[cut: only the first 33554432 bytes of this file were read]
<?xml version="1.0" encoding="utf-8"?>
<posts>
  <row Id="1" PostTypeId="1" AcceptedAnswerId="4" CreationDate="2014-09-23T18:18:10.547" Score="124" ViewCount="23369" Body="&lt;p&gt;I've normally used &lt;code&gt;~/.emacs&lt;/code&gt; for my config file, but I've noticed others using &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. Are there advantages to the &lt;code&gt;init.el&lt;/code&gt; location? Any disadvantages?&lt;/p&gt;&#xA;" OwnerUserId="14" LastEditorUserId="253" LastEditDate="2014-11-18T20:56:44.313" LastActivityDate="2019-09-16T19:07:46.020" Title="Are there any advantages to using ~/.emacs.d/init.el instead of ~/.emacs?" Tags="|init-file|" AnswerCount="6" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2" PostTypeId="1" AcceptedAnswerId="5" CreationDate="2014-09-23T18:38:48.913" Score="28" ViewCount="2262" Body="&lt;p&gt;I work on many different C projects with unique indentation styles. How do I get Emacs to do per-project indentation settings without polluting the upstream project trees with &lt;code&gt;.dir-locals.el&lt;/code&gt; files? I want to match the projects using their paths on disk.&lt;/p&gt;&#xA;" OwnerUserId="24" LastActivityDate="2015-07-26T03:06:00.970" Title="Different indentation styles for different projects" Tags="|indentation|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3" PostTypeId="2" ParentId="2" CreationDate="2014-09-23T18:45:25.613" Score="2" Body="&lt;p&gt;The normal way to do it is using &lt;code&gt;.dir-locals&lt;/code&gt;. This is why they were introduced in the first place. Why not? To my knowledge, most of project-related tools tend to keep their configs in the root project directory: git, svn, Eclipse and many others…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just don't forget to add the file to &lt;code&gt;.gitignore&lt;/code&gt; or similar. &lt;/p&gt;&#xA;" OwnerUserId="27" LastEditorUserId="25" LastEditDate="2014-09-24T12:55:57.127" LastActivityDate="2014-09-24T12:55:57.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4" PostTypeId="2" ParentId="1" CreationDate="2014-09-23T18:56:50.803" Score="116" Body="&lt;p&gt;Yes, there are. Quoting &lt;a href=&quot;http://www.reddit.com/r/emacs/comments/1xdoyq/trouble_running_emacs_eval_from_puppet/cfdcje3&quot; rel=&quot;noreferrer&quot;&gt;lunaryorn on Reddit&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It keeps the &lt;code&gt;$HOME&lt;/code&gt; directory uncluttered, because all of Emacs' files are neatly contained in a single directory. For the same reason, all modern Emacs packages write their caches, histories, etc. into &lt;code&gt;~/.emacs.d/&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It makes version control easier, especially if you split your init.el into different files in &lt;code&gt;~/.emacs.d&lt;/code&gt;. You can just commit &lt;code&gt;init.el&lt;/code&gt; like every other file, and &lt;code&gt;git clone /my/emacs/config.git ~/.emacs.d&lt;/code&gt; on a new system gives you all of your Emacs configuration, without having to link a file into &lt;code&gt;$HOME&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-09-23T19:57:11.640" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5" PostTypeId="2" ParentId="2" CreationDate="2014-09-23T18:58:37.797" Score="21" Body="&lt;p&gt;&lt;code&gt;.dir-locals.el&lt;/code&gt; is my preferred method when it's possible, especially as it applies to all Emacs users working on that project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For projects that are hostile to Emacs users or otherwise don't want &lt;code&gt;.dir-locals.el&lt;/code&gt; files, or if you want to have personal preferences (presumably not indentation) that shouldn't apply to other people, if you use a distributed version control system, an option is to always work on personal branches that have your &lt;code&gt;.dir-locals.el&lt;/code&gt;. I don't know of a way to use a DCVS that makes this painless, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is to not check in the &lt;code&gt;.dir-locals.el&lt;/code&gt; files. For example, with git, add it to &lt;code&gt;.git/info/exclude&lt;/code&gt;. That's painful when you have many checkouts of a project, of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I've done where &lt;code&gt;.dir-locals.el&lt;/code&gt; wasn't an option is to add a hook that looks up &lt;code&gt;buffer-file-name&lt;/code&gt; against known values.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar guessed-project nil)&#xA;(make-variable-buffer-local 'guessed-project)&#xA;(defun guess-project-from-file-name ()&#xA;  (save-match-data&#xA;    (setq guessed-project&#xA;          (cond&#xA;           ((string-match &quot;/linux-kernel/&quot; buffer-file-name)&#xA;            'linux-kernel)&#xA;           ((string-match &quot;/gnu/&quot; buffer-file-name)&#xA;            'gnu)&#xA;           ; etc.&#xA;          ))))&#xA;(defun c-my-project-hook ()&#xA;  (guess-project-from-file-name)&#xA;  (case guessed-project&#xA;    ((gnu) (c-sty-style 'gnu))&#xA;    ((linux-kernel) (c-sty-style 'linux))&#xA;  ))&#xA;(add-hook 'c-mode-hook 'c-my-project-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Warning: code typed directly into my browser as I don't have access to my real code right now.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-09-23T22:04:50.227" LastActivityDate="2014-09-23T22:04:50.227" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="6" PostTypeId="2" ParentId="1" CreationDate="2014-09-23T19:21:15.370" Score="25" Body="&lt;p&gt;If all you need to set up Emacs the way you like is an init  file, it doesn't make a difference if it's &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. But it makes sense to create a directory the moment you start splitting your init file, or adding Emacs-related configs, a Cask file for example. Also, it's the place where you'll save the file with abbrev definitions, the file for custom options (&lt;code&gt;M-x customize&lt;/code&gt;), etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep everything neatly tucked in &lt;code&gt;~/.emacs.d&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="31" LastEditorUserId="25" LastEditDate="2014-09-23T22:14:53.320" LastActivityDate="2014-09-23T22:14:53.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7" PostTypeId="1" AcceptedAnswerId="8" CreationDate="2014-09-23T19:37:55.753" Score="8" ViewCount="1106" Body="&lt;p&gt;Say you have code on lines 4, 5, 6. Then you want to move this block of code to starting point line 9 while also deleting lines 4, 5, 6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the fastest way, i.e. least amount of key strokes, to achieve this? Would a custom function be better suited?&lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="25" LastEditDate="2014-10-22T20:44:23.087" LastActivityDate="2014-10-22T20:44:23.087" Title="Fastest way to move code block to specific line" Tags="|copy-paste|editing|yank|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8" PostTypeId="2" ParentId="7" CreationDate="2014-09-23T19:52:09.323" Score="6" Body="&lt;p&gt;Starting at the beginning of line 4 (&lt;code&gt;ESC 4 ESC g g&lt;/code&gt; or &lt;code&gt;M-4 M-g M-g&lt;/code&gt; to go there), &lt;code&gt;C-3 C-k C-2 C-n C-y&lt;/code&gt; (or &lt;code&gt;ESC 3 C-k down down C-y&lt;/code&gt; if you don't like holding modifiers down) will do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to do the arithmetic in your head, but instead select lines visually, then&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Move to the beginning of the zone to move&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-SPC&lt;/code&gt; to set the mark&lt;/li&gt;&#xA;&lt;li&gt;Move down to the beginning of the first line to keep&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-w&lt;/code&gt; to cut&lt;/li&gt;&#xA;&lt;li&gt;Move down to the place where you want to insert the cut text&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y&lt;/code&gt; to paste&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I don't think there's any way to make this shorter unless you're willing to lose some flexibility (for example, if you often want to move a block of exactly three lines). You need to provide three locations: the beginning of the block to move, the end of the block to move, and the destination. In the sequences above, there is a single keystroke at each location, which is as low as it gets.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-09-23T19:52:09.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9" PostTypeId="1" AcceptedAnswerId="14" CreationDate="2014-09-23T20:03:34.297" Score="5" ViewCount="8555" Body="&lt;p&gt;I want to be able to search for some text and navigate quickly between the occurrences. What is a convenient way to search for some text, view all the occurrences, and jump quickly to the next/previous occurrence?&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2014-09-29T21:42:14.663" LastActivityDate="2015-08-21T12:57:10.430" Title="Search for text and navigate between the occurrences" Tags="|search|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10" PostTypeId="2" ParentId="9" CreationDate="2014-09-23T20:03:34.297" Score="4" Body="&lt;p&gt;Press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;S&lt;/kbd&gt; (&lt;code&gt;isearch-forward&lt;/code&gt;), then type your text. Emacs will search as you type. To find the next occurrence, press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;S&lt;/kbd&gt; again. To go to previous occurrence, press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;R&lt;/kbd&gt;. To stop, press &lt;kbd&gt;Enter ↵&lt;/kbd&gt; to leave the cursor there. Or type &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;G&lt;/kbd&gt; to return to the spot before search was started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This command is also under the menu &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;S&lt;/kbd&gt; twice will search your last searched word.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="7" LastEditDate="2014-10-05T18:55:24.970" LastActivityDate="2014-10-05T18:55:24.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11" PostTypeId="1" AcceptedAnswerId="12" CreationDate="2014-09-23T20:14:06.120" Score="45" ViewCount="10007" Body="&lt;p&gt;I have the code below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hello&#xA;There&#xA;I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And want to add code in front of it, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I said Hello&#xA;I said There&#xA;I said I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how would I add a prefix to each line? &lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2014-12-25T00:22:45.740" LastActivityDate="2014-12-25T00:22:45.740" Title="How to add a prefix to every line?" Tags="|text-editing|editing|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12" PostTypeId="2" ParentId="11" CreationDate="2014-09-23T20:17:18.773" Score="58" Body="&lt;p&gt;You can add a prefix with &lt;code&gt;M-x string-rectangle&lt;/code&gt;, which is bound to &lt;code&gt;C-x r t&lt;/code&gt;.&#xA;This is part of a series of commands that operates on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html&quot;&gt;&lt;em&gt;rectangular selections&lt;/em&gt;&lt;/a&gt;; this one inserts text at every line in the rectangle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start by setting the mark at the beginning of the first line, and move your cursor to the &lt;em&gt;first&lt;/em&gt; character of the last line you want to prefix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*Hello&#xA; There&#xA;▮I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use &lt;code&gt;C-x r t&lt;/code&gt;, enter your prefix (&lt;code&gt;I said&lt;/code&gt;) and press &lt;code&gt;RET&lt;/code&gt;. This adds the text to each line in the rectangle:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I said Hello&#xA;I said There&#xA;I said I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't line up your cursor on the same column as your mark, it will overwrite that part of the rectangle:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*Hello&#xA; There&#xA; I am▮ some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the same command results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I said o&#xA;I said e&#xA;I said  some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17" LastEditorUserId="105" LastEditDate="2014-10-23T23:36:32.263" LastActivityDate="2014-10-23T23:36:32.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13" PostTypeId="2" ParentId="11" CreationDate="2014-09-23T20:20:37.547" Score="34" Body="&lt;p&gt;You could use &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot;&gt;multiple-cursors-mode&lt;/a&gt;, to put a cursor on every line.  Then, any text you type will be inserted on each line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would start out with the point at the beginning of the piece of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮Hello&#xA; There&#xA; I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then hit &lt;kbd&gt;C-&gt;&lt;/kbd&gt; twice.  (This is the suggested key binding; you have to set it up yourself.)  This creates two extra cursors on the following two lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮Hello&#xA;▮There&#xA;▮I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then type &lt;code&gt;I said&lt;/code&gt;.  The text will be added on each line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I said ▮Hello&#xA;I said ▮There&#xA;I said ▮I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally hit &lt;kbd&gt;RET&lt;/kbd&gt; to exit multiple cursors mode and leave point at the last cursor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I said Hello&#xA;I said There&#xA;I said ▮I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsrocks.com/e13.html&quot;&gt;Here&lt;/a&gt; is a video that shows how it works.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="11" LastEditDate="2014-09-24T09:46:59.860" LastActivityDate="2014-09-24T09:46:59.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14" PostTypeId="2" ParentId="9" CreationDate="2014-09-23T20:22:59.753" Score="22" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Search.html#Search&quot;&gt;manual&lt;/a&gt; is your friend!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic search capability is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Incremental-Search.html#Incremental-Search&quot;&gt;incremental search&lt;/a&gt;. Press &lt;code&gt;C-s&lt;/code&gt; and enter the string to search (&lt;code&gt;C-r&lt;/code&gt; to search backwards). &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Repeat-Isearch.html#Repeat-Isearch&quot;&gt;Press &lt;code&gt;C-s&lt;/code&gt;/&lt;code&gt;C-r&lt;/code&gt; again&lt;/a&gt; to go to the next/previous occurrence. Any command other than typing text, backspace and a few others exits search mode; in particular, press &lt;code&gt;RET&lt;/code&gt; to continue editing where the occurrence was found or &lt;code&gt;C-g&lt;/code&gt; to go back to the starting point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;C-s C-s&lt;/code&gt; to repeat the previous search (&lt;code&gt;C-r C-r&lt;/code&gt; to repeat it backwards). After entering incrementatl search mode with &lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;C-r&lt;/code&gt;, press &lt;code&gt;M-p&lt;/code&gt;/&lt;code&gt;M-n&lt;/code&gt; to browse the search history (previous/next). Press &lt;code&gt;C-s C-w&lt;/code&gt; to search for the word under the cursor (and other &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Isearch-Yank.html#Isearch-Yank&quot;&gt;similar commands&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-M-s&lt;/code&gt; or &lt;code&gt;C-M-r&lt;/code&gt; to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Search.html#Regexp-Search&quot;&gt;search for a regular expression&lt;/a&gt; instead of a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want an overview of all the occurrences of a string (or more generally a regular expression), &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html#index-mode_002c-Occur-878&quot;&gt;&lt;code&gt;M-x occur&lt;/code&gt;&lt;/a&gt; is your friend. It shows a list of matching lines in a separate buffer. In the &lt;code&gt;*Occur*&lt;/code&gt; buffer, press &lt;code&gt;RET&lt;/code&gt; or the middle mouse button to jump to the corresponding line in the original buffer. See the manual for commands that search multiple buffers.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-09-23T20:22:59.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15" PostTypeId="1" AcceptedAnswerId="22" CreationDate="2014-09-23T20:26:31.800" Score="29" ViewCount="3998" Body="&lt;p&gt;Is there a built-in command to delete the contents of a cell in a single keystroke within an org-mode table? Note, I don't want to delete the row, just the cell contents.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; | some text |  ==&amp;gt; |             |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If not, how would you write this?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="14825" LastEditDate="2022-11-05T01:27:18.000" LastActivityDate="2022-11-05T01:27:18.000" Title="How to clear a cell in an org-mode table?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16" PostTypeId="1" CreationDate="2014-09-23T20:31:23.283" Score="5" ViewCount="259" Body="&lt;p&gt;This is most likely a problem with a plugin (caching options, using LRU, etc?), but I'm not good enough to really troubleshoot it. My complete dotfiles (not very extensive) can be found &lt;a href=&quot;https://github.com/Trevoke/dotfiles/tree/master/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the following related plugins (and maybe others, but I'm not sure):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;flx-ido&lt;/li&gt;&#xA;&lt;li&gt;smex&lt;/li&gt;&#xA;&lt;li&gt;ido-ubiquitous&lt;/li&gt;&#xA;&lt;li&gt;ido-vertical-mode&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What seems to be happening is the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I press &lt;code&gt;C-x C-m&lt;/code&gt; (globally bound to &lt;code&gt;'smex&lt;/code&gt;) &lt;/li&gt;&#xA;&lt;li&gt;I type &lt;code&gt;lt&lt;/code&gt; which finds &lt;code&gt;load-theme&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;I choose a theme&lt;/li&gt;&#xA;&lt;li&gt;Everything works&lt;/li&gt;&#xA;&lt;li&gt;I press &lt;code&gt;C-x C-m&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;I type &lt;code&gt;ruby&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;I see absolutely nothing in the list&lt;/li&gt;&#xA;&lt;li&gt;I type &lt;code&gt;C-g&lt;/code&gt; to get out of it&lt;/li&gt;&#xA;&lt;li&gt;I type &lt;code&gt;C-x C-m&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;I type &lt;code&gt;ruby&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;I see a lot of ruby options&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I should see a host of ruby-related things, including for instance &lt;code&gt;ruby-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="61" LastEditDate="2014-09-24T12:04:19.443" LastActivityDate="2014-09-25T01:28:24.600" Title="M-x sometimes doesn't show me the right options (smex?)" Tags="|ido|m-x|flx-ido|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17" PostTypeId="1" AcceptedAnswerId="100" CreationDate="2014-09-23T20:33:58.910" Score="19" ViewCount="899" Body="&lt;p&gt;I'm using Helm to perform completions for my interactive commands, but it only lets me cycle through those commands which I have used in the past (i.e. 4 Candidate(s)). I don't want this behavior, instead, when pressing C-n/C-p it should cycle across all pattern matched commands. How do I change this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sMRZ5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="105" LastEditDate="2015-03-27T19:23:38.880" LastActivityDate="2015-03-27T19:23:38.880" Title="How to scroll through all available matching interactive (M-x) commands using Helm rather than just my history?" Tags="|helm|cycling|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18" PostTypeId="1" AcceptedAnswerId="19" CreationDate="2014-09-23T20:34:36.900" Score="23" ViewCount="7587" Body="&lt;p&gt;I recently asked:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/11/how-to-add-a-prefix-to-every-line&quot;&gt;How to add a prefix to every line?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So go from the code below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I said Hello&#xA;I said There&#xA;I said I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To code like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hello&#xA;There&#xA;I am some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, how do I delete n number of characters from a line?&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-10-27T03:11:45.487" Title="How to delete the first few n chars of every line?" Tags="|text-editing|editing|" AnswerCount="6" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19" PostTypeId="2" ParentId="18" CreationDate="2014-09-23T20:47:57.613" Score="34" Body="&lt;p&gt;It's even easier! Again, use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html#Rectangles&quot;&gt;rectangle commands&lt;/a&gt;. Move to one corner of the rectangle you want to delete, press &lt;code&gt;C-SPC&lt;/code&gt; to set the mark. Move to the other corner of the rectangle and press &lt;code&gt;C-x r d&lt;/code&gt; (&lt;code&gt;delete-rectangle&lt;/code&gt;). For example, move to the first line you want to act on, press &lt;code&gt;C-a&lt;/code&gt; or &lt;code&gt;home&lt;/code&gt; to go to the beginning of the line, move down to the last line you want to act on, &lt;code&gt;C-u &lt;em&gt;number&lt;/em&gt; C-f&lt;/code&gt; to move to the bottom right corner, and then &lt;code&gt;C-x r d&lt;/code&gt; to delete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the last line has fewer than the desired number of characters, it may be more convenient to use the bottom left and top right corners instead. Alternatively, you can insert junk characters (this is useful if both the first line and the last line are shorter).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;C-x r k&lt;/code&gt; to kill the rectangle, which allows you to yank (&lt;code&gt;C-x r y&lt;/code&gt;) it later (move to the upper left corner of the place where you want to insert it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;C-x r t&lt;/code&gt; (&lt;code&gt;string-rectangle&lt;/code&gt;) and enter an empty string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rectangle commands are based on column positions. If you want to delete n characters, rather than n columns (which makes a difference with multi-column characters such as tabs), you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Replace.html#Replace&quot;&gt;regular expression replacement&lt;/a&gt;: replace &lt;code&gt;^.\{42\}&lt;/code&gt; by nothing to delete the first 42 characters of every line.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-09-23T20:47:57.613" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20" PostTypeId="1" AcceptedAnswerId="23" CreationDate="2014-09-23T20:50:17.730" Score="46" ViewCount="15618" Body="&lt;p&gt;If I accidentally closed the scratch buffer in Emacs, how do I create a new scratch buffer?&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2014-09-23T21:07:05.710" LastActivityDate="2014-10-20T02:21:42.690" Title="Re-open *scratch* buffer" Tags="|buffers|scratch-buffer|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21" PostTypeId="2" ParentId="20" CreationDate="2014-09-23T20:51:34.220" Score="9" Body="&lt;p&gt;GNU Emacs default bindings:&lt;/p&gt;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;b&lt;/kbd&gt;&lt;code&gt;*scratch*&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;or, more verbosely&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;switch-to-buffer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Typing: &lt;code&gt;*scratch*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;And then hitting the &lt;kbd&gt;RET&lt;/kbd&gt; key.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The &lt;code&gt;*scratch*&lt;/code&gt; buffer is the buffer selected upon startup, and has the major mode &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Interaction.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lisp Interaction&lt;/a&gt;.  Note: the mode for the &lt;code&gt;*scratch*&lt;/code&gt; buffer is controlled by the variable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Entering-Emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;initial-major-mode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;In general you can create as many &amp;quot;scratch&amp;quot; buffers as you want, and name them however you choose.&lt;/p&gt;&#xA;&lt;p&gt;&lt;kbd&gt;C-x &lt;/kbd&gt;&lt;kbd&gt;b&lt;/kbd&gt;&lt;code&gt;NAME&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;switches to buffer &lt;code&gt;NAME&lt;/code&gt;, creating it if it doesn't exist. A new buffer is not associated with a file on disk until you use &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-w&lt;/kbd&gt; (or &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;write-file&lt;/code&gt;) to choose a file where it should be saved.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;text-mode&lt;/code&gt; changes the current buffer's major mode to Text mode.&lt;/p&gt;&#xA;&lt;p&gt;To find all the modes available (that is, without requiring any new packages), you can get a list by typing:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;apropos-command&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then type: &lt;code&gt;-mode$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;And then press &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-20T02:21:42.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22" PostTypeId="2" ParentId="15" CreationDate="2014-09-23T20:53:54.883" Score="40" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Built_002din-table-editor.html#index-C_002dc-SPC-267&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-table-blank-field&lt;/code&gt;&lt;/a&gt;, present in the “Tbl” menu.&lt;/p&gt;&#xA;&lt;p&gt;It used to be bound to &lt;code&gt;C-c SPC&lt;/code&gt;, but &lt;a href=&quot;https://github.com/bzg/org-mode/blob/main/etc/ORG-NEWS#the-keybinding-for-org-table-blank-field-has-been-removed&quot; rel=&quot;nofollow noreferrer&quot;&gt;version 9.5&lt;/a&gt; removed that default binding.&lt;/p&gt;&#xA;&lt;p&gt;It's been around at least since version 6.01 in 2008, but for some reason it was only &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=9aa58fa&quot; rel=&quot;nofollow noreferrer&quot;&gt;added&lt;/a&gt; to the manual &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-11/msg00493.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;as a consequence of this question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2021-12-15T15:10:14.287" LastActivityDate="2021-12-15T15:10:14.287" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="23" PostTypeId="2" ParentId="20" CreationDate="2014-09-23T21:05:27.847" Score="52" Body="&lt;p&gt;Just re-create the buffer by switching to it: &lt;code&gt;C-x b *scratch* RET&lt;/code&gt;. Since Emacs 21.2, if you create a buffer called &lt;code&gt;*scratch*&lt;/code&gt;, it's automatically put in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Interaction.html#Lisp-Interaction&quot;&gt;Lisp Interaction mode&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-09-23T21:14:39.120" LastActivityDate="2014-09-23T21:14:39.120" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24" PostTypeId="2" ParentId="7" CreationDate="2014-09-23T21:08:30.063" Score="3" Body="&lt;p&gt;You could use &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow&quot;&gt;expand-region&lt;/a&gt; to mark the block, if it is a semantic unit, like a function (The package's website explains this in more detail). Then moving it around as the other response explains. Depending on where you are in the block, a single keystroke can mark the whole thing. &lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2014-09-23T21:15:34.617" LastActivityDate="2014-09-23T21:15:34.617" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25" PostTypeId="2" ParentId="11" CreationDate="2014-09-23T21:16:16.093" Score="29" Body="&lt;p&gt;Personally, I prefer &lt;code&gt;replace-regexp&lt;/code&gt; (replace &quot;^&quot; with &quot;I said &quot;).&lt;/p&gt;&#xA;" OwnerUserId="24" LastActivityDate="2014-09-23T21:16:16.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26" PostTypeId="1" AcceptedAnswerId="51" CreationDate="2014-09-23T21:18:25.277" Score="14" ViewCount="4552" Body="&lt;p&gt;I've gotten the Emacs daemon to work through the command line using the &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsAsDaemon&quot;&gt;EmacsWiki page&lt;/a&gt;, but I'm stuck on how to get the client to run through the Gnome 3 launcher. How can I set up a &lt;a href=&quot;https://developer.gnome.org/integration-guide/stable/desktop-files.html.en&quot;&gt;Gnome desktop file&lt;/a&gt; that launches a GUI window that connects to the Emacs daemon?&lt;/p&gt;&#xA;" OwnerUserId="75" LastEditorUserId="184" LastEditDate="2015-05-28T15:10:39.750" LastActivityDate="2017-11-24T17:02:30.177" Title="Using daemon mode in Gnome 3" Tags="|emacsclient|daemon|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27" PostTypeId="1" AcceptedAnswerId="893" CreationDate="2014-09-23T21:20:43.050" Score="46" ViewCount="4422" Body="&lt;p&gt;I often use TRAMP to manage several remote servers, both for editing files and running remote shells in &lt;code&gt;shell-mode&lt;/code&gt;. However, this does not work when a command uses the &lt;code&gt;EDITOR&lt;/code&gt; variable to edit a file, such as &lt;code&gt;crontab -e&lt;/code&gt; especially because &lt;code&gt;shell-mode&lt;/code&gt; is a &quot;dumb&quot; terminal that does not support running another editor inside of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Locally, I do this with an appropriate call to &lt;code&gt;emacsclient&lt;/code&gt; which opens up a new buffer and makes life very easy. Unfortunately, this does not work from the remote machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I could use &lt;code&gt;ed&lt;/code&gt;. (Hah!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set up a remote &lt;code&gt;EDITOR&lt;/code&gt; that would let me edit files with my local Emacs instance?&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2017-10-10T18:48:44.337" Title="How can I use my local Emacs client as the $EDITOR for remote machines I access over TRAMP?" Tags="|emacsclient|tramp|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28" PostTypeId="1" AcceptedAnswerId="38" CreationDate="2014-09-23T21:23:14.890" Score="15" ViewCount="4833" Body="&lt;p&gt;I inherited my .emacs file from a friend about 18 years ago.  Buried in the middle is the following ominous comment warning about the security implications of the &lt;code&gt;enable-local-variables&lt;/code&gt; feature:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Date: Wed, 7 Dec 1994 11:57:50 -0600&#xA;;; From: blob@syl.dl.nec.com (David Blob)&#xA;;; Subject: Self-extracting emacs elisp code&#xA;;;&#xA;;; With all this talk about self extracting mail &quot;viruses&quot;, a friend&#xA;;; showed me that in emacs (which I use to read mail, along with vm)&#xA;;; has the ability to self-extract elisp code. This feature seems to&#xA;;; be turned on by default, and it not only applies to mail read with&#xA;;; emacs, but rather every file visited (when the feature is on, of&#xA;;; course).&#xA;;;&#xA;;; The way it works is by having a line which reads &quot;Local Variables:&quot;&#xA;;; followed by the lisp variables you would like to set...well, it may&#xA;;; seem petty, but you can execute programs, make connections and much&#xA;;; more through cleverly written elisp code contained within.&#xA;;;&#xA;;; It's simple to turn off, at any rate...&#xA;;;&#xA;;; (setq enable-local-variables  f) ;; turns off feature  (in emacs 19)&#xA;;; (setq enable-local-variables  1) ;; makes it ask first (in emacs 19)&#xA;;; (setq inhibit-local-variables t) ;; turns off feature  (in emacs 18)&#xA;;;&#xA;;; Anyhow, I think the risks here speak for themselves...&#xA;;;&#xA;(setq enable-local-variables '())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I've never actually used the &lt;code&gt;local-variables&lt;/code&gt; feature even though it seems like it could be pretty useful.  Is there a way to &lt;code&gt;enable-local-variables&lt;/code&gt; that does something useful without exposing me to arbitrary code-injection attacks?&lt;/p&gt;&#xA;" OwnerUserId="83" LastEditorUserId="25" LastEditDate="2014-09-23T21:59:08.297" LastActivityDate="2014-09-23T21:59:08.297" Title="Safe way to `enable-local-variables`?" Tags="|security|file-local-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29" PostTypeId="2" ParentId="7" CreationDate="2014-09-23T21:24:12.233" Score="2" Body="&lt;p&gt;If you're using &lt;code&gt;evil-mode&lt;/code&gt;, you can alternatively use an &lt;code&gt;ex&lt;/code&gt; command: &lt;code&gt;:4,6m9&lt;/code&gt; (which &lt;code&gt;m&lt;/code&gt;oves lines &lt;code&gt;4&lt;/code&gt; to &lt;code&gt;6&lt;/code&gt; to line &lt;code&gt;9&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-23T21:24:12.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30" PostTypeId="2" ParentId="28" CreationDate="2014-09-23T21:30:23.510" Score="10" Body="&lt;p&gt;Emacs is pretty safe when it comes to local variables. It does not actually evaluate anything for file- or directory-local variables, it only parses Lisp syntax. Also, a variable has to be declared &quot;safe&quot; before it will be set by Emacs, and that declaration also includes a predicate. So a variable can say &quot;a file may set this, but only if it is a string&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that you can safely enable local variables. You can actually just leave the default value of &lt;code&gt;t&lt;/code&gt; – Emacs will ask you about whether it should set variables that it does not deem safe, and you can examine those first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure you do &lt;em&gt;not&lt;/em&gt; set this variable to &lt;code&gt;:all&lt;/code&gt;, and &lt;em&gt;do&lt;/em&gt; look at the values of variables first before setting them if Emacs asks you. You can use &lt;code&gt;:safe&lt;/code&gt; to only set variables that Emacs deems safe and ignore the rest, but you can miss out on some stuff this way.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-09-23T21:30:23.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31" PostTypeId="2" ParentId="2" CreationDate="2014-09-23T21:31:58.600" Score="7" Body="&lt;p&gt;You can't convince upstream projects like llvm and linux to check in a &lt;code&gt;.dir-locals.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An elaborate solution to the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro define-new-c-style (name derived-from style-alist match-path)&#xA;  `(progn&#xA;     (c-add-style ,name&#xA;                  '(,derived-from ,@style-alist))&#xA;     (add-hook 'c-mode-hook&#xA;               (lambda ()&#xA;                 (let ((filename (buffer-file-name)))&#xA;                   (when (and filename&#xA;                              (string-match (expand-file-name ,match-path) filename))&#xA;                     (c-set-style ,name)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Used as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-new-c-style &quot;llvm&quot; &quot;gnu&quot; ((fill-column . 80)&#xA;                                  (c++-indent-level . 2)&#xA;                                  (c-offsets-alist . ((innamespace 0))))&#xA;  &quot;~/src/llvm&quot;)&#xA;&#xA;(define-new-c-style &quot;emacs&quot; &quot;gnu&quot; nil &quot;~/src/emacs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a similar macro for other language modes as well.&lt;/p&gt;&#xA;" OwnerUserId="24" LastActivityDate="2014-09-23T21:31:58.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33" PostTypeId="1" AcceptedAnswerId="34" CreationDate="2014-09-23T21:35:31.330" Score="22" ViewCount="12010" Body="&lt;p&gt;How can I set up Emacs so that all backups are placed into one backup folder? e.g. &lt;code&gt;/MyEmacsBackups&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-09-23T22:01:42.877" LastActivityDate="2023-04-27T16:35:15.763" Title="Put all backups into one backup folder" Tags="|backup|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34" PostTypeId="2" ParentId="33" CreationDate="2014-09-23T21:38:01.303" Score="25" Body="&lt;p&gt;Check out &lt;code&gt;backup-directory-alist&lt;/code&gt;, which allows you to set backup locations by file regexp. To have everything go to one directory, try something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/MyEmacsBackups&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the truly paranoid (like myself), there's also &lt;a href=&quot;http://www.emacswiki.org/emacs/backup-each-save.el&quot;&gt;backup-each-save&lt;/a&gt;, which (as the name suggests) backs up your files each time they're saved in a convenient location. This gives an extra layer of protection over traditional version control, for instance for those cases when you accidentally clear your working directory without checking something in.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-09-23T22:46:13.600" LastActivityDate="2014-09-23T22:46:13.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36" PostTypeId="2" ParentId="33" CreationDate="2014-09-23T21:40:23.170" Score="21" Body="&lt;p&gt;The following is a quick code from my &lt;code&gt;.emacs&lt;/code&gt;. It does not only put backups into a specific directory, but also auto-saves, and does the same for Tramp files so those are not put onto the remote system.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Put backup files neatly away&#xA;(let ((backup-dir &amp;quot;~/tmp/emacs/backups&amp;quot;)&#xA;      (auto-saves-dir &amp;quot;~/tmp/emacs/auto-saves/&amp;quot;))&#xA;  (dolist (dir (list backup-dir auto-saves-dir))&#xA;    (when (not (file-directory-p dir))&#xA;      (make-directory dir t)))&#xA;  (setq backup-directory-alist `((&amp;quot;.&amp;quot; . ,backup-dir))&#xA;        auto-save-file-name-transforms `((&amp;quot;.*&amp;quot; ,auto-saves-dir t))&#xA;        auto-save-list-file-prefix (concat auto-saves-dir &amp;quot;.saves-&amp;quot;)&#xA;        tramp-backup-directory-alist `((&amp;quot;.*&amp;quot; . ,backup-dir))&#xA;        tramp-auto-save-directory auto-saves-dir))&#xA;&#xA;(setq backup-by-copying t    ; Don't delink hardlinks&#xA;      delete-old-versions t  ; Clean up the backups&#xA;      version-control t      ; Use version numbers on backups,&#xA;      kept-new-versions 5    ; keep some new versions&#xA;      kept-old-versions 2)   ; and some old ones, too&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="90" LastEditorUserId="28451" LastEditDate="2023-04-27T16:35:15.763" LastActivityDate="2023-04-27T16:35:15.763" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="37" PostTypeId="2" ParentId="1" CreationDate="2014-09-23T21:42:25.093" Score="39" Body="&lt;p&gt;One additional advantage: if everything is in &lt;code&gt;.emacs.d&lt;/code&gt;, you can keep your Emacs configuration on Dropbox (or an alternative) and symlink the whole configuration to your home directory. That makes syncing across computers trivial.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-23T21:42:25.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="38" PostTypeId="2" ParentId="28" CreationDate="2014-09-23T21:45:56.977" Score="18" Body="&lt;p&gt;18 years ago, you were right to be worried. But time has marched on. Since Emacs 22, there is a decent built-in mechanism to whitelist safe local variables. The details are documented in the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Local-Variables.html#File-Local-Variables&quot;&gt;Emacs Lisp&lt;/a&gt; manual. The most important aspects are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Lisp authors can declare safe values for each variable. This is a whitelist: if the Lisp programmer hasn't done anything special, all values are considered unsafe.&lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;enable-local-variables&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt; (the default), Emacs will automatically set safe values and prompt for confirmation if a file attempts to set an unsafe value. Once the user has approved a value for a given variable, this is automatically recorded and Emacs will not ask again about the same value for the same variable.&lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;enable-local-variables&lt;/code&gt; is set to &lt;code&gt;:safe&lt;/code&gt;, Emacs will automatically set safe values and ignore the others.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So you can keep the default setting if you don't mind being prompted, or use&#xA;&lt;code&gt;(setq enable-local-variables :safe)&lt;/code&gt; to get the common benefits (indent style, timestamp format, etc.) with no risk and no user interface encroachment.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-09-23T21:45:56.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="39" PostTypeId="2" ParentId="33" CreationDate="2014-09-23T21:47:10.663" Score="4" Body="&lt;pre&gt;&lt;code&gt;;; put all backup files into ~/MyEmacsBackups&#xA;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/MyEmacsBackups&quot;)))&#xA;(setq backup-by-copying t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="87" LastEditorUserId="25" LastEditDate="2014-09-23T22:14:40.083" LastActivityDate="2014-09-23T22:14:40.083" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="40" PostTypeId="2" ParentId="27" CreationDate="2014-09-23T21:48:19.780" Score="0" Body="&lt;p&gt;Might require a bit of tweaking, but here's the idea:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EDITOR=&quot;ssh artagnon@luneth \&quot;emacsclient -n /`hostname`:$1\&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24" LastEditorUserId="104" LastEditDate="2014-09-24T04:27:29.383" LastActivityDate="2014-09-24T04:27:29.383" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="41" PostTypeId="1" AcceptedAnswerId="59" CreationDate="2014-09-23T21:49:51.340" Score="14" ViewCount="3633" Body="&lt;p&gt;Typically I start emacs with the GUI, and start a server right away with &lt;code&gt;(server-start)&lt;/code&gt;.  Now I can easily open documents into my existing emacs session from terminal via &lt;code&gt;emacsclient -n &amp;lt;file&amp;gt;&lt;/code&gt;, or from the File Browser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From time to time, however, I want to run emacs inside my terminal using &lt;code&gt;emacsclient -t&lt;/code&gt;.  This happens most often when writing git commit logs or performing other very small tasks. In those instances, the fact that my init file was loaded in a GUI instance of emacs means that I don't get any of my customizations that are specific to TTY emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -nw -q -l &quot;some-custom-init-file.el&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that will reload all of the packages every time. Can I have the best of both worlds? Is there a way to set up a &quot;TTY daemon&quot; so that I can use separate customizations for running inside the terminal versus visiting the file in an existing emacs window?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2017-06-17T13:22:48.907" Title="Start two separate emacs daemons for console and GUI" Tags="|daemon|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="42" PostTypeId="1" AcceptedAnswerId="99" CreationDate="2014-09-23T21:59:43.517" Score="9" ViewCount="360" Body="&lt;p&gt;I find jabber to be a fantastic tool, but it worries me a little that my password is written in plain text in my init file.&lt;br&gt;&#xA;&lt;strong&gt;Is there a way to configure my jabber login credentials without writing them in plain text?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to be clear, I don't want to be asked for a password either. So the solution would need to hook into some external keyring/database or just do some encrypting to obscure the password.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, the solution would be OS independent, but my priority is getting it to work on Linux (with gnome) which is where I use jabber the most.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="25" LastEditDate="2015-06-07T21:55:15.307" LastActivityDate="2015-06-07T21:55:15.307" Title="Configure jabber without writing password in plain text" Tags="|security|passwords|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="44" PostTypeId="2" ParentId="9" CreationDate="2014-09-23T22:00:58.307" Score="10" Body="&lt;p&gt;Instead of just providing a link to the manual section section about searching, the real &quot;&lt;em&gt;the manual is your friend&lt;/em&gt;&quot; answer is to tell you &lt;strong&gt;how to look this up in the manual yourself&lt;/strong&gt;: &lt;code&gt;C-h r i searching RET&lt;/code&gt; or &lt;code&gt;C-h r i search TAB ing RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone is really at this basic a level with Emacs, then the real question is &lt;strong&gt;how to look something up in the manual&lt;/strong&gt;, and the answer is &lt;code&gt;C-h r i&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is self-documenting. &lt;em&gt;Start&lt;/em&gt; by &lt;strong&gt;asking Emacs&lt;/strong&gt;, not Stack Exchange. To learn to ask Emacs, start with &lt;code&gt;C-h C-h&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-23T22:00:58.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="45" PostTypeId="2" ParentId="11" CreationDate="2014-09-23T22:02:32.350" Score="15" Body="&lt;p&gt;Another option is to use macros, which can handle more tasks than rectangular selections or multiple cursors, even if it's a little clunkier for this specific case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Position the cursor at the beginning of the first line and hit &lt;kbd&gt;F3&lt;/kbd&gt; to start recording, insert the text, move the cursor to the beginning of the next line and hit &lt;kbd&gt;F4&lt;/kbd&gt; to stop recording. Now hit &lt;kbd&gt;F4&lt;/kbd&gt; again to repeat the macro, &lt;kbd&gt;C-2&lt;/kbd&gt; &lt;kbd&gt;F4&lt;/kbd&gt; to repeat it twice, or &lt;kbd&gt;C-0&lt;/kbd&gt; &lt;kbd&gt;F4&lt;/kbd&gt; to repeat it until an error (such as running out of lines) is encountered.&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2014-09-24T11:49:37.813" LastActivityDate="2014-09-24T11:49:37.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="46" PostTypeId="2" ParentId="42" CreationDate="2014-09-23T22:03:57.020" Score="3" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.passwordstore.org/&quot; rel=&quot;nofollow&quot;&gt;pass&lt;/a&gt; to store my passwords, and a lisp wrapper to set the value appropriately:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 's)&#xA;(defun my-password (pass)&#xA;  (s-trim (shell-command-to-string&#xA;            (concat &quot;pass show &quot; pass))))&#xA;&#xA;(setq my-jabber-password (my-password &quot;Personal/jabber&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-23T22:03:57.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="47" PostTypeId="1" CreationDate="2014-09-23T22:07:43.903" Score="9" ViewCount="1214" Body="&lt;p&gt;I wrote &lt;a href=&quot;https://meta.stackoverflow.com/a/271990/1438&quot;&gt;this post&lt;/a&gt; in Emacs. In order to make the tables look nice, I decided to adjust the spacing so that decimals line up neatly. The original format &lt;a href=&quot;http://data.stackexchange.com/stackoverflow/query/225883/question-stats-by-tag?tag=%27emacs%27,%20%27elisp%27,%20%27vi%27,%20%27vim%27,%20%27latex%27,%20%27wolfram-mathematica%27,%20%27blender%27,%20%27drupal%27,%20%27tridion%27,%20%27magento%27,%20%27joomla%27#&quot; rel=&quot;nofollow noreferrer&quot;&gt;from the database&lt;/a&gt; looked like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs                11505 227          3.6       3.3         1.9         68.9          93.5        68         &#xA;vi                   1087  289          11.1      6.9         2.9         71.7          96.2        9          &#xA;wolfram-mathematica  2993  360          4         2.2         1.9         66.7          92.5        51         &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's pretty close, but I want the columns right justified and all the ones digits lined up.  The fourth column should look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 3.6&#xA;11.1&#xA; 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I played around with the &lt;a href=&quot;http://www.emacswiki.org/emacs/AlignCommands&quot; rel=&quot;nofollow noreferrer&quot;&gt;align commands&lt;/a&gt; and could not find a way to automatically align the table on the (optional) decimal point. For some reason, &lt;a href=&quot;http://www.emacswiki.org/emacs/AlignCommands&quot; rel=&quot;nofollow noreferrer&quot;&gt;these instructions&lt;/a&gt; fail to align anything at all:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Figures can also be lined up with respect to the decimal point, using &lt;code&gt;M-- M-x align&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2" LastEditorUserId="-1" LastEditDate="2017-03-20T09:16:07.180" LastActivityDate="2014-09-24T22:25:29.613" Title="Align vertical columns of numbers on the decimal point" Tags="|align|regular-expressions|table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="48" PostTypeId="2" ParentId="47" CreationDate="2014-09-23T22:07:43.903" Score="8" Body="&lt;p&gt;First, you need to be sure that the buffer is in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Mode.html&quot; rel=&quot;nofollow&quot;&gt;Text mode&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x text-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once in text mode, &lt;code&gt;C-- M-x align&lt;/code&gt; (which invokes the &lt;code&gt;text-dollar-figure&lt;/code&gt; alignment rule) will align the first decimal vertically. But it fails to align the second decimal column. Plus it fails to align numbers that don't have an explicit decimal point (such as wolfram-mathematica's average score of 4). To fix that, you'll want to adjust the value of the rule in the &lt;code&gt;align-rules-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(text-dollar-figure&#xA;  (regexp . &quot;\\$?\\(\\s-+[0-9]+\\)\\.?&quot;)&#xA;  (modes . align-text-modes)&#xA;  (repeat . t)&#xA;  (spacing . 2)&#xA;  (justify . t)&#xA;  (run-if lambda nil&#xA;      (eq '- current-prefix-arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That does a few things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The regexp now allows for the an optional trailing period.&lt;/li&gt;&#xA;&lt;li&gt;By turning on repeat, each instance of a number is aligned.&lt;/li&gt;&#xA;&lt;li&gt;I added 2 spaces instead of just one for readability.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs                11505  227   3.6  3.3  1.9  68.9  93.5   68         &#xA;vi                    1087  289  11.1  6.9  2.9  71.7  96.2    9          &#xA;wolfram-mathematica   2993  360   4    2.2  1.9  66.7  92.5   51         &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;A more or less equivalent method is to define a function that calls &lt;code&gt;align-regexp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun align-decimal (start end)&#xA;    &quot;Align a table of numbers on (optional) decimal points.&quot;&#xA;    (interactive &quot;r&quot;)&#xA;    (align-regexp start end &quot;\\(\\s-*\\)\\$?\\(\\s-+[0-9]+\\)\\.?&quot;&#xA;                  -2 0 t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, I set the &lt;code&gt;groups&lt;/code&gt; parameter to a negative number to turn on right justification and &lt;code&gt;spacing&lt;/code&gt; to 0 in order to preserve the original spacing as much as possible.&lt;/p&gt;&#xA;" OwnerUserId="2" LastEditorUserId="2" LastEditDate="2014-09-24T22:25:29.613" LastActivityDate="2014-09-24T22:25:29.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="49" PostTypeId="1" CreationDate="2014-09-23T22:11:30.893" Score="24" ViewCount="40758" Body="&lt;p&gt;I heard that we can view pdf files in emacs. Is it done by converting pdf files to plain texts first?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we view pdf files at its fullness in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can we edit pdf files in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="253" LastEditDate="2015-05-06T14:22:53.970" LastActivityDate="2022-10-25T12:26:33.637" Title="How to view and edit pdf files in emacs?" Tags="|pdf|docview|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="51" PostTypeId="2" ParentId="26" CreationDate="2014-09-23T22:12:35.250" Score="20" Body="&lt;p&gt;I'm using Ubuntu, so the location of the desktop file may be different but I think the contents should be similar.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat ~/.local/share/applications/emacsclient.desktop &#xA;#!/usr/bin/env xdg-open&#xA;&#xA;[Desktop Entry]&#xA;Version=1.0&#xA;Name=GNU Emacs 24&#xA;GenericName=Text Editor&#xA;Comment=View and edit files&#xA;MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;&#xA;Exec=/usr/bin/emacsclient -c -a &quot;&quot; %F&#xA;Icon=/usr/share/icons/hicolor/scalable/apps/emacs-snapshot.svg&#xA;Type=Application&#xA;Terminal=false&#xA;Categories=Utility;Development;TextEditor;&#xA;StartupWMClass=Emacs&#xA;Name[en_US]=GNU Emacs 24&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The important part is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Exec=/usr/bin/emacsclient -c -a &quot;&quot; %F&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To clarify that should probably be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Exec=/usr/bin/emacsclient --create-frame --alternate-editor &quot;&quot; %F&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the documentation on emacsclient those switches do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-c, --create-frame      Create a new frame instead of trying to&#xA;                        use the current Emacs frame&#xA;-a EDITOR, --alternate-editor=EDITOR&#xA;                        Editor to fallback to if the server is not running&#xA;                        If EDITOR is the empty string, start Emacs in daemon&#xA;                        mode and try connecting again&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it makes a new frame using &lt;code&gt;-c&lt;/code&gt; and then if emacs is not already daemonized it starts a new emacs daemon with &lt;code&gt;-a &quot;&quot;&lt;/code&gt;. Finally, the &lt;code&gt;%F&lt;/code&gt; fixes it so you can drag a text file onto the icon and it will open it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as an aside you might also look into including &lt;code&gt;-F &quot;((fullscreen . maximized))&quot;&lt;/code&gt; to force the frame to maximize at launch. Unfortunately, I can't remember which version of emacs is required for that to work.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-09-23T22:12:35.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="52" PostTypeId="1" AcceptedAnswerId="56" CreationDate="2014-09-23T22:15:06.897" Score="97" ViewCount="33959" Body="&lt;p&gt;When you have to edit system files, it's an usual situation that you launched Emacs with a normal user before, so the file will be write-protected. What can I do to gain root privileges? I mean something like &lt;code&gt;M-x sudo&lt;/code&gt; from dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to launch Emacs as super-user and I don't want to quit it.&lt;/p&gt;&#xA;" OwnerUserId="119" LastEditorUserId="119" LastEditDate="2019-11-14T15:35:57.607" LastActivityDate="2022-04-02T14:36:55.460" Title="Edit file with super-user rights" Tags="|dired|files|sudo|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="53" PostTypeId="1" AcceptedAnswerId="85" CreationDate="2014-09-23T22:17:16.077" Score="6" ViewCount="720" Body="&lt;p&gt;A lot of things including &lt;code&gt;M-x compile&lt;/code&gt; work fine over tramp, but &lt;code&gt;find-tag&lt;/code&gt; seems to be the exception: it attempts to jump to a location in a local file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would someone investigate why it's doing this, and explore a possible fix?&lt;/p&gt;&#xA;" OwnerUserId="24" LastActivityDate="2014-09-23T23:53:58.630" Title="ctags over tramp" Tags="|tramp|ctags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="54" PostTypeId="1" CreationDate="2014-09-23T22:17:25.950" Score="4" ViewCount="392" Body="&lt;p&gt;Suppose I open one window with a Common Lisp file in it, and a second window with SLIME REPL in it (using M-x slime or whatever). Now, doing &lt;code&gt;C-c C-d h&lt;/code&gt; with point on a Common Lisp keyword brings up a window with the CLHS entry for that keyword (using w3m, and assuming everything has been configured correctly, but lets assume that is the case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I want the CLHS window to be set up, so that wherever I call &lt;code&gt;C-c C-d h&lt;/code&gt;, either in the Lisp file window, or in the SLIME REPL window, the CLHS page comes up in the same window. This currently does not happen. I &lt;em&gt;am&lt;/em&gt; using some code which I found on the Emacs wiki, &lt;a href=&quot;http://www.emacswiki.org/emacs/emacs-w3m#toc24&quot; rel=&quot;nofollow&quot;&gt;W3m: Browse url on other window&lt;/a&gt;, which helps but does not completely work. I think it works if only one window (besides the CLHS window) is open.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq browse-url-browser-function 'w3m-browse-url-other-window)&#xA;&#xA;(defun w3m-browse-url-other-window (url &amp;amp;optional newwin)&#xA;  (let ((w3m-pop-up-windows t))&#xA;    (if (one-window-p) (split-window))&#xA;    (other-window 1)&#xA;    (w3m-browse-url url newwin)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;NOTE: This is probably a specific example of a more general question.&lt;/p&gt;&#xA;" OwnerUserId="100" LastEditorUserId="100" LastEditDate="2014-09-23T22:49:31.160" LastActivityDate="2014-09-26T00:04:22.647" Title="Creating permanent fixed buffer for CLHS lookup" Tags="|buffers|common-lisp|slime|w3m|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="55" PostTypeId="2" ParentId="49" CreationDate="2014-09-23T22:18:49.567" Score="19" Body="&lt;p&gt;Since Emacs 23, you can view PDF files as images just by opening them like normal files as long as you have Emacs running in X rather than a terminal. You can also see and edit the PDF directly, which will display the contents of the binary file as text (with lots of unprintable characters!). You can edit this text directly, but unless you can encode and decode PDFs in your head, it won't be very useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can switch between the two views with &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/CVYE0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The same file both as an image preview and as text. I should learn to label my axes ;).&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Text mode isn't very useful for PDFs, but it also works on some human-readable formats like &lt;code&gt;.ps&lt;/code&gt; and &lt;code&gt;.svg&lt;/code&gt;, which is useful for editing those files in place.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2014-09-24T17:52:34.897" LastActivityDate="2014-09-24T17:52:34.897" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="56" PostTypeId="2" ParentId="52" CreationDate="2014-09-23T22:22:50.990" Score="127" Body="&lt;p&gt;Use &lt;code&gt;C-x C-f&lt;/code&gt; and type out &lt;a href=&quot;http://www.gnu.org/software/tramp/#index-method-su&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;/su::/etc/hostname&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;http://www.gnu.org/software/tramp/#index-method-sudo&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;/sudo::/etc/hostname&lt;/code&gt;&lt;/a&gt; as applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This uses the &lt;a href=&quot;http://www.gnu.org/software/tramp/#Overview&quot; rel=&quot;noreferrer&quot;&gt;TRAMP&lt;/a&gt; package, which is distributed with Emacs. This package provides access to remote files, and more generally to files that Emacs can't open directly.&lt;/p&gt;&#xA;" OwnerUserId="24" LastEditorUserId="25" LastEditDate="2017-10-05T20:19:17.860" LastActivityDate="2017-10-05T20:19:17.860" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="57" PostTypeId="1" AcceptedAnswerId="67" CreationDate="2014-09-23T22:26:39.973" Score="9" ViewCount="1128" Body="&lt;p&gt;When editing files, some &lt;code&gt;foo.bar~&lt;/code&gt;  backups appear  (files ending with a &lt;em&gt;tilde&lt;/em&gt; ~). How can I control their creations, and is it possible to ask for a recursive bulk deletion of all files from a specific directory and all it's sub directories?&lt;/p&gt;&#xA;" OwnerUserId="119" LastEditorUserId="105" LastEditDate="2022-04-04T15:44:19.947" LastActivityDate="2022-04-04T15:44:19.947" Title="Automatic deletion of backup files" Tags="|backup|deletion|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="58" PostTypeId="2" ParentId="52" CreationDate="2014-09-23T22:30:56.727" Score="14" Body="&lt;p&gt;Use &lt;code&gt;find-file&lt;/code&gt; with tramp. At the prompt &lt;code&gt;/sudo::/etc/ssh/ssh_config&lt;/code&gt; will use sudo and a subshell to open that file with root privileges. When sudo is first used it will prompt for a password, but until that session closes you can edit any file with those permissions by prefixing with the existing &lt;code&gt;/sudo::&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.gnu.org/software/tramp/&quot;&gt;http://www.gnu.org/software/tramp/&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-09-23T22:30:56.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="59" PostTypeId="2" ParentId="41" CreationDate="2014-09-23T22:32:27.533" Score="14" Body="&lt;p&gt;Use &lt;code&gt;emacs --daemon=your-server-name -l &quot;custom-init-file&quot;&lt;/code&gt; to start a new server and &lt;code&gt;emacsclient -nw -s your-server-name&lt;/code&gt; to connect to it from the terminal itself. The section on Using Emacs as a server in the manual has more initialization options.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-23T22:32:27.533" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="60" PostTypeId="2" ParentId="57" CreationDate="2014-09-23T22:33:13.427" Score="4" Body="&lt;p&gt;&lt;code&gt;dired&lt;/code&gt; makes it easy to delete all the backup files in a directory--from &lt;code&gt;dired&lt;/code&gt;, just type &lt;code&gt;~&lt;/code&gt; to mark backup files for deletion and &lt;code&gt;x&lt;/code&gt; to execute the deletion.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-23T22:33:13.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="61" PostTypeId="1" CreationDate="2014-09-23T22:33:27.480" Score="25" ViewCount="3275" Body="&lt;p&gt;This question was originally asked at &lt;a href=&quot;https://stackoverflow.com/questions/15895313/let-emacs-move-the-cursor-off-screen&quot;&gt;https://stackoverflow.com/questions/15895313/let-emacs-move-the-cursor-off-screen&lt;/a&gt;, but all the answers I got more or less said &quot;it can't be done&quot;, which with emacs I just don't accept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to let Emacs have the cursor be moved off-screen, like most GUI text editors work? This is one of the biggest things that bothers me when I use Emacs over any GUI editor. When I scroll down, the cursor is &quot;pushed forward&quot; by the top of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had previously thought that this was completely impossible, because this is hard-wired into the architecture of Emacs, but then I saw multiple-cursors, which does exactly this for the secondary cursors (assuming you prevent the scrolling functions from acting on the secondary cursors). Is it maybe possible to use multiple-cursors to have the main cursor in some hidden buffer, and the effective cursor being what I actually edit with? Or maybe some other clever trick? Or maybe my Googling has failed me and this is really already possible without any magic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the terminal emacs, so it should work there. &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2022-11-29T21:16:48.693" Title="Let Emacs move the cursor off-screen" Tags="|scrolling|cursor|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="62" PostTypeId="1" AcceptedAnswerId="336" CreationDate="2014-09-23T22:42:12.770" Score="26" ViewCount="4644" Body="&lt;p&gt;It is annoying to see the compilation window appear when it is successful. How to remove that automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to see it though if it is not successful.&lt;/p&gt;&#xA;" OwnerUserId="130" LastEditorUserId="25" LastEditDate="2014-09-25T23:57:03.823" LastActivityDate="2023-07-08T08:51:59.610" Title="Hide *compilation* window" Tags="|window|compilation|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="63" PostTypeId="1" AcceptedAnswerId="65" CreationDate="2014-09-23T22:44:35.670" Score="6" ViewCount="259" Body="&lt;p&gt;Is there a way to filter out certain messages from being echoed in the echo-area while still being logged in to the &lt;em&gt;Messages&lt;/em&gt; buffer ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use case scenario being an aggressive backward delete in the minibuffer yields a &lt;code&gt;Text is read-only&lt;/code&gt; message when the point hits the prompt. I find this highly distracting.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-23T23:36:54.820" Title="How can I suppress certain messages from being echoed in the echo-area?" Tags="|echo-area|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="64" PostTypeId="1" AcceptedAnswerId="286" CreationDate="2014-09-23T22:48:09.647" Score="10" ViewCount="311" Body="&lt;p&gt;I have the below in my documentation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+INCLUDE: &quot;code/basic.sv&quot; :src systemverilog :lines &quot;14-117&quot;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here line 14 is where I have &lt;code&gt;class basic extends ..&lt;/code&gt; and line 116 is where I have &lt;code&gt;endclass&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to auto insert the numbers 14 and 117 (=116+1) so that I don't have to manually update them every time I modify the &lt;code&gt;code/basic.sv&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-09-25T22:59:45.570" Title="How to auto calculate the begin and end lines when including source files in org-mode?" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="65" PostTypeId="2" ParentId="63" CreationDate="2014-09-23T22:51:44.930" Score="4" Body="&lt;p&gt;You can hack just about any function with &lt;code&gt;defadvice&lt;/code&gt;, although debugging advised functions is quite difficult:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice message (around my-message-filter activate)&#xA;  (unless (string-match &quot;Text is read-only&quot; (or (ad-get-arg 0) &quot;&quot;))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-09-23T23:36:54.820" LastActivityDate="2014-09-23T23:36:54.820" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="66" PostTypeId="1" AcceptedAnswerId="68" CreationDate="2014-09-23T22:52:33.723" Score="18" ViewCount="2438" Body="&lt;p&gt;Say I have a elisp code like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 2 3▮(+ 3&#xA;          4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to automatically re-indent the sexp after the cursor, when I add or remove symbols?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after pressing &lt;code&gt;SPC 4 SPC&lt;/code&gt;, I would automatically get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 2 3 4 ▮(+ 3&#xA;             4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can do this manual by calling &lt;code&gt;mark-sexp&lt;/code&gt; followed by &lt;code&gt;indent-region&lt;/code&gt;. Are there better ways of doing this?&lt;/p&gt;&#xA;" OwnerUserId="43" LastEditorUserId="105" LastEditDate="2023-09-27T16:11:00.337" LastActivityDate="2023-09-27T16:11:00.337" Title="Automatically re-indenting elisp code when adding or removing code before an indented block" Tags="|indentation|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="67" PostTypeId="2" ParentId="57" CreationDate="2014-09-23T22:56:50.043" Score="8" Body="&lt;p&gt;You can make all backup files to go a directory with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist `((&quot;.&quot; . &quot;~/.emacs.bak&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and turn it off completely with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq make-backup-files nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;although nobody will recommend that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making backups for only some projects is not easy: you'll have to flip that variable in various hooks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, asking for bulk deletion is exactly equivalent to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find . -name '*~' -exec rm {} \;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so you might be better of doing that in the shell.&lt;/p&gt;&#xA;" OwnerUserId="24" LastActivityDate="2014-09-23T22:56:50.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="68" PostTypeId="2" ParentId="66" CreationDate="2014-09-23T22:57:37.493" Score="14" Body="&lt;p&gt;Instead of &lt;code&gt;mark-sexp&lt;/code&gt; + &lt;code&gt;indent-region&lt;/code&gt;, you can press &lt;code&gt;C-M-q&lt;/code&gt;. This will call &lt;code&gt;indent-pp-sexp&lt;/code&gt;. Not automatic, but a bit better than having to invoke two commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or if you're using &lt;code&gt;paredit-mode&lt;/code&gt;, press &lt;code&gt;M-q&lt;/code&gt;. That will reindent the whole function definition you're in.&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorUserId="79" LastEditDate="2014-09-28T01:45:56.537" LastActivityDate="2014-09-28T01:45:56.537" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="69" PostTypeId="1" AcceptedAnswerId="111" CreationDate="2014-09-23T22:57:57.317" Score="18" ViewCount="946" Body="&lt;p&gt;Say I have a buffer with text. I would like to test a regular expression (ideally Perl type) against my buffer and have Emacs highlight the matches on it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following regexp (&lt;a href=&quot;https://en.wikipedia.org/wiki/Regular_expression&quot; rel=&quot;noreferrer&quot;&gt;taken from Wikipedia&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(?&amp;lt;=\.) {2,}(?=[A-Z]) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would match as follows on the following text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;img src=&quot;https://i.stack.imgur.com/LHEcL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This regular expression in particular matches at least two spaces occurring after period &lt;code&gt;(.)&lt;/code&gt; and before an upper case letter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does Emacs provide an &lt;strong&gt;interactive&lt;/strong&gt; regular expression matcher for &lt;strong&gt;Perl&lt;/strong&gt; regular expressions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the answer to the latter is no:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a reason why &lt;strong&gt;native&lt;/strong&gt; support of &lt;strong&gt;Perl&lt;/strong&gt; regular expressions wasn't (ever) considered in Emacs? (considering that it is a well known standard in Unix/Linux)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How could one proceed about building one such Perl regexp matcher? (perhaps calling Perl under the hood, or pre-converting the Perl regexp to a supported variant?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6" LastEditorUserId="50" LastEditDate="2014-10-01T08:09:33.197" LastActivityDate="2014-10-01T08:09:33.197" Title="How can I test and use a Perl regular expression interactively?" Tags="|regular-expressions|commands|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="70" PostTypeId="1" AcceptedAnswerId="71" CreationDate="2014-09-23T23:00:37.087" Score="55" ViewCount="6172" Body="&lt;p&gt;Very frequently I would need to perform the set of steps requiring multiple key strokes. For the same session those steps can be recorded in a keyboard macro. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example is saving a frequently executed search/replace operation as a keyboard macro. But that macro is lost when I quit emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I save my frequently used keyboard macro as a Lisp function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sake of simplicity, I want to save the action of replacing &quot;abc&quot; with &quot;def&quot; as a function so that I can reuse it across emacs sessions.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-09T10:14:19.230" LastActivityDate="2014-12-16T11:25:40.800" Title="How to save a keyboard macro as a Lisp function?" Tags="|elisp|keyboard-macros|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="71" PostTypeId="2" ParentId="70" CreationDate="2014-09-23T23:00:37.087" Score="61" Body="&lt;p&gt;Here are the steps that you can follow:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select the region you want to do the search-replace.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Start recording macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x start-kbd-macro&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Do the required &lt;code&gt;M-x query-replace-regexp&lt;/code&gt; (replace &quot;abc&quot; with &quot;def&quot;) and use &lt;code&gt;!&lt;/code&gt; to force search-replace in the whole region. &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Stop recording macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x kmacro-end-or-call-macro&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x kmacro-name-last-macro&lt;/code&gt; and give the macro a descriptive name like &lt;code&gt;replace-abc-with-def&lt;/code&gt;. You will then be able to call that macro again by doing &lt;code&gt;M-x replace-abc-with-def&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Now save this macro as a function to a file that you load during your emacs initialization; for example, &lt;code&gt;init.el&lt;/code&gt;. &#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x insert-kbd-macro&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select your named macro to be inserted there.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The auto-created &lt;code&gt;replace-abc-with-def&lt;/code&gt; function definition looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'replace-abc-with-def&#xA;   (lambda (&amp;amp;optional arg) &quot;Keyboard macro.&quot; (interactive &quot;p&quot;) (kmacro-exec-ring-item (quote ([59 39 return 97 98 99 return 100 101 102 return 33] 0 &quot;%d&quot;)) arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can &lt;code&gt;M-x replace-abc-with-def&lt;/code&gt; in all your emacs sessions.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-09-24T13:03:36.743" LastActivityDate="2014-09-24T13:03:36.743" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="72" PostTypeId="2" ParentId="66" CreationDate="2014-09-23T23:06:29.077" Score="3" Body="&lt;p&gt;I don't know of a pre-existing solution, but you can use &lt;code&gt;post-self-insert-hook&lt;/code&gt; to accomplish this yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-indent-next-sexp ()&#xA;  (interactive)&#xA;  (mark-sexp)&#xA;  (indent-region))&#xA;&#xA;(add-hook 'post-self-insert-hook 'my-indent-next-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would worry about potential performance problems though.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-23T23:06:29.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="73" PostTypeId="1" AcceptedAnswerId="78" CreationDate="2014-09-23T23:06:56.857" Score="11" ViewCount="141" Body="&lt;p&gt;Right now, this is a task I find a lot easier in something like gedit, because I can just replace &quot;\n&quot; (the line break) with &quot;&amp;lt;/li&amp;gt;\n&amp;lt;li&amp;gt;&quot; and then I have a list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the few little things I don't seem to be able to in Emacs quickly, but something I use a lot.&lt;/p&gt;&#xA;" OwnerUserId="133" LastActivityDate="2014-09-24T12:56:02.973" Title="How to convert a series of lines into a working HTML list?" Tags="|search|html|line-break|replace|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="74" PostTypeId="2" ParentId="20" CreationDate="2014-09-23T23:07:30.333" Score="9" Body="&lt;p&gt;It's arguably better to re-create the &lt;code&gt;*scratch*&lt;/code&gt; buffer automatically whenever it gets deleted, and avoid having to retype its name.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun prepare-scratch-for-kill ()&#xA;  (save-excursion&#xA;    (set-buffer (get-buffer-create &quot;*scratch*&quot;))&#xA;    (add-hook 'kill-buffer-query-functions 'kill-scratch-buffer t)))&#xA;&#xA;(defun kill-scratch-buffer ()&#xA;  (let (kill-buffer-query-functions)&#xA;    (kill-buffer (current-buffer)))&#xA;  ;; no way, *scratch* shall live&#xA;  (prepare-scratch-for-kill)&#xA;  ;; Since we &quot;killed&quot; it, don't let caller try too&#xA;  nil)&#xA;&#xA;(prepare-scratch-for-kill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-23T23:07:30.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="75" PostTypeId="2" ParentId="69" CreationDate="2014-09-23T23:09:04.847" Score="7" Body="&lt;p&gt;&lt;code&gt;re-builder&lt;/code&gt; allows on the fly construction of emacs lisp style regular expressions. I don't know if there is an equivalent package for building Perl regular expressions interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.masteringemacs.org/articles/2011/04/12/re-builder-interactive-regexp-builder/&quot;&gt;http://www.masteringemacs.org/articles/2011/04/12/re-builder-interactive-regexp-builder/&lt;/a&gt; for more discussion.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-09-23T23:09:04.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="76" PostTypeId="2" ParentId="73" CreationDate="2014-09-23T23:14:35.067" Score="1" Body="&lt;p&gt;For a full-featured solution, convert your text into an org-mode list and &lt;a href=&quot;http://orgmode.org/manual/HTML-export.html&quot; rel=&quot;nofollow&quot;&gt;export to HTML&lt;/a&gt;. Prefix lines with '* ', active &lt;code&gt;org-mode&lt;/code&gt;, and run &lt;code&gt;org-html-export-to-html&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="24" LastEditorUserId="24" LastEditDate="2014-09-23T23:25:17.580" LastActivityDate="2014-09-23T23:25:17.580" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="77" PostTypeId="2" ParentId="73" CreationDate="2014-09-23T23:18:55.023" Score="8" Body="&lt;p&gt;You can use &lt;code&gt;query-replace-regexp&lt;/code&gt; (&lt;code&gt;C-M-%&lt;/code&gt;). Replace &lt;code&gt;^\(.*\)$&lt;/code&gt; with &lt;code&gt;&amp;lt;li&amp;gt;\1&amp;lt;/li&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-23T23:18:55.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="78" PostTypeId="2" ParentId="73" CreationDate="2014-09-23T23:23:24.473" Score="7" Body="&lt;p&gt;The most direct way of doing this would be to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mark the region of text lines to become a list&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;M-%&lt;/code&gt; (&lt;code&gt;query-replace&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;C-q C-j RET &amp;lt;/li&amp;gt; C-q C-j &amp;lt;li&amp;gt; RET&lt;/code&gt; (&lt;code&gt;C-q C-j&lt;/code&gt; inserts a quoted newline character)&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;!&lt;/code&gt; to replace all occurrences&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="43" LastEditorUserId="133" LastEditDate="2014-09-24T12:56:02.973" LastActivityDate="2014-09-24T12:56:02.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="79" PostTypeId="1" AcceptedAnswerId="84" CreationDate="2014-09-23T23:33:07.847" Score="7" ViewCount="1894" Body="&lt;p&gt;How do I generate a beamer presentation from an org-mode file? What beamer features can I use in my file?&lt;/p&gt;&#xA;" OwnerUserId="24" LastActivityDate="2023-09-24T10:05:22.543" Title="Exporting beamer with org-mode" Tags="|org-mode|latex|beamer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="80" PostTypeId="1" AcceptedAnswerId="81" CreationDate="2014-09-23T23:37:43.500" Score="23" ViewCount="1097" Body="&lt;p&gt;At times while working on a code, it's useful to quickly open a *scratch* buffer to paste a snippet from that code file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am working on a Perl script, I would like to quickly open a *scratch* buffer with in &lt;code&gt;cperl-mode&lt;/code&gt;. It would also be nice to quickly jump back to the code buffer I was originally working in.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="50" LastEditDate="2014-10-03T15:39:28.007" LastActivityDate="2016-09-01T15:25:36.140" Title="How can I quickly toggle between a file and a *scratch* buffer having the same major mode?" Tags="|major-mode|scratch-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="81" PostTypeId="2" ParentId="80" CreationDate="2014-09-23T23:37:43.500" Score="25" Body=" &#xA;&#xA;&lt;p&gt;It will be convenient to bind the below function to a key binding of your choice.&#xA;If you are currently working on a &lt;code&gt;FILE&lt;/code&gt; buffer, calling the below function will toggle between &lt;code&gt;FILE&lt;/code&gt;'s major-mode specific *scratch* buffer called &lt;code&gt;*scratch-MAJOR-MODE*&lt;/code&gt; and the &lt;code&gt;FILE&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the example in question, if I am working on a Perl script called &lt;code&gt;myperl.pl&lt;/code&gt;, calling this function will toggle between &lt;code&gt;myperl.pl&lt;/code&gt; and &lt;code&gt;*scratch-cperl-mode*&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/switch-to-scratch-and-back (&amp;amp;optional arg)&#xA;  &quot;Toggle between *scratch-MODE* buffer and the current buffer.&#xA;If a scratch buffer does not exist, create it with the major mode set to that&#xA;of the buffer from where this function is called.&#xA;&#xA;        COMMAND -&amp;gt; Open/switch to a scratch buffer in the current buffer's major mode&#xA;    C-0 COMMAND -&amp;gt; Open/switch to a scratch buffer in `fundamental-mode'&#xA;    C-u COMMAND -&amp;gt; Open/switch to a scratch buffer in `org-mode'&#xA;C-u C-u COMMAND -&amp;gt; Open/switch to a scratch buffer in `emacs-elisp-mode'&#xA;&#xA;Even if the current major mode is a read-only mode (derived from `special-mode'&#xA;or `dired-mode'), we would want to be able to write in the scratch buffer. So&#xA;the scratch major mode is set to `org-mode' for such cases.&#xA;&#xA;Return the scratch buffer opened.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (if (and (or (null arg)               ; no prefix&#xA;               (= arg 1))&#xA;           (string-match-p &quot;\\*scratch&quot; (buffer-name)))&#xA;      (switch-to-buffer (other-buffer))&#xA;    (let* ((mode-str (cl-case arg&#xA;                       (0  &quot;fundamental-mode&quot;) ; C-0&#xA;                       (4  &quot;org-mode&quot;) ; C-u&#xA;                       (16 &quot;emacs-lisp-mode&quot;) ; C-u C-u&#xA;                       ;; If the major mode turns out to be a `special-mode'&#xA;                       ;; derived mode, a read-only mode like `help-mode', open&#xA;                       ;; an `org-mode' scratch buffer instead.&#xA;                       (t (if (or (derived-mode-p 'special-mode) ; no prefix&#xA;                                  (derived-mode-p 'dired-mode))&#xA;                              &quot;org-mode&quot;&#xA;                            (format &quot;%s&quot; major-mode)))))&#xA;           (buf (get-buffer-create (concat &quot;*scratch-&quot; mode-str &quot;*&quot;))))&#xA;      (switch-to-buffer buf)&#xA;      (funcall (intern mode-str))   ; http://stackoverflow.com/a/7539787/1219634&#xA;      buf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-09-01T15:25:36.140" LastActivityDate="2016-09-01T15:25:36.140" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="82" PostTypeId="2" ParentId="73" CreationDate="2014-09-23T23:39:42.047" Score="10" Body="&lt;p&gt;Alternatively to query replace you can go with &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;multiple-cursors&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WN5hB.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also consider using something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wrap-html-tag (tagName)&#xA;  &quot;Add a tag to beginning and ending of current word or text selection.&quot;&#xA;  (interactive &quot;sEnter tag name: &quot;)&#xA;  (let (p1 p2 inputText)&#xA;    (if (use-region-p)&#xA;        (progn&#xA;          (setq p1 (region-beginning) )&#xA;          (setq p2 (region-end) )&#xA;          )&#xA;      (let ((bds (bounds-of-thing-at-point 'symbol)))&#xA;        (setq p1 (car bds) )&#xA;        (setq p2 (cdr bds) ) ) )&#xA;&#xA;    (goto-char p2)&#xA;    (insert &quot;&amp;lt;/&quot; tagName &quot;&amp;gt;&quot;)&#xA;    (goto-char p1)&#xA;    (insert &quot;&amp;lt;&quot; tagName &quot;&amp;gt;&quot;)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ergoemacs.org/emacs/emacs_html_insert_tags.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="137" LastEditorUserId="137" LastEditDate="2014-09-24T00:06:48.710" LastActivityDate="2014-09-24T00:06:48.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="83" PostTypeId="1" AcceptedAnswerId="88" CreationDate="2014-09-23T23:45:15.363" Score="3" ViewCount="430" Body="&lt;p&gt;I have predictive, auctex installed. I want predictive mode to work with my .tex files but I keep getting a warning of: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Warning (emacs): Predictive major-mode setup function predictive-setup-latex failed; latex-mode support disabled&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;after trying to turn on predictive mode with &lt;code&gt;M-x predictive-mode&lt;/code&gt; when a &lt;code&gt;.tex&lt;/code&gt; file is open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found this issue here, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://superuser.com/questions/326431/why-is-emacs-predictive-mode-not-working-for-latex-documents&quot;&gt;https://superuser.com/questions/326431/why-is-emacs-predictive-mode-not-working-for-latex-documents&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://tex.stackexchange.com/questions/26109/emacs-predictive-mode-does-not-work-for-latex-documents&quot;&gt;https://tex.stackexchange.com/questions/26109/emacs-predictive-mode-does-not-work-for-latex-documents&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But both are inconclusive to me as I know predictive mode has successfully installed, its being managed by el-get. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually I debug with emacs --debug-init, but this is happening long after the .emacs is loaded. &lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2014-09-24T00:14:39.160" Title="Predictive mode, Auctex not playing nicely" Tags="|latex|auctex|predictive-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="84" PostTypeId="2" ParentId="79" CreationDate="2014-09-23T23:50:01.923" Score="10" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Beamer-export.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Beamer export&lt;/a&gt; is very similiar to &lt;a href=&quot;https://orgmode.org/manual/LaTeX-export.html#LaTeX-export&quot; rel=&quot;nofollow noreferrer&quot;&gt;LaTeX export&lt;/a&gt; in Org-Mode, all you need to do is hitting &lt;code&gt;M-x org-beamer-export-to-pdf&lt;/code&gt; or &lt;code&gt;C-c C-e l P&lt;/code&gt; from the Org buffer you're working on.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://orgmode.org/manual/Beamer-specific-export-settings.html#Beamer-specific-export-settings&quot; rel=&quot;nofollow noreferrer&quot;&gt;The majority of options&lt;/a&gt; are taken from the LaTeX export except for &lt;code&gt;BEAMER_THEME&lt;/code&gt; and &lt;code&gt;BEAMER_COLOR_THEME&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Other than that there are a few Beamer-specific commands one can use to have Beamer-only code and to control its overlays, &lt;a href=&quot;https://orgmode.org/manual/Beamer-specific-syntax.html#Beamer-specific-syntax&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Beamer-specific syntax and overlays&quot;&gt;see the manual for further details&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditorDisplayName="user10000" LastEditDate="2023-09-24T10:05:22.543" LastActivityDate="2023-09-24T10:05:22.543" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="85" PostTypeId="2" ParentId="53" CreationDate="2014-09-23T23:53:58.630" Score="5" Body="&lt;p&gt;I don't have that problem, using &lt;code&gt;find-tag&lt;/code&gt; over TRAMP resolves the filenames over TRAMP as well.&#xA;That said, that works only if the TAGS file contains &lt;em&gt;relative&lt;/em&gt; paths (relative to the location of the TAGS file itself, therefore over TRAMP), and not &lt;em&gt;absolute&lt;/em&gt; ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it'd be better if in case of absolute filenames over TRAMP, the resolution was smart enough to consider them as absolute filenames... on the remote location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an attempt at doing just that (this redefines the function that's responsible for the path resolution):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun etags-file-of-tag (&amp;amp;optional relative) ; Doc string?&#xA;  (save-excursion&#xA;    (re-search-backward &quot;\f\n\\([^\n]+\\),[0-9]*\n&quot;)&#xA;    (let ((str (convert-standard-filename&#xA;                (buffer-substring (match-beginning 1) (match-end 1)))))&#xA;      (if relative&#xA;      str&#xA;        (let ((basedir (file-truename default-directory)))&#xA;          (if (file-remote-p basedir)&#xA;              (with-parsed-tramp-file-name basedir nil&#xA;                (expand-file-name (apply 'tramp-make-tramp-file-name&#xA;                                         (list method user host str hop))))&#xA;            (expand-file-name str basedir)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-23T23:53:58.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="86" PostTypeId="1" AcceptedAnswerId="109" CreationDate="2014-09-24T00:03:00.910" Score="9" ViewCount="803" Body="&lt;p&gt;After copying a &quot;rectangle&quot; using &lt;code&gt;C-x r M-w&lt;/code&gt;, doing &lt;code&gt;C-x r y&lt;/code&gt; yanks or pastes the rectangle. But that inserts the copied rectangle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I paste the copied rectangle so that it overwrites the text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; a b c d e f g&#xA; h i j k▮l m n&#xA; o p q r s t u▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I copied the rectangle enclosed between the cursor positions shown above using &lt;code&gt;M-x copy-rectangle-as-kill&lt;/code&gt; or &lt;code&gt;C-x r M-w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when I paste it in front of the character &lt;code&gt;h&lt;/code&gt; using &lt;code&gt;M-x yank-rectangle&lt;/code&gt; or &lt;code&gt;C-x r y&lt;/code&gt;, I want the result to look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; a b c d e f g&#xA;▮l m n k l m n&#xA; s t u r s t u&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; a b c d e f g&#xA;▮l m n h i j k l m n&#xA; s t u o p q r s t u&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make the &lt;code&gt;yank-rectangle&lt;/code&gt; overwrite?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-09-24T13:06:18.897" LastActivityDate="2014-09-24T13:06:18.897" Title="How to overwrite a copied rectangle instead of inserting it (which is the default behavior of yank-rectangle)?" Tags="|yank|rectangle|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="87" PostTypeId="1" AcceptedAnswerId="108" CreationDate="2014-09-24T00:08:19.387" Score="6" ViewCount="915" Body="&lt;p&gt;Occasionally looking up a function with &lt;code&gt;C-h f&lt;/code&gt; will cross reference to an Info node in the manual, but that is pretty rare. I often want a way to jump from the help documentation on a given function to the corresponding documentation referencing it in Info, but I have yet to find an easy way to do that. &lt;code&gt;info-finder&lt;/code&gt; can sort of work on categories, and of course it's possible to manually search through various Info manuals from the root menu at &lt;code&gt;C-h i&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found &lt;code&gt;info-apropos&lt;/code&gt;, which can be a little slow. It appears to read and index every Info file for every keyword search. Is there a better or faster method for looking up a keyword in Info? Is there a way to pre-index &lt;code&gt;info-apropos&lt;/code&gt;? Is there a nice way to jump from the help for a function to related Info pages?&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2016-02-14T10:29:57.263" Title="How do I search Info for help on a given keyword or function?" Tags="|help-mode|info|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="88" PostTypeId="2" ParentId="83" CreationDate="2014-09-24T00:13:08.623" Score="2" Body="&lt;p&gt;After digging some more, I found the solution. Thank you Vamsi for the debug-on-entry tip. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was getting the error because the predictive/latex wasn't on the load path. I assumed that el-get would take care of all the proper loading but it doesn't since predictive/latex, predictive/texinfo aren't really needed for all predictive use-cases. So the solution is to simply add them to the load-path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest and kludgiest solution is to add to your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/el-get/predictive/latex&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/el-get/predictive/texinfo&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This answer of course assumes you are using &lt;code&gt;el-get&lt;/code&gt; like I am. &lt;/p&gt;&#xA;" OwnerUserId="39" LastActivityDate="2014-09-24T00:13:08.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="89" PostTypeId="2" ParentId="11" CreationDate="2014-09-24T00:14:35.643" Score="11" Body="&lt;p&gt;You could install &lt;a href=&quot;http://www.emacswiki.org/Evil&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;evil homepage&quot;&gt;evil&lt;/a&gt; and do it in any number of &lt;a href=&quot;https://stackoverflow.com/questions/1174274/how-can-i-prepend-text-to-multiple-lines-in-vim&quot;&gt;vi-like ways&lt;/a&gt; - I prefer visual block selection using &lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;V&lt;/kbd&gt; to mark each line and then &lt;kbd&gt;Shift&lt;/kbd&gt; + &lt;kbd&gt;I&lt;/kbd&gt; to insert and then type the text you want to insert and finally hit &lt;kbd&gt;ESC&lt;/kbd&gt; to exit insert mode and the text will be prepended to each line. This is very similar to emacs rectangle selections but a few less keystrokes.&lt;/p&gt;&#xA;" OwnerUserId="144" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2014-09-24T00:14:35.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="90" PostTypeId="1" AcceptedAnswerId="97" CreationDate="2014-09-24T00:17:59.087" Score="11" ViewCount="2185" Body="&lt;p&gt;I have this in an Org mode projects file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TODO: TODO(t!) WAITING(w!) DONE(d!) CANCELED(c@)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I move something from TODO to WAITING, it adds a timestamp without asking for a note.  That's fine 8 or 9 times out of 10 ... but sometimes I want to add a note too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use the @ it will always ask me for a note, and I have to &lt;code&gt;C-c C-c&lt;/code&gt; to get out of that.  I'd like to avoid that if I can.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way (a prefix or alternate command) that I can use to have Org let me add an optional note when I change a TODO state?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-z&lt;/code&gt; (&lt;code&gt;org-add-note&lt;/code&gt;) adds a note, but it does it to the item as a whole, not to the WAITING workflow change, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* WAITING Find out how to sometimes add a note when I change to WAITING&#xA;  - Note taken on [2014-09-23 Tue 11:36] \\&#xA;    Asked on SE&#xA;  - State &quot;WAITING&quot;    from &quot;WAITING&quot;    [2014-09-23 Tue 11:30]&#xA;  - State &quot;WAITING&quot;    from &quot;TODO&quot;       [2014-09-21 Sun 11:25]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="145" LastActivityDate="2015-01-10T21:13:22.000" Title="How to sometimes but not always add a note to an Org TODO state change?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="91" PostTypeId="2" ParentId="87" CreationDate="2014-09-24T00:20:02.680" Score="5" Body="&lt;p&gt;&lt;code&gt;info-lookup-symbol&lt;/code&gt; bound by default to &lt;code&gt;C-h S&lt;/code&gt; can search info indices to find the relevant node for symbol corresponding to point. &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-24T00:20:02.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="92" PostTypeId="2" ParentId="41" CreationDate="2014-09-24T00:21:14.480" Score="7" Body="&lt;p&gt;In addition to @Vamsi's answer, you can get many of the same benefits while running only a single server by attaching advice to &lt;code&gt;make-frame-command&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, while running in the terminal I want the background color to be &lt;code&gt;black&lt;/code&gt; (which maps to &lt;code&gt;#202020&lt;/code&gt;) but I want to use &lt;code&gt;#202020&lt;/code&gt; in a graphical mode. I implemented this with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defadvice make-frame-command (after make-frame-change-background-color last activate)&#xA;  &quot;Adjusts the background color for different frame types. &#xA;Graphical (X) frames should have the theme color, while terminal frames should match the terminal color (which matches the theme color...but terminal frames can't directly render this color)&quot;&#xA;    (if (display-graphic-p)&#xA;        (set-background-color &quot;#202020&quot;)&#xA;      (set-background-color &quot;black&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can get a lot of mileage out of this using &lt;code&gt;make-variable-frame-local&lt;/code&gt; (&lt;code&gt;set-background-color&lt;/code&gt; in the above is already frame-local). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if this is the best pattern, but if you have relatively few differences between TTY-mode and X-mode Emacs it can make configuration management easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above code was pulled from &lt;a href=&quot;https://github.com/emallson/dotfiles/blob/master/.emacs.d/init.el#L27&quot; rel=&quot;nofollow noreferrer&quot;&gt;my .emacs.d&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="15477" LastEditDate="2017-06-17T13:22:48.907" LastActivityDate="2017-06-17T13:22:48.907" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="93" PostTypeId="2" ParentId="61" CreationDate="2014-09-24T00:37:22.567" Score="4" Body="&lt;p&gt;The method that I always use is to set the mark where I want to jump back to, and then when I am done perusing the buffer, I pop the mark using &lt;code&gt;C-u C-SPC&lt;/code&gt;.  Even when I forget to set the mark before wandering off, I find that popping the mark usually lands me pretty close to where I came from. This is due partly to the fact that some commands (like &lt;code&gt;isearch&lt;/code&gt; for example) set the mark without you even realizing.  So through the course of your editing, you have been inadvertently leaving a little trail of breadcrumbs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set-mark-command is an interactive compiled Lisp function in `simple.el'.&#xA;&#xA;It is bound to C-@, C-SPC.&#xA;&#xA;(set-mark-command ARG)&#xA;&#xA;....&#xA;&#xA;With prefix argument (e.g., C-u C-SPC), jump to the mark, and set the mark&#xA;from position popped off the local mark ring (this does not affect the global&#xA;mark ring).  Use C-x C-@ to jump to a mark popped off the global mark ring&#xA;(see `pop-global-mark').&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I almost never bother with setting bookmarks or registers, but I can almost always find my way back where I came from quickly using either &lt;code&gt;C-u C-SPC&lt;/code&gt; or &lt;code&gt;pop-global-mark&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-09-24T00:37:22.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="94" PostTypeId="2" ParentId="27" CreationDate="2014-09-24T00:39:57.060" Score="1" Body="&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I have not tried this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could get part of the way by having a function watch command output for a command to open the file using TRAMP. Security hole? Yes. Functional? Probably.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use a &lt;code&gt;shell-mode&lt;/code&gt; hook to add a hook to &lt;code&gt;after-change-hook&lt;/code&gt; in &lt;code&gt;shell-mode&lt;/code&gt;. This hook watches for a specific sequence. Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; RemoteTRAMP token: &amp;lt;authentication token maybe?&amp;gt;&#xA;;; RemoteTRAMP edit: /path/to/my/file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It then uses &lt;code&gt;tramp-find-file&lt;/code&gt; to open the file. This is relatively secure because the ONLY THING that the remote can do is trigger a &lt;code&gt;tramp-find-file&lt;/code&gt;. A confirmation first would be good but optional.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When editing is finished, another hook can trigger the exit of the dummy program (eg by sending &lt;code&gt;C-c&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The worst case (for security) is that they find a way to run arbitrary code. If you have buffer-variables set to always evaluate, a malicious attacker could overwrite important settings without your knowledge. They could also launch a denial of service attack by causing many buffers to open. Confirmations could likely prevent all of the above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The program on the remote could be trivially implemented in C (or any other language).&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2014-09-24T00:39:57.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="95" PostTypeId="1" AcceptedAnswerId="98" CreationDate="2014-09-24T00:45:40.153" Score="10" ViewCount="321" Body="&lt;p&gt;In GitHub one can often find, for a given open-source project, the list of issues that have been reported and the estimated time-horizon that is considered for a given fix or enhancement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an equivalent repository where feature requests and bugs for GNU Emacs are collected and prioritized? Do the developers group them into specific milestones per version?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="184" LastEditDate="2014-11-20T14:05:06.543" LastActivityDate="2014-11-21T10:41:49.140" Title="List of GNU Emacs enhancement requests, bugs, and milestones at any given time" Tags="|emacs-development|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="96" PostTypeId="1" AcceptedAnswerId="113" CreationDate="2014-09-24T00:46:00.663" Score="9" ViewCount="648" Body="&lt;p&gt;I would like to change the behavior of &lt;code&gt;fill-paragraph&lt;/code&gt; in certain modes (e.g. &lt;code&gt;LaTeX-mode&lt;/code&gt; provided by &lt;code&gt;AucTeX&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could just rebind the key &lt;code&gt;M-q&lt;/code&gt;, but I am also using &lt;code&gt;evil-mode&lt;/code&gt; whose implementation of &lt;code&gt;evil-fill-and-move&lt;/code&gt; uses &lt;code&gt;fill-region&lt;/code&gt;. Ideally, my custom fill function to override both the functions &lt;code&gt;fill-paragraph&lt;/code&gt; (so it works with &lt;code&gt;M-q&lt;/code&gt;) and &lt;code&gt;fill-region&lt;/code&gt; (so it works with &lt;code&gt;evil&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that I have a standalone program &lt;code&gt;format&lt;/code&gt; that takes in LaTeX code via &lt;code&gt;stdin&lt;/code&gt; and output formatted code on &lt;code&gt;stdout&lt;/code&gt;, how would I go about override the above two fill functions to use &lt;code&gt;format&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: this is similar to &lt;code&gt;vim&lt;/code&gt;'s &lt;code&gt;formatprg&lt;/code&gt; option.)&lt;/p&gt;&#xA;" OwnerUserId="117" LastEditorUserId="39" LastEditDate="2014-09-24T00:53:11.113" LastActivityDate="2014-09-24T03:08:59.367" Title="Overriding fill-paragraph in LaTeX mode" Tags="|latex|init-file|auctex|fill-paragraph|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="97" PostTypeId="2" ParentId="90" CreationDate="2014-09-24T01:01:03.893" Score="10" Body="&lt;p&gt;First of all, note that passing a argument of 0 to &lt;code&gt;org-todo&lt;/code&gt; would inhibit notes. So if you're willing to inverse the default state of everything, it might work for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it'd be cleaner to force a note, which does not have a similar flag, unfortunately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's something you can do to simulate that.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-todo-force-notes ()&#xA;  (interactive)&#xA;  (let ((org-todo-log-states&#xA;         (mapcar (lambda (state)&#xA;                   (list state 'note 'time))&#xA;                 (apply 'append org-todo-sets))))&#xA;    (call-interactively 'org-todo)))&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-c C-S-t&quot;) 'org-todo-force-notes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Explanation: Here I'm temporarily redefining the note-taking semantic that's associated with all todo keywords (they're organized in sets in &lt;code&gt;org-todo-sets&lt;/code&gt;, a flat representation might be available in another variable) to force note-taking, and passing that as a dynamic context to the actual &lt;code&gt;org-todo&lt;/code&gt; code.&#xA;So whenever hitting &lt;code&gt;C-c C-T&lt;/code&gt; (uppercase T), you force a note, regardless of what state you'll end up with. &lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="388" LastEditDate="2015-01-10T21:13:22.000" LastActivityDate="2015-01-10T21:13:22.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="98" PostTypeId="2" ParentId="95" CreationDate="2014-09-24T01:01:04.517" Score="9" Body="&lt;p&gt;One place where emacs bugs are filed/listed is &lt;a href=&quot;http://debbugs.gnu.org/db/pa/lemacs.html&quot;&gt;debbugs&lt;/a&gt;.  Other places to discover/place feature requests and follow development include the emacs and emacs-devel &lt;a href=&quot;https://savannah.gnu.org/mail/?group_id=40&quot;&gt;discussion lists&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2014-09-24T01:01:04.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="99" PostTypeId="2" ParentId="42" CreationDate="2014-09-24T01:04:09.983" Score="6" Body="&lt;p&gt;See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/auth.html&quot;&gt;Emac's auth-source&lt;/a&gt;.  You may discover that it is already wired into the default authentication of the tool your using, for example ERC uses it.  I wrote a bit about it in &lt;a href=&quot;http://enthusiasm.cozy.org/archives/2014/07/auth-source-getting-my-secrets-out-of-my-emacs-init-file&quot;&gt;this blog post&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2014-09-24T01:04:09.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="100" PostTypeId="2" ParentId="17" CreationDate="2014-09-24T01:23:53.713" Score="18" Body="&lt;p&gt;&lt;code&gt;C-o&lt;/code&gt; is bound to &lt;code&gt;helm-next-source&lt;/code&gt; by default. This will cycle through available sources. In this case, the sources are your command history and available commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were at the top of your history in the example image, then pressed &lt;code&gt;C-o&lt;/code&gt;, it'd move you to the first entry in &lt;em&gt;Emacs Commands&lt;/em&gt;. &lt;code&gt;C-o&lt;/code&gt; again would move you back to the top of the history. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To move to the command list automatically from the bottom of the history, set &lt;code&gt;helm-move-to-line-cycle-in-source&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2014-09-24T01:23:53.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="101" PostTypeId="1" AcceptedAnswerId="2202" CreationDate="2014-09-24T01:34:40.463" Score="5" ViewCount="1398" Body="&lt;p&gt;I'm using org-mode and mu4e. I'd like to have each email become the active link so that I can link to it in Org. When viewing an email, I can &lt;code&gt;C-c C-l&lt;/code&gt; (bound to &lt;code&gt;(org-store-link)&lt;/code&gt;) to make a link to it, and then elsewhere in Org &lt;code&gt;C-c l&lt;/code&gt; to paste the link. I'd like the &lt;code&gt;(org-store-link)&lt;/code&gt; part to happen automagically each time I send an email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found two hooks: &lt;code&gt;message-send-hook&lt;/code&gt; and &lt;code&gt;message-sent-hook&lt;/code&gt; but am not sure where to call &lt;code&gt;(org-store-link)&lt;/code&gt;. I've tried that in a function on each hook, but it doesn't work. I think there is additional trickery to catch the just-sent (or sending) message.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-12-13T21:39:55.987" Title="How can I create an Org link for each email sent by mu4e?" Tags="|org-mode|mu4e|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="102" PostTypeId="1" AcceptedAnswerId="106" CreationDate="2014-09-24T01:35:02.027" Score="90" ViewCount="20466" Body="&lt;p&gt;I see a lot of people (extension authors and others) give configuration examples with &lt;code&gt;setq&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo 'bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These parameters are often defined with &lt;code&gt;defcustom&lt;/code&gt;, making them available for customization through &lt;code&gt;custom.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I typically use &lt;code&gt;custom.el&lt;/code&gt; to set them. Would there be any advantage to using &lt;code&gt;setq&lt;/code&gt; instead or are the two methods roughly equivalent?&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="105" LastEditDate="2015-05-20T05:10:00.387" LastActivityDate="2023-09-20T16:12:27.400" Title="Advantages of setting variables with setq instead of custom.el?" Tags="|elisp|init-file|custom|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="103" PostTypeId="5" CreationDate="2014-09-24T01:35:30.090" Score="0" Body="&lt;p&gt;Org-mode is an Emacs mode for keeping notes, maintaining ToDo lists, doing project planning, GTD, and authoring with a fast and effective plain-text system. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/&lt;/a&gt; — Homepage&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/worg/&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/&lt;/a&gt; — collaborative knowledge site (sort of like a Wiki)&lt;/li&gt;&#xA;&lt;li&gt;emacs-orgmode@gnu.org — Mailinglist (accessible through &lt;a href=&quot;http://news.gmane.org/gmane.emacs.orgmode&quot; rel=&quot;nofollow&quot;&gt;Gmane&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Org-mode has been included with Emacs since version 22.1, released in June, 2007.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-01T00:46:35.170" LastActivityDate="2014-10-01T00:46:35.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="104" PostTypeId="4" CreationDate="2014-09-24T01:35:30.090" Score="0" Body="Org-mode is an Emacs major mode for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system. Because Org mode is a vast subject area, other tags must accompany the `org-mode` tag." OwnerUserId="45" LastEditorUserId="262" LastEditDate="2024-03-20T19:00:43.153" LastActivityDate="2024-03-20T19:00:43.153" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="105" PostTypeId="2" ParentId="102" CreationDate="2014-09-24T01:49:36.753" Score="27" Body="&lt;p&gt;One advantage of using &lt;code&gt;setq&lt;/code&gt; instead of &lt;code&gt;customize&lt;/code&gt; is readability. One is free to annotate each customization to one's liking which IMO improves readability. One can also group related customizations together which improves modularity. Finally, I would argue that navigating through an elisp buffer is more &quot;easy&quot; then navigating customize UI and widgets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, customize lets you easily revert to default values which can be priceless when things go haywire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Drew's answer provides a great reason to use &lt;code&gt;customize-set-variables&lt;/code&gt; which can provide all the advantages I pointed out.  However, the Customize UI does not lend itself to portable configurations among different platforms as easily as raw elisp does. If you require a variable to have os dependent setting, you will have to fallback to elisp in many cases. My point about easier navigation in elisp buffers still stands.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-09-24T05:17:55.590" LastActivityDate="2014-09-24T05:17:55.590" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="106" PostTypeId="2" ParentId="102" CreationDate="2014-09-24T01:49:44.900" Score="116" Body="&lt;p&gt;Some people might think it is simpler to use &lt;code&gt;setq&lt;/code&gt;.  Some people might think it is more lispy.  In reality, it is naive in the general case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is true that for some user options it does not matter. But for others, it does matter, and &lt;code&gt;setq&lt;/code&gt; is the wrong approach for those options.  So as a general rule, &lt;strong&gt;&lt;code&gt;setq&lt;/code&gt; is the wrong approach.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;custom-set-variables&lt;/code&gt; or &lt;code&gt;customize-set-variable&lt;/code&gt; instead of &lt;code&gt;setq&lt;/code&gt;, or if you use the Customize user interface (e.g. &lt;code&gt;M-x customize-option&lt;/code&gt;), then you are sure that any intended initialization or updating code that is needed for the option value will be automatically triggered and run as needed.  If you use &lt;code&gt;setq&lt;/code&gt;, this will not be done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, it is also the case that most user options, especially many of them written for 3rd-party libraries, do not make use of the &lt;code&gt;defcustom&lt;/code&gt; keywords &lt;code&gt;:set&lt;/code&gt; and &lt;code&gt;:initialize&lt;/code&gt;, and using &lt;code&gt;setq&lt;/code&gt; does not matter for them.  But lots of vanilla Emacs options do use such keywords, and for those that do, &lt;code&gt;setq&lt;/code&gt; is not the right thing.&#xA;So if you want to use Lisp code and not the Customize UI to set your options, then you are better off using &lt;code&gt;custom-set-variables&lt;/code&gt; or &lt;code&gt;customize-set-variable&lt;/code&gt; instead of &lt;code&gt;setq&lt;/code&gt;. It never hurts and it sometimes helps (a lot).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what I recommend is to do both of these things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Use the Customize UI&lt;/em&gt; instead of writing Lisp code for this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Define variable &lt;strong&gt;&lt;code&gt;custom-file&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt;, so that Customize writes customizations to that file and not to your init file (&lt;code&gt;~/.emacs&lt;/code&gt;).  IOW, keep your hand-written initialization code separate from the automatic code written by Customize. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-09-24T04:57:53.447" LastActivityDate="2014-09-24T04:57:53.447" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="107" PostTypeId="1" AcceptedAnswerId="132" CreationDate="2014-09-24T01:54:39.710" Score="7" ViewCount="762" Body="&lt;p&gt;In Verilog/C/C++, comments can begin with &lt;code&gt;//&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example comment,&#xA;&lt;code&gt;&#xA;//This is a comment&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to use the &lt;em&gt;find-file-at-point&lt;/em&gt; feature. If my cursor is on the file name in &lt;code&gt;`include &quot;some_file.v&quot;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if my cursor is on the above example comment and if I hit &lt;code&gt;C-x C-f&lt;/code&gt;, emacs tries to open a tentative path &lt;code&gt;//This&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I selectively prevent &lt;em&gt;find-file-at-point&lt;/em&gt; from activating? In this case, when the major mode is &lt;code&gt;verilog-mode&lt;/code&gt;, how do I NOT do &lt;code&gt;find-file-at-point&lt;/code&gt; when my cursor is on a line where the first 2 non-space characters are &lt;code&gt;//&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="17702" LastEditDate="2019-12-18T15:54:24.247" LastActivityDate="2019-12-18T15:54:24.247" Title="How do I disable ffap (find file at point) when the first two non-space characters in a line are '//'?" Tags="|comment|c|ffap|verilog|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="108" PostTypeId="2" ParentId="87" CreationDate="2014-09-24T02:01:18.537" Score="6" Body="&lt;p&gt;In addition to &lt;code&gt;info-lookup-symbol&lt;/code&gt; (&lt;code&gt;C-h S&lt;/code&gt;), if you use library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/help-fns%2b.el&quot;&gt;help-fns+.el&lt;/a&gt; then &lt;code&gt;C-h f&lt;/code&gt;, &lt;code&gt;C-h v&lt;/code&gt;, or &lt;code&gt;C-h k&lt;/code&gt; includes a link to look up the function (or variable etc.) in the manuals (using the index).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You control which manuals are searched by way of user option &lt;code&gt;help-cross-reference-manuals&lt;/code&gt;. The default behavior is to look in the Emacs and Elisp manuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.emacswiki.org/HelpPlus#LinksToManuals&quot;&gt;Links to Manuals&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-24T02:01:18.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="109" PostTypeId="2" ParentId="86" CreationDate="2014-09-24T02:10:56.733" Score="8" Body="&lt;p&gt;Use &lt;code&gt;M-x picture-mode&lt;/code&gt;.  &lt;code&gt;C-c C-y&lt;/code&gt;, bound to command &lt;code&gt;picture-yank-rectangle&lt;/code&gt;, does what you want.  (You can use &lt;code&gt;C-_&lt;/code&gt; to undo.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These related keys are also available in &lt;code&gt;picture-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-k&lt;/code&gt; - Clear a rectangle and save it (&lt;code&gt;picture-clear-rectangle&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-w&lt;/code&gt; - Clear a rectangle and save it in a register (&lt;code&gt;picture-clear-rectangle-to-register&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-x&lt;/code&gt; - Like &lt;code&gt;C-c C-y&lt;/code&gt;, but uses the rectangle in a register (&lt;code&gt;picture-yank-rectangle-from-register&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x r r&lt;/code&gt; - Copy a rectangle to a register (&lt;code&gt;copy-rectangle-to-register&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-c C-c&lt;/code&gt; to exit picture mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use the picture-mode commands without turning on &lt;code&gt;picture-mode&lt;/code&gt;, but in that case their keys are not bound.  You will anyway need to load library &lt;code&gt;picture&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can, for example, do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;C-x r r&lt;/code&gt; to copy a rectangle to a register.&lt;/li&gt;&#xA;&lt;li&gt;Put the cursor where you want to yank that rectangle, replacing existing text.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x picture-yank-rectangle-from-register&lt;/code&gt; (which you can also bind to a key).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-09-24T05:21:33.650" LastActivityDate="2014-09-24T05:21:33.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="110" PostTypeId="2" ParentId="62" CreationDate="2014-09-24T02:37:08.680" Score="15" Body="&lt;p&gt;Looking quickly at the code (in library &lt;code&gt;compile.el&lt;/code&gt;), you should be able to just kill or hide the displayed buffer by using a function on hook &lt;strong&gt;&lt;code&gt;compilation-finish-functions&lt;/code&gt;&lt;/strong&gt;.  To do that, use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'compilation-finish-functions (lambda (buf strg) (kill-buffer buf))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want to kill the buffer, then use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'compilation-finish-functions&#xA;           (lambda (buf strg)&#xA;             (let ((win  (get-buffer-window buf 'visible)))&#xA;               (when win (delete-window win)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In general, you can imagine that for something like this there is probably a hook already provided, so you can easily attach code at such a significant place in the processing. A little browsing of the code or using &lt;code&gt;M-x apropos&lt;/code&gt; will typically quickly let you know. The names of hooks typically end in &lt;code&gt;-hook&lt;/code&gt; or &lt;code&gt;-functions&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-24T02:37:08.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="111" PostTypeId="2" ParentId="69" CreationDate="2014-09-24T02:46:48.453" Score="17" Body="&lt;p&gt;There are two nice packages for working with perl kind of regexes effectively, which should be used together - &lt;a href=&quot;https://github.com/benma/visual-regexp.el&quot; rel=&quot;noreferrer&quot;&gt;visual-regexp&lt;/a&gt; and it's extension - &lt;a href=&quot;https://github.com/benma/visual-regexp-steroids.el/&quot; rel=&quot;noreferrer&quot;&gt;visual-regexp-steroids&lt;/a&gt;. They are great addition to emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZEj2x.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="137" LastActivityDate="2014-09-24T02:46:48.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="112" PostTypeId="1" AcceptedAnswerId="115" CreationDate="2014-09-24T03:05:07.823" Score="16" ViewCount="1827" Body="&lt;p&gt;I would like to configure my Emacs fringe to show code folding sections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, BBEdit on the Mac would show the following when editing a JSON file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wh1NK.png&quot; alt=&quot;BBEdit code folding marks&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The marks themselves are actionable: clicking on a mark would expand or collapse the corresponding code section. When the document does not have a mode that supports code folding, the fringe is not shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to expand the Emacs fringe functionality in such a way?&lt;/p&gt;&#xA;" OwnerUserId="159" LastActivityDate="2014-09-24T04:04:45.753" Title="Actionable code folding in Emacs fringe" Tags="|fringe|code-folding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="113" PostTypeId="2" ParentId="96" CreationDate="2014-09-24T03:08:59.367" Score="7" Body="&lt;p&gt;It would be better to have 2 functions, although one can be implemented in terms of the other. The reason being that a paragraph is an &lt;em&gt;implicit&lt;/em&gt; region, so the input in both cases should be different&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-format-region (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (shell-command-on-region beg end &quot;format&quot;))&#xA;&#xA;(defun my-format-paragraph ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (mark-paragraph)&#xA;    (my-format-region (point) (mark))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to substitute functions to others, regardless of their keybinding, use remap keybindings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define-key LaTeX-mode-map [remap fill-region] 'my-format-region)&#xA; (define-key LaTeX-mode-map [remap fill-paragraph] 'my-format-paragraph)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-24T03:08:59.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="114" PostTypeId="2" ParentId="112" CreationDate="2014-09-24T03:27:39.097" Score="4" Body="&lt;p&gt;While I don't think the fringe items can directly receive clicks (I might be wrong though), a possible hack would be to bind &lt;code&gt;(kbd &quot;&amp;lt;left-fringe&amp;gt; &amp;lt;double-mouse-1&amp;gt;&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the first click would move the point to the beginning of the line that corresponds to the fringe icon, testing the value of &lt;code&gt;(point)&lt;/code&gt; in your hypothetical (un)folding function would allow you to identify which portion of code to (un)fold, or if you need to do anything at all (in case no fringe icon is present for this line)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example with an org-mode buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;&amp;lt;left-fringe&amp;gt; &amp;lt;double-mouse-1&amp;gt;&quot;) 'org-cycle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Double-clicking on the fringe cycles the corresponding subtree.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-24T03:27:39.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="115" PostTypeId="2" ParentId="112" CreationDate="2014-09-24T03:56:59.210" Score="17" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/emacsmirror/hideshowvis/blob/master/hideshowvis.el&quot;&gt;Hideshowvis&lt;/a&gt; adds clickable icons to the fringe, but for some strange reason it's not included in elpa or melpa. By default it shows a &lt;code&gt;-&lt;/code&gt; in the fringe for code that can be folded, and then elides the content with a &lt;code&gt;...&lt;/code&gt;. By also enabling &lt;code&gt;hideshowvis-symbols&lt;/code&gt; it adds a &lt;code&gt;+&lt;/code&gt; and makes the hinting for folded content a little louder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hideshow itself also allows mouse clicks on the line to toggle display using &lt;code&gt;S-mouse-2&lt;/code&gt; (or shift middle click). That is built in and can be enabled with &lt;code&gt;hs-minor-mode&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-09-24T04:04:45.753" LastActivityDate="2014-09-24T04:04:45.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="116" PostTypeId="1" AcceptedAnswerId="117" CreationDate="2014-09-24T04:02:45.133" Score="4" ViewCount="1234" Body="&lt;p&gt;How to make buffers accessible only from one frame(window) and not accessible from another and vice versa? So I want to have each frame with its own buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on OS X.&lt;/p&gt;&#xA;" OwnerUserId="137" LastActivityDate="2018-12-07T16:50:37.103" Title="Per Frame Buffers" Tags="|buffers|frames|osx|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="117" PostTypeId="2" ParentId="116" CreationDate="2014-09-24T04:21:32.560" Score="3" Body="&lt;p&gt;The only way I can think of is launching a new instance of Emacs instead of opening a new frame normally. You can set &lt;code&gt;C-x 5 2&lt;/code&gt; to start &lt;code&gt;emacs&lt;/code&gt; instead of creating a new frame:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun start-other-emacs ()&#xA;  &quot;Start another Emacs process to open an independent Emacs window.&quot;&#xA;  (interactive)&#xA;  ;;; Run the command &quot;emacs&quot;, piping output into a &#xA;  ;;; buffer called &quot;*other-emacs*&quot;&#xA;  (start-process &quot;emacs&quot; &quot;*other-emacs*&quot; &quot;emacs&quot;))&#xA;(global-set-key (kbd &quot;C-x 5 2&quot;) 'start-other-emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this isn't terribly fast unless you have a more optimized Emacs config than I do!&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2014-09-24T04:21:32.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="118" PostTypeId="2" ParentId="116" CreationDate="2014-09-24T04:43:12.000" Score="1" Body="&lt;p&gt;Your question is not very clear (to me, at least). Just what do you mean by &quot;&lt;em&gt;accessible&lt;/em&gt;&quot;? (displayed without selecting? selected as current buffer?) And what do you mean here by &quot;&lt;em&gt;and vice versa&lt;/em&gt;&quot;? And what does &quot;&lt;em&gt;each frame with its own buffers&lt;/em&gt;&quot; (plural?) mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking a wild guess, perhaps you mean that you want a single buffer (not two or more) shown in each frame.  And perhaps you want the frame to show only that buffer.  (No, I realize that this is not at all what you said.  But what you said is anyway unclear to me.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, then to use a separate frame by default for most buffer-displaying commands, try setting option &lt;code&gt;pop-up-frames&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.  (Or customize the complex option &lt;code&gt;display-buffer-alist&lt;/code&gt;.)  And to prevent other buffers from being shown in the same frame, make the buffer's window dedicated -- see the Elisp manual, node &lt;code&gt;Dedicated Windows&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you do only those things then you will wind up somewhat disappointed, as Emacs does not always behave well with one-buffer-per-frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a relatively coherent setup that provides one-buffer-per-frame behavior, consider trying &lt;a href=&quot;http://www.emacswiki.org/OneOnOneEmacs&quot; rel=&quot;nofollow&quot;&gt;One On One Emacs&lt;/a&gt;.  Try library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/oneonone.el&quot; rel=&quot;nofollow&quot;&gt;oneonone.el&lt;/a&gt;, for example.  To make all windows dedicated you can customize &lt;code&gt;special-display-regexps&lt;/code&gt; so that it matches all buffer names.  (Or again, you can fiddle with customizing option &lt;code&gt;display-buffer-alist&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-24T04:43:12.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="119" PostTypeId="2" ParentId="116" CreationDate="2014-09-24T04:43:41.217" Score="6" Body="&lt;p&gt;Generally you can't have frame-local list of buffers. It might have been possible when &lt;code&gt;buffer-alist&lt;/code&gt; was exposed at Lisp level (but even like that I'm not too sure), but that possibility is now gone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next best thing is to pretend you do. Packages like &lt;a href=&quot;https://github.com/nex3/perspective-el&quot;&gt;perspective.el&lt;/a&gt; can help in this regard: they avoid presenting buffers that are not &quot;contained&quot; in the current perspective.&#xA;You can then activate different perspectives in different frames to implement your scenario.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-24T04:43:41.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="120" PostTypeId="2" ParentId="86" CreationDate="2014-09-24T05:08:40.063" Score="1" Body="&lt;p&gt;Another approach is to use &lt;code&gt;delete-selection-mode&lt;/code&gt; and do this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (put 'yank-rectangle 'delete-selection 'yank)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that makes &lt;code&gt;yank-rectangle&lt;/code&gt; &lt;strong&gt;always&lt;/strong&gt; replace the text at point, which might not be what you want.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-24T05:08:40.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="121" PostTypeId="2" ParentId="18" CreationDate="2014-09-24T05:37:22.780" Score="-1" Body="&lt;p&gt;If it's only a line you can zap-to-char with M-z asuming that character is not repeated between the point and the one you want to delete up to.&#xA;For some cases this is faster than creating a region.&lt;/p&gt;&#xA;" OwnerUserId="188" LastActivityDate="2014-09-24T05:37:22.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="122" PostTypeId="1" AcceptedAnswerId="136" CreationDate="2014-09-24T05:56:41.710" Score="20" ViewCount="1441" Body="&lt;p&gt;&lt;code&gt;C-h l&lt;/code&gt; shows the lossage help buffer, which shows recent keystrokes. Pressing &lt;code&gt;g&lt;/code&gt; appears to revert it, causing it to update. Unfortunately, enabling &lt;code&gt;auto-revert-mode&lt;/code&gt; does not change it to update continuously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be nice if I could open up another window or frame and just display lossage in real time to show viewers what I am typing. This could also be used for pairing in a tmux/tmate session. Some of the videos online have something like this, but they appear to be external applications and OS specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a nice way to show keystrokes in real time as they occur from within Emacs?&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2023-02-16T10:05:09.153" Title="Is there a mode for viewing keystroke lossage in realtime?" Tags="|keystrokes|pairing|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="123" PostTypeId="5" CreationDate="2014-09-24T06:22:06.117" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-09-24T06:22:06.117" LastActivityDate="2014-09-24T06:22:06.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="124" PostTypeId="4" CreationDate="2014-09-24T06:22:06.117" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-09-24T06:22:06.117" LastActivityDate="2014-09-24T06:22:06.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="125" PostTypeId="2" ParentId="122" CreationDate="2014-09-24T06:42:00.247" Score="3" Body="&lt;p&gt;The lossage help buffer is not associated with a file on disk. Hence auto revert mode does not work. A pseudo realtime alternative can be using&#xA; &lt;code&gt;(open-dribble-file &quot;FILE&quot;)&lt;/code&gt; which writes all keystrokes to FILE. Using &lt;code&gt;auto-revert-tail-mode&lt;/code&gt; on FILE buffer can reflect the keystrokes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way would be to advice &lt;code&gt;self-insert-command&lt;/code&gt;(and some prefix keys) to echo to a buffer.  &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-24T06:42:00.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="126" PostTypeId="2" ParentId="54" CreationDate="2014-09-24T06:46:20.507" Score="4" Body="&lt;p&gt;I think the following should mostly do what you want&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar w3m-dedicated-window nil)&#xA;&#xA;(defun w3m-browse-url-dedicated-window (url &amp;amp;optional new-session)&#xA;  (let ((w3m-pop-up-windows t))&#xA;    (if (and w3m-dedicated-window&#xA;             (window-live-p w3m-dedicated-window))&#xA;        (with-selected-window w3m-dedicated-window&#xA;          (w3m-browse-url url new-session))&#xA;      (split-window) ;; ugly as hell, but w3m-pop-up-windows is ignored...&#xA;      (other-window 1)&#xA;      (w3m-browse-url url new-session)&#xA;      (setq w3m-dedicated-window (selected-window))&#xA;      (set-window-dedicated-p w3m-dedicated-window t))))&#xA;&#xA;(setq browse-url-browser-function 'w3m-browse-url-dedicated-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the dedicated window flag, it tries harder to keep the browser visible. And that dedicated window is reused as much as possible, whenever a new URL is browsed.&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-26T00:04:22.647" LastActivityDate="2014-09-26T00:04:22.647" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="127" PostTypeId="1" CreationDate="2014-09-24T06:48:53.723" Score="7" ViewCount="300" Body="&lt;p&gt;Weirdly when I try to log onto freenode using ERC, a ` is added to my nickname, which results in the name not being found on the server. I get the following output in the &lt;em&gt;Messages&lt;/em&gt; buffer - I have replaced my real nick with nickname.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Connecting to irc.freenode.net:6667... ...done&#xA;Logging in as 'nickname'...&#xA;Logging in as 'nickname`'... done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using ERC 5.3 on Emacs 24.3.5.1 on OS X&lt;/p&gt;&#xA;" OwnerUserId="199" LastActivityDate="2014-09-24T18:54:32.893" Title="Why does ERC add ` to my nickname" Tags="|erc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="128" PostTypeId="2" ParentId="127" CreationDate="2014-09-24T06:59:16.447" Score="13" Body="&lt;p&gt;I get this behavior when I, or somebody else, is already logged into the server with my original username. If I open ERC twice, logging in as &lt;code&gt;tikhon&lt;/code&gt; both times, the second login is automatically changed to &lt;code&gt;tikhon`&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can happen if you first connect and then time out. The IRC server gives you a grace period before kicking you off; if you try to log in while the old you is still on the server, your name will get a &lt;code&gt;`&lt;/code&gt; appended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a mathematical bent, you can read it as &quot;tikhon prime&quot; :).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change this character by customizing &lt;code&gt;erc-nick-uniquifier&lt;/code&gt;, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq erc-nick-uniquifier &quot;_&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to use &lt;code&gt;nickname_&lt;/code&gt; instead of &lt;code&gt;nickname`&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2014-09-24T18:54:32.893" LastActivityDate="2014-09-24T18:54:32.893" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="129" PostTypeId="2" ParentId="2" CreationDate="2014-09-24T07:04:38.897" Score="6" Body="&lt;p&gt;distributing .dir-locals.el in different projects is hard to maintain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My way is pretty simple, put all the code in one ~/.custom.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, the code will be run in prog-mode-hook (or your-whatever-major-mode-hook) and do the following things: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;analyze whether the full path of file does contain the specific project name&lt;/li&gt;&#xA;&lt;li&gt;if true then do the setup for that project (including tweaking the indent).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've been successfully using this method for one year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code (call my-setup-develop-environment in prog-mode-hook):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-project-name-contains-substring (REGEX)&#xA;  (let ((dir (if (buffer-file-name)&#xA;                 (file-name-directory (buffer-file-name))&#xA;               &quot;&quot;)))&#xA;    (string-match-p REGEX dir)))&#xA;&#xA;(defun my-office-code-style ()&#xA;  (interactive)&#xA;  (message &quot;Office code style!&quot;)&#xA;  ;; web development&#xA;  (setq coffee-tab-width 4)&#xA;  (setq javascript-indent-level 4)&#xA;  (setq js-indent-level 4)&#xA;  (setq js2-basic-offset 4)&#xA;  (setq web-mode-indent-style 4)&#xA;  (setq web-mode-markup-indent-offset 4)&#xA;  (setq web-mode-css-indent-offset 4)&#xA;  (setq web-mode-code-indent-offset 4)&#xA;  )&#xA;&#xA;(defun my-personal-code-style ()&#xA;  (interactive)&#xA;  (message &quot;My personal code style!&quot;)&#xA;  (setq coffee-tab-width 4)&#xA;  (setq javascript-indent-level 2)&#xA;  (setq js-indent-level 2)&#xA;  (setq js2-basic-offset 2)&#xA;  (setq web-mode-indent-style 2)&#xA;  (setq web-mode-markup-indent-offset 2)&#xA;  (setq web-mode-css-indent-offset 2)&#xA;  (setq web-mode-code-indent-offset 2)&#xA;  )&#xA;&#xA;(defun my-setup-develop-environment ()&#xA;  (interactive)&#xA;  (cond&#xA;   ;; company's project for ttag&#xA;   ((my-project-name-contains-substring &quot;commerical-proj1&quot;)&#xA;    (my-office-code-style))&#xA;   ((my-project-name-contains-substring &quot;hobby-proj1&quot;)&#xA;    (my-personal-code-style))&#xA;  )&#xA;)&#xA;(add-hook 'prog-mode-hook 'my-setup-develop-environment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-07-26T03:06:00.970" LastActivityDate="2015-07-26T03:06:00.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="130" PostTypeId="2" ParentId="107" CreationDate="2014-09-24T07:09:43.557" Score="2" Body="&lt;p&gt;I think hacking &lt;code&gt;find-file-at-point&lt;/code&gt; is easy, you can use &lt;code&gt;defadvice&lt;/code&gt; on &lt;code&gt;find-file-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key point is detecting whether the cursor is in a comment. I had a similar issue when developing &lt;code&gt;evil-nerd-commenter&lt;/code&gt;. Here is the function you can re-use. The trick is to detect the current font face.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun evilnc--in-comment-p (pos)&#xA;  (interactive)&#xA;  (let ((fontfaces (get-text-property pos 'face)))&#xA;    (when (not (listp fontfaces))&#xA;      (setf fontfaces (list fontfaces)))&#xA;    (delq nil&#xA;      (mapcar #'(lambda (f)&#xA;              ;; learn this trick from flyspell&#xA;              (or (eq f 'font-lock-comment-face)&#xA;              (eq f 'font-lock-comment-delimiter-face)))&#xA;          fontfaces))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="25" LastEditDate="2014-09-26T00:01:56.930" LastActivityDate="2014-09-26T00:01:56.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="131" PostTypeId="2" ParentId="122" CreationDate="2014-09-24T07:13:41.937" Score="9" Body="&lt;p&gt;You can use a&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/post-command-hook&quot;&gt;post-command-hook&lt;/a&gt;&#xA;to update the lossage buffer. The following snippet does that for you&#xA;(on a buffer local basis), but it assumes you've renamed the lossage&#xA;buffer to &quot;Lossage&quot; (so this way you can still open other help&#xA;buffers).&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun update-lossage-buffer ()&#xA;  &quot;Update the \&quot;Lossage\&quot; buffer.&#xA;For this to work, visit the lossage buffer, and call&#xA;M-x rename-buffer Lossage RET&quot;&#xA;  (save-excursion&#xA;    (let ((b (get-buffer &quot;Lossage&quot;)))&#xA;      (when (buffer-live-p b)&#xA;        (with-current-buffer b&#xA;          (revert-buffer nil 'noconfirm))))))&#xA;(add-hook 'post-command-hook #'update-lossage-buffer nil 'local)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="104" LastEditDate="2014-09-24T12:53:23.950" LastActivityDate="2014-09-24T12:53:23.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="132" PostTypeId="2" ParentId="107" CreationDate="2014-09-24T07:15:00.600" Score="9" Body="&lt;p&gt;This is a bit disppointing, because &lt;code&gt;ffap.el&lt;/code&gt; has some code that &lt;em&gt;should&lt;/em&gt; do just that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; Immediate rejects (/ and // and /* are too common in C/C++):&#xA;     ((member name '(&quot;&quot; &quot;/&quot; &quot;//&quot; &quot;/*&quot; &quot;.&quot;)) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But unfortunately, it relies on there being a space after the comment separator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also &lt;em&gt;very&lt;/em&gt; disappointing, because comment markers should never be part of any string-at-point.&#xA;So here's a patched version of &lt;code&gt;ffap-string-at-point&lt;/code&gt; that tries to systematically ignore those markers&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ffap)&#xA;(defun ffap-string-at-point (&amp;amp;optional mode)&#xA;  (let* ((args&#xA;      (cdr&#xA;       (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)&#xA;           (assq 'file ffap-string-at-point-mode-alist))))&#xA;         next-comment&#xA;     (pt (point))&#xA;     (beg (if (use-region-p)&#xA;          (region-beginning)&#xA;        (save-excursion&#xA;          (skip-chars-backward (car args))&#xA;          (skip-chars-forward (nth 1 args) pt)&#xA;                  (save-excursion&#xA;                    (setq next-comment&#xA;                          (progn (comment-search-forward (line-end-position) t)&#xA;                                 (point))))&#xA;          (point))))&#xA;     (end (if (use-region-p)&#xA;          (region-end)&#xA;        (save-excursion&#xA;          (skip-chars-forward (car args))&#xA;          (skip-chars-backward (nth 2 args) pt)&#xA;          (point)))))&#xA;  (when (&amp;gt; end next-comment)&#xA;    (setq beg next-comment))&#xA;  (setq ffap-string-at-point&#xA;      (buffer-substring-no-properties&#xA;       (setcar ffap-string-at-point-region beg)&#xA;       (setcar (cdr ffap-string-at-point-region) end)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By side effect it fixes your problem, but it's much more general.&#xA;I'm wondering if such a fix should be integrated upstream.&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="115" LastEditDate="2014-11-03T14:35:34.723" LastActivityDate="2014-11-03T14:35:34.723" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="133" PostTypeId="1" AcceptedAnswerId="181" CreationDate="2014-09-24T07:16:38.160" Score="3" ViewCount="1625" Body="&lt;p&gt;My company's firewall only allow http and https connections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To access internet, I have to specify the proxy before connecting the internet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export http_proxy=http://my-company.com&#xA;export https_proxy=http://my-company.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's the current situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how can I use Gnus to access Gmail's IMAP server through? What's the setup? Has anyone actually done this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've no problem to connect Gmail's IMAP server without proxy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did some investigation,&#xA;looks Gnus is using openssl to connect to the Gnus. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the first step is &lt;a href=&quot;https://stackoverflow.com/questions/3220419/openssl-s-client-using-a-proxy&quot;&gt;ask openssl to use proxy&lt;/a&gt; (because Gnus is using openssl)&#xA;but I've not succeeded yet.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-09-26T23:38:18.167" Title="How can I use Gnus to access Gmail IMAP through http(s) firefwall?" Tags="|gnus|email|imap|proxy|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="134" PostTypeId="2" ParentId="102" CreationDate="2014-09-24T07:19:10.903" Score="48" Body="&lt;p&gt;I prefer &lt;code&gt;setq&lt;/code&gt; over &lt;code&gt;customize&lt;/code&gt; for several reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First and foremost, it allows variables to be set programatically (as in, &lt;code&gt;(setq foo (calculate-foo))&lt;/code&gt;). I use this power all the time in my configuration to keep things DRY. For me, the whole point of using Emacs is programmability, and the &lt;code&gt;customize&lt;/code&gt; interface does nothing but get in the way.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;setq&lt;/code&gt; lends itself better to version control and code organization. I split my initialization between dozens of files; if everything was in one huge &lt;code&gt;custom.el&lt;/code&gt; file, it would be much harder to quickly find and edit settings.&lt;/li&gt;&#xA;&lt;li&gt;This is subjective, but to me the whole &lt;code&gt;customize&lt;/code&gt; interface feels like a horrible relic from the worst UIs of the 90s. I'd prefer editing text with the power of Emacs any day.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;@Drew makes some good points about some subtleties with &lt;code&gt;:set&lt;/code&gt; and &lt;code&gt;:initialize&lt;/code&gt;. I've been using Emacs for years and have rarely encountered problems like that. When I do, it's easy to swap out &lt;code&gt;setq&lt;/code&gt; for &lt;code&gt;custom-set-variable&lt;/code&gt; in specific cases.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2015-05-23T02:40:15.600" LastActivityDate="2015-05-23T02:40:15.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="135" PostTypeId="2" ParentId="122" CreationDate="2014-09-24T07:25:34.170" Score="11" Body="&lt;p&gt;Yes. There's a package called &lt;code&gt;mwe-log-commands&lt;/code&gt;, which is available &lt;a href=&quot;https://github.com/overtone/live-coding-emacs/blob/master/lib/mwe-log-commands.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;on GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Just run &lt;code&gt;M-x mwe:log-keyboard-commands&lt;/code&gt; to start recording, then &lt;code&gt;M-x mwe:open-command-log-buffer&lt;/code&gt; will open a buffer which shows the typed commands in real time.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/lewang/command-log-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;command-log-mode&lt;/a&gt; is a newer and more actively-maintained fork of &lt;code&gt;mwe-log-commands&lt;/code&gt;, so it might be preferable these days.&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="29238" LastEditDate="2023-02-16T10:05:09.153" LastActivityDate="2023-02-16T10:05:09.153" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="136" PostTypeId="2" ParentId="122" CreationDate="2014-09-24T07:46:30.063" Score="22" Body="&lt;p&gt;Addressing the last question in your post: you can get an auto-updating log of commands &amp;amp; key strokes by using &lt;a href=&quot;https://github.com/lewang/command-log-mode&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/lewang/command-log-mode&lt;/a&gt; which is also available on MELPA - by default it only shows non-trivial commands (so no self-insert or cursor movement commands). It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jf5ge.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="204" LastActivityDate="2014-09-24T07:46:30.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="137" PostTypeId="2" ParentId="17" CreationDate="2014-09-24T08:03:42.083" Score="4" Body="&lt;p&gt;This isn't an answer per se but it might improve the UX to something more of your liking: if you set &lt;code&gt;helm-mode-reverse-history&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; it will put the &quot;Emacs Command History&quot; source after &quot;Emacs Commands&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or from the Emacs docs themselves:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Display history source after current source in &lt;code&gt;helm-mode&lt;/code&gt; handled commands.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="214" LastEditorUserId="504" LastEditDate="2014-11-19T19:16:41.110" LastActivityDate="2014-11-19T19:16:41.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="139" PostTypeId="2" ParentId="101" CreationDate="2014-09-24T08:47:14.533" Score="3" Body="&lt;p&gt;My first suggestion would be to try the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'message-send-hook (lambda () (org-store-link nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since you said you tried the hook, another way is to just combine&#xA;&lt;code&gt;org-store-link&lt;/code&gt; and message sending into a single function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun store-link-then-send-message ()&#xA;  &quot;Call `org-store-link', then send current email message.&quot;&#xA;  (interactive)&#xA;  (call-interactively #'org-store-link)&#xA;  (call-interactively #'message-send-and-exit))&#xA;&#xA;(define-key mu4e-compose-mode-map &quot;\C-c\C-c&quot; #'store-link-then-send-message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This assumes you're using &lt;code&gt;message-send-and-exit&lt;/code&gt; to send the message. You could do something identical with the &lt;code&gt;message-send&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key mu4e-compose-mode-map &quot;\C-c\C-c&quot; #'store-link-then-send-message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-24T10:25:31.270" LastActivityDate="2014-09-24T10:25:31.270" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="140" PostTypeId="1" AcceptedAnswerId="150" CreationDate="2014-09-24T09:09:02.640" Score="14" ViewCount="387" Body="&lt;p&gt;90% of the time I visit a directory in Emacs, the first thing I do is&#xA;move point to a specific file and open it. A lot of times, the file I&#xA;need to open is very predictable. For instance:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If there are &lt;code&gt;.tex&lt;/code&gt; files in this directory, I usually go straight to &lt;code&gt;master.tex&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;At the root of Android projects, it's commonly &lt;code&gt;AndroidManifest.xml&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In a directory where I develop an emacs package, it's almost always&#xA;the package's main source file. That's usually, but not always, the&#xA;only &lt;code&gt;.el&lt;/code&gt; file in this directory.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way I can have dired automatically place point on these&#xA;  files when I open these directories?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would offer a lot of convenience (as I could open them by just&#xA;hitting &lt;kbd&gt;RET&lt;/kbd&gt;), but would still give the flexibility of&#xA;visiting other files.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-25T18:10:44.220" LastActivityDate="2014-09-25T18:10:44.220" Title="In dired buffers, place point on the most important file of that directory" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="141" PostTypeId="1" CreationDate="2014-09-24T09:10:05.200" Score="26" ViewCount="9493" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;OS: OS X 10.9.5, Mavericks&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, Carbon Version 1.6.0&#xA;  AppKit 1265.19) of 2014-04-03 on Rainers-MacBook-Pro-3.local&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I installed emacs via &lt;a href=&quot;http://brew.sh&quot;&gt;homebrew&lt;/a&gt; from &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot;&gt;railwaycat&lt;/a&gt; and it works nicely - no complaints. I do not use emacs in the termoinal, and I usually start it via the Application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said - I am happy so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just have one thing I did not manage to get right (which worked nicely under linux before), which is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;get emacs daemon starting upon login &lt;/li&gt;&#xA;&lt;li&gt;using emacsclient to open&lt;/li&gt;&#xA;&lt;li&gt;close emacsdaemon and save al files upon logoff&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any working recipes which could help me to set this up?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Added information&lt;/h2&gt;&#xA;&#xA;&lt;h2&gt;To start an emacs daemon upon login&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I created an Automator Application executing the bash command &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/local/bin/emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and added it to the Login Items which works nicely.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Utilising daemon from terminal&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I can utilise the emacs daemon by using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient .bashrc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which opens .bashrc in an emacs terminal session.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Utilising from GUI&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now remains the question: how can I utilise it from the GUI? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand the emacsclient, I can not open an emacsclient unless I specify a file to open. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to open an emacsclient GUI and open &lt;strong&gt;all files which were previously opened&lt;/strong&gt;? Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found out that I can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in a terminal to do what I want - but can I do the same for the GUI?&lt;/p&gt;&#xA;" OwnerUserId="225" LastEditorUserId="225" LastEditDate="2014-09-25T08:59:33.213" LastActivityDate="2017-05-13T00:43:32.520" Title="Emacsdaemon and Emacsclient on Mac" Tags="|daemon|emacsclient|osx|" AnswerCount="5" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="142" PostTypeId="5" CreationDate="2014-09-24T09:13:37.783" Score="0" Body="&lt;p&gt;Gnus is a news and mail reader.  It can display messages from a variety of sources, called &quot;select methods&quot;, including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;newsgroups from an NNTP server&lt;/li&gt;&#xA;&lt;li&gt;newsgroups from a local spool&lt;/li&gt;&#xA;&lt;li&gt;mail from a local directory (mbox, maildir etc supported)&lt;/li&gt;&#xA;&lt;li&gt;mail from an IMAP server&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A stable version of Gnus is included in Emacs.  Gnus is &lt;a href=&quot;http://gnus.org/distribution.html&quot; rel=&quot;nofollow&quot;&gt;developed in a separate repository&lt;/a&gt;, which is regularly synced with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Gnus manual is accessible from Emacs' Info facility, but can also be &lt;a href=&quot;http://gnus.org/manual.html&quot; rel=&quot;nofollow&quot;&gt;read online&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="11" LastEditDate="2014-09-24T16:18:08.663" LastActivityDate="2014-09-24T16:18:08.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="143" PostTypeId="4" CreationDate="2014-09-24T09:13:37.783" Score="0" Body="is the flexible built-in message reader in Emacs. It supports reading and composing both news and mail. It can also use web-based sources as inputs for its groups." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-16T03:57:41.070" LastActivityDate="2017-02-16T03:57:41.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="144" PostTypeId="1" CreationDate="2014-09-24T09:14:34.567" Score="6" ViewCount="695" Body="&lt;p&gt;When I open a directory using dired and there is already the same directory opened in dired, a second one is opened with &lt;code&gt;&amp;lt;2&amp;gt;&lt;/code&gt;. How can I inhibit this creation of the duplicate window and switch to the existing one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can set dired to use only one window, but I just do not want to have two dired windows for the same directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dired naturally does this when I open the same path twice. But I access the same directory via different paths (via symlinked paths), I seem to have the duplicates. How can I reuse the same window when I access the same directory through different paths because of symbolic links?&lt;/p&gt;&#xA;" OwnerUserId="225" LastEditorUserId="25" LastEditDate="2014-09-26T23:43:05.720" LastActivityDate="2014-09-26T23:43:05.720" Title="Stop dired opening second window of already open directory" Tags="|dired|symbolic-links|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="145" PostTypeId="1" AcceptedAnswerId="151" CreationDate="2014-09-24T09:20:31.507" Score="12" ViewCount="430" Body="&lt;p&gt;I'm trying to get familiar with Emacs Lisp, its syntax, data structures etc, so I was wondering what are some built-in packages whose source could help me better understand how to use the language and learn its idioms?&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2015-12-16T12:26:24.267" Title="What are some built-in packages with nice source code?" Tags="|elisp|package|learning|" AnswerCount="2" CommentCount="4" ClosedDate="2014-09-26T00:09:49.467" ContentLicense="CC BY-SA 3.0" />
  <row Id="146" PostTypeId="1" AcceptedAnswerId="152" CreationDate="2014-09-24T09:27:44.000" Score="19" ViewCount="6979" Body="&lt;p&gt;I am particularly interested in the full Windows experience including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Automatically starting a server if one is not already started&lt;/li&gt;&#xA;&lt;li&gt;How to call emacs so that it utilizes the server (e.g. from command line or third party tools)&lt;/li&gt;&#xA;&lt;li&gt;Context menu support (e.g. right-click on a file and allow it to be sent to emacs for viewing and editing)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is such support available out of the box anywhere?&lt;/p&gt;&#xA;" OwnerUserId="228" LastEditorUserId="25" LastEditDate="2014-09-26T23:45:58.657" LastActivityDate="2014-12-30T16:12:06.393" Title="Set up Emacs on Windows to start a single instance and open files in the existing instance" Tags="|microsoft-windows|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="147" PostTypeId="1" AcceptedAnswerId="155" CreationDate="2014-09-24T09:41:21.340" Score="116" ViewCount="46945" Body="&lt;p&gt;As a programmer, I want to see a ruler at a specific column (usually 80), both so I see when I cross that column, but also to see how close I am getting to it so I can reformat my code early.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The options I have found so far are all not achieving this goal:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;whitespace-mode&lt;/code&gt;, &lt;a href=&quot;https://github.com/jordonbiondo/column-enforce-mode/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;column-enforce-mode&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;http://www.emacswiki.org/emacs/column-marker.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;column-marker&lt;/code&gt;&lt;/a&gt; only highlight individual rows after the text in the row has already passed the &lt;code&gt;fill-column&lt;/code&gt;. I'd like to see when I am getting close to the column, not just when I cross it.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/alpaker/Fill-Column-Indicator&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;fill-column-indicator&lt;/code&gt;&lt;/a&gt; would be a good solution, except it breaks &lt;code&gt;auto-complete-mode&lt;/code&gt;, &lt;code&gt;company-mode&lt;/code&gt;, &lt;code&gt;avy&lt;/code&gt;, and more. These are issues that seem hard to fix, each requiring an individual workaround -- e.g., see &lt;a href=&quot;https://github.com/alpaker/Fill-Column-Indicator/issues/54&quot; rel=&quot;noreferrer&quot;&gt;the &lt;code&gt;company-mode&lt;/code&gt; issue&lt;/a&gt; and &lt;a href=&quot;https://github.com/alpaker/Fill-Column-Indicator/issues/21&quot; rel=&quot;noreferrer&quot;&gt;the &lt;code&gt;auto-complete-mode&lt;/code&gt; issue&lt;/a&gt;, the latter over two years old).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Are there any better alternatives?&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="13444" LastEditDate="2017-07-17T17:46:48.250" LastActivityDate="2023-04-15T09:39:52.590" Title="How can I get a ruler at column 80?" Tags="|display|font-lock|programming|" AnswerCount="9" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="148" PostTypeId="2" ParentId="7" CreationDate="2014-09-24T09:45:10.690" Score="8" Body="&lt;p&gt;If the distance not big you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/move-text.el&quot; rel=&quot;noreferrer&quot;&gt;move-text&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1wAve.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of key strokes, for me it is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Select region:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-SPC&lt;/kbd&gt;&lt;kbd&gt;C-n&lt;/kbd&gt;&lt;kbd&gt;C-n&lt;/kbd&gt;&lt;kbd&gt;C-n&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Move region:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;H-S-n&lt;/kbd&gt;&lt;kbd&gt;H-S-n&lt;/kbd&gt;&lt;kbd&gt;H-S-n&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;move-text-down&lt;/code&gt; is binded to &lt;kbd&gt;H-S-n&lt;/kbd&gt;)&lt;/p&gt;&#xA;" OwnerUserId="137" LastActivityDate="2014-09-24T09:45:10.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="149" PostTypeId="2" ParentId="147" CreationDate="2014-09-24T09:55:19.277" Score="27" Body="&lt;p&gt;Here is one option which is more robust, it breaks almost nothing&#xA;(occasionally company-mode being a noteworthy exception), but is not as convenient&#xA;as &lt;code&gt;fill-column-indicator&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use &#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/header-line-format&quot;&gt;header-line-format&lt;/a&gt;&#xA;to mark the 80th column on the header.&lt;/strong&gt;&lt;br&gt;&#xA;Something like the following should suffice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default header-line-format &#xA;              (list &quot; &quot; (make-string 79 ?-) &quot;|&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should change the number of spaces in that first string depending&#xA;on the size of your left fringe. But other than that, this should work reasonably well.&#xA;It's not as convenient as a ruler in the actual buffer, but it helps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also set it to apply only on programming buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun prog-mode-header-line ()&#xA;  &quot;Setup the `header-line-format' on for buffers.&quot;&#xA;  (setq header-line-format &#xA;        (list &quot; &quot; (make-string 79 ?-) &quot;|&quot;)))&#xA;&#xA;(add-hook 'prog-mode-hook #'prog-mode-header-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;br&gt;&#xA;You should get something like the following (the first line is not actually in the buffer, but in the header). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-------------------------------------------------------------------------------|&#xA;;; This is what your buffer should look like all the way up to column number 80.&#xA;(setq some-dummy-variable we-are-all-friends)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-24T10:53:30.070" LastActivityDate="2014-09-24T10:53:30.070" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="150" PostTypeId="2" ParentId="140" CreationDate="2014-09-24T10:09:12.363" Score="16" Body="&lt;p&gt;Write a custom function for &lt;code&gt;dired-initial-position-hook&lt;/code&gt;.  In this function you can use various dired functions to search for files, and eventually call &lt;code&gt;dired-goto-file&lt;/code&gt; to move point to the “best” file:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-dired-goto-important-file ()&#xA;  &quot;Go to an important file in the current dired buffer.&quot;&#xA;  (unless (bound-and-true-p save-place)&#xA;    (let ((candidates '(&quot;master.tex&quot; &quot;AndroidManifest.xml&quot;))&#xA;          candidate)&#xA;      (while (and candidates&#xA;                  (not (dired-goto-file (expand-file-name (pop candidates)))))&#xA;        nil))))&#xA;&#xA;(add-hook 'dired-initial-position-hook #'my-dired-goto-important-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the following I'll explain specific aspects of this function, and highlight potential extensions.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Jumping to files&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dired-goto-file&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; if the file does not exist in the current dired buffer, so it's safe to call without prior checking.  However &lt;code&gt;dired-goto-file&lt;/code&gt; requires an &lt;strong&gt;absolute&lt;/strong&gt; file name (it errors on relative names), hence &lt;code&gt;expand-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Searching for files&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Dired does not provide a straight-forward API to search for files.  Generally, you can iterate over all files just like you'd iterate over all lines in a buffer:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let (files)&#xA;  (goto-char (point-min))&#xA;  (while (not (eobp))&#xA;    (let ((filename (dired-get-filename nil 'no-error)))&#xA;      (when filename&#xA;        (push filename files)))&#xA;    (forward-line 1))&#xA;  ;; Now `files' is a list of files, which you can search for patterns&#xA;  ;; …&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it's more convenient to use the marking functions.  Just take care to use an “unusual” marker characters, to not loose existing interactive marks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unwind-protect&#xA;    (when (dired-mark-files-regexp (rx &quot;.tex&quot; string-end) ?t)&#xA;      (dired-goto-file (expand-file-name &quot;master.tex&quot;)))&#xA;  (dired-unmark-all-files ?t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Save Place Mode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You also need to be careful with regards to Save Place Mode, in case you enabled it.&#xA;In Dired buffers, Save Place Mode does not remember the point value as in other modes, but rather the last file name point was on.  It restores this file name just like we do: It hooks into &lt;code&gt;dired-initial-position-hook&lt;/code&gt; and calls &lt;code&gt;dired-goto-file&lt;/code&gt; (in fact, that's where I stole that code from :) ).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If our hook comes before save place, Save Place Mode will unconditionally overwrite our position.  However, if it comes before our hook (as is the case when Save Place is enabled after you setup this hook) our function would actually overwrite Save Place which is not desirable.  However, as in any buffer, Save Place sets the local variable &lt;code&gt;save-place&lt;/code&gt; to a non-nil value, so we can simply check that and only act it Save Place did not restore a file name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you'd rather have Save Place “loose”, remove the check for &lt;code&gt;save-place&lt;/code&gt;, and make sure that our hook is run &lt;em&gt;after&lt;/em&gt; Save Place, by enabling Save Place Mode &lt;strong&gt;first&lt;/strong&gt;, and then calling &lt;code&gt;add-hook&lt;/code&gt; with a non-nil value for its &lt;code&gt;APPEND&lt;/code&gt; argument.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-09-24T10:09:12.363" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="151" PostTypeId="2" ParentId="145" CreationDate="2014-09-24T10:28:22.977" Score="12" Body="&lt;p&gt;I can recommend Ruby Mode in &lt;code&gt;ruby-mode.el&lt;/code&gt; and Python Mode in &lt;code&gt;python.el&lt;/code&gt;, for some aspects of their implementation.  The former is a particularly great source for advanced indentation and navigation code based on the new SMIE engine.  However, neither uses data structures in any particularly clever or advanced way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also recommend some parts of Org Mode 8, for its design.  Notably the exporter framework of Org 8 shows how to create an generic, extensible, object-like framework in plain Emacs Lisp.  However, I'd recommend against most other parts of Org, for reasons already stated in comments:  It's old, and full of legacy and harmful practices (e.g. &lt;code&gt;find-file-noselect&lt;/code&gt; to read files non-interactively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gnus is also said to have good code, but again I'd be careful to determine how well-maintained the particular piece of code is that you are looking at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Emacs itself is very old, and only superficially maintained in many places, the &lt;strong&gt;average&lt;/strong&gt; quality of its code is actually rather low by modern standards.   There's many legacy stuff in there. For instance, even in core parts such as the byte compiler you'll find “TODO”s and “DUNNO”s dating back years, if not decades.  Also, since Emacs is very slow to take code and developers from the “outside” community due to the restrictive policies established by the FSF, the overall quality increases only slowly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, you are more likely to find good code in popular 3rd party packages maintained by high-profile community members, e.g. Magit, Projectile, etc.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="124" LastEditDate="2015-12-16T12:26:24.267" LastActivityDate="2015-12-16T12:26:24.267" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="152" PostTypeId="2" ParentId="146" CreationDate="2014-09-24T10:49:55.417" Score="22" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Automatically starting a server if one is not already started&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This should be the same for any Emacs build. Add this snippet to your&#xA;&lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;.emacs.d/init.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(unless (server-running-p)&#xA;  (server-start)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then just start emacs by running the &lt;code&gt;runemacs.exe&lt;/code&gt; executable that comes with the build.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How to call emacs so that it utilizes the server (e.g. from command line or third party tools)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs' Windows build comes with an &lt;code&gt;emacsclientw.exe&lt;/code&gt; executable in the&#xA;&lt;code&gt;bin/&lt;/code&gt; directory. Use the &lt;strong&gt;full path&lt;/strong&gt; to that executable as your editor&#xA;of choice on any third party tools you need to configure.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Context menu support (e.g. right-click on a file and allow it to be sent to emacs for viewing and editing)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Right click on a file, select &lt;code&gt;Open With -&amp;gt; Select Default Program&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In the window that pops up, navigate to your &lt;code&gt;emacsclientw.exe&lt;/code&gt; executable mentioned above and choose it.&lt;/li&gt;&#xA;&lt;li&gt;If you don't want Emacs to be the default, do steps 1 and 2 again, choosing a different program as the default.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacsclientw.exe&lt;/code&gt; will now always be an option in the context menu.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="228" LastEditDate="2014-12-30T16:12:06.393" LastActivityDate="2014-12-30T16:12:06.393" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="153" PostTypeId="2" ParentId="144" CreationDate="2014-09-24T11:08:07.290" Score="0" Body="&lt;p&gt;You can try out the &lt;code&gt;dired-single&lt;/code&gt; package from Melpa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This package, though, does more than what you asked for. It creates a &lt;code&gt;dired-single-magic-buffer&lt;/code&gt;; it always updates the same buffer whether or not you opened the same dired directory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more about it on this &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredReuseDirectoryBuffer&quot; rel=&quot;nofollow&quot;&gt;emacswiki&lt;/a&gt; page. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-09-24T11:08:07.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="154" PostTypeId="2" ParentId="144" CreationDate="2014-09-24T11:41:20.213" Score="4" Body="&lt;p&gt;Using &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;dired+&lt;/a&gt;, which brings other cool improvements to dired, you only need to set the &lt;code&gt;toggle-diredp-find-file-reuse-dir&lt;/code&gt; var to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-09-24T11:41:20.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="155" PostTypeId="2" ParentId="147" CreationDate="2014-09-24T11:47:32.217" Score="58" Body="&lt;p&gt;&lt;strong&gt;Note that as of Emacs 27, you should probably use the built-in &lt;code&gt;display-fill-column-indicator-mode&lt;/code&gt;, as noted by the newer answer from Basil.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;fill-column-indicator&lt;/code&gt; is the most mature solution, and if you find overlay-based code with which it conflicts, you can add code to suspend &lt;code&gt;fci-mode&lt;/code&gt; while the conflicting code is active. For example, the following code makes it work with &lt;code&gt;auto-complete&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;  (defun sanityinc/fci-enabled-p () (symbol-value 'fci-mode))&#xA;&#xA;  (defvar sanityinc/fci-mode-suppressed nil)&#xA;  (make-variable-buffer-local 'sanityinc/fci-mode-suppressed)&#xA;&#xA;  (defadvice popup-create (before suppress-fci-mode activate)&#xA;    &amp;quot;Suspend fci-mode while popups are visible&amp;quot;&#xA;    (let ((fci-enabled (sanityinc/fci-enabled-p)))&#xA;      (when fci-enabled&#xA;        (setq sanityinc/fci-mode-suppressed fci-enabled)&#xA;        (turn-off-fci-mode))))&#xA;&#xA;  (defadvice popup-delete (after restore-fci-mode activate)&#xA;    &amp;quot;Restore fci-mode when all popups have closed&amp;quot;&#xA;    (when (and sanityinc/fci-mode-suppressed&#xA;               (null popup-instances))&#xA;      (setq sanityinc/fci-mode-suppressed nil)&#xA;      (turn-on-fci-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2021-05-21T02:02:29.690" LastActivityDate="2021-05-21T02:02:29.690" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="156" PostTypeId="1" AcceptedAnswerId="180" CreationDate="2014-09-24T12:10:37.323" Score="11" ViewCount="1081" Body="&lt;p&gt;I have many documents as org-files which have a CUSTOM_LABEL property, like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;* Introduction&#xA;  :PROPERTIES:&#xA;  :CUSTOM_LABEL: AP 1&#xA;  :END:&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the files need to be exported as LaTeX, translating each &lt;code&gt;CUSTOM_LABEL&lt;/code&gt; as a &lt;code&gt;\label{marker}&lt;/code&gt;. The example above should translate to &lt;code&gt;\label{AP 1}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know already how to call custom functions at export time, but I am not expert enough to write a defun to do that particular conversion, ie &lt;code&gt;CUSTOM_LABEL&lt;/code&gt; -&gt; &lt;code&gt;\label{}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can the defun to inject a &lt;code&gt;custom_label&lt;/code&gt; as &lt;code&gt;\label{}&lt;/code&gt; be written?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate even just some pseudo-code, or some pointers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asking this question here instead of other places, because this is more an Emacs question, since I searched thoroughly the org-mode manual, and that kind of feature is currently unavailable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A generic function to convert a given PROPERTY when exporting (LaTeX, HTML, or any other format), would be even better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="50" LastEditDate="2014-10-06T22:10:41.627" LastActivityDate="2015-04-20T20:34:37.560" Title="Emacs function to convert an arbitrary ORG PROPERTY into an arbitrary string (namely, a LaTeX label)?" Tags="|org-mode|elisp|org-export|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="157" PostTypeId="2" ParentId="156" CreationDate="2014-09-24T12:27:24.337" Score="1" Body="&lt;p&gt;I'm not sure, but you likely need to advise or even overwrite the exporter function.  In Org 8, that is &lt;code&gt;org-latex-export-headline&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function gets the headline element, the headline contents and an additional property list.  Within the exporter function, you can get element properties (including your custom label) with &lt;code&gt;org-element-property&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-09-24T12:27:24.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="158" PostTypeId="2" ParentId="146" CreationDate="2014-09-24T12:34:01.147" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Automatically starting a server if one is not already started&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I highly recommend setting an environment variable for &lt;code&gt;ALTERNATE_EDITOR&lt;/code&gt; to &lt;code&gt;runemacs.exe&lt;/code&gt;. This way you can always call emacsclient even if there is no server. Just add (server-start) to your init file. When a server does not exist emacsclient calls the &lt;code&gt;ALTERNATE_EDITOR&lt;/code&gt; which is emacs in our case. Since emace starts up a server in the init file, any new calls to emacsclient will be instantaneous.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How to call emacs so that it utilizes the server (e.g. from command line or third party tools)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;emacsclientw.exe -c -n &quot;your_file&quot;&lt;/code&gt; to open your_file . The &lt;code&gt;-c&lt;/code&gt; argument creates a new graphical frame and &lt;code&gt;-n&lt;/code&gt; allows you to close the frame without losing server state. You can even call it without a filename to open the &lt;code&gt;*Scratch*&lt;/code&gt; buffer. Works from a desktop shortcut also. Using &lt;code&gt;emacsclient.exe&lt;/code&gt; (note the missing w) will pop up a command prompt for a few seconds everytime you call it.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Adding to context menu&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacswiki has a nice page on adding Emacs to the context menu &lt;a href=&quot;http://www.emacswiki.org/emacs/ContextMenu&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. It involves editing the registry node &lt;code&gt;HKEY_CLASSES_ROOT\*&lt;/code&gt; to add an action to open with emacs.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-24T12:34:01.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="160" PostTypeId="2" ParentId="70" CreationDate="2014-09-24T12:58:48.890" Score="18" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/Silex/elmacro&quot;&gt;elmacro&lt;/a&gt; package lets you view the last recorded macro as proper Emacs Lisp with &lt;kbd&gt;M-x elmacro-show-last-macro&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-09-24T12:58:48.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="161" PostTypeId="5" CreationDate="2014-09-24T12:59:08.973" Score="0" Body="&lt;p&gt;&lt;a href=&quot;/questions/tagged/mu4e&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;mu4e&amp;#39;&quot; rel=&quot;tag&quot;&gt;mu4e&lt;/a&gt; efficiently handles e-mail searching, reading, replying, moving, and deleting. &lt;a href=&quot;/questions/tagged/mu4e&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;mu4e&amp;#39;&quot; rel=&quot;tag&quot;&gt;mu4e&lt;/a&gt; is primarily an optimized filter system for the &lt;code&gt;mailbox&lt;/code&gt;. &lt;a href=&quot;/questions/tagged/mu4e&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;mu4e&amp;#39;&quot; rel=&quot;tag&quot;&gt;mu4e&lt;/a&gt; does not send or fetch &lt;a href=&quot;/questions/tagged/email&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;email&amp;#39;&quot; rel=&quot;tag&quot;&gt;email&lt;/a&gt; messages, instead relying on other tools, such as &lt;code&gt;fetchmail&lt;/code&gt; and &lt;a href=&quot;/questions/tagged/smtpmail&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;smtpmail&amp;#39;&quot; rel=&quot;tag&quot;&gt;smtpmail&lt;/a&gt;. &lt;a href=&quot;/questions/tagged/mu4e&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;mu4e&amp;#39;&quot; rel=&quot;tag&quot;&gt;mu4e&lt;/a&gt; works well with the &lt;a href=&quot;/questions/tagged/gnus&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;gnus&amp;#39;&quot; rel=&quot;tag&quot;&gt;gnus&lt;/a&gt; message editor to complete features needed for an email client for Emacs.  &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/mu4e&quot; rel=&quot;nofollow noreferrer&quot;&gt;mu4e&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="91" LastEditorUserId="7045" LastEditDate="2017-02-27T16:44:15.207" LastActivityDate="2017-02-27T16:44:15.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="162" PostTypeId="4" CreationDate="2014-09-24T12:59:08.973" Score="0" Body="mu4e is an e-mail client for Emacs based on the mu indexer and searcher." OwnerUserId="129" LastEditorUserId="7045" LastEditDate="2017-02-24T21:11:12.057" LastActivityDate="2017-02-24T21:11:12.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="164" PostTypeId="1" AcceptedAnswerId="166" CreationDate="2014-09-24T13:11:22.980" Score="8" ViewCount="1325" Body="&lt;p&gt;I am using BBDB3 with Gnus. I want to make BBDB to update the recipient address in its database for each mail I send (just like Gmail does). Is it possible?&lt;/p&gt;&#xA;" OwnerUserId="224" LastEditorUserId="330" LastEditDate="2014-09-27T00:17:36.153" LastActivityDate="2015-03-31T21:07:17.607" Title="Automatically add recipients' mail address to the BBDB database" Tags="|gnus|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="165" PostTypeId="1" AcceptedAnswerId="175" CreationDate="2014-09-24T13:27:04.290" Score="11" ViewCount="361" Body="&lt;p&gt;I want to use Emacs in a frame-oriented fashion and let my tiling window manager handle buffer organization. For example, following this &lt;a href=&quot;http://compsoc.man.ac.uk/~shep/tearing-out-the-emacs-window-manager.html&quot;&gt;tutorial&lt;/a&gt;. By default, Emacs packages such as undo-tree-mode seem to be dependent on windows to display the visualization. Am I wrong on this? Can I make undo-tree-mode default to opening the visualizer in another frame?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2014-09-24T13:36:02.033" LastActivityDate="2014-09-24T15:19:03.843" Title="Configuring Emacs and especially undo-tree-mode for tiling window managers" Tags="|frames|undo-tree-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="166" PostTypeId="2" ParentId="164" CreationDate="2014-09-24T13:40:41.503" Score="5" Body="&lt;p&gt;Certainly, this is Emacs ! :)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bbdb-initialize 'gnus 'message)&#xA;(bbdb-mua-auto-update-init 'message) ;; use 'gnus for incoming messages too&#xA;(setq bbdb-mua-auto-update-p 'query) ;; or 'create to create without asking&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will parse fields in outgoing messages, and suggest creation of corresponding BBDB entries&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-24T13:40:41.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="167" PostTypeId="1" AcceptedAnswerId="838" CreationDate="2014-09-24T13:56:05.527" Score="6" ViewCount="705" Body="&lt;p&gt;When using Whitespace Mode with the &lt;code&gt;empty&lt;/code&gt; style enabled, the blank lines at the end of a file aren't highlighted if I'm on the very last line.  However, I also don't want them to be highlighted if I'm on the line before last, since it visually interferes with appending text to the end of a file.  For instance, say I have an unsaved buffer which looks like this, where &lt;code&gt;$&lt;/code&gt; denotes a newline character and &lt;code&gt;|&lt;/code&gt; denotes point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.|$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I decide to add a new paragraph:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.$&#xA;$&#xA;|$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whitespace Mode will now highlight the two blank lines at the end.  However, as soon as I start writing text, it becomes obvious that there isn't, in fact, any issue with those blank lines since my point is positioned to rectify them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.$&#xA;$&#xA;Pellentesque quis metus eget urna dictum pulvinar.|$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Therefore, how can I prevent Whitespace Mode from highlighting the blank lines in the situation just before I start typing &lt;code&gt;Pellentesque&lt;/code&gt;, when my point is on the second-to-last blank line?&lt;/p&gt;&#xA;" OwnerUserId="49" LastEditorUserId="49" LastEditDate="2014-09-24T16:27:17.813" LastActivityDate="2014-10-08T02:17:58.077" Title="Prevent whitespace-mode from overzealously highlighting blank lines at end" Tags="|whitespace-mode|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="168" PostTypeId="2" ParentId="147" CreationDate="2014-09-24T14:38:19.737" Score="9" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/RulerMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;This EmacsWiki page&lt;/em&gt;&lt;/a&gt; is about &lt;strong&gt;Ruler Mode&lt;/strong&gt;, a minor mode that shows a ruler for columns at the top of a window.&lt;/p&gt;&#xA;&lt;p&gt;It also shows you the current column and the positions of &lt;code&gt;comment-column&lt;/code&gt;, &lt;code&gt;fill-column&lt;/code&gt;, &lt;code&gt;goal-column&lt;/code&gt;, and the tab stops (as in &lt;code&gt;tab-stop-list&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;And &lt;a href=&quot;https://www.emacswiki.org/emacs/PopupRuler&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;this EmacsWiki page&lt;/em&gt;&lt;/a&gt; is about a ruler that pops up on demand, then disappears.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/EightyColumnRule&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;This other EmacsWiki page&lt;/em&gt;&lt;/a&gt; has lots of information about different ways to mark a particular column or otherwise let you know when you go past it.&lt;/p&gt;&#xA;&lt;p&gt;The one I use is &lt;a href=&quot;http://www.emacswiki.org/emacs/ModeLinePosition&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mode Line Position&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;But others include showing a vertical line at the column (&lt;a href=&quot;http://www.emacswiki.org/emacs/ColumnMarker&quot; rel=&quot;nofollow noreferrer&quot;&gt;Column Marker&lt;/a&gt;, &lt;a href=&quot;http://www.emacswiki.org/emacs/FillColumnIndicator&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fill-Column Indicator&lt;/a&gt;) and using whitespace mode to highlight text that goes past the column.&lt;/p&gt;&#xA;&lt;p&gt;(If you need the line to be far to the right of all text in all rows, you can always turn on &lt;code&gt;picture-mode&lt;/code&gt;, but that is probably useful here only as a temporary workaround.)&lt;/p&gt;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://www.emacswiki.org/emacs/FindLongLines&quot; rel=&quot;nofollow noreferrer&quot;&gt;Find Long Lines&lt;/a&gt; for ways to find long lines on demand.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditorDisplayName="user12563" LastEditDate="2021-02-28T17:33:42.327" LastActivityDate="2021-02-28T17:33:42.327" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="169" PostTypeId="1" AcceptedAnswerId="171" CreationDate="2014-09-24T14:43:40.030" Score="173" ViewCount="114785" Body="&lt;p&gt;I usually work on files which are updated in the file system via version control. What's a quick way to reload a file without having to &lt;code&gt;C-x C-f&lt;/code&gt; the file again and getting asked if I want to reload it?&lt;/p&gt;&#xA;" OwnerUserId="195" LastEditorUserId="105" LastEditDate="2014-09-28T03:38:47.913" LastActivityDate="2024-02-05T00:18:24.770" Title="How do I reload a file in a buffer?" Tags="|files|revert-buffer|" AnswerCount="10" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="170" PostTypeId="2" ParentId="146" CreationDate="2014-09-24T14:49:07.673" Score="5" Body="&lt;p&gt;Others have answered the server part. Here is what I do, to get UNIX / GNU/Linux-like utilities such as &lt;code&gt;grep&lt;/code&gt; and &lt;code&gt;diff&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install &lt;a href=&quot;https://www.cygwin.com/&quot; rel=&quot;noreferrer&quot;&gt;Cygwin&lt;/a&gt; (one-time operation).&lt;/li&gt;&#xA;&lt;li&gt;Load &lt;a href=&quot;http://www.emacswiki.org/emacs/download/cygwin-mount.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;cygwin-mount.el&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Load &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/setup-cygwin.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;setup-cygwin.el&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However, be aware that there are different versions of Cygwin. I use an older version (dunno which one - hard to tell, AFAICT). Dunno whether you will have problems with recent versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/NTEmacsWithCygwin&quot; rel=&quot;noreferrer&quot;&gt;Emacs on Windows with Cygwin&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/EdiffOnWThirtyTwo&quot; rel=&quot;noreferrer&quot;&gt;Ediff on Windows&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-24T14:49:07.673" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="171" PostTypeId="2" ParentId="169" CreationDate="2014-09-24T14:53:35.540" Score="194" Body="&lt;p&gt;&lt;code&gt;M-x revert-buffer&lt;/code&gt; will do exactly what you want. It will still ask for confirmation.&lt;/p&gt;&#xA;&lt;p&gt;Another option (my favorite) is the below function:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Source: https://www.emacswiki.org/emacs/misc-cmds.el&#xA;(defun revert-buffer-no-confirm ()&#xA;    &amp;quot;Revert buffer without confirmation.&amp;quot;&#xA;    (interactive)&#xA;    (revert-buffer :ignore-auto :noconfirm))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="37922" LastEditDate="2022-08-02T12:03:05.207" LastActivityDate="2022-08-02T12:03:05.207" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="172" PostTypeId="2" ParentId="169" CreationDate="2014-09-24T14:57:15.213" Score="11" Body="&lt;p&gt;&lt;code&gt;revert-buffer&lt;/code&gt; is there. But I like to have some feedback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following in my &lt;code&gt;.emacs&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c r&quot;) (lambda ()&#xA;                                (interactive)&#xA;                                (revert-buffer t t t)&#xA;                                (message &quot;buffer is reverted&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="224" LastActivityDate="2014-09-24T14:57:15.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="174" PostTypeId="1" AcceptedAnswerId="179" CreationDate="2014-09-24T15:03:20.147" Score="6" ViewCount="1661" Body="&lt;p&gt;By default org-mode will overlap images of the latex equations for a given section, or for the whole document. If I press &lt;code&gt;C-c C-c&lt;/code&gt; on an equation with an image overlay, all the images are removed. Can I make it so that only the one image is removed (and from which I can recreate the image by typing &lt;code&gt;C-c C-x C-l&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-09-24T17:10:59.557" Title="controlling display of latex equations in org-mode" Tags="|org-mode|latex|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="175" PostTypeId="2" ParentId="165" CreationDate="2014-09-24T15:19:03.843" Score="5" Body="&lt;p&gt;The first basic step would be to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq pop-up-frames t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that &lt;code&gt;display-buffer&lt;/code&gt; always makes a new frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of further (but more complicated) customizations are described in the &lt;a href=&quot;http://www.emacswiki.org/emacs/OneOnOneEmacs&quot;&gt;&quot;One On One&quot; Emacs&lt;/a&gt; project by Drew Adams.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-09-24T15:19:03.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="176" PostTypeId="2" ParentId="167" CreationDate="2014-09-24T15:20:47.893" Score="0" Body="&lt;p&gt;I don't have an answer for doing what you want with &lt;code&gt;whitespace-mode&lt;/code&gt;.  Perhaps someone else will.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative is to use library &lt;a href=&quot;http://www.emacswiki.org/ShowWhiteSpace#HighlightChars&quot; rel=&quot;nofollow&quot;&gt;Highlight Chars&lt;/a&gt;. It doesn't have this problem when highlighting trailing whitespace. It doesn't treat newline chars as whitespace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/highlight-chars.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-24T15:20:47.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="177" PostTypeId="1" AcceptedAnswerId="183" CreationDate="2014-09-24T15:35:41.923" Score="5" ViewCount="3296" Body="&lt;p&gt;I installed Magit on Windows, but every time I use it, it give me the error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;searching for program: permission denied, git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;even though I already installed the git software on windows. (it seems that there is no git available from the cmd). I am using the GUI emacs and not emacs from cygwin.&lt;/p&gt;&#xA;" OwnerUserId="130" LastEditorUserId="7" LastEditDate="2014-09-24T18:02:51.603" LastActivityDate="2014-09-24T18:02:51.603" Title="Magit on Windows: &quot;searching for program: permission denied, git&quot;" Tags="|git|magit|microsoft-windows|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="179" PostTypeId="2" ParentId="174" CreationDate="2014-09-24T15:48:45.423" Score="4" Body="&lt;p&gt;I don't think that feature is present in org, but it's certainly possible to add it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-remove-latex-fragment-overlay-at-point ()&#xA;  (interactive)&#xA;  (let ((overlays (overlays-at (point))))&#xA;    (mapc (lambda (ov)&#xA;            (when (eq (overlay-get ov 'org-overlay-type) 'org-latex-overlay)&#xA;              (setq org-latex-fragment-image-overlays&#xA;                    (delete ov org-latex-fragment-image-overlays))&#xA;              (delete-overlay ov)))&#xA;          overlays)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling that function will disable the overlay at point&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-24T17:10:59.557" LastActivityDate="2014-09-24T17:10:59.557" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="180" PostTypeId="2" ParentId="156" CreationDate="2014-09-24T16:13:19.873" Score="10" Body="&lt;p&gt;I've written a function that does what you want in a quite extendable&#xA;manner. It checks which headlines contain the property &lt;code&gt;CUSTOM_LABEL&lt;/code&gt;&#xA;(or some other property you configure) and calls the function&#xA;&lt;code&gt;endless/insert-org-label-latex&lt;/code&gt; on each of them with the value of the&#xA;property as an argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example snippet also shows how to extend it for html or other backends.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Configure the replacements&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;With this variable you can configure properties you care about and&#xA;which functions get called to handle each property.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom endless/org-property-mapping &#xA;  '((latex (&quot;CUSTOM_LABEL&quot; . endless/insert-org-label-latex))&#xA;    (html (&quot;CUSTOM_LABEL&quot; . endless/insert-org-label-html)))&#xA;  &quot;List of mappings from org property to arbitrary strings.&#xA;Each element is a list:&#xA;  (BACKEND (PROPERTY1 . FUNCTION1) (PROPERTY2 . FUNCTION2) ...)&#xA;&#xA;FUNCTION are functions which get called with a single&#xA;argument (the value of PROPERTY) and are responsible for doing&#xA;whatever should be done.&quot;&#xA;  :type '(repeat (cons symbol (repeat (cons string string)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;The Heavy worker&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This function is what you should add to the org export hook. It takes&#xA;care of checking for the properties listed above, and calling the&#xA;functions associated with those properties.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/replace-org-property (backend)&#xA;  &quot;Convert org properties using `endless/org-property-mapping'.&#xA;Lookup BACKEND in `endless/org-property-mapping' for a list of&#xA;\(PROPERTY REPLACEMENT). For each healine being exported, if it has a&#xA;PROPERTY listed insert a string immediately after the healine given by&#xA;    (format REPLACEMENT PROPERTY-VALUE)&quot;&#xA;  (let ((map (cdr (assoc backend endless/org-property-mapping)))&#xA;        value replacement)&#xA;    (when map      &#xA;      (org-map-entries&#xA;       (lambda () &#xA;         (dolist (it map)&#xA;           (save-excursion&#xA;             (when (setq value (org-entry-get (point) (car it))) &#xA;               (funcall (cdr it) value)))))))))&#xA;&#xA;(add-hook 'org-export-before-processing-hook #'endless/replace-org-property)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;The functions you define&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;These are the ones that do the actual replacement. Below is an example&#xA;for the latex case.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/insert-org-label-latex (label)&#xA;  &quot;Insert \&quot;\\\\label{LABEL}\\n\&quot; after the :PROPERTY: drawer.&quot;&#xA;  (search-forward-regexp org-property-end-re)&#xA;  (forward-char 1)&#xA;  (insert (format &quot;\\label{%s}\n&quot; label)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Result&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Evaluate all of this code above, then export the following org buffer to latex.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Test&#xA;  :PROPERTIES:&#xA;  :CUSTOM_LABEL: hi&#xA;  :END:&#xA;Test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The resulting latex buffer should be something like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{Test}&#xA;\label{sec-1}&#xA;\label{hi}&#xA;Test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-24T16:13:19.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="181" PostTypeId="2" ParentId="133" CreationDate="2014-09-24T16:13:23.593" Score="3" Body="&lt;p&gt;I don't think that's specifically Emacs-related. Your problem seems to be that you only have access to ports 80/443, and Gmail doesn't provide IMAP access over those: they only have 993 open for IMAP/SSL&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://support.google.com/mail/troubleshooter/1668960&quot; rel=&quot;nofollow&quot;&gt;https://support.google.com/mail/troubleshooter/1668960&lt;/a&gt; for reference&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So unless you can bypass your proxy (by means of an external gateway for example), you're out of luck.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-24T16:13:23.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="182" PostTypeId="1" AcceptedAnswerId="46374" CreationDate="2014-09-24T16:38:51.153" Score="11" ViewCount="136" Body="&lt;p&gt;Whenever I call &lt;code&gt;fill-paragraph&lt;/code&gt;, the buffer is always marked as modified, even if the command had no effect (i.e. if the paragraph was already filled).  It also creates an empty undoable action (easily detected with &lt;code&gt;undo-tree-mode&lt;/code&gt;).  Other commands which have the potential to make changes, such as the indentation commands, don't mark the buffer as modified or create an undoable action if nothing was changed.  Is there any way to make &lt;code&gt;fill-paragraph&lt;/code&gt; mark the buffer modified and create an undoable action only if it actually changed something?&lt;/p&gt;&#xA;" OwnerUserId="49" LastEditorUserId="7" LastEditDate="2014-09-24T19:14:06.513" LastActivityDate="2018-12-02T10:26:50.423" Title="fill-paragraph marks file as changed, even if it didn't do anything" Tags="|fill-paragraph|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="183" PostTypeId="2" ParentId="177" CreationDate="2014-09-24T16:49:36.713" Score="9" Body="&lt;p&gt;Run: &lt;code&gt;M-x eval-expression (executable-find &quot;git&quot;)&lt;/code&gt; if it is not found then you need to add git to the &lt;code&gt;exec-path&lt;/code&gt; list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;/path/to/folder/containing/git/executable&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Look at the definition for &lt;code&gt;magit-git-executable&lt;/code&gt; and you'll see how, if emacs cannot find &lt;code&gt;git&lt;/code&gt; using &lt;code&gt;executable-find&lt;/code&gt;, it won't be set correctly. &lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-09-24T16:49:36.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="184" PostTypeId="2" ParentId="182" CreationDate="2014-09-24T16:58:10.397" Score="10" Body="&lt;p&gt;The problem is that &lt;code&gt;fill-paragraph&lt;/code&gt; (or rather, &lt;code&gt;fill-region-as-paragraph&lt;/code&gt;) will remove and re-insert newlines while it breaks down your paragraph. It won't modify the buffer if there is only one line. The no-op in the undo list you witness is just &lt;code&gt;fill-paragraph&lt;/code&gt; removing and re-inserting newlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is non-trivial to avoid this. The following is a pretty bad hack, and highly inefficient for large buffers, but maybe it works for you. The command mimics &lt;code&gt;fill-paragraph&lt;/code&gt; (&lt;code&gt;M-q&lt;/code&gt;) with the identical behavior, except it stores the contents of the buffer before calling it, and afterwards, if the contents stayed the same, it will restore the modification state and undo list from before the change. To do this, it needs a copy (two, actually) of the buffer contents, so really, this is quite inefficient. :-)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/fill-paragraph (&amp;amp;optional justify region)&#xA;  (interactive (progn&#xA;                 (barf-if-buffer-read-only)&#xA;                 (list (if current-prefix-arg 'full) t)))&#xA;  (let ((old-text (buffer-string))&#xA;        (old-modified (buffer-modified-p))&#xA;        (old-undo-list buffer-undo-list))&#xA;    (fill-paragraph justify region)&#xA;    (when (equal old-text (buffer-string))&#xA;      (setq buffer-undo-list old-undo-list)&#xA;      (set-buffer-modified-p old-modified))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind that to &lt;code&gt;M-q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-09-24T16:58:10.397" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="185" PostTypeId="1" AcceptedAnswerId="186" CreationDate="2014-09-24T18:24:53.727" Score="35" ViewCount="9413" Body="&lt;p&gt;Occasionally, when I start Emacs, I get a message like.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Source file `/home/USER/.emacs.d/elpa/....el' newer than byte-compiled file&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also, I sometimes edit a package I'm developing and forget to&#xA;recompile it. When I try to load the new file, it takes me a while to&#xA;realise that Emacs is still using the old compiled file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way I can tell Emacs to completely avoid byte-compiled files that are older than their respective source files?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2022-08-14T16:30:15.250" Title="Can I avoid outdated byte-compiled elisp files?" Tags="|byte-compilation|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="186" PostTypeId="2" ParentId="185" CreationDate="2014-09-24T18:24:53.727" Score="44" Body="&lt;h2&gt;Emacs 24.3 or below&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There's no built-in way of preventing these old files from being loaded, but&#xA;there are easy ways to get rid of them.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can recompile the entire elpa directory by calling:&lt;br&gt;&#xA;&lt;code&gt;M-x byte-recompile-directory RET ~/.emacs.d/elpa/&lt;/code&gt;.&lt;br&gt;&#xA;This should get rid of outdated files.&lt;/li&gt;&#xA;&lt;li&gt;You can use the&#xA;&lt;a href=&quot;https://github.com/tarsius/auto-compile&quot;&gt;auto-compile&lt;/a&gt; package and&#xA;activate &lt;code&gt;auto-compile-on-load-mode&lt;/code&gt; which can compile files before&#xA;they are loaded.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Emacs 24.4&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Yes, and it turns out to be rather simple. The &lt;code&gt;load-prefer-newer&lt;/code&gt;&#xA;variable serves precisely this purpose.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-prefer-newer t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, it won't work when some code specifically targets the&#xA;&lt;code&gt;.elc&lt;/code&gt; file, such as &lt;code&gt;(load &quot;server.elc&quot;)&lt;/code&gt;. But it should be enough as&#xA;long as you're using &lt;code&gt;require&lt;/code&gt;s or calling &lt;code&gt;load&lt;/code&gt; without a suffix, which you should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the doc:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;load-prefer-newer is a variable defined in lread.c.&lt;br&gt;&#xA;  Its value is nil  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;br&gt;&#xA;  Non-nil means load prefers the newest version of a file.&lt;br&gt;&#xA;  This applies when a filename suffix is not explicitly specified and&#xA;  load is trying various possible suffixes (see load-suffixes and&#xA;  load-file-rep-suffixes).  Normally, it stops at the first file&#xA;  that exists unless you explicitly specify one or the other.  If this&#xA;  option is non-nil, it checks all suffixes and uses whichever file is&#xA;  newest.&lt;br&gt;&#xA;  Note that if you customize this, obviously it will not affect files&#xA;  that are loaded before your customizations are read!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-24T19:04:36.653" LastActivityDate="2014-09-24T19:04:36.653" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="187" PostTypeId="5" CreationDate="2014-09-24T18:31:55.297" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Lisp&lt;/a&gt; is a dialect of the Lisp programming language used as a scripting language by Emacs. It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C (as is the Lisp interpreter itself).&lt;/p&gt;&#xA;&lt;p&gt;The most common way to customize Emacs is by Emacs Lisp expressions in your init file, &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Emacs packages are also predominantly written in Emacs Lisp. See &lt;a href=&quot;http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;A guide to learning Emacs Lisp&lt;/a&gt; for non-programmers for reference. &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/elisp.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Emacs Lisp Reference&lt;/a&gt; is also viewable in Emacs with &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt; &lt;code&gt;elisp&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Use &lt;a href=&quot;/questions/tagged/elisp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;elisp&amp;#39;&quot; rel=&quot;tag&quot;&gt;elisp&lt;/a&gt; for &lt;em&gt;questions about the language&lt;/em&gt; itself, in particular, its relation to other Lisp dialects and differences from them.&lt;/p&gt;&#xA;&lt;p&gt;Please &lt;strong&gt;DO NOT&lt;/strong&gt; use &lt;a href=&quot;/questions/tagged/elisp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;elisp&amp;#39;&quot; rel=&quot;tag&quot;&gt;elisp&lt;/a&gt; for questions about &lt;em&gt;using&lt;/em&gt; Elisp, e.g., snippets of code in your customizations or questions about how to write an application. Use &lt;a href=&quot;/questions/tagged/elisp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;elisp&amp;#39;&quot; rel=&quot;tag&quot;&gt;elisp&lt;/a&gt; only for questions about the nature of the language itself.&lt;/p&gt;&#xA;&lt;p&gt;When available and appropriate, use more specific tags about the aspects of the language, such as &lt;code&gt;elisp-macros&lt;/code&gt;, &lt;code&gt;variables&lt;/code&gt;, &lt;code&gt;lexical-scoping&lt;/code&gt;, etc.  You can use such tags for questions about &lt;em&gt;using&lt;/em&gt; such things, as well as questions about their nature/meaning.&lt;/p&gt;&#xA;&lt;h2&gt;Wisdom from the Stack&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/154097/whats-in-your-emacs&quot;&gt;What's in your .emacs?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://web.archive.org/web/20141004103732/https://stackoverflow.com/questions/41522/tips-for-learning-elisp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tips for learning Elisp?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/2241111/lisp-community-quality-tutorials-resources&quot;&gt;Lisp Community - Quality tutorials/resources&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/2087532/troubleshooting-techniques-for-emacs-and-elisp&quot;&gt;Troubleshooting techniques for Emacs and Elisp&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="15177" LastEditDate="2020-07-02T15:03:59.160" LastActivityDate="2020-07-02T15:03:59.160" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="188" PostTypeId="4" CreationDate="2014-09-24T18:31:55.297" Score="0" Body="*ONLY* for questions about Emacs Lisp as a language, compared to other languages, in particular, compared to other Lisp dialects. That is, it is for questions *about the language* itself. *DO NOT USE IT* for questions about *using* Emacs Lisp, because most questions here are about using Elisp, and adding this tag to them is redundant. Emacs Lisp is the scripting and programming language that the Emacs editor is built on." OwnerUserId="45" LastEditorUserId="39388" LastEditDate="2023-07-14T13:26:40.637" LastActivityDate="2023-07-14T13:26:40.637" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="189" PostTypeId="2" ParentId="169" CreationDate="2014-09-24T18:32:22.623" Score="76" Body="&lt;p&gt;Another option, which I use, is &lt;code&gt;find-alternate-file&lt;/code&gt; bound to &lt;code&gt;C-x C-v&lt;/code&gt;. This opens a file reusing your current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, it points to the file you're currently on, so you can just type &lt;code&gt;C-x C-v RET&lt;/code&gt; to reload your file. It won't prompt unless your buffer has unsaved data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some non-text modes like &lt;code&gt;image-mode&lt;/code&gt; (used for rendering pictures, pdfs, svgs...etc) and &lt;code&gt;dired&lt;/code&gt; have &lt;code&gt;revert-buffer&lt;/code&gt; bound to &lt;code&gt;g&lt;/code&gt; for faster access.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2014-09-24T18:32:22.623" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="190" PostTypeId="5" CreationDate="2014-09-24T18:35:54.690" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/LaTeX&quot; rel=&quot;nofollow noreferrer&quot;&gt;LaTeX&lt;/a&gt; is a document preparation system that uses macros with the &lt;a href=&quot;http://en.wikipedia.org/wiki/TeX&quot; rel=&quot;nofollow noreferrer&quot;&gt;TeX&lt;/a&gt; &lt;a href=&quot;/questions/tagged/tex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;tex&amp;#39;&quot; rel=&quot;tag&quot;&gt;tex&lt;/a&gt; engine for producing scientific or technical books and articles of typeset quality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;a href=&quot;/questions/tagged/latex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;latex&amp;#39;&quot; rel=&quot;tag&quot;&gt;latex&lt;/a&gt; tag for general questions about working with LaTeX documents in Emacs. Other tags may also be applicable depending on the question and specific feature or mode of Emacs. For example, there are many modes for working with LaTeX documents, three of the common ones are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The basic &lt;code&gt;tex-mode&lt;/code&gt; package included in GNU Emacs. Use the tag &lt;a href=&quot;/questions/tagged/tex-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;tex-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;tex-mode&lt;/a&gt; for questions pertaining to this mode.&lt;/li&gt;&#xA;&lt;li&gt;The complete &lt;a href=&quot;http://en.wikipedia.org/wiki/AUCTeX&quot; rel=&quot;nofollow noreferrer&quot;&gt;AUCTeX&lt;/a&gt; third-party package (included in XEmacs). AUCTeX provides advanced features, including syntax highlighting, completion macros in third-party packages, better support for complex compilations, preview of math equations. Use the tag &lt;a href=&quot;/questions/tagged/auctex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;auctex&amp;#39;&quot; rel=&quot;tag&quot;&gt;auctex&lt;/a&gt; for questions about AUCTeX.&lt;/li&gt;&#xA;&lt;li&gt;For questions about LaTeX in &lt;code&gt;org-mode&lt;/code&gt;, use the appropriate org tag as well. For example, for LaTeX exports, use &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For questions about (La)TeX and companion tools unrelated to Emacs, consult &lt;a href=&quot;http://tex.stackexchange.com/&quot;&gt;TeX - LaTeX Stack Exchange&lt;/a&gt; as well.&lt;/p&gt;&#xA;" OwnerUserId="7" LastEditorUserId="7045" LastEditDate="2017-02-09T11:17:54.883" LastActivityDate="2017-02-09T11:17:54.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="191" PostTypeId="4" CreationDate="2014-09-24T18:35:54.690" Score="0" Body="Working with LaTeX documents, LaTeX coding, and LaTeX source blocks in other documents." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-09T11:15:24.177" LastActivityDate="2017-02-09T11:15:24.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="192" PostTypeId="2" ParentId="57" CreationDate="2014-09-24T18:38:44.370" Score="3" Body="&lt;p&gt;From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Names.html#Backup-Names&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Names.html#Backup-Names&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can customize the variable backup-directory-alist to specify that&#xA;  files matching certain patterns should be backed up in specific&#xA;  directories. This variable applies to both single and numbered&#xA;  backups. A typical use is to add an element (&quot;.&quot; . dir) to make all&#xA;  backups in the directory with absolute name dir; Emacs modifies the&#xA;  backup file names to avoid clashes between files with the same names&#xA;  originating in different directories. Alternatively, adding, (&quot;.&quot; .&#xA;  &quot;.~&quot;) would make backups in the invisible subdirectory .~ of the&#xA;  original file's directory. Emacs creates the directory, if necessary,&#xA;  to make the backup.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If you define the variable make-backup-file-name-function to a&#xA;  suitable Lisp function, that overrides the usual way Emacs constructs&#xA;  backup file names.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can also set EMACS to keep numbered backups and only keep a given number of backups, although this may be worse than just a single backup for each file.  See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Deletion.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Deletion.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="181" LastActivityDate="2014-09-24T18:38:44.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="193" PostTypeId="5" CreationDate="2014-09-24T18:39:44.067" Score="0" Body="&lt;p&gt;macOS consists of a Mach/BSD-based kernel, operating system interfaces primarily based on FreeBSD, and additional frameworks (written in C, C++ and Objective-C) providing user interface and application-level services.&lt;/p&gt;&#xA;&lt;p&gt;There are several packages of Emacs for macOS with slightly different feature sets. When asking about Emacs on macOS, please specify which package you are using (the URL where you downloaded it is often good enough).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacsformacosx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://emacsformacosx.com/&lt;/a&gt; provides a popular packaging of GNU Emacs for macOS based on the upstream GNU sources&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://aquamacs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://aquamacs.org/&lt;/a&gt; provides a version of GNU Emacs with various adaptations to make it better conform to the conventions of the macOS GUI and Apple's human interface guidelines&lt;/li&gt;&#xA;&lt;li&gt;Homebrew provides a GNU Emacs recipe &lt;a href=&quot;https://formulae.brew.sh/formula/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://formulae.brew.sh/formula/emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There are several others; see also &lt;a href=&quot;https://emacs.stackexchange.com/questions/271/what-is-the-difference-between-aquamacs-and-other-mac-versions-of-emacs&quot;&gt;What is the difference between Aquamacs and other Mac versions of Emacs?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="2057" LastEditDate="2021-04-20T15:18:25.270" LastActivityDate="2021-04-20T15:18:25.270" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="194" PostTypeId="4" CreationDate="2014-09-24T18:39:44.067" Score="0" Body="for questions about graphical and terminal versions of Emacs on macOS operating system. Please specify which package of Emacs for macOS you are using!" OwnerUserId="45" LastEditorUserId="2057" LastEditDate="2021-05-11T13:31:32.103" LastActivityDate="2021-05-11T13:31:32.103" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="195" PostTypeId="5" CreationDate="2014-09-24T18:45:31.067" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-09-24T18:45:31.067" LastActivityDate="2014-09-24T18:45:31.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="196" PostTypeId="4" CreationDate="2014-09-24T18:45:31.067" Score="0" Body="Questions relating to the use and configuration of Emacs on the proprietary Microsoft Windows Operating System." OwnerUserId="-1" LastEditorUserId="337" LastEditDate="2015-02-19T15:58:40.297" LastActivityDate="2015-02-19T15:58:40.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="197" PostTypeId="5" CreationDate="2014-09-24T18:49:37.470" Score="0" Body="&lt;p&gt;This tag should &lt;em&gt;rarely&lt;/em&gt; be used. It applies only to questions that distinguish &lt;a href=&quot;http://www.gnu.org/software/emacs/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;em&gt;GNU&lt;/em&gt;&lt;/strong&gt; Emacs&lt;/a&gt; from other variants such as the largely moribund &lt;a href=&quot;http://www.xemacs.org/&quot; rel=&quot;nofollow&quot;&gt;XEmacs&lt;/a&gt;, or possibly variants such as &lt;a href=&quot;http://aquamacs.org/&quot; rel=&quot;nofollow&quot;&gt;Aquamacs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="253" LastEditDate="2014-11-18T20:53:12.820" LastActivityDate="2014-11-18T20:53:12.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="198" PostTypeId="4" CreationDate="2014-09-24T18:49:37.470" Score="0" Body="Do NOT use this tag unless you know exactly what you're doing!" OwnerUserId="50" LastEditorUserId="253" LastEditDate="2014-11-18T20:53:12.820" LastActivityDate="2014-11-18T20:53:12.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="199" PostTypeId="5" CreationDate="2014-09-24T18:51:50.430" Score="0" Body="&lt;p&gt;Use the &lt;a href=&quot;/questions/tagged/autex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;autex&amp;#39;&quot; rel=&quot;tag&quot;&gt;autex&lt;/a&gt; tag as a generic tag for many &lt;a href=&quot;/questions/tagged/tex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;tex&amp;#39;&quot; rel=&quot;tag&quot;&gt;tex&lt;/a&gt; issues:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for &lt;code&gt;AMS-TeX&lt;/code&gt;, &lt;code&gt;ConTeXt&lt;/code&gt;, and other &lt;code&gt;TeX&lt;/code&gt; dialects. &lt;/li&gt;&#xA;&lt;li&gt;for &lt;code&gt;LuaTeX&lt;/code&gt;, &lt;code&gt;Omega&lt;/code&gt;, and &lt;code&gt;XeTeX&lt;/code&gt; engines.&lt;/li&gt;&#xA;&lt;li&gt;for other file types besides &lt;code&gt;.tex&lt;/code&gt;, such as &lt;code&gt;.aux&lt;/code&gt;, &lt;code&gt;.dtx&lt;/code&gt;, &lt;code&gt;.idx&lt;/code&gt;, &lt;code&gt;.ind&lt;/code&gt;, and so on, which are part of AUCTeX's normal handling of TeX files.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Use additional tags, such as &lt;a href=&quot;/questions/tagged/pdf&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;pdf&amp;#39;&quot; rel=&quot;tag&quot;&gt;pdf&lt;/a&gt; or &lt;a href=&quot;/questions/tagged/preview-latex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;preview-latex&amp;#39;&quot; rel=&quot;tag&quot;&gt;preview-latex&lt;/a&gt;, when appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides augmenting with the right tags, include the name of tool pertinent to the question using the tool's commonly known spelling: for example, &lt;code&gt;bibtex&lt;/code&gt;, &lt;code&gt;xindy&lt;/code&gt;,  &lt;code&gt;ps2pdf&lt;/code&gt;, &lt;code&gt;RefTeX&lt;/code&gt;, &lt;code&gt;dvips&lt;/code&gt;, &lt;a href=&quot;/questions/tagged/org-ref&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-ref&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-ref&lt;/a&gt;, &lt;code&gt;makeindex&lt;/code&gt;, etc. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/auctex/&quot; rel=&quot;nofollow noreferrer&quot;&gt;AUCTeX, GNU Project&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;AUCTeX manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/tex-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;tex-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;tex-mode&lt;/a&gt; default &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/TeX-Mode.html#TeX-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;support in Emacs&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7" LastEditorUserId="7045" LastEditDate="2017-03-05T13:42:27.523" LastActivityDate="2017-03-05T13:42:27.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="200" PostTypeId="4" CreationDate="2014-09-24T18:51:50.430" Score="0" Body="is for AUCTeX package that extends basic `tex-mode` Emacs provides for editing TeX files. AUCTeX integrates many built-in and external macro packages for creating, editing, printing, publishing, and managing multilingual TeX documents. AUCTeX works with several TeX compilers, extensions, and dialects of TeX and LaTeX. AUCTeX supports customizable bibliographies, indexes, and tables of content." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-03-03T11:25:03.647" LastActivityDate="2017-03-03T11:25:03.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="201" PostTypeId="2" ParentId="145" CreationDate="2014-09-24T18:56:13.697" Score="1" Body="&lt;p&gt;For basic idioms look into simple.el&lt;/p&gt;&#xA;" OwnerUserId="279" LastActivityDate="2014-09-24T18:56:13.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="202" PostTypeId="1" AcceptedAnswerId="205" CreationDate="2014-09-24T19:09:36.883" Score="26" ViewCount="7165" Body="&lt;p&gt;Sometimes my buffer list has 10+ dired windows, and I end up using &lt;code&gt;buffer-menu&lt;/code&gt; to manually mark and kill all of them.  Is there a faster way to close all open dired windows?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2018-10-09T14:42:03.053" Title="Close all dired buffers" Tags="|buffers|dired|" AnswerCount="8" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="203" PostTypeId="2" ParentId="202" CreationDate="2014-09-24T19:20:39.783" Score="1" Body="&lt;p&gt;I would try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(defun my-kill-dired-buffers ()&#xA;  (interactive)&#xA;  (kill-some-buffers&#xA;   (-filter (lambda (buffer)&#xA;              (save-excursion&#xA;                (set-buffer buffer)&#xA;                (eq major-mode 'dired-mode)))&#xA;            (buffer-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-09-24T20:30:48.960" LastActivityDate="2014-09-24T20:30:48.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="204" PostTypeId="2" ParentId="202" CreationDate="2014-09-24T19:21:13.057" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/KillingBuffers#toc3&quot;&gt;Something like this&lt;/a&gt; (scroll a bit)?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-dired-buffers ()&#xA;     (interactive)&#xA;     (mapc (lambda (buffer) &#xA;           (when (eq 'dired-mode (buffer-local-value 'major-mode buffer)) &#xA;             (kill-buffer buffer))) &#xA;         (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7" LastActivityDate="2014-09-24T19:21:13.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="205" PostTypeId="2" ParentId="202" CreationDate="2014-09-24T19:22:11.397" Score="37" Body="&lt;p&gt;You could do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;ibuffer&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;* /&lt;/code&gt; to mark buffers in dired mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;D&lt;/code&gt; to delete them.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2014-09-24T19:22:11.397" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="206" PostTypeId="1" AcceptedAnswerId="208" CreationDate="2014-09-24T19:33:40.510" Score="8" ViewCount="92" Body="&lt;p&gt;I have the following function, adapted slightly from &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_examples.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Insert text around a region. In this case, it's&#xA;;; the LaTeX code environment from the listings package &#xA;(defun wrap-code (start end)&#xA;  &quot;Insert a \begin{code} and \end{code} around a region.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (goto-char start) (insert &quot;\\begin{code}&quot;)&#xA;    (goto-char end) (insert &quot;\\end{code}&quot;)&#xA;    ))&#xA;;; Assign its shortcut&#xA;(global-set-key (kbd &quot;C-c p&quot;) 'wrap-code) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I then select a region and apply my function, it inserts the &lt;code&gt;\end{code}&lt;/code&gt; at the wrong place:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{code}while :; do&#xA;      echo this is\end{code} a test&#xA;done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="241" LastEditorUserId="105" LastEditDate="2016-09-21T19:48:37.187" LastActivityDate="2016-09-21T19:48:37.187" Title="Why is my function not identifying the end of the region correctly?" Tags="|region|point|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="207" PostTypeId="2" ParentId="206" CreationDate="2014-09-24T19:41:55.823" Score="3" Body="&lt;p&gt;&lt;code&gt;end&lt;/code&gt; is a number, an exact position in the buffer. So when you go to &lt;code&gt;start&lt;/code&gt; and insert text, the rest of the text gets pushed forward, and &lt;code&gt;end&lt;/code&gt; is no longer pointing to the end of &quot;done&quot; but rather still the position &quot;done&quot; used to be at. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest solution is to just insert the end{code} text first, the the begin.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-09-24T19:41:55.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="208" PostTypeId="2" ParentId="206" CreationDate="2014-09-24T19:42:45.350" Score="9" Body="&lt;p&gt;That's because when you insert your first chunk of code after &lt;code&gt;start&lt;/code&gt;, &lt;code&gt;end&lt;/code&gt; remains constant and now point in the middle of something (since more characters have been added before it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick solution for your use case is to insert text at the end before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Insert text around a region. In this case, it's&#xA;;; the LaTeX code environment from the listings package &#xA;(defun wrap-code (start end)&#xA;  &quot;Insert a \begin{code} and \end{code} around a region.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (goto-char end) (insert &quot;\\end{code}&quot;)&#xA;    (goto-char start) (insert &quot;\\begin{code}&quot;)))&#xA;;; Assign its shortcut&#xA;(global-set-key (kbd &quot;C-c p&quot;) 'wrap-code)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A more general solution would involve &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Overview-of-Markers.html&quot;&gt;markers&lt;/a&gt; instead of positions&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-24T19:42:45.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="209" PostTypeId="1" AcceptedAnswerId="210" CreationDate="2014-09-24T20:12:24.287" Score="16" ViewCount="1141" Body="&lt;p&gt;From time to time I observe unexpected behavior when editing text.  My first recourse is usually to use &lt;code&gt;C-h k&lt;/code&gt; to find out what functions are being called by a given key sequence.  However, sometimes the documentation is at odds with the observed behavior.  In these cases, I usually assume that some other package has hooked into that function or key sequence and is modifying its behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I find out&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;which&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;functions are hooking into my key sequence?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example that I encountered recently was that I pressed the &lt;kbd&gt;&quot;&lt;/kbd&gt; key and quotation marks were inserted at the beginning and end of the active region.  I had a suspicion that this was not the default Emacs behavior, so I used &lt;code&gt;C-h k &quot;&lt;/code&gt; to find out what function was actually being called.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;describe-key&lt;/code&gt; documentation told me that the function &lt;code&gt;self-insert-command&lt;/code&gt; was being called, which is a built-in function.  To make a long story short, after some amount of trial and error, I was able to determine that the behavior was caused by &lt;code&gt;electric-pair-mode&lt;/code&gt;.  In the future, is there a faster way to arrive at this conclusion than to turn off suspected packages one at a time until finding the culprit?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="105" LastEditDate="2014-09-28T03:46:56.610" LastActivityDate="2015-05-06T14:42:55.893" Title="How to find out what a key sequence really does" Tags="|keymap|hooks|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="210" PostTypeId="2" ParentId="209" CreationDate="2014-09-24T20:24:53.687" Score="14" Body="&lt;p&gt;There is no easy way to know exactly what a single key press will do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you see additional behavior always check the common hooks. See the list here: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most cases the important ones are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;after-change-functions&lt;/li&gt;&#xA;&lt;li&gt;before-change-functions&lt;/li&gt;&#xA;&lt;li&gt;first-change-hook&lt;/li&gt;&#xA;&lt;li&gt;post-command-hook&lt;/li&gt;&#xA;&lt;li&gt;pre-command-hook&lt;/li&gt;&#xA;&lt;li&gt;post-self-insert-hook&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You'll need to inspect those hooks and look into the functions they contain to see which one is modifying your behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the functions in these hooks don't fully describe the observed behavior, check the functions for advice which will show up in their documentation from &lt;code&gt;describe-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&#xA;I've written some functions to help describe a hook better than going through the functions one by one: &lt;a href=&quot;https://gist.github.com/jordonbiondo/bad03e44bb053db0f1eb&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/jordonbiondo/bad03e44bb053db0f1eb&lt;/a&gt;&#xA;You can use &lt;code&gt;describe-hook&lt;/code&gt; defined there like the other describe functions. Here is a sample of it's output:&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/DwXU1.png&quot; width=&quot;550&quot; height=&quot;250&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here's all the code, in case the gist disappears: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun guess-all-hooks ()&#xA;  &quot;Return a list of all variables that are probably hook lists.&quot;&#xA;  (let ((syms '()))&#xA;    (mapatoms&#xA;     (lambda (sym)&#xA;       (if (ignore-errors (symbol-value sym))&#xA;           (let ((name (symbol-name sym)))&#xA;             (when (string-match &quot;-\\(hook[s]?\\|functions\\)$&quot; name)&#xA;               (push sym syms))))))&#xA;    syms))&#xA;&#xA;(defun face-it (str face)&#xA;  &quot;Apply FACE to STR and return.&quot;&#xA;  (propertize str 'face face))&#xA;&#xA;(defun describe-hook (hook)&#xA;  &quot;Display documentation about a hook variable and the&#xA;functions it contains.&quot;&#xA;  (interactive&#xA;   (list (completing-read&#xA;          &quot;Hook: &quot; (mapcar (lambda (x) (cons x nil)) (guess-all-hooks)))))&#xA;  (let* ((sym (intern hook))&#xA;         (sym-doc (documentation-property sym 'variable-documentation))&#xA;         (hook-docs (mapcar&#xA;                     (lambda (func)&#xA;                       (cons func (ignore-errors (documentation func))))&#xA;                     (symbol-value sym))))&#xA;    (switch-to-buffer&#xA;     (with-current-buffer (get-buffer-create &quot;*describe-hook*&quot;)&#xA;       (let ((inhibit-read-only t))&#xA;         (delete-region (point-min) (point-max))&#xA;         (insert (face-it &quot;Hook: &quot; 'font-lock-constant-face) &quot;\n\n&quot;)&#xA;         (insert (face-it (concat &quot;`&quot; hook &quot;'&quot;) 'font-lock-variable-name-face))&#xA;         (replace-string &quot;\n&quot; &quot;\n\t&quot; nil&#xA;                         (point)&#xA;                         (save-excursion&#xA;                           (insert &quot;\n&quot; sym-doc &quot;\n\n&quot;)&#xA;                           (1- (point))))&#xA;         (goto-char (point-max))&#xA;         (insert (face-it &quot;Hook Functions: &quot; 'font-lock-constant-face) &quot;\n\n&quot;)&#xA;         (dolist (hd hook-docs)&#xA;           (insert (face-it (concat &quot;`&quot; (symbol-name (car hd)) &quot;'&quot;)&#xA;                            'font-lock-function-name-face)&#xA;                   &quot;: \n\t&quot;)&#xA;           (replace-string &quot;\n&quot; &quot;\n\t&quot; nil&#xA;                           (point)&#xA;                           (save-excursion&#xA;                             (insert (or (cdr hd) &quot;No Documentation&quot;) &quot;\n\n&quot;)&#xA;                             (1- (point))))&#xA;           (goto-char (point-max))))&#xA;       (help-mode)&#xA;       (help-make-xrefs)&#xA;       (read-only-mode t)&#xA;       (setq truncate-lines nil)&#xA;       (current-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-05-06T14:42:55.893" LastActivityDate="2015-05-06T14:42:55.893" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="211" PostTypeId="2" ParentId="202" CreationDate="2014-09-24T20:35:07.967" Score="1" Body="&lt;p&gt;What you might actually be looking for is a way to clean up unwanted buffers automatically, in which case you should check out &lt;code&gt;midnight.el&lt;/code&gt;, which is part of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But generally speaking, &lt;code&gt;ibuffer&lt;/code&gt; makes it very easy to operate on buffers in bulk, as Francisco suggested.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-09-24T20:35:07.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="212" PostTypeId="1" AcceptedAnswerId="243" CreationDate="2014-09-24T20:36:43.673" Score="37" ViewCount="5029" Body="&lt;p&gt;I'm aware of &lt;code&gt;find-grep-dired&lt;/code&gt;, marking the corresponding files and then pressing &lt;kbd&gt;Q&lt;/kbd&gt; to run &lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt; on the marked files. Unfortunately that requires restarting the grep and no longer using git-grep, ack, or ag and switching to use &lt;code&gt;find-grep&lt;/code&gt; which has a different syntax for searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also aware of &lt;code&gt;multi-occur&lt;/code&gt; and &lt;code&gt;occur-edit-mode&lt;/code&gt;, but that requires restarting the search using occur. Finally, &lt;code&gt;ag-dired&lt;/code&gt; appears to match on the filename, not on the contents of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current approach is to generate grep output, and then run a macro that starts in the grep buffer, and visits each match and changes it. I would prefer to use &lt;code&gt;query-replace&lt;/code&gt; directly over the set of matches found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to do is to either quickly build a dired buffer from existing grep output so that I can mark the appropriate files and call query-regexp on them, or transform grep output into a list of buffers for &lt;code&gt;multi-occur&lt;/code&gt; so that I can use &lt;code&gt;occur-edit-mode&lt;/code&gt; to edit it in place and run &lt;code&gt;query-replace&lt;/code&gt; on that buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this functionality exist, or is there another workflow that solves this problem?&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2016-10-08T06:58:47.290" Title="Is there a way to use query-replace from grep/ack/ag output modes?" Tags="|dired|editing|replace|occur|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="213" PostTypeId="2" ParentId="185" CreationDate="2014-09-24T20:41:57.607" Score="17" Body="&lt;p&gt;If you only set &lt;code&gt;load-prefer-newer&lt;/code&gt; (where available), the correct code will get loaded, but it might not have been byte-compiled, so there may be a slight performance penalty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use Jonas Bernoulli's excellent &lt;a href=&quot;https://github.com/tarsius/auto-compile&quot;&gt;auto-compile&lt;/a&gt; library to help make sure this problem doesn't arise. In particular, &lt;code&gt;auto-compile-on-load-mode&lt;/code&gt; will recompile outdated &lt;code&gt;.elc&lt;/code&gt; files before loading them.&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="24" LastEditDate="2014-09-25T18:28:47.063" LastActivityDate="2014-09-25T18:28:47.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="214" PostTypeId="2" ParentId="212" CreationDate="2014-09-24T20:42:45.517" Score="4" Body="&lt;p&gt;This functionality exists within &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;projectile&lt;/a&gt; (&lt;code&gt;projectile-replace&lt;/code&gt;). It will use ag/ack/git grep/grep if available (in that order) to find occurrences, and &lt;code&gt;tags-query-replace&lt;/code&gt; to execute the query-replace.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-24T20:42:45.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="215" PostTypeId="1" AcceptedAnswerId="219" CreationDate="2014-09-24T21:13:46.580" Score="14" ViewCount="3736" Body="&lt;p&gt;How can I get TeX previews inside modes other than AUCTeX or org-mode? I'd love to see TeX equations in jabber, erc and markdown. If I ever switch to Emacs for email, I'd presumably like to see previews there too.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2020-05-18T19:55:46.713" Title="How can I preview TeX formulas inline in arbitrary modes?" Tags="|auctex|tex|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="216" PostTypeId="1" AcceptedAnswerId="396" CreationDate="2014-09-24T21:14:46.880" Score="8" ViewCount="809" Body="&lt;p&gt;Is there a way to make eshell behave better? By default &lt;code&gt;printenv TERM&lt;/code&gt; returns &lt;code&gt;dumb&lt;/code&gt;. For example &lt;code&gt;brew&lt;/code&gt; often complains about the terminal type and causes eshell to &quot;jiggle&quot; while the progress bar is showing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't happen in &lt;code&gt;term&lt;/code&gt;. I suspect this is because &lt;code&gt;TERM=eterm-color&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I could just add &lt;code&gt;brew&lt;/code&gt; to &lt;code&gt;eshell-visual-commands&lt;/code&gt;, but are there any ways of making &lt;code&gt;eterm-color&lt;/code&gt; work in eshell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the video of &lt;code&gt;brew&lt;/code&gt; behaving weirdly. Unfortunately I couldn't reproduce the error mentioned: &lt;a href=&quot;https://www.youtube.com/watch?v=XFhM_ToLuaQ&quot;&gt;https://www.youtube.com/watch?v=XFhM_ToLuaQ&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="43" LastEditorUserId="43" LastEditDate="2014-09-24T22:59:05.203" LastActivityDate="2014-09-28T14:42:14.683" Title="Proper TERM type for eshell" Tags="|eshell|term|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="217" PostTypeId="2" ParentId="212" CreationDate="2014-09-24T21:18:18.743" Score="16" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What I would like to do is to either quickly build a dired buffer from existing grep output [...], or transform grep output into a list of buffers for multi-occur [...].&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You don't need to convert the grep results buffer into anything, there's already a mode specifically for editing grep output (and reflecting the changes on the files, of course).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-wgrep&quot;&gt;wgrep&lt;/a&gt; package from Melpa.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(require 'wgrep)&lt;/code&gt; in your init file.&lt;/li&gt;&#xA;&lt;li&gt;After doing a grep search, hit &lt;code&gt;C-c C-p&lt;/code&gt; and edit away! &lt;/li&gt;&#xA;&lt;li&gt;Save your edits with &lt;code&gt;C-c C-e&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It even works with ack and ag as well.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-24T21:18:18.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="218" PostTypeId="2" ParentId="133" CreationDate="2014-09-24T23:20:37.630" Score="1" Body="&lt;p&gt;Unless your mail provider provides IMAP/SMTP access on ports 80/443, you are out of luck.  No email client can be tuned to give access to a port that is being blocked by a firewall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I am in these circumstances, I use a VPN such as OpenVPN (e.g. with a third party service provider) that CAN be accessed over these ports.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, you can tunnel all of your traffic (including e.g. ports 993/465) through port 443 and get the access that you desire.&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2014-09-24T23:20:37.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="219" PostTypeId="2" ParentId="215" CreationDate="2014-09-24T23:21:08.600" Score="10" Body="&lt;p&gt;I've tried to re-use AUCTeX &lt;a href=&quot;https://www.gnu.org/software/auctex/preview-latex.html&quot; rel=&quot;nofollow&quot;&gt;preview-latex&lt;/a&gt; but failed and gave up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Previewing-LaTeX-fragments.html#Previewing-LaTeX-fragments&quot; rel=&quot;nofollow&quot;&gt;Org-mode also provide the same feature&lt;/a&gt;. Turns out &lt;a href=&quot;https://github.com/the-kenny/weechat.el/blob/master/weechat-latex.el&quot; rel=&quot;nofollow&quot;&gt;weechat&lt;/a&gt; managed to re-use it to automatically show latex preview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've extracted the preview part from weechat in a separate file which you can get on &lt;a href=&quot;https://github.com/aaptel/preview-latex/&quot; rel=&quot;nofollow&quot;&gt;this repo&lt;/a&gt;. It's also available as the &lt;code&gt;px&lt;/code&gt; package on MELPA (I've just submited it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are 4 entry points which can be called interactively:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;px-preview&lt;/code&gt;: render all latex fragments in the current buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;px-preview-region&lt;/code&gt;: render fragments in the region.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;px-remove&lt;/code&gt;: remove all previews from the current buffer (restore the text).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;px-toggle&lt;/code&gt;: toggle display of previews in the current buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As long as org-mode previewer works, this one should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the code is still pretty small I'll include it below, but please install the package or use the repo.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; px.el --- preview inline latex -*- lexical-binding: t -*-&#xA;&#xA;;; Most of this code comes from weechat-latex.el which in turn uses&#xA;;; org-mode previewer.&#xA;&#xA;;; Copyright (C) 2014 Aurélien Aptel &amp;lt;aurelien.aptel@gmail.com&amp;gt;&#xA;;; Copyright (C) 2013 Rüdiger Sonderfeld &amp;lt;ruediger@c-plusplus.de&amp;gt;&#xA;&#xA;;; This program is free software; you can redistribute it and/or modify&#xA;;; it under the terms of the GNU General Public License as published by&#xA;;; the Free Software Foundation, either version 3 of the License, or&#xA;;; (at your option) any later version.&#xA;&#xA;;; This program is distributed in the hope that it will be useful,&#xA;;; but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&#xA;;; GNU General Public License for more details.&#xA;&#xA;;; You should have received a copy of the GNU General Public License&#xA;;; along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&#xA;&#xA;(require 'org)&#xA;&#xA;(defvar px-temp-file-prefix &quot;px-&quot;&#xA;  &quot;Prefix for temporary files.&quot;)&#xA;&#xA;(defvar px-temp-directory-prefix &quot;px-&quot;&#xA;  &quot;Prefix for temporary directory.&quot;)&#xA;&#xA;(defvar px-image-program org-latex-create-formula-image-program&#xA;  &quot;Program to convert LaTeX fragments.&#xA;See `org-latex-create-formula-image-program'&quot;)&#xA;&#xA;(defvar px-temp-dir nil&#xA;  &quot;The temporary directory used for preview images.&quot;)&#xA;&#xA;(defun px--create-preview (at)&#xA;  &quot;Wrapper for `org-format-latex'.&#xA;The parameter AT should be nil or in (TYPE . POINT) format.  With TYPE being a&#xA;string showing the matched LaTeX statement (e.g., ``$'') and POINT being the&#xA;POINT to replace.  If AT is nil replace statements everywhere.&quot;&#xA;  (org-format-latex px-temp-file-prefix&#xA;                    px-temp-dir&#xA;                    'overlays&#xA;                    &quot;Creating images...%s&quot;&#xA;                    at 'forbuffer&#xA;                    px-image-program))&#xA;&#xA;(defun px--set-temp-dir ()&#xA;  &quot;Set `px-temp-dir' unless it is already set.&quot;&#xA;  (unless px-temp-dir&#xA;    (setq px-temp-dir&#xA;          (make-temp-file px-temp-directory-prefix&#xA;                          'directory))))&#xA;&#xA;(defun px-preview ()&#xA;  &quot;Preview LaTeX fragments.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (let ((inhibit-read-only t))&#xA;      (px--set-temp-dir)&#xA;      (org-remove-latex-fragment-image-overlays)&#xA;      (px--create-preview nil))))&#xA;&#xA;(defun px-preview-region (beg end)&#xA;  &quot;Preview LaTeX fragments in region.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (let* ((math-regex (assoc &quot;$&quot; org-latex-regexps))&#xA;         (regex (nth 1 math-regex))&#xA;         (n (nth 2 math-regex))&#xA;         matches)&#xA;    (save-excursion&#xA;      (goto-char beg)&#xA;      (while (re-search-forward regex end t)&#xA;        (setq matches (cons (cons &quot;$&quot; (match-beginning n)) matches)))&#xA;      (let ((inhibit-read-only t))&#xA;        (px--set-temp-dir)&#xA;        (dolist (i matches)&#xA;          (px--create-preview i))))))&#xA;&#xA;&#xA;(defun px-remove ()&#xA;  &quot;Remove LaTeX preview images.&quot;&#xA;  (interactive)&#xA;  (let ((inhibit-read-only t))&#xA;    (org-remove-latex-fragment-image-overlays)))&#xA;&#xA;(defun px-is-active? ()&#xA;  &quot;Are LaTeX Previews currently displayed?&quot;&#xA;  org-latex-fragment-image-overlays)&#xA;&#xA;(defun px-toggle ()&#xA;  &quot;Toggle display of LaTeX preview.&quot;&#xA;  (interactive)&#xA;  (if (px-is-active?)&#xA;      (px-remove)&#xA;    (px-preview)))&#xA;&#xA;&#xA;(provide 'px)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="158" LastEditorUserId="158" LastEditDate="2014-09-26T14:48:57.567" LastActivityDate="2014-09-26T14:48:57.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="220" PostTypeId="1" AcceptedAnswerId="221" CreationDate="2014-09-25T00:36:38.923" Score="19" ViewCount="3360" Body="&lt;p&gt;I want to make &lt;code&gt;Control-i&lt;/code&gt; perform &lt;code&gt;indent-region&lt;/code&gt; (basically since Xcode has built that muscle memory already).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realise that &lt;code&gt;Control-i&lt;/code&gt; and &lt;code&gt;tab&lt;/code&gt; are indistinguishable in the Ascii sense, but they are in the keycode sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the obvious:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-i&quot;))&#xA;(global-set-key (kbd &quot;C-i&quot;) 'indent-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to no avail - pressing &lt;code&gt;Control-i&lt;/code&gt; still just does whatever the &lt;code&gt;tab&lt;/code&gt; key does in the current context. Is there anything I can do to help Emacs treat the tab button differently to &lt;code&gt;Control-i&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; I guess an equivalent outcome would be achieved by being able to remap what a &lt;code&gt;tab&lt;/code&gt;/&lt;code&gt;Control-i&lt;/code&gt; press does when a region is selected.&lt;/p&gt;&#xA;" OwnerUserId="215" LastEditorUserId="105" LastEditDate="2021-06-01T14:10:40.083" LastActivityDate="2024-02-14T13:41:26.647" Title="How to bind C-i as different from TAB?" Tags="|key-bindings|keymap|control-characters|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="221" PostTypeId="2" ParentId="220" CreationDate="2014-09-25T00:45:36.337" Score="24" Body="&lt;p&gt;I don't think that this can be achieved from a terminal, but in GUI mode you could try this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-key input-decode-map [?\C-i] [C-i])&#xA;(global-set-key (kbd &amp;quot;&amp;lt;C-i&amp;gt;&amp;quot;) 'indent-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I do the same thing with &lt;code&gt;C-m&lt;/code&gt; so that it can be distinguished from &lt;code&gt;RET&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The following should work whether you are in GUI or TTY mode:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Unbind &amp;lt;C-i&amp;gt; from the TAB key and bind it to indent-region.&#xA;;; Since TAB and &amp;lt;C-i&amp;gt; cannot be differentiated in TTY emacs,&#xA;;; the workaround is to conditionally bind TAB to indent-region&#xA;;; when there is an active region selected.&#xA;(if (window-system)&#xA;    ;; IF we are not in a TTY, unbind C-i from TAB&#xA;    (progn&#xA;      (define-key input-decode-map [?\C-i] [C-i])&#xA;      ;; ... and remap it to indent-region&#xA;      (global-set-key (kbd &amp;quot;&amp;lt;C-i&amp;gt;&amp;quot;) 'indent-region))&#xA;  ;; ELSE IF we are in a TTY, create a replacement for TAB&#xA;  (defun my/tab-replacement (&amp;amp;optional START END)&#xA;    (interactive &amp;quot;r&amp;quot;)&#xA;    (if (use-region-p)&#xA;        ;; IF active region, use indent-region&#xA;        (indent-region START END)&#xA;      ;; ELSE IF no active region, use default tab command&#xA;      (indent-for-tab-command)))&#xA;  ;; Bind our quick-and-dirty TAB replacement to the TAB key&#xA;  (global-set-key (kbd &amp;quot;TAB&amp;quot;) 'my/tab-replacement))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It is not pretty, but it seems to do the job.  I welcome any refinements or edits to this code as necessary.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="25631" LastEditDate="2024-02-14T13:41:26.647" LastActivityDate="2024-02-14T13:41:26.647" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="222" PostTypeId="2" ParentId="16" CreationDate="2014-09-25T01:28:24.600" Score="1" Body="&lt;p&gt;Have you changed the value of &lt;code&gt;smex-auto-update&lt;/code&gt;?  The default is &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;smex-auto-update is a compiled Lisp function in `smex.el'.&#xA;(smex-auto-update &amp;amp;optional IDLE-TIME)&#xA;Update Smex when Emacs has been idle for IDLE-TIME.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastActivityDate="2014-09-25T01:28:24.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="223" PostTypeId="2" ParentId="202" CreationDate="2014-09-25T02:51:59.097" Score="13" Body="&lt;p&gt;Instead of add another function to kill all &lt;code&gt;dired&lt;/code&gt; buffers, I suggest you take advantage of filter groups in &lt;code&gt;ibuffer&lt;/code&gt;, it allow you to group buffer by many condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a example to set filter groups:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default ibuffer-saved-filter-groups&#xA;              `((&quot;Default&quot;&#xA;                 ;; I create a group call Dired, which contains all buffer in dired-mode&#xA;                 (&quot;Dired&quot; (mode . dired-mode))&#xA;                 (&quot;Temporary&quot; (name . &quot;\*.*\*&quot;))&#xA;                 )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;C-x C-b&lt;/code&gt; open &lt;code&gt;ibuffer&lt;/code&gt; window, you can see something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TJqxQ.png&quot; alt=&quot;example1&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Move cursor to &lt;code&gt;[ Dired ]&lt;/code&gt; (with &lt;code&gt;M-p&lt;/code&gt;, &lt;code&gt;M-n&lt;/code&gt;), then press &lt;code&gt;d&lt;/code&gt; to mark as delete&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/eudiW.png&quot; alt=&quot;example2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then press &lt;code&gt;x&lt;/code&gt; to execute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer this way because I don't need to think about how I should bind my key to the new function, and my buffers are better organized.&lt;/p&gt;&#xA;" OwnerUserId="165" LastActivityDate="2014-09-25T02:51:59.097" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="224" PostTypeId="2" ParentId="212" CreationDate="2014-09-25T02:53:50.623" Score="1" Body="&lt;p&gt;Here is another approach, using &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your Emacs &lt;code&gt;*grep*&lt;/code&gt; output buffer, hit C-c ` (that's C-c backquote), which in &lt;em&gt;Icicle&lt;/em&gt; mode is bound in buffer &lt;code&gt;*grep*&lt;/code&gt; to command &lt;code&gt;icicle-compilation-search&lt;/code&gt;.  This lets you quickly navigate among any of the search hits (the &lt;code&gt;grep&lt;/code&gt; hits) you choose, in any order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input you type in the minibuffer dynamically filters (narrows) the set of search hits, and you can use &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow&quot;&gt;progressive completion&lt;/a&gt; to narrow by successively matching multiple patterns (e.g. substrings, regexps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When navigating among search hits you can replace any of them on demand - either the entire hit (line) or just the part matching your current minibuffer input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Other_Search_Commands#IciclesCompileOrGrep&quot; rel=&quot;nofollow&quot;&gt;Icicles Search - Compile or Grep&lt;/a&gt;.  An intro to &lt;strong&gt;Icicles&lt;/strong&gt; search is &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, and info about replacing matches during &lt;strong&gt;Icicles&lt;/strong&gt; search is &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Search-And-Replace&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-25T02:53:50.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="225" PostTypeId="1" AcceptedAnswerId="229" CreationDate="2014-09-25T07:57:48.270" Score="3" ViewCount="361" Body="&lt;p&gt;I am using &lt;a href=&quot;http://www.emacswiki.org/emacs/TabBarMode&quot; rel=&quot;nofollow&quot;&gt;tabbar-mode&lt;/a&gt; and I love it. I have only one thing which is irritating me: the sorting order of tabs of fired windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As in other modes, they seem to be sorted by time opened. But in case of the dired buffers, I would prefer a sorting based on the directory structure, so that lower directories are further left, an directories higher in the directory structure further to the right. As an example, the tabs could be sorted like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;/ | home | Username | DirectoryInUsernamesHomeDirectory | SecondUsername | ... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware, that it is not possible to project a two-dimensional tree structure into a one dimensional tab-bar, but any logical sorting based on the tree structure would be favourable to a time-of-opening sorting as it is now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way (sure there is - but my elisp knowledge is not sufficient to write it) to achieve this? I guess a custom function tab-bar-add-tab needs to be defines as &lt;a href=&quot;http://www.emacswiki.org/emacs/TabBarMode#toc7&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2014-09-25T09:43:20.777" Title="Is it possible to sort dired tabs in tab bar-mode by directory structure?" Tags="|dired|tabbar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="227" PostTypeId="1" AcceptedAnswerId="232" CreationDate="2014-09-25T09:05:17.770" Score="10" ViewCount="154" Body="&lt;p&gt;In &lt;code&gt;latex-mode&lt;/code&gt; when I use &lt;code&gt;TeX-insert-macro&lt;/code&gt; to type a &lt;code&gt;\input{...}&lt;/code&gt;&#xA;macro, Auctex conveniently offers filename completion, which is great.&#xA;However, it seems to search a lot of places to compile the completion&#xA;list, because emacs hangs for almost a minute on my poor little&#xA;laptop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way for &lt;code&gt;TeX-insert-macro&lt;/code&gt; to offer dumb filename completion?&lt;/strong&gt;&lt;br&gt;&#xA;By &quot;dumb&quot;, I mean the one you get when calling &lt;code&gt;find-file&lt;/code&gt;. Most of&#xA;the time the file I want to input is just one directory away, so that&#xA;would be more than fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not possible, &lt;strong&gt;is there another way to speed it up?&lt;/strong&gt;&lt;br&gt;&#xA;I noticed when I insert the &lt;code&gt;\include&lt;/code&gt; macro the list of filenames is&#xA;much shorter, so maybe there's a way to use that list for the &lt;code&gt;\input&lt;/code&gt;&#xA;macro as well.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-25T13:16:22.293" Title="Speed up TeX-insert-macro on \input" Tags="|latex|auctex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="228" PostTypeId="1" AcceptedAnswerId="231" CreationDate="2014-09-25T09:30:01.197" Score="17" ViewCount="1406" Body="&lt;p&gt;I'd like to produce unicode art with artist-mode. But it appears that artist-mode only supports ASCII art.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure artist-mode to produce instead of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  +---------------+&#xA;  |               |&#xA;  |       +-------+--+&#xA;  |       |       |  |&#xA;  |       |       |  |&#xA;  |       |       |  |&#xA;  +-------+-------+  |&#xA;          |          |&#xA;          |          |&#xA;          |          |&#xA;          +----------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ┌───────────────┐&#xA;  │               │&#xA;  │       ┌───────┼──┐&#xA;  │       │       │  │&#xA;  │       │       │  │&#xA;  │       │       │  │&#xA;  └───────┼───────┘  │&#xA;          │          │&#xA;          │          │&#xA;          │          │&#xA;          └──────────┘&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="23" LastActivityDate="2014-09-25T09:46:59.737" Title="How can I draw in unicode with artist-mode?" Tags="|unicode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="229" PostTypeId="2" ParentId="225" CreationDate="2014-09-25T09:33:07.163" Score="5" Body="&lt;p&gt;Conveniently enough, sorting dired buffers alphabetically (by full&#xA;path) results in exactly the behaviour you describe. So it turns out&#xA;to be quite achievable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply add the following snippet to your init file and everything should work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tabbar)&#xA;&#xA;(defun tabbar-add-tab (tabset object &amp;amp;optional append)&#xA;  &quot;Add to TABSET a tab with value OBJECT if there isn't one there yet.&#xA;If the tab is added, it is added at the beginning of the tab list,&#xA;unless the optional argument APPEND is non-nil, in which case it is&#xA;added at the end.&quot;&#xA;  (let ((tabs (tabbar-tabs tabset)))&#xA;    (if (tabbar-get-tab object tabset)&#xA;        tabs&#xA;      (let ((tab (tabbar-make-tab object tabset)))&#xA;        (tabbar-set-template tabset nil)&#xA;        (set tabset&#xA;             (if (tabbar-tab-derived-mode-p 'dired-mode tab)&#xA;                 (sort (cons tab tabs) #'tabbar-default-directory&amp;lt;)&#xA;               (if append&#xA;                   (append tabs (list tab))&#xA;                 (cons tab tabs))))))))&#xA;&#xA;(defun tabbar-default-directory&amp;lt; (a b)&#xA;  &quot;Is the `default-directory' of tab A `string&amp;lt;' than that of B?&quot;&#xA;  (string&amp;lt;&#xA;   (expand-file-name (buffer-local-value 'default-directory (car a)))&#xA;   (expand-file-name (buffer-local-value 'default-directory (car b)))))&#xA;&#xA;(defun tabbar-tab-derived-mode-p (mode tab)&#xA;  &quot;Is the major mode of TAB derived from MODE?&quot;&#xA;  (with-current-buffer (car tab)&#xA;    (derived-mode-p mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All the magic happens on the line &lt;code&gt;(sort (cons tab tabs) #'tabbar-dired&amp;lt;)&lt;/code&gt; which sorts the dired tab list whenever a new tab is added.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-25T09:43:20.777" LastActivityDate="2014-09-25T09:43:20.777" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="230" PostTypeId="2" ParentId="185" CreationDate="2014-09-25T09:37:56.183" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Also, I sometimes edit a package I'm developing and forget to recompile it. When I try to load the new file, it takes me a while to realise that Emacs is still using the old compiled file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;May I suggest to add a hook in your init file?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-save-hook 'byte-compile-current-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, if you want to apply the hook only on el files: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook (lambda () (add-hook 'after-save-hook 'byte-compile-current-buffer nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastEditorUserId="111" LastEditDate="2014-12-21T14:41:56.033" LastActivityDate="2014-12-21T14:41:56.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="231" PostTypeId="2" ParentId="228" CreationDate="2014-09-25T09:46:59.737" Score="12" Body="&lt;p&gt;There is nice package by &lt;a href=&quot;http://gnuvola.org&quot;&gt;TTN&lt;/a&gt; called &lt;a href=&quot;http://www.gnuvola.org/software/aa2u/&quot;&gt;aau2&lt;/a&gt; which is available in GNU ELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to test it. result is nice as you expected.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET ascii-art-to-unicode RET&#xA;\select region/&#xA;M-x aa2u RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: just for reference, here is mailing list link for an example.&#xA;&lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2014-05/msg00316.html&quot;&gt;http://lists.gnu.org/archive/html/help-gnu-emacs/2014-05/msg00316.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="224" LastActivityDate="2014-09-25T09:46:59.737" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="232" PostTypeId="2" ParentId="227" CreationDate="2014-09-25T09:59:46.760" Score="6" Body="&lt;p&gt;You have a few solutions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, there is a variable customizing this behavior: &lt;code&gt;TeX-arg-input-file-search&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If &lt;code&gt;TeX-arg-input-file&lt;/code&gt; should search for files.&#xA;  If the value is t, files in TeX's search path are searched for&#xA;  and provided for completion.  The file name is then inserted&#xA;  without directory and extension.  If the value is nil, the file&#xA;  name can be specified manually and is inserted with a path&#xA;  relative to the directory of the current buffer's file and with&#xA;  extension.  If the value is &lt;code&gt;ask&lt;/code&gt;, you are asked for the method&#xA;  to use every time &lt;code&gt;TeX-arg-input-file&lt;/code&gt; is called.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This piece of documentation is, imho, quite not clear enough, but setting it to &lt;code&gt;nil&lt;/code&gt; seems to do the job.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq TeX-arg-input-file-search nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This variable affects all functions that call &lt;code&gt;TeX-arg-input-file&lt;/code&gt;, including &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;include&lt;/code&gt; and &lt;code&gt;usepackage&lt;/code&gt;. For the latter, this behavior may be unexpected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there is a more hacky solution which should work for all functions: &lt;code&gt;TeX-arg-input-file&lt;/code&gt; features a &lt;code&gt;local&lt;/code&gt; flag for this behavior (this flag is for example set to &lt;code&gt;t&lt;/code&gt; for &lt;code&gt;include&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, you can override any other setting by just adding another entry for the command, so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook &#xA;  (lambda nil &#xA;     (TeX-add-symbols '(&quot;input&quot; (TeX-arg-input-file &quot;File&quot; t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A last solution, if you have long-lasting emacs sessions, is to simply let it go. It seems that the &quot;searching files&quot; phase caches its results, so it should be called only once per session.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2014-09-25T13:16:22.293" LastActivityDate="2014-09-25T13:16:22.293" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="233" PostTypeId="1" AcceptedAnswerId="53142" CreationDate="2014-09-25T10:05:04.587" Score="64" ViewCount="33854" Body="&lt;p&gt;I just tried to install &lt;code&gt;ascii-art-to-unicode&lt;/code&gt; from the gnu repository (&lt;a href=&quot;http://elpa.gnu.org/&quot;&gt;http://elpa.gnu.org/&lt;/a&gt;) via &lt;code&gt;list-packages&lt;/code&gt;. I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;package--check-signature: Failed to verify signature &#xA;   ascii-art-to-unicode-1.9.el.sig: (&quot;No public key &#xA;   for 474F05837FBDEF9B created at 2014-09-24T16:20:01+0200 &#xA;   using DSA&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using cask/pallet to manage my packages; is there some setup I missed? Some recent changes to elpa?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using an emacs 24.4 pre-release.&lt;/p&gt;&#xA;" OwnerUserId="295" LastActivityDate="2021-08-24T21:37:51.433" Title="How to proceed on package.el signature check failure" Tags="|package|package-repositories|" AnswerCount="9" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="234" PostTypeId="5" CreationDate="2014-09-25T10:10:52.700" Score="0" Body="&lt;p&gt;ELPA stands for Emacs Lisp Package Archive a simple package manager for Emacs, and a repository of pre-packed Emacs Lisp code. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can access the repository at: &lt;a href=&quot;http://elpa.gnu.org/&quot; rel=&quot;nofollow&quot;&gt;http://elpa.gnu.org/&lt;/a&gt;. For more information, please refer: &lt;a href=&quot;http://www.emacswiki.org/emacs/ELPA&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/ELPA&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs users, can use this tag when asking questions related to ELPA used in &lt;strong&gt;Emacs&lt;/strong&gt; editor.&lt;/p&gt;&#xA;" OwnerUserId="295" LastEditorUserId="45" LastEditDate="2014-10-20T06:57:39.783" LastActivityDate="2014-10-20T06:57:39.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="235" PostTypeId="4" CreationDate="2014-09-25T10:10:52.700" Score="0" Body="ELPA stands for Emacs Lisp Package Archive a simple package manager for Emacs, and a repository of pre-packed Emacs Lisp code." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-20T06:58:03.187" LastActivityDate="2014-10-20T06:58:03.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="236" PostTypeId="1" AcceptedAnswerId="2234" CreationDate="2014-09-25T10:24:16.713" Score="12" ViewCount="1404" Body="&lt;p&gt;Let's say I'm editing a latex in Auctex's latex-mode, and I have the following equation.&lt;br&gt;&#xA;&lt;strong&gt;This is just indented with &lt;code&gt;indent-region&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{align}&#xA;    \phi &amp;amp; = a + b&#xA;    + c + d \\&#xA;    &amp;amp; = a + b&#xA;    + c + d + e&#xA;\end{align}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above alignment is what I get if I select everything and hit &lt;code&gt;TAB&lt;/code&gt;,&#xA;that is, if I'm just using &lt;code&gt;indent-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I would like to get is the following:&lt;/strong&gt;&lt;br&gt;&#xA;Note how the &lt;code&gt;+ c + d&lt;/code&gt; is aligned with the text &lt;em&gt;after&lt;/em&gt; the &amp;amp;. This would make the most sense to be, as the &lt;code&gt;+ c + d&lt;/code&gt; are part of the same &quot;column&quot; as &lt;code&gt;= a + b&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{align}&#xA;    \phi &amp;amp; = a + b&#xA;           + c + d \\&#xA;         &amp;amp; = a + b&#xA;           + c + d + e&#xA;\end{align}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Below is what I get if I call &lt;code&gt;align-current&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{align}&#xA;    \phi &amp;amp; = a + b&#xA;    + c + d \\&#xA;         &amp;amp; = a + b&#xA;         + c + d + e&#xA;\end{align}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which &lt;em&gt;almost&lt;/em&gt; gets there, but not quite. The difference is clear.&lt;br&gt;&#xA;Also, if I decide to remove the &lt;code&gt;\phi&lt;/code&gt;, &lt;code&gt;align-current&lt;/code&gt; does something simply bizarre:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{align}&#xA; &amp;amp; = a + b&#xA;    + c + d \\&#xA; &amp;amp; = a + b&#xA;         + c + d + e&#xA;\end{align}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way I can customize &lt;code&gt;align-current&lt;/code&gt; or use something else to get the desired effect?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-25T11:01:49.853" LastActivityDate="2014-10-16T10:14:14.137" Title="Aligning multi-lined equations and tables in latex-mode" Tags="|latex|auctex|align|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="237" PostTypeId="1" AcceptedAnswerId="354" CreationDate="2014-09-25T11:16:38.273" Score="10" ViewCount="1555" Body="&lt;p&gt;I want to call the &lt;code&gt;ssh-add&lt;/code&gt; shell command.&#xA;So I invoke &lt;code&gt;M-x shell-command RET&lt;/code&gt;, and&#xA;in the minibuffer, I type: &lt;code&gt;ssh-add .ssh/id_rsa&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing I get is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory^M&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make Emacs give me another prompt, so I can type the passphrase ssh-add is waiting for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is with Emacs under X11 on Debian.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="25" LastEditDate="2015-01-01T16:40:58.620" LastActivityDate="2015-01-01T16:40:58.620" Title="Run ssh-add from Emacs and enter a passphrase" Tags="|subprocess|shell-command|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="238" PostTypeId="1" AcceptedAnswerId="239" CreationDate="2014-09-25T12:25:55.713" Score="8" ViewCount="625" Body="&lt;p&gt;I'm trying to understand how syntax tables work, but my minimal major mode doesn't highlight anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've written the following elisp, which is just supposed to highlight comments:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst my-yaml-mode-syntax-table&#xA;  (let ((table (make-syntax-table)))&#xA;    (modify-syntax-entry ?# &quot;&amp;lt;&quot; table)&#xA;    (modify-syntax-entry ?\n &quot;&amp;gt;&quot; table)&#xA;    table)&#xA;  &quot;Syntax table for `my-yaml-mode'.&quot;)&#xA;&#xA;(define-derived-mode my-yaml-mode fundamental-mode &quot;My YAML&quot;&#xA;  &quot;testing&quot;&#xA;  :syntax-table my-yaml-mode-syntax-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, given a file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# foo&#xA;# bar&#xA;baz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I activate my major-mode with &lt;code&gt;M-x my-yaml-mode&lt;/code&gt;, I don't get any highlighting. &lt;code&gt;C-u C-x =&lt;/code&gt; shows that no faces have been applied.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2017-05-02T12:45:29.590" LastActivityDate="2017-05-02T12:45:29.590" Title="How do I create a simple syntax table for a major mode?" Tags="|elisp|major-mode|syntax-highlighting|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="239" PostTypeId="2" ParentId="238" CreationDate="2014-09-25T12:52:44.060" Score="8" Body="&lt;p&gt;It is correct, but it is not being refontified just because you change major modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enable your major mode and put your cursor in the comment then run &lt;kbd&gt; M-x &lt;/kbd&gt; &lt;code&gt;eval-expression&lt;/code&gt; &lt;code&gt;(syntax-ppss-context (syntax-ppss (point)))&lt;/code&gt;, it should yield 'comment and you'll see that the syntax table is setup correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple fix would be to call &lt;code&gt;(font-lock-fontify-buffer)&lt;/code&gt; when enabling your mode. &lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-09-25T12:52:44.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="240" PostTypeId="2" ParentId="236" CreationDate="2014-09-25T13:01:15.643" Score="5" Body="&lt;p&gt;Assuming that you don't have any blank lines between the \begin and \end of your equations, you can call this function while your cursor is anywhere within the \begin-\end region.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/align-latex-eq ()&#xA;  &quot;Align the &amp;amp; chars and then align the +/= chars.&quot;&#xA;  (interactive)&#xA;  (backward-paragraph)&#xA;  (mark-paragraph)&#xA;  ;; align-regexp syntax:  align-regexp (beg end regexp &amp;amp;optional group spacing repeat)&#xA;  (align-regexp (region-beginning) (region-end) &quot;\\(\\s-*\\)&amp;amp;&quot; 1 1 nil)&#xA;  (mark-paragraph)&#xA;  (align-regexp (region-beginning) (region-end) &quot;\\(\\s-*\\)[+=]&quot; 1 1 nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-09-25T13:01:15.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="241" PostTypeId="1" AcceptedAnswerId="242" CreationDate="2014-09-25T13:01:33.883" Score="28" ViewCount="1128" Body="&lt;p&gt;I know of at least four possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;eshell&lt;/li&gt;&#xA;&lt;li&gt;term&lt;/li&gt;&#xA;&lt;li&gt;ansi-term&lt;/li&gt;&#xA;&lt;li&gt;shell&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What's the complete list of tools built-in to emacs to launch a shell, and what benefits and drawbacks do they offer?&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="61" LastEditDate="2014-09-25T13:28:51.373" LastActivityDate="2014-10-03T13:38:43.363" Title="What are all the ways of launching a shell from inside emacs and what are their various properties?" Tags="|eshell|shell|term|ansi-term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="242" PostTypeId="2" ParentId="241" CreationDate="2014-09-25T13:18:36.470" Score="32" Body="&lt;p&gt;&lt;code&gt;M-x shell&lt;/code&gt; is the standard interface to OS's shell. On linux, it calls bash (or whatever your default), on Windows, it calls cmd.exe. &lt;code&gt;M-x shell&lt;/code&gt; is the most frequently used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x eshell&lt;/code&gt; is a shell written in emacs lisp entirely. It has a syntax similar to bash, but is integrated with elisp well. e.g. you can eval elisp code right there. Eshell is especially useful on Windows when you don't have cygwin etc installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x term&lt;/code&gt; and &lt;code&gt;M-x ansi-term&lt;/code&gt; are terminal emulations, much like gnome-terminal, xterm, etc. The main difference to &lt;code&gt;M-x shell&lt;/code&gt; is that, in &lt;code&gt;eshell&lt;/code&gt; or &lt;code&gt;shell&lt;/code&gt;, keys are still emacs keys, but in &lt;code&gt;term&lt;/code&gt;, emacs keys doesn't work. But, the advantage is that you can run ssh, vim, or any command that are text-UI based, which won't work in &lt;code&gt;M-x eshell&lt;/code&gt; or &lt;code&gt;M-x shell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;term&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt; used to be different packages, but now they are 2 different commands in the same file term.el. I haven't used them much. You can find a more detailed answer about this on &lt;a href=&quot;http://www.emacswiki.org/emacs/AnsiTerm&quot;&gt;emacs wiki&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some more information on &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_shell_vs_term_vs_ansi-term_vs_eshell.html&quot;&gt;my blog&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="61" LastEditDate="2014-10-03T13:38:43.363" LastActivityDate="2014-10-03T13:38:43.363" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="243" PostTypeId="2" ParentId="212" CreationDate="2014-09-25T13:29:43.437" Score="31" Body="&lt;p&gt;@Malabarba mentioned the use of &lt;code&gt;wgrep&lt;/code&gt; package for editing grep/ack/ag results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to write a detailed walk-through of how I use the &lt;a href=&quot;https://github.com/Wilfred/ag.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ag&lt;/code&gt;&lt;/a&gt; package and &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-wgrep/blob/master/wgrep-ag.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;wgrep-ag&lt;/code&gt;&lt;/a&gt; packages to achieve editing of 'ag'ged results using &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;These packages are available through Melpa. You also need to have &lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ag&lt;/code&gt; aka the_silver_searcher&lt;/a&gt; installed on your system.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This walk-through applies to cases where you are looking for a way to do single line edits at all/selected locations that &lt;code&gt;ag&lt;/code&gt; found.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Install &lt;code&gt;ag&lt;/code&gt; on your system and the above mentioned emacs packages.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;ag&lt;/code&gt; supports searching files with contents that match your specified regex. The simplest way to tell &lt;code&gt;ag&lt;/code&gt; where the project root is to put an empty &lt;code&gt;.git&lt;/code&gt; folder there. Then do the search using &lt;code&gt;M-x ag-project-regexp&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The results buffer of ag search is not editable by default. To make it editable, do &lt;code&gt;M-x wgrep-change-to-wgrep-mode&lt;/code&gt; or use the &lt;code&gt;wgrep&lt;/code&gt;-default binding &lt;code&gt;C-c C-p&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now if you needed to change 'abcdef' to 'ghijkl' in all your files, you'd search for 'abcdef' and the ag results buffer will display all lines containing that string. Then you make that buffer editable and change those strings manually and those changes will reflect in the actual file buffers on doing &lt;code&gt;M-x wgrep-finish-edit&lt;/code&gt; or using the default binding &lt;code&gt;C-c C-e&lt;/code&gt;. You can also use &lt;code&gt;query-replace-regexp&lt;/code&gt; to do that search replace.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I prefer using &lt;code&gt;multiple-cursors&lt;/code&gt; for fast refactoring so that I can see a real time feedback of where my multiple edits are happening simultaneously. Highlight the string you want to replace in that ag results buffer and call &lt;code&gt;M-x mc/mark-all-like-this&lt;/code&gt; and then edit away in awe as you see stuff getting edited at multiple points at the same time. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Once you are happy with the edits, as I mentioned above, do &lt;code&gt;C-c C-e&lt;/code&gt; to &quot;reflect&quot; the changes in the actual buffers. &lt;em&gt;The buffers are not saved yet.&lt;/em&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To save all the buffers, I usually do that in one go, using the emacs default &lt;code&gt;C-x s !&lt;/code&gt; binding. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Here is an example use case with screenshots:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows the process of replacing all the instances of &lt;code&gt;bind-to-modi-map&lt;/code&gt; to &lt;code&gt;bind-to-my-map&lt;/code&gt; in my &lt;code&gt;~/.emacs.d/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I search for &lt;code&gt;bind-to-modi-map&lt;/code&gt; in my emacs setup folder, I get the below 'ag'ged result: &lt;img src=&quot;https://i.stack.imgur.com/gzoDm.png&quot; alt=&quot;ag results, unmodified&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This buffer is read-only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;M-x wgrep-change-to-wgrep-mode&lt;/code&gt;, I highlight, &lt;code&gt;-modi-map&lt;/code&gt;, select all instances of that selection using &lt;code&gt;M-x mc/mark-all-like-this&lt;/code&gt; and after editing those selections to &lt;code&gt;-my-map&lt;/code&gt;, it looks as below: &#xA;&lt;img src=&quot;https://i.stack.imgur.com/YqGvG.png&quot; alt=&quot;ag results, modified using multiple-cursors&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The blue highlight shows which lines will be modified when I press &lt;code&gt;C-c C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On hitting &lt;code&gt;C-c C-e&lt;/code&gt;, you can see the change reflected in the actual file in this screenshot: &#xA;    &lt;img src=&quot;https://i.stack.imgur.com/UCrbw.png&quot; alt=&quot;ag results, after finishing the edits&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would then save all the modified files using &lt;code&gt;C-x s !&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-09-25T13:40:59.327" LastActivityDate="2014-09-25T13:40:59.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="244" PostTypeId="2" ParentId="237" CreationDate="2014-09-25T13:42:10.967" Score="1" Body="&lt;p&gt;The simplest way to go about this is use &lt;strong&gt;&lt;code&gt;M-x shell&lt;/code&gt;&lt;/strong&gt; instead of &lt;code&gt;shell-command&lt;/code&gt;. &#xA;&lt;code&gt;M-x shell&lt;/code&gt; is an actual shell, not just a prompt, and it should be&#xA;capable of shallow interactions such as this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever you need to use a shell command and even &lt;code&gt;shell&lt;/code&gt; isn't doing&#xA;what you need, call &lt;strong&gt;&lt;code&gt;M-x term&lt;/code&gt;&lt;/strong&gt; instead, which is an actual terminal&#xA;emulator and should be capable of performing most tasks.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-25T13:42:10.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="245" PostTypeId="2" ParentId="169" CreationDate="2014-09-25T13:59:51.653" Score="86" Body="&lt;p&gt;There is also &lt;code&gt;auto-revert-mode&lt;/code&gt; which does it automatically and gives you feedback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the doc string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;auto-revert-mode is an interactive autoloaded compiled Lisp function&#xA;in `autorevert.el'.&#xA;&#xA;(auto-revert-mode &amp;amp;optional ARG)&#xA;&#xA;Toggle reverting buffer when the file changes (Auto Revert mode).&#xA;With a prefix argument ARG, enable Auto Revert mode if ARG is&#xA;positive, and disable it otherwise.  If called from Lisp, enable&#xA;the mode if ARG is omitted or nil.&#xA;&#xA;Auto Revert mode is a minor mode that affects only the current&#xA;buffer.  When enabled, it reverts the buffer when the file on&#xA;disk changes.&#xA;&#xA;Use `global-auto-revert-mode' to automatically revert all buffers.&#xA;Use `auto-revert-tail-mode' if you know that the file will only grow&#xA;without being changed in the part that is already in the buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="274" LastActivityDate="2014-09-25T13:59:51.653" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="246" PostTypeId="2" ParentId="64" CreationDate="2014-09-25T14:15:10.303" Score="5" Body="&lt;p&gt;The best way I can think of is to update these numbers immediately&#xA;before exporting or before evaluating.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Updater&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is the function that goes through the buffer. You can bind it to&#xA;a key, or add it to a hook. The following code updates the lines&#xA;&lt;em&gt;whenever you save the file&lt;/em&gt;, but if your use case is different, just&#xA;find out which hook you need! (org-mode is &lt;em&gt;full&lt;/em&gt; of hooks)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'before-save-hook #'endless/update-includes)&#xA;&#xA;(defun endless/update-includes (&amp;amp;rest ignore)&#xA;  &quot;Update the line numbers of all #+INCLUDE:s in current buffer.&#xA;Only looks at INCLUDEs that already have a line number listed!&#xA;This function does nothing if not in org-mode, so you can safely&#xA;add it to `before-save-hook'.&quot;&#xA;  (interactive)&#xA;  (when (derived-mode-p 'org-mode)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (search-forward-regexp&#xA;              &quot;^\\s-*#\\+INCLUDE: *\&quot;\\([^\&quot;]+\\)\&quot;.*:lines *\&quot;\\([-0-9]+\\)\&quot;&quot;&#xA;              nil 'noerror)&#xA;        (let* ((file (expand-file-name (match-string-no-properties 1)))&#xA;               (lines (endless/decide-line-range file)))&#xA;          (when lines&#xA;            (replace-match lines :fixedcase :literal nil 2)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;The Regexps&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is where you define the regexps which will be used as the first&#xA;and last lines to be included. You can give a list of regexps for&#xA;each file extension.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom endless/extension-regexp-map &#xA;  '((&quot;sv&quot; (&quot;^class\\b&quot; . &quot;^endclass\\b&quot;) (&quot;^enum\\b&quot; . &quot;^endenum\\b&quot;)))&#xA;  &quot;Alist of regexps to use for each file extension.&#xA;Each item should be&#xA;    (EXTENSION (REGEXP-BEGIN . REGEXP-END) (REGEXP-BEGIN . REGEXP-END))&#xA;See `endless/decide-line-range' for more information.&quot;&#xA;  :type '(repeat (cons string (repeat (cons regexp regexp)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;The background worker&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is the guy that does most of the work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/decide-line-range (file)&#xA;  &quot;Visit FILE and decide which lines to include.&#xA;The FILE's extension is used to get a list of cons cells from&#xA;`endless/extension-regexp-map'. Each cons cell is a pair of&#xA;regexps, which determine the beginning and end of region to be&#xA;included. The first one which matches is used.&quot;&#xA;  (let ((regexps (cdr-safe (assoc (file-name-extension file)&#xA;                                  endless/extension-regexp-map)))&#xA;        it l r)&#xA;    (when regexps&#xA;      (save-match-data&#xA;        (with-temp-buffer&#xA;          (insert-file file)&#xA;          (while regexps&#xA;            (goto-char (point-min))&#xA;            (setq it (pop regexps))&#xA;            (when (search-forward-regexp (car it) nil 'noerror)&#xA;              (setq l (line-number-at-pos (match-beginning 0)))&#xA;              (when (search-forward-regexp (cdr it) nil 'noerror)&#xA;                (setq regexps nil&#xA;                      r (line-number-at-pos (match-end 0))))))&#xA;          (when r (format &quot;%s-%s&quot; l (+ r 1))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-25T17:17:07.750" LastActivityDate="2014-09-25T17:17:07.750" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="247" PostTypeId="1" AcceptedAnswerId="248" CreationDate="2014-09-25T14:21:56.323" Score="4" ViewCount="86" Body="&lt;p&gt;In bash I commonly use an alias 'nth' (hint: it makes sense as a key-combo if you use Dvorak layout). When I type this in eshell, I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ nth&#xA;usage: nth: (N LIST)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get eshell ignore &lt;code&gt;nth&lt;/code&gt; as a lisp command?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2014-09-25T14:42:24.970" Title="How can I reclaim &quot;nth&quot; for bash in eshell?" Tags="|eshell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="248" PostTypeId="2" ParentId="247" CreationDate="2014-09-25T14:42:24.970" Score="7" Body="&lt;p&gt;You'll need to redefine the alias for eshell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance if you alias &lt;code&gt;nth&lt;/code&gt; to &lt;code&gt;echo hi&lt;/code&gt; in bash then in eshell type &lt;code&gt;alias nth echo hi&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eshell will write your aliases to your &lt;code&gt;eshell-alias-file&lt;/code&gt; where they will persist.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-09-25T14:42:24.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="249" PostTypeId="1" CreationDate="2014-09-25T15:56:48.513" Score="23" ViewCount="11091" Body="&lt;p&gt;Search and replace, by &lt;kbd&gt;M-%&lt;/kbd&gt; and &lt;kbd&gt;!&lt;/kbd&gt;, is done from current position to the end of the buffer. How can I do it for the entire buffer? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="306" LastEditDate="2016-08-16T13:58:36.860" LastActivityDate="2022-06-08T10:50:23.617" Title="How to search and replace in the entire buffer?" Tags="|replace|" AnswerCount="7" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="250" PostTypeId="2" ParentId="249" CreationDate="2014-09-25T16:04:16.373" Score="17" Body="&lt;p&gt;I don't see that supported while still retaining your starting position. (I don't see a way to wrap to the beginning of the buffer when search reaches the end.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your best bet is using &lt;kbd&gt;M-&amp;lt;&lt;/kbd&gt; to go to the start of the buffer, then do the &lt;code&gt;query-replace&lt;/code&gt;, when you're done press &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-space&lt;/kbd&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-space&lt;/kbd&gt; to jump back to your starting point.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="147" LastEditDate="2014-09-27T03:34:30.063" LastActivityDate="2014-09-27T03:34:30.063" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="251" PostTypeId="1" CreationDate="2014-09-25T16:16:10.117" Score="26" ViewCount="5187" Body="&lt;p&gt;Some Unicode characters cause the line they are displayed on to be quite large. For example, a grave accent &quot;̀ &quot; adds about 2.5 lines of space above and below it. Other characters that cause this behavior include the Greek letter &quot;ϕ&quot; (phi) or subset-equal &quot;⫅&quot;. Other characters such as maps-to &quot;⤇&quot; add only about 0.5 lines on either side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran into this problem when reading the source of &lt;code&gt;julia-mode.el&lt;/code&gt; which contains a large number of such characters for LaTeX substitution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does this occur, and can it be fixed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I'm using Ubuntu 14.04 LTS with Emacs 24.3.1. By default I use the &quot;Ubuntu Mono 13&quot; font but other fonts are sometimes used to display characters. I have installed no packages to explicitly manage unicode, and this problem is reproducible using the command &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="313" LastEditorUserId="25" LastEditDate="2014-09-27T00:49:40.777" LastActivityDate="2015-10-07T05:49:54.203" Title="Line height with unicode characters" Tags="|unicode|fonts|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="252" PostTypeId="2" ParentId="249" CreationDate="2014-09-25T16:27:22.297" Score="15" Body="&lt;p&gt;You can follow the following steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x h&lt;/code&gt; — Select the whole buffer &lt;em&gt;or&lt;/em&gt; &lt;code&gt;M-&amp;lt;&lt;/code&gt; - Go to the top of the buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-%&lt;/code&gt; — Initiate &lt;code&gt;query-replace&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;!&lt;/code&gt; — Force replace all&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u C-SPC C-u C-SPC&lt;/code&gt; — Move back to your starting position&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="25" LastEditDate="2014-09-27T00:27:07.940" LastActivityDate="2014-09-27T00:27:07.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="253" PostTypeId="2" ParentId="249" CreationDate="2014-09-25T16:35:31.820" Score="3" Body="&lt;p&gt;You can add this to your &lt;code&gt;init.el&lt;/code&gt; file to update the behavior of &lt;code&gt;M-%&lt;/code&gt; to to replace the word in the entire buffer by default:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/query-replace (from-string to-string &amp;amp;optional delimited start end)&#xA;  &quot;Replace some occurrences of FROM-STRING with TO-STRING.  As each match is&#xA;found, the user must type a character saying what to do with it. This is a&#xA;modified version of the standard `query-replace' function in `replace.el',&#xA;This modified version defaults to operating on the entire buffer instead of&#xA;working only from POINT to the end of the buffer. For more information, see&#xA;the documentation of `query-replace'&quot;&#xA;  (interactive&#xA;   (let ((common&#xA;      (query-replace-read-args&#xA;       (concat &quot;Query replace&quot;&#xA;           (if current-prefix-arg &quot; word&quot; &quot;&quot;)&#xA;           (if (and transient-mark-mode mark-active) &quot; in region&quot; &quot;&quot;))&#xA;       nil)))&#xA;     (list (nth 0 common) (nth 1 common) (nth 2 common)&#xA;       (if (and transient-mark-mode mark-active)&#xA;           (region-beginning)&#xA;         (buffer-end -1))&#xA;       (if (and transient-mark-mode mark-active)&#xA;           (region-end)&#xA;         (buffer-end 1)))))&#xA;  (perform-replace from-string to-string t nil delimited nil nil start end))&#xA;;; Replace the default key mapping&#xA;(define-key esc-map &quot;%&quot; 'my/query-replace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And to get the same behavior from &lt;code&gt;query-replace-regexp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/query-replace-regexp (regexp to-string &amp;amp;optional delimited start end)&#xA;  &quot;Replace some things after point matching REGEXP with TO-STRING.  As each&#xA;match is found, the user must type a character saying what to do with&#xA;it. This is a modified version of the standard `query-replace-regexp'&#xA;function in `replace.el', This modified version defaults to operating on the&#xA;entire buffer instead of working only from POINT to the end of the&#xA;buffer. For more information, see the documentation of `query-replace-regexp'&quot;&#xA;  (interactive&#xA;   (let ((common&#xA;      (query-replace-read-args&#xA;       (concat &quot;Query replace&quot;&#xA;           (if current-prefix-arg &quot; word&quot; &quot;&quot;)&#xA;           &quot; regexp&quot;&#xA;           (if (and transient-mark-mode mark-active) &quot; in region&quot; &quot;&quot;))&#xA;       t)))&#xA;     (list (nth 0 common) (nth 1 common) (nth 2 common)&#xA;       (if (and transient-mark-mode mark-active)&#xA;           (region-beginning)&#xA;         (buffer-end -1))&#xA;       (if (and transient-mark-mode mark-active)&#xA;           (region-end)&#xA;         (buffer-end 1)))))&#xA;  (perform-replace regexp to-string t t delimited nil nil start end))&#xA;;; Replace the default key mapping&#xA;(define-key esc-map [?\C-%] 'my/query-replace-regexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-09-25T17:05:13.127" LastActivityDate="2014-09-25T17:05:13.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="255" PostTypeId="1" AcceptedAnswerId="261" CreationDate="2014-09-25T17:25:50.570" Score="30" ViewCount="7662" Body="&lt;p&gt;I use org-mode to document stuff and usually export it to pdf (via latex) and html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the &lt;code&gt;\\&lt;/code&gt; characters are at the &lt;strong&gt;end&lt;/strong&gt; of a line, it forces a newline character when exporting to both pdf and html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like to know how to force a newline character &lt;strong&gt;in-between&lt;/strong&gt; a line when exporting to html. It would be helpful to have this solution so that I can have multi-line titles in html exports too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: First Line of Title \\ Second Line of Title&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above exports to 2 lines in pdf export but the &lt;code&gt;\\&lt;/code&gt; characters are retained in html export (as they are not at the end of the line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I format the title so that multi line titles export fine in both formats?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="50" LastEditDate="2014-10-06T13:35:07.417" LastActivityDate="2015-05-07T14:50:39.783" Title="New line in Title of an org-mode exported html document" Tags="|org-mode|html|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="256" PostTypeId="2" ParentId="233" CreationDate="2014-09-25T17:28:04.980" Score="5" Body="&lt;p&gt;It appears that the key used to sign this package (474F05837FBDEF9B) is indeed not published (therefore cannot be signed, therefore cannot be trusted).&#xA;But it would seem that package.el is supposed to fail gracefully (for now) in such cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If package-check-signature is allow-unsigned, don't&#xA;;; signal error when we can't verify signature because of&#xA;;; missing public key.  Other errors are still treated as&#xA;;; fatal (bug#17625).&#xA;(unless (and (eq package-check-signature 'allow-unsigned)&#xA;             (eq (epg-signature-status sig) 'no-pubkey))&#xA;  (setq had-fatal-error t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I'm wondering if for some reason your value of &lt;code&gt;package-check-signature&lt;/code&gt; is different than its default value of &lt;code&gt;allow-unsigned&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-25T17:28:04.980" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="257" PostTypeId="2" ParentId="251" CreationDate="2014-09-25T17:37:14.720" Score="7" Body="&lt;p&gt;This occurs because Emacs uses different fonts for different parts of the Unicode character set. You can verify what font is being used by positioning the cursor over a character and pressing &lt;kbd&gt;C-u C-x =&lt;/kbd&gt;. For instance, with my configuration over an ASCII character I get &lt;code&gt;nil:-apple-Consolas-medium-normal-normal-*-14-*-*-*-m-0-iso10646-1 (#x88)&lt;/code&gt;, but over a ⧺ I get &lt;code&gt;nil:-apple-Symbola-medium-normal-normal-*-14-*-*-*-p-0-iso10646-1 (#xCE1)&lt;/code&gt; (in other words, it's using Consolas for ASCII and Symbola for some special characters). Different fonts have different heights, and Emacs will always give enough space in the line height to display the tallest font. By default, Emacs will try to use system-dependent fonts that work, but this often leads to ugly results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution I've found to the line height problem is unfortunately rather annoying: I go through the problematic characters I find and use &lt;code&gt;set-fontset-font&lt;/code&gt; to set them to a font/size that doesn't affect the line height. The code to do this is available in &lt;a href=&quot;https://github.com/shosti/.emacs.d/blob/master/personal/p-display.el#L9&quot; rel=&quot;noreferrer&quot;&gt;my configuration&lt;/a&gt;, but it's ugly and still not perfect. If anyone has a better solution I'd be interested in hearing it.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-09-25T17:52:10.153" LastActivityDate="2014-09-25T17:52:10.153" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="258" PostTypeId="1" AcceptedAnswerId="400" CreationDate="2014-09-25T17:43:07.283" Score="9" ViewCount="861" Body="&lt;p&gt;I have &lt;code&gt;show-trailing-whitespace&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt; globally in my &lt;code&gt;.emacs&lt;/code&gt; file, and this is generally not a problem except for when I'm in &lt;code&gt;diff-mode&lt;/code&gt; looking at a patch which has mandatory trailing white space for blank context lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution would be to simply turn off &lt;code&gt;show-trailing-whitespace&lt;/code&gt; in &lt;code&gt;diff-mode&lt;/code&gt; in some relevant hook, but actually I'd like for trailing white space in change lines to still show up. For example, if I've accidentally introduced trailing white space or if I'm removing it, that's ok, and &lt;strong&gt;I still want that to show up in the &lt;code&gt;trailing-whitespace&lt;/code&gt; face&lt;/strong&gt;. I just don't want the blank context lines to be treated as trailing white space since they are necessary for the diff format itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of the current behavior that I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8bUrS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this is what I would like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mZxta.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's another example, but this time, with &lt;em&gt;actual&lt;/em&gt; whitespace addition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/DhRRt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if I disable &lt;code&gt;show-trailing-whitespace&lt;/code&gt; entirely in &lt;code&gt;diff-mode&lt;/code&gt;, then I wouldn't see any dark red at all. Instead, this is what I'm wanting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jX5Ap.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I think this involves making &lt;code&gt;show-trailing-whitespace&lt;/code&gt; aware that diff lines with just a single space are special.&lt;/p&gt;&#xA;" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-09-26T23:49:05.587" LastActivityDate="2014-09-29T17:17:36.410" Title="Override `show-trailing-whitespace` in `diff-mode`" Tags="|diff-mode|whitespace|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="259" PostTypeId="2" ParentId="255" CreationDate="2014-09-25T17:48:20.547" Score="3" Body="&lt;p&gt;I'm not entirely sure there wouldn't be any unwanted side effects, but the following might work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push (cons &quot;\\\\\\\\&quot; &quot;&amp;lt;br /&amp;gt;&quot;) org-html-special-string-regexps)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Kinda lucky that the list of special string expansions is extensible in the HTML exporter, because it's not in the LaTeX exporter...&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-25T17:48:20.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="260" PostTypeId="1" CreationDate="2014-09-25T17:56:33.810" Score="10" ViewCount="598" Body="&lt;p&gt;I want to use Emacs as an enhanced way to view the source of a page (say &lt;code&gt;http://example.com&lt;/code&gt;). Is there some easy way to download the page directly from Emacs, maybe even through &lt;code&gt;C-x C-f&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I remember doing this &lt;em&gt;somehow&lt;/em&gt; in the past (maybe thanks to TRAMP?), but not &lt;em&gt;how&lt;/em&gt;, and I can't reproduce it any more.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="25" LastEditDate="2014-09-27T00:21:50.123" LastActivityDate="2014-09-27T00:21:50.123" Title="How can I download a web page's source from Emacs?" Tags="|tramp|web|networking|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="261" PostTypeId="2" ParentId="255" CreationDate="2014-09-25T17:57:20.240" Score="42" Body="&lt;p&gt;Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Foo @@latex:\\@@ Bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Foo @@latex:\\@@ @@html:&amp;lt;br&amp;gt;@@ Bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If such newline characters are needed to be added at multiple places in the document, replacing this verbose &lt;code&gt;@@latex:\\@@ @@html:&amp;lt;br&amp;gt;@@&lt;/code&gt; string with an org mode &lt;code&gt;MACRO&lt;/code&gt; would be better suited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A MACRO definition like below can be placed at the top of the document or in a common &quot;org config&quot; file that's included in your org documents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: NEWLINE @@latex:\\@@ @@html:&amp;lt;br&amp;gt;@@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The MACRO can then be used for formatting the title as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Foo {{{NEWLINE}}} Bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advantages of using the MACRO approach are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The org mode document is easier to read &lt;/li&gt;&#xA;&lt;li&gt;If the need arises to change the definition of &lt;code&gt;{{{NEWLINE}}}&lt;/code&gt; to support a new export format, then that change needs to be done at just one place.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Example: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: NEWLINE @@latex:\\@@ @@html:&amp;lt;br&amp;gt;@@ @@ascii:|@@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE: &lt;code&gt;@@ascii:|@@&lt;/code&gt; won't insert a newline in ascii exports; it will simply place the pipe character &lt;code&gt;|&lt;/code&gt; wherever &lt;code&gt;{{{NEWLINE}}}&lt;/code&gt; was used in the org doc.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the &lt;code&gt;#+SUBTITLE&lt;/code&gt; keyword may also help.&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="91" LastEditDate="2015-05-07T14:50:39.783" LastActivityDate="2015-05-07T14:50:39.783" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="262" PostTypeId="2" ParentId="209" CreationDate="2014-09-25T18:05:43.337" Score="5" Body="&lt;p&gt;Perhaps not a full answer to your question, but the package  &lt;a href=&quot;https://github.com/emacs-helm/helm-descbinds&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;helm-descbinds&lt;/code&gt;&lt;/a&gt; helps you &lt;strong&gt;search&lt;/strong&gt; all the defined keyboard bindings from the ascii representation of the shortcut. For every hit, it shows you the interactive function associated with the keyboard shortcut, and you can ask &lt;code&gt;helm-descbinds&lt;/code&gt; to &lt;strong&gt;describe&lt;/strong&gt; it, or &lt;strong&gt;execute&lt;/strong&gt; it directly from the search results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fzSy6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the package description from the GitHub site:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Helm Descbinds provides an interface to emacs’ describe-bindings&#xA;  making the currently active key bindings interactively searchable with&#xA;  helm.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Additionally you have the following actions&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Execute the command&lt;/li&gt;&#xA;  &lt;li&gt;Describe the command&lt;/li&gt;&#xA;  &lt;li&gt;Find the command&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;And &lt;code&gt;C-z&lt;/code&gt; will give you a persistent description of the current command.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6" LastActivityDate="2014-09-25T18:05:43.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="263" PostTypeId="2" ParentId="260" CreationDate="2014-09-25T18:09:21.473" Score="8" Body="&lt;p&gt;Here's a really quick and dirty solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-view-source (url)&#xA;  (interactive &quot;MURL: &quot;)&#xA;  (switch-to-buffer (url-retrieve url (lambda (_)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;url-retrieve&lt;/code&gt; is built-in to Emacs; there are also alternatives such as &lt;a href=&quot;https://github.com/tkf/emacs-request&quot;&gt;request.el&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-25T18:09:21.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="264" PostTypeId="2" ParentId="260" CreationDate="2014-09-25T18:10:02.203" Score="5" Body="&lt;p&gt;The &lt;a href=&quot;http://www.emacswiki.org/emacs/w3&quot;&gt;w3&lt;/a&gt; mode can do this with the &lt;code&gt;w3-source-document-at-point&lt;/code&gt; command which by default is bound to &lt;code&gt;s&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also use &lt;code&gt;M-!&lt;/code&gt; and invoke &lt;code&gt;curl&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-09-25T18:10:02.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="265" PostTypeId="1" AcceptedAnswerId="266" CreationDate="2014-09-25T18:31:15.033" Score="29" ViewCount="3330" Body="&lt;p&gt;I recently had a Sublime Text user try out Emacs for a while, and he was interested in getting the same auto-save behavior in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, he wanted &lt;strong&gt;all buffers to be saved whenever the frame lost focus&lt;/strong&gt; (really saved, not just backed-up). This includes when switching windows to a completely different application. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could not find any event that was triggered when switching to a different application. Is there such an event or is there another way to achieve the same behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note a time based solution was not satisfactory, and neither was the default auto backup behavior. He specifically wanted the buffers to be saved (as in &lt;code&gt;save-buffer&lt;/code&gt;) for all files.&lt;/p&gt;&#xA;" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-09-26T16:10:27.203" LastActivityDate="2015-07-18T10:01:56.880" Title="How to auto-save buffers when Emacs loses focus?" Tags="|buffers|saving|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="266" PostTypeId="2" ParentId="265" CreationDate="2014-09-25T18:34:31.103" Score="34" Body="&lt;p&gt;Unfortunately, this exact behavior isn't possible in Emacs &amp;lt;= 24.3, but you can save on window/buffer change using &lt;code&gt;defadvice&lt;/code&gt; (as detailed &lt;a href=&quot;http://batsov.com/articles/2012/03/08/emacs-tip-number-5-save-buffers-automatically-on-buffer-or-window-switch/&quot;&gt;on bbatsov's blog&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice switch-to-buffer (before save-buffer-now activate)&#xA;  (when (and buffer-file-name (buffer-modified-p)) (save-buffer)))&#xA;(defadvice other-window (before other-window-now activate)&#xA;  (when (and buffer-file-name (buffer-modified-p)) (save-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs 24.4, you will also be able to save on frame focus loss thanks to the new &lt;a href=&quot;http://emacsredux.com/blog/2014/03/22/a-peek-at-emacs-24-dot-4-focus-hooks/&quot;&gt;focus hooks&lt;/a&gt;: &lt;code&gt;(add-hook 'focus-out-hook 'save-buffer)&lt;/code&gt; (to save the active buffer) or &lt;code&gt;(add-hook 'focus-out-hook (lambda () (save-some-buffers t)))&lt;/code&gt; (to save all open buffers).&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8595" LastEditDate="2015-06-15T15:17:10.763" LastActivityDate="2015-06-15T15:17:10.763" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="268" PostTypeId="1" AcceptedAnswerId="270" CreationDate="2014-09-25T18:41:10.777" Score="136" ViewCount="20597" Body="&lt;p&gt;I notice that there are several different repositories that often contain the same software.  Why would I want to prefer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU ELPA&lt;/li&gt;&#xA;&lt;li&gt;Marmalade&lt;/li&gt;&#xA;&lt;li&gt;MELPA&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;over the others?  Since any one repository does not contain all the packages that I want, is it a good idea to have these repositories enabled simultaneously?&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="50" LastEditDate="2014-11-16T16:08:56.950" LastActivityDate="2018-06-14T09:13:16.760" Title="What are the practical differences between the various Emacs Package Repositories?" Tags="|package|package-repositories|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="270" PostTypeId="2" ParentId="268" CreationDate="2014-09-25T18:52:42.987" Score="93" Body="&lt;p&gt;&lt;strong&gt;GNU ELPA&lt;/strong&gt; is the official GNU Emacs package repository. It's the only one enabled by default, which means that it has the greatest reach. At the same time, submitting a package there is a bit of a hassle and requires an FSF copyright assignment, which means it has a relatively limited selection of packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MELPA&lt;/strong&gt; and &lt;strong&gt;Marmalade&lt;/strong&gt; are both third-party package repositories. They're not officially supported by GNU, but also have much larger selections of packages. Package quality is a bit more variable, but you're much more likely to find whatever you're looking for, especially if it's a bit obscure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Marmalade and MELPA have slightly different models for package uploaders. My understanding is that MELPA tracks a version control repository directly (ie via GitHub), letting package authors update packages just by pushing commits to a branch. Marmalade, on the other hand, has people upload packages to the repository explicitly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, I haven't seen much difference between MELPA and Marmalade. There isn't much downside to enabling both of them to have the largest possible selection of installable packages: I've been using both (and GNU ELPA, of course) for a while with no significant problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possible concern (which I haven't run into myself) with having both repositories enabled, which I haven't run into myself, is having packages available from both at different versions. By default, the package manager (&lt;code&gt;package.el&lt;/code&gt;) does not have any way to resolve conflict like this; however, you can resolve this by installing the &lt;code&gt;melpa&lt;/code&gt; package which lets you customize which packages are provided or excluded from which repositories. You can see more details &lt;a href=&quot;http://www.wisdomandwonder.com/article/8012/how-to-choose-packages-between-two-elpa-repositories&quot;&gt;here&lt;/a&gt; or from the documentation for the &lt;code&gt;melpa&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Malabarba helpfully pointed out, this problem is resolved in Emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're really worried about security, you may want to avoid both MELPA and Marmalade because they let anyone upload packages and, as far as I know, don't have any proactive security arrangements. The GNU ELPA repository, on the other hand, is managed by the FSF and has signed packages which should help. Of course, if security is really important, you might want to just review and install elisp packages by hand instead of using the package manager.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="105" LastEditDate="2014-10-25T15:56:12.553" LastActivityDate="2014-10-25T15:56:12.553" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="271" PostTypeId="1" AcceptedAnswerId="274" CreationDate="2014-09-25T19:14:02.090" Score="109" ViewCount="48195" Body="&lt;p&gt;Macintosh users have several choices of pre-built Emacs.  I am aware of the following versions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;YAMAMOTO Mitsuharu's &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Mac Port&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;David Caldwell's &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs for Mac OS X&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Vincent Goulet's &lt;a href=&quot;https://vigou3.gitlab.io/emacs-modified-macos/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Modified for macOS&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;David Reitter's &lt;a href=&quot;http://aquamacs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Aquamacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Some questions I had in mind:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do these versions differ in any signifcant ways?&lt;/li&gt;&#xA;&lt;li&gt;Can one obtain the functionality of the others by simply modifying the initialization file?&lt;/li&gt;&#xA;&lt;li&gt;Do these changes make their way back upstream?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I am aware that Aquamacs is considered &amp;quot;unorthodox&amp;quot; as it has very Mac-like keybindings, but I am also interested in understanding the differences between the non-Aquamacs versions.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="14640" LastEditDate="2021-03-25T02:25:14.660" LastActivityDate="2023-07-12T03:45:37.177" Title="What is the difference between Aquamacs and other Mac versions of Emacs?" Tags="|osx|aquamacs|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="272" PostTypeId="2" ParentId="249" CreationDate="2014-09-25T19:41:40.840" Score="9" Body="&lt;p&gt;You could add the following command to your emacs initialization file, and bind it to&#xA;the keystroke of your choice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun replace-regexp-entire-buffer (pattern replacement)&#xA;  &quot;Perform regular-expression replacement throughout buffer.&quot;&#xA;  (interactive&#xA;   (let ((args (query-replace-read-args &quot;Replace&quot; t)))&#xA;     (setcdr (cdr args) nil)    ; remove third value returned from query---args&#xA;     args))&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward pattern nil t)&#xA;      (replace-match replacement))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="321" LastActivityDate="2014-09-25T19:41:40.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="273" PostTypeId="2" ParentId="249" CreationDate="2014-09-25T19:58:57.837" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search-And-Replace&quot; rel=&quot;nofollow noreferrer&quot;&gt;search-and-replace&lt;/a&gt; over the entire buffer (or multiple buffers or files or bookmark targets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And unlike &lt;code&gt;query-replace&lt;/code&gt; (e.g. &lt;code&gt;C-x h M-%&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can navigate the matches &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;in any order&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Replacement is on demand: you &lt;em&gt;need not visit each match&lt;/em&gt; and answer whether or not to replace it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2020-02-06T15:58:44.503" LastActivityDate="2020-02-06T15:58:44.503" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="274" PostTypeId="2" ParentId="271" CreationDate="2014-09-25T20:16:56.503" Score="138" Body="&lt;h1&gt;Emacs for Mac OS X&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsformacosx.com/&quot;&gt;Emacs for Mac OS X&lt;/a&gt; provides OS X binaries of GNU &#xA;Emacs proper.  It's roughly the same you'd get by compiling a GNU Emacs release tarball with &lt;code&gt;./configure --with-ns&lt;/code&gt;.  The site provides builds of stable releases and pretests, as well as nightly snapshots.  All of these builds are self-contained, which lets you safely try pretests and snapshots. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note though, that these binaries lack support for some libraries, notably GNU TLS and ImageMagick.  If you'd like to use these—the former is particularly important if you'd like to read your mail in Emacs—you need to get GNU Emacs from Homebrew.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Emacs for OS X Modified&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;According to the website &lt;a href=&quot;http://vgoulet.act.ulaval.ca/en/emacs/mac/&quot;&gt;Emacs for OS X Modified&lt;/a&gt; is simply a standard build of GNU Emacs, based on the above, with some additional packages, and the necessary configuration to enable all of these packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the notable exception of ESS, all of these packages are available through Emacs' package archives for installation in any Emacs.  For instance, you can install AUCTeX in GNU Emacs proper by simply typing &lt;code&gt;M-x package-install RET auctex&lt;/code&gt;, and enabling it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The choice of packages suggests that it's mostly targeted at statistician and researches, which would work through their data with R and ESS, and then publish a paper with Org or AUCTeX and LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other users, this distribution is probably of little value, since you'd need to install additional packages anyway, and might as well use GNU Emacs proper right away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the only distribution which you can create yourself in GNU Emacs proper by installing additional Emacs packages and adjusting your &lt;code&gt;init.el&lt;/code&gt; accordingly.  The other distributions are patched and forked variants of GNU Emacs.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Emacs Mac Port&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot;&gt;Emacs Mac Port&lt;/a&gt; is a patch set for GNU Emacs proper for better OS X integration.  Note that GNU Emacs itself has native OS X support as well, but lacks the OS X specific additions, which this patch set provides.  Notably:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Core Text for text rendering, which improves text appearance and Unicode support.  This was merged into GNU Emacs proper, and is part of Emacs 24.4.&lt;/li&gt;&#xA;&lt;li&gt;Smooth scrolling.  GNU Emacs proper scrolls line-wise, which is very laggy and jumpy with trackpads.  Emacs Mac Port uses pixel-based scrolling like other native OS X applications, which feels &lt;em&gt;much&lt;/em&gt; smoother and is much more precise.  It only affects trackpad scrolling, though, so if you don't use the mouse, you won't need it.&lt;/li&gt;&#xA;&lt;li&gt;Gestures.  You can pinch to increase/decrease the text size.  Again, if you don't use the mouse, you won't notice it, and it's arguably just a fancy feature.&lt;/li&gt;&#xA;&lt;li&gt;Support for Apple Events.  You can send and receive Apple Events from Emacs Lisp.&lt;/li&gt;&#xA;&lt;li&gt;Dictionary service.  Three-finger tapping will search the word under cursor in Apple's Dictionary application, like in other OS X applications.&lt;/li&gt;&#xA;&lt;li&gt;Services integration.  You can open a selected file in Finder from the context menu in the running Emacs.&lt;/li&gt;&#xA;&lt;li&gt;Native SVG display using Webkit, rather than librsvg.  Webkit has better SVG support to my knowledge, but who views SVGs in Emacs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You'll notice that most of these features are merely concerned with integration into OS X, and are not essential to using Emacs.  Other than that, Emacs Mac Port is pretty much like a standard GNU Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of its features make their way back into GNU Emacs, but other will never be merged, since they are exclusive to OS X, and not available in the free alternative GNUStep, which goes against the politics of the FSF to not support proprietary operating systems over their free alternatives.  Also, if I remember correctly, the author of this patchset has shown little interest to bring the features back upstream, probably for the former reason.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Aquamacs&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Aquamacs is a &lt;strong&gt;heavily patched fork&lt;/strong&gt; of GNU Emacs.  Unlike all of the above, it's not based on GNU Emacs, but has an independent source tree.  It's regularly synched with Emacs upstream, though, and closely follows Emacs releases.  It inevitably lags behind GNU Emacs trunk, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is heavily modified to look and feel like a native OS X application.  Notably it supports and encourages standard OS X key bindings, e.g &lt;kbd&gt;Cmd+S&lt;/kbd&gt; to save.  Standard Emacs bindings are mostly still available though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since its a fork, heavily modified and with entirely different aims and principles, none of its features will be merged with GNU Emacs:  Most of these modifications go directly against the “spirit”, ideas and philosophy of GNU Emacs.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;TL;DR (or: What should I pick)&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you are a statistician or researcher and don't want to setup Emacs yourself:  &lt;strong&gt;Emacs for OS X modified&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;If you want a native OS X application more than everything else: &lt;strong&gt;Aquamacs&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;If you want Emacs, but with as good OS X support as can be: &lt;strong&gt;Emacs Mac Port&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;If you just want Emacs without any complications: &lt;strong&gt;Emacs for Mac OS X&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;My personal advice&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I never tried Emacs for OS X Modified or Aquamacs, but I see little use in the former (I am no statistician, and can install AUCTeX by myself).  I'd also recommend against the latter:  It's a fork, and while it gives you best OS X integration, it inevitably lags behind, and receives less support from the Emacs community overall.  Many packages don't support Aquamacs, so if there are issues, there's a good chance for you to be left alone as an Aquamacs user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did try Emacs Mac Port, and while smooth scrolling, gestures and Apple Events are nice, I found that these little benefits are not worth the hassle of keeping a patched version of GNU Emacs.  YMMV, obviously, and if you care for good OS X support, and if these features appeal to you, you should definitely try it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nowadays, I use just GNU Emacs snapshot builds.  These have reasonably good OS X support, and are by far the easiest to install, and best supported by the community.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to get them from Emacs for Mac OS X, but now I use Homebrew, because it supports more libraries, notably GNU TLS for encrypted network connections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all:  Use &lt;code&gt;brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick&lt;/code&gt; :).&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditDate="2016-12-17T01:37:08.660" LastActivityDate="2016-12-17T01:37:08.660" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="275" PostTypeId="1" CreationDate="2014-09-25T20:55:37.437" Score="19" ViewCount="5025" Body="&lt;p&gt;I would like to create a function that does a &quot;quick view&quot; of a file the is under point in dired.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way that I would like for this to work is that I hold down a function key, which then makes the file visible in a buffer, but when I let off of the key, the buffer closes and the dired buffer returns.  &lt;em&gt;I do not want to have to close the temporary buffer with&lt;/em&gt; &lt;code&gt;C-x k&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make this functionality in Emacs?  It seems possible if I can bind functions to keypress / depress.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="105" LastEditDate="2015-05-14T00:34:11.527" LastActivityDate="2023-05-11T23:05:54.503" Title="Dired &quot;quick-view&quot; key to preview the file at point" Tags="|key-bindings|dired|keymap|" AnswerCount="7" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="276" PostTypeId="2" ParentId="268" CreationDate="2014-09-25T21:01:35.447" Score="48" Body="&lt;p&gt;The way I think of it, some repos have more overhead involved with submitting packages than others; the repos with more overhead tend to have fewer packages. In order from most to least overhead:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://elpa.gnu.org/&quot;&gt;GNU ELPA&lt;/a&gt; requires all code to be GPL'd and copyright assigned to the FSF. ELPA code is essentially &quot;owned&quot; by the core Emacs team, so there's much less of it than with other repos. (org-mode has its own repo, but it has the same mode of operation.) &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://marmalade-repo.org/&quot;&gt;Marmalade&lt;/a&gt; requires all code to have a GPL-compatible license and all packages are manually uploaded. Ownership is a little unspecified, and changing ownership doesn't have a set process AFAIK.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://melpa-stable.milkbox.net/&quot;&gt;MELPA Stable&lt;/a&gt; is more or less in direct competition with Marmalade, except it has no license restrictions and automatically builds packages from git repos using the latest tagged revision. Ownership is determined through the &lt;a href=&quot;https://github.com/milkypostman/melpa&quot;&gt;MELPA repo&lt;/a&gt; (ownership changes occur through pull request).&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://melpa.milkbox.net/#/&quot;&gt;MELPA&lt;/a&gt; is like MELPA stable except it always pulls from the latest revision on the master branch of a git repo. The packages tend to be &quot;bleeding-edge&quot;, and it can be a bit of a free-for-all stability-wise (which has pros and cons).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Personally I think either MELPA Stable or Marmalade will probably win out in the long run for most users—MELPA proper is pretty unstable and ELPA is too restrictive to be really scalable for lots of packages. But that's just an opinion.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-09-26T23:16:03.517" LastActivityDate="2014-09-26T23:16:03.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="277" PostTypeId="2" ParentId="275" CreationDate="2014-09-25T21:35:48.027" Score="9" Body="&lt;p&gt;As pointed in comments, functions are bound to keys, not events. But to take a step back, I'm not sure I understand why it's important for you to keep the key down while you're (presumably) reading the content of the file. It would also be incompatible with basic (and reasonable) actions like scrolling to get more of it. Not to mention the fact that if it takes a while, it might get uncomfortable :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about &lt;em&gt;repeating&lt;/em&gt; a key instead ? Something like the following could be the basic skeleton of a functional equivalent:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-dired-view-file ()&#xA;  (interactive)&#xA;  (dired-view-file)&#xA;  (local-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'View-quit))&#xA;&#xA;(define-key dired-mode-map (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'my-dired-view-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyway, I'm more challenging your use-case than answering your question at this point, as this has nothing to do with keypress/depress bindings :)&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="675" LastEditDate="2015-05-12T21:25:19.530" LastActivityDate="2015-05-12T21:25:19.530" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="278" PostTypeId="1" AcceptedAnswerId="280" CreationDate="2014-09-25T21:44:13.833" Score="72" ViewCount="83126" Body="&lt;p&gt;I know how to display line numbers (and columns) in the mode-line, but I'd like emacs to display the line numbers for all the lines on the left-hand side. I've seen this done in vim and other text editors. How do I do this for emacs?&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="50" LastEditDate="2014-10-08T18:18:43.670" LastActivityDate="2023-11-11T17:34:45.203" Title="How do I display line numbers in emacs (not in the mode line)?" Tags="|line-numbers|linum-mode|" AnswerCount="9" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="279" PostTypeId="2" ParentId="278" CreationDate="2014-09-25T21:45:16.570" Score="22" Body="&lt;p&gt;&lt;code&gt;M-x linum-mode&lt;/code&gt; will do the trick.  If you wish to effect this for all buffers, then &lt;code&gt;M-x global-linum-mode&lt;/code&gt; will do this.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2014-09-25T22:22:34.793" LastActivityDate="2014-09-25T22:22:34.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="280" PostTypeId="2" ParentId="278" CreationDate="2014-09-25T22:01:36.943" Score="98" Body="&lt;p&gt;For Emacs version &amp;gt;= 26 you should use &lt;code&gt;display-line-numbers-mode&lt;/code&gt; or &lt;code&gt;global-display-line-numbers-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can run the command with &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;display-line-numbers-mode&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; or &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;global-display-line-numbers-mode&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; to try it.&lt;/p&gt;&#xA;&lt;p&gt;Another good idea is to use &lt;code&gt;(add-hook 'prog-mode-hook 'display-line-numbers-mode)&lt;/code&gt; in your init.el to automatically enable that mode in all programming modes.&lt;/p&gt;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/LineNumbers&quot; rel=&quot;noreferrer&quot;&gt;EmacsWiki&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="43" LastEditorUserId="2506" LastEditDate="2021-05-19T04:03:51.250" LastActivityDate="2021-05-19T04:03:51.250" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="281" PostTypeId="1" CreationDate="2014-09-25T22:08:55.513" Score="108" ViewCount="44440" Body="&lt;p&gt;People occasionally post screenshots with modelines that have solid colors and triangles:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/1UJJu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I replicate this effect?&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="253" LastEditDate="2015-02-25T19:30:59.960" LastActivityDate="2018-12-05T21:39:00.877" Title="How do I get a fancier mode line that uses solid colors and triangles?" Tags="|mode-line|powerline|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="282" PostTypeId="2" ParentId="281" CreationDate="2014-09-25T22:10:37.000" Score="48" Body="&lt;p&gt;This can be achieved with a package called &quot;powerline&quot;. There are several variants available, including at least one you can install through &lt;code&gt;package.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I use &lt;a href=&quot;https://github.com/jonathanchu/emacs-powerline&quot; rel=&quot;noreferrer&quot;&gt;this one&lt;/a&gt;. Here's a screenshot from the package's README:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://camo.githubusercontent.com/67e5e0dfde850c3bcfec20537f4d184e74e5f28d/687474703a2f2f692e696d6775722e636f6d2f43454352632e706e67&quot; alt=&quot;A powerline example.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can configure the color by setting the face of the mode-line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'mode-line nil&#xA;                    :foreground &quot;Black&quot;&#xA;                    :background &quot;DarkOrange&quot;&#xA;                    :box nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also configure different shapes, rather than just triangles:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq powerline-arrow-shape 'curve)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cbnwh.png&quot; alt=&quot;Emacs powerline with curves instead of arrows.&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2014-09-25T22:17:35.880" LastActivityDate="2014-09-25T22:17:35.880" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="283" PostTypeId="1" CreationDate="2014-09-25T22:16:49.260" Score="40" ViewCount="16486" Body="&lt;p&gt;Let's say I have a function that looks like the following (as is often the case&#xA;when printing elisp output).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-example-function () (let ((a (do-something)) (b (do-something))) (setq someone me) (with-current-buffer b (do-that (or this (and that those))) (format &quot;%s&quot; a))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I would like a command that can turn that into something a human would write, such as the following.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-example-function ()&#xA;  (let ((a (do-something))&#xA;        (b (do-something)))&#xA;    (setq someone me)&#xA;    (with-current-buffer b&#xA;      (do-that (or this (and that those)))&#xA;      (format &quot;%s&quot; a))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I understand that there's more than one way to format a piece of elisp&#xA;code&lt;/strong&gt;, and different human beings do it differently. Furthermore, I understand it's somewhat subjective. But it should be&#xA;fairly easy to come up with a set of rules that results in code that&#xA;is at least decent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I actually tought of doing this myself a while ago, but I figured it's&#xA;better to ask before I reinvent the wheel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note, I'm aware of the &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/pp&quot; rel=&quot;noreferrer&quot;&gt;pp&lt;/a&gt; function, but it doesn't quite get there:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-example-function nil&#xA;  (let&#xA;      ((a&#xA;        (do-something))&#xA;       (b&#xA;        (do-something)))&#xA;    (setq someone me)&#xA;    (with-current-buffer b&#xA;      (do-that&#xA;       (or this&#xA;           (and that those)))&#xA;      (format &quot;%s&quot; a))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="2487" LastEditDate="2015-08-27T07:09:37.377" LastActivityDate="2023-05-20T07:27:03.563" Title="Command that formats (prettifies) Elisp code" Tags="|elisp|formatting|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="284" PostTypeId="2" ParentId="275" CreationDate="2014-09-25T22:26:47.187" Score="2" Body="&lt;p&gt;From a dired buffer, &lt;kbd&gt;v&lt;/kbd&gt; will visit a file in view-only mode, and &lt;kbd&gt;q&lt;/kbd&gt; will quit view mode and take you back to the dired buffer.  This is a quick way to preview a file, and it gives the possibility of scrolling and even searching the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think that emacs has the ability to pass along any low-level keypress messages it receives from the operating system. This may be partly for historical reasons. The terminals available to hackers (read &quot;programmers&quot;) at the time that emacs was being developed back in the 1970s-1980s did not work with real-time key up/down events, but rather a simple input of characters and escape sequences. To this day emacs can still operate impressively well in the confines of a simple terminal or SSH session using only simple ASCII characters and escape sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is not to say that the functionality has not grown significantly over the years to include features such as menus, multiple frame management, and mouse interaction.  There is no reason (that I am aware) that emacs could not be altered (at its core) to make low-level key messages available to extensions, but I wouldn't hold your breath.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;strong&gt;Disclaimer:&lt;/strong&gt; This post should be taken as opinion and speculation, rather than hard fact.)&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-09-25T23:12:32.827" LastActivityDate="2014-09-25T23:12:32.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="285" PostTypeId="2" ParentId="283" CreationDate="2014-09-25T22:52:04.963" Score="16" Body="&lt;p&gt;As others have suggested in comments, &quot;formatting&quot; can mean different things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;em&gt;indentation&lt;/em&gt; that is pretty conventional, try using &lt;code&gt;C-M-q&lt;/code&gt; (command &lt;code&gt;indent-pp-sexp&lt;/code&gt; in Lisp modes) with the cursor somewhere inside the top-level sexp that you want to re-indent (e.g. the &lt;code&gt;defun&lt;/code&gt; sexp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No, this is not &quot;automatic&quot; indentation, but it can become a habit to use it. ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For things other than indentation you will need to either do it manually or roll your own &quot;formatting&quot; command(s) or find some existing such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the Emacs manual, node Multi-line Indent and the Elisp manual, node &lt;code&gt;Mode-Specific Indent&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-25T22:52:04.963" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="286" PostTypeId="2" ParentId="64" CreationDate="2014-09-25T22:59:45.570" Score="8" Body="&lt;p&gt;Here is another option. This one is let's you customize the regular&#xA;expressions on a per-include basis. It should fit better with some&#xA;workflows as you're not limited to extension-based definitions.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;To Use&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Do something like the following in your org-file. (The &lt;code&gt;:lines&lt;/code&gt; keyword is optional)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: &quot;code/my-class.sv&quot; :src systemverilog :range-begin &quot;^class&quot; :range-end &quot;^endclass&quot; :lines &quot;14-80&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function will visit &quot;my-class.sv&quot; and search for those two&#xA;regexps, and then it will update the &lt;code&gt;:lines&lt;/code&gt; keyword according with&#xA;the match result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;:range-begin&lt;/code&gt; is missing, the range will be &quot;-80&quot;.&lt;br&gt;&#xA;If &lt;code&gt;:range-end&lt;/code&gt; is missing, the range will be &quot;14-&quot;.  &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Code&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'before-save-hook #'endless/update-includes)&#xA;&#xA;(defun endless/update-includes (&amp;amp;rest ignore)&#xA;  &quot;Update the line numbers of #+INCLUDE:s in current buffer.&#xA;Only looks at INCLUDEs that have either :range-begin or :range-end.&#xA;This function does nothing if not in org-mode, so you can safely&#xA;add it to `before-save-hook'.&quot;&#xA;  (interactive)&#xA;  (when (derived-mode-p 'org-mode)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (search-forward-regexp&#xA;              &quot;^\\s-*#\\+INCLUDE: *\&quot;\\([^\&quot;]+\\)\&quot;.*:range-\\(begin\\|end\\)&quot;&#xA;              nil 'noerror)&#xA;        (let* ((file (expand-file-name (match-string-no-properties 1)))&#xA;               lines begin end)&#xA;          (forward-line 0)&#xA;          (when (looking-at &quot;^.*:range-begin *\&quot;\\([^\&quot;]+\\)\&quot;&quot;)&#xA;            (setq begin (match-string-no-properties 1)))&#xA;          (when (looking-at &quot;^.*:range-end *\&quot;\\([^\&quot;]+\\)\&quot;&quot;)&#xA;            (setq end (match-string-no-properties 1)))&#xA;          (setq lines (endless/decide-line-range file begin end))&#xA;          (when lines&#xA;            (if (looking-at &quot;.*:lines *\&quot;\\([-0-9]+\\)\&quot;&quot;)&#xA;                (replace-match lines :fixedcase :literal nil 1)&#xA;              (goto-char (line-end-position))&#xA;              (insert &quot; :lines \&quot;&quot; lines &quot;\&quot;&quot;))))))))&#xA;&#xA;(defun endless/decide-line-range (file begin end)&#xA;  &quot;Visit FILE and decide which lines to include.&#xA;BEGIN and END are regexps which define the line range to use.&quot;&#xA;  (let (l r)&#xA;    (save-match-data&#xA;      (with-temp-buffer&#xA;        (insert-file file)&#xA;        (goto-char (point-min))&#xA;        (if (null begin)&#xA;            (setq l &quot;&quot;)&#xA;          (search-forward-regexp begin)&#xA;          (setq l (line-number-at-pos (match-beginning 0))))&#xA;        (if (null end)&#xA;            (setq r &quot;&quot;)&#xA;          (search-forward-regexp end)&#xA;          (setq r (1+ (line-number-at-pos (match-end 0)))))&#xA;        (format &quot;%s-%s&quot; l r)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-25T22:59:45.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="287" PostTypeId="2" ParentId="275" CreationDate="2014-09-25T23:12:58.237" Score="2" Body="&lt;p&gt;Another possibility, if you use a mouse, is to put the preview you want in a &lt;strong&gt;tooltip&lt;/strong&gt;. Then, when you move the mouse over a file name (with property &lt;code&gt;help-echo&lt;/code&gt;) the preview will pop up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this technique in &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;, for example, to (optionally) show previews of the images associated with image files, when you mouseover the file names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see the effect of this by doing this after loading &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Ensure that &lt;code&gt;tooltip-mode&lt;/code&gt; is turned on: &lt;code&gt;(tooltip-mode 1)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ensure that option &lt;code&gt;diredp-image-preview-in-tooltip&lt;/code&gt; has a non-&lt;code&gt;nil&lt;/code&gt; value (either the thumbnail size or &lt;code&gt;full&lt;/code&gt; for a full-size image).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Place the mouse pointer over an image-file name in Dired.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can use the code in of function &lt;code&gt;diredp-mouseover-help&lt;/code&gt; as inspiration for doing what you want (display your &quot;quick view&quot; on mouseover).  See the calls of that function for how to use it.  Here is one such call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-text-properties (line-beginning-position) (line-end-position)&#xA;                      '(mouse-face highlight help-echo diredp-mouseover-help))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-25T23:12:58.237" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="288" PostTypeId="1" AcceptedAnswerId="289" CreationDate="2014-09-26T00:03:48.967" Score="30" ViewCount="7953" Body="&lt;p&gt;Is there a way to reflect the navigation commands in the current window in another visible window. I have two related LaTeX files displayed in two windows and would like to scroll through them simultaneously to get an overview of the differences. I currently use a macro to automate scrolling in one buffer, moving to the other window, and scrolling and then moving back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ediff has an inbuilt way of doing this in &lt;code&gt;ediff-scroll-vertically&lt;/code&gt; bound to &lt;code&gt;v&lt;/code&gt; , so I was wondering if emacs already has one built in. Ideally I would like a minor mode that mirrors navigation in all visible windows.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="330" LastEditDate="2014-09-26T23:25:27.177" LastActivityDate="2014-09-26T23:25:27.177" Title="Synchronized scrolling in two windows" Tags="|window|scrolling|navigation|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="289" PostTypeId="2" ParentId="288" CreationDate="2014-09-26T00:06:47.603" Score="36" Body="&lt;p&gt;&lt;code&gt;M-x scroll-all-mode&lt;/code&gt; does exactly that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also refer to the &lt;a href=&quot;http://www.emacswiki.org/emacs/ScrollAllMode&quot;&gt;emacs wiki&lt;/a&gt; on &lt;code&gt;scroll-all-mode&lt;/code&gt; and how to make synchronized scrolling work with mouse scrolling. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-09-26T00:16:29.413" LastActivityDate="2014-09-26T00:16:29.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="290" PostTypeId="1" AcceptedAnswerId="291" CreationDate="2014-09-26T00:08:13.440" Score="13" ViewCount="8446" Body="&lt;p&gt;I am already in TeX-PDF-mode. When C-c C-c and type in pdflatex, it doesn't run. How can I run pdflatex in TeX-PDF-mode? Note: I don't change my emacs configuration file. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="108" LastEditDate="2014-09-26T00:48:47.357" LastActivityDate="2014-09-26T18:29:43.850" Title="How to call pdflatex under TeX-PDF-mode?" Tags="|auctex|tex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="291" PostTypeId="2" ParentId="290" CreationDate="2014-09-26T00:16:50.433" Score="16" Body="&lt;p&gt;Just type &lt;code&gt;latex&lt;/code&gt; instead of &lt;code&gt;pdflatex&lt;/code&gt; at the &lt;code&gt;C-c C-c&lt;/code&gt; prompt. &lt;code&gt;TeX-PDF-mode&lt;/code&gt; sets the TeX-engine to pdflatex automatically. The command you are entering at the prompt is only representative of what you want emacs to do i.e compile with &lt;code&gt;latex&lt;/code&gt;, view the pdf file with &lt;code&gt;view&lt;/code&gt; and so on. The actual commands the prompt can accept is given in the variable &lt;code&gt;TeX-command-list&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same works for any other engine say xetex. You set &lt;code&gt;TeX-engine&lt;/code&gt; to xetex and call &lt;code&gt;latex&lt;/code&gt; at the &lt;code&gt;C-c C-c&lt;/code&gt; prompt.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-26T00:16:50.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="292" PostTypeId="1" CreationDate="2014-09-26T00:28:45.167" Score="3" ViewCount="92" Body="&lt;p&gt;In Ubuntu, AucTeX has an addon called catdvi. What is its use by AucTeX? Some other questions I have include:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I invoke catdvi in my gnome-terminal? &lt;code&gt;C-c C-c&lt;/code&gt; will invoke a GUI viewer. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For TeX-PDF-mode, what command to view pdf files in terminal?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="120" LastEditorUserId="105" LastEditDate="2014-10-23T23:39:12.173" LastActivityDate="2014-10-23T23:39:12.173" Title="What is catdvi used for in AucTeX?" Tags="|auctex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="293" PostTypeId="1" AcceptedAnswerId="298" CreationDate="2014-09-26T00:39:43.443" Score="70" ViewCount="6586" Body="&lt;p&gt;Like many people, I manage a lot of my dotfiles via a version control repository (Mercurial on Bitbucket, private, in my case). This is handy when setting up a new machine or propagating configurations among different machines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So naturally I added my &lt;code&gt;.emacs&lt;/code&gt; and &lt;code&gt;.emacs.d&lt;/code&gt; to this setup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I installed some packages, and ended up adding &lt;code&gt;*.elc&lt;/code&gt; to my &lt;code&gt;.hgignore&lt;/code&gt;, just like I omit &lt;code&gt;*.pyc&lt;/code&gt; files from my Python repos. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there other things I shouldn't be tracking, e.g. generated files that are environment specific and won't be useful/correct when cloned to another platform? (I use Linux and OS X on the desktop, and FreeBSD on the server.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any setup tricks that are commonly used to make this kind of sharing more valuable? With my shell file setup I'm still looking for good ways to cherry-pick individual files across branches for example.&lt;/p&gt;&#xA;" OwnerUserId="322" LastEditorUserId="2223" LastEditDate="2015-05-24T15:57:14.370" LastActivityDate="2023-09-02T13:34:10.703" Title="What should/shouldn't I do when keeping .emacs and .emacs.d in version control?" Tags="|init-file|version-control|" AnswerCount="8" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="294" PostTypeId="2" ParentId="292" CreationDate="2014-09-26T00:40:47.673" Score="6" Body="&lt;p&gt;CatDVI translates a TeX Device Independent (DVI) file into a readable plaintext file. It aims to generate high-quality output that reproduces all aspects of the DVI file within the limits of the output medium. CatDVI uses Unicode internally and can output ASCII, ISO Latin 1 and UTF-8 Unicode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CatDVI can be used for previewing TeX documents on character-cell displays such as traditional terminals and terminal emulators. It is also possible to use it in generation of plain text documents from TeX source, assuming that the document is written with this conversion in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CatDVI is under development and as such yet incomplete. However, it is quite useful even in its current form and already outperforms some of its competition in some areas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CatDVI requires that the TFM files for all fonts used in its input DVI files are installed or can be generated by kpathsea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to invoke catdvi from the gnome-terminal, just type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;catdvi file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In many systems less uses lesspipe, which can handle pdftotext automatically. Therefore, you can immediately try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; less file.pdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will show the output of pdftotext in less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://archive.debian.net/lenny/tex/catdvi&quot;&gt;catdvi&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-09-26T01:00:48.277" LastActivityDate="2014-09-26T01:00:48.277" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="295" PostTypeId="2" ParentId="293" CreationDate="2014-09-26T00:57:37.073" Score="6" Body="&lt;p&gt;I have the following things in my .hgignore&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;emacs server file&lt;/li&gt;&#xA;&lt;li&gt;recentf file: File paths on one machine do not make sense on another&lt;/li&gt;&#xA;&lt;li&gt;elpa/melpa directory: Use init file to automatically install required packages and save pull/push times.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to share your init with others, you might consider removing any history files such as the one created by savehist mode. Apart from that I do not think there are any special tricks to this. Any guidelines you follow for versioning code projects work well here as well.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-26T00:57:37.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="296" PostTypeId="2" ParentId="275" CreationDate="2014-09-26T01:18:23.547" Score="9" Body="&lt;p&gt;Here is my super hacky way to simulate key down/up event binding by taking advantage of timers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall I would suggest going by Sigma's answer, but you asked for a way to close the preview by letting go so I'm obliged to try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically what you can do is bind some function that will be your &quot;keydown&quot; function to a keybinding and inside that action, start an idle timer that that executes a function that is your &quot;keyup&quot; function, as long as you are holding down the given keys, &quot;keydown&quot; function will fire over and over and this will inhibit the idle timers from running. Of course you need to compensate for the fact that the command will fire over and over, likely by rebinding the key to some sort of noop function in your &quot;keydown&quot; function, then rebinding the &quot;keydown&quot; function in the &quot;keyup&quot; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for your use case your &quot;keydown&quot; function will open up a preview buffer with the contents of the file at point and in that preview buffer bind the same key combo to some noop like command. You &quot;keydown&quot; function will also start an idle timer that will delete your preview buffer and restore you back where you were.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short here is the code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bind this function to a key combo (I used &lt;kbd&gt;C-M-v&lt;/kbd&gt;), when you press it down on top of a file name it will open a new buffer displaying the contents of the file at point, when you let go you will be switched back to the original buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq lexical-binding t)&#xA;&#xA;(defun quick-view-file-at-point ()&#xA;  &quot;Preview the file at point then jump back after some idle time.&#xA;&#xA;In order for this to work you need to bind this function to a key combo, &#xA;you cannot call it from the minibuffer and let it work.&#xA;&#xA;The reason it works is that by holding the key combo down, you inhibit&#xA;idle timers from running so as long as you hold the key combo, the &#xA;buffer preview will still display.&quot;&#xA;  (interactive)&#xA;  (let* ((buffer (current-buffer))&#xA;         (file (thing-at-point 'filename t))&#xA;         (file-buffer-name (format &quot;*preview of %s*&quot; file)))&#xA;    (if (and file (file-exists-p file))&#xA;        (let ((contents))&#xA;          (if (get-buffer file)&#xA;              (setq contents (save-excursion&#xA;                               (with-current-buffer (get-buffer file)&#xA;                                 (font-lock-fontify-buffer)&#xA;                                 (buffer-substring (point-min) (point-max)))))&#xA;            (let ((new-buffer (find-file-noselect file)))&#xA;              (with-current-buffer new-buffer&#xA;                (font-lock-mode t)&#xA;                (font-lock-fontify-buffer)&#xA;                (setq contents (buffer-substring (point-min) (point-max))))&#xA;              (kill-buffer new-buffer)))&#xA;          (switch-to-buffer (get-buffer-create file-buffer-name))&#xA;          (setq-local header-line-format &quot;%60b&quot;)&#xA;          (delete-region (point-min) (point-max))&#xA;          (save-excursion (insert contents))&#xA;          (local-set-key (kbd &quot;C-M-v&quot;) (lambda () (interactive) (sit-for .2)))&#xA;          (run-with-idle-timer&#xA;           .7 &#xA;           nil&#xA;           (lambda ()&#xA;             (switch-to-buffer buffer)&#xA;             (kill-buffer file-buffer-name))))&#xA;      (message &quot;no file to preview at point!&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also here is a gif of it in action, all I do is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;place my cursor over the file&lt;/li&gt;&#xA;&lt;li&gt;press and hold my keybinding&lt;/li&gt;&#xA;&lt;li&gt;the preview is displayed&lt;/li&gt;&#xA;&lt;li&gt;when I let go, the preview is killed and you're back where you were.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7GYKA.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;One important thing to note is the idle timer's seconds, in my code I used &lt;code&gt;.7&lt;/code&gt; but it's kind of a magic number, you want to keep it really small, but if you see the preview flashing twice try raising it 1/10th a second each time until your find the right spot for your machine.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*Also note that in the function I try to do some fontification of the preview buffer but I couldn't get it to work, that'll be the next step in making it more useful.**&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="675" LastEditDate="2015-05-12T21:25:47.643" LastActivityDate="2015-05-12T21:25:47.643" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="297" PostTypeId="2" ParentId="293" CreationDate="2014-09-26T02:07:37.937" Score="1" Body="&lt;p&gt;It depends on which packages/features you use, so it can get tricky. Beside the files mentioned by Vamsi, for example, if you use dired-immage, it creates a directory there to cache thumbnails. You probable want to ignore .elc files too.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-09-26T02:07:37.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="298" PostTypeId="2" ParentId="293" CreationDate="2014-09-26T02:16:44.300" Score="40" Body="&lt;p&gt;I store my Emacs configuration in GitHub because I use two different computers, one at work, one at home.&lt;/p&gt;&#xA;&lt;p&gt;Here is a list about things that I don't put into source control:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Environment specified setups.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;For example, my Emacs open different org file on start-up at different machine. You don't want to commit these settings into source control.&lt;/p&gt;&#xA;&lt;p&gt;I use &lt;code&gt;(require 'local nil t)&lt;/code&gt; to load these settings, but never commit &lt;code&gt;local.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Packages that managed by package manager&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;When packages are managed by package manager, I suggest not to put those packages into source control. Because :&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You have to commit after every update.&lt;/li&gt;&#xA;&lt;li&gt;You can miss important file that store somewhere else, which make you unable to synchronize across different computer properly.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Instead of commit packages, I suggest you commit the &lt;strong&gt;mechanism&lt;/strong&gt; which recognized by your package manager.&lt;/p&gt;&#xA;&lt;p&gt;For example, I use &lt;a href=&quot;https://github.com/cask/cask&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cask&lt;/a&gt; to manage my 3rd packages, so I only commit the cask file, which contains specified packages I want.&lt;/p&gt;&#xA;&lt;p&gt;When I use &lt;code&gt;package.el&lt;/code&gt; before, my configuration will check whether package is installed/need to updated, so no package is committed.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;However&lt;/strong&gt;, there are some packages that does not exist in any package repository, in this case, I will commit it to the source control, such as in &lt;code&gt;site-lisp&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;All the files generated by packages&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;For example, all the autosave, backup files, &lt;code&gt;tramp&lt;/code&gt;, &lt;code&gt;eshell&lt;/code&gt;, &lt;code&gt;recentf&lt;/code&gt;, even &lt;code&gt;custom.el&lt;/code&gt;. I put these files into &lt;code&gt;~/.emacs/.gen&lt;/code&gt;, so I can just ignore this directory.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Files that change frequently but required to be synchronized&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Such as personal dictionary file used by &lt;code&gt;aspell&lt;/code&gt;, file database used by &lt;code&gt;elfeed&lt;/code&gt;, In these case, I use Dropbox to synchronized it across different computers. So I won't forget to commit.&lt;/p&gt;&#xA;" OwnerUserId="165" LastEditorUserId="39388" LastEditDate="2023-09-02T13:34:10.703" LastActivityDate="2023-09-02T13:34:10.703" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="299" PostTypeId="1" AcceptedAnswerId="300" CreationDate="2014-09-26T02:21:36.907" Score="26" ViewCount="7383" Body="&lt;p&gt;I have defined some functions to run async background process using &lt;code&gt;async-shell-command&lt;/code&gt; in my .emacs, but everytime I run the commands a new window (not frame) is created and the process' buffer is shown there. How could I run the command without the &quot;pop up&quot; buffer?&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="330" LastEditDate="2014-09-26T23:25:40.737" LastActivityDate="2022-08-16T08:51:51.900" Title="How can I run an async process in the background without popping up a buffer?" Tags="|shell|async|process|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="300" PostTypeId="2" ParentId="299" CreationDate="2014-09-26T02:48:59.957" Score="22" Body="&lt;p&gt;You can start background processes with &lt;code&gt;start-process&lt;/code&gt;, which shouldn't pop up a buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(start-process &quot;process-name&quot; &quot;buffer-name&quot; &quot;program&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Process names are modified to avoid duplication as necessary, so don't worry about that. Just give it a name useful for debugging in the future!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you give a &lt;code&gt;&quot;buffer-name&quot;&lt;/code&gt;, a buffer will be created but not shown immediately. This can be convenient for managing processes and looking at output. If you don't want a buffer to be created at all, pass &lt;code&gt;nil&lt;/code&gt; as the buffer name:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(start-process &quot;process-name&quot; nil &quot;program&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17" LastEditorUserId="675" LastEditDate="2015-05-12T21:43:39.680" LastActivityDate="2015-05-12T21:43:39.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="301" PostTypeId="1" AcceptedAnswerId="305" CreationDate="2014-09-26T05:06:09.730" Score="47" ViewCount="3650" Body="&lt;p&gt;How is the source code of GNU Emacs organized? What are the main modules and their functionality?  Where can I find an official, up-to-date description of the architecture and its source code?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2014-11-27T20:48:26.543" LastActivityDate="2015-11-15T08:54:47.907" Title="How is the GNU Emacs source code organized?" Tags="|emacs-development|emacs-internals|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="302" PostTypeId="2" ParentId="293" CreationDate="2014-09-26T07:27:32.220" Score="8" Body="&lt;p&gt;Just make sure no generated stuff (like @rangi-lin notes) is in the repo and, if you're sharing your dotfiles with others, no related security stuff (like passwords and API keys).  For the later I've split my customizations into a separate file with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-file (concat dotfiles-dir &quot;custom.el&quot;))&#xA;(load custom-file 'noerror)&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Occasionally I move &quot;safe&quot; customizations to a big &lt;code&gt;setq&lt;/code&gt; statement before the snippet above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My .gitignore file looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/.org-id-locations&#xA;/ac-comphist.dat&#xA;/auto-save-list&#xA;/custom.el&#xA;/elpa/*&#xA;/image-dired/&#xA;/oauth2.plstore&#xA;/session.*&#xA;/tramp&#xA;/url/&#xA;/var/&#xA;*.elc&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="205" LastActivityDate="2014-09-26T07:27:32.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="303" PostTypeId="1" AcceptedAnswerId="310" CreationDate="2014-09-26T07:44:43.870" Score="19" ViewCount="1483" Body="&lt;p&gt;I like using a combination of &lt;code&gt;describe-face&lt;/code&gt; and &lt;code&gt;customize-face&lt;/code&gt; to adjust the appearance of my working environment.  Sometime this workflow fails when I want to change the face of a location I can not reach with the cursor; mode-line, header-line, magit-blame headers etc.  Most of the time, I can trail and error my way to a solution but sometimes I get stuck (I didn't know the header-line existed until yesterday for instance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a convenient way to describe the face of a location in a frame which is not reachable by the cursor?  By means of a mouse for instance.&lt;/p&gt;&#xA;" OwnerUserId="205" LastEditorUserId="25" LastEditDate="2014-09-27T00:33:18.103" LastActivityDate="2017-09-12T04:24:19.997" Title="describe-face character not under / unreachable by the cursor" Tags="|themes|customize|faces|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="305" PostTypeId="2" ParentId="301" CreationDate="2014-09-26T09:07:22.870" Score="48" Body="&lt;p&gt;Being an official GNU project it adheres closely to the GNU coding standards and directory layout. That said, if you are exploring the source tree I would start, as with most projects, with the &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/README&quot; rel=&quot;noreferrer&quot;&gt;README&lt;/a&gt; file in the root directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that file onwards, there are several sub-directories:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`src'       holds the C code for Emacs (the Emacs Lisp interpreter and&#xA;            its primitives, the redisplay code, and some basic editing&#xA;            functions).&#xA;`lisp'      holds the Emacs Lisp code for Emacs (almost everything else).&#xA;`leim'      holds the library of Emacs input methods, Lisp code and&#xA;            auxiliary data files required to type international characters&#xA;            which can't be directly produced by your keyboard.&#xA;`lib-src'   holds the source code for some utility programs for use by or&#xA;            with Emacs, like movemail and etags.&#xA;`etc'       holds miscellaneous architecture-independent data files&#xA;            Emacs uses, like the tutorial text and the Zippy, the Pinhead&#xA;            quote database. The contents of the `lisp', `leim', `info',&#xA;            `man', `lispref', and `lispintro' subdirectories are&#xA;            architecture-independent too.&#xA;`info'      holds the Info documentation tree for Emacs.&#xA;`doc/emacs' holds the source code for the Emacs Manual.  If you modify the&#xA;            manual sources, you will need the `makeinfo' program to produce&#xA;            an updated manual. `makeinfo' is part of the GNU Texinfo&#xA;            package; you need version 4.6 or later of Texinfo.&#xA;`doc/lispref'   holds the source code for the Emacs Lisp reference manual.&#xA;`doc/lispintro' holds the source code for the Introduction to Programming&#xA;                in Emacs Lisp manual.&#xA;`msdos'     holds configuration files for compiling Emacs under MS-DOS.&#xA;`nt'        holds various command files and documentation files that pertain&#xA;            to building and running Emacs on Windows 9X/ME/NT/2000/XP.&#xA;`test'      holds tests for various aspects of Emacs's functionality.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastEditorUserId="4025" LastEditDate="2015-11-15T08:54:47.907" LastActivityDate="2015-11-15T08:54:47.907" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="306" PostTypeId="2" ParentId="281" CreationDate="2014-09-26T09:34:56.873" Score="91" Body="&lt;p&gt;This can be achieved with two packages:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line/&quot;&gt;smart-mode-line&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/jonathanchu/emacs-powerline&quot;&gt;powerline&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Overall, &lt;strong&gt;smart-mode-line&lt;/strong&gt; is more powerful than &lt;strong&gt;powerline&lt;/strong&gt;&#xA;(pardon the pun), in the sense that it offers more features to control&#xA;the mode-line's behaviour and more customizability in the appearance.&#xA;The Readme has a great&#xA;&lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line/#features&quot;&gt;list of features&lt;/a&gt;,&#xA;but in short it offers width-control, string replacement in the file&#xA;path, hiding of the minor modes, among other things.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If all you want is to achieve the screenshot, &lt;strong&gt;powerline&lt;/strong&gt; is the best choice.&lt;/li&gt;&#xA;&lt;li&gt;If you want a suite of other features combined with that, give &lt;strong&gt;smart-mode-line&lt;/strong&gt; a try.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since powerline has been very well explained on another answer, I'll&#xA;focus on how you can achieve that appearance with smart-mode-line.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;First Install&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can install smart-mode-line from Melpa, Melpa-Stable, or download&#xA;it manually. Assuming you decide to use the package manager, just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET smart-mode-line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you turn it on with &lt;code&gt;M-x sml/setup&lt;/code&gt;, your mode-line should look&#xA;similar to one of these two.&lt;br&gt;&#xA;&lt;img src=&quot;https://raw.github.com/Bruce-Connor/smart-mode-line/master/screenshot-2013-11-11-dark.png&quot; alt=&quot;Dark Theme Screenshot&quot;&gt;&#xA;&lt;img src=&quot;https://raw.github.com/Bruce-Connor/smart-mode-line/master/screenshot-2013-11-11-light.png&quot; alt=&quot;Light Theme Screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Powerline Theme&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;smart-mode-line&lt;/em&gt; has several themes built-in, the one that achieves&#xA; the requested appearance is provided separately in the &lt;code&gt;themes/&lt;/code&gt;&#xA; directory. &lt;em&gt;Note that this theme is still in beta, so customizing it&#xA; might not work perfectly just yet.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install the theme from Melpa &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET smart-mode-line-powerline-theme&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to install it manually, it's&#xA;&lt;a href=&quot;https://raw.githubusercontent.com/Bruce-Connor/smart-mode-line/master/themes/smart-mode-line-powerline-theme.el&quot;&gt;here&lt;/a&gt;,&#xA; but you'll also need to install powerline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally you can turn on the theme with &lt;code&gt;M-x sml/apply-theme RET powerline&lt;/code&gt;. And your mode-line should then look like this.&lt;br&gt;&#xA;&lt;img src=&quot;https://raw.github.com/Bruce-Connor/smart-mode-line/master/screenshot-powerline-theme.png&quot; alt=&quot;Powerline Theme Screenshot&quot;&gt;&lt;br&gt;&#xA;As you can see, the order of elements is not quite the same, but the&#xA;overall appearance is there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use this theme every-time, add the following to your init file. You&#xA;can also customize any of the powerline configuration variables, and&#xA;they should have the same effect here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; These two lines are just examples&#xA;(setq powerline-arrow-shape 'curve)&#xA;(setq powerline-default-separator-dir '(right . left))&#xA;;; These two lines you really need.&#xA;(setq sml/theme 'powerline)&#xA;(sml/setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-12-01T17:04:05.523" LastActivityDate="2014-12-01T17:04:05.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="308" PostTypeId="1" AcceptedAnswerId="309" CreationDate="2014-09-26T11:00:13.027" Score="7" ViewCount="375" Body="&lt;p&gt;I have a problem with &lt;code&gt;org-mode&lt;/code&gt;'s agenda view. While I've set &lt;code&gt;org-agenda-files&lt;/code&gt; to &lt;code&gt;'(&quot;~/org/&quot;)&lt;/code&gt; invariably when I finally spin up &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;org-agenda&lt;/code&gt; I find that &lt;code&gt;org-agenda-files&lt;/code&gt; just points to one org-file. Obviously something is deciding just to include the last org-file I viewed but I'm having trouble working out what. Is there any way to trap when this variable is changed and display or log some sort of backtrace?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="105" LastEditDate="2022-09-16T21:56:06.827" LastActivityDate="2022-09-16T21:56:06.827" Title="Tracking when variables get updated" Tags="|org-mode|org-agenda|variables|variable-watchers|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="309" PostTypeId="2" ParentId="308" CreationDate="2014-09-26T11:42:57.477" Score="6" Body="&lt;p&gt;In this situation, I find that the best way to figure out what's going&#xA;on into is to visit my &lt;code&gt;~/.emacs.d/&lt;/code&gt; and run &lt;code&gt;rgrep&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Searching your configs&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The following snippet, taken from here, makes sure that &lt;code&gt;rgrep&lt;/code&gt;&#xA;doesn't go into the &lt;code&gt;elpa/&lt;/code&gt; subdir (since you're sure to find dozens&#xA;of useless hits in there).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'grep&#xA;  '(progn&#xA;     (add-to-list 'grep-find-ignored-directories &quot;auto&quot;)&#xA;     (add-to-list 'grep-find-ignored-directories &quot;elpa&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I just run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x rgrep RET org-agenda-files RET *.el RET ~/.emacs.d/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will find any reference to &lt;code&gt;org-agenda-files&lt;/code&gt; in my&#xA;configuration. If it's a problem with my configs, this will find it.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Searching Elsewhere&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If the above doesn't find anything, it means there's an Elpa package&#xA;causing trouble. So I do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x rgrep RET org-agenda-files RET *.el RET ~/.emacs.d/elpa/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will usually yield &lt;strong&gt;a lot&lt;/strong&gt; of results, but there are ways to go&#xA;through them quickly. For instance, it's very unlikely that org-mode&#xA;itself is causing this problem. So it's safe to ignore all hits that&#xA;come from inside org-modes installation directory.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-26T11:42:57.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="310" PostTypeId="2" ParentId="303" CreationDate="2014-09-26T11:45:26.793" Score="13" Body="&lt;p&gt;I do not know about using the mouse, but I've often found it's easiest for me to run  &lt;code&gt;list-faces-display&lt;/code&gt; and then just i-search for what the face is likely called or visually scan for text that looks the same.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-09-26T11:45:26.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="311" PostTypeId="2" ParentId="303" CreationDate="2014-09-26T11:59:42.213" Score="10" Body="&lt;p&gt;There are 4 regions where text may be displayed in Emacs, here is what&#xA;you can do to inspect each of them.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The mode-line&lt;/strong&gt;: See the value of &lt;code&gt;mode-line-format&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The header-line&lt;/strong&gt;: See the value of &lt;code&gt;header-line-format&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Buffer&lt;/strong&gt;: If the face is in a region of the buffer you can't reach, see the value of &lt;code&gt;(buffer-string)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Minibuffer&lt;/strong&gt;: If point is currently in the minibuffer, you can do &lt;code&gt;M-: (buffer-string)&lt;/code&gt;, and that will describe the contents of the minibuffer.&#xA;You may need to &lt;code&gt;(setq enable-recursive-minibuffers to t)&lt;/code&gt; first.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Fringe or Margin&lt;/strong&gt;: None that I know of.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These methods will give you the entire contents of these regions, so&#xA;it may take some reading to actually find the face you're looking for,&#xA;but it will certainly be there. Most importantly, it will describe even regions you cannot reach.&lt;br&gt;&#xA;For instance, let's say I want to know&#xA;which face is used in the &lt;code&gt;find-file&lt;/code&gt; prompt.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Invoke find-file with &lt;code&gt;C-x C-f&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Describe the minibuffer with &lt;code&gt;M-: (buffer-string)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That will give something like the following output, and right there at&#xA;the end is the face I was looking for.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#(&quot;Find file: ~/&quot; 0 11 (front-sticky t rear-nonsticky t field t read-only t point-entered minibuffer-avoid-prompt face minibuffer-prompt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-26T22:56:59.453" LastActivityDate="2014-09-26T22:56:59.453" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="312" PostTypeId="2" ParentId="258" CreationDate="2014-09-26T12:05:05.457" Score="2" Body="&lt;p&gt;The value of &lt;code&gt;show-trailing-whitespace&lt;/code&gt; becomes buffer local when set so you can just set it in the relevant hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'diff-mode-hook (lambda () (setq show-trailing-whitespace nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To check the documentation for show-trailing-whitespace: &lt;code&gt;C-h v show-trailing-whitespace&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2014-09-26T12:05:05.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="313" PostTypeId="2" ParentId="308" CreationDate="2014-09-26T12:34:14.767" Score="2" Body="&lt;p&gt;Are you ever using &lt;kbd&gt;C-c [&lt;/kbd&gt; (&lt;code&gt;org-agenda-file-to-front&lt;/code&gt;) or &lt;kbd&gt;C-c ]&lt;/kbd&gt; (&lt;code&gt;org-remove-file&lt;/code&gt;) while in an &lt;code&gt;org&lt;/code&gt; file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These overwrite the current &lt;code&gt;org-agenda-files&lt;/code&gt; with a hardcoded list of files that will no longer use your defined &lt;code&gt;~/org/&lt;/code&gt; as a source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also if you are setting it to &lt;code&gt;~/org/&lt;/code&gt; please ensure that the agenda files you want are in that folder with &lt;code&gt;.org&lt;/code&gt; for the extension.  Otherwise they will not be detected.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-09-26T12:34:14.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="314" PostTypeId="1" AcceptedAnswerId="317" CreationDate="2014-09-26T12:55:38.457" Score="5" ViewCount="1118" Body="&lt;p&gt;Here is a super-short org mode file ready to export to pdf &lt;code&gt;C-c C-e l o&lt;/code&gt;. It is a sample file to demonstrate long tables and the issue I am facing with the auto generated index of tables by org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Testing out =longtable=&#xA;&#xA;# below gets rid of the red boxes drawn around the links&#xA;# `hyperref' package is already included in org-latex-default-packages-alist&#xA;#+LaTeX_HEADER: \hypersetup{&#xA;#+LaTeX_HEADER:     colorlinks,%&#xA;#+LaTeX_HEADER:     citecolor=black,%&#xA;#+LaTeX_HEADER:     filecolor=black,%&#xA;#+LaTeX_HEADER:     linkcolor=blue,%&#xA;#+LaTeX_HEADER:     urlcolor=blue&#xA;#+LaTeX_HEADER: }&#xA;&#xA;#+TOC: tables&#xA;&#xA;#+CAPTION: This is a long table&#xA;#+ATTR_LaTeX: :environment longtable&#xA;#+NAME: tab:longtable&#xA;|----------+----------|&#xA;| Header 1 | Header 2 |&#xA;|----------+----------|&#xA;|        1 | Item 1   |&#xA;|        2 | Item 2   |&#xA;|        3 | Item 3   |&#xA;|        4 | Item 4   |&#xA;|        5 | Item 5   |&#xA;|        6 | Item 6   |&#xA;|        7 | Item 7   |&#xA;|        8 | Item 8   |&#xA;|        9 | Item 9   |&#xA;|       10 | Item 10  |&#xA;|       11 | Item 11  |&#xA;|       12 | Item 12  |&#xA;|       13 | Item 13  |&#xA;|       14 | Item 14  |&#xA;|       15 | Item 15  |&#xA;|       16 | Item 16  |&#xA;|       17 | Item 17  |&#xA;|       18 | Item 18  |&#xA;|       19 | Item 19  |&#xA;|       20 | Item 20  |&#xA;|       21 | Item 21  |&#xA;|       22 | Item 22  |&#xA;|       23 | Item 23  |&#xA;|       24 | Item 24  |&#xA;|       25 | Item 25  |&#xA;|----------+----------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using latex specific attributes, I am specifying org-mode to use the &lt;code&gt;longtable&lt;/code&gt; latex package for creating that table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The table renders fine, but the issue is that for each page the long table spans, an extra entry is created in the TOC for tables. The below example is short, but if I have a table spanning 5 pages, 5 entries are created in the TOC with the same table title!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below screenshots show the 2 pdf pages:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Fam3t.png&quot; alt=&quot;Page 1&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/yYKqt.png&quot; alt=&quot;Page 2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make org-mode put only one TOC entry per table (and not per table per page)?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="25" LastEditDate="2014-09-27T00:51:45.357" LastActivityDate="2015-08-05T02:11:01.527" Title="TOC of tables for org-mode long tables" Tags="|org-mode|latex|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="315" PostTypeId="1" AcceptedAnswerId="316" CreationDate="2014-09-26T13:02:52.007" Score="12" ViewCount="2207" Body="&lt;p&gt;I would like to use &lt;a href=&quot;http://www.emacswiki.org/emacs/DeskTop&quot;&gt;DeskTop&lt;/a&gt; for basic project management, i.e. opening a set of buffers and restore histories depending on the project I am working on. Is this possible, i.e. having one desktop file in a project directory and how can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="225" LastEditorUserId="25" LastEditDate="2014-09-27T00:49:00.337" LastActivityDate="2020-10-19T20:33:29.120" Title="Using DeskTop for basic project management" Tags="|session|desktop|project|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="316" PostTypeId="2" ParentId="315" CreationDate="2014-09-26T13:20:02.643" Score="14" Body="&lt;p&gt;I needed to manage the desktop files just like you; have a separate desktop file for each project and save buffers, Emacs variables, etc independently for each.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to achieve that using a package called &lt;code&gt;bookmark+&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;bookmark+&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Library &lt;strong&gt;Bookmark+&lt;/strong&gt; manages different types of bookmarks, one of those is &lt;strong&gt;Desktop Bookmarks&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After installing the package,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to have &lt;code&gt;(require 'bookmark+)&lt;/code&gt; in your &lt;code&gt;init.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;To create a bookmark for each project, set up the buffers you'd like for each project and do &lt;code&gt;M-x bmkp-set-desktop-bookmark&lt;/code&gt; or &lt;kbd&gt;C-x p K&lt;/kbd&gt;. That will ask you where you want to save the desktop file and you can choose to save it in that project's folder.&lt;/li&gt;&#xA;&lt;li&gt;Once you have set the desktop bookmarks for all projects, you can jump to different bookmarks using &lt;code&gt;M-x bmkp-desktop-jump&lt;/code&gt; or &lt;kbd&gt;C-x j K&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bookmark+&lt;/a&gt; doc on Emacs Wiki is very informative if you want to learn more about this package.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;desktop.el&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;In addition to that, I have the following to set up the &lt;code&gt;desktop&lt;/code&gt; package where I can choose what all I want to save per desktop&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;&#xA;;; Source: https://github.com/purcell/emacs.d/blob/master/lisp/init-sessions.el&#xA;; save a bunch of variables to the desktop file&#xA;;; for lists specify the len of the maximal saved data also&#xA;(setq desktop-globals-to-save&#xA;      (append '((comint-input-ring . 50)&#xA;                (compile-history . 30)&#xA;                desktop-missing-file-warning&#xA;                (dired-regexp-history . 20)&#xA;                (extended-command-history . 30)&#xA;                (face-name-history . 20)&#xA;                (file-name-history . 100)&#xA;                (grep-find-history . 30)&#xA;                (grep-history . 30)&#xA;                (ido-buffer-history . 100)&#xA;                (ido-last-directory-list . 100)&#xA;                (ido-work-directory-list . 100)&#xA;                (ido-work-file-list . 100)&#xA;                (magit-read-rev-history . 50)&#xA;                (minibuffer-history . 50)&#xA;                (org-clock-history . 50)&#xA;                (org-refile-history . 50)&#xA;                (org-tags-history . 50)&#xA;                (query-replace-history . 60)&#xA;                (read-expression-history . 60)&#xA;                (regexp-history . 60)&#xA;                (regexp-search-ring . 20)&#xA;                register-alist&#xA;                (search-ring . 20)&#xA;                (shell-command-history . 50)&#xA;                tags-file-name&#xA;                tags-table-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Saving project-specific desktops when quitting emacs&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I find it useful to bind the below function to &lt;kbd&gt;C-x C-c&lt;/kbd&gt; so that the desktops get saved automatically when I quit emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun save-desktop-save-buffers-kill-emacs ()&#xA;  &quot;Save buffers and current desktop every time when quitting emacs.&quot;&#xA;  (interactive)&#xA;  (desktop-save-in-desktop-dir)&#xA;  (save-buffers-kill-emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At times, I wouldn't want to save the desktop when quitting emacs. For those occasions, I use this other function and have bound that to &lt;kbd&gt;C-x M-c&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Kill emacs when running in daemon mode or not&#xA;;; Source: http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00348.html&#xA;(defun tv-stop-emacs ()&#xA;  (interactive)&#xA;  (if (daemonp)&#xA;      (save-buffers-kill-emacs)&#xA;    (save-buffers-kill-terminal)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2020-01-26T18:15:38.483" LastActivityDate="2020-01-26T18:15:38.483" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="317" PostTypeId="2" ParentId="314" CreationDate="2014-09-26T14:40:03.523" Score="2" Body="&lt;p&gt;Interesting, that's almost equally a LaTeX question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://mirror.utexas.edu/ctan/macros/latex/required/tools/longtable.pdf&quot; rel=&quot;nofollow&quot;&gt;the longtable documentation&lt;/a&gt;, the correct way to discriminate the first chunk of the table is to use &lt;code&gt;\endfirsthead&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore you can get the effect you want by adding the following LaTeX attribute:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_LaTeX: :caption \caption{\label{tab:longtable}This is a long table}\\\hline Header 1 &amp;amp; Header 2\\\hline\endfirsthead&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course this forces you to handle the caption yourself, so you need to make sure that the &lt;code&gt;\label{}&lt;/code&gt; in that fragment keeps in sync with the org attribute &lt;code&gt;#+NAME&lt;/code&gt;. I guess a macro could help if that's an issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, we'd like the generated code look like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{longtable}{rl}&#xA;\\&#xA;\caption[]{This is a long table}\\&#xA;\hline&#xA;Header 1 &amp;amp; Header 2\\&#xA;\hline&#xA;\endhead&#xA;\caption{\label{tab:longtable}This is a long table}\\&#xA;\hline&#xA;Header 1 &amp;amp; Header 2\\&#xA;\hline&#xA;\endfirsthead&#xA;\hline\multicolumn{2}{r}{Continued on next page} \\&#xA;\endfoot&#xA;\endlastfoot&#xA;1 &amp;amp; Item 1\\&#xA;...&#xA;25 &amp;amp; Item 25\\&#xA;\hline&#xA;\end{longtable}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it appears the code to handle the table and caption (&lt;code&gt;org-latex--org-tabl&lt;/code&gt;) and the code to handle the rows (&lt;code&gt;org-latex-table-row&lt;/code&gt;) are sufficiently disjoint that it would require some significant refactoring to allow for that kind of code generation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I strongly suspect that it should be an option (if not the default) option to avoid multiplying entries in the list of tables. So maybe opening a bug report would be the best course of action&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-26T16:43:32.143" LastActivityDate="2014-09-26T16:43:32.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="318" PostTypeId="1" AcceptedAnswerId="320" CreationDate="2014-09-26T14:54:52.053" Score="16" ViewCount="2412" Body="&lt;p&gt;Say you have two buffers open like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;------------------------------------&#xA;            |                      |&#xA;  buffer 1  |        buffer 2      |       &#xA;            |                      |&#xA;------------------------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the fastest way to switch the buffers so that you get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;------------------------------------&#xA;           buffer 1                |&#xA;                                   |&#xA;------------------------------------&#xA;            buffer 2               |&#xA;                                   |&#xA;------------------------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="39" LastEditorUserId="50" LastEditDate="2014-09-26T22:25:08.217" LastActivityDate="2014-09-26T22:25:08.217" Title="Switch window split orientation, fastest way" Tags="|buffers|window|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="319" PostTypeId="1" AcceptedAnswerId="325" CreationDate="2014-09-26T14:58:03.813" Score="16" ViewCount="800" Body="&lt;p&gt;For most projects I work on I use a &lt;code&gt;before-save-hook&lt;/code&gt; to run &lt;code&gt;whitespace-cleanup&lt;/code&gt;.  This is fine when everybody on the team cleanups up their spaces but sometimes I am involved in already running projects were most files are littered with trailing white.  Currently I simply turn off my save-hook and add my share of spaces but ideally I want my diffs to be squeaky clean..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any packages out there which only cleanup whitespace on the lines I touched?&lt;/p&gt;&#xA;" OwnerUserId="205" LastActivityDate="2016-02-01T16:45:31.097" Title="Only doing whitespace-cleanup on the lines touched" Tags="|whitespace-mode|version-control|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="320" PostTypeId="2" ParentId="318" CreationDate="2014-09-26T15:08:25.243" Score="17" Body="&lt;p&gt;Here's a defun that would do what you are looking for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun toggle-window-split ()&#xA;  (interactive)&#xA;  (if (= (count-windows) 2)&#xA;      (let* ((this-win-buffer (window-buffer))&#xA;             (next-win-buffer (window-buffer (next-window)))&#xA;             (this-win-edges (window-edges (selected-window)))&#xA;             (next-win-edges (window-edges (next-window)))&#xA;             (this-win-2nd (not (and (&amp;lt;= (car this-win-edges)&#xA;                                         (car next-win-edges))&#xA;                                     (&amp;lt;= (cadr this-win-edges)&#xA;                                         (cadr next-win-edges)))))&#xA;             (splitter&#xA;              (if (= (car this-win-edges)&#xA;                     (car (window-edges (next-window))))&#xA;                  'split-window-horizontally&#xA;                'split-window-vertically)))&#xA;        (delete-other-windows)&#xA;        (let ((first-win (selected-window)))&#xA;          (funcall splitter)&#xA;          (if this-win-2nd (other-window 1))&#xA;          (set-window-buffer (selected-window) this-win-buffer)&#xA;          (set-window-buffer (next-window) next-win-buffer)&#xA;          (select-window first-win)&#xA;          (if this-win-2nd (other-window 1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Shamelessly copied from &lt;a href=&quot;https://github.com/magnars/.emacs.d/blob/master/defuns/buffer-defuns.el&quot;&gt;Magnars .emacs.d&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plus if you call it again, it will re-split your windows in the original vertical orientation.&lt;/p&gt;&#xA;" OwnerUserId="264" LastEditorUserId="264" LastEditDate="2014-09-26T17:55:19.153" LastActivityDate="2014-09-26T17:55:19.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="322" PostTypeId="2" ParentId="20" CreationDate="2014-09-26T15:22:35.167" Score="2" Body="&lt;p&gt;May I suggest to create an empty buffer? The interesting thing being that, you create the buffer first, and you save it after, if you really want to.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-empty-buffer () &#xA;  &quot;Open a new empty buffer.&quot;&#xA;  (interactive)&#xA;  (let ((buf (generate-new-buffer &quot;untitled&quot;)))&#xA;    (switch-to-buffer buf)&#xA;    (funcall (and initial-major-mode))&#xA;    (setq buffer-offer-save t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will have to set initial-major-mode to lisp in your init file and you should bind the my-empty-buffer to a shortcut like &lt;code&gt;C-n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_new_empty_buffer.html&quot; rel=&quot;nofollow&quot;&gt;ergoemacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-09-26T18:02:38.330" LastActivityDate="2014-09-26T18:02:38.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="323" PostTypeId="1" AcceptedAnswerId="326" CreationDate="2014-09-26T15:22:39.473" Score="9" ViewCount="1537" Body="&lt;p&gt;Is there a gdocs-mode or something I could use to edit Google Docs?&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="25" LastEditDate="2014-09-27T00:50:35.877" LastActivityDate="2014-09-27T00:50:35.877" Title="How can I edit Google Docs from Emacs?" Tags="|google-docs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="324" PostTypeId="2" ParentId="299" CreationDate="2014-09-26T15:24:00.630" Score="8" Body="&lt;p&gt;Like Tikhon mentioned, &lt;code&gt;(start-process)&lt;/code&gt; is the way to go. In case you don't want to create a buffer but would still like to react to the background process status, you can also employ &lt;code&gt;(set-process-sentinel)&lt;/code&gt;. Here's a modified example I'm taking from my &lt;a href=&quot;https://github.com/waymondo/projector.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;projector&lt;/code&gt;&lt;/a&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-process-sentinel (start-process &quot;process-name&quot; nil &quot;command&quot;) #'output-message-sentinel)&#xA;&#xA;(defun output-message-sentinel (process msg)&#xA;  (when (memq (process-status process) '(exit signal))&#xA;    (message (concat (process-name process) &quot; - &quot; msg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the Emacs function description:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-process-sentinel PROCESS SENTINEL)&#xA;&#xA;Give PROCESS the sentinel SENTINEL; nil for default.&#xA;The sentinel is called as a function when the process changes state.&#xA;It gets two arguments: the process, and a string describing the change.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Processes.html#Processes&quot; rel=&quot;nofollow&quot;&gt;GNU manual pages on Processes&lt;/a&gt; is pretty good for more info.&lt;/p&gt;&#xA;" OwnerUserId="264" LastEditorUserId="675" LastEditDate="2015-05-12T22:02:11.620" LastActivityDate="2015-05-12T22:02:11.620" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="325" PostTypeId="2" ParentId="319" CreationDate="2014-09-26T15:39:17.347" Score="15" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/lewang/ws-butler&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ws-butler&lt;/code&gt;&lt;/a&gt; package removes whitespace only from the touched lines. The package is available on Melpa.&lt;/p&gt;&#xA;&lt;p&gt;From that package's README on github:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Only lines touched get trimmed. If the white space at end of buffer is changed, then blank lines at the end of buffer are truncated respecting require-final-newline.&lt;/p&gt;&#xA;&lt;p&gt;Trimming only happens when saving.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-09-26T15:39:17.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="326" PostTypeId="2" ParentId="323" CreationDate="2014-09-26T16:06:13.490" Score="5" Body="&lt;p&gt;Emacs g-client is all that I've ever heard of, at one point it could edit google docs but last I've known it doesn't work any more, you can try it out yourself:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/emacspeak/source/browse/#svn%2Ftrunk%2Flisp%2Fg-client&quot; rel=&quot;noreferrer&quot;&gt;https://code.google.com/p/emacspeak/source/browse/#svn%2Ftrunk%2Flisp%2Fg-client&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-09-26T16:06:13.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="327" PostTypeId="1" AcceptedAnswerId="338" CreationDate="2014-09-26T16:29:08.307" Score="16" ViewCount="1551" Body="&lt;p&gt;Currently I work with ruby and rspec. I really like the idea of having a separate frame in another monitor showing me the compilation buffer. My current setup uses a 'code' frame (in which I do actual work) and a 'test-result' frame (in which I see rspec results)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that when I try to open some compilation error or file in the 'test-result' frame, the window splits in &lt;em&gt;that&lt;/em&gt; frame. What I would really like to do is for it to open in my 'code' frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already use the option &lt;code&gt;display-buffer-reuse-frames&lt;/code&gt;.&#xA;I also tried to set the compilation results window &lt;code&gt;dedicated&lt;/code&gt;, but whenever emacs try to open a new window, a new frame would be created (which is particularly awful if you use Helm.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some easy way to achieve this ?&lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2014-09-26T21:38:37.330" Title="How can I block a frame from being split?" Tags="|window|frames|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="328" PostTypeId="1" AcceptedAnswerId="337" CreationDate="2014-09-26T16:35:45.363" Score="9" ViewCount="2232" Body="&lt;p&gt;For some tasks like using ruby's &lt;code&gt;pry&lt;/code&gt; and &lt;code&gt;tmux&lt;/code&gt; both &lt;code&gt;eshell&lt;/code&gt; and &lt;code&gt;shell&lt;/code&gt; do not behave well. I tried to use &lt;code&gt;term&lt;/code&gt;, but my innability to override the keybindings in &lt;code&gt;term&lt;/code&gt; makes its use annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set, say, &lt;code&gt;M-o&lt;/code&gt; as &lt;code&gt;other-window&lt;/code&gt; and &lt;code&gt;M-k&lt;/code&gt; as &lt;code&gt;kill-buffer&lt;/code&gt; when using &lt;code&gt;term&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="25" LastEditDate="2014-09-27T01:03:59.987" LastActivityDate="2014-09-27T03:28:31.230" Title="How to override keybindings for `term`" Tags="|keymap|term|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="329" PostTypeId="1" AcceptedAnswerId="330" CreationDate="2014-09-26T17:29:15.780" Score="8" ViewCount="212" Body="&lt;p&gt;I know that I can look up help for a key sequence using &lt;code&gt;C-h k &amp;lt;key sequence&amp;gt;&lt;/code&gt;, but I use Emacs in the terminal, and my terminal emulator doesn't pass all key sequences through to Emacs. Sometimes I'll see the notation for a given key sequence written somewhere without explanation, and I want to look up what it does, but I can't even type it. Is there an equivalent to &lt;code&gt;C-h k&lt;/code&gt; where I can just type the key sequence (like literally &lt;code&gt;C-&amp;lt;character&amp;gt;&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="105" LastEditDate="2014-09-28T03:49:51.663" LastActivityDate="2014-09-28T03:49:51.663" Title="How can I look up help for a key sequence that I can't type" Tags="|keymap|help|terminal-emacs|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="330" PostTypeId="2" ParentId="329" CreationDate="2014-09-26T17:32:18.890" Score="15" Body="&lt;p&gt;Evaluate the following using &lt;code&gt;eval-expression&lt;/code&gt; (&lt;kbd&gt;M-:&lt;/kbd&gt;) or in a scratch buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(describe-key (kbd &quot;C-&amp;lt;whatever&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-26T17:32:18.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="331" PostTypeId="2" ParentId="314" CreationDate="2014-09-26T17:35:45.510" Score="2" Body="&lt;p&gt;Thanks to @Sigma's answer, I found a temporary workable solution till org-mode supports this in a cleaner way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below solution could have looked prettier were it not for the below shown org-mode macro limitations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Unable to have nested macro replacement. The below is not possible.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: LT_REF     ref_longtable&#xA;#+MACRO: LT_TITLE   This is a long table&#xA;#+MACRO: LT_HEADER1 Header 1 &#xA;#+MACRO: LT_HEADER2 Header 2&#xA;{{{LT_HEADER({{{LT_REF}}}, {{{LT_TITLE}}}, {{{LT_HEADER1}}}, {{{LT_HEADER2}}})}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Unable to use macros in &lt;code&gt;#+NAME:&lt;/code&gt;. The below is not possible.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: {{{LT_REF}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Due to these limitations, the table reference tag and the headers have to be manually repeated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution derived from @Sigma's answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Testing out =longtable=&#xA;&#xA;# below gets rid of the red boxes drawn around the links&#xA;# `hyperref' package is already included in org-latex-default-packages-alist&#xA;#+LaTeX_HEADER: \hypersetup{&#xA;#+LaTeX_HEADER:     colorlinks,%&#xA;#+LaTeX_HEADER:     citecolor=black,%&#xA;#+LaTeX_HEADER:     filecolor=black,%&#xA;#+LaTeX_HEADER:     linkcolor=blue,%&#xA;#+LaTeX_HEADER:     urlcolor=blue&#xA;#+LaTeX_HEADER: }&#xA;&#xA;#+MACRO: LT_HEADER #+ATTR_LaTeX: :caption \caption{\label{$1} $2}\\\hline $3 &amp;amp; $4 \\\hline\endfirsthead\caption[]{$2}\endhead&#xA;&#xA;#+TOC: tables&#xA;&#xA;#+ATTR_LaTeX: :environment longtable&#xA;{{{LT_HEADER(ref_longtable, This is a long table, Header 1, Header 2)}}}&#xA;#+NAME: ref_longtable&#xA;|----------+----------|&#xA;| Header 1 | Header 2 |&#xA;|----------+----------|&#xA;|        1 | Item 1   |&#xA;|        2 | Item 2   |&#xA;|        3 | Item 3   |&#xA;|        4 | Item 4   |&#xA;|        5 | Item 5   |&#xA;|        6 | Item 6   |&#xA;|        7 | Item 7   |&#xA;|        8 | Item 8   |&#xA;|        9 | Item 9   |&#xA;|       10 | Item 10  |&#xA;|       11 | Item 11  |&#xA;|       12 | Item 12  |&#xA;|       13 | Item 13  |&#xA;|       14 | Item 14  |&#xA;|       15 | Item 15  |&#xA;|       16 | Item 16  |&#xA;|       17 | Item 17  |&#xA;|       18 | Item 18  |&#xA;|       19 | Item 19  |&#xA;|       20 | Item 20  |&#xA;|       21 | Item 21  |&#xA;|       22 | Item 22  |&#xA;|       23 | Item 23  |&#xA;|       24 | Item 24  |&#xA;|       25 | Item 25  |&#xA;|----------+----------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE: There MUST be NO space in the &lt;code&gt;\label{LABEL}&lt;/code&gt; section. I had hard time debugging why the tex to pdf conversion wasn't able to resolve the table references. I had &lt;code&gt;\label{ LABEL }&lt;/code&gt; instead of &lt;code&gt;\label{LABEL}&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-03T12:01:22.340" LastActivityDate="2014-10-03T12:01:22.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="332" PostTypeId="1" AcceptedAnswerId="26081" CreationDate="2014-09-26T17:57:26.440" Score="20" ViewCount="8674" Body="&lt;p&gt;My current use case is to find where the &lt;code&gt;Cask&lt;/code&gt; executable is (it can be installed in at least two places, and there's &lt;a href=&quot;https://github.com/cask/cask/issues/233&quot;&gt;an issue&lt;/a&gt; open about this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to require cask this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'cask &quot;~/.cask/cask.el&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I need to find the correct path to that &lt;code&gt;cask.el&lt;/code&gt;, and as far as I know, the easiest way to do that is through locating the executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="25" LastEditDate="2014-09-27T00:59:23.160" LastActivityDate="2017-01-26T17:55:20.737" Title="How can I find the path to an executable with Emacs Lisp?" Tags="|elisp|files|cask|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="333" PostTypeId="2" ParentId="332" CreationDate="2014-09-26T18:00:33.573" Score="3" Body="&lt;p&gt;Not sure I understand completely (I'm not using Cask myself), but would the following put you on the right track ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(locate-file &quot;cask&quot; exec-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That seems to be the answer to your general question.&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-26T18:42:19.603" LastActivityDate="2014-09-26T18:42:19.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="334" PostTypeId="2" ParentId="290" CreationDate="2014-09-26T18:29:43.850" Score="1" Body="&lt;p&gt;There's a command &lt;code&gt;TeX-PDF-mode&lt;/code&gt; bound to &lt;code&gt;C-c C-t C-p&lt;/code&gt; in my latex-mode, that's how I switch a buffer to using pdflatex instead of latex.&lt;/p&gt;&#xA;" OwnerUserId="149" LastActivityDate="2014-09-26T18:29:43.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="335" PostTypeId="2" ParentId="328" CreationDate="2014-09-26T18:32:45.750" Score="8" Body="&lt;p&gt;In term-mode, any regular &lt;code&gt;C-x whatever&lt;/code&gt; keybinding becomes &lt;code&gt;C-c whatever&lt;/code&gt; instead. &#xA;Courtesy of &lt;a href=&quot;https://stackoverflow.com/a/2173749&quot;&gt;Josh Matthews&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to define keybindings that will be active only in term mode, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'term-mode-hook&#xA;  (lambda () &#xA;    (define-key term-raw-map (kbd &quot;M-J&quot;) 'other-window)&#xA;    (define-key term-raw-map (kbd &quot;M-k&quot;) 'kill-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-09-27T03:28:31.230" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="336" PostTypeId="2" ParentId="62" CreationDate="2014-09-26T18:33:02.337" Score="12" Body="&lt;p&gt;years ago on the #emacs IRC channel I got this bit of code I've been using forever. The value &quot;2 sec&quot; sets the amount of time the successful compilation window stays visible.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; from enberg on #emacs&#xA;(add-hook 'compilation-finish-functions&#xA;  (lambda (buf str)&#xA;    (if (null (string-match &quot;.*exited abnormally.*&quot; str))&#xA;        ;;no errors, make the compilation window go away in a few seconds&#xA;        (progn&#xA;          (run-at-time&#xA;           &quot;2 sec&quot; nil 'delete-windows-on&#xA;           (get-buffer-create &quot;*compilation*&quot;))&#xA;          (message &quot;No Compilation Errors!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="149" LastEditorUserId="26950" LastEditDate="2020-02-23T11:55:20.603" LastActivityDate="2020-02-23T11:55:20.603" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="337" PostTypeId="2" ParentId="328" CreationDate="2014-09-26T18:34:05.670" Score="7" Body="&lt;p&gt;maybe using &lt;code&gt;ansi-term&lt;/code&gt; instead would be slightly less annoying, since it exposes a &lt;code&gt;C-x&lt;/code&gt; prefix, allowing you to use, say, &lt;code&gt;C-x o&lt;/code&gt; or &lt;code&gt;C-x k&lt;/code&gt; without any special trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not sufficient, you can use the following approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun expose-global-binding-in-term (binding)&#xA;   (define-key term-raw-map binding &#xA;     (lookup-key (current-global-map) binding)))&#xA;&#xA;(expose-global-binding-in-term (kbd &quot;M-o&quot;))&#xA;(expose-global-binding-in-term (kbd &quot;M-k&quot;))&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-27T02:46:50.923" LastActivityDate="2014-09-27T02:46:50.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="338" PostTypeId="2" ParentId="327" CreationDate="2014-09-26T19:52:59.293" Score="10" Body="&lt;p&gt;You need to configure the 600-pound gorilla that is &lt;code&gt;display-buffer-alist&lt;/code&gt; which determines how &lt;code&gt;display-buffer&lt;/code&gt; chooses where to display a buffer. It makes &lt;code&gt;display-buffer-reuse-frames&lt;/code&gt; obsolete in newer emacsen. Here is a config that should guide you (atleast in emacs 24.3).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; all buffers, try to reuse windows across all frames&#xA;(add-to-list 'display-buffer-alist&#xA;           '(&quot;.*&quot;. (display-buffer-reuse-window .&#xA;                                  ((reusable-frames . t)))))&#xA;&#xA;;; except for compilation buffers where you want new and dedicated frames when necessary&#xA;(add-to-list 'display-buffer-alist&#xA;         '(&quot;^\\*Compile-Log\\*&quot;. ((display-buffer-reuse-window&#xA;                                   display-buffer-pop-up-frame) .&#xA;                                  ((reusable-frames . t)&#xA;                                  (inhibit-same-window . t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see I use a regexp to match the compile-log buffer. The documentation of &lt;code&gt;display-buffer&lt;/code&gt; should give you an idea of what is happening. Just a heads up that it is not the most enjoyable piece of documentation you will ever read. I added them sequentially so the compile-log regexp will be matched ahead of the generic regexp. Adapt the regexp to your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT&#xA;To make any frame unsplittable you can eval &lt;code&gt;M-: (set-frame-parameter nil 'unsplittable t)&lt;/code&gt; in that particular frame. Replace nil with required &lt;code&gt;FRAME&lt;/code&gt; if doing it from elisp.&#xA;Between these two settings, it should make the compilation frame exclusive unless you specifically find a file in that frame.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-09-26T21:38:37.330" LastActivityDate="2014-09-26T21:38:37.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="339" PostTypeId="2" ParentId="329" CreationDate="2014-09-26T19:55:17.570" Score="9" Body="&lt;p&gt;If you can't use a particular key combination because of your terminal, you can often fake it by manually simulating the key modifier. The following combinations work exactly as though you had used the corresponding modifier key:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x @ a     alt&#xA;C-x @ m     meta&#xA;C-x @ c     control&#xA;C-x @ h     hyper&#xA;C-x @ s     super (lowercase s)&#xA;C-x @ S     shift (uppercase S)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, if you can't type &lt;code&gt;C-a&lt;/code&gt; for whatever reason, &lt;code&gt;C-x @ c a&lt;/code&gt; is the same thing. If &lt;code&gt;S-&amp;lt;return&amp;gt;&lt;/code&gt; doesn't work at your terminal, &lt;code&gt;C-x @ S RET&lt;/code&gt; will. These key combinations work with the &lt;code&gt;C-h k&lt;/code&gt; help prefix, too.&lt;/p&gt;&#xA;" OwnerUserId="321" LastActivityDate="2014-09-26T19:55:17.570" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="340" PostTypeId="2" ParentId="20" CreationDate="2014-09-26T20:13:55.257" Score="4" Body="&lt;p&gt;I like to use scratch buffers for throw-away stuff.  Having only one is somewhat limiting though, therefore I have &lt;code&gt;scratch&lt;/code&gt; as an interactive command for opening a new scratch buffer (no matter how many exist already):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun scratch ()&#xA;  &quot;create a new scratch buffer to work in. (could be *scratch* - *scratchX*)&quot;&#xA;  (interactive)&#xA;  (let ((n 0)&#xA;        bufname)&#xA;    (while (progn&#xA;             (setq bufname (concat &quot;*scratch&quot;&#xA;                                   (if (= n 0) &quot;&quot; (int-to-string n))&#xA;                                   &quot;*&quot;))&#xA;             (setq n (1+ n))&#xA;             (get-buffer bufname)))&#xA;  (switch-to-buffer (get-buffer-create bufname))&#xA;  (if (= n 1) initial-major-mode))) ; 1, because n was incremented&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;adopted from: &lt;a href=&quot;http://everything2.com/index.pl?node_id=1038451&quot; rel=&quot;nofollow&quot;&gt;http://everything2.com/index.pl?node_id=1038451&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="330" LastActivityDate="2014-09-26T20:13:55.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="341" PostTypeId="2" ParentId="329" CreationDate="2014-09-26T20:36:15.390" Score="2" Body="&lt;p&gt;You could also use &lt;code&gt;C-h b&lt;/code&gt;to look at all the keybindings, that will include mouse buttons and everything else.&lt;/p&gt;&#xA;" OwnerUserId="149" LastActivityDate="2014-09-26T20:36:15.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="342" PostTypeId="1" AcceptedAnswerId="343" CreationDate="2014-09-26T20:53:36.280" Score="12" ViewCount="4955" Body="&lt;p&gt;I have learned Emacs mostly using it's own documentation and the late &lt;a href=&quot;https://github.com/technomancy/emacs-starter-kit&quot; rel=&quot;noreferrer&quot;&gt;emacs-starter-kit&lt;/a&gt;. Talking with people interested in learning Emacs, I found that my approach is not appealing to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the best resources around to learn Emacs from scratch ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there resources dedicated for people migrating from other editors (vim/sublime) to Emacs?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="253" LastEditDate="2014-11-16T19:09:51.553" LastActivityDate="2014-11-16T19:09:51.553" Title="What are the best resources to learn Emacs?" Tags="|learning|" AnswerCount="4" CommentCount="2" ClosedDate="2014-09-27T08:09:19.027" ContentLicense="CC BY-SA 3.0" />
  <row Id="343" PostTypeId="2" ParentId="342" CreationDate="2014-09-26T21:57:44.387" Score="12" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsNewbie&quot;&gt;&lt;em&gt;This is the place&lt;/em&gt;&lt;/a&gt; I suggest to start. It is a relatively organized set of EmacsWiki pages (category EmacsNewbie) for help with learning Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the pages in that set.  And some of these lead to further pages. For example, you will most likely want to look at the &lt;a href=&quot;http://www.emacswiki.org/emacs/LearningEmacs&quot;&gt;LearningEmacs&lt;/a&gt; page. (And &lt;a href=&quot;http://www.emacswiki.org/emacs/LearnEmacsLisp&quot;&gt;this page&lt;/a&gt; is about learning Emacs Lisp.)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Emacs&quot;&gt;WikiPedia:Emacs&lt;/a&gt; – Overview. of Emacs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/CategoryGlossary&quot;&gt;CategoryGlossary&lt;/a&gt; – Emacs terminology.&lt;/li&gt;&#xA;&lt;li&gt;A &lt;a href=&quot;http://www.gnu.org/software/emacs/tour/&quot;&gt;guided tour&lt;/a&gt; of GnuEmacs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/LearningEmacs&quot;&gt;&lt;strong&gt;LearningEmacs&lt;/strong&gt;&lt;/a&gt; – Different ways to learn Emacs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsNewbieMouseReference&quot;&gt;EmacsNewbieMouseReference&lt;/a&gt; – How the Emacs mouse works.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsNewbieHelpReference&quot;&gt;EmacsNewbieHelpReference&lt;/a&gt; – Commonly used Emacskeys.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsNewbieKeyReference&quot;&gt;EmacsNewbieKeyReference&lt;/a&gt; – Commonly used Emacscommands.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsNewbieWithIcicles&quot;&gt;EmacsNewbieWithIcicles&lt;/a&gt; – Help while you use Emacs (discovery, feedback).&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/KeyboardMacros&quot;&gt;KeyboardMacros&lt;/a&gt; – Record what you do (mouse, menu, keyboard). Play it back again.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/CategoryReferenceSheet&quot;&gt;CategoryReferenceSheet&lt;/a&gt; – Emacs key reference sheet.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/CommonProblems&quot;&gt;CommonProblems&lt;/a&gt; – Common sources of confusion.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="317" LastEditDate="2014-09-27T01:39:48.727" LastActivityDate="2014-09-27T01:39:48.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="344" PostTypeId="2" ParentId="342" CreationDate="2014-09-26T22:40:11.860" Score="1" Body="&lt;p&gt;When I first learned emacs I followed the built-in tutorial.  It is a good exposition of the most basic emacs concepts and keybindings.  It is interactive in that it is an editable buffer that encourages you to try out the operations as you read about them including searching, text insertion/deletion, kill/yank operations, opening files, switching between buffers, splitting windows, and more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One (arguable) downside is that it is a long (1,160 lines) text document with no pictures, so it may not be very appealing to people who are used to flashy animated tutorials with embedded videos, etc.  Personally, I did not find it to be boring because it is fairly hands-on, and it takes less than an hour to work through all of the examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can access the built-in tutorial by typing &lt;code&gt;C-h t&lt;/code&gt; (which means &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;h&lt;/kbd&gt;, then &lt;kbd&gt;t&lt;/kbd&gt;).&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-09-26T22:40:11.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="345" PostTypeId="2" ParentId="308" CreationDate="2014-09-26T22:46:05.173" Score="3" Body="&lt;p&gt;Another option you have is to track the value of this variable throughout the execution of &lt;code&gt;org-agenda&lt;/code&gt;, that &lt;em&gt;has&lt;/em&gt; to tell you where the problem is.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Evaluate the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [f1] (lambda () (interactive) (message &quot;%s&quot; org-agenda-files)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Visit the function with &lt;code&gt;M-x find-function RET org-agenda&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Edebug it with &lt;code&gt;C-u C-M-x&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Call the function, &lt;code&gt;M-x org-agenda&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Gradually step through it by pressing &lt;code&gt;n&lt;/code&gt;, and monitor the value of the variable by hitting &lt;code&gt;F1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At some point inside the &lt;code&gt;org-agenda&lt;/code&gt; function, you'll hit &lt;code&gt;F1&lt;/code&gt; and the value of &lt;code&gt;org-agenda-files&lt;/code&gt; will have changed. That will tell you where to look.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-26T22:46:05.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="346" PostTypeId="2" ParentId="342" CreationDate="2014-09-26T22:51:59.297" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/tour/&quot; rel=&quot;nofollow&quot;&gt;emacs guided tour&lt;/a&gt; is what I would recommend for new users who want to edit text ASAP. If you want to learn elisp, I think the &lt;code&gt;Emacs Lisp Introduction&lt;/code&gt; available as an info node is easiest for getting your feet wet.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-26T22:51:59.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="347" PostTypeId="1" CreationDate="2014-09-26T22:57:34.833" Score="3" ViewCount="273" Body="&lt;p&gt;I often keep a &quot;short&quot; secondary window below my main window with an arrangement like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------+&#xA;|         |&#xA;|         |&#xA;|   top   |&#xA;|         |&#xA;|         |&#xA;|         |&#xA;+---------+&#xA;|         |&#xA;| bottom  |&#xA;|         |&#xA;+---------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The bottom window typically contains, &lt;code&gt;*compilation*&lt;/code&gt;, &lt;code&gt;*grep*&lt;/code&gt;, &lt;code&gt;*Shell*&lt;/code&gt;, &lt;code&gt;*Help*&lt;/code&gt;, etc. I typically keep a 80%-20% top-bottom split, but I find myself having to maintain this manually. Whenever I open certain new mode types like Help they often grow the bottom window to a 50-50 split with top. Is there any way for me to preserve this arrangement even when invoking these alternative modes like Help or compilation?&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-09-27T00:24:33.427" Title="Preserve window arrangement for secondary windows" Tags="|window|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="348" PostTypeId="2" ParentId="347" CreationDate="2014-09-26T23:02:21.057" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;http://github.com/m2ym/popwin-el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;popwin&lt;/code&gt;&lt;/a&gt; package might be what you want. It's available on Melpa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't persistently keep the *Help*, *Completion*, etc windows persistently open, but you can set the size and position where they can open. The best part is that those windows close automatically, recovering the precious screen area. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-09-26T23:02:21.057" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="349" PostTypeId="1" CreationDate="2014-09-26T23:41:27.107" Score="9" ViewCount="6718" Body="&lt;p&gt;I'm going to be doing a bit of iOS work soon, using Swift (yay!). Unfortunately, this usually involves xcode (boo!). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set Emacs up to build iOS apps with Swift? Ideally, they would run on my testing device automatically. More advanced functionality like autocomplete would be nice too, but not critical.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="330" LastEditDate="2014-09-27T01:39:39.720" LastActivityDate="2014-10-08T21:50:45.403" Title="How can I set Emacs up for iOS development with Swift?" Tags="|osx|development|ios|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="350" PostTypeId="2" ParentId="329" CreationDate="2014-09-27T00:17:34.690" Score="0" Body="&lt;p&gt;I wasn't aware of any of these more specific solutions, and they probably work better if you want the exact command that is executed by a key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for a more general tip on finding help, if you do in fact have a sort of vague idea about what the key binding is doing, but want more details, I've used &lt;code&gt;C-h f&lt;/code&gt; (or &lt;code&gt;describe-function&lt;/code&gt;) with tab completion to try and find the name of the function, which often works, and then the help will tell you if that function has a binding. And when that hasn't worked, I've used &lt;code&gt;C-h a&lt;/code&gt; (or &lt;code&gt;apropos-command&lt;/code&gt;) and typed in some terms that I thought might be related and surprisingly, I've had a lot of success finding the correct command for the key binding. Another good option is &lt;code&gt;C-h m&lt;/code&gt; (or &lt;code&gt;describe-mode&lt;/code&gt;) and look at all the key bindings for the current mode. This can also be used as helpful terms to use for either or the previous two search techniques.&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-09-27T00:17:34.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="351" PostTypeId="2" ParentId="347" CreationDate="2014-09-27T00:24:33.427" Score="0" Body="&lt;p&gt;It's possible the answer from this question may be applicable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/338/317&quot;&gt;https://emacs.stackexchange.com/a/338/317&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't yet tried it, and am unfamiliar with &lt;code&gt;display-buffer-alist&lt;/code&gt;, but maybe this will lead someone to come up with an example solution that would be applicable.&lt;/p&gt;&#xA;" OwnerUserId="317" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-09-27T00:24:33.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="352" PostTypeId="1" AcceptedAnswerId="360" CreationDate="2014-09-27T00:34:01.357" Score="55" ViewCount="15123" Body="&lt;p&gt;Sometimes my global keybindings are overridden by a major mode.  An easy example is the following setting in my init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-j&quot;) 'newline-and-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But annoyingly this keybinding is hidden by the &quot;Lisp Interaction&quot; major mode which is the default mode of the scratch buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;When I find myself in a situation where a major mode (or minor mode) is hiding my global keybinding, how can I get it back?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: My question is not &lt;em&gt;&quot;How can I bind &lt;code&gt;C-j&lt;/code&gt; to &lt;code&gt;newline-and-indent&lt;/code&gt; in &quot;Lisp Interaction&quot; mode?&quot;&lt;/em&gt;  I am interested in a much more general answer about how to deal with keymaps that clash or user keybindings that get hidden by some major/minor mode.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="105" LastEditDate="2017-09-21T23:51:49.633" LastActivityDate="2023-03-13T00:59:12.720" Title="How to override major mode bindings" Tags="|key-bindings|major-mode|keymap|minor-mode|" AnswerCount="6" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="353" PostTypeId="2" ParentId="352" CreationDate="2014-09-27T02:02:37.880" Score="5" Body="&lt;p&gt;To have a global binding override a major mode binding, simply set the binding to &lt;code&gt;nil&lt;/code&gt; in the major mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-major-mode-map (kbd &quot;C-j&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not possible to have the global binding take precedence over all modes in general (otherwise there would be no point in having major modes), but you could hack around it by creating your own minor mode with your most important bindings. Then you would at least have precedence over most (although not necessarily all) modes.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-09-29T20:48:52.470" LastActivityDate="2014-09-29T20:48:52.470" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="354" PostTypeId="2" ParentId="237" CreationDate="2014-09-27T02:10:56.217" Score="4" Body="&lt;p&gt;The easy way would be to install &lt;code&gt;ssh-askpass&lt;/code&gt;. This is the program that &lt;code&gt;ssh-add&lt;/code&gt; runs when its standard input is not a terminal but an X11 display is available. The program &lt;code&gt;ssh-askpass&lt;/code&gt; prompts for your passphrase in a separate GUI window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to stay within Emacs, or if you want a solution that works whether X11 is available or not, you can make Emacs prompt for the passphrase. Here's some Lisp code (minimally tested) to do this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ssh-add-process-filter (process string)&#xA;  (save-match-data&#xA;    (if (string-match &quot;:\\s *\\'&quot; string)&#xA;        (process-send-string process (concat (read-passwd string) &quot;\n&quot;))&#xA;      (message &quot;%s&quot; string))))&#xA;(defun ssh-add (key-file)&#xA;  &quot;Run ssh-add to add a key to the running SSH agent.&#xA;Let Emacs prompt for the passphrase.&quot;&#xA;  (interactive &quot;fAdd key: \n&quot;)&#xA;  (let ((process-connection-type t)&#xA;            process)&#xA;    (unwind-protect&#xA;        (progn&#xA;          (setq process (start-process &quot;ssh-add&quot; nil&#xA;                                       &quot;ssh-add&quot; (expand-file-name key-file)))&#xA;          (set-process-filter process 'ssh-add-process-filter)&#xA;          (while (accept-process-output process)))&#xA;      (if (eq (process-status process) 'run)&#xA;          (kill-process process)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-09-27T02:10:56.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="355" PostTypeId="2" ParentId="169" CreationDate="2014-09-27T02:21:42.470" Score="14" Body="&lt;p&gt;Emacs calls this &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html#Reverting&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;reverting&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can revert the current file with &lt;code&gt;M-x revert-buffer&lt;/code&gt;. This prompts for confirmation whether the file has been modified or not, except for files that match patterns listed in the variable &lt;code&gt;revert-without-query&lt;/code&gt; (see the manual for details). Another occasional annoyance of &lt;code&gt;revert-buffer&lt;/code&gt; is that it resets the file mode to the default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the following function to revert a bunch of files, given by name. If a file isn't opened in some buffer, it is ignored.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun revert-files (&amp;amp;rest files)&#xA;  &quot;Reload all specified files from disk.&#xA;Only files that are currently visited in some buffer are reverted.&#xA;Do not ask confirmation unless the buffer is modified.&quot;&#xA;  (save-excursion&#xA;    (let ((revert-without-query '(&quot;&quot;)))&#xA;      (dolist (file-name files)&#xA;        (message &quot;Considering whether to revert file %s&quot; file-name)&#xA;        (let ((buf (find-buffer-visiting file-name)))&#xA;          (when buf&#xA;            (message &quot;Reverting file in buffer %s&quot; (buffer-name buf))&#xA;            (set-buffer buf)&#xA;        (revert-buffer t nil t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A typical use case for this function is after updating files from version control. Use &lt;code&gt;emacsclient&lt;/code&gt; to call &lt;code&gt;revert-files&lt;/code&gt; on all the files that have been updated, or (this is easier, and only slightly slower) on all the files concerned by the update. I call the following shell script, passing it the files as arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#! /bin/sh&#xA;# Similar to gnuclient, but call `revert-files' on the files.&#xA;files=&#xA;&#xA;## Find a way to convert a path to absolute. Bizarre OSes such as Windows&#xA;## require special cases. We also try to detect non-filenames such as URIs.&#xA;case `uname -s` in&#xA;  CYGWIN*)&#xA;    absolute_path () {&#xA;      cygpath -a -w -- &quot;$1&quot;&#xA;    };;&#xA;  *)&#xA;    wd=&quot;`pwd -P 2&amp;gt;/dev/null || pwd`&quot;&#xA;    absolute_path () {&#xA;      case &quot;$1&quot; in&#xA;        /*) printf '%s' &quot;$1&quot;;; # ordinary absolute path&#xA;        *:/*)&#xA;          if expr &quot;z$1&quot; : 'z[0-9A-Z_a-z][-.0-9@A-Z_a-z]*:/.*'; then&#xA;            printf '%s' &quot;$1&quot; # URI or machine:/some/path&#xA;          else&#xA;            printf '%s' &quot;$wd/$1&quot; # default to a relative path&#xA;          fi;;&#xA;        *) printf '%s' &quot;$wd/$1&quot;;; # default to a relative path&#xA;      esac&#xA;    };;&#xA;esac&#xA;&#xA;for x; do&#xA;  files=&quot;$files \&quot;`absolute_path &quot;$x&quot; | sed 's/[\\\\\\\&quot;]/\\\\&amp;amp;/g'`\&quot;&quot;&#xA;done&#xA;exec emacsclient -e &quot;(revert-files$files)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;svn update&#xA;find -name .svn -prune -o -type f -exec emacsclient-revert {} +&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-09-28T11:43:53.763" LastActivityDate="2014-09-28T11:43:53.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="356" PostTypeId="2" ParentId="342" CreationDate="2014-09-27T02:25:33.977" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://david.rothlis.net/emacs/howtolearn.html&quot; rel=&quot;nofollow&quot;&gt;How To Learn Emacs&lt;/a&gt; is something I wish I'd found years ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's clear, concise, and a good introduction to using Emacs effectively.&lt;/p&gt;&#xA;" OwnerUserId="351" LastActivityDate="2014-09-27T02:25:33.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="357" PostTypeId="2" ParentId="275" CreationDate="2014-09-27T02:40:18.040" Score="4" Body="&lt;p&gt;Instead of showing the file while a key is pressed, which would be very difficult to implement, I suggest showing the file until the next key is pressed.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-find-file-until-key ()&#xA;  (interactive)&#xA;  (let ((filename (dired-file-name-at-point))&#xA;    (buffer-count (length (buffer-list))))&#xA;    (dired-find-file)&#xA;    (message &quot;Showing %s temporarily...&quot; filename)&#xA;    (isearch-unread-key-sequence (list (read-event)))&#xA;    (if (= (length (buffer-list)) buffer-count)&#xA;    (bury-buffer)&#xA;      (kill-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a variant that shows the file in another window, which I think is a more convenient user interface.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-find-file-other-window-until-key ()&#xA;  (interactive)&#xA;  (let ((buffer-count (length (buffer-list))))&#xA;    (dired-find-file-other-window)&#xA;    (isearch-unread-key-sequence (list (read-event)))&#xA;    (if (= (length (buffer-list)) buffer-count)&#xA;    (delete-window)&#xA;      (kill-buffer-and-window))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You won't be able to do so much as scroll in the buffer. It might make more sense to implement a “quick view” mode where scrolling commands are accepted, but other input events cause the quick view mode to exit and are interpreted according to the previous mode, like Isearch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;v&lt;/code&gt; (&lt;code&gt;dired-view-file&lt;/code&gt;), you get something intermediate: the buffer is edited in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/View-Mode.html#View-Mode&quot; rel=&quot;nofollow&quot;&gt;View mode&lt;/a&gt;, where you can scroll around, search, etc. but closing the buffer is the simple keystroke &lt;code&gt;q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="675" LastEditDate="2015-05-12T21:26:10.857" LastActivityDate="2015-05-12T21:26:10.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="358" PostTypeId="2" ParentId="352" CreationDate="2014-09-27T03:01:36.933" Score="41" Body="&#xA;&#xA;&lt;p&gt;You can define your own minor mode and its key map and have that override all other modes (minor + major). That's exactly why I chose to write my own minor mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Steps to have your key bindings override all bindings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Defining your own minor mode and key map as shown below.&lt;/li&gt;&#xA;&lt;li&gt;Activate your minor mode globally&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(define-key my-mode-map (kbd &quot;C-j&quot;) #'newline-and-indent)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Similarly your other key bindings set in your minor mode will override those in other modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I highly recommend reading the &lt;a href=&quot;http://nullprogram.com/blog/2013/02/06/&quot; rel=&quot;noreferrer&quot;&gt;blog post&lt;/a&gt; by Christopher Wellons on how to write a minor mode. That blog plus the annoyance of having to set multiple key bindings to &lt;code&gt;nil&lt;/code&gt; in multiple major and minor modes inspired me to write my own minor mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best part of using this approach is that when you want to check what the key bindings do in emacs' default configuration, you simply turn off your minor mode; you then turn it back on and you get back your custom key bindings. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Main use is to have my key bindings have the highest priority&#xA;;; https://github.com/kaushalmodi/.emacs.d/blob/master/elisp/modi-mode.el&#xA;&#xA;(defvar my-mode-map (make-sparse-keymap)&#xA;  &quot;Keymap for `my-mode'.&quot;)&#xA;&#xA;;;;###autoload&#xA;(define-minor-mode my-mode&#xA;  &quot;A minor mode so that my key settings override annoying major modes.&quot;&#xA;  ;; If init-value is not set to t, this mode does not get enabled in&#xA;  ;; `fundamental-mode' buffers even after doing \&quot;(global-my-mode 1)\&quot;.&#xA;  ;; More info: http://emacs.stackexchange.com/q/16693/115&#xA;  :init-value t&#xA;  :lighter &quot; my-mode&quot;&#xA;  :keymap my-mode-map)&#xA;&#xA;;;;###autoload&#xA;(define-globalized-minor-mode global-my-mode my-mode my-mode)&#xA;&#xA;;; https://github.com/jwiegley/use-package/blob/master/bind-key.el&#xA;;; The keymaps in `emulation-mode-map-alists' take precedence over&#xA;;; `minor-mode-map-alist'&#xA;(add-to-list 'emulation-mode-map-alists `((my-mode . ,my-mode-map)))&#xA;&#xA;;; Turn off the minor mode in the minibuffer&#xA;(defun turn-off-my-mode ()&#xA;  &quot;Turn off my-mode.&quot;&#xA;  (my-mode -1))&#xA;(add-hook 'minibuffer-setup-hook #'turn-off-my-mode)&#xA;&#xA;(provide 'my-mode)&#xA;&#xA;;; Minor mode tutorial: http://nullprogram.com/blog/2013/02/06/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-11T15:11:20.973" LastActivityDate="2016-05-11T15:11:20.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="359" PostTypeId="2" ParentId="352" CreationDate="2014-09-27T03:10:05.043" Score="1" Body="&lt;p&gt;You can use these macros:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro expose-global-keybinding (binding map)&#xA;  `(define-key ,map ,binding (lookup-key (current-global-map) ,binding)))&#xA;&#xA;(defmacro expose-bindings (map bindings)&#xA;  `(dolist (bnd ,bindings)&#xA;     (expose-global-keybinding (kbd bnd) ,map)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the example bellow:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the keymap X is overriding your global binding Y, you write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(expose-bindings X '(&quot;Y&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then the override will be 'undone'.&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="290" LastEditDate="2014-10-08T21:02:32.400" LastActivityDate="2014-10-08T21:02:32.400" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="360" PostTypeId="2" ParentId="352" CreationDate="2014-09-27T03:44:04.380" Score="54" Body="&lt;p&gt;There is a &quot;shortcut&quot; approach too for the same solution if you don't want to define your own minor mode (that I talk about in my first answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install the &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; package available from Melpa and make use of &lt;code&gt;bind-key*&lt;/code&gt; or &lt;code&gt;bind-keys*&lt;/code&gt; macro that's part of the &lt;code&gt;bind-key&lt;/code&gt; package that ships with &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation of &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot;&gt;&lt;code&gt;bind-key.el&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; If you want the keybinding to override all minor modes that may also bind&#xA;;; the same key, use the `bind-key*' form:&#xA;;;&#xA;;;   (bind-key* &quot;&amp;lt;C-return&amp;gt;&quot; 'other-window)&#xA;&#xA;;; To bind multiple keys in a `bind-key*' way (to be sure that your bindings&#xA;;; will not be overridden by other modes), you may use `bind-keys*' macro:&#xA;;;&#xA;;;    (bind-keys*&#xA;;;     (&quot;C-o&quot; . other-window)&#xA;;;     (&quot;C-M-n&quot; . forward-page)&#xA;;;     (&quot;C-M-p&quot; . backward-page))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="2642" LastEditDate="2015-08-04T22:34:45.490" LastActivityDate="2015-08-04T22:34:45.490" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="361" PostTypeId="1" AcceptedAnswerId="3103" CreationDate="2014-09-27T08:35:55.190" Score="33" ViewCount="8651" Body="&lt;p&gt;When editing org files, I find it extremely convenient how you can&#xA;hide and display headlines and their content by just hitting &lt;code&gt;TAB&lt;/code&gt; on&#xA;the headline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, consider the following buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 1&#xA;Some text here.&#xA;&#xA;* Headline 2&#xA;Some more text here.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I place the point on the first &lt;code&gt;*&lt;/code&gt;, and hit &lt;code&gt;TAB&lt;/code&gt;, I will get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 1...&#xA;* Headline 2&#xA;Some more text here.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to achieve that with LaTeX sections?&lt;/strong&gt;&lt;br&gt;&#xA;i.e., how can I hide and display the contents of a LaTeX&#xA;section/chapter/etc, while keeping the title visible? I'm using AucTeX for LaTeX-mode but I haven't&#xA;found anything that seems to fill this role.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-04T21:34:16.773" Title="How can I hide/display LaTeX section just like org-mode does with headlines?" Tags="|latex|code-folding|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="362" PostTypeId="2" ParentId="361" CreationDate="2014-09-27T08:35:55.190" Score="28" Body="&lt;p&gt;What you want is called folding, and there are 2 ways you can do that.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Outline-minor-mode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This is a built-in minor mode that is exactly what org-mode uses to&#xA;hide and display it's headlines. You can make sure it's always turned&#xA;on in &lt;code&gt;latex-mode&lt;/code&gt; with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'outline-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The keybinds it defines are a little hard to use, so you might want&#xA;to change some of them.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c @ C-a       show-all&#xA;C-c @ C-c       hide-entry&#xA;C-c @ C-d       hide-subtree&#xA;C-c @ C-e       show-entry&#xA;C-c @ TAB       show-children&#xA;C-c @ C-k       show-branches&#xA;C-c @ C-l       hide-leaves&#xA;C-c @ C-o       hide-other&#xA;C-c @ C-q       hide-sublevels&#xA;C-c @ C-s       show-subtree&#xA;C-c @ C-t       hide-body&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Latex-extra&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/Bruce-Connor/latex-extra/&quot;&gt;latex-extra&lt;/a&gt; is a minor mode available on Melpa and Melpa-stable.&#xA;You can install it with &lt;code&gt;M-x package-install RET latex-extra&lt;/code&gt; and turn&#xA;it on with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'latex-extra-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It adds a series of conveniences to &lt;code&gt;latex-mode&lt;/code&gt;, one of them is&#xA;section folding. &lt;code&gt;latex-extra&lt;/code&gt; also uses &lt;code&gt;outline-minor-mode&lt;/code&gt; behind&#xA;the scenes, but the advantage is that it &lt;strong&gt;emulates org-mode's&#xA;behaviour&lt;/strong&gt; more closely (albeit not identically).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From its &lt;a href=&quot;https://github.com/Bruce-Connor/latex-extra/&quot;&gt;readme&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Similar to how org-mode hides and displays of subtrees, if you hit&#xA;  &lt;strong&gt;TAB&lt;/strong&gt; on a section header &lt;em&gt;latex-extra&lt;/em&gt; will hide the contents of&#xA;  that section for you. Hitting tab twice will expand it again.&lt;br&gt;&#xA;  This will &lt;strong&gt;not&lt;/strong&gt; interfere with whatever with other keybinds you have&#xA;  set for &lt;strong&gt;TAB&lt;/strong&gt;, such as yasnippet or auto-completion.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Shift-TAB&lt;/strong&gt; will do the same for the entire buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Of course, the same goes for chapters, subsections, etc.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-29T10:19:00.383" LastActivityDate="2014-09-29T10:19:00.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="363" PostTypeId="1" AcceptedAnswerId="373" CreationDate="2014-09-27T09:19:40.530" Score="9" ViewCount="946" Body="&lt;p&gt;Although Emacs (24.3.93.1) runs fine if launched from the Finder, if the terminal version is launched:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;/Applications/Emacs.app/Contents/MacOS/Emacs -nw&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs crashes with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Fatal error 11: Segmentation fault[1]    51512 abort      /Applications/Emacs.app/Contents/MacOS/Emacs -nw&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems the issue is caused by a single line in init.el,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(set-face-attribute 'default nil :font  &quot;Menlo-16&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that line is commented out, the terminal version of Emacs will start fine too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To pinpoint the cause of the crash took me several hours (diminishing my init.el half by half).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that in any case Emacs will inherit whatever font and font size is specified in the terminal app (basically, that line is not meaningful in the cli.)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generally speaking, is there a better way to debug a crashing Emacs? Perhaps using some kind of cli debugger that would print a more descriptive message?&lt;/li&gt;&#xA;&lt;li&gt;Why is that line crashing Emacs via cli, but not if launched from the Finder?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="249" LastEditorUserId="249" LastEditDate="2014-09-27T15:15:37.953" LastActivityDate="2014-10-31T12:17:18.357" Title="Better debugging of crashing Emacs?" Tags="|elisp|fonts|debugging|crash|" AnswerCount="2" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="364" PostTypeId="1" AcceptedAnswerId="367" CreationDate="2014-09-27T09:29:30.130" Score="34" ViewCount="6609" Body="&lt;p&gt;From what I understand &lt;code&gt;require&lt;/code&gt; is used to load large chunks of code (something like modules) although it can also load individual functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Autoload on the other side, only &lt;em&gt;registers&lt;/em&gt; functions and defers the loading to execution time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've recently read &lt;a href=&quot;http://a-nickels-worth.blogspot.ro/2007/11/effective-emacs.html&quot;&gt;an article&lt;/a&gt; which advocates the usage of &lt;code&gt;autoload&lt;/code&gt; exclusively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it better to &lt;code&gt;autoload&lt;/code&gt; than to &lt;code&gt;require&lt;/code&gt;? What are some typical use cases for each of these?&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="330" LastEditDate="2016-02-08T13:41:02.150" LastActivityDate="2021-04-17T22:10:53.140" Title="When should I use autoload instead of require?" Tags="|elisp|libraries|autoload|require|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="366" PostTypeId="2" ParentId="364" CreationDate="2014-09-27T09:56:49.867" Score="3" Body="&lt;p&gt;If you want a certain feature to be loaded and available directly when your Emacs has started, use require, otherwise use autoload. I personally value startup time much (I actually restart Emacs a couple of times per week, sometimes several times per day), so I accept that it will take a little bit of time when Emacs autoloads a certain function when I need it. So, think about what you want to be available directly after Emacs is started and what can be loaded when needed.&lt;/p&gt;&#xA;" OwnerUserId="320" LastActivityDate="2014-09-27T09:56:49.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="367" PostTypeId="2" ParentId="364" CreationDate="2014-09-27T11:36:59.820" Score="31" Body="&lt;p&gt;&lt;code&gt;autoload&lt;/code&gt; is not a substitute for &lt;code&gt;require&lt;/code&gt;.  Typically &lt;code&gt;require&lt;/code&gt; is used to make sure that a certain file is loaded.  &lt;code&gt;autoload&lt;/code&gt; on the other hand gives Emacs a hint in which file to find a given function &lt;em&gt;without&lt;/em&gt; loading the file right away.  Only when the autoloaded function is called is the corresponding file loaded.&lt;/p&gt;&#xA;&lt;p&gt;Basically with &lt;code&gt;autoload&lt;/code&gt; you can delay the loading of a whole file to the moment when you actually need it.  This is why (especially big) packages typically define their entry functions as &lt;code&gt;autoload&lt;/code&gt;s.&lt;/p&gt;&#xA;&lt;p&gt;If you want to do heavy customizations for a package usually you are out of luck with &lt;code&gt;autoload&lt;/code&gt;.  If you still want to avoid &lt;code&gt;require&lt;/code&gt; then you can defer your customizations until after the file has been loaded by using &lt;code&gt;eval-after-load&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;elisp&lt;/code&gt; manual covers this topic in the following sections:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/How-Programs-Do-Loading.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;16.1 How Programs Do Loading&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;16.5 Autoload&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;16.7 Features (provide &amp;amp; require)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="330" LastEditorUserId="21893" LastEditDate="2021-04-17T22:10:53.140" LastActivityDate="2021-04-17T22:10:53.140" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="368" PostTypeId="1" AcceptedAnswerId="369" CreationDate="2014-09-27T13:55:03.903" Score="3" ViewCount="701" Body="&lt;p&gt;For example in a org file (cursor represented as &lt;code&gt;|&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* heading&#xA;    this is body |of the heading&#xA;    1. some&#xA;    2. list&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After 'org-beginning-of-line' :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* heading&#xA;    |this is body of the heading&#xA;    1. some&#xA;    2. list&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a good way to do this &lt;strong&gt;without losing org-mode syntax awareness&lt;/strong&gt;  &lt;code&gt;org-beginning-of-line&lt;/code&gt; provided ?&lt;/p&gt;&#xA;" OwnerUserId="165" LastEditorUserId="165" LastEditDate="2014-09-28T03:47:37.383" LastActivityDate="2014-09-28T04:02:09.080" Title="How do I make 'org-beginning-of-line' move cursor to the first text in heading body" Tags="|org-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="369" PostTypeId="2" ParentId="368" CreationDate="2014-09-27T14:52:06.397" Score="3" Body="&lt;p&gt;A possibility would be to add an advice to &lt;code&gt;org-beginning-of-line&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-beginning-of-line (around ad-org-beginning-of-line-around act)&#xA;  &quot;Move back to indentation first, then to beginning of line&quot;&#xA;  (let ((initial-position (point)))&#xA;    ad-do-it&#xA;    (when (looking-at &quot;^ +&quot;)&#xA;      (when (equal initial-position&#xA;                   (progn (back-to-indentation)&#xA;                          (point)))&#xA;        (beginning-of-line)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But really, the only advantage of doing that is to keep using &lt;code&gt;C-a&lt;/code&gt; (which behaves differently on headers and items). Ideally, it would probably be better to start using the &quot;proper&quot; binding for &lt;code&gt;back-to-indentation&lt;/code&gt; directly: &lt;code&gt;M-m&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-28T04:02:09.080" LastActivityDate="2014-09-28T04:02:09.080" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="370" PostTypeId="2" ParentId="368" CreationDate="2014-09-27T15:04:16.410" Score="0" Body="&lt;p&gt;I have bound &lt;kbd&gt;C-a&lt;/kbd&gt; to the &lt;code&gt;back-to-indentation-or-beginning-of-line&lt;/code&gt; function below that I got from @lunaryorn's &lt;a href=&quot;https://github.com/lunaryorn/stante-pede/blob/master/init.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;init.el&lt;/code&gt;&lt;/a&gt;. &lt;em&gt;I recommend having a look at that init.el for more useful snippets like this.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Make C-a toggle between beginning of line and indentation&#xA;;; https://github.com/lunaryorn/stante-pede/blob/master/init.el&#xA;(defun back-to-indentation-or-beginning-of-line (arg)&#xA;  &quot;Move point back to indentation of beginning of line.&#xA;Move point to the first non-whitespace character on this line.&#xA;If point is already there, move to the beginning of the line.&#xA;Effectively toggle between the first non-whitespace character and&#xA;the beginning of the line.&#xA;If ARG is not nil or 1, move forward ARG - 1 lines first.  If&#xA;point reaches the beginning or end of the buffer, stop there.&quot;&#xA;  (interactive &quot;^p&quot;)&#xA;  (setq arg (or arg 1))&#xA;&#xA;  ;; Move lines first&#xA;  (when (/= arg 1)&#xA;    (let ((line-move-visual nil))&#xA;      (forward-line (1- arg))))&#xA;&#xA;  (let ((orig-point (point)))&#xA;    (back-to-indentation)&#xA;    (when (= orig-point (point))&#xA;      (move-beginning-of-line 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have bound this to my minor mode key map so that it can override the &lt;code&gt;C-a&lt;/code&gt; bindings of all other modes (including &lt;code&gt;org-mode&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-09-27T15:04:16.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="371" PostTypeId="1" AcceptedAnswerId="380" CreationDate="2014-09-27T15:26:47.310" Score="55" ViewCount="36931" Body="&lt;p&gt;I'd like to be able to run emacs on one computer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;server $ emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then connect to it from another:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;local $ emacsclient -c server&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible? If so, how?&lt;/p&gt;&#xA;" OwnerUserId="278" LastEditorUserId="278" LastEditDate="2014-09-29T16:34:13.213" LastActivityDate="2020-06-25T22:26:12.443" Title="How do I use emacsclient to connect to a remote emacs instance?" Tags="|daemon|emacsclient|networking|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="372" PostTypeId="1" CreationDate="2014-09-27T16:35:26.023" Score="5" ViewCount="1305" Body="&lt;p&gt;Suppose I copy some text from a source (e.g. a webpage, a text file opened in an editor such as gedit or emacs) to a buffer in emacs, and then save the buffer to a text file.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;When I copy the text from the source to the Emacs buffer,&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I actually copy &quot;the code values of the text under the encoding&#xA;method used by the source&quot; to the Emacs buffer? Or do I copy&#xA;something else of the text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does emacs need to know the encoding method of the text in the&#xA;source?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does conversion of encoding involve during this copy&#xA;process?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;When Emacs writes the buffer to a text file,&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;by default, without customized configurations of emacs, will emacs&#xA;write the buffer to the text file using the same encoding method as&#xA;the source does?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="120" LastEditorUserId="25" LastEditDate="2014-09-28T02:03:31.527" LastActivityDate="2014-09-28T02:03:31.527" Title="Character encoding when copying some text from somewhere to Emacs and saving to a file" Tags="|files|copy-paste|character-encoding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="373" PostTypeId="2" ParentId="363" CreationDate="2014-09-27T16:41:51.050" Score="6" Body="&lt;h2&gt;To help you track it next time&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This happened to me before. There was a situation where&#xA;&lt;code&gt;string-to-int&lt;/code&gt; crashed Emacs, and it took me hours to pinpoint as&#xA;well.&lt;br&gt;&#xA;Sorry I can't provide a nicer answer, but Emacs crashes happen&#xA;deep down in the C code, and there aren't any built-in tools available&#xA;to track down such problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose debugging it with &lt;code&gt;gdb&lt;/code&gt; is possible, but its&#xA;effectiveness will depend on your proficiency with &lt;code&gt;gdb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you really need to do is&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;File a bug report&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Pure elisp code (non-byte-compiled) is never supposed to crash Emacs.&#xA;It could cause a hang (due to some infinite loop) and it could cause&#xA;Emacs to run out of memory. But, beyond that, &lt;strong&gt;any crash is a bug&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x report-emacs-bug&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Simply providing this minimally working example you came up with,&#xA;along with a description of your build and system, should be enough&#xA;help for the kind developers.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="11" LastEditDate="2014-09-27T23:12:06.293" LastActivityDate="2014-09-27T23:12:06.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="374" PostTypeId="1" AcceptedAnswerId="377" CreationDate="2014-09-27T17:23:04.353" Score="5" ViewCount="530" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I created a text file by copying its different parts from different&#xA;sources (webpages, other text files, pdf files) into gedit and saved&#xA;it to the file. I wonder if that is the reason why I may have&#xA;multiple encodings in the text file, &lt;a href=&quot;https://emacs.stackexchange.com/questions/372/what-happens-with-character-encoding-when-copying-some-text-from-somewhere-to-e&quot;&gt;see also here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How shall I avoid creating a text file with mixed encodings when copying its different parts from different sources into an editor such as emacs?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Whenever I open the file in gedit, gedit can always show or decode&#xA;every part of the text correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I open the file in emacs, there will be characters that&#xA;can't be shown correctly. I wonder why emacs can't do that? Is it&#xA;because gedit add some metadata to the text file about which&#xA;encoding for which part, and these metadata can't be accessed by&#xA;emacs?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When I find the correct encoding for a part of the text file, and&#xA;change the encoding of the text file by &lt;code&gt;C-x RET R &amp;lt;found encoding&amp;gt;&lt;/code&gt;, and save the change to the file, it is expected that&#xA;emacs still can't show  the other parts of the text files with&#xA;different encodings. Also gedit can't show or decode the entire file&#xA;correctly. Is it because the other parts with other encodings were&#xA;altered as well? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I do to convert the text file with mixed encodings to a&#xA;single encoding such as utf-8?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="120" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-09-28T02:02:34.553" Title="Handling text files with mixed encodings" Tags="|copy-paste|character-encoding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="375" PostTypeId="1" AcceptedAnswerId="382" CreationDate="2014-09-27T17:23:49.610" Score="2" ViewCount="3104" Body="&lt;p&gt;I am always editing my .emacs file, and I was just wondering if I could reload it without restarting Emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I have tried &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;load-file&lt;/code&gt; and choosing the .emacs file, but I get this error message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VFKyC.png&quot; alt=&quot;error message&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could faulty code be causing this?  Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-background-color &quot;#1E1E20&quot;)&#xA;(set-foreground-color &quot;#D9CB9E&quot;)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/&quot;)&#xA;(require 'auto-complete-config)&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d//ac-dict&quot;)&#xA;(ac-config-default)&#xA;&#xA;(defun defun ()&#xA;  &quot;Insert defun function.&quot;&#xA;  (interactive)&#xA;  (insert &quot;(defun name () &#xA;  \&quot;Insert description here.\&quot;&#xA;)&quot;)&#xA;  (backward-char 35)&#xA;)&#xA;&#xA;(defun hello () &#xA;  &quot;Just a gretting.&quot;&#xA;  (interactive)&#xA;  (message &quot;Hello World!&quot;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2014-09-28T02:29:46.553" LastActivityDate="2014-09-28T02:29:46.553" Title="&quot;Symbol's value as a variable is void: defun&quot; when reloading .emacs?" Tags="|elisp|debugging|init-file|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="376" PostTypeId="2" ParentId="375" CreationDate="2014-09-27T17:53:59.097" Score="4" Body="&lt;h2&gt;The problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defun&lt;/code&gt; is already an elisp macro, which is similar to a function. So&#xA;doing something like &lt;code&gt;(defun defun () ..)&lt;/code&gt; is redefining the function&#xA;called &lt;code&gt;defun&lt;/code&gt; to do something else.&lt;br&gt;&#xA;Since &lt;code&gt;defun&lt;/code&gt; is used throughout Emacs (including in your &lt;code&gt;.emacs&lt;/code&gt;),&#xA;redefining it is a recipe for disaster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem should be fixed if you change that to anything that&#xA;doesn't override a fundamental elisp function &lt;code&gt;(defun write-defun () ..)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What you actually wanted&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;What you are trying to do is auto-insert a template for defining a new &lt;code&gt;defun&lt;/code&gt;. To achieve that you can use the &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;yasnippet&lt;/code&gt;&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an inbuilt &lt;code&gt;yasnippet&lt;/code&gt; template for inserting &lt;code&gt;defun&lt;/code&gt;'s [&lt;a href=&quot;https://github.com/AndreaCrotti/yasnippet-snippets/blob/master/emacs-lisp-mode/defun&quot; rel=&quot;nofollow&quot;&gt;Source&lt;/a&gt;]:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: defun&#xA;# key: def&#xA;# --&#xA;(defun ${1:fun} (${2:args})&#xA;  ${3:(interactive${4: &quot;P&quot;})}&#xA;  $0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;How to use this template?&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install &lt;code&gt;yasnippet&lt;/code&gt; from Melpa&lt;/li&gt;&#xA;&lt;li&gt;Add &lt;code&gt;(require 'yasnippet)&lt;/code&gt; and &lt;code&gt;(yas-global-mode 1)&lt;/code&gt; to your &lt;code&gt;init.el&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Restart emacs or &lt;code&gt;load-file&lt;/code&gt; your &lt;code&gt;init.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Now in a buffer with &lt;code&gt;emacs-lisp-mode&lt;/code&gt; major mode, type &lt;code&gt;def&lt;/code&gt; and hit &lt;kbd&gt;TAB&lt;/kbd&gt;. &#xA;&lt;ul&gt;&#xA;&lt;li&gt;Magic! You will see the &lt;code&gt;defun&lt;/code&gt; template inserted for you. This is because of the &lt;code&gt;# key: def&lt;/code&gt; line in the template for &lt;code&gt;defun&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Now by hitting &lt;kbd&gt;TAB&lt;/kbd&gt; consecutively, you cursor will jump through the positions labeled &lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt;, &lt;code&gt;$3&lt;/code&gt;, &lt;code&gt;$4&lt;/code&gt;, and finally end up at the &lt;code&gt;$0&lt;/code&gt; position.    &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you'd like to understand that template in more detail, I would suggest having a read of &lt;a href=&quot;http://cupfullofcode.com/snippet-expansion-with-yasnippet/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; tutorial by Matthew Keeler. It was very useful for me to help get started with &lt;code&gt;yasnippet&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="50" LastEditDate="2014-09-27T21:44:26.620" LastActivityDate="2014-09-27T21:44:26.620" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="377" PostTypeId="2" ParentId="374" CreationDate="2014-09-27T17:58:39.830" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;1) How shall I avoid creating a text file with mixed encodings when copying its different parts from different sources into an editor such as emacs?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Irrespective of the source, you can always set the encoding of a buffer by setting the variable &lt;code&gt;buffer-file-coding-system&lt;/code&gt;. An easy way to do this is via the keybinding &lt;code&gt;C-x RET f&lt;/code&gt; which prompts you for a file coding system.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;2)But when I open the file in emacs, there will be characters that can't be shown correctly. I wonder why emacs can't do that? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Gedit probably uses UTF-8 by default or has a different order of checking encodings where the right one is checked first. In emacs, you can always prefer UTF8 by setting &lt;code&gt;(prefer-coding-system 'utf-8)&lt;/code&gt;. This puts UTF-8 on top of the list used for detecting encoding of a buffer. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;3) Is it because the other parts with other encodings were altered as well? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, &lt;code&gt;C-x RET R&lt;/code&gt; runs &lt;code&gt;revert-buffer-with-coding-system&lt;/code&gt; which sets the coding system of the whole buffer to be &lt;code&gt;&amp;lt;found encoding&amp;gt;&lt;/code&gt; in your case. Emacs treats buffer encoding as a buffer-local-variable, which makes sense because a buffer/file can have only one encoding system. AFAIK the reason you cannot have two encoding systems is it is hard to detect where one ends and the other begins in a bitstream. You can use &lt;code&gt;C-x RET f&lt;/code&gt; to set the file-coding-system to a universal one such as UTF-8. &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-27T17:58:39.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="378" PostTypeId="2" ParentId="372" CreationDate="2014-09-27T18:51:57.217" Score="6" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;When I copy the text from the source to the emacs buffer ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;What you copy depends upon the application you are copying from. Some applications release UTF-8 encoded strings while others use different &lt;a href=&quot;http://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/CTEXT/ctext.html&quot; rel=&quot;noreferrer&quot;&gt;formats&lt;/a&gt;. Emacs uses the variable &lt;code&gt;selection-coding-system&lt;/code&gt; to determine whether to decide the encoding from the data or presume a particular encoding. See the documentation of &lt;code&gt;selection-coding-system&lt;/code&gt; for more details. Emacs has its own internal representation &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Representations.html#Text-Representations&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;utf-8-emacs&lt;/code&gt;&lt;/a&gt;, so any text insertion has an implicit conversion into this representation.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;When emacs write the buffer to a text file...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;For an unconfigured emacs, I believe emacs uses &lt;code&gt;select-safe-coding-system&lt;/code&gt; to determine a coding system or prompt the user if undecided. Here is an excerpt from the documentation of &lt;code&gt;select-safe-coding-system&lt;/code&gt; that determines when emacs prompts for a coding system choice.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/User_002dChosen-Coding-Systems.html#User_002dChosen-Coding-Systems&quot; rel=&quot;noreferrer&quot;&gt;Source&lt;/a&gt; (Formatting mine)&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;If &lt;code&gt;default-coding-system&lt;/code&gt; is non-nil, that is the first coding system to try; if that can handle the text, &lt;code&gt;select-safe-coding-system&lt;/code&gt; returns that coding system. It can also be a list of coding systems; then the function tries each of them one by one. After trying all of them, it next tries the current buffer's value of &lt;code&gt;buffer-file-coding-system&lt;/code&gt; (if it is not undecided), then the default value of &lt;code&gt;buffer-file-coding-system&lt;/code&gt; and finally the user's most preferred coding system, which the user can set using the command &lt;code&gt;prefer-coding-system&lt;/code&gt; (see Recognizing Coding Systems).&lt;/p&gt;&#xA;&lt;p&gt;If one of those coding systems can safely encode all the specified text, &lt;code&gt;select-safe-coding-system&lt;/code&gt; chooses it and returns it. Otherwise, it asks the user to choose from a list of coding systems which can encode all the text, and returns the user's choice.&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="108" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-09-27T18:51:57.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="379" PostTypeId="2" ParentId="371" CreationDate="2014-09-27T19:06:42.007" Score="12" Body="&lt;p&gt;Probably not what you asked for but assuming you have ssh setup with X-forwarding, you could start emacsclient on the server and forward it to remote DISPLAY. (Disclaimer: code typed directly into webform)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; local&amp;gt; ssh server -f emacsclient -c --display=$DISPLAY&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-27T19:06:42.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="380" PostTypeId="2" ParentId="371" CreationDate="2014-09-27T20:00:01.483" Score="25" Body="&lt;p&gt;You cannot use emacsclient to connect to an Emacs instance running on a remote computer.  This client-server concept is related to (local) processes, not network nodes.  However, you &lt;em&gt;can&lt;/em&gt; use various network technologies to log in to the remote computer, attach to an emacs server running there and display the emacsclient's screen locally.  Depending on the operating system that is used the networking could be done via SSH (terminal/X-Forwarding), VNC, RDP etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;:&lt;br&gt;&#xA;As some people pointed out, emacsclient actually does have an option to connect to the server via TCP.  However, emacsclient was never meant to be used remotely, the TCP socket option is required for compatibility with non-UNIX systems (i.e. operating systems where UNIX domain sockets are not available, like Windows).&lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="330" LastEditDate="2015-08-29T21:50:19.280" LastActivityDate="2015-08-29T21:50:19.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="381" PostTypeId="2" ParentId="371" CreationDate="2014-09-27T20:12:56.600" Score="8" Body="&lt;p&gt;This may be not what you want but just in case see if it can help you some way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually work inside a virtual machine bootstrapped with Vagrant, I have my &lt;code&gt;~/.emacs.d&lt;/code&gt; directory synced between my machine (local) and the virtual machine (remote) putting the following in the &lt;code&gt;Vagrantfile&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;config.vm.synced_folder &quot;~/.emacs.d&quot;, &quot;/home/vagrant/.emacs.d&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, my Emacs config automatically starts a server on startup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(setq server-use-tcp t&#xA;      server-socket-dir &quot;~/.emacs.d/server&quot;)&#xA;(unless (server-running-p)&#xA;    (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when I launch an Emacs server inside the virtual machine, I can connect to it with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh -Y -i ~/.vagrant.d/insecure_private_key &quot;&amp;lt;virtual machine hostname&amp;gt;&quot; 'emacsclient -c -f ~/.emacs.d/server/server'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;virtual machine hostname&lt;/strong&gt; is the hostname of the virtual machine I have configured in my ~/.ssh/config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host &amp;lt;virtual machine hostname&amp;gt;&#xA;  HostName 127.0.0.1&#xA;  User vagrant&#xA;  Port 2222&#xA;  UserKnownHostsFile /dev/null&#xA;  StrictHostKeyChecking no&#xA;  PasswordAuthentication no&#xA;  IdentityFile /home/anler/.vagrant.d/insecure_private_key&#xA;  IdentitiesOnly yes&#xA;  LogLevel FATAL&#xA;  ForwardAgent yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: Before launching the Emacs server inside the virtual machine I check that the &lt;code&gt;~/.emacs.d/server/server&lt;/code&gt; file is not present (if it is I just remove it) because otherwise it won't work.&lt;/p&gt;&#xA;" OwnerUserId="366" LastActivityDate="2014-09-27T20:12:56.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="382" PostTypeId="2" ParentId="375" CreationDate="2014-09-27T21:44:58.583" Score="3" Body="&lt;p&gt;The first thing to know is that Elisp has almost no special syntax--&lt;code&gt;defun&lt;/code&gt; is just an Elisp macro for defining functions. Its expansion is rather simple, as you can see from running a quick macroexpansion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'defun&#xA;  (function&#xA;   (lambda nil &quot;Insert defun function.&quot;&#xA;     (interactive)&#xA;     (insert &quot;(defun name () &#xA;  \&quot;Insert description here.\&quot;&#xA;)&quot;)&#xA;     (backward-char 35))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An important thing to note: the name of the function being defined in &lt;code&gt;defun&lt;/code&gt; is just an argument to a macro. Since &lt;code&gt;defun&lt;/code&gt; is a macro, it does not evaluate its arguments immediately. &lt;code&gt;defalias&lt;/code&gt;, on the other hand, &lt;em&gt;is&lt;/em&gt; a built-in function, so it takes a quoted version of the function name--otherwise it would try to evaluate the function name as a variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elisp is incredibly flexible, so it is more than happy to re-define &lt;code&gt;defun&lt;/code&gt; to be a function rather than a macro, which is what you did in your code, and for functions (unlike macros) all arguments are immediately evaluated. The error I got was slightly different than yours--I got &lt;code&gt;hello&lt;/code&gt; being undefined as a variable (I'm guessing your error was caused by some sort of byte-compilation or double-evaluation). Once you understand how function evaluation works in Elisp, this makes perfect sense--the interpreter first evaluates &lt;code&gt;hello&lt;/code&gt; as a variable in order to pass that value to the new function &lt;code&gt;defun&lt;/code&gt;. If &lt;code&gt;hello&lt;/code&gt; were defined, you would probably get a &quot;wrong number of arguments&quot; error instead (since your new version of &lt;code&gt;defun&lt;/code&gt; takes no arguments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The moral of the story: Elisp lets you do pretty much anything, but that doesn't mean you should. &lt;strong&gt;Never&lt;/strong&gt; re-define built-in functions or macros unless you want debugging hell.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-27T21:44:58.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="383" PostTypeId="1" CreationDate="2014-09-27T22:03:07.747" Score="32" ViewCount="814" Body="&lt;p&gt;In terms of functionality, what are the key points that presently distinguish XEmacs from GNU Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To account for the different release schedules the most recent development version of each Emacs flavor should be considered as the basis for comparison.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We should avoid arguments about historical/organizational/philosophical/... issues, so please only mention purely functional/technical differences.&lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="253" LastEditDate="2014-11-18T20:56:04.767" LastActivityDate="2017-01-17T09:01:48.340" Title="What functionality is missing in GNU Emacs when compared to XEmacs?" Tags="|xemacs|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="384" PostTypeId="1" AcceptedAnswerId="2287" CreationDate="2014-09-27T22:04:39.857" Score="2" ViewCount="256" Body="&lt;p&gt;When coding Android projects, resource variables are somewhat&#xA;cumbersome to define, as they involve visiting a file far away in the&#xA;directory structure and writing xml(!). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I want to define a string resource called &lt;code&gt;street&lt;/code&gt;. I'll need to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Visit &lt;code&gt;res/values/strings.xml&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;Type an xml entry like &lt;code&gt;&amp;lt;string name=&quot;street&quot;&amp;gt;VALUE&amp;lt;/string&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If the resource was a number or a list, it goes into another file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, this could all be done automatically. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I would write &lt;code&gt;R.string.street&lt;/code&gt; in java code (which already have to do anyway);&lt;/li&gt;&#xA;&lt;li&gt;Then I would just call this magic command;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The command could ask me for the &lt;code&gt;VALUE&lt;/code&gt; to use, and it could infer&#xA;everything else from the &lt;code&gt;R.string.street&lt;/code&gt; under point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a minor-mode or a command that will do this for me?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="330" LastEditDate="2014-09-27T23:46:01.483" LastActivityDate="2014-10-17T11:50:36.103" Title="Command to automatically define a resource variable in an Android project" Tags="|development|project|android|automation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="385" PostTypeId="2" ParentId="66" CreationDate="2014-09-27T22:43:10.877" Score="16" Body="&lt;h1&gt;&lt;a href=&quot;https://github.com/Bruce-Connor/aggressive-indent-mode/&quot;&gt;Aggressive Indent Mode&lt;/a&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Since some people asked for it, I turned this answer&#xA;&lt;a href=&quot;https://github.com/Bruce-Connor/aggressive-indent-mode/&quot;&gt;into a package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have Melpa configured, you can install it with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET aggressive-indent&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://github.com/Bruce-Connor/aggressive-indent-mode/&quot;&gt;Readme&lt;/a&gt; for all the options, but the&#xA;simplest way to turn it on is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;The Old Answer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The following does auto-indentation only on elisp buffers. It has advantage of also working when you erase or yank stuff (instead of just typing). It's easy to add to other modes as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function will indent whatever s-expression the point is currently inside.&#xA;You can bind it to a key if you'd like, but see below first.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun endless/indent-defun ()&#xA;  &quot;Indent current defun.&#xA;Do nothing if mark is active (to avoid deactivating it), or if&#xA;buffer is not modified (to avoid creating accidental&#xA;modifications).&quot;&#xA;  (interactive)&#xA;  (ignore-errors&#xA;    (unless (or (region-active-p)&#xA;                buffer-read-only&#xA;                (null (buffer-modified-p)))&#xA;      (let ((l (save-excursion (beginning-of-defun 1) (point)))&#xA;            (r (save-excursion (end-of-defun 1) (point))))&#xA;        (cl-letf (((symbol-function 'message) #'ignore))&#xA;          (indent-region l r))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This hook will make it so that this function will be run after you&#xA;type anything, but only in elisp buffers. This should keep everything&#xA;always indented.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook&#xA; 'emacs-lisp-mode-hook&#xA; (lambda ()&#xA;   (add-hook 'post-command-hook&#xA;             #'endless/indent-defun nil 'local)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try it! &lt;strong&gt;It works remarkably well.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, following @holocronweaver’s suggestion in the comments, you can use&#xA;something like the following for c-like languages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key c++-mode-map &quot;;&quot;&#xA;  (lambda () (interactive)&#xA;    (insert &quot;;&quot;)&#xA;    (endless/indent-defun)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-16T19:42:43.457" LastActivityDate="2014-10-16T19:42:43.457" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="386" PostTypeId="2" ParentId="383" CreationDate="2014-09-27T23:16:13.103" Score="27" Body="&lt;p&gt;As far as I can tell, there's mainly one feature that's been present in XEmacs for a very long time and that's still missing from GNU Emacs: &lt;a href=&quot;http://www.xemacs.org/Documentation/21.5/html/emodules_1.html&quot;&gt;dynamically loading modules written in C, or FFI&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this is regularly &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00538.html&quot;&gt;discussed&lt;/a&gt; on the emacs-devel mailing list, and there are no longer any objection to its implementation from the current maintainer, it's still a work in progress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of this writing, the integration of some additional features is actively postponed until such a thing as a proper FFI exists (for example, &lt;a href=&quot;http://comments.gmane.org/gmane.emacs.devel/174659&quot;&gt;json and yaml bindings&lt;/a&gt;), so one can reasonably expect that this last missing feature should be implemented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effectively, there are signs that code for this feature would now be welcome in the code base for Emacs 25 as long as they are disabled by default.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-27T23:16:13.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="387" PostTypeId="1" AcceptedAnswerId="409" CreationDate="2014-09-28T03:21:33.317" Score="3" ViewCount="1045" Body="&lt;p&gt;I open a LaTeX file in Emacs, and press &lt;code&gt;C-c C-p C-b&lt;/code&gt; (&lt;code&gt;M-x preview-buffer&lt;/code&gt;) to generate math/graphics previews for the entire buffer. I find that a PDF file is generated with each page containing a math formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then move cursor to the beginning of an equation, press &lt;code&gt;C-c C-p C-p&lt;/code&gt; (&lt;code&gt;M-x preview-at-point&lt;/code&gt;), but the equation gets folded up!  Here are screenshots before and after pressing &lt;code&gt;C-c C-p C-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/CrsVu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PrCAq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I using preview-latex correctly? Why is there no equation rendered for the first line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When moving cursor inside an align environment, I don't get a preview either, and it says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GPL Ghostscript 9.05: Unrecoverable error, exit code 1&#xA;Preview-PDF2DSC exited abnormally with code 1 at Sun Sep 28 10:19:53&#xA;PDF2DSC sentinel: Opening input file: no such file or directory,  ./_region_.prv/tmp19610wh0/preview.dsc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I installed AucTeX and TeXLive on my Ubuntu 12.04.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;TeXlive 2009-15&lt;/li&gt;&#xA;&lt;li&gt;AUCTeX 11.86-2ubuntu1&lt;/li&gt;&#xA;&lt;li&gt;preview-latex 11.86-2ubuntu1&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;TeX-PDF-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;After installing the latest auctex, the problem solved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when C-c C_p C-d, there is an error at the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(see the transcript file for additional information)&amp;lt;/usr/share/texmf-texlive/f&#xA;onts/type1/public/amsfonts/cm/cmbx12.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/&#xA;public/amsfonts/cm/cmex10.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/public/amsf&#xA;onts/cm/cmmi12.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmm&#xA;i6.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi8.pfb&amp;gt;&amp;lt;/usr&#xA;/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr12.pfb&amp;gt;&amp;lt;/usr/share/texmf&#xA;-texlive/fonts/type1/public/amsfonts/cm/cmr6.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/font&#xA;s/type1/public/amsfonts/cm/cmr8.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/publi&#xA;c/amsfonts/cm/cmsy10.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/public/amsfonts/&#xA;cm/cmsy6.pfb&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy8.pfb&#xA;&amp;gt;&amp;lt;/usr/share/texmf-texlive/fonts/type1/public/amsfonts/symbols/msbm10.pfb&amp;gt;&#xA;Output written on hw.pdf (135 pages, 204905 bytes).&#xA;Transcript written on hw.log.&#xA;&#xA;Preview-LaTeX exited as expected with code 1 at Sun Sep 28 17:21:07&#xA;LaTeX: LaTeX found no preview images&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When C-c C-p C-p, I can see the preview:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Preview-LaTeX exited as expected with code 1 at Sun Sep 28 17:22:06&#xA;Running `Preview-PDF2DSC' with ``pdf2dsc _region_.pdf _region_.prv/tmp32202-vH/preview.dsc''&#xA;&#xA;Preview-PDF2DSC finished at Sun Sep 28 17:22:07&#xA;Running `Preview-Ghostscript' with ``gs -dOutputFile\=\(_region_.prv/tmp32202-vH/pr1-\%d.png\) -q -dDELAYSAFER -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 -sDEVICE\=png16m -r96x96.0504''&#xA;&#xA;Preview-Ghostscript finished at Sun Sep 28 17:22:21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2014-09-28T21:26:04.560" LastActivityDate="2014-09-28T21:26:04.560" Title="Why does preview-latex not show some equations?" Tags="|auctex|preview-latex|" AnswerCount="1" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="388" PostTypeId="1" AcceptedAnswerId="389" CreationDate="2014-09-28T06:30:27.137" Score="8" ViewCount="2825" Body="&lt;p&gt;I have Ubuntu 12.04 running with Emacs 24.3.&#xA;On computer startup, &lt;code&gt;emacs --daemon&lt;/code&gt; is executed, and I have modified the &lt;code&gt;emacs24.desktop&lt;/code&gt; to take &lt;code&gt;emacsclient -c -a &quot;&quot;&lt;/code&gt; as exec parameter. However, whenever I try to open a file a new frame opens every time.&lt;br&gt;&#xA;&lt;strong&gt;Is there a way to make the file appear in a preexisting frame as a new buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &lt;em&gt;“open a file”&lt;/em&gt; I mean using either GUI file manager or using terminal by &lt;code&gt;emacsclient -nc [filename]&lt;/code&gt; or &lt;code&gt;emacsclient -nc -a &quot;&quot; [file]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT&lt;/em&gt;: What seems to be happening is that emacs is opening a new &quot;OS window&quot; (as in Emacs frame) with every file; however, I am able to access all the buffers in the same emacs frame. Still, having multiple emacs frames in irritating even though I don't have to switch through them. Closing the frame manually removes the buffer too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to suppress the behavior of opening the new frame every time?&lt;/p&gt;&#xA;" OwnerUserId="174" LastEditorUserId="25" LastEditDate="2014-09-28T11:46:14.633" LastActivityDate="2014-09-28T11:46:14.633" Title="How to prevent emacsclient starting a new frame every time?" Tags="|emacsclient|frames|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="389" PostTypeId="2" ParentId="388" CreationDate="2014-09-28T08:25:02.763" Score="9" Body="&lt;p&gt;Your included option of &lt;code&gt;-c&lt;/code&gt; is causing this. Per the man page,  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-c, --create-frame  create a new frame instead of trying to use  the  current Emacs frame. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Remove this option from your command and Emacs should refrain from creating a new frame (AKA Window).&lt;/p&gt;&#xA;" OwnerUserId="378" LastEditorUserId="50" LastEditDate="2014-09-28T09:02:46.573" LastActivityDate="2014-09-28T09:02:46.573" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="390" PostTypeId="1" AcceptedAnswerId="401" CreationDate="2014-09-28T09:24:58.857" Score="32" ViewCount="9056" Body="&lt;p&gt;&lt;em&gt;Note: This question was &lt;a href=&quot;https://stackoverflow.com/q/15407485/491532&quot;&gt;asked here&lt;/a&gt; before, with no success.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode’s ability to display inline images is fantastic for writing&#xA;my weekly scientific reports. I can include graphs, link them with&#xA;their data, link with the conclusions, and really harness the power of&#xA;org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only problem I have is that org needs the images to use&#xA;conventional image formats (jpeg, png, etc), while I prefer for my&#xA;graphs to be in PDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I display inline pdf images in org-mode?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My final objective is to just write a link like this in org-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:~/Work/grap.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And have it displayed inline just like it would happen if it were a png.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I know I could just have a copy of each graph in jpeg or something&#xA;(which is what I do right now), but it’s slightly cumbersome and it&#xA;always carries the risk of the pdf graph being updated and me&#xA;forgetting to update the jpeg.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2021-12-02T04:13:41.693" Title="Display PDF images in org-mode" Tags="|org-mode|pdf|images|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="391" PostTypeId="2" ParentId="364" CreationDate="2014-09-28T10:16:35.627" Score="4" Body="&lt;p&gt;In terms of Emacs initialization, don't make either choice. GitHub user jwiegley has the excellent &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot; title=&quot;use-package&quot;&gt;use-package&lt;/a&gt; declaration macro, that will require or autoload a package as determined by need. Best used to defer the loading of packages that can be loaded on-demand.&lt;/p&gt;&#xA;" OwnerUserId="378" LastActivityDate="2014-09-28T10:16:35.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="392" PostTypeId="1" AcceptedAnswerId="393" CreationDate="2014-09-28T13:08:08.620" Score="43" ViewCount="29703" Body="&lt;p&gt;I would like to change the cursor, like in Terminal, from the block to the I-Beam cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZsLhF.png&quot; alt=&quot;Block&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/eiue5.png&quot; alt=&quot;Ibeam&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, on a side note, how do I change the color of the cursor?&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2014-09-28T16:13:35.607" LastActivityDate="2023-05-16T18:16:54.277" Title="How to change the cursor type and color?" Tags="|cursor|customize|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="393" PostTypeId="2" ParentId="392" CreationDate="2014-09-28T13:08:08.620" Score="60" Body="&lt;p&gt;In order to change your cursor or caret, what you want to do is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open your .emacs file and this line of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default cursor-type 'bar) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And to change the color:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-cursor-color &quot;#ffffff&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, you can change &lt;code&gt;#ffffff&lt;/code&gt; to any hexadecimal  color.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-09-29T02:04:52.913" LastActivityDate="2014-09-29T02:04:52.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="394" PostTypeId="1" AcceptedAnswerId="398" CreationDate="2014-09-28T14:30:12.197" Score="1" ViewCount="450" Body="&lt;p&gt;In a dired buffer, how can I determine whether the file under the point, i.e. &lt;code&gt;(dired-get-file-for-visit)&lt;/code&gt;, is local or remote?  Is there something like &lt;code&gt;(dired-local-file-p)&lt;/code&gt; or maybe &lt;code&gt;(tramp-local-file-p file)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to call different functions for visiting local and remote files.&lt;/p&gt;&#xA;" OwnerUserId="330" LastActivityDate="2014-09-28T14:59:26.453" Title="dired: is file under point local or remote?" Tags="|dired|files|tramp|remote|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="395" PostTypeId="1" CreationDate="2014-09-28T14:39:12.023" Score="8" ViewCount="3694" Body="&lt;p&gt;I run emacs in two ways: One as a Mac OS X executable, built from source, and the other as a Linux executable using the Lucid toolkit, in daemon mode, connected to using a graphical emacscient using XQuartz on my mac laptop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My base configuration is currently Emacs Prelude, and it defines a set of key chords that use a &lt;kbd&gt;Super&lt;/kbd&gt; key, in addition to some &lt;kbd&gt;Meta&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt; chords. However, I cannot figure out how to send a &lt;kbd&gt;Super&lt;/kbd&gt; chord at all. This is true both on my OSX build and on my emacsclient/XQuartz setup. &lt;kbd&gt;Command&lt;/kbd&gt; sends Meta, &lt;kbd&gt;Option&lt;/kbd&gt; just sends literal keys (in the OSX way, it emits a subset of the extended Unicode space) and obviously &lt;kbd&gt;Shift&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt; do their usual thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how do I send super-prefixed key chords to my Emacs?&lt;/p&gt;&#xA;" OwnerUserId="380" LastEditorUserId="380" LastEditDate="2014-09-29T03:22:19.773" LastActivityDate="2023-08-09T15:04:54.283" Title="How can I send Super from my Mac to my Emacs instance?" Tags="|keymap|osx|x11|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="396" PostTypeId="2" ParentId="216" CreationDate="2014-09-28T14:42:14.683" Score="3" Body="&lt;p&gt;As @shosti pointed out, &lt;code&gt;eshell&lt;/code&gt; simply doesn't support any fancy escape sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However my problems with &lt;code&gt;brew&lt;/code&gt; can be fixed by resetting &lt;code&gt;fringe-mode&lt;/code&gt; and disabling &lt;code&gt;truncate-lines&lt;/code&gt; in &lt;code&gt;eshell&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This ensures characters don't wrap to the next line and that long lines (such as the progress bar) don't get covered by the &lt;code&gt;truncation&lt;/code&gt; glyph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried @kindahero suggestions about the scroll, but to no avail.&lt;/p&gt;&#xA;" OwnerUserId="43" LastActivityDate="2014-09-28T14:42:14.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="397" PostTypeId="2" ParentId="394" CreationDate="2014-09-28T14:45:43.300" Score="2" Body="&lt;p&gt;I realize you're asking to detect tramp buffers vs, say, files on a remote mounted filesystem, but for posterity this might be useful to other searchers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun buffer-is-on-local-fs-p ()&#xA;  (and (buffer-file-name)&#xA;       (let ((local-path (chomp (shell-command-to-string&#xA;                                 (concat &quot;df -l \&quot;&quot; (buffer-file-name) &quot;\&quot; | awk '/^Filesystem/ {next}; {print $6}'&quot;)))))&#xA;         (not (string= &quot;&quot; local-path)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This uses unix's &lt;code&gt;df&lt;/code&gt; to identify the filesystem hosting the full path of the current buffer, and then makes a best-effort to determine what its mount type is. It's not perfect, but it's served me pretty well (I used to use it to gate VC mode funcionality, which was painfully slow on remote filesystems).&lt;/p&gt;&#xA;" OwnerUserId="380" LastActivityDate="2014-09-28T14:45:43.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="398" PostTypeId="2" ParentId="394" CreationDate="2014-09-28T14:59:26.453" Score="2" Body="&lt;p&gt;If you simply want to know whether the file is accessed through a remote acces method, you can call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Magic-File-Names.html#index-file_002dremote_002dp-2047&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;file-remote-p&lt;/code&gt;&lt;/a&gt; (built into Emacs) or Tramp's similar function &lt;code&gt;tramp-handle-file-remote-p&lt;/code&gt;. Both functions return &lt;code&gt;nil&lt;/code&gt; for an actual file name and the method prefix (as a string) for a file accessed through a remote method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may or may not be what you're after. Files on a remote filesystem mounted by the operating system (NFS, Samba, Windows shares, SSHFS, etc.) will be reported as nil; you can &lt;a href=&quot;https://emacs.stackexchange.com/a/397&quot;&gt;call &lt;code&gt;df&lt;/code&gt; to get more information&lt;/a&gt; if you have unix tools available. Contrariwise, local files accessed through privilege escalation (e.g. &lt;code&gt;/sudo::&lt;/code&gt; or &lt;code&gt;/su::&lt;/code&gt;) are reported as non-nil. You can call &lt;code&gt;tramp-dissect-file-name&lt;/code&gt; and the &lt;code&gt;tramp-file-name-…&lt;/code&gt; function family (all defined in &lt;code&gt;tramp.el&lt;/code&gt;) if you want to analyze the method further.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-09-28T14:59:26.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="399" PostTypeId="2" ParentId="395" CreationDate="2014-09-28T15:05:23.260" Score="1" Body="&lt;p&gt;After a bit of digging, I located &lt;a href=&quot;http://xahlee.info/kbd/Mac_OS_X_keymapping_keybinding_tools.html&quot; rel=&quot;nofollow&quot;&gt;this page by Xah Lee&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cause of your problem is that your keyboard settings in OSX are not set for any key to send &lt;kbd&gt;Super&lt;/kbd&gt;. In order to send &lt;kbd&gt;Super&lt;/kbd&gt;, you need to change that. The document linked above has directions for doing so.&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2014-09-28T15:05:23.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="400" PostTypeId="2" ParentId="258" CreationDate="2014-09-28T15:21:41.290" Score="1" Body="&lt;p&gt;One solution is to turn off Trailing whitespace mode in Diff mode, and instead define your own custom font lock rules for the trailing whitespace that you don't want to see.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar diff-trailing-whitespace-keywords&#xA;  '((&quot;^[+-&amp;lt;&amp;gt;]\\(.*\\S \\)?\\(\\s +\\)$&quot; (2 'trailing-whitespace t))))&#xA;(defun diff-mode-font-lock-add-trailing-whitespace ()&#xA;  (setq diff-font-lock-keywords-and-whitespace&#xA;    (append diff-font-lock-keywords&#xA;        diff-trailing-whitespace-keywords))&#xA;  (setcar diff-font-lock-defaults 'diff-font-lock-keywords-and-whitespace))&#xA;(defun turn-off-trailing-whitespace ()&#xA;  (setq show-trailing-whitespace nil))&#xA;(add-hook 'diff-mode-hook 'turn-off-trailing-whitespace)&#xA;(eval-after-load &quot;diff-mode&quot; '(diff-mode-font-lock-add-trailing-whitespace))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-09-29T17:17:36.410" LastActivityDate="2014-09-29T17:17:36.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="401" PostTypeId="2" ParentId="390" CreationDate="2014-09-28T15:35:47.467" Score="17" Body="&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: You need to have ImageMagick installed on your system (&lt;code&gt;convert&lt;/code&gt; executable) for this solution to work. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;How this solution is implemented&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The function &lt;code&gt;org-include-img-from-pdf&lt;/code&gt; is the workhorse that does the PDF to Image format conversion using &lt;code&gt;convert&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If the org file contains &lt;code&gt;# ()convertfrompdf:t&lt;/code&gt;, it will be assumed that the user has a pdf file that they want to convert to an image file. The user should put the above &lt;em&gt;special comment&lt;/em&gt; above the image file link as shown in the below example.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The image file type is determined by the file extension in the bracket link &lt;code&gt;[[./myimage.EXT]]&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;By adding the &lt;code&gt;org-include-img-from-pdf&lt;/code&gt; function to the &lt;code&gt;before-save-hook&lt;/code&gt;, that function is executed every time the user saves the file (See the elisp snippet following the function definition below).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Example setup&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;In this example setup I have the following files:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;An org file like below that includes an image file.&lt;/li&gt;&#xA;&lt;li&gt;The pdf file &lt;code&gt;myimage.pdf&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;# ()convertfrompdf:t&#xA;[[./myimage.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Function to auto convert pdf to image files&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-include-img-from-pdf (&amp;amp;rest _)&#xA;  &quot;Convert pdf files to image files in org-mode bracket links.&#xA;&#xA;    # ()convertfrompdf:t # This is a special comment; tells that the upcoming&#xA;                         # link points to the to-be-converted-to file.&#xA;    # If you have a foo.pdf that you need to convert to foo.png, use the&#xA;    # foo.png file name in the link.&#xA;    [[./foo.png]]&#xA;&quot;&#xA;  (interactive)&#xA;  (if (executable-find &quot;convert&quot;)&#xA;      (save-excursion&#xA;        (goto-char (point-min))&#xA;        (while (re-search-forward &quot;^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t&quot;&#xA;                                  nil :noerror)&#xA;          ;; Keep on going to the next line till it finds a line with bracketed&#xA;          ;; file link.&#xA;          (while (progn&#xA;                   (forward-line 1)&#xA;                   (not (looking-at org-bracket-link-regexp))))&#xA;          ;; Get the sub-group 1 match, the link, from `org-bracket-link-regexp'&#xA;          (let ((link (match-string-no-properties 1)))&#xA;            (when (stringp link)&#xA;              (let* ((imgfile (expand-file-name link))&#xA;                     (pdffile (expand-file-name&#xA;                               (concat (file-name-sans-extension imgfile)&#xA;                                       &quot;.&quot; &quot;pdf&quot;)))&#xA;                     (cmd (concat &quot;convert -density 96 -quality 85 &quot;&#xA;                                  pdffile &quot; &quot; imgfile)))&#xA;                (when (and (file-readable-p pdffile)&#xA;                           (file-newer-than-file-p pdffile imgfile))&#xA;                  ;; This block is executed only if pdffile is newer than&#xA;                  ;; imgfile or if imgfile does not exist.&#xA;                  (shell-command cmd)&#xA;                  (message &quot;%s&quot; cmd)))))))&#xA;    (user-error &quot;`convert' executable (part of Imagemagick) is not found&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Hook setup to specify when to run this function&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-include-img-from-pdf-before-save ()&#xA;  &quot;Execute `org-include-img-from-pdf' just before saving the file.&quot;&#xA;    (add-hook 'before-save-hook #'org-include-img-from-pdf nil :local))&#xA;(add-hook 'org-mode-hook #'my/org-include-img-from-pdf-before-save)&#xA;&#xA;;; If you want to attempt to auto-convert PDF to PNG  only during exports, and not during each save.&#xA;;; (with-eval-after-load 'ox&#xA;;;   (add-hook 'org-export-before-processing-hook #'org-include-img-from-pdf))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/tree/master/elisp/org-include-img-from-pdf&quot; rel=&quot;noreferrer&quot;&gt;Code + MWE&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2017-04-05T12:25:34.183" LastActivityDate="2017-04-05T12:25:34.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="402" PostTypeId="2" ParentId="392" CreationDate="2014-09-28T16:10:21.863" Score="16" Body="&lt;p&gt;Cursor type can be set for a given &lt;strong&gt;buffer&lt;/strong&gt; (using buffer-local variable &lt;code&gt;cursor-type&lt;/code&gt;), as indicated in the answer by @King. (That answer uses &lt;code&gt;setq-default&lt;/code&gt; to set the default value for all buffers.)&lt;/p&gt;&#xA;&lt;p&gt;Or it can be set for a given &lt;strong&gt;frame&lt;/strong&gt;, as frame parameter &lt;code&gt;cursor-type&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can set it the default cursor type for all frames by adding it to option &lt;code&gt;default-frame-alist&lt;/code&gt;. For example add this item to the alist: &lt;code&gt;(cursor-type . bar)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here is a command (from library &lt;a href=&quot;https://www.emacswiki.org/emacs/oneonone.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;oneonone.el&lt;/a&gt; to set the cursor type for the current frame:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun 1on1-set-cursor-type (cursor-type)&#xA;  &amp;quot;Set the cursor type of the selected frame to CURSOR-TYPE.&#xA;When called interactively, prompt for the type to use.&#xA;To get the frame's current cursor type, use `frame-parameters'.&amp;quot;&#xA;  (interactive&#xA;   (list (intern (completing-read&#xA;                   &amp;quot;Cursor type: &amp;quot;&#xA;                   (mapcar 'list '(&amp;quot;box&amp;quot; &amp;quot;hollow&amp;quot; &amp;quot;bar&amp;quot; &amp;quot;hbar&amp;quot; nil))))))&#xA;  (modify-frame-parameters (selected-frame) (list (cons 'cursor-type cursor-type))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Cursor &lt;em&gt;color&lt;/em&gt; is always per-&lt;em&gt;frame&lt;/em&gt;, not per-buffer.&lt;/p&gt;&#xA;&lt;p&gt;(In library &lt;code&gt;oneonone.el&lt;/code&gt; you will also find options to automatically change the cursor type when you switch a buffer between read-only and writable, or between overwrite mode and insert mode, or to change the type to a box cursor (more noticeable) when Emacs is idle.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="14825" LastEditDate="2023-04-05T02:30:40.507" LastActivityDate="2023-04-05T02:30:40.507" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="403" PostTypeId="2" ParentId="395" CreationDate="2014-09-28T16:57:45.093" Score="5" Body="&lt;p&gt;You might want to have a look at the various &lt;code&gt;ns-*-modifier&lt;/code&gt;, like &lt;code&gt;ns-alternate-modifier&lt;/code&gt; (for &lt;kbd&gt;Option&lt;/kbd&gt;) or &lt;code&gt;ns-command-modifier&lt;/code&gt; (for &lt;kbd&gt;Command&lt;/kbd&gt;). They allow to map the native OSX keys to arbitrary modifiers. Note that there exists a &lt;code&gt;ns-function-modifier&lt;/code&gt; which is quite handy for laptops.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That should solve the native OSX Emacs part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for XQuartz, without testing at all, I would assume that you might get away with some &lt;code&gt;xmodmap&lt;/code&gt; invocation, along the line of &lt;code&gt;xmodmap -e 'add Mod2 = Super_L Super_R'&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-28T16:57:45.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="404" PostTypeId="1" CreationDate="2014-09-28T18:41:53.567" Score="4" ViewCount="105" Body="&lt;p&gt;When I download and install auctex, I read that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The simplest way of installing AUCTeX is by using the Emacs package&#xA;  manager integrated in Emacs 24 and greater (ELPA).  Simply do &lt;code&gt;M-x package-list-packages RET&lt;/code&gt;, mark the auctex package for installation with &lt;code&gt;i&lt;/code&gt;, and hit &lt;code&gt;x&lt;/code&gt; to execute the installation procedure.  That's&#xA;  all.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The remainder of this section is about installing AUCTeX from a&#xA;  release tarball or from a checkout of the AUCTeX repository.&#xA;     Installing AUCTeX should be simple: merely &lt;code&gt;./configure&lt;/code&gt;, &lt;code&gt;make&lt;/code&gt;,&#xA;  and &lt;code&gt;make install&lt;/code&gt; for a standard site-wide installation (most other installations can be done by specifying a &lt;code&gt;--prefix=...&lt;/code&gt; option).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In both ways, what compiler(s) are used? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first approach, the output of installation said&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Compiling file /home/tim/.emacs.d/elpa/auctex-11.87.7/auctex-pkg.el at Sun Sep 28 14:29:44 2014&#xA;Entering directory `/home/tim/.emacs.d/elpa/auctex-11.87.7/'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the second approach, I searched in the Makefile, and don't find gcc or g++.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="50" LastEditDate="2014-10-13T23:26:12.377" LastActivityDate="2014-10-13T23:26:12.377" Title="What compilers are used during installation of a package?" Tags="|package|byte-compilation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="405" PostTypeId="2" ParentId="404" CreationDate="2014-09-28T18:59:11.623" Score="8" Body="&lt;p&gt;The compilation you refer to is usually called byte-compilation of emacs lisp. It generates a different and faster representation of functions for the emacs interpreter. Unlike compilation of C code using gcc where the resulting code is run directly by the hardware, byte-compiled code still needs the Emacs interpreter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs comes with a native compiler that can natively byte-compile an emacs lisp file. If you see the makefile, you should see a reference to &lt;code&gt;emacs --batch&lt;/code&gt; which is calling emacs in non-interactive mode to convert &lt;code&gt;.el&lt;/code&gt; files to byte-code. Interactively, you can achieve the same behavior using &lt;code&gt;byte-compile-file&lt;/code&gt; or &lt;code&gt;byte-compile-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more about &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Byte-Compilation.html#Byte-Compilation&quot;&gt;byte-compilation&lt;/a&gt; from the manual.   &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-28T18:59:11.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="406" PostTypeId="1" CreationDate="2014-09-28T19:07:47.537" Score="5" ViewCount="590" Body="&lt;p&gt;With AUCTeX and preview-latex, I can see the preview of math equations with &lt;code&gt;C-c C-p C-p&lt;/code&gt;. But I can't see its LaTeX code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder how can I see both the code and preview of math equations at the same time, for WYSIWYG editing?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="25" LastEditDate="2014-09-28T19:27:58.177" LastActivityDate="2016-04-05T14:14:16.083" Title="See LaTeX code and math preview at the same time with preview-latex" Tags="|auctex|preview-latex|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="407" PostTypeId="2" ParentId="404" CreationDate="2014-09-28T19:10:41.383" Score="4" Body="&lt;p&gt;In both cases, the compiler used is Emacs itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When installing from ELPA, most of the build process is handled by &lt;code&gt;package.el&lt;/code&gt;, therefore by the running instance of Emacs. &lt;code&gt;package.el&lt;/code&gt; also loads directly the product of this build process, so that the package becomes immediately available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Makefile-based approach, we have repeated calls to an external Emacs process. This can be seen in the Makefile with the following snippet&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELCC=$(EMACS) -batch -q -no-site-file -no-init-file -l lpath.el&#xA;...&#xA;lisp:   tex-site.el $(AUCSRC) $(STYLESRC) $(MULESRC)&#xA;    $(ELCC) -f batch-byte-compile $(AUCSRC) $(STYLESRC) $(MULESRC)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-28T19:20:29.757" LastActivityDate="2014-09-28T19:20:29.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="408" PostTypeId="1" AcceptedAnswerId="410" CreationDate="2014-09-28T19:29:29.197" Score="63" ViewCount="8807" Body="&lt;p&gt;I use emacs in different places and I want to have a similar setup and packages installed everywhere. I guess I can use a version control repository for the setup files. Since I use &lt;a href=&quot;https://prelude.emacsredux.com/&quot; rel=&quot;noreferrer&quot;&gt;Prelude&lt;/a&gt;, that would be &lt;code&gt;~/.emacs.d/personal/&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how to do with packages. Is there a file somewhere in &lt;code&gt;.emacs.d/&lt;/code&gt; with the list of installed packages that I can use to make emacs in other machines to also install those listed there? &lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="10825" LastEditDate="2019-10-04T19:46:04.660" LastActivityDate="2021-05-01T03:30:11.323" Title="Synchronize packages between different machines" Tags="|init-file|package|version-control|" AnswerCount="12" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="409" PostTypeId="2" ParentId="387" CreationDate="2014-09-28T19:34:26.343" Score="3" Body="&lt;p&gt;Auctex 11.86 has known issues with Ghostscript ver &gt;=9.0. Either downgrading ghostscript or updating Auctex will fix the issue.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-28T19:34:26.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="410" PostTypeId="2" ParentId="408" CreationDate="2014-09-28T19:44:40.917" Score="52" Body="&lt;p&gt;&lt;strong&gt;For emacs 25 or newer &lt;a href=&quot;https://emacs.stackexchange.com/a/10961/23&quot;&gt;refer to this answer&lt;/a&gt;&lt;/strong&gt;. For emacs &amp;lt; 25 there's no automatically generated manifest file that you can synchronize to achieve the desired effect.&lt;/p&gt;&#xA;&lt;p&gt;That said, something you can do is add calls to &lt;code&gt;package-install&lt;/code&gt; in your emacs configuration itself.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(package-install 'auctex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The idea is that &lt;code&gt;package-install&lt;/code&gt; is idempotent, so if the package is already present, nothing will actually happen.&#xA;Assuming you have such a call for every package you use (or at least the leaves in the dependency graph), that would effectively synchronize your packages across machines.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;For multiple packages you can use the following:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq my-package-list '(package1 package2 packageN))&#xA;(mapc #'package-install my-package-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastEditorUserId="33634" LastEditDate="2021-05-01T03:30:11.323" LastActivityDate="2021-05-01T03:30:11.323" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="411" PostTypeId="1" AcceptedAnswerId="523" CreationDate="2014-09-28T20:13:33.487" Score="9" ViewCount="1222" Body="&lt;p&gt;I installed auctex from Ubuntu's software center, and then I installed a newer version of auctex from emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then uninstalled the auctex installed by Ubuntu's software center. I found that it didn't uninstall the one I installed from emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does emacs manage its packages?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there no interference between emacs and Ubuntu in managing installation and uninstallation of emacs packages?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am correct, a few years ago, there was no way to install packages within emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="50" LastEditDate="2014-10-13T23:26:39.573" LastActivityDate="2017-07-13T07:48:06.490" Title="How does emacs manage its packages?" Tags="|package|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="412" PostTypeId="1" AcceptedAnswerId="414" CreationDate="2014-09-28T20:48:47.307" Score="4" ViewCount="3170" Body="&lt;p&gt;I am running Emacs in Gnome-terminal on Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I know to copy and paste between emacs and other applications is by &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;C&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;V&lt;/kbd&gt;, which I think is by the terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A problem with that is it will copy the line continuation symbol &lt;code&gt;\&lt;/code&gt; in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that flawlessly? Can you explain why your way works? Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw, I asked &lt;a href=&quot;https://unix.stackexchange.com/q/126577/674&quot;&gt;a similar question&lt;/a&gt; with output of less, which I heard uses vi. If possible, could you also take a look at it?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2022-05-13T14:25:45.147" Title="Copy and paste between Emacs in an X terminal and other X applications" Tags="|copy-paste|terminal-emacs|x11|clipboard|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="413" PostTypeId="1" AcceptedAnswerId="449" CreationDate="2014-09-28T21:25:21.427" Score="49" ViewCount="35182" Body="&lt;p&gt;I love dired, but sometimes (particularly when filming screencasts) I want to see the tree-structure of a directory and its children, a la the tree(1) command. Is there a tree-oriented directory browser for Emacs?&lt;/p&gt;&#xA;" OwnerUserId="387" LastActivityDate="2021-06-17T07:25:36.297" Title="Tree-based directory browser?" Tags="|dired|directories|" AnswerCount="7" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="414" PostTypeId="2" ParentId="412" CreationDate="2014-09-28T21:39:36.380" Score="7" Body="&lt;p&gt;You can use the external utilities &lt;a href=&quot;http://www.vergenet.net/%7Econrad/software/xsel/&quot; rel=&quot;nofollow noreferrer&quot;&gt;xsel&lt;/a&gt; or &lt;a href=&quot;http://xclip.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;xclip&lt;/a&gt; (they have mostly the same features, I'll use xsel in this answer) to copy data from or to the X clipboard. To copy to the clipboard, pass the desired content on standard input. When pasting from the clipboard, the content is written to standard output.&lt;/p&gt;&#xA;&lt;p&gt;To copy the selection to the X clipboard, use &lt;code&gt;M-| xsel -bi RET&lt;/code&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Shell.html#Shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;shell-command-on-region&lt;/code&gt;&lt;/a&gt;). If you want to copy to the X selection (which can be pasted with the middle mouse button), use &lt;code&gt;xsel -i&lt;/code&gt;. To paste from the X selection, you can use the middle mouse button or &lt;code&gt;M-1 M-! xsel -o RET&lt;/code&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Shell.html#Shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;shell-command&lt;/code&gt;&lt;/a&gt; with a prefix argument to insert the output into the current buffer); make that &lt;code&gt;xsel -bo&lt;/code&gt; to insert the clipboard content.&lt;/p&gt;&#xA;&lt;p&gt;If you want to copy and paste automatically to the X selection or clipboard (when available) when running in a terminal under X, like what happens when running in an X window, you can set the variables &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Kill-Ring.html#index-interprogram_002dcut_002dfunction-2885&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;interprogram-cut-function&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Kill-Ring.html#index-interprogram_002dpaste_002dfunction-2885&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;interprogram-paste-function&lt;/code&gt;&lt;/a&gt; to functions that call &lt;code&gt;xsel&lt;/code&gt;. Here's some minimally-tested code to automatically copy to the X clipboard when running in a text terminal under X.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-x-environment (&amp;amp;rest body)&#xA;  `(let ((process-environment&#xA;            (cons (concat &amp;quot;DISPLAY=&amp;quot; (getenv &amp;quot;DISPLAY&amp;quot; (selected-frame)))&#xA;                  process-environment)))&#xA;     (if (getenv &amp;quot;XAUTHORITY&amp;quot; (selected-frame))&#xA;          (setq process-environment&#xA;                       (cons (concat &amp;quot;XAUTHORITY=&amp;quot; (getenv &amp;quot;XAUTHORITY&amp;quot; (selected-frame)))&#xA;                                  process-environment)))&#xA;     ,@body))&#xA;(defun x-terminal-copy (text)&#xA;  (with-temp-buffer&#xA;    (insert text)&#xA;    (with-x-environment&#xA;     (call-process-region (point-min) (point-max) &amp;quot;xsel&amp;quot; nil nil nil &amp;quot;-bi&amp;quot;))))&#xA;(defadvice x-select-text&#xA;  (before x-select-text-in-tty activate)&#xA;  &amp;quot;Use xsel to copy to the X clipboard when running in a terminal under X.&amp;quot;&#xA;  (when (and (eq (framep (selected-frame)) t)&#xA;                  (getenv &amp;quot;DISPLAY&amp;quot; (selected-frame)))&#xA;    (x-terminal-copy text)))&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you want automatic pasting as well, the following code should do it, but in a possibly annoying way: it always considers the X clipboard to be newer than Emacs's internal buffers, so it will always paste from X. You may find it more convenient to bind X pasting to a different key instead.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun x-terminal-paste ()&#xA;  (with-temp-buffer&#xA;    (with-x-environment&#xA;     (call-process &amp;quot;xsel&amp;quot; nil t nil &amp;quot;-bo&amp;quot;))))&#xA;(defadvice x-cut-buffer-or-selection-value&#xA;  (before x-cut-buffer-or-selection-value-in-tty activate)&#xA;  &amp;quot;Use xsel to paste from the X clipboard when running in a terminal under X.&amp;quot;&#xA;  (when (and (eq (framep (selected-frame)) t)&#xA;                  (getenv &amp;quot;DISPLAY&amp;quot; (selected-frame)))&#xA;    (x-terminal-paste text)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="31398" LastEditDate="2022-05-13T14:25:45.147" LastActivityDate="2022-05-13T14:25:45.147" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="415" PostTypeId="2" ParentId="413" CreationDate="2014-09-28T21:40:27.660" Score="25" Body="&lt;p&gt;There are a couple of options for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check out &lt;a href=&quot;https://github.com/zk/emacs-dirtree&quot;&gt;dirtree&lt;/a&gt;, which is based on dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also an emacs port of vim's NERDTree called &lt;a href=&quot;https://github.com/jaypei/emacs-neotree&quot;&gt;neotree&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both are excellent packages, though I tend to favor neotree as it has convenient bindings to let me create and delete files and directories.  I do not believe dirtree has this support, though I could be wrong.  It has been a while since I last used it.&lt;/p&gt;&#xA;" OwnerUserId="327" LastActivityDate="2014-09-28T21:40:27.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="416" PostTypeId="2" ParentId="411" CreationDate="2014-09-28T21:44:56.223" Score="10" Body="&lt;p&gt;Emacs uses the &lt;code&gt;load-path&lt;/code&gt;, which is essentially a list of directories it should search for Lisp files.  If a package is available in the &lt;code&gt;load-path&lt;/code&gt; then it is &lt;em&gt;installed&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no interface between the Debian/Ubuntu package manager and the Emacs package manager (package.el).  The former installs Emacs packages in a system-wide fashion (available to every user of the computer) while the latter installs a package by default under your home directory.  Theoretically you can use both sources to install packages.  However, I would advise against this practice: You might experience some issues when you install the &lt;em&gt;same&lt;/em&gt; package from both sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The list of Emacs packages you can install through the Debian/Ubuntu package manager is much more limited when compared to ELPA/MELPA/..., because each package has to be prepared specifically for Debian/Ubuntu. In other words: package on ELPA != package in Debian.&lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="330" LastEditDate="2014-09-28T23:16:58.150" LastActivityDate="2014-09-28T23:16:58.150" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="417" PostTypeId="1" CreationDate="2014-09-28T21:53:35.520" Score="3" ViewCount="188" Body="&lt;p&gt;I love helm and try to utilize it whenever possible.  Naturally, I have bound &lt;kbd&gt;M-x&lt;/kbd&gt; to &lt;code&gt;M-x-helm&lt;/code&gt;.  For the most part, this has not caused any problems for me.  However, I have noticed that it appears to be interfering with &lt;code&gt;sql-sqlite&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to execute this command, it prompts me for the path to the sqlite database.  Normally, helm allows me to traverse the directory structure and find the file I would like.  But when it comes to &lt;code&gt;sql-sqlite&lt;/code&gt;, it limits me to the files in the current directory.  If I try to manually type in the path, I just get the error &quot;No Match&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I instead run &lt;code&gt;execute-extended-command&lt;/code&gt;, I am able to navigate to the appropriate path and proceed without issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone else experienced this problem before, or have recommendations on how to address / debug it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure that it matters, but &lt;a href=&quot;https://github.com/keelerm84/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;here is my configuration&lt;/a&gt; and a link to the &lt;a href=&quot;https://github.com/keelerm84/.emacs.d/blob/master/customizations/setup-helm.el&quot; rel=&quot;nofollow&quot;&gt;relevant helm setup&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="327" LastActivityDate="2014-09-28T21:53:35.520" Title="M-x-helm Interfering with sql-sqlite" Tags="|helm|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="418" PostTypeId="1" AcceptedAnswerId="419" CreationDate="2014-09-28T22:15:27.527" Score="6" ViewCount="4444" Body="&lt;p&gt;How can I configure Emacs to set the default input method for all new buffers? I'd like to use &lt;code&gt;polish-slash&lt;/code&gt; everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Emacs 24.3.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in a solution which could be pasted into &lt;code&gt;init.el&lt;/code&gt; so I can easily reuse this config between my machines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using just &lt;code&gt;(setq default-input-method &quot;polish-slash&quot;)&lt;/code&gt; in &lt;code&gt;init.el&lt;/code&gt; does not work for me:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v default-input-method&lt;/code&gt; returns &lt;code&gt;&quot;polish-slash&quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v current-input-method&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; in probably any buffer. I checked &lt;code&gt;init.el&lt;/code&gt; and &lt;code&gt;*scratch*&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="390" LastEditorUserId="25" LastEditDate="2014-09-29T17:14:54.047" LastActivityDate="2014-09-29T17:14:54.047" Title="Setting and activating the default input method" Tags="|init-file|input-method|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="419" PostTypeId="2" ParentId="418" CreationDate="2014-09-28T22:24:29.733" Score="8" Body="&lt;h2&gt;Setting &lt;code&gt;default-input-method&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In the Customize interface (&lt;code&gt;M-x customize&lt;/code&gt; or “Options” → “Customize Emacs” → “Top-level Cutomization Group”), navigate to “Environment” → “I18n” → “MULE”. Set the “Default Input Method”: choose “String” in the value menu, and set the string to &lt;code&gt;polish-slash&lt;/code&gt;. Use the “State” button to set the value for the current session or to save it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also reach this Customize setting &lt;code&gt;M-x customize-variable&lt;/code&gt; or through the menu “Options” → “Customize Emacs” → “Specific Option”, then entering &lt;code&gt;default-input-method&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, set the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html#Select-Input-Method&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;default-input-method&lt;/code&gt;&lt;/a&gt; variable in your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-input-method &quot;polish-slash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once this is done, &lt;code&gt;polish-slash&lt;/code&gt; will be the default input method. However, by default, no input method is active (which is different, internally, from some kind of “none” or “pass-through” input method). The default input method is the one that gets activated by typing &lt;code&gt;C-\&lt;/code&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;toggle-input-method&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Activating the input method by default&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you want the input method to be turned on by default, you need an additional step. I can't find a high-level way to do it. One low-level way is to add the following lines to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar use-default-input-method t)&#xA;(make-variable-buffer-local 'use-default-input-method)&#xA;(defun activate-default-input-method ()&#xA;  (interactive)&#xA;  (if use-default-input-method&#xA;      (activate-input-method default-input-method)&#xA;    (inactivate-input-method)))&#xA;(add-hook 'after-change-major-mode-hook 'activate-default-input-method)&#xA;(add-hook 'minibuffer-setup-hook 'activate-default-input-method)&#xA;(defun inactivate-default-input-method ()&#xA;  (setq use-default-input-method nil))&#xA;(add-hook 'c-mode-hook 'inactivate-default-input-method)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;use-default-input-method&lt;/code&gt; and the function &lt;code&gt;inactivate-default-input-method&lt;/code&gt; provide a way to turn off the input method (it may be annoying e.g. in programming modes). If you want to turn off the default method in some modes, you register the function &lt;code&gt;inactivate-default-input-method&lt;/code&gt; in that mode's startup hook, as in the example above for C mode and derived modes (C++, Java, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code above systematically turns on the default input method in the minibuffer (comment out that line to have it off by default). Smarter code might use the same input method or lack thereof as the buffer that was previously active, or might choose an input method depending on what the minibuffer is prompted for (e.g. used for search strings but not for file names), but I declare this beyond the scope of this answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you prefer to whitelist modes where the input method is automatically activated, add the function &lt;code&gt;activate-default-input-method&lt;/code&gt; below to these modes' startup hook, as in the example below for Text mode and derived modes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun activate-default-input-method ()&#xA;  (interactive)&#xA;  (activate-input-method default-input-method))&#xA;(add-hook 'text-mode-hook 'activate-default-input-method)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-09-29T17:13:40.060" LastActivityDate="2014-09-29T17:13:40.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="420" PostTypeId="1" CreationDate="2014-09-29T00:54:55.857" Score="2" ViewCount="359" Body="&lt;p&gt;If I am correct, emacs is both an editor and an interpreter (or compiler?) of the elisp language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is emacs &lt;code&gt;init.el&lt;/code&gt; used for emacs as an editor or as an interpreter of elisp?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If we use Emacs as an editor, the its init.el can be seen as the configuration file for this software.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If we use Emacs with the &lt;code&gt;--batch&lt;/code&gt; option, is it similar to what .bashrc is for bash as an interpreter of bash language? Does the &lt;code&gt;init.el&lt;/code&gt; get loaded then?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="120" LastEditorUserId="50" LastEditDate="2014-10-03T16:17:09.410" LastActivityDate="2014-12-02T00:02:34.730" Title="Is init.el used for emacs, when emacs is viewed as an editor or as an interpreter of elisp?" Tags="|elisp|init-file|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="421" PostTypeId="2" ParentId="420" CreationDate="2014-09-29T01:02:17.733" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is emacs init.el used for emacs as an editor or as an interpreter of elisp?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The emacs init file contains personal elisp code that you want to execute when you start emacs.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is it similar to what .bashrc is for bash as an interpreter of bash language?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;.bashrc contains personal bash code that you want to execute when you start your shell.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;does Python also has something such as init.py, for preloading some packages when starting the interpreter?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;.pythonrc contains personal python code that you want to execute when you start your python shell &lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-09-29T01:09:58.303" LastActivityDate="2014-09-29T01:09:58.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="422" PostTypeId="2" ParentId="420" CreationDate="2014-09-29T01:03:27.870" Score="1" Body="&lt;p&gt;Emacs is an interpreter of Elisp with some interactive features around text editing. That is all. The text editing capabilities are best thought of as an Elisp &quot;program&quot; (with other &quot;programs&quot; being things like GNUS). Thus, your second definition (equivalent of .bashrc) is the correct one--init.el contains actual code that is executed on startup, not &quot;configuration&quot; in the sense of my.conf or similar.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-09-29T01:03:27.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="423" PostTypeId="1" AcceptedAnswerId="424" CreationDate="2014-09-29T01:39:12.533" Score="11" ViewCount="267" Body="&lt;p&gt;There are a number of Emacs buffers where their names have &quot;earmuffs&quot;, i.e. they have names like&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;*scratch*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;*R*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;*ESS*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;*helm-mode-circe*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the significance of the earmuffs, and is there a reason for users creating buffers to use them?&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2014-09-29T02:17:44.180" Title="What is the significance of Emacs buffers having names with *earmuffs*?" Tags="|buffers|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="424" PostTypeId="2" ParentId="423" CreationDate="2014-09-29T01:55:34.160" Score="14" Body="&lt;p&gt;By convention, those special names are used for buffers that are not associated directly to a file, but are used to provide the user with a view of some activity that happens in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amongst other things this includes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;emacs-lisp evaluation buffers&lt;/li&gt;&#xA;&lt;li&gt;buffers for interaction with sub-processes&lt;/li&gt;&#xA;&lt;li&gt;network-related buffers (IRC, messages, ...)&lt;/li&gt;&#xA;&lt;li&gt;buffers that aggregate content spanning multiple files (various help systems)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that there is another category of buffers that's more specifically internal: those following the &lt;code&gt;*pattern*&lt;/code&gt; (with a leading space). These buffers are of the same kind, but are deemed generally uninteresting to the user, thus are completely hidden by default in buffer listings and completions. Some debug and trace buffers fall under that category.&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-29T02:17:44.180" LastActivityDate="2014-09-29T02:17:44.180" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="425" PostTypeId="1" CreationDate="2014-09-29T02:05:33.003" Score="10" ViewCount="1006" Body="&lt;p&gt;When opening a new file whose parent directory doesn't exist yet, I  either open a shell window, or an Emacs shell buffer, and then &lt;code&gt;mkdir&lt;/code&gt; the directory in it. I find this cumbersome. Is there an easier way?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="25" LastEditDate="2014-09-29T18:14:10.723" LastActivityDate="2019-03-01T05:12:02.493" Title="Opening a new file whose parent directory doesn't exist yet" Tags="|files|directories|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="426" PostTypeId="2" ParentId="425" CreationDate="2014-09-29T02:08:11.847" Score="1" Body="&lt;p&gt;When in this situation, emacs should have told you something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;use M-x make-directory RET RET to create the directory and its parents&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is it cumbersome? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'll say, yes it is.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-09-29T02:08:11.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="427" PostTypeId="2" ParentId="425" CreationDate="2014-09-29T02:11:15.520" Score="16" Body="&lt;p&gt;You don't need to do that, if that's your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x C-f /some/new/directory/newfile.txt&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs prints a message to let you know that the directory &lt;code&gt;/some/new/directory/&lt;/code&gt; does not yet exist: &lt;code&gt;Use M-x make-directory RET RET to create the directory and its parents&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Insert text into the new buffer for new file &lt;code&gt;newfile.txt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x C-s&lt;/code&gt; to save the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs asks you whether you want to create the missing intermediate directories (e.g., &lt;code&gt;new/directory/&lt;/code&gt;.  You hit &lt;code&gt;y&lt;/code&gt; for &quot;yes&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not very cumbersome, IMO.  The UI needs to ask you for confirmation, because you could easily have mistyped the name of an existing directory.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-29T02:11:15.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="428" PostTypeId="1" CreationDate="2014-09-29T02:35:54.583" Score="11" ViewCount="3415" Body="&lt;p&gt;I'm trying to make &lt;a href=&quot;https://github.com/tkf/emacs-ipython-notebook&quot;&gt;EIN&lt;/a&gt; work within Emacs, but right now (with IPython 2) it seems that it's not possible. This errors arise:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;REQUEST [error] Error from parser ein:json-read: (json-readtable-error)&#xA;ein: [error] Error (parse-error) while opening notebook list at the server 8888.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But while trying to solve this problem I started to wonder if there is really any advantage of using the notebook over an IPython shell with all the added functionality that Emacs gives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is: which are the advantages of using EIN over the IPython shell inside Emacs? Is there a way to save an IPython session to a file?&lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="25" LastEditDate="2014-09-29T13:20:38.107" LastActivityDate="2017-05-28T16:03:51.977" Title="Emacs EIN vs IPython shell" Tags="|ipython|ein|python|repl|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="429" PostTypeId="2" ParentId="420" CreationDate="2014-09-29T02:37:05.787" Score="13" Body="&lt;p&gt;To supplement what others have said about Emacs the editor and its relation to Emacs Lisp, &lt;em&gt;Emacs as an editor works this way:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keys you hit or mouse actions you make are bound to interactive Emacs-Lisp functions called &lt;em&gt;commands&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely, key &lt;em&gt;sequences&lt;/em&gt; are bound to commands. A key sequence might be just hitting one keyboard key. Or it might be hitting multiple keys, either together as a chord (using modifier keys such as Control and Shift) or sequentially.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Key sequences that are not bound to commands are either ignored or have a default effect - typically raising an error telling you that that key sequence is not bound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is worth repeating that this is pretty much &lt;em&gt;all&lt;/em&gt; that Emacs does.  Even when you type the letter &lt;code&gt;a&lt;/code&gt; by hitting the &lt;code&gt;a&lt;/code&gt; key, to insert an &lt;code&gt;a&lt;/code&gt; in a text buffer, an Emacs command is invoked: the command named &lt;code&gt;self-insert-command&lt;/code&gt;. In a nutshell: &lt;strong&gt;Everything you do in Emacs amounts to invoking Lisp functions by hitting keys.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The keyboard keys that you typically think of as entering text (&lt;code&gt;a&lt;/code&gt;, &lt;code&gt;K&lt;/code&gt;, &lt;code&gt;9&lt;/code&gt;, &lt;code&gt;%&lt;/code&gt;, etc.) are generally bound to command &lt;code&gt;self-insert-command&lt;/code&gt; in contexts where text insertion makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other contexts, the same key might be bound to another command.  For example, in the Emacs directory editor (mode Dired), the key &lt;code&gt;a&lt;/code&gt; reads a file name and then visits that file.  In still other contexts, the same key (e.g. &lt;code&gt;a&lt;/code&gt;) might not be bound, and Emacs tells you so when you hit it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can think of Emacs as an interpreter of Emacs Lisp.  Or you can think of Emacs as a bunch of bindings of keys to Emacs-Lisp functions - that is, you can &lt;strong&gt;think of Emacs as Emacs Lisp&lt;/strong&gt; with some keyboard &quot;hooks&quot;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-09-29T02:37:05.787" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="430" PostTypeId="2" ParentId="408" CreationDate="2014-09-29T03:13:18.313" Score="9" Body="&lt;p&gt;What you want to use is &lt;a href=&quot;http://cask.readthedocs.org/en/latest/&quot;&gt;Cask&lt;/a&gt;, which lets you create a &lt;a href=&quot;https://github.com/andschwa/emacs/blob/master/Cask&quot;&gt;Cask file&lt;/a&gt; specifying which packages to install on &lt;code&gt;cask install&lt;/code&gt;. It can be used to manage dependencies of a package, and &quot;dependencies&quot; of your Emacs configuration with ease. Put your Cask file in under version control, and install/update packages on a per-machine basis.&lt;/p&gt;&#xA;" OwnerUserId="378" LastActivityDate="2014-09-29T03:13:18.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="431" PostTypeId="2" ParentId="428" CreationDate="2014-09-29T03:49:03.137" Score="4" Body="&lt;p&gt;I think EIN's main value was to be able to connect arbitrary buffers to the ipython kernel that corresponds to the notebook, therefore enabling cooperation of multiple Emacs &quot;objects&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since EIN's README only mentions ipython 0.12 and there hasn't been any activity for a while, it's highly likely that API changes make it currently unusable.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-29T03:49:03.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="432" PostTypeId="1" AcceptedAnswerId="437" CreationDate="2014-09-29T04:09:36.957" Score="13" ViewCount="3635" Body="&lt;p&gt;After the init file has done loading I get this message in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;For information about GNU Emacs and the GNU system, type C-h C-a.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is it being triggered by and how do I change it? &lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="337" LastEditDate="2014-11-10T13:55:03.410" LastActivityDate="2017-10-19T23:28:03.383" Title="How to change default minibuffer message?" Tags="|elisp|init-file|minibuffer|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="433" PostTypeId="2" ParentId="406" CreationDate="2014-09-29T04:39:08.240" Score="4" Body="&lt;p&gt;So first of all, there's no easy way to get to that outcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it would certainly be possible to hack around &lt;code&gt;preview-toggle&lt;/code&gt; to make the overlay that displays the preview image &lt;em&gt;also&lt;/em&gt; display the underlying text, I do believe that the design choice in AucTeX makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that previews are generated on demand, whenever the image needs to be displayed, and that generation can be quite compute-intensive. So intensive that regenerating images after each text change (which would be what's really needed to get true WYSIWYG) is generally not practical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the only reasonably easy change would be to keep displaying a potentially outdated image alongside it's source text, which might be more confusing that helpful.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-29T04:39:08.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="434" PostTypeId="2" ParentId="432" CreationDate="2014-09-29T04:51:56.997" Score="4" Body="&lt;p&gt;This is being triggered by &lt;code&gt;display-startup-echo-area-message&lt;/code&gt;, which gets called at startup time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This particular message is made intentionally difficult to remove (I guess because the GNU project feels they need the advertisement).&#xA;You can still disable it by customizing &lt;code&gt;inhibit-startup-echo-area-message&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-variable inhibit-startup-echo-area-message RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-29T04:51:56.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="435" PostTypeId="1" CreationDate="2014-09-29T06:09:56.100" Score="3" ViewCount="1621" Body="&lt;p&gt;mu4e has the ability to hide duplicates, with the &quot;V&quot; key, but I see no way to delete the messages. I've tried tricks with marking messages in and out of the hide state, but nothing seems to work well. Searching the documentation and googling has turned up nothing.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2021-04-11T13:37:54.223" Title="How do I delete duplicate messages in mu4e?" Tags="|mu4e|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="436" PostTypeId="2" ParentId="406" CreationDate="2014-09-29T06:14:43.630" Score="2" Body="&lt;p&gt;You might want to try &lt;a href=&quot;http://cristal.inria.fr/whizzytex/&quot; rel=&quot;nofollow&quot;&gt;WhizzyTeX&lt;/a&gt; mode that tries to compile latex code on the fly. It comprises of a minor mode for emacs along with a bash script which provides a preview in a separate dvi window. Note that it only supports *nix platforms (no windows) and that too only in dvi mode. It also recommends using advi instead of xdvi to view generated dvi files. Disclaimer : I have not used this mode since a long time.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-09-29T06:22:29.603" LastActivityDate="2014-09-29T06:22:29.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="437" PostTypeId="2" ParentId="432" CreationDate="2014-09-29T06:22:41.333" Score="24" Body="&lt;p&gt;&lt;code&gt;display-startup-echo-area-message&lt;/code&gt; triggers this little advertisement unless you're using customize and have set it there or have it set in your &lt;code&gt;user-init-file&lt;/code&gt; (because it actually goes ahead and scans this file for something looking like that, see the definition of &lt;code&gt;display-startup-echo-area-message&lt;/code&gt; for the gory details).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a way to replace it with something completely different though, simply by redefining it in your Emacs configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun display-startup-echo-area-message ()&#xA;  (message &quot;Let the hacking begin!&quot;))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-09-29T06:22:41.333" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="438" PostTypeId="2" ParentId="420" CreationDate="2014-09-29T08:26:09.350" Score="3" Body="&lt;p&gt;Emacs is an interpreter with a large number of built-in commands for editing. Typing text calls &lt;code&gt;self-insert-command&lt;/code&gt;, which is an interactive function that inserts text in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is not a compiler, but it does provide bytecode. You can compile a file to bytecode (from &lt;code&gt;foo.el&lt;/code&gt; you get a &lt;code&gt;foo.elc&lt;/code&gt; file). This bytecode is then interpreted (much like Python or Ruby) and is interpreted a little bit faster than interpreting the &lt;code&gt;.el&lt;/code&gt; directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;init.el is just a script that is run by Emacs as it starts up. You don't have to run it. The bash equivalent is &lt;code&gt;.bashrc&lt;/code&gt;, which is just a bash script that's executed on startup. &lt;a href=&quot;https://docs.python.org/2/library/user.html&quot; rel=&quot;nofollow&quot;&gt;There's no Python equivalent&lt;/a&gt;. To start Emacs without running init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --no-init-file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You also don't have to start an editor window, you can run Emacs as just a CLI interpreter (this is not useful very often).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --batch --eval '(message &quot;hello world&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastActivityDate="2014-09-29T08:26:09.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="439" PostTypeId="1" AcceptedAnswerId="536" CreationDate="2014-09-29T08:47:54.283" Score="14" ViewCount="3572" Body="&lt;p&gt;I use &lt;kbd&gt;C-h f&lt;/kbd&gt; heavily, but this is all functions in Emacs. I'm often only interested in interactive functions, i.e. commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an equivalent for commands? Ideally I'd like ido completion too.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="50" LastEditDate="2014-10-09T18:08:19.983" LastActivityDate="2019-09-04T09:40:58.907" Title="Is there a command `describe-command', similar to command `describe-function'?" Tags="|help|ido|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="440" PostTypeId="1" AcceptedAnswerId="441" CreationDate="2014-09-29T08:51:15.877" Score="6" ViewCount="1685" Body="&lt;p&gt;Pressing &lt;kbd&gt;a&lt;/kbd&gt; in a dired buffer gives me a warning:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] disabled command dired-find-alternate-file.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is disabled because new users find it confusing.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell, it just opens the file or folder. What is confusing about it? More generally, what criteria does Emacs use for marking commands as confusing?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2014-10-01T16:22:11.453" LastActivityDate="2014-10-01T16:22:11.453" Title="Why is dired-find-alternate-file considered confusing?" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="441" PostTypeId="2" ParentId="440" CreationDate="2014-09-29T08:57:15.290" Score="9" Body="&lt;p&gt;Why is it confusing? Well, that's subjective. My guess is that it is an emacs-centric view of &quot;all commands should open a new buffer for new content&quot;. But since the behavior of a file manager is usually to reuse the current window, in this very case, I find the default behavior more confusing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the criteria? There is nothing very smart about it, just a label stamped onto the function by human developers (or users), e.g:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'dired-find-file-other-buffer 'disabled t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or (equivalently):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(disable-command 'dired-find-file-other-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll find more details in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Disabling-Commands.html&quot; rel=&quot;noreferrer&quot;&gt;the relevant manual page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2014-09-29T08:57:15.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="443" PostTypeId="1" AcceptedAnswerId="472" CreationDate="2014-09-29T10:01:48.467" Score="30" ViewCount="3405" Body="&lt;p&gt;&lt;em&gt;A bit of background.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’m trying to version-control my latex documents, and the&#xA;effectiveness of this initiative would be greatly improved if I adopt&#xA;a &lt;em&gt;one-sentence-per-line&lt;/em&gt; approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, the following is what my documents will look like.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Some text here.&#xA;New stencence on the same paragraph.&#xA;Some more text, still on the same paragraph.&#xA;&#xA;This is another paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is simple.&lt;br&gt;&#xA;&lt;strong&gt;How much of that can I automate/improve with Emacs?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following two points are what I have in mind.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;My sentences are &lt;strong&gt;long&lt;/strong&gt;, so I need to wrap lines without actually&#xA;filling them. That is, a very long sentence needs to be displayed&#xA;over several lines on my screen, but it needs to be a single line&#xA;in the &lt;em&gt;“.tex”&lt;/em&gt; file. &lt;em&gt;This would preferably be done in a way that&#xA;doesn’t wrap equations.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;visual-line-mode&lt;/code&gt; wraps at window width, that is too wide. I need&#xA;something that wraps lines and limits their width to 80 or so&#xA;characters. Just like &lt;code&gt;fill-paragraph&lt;/code&gt; would normally do, but&#xA;without actually breaking the lines in the file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;I can manually break the line after each sentence, but it would be&#xA;highly preferable if I could configure &lt;code&gt;fill-paragraph&lt;/code&gt; (or maybe&#xA;even &lt;code&gt;auto-fill-mode&lt;/code&gt;) to put one sentence per line as well. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-29T11:09:06.990" LastActivityDate="2020-08-04T13:05:19.363" Title="Editing files with one-sentence-per-line" Tags="|latex|fill-paragraph|line-break|" AnswerCount="5" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="444" PostTypeId="5" CreationDate="2014-09-29T10:10:49.023" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/tramp/&quot; rel=&quot;nofollow noreferrer&quot;&gt;TRAMP&lt;/a&gt; is now part of the main Emacs core.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TRAMP enables Emacs edit remote files locally. TRAMP handles many common access protocols, authentication methods, including editing as &lt;a href=&quot;/questions/tagged/sudo&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;sudo&amp;#39;&quot; rel=&quot;tag&quot;&gt;sudo&lt;/a&gt; or as a different user on remote files. TRAMP transparently handles &lt;a href=&quot;/questions/tagged/version-control&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;version-control&amp;#39;&quot; rel=&quot;tag&quot;&gt;version-control&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/dired&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;dired&amp;#39;&quot; rel=&quot;tag&quot;&gt;dired&lt;/a&gt; features on remote file systems. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;TRAMP supports many of the standard connection methods, ranging from telnet or rhs to ssh and scp. On Windows operating systems, TRAMP uses the &lt;code&gt;PuTTY&lt;/code&gt; package to make remote connections using &lt;code&gt;plink&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="7045" LastEditDate="2017-02-09T11:16:15.643" LastActivityDate="2017-02-09T11:16:15.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="445" PostTypeId="4" CreationDate="2014-09-29T10:10:49.023" Score="0" Body="TRAMP is ‘Transparent Remote (file) Access, Multiple Protocol’ for editing remote files from Emacs." OwnerUserId="221" LastEditorUserId="7045" LastEditDate="2017-02-09T11:15:11.620" LastActivityDate="2017-02-09T11:15:11.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="446" PostTypeId="2" ParentId="439" CreationDate="2014-09-29T10:44:57.943" Score="5" Body="&lt;p&gt;If you are using helm and &lt;code&gt;helm-M-x&lt;/code&gt;, you can press &lt;code&gt;C-j&lt;/code&gt; on the commands to pop up their documentation.&lt;/p&gt;&#xA;" OwnerUserId="113" LastActivityDate="2014-09-29T10:44:57.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="447" PostTypeId="2" ParentId="439" CreationDate="2014-09-29T10:53:40.103" Score="9" Body="&lt;p&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/apropos-command&quot;&gt;&lt;code&gt;apropos-command&lt;/code&gt;&lt;/a&gt; might be sufficiently close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn’t offer &lt;code&gt;describe-function&lt;/code&gt;’s tab completion, but it lets you&#xA;search only through commands, and it takes you&#xA;to their doc page.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-09-29T10:53:40.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="448" PostTypeId="1" AcceptedAnswerId="454" CreationDate="2014-09-29T11:40:49.163" Score="40" ViewCount="24820" Body="&lt;p&gt;&lt;strong&gt;What is the easiest way to search for a regexp throughout the contents all files in the current project, skipping files that are not useful?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Useless files are things like compiled files, imported libraries,&#xA;version-control files, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’m aware of &lt;code&gt;rgrep&lt;/code&gt;, but it just searches everything. Is there a&#xA;package that searches ‘inteligently’ and knows about several&#xA;different programming languages, so I wouldn’t have to configure it&#xA;for each individual project?&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2021-06-16T18:46:27.157" Title="What is the easiest way to search all useful files inside a single project?" Tags="|search|project|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="449" PostTypeId="2" ParentId="413" CreationDate="2014-09-29T11:43:02.783" Score="27" Body="&lt;p&gt;Additionally you can use &lt;a href=&quot;https://github.com/Fuco1/dired-hacks/blob/master/dired-subtree.el&quot; rel=&quot;noreferrer&quot;&gt;dired-subtree&lt;/a&gt; from &lt;a href=&quot;https://github.com/Fuco1/dired-hacks&quot; rel=&quot;noreferrer&quot;&gt;dired-hacks&lt;/a&gt; repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here you have short &lt;a href=&quot;https://www.youtube.com/watch?v=z26b8HKFsNE&quot; rel=&quot;noreferrer&quot;&gt;demo&lt;/a&gt; and screenshot from my setup where I press &lt;code&gt;i&lt;/code&gt; to drill down folder and &lt;code&gt;;&lt;/code&gt; to go back.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (define-key dired-mode-map &quot;i&quot; 'dired-subtree-insert)&#xA;  (define-key dired-mode-map &quot;;&quot; 'dired-subtree-remove)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KXZLl.png&quot; alt=&quot;dired-subtree&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS&#xA;I'm also aware of &lt;a href=&quot;https://github.com/m2ym/direx-el&quot; rel=&quot;noreferrer&quot;&gt;direx&lt;/a&gt; which looks like that: &lt;img src=&quot;https://i.stack.imgur.com/6nKXC.png&quot; alt=&quot;direx&quot;&gt;:&lt;/p&gt;&#xA;" OwnerUserId="220" LastEditorUserId="220" LastEditDate="2014-09-29T11:48:12.707" LastActivityDate="2014-09-29T11:48:12.707" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="450" PostTypeId="1" AcceptedAnswerId="2103" CreationDate="2014-09-29T12:08:17.777" Score="41" ViewCount="9356" Body="&lt;p&gt;By default, the results of running &lt;code&gt;M-x ispell-buffer&lt;/code&gt; in org-mode are&#xA;very disappointing.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Ispell looks inside &lt;code&gt;:PROPERTY:&lt;/code&gt; drawers, which commonly contain things like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:ID:       797495bd-581b-4a42-883b-c2a55a08f08a&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It tries to correct org statements! For instance, it complains about the &lt;code&gt;SRC&lt;/code&gt; in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It goes inside org-blocks. I suppose this might be useful for&#xA;blocks like &lt;code&gt;#+BEGIN_QUOTE&lt;/code&gt;, but in source code blocks that’s just&#xA;silly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a package that fixes all this?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’d love to spell-check my writing but the amount of false-positives&#xA;I’m getting makes it unfeasible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If it matters, the OS's spell checker is aspell.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2016-05-08T07:40:39.360" Title="Intelligent spell-checking in org-mode" Tags="|org-mode|spell-checking|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="451" PostTypeId="1" AcceptedAnswerId="456" CreationDate="2014-09-29T12:10:52.337" Score="4" ViewCount="1020" Body="&lt;p&gt;I would like to be able to manage external processes from Emacs, in a way that is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;(a)&lt;/strong&gt; safe w.r.t. arguments escaping for the shell,&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;(b)&lt;/strong&gt; efficient both for local and remote processes (using TRAMP w/ ssh).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here are two solutions I can think of to implement calling a possibly remote process:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;using &lt;code&gt;shell-command&lt;/code&gt;: this has the advantage that it is fast (meets criterion b), but one needs to pass a full shell command (fails for criterion a).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;using &lt;code&gt;start-file-process&lt;/code&gt; as recommended by the &lt;a href=&quot;https://www.gnu.org/software/tramp/#Remote-processes&quot; rel=&quot;nofollow&quot;&gt;TRAMP documentation&lt;/a&gt;: this is nice in terms of arguments handling (criterion a), but a new SSH connection seems to be called for each process, which dramatically slows things down in remote configurations (criterion b).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; these solutions also differ in that (1) is synchronous whereas (2) is asynchronous, but I don't mention it because (a)synchronicity doesn't matter for my application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like option (2) is slow because it spawns a new ssh process, whereas option (1) reuses an already existing one. &lt;strong&gt;Is there any high-level function allowing to call a possibly remote process, while still being efficient by reusing an existing connection if possible?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Below is the code I used to benchmark both solutions: &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((test/remote-buffer (find-file &quot;/xxx.xxx.xxx.xxx:/home/LOGIN/&quot;))&#xA;      (test/output-buffer (get-buffer-create &quot;*hostname*&quot;)))&#xA;  (with-current-buffer test/output-buffer&#xA;    (erase-buffer))&#xA;&#xA;  (with-current-buffer test/remote-buffer&#xA;    (setq test/begin (current-time))&#xA;    (shell-command &quot;hostname&quot; test/output-buffer)&#xA;    (message &quot;1-Elapsed: %f&quot; (float-time (time-subtract (current-time) test/begin))))&#xA;&#xA;  (with-current-buffer test/remote-buffer&#xA;    (setq test/begin (current-time))&#xA;    (set-process-sentinel&#xA;     (start-file-process &quot;hostname&quot; test/output-buffer &quot;hostname&quot;)&#xA;     (lambda (p e)&#xA;       (message &quot;2-Elapsed: %f&quot; (float-time (time-subtract (current-time) test/begin)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yielding output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1-Elapsed: 0.010178&#xA;Tramp: Opening connection for xxx.xxx.xxx.xxx using scp...&#xA;Tramp: Sending command `exec ssh -q   -o ControlPath=/tmp/tramp.12155IuC.%r@%h:%p -o ControlMaster=auto -e none xxx.xxx.xxx.xxx'&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Tramp: Found remote shell prompt on `xxx.xxx.xxx.xxx'&#xA;Tramp: Opening connection for xxx.xxx.xxx.xxx using scp...done&#xA;2-Elapsed: 1.116449&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the case of local processes, both implementations take a similar elapsed time, which is negligible (and often faster for solution 2).&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-09-29T14:48:50.840" Title="Efficiently call remote processes" Tags="|tramp|process|remote|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="453" PostTypeId="2" ParentId="448" CreationDate="2014-09-29T12:41:02.440" Score="14" Body="&lt;p&gt;The project-wide search of only relevant files can be done using &lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ag&lt;/code&gt; aka the_silver_searcher&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Why ag?&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It ignores file patterns from your &lt;code&gt;.gitignore&lt;/code&gt;, &lt;code&gt;.hgignore&lt;/code&gt;, &lt;code&gt;svn:ignore&lt;/code&gt;. &lt;em&gt;You can choose for your searches to NOT use the ignore list from the version-control ignore lists by using the &lt;code&gt;-U&lt;/code&gt; switch.&lt;/em&gt; &lt;/li&gt;&#xA;&lt;li&gt;If there are files in your source repo you don't want to search, just add their patterns to a &lt;code&gt;.agignore&lt;/code&gt; file. &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A global &lt;code&gt;.agignore&lt;/code&gt; file can be put in your &lt;code&gt;$HOME&lt;/code&gt; and then you can put more project specific &lt;code&gt;.agignore&lt;/code&gt; files in your project roots.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Setting up &lt;code&gt;ag&lt;/code&gt; and emacs&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install &lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ag&lt;/code&gt; aka the_silver_searcher&lt;/a&gt; on your system.&lt;/li&gt;&#xA;&lt;li&gt;Set up the &lt;code&gt;.agignore&lt;/code&gt; file. &lt;em&gt;I prefer to have just a global &lt;code&gt;.agignore&lt;/code&gt; file in my &lt;code&gt;$HOME&lt;/code&gt;.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Install the &lt;a href=&quot;https://github.com/Wilfred/ag.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ag&lt;/code&gt;&lt;/a&gt; package (available on Melpa). &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I would also recommend installing the &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-wgrep/blob/master/wgrep-ag.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;wgrep-ag&lt;/code&gt;&lt;/a&gt; package (also available on Melpa). That would help if and when you try to do &lt;a href=&quot;https://emacs.stackexchange.com/a/243/115&quot;&gt;project-wide search/replace using &lt;code&gt;ag&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;You can then use the &lt;code&gt;ag-project&lt;/code&gt; or &lt;code&gt;ag-project-regexp&lt;/code&gt; function (that come with the &lt;code&gt;ag&lt;/code&gt; package) to do project-wide file searches. &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;By default, these functions use the root of the VCS repo as the directory to search in. You can override this by setting or customizing the &lt;code&gt;ag-project-root-function&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Even if your project is not git controlled, you can mark a project-root for the &lt;code&gt;ag-project&lt;/code&gt; / &lt;code&gt;ag-project-regexp&lt;/code&gt; based searches by putting an empty &lt;code&gt;.git&lt;/code&gt; folder in your project root. You then don't have to customize &lt;code&gt;ag-project-root-function&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-09-29T12:41:02.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="454" PostTypeId="2" ParentId="448" CreationDate="2014-09-29T12:56:52.127" Score="41" Body="&lt;p&gt;Project based searching within Emacs can be done using &lt;a href=&quot;https://github.com/bbatsov/projectile&quot;&gt;projectile&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It allows for per-project configuration of ignore files (in a &lt;code&gt;&amp;lt;projectroot&amp;gt;\.projectile&lt;/code&gt; file), or specify subdirectories to monitor and ignore all others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can run &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;ack&lt;/code&gt; (requires &lt;code&gt;ack-and-a-half.el&lt;/code&gt;) and &lt;code&gt;ag&lt;/code&gt; (&lt;code&gt;ag.el&lt;/code&gt;) on files within the defined project (either based on the &lt;code&gt;.projectile&lt;/code&gt; file or by finding a supported VC file to define a project root).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Commands&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;(With regards to searching through useful files)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per Projectile Readme&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c p s g&lt;/code&gt;  :: Run &lt;code&gt;grep&lt;/code&gt; on the files in the project.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c p s a&lt;/code&gt;  :: Runs &lt;code&gt;ack&lt;/code&gt; on the project. Requires the presence of ack-and-a-half.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c p s s&lt;/code&gt;  :: Runs &lt;code&gt;ag&lt;/code&gt; on the project. Requires the presence of ag.el.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c p f&lt;/code&gt;    :: Display a list of all files in the project.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c p d&lt;/code&gt;    :: Display a list of all directories in the project.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c p a&lt;/code&gt;  :: Switch between files with the same name but different extension in the project.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c p o&lt;/code&gt; :: Runs &lt;code&gt;multi-occur&lt;/code&gt; on all project buffers currently open.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These will only act on files defined as being part of the project (or found when the cache is generated/regenerated).&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2014-09-29T13:49:14.123" LastActivityDate="2014-09-29T13:49:14.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="455" PostTypeId="2" ParentId="425" CreationDate="2014-09-29T12:59:50.690" Score="7" Body="&lt;h3&gt;For &lt;code&gt;ido&lt;/code&gt; users&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-f&lt;/kbd&gt; (which should call &lt;code&gt;ido-find-file&lt;/code&gt;) and enter a non-existent path.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;M-m&lt;/kbd&gt; (mnemonic for &lt;code&gt;m&lt;/code&gt;ake new dir?). Hit &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Continue with typing the new file name that you want to create in that new dir. Hit &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-09-29T12:59:50.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="456" PostTypeId="2" ParentId="451" CreationDate="2014-09-29T13:26:38.113" Score="5" Body="&lt;p&gt;What about writing a &quot;safe&quot; version of &lt;code&gt;shell-command&lt;/code&gt; that would properly escape arguments using &lt;code&gt;shell-quote-argument&lt;/code&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun safe-shell-command (args &amp;amp;optional output-buffer error-buffer)&#xA;  (apply 'shell-command (mapconcat 'shell-quote-argument args &quot; &quot;)&#xA;         output-buffer error-buffer nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(the same would easily apply to &lt;code&gt;async-shell-command&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously it has the same performance characteristics as &lt;code&gt;shell-command&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual has a section on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Shell-Arguments.html&quot; rel=&quot;nofollow&quot;&gt;shell arguments&lt;/a&gt;. It also mentions &lt;code&gt;combine-and-quote-strings&lt;/code&gt;, which might be useful depending on the case: it produces &quot;less quoted&quot; arguments, for example &lt;code&gt;$&lt;/code&gt; characters are left alone.&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-09-29T14:48:50.840" LastActivityDate="2014-09-29T14:48:50.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="457" PostTypeId="1" CreationDate="2014-09-29T14:03:37.093" Score="12" ViewCount="1055" Body="&lt;p&gt;One of vim's quirks is that it doesn't show an empty line at the end of a file if the file ends with the newline character. This way, if the file &lt;em&gt;doesn't&lt;/em&gt; end with a newline, the display is the same, only with the &lt;code&gt;[noeol]&lt;/code&gt; marker in the modeline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs on the other hand, displays the last line if the file ends with a newline, and doesn't otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While Emacs' behaviour is fundamentally more sensible, for better or worse, I've gotten used to the former.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to suppress the display of the last empty line, while still requiring that the file be newline terminated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/aLZkp.png&quot; alt=&quot;Emacs new-line behaviour&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The screenshot shows three windows (view image in new tab if too small):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Large emacs window on the left in &lt;code&gt;hexl-mode&lt;/code&gt;, showing you that there really is a newline at the end of the file (0a, where the cursor is positioned).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs window on top right, with cursor on the empty third line.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Vim window on bottom right, with cursor on the last text line. The cursor cannot move below this point, even though the file ends with a newline (there is no &lt;code&gt;[noeol]&lt;/code&gt; marker on the vim statusline).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="285" LastEditorUserId="-1" LastEditDate="2020-07-13T18:24:38.073" LastActivityDate="2020-07-13T18:24:38.073" Title="How can I suppress emacs' cursor moving into the empty last line of a file?" Tags="|whitespace|display|newlines|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="458" PostTypeId="2" ParentId="420" CreationDate="2014-09-29T14:10:58.443" Score="7" Body="&lt;h3&gt;Emacs as editor&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; and the equivalen &lt;code&gt;~/.emacs&lt;/code&gt;,&lt;code&gt;~/.emacs.el&lt;/code&gt; all serve as the source of user-specific customization for emacs.  When emacs is launched these are sourced to provide you with your desired editing environment.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Emacs in --batch&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;--batch&lt;/code&gt; implies &lt;code&gt;-q&lt;/code&gt; (--no-init-file) according to &lt;code&gt;emacs --help&lt;/code&gt;.  This means customizations are not included when launching a batch process.  You can manually tell it to include your customizations by running &lt;code&gt;emacs --batch -l ~/.emacs.d/init.el&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does however still include the &lt;code&gt;site-lisp&lt;/code&gt; directory (so packages bundled with emacs or installed to &lt;code&gt;site-lisp&lt;/code&gt; will still be available/loaded).  To ensure they are not added you can run &lt;code&gt;emacs --batch -Q&lt;/code&gt; or &lt;code&gt;emacs --batch --no-site-lisp&lt;/code&gt;.  If you have a specific set of packages you need run when launching a batch process best would be to create a file that &lt;code&gt;requires&lt;/code&gt; the specific files (&lt;code&gt;~/.emacs.d/batch.el&lt;/code&gt;) and sets any variables as desired then run &lt;code&gt;emacs --batch -l ~/.emacs.d/batch.el --eval &amp;lt;command&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-09-29T14:10:58.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="459" PostTypeId="1" AcceptedAnswerId="460" CreationDate="2014-09-29T14:11:13.137" Score="4" ViewCount="2128" Body="&lt;p&gt;I just recently started using Helm and I like it so far. But one annoying thing I encountered was the fact that if I don't complete an action, I end up with a totally useless buffer. And these things just keep adding up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I should not care about the remaining buffers, and just use &lt;code&gt;helm-&lt;/code&gt; functions, but somehow I find myself thinking I have to kill them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution is to automatize: &lt;code&gt;list-buffers&lt;/code&gt; / &lt;code&gt;ibuffer&lt;/code&gt;, mark all by mode or by regex and delete them, but I'm looking for something more like &lt;a href=&quot;https://github.com/m2ym/popwin-el&quot; rel=&quot;nofollow&quot;&gt;popwin&lt;/a&gt;. How could I do this?&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2014-09-29T17:28:44.977" Title="How to automatically kill Helm buffers I don't need?" Tags="|elisp|helm|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="460" PostTypeId="2" ParentId="459" CreationDate="2014-09-29T16:10:21.940" Score="5" Body="&lt;p&gt;I use popwin and helm with the following and I think that's all that's needed to get your desired behaviour (I'm not sure where I found it). I use it not so much for the buffer clutter, which I hadn't actually noticed till now, but for keeping the window arrangement.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'popwin)&#xA;(popwin-mode 1)&#xA;(setq display-buffer-function 'popwin:display-buffer)&#xA;(push '(&quot;^\*helm .+\*$&quot; :regexp t) popwin:special-display-config)&#xA;(push '(&quot;^\*helm-.+\*$&quot; :regexp t) popwin:special-display-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="410" LastActivityDate="2014-09-29T16:10:21.940" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="461" PostTypeId="1" AcceptedAnswerId="465" CreationDate="2014-09-29T16:27:03.237" Score="8" ViewCount="7902" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I configure eshell to be able to run programs from directories in PATH env variable?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I add additional custom directories to the list?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I use Emacs 24.3.1.&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2018-09-28T04:26:00.193" Title="Configuration of eshell. Running programs from directories in PATH env variable" Tags="|eshell|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="462" PostTypeId="1" AcceptedAnswerId="463" CreationDate="2014-09-29T16:29:14.310" Score="5" ViewCount="473" Body="&lt;p&gt;Is there a way (or package) to search and replace code like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Account&#xA;  def list_accounts&#xA;  end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Company&#xA;  def list_companies&#xA;  end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically I want to replace account(s) with compan(y/ies)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vim does this with &lt;a href=&quot;http://vimcasts.org/episodes/smart-search-with-subvert/&quot; rel=&quot;nofollow&quot;&gt;Subvert&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="94" LastEditorUserId="25" LastEditDate="2014-09-29T18:20:02.333" LastActivityDate="2014-09-29T18:25:19.823" Title="Search and replace with case preservation and plurals" Tags="|search|replace|case-folding|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="463" PostTypeId="2" ParentId="462" CreationDate="2014-09-29T17:03:18.343" Score="8" Body="&lt;h1&gt;Retaining the cases on replacing&lt;/h1&gt;&#xA;&lt;p&gt;By default, emacs retains the cases when replacing.&lt;/p&gt;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Replacement-and-Case.html#Replacement-and-Case&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs manual&lt;/a&gt;,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;When the newstring argument is all or partly lower case, replacement commands try to preserve the case pattern of each occurrence. Thus, the command&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-string &amp;lt;RET&amp;gt; foo &amp;lt;RET&amp;gt; bar &amp;lt;RET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;replaces a lower case &lt;code&gt;foo&lt;/code&gt; with a lower case &lt;code&gt;bar&lt;/code&gt;, an all-caps &lt;code&gt;FOO&lt;/code&gt; with &lt;code&gt;BAR&lt;/code&gt;, and a capitalized &lt;code&gt;Foo&lt;/code&gt; with &lt;code&gt;Bar&lt;/code&gt;. (These three alternatives—lower case, all caps, and capitalized, are the only ones that replace-string can distinguish.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Ensure that the &lt;code&gt;case-replace&lt;/code&gt; variable is &lt;code&gt;t&lt;/code&gt; (which it is, by default).&lt;/p&gt;&#xA;&lt;h1&gt;Replacing with plurals&lt;/h1&gt;&#xA;&lt;p&gt;You can try &lt;code&gt;query-replace-regexp&lt;/code&gt; (&lt;code&gt;C-M-%&lt;/code&gt;) then replace&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;account\(s\)?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;compan\,(if (string= \1 &amp;quot;s&amp;quot;) &amp;quot;ies&amp;quot; &amp;quot;y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-09-29T18:25:19.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="464" PostTypeId="2" ParentId="461" CreationDate="2014-09-29T17:15:29.150" Score="2" Body="&lt;p&gt;To answer to your first question: Eshell is already able to run programs in PATH. Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Welcome to the Emacs shell&#xA;&#xA;~ $ env-info&#xA;&#xA;manuel@bebop&#xA;&#xA;OS: LinuxBBQ Haggis&#xA;Uptime: 0d 4h 9m&#xA;Shell: /bin/zsh&#xA;WM: ratpoison&#xA;Disk: 37G / 257G&#xA;Mem: 1180M / 4042M&#xA;Kernel: Linux 3.16-2-686-pae i686&#xA;CPU: Intel(R) Core(TM)2 Duo CPU     T6400  @ 2.00GHz&#xA;&#xA;~ $ which env-info&#xA;/home/manuel/bin/env-info&#xA;~ $ echo $PATH | grep bin&#xA;/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/manuel/bin&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="219" LastActivityDate="2014-09-29T17:15:29.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="465" PostTypeId="2" ParentId="461" CreationDate="2014-09-29T17:17:21.530" Score="9" Body="&lt;p&gt;The Emacs equivalent of the PATH environment variable is &lt;code&gt;exec-path&lt;/code&gt;, which is a list instead of a colon-separated string. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its content it initialized with the value of PATH, so supposedly it should be all transparent. But if this happens not to contain what you want (typically when Emacs is not run from a shell, but from a Desktop Environment), you might find this package useful: &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt;. Install it from Marmalade or MELPA using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install exec-path-from-shell RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-29T17:17:21.530" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="466" PostTypeId="2" ParentId="439" CreationDate="2014-09-29T17:27:53.430" Score="7" Body="&lt;p&gt;I can't find this built-in. It is fairly easy to make a wrapper around &lt;code&gt;describe-function&lt;/code&gt; that only completes command names when called interactively. In the implementation below, I duplicated the interactive form from &lt;code&gt;describe-function&lt;/code&gt; and changed the &lt;code&gt;fboundp&lt;/code&gt; test to &lt;code&gt;commandp&lt;/code&gt;. As an added bonus, this function offers all function names when called with a prefix argument. Change &lt;code&gt;if current-prefix-arg&lt;/code&gt; to &lt;code&gt;if (not current-prefix-arg)&lt;/code&gt; to make describing all functions the default.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun describe-command (function &amp;amp;optional all-functions)&#xA;  &quot;Display the full documentation of FUNCTION (a symbol).&#xA;When called interactively with a prefix argument, prompt for all functions,&#xA;not just interactive commands, like `describe-function'.&quot;&#xA;  (interactive (if current-prefix-arg&#xA;                   (eval (car (cdr (interactive-form 'describe-function))))&#xA;                 (list (let ((fn (function-called-at-point))&#xA;                             (enable-recursive-minibuffers t)&#xA;                             val)&#xA;                         (setq val (completing-read (if (and fn (commandp fn))&#xA;                                                        (format &quot;Describe command (default %s): &quot; fn)&#xA;                                                      &quot;Describe command: &quot;)&#xA;                                                    obarray 'commandp t nil nil&#xA;                                                    (and fn (commandp fn)&#xA;                                                         (symbol-name fn))))&#xA;                         (if (equal val &quot;&quot;) fn (intern val)))&#xA;                       current-prefix-arg)))&#xA;  (describe-function function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't tested this with ido but it should integrate normally.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="2239" LastEditDate="2019-09-04T09:40:58.907" LastActivityDate="2019-09-04T09:40:58.907" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="467" PostTypeId="2" ParentId="459" CreationDate="2014-09-29T17:28:44.977" Score="2" Body="&lt;p&gt;Regardless of whether it's a good idea or not, you might find &lt;a href=&quot;http://www.emacswiki.org/emacs/tempbuf.el&quot; rel=&quot;nofollow&quot;&gt;tempbuf.el&lt;/a&gt; useful. A possibility would be to install it into so helm hook, and adjust the expiration delay to your taste. From there, buffers will start disappearing automatically when they're deemed unneeded.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-29T17:28:44.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="468" PostTypeId="1" AcceptedAnswerId="768" CreationDate="2014-09-29T17:33:34.950" Score="7" ViewCount="1171" Body="&lt;p&gt;I am having some trouble with helm, so I have set &lt;code&gt;debug-on-error&lt;/code&gt; in an effort to locate the problem.  Now whenever the problem occurs, the &lt;code&gt;*Backtrace*&lt;/code&gt; buffer appears as expected, but I am still in one of helm's major modes and I am not able to navigate the backtrace buffer and debug normally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The major mode is still using the minibuffer, and also seems to be &quot;stealing&quot; my key sequences and preventing me from debugging.  When I exit the &lt;code&gt;helm-mulit-occur&lt;/code&gt; in progress, the backtrace buffer is cleared and I cannot continue debugging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to &quot;pause&quot; a major mode while keeping the elisp debugger running so that I can debug as normal?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-10-02T15:54:41.477" LastActivityDate="2022-01-28T17:35:54.743" Title="How to debug Helm" Tags="|helm|debugging|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="469" PostTypeId="2" ParentId="457" CreationDate="2014-09-29T18:05:17.970" Score="2" Body="&lt;p&gt;Let me give a &lt;em&gt;horrible&lt;/em&gt; suggestion to implement that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-eof-intangible ()&#xA;  (interactive)&#xA;  (add-hook 'post-command-hook (lambda ()&#xA;                                 (when (and (equal (point) (point-max))&#xA;                                            (looking-back &quot;\n&quot;))&#xA;                                   (backward-char))) t t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I'm using a local hook because I suspect setting it globally might mess up things seriously, so better enable it on a per-buffer basis)&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-29T18:05:17.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="470" PostTypeId="1" CreationDate="2014-09-29T18:54:45.193" Score="0" ViewCount="151" Body="&lt;p&gt;I have the following keymap defined to navigate my Emacs windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-keys-minor-mode-map (make-keymap) &quot;my-keys-minor-mode keymap.&quot;)&#xA;(define-key my-keys-minor-mode-map (kbd &quot;C-M-j&quot;) 'windmove-left)&#xA;(define-key my-keys-minor-mode-map (kbd &quot;C-M-l&quot;) 'windmove-right)&#xA;(define-key my-keys-minor-mode-map (kbd &quot;C-M-i&quot;) 'windmove-up)&#xA;(define-key my-keys-minor-mode-map (kbd &quot;C-M-k&quot;) 'windmove-down)&#xA;(define-key my-keys-minor-mode-map (kbd &quot;C-M-u&quot;) 'toggle-maximize-buffer)&#xA;&#xA;(define-minor-mode my-keys-minor-mode&#xA;  &quot;A minor mode so that my key settings override annoying major modes.&quot;&#xA;  t &quot; my-keys&quot; 'my-keys-minor-mode-map)&#xA;&#xA;(my-keys-minor-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works great, except when I am viewing a PDF (&lt;code&gt;DocView&lt;/code&gt;). In that case, Whenever I press any of the shortcuts I get errors like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: wholenump, -56&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What could be going on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case it helps I am using GNU Emacs on OS X. I installed with the following command, as suggested in this other &lt;a href=&quot;https://emacs.stackexchange.com/a/274/6&quot;&gt;answer&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --HEAD --use-git-head --cocoa --with-gnutls --with-rsvg --with-imagemagick&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My version specifically is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F34))&#xA; of 2014-09-27 on josh.host.net&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could this be a bug? Or perhaps am I not defining this keymap correctly? &lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-10-10T19:11:33.470" Title="DocView clashing with global keymaps" Tags="|keymap|docview|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="471" PostTypeId="2" ParentId="443" CreationDate="2014-09-29T20:32:38.237" Score="9" Body="&lt;p&gt;Would your version-control issues be avoided/resolved if you use git diff --color-words or latexdiff? Then you can look at changed words.&lt;/p&gt;&#xA;" OwnerUserId="364" LastActivityDate="2014-09-29T20:32:38.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="472" PostTypeId="2" ParentId="443" CreationDate="2014-09-29T20:42:50.930" Score="12" Body="&lt;p&gt;If you just want something like &lt;code&gt;visual-line-mode&lt;/code&gt; but configurable, you can try &lt;code&gt;longlines-mode&lt;/code&gt; which is what I use for most of my prose. &lt;code&gt;longlines-mode&lt;/code&gt; wraps your text similarly to &lt;code&gt;visual-line-mode&lt;/code&gt; with the width configured by &lt;code&gt;fill-column&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a screenshot with &lt;code&gt;fill-column&lt;/code&gt; set to &lt;code&gt;70&lt;/code&gt; (the window actually extends even more to the right).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6vRNS.png&quot; alt=&quot;An example of longlines-mode wrapping text.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Configuring &lt;code&gt;fill-paragraph&lt;/code&gt; would be neat, but I'm not sure how to do it. Instead, here's a reasonable temporary hack: make your &lt;code&gt;.&lt;/code&gt; character electric in TeX mode, inserting a newline. This just involves rebinding it in whatever the appropriate mode hook is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-electric-dot ()&#xA;  (interactive)&#xA;  (insert &quot;.\n&quot;))&#xA;(defun my-tex-hook ()&#xA;  (local-set-key (kbd &quot;.&quot;) 'my-electric-dot))&#xA;(add-hook 'TeX-mode-hook 'my-tex-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17" LastEditorUserId="675" LastEditDate="2015-05-12T21:25:35.823" LastActivityDate="2015-05-12T21:25:35.823" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="473" PostTypeId="2" ParentId="443" CreationDate="2014-09-29T22:01:03.010" Score="14" Body="&lt;p&gt;For (1), I would use an enlarged margin, so that &lt;code&gt;visual-line-mode&lt;/code&gt; wraps lines at the desired &lt;code&gt;fill-column&lt;/code&gt;. This will affect both text lines and equations, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for (2), one can define a custom filling command to be bound to &lt;code&gt;M-q&lt;/code&gt; and correctly fill paragraphs. I haven't yet managed to write a command with the correct behaviour for auto-filling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wrapping this all in a minor mode could look like the following. It is not very beautiful code, but should work in most cases. (I have had the &lt;code&gt;unfill-paragraph&lt;/code&gt; function in my &lt;code&gt;init.el&lt;/code&gt; for quite some time without noticing problems).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode ospl-mode&#xA;  &quot;One Sentence Per Line&quot;&#xA;  :init-value nil&#xA;  :lighter &quot; ospl&quot;&#xA;  :keymap (let ((map (make-sparse-keymap)))&#xA;            (define-key map (kbd &quot;M-q&quot;) 'ospl/fill-paragraph)&#xA;            map)&#xA;&#xA;  (if ospl-mode&#xA;      (progn&#xA;        (visual-line-mode 1)&#xA;        (setq right-margin-width (- (window-body-width) fill-column)))&#xA;    (visual-line-mode -1)&#xA;    (setq right-margin-width 0))&#xA;&#xA;  ;; Account for new margin width&#xA;  (set-window-buffer (selected-window) (current-buffer)))&#xA;&#xA;&#xA;(defun ospl/unfill-paragraph ()&#xA;  &quot;Unfill the paragraph at point.&#xA;&#xA;This repeatedly calls `join-line' until the whole paragraph does&#xA;not contain hard line breaks any more.&quot;&#xA;  (interactive)&#xA;  (forward-paragraph 1)&#xA;  (forward-paragraph -1)&#xA;  (while (looking-at paragraph-start)&#xA;    (forward-line 1))&#xA;  (let ((beg (point)))&#xA;    (forward-paragraph 1)&#xA;    (backward-char 1)&#xA;    (while (&amp;gt; (point) beg)&#xA;      (join-line)&#xA;      (beginning-of-line))))&#xA;&#xA;&#xA;(defun ospl/fill-paragraph ()&#xA;  &quot;Fill the current paragraph until there is one sentence per line.&#xA;&#xA;This unfills the paragraph, and places hard line breaks after each sentence.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (fill-paragraph)         ; takes care of putting 2 spaces if needed&#xA;    (ospl/unfill-paragraph)  ; remove hard line breaks&#xA;&#xA;    ;; insert line breaks again&#xA;    (let ((end-of-paragraph (make-marker)))&#xA;      (save-excursion&#xA;        (forward-paragraph)&#xA;        (backward-sentence)&#xA;        (forward-sentence)&#xA;        (set-marker end-of-paragraph (point)))&#xA;      (forward-sentence) &#xA;      (while (&amp;lt; (point) end-of-paragraph)&#xA;        (just-one-space)&#xA;        (delete-backward-char 1)&#xA;        (newline)&#xA;        (forward-sentence))&#xA;      (set-marker end-of-paragraph nil)))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="675" LastEditDate="2015-05-12T21:26:37.893" LastActivityDate="2015-05-12T21:26:37.893" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="474" PostTypeId="1" CreationDate="2014-09-29T22:29:03.703" Score="56" ViewCount="34756" Body="&lt;p&gt;I have been trying off and on for over a year now to use Emacs as a C/C++ IDE.  I have only been marginally successful thus far, but have run into a few brick walls along the way.  Currently I am trying to use CEDET, but I am having a rough time understanding how to use it effectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The features that I am looking for in an IDE are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Management of software &quot;projects.&quot;  I want my IDE to have a sense of all of the files that make up my current project so that I can perform functions like search-and-replace within my project. (It would be nice if I could also achieve this without littering my source tree with lots of support files. Why do I need more than one centralized project file per project?)&lt;/li&gt;&#xA;&lt;li&gt;The ability to build the current project from within the IDE, regardless of which buffer I am currently visiting.  I need to be able to bind a key which will build the current project.&lt;/li&gt;&#xA;&lt;li&gt;Error reporting.  I don't want to have to read through 500+ lines of output to find the errors that were reported by the build tools.  Preferably, the errors show up in their very own buffer with one line per error.&lt;/li&gt;&#xA;&lt;li&gt;An awareness of symbols within the project, and where they are defined.  I want to jump to a symbol definition whether it lives in my project files or in the system include files.&lt;/li&gt;&#xA;&lt;li&gt;Visual debugging.  I want to have a watch list of local variables that update automatically as I step through the code.  I want to be able to set breakpoints in the code see which line of code will be executed next.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I know that each of these features exists because I have had each of them working at one time or another using EDE, Semantic, GDB, etc.  The problem is that I have never been able to have all of these features working at the same time,  because each piece usually has to be configured by itself, and it is usually too much work to figure out how to configure all of them at once and make them work together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What solutions exist for turning Emacs into a full-featured C/C++ IDE?&lt;/strong&gt;  Do you always have to configure everything piecemeal, or is there a way to set all of the features up at a time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; A good answer to this question does not have to exactly meet all five of the given criteria.  I simply provided the list to give a more concrete idea of the type of features I want to see before I would consider an IDE to be &quot;full-featured.&quot;  It is quite possible that CEDET could fit the bill, but I have yet to find a working step-by-step tutorial on how to set it up from scratch.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-09-30T05:01:21.993" LastActivityDate="2015-05-04T14:58:45.777" Title="Using Emacs as a full-featured C/C++ IDE" Tags="|debugging|compilation|ide|cedet|c++|" AnswerCount="9" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="475" PostTypeId="1" AcceptedAnswerId="479" CreationDate="2014-09-29T23:00:22.277" Score="10" ViewCount="320" Body="&lt;p&gt;I'm not going to weigh in on whether ending sentences with two spaces is the One True Way or an abomination. All I know is that I show no signs of establishing a consistent habit of hitting the spacebar twice at the end of a sentence. So, given that: what's an ideal set of &lt;code&gt;sentence-*&lt;/code&gt; customizations that will accurately recognize most English sentence endings without the aid of two spaces?&lt;/p&gt;&#xA;" OwnerUserId="387" LastEditorUserId="421" LastEditDate="2014-10-28T14:23:09.117" LastActivityDate="2014-10-28T14:23:09.117" Title="Recognizing sentences that don't end in two spaces" Tags="|text|sentences|writing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="476" PostTypeId="1" AcceptedAnswerId="2366" CreationDate="2014-09-29T23:05:43.093" Score="28" ViewCount="10419" Body="&lt;p&gt;If you have ever used &lt;a href=&quot;http://jsbin.com/&quot;&gt;JS Bin&lt;/a&gt;, you know that as you type your code (HTML, CSS, Javascript) on the right is updated to fit what you typed. I have found this to be one of the most useful tools for making little code snippets. However, I would like the same feature to be implemented into Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as I type/edit code in my Emacs buffers, the web page would refresh or load asynchronously without my having to save the file or refresh the page.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side note: I do not care if the web browser is internal like &lt;a href=&quot;http://www.emacswiki.org/emacs/w3&quot;&gt;w3&lt;/a&gt;, or external like &lt;a href=&quot;http://www.google.com/intl/en/chrome/browser/&quot;&gt;Google Chrome&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="50" LastEditDate="2014-10-20T13:38:41.153" LastActivityDate="2014-10-27T03:30:12.800" Title="How to make Emacs render HTML without having to save the file?" Tags="|html|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="477" PostTypeId="1" AcceptedAnswerId="483" CreationDate="2014-09-29T23:27:40.267" Score="33" ViewCount="6711" Body="&lt;p&gt;I regularly use &lt;code&gt;org-mode&lt;/code&gt; and the agenda to keep track of my to-do list. Since I use Dropbox to sync my list, I need the same tasks to be available on all computers. Sometimes during the course of my cleanup I will forget to save my changes, leaving emacs open at home when I go into the office (thus I am not prompted to save on closing emacs). How can I automatically save changes to &lt;code&gt;*.org&lt;/code&gt; agenda buffers that are modified through the agenda?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: To clarify, I use the agenda view of my tasks to show me an overview. From that view, I can change the status of tasks. Additionally, I use remember-mode to add new tasks, which can then be recategorized in the agenda view. These changes in the agenda result in modified org-mode agenda buffers, which must then be saved. When these changes are made, I would like the buffers to be saved automatically.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="50" LastEditDate="2014-09-30T10:33:04.357" LastActivityDate="2020-01-03T08:44:55.300" Title="How do I automatically save org-mode buffers?" Tags="|org-mode|saving|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="478" PostTypeId="1" AcceptedAnswerId="13673" CreationDate="2014-09-29T23:56:36.327" Score="10" ViewCount="1420" Body="&lt;p&gt;I'm using GNU Emacs on Windows, and I am unable to use &lt;code&gt;magit-push&lt;/code&gt; to push my local changes to a remote repository. This happens with remote repositories regardless of if they are accessed with SSH or HTTPS. What do I need to do to make &lt;code&gt;magit-push&lt;/code&gt; work on Windows as seamlessly (or at least nearly so) as it does on my Linux machines?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I see in the &lt;code&gt;*Messages*&lt;/code&gt; buffer is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Running c:/Program Files (x86)/Git/bin/git.exe push -v origin master:refs/heads/master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same shows in the &lt;code&gt;*magit-process*&lt;/code&gt; buffer, more or less. Nothing more useful. I am able to git push from the command line, but it does ask for my ssh key's password. Might that be the problem? I've tried loading the key with Pageant (PuTTY's key agent), but that didn't seem to make a difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's helpful, I have Cygwin installed, and would be happy with a solution that involved forcing Emacs to use Cygwin's executables.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="25" LastEditDate="2014-10-01T12:09:31.210" LastActivityDate="2018-11-07T17:30:22.893" Title="magit-push hangs on Windows" Tags="|magit|microsoft-windows|git|ssh|" AnswerCount="8" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="479" PostTypeId="2" ParentId="475" CreationDate="2014-09-30T00:51:12.263" Score="13" Body="&lt;p&gt;Try setting &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="146" LastEditorUserId="8" LastEditDate="2014-09-30T01:11:27.623" LastActivityDate="2014-09-30T01:11:27.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="480" PostTypeId="2" ParentId="432" CreationDate="2014-09-30T01:01:04.423" Score="2" Body="&lt;p&gt;The Help Text for &lt;code&gt;inhibit-startup-echo-area-message&lt;/code&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil inhibits the initial startup echo area message. Setting this variable takes effect only if you do it with the customization buffer or if your init file contains a line of this form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inhibit-startup-echo-area-message &quot;YOUR-USER-NAME&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;If your init file is byte-compiled, use the following form&#xA;  instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval '(setq inhibit-startup-echo-area-message &quot;YOUR-USER-NAME&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="146" LastEditorUserId="115" LastEditDate="2014-09-30T02:10:08.467" LastActivityDate="2014-09-30T02:10:08.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="481" PostTypeId="2" ParentId="474" CreationDate="2014-09-30T01:44:13.487" Score="28" Body="&lt;p&gt;Different levels of &quot;IDE-ness&quot; exist for different languages, and unfortunately you're never going to get full IDE features without some configuration (if you don't like configuring things, you probably shouldn't use Emacs). CEDET aims to be a complete solution that covers all your needs for supported languages, but I've personally never gotten it working properly; instead, I use a few packages in tandem to cover my IDE bases. I'll go over your points in order, with some solutions for different languages that I know of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/bbatsov/projectile&quot;&gt;projectile&lt;/a&gt; is the closest package to providing a real IDE-like experience. It provides a ton of useful functionality on a per-project basis. You will probably also want some sort of window/workspace management; I use my own solution called &lt;a href=&quot;https://github.com/shosti/wacspace.el&quot;&gt;wacspace&lt;/a&gt;, but other good solutions include &lt;a href=&quot;https://github.com/nex3/perspective-el&quot;&gt;perspective&lt;/a&gt;, &lt;a href=&quot;https://github.com/tlh/workgroups.el&quot;&gt;workgroups&lt;/a&gt;, and &lt;a href=&quot;https://github.com/shosti/elscreen&quot;&gt;elscreen&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Different languages have different ideas of what a &quot;build&quot; is, but &lt;code&gt;M-x compile&lt;/code&gt; can accommodate pretty much anything and makes paging through errors easy (just use &lt;code&gt;next-error&lt;/code&gt;). You can easily customize on a per-project basis using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot;&gt;directory variables&lt;/a&gt; to set &lt;code&gt;compile-command&lt;/code&gt;. You can run &lt;code&gt;compile&lt;/code&gt; with projectile using &lt;code&gt;projectile-compile-project&lt;/code&gt; (&lt;code&gt;C-c p c&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x compile&lt;/code&gt; also has you covered here--errors usually end up one per line in the &lt;code&gt;*compilation*&lt;/code&gt; buffer, with easy paging with &lt;code&gt;next-error&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Jumping to a symbol involves &quot;understanding your code&quot;, and this is where support varies tremendously across languages. For Elisp, you can use the excellent &lt;a href=&quot;https://github.com/purcell/elisp-slime-nav&quot;&gt;elisp-slime-nav&lt;/a&gt;, and then &lt;code&gt;M-.&lt;/code&gt; to jump to definition. Here are some packages that provide similar support for other languages: &lt;a href=&quot;https://github.com/clojure-emacs/cider&quot;&gt;CIDER&lt;/a&gt; (for Clojure); &lt;a href=&quot;http://common-lisp.net/project/slime/&quot;&gt;SLIME&lt;/a&gt; (for Common Lisp); &lt;a href=&quot;https://github.com/dgutov/robe&quot;&gt;robe&lt;/a&gt; (for Ruby); &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Semantic.html&quot;&gt;semantic&lt;/a&gt; or &lt;a href=&quot;http://ffevotte.github.io/clang-tags/&quot;&gt;clang-tags&lt;/a&gt; for C/C++ (disclaimer: I've never used either, so I have no idea whether they work well). If all else fails, you can also use Emacs' built-in TAGS facilities using something like &lt;a href=&quot;http://ctags.sourceforge.net/&quot;&gt;exuberant ctags&lt;/a&gt;, but I've never had anywhere near acceptable results with TAGS.&lt;/li&gt;&#xA;&lt;li&gt;Emacs has very scattered support for debuggers. GDB with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Debuggers.html&quot;&gt;GUD&lt;/a&gt; is your best bet for C-like languages; otherwise, it's pretty much entirely on a per-language basis. (I don't think cross-language visual debugging is really a realistic goal.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-10-02T16:22:10.417" LastActivityDate="2014-10-02T16:22:10.417" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="482" PostTypeId="2" ParentId="476" CreationDate="2014-09-30T02:29:05.840" Score="5" Body="&lt;p&gt;You could write a minor mode that refreshes the rendered webpage after you modify any relevant buffer.&#xA;Of course, doing so after each keystroke would be overkill, so using a timer and rendering when emacs is idling&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick POC would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-html-render-delay 1)&#xA;&#xA;(defun my-html-render-post-command-hook ()&#xA;  (run-with-idle-timer my-html-render-delay nil&#xA;                       (lambda (buffer) &#xA;                         (shr-render-buffer buffer)&#xA;                         (select-window (get-buffer-window buffer))) &#xA;                       (current-buffer)))&#xA;&#xA;(defun my-html-render-install ()&#xA;  (interactive)&#xA;  (add-hook 'post-command-hook 'my-html-render-post-command-hook nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Many things are wrong with this code (window handling is terrible for example, but also it's using &lt;code&gt;shr&lt;/code&gt;, which will most definitely help you with javascript), but it gives the idea.&#xA;Developing a full solution is certainly possible, but it's a small project by itself.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-30T02:29:05.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="483" PostTypeId="2" ParentId="477" CreationDate="2014-09-30T02:43:15.410" Score="16" Body="&lt;p&gt;A quick hack, which I'm not sure will satisfy your use-case would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-agenda-mode-hook&#xA;          (lambda ()&#xA;            (add-hook 'auto-save-hook 'org-save-all-org-buffers nil t)&#xA;            (auto-save-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As long as the Org agenda buffer is open, all org buffers will be saved periodically (it equivalent to what would happen if &lt;code&gt;s&lt;/code&gt; was pressed regularly from the agenda view).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is somewhat abusing &lt;code&gt;auto-save-mode&lt;/code&gt; in that the agenda buffer itself doesn't make much  sense as far as &lt;code&gt;auto-save&lt;/code&gt; is concerned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you happen to use that hack, you'd better make sure that backup files are kept for all your .org files, to be on the safe side.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-30T02:43:15.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="484" PostTypeId="2" ParentId="476" CreationDate="2014-09-30T05:43:26.410" Score="24" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/netguy204/imp.el&quot;&gt;Impatient Mode&lt;/a&gt; will get you most of the way there. &lt;a href=&quot;https://www.youtube.com/watch?v=QV6XVyXjBO8&amp;amp;feature=youtu.be&quot;&gt;Here's a cool video&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's especially handy when doing the first styling and prototyping. Since it renders the current buffer, you'll have to put all your html and css in one buffer, code and tweak until you're happy, then separate it all out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even Javascript can be handled the same way — but it's a bit more tricky, since basically every keystroke is rendering the buffer, you end up with lots of errors and such whilst you're coding!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggested workflow is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a single HTML page, with all non-changing stuff included via tags&lt;/li&gt;&#xA;&lt;li&gt;Start up impatient-mode, open your browser(s) and get to the page&lt;/li&gt;&#xA;&lt;li&gt;Code up a storm&lt;/li&gt;&#xA;&lt;li&gt;Separate your HTML, CSS, JS once you're happy&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Clients are particularly impressed when you can type and have the update visible immediately, often in several browsers &lt;em&gt;at the same time&lt;/em&gt; :)&lt;/p&gt;&#xA;" OwnerUserId="395" LastEditorUserId="25" LastEditDate="2014-09-30T12:49:43.013" LastActivityDate="2014-09-30T12:49:43.013" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="485" PostTypeId="1" AcceptedAnswerId="494" CreationDate="2014-09-30T06:32:15.323" Score="25" ViewCount="1755" Body="&lt;p&gt;One of the things I find annoying in &lt;code&gt;emacs-helm&lt;/code&gt; is the size of the column showing buffer names in &lt;code&gt;helm-buffers-list&lt;/code&gt;. I have searched the documentation and couldn't find how to customize the width of this column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this even possible?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="205" LastEditDate="2014-09-30T10:29:48.630" LastActivityDate="2014-09-30T10:29:48.630" Title="How to widen helm buffer names in `helm-buffers-list`?" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="486" PostTypeId="2" ParentId="478" CreationDate="2014-09-30T07:30:36.563" Score="6" Body="&lt;p&gt;Usually, the problem is that Emacs can't access the password prompt of git on Windows. Thus, it seems to &quot;hang&quot; on push, where it really is waiting for your password. You can circumvent this by using an ssh key instead of a username/password in your git repo, and doing the first push manually in the shell (git will remember your ssh password after the first push).&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2014-09-30T07:30:36.563" CommentCount="1" CommunityOwnedDate="2014-09-30T07:30:36.563" ContentLicense="CC BY-SA 3.0" />
  <row Id="487" PostTypeId="1" AcceptedAnswerId="491" CreationDate="2014-09-30T08:08:23.327" Score="5" ViewCount="2703" Body="&lt;p&gt;Is it possible to set a default username (i.e.: my Github user name) for magit? It is prompting for the user every time I have to push a commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't know if this may help with the answer, but I already have my username and my e-mail in &lt;code&gt;~/.gitconfig&lt;/code&gt; as per magit's manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The default is determined by the &lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt; git configuration settings.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="219" LastEditorUserId="25" LastEditDate="2014-09-30T12:53:33.520" LastActivityDate="2014-09-30T12:53:33.520" Title="magit: how to set default username?" Tags="|magit|git|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="488" PostTypeId="2" ParentId="457" CreationDate="2014-09-30T08:18:00.250" Score="1" Body="&lt;p&gt;These are probably not exactly what you want, but may be useful.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm using the &lt;code&gt;linum-mode&lt;/code&gt; minor mode in all my buffers (set &lt;code&gt;(global-linum-mode t)&lt;/code&gt; in your init file). This shows line numbers only for the lines that have a newline character at the end. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another thing you might like is enabling &lt;code&gt;whitespace-mode&lt;/code&gt;, by default this shows grey &lt;code&gt;$&lt;/code&gt; signs on empty lines, thus allowing you to see which lines are empty. See &lt;a href=&quot;http://www.emacswiki.org/emacs/WhiteSpace&quot; rel=&quot;nofollow&quot;&gt;the Emacs Wiki page here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In a similar way, setting &lt;code&gt;indicate-empty-lines&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; will show you where the last line is (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Indicators.html&quot; rel=&quot;nofollow&quot;&gt;the manual for fringe indicators here&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="421" LastActivityDate="2014-09-30T08:18:00.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="489" PostTypeId="2" ParentId="477" CreationDate="2014-09-30T08:27:58.357" Score="5" Body="&lt;p&gt;I use the following snippet to automatically save all the agenda mode buffers after a new capture, but you could hook it anywhere you'd like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/save-all-agenda-buffers ()&#xA;  &quot;Function used to save all agenda buffers that are&#xA;currently open, based on `org-agenda-files'.&quot;&#xA;  (interactive)&#xA;  (save-current-buffer&#xA;    (dolist (buffer (buffer-list t))&#xA;      (set-buffer buffer)&#xA;      (when (member (buffer-file-name)&#xA;                    (mapcar 'expand-file-name (org-agenda-files t)))&#xA;        (save-buffer)))))&#xA;&#xA;;; save all the agenda files after each capture&#xA;(add-hook 'org-capture-after-finalize-hook 'my/save-all-agenda-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Change the &lt;code&gt;'org-capture-after-finalize-hook&lt;/code&gt; to &lt;code&gt;'org-agenda-finalize-hook&lt;/code&gt;, which I believe is called just before displaying the agenda buffer.&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="379" LastEditDate="2014-09-30T13:21:43.923" LastActivityDate="2014-09-30T13:21:43.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="490" PostTypeId="1" AcceptedAnswerId="493" CreationDate="2014-09-30T08:32:44.857" Score="8" ViewCount="692" Body="&lt;p&gt;When I have a lot of buffers open and I use &lt;code&gt;helm-mini&lt;/code&gt; to look through them, I notice that deeply-nested or tramp buffers take up too much horizontal space, causing them to wrap around, like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zeQoO.png&quot; alt=&quot;buffer-wraparound&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get helm to truncate these lines so they don't wrap around? Toggling &lt;code&gt;truncate-lines&lt;/code&gt; when the helm buffer is open doesn't take effect.&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2023-02-24T06:32:57.790" Title="How to truncate buffer information in helm list" Tags="|helm|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="491" PostTypeId="2" ParentId="487" CreationDate="2014-09-30T08:35:33.580" Score="5" Body="&lt;p&gt;&lt;code&gt;user.name&lt;/code&gt; in your .gitconfig is only for authorship of commits, and not used for authentication. It seems you are using password authentication before pushing to github.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-09-30T08:35:33.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="492" PostTypeId="2" ParentId="408" CreationDate="2014-09-30T08:36:39.697" Score="7" Body="&lt;p&gt;An alternative approach would be the following: since I do not only want to synchronise my Emacs packages, but also other files (e.g. &lt;code&gt;.emacs&lt;/code&gt;, &lt;code&gt;.bashrc&lt;/code&gt;, but also other directories) between my server and my laptop, I started to use &lt;a href=&quot;http://www.cis.upenn.edu/~bcpierce/unison/&quot;&gt;&lt;code&gt;unison&lt;/code&gt;&lt;/a&gt;, to sync the files and directories. So when working on my laptop I simple run &lt;code&gt;unison laptop&lt;/code&gt; before anything else. My &lt;code&gt;~/.unison/laptop.prf&lt;/code&gt; file has the following section for Emacs related files: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;path = .emacs&#xA;path = .emacs.d&#xA;ignore = Path {.emacs.d/semanticdb}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since my Emacs packages (and also my Emacs backups and bookmarks) are stored in &lt;code&gt;~/.emacs.d&lt;/code&gt; this makes sure I've got everything on all my machines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative approach would be put the &lt;code&gt;.emacs.d&lt;/code&gt; directory in a directory that is synced with OwnCloud, DropBox or any other file syncing service and then create symlinks from &lt;code&gt;~/.emacs.d&lt;/code&gt; to that shared directory. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2014-09-30T08:36:39.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="493" PostTypeId="2" ParentId="490" CreationDate="2014-09-30T09:02:21.917" Score="7" Body="&lt;p&gt;The relevant setting is &lt;code&gt;helm-buffers-truncate-lines&lt;/code&gt; which truncates lines when non-nil. You can use &lt;code&gt;M-x customize-variable helm-buffers-truncate-lines&lt;/code&gt; to toggle it.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="9977" LastEditDate="2018-04-22T14:53:34.077" LastActivityDate="2018-04-22T14:53:34.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="494" PostTypeId="2" ParentId="485" CreationDate="2014-09-30T09:07:55.013" Score="31" Body="&lt;p&gt;You should customize &lt;code&gt;helm-buffer-max-length&lt;/code&gt; to an appropriate number. Default I believe is 20. If set to &lt;code&gt;nil&lt;/code&gt;, helm will use the longest buffer name. You can access the customization setup by &lt;code&gt;M-x customize-variable helm-buffer-max-length&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-09-30T09:07:55.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="495" PostTypeId="1" CreationDate="2014-09-30T10:20:36.837" Score="9" ViewCount="6323" Body="&lt;p&gt;In my setup, I have several (GNU) Emacs instances running simultaneously on my local machine, one for each project or task that I'm currently working on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to open buffers in an already running Emacs instance, for example by a command like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://superuser.com/questions/462451&quot;&gt;typically suggested solution&lt;/a&gt; to this is to run Emacs in server mode. However, this conflicts with my use of multiple Emacs instances, as I understand that by default only a single emacsclient can be active at any time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I open files as buffers in existing (possibly multiple) Emacs instances? The final goal is to open the file in the Emacs instance that is in the current workspace (Compiz), or to create such an instance if it doesn't already exist.&lt;/p&gt;&#xA;" OwnerUserId="338" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2024-02-26T05:59:18.537" Title="Multiple Emacs instances each with their own server?" Tags="|emacsclient|server|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="496" PostTypeId="2" ParentId="495" CreationDate="2014-09-30T10:25:55.497" Score="0" Body="&lt;p&gt;As far as I know, you can use Emacs in server mode to get what you are looking for. I often have multiple emacsclient instances in different workspaces, which, for instance, enables me to easily share buffers between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I do:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;start &lt;code&gt;emacs --daemon&lt;/code&gt; in my &lt;code&gt;.xinitrc&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;run &lt;code&gt;emacsclient -c&lt;/code&gt; in workspace 2&lt;/li&gt;&#xA;&lt;li&gt;run &lt;code&gt;emacsclient -t&lt;/code&gt; in workspace 1 (when I usually keep a fullscreen tmux)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I can edit buffers in each instance, moving quickly from term to GUI and viceversa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more approaches in &lt;a href=&quot;https://emacs.stackexchange.com/questions/41/start-two-separate-emacs-daemons-for-console-and-gui&quot;&gt;Start two separate emacs daemons for console and GUI&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-09-30T13:01:02.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="497" PostTypeId="5" CreationDate="2014-09-30T10:42:26.200" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-09-30T10:42:26.200" LastActivityDate="2014-09-30T10:42:26.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="498" PostTypeId="4" CreationDate="2014-09-30T10:42:26.200" Score="0" Body="Use this tag for questions about moving, deleting, or opening files. Or for questions about the difference between a buffer and its file. For topics such as &quot;Saving Files&quot;, use &quot;buffers&quot; instead." OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-30T18:13:41.470" LastActivityDate="2014-09-30T18:13:41.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="499" PostTypeId="1" AcceptedAnswerId="510" CreationDate="2014-09-30T10:43:03.040" Score="6" ViewCount="413" Body="&lt;p&gt;I currently I have a couple of org-babel shell &lt;a href=&quot;http://people.linaro.org/~alex.bennee/org/apm.html#sec-2-2&quot; rel=&quot;nofollow&quot;&gt;snippets&lt;/a&gt; to package up a build and push it to a server for later usage. This also handily keeps a reference to the last execution of the snippet so I can remember what was last uploaded and when.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking I could further automate my process by hooking into &lt;code&gt;compilation-finish-functions&lt;/code&gt; to look-up a babel snippet and execute it on successful compilation. What's the best way to organise the babel snippets and call the snippets programmatically? I was wondering if I can use &lt;code&gt;:tags:&lt;/code&gt; or if I can just call up the snippet by &lt;code&gt;#+:NAME&lt;/code&gt; by searching all my &lt;code&gt;org-agenda-files&lt;/code&gt;. I was planning in storing the target babel function in the project's &lt;code&gt;.dir-locals.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be nice to mark a snippet as trusted whilst it was unchanged so I didn't need to confirm every execution.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-09-30T15:50:56.087" LastActivityDate="2014-09-30T16:24:22.220" Title="Finding and executing org-babel snippets programatically" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="500" PostTypeId="2" ParentId="461" CreationDate="2014-09-30T11:52:30.267" Score="4" Body="&lt;p&gt;For a clear answer to part 2 (How can I add additional custom directories to the list?):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the following elisp to customize your &lt;code&gt;exec-path&lt;/code&gt; variable to include any additional directories&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;/custom/directory/path&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Use case&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Although the other answers specify how to add to your &lt;code&gt;$PATH&lt;/code&gt; (&lt;code&gt;%PATH%&lt;/code&gt; on Windows) there are cases where this is not really a solution, particularly in a Windows environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have Cygwin installed and do not want to include &lt;code&gt;c:\cygwin\bin&lt;/code&gt; in &lt;code&gt;%PATH%&lt;/code&gt; (user or system) because it will overwrite certain DOS built-in commands (&lt;code&gt;Find&lt;/code&gt;) and could break any scripts that call them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding it directly to &lt;code&gt;exec-path&lt;/code&gt; within Emacs on startup can ensure you get full access to those tools within the editor, without installing Cygwin Emacs.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-09-30T11:52:30.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="501" PostTypeId="1" AcceptedAnswerId="504" CreationDate="2014-09-30T12:38:56.050" Score="14" ViewCount="2902" Body="&lt;p&gt;There are certain things like the display of trailing whitespace, display of buffer boundaries, rainbow-colored delimiters and many more I'd like to enable in most modes or rather, all programming- and text-related ones (because displaying trailing spaces in, say &lt;code&gt;ediff-mode&lt;/code&gt;, would clash with the major mode) instead of using a globalized minor mode with exception rules. Since most modes are derived from either &lt;code&gt;prog-mode&lt;/code&gt; or &lt;code&gt;text-mode&lt;/code&gt;, adding the function in question to both &lt;code&gt;prog-mode-hook&lt;/code&gt; and &lt;code&gt;text-mode-hook&lt;/code&gt; does work, however there are enough modes not following this specification, such as &lt;code&gt;css-mode&lt;/code&gt; or &lt;code&gt;LaTeX-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to define a hook that encompasses all these modes for the time being to only add functions to one hook. Let's call it &lt;code&gt;non-special-mode-hook&lt;/code&gt; (to distinguish it from &lt;code&gt;special-mode-hook&lt;/code&gt;). How would I be able to create such a hook that is run for all major modes it is made for?&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="50" LastEditDate="2014-10-03T16:17:19.407" LastActivityDate="2024-03-13T15:42:43.250" Title="How do I &quot;group&quot; hooks?" Tags="|init-file|" AnswerCount="7" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="502" PostTypeId="2" ParentId="501" CreationDate="2014-09-30T12:53:21.627" Score="5" Body="&lt;p&gt;You could add a function to &lt;code&gt;after-change-major-mode-hook&lt;/code&gt;, that checks whether the new mode is an interesting one (possibly through &lt;code&gt;(not (derived-mode-p 'special-mode))&lt;/code&gt;), and if so runs &lt;code&gt;non-special-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-09-30T12:53:21.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="503" PostTypeId="2" ParentId="501" CreationDate="2014-09-30T12:54:18.583" Score="2" Body="&lt;p&gt;Rather than define a new hook that works for all these &lt;em&gt;non-derived&lt;/em&gt; modes you can do the following.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-my-hooks ()&#xA;  &quot;Run all the following functions in the hook&quot;&#xA;  (smartparens-mode 1)&#xA;  (whitespace-mode 1)&#xA;  (my-needed-mode 1)&#xA;  ...)&#xA;&#xA;(add-hook 'specific-mode-hook 'run-my-hooks)&#xA;(add-hook 'another-mode-hook 'run-my-hooks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll still need to add it to all the modes, but by defining your function to include all the modes you will only have to change one definition when adding/removing addtional features.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2014-09-30T23:32:49.160" LastActivityDate="2014-09-30T23:32:49.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="504" PostTypeId="2" ParentId="501" CreationDate="2014-09-30T12:54:41.587" Score="20" Body="&lt;p&gt;Just group those settings together into a function, and add that function to all of the relevant hook functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-non-special-mode-setup ()&#xA;  (setq show-trailing-whitespace t)&#xA;  ...)&#xA;(dolist (hook '(prog-mode-hook text-mode-hook css-mode-hook ...))&#xA;  (add-hook hook 'my-non-special-mode-setup))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No other way to do this would be more concise: whatever happens, somewhere you're going to have either a whitelist or blacklist of modes. In practice, you'll only find a few modes which need adding to the list, so I'd suggest just keeping things simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my own config, I &lt;a href=&quot;https://github.com/purcell/emacs.d/blob/168cd09e01518cde9af72df09ea54fd396b88b47/lisp/init-lisp.el#L147-L176&quot;&gt;use exactly this trick&lt;/a&gt; to unify the configuration of several lisp-oriented modes.&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="50" LastEditDate="2014-09-30T14:53:48.673" LastActivityDate="2014-09-30T14:53:48.673" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="505" PostTypeId="2" ParentId="495" CreationDate="2014-09-30T13:12:30.377" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/59/147&quot;&gt;This answer&lt;/a&gt; has the general method, though the question was different than yours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;emacs --daemon=workspaceN&lt;/code&gt; combined with &lt;code&gt;emacsclient -s workspaceN&lt;/code&gt; to have an emacs daemon on workspace N. If you need multiple, simply do workspace1, workspace2, etc. Note that the daemon name is entirely arbitrary and you can use whatever naming scheme you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Determining which workspace you're in will likely be more difficult, and I do not know how to determine it. If you have an environment variable then a shell alias or function will likely do the trick (if you only want to open things via shell).&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-09-30T13:12:30.377" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="506" PostTypeId="1" CreationDate="2014-09-30T13:39:31.887" Score="63" ViewCount="9809" Body="&lt;p&gt;I am using mew for my e-mail.  I need to use TLS with my email provider for SMTP.  However, when I try to invoke that, Emacs freezes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to take this opportunity to learn more about Emacs packages.  How would I go about debugging this issue?  Is there some kind of built-in debugger, like in Common Lisp?  Could I use logging?&lt;/p&gt;&#xA;" OwnerUserId="438" LastEditorUserId="25" LastEditDate="2017-02-22T13:40:17.137" LastActivityDate="2022-01-05T23:21:39.643" Title="Debugging a frozen Emacs" Tags="|debugging|quitting|frozen-emacs|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="507" PostTypeId="2" ParentId="506" CreationDate="2014-09-30T13:46:28.713" Score="44" Body="&lt;p&gt;If the freeze goes away when you hit &lt;code&gt;C-g&lt;/code&gt;, then you can use the built-in debugger.  Type &lt;code&gt;M-x toggle-debug-on-quit&lt;/code&gt; before sending the message, hit &lt;code&gt;C-g&lt;/code&gt; when it freezes, and inspect the &lt;code&gt;*Backtrace*&lt;/code&gt; buffer that comes up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;C-g&lt;/code&gt; doesn't help, then the freeze probably happens in the C code, and you'll need to use an external debugger such as &lt;code&gt;gdb&lt;/code&gt;.  Hit &lt;code&gt;C-h C-d&lt;/code&gt; to see the &lt;code&gt;DEBUG&lt;/code&gt; file which gives some hints about how to do that.  (You can also &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/DEBUG&quot; rel=&quot;noreferrer&quot;&gt;read the DEBUG file in the Emacs repository web interface&lt;/a&gt;.)  &lt;a href=&quot;https://emacs.stackexchange.com/a/14376/11&quot;&gt;This answer&lt;/a&gt; goes into more details about how to use &lt;code&gt;gdb&lt;/code&gt; with Emacs.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-05-18T10:31:56.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="508" PostTypeId="1" AcceptedAnswerId="509" CreationDate="2014-09-30T13:53:34.607" Score="5" ViewCount="736" Body="&lt;p&gt;I have the following code from Intellij's indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public static String[] defaultMethodBlacklist = new String[]{&#xA;        &quot;getClass&quot;,&#xA;        &quot;wait&quot;,&#xA;        &quot;notify&quot;,&#xA;        &quot;notifyAll&quot;,&#xA;        &quot;finalize&quot;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public InternalClusterInfoService(Settings settings, NodeSettingsService nodeSettingsService,&#xA;                                  TransportNodesStatsAction transportNodesStatsAction,&#xA;                                  TransportIndicesStatsAction transportIndicesStatsAction, ClusterService clusterService,&#xA;                                  ThreadPool threadPool) {&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I attempt to adjust/fix the indentation in Emacs, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public static String[] defaultMethodBlacklist = new String[]{&#xA;    &quot;getClass&quot;,&#xA;    &quot;wait&quot;,&#xA;    &quot;notify&quot;,&#xA;    &quot;notifyAll&quot;,&#xA;    &quot;finalize&quot;&#xA;};&#xA;&#xA;public InternalClusterInfoService(Settings settings, NodeSettingsService nodeSettingsService,&#xA;        TransportNodesStatsAction transportNodesStatsAction,&#xA;        TransportIndicesStatsAction transportIndicesStatsAction, ClusterService clusterService,&#xA;        ThreadPool threadPool) {&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My current indentation configuration looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (c-offsets-alist . ((inline-open . 0)&#xA;                      (topmost-intro-cont    . +)&#xA;                      (statement-block-intro . +)&#xA;                      (knr-argdecl-intro     . 5)&#xA;                      (substatement-open     . +)&#xA;                      (substatement-label    . +)&#xA;                      (label                 . +)&#xA;                      (statement-case-open   . +)&#xA;                      (statement-cont        . ++)&#xA;                      (arglist-intro  . ++)&#xA;                      (arglist-close  . ++)&#xA;                      (arglist-cont-nonempty . ++)&#xA;                      (access-label   . 0)&#xA;                      (inher-cont     . ++)&#xA;                      (func-decl-cont . ++))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I configure the indentation in emacs to match Intellij's for code like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how can I diagnose and fix issues like this in the future myself? Is there a way to get which &quot;type&quot; of indentation is being used at a particular point?&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorDisplayName="user227" LastEditDate="2014-09-30T14:45:16.803" LastActivityDate="2014-09-30T14:55:39.007" Title="How to configure specific Java indentation?" Tags="|indentation|java|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="509" PostTypeId="2" ParentId="508" CreationDate="2014-09-30T14:55:39.007" Score="8" Body="&lt;p&gt;You can make your style look like this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((c-basic-offset . 8)&#xA;  (c-offsets-alist . ((inline-open . 0)&#xA;                      (topmost-intro-cont    . +)&#xA;                      (statement-block-intro . +)&#xA;                      (knr-argdecl-intro     . 5)&#xA;                      (substatement-open     . +)&#xA;                      (substatement-label    . +)&#xA;                      (label                 . +)&#xA;                      (statement-case-open   . +)&#xA;                      (statement-cont        . ++)&#xA;                      (arglist-intro  . c-lineup-arglist-intro-after-paren)&#xA;                      (arglist-close  . c-lineup-arglist)&#xA;                      (access-label   . 0)&#xA;                      (inher-cont     . ++)&#xA;                      (func-decl-cont . ++))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As legoscia points out, &lt;code&gt;C-c C-s&lt;/code&gt; gives valuable insight regarding the syntactic symbols used. But you'll also need the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/ccmode/Syntactic-Symbols.html&quot;&gt;list of those symbols&lt;/a&gt; to look for what you really need.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-09-30T14:55:39.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="510" PostTypeId="2" ParentId="499" CreationDate="2014-09-30T16:24:22.220" Score="4" Body="&lt;p&gt;For the first part, the following can move to a specific named snippet and execute it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/invoke-babel-named (name)&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (org-babel-goto-named-src-block name)&#xA;    (org-babel-execute-src-block-maybe)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can define snippets as trusted/untrusted based on varying factors, however I don't think there is any built-in mechanism to trust based on content.  The following should work based on limited testing (2 code blocks of different languages, making a few changes to ensure it re-prompted).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my/babel-hashes 'nil)&#xA;(defun my/babel-hashed-confirm (lang body)&#xA;  (let ((check (list lang (md5 body))))&#xA;    ;; If not hashed, prompt&#xA;    (if (not (member (list lang (md5 body)) my/babel-hashes))&#xA;        ;; Ask if you want to hash&#xA;        (if (yes-or-no-p &quot;Store hash for block? &quot;)&#xA;            ;; Hash is added, proceed with evaluation&#xA;            (progn&#xA;              (add-to-list 'my/babel-hashes check)&#xA;              'nil)&#xA;          ;; Return 't to prompt for evaluation&#xA;          't))))&#xA;&#xA;(setq org-confirm-babel-evaluate 'my/babel-hashed-confirm)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-babel-confirm-evaluate&lt;/code&gt; does not provide the code block name so the hash will be added for every change rather than stored on a per-block basis.  The downside being frequent changes will lead to a very large hash.  The upside being that reverting changes to the code block will still have the hash in memory if already accepted.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-09-30T16:24:22.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="511" PostTypeId="2" ParentId="501" CreationDate="2014-09-30T16:49:59.553" Score="4" Body="&lt;p&gt;I found myself often doing @sanityinc's pattern of wrapping my settings and minor mode activations in a defun and looping through hooks to call it, but I wanted a cleaner approach so I wrote this macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro hook-modes (modes &amp;amp;rest body)&#xA;  (declare (indent 1))&#xA;  `(--each ,modes&#xA;     (add-hook (intern (format &quot;%s-hook&quot; it))&#xA;               (lambda () ,@body))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: I'm &lt;a href=&quot;https://github.com/magnars/dash.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dash.el&lt;/code&gt;&lt;/a&gt; for cleanliness but it could easily be adapted to use &lt;code&gt;(dolist)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can define grouped modes as list variables and use it like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar progish-modes&#xA;  '(prog-mode css-mode sgml-mode))&#xA;&#xA;(hook-modes progish-modes&#xA;  (highlight-symbol-mode)&#xA;  (highlight-symbol-nav-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="264" LastActivityDate="2014-09-30T16:49:59.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="512" PostTypeId="1" AcceptedAnswerId="513" CreationDate="2014-09-30T17:18:42.477" Score="11" ViewCount="2489" Body="&lt;p&gt;I don't know whether this is possible or not.&#xA;I know I can edit remote files, but what I am looking for is a setup like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;one buffer with dired on my local directory&lt;/li&gt;&#xA;&lt;li&gt;one buffer with dired on the remote directory&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Sort of a visual aid when updating my files on the remote directory. Marking multiple files and updating them via FTP would be quick if it was possible from this kind of configuration.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="25" LastEditDate="2014-09-30T20:33:13.027" LastActivityDate="2018-07-10T13:35:07.727" Title="Dired as an FTP client" Tags="|dired|ftp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="513" PostTypeId="2" ParentId="512" CreationDate="2014-09-30T17:39:51.540" Score="12" Body="&lt;p&gt;Yes, you can do that.  You don't need to (explicitly) use FTP.  Just use &lt;code&gt;C&lt;/code&gt; in Dired to copy from one directory to the other. You can copy in either direction: from local to remote or remote to local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Dired buffer #1 is for local directory &lt;code&gt;~jpepin/mydir/&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Dired buffer #1 is for remote directory &lt;code&gt;/foo.bar.toto.com:/home/jpepin/mydir/&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(&lt;strong&gt;&lt;em&gt;Tip:&lt;/em&gt;&lt;/strong&gt; Create a Dired &lt;em&gt;bookmark&lt;/em&gt; to your remote directory (and perhaps another to your local directory). Dired bookmarks are especially handy if you use &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;. You can also bookmark a Dired tree: a set of Dired bookmarks.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-07-10T13:35:07.727" LastActivityDate="2018-07-10T13:35:07.727" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="514" PostTypeId="1" AcceptedAnswerId="518" CreationDate="2014-09-30T17:40:38.623" Score="1" ViewCount="226" Body="&lt;p&gt;I'm using org-mode with predictive and having an issue with predictive changing a key binding that org-mode uses. Specifically, predictive changes M-tab and I prefer to keep org-mode's definition of M-tab. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm loading up predictive with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'org-mode-hook 'predictive-mode)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which makes me think that I can do something like:&#xA;&lt;code&gt;(eval-after-load 'org-mode&#xA;    '(define-key....&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm not sure if this is the correct &quot;emacs&quot; way to solve this problem. &lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="50" LastEditDate="2014-10-03T15:36:51.567" LastActivityDate="2014-10-03T15:36:51.567" Title="org-mode with predictive mode key conflict" Tags="|org-mode|keymap|predictive-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="515" PostTypeId="2" ParentId="512" CreationDate="2014-09-30T17:42:41.780" Score="3" Body="&lt;p&gt;Have you had a look at &lt;a href=&quot;https://github.com/escherdragon/sunrise-commander&quot; rel=&quot;nofollow&quot;&gt;Sunrise Commander&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/Sunrise_Commander&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki page&lt;/a&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It builds on Dired to provide a 2 pane file manager similar to Norton Commander and Midnight Commander.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can let you view both directories (as long as you can access the second directory through TRAMP it should be able to be accessed through Dired).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commands at that point mirror Dired where applicable.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-09-30T17:42:41.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="516" PostTypeId="5" CreationDate="2014-09-30T18:08:11.583" Score="0" Body="&lt;p&gt;Use this tag to ask questions about&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Helm&lt;/code&gt; installation and configuration&lt;/li&gt;&#xA;&lt;li&gt;Changing &lt;code&gt;Helm&lt;/code&gt; behavior&lt;/li&gt;&#xA;&lt;li&gt;Integrating &lt;code&gt;Helm&lt;/code&gt; completion with other commands&lt;/li&gt;&#xA;&lt;li&gt;Debugging &lt;code&gt;Helm&lt;/code&gt; issues&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-09-30T18:36:44.663" LastActivityDate="2014-09-30T18:36:44.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="517" PostTypeId="4" CreationDate="2014-09-30T18:08:11.583" Score="0" Body="Helm is an incremental completion and narrowing framework for Emacs. It is available for installation from MELPA." OwnerUserId="108" LastEditorUserId="504" LastEditDate="2014-11-04T12:44:21.543" LastActivityDate="2014-11-04T12:44:21.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="518" PostTypeId="2" ParentId="514" CreationDate="2014-09-30T18:37:01.433" Score="2" Body="&lt;p&gt;First of all, are you sure that the &lt;code&gt;M-tab&lt;/code&gt; binding you like is from Org mode? The version of Org-mode I'm using (7.9.3f, from emacs 24.3) doesn't bind &lt;code&gt;M-tab&lt;/code&gt;, if I'm reading things right. Check &lt;code&gt;C-h k M-TAB&lt;/code&gt; to be sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's what you want, add it to a hook function (you don't want &lt;code&gt;eval-after-load&lt;/code&gt;, because that will only be executed when the org-mode library loads, not whenever you start org-mode, which is what you want). Something like this &lt;em&gt;(warning: untested, because I haven't installed predictive)&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fixup-org-mode-keys ()&#xA;  (let* ((key     [(meta tab)])&#xA;         (binding (lookup-key org-mode-map key)))&#xA;    (require 'predictive)&#xA;    (predictive-mode 1)&#xA;    (local-set-key key binding)))&#xA;(add-hook 'org-mode-hook 'fixup-org-mode-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If that's not the command you want, replace the &lt;code&gt;lookup-key&lt;/code&gt; expression above with whatever function &lt;code&gt;C-h k M-TAB&lt;/code&gt; reports, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   ...(let* ((key     [(meta tab)])&#xA;             (binding 'pcomplete))&#xA;   ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;An alternative method&lt;/strong&gt; is to disable predictive's &lt;code&gt;M-TAB&lt;/code&gt; binding altogether. This is simpler, but has the effect of removing this binding &lt;em&gt;everywhere&lt;/em&gt;. You may or may not like that, it's up to you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'predictive (define-key predictive-map [(meta tab)] nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="321" LastActivityDate="2014-09-30T18:37:01.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="519" PostTypeId="1" AcceptedAnswerId="520" CreationDate="2014-09-30T18:42:49.567" Score="17" ViewCount="3890" Body="&lt;p&gt;Is it possible to set key bindings specific to buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following in one of my org files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# eval: (local-set-key (kbd &quot;&amp;lt;f10&amp;gt;&quot;) 'some-custom-defun-specific-to-this-buffer)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this binding persists for other org-mode files too. If I open a file with a different major mode, then my default key binding kicks in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like &lt;code&gt;local-set-key&lt;/code&gt; is setting bindings specific to the major-mode not specific to the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I have bindings that activate only in a particular buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2015-05-14T00:17:33.600" LastActivityDate="2015-07-31T16:54:52.677" Title="Key bindings specific to a buffer" Tags="|key-bindings|keymap|file-local-variables|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="520" PostTypeId="2" ParentId="519" CreationDate="2014-09-30T19:26:49.593" Score="18" Body="&lt;p&gt;For closure, here is an answer that expands upon my comment. I define a minor mode with the required keybinding and toggle it in the required buffer using file local variables. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (define-minor-mode my-org-buffer-local-mode&#xA;    &quot;Minor mode to simulate buffer local keybindings.&quot;&#xA;    :init-value nil)&#xA;  (define-key my-org-buffer-local-mode-map (kbd &quot;&amp;lt;f10&amp;gt;&quot;) 'some-custom-defun-specific-to-this-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can toggle it in necessary files by setting the local variables section at the end of the file as follows. You can also change or add the keybinding here. &lt;strong&gt;You will still need to define different minor modes for each buffer that maps the same key-sequence to different commands.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; # Local Variables:&#xA; # my-org-buffer-local-mode: t&#xA; # eval:(define-key my-org-buffer-local-mode-map (kbd &quot;&amp;lt;f10&amp;gt;&quot;) 'some-other-custom-defun-specific-to-this-buffer)&#xA; # End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="108" LastEditorUserId="115" LastEditDate="2014-09-30T20:31:15.167" LastActivityDate="2014-09-30T20:31:15.167" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="521" PostTypeId="1" AcceptedAnswerId="522" CreationDate="2014-09-30T19:32:00.677" Score="4" ViewCount="642" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.emacswiki.org/JabberEl&quot; rel=&quot;nofollow&quot;&gt;jabber.el&lt;/a&gt; to communicate with people at work, and I have sound&#xA;notifications setup so that I get notified even when I’m not using&#xA;Emacs. The notification is setup in the following way.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'jabber-alert-message-hooks #'my-jabber-sound-notification)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is: when I’m actually writing in Emacs I already have&#xA;access to mode-line notifications, and the sound notifications are just a&#xA;useless distraction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to disable sound notifications while Emacs has focus?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I could write something with an idle timer. But if there’s a&#xA;way to check if Emacs has focus in the window manager, that would be&#xA;much nicer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Using Emacs 24.4&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-09-30T20:18:31.707" LastActivityDate="2014-10-01T18:15:39.763" Title="Turn off jabber notifications when Emacs has focus" Tags="|frames|hooks|jabber|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="522" PostTypeId="2" ParentId="521" CreationDate="2014-09-30T19:37:19.750" Score="7" Body="&lt;p&gt;In Emacs 24.4 you should be able to use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'focus-out-hook #'turn-on-my-jabber-sound)&#xA;(add-hook 'focus-in-hook #'turn-off-my-jabber-sound)&#xA;&#xA;(defun turn-on-my-jabber-sound ()&#xA;  ;; t for `on'&#xA;  (setq my-jabber-sound 't))&#xA;&#xA;(defun turn-off-my-jabber-sound ()&#xA;  ;; nil for `off'&#xA;  (setq my-jabber-sound 'nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then test if &lt;code&gt;my-jabber-sound&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt; when executing &lt;code&gt;my-jabber-sound-notification&lt;/code&gt; (pseudo-lisp below):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(...&#xA;  (when my-jabber-sound&#xA;    (&amp;lt;play sound&amp;gt;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-09-30T19:37:19.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="523" PostTypeId="2" ParentId="411" CreationDate="2014-09-30T19:44:19.297" Score="11" Body="&lt;p&gt;As paprika said, Emacs uses &lt;code&gt;load-path&lt;/code&gt; to search for list available &lt;code&gt;elisp&lt;/code&gt; files (&lt;code&gt;.elc&lt;/code&gt;, &lt;code&gt;.el&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;load-path&lt;/code&gt; is searched for the first matching package when it is being required.  If multiple copies of a package are installed, then the first one will be loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distro package manager cannot install to the same source as &lt;code&gt;package-install&lt;/code&gt; does, since one is system-wide and the other is user-specific.  &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Package Sources&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Built-in and Distro-Specific&lt;/h3&gt;&#xA;&#xA;Distro Package Manager&#xA;&#xA;&lt;p&gt;Distro package managers provide a selection of emacs packages that can be installed.  In my experience these are often among the more popular/widely-used packages.  Prior to the development of &lt;code&gt;package.el&lt;/code&gt; this was the &lt;em&gt;easiest&lt;/em&gt; way to obtain the packages.  (Easiest by virtue of just running &lt;code&gt;apt-get install &amp;lt;package&amp;gt;&lt;/code&gt; as opposed to using version-control or direct download.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Packages installed through the distro package manager are installed to &lt;code&gt;/usr/local/share/emacs/site-lisp/&lt;/code&gt; which is a default in the &lt;code&gt;load-path&lt;/code&gt; and will be hidden by user-specific &lt;code&gt;load-path&lt;/code&gt; additions.&lt;/p&gt;&#xA;&#xA;Package.el&#xA;&#xA;&lt;p&gt;&lt;code&gt;package.el&lt;/code&gt; was first included with &lt;code&gt;Emacs 24&lt;/code&gt;.  &lt;a href=&quot;http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;This version&lt;/a&gt; is compatible with &lt;code&gt;Emacs 23&lt;/code&gt; but needs to be installed manually, packages retrieved by it may or may not be compatible with &lt;code&gt;Emacs 23&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package.el&lt;/code&gt; provides a browseable repository of packages for Emacs.  By default only the &lt;code&gt;Elpa&lt;/code&gt; repository is configured, but access to &lt;a href=&quot;http://melpa.milkbox.net&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt; and &lt;a href=&quot;http://marmalade-repo.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Marmelade&lt;/a&gt; can be added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This provides access to a much larger pool of packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;package.el&lt;/code&gt; installs packages to &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; and when &lt;code&gt;(package-initialize)&lt;/code&gt; is called this directory will be placed closer to the front of the &lt;code&gt;load-path&lt;/code&gt;, resulting in these packages taking precedence over those installed with by the distribution package manager.&lt;/p&gt;&#xA;&#xA;Git/Bzr/hg/... + EmacsWiki&#xA;&#xA;&lt;p&gt;Version controlled packages can be manually retrieved from their repository through cloning.  Some also provide packaged releases that can be downloaded directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EmacsWiki Elisp files can also be downloaded, although they are typically single files rather than directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the package is retrieved, ensure that the destination folder is on your &lt;code&gt;load-path&lt;/code&gt; and it will be available to use.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;3rd-Party package management&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;These tools provide wrappers or additional functionality over the above to centralize package management.  They are designed with shared configuration in mind to ensure all your machines have the same packages available.&lt;/p&gt;&#xA;&#xA;El-Get&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/dimitri/el-get&quot; rel=&quot;nofollow noreferrer&quot;&gt;El-Get&lt;/a&gt; maintains a list of recipes that allow it to retrieve packages using &lt;code&gt;package.el&lt;/code&gt;, &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;emacswiki&lt;/code&gt; as sources (among others).  It also provides functions to ensure packages are up-to-date, manage loading (deferred or immediate), and store package-specific customization in files that are loaded automatically when the package is &lt;code&gt;required&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;Cask&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/cask/cask&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cask&lt;/a&gt; is designed for project management in/for Emacs.  It uses a &lt;code&gt;cask&lt;/code&gt; file to maintain a list of dependencies (other packages) required to use the package, and will download missing packages to ensure everything loads successfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be used to manage local package configurations by treating your &lt;code&gt;~/.emacs.d&lt;/code&gt; as a project and calling &lt;code&gt;(cask-initialize)&lt;/code&gt; on startup.&lt;/p&gt;&#xA;&#xA;&lt;code&gt;straight.el&lt;/code&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/raxod502/straight.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;straight.el&lt;/code&gt;&lt;/a&gt; is designed for people who want to make local changes to their packages, and possibly contribute those changes upstream. It pulls recipes from &lt;a href=&quot;http://melpa.milkbox.net&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt;, &lt;a href=&quot;https://elpa.gnu.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU ELPA&lt;/a&gt;, and &lt;a href=&quot;https://emacsmirror.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsMirror&lt;/a&gt;, or allows you to specify your own. It also supports writing a revision lockfile for maximum reproducibility, among many other features.&lt;/p&gt;&#xA;&#xA;Use-Package&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;Use-Package&lt;/a&gt; is designed primarily as an emacs configuration management tool.  It will download necessary &lt;code&gt;package.el&lt;/code&gt; packages but does not have built-in mechanisms to access other sources.  It allows for deferred loading of packages and deferred customization.  This improves emacs initialization while slowing initial use of the packages (but if not using them in a given session there is only a net gain).&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="12534" LastEditDate="2017-07-13T07:48:06.490" LastActivityDate="2017-07-13T07:48:06.490" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="524" PostTypeId="2" ParentId="519" CreationDate="2014-09-30T20:37:51.773" Score="6" Body="&lt;p&gt;Here is a generic way to set buffer-specific key bindings.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a temporary minor mode (save the below snippet to &lt;code&gt;temp-mode.el&lt;/code&gt; and &lt;code&gt;require&lt;/code&gt; it in your &lt;code&gt;init.el&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Enable that &lt;code&gt;temp-mode&lt;/code&gt; minor mode and define that minor-mode's keymap only in the buffer(s) you need.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Put the below &lt;code&gt;Local Variables&lt;/code&gt; snippet in the buffer where you want the custom key binding. Below are examples of &lt;code&gt;org-mode&lt;/code&gt; files.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In buffer ONE&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;# Local Variables:&#xA;# eval: (temp-mode 1)&#xA;# eval: (define-key temp-mode-map (kbd &quot;&amp;lt;f10&amp;gt;&quot;) 'function-ONE)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If some other buffer redefines the same key-binding using,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In buffer TWO&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;# Local Variables:&#xA;# eval: (temp-mode 1)&#xA;# eval: (define-key temp-mode-map (kbd &quot;&amp;lt;f10&amp;gt;&quot;) 'function-TWO)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the new binding become effective on doing &lt;code&gt;M-x revert-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I would do if I need to switch between these two buffers very frequently and if I have to use the &lt;kbd&gt;F10&lt;/kbd&gt; binding in both:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Work in buffer ONE, &lt;code&gt;C-x C-s&lt;/code&gt; (save) and switch to buffer TWO&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;revert-buffer&lt;/code&gt; (refresh bindings), work in buffer TWO, &lt;code&gt;C-x C-s&lt;/code&gt; and switch to buffer ONE&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;revert-buffer&lt;/code&gt; (refresh bindings), work in buffer ONE, &lt;code&gt;C-x C-s&lt;/code&gt; and switch to buffer TWO&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;But I would rather bind the different buffer-specific commands to different keys.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Temporary minor mode&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; temp-mode.el&#xA;;; Temporary minor mode&#xA;;; Main use is to enable it only in specific buffers to achieve the goal of&#xA;;; buffer-specific keymaps&#xA;&#xA;(defvar temp-mode-map (make-sparse-keymap)&#xA;  &quot;Keymap while temp-mode is active.&quot;)&#xA;&#xA;;;;###autoload&#xA;(define-minor-mode temp-mode&#xA;  &quot;A temporary minor mode to be activated only specific to a buffer.&quot;&#xA;  nil&#xA;  :lighter &quot; Temp&quot;&#xA;  temp-mode-map)&#xA;&#xA;(provide 'temp-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-31T16:54:52.677" LastActivityDate="2015-07-31T16:54:52.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="525" PostTypeId="1" CreationDate="2014-09-30T21:37:54.587" Score="1" ViewCount="588" Body="&lt;p&gt;I use &lt;code&gt;C-s&lt;/code&gt; for sequential searching. When I want to delete the current match, &lt;kbd&gt;backspace&lt;/kbd&gt; will go to the previous match instead. How can I delete the current match?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="79" LastEditDate="2014-10-01T01:24:31.087" LastActivityDate="2014-10-01T15:46:53.477" Title="Delete some matches of an incremental search" Tags="|search|replace|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="526" PostTypeId="2" ParentId="474" CreationDate="2014-09-30T21:39:08.317" Score="16" Body="&lt;p&gt;I used &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;noreferrer&quot;&gt;this guide&lt;/a&gt; to get started using Emacs as a C++ IDE. It introduces &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;noreferrer&quot;&gt;Helm&lt;/a&gt; and &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;Projectile&lt;/a&gt; which help answer a number of your questions. To wit,&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Projectile manages projects. It searches up the directory tree for a Makefile, SConstruct, Git repo, SVN repo, and perhaps some other build system or version control files to automatically learn what files are associated with the current project. As an example, &lt;code&gt;C-c p h&lt;/code&gt; runs &lt;code&gt;helm-projectile&lt;/code&gt; which is uses Helm to find a file in the current project.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Projectile can build your projects. &lt;code&gt;C-c p c&lt;/code&gt; runs &lt;code&gt;projectile-compile-project&lt;/code&gt; which tries to run Make/SCons/CMake based on available files. I have never had to configure this; it has always known what to do.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The errors show up in their own buffer when you run &lt;code&gt;projectile-compile-project&lt;/code&gt; but I'm not sure it is as pretty as you'd like.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use the package &lt;code&gt;helm-gtags&lt;/code&gt; which interfaces with the &lt;code&gt;gtags&lt;/code&gt; program (which you should have available on your system). Note that gtags is a GNU project and so is unlikely to work immediately on Windows.&lt;/p&gt;&#xA;&lt;p&gt;Once configured, Helm becomes aware of symbols in the project and can navigate to definitions and use locations. For example &lt;code&gt;helm-gtags-dwim&lt;/code&gt; can jump to any use of a variable or function, and when run on a header file opens that header file.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I haven't yet tried this.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The guide listed gives very explicit configuration information on how to get started.&lt;/p&gt;&#xA;" OwnerUserId="313" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-09-30T21:39:08.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="527" PostTypeId="5" CreationDate="2014-09-30T21:43:27.527" Score="0" Body="&lt;p&gt;See also &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server&quot; rel=&quot;nofollow&quot;&gt;Emacs-Server (GNU Emacs Manual)&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsClient&quot; rel=&quot;nofollow&quot;&gt;Emacs Client (emacswiki)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-01T09:05:33.320" LastActivityDate="2014-10-01T09:05:33.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="528" PostTypeId="4" CreationDate="2014-09-30T21:43:27.527" Score="0" Body="emacsclient is a program which allows the user to connect to the Emacs Server. This is useful when using Emacs as the default editor on Unix-like systems, as it allows Emacs to be invoked without creating a new process, allowing the reuse of shared buffers and command history." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-09-30T23:05:44.220" LastActivityDate="2014-09-30T23:05:44.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="529" PostTypeId="2" ParentId="525" CreationDate="2014-09-30T21:47:59.510" Score="5" Body="&lt;p&gt;It seems, &lt;code&gt;M-x query-replace&lt;/code&gt; is one of the way to achieve what you are looking for. Just replace by an empty string.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-09-30T21:47:59.510" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="530" PostTypeId="2" ParentId="478" CreationDate="2014-09-30T21:56:10.977" Score="1" Body="&lt;p&gt;I never figured out how to fix this with just MSYS Git and Emacs, but here's seamless workaround.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add &lt;a href=&quot;https://gitcredentialstore.codeplex.com/&quot; rel=&quot;nofollow&quot;&gt;Git Credential Winstore&lt;/a&gt; to your $PATH.  Git-Credential-Winstore will use the Windows keychain to manage your passwords for you and Magit will happily push to remote repositories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your &lt;code&gt;.gitconfig&lt;/code&gt; file, set the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[credential]&#xA;        helper = &quot;winstore&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works because the &lt;a href=&quot;http://git-scm.com/docs/gitcredentials&quot; rel=&quot;nofollow&quot;&gt;Git Credential Docs&lt;/a&gt; state that &quot;if the helper name is not an absolute path, then the string git credential- is prepended.&quot; I prefer this approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, you can simply run git-credential-winstore.exe and it will install itself to your AppData folder and fill in your &lt;code&gt;.gitconfig&lt;/code&gt; file with a hardcoded path to it's location.  After running it, your &lt;code&gt;.gitconfig&lt;/code&gt; will look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[credential]&#xA;        helper = !&quot;c:\\Users\Joe\\\AppData\\Roaming\\GitCredStore\\git-credential-winstore.exe&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The exclamation point instructs Git to treat the string as an absolute path.&lt;/p&gt;&#xA;" OwnerUserId="256" LastEditorUserId="256" LastEditDate="2014-10-01T23:06:20.657" LastActivityDate="2014-10-01T23:06:20.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="531" PostTypeId="2" ParentId="525" CreationDate="2014-09-30T22:10:09.577" Score="2" Body="&lt;p&gt;Isearch has no built-in command to act on the current match as a unit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can press &lt;code&gt;RET&lt;/code&gt; to stop searching and edit at the current point location, which is the end of the current match (or the beginning if searching backwards). But there's no automatic way to go to the beginning of the match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following little function exits isearch, like &lt;code&gt;RET&lt;/code&gt;, and additionally sets the mark at the beginning of the match (the point is at the end; swap beginning and end when searching backwards). I demonstrate how to assign it to &lt;code&gt;M-m&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-mark-current-match-and-exit ()&#xA;  (interactive)&#xA;  (isearch-exit)&#xA;  (push-mark isearch-other-end))&#xA;(define-key isearch-mode-map [?\M-m] 'isearch-mark-current-match-and-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you're done editing, you can resume the previous search by pressing &lt;code&gt;C-s C-s&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, to delete some occurrences, replace them by the empty string. &lt;a href=&quot;https://emacs.stackexchange.com/a/529/25&quot;&gt;As suggested by Nsukami _&lt;/a&gt;, run &lt;code&gt;query-replace&lt;/code&gt;, enter the string to search, then enter the empty string as a replacement. Type &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;n&lt;/code&gt; for each match depending on whether you want to delete it or keep it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you started from incremental search, you can switch to a &lt;code&gt;query-replace&lt;/code&gt; operation by pressing &lt;code&gt;M-%&lt;/code&gt; during the incremental search. The current isearch string will be used as the string to replace.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-09-30T22:10:09.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="532" PostTypeId="5" CreationDate="2014-09-30T23:19:21.420" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-09-30T23:19:21.420" LastActivityDate="2014-09-30T23:19:21.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="533" PostTypeId="4" CreationDate="2014-09-30T23:19:21.420" Score="0" Body="Dired is a major mode that allows users to edit files and directories on a file system. It is essentially a file browser, with a wide range of features and an appearance similar to the `ls` command." OwnerUserId="45" LastEditorUserId="50" LastEditDate="2014-10-01T15:35:26.737" LastActivityDate="2014-10-01T15:35:26.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="534" PostTypeId="2" ParentId="525" CreationDate="2014-10-01T01:05:59.793" Score="3" Body="&lt;p&gt;If you want to delete the current match and nothing else, the following would do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-kill-current ()&#xA;  (interactive)&#xA;  (delete-region isearch-other-end (point)))&#xA;&#xA;(define-key isearch-mode-map (kbd &quot;&amp;lt;deletechar&amp;gt;&quot;) 'isearch-kill-current)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't interrupt the search, just deletes the currently selected match and lets you proceed with your next forward &lt;code&gt;C-s&lt;/code&gt; or anything similar.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-01T01:05:59.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="535" PostTypeId="2" ParentId="439" CreationDate="2014-10-01T01:14:37.577" Score="8" Body="&lt;p&gt;if you have smex installed, just call smex. Start to type, when the right one comes up, press C-h f.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2014-10-01T01:14:37.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="536" PostTypeId="2" ParentId="439" CreationDate="2014-10-01T01:30:42.657" Score="12" Body="&lt;p&gt;Yes. Library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/help-fns%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/a&gt; defines command &lt;code&gt;describe-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it redefines &lt;code&gt;describe-function&lt;/code&gt; so that it does &lt;code&gt;describe-command&lt;/code&gt; if you give it a prefix arg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The library binds &lt;code&gt;describe-command&lt;/code&gt; to &lt;code&gt;C-h c&lt;/code&gt; (&lt;code&gt;describe-key-briefly&lt;/code&gt; is moved to &lt;code&gt;C-h C-c&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same library defines other help commands, such as &lt;code&gt;describe-file&lt;/code&gt;, &lt;code&gt;describe-buffer&lt;/code&gt;, &lt;code&gt;describe-keymap&lt;/code&gt;, and &lt;code&gt;describe-option-of-type&lt;/code&gt;. Here is &lt;a href=&quot;https://www.emacswiki.org/emacs/HelpPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;more info&lt;/a&gt; about the library.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-09-03T17:19:33.690" LastActivityDate="2018-09-03T17:19:33.690" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="537" PostTypeId="1" AcceptedAnswerId="538" CreationDate="2014-10-01T03:37:21.683" Score="7" ViewCount="2008" Body="&lt;p&gt;How can I insert header comments in source files of arbitrary languages?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the file is newly created, the header should be inserted. &lt;/li&gt;&#xA;&lt;li&gt;If a file already exists, then it should be possible to insert a header at the top of the file, or update as needed (update file name in the header if the file name changed, update copyright year)&lt;/li&gt;&#xA;&lt;li&gt;Of course depending on the language, the header should be inserted with the correct commenting characters. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am looking forward to different packages and/or custom elisp recommendations. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2016-06-21T02:04:05.233" LastActivityDate="2019-05-13T15:32:50.323" Title="Inserting/updating source file header comments" Tags="|file-header|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="538" PostTypeId="2" ParentId="537" CreationDate="2014-10-01T05:11:00.223" Score="9" Body="&lt;p&gt;Here is one answer: library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/header2.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;header2.el&lt;/code&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use it to define file headers for different types of file (C, shell, Emacs Lisp, etc.). You can automatically insert a header when you open a new file buffer. Different parts of the header can be updated automatically when the file is saved. Or you can add or update a header manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Emacs-Lisp files, &lt;code&gt;header2.el&lt;/code&gt; headers can take advantage of library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/lib-requires.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;lib-requires.el&lt;/code&gt;&lt;/a&gt;, to fill in and update a list of Lisp libraries that the file with the header might require. The list is based on the currently loaded libraries that are used by the file with the header.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more detailed description and examples, see Emacs Wiki page &lt;a href=&quot;http://www.emacswiki.org/emacs/AutomaticFileHeaders&quot; rel=&quot;nofollow noreferrer&quot;&gt;Automatic File Headers&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="9874" LastEditDate="2019-05-13T15:32:50.323" LastActivityDate="2019-05-13T15:32:50.323" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="539" PostTypeId="1" CreationDate="2014-10-01T08:54:10.577" Score="33" ViewCount="4534" Body="&lt;p&gt;How do I measure the performance of my elisp code? What tools / external packages are available for me to measure time taken?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to total time, can I see a profile that shows time taken per-function? Can I profile memory usage too?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2014-10-03T10:01:43.833" LastActivityDate="2018-02-18T11:50:44.777" Title="How do I measure performance of elisp code?" Tags="|performance|benchmarking|" AnswerCount="4" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="540" PostTypeId="2" ParentId="539" CreationDate="2014-10-01T09:36:02.307" Score="35" Body="&lt;h3&gt;Benchmark&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The most straightforward options is the built-in &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/benchmark&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;benchmark&lt;/code&gt;&lt;/a&gt; package.&#xA;Its usage is remarkably simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark 100 (form (to be evaluated)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It’s autoloaded, so you don’t even need to require it.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Profiling&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Benchmark is good at overall tests, but if you’re having performance&#xA;problems it doesn’t tell you which functions are causing the problem.&#xA;For that, you have the (also built-in) &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/profiler-start&quot; rel=&quot;noreferrer&quot;&gt;profiler&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start it with &lt;code&gt;M-x profiler-start&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Do some time consuming operations.&lt;/li&gt;&#xA;&lt;li&gt;Get the report with &lt;code&gt;M-x profiler-report&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You should be taken to a buffer with a navigatable tree of function calls.&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Vkcgc.png&quot; alt=&quot;Profiler screenshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-01T10:05:02.373" LastActivityDate="2014-10-01T10:05:02.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="541" PostTypeId="2" ParentId="539" CreationDate="2014-10-01T09:46:31.500" Score="16" Body="&lt;p&gt;In addition to @Malabara's answer, I tend to use a custom-made &lt;code&gt;with-timer&lt;/code&gt; macro to permanently instrument various parts of my code (e.g my &lt;code&gt;init.el&lt;/code&gt; file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference is that while &lt;code&gt;benchmark&lt;/code&gt; allows to study the performance of a specific bit of code that you instrument, &lt;code&gt;with-timer&lt;/code&gt; always gives you the time spent in each instrumented part of the code (without much overhead for sufficiently large parts), which gives you the input to know which part should be investigated further.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-timer (title &amp;amp;rest forms)&#xA;  &quot;Run the given FORMS, counting the elapsed time.&#xA;A message including the given TITLE and the corresponding elapsed&#xA;time is displayed.&quot;&#xA;  (declare (indent 1))&#xA;  (let ((nowvar (make-symbol &quot;now&quot;))&#xA;        (body   `(progn ,@forms)))&#xA;    `(let ((,nowvar (current-time)))&#xA;       (message &quot;%s...&quot; ,title)&#xA;       (prog1 ,body&#xA;         (let ((elapsed&#xA;                (float-time (time-subtract (current-time) ,nowvar))))&#xA;           (message &quot;%s... done (%.3fs)&quot; ,title elapsed))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example use: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-timer &quot;Doing things&quot;&#xA;  (form (to (be evaluated))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yielding the following output in the &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Doing things... done (0.047s)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I should mention that this is heavily inspired by Jon Wiegley's &lt;code&gt;use-package-with-elapsed-timer&lt;/code&gt; macro in his excellent &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; extension.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-10-01T09:46:31.500" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="542" PostTypeId="1" CreationDate="2014-10-01T10:12:24.930" Score="15" ViewCount="618" Body="&lt;p&gt;I'm missing some visual indication of the push / pull progress. After executing the appropriate command, &lt;code&gt;magit&lt;/code&gt; prints &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Pushing to domain.tld:repo.git  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;however, no further indication of the progress is given. On a slow network connection or if the data to be transmitted is large, the process can take quite some time, hence, it would be nice if &lt;code&gt;magit&lt;/code&gt; could give some indication of progress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturally the &lt;code&gt;*magit-process*&lt;/code&gt; buffer contains &lt;code&gt;git&lt;/code&gt;'s own progress indication but how do you tell &lt;code&gt;magit&lt;/code&gt; to pass the relevant part through to the echo area?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even better would be if the progress indicator is added to the mode line, thus allowing the user to close the &lt;code&gt;magit-status&lt;/code&gt; buffer and continue working while &lt;code&gt;git&lt;/code&gt; is doing the heavy lifting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I'm not looking for indication that &lt;code&gt;magit&lt;/code&gt; is pushing / pulling, I know that because I just hit &lt;code&gt;P&lt;/code&gt;/&lt;code&gt;F&lt;/code&gt;. I want to see at which stage of pushing / pulling it is (i.e. (un)packing, transmitting) and how much of that action it already did. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, if you run &lt;code&gt;git&lt;/code&gt; through the terminal it'll print something like&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Pushing to domain.tld:repo.git&lt;br&gt;&#xA;  Counting objects: 29, done.&lt;br&gt;&#xA;  Writing objects: 100% (15/15), 249.80 KiB | 28.00 KiB/s, done.&lt;br&gt;&#xA;  Total 15 (delta 10), reused 0 (delta 0)&lt;br&gt;&#xA;  To domain.tld:repo.git&lt;br&gt;&#xA;     5436bd0..d9ec32a  master -&gt; master&lt;br&gt;&#xA;  updating local tracking ref 'refs/remotes/origin/master'  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;[obviously this is a snapshot of the dynamic output]. I would like that progress to be displayed from within emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit2:&lt;/strong&gt; Opened feature request on &lt;a href=&quot;https://github.com/magit/magit/issues/1527&quot;&gt;github&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="448" LastEditDate="2014-10-01T22:16:00.273" LastActivityDate="2018-04-26T05:40:30.807" Title="Magit pushing / pulling show progress" Tags="|magit|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="543" PostTypeId="2" ParentId="478" CreationDate="2014-10-01T11:43:33.027" Score="1" Body="&lt;p&gt;If you already have Cygwin installed you can use &lt;a href=&quot;http://www.funtoo.org/Keychain&quot; rel=&quot;nofollow&quot;&gt;keychain&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/keychain-environment.el&quot; rel=&quot;nofollow&quot;&gt;keychain-environment&lt;/a&gt; to manage your keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the shell of your choice to launch keychain, then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'keychain-environment)&#xA;(keychain-refresh-environment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to ensure the keys are loaded into Emacs.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-01T11:43:33.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="544" PostTypeId="5" CreationDate="2014-10-01T12:04:04.333" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-01T12:04:04.333" LastActivityDate="2014-10-01T12:04:04.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="545" PostTypeId="4" CreationDate="2014-10-01T12:04:04.333" Score="0" Body="Troubleshooting is a form of problem solving that uses logical, systematic steps to solve the problem. Use this to ask about a feature that's not behaving as it should, or to ask why your emacs-lisp code isn't working." OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-01T13:53:37.237" LastActivityDate="2014-10-01T13:53:37.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="546" PostTypeId="2" ParentId="525" CreationDate="2014-10-01T13:11:14.983" Score="2" Body="&lt;p&gt;&lt;em&gt;To expand on the last paragraph of @Gilles' answer:&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can turn an ongoing &lt;code&gt;isearch&lt;/code&gt; into a &lt;code&gt;query-replace&lt;/code&gt; search.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;As you’re doing &lt;code&gt;isearch&lt;/code&gt;, if you decide you would like to erase some&#xA;entries, simply hit &lt;code&gt;M-%&lt;/code&gt; (which is Emacs’s binding for&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/query-replace&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;query-replace&lt;/code&gt;&lt;/a&gt;)&#xA;and it will transform you ongoing &lt;code&gt;isearch&lt;/code&gt; into query replace.&lt;/li&gt;&#xA;&lt;li&gt;The current search term will remain the same and you will be prompted for a replacement.&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;RET&lt;/code&gt; for no replacement.&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;y&lt;/code&gt; on the the matches you want to erase, and &lt;code&gt;n&lt;/code&gt; on those you don’t.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It will start asking at current match, so it’s a great tool to use midway through an &lt;code&gt;isearch&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-01T14:17:27.660" LastActivityDate="2014-10-01T14:17:27.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="547" PostTypeId="1" AcceptedAnswerId="548" CreationDate="2014-10-01T13:43:06.760" Score="12" ViewCount="1075" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; is there a way to detect if point is inside a LaTeX math environment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one detect whether point is or is not inside a LaTeX math environment, whether delineated inline by &lt;code&gt;$...$&lt;/code&gt; or by named environments (&lt;code&gt;equation&lt;/code&gt;, &lt;code&gt;displaymath&lt;/code&gt;, etc.)?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-01T18:01:26.817" Title="how to detect if inside a LaTeX math environment?" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="548" PostTypeId="2" ParentId="547" CreationDate="2014-10-01T14:00:12.583" Score="10" Body="&lt;p&gt;The function &lt;code&gt;texmathp&lt;/code&gt; defined in AUCTeX (autoloaded from &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/tree/texmathp.el&quot;&gt;&lt;code&gt;texmathp&lt;/code&gt;&lt;/a&gt;) does exactly that (ok, actually it does a bit more). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Used interactively, it will give you some more information, including whether the point is in a math construct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Used in elisp, it will be &lt;code&gt;t&lt;/code&gt; if in math, &lt;code&gt;nil&lt;/code&gt; otherwise. The additional pieces of informations are then stored in the variable &lt;code&gt;texmathp-why&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;texmathp&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt;, this is a cons of &lt;code&gt;(MATCH . POSITION)&lt;/code&gt;, where &lt;code&gt;MATCH&lt;/code&gt; is a string containing the TeX command or the name of the environment that triggered math mode, and &lt;code&gt;POSITION&lt;/code&gt; is the position at which that string was found in the buffer. &lt;code&gt;MATCH&lt;/code&gt; is something like &lt;code&gt;&quot;$&quot;&lt;/code&gt;, &lt;code&gt;&quot;$$&quot;&lt;/code&gt;, &lt;code&gt;&quot;\\(&quot;&lt;/code&gt;, &lt;code&gt;&quot;\\[&quot;&lt;/code&gt; &lt;code&gt;&quot;\\ensuremath&quot;&lt;/code&gt;, &lt;code&gt;&quot;displaymath&quot;&lt;/code&gt;, &lt;code&gt;&quot;equation&quot;&lt;/code&gt;, … When &lt;code&gt;texmathp&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, the variable &lt;code&gt;texmathp-why&lt;/code&gt; is &lt;code&gt;(nil . pos)&lt;/code&gt; where &lt;code&gt;pos&lt;/code&gt; is the beginning of the paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Warning from the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The functions assumes that you have (almost) syntactically correct (La)TeX in&#xA;  the buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is aware of all environments that &lt;code&gt;AUCTeX&lt;/code&gt; knows of (for example for font-locking), and you can add more using the variable &lt;code&gt;texmathp-tex-commands&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2014-10-01T18:01:26.817" LastActivityDate="2014-10-01T18:01:26.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="550" PostTypeId="1" AcceptedAnswerId="553" CreationDate="2014-10-01T14:36:34.377" Score="44" ViewCount="25557" Body="&lt;p&gt;I have seen examples online where people add paths to the default path in Emacs with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;/usr/local/bin/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am new to Elisp, and I think I understand what the statement above does, but I have a few questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In &lt;strong&gt;what order&lt;/strong&gt; does Emacs search through the execution paths? For example, does it consider the value of &lt;code&gt;$PATH&lt;/code&gt; (env. variable) at all (and if so, before or after &lt;code&gt;exec-path&lt;/code&gt;?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I &lt;strong&gt;prepend&lt;/strong&gt; multiple such paths? Can I just keep concatenating them? e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;PATH1&quot;, &quot;PATH2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or should I do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;PATH1:PATH2:PATH3&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I also found this interesting package on GitHub: &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt;. Why is there a need for a package for this?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Motivation&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Ever find that a command works in your shell, but not in Emacs?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This happens a lot on OS X, where an Emacs instance started from the&#xA;  GUI inherits a default set of environment variables.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This library works solves this problem by copying important&#xA;  environment variables from the user's shell: it works by asking your&#xA;  shell to print out the variables of interest, then copying them into&#xA;  the Emacs environment.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6" LastEditorUserId="30574" LastEditDate="2022-05-30T15:06:12.030" LastActivityDate="2022-05-30T15:06:12.030" Title="exec-path and $PATH" Tags="|path|exec-path|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="551" PostTypeId="1" AcceptedAnswerId="555" CreationDate="2014-10-01T14:37:36.643" Score="11" ViewCount="2203" Body="&lt;p&gt;I use org-publish to publish HTML exports of org-mode files quite often to share documents with my coworkers, however, I generate a lot of diagrams with &lt;code&gt;plantuml&lt;/code&gt; and &lt;code&gt;gnuplot&lt;/code&gt;. These diagrams aren't sent to the remote server when I export the file with &lt;code&gt;C-c C-e P f&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My configuration looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;org-pastebin&quot;&#xA; :base-directory &quot;~/org/&quot;&#xA; :base-extension &quot;org\\|zsh\\|html\\|png&quot;&#xA; :publishing-directory &quot;/ssh:user@server:~/public_html/org/&quot;&#xA; :publishing-function org-html-publish-to-html&#xA; :with-toc t&#xA; :html-preamble t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I have an org-mode file that looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Header&#xA;Some prose&#xA;&#xA;#+BEGIN_SRC plantuml :file my-file.png :results raw&#xA;...&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[file:my-file.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get Emacs to automatically publish the linked file (my-file.png) in this case? Even if I publish the whole project the images are not copied.&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="79" LastEditDate="2014-10-01T15:35:15.890" LastActivityDate="2014-10-01T15:35:15.890" Title="How to have org-publish automatically publish generated images?" Tags="|org-mode|org-publish|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="552" PostTypeId="2" ParentId="550" CreationDate="2014-10-01T14:55:51.133" Score="9" Body="&lt;p&gt;When emacs starts a new external process using primitive functions such as &lt;code&gt;call-process&lt;/code&gt; or &lt;code&gt;start-process&lt;/code&gt;, the executable is searched in &lt;code&gt;exec-path&lt;/code&gt; (and not &lt;code&gt;$PATH&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a function such as &lt;code&gt;shell-command&lt;/code&gt; starts the shell as a subprocess and passes it the command you want to run. In order to execute this command, the shell will then try to find the executable in &lt;code&gt;$PATH&lt;/code&gt; (and not in &lt;code&gt;exec-path&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;code&gt;exec-path&lt;/code&gt; is what counts most for external processes which are started by emacs itself, whereas &lt;code&gt;$PATH&lt;/code&gt; is what counts for commands you run yourself with higher-level function (using &lt;kbd&gt;M-!&lt;/kbd&gt; for example)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to add multiple directories to &lt;code&gt;exec-path&lt;/code&gt;, you should use&#xA;&lt;code&gt;add-to-list&lt;/code&gt; multiple times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do it either manually &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;dir1&quot;)&#xA;(add-to-list 'exec-path &quot;dir2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or using a loop&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (dir '(&quot;dir1&quot; &quot;dir2&quot;))&#xA;  (add-to-list 'exec-path dir))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Regarding your third question, if emacs was launched from the desktop environment, it inherits the environment from it, which might be less complete than that of a full shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that it might sometimes be necessary to complete Emacs' value for &lt;code&gt;$PATH&lt;/code&gt; using what a regular shell sees. This is the purpose of the &lt;code&gt;exec-path-from-shell&lt;/code&gt; library you mention.&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-10-01T15:03:09.180" LastActivityDate="2014-10-01T15:03:09.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="553" PostTypeId="2" ParentId="550" CreationDate="2014-10-01T14:59:07.423" Score="38" Body="&lt;h1&gt;1) &lt;code&gt;PATH&lt;/code&gt; and &lt;code&gt;exec-path&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Emacs does set &lt;code&gt;exec-path&lt;/code&gt; from the value of &lt;code&gt;PATH&lt;/code&gt; on startup, but will not look at it again later. But if you run a command, it will inherit &lt;code&gt;PATH&lt;/code&gt;, not &lt;code&gt;exec-path&lt;/code&gt;, so subprocesses can find different commands than Emacs does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Francesco says, this can be especially confusing for &lt;code&gt;shell-command&lt;/code&gt;, as that does not run a process directly, but calls a shell to run it, which will use &lt;code&gt;PATH&lt;/code&gt;, not &lt;code&gt;exec-path&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;2) Adding multiple paths to &lt;code&gt;exec-path&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Just call &lt;code&gt;add-to-list&lt;/code&gt; repeatedly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;PATH1&quot;)&#xA;(add-to-list 'exec-path &quot;PATH2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do note that &lt;code&gt;add-to-list&lt;/code&gt; adds to the beginning of the list, so this will end up with &lt;code&gt;&quot;PATH2&quot;&lt;/code&gt; being in the &lt;code&gt;exec-path&lt;/code&gt; before &lt;code&gt;&quot;PATH1&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use more &quot;low-level&quot; access to lists:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (append '(&quot;PATH1&quot; &quot;PATH2&quot;)&#xA;                        exec-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will add &lt;code&gt;&quot;PATH1&quot;&lt;/code&gt; and &lt;code&gt;&quot;PATH2&quot;&lt;/code&gt; to your &lt;code&gt;exec-path&lt;/code&gt;, in that order.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;3) Mac OS' PATH&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The problem on Mac OS X is that Mac OS does not set the environment the same when you call a program from the global UI or when you call it from a shell. This means that running Emacs from a shell will result in different environment variables being set than when you run it from the finder. This is especially annoying if you set environment variables in &lt;code&gt;.bashrc&lt;/code&gt; or similar, as that won't affect the &quot;global&quot; Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package apparently starts a shell and imports environment variables from there, mimicing the environment you get from a shell in a globally-started Emacs.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-10-01T14:59:07.423" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="554" PostTypeId="2" ParentId="542" CreationDate="2014-10-01T14:59:38.767" Score="7" Body="&lt;p&gt;That feature has existed forever. But I have to admit that I never noticed that either, and only know about it because I stumbled into the implementation :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When an asynchronous process is running you will see e.g. &lt;code&gt;Magit git update&lt;/code&gt; instead of just &lt;code&gt;Magit&lt;/code&gt; in the mode-line.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-10-01T14:59:38.767" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="555" PostTypeId="2" ParentId="551" CreationDate="2014-10-01T15:29:50.837" Score="10" Body="&lt;p&gt;In order to publish projects consisting of multiple file types I add the following to my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-publish-project-alist&#xA;  '((&quot;myprojectorg&quot;&#xA;     :base-directory &quot;~/path/to/myproject/&quot;&#xA;     :publishing-directory &quot;/ssh:user@server:~/public_html/myproject/&quot;&#xA;     :publishing-function org-html-publish-to-html&#xA;     :auto-preamble t&#xA;     )&#xA;    (&quot;myprojectother&quot;&#xA;     :base-directory &quot;~/path/to/myproject/&quot;&#xA;     :base-extension &quot;css\\|pdf\\|sh&quot;&#xA;     :publishing-directory &quot;/ssh:user@server:~/public_html/myproject&quot;&#xA;     :publishing-function org-publish-attachment&#xA;     )&#xA;    (&quot;myprojectimages&quot;&#xA;     :base-directory &quot;~/path/to/myproject/images&quot;&#xA;     :base-extension &quot;png\\|jpg&quot;&#xA;     :publishing-directory &quot;/ssh:user@server:~/public_html/myproject/images&quot;&#xA;     :publishing-function org-publish-attachment&#xA;     )&#xA;    (&quot;myprojectweb&quot; :components(&quot;myprojectorg&quot; &quot;myprojectother&quot; &quot;myprojectimages&quot;))&#xA;   )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This defines an entry &lt;code&gt;myprojectweb&lt;/code&gt; which I use when publishing from org-mode using &lt;code&gt;C-c C-e P x&lt;/code&gt;. This &lt;code&gt;myprojectweb&lt;/code&gt; consists of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the org file(s) as defined in &lt;code&gt;myprojectorg&lt;/code&gt;,&lt;/li&gt;&#xA;&lt;li&gt;image files as defined in &lt;code&gt;myprojectimages&lt;/code&gt; (which are in a subdirectory), and&lt;/li&gt;&#xA;&lt;li&gt;other files (in this case PDFs, CSS files and shell scripts), which are defined in &lt;code&gt;myprojectother&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These last two entries are published using &lt;code&gt;org-publish-attachment&lt;/code&gt; which does nothing but copy the files to the &lt;code&gt;publishing-directory&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2014-10-01T15:29:50.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="556" PostTypeId="2" ParentId="525" CreationDate="2014-10-01T15:46:53.477" Score="2" Body="&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; then you can do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Hit &lt;strong&gt;&lt;code&gt;C-SPC&lt;/code&gt;&lt;/strong&gt; while searching, to tell Isearch to &lt;strong&gt;select the last search hit&lt;/strong&gt; as the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-SPC&lt;/code&gt; actually toggles option &lt;code&gt;isearchp-set-region-flag&lt;/code&gt;, which when non-&lt;code&gt;nil&lt;/code&gt; selects the last search hit visited.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hit &lt;strong&gt;&lt;code&gt;C-x o&lt;/code&gt;&lt;/strong&gt; while searching, to &lt;strong&gt;pause Isearch&lt;/strong&gt;; do whatever you want (e.g. replace the selected last search hit); and then hit &lt;strong&gt;&lt;code&gt;C-M-c&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;resume Isearch&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x o&lt;/code&gt; opens a recursive editing session, where you can do anything you like (including&#xA;search for something different).  Using &lt;code&gt;C-M-c&lt;/code&gt; closes the recursive editing session and resumes the search (from the current position where you hit &lt;code&gt;C-M-c&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;strong&gt;&lt;code&gt;C-M-RET&lt;/code&gt;&lt;/strong&gt; to perform a specified action on any search hit you visit. Just repeat &lt;code&gt;C-M-RET&lt;/code&gt; to continue visiting and acting on subsequent search hits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default action is to replace the search hit.  This means you can use &lt;code&gt;C-M-RET&lt;/code&gt; to &lt;strong&gt;replace search hits on demand&lt;/strong&gt;.  Provide a prefix arg to &lt;code&gt;C-M-RET&lt;/code&gt; at any time to change the replacement string (the default is &quot;&quot;, which just deletes the search hit).  This means you can provide &lt;strong&gt;different replacements for different search hits&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With a negative prefix arg, &lt;code&gt;C-M-RET&lt;/code&gt; changes searching itself (e.g. &lt;code&gt;C-s&lt;/code&gt;) so that it automatically replaces whenever a search hit is visited. With a positive prefix arg &lt;em&gt;N&lt;/em&gt;, you &lt;strong&gt;replace the next &lt;em&gt;N&lt;/em&gt; search hits&lt;/strong&gt;. With a zero prefix arg (e.g. &lt;code&gt;C-0&lt;/code&gt;), you &lt;strong&gt;replace all remaining search hits&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(To use a prefix arg with Isearch you must set option &lt;code&gt;isearch-allow-prefix&lt;/code&gt; or &lt;code&gt;isearch-allow-scroll&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;On-demand replacement (with &lt;code&gt;C-M-RET&lt;/code&gt;) can use &lt;code&gt;query-replace-regexp&lt;/code&gt;-style replacement. That is, you can use &lt;code&gt;\&amp;amp;&lt;/code&gt;, &lt;code&gt;\=\N&lt;/code&gt;, &lt;code&gt;\#&lt;/code&gt;, &lt;code&gt;\,&lt;/code&gt;, and &lt;code&gt;\?&lt;/code&gt;.  You can use &lt;strong&gt;&lt;code&gt;C-M-`&lt;/code&gt;&lt;/strong&gt; while searching to toggle whether such constructs should be interpreted or taken literally (as plain text).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;See the &lt;strong&gt;Isearch+&lt;/strong&gt; doc for more about replacement during Isearch.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-01T15:46:53.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="557" PostTypeId="2" ParentId="440" CreationDate="2014-10-01T16:05:00.650" Score="7" Body="&lt;p&gt;There is nothing especially confusing about it. Any command can be confusing if you don't read its description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for criteria, no such general criteria have been stated explicitly, AFAIK. A judgment is made by the developers who distribute Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is typically not so much about inherent confusion regarding what the command does or how it works as it is about confusion after the fact: confusion about what happened. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And even more importantly, whether inadvertent use of the command might cause changes that are difficult or impossible to reverse (undo).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Dired, my guess is that the reason &lt;code&gt;a&lt;/code&gt; is disabled by default is that someone who uses it, perhaps inadvertently, loses the current Dired state, with no warning and no confirmation required.  The buffer is killed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you had gone to a lot of trouble to omit certain files and subdirs from the Dired display, to insert certain subdirs, to mark certain files or subdirs, to use particular &lt;code&gt;ls&lt;/code&gt; switches, etc., then it would take some effort (and some memory) for you to restore the same Dired state.  On the other hand, if the Dired state is the default state then you can simply use &lt;code&gt;C-x d&lt;/code&gt; to visit the directory again.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-01T16:05:00.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="559" PostTypeId="1" AcceptedAnswerId="564" CreationDate="2014-10-01T16:47:08.520" Score="6" ViewCount="1338" Body="&lt;p&gt;Whenever I use ssh over Tramp to get to my local server (either with dired or pointing directly to a file), another buffer is also created:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#&amp;lt;buffer *tramp/ssh user@local_server_address*&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I finished my editing and close the buffer I was working on, the above mentioned buffer remains. Since it is not useful to me, is there a way to automatically kill it when I finished my editing?&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2014-10-01T17:30:42.517" Title="Tramp: killing all buffers" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="560" PostTypeId="1" AcceptedAnswerId="842" CreationDate="2014-10-01T16:50:47.400" Score="5" ViewCount="283" Body="&lt;p&gt;So emacs's &lt;code&gt;java-mode&lt;/code&gt; handles indenting continued method invocations at the function body level out of the box, but it doesn't seem to handle them inside of an argument list. I'd like to override this behavior. I'm aware of &lt;code&gt;C-c C-s&lt;/code&gt;, but in this particular example both the line that begins with &lt;code&gt;Other&lt;/code&gt; and the line that begins with &lt;code&gt;.newBuilder()&lt;/code&gt; are &lt;code&gt;arglist-cont&lt;/code&gt;. I'd like to distinguish between these two cases. In the function-level example &lt;code&gt;.newBuilder()&lt;/code&gt; is &lt;code&gt;statement-cont&lt;/code&gt;, so that's why it's getting indented correctly. (I just realized that I do actually have &lt;code&gt;(arglist-intro . +)&lt;/code&gt; set in my current style so that is why &lt;code&gt;args[0]&lt;/code&gt; is getting indented once instead of aligning to the preceding parenthesis, but even without that setting, the &lt;code&gt;.newBuilder()&lt;/code&gt; line still aligns with the other arguments instead of indenting one additional level.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public class Foo {&#xA;    void main(String[] args) {&#xA;        /* This works just fine */&#xA;        Other&#xA;            .newBuilder()&#xA;            .fluent1()&#xA;            .fluent2()&#xA;            .build();&#xA;        /* This is how it works currently. */&#xA;        someMethodThatTakesOther(&#xA;            args[0],&#xA;            args[1],&#xA;            Other&#xA;            .newBuilder()&#xA;            .fluent1()&#xA;            .fluent2()&#xA;            .build());&#xA;        /* This is what I would like. */&#xA;        someMethodThatTakesOther(&#xA;            args[0],&#xA;            args[1],&#xA;            Other&#xA;                .newBuilder()&#xA;                .fluent1()&#xA;                .fluent2()&#xA;                .build());&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-10-08T04:01:48.427" Title="Get Emacs to indent fluent builder inside argument list" Tags="|indentation|java|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="561" PostTypeId="1" AcceptedAnswerId="566" CreationDate="2014-10-01T16:57:53.960" Score="20" ViewCount="4762" Body="&lt;p&gt;I use eww to browse the internet and more often than not I do not want images to load, there doesn't seem to be much in terms of customizations built in for eww and none dealing with images.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have a system setup that allows me to start and stop showing images in eww but only after a page refresh, what I want is a way to toggle images on and off &lt;strong&gt;without refreshing the page&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my current method which takes advantage of the internals of &lt;code&gt;shr-put-image&lt;/code&gt; which eww uses.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar display-graphic-override nil&#xA;  &quot;Used to override `display-graphic-p' behavior.&#xA;Should either be nil, or a list where the car is the override.&quot;)&#xA;&#xA;(defadvice display-graphic-p (around sometimes-lie activate)&#xA;  &quot;Use the override if it is non nil.&quot;&#xA;  (if display-graphic-override&#xA;      (car display-graphic-override)&#xA;    ad-do-it))&#xA;&#xA;(defadvice eww-render (around no-images activate)&#xA;  &quot;Temporarily lie about supporting graphics&quot;&#xA;  (let ((display-graphic-override '(nil)))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also tried toggling the 'invisible text property where images are but that doesn't seem to work.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2018-02-06T15:41:14.293" Title="How can I toggle displaying images in eww without a page refresh?" Tags="|images|eww|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="562" PostTypeId="5" CreationDate="2014-10-01T17:30:37.397" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/eww&quot; rel=&quot;nofollow&quot;&gt;eww&lt;/a&gt; stands for Emacs Web Wowser. It is a browser entirely written in elisp and based on shr.el. It is part of the next Emacs (24.4) release. It even supports some basic CSS and HTML5.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-01T18:42:02.710" LastActivityDate="2014-10-01T18:42:02.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="563" PostTypeId="4" CreationDate="2014-10-01T17:30:37.397" Score="0" Body="eww is a built-in package that provides a web browser into Emacs." OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-01T18:42:09.123" LastActivityDate="2014-10-01T18:42:09.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="564" PostTypeId="2" ParentId="559" CreationDate="2014-10-01T17:30:42.517" Score="11" Body="&lt;p&gt;You can get rid of these buffers with &lt;code&gt;M-x tramp-cleanup-all-connections&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-10-01T17:30:42.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="565" PostTypeId="2" ParentId="521" CreationDate="2014-10-01T18:07:12.437" Score="2" Body="&lt;p&gt;I have custom notification code that runs, and like you I often do not want them if I am obviously editing in Emacs at the time the message arrives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often I am looking away from Emacs, away from my desk, or something else and emacs still has focus, so messages can be missed easily if only mode line notifications are used or if they are notifications are canceled based on focus. I use lasting OS specific notifications that always run if the corresponding chat buffer is not visible when the message comes in, that way even if you miss the mode line blip, you will always know when messages came through when you return to your desk etc. You have access to which buffer the message belongs to in the custom notification hook, so basically, in your notification hook do...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (get-buffer-window chat-buffer) (do-notification))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sometimes I may get important chat notifications while I am away from Emacs for a long time but am still connected, in those cases I use &lt;code&gt;current-idle-time&lt;/code&gt; to choose whether or not to elevate the notification to an email.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (&amp;gt; (time-to-seconds (or (current-idle-time) (seconds-to-time 0)))&#xA;         (or min-number-of-idle-seconds-before-email 300))&#xA;    (do-custom-email-notification))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the above code I only perform an email when emacs has been idle for a given number of seconds or 300 seconds (5 minutes) if my custom variable is nil. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With these hooks, I ensure that I won't be bothered with excessive noise while editting, won't miss any messages if I am looking away or gone for a bit, and will also not miss any messages that come even if I am away for hours by getting them by email. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am hesitant to link this as my jabber configuration is without a doubt, the messiest and least organized file in my .emacs.d, but here is what I use currently in total: &#xA;&lt;a href=&quot;http://www.github.com/jordonbiondo/.emacs.d/blob/master/jorbi/jorbi-jabber.el#L248&quot; rel=&quot;nofollow&quot;&gt;.emacs.d/jorbi/jorbi-jabber.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-10-01T18:15:39.763" LastActivityDate="2014-10-01T18:15:39.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="566" PostTypeId="2" ParentId="561" CreationDate="2014-10-01T18:52:02.250" Score="13" Body="&lt;h2&gt;Background&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Eww, as many other packages, uses the &lt;code&gt;display&lt;/code&gt; text property to&#xA;display images. That is why toggling the &lt;code&gt;invisible&lt;/code&gt; text property&#xA;didn’t help. You’re making the text itself invisible but the &lt;code&gt;display&lt;/code&gt;&#xA;property is still being shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, this is something so common that the code below should work&#xA;on any buffer that displays images (not just eww).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The easiest solution is to just remove the &lt;code&gt;display&lt;/code&gt; property from the&#xA;entire buffer. But that’s an irreversible action, you wouldn’t be able&#xA;to turn images back on without refreshing the page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more robust solution, presented below, removes &lt;code&gt;display&lt;/code&gt;&#xA;properties in the buffer and simultaneously backs-up the image to&#xA;another (useless) property. When called again, the command moves the&#xA;backed up images back into the &lt;code&gt;display&lt;/code&gt; property.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar-local endless/display-images t)&#xA;&#xA;(defun endless/toggle-image-display ()&#xA;  &quot;Toggle images display on current buffer.&quot;&#xA;  (interactive)&#xA;  (setq endless/display-images&#xA;        (null endless/display-images))&#xA;  (endless/backup-display-property endless/display-images))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the guy who does the backup and restore everywhere. Text&#xA;property code isn’t terribly easy to read, but I think this function&#xA;is short enough to be self explanatory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/backup-display-property (invert &amp;amp;optional object)&#xA;  &quot;Move the 'display property at POS to 'display-backup.&#xA;Only applies if display property is an image.&#xA;If INVERT is non-nil, move from 'display-backup to 'display&#xA;instead.&#xA;Optional OBJECT specifies the string or buffer. Nil means current&#xA;buffer.&quot;&#xA;  (let* ((inhibit-read-only t)&#xA;         (from (if invert 'display-backup 'display))&#xA;         (to (if invert 'display 'display-backup))&#xA;         (pos (point-min))&#xA;         left prop)&#xA;    (while (and pos (/= pos (point-max)))&#xA;      (if (get-text-property pos from object)&#xA;          (setq left pos)&#xA;        (setq left (next-single-property-change pos from object)))&#xA;      (if (or (null left) (= left (point-max)))&#xA;          (setq pos nil)&#xA;        (setq prop (get-text-property left from object))&#xA;        (setq pos (or (next-single-property-change left from object)&#xA;                      (point-max)))&#xA;        (when (eq (car prop) 'image)&#xA;          (add-text-properties left pos (list from nil to prop) object))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please to let me know if it works! I only tested it on very simple webpages.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-01T18:52:02.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="567" PostTypeId="5" CreationDate="2014-10-01T18:56:24.877" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://magit.vc&quot; rel=&quot;nofollow noreferrer&quot;&gt;Magit&lt;/a&gt; is an Emacs menu interface to the &lt;code&gt;Git&lt;/code&gt; &lt;code&gt;version control&lt;/code&gt; system. &lt;code&gt;Magit&lt;/code&gt; is implemented as an Emacs extension package -- a Git porcelain inside Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike the Version Control package which is part of Emacs and strives to provide a unified interface to various version control systems, Magit only supports Git and can therefore better take advantage of its native features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Magit, you can inspect and modify your Git repositories with Emacs. You can review and commit the changes you have made to the tracked files, for example, and you can browse the history of past changes. There is support for cherry picking, reverting, merging, rebasing, and other common Git operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit is not a complete interface to Git; it just aims to make the most common Git operations convenient. Thus, Magit will likely not save you from learning Git itself.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="306" LastEditDate="2017-07-15T16:29:56.337" LastActivityDate="2017-07-15T16:29:56.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="568" PostTypeId="4" CreationDate="2014-10-01T18:56:24.877" Score="0" Body="is an Emacs extension for the Git version control system." OwnerUserId="219" LastEditorUserId="7045" LastEditDate="2017-02-14T13:18:58.567" LastActivityDate="2017-02-14T13:18:58.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="569" PostTypeId="5" CreationDate="2014-10-01T18:59:36.787" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/eshell/&quot; rel=&quot;nofollow&quot;&gt;Eshell&lt;/a&gt; is a shell-like command interpreter implemented in Emacs Lisp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It invokes no external processes except for those requested by the user. It is intended to be a functional replacement for command shells such as bash, zsh, rc, or 4dos since Emacs itself is capable of handling the sort of tasks accomplished by those tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything it does, it uses Emacs's facilities to do. This means that Eshell is as portable as Emacs itself. It also means that cooperation with Lisp code is natural and seamless.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-01T20:17:03.603" LastActivityDate="2014-10-01T20:17:03.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="570" PostTypeId="4" CreationDate="2014-10-01T18:59:36.787" Score="0" Body="Eshell is a shell-like command interpreter implemented in Emacs Lisp." OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-01T20:17:13.487" LastActivityDate="2014-10-01T20:17:13.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="571" PostTypeId="1" AcceptedAnswerId="575" CreationDate="2014-10-01T19:40:06.730" Score="7" ViewCount="1520" Body="&lt;p&gt;Admitting up front that I am not capable of much Lisp, I have found ways to produce the current date or a number of seconds from a date, but I am looking for a simple equivalent to shell command like &lt;code&gt;date -d &quot;next wed&quot;&lt;/code&gt; I believe that with the output fed to &lt;code&gt;(format-time-string ...&lt;/code&gt; I can get what I need. &lt;/p&gt;&#xA;" OwnerUserId="143" LastEditorUserId="105" LastEditDate="2021-04-14T16:28:45.180" LastActivityDate="2021-04-14T16:28:45.180" Title="Elisp function to see a date for next Wednesday" Tags="|time-date|parsing|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="572" PostTypeId="5" CreationDate="2014-10-01T19:51:56.600" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/InteractivelyDoThings&quot; rel=&quot;nofollow&quot;&gt;Ido&lt;/a&gt; stands for Interactive Do. It provides a very convenient way to find files and switch buffers in Emacs. It switches between buffers and opens files and directories with a minimum of keystrokes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a superset of iswitchb, the interactive buffer switching package by Stephen Eglen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you type in a substring, the list of buffers or files currently matching the substring are displayed as you type.  The list is ordered so that the most recent buffers or files visited come at the start of the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buffer or file at the start of the list will be the one visited when you press RETURN.  By typing more of the substring, the list is narrowed down so that gradually the buffer or file you want will be at the top of the list.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use C-s and C-r (or the right and left arrow keys) to rotate buffer or file names in the list until the one you want is at the top of the list.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-01T23:23:16.167" LastActivityDate="2014-10-01T23:23:16.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="573" PostTypeId="4" CreationDate="2014-10-01T19:51:56.600" Score="0" Body="Ido provides a very convenient way to find files and switch buffers in Emacs." OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-01T22:34:24.540" LastActivityDate="2014-10-01T22:34:24.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="574" PostTypeId="1" AcceptedAnswerId="578" CreationDate="2014-10-01T20:16:27.603" Score="4" ViewCount="1921" Body="&lt;p&gt;Using the Emacs GUI, I get a certain amount of spacing between each line of text. By default this spacing seems to be zero, but can be increased by customizing line spacing. This is the default of zero:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/H9ERO.png&quot; alt=&quot;without spacing&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this is the same text when line spacing is set to 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HueiV.png&quot; alt=&quot;with increased spacing&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because I'd like extra lines on my screen and don't think it would impact readability a lot, I'd like to use a line spacing of -1, so the lines overlap just slightly. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="278" LastEditorUserId="278" LastEditDate="2014-10-01T20:25:10.640" LastActivityDate="2014-10-01T21:17:07.323" Title="How do I reduce spacing between lines to less than zero?" Tags="|display|line-spacing|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="575" PostTypeId="2" ParentId="571" CreationDate="2014-10-01T20:42:30.143" Score="9" Body="&lt;p&gt;Emacs's built-in date parser is &lt;code&gt;parse-time-string&lt;/code&gt; in &lt;a href=&quot;http://bzr.savannah.gnu.org/lh/emacs/emacs-24/annotate/head:/lisp/calendar/parse-time.el&quot;&gt;&lt;code&gt;parse-time.el&lt;/code&gt;&lt;/a&gt;, called by &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html#index-date_002dto_002dtime-4157&quot;&gt;&lt;code&gt;date-to-time&lt;/code&gt;&lt;/a&gt;. It understands English month and weekday names and several combinations of elements in various orders, but not expressions like “next Wednesday”.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/coreutils/manual/coreutils.html#Date-input-formats&quot;&gt;date input formats&lt;/a&gt; in the GNU &lt;code&gt;date&lt;/code&gt; command provided on non-embedded Linux and Cygwin are implemented in the source of the &lt;code&gt;date&lt;/code&gt; utility, they are not available as a standalone library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the GNU &lt;code&gt;date&lt;/code&gt; utility is available on your system, you can call it. The following snippet returns a time parsed by &lt;code&gt;date&lt;/code&gt; as a list (SEC MIN HOUR DAY MON YEAR DOW DST TZ).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((human-time &quot;next Wednesday&quot;))&#xA;  (parse-time-string (with-temp-buffer&#xA;                       (call-process &quot;env&quot; nil t nil &quot;LC_ALL=C&quot; &quot;LANGUAGE=&quot; &quot;date&quot; &quot;-d&quot; human-time)&#xA;                       (or (bobp) (delete-backward-char 1))&#xA;                       (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-01T20:42:30.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="576" PostTypeId="1" AcceptedAnswerId="593" CreationDate="2014-10-01T21:01:54.090" Score="4" ViewCount="146" Body="&lt;p&gt;While working on a sort of &quot;background processing&quot; function, I noticed that my logs would print backwards if the buffer was in another frame. I cannot seem to figure out why it is happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not looking for a solution to make the log print correctly, I can just specify that during logging, to move to &lt;code&gt;(point-max)&lt;/code&gt; and everything is fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, why does the point seem to update while modifying a buffer in the current frame, but not when the buffer is visible in another frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is hard to fully describe so I will include code:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Test Code&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Copy the code and run it in &lt;code&gt;*scratch*&lt;/code&gt; in these two different frame configurations&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With one frame, showing both &lt;code&gt;*scratch*&lt;/code&gt; and &lt;code&gt;test-buffer&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With two frames, one showing &lt;code&gt;*scratch*&lt;/code&gt; and one showing &lt;code&gt;*test-buffer*&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test-buffer (get-buffer-create &quot;test-buffer&quot;))&#xA;&#xA;(progn&#xA;  (with-current-buffer test-buffer (delete-region 1 (point-max)))&#xA;  (run-with-timer &#xA;   1 nil (lambda () (with-current-buffer test-buffer (insert &quot;first\n&quot;))))&#xA;  (run-with-timer &#xA;   2 nil (lambda () (with-current-buffer test-buffer (insert &quot;second\n&quot;))))&#xA;  (run-with-timer &#xA;   3 nil (lambda () (with-current-buffer test-buffer (insert &quot;third\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will see that at the end of the first test, test-buffer will contain&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;first&#xA;second&#xA;third&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and after the second test, test-buffer will contain&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;third&#xA;second&#xA;first&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is causing this? Is this a documented feature or perhaps even a bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a gif of me running the tests:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/I5EvY.gif&quot; alt=&quot;animated demo&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="25" LastEditDate="2014-10-02T10:11:50.163" LastActivityDate="2014-10-02T10:13:01.830" Title="Inconsistent point when inserting into a buffer that is visible in another frame" Tags="|window|frames|point|logging|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="577" PostTypeId="2" ParentId="576" CreationDate="2014-10-01T21:16:43.827" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;what is causing this?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The problem here is that you seem to consider that the point is associated to a buffer, but this is not exactly the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider for example the case where the same buffer is displayed in two different windows. You'll notice that the buffer contents is the same (i.e. modifying the buffer contents in one window modifies it in the other), but point positions are not identical (i.e. moving the point in one buffer doesn't move it in the other, which is a desirable and documented feature).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, point position is not attached to the buffer itself, but rather to the (buffer, window) pair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A consequence of this is that you should not rely on the point position being where you last left it when you change buffer (using &lt;code&gt;with-current-buffer&lt;/code&gt; for example). A reliable behaviour could be achieved by always calling a point movement function before doing anything else. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer test-buffer&#xA;  (goto-char (point-max))&#xA;  (insert &quot;first\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-10-01T21:21:59.670" LastActivityDate="2014-10-01T21:21:59.670" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="578" PostTypeId="2" ParentId="574" CreationDate="2014-10-01T21:17:07.323" Score="5" Body="&lt;p&gt;I'm sorry to say that this seems to be entirely impossible in Emacs currently.  From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Line-Height.html#Line-Height&quot; rel=&quot;noreferrer&quot;&gt;Line Height&lt;/a&gt; (emphasis mine):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The total height of each display line consists of the height of the contents of the line, plus optional additional vertical line spacing above or below the display line.&lt;/p&gt;&#xA;&lt;p&gt;The height of the line contents is the &lt;strong&gt;maximum height&lt;/strong&gt; of any character or image on that display line, including the final newline if there is one. (A display line that is continued doesn't include a final newline.) That is the &lt;strong&gt;default line&lt;/strong&gt; height, if you do nothing to specify a greater height. (In the most common case, this equals the height of the default frame font.)&lt;/p&gt;&#xA;&lt;p&gt;There are several ways to explicitly specify a larger line height, either by specifying an absolute height for the display line, or by specifying vertical space. However, no matter what you specify, the &lt;strong&gt;actual line height can never be less than the default&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In other words, you cannot shrink the line height below the maximum height of any character on the line.  Hence, having lines with overlapping characters is impossible currently.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-01T21:17:07.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="579" PostTypeId="2" ParentId="571" CreationDate="2014-10-01T21:21:12.873" Score="4" Body="&lt;p&gt;I made an Elisp only solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can call it using &lt;code&gt;M-x dow-time&lt;/code&gt; and in code using &lt;code&gt;(dow-time 3)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar dow-time-days '((&quot;Monday&quot; . 1)&#xA;                        (&quot;Tuesday&quot; . 2)&#xA;                        (&quot;Wednesday&quot; . 3)&#xA;                        (&quot;Thursday&quot; . 4)&#xA;                        (&quot;Friday&quot; . 5)&#xA;                        (&quot;Saturday&quot; . 6)&#xA;                        (&quot;Sunday&quot; . 0))&#xA;  &quot;Days of week alist used by `dow-time'&quot;)&#xA;&#xA;(defun dow-time (day-input)&#xA;  &quot;Get time for next day of week, 0 is Sunday&#xA;Also accepts human readable strings&quot;&#xA;  (interactive (list&#xA;                (completing-read &quot;Day of week: &quot; dow-time-days nil t)))&#xA;  (let* ((day (if (numberp day-input) day-input&#xA;                (cdr (assoc day-input dow-time-days))))&#xA;         (time (decode-time))&#xA;         (dow (nth 6 time))&#xA;         (day-of-month (nth 3 time))&#xA;         (new-dow (if (&amp;gt; day dow)        ; Check what's the new dow's index&#xA;                       (- day dow)       ; In the same week&#xA;                     (+ (- 7 dow) day))) ; In the next week&#xA;         (new-time (encode-time 0 0 0&#xA;                                (+ new-dow day-of-month)&#xA;                                (nth 4 time)&#xA;                                (nth 5 time))))&#xA;    (if (called-interactively-p 'any)&#xA;        (message (current-time-string new-time)) ; Print nicely if interactive&#xA;      new-time)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="43" LastActivityDate="2014-10-01T21:21:12.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="580" PostTypeId="1" AcceptedAnswerId="581" CreationDate="2014-10-01T21:36:19.493" Score="5" ViewCount="273" Body="&lt;p&gt;When I click with the middle mouse button that usually inserts the primary selection at the point where I clicked.  However, the same button opens flyspell's context menu when I click on a misspelled word.  The problem is that when I use the context menu to, e.g., save a word to the dictionary, this also inserts the primary selection after the flyspell action is finished.  I thought that this problem may be due to a mess-up in my configuration but I can also reproduce this with &lt;code&gt;emacs -Q&lt;/code&gt;.  How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Steps to reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Start &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Insert the following sentence (in the scratch buffer):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sentence with a mistaake.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x flyspell-buffer&lt;/code&gt;, the word &lt;em&gt;mistaake&lt;/em&gt; is highlighted.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Double click on &lt;em&gt;sentence&lt;/em&gt; to select it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Click middle mouse button (mouse-2) on &lt;em&gt;mistaake&lt;/em&gt;, choose the correct spelling &lt;em&gt;mistake&lt;/em&gt; from the context memu.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Result: &lt;em&gt;mistaake&lt;/em&gt; is replaced with &lt;em&gt;missentecetake&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found some really old bug reports that sound related (going back to 2005) but no working solution.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="105" LastEditDate="2015-05-14T00:31:13.547" LastActivityDate="2015-05-14T00:31:13.547" Title="Inadvertent paste when correcting spelling mistakes using flyspell" Tags="|key-bindings|keymap|copy-paste|mouse|flyspell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="581" PostTypeId="2" ParentId="580" CreationDate="2014-10-01T21:53:36.370" Score="7" Body="&lt;p&gt;Sounds like you are being bitten by the fact that one command is bound to &lt;code&gt;mouse-2&lt;/code&gt;, another command is bound to &lt;code&gt;down-mouse-2&lt;/code&gt;, and the two commands do not play well together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do &lt;code&gt;C-h k&lt;/code&gt; and then click &lt;code&gt;mouse-2&lt;/code&gt; on text (e.g. &lt;code&gt;mistaake&lt;/code&gt;). The help should tell you what &lt;code&gt;mouse-2&lt;/code&gt; and &lt;code&gt;down-mouse-2&lt;/code&gt; are bound to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm right in my guess, you can try doing one of these things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Move your yank command to a different key sequence (but I would keep it as a yank).&lt;/li&gt;&#xA;&lt;li&gt;Move the flyspell command to another key sequence.&lt;/li&gt;&#xA;&lt;li&gt;Swap the two bindings (for click down and up).  Worth a try, at least.&lt;/li&gt;&#xA;&lt;li&gt;Put a renamed copy of the flyspell command on the up action and modify the copy so that it ignores the down event. IOW, make the flyspell command play well with a non-menu command bound to the down event.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Personally, I would count this as a (key-binding) bug in flyspell -- clicking &lt;code&gt;mouse-2&lt;/code&gt; should usually yank in Emacs, in one form or another. The flyspell developers should be able to make flyspell cohabit with down or up clicks that yank text. (But I imagine that the flyspell people won't see it that way.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Disclosure: I am not a flyspell user.  With luck, someone who uses it will provide a simple solution and explanation.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Looking at the flyspell.el code, I see that it does this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (featurep 'xemacs)&#xA;    (define-key map [button2] #'flyspell-correct-word)&#xA;  (define-key map [down-mouse-2] #'flyspell-correct-word)&#xA;  (define-key map [mouse-2] 'undefined))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are you using XEmacs?  If not, try changing &lt;code&gt;undefined&lt;/code&gt; to &lt;code&gt;ignore&lt;/code&gt;, here. Dunno whether that will make a difference, but it might be worth a try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, try it the other way around:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (featurep 'xemacs)&#xA;    (define-key map [button2] #'flyspell-correct-word)&#xA;  (define-key map [mouse-2] #'flyspell-correct-word) ; REVERSED the bindings&#xA;  (define-key map [down-mouse-2] 'ignore))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is usually what I do. For example, in &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/isearch%2b.el&quot;&gt;&lt;code&gt;isearch+.el&lt;/code&gt;&lt;/a&gt; I do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key isearch-mode-map [mouse-2]      'isearch-mouse-2)&#xA;(define-key isearch-mode-map [down-mouse-2] 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-01T22:06:54.053" LastActivityDate="2014-10-01T22:06:54.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="582" PostTypeId="1" AcceptedAnswerId="584" CreationDate="2014-10-01T22:01:18.460" Score="28" ViewCount="21736" Body="&lt;p&gt;If I have Emacs split horizontally and on top I'm editing elisp code and on the bottom I am in the shell. By default, Emacs makes the two windows equal in size, but I'd like the shell buffer smaller. I was wondering how I could do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Original question asked by &lt;a href=&quot;https://stackoverflow.com/users/615550/steve&quot;&gt;Steve&lt;/a&gt; on SO: &lt;a href=&quot;https://stackoverflow.com/questions/4987760/how-to-change-size-of-split-screen-emacs-windows&quot;&gt;How to Change size of split screen emacs windows?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-11-24T16:18:04.200" Title="How to Change size of split screen emacs windows?" Tags="|window|customize|" AnswerCount="5" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="583" PostTypeId="2" ParentId="582" CreationDate="2014-10-01T22:05:53.793" Score="5" Body="&lt;p&gt;You can use &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;^&lt;/kbd&gt; (&lt;code&gt;enlarge-window&lt;/code&gt;) in the upper window to make it larger (and thus make the lower window smaller).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the mouse, you can also drag the modeline of the upper window to resize it.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-10-01T22:05:53.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="584" PostTypeId="2" ParentId="582" CreationDate="2014-10-01T22:10:44.487" Score="55" Body="&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;-&lt;/kbd&gt; (&lt;code&gt;shrink-window-if-larger-than-buffer&lt;/code&gt;) to shrink a window to fit its content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;+&lt;/kbd&gt; (&lt;code&gt;balance-windows&lt;/code&gt;) to make windows the same heights and widths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;^&lt;/kbd&gt; (&lt;code&gt;enlarge-window&lt;/code&gt;) to increase height by 1 line, or the prefix arg value. A negative arg shrinks the window. Example: &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;-&lt;/kbd&gt; &lt;kbd&gt;3&lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;^&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;{&lt;/kbd&gt; (&lt;code&gt;shrink-window-horizontally&lt;/code&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;}&lt;/kbd&gt; (&lt;code&gt;enlarge-window-horizontally&lt;/code&gt;) &lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="504" LastEditDate="2014-10-24T10:32:39.970" LastActivityDate="2014-10-24T10:32:39.970" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="585" PostTypeId="1" AcceptedAnswerId="681" CreationDate="2014-10-01T22:35:08.617" Score="9" ViewCount="539" Body="&lt;p&gt;I'm looking for a way to add a new full-height window split to an existing (splitted) window configuration. Because I don't know how to explain it properly I'll just post some ASCII graphics showing the desired behaviour for two example window configurations:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;             from                              to  &#xA;&#xA;  +-------------------------+      +---------------------+---+  &#xA;  |                         |      |                     |   |  &#xA;  |                         |      |                     |   |  &#xA;  |            A            |  =&amp;gt;  |           A         | E |  &#xA;  |                         |      |                     |   |  &#xA;  |                         |      |                     |   |  &#xA;  +-------------------------+      +---------------------+---+  &#xA;&#xA;  +------------+------------+      +----------+----------+---+  &#xA;  |            |     B      |      |          |   B      |   |&#xA;  |     A      +------------+      |     A    +----------+   |&#xA;  |            |     C      |  =&amp;gt;  |          |   C      | E | &#xA;  +------------+------------+      +----------+----------+   |&#xA;  |            D            |      |          D          |   |&#xA;  +-------------------------+      +---------------------+---+  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where the function accepts the desired width of the new window &lt;code&gt;E&lt;/code&gt; and shrinks the widths of &lt;code&gt;A&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;, &lt;code&gt;C&lt;/code&gt;, and &lt;code&gt;D&lt;/code&gt; accordingly. &lt;strong&gt;Edit2&lt;/strong&gt;: Note that the above two drawings are examples of the expected behaviour for a concrete case. I'm looking for a general function that does this independently of the configuration in the &lt;em&gt;from&lt;/em&gt; column (i.e. the number of windows [splits] in the from column should be arbitrary).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also looking for this functionality on the left side and on the top and bottom of a frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; From @Nsukami_'s comment I realised that the functionality I'm looking for is a special case of a more abstract problem. So I'll phrase that problem:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How do you store a window configuration (consisting of any number of windows and buffers) and &lt;em&gt;&quot;paste&quot;&lt;/em&gt; the stored config into an existing window? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;&quot;paste&quot;&lt;/em&gt; should then preserve relative window sizes and the splitting; naturally the resulting pasted config is a scaled copy.&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="105" LastEditDate="2014-12-21T03:52:34.803" LastActivityDate="2014-12-21T03:52:34.803" Title="Split Window at outermost border" Tags="|elisp|window|frames|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="586" PostTypeId="1" AcceptedAnswerId="590" CreationDate="2014-10-01T23:06:57.270" Score="2" ViewCount="582" Body="&lt;p&gt;I am using &lt;a href=&quot;http://matlab-emacs.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;matlab-emacs&lt;/a&gt; to debug a matlab script from inside of emacs with GUD.  Everything seems to be working as expected except that I don't see any breakpoint indicators in the fringe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is important to me for two reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It is nice to easily see where all of the breakpoints are in the code. It makes it much easier to know what to expect when I &quot;continue.&quot;&lt;/li&gt;&#xA;&lt;li&gt;It lets me toggle breakpoints on and off. When the breakpoint indicator is there, I can check for it in code, and know whether I should toggle the breakpoint on or off.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get breakpoint indicators for Matlab debugging?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="50" LastEditDate="2014-10-10T18:31:47.210" LastActivityDate="2014-10-10T18:31:47.210" Title="Show breakpoints when debugging Matlab" Tags="|debugging|matlab|gud|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="587" PostTypeId="2" ParentId="576" CreationDate="2014-10-01T23:10:29.240" Score="2" Body="&lt;p&gt;You can also tell Emacs to move the &lt;code&gt;window-point&lt;/code&gt; forward when text is inserted there. This should work at least in simple cases like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local window-point-insertion-type t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-10-01T23:10:29.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="588" PostTypeId="5" CreationDate="2014-10-01T23:32:58.870" Score="0" Body="&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://www.mathworks.com/products/matlab/&quot; rel=&quot;nofollow&quot;&gt;MATLAB&lt;/a&gt;&lt;/strong&gt; is a high-level language and interactive programming environment for numerical computation and visualization developed by &lt;a href=&quot;http://www.mathworks.com/&quot; rel=&quot;nofollow&quot;&gt;MathWorks&lt;/a&gt;. MATLAB can be used when performing tasks such as signal processing and communications, image and video processing, computational finance, and computational biology. It is the foundation for a number of other tools, including &lt;a href=&quot;http://www.mathworks.com/products/simulink/&quot; rel=&quot;nofollow&quot;&gt;Simulink&lt;/a&gt; and &lt;a href=&quot;http://www.mathworks.com/products/product_listing/index.html&quot; rel=&quot;nofollow&quot;&gt;various toolboxes&lt;/a&gt; that extend its core capabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some informative links that show up quite often in answers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathworks.com/help/matlab/index.html&quot; rel=&quot;nofollow&quot;&gt;MATLAB documentation&lt;/a&gt; for the most recent version (R2014a)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathworks.com/help/doc-archives.html&quot; rel=&quot;nofollow&quot;&gt;Archived documentation&lt;/a&gt; for prior versions (&lt;strong&gt;NOTE:&lt;/strong&gt; only available to licensed users)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/&quot; rel=&quot;nofollow&quot;&gt;MATLAB Central File Exchange&lt;/a&gt;: a repository of user-contributed MATLAB tools&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://blogs.mathworks.com/&quot; rel=&quot;nofollow&quot;&gt;MATLAB Central blogs&lt;/a&gt;: usually updated weekly by a number of MathWorks employees&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://undocumentedmatlab.com/&quot; rel=&quot;nofollow&quot;&gt;Undocumented MATLAB&lt;/a&gt;: &quot;Charting MATLAB’s unsupported hidden underbelly&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/answers/&quot; rel=&quot;nofollow&quot;&gt;MATLAB Answers&lt;/a&gt;: a collaborative environment for getting answers to questions about MathWorks products, similar to Stack Overflow&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;comp.soft-sys.matlab&lt;/em&gt; Usenet group: can be accessed online through the &lt;a href=&quot;http://www.mathworks.com/matlabcentral/newsreader/&quot; rel=&quot;nofollow&quot;&gt;MATLAB Central Newsreader&lt;/a&gt; hosted by MathWorks, or using &lt;a href=&quot;http://groups.google.com/group/comp.soft-sys.matlab&quot; rel=&quot;nofollow&quot;&gt;Google Groups&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/cody&quot; rel=&quot;nofollow&quot;&gt;MATLAB Cody™&lt;/a&gt; is a place where you can go to find a variety of MATLAB-based coding challenges that will help to expand your understanding of Matlab.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/MATLAB&quot; rel=&quot;nofollow&quot;&gt;MATLAB Wikipedia Article&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-02T07:27:04.293" LastActivityDate="2014-10-02T07:27:04.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="589" PostTypeId="4" CreationDate="2014-10-01T23:32:58.870" Score="0" Body="MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-02T04:37:22.287" LastActivityDate="2014-10-02T04:37:22.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="590" PostTypeId="2" ParentId="586" CreationDate="2014-10-01T23:33:16.127" Score="3" Body="&lt;p&gt;Unless some thing has changed with newer versions of MatLab, short answer is you cannot (MaTLaB 2011b here). Eric Ludlam, maintainer of matlab-emacs, does say so &lt;a href=&quot;http://sourceforge.net/p/matlab-emacs/mailman/message/28872261/&quot; rel=&quot;nofollow&quot;&gt;here in the matlab-emacs mailing list&lt;/a&gt;. MatLab lost an undocumented API which allowed it to show icons for breakpoints with select versions of GUD.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-01T23:33:16.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="591" PostTypeId="5" CreationDate="2014-10-01T23:36:54.113" Score="0" Body="&lt;p&gt;The minibuffer is where Emacs commands read complicated arguments, such as file names, buffer names, Emacs command names, or Lisp expressions. It's called the &quot;minibuffer&quot; because it's a special-purpose buffer with a small amount of screen space. It is still an Emacs buffer, a first-class object, but it is a specialized one. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual section about the minibuffer&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-02T01:01:03.873" LastActivityDate="2014-10-02T01:01:03.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="592" PostTypeId="4" CreationDate="2014-10-01T23:36:54.113" Score="0" Body="The minibuffer is a part of Emacs used to read in complex commands or arguments. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-02T07:27:52.220" LastActivityDate="2014-10-02T07:27:52.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="593" PostTypeId="2" ParentId="576" CreationDate="2014-10-02T00:55:41.913" Score="5" Body="&lt;p&gt;Each buffer has a point, and in addition each window also has a point. The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html#Window-Point&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; explains the relationship:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;The window point is established when a window is first created; it is initialized from the buffer's point, or from the window point of another window opened on the buffer if such a window exists.&lt;/li&gt;&#xA;  &lt;li&gt;Selecting a window sets the value of point in its buffer from the window's value of point. Conversely, deselecting a window sets the window's value of point from that of the buffer. Thus, when you switch between windows that display a given buffer, the point value for the selected window is in effect in the buffer, while the point values for the other windows are stored in those windows.&lt;/li&gt;&#xA;  &lt;li&gt;As long as the selected window displays the current buffer, the window's point and the buffer's point always move together; they remain equal.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here's a little experiment to illustrate this. Create a buffer and display it in another window (it doesn't matter whether that window is in the same frame or not). Stick to a window that doesn't show the buffer. Insert some text in the buffer, without selecting the other window, and notice that the buffer's point is updated to be after the inserted text. Then select the window displaying the buffer. Notice that now the buffer's point has now changed to the window's point.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-selected-window (selected-window) (find-file-other-window &quot;foo&quot;))&#xA;#&amp;lt;buffer foo&amp;gt;&#xA;(with-current-buffer (set-buffer &quot;foo&quot;) (insert &quot;foo&quot;) (cons (point) (point-max)))&#xA;(4 . 4)&#xA;(with-selected-window (selected-window) (other-window 1))&#xA;nil&#xA;(with-current-buffer (set-buffer &quot;foo&quot;) (cons (point) (point-max)))&#xA;(1 . 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To avoid this effect where the point is reset to another location when the user switches to a window that displays the buffer, you can &lt;strong&gt;use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Insertion.html#index-insert_002dbefore_002dmarkers-2839&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;insert-before-markers&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; instead of plain &lt;code&gt;insert&lt;/code&gt;. This works because the window's point is implemented as a marker internally. (The buffer's point is not a marker.) This is what &lt;code&gt;accept-process-output&lt;/code&gt; does internally, for example, which is why output from a subprocess doesn't get mixed up when the destination buffer is displayed in a non-selected window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach is to set &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html#index-window_002dpoint_002dinsertion_002dtype-2384&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;window-point-insertion-type&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;t&lt;/code&gt;. By default, a window's point stays behind insertions. By setting it to a non-nil value, the window's point moves with insertions at that location. This is the approach used by Comint, for example: it declares &lt;code&gt;window-point-insertion-type&lt;/code&gt; as buffer-local and sets it to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your experiment, you never explicitly switch to the window that's displaying the test buffer. But that buffer is in the selected window of another GUI frame. Since the insertion code is running in a timer, with user interactions between each insertion, the redisplay code runs between each insertion. One of the effects of the &lt;a href=&quot;http://bzr.savannah.gnu.org/lh/emacs/emacs-24/annotate/head:/src/xdisp.c&quot; rel=&quot;nofollow&quot;&gt;redisplay code&lt;/a&gt; is to recalculate the frame's title. Deep in the bowels of &lt;code&gt;x_consider_frame_title&lt;/code&gt;, the code temporarily selects the frame's selected window, causing the cursor update. This analysis is confirmed by running the experiment with the buffer displayed in a terminal frame instead of a GUI frame: the insertions are in the expected order. You'd see the same effect from any kind of asynchronous operation: timer, process sentinel, etc.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-10-02T10:13:01.830" LastActivityDate="2014-10-02T10:13:01.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="594" PostTypeId="1" AcceptedAnswerId="599" CreationDate="2014-10-02T02:32:53.630" Score="23" ViewCount="1756" Body="&lt;p&gt;At times, I need to use the same link at multiple places in a long document.&lt;/p&gt;&#xA;&lt;p&gt;For those cases it would be useful to have link IDs like in markdown. From &lt;a href=&quot;http://daringfireball.net/projects/markdown/syntax#link&quot; rel=&quot;noreferrer&quot;&gt;markdown syntax ref&lt;/a&gt;,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You can optionally use a space to separate the sets of brackets:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;This is [an example] [id] reference-style link. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then, anywhere in the document, you define your link label like this, on a line by itself:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[id]: http://example.com/ &amp;quot;Optional Title Here&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I believed that the &lt;a href=&quot;http://orgmode.org/manual/Link-abbreviations.html#Link-abbreviations&quot; rel=&quot;noreferrer&quot;&gt;Link Abbreviation&lt;/a&gt; in org-mode would work the same way (without tags) but it doesn't.&lt;/p&gt;&#xA;&lt;p&gt;The purpose of link IDs is to have a central place for editing the links. A good location would be at the end of the document. Full links are defined in the ID but only the ID is used elsewhere in the document where we need to place the hyperlinks.&#xA;When exporting, the IDs are replaced with the actual hyperlinks.&lt;/p&gt;&#xA;&lt;p&gt;Benefits of this approach are,&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When the links change, we need to just modify the ID definitions. On exporting, the hyperlinks in the document will be updated to that.&lt;/li&gt;&#xA;&lt;li&gt;Faster hyperlink insertion when writing the document as one doesn't have to get and paste the full links every time. You type the IDs in the document and define them in a block at the end of the document.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-06T13:34:40.430" Title="How to implement Markdown style link IDs in org-mode?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="595" PostTypeId="1" CreationDate="2014-10-02T04:55:59.140" Score="31" ViewCount="22291" Body="&lt;p&gt;There are a bunch of &lt;a href=&quot;http://plantuml.sourceforge.net/emacs.html&quot;&gt;integration options between Emacs and UML tools&lt;/a&gt;, like &lt;a href=&quot;http://eschulte.github.io/babel-dev/DONE-integrate-plantuml-support.html&quot;&gt;&lt;code&gt;org-mode&lt;/code&gt;'s &lt;code&gt;plantuml&lt;/code&gt; embedding&lt;/a&gt;, a &lt;a href=&quot;https://github.com/zwz/plantuml-mode&quot;&gt;&lt;code&gt;plantuml&lt;/code&gt; major mode&lt;/a&gt; etc.  Of course I can try them out but I'm wondering what other people use for a UML workflow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Embedding inside another document like &lt;code&gt;org-mode&lt;/code&gt; does is a nice idea, or outputting the generated uml in another buffer live-updated would be nice too.  I'm sure people out there have some super-cute elisp functions to automate this kind of thing!&lt;/p&gt;&#xA;" OwnerUserId="215" LastEditorUserId="253" LastEditDate="2014-12-19T13:19:20.233" LastActivityDate="2023-08-31T13:16:14.317" Title="Best ways of generating UML from within Emacs" Tags="|org-mode|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="596" PostTypeId="2" ParentId="582" CreationDate="2014-10-02T07:21:40.627" Score="1" Body="&lt;p&gt;Also note that just like in a window system, you can use the mouse with xterm-mouse-mode to drag the window divider.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this seems to sometimes depend a bit on the actual xterm or xterm-like program, and iirc in older Emacsen it wasn't reliable past about the 100th column unless you played with the TERM environment variable a bit, but in my Emacs 24.2.1 it works fine with emacs -nw -q (ie. totally ignoring my .emacs and manually enabling xterm-mouse-mode with &lt;code&gt;M-x xterm-mouse-mode&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; FYI for completeness I'll point out this also works for vertical dividers (ie. when you have split with &lt;code&gt;C-x 3&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="215" LastActivityDate="2014-10-02T07:21:40.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="597" PostTypeId="2" ParentId="582" CreationDate="2014-10-02T08:43:41.710" Score="13" Body="&lt;p&gt;I would also recommend checking out either the &lt;code&gt;windresize&lt;/code&gt; package from &lt;a href=&quot;http://elpa.gnu.org/packages/&quot; rel=&quot;noreferrer&quot;&gt;ELPA&lt;/a&gt;, or the &lt;code&gt;windsize&lt;/code&gt; package from &lt;a href=&quot;http://melpa.milkbox.net/#/&quot; rel=&quot;noreferrer&quot;&gt;MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;windresize&lt;/code&gt;, you can do &lt;code&gt;M-x windresize&lt;/code&gt; and then use the arrow keys to move window borders easily, hitting ENTER when you're done.&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2014-10-02T08:43:41.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="598" PostTypeId="1" AcceptedAnswerId="603" CreationDate="2014-10-02T08:49:03.023" Score="108" ViewCount="18042" Body="&lt;p&gt;I see hugely varied performance depending on how many newlines there are in the file I'm visiting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example. I have two JSON files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ wget https://github.com/Wilfred/ReVo-utilities/blob/a4bdc40dd2656c496defc461fc19c403c8306d9f/revo-export/dictionary.json?raw=true -O one_line.json&#xA;$ python -m json.tool &amp;lt;one_line.json &amp;gt;pretty_printed.json&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These are two JSON files with the same content. &lt;code&gt;one_line.json&lt;/code&gt; is 18MiB of JSON without any newlines. &lt;code&gt;pretty_printed.json&lt;/code&gt; has newlines and whitespace added, making it 41MiB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the bigger file split over many lines is much faster to open in Emacs, both in Javascript mode and Fundamental mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does Emacs have such poor performance with long lines, since it's actually fewer bytes? Is there anything I can do to improve performance without reformatting the data outside of Emacs?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="454" LastEditDate="2021-04-21T04:14:07.687" LastActivityDate="2023-02-10T02:27:23.220" Title="How do I prevent extremely long lines making Emacs slow?" Tags="|performance|line-break|so-long|" AnswerCount="12" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="599" PostTypeId="2" ParentId="594" CreationDate="2014-10-02T08:50:01.430" Score="21" Body="&lt;p&gt;&lt;a href=&quot;http://endlessparentheses.com/use-org-mode-links-for-absolutely-anything.html&quot;&gt;This page&lt;/a&gt;&#xA;has a nice description on how to extend org-mode links. It doesn’t&#xA;address your specific concern, but it explains the basic principle.&lt;br&gt;&#xA;Let’s say we want your links to be defined like this, anywhere in the buffer,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LINK-ID: wiki http://www.emacswiki.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and invoked like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[lid:wiki][You should check out the wiki]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First, you need to tell org how to follow and how to export your link.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-add-link-type &quot;lid&quot; 'endless/open-id-link 'endless/export-id-link)&#xA;&#xA;(defun endless/open-id-link (path)&#xA;  &quot;Follow an ID link to PATH.&quot;&#xA;  (browse-url (endless/find-id-link path)))&#xA;&#xA;(defun endless/export-id-link (path desc format)&#xA;  &quot;Create the export version of an ID link specified by PATH and DESC.&#xA;FORMATs understood are 'latex and 'html.&quot;&#xA;  (setq path (endless/find-id-link path))&#xA;  (cond&#xA;   ((eq format 'html) (format &quot;&amp;lt;a href=\&quot;%s\&quot;&amp;gt;%s&amp;lt;/a&amp;gt;&quot; path desc))&#xA;   ((eq format 'latex) (format &quot;\\href{%s}{%s}&quot; path desc))&#xA;   (t desc)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you just need to decide how &lt;em&gt;you&lt;/em&gt; want to handle this link.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/find-id-link (id &amp;amp;optional noerror)&#xA;  &quot;Find \&quot;#+LINK-ID: ID\&quot; in current buffer and return the link.&#xA;Unless NOERROR is non-nil, throw an error if link not found.&quot;&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (let ((case-fold-search t))&#xA;      (when (search-forward-regexp &#xA;             (format &quot;^#\\+LINK-ID: \\b%s\\b +\\(.*\\) *$&quot; id)&#xA;             nil noerror)&#xA;        (match-string-no-properties 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-02T14:59:22.667" LastActivityDate="2014-10-02T14:59:22.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="600" PostTypeId="1" AcceptedAnswerId="627" CreationDate="2014-10-02T09:53:21.180" Score="1" ViewCount="501" Body="&lt;p&gt;When spelunking through Java code, I rely heavily on the semantic integration through the use of &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; to navigate to different functions in a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works great for simple to moderately-complex Java files, however, some complex Java files show an empty semantic imenu. There are no errors in the log, only the customary:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Parsing NettyTransport.java (LALR)...done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then the imenu is empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I diagnose and/or fix the semantic parsing for these Java files so they correctly show functions/vars/etc in the imenu?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, a Java file that silently fails semantic parsing can be found &lt;a href=&quot;https://github.com/elasticsearch/elasticsearch/blob/d4d77cdb66e1c23a2639a3fd578a3965fc687172/src/main/java/org/elasticsearch/transport/netty/NettyTransport.java&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="379" LastEditDate="2014-10-02T11:23:39.440" LastActivityDate="2014-10-02T20:51:58.477" Title="How to diagnose why semantic-imenu does not correctly parse a file?" Tags="|helm|semantic-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="601" PostTypeId="2" ParentId="598" CreationDate="2014-10-02T10:15:41.177" Score="19" Body="&lt;p&gt;I did some brief experiments with this using a minified copy of jquery. &lt;code&gt;font-lock-mode&lt;/code&gt; and &lt;code&gt;flycheck-mode&lt;/code&gt; both contributed to slowness, as did &lt;code&gt;js2-mode&lt;/code&gt;, and &lt;code&gt;prettify-symbols-mode&lt;/code&gt;. &lt;code&gt;line-number-mode&lt;/code&gt; and &lt;code&gt;column-number-mode&lt;/code&gt; had minor effect. Once I had turned off all the different modes though the performance was relatively snappy. Use &lt;kbd&gt;C-h m&lt;/kbd&gt; and start disabling different modes that are enabled, or try just switch to &lt;code&gt;fundamental-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly using &lt;code&gt;hexl-mode&lt;/code&gt; I could fly through the file without any issue, though obviously columns were quite short. Unfortunately &lt;code&gt;visual-line-mode&lt;/code&gt; really slowed things down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that the syntax table is happy to stop processing at line endings, and when it's all on one line it has to reparse everything on every update.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-02T10:15:41.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="602" PostTypeId="2" ParentId="598" CreationDate="2014-10-02T10:17:55.677" Score="9" Body="&lt;p&gt;I expect you'll find that the difference is due to &lt;code&gt;font-lock&lt;/code&gt;. When fontification is to be performed on the subset of the file which is visible in the window, it proceeds by first extending the fontification region such that it will include full semantic units. See the &lt;code&gt;font-lock-extend-region-functions&lt;/code&gt; code for this. It's common for this to include extending the region to include full lines. When the lines are extremely long, this can lead to fontification being performed across a very much larger chunk of content than is actually visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, when newlines themselves have semantic information, their absence may sometimes mean that regexp patterns for font lock have to scan further in order to determine whether they match or not.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-10-02T10:17:55.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="603" PostTypeId="2" ParentId="598" CreationDate="2014-10-02T10:42:05.090" Score="72" Body="&lt;p&gt;Emacs' handling of long lines is not very well optimized. For a number of operations, Emacs has to scan the whole line repeatedly. For example, to display a line, Emacs has to figure out the height of the line, which requires scanning the whole line to find the tallest glyph. Additionally, scanning for bidirectional display eats up a lot of time. You can get some additional information in, for example, the docstring of &lt;code&gt;cache-long-line-scans&lt;/code&gt; (renamed &lt;code&gt;cache-long-scans&lt;/code&gt; in 24.4).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try and see if setting &lt;code&gt;bidi-paragraph-direction&lt;/code&gt; to &lt;code&gt;left-to-right&lt;/code&gt; and setting &lt;code&gt;bidi-inhibit-bpa&lt;/code&gt;&lt;sup&gt;1&lt;/sup&gt; (new in Emacs 27) to &lt;code&gt;t&lt;/code&gt; improves the speed for you.&lt;sup&gt;2&lt;/sup&gt;&#xA;  This removes some significant contributors to line scans, but sadly not the only ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best option is to add newlines. You can pipe a JSON file through e.g. &lt;code&gt;python -c 'import json, sys ; json.dump(json.load(sys.stdin), sys.stdout, indent=2)'&lt;/code&gt; to add newlines and improve readability in general.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; &lt;code&gt;bidi-inhibit-bpa&lt;/code&gt; is new in Emacs 27.  Setting it to &lt;code&gt;t&lt;/code&gt; can have a noticeable (sometimes dramatic) effect in cases where (a) a physical line is very long, and (b) the line includes many parentheses and/or braces, especially if they are nested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; There is also &lt;code&gt;bidi-display-reordering&lt;/code&gt;, but this is only for internal/debugging purposes.  Setting it to &lt;code&gt;nil&lt;/code&gt; may improve performance, however that is an &lt;em&gt;unsupported&lt;/em&gt; setting which may cause other problems, so it is not recommended.  In Emacs 27, the combination of setting &lt;code&gt;bidi-paragraph-direction&lt;/code&gt; and &lt;code&gt;bidi-inhibit-bpa&lt;/code&gt; is a supported configuration which provides approximately the same performance boost.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="454" LastEditDate="2019-12-18T20:51:10.303" LastActivityDate="2019-12-18T20:51:10.303" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="604" PostTypeId="1" AcceptedAnswerId="606" CreationDate="2014-10-02T11:08:48.340" Score="4" ViewCount="840" Body="&lt;p&gt;I'm having problems installing package from &lt;code&gt;(m)elpa&lt;/code&gt; which require &lt;code&gt;cl-lib-1.0&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;emacs&lt;/code&gt; version is &lt;code&gt;24.3&lt;/code&gt;, hence I have a builtin copy of &lt;code&gt;cl-lib-1.0&lt;/code&gt;, however, the only version available via &lt;code&gt;elpa&lt;/code&gt; is 0.5. Unfortunately the dependency resolution does not seem to understand that my builtin &lt;code&gt;cl-lib&lt;/code&gt; is more recent (and adequate), hence it installs &lt;code&gt;cl-lib&lt;/code&gt; in v0.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The packages in question are &lt;code&gt;shift-text&lt;/code&gt; and &lt;code&gt;stripe-buffer&lt;/code&gt; available on &lt;code&gt;melpa&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using a function for batch install of all packages, you can find the relevant code &lt;a href=&quot;http://pastebin.com/aniDPFxU&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A working (workaround) solution is to uninstall &lt;code&gt;cl-lib-0.5&lt;/code&gt; via &lt;code&gt;list-packages&lt;/code&gt; and then manually install the package(s) in question. [Therefore I think the actual culprit is my batch install routine?] However, I'd like to continue using my batch installation procedure, hence the question&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How do you tell &lt;code&gt;package.el&lt;/code&gt; that a certain package is already installed in a given version?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Btw, this problem has surfaced previously, however, the discussion in &lt;a href=&quot;https://github.com/Bruce-Connor/paradox/issues/14&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; &lt;code&gt;github&lt;/code&gt; issue does not properly solve it.&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="448" LastEditDate="2014-10-02T11:15:19.513" LastActivityDate="2015-10-16T23:23:30.197" Title="Problems installing packages via elpa that require cl-lib-1.0" Tags="|package|package-repositories|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="605" PostTypeId="2" ParentId="585" CreationDate="2014-10-02T11:47:09.857" Score="0" Body="&lt;p&gt;Not sure if the best solution, as not enough abstracted, I'm actually solving only one use case. The trick is write a function to go from layoutX to layoutY, and another one to go from layoutY to layoutX&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun from-x-to-y ()&#xA; (interactive)&#xA; (delete-other-windows)&#xA; (split-window-vertically) ;;&#xA; (let ((current-prefix-arg 10)) ;; emulate C-u&#xA;   (call-interactively 'enlarge-window) ;; resize&#xA;   )&#xA; (split-window-horizontally) ;; -&amp;gt; |&#xA; (next-multiframe-window)&#xA; (split-window-vertically) ;;  -&amp;gt; --&#xA; (previous-multiframe-window)&#xA;)&#xA;&#xA;(defun from-y-to-x ()&#xA;  (interactive)&#xA;  (delete-other-windows)&#xA;  (split-window-horizontally) ;; -&amp;gt; |&#xA;  (let ((current-prefix-arg -60)) ;; emulate C-u&#xA;    (call-interactively 'shrink-window-horizontally) ;; resize&#xA;    )&#xA;  (split-window-vertically) ;; -&amp;gt; --&#xA;  (let ((current-prefix-arg 10)) ;;&#xA;    (call-interactively 'enlarge-window) ;;&#xA;    )&#xA;  (split-window-horizontally) ;;&#xA;  (next-multiframe-window)&#xA;  (split-window-vertically) &#xA;  (previous-multiframe-window)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope that solution will help&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How do you store a window configuration (consisting of any number of windows and buffers) and &quot;paste&quot; the stored config into an existing window? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Just found a package named &lt;a href=&quot;http://www.emacswiki.org/emacs/layout-restore.el&quot; rel=&quot;nofollow&quot;&gt;layout.el&lt;/a&gt;, I've never used it but it seems to be what you're looking for, you'll tell us if ok.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to find a more generic solution, it seems that you can use &lt;code&gt;M-x switch-to-buffer-other-frame&lt;/code&gt; to go from a buffer in a frame, let say with a layout X, to another buffer in another frame with a layout Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also be in a layout X, store this layout in a register &lt;code&gt;C-x r f&lt;/code&gt; (frame-configuration-to-register), go to another layout, and when necessary, switch back to the previous one, calling what inside the register with &lt;code&gt;C-x r j&lt;/code&gt;&#xA;(jump-to-register)&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-10-02T13:43:13.390" LastActivityDate="2014-10-02T13:43:13.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="606" PostTypeId="2" ParentId="604" CreationDate="2014-10-02T11:54:31.060" Score="5" Body="&lt;p&gt;The version of &lt;code&gt;cl-lib&lt;/code&gt; in GNU Elpa is a backport of the &lt;code&gt;cl-lib&lt;/code&gt; from Emacs 24.3 intended for Emacs &amp;lt;=24.2. (Or put differently it is a forward compatibility wrapper around &lt;code&gt;cl&lt;/code&gt; as it comes with &amp;lt;=24.2). If you are using Emacs 24.3 then you don't need it and when you use &lt;code&gt;package.el&lt;/code&gt; from that Emacs version it will never install any version of &lt;code&gt;cl-lib&lt;/code&gt; because it is aware that that is a built-in library/package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So just uninstall &lt;code&gt;cl-lib&lt;/code&gt;, you probably installed it when still using an older Emacs version. If &lt;code&gt;package.el&lt;/code&gt; actually tries to install &lt;code&gt;cl-lib&lt;/code&gt; while using Emacs 24.3, then you have to investigate why that happens, it shouldn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second issue is that the mentioned packages depend on version &lt;code&gt;1.0&lt;/code&gt; of &lt;code&gt;cl-lib&lt;/code&gt; when they should instead depend on &lt;code&gt;0.5&lt;/code&gt; so that they can be used with older Emacsen. If they cannot be used with older Emacsen that should be made explicit by depending on &lt;code&gt;(emacs &quot;24.3&quot;)&lt;/code&gt;. Please open issues against these packages so that this can be fixed.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-10-02T12:00:48.840" LastActivityDate="2014-10-02T12:00:48.840" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="607" PostTypeId="2" ParentId="468" CreationDate="2014-10-02T14:02:51.757" Score="2" Body="&lt;p&gt;It isn't possible to &quot;pause&quot; a major mode, but as suggested in the comments to your questions it should be possible to move away from the buffer that triggered the error and to the backtrace buffer. If the mode of the buffer where the error occurred overrides the normal global bindings to move to another buffer then adding the key explicitly to its keymap &lt;em&gt;might&lt;/em&gt; give you back the ability to select another buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it is also possible that the mode reads user input in a fancier way, making it impossible to move away. In the case of a completion buffer/mode like &lt;code&gt;helm&lt;/code&gt; that could make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However you might be able to simply quit &lt;code&gt;helm&lt;/code&gt; and then go to &lt;code&gt;*Backtrace*&lt;/code&gt;. The buffer won't be displayed in a window anymore, but it should still exist and contain the latest backtrace. You mention that the &quot;backtrace buffer is cleared&quot;; does the buffer simply disappears or is its content really cleared? In the latter case you might want to open an issue on the &lt;code&gt;helm&lt;/code&gt; repository, as this could be considered a bug.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-10-02T14:59:53.340" LastActivityDate="2014-10-02T14:59:53.340" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="608" PostTypeId="1" AcceptedAnswerId="621" CreationDate="2014-10-02T14:06:53.743" Score="14" ViewCount="6094" Body="&lt;p&gt;I am trying to make the Evil function &lt;code&gt;evil-jump-to-tag&lt;/code&gt;, &lt;kbd&gt;C-]&lt;/kbd&gt; behave like the Emacs binding &lt;kbd&gt;M-.&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The normal behaviour is fine for browsing Tags files, but I want it to work also for Slime's &lt;code&gt;slime-edit-definition&lt;/code&gt;, Elisps' &lt;code&gt;elisp-slime-nav-find-elisp-thing-at-point&lt;/code&gt;, Clojures &lt;code&gt;cider-jump-to-var&lt;/code&gt;, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These major modes and many more have bound some equivalent of jump-to-definition to the keybinding &lt;kbd&gt;M-.&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the same behaviour for Evil-mode, do I need to bind a keybinding locally for every of these modes, or is it possible to take a keybinding and tell Emacs, that whenever this key is pressed, use the function bound for that key in Emacs mode?&lt;/p&gt;&#xA;" OwnerUserId="312" LastEditorUserId="25" LastEditDate="2014-10-02T18:25:26.637" LastActivityDate="2016-04-05T08:23:14.460" Title="Evil: map keybindings the vim way?" Tags="|keymap|evil|" AnswerCount="7" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="609" PostTypeId="2" ParentId="435" CreationDate="2014-10-02T14:19:14.157" Score="3" Body="&lt;p&gt;As far as I know mu and by extension mu4e does not support this and I don't think it ever will because it does not match its design principles. Instead of providing tools to make it easier to &lt;em&gt;organize&lt;/em&gt; your inboxes more easily it replaces &lt;em&gt;organizing&lt;/em&gt; with &lt;em&gt;searching&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some support for explicitly organizing mail and by &lt;em&gt;saving searches&lt;/em&gt; you are effectively doing something similar. But the idea is that we receive so much mail that it has become inefficient to manually organize and vet our inboxes. Its not considered an issue that there might be duplicates, boring mail isn't deleted etc. Mu/mu4e is supposed to let us forget about these issues by providing good search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are duplicates in your sea of messages but that isn't considered an issue. Only that duplicates might be &lt;em&gt;displayed&lt;/em&gt; is considered an issue. And for that there is &lt;code&gt;(setq mu4e-headers-skip-duplicates t)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-10-02T14:19:14.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="610" PostTypeId="2" ParentId="608" CreationDate="2014-10-02T15:02:02.040" Score="2" Body="&lt;p&gt;I don't understand &lt;code&gt;evil&lt;/code&gt;'s keymaps, but the following function does whatever &lt;kbd&gt;M-.&lt;/kbd&gt; is bound to at the moment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-tag-jump ()&#xA;    (interactive)&#xA;    (call-interactively (key-binding (kbd &quot;M-.&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Binding this to the appropriate &lt;code&gt;evil&lt;/code&gt; keymap should do what you want. There may be a more &lt;code&gt;evil&lt;/code&gt;-specific way to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;evil&lt;/code&gt; binds &lt;kbd&gt;C-]&lt;/kbd&gt; in &lt;code&gt;evil-motion-state-map&lt;/code&gt;, so try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;evil-maps&quot;&#xA;    '(define-key evil-motion-state-map &quot;\C-]&quot; 'my-tag-jump))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2014-10-02T16:10:00.110" LastActivityDate="2014-10-02T16:10:00.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="611" PostTypeId="2" ParentId="141" CreationDate="2014-10-02T15:10:26.907" Score="0" Body="&lt;p&gt;Create an AppleScript application like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tell application &quot;Terminal&quot;&#xA;do shell script &quot;/usr/local/bin/emacsclient -c&quot;&#xA;endtell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might have to adjust the path, or you might be able to leave out the path completely.  You could also use something fancier with starts the daemon if it isn't running yet.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-10-02T15:10:26.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="612" PostTypeId="2" ParentId="608" CreationDate="2014-10-02T15:21:42.967" Score="3" Body="&lt;p&gt;Try something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-]&quot; &quot;\M-.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or, if &lt;code&gt;evil&lt;/code&gt; already uses this keybind, you may need to do something like.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-mode-map &quot;\C-]&quot; &quot;\M-.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will completely override the behaviour of &lt;code&gt;C-]&lt;/code&gt;, if you want to&#xA;keep evil’s behaviour depending on the current major-mode, @Tyler’s&#xA;solution is more appropriate because you can have a function that decides whether to call &lt;code&gt;M-.&lt;/code&gt; or do something esle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this help?&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-02T15:21:42.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="613" PostTypeId="1" AcceptedAnswerId="625" CreationDate="2014-10-02T15:25:33.230" Score="15" ViewCount="3972" Body="&lt;p&gt;Generally speaking, I would like to be able to open all files within a given set of directories (and their subdirectories) where the filename matches a given regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  /home/nispio/project:&#xA;  total used in directory 1612 available 1000000000&#xA;  drwxrwxr-x 13 nispio group    4096 Sep 19 14:06 .&#xA;  drwxrwxr-x  7 nispio group    4096 Sep 22 16:41 ..&#xA;  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 cfg&#xA;  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 hlp&#xA;* drwxrwxr-x  2 nispio group    4096 Sep 23 16:52 hst&#xA;* drwxrwxr-x  2 nispio group    4096 Sep 29 14:52 inc&#xA;* drwxrwxr-x  2 nispio group    4096 Oct  1 12:53 lib&#xA;  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 mcr&#xA;  drwxrwxr-x  2 nispio group    4096 Sep 24 10:50 pyl&#xA;  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 snr&#xA;  drwxrwxr-x  2 nispio group    4096 Sep 19 12:46 unix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have marked the directories &lt;code&gt;hst&lt;/code&gt;, &lt;code&gt;inc&lt;/code&gt;, and &lt;code&gt;lib&lt;/code&gt;, and now I want to visit all files with extensions &lt;code&gt;.c&lt;/code&gt;, &lt;code&gt;.cc&lt;/code&gt;, and &lt;code&gt;.h&lt;/code&gt; within those three directories and their subdirectories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be even better if I could see everything that I am opening before I open it.  If the dired buffer was updated to show me all of the files that matched my search, and all of those were highlighted, I could do a sanity check to make sure that my search returned what I expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am open to suggestions to do this same thing using &lt;code&gt;helm&lt;/code&gt; or &lt;code&gt;dired+&lt;/code&gt; or any other extensions that will let me navigate my filesystem more easily.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-15T13:13:32.887" Title="Recursively open files matching regexp in marked directories" Tags="|dired|files|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="614" PostTypeId="1" AcceptedAnswerId="615" CreationDate="2014-10-02T15:39:34.177" Score="9" ViewCount="1032" Body="&lt;p&gt;By default when org-mode documents are exported to HTML, the section and sub-section links look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:///path/to/export/location/doc.html#sec-1-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that the above link won't point to the correct section if I rearrange the sections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we have permalinks for each section auto-generated that look like below?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:///path/to/export/location/doc.html#introduction&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2019-07-10T17:24:10.297" Title="Creating permalinks for sections in HTML exported from org-mode" Tags="|org-mode|html|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="615" PostTypeId="2" ParentId="614" CreationDate="2014-10-02T15:53:09.637" Score="13" Body="&lt;p&gt;You can get this result by setting the &lt;code&gt;CUSTOM_ID&lt;/code&gt; property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the following file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* Test&#xA;:PROPERTIES:&#xA;:CREATED:  [2014-10-02 Thu 11:48]&#xA;:END:&#xA;** Sub no custom&#xA;:PROPERTIES:&#xA;:CREATED:  [2014-10-02 Thu 11:49]&#xA;:END:&#xA;** Sub custom&#xA;:PROPERTIES:&#xA;:CREATED:  [2014-10-02 Thu 11:49]&#xA;:CUSTOM_ID: Custom&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following Export (&lt;code&gt;C-c C-e h H&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;div id=&quot;text-table-of-contents&quot;&amp;gt;&#xA;&amp;lt;ul&amp;gt;&#xA;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#sec-1&quot;&amp;gt;1. Test&amp;lt;/a&amp;gt;&#xA;&amp;lt;ul&amp;gt;&#xA;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#sec-1-1&quot;&amp;gt;1.1. Sub no custom&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#Custom&quot;&amp;gt;1.2. Sub custom&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;div id=&quot;outline-container-sec-1&quot; class=&quot;outline-2&quot;&amp;gt;&#xA;&amp;lt;h2 id=&quot;sec-1&quot;&amp;gt;&amp;lt;span class=&quot;section-number-2&quot;&amp;gt;1&amp;lt;/span&amp;gt; Test&amp;lt;/h2&amp;gt;&#xA;&amp;lt;div class=&quot;outline-text-2&quot; id=&quot;text-1&quot;&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;div id=&quot;outline-container-sec-1-1&quot; class=&quot;outline-3&quot;&amp;gt;&#xA;&amp;lt;h3 id=&quot;sec-1-1&quot;&amp;gt;&amp;lt;span class=&quot;section-number-3&quot;&amp;gt;1.1&amp;lt;/span&amp;gt; Sub no custom&amp;lt;/h3&amp;gt;&#xA;&amp;lt;div class=&quot;outline-text-3&quot; id=&quot;text-1-1&quot;&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;div id=&quot;outline-container-Custom&quot; class=&quot;outline-3&quot;&amp;gt;&#xA;&amp;lt;h3 id=&quot;Custom&quot;&amp;gt;&amp;lt;a id=&quot;sec-1-2&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;span class=&quot;section-number-3&quot;&amp;gt;1.2&amp;lt;/span&amp;gt; Sub custom&amp;lt;/h3&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;Sub no custom&lt;/code&gt; is linked to by &lt;code&gt;#sec-1-1&lt;/code&gt; while &lt;code&gt;Sub custom&lt;/code&gt; uses &lt;code&gt;#custom&lt;/code&gt; as the reference.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;AutoGenerating IDs&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Adding &lt;code&gt;org-id&lt;/code&gt; to the list of loaded &lt;code&gt;org-modules&lt;/code&gt; or directly evaluating &lt;code&gt;(require 'org-id)&lt;/code&gt; will allow for IDs to be generated using &lt;code&gt;org-id-get-create&lt;/code&gt;.  The following will insert IDs automatically and use them on export.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Use custom ID if present, otherwise create a new one when trying to&#xA;;; resolve links&#xA;(setq org-id-link-to-org-use-id&#xA;      'create-if-interactive-and-no-custom-id)&#xA;&#xA;;; Based on org-expiry-insinuate&#xA;(add-hook 'org-insert-heading-hook 'org-id-get-create)&#xA;(add-hook 'org-after-todo-state-change-hook 'org-id-get-create)&#xA;(add-hook 'org-after-tags-change-hook 'org-id-get-create)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should look through your existing headlines in a buffer and update the IDs.  It will only create IDs if none are present.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-update-ids ()&#xA;  (interactive)&#xA;  (let* ((tree (org-element-parse-buffer 'headline))&#xA;         (map (reverse&#xA;               (org-element-map tree 'headline&#xA;                 (lambda (hl)&#xA;                   (org-element-property :begin hl))))))&#xA;    (save-excursion&#xA;      (cl-loop for point in map do&#xA;               (goto-char point)&#xA;               (org-id-get-create)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note.  This will not fix TOC links to point to the correct IDs.  TOC is only configured to use &lt;code&gt;CUSTOM_ID&lt;/code&gt; or &lt;code&gt;sec-#-#&lt;/code&gt; for generating links.  You can however access the sections by their ID's (I would suggest changing &lt;code&gt;org-id-method&lt;/code&gt; to &lt;code&gt;org&lt;/code&gt; from &lt;code&gt;uuid&lt;/code&gt; to shorten the ID length if you intend to use it this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;CUSTOM_ID&lt;/code&gt; is still probably your best bet if you actually want human-legible IDs for the headlines.  &lt;code&gt;my/org-update-ids&lt;/code&gt; should be able to be used as a starting point for that (map through the buffer for each headline, go to headline then perform action).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A starting point would be &lt;code&gt;(org-entry-put (point) &quot;CUSTOM_ID&quot; id)&lt;/code&gt; for setting and &lt;code&gt;(org-entry-get (point) &quot;CUSTOM_ID&quot;)&lt;/code&gt; for getting.  Determinining what to use as &lt;code&gt;id&lt;/code&gt; is dependant on how you want them named.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2019-07-10T17:24:10.297" LastActivityDate="2019-07-10T17:24:10.297" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="616" PostTypeId="2" ParentId="474" CreationDate="2014-10-02T15:54:53.863" Score="5" Body="&lt;p&gt;For #4, I highly recommend exuberant-ctags and the built-in tags support, which I have used for years. Alternatively, I just recently have switched to using GNU Global and the ggtags package and have found them to be slightly superior; although, they function almost identically. Both work with nearly no configuration. For other IDE features, I also like the auto-complete package. Likewise, I use &lt;code&gt;M-x compile&lt;/code&gt; extensively and bind global keys to next and previous error. For searching within &quot;projects&quot;, I generally just use &lt;code&gt;M-x find-grep&lt;/code&gt;. Note that it will use the same key bindings for next and previous error.&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-10-02T15:54:53.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="617" PostTypeId="1" AcceptedAnswerId="645" CreationDate="2014-10-02T16:25:23.537" Score="6" ViewCount="180" Body="&lt;p&gt;I just discovered &lt;a href=&quot;http://github.com/m00natic/vlfi&quot;&gt;&lt;code&gt;vlf-mode&lt;/code&gt; (View Large Files)&lt;/a&gt; and I am using it to view a large binary file in &lt;code&gt;hexl-mode&lt;/code&gt; and read certain metadata from headers within the file.  It works great, with one exception. When I move to another &quot;batch&quot; within the file, hexl-mode starts the addresses of the next batch at &lt;code&gt;0x00000000&lt;/code&gt; which makes it hard to know which byte I am actually at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there existing solutions for viewing large binary files but maintaining information about the absolute &quot;address&quot; of a given line?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="50" LastEditDate="2014-10-08T18:08:16.537" LastActivityDate="2014-10-08T18:08:16.537" Title="Batch loading binary files" Tags="|binary|large-files|hexl-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="618" PostTypeId="2" ParentId="613" CreationDate="2014-10-02T16:38:53.613" Score="5" Body="&lt;p&gt;eshell handles zsh-style &lt;code&gt;**/*&lt;/code&gt; glob expansion, so one approach is to fire up eshell in the correct directory and run &lt;code&gt;for f in **/*cc **/*h { find-file $f}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, the function &lt;code&gt;find-file&lt;/code&gt; supports wildcards when called from elisp.&#xA;Here's a useful snippet from the documentation for that &lt;code&gt;find-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(find-file FILENAME &amp;amp;optional WILDCARDS)&#xA;Interactively, or if WILDCARDS is non-nil in a call from Lisp, expand wildcards (if any) and visit multiple files.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I couldn't figure out how to get that to work with zsh-style globbing, but it might be a good option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all of these files are in a single source controlled project, &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;projectile&lt;/a&gt; might be a different and better approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. If you go with eshell, I'd suggest binding &lt;code&gt;eshell-toggle-cd&lt;/code&gt; to a key so you can easily popup an eshell prompt in the directory of the buffer you're editing.&lt;/p&gt;&#xA;" OwnerUserId="149" LastActivityDate="2014-10-02T16:38:53.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="619" PostTypeId="2" ParentId="608" CreationDate="2014-10-02T16:43:02.447" Score="2" Body="&lt;p&gt;In general, it's not possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that there might be several maps that define the same binding, and there's not way to figure out automatically which one you want. (in your example, &lt;code&gt;elisp-slime-nav-mode&lt;/code&gt; is such a minor mode). So the only really reliable approach is for you to figure out exactly what definition you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said... there's a possible hack (isn't there always...)&#xA;Part of what makes it tricky is that the binding that you want to remap is potentially already masked by an evil active keymap, so getting the current binding of &lt;code&gt;M-.&lt;/code&gt; is useless.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun lookup-no-evil (key)&#xA;  ;; excluding evil maps from the lookup. not sure if &#xA;  ;; anything more than evail-normal-state-map is needed&#xA;  (let* ((evil-maps (list evil-normal-state-map))&#xA;         (bindings&#xA;          (remq nil&#xA;                (mapcar&#xA;                 (lambda (map)&#xA;                   (unless (memq map evil-maps)&#xA;                     (lookup-key map key)))&#xA;                 (current-active-maps)))))&#xA;    (when bindings&#xA;      ;; let's assume the first one is the right one. &#xA;      ;; Given that minor modes are at the beginning &#xA;      ;; (although this is *not* documented so should not &#xA;      ;; be relied upon), it might be what we would have &#xA;      ;;without evil-mode indeed&#xA;      (car bindings))))&#xA;&#xA;(defmacro evil-remap (from to)&#xA;  ;; assuming that we want to put it in the normal-state map.&#xA;  ;; not sure about that&#xA;  `(define-key evil-normal-state-map ,to&#xA;       (lambda ()&#xA;         (interactive)&#xA;         (call-interactively (lookup-no-evil ,from)))))&#xA;&#xA;(evil-remap (kbd &quot;M-.&quot;) (kbd &quot;C-]&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I normally don't use evil at all, so there might be adjustments needed (see embedded comments)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, a cleaner approach would be to lookup the bindings once (in a mode hook for example), instead of looking up dynamically every time the keybinding is pressed. But I'm not sure what evil hook to use, so this is left as an exercise ;)&#xA;(and depending on the order you use for your minor-modes, or if you toggle them dynamically, it might be incorrect)&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="25" LastEditDate="2014-10-02T18:24:56.020" LastActivityDate="2014-10-02T18:24:56.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="620" PostTypeId="1" AcceptedAnswerId="623" CreationDate="2014-10-02T17:28:49.043" Score="21" ViewCount="2392" Body="&lt;p&gt;Is there a way to customize the widths of the columns in &lt;code&gt;ibuffer&lt;/code&gt;?  Specifically, I want to widen the Name column to be able to read more of the buffer names before they get truncated.  I have tried &lt;code&gt;Buffer-menu-name-width&lt;/code&gt;, but it seems that the &lt;code&gt;Buffer-menu&lt;/code&gt; variables are not used by &lt;code&gt;ibuffer&lt;/code&gt;.  I have also tried &lt;code&gt;M-x customize-group RET ibuffer RET&lt;/code&gt; but nothing seemed relevant.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2017-09-12T20:16:50.813" Title="Set column widths in `ibuffer`" Tags="|buffers|customize|ibuffer|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="621" PostTypeId="2" ParentId="608" CreationDate="2014-10-02T17:53:51.030" Score="10" Body="&lt;p&gt;I've got it working now, thanks to your answers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-jump-to-tag ()&#xA;  (interactive)&#xA;  (evil-emacs-state)&#xA;  (call-interactively (key-binding (kbd &quot;M-.&quot;)))&#xA;  (evil-change-to-previous-state (other-buffer))&#xA;  (evil-change-to-previous-state (current-buffer)))&#xA;&#xA;(define-key evil-normal-state-map (kbd &quot;C-]&quot;) 'my-jump-to-tag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set evil-state to &quot;Emacs&quot;, call the function bound to M-., and change back to the previous emacs state in the other buffer. I've tried it with elisp, slime and go and it's working for all of them.&lt;/p&gt;&#xA;" OwnerUserId="312" LastEditorUserId="312" LastEditDate="2014-10-03T11:14:35.853" LastActivityDate="2014-10-03T11:14:35.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="622" PostTypeId="2" ParentId="620" CreationDate="2014-10-02T18:50:05.013" Score="5" Body="&lt;p&gt;You can customize &lt;code&gt;ibuffer-formats&lt;/code&gt;, which allows you to define amongst other things the width of the columns.&#xA;It also allows you to define several formats, which is convenient for the stuff that you don't want to always display.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-02T18:50:05.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="623" PostTypeId="2" ParentId="620" CreationDate="2014-10-02T19:06:42.213" Score="21" Body="&lt;p&gt;As @Sigma's answer mentions, you need to customize &lt;code&gt;ibuffer-formats&lt;/code&gt;.   The docstring gives a lot of details about how to modify it by hand, and also notes that you can use the &lt;code&gt;customize&lt;/code&gt; machinery to tinker with it.  If you prefer the elisp approach, you can adapt the default settings to your taste, with the numbers after the &lt;code&gt;name&lt;/code&gt; component of the list referring to the minimum and maximum width of the columns.  So, changing the column to which the name field spans from the default of 18 to 30 can be achieved by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; nearly all of this is the default layout&#xA;(setq ibuffer-formats &#xA;      '((mark modified read-only &quot; &quot;&#xA;              (name 30 30 :left :elide) ; change: 30s were originally 18s&#xA;              &quot; &quot;&#xA;              (size 9 -1 :right)&#xA;              &quot; &quot;&#xA;              (mode 16 16 :left :elide)&#xA;              &quot; &quot; filename-and-process)&#xA;        (mark &quot; &quot;&#xA;              (name 16 -1)&#xA;              &quot; &quot; filename)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-02T19:06:42.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="624" PostTypeId="2" ParentId="595" CreationDate="2014-10-02T20:03:37.400" Score="5" Body="&lt;p&gt;I know graphviz has some &lt;a href=&quot;http://www.ffnn.nl/pages/articles/media/uml-diagrams-using-graphviz-dot.php&quot; rel=&quot;noreferrer&quot;&gt;support for UML&lt;/a&gt;, and org-mode has &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-dot.html&quot; rel=&quot;noreferrer&quot;&gt;good support&lt;/a&gt; for graphviz. Perhaps the combination will work for you?&lt;/p&gt;&#xA;" OwnerUserId="149" LastActivityDate="2014-10-02T20:03:37.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="625" PostTypeId="2" ParentId="613" CreationDate="2014-10-02T20:13:47.053" Score="18" Body="&lt;p&gt;Try this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u C-x d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This let's you enter arguments for how Dired should list files. By default it says &lt;code&gt;-al&lt;/code&gt; at the prompt. Add &lt;code&gt;R&lt;/code&gt; to that, ending up with &lt;code&gt;-alR&lt;/code&gt;. Type &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select/type a directory and then press &lt;kbd&gt;RET&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will recursively open all directories from the one you select, and below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here, type &lt;code&gt;% m&lt;/code&gt; to mark all files matching a certain file name pattern. I also often then type &lt;kbd&gt;t&lt;/kbd&gt; and then &lt;kbd&gt;k&lt;/kbd&gt; to kill (hide) all files I am not interested in. Type &lt;kbd&gt;t&lt;/kbd&gt; again to mark all files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as actually opening the files, I don't think there is a standard way to do it, but you can easily define a new command to do it (place it in your &lt;code&gt;.emacs&lt;/code&gt; file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dired-find-marked-files ()&#xA; (interactive)&#xA; (dolist (f (dired-get-marked-files)) &#xA;  (find-file f)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Most probably someone has already included this in some nice Dired enhancement package, but it's fun to do it yourself too ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;" OwnerUserId="320" LastEditorUserId="504" LastEditDate="2014-10-15T09:08:37.163" LastActivityDate="2014-10-15T09:08:37.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="626" PostTypeId="1" AcceptedAnswerId="632" CreationDate="2014-10-02T20:15:04.593" Score="5" ViewCount="566" Body="&lt;p&gt;Indentation in ESS is occasionally a little kooky, and I'm trying to figure out if the kookiness is a bug or a feature.  How does one get proper indentation of parentheses after an &quot;=&quot; sign in ESS (say, in &lt;code&gt;R-mode&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, I'd expect indentation to look like this for the &quot;labels&quot; parameter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;somevar &amp;lt;- factor(x = 1:3,&#xA;                  labels = c(&quot;a&quot;,&#xA;                             &quot;b&quot;,&#xA;                             &quot;c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;somevar &amp;lt;- factor(x = 1:3,&#xA;                  labels = c(&quot;a&quot;,&#xA;                    &quot;b&quot;,&#xA;                    &quot;c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This version (note the extra parentheses wrapped around the &lt;code&gt;c(...)&lt;/code&gt; expression) seems to work just fine, however:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;somevar &amp;lt;- factor(x = 1:3,&#xA;                  labels = (c(&quot;a&quot;,&#xA;                              &quot;b&quot;,&#xA;                              &quot;c&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This oddity only seems to occur if it's after the &quot;=&quot;.  How do I get the desired behavior?  Am I missing some setting somewhere?  (I hope so: wading through the source code for &lt;code&gt;ess-indent-line&lt;/code&gt; is not an explosion of joy.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE:&lt;/em&gt; I'd originally asked a version of &#xA;&lt;a href=&quot;https://stackoverflow.com/questions/22056585/emacs-ess-indentation-of-parentheses-after&quot;&gt;this question&lt;/a&gt; on Stack Overflow about half a year ago -- it got a little interest but zero answers.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-01-13T11:50:03.797" Title="ESS indentation of parentheses after =?" Tags="|indentation|ess|r|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="627" PostTypeId="2" ParentId="600" CreationDate="2014-10-02T20:51:58.477" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;M-x bovinate&lt;/code&gt; to see what the parser will dump. On the file you linked it's fairly obvious from the output that it gets stuck near the class definition. The offending token is &lt;code&gt;AbstractLifecycleComponent&amp;lt;Transport&amp;gt;&lt;/code&gt;. You can test this yourself by deleting the &quot;extends&quot; portion of that class definition and trying again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a problem with the parser used in &lt;code&gt;wisent/java-tags.el&lt;/code&gt; in both the &lt;code&gt;cedet&lt;/code&gt; included in recent versions of emacs, and in the &lt;code&gt;cedet&lt;/code&gt; development version. There is an alternative parser that works fine with your example file, and basically everything I've ever thrown at it, included in the development version of &lt;code&gt;cedet&lt;/code&gt;. Just make sure that the full parser is loaded in favour of the inaccurate but fast &lt;code&gt;java-tags.el&lt;/code&gt; parser. You can do this by messing with &lt;code&gt;cedet&lt;/code&gt;'s autoloads using the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'wisent-java-default-setup &quot;semantic/wisent/java&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="284" LastActivityDate="2014-10-02T20:51:58.477" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="628" PostTypeId="1" AcceptedAnswerId="629" CreationDate="2014-10-02T21:09:57.607" Score="5" ViewCount="740" Body="&lt;p&gt;I currently use the following custom command to navigate between windows and frames:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun nispio/other-window (&amp;amp;optional arg)&#xA;  &quot;With prefix argument, select the next frame. Otherwise, select the next window&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if arg (other-frame 1) (other-window 1)))&#xA;(global-set-key (kbd &quot;C-\\&quot;) 'nispio/other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows me to jump between windows with &lt;code&gt;C-\&lt;/code&gt; and between frames with &lt;code&gt;C-u C-\&lt;/code&gt;.  But what I would &lt;em&gt;really&lt;/em&gt; like is a command that will let me cycle through all of the windows, regardless of the frame that the window is in.  Given the following window configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             Frame 1                         Frame 2&#xA;   +---------------------------+       +------------------+&#xA;   +------------+--------------+       +------------------+&#xA;   |            |              |       |                  |&#xA;   |  Window 1  |   Window 2   |       |                  |&#xA;   |            |              |       |                  |&#xA;   |            |              |       |     Window 4     |&#xA;   |            |              |       |                  |&#xA;   +------------+--------------+       |                  |&#xA;   |         Window 3          |       |                  |&#xA;   |                           |       |                  |&#xA;   +---------------------------+       +------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want a command that freely cycles between window 1 - 2 - 3 - 4 - and back to 1 again.  I don't want to have to think about which frame a window belongs to in order to cycle through them.  Does such a command exist?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="105" LastEditDate="2015-03-27T19:21:24.630" LastActivityDate="2015-03-27T19:21:24.630" Title="Cycle between windows in all frames" Tags="|window|frames|cycling|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="629" PostTypeId="2" ParentId="628" CreationDate="2014-10-02T21:20:06.723" Score="8" Body="&lt;p&gt;You're almost there: &lt;code&gt;other-window&lt;/code&gt; takes an optional second argument which, if it has the value &lt;code&gt;t&lt;/code&gt;, says to cycle through windows on all frames. You can also use the symbol &lt;code&gt;visible&lt;/code&gt; to consider only visible frames, or the integer 0 to consider only visible or iconified frames. So replace &lt;code&gt;(other-window 1)&lt;/code&gt; by &lt;code&gt;(other-window 1 t)&lt;/code&gt; or &lt;code&gt;(other-window 1 'visible)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a wrinkle, which is that Emacs tends to defer to the operating system's windowing system's rules for selecting a frame. From the documentation of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Input-Focus.html#index-select_002dframe-2603&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;select-frame&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The selection of frame lasts until the next time the user does something to select a different frame, or until the next time this function is called. (If you are using a window system, the previously selected frame may be restored as the selected frame after return to the command loop, because it still may have the window system's input focus.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So when the interactive command that triggered a call to &lt;code&gt;other-window&lt;/code&gt; returns, the selected frame may be restored. To avoid this, call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Input-Focus.html#index-select_002dframe_002dset_002dinput_002dfocus-2602&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;select-frame-set-input-focus&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(other-window 1 t)&#xA;(select-frame-set-input-focus (selected-frame))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-10-03T07:40:22.950" LastActivityDate="2014-10-03T07:40:22.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="630" PostTypeId="1" AcceptedAnswerId="656" CreationDate="2014-10-02T22:02:24.837" Score="4" ViewCount="554" Body="&lt;p&gt;Abbrev-mode seems to think an underscore signals a new word, which is not the case in many programming languages. I want it to expand after spaces, newlines, and tabs; not after underscores. Is there a way to tell abbrev-mode not to expand when I type an underscore?&lt;/p&gt;&#xA;" OwnerUserId="387" LastActivityDate="2015-10-20T22:17:43.537" Title="Prevent abbrev-mode from expanding on underscore" Tags="|abbrev|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="631" PostTypeId="2" ParentId="630" CreationDate="2014-10-02T22:30:08.317" Score="0" Body="&lt;p&gt;I've just found &lt;a href=&quot;https://stackoverflow.com/questions/6993866/prevent-abbrev-expansion-after-certain-symbols-in-emacs&quot;&gt;this&lt;/a&gt; on SO: define some function to protect some key. Not sure if the best solution. &lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-02T22:30:08.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="632" PostTypeId="2" ParentId="626" CreationDate="2014-10-02T22:55:28.560" Score="8" Body="&lt;p&gt;Set &lt;code&gt;ess-arg-function-offset&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf ess-arg-function-offset nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For me this indents your examples the way that you want them to be. Read the documentation of the variable to find out why (and note that &lt;code&gt;c&lt;/code&gt; is a function call).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply setting it once in an init file does not work. A simple way for it to register is to set it in &lt;code&gt;ess-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ess-mode-hook (lambda () (setq ess-arg-function-offset nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is because of the way that those style variables are set from a list of possible default styles (listed in &lt;code&gt;ess-style-alist&lt;/code&gt;) for each ess buffer at their creation. This hook adjusts &lt;code&gt;ess-arg-function-offset&lt;/code&gt; after the fact, which is why it works when a single setting in &lt;code&gt;init.el&lt;/code&gt; doesn't work. You can define your own style and give it a name, and use it instead of one of the builtin ones, similar to what you can do with CC mode.&lt;/p&gt;&#xA;" OwnerUserId="284" LastEditorUserId="25" LastEditDate="2014-10-03T11:49:31.707" LastActivityDate="2014-10-03T11:49:31.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="633" PostTypeId="1" AcceptedAnswerId="652" CreationDate="2014-10-02T22:57:44.003" Score="11" ViewCount="10137" Body="&lt;p&gt;Of course when I am in Terminal and I press the up arrow key, it goes to the previous command. However, when I hit the &lt;kbd&gt;M-x&lt;/kbd&gt; keys and type &lt;code&gt;shell&lt;/code&gt; an integrated shell comes up in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/MuU1w.png&quot; alt=&quot;Shell in Emacs&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I type a command and press up, this happens: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/rpTSX.png&quot; alt=&quot;When I press the up button in Shell Emacs&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get back to the last command I typed?&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="50" LastEditDate="2014-10-20T17:48:30.710" LastActivityDate="2020-08-26T09:53:43.110" Title="How to run a previous command in an Emacs shell?" Tags="|eshell|" AnswerCount="6" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="634" PostTypeId="2" ParentId="633" CreationDate="2014-10-02T23:00:25.277" Score="7" Body="&lt;p&gt;Just found an answer on Super User:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://superuser.com/questions/139815/how-do-you-run-the-previous-command-in-emacs-shell&quot;&gt;How do you run the previous command in emacs shell?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-p&lt;/kbd&gt; goes to the previous command. &lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2014-10-02T23:00:25.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="635" PostTypeId="1" AcceptedAnswerId="638" CreationDate="2014-10-02T23:56:38.627" Score="27" ViewCount="3875" Body="&lt;p&gt;I'm aware of &lt;code&gt;C-x C-e&lt;/code&gt; which is &lt;code&gt;eval-last-sexp&lt;/code&gt; and &lt;code&gt;M-x eval-buffer&lt;/code&gt;, but these aren't always sufficient to pick up all changes. Sometimes you need to actually close buffers that are in the modes who have had their configuration changed, and other times you need to restart emacs entirely. Is there a more general way of handling this problem? Alternatively, is there a way to restart emacs without losing the existing opened buffers and the interactive history?&lt;/p&gt;&#xA;" OwnerUserId="317" LastEditorUserId="306" LastEditDate="2014-10-03T19:18:46.060" LastActivityDate="2016-03-01T22:28:34.323" Title="What's the fastest way to reload my .emacs file when I make changes so all my affected buffers will pick up those changes?" Tags="|init-file|session|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="636" PostTypeId="1" AcceptedAnswerId="637" CreationDate="2014-10-03T00:06:39.163" Score="30" ViewCount="4844" Body="&lt;p&gt;I'd like to load the &lt;code&gt;yaml-mode&lt;/code&gt; for any files named &lt;code&gt;*.yml&lt;/code&gt; or &lt;code&gt;*.yaml&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-10-06T23:15:14.887" Title="How do I automatically load a mode for a specific set of file extensions?" Tags="|major-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="637" PostTypeId="2" ParentId="636" CreationDate="2014-10-03T00:06:39.163" Score="29" Body="&lt;p&gt;Add these lines to your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'yaml-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.ya?ml\\'&quot; . yaml-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;auto-mode-alist&lt;/code&gt; is a variable which emacs consults whenever a new file is opened. You can add mappings between filename patterns and major-modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find out more about how Emacs determines which modes to load for a given buffer from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Auto-Major-Mode.html#Auto-Major-Mode&quot; rel=&quot;noreferrer&quot;&gt;Emacs manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-10-06T23:15:14.887" LastActivityDate="2014-10-06T23:15:14.887" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="638" PostTypeId="2" ParentId="635" CreationDate="2014-10-03T00:19:40.350" Score="17" Body="&lt;p&gt;No, it is not possible to reload the modified configuration and have Emacs behave as if those modifications were already in place when Emacs was loaded. In short, Emacs packages have too much freedom for this to be feasible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You mention that some major modes don't pick up configuration changes. A likely reason for this is that enabling the mode sets some buffer-local variables based on the current values of certain options. Without re-enabling such a mode in every buffer which uses it, not all changes will be picked up. And even then it is quite possible that some things stay unchanged. The odds of this working are higher when the options are customized using a &lt;code&gt;custom-set-variables&lt;/code&gt; form, but this has to be implemented explicitly for each and every option. And so far we have only talked about major modes and their options...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could attempt to implement a command to re-enable the major mode of each buffer. But it is unlikely that would fully enable all changes, and worse it would disable all minor modes you have manually enabled, and lose all kinds of other state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that reason I would even recommend against &lt;code&gt;eval-buffer&lt;/code&gt;ing your init file at all to pick up as many of the changes as possible. Evaluate the changed settings individually using &lt;code&gt;eval-last-sexp&lt;/code&gt; and if that doesn't work, well then you have to restart Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How state can be preserved when Emacs is closed is a different question which should be asked separately.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="92" LastEditDate="2016-03-01T19:55:25.467" LastActivityDate="2016-03-01T19:55:25.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="639" PostTypeId="1" AcceptedAnswerId="642" CreationDate="2014-10-03T00:25:04.910" Score="18" ViewCount="2657" Body="&lt;p&gt;As a follow-up to &lt;a href=&quot;https://emacs.stackexchange.com/questions/635/whats-the-fastest-way-to-reload-my-emacs-file-when-i-make-changes-so-all-my-af&quot;&gt;What&amp;#39;s the fastest way to reload my .emacs file when I make changes so all my affected buffers will pick up those changes?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was suggested that the restart question should be asked separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to reopen all the previous buffers &lt;strong&gt;and keep the &lt;code&gt;M-p&lt;/code&gt; interactive history for commands?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="317" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-10-03T02:53:16.117" Title="How can I restart emacs and preserve my open buffers and interactive history?" Tags="|session|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="640" PostTypeId="5" CreationDate="2014-10-03T00:53:31.187" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-03T00:53:31.187" LastActivityDate="2014-10-03T00:53:31.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="641" PostTypeId="4" CreationDate="2014-10-03T00:53:31.187" Score="0" Body="Commands are functions that can be invoked interactively either through `M-x` or by a key binding." OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-10-03T04:53:11.997" LastActivityDate="2014-10-03T04:53:11.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="642" PostTypeId="2" ParentId="639" CreationDate="2014-10-03T01:41:44.510" Score="19" Body="&lt;p&gt;&lt;code&gt;desktop-save-mode&lt;/code&gt; handles storing, and restoring, the buffer state of your session. It can also handle window and frames.&#xA;For persistence of variables across sessions, see &lt;code&gt;savehist-mode&lt;/code&gt;. By default it handles the minibuffer history, but it's not limited to it. Another interesting thing that might be interesting to persist is for example the kill-ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;(savehist-mode 1)&#xA;(add-to-list 'savehist-additional-variables 'kill-ring) ;; for example&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-10-03T02:53:16.117" LastActivityDate="2014-10-03T02:53:16.117" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="643" PostTypeId="1" AcceptedAnswerId="650" CreationDate="2014-10-03T02:11:19.263" Score="4" ViewCount="718" Body="&lt;p&gt;Sometimes when I am using helm, I want to make the helm completion buffer as big as possible. I know that &lt;code&gt;helm-enlarge-window&lt;/code&gt; will make the window grow by 1 line, but this is awkward and still doesn't quite achieve the desired result.  I also know that setting &lt;code&gt;(setq helm-full-frame t)&lt;/code&gt; will make helm open full-frame by default, but I don't want all helm buffer full frame all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I really want is to bind a key that will instantly expand the helm completion buffer to full-frame.  I have tried this (where &lt;code&gt;*helm XYZ*&lt;/code&gt; is the name of the current helm buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (with-current-buffer &quot;*helm XYZ*&quot; (delete-other-windows))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I get the error &quot;Can't expand minibuffer to full frame.&quot;  Any other suggestions for how I can toggle the helm buffer to be full frame?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-03T04:52:52.350" Title="Make helm window the only window" Tags="|window|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="644" PostTypeId="2" ParentId="474" CreationDate="2014-10-03T02:15:24.333" Score="1" Body="&lt;p&gt;For #4, seems to be a new project called &lt;a href=&quot;https://github.com/Valloric/YouCompleteMe&quot; rel=&quot;nofollow&quot;&gt;YouCompleteme&lt;/a&gt;, and the corresponding &lt;a href=&quot;https://github.com/neuromage/ycm.el&quot; rel=&quot;nofollow&quot;&gt;Emacs client&lt;/a&gt; which seems to be the next cool thing. Because it uses clang it has a better view of the code than tags or global.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-10-03T02:15:24.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="645" PostTypeId="2" ParentId="617" CreationDate="2014-10-03T02:49:46.573" Score="3" Body="&lt;p&gt;That sounds like a missing feature in &lt;code&gt;vlf-mode&lt;/code&gt;, and quite possibly some missing customization in &lt;code&gt;hexl-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way &lt;code&gt;hexl-mode&lt;/code&gt; works if by running the &lt;code&gt;hexl&lt;/code&gt; program (shipped with Emacs, see &lt;code&gt;hexl-program&lt;/code&gt;), and displaying the output. This output already contains the offsets, they're just made non-editable. So, &lt;code&gt;vlf-mode&lt;/code&gt; should add &lt;code&gt;vlf-start-pos&lt;/code&gt; to all of those. Then of course, things like &lt;code&gt;hexl-goto-address&lt;/code&gt; should also be modified, by transparently substracting the same &lt;code&gt;vls-start-pos&lt;/code&gt;.&#xA;It might also be worth forcing &lt;code&gt;vlf-batch-size&lt;/code&gt; to be alignment friendly by making it a multiple of 256 when &lt;code&gt;hexl-mode&lt;/code&gt; is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That sounds like a too invasive change to do it here, but I suspect the &lt;code&gt;vlf-mode&lt;/code&gt; author would appreciate the feedback, and would be in a good position to implement just that.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-03T02:49:46.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="646" PostTypeId="2" ParentId="613" CreationDate="2014-10-03T03:04:41.387" Score="6" Body="&lt;p&gt;Here are two possibilities (alternatives):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In Dired you can include all of the subdirs containing files you want to act on, either by using &lt;code&gt;ls&lt;/code&gt; switches that include &lt;code&gt;-R&lt;/code&gt; or by using &lt;code&gt;i&lt;/code&gt; to include specific subdirs.  If you use library &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then you can use &lt;code&gt;* .&lt;/code&gt; (bound to &lt;code&gt;diredp-mark/unmark-extension&lt;/code&gt;, to mark all of the listed files that have a given extension (such as &lt;code&gt;.h&lt;/code&gt;).  Then you can use &lt;code&gt;F&lt;/code&gt; (bound to &lt;code&gt;dired-do-find-marked-files&lt;/code&gt;) to open all of the marked files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With library &lt;strong&gt;Dired+&lt;/strong&gt; you can act on all of the marked files and all of the marked files in marked subdirectories, defined recursively, IOW, subdirs of subdirs, their subdirs, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any marked directory, &lt;em&gt;if no files are marked&lt;/em&gt; in that directory (i.e., marked in a Dired listing for that subdir) then the action is on &lt;strong&gt;all&lt;/strong&gt; of its files.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a fair number of commands for acting on such files in different ways (opening, searching etc.).  But the files to act on are determined only that way; there is not also the possibility of, say, entering a glob pattern or a regexp to filter the set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you use library &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; together with &lt;strong&gt;Dired+&lt;/strong&gt; then you can use &lt;code&gt;M-+ C-F&lt;/code&gt;, i.e., &lt;code&gt;M-+ C-S-f&lt;/code&gt; (which is bound to &lt;code&gt;icicle-visit-marked-file-of-content-recursive&lt;/code&gt;), to open any or all of the files just described (i.e., those marked or in marked subdirs, defined recursively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use regexps, on the fly, to filter the file names (and/or the file contents).  For example, You can, as you request, open all of the files that have extensions &lt;code&gt;.c&lt;/code&gt;, &lt;code&gt;.cc&lt;/code&gt;, and &lt;code&gt;.h&lt;/code&gt; in the marked subdirs (with marked subdirs being handled the same way, recursively).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-03T03:11:02.877" LastActivityDate="2014-10-03T03:11:02.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="647" PostTypeId="2" ParentId="628" CreationDate="2014-10-03T03:31:01.643" Score="1" Body="&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then &lt;code&gt;C-x o&lt;/code&gt; (bound to &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands#multi-command&quot; rel=&quot;nofollow&quot;&gt;multi-command&lt;/a&gt; &lt;code&gt;icicle-other-window-or-frame&lt;/code&gt;) does what you describe, when you use it only for cycling. To include all windows on all visible frames, use a plain prefix arg (&lt;code&gt;C-u C-x o&lt;/code&gt;). To include all windows on any frame (including iconified and invisible frames), use &lt;code&gt;C-u C-u C-x o&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You do not cycle by repeating this key.  You use the key once, then you cycle among candidates using &lt;code&gt;C-down&lt;/code&gt; or similar.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You asked only for cycling, but the command lets you also (1) choose a window by name (with completion) or (2) narrow the set of windows to cycle through by filtering on their names (on the fly).  Whatever windows have names that match your current minibuffer input are those that are candidates, and those you can cycle through.  You can cycle through any subsequence of those, and you can do so in different orders (you can sort the candidates in different ways).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-03T15:08:41.720" LastActivityDate="2014-10-03T15:08:41.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="648" PostTypeId="2" ParentId="633" CreationDate="2014-10-03T03:49:43.577" Score="1" Body="&lt;p&gt;Another possibility, if you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;: Use &lt;code&gt;C-c TAB&lt;/code&gt; (command &lt;code&gt;icicle-comint-command&lt;/code&gt;) to choose a previously entered command with completion (or cycling).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-08-26T13:42:24.977" LastActivityDate="2017-08-26T13:42:24.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="649" PostTypeId="2" ParentId="506" CreationDate="2014-10-03T04:06:04.293" Score="61" Body="&lt;p&gt;Before resorting to &lt;code&gt;gdb&lt;/code&gt;, if you're using a Unix-y operating system, you can try sending &lt;code&gt;SIGUSR2&lt;/code&gt; to the Emacs process, like documented in the &lt;code&gt;DEBUG&lt;/code&gt; file mentioned in the other answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ kill -SIGUSR2 &amp;lt;emacs_pid_goes_here&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will make Emacs attempt to break out of its current loop into the Lisp debugger.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or use this one liner without typing emacs pid manually:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ps aux | grep -ie emacs | grep -v grep | awk '{print $2}' | xargs kill -SIGUSR2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if &lt;code&gt;killall&lt;/code&gt; is available:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ killall -USR2 emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="124" LastEditorUserId="1982" LastEditDate="2017-03-06T12:08:03.140" LastActivityDate="2017-03-06T12:08:03.140" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="650" PostTypeId="2" ParentId="643" CreationDate="2014-10-03T04:52:52.350" Score="6" Body="&lt;p&gt;The error you get is because point is in the minibuffer waiting for completion when you call &lt;code&gt;with-current-buffer&lt;/code&gt;. Fortunately, &lt;code&gt;helm&lt;/code&gt; provides &lt;code&gt;helm-window&lt;/code&gt; to select the completion window. The following function leverages this to achieve what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun my-make-helm-full-frame ()&#xA;   (interactive)&#xA;   (with-selected-window (helm-window)&#xA;     (delete-other-windows)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bind it to a key in &lt;code&gt;helm-map&lt;/code&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'my-make-helm-full-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that pressing &lt;code&gt;F9&lt;/code&gt; when helm is active maximized the window. Pressing &lt;code&gt;C-g&lt;/code&gt; quits &lt;code&gt;helm&lt;/code&gt; and restores your original window. If you use &lt;code&gt;winner-mode&lt;/code&gt; you can call &lt;code&gt;winner-undo&lt;/code&gt; bound to &lt;code&gt;C-c left&lt;/code&gt; to restore the completion window to its original size.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-03T04:52:52.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="651" PostTypeId="2" ParentId="630" CreationDate="2014-10-03T05:25:06.230" Score="2" Body="&lt;p&gt;This should be take care of it. It disables abbrev mode for any key you want. It's similar to the other answer, but you don't need to define a new function for each key.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun self-insert-no-abbrev ()&#xA;  (interactive)&#xA;  (let ((abbrev-mode nil))&#xA;    (call-interactively 'self-insert-command)))&#xA;&#xA;(global-set-key &quot;_&quot; #'self-insert-no-abbrev)&#xA;(global-set-key &quot;.&quot; #'self-insert-no-abbrev)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-03T05:25:06.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="652" PostTypeId="2" ParentId="633" CreationDate="2014-10-03T05:44:12.163" Score="23" Body="&lt;p&gt;The function that &lt;em&gt;cycles backwards through input history, saving input.&lt;/em&gt; is &lt;code&gt;comint-previous-input&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is bound to &lt;kbd&gt;C-up&lt;/kbd&gt;, &lt;kbd&gt;M-p&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2014-10-03T10:21:23.177" LastActivityDate="2014-10-03T10:21:23.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="653" PostTypeId="1" AcceptedAnswerId="654" CreationDate="2014-10-03T06:57:19.177" Score="72" ViewCount="19256" Body="&#xA;&#xA;&lt;p&gt;I have rebound a the 'd' key in &lt;code&gt;gnus-article-mode&lt;/code&gt;, but its old behavior is still active when the point is on an attachment. I can see that the rebinding did not take effect there by doing &lt;code&gt;C-h k d&lt;/code&gt;, but it is not telling me what keymap is in effect at that point, so that I can rebind it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to find it out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a precise example: I'm using evil, and I want articles to be in motion mode. For my keyboard layout I have 'd' configured as the key to go up.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-mode 1)&#xA;(add-to-list 'evil-motion-state-modes 'gnus-article-mode)&#xA;(setq evil-emacs-state-modes (remove 'gnus-article-mode evil-emacs-state-modes))&#xA;(define-key evil-motion-state-map &quot;d&quot; 'evil-previous-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To make sure the evil keys are taken into account, I unset gnus key in the local map:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun as/alter-article-evil-map ()&#xA;  (local-unset-key &quot;d&quot;))&#xA;(add-hook 'gnus-article-mode-hook 'as/alter-article-evil-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, when the point is on an attachment, the 'd' key no longer goes up but it offers me to delete the attachment. I guess another binding is active at that point, hence the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt; I used the &lt;code&gt;keymaps-at-point&lt;/code&gt; below to find the keymap used was from a text property. I then looked at the code of the bound function to find the name of the keymap &lt;code&gt;gnus-mime-button-map&lt;/code&gt;. The following code does what I want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun as/alter-article-evil-map ()&#xA;  (define-key gnus-mime-button-map &quot;d&quot; nil))&#xA;(add-hook 'gnus-article-mode-hook 'as/alter-article-evil-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="491" LastEditorUserId="105" LastEditDate="2018-11-24T05:48:01.893" LastActivityDate="2024-01-12T01:55:24.410" Title="How can I find out in which keymap a key is bound?" Tags="|key-bindings|keymap|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="654" PostTypeId="2" ParentId="653" CreationDate="2014-10-03T08:24:33.633" Score="70" Body="&#xA;&#xA;&lt;h2&gt;Emacs 25&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As mentioned by @YoungFrog in the comments, &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=958d20d22a5e9b997de0bf7cc63436dc82486111&quot; rel=&quot;noreferrer&quot;&gt;starting with Emacs 25.1&lt;/a&gt;, the good-old &lt;code&gt;C-h k&lt;/code&gt; method of describing key-binds will also tell you which keymap the key was found in.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Before Emacs 25&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There’s some code&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/18801018/how-to-find-in-which-map-a-key-binding-is-from-programatically-in-emacs&quot;&gt;here&lt;/a&gt;&#xA;on this, but it’s incomplete as it does not cover everything. Below is an improved version of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keys can be bound in 9(!) ways. Thanks to @Drew for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-Keymaps.html#Searching-Keymaps&quot; rel=&quot;noreferrer&quot;&gt;this link&lt;/a&gt; (also supplemented by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html#Controlling-Active-Maps&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt;) with the full list. By order of precedence, they are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A terminal-specific set of keys, &lt;a href=&quot;http://doc.endlessparentheses.com/Var/overriding-terminal-local-map&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;overriding-terminal-local-map&lt;/code&gt;&lt;/a&gt;. This is defined by the &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/set-transient-map&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;set-transient-map&lt;/code&gt;&lt;/a&gt; function.&lt;/li&gt;&#xA;&lt;li&gt;A buffer-local override map, &lt;a href=&quot;http://doc.endlessparentheses.com/Var/overriding-local-map&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;overriding-local-map&lt;/code&gt;&lt;/a&gt;. If this one is set, items 3–8 are skipped (probably why you don't see many of these).&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&quot; rel=&quot;noreferrer&quot;&gt;At point&lt;/a&gt; via the &lt;code&gt;keymap&lt;/code&gt; text-propety (which could go on actual text or on overlays).&lt;/li&gt;&#xA;&lt;li&gt;A variable which essentially simulates different possible sets of enabled minor-modes, &lt;a href=&quot;http://doc.endlessparentheses.com/Var/emulation-mode-map-alists&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;emulation-mode-map-alists&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;A variable where major-modes can override the keybinds of minor-modes, &lt;a href=&quot;http://doc.endlessparentheses.com/Var/minor-mode-overriding-map-alist&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;minor-mode-overriding-map-alist&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The actual &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Keymaps-and-Minor-Modes.html&quot; rel=&quot;noreferrer&quot;&gt;minor-modes&lt;/a&gt;, whose keybinds are stored in &lt;a href=&quot;http://doc.endlessparentheses.com/Var/minor-mode-map-alist&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;minor-mode-map-alist&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&quot; rel=&quot;noreferrer&quot;&gt;At point&lt;/a&gt; (again), via the &lt;code&gt;local-map&lt;/code&gt; text property. If this exists, item 8 is skipped.&lt;/li&gt;&#xA;&lt;li&gt;The standard &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Local-Keymaps.html&quot; rel=&quot;noreferrer&quot;&gt;buffer-local keymap&lt;/a&gt; (where major-mode or buffer-local keybinds go), returned by the function &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/current-local-map&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;current-local-map&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keymaps.html#Keymaps&quot; rel=&quot;noreferrer&quot;&gt;global keymap&lt;/a&gt;, returned by &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/current-global-map&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;current-global-map&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;There's a also a semi-item 10. Whatever command was found through the above procedure might also have been remaped.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following function queries &lt;strong&gt;some&lt;/strong&gt; of these possibilities (the most likely ones), and returns or prints the result.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun locate-key-binding (key)&#xA;  &quot;Determine in which keymap KEY is defined.&quot;&#xA;  (interactive &quot;kPress key: &quot;)&#xA;  (let ((ret&#xA;         (list&#xA;          (key-binding-at-point key)&#xA;          (minor-mode-key-binding key)&#xA;          (local-key-binding key)&#xA;          (global-key-binding key))))&#xA;    (when (called-interactively-p 'any)&#xA;      (message &quot;At Point: %s\nMinor-mode: %s\nLocal: %s\nGlobal: %s&quot;&#xA;               (or (nth 0 ret) &quot;&quot;) &#xA;               (or (mapconcat (lambda (x) (format &quot;%s: %s&quot; (car x) (cdr x)))&#xA;                              (nth 1 ret) &quot;\n             &quot;)&#xA;                   &quot;&quot;)&#xA;               (or (nth 2 ret) &quot;&quot;)&#xA;               (or (nth 3 ret) &quot;&quot;)))&#xA;    ret))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are built-in functions for each of these except the first, so we&#xA;must create one (also an improved version of the code linked above).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun key-binding-at-point (key)&#xA;  (mapcar (lambda (keymap) (when (keymapp keymap)&#xA;                             (lookup-key keymap key)))&#xA;          (list&#xA;           ;; More likely&#xA;           (get-text-property (point) 'keymap)&#xA;           (mapcar (lambda (overlay)&#xA;                     (overlay-get overlay 'keymap))&#xA;                   (overlays-at (point)))&#xA;           ;; Less likely&#xA;           (get-text-property (point) 'local-map)&#xA;           (mapcar (lambda (overlay)&#xA;                     (overlay-get overlay 'local-map))&#xA;                   (overlays-at (point))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since you’re saying the behaviour is active when point is on an &#xA;attachment, there’s a good chance this keybind takes place on an&#xA;overlay or text-property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If that doesn't work&lt;/strong&gt;, try the following command as well. Just place the cursor on the attachment, and do &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;keymaps-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun keymaps-at-point ()&#xA;  &quot;List entire keymaps present at point.&quot;&#xA;  (interactive)&#xA;  (let ((map-list&#xA;         (list&#xA;          (mapcar (lambda (overlay)&#xA;                    (overlay-get overlay 'keymap))&#xA;                  (overlays-at (point)))&#xA;          (mapcar (lambda (overlay)&#xA;                    (overlay-get overlay 'local-map))&#xA;                  (overlays-at (point)))&#xA;          (get-text-property (point) 'keymap)&#xA;          (get-text-property (point) 'local-map))))&#xA;    (apply #'message&#xA;           (concat &#xA;            &quot;Overlay keymap: %s\n&quot;&#xA;            &quot;Overlay local-map: %s\n&quot;&#xA;            &quot;Text-property keymap: %s\n&quot;&#xA;            &quot;Text-property local-map: %s&quot;)&#xA;           map-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="25" LastEditDate="2017-10-19T20:57:50.073" LastActivityDate="2017-10-19T20:57:50.073" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="655" PostTypeId="1" CreationDate="2014-10-03T09:58:56.160" Score="10" ViewCount="324" Body="&lt;p&gt;(This question is &lt;em&gt;not&lt;/em&gt; about writing benchmarks/profiling elisp code, for that, see &lt;a href=&quot;https://emacs.stackexchange.com/q/539/304&quot;&gt;this question&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do any benchmark suites exist for Emacs performance? I'm looking for something equivalent to &lt;a href=&quot;http://v8.googlecode.com/svn/data/benchmarks/v7/run.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the V8 interpreter team's standard benchmark&lt;/a&gt; or &lt;a href=&quot;http://speed.pypy.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;the pypy team's benchmark suite&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to answer questions like 'is Emacs 24.4 faster than 24.3?'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any existing benchmark suites?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-10-12T03:11:58.587" Title="Are there any pre-existing benchmark suites for Emacs itself?" Tags="|performance|benchmarking|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="656" PostTypeId="2" ParentId="630" CreationDate="2014-10-03T11:43:17.523" Score="2" Body="&lt;p&gt;Abbrev expansion behavior is built into the C code that implements &lt;code&gt;self-insert-command&lt;/code&gt;. It looks up the syntactic class of the current and previous character in the buffer's &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html#Syntax-Tables&quot; rel=&quot;nofollow noreferrer&quot;&gt;syntax table&lt;/a&gt; to decide whether to expand abbreviations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a programming mode for a language where the underscore is an identifier constituent, you may want to &lt;strong&gt;change &lt;code&gt;_&lt;/code&gt; to have word syntax&lt;/strong&gt;. This is a blunt instrument: every part of the system will then treat &lt;code&gt;_&lt;/code&gt; as a word constituent, including motion commands. You may or may not like this. You can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ccmode/Subword-Movement.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Subword mode&lt;/a&gt; to make the basic motion commands treat underscore as a word separator regardless of its declared syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally, font locking has special support to use a different syntax table for highlighting. Many programming language modes use this to treat &lt;code&gt;_&lt;/code&gt; as a word constituent for syntax highlighting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-underscore-word-constituent (syntax-table)&#xA;  (modify-syntax-entry ?_ &quot;w&quot; syntax-table))&#xA;(eval-after-load &quot;cc-mode&quot; '(make-underscore-word-constituent c-mode-syntax-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't like the secondary effects, you can make &lt;code&gt;_&lt;/code&gt; a key that inserts &lt;code&gt;_&lt;/code&gt; in any way other than self-insert, e.g. &lt;a href=&quot;https://emacs.stackexchange.com/a/651&quot;&gt;by temporarily setting &lt;code&gt;abbrev-mode&lt;/code&gt; to nil&lt;/a&gt; or like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun self-insert-no-abbrev (&amp;amp;optional arg)&#xA;  (interactive &quot;*p&quot;)&#xA;  (insert-char last-command-char arg))&#xA;(define-key c-mode-base-map &quot;_&quot; 'self-insert-no-abbrev)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has a few side effects of its own, because &lt;code&gt;_&lt;/code&gt; won't be self-inserting any more. For example, &lt;code&gt;_&lt;/code&gt; will remain an undo barrier, it won't delete the selection under &lt;code&gt;delete-selection-mode&lt;/code&gt;, etc. Some of these side effects may disappear if you add &lt;code&gt;(setq this-command 'self-insert-command)&lt;/code&gt; to &lt;code&gt;self-insert-no-abbrev&lt;/code&gt;, but not the ones I mentioned (I don't think there's a generic solution that will apply to &lt;code&gt;delete-selection&lt;/code&gt;mode` since it runs before the command).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-10-04T00:42:45.960" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="657" PostTypeId="1" AcceptedAnswerId="673" CreationDate="2014-10-03T13:23:38.720" Score="4" ViewCount="822" Body="&lt;p&gt;Here is a screenshot showing the difference between &lt;code&gt;sql-interactive-mode&lt;/code&gt; (top) and &lt;code&gt;sql-mode&lt;/code&gt; (bottom).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mzTrm.png&quot; alt=&quot;At the top, sql-interactive mode, at the bottom, sql-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does the string not get highlighted properly in &lt;code&gt;sql-interactive-mode&lt;/code&gt;? (Note - this also happens with no color theme enabled.&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2014-10-04T11:31:57.247" Title="Why do sql-mode and sql-interactive-mode not highlight strings the same way?" Tags="|syntax-highlighting|sql-mode|sql-interactive-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="658" PostTypeId="1" AcceptedAnswerId="659" CreationDate="2014-10-03T13:27:51.053" Score="6" ViewCount="150" Body="&lt;p&gt;In emacs lisp, there's the function &lt;code&gt;posix-search-forward&lt;/code&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/POSIX-Regexps.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/POSIX-Regexps.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a full example showing its difference from &lt;code&gt;search-forward-regexp&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="11941" LastEditDate="2017-02-10T18:06:21.650" LastActivityDate="2017-02-10T18:06:21.650" Title="Difference between posix-search-forward and search-forward-regexp (need example)" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="659" PostTypeId="2" ParentId="658" CreationDate="2014-10-03T13:47:21.520" Score="8" Body="&lt;p&gt;As stated, the posix functions find the longest match in all situations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the text &lt;code&gt;aa&lt;/code&gt; and the regexp &lt;code&gt;&quot;a\\|aa&quot;&lt;/code&gt;, &lt;code&gt;search-forward-regexp&lt;/code&gt; will find &lt;code&gt;a&lt;/code&gt; and stop, while &lt;code&gt;posix-search-forward&lt;/code&gt; will continue to backtrack over all alternatives and will find that &lt;code&gt;aa&lt;/code&gt; is the longest match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also as stated, the posix approach is incompatible with non-greedy operators:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the text &lt;code&gt;aa&lt;/code&gt; and the regexp &lt;code&gt;&quot;a+?&quot;&lt;/code&gt; &lt;code&gt;search-forward-regexp&lt;/code&gt; will find the minimal match &lt;code&gt;a&lt;/code&gt;, but &lt;code&gt;posix-search-forward&lt;/code&gt; will (greedily) find &lt;code&gt;aa&lt;/code&gt;, simply ignoring the non-greedy modifier.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-10-03T14:16:23.997" LastActivityDate="2014-10-03T14:16:23.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="661" PostTypeId="1" AcceptedAnswerId="684" CreationDate="2014-10-03T14:25:48.657" Score="9" ViewCount="1928" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I get &lt;code&gt;yasnippet&lt;/code&gt; to expand a text string correctly (recognizing snippet fields) from inside elisp code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very simple snippet is a just a string of characters with some control characters intermingled.  We can also use elisp forms to create richer snippets, but it's not clear to me how to expand them appropriately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a simple example that captures the problem.  I'm creating an &lt;code&gt;org-mode&lt;/code&gt; snippet to insert a link skeleton, which looks like &lt;code&gt;[[source][description]]&lt;/code&gt;.  The following simple snippet produces the desired behavior of &quot;start in the source field, end up in the description field&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[$1][$0]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can intermingle elisp code in snippets (wrapped in `s).  I would have thought that the following would produce exactly the same behavior as the simpler version, because the &lt;code&gt;if&lt;/code&gt; will simply evaluate to &lt;code&gt;[[$1][$0]]&lt;/code&gt; as a string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(if t &quot;[[$1][$0]]&quot;)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does not do so, however.  Instead, it acts as if the &lt;code&gt;$0&lt;/code&gt; and &lt;code&gt;$1&lt;/code&gt; fields are not fields, ends the snippet, and places point after the final &lt;code&gt;]&lt;/code&gt;.  So: how does one get the desired behavior when an elisp form evaluates to a text string with &lt;code&gt;yasnippet&lt;/code&gt; fields embedded in that string?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; as requested, here's the particular use-case that inspired the question.  If the X clipboard contains a url link, I'd like it to populate the source field in the org link ([[&lt;em&gt;source&lt;/em&gt;][description]]) and leave me in the destination field.  It uses a helper function (&lt;code&gt;dan-xclipboard-link-p&lt;/code&gt;) which returns the url if it exists, or else &lt;code&gt;nil&lt;/code&gt;.  It seems to me that I should be able to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(let ((link (dan-xclipboard-link-p)))&#xA;   (if link&#xA;       (concat &quot;[[&quot; link &quot;][$0]]&quot;)&#xA;     &quot;[[$1][$0]]&quot;))`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In fact, with an earlier version of yasnippet, a version of this code worked as I intended it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2:&lt;/strong&gt; Interestingly enough, this snippet works when there is a link on the X clipboard, but fails when not (ie, it doesn't recognize &lt;code&gt;$1&lt;/code&gt; as a field:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[`(or (dan-xclipboard-link-p) &quot;$1&quot;)`][$0]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-10-04T15:23:14.210" LastActivityDate="2014-10-06T06:19:27.830" Title="yasnippet: how to expand a snippet from a string and have the fields recognized?" Tags="|yasnippet|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="662" PostTypeId="2" ParentId="633" CreationDate="2014-10-03T15:10:50.277" Score="3" Body="&lt;p&gt;My favorite commands for cycling through shell command history are &lt;code&gt;comint-previous-matching-input-from-input&lt;/code&gt; and &lt;code&gt;comint-next-matching-input-from-input&lt;/code&gt;. If the prompt is empty, they will behave exactly like &lt;code&gt;comint-previous-input&lt;/code&gt; and &lt;code&gt;comint-next-input&lt;/code&gt; cycling through all history items. Though if you have entered &lt;code&gt;rake&lt;/code&gt;, for example, they will cycle through your shell command history of commands starting with &lt;code&gt;rake&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default these are bound to &lt;code&gt;C-c M-r&lt;/code&gt; and &lt;code&gt;C-c M-s&lt;/code&gt; respectively, but I find those not ideal. I'm personally binding them to &lt;code&gt;M-TAB&lt;/code&gt; and &lt;code&gt;&amp;lt;M-S-tab&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2014-10-03T15:10:50.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="663" PostTypeId="1" AcceptedAnswerId="666" CreationDate="2014-10-03T15:11:38.473" Score="5" ViewCount="943" Body="&lt;p&gt;When I'm viewing a file and then pop a stash which modifies that file in the working tree using &lt;code&gt;git stash pop&lt;/code&gt; in either bash or eshell, what is the best way to immediately see those changes in the buffer visiting that file? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually I end up using &lt;code&gt;C-x C-f&lt;/code&gt; or &lt;code&gt;M-x revert-buffer&lt;/code&gt; but that's a bit slow. It would be nice to find a mode that automatically updates buffers when the files they visit change on disk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've heard of git-modes for viewing diffs or conflicts, but haven't found much for stashing/popping or cherry-picking. &lt;/p&gt;&#xA;" OwnerUserId="154" LastEditorUserId="306" LastEditDate="2014-10-10T08:37:00.657" LastActivityDate="2020-03-13T04:55:11.463" Title="What is the best way to reload git stashed changes you've popped while file is open in buffer?" Tags="|git|magit|revert-buffer|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="664" PostTypeId="1" AcceptedAnswerId="717" CreationDate="2014-10-03T15:11:45.633" Score="5" ViewCount="2078" Body="&lt;p&gt;I'm currently preparing a presentation which I've outlined in &lt;code&gt;org-mode&lt;/code&gt; and I'm having difficulty in including diagrams in the exported HTML. I'm currently using &lt;a href=&quot;https://github.com/yjwen/org-reveal&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-reveal&lt;/code&gt;&lt;/a&gt; but I'm happy to use another HTML presentation exporter if needed. &lt;code&gt;org-reveal&lt;/code&gt; does offer the option to include HTML directly in the presentation but that seems a little hacky. Surely there is a better way to specify that an image should be in-line in the final exported output?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="504" LastEditDate="2014-10-04T01:15:34.100" LastActivityDate="2018-10-01T21:49:03.783" Title="Supporting images/diagrams in exported org-mode presentations" Tags="|org-mode|org-publish|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="666" PostTypeId="2" ParentId="663" CreationDate="2014-10-03T15:31:42.853" Score="13" Body="&lt;p&gt;If you use &lt;a href=&quot;http://magit.github.io/&quot;&gt;&lt;code&gt;magit&lt;/code&gt;&lt;/a&gt; you can create a stash with the &lt;code&gt;z z&lt;/code&gt; command from the &lt;code&gt;magit-status&lt;/code&gt; buffer. You can also pop a stash using the &lt;code&gt;A&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use these commands, affected files will be automatically reverted (changes are loaded).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out the &lt;a href=&quot;http://magit.github.io/documentation.html&quot;&gt;&lt;code&gt;magit documentation&lt;/code&gt;&lt;/a&gt; for more info on how to use &lt;code&gt;magit&lt;/code&gt; effectively. &lt;/p&gt;&#xA;" OwnerUserId="448" LastActivityDate="2014-10-03T15:31:42.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="667" PostTypeId="5" CreationDate="2014-10-03T16:22:23.207" Score="0" Body="&lt;p&gt;On startup, Emacs normally loads a Lisp program from an initialization file, or &lt;code&gt;init file&lt;/code&gt; for short. It is how Emacs is customized. Emacs looks for the &lt;code&gt;init file&lt;/code&gt; using the filenames &lt;code&gt;~/.emacs&lt;/code&gt;, &lt;code&gt;~/.emacs.el&lt;/code&gt;, or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; (where &lt;code&gt;~/&lt;/code&gt; is the home directory). Use the &lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt; tag for questions pertaining to any of these initialization files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt; for questions about:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;~/.emacs&lt;/code&gt;, &lt;code&gt;~/.emacs.el&lt;/code&gt;, or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;customs, protocols, and canonical practices for Emacs startup files&lt;/li&gt;&#xA;&lt;li&gt;errors in &lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Do not use &lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt; for questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;that you assume may need code snippets in the &lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="337" LastEditorUserId="7045" LastEditDate="2017-02-14T13:19:08.390" LastActivityDate="2017-02-14T13:19:08.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="668" PostTypeId="4" CreationDate="2014-10-03T16:22:23.207" Score="0" Body="for questions about initialization files `.emacs` or `init.el. DO NOT USE this tag if you assume answers require tweaking initialization files because many solutions do not involve directly manipulating initialization files." OwnerUserId="50" LastEditorUserId="7045" LastEditDate="2017-02-14T13:19:20.127" LastActivityDate="2017-02-14T13:19:20.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="669" PostTypeId="1" AcceptedAnswerId="670" CreationDate="2014-10-03T21:54:29.337" Score="24" ViewCount="1678" Body="&lt;p&gt;I would like a way to catch errors when running my init file, and then handle them gracefully. A lot of my most important customizations and keybindings show up at the end of my init file to make sure that other settings don't get applied over the top of them.  The problem is that when initialization aborts early, I feel totally crippled trying to debug the problem without my familiar key bindings and settings being applied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there any way to gracefully finish out the initialization process when an error occurs?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2015-11-02T23:01:31.487" Title="How to gracefully handle errors in init file" Tags="|init-file|error-handling|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="670" PostTypeId="2" ParentId="669" CreationDate="2014-10-03T22:20:01.350" Score="10" Body="&lt;p&gt;Two options, neither of which are perfect, come to mind.  First, you could wrap most of your early initialization code (ie, before it gets to your customizations) in &lt;code&gt;(ignore-errors ...)&lt;/code&gt;. If there &lt;em&gt;are&lt;/em&gt; errors, however, there won't be a lot of feedback -- &lt;code&gt;ignore-errors&lt;/code&gt; will simply return &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more intricate option would be to wrap the potentially buggy code in a combination of &lt;code&gt;unwind-protect&lt;/code&gt; and &lt;code&gt;with-demoted-errors&lt;/code&gt; (with &lt;code&gt;debug-on-error&lt;/code&gt; set to nil).  The latter will error out gracefully-ish at the first error it encounters and report the error message to the &lt;code&gt;*Messages*&lt;/code&gt; buffer for your inspection.  Meanwhile, the rest of the &lt;code&gt;unwind-protect&lt;/code&gt; body (presumably your customizations) will be evaluated.  So, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unwind-protect&#xA;    (let ((debug-on-error nil))&#xA;      (with-demoted-errors&#xA;        (message &quot;The world is about to end&quot;)&#xA;        (sleep-for 2)&#xA;        (/ 10 0)                        ; divide by zero signals an error&#xA;        (message &quot;This will never evaluate&quot;)&#xA;        (sleep-for 2)&#xA;        (setq some-var 5)))&#xA;  (message &quot;Here are the unwind forms that will always evaluate&quot;)&#xA;  (sleep-for 2)&#xA;  (setq some-var 10)&#xA;  (setq another-var &quot;puppies&quot;)&#xA;  (message &quot;All done!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-03T22:20:01.350" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="671" PostTypeId="2" ParentId="669" CreationDate="2014-10-03T23:02:43.367" Score="9" Body="&lt;p&gt;@Dan described well how you can turn errors into messages. You can&#xA;also do whatever you want with errors by using&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/condition-case&quot;&gt;&lt;code&gt;condition-case&lt;/code&gt;&lt;/a&gt;.&#xA;Yet another option is to use&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/unwind-protect&quot;&gt;&lt;code&gt;unwind-protect&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’ll stick to &lt;code&gt;condition-case&lt;/code&gt; here, for no reason whatsoever.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Catching the Error&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This should always guarantee your key definitions get evaluated,&#xA;regardless of what happened inside &lt;code&gt;condition-case&lt;/code&gt;. Any error gets&#xA;stored inside &lt;code&gt;init-error&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar init-error nil &#xA;  &quot;The error which happened.&quot;)&#xA;&#xA;(condition-case the-error&#xA;    (progn&#xA;      ;; Do the dangerous stuff here.&#xA;      (require 'what-I-want))&#xA;  (error&#xA;   ;; This is only evaluated if there's an error.&#xA;   (setq init-error the-error)))&#xA;&#xA;;;; Do the safe stuff here.&#xA;(define-key uncrippling-map &quot;\C-h&quot; 'help!)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Throwing it Back&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Afterwards, just throw the error again. There are several ways you can&#xA;do that, here’s one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Throw the error again here.&#xA;(when init-error&#xA;  (funcall #'signal (car init-error) (cdr init-error)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-03T23:02:43.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="672" PostTypeId="1" CreationDate="2014-10-04T10:59:37.053" Score="5" ViewCount="74" Body="&lt;p&gt;I'm trying to debug &lt;a href=&quot;https://github.com/JuliaLang/julia/issues/8538&quot; rel=&quot;noreferrer&quot;&gt;this julia-mode indentation issue&lt;/a&gt; using edebug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The elisp I'm running is &lt;a href=&quot;https://github.com/JuliaLang/julia/blob/master/contrib/julia-mode.el&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; and the bug only occurs on Emacs 23.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;TAB&lt;/kbd&gt; is bound to &lt;code&gt;julia-latexsub-or-indent&lt;/code&gt;. I can reproduce the issue. However, if I run &lt;code&gt;edebug-defun&lt;/code&gt; on &lt;code&gt;julia-latexsub-or-indent&lt;/code&gt;, the problem disappears!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know Emacs has a lot of internal state, so I presume some of it is modified by edebug (even though it uses a recursive editor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When is &lt;code&gt;edebug&lt;/code&gt; not appropriate for debugging?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2014-10-04T10:59:37.053" Title="In what circumstances will edebug produce different behaviour?" Tags="|edebug|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="673" PostTypeId="2" ParentId="657" CreationDate="2014-10-04T11:10:57.457" Score="5" Body="&lt;p&gt;There's code in &lt;code&gt;sql-interactive-mode&lt;/code&gt; which says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Note that making KEYWORDS-ONLY nil will cause havoc if you try&#xA;;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column&#xA;;; will have just one quote.  Therefore syntactic highlighting is&#xA;;; disabled for interactive buffers.  No imenu support.&#xA;(sql-product-font-lock t nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the &lt;code&gt;t&lt;/code&gt; says &quot;only highlight keywords&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you don't care about &lt;code&gt;SQL*Plus&lt;/code&gt; - as should be the case for any reasonable person in control of his destiny and happiness - you can do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-font-lock-everything-in-sql-interactive-mode ()&#xA;  (unless (eq 'oracle sql-product)&#xA;    (sql-product-font-lock nil nil)))&#xA;(add-hook 'sql-interactive-mode-hook 'my-font-lock-everything-in-sql-interactive-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And indeed that seems to work nicely with PostgreSQL, at least in the simple case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where you might run into problems is if you &lt;code&gt;SELECT&lt;/code&gt; data which contains, say, unmatched quote characters. The font locking will likely be applied to all of that data too, and the quotes might confuse it. So be prepared for quirks!&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2014-10-04T11:31:57.247" LastActivityDate="2014-10-04T11:31:57.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="674" PostTypeId="1" AcceptedAnswerId="675" CreationDate="2014-10-04T12:29:42.240" Score="6" ViewCount="468" Body="&lt;p&gt;&lt;sup&gt;This is  cross-post from &lt;a href=&quot;https://stackoverflow.com/questions/26188421/elisp-widgets-modifying-an-editable-fields-value-real-time-when-changing-anoth&quot;&gt;Stack Overflow&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a simple widget setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gobgen-widget-name&#xA;      (widget-create 'editable-field&#xA;                     :size 25&#xA;                     :format &quot;Name:   %v&quot;&#xA;                     :notify (lambda (widget &amp;amp;rest ignore)&#xA;                               (widget-value-set gobgen-widget-prefix (get-gobject-prefix (widget-value widget))))&#xA;                     &quot;g_example_object&quot;))&#xA;&#xA;(widget-insert &quot; &quot;)&#xA;&#xA;(setq gobgen-widget-prefix&#xA;      (widget-create 'editable-field&#xA;                     :size 10&#xA;                     :format &quot;Prefix: %v\n&quot;&#xA;                     &quot;g&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I’d like to update the second widget real time with the return value of &lt;code&gt;get-gobject-prefix&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, whenever I enter a character in the &lt;code&gt;Name&lt;/code&gt; widget, point automatically jumps to the last character of the &lt;code&gt;Prefix&lt;/code&gt; field, and inserts my character there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do what I’m trying to achieve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I’m using Emacs 24.3.1)&lt;/p&gt;&#xA;" OwnerUserId="507" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-04T16:20:16.193" Title="elisp widgets: Modifying an editable-field's value real time when changing another one" Tags="|elisp|widget|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="675" PostTypeId="2" ParentId="674" CreationDate="2014-10-04T13:08:34.000" Score="3" Body="&lt;p&gt;It turns out that this was easier than I expected: using &lt;code&gt;save-excursion&lt;/code&gt; saved the day (and my point position).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda (widget &amp;amp;rest ignore)&#xA;  (save-excursion&#xA;    (widget-value-set gobgen-widget-prefix (get-gobject-prefix (widget-value widget)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not totally perfect, though, as it changes the width of the &lt;code&gt;Prefix&lt;/code&gt; widget.&lt;/p&gt;&#xA;" OwnerUserId="507" LastActivityDate="2014-10-04T13:08:34.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="676" PostTypeId="2" ParentId="383" CreationDate="2014-10-04T13:19:00.193" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://ergoemacs.org/emacs/emacs_vs_xemacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Xah Lee wrote in 2007&lt;/a&gt; about XEmacs packages he felt were more mature. These days GNU Emacs has package.el so it's hard to find packages that are more polished on XEmacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.xemacs.org/About/XEmacsVsGNUemacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;XEmacs website also has a page that documents differences&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;XEmacs does not support user-defined reader macros, but it does support the additional reader macros &lt;code&gt;#+&lt;/code&gt; and &lt;code&gt;#-&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="10761" LastEditDate="2017-01-17T09:01:48.340" LastActivityDate="2017-01-17T09:01:48.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="677" PostTypeId="1" AcceptedAnswerId="680" CreationDate="2014-10-04T13:24:43.373" Score="8" ViewCount="1255" Body="&lt;p&gt;A few months ago, I converted my init file into an org file, and I’ve&#xA;since been using it as a way to &lt;a href=&quot;http://endlessparentheses.com/init-org-Without-org-mode.html&quot;&gt;organize my blog posts&lt;/a&gt;. &#xA;I won’t go into too much detail here, suffice to say that this is a huge&#xA;&lt;code&gt;org-mode&lt;/code&gt; buffer, where many headlines have a &lt;code&gt;SCHEDULED&lt;/code&gt; date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I list all SCHEDULED headlines in this file, sorted by date?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I care to see is the &lt;strong&gt;date&lt;/strong&gt;, &lt;strong&gt;todo status&lt;/strong&gt;, and &lt;strong&gt;title&lt;/strong&gt;. Anything else is superfluous.&lt;br&gt;&#xA;Other important requirements:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do &lt;strong&gt;not&lt;/strong&gt; ommit headlines marked as &lt;code&gt;DONE&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;List &lt;strong&gt;only&lt;/strong&gt; &lt;code&gt;SCHEDULED&lt;/code&gt; items. I don’t want to see headlines&#xA;that just happen to have a date (&lt;code&gt;&amp;lt;2014-10-04 Sat&amp;gt;&lt;/code&gt;) in them.&lt;/li&gt;&#xA;&lt;li&gt;Only use &lt;em&gt;this&lt;/em&gt; file. Do not search through all my agenda files.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For clarity, take the following file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE Hi guys&#xA;  CLOSED: [2014-10-04 Sat 15:18] SCHEDULED: &amp;lt;2014-10-04 Sat&amp;gt;&#xA;* Hello me&#xA;** Hello everyone &amp;lt;2014-10-05 Sun&amp;gt;&#xA;** TODO The world is at my feet&#xA;   SCHEDULED: &amp;lt;2014-10-11 Sat&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I’d like to run a command which would display a list something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2014-10-04 Sat&amp;gt; DONE Hi guys&#xA;&amp;lt;2014-10-11 Sat&amp;gt; TODO The world is at my feet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, I’m not picky about the format. The important thing is to&#xA;have this information displayed in a convenient way.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My gut tells me this has something to do with &lt;code&gt;org-agenda&lt;/code&gt;, but I’m&#xA;not sure how to get there.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="253" LastEditDate="2015-12-22T00:45:59.457" LastActivityDate="2015-12-22T00:45:59.457" Title="Listing SCHEDULED headlines from an org file ordered by date" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="678" PostTypeId="2" ParentId="474" CreationDate="2014-10-04T15:21:27.303" Score="2" Body="&lt;p&gt;The CEDET version currently shipped with Emacs is difficult to setup, but the one you can get on the &lt;a href=&quot;http://cedet.sourceforge.net&quot; rel=&quot;nofollow&quot;&gt;official site&lt;/a&gt; is easier to setup, and could answer to your #2 and #4 needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CEDET's EDE allows you to manage for example makefile and automake projects, adding targets to it, and associating files to targets. You can then compile your project using EDE commands. As it uses the Emacs' built-in compilation mode, your need #3 is satisfied too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CEDET's Semantic has parsers for several languages, including C++. It can retrieve the tags defined in a file, like exuberant-ctags and GNU Global, but it has also accurate auto-completion and jumping features. If you have two methods called &quot;foo&quot;, Semantic's jump is smart enough to bring you on the right one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For #1, I personally use &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;projectile&lt;/a&gt;, and I succesfully used &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/GDB-Graphical-Interface.html#GDB-Graphical-Interface&quot; rel=&quot;nofollow&quot;&gt;GDB&lt;/a&gt; for #5 some times ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hint for #3: If EDE is overkill to you, Emacs has the command &lt;code&gt;M-x recompile&lt;/code&gt; to launch your last compile command, so you can run your compilation one first time, and then use &lt;code&gt;recompile&lt;/code&gt; in any buffer.&lt;/p&gt;&#xA;" OwnerUserId="510" LastActivityDate="2014-10-04T15:21:27.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="679" PostTypeId="2" ParentId="474" CreationDate="2014-10-04T19:19:21.857" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Management of software &quot;projects.&quot; I want my IDE to have a sense of&#xA;  all of the files that make up my current project so that I can perform&#xA;  functions like search-and-replace within my project. (It would be nice&#xA;  if I could also achieve this without littering my source tree with&#xA;  lots of support files. Why do I need more than one centralized project&#xA;  file per project?)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt; seems the best option for project management in emacs. It is extremely lightweight, you do not need to add any extra file to your project. It will try to automatically detect projects for you based on presence of certain special files. For example - if you are working in a git repo, projectile will treat it as a project (any files tracked by git will be treated as part of project), then you will be able to use commands like &lt;code&gt;projectile-find-file&lt;/code&gt; to open any file the project. It has a bunch of other command which operate on per project basis.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error reporting. I don't want to have to read through 500+ lines of&#xA;  output to find the errors that were reported by the build tools.&#xA;  Preferably, the errors show up in their very own buffer with one line&#xA;  per error.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/flycheck/flycheck&quot; rel=&quot;nofollow&quot;&gt;Flycheck&lt;/a&gt; has support for checking syntax using clang/gcc.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An awareness of symbols within the project, and where they are&#xA;  defined. I want to jump to a symbol definition whether it lives in my&#xA;  project files or in the system include files&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I would recommend you to take a look at &lt;a href=&quot;https://github.com/Andersbakken/rtags&quot; rel=&quot;nofollow&quot;&gt;rtags&lt;/a&gt;. It uses clang as a backend and a pretty good job of jumping to definition and completion. It may also help you with #3 since it also integrates with flymake to display error and warnings using clang. Besides it has some limited support for refactoring. Another option for intelligent auto-completion is &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow&quot;&gt;irony-mode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-10-04T19:19:21.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="680" PostTypeId="2" ParentId="677" CreationDate="2014-10-04T19:35:30.890" Score="8" Body="&lt;p&gt;Here a way to do it using org-agenda. You can write a custom agenda command like the one below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  '((&quot;i&quot; &quot;Only scheduled entries in init.org sorted by time&quot; agenda &quot;&quot;&#xA;     ((org-agenda-files '(&quot;~/.emacs.d/init.org&quot;))&#xA;      (org-agenda-entry-types '(:scheduled))&#xA;      (org-agenda-start-day &quot;2014-01-01&quot;)&#xA;      (org-agenda-span 'year)&#xA;      (org-agenda-include-diary nil)&#xA;      (org-agenda-show-all-dates nil))))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Most of the configuration is happening &lt;code&gt;settings&lt;/code&gt; part of custom command (I am the skipping the explanation of format of &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; for brevity, see &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;org-agenda-custom-commands&lt;kbd&gt;RET&lt;/kbd&gt;). Following is a brief explanation of each of the setting used&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &lt;code&gt;org-agenda-files&lt;/code&gt; is set to the init file so that org mode does not search all the agenda files while building this particular agenda. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &lt;code&gt;org-agenda-entry-types&lt;/code&gt; is set to ':scheduled' to restrict it to just to scheduled items. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3)The &lt;code&gt;org-agenda-start-day&lt;/code&gt; is the day onwards which you want the entries to be listed, I have set it to this years start you might want to set to the day of your first article. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) &lt;code&gt;org-agenda-span&lt;/code&gt; tells the numbers days to be included in the agenda view. &lt;code&gt;org-agenda-include-diary&lt;/code&gt; is set to nil to avoid having diary entries in the agenda view. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Finally empty dates are hidden by setting &lt;code&gt;org-agenda-show-all-dates&lt;/code&gt; to nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when you run the command &lt;code&gt;org-agenda&lt;/code&gt; in the dispatcher menu you will get the an option 'i' which you can select to obtain the desired view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Old answer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the command &lt;code&gt;org-occur&lt;/code&gt; from the docstring&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-occur REGEXP &amp;amp;optional KEEP-PREVIOUS CALLBACK)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Make a compact tree which shows all matches of REGEXP. The tree will&#xA;  show the lines where the regexp matches, and all higher headlines&#xA;  above the match.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is another way to do it. Use occur with a prefix argument. From the docstring of the command.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(occur REGEXP &amp;amp;optional NLINES)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Show all lines in the current buffer containing a match for REGEXP. If&#xA;  a match spreads across multiple lines, all those lines are shown.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Each line is displayed with NLINES lines before and after, or -NLINES&#xA;  before if NLINES is negative.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So doing &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;-1&lt;/kbd&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;occur&lt;kbd&gt;RET&lt;/kbd&gt;SCHEDULED&lt;kbd&gt;RET&lt;/kbd&gt; should give you what you want&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to sort the headlines tough.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2014-10-04T20:47:18.470" LastActivityDate="2014-10-04T20:47:18.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="681" PostTypeId="2" ParentId="585" CreationDate="2014-10-04T21:45:43.247" Score="5" Body="&lt;p&gt;The following function should do what you want. The trick is to split root window of current frame.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-split-main-window (direction size)&#xA;  &quot;Split the main window in the DIRECTION where DIRECTION is a symbol with&#xA;possible values of right, left, above or below and SIZE is the final size of the&#xA;windows, if the window is split horizontally (i.e. in DIRECTION below or above)&#xA;SIZE is assumed to be the target height otherwise SIZE is assumed to be the&#xA;target width&quot;&#xA;  (let* ((new-window (split-window (frame-root-window) nil direction))&#xA;         (horizontal (member direction '(right left))))&#xA;    (save-excursion &#xA;      (select-window new-window)&#xA;      (enlarge-window (- size (if horizontal&#xA;                                  (window-width)&#xA;                                (window-height)))&#xA;                      horizontal))&#xA;    new-window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Call the function with direction in which you to split the window and the size of the new window. The above returns the newly created window. The concept and windows and frames are explained very well in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Windows-and-Frames.html&quot; rel=&quot;noreferrer&quot;&gt;GNU Emacs Lisp Reference Manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-10-04T21:45:43.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="684" PostTypeId="2" ParentId="661" CreationDate="2014-10-05T03:06:59.043" Score="12" Body="&lt;h2&gt;&lt;strong&gt;SHORT SOLUTION&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you do not mind an additional &lt;code&gt;TAB&lt;/code&gt; keystroke, definining your snippet as below should work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; [[${1:`(dan-xclipboard-link-p)`}][$0]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The embedded lisp returns the url from the clipboard if it exists and sets it to be the default text in the field &lt;code&gt;$1&lt;/code&gt;. You can type over the link to change it or just &lt;code&gt;TAB (yas-next-field)&lt;/code&gt; to move point to &lt;code&gt;$0&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;LONGER FULL FEATURED SOLUTION&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I got the idea based on @IqbalAnsari's comment after writing the shorter solution.&#xA;You can use the condition predicate for choosing which snippet to expand. For instance define two snippets with the same trigger&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SNIPPET 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  # -*- mode: snippet; require-final-newline: nil -*-&#xA;  # name: org-link&#xA;  # key: [[&#xA;  # binding: direct-keybinding&#xA;  # type: snippet&#xA;  # condition: (not (dan-xclipboard-link-p))&#xA;  # --&#xA;  [[$1][$0]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SNIPPET 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  # -*- mode: snippet; require-final-newline: nil -*-&#xA;  # name: org-link-with-default-paste&#xA;  # key: [[&#xA;  # binding: direct-keybinding&#xA;  # type: snippet&#xA;  # condition: (dan-xclipboard-link-p)&#xA;  # --&#xA;  [[`(dan-xclipboard-link-p)`][$0]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both the snippets have the same trigger, but have inverted predicates denoted by the &lt;code&gt;condition:&lt;/code&gt;. As such only one of the snippets will be expanded depending upon the value returned by &lt;code&gt;(dan-xclipboard-link-p)&lt;/code&gt;. This way you can position the point at &lt;code&gt;$0&lt;/code&gt; directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the general question, no it is not possible for yasnippet to recognize fields within elisp as it parses embedded elisp blocks separately without any concern for normal template syntax. I am not sure how the previous versions worked though.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-10-06T06:19:27.830" LastActivityDate="2014-10-06T06:19:27.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="685" PostTypeId="5" CreationDate="2014-10-05T13:46:04.470" Score="0" Body="&lt;p&gt;HTML (&lt;a href=&quot;http://en.wikipedia.org/wiki/HTML&quot; rel=&quot;nofollow&quot;&gt;HyperText Markup Language&lt;/a&gt;) is the main markup language (similar to &lt;a href=&quot;/questions/tagged/xml&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;xml&amp;#39;&quot; rel=&quot;tag&quot;&gt;xml&lt;/a&gt;) for creating web pages and other information to be displayed in a web browser. It was invented by Tim Berners-Lee while at CERN to enable researchers to share their findings. The latest version for HTML is &lt;a href=&quot;http://www.w3.org/TR/html5&quot; rel=&quot;nofollow&quot;&gt;HTML5&lt;/a&gt;, which supports many new features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts written in languages such as JavaScript which affect the behavior of HTML web pages. All the webpages that are written in different programming languages (PHP, JSP, VF etc.) get rendered as HTML on the browser.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Syntax&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;HTML is written in the form of HTML elements consisting of tags (and their attributes) enclosed in angle brackets (like &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;), within the web page content. Angle brackets are also referred to as left &amp;amp; right guillemets or chevrons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTML tags most commonly come in pairs like &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/h1&amp;gt;&lt;/code&gt;, although some tags, known as empty elements, are unpaired, for example &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt;, these are usually closed by putting a &lt;code&gt;/&lt;/code&gt; at the end (Ex. &lt;code&gt;&amp;lt;img src='image.jpg'/&amp;gt;&lt;/code&gt;). The first tag in a pair is the start tag, the second tag is the end tag (they are also called opening tags and closing tags). In between these tags authors can add text, tags, comments and other types of text-based content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose of a web browser is to read HTML documents and compose them into visible or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Standards&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;HTML standards, as well as those for many other web technologies, are maintained by the &lt;a href=&quot;http://www.w3.org/&quot; rel=&quot;nofollow&quot;&gt;World Wide Web Consortium&lt;/a&gt; (&lt;a href=&quot;/questions/tagged/w3c&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;w3c&amp;#39;&quot; rel=&quot;tag&quot;&gt;w3c&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;/questions/tagged/html4&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;html4&amp;#39;&quot; rel=&quot;tag&quot;&gt;html4&lt;/a&gt; was introduced in 1997, and the latest iteration, &lt;a href=&quot;/questions/tagged/html5&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;html5&amp;#39;&quot; rel=&quot;tag&quot;&gt;html5&lt;/a&gt; was recently developed by the W3C. What W3C calls &lt;em&gt;HTML5&lt;/em&gt; is a subset of the HTML-Living-Standard which is specified by the &lt;a href=&quot;http://www.whatwg.org/&quot; rel=&quot;nofollow&quot;&gt;Web Hypertext Application Technology Working Group&lt;/a&gt; (WHATWG).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The language specification and standards documents for HTML5 are available online &lt;a href=&quot;http://www.w3.org/TR/html5/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;FAQ&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/HTML5_element_list&quot; rel=&quot;nofollow&quot;&gt;HTML5 Elements List&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/tagged/html5&quot;&gt;HTML5-tagged on StackOverflow&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;References&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.w3.org/wiki/HTML/Specifications&quot; rel=&quot;nofollow&quot;&gt;W3C HTML/Specifications&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://validator.w3.org/&quot; rel=&quot;nofollow&quot;&gt;W3C HTML Validator&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en/HTML/&quot; rel=&quot;nofollow&quot;&gt;HTML Reference at the Mozilla Developer Network (MDN)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.webplatform.org/&quot; rel=&quot;nofollow&quot;&gt;WebPlatform&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ie/aa740473.aspx&quot; rel=&quot;nofollow&quot;&gt;Web development features - IE Dev Center&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://reference.sitepoint.com/html&quot; rel=&quot;nofollow&quot;&gt;SitePoint HTML Reference&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.w3.org/community/webed/wiki/Main_Page&quot; rel=&quot;nofollow&quot;&gt;Web Education Community Group Wiki&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.w3.org/TR/WCAG20/&quot; rel=&quot;nofollow&quot;&gt;W3C Web Content Accessibility Guidelines&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.w3.org/Bugs/Public/buglist.cgi?product=HTML.next&quot; rel=&quot;nofollow&quot;&gt;HTML Feature Requests&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Free HTML Books&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://diveintohtml5.info/&quot; rel=&quot;nofollow&quot;&gt;Dive Into HTML5&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.htmldog.com/&quot; rel=&quot;nofollow&quot;&gt;HTML Dog Tutorials&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-06T13:00:38.453" LastActivityDate="2014-10-06T13:00:38.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="686" PostTypeId="4" CreationDate="2014-10-05T13:46:04.470" Score="0" Body="HTML (HyperText Markup Language) is the principal markup language used for structuring web pages and formatting content. The most recent revision to the HTML specification is HTML5." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-06T12:59:39.297" LastActivityDate="2014-10-06T12:59:39.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="687" PostTypeId="1" AcceptedAnswerId="695" CreationDate="2014-10-05T13:59:33.353" Score="4" ViewCount="992" Body="&lt;p&gt;I have been using Emacs more and more, to the point that I would like to start using StumpWM as my default window manager with it, so that I can integrate the missing bits of my workflow that realistically cannot (still) be done from inside Emacs alone. As the &lt;code&gt;EmacsWiki&lt;/code&gt; puts it, &quot;Stumpwm is the Emacs of window managers.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been trying Emacs from StumpWM, but I am going against a little 'context mismatch`, especially from controlling Emacs buffers in StumpWM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to match individual Emacs buffers as individual StumpWM frames. I thought perhaps one way would be to use Emacs' one-buffer-per-frame technique, but I am not sure it is a good way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of Emacs settings/libraries could be tweaked to better control Emacs buffers from StumpWM, so that each Emacs buffer corresponds to a StumpWM frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not experience this issue with other applications that I run from StumpWM, That is why I believe it is Emacs related, and I am asking it here on emacs.stackexchange.com&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any pointer.&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="249" LastEditDate="2014-10-05T17:45:48.033" LastActivityDate="2014-10-05T18:44:16.783" Title="How to better control Emacs buffers in StumpWM?" Tags="|buffers|frames|integration|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="688" PostTypeId="1" AcceptedAnswerId="690" CreationDate="2014-10-05T14:05:26.783" Score="6" ViewCount="1004" Body="&lt;p&gt;I recently created the alias in eshell: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias hello 'echo &quot;Hello World&quot;'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So now whenever I type &lt;code&gt;hello&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gvnE1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am very used to creating temporary alias in the Terminal for more subtle use. And then putting my more permanent alias in the .bashrc file. So how do I remove the alias for hello? Do I have to set another alias for hello that does nothing? Is there an file that I have to edit to change this? &lt;/p&gt;&#xA;" OwnerUserId="45" LastActivityDate="2014-10-05T14:51:59.083" Title="How to remove alias from the eshell?" Tags="|eshell|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="689" PostTypeId="2" ParentId="688" CreationDate="2014-10-05T14:09:54.667" Score="0" Body="&lt;p&gt;Okay, I went into my &lt;strong&gt;home&lt;/strong&gt; folder and found the &lt;strong&gt;.eshell&lt;/strong&gt; file. Inside I found a file named &lt;strong&gt;alias&lt;/strong&gt; and opened it. That is where I found the place to edit and delete alias. &lt;/p&gt;&#xA;" OwnerUserId="45" LastActivityDate="2014-10-05T14:09:54.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="690" PostTypeId="2" ParentId="688" CreationDate="2014-10-05T14:51:59.083" Score="13" Body="&lt;p&gt;The &lt;code&gt;alias&lt;/code&gt; command of &lt;code&gt;eshell&lt;/code&gt; can also be used to remove aliases: just leave out the definition part.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ alias hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-05T14:51:59.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="691" PostTypeId="1" AcceptedAnswerId="693" CreationDate="2014-10-05T16:29:27.730" Score="9" ViewCount="6504" Body="&lt;p&gt;In one of my projects I need to run &lt;code&gt;make package install&lt;/code&gt; when building instead of &lt;code&gt;make&lt;/code&gt;. It remembers the last compile command I used, but resets to &lt;code&gt;make -k&lt;/code&gt; every time emacs starts up. How can I customize &lt;code&gt;M-x compile&lt;/code&gt; to default to &lt;code&gt;make package install&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="58" LastEditorUserId="58" LastEditDate="2014-10-05T16:45:51.820" LastActivityDate="2020-08-23T11:23:45.327" Title="How can I customize the compile command?" Tags="|compilation|commands|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="692" PostTypeId="1" AcceptedAnswerId="698" CreationDate="2014-10-05T16:29:50.653" Score="13" ViewCount="2663" Body="&lt;p&gt;First of all, a disclaimer. I have researched this many times, and I&#xA;am pretty sure that I have already found the answer one way or&#xA;another, but I just don't understand it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have a process running through comint&lt;/li&gt;&#xA;&lt;li&gt;I want to send a line of input, capture output and see when it is&#xA;over (when the last line of the output matches the regexp for a&#xA;prompt)&lt;/li&gt;&#xA;&lt;li&gt;only when the process has finished sending output, I want to send&#xA;another line of input (for example).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a bit of background, think of a major mode implementing&#xA;interaction with a program, which may return an arbitrary amount of&#xA;output, in arbitrarily long time. This should not be an unusual&#xA;situation, right? Okay, maybe the part where I need to wait &lt;em&gt;between&lt;/em&gt;&#xA;inputs is unusual, but it has a few advantages over sending the input&#xA;as a whole:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the output buffer is nicely formatted: input output input&#xA;output...&lt;/li&gt;&#xA;&lt;li&gt;more importantly, when sending a lot of text to a process, the text&#xA;is cut into pieces and the pieces are pasted back by the process;&#xA;the cutting points are arbitrary and this sometimes makes invalid&#xA;input (my process won't paste back correctly an input cut in&#xA;the middle of an identifier, for example)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Anyway, unusual or not, it turns out that it &lt;em&gt;is&lt;/em&gt; complicated. Right now,&#xA;I am using something along the lines of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mymode--wait-for-output ()&#xA;  (let ((buffer (mymode-get-buffer)))&#xA;    (with-current-buffer buffer&#xA;      (goto-char (point-max))&#xA;      (forward-line 0)&#xA;      (while (not (mymode-looking-at-prompt))&#xA;        (accept-process-output nil 0.001)&#xA;        (redisplay)&#xA;        (goto-char (point-max))&#xA;        (forward-line 0))&#xA;      (end-of-line))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I call this every time after sending an input line, and before&#xA;sending the next one. Well... it works, that's already something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it also makes emacs hang&#xA;while waiting for the output. The reason is obvious, and I figured&#xA;that if I included some kind of asynchronous &lt;code&gt;sleep-for&lt;/code&gt; (for&#xA;example 1s) in the loop it would delay the output by 1s, but suppress&#xA;the hanging. Except that it seems that this kind of asynchronous&#xA;&lt;code&gt;sleep-for&lt;/code&gt; &lt;em&gt;doesn't exist&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or does it? More generally, is there an idiomatic way of achieving&#xA;this with emacs? In other words:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to send input to a process, wait for the output, then send more input, asynchronously?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When searching around (see the related questions), I have mainly seen&#xA;mentions of sentinels (but I don't think it applies in my case, since&#xA;the process doesn't finish) and of some comint hooks (but then what?&#xA;should I make the hook buffer-local, turn my &quot;evaluate the remaining&#xA;lines&quot; into a function, add this function to the hook and clean the&#xA;hook afterwards? that sounds really dirty, doesn't it?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sorry if am not making myself clear, or if there is really an&#xA;obvious answer available somewhere, I am really confused by all the&#xA;intricaties of process interaction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If needed, I can make this all a working example, but I am afraid that&#xA;it would just make one more &quot;specific process question with specific&#xA;process answer&quot; like all those I found earlier and didn't help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some related questions on SO:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/q/16815598/1083706&quot;&gt;https://stackoverflow.com/q/16815598/1083706&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/q/3572532/1083706&quot;&gt;https://stackoverflow.com/q/3572532/1083706&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/q/6578373/1083706&quot;&gt;https://stackoverflow.com/q/6578373/1083706&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="184" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-02-21T18:02:24.123" Title="Asynchronously wait for output from a comint process" Tags="|subprocess|comint|async|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="693" PostTypeId="2" ParentId="691" CreationDate="2014-10-05T16:50:23.357" Score="7" Body="&lt;p&gt;You can customize the variable &lt;code&gt;compile-command&lt;/code&gt; to change the compilation command that is used by default:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq compile-command &quot;make package install&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-04T18:46:06.390" LastActivityDate="2015-02-04T18:46:06.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="694" PostTypeId="1" AcceptedAnswerId="935" CreationDate="2014-10-05T17:00:36.007" Score="3" ViewCount="409" Body="&lt;p&gt;Currently, &lt;a href=&quot;http://www.emacswiki.org/emacs/WhiteSpace&quot; rel=&quot;nofollow&quot;&gt;whitespace.el&lt;/a&gt; shows me newline characters by changing the display table to show a &lt;code&gt;$&lt;/code&gt; at the end of lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't actually find this useful, so I disable it while I enjoy the many other benefits of &lt;code&gt;whitespace-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm composing emails in &lt;code&gt;message-mode&lt;/code&gt; I want to show the newline characters that have the &lt;code&gt;'hard&lt;/code&gt; text property, because it affects how the flowed text shows up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I hack this distinction into the display table logic of &lt;code&gt;whitespace-mode&lt;/code&gt;?  My backup plan relies on &lt;code&gt;longlines-show-hard-newlines&lt;/code&gt; but I'd prefer to extend  whitespace.el if possible.&lt;/p&gt;&#xA;" OwnerUserId="372" LastEditorUserId="372" LastEditDate="2014-10-05T18:10:40.320" LastActivityDate="2014-10-09T10:29:37.163" Title="Can I modify whitespace mode to distinguish hard and soft newlines?" Tags="|whitespace-mode|buffer-display-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="695" PostTypeId="2" ParentId="687" CreationDate="2014-10-05T18:44:16.783" Score="2" Body="&lt;p&gt;It sounds like you are having difficulty with a new display manager.  This new display manager does not match your Emacs workflow.  We can try the following and see if it helps.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;pick up a frame-oriented workflow&lt;/li&gt;&#xA;&lt;li&gt;adjust the frame titles in appropriate ways, maybe with &lt;code&gt;(setq frame-title-format &quot;%b&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;configure the appropriate &quot;frame preferences&quot; in your display manager&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-10-05T18:44:16.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="696" PostTypeId="1" AcceptedAnswerId="697" CreationDate="2014-10-05T20:35:04.113" Score="22" ViewCount="7440" Body="&lt;p&gt;So &lt;code&gt;buffer-string&lt;/code&gt; gets the content of the current buffer. But it doesn't allow specifying other buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get around that? Do I need something like &lt;code&gt;save-window-excursion&lt;/code&gt; to make it work?&lt;/p&gt;&#xA;" OwnerUserId="43" LastEditorUserId="104" LastEditDate="2014-10-06T08:58:32.367" LastActivityDate="2019-08-31T21:22:26.143" Title="Get content of a buffer" Tags="|elisp|buffers|excursion|string|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="697" PostTypeId="2" ParentId="696" CreationDate="2014-10-05T20:44:43.387" Score="30" Body="&lt;p&gt;A lot of things in Emacs operate on the current buffer. You need to change the current buffer and restore it when you're done. Use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Current-Buffer.html#index-with_002dcurrent_002dbuffer-2122&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;with-current-buffer&lt;/code&gt;&lt;/a&gt; for simple cases where you just need to do something in another buffer, and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Current-Buffer.html#index-save_002dcurrent_002dbuffer-2123&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;save-current-buffer&lt;/code&gt;&lt;/a&gt; for more complex cases where you need to navigate between several buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun buffer-string* (buffer)&#xA;  (with-current-buffer buffer&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want the text content of the buffer without properties, call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Contents.html#index-buffer_002dsubstring_002dno_002dproperties-2825&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;buffer-substring-no-properties&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;buffer-string&lt;/code&gt; returns only the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Narrowing.html#Narrowing&quot; rel=&quot;noreferrer&quot;&gt;narrowed&lt;/a&gt; part of the buffer. If you need the whole content, widen it after saving the narrowing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun buffer-whole-string (buffer)&#xA;  (with-current-buffer buffer&#xA;    (save-restriction&#xA;      (widen)&#xA;      (buffer-substring-no-properties (point-min) (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you also need to save the point, call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Excursions.html#index-save_002dexcursion-2759&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;save-excursion&lt;/code&gt;&lt;/a&gt; as well. Note that &lt;code&gt;save-excursion&lt;/code&gt; restores the point only in the current buffer, so if you need to switch to another buffer and move around there, call &lt;code&gt;save-excursion&lt;/code&gt; inside &lt;code&gt;save-current-buffer&lt;/code&gt; or &lt;code&gt;with-current-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="13589" LastEditDate="2019-08-31T21:22:26.143" LastActivityDate="2019-08-31T21:22:26.143" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="698" PostTypeId="2" ParentId="692" CreationDate="2014-10-05T20:54:29.090" Score="20" Body="&lt;p&gt;First of all, you shouldn't be using &lt;code&gt;accept-process-output&lt;/code&gt; if you want asynchronous processing. Emacs will accept output every time when it is waiting for user input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proper way to go is to use filter functions to intercept the output. You don't need to create or delete the filter(s) depending on whether you still have lines to send. Rather, you will usually declare a single filter for the lifetime of the process and use buffer-local variables to track the state and do different things as needed.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The low-level interface&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Filter-Functions.html#Filter-Functions&quot; rel=&quot;noreferrer&quot;&gt;Filter functions&lt;/a&gt; are what you're looking for. Filter functions are to output what sentinels are to termination.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mymode--output-filter (process string)&#xA;  (let ((buffer (process-buffer process)))&#xA;    (when (buffer-live-p buffer)&#xA;      (with-current-buffer buffer&#xA;        (goto-char (point-max))&#xA;        (forward-line 0)&#xA;        (when (mymode-looking-at-prompt)&#xA;          (do-something)&#xA;          (goto-char (point-max)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Look at the manual or at many examples that come with Emacs (&lt;code&gt;grep&lt;/code&gt; for &lt;code&gt;process-filter&lt;/code&gt; in the &lt;code&gt;.el&lt;/code&gt; files).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Register your filter function with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-process-filter 'mymode--output-filter)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;The comint interface&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Comint defines a filter function which does a few things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Switch to the buffer that should contain the process output.&lt;/li&gt;&#xA;&lt;li&gt;Run the functions in the list &lt;code&gt;comint-preoutput-filter-functions&lt;/code&gt;, passing them the new text as an argument.&lt;/li&gt;&#xA;&lt;li&gt;Perform some ad hoc duplicate prompt elimination, based on &lt;code&gt;comint-prompt-regexp&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Insert the process output at the end of the buffer&lt;/li&gt;&#xA;&lt;li&gt;Run the functions in the list &lt;code&gt;comint-output-filter-functions&lt;/code&gt;, passing them the new text as an argument.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Given that your mode is based on comint, you should register your filter in &lt;code&gt;comint-output-filter-functions&lt;/code&gt;. You should set &lt;code&gt;comint-prompt-regexp&lt;/code&gt; to match your prompt. I don't think Comint has a built-in facility to detect a complete output chunk (i.e. between two prompts), but it can help. The marker &lt;code&gt;comint-last-input-end&lt;/code&gt; is set at the end of the last input chunk. You have a new output chunk when the end of the last prompt is after &lt;code&gt;comint-last-input-end&lt;/code&gt;. How to find the end of the last prompt depends on the version of Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Up to 24.3, the overlay &lt;code&gt;comint-last-prompt-overlay&lt;/code&gt; spans the last prompt.&lt;/li&gt;&#xA;&lt;li&gt;Since 24.4, the variable &lt;code&gt;comint-last-prompt&lt;/code&gt; contains markers to the start and end of the last prompt. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mymode--comint-output-filter (string)&#xA;  (let ((start (marker-position comint-last-input-end))&#xA;        (end (if (boundp 'comint-last-prompt-overlay)&#xA;                 (and comint-last-prompt-overlay (overlay-start comint-last-prompt-overlay))&#xA;               (and comint-last-prompt (cdr comint-last-prompt))))&#xA;  (when (and start end (&amp;lt; start end))&#xA;    (let ((new-output-chunk (buffer-substring-no-properties start end)))&#xA;      ...)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may want to add protections in case the process emits output in a sequence other than {receive input, emit output, display prompt}.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2017-02-21T18:02:24.123" LastActivityDate="2017-02-21T18:02:24.123" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="699" PostTypeId="1" AcceptedAnswerId="700" CreationDate="2014-10-05T20:55:42.807" Score="2" ViewCount="6470" Body="&lt;p&gt;It is well known that when you type &lt;code&gt;M-x doctor&lt;/code&gt;, a kind of AI program prompt you to write about your problems, as a psychotherapist does. Some said it's an easter egg, but &lt;a href=&quot;https://en.wikipedia.org/wiki/ELIZA&quot; rel=&quot;nofollow&quot;&gt;it seems it goes beyond the fun&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual says (33.2.8 in a 2007 paper edition): &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If using Emacs (or something else) becomes terribly frustrating and none of the techniques described above solve the problem, Emacs can still help you. First, if the Emacs you are using is not responding to commands, type C-g C-g to get out of it and then start a new one. Second, type M-x doctor RET. The Emacs psychotherapist will help you feel better.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Do you have real examples of people using the help of the psychotherapist? Is there use cases where it can really be used as a tool to solve problems? Do you have some stories about it here? &lt;/p&gt;&#xA;" OwnerUserId="119" LastEditorUserId="8406" LastEditDate="2015-06-16T14:50:40.800" LastActivityDate="2015-06-16T14:50:40.800" Title="What are possible real use cases of the Emacs &quot;psychotherapist&quot; mode?" Tags="|help|doctor|" AnswerCount="2" CommentCount="3" ClosedDate="2014-10-06T05:27:11.203" ContentLicense="CC BY-SA 3.0" />
  <row Id="700" PostTypeId="2" ParentId="699" CreationDate="2014-10-05T21:00:30.893" Score="7" Body="&lt;p&gt;Eliza stems from 1960s research in AI. It goes beyond the fun as far as AI research is concerned; it's wildly out of date, but still a common, reasonably fun programming exercise. As far as psychotherapy is concerned, it is about fun. It &lt;em&gt;can&lt;/em&gt; alleviate frustration, but it isn't supposed to bring serious psychological help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;doctor.el&lt;/code&gt; &lt;em&gt;is&lt;/em&gt; in the &lt;code&gt;lisp/play/&lt;/code&gt; subdirectory.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-05T21:00:30.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="701" PostTypeId="2" ParentId="699" CreationDate="2014-10-05T21:03:24.150" Score="4" Body="&lt;p&gt;When life, the universe and everything is all getting too much, Emacs has &#xA;&lt;code&gt;doctor.el&lt;/code&gt; to help. To consult the doctor type&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x doctor&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doctor is a psychoanalyst who will help you with your problems. It would spoil the fun and hurt your recovery to say too much here about how the doctor works. But when you’re ready to find out see &lt;a href=&quot;http://en.wikipedia.org/wiki/ELIZA&quot; rel=&quot;nofollow&quot;&gt;WikiPedia:ELIZA.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastActivityDate="2014-10-05T21:03:24.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="704" PostTypeId="1" AcceptedAnswerId="705" CreationDate="2014-10-06T00:28:00.197" Score="13" ViewCount="2690" Body="&lt;p&gt;I have some customizations for emacs that I'd like to use for a single project, but not affect emacs globally. Is there any way I can have emacs load a specific init file when launched from a certain directory or automatically load all init files in the directory its launched from?&lt;/p&gt;&#xA;" OwnerUserId="58" LastEditorUserId="58" LastEditDate="2014-10-07T13:42:21.303" LastActivityDate="2024-01-30T09:44:33.607" Title="project specific init file" Tags="|init-file|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="705" PostTypeId="2" ParentId="704" CreationDate="2014-10-06T01:08:47.473" Score="19" Body="&lt;p&gt;You might want to take a look at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot;&gt;Directory variables&lt;/a&gt;. Basically you will need to create a &lt;code&gt;.dir-locals.el&lt;/code&gt; file in your project root with all the project specific setting in it. Now whenever you open a file in the directory or any of its subdirectories emacs will apply the settings in the &lt;code&gt;.dir-locals.el&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example suppose you want to use the &lt;code&gt;make package install&lt;/code&gt; as compile command only in project A, you will need to create a file named .dir-locals.el in root directory of the project and add something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((compile-command . &quot;make package install&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Henceforth whenever you run &lt;code&gt;compile&lt;/code&gt; command from any file under the directory A, the default &lt;code&gt;compile-command&lt;/code&gt; will be the one specified above, however the &lt;code&gt;compile command&lt;/code&gt; for files outside the directory A will stay untouched.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2014-10-06T01:28:03.820" LastActivityDate="2014-10-06T01:28:03.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="706" PostTypeId="2" ParentId="691" CreationDate="2014-10-06T01:24:29.357" Score="3" Body="&lt;p&gt;If you want to customize the variable per project rather than globally. You can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Directory Variables&lt;/a&gt;. These allow you to apply certain customizations only for files in certain directory and its subdirectories. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example you want to use the &lt;code&gt;make package install&lt;/code&gt; as compile command &lt;strong&gt;only&lt;/strong&gt; in project A, you will need to create a file named &lt;code&gt;.dir-locals.el&lt;/code&gt; in root directory of the project and add something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((compile-command . &quot;make package install&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The syntax is explained in detail in the link to emacs manual above. As pointed out by @hatschipuh, you can use the commands &lt;code&gt;add-dir-local-variable&lt;/code&gt; and &lt;code&gt;delete-dir-local-variable&lt;/code&gt; to easily add and delete dir local values. &lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-06T16:18:55.443" LastActivityDate="2015-09-06T16:18:55.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="707" PostTypeId="1" CreationDate="2014-10-06T03:14:44.627" Score="1" ViewCount="723" Body="&lt;p&gt;I have a global prefix command key define like following:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(unless (boundp 'help-document-map)&#xA;  (define-prefix-command 'help-document-map))&#xA;;; (define-key my-programming-prefix-k (kbd &amp;quot;h&amp;quot;) 'help-document-map)&#xA;(global-set-key (kbd &amp;quot;C-h d&amp;quot;) 'help-document-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And then I want to use it in following mode-map defining keys.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &amp;quot;helm-cscope&amp;quot;&#xA;  '(progn&#xA;     (define-key helm-cscope-mode-map (kbd &amp;quot;M-t&amp;quot;) 'helm-cscope-find-symbol)&#xA;     (define-key helm-cscope-mode-map (kbd &amp;quot;M-r&amp;quot;) 'helm-cscope-find-global-definition)&#xA;     (define-key helm-cscope-mode-map (kbd &amp;quot;M-g M-c&amp;quot;) 'helm-cscope-find-called-function)&#xA;     (define-key helm-cscope-mode-map (kbd &amp;quot;M-g M-p&amp;quot;) 'helm-cscope-find-calling-this-funtcion)&#xA;     (define-key helm-cscope-mode-map (kbd &amp;quot;M-s&amp;quot;) 'helm-cscope-select)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So how do I define this key binding?&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="105" LastEditDate="2021-12-20T00:29:59.650" LastActivityDate="2021-12-20T00:29:59.650" Title="How to use global prefix command key in define mode-map key binding?" Tags="|key-bindings|keymap|prefix-keys|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="708" PostTypeId="2" ParentId="707" CreationDate="2014-10-06T04:46:01.383" Score="1" Body="&lt;p&gt;It sounds like what you want is for &lt;kbd&gt;C-h d&lt;/kbd&gt; to act as a prefix to a map dependent on the current mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a couple of solutions to this. One solution I have seen used in a couple of modes is to prefix each of the &lt;code&gt;kbd&lt;/code&gt; calls with say &lt;code&gt;help-document-prefix&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar helm-document-prefix &quot;C-h d&quot;)&#xA;(eval-after-load &quot;helm-cscope&quot;&#xA;  '(progn&#xA;     (define-key helm-cscope-mode-map &#xA;                 (kbd (concat help-document-prefix &quot; M-t&quot;)) &#xA;                 'helm-cscope-find-symbol)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This approach will enable &lt;kbd&gt;C-h d M-t&lt;/kbd&gt; when &lt;code&gt;helm-cscope-mode-map&lt;/code&gt; is active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach would be to set these bindings using &lt;code&gt;local-set-key&lt;/code&gt; but inside of the mode hook. That would do a better job of respecting the &lt;code&gt;help-document-prefix&lt;/code&gt; variable changing, as the binding would update every time the mode was enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if there is a way to use a prefix map to dispatch to a function, which in turn dispatches to a keymap. It is possible to inherit from another keymap, but I don't know as that would help here.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-06T04:46:01.383" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="709" PostTypeId="1" CreationDate="2014-10-06T09:18:51.680" Score="9" ViewCount="562" Body="&lt;p&gt;I have an issue where if I try to perform some random Emacs operations such as &lt;code&gt;org-capture&lt;/code&gt;, or renaming a file to a different (local) directory in &lt;code&gt;dired&lt;/code&gt;, Emacs attempts to contact a different machine using tramp, presumably for some sort of auto-completion or history reasoning. This causes a lot of hanging and waiting, because the machine tramp is trying to connect to is not available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent Emacs from looking up tramp files/locations when I perform other rudimentary operations? How can I determine where and how Emacs is getting the idea that it needs to look inside a remote file/location for operations like &lt;code&gt;org-capture&lt;/code&gt; and &lt;code&gt;dired-do-rename&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="105" LastEditDate="2014-10-10T17:18:35.833" LastActivityDate="2015-05-26T15:15:06.043" Title="How to prevent tramp locations from interfering in history?" Tags="|dired|tramp|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="710" PostTypeId="2" ParentId="664" CreationDate="2014-10-06T09:57:08.703" Score="1" Body="&lt;p&gt;The details are in the &lt;a href=&quot;https://orgmode.org/manual/Images-in-HTML-export.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-mode manual&lt;/a&gt; but I missed it. Basically you need to ensure you don't add a title. So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :alt Architectural overview :style border:none;&#xA;[[file:diagrams/RISU_Architecture_Overview.svg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastEditorUserId="9996" LastEditDate="2018-10-01T21:49:03.783" LastActivityDate="2018-10-01T21:49:03.783" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="711" PostTypeId="1" CreationDate="2014-10-06T10:05:16.020" Score="6" ViewCount="477" Body="&lt;p&gt;In &lt;code&gt;LaTeX&lt;/code&gt; it is customary to put the content of different chapters into different files which are then pulled into a &lt;em&gt;master&lt;/em&gt; file using &lt;code&gt;\include{FILENAME}&lt;/code&gt; statements. One can then use the &lt;code&gt;\includeonly{SPEC}&lt;/code&gt; command to compile only those chapters which are specified by &lt;code&gt;SPEC&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The TeX.SO question &lt;a href=&quot;https://tex.stackexchange.com/questions/8400/typeset-single-chapter-from-book&quot;&gt;&lt;code&gt;Typeset single chapter from book&lt;/code&gt;&lt;/a&gt; shows how to do this. Here comes my question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is it possible to tell &lt;code&gt;AUCTeX&lt;/code&gt; to parse through the master file and compile each of the &lt;code&gt;\include&lt;/code&gt;'d files to its own pdf file?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Say I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-tex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{book}&#xA;&#xA;\begin{document}&#xA;\include{Chap1}&#xA;\include{Chap2}&#xA;\include{Chap3}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in a file called &lt;code&gt;Master.tex&lt;/code&gt;. The function I'm looking for would then compile &lt;code&gt;Chap1&lt;/code&gt; to &lt;code&gt;Master_Chap1.pdf&lt;/code&gt;, &lt;code&gt;Chap2&lt;/code&gt; to &lt;code&gt;Master_Chap2.pdf&lt;/code&gt; and so on [By using &lt;code&gt;\includeonly&lt;/code&gt; I'd assume].&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2014-10-14T14:44:18.707" Title="Make AUCTeX compile each \include to a separate file" Tags="|latex|auctex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="712" PostTypeId="1" AcceptedAnswerId="758" CreationDate="2014-10-06T10:42:43.557" Score="59" ViewCount="19265" Body="&lt;p&gt;There seem to be two major autocompletion extensions for emacs: autocomplete and company mode. What are some of the practical differences between the two and when would I want to use one over the other? Also, are they compatible with each other?&lt;/p&gt;&#xA;" OwnerUserId="58" LastEditorUserId="50" LastEditDate="2014-11-16T13:20:12.040" LastActivityDate="2014-11-16T13:20:12.040" Title="What are the differences between autocomplete and company mode?" Tags="|completion|company-mode|auto-complete-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="713" PostTypeId="1" AcceptedAnswerId="725" CreationDate="2014-10-06T11:40:39.883" Score="9" ViewCount="6263" Body="&lt;p&gt;How can I find all files from a folder and its subfolders recursively, containing a regexp in the filename, using helm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: how to search for all files with the extension &lt;code&gt;.el&lt;/code&gt; and containing the string &lt;code&gt;dired&lt;/code&gt; in the directory &lt;code&gt;emacs-24.3&lt;/code&gt; its subdirectories, using helm?&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="25" LastEditDate="2014-10-06T22:24:12.030" LastActivityDate="2014-10-07T06:58:50.637" Title="Recursively find all files from a folder containing a regexp in the filename, using helm" Tags="|helm|search|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="714" PostTypeId="2" ParentId="704" CreationDate="2014-10-06T12:20:04.177" Score="4" Body="&lt;p&gt;A less-featured alternative to &lt;code&gt;.dir-locals.el&lt;/code&gt; is the &lt;a href=&quot;http://editorconfig.org/&quot; rel=&quot;nofollow&quot;&gt;EditorConfig&lt;/a&gt; standard, which has an &lt;a href=&quot;https://github.com/editorconfig/editorconfig-emacs&quot; rel=&quot;nofollow&quot;&gt;emacs-package&lt;/a&gt;. It doesn't support nearly as many options, however, it allows a team of people to standardize on some settings and use them across different editors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It behaves much the same way, with a project-specific &lt;code&gt;.editorconfig&lt;/code&gt; file at the top-level.&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2014-10-06T12:20:04.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="715" PostTypeId="1" AcceptedAnswerId="716" CreationDate="2014-10-06T12:30:08.800" Score="46" ViewCount="10396" Body="&lt;p&gt;I have the below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq some-variable &quot;less&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am confused why I have to use the single quote with &lt;code&gt;boundp&lt;/code&gt; but not with &lt;code&gt;bound-and-true-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (boundp 'some-variable) &#xA;   (message &quot;some-variable is %s&quot; some-variable))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;some-variable is less&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 2a:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (bound-and-true-p some-variable) ;; Note that using single-quote causes error&#xA;   (message &quot;some-variable is %s&quot; some-variable))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;some-variable is less&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 2b:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (bound-and-true-p 'some-variable) ;; Note that using single-quote causes error&#xA;   (message &quot;some-variable is %s&quot; some-variable))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;and: Wrong type argument: symbolp, (quote some-variable)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2015-07-11T04:38:17.950" LastActivityDate="2021-03-04T12:08:12.523" Title="How to know when or when not to use the single quote before variable names?" Tags="|elisp|quote|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="716" PostTypeId="2" ParentId="715" CreationDate="2014-10-06T12:42:09.217" Score="35" Body="&lt;h3&gt;Short answer&lt;/h3&gt;&#xA;&lt;p&gt;If you are trying to use the variable itself, then use &lt;code&gt;'some-variable&lt;/code&gt;.  If you are trying to use the value stored in the variable, use &lt;code&gt;some-variable&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;boundp uses symbol so it will look at anything that can be bound, including functions.&#xA;It only cares whether there is a symbol that matches, not what the value is.&lt;/li&gt;&#xA;&lt;li&gt;bound-and-truep uses var and returns the value. In this case you need to provide the&#xA;value of the symbol to the function. If no symbol var is bound, or the value is nil then&#xA;it will return nil.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3&gt;Explanation&lt;/h3&gt;&#xA;&lt;p&gt;For the manual definition please see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;'&lt;/code&gt; and &lt;code&gt;(quote ...)&lt;/code&gt; both perform the same purpose in emacs-lisp.&lt;/p&gt;&#xA;&lt;p&gt;The purpose of this is to pass the unevaluated form to the surrounding environment rather than evaluate it.&lt;/p&gt;&#xA;&lt;p&gt;In your example assume we had the following higher up&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (setq some-variable &amp;quot;less&amp;quot;) ;; Rather than just 't for clarity&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then the evaluation goes as follows:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (when (boundp 'some-variable) &#xA;       (message &amp;quot;some-variable is %s&amp;quot; some-variable))&#xA;    ;; ==&amp;gt; (boundp 'some-variable) ; 't&#xA;    ;; ==&amp;gt; some-variable is &amp;quot;less&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Whereas without a quote:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (when (boundp some-variable) ;; Note that not using single-quote causes error&#xA;       (message &amp;quot;some-variable is %s&amp;quot; some-variable))&#xA;    ;; ==&amp;gt; (boundp &amp;quot;less&amp;quot;) ; &amp;quot;less&amp;quot; is not a variable. -&amp;gt; Error&#xA;&#xA;Lisp evaluates forms as they are reached, by quoting the form you prevent evaluation so that the actual variable (or list, or function name) is passed.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastEditorUserId="29032" LastEditDate="2021-02-03T11:42:41.213" LastActivityDate="2021-02-03T11:42:41.213" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="717" PostTypeId="2" ParentId="664" CreationDate="2014-10-06T12:42:18.833" Score="3" Body="&lt;p&gt;Images can be exported as Inline in two styles: with hyperlink or without hyperlink.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Inline With Hyperlink&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:./image.png][file:./image_thumbnail.png]] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that it is mandatory to put a prefix like &lt;code&gt;file:&lt;/code&gt; or &lt;code&gt;http:&lt;/code&gt; in the &lt;em&gt;Description&lt;/em&gt; portion (&lt;code&gt;[file:./image_thumbnail.png]&lt;/code&gt;) of the above image link; otherwise &lt;code&gt;ox-html&lt;/code&gt; will export that as a text hyperlink pointing to the image.png.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use simply reuse image.png instead of image_thumbnail.png.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Below examples will result in inline image hyperlinks pointing to &lt;code&gt;./image.png&lt;/code&gt;:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[file:./image.png][file:./image.png]]&#xA;[[./image.png][file:./image.png]]&#xA;[[file:./image.png][file:./other-image.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Inline Without Hyperlink&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:./image.png]] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Below examples will result in inline images without hyperlinks:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[file:./image.png]]&#xA;[[./image.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Text hyperlink to image&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:./image.png][Any text that doesn't begin with file:]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Below examples will result in text hyperlinks pointing to &lt;code&gt;./image.png&lt;/code&gt;:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[file:./image.png][Description]]&#xA;[[file:./image.png][./image.png]]&#xA;[[./image.png][./image.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-06T13:18:58.937" LastActivityDate="2014-10-06T13:18:58.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="718" PostTypeId="2" ParentId="713" CreationDate="2014-10-06T12:49:45.703" Score="5" Body="&lt;p&gt;This answer isn't exactly what you want (it does not use helm and does not use&#xA;regexp) but Emacs has a built-in command called &lt;code&gt;find-name-dired&lt;/code&gt; which finds&#xA;recursively in a directory all files matching a given &lt;a href=&quot;http://www.linfo.org/wildcard.html&quot; rel=&quot;noreferrer&quot;&gt;shell wildcard&lt;/a&gt; and&#xA;opens a Dired buffer with all the matching files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your particular example you can do&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-name-dired&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;/path/to/emacs-24.3&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;*.el&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="504" LastEditDate="2014-10-06T18:57:54.170" LastActivityDate="2014-10-06T18:57:54.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="719" PostTypeId="2" ParentId="715" CreationDate="2014-10-06T12:58:47.840" Score="3" Body="&lt;p&gt;From the source code of &lt;code&gt;boundp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;DEFUN (&quot;boundp&quot;, Fboundp, Sboundp, 1, 1, 0,&#xA;      doc: /* Return t if SYMBOL's value is not void.&#xA;Note that if `lexical-binding' is in effect, this refers to the&#xA;global value outside of any lexical scope.  */)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;boundp&lt;/code&gt; expects a &lt;code&gt;symbol&lt;/code&gt; as the input. &lt;code&gt;'some-variable&lt;/code&gt; is a symbol to the variable &lt;code&gt;some-variable&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the source code of &lt;code&gt;bound-and-true-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro bound-and-true-p (var)&#xA;  &quot;Return the value of symbol VAR if it is bound, else nil.&quot;&#xA;  `(and (boundp (quote ,var)) ,var))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;bound-and-true-p&lt;/code&gt; expects a &lt;code&gt;variable&lt;/code&gt; as the input. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside the &lt;code&gt;bound-and-true-p&lt;/code&gt; macro, it gets the symbol by doing &lt;code&gt;(quote ,var)&lt;/code&gt;. So if the input is &lt;code&gt;some-variable&lt;/code&gt;, &lt;code&gt;(quote ,var)&lt;/code&gt; will results in &lt;code&gt;'some-variable&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I give the input &lt;code&gt;'some-variable&lt;/code&gt; to &lt;code&gt;bound-and-true-p&lt;/code&gt;, I get the error: &lt;code&gt;and: Wrong type argument: symbolp, (quote some-variable)&lt;/code&gt; because the macro is NOT expecting a symbol (&lt;code&gt;'some-variable&lt;/code&gt;) at the input.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-06T13:06:15.077" LastActivityDate="2014-10-06T13:06:15.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="720" PostTypeId="1" AcceptedAnswerId="763" CreationDate="2014-10-06T13:25:23.320" Score="2" ViewCount="257" Body="&lt;p&gt;Paraphrasing &lt;a href=&quot;https://superuser.com/questions/603441/can-i-toggle-fringe-mode-when-entering-exiting-emacs-edebug/639624&quot;&gt;a question I previously asked on SuperUser&lt;/a&gt; because, IMO, the answer found there does not resolve the issue.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For the most part I prefer to disable Emacs' fringe. (I customize &lt;code&gt;fringe-mode&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; a/k/a &lt;code&gt;no-fringes&lt;/code&gt;)  But I like to have the left fringe active when debugging elisp code (for the little fringe arrow pointing to the active line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure Emacs to switch to &lt;code&gt;fringe-mode&lt;/code&gt; of &lt;code&gt;(nil . 0)&lt;/code&gt; a/k/a &lt;code&gt;left-only&lt;/code&gt; when entering edebug and restore the previous &lt;code&gt;fringe-mode&lt;/code&gt; when exiting?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Since Emacs 24.3 is the latest stable release as of this writing, I have a preference for solutions that work there.  Since Emacs 24.4 is available, in feature-freeze, and actively in use by several users of this site, I'm accepting that answer.&lt;/p&gt;&#xA;" OwnerUserId="372" LastEditorUserId="372" LastEditDate="2014-10-07T13:30:34.283" LastActivityDate="2014-10-07T13:30:34.283" Title="Can I toggle fringe-mode when entering / exiting edebug?" Tags="|edebug|fringe-mode|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="721" PostTypeId="1" AcceptedAnswerId="724" CreationDate="2014-10-06T14:05:48.813" Score="13" ViewCount="1273" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I control which window &lt;code&gt;org-deadline&lt;/code&gt; uses to display the calendar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-deadline&lt;/code&gt; temporarily pops up the &lt;code&gt;calendar&lt;/code&gt; buffer in a window when setting a deadline, and then closes it again after completing.  When there is only one window, it pops a new window at the bottom of the existing frame.  When there are multiple windows, it selects one -- I presume with something like &lt;code&gt;get-lru-window&lt;/code&gt; -- of the available windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter is problematic if it takes over one of the other windows that has the information I need in order to set the deadline (date, time, etc.)  This is commonly a problem in a window setup such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------------------+--------------------+&#xA;|                    |                    |&#xA;|                    |  (B: mu4e header)  |&#xA;|                    |                    |&#xA;|                    +--------------------+&#xA;|  (A: agenda file)  |                    |&#xA;|                    |                    |&#xA;|                    |                    |&#xA;|                    |  (C: mu4e view)    |&#xA;|                    |                    |&#xA;|                    |                    |&#xA;|                    |                    |&#xA;+--------------------+--------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When adding a deadline to the agenda file in (A), &lt;code&gt;org-deadline&lt;/code&gt; will take over (B) or (C), which contain emails that have the date/time information I need.  I'd much prefer that, if I'm calling &lt;code&gt;org-deadline&lt;/code&gt; from (A), it would pop a temporary window (D) to contain the &lt;code&gt;calendar&lt;/code&gt; buffer as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------------------+--------------------+&#xA;|                    |                    |&#xA;|                    |  (B: mu4e header)  |&#xA;|                    |                    |&#xA;|                    +--------------------+&#xA;|  (A: agenda file)  |                    |&#xA;|                    |                    |&#xA;|                    |                    |&#xA;+--------------------+  (C: mu4e view)    |&#xA;|                    |                    |&#xA;|   (D: calendar)    |                    |&#xA;|                    |                    |&#xA;+--------------------+--------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So: how would one force &lt;code&gt;org-deadline&lt;/code&gt; (and analogous functions) to pop a new, temporary window at the bottom of the active window rather than take over one of the other ones?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;&lt;em&gt;PS:&lt;/em&gt; I'm aware of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Dedicated-Windows.html&quot;&gt;dedicated windows&lt;/a&gt;, but they don't strike me as the best approach since it's not so much that I want to dedicate buffers to windows as I want to avoid having a function take over one of the &quot;short&quot; ones.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="50" LastEditDate="2014-10-06T21:39:56.890" LastActivityDate="2014-11-30T06:34:00.990" Title="How to control in which window a buffer is displayed?" Tags="|org-mode|window|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="722" PostTypeId="2" ParentId="715" CreationDate="2014-10-06T14:19:28.043" Score="24" Body="&lt;p&gt;A symbol which is in non-function position is treated as the name of a variable. In &lt;code&gt;(function variable)&lt;/code&gt; &lt;code&gt;function&lt;/code&gt; is in function-position (after the opening parenthesis) and &lt;code&gt;variable&lt;/code&gt; is not. Unless explicitly quoted variables are replaced with their values.&lt;/p&gt;&#xA;&lt;p&gt;If you were to write &lt;code&gt;(boundp my-variable)&lt;/code&gt; that would mean &amp;quot;is the symbol which is stored in the value of variable &lt;code&gt;my-variable&lt;/code&gt; bound as a variable&amp;quot; and not &amp;quot;is the symbol &lt;code&gt;my-variable&lt;/code&gt; bound as a variable.&lt;/p&gt;&#xA;&lt;p&gt;So why does &lt;code&gt;bound-and-true-p&lt;/code&gt; behave differently?&lt;/p&gt;&#xA;&lt;p&gt;This is a macro and the normal (function) evaluation rules don't apply here, macros are free to decide if and when their arguments are evaluated. What macros actually do is somehow transform the arguments and return the result as a list, which is then evaluated. The transformation and the final evaluation happen at different times, called macro-expansion-time and evaluation-time.&lt;/p&gt;&#xA;&lt;p&gt;This is what the definition of &lt;code&gt;bound-and-true-p&lt;/code&gt; looks like:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro bound-and-true-p (var)&#xA;  &amp;quot;Return the value of symbol VAR if it is bound, else nil.&amp;quot;&#xA;  `(and (boundp (quote ,var)) ,var))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This uses reader macros which are different from lisp macros (more on that below). To not complicate this further lets not use any reader macros:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro bound-and-true-p (var)&#xA;  &amp;quot;Return the value of symbol VAR if it is bound, else nil.&amp;quot;&#xA;  (list 'and (list 'boundp (list 'quote var)) var))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you write&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(bound-and-true-p my-variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;that is first &amp;quot;translated&amp;quot; to&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(and (boundp 'my-variable) my-variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and then that is evaluated returning &lt;code&gt;nil&lt;/code&gt; if &lt;code&gt;my-variable&lt;/code&gt; is not &lt;code&gt;boundp&lt;/code&gt; or else the value of &lt;code&gt;my-variable&lt;/code&gt; (which of course can also be &lt;code&gt;nil&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;You might have noticed that the expansion wasn't&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(and (boundp (quote my-variable)) my-variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;as we could have expected. &lt;code&gt;quote&lt;/code&gt; is a special form, not a macro or function. Like macros, special forms can do whatever with their arguments. This particular special form simply returns its argument, here a symbol, instead of the variable value of the symbol. That's actually the only purpose of this special form: preventing evaluation! Macros cannot do that on their own, they need to use &lt;code&gt;quote&lt;/code&gt; to do so.&lt;/p&gt;&#xA;&lt;p&gt;So what's up with &lt;code&gt;'&lt;/code&gt;? It is a &lt;em&gt;reader macro&lt;/em&gt;, which as mentioned above isn't the same as a &lt;em&gt;lisp macro&lt;/em&gt;. While macros are used to transform code/data, reader macros are used earlier when reading text in order to transform that text into code/data.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;'something&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;is a short form for&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(quote something)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;`&lt;/code&gt; used in the actual definition of &lt;code&gt;bound-and-true-p&lt;/code&gt; also is a reader macro. If it quotes a symbol as in &lt;code&gt; `symbol&lt;/code&gt; it is equivalent to &lt;code&gt;'symbol&lt;/code&gt;, but when is used to quote a list as in &lt;code&gt; `(foo bar ,baz)&lt;/code&gt; it behaves differently in that forms that are prefixed with &lt;code&gt;,&lt;/code&gt; are evaluated.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;`(constant ,variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;is equivalent to&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(list (quote constant) variable))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;This should answer the question why unquoted symbols are sometimes evaluated (replaced with their values) and sometimes not; macros can use &lt;code&gt;quote&lt;/code&gt; to prevent a symbol from being evaluated.&lt;/p&gt;&#xA;&lt;p&gt;But why is &lt;code&gt;bound-and-true-p&lt;/code&gt; a macro while &lt;code&gt;boundp&lt;/code&gt; is not? We have to be able to determine if arbitrary symbols, which are not known until run-time, are bound as symbols. This would not be possible if &lt;code&gt;boundp&lt;/code&gt; argument was automatically quoted.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;bound-and-true-p&lt;/code&gt; is used to determine whether a known variable is defined and if so use its value. This is useful if a library has an &lt;em&gt;optional&lt;/em&gt; dependency on a third-party library as in:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun foo-get-value ()&#xA;  (or (bound-and-true-p bar-value)&#xA;      ;; we have to calculate the value ourselves&#xA;      (our own inefficient or otherwise undesirable variant)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;bound-and-true-p&lt;/code&gt; could be defined as a function and require the argument to be quoted but because it is intended for cases where you know upfront what variable you care about a macro was used to save you from having to type the &lt;code&gt;'&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2021-03-04T12:08:12.523" LastActivityDate="2021-03-04T12:08:12.523" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="723" PostTypeId="1" AcceptedAnswerId="761" CreationDate="2014-10-06T14:33:06.427" Score="17" ViewCount="634" Body="&lt;p&gt;I would like to use the SE flavor of markdown in my emacs. The default Markdown mode has some features (backticks and indentation mark code, &lt;code&gt;#&lt;/code&gt; makes a header and &lt;code&gt;&amp;gt;&lt;/code&gt; also changes the font) but I would also like to have:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;*&lt;/code&gt; to make a list item, including indentation.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[foo](http://example.com)&lt;/code&gt; to show up as &lt;a href=&quot;http://example.com&quot; rel=&quot;nofollow&quot;&gt;foo&lt;/a&gt; and open a browser to &lt;code&gt;http://example.com&lt;/code&gt; when clicked.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Ideally, I would like this to be shown in my emacs as rendered Markdown. For example, if I were to write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## Header&#xA;&#xA;* item 1&#xA;* item 2&#xA;&#xA;         while true; do echo foo; done&#xA;&#xA;End of list and more code&#xA;&#xA;    while true; do echo bar; done&#xA;&#xA; See [here](http://example.com) for details&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like it to be rendered like this in emacs itself:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Header&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;item 1&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;item 2&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;while true; do echo foo; done&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;End of list and more code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;while true; do echo bar; done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://example.com&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for details&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Can this be achieved and, if so, how?&lt;/p&gt;&#xA;" OwnerUserId="241" LastEditorUserId="241" LastEditDate="2014-10-28T11:31:53.203" LastActivityDate="2017-07-17T12:04:47.850" Title="How can I use the SE flavor of Markdown in emacs?" Tags="|font-lock|markdown|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="724" PostTypeId="2" ParentId="721" CreationDate="2014-10-06T16:16:38.587" Score="10" Body="&lt;p&gt;Following should do what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-window-displaying-agenda-p (window)&#xA;    (equal (with-current-buffer (window-buffer window) major-mode)&#xA;        'org-agenda-mode)) &#xA;&#xA;(defun my-position-calendar-buffer (buffer alist)&#xA;  (let ((agenda-window (car (remove-if-not #'my-window-displaying-agenda-p (window-list)))))&#xA;    (when agenda-window&#xA;      (let ((desired-window (split-window agenda-window nil 'below)))&#xA;        (set-window-buffer desired-window  buffer)&#xA;        desired-window))))&#xA;&#xA;(add-to-list 'display-buffer-alist (cons &quot;\\*Calendar\\*&quot; (cons #'my-position-calendar-buffer nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calendar uses the function &lt;code&gt;calendar-basic-setup&lt;/code&gt; to display the calendar buffer, &lt;code&gt;calendar-basic-setup&lt;/code&gt; in turn uses &lt;code&gt;pop-to-buffer&lt;/code&gt; which in turn uses &lt;code&gt;display-buffer&lt;/code&gt; to display the calendar buffer. Now &lt;code&gt;display-buffer&lt;/code&gt; is highly &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window.html&quot; rel=&quot;nofollow&quot;&gt;customizable&lt;/a&gt; and allows us to provide functions to display a buffer using certain variables we use one such variable &lt;code&gt;display-buffer-alist&lt;/code&gt; here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically we are saying emacs to use the function &lt;code&gt;my-position-calendar-buffer&lt;/code&gt; to display a buffer matching the regexp &lt;code&gt;\*Calendar\*&lt;/code&gt;. The function &lt;code&gt;my-position-calendar-buffer&lt;/code&gt; searches for a window displaying org agenda, if it does not find any such window, it does nothing in which case &lt;code&gt;display-buffer&lt;/code&gt; will try some other functions to display the buffer. In case a window displaying org-agenda is found the function splits that window vertically and displays the calendar buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not tested this throughly (just tried starting calendar with agenda view and without agenda view), it seems to be working but there might be some bugs. &lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2014-11-30T06:34:00.990" LastActivityDate="2014-11-30T06:34:00.990" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="725" PostTypeId="2" ParentId="713" CreationDate="2014-10-06T18:14:54.120" Score="10" Body="&lt;p&gt;On systems that provide GNU &lt;code&gt;find&lt;/code&gt; utility, you can use &lt;code&gt;helm-find&lt;/code&gt; (by default bound to &lt;code&gt;C-x c /&lt;/code&gt;) to get the desired behavior. Starting &lt;code&gt;helm-find&lt;/code&gt; with a prefix argument &lt;code&gt;C-u C-x c /&lt;/code&gt; prompts for the directory (&lt;code&gt;emacs24.3&lt;/code&gt; in the example) first and then for the pattern (&lt;code&gt;dired el&lt;/code&gt; in the example). Without the prefix argument, it uses the default directory of the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Note that &lt;code&gt;helm-find&lt;/code&gt; cannot use wildcards or regexps unlike the actual &lt;code&gt;find&lt;/code&gt; utility. It does however support a whitespace separator to match multiple pattern within a string. For instance &lt;code&gt;dired .el&lt;/code&gt; matches only filenames that contain both the strings &lt;code&gt;dired&lt;/code&gt; and &lt;code&gt;.el&lt;/code&gt; in the path in any order.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-10-06T19:27:44.390" LastActivityDate="2014-10-06T19:27:44.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="726" PostTypeId="1" AcceptedAnswerId="746" CreationDate="2014-10-06T18:31:59.430" Score="10" ViewCount="661" Body="&lt;p&gt;I have a column in an org-mode table that contains long file names.  The interesting part of the filename is the last few characters rather than the first.  For example, given the files below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/data/capture/abcd_spectrum_01292000.dat&#xA;/data/capture/abcd_spectrum_02251435.dat&#xA;/data/capture/abcd_spectrum_02251847.dat&#xA;/data/capture/abcd_spectrum_02251848.dat&#xA;/data/capture/abcd_spectrum_02251848.dat&#xA;/data/capture/abcd_spectrum_02251849.dat&#xA;/data/capture/abcd_spectrum_02251851.dat&#xA;/data/capture/abcd_spectrum_02251852.dat&#xA;/data/capture/abcd_spectrum_02251852.dat&#xA;/data/capture/abcd_spectrum_02270910.dat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want my org table to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|            File | TD | FD | MF | Notes:               |&#xA;|-----------------+----+----+----+----------------------|&#xA;|           &amp;lt;r15&amp;gt; |    |    |    | &amp;lt;l20&amp;gt;                |&#xA;| &amp;lt;=_01292000.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251435.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251847.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251848.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251848.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251849.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251851.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251852.dat |    |    |    |                      |&#xA;| &amp;lt;=_02251852.dat |    |    |    |                      |&#xA;| &amp;lt;=_02270910.dat |    |    |    |                      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But instead it looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|            File | TD | FD | MF | Notes:               |&#xA;|-----------------+----+----+----+----------------------|&#xA;|           &amp;lt;r15&amp;gt; |    |    |    | &amp;lt;l20&amp;gt;                |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;| /data/capture=&amp;gt; |    |    |    |                      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is it possible to make right-aligned columns truncate to the left, so that I can see the right-most part of the entries?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2022-04-05T05:43:22.260" Title="Truncate beginning of right-aligned column in org table" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="727" PostTypeId="1" CreationDate="2014-10-06T19:00:39.693" Score="0" ViewCount="1415" Body="&lt;p&gt;What are my options for making my Caps Lock key a Control key? Can this be done within Emacs?&lt;/p&gt;&#xA;" OwnerUserId="537" LastEditorUserId="25" LastEditDate="2014-10-06T20:41:31.330" LastActivityDate="2014-10-07T00:39:53.850" Title="How do I bind Caps Lock to Control on Windows?" Tags="|keymap|microsoft-windows|" AnswerCount="3" CommentCount="8" ClosedDate="2014-10-07T09:20:03.863" ContentLicense="CC BY-SA 3.0" />
  <row Id="728" PostTypeId="1" CreationDate="2014-10-06T19:05:23.960" Score="90" ViewCount="58711" Body="&lt;p&gt;In vanilla Emacs, I have to do &lt;code&gt;C-x b&lt;/code&gt; and then manually type out the buffer name to switch. If I forget the  name of the buffer, I have to hit &lt;code&gt;TAB&lt;/code&gt; to list possible completions. Is there anything I can do to make this process faster?&lt;/p&gt;&#xA;" OwnerUserId="537" LastEditorUserId="105" LastEditDate="2015-05-14T00:35:19.947" LastActivityDate="2023-01-15T18:45:26.063" Title="How do I switch buffers quickly?" Tags="|key-bindings|buffers|cycling|" AnswerCount="25" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="729" PostTypeId="2" ParentId="723" CreationDate="2014-10-06T19:12:15.290" Score="5" Body="&lt;p&gt;A good place to start would be &lt;code&gt;markdown-mode.el&lt;/code&gt; which can be downloaded from &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mode does not offer &lt;code&gt;org-mode&lt;/code&gt; style beautification, but it does offer syntax highlighting and a bevy of &lt;code&gt;customize&lt;/code&gt; options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to get this style beautification, someone would need to write an extension to markdown-mode.el implementing font-faces. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Most of org-mode.el's faces are defined in &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-faces.el&quot;&gt;org-faces.el&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Additionally you will want to take a look at how org-mode visually replaces text with characters. That code is in &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-entities.el&quot;&gt;org-entities.el&lt;/a&gt;. This is the code that replaces the latex &lt;code&gt;\pm&lt;/code&gt; with ±.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="537" LastEditorUserId="537" LastEditDate="2014-10-06T19:29:47.990" LastActivityDate="2014-10-06T19:29:47.990" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="730" PostTypeId="2" ParentId="728" CreationDate="2014-10-06T19:12:19.367" Score="55" Body="&lt;p&gt;There is &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_buffer_switching.html&quot;&gt;ido&lt;/a&gt; mode that should help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;put this in your init file, to activate ido mode by default:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(ido-mode 1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;code&gt;C-x b&lt;/code&gt; will show you a list of candidates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this in your init file, if you prefer the items being displayed vertically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq ido-separator &quot;\n&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_buffer_switching.html&quot;&gt;ergoemacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me also suggest this &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_next_prev_user_buffer.html&quot;&gt;post&lt;/a&gt; talking about switch to previous/next buffer.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-10-06T19:25:31.203" LastActivityDate="2014-10-06T19:25:31.203" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="731" PostTypeId="2" ParentId="727" CreationDate="2014-10-06T19:17:39.973" Score="0" Body="&lt;p&gt;Most of the time, AutoHotKey should do the trick. I've red this &lt;a href=&quot;http://xahlee.info/mswin/autohotkey_swap_capslock.html&quot; rel=&quot;nofollow&quot;&gt;post&lt;/a&gt;, and this other &lt;a href=&quot;http://www.emacswiki.org/emacs/MovingTheCtrlKey#toc16&quot; rel=&quot;nofollow&quot;&gt;post&lt;/a&gt;. Never tried this myself, so I hope it will help.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-10-06T19:17:39.973" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="732" PostTypeId="1" CreationDate="2014-10-06T19:37:09.413" Score="68" ViewCount="35151" Body="&lt;p&gt;I am trying out a new major mode, how can I take advantage of Emacs' documentation system to get a listing of key bindings available in that specific buffer?&lt;/p&gt;&#xA;" OwnerUserId="537" LastEditorUserId="105" LastEditDate="2015-05-14T00:27:52.580" LastActivityDate="2023-05-29T20:17:33.580" Title="How do I list all key-bindings available in a given buffer?" Tags="|key-bindings|keymap|major-mode|" AnswerCount="8" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="733" PostTypeId="2" ParentId="732" CreationDate="2014-10-06T19:42:17.090" Score="73" Body="&lt;p&gt;&lt;code&gt;C-h b&lt;/code&gt; will list all the bindings available in a buffer. This is a mnemonic for help (C-h) bindings (b). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also get a list of keybindings via &lt;code&gt;C-h m&lt;/code&gt;, which is help for the major and minor modes for the buffer. The formatting of this is a little clearer, but includes additional information about the modes beyond just listing the keybindings.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2014-10-06T19:42:17.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="734" PostTypeId="2" ParentId="732" CreationDate="2014-10-06T20:33:47.487" Score="10" Body="&lt;p&gt;Although not the canonical &lt;code&gt;emacs&lt;/code&gt; way of doing things, I quite like using &lt;a href=&quot;https://framagit.org/steckerhalter/discover-my-major&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;discover-my-major&lt;/code&gt;&lt;/a&gt; for that purpose because it just feels more effective. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is available on &lt;code&gt;melpa&lt;/code&gt; and is powered by the &lt;code&gt;makey&lt;/code&gt; library, which is responsible for those nice menus &lt;code&gt;magit&lt;/code&gt; is known for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd suggest you check out the &lt;code&gt;github&lt;/code&gt; link for a screenshot demonstrating the functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install it (I'd suggest  from &lt;code&gt;melpa&lt;/code&gt; using &lt;code&gt;package.el&lt;/code&gt;) and add&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'discover-my-major)&#xA;(global-set-key (kbd &quot;C-h C-m&quot;) 'discover-my-major)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your config.&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="17895" LastEditDate="2019-02-12T19:25:54.823" LastActivityDate="2019-02-12T19:25:54.823" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="735" PostTypeId="1" CreationDate="2014-10-06T20:42:23.923" Score="8" ViewCount="3181" Body="&lt;p&gt;I want to get onto the #Emacs channel on Freenode. How do I do it?&lt;/p&gt;&#xA;" OwnerUserId="537" LastEditorUserId="25" LastEditDate="2014-10-06T20:58:53.880" LastActivityDate="2016-05-12T10:24:06.600" Title="How do I connect to IRC using Emacs?" Tags="|networking|irc|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="736" PostTypeId="2" ParentId="735" CreationDate="2014-10-06T20:48:17.807" Score="13" Body="&lt;p&gt;&lt;code&gt;M-x erc&lt;/code&gt; is built in and works well. You want to join &lt;code&gt;irc.freenode.net&lt;/code&gt;; the initial login is pretty self-explanatory. Then, type &lt;code&gt;/join #emacs&lt;/code&gt; from the main IRC prompt.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-10-06T20:48:17.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="737" PostTypeId="1" CreationDate="2014-10-06T21:07:36.317" Score="55" ViewCount="13227" Body="&lt;p&gt;Lets say I have 10 buffers open, and I want to find all occurrences of &lt;code&gt;blah&lt;/code&gt; in all 10 buffers. How would I do this? &lt;/p&gt;&#xA;" OwnerUserId="537" LastEditorUserId="12268" LastEditDate="2019-02-01T12:42:37.570" LastActivityDate="2023-07-25T01:08:08.160" Title="How do I find text across many open buffers?" Tags="|buffers|search|" AnswerCount="9" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="738" PostTypeId="2" ParentId="732" CreationDate="2014-10-06T21:23:40.993" Score="30" Body="&lt;p&gt;I use the command &lt;a href=&quot;https://github.com/emacs-helm/helm-descbinds&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;helm-descbinds&lt;/code&gt;&lt;/a&gt;, which is available via &lt;a href=&quot;http://melpa.milkbox.net/#/getting-started&quot; rel=&quot;noreferrer&quot;&gt;melpa&lt;/a&gt;.  I mapped it to &lt;code&gt;C-h b&lt;/code&gt; because it is basically a drop-in replacement for &lt;code&gt;describe-bindings&lt;/code&gt;.  The benefit is that it is easier to navigate and search than the output of &lt;code&gt;describe-bindings&lt;/code&gt; because you can easily search for keywords and the helm buffer will narrow to show all of the matches, and which mode they come from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mR9zb.png&quot; alt=&quot;helm-descbinds in action&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any selection in the list, you can choose to either perform the action, or to jump to the documentation for the command.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2019-10-06T01:07:50.733" LastActivityDate="2019-10-06T01:07:50.733" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="739" PostTypeId="2" ParentId="737" CreationDate="2014-10-06T21:27:39.403" Score="51" Body="&lt;p&gt;Sticking to built-in Emacs commands, you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html#index-multi_002doccur-872&quot;&gt;&lt;code&gt;multi-occur&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html#index-multi_002doccur_002din_002dmatching_002dbuffers-873&quot;&gt;&lt;code&gt;multi-occur-in-matching-buffers&lt;/code&gt;&lt;/a&gt; (&lt;code&gt;M-x multi-occur- TAB RET&lt;/code&gt;). &lt;code&gt;multi-occur&lt;/code&gt; gives you fine control by prompting for each buffer to use, but it's tedious. &lt;code&gt;multi-occur-in-matching-buffers&lt;/code&gt; lets you enter a regexp to match file names (it only searches in buffers that are visiting files); enter &lt;code&gt;.&lt;/code&gt; as the file regexp to search in all buffers that are visiting a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also functions for incremental search across a list of buffers or files, but they're tedious like &lt;code&gt;multi-occur&lt;/code&gt; as they require listing the buffers or files one by one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To search in all the files in a directory, or files matching certain patterns, whether they're open or not, you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Grep-Searching.html#index-grep-2555&quot;&gt;&lt;code&gt;grep&lt;/code&gt;&lt;/a&gt;. There are variants &lt;code&gt;rgrep&lt;/code&gt; and &lt;code&gt;grep-find&lt;/code&gt; to search subdirectories recursively.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-06T21:27:39.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="740" PostTypeId="2" ParentId="737" CreationDate="2014-10-06T21:39:31.743" Score="12" Body="&lt;p&gt;This can be done with &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;helm&lt;/a&gt; via the command &lt;code&gt;helm-multi-occur&lt;/code&gt;.  You can install helm from &lt;a href=&quot;http://melpa.milkbox.net/#/getting-started&quot;&gt;melpa&lt;/a&gt; and then call the command as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x helm-multi-occur RET M-a RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will open &lt;code&gt;helm-multi-occur&lt;/code&gt; and then select all buffers. Instead of using &lt;code&gt;M-a&lt;/code&gt; to mark all buffers, you can optionally select the buffers of interest one at a time. Navigate up and down the list with &lt;code&gt;C-n&lt;/code&gt; and &lt;code&gt;C-p&lt;/code&gt; and mark buffers with &lt;code&gt;C-SPC&lt;/code&gt;.  Once all of the buffers are marked, press &lt;code&gt;RET&lt;/code&gt; to accept the marked buffers and start searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm-regexp)&#xA;(eval-after-load &quot;helm-regexp&quot;&#xA;  '(setq helm-source-moccur&#xA;    (helm-make-source &quot;Moccur&quot; 'helm-source-multi-occur :follow 1)))&#xA;&#xA;;; (source: http://stackoverflow.com/q/14726601)&#xA;(defun my-helm-multi-occur-buffers ()&#xA;  &quot;multi-occur in all buffers backed by files.&quot;&#xA;  (interactive)&#xA;  (helm-multi-occur&#xA;   (delq nil&#xA;     (mapcar (lambda (b)&#xA;           (when (buffer-file-name b) (buffer-name b)))&#xA;         (buffer-list)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then bind the command &lt;code&gt;my-helm-multi-occur-buffers&lt;/code&gt; to do a multi-occur in all buffers that are backed by files.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-06T21:39:31.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="741" PostTypeId="2" ParentId="735" CreationDate="2014-10-06T21:42:55.890" Score="2" Body="&lt;p&gt;There is also circe, but you have to install it through melpa&lt;/p&gt;&#xA;" OwnerUserId="188" LastActivityDate="2014-10-06T21:42:55.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="742" PostTypeId="2" ParentId="728" CreationDate="2014-10-06T22:03:10.430" Score="4" Body="&lt;p&gt;I use &lt;code&gt;windmove.el&lt;/code&gt; and &lt;code&gt;bs.el&lt;/code&gt; to switch buffers quickly.  Both modes&#xA;are included with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;windmove.el&lt;/code&gt; - switches to a &lt;strong&gt;window&lt;/strong&gt; (a buffer that is currently displayed) in a specified direction,&#xA;e.g. left, right, up, down.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;bs.el&lt;/code&gt; - I use &lt;code&gt;bs-cycle-next&lt;/code&gt; and &lt;code&gt;bs-cycle-previous&lt;/code&gt; to switch to&#xA;the next buffer that isn't currently shown in a window.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can setup windmove with &lt;code&gt;(windmove-default-keybindings)&lt;/code&gt; which&#xA;will bind the appropriate commands to &lt;code&gt;Shift-Left Arrow&lt;/code&gt;, &lt;code&gt;Shift-Right Arrow&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For setting up &lt;code&gt;bs.el&lt;/code&gt;, something like this will work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-set-key [(f9)]   'bs-cycle-previous)&#xA; (global-set-key [(f10)]  'bs-cycle-next)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastEditorUserId="256" LastEditDate="2014-10-07T22:09:28.550" LastActivityDate="2014-10-07T22:09:28.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="743" PostTypeId="5" CreationDate="2014-10-06T22:08:03.247" Score="0" Body="&lt;p&gt;The text you are editing in Emacs resides in an object called a buffer. Each time you visit a file, a buffer is used to hold the file's text. Each time you invoke Dired, a buffer is used to hold the directory listing. If you send a message with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt;, a buffer is used to hold the text of the message. When you ask for a command's documentation, that appears in a buffer named &lt;code&gt;*Help*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Each buffer has a unique name, which can be of any length. When a buffer is displayed in a window, its name is shown in the mode line (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Mode-Line.html#Mode-Line&quot; rel=&quot;nofollow&quot;&gt;Mode Line&lt;/a&gt;). The distinction between upper and lower case matters in buffer names. Most buffers are made by visiting files, and their names are derived from the files' names; however, you can also create an empty buffer with any name you want. A newly started Emacs has several buffers, including one named &lt;code&gt;*scratch*&lt;/code&gt;, which can be used for evaluating Lisp expressions and is not associated with any file (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Interaction.html#Lisp-Interaction&quot; rel=&quot;nofollow&quot;&gt;Lisp Interaction&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At any time, one and only one buffer is selected; we call it the current buffer. We sometimes say that a command operates on “the buffer”; this really means that it operates on the current buffer. When there is only one Emacs window, the buffer displayed in that window is current. When there are multiple windows, the buffer displayed in the selected window is current. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows.html#Windows&quot; rel=&quot;nofollow&quot;&gt;Windows&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from its textual contents, each buffer records several pieces of information, such as what file it is visiting (if any), whether it is modified, and what major mode and minor modes are in effect (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Modes.html#Modes&quot; rel=&quot;nofollow&quot;&gt;Modes&lt;/a&gt;). These are stored in buffer-local variables—variables that can have a different value in each buffer. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Locals.html#Locals&quot; rel=&quot;nofollow&quot;&gt;Locals&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A buffer's size cannot be larger than some maximum, which is defined by the largest buffer position representable by Emacs integers. This is because Emacs tracks buffer positions using that data type. For typical 64-bit machines, this maximum buffer size is 2^61 - 2 bytes, or about 2 EiB. For typical 32-bit machines, the maximum is usually 2^29 - 2 bytes, or about 512 MiB. Buffer sizes are also limited by the amount of memory in the system.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Buffer.html#Select-Buffer&quot; rel=&quot;nofollow&quot;&gt;Select Buffer&lt;/a&gt;: Creating a new buffer or reselecting an old one.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/List-Buffers.html#List-Buffers&quot; rel=&quot;nofollow&quot;&gt;List Buffers&lt;/a&gt;: Getting a list of buffers that exist.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Buffer.html#Misc-Buffer&quot; rel=&quot;nofollow&quot;&gt;Misc Buffer&lt;/a&gt;: Renaming; changing read-only status; copying text.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Kill-Buffer.html#Kill-Buffer&quot; rel=&quot;nofollow&quot;&gt;Kill Buffer&lt;/a&gt;: Killing buffers you no longer need.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Several-Buffers.html#Several-Buffers&quot; rel=&quot;nofollow&quot;&gt;Several Buffers&lt;/a&gt;: How to go through the list of all buffers and operate variously on several of them.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html#Indirect-Buffers&quot; rel=&quot;nofollow&quot;&gt;Indirect Buffers&lt;/a&gt;: An indirect buffer shares the text of another buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Buffer-Convenience.html#Buffer-Convenience&quot; rel=&quot;nofollow&quot;&gt;Buffer Convenience&lt;/a&gt;: Convenience and customization features for buffer handling.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="504" LastEditDate="2014-11-13T14:23:40.280" LastActivityDate="2014-11-13T14:23:40.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="744" PostTypeId="4" CreationDate="2014-10-06T22:08:03.247" Score="0" Body="The text you are editing in Emacs resides in an object called a buffer. Each time you visit a file, a buffer is used to hold the file's text. Each time you invoke Dired, a buffer is used to hold the directory listing." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-18T16:28:44.977" LastActivityDate="2014-10-18T16:28:44.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="745" PostTypeId="2" ParentId="737" CreationDate="2014-10-06T22:15:46.747" Score="12" Body="&lt;p&gt;In addition to what others have mentioned - here are two other resources for this.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x multi-isearch-buffers&lt;/code&gt; or &lt;code&gt;M-x multi-isearch-buffers-regexp&lt;/code&gt; (vanilla Emacs) - Incremental search across multiple buffers.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;icicle-search&lt;/code&gt;&lt;/a&gt; (or &lt;code&gt;icicle-occur&lt;/code&gt;, or any number of other &lt;code&gt;icicle-search&lt;/code&gt; specializations) to search across multiple files or buffers.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(In addition to searching and replacing across arbitrary &lt;strong&gt;buffers&lt;/strong&gt;, there are of course commands that do that across multiple &lt;strong&gt;files&lt;/strong&gt;.  Others have mentioned &lt;code&gt;grep&lt;/code&gt;, for instance. And there is of course &lt;code&gt;A&lt;/code&gt; in Dired.  But you did not ask about searching files.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="21659" LastEditDate="2019-02-15T17:18:13.583" LastActivityDate="2019-02-15T17:18:13.583" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="746" PostTypeId="2" ParentId="726" CreationDate="2014-10-06T22:29:01.227" Score="8" Body="&lt;p&gt;As far as I know, there is no built-in support for customizing truncation of table columns. However, you can modify the command &lt;code&gt;org-table-align&lt;/code&gt; to achieve what you want:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Find the file &lt;code&gt;org-table.el&lt;/code&gt;. It is located in the directory of your &lt;code&gt;org-mode&lt;/code&gt; installation. The fastest way to open it is via &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-library&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;org-table&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Copy the definition of &lt;code&gt;org-table-align&lt;/code&gt; to your &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Replace&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-text-properties f1 (length xx) (list 'org-cwidth t) xx)&#xA;(add-text-properties (- f1 2) f1&#xA;               (list 'display org-narrow-column-arrow)&#xA;               xx)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let (s1 e1 s2 e2 arrow-string)&#xA;  (if (and falign1 (equal (downcase falign1) &quot;r&quot;))&#xA;      (setq s1 0&#xA;            e1 (- (length xx) f1)&#xA;            s2 (- (length xx) f1)&#xA;            e2 (- (length xx) (- f1 2))&#xA;            arrow-string &quot;&amp;lt;=&quot;)&#xA;    (setq s1 f1&#xA;          e1 (length xx)&#xA;          s2 (- f1 2)&#xA;          e2 f1&#xA;          arrow-string org-narrow-column-arrow))&#xA;  (add-text-properties s1 e1 (list 'org-cwidth t) xx)&#xA;  (add-text-properties s2 e2 (list 'display arrow-string) xx))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Tested using version 8.2.8 of &lt;code&gt;org-mode&lt;/code&gt;.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-04T11:32:01.973" LastActivityDate="2015-02-04T11:32:01.973" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="747" PostTypeId="2" ParentId="732" CreationDate="2014-10-06T22:36:36.740" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Key_Completion&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt; key completion&lt;/a&gt; gives you all of the info you get from &lt;code&gt;C-h b&lt;/code&gt; (&lt;code&gt;describe-bindings&lt;/code&gt;), &lt;code&gt;C-h w&lt;/code&gt; (&lt;code&gt;where-is&lt;/code&gt;), and &lt;code&gt;C-h c&lt;/code&gt; (&lt;code&gt;describe-key-briefly&lt;/code&gt;), rolled into one.  Just hit &lt;code&gt;S-TAB&lt;/code&gt; anytime at top level.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Every key sequence that you can possibly type in the current context (with the exception of keys such as &lt;code&gt;q&lt;/code&gt; that just insert characters) is displayed in buffer &lt;code&gt;*Completions*&lt;/code&gt;. This tells you which keys are available &lt;strong&gt;now&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The command that each key sequence is bound to is also shown in &lt;code&gt;*Completions*&lt;/code&gt;, next to the key name (e.g. &lt;code&gt;b = bookmark-jump&lt;/code&gt;). This gives you a rough idea what the key (e.g. &lt;code&gt;b&lt;/code&gt;) &lt;strong&gt;does&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Each key sequence that is bound &lt;em&gt;locally&lt;/em&gt;, that is, each key that has a special meaning for the current buffer mode, is highlighted in &lt;code&gt;*Completions*&lt;/code&gt; with a pale yellow background. This tells you which bindings are those offered by the &lt;strong&gt;current mode&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Click &lt;code&gt;C-M-mouse-2&lt;/code&gt; on a key name (with its command name). A &lt;code&gt;*Help*&lt;/code&gt; buffer opens with a complete description of the command bound to the key. This tells you what the key sequence does in detail.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Click another key (command) to get help on it, and so on… You can do this all day, browsing through the available key bindings to learn what they do. This is a great way, in particular, to learn about the keys defined by a given mode.&lt;/li&gt;&#xA;&lt;li&gt;Click any link in the &lt;code&gt;*Help*&lt;/code&gt; buffer to find out about stuff related to a given command and its key sequence. Navigate throughout the help system – you can do this all day too. Then pick another key to interrogate…&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want to then &lt;strong&gt;use&lt;/strong&gt; a key (command), then just click &lt;code&gt;mouse-2&lt;/code&gt; on its name in &lt;code&gt;*Completions*&lt;/code&gt; (or complete the key + command name and hit &lt;code&gt;RET&lt;/code&gt;). Or cancel, using &lt;code&gt;C-g&lt;/code&gt;, and hit the key as you would normally.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can start with &lt;code&gt;S-TAB&lt;/code&gt;, to see &lt;strong&gt;all&lt;/strong&gt; currently available keys. Or you can start by hitting a prefix key (e.g. &lt;code&gt;C-x&lt;/code&gt;) and then hit &lt;code&gt;S-TAB&lt;/code&gt; to see all &lt;strong&gt;keys that have that prefix&lt;/strong&gt; (i.e., all keys available after you have hit that prefix key). (The &quot;command&quot; associated with a prefix key is indicated by &lt;code&gt;...&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can even complete menu-bar menus this way, by accessing the pseudo-function prefix key &lt;code&gt;menu-bar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsNewbieWithIcicles#PossibleKeyBindings&quot; rel=&quot;nofollow&quot;&gt;this description&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-06T22:36:36.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="748" PostTypeId="2" ParentId="727" CreationDate="2014-10-06T22:39:37.683" Score="2" Body="&lt;p&gt;Windows has a built-in feature that lets you flexibly remap keys by adding registry keys corresponding one keycode to another. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't very user-friendly to do manually, so you can get a program called &lt;a href=&quot;http://www.randyrants.com/sharpkeys/&quot; rel=&quot;nofollow&quot;&gt;SharpKeys&lt;/a&gt; that's a nice GUI to this. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Just install the program (it's small); start it up.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;em&gt;Add&lt;/em&gt; below the empty list box. &lt;/li&gt;&#xA;&lt;li&gt;You can then choose &lt;em&gt;Caps Lock&lt;/em&gt; from the left list and &lt;em&gt;Left Control&lt;/em&gt; or &lt;em&gt;Right Control&lt;/em&gt; from the right list, or do it the easy way and just click &quot;Type Key&quot; on the left and press your caps lock key and then okay.&lt;/li&gt;&#xA;&lt;li&gt;Then do the same thing on the right with either &lt;em&gt;Left Control&lt;/em&gt; or &lt;em&gt;Right Control&lt;/em&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Then just hit OK, then hit &lt;em&gt;Write to Registry&lt;/em&gt; in the main window. &lt;/li&gt;&#xA;&lt;li&gt;Once this is done you'll need to log off and then back on so that Windows will reload the keyboard settings.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastActivityDate="2014-10-06T22:39:37.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="749" PostTypeId="2" ParentId="474" CreationDate="2014-10-06T23:15:47.863" Score="10" Body="&lt;p&gt;Since you are asking for a full-featureed C/C++ IDE now, I might be qualified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used all MS IDEs from vc4 to Visual Studio 2010, so I fully understand what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good news is that Emacs could be 95% as good as Visual Studio, and it can do much more. but you might be not interested in the &quot;more&quot; part. So I will focus on your questions only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the key point, you &lt;strong&gt;MUST USE CMake&lt;/strong&gt;, even your C++ application is for windows only! End of story. No other choice, I know what I'm talking about. If you don't use CMake, then it's pointless to continue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer to question 1&lt;/strong&gt;:&#xA;You don't need set up anything, install cpputils-cmake (&lt;a href=&quot;https://github.com/redguardtoo/cpputils-cmake&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/redguardtoo/cpputils-cmake&lt;/a&gt;) which sets up other plugins. It's even more convenient than Visual Studio. So per project setup is not needed. For search replace thing, I combine the power of bash/perl/git and percol (&lt;a href=&quot;https://github.com/mooz/percol&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/mooz/percol&lt;/a&gt;), which is much better than any IDE. check my blog (&lt;a href=&quot;http://blog.binchen.org/categories/emacs.html&quot; rel=&quot;noreferrer&quot;&gt;http://blog.binchen.org/categories/emacs.html&lt;/a&gt;) and my ~/.bashrc (&lt;a href=&quot;https://gist.github.com/redguardtoo/01868d7a13817c9845e8#file-bashrc&quot; rel=&quot;noreferrer&quot;&gt;https://gist.github.com/redguardtoo/01868d7a13817c9845e8#file-bashrc&lt;/a&gt;). For example, I can search replace the files in certain commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer to question 2&lt;/strong&gt;:&#xA;It's already setup by cpputils-cmake, you just need &lt;code&gt;M-x compile&lt;/code&gt; as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer to question 3&lt;/strong&gt;:&#xA;same as question 2. I don't know why this is a problem. it's exactly the same behavior as VS, with better key bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer to question 4&lt;/strong&gt;:&#xA;Now most people just use Gnu Global which could be combined with cpputils-cmake. I understand the real issue is &lt;strong&gt;detect the directories containing all included C++ headers automatically&lt;/strong&gt;. That can be done with cpputils-cmake, everything else is easy. Please &lt;code&gt;man global&lt;/code&gt; in shell and read manual about the environment variable GTAGSLIBPATH. There are many plugins to provide nice UX based on Global for code navigation, I recommend ggtags.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer to question 5&lt;/strong&gt;:&#xA;Visual Debugging, Many people recommended &lt;code&gt;M-x gdb-many-window&lt;/code&gt;, I tried it but it didn't work. It's simply because my gdb version is outdated (Hint, I'm using OSX 10.7.3) and I'm too lazy to upgrade my OS. But GUD is fine. I create some short key to print variable for me in the editor window. all the debug stuff is usable. It does not has table UX layout as VS. but to be honest with you. Microsoft's debugger UX is also not the best in the world. The best user friendly debugger is DDD (&lt;a href=&quot;http://www.gnu.org/software/ddd/&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/ddd/&lt;/a&gt;). Gud and VS both suck on this issue. These days I just insert logging code with yasnippet which is another Emacs plugin. To clarify, I know all the advanced tricks about breakpoints, it's just because I'm too lazy to apply these tricks. Inserting logging code in Emacs is much easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many more things about IDE:&#xA;code completion? use company-mode, no setup need.&#xA;real time syntax check? use cpputils-cmake, then &lt;code&gt;(flymake-mode 1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best thing is, you need do less setup than VS &lt;strong&gt;if you use my setup&lt;/strong&gt; at (&lt;a href=&quot;https://github.com/redguardtoo/emacs.d&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d&lt;/a&gt;) That setup has the title &lt;strong&gt;&quot;purcell's emacs configuration plus C/C++ support&quot;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now there is something I need emphasize, &lt;strong&gt;Emacs give you full freedom&lt;/strong&gt;. You can choose any way to start. hard way or easy way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easy way is just copy my setup (or anybody's setup on github, count the stars at first), in 5 minutes you will have a fully functional C++ IDE. VS has not finished start up in that 5 minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hard way is tweaking the setup from the scratch. If you choose the hard way, then &lt;strong&gt;don't complain Emacs&lt;/strong&gt;. It's your choice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, in the long run, a little bit Emacs Lisp knowledge might be helpful. I think it's trivial for a professional C++ developer compared the time I wasted on MS sh*t. Many years ago MS silently upgraded their VC runtime in some windows update. It made my product running OK on company's machines but crashed &lt;strong&gt;on customers' computers&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that incident, I began to understand Richard Stallman.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-05-04T14:58:45.777" LastActivityDate="2015-05-04T14:58:45.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="750" PostTypeId="2" ParentId="727" CreationDate="2014-10-07T00:39:53.850" Score="0" Body="&lt;p&gt;Apologies for being slightly OT, but it's been a &lt;em&gt;long&lt;/em&gt; time since I used Windows.  I was kept sane back then by &lt;a href=&quot;http://www.cam.hi-ho.ne.jp/oishi/indexen.html&quot; rel=&quot;nofollow&quot;&gt;XKeyEmacs&lt;/a&gt;, a somewhat obscure but wonderfull program that makes Emacs keybindings work throughout Windows. Even multi-key bindings like C-x C-s work in MS Word etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;IIRC it can also map tab to control, but perhaps that was something else. &lt;/p&gt;&#xA;" OwnerUserId="215" LastActivityDate="2014-10-07T00:39:53.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="751" PostTypeId="1" AcceptedAnswerId="773" CreationDate="2014-10-07T00:57:02.827" Score="66" ViewCount="22870" Body="&lt;p&gt;I recently learned about  &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt;, and it looks like a very useful package. I went through the documentation on the &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot;&gt;original repo&lt;/a&gt;, but the commands still look a bit obscure to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then watched the &lt;a href=&quot;http://emacsrocks.com/e13.html&quot;&gt;video&lt;/a&gt; in Emacs Rocks!, and the video is great, but it focuses mostly on what &lt;code&gt;multiple-cursors&lt;/code&gt; is capable of doing, rather than on &lt;strong&gt;how&lt;/strong&gt; to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any walk-throughs, tutorials or examples that illustrate its most basic functionality?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2015-09-30T15:59:56.647" LastActivityDate="2017-02-06T01:42:06.377" Title="Fundamentals of multiple-cursors" Tags="|multiple-cursors|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="752" PostTypeId="2" ParentId="713" CreationDate="2014-10-07T02:10:27.350" Score="1" Body="&lt;p&gt;If you don't care about using Helm, you can do what you ask using &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is it that you want to do with the files you find?  Open them? Search them? I'll assume you want to open them, as an illustration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a couple different ways. The first is simpler; the second shows some additional features that you can also use in other ways.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow&quot;&gt;multi-command&lt;/a&gt; &lt;strong&gt;&lt;code&gt;icicle-locate-file-other-window&lt;/code&gt;&lt;/strong&gt; to open files under a given directory, matching them by name or content, or both. You are prompted for the directory within which to look.  (On platforms that have system command &lt;code&gt;locate&lt;/code&gt; you can use &lt;code&gt;icicle-locate&lt;/code&gt; instead, which is faster than &lt;code&gt;icicle-locate-file&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then type a &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Multi-Completions&quot; rel=&quot;nofollow&quot;&gt;multi-completion&lt;/a&gt; pattern to match.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f.* C-M-j some text .*in the file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The files with &lt;em&gt;names&lt;/em&gt; matching regexp &lt;strong&gt;&lt;code&gt;f.*&lt;/code&gt;&lt;/strong&gt; and with &lt;em&gt;content&lt;/em&gt; matching regexp &lt;strong&gt;&lt;code&gt;some text .*in the file&lt;/code&gt;&lt;/strong&gt; are the completion candidates. Each part here is optional: if you want, you can filter on just file names or just file contents. The matching (absolute) file names appear in buffer &lt;code&gt;*Completions*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-M-j&lt;/code&gt;&lt;/strong&gt; here is a multi-completion separator.  (Helm uses a space similarly, but in &lt;strong&gt;Icicles&lt;/strong&gt; space chars are often used in the patterns themselves, which can be any regexps.  Actually, what is used for the separator is defined by a user option.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Optionally, hit &lt;strong&gt;&lt;code&gt;S-SPC&lt;/code&gt;&lt;/strong&gt; and then type more patterns to narrow the completion choices further.  You can use &lt;code&gt;S-SPC&lt;/code&gt; to add as many patterns as you like.  This is &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow&quot;&gt;progressive completion&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;strong&gt;&lt;code&gt;C-!&lt;/code&gt;&lt;/strong&gt; to open all of the candidate files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without exiting multi-command &lt;code&gt;icicle-locate-file-other-window&lt;/code&gt;, you can change the filtering expressions to get a different subset of the file names, and then act on them as well.  However, if you accumulated patterns using progressive completion, then any patterns you entered before the last &lt;code&gt;S-SPC&lt;/code&gt; are locked in, unless you use &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Candidate_Sets#RecompletingUsingTheOriginalDomain&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;C-x C-0&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to restore the original domain of candidates (which in this case is all of the files under the given directory).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;With the second approach, you first &lt;em&gt;save the names of all files in and below the current directory&lt;/em&gt;.  You can save that list in a cache file, in an Emacs fileset, or in a variable.  If you want to save it in a variable, you can be prompted for it or just use the default variable for this, &lt;code&gt;icicle-saved-completion-candidates&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this in Dired using command &lt;code&gt;icicle-dired-save-marked-recursive&lt;/code&gt;.  If you use library &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then this command is bound to &lt;strong&gt;&lt;code&gt;M-+ C-M-&amp;gt;&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;M-+&lt;/code&gt; is a &lt;strong&gt;Dired+&lt;/strong&gt; prefix for acting on all files under a directory, or all marked files there and in marked subdirs, defined recursively.  &lt;code&gt;C-M-&amp;gt;&lt;/code&gt; is the standard &lt;strong&gt;Icicles&lt;/strong&gt; completion action key for saving candidates.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can later retrieve the list of file names (as many times as you like), to act on the files themselves.  When you do this, you can filter the files - by name or by content, using one or more regexps or substrings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you want to open all of the files (among those whose &lt;em&gt;names&lt;/em&gt; were saved) whose names match &lt;code&gt;f.*&lt;/code&gt; and whose &lt;em&gt;content&lt;/em&gt; matches &lt;code&gt;some text .*in the file&lt;/code&gt;, then do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  C-u C-x 4 C-f C-M-&amp;lt; f.* C-M-j some text .*in the file C-!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Decomposing that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-x 4 C-f&lt;/code&gt;&lt;/strong&gt; is &lt;strong&gt;Icicles&lt;/strong&gt; command &lt;code&gt;icicle-file-other-window&lt;/code&gt;, which is a &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow&quot;&gt;multi-command&lt;/a&gt; version of &lt;code&gt;find-file-other-window&lt;/code&gt;.  But with &lt;strong&gt;&lt;code&gt;C-u&lt;/code&gt;&lt;/strong&gt; the candidates are &lt;em&gt;absolute&lt;/em&gt; file names.  (The names saved using &lt;code&gt;M-+ C-M-&amp;gt;&lt;/code&gt;, which you are going to retrieve, are absolute, as they are in different directories.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-M-&amp;lt;&lt;/code&gt;&lt;/strong&gt; is the opposite of &lt;code&gt;C-M-&amp;gt;&lt;/code&gt;.  It &lt;em&gt;retrieves&lt;/em&gt; a saved set of files (by default, from variable &lt;code&gt;icicle-saved-completion-candidates&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Just as in the first method, &lt;code&gt;f.* C-M-j some text .*in the file&lt;/code&gt; says to match regexp &lt;code&gt;f.*&lt;/code&gt; against file &lt;em&gt;names&lt;/em&gt; and match regexp &lt;code&gt;some text .*in the file&lt;/code&gt; against the file &lt;em&gt;contents&lt;/em&gt;.  This filters the set of file names to those that satisfy these two constraints.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-!&lt;/code&gt;&lt;/strong&gt; means &lt;em&gt;act on all&lt;/em&gt; candidates.  The action here is to find (open) the file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As with the first method, without exiting multi-command &lt;code&gt;icicle-file-other-window&lt;/code&gt;, you can change the filtering expressions to get a different subset of the saved file names, and then act on them as well.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-07T06:58:50.637" LastActivityDate="2014-10-07T06:58:50.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="753" PostTypeId="1" AcceptedAnswerId="757" CreationDate="2014-10-07T02:39:37.013" Score="13" ViewCount="2277" Body="&lt;p&gt;Sometimes &lt;code&gt;describe-&lt;/code&gt; or &lt;code&gt;apropos-&lt;/code&gt; are not enough. How can I search the Emacs Lisp Reference Manual (&lt;kbd&gt;C-h i m elisp&lt;/kbd&gt;) from within emacs?&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2014-10-07T02:45:54.600" LastActivityDate="2023-02-08T20:51:46.427" Title="How to search the Emacs Lisp Reference Manual?" Tags="|search|info|" AnswerCount="7" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="754" PostTypeId="2" ParentId="753" CreationDate="2014-10-07T03:34:10.193" Score="3" Body="&lt;p&gt;The closest I know of is searching the index by running &lt;code&gt;Info-virtual-index&lt;/code&gt; (bound to &lt;code&gt;I&lt;/code&gt;) from within the manual.&lt;/p&gt;&#xA;" OwnerUserId="146" LastActivityDate="2014-10-07T03:34:10.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="755" PostTypeId="2" ParentId="753" CreationDate="2014-10-07T04:05:29.360" Score="14" Body="&lt;p&gt;You can use &lt;code&gt;elisp-index-search&lt;/code&gt;. I use it daily.&#xA;I use it mostly when I already know a function name and want to see it in emacs lisp manual.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2014-10-07T04:12:42.687" LastActivityDate="2014-10-07T04:12:42.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="756" PostTypeId="2" ParentId="753" CreationDate="2014-10-07T04:52:29.283" Score="6" Body="&lt;p&gt;More of a full text search but &lt;kbd&gt;C-s&lt;/kbd&gt; (&lt;code&gt;isearch-forward&lt;/code&gt;) will search through the whole info document if you repeat enough times. I use it mostly as a desperation measure when I can't work out the actual term that appears in the index.&lt;/p&gt;&#xA;" OwnerUserId="541" LastActivityDate="2014-10-07T04:52:29.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="757" PostTypeId="2" ParentId="753" CreationDate="2014-10-07T05:27:08.447" Score="13" Body="&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I just found the wonderful &lt;code&gt;M-x info-apropos&lt;/code&gt; which searches full text over all info documents and returns the relevant nodes. Seems this gem is relatively unknown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;helm&lt;/code&gt; package from MELPA with &lt;code&gt;helm-mode&lt;/code&gt; on, using either &lt;code&gt;i (info-index)&lt;/code&gt; or &lt;code&gt;I (info-virtual-index)&lt;/code&gt; pops up a helm window with the index terms. You can then use typical helm completion patterns to discover and browse the index.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-10-07T06:16:47.627" LastActivityDate="2014-10-07T06:16:47.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="758" PostTypeId="2" ParentId="712" CreationDate="2014-10-07T07:04:04.773" Score="37" Body="&lt;p&gt;I've used autocomplete-mode for a good a few years and switched to company-mode a couple of months ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In basic usage there's not much of a difference. Like someone else posted &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/68&quot;&gt;this link&lt;/a&gt; has a good summary of the differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found company-mode to be easier to configure and to let it do what I want it to. With autocomplete-mode I ran into issues now and then of something not working the way I wanted it to and then something else falling over when tweaking it. In usage, I rarely feel company-mode is in the way when using Emacs while autocomplete-mode did get in the way now and then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, for developers it is easy to add support for their packages to company-mode, see: &lt;a href=&quot;http://www.emacswiki.org/emacs/CompanyMode#toc1&quot;&gt;EmacsWiki:CompanyMode:Backends&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are not compatible with each other. For now, there's more packages that support autocomplete-mode but that is changing fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tl;dr. They pretty much do the same thing. Start with company-mode and try autocomplete-mode if you miss anything from the former.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2014-10-07T07:04:04.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="759" PostTypeId="2" ParentId="712" CreationDate="2014-10-07T07:20:27.707" Score="41" Body="&lt;p&gt;They're pretty much equivalent, but &lt;code&gt;company-mode&lt;/code&gt; has a better thought-out API for plugin developers. It's also much more actively maintained. But there are two key differences which may or may not matter to you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, &lt;code&gt;company-mode&lt;/code&gt; now targets Emacs 24, so if you're stuck with Emacs 23 then you're out of luck. &lt;code&gt;auto-complete&lt;/code&gt; still works with Emacs 23.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, &lt;code&gt;auto-complete&lt;/code&gt; has a &quot;popup docs&quot; mechanism which displays a tool-tip-like yellow overlay in the current buffer showing info about the symbol at point. IIRC, &lt;code&gt;company-mode&lt;/code&gt; can pull in the same info, but it does it in a separate window right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/138&quot;&gt;an issue&lt;/a&gt; filed for that, and it seems likely that &lt;code&gt;company-mode&lt;/code&gt; will gain popup doc support, perhaps via an add-on package. Historically, such popup windows have been somewhat buggy, so it might be worth getting used to &lt;code&gt;company&lt;/code&gt;'s separate-window approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're starting afresh now, and you have Emacs 24, &lt;code&gt;company-mode&lt;/code&gt; is the way to go.&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2014-10-07T12:46:18.810" LastActivityDate="2014-10-07T12:46:18.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="761" PostTypeId="2" ParentId="723" CreationDate="2014-10-07T11:46:56.620" Score="19" Body="&lt;p&gt;**EDIT: **&#xA;Since this writing, it seems that part of the features have been directly implemented in markdown-mode. Check out this &lt;a href=&quot;https://emacs.stackexchange.com/questions/723/how-can-i-use-the-se-flavor-of-markdown-in-emacs/761#comment51750_761&quot;&gt;comment&lt;/a&gt;, and the links therein. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Configuration&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;There are two approaches you can take. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You can write a command that compiles the markdown code (using a&#xA;shell command) and displays the html in a buffer.&lt;/li&gt;&#xA;&lt;li&gt;You can make some customizations a-la org-mode to make the buffer &lt;em&gt;look&lt;/em&gt; like rendered markdown.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I explain here how to implement number 2. Simply copy all of the code&#xA;below to you init file.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Add the font-lock rules&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This variable controls how you want lists to look. It adds some space&#xA;to indent the list, and uses a pretty bullet-point (if your font can&#xA;display it).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar endless/bullet-appearance&#xA;  (propertize (if (char-displayable-p ?•) &quot;  •&quot; &quot;  *&quot;)&#xA;              'face 'markdown-list-face)&#xA;  &quot;String to be displayed as the bullet of markdown list items.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the command that actually adds the rules. There is one for lists and one for links.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'rx)&#xA;(defvar endless/markdown-link-regexp&#xA;    &quot;\\[\\(?1:[^]]+\\)]\\(?:(\\(?2:[^)]+\\))\\|\\[\\(?3:[^]]+\\)]\\)&quot;&#xA;  &quot;Regexp matching a markdown link.&quot;)&#xA;&#xA;(font-lock-add-keywords&#xA; 'markdown-mode&#xA; '((&quot;^ *\\(\\*\\|\\+\\|-\\|\\) &quot;&#xA;    1 `(face nil display ,endless/bullet-appearance) prepend)&#xA;   (endless/markdown-link-regexp&#xA;    1 '(face nil display &quot;&quot;) prepend))&#xA; 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Make the link editable&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Because we’re using the &lt;code&gt;display&lt;/code&gt; property to hide part of the link,&#xA;we need to tell font-lock that it should erase that property whenever&#xA;you delete part of the link (that way we can still edit it).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'markdown-mode-hook #'endless/markdown-font-lock)&#xA;&#xA;(defun endless/markdown-font-lock ()&#xA;  &quot;Configure aggressive font-locking of `markdown-mode'.&quot;&#xA;  (define-key markdown-mode-map &quot;\C-c\C-l&quot; #'endless/markdown-insert-link)&#xA;  (add-to-list (make-local-variable 'font-lock-extra-managed-props) 'display))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can also define a command to edit it easily, bound to &lt;code&gt;C-c C-l&lt;/code&gt;, like in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/markdown-insert-link ()&#xA;  &quot;Insert or edit link at point.&quot;&#xA;  (interactive)&#xA;  (if (or (looking-at endless/markdown-link-regexp)&#xA;          (and (ignore-errors (backward-up-list) t)&#xA;               (or (looking-at endless/markdown-link-regexp)&#xA;                   (and (forward-sexp -1)&#xA;                        (looking-at endless/markdown-link-regexp)))))&#xA;      (let ((data (endless/ask-for-link&#xA;                   (match-string-no-properties 1) &#xA;                   (or (match-string-no-properties 2)&#xA;                       (match-string-no-properties 3)))))&#xA;        (if (match-string-no-properties 2)&#xA;            (replace-match (cdr data) :fixedcase :literal nil 2)&#xA;          (replace-match (cdr data) :fixedcase :literal nil 3))&#xA;        (replace-match (car data) :fixedcase :literal nil 1))&#xA;    (let ((data (endless/ask-for-link)))&#xA;      (insert &quot;[&quot; (car data) &quot;](&quot; (cdr data) &quot;)&quot;))))&#xA;&#xA;(defun endless/ask-for-link (&amp;amp;optional name link)&#xA;  (cons (read-string &quot;Text of the link: &quot; name)&#xA;        (read-string &quot;URL of the link: &quot; link)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;(Optional) Configure some faces&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;That should be enough for the points you requested. If you want your&#xA;buffer to look &lt;em&gt;even more&lt;/em&gt; like SE markdown, call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-group RET markdown-faces&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and change what you see fit. I did some configuring myself, and here’s&#xA;what I got.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; '(markdown-header-face-1 ((t (:inherit markdown-header-face :height 2.0))))&#xA; '(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.7))))&#xA; '(markdown-header-face-3 ((t (:inherit markdown-header-face :height 1.4))))&#xA; '(markdown-header-face-4 ((t (:inherit markdown-header-face :height 1.1))))&#xA; '(markdown-inline-code-face ((t (:inherit font-lock-constant-face :background &quot;gainsboro&quot;))))&#xA; '(markdown-link-face ((t (:inherit link))))&#xA; '(markdown-pre-face ((t (:inherit font-lock-constant-face :background &quot;gainsboro&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Results&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Here’s what you’ll get after the first 2 set of configurations:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/nZpDd.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here’s what you’ll get after configuring faces as well. It’s arguable&#xA;whether this looks better, I’ll personally stick with the one above.&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/QDeO1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2017-07-17T12:04:47.850" LastActivityDate="2017-07-17T12:04:47.850" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="762" PostTypeId="1" AcceptedAnswerId="764" CreationDate="2014-10-07T12:46:28.573" Score="12" ViewCount="889" Body="&lt;p&gt;I've been looking at a way of detecting whether point is on a comment by looking at how the current buffer is fontified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Smartparens defines &lt;code&gt;sp-point-in-comment&lt;/code&gt;, which relies on &lt;code&gt;syntax-ppss&lt;/code&gt;. However, it seems that &lt;code&gt;syntax-ppss&lt;/code&gt; and &lt;code&gt;parse-partial-sexp&lt;/code&gt; can be used for arbitrary languages, even if they don't use s-expressions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this Python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 1&#xA;# I'm a comment&#xA;y = 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Placing point inside the comment and evaluating &lt;code&gt;(if (nth 4 (syntax-ppss)) 'comment 'not-comment)&lt;/code&gt; works correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does &lt;code&gt;syntax-ppss&lt;/code&gt; work for any programming mode? Why do the docstrings discuss s-expressions?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="50" LastEditDate="2014-10-07T15:50:01.507" LastActivityDate="2016-03-11T22:50:34.233" Title="For what languages is `syntax-ppss` appropriate?" Tags="|syntax-highlighting|parsing|syntax|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="763" PostTypeId="2" ParentId="720" CreationDate="2014-10-07T13:20:19.753" Score="1" Body="&lt;p&gt;If you’re using &lt;strong&gt;Emacs 24.4&lt;/strong&gt;, the code you’ve posted (which I’m repeating below) should be enough.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'edebug-mode-hook&#xA;          (lambda ()&#xA;            (set-fringe-mode&#xA;             (set (make-local-variable 'fringe-mode)&#xA;                  (if edebug-mode '(nil . 0) 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I’m positing this as answer for completeness, I understand it doesn’t&#xA;statisfy your needs. I tried to look a bit into &lt;code&gt;edebug&lt;/code&gt;’s source&#xA;code, to find a function I could advise and get a similar effect, but&#xA;failed.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;On Emacs 24.4&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.4 has been in feature freeze for a while now and is unlikely&#xA;to change very much until release. Plenty of people are using it daily, and I haven’t run into any problems whatsoever.&lt;br&gt;&#xA;I won’t go into how to install it, as that’s another question&#xA;entirely.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-07T13:20:19.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="764" PostTypeId="2" ParentId="762" CreationDate="2014-10-07T13:27:08.883" Score="14" Body="&lt;p&gt;Well, s-expressions are essentially “abstract syntax”, in the sense that they are merely a concrete syntax for abstract syntax trees, and thus any language can be represented as s-expressions, and manipulated with s-expression commands.  Hence, &lt;code&gt;syntax-ppss&lt;/code&gt; speaking of “Sexps” is simply the Lisp way to talk about abstract syntax trees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically, though, &lt;code&gt;syntax-ppss&lt;/code&gt; does not generally work for any mode.  It's fundamentally targeted at Lisp-like languages, and if the concrete language of a language deviates from Sexps too much, it doesn't make much sense anymore to use Sexp commands to manipulate the language.  It'd work, but there'd be too big a gap between the abstract representation and the concrete syntax, which would make most commands counter-intuitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, some of underlying infrastructure of &lt;code&gt;syntax-ppss&lt;/code&gt; is fairly generic.  Major modes typically try hard to plug into it, because it makes them work nicely with many built-in Emacs' features and provides a generic interface for other 3rd party packages such as Smartparens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notably, &lt;code&gt;syntax-ppss&lt;/code&gt; relies on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html&quot;&gt;Syntax Tables&lt;/a&gt; for strings and comments.  Syntax Tables categorize individual characters by their syntactic class.  There are classes for paired delimiters, string delimiters and comment characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The structure of strings and comments is fairly similar in almost all programming languages:  Strings are normally enclosed in special delimiters.  Comments can have special delimiters as well, or start with a certain character and extend to the end of the line.  These structures can easily be captured in syntax tables, and almost all major modes define appropriate syntax tables, if only to profit from Emacs' syntactic fortification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, &lt;code&gt;syntax-ppss&lt;/code&gt; works well for strings and comments in almost any language, but support and “usefulness” of other features varies.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-07T13:27:08.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="765" PostTypeId="2" ParentId="751" CreationDate="2014-10-07T13:50:09.273" Score="22" Body="&lt;p&gt;I basically have two frequent use cases for &lt;code&gt;multiple-cursors&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Replace some string. Mark one instance of a string, then use &lt;code&gt;mc/mark-next-like-this&lt;/code&gt; and &lt;code&gt;mc/mark-previous-like-this&lt;/code&gt; to mark more instances of it. I then immediately hit &lt;kbd&gt;C-w&lt;/kbd&gt; to delete every instance, and write a new string instead. I use this often to rename a variable in code.&lt;/li&gt;&#xA;&lt;li&gt;Edit several places simultaneously. Either mark several instances of a string like before, but cancel the selection (but not the cursors) immediately using &lt;kbd&gt;C-g&lt;/kbd&gt;, or place mark and point in the same column of different lines, and use &lt;code&gt;mc/edit-lines&lt;/code&gt; to get one cursor per line. You now can use regular editing commands that operate on every one of these cursors.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first use case is particularly useful with &lt;code&gt;expand-region&lt;/code&gt;. I have &lt;code&gt;er/expand-region&lt;/code&gt; bound to &lt;kbd&gt;C-j&lt;/kbd&gt;, and &lt;code&gt;mc/mark-next-like-this&lt;/code&gt; and &lt;code&gt;mc/mark-previous-like-this&lt;/code&gt; to &lt;kbd&gt;C-&gt;&lt;/kbd&gt; and &lt;kbd&gt;C-&amp;lt;&lt;/kbd&gt;. With that, I can easily select the word point is on, and mark the next/previous occurrence of that word instantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second use case replaced most uses of macros for me. Instead of recording a macro, and then applying that in several places, I would place a cursor on every place, and just do the operation in all places at once.&lt;/p&gt;&#xA;" OwnerUserId="80" LastEditorUserId="80" LastEditDate="2015-09-30T08:52:35.047" LastActivityDate="2015-09-30T08:52:35.047" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="766" PostTypeId="1" AcceptedAnswerId="769" CreationDate="2014-10-07T13:58:18.350" Score="28" ViewCount="4205" Body="&lt;p&gt;Often I find myself copying a code snippet into my operating system's clipboard from the internet.  Then, I take the following simple steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Switch to my Emacs window&lt;/li&gt;&#xA;&lt;li&gt;Find the place where I want to paste the code&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;C-y&lt;/code&gt; (&lt;code&gt;yank&lt;/code&gt;) to insert the copied text.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However, sometimes I find (to my great disappointment) that I unwittingly used some form of kill command (such as &lt;code&gt;kill-word&lt;/code&gt; or &lt;code&gt;kill-line&lt;/code&gt;) while I was on step 2.  In such cases, the copied text from the &quot;clipboard&quot; never makes it into the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to make sure that copied text from other applications always makes it into my kill ring?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I work in Linux most often, but I also use Emacs regularly on Windows and Mac OS X, so an OS-agnostic answer is preferred.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="25" LastEditDate="2014-10-08T21:02:26.493" LastActivityDate="2014-10-08T21:02:26.493" Title="Add operating system clipboard to kill ring" Tags="|copy-paste|clipboard|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="767" PostTypeId="1" CreationDate="2014-10-07T14:17:34.057" Score="16" ViewCount="605" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; is there a general way to detect whether or not point is inside a matched pair of characters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is: is there a general predicate function (or something) that can determine if point is in-between a matched pair or some arbitrarily-chosen characters?  I'm thinking about one that would evaluate to &lt;code&gt;t&lt;/code&gt; in, say, the following scenarios, with &lt;code&gt;!&lt;/code&gt; referring to point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;!&quot;   (quotes in general)&#xA;``!'' (LaTeX quotes)&#xA;$!$   (LaTeX math)&#xA;(!)   (lisp parens)&#xA;*!*   (org emphasis)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;: &lt;code&gt;syntax-ppss&lt;/code&gt; seems to be a good starting point, but it's not clear to me how one would adapt it to multi-character matched pairs (eg, the ``LaTeX quotes'', or even matched &lt;code&gt;&amp;lt;b&amp;gt;html tags&amp;lt;/b&amp;gt;&lt;/code&gt;).  I'm wondering if there's a general solution, or if it would require a purpose-built parser.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-08-13T14:00:47.420" LastActivityDate="2015-08-13T14:00:47.420" Title="how to detect if inside a matched pair?" Tags="|elisp|syntax|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="768" PostTypeId="2" ParentId="468" CreationDate="2014-10-07T14:24:15.703" Score="3" Body="&lt;p&gt;The command &lt;code&gt;helm-toggle-suspend-update&lt;/code&gt; is bound to &lt;code&gt;C-!&lt;/code&gt; by default.  It does not close helm, or end the recursive update, but it temporarily makes helm-mode much less &quot;invasive.&quot;  Suspending updates will keep helm from &quot;stealing&quot; all of your keyboard and mouse input, which can allow you to debug the helm process in another window.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-07T14:24:15.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="769" PostTypeId="2" ParentId="766" CreationDate="2014-10-07T14:40:28.517" Score="33" Body="&lt;p&gt;You need to customize &lt;code&gt;save-interprogram-paste-before-kill&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. This will push your clipboard onto the killring in case you kill something in emacs before pasting the clipboard. A related customization is &lt;code&gt;yank-pop-change-selection&lt;/code&gt; which pushes your current yank in emacs onto the clipboard. For both of these to work, you need &lt;code&gt;x-select-enable-clipboard&lt;/code&gt; (replaced by &lt;code&gt;gui-select-enable-clipboard&lt;/code&gt; in emacs 25.1) to be &lt;code&gt;t&lt;/code&gt; which is default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this is turned off by default is to prevent inadvertant pushing of large amount of data onto the killring which persists through out the session unlike the clipboard which is easily replaced.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-07T14:40:28.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="770" PostTypeId="1" AcceptedAnswerId="865" CreationDate="2014-10-07T14:50:00.577" Score="3" ViewCount="496" Body="&lt;p&gt;I'm using org-babel to generate a result I want to export in my table. However I can't find a way to easily control the heading of the table. At the moment the best I can manage is echo'ing some CSV data in my SRC. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: size-of-tcg&#xA;#+BEGIN_SRC sh :dir ~/lsrc/qemu/qemu.git/ :results output table :exports results&#xA;EXCL_SPEC='-and -not -iname &quot;kvm*&quot; -and -not -iname &quot;gdb*&quot; -and -not -iname &quot;machine.c&quot;'&#xA;echo &quot;arch, language, lines of code&quot;&#xA;eval find target-i386/ -xtype f ${EXCL_SPEC} &amp;gt; /tmp/cloc-files&#xA;cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d&quot;,&quot; -f2,5 | sed s/^/i386,/&#xA;eval find target-sparc/ -xtype f ${EXCL_SPEC} &amp;gt; /tmp/cloc-files&#xA;cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d&quot;,&quot; -f2,5 | sed s/^/ppc,/&#xA;eval find target-arm/ -xtype f ${EXCL_SPEC} &amp;gt; /tmp/cloc-files&#xA;cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d&quot;,&quot; -f2,5 | sed s/^/arm,/&#xA;echo &quot; , Total, &quot;&#xA;#+END_SRC&#xA;#+CAPTION: TCG Code for various target-*&#xA;#+ATTR_HTML: :border 2 :rules all :frame border :width 90%&#xA;#+RESULTS: size-of-tcg&#xA;| arch | language     | lines of code |&#xA;| i386 | C            |         17032 |&#xA;| i386 | C/C++ Header |          4086 |&#xA;| ppc  | C            |         10483 |&#xA;| ppc  | C/C++ Header |           834 |&#xA;| arm  | C            |         28941 |&#xA;| arm  | C/C++ Header |          1962 |&#xA;|      | Total        |         63338 |&#xA;#+TBLFM: @8$3=vsum(@2$3..@7$3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to do this?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-10-08T11:47:00.537" Title="Adding table headings to #+RESULTS: tables" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="771" PostTypeId="2" ParentId="767" CreationDate="2014-10-07T15:01:34.600" Score="16" Body="&lt;p&gt;&lt;code&gt;syntax-ppss&lt;/code&gt; might be of help here.  It &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Parsing.html&quot;&gt;returns a list&lt;/a&gt; that also has these elements:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;element 0: depth in parens&lt;/li&gt;&#xA;&lt;li&gt;element 3: non-nil if inside a string&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You could use it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(or (&amp;gt; (nth 0 (syntax-ppss)) 0)&#xA;    (nth 3 (syntax-ppss)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With a properly set up syntax-table in the buffer (for strings and matching parens) the function should do what you expect.  If using the mode's syntax-table is not possible than you could resort to using &lt;code&gt;with-syntax-table&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="330" LastActivityDate="2014-10-07T15:01:34.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="772" PostTypeId="2" ParentId="767" CreationDate="2014-10-07T15:06:13.907" Score="2" Body="&lt;p&gt;If you want for example to check if between curly braces, use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(and (looking-back &quot;{&quot;) (looking-at &quot;}&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sure, you can replace the curly braces by whatever you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more useful function will be something close to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-inside-curly-braces ()&#xA; (interactive)&#xA; (when (and (looking-back &quot;{\\(.*?\\)&quot;) (looking-at &quot;\\(.*?\\)}&quot;))&#xA;  (message &quot;inside curly braces&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-10-07T17:32:44.823" LastActivityDate="2014-10-07T17:32:44.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="773" PostTypeId="2" ParentId="751" CreationDate="2014-10-07T17:06:23.047" Score="25" Body="&lt;p&gt;In addition to the uses @bastibe describes, I use multiple cursors to add or remove text from the beginning/end of a group of lines:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Move point to the beginning or end of the area of interest&lt;/li&gt;&#xA;&lt;li&gt;call &lt;code&gt;set-rectangular-region-anchor&lt;/code&gt; (bound to whatever key you like, I think the suggestion from Magnars was &lt;kbd&gt;H-space&lt;/kbd&gt;, if you have a hyper key)&lt;/li&gt;&#xA;&lt;li&gt;Moved point forward or backwards by line (&lt;code&gt;C-n&lt;/code&gt; and &lt;code&gt;C-p&lt;/code&gt;) until you have a cursor on every line you want to edit&lt;/li&gt;&#xA;&lt;li&gt;Insert or delete text as needed, optionally moving to the end of the line (&lt;code&gt;C-e&lt;/code&gt;) to make changes there.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;You can use &lt;code&gt;forward-word&lt;/code&gt;, &lt;code&gt;forward sentence&lt;/code&gt; etc to move back and forth along the lines, which allows you to edit the fourth word in each line, even if the text on each line isn't identical.&lt;/p&gt;&#xA;&lt;p&gt;As an example, I do this sort of work all the time:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;C-u M-!&lt;/kbd&gt;ls /test-dat/pp5/*fsa&lt;kbd&gt;RETURN&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;p&gt;This inserts the contens of the pp5 directory into the buffer. I place point &lt;code&gt;!&lt;/code&gt; at the start of the listing:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;→&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;!/test-dat/pp5/ONAB-6-5_Frag#89.fsa&#xA;/test-dat/pp5/QCJB-22-5_Frag#90.fsa&#xA;/test-dat/pp5/ONGL-1-5_Frag#102.fsa&#xA;/test-dat/pp5/ONGL-1-5_Frag#78.fsa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Add cursors to every line with &lt;kbd&gt;H-space&lt;/kbd&gt;, &lt;kbd&gt;C-n&lt;/kbd&gt; x 4&lt;/li&gt;&#xA;&lt;li&gt;duplicate each line with &lt;kbd&gt;C-k&lt;/kbd&gt; &lt;kbd&gt;C-y&lt;/kbd&gt; &lt;kbd&gt;space&lt;/kbd&gt; &lt;kbd&gt;C-y&lt;/kbd&gt; &lt;kbd&gt;C-a&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;→&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;!/test-dat/pp5/ONAB-6-5_Frag#89.fsa /test-dat/pp5/ONAB-6-5_Frag#89.fsa&#xA;!/test-dat/pp5/QCJB-22-5_Frag#90.fsa /test-dat/pp5/QCJB-22-5_Frag#90.fsa&#xA;!/test-dat/pp5/ONGL-1-5_Frag#102.fsa /test-dat/pp5/ONGL-1-5_Frag#102.fsa&#xA;!/test-dat/pp5/ONGL-1-5_Frag#78.fsa /test-dat/pp5/ONGL-1-5_Frag#78.fsa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;trim the first section into variable names with &lt;kbd&gt;M-d&lt;/kbd&gt; x 3 &lt;kbd&gt;C-d&lt;/kbd&gt; &lt;kbd&gt;C-f&lt;/kbd&gt; x3 &lt;kbd&gt;M-d&lt;/kbd&gt; x3 &amp;lt;-&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;→&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;ONAB-6-5 &amp;lt;-! /test-dat/pp5/ONAB-6-5_Frag#89.fsa&#xA;QCJB-22-5 &amp;lt;-! /test-dat/pp5/QCJB-22-5_Frag#90.fsa&#xA;ONGL-1-5 &amp;lt;-! /test-dat/pp5/ONGL-1-5_Frag#102.fsa&#xA;ONGL-1-5 &amp;lt;-! /test-dat/pp5/ONGL-1-5_Frag#78.fsa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;then wrap the actual file name in the function to load it: read.file( &lt;kbd&gt;C-d&lt;/kbd&gt;&amp;quot;&lt;kbd&gt;C-e&lt;/kbd&gt;&amp;quot;)&lt;kbd&gt;RETURN&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;→&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;ONAB-6-5 &amp;lt;- read.file(&amp;quot;/test-dat/pp5/ONAB-6-5_Frag#89.fsa&amp;quot;)&#xA;QCJB-22-5 &amp;lt;- read.file(&amp;quot;/test-dat/pp5/QCJB-22-5_Frag#90.fsa&amp;quot;)&#xA;ONGL-1-5 &amp;lt;- read.file(&amp;quot;/test-dat/pp5/ONGL-1-5_Frag#102.fsa&amp;quot;)&#xA;ONGL-1-5 &amp;lt;- read.file(&amp;quot;/test-dat/pp5/ONGL-1-5_Frag#78.fsa&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And voila, you have converted a file listing into the code to read that listing. It's actually much harder to describe than to actually do!&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-07-29T10:21:55.423" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="774" PostTypeId="1" AcceptedAnswerId="1040" CreationDate="2014-10-07T17:44:06.803" Score="11" ViewCount="1032" Body="&lt;p&gt;Sometimes it is convenient to set a manual column width when creating a table in org-mode.  This makes it so that columns do not have to grow to the size of their longest entry.  When an entry in and org-mode table is longer than the column it is found in, the entry gets visually truncated with a &lt;code&gt;=&amp;gt;&lt;/code&gt; symbol at the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can do &lt;code&gt;C-c `&lt;/code&gt; to use &lt;code&gt;org-table-edit-field&lt;/code&gt;, but this requires pressing &lt;code&gt;C-c C-c&lt;/code&gt; to close the preview window and get back to the org-mode buffer.  Calling the same command with a prefix argument &lt;code&gt;C-u C-c `&lt;/code&gt; makes the full field visible so that it can be edited in place, but it is still tedious if I want to quickly preview 5-10 fields in quick succession. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;LibreOffice Calc has a preview field at the top of a spreadsheet (so does MS Excel) which shows the value of the currently selected field:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LlN3T.png&quot; alt=&quot;preview field in LibreOffice Calc&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is it possible to get a similar preview when editing an org-mode table?&lt;/strong&gt;  The minibuffer seems like one good place for it, although it might have the side effect of filling up the &lt;code&gt;*Messages*&lt;/code&gt; buffer quickly. A dedicated mini window at the top or bottom of the buffer would also work.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2019-10-05T14:04:01.907" Title="Preview fields in org table" Tags="|org-mode|org-table|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="775" PostTypeId="1" AcceptedAnswerId="778" CreationDate="2014-10-07T18:59:24.240" Score="13" ViewCount="620" Body="&lt;p&gt;This question has confounded me ever since I was a freshman in college trying to subtly bludgeon my way through Dunnet in the lab without my professor noticing. &lt;strong&gt;Why in the world does emacs come with games and amusements?&lt;/strong&gt; Why include games in a text editor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this question, I'm looking for an accurate historical summary. Were there games present in emacs from the very beginning? Were silly amusements always intended as a feature? Did someone package the very first included game in as a joke and everyone ran with it? Is it a mystery lost to the sands of time?&lt;/p&gt;&#xA;" OwnerUserId="547" LastActivityDate="2018-01-28T02:16:43.507" Title="Why does emacs come packaged with games and amusements?" Tags="|package|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="777" PostTypeId="1" AcceptedAnswerId="915" CreationDate="2014-10-07T19:31:13.360" Score="16" ViewCount="1935" Body="&lt;p&gt;When writing lisp codes, sometimes I'm deep in a nested expression and all I want is to insert all the missing closing parenthesis. Right now I'm just inserting them until I get a mismatched paren, but it's not very efficient.&lt;br&gt;&#xA;&lt;strong&gt;Is there any command to insert all the missing parentheses?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, I'm using smartparens to automatically insert matching parens. Still, sometimes I just need to do this.&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="50" LastEditDate="2014-10-07T20:16:20.573" LastActivityDate="2021-11-08T13:21:21.160" Title="Closing all pending parenthesis" Tags="|development|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="778" PostTypeId="2" ParentId="775" CreationDate="2014-10-07T19:38:58.457" Score="19" Body="&lt;p&gt;I think the only honest answer is &quot;because we can&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to history, the first entry &lt;code&gt;lisp/play/studly.el&lt;/code&gt; for the GNU Emacs repository was created in 1986. Then over the years, a few additions were made, including &lt;code&gt;yow.el&lt;/code&gt; by RMS in 1990.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hacker spirit has always been very compatible with (silly) games, and using software (like Emacs) for something that it wasn't initially intended to do, even more so (does anybody remember that Emacs is a text editor at the core ?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line, don't over-think it, it's just the way it is :)&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-07T19:38:58.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="779" PostTypeId="2" ParentId="762" CreationDate="2014-10-07T19:47:05.003" Score="4" Body="&lt;p&gt;Adding to @lunaryorn's answer, I think syntax-ppss just rely on the robustness of emacs's syntax table system, which works for comment and string in most languages. But if the language has syntax that syntax table can't capture, and if the mode did't build a parser to add syntax properties to the right places, &lt;code&gt;syntax-ppss&lt;/code&gt; would fail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this in &lt;code&gt;html-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;p class=&quot;aa&quot; id='bb'&amp;gt;&quot;cc&quot; 'dd'&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and call the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun inside-string-p (&amp;amp;optional pos)&#xA;  &quot;Return non-nil if inside string, else nil.&#xA;This depends on major mode having setup syntax table properly.&quot;&#xA;  (interactive)&#xA;  (let ((result (nth 3 (syntax-ppss pos))))&#xA;    (print result)&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Only aa is true, but bb should also be true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When in &lt;code&gt;nxml-mode&lt;/code&gt;, none of it returns true, but at least aa should be true.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="115" LastEditDate="2016-03-11T22:50:34.233" LastActivityDate="2016-03-11T22:50:34.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="780" PostTypeId="1" AcceptedAnswerId="781" CreationDate="2014-10-07T19:47:17.387" Score="1" ViewCount="847" Body="&lt;p&gt;Is there a popup input dialogue box for Emacs, which returns the string that a user enters? Maybe something that can be launched through the mini-buffer? Or through an elisp command/function? &lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2017-04-20T14:21:13.223" LastActivityDate="2017-04-20T14:21:13.223" Title="Interactive pop-up dialog?" Tags="|interactive|popup|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="781" PostTypeId="2" ParentId="780" CreationDate="2014-10-07T19:56:55.753" Score="3" Body="&lt;p&gt;&lt;code&gt;yes-or-no-p&lt;/code&gt; provides this for yes/no answers (and it's often used cousin &lt;code&gt;y-or-no-p&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Several arguments to the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;interactive&lt;/code&gt;&lt;/a&gt; macro can allow prompting for arguments when a function is called interactively (using &lt;kbd&gt;M-x&lt;/kbd&gt; to call the function, binding a key to the function, or using &lt;code&gt;call-interactively&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the documentation for &lt;code&gt;interactive&lt;/code&gt; above, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;read-string&lt;/code&gt;&lt;/a&gt; will prompt the minibuffer for a string and return it to the caller.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-Completion.html#Minibuffer-Completion&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;completing-read&lt;/code&gt;&lt;/a&gt; can be used to prompt the user with options for completion. For instance, &lt;code&gt;switch-to-buffer&lt;/code&gt; and &lt;code&gt;find-file&lt;/code&gt; use wrapper functions around &lt;code&gt;completing-read&lt;/code&gt; that provide a list of current buffers or the files in the current directory as candidate completions. &lt;code&gt;completing-read&lt;/code&gt; then uses that list of candidates to prompt the user on what file or buffer to open.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-10-07T20:22:53.397" LastActivityDate="2014-10-07T20:22:53.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="782" PostTypeId="2" ParentId="11" CreationDate="2014-10-07T20:01:29.960" Score="4" Body="&lt;p&gt;If you have &lt;code&gt;cua-mode&lt;/code&gt; enabled, then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-a&lt;/kbd&gt; to move to beginning of line,&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-RET&lt;/kbd&gt; to start rectangle,&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;↓&lt;/kbd&gt; (down key) twice to move to third line,&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;I said&lt;/code&gt; as text to be inserted&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-RET&lt;/kbd&gt; to end rectangle&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I prefer the &lt;code&gt;cua-mode&lt;/code&gt; way of working, compared to the Emacs standard rectangle where the equivalent would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-a&lt;/kbd&gt; to move to beginning of line,&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-SPC&lt;/kbd&gt; to start rectangle,&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;↓&lt;/kbd&gt; (down key) twice to move to third line,&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x r t&lt;/kbd&gt; &lt;code&gt;I said&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to insert text&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;cua-mode&lt;/code&gt; saves two key presses compared to standard Emacs rectangle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for me, the additional advantage of cua-mode is that I can &lt;em&gt;append&lt;/em&gt; text to the rectangle (I personally to do not know how to &lt;em&gt;append&lt;/em&gt; text with standard Emacs rectangle). With cua-mode, it is one &lt;kbd&gt;RET&lt;/kbd&gt; key press only, inputed before the &lt;code&gt;I said&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="555" LastActivityDate="2014-10-07T20:01:29.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="783" PostTypeId="5" CreationDate="2014-10-07T20:02:57.607" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-07T20:02:57.607" LastActivityDate="2014-10-07T20:02:57.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="784" PostTypeId="4" CreationDate="2014-10-07T20:02:57.607" Score="0" Body="Editing is a generic term for updating a file, document, or page." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-08T13:03:05.840" LastActivityDate="2014-10-08T13:03:05.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="785" PostTypeId="2" ParentId="780" CreationDate="2014-10-07T20:06:13.967" Score="1" Body="&lt;p&gt;interactive has several &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html#Interactive-Codes&quot; rel=&quot;nofollow&quot;&gt;code characters&lt;/a&gt; which can be what you are looking for. If you write a function, you can specify that the user needs to provide a plain string, a buffer name, etc. All from the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to provide completion look at &lt;code&gt;ido-completing-read&lt;/code&gt;, from &lt;a href=&quot;http://www.emacswiki.org/InteractivelyDoThings&quot; rel=&quot;nofollow&quot;&gt;ido&lt;/a&gt;, to request user input anywhere in your function (and it's easy to use IMHO).&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-10-07T20:06:13.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="786" PostTypeId="5" CreationDate="2014-10-07T20:08:50.667" Score="0" Body="&lt;p&gt;Yanking means reinserting text previously killed. The usual way to move or copy text is to kill it and then yank it elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y&lt;/code&gt;:Yank the last kill into the buffer, at point (yank).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-y&lt;/code&gt;: Replace the text just yanked with an earlier batch of killed text (yank-pop).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Yanking.html&quot; rel=&quot;nofollow&quot;&gt;from the Emacs manual&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-07T10:46:04.370" LastActivityDate="2014-11-07T10:46:04.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="787" PostTypeId="4" CreationDate="2014-10-07T20:08:50.667" Score="0" Body="Emacs' name for 'paste' (the one that goes together with copy). " OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-07T10:46:30.990" LastActivityDate="2014-11-07T10:46:30.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="788" PostTypeId="2" ParentId="408" CreationDate="2014-10-07T20:12:58.937" Score="36" Body="&lt;p&gt;I keep my .emacs.d directory in version control. Then, in my init.el and subsequent files I use &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;use-package&lt;/a&gt; to define package setup. Not only does use-package lazily load your packages, it will download them on demand if they don't exist from whatever package repos you've set up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I use go-mode, but not on every machine. In my init.el I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package go-mode&#xA;  :ensure t&#xA;  :config&#xA;  (progn&#xA;    (defun my-go-mode-hook ()&#xA;      (linum-mode t)&#xA;      (setq tab-width 4)&#xA;      (add-hook 'before-save-hook 'gofmt-before-save))&#xA;    (add-hook 'go-mode-hook 'my-go-mode-hook)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This adds a mode hook, but more importantly, by specifying &lt;code&gt;:ensure t&lt;/code&gt; it will download the package on demand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To keep a machine in sync, you can just checkout or pull from the repo and start up Emacs. Any new packages will be downloaded and installed. &lt;/p&gt;&#xA;" OwnerUserId="559" LastEditorUserId="97" LastEditDate="2018-02-28T23:19:23.307" LastActivityDate="2018-02-28T23:19:23.307" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="789" PostTypeId="2" ParentId="18" CreationDate="2014-10-07T20:15:11.780" Score="5" Body="&lt;p&gt;If you have &lt;code&gt;cua-mode&lt;/code&gt; enabled, then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-a&lt;/kbd&gt; to move to beginning of line,&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-RET&lt;/kbd&gt; to start rectangle,&lt;/li&gt;&#xA;&lt;li&gt;Then move with arrow keys or any emacs move command like &lt;kbd&gt;C-f&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;DEL&lt;/kbd&gt; to delete selection&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I prefer the &lt;code&gt;cua-mode&lt;/code&gt; way of working, compared to the Emacs standard rectangle where the equivalent would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-a&lt;/kbd&gt; to move to beginning of line,&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-SPC&lt;/kbd&gt; to start rectangle,&lt;/li&gt;&#xA;&lt;li&gt;Then move with arrow keys or any emacs move command like &lt;kbd&gt;C-f&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x r d&lt;/kbd&gt; to delete selection&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;cua-mode&lt;/code&gt; saves three key presses compared to standard Emacs rectangle.&lt;/p&gt;&#xA;" OwnerUserId="555" LastActivityDate="2014-10-07T20:15:11.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="790" PostTypeId="2" ParentId="753" CreationDate="2014-10-07T20:15:33.833" Score="2" Body="&lt;p&gt;In addition to what others have mentioned, &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; facilitates browsing and searching Info manuals.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Remember that &lt;code&gt;i&lt;/code&gt; (&lt;code&gt;Info-index&lt;/code&gt;) is your friend in Info. Start your search with it. It is typically more useful than a brute-force text search, because a human has indexed useful terms.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately, although &lt;code&gt;i&lt;/code&gt; in vanilla index accepts a substring of an index entry as input (using &lt;code&gt;RET&lt;/code&gt;), it does not provide substring, let along regexp, &lt;em&gt;completion&lt;/em&gt;. In &lt;em&gt;Icicle&lt;/em&gt; mode, &lt;code&gt;i&lt;/code&gt; in Info is bound to &lt;code&gt;icicle-Info-index&lt;/code&gt;, which provides such completion, and it also lets you filter using multiple patterns (&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow noreferrer&quot;&gt;progressive completion&lt;/a&gt;). It is also a &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow noreferrer&quot;&gt;multi-command&lt;/a&gt;, which means that with a single &lt;code&gt;i&lt;/code&gt; invocation you can visit any number of occurrences for any number of index entries.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;strong&gt;Icicles&lt;/strong&gt;, you can optionally have &lt;code&gt;i&lt;/code&gt; and other Info commands &lt;em&gt;highlight&lt;/em&gt; a bit differently, in buffer &lt;code&gt;*Completions*&lt;/code&gt;, completion candidates that correpond to Info &lt;em&gt;nodes that you have already visited&lt;/em&gt;.  This is handy to avoid revisiting a node that you have already consulted, when searching in different ways.  It helps especially with double-entry indexing, that is, multiple index entries to the same node.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In addition to index lookup, you can &lt;em&gt;search&lt;/em&gt; an Info manual. In vanilla Emacs you can use &lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;C-M-s&lt;/code&gt; repeatedly to do this. This can be handy in cases where &lt;code&gt;i&lt;/code&gt; does give you the help you want.&lt;/p&gt;&#xA;&lt;p&gt;With &lt;strong&gt;Icicles&lt;/strong&gt;, you can limit searching to a particular set of nodes.  &lt;code&gt;g&lt;/code&gt; (&lt;code&gt;Info-goto-node&lt;/code&gt;) accepts &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Multi-Completions&quot; rel=&quot;nofollow noreferrer&quot;&gt;multi-completion&lt;/a&gt; input.  You can provide a pattern (regexp, substring, etc.) that matches node names or a pattern that matches node content, or both.  Matching a pattern against node content means searching manual content. The completion candidates shown in &lt;code&gt;*Completions*&lt;/code&gt; are the node names.&lt;/p&gt;&#xA;&lt;p&gt;You can search a set of nodes or an entire manual. After you choose one of the matching nodes to visit, you can use &lt;code&gt;C-M-s&lt;/code&gt; to find each match of the content-search pattern within the node. And just as for &lt;code&gt;i&lt;/code&gt;, &lt;code&gt;g&lt;/code&gt; is a &lt;em&gt;multi-command&lt;/em&gt;, which means that you can visit any number of nodes in a single &lt;code&gt;g&lt;/code&gt; invocation.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can create virtual books composed of different sets of nodes (even from different manuals), and save these persistently, for reuse later. Searching a smaller set of nodes (a sub-manual) can be faster.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Info_Enhancements&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for more info about &lt;strong&gt;Icicles&lt;/strong&gt; Info enhancements.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="14091" LastEditDate="2023-02-08T16:43:18.073" LastActivityDate="2023-02-08T16:43:18.073" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="791" PostTypeId="2" ParentId="774" CreationDate="2014-10-07T20:40:48.923" Score="8" Body="&lt;p&gt;If you put your cursor in the cell and hit &lt;code&gt;C-h .&lt;/code&gt; it'll show the help text for that cell in the echo area. The help text contains the full value as well as the other help text. Kind of noisy but it shows the value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;display-local-help&lt;/code&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Help-Echo.html&quot;&gt;Help Echo&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="567" LastActivityDate="2014-10-07T20:40:48.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="792" PostTypeId="5" CreationDate="2014-10-07T20:43:19.527" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://git-scm.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git&lt;/a&gt; is an open-source &lt;a href=&quot;http://stackoverflow.com/tags/dvcs/info&quot;&gt;distributed version control system&lt;/a&gt; (DVCS) with an emphasis on speed. Git was initially designed and developed by &lt;a href=&quot;http://en.wikipedia.org/wiki/Linus_Torvalds&quot; rel=&quot;nofollow noreferrer&quot;&gt;Linus Torvalds&lt;/a&gt; for Linux kernel development, now it is maintained by &lt;a href=&quot;http://git-blame.blogspot.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Junio Hamano&lt;/a&gt;. Every Git working directory contains a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many resources and tutorials available free online for Git beginners; see the bottom of this page for links to some of these resources.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;Characteristics&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Strong support for non-linear development&lt;/li&gt;&#xA;&lt;li&gt;Distributed development&lt;/li&gt;&#xA;&lt;li&gt;Compatibility with existing systems/protocols&lt;/li&gt;&#xA;&lt;li&gt;Efficient handling of large projects&lt;/li&gt;&#xA;&lt;li&gt;Cryptographic authentication of history&lt;/li&gt;&#xA;&lt;li&gt;Toolkit-based design&lt;/li&gt;&#xA;&lt;li&gt;Pluggable merge strategies&lt;/li&gt;&#xA;&lt;li&gt;Garbage accumulates unless collected&lt;/li&gt;&#xA;&lt;li&gt;Periodic explicit object packing&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;Data structures&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GEGy5.png&quot; alt=&quot;git - data workflow&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;External Links&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git-scm.com/book&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pro Git by Scott Chacon&lt;/a&gt; (free)&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Recommended chapters for beginners: 1-3, 6-6.5.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://chimera.labs.oreilly.com/books/1230000000561/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git Pocket Guide&lt;/a&gt; (free)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git-scm.com/docs/gittutorial&quot; rel=&quot;nofollow noreferrer&quot;&gt;Official Git Tutorial&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://git.wiki.kernel.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Official Git Wiki&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://jk.gs/git.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jan Krüger's mirror of the official Git documentation&lt;/a&gt;.&lt;/strong&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This is currently &lt;strong&gt;the most complete, comprehensive, and up-to-date&lt;/strong&gt; online version of the Git documentation.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://gitref.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git Reference&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/git/git/tree/v2.0.1/Documentation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git Documentation Source Code&lt;/a&gt;&lt;/strong&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This is guaranteed to be up-to-date, and have the most readable formatting.&lt;/li&gt;&#xA;&lt;li&gt;You can also view these docs using &lt;code&gt;man git&lt;/code&gt;, &lt;code&gt;git &amp;lt;command&amp;gt; --help&lt;/code&gt;, or &lt;code&gt;git help &amp;lt;command&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.kernel.org/pub/software/scm/git/docs/user-manual.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Official Git user manual&lt;/a&gt; (may be outdated)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git-scm.com/documentation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git-SCM documentation&lt;/a&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A simplified, but more up-to-date, copy of &lt;a href=&quot;https://www.kernel.org/pub/software/scm/git/docs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;the official reference&lt;/a&gt;. Not all documentation is entirely and properly rendered, however.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git.kernel.org/?p=git/git.git;a=summary&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git source code&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/git/git&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git source code mirror on GitHub&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Git_(software)&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git Wikipedia Article&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://marklodato.github.io/visual-git-guide/index-en.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Visual Git Reference&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git-scm.com/blog&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git-SCM Blog&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.atlassian.com/git/tutorial&quot; rel=&quot;nofollow noreferrer&quot;&gt;Atlassian Git Tutorials and Traning&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://eagain.net/articles/git-for-computer-scientists/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git for Computer Scientists&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;Internal Links&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h2&gt;Installation/Setup&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323764&quot;&gt;How to install Git&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;How do you set up Git?  Try to cover Linux, Windows, Mac, think 'client/server' mindset.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/1482824/setup-git-server-with-msysgit-on-windows&quot;&gt;Setup GIT Server with Msysgit on Windows&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#320140&quot;&gt;How do you create a new project/repository?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#316062&quot;&gt;How do you configure it to ignore files (.obj, .user, etc) that are not really part of the codebase?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Working with the code&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/1350157#1350157&quot;&gt;How do you get the latest code?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323906&quot;&gt;How do you check out code?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#316055&quot;&gt;How do you commit changes?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#319465&quot;&gt;How do you see what's uncommitted, or the status of your current codebase?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323898&quot;&gt;How do you destroy unwanted commits?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/1762631#1762631&quot;&gt;How do you compare two revisions of a file, or your current file and a previous revision?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/2114836#2114836&quot;&gt;How do you see the history of revisions to a file?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/323898#323898&quot;&gt;How do you undo (revert or reset) a commit?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Tagging, branching, releases, baselines&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#322967&quot;&gt;How do you 'mark' 'tag' or 'release' a particular set of revisions for a particular set of files so you can always pull that one later?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/816614#816614&quot;&gt;How do you branch?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/816636#816636&quot;&gt;How do you merge branches?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/5985070#5985070&quot;&gt;What is rebasing?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/1590791#1590791&quot;&gt;How do I track remote branches?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/1590803#1590803&quot;&gt;How can I create a branch on a remote repository?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/5977604#5977604&quot;&gt;How do I delete a branch on a remote repository?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/5968622#5968622&quot;&gt;Git workflow examples&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Git Clients&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323559&quot;&gt;msysgit&lt;/a&gt; - Cross platform, included with Git&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323559&quot;&gt;gitk&lt;/a&gt; - Cross platform history viewer, included with Git&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323559&quot;&gt;gitnub&lt;/a&gt; - Mac OS X&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323559&quot;&gt;gitx&lt;/a&gt; - Mac OS X history viewer&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323559&quot;&gt;smartgit&lt;/a&gt; - Cross platform, commercial, beta&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/322989#322989&quot;&gt;tig&lt;/a&gt; - console GUI for Linux&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/644129#644129&quot;&gt;qgit&lt;/a&gt; - GUI for Windows, Linux&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323559&quot;&gt;Git Extensions&lt;/a&gt; - package for Windows, includes friendly GUI&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sourcetreeapp.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SourceTree&lt;/a&gt; - A free Git &amp;amp; Mercurial client for Windows or Mac&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://dahlbyk.github.io/posh-git/&quot; rel=&quot;nofollow noreferrer&quot;&gt;posh-git&lt;/a&gt; - A Windows PowerShell environment for Git&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Any other common tasks a beginner should know?&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide/319465#319465&quot;&gt;Git Status tells you what you just did, what branch you have, and other useful information&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Other Git beginner's references&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://wiki.sourcemage.org/Git_Guide&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git guide&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git-scm.com/book&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pro Git - book by Scott Chacon&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www-cs-students.stanford.edu/~blynn/gitmagic/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git magic&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.youtube.com/playlist?list=PLg7s6cbtAD15HBa4C41jhT9YQs5bZumTE&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub video guides&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://help.github.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub guides&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git.or.cz/course/svn.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Git - SVN Crash Course&quot;&gt;Git - SVN Crash Course&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.newartisans.com/2008/04/git-from-the-bottom-up/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git from the bottom up&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gitready.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git ready&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ndpsoftware.com/git-cheatsheet.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git visual cheatsheet&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Gazler/githug&quot; rel=&quot;nofollow noreferrer&quot;&gt;Githug&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://try.github.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;tryGit&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://marklodato.github.com/visual-git-guide/index-en.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Visual Git Reference&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://think-like-a-git.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Think Like (a) Git&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.atlassian.com/git/tutorial&quot; rel=&quot;nofollow noreferrer&quot;&gt;Atlassian Git Tutorials and Traning&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://wiki.spheredev.org/Git_for_the_lazy&quot; rel=&quot;nofollow noreferrer&quot;&gt;Git for the Lazy&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://pcottle.github.io/learnGitBranching/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Learn Git Branch - Interactive Tutorial&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Delving into Git&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.eecs.harvard.edu/~cduan/technical/git/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Understanding Git conceptually&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Comparison of revision control software&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_revision_control_software&quot; rel=&quot;nofollow noreferrer&quot;&gt;Comparison of revision control software&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-08T13:02:49.503" LastActivityDate="2014-10-08T13:02:49.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="793" PostTypeId="4" CreationDate="2014-10-07T20:43:19.527" Score="0" Body="is for Emacs support of Git, the distributed version control system. Emacs `version-control` feature supports many systems besides Git. Additional extensions, such as `Magit`, also provide extensive Git support. Therefore use additional tags besides `git` for Git related questions." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-16T07:25:29.097" LastActivityDate="2017-02-16T07:25:29.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="794" PostTypeId="5" CreationDate="2014-10-07T20:44:33.780" Score="0" Body="&lt;h1&gt;Unicode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://unicode.org/&quot; rel=&quot;nofollow&quot;&gt;Unicode&lt;/a&gt; assigns each character a code point to act as a unique reference:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;U+0041 &lt;strong&gt;A&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;U+0042 &lt;strong&gt;B&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;U+0043 &lt;strong&gt;C&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;li&gt;U+039B &lt;strong&gt;Λ&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;U+039C &lt;strong&gt;Μ&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Unicode Transformation Formats&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UTFs describe how to encode code points as byte representations. The most common forms are UTF-8 (which encodes code points as a sequence of one, two, three or four bytes) and UTF-16 (which encodes code points as two or four bytes).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Code Point          UTF-8           UTF-16 (big-endian)&#xA;U+0041              41              00 41&#xA;U+0042              42              00 42&#xA;U+0043              43              00 43&#xA;...&#xA;U+039B              CE 9B           03 9B&#xA;U+039C              CE 9C           03 9C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Specification&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Unicode Consortium also defines standards for sorting algorithms, rules for capitalization, character normalization and other locale-sensitive character operations.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.unicode.org/versions/latest/&quot; rel=&quot;nofollow&quot;&gt;Latest Version of the Standard&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Identifying Characters&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.unicode.org/charts/&quot; rel=&quot;nofollow&quot;&gt;PDF charts&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://unicode.org/Public/UNIDATA/UnicodeData.txt&quot; rel=&quot;nofollow&quot;&gt;Character list&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For more general information, see the &lt;a href=&quot;https://secure.wikimedia.org/wikipedia/en/wiki/Unicode&quot; rel=&quot;nofollow&quot;&gt;Unicode article on Wikipedia&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-08T13:03:32.793" LastActivityDate="2014-10-08T13:03:32.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="795" PostTypeId="4" CreationDate="2014-10-07T20:44:33.780" Score="0" Body="Unicode is a standard for the encoding, representation and handling of text with the intention of supporting all the characters required for written text incorporating all writing systems, technical symbols and punctuation." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-30T21:56:03.250" LastActivityDate="2014-10-30T21:56:03.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="796" PostTypeId="5" CreationDate="2014-10-07T20:45:57.580" Score="0" Body="&lt;p&gt;This tag is about invoking compilers and other software build tools from within Emacs. For questions about compiling Emacs itself, see &lt;a href=&quot;/questions/tagged/build&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;build&amp;#39;&quot; rel=&quot;tag&quot;&gt;build&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="25" LastEditDate="2016-01-09T13:46:20.317" LastActivityDate="2016-01-09T13:46:20.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="797" PostTypeId="4" CreationDate="2014-10-07T20:45:57.580" Score="0" Body="Running compilers, and more generally building software from within Emacs." OwnerUserId="45" LastEditorUserId="25" LastEditDate="2016-01-09T13:46:20.317" LastActivityDate="2016-01-09T13:46:20.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="798" PostTypeId="1" AcceptedAnswerId="3960" CreationDate="2014-10-07T20:59:45.337" Score="37" ViewCount="2893" Body="&lt;p&gt;I see lots of folks posting animated GIF's showing off Emacs features, but I haven't seen a nice walk through on creating one. Is there any code that tries to link the keyframes of the gif to keypresses in Emacs? Is there any elisp packages or functions to automate the process? I'd love to be able to press a key to start recording, press it again to stop, and have it prompt for a filename to save the gif to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related question, is there a package for recording longer screencasts from within Emacs?&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="25" LastEditDate="2015-05-03T09:55:27.090" LastActivityDate="2015-08-17T18:57:16.833" Title="Recording a GIF screencast of Emacs" Tags="|images|screencast|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="799" PostTypeId="2" ParentId="774" CreationDate="2014-10-07T21:01:27.477" Score="9" Body="&lt;p&gt;Inspired by seth's answer, you may always display the tooltip text on the header line (which is a little-known mode line at the top of the window).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Execute the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default header-line-format (list '(:eval (help-at-pt-kbd-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, every time the text under the point has a tooltip property, it will be displayed on the header line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, org-table tooltips contain an annoying prefix with instructions, but it is an approximation to your problem.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2014-10-07T21:01:27.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="800" PostTypeId="2" ParentId="798" CreationDate="2014-10-07T21:15:52.090" Score="20" Body="&lt;p&gt;I posted a &lt;a href=&quot;http://www.reddit.com/r/emacs/comments/1yu2j0/generating_gifs_showing_emacs_features/&quot; rel=&quot;noreferrer&quot;&gt;similar question on /r/Emacs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For recording GIFs, your main options are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;byzanz-record:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# 12 second duration, top left corner, 700x800 pixel gif&#xA;$ byzanz-record -d 12 -x 0 -y 0 -w 900 -h 700 output.gif&#xA;# more documentation at https://wiki.ubuntu.com/CreatingScreencasts&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cockos.com/licecap/&quot; rel=&quot;noreferrer&quot;&gt;LICEcap&lt;/a&gt; (Windows and OS X)&lt;/li&gt;&#xA;&lt;li&gt;ffmpeg/avconv (avconv is a fork of ffmpeg):&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ avconv -y -video_size 200x100 -f x11grab -i :0.0+0,50 frame-%04d.gif&#xA;$ gifsicle --loop -O3 -d5 frame-*.gif &amp;gt; emacs.gif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To show keystrokes, you just need an application that shows keystrokes. &lt;a href=&quot;https://code.google.com/p/key-mon/&quot; rel=&quot;noreferrer&quot;&gt;key-mon&lt;/a&gt; provides a GUI app for this. There is, of course, an Emacs mode for showing keys pressed: &lt;a href=&quot;https://github.com/lewang/command-log-mode&quot; rel=&quot;noreferrer&quot;&gt;command-log-mode&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2015-01-24T18:59:14.690" LastActivityDate="2015-01-24T18:59:14.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="801" PostTypeId="1" AcceptedAnswerId="1010" CreationDate="2014-10-07T21:17:14.590" Score="50" ViewCount="73147" Body="&lt;p&gt;Emacs cannot compete with another other IDE if it doesn’t have an auto completion function. Auto-complete simply makes me a more efficient programmer. I know of the &lt;a href=&quot;http://cx4a.org/software/auto-complete/&quot; rel=&quot;noreferrer&quot;&gt;Auto Complete Mode extension&lt;/a&gt;, but it does not work with C++. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/rue4P.png&quot; alt=&quot;autocomplete&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve smart and efficient autocompletion for C++?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This question was originally asked by &lt;a href=&quot;https://emacs.stackexchange.com/users/50/malabarba&quot;&gt;Malabarba&lt;/a&gt; on the Area 51 proposal:&#xA;&lt;a href=&quot;http://area51.stackexchange.com/proposals/76571/emacs/76589#76589&quot;&gt;How to get intelligent auto-completion in C++?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-07-26T08:05:51.760" Title="How to get intelligent auto-completion in C++?" Tags="|c++|completion|" AnswerCount="6" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="802" PostTypeId="1" AcceptedAnswerId="803" CreationDate="2014-10-07T21:27:44.313" Score="3" ViewCount="784" Body="&lt;p&gt;I'd like magit to default to a large buffer instead of one that is half the size of the available space. Even better would be a way to wrap the call to a major mode to make this happen when opening any major mode?&lt;/p&gt;&#xA;" OwnerUserId="99" LastEditorUserId="105" LastEditDate="2014-12-21T03:53:54.810" LastActivityDate="2014-12-21T03:53:54.810" Title="How to get a major mode to open full screen" Tags="|elisp|window|major-mode|magit|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="803" PostTypeId="2" ParentId="802" CreationDate="2014-10-07T21:37:03.527" Score="4" Body="&lt;p&gt;Not sure about applying this in general but magit has a configuration variable for this, &lt;code&gt;magit-status-buffer-switch-function&lt;/code&gt;. By default it is set to &lt;code&gt;pop-to-buffer&lt;/code&gt; which prefers to open an alternate buffer, ie &lt;code&gt;other-window&lt;/code&gt; or split screen and &lt;code&gt;other-window&lt;/code&gt;. However, if you customize the value to &lt;code&gt;switch-to-buffer&lt;/code&gt; it will swap out the current buffer for &lt;code&gt;magit-status&lt;/code&gt;. Throw the following in your init file and it should open it in the current window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq magit-status-buffer-switch-function 'switch-to-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: It appears the general solution to this problem may be encoded in the documentation for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window.html#Choosing-Window&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;display-buffer&lt;/code&gt;&lt;/a&gt;, specifically &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window-Options.html#Choosing-Window-Options&quot; rel=&quot;nofollow&quot;&gt;Choosing Window&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html#Display-Action-Functions&quot; rel=&quot;nofollow&quot;&gt;Display Action Functions&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-07T21:37:03.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="804" PostTypeId="1" CreationDate="2014-10-07T21:44:03.197" Score="13" ViewCount="1144" Body="&lt;p&gt;It takes several seconds for Emacs org-mode to generate my agenda. How can I make it faster? I'm already using archive files, and I have less than 30 &lt;code&gt;.org&lt;/code&gt; files, all of them reasonably short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Partial profiler output of the &lt;code&gt;org-agenda&lt;/code&gt; command: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+ ...                                                              93  50%&#xA;- command-execute                                                  90  49%&#xA; - call-interactively                                              85  46%&#xA;  - org-agenda                                                     80  43%&#xA;   - byte-code                                                     80  43%&#xA;    - call-interactively                                           79  43%&#xA;     - org-agenda-list                                             79  43%&#xA;      - byte-code                                                  79  43%&#xA;       - org-agenda-prepare                                        68  37%&#xA;        - org-agenda-prepare-buffers                               67  36%&#xA;         - byte-code                                               67  36%&#xA;          - org-get-agenda-file-buffer                             67  36%&#xA;           - find-file-noselect                                    67  36%&#xA;            - find-file-noselect-1                                 67  36%&#xA;             - after-find-file                                     66  36%&#xA;              + run-hooks                                          35  19%&#xA;              + normal-mode                                        30  16%&#xA;              + auto-save-mode                                      1   0%&#xA;             + normal-backup-enable-predicate                       1   0%&#xA;        + org-agenda-files                                          1   0%&#xA;       + byte-code                                                 10   5%&#xA;         org-days-to-iso-week                                       1   0%&#xA;    + org-agenda-get-restriction-and-command                        1   0%   &#xA;  + byte-code                                                       4   2%   &#xA;  + minibuffer-complete                                             1   0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="594" LastEditorUserId="104" LastEditDate="2014-10-07T21:46:57.640" LastActivityDate="2014-10-08T09:16:55.417" Title="How do I speed up org-mode agenda generation" Tags="|org-mode|profiler|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="805" PostTypeId="1" CreationDate="2014-10-07T21:47:14.023" Score="9" ViewCount="2330" Body="&lt;p&gt;In the screenshot below I have simply set the background of the &lt;code&gt;linum&lt;/code&gt; face to some color, however there is a blank region at the end of the buffer and there are gaps between the lines when line wrapping (&lt;code&gt;global-visual-line-mode&lt;/code&gt;) is enabled:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/db8cr.png&quot; alt=&quot;Broken linum background with line wrap.&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally the whole left side should be in a uniform color. Is this possible? I know some Elisp, so if it’s possible, I could maybe write a fix myself with some instructions.&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="50" LastEditDate="2014-10-08T17:12:34.390" LastActivityDate="2014-10-08T17:23:17.213" Title="How can I fill the entire line number bar with a custom background color?" Tags="|customize|faces|linum-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="806" PostTypeId="1" AcceptedAnswerId="821" CreationDate="2014-10-07T21:51:17.000" Score="11" ViewCount="986" Body="&lt;p&gt;The &lt;code&gt;profiler-start&lt;/code&gt; command has options for &lt;code&gt;cpu&lt;/code&gt;, &lt;code&gt;mem&lt;/code&gt;, and &lt;code&gt;cpu+mem&lt;/code&gt;. Is there a way to profile a command by elapsed time?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="2688" LastEditDate="2014-12-16T13:03:28.950" LastActivityDate="2019-06-01T07:08:16.750" Title="Profile a command by wall time" Tags="|profiler|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="809" PostTypeId="2" ParentId="777" CreationDate="2014-10-07T22:15:20.213" Score="1" Body="&lt;p&gt;A very primitive (and almost certainly wrong) way to do that would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun buffer-needs-parens-fixing ()&#xA;  (save-excursion&#xA;    (condition-case nil&#xA;        (check-parens)&#xA;      (error (point)))))&#xA;&#xA;(defun buffer-fix-parens ()&#xA;  (interactive)&#xA;  (while (buffer-needs-parens-fixing)&#xA;    (insert &quot;)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Amongst other limitations, it assumes that all the parentheses that need inserting are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;closing ones&lt;/li&gt;&#xA;&lt;li&gt;needed at the current location&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I guess it might be just enough to be useful for your specific use-case&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-10-08T00:42:07.920" LastActivityDate="2014-10-08T00:42:07.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="810" PostTypeId="1" AcceptedAnswerId="815" CreationDate="2014-10-07T22:20:34.893" Score="5" ViewCount="1173" Body="&lt;p&gt;I'm using Projectile to index a Rails 4 project.  When I use &lt;kbd&gt;M&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; &lt;code&gt;projectile-find-file&lt;/code&gt; to locate files using their file name, some files simply don't appear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have a file located in &lt;code&gt;app/controllers/api/v1/test_controller.rb&lt;/code&gt;, but typing &lt;kbd&gt;M&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; &lt;code&gt;projectile-find-file&lt;/code&gt; &lt;kbd&gt;enter&lt;/kbd&gt;&lt;code&gt;test_controller&lt;/code&gt;&lt;kbd&gt;enter&lt;/kbd&gt; returns no results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to re-index the project, or figure out what's filtering out certain files?&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="104" LastEditDate="2014-10-07T22:37:06.457" LastActivityDate="2014-10-07T22:37:06.457" Title="Projectile not showing all files under my Git project" Tags="|project|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="811" PostTypeId="2" ParentId="293" CreationDate="2014-10-07T22:22:09.647" Score="1" Body="&lt;p&gt;I publish my .emacs.d, but use a subrepo with the private changes (passwords and such). To allow others to clone it, the default branch points to a placeholder subrepo, and every machine has its own named branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When merging between machines, I first &lt;code&gt;graft&lt;/code&gt; the new changes into the &lt;code&gt;default&lt;/code&gt; branch and then merge the &lt;code&gt;default&lt;/code&gt; branch into the other workplace branches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As example, you can find my .emacs.d &lt;a href=&quot;https://bitbucket.org/ArneBab/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;on bitbucket&lt;/a&gt;, including a readme with a short usage guide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to add the &lt;a href=&quot;http://orgmode.org/worg/org-contrib/gsoc2012/student-projects/git-merge-tool/manual.html#sec-4-4&quot; rel=&quot;nofollow&quot;&gt;org-mode merge driver&lt;/a&gt; to this setup.&lt;/p&gt;&#xA;" OwnerUserId="614" LastActivityDate="2014-10-07T22:22:09.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="812" PostTypeId="1" CreationDate="2014-10-07T22:25:08.793" Score="6" ViewCount="852" Body="&lt;p&gt;Occasionally I start to open a file, and before I select the file for some reason I execute &lt;kbd&gt;C-x o&lt;/kbd&gt; before answering the prompt. Then everytime I try and run &lt;code&gt;find-file&lt;/code&gt; again it complains about &lt;em&gt;Command attempted to use minibuffer while in minibuffer&lt;/em&gt;. However if I use a command like &lt;code&gt;isearch-forward-regexp&lt;/code&gt;, (even if already in a &lt;code&gt;find-file&lt;/code&gt; prompt), the error is not thrown and I can't switch back to the minibuffer using &lt;code&gt;other-window&lt;/code&gt;.&lt;br&gt;&#xA;&lt;strong&gt;Why is it that some prompts temporarily upgrade the minibuffer so that &lt;code&gt;other-window&lt;/code&gt; considers the minibuffer a possible target, and others do not?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Just to clarify, I’m not asking &lt;em&gt;how&lt;/em&gt; to get unstuck.&lt;br&gt;&#xA;Originally when I encountered this, I would switch to the minibuffer and do &lt;kbd&gt;Esc Esc Esc&lt;/kbd&gt; or &lt;kbd&gt;C-g&lt;/kbd&gt; to escape the prompt, so that I could initiate a new command that uses the minibuffer. However, on pondering this question, I realized that &lt;code&gt;abort-recursive-edit&lt;/code&gt; (&lt;kbd&gt;C-]&lt;/kbd&gt;) will close this minibuffer in progress without having to do &lt;code&gt;other-window&lt;/code&gt; + &lt;code&gt;keyboard-quit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, I'm not quite sure what the original use case is for. Perhaps, it’s meant to aid in copy pasting into a minibuffer prompt, or to assist running a command in the middle of a macro?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I &lt;em&gt;do&lt;/em&gt; want to know is if there is a way to disable this recursivity the way it is with &lt;code&gt;isearch&lt;/code&gt;. Is &lt;code&gt;isearch&lt;/code&gt; safe because it's using read-event instead of a blocking prompt? Is there a hook to trigger &lt;code&gt;abort-recursive-edit&lt;/code&gt; when exiting the minibuffer?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why do some minibuffer commands upgrade the minibuffer to a target for &lt;code&gt;other-window&lt;/code&gt;, and block running new minibuffer commands, while others, such as &lt;code&gt;isearch&lt;/code&gt;, do not?  &lt;/li&gt;&#xA;&lt;li&gt;Is there a way to disable this?&lt;/li&gt;&#xA;&lt;li&gt;What is this feature's intended use case?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="104" LastEditorUserId="50" LastEditDate="2014-10-13T10:45:23.723" LastActivityDate="2018-08-19T22:34:31.180" Title="Why do some commands terminate when leaving the minibuffer (isearch) while others don't (find-file)?" Tags="|minibuffer|recursive-edit|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="813" PostTypeId="2" ParentId="802" CreationDate="2014-10-07T22:26:20.427" Score="3" Body="&lt;p&gt;How about &lt;a href=&quot;https://github.com/tomterl/fullframe&quot; rel=&quot;nofollow&quot;&gt;fullframe&lt;/a&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From their docs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Open magit-status in a single window in fullscreen&#xA;(require 'fullframe)&#xA;(fullframe magit-status magit-mode-quit-window nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="623" LastActivityDate="2014-10-07T22:26:20.427" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="814" PostTypeId="2" ParentId="801" CreationDate="2014-10-07T22:27:05.653" Score="7" Body="&lt;p&gt;Solution 1:&#xA;company-mode + clang&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only issue is you need tell company-mode where to search your project's c/c++ header files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use cmake, you can let &lt;a href=&quot;https://github.com/redguardtoo/cpputils-cmake&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/redguardtoo/cpputils-cmake&lt;/a&gt; to do the setup for you (HINT: I'm the author of cpputils-cmake).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution 2:&#xA;company-mode + gnu global&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nothing more to say, you need build the tags with gnu global cli tool, as others mentioned. &lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2014-10-14T01:06:36.430" LastActivityDate="2014-10-14T01:06:36.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="815" PostTypeId="2" ParentId="810" CreationDate="2014-10-07T22:30:51.293" Score="6" Body="&lt;p&gt;The quick answer is to invalidate the &lt;a href=&quot;https://github.com/bbatsov/projectile#project-files&quot;&gt;projectile cache&lt;/a&gt;. When using &lt;code&gt;projectile-find-file&lt;/code&gt; if you use &lt;kbd&gt;C-u&lt;/kbd&gt; to send the universal argument before running the function, it will invalidate the cache before searching it. To match your example;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;kbd&gt;C-u M-x&lt;/kbd&gt; &lt;em&gt;projectile-find-file&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There are a number of other functions in projectile that use the prefix argument, check for any that call &lt;code&gt;projectile-maybe-invalidate-cache&lt;/code&gt; if the universal argument is present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally though, projectile provides &lt;code&gt;projectile-invalidate-cache&lt;/code&gt; which is by default bound to &lt;kbd&gt;C-c p i&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-07T22:30:51.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="817" PostTypeId="2" ParentId="293" CreationDate="2014-10-07T22:58:17.970" Score="1" Body="&lt;p&gt;After several iterations, I have determined that, while version control is great for sharing code and tracking changes, it's not a great solution for syncing a rapidly-changing configuration across computers. The reason is that there are many things that &lt;em&gt;should&lt;/em&gt; be synced and &lt;em&gt;should not&lt;/em&gt; be in version control. Some examples:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;.elc&lt;/code&gt; files (recompiling them when there's a configuration change is a major hassle, and bugs from outdated &lt;code&gt;elc&lt;/code&gt; files are often a pain to debug).&lt;/li&gt;&#xA;&lt;li&gt;The entire &lt;code&gt;elpa&lt;/code&gt; directory (and until version-pinning becomes standard, automatically rebuilding it just isn't reliable enough).&lt;/li&gt;&#xA;&lt;li&gt;Auto-generated files such as &lt;code&gt;eshell&lt;/code&gt; history and &lt;code&gt;gnus&lt;/code&gt; files.&lt;/li&gt;&#xA;&lt;li&gt;Private information such as passwords and API keys.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(Note that cross-platform issues aren't in the list--it should be perfectly fine to have one configuration that works across multiple operating systems.) Instead of using git as a syncing solution, I use it solely as a code tracking solution and sync using Dropbox. That way, all the annoying files that shouldn't be in version control are taken care of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;do&lt;/em&gt;, however, have a goal of having my configuration be rebuildable from source if my Dropbox configuration disappears for whatever reason, so I keep track of all the installed packages and whatnot in the source. My private information is stored in a git submodule as well. But for day-to-day syncing, git just isn't a great solution.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-10-07T22:58:17.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="819" PostTypeId="2" ParentId="766" CreationDate="2014-10-07T23:20:10.660" Score="3" Body="&lt;p&gt;another solution is just use cli tool if possible,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;pbcopy/pbpaste on Mac&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;getclip/putclip on Cygwin&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;xsel on Linux&lt;/li&gt;&#xA;&lt;li&gt;x-clipboard in GUI Emacs (as others mentioned, you need turn on the flag x-select-enable-clipboard).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The advantage of this solution is that the clipboard is always usable (for example, when you remote ssh).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My answer has two parts. part one introduce some handy tools to manipulate the clipboard. part two will answer your original question (store clipboard into kill ring).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;PART ONE&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Insert below code into your ~/.emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq *is-a-mac* (eq system-type 'darwin))&#xA;(setq *cygwin* (eq system-type 'cygwin) )&#xA;(setq *linux* (or (eq system-type 'gnu/linux) (eq system-type 'linux)) )&#xA;(defun copy-to-x-clipboard ()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (progn&#xA;        (cond&#xA;         ((and (display-graphic-p) x-select-enable-clipboard)&#xA;          (x-set-selection 'CLIPBOARD (buffer-substring (region-beginning) (region-end))))&#xA;         (t (shell-command-on-region (region-beginning) (region-end)&#xA;                                     (cond&#xA;                                      (*cygwin* &quot;putclip&quot;)&#xA;                                      (*is-a-mac* &quot;pbcopy&quot;)&#xA;                                      (*linux* &quot;xsel -ib&quot;)))&#xA;            ))&#xA;        (message &quot;Yanked region to clipboard!&quot;)&#xA;        (deactivate-mark))&#xA;        (message &quot;No region active; can't yank to clipboard!&quot;)))&#xA;&#xA;(defun paste-from-x-clipboard()&#xA;  (interactive)&#xA;  (cond&#xA;   ((and (display-graphic-p) x-select-enable-clipboard)&#xA;    (insert (x-selection 'CLIPBOARD)))&#xA;   (t (shell-command&#xA;       (cond&#xA;        (*cygwin* &quot;getclip&quot;)&#xA;        (*is-a-mac* &quot;pbpaste&quot;)&#xA;        (t &quot;xsel -ob&quot;))&#xA;       1))&#xA;   ))&#xA;&#xA;(defun my/paste-in-minibuffer ()&#xA;  (local-set-key (kbd &quot;M-y&quot;) 'paste-from-x-clipboard)&#xA;  )&#xA;&#xA;(add-hook 'minibuffer-setup-hook 'my/paste-in-minibuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;PART TWO&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;insert below code into your ~/.emacs, and from now on, use &quot;M-x paste-from-clipboard-and-cc-kill-ring&quot; to paste:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun paste-from-clipboard-and-cc-kill-ring ()&#xA;  &quot;paste from clipboard and cc the content into kill ring&quot;&#xA;  (interactive)&#xA;  (let (str)&#xA;    (with-temp-buffer&#xA;      (paste-from-x-clipboard)&#xA;      (setq str (buffer-string)))&#xA;    ;; finish the paste&#xA;    (insert str)&#xA;    ;; cc the content into kill ring at the same time&#xA;    (kill-new str)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2014-10-07T23:25:21.140" LastActivityDate="2014-10-07T23:25:21.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="820" PostTypeId="2" ParentId="804" CreationDate="2014-10-07T23:27:32.540" Score="9" Body="&lt;p&gt;I've created this workaround, which pregenerates an agenda buffer whenever Emacs is idle for more than 5 seconds. The next time the agenda command is run, generation takes less than a second, since the org buffers have already been loaded.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-idle-timer 5 nil (lambda () (org-agenda-list) (delete-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-10-07T23:27:32.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="821" PostTypeId="2" ParentId="806" CreationDate="2014-10-07T23:31:08.037" Score="7" Body="&lt;p&gt;I'm not sure if you can do that using &lt;em&gt;profiler.el&lt;/em&gt; as it is a sampling profiler. It's not actually measuring how long a function takes to run, it's periodically checking to see what function is currently being executed, and adding up all of those samples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ELP or the &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsLispProfiler&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsLispProfiler&lt;/a&gt; is an instrumenting compiler. To enable instrumentation use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;em&gt;elp-instrument-function&lt;/em&gt; on one or more functions. After running code that calls the instrumented functions, run &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;em&gt;elp-results&lt;/em&gt;. This will display a buffer showing the total number of calls and elapsed time for each instrumented function. Check out &lt;kbd&gt;M-x find-libary&lt;/kbd&gt; &lt;em&gt;elp&lt;/em&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know exactly what function you want to profile, the benchmark library might also be useful.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2019-06-01T07:08:16.750" LastActivityDate="2019-06-01T07:08:16.750" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="822" PostTypeId="1" CreationDate="2014-10-07T23:34:51.050" Score="20" ViewCount="9032" Body="&lt;p&gt;Every time I open up Emacs I tend to set up 3 windows by doing &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;3&lt;/kbd&gt; (&lt;code&gt;split-window-right&lt;/code&gt;) and then &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;2&lt;/kbd&gt; (&lt;code&gt;split-window-below&lt;/code&gt;). After that I have to switch to each window to open the files I want to edit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set this to be done automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have Emacs recover the same screen organization (windows and files) from last use?&lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="25" LastEditDate="2014-10-09T00:39:34.663" LastActivityDate="2017-10-12T13:25:03.387" Title="How to setup default windows at startup?" Tags="|window|init-file|session|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="823" PostTypeId="2" ParentId="728" CreationDate="2014-10-07T23:47:18.167" Score="68" Body="&lt;p&gt;I've recently started using &lt;code&gt;C-x &amp;lt;left&amp;gt;&lt;/code&gt; and &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt;. Those are both standard Emacs bindings—nothing to configure. Left takes you back to the previous buffer (initially the same as &lt;code&gt;C-x b RET&lt;/code&gt;) but doing it again takes you to the 3rd most recently visited buffer. If you're popping back and forth between 3 or 4 buffers a lot then I find it a lot easier than trying to remember buffer names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I just discovered &lt;code&gt;C-x C-&amp;lt;left&amp;gt;&lt;/code&gt; and &lt;code&gt;C-x C-&amp;lt;right&amp;gt;&lt;/code&gt; are bound to the same functions so that you can just hold down the control key and alternate between x and the arrows to flip through buffers. Pretty nice!&lt;/p&gt;&#xA;" OwnerUserId="638" LastActivityDate="2014-10-07T23:47:18.167" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="824" PostTypeId="2" ParentId="728" CreationDate="2014-10-07T23:47:28.043" Score="46" Body="&lt;p&gt;You could use &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;Helm&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my setup, I have switched &lt;code&gt;C-x b&lt;/code&gt; for &lt;code&gt;M-l&lt;/code&gt;. This allied with &lt;code&gt;helm-buffers-list&lt;/code&gt;, makes the process pretty fast, at least for me.&lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2014-10-07T23:47:28.043" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="825" PostTypeId="1" AcceptedAnswerId="831" CreationDate="2014-10-08T00:19:20.567" Score="10" ViewCount="3642" Body="&lt;p&gt;I'd like to check whether some (say, current) buffer is visiting a file or not.  I could say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (buffer-file-name) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it seems to be not very elegant - what I'm interested in is only the boolean value, not the actual &lt;em&gt;name&lt;/em&gt; of the buffer in question.  If the &lt;code&gt;buffer-file-name&lt;/code&gt; function were written in Elisp, I could look into its source to find out what it uses - but it is written in C, and while I could install the Emacs sources, I'm afraid that I wouldn't find an elisp name for the function that checks what I'm after there anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I need it for is I want to create a directory based on the name of the current buffer's file, and currently I'm doing more or less this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-directory (if (buffer-file-name) (file-name-base) &quot;default-dir&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, what would be the Elisp-idiomatic way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="642" LastEditorUserId="105" LastEditDate="2015-05-20T05:17:31.510" LastActivityDate="2017-07-20T07:51:25.063" Title="How to check whether a buffer is visiting a file?" Tags="|elisp|buffers|files|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="826" PostTypeId="2" ParentId="822" CreationDate="2014-10-08T00:21:51.350" Score="8" Body="&lt;p&gt;write a function close to that one in your init file, you will probably have to modify it a little bit to fit your needs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; layout definition&#xA;(defun my-startup-layout ()&#xA; (interactive)&#xA; (delete-other-windows)&#xA; (split-window-horizontally) ;; -&amp;gt; |&#xA; (next-multiframe-window)&#xA; (find-file &quot;~/.emacs.d/init.el&quot;)&#xA; (split-window-vertically) ;;  -&amp;gt; --&#xA; (next-multiframe-window)&#xA; (find-file &quot;~/.emacs.d/init_settings.el&quot;)&#xA; (next-multiframe-window)&#xA; (dired &quot;~&quot;)&#xA;)&#xA;&#xA;;; execute the layout&#xA;(my-startup-layout )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is there a way to have Emacs recover the same screen organization (windows and files) from last use?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You should have a look at the &lt;a href=&quot;https://www.emacswiki.org/emacs/LayoutRestore&quot; rel=&quot;nofollow noreferrer&quot;&gt;layout&lt;/a&gt; package&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="17093" LastEditDate="2017-10-12T13:25:03.387" LastActivityDate="2017-10-12T13:25:03.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="827" PostTypeId="1" AcceptedAnswerId="833" CreationDate="2014-10-08T00:35:05.687" Score="9" ViewCount="2144" Body="&lt;p&gt;I would like to grow a selection without moving point (the cursor) from its location. I know I can always use &lt;code&gt;C-u C-spc&lt;/code&gt; to move to the previous location, but I would like to avoid that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I would like to do both of these operations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select all text in the buffer&lt;/li&gt;&#xA;&lt;li&gt;Gradually add subsequent lines / paragraphs to the selection&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;while keeping the cursor where it is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does Emacs have any interactive functions for this? Are they bound to any keyboard shortcuts? &lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2014-10-08T12:16:54.537" LastActivityDate="2014-10-09T03:47:35.990" Title="Selecting text without moving the cursor" Tags="|region|mark|" AnswerCount="6" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="828" PostTypeId="2" ParentId="827" CreationDate="2014-10-08T00:40:41.037" Score="10" Body="&lt;p&gt;&lt;strong&gt;If the region grows then the cursor changes position.&lt;/strong&gt;  This is because the cursor is always at one end of the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you select all of the buffer text (&lt;code&gt;C-x h&lt;/code&gt; and then use &lt;code&gt;C-x C-x&lt;/code&gt; to swap point and mark, so the cursor is at the end of the text), and then you type some more text, then you have accomplished what you want: the region has been extended to include the text you typed. (This assumes you do not have &lt;code&gt;delete-selection-mode&lt;/code&gt; turned on.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The region has also been deactivated, automatically, so the region text is no longer highlighted.  To re-activate the region, do &lt;code&gt;C-x C-x&lt;/code&gt; (which you can repeat, if you want to keep the cursor at the buffer end.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-08T00:40:41.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="829" PostTypeId="2" ParentId="825" CreationDate="2014-10-08T00:42:53.820" Score="3" Body="&lt;p&gt;Just use &lt;code&gt;buffer-file-name&lt;/code&gt;.  In Lisp we often use a non-&lt;code&gt;nil&lt;/code&gt; value to mean &lt;strong&gt;true&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only times you might want to avoid this is if the function is costly or has unwanted side effects.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-08T00:42:53.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="830" PostTypeId="2" ParentId="825" CreationDate="2014-10-08T00:43:13.837" Score="9" Body="&lt;p&gt;You can use either &lt;code&gt;(buffer-file-name)&lt;/code&gt; (with optional buffer argument) or the buffer-local &lt;code&gt;buffer-file-name&lt;/code&gt; variable. Both evaluate to the same value for a given buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That &lt;em&gt;is&lt;/em&gt; the idiomatic way to do this in Elisp, though, so your code is fine. If you desperately wanted to you could always make a &lt;code&gt;buffer-has-file-p&lt;/code&gt; wrapper function.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-10-08T00:43:13.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="831" PostTypeId="2" ParentId="825" CreationDate="2014-10-08T00:54:49.020" Score="14" Body="&lt;p&gt;I'd argue that your usage &lt;strong&gt;is&lt;/strong&gt; idiomatic elisp, since the buffer's name is a perfectly appropriate boolean value in its own right.  Quoting from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/Truth-_0026-Falsehood.html&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is an important aspect to the truth test in an if expression. So far, we have spoken of `true' and `false' as values of predicates as if they were new kinds of Emacs Lisp objects. In fact, `false' is just our old friend &lt;code&gt;nil&lt;/code&gt;. Anything else—anything at all—is `true'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To further the point, check out the code for &lt;code&gt;clone-buffer&lt;/code&gt;.  I expect you'll see the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(interactive&#xA; (progn&#xA;   (if buffer-file-name&#xA;       (error &quot;Cannot clone a file-visiting buffer&quot;))&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this is testing the variable binding of &lt;code&gt;buffer-file-name&lt;/code&gt; instead of calling the function without argument, &lt;code&gt;(buffer-file-name)&lt;/code&gt;, but the two should always behave the same.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-10-08T00:54:49.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="832" PostTypeId="2" ParentId="812" CreationDate="2014-10-08T01:12:27.553" Score="2" Body="&lt;p&gt;The below snippet [&lt;a href=&quot;https://stackoverflow.com/questions/3022880/how-can-i-prevent-the-mini-buffer-from-displaying-previous-commands-in-emacs&quot;&gt;Source&lt;/a&gt;] aborts recursive edit when focus moves away from the minibuffer. This is to avoid the irritating occassions where repeated &lt;code&gt;C-g&lt;/code&gt; pressing doesn't edit the mini-buffer as cursor focus has moved out of it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun stop-using-minibuffer ()&#xA;  &quot;kill the minibuffer&quot;&#xA;  (when (and (&gt;= (recursion-depth) 1) (active-minibuffer-window))&#xA;    (abort-recursive-edit)))&#xA;(add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2014-10-08T01:12:27.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="833" PostTypeId="2" ParentId="827" CreationDate="2014-10-08T01:22:40.133" Score="12" Body="&lt;p&gt;There is a separate answer for each of the points you listed:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The emacs default binding &lt;kbd&gt;C-x&lt;/kbd&gt;&#xA;&lt;kbd&gt;h&lt;/kbd&gt; will select the whole buffer regardless of where the cursor is.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;noreferrer&quot;&gt;expand-region&lt;/a&gt; package will help achieve the second goal of gradually expanding the selection. &lt;code&gt;expand-region&lt;/code&gt; will also eventually select the whole buffer as you keep on expanding the region. Have a look at its readme on github for more info. This package is available through MELPA.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Here is a brief introduction to this package from its github:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Expand region increases the selected region by semantic units. Just keep pressing the key until it selects what you want.&lt;/p&gt;&#xA;&lt;p&gt;An example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; (setq alphabet-start &amp;quot;abc def&amp;quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With the cursor at the c, it starts by marking the entire word abc, then expand to the contents of the quotes abc def, then to the entire quote &amp;quot;abc def&amp;quot;, then to the contents of the sexp setq alphabet-start &amp;quot;abc def&amp;quot; and finally to the entire sexp.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I'd like to add though that modifying the region selection in either case will still move the cursor.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-08T14:29:30.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="834" PostTypeId="2" ParentId="384" CreationDate="2014-10-08T01:29:58.673" Score="0" Body="&lt;p&gt;You'll have to write some elisp to make this happen. Getting the &quot;R.string.street&quot; and prompting for a value wouldn't be too hard. It might be easier to write a Python script to do the actual edit in the XML file. You would write it as a command line utility and call it from you elisp function that collections the value that you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to implement the function would be to just prompt for the 3 values that you want, resource-type, resource-name and resource-value and just hand them off to your command line utility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course an elite elisp would probably do the whole operation in elisp but I'm not that comfortable with elisp to do XML parsing.&lt;/p&gt;&#xA;" OwnerUserId="657" LastActivityDate="2014-10-08T01:29:58.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="835" PostTypeId="1" CreationDate="2014-10-08T01:30:19.117" Score="14" ViewCount="1454" Body="&lt;p&gt;How can I make it so that when I press &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-b&lt;/kbd&gt; to access the Buffer List that that buffer automatically takes focus instead of having to switch to it manually with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;? I can't find a variable that customizes this.&lt;/p&gt;&#xA;" OwnerUserId="655" LastEditorUserId="45" LastEditDate="2014-10-08T01:43:52.540" LastActivityDate="2023-10-29T14:42:25.010" Title="Make Buffer List take focus?" Tags="|buffers|customize|focus|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="836" PostTypeId="2" ParentId="835" CreationDate="2014-10-08T01:56:55.637" Score="11" Body="&lt;p&gt;You can replace the command &lt;code&gt;list-buffers&lt;/code&gt; which is run with &lt;code&gt;C-x C-b&lt;/code&gt; to a function that does what you want.  In this case &lt;code&gt;buffer-menu-other-window&lt;/code&gt; opens the buffers list in another window with focus. Adding the following snippet to your init file should remap &lt;code&gt;C-x C-b&lt;/code&gt; to the new function. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define-key global-map [remap list-buffers] 'buffer-menu-other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here &lt;code&gt;global-map&lt;/code&gt; represents the keymap where &lt;code&gt;C-x C-b&lt;/code&gt; is bound to a command, &lt;code&gt;list-buffers&lt;/code&gt; the original command and &lt;code&gt;buffer-menu-other-window&lt;/code&gt; the new command.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-08T01:56:55.637" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="837" PostTypeId="2" ParentId="801" CreationDate="2014-10-08T02:16:33.120" Score="24" Body="&lt;p&gt;Check &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot;&gt;my guide&lt;/a&gt;. It lists several methods for auto-completion in C/C++. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those options are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot;&gt;Irony&lt;/a&gt;. Highly recommended, since it uses Clang and easy to setup compared with other solutions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using the built-in parser from Emacs. It is the best auto-complete you can get is from within Emacs parser, Semantic, but it would be slow on large project like Linux kernel.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;code&gt;company-mode&lt;/code&gt; package with &lt;code&gt;company-clang&lt;/code&gt;. Provides code completion fine for system include paths since it can automatically get the paths from Clang, but has to do some configuration for project local&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;code&gt;company-mode&lt;/code&gt; with &lt;code&gt;company-gtags&lt;/code&gt;. It uses tag database generated from GNU Global as completion. You can use this to provide code complete locally to your project. It's not exactly intelligent since it throws everything inside the generated database to you.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;rtags&lt;/code&gt; goes farther by providing a server for live analysis. But it's complicated to setup compare with pure Elisp solution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-06-09T07:16:36.380" LastActivityDate="2015-06-09T07:16:36.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="838" PostTypeId="2" ParentId="167" CreationDate="2014-10-08T02:17:58.077" Score="3" Body="&lt;p&gt;I don't think &lt;code&gt;whitespace-mode&lt;/code&gt; can do what you're asking out-of-the-box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is Emacs!  You can get (maybe?) what you want by redefining the functions &lt;code&gt;whitespace-empty-at-eob-regexp&lt;/code&gt; and &lt;code&gt;whitespace-post-command-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;whitespace-empty-at-eob-regexp&lt;/code&gt; (the function, not the actual regexp) you should find the following branch:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA; ;; at eob&#xA; ((= limit e)&#xA;  (when (/= whitespace-point e)&#xA;    (goto-char limit)&#xA;    (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp b)))&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you change the last line I quoted to look like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (setq r (whitespace-looking-back whitespace-empty-at-eob-regexp whitespace-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;whitespace-mode&lt;/code&gt; will only highlight lines from point to the end.  This probably won't do what you expect, though, because &lt;code&gt;whitespace-mode&lt;/code&gt; is clever about when it refontifies.  So!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;whitespace-post-command-hook&lt;/code&gt; you should find the following logic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((refontify&#xA;       (or&#xA;        ...&#xA;        ;; it is at end of buffer (eob)&#xA;        (= whitespace-point (1+ (buffer-size)))&#xA;        ;; the buffer was modified and ...&#xA;        ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you insert at the same depth a clause like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        ;; it is inside eob whitespace region&#xA;        (&amp;gt;= whitespace-point whitespace-eob-marker)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you'll get refontification more often.  I wish I could say &quot;whenever point is in the empty space at the end of the buffer&quot; but I'm pretty confident there are situations where you can trick Emacs into getting out of sync.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also do what I do, and just type really fast in the blank lines.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-10-08T02:17:58.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="839" PostTypeId="2" ParentId="798" CreationDate="2014-10-08T02:20:44.930" Score="5" Body="&lt;p&gt;I used &lt;a href=&quot;https://askubuntu.com/a/123515/13847&quot;&gt;Byzanz&lt;/a&gt; to generate all my GIFs. I record with one screen to run the &lt;code&gt;byzanz&lt;/code&gt; command, one for recording. Some examples are in &lt;a href=&quot;http://tuhdo.github.io/emacs-tutor.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;my guide here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2014-10-08T02:20:44.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="840" PostTypeId="2" ParentId="474" CreationDate="2014-10-08T02:47:22.950" Score="1" Body="&lt;p&gt;I've been happy with CEDET  from its source repo + ECB + gtags +cscope. That said, there are many suggestions on this post that I will be trying. &lt;/p&gt;&#xA;" OwnerUserId="671" LastActivityDate="2014-10-08T02:47:22.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="841" PostTypeId="2" ParentId="835" CreationDate="2014-10-08T03:35:11.007" Score="8" Body="&lt;p&gt;An alternative is to switch to ibuffer, which does not share this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ibuffer is part of GNU Emacs, so on recent versions of Emacs you should just need to add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-b&quot;) 'ibuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init file.&lt;/p&gt;&#xA;" OwnerUserId="676" LastEditorUserId="105" LastEditDate="2018-06-23T00:54:24.163" LastActivityDate="2018-06-23T00:54:24.163" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="842" PostTypeId="2" ParentId="560" CreationDate="2014-10-08T04:01:48.427" Score="4" Body="&lt;p&gt;Disclaimer: I'm not &lt;em&gt;that&lt;/em&gt; familiar with cc-mode styles, so there might be simpler ways to do that, and also unforeseen side-effects to my code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-java-lineup-cascaded-calls (langelem)&#xA;  (save-excursion&#xA;    (back-to-indentation)&#xA;    (let ((operator (and (looking-at &quot;\\.&quot;)&#xA;                         (regexp-quote (match-string 0))))&#xA;          (stmt-start (c-langelem-pos langelem)) col)&#xA;&#xA;      (when (and operator&#xA;                 (looking-at operator)&#xA;                 (zerop (c-backward-token-2 1 t stmt-start)))&#xA;        (if (and (eq (char-after) ?\()&#xA;                 (zerop (c-backward-token-2 2 t stmt-start))&#xA;                 (looking-at operator))&#xA;            (progn&#xA;              (setq col (current-column))&#xA;&#xA;              (while (and (zerop (c-backward-token-2 1 t stmt-start))&#xA;                          (eq (char-after) ?\()&#xA;                          (zerop (c-backward-token-2 2 t stmt-start))&#xA;                          (looking-at operator))&#xA;                (setq col (current-column)))&#xA;              (vector col))&#xA;          (vector (+ (current-column)&#xA;                     c-basic-offset)))))))&#xA;&#xA;(add-to-list 'c-offsets-alist '(arglist-cont . my-java-lineup-cascaded-calls))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Explanation: this is a modified version of &lt;code&gt;c-lineup-cascaded-calls&lt;/code&gt; that does almost what you want except that it aligns stuff like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a.foo()&#xA; .bar()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So this code does that too, but in addition, when we're looking at the dot &lt;em&gt;and&lt;/em&gt; we should not align like above, then we add an indentation level.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-08T04:01:48.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="843" PostTypeId="1" AcceptedAnswerId="1007" CreationDate="2014-10-08T05:21:13.993" Score="6" ViewCount="2924" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow&quot;&gt;irony-mode&lt;/a&gt; is: &lt;em&gt;an Emacs minor-mode that aims at improving the editing experience for the C, C++ and Objective-C languages. It works by using a combination of an Emacs package and a C++ program (irony-server) that uses libclang.&lt;/em&gt; (provides code completion with either company-mode or auto-complete)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, For tiny projects that I might be working on, which are compiled with a simple &lt;code&gt;g++ foo.c -o foo&lt;/code&gt;, how should I put the compile files to make irony-mode work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And what about larger projects that uses CMake, SCons and others! How do I get those compilations flags for projects that make use of these piece of software to build themselves?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Sorry, but irony-mode assumes a lot of things and dismiss any in deep explanation about these things it mentions, and since I'm not a full time C++ developer, figuring out myself is quite hard.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="50" LastEditDate="2014-10-10T09:19:51.400" LastActivityDate="2016-11-07T19:03:41.633" Title="How should I configure irony-mode if my project has no &quot;compilation flags&quot;?" Tags="|init-file|c++|company-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="844" PostTypeId="1" AcceptedAnswerId="994" CreationDate="2014-10-08T06:04:31.943" Score="3" ViewCount="239" Body="&lt;p&gt;I have written this function to insert an org-style link to a file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jay/insert-file-link (fname)&#xA;  &quot;Insert link to file (called by Midnight Commander).&quot;&#xA;  (interactive &quot;s&quot;)&#xA;  (insert &quot;[[&quot;)&#xA;  (insert fname)&#xA;  (insert &quot;][&quot;)&#xA;  (insert fname)&#xA;  (insert &quot;]]&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I am in a buffer with the cursor after this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(jay/insert-file-link &quot;foobar&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and hit C-x C-e it correctly inserts and I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(jay/insert-file-link &quot;foobar&quot;)[[foobar][foobar]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However when I try it from the command line,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -e &quot;(jay/insert-file-link \&quot;/tmp/foo\&quot;)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it doesn't do anything in the buffer (it prints nil on the command line as expected)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any clues as to what I'm dong wrong?  Thanks.&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="50" LastEditDate="2014-10-10T00:46:01.883" LastActivityDate="2014-10-10T00:46:01.883" Title="Inserting org-style links from external program" Tags="|buffers|window|emacsclient|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="845" PostTypeId="2" ParentId="844" CreationDate="2014-10-08T06:26:10.497" Score="8" Body="&lt;p&gt;Nothing in your function tells Emacs where to insert the text, you need to tell it where to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you’d like Emacs to place this link in a buffer named &lt;code&gt;BUFFER-NAME&lt;/code&gt;&#xA;(which you &lt;strong&gt;know&lt;/strong&gt; will be open), you can use&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/with-current-buffer&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;with-current-buffer&lt;/code&gt;&lt;/a&gt;.&#xA;The following code inserts the link wherever point happens to&#xA;currently be in a window displaying that buffer. If no window displays&#xA;that buffer, it defaults to &lt;code&gt;point-max&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jay/insert-file-link (fname)&#xA;  &quot;Insert link to file (called by Midnight Commander).&quot;&#xA;  (interactive &quot;s&quot;)&#xA;  (let* ((target-buffer (get-buffer &quot;BUFFER-NAME&quot;))&#xA;         (window (get-buffer-window target-buffer t))&#xA;         (p (when window (window-point window))))&#xA;    (with-current-buffer target-buffer&#xA;      (goto-char (or p (point-max)))&#xA;      (insert &quot;[[&quot; fname &quot;][&quot; fname &quot;]]&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you’d like Emacs to place this link in a file named &lt;code&gt;FILE-PATH&lt;/code&gt;&#xA;(which may or may not be opened), you can use&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/find-file&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;find-file&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jay/insert-file-link (fname)&#xA;  &quot;Insert link to file (called by Midnight Commander).&quot;&#xA;  (interactive &quot;s&quot;)&#xA;  (find-file &quot;FILE-PATH&quot;)&#xA;  (insert &quot;[[&quot; fname &quot;][&quot; fname &quot;]]&quot;)&#xA;  (save-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-08T16:31:54.590" LastActivityDate="2014-10-08T16:31:54.590" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="846" PostTypeId="2" ParentId="806" CreationDate="2014-10-08T06:53:26.607" Score="5" Body="&lt;p&gt;You can use&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/benchmark&quot;&gt;&lt;code&gt;benchmark&lt;/code&gt;&lt;/a&gt; to&#xA;determine how long a command takes. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark 100 (command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;100 is the number of repetitions, make it large enough for you results&#xA;to be meaningful. And don’t forget you can also call it interactively.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(benchmark REPETITIONS FORM)  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Print the time taken for REPETITIONS executions of FORM.&lt;br&gt;&#xA;  Interactively, REPETITIONS is taken from the prefix arg.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can also use it for any arbitrary form, not just a single command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark 100 (form to (be evaluated))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-08T06:53:26.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="847" PostTypeId="1" AcceptedAnswerId="1071" CreationDate="2014-10-08T07:08:24.003" Score="2" ViewCount="3677" Body="&lt;p&gt;I've been trying to setting the capture configuration for org-mode, however, when I try to select a capture template, I get this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Template key: &#xA;byte-code: Capture template `p': listp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is my conf:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       (setf org-footnote-auto-adjust t&#xA;             org-directory (expand-file-name &quot;~/org&quot;)&#xA;             org-archive-location (concat org-directory &quot;/archivado.org::* Entradas viejas y archivadas&quot;)&#xA;             ;; ...&#xA;             org-agenda-files (list (concat org-directory &quot;/trabajo.org&quot;)&#xA;                                    (concat org-directory &quot;/notas.org&quot;)&#xA;                                    (concat org-directory &quot;/otros.org&quot;)&#xA;                                    (concat org-directory &quot;/agenda.org&quot;))&#xA;             org-log-done 'time&#xA;             org-default-notes-file (concat org-directory &quot;/notas.org&quot;)&#xA;             org-capture-templates '((&quot;p&quot; &quot;Cosas por hacer&quot; entry (file+headline (concat org-directory &quot;/otros.org&quot;) &quot;Tareas&quot;)&#xA;                                      &quot;* Tareas %?\n  %i\n  %a&quot;)&#xA;                                     (&quot;d&quot; &quot;Diario&quot; entry (file+datatree (concat org-directory &quot;/diario.org&quot;))&#xA;                                      &quot;* %?\nInsertado el %U\n  %i\n  %a&quot;)&#xA;                                     (&quot;a&quot; &quot;Apuntes importantes&quot; entry (file+datatree &quot;&quot;)&#xA;                                      &quot;* Notas importantes %?\nNota importante del %U\n  %i\n  %a&quot;)&#xA;                                     (&quot;g&quot; &quot;Agenda&quot; entry (file+datatree+prompt (concat org-directory &quot;/agenda.org&quot;))&#xA;                                      &quot;* Agenda %?\n Ingresado el %T\nProgramado para el %:date\n  %i\n&quot;))&#xA;             org-clock-persist 'history)&#xA;&#xA;       ;; ...&#xA;       (define-key global-map (kbd &quot;C-c c&quot;) 'org-capture)&#xA;       (org-clock-persistence-insinuate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I press &lt;kbd&gt;a&lt;/kbd&gt; I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Template key: &#xA;org-capture-set-target-location: Invalid capture target specification&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But according to the manual this &lt;code&gt;(file+datatree &quot;&quot;)&lt;/code&gt; should be valid, what I'm missing?&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="690" LastEditDate="2014-10-09T06:20:24.273" LastActivityDate="2014-10-11T02:44:16.670" Title="What's wrong with my org-mode capture settings?" Tags="|org-mode|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="848" PostTypeId="2" ParentId="847" CreationDate="2014-10-08T07:19:51.483" Score="3" Body="&lt;p&gt;You've got this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;p&quot; &quot;Cosas por hacer&quot; entry (file+headline (concat org-directory &quot;/otros.org&quot;) &quot;Tareas&quot;) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the &lt;code&gt;concat&lt;/code&gt; part won't get evaluated: a string is expected after &lt;code&gt;file+headline&lt;/code&gt;, and you've provided a list, hence the error. Try the following instead: (note the backquote)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`((&quot;p&quot; &quot;Cosas por hacer&quot; entry (file+headline ,(concat org-directory &quot;/otros.org&quot;) &quot;Tareas&quot;) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To see the difference in result, you can play about evaluating those two expressions by placing the cursor after them and using &lt;code&gt;C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Prefer &lt;code&gt;expand-file-name&lt;/code&gt; to &lt;code&gt;concat&lt;/code&gt; when joining directory and filenames to make a path.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-10-08T07:19:51.483" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="849" PostTypeId="2" ParentId="802" CreationDate="2014-10-08T07:33:08.853" Score="2" Body="&lt;p&gt;Here are some examples using &lt;a href=&quot;https://github.com/tomterl/fullframe&quot; rel=&quot;nofollow&quot;&gt;fullframe&lt;/a&gt;, lifted straight from my emacs config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'package&#xA;  '(fullframe list-packages quit-window))&#xA;&#xA;(eval-after-load 'magit&#xA;  '(fullframe magit-status magit-mode-quit-window))&#xA;&#xA;(eval-after-load 'ibuffer&#xA;  '(fullframe ibuffer ibuffer-quit))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first parameter for &lt;code&gt;fullframe&lt;/code&gt; is any command which creates and switches to a new window, and the second is a function which is called when that window is quit - either the command the user uses to quit the window, or a command which is called in the course of the window being quit.&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2014-10-08T08:34:28.747" LastActivityDate="2014-10-08T08:34:28.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="850" PostTypeId="2" ParentId="728" CreationDate="2014-10-08T07:37:51.137" Score="10" Body="&lt;p&gt;Just to add tweaks that I use with already mentioned &lt;a href=&quot;http://www.emacswiki.org/emacs/InteractivelyDoThings&quot;&gt;Ido&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ido)&#xA;(require 'ido-hacks)&#xA;(require 'flx-ido)&#xA;(require 'ido-vertical-mode)&#xA;&#xA;(ido-mode 1)&#xA;(flx-ido-mode 1)&#xA;(ido-hacks-mode 1)&#xA;(ido-everywhere 1)&#xA;(ido-vertical-mode 1)&#xA;&#xA;(setq ido-enable-flex-matching t&#xA;      ido-use-filename-at-point 'guess&#xA;      ido-vertical-define-keys 'C-n-C-p-up-down-left-right))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm also using &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot;&gt;&lt;code&gt;ace-window&lt;/code&gt;&lt;/a&gt; to switch between buffers together with &lt;a href=&quot;https://github.com/winterTTr/ace-jump-mode&quot;&gt;&lt;code&gt;ace-jump-mode&lt;/code&gt;&lt;/a&gt; to &lt;em&gt;jump&lt;/em&gt; between visible windows. Comes with some getting used to but worth trying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have combined it with &lt;a href=&quot;http://www.emacswiki.org/KeyChord&quot;&gt;&lt;code&gt;key-chord-mode&lt;/code&gt;&lt;/a&gt; and hit &lt;code&gt;so&lt;/code&gt; for quick jump:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define-global &quot;so&quot; 'ace-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All of the above mentioned packages are available via the package manager from Melpa. &lt;/p&gt;&#xA;" OwnerUserId="714" LastEditorUserId="115" LastEditDate="2014-10-30T11:19:16.313" LastActivityDate="2014-10-30T11:19:16.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="851" PostTypeId="1" AcceptedAnswerId="940" CreationDate="2014-10-08T07:45:56.730" Score="6" ViewCount="878" Body="&lt;p&gt;Is there any way to have time constant in an Org spreadsheet formula? For example, i would like to have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@&amp;gt;$3=@&amp;gt;$5-'08:00:00'*vcount(@2..@-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to calculate how much longer I've been at work than I have to be :) The &lt;code&gt;@&amp;gt;$5&lt;/code&gt; is the total sum of hours I've been at work and &lt;code&gt;@2..@-1&lt;/code&gt; are the rows with days I've been working.&lt;/p&gt;&#xA;" OwnerUserId="718" LastEditorUserId="25" LastEditDate="2014-10-08T21:28:55.470" LastActivityDate="2014-10-09T22:50:04.653" Title="time value in org-table formula" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="852" PostTypeId="2" ParentId="822" CreationDate="2014-10-08T07:47:08.030" Score="8" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/pashinin/workgroups2&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;workgroups2&lt;/code&gt;&lt;/a&gt; to manage your desktop. From the README on GitHub:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Workgroups is a session manager for Emacs.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It saves all your opened buffers, their location and sizes on disk to restore later&lt;/li&gt;&#xA;&lt;li&gt;You can create several workspaces&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can also restore such buffers as: org-agenda, shell, magit-status, help.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;If you have the &lt;a href=&quot;http://melpa.milkbox.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt; repository enabled, you can install this package via &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;package-install&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;workgroups2&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The basic setup is:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'workgroups2)&#xA;(workgroups-mode 1) ; This should go at the end of your init file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When you restart Emacs for the first time after adding this code to your init file, &lt;code&gt;workgroups2&lt;/code&gt; will automatically create a workgroup for you. You can verify that this was successful by checking the &lt;code&gt;*Messages*&lt;/code&gt; buffer for the following information:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Workgroups Mode: on&#xA;Switched: First workgroup&#xA;Created: First workgroup  ( -&amp;lt;{ 0: First workgroup }&amp;gt;- )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;From this point on, Emacs will save the current configuration of windows and files automatically on exit, and restore it the next time it starts.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-03T12:36:06.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="853" PostTypeId="2" ParentId="728" CreationDate="2014-10-08T07:58:12.557" Score="2" Body="&lt;p&gt;Widely speaking, there are 2 ways to switch buffers and most of the solutions&#xA;will fall into one of these.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using the mini buffer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is what &lt;code&gt;C-x b&lt;/code&gt; does by default. Ido gives you nice auto completion so that&#xA;you don't need to TAB TAB TAB so much. Projects like helm, projectile etc makes&#xA;it easier by giving you abilities to work with files in a project etc, and along&#xA;with ido, they can be pretty useful.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;An entire buffer with all items listed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is useful when you have so many buffers and you want a list of them all.&#xA;You can go up and down the buffer, and press enter to visit a particular file.&#xA;Ibuffer is pretty good for that.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use both and this is how you can set it up.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-set-key (kbd &quot;C-x C-b&quot;) 'ido-switch-buffer)&#xA; (global-set-key (kbd &quot;C-x b&quot;) 'ibuffer)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="246" LastEditorUserId="246" LastEditDate="2014-11-10T12:46:44.280" LastActivityDate="2014-11-10T12:46:44.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="854" PostTypeId="5" CreationDate="2014-10-08T08:01:05.590" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-08T08:01:05.590" LastActivityDate="2014-10-08T08:01:05.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="855" PostTypeId="4" CreationDate="2014-10-08T08:01:05.590" Score="0" Body="Using Emacs to develop programs in other languages." OwnerUserId="304" LastEditorUserId="304" LastEditDate="2014-10-08T13:03:15.163" LastActivityDate="2014-10-08T13:03:15.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="856" PostTypeId="2" ParentId="728" CreationDate="2014-10-08T08:07:24.943" Score="1" Body="&lt;p&gt;As you can see from the other answers, there are many ways to streamline this particular task. I personally use &lt;a href=&quot;https://github.com/sjbach/lusty-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lusty Emacs&lt;/a&gt; as my buffer switching apparatus, as it handles fuzzy completion quite nicely. This minimizes the number of key-strokes required to select the new buffer; for example I need only type &lt;code&gt;oxr&amp;lt;tab&amp;gt;&lt;/code&gt; to switch to &lt;code&gt;ox-reveal.el&lt;/code&gt;, or even just &lt;code&gt;o&lt;/code&gt; the second time around, as it tracks the history of switches as well.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="14825" LastEditDate="2022-05-27T13:35:44.317" LastActivityDate="2022-05-27T13:35:44.317" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="857" PostTypeId="2" ParentId="822" CreationDate="2014-10-08T08:08:45.610" Score="14" Body="&lt;p&gt;Since Emacs 24.4, you can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html&quot;&gt;desktop-save-mode&lt;/a&gt;. It's been part of Emacs for ages, but the window layout is only saved and restored since version 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just add this line in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="716" LastEditorUserId="25" LastEditDate="2014-10-09T23:49:22.207" LastActivityDate="2014-10-09T23:49:22.207" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="858" PostTypeId="2" ParentId="293" CreationDate="2014-10-08T08:20:37.470" Score="3" Body="&lt;p&gt;Over the time packages add a lot of things to &lt;code&gt;~/.emacs&lt;/code&gt; and I end up adding them one by one to my &lt;code&gt;.gitignore&lt;/code&gt;. I also have a &lt;code&gt;private.el&lt;/code&gt; which contains passwords, machine specific code etc which I dont track. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I have now.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Gitignore file&#xA;&#xA;# Remove backup files&#xA;*#&#xA;*.&#xA;*.elc&#xA;*~&#xA;.#*&#xA;&#xA;# Emacs packages&#xA;elpa/&#xA;var/&#xA;&#xA;#  Emacs tmp files &amp;amp; Misc&#xA;/.mc-lists.el&#xA;/.DS_Store&#xA;/.emacs.desktop&#xA;/.emacs.desktop.lock&#xA;/.watsonresults&#xA;/ac-comphist.dat&#xA;/auto-save-list&#xA;/eshell/history&#xA;/eshell/lastdir&#xA;/newsticker/feeds/&#xA;/snippets/&#xA;/tramp&#xA;/url/cookies&#xA;/.python-environments/&#xA;/ido.last&#xA;/places&#xA;/private.el&#xA;/games/&#xA;/bookmarks&#xA;/projectile-bookmarks.eld&#xA;/projectile.cache&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="246" LastActivityDate="2014-10-08T08:20:37.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="859" PostTypeId="2" ParentId="805" CreationDate="2014-10-08T08:59:01.287" Score="-1" Body="&lt;p&gt;You could put this in your config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-background 'fringe &quot;#f4a460&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... obviously change the colour code to the one you want.  &lt;/p&gt;&#xA;" OwnerUserId="726" LastActivityDate="2014-10-08T08:59:01.287" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="861" PostTypeId="2" ParentId="804" CreationDate="2014-10-08T09:16:55.417" Score="8" Body="&lt;p&gt;Not &lt;em&gt;quite&lt;/em&gt; an answer to your question, but consider &lt;code&gt;(setq org-agenda-sticky t)&lt;/code&gt;. This makes the &lt;kbd&gt;q&lt;/kbd&gt; command bury the agenda buffer when you've finished with it, rather than close it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result of this is that the agenda will reappear immediately when you next ask for it, but it won't have been updated since you last saw it. If you want it updated you can always press &lt;kbd&gt;g&lt;/kbd&gt; in the agenda to rebuild it properly.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2014-10-08T09:16:55.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="862" PostTypeId="2" ParentId="827" CreationDate="2014-10-08T09:19:59.323" Score="1" Body="&lt;p&gt;When you have copied something, you can add text to the selection later on with the use of &lt;code&gt;C-M-w&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;copy a line/region&lt;/li&gt;&#xA;&lt;li&gt;do something else&lt;/li&gt;&#xA;&lt;li&gt;you want to append sthg to the previously copied text: type &lt;code&gt;C-M-w&lt;/code&gt; (&lt;code&gt;append-next-kill&lt;/code&gt;) and then copy what you want (&lt;code&gt;M-w&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="739" LastActivityDate="2014-10-08T09:19:59.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="863" PostTypeId="2" ParentId="732" CreationDate="2014-10-08T09:51:00.830" Score="4" Body="&lt;p&gt;You may want to look at &lt;code&gt;C-h m&lt;/code&gt; that lists all key bindings of major mode and minor modes. Read more about other Help commands &lt;a href=&quot;http://tuhdo.github.io/emacs-tutor.html#sec-7-4&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. Emacs help system is rich.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-08T09:51:00.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="864" PostTypeId="1" AcceptedAnswerId="868" CreationDate="2014-10-08T10:58:55.280" Score="17" ViewCount="2782" Body="&lt;p&gt;I've added a custom key for the org agenda to show all unscheduled TODO items following Sacha Chua:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sacha/org-agenda-skip-scheduled ()&#xA;  (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp &quot;\n]+&amp;gt;&quot;))&#xA;&#xA;(setq org-agenda-custom-commands&#xA;   '((&quot;u&quot; &quot;Unscheduled tasks&quot; alltodo &quot;&quot;&#xA;      ((org-agenda-skip-function 'sacha/org-agenda-skip-scheduled)&#xA;       (org-agenda-overriding-header &quot;Unscheduled TODO entries: &quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can bring up this list with &lt;code&gt;C-c a u&lt;/code&gt;, but I'd rather just bind it to a single key. Currently I have the simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f8&amp;gt;&quot;) 'org-todo-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I would like this to use the above custom command. I've had a dig through the manual but I can't see how to do it.&lt;/p&gt;&#xA;" OwnerUserId="753" LastActivityDate="2018-03-02T14:13:26.830" Title="How to bind a key to a specific agenda command/list in org mode" Tags="|org-mode|keymap|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="865" PostTypeId="2" ParentId="770" CreationDate="2014-10-08T11:47:00.537" Score="1" Body="&lt;p&gt;So the cleanest solution I've come up with so far is to copy the data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: size-of-tcg&#xA;#+BEGIN_SRC sh :dir ~/lsrc/qemu/qemu.git/ :results output table :exports none&#xA;EXCL_SPEC='-and -not -iname &quot;kvm*&quot; -and -not -iname &quot;gdb*&quot; -and -not -iname &quot;machine.c&quot;'&#xA;eval find target-i386/ -xtype f ${EXCL_SPEC} &amp;gt; /tmp/cloc-files&#xA;cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d&quot;,&quot; -f2,5 | sed s/^/i386,/&#xA;eval find target-sparc/ -xtype f ${EXCL_SPEC} &amp;gt; /tmp/cloc-files&#xA;cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d&quot;,&quot; -f2,5 | sed s/^/ppc,/&#xA;eval find target-arm/ -xtype f ${EXCL_SPEC} &amp;gt; /tmp/cloc-files&#xA;cloc --quiet --csv --list-file=/tmp/cloc-files | tail -n +3 | cut -d&quot;,&quot; -f2,5 | sed s/^/arm,/&#xA;#+END_SRC&#xA;#+NAME: tcg-raw-data&#xA;#+RESULTS: size-of-tcg&#xA;| i386 | C            | 17032 |&#xA;| i386 | C/C++ Header |  4086 |&#xA;| ppc  | C            | 10483 |&#xA;| ppc  | C/C++ Header |   834 |&#xA;| arm  | C            | 28941 |&#xA;| arm  | C/C++ Header |  1962 |&#xA;&#xA;#+CAPTION: TCG Code for various target-*&#xA;#+ATTR_HTML: :border 2 :rules all :frame border :width 90%&#xA;| Architecture | Lines of Code |&#xA;|--------------+---------------|&#xA;| i386         |         21118 |&#xA;| ppc          |         11317 |&#xA;| arm          |         30903 |&#xA;|--------------+---------------|&#xA;| Total        |         63338 |&#xA;#+TBLFM: @2$1=remote(tcg-raw-data,@1$1)::@2$2=vsum(remote(tcg-raw-data,@1$3..@2$3))::@3$1=remote(tcg-raw-data,@3$1)::@3$2=vsum(remote(tcg-raw-data,@3$3..@4$3))::@4$1=remote(tcg-raw-data,@5$1)::@4$2=vsum(remote(tcg-raw-data,@5$3..@6$3))::@5$2=vsum(@2..@4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-10-08T11:47:00.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="866" PostTypeId="1" AcceptedAnswerId="885" CreationDate="2014-10-08T11:48:10.223" Score="7" ViewCount="803" Body="&lt;p&gt;When using the shellcheck checker, Flycheck will warn me that the &quot;$@&quot; in the following will be expanded on the client rather than the ssh server.  Which is a helpful warning, but yeah I know and I'm good.  So is it possible to suppress this warning; better yet if it's for just this one line.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;function f(){ ssh foo &quot;$@&quot; ; }&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="156" LastEditorUserId="50" LastEditDate="2014-10-08T15:20:52.493" LastActivityDate="2014-10-20T15:33:38.927" Title="flycheck/bash - i'd like to declare that the next line was intentional" Tags="|bash|flycheck|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="867" PostTypeId="1" AcceptedAnswerId="880" CreationDate="2014-10-08T11:48:57.687" Score="6" ViewCount="126" Body="&lt;p&gt;I understand why &lt;code&gt;eshell&lt;/code&gt; provides elisp interpretations of the &lt;code&gt;kill&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt; commands, however, I would like Emacs to use the operating-specific implementations if they are available in the &lt;code&gt;$PATH&lt;/code&gt; (especially in the case of &lt;code&gt;rm&lt;/code&gt;, because the elisp implementation of &lt;code&gt;rm&lt;/code&gt; can take &lt;em&gt;minutes&lt;/em&gt; to delete large directories of files).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell Emacs to use the &lt;code&gt;rm&lt;/code&gt; command in &lt;code&gt;$PATH&lt;/code&gt; if available, and only fall back to the elisp implementation if not found?&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="379" LastEditDate="2014-10-08T12:01:48.440" LastActivityDate="2014-10-08T13:59:16.947" Title="How to tell eshell to use the os-specific tools if available" Tags="|eshell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="868" PostTypeId="2" ParentId="864" CreationDate="2014-10-08T11:51:31.633" Score="15" Body="&lt;p&gt;You can do this by wrapping a call to &lt;code&gt;org-agenda&lt;/code&gt; into a custom command and binding that to a key:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-agenda-show-unscheduled (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (org-agenda arg &quot;u&quot;))&#xA;&#xA;(define-key org-mode-map (kbd &quot;&amp;lt;f8&amp;gt;&quot;) 'org-agenda-show-unscheduled)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-01T20:38:52.380" LastActivityDate="2015-02-01T20:38:52.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="869" PostTypeId="1" CreationDate="2014-10-08T11:58:10.850" Score="13" ViewCount="1796" Body="&lt;p&gt;Searching and replacing using regular expressions is clearly a powerful tool to the Emacs user who can routinely perform these actions. However, as an Emacs (and/or programming) beginner, regular expressions need to be learned and practiced. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I learn and train regular expressions &lt;em&gt;interactively&lt;/em&gt; in Emacs, similarly to the built-in Emacs tutorial? If not, what are other suggestions to utilize Emacs to practice the use of regular expressions for searching and replacing?&lt;/p&gt;&#xA;" OwnerUserId="338" LastActivityDate="2014-10-09T04:57:23.133" Title="How can I practice searching and replacing with regular expressions interactively in Emacs?" Tags="|regular-expressions|learning|" AnswerCount="7" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="870" PostTypeId="2" ParentId="869" CreationDate="2014-10-08T12:02:44.083" Score="17" Body="&lt;p&gt;You can try &lt;code&gt;M-x regexp-builder RET&lt;/code&gt; which is an interactive regular expression matcher, that's not bad&lt;/p&gt;&#xA;" OwnerUserId="727" LastActivityDate="2014-10-08T12:02:44.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="871" PostTypeId="2" ParentId="827" CreationDate="2014-10-08T12:27:43.983" Score="2" Body="&lt;p&gt;As stated in other answers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;h&lt;/kbd&gt; will select the entire buffer ; &lt;code&gt;(mark-whole-buffer)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to grow your selection the easiest way would be using the &lt;code&gt;mark-*&lt;/code&gt; commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a keybound example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-M-SPC&lt;/kbd&gt; &lt;code&gt;(mark-sexp)&lt;/code&gt; will mark the sexp at point.  If you repeat the command, it will add the following sexp to the selection.  The cursor will remain at the current position, or move to the start of the object (paragraph/sexp) to ensure it is entirely marked.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-08T12:27:43.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="872" PostTypeId="2" ParentId="869" CreationDate="2014-10-08T12:42:33.710" Score="1" Body="&lt;p&gt;Not within emacs, but &lt;a href=&quot;http://rubular.com/&quot; rel=&quot;nofollow&quot; title=&quot;rubular.com&quot;&gt;http://rubular.com/&lt;/a&gt; is basically &lt;code&gt;regexp-builder&lt;/code&gt; with a cheat-sheet. You can set up an example and have it spit out a &lt;a href=&quot;http://rubular.com/r/iUJsL6xsyr&quot; rel=&quot;nofollow&quot; title=&quot;link&quot;&gt;link&lt;/a&gt; to that example. I use this when discussing regex with a team.&lt;/p&gt;&#xA;" OwnerUserId="99" LastActivityDate="2014-10-08T12:42:33.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="873" PostTypeId="2" ParentId="867" CreationDate="2014-10-08T13:01:21.127" Score="0" Body="&lt;p&gt;&lt;em&gt;shameless plug&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not exactly the solution to your problem, but I think is close enough for you to consider it if a better answer doesn't show up. I wrote an extension a while back, &lt;a href=&quot;https://github.com/rlazo/shell-ext&quot; rel=&quot;nofollow&quot;&gt;shell-ext&lt;/a&gt;, which works with shell-mode rather than eshell, but it intercepts the commands before being executed, letting you do  whatever you want with it, like calling a different command based on OS. It relies on a hook that shell-mode provides to get the input. If eshell provides a similar hook you could use the same mechanism. &lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-10-08T13:01:21.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="874" PostTypeId="2" ParentId="869" CreationDate="2014-10-08T13:06:54.197" Score="1" Body="&lt;p&gt;As an alternative to Dave F's &lt;code&gt;regexp-builder&lt;/code&gt; you can also create arbitrary text to practice pattern matching against.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most useful feature of this command is that it will highlight matches in the buffer as the pattern is created to assist you in ensuring the proper pattern matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;(query-replace-regexp)&lt;/code&gt; (&lt;kbd&gt;C-M-%&lt;/kbd&gt;) and creating a regular expression to perform the replacement you want will help you practice.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-08T13:06:54.197" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="875" PostTypeId="2" ParentId="869" CreationDate="2014-10-08T13:36:31.997" Score="18" Body="&lt;p&gt;Besides &lt;code&gt;regexp-builder&lt;/code&gt; you might also consider &lt;a href=&quot;https://github.com/benma/visual-regexp.el&quot; rel=&quot;noreferrer&quot;&gt;visual-regexp&lt;/a&gt; to provide you with visual feedback on the replace in progress:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7rlZ7.png&quot; alt=&quot;visual-regexp snapshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="533" LastActivityDate="2014-10-08T13:36:31.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="876" PostTypeId="1" AcceptedAnswerId="878" CreationDate="2014-10-08T13:36:37.483" Score="14" ViewCount="4467" Body="&lt;p&gt;The fonts in my pdf's as displayed in doc-view aren't particularly readable. Is there a setting I can change to improve the image quality? I tried changing &lt;code&gt;doc-view-resolution&lt;/code&gt; from 100 to 300, but that just made the pdf render larger.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-10-08T13:49:30.970" Title="improve doc-view display quality" Tags="|pdf|docview|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="877" PostTypeId="2" ParentId="866" CreationDate="2014-10-08T13:46:00.773" Score="4" Body="&lt;p&gt;The only way you would get that error is if you were using the shellcheck checker, in order to remove these warnings you need to customize the command flycheck is using for shellcheck, there is no built in way to customize the existing shellcheck checker, but you can create a new checker with that feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll need to create a new flycheck checker that is just like the existing shellcheck checker but makes use of the &quot;-e&quot; option that allows you to exclude errors types.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defvar shellcheck-exclude-types '(&quot;SC2029&quot;)&#xA;  &quot;Shellcheck error types to exclude from flycheck&quot;)&#xA;&#xA;(flycheck-define-checker sh-my-shellcheck&#xA;  &quot;Custom shellcheck checker&quot;&#xA;  :command (&quot;shellcheck&quot; &quot;-f&quot; &quot;checkstyle&quot;&#xA;        ;; here we join all the exclude types in the -e option&#xA;        ;; like: -e=SC2029,sc20xxx,...&#xA;        ;; this is the only NEW line to the existing shellcheck checker&#xA;        (eval (concat &quot;-e=&quot; (string-join shellcheck-exclude-types &quot;,&quot;)))&#xA;        &quot;-s&quot; (eval (symbol-name sh-shell))&#xA;            source)&#xA;  :modes sh-mode&#xA;  :error-parser flycheck-parse-checkstyle&#xA;  :predicate (lambda () (memq sh-shell flycheck-shellcheck-supported-shells)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found that SC2029 is the code for that kind of error by running shellcheck from the command line on the file, I have no idea where all the codes are documented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have your checker defined, you'll need to activate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to do it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'sh-mode-hook (lambda () (flycheck-select-checker 'sh-my-shellcheck)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-10-08T13:46:00.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="878" PostTypeId="2" ParentId="876" CreationDate="2014-10-08T13:49:30.970" Score="7" Body="&lt;p&gt;If by &quot;render larger&quot; you mean that the dimensions of the rendered png image are larger, then you could use some of the &lt;code&gt;doc-view&lt;/code&gt; functions to fit the image to your window: &lt;code&gt;doc-view-fit-page-to-window&lt;/code&gt;, &lt;code&gt;doc-view-fit-width-to-window&lt;/code&gt;, and &lt;code&gt;doc-view-fit-height-to-window&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, increase the resolution of the rendered image as you did, and then fit (probably shrink) the sharper image with the &lt;code&gt;...-fit-...&lt;/code&gt; functions.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-08T13:49:30.970" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="879" PostTypeId="2" ParentId="869" CreationDate="2014-10-08T13:49:33.593" Score="3" Body="&lt;p&gt;It can be a tremendous help when learning to use regexps to see what is matched by which parts of a regexp - in particular, regexp groups.  And to do that interactively and incrementally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Along the lines of @immerr's answer, &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt; search&lt;/a&gt; has had similar &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Search_Commands%2c_Overview#SearchHighlightingContextLevels&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlighting&lt;/a&gt; for a long time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1oN8O.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-08T13:57:10.527" LastActivityDate="2014-10-08T13:57:10.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="880" PostTypeId="2" ParentId="867" CreationDate="2014-10-08T13:52:56.430" Score="6" Body="&lt;p&gt;If it's just for a single invocation then, as per the eshell manual (look for the &quot;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/eshell.html#Built_002dins&quot;&gt;Built-in commands&lt;/a&gt;&quot; section), you can prefix any command with '*' to ignore the built-ins:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which ls&#xA;eshell/ls is a compiled Lisp function in `em-ls.el'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Compared with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which *ls&#xA;/usr/bin/ls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That same page has the tip that if you wanted to always do this (say for your &lt;code&gt;rm&lt;/code&gt; example), you could define a permanent alias:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ alias rm '*rm $*'&#xA;$ which rm&#xA;/usr/bin/rm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="737" LastEditorUserId="219" LastEditDate="2014-10-08T13:59:16.947" LastActivityDate="2014-10-08T13:59:16.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="881" PostTypeId="2" ParentId="802" CreationDate="2014-10-08T14:14:40.287" Score="0" Body="&lt;p&gt;This is the solution I currently use.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice magit-status (around magit-fullscreen activate)&#xA;  (window-configuration-to-register :magit-fullscreen)&#xA;  ad-do-it&#xA;  (delete-other-windows)) &#xA;&#xA; (defun custom-kill-buffers (regexp)&#xA;  &quot;Kill buffers matching REGEXP without asking for confirmation.&quot;&#xA;  (interactive &quot;sKill buffers matching this regular expression: &quot;)&#xA;  (flet ((kill-buffer-ask (buffer) (kill-buffer buffer)))&#xA;    (kill-matching-buffers regexp)))&#xA;&#xA;(defun magit-quit-session ()&#xA;  &quot;Restores the previous window configuration and kills the magit buffer&quot;&#xA;  (interactive)&#xA;  (custom-kill-buffers &quot;^\\*magit&quot;)&#xA;  (jump-to-register :magit-fullscreen))&#xA;&#xA;(define-key magit-status-mode-map (kbd &quot;q&quot;) 'magit-quit-session)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I customized the solution explained on &lt;a href=&quot;http://whattheemacsd.com/setup-magit.el-01.html&quot; rel=&quot;nofollow&quot;&gt;whattheemacsd.com&lt;/a&gt;: I close every magit buffer when I press &quot;q&quot;.&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2014-10-08T14:14:40.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="882" PostTypeId="2" ParentId="737" CreationDate="2014-10-08T14:20:37.937" Score="9" Body="&lt;p&gt;You can use &lt;code&gt;ibuffer&lt;/code&gt; mode to mark the buffers you would like to search. Call &lt;code&gt;ibuffer-do-isearch&lt;/code&gt; (bound to &lt;code&gt;M-s a C-s&lt;/code&gt; by default) to search for text, or &lt;code&gt;ibuffer-do-isearch-regexp&lt;/code&gt; if you need to search for a regular expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you aren't familiar with &lt;code&gt;ibuffer&lt;/code&gt;, fire it up and take a look at the Mark menu to see all the ways you can choose a set of buffers on which to operate.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-08T14:20:37.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="883" PostTypeId="1" AcceptedAnswerId="889" CreationDate="2014-10-08T14:23:25.940" Score="5" ViewCount="558" Body="&lt;p&gt;The great org-mode has a fast way to jump between headings in an org file; &lt;code&gt;M-x org-goto&lt;/code&gt; or &lt;code&gt;C-c C-j&lt;/code&gt;. This doesn't work with evil mode that well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am on evil normal mode in an org file, &lt;code&gt;C-c C-j&lt;/code&gt; gets me the &lt;code&gt;org-goto&lt;/code&gt; interface alright but I stay in normal mode. The same happens if I'm in insert mode. Even when I'm in Emacs state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is after the invocation of &lt;code&gt;C-c C-j&lt;/code&gt; when I have to manually intervene and jump into Emacs state by myself in order to have the functionality work as intended. When I'm finished there, I stay in Emacs state, which I do not desire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had these two obvious tries with the machinery but evil ignores both methods. I'm in normal mode, no matter what.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; No go&#xA;(defun progo-org-goto ()&#xA;  (interactive)&#xA;  (call-interactively 'evil-emacs-state)&#xA;  (call-interactively 'org-goto))&#xA;&#xA;;; no go; but the advice did run.&#xA;;; also tried &quot;after&quot;&#xA;(defadvice org-goto (before goto-advice activate)&#xA;  (message &quot;adviced goto&quot;)&#xA;  (call-interactively 'evil-emacs-state))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what kind of magic do I have to perform to have evil change to Emacs state during the &lt;code&gt;org-goto&lt;/code&gt; and then return to normal mode afterwards?&lt;/p&gt;&#xA;" OwnerUserId="318" LastEditorUserId="253" LastEditDate="2014-10-08T16:16:47.183" LastActivityDate="2014-10-08T16:16:47.183" Title="Using evil-mode with a function that does not work well with evil-mode" Tags="|org-mode|evil|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="884" PostTypeId="2" ParentId="802" CreationDate="2014-10-08T14:23:36.113" Score="1" Body="&lt;p&gt;Specifically with regards to Magit and &lt;code&gt;magit-status&lt;/code&gt;, the following should do the trick for you:  &lt;a href=&quot;http://whattheemacsd.com/setup-magit.el-01.html&quot; rel=&quot;nofollow&quot;&gt;Magit Status Fullscreen&lt;/a&gt; from Magnar Sveen's What the .emacs.d!? blog.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; full screen magit-status&#xA;(defadvice magit-status (around magit-fullscreen activate)&#xA;  (window-configuration-to-register :magit-fullscreen)&#xA;  ad-do-it&#xA;  (delete-other-windows))&#xA;&#xA;;; restore previously hidden windows&#xA;(defadvice magit-quit-window (around magit-restore-screen activate)  &#xA;  ad-do-it&#xA;  (jump-to-register :magit-fullscreen))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Updated with Brad Wright's comment with regards to restoring previous view.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-08T14:23:36.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="885" PostTypeId="2" ParentId="866" CreationDate="2014-10-08T14:26:23.360" Score="9" Body="&lt;p&gt;Thanks J David for forcing me to look more deeply.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;flycheck.el defines sh-bash, the checker used for bash; and that has a next-checker known as sh-shellcheck.  Ans, as Jordon is points out, that invokes &lt;a href=&quot;http://www.shellcheck.net/&quot;&gt;shellcheck&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Poking around in &lt;a href=&quot;https://github.com/koalaman/shellcheck&quot;&gt;2&lt;/a&gt; reveals how to supress warning in a selective manner:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function f(){    &#xA;   # shellcheck disable=SC2029&#xA;   ssh foo &quot;$@&quot; &#xA;}&#xA;&#xA;ssh foo &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finding that number SC2029, was tedious and in the end I ran shellcheck directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one is having this problem with other flycheck variations you need to track down, what checker(s) are being used, and then how that checker handles adjusting the checks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I get the pony I've been wishing for I'll wish for a command in flycheck that just adds a line like that based on it's awesome comprehension of the file mode, the checker, etc. etc.&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2014-10-08T14:26:23.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="886" PostTypeId="2" ParentId="883" CreationDate="2014-10-08T14:38:34.580" Score="4" Body="&lt;p&gt;&lt;code&gt;org-goto&lt;/code&gt; creates a new buffer named &lt;code&gt;*org-goto*&lt;/code&gt; when you use it. Therefore, you can check for this name with a hook, using something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda ()&#xA;                           (if (string= &quot;*org-goto*&quot; (buffer-name))&#xA;                               (evil-emacs-state))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-10-08T14:38:34.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="887" PostTypeId="5" CreationDate="2014-10-08T14:46:45.707" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.flycheck.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;Flycheck&lt;/a&gt; is an on-the-fly syntax checking package for GNU Emacs 24, replacing the built-in Flymake extension.  It features in-buffer error highlights, automatic background checking, a dynamic error list, and a rich extension interface.  It has built-in support for many programming and markup languages, including C/C++, Go, Haskell, JavaScript, PHP, Python, Ruby, LaTeX, Shell scripts, and many more, and can easily be extended for new languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is available for installation via package.el from the popular MELPA and MELPA Stable archives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information and comprehensive documentation please consult the &lt;a href=&quot;http://www.flycheck.org/en/latest/index.html#the-user-guide&quot; rel=&quot;nofollow noreferrer&quot;&gt;online manual&lt;/a&gt;, which is also included in the Flycheck packages in the above archives for online reading in Emacs' info browser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please follow our &lt;a href=&quot;http://www.flycheck.org/en/latest/community/conduct.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Code of Conduct&lt;/a&gt; when posting under this tag.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="14920" LastEditDate="2018-10-16T19:22:55.997" LastActivityDate="2018-10-16T19:22:55.997" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="888" PostTypeId="4" CreationDate="2014-10-08T14:46:45.707" Score="0" Body="Flycheck is an on-the-fly syntax checking package for GNU Emacs 24, with in-buffer error highlighting, automatic background checking, a dynamic error list, and built-in support for over 40 programming and markup languages." OwnerDisplayName="user227" LastEditorUserId="14920" LastEditDate="2018-10-23T20:40:25.077" LastActivityDate="2018-10-23T20:40:25.077" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="889" PostTypeId="2" ParentId="883" CreationDate="2014-10-08T14:54:09.007" Score="5" Body="&lt;p&gt;Your instincts were right on advising &lt;code&gt;org-goto&lt;/code&gt;, but you want around advice rather than before advice.  The following advice should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-goto (around make-it-evil activate)&#xA;  (let ((orig-state evil-state)&#xA;        (evil-emacs-state-modes (cons 'org-mode evil-emacs-state-modes)))&#xA;    ad-do-it&#xA;    (evil-change-state orig-state)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It saves your current state in the &lt;code&gt;let&lt;/code&gt;-bound &lt;code&gt;orig-state&lt;/code&gt;, temporarily adds &lt;code&gt;org-mode&lt;/code&gt; to &lt;code&gt;evil-emacs-state-modes&lt;/code&gt; so that &lt;code&gt;*org-goto*&lt;/code&gt; (whose major mode is &lt;code&gt;org-mode&lt;/code&gt;) will be opened in &lt;code&gt;emacs-state&lt;/code&gt;, runs the regular &lt;code&gt;org-goto&lt;/code&gt; function via &lt;code&gt;ad-do-it&lt;/code&gt;, and then restores your original state.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-10-08T15:25:07.310" LastActivityDate="2014-10-08T15:25:07.310" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="890" PostTypeId="2" ParentId="653" CreationDate="2014-10-08T15:27:19.570" Score="1" Body="&lt;p&gt;I'm aware that the following does not answer the question of &lt;em&gt;How can I find out which keymap&lt;/em&gt;, however it deals with the underlying issue in this case of how to ensure that the &lt;code&gt;d&lt;/code&gt; key behaves according to what the user wants.  If preferred, I can remove this answer and convert into another question + answer regarding that issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a method to override the &lt;code&gt;text-property/overlay&lt;/code&gt; map, you should be able to use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((map (make-sparse-keymap)))&#xA;  (define-key map &quot;d&quot; 'evil-previous-line)&#xA;  (setq overriding-local-map map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As per &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html&quot; rel=&quot;nofollow&quot;&gt;Controlling Active Maps&lt;/a&gt;, &lt;code&gt;overriding-local-map&lt;/code&gt; takes precedence over every other active map other than &lt;code&gt;overriding-terminal-local-map&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-08T15:27:19.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="891" PostTypeId="1" CreationDate="2014-10-08T15:34:23.393" Score="7" ViewCount="1537" Body="&lt;p&gt;After modifying multiple files, how can I save all their buffers?&lt;/p&gt;&#xA;" OwnerUserId="559" LastEditorUserId="50" LastEditDate="2014-10-08T16:25:10.670" LastActivityDate="2014-10-08T16:25:10.670" Title="How to save multiple buffers" Tags="|buffers|saving|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="892" PostTypeId="2" ParentId="891" CreationDate="2014-10-08T15:34:23.393" Score="9" Body="&lt;p&gt;After making the changes you can save the open buffers using &lt;code&gt;save-some-buffers&lt;/code&gt;. This is bound &lt;code&gt;C-x s&lt;/code&gt; by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what the docs say.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Save some modified file-visiting buffers.  Asks user about each one. &#xA;You can answer `y' to save, `n' not to save, `C-r' to look at the &#xA;buffer in question with `view-buffer' before deciding or `d' to &#xA;view the differences using `diff-buffer-with-file'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;C-u C-x s&lt;/code&gt; to save without asking.&lt;/p&gt;&#xA;" OwnerUserId="559" LastActivityDate="2014-10-08T15:34:23.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="893" PostTypeId="2" ParentId="27" CreationDate="2014-10-08T15:38:46.140" Score="26" Body="&lt;p&gt;&lt;strong&gt;[NOTE]&lt;/strong&gt; this answer was heavily edited to follow the updates of &lt;code&gt;with-editor&lt;/code&gt; developments. Most comments likely won't make much sense anymore. There are  some new comments which &lt;em&gt;do&lt;/em&gt; make sense.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/magit/magit&quot; rel=&quot;noreferrer&quot;&gt;Magit&lt;/a&gt; contains a library named &lt;code&gt;with-editor&lt;/code&gt; available at &lt;a href=&quot;https://github.com/magit/with-editor&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/magit/with-editor&lt;/a&gt; which allows you &#xA;to use your local Emacs as an $EDITOR on remote machines over TRAMP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another alternative is &lt;a href=&quot;https://github.com/habnabit/remote-emacsclient&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/habnabit/remote-emacsclient&lt;/a&gt;, but it seems more complicated &amp;amp; less generic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest way to install &lt;code&gt;with-editor&lt;/code&gt; is through MELPA:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x package-install with-editor&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, just grab &lt;a href=&quot;https://github.com/magit/with-editor/blob/master/with-editor.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/magit/with-editor/blob/master/with-editor.el&lt;/a&gt; somewhere to your load path and &lt;code&gt;require&lt;/code&gt; it (it also depends on dash).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, simply start &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;eshell&lt;/code&gt; or &lt;code&gt;ansi-term&lt;/code&gt; and do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x with-editor-export-editor&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It'll ask you which $EDITOR you are interested in, just press enter for the default &lt;code&gt;EDITOR&lt;/code&gt; variable. Then inside the shell you can type &lt;code&gt;crontab -e&lt;/code&gt; and edit your crontab within emacs. Press &lt;kbd&gt;C-c C-c&lt;/kbd&gt; to save the crontab or &lt;kbd&gt;C-c C-k&lt;/kbd&gt; to cancel editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a more permanent setup:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'shell-mode-hook  'with-editor-export-editor)&#xA;(add-hook 'term-mode-hook   'with-editor-export-editor)&#xA;(add-hook 'eshell-mode-hook 'with-editor-export-editor)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use &lt;kbd&gt;M-x with-editor-async-shell-command crontab -e RET&lt;/kbd&gt; for quick commands.&lt;/p&gt;&#xA;" OwnerUserId="790" LastEditorUserId="790" LastEditDate="2016-02-09T07:33:35.333" LastActivityDate="2016-02-09T07:33:35.333" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="894" PostTypeId="2" ParentId="891" CreationDate="2014-10-08T15:50:46.437" Score="5" Body="&lt;p&gt;&lt;kbd&gt;M-x ibuffer * u S&lt;/kbd&gt; is quite convenient for this as well, because you can add/remove selected buffers with &lt;code&gt;m&lt;/code&gt; or &lt;code&gt;u&lt;/code&gt; before saving with &lt;code&gt;S&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="790" LastActivityDate="2014-10-08T15:50:46.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="895" PostTypeId="1" CreationDate="2014-10-08T16:53:06.127" Score="4" ViewCount="910" Body="&lt;p&gt;Is there an equivalent &lt;code&gt;find-grep-dired&lt;/code&gt; using &lt;code&gt;ack&lt;/code&gt; or &lt;code&gt;ag&lt;/code&gt;? With the ability to specify the directory where the search starts? The Dired output itself is not so important (in fact I prefer the &lt;em&gt;ack-mode&lt;/em&gt; result output). The closest thing I found is a Projectile &lt;code&gt;ag&lt;/code&gt;/&lt;code&gt;ack&lt;/code&gt; integration where the prefix argument prompts for the directory, but I was looking for something more general. &lt;/p&gt;&#xA;" OwnerUserId="679" LastEditorUserId="105" LastEditDate="2014-10-10T17:17:53.387" LastActivityDate="2014-10-10T17:17:53.387" Title="find-grep-dired equivalents for ack and ag" Tags="|search|dired|files|projectile|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="896" PostTypeId="2" ParentId="895" CreationDate="2014-10-08T17:11:57.797" Score="2" Body="&lt;p&gt;The &lt;code&gt;ag&lt;/code&gt; package (available on MELPA) has the ability to run &lt;code&gt;ag&lt;/code&gt; only within your specified folder or in project root. Check out its &lt;a href=&quot;https://github.com/Wilfred/ag.el#running-a-search&quot; rel=&quot;nofollow noreferrer&quot;&gt;README&lt;/a&gt; on its github for more info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some of the answers from this stackexchange the elaborate on the use of &lt;code&gt;ag&lt;/code&gt; in emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/453/115&quot;&gt;What is the easiest way to search all useful files inside a single project?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/243/115&quot;&gt;Is there a way to use query-replace from grep/ack/ag output modes?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-10-08T17:37:10.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="897" PostTypeId="2" ParentId="805" CreationDate="2014-10-08T17:23:17.213" Score="6" Body="&lt;h2&gt;The Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The problem here is that there’s no face to control the appearance of&#xA;the margins. You can display text in the margin using overlays (that’s&#xA;what &lt;code&gt;linum-mode&lt;/code&gt; does) but, like any text in Emacs, it’s constrained&#xA;to the limits of the buffer. So you can’t have any control over the&#xA;margin display beyond the last line of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you &lt;strong&gt;can&lt;/strong&gt; do, is fix those faulty lines in-between. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What to put there&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This variable controls what you want to display on those visual lines&#xA;“between” two logical lines. The important part is the &lt;code&gt;'face 'linum&lt;/code&gt;,&#xA;which ensures these lines will follow the appearance of &lt;code&gt;linum-mode&lt;/code&gt;.&#xA;The &lt;code&gt;&quot;-----&quot;&lt;/code&gt; part is demonstrative, you can change it to spaces or&#xA;whatever you wish.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar endless/margin-display&#xA;  `((margin left-margin) ,(propertize &quot;-----&quot; 'face 'linum))&#xA;  &quot;String used on the margin.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;How to do it&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The following code goes through the buffer and places overlays&#xA;(similar to the ones &lt;code&gt;linum-mode&lt;/code&gt; uses) on each line which isn’t&#xA;“real”.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar-local endless/margin-overlays nil&#xA;  &quot;List of overlays in current buffer.&quot;)&#xA;&#xA;(defun endless/setup-margin-overlays ()&#xA;  &quot;Put overlays on each line which is visually wrapped.&quot;&#xA;  (interactive)&#xA;  (let ((ww (- (window-width)&#xA;               (if (= 0 (or (cdr fringe-mode) 1)) 1 0)))&#xA;        ov)&#xA;    (mapc #'delete-overlay endless/margin-overlays)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (null (eobp))&#xA;        ;; On each logical line&#xA;        (forward-line 1)&#xA;        (save-excursion&#xA;          (forward-char -1)&#xA;          ;; Check if it has multiple visual lines.&#xA;          (while (&amp;gt;= (current-column) ww)&#xA;            (endles/make-overlay-at (point))&#xA;            (forward-char (- ww))))))))&#xA;&#xA;(defun endles/make-overlay-at (p)&#xA;  &quot;Create a margin overlay at position P.&quot;&#xA;  (push (make-overlay p (1+ p)) endless/margin-overlays)&#xA;  (overlay-put&#xA;   (car endless/margin-overlays) 'before-string&#xA;   (propertize &quot; &quot;  'display endless/margin-display)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And we want to it run whenever &lt;code&gt;linum-mode&lt;/code&gt; updates the line numbers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'linum-before-numbering-hook #'endless/setup-margin-overlays)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-08T17:23:17.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="898" PostTypeId="2" ParentId="822" CreationDate="2014-10-08T17:35:37.590" Score="3" Body="&lt;p&gt;I've been using something modeled after &lt;a href=&quot;https://github.com/purcell/emacs.d/blob/master/lisp/init-sessions.el&quot; rel=&quot;nofollow&quot;&gt;sanityinc's .emacs.d&lt;/a&gt;.&#xA;It uses &lt;code&gt;desktop-save-mode&lt;/code&gt;, and also is smart enough to use &lt;code&gt;frame-restore&lt;/code&gt; on older versions emacs.&#xA;From the readme for &lt;code&gt;frame-restore&lt;/code&gt; from &lt;code&gt;package-list-packages&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Save and restore parameters of Emacs frames.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Just call &lt;code&gt;frame-restore' in your&lt;/code&gt;init.el':&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(frame-restore-mode)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note that since r113242 the built-in Desktop Save mode will restore&#xA;  frames. If you are using a Emacs snapshot build later than this&#xA;  revision, you are&#xA;  &lt;em&gt;strongly&lt;/em&gt; advised to use Desktop Save mode instead:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(desktop-save-mode)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Frame Restore mode will display a bold warning if enabled in an Emacs&#xA;  build whose Desktop Save mode can restore frames.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="623" LastActivityDate="2014-10-08T17:35:37.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="899" PostTypeId="2" ParentId="869" CreationDate="2014-10-08T17:44:10.677" Score="6" Body="&lt;p&gt;I use &lt;code&gt;regexp-builder&lt;/code&gt; which let's you test regexps interactively and get feedback.&#xA;And of course, once I started using that, I immediately asked myself &quot;How do I feed this regexp into &lt;code&gt;query-replace-regexp&lt;/code&gt;?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer I chose is the following function defined on the &lt;a href=&quot;http://www.emacswiki.org/emacs/ReBuilder&quot; rel=&quot;noreferrer&quot;&gt;EmacsWiki ReBuilder&lt;/a&gt; page.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun reb-query-replace (to-string)&#xA;  &quot;Replace current RE from point with `query-replace-regexp'.&quot;&#xA;  (interactive&#xA;   (progn (barf-if-buffer-read-only)&#xA;          (list (query-replace-read-to (reb-target-binding reb-regexp)&#xA;                                       &quot;Query replace&quot;  t))))&#xA;  (with-current-buffer reb-target-buffer&#xA;    (query-replace-regexp (reb-target-binding reb-regexp) to-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my workflow is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x re-builder&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;type type type&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x reb-query-replace&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="623" LastEditorUserId="623" LastEditDate="2014-10-08T18:39:42.307" LastActivityDate="2014-10-08T18:39:42.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="900" PostTypeId="1" AcceptedAnswerId="2093" CreationDate="2014-10-08T18:05:37.090" Score="5" ViewCount="627" Body="&lt;p&gt;A nice feature of viewing binary files with &lt;code&gt;hexl-mode&lt;/code&gt; is it displays the equivalent ASCII values to the right of your hexidecimal lines. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make &lt;code&gt;hexl-mode&lt;/code&gt; treat hex values as floats, doubles, or some other format instead of ASCII? If not, is there a way to easily do the conversion on a line or region basis and display the result in the same buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions for modes besides hexl-mode are fine, but I would prefer to stick to the built-in modes if it doesn't require too much &lt;code&gt;.emacs&lt;/code&gt; configuration.&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2014-10-12T04:03:44.167" LastActivityDate="2022-06-27T07:30:24.603" Title="How can I convert hexidecimal values to base 10 in hexl-mode?" Tags="|binary|hexl-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="901" PostTypeId="2" ParentId="278" CreationDate="2014-10-08T18:29:44.003" Score="8" Body="&lt;p&gt;&lt;code&gt;nlinum-mode&lt;/code&gt; is another option. It has the same interface as &lt;code&gt;linum-mode&lt;/code&gt;, so you can use the same hooks, but it uses a different technology to be more performant. Quote from &lt;code&gt;nlinum.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;;; This is like linum-mode, but uses jit-lock to be (hopefully) more efficient.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can install it via GNU Elpa via the usual &lt;code&gt;list-packages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://elpa.gnu.org/packages/nlinum.html&quot; rel=&quot;noreferrer&quot;&gt;http://elpa.gnu.org/packages/nlinum.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="810" LastActivityDate="2014-10-08T18:29:44.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="902" PostTypeId="1" CreationDate="2014-10-08T18:50:17.970" Score="3" ViewCount="1975" Body="&lt;p&gt;I share my .emacs file between machines, which works great but I use a lot of packages and when emacs starts on a new machine with the .emacs it complains about the missing package.  I can ignore it until I install that package, but it's laborious having to manually install packages.  Is there a way to install all the packages needed by my .emacs file?  &lt;/p&gt;&#xA;" OwnerUserId="814" LastEditorUserId="50" LastEditDate="2014-10-08T19:02:41.220" LastActivityDate="2014-10-08T20:03:57.803" Title="install multiple packages from my .emacs file" Tags="|package|init-file|" AnswerCount="3" CommentCount="0" ClosedDate="2014-10-09T08:51:03.343" ContentLicense="CC BY-SA 3.0" />
  <row Id="903" PostTypeId="2" ParentId="278" CreationDate="2014-10-08T19:02:16.297" Score="4" Body="&lt;p&gt;Certainly &lt;code&gt;linum-mode&lt;/code&gt; is a good choice.&#xA;If you don't always want to see line numbers, like me, you can use this trick from the excellent &lt;a href=&quot;http://whattheemacsd.com/key-bindings.el-01.html&quot; rel=&quot;nofollow&quot;&gt;What the .emacs.d!?&lt;/a&gt; blog.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This temporarily enables &lt;code&gt;linum-mode&lt;/code&gt; when you run &lt;code&gt;goto-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code from his blog:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [remap goto-line] 'goto-line-with-feedback)&#xA;&#xA;(defun goto-line-with-feedback ()   &quot;Show line numbers temporarily, while prompting for the line number input&quot;   (interactive)   (unwind-protect&#xA;      (progn&#xA;        (linum-mode 1)&#xA;        (goto-line (read-number &quot;Goto line: &quot;)))&#xA;    (linum-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="623" LastActivityDate="2014-10-08T19:02:16.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="904" PostTypeId="1" AcceptedAnswerId="1049" CreationDate="2014-10-08T19:06:24.090" Score="5" ViewCount="314" Body="&lt;h3&gt;First, some context:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I am in the process of debugging a strange interaction between &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/manual/Speed-keys.html&quot;&gt;Org Speed Keys&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After editing an &lt;code&gt;.org&lt;/code&gt; file for a while, specific speed keys for navigating the outline start to be treated as though they are modifying the buffer. For instance, if I press &lt;code&gt;n&lt;/code&gt; on a heading after saving the file, the portion of the mode line that indicates whether the file has been modified or not changes from &lt;code&gt;--&lt;/code&gt; (unmodified) to &lt;code&gt;**&lt;/code&gt; (modified). No characters are inserted into the buffer though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to figure out what might be causing this problem by doing &lt;kbd&gt;C-h k&lt;/kbd&gt; &lt;code&gt;n&lt;/code&gt; right after opening the &lt;code&gt;.org&lt;/code&gt; file and then again after the problematic behavior started. Turns out that initially, &lt;code&gt;n&lt;/code&gt; is bound to &lt;code&gt;org-self-insert-command&lt;/code&gt;, and gets rebound to &lt;code&gt;sp--self-insert-command&lt;/code&gt; later on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I have no idea &lt;em&gt;when&lt;/em&gt; the command bound to &lt;code&gt;n&lt;/code&gt; changes. I also tried &lt;kbd&gt;C-h l&lt;/kbd&gt; (&lt;code&gt;view-lossage&lt;/code&gt;) a few times after the behavior changed but I couldn't detect any patterns that would give me a hint as to what might be triggering the change in behavior.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Question:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I think in order to solve this problem I need to pinpoint the exact command that is causing &lt;code&gt;n&lt;/code&gt; to be rebound to &lt;code&gt;sp--self-insert-command&lt;/code&gt; (if only to be able to automatically reset the binding).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is: &lt;strong&gt;How can I detect when the command bound to&lt;/strong&gt; &lt;code&gt;n&lt;/code&gt; &lt;strong&gt;changes?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2014-10-10T18:30:10.673" Title="Detect when a key is rebound to another command" Tags="|org-mode|hooks|key-bindings|smartparens|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="905" PostTypeId="2" ParentId="902" CreationDate="2014-10-08T19:34:01.900" Score="0" Body="&lt;p&gt;This is one way to do it. I took the idea from &lt;a href=&quot;http://www.aaronbedra.com/emacs.d/&quot; rel=&quot;nofollow&quot;&gt;Aaron Bedra&lt;/a&gt;. Basically you group the packages you want to install. If they are not installed, they will be installed when you start Emacs. If they are already installed, nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar custom/packages '(ido-ubiquitous&#xA;          ido-vertical-mode&#xA;          flx-ido&#xA;          smex&#xA;          browse-kill-ring&#xA;          hungry-delete&#xA;          smartscan&#xA;          org&#xA;          magit&#xA;          auctex&#xA;          latex-pretty-symbols&#xA;          ebib&#xA;          latex-preview-pane&#xA;          latex-extra&#xA;          adaptive-wrap&#xA;          clojure-mode&#xA;          cider&#xA;          pandoc-mode&#xA;          multifiles&#xA;          rainbow-delimiters&#xA;          bookmark+)&#xA;  &quot;Default packages&quot;)&#xA;&#xA;(defun custom/packages-installed-p ()&#xA;  (loop for pkg in custom/packages&#xA;        when (not (package-installed-p pkg)) do (return nil)&#xA;        finally (return t)))&#xA;&#xA;(unless (custom/packages-installed-p)&#xA;  (when (not package-archive-contents)&#xA;    (message &quot;%s&quot; &quot;Refreshing package database...&quot;)&#xA;    (package-refresh-contents)&#xA;    (dolist (pkg custom/packages)&#xA;      (when (not (package-installed-p pkg))&#xA;    (package-install pkg)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-08T19:43:48.800" LastActivityDate="2014-10-08T19:43:48.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="906" PostTypeId="2" ParentId="902" CreationDate="2014-10-08T19:53:47.860" Score="1" Body="&lt;p&gt;I manage this by dotting &lt;code&gt;require-package&lt;/code&gt; calls around &lt;a href=&quot;https://github.com/purcell/emacs.d/&quot; rel=&quot;nofollow&quot;&gt;my emacs config&lt;/a&gt;, where &lt;code&gt;require-package&lt;/code&gt; is defined as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun require-package (package &amp;amp;optional min-version no-refresh)&#xA;  &quot;Install given PACKAGE, optionally requiring MIN-VERSION.&#xA;If NO-REFRESH is non-nil, the available package lists will not be&#xA;re-downloaded in order to locate PACKAGE.&quot;&#xA;  (if (package-installed-p package min-version)&#xA;      t&#xA;    (if (or (assoc package package-archive-contents) no-refresh)&#xA;        (package-install package)&#xA;      (progn&#xA;        (package-refresh-contents)&#xA;        (require-package package min-version t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then elsewhere I'll have code like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require-package 'haskell-mode)&#xA;(add-hook 'haskell-mode-hook 'interactive-haskell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to get fancier about it, you can use John Wiegley's &lt;a href=&quot;http://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt; package, which has an &lt;code&gt;:ensure&lt;/code&gt; keyword that triggers package installation. But then, you still have to install &lt;code&gt;use-package&lt;/code&gt; itself first, e.g. with a call to &lt;code&gt;package-install&lt;/code&gt;!&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2014-10-08T19:58:58.483" LastActivityDate="2014-10-08T19:58:58.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="907" PostTypeId="2" ParentId="728" CreationDate="2014-10-08T20:03:48.660" Score="9" Body="&lt;p&gt;I'm surprised nobody mentioned &lt;code&gt;iswitchb&lt;/code&gt; yet. It may not be as powerful as &lt;code&gt;ido&lt;/code&gt;, but long before &lt;code&gt;ido-mode&lt;/code&gt; was born &lt;code&gt;iswitchb-mode&lt;/code&gt; was already standard for emacs, and it is still useful nowadays.&#xA;To try it just put&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(iswitchb-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into your .emacs or activate via &lt;code&gt;M-x iswitchb-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="813" LastActivityDate="2014-10-08T20:03:48.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="908" PostTypeId="2" ParentId="902" CreationDate="2014-10-08T20:03:57.803" Score="0" Body="&lt;p&gt;Since I write my configuration in a org file and then use some org-babel magic to make a .el which is loaded later by Emacs, I wrote a script in Python that I run from the same org file and it creates a .el file with every package installed in my emacs configuration, this is how it looks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Repositorio de paquetes&#xA;&amp;lt;Spanish comments omitted...&amp;gt;&#xA;&#xA;#+begin_src emacs-lisp&#xA;  (setf package-archives (list (quote (&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;))&#xA;                               (quote (&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;                               (quote (&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;                               (quote (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))))&#xA;#+end_src&#xA;&#xA;&amp;lt;Spanish comments omitted...&amp;gt;&#xA;&#xA;** Listado, revisión e instalación de paquetes con Melpa&#xA;&amp;lt;Spanish comments omitted...&amp;gt;&#xA;&#xA;#+BEGIN_SRC emacs-lisp&#xA;  (org-babel-do-load-languages&#xA;   'org-babel-load-languages&#xA;   '(&#xA;     (emacs-lisp . t)&#xA;     (python . t)&#xA;     )&#xA;  )&#xA;#+END_SRC&#xA;&#xA;#+name: codigopython&#xA;#+BEGIN_SRC python :results output :file paquetes.el&#xA;  import os&#xA;&#xA;  if os.path.isdir(os.path.expanduser(&quot;~/.emacs.d/elpa/&quot;)):&#xA;      melpapackages = os.listdir(os.path.expanduser(&quot;~/.emacs.d/elpa/&quot;))&#xA;      packagestoinstall = []&#xA;      for package in melpapackages:&#xA;          if os.path.isdir(os.path.expanduser(&quot;~/.emacs.d/elpa/&quot;) + package):&#xA;              name = package[:package.rfind(&quot;-&quot;)]&#xA;              if not name == &quot;archive&quot;:&#xA;                  packagestoinstall.append(&#xA;                      &quot;(use-package {0}\n  :ensure {0})&quot;.format(name))&#xA;&#xA;      # Remove any repeated package. This can happen if different directories&#xA;      # with the same package name exists in the elpa/ directory&#xA;      packagestoinstall = list(set(packagestoinstall))&#xA;&#xA;      # Sort things, please!&#xA;      packagestoinstall.sort()&#xA;      print(&quot;\n&quot;.join(packagestoinstall))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: codigopython&#xA;[[file:paquetes.el]]&#xA;&#xA;&amp;lt;Spanish comments omitted...&amp;gt;&#xA;&#xA;#+BEGIN_SRC emacs-lisp :results silent&#xA;  (unless (file-exists-p (expand-file-name &quot;elpa/archives/melpa&quot; user-emacs-directory))&#xA;    (package-refresh-contents))&#xA;&#xA;  (when (not (package-installed-p 'use-package))&#xA;    (package-install 'use-package))&#xA;&#xA;  (require 'use-package)&#xA;  (load-file (expand-file-name &quot;paquetes.el&quot; user-emacs-directory))&#xA;#+END_SRC&#xA;&#xA;&amp;lt;Spanish comments omitted...&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just have to move the cursor inside the source block with the python code, do &lt;kbd&gt;C&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;C&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt; and BAM! I have all my packages installed listed automatically :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want, you can copy the Python snippet and paste it inside a file, so you can call it as a command from your shell, redirecting the output to a file. This in case you don't use org-mode and org-babel for your Emacs configuration!&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-10-08T20:03:57.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="909" PostTypeId="1" AcceptedAnswerId="914" CreationDate="2014-10-08T20:49:46.457" Score="7" ViewCount="3074" Body="&lt;p&gt;I'm using org-mode as a knowledge base, where each file is for a specific project that I'm working on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each file has its own journal and I would love to see an aggregated journal of all the things I've done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That information is in a bunch of &lt;code&gt;.org&lt;/code&gt; files in a specific directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The functionality I'm looking for is what the agenda timeline provides, but it only works for one file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make it work for all files in &lt;code&gt;org-agenda-files&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="829" LastEditorUserId="2274" LastEditDate="2015-02-01T18:46:26.780" LastActivityDate="2015-02-01T18:46:26.780" Title="How can I have an agenda timeline view of multiple files?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="911" PostTypeId="1" AcceptedAnswerId="9429" CreationDate="2014-10-08T21:36:43.777" Score="11" ViewCount="1536" Body="&lt;p&gt;I've tried simple searches on Google and MELPA with keywords like &quot;emacs poetry mode&quot; or &quot;emacs verse mode&quot; but haven't found anything specifically built for the purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual walks through some common extensions to &lt;code&gt;text-mode&lt;/code&gt; but they're designed for text-plus-markup.  I'm looking for text-plus-distinctive-formatting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org has &lt;code&gt;#+BEGIN_VERSE&lt;/code&gt; / &lt;code&gt;#+END_VERSE&lt;/code&gt; markup, which preserves whitespace upon export.  That's about as far as you can get from what I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a mode that knows a few conventions for indentation, capitalization, and punctuation.  Bonus points if it's good about respecting isolated breaks from those conventions.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2015-02-20T06:05:06.407" Title="Is there an Emacs mode convenient for writing poetry?" Tags="|indentation|capitalization|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="912" PostTypeId="2" ParentId="349" CreationDate="2014-10-08T21:50:45.403" Score="3" Body="&lt;p&gt;There's &lt;a href=&quot;https://github.com/chrisbarrett/swift-mode&quot; rel=&quot;nofollow&quot;&gt;swift-mode&lt;/a&gt; which is available on &lt;a href=&quot;http://melpa.milkbox.net/&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;. This offers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Syntax highlighting&lt;/li&gt;&#xA;&lt;li&gt;Indentation&lt;/li&gt;&#xA;&lt;li&gt;Code navigation with imenu&lt;/li&gt;&#xA;&lt;li&gt;Syntax checking with &lt;a href=&quot;https://github.com/flycheck/flycheck&quot; rel=&quot;nofollow&quot;&gt;flycheck&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There's &lt;a href=&quot;https://github.com/iamleeg/swift-mode&quot; rel=&quot;nofollow&quot;&gt;another swift-mode here&lt;/a&gt;, but it looks less complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To run code on the device, your best option is probably calling &lt;a href=&quot;https://github.com/roupam/fruitstrap&quot; rel=&quot;nofollow&quot;&gt;fruitstrap&lt;/a&gt; from Emacs (&lt;a href=&quot;http://roupam.github.io/#sec-5&quot; rel=&quot;nofollow&quot;&gt;discussed here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2014-10-08T21:50:45.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="913" PostTypeId="1" AcceptedAnswerId="944" CreationDate="2014-10-08T22:01:19.213" Score="3" ViewCount="572" Body="&lt;p&gt;How can I connect to a group chat using a bookmark with jabber.el? I figured out how to &lt;em&gt;look&lt;/em&gt; at the bookmarks via &lt;code&gt;M-x jabber-edit-bookmarks&lt;/code&gt;, but I can't find any commands to actually use them! (Actually &lt;em&gt;editing&lt;/em&gt; bookmarks seems unsupported, at least in my version of jabber.el.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a few bookmarks already set up with another service that &lt;em&gt;do&lt;/em&gt; show up in the Jabber bookmarks buffer, but I have no idea of how to actually connect through them.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="50" LastEditDate="2014-10-09T14:24:12.657" LastActivityDate="2014-10-09T14:24:12.657" Title="How can I connect to a Jabber group chat through a bookmark with jabber.el?" Tags="|jabber|bookmarks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="914" PostTypeId="2" ParentId="909" CreationDate="2014-10-08T22:27:28.187" Score="2" Body="&lt;p&gt;Based on the suggestions provided in &lt;a href=&quot;https://unix.stackexchange.com/a/55864/16894&quot;&gt;this answer&lt;/a&gt;, the following command collects the contents of all &lt;code&gt;org-agenda-files&lt;/code&gt; in a single file and then calls the &lt;code&gt;org-agenda&lt;/code&gt; command that builds the timeline:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-agenda-timeline-all (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (with-temp-buffer&#xA;    (dolist (org-agenda-file org-agenda-files)&#xA;      (insert-file-contents org-agenda-file nil)&#xA;      (end-of-buffer)&#xA;      (newline))&#xA;    (write-file &quot;/tmp/timeline.org&quot;)&#xA;    (org-agenda arg &quot;L&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For best results, set up a custom key binding for this command via&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c t&quot;) 'org-agenda-timeline-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additionally&lt;/strong&gt;, if you want the command to consider all &lt;code&gt;org-mode&lt;/code&gt; files that are currently open (in addition your &lt;code&gt;org-agenda-files&lt;/code&gt;, which may or may not be open), you can replace &lt;code&gt;org-agenda-files&lt;/code&gt; with a call to &lt;code&gt;(org-files-list)&lt;/code&gt; in the code above.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2015-02-01T10:56:45.567" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="915" PostTypeId="2" ParentId="777" CreationDate="2014-10-09T00:46:20.813" Score="9" Body="&lt;p&gt;Here's a function that closes all unclosed parentheses and other matched pairs, such as square brackets. It relies on Emacs's sexp parsing. It only supports single-character matched pairs, so something like &lt;code&gt;{-&lt;/code&gt; will be closed with &lt;code&gt;}&lt;/code&gt;, not &lt;code&gt;-}&lt;/code&gt;. For Lisp, that doesn't matter.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun close-all-parentheses ()&#xA;  (interactive &amp;quot;*&amp;quot;)&#xA;  (let ((closing nil))&#xA;    (save-excursion&#xA;      (while (condition-case nil&#xA;         (progn&#xA;           (backward-up-list)&#xA;           (let ((syntax (syntax-after (point))))&#xA;             (cl-case (car syntax)&#xA;               ((4) (setq closing (cons (cdr syntax) closing)))&#xA;               ((7 8) (setq closing (cons (char-after (point)) closing)))))&#xA;           t)&#xA;           ((scan-error) nil))))&#xA;    (apply #'insert (nreverse closing))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="14253" LastEditDate="2021-11-08T13:21:21.160" LastActivityDate="2021-11-08T13:21:21.160" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="916" PostTypeId="2" ParentId="844" CreationDate="2014-10-09T00:52:49.113" Score="2" Body="&lt;p&gt;Your code is working, as far as Emacs is concerned. But (as &lt;a href=&quot;https://emacs.stackexchange.com/a/845&quot;&gt;Malabarba correctly identified&lt;/a&gt;) it's inserting text into the buffer that's current while running code received by the server. That's a buffer called &lt;code&gt; *server*&lt;/code&gt;, not the buffer which you're currently editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Current-Buffer.html#Current-Buffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;switch to the desired buffer&lt;/a&gt; before inserting the text. Your desired buffer is the one that's shown in the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Selecting-Windows.html#Selecting-Windows&quot; rel=&quot;nofollow noreferrer&quot;&gt;currently selected window&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -e '(set-buffer (window-buffer (selected-window)))' -e &quot;(jay/insert-file-link \&quot;/tmp/foo\&quot;)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-10-09T00:52:49.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="917" PostTypeId="2" ParentId="827" CreationDate="2014-10-09T01:12:31.407" Score="1" Body="&lt;p&gt;If you're ok with using the mouse, you can use the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Secondary-Selection.html#Secondary-Selection&quot; rel=&quot;nofollow&quot;&gt;secondary selection&lt;/a&gt;. Press &lt;kbd&gt;Meta&lt;/kbd&gt;, then click and drag the left mouse button (&lt;code&gt;M-drag-mouse-1&lt;/code&gt;). This doesn't move the point as long as you're only copying text that's visible on the screen. You can copy the secondary selection with &lt;code&gt;M-mouse-3&lt;/code&gt; and yank it with &lt;code&gt;M-mouse-2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from the secondary selection, you will need to move the cursor to select arbitrary text, because the cursor is one end of the selection (the other one is the mark).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to work in a buffer without affecting the point, you can open the buffer in a second window (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Split-Window.html#Split-Window&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;C-x 2&lt;/code&gt; or &lt;code&gt;C-x 3&lt;/code&gt;&lt;/a&gt;). Each window has its own point. When you've finished selecting and otherwise editing, close the window (&lt;code&gt;C-x 0&lt;/code&gt;) and go back to the other one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more flexibility, you can clone the current buffer. Run &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html#Indirect-Buffers&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;M-x clone-indirect-buffer&lt;/code&gt;&lt;/a&gt;, or &lt;code&gt;C-x 4 c&lt;/code&gt; to also create a new window showing that buffer. The clone has the same text as the original, but it has its own mark and point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you've already killed some text, you can &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Appending-Kills.html#Appending-Kills&quot; rel=&quot;nofollow&quot;&gt;append more text&lt;/a&gt; by typing &lt;code&gt;C-M-w&lt;/code&gt; (&lt;code&gt;append-next-kill&lt;/code&gt;) and then using a kill command. For example, &lt;code&gt;C-M-w C-k&lt;/code&gt; appends the tail of the current line to the text that's already at the front of the kill ring, and deletes the copied text. &lt;code&gt;C-M-w M-w&lt;/code&gt; appends the selection to the text at the front of the kill ring (as opposed to &lt;code&gt;M-w&lt;/code&gt; which pushes the selected text as a new entry on the kill ring).&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-09T01:12:31.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="918" PostTypeId="1" AcceptedAnswerId="921" CreationDate="2014-10-09T01:21:14.063" Score="2" ViewCount="269" Body="&lt;p&gt;I'm on Ubuntu 14.04, with:&#xA;&lt;code&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian&lt;/code&gt; and have discovered something disturbing/annoying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been trying to use the latest version of CEDET via el-get but kept getting the error of &lt;code&gt;Emacs' built-in CEDET has already been loaded!  Restart Emacs to load CEDET from el-get instead.&lt;/code&gt; This was strange since it happened even after I commented everything in my .emacs out except for el-get code. Upon starting up with --debug-init, I saw that code is being running from &lt;code&gt;/etc/emacs/site-start.d/&lt;/code&gt;. This is &lt;em&gt;before&lt;/em&gt; my &lt;code&gt;.emacs&lt;/code&gt; even gets a chance to respond. I'm guessing that something in there is doing a &lt;code&gt;(require 'cedet)&lt;/code&gt;, or at least a &lt;code&gt;provide&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do in this situation? Do I need to recompile emacs? Or skip the apt-get version all together and build from source? And how is it possible that the emacs binary is loading code before the .emacs? Is there some kind of meta .emacs? Or was this some kind of build flag during compilation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I got some info from &lt;code&gt;apt-cache show emacs24-el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT2: Got more relevant info from &lt;a href=&quot;https://www.debian.org/doc/packaging-manuals/debian-emacs-policy&quot; rel=&quot;nofollow&quot;&gt;https://www.debian.org/doc/packaging-manuals/debian-emacs-policy&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="39" LastEditDate="2014-10-09T02:18:55.390" LastActivityDate="2017-01-22T22:52:18.073" Title="Ubuntu/Debian preempting me and running code before me" Tags="|cedet|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="920" PostTypeId="2" ParentId="911" CreationDate="2014-10-09T01:36:14.140" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs-muse/manual/muse.html#Releases&quot; rel=&quot;noreferrer&quot;&gt;Emacs Muse&lt;/a&gt; (also known as “Muse” or “Emacs-Muse”) is an authoring and publishing environment for Emacs. It simplifies the process of writing documents and publishing them to various output formats.Muse consists of two main parts: an enhanced text-mode for authoring documents and navigating within Muse projects, and a set of publishing styles for generating different kinds of output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Muse Mode should automatically be activated when you visit a file with a “.muse” extension. One such file is QuickStart.muse, which is available in the examples directory of the Muse distribution. You can tell that Muse Mode has been activated by checking for the text “Muse” in your mode line. If Muse Mode has not been activated, you may activate it by type &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;muse-mode&lt;/code&gt; RET. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case for indicating poetic stanzas, poetry requires that whitespace be preserved (I'm sure you already know this), but without resorting to monospace. To indicate this, use the following markup, reminiscent of email quotations. So open up a file with an .muse extension and type any of the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;gt; A line of Emacs verse;&#xA; &amp;gt;   forgive its being so terse.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use the  tag, if you prefer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;verse&amp;gt;&#xA; A line of Emacs verse;&#xA;   forgive its being so terse.&#xA; &amp;lt;/verse&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Multiple stanzas may be included in one set of  tags, as follows.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;verse&amp;gt;&#xA; A line of Emacs verse;&#xA;   forgive its being so terse.&#xA;&#xA; In terms of terse verse,&#xA;   you could do worse.&#xA; &amp;lt;/verse&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="45" LastActivityDate="2014-10-09T01:36:14.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="921" PostTypeId="2" ParentId="918" CreationDate="2014-10-09T02:37:40.550" Score="3" Body="&lt;p&gt;See the manual: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Init File&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;emacs --no-site-file&lt;/code&gt; to inhibit the &lt;code&gt;site-start.el&lt;/code&gt; file, which is loaded before your init file, and which Debian is presumably using to load code from &lt;code&gt;/etc/emacs/site-start.d/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-library&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;site-start&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not the one, then Debian &lt;em&gt;may&lt;/em&gt; (more nicely) be using &lt;code&gt;default.el&lt;/code&gt; which you can override in your init file, rather than needing a command-line argument:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inhibit-default-init t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similarly, to check for that library: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-library&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;default&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything you've said points to &lt;code&gt;site-start.el&lt;/code&gt; however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if you're the only user, you could likely just delete everything you don't want from &lt;code&gt;site-start.d&lt;/code&gt;. Updating the Debian package may or may not put them back again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you fancy taking the bull by the horns, you could start compiling Emacs for yourself, and do away with the Debian packages entirely.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-10-09T02:37:40.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="922" PostTypeId="1" AcceptedAnswerId="923" CreationDate="2014-10-09T02:52:35.877" Score="5" ViewCount="164" Body="&lt;p&gt;When I evaluate &lt;code&gt;(local-key-binding key)&lt;/code&gt; for any arbitrary key that &lt;strong&gt;&lt;em&gt;does not have a local binding&lt;/em&gt;&lt;/strong&gt;, I expect a return value of &lt;code&gt;nil&lt;/code&gt;, but I almost always get a &lt;code&gt;1&lt;/code&gt;.  If the key actually does have a local binding (say from a major mode) in the current buffer, then &lt;code&gt;local-key-binding&lt;/code&gt; behaves as expected and returns the function to which the key is bound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question then, is &lt;strong&gt;why does &lt;code&gt;local-key-binding&lt;/code&gt; often return &lt;code&gt;1&lt;/code&gt; when there is in fact no local binding for the given key?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, after opening emacs with &lt;code&gt;emacs -Q&lt;/code&gt;, type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-binding (kbd &quot;C-h h&quot;))&#xA;(local-key-binding (kbd &quot;C-h h&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the scratch buffer and evaluate each of the forms. Notice that &lt;code&gt;key-binding&lt;/code&gt; returns &lt;code&gt;view-hello-file&lt;/code&gt;, and &lt;code&gt;local-key-binding&lt;/code&gt; return &lt;code&gt;1&lt;/code&gt;.  The binding for &lt;code&gt;C-h h&lt;/code&gt; is defined globally, not locally, so I expect &lt;code&gt;local-key-binding&lt;/code&gt; to return &lt;code&gt;nil&lt;/code&gt;.  Now try &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key (kbd &quot;C-h h&quot;) 'describe-bindings)&#xA;(key-binding (kbd &quot;C-h h&quot;))&#xA;(local-key-binding (kbd &quot;C-h h&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and evaluate each of the forms.  Notice that both &lt;code&gt;key-binding&lt;/code&gt; and &lt;code&gt;local-key-binding&lt;/code&gt; return &lt;code&gt;describe-bindings&lt;/code&gt;.  Now try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-unset-key (kbd &quot;C-h h&quot;))&#xA;(key-binding (kbd &quot;C-h h&quot;))&#xA;(local-key-binding (kbd &quot;C-h h&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and evaluate each of the forms.  Notice that &lt;code&gt;key-binding&lt;/code&gt; has gone back to &lt;code&gt;view-hello-file&lt;/code&gt;, and &lt;code&gt;local-key-binding&lt;/code&gt; now shows &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="105" LastEditDate="2014-12-21T03:53:16.183" LastActivityDate="2014-12-21T03:53:16.183" Title="Why does local-key-binding return a 1 for a key with no local binding" Tags="|elisp|key-bindings|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="923" PostTypeId="2" ParentId="922" CreationDate="2014-10-09T03:38:40.150" Score="7" Body="&lt;p&gt;&lt;code&gt;local-key-binding&lt;/code&gt; uses &lt;code&gt;lookup-key&lt;/code&gt; whose doc-string contains this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A number as value means KEY is &quot;too long&quot;;&#xA;  that is, characters or symbols in it except for the last one&#xA;  fail to be a valid sequence of prefix characters in KEYMAP.&#xA;  The number is how many characters at the front of KEY&#xA;  it takes to reach a non-prefix key.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;local-unset-key&lt;/code&gt; does not reverse the effect of &lt;code&gt;local-key-binding&lt;/code&gt;, because it does not actually do what its doc-string claims it does:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Remove local binding of KEY&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But what actually happens boils down to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key (current-local-map) &quot;\C-hh&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(One could argue that it does what the doc-string claims, but it certainly doesn't do what one would expect when first reading that doc-string).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The keymap went through these stages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(keymap)&#xA;(keymap (8 keymap (104 . describe-bindings))))&#xA;(keymap (8 keymap (104)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To &lt;strong&gt;remove&lt;/strong&gt; the binding for a key instead of re-binding it to &lt;code&gt;nil&lt;/code&gt; you can use &lt;a href=&quot;https://github.com/tarsius/keymap-utils/blob/master/keymap-utils.el#L372&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;kmu-remove-key&lt;/code&gt;&lt;/a&gt; from my library &lt;a href=&quot;https://github.com/tarsius/keymap-utils&quot; rel=&quot;nofollow&quot;&gt;keymap-utils&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a key is bound to &lt;code&gt;nil&lt;/code&gt; in a local keymap that prevents key lookup to consider the binding in the parent keymap, but it does not override the global binding.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-10-10T00:15:49.610" LastActivityDate="2014-10-10T00:15:49.610" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="924" PostTypeId="2" ParentId="827" CreationDate="2014-10-09T03:47:35.990" Score="4" Body="&lt;p&gt;As mentioned, the &lt;code&gt;expand-region&lt;/code&gt; package is great but I also feel its worth mentioning &lt;a href=&quot;https://github.com/leoliu/easy-kill&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;easy-kill&lt;/code&gt;&lt;/a&gt;. It's billed as a drop in replacement for &lt;code&gt;kill-ring-save&lt;/code&gt; that turns the normal &lt;code&gt;M-w&lt;/code&gt; &quot;copy&quot; into a dynamic copy command that also acts as a prefix for saving various things. For example, &lt;code&gt;M-w&lt;/code&gt; would copy the active region, url, email or current line (in order of &lt;code&gt;easy-kill-try-things&lt;/code&gt;) but followed by a &quot;d&quot; &lt;code&gt;M-w d&lt;/code&gt; it would forcefully copy of the current defun. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a method of expanding/shrinking the current selection, somewhat like &lt;code&gt;expand-region&lt;/code&gt;, as well as a command called &lt;code&gt;easy-mark&lt;/code&gt; for marking regions without changing your current point.&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2014-10-09T03:47:35.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="925" PostTypeId="2" ParentId="895" CreationDate="2014-10-09T04:53:01.470" Score="1" Body="&lt;p&gt;You can use &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-8&quot; rel=&quot;nofollow&quot;&gt;helm-ff-do-grep invoked in helm-find-files&lt;/a&gt; to grep any directory you want. It has a demo in there; the grep in Helm is incremental: it returns results for every character you type, effectively provides live feedback. Or use &lt;code&gt;helm-projectile&lt;/code&gt; that is capable of invoking grep in any directory of selected file or directory in a helm-projectile-find-file or helm-projectile-find-dir. See the &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot; rel=&quot;nofollow&quot;&gt;helm-projectile guide here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-09T04:53:01.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="926" PostTypeId="2" ParentId="869" CreationDate="2014-10-09T04:57:23.133" Score="3" Body="&lt;p&gt;You can also use &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-18&quot; rel=&quot;nofollow&quot;&gt;helm-regexp&lt;/a&gt; that displays regex groups separately.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-09T04:57:23.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="927" PostTypeId="2" ParentId="728" CreationDate="2014-10-09T04:59:26.940" Score="7" Body="&lt;p&gt;Use &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-6&quot;&gt;helm-buffer-list or helm-mini&lt;/a&gt; for visually selecting buffer entry and fuzzy matching. It can do a lot of things outside of switching buffers. You should see the demo in the link.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-09T04:59:26.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="928" PostTypeId="1" AcceptedAnswerId="955" CreationDate="2014-10-09T08:17:09.997" Score="10" ViewCount="413" Body="&lt;p&gt;I'm writing a major mode for a programming language, but I want to support older Emacs versions. &lt;code&gt;prog-mode&lt;/code&gt; is relatively new. I want to inherit from &lt;code&gt;prog-mode&lt;/code&gt; if it's defined, but still do something sensible otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best approach? Should I &lt;code&gt;defalias&lt;/code&gt; &lt;code&gt;prog-mode&lt;/code&gt; on older Emacsen, or will that interfere with other modes if they do the same thing?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2014-10-09T08:28:46.360" LastActivityDate="2019-03-28T21:10:43.060" Title="How do I inherit from prog-mode, whilst still supporting older emacsen?" Tags="|major-mode|prog-mode|version-compatibilty|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="929" PostTypeId="1" AcceptedAnswerId="933" CreationDate="2014-10-09T09:10:21.857" Score="5" ViewCount="1352" Body="&lt;p&gt;I want to transform a text file with many lines :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;| refXXXXX | here useful text, first sentence, last word. |&lt;br&gt;&#xA;  | refYYYYY | First word, second sentence.                 |  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;into :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;here useful text, first sentence, last word. First word, second sentence.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but appearing as :  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;[refXXXXX]&lt;/code&gt; here useful text, first sentence, last word. &lt;code&gt;[refYYYYY]&lt;/code&gt; First word, second sentence.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;[refs within brackets]&lt;/code&gt; would be Overlays or Text Properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(The aim would be to be able to make use of &lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;M-x occur&lt;/code&gt; to retrieve directly &quot;last word. First word&quot;, at the end of first sentence + beginning of second sentence in the example.&#xA;Btw, I know how to do the corresponding search in the source file with a regexp, but it's not the solution I want.)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;My question is :&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;is this possible with Overlays or Text properties, with a defun retrieving all the &quot;refs&quot;, cutting them from the text and replacing them by Overlays/TextProperties?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun source-to-final ()&#xA;    &quot;cut refs from the txt, but letting them appear as overlays (or text properties)&quot;&#xA;    (while&#xA;        (search-forward-regexp &quot;| ref.*?|&quot;)&#xA;      (replace-match &quot;&quot;)   ;; cutting the ref text&#xA;      (set-some-overlay-or-textproperty-here (match-string 0)) &#xA;      (search-forward-regexp &quot; +|\n&quot;) ;; assembling current sentence with next one&#xA;      (replace-match &quot;&quot;)&#xA;      ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where I just don't know how the defun &lt;code&gt;set-some-overlay-or-textproperty-here&lt;/code&gt; should look like.&lt;/p&gt;&#xA;" OwnerUserId="863" LastEditorUserId="50" LastEditDate="2014-10-14T01:02:29.390" LastActivityDate="2014-10-14T01:02:29.390" Title="How to apply overlay or text properties to text matching a regexp?" Tags="|elisp|overlays|text-properties|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="930" PostTypeId="2" ParentId="15" CreationDate="2014-10-09T09:20:00.550" Score="15" Body="&lt;p&gt;&lt;code&gt;org-table-blank-field&lt;/code&gt; as already said, but also if you move to the cell with &lt;code&gt;TAB&lt;/code&gt;, then typing will clear the cell content and replace it with what you type.&lt;/p&gt;&#xA;" OwnerUserId="863" LastActivityDate="2014-10-09T09:20:00.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="931" PostTypeId="1" AcceptedAnswerId="963" CreationDate="2014-10-09T09:30:09.900" Score="4" ViewCount="147" Body="&lt;p&gt;I have &lt;code&gt;highlight-symbol&lt;/code&gt; enabled with the delay set to &lt;code&gt;0&lt;/code&gt;. It's great, but unfortunately when I navigate by holding down &lt;code&gt;j&lt;/code&gt; or &lt;code&gt;k&lt;/code&gt; (evil-mode), the feedback is not great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I was wondering if it's possible to temporarily disable highlight-symbol as I'm holding down &lt;code&gt;j&lt;/code&gt; or &lt;code&gt;k&lt;/code&gt;. I've tried setting the delay to &lt;code&gt;0.1&lt;/code&gt; or smaller, but it always seems to feel like it's 1 second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Now, I know there are better ways in navigating, but that's beside the question)&lt;/p&gt;&#xA;" OwnerUserId="251" LastEditorUserId="50" LastEditDate="2014-10-09T18:02:51.110" LastActivityDate="2014-10-09T18:02:51.110" Title="Trigger a function when a key is held down after X seconds?" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="932" PostTypeId="2" ParentId="928" CreationDate="2014-10-09T09:34:54.500" Score="0" Body="&lt;p&gt;I think testing using &lt;code&gt;fboundp&lt;/code&gt; makes more sense.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (fboundp 'prog-mode)&#xA;    ...&#xA;   ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="360" LastActivityDate="2014-10-09T09:34:54.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="933" PostTypeId="2" ParentId="929" CreationDate="2014-10-09T09:37:11.473" Score="6" Body="&lt;h2&gt;Yes, it’s possible&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A couple of points on your function:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Don’t cut the text before you need it.&lt;/li&gt;&#xA;&lt;li&gt;Use the third argument for &lt;code&gt;search-forward-regexp&lt;/code&gt; to avoid getting errors.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun source-to-final ()&#xA;  &quot;Cut refs from the txt, but letting them appear as text properties.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (search-forward-regexp &quot;| \\(ref.*?\\) |&quot; nil 'noerror)&#xA;      (let ((ref (match-string 1)))&#xA;        (replace-match &quot;&quot;) ;; cutting the ref text&#xA;        ;; This kind of assumes the character after point is a blank space.&#xA;        (set-some-overlay-or-textproperty-here (concat ref &quot; &quot;)) &#xA;        (when (search-forward-regexp &quot; +|\n&quot; nil 'noerror)&#xA;          (replace-match &quot;&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here’s how you set text properties.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-some-overlay-or-textproperty-here (text)&#xA;  (add-text-properties (point) (1+ (point))&#xA;                       `(display ,(propertize text 'face 'font-lock-comment-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Result&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you run the command above, the buffer should be the way you want. Then you can isearch for &lt;code&gt;last word. First word&lt;/code&gt; and you'll be taken to the right place.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-09T15:07:18.130" LastActivityDate="2014-10-09T15:07:18.130" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="934" PostTypeId="2" ParentId="928" CreationDate="2014-10-09T09:48:11.833" Score="3" Body="&lt;p&gt;tl;dr: Use &lt;code&gt;if&lt;/code&gt; and your own init function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (fboundp 'prog-mode)&#xA;    (define-derived-mode your-cool-mode prog-mode &quot;Cool&quot;&#xA;      &quot;Docstring&quot;&#xA;      (your-cool--init))&#xA;  (define-derived-mode your-cool-mode nil &quot;Cool&quot;&#xA;    &quot;Docstring&quot;&#xA;    (your-cool--init)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then do all the mode's initialization in &lt;code&gt;your-cool-init&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Longer explanation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that the official way of writing a derived major mode is to use the &lt;code&gt;define-derived-mode&lt;/code&gt; macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode your-cool-mode prog-mode ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On older Emacsen (pre-24), this breaks when &lt;code&gt;prog-mode&lt;/code&gt;. And you can't use &lt;code&gt;(if (fboundp 'prog-mode) ...)&lt;/code&gt; there because the macro expects a literal symbol, and will quote it for you in the expansion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;define-derived-mode&lt;/code&gt; uses the parent in a multitude of ways. You'd need to copy all of those in your own mode definition to make use of them, and that's both tedious and error-prone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the only way is to use two different &lt;code&gt;define-derived-mode&lt;/code&gt; statements, depending on whether &lt;code&gt;prog-mode&lt;/code&gt; exists or not. That leaves you with the problem of writing your initialization code twice. Which is of course bad, so you extract that into its own function, as described above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The best solution is of course to drop support for 23.x and use lexical scoping. But I guess you already considered and dropped that option. :-))&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-10-09T09:48:11.833" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="935" PostTypeId="2" ParentId="694" CreationDate="2014-10-09T10:29:37.163" Score="1" Body="&lt;p&gt;Here is a very ugly solution. First, define a function to find hard newlines such that it can be used by font-lock-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun whitespace-find-hard-newlines (end)&#xA;  (search-forward &quot;\n&quot; end t)&#xA;  (while (and (not (memq 'hard (text-properties-at (match-beginning 0))))&#xA;       (search-forward &quot;\n&quot; end t)))&#xA;  (memq 'hard (text-properties-at (match-beginning 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is what I used in my &lt;code&gt;*scratch*&lt;/code&gt; buffer to test it. The switch to &lt;code&gt;fundamental-mode&lt;/code&gt; made sure everything got initialized properly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (fundamental-mode)&#xA;  (text-mode)&#xA;  (longlines-mode)&#xA;  (whitespace-mode)&#xA;  (font-lock-add-keywords nil&#xA;    '((whitespace-find-hard-newlines 0 '(background-color . &quot;#eee&quot;) t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is it ugly? Because adding a background color to the &quot;newline&quot; will create a light grey line to the right edge of the window. It looks ugly. You can't use the foreground color because there is nothing there to highlight. The $ sign that you're seeing comes from a display table and that only works on &lt;em&gt;characters&lt;/em&gt;. On the character level, however, the hard and soft newlines don't differ.&lt;/p&gt;&#xA;" OwnerUserId="360" LastActivityDate="2014-10-09T10:29:37.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="936" PostTypeId="5" CreationDate="2014-10-09T10:30:41.580" Score="0" Body="&lt;p&gt;Emacs can start in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server&quot; rel=&quot;nofollow noreferrer&quot;&gt;daemon mode&lt;/a&gt;: it starts without any user interface, only with a &lt;a href=&quot;/questions/tagged/server&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;server&amp;#39;&quot; rel=&quot;tag&quot;&gt;server&lt;/a&gt;, and you can open files and windows by contacting the server with the &lt;a href=&quot;/questions/tagged/emacsclient&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;emacsclient&amp;#39;&quot; rel=&quot;tag&quot;&gt;emacsclient&lt;/a&gt; utility.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2018-06-11T22:51:25.130" LastActivityDate="2018-06-11T22:51:25.130" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="937" PostTypeId="4" CreationDate="2014-10-09T10:30:41.580" Score="0" Body="Starting Emacs in daemon mode" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2018-06-11T22:51:25.130" LastActivityDate="2018-06-11T22:51:25.130" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="938" PostTypeId="5" CreationDate="2014-10-09T10:31:44.780" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Debugging&quot; rel=&quot;nofollow&quot;&gt;Debugging&lt;/a&gt; is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge in another. Many books have been written about debugging, as it involves numerous aspects, including interactive debugging, control flow, integration testing, log files, monitoring (application, system), memory dumps, profiling, Statistical Process Control, and special design tactics to improve detection while simplifying changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Applications for Debugging:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Windbg&quot; rel=&quot;nofollow&quot;&gt;WinDbg&lt;/a&gt; - A debugger for low-level debugging, mostly used for &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ee817659.aspx&quot; rel=&quot;nofollow&quot;&gt;production debugging&lt;/a&gt; and difficult error solving.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;WinDbg also contains extensions for .Net debugging like &quot;.Sos&quot;, &quot;.SosEx&quot; and more...&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ollydbg&quot; rel=&quot;nofollow&quot;&gt;OllyDbg&lt;/a&gt; - An assembly debugger mostly used for reverse engineering and cracking.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Note that as for February 2014 &lt;a href=&quot;http://en.wikipedia.org/wiki/Ollydbg&quot; rel=&quot;nofollow&quot;&gt;OllyDbg&lt;/a&gt; only support 32 Bit application debugging.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Learning Sources:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Books:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0321374460&quot; rel=&quot;nofollow&quot;&gt;Advanced Windows Debugging&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0814474578&quot; rel=&quot;nofollow&quot;&gt;Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T01:11:51.320" LastActivityDate="2014-10-27T01:11:51.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="939" PostTypeId="4" CreationDate="2014-10-09T10:31:44.780" Score="0" Body="Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:47:22.527" LastActivityDate="2014-10-26T03:47:22.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="940" PostTypeId="2" ParentId="851" CreationDate="2014-10-09T10:38:14.823" Score="3" Body="&lt;p&gt;Org mode formulas use Calc mode under the covers and Calc has a format for specifying hours, minutes and seconds. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/calc.html#HMS-Formats&quot; rel=&quot;nofollow&quot;&gt;the Emacs manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can therefore use &lt;code&gt;8@&lt;/code&gt; to specify 8 hours, 0 minutes and 0 seconds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that to get it to work I had to calculate the vcount first. So something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@&amp;gt;$3=vcount(@2..@-1) * (@&amp;gt;$5-8@)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="867" LastEditorUserId="25" LastEditDate="2014-10-09T22:50:04.653" LastActivityDate="2014-10-09T22:50:04.653" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="941" PostTypeId="1" AcceptedAnswerId="960" CreationDate="2014-10-09T11:11:24.543" Score="12" ViewCount="2187" Body="&lt;p&gt;Been looking for a solution to this for a while now. On OS X minors mode fill the menu bar with useless menu items. Here's a screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VVlDh.png&quot; alt=&quot;menubar](![minor modes taken over the menu bar&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can't tell, Emacs menu items are blocking the rest of my menu bar. Is there a way to tell Emacs to not use the menu bar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot;&gt;this port&lt;/a&gt; of emacs.&lt;/p&gt;&#xA;" OwnerUserId="399" LastEditorUserId="50" LastEditDate="2014-10-09T18:05:12.927" LastActivityDate="2014-10-09T18:05:12.927" Title="Emacs and OS X Menu Bar" Tags="|osx|menu-bar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="942" PostTypeId="2" ParentId="847" CreationDate="2014-10-09T11:14:44.350" Score="4" Body="&lt;p&gt;Your issue is that the valid specification is &lt;code&gt;file+datetree&lt;/code&gt; and you have &lt;code&gt;file+datatree&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is true for your &lt;code&gt;Diario&lt;/code&gt;,&lt;code&gt;Apuntes importantes&lt;/code&gt; and &lt;code&gt;Agenda&lt;/code&gt;.  If you correct that one spelling mistake it will allow them to resolve properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tested this with &lt;code&gt;emacs -q&lt;/code&gt;, adding current org to the load path, requiring it then evaluating the &lt;code&gt;setf&lt;/code&gt;.  It no longer gave errors (other than directory not already existing since I use &lt;code&gt;~/documents/org&lt;/code&gt; instead of &lt;code&gt;~/org&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-09T11:14:44.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="944" PostTypeId="2" ParentId="913" CreationDate="2014-10-09T11:34:34.150" Score="4" Body="&lt;p&gt;There is a command for connecting to all bookmarked group chats that have the &quot;autojoin&quot; flag set: &lt;code&gt;M-x jabber-muc-autojoin&lt;/code&gt;.  This is included in &lt;code&gt;jabber-post-connect-hooks&lt;/code&gt; by default, so you should only need to use it just after modifying bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can join a room manually with &lt;code&gt;M-x jabber-muc-join&lt;/code&gt;.  It currently doesn't offer the bookmarked rooms for completion (though it probably should), but if you enter the JID, it will pick up the nickname configured in the bookmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Editing bookmarks is supported by jabber.el, but sometimes the server doesn't allow it.  You should see an error message in the echo area in that case.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-10-09T11:34:34.150" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="945" PostTypeId="1" AcceptedAnswerId="947" CreationDate="2014-10-09T11:34:38.163" Score="2" ViewCount="1309" Body="&lt;p&gt;I find Helm's space separated queries very useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, on occasion, particularly while using the &lt;code&gt;@&lt;/code&gt; prefix (searching for match within a buffer in helm-mini) I would like to be able to specify a single search string which includes a space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. &lt;code&gt;@Find\ buffer\ matching\ this\ text&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="867" LastEditorUserId="25" LastEditDate="2014-10-09T22:58:03.950" LastActivityDate="2020-01-08T01:31:02.927" Title="Match a string that includes a space in Helm" Tags="|search|helm|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="946" PostTypeId="2" ParentId="70" CreationDate="2014-10-09T11:45:33.740" Score="28" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Silex/elmacro&quot;&gt;elmacro&lt;/a&gt; was already mentioned by @lunaryorn, but as the author of this package I thought it'd be nice to provide an example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you record a macro like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;F3 C-e M-b M-u C-a C-n F4&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then doing &lt;kbd&gt;M-x elmacro-show-last-macro upcase-last-word&lt;/kbd&gt; produces a buffer with:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun upcase-last-word ()&#xA;  &quot;Change me!&quot;&#xA;  (interactive)&#xA;  (move-end-of-line 1)&#xA;  (backward-word 1)&#xA;  (upcase-word 1)&#xA;  (move-beginning-of-line 1)&#xA;  (next-line 1 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="790" LastEditorUserId="790" LastEditDate="2014-12-16T11:25:40.800" LastActivityDate="2014-12-16T11:25:40.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="947" PostTypeId="2" ParentId="945" CreationDate="2014-10-09T13:12:33.910" Score="0" Body="&lt;p&gt;I don't think it's possible. I opened an issue &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/660&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: It's not possible.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-10-09T16:45:45.377" LastActivityDate="2014-10-09T16:45:45.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="948" PostTypeId="2" ParentId="728" CreationDate="2014-10-09T13:29:33.387" Score="3" Body="&lt;p&gt;The fastest way to switch buffers I'm aware of is with &lt;a href=&quot;https://github.com/waymondo/ace-jump-buffer&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ace-jump-buffer&lt;/code&gt;&lt;/a&gt;. One key stroke opens the buffer menu and then select the letter next to the buffer you want with &lt;code&gt;ace-jump-line-mode&lt;/code&gt;. This works best for the 26 or so most recent buffers. For switching to buffers farther back in your usage history, &lt;code&gt;ido-switch-buffer&lt;/code&gt; is always a good choice.&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2014-10-09T13:29:33.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="949" PostTypeId="1" AcceptedAnswerId="956" CreationDate="2014-10-09T13:33:00.687" Score="1" ViewCount="1248" Body="&lt;p&gt;I posted &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2014-10/msg00030.html&quot; rel=&quot;nofollow&quot;&gt;this question to help-gnu-emacs&lt;/a&gt;, but haven't had a reply there, so perhaps this is a different audience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an automated test suite that downloads a few packages from ELPA&#xA;to simulate a fresh install. It runs perfectly well on Linux and OSX,&#xA;but not on Windows with Emacs 24.3.1. A simple way to reproduce the&#xA;problem is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\&amp;gt;c:\utils\emacs\bin\emacs -Q --batch -f toggle-debug-on-error --eval &quot;(setq package-archives '((\&quot;gnu\&quot; . \&quot;http://elpa.gnu.org/packages/\&quot;)))&quot; --eval &quot;(package-refresh-contents)&quot;&#xA;Debug on Error enabled globally&#xA;Contacting host: elpa.gnu.org:80&#xA;Memory exhausted--use C-x s then exit and restart Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried using an up to date binary from&#xA;&lt;a href=&quot;http://sourceforge.net/projects/emacs-bin/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/projects/emacs-bin/&lt;/a&gt; dated 9th September 2014.&#xA;This fails to find gpg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\&amp;gt;c:\utils\emacs-trunk\bin\emacs -Q --batch -f toggle-debug-on-error --eval &quot;(setq package-archives '((\&quot;gnu\&quot; . \&quot;http://elpa.gnu.org/packages/\&quot;)))&quot; --eval &quot;(package-refresh-contents)&quot;&#xA;Debug on Error enabled globally&#xA;Contacting host: elpa.gnu.org:80&#xA;Contacting host: elpa.gnu.org:80&#xA;Debugger entered--Lisp error: (file-error &quot;Searching for program&quot; &quot;no&#xA;such file or directory&quot; &quot;&#xA;gpg&quot;)&#xA;  start-process(&quot;epg&quot; #&amp;lt;buffer  *epg*&amp;gt; &quot;gpg&quot; &quot;--no-tty&quot; &quot;--status-fd&quot;&#xA;&quot;1&quot; &quot;--yes&quot; &quot;--homedir&quot; &quot;&#xA;d:/dev/rneatherway-fsharpbinding/emacs/tmp/.emacs.d/elpa/gnupg&quot;&#xA;&quot;--command-fd&quot; &quot;0&quot; &quot;--output&quot; &quot;&#xA;c:/Users/robnea/AppData/Local/Temp/epg-output3804P5-&quot; &quot;--verify&quot; &quot;--&quot;&#xA;&quot;c:/Users/robnea/AppData/&#xA;Local/Temp/epg-signature3804jvu&quot; &quot;-&quot;)&#xA;... snip ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while using MELPA works fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\&amp;gt;c:\utils\emacs-trunk\bin\emacs&#xA;--batch -f toggle-debug-on-error --eval &quot;(setq package-archives&#xA;'((\&quot;melpa\&quot; . \&quot;http://melpa.milkbox.net/packages/\&quot;)))&quot; --eval&#xA;&quot;(package-refresh-contents)&quot;&#xA;Debug on Error enabled globally&#xA;Contacting host: melpa.milkbox.net:80&#xA;Contacting host: melpa.milkbox.net:80&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not quite sure how to proceed debugging this, but something seems&#xA;to be not quite right with the Windows build.&lt;/p&gt;&#xA;" OwnerUserId="753" LastEditorUserId="105" LastEditDate="2014-10-10T04:55:20.567" LastActivityDate="2014-10-10T04:55:20.567" Title="Using ELPA in batch mode on Windows fails" Tags="|package|microsoft-windows|package-repositories|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="950" PostTypeId="2" ParentId="945" CreationDate="2014-10-09T13:33:52.047" Score="2" Body="&lt;p&gt;It is possible to search names with spaces using \\ escaping.&#xA;For example if there are two buffers opened, one named &quot;file with spaces&quot; and the second named &quot;filewithoutspaces&quot;, then, in helm-mini, pattern &quot;with spaces&quot; will find both buffers, while pattern &quot;with spaces \\ &quot; (note the space at the end) will find only the buffer with space in name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, I cannot find a way to search with space in buffer contents.&lt;/p&gt;&#xA;" OwnerUserId="873" LastEditorUserId="193" LastEditDate="2014-10-10T07:13:49.710" LastActivityDate="2014-10-10T07:13:49.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="951" PostTypeId="2" ParentId="929" CreationDate="2014-10-09T13:43:56.140" Score="2" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/isearch-prop.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; can help with at least some of what you want to do, I think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See command &lt;code&gt;isearchp-add-regexp-as-property&lt;/code&gt; or function &lt;code&gt;isearchp-regexp-scan&lt;/code&gt;, for adding text properties based on regexps, to give you propertied zones amenable for searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other commands and functions in the library let you search such propertied zones or their complements. For example, you can use &lt;code&gt;C-t&lt;/code&gt; within Isearch (or &lt;code&gt;C-M-t&lt;/code&gt; within regexp Isearch) to search within such a zone. (&lt;code&gt;C-M-~&lt;/code&gt; toggles searching the complement.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This adds property &lt;code&gt;foo&lt;/code&gt; (with value &lt;code&gt;(&quot;ref.+&quot;)&lt;/code&gt;) to text matching the regexp &lt;code&gt;ref.+&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(isearchp-add-regexp-as-property (point-min) (point-max) 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You can also apply other properties, such as &lt;code&gt;face&lt;/code&gt; or &lt;code&gt;mouse-face&lt;/code&gt; or &lt;code&gt;invisible&lt;/code&gt;, to the same text, depending on whether you want some particular display behavior.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But note that if your aim is just to propertize certain positions or zones of text so that you can quickly get to them later then, then &lt;em&gt;unless you need to insert your &lt;code&gt;refXXXX&lt;/code&gt; text for some other reason&lt;/em&gt;, you can skip that text insertion and just propertize the locations/zones directly. You can easily do that using &lt;code&gt;isearch-prop.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, why are you bothering to insert &lt;code&gt;refXXXX&lt;/code&gt; text that you later want to hide (or highlight?), if that text is just meant to identify buffer positions or zones?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to mark positions, you can of course use markers, but they do not have identities (i.e., additional info) beyond their positions.  If you want to mark the text itself, you can use properties to do that.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here are the doc strings for the functions that add properties that let you search regexp-defined zones (or their complements):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(isearchp-regexp-scan BEG END PROPERTY REGEXP &amp;amp;optional PREDICATE ACTION)&#xA;&#xA;Scan for REGEXP, adding text property PROPERTY to matches.&#xA;If the region is active then scan it.  Otherwise scan the buffer.&#xA;Return the value of PROPERTY, if added somewhere.  Else return nil.&#xA;See `isearchp-add-regexp-as-property' for the parameter descriptions.&#xA;&#xA;(isearchp-add-regexp-as-property PROPERTY REGEXP &amp;amp;optional BEG END PREDICATE ACTION MSGP)&#xA;&#xA;Add PROPERTY with value (REGEXP . PREDICATE) to REGEXP matches.&#xA;If region is active, limit action to region.  Else, use whole buffer.&#xA;If REGEXP has subgroups, then use what the Nth subgroup matches as the&#xA; search context (hit), where N = `isearchp-context-level'.&#xA; If N=0, then use the overall match of REGEXP as the search context.&#xA;PROPERTY is a text property to add to the search-hit text.&#xA; the value of the property is REGEXP (a string).&#xA; Interactively, PREDICATE is nil, so the PROPERTY value is (REGEXP).&#xA;&#xA;Non-interactively:&#xA;&#xA;BEG, END are the region limits.  If nil, the buffer limits are used.&#xA;PREDICATE is nil or a boolean function that takes these arguments:&#xA;  - the search-context string&#xA;  - a marker at the end of the search-context&#xA;If PREDICATE is non-nil then act on only the hits for which it holds.&#xA;If ACTION is non-nil then it is a function that accepts no arguments.&#xA; It is called after matching buffer text with REGEXP.  After ACTION,&#xA; the search hit end position is extended or restricted to point.&#xA;Non-interactively, non-nil BEG and END are used as the region limits.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Library &lt;code&gt;isearch-prop.el&lt;/code&gt; is a companion to library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/isearch%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;isearch+.el&lt;/code&gt;&lt;/a&gt; (neither is needed for the other, but they enhance each other). See also &lt;a href=&quot;http://www.emacswiki.org/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-09T14:50:35.250" LastActivityDate="2014-10-09T14:50:35.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="952" PostTypeId="1" CreationDate="2014-10-09T14:29:03.827" Score="2" ViewCount="494" Body="&lt;p&gt;In my mode line, to the left of where it describes the current modes e.g. &lt;code&gt;(Org company)&lt;/code&gt;, there is text that looks like &lt;code&gt;[#]&lt;/code&gt; or sometimes &lt;code&gt;[i,#]&lt;/code&gt;, where the &lt;code&gt;i&lt;/code&gt; and &lt;code&gt;#&lt;/code&gt; signs are highlighted. I don't think this is a stock Emacs feature as I can't find what it means in the documentation. What does that mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the left of the above, the mode line mentions &lt;code&gt;Git:master&lt;/code&gt;. I have not installed any Git-related packages. Further, when I look at the currently running modes, I do not see anything that mentions Git or version control. I also do not see in the manual anything that mentions out-of-the-box Git integration. I'm wondering what I might have done to enable this.&lt;/p&gt;&#xA;" OwnerUserId="655" LastEditorUserId="25" LastEditDate="2014-10-09T22:53:49.080" LastActivityDate="2014-10-09T22:53:49.080" Title="Origin of some modeline indications: Git:master [i,#]" Tags="|git|mode-line|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="953" PostTypeId="2" ParentId="931" CreationDate="2014-10-09T14:42:34.133" Score="0" Body="&lt;p&gt;The default delay for highlight symbol (at least according to &lt;a href=&quot;https://github.com/nschum/highlight-symbol.el/blob/master/highlight-symbol.el&quot; rel=&quot;nofollow&quot;&gt;this source file&lt;/a&gt;) is 1.5 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you leave it at the default, or set it back to 1.5 yourself, won't you get the desired effect?&lt;/p&gt;&#xA;" OwnerUserId="503" LastEditorUserId="50" LastEditDate="2014-10-09T17:56:33.140" LastActivityDate="2014-10-09T17:56:33.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="954" PostTypeId="2" ParentId="952" CreationDate="2014-10-09T14:48:24.060" Score="4" Body="&lt;p&gt;Use &lt;code&gt;C-h v mode-line-format&lt;/code&gt; to get access to the string that defines the mode line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That'll tell you what's in your mode line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also yank it into a scratch buffer, quote it and surround it with a &lt;code&gt;(setq-default)&lt;/code&gt;, and eval your modifications repeatedly to try and figure out what to remove to make this go away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example here's part of mine.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA; '(&quot;%e&quot;&#xA;;; snip&#xA;   (vc-mode vc-mode)&#xA;;;snip&#xA;   mode-line-modes&#xA;   mode-line-misc-info))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Git:master&lt;/code&gt; is probably dealt with by code like &lt;code&gt;(vc-mode vc-mode)&lt;/code&gt;. &lt;code&gt;C-h f vc-mode&lt;/code&gt; gives documentation indicating this autoactivates in certain scenarios: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This minor mode is automatically activated whenever you visit a file under&#xA;  control of one of the revision control systems in `vc-handled-backends'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;[#]&lt;/code&gt; and &lt;code&gt;[i,#]&lt;/code&gt;, might that be rcirc-mode's modeline addition? Do you have rcirc-track-minor-mode on? (This lets you know when irc channels you're in have been active in the background, and/or when someone private messages you.) You can test this by &lt;code&gt;M-x rcirc-track-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="676" LastActivityDate="2014-10-09T14:48:24.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="955" PostTypeId="2" ParentId="928" CreationDate="2014-10-09T14:55:49.190" Score="11" Body="&lt;p&gt;At the cost of an extra top-level symbol binding, there's a very neat solution which avoids repeating the &lt;code&gt;define-derived-mode&lt;/code&gt; form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'my-fancy-parent-mode&#xA;  (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))&#xA;&#xA;(define-derived-mode my-fancy-mode my-fancy-parent-mode&#xA;   ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works fine in any Emacs &gt;= 23. I came up with this for &lt;code&gt;haml-mode&lt;/code&gt; a couple of years ago IIRC, and it seems to have spread from there to several other major modes. The main thing the &lt;code&gt;define-derived-mode&lt;/code&gt; macro does with the parent mode symbol is generate code which calls its function: in this sense, &lt;code&gt;defalias&lt;/code&gt; makes the new variable exactly equivalent to the aliased function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One caveat is that this can confuse &lt;code&gt;derived-mode-p&lt;/code&gt;, so code which checks to see if your mode is derived from &lt;code&gt;prog-mode&lt;/code&gt; might not work correctly. In practice I haven't encountered any problems: it's more usual for such code to hook into &lt;code&gt;prog-mode-hook&lt;/code&gt;, which still gets run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(As Jorgen points out in the comments, &lt;code&gt;define-derived-mode&lt;/code&gt; also uses the &lt;code&gt;mode-class&lt;/code&gt; property from the parent mode symbol, and &lt;code&gt;defalias&lt;/code&gt; will not copy it. At the time of writing, this property &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;only seems to be used for &lt;code&gt;special-mode&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update: these days I'd simply suggest requiring at least Emacs 24, since older versions are long obsolete.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2019-03-28T21:10:43.060" LastActivityDate="2019-03-28T21:10:43.060" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="956" PostTypeId="2" ParentId="949" CreationDate="2014-10-09T15:00:09.453" Score="4" Body="&lt;p&gt;Debugger is flagging on:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Searching for program&quot; &quot;no&#xA;such file or directory&quot; &quot;&#xA;gpg&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will need to confirm if &lt;code&gt;gpg.exe&lt;/code&gt; is installed on the machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is not and you don't intend to install it, you can bypass signature checking with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-check-signature nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will skip the &lt;code&gt;gpg&lt;/code&gt; (epg) checking and refresh directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately you can install &lt;a href=&quot;http://www.gpg4win.org&quot; rel=&quot;nofollow&quot;&gt;GPG4Win&lt;/a&gt; and ensure it is in your path before launching Emacs to allow checking to proceed.  Although you will have to confirm interactively that it does not prompt for approval of keys that may cause it to hang/wait for input.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-09T15:00:09.453" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="957" PostTypeId="2" ParentId="952" CreationDate="2014-10-09T15:10:29.480" Score="6" Body="&lt;p&gt;They're both stock Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The part that looks like &lt;code&gt;[#]&lt;/code&gt; is &lt;code&gt;erc&lt;/code&gt;'s mode-line indicator. It tells you the status of the IRC room you've joined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The &lt;code&gt;Git:master&lt;/code&gt; is &lt;code&gt;vc-mode&lt;/code&gt;. It tells you the status of the current version controlled directory (in your case that's a git repo). You can turn it off with &lt;code&gt;(vc-mode -1)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-09T15:57:52.383" LastActivityDate="2014-10-09T15:57:52.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="958" PostTypeId="1" CreationDate="2014-10-09T15:34:02.587" Score="8" ViewCount="1317" Body="&lt;p&gt;Ideally, I would like to be able to store the entire contents of my &lt;code&gt;.emacs.d&lt;/code&gt; directory and have it &quot;just work&quot; on any Emacs I load it into, but still take advantage of any features of the specific environment, such as GUI windowing systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not looking for an encyclopedia of&#xA;incompatible features. I'd just like to know how to check for features, OS, version, graphics, etc, and how to take advantage of these without breaking the code for other configurations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What basic techniques can I use to write Elisp that works in multiple versions of Emacs common in the wild (e.g. 22.x+) and on multiple underlying platforms (e.g. OSX, Linux, Windows, and other *nix), while taking advantage of platform and version-specific features where applicable?  &lt;/p&gt;&#xA;" OwnerUserId="852" LastEditorUserId="50" LastEditDate="2014-10-10T09:36:28.007" LastActivityDate="2019-09-15T18:48:29.543" Title="Writing portable Elisp" Tags="|elisp|version-compatibilty|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="959" PostTypeId="2" ParentId="958" CreationDate="2014-10-09T16:28:16.967" Score="6" Body="&lt;p&gt;(Community wiki. Please add yours!)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If there's a function, added in a newer Emacs version, that you'd like to use, check whether it's defined with &lt;code&gt;fboundp&lt;/code&gt;, and define a compatibility function if it's not  defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's considered a bad idea to give the compatibility function the same name as the real function, as other Elisp code may be using the same &lt;code&gt;fboundp&lt;/code&gt; trick.  Thus, use a prefix for the compatibility function, and use &lt;code&gt;defalias&lt;/code&gt; for the same name if it is defined.  E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (fboundp 'propertize)&#xA;    (defalias 'my-propertize 'propertize)&#xA;  (defun my-propertize (string &amp;amp;rest properties)&#xA;    &quot;Return a copy of STRING with text properties added.&#xA;&#xA; [Note: this docstring has been copied from the Emacs 21 version]&#xA;&#xA;First argument is the string to copy.&#xA;Remaining arguments form a sequence of PROPERTY VALUE pairs for text&#xA;properties to add to the result.&quot;&#xA;    (let ((str (copy-sequence string)))&#xA;      (add-text-properties 0 (length str)&#xA;                           properties&#xA;                           str)&#xA;      str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If some piece of configuration should only apply to a certain OS, there are a few different possibilities.  You can check the &lt;code&gt;system-type&lt;/code&gt; variable, which returns &lt;code&gt;gnu/linux&lt;/code&gt;, &lt;code&gt;darwin&lt;/code&gt;, &lt;code&gt;windows-nt&lt;/code&gt; and a few others (see the docstring).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may be tempted to use &lt;code&gt;window-system&lt;/code&gt;, though its docstring states that &quot;Use of this variable as a boolean is deprecated&quot;, and recommends using &lt;code&gt;display-graphic-p&lt;/code&gt; instead.  Note that Emacs is able to use different types of displays for different frames nowadays (e.g. one frame on a terminal and another in a &quot;proper&quot; window), so this may cause surprises.  Use &lt;code&gt;current-frame-configuration&lt;/code&gt; or &lt;code&gt;get-buffer-window-list&lt;/code&gt; in your elisp to make the right choice.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You may want to check if you are running under the right flavor of emacs. Use featurep to check the variant.&#xA;E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (featurep 'xemacs)&#xA;   (require 'fsf-compat))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use it to check specific modules are loaded. For instance, if you only use a small and easy to define defun of common-lisp you might opt for defining instead of requiring. E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (featurep 'cl)&#xA;   (defun caaar (x)&#xA;      &quot;Return the `car' of the `car' of the `car' of X.&quot;&#xA;      (car (car (car x)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Avoid storing .elc files. These are not forward or backward compatible with between some Emacs versions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11" LastEditorUserId="304" LastEditDate="2014-10-10T07:59:55.833" LastActivityDate="2014-10-10T07:59:55.833" CommentCount="0" CommunityOwnedDate="2014-10-09T16:28:16.967" ContentLicense="CC BY-SA 3.0" />
  <row Id="960" PostTypeId="2" ParentId="941" CreationDate="2014-10-09T16:36:16.047" Score="11" Body="&lt;p&gt;You can't hide the menu bar on OS X from within Emacs.  It's always shown for non-fullscreen applications, that's simply how OS X works.  Applications have no influence on that.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;No menu bar&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you'd like to use Emacs without any menu bar, enable fullscreen mode with &lt;code&gt;M-x toggle-frame-fullscreen&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Removing individual items&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you'd just like to remove individual items from the menu bar, adjust the corresponding key maps in your &lt;code&gt;init.el&lt;/code&gt;.  For instance, the following snippet removes the “Options”, “Edit” and ”Tools” menus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map [menu-bar options] nil)&#xA;(define-key global-map [menu-bar edit] nil)&#xA;(define-key global-map [menu-bar tools] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2009-02/msg00058.html&quot;&gt;mailing list post from Xah Lee&lt;/a&gt; has more examples.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-09T16:36:16.047" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="961" PostTypeId="5" CreationDate="2014-10-09T16:51:34.820" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-09T16:51:34.820" LastActivityDate="2014-10-09T16:51:34.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="962" PostTypeId="4" CreationDate="2014-10-09T16:51:34.820" Score="0" Body="A text property is a property attached to characters in a buffer or a string." OwnerUserId="863" LastEditorUserId="863" LastEditDate="2014-10-09T21:34:09.053" LastActivityDate="2014-10-09T21:34:09.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="963" PostTypeId="2" ParentId="931" CreationDate="2014-10-09T17:13:29.380" Score="4" Body="&lt;p&gt;The way highlight-symbol handles itself, IMO, is not ideal. In order to be able to navigate at full speed and still have highlighting applied quickly after a pause I had to make some changes to the core functions of the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, highlight symbol actually checks for a 0 delay and acts differently, this isn't needed, so you can redefine &lt;code&gt;highlight-symbol-post-command&lt;/code&gt; to this version which removes the 0 delay check and just always does highlighting via a timer, not directly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun highlight-symbol-mode-post-command ()&#xA;  &quot;After a command, change the temporary highlighting.&#xA;Remove the temporary symbol highlighting and, unless a timeout is specified,&#xA;create the new one.&quot;&#xA;  (if (eq this-command 'highlight-symbol-jump)&#xA;      (when highlight-symbol-on-navigation-p&#xA;        (highlight-symbol-temp-highlight))&#xA;    (highlight-symbol-update-timer highlight-symbol-idle-delay)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Second, we need to change how the timers are started for highlighting. There is no need to have the timer repeat and no need to use an idle timer over a standard timer. You can redefined &lt;code&gt;highlight-symbol-update-timer&lt;/code&gt; like as this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun highlight-symbol-update-timer (value)&#xA;  (when highlight-symbol-timer&#xA;    (cancel-timer highlight-symbol-timer))&#xA;  (setq highlight-symbol-timer&#xA;        (run-with-timer value nil 'highlight-symbol-temp-highlight)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, set the delay time very small, I used .1 seconds. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq highlight-symbol-idle-delay .1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With these changes I am able to move around the buffer quickly with without unnecessary highlighting occurring and slowing things down along the way. Instead highlighting occurs promptly after I stop moving.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-10-09T17:13:29.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="964" PostTypeId="1" AcceptedAnswerId="969" CreationDate="2014-10-09T17:30:29.517" Score="36" ViewCount="6973" Body="&lt;p&gt;I want to define some key bindings for my new found usage of helm, amazing mode btw, and I want to do it without overwriting the usage of other keys. I realize that the number of different key combinations is infinite, but is there some way to see all &lt;em&gt;undefined&lt;/em&gt; key bindings for say 1 level deep? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want to know what key bindings are available after hitting &lt;code&gt;C-c&lt;/code&gt;, and then get a buffer with a listing of &lt;code&gt;C-c some_keys&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming this feature doesn't currently exist?&lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="105" LastEditDate="2014-10-10T04:45:45.143" LastActivityDate="2017-09-29T17:04:12.930" Title="Show unbound keys" Tags="|key-bindings|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="965" PostTypeId="1" CreationDate="2014-10-09T17:34:31.887" Score="1" ViewCount="855" Body="&lt;p&gt;I have the following line in my &lt;code&gt;.emacs&lt;/code&gt; to load the &lt;a href=&quot;https://github.com/greduan/emacs-theme-gruvbox/blob/master/gruvbox-theme.el&quot; rel=&quot;nofollow&quot;&gt;gruvbox theme&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'gruvbox t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When opening Emacs, I get the following error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unable to load color &quot;color-235&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I call &lt;code&gt;load-theme&lt;/code&gt; again, everything works out fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this error occurring? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this so that I do not need to call &lt;code&gt;load-theme&lt;/code&gt; every time I open Emacs?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="25" LastEditDate="2015-06-08T00:36:02.143" LastActivityDate="2023-12-14T01:01:45.187" Title="Unable to load color &quot;color-235&quot; when using `gruvbox` theme" Tags="|frames|themes|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="966" PostTypeId="2" ParentId="958" CreationDate="2014-10-09T17:47:43.220" Score="10" Body="&lt;p&gt;Elisp is an interpreted language. You can put version-specific code in your &lt;code&gt;.emacs&lt;/code&gt;, but protect it by testing at load time that it's operating on the correct version.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (is-new-feature-available)&#xA;    (shiny-new-feature)&#xA;  (old-less-nifty-feature))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code will work in all versions because &lt;code&gt;(shiny-new-feature)&lt;/code&gt; is only evaluated when &lt;code&gt;(is-new-feature-available)&lt;/code&gt; returns true. Much of this answer is devoted to how to implement &lt;code&gt;(is-new-feature-available)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Coping with different sets of features&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It's better to test whether a feature is available than to test the Emacs version. Sometimes the feature may be available as an optional package. If you want to run code in XEmacs or other Emacs variant, it may have acquired the same features in different versions. Use the function &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Void-Variables.html#index-boundp-629&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;boundp&lt;/code&gt;&lt;/a&gt; to test if a variable is available, and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Function-Cells.html#index-fboundp-759&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;fboundp&lt;/code&gt;&lt;/a&gt; to test if a function is available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following snippet binds a key to toggle &lt;code&gt;visual-line-mode&lt;/code&gt; if available, and &lt;code&gt;longlines-mode&lt;/code&gt; otherwise.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\eml&quot; (if (fboundp 'visual-line-mode)&#xA;                           'visual-line-mode&#xA;                         'longlines-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sometimes, rather than test for the feature, it's easier to run a small piece of code and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html#Handling-Errors&quot; rel=&quot;nofollow noreferrer&quot;&gt;ignore any errors&lt;/a&gt; due to undefined functions, invalid arguments, etc. Don't do this for large amounts of code, as this will make your code very hard to debug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I don't want to see a toolbar. Older versions of Emacs didn't have them at all. GNU Emacs and XEmacs added that feature in different ways and made it the default. Here's how I turn them off. The &lt;code&gt;set-specifier&lt;/code&gt; function is specific to XEmacs, and &lt;code&gt;default-toolbar-visible-p&lt;/code&gt; is specific to recent enough versions of Emacs; using &lt;code&gt;condition-case&lt;/code&gt; takes care of both requirements. GNU Emacs provides a dedicated function so I merely test if that function is available.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; For XEmacs&#xA;(condition-case nil&#xA;    (set-specifier default-toolbar-visible-p nil)&#xA;  (error nil))&#xA;;; For GNU Emacs&#xA;(if (fboundp 'tool-bar-mode)&#xA;    (tool-bar-mode 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some face names change over versions. Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces.html#index-facep-3771&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;facep&lt;/code&gt;&lt;/a&gt; to test the availability of a face name.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((face (if (facep 'mode-line) 'mode-line 'modeline)))&#xA;  (set-face-background face …))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sometimes you may want to load a nice package if present, and do nothing if the package isn't available. &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html#index-require-884&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;require&lt;/code&gt;&lt;/a&gt; has an optional argument for that.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tex-site nil t) ;; Load AUCTeX if available&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This argument was introduced in GNU Emacs 20.4 and isn't available in XEmacs, so if you want to go that far back, you'll have to either wrap it in &lt;code&gt;condition-case&lt;/code&gt; or use &lt;code&gt;load&lt;/code&gt; instead (which doesn't check for already-loaded libraries).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Limit the version dependencies to user-level features. Don't use newer programming features that aren't available in all the versions you want to support: you'll have to provide a compatibility version for older versions, and it's easier to maintain a single version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes you do need a feature in many places, and it's available on all the implementations you care about, but in a different way. This is mostly the case if you want to support both XEmacs and GNU Emacs: they had a frustrating tendency of copying each other's features but not their interface. In this case, defining a compatibility function is more convenient than testing at the point of use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following code defines a function that returns the window system of the current frame, the modern GNU way, the modern XEmacs way, and the old-style way when you couldn't combine terminal and GUI frames in the same instance.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'compat-window-system&#xA;  (cond&#xA;   ((fboundp 'window-system) #'window-system)&#xA;   ((fboundp 'device-type)&#xA;    (lambda (&amp;amp;optional frame)&#xA;      (device-type (frame-device frame))))&#xA;   (t&#xA;    (lambda (&amp;amp;optional frame) window-system))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Environment dependencies&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There isn't much code that needs to be platform-dependent. The variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html#index-system_002dtype-4120&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;system-type&lt;/code&gt;&lt;/a&gt; indicates the operating system. I use it exclusively to activate a few hacks for &lt;code&gt;ms-dos&lt;/code&gt; (yes, my files are that old) and &lt;code&gt;windows-nt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to add directories to your executable search path (&lt;code&gt;PATH&lt;/code&gt;), but that's usually best done outside Emacs, in your &lt;code&gt;.profile&lt;/code&gt; for Unix-like system and through the control panel in Windows. To test whether an external program is available, call &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Locating-Files.html#index-executable_002dfind-1953&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;executable-find&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For code that needs to act differently depending on the type of GUI if any, check &lt;code&gt;window-type&lt;/code&gt; or its successors (see above).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Initialization files&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For maximum compatibility, put your code in &lt;code&gt;~/.emacs&lt;/code&gt;. GNU Emacs started looking in &lt;code&gt;~/emacs.d&lt;/code&gt; in version 22. XEmacs started looking in &lt;code&gt;~/.xemacs&lt;/code&gt; in version 21.4. An alternative approach is to put compatibility code in &lt;code&gt;~/.emacs&lt;/code&gt; and finish by loading your main file. Put &lt;code&gt;(setq load-home-init-file t)&lt;/code&gt; somewhere to avoid having recent¹ versions of XEmacs ask you whether you want to move your &lt;code&gt;.emacs&lt;/code&gt; to the XEmacs-only location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different versions of Emacs may have different, and incompatible, expansion for some macros. So don't share your byte-compiled files between versions, compile the files on each machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes a feature is deprecated, but you still want to use it because that's all there is in some other version that you want to support. The byte compiler warnings come from the &lt;code&gt;byte-obsolete-variable&lt;/code&gt; property.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA; ((not (boundp 'desktop-enable))&#xA;  (defvaralias 'desktop-enable 'desktop-save-mode))&#xA; ((get 'desktop-enable 'byte-obsolete-variable)&#xA;  (put 'desktop-enable 'byte-obsolete-variable nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;¹ &lt;sub&gt; Relatively speaking, compared with older XEmacs. &lt;/sub&gt;  &lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="1979" LastEditDate="2019-09-15T18:48:29.543" LastActivityDate="2019-09-15T18:48:29.543" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="967" PostTypeId="1" CreationDate="2014-10-09T18:05:00.790" Score="9" ViewCount="1397" Body="&lt;p&gt;Is there a way, via some command that can be invoked by the keyboard, of making Emacs think that I clicked at a particular point (so that it does whatever it would have done if I clicked there, e.g. follow link or pop up a menu)? Or that I hovered mouse at point (so that tool tip pops up)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Motivation: Some modes decorate the buffer, turning some text into links and so on. I may know how to do something with the mouse (e.g. click on it), but not the equivalent keyboard shortcut/command to invoke. Of course I should read documentation for the mode and learn it, but thought it's an interesting question.]&lt;/p&gt;&#xA;" OwnerUserId="862" LastEditorUserId="50" LastEditDate="2014-10-09T18:10:38.383" LastActivityDate="2022-03-24T23:35:47.000" Title="Simulating mouse operations with keyboard" Tags="|key-bindings|mouse|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="968" PostTypeId="2" ParentId="964" CreationDate="2014-10-09T18:22:27.610" Score="7" Body="&lt;p&gt;You can hit &lt;code&gt;C-c C-h&lt;/code&gt; to know all bindings that start with &lt;code&gt;C-c&lt;/code&gt;. This works for any key sequence that is &quot;incomplete&quot;: hit that key sequence and then &lt;code&gt;C-h&lt;/code&gt; to see all the keybindings that start with that sequence. You can then pick something not in the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To know whether a particular keybinding is defined (to avoid overwriting it), you can use &lt;code&gt;C-h c&lt;/code&gt; or &lt;code&gt;M-x describe-key-briefly&lt;/code&gt; (or &lt;code&gt;C-h k&lt;/code&gt; or &lt;code&gt;M-x describe-key&lt;/code&gt;) to see what it is defined to, in the current mode.&lt;/p&gt;&#xA;" OwnerUserId="862" LastActivityDate="2014-10-09T18:22:27.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="969" PostTypeId="2" ParentId="964" CreationDate="2014-10-09T18:22:35.123" Score="30" Body="&lt;p&gt;Check out the &lt;a href=&quot;https://github.com/Fuco1/free-keys&quot;&gt;&lt;code&gt;free-keys&lt;/code&gt;&lt;/a&gt; package, which gives you a function of the same name that shows you all your currently unused key-bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot;&gt;&lt;code&gt;bind-key&lt;/code&gt;&lt;/a&gt; is also a helpful tool which gives you a cleaner syntax for defining your own bindings, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key &quot;C-h C-k&quot; 'free-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;bind-key&lt;/code&gt; also comes with a handy defun called &lt;code&gt;describe-personal-keybindings&lt;/code&gt; to see all the key-bindings you've set as well as if and what bindings you've overridden.&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2014-10-09T18:22:35.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="970" PostTypeId="2" ParentId="964" CreationDate="2014-10-09T18:35:43.513" Score="9" Body="&lt;p&gt;Here are few ideas. They don't answer your question directly but they can help you figure out which key bindings are available for use.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Get a list of all key bindings starting with a prefix&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/kai2nenobu/guide-key&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;guide-key&lt;/code&gt;&lt;/a&gt; package can be used to show, in alphabetical order, all the key bindings that begin with the entered prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below screen capture shows &lt;code&gt;guide-key&lt;/code&gt; showing me all my key-bindings beginning with &lt;kbd&gt;C-x r&lt;/kbd&gt;. As the available bindings are listed alphabetically, it's easy to figure out which bindings are available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The screen capture also shows what other key prefixes I use &lt;code&gt;guide-key&lt;/code&gt; for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/nDWbF.png&quot; alt=&quot;My key bindings that begin with C-x r&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Get a list of what bindings you overrode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;describe-personal-keybindings&lt;/code&gt; function that comes with the &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; package shows what key bindings you overrode as shown in below screen capture. You can review the results of this function to check if you overrode a binding unintentionally. The cool thing is that this function shows the bindings for all minor modes too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/l5xiD.png&quot; alt=&quot;Sample of what the output of describe-personal-keybindings looks like&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="1979" LastEditDate="2017-09-29T17:04:12.930" LastActivityDate="2017-09-29T17:04:12.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="971" PostTypeId="1" AcceptedAnswerId="973" CreationDate="2014-10-09T18:36:17.723" Score="8" ViewCount="308" Body="&lt;p&gt;I have code that tests the arity of a function. I use it to determine whether optional arguments added in recent versions of a package are present. It calls &lt;code&gt;subr-arity&lt;/code&gt; for built-in functions and parses the arglist of bytecode objects and lambdas.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun function-argspec (func)&#xA;  (if (symbolp func) (setq func (indirect-function func)))&#xA;  (cond&#xA;   ((byte-code-function-p func)&#xA;    (aref func 0))&#xA;   ((and (consp func)&#xA;         (eq (car func) 'lambda)&#xA;         (consp (cdr func)))&#xA;    (car (cdr func)))&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has worked well up to Emacs 23. In Emacs 24.3 on Ubuntu 14.04, it's working well for some functions, but not for others.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(function-argspec 'revert-buffer)&#xA;(&amp;amp;optional ignore-auto noconfirm preserve-modes)&#xA;(require 'vc)&#xA;vc&#xA;(function-argspec 'vc-print-log-internal)&#xA;1283&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evidently the bytecode format has changed in a way that isn't reflected in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Byte_002dCode-Objects.html&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbol-function 'vc-print-log-internal)&#xA;#[1283 \301\211\302\301\211\203\211@\303!\203\304\262A\266\202\202\210\203'\305&amp;gt;\202*\306&amp;gt;??\262\2036\307\2027\310\262\311&#xA;\312\313\314\315\316&#xA;$\317&quot;\320\321%\312\322\323\315\316#\324&quot;\325\326%\312\327\330\315\316!\331&quot;\332\333%\312\334\335\315\316%\336&quot;\325\337%&amp;amp;\262\207 [vc-log-short-style nil *vc-change-log* file-directory-p t directory file short long vc-log-internal-common make-byte-code 1028 \304\305\303\301\205\300\302&amp;amp;\207 vconcat vector [vc-call-backend print-log] 12 &#xA;&#xA;(fn BK BUF TYPE-ARG FILES-ARG) 771 \303\300\301\302$\207 [vc-print-log-setup-buttons] 8 &#xA;&#xA;(fn BK FILES-ARG RET) 257 \301\302\300#\207 [vc-call-backend show-log-entry] 5 &#xA;&#xA;(fn BK) 514 \305\300\301\302\303\304%\207 [vc-print-log-internal] &#xA;&#xA;(fn IGNORE-AUTO NOCONFIRM)] 28 &#xA;&#xA;(fn BACKEND FILES WORKING-REVISION &amp;amp;optional IS-START-REVISION LIMIT)]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I reliably access the argument list of a bytecode object? Just knowing the arity would do, I don't care about the argument names. More precisely, I want to know how many arguments are mandatory and how many arguments are optional, or in other terms, I want the same information that I get from &lt;code&gt;subr-arity&lt;/code&gt;. Of course my code must cope with both old-style and new-style bytecode, so I need to know not just where to dig but also when to dig where.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-08-21T20:06:40.903" Title="Argspec or arity of a bytecode function in Emacs 24" Tags="|elisp|bytecode|functions|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="972" PostTypeId="1" AcceptedAnswerId="2923" CreationDate="2014-10-09T18:59:12.500" Score="17" ViewCount="1109" Body="&lt;p&gt;I have been using &lt;code&gt;csv-mode&lt;/code&gt; to modify small to medium sized CSV files, but recently I have been working with large files containing more than 40,812 entries. &lt;code&gt;csv-mode&lt;/code&gt; struggles to align and navigate the tables, and is too slow to be usable as is.  In comparison, LibreOffice Calc can zip through the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to make &lt;code&gt;csv-mode&lt;/code&gt; handle large tables, or is there a better approach available?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of &lt;a href=&quot;https://stackoverflow.com/questions/10616525/is-there-a-good-emacs-mode-for-displaying-and-editing-huge-delimiter-separated-f&quot;&gt;a related Stack Overflow question&lt;/a&gt;. Its solution was to only align the portion of buffer in the visible window, but this did not solve the sluggishness in my case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.dropbox.com/s/xmt4s5i5ikq0i0v/big.csv?dl=0&quot; rel=&quot;noreferrer&quot;&gt;Here is an example file.&lt;/a&gt;  I tried to make it large, but not so large it will freeze Emacs on older computers.&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-31T17:10:51.973" Title="How to view and edit large delimiter separated value files?" Tags="|editing|table|large-files|csv|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="973" PostTypeId="2" ParentId="971" CreationDate="2014-10-09T19:01:54.780" Score="8" Body="&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Woo! I found a function that will take either the normal argument list, or the integer version and return somewhat of a signature: &lt;code&gt;byte-compile-arglist-signature&lt;/code&gt; in bytecomp.el!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(byte-compile-arglist-signature 1283) ;; =&amp;gt; (3 . 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Initial Answer:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I hope someone else can chime in on whether or not this is documented somewhere but this is what I learned by reading &lt;code&gt;exec_byte_code&lt;/code&gt; inside bytecode.c in Emacs source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number you see is used to calculate the argspec when the the byte code is actually being run, I assume this for performance, it's actually quite clever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote this code to show you how to calculate the arity of a function given that number:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun arity-info (byte-code-int)&#xA;  (let* ((required  (logand byte-code-int 127))&#xA;         (total-named  (lsh byte-code-int -8))&#xA;         (optional (- total-named required))&#xA;         (allow-rest  (if (not (zerop (logand byte-code-int 128))) &quot;yes&quot; &quot;no&quot;)))&#xA;    (list&#xA;     (cons 'required required)&#xA;     (cons 'total-named total-named)&#xA;     (cons 'optional optional)&#xA;     (cons 'allow-rest allow-rest))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can see here that if we run &lt;code&gt;arity-info&lt;/code&gt; with 1283 we get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((required . 3) (total-named . 5) (optional . 2) (allow-rest . &quot;no&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which you can see describes the arity of &lt;code&gt;vc-print-log-internal&lt;/code&gt; perfectly, 5 total args, 3 required, 2 optional, does not allow &amp;amp;rest.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(vc-print-log-internal BACKEND FILES WORKING-REVISION &amp;amp;optional IS-START-REVISION LIMIT)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-10-09T19:20:57.360" LastActivityDate="2014-10-09T19:20:57.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="974" PostTypeId="1" AcceptedAnswerId="2095" CreationDate="2014-10-09T20:14:42.963" Score="4" ViewCount="205" Body="&lt;p&gt;When I terminate a Multi I-search, Emacs takes me back to the original buffer rather than the result I'm looking at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried terminating the search with RET, escape, arrow keys, and none of these have worked. What should I be doing instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start Emacs with &lt;code&gt;emacs -Q&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Open several buffers.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x ibuffer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Mark several buffers with &lt;code&gt;m&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Start Multi I-search with &lt;code&gt;M-s a C-s&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Search for something and press &lt;code&gt;C-s&lt;/code&gt; until you're in at least the second buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RET&lt;/code&gt; returns you to the original buffer!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="655" LastEditorUserId="304" LastEditDate="2014-10-10T22:41:21.537" LastActivityDate="2014-10-12T15:13:09.387" Title="Terminating ibuffer incremental search" Tags="|search|ibuffer|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="975" PostTypeId="1" AcceptedAnswerId="978" CreationDate="2014-10-09T20:47:49.633" Score="23" ViewCount="5082" Body="&lt;p&gt;Inspired by modern browsers, I'd love to be able to see &lt;em&gt;how&lt;/em&gt; many occurrences there are of some string, when I search for it &amp;ndash; like the &quot;10 of 37&quot; at the top-right corner of the screenshot below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yxOkZ.png&quot; alt=&quot;Chrome 10 of 37&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way of getting this in Emacs? Presumably, so as to not be slow, it should run only after some idle time.&lt;/p&gt;&#xA;" OwnerUserId="862" LastActivityDate="2021-03-01T16:38:37.757" Title="Getting number of occurrences, during incremental search (C-s / isearch-forward)" Tags="|search|" AnswerCount="5" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="976" PostTypeId="1" AcceptedAnswerId="1000" CreationDate="2014-10-09T20:52:56.533" Score="8" ViewCount="3205" Body="&lt;p&gt;I know basics of Common Lisp. I've learned it using Emacs + SLIME, and I must say that without these two I wouldn't learn too much - using bare REPL is tough job. However, SLIME makes a great job at turning REPL into great environment for interactive programming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, I'd like to learn Scheme with SICP book - it's always good to learn something new, and the book has good reviews. However, I wouldn't like to go back to bare REPL from Scheme - that's why I'd like to ask if there's some way to connect MIT Scheme with Emacs+SLIME, or something similar to turn it into something a bit more programmer-friendly.&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="104" LastEditDate="2014-10-10T03:25:06.213" LastActivityDate="2014-10-10T03:25:06.213" Title="How to integrate SLIME with MIT Scheme?" Tags="|slime|programming|repl|scheme|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="977" PostTypeId="1" AcceptedAnswerId="989" CreationDate="2014-10-09T21:32:18.270" Score="15" ViewCount="6582" Body="&lt;p&gt;Very often I use &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Up/Down&lt;/kbd&gt; to select a region in Emacs. It works fine in GUI mode, but when &lt;code&gt;emacs&lt;/code&gt; is invoked with &lt;code&gt;-nw&lt;/code&gt; option I can select lines only with &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Down&lt;/kbd&gt;. The &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Up&lt;/kbd&gt; doesn't work, I get this error message in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;select&amp;gt; is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I solve this issue?&lt;/p&gt;&#xA;" OwnerUserId="871" LastEditorUserId="25" LastEditDate="2017-10-16T22:39:04.450" LastActivityDate="2021-12-23T23:19:05.283" Title="Shift+Up isn't recognized by Emacs in a terminal" Tags="|key-bindings|terminal-emacs|region|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="978" PostTypeId="2" ParentId="975" CreationDate="2014-10-09T21:47:03.260" Score="15" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/syohex/emacs-anzu&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;anzu&lt;/code&gt;&lt;/a&gt; package does that. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;anzu.el provides a minor mode which displays current match and total matches information in the mode-line in various search modes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://github.com/syohex/emacs-anzu/raw/master/image/anzu.gif&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="304" LastEditDate="2014-10-17T12:55:08.393" LastActivityDate="2014-10-17T12:55:08.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="979" PostTypeId="2" ParentId="976" CreationDate="2014-10-09T22:01:05.020" Score="0" Body="&lt;p&gt;I haven't tried it in Emacs, but there is a racket language for sicp and racket-mode can be installed from melpa. It probably won't be as sophisticated as slime, but will probably give you function completion and documentation at least.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-10-09T22:01:05.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="980" PostTypeId="2" ParentId="977" CreationDate="2014-10-09T22:01:15.920" Score="4" Body="&lt;p&gt;In emacs, the region is delimited by the point (cursor) and the mark (some previous position of the cursor, which has been &quot;marked&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, to &quot;select a region&quot;, you need to place that mark, then move your point around. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to place the mark is to press &lt;code&gt;C-SPC&lt;/code&gt;. Then just move the cursor around, you'll see the &quot;region&quot; extend as you do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To &quot;deselect the region&quot;, you can press &lt;code&gt;C-SPC&lt;/code&gt; again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &quot;shift+movement&quot; is a common keybinding in other software, by default, it emulates this &quot;select region&quot; behavior. However, it doesn't work in terminal, because shift cannot be sent to emacs as a modifier key. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that generally, the &lt;code&gt;C-SPC&lt;/code&gt; method is much more powerful than other methods for selecting a region: you are not limited to up/down/left/right for movement (you can use search for example...), and it doesn't require that you maintain an uncomfortable key combination for a long time.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2014-10-09T22:25:59.287" LastActivityDate="2014-10-09T22:25:59.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="981" PostTypeId="1" AcceptedAnswerId="982" CreationDate="2014-10-09T22:13:27.030" Score="9" ViewCount="3568" Body="&lt;p&gt;How can  I save the cursor position for every file I have opened? So, next time I open the file, the cursor will be at the position I last opened it.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2014-10-09T23:12:30.277" LastActivityDate="2014-10-10T00:46:05.060" Title="How do I save a cursor position?" Tags="|cursor|session|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="982" PostTypeId="2" ParentId="981" CreationDate="2014-10-09T22:19:57.563" Score="10" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/SavePlace&quot;&gt;&lt;code&gt;saveplace&lt;/code&gt;&lt;/a&gt; has you covered:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'saveplace)&#xA;(setq-default save-place t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-10-09T22:19:57.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="983" PostTypeId="1" AcceptedAnswerId="986" CreationDate="2014-10-09T22:26:16.960" Score="12" ViewCount="1855" Body="&lt;p&gt;There are a number of commands in Emacs which apply to &quot;words.&quot;  Examples include &lt;code&gt;forward-word&lt;/code&gt;, &lt;code&gt;kill-word&lt;/code&gt;, &lt;code&gt;upcase-word&lt;/code&gt;, &lt;code&gt;mark-word&lt;/code&gt;, &lt;code&gt;transpose-words&lt;/code&gt;, etc.  The definition of &quot;word&quot; seems to vary a bit between the commands.  For example, &lt;code&gt;forward-word&lt;/code&gt; will stop at an underscore within a word (e.g. &lt;code&gt;foo_bar&lt;/code&gt;) but &lt;code&gt;mark-word&lt;/code&gt; does not stop at the underscore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is it possible to change the definition of &quot;word&quot; when I am in a prog mode so that Emacs will use the appropriate word boundaries for the syntax of the current language?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I am in &lt;code&gt;c-mode&lt;/code&gt; I want &lt;code&gt;forward-word&lt;/code&gt; to skip over underscores, and when I am in &lt;code&gt;lisp-mode&lt;/code&gt; I want &lt;code&gt;forward-word&lt;/code&gt; to skip over both hyphens and underscores, etc.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-10T01:39:30.457" Title="Treat symbols as words in prog modes" Tags="|syntax|navigation|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="984" PostTypeId="1" CreationDate="2014-10-09T22:33:42.853" Score="5" ViewCount="3762" Body="&lt;p&gt;I want to install tab bar to see buffer names at the top and jump between them with Ctrl-Up/Down. Yes, I know that some people &lt;a href=&quot;https://stackoverflow.com/a/3812010/3620917&quot;&gt;doesn't recommend&lt;/a&gt; it for emacs, but I don't agree with them - I do like &lt;code&gt;ido&lt;/code&gt; but I like tabs too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, when I open &lt;a href=&quot;http://www.emacswiki.org/emacs/TabBarMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;most obvious source on emacswiki&lt;/a&gt;, it gives me link to sourceforge saying that it is outdated and if I want the newer version I should look at debian packages. I'm not a debian user, know nothing about their package manager and it sounds strange that such popular package is updated only by developers of some distribution (not emacs dev).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I have found this package also &lt;a href=&quot;http://melpa.milkbox.net/#/tabbar&quot; rel=&quot;nofollow noreferrer&quot;&gt;on melpa&lt;/a&gt;, where according to the version number (20140316.600) it was updated this year, so relatively new. But if I click (in melpa) on &quot;Homepage&quot; it redirects me to &lt;a href=&quot;https://github.com/dholm/tabbar&quot; rel=&quot;nofollow noreferrer&quot;&gt;git page&lt;/a&gt; where there is yet another different &quot;last commit&quot; date (even newer!). To add to the mess git once again refers to different site, this time back to emacswiki, but it is written in such a way that I'm not sure if &lt;code&gt;git version&lt;/code&gt; is a fork of emacswiki ones or they are the same and both the fork of aquamacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone shed light which version is the current one, say official? Or is it that there are only random patches here and there done by random people and none of package is official?&lt;/p&gt;&#xA;" OwnerUserId="871" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2023-03-02T08:42:51.457" Title="What is the right way to install tab bar?" Tags="|tabbar|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="986" PostTypeId="2" ParentId="983" CreationDate="2014-10-09T22:53:35.357" Score="4" Body="&lt;p&gt;Emacs should already use &quot;&lt;em&gt;the appropriate word boundaries for the syntax of the current language&lt;/em&gt;&quot;.  If it does not then file a bug for the major mode for that language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But maybe you don't really mean &lt;em&gt;words&lt;/em&gt;.  Maybe you mean &lt;strong&gt;symbol&lt;/strong&gt; syntax, not word syntax. Emacs distinguishes the two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For symbol syntax, use symbol commands, not word commands: &lt;code&gt;forward-symbol&lt;/code&gt;, etc. &lt;em&gt;From your description, this is what you really want.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you feel you really want to use a word function on a symbol, you can &lt;strong&gt;change the syntax category of particular characters&lt;/strong&gt; &lt;em&gt;to have word-constituent syntax instead of symbol-constituent syntax.&lt;/em&gt; But generally this is not what you want to do and you should not need to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual for info about character syntax. And see the Emacs manual and the Elisp manual for commands and other functions that operate on symbols (not Lisp symbols, but text with symbol syntax, in whatever language).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And keep in mind that operations on sexps are often useful also for acting on symbols: &lt;code&gt;C-M-f&lt;/code&gt; (&lt;code&gt;forward-sexp&lt;/code&gt;), &lt;code&gt;C-M-t&lt;/code&gt; (&lt;code&gt;transpose-sexps&lt;/code&gt;), etc.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-10T01:39:30.457" LastActivityDate="2014-10-10T01:39:30.457" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="987" PostTypeId="2" ParentId="983" CreationDate="2014-10-09T23:02:05.893" Score="3" Body="&lt;p&gt;If I understood your question, you could modify the language syntax table, e.g. For c++:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(modify-syntax-entry ?_ &quot;w&quot; c++-mode-syntax-table)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x apropos&lt;/code&gt; then look up of syntax-table should help you too.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-10-09T23:02:05.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="988" PostTypeId="2" ParentId="975" CreationDate="2014-10-09T23:21:18.890" Score="14" Body="&lt;p&gt;Here are some possibilities that aren't very slick, that have the advantage of working with a stock Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you press &lt;code&gt;M-s o&lt;/code&gt; (&lt;code&gt;isearch-occur&lt;/code&gt;) during an incremental search, an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html#index-M_002ds-o&quot; rel=&quot;noreferrer&quot;&gt;Occur&lt;/a&gt; buffer pops up with the current search expression. At the top of the &lt;code&gt;*Occur*&lt;/code&gt; buffer is the number of matching lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html#index-how_002dmany&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;how-many&lt;/code&gt;&lt;/a&gt; displays the number of occurrences of a regexp (including repeated occurrences). Unfortunately it isn't integrated with incremental search. Here's a proof-of-concept isearch integration: press &lt;code&gt;M-s #&lt;/code&gt; during isearch to show the number of matches.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-how-many (regexp)&#xA;  &quot;Run `how-many' using the last search string as the regexp.&#xA;Interactively, REGEXP is constructed as with `isearch-occur'.&quot;&#xA;  (interactive&#xA;   (list (cond&#xA;      ((functionp isearch-word)&#xA;       (funcall isearch-word isearch-string))&#xA;      (isearch-word (word-search-regexp isearch-string))&#xA;      (isearch-regexp isearch-string)&#xA;      (t (regexp-quote isearch-string)))))&#xA;  (how-many regexp nil nil (interactive-p)))&#xA;(define-key isearch-mode-map [?\M-s ?#] 'isearch-how-many)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2017-04-25T18:33:34.883" LastActivityDate="2017-04-25T18:33:34.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="989" PostTypeId="2" ParentId="977" CreationDate="2014-10-09T23:37:59.177" Score="16" Body="&lt;p&gt;A text terminal transmits only characters (more precisely, bytes), not keys. Keys and keychords (keys with modifiers) are encoded as character sequences. Keys that insert printable characters are sent as themselves; function keys are sent as escape sequences. Most escape sequences consist of the character Escape (&lt;code&gt;?\e&lt;/code&gt; in Emacs syntax) followed by two or more printable characters. See &lt;a href=&quot;https://unix.stackexchange.com/questions/47312/control-and-up-down-keys-in-terminal-for-use-by-emacs/47402#47402&quot;&gt;Control and up/down keys in terminal for use by emacs&lt;/a&gt; and &lt;a href=&quot;https://unix.stackexchange.com/questions/116629/how-do-keyboard-input-and-text-output-work/116630#116630&quot;&gt;How do keyboard input and text output work?&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#Translation-Keymaps&quot; rel=&quot;noreferrer&quot;&gt;mechanism to translate escape sequences&lt;/a&gt; into its own notion of keys. The translation table &lt;code&gt;input-decode-map&lt;/code&gt; is initialized when Emacs starts (or more precisely, when a new frame is open: this variable has a different value on each terminal). Sometimes Emacs doesn't know all the escape sequences sent by the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, it appears that Emacs has the wrong interpretation for the escape sequence sent by &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Up&lt;/kbd&gt;. You need to tell it to interpret it as &lt;code&gt;S-up&lt;/code&gt; rather than &lt;code&gt;select&lt;/code&gt;. First, figure out what the escape sequence is. In the &lt;code&gt;*scratch*&lt;/code&gt; buffer, press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Q&lt;/kbd&gt; then &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Up&lt;/kbd&gt;. The command &lt;code&gt;C-q&lt;/code&gt; causes the next character, which is the escape character, to be inserted literally, followed by the rest of the escape sequence. Let's say that &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Up&lt;/kbd&gt; sends &lt;code&gt;\e[1;2A&lt;/code&gt; on our system, then you would need to redefine the corresponding entry in &lt;code&gt;input-mode-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map &quot;\e[1;2A&quot; [S-up])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In principle, &lt;code&gt;input-decode-map&lt;/code&gt; should be set per terminal. In practice, it's very rare to have two terminals in which the same escape sequence encodes different keys, so a global setting will work fine.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2014-10-09T23:37:59.177" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="990" PostTypeId="1" AcceptedAnswerId="996" CreationDate="2014-10-10T00:25:59.327" Score="15" ViewCount="804" Body="&lt;p&gt;Assume that I have downloaded a major mode called &lt;code&gt;magical-mode&lt;/code&gt;, and it has its own magical keymap called &lt;code&gt;magical-mode-map&lt;/code&gt;.  This mode also provides a hook &lt;code&gt;magical-mode-hook&lt;/code&gt; which is run each time &lt;code&gt;magical-mode&lt;/code&gt; becomes the major mode of a buffer.  Now I want to modify my init file to add a few custom key bindings to use in that mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that there are (at least) two ways to set up custom key bindings for &lt;code&gt;magical-mode&lt;/code&gt;.  The one that I see most commonly is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-magical-keys ()&#xA;  (local-set-key (kbd &quot;C-i&quot;) 'previous-line)&#xA;  (local-set-key (kbd &quot;C-k&quot;) 'next-line)&#xA;  (local-set-key (kbd &quot;C-j&quot;) 'backward-char)&#xA;  (local-set-key (kbd &quot;C-l&quot;) 'forward-char))&#xA;(add-hook 'magical-mode-hook 'my-magical-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it is also possible to do it this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key magical-mode-map (kbd &quot;C-i&quot;) 'previous-line)&#xA;(define-key magical-mode-map (kbd &quot;C-k&quot;) 'next-line)&#xA;(define-key magical-mode-map (kbd &quot;C-j&quot;) 'backward-char)&#xA;(define-key magical-mode-map (kbd &quot;C-l&quot;) 'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second method actually seems cleaner to me.  &lt;strong&gt;Are there any advantages to doing it one way over the other?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="105" LastEditDate="2015-05-20T04:33:16.773" LastActivityDate="2015-05-20T04:33:16.773" Title="Differences between setting major mode keys with a hook versus adding them to the mode map" Tags="|elisp|key-bindings|major-mode|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="991" PostTypeId="1" CreationDate="2014-10-10T00:30:55.157" Score="12" ViewCount="730" Body="&lt;p&gt;In emacs, more often than i like, I end up with 4 windows or more.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll use that example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------|-----------+&#xA;|        |           |&#xA;|   1    |   2       |&#xA;|        |           |&#xA;+--------+-----------+&#xA;|    3   |     4     |&#xA;|        +-----------+&#xA;|        |     5     |&#xA;+--------+-----------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Lots of function can do action in &lt;code&gt;other-window&lt;/code&gt; (usually same window pointed by &lt;code&gt;C-x o&lt;/code&gt;). Specially useful are &lt;code&gt;scroll-other-window&lt;/code&gt;. However, when 4 or more windows are opened, &lt;code&gt;other window&lt;/code&gt; is unlikely to be the one I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a &lt;strong&gt;easy&lt;/strong&gt; way to manage to do set &lt;code&gt;other-window&lt;/code&gt; without changing window/buffer layout ? Of course, it's doable using a bunch of &lt;code&gt;C-x 4 b&lt;/code&gt; and &lt;code&gt;C-b&lt;/code&gt; but I do not want to change the layout. &#xA;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if editing in window &lt;em&gt;4&lt;/em&gt; in above picture, is there an easy way to set &lt;code&gt;C-M-v&lt;/code&gt; to scroll the window &lt;em&gt;1&lt;/em&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Or simply, suppose the the focus in on window &lt;em&gt;3&lt;/em&gt; , how to set &lt;code&gt;other-window&lt;/code&gt;to point to window &lt;em&gt;2&lt;/em&gt; ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="499" LastActivityDate="2015-01-30T20:36:42.087" Title="Defining the window pointed by &quot;other-window&quot;" Tags="|window|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="992" PostTypeId="2" ParentId="990" CreationDate="2014-10-10T00:34:04.397" Score="0" Body="&lt;p&gt;Your naming is little confusing (I think you should remove &lt;code&gt;my&lt;/code&gt; in your second part of the question). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway assuming &lt;code&gt;my-magical-keys&lt;/code&gt; is a user customizing function of &lt;code&gt;magical-mode&lt;/code&gt;, I see &lt;strong&gt;one&lt;/strong&gt; obvious advantage. It is easy to remove (by &lt;code&gt;remove-hook&lt;/code&gt;)  hook in a single go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second advantage is what functions are meant for. I mean they are reusable. you can hook them to other modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @tarsius has pointed out, removing hook won't restore original behavior and turning the function into a minor mode may be better.  &lt;/p&gt;&#xA;" OwnerUserId="224" LastEditorUserId="224" LastEditDate="2014-10-10T01:00:55.933" LastActivityDate="2014-10-10T01:00:55.933" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="993" PostTypeId="2" ParentId="983" CreationDate="2014-10-10T00:34:35.350" Score="11" Body="&lt;p&gt;Take a look at &lt;code&gt;superword-mode&lt;/code&gt; and &lt;code&gt;subword-mode&lt;/code&gt;. Superword treats underscores as part of a word instead of a boundary, so &lt;code&gt;foo_bar&lt;/code&gt; &lt;em&gt;would be treated as a single word&lt;/em&gt;.&lt;br&gt;&#xA;Subword does the opposite but for camelCase, so &lt;code&gt;fooBar&lt;/code&gt; is treated as two words instead of one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like the behavior you want is for &lt;code&gt;cc-mode&lt;/code&gt; to use &lt;code&gt;superword-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c-mode-common-hook 'superword-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would recommend reading over the source for &lt;code&gt;subword-mode&lt;/code&gt;, as even if those two modes are not doing exactly what you want, they should show you how to change the word detection behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Longer discussion on &lt;a href=&quot;http://emacsredux.com/blog/2013/04/21/camelcase-aware-editing/&quot;&gt;emacsredux&lt;/a&gt;, and &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_subword-mode_superword-mode.html&quot;&gt;ergomacs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="50" LastEditDate="2014-10-10T00:43:40.960" LastActivityDate="2014-10-10T00:43:40.960" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="994" PostTypeId="2" ParentId="844" CreationDate="2014-10-10T00:36:33.087" Score="1" Body="&lt;p&gt;Thanks to everyone for their help and thanks to @Jaseem for a key piece. Indeed org-insert-link works better than my hand-rolled version.&#xA;What I ended up doing was  this. The function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jay/insert-file-link (fname)&#xA;  &quot;Insert link to file (called by Midnight Commander).&quot;&#xA;  (interactive &quot;s&quot;)&#xA;  (set-buffer (window-buffer (selected-window)))&#xA;  (org-insert-link nil (concat &quot;file://&quot; fname) fname))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this is the line from Midnight Commander menu file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;l       Insert Link to this file in Emacs&#xA;        emacsclient -e '(jay/insert-file-link &quot;%f&quot;)' &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works as I wanted it to (with a minor annoyance of MC waiting for me to hit enter).  In MC I just hit F2,l and a link to the highlighted file gets inserted wherever the cursor is in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'll edit the title to make it easier for others to find.)&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2014-10-10T00:36:33.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="995" PostTypeId="2" ParentId="981" CreationDate="2014-10-10T00:46:05.060" Score="2" Body="&lt;p&gt;Bookmarks can save your point position. I am currently getting a lot of mileage from bookmarks by using them instead of traditional desktop saving. This solution will provide many side benefits, as I shall describe below.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Edit a buffer and leave the point where you like.&lt;/li&gt;&#xA;&lt;li&gt;Save as normal with C-x C-s.&lt;/li&gt;&#xA;&lt;li&gt;Set a bookmark with C-x r m.&lt;/li&gt;&#xA;&lt;li&gt;Close the buffer.&lt;/li&gt;&#xA;&lt;li&gt;List bookmarks with C-x r l.&lt;/li&gt;&#xA;&lt;li&gt;Move the point to the name of the file with C-s filename...&lt;/li&gt;&#xA;&lt;li&gt;Press enter twice to load the file into a buffer.&lt;/li&gt;&#xA;&lt;li&gt;Notice that the point is exactly where you left it; smile.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I like this workflow because:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It gives me a permanent record of every file I ever edit.&lt;/li&gt;&#xA;&lt;li&gt;The buffer content is searchable, copyable, and accessible to macros and Lisp functions.&lt;/li&gt;&#xA;&lt;li&gt;Emacs remembers the location of the file; no more searching my hard drive for that little used shell script I wrote three years ago.&lt;/li&gt;&#xA;&lt;li&gt;The bookmark file loads very quickly, even if it grows very long, as compared to my old desktop with dozens of large files loading every time I run Emacs.&lt;/li&gt;&#xA;&lt;li&gt;Bookmarks has many more features I haven't even explored yet, like most of Emacs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The one disadvantage to this workflow is that I must manually set the bookmark every time I save the file. The next step would be, I believe, to add a &quot;hook&quot; to automatically bookmark every file I save. I haven't gotten there yet, but I'm sure someone has that already figured out.&lt;/p&gt;&#xA;" OwnerUserId="890" LastActivityDate="2014-10-10T00:46:05.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="996" PostTypeId="2" ParentId="990" CreationDate="2014-10-10T00:49:34.243" Score="17" Body="&lt;p&gt;The second approach is preferable as it modifies the mode's keymap just once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do it using the mode's hook then that will be called every time that mode is enabled in some buffer. Doing so again usually won't actually have an effect because the keys are just again bound to what they are already bound to. Major mode keymaps are &quot;local&quot; to the major mode not the individual buffers which use that mode, so if you change a binding in one of these buffers using &lt;code&gt;local-set-key&lt;/code&gt; then that affects all buffers with the same major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;local-set-key&lt;/code&gt; is primarily intended to be used as a command. Once you have determined that you would like to make some change persistent, use &lt;code&gt;define-key&lt;/code&gt; with the mode keymap as the first argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a hook to modify the keymap over and over again then that could conflict with the intended use of &lt;code&gt;local-set-key&lt;/code&gt;. Say you used &lt;code&gt;M-x local-set-key RET C-i fancy-previous-line RET&lt;/code&gt; because you want to tryout that variant of &lt;code&gt;previous-line&lt;/code&gt;. If you now open a new buffer which uses the same major mode, then the hook would run again and override your temporary binding, in &lt;em&gt;all buffers&lt;/em&gt; using that major mode, including the buffer in which you did previously use &lt;code&gt;local-set-key&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-10-10T00:59:41.250" LastActivityDate="2014-10-10T00:59:41.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="997" PostTypeId="2" ParentId="990" CreationDate="2014-10-10T00:50:54.793" Score="4" Body="&lt;p&gt;Using &lt;code&gt;(define-key my-magical-mode-map …)&lt;/code&gt; is the normal way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use a hook and &lt;code&gt;local-set-key&lt;/code&gt;, the keys are added each time you enter My Magical mode in some buffer. This is weird because &lt;code&gt;local-set-key&lt;/code&gt; affects all buffers that are in the same mode (more generally, all buffers using the same keymap). So if you've made any changes to the keymap, they will be overridden each time you enter My Magical mode in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second method may also be confusing if you customize the keymap in different places. The hooks are executed in the reverse order from the order they're added in, and until the first time they are executed, you won't see any trace of your customizations.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-10T00:50:54.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="998" PostTypeId="2" ParentId="991" CreationDate="2014-10-10T00:56:45.113" Score="2" Body="&lt;p&gt;From a quick review of the source of &lt;code&gt;other-window&lt;/code&gt; it looks like it's actually dependent on the window returned by &lt;code&gt;next-window&lt;/code&gt;, which is defined in c. Unfortunately &lt;code&gt;scroll-other-window&lt;/code&gt; is also defined in c, and presumably calls next-window from there. I don't think it's easy to override that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;switch-to-buffer-other-window&lt;/code&gt; appears to use &lt;code&gt;pop-to-buffer&lt;/code&gt;, so you may have some luck there.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-10T00:56:45.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="999" PostTypeId="2" ParentId="967" CreationDate="2014-10-10T01:01:36.687" Score="6" Body="&lt;p&gt;Often, navigating to a location and pressing some key will have the same effect as clicking at that location. There's no built-in mechanism that ensures this, it's just that modes are typically written that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can generate &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mouse-Events.html#Mouse-Events&quot; rel=&quot;noreferrer&quot;&gt;mouse events&lt;/a&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Click-Events.html#Click-Events&quot; rel=&quot;noreferrer&quot;&gt;click&lt;/a&gt;, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Repeat-Events.html#Repeat-Events&quot; rel=&quot;noreferrer&quot;&gt;double/triple/… click&lt;/a&gt;, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Button_002dDown-Events.html#Button_002dDown-Events&quot; rel=&quot;noreferrer&quot;&gt;button down/up&lt;/a&gt;, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Drag-Events.html#Drag-Events&quot; rel=&quot;noreferrer&quot;&gt;drag&lt;/a&gt;, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Motion-Events.html#Motion-Events&quot; rel=&quot;noreferrer&quot;&gt;motion&lt;/a&gt;). All mouse events have the form &lt;code&gt;(TYPE POSITION . EXTRA-DATA)&lt;/code&gt; where TYPE is a symbol that encodes the mouse button, the nature of the action (click, drag, etc.), and the modifiers. TYPE is &lt;code&gt;mouse-movement&lt;/code&gt; for a motion event. Call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Accessing-Mouse.html#index-posn_002dat_002dpoint-1409&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;posn-at-point&lt;/code&gt;&lt;/a&gt; to generate the POSITION for the location of the point in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some proof-of-concept code that simulates a mouse click at the cursor position when you press &lt;code&gt;f11&lt;/code&gt; followed by a digit. Modifiers are taken into account.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-mouse-event-at-point (base-event)&#xA;  (let ((posn (posn-at-point))&#xA;        (prefix &quot;&quot;)&#xA;        (basic-type (event-basic-type base-event))&#xA;        (modifiers (event-modifiers base-event)))&#xA;    (cond&#xA;     ((and (integerp basic-type) (&amp;gt;= basic-type ?0) (&amp;lt;= basic-type ?9))&#xA;      ;; click&#xA;      (let* ((mouse-type (intern (format &quot;%smouse-%d&quot; prefix (- basic-type ?0))))&#xA;             (click-count 1)&#xA;             (type (event-convert-list (append modifiers (list mouse-type)))))&#xA;        (list type posn click-count)))&#xA;     (t&#xA;      (error &quot;Unsupported key for mouse event: %s&quot; (event-basic-type base-event))))))&#xA;(defun simulate-mouse-event-at-point ()&#xA;  (interactive)&#xA;  (let ((event (make-mouse-event-at-point last-input-event)))&#xA;    (setq unread-command-events (cons event unread-command-events))))&#xA;&#xA;(defvar simulate-mouse-event-map (make-sparse-keymap))&#xA;(global-set-key [f11] simulate-mouse-event-map)&#xA;(define-key simulate-mouse-event-map [t] 'simulate-mouse-event-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Simulating hover looks more difficult.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-10T01:01:36.687" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1000" PostTypeId="2" ParentId="976" CreationDate="2014-10-10T01:13:48.553" Score="5" Body="&lt;p&gt;I think &lt;a href=&quot;http://nongnu.org/geiser/&quot; rel=&quot;noreferrer&quot;&gt;geiser-mode&lt;/a&gt; may provide what you are looking for at least for guile and racket, but apparently not MIT Scheme. I know that provides &lt;kbd&gt;M-.&lt;/kbd&gt; to jump to symbol definition in environment, completion, and inline documentation help. Take a look at the &lt;a href=&quot;http://nongnu.org/geiser/geiser_1.html#Introduction&quot; rel=&quot;noreferrer&quot;&gt;introduction&lt;/a&gt;, and &lt;a href=&quot;http://nongnu.org/geiser/geiser_5.html#Cheat-sheet&quot; rel=&quot;noreferrer&quot;&gt;cheat sheet&lt;/a&gt; for a quick overveiw of features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternative, it does appear mit-scheme has &lt;a href=&quot;https://github.com/ecraven/mit-scheme-swank&quot; rel=&quot;noreferrer&quot;&gt;SWANK bindings&lt;/a&gt; for SLIME, and that may be incorporated into SLIME itself.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-10T01:13:48.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1001" PostTypeId="2" ParentId="663" CreationDate="2014-10-10T01:22:22.497" Score="0" Body="&lt;p&gt;As mentioned by @elemakil running a Magit command causes buffers that visit files inside the same repository to be reverted when they change on disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mode only does something after you have used a Magit command. If you run a Git command in bash or eshell then &lt;a href=&quot;https://github.com/magit/magit/blob/c29b17d28b8eab5051012b9894ab191a43d563be/magit.el#L1095&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;magit-auto-revert-mode&lt;/code&gt;&lt;/a&gt; does not kick in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However that mode is just a specialized variant of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;global-auto-revert-mode&lt;/code&gt;&lt;/a&gt;. The latter works regardless of what causes a file to change on disk.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-10-10T01:28:12.673" LastActivityDate="2014-10-10T01:28:12.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1002" PostTypeId="2" ParentId="984" CreationDate="2014-10-10T01:49:39.633" Score="2" Body="&lt;p&gt;After going around, I found that david holm (&lt;a href=&quot;https://github.com/dholm/tabbar&quot; rel=&quot;nofollow&quot;&gt;https://github.com/dholm/tabbar&lt;/a&gt;) version is the latest and also both el-get and Melpa are pointing to this repository. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I suggest using that version. I just installed with &lt;code&gt;el-get&lt;/code&gt; with out a problem. Though I seems to have different behavior than I expected (bug?).&lt;/p&gt;&#xA;" OwnerUserId="224" LastActivityDate="2014-10-10T01:49:39.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1003" PostTypeId="2" ParentId="990" CreationDate="2014-10-10T02:06:03.760" Score="2" Body="&lt;p&gt;You are apparently &lt;em&gt;not&lt;/em&gt; asking about &lt;em&gt;defining&lt;/em&gt; a major-mode keymap but about &lt;em&gt;user&lt;/em&gt; code to add or change a few keybindings in an &lt;em&gt;existing&lt;/em&gt; major-mode keymap. You say &quot;custom&quot;, which suggests this, but we might as well make it clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be sure, what you say you see most commonly for this is &lt;em&gt;not&lt;/em&gt; what is used generally to &lt;em&gt;define&lt;/em&gt; a major-mode keymap.  It is &lt;em&gt;not&lt;/em&gt; what you find in the Emacs source code, for instance.  And it is &lt;em&gt;not&lt;/em&gt; what is recommended in the Elisp manual (node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Major-Mode-Conventions.html#Major-Mode-Conventions&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Major Mode Conventions&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wanted to get that out of the way, to be clear for others: you generally do not want to use the mode hook to define the major-mode map.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To your question about user key customizations - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case it is not &lt;code&gt;local-set-key&lt;/code&gt; that you should use in a mode hook. Just use &lt;code&gt;define-key&lt;/code&gt; with the major-mode keymap, exactly as in your first example.  @tarsius has already explained this well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than that, the answer is: it makes little difference, &lt;em&gt;in general&lt;/em&gt;, whether you bind the keys (using &lt;code&gt;define-key&lt;/code&gt; with the mode map) once and for all or you use the hook to bind them each time you enter the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it can make a difference if bindings in the map change - for example, by your loading some other code that changes them.  In that case, putting bindings on the major-mode hook ensures that when the mode is entered the bindings will be established.  That is, it ensures that they will be made, but it does not ensure that nothing else changes them afterward (e.g. another function on the same hook, invoked afterward).  Remember that you have little control over what gets run on a hook and when - unless, of course you are sure that only your own code messes with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is the only difference in effect, that I can think of.  For you to decide when you consider that difference to be an advantage of one or the other approach.  FWIW, looking at my own code, I don't think I ever bind keys on a mode hook.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-10T02:06:03.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1004" PostTypeId="2" ParentId="984" CreationDate="2014-10-10T03:38:17.287" Score="1" Body="&lt;p&gt;If you like tabs, have a look at &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsLispScreen&quot; rel=&quot;nofollow noreferrer&quot;&gt;elscreen&lt;/a&gt;. Here is &lt;a href=&quot;https://github.com/knu/elscreen&quot; rel=&quot;nofollow noreferrer&quot;&gt;Github link&lt;/a&gt;. I like it better than tabbar, once upone a time when I was still using tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a &lt;a href=&quot;https://i.stack.imgur.com/VqPMv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;random screenshot&lt;/a&gt; of Elscreen, taken from this &lt;a href=&quot;https://stackoverflow.com/questions/11613826/where-can-i-download-the-emacs-apel-package&quot;&gt;SO question&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-10T03:38:17.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1005" PostTypeId="2" ParentId="895" CreationDate="2014-10-10T03:56:59.337" Score="2" Body="&lt;p&gt;Here is small function that does what I was looking for; perhaps useful to someone else too. The function prompts for the directory and invokes the &lt;code&gt;ag&lt;/code&gt; &lt;code&gt;search-term&lt;/code&gt;. When invoked with the prefix argument the &lt;code&gt;search-term&lt;/code&gt; is interpreted as regular expression.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun find-ag (dir search-term)&#xA;  &quot;Run an ag search with SEARCH-TERM in the directory.&#xA;&#xA;With an optional prefix argument ARG SEARCH-TERM is interpreted as a&#xA;regular expression.&quot;&#xA;  (interactive &quot;DFind-ag (directory): \nsFind-ag (ag expression): &quot;)&#xA;  (if (fboundp 'ag-regexp)&#xA;      (let ((ag-command (if current-prefix-arg 'ag-regexp 'ag))&#xA;            ;; reset the prefix arg, otherwise it will affect the ag-command&#xA;            (current-prefix-arg nil))&#xA;        (funcall ag-command search-term dir))&#xA;    (error &quot;Ag is not available&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="679" LastActivityDate="2014-10-10T03:56:59.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1006" PostTypeId="2" ParentId="964" CreationDate="2014-10-10T04:43:08.387" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Key_Completion&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt; key completion&lt;/a&gt; - &lt;code&gt;S-TAB&lt;/code&gt; - shows you all key sequences currently available for use (i.e., bound, not free), including after you hit a prefix key.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;C-x r S-TAB&lt;/code&gt; shows key sequences with the prefix &lt;code&gt;C-x r&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keys that are not listed are unbound (free).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can sort the displayed key sequences in different ways, using &lt;code&gt;C-,&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-08-21T03:30:50.163" LastActivityDate="2017-08-21T03:30:50.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1007" PostTypeId="2" ParentId="843" CreationDate="2014-10-10T07:58:32.210" Score="6" Body="&lt;p&gt;irony-mode's author here.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So, For tiny projects that I might be working on, which are compiled&#xA;  with a simple &lt;code&gt;g++ foo.c -o foo&lt;/code&gt;, how should I put the compile files to&#xA;  make irony-mode work?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you don't have any flags you don't have to do anything. You give irony-mode some flags only so that it can parse your file. In your case, no flags are needed to parse the buffer.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And what about larger projects that uses CMake, SCons and others! How&#xA;  do I get those compilations flags for projects that make use of these&#xA;  piece of software to build themselves?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Please check out the &lt;a href=&quot;https://github.com/Sarcasm/irony-mode/#compilation-database&quot; rel=&quot;nofollow noreferrer&quot;&gt;compilation database documentation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now irony-mode asks you to create a &lt;code&gt;.clang_complete&lt;/code&gt; file. This file should contain the compilation flags, one flag per line and it should be placed in the directory of your file or a parent directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also support for the &lt;a href=&quot;http://clang.llvm.org/docs/JSONCompilationDatabase.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;JSON Compilation Database&lt;/a&gt; format. The CMake and Ninja build systems are supported for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a build system, such as SCons, does not support generating a JSON Compilation Database, there are a few tools capable of producing a &lt;code&gt;compile_commands.json&lt;/code&gt; by watching the build.&#xA;For example &lt;code&gt;intercept-build&lt;/code&gt; from &lt;a href=&quot;https://github.com/rizsotto/scan-build&quot; rel=&quot;nofollow noreferrer&quot;&gt;scan-build&lt;/a&gt; or the &lt;a href=&quot;https://github.com/rizsotto/Bear&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bear&lt;/a&gt; tool.&lt;/p&gt;&#xA;" OwnerUserId="901" LastEditorUserId="901" LastEditDate="2016-11-07T19:03:41.633" LastActivityDate="2016-11-07T19:03:41.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1008" PostTypeId="1" AcceptedAnswerId="1009" CreationDate="2014-10-10T08:26:11.443" Score="5" ViewCount="219" Body="&lt;p&gt;When editing text, editors' usual behaviour is to replace selected text with the next text.  In Emacs, when text is selected and you enter new characters, the new text gets inserted at point, leaving the current selection intact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to get Emacs to delete selected text when typing new characters?&lt;/p&gt;&#xA;" OwnerUserId="724" LastEditorUserId="105" LastEditDate="2016-09-21T19:48:09.000" LastActivityDate="2016-09-21T19:48:09.000" Title="How to make sure currently selected text gets deleted when typing new text?" Tags="|text-editing|region|delete-selection-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1009" PostTypeId="2" ParentId="1008" CreationDate="2014-10-10T08:29:33.003" Score="8" Body="&lt;p&gt;Just add this line in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(delete-selection-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="716" LastActivityDate="2014-10-10T08:29:33.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1010" PostTypeId="2" ParentId="801" CreationDate="2014-10-10T08:48:03.443" Score="50" Body="&lt;p&gt;Disclaimer: I'm the author of irony-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LlW93.png&quot; alt=&quot;company-irony screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want smart auto-completion, I can recommend &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot;&gt;irony-mode&lt;/a&gt; with &lt;a href=&quot;https://github.com/Sarcasm/company-irony&quot;&gt;company-irony&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;irony-mode is &lt;strong&gt;easy to install&lt;/strong&gt; thanks to &lt;a href=&quot;http://melpa.milkbox.net/&quot;&gt;MELPA&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;the &lt;strong&gt;completion is very accurate&lt;/strong&gt; and the &lt;strong&gt;performance quite decent&lt;/strong&gt; thanks to &lt;a href=&quot;http://clang.llvm.org/docs/Tooling.html#libclang&quot;&gt;libclang&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;with company-irony you have an &lt;strong&gt;asynchronous completion&lt;/strong&gt; backend that will not get in your way if the completion takes some time&lt;/li&gt;&#xA;&lt;li&gt;company-irony &lt;strong&gt;supports overloaded functions&lt;/strong&gt; and if you have Yasnippet installed the function arguments are inserted as placeholders to fill-in&lt;/li&gt;&#xA;&lt;li&gt;if your project uses Doxygen, the &lt;strong&gt;brief documentation&lt;/strong&gt; of the completion candidate is displayed in the minibuffer (see screenshot)&lt;/li&gt;&#xA;&lt;li&gt;the installation of irony-mode server on a Unix-like system (Linux, OS X) should be easy. Windows on the other hand requires a bit of tweaking but it is documented in the wiki&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another tool that hasn't been cited yet is &lt;a href=&quot;https://github.com/abingham/emacs-ycmd&quot;&gt;emacs-ycmd&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="901" LastActivityDate="2014-10-10T08:48:03.443" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="1011" PostTypeId="1" AcceptedAnswerId="1012" CreationDate="2014-10-10T08:52:40.980" Score="7" ViewCount="2131" Body="&lt;p&gt;Is there a way of creating table for existing data using org-mode ?&#xA;Let's assume I have the following data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;row1&#xA;row2&#xA;row3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And now I want to create a table of dimension 1x3 (col*row) on it.&#xA;The resulting output should be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| row1 |&#xA;|------|&#xA;| row2 |&#xA;| row3 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or even a variation of the above output should be ok.&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2014-10-10T08:56:15.290" Title="Create table for existing data using org-mode" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1012" PostTypeId="2" ParentId="1011" CreationDate="2014-10-10T08:56:15.290" Score="14" Body="&lt;p&gt;Select your data and type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c |    (org-table-create-or-convert-from-region)&#xA;C-c -    (org-table-insert-hline)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="716" LastActivityDate="2014-10-10T08:56:15.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1013" PostTypeId="2" ParentId="991" CreationDate="2014-10-10T09:42:09.270" Score="10" Body="&lt;p&gt;If I read your question correctly, you are mainly interested in operating on buffers displayed in other windows quickly (while preserving the current window layout).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing the window that &lt;code&gt;other-window&lt;/code&gt; points to is one way of achieving that, but I'd like to suggest an alternative workflow:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike &lt;code&gt;other-window&lt;/code&gt;, &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ace-window&lt;/code&gt;&lt;/a&gt; allows you to quickly jump to a &lt;em&gt;specific window&lt;/em&gt;: When you call &lt;code&gt;ace-window&lt;/code&gt;, it shows a unique number in each window. To jump to a specific window, you simply type the corresponding number. If you only have two windows, it puts point in the other window without asking you to type a number. This screencast demonstrates switching to another window, scrolling it, and switching back to the original window:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YtU5S.gif&quot; alt=&quot;Demonstration of ace-window&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you bind &lt;code&gt;ace-window&lt;/code&gt; to &lt;code&gt;C-x o&lt;/code&gt;, you don't have to memorize an additional key binding, and it will feel like you are using a supercharged version of &lt;code&gt;other-window&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you touch-type and/or prefer not to move your fingers too far away from the home row, you can instruct &lt;code&gt;ace-window&lt;/code&gt; to &quot;number&quot; windows using letters instead of numbers (see below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ace-window&lt;/code&gt; is available in &lt;a href=&quot;http://melpa.milkbox.net/&quot; rel=&quot;noreferrer&quot;&gt;MELPA&lt;/a&gt;. After installing it via &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;package-install&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;ace-window&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, you can put the following in your init-file to set it up as described above:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x o&quot;) 'ace-window)&#xA;(setq aw-keys '(?a ?b ?c ?d ?e ?f ?g ?h ?i))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-30T20:36:42.087" LastActivityDate="2015-01-30T20:36:42.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1014" PostTypeId="1" CreationDate="2014-10-10T10:24:31.367" Score="7" ViewCount="1594" Body="&lt;p&gt;Both &lt;a href=&quot;https://github.com/capitaomorte/autopair&quot;&gt;&lt;code&gt;autopair&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt; provide functionality for inserting matching pairs of delimiters automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do they differ from each other in practice (if at all)? What are some use cases that are covered by one of these packages but not by the other?&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2014-10-10T17:30:19.673" Title="What are the differences between autopair and smartparens?" Tags="|smartparens|balanced-parentheses|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1015" PostTypeId="2" ParentId="984" CreationDate="2014-10-10T10:34:00.273" Score="1" Body="&lt;p&gt;The “official” tabbar package is maintained as part of &lt;a href=&quot;http://aquamacs.org/&quot; rel=&quot;nofollow&quot;&gt;Aquamacs&lt;/a&gt; and is not available independently.   A standalone variant is kept at &lt;a href=&quot;https://github.com/dholm/tabbar/&quot; rel=&quot;nofollow&quot;&gt;https://github.com/dholm/tabbar/&lt;/a&gt; and occasionally, but infrequently updated from Aquamacs upstream.  It is not however &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/298#issuecomment-32679766&quot; rel=&quot;nofollow&quot;&gt;maintained independently&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you'd like to use tabbar in GNU Emacs, this is your best bet currently.  Generally you can safely follow whatever MELPA currently considers the best source, even if you don't actually install from MELPA, since both the MELPA maintainers and independent package maintainers typically do a very good job at keeping MELPA up to date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, be aware that there is no official and maintained GNU Emacs package of tabbar, so you may sooner or later experience breakage and issues.  Also, tabbar is not a particularly good fit for the classic GNU Emacs user interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, if you like tabbars, then use Aquamacs.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="304" LastEditDate="2014-10-10T12:41:53.940" LastActivityDate="2014-10-10T12:41:53.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1016" PostTypeId="2" ParentId="928" CreationDate="2014-10-10T10:35:31.887" Score="0" Body="&lt;p&gt;You can define a wrapper macro for &lt;code&gt;define-derived-mode&lt;/code&gt; that evaluates its arguments.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro define-derived-mode* (child parent name &amp;amp;optional docstring &amp;amp;rest body)&#xA;  (macroexpand `(define-derived-mode ,(eval child) ,(eval parent) ,(eval name)&#xA;                                     ,(eval docstring) . ,body)))&#xA;(define-derived-mode* 'toy-mode&#xA;  (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode)&#xA;  &quot;Toy&quot;&#xA;  &quot;Major mode for my favorite toy language&quot;&#xA;  (toy-mode-setup))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Warning: only minimally tested.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-10T10:35:31.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1017" PostTypeId="1" AcceptedAnswerId="3053" CreationDate="2014-10-10T11:41:45.127" Score="15" ViewCount="742" Body="&lt;p&gt;I'm looking into doing the following: I have a program written in Common Lisp, which I want to be able to communicate with Emacs. The program deals with natural language parsing, so the things I'd need to access in Emacs would be the contents of the buffer and some minimal preliminary parsing required to create messages to send to the Common Lisp program. The Common Lisp program will then process the messages and reply to the Emacs Lisp program, so that it will display the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that SLIME would be a good tool to use to achieve this, mainly because it already does most of it, but looking into documentation I find that it's a &quot;user documentation&quot; kind, not a &quot;developer documentation&quot;. Essentially, I would like to know what is the minimum that I could use on the Emacs Lisp side to get the communication going (I certainly don't need the introspection, or REPL in this case, all I need is to send messages to and from my program running in SWANK).&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-11-03T22:31:55.967" Title="How to use SLIME as a proxy between Common Lisp program and Emacs Lisp?" Tags="|slime|common-lisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1019" PostTypeId="2" ParentId="904" CreationDate="2014-10-10T12:41:08.830" Score="2" Body="&lt;p&gt;You could do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook&#xA;          (lambda ()&#xA;            (when (not (eq (key-binding (kbd &quot;n&quot;) t)&#xA;                           'org-self-insert-command))&#xA;              (message &quot;Command %s rebound the key!&quot; this-command)))&#xA;          nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will add the lambda function buffer-locally to be run after every command, so you can just kill the buffer to get rid of the behavior. If after a command &lt;code&gt;(kbd &quot;n&quot;)&lt;/code&gt; is not &lt;code&gt;org-self-insert-command&lt;/code&gt; anymore, it will tell you which command did that.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-10-10T12:41:08.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1020" PostTypeId="1" AcceptedAnswerId="1056" CreationDate="2014-10-10T12:58:30.293" Score="41" ViewCount="17516" Body="&lt;p&gt;I have the following line in &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [(control \;)] 'comment-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works very well in GUI window, but if &lt;code&gt;emacs&lt;/code&gt; is invoked with the &lt;code&gt;-nw&lt;/code&gt; option then &lt;kbd&gt;C-;&lt;/kbd&gt; doesn't comment region, only inserts &lt;code&gt;;&lt;/code&gt; character. &lt;kbd&gt;M-x comment-region RET&lt;/kbd&gt; works fine however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried follow &lt;a href=&quot;https://emacs.stackexchange.com/a/989/871&quot;&gt;this answer&lt;/a&gt; on similar problem, but &lt;kbd&gt;C-q C-;&lt;/kbd&gt; returns just &lt;code&gt;;&lt;/code&gt; and I obviously don't want to bind bare &lt;code&gt;;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to achieve desired effect?&lt;/p&gt;&#xA;" OwnerUserId="871" LastEditorUserId="25" LastEditDate="2023-01-22T11:27:13.903" LastActivityDate="2023-01-22T11:27:13.903" Title="Problems with keybindings when using terminal" Tags="|key-bindings|terminal-emacs|" AnswerCount="6" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1021" PostTypeId="1" AcceptedAnswerId="1023" CreationDate="2014-10-10T13:10:46.710" Score="2" ViewCount="2679" Body="&lt;p&gt;At some moment in time, auto-complete just stopped working for me. I added this code in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-auto-complete-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get this error when starting Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: global-auto-complete-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can enable auto-complete on a per buffer basis, so I know it's installed and working. But I want it to be enabled globally by default.&lt;/p&gt;&#xA;" OwnerUserId="195" LastEditorUserId="50" LastEditDate="2014-11-16T13:17:51.290" LastActivityDate="2014-11-16T13:17:51.290" Title="How do I enable auto-complete globally on my init file?" Tags="|auto-complete-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1022" PostTypeId="2" ParentId="1014" CreationDate="2014-10-10T13:12:13.013" Score="2" Body="&lt;p&gt;One basic difference is that &lt;code&gt;smartparens&lt;/code&gt; can match escaped pairs and non-punctuation mark, like &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;fi&lt;/code&gt;; you can also customize your pairs. &lt;code&gt;smartparens&lt;/code&gt; is really great when working regex where there are lots of escaped pairs like &lt;code&gt;\(...\)&lt;/code&gt;, since it has its own &lt;strong&gt;highlighting&lt;/strong&gt; for such pairs, making working with &lt;code&gt;sed&lt;/code&gt;, &lt;code&gt;awk&lt;/code&gt;... much more pleasant.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="50" LastEditDate="2014-10-10T17:30:19.673" LastActivityDate="2014-10-10T17:30:19.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1023" PostTypeId="2" ParentId="1021" CreationDate="2014-10-10T13:21:29.023" Score="5" Body="&lt;p&gt;If the function isn't defined at startup, that probably means the file containing the function hasn't been loaded yet. The function &lt;code&gt;global-auto-complete-mode&lt;/code&gt; is in the file &lt;code&gt;auto-complete.el&lt;/code&gt;, which you can see with &lt;code&gt;C-h f&lt;/code&gt;, so the first thing to try is to execute&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before calling the function.&lt;/p&gt;&#xA;" OwnerUserId="875" LastActivityDate="2014-10-10T13:21:29.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1024" PostTypeId="1" AcceptedAnswerId="1034" CreationDate="2014-10-10T13:44:21.613" Score="5" ViewCount="735" Body="&lt;p&gt;I'm trying to define a prefix keymap for a minor mode, but I'm getting a result I've not seen yet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`link-grammar-mode' Minor Mode Bindings:&#xA;key             binding&#xA;---             -------&#xA;&#xA;&amp;lt;C-.&amp;gt;           link-grammar-prefix-map&#xA;&#xA;&amp;lt;C-.&amp;gt; &amp;lt;p&amp;gt;       link-grammar-parse-paragraph&#xA;&amp;lt;C-.&amp;gt; &amp;lt;r&amp;gt;       link-grammar-parse-region&#xA;&amp;lt;C-.&amp;gt; &amp;lt;s&amp;gt;       link-grammar-parse-sentence&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's how I've defined it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'link-grammar-prefix-map)&#xA;&#xA;(define-key link-grammar-prefix-map [s] 'link-grammar-parse-sentence)&#xA;(define-key link-grammar-prefix-map [p] 'link-grammar-parse-paragraph)&#xA;(define-key link-grammar-prefix-map [r] 'link-grammar-parse-region)&#xA;&#xA;(define-minor-mode link-grammar-mode&#xA;  &quot;Enables display of the parse of the natural language text&#xA;produced by link-grammar parser library&quot;&#xA;  :initial-value nil&#xA;  :lighter &quot; LG&quot;&#xA;  :keymap '(([C-.] . link-grammar-prefix-map))&#xA;  :group 'link-grammar&#xA;  (run-hooks link-grammar-hooks)&#xA;  (message &quot;link-grammar minor mode activated&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could please anyone explain what happened? I can see the map added to &lt;code&gt;minor-mode-map-alist&lt;/code&gt;, but the keys aren't &quot;activated&quot;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-10-10T22:45:02.963" Title="What does &quot;less-than&quot; key &quot;greater-than&quot; mean in terms of keybindings?" Tags="|keymap|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1025" PostTypeId="1" AcceptedAnswerId="1026" CreationDate="2014-10-10T13:52:13.133" Score="6" ViewCount="1136" Body="&lt;p&gt;With &lt;code&gt;M-x replace-regexp&lt;/code&gt;, I found that both  &lt;code&gt;\([[:digit:]]+\)&lt;/code&gt; and &lt;code&gt;([[:digit:]]+)&lt;/code&gt; will match &lt;code&gt;(123)&lt;/code&gt;, and not one without parentheses, But the first will replace &lt;code&gt;123&lt;/code&gt; and the second &lt;code&gt;(123)&lt;/code&gt;. I wonder why the difference?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="25" LastEditDate="2014-10-10T15:35:07.363" LastActivityDate="2014-10-10T15:35:07.363" Title="Regexp replacement: difference between \([[:digit:]]+\) and ([[:digit:]]+)" Tags="|replace|regular-expressions|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1026" PostTypeId="2" ParentId="1025" CreationDate="2014-10-10T14:01:14.327" Score="11" Body="&lt;p&gt;In emacs regular expressions (unlike most regexp engines), &lt;code&gt;\(&lt;/code&gt; and &lt;code&gt;\)&lt;/code&gt; are group delimiters, while &lt;code&gt;(&lt;/code&gt; and &lt;code&gt;)&lt;/code&gt; match litteral brackets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;code&gt;\([[:digit:]]+\)&lt;/code&gt; matches one digit or more, that is here &lt;code&gt;123&lt;/code&gt;, and makes it a group. That means that for example, &lt;code&gt;\([[:digit:]]+\)?&lt;/code&gt; would match either &lt;code&gt;123&lt;/code&gt; or some empty string, and that you can use &lt;code&gt;\1&lt;/code&gt; (assuming it is your only group) for &lt;code&gt;123&lt;/code&gt; in the replacement text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, &lt;code&gt;([[:digit:]]+)&lt;/code&gt; matches an opening bracket, one digit or more, then a closing bracket, so it will match &lt;code&gt;(123)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RBssy.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/X45o0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2014-10-10T14:01:14.327" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1027" PostTypeId="1" AcceptedAnswerId="1039" CreationDate="2014-10-10T14:06:25.580" Score="7" ViewCount="1039" Body="&lt;p&gt;I'm looking for either some built-in setting or a &lt;em&gt;simple&lt;/em&gt; mode for viewing and editing tab-separated columns (TSV files).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I need is for the TSV text to be displayed in a way that respects the vertical alignment of the columns, and the horizontal alignment of the rows.  If line-wrapping could be toggled that would be sweet, but secondary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching for column viewing in emacs is made difficult by the fact that the word &quot;column&quot; already has a different meaning in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I specified &quot;&lt;em&gt;simple&lt;/em&gt;&quot; to discourage answers like org-mode's column view.  At the moment my needs are extremely simple, and I don't want to contend with installing, loading, and learning about a monster mode like org.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2021-12-22T12:53:18.263" Title="Setting (or *simple* mode) for editing tab-separated columns" Tags="|table|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1028" PostTypeId="1" AcceptedAnswerId="1029" CreationDate="2014-10-10T14:27:52.303" Score="14" ViewCount="3880" Body="&lt;p&gt;Helm seem to support marking files in &lt;code&gt;helm-find-files&lt;/code&gt;. Is it possible to open the marked files, each one inside of its own buffer from within the find file buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I noticed that I was using &lt;code&gt;helm-projectile-switch-project&lt;/code&gt; rather than the Helm enhanced &lt;code&gt;find-file&lt;/code&gt; command.&lt;/p&gt;&#xA;" OwnerDisplayName="user66" LastEditorDisplayName="user66" LastEditDate="2014-10-10T16:03:51.283" LastActivityDate="2019-12-03T10:45:43.553" Title="Mark and open multiple files with Helm and Projectile" Tags="|helm|projectile|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1029" PostTypeId="2" ParentId="1028" CreationDate="2014-10-10T14:30:18.457" Score="17" Body="&lt;p&gt;Yes, use &lt;code&gt;C-SPC&lt;/code&gt; to mark each file individually or mark all with &lt;code&gt;M-a&lt;/code&gt;, then press &lt;code&gt;RET&lt;/code&gt; to open all those files. I wrote a &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot;&gt;Helm guide here&lt;/a&gt; that covers Helm basics and most of default commands. Also check my &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot;&gt;helm-projectile&lt;/a&gt;. It has the multifile opening right at the beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from the answer above, the question was updated with the question to open multiple files using &lt;code&gt;helm-projectile-switch-project&lt;/code&gt;. To use &lt;code&gt;helm-projectile-switch-project&lt;/code&gt; to switch to another project and open multiple files, either &lt;code&gt;helm-projectile&lt;/code&gt; or &lt;code&gt;helm-projectile-find-file&lt;/code&gt; must be set to &lt;code&gt;projectile-switch-project-action&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-completion-system 'helm&#xA;      projectile-switch-project-action 'helm-projectile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that, you can open files in any project (including current projejct) without ever leaving your current working project. This is also explained in &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html#sec-5&quot;&gt;Enter project portal: helm-projectile-switch-project, C-c p p&lt;/a&gt; in my guide.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-10-10T16:31:10.937" LastActivityDate="2014-10-10T16:31:10.937" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1030" PostTypeId="1" CreationDate="2014-10-10T14:31:10.293" Score="19" ViewCount="5919" Body="&lt;p&gt;I have this line in my init.el file to set the size of the font in all frames:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(font . &quot;DejaVu Sans Mono-10&quot;) default-frame-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works but i'd like to have a bigger font in all buffers while keeping a smaller one for the mode line (so it could fit more information and be less distracting). The idea is to have this set automatically without having to change the font size with C-x C-+ for every open buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 25.0.50.1 compiled from trunk on a GNU/Linux system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: just added an answer showing how it can be done.&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="920" LastEditDate="2014-10-11T13:25:10.117" LastActivityDate="2015-01-29T21:16:11.243" Title="How can I set different font sizes for buffers and for the mode-line?" Tags="|buffers|mode-line|fonts|faces|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1031" PostTypeId="1" AcceptedAnswerId="1033" CreationDate="2014-10-10T14:38:24.993" Score="3" ViewCount="1219" Body="&lt;p&gt;I am trying to implement the &lt;a href=&quot;https://emacs.stackexchange.com/a/385/115&quot;&gt;auto-indentation snippet&lt;/a&gt; posted by @Malabarba in one of the emacs SE questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that post, below is the function that I am trying to add to the &lt;code&gt;post-command-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(require 'cl-lib)&#xA;(defun endless/indent-defun ()&#xA;  &quot;Indent current defun.&#xA;Do nothing if mark is active (to avoid deactivaing it), or if&#xA;buffer is not modified (to avoid creating accidental&#xA;modifications).&quot;&#xA;  (interactive)&#xA;  (unless (or (region-active-p)&#xA;              buffer-read-only&#xA;              (null (buffer-modified-p)))&#xA;    (let ((l (save-excursion (beginning-of-defun 1) (point)))&#xA;          (r (save-excursion (end-of-defun 1) (point))))&#xA;      (cl-letf (((symbol-function 'message) #'ignore))&#xA;        (indent-region l r)))))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But emacs is removing it from that hook as it seems to be causing some error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I call the function using &lt;kbd&gt;M-x&lt;/kbd&gt;, it runs fine and doesn't throw any error; it just doesn't run when executed via the &lt;code&gt;post-command-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question: How can I find what's causing the removal of that function from the hook?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the following code to add that function to the hook only for elisp mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun endless/activate-aggressive-indent ()&#xA;   &quot;Locally add `endless/indent-defun' to `post-command-hook'.&quot;&#xA;   (add-hook 'post-command-hook&#xA;             #'endless/indent-defun nil 'local))&#xA;&#xA; (add-hook 'emacs-lisp-mode-hook&#xA;           #'endless/activate-aggressive-indent)&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2018-04-15T15:17:11.470" LastActivityDate="2018-04-15T15:17:11.470" Title="Debug why a function is removed from post-command-hook" Tags="|hooks|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1032" PostTypeId="2" ParentId="1030" CreationDate="2014-10-10T14:44:44.267" Score="21" Body="&lt;p&gt;Try replacing the code for setting the font size with this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'default nil :font &quot;DejaVu Sans Mono-14&quot;)&#xA;(set-face-attribute 'mode-line nil :font &quot;DejaVu Sans Mono-10&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, you'll want to change the sizes (&lt;code&gt;14&lt;/code&gt; and &lt;code&gt;10&lt;/code&gt;) to values of your liking.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to customize a specific face and don't know the name of it, try doing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;list-faces-display&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will give you a list of all faces (with previews) that you can search for specific keywords.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-29T21:16:11.243" LastActivityDate="2015-01-29T21:16:11.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1033" PostTypeId="2" ParentId="1031" CreationDate="2014-10-10T15:02:52.180" Score="4" Body="&lt;p&gt;Hooks are intentionally removed from &lt;code&gt;post-command-hook&lt;/code&gt; because otherwise a bad hook could lead to a condition where it becomes impossible to do anything, including figuring out what is going wrong, because the errors happens when ever the user does anything what-so-ever...&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-10-10T15:27:47.470" LastActivityDate="2014-10-10T15:27:47.470" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1034" PostTypeId="2" ParentId="1024" CreationDate="2014-10-10T15:10:48.940" Score="4" Body="&lt;p&gt;Some events understood by Emacs are characters which in turn are just integers. So a key which is an integer can be greater or smaller than another such key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there are events which are represented using symbols, e.g. &lt;code&gt;return&lt;/code&gt;. Functions that take events as arguments accept different representations for these events. For &lt;code&gt;return&lt;/code&gt; one can use &lt;code&gt;&quot;&amp;lt;return&amp;gt;&quot;&lt;/code&gt; or &lt;code&gt;[return]&lt;/code&gt;. However the vector representation is &lt;em&gt;only&lt;/em&gt; intended for &quot;symbol events&quot;, you can not use it for character events. So &lt;code&gt;[s]&lt;/code&gt; is wrong, there is no such event; instead use &lt;code&gt;[?s]&lt;/code&gt; or &lt;code&gt;&quot;s&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="25" LastEditDate="2014-10-10T22:45:02.963" LastActivityDate="2014-10-10T22:45:02.963" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1035" PostTypeId="1" CreationDate="2014-10-10T15:12:39.367" Score="5" ViewCount="1211" Body="&lt;p&gt;The variable &lt;code&gt;org-clock-modeline-total&lt;/code&gt; gives me several options for what time to show in the modeline, but they limited to time clocked into the current task. I would like to show the total time clock into all tasks in a particular subtree. Is that possible?&lt;/p&gt;&#xA;" OwnerUserId="925" LastEditorUserId="813" LastEditDate="2014-10-10T15:27:00.403" LastActivityDate="2014-10-13T22:48:28.180" Title="How can I see total time today on _all projects_ in the modeline?" Tags="|org-mode|mode-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1036" PostTypeId="2" ParentId="1031" CreationDate="2014-10-10T15:37:53.500" Score="4" Body="&lt;p&gt;Don't just make the function on &lt;code&gt;post-command-hook&lt;/code&gt; ignore errors. Instead, you can debug it to find out what the error is, and fix that.  To do that, you cannot use &lt;code&gt;M-x debug-on-error&lt;/code&gt;, as using the debugger is (rightfully) disabled during &lt;code&gt;post-command-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do is old-school debugging: Add calls to &lt;code&gt;message&lt;/code&gt; to the function at various points, printing relevant info, to let you know just what is going on. Simple to do, and generally quick to debug. Open buffer &lt;code&gt;*Messages*&lt;/code&gt; in a separate frame, and put point at the end of it, so you can see what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have handy a &lt;code&gt;remove-hook&lt;/code&gt; sexp or a sexp to restore the un-&lt;code&gt;message&lt;/code&gt;d version of the function (e.g. in the secondary selection or a register), so you can quickly restore things if they get out of hand. ;-)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-10T15:37:53.500" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1037" PostTypeId="2" ParentId="991" CreationDate="2014-10-10T15:44:39.300" Score="2" Body="&lt;p&gt;There is no easy way to manipulate the window list, so the result returned by &lt;code&gt;other-window&lt;/code&gt; is more or less fixed. This is not a bad thing per se, as it allows for consistency when navigating windows. Regarding the two scenarios you described, with some elisp or macros you can suit your workflow.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;if editing in window 4 in above picture, is there an easy way to set C-M-v to scroll the window 1?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can use a simple snippet like the one below to use &lt;code&gt;other-window&lt;/code&gt; the appropriate number of times, scroll down and move back to the original window.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun my-scroll-down-other-window (&amp;amp;optional arg)&#xA; &quot;Like `scroll-other-window' but takes a prefix argument &#xA; that indicates which window to scroll.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (save-selected-window&#xA;    (other-window arg)&#xA;    (scroll-down)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can pass a prefix argument to specify which window to scroll. As you can infer, it uses the inbuilt mechanism in &lt;code&gt;other-window&lt;/code&gt; to skip &lt;code&gt;arg&lt;/code&gt; number of windows before scrolling. The &lt;code&gt;save-selected-window&lt;/code&gt; ensures focus will return to the original window. The documentation of &lt;code&gt;other-window&lt;/code&gt; can provide more information on modifying this snippet to suit your behavior.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Or simply, suppose the the focus in on window 3 , how to set &lt;code&gt;other-window&lt;/code&gt; to point to window 2 ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again use a &lt;code&gt;prefix-arg&lt;/code&gt; as in &lt;code&gt;C-3 C-x o&lt;/code&gt; when calling &lt;code&gt;other-window&lt;/code&gt;. The actual number to provide will vary depending upon which order you split them, and will not change as long as you do not create new windows. Alternately, you can use convenience packages such as &lt;code&gt;window-number&lt;/code&gt; or &lt;code&gt;ace-window&lt;/code&gt; from MELPA to switch selected windows fast.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-10T15:44:39.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1038" PostTypeId="2" ParentId="1014" CreationDate="2014-10-10T16:04:44.223" Score="6" Body="&lt;p&gt;&lt;code&gt;smartparens&lt;/code&gt; has a superset of the functionality provided by &lt;code&gt;autopair&lt;/code&gt;. Apart from providing pair insertion (which is what &lt;code&gt;autopair&lt;/code&gt; does) , it supports manipulating what it calls &quot;hybrid sexps&quot; or sexps in non-lisp modes. It provides commands for navigating, marking, joining, splitting, absorbing and more for sexps among other things. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally use &lt;code&gt;smartparens&lt;/code&gt; and found that it provides some overlapping functionality with&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;yasnippet&lt;/code&gt; - ability to trigger pair insertion using a string&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;change-inner&lt;/code&gt; - select expression within matched pair&lt;/li&gt;&#xA;&lt;li&gt;and &lt;code&gt;paredit&lt;/code&gt; of course&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-10T16:04:44.223" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1039" PostTypeId="2" ParentId="1027" CreationDate="2014-10-10T16:15:37.210" Score="7" Body="&lt;p&gt;This should give you a chance to try out Org tables with virtually no learning curve. Place the following code in your init file and run it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-export-to-parent ()&#xA;  &quot;Exports the table in the current buffer back to its parent DSV file and&#xA;    then closes this buffer.&quot;&#xA;  (let ((buf (current-buffer)))&#xA;    (org-table-export parent-file export-func)&#xA;    (set-buffer-modified-p nil)&#xA;    (switch-to-buffer (find-file parent-file))&#xA;    (kill-buffer buf)))&#xA;&#xA;(defun my-edit-dsv-as-orgtbl (&amp;amp;optional arg)&#xA;  &quot;Convet the current DSV buffer into an org table in a separate file. Saving&#xA;    the table will convert it back to DSV and jump back to the original file&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((buf (current-buffer))&#xA;         (file (buffer-file-name buf))&#xA;         (txt (substring-no-properties (buffer-string)))&#xA;         (org-buf (find-file-noselect (concat (buffer-name) &quot;.org&quot;))))&#xA;    (save-buffer)&#xA;    (with-current-buffer org-buf&#xA;      (erase-buffer)&#xA;      (insert txt)&#xA;      (org-table-convert-region 1 (buffer-end 1) arg)&#xA;      (setq-local parent-file file)&#xA;      (cond &#xA;       ((equal arg '(4)) (setq-local export-func &quot;orgtbl-to-csv&quot;))&#xA;       ((equal arg '(16)) (setq-local export-func &quot;orgtbl-to-tsv&quot;))&#xA;       (t (setq-local export-func &quot;orgtbl-to-tsv&quot;)))&#xA;      (add-hook 'after-save-hook 'my-export-to-parent nil t))&#xA;    (switch-to-buffer org-buf)&#xA;    (kill-buffer buf)))&#xA;&#xA;;; Open the current TSV file as an Org table&#xA;(global-set-key (kbd &quot;C-c |&quot;) 'my-edit-dsv-as-orgtbl)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, from a TSV file you can press &lt;code&gt;C-c |&lt;/code&gt; and your table will be converted to an Org table. (With &lt;code&gt;C-u C-c |&lt;/code&gt; it will work for a CSV file too.) Once you are done editing the Org table, press &lt;code&gt;C-x C-s&lt;/code&gt; and the Org table will be converted back to TSV and saved back into the original file.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-10-10T18:49:11.973" LastActivityDate="2014-10-10T18:49:11.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1040" PostTypeId="2" ParentId="774" CreationDate="2014-10-10T16:53:52.633" Score="11" Body="&lt;p&gt;Inspired by &lt;a href=&quot;https://emacs.stackexchange.com/a/799/93&quot;&gt;Juancho's answer&lt;/a&gt;, I decided to use the header line to display the value of the current field.  While I was at it, I decided it would be nice to show the location of the field in the header as well:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SCMl0.png&quot; alt=&quot;Org table header in action&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code I used to achieve it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-trim-string (arg) &#xA;  &quot;Simple function for trimming the whitespace from the ends of&#xA; a string. Also removes any string properties such as font faces.&quot;&#xA;  (let ((str (substring-no-properties arg)))&#xA;    (when (string-match &quot;^[ \t]+&quot; str)&#xA;      (setq str (replace-match &quot;&quot; nil nil str)))&#xA;    (when (string-match &quot;[ \t]+$&quot; str)&#xA;      (setq str (replace-match &quot;&quot; nil nil str)))&#xA;    str))&#xA;&#xA;(defun my-org-table-location (&amp;amp;optional arg)&#xA;  &quot;Get the location of the current field in the table&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (when (eq 'org-mode major-mode)&#xA;    (org-table-get-specials)&#xA;    (let* ((row (org-table-current-dline))&#xA;           (col (org-table-current-column))&#xA;           (loc (if arg&#xA;                    (format &quot;%c%02d&quot; (+ 64 col) row)&#xA;                  (format &quot;@%d$%d&quot; row col))))&#xA;      (when (called-interactively-p 'any)&#xA;        (message &quot;Field Location: %s&quot; loc))&#xA;      loc)))&#xA;&#xA;(defun my-org-table-field (&amp;amp;optional arg)&#xA;  &quot;Get the value of the current field in the table&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (when (eq 'org-mode major-mode)&#xA;    (org-table-get-specials)&#xA;    (let* ((formula (org-table-current-field-formula))&#xA;           (value (my-trim-string (org-table-get-field)))&#xA;           (field (or (and arg formula) value)))&#xA;      (when (called-interactively-p 'any)&#xA;        (message &quot;Field Value: %s&quot; loc))&#xA;      field)))&#xA;&#xA;;; Define the format for the header line in Org mode&#xA;(setq my-org-table-header&#xA;      (list '(:eval (let ((loc (my-org-table-location))&#xA;                          (field (my-org-table-field)))&#xA;                      (format &quot; %s: %s&quot; loc field)))))&#xA;&#xA;(defun my-org-mode-setup ()&#xA;  &quot;Apply custom setup to org-mode buffers&quot;&#xA;  (setq-local header-line-format my-org-table-header))&#xA;(add-hook 'org-mode-hook 'my-org-mode-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It has withstood a few days of (minimal) testing, so I decided to go ahead and share it.  If anybody else ends up using this, please let me know if you encounter any problems with it.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-10-10T17:04:12.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1041" PostTypeId="2" ParentId="202" CreationDate="2014-10-10T17:38:07.753" Score="10" Body="&lt;p&gt;Do you have many Dired buffers because you &lt;em&gt;wanted&lt;/em&gt; them all at one point? IOW, did you &lt;em&gt;want&lt;/em&gt; to create each of them as separate buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, the solution is simple: &lt;strong&gt;tell Dired to reuse an existing Dired buffer&lt;/strong&gt; when you hit &lt;code&gt;RET&lt;/code&gt; a directory name to open it in Dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how to do that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Load library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired+)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Tell Dired to reuse Dired buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(diredp-toggle-find-file-reuse-dir 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The effect is that when you hit &lt;code&gt;RET&lt;/code&gt; (or click the mouse) on a directory in Dired, &lt;code&gt;find-alternate-file&lt;/code&gt; is used, so the original Dired buffer is replaced (deleted) by the new one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can toggle this behavior anytime, using &lt;code&gt;C-M-R&lt;/code&gt; (aka &lt;code&gt;C-M-S-r&lt;/code&gt;) in Dired.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-10-09T14:42:03.053" LastActivityDate="2018-10-09T14:42:03.053" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="1042" PostTypeId="2" ParentId="470" CreationDate="2014-10-10T17:39:37.733" Score="1" Body="&lt;p&gt;You should almost never use &lt;code&gt;make-keymap&lt;/code&gt;. As a rule of thumb, if you don't know whether to use &lt;code&gt;make-keymap&lt;/code&gt; or &lt;code&gt;make-sparse-keymap&lt;/code&gt; use the latter. Only use &lt;code&gt;make-keymap&lt;/code&gt; when the keymap is used to temporarily or permanently replace the default &lt;strong&gt;global&lt;/strong&gt; map.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also bindings should be established inside the &lt;code&gt;defvar&lt;/code&gt; form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-keys-minor-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map (kbd &quot;C-M-j&quot;) 'windmove-left)&#xA;    ...&#xA;    map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way reloading the library does not override user customizations done in some other file or temporarily, i.e. when using &lt;code&gt;eval-buffer&lt;/code&gt; to load some experimental changes the user has made. For personal code that doesn't matter much (provided you don't extend the map elsewhere) but it is still good practice to set the default value inside &lt;code&gt;defvar&lt;/code&gt;. (&lt;code&gt;defvar&lt;/code&gt; does never &lt;em&gt;change&lt;/em&gt; the value of a variable. It only sets the value if the symbol was previously undefined as a variable).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;wholenump&lt;/code&gt; error might be related to the use of &lt;code&gt;make-keymap&lt;/code&gt;, but until you help us to help you by providing a backtrace as requested by @Sigma, you likely won't get any help with that.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-10-10T19:11:33.470" LastActivityDate="2014-10-10T19:11:33.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1043" PostTypeId="1" AcceptedAnswerId="1046" CreationDate="2014-10-10T17:40:10.040" Score="1" ViewCount="290" Body="&lt;p&gt;I'm trying to install go-mode in emacs (&lt;a href=&quot;http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/&quot; rel=&quot;nofollow&quot;&gt;http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs/&lt;/a&gt;) but am having trouble and I'm not sure if the problem is with my .emacs file or with the go-mode el.  I've auto-generated go-mode-load.el as in &lt;a href=&quot;http://www.pastebucket.com/58212&quot; rel=&quot;nofollow&quot;&gt;http://www.pastebucket.com/58212&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then configured my .emacs file as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/Users/&amp;lt;username&amp;gt;/Misc/emacs/go-mode.el/&quot;)&#xA;(require 'go-mode-load)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I start emacs I get the following error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  expand-file-name(nil &quot;/SourceCache/emacs/emacs-92/emacs/lisp&quot;)&#xA;  update-file-autoloads(&quot;go-mode.el&quot;)&#xA;  (let ((generated-autoload-file buffer-file-name)) (update-file-autoloads &quot;go-mode.el&quot;))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;lt;2&amp;gt;&amp;gt; nil &quot;/Users/ygreif/Misc/emacs/go-mode.el/go-mode-load.el&quot; nil t)  ; Reading at buffer position 143&#xA;load-with-code-conversion(&quot;/Users/ygreif/Misc/emacs/go-mode.el/go-mode-load.el&quot;     &quot;/Users/ygreif/Misc/emacs/go-mode.el/go-mode-load.el&quot; nil t)&#xA;require(go-mode-load)&#xA;eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/Users/ygreif/.emacs&quot; nil t)  ; Reading at buffer position 88&#xA;load-with-code-conversion(&quot;/Users/ygreif/.emacs&quot; &quot;/Users/ygreif/.emacs&quot; t t)&#xA;load(&quot;~/.emacs&quot; t t)&#xA;[globbily-bluck]&#xA;command-line()&#xA;normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I interpet the --debug-init.  Is the problem in my .emacs file?&lt;/p&gt;&#xA;" OwnerUserId="928" LastEditorUserId="105" LastEditDate="2014-10-10T18:12:15.183" LastActivityDate="2014-10-10T18:12:15.183" Title="Interpret where error is from --debug-init when trying to require go-mode" Tags="|elisp|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1044" PostTypeId="2" ParentId="202" CreationDate="2014-10-10T17:50:09.907" Score="5" Body="&lt;p&gt;You can also use &lt;code&gt;helm-mini&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x helm-mini&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Type into the prompt: &lt;code&gt;*Di&lt;/code&gt; (partial word for &lt;code&gt;Dired&lt;/code&gt;, no need to enter more). As you type, the buffers are narrowed incrementally. Now, only &lt;code&gt;Dired&lt;/code&gt; buffer left. Press &lt;code&gt;M-a&lt;/code&gt; to mark all.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;TAB&lt;/code&gt; to switch to action menu and press &lt;code&gt;K&lt;/code&gt; to select action &lt;code&gt;Kill buffer(s)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;RET&lt;/code&gt; to execute the action.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The good thing with &lt;code&gt;helm-mini&lt;/code&gt; is that it can replace normal Emacs &lt;code&gt;C-x b&lt;/code&gt;, so you won't have to use two key bindings, one for switching buffer and one for an actual buffer manager. &lt;code&gt;helm-mini&lt;/code&gt; is all-in-one. Read more in &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-6&quot; rel=&quot;nofollow&quot;&gt;my helm-mini guide&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-mini&lt;/code&gt; can also fuzzy match buffer and allow to open multiple buffers by marking with &lt;code&gt;C-SPC&lt;/code&gt; or &lt;code&gt;M-a&lt;/code&gt; (stand for &lt;strong&gt;M&lt;/strong&gt;ark &lt;strong&gt;a&lt;/strong&gt;ll). You can also narrow to buffer contain certain string by appending &lt;code&gt;@&lt;/code&gt; before a pattern, for example, &lt;code&gt;@test&lt;/code&gt; means select only buffers contain the string &quot;test&quot;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-10T17:50:09.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1045" PostTypeId="1" AcceptedAnswerId="1047" CreationDate="2014-10-10T17:57:37.837" Score="10" ViewCount="8958" Body="&lt;p&gt;When I launch Emacs24 (in an Ubuntu machine) I get an error message in the init procedure. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/nivaca/.emacs':&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I launch it with &lt;code&gt;emacs --debug-init&lt;/code&gt; the debugger is not entered. How can I debug this problem?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="105" LastEditDate="2014-10-10T18:35:47.953" LastActivityDate="2022-04-28T05:56:35.777" Title="How to debug startup problem, if `--debug-init' has no effect" Tags="|debugging|init-file|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1046" PostTypeId="2" ParentId="1043" CreationDate="2014-10-10T18:03:19.777" Score="1" Body="&lt;p&gt;You can read the output topdown. The latest elisp that is being evaluated is the line just after the error, in this case &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  expand-file-name(nil &quot;/SourceCache/emacs/emacs-92/emacs/lisp&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A quick look at &lt;code&gt;expand-file-name&lt;/code&gt; documentation reveals that the first argument is mandatory and must be a string containing a filename. Here you are somehow calling it with &lt;code&gt;nil&lt;/code&gt; which is reflected in the error that says &lt;code&gt;nil&lt;/code&gt; is not a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took a quick look at &lt;code&gt;go-mode&lt;/code&gt; from MELPA which points to the same github repository as source and could &lt;strong&gt;not&lt;/strong&gt; find any file that provided &lt;code&gt;go-mode-load&lt;/code&gt; as a feature. The only relavent lisp file was &lt;code&gt;go-mode.el&lt;/code&gt; which can be loaded by &lt;code&gt;(require 'go-mode)&lt;/code&gt;. I strongly recommend installing from MELPA in this case.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-10T18:03:19.777" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1047" PostTypeId="2" ParentId="1045" CreationDate="2014-10-10T18:18:01.903" Score="12" Body="&lt;p&gt;You do not enter the debugger from &lt;code&gt;--debug-init&lt;/code&gt; in this case because the message is a &lt;strong&gt;warning&lt;/strong&gt;, not an error message.  IOW, in spite of the text in the warning message, which speaks of an &quot;&lt;em&gt;error&lt;/em&gt;&quot;, from Emacs's point of view, &lt;strong&gt;an error was not raised&lt;/strong&gt;. (Or at least not an error that is respected by &lt;code&gt;--debug-init&lt;/code&gt; -- see &lt;code&gt;user-error&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions for debugging:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Recursively bisect your init file, to narrow down where the problem is. Do this by commenting-out 1/2 of it, then 3/4 of it, then 7/8, etc.  You can use &lt;code&gt;comment-region&lt;/code&gt;, with and without a plain prefix arg (&lt;code&gt;C-u&lt;/code&gt;), to comment and uncomment regions of text.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add calls to &lt;code&gt;message&lt;/code&gt; in your init file, to print information to let you know where the error occurs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Use #1 especially if your init file is complex or it loads other libraries. #2 might suffice if your init file is simple and short.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-10T18:18:01.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1048" PostTypeId="2" ParentId="1045" CreationDate="2014-10-10T18:21:45.837" Score="1" Body="&lt;p&gt;Fixed it: there was a missing parenthesis in the &lt;code&gt;.emacs&lt;/code&gt; file. However, the strange thing is that &lt;code&gt;--debug-init&lt;/code&gt; couldn't spot it.&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2014-10-10T18:21:45.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1049" PostTypeId="2" ParentId="904" CreationDate="2014-10-10T18:30:10.673" Score="5" Body="&lt;p&gt;Use &lt;code&gt;defadvice&lt;/code&gt; to intercept &lt;code&gt;define-key&lt;/code&gt; and check for your desired key sequence.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice define-key (before define-key-check-n (keymap key def))&#xA;  (when (equal key &quot;n&quot;)&#xA;    (message &quot;`n' redefined&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You can change &lt;code&gt;(message ...)&lt;/code&gt; to &lt;code&gt;(debug)&lt;/code&gt; or something else that'll give you more information about where you are.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make the advice effective with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ad-activate 'define-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To discard the advice, first disable it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ad-disable-advice 'define-key 'before 'define-key-check-n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then &quot;reconfigure&quot; the function again&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ad-activate 'define-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="807" LastActivityDate="2014-10-10T18:30:10.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1050" PostTypeId="2" ParentId="202" CreationDate="2014-10-10T18:34:06.610" Score="1" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/cgi-bin/wiki/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;, then you can use &lt;strong&gt;&lt;code&gt;C-x k&lt;/code&gt;&lt;/strong&gt; to kill all Dired buffers -- or all buffers in any given mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After hitting &lt;code&gt;C-x k&lt;/code&gt;, use &lt;strong&gt;&lt;code&gt;C-x M +&lt;/code&gt;&lt;/strong&gt; to keep only the buffers with a certain mode. Hit &lt;code&gt;TAB&lt;/code&gt; to see the modes, and choose &lt;code&gt;dired-mode&lt;/code&gt;.  Then use &lt;strong&gt;&lt;code&gt;C-!&lt;/code&gt;&lt;/strong&gt; to kill &lt;em&gt;all&lt;/em&gt; of the buffers with that mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x k C-x M + dired-mode C-!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-10T18:34:06.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1051" PostTypeId="1" CreationDate="2014-10-10T18:36:25.907" Score="7" ViewCount="1879" Body="&lt;p&gt;I would like to be able to easily select a region of text from Emacs and then paste it into another app or browser - with all the extra fill-paragraph newlines removed so that the paragraph display in the other app can work properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;unfill-region&lt;/code&gt; function in the &lt;a href=&quot;https://github.com/purcell/unfill&quot;&gt;&lt;code&gt;unfill&lt;/code&gt; package&lt;/a&gt; seems fine for this, but further work is needed to automate this properly. Before I do that, does this already exist?&lt;/p&gt;&#xA;" OwnerUserId="62" LastEditorUserId="111" LastEditDate="2014-10-10T19:43:40.463" LastActivityDate="2019-04-14T16:55:44.180" Title="Copy region from emacs without newlines" Tags="|copy-paste|fill-paragraph|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1052" PostTypeId="2" ParentId="1051" CreationDate="2014-10-10T18:42:11.713" Score="3" Body="&lt;p&gt;If you only want to remove newlines, then use &lt;code&gt;replace-regexp-in-string&lt;/code&gt; on the result of &lt;code&gt;buffer-substring&lt;/code&gt; to remove them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to remove all extra (typically &quot;insignificant&quot;) whitespace, then try function &lt;code&gt;ni-buffer-substring-collapsed-visible&lt;/code&gt; from library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/narrow-indirect.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;narrow-indirect.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It returns the buffer content between two positions, but with &#xA;whitespace collapsed (extra whitespace removed, including newlines).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you also use library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/subr+.el&quot; rel=&quot;nofollow&quot;&gt;`subr+.el'&lt;/a&gt; then invisible text is also removed.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-10T18:42:11.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1053" PostTypeId="2" ParentId="41" CreationDate="2014-10-10T18:44:08.657" Score="3" Body="&lt;p&gt;You don't need an &lt;em&gt;advice&lt;/em&gt; to change settings of different frames running in the same emacs daemon. Just use the hook &lt;code&gt;after-make-frame-functions&lt;/code&gt; like so&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar my/ttheme 'tango-dark)&#xA;(defvar my/gtheme 'tango)&#xA;(defun my/frame-configuration (frame)&#xA;  &quot;configure the current frame depending on the frame type&quot;&#xA;  (with-selected-frame frame&#xA;    (if (display-graphic-p)&#xA;        (progn&#xA;          (message &quot;after-make-frame-functions hook: window system&quot;)&#xA;          (set-frame-size frame 115 60)&#xA;          ;; other settings for a graphical frame&#xA;          (load-theme my/gtheme t))&#xA;      (message &quot;after-make-frame-functions hook: text console&quot;)&#xA;      (load-theme my/ttheme t)&#xA;      (set-frame-parameter frame 'menu-bar-lines 0))))&#xA;&#xA;(add-hook 'after-make-frame-functions 'my/frame-configuration)&#xA;&#xA;;; normal start without daemon&#xA;(if (not (daemonp))&#xA;  (my/frame-configuration (selected-frame)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Defining it this way has the added bonus, that it set's the desired frame-configuration even if you don't start in daemon mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately &lt;code&gt;load-theme&lt;/code&gt; is not frame local and so the other frames get coloured too if you really use different themes for text and graphical frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Bonus information:&lt;/em&gt; configure your terminals with at least 256 colors to get the real feel of your selected theme. Use a setting like this in one of your shell startup files:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-shell prettyprint-override&quot;&gt;&lt;code&gt;TERM=xterm-256color&#xA;export TERM&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="934" LastEditorUserId="15477" LastEditDate="2017-06-17T13:22:42.947" LastActivityDate="2017-06-17T13:22:42.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1054" PostTypeId="1" CreationDate="2014-10-10T19:45:06.660" Score="0" ViewCount="538" Body="&lt;p&gt;When I run emacs24 on my Mac, the keyboard input continues to appear in the terminal instead of in the emacs shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just installed emacs on my Mac using Homebrew. eg&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --cocoa&#xA;ln -s /opt/boxen/homebrew/Cellar/emacs/24.3/Emacs.app /Applications&#xA;emacs-24.3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Loads a graphical version of emacs.  When I mouseover and click things move as expected.  But the keyboard does not. eg I can't type anything in and have the cursor respond.  Instead the keyboard input remains on the terminal.  So if I type right-arrow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;^[[C&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appears in terminal...&lt;/p&gt;&#xA;" OwnerUserId="928" LastEditorUserId="50" LastEditDate="2014-10-10T21:38:45.323" LastActivityDate="2014-12-09T22:04:17.560" Title="emacs24 Mac - Mouse works but keyboard input stays in terminal" Tags="|osx|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1055" PostTypeId="1" AcceptedAnswerId="1081" CreationDate="2014-10-10T19:47:35.187" Score="7" ViewCount="1944" Body="&lt;p&gt;I'm editing a text file containing Japanese kanji characters.  単 does not show up in Emacs, how to fix?  It shows up as some sort of white space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.3 (9) for Mac.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After examining my &lt;code&gt;.emacs&lt;/code&gt;, I actually copied from someone else's configuration and has&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(create-fontset-from-fontset-spec&#xA;  &quot;-unknown-Source Code Pro-normal-normal-normal-*-16-*-*-*-m-0-fontset-myfontset&quot;)&#xA;(set-fontset-font &quot;fontset-myfontset&quot; 'han &quot;XinGothic CiticPress&quot;)&#xA;(set-fontset-font &quot;fontset-myfontset&quot; 'kana &quot;HanaMinPlus&quot;)&#xA;(add-to-list 'default-frame-alist '(font . &quot;fontset-myfontset&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I don't quite understand what it does.  Apparently it doesn't work for some Kanji characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've confirmed font &lt;code&gt;HanaMinPlus&lt;/code&gt; can display that character correctly by evaluating &lt;code&gt;(set-frame-font &quot;HanMinPlus&quot; nil t)&lt;/code&gt; in my mini-buffer and observing &lt;code&gt;単&lt;/code&gt; showing up correctly in scratch buffer.  But I wonder how to tweak/correct the above code to let it automatically detect and set font.  I don't understand how fontset work in Emacs.  But &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;describe-fontset &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fontset: -apple-Menlo-medium-normal-normal-*-16-*-*-*-m-0-fontset-auto1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;not &lt;code&gt;myfontset&lt;/code&gt;.  And &lt;code&gt;describe-font&lt;/code&gt; gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;name (opened by): -apple-Menlo-medium-normal-normal-*-16-*-*-*-m-0-iso10646-1&#xA;       full name: Menlo-Regular&#xA;            size: 16&#xA;          height: 19&#xA; baseline-offset:  0&#xA;relative-compose:  0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Experiment 1&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Applications/Emacs.app/Contents/MacOS$ ./Emacs --no-init-file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then open a text file containing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;すべての人間は、生まれながらにして自由であり、&#xA;かつ、尊厳と権利と について平等である。&#xA;人間は、理性と良心とを授けられており、&#xA;互いに同胞の精神をもって行動しなければならない。&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see all characters showing up correctly.  And &lt;code&gt;describe-font&lt;/code&gt; with default selection shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;name (opened by): -apple-Menlo-medium-normal-normal-*-12-*-*-*-m-0-iso10646-1&#xA;       full name: Menlo-Regular&#xA;            size: 12&#xA;          height: 14&#xA; baseline-offset:  0&#xA;relative-compose:  0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;describe-fontset&lt;/code&gt; shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fontset: -apple-Menlo-medium-normal-normal-*-*-*-*-*-m-0-fontset-startup&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Experiment 2&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Applications/Emacs.app/Contents/MacOS$ ./Emacs --no-site-file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then open the same test file.  I see all characters showing up correctly.  And &lt;code&gt;describe-font&lt;/code&gt; with default selection shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;name (opened by): -apple-Source_Code_Pro-medium-normal-normal-*-12-*-*-*-m-0-iso10646-1&#xA;       full name: SourceCodePro-Regular&#xA;            size: 12&#xA;          height: 16&#xA; baseline-offset:  0&#xA;relative-compose:  0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Why it's not font size 16?!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;describe-fontset&lt;/code&gt; shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fontset: -apple-Source_Code_Pro-medium-normal-normal-*-12-*-*-*-m-0-fontset-auto1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="936" LastEditorUserId="936" LastEditDate="2014-10-11T19:52:13.087" LastActivityDate="2014-10-11T19:52:13.087" Title="単 does not show up in Emacs, how to fix?" Tags="|fonts|character-encoding|" AnswerCount="3" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="1056" PostTypeId="2" ParentId="1020" CreationDate="2014-10-10T19:55:26.387" Score="25" Body="&lt;p&gt;First, the more general issue: terminal emulators are often limited in the control and escape sequences they can send.  So: it may be the case that the terminal swallows your special characters before they reach Emacs.  As a general diagnostic, you can hit &lt;code&gt;C-h l&lt;/code&gt; (or &lt;code&gt;M-x view-lossage&lt;/code&gt;) to see if your key combinations make it into Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more discussion of this issue, have a look at &lt;a href=&quot;https://stackoverflow.com/questions/24309580/emacs-key-bindings-change-in-terminal-emulator/24312072#24312072&quot;&gt;this Stack Overflow thread&lt;/a&gt; and the links therein.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize the back-and-forth in the comments, your specific problem suggests it's the terminal rather than Emacs that is the problem.  When you tried &lt;code&gt;C-;&lt;/code&gt; and then &lt;code&gt;M-x view-lossage&lt;/code&gt;, you got &lt;code&gt;blah blah blah c ; ESC v i e w - l o s s a g e RET&lt;/code&gt;.  That looks like a terminal issue: if the key combination were reaching Emacs, the &lt;code&gt;c ;&lt;/code&gt; part would look like &lt;code&gt;C-;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-10T19:55:26.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1057" PostTypeId="2" ParentId="1051" CreationDate="2014-10-10T20:04:53.633" Score="7" Body="&lt;p&gt;I use the following for this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-copy-simple (beg end)&#xA;  &quot;Save the current region to the kill ring after stripping extra whitespace and new lines&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (copy-region-as-kill beg end)&#xA;  (with-temp-buffer &#xA;    (yank)&#xA;    (goto-char 0)&#xA;    (while (looking-at &quot;[ \t\n]&quot;)&#xA;      (delete-char 1))&#xA;    (compact-uncompact-block)&#xA;    (mark-whole-buffer)&#xA;    (kill-region (point-min) (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This depends on the following function, which I've been using for a while as a replacement for the default &lt;kbd&gt;M-q&lt;/kbd&gt; &lt;code&gt;fill-paragraph&lt;/code&gt;. I didn't note where it came from, I think it was Xah Lee's?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun compact-uncompact-block ()&#xA;  &quot;Remove or add line ending chars on current paragraph.&#xA;This command is similar to a toggle of `fill-paragraph'.&#xA;When there is a text selection, act on the region.&quot;&#xA;  (interactive)&#xA;&#xA;  ;; This command symbol has a property “'stateIsCompact-p”.&#xA;  (let (currentStateIsCompact (bigFillColumnVal 4333999) (deactivate-mark nil))&#xA;&#xA;    (save-excursion&#xA;      ;; Determine whether the text is currently compact.&#xA;      (setq currentStateIsCompact&#xA;            (if (eq last-command this-command)&#xA;                (get this-command 'stateIsCompact-p)&#xA;              (if (&amp;gt; (- (line-end-position) (line-beginning-position)) fill-column) t nil) ) )&#xA;&#xA;      (if (region-active-p)&#xA;          (if currentStateIsCompact&#xA;              (fill-region (region-beginning) (region-end))&#xA;            (let ((fill-column bigFillColumnVal))&#xA;              (fill-region (region-beginning) (region-end))) )&#xA;        (if currentStateIsCompact&#xA;            (fill-paragraph nil)&#xA;          (let ((fill-column bigFillColumnVal))&#xA;            (fill-paragraph nil)) ) )&#xA;&#xA;      (put this-command 'stateIsCompact-p (if currentStateIsCompact nil t)) ) ) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2014-10-10T20:04:53.633" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1058" PostTypeId="2" ParentId="1055" CreationDate="2014-10-10T20:26:25.470" Score="2" Body="&lt;p&gt;If you are seeing it as a white rectangle (a black hollow rectangle) then it probably means that the font of the current face used to display it does not support that character. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try another font, which you are sure supports that character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/SetFonts#InspectingAndChangingFonts&quot; rel=&quot;nofollow&quot;&gt;This page&lt;/a&gt; covers various ways to inspect and change fonts.  Several of them let you inspect visually the effect of changing fonts before doing so, e.g., cycling among the available fonts or subsets of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[But you don't say what Emacs version you are using. If you are using Emacs 22 or earlier then Emacs does not have Unicode support. (That doesn't imply that it cannot show the character, but it makes things different.)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe &lt;a href=&quot;http://www.emacswiki.org/FontSets&quot; rel=&quot;nofollow&quot;&gt;this EmacsWiki page on fontsets&lt;/a&gt; will help you a bit. &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-11T06:51:12.553" LastActivityDate="2014-10-11T06:51:12.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1059" PostTypeId="1" AcceptedAnswerId="1066" CreationDate="2014-10-10T20:47:45.100" Score="2" ViewCount="137" Body="&lt;p&gt;ECB windows display their number: &lt;code&gt;W-0&lt;/code&gt;, &lt;code&gt;W-1&lt;/code&gt;, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to define bindings so that I can get to these windows using bindings such as &lt;code&gt;C-c . w 0&lt;/code&gt;, &lt;code&gt;C-c . w 1&lt;/code&gt;, rather than using &lt;code&gt;C-c . g d&lt;/code&gt; to go to directories, &lt;code&gt;C-c . g s&lt;/code&gt; to go to sources?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ga79c.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, is there a way to display the key bindings for the windows in the frame modelines?&lt;/p&gt;&#xA;" OwnerUserId="724" LastEditorUserId="79" LastEditDate="2014-10-11T04:31:04.150" LastActivityDate="2014-10-11T04:31:04.150" Title="How to modify bindings to match ECB window numbers?" Tags="|window|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1060" PostTypeId="2" ParentId="1055" CreationDate="2014-10-10T20:51:10.400" Score="1" Body="&lt;p&gt;As per the link in @Drew's answer, there are several ways to cycle through fonts to get the one you need.  I use DejaVu Sans Mono and can confirm that it can display the 単 character, although I'm not sure what the analog font is on a Mac.  If you have that font (or another one you can use in its place, such as Lucida Console as per one of @Drew's comments), you could evaluate the following to set the current frame's font (with a font size of 15):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-font &quot;DejaVu Sans Mono-15&quot; nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If that works for you, you can tell Emacs to default to that font by adding to the &lt;code&gt;default-frame-alist&lt;/code&gt; with the following line in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(font . &quot;DejaVu Sans Mono-15&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-10T20:51:10.400" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1061" PostTypeId="2" ParentId="1054" CreationDate="2014-10-10T21:33:30.880" Score="1" Body="&lt;p&gt;I'm not entirely sure what causes this exactly, but the right way to run Emacs is to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ open /Applications/Emacs.app&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might want to setup an alias for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ alias emacs='open /Applications/Emacs.app --args &quot;$@&quot;'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like homebrew links its emacs binaries outside of the Emacs.app, so that it will probably not work very well in graphical mode. There shouldn't be a problem for running it in console mode though&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs-24.3 -nw &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-10T21:33:30.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1062" PostTypeId="2" ParentId="1030" CreationDate="2014-10-10T21:43:18.843" Score="7" Body="&lt;p&gt;Thanks to the answer provided by itsjeyd I managed to write a short expression to change the size of all mode-line related faces for all current and future frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're using other themes besides the default one (such as zenburn, etc.), the code should be put &lt;strong&gt;after&lt;/strong&gt; you've declared the theme; i.e., after this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'solarized-light t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming your default font size is other than 10, the code would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((faces '(mode-line&#xA;               mode-line-buffer-id&#xA;               mode-line-emphasis&#xA;               mode-line-highlight&#xA;               mode-line-inactive)))&#xA;     (mapc&#xA;      (lambda (face) (set-face-attribute face nil :font &quot;DejaVu Sans Mono-10&quot;))&#xA;      faces))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a smaller font, set a smaller value (&quot;DejaVu Sans Mono-9&quot;). Other fonts can be used: inconsolata, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; added a screenshot showing the results. The font size on the mode-line is 10 while the rest (buffers, etc.) is 12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PDtRp.png&quot; alt=&quot;Smaller mode-line font&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="920" LastEditDate="2014-10-10T23:23:10.540" LastActivityDate="2014-10-10T23:23:10.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1063" PostTypeId="2" ParentId="1059" CreationDate="2014-10-10T21:45:29.847" Score="0" Body="&lt;p&gt;The generic solution would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;describe-key&lt;/code&gt; (&lt;kbd&gt;C-h k&lt;/kbd&gt;) or &lt;code&gt;describe-key-briefly&lt;/code&gt;(&lt;kbd&gt;C-h c&lt;/kbd&gt;) to get the names of the commands invoked by the original bindings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h c&lt;/kbd&gt; &lt;kbd&gt;C-c . g d&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h c&lt;/kbd&gt; &lt;kbd&gt;C-c . g s&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set up additional bindings for the commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ecb-mode-map (kbd &quot;w 0&quot;) 'goto-dirs)&#xA;(define-key ecb-mode-map (kbd &quot;w 1&quot;) 'goto-sources)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... where &lt;code&gt;goto-dirs&lt;/code&gt; and &lt;code&gt;goto-sources&lt;/code&gt; are the names of the commands you obtained in step 1.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastActivityDate="2014-10-10T21:45:29.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1064" PostTypeId="1" AcceptedAnswerId="1065" CreationDate="2014-10-10T22:05:01.147" Score="14" ViewCount="1089" Body="&lt;p&gt;I was experimenting with local variables and set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar-local foo nil &quot;Buffer local foo&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I later redesigned my program to use a global variable instead using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo nil &quot;Not buffer local foo&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the variable is still buffer local and even &lt;code&gt;(kill-local-variable 'foo)&lt;/code&gt; didn't kill it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, how can I &quot;undo&quot; &lt;code&gt;make-local-variable&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="43" LastEditorUserId="105" LastEditDate="2015-05-20T05:01:52.713" LastActivityDate="2015-05-20T05:01:52.713" Title="Make a buffer-local variable become global again" Tags="|elisp|local-variables|buffer-local|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1065" PostTypeId="2" ParentId="1064" CreationDate="2014-10-10T22:15:18.083" Score="15" Body="&lt;p&gt;The comment from @Malabarba explains your problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;kill-local-variable&lt;/code&gt; &lt;em&gt;does&lt;/em&gt; get rid of the local variable binding. But since in your case the variable is &lt;em&gt;automatically&lt;/em&gt; local in any buffer, when you reassign it a value, that value is local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AFAIK, there is no way to counter &lt;code&gt;make-variable-buffer-local&lt;/code&gt;, except to use &lt;code&gt;unintern&lt;/code&gt; on the symbol.  (&lt;code&gt;makunbound&lt;/code&gt; does not help.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use unintern then you're OK. But keep in mind that uninterning removes the symbol altogether, so if you used the symbol for something else, besides a variable, then there might be negative consequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the only answer I have is to use &lt;code&gt;unintern&lt;/code&gt; and then reassign the variable whatever value you want - it will be a global value.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-10T22:15:18.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1066" PostTypeId="2" ParentId="1059" CreationDate="2014-10-10T22:17:52.563" Score="3" Body="&lt;p&gt;Here's what to do, and how to discover it :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Navigating to one of these windows, we see that the local value of &lt;code&gt;mode-line-format&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((:eval&#xA;  (car&#xA;   (ecb-mode-line-make-modeline-str&#xA;    (format &quot; W-%d&quot;&#xA;            (1-&#xA;             (ecb-window-in-window-list-number&#xA;              (ecb-canonical-windows-list))))&#xA;   ecb-mode-line-win-nr-face)))&#xA; (#(&quot; &quot; 0 1&#xA;    (face ecb-mode-line-prefix-face)))&#xA; (#(&quot;/Volumes/Home/hodiquey/Projects/git/ecb&quot; 0 39&#xA;    (help-echo &quot;Mouse-2 toggles maximizing, mouse-3 displays a popup-menu&quot; face ecb-mode-line-data-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;code&gt;ecb-window-in-window-list-number&lt;/code&gt; and &lt;code&gt;ecb-canonical-windows-list&lt;/code&gt; are the key (and the actual numbers is 1 more than what's displayed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-jump-to-ecb-number (n)&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((winlist (ecb-canonical-windows-list)))&#xA;    (select-window&#xA;     (cdr&#xA;      (assoc (+ n 1)&#xA;             (mapcar (lambda (win)&#xA;                       (cons (ecb-window-in-window-list-number winlist win)&#xA;                             win))&#xA;                     winlist))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And use it with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ecb-mode-map (kbd &quot;w 0&quot;) (lambda () (interactive) (my-jump-to-ecb-number 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-10T22:17:52.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1067" PostTypeId="1" CreationDate="2014-10-11T01:14:36.913" Score="2" ViewCount="591" Body="&lt;p&gt;I am constantly getting frustrated with the GDB &lt;code&gt;comint-mode&lt;/code&gt; buffer when using GUD.  Somehow my cursor always ends up straying from the bottom of the buffer, and then my input is not interpreted how I would expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way that I can make comint buffers behave more like &lt;code&gt;term-mode&lt;/code&gt; so that my keys get sent to the underlying process?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that I will have to manually allow my debugging keys, but that should be easy because I use the function keys almost exclusively when debugging.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2015-09-26T11:59:18.203" Title="Make comint-mode behave more like term-mode" Tags="|debugging|term|gud|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1068" PostTypeId="1" CreationDate="2014-10-11T01:37:18.857" Score="1" ViewCount="1686" Body="&lt;p&gt;This is my code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/set-c-mode ()&#xA; (local-set-key (kbd &quot;C-c C-c&quot;) 'compile)&#xA; (setq compilation-finish-function 'compilation-exit-autoclose-clone)&#xA; (setq c-default-style &quot;linux&quot;)&#xA; (setq c-indent-level 8)&#xA; (setq c-brace-imaginary-offset 0)&#xA; (setq c-brace-offset -8)&#xA; (setq c-argdecl-indent 8)&#xA; (setq c-label-offset -8)&#xA; (setq c-continued-statement-offset 8))&#xA;(add-hook 'c++-mode-hook      'my/set-c-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet it does not indent correctly. This should give me the linux style indentation, but what I get is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* File: ast.cc&#xA; *&#xA;&#xA; ------------&#xA; */&#xA;&#xA;#include &quot;ast.h&quot;&#xA;#include &quot;ast_type.h&quot;&#xA;#include &quot;ast_decl.h&quot;&#xA;#include &amp;lt;string.h&amp;gt; // strdup&#xA;#include &amp;lt;stdio.h&amp;gt;  // printf&#xA;&#xA;Node::Node(yyltype loc) {&#xA;  location = new yyltype(loc);&#xA;  parent = NULL;&#xA;}&#xA;&#xA;Node::Node() {&#xA;  location = NULL;&#xA;  parent = NULL;&#xA;}&#xA;&#xA;Identifier::Identifier(yyltype loc, const char *n) : Node(loc) {&#xA;  name = strdup(n);&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any Idea why?&lt;/p&gt;&#xA;" OwnerUserId="130" LastEditorUserId="25" LastEditDate="2014-10-12T01:26:11.933" LastActivityDate="2014-10-12T01:26:11.933" Title="Why does hook to set up C++ mode indentation not work?" Tags="|indentation|c++|c|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1069" PostTypeId="1" CreationDate="2014-10-11T01:45:57.163" Score="5" ViewCount="2206" Body="&lt;p&gt;I really like all of the information that is available to me when I run GUD/GDB with &lt;code&gt;gdb-many-windows&lt;/code&gt;, but I would like to be able to move the windows around some.  Specifically I would like to use the following layout&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  +-----------------------+------------------+------------+&#xA;  |                       |                  |            |&#xA;  |        comint         |  input/output    |            |&#xA;  |                       |                  |            |&#xA;  +-----------------------+------------------+            |&#xA;  |                       |                  |            |&#xA;  |                       |     locals       |     sr-    |&#xA;  |                       |                  |  speedbar  |&#xA;  |        source         |                  |            |&#xA;  |                       +------------------+            |&#xA;  |                       |                  |            |&#xA;  |                       |                  |            |&#xA;  |                       |      stack       |            |&#xA;  |                       |                  |            |&#xA;  |                       |                  |            |&#xA;  +-----------------------+------------------+------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way that I can customize this so that I always get the same window arrangement every time that I run GDB?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-11T04:05:48.623" Title="Customizing the layout of gdb-many-windows" Tags="|window|gud|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1070" PostTypeId="2" ParentId="1068" CreationDate="2014-10-11T01:49:06.530" Score="-1" Body="&lt;p&gt;Fixed! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just added  &lt;code&gt;(c-basic-offset 8)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="130" LastActivityDate="2014-10-11T01:49:06.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1071" PostTypeId="2" ParentId="847" CreationDate="2014-10-11T02:44:16.670" Score="1" Body="&lt;p&gt;So, after following the advices posted here, and doing some debugging, I found out that my issue was caused by the line &lt;code&gt;(setf org-blank-before-new-entry t)&lt;/code&gt;, commenting it enabled me to capture annotations.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-10-11T02:44:16.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1072" PostTypeId="2" ParentId="1069" CreationDate="2014-10-11T04:05:48.623" Score="4" Body="&lt;p&gt;So, the layout itself is hardcoded (as mentioned in the documentation of the &lt;code&gt;gdb&lt;/code&gt; function). This layout is defined in &lt;code&gt;gdb-setup-windows&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then, since it's defined &lt;em&gt;only&lt;/em&gt; in &lt;code&gt;gdb-setup-windows&lt;/code&gt;, and that function is called whenever restoring that layout is needed... All you have to do is to override that function to make it generate the layout you fancy !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, the initial code of &lt;code&gt;gdb-setup-windows&lt;/code&gt; is a good example of how to write such a function :)&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-11T04:05:48.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1073" PostTypeId="2" ParentId="732" CreationDate="2014-10-11T11:01:13.440" Score="4" Body="&lt;p&gt;Although not exactly what you are looking for you might want to try out &lt;a href=&quot;https://github.com/kai2nenobu/guide-key&quot; rel=&quot;nofollow noreferrer&quot;&gt;guide-key&lt;/a&gt;.  If you enter a prefix sequence without completing it &lt;em&gt;guide-key&lt;/em&gt; will pop up a buffer showing you the available completions and what functions they execute.  I find this very useful when I need to learn new bindings in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/X40OK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="457" LastActivityDate="2014-10-11T11:01:13.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1074" PostTypeId="1" AcceptedAnswerId="1078" CreationDate="2014-10-11T11:14:29.730" Score="23" ViewCount="7084" Body="&lt;p&gt;When working on a maximized Emacs frame, having the content of the minibuffer / echo area display at the bottom of the screen can be hard to see, but also causes to lose focus on the text being edited when typing a command – which is quite an issue in terms of usability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to either move the minibuffer / echo area in the centre of the current emacs buffer, over the the text being edited when minibuffer is active, or, better, to capture the content of the minibuffer and display it also in the centre of the current buffer whilst typing the command?&lt;/p&gt;&#xA;" OwnerUserId="724" LastActivityDate="2019-01-25T18:00:28.643" Title="How to display the content of minibuffer in the middle of the emacs frame?" Tags="|minibuffer|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1075" PostTypeId="1" AcceptedAnswerId="1077" CreationDate="2014-10-11T12:18:14.143" Score="7" ViewCount="1002" Body="&lt;p&gt;When defining a syntax table for a major mode, I can define both word constituents and symbol constituents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When should I use each? For example, given a programming language that writes variables in snake case &lt;code&gt;foo_bar&lt;/code&gt;, should &lt;code&gt;_&lt;/code&gt; be part of a word or symbol?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2015-05-20T05:14:25.413" LastActivityDate="2015-05-20T05:14:25.413" Title="What's the difference between words and symbols?" Tags="|elisp|major-mode|syntax|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1076" PostTypeId="2" ParentId="1074" CreationDate="2014-10-11T12:43:59.527" Score="7" Body="&lt;h1&gt;Minibuffer at the top&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Displaying the minibuffer at the middle of the screen is complicated.&#xA;A reasonable alternative (which you may or may not find more readable)&#xA;is to move it to the top.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can configure the location (or existence) of a frame’s minibuffer&#xA;with the &lt;code&gt;minibuffer&lt;/code&gt; frame parameter in the&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/initial-frame-alist&quot;&gt;&lt;code&gt;initial-frame-alist&lt;/code&gt;&lt;/a&gt;&#xA;variable.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Separate Frame&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Setting the parameter to &lt;code&gt;nil&lt;/code&gt; will configure the frame to have no&#xA;minibuffer, and Emacs will automatically create a separate minibuffer&#xA;frame for you. You can position these two frames using your OS’ window&#xA;manager, or you can do it from Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following snippet examplifies how to place the minibuffer frame at&#xA;the top, with the regular frame just below it, but you’ll definitely&#xA;have to change the numbers to account for you monitor size.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-frame-alist&#xA;      '((left . 1) (minibuffer . nil)&#xA;        ;; You'll need to adjust the following 3 numbers.&#xA;        (top . 75) ; In pixels&#xA;        (width . 127) ; In chars&#xA;        (height . 31)))&#xA;&#xA;(setq minibuffer-frame-alist&#xA;      '((top . 1) (left . 1) (height . 2)&#xA;        ;; You'll need to adjust the following number.&#xA;        (width . 127)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The quickest way to adjust this, is to resize the frames in your&#xA;window manager, and then evaluate &lt;code&gt;(frame-parameters)&lt;/code&gt; to see&#xA;parameter values you have.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Same Frame&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Another possibility is to set the &lt;code&gt;minibuffer&lt;/code&gt; parameter to a window. Unfortunately, I was unable to get this to work for a window in the same frame.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-11T12:43:59.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1077" PostTypeId="2" ParentId="1075" CreationDate="2014-10-11T12:49:57.670" Score="4" Body="&lt;p&gt;&lt;strong&gt;Word constituents: ‘w’&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parts of words in human languages. These are typically used in variable and command names in programs. All upper- and lower-case letters, and the digits, are typically word constituents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Symbol constituents: ‘_’&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extra characters used in variable and command names along with word constituents. Examples include the characters ‘$&amp;amp;*+-_&amp;lt;&gt;’ in Lisp mode, which may be part of a symbol name even though they are not part of English words. In standard C, the only non-word-constituent character that is valid in symbols is underscore &quot; _ &quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table&quot; rel=&quot;nofollow noreferrer&quot;&gt;gnu.org&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When should I use each? For example, given a programming language that writes variables in snake case foo_bar, should _ be part of a word or symbol?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It depends one what you want to achieve. I'll say, '_' should be part of word. That way, foo_bar will be treated as one word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please throw an eye to that &lt;a href=&quot;https://emacs.stackexchange.com/questions/983/treat-symbols-as-words-in-prog-modes&quot;&gt;question&lt;/a&gt;, there is an interesting answer talking about superword-mode and subword-mode&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-10-11T12:57:29.710" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1078" PostTypeId="2" ParentId="1074" CreationDate="2014-10-11T15:13:10.173" Score="10" Body="&lt;h1&gt;Popup Minibuffer at the Center&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Here’s a way to do exactly what you asked: &lt;strong&gt;display the minibuffer at the center of the screen&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Have a separate frame for the minibuffer&lt;/li&gt;&#xA;&lt;li&gt;Position it at the center&lt;/li&gt;&#xA;&lt;li&gt;Raise this frame whenever the minibuffer gains focus.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That is relatively easy to achieve, and is what you’ll get with the&#xA;&lt;code&gt;oneonone.el&lt;/code&gt; package (as @Drew points out). The problem with this approach, is&#xA;that the minibuffer is also used for messages, so keeping it hidden is&#xA;not something very convenient. &lt;em&gt;Not to worry!&lt;/em&gt; I came up with another&#xA;solution.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Have a &lt;strong&gt;second minibuffer&lt;/strong&gt; displayed on a separate frame.&lt;/li&gt;&#xA;&lt;li&gt;Position it at the center.&lt;/li&gt;&#xA;&lt;li&gt;Use the second frame for interactive commands, while the original (first) minibuffer is used for echoing messages.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Implementation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To implement this, we need to create the minibuffer frame at emacs&#xA;startup.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar endless/popup-frame-parameters&#xA;  '((name . &quot;MINIBUFFER&quot;)&#xA;    (minibuffer . only)&#xA;    (height . 1)&#xA;    ;; Ajust this one to your preference.&#xA;    (top . 200))&#xA;  &quot;Parameters for the minibuffer popup frame.&quot;)&#xA;&#xA;(defvar endless/minibuffer-frame&#xA;  (let ((mf (make-frame endless/popup-frame-parameters)))&#xA;    (iconify-frame mf) mf)&#xA;  &quot;Frame holding the extra minibuffer.&quot;)&#xA;&#xA;(defvar endless/minibuffer-window&#xA;  (car (window-list endless/minibuffer-frame t))&#xA;  &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then we patch &lt;code&gt;read-from-minibuffer&lt;/code&gt; to use this second minibuffer,&#xA;instead of the original frame’s minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-popup-minibuffer (&amp;amp;rest body)&#xA;  &quot;Execute BODY using a popup minibuffer.&quot;&#xA;  (let ((frame-symbol (make-symbol &quot;selected-frame&quot;)))&#xA;    `(let* ((,frame-symbol (selected-frame)))&#xA;       (unwind-protect &#xA;           (progn &#xA;             (make-frame-visible endless/minibuffer-frame)&#xA;             (when (fboundp 'point-screen-height)&#xA;               (set-frame-parameter&#xA;                endless/minibuffer-frame &#xA;                'top (point-screen-height)))&#xA;             (select-frame-set-input-focus endless/minibuffer-frame 'norecord)&#xA;             ,@body)&#xA;         (select-frame-set-input-focus ,frame-symbol)))))&#xA;&#xA;(defun use-popup-minibuffer (function)&#xA;  &quot;Rebind FUNCTION so that it uses a popup minibuffer.&quot;&#xA;  (let* ((back-symb (intern (format &quot;endless/backup-%s&quot; function)))&#xA;         (func-symb (intern (format &quot;endless/%s-with-popup-minibuffer&quot;&#xA;                                    function)))&#xA;         (defs `(progn&#xA;                  (defvar ,back-symb (symbol-function ',function))&#xA;                  (defun ,func-symb (&amp;amp;rest rest)&#xA;                    ,(format &quot;Call `%s' with a poupup minibuffer.&quot; function)&#xA;                    ,@(list (interactive-form function))&#xA;                    (with-popup-minibuffer &#xA;                     (apply ,back-symb rest))))))&#xA;    (message &quot;%s&quot; defs)&#xA;    (when (and (boundp back-symb) (eval back-symb))&#xA;      (error &quot;`%s' already defined! Can't override twice&quot; back-symb))&#xA;    (eval defs)&#xA;    (setf (symbol-function function) func-symb)))&#xA;&#xA;;;; Try at own risk.&#xA;(use-popup-minibuffer 'read-from-minibuffer)&#xA;;;; This will revert the effect.&#xA;;; (setf (symbol-function #'read-from-minibuffer) endless/backup-read-from-minibuffer)&#xA;;; (setq endless/backup-read-from-minibuffer nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This might not work with absolutely everything, but it worked on&#xA;everything I tried so far---&lt;code&gt;find-file&lt;/code&gt;, &lt;code&gt;ido-switch-buffer&lt;/code&gt;,&#xA;&lt;code&gt;eval-expression&lt;/code&gt;. If you &lt;em&gt;do&lt;/em&gt; find any exceptions, you can patch&#xA;these functions on a case-by-case basis by calling&#xA;&lt;code&gt;use-popup-minibuffer&lt;/code&gt; on them.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Position Near Point&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To position this minibuffer frame near the height of the point, simply&#xA;define something like the following function. It’s not perfect (in fact, it's awful at a lot of cases), but it does a decent&#xA;job of estimating point height.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun point-screen-height ()&#xA;  (* (/ (face-attribute 'default :height) 10) 2&#xA;     (- (line-number-at-pos (point))&#xA;        (line-number-at-pos (window-start)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-13T22:07:55.930" LastActivityDate="2014-10-13T22:07:55.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1079" PostTypeId="2" ParentId="1075" CreationDate="2014-10-11T15:29:05.740" Score="4" Body="&lt;p&gt;This answer addresses your question title: &quot;&lt;em&gt;What's the difference between words and symbols&lt;/em&gt;&quot;. It does not speak only to the body of your question, which is about symbol syntax, which has been answered well by @Nsukami.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two &lt;em&gt;very different&lt;/em&gt; meanings of the word &lt;em&gt;symbol&lt;/em&gt; in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;symbol syntax&lt;/strong&gt;, which involves &lt;em&gt;word-constituent characters&lt;/em&gt; &lt;strong&gt;plus&lt;/strong&gt; &lt;em&gt;symbol-constituent characters&lt;/em&gt;. This can apply to &lt;em&gt;any&lt;/em&gt; mode, in particular any programming mode/language. @Nsukami described this meaning quite well. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Emacs-Lisp symbols&lt;/strong&gt;.  This is not a syntax category.  A Lisp symbol is a Lisp entity, or object, which has certain characteristics: a &lt;strong&gt;name&lt;/strong&gt;, a &lt;strong&gt;plist&lt;/strong&gt; (property list), and potentially a &lt;strong&gt;value&lt;/strong&gt; and a &lt;strong&gt;function&lt;/strong&gt; definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, the value cell and function cell are empty, and the plist is is the empty list (&lt;code&gt;nil&lt;/code&gt;). Lisp functions &lt;code&gt;symbol-name&lt;/code&gt;, &lt;code&gt;symbol-value&lt;/code&gt;, &lt;code&gt;symbol-function&lt;/code&gt;, and &lt;code&gt;symbol-plist&lt;/code&gt; return the components.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note, BTW, that there is no mention of these things in the Emacs manual; they are covered only in the Elisp manual. And more significantly, perhaps: There is &lt;strong&gt;no index entry&lt;/strong&gt; that matches &quot;&lt;em&gt;symbol&lt;/em&gt;&quot; for the first meaning (syntax).  &lt;strong&gt;All&lt;/strong&gt; index entries that include the term &quot;&lt;em&gt;symbol&lt;/em&gt;&quot; refer to the second meaning (Lisp symbol). In particular, there is no entry that contains both &quot;&lt;em&gt;symbol&lt;/em&gt;&quot; and &quot;&lt;em&gt;syntax&lt;/em&gt;&quot;.  Whether there should be such an index entry, I don't know (probably). But this can give you some idea of the &lt;strong&gt;importance to Lisp of symbols as Lisp objects&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more info, see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Symbols&quot;&gt;&lt;code&gt;Symbols&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table&quot;&gt;&lt;code&gt;Syntax Class Table&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;http://www.emacswiki.org/Glossary&quot;&gt;Glossary&lt;/a&gt; on Emacs Wiki.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-11T15:40:20.427" LastActivityDate="2014-10-11T15:40:20.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1080" PostTypeId="2" ParentId="1074" CreationDate="2014-10-11T15:57:27.663" Score="5" Body="&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/oneonone.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;oneonone.el&lt;/code&gt;&lt;/a&gt; gives you this out of the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just customize option &lt;strong&gt;&lt;code&gt;1on1-minibuffer-frame-top/bottom&lt;/code&gt;&lt;/strong&gt; to the position you want for the standalone minibuffer frame.  The value is the number of pixels from the top (if non-negative) or the bottom (if negative) of your display.  For example, set the value to your display height divided by 2, to center it vertically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you instead want it to be positioned dynamically, say in the vertical center of the current frame, then you can do that by (a) leaving &lt;code&gt;1on1-minibuffer-frame-top/bottom&lt;/code&gt; = &lt;code&gt;nil&lt;/code&gt; and (b) &lt;em&gt;advising function&lt;/em&gt; &lt;strong&gt;&lt;code&gt;1on1-set-minibuffer-frame-top/bottom&lt;/code&gt;&lt;/strong&gt; to bind that variable dynamically to the appropriate position.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice 1on1-set-minibuffer-frame-top/bottom (around center activate)&#xA;  (let ((1on1-minibuffer-frame-top/bottom  (my-dynamic-position ...)))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Define function &lt;code&gt;my-dynamic-position&lt;/code&gt; to calculate the position you want, based on whatever criteria you want (current window/frame size &amp;amp; position, phase of the moon,...).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="15177" LastEditDate="2019-01-25T18:00:28.643" LastActivityDate="2019-01-25T18:00:28.643" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="1081" PostTypeId="2" ParentId="1055" CreationDate="2014-10-11T18:25:06.300" Score="3" Body="&lt;p&gt;I don't think you have to do anything special. Remember, there's font substitution technology in Mac OS X, Linux, MS Windows. So, even if the font doesn't contain the char, it'll &lt;em&gt;likely&lt;/em&gt; show. Many of the font mentioned here does not actually contain Chinese char sets. Specifically, Menlo and DejaVu does not contain Chinese characters.&#xA;(my emacs is set to use DejaVu, and without any setting related to Chinese. But Chinese shows fine (including 単). This has been so in Ubuntu Linux, Microsoft Windows 7, Mac OS X.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, depending on what emacs distribution you are using on the Mac, they likely have bundled their own font with settings in &lt;code&gt;site-start.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend the following, try in order, if doesn't work, try next item:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start emacs with &lt;code&gt;--no-init-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Start emacs with &lt;code&gt;--no-site-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Start emacs with &lt;code&gt;--no-site-file&lt;/code&gt; and &lt;code&gt;--no-init-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Start emacs with &lt;code&gt;--no-site-file&lt;/code&gt;, with only this line in your init file: &lt;code&gt;(set-language-environment &quot;UTF-8&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If one of these steps works, then you have narrowed down the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is hard to track down why exactly a character doesn't display. Different Operating System uses different font subsitution technology, and they don't work 100% for all characters. e.g. I have Unicode font symbola installed for displaying Unicode 6's emoticons, but many doesn't show, untill i specifically set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; specify font for all unicode characters&#xA;(when (member &quot;Symbola&quot; (font-family-list))&#xA;  (set-fontset-font t 'unicode &quot;Symbola&quot; nil 'prepend))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the above comes after:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA; ((string-equal system-type &quot;windows-nt&quot;) ; Microsoft Windows&#xA;  (when (member &quot;DejaVu Sans Mono&quot; (font-family-list))&#xA;    (add-to-list 'initial-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;))&#xA;    (add-to-list 'default-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;))&#xA;    )&#xA;  )&#xA; ((string-equal system-type &quot;darwin&quot;)   ; Mac OS X&#xA;  (when (member &quot;DejaVu Sans Mono&quot; (font-family-list))&#xA;    (add-to-list 'initial-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;))&#xA;    (add-to-list 'default-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;)))&#xA;  )&#xA; ((string-equal system-type &quot;gnu/linux&quot;) ; linux&#xA;  (when (member &quot;DejaVu Sans Mono&quot; (font-family-list))&#xA;    (add-to-list 'initial-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;))&#xA;    (add-to-list 'default-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;)))&#xA;  )&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2014-10-11T19:11:42.400" LastActivityDate="2014-10-11T19:11:42.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2081" PostTypeId="1" AcceptedAnswerId="2100" CreationDate="2014-10-11T20:06:24.657" Score="4" ViewCount="375" Body="&lt;p&gt;I use &lt;code&gt;ido-mode&lt;/code&gt; for finding files and directories, which is generally very efficient in terms of keystrokes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one annoyance I've found is when deleting the trailing pathname component when using &lt;code&gt;ido-find-file&lt;/code&gt;.  E.g., if the minibuffer contains &lt;code&gt;/some/long/directory/path/and.some.long.file.name&lt;/code&gt;, I would like to quickly delete &lt;code&gt;and.some.long.file.name&lt;/code&gt; with a single keystroke.  It seems hard to believe that this isn't built-in, but if so I haven't found the keybinding for it.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a quick way to erase the trailing file name, or another efficient way of dealing with this?&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorUserId="50" LastEditDate="2014-10-14T01:16:35.703" LastActivityDate="2014-10-14T01:49:01.760" Title="How can I quickly delete the trailing pathname component in ido-mode?" Tags="|key-bindings|ido|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2082" PostTypeId="1" AcceptedAnswerId="2088" CreationDate="2014-10-11T21:35:41.143" Score="12" ViewCount="1291" Body="&lt;p&gt;For a long time I've had Emacs put backups for all files into a single folder:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/.emacs.d/backups&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hardly ever visit the &lt;code&gt;backups&lt;/code&gt; directory, but recently I noticed that it contains a &lt;em&gt;lot&lt;/em&gt; of &lt;code&gt;*-autoloads.el&lt;/code&gt; files that I don't need backups for. How can I tell Emacs not to make backups of these types of files?&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-04T23:13:03.057" LastActivityDate="2023-10-10T12:39:10.640" Title="Turn off automatic backups for specific files" Tags="|backup|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2083" PostTypeId="2" ParentId="2081" CreationDate="2014-10-11T21:53:25.020" Score="3" Body="&lt;p&gt;&lt;code&gt;M-backspace&lt;/code&gt; (&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt;) is quite efficient.  It'll kill whole words instead of single characters.  It's perhaps not a single key solution in your case, but you can use it pretty much everywhere in Emacs or in shell.&lt;/p&gt;&#xA;" OwnerDisplayName="user1970" LastEditorUserId="25" LastEditDate="2014-10-12T01:55:17.663" LastActivityDate="2014-10-12T01:55:17.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2084" PostTypeId="1" CreationDate="2014-10-11T22:11:03.843" Score="9" ViewCount="1420" Body="&lt;p&gt;When I run &lt;code&gt;M-x compile&lt;/code&gt; it spawns a new subshell to execute my compile command. As soon as the compile command returns, the shell process is killed. I can see why this would be desirable in most cases, but I am currently in a situation where it is not helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working in a specialized build environment right now which requires that I take some initial steps to setup the build before running the compiler. As long as the environment persists,I only need to do the setup steps once. But when I use &lt;code&gt;M-x compile&lt;/code&gt; it means that I have to do the steps each time I want to compile or recompile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way that I can spawn a subshell that will persist in the background? One that &lt;code&gt;M-x compile&lt;/code&gt; and &lt;code&gt;M-x gdb&lt;/code&gt; can use each time they need to run a shell process?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Motivation:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I have a program (which we will call &lt;code&gt;xcc&lt;/code&gt;) which builds C code for special platforms. In order to build my code, I first start &lt;code&gt;xcc&lt;/code&gt; from the &lt;code&gt;tcsh&lt;/code&gt; prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ xcc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The program takes 10+ seconds to load, and then I can enter commands at its interactive prompt&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xcc&amp;gt;&amp;gt; add target myprogram&#xA;xcc&amp;gt;&amp;gt; set source myprogram $PROJDIR/src/&#xA;xcc&amp;gt;&amp;gt; set includes myprogram $PROJDIR/include/&#xA;xcc&amp;gt;&amp;gt; set type myprogram primitive&#xA;xcc&amp;gt;&amp;gt; set inputs myprogram int8,int8&#xA;xcc&amp;gt;&amp;gt; set outputs myprogram fix16,fix16&#xA;xcc&amp;gt;&amp;gt; build myprogram&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above steps can be built into a custom macro &lt;code&gt;buildmyprog.macro&lt;/code&gt; so that I can run it directly from the shell, or from emacs with &lt;code&gt;M-x compile&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ xcc buildmyprog.macro&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main problem with this approach is the fact that it takes the &lt;code&gt;xcc&lt;/code&gt; program 10 seconds to load, before compilation even begins. I got tired enough of waiting the extra 10 seconds every time I compiled that I have started running &lt;code&gt;xcc&lt;/code&gt; in an &lt;code&gt;ansi-term&lt;/code&gt; in a separate buffer. Now after I modify and save the code, I switch over to the &lt;code&gt;ansi-term&lt;/code&gt; buffer and run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xcc&amp;gt;&amp;gt; build myprogram&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine, but every time I switch over to that buffer I think, &quot;Wouldn't it be great if I could just push &lt;code&gt;F7&lt;/code&gt; and my compile command would get sent to the already-running instance of &lt;code&gt;xcc&lt;/code&gt;?&quot;&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-10-13T13:59:19.767" LastActivityDate="2014-10-23T13:48:18.790" Title="Persistent environment for M-x compile" Tags="|compilation|shell|process|subprocess|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2085" PostTypeId="2" ParentId="2084" CreationDate="2014-10-11T22:15:54.810" Score="0" Body="&lt;p&gt;Use an actual shell inside Emacs then, like &lt;code&gt;eshell&lt;/code&gt; or &lt;code&gt;ansi-term&lt;/code&gt;. You should use &lt;code&gt;compile&lt;/code&gt; for compiling, although it can be used to execute any command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think it's possible with compile command, but maybe I am missing something. Otherwise, you could put every setup steps into a shell script and execute that script with &lt;code&gt;M-x compile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-10-12T06:21:42.120" LastActivityDate="2014-10-12T06:21:42.120" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2086" PostTypeId="1" AcceptedAnswerId="2091" CreationDate="2014-10-11T22:51:46.163" Score="21" ViewCount="1671" Body="&lt;p&gt;Is it possible to prevent editing of text within a collapsed subtree in Org Mode? That is, I would like to make it impossible to edit the hidden text. This seems like something that should exist but I haven't seen a way to do it.&lt;/p&gt;&#xA;" OwnerUserId="655" LastActivityDate="2014-10-12T01:37:43.423" Title="Org Mode: Prevent editing of text within collapsed subtree" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2087" PostTypeId="1" AcceptedAnswerId="2094" CreationDate="2014-10-11T23:35:37.387" Score="6" ViewCount="743" Body="&lt;p&gt;How do I add a new &lt;a href=&quot;http://www.emacswiki.org/emacs/IbufferMode&quot; rel=&quot;noreferrer&quot;&gt;ibuffer&lt;/a&gt; saved filter group which matches all files in &lt;code&gt;org-agenda-files&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default ibuffer-saved-filter-groups&#xA;              `((&quot;Default&quot;&#xA;                 (&quot;Agenda&quot; (or (mode . org-agenda-mode)&#xA;                               (mode . diary-mode)&#xA;                               (predicate . '(lambda ()&#xA;                                              (member (buffer-file-name)&#xA;                                                      (mapcar 'expand-file-name org-agenda-files))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm guessing at the &lt;code&gt;predicate&lt;/code&gt; bit as I can't find any examples or documentation. What should it really look like?&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2014-10-12T15:05:08.453" Title="Predicates in ibuffer saved filter groups" Tags="|org-mode|ibuffer|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2088" PostTypeId="2" ParentId="2082" CreationDate="2014-10-12T01:02:46.310" Score="16" Body="&lt;p&gt;You can customize the location through &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Names.html&quot;&gt;&lt;code&gt;backup-directory-alist&lt;/code&gt;&lt;/a&gt;. Each entry in the list says where to put the backups of files matching a pattern; if the location is &lt;code&gt;nil&lt;/code&gt;, the backup will be in the same directory as the original. The order matters: the first match is used.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;-autoloads\\.el\\'&quot;)&#xA;                               (&quot;.&quot; . &quot;~/.emacs.d/backups&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to suppress backups altogether on the basis of the file name or location, there doesn't appear to be a built-in mechanism for that, but it's easy enough to add. The variable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Making-Backups.html#index-backup_002denable_002dpredicate-2070&quot;&gt;&lt;code&gt;backup-enable-predicate&lt;/code&gt;&lt;/a&gt; contains the name of a function that determines whether a file should have backups. The default setting &lt;code&gt;normal-backup-enable-predicate&lt;/code&gt; only inhibits backups in the directories that Emacs uses for temporary files. You can add your own function that checks the file name as well.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar backup-inhibit-file-name-regexp &quot;-autoloads\\.el\\'&quot;&#xA;  &quot;Files whose full path matches this regular expression will not be backed up.&quot;)&#xA;(defun regexp-backup-enable-predicate (filename)&#xA;  &quot;Disable backups for files whose name matches `backup-inhibit-file-name-regexp'.&#xA;Also call `normal-backup-enable-predicate'.&quot;&#xA;  (save-match-data&#xA;    (and (not (string-match backup-inhibit-file-name-regexp filename))&#xA;     (normal-backup-enable-predicate filename))))&#xA;(setq backup-enable-predicate 'regexp-backup-enable-predicate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Even if this function returns &lt;code&gt;t&lt;/code&gt;, other mechanisms can disable backups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to disable backups in a specific major mode, set &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Making-Backups.html#index-make_002dbackup_002dfiles-2069&quot;&gt;&lt;code&gt;make-backup-files&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;nil&lt;/code&gt; in the major mode's setup hook (possibly based on the file name and other characteristics). Don't forget to make the variable buffer-local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to disable backups for certain files is to set &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Making-Backups.html#index-backup_002dinhibited-2072&quot;&gt;&lt;code&gt;backup-inhibited&lt;/code&gt;&lt;/a&gt;. This variable survives a major mode change. It's how VC disables backups on files under version control (through an entry in &lt;code&gt;file-find-hook&lt;/code&gt;). Don't forget to make the variable buffer-local.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-10-12T13:57:23.427" LastActivityDate="2014-10-12T13:57:23.427" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2089" PostTypeId="2" ParentId="1068" CreationDate="2014-10-12T01:15:52.517" Score="2" Body="&lt;p&gt;Your code doesn't make much sense. You set the default style in the mode setup hook. The default style will be used when you subsequently open a file. The first file you open will be in what was the default style at the time (which is &lt;code&gt;&quot;gnu&quot;&lt;/code&gt;) with some parameters customized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Linux style is built in, so you don't need to do anything other than select it. Remove your hook and set &lt;code&gt;c-default-style&lt;/code&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq c-default-style '((&quot;c++&quot; . &quot;linux&quot;)&#xA;                        (java-mode . &quot;java&quot;)&#xA;                        (awk-mode . &quot;awk&quot;)&#xA;                        (other . &quot;gnu&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want to bake in the default value, add your setting after the CC Mode package is loaded.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;cc-vars&quot;&#xA;  '(setq c-default-style (cons (&quot;c++&quot; . &quot;linux&quot;) c-default-style)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Defining a key binding &lt;a href=&quot;https://emacs.stackexchange.com/questions/990/differences-between-setting-major-mode-keys-with-a-hook-versus-adding-them-to-th&quot;&gt;should also be done&lt;/a&gt; when the corresponding mode is loaded, not when opening a file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;cc-mode&quot; '(define-key c-mode-map (kbd &quot;C-c C-c&quot;) 'compile))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can either set &lt;code&gt;compilation-finish-function&lt;/code&gt; globally or only in C++ mode. If you want to set it globally, set it directly in &lt;code&gt;.emacs&lt;/code&gt;. If you want to set it only in C++ mode, you need to make it buffer-local. Note that &lt;code&gt;compilation-finish-function&lt;/code&gt; has been obsoleted by &lt;code&gt;compilation-finish-functions&lt;/code&gt;. To set it for C++ mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c++-mode-hook&#xA;  (lamdbda ()&#xA;    (add-to-list 'compilation-finish-functions 'compilation-exit-autoclose-clone t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-10-12T01:25:10.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2090" PostTypeId="2" ParentId="1075" CreationDate="2014-10-12T01:33:44.383" Score="2" Body="&lt;p&gt;This is explained &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table&quot; rel=&quot;nofollow&quot;&gt;in the ELisp manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs uses terminology from Lisp. What Lisp and Emacs calls a &lt;em&gt;symbol&lt;/em&gt; is what many other programming languages call an *identifier. That's the name of a variable, function, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;em&gt;word&lt;/em&gt; is a run of letters or digits with no intervening punctation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most programming languages allow the underscore &lt;code&gt;_&lt;/code&gt; character in identifiers, in addition to letters and digits. Some languages, such as Lisp, allow more. In programming languages, characters such as &lt;code&gt;_&lt;/code&gt; that can appear in identifiers have the class “symbol constituent” &lt;code&gt;_&lt;/code&gt;; letters and digits have the class “word constituent” &lt;code&gt;w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commands that act on words treat a sequence of word constituents as a word. Commands that act on expressions (e.g. &lt;code&gt;forward-sexp&lt;/code&gt;) move by whole identifiers at once. Syntax highlighting usually treats all symbol constituents identically.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-12T01:33:44.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2091" PostTypeId="2" ParentId="2086" CreationDate="2014-10-12T01:37:43.423" Score="29" Body="&lt;p&gt;From the fine Org Manual -- &lt;a href=&quot;http://orgmode.org/org.html#Catching-invisible-edits&quot;&gt;2.3.3 Catching Invisible Edits&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sometimes you may inadvertently edit an invisible part of the buffer and be confused on what has been edited and how to undo the mistake. Setting org-catch-invisible-edits to non-nil will help prevent this. See the docstring of this option on how Org should catch invisible edits and process them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have this in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default org-catch-invisible-edits 'smart)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found out about the &lt;code&gt;'smart&lt;/code&gt; option by hitting &lt;code&gt;C-h v org-catch-invisible-edits&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2014-10-12T01:37:43.423" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2092" PostTypeId="2" ParentId="655" CreationDate="2014-10-12T03:11:58.587" Score="3" Body="&lt;p&gt;I don't know of any good performance benchmark for Emacs, sadly.&#xA;Part of the reason is that it depends on what you want to measure (redisplay performance?  I/O performance? ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding Elisp performance in particular, the lack of benchmark is a symptom of the relative lack of work on improving its performance.  FWIW, when working on the implementation of lexical-binding, I did use a benchmark to try and make sure that this new feature did not come at the cost of lower performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This benchmark I used is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rm **/*.elc lisp/loaddefs.el; make -jN&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;running it from within Emacs's source causes all Elisp files to be recompiled, and the byte-compiler is one of the relatively few pieces of Elisp which run for long periods of time and can easily be run in batch mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside is that this is a moving target, since the time taken depends on the version of the byte-compiler you're using as well as on the version of Emacs you're compiling.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-12T03:11:58.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2093" PostTypeId="2" ParentId="900" CreationDate="2014-10-12T03:18:50.630" Score="4" Body="&lt;p&gt;I think the most simple answer is &quot;no, there is no way to make hexl-mode do that&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mostly because hexl-mode is by nature very limited in what it can and can't do (or more specifically, to let it do other things, you'd have to change it substantially).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what you mean by &quot;display hex values as floats&quot;, but if you mean &quot;take 4-byte chunks and treat them as 32-bit floats&quot;, then I think the best way might be to do something like what &lt;code&gt;nhexl-mode&lt;/code&gt; does.  It's not going to be a 2-line change, though, since you're going to have to write by hand the conversion from 4-byte chunks to a float.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="25" LastEditDate="2014-10-17T21:12:55.137" LastActivityDate="2014-10-17T21:12:55.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2094" PostTypeId="2" ParentId="2087" CreationDate="2014-10-12T03:19:53.813" Score="4" Body="&lt;p&gt;The predicate is not a function, but a form to be eval'd in the context of each buffer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-agenda-filter ()&#xA;  (let ((fname (buffer-file-name)))&#xA;    (and fname&#xA;         (member (file-truename fname)&#xA;                 (mapcar 'file-truename (org-agenda-files))))))&#xA;&#xA;(setq-default ibuffer-saved-filter-groups&#xA;              `((&quot;default&quot;&#xA;                 (&quot;Agenda&quot; (or (mode . org-agenda-mode)&#xA;                               (mode . diary-mode)&#xA;                               (predicate . (my-org-agenda-filter)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you should not use &lt;code&gt;org-agenda-files&lt;/code&gt; since it can be for example a directory, or even a file containing the list of actual files you're interested in.&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-10-12T15:05:08.453" LastActivityDate="2014-10-12T15:05:08.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2095" PostTypeId="2" ParentId="974" CreationDate="2014-10-12T11:05:53.887" Score="3" Body="&lt;p&gt;The search returns to the original buffer when a recursive edit is used for modal searching. But multi-file search doesn't support modal isearch. This problem is fixed in Emacs 24.4 (scheduled to be released next week as I write).&lt;/p&gt;&#xA;" OwnerUserId="478" LastEditorUserId="25" LastEditDate="2014-10-12T15:13:09.387" LastActivityDate="2014-10-12T15:13:09.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2096" PostTypeId="1" CreationDate="2014-10-12T11:27:51.247" Score="21" ViewCount="5944" Body="&lt;p&gt;I'm trying to achieve the following behavior in Emacs24:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to use a different theme (solarized-dark vs. solarized-light) depending on whether I connect to the running&#xA;server with a terminal frame&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% emacsclient -t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or with a gtk frame&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% emacsclient -c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to have worked in older Emacs, but the current Emacs I couldn't find a way.  I alreday checked SO (e.g., &lt;a href=&quot;https://stackoverflow.com/q/18904529/152439&quot;&gt;https://stackoverflow.com/q/18904529/152439&lt;/a&gt; and answers) and the mailing lists (e.g., &lt;a href=&quot;https://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00227.html&quot; rel=&quot;noreferrer&quot;&gt;https://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00227.html&lt;/a&gt; and &lt;a href=&quot;https://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00237.html&quot; rel=&quot;noreferrer&quot;&gt;https://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00237.html&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current setup looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'custom-theme-load-path &quot;~/.emacs.d/themes/solarized&quot;)&#xA;(if (daemonp)&#xA;  (add-hook 'after-make-frame-functions&#xA;    (lambda (frame)&#xA;      (select-frame frame)&#xA;      (if (display-graphic-p frame)&#xA;        (load-theme 'solarized-light t)&#xA;        (load-theme 'solarized-dark t)&#xA;      )&#xA;    )&#xA;  )&#xA;  (load-theme 'solarized-light t)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with this is that if I have a graphical frame open and then open a terminal frame with &lt;code&gt;emacsclient -t&lt;/code&gt;, the theme solarized-dark gets applied to both the new terminal frame (which is correct) and the already open graphical frame (which should be left untouched, ideally).  The equivalent happens when a terminal frame is already open and I open a new graphical frame with &lt;code&gt;emacsclient -c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; In case this is not possible with current Emacs24, are there any plans to make it possible again?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2021-08-19T15:05:59.937" Title="Different themes for terminal and graphical frames when using Emacs daemon" Tags="|frames|daemon|themes|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2097" PostTypeId="1" AcceptedAnswerId="2098" CreationDate="2014-10-12T16:56:55.260" Score="7" ViewCount="644" Body="&lt;p&gt;I'd like to know exactly what my modeline is telling me and how it's derived. Right now, if I'm working with a graphical terminal I can hover over each modeline entry in turn, and if I'm lucky, a tooltip will pop up; obviously, this won't work in a console.  Alternately I can examine the &lt;code&gt;mode-line-format&lt;/code&gt; variable, but it's not at all obvious how the values correlate to what's displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I'd like something within Emacs that would explain, for example, how am I getting from &lt;code&gt;&quot;%e&quot;&lt;/code&gt; in mode-line-format to &lt;code&gt;U:---&lt;/code&gt;, what that means and where to get more information:  “&lt;code&gt;U:---&lt;/code&gt; comes from &lt;code&gt;%e&lt;/code&gt; in &lt;code&gt;mode-line-format&lt;/code&gt; and means this, that and the other.  You can customize it here.”&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a mode or tool that will help me?&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="105" LastEditDate="2015-03-27T19:10:54.587" LastActivityDate="2015-03-27T19:10:54.587" Title="How can I find out exactly what my modeline is telling me?" Tags="|mode-line|help|tooltip|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2098" PostTypeId="2" ParentId="2097" CreationDate="2014-10-12T17:13:32.870" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;As far as I know, &lt;strong&gt;there is no such tool&lt;/strong&gt; in Emacs or a 3rd-party library. But perhaps someone else will come up with one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You have correctly pointed to the two main sources of info I would have mentioned: (1) pop-up info in tooltips and (2) studying &lt;code&gt;mode-line-format&lt;/code&gt; and its doc (doc string and Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Top.html#Mode-Line-Top&quot;&gt;&lt;code&gt;Mode Line Top&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third source of info that can help is to see how existing code modifies &lt;code&gt;mode-line-format&lt;/code&gt; and what it does with it. This can be helpful because of the complexity of &lt;code&gt;mode-line-format&lt;/code&gt;.  There are lots of such code examples out there. Library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/modeline-posn.el&quot;&gt;&lt;code&gt;modeline-posn.el&lt;/code&gt;&lt;/a&gt; is one of mine, but there are plenty of others, including code that is part of the Emacs distribution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Please consider suggesting this as a possible enhancement to Emacs. You do that with &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; (it is not only for bug reports). And if you have any particular ideas of what features for this might be useful for users, please contribute them also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also send a mail to &lt;code&gt;emacs-devel@gnu.org&lt;/code&gt;, which is the Emacs development mailing list, to open a discussion about this possibility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There are other such complex structures in Emacs that could also benefit from additional help/exploration/navigation: menus &amp;amp; other keymaps, &lt;code&gt;font-lock-keywords&lt;/code&gt;...  A generic means of, or framework for, exploring/interrogating such a structure might also be helpful.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-12T17:13:32.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2099" PostTypeId="2" ParentId="2097" CreationDate="2014-10-12T17:20:47.193" Score="4" Body="&lt;p&gt;Since any tool will have to read &lt;code&gt;mode-line-format&lt;/code&gt;, you cannot do better than examining it. The manual has an extensive section describing the format &lt;strong&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/strong&gt; including all the &lt;code&gt;%&lt;/code&gt; constructs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;mode-line-format&lt;/code&gt; is often recursive i.e. it contains variables which are themselves valid modeline formats so it is often useful to parse a part of it independently. For this case &lt;code&gt;format-mode-line&lt;/code&gt; is a useful function which can give insight to what a particular snippet does. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that many minor modes (&lt;code&gt;anzu-mode&lt;/code&gt;, &lt;code&gt;helm&lt;/code&gt; etc) will often add there own sections to the modelines which might not be evident from &lt;code&gt;mode-line-format&lt;/code&gt; directly. Browsing customization options usually yields information on these.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-10-12T17:20:47.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2100" PostTypeId="2" ParentId="2081" CreationDate="2014-10-12T18:30:43.823" Score="1" Body="&lt;p&gt;I didn't find a built-in way to do that (well &lt;code&gt;M-^ C-k&lt;/code&gt; seems to work, but that's a little bit hacky). That said, implementing it doesn't look too difficult. I believe the following would do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ido-clear-fname ()&#xA;  (interactive)&#xA;  (setq ido-text-init &quot;&quot;&#xA;        ido-exit 'refresh)&#xA;  (exit-minibuffer))&#xA;&#xA;(define-key ido-common-completion-map (kbd &quot;&amp;lt;C-M-backspace&amp;gt;&quot;) 'ido-clear-fname)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-12T18:30:43.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2101" PostTypeId="1" AcceptedAnswerId="2102" CreationDate="2014-10-12T19:05:31.487" Score="8" ViewCount="3256" Body="&lt;p&gt;I'm using the shell (&lt;code&gt;M-x shell&lt;/code&gt;) to connect to a remote host via SSH. After launching some command line tools (mostly &lt;strong&gt;psql&lt;/strong&gt;, the postgresql command line interface, but &lt;strong&gt;man&lt;/strong&gt; would be the same for example), the shell is giving me the following warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;WARNING: terminal is not fully functional                                                    &#xA;-  (press RETURN) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I know, this looks like a pager problem. Changing the pager to &lt;code&gt;cat&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;PAGER&quot; &quot;/bin/cat&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;helped me get rid of those messages, but only for local commands (and I do not mind using cat as a pager). As I only have one local instance of Emacs, is there a way to use a different pager on the remote host? Or any other way to get rid of the warning messages, if possible without switching to &lt;code&gt;ansi-term&lt;/code&gt;? If it's of any help, I'm using GNU Emacs 24.3.1.&lt;/p&gt;&#xA;" OwnerUserId="424" LastEditorUserId="25" LastEditDate="2014-10-12T19:22:40.180" LastActivityDate="2014-10-12T20:02:14.073" Title="“terminal is not fully functional” over ssh in a *shell* buffer" Tags="|tramp|shell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2102" PostTypeId="2" ParentId="2101" CreationDate="2014-10-12T20:02:14.073" Score="9" Body="&lt;p&gt;The &quot;problem&quot; is that with &lt;code&gt;M-x shell&lt;/code&gt; (or &lt;code&gt;M-x eshell&lt;/code&gt; btw), Emacs uses a &lt;em&gt;very&lt;/em&gt; limited terminal emulator, so that &lt;code&gt;TERM&lt;/code&gt; is correctly set to &lt;code&gt;dumb&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fancy pagers cannot operate under such limited constraints, which is why you have to use &lt;code&gt;cat&lt;/code&gt; instead.&#xA;Now, when you open an ssh connection from that shell, &lt;code&gt;TERM&lt;/code&gt; is still dumb, but &lt;code&gt;PAGER&lt;/code&gt; is reset to whatever the other system thinks you should use. In order to fix this, you need to alter your shell configuration on the remote system so that it uses decent defaults whenever it's accessed from a dumb terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ &quot;$TERM&quot; = &quot;dumb&quot; ] &amp;amp;&amp;amp; export PAGER=/bin/cat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-12T20:02:14.073" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2103" PostTypeId="2" ParentId="450" CreationDate="2014-10-13T03:44:15.420" Score="33" Body="&lt;p&gt;As &lt;a href=&quot;https://emacs.stackexchange.com/questions/450/intelligent-spell-checking-in-org-mode#comment1421_450&quot;&gt;rvf0068 suggested&lt;/a&gt;, ispell can be configured to skip over regions that match regexes.  For example, to skip over &lt;code&gt;:PROPERTIES:&lt;/code&gt; and &lt;code&gt;:LOGBOOK:&lt;/code&gt; drawers as well as &lt;code&gt;SRC&lt;/code&gt; blocks, you could put this in your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'ispell-skip-region-alist '(&quot;:\\(PROPERTIES\\|LOGBOOK\\):&quot; . &quot;:END:&quot;))&#xA;(add-to-list 'ispell-skip-region-alist '(&quot;#\\+BEGIN_SRC&quot; . &quot;#\\+END_SRC&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;(I'm new to StackExchange, so if I've broken etiquette or rules by expanding on rvf0068's answer please let me know.)&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="50" LastEditDate="2014-10-13T10:49:57.507" LastActivityDate="2014-10-13T10:49:57.507" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2104" PostTypeId="2" ParentId="2084" CreationDate="2014-10-13T04:21:14.907" Score="2" Body="&lt;p&gt;Can you do the setup in your shell before you start emacs?  The &lt;code&gt;compile&lt;/code&gt; sub-shell should inherit the environment from its grandparent via emacs.&lt;/p&gt;&#xA;" OwnerUserId="2000" LastActivityDate="2014-10-13T04:21:14.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2105" PostTypeId="1" AcceptedAnswerId="2108" CreationDate="2014-10-13T07:21:35.047" Score="6" ViewCount="425" Body="&lt;p&gt;&lt;code&gt;key-chord-mode&lt;/code&gt; is useful, but I don't need it to work in the minibuffer. How do I disable it in the minibuffer?&lt;/p&gt;&#xA;" OwnerUserId="2004" LastEditorUserId="25" LastEditDate="2014-10-13T09:39:22.580" LastActivityDate="2014-10-13T09:39:22.580" Title="How do I disable key-chord-mode in the minibuffer?" Tags="|minibuffer|key-chord-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2106" PostTypeId="2" ParentId="461" CreationDate="2014-10-13T08:38:25.397" Score="7" Body="&lt;p&gt;You can configure TRAMP to respect the PATH variable on the remote machine (for remote eshell sessions) by adding &lt;code&gt;'tramp-own-remote-path&lt;/code&gt; to the list &lt;code&gt;'tramp-remote-path&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-remote-path 'tramp-own-remote-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, eshell will not adopt the remote PATH settings.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-13T08:38:25.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2107" PostTypeId="1" AcceptedAnswerId="2114" CreationDate="2014-10-13T08:50:08.293" Score="12" ViewCount="782" Body="&lt;p&gt;I often use Eshell to connect to remote systems.  On those remote systems I sometimes want to run scripts in the current working directory.  In a regular terminal I'd type this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./my-script.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, inside of Eshell this won't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ cd /remote1:~&#xA;/ssh:remote1:/home/rekado $ ./my-script.sh &#xA;env: /ssh:remote1:/home/rekado/my-script.sh: No such file or directory&#xA;/ssh:remote1:/home/rekado $ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It only works if I provide the complete TRAMP path to the script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/ssh:remote1:/home/rekado $ /ssh:remote1:/home/rekado/my-script.sh &#xA;It works!&#xA;/ssh:remote1:/home/rekado $ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to convince Eshell to expand &lt;code&gt;.&lt;/code&gt; automatically such that the simpler invocation just works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround I currently use a function bound to &lt;code&gt;C-c .&lt;/code&gt; that inserts the current full path on the command line.  I'd much prefer to have &lt;code&gt;.&lt;/code&gt; just behave as expected.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-11-05T18:23:58.123" Title="Run application in cwd on remote host from within eshell" Tags="|tramp|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2108" PostTypeId="2" ParentId="2105" CreationDate="2014-10-13T09:18:56.277" Score="13" Body="&lt;p&gt;Just add this code in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun disable-key-chord-mode ()&#xA;  (set (make-local-variable 'input-method-function) nil))&#xA;&#xA;(add-hook 'minibuffer-setup-hook #'disable-key-chord-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="716" LastEditorUserId="716" LastEditDate="2014-10-13T09:26:49.440" LastActivityDate="2014-10-13T09:26:49.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2109" PostTypeId="1" AcceptedAnswerId="2110" CreationDate="2014-10-13T11:07:54.797" Score="2" ViewCount="380" Body="&lt;p&gt;I found this list at the emacswiki: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FFI (foreign function interface). Would be great to have this in GNU.&#xA;Enhanced Numerics. We sorely need this too.&#xA;Apparently much better multimedia support (Of particular interest to me.)&#xA;Doubly-linked lists, skip lists, and some other possibly interesting data structures.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does Emacs have a feature request location, or even somewhere to post issues? &lt;/p&gt;&#xA;" OwnerUserId="2008" LastEditorUserId="253" LastEditDate="2014-11-18T20:55:49.303" LastActivityDate="2014-11-18T20:55:49.303" Title="How do I make a bug report or feature request against GNU Emacs?" Tags="|debugging|" AnswerCount="1" CommentCount="2" ClosedDate="2014-10-13T14:25:08.593" ContentLicense="CC BY-SA 3.0" />
  <row Id="2110" PostTypeId="2" ParentId="2109" CreationDate="2014-10-13T13:13:50.763" Score="6" Body="&lt;p&gt;The procedure for reporting bugs, requesting features, and submitting pathces is outlined in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt; C-h &lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt;&lt;kbd&gt;Bugs&lt;/kbd&gt;&lt;kbd&gt;return&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or read online: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Bugs.html&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Bugs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use &lt;code&gt;report-emacs-bug&lt;/code&gt; for bug reporting and feature requests&lt;/li&gt;&#xA;&lt;li&gt;ask the dev mailing list if you think your request requires more discussion&lt;/li&gt;&#xA;&lt;li&gt;check the existing bugs and search the mailing list to see if the topic has already been discussed and concluded upon&lt;/li&gt;&#xA;&lt;li&gt;read the manual for how to send patches&lt;/li&gt;&#xA;&lt;li&gt;subscribe to emacs-devel or even bug-gnu-emacs if you want to be more involved or informed about what is happening in emacs development.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also read &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/etc/CONTRIBUTE&quot;&gt;etc/CONTRIBUTE&lt;/a&gt; and &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/BUGS&quot;&gt;BUGS&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-10-13T13:28:49.317" LastActivityDate="2014-10-13T13:28:49.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2111" PostTypeId="1" AcceptedAnswerId="2116" CreationDate="2014-10-13T13:19:07.127" Score="3" ViewCount="161" Body="&lt;p&gt;Even if I copy the example from here: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/calc/Linear-Fits.html#Linear-Fits&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/calc/Linear-Fits.html#Linear-Fits&lt;/a&gt; this one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ [ 1, 2, 3, 4,  5  ]&#xA;  [ 5, 7, 9, 11, 13 ] ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to be more specific, and then press &lt;kbd&gt;a F 1 RET&lt;/kbd&gt;, all I get is the error message &quot;Model expression is too complex: a + b * x&quot;. Do I have to do something special to make it work? Calc can plot data, so that's not an issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;emacs -Q&lt;/code&gt; gives the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Emacs Version: &lt;code&gt;GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.8.2) of 2013-08-14 on buildvm-15.phx2.fedoraproject.org&lt;/code&gt;&lt;br&gt;&#xA;&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="50" LastEditDate="2014-10-13T14:42:42.697" LastActivityDate="2014-10-13T18:20:54.923" Title="Calc won't fit any curve to any data, complains “Model expression is too complex”" Tags="|calc|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2112" PostTypeId="1" AcceptedAnswerId="2113" CreationDate="2014-10-13T13:28:00.453" Score="4" ViewCount="2864" Body="&lt;p&gt;For some reason, I need to manually update the &lt;code&gt;custom-theme-load-path&lt;/code&gt; list after every update of a theme like &lt;code&gt;smart-mode-line&lt;/code&gt; or &lt;code&gt;leuven-theme&lt;/code&gt;. Looking for a solution, I came across &lt;a href=&quot;https://stackoverflow.com/a/15381087/1219634&quot;&gt;this SO&lt;/a&gt; post.  Here is the solution from that post (with slight modification):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Ensure that the custom-theme-load-path has all the theme paths added&#xA;;; Source: https://stackoverflow.com/a/15381087/1219634&#xA;(require 'dash)&#xA;  (require 's)&#xA;  (-each&#xA;      (-map&#xA;       (lambda (item)&#xA;         (format (concat elpa-dir &quot;/%s&quot;) item))&#xA;       (-filter&#xA;        (lambda (item)&#xA;          (or (s-contains? &quot;theme&quot; item)&#xA;              (s-contains? &quot;smart-mode-line&quot; item)))&#xA;        (directory-files elpa-dir)))&#xA;    (lambda (item)&#xA;      (add-to-list 'custom-theme-load-path item)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above snippet works great and it updates &lt;code&gt;custom-theme-load-path&lt;/code&gt;. The catch is that every time I load a theme using &lt;code&gt;load-theme&lt;/code&gt;, the &lt;code&gt;custom-theme-load-path&lt;/code&gt; resets to the value set by &lt;em&gt;Customize&lt;/em&gt;. I have verified this behavior by putting &lt;code&gt;(message &quot;%s&quot; custom-theme-load-path)&lt;/code&gt; before and after the call to &lt;code&gt;(load-theme ..)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I permanently set the value of &lt;code&gt;custom-theme-load-path&lt;/code&gt; so that &lt;code&gt;load-theme&lt;/code&gt; cannot reset its value?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a workaround I use to avoid this issue (but I'd like to understand why this is happening):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have wrapped the above snippet in a function called &lt;code&gt;update-custom-theme-load-path&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I call that function right before I call &lt;code&gt;(load-theme 'leuven t)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-13T14:38:15.197" Title="Why does load-theme reset the custom-theme-load-path?" Tags="|elisp|themes|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2113" PostTypeId="2" ParentId="2112" CreationDate="2014-10-13T14:38:15.197" Score="7" Body="&lt;h2&gt;The Short Answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You should &lt;strong&gt;not&lt;/strong&gt; customize the &lt;code&gt;custom-theme-load-path&lt;/code&gt; variable in the &lt;em&gt;Customize&lt;/em&gt; interface.&lt;br&gt;&#xA;So call &lt;code&gt;M-x customize-variable RET custom-theme-load-path&lt;/code&gt; and ask&#xA;to erase customizations (and save changes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to configure a custom theme directory beyond that which&#xA;packages automatically add, customize the&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/custom-theme-directory&quot;&gt;&lt;code&gt;custom-theme-directory&lt;/code&gt;&lt;/a&gt;&#xA;variable instead. That is exactly what this variable is for.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;The Long Answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Any customizations made through the &lt;em&gt;Customize&lt;/em&gt; interface are&#xA;reapplied whenever a theme changes. That’s due to 2 reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Themes are not just about faces, they’re about variables too. &lt;/li&gt;&#xA;&lt;li&gt;And the user customizations should always supersede the&#xA;customizations applied by themes.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thus, whenever a new theme is applied, the user customizations must be&#xA;reapplied on top of it. Since your customization contains the&#xA;&lt;code&gt;custom-theme-load-path&lt;/code&gt; variable, themes are unable to add themselves&#xA;to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That’s probably why the &lt;code&gt;custom-theme-directory&lt;/code&gt; variable was created.&#xA;This one is safe to customize, because it’s only yours (themes won’t&#xA;touch it).&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-13T14:38:15.197" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2114" PostTypeId="2" ParentId="2107" CreationDate="2014-10-13T14:55:37.510" Score="11" Body="&lt;p&gt;That looks like a bug in &lt;code&gt;eshell&lt;/code&gt;, you should report it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; you can fix it by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice eshell-gather-process-output (before absolute-cmd (command args) act)&#xA;  (setq command (file-truename command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bottom-line, the problem is that tramp ends up constructing a remote command line of the form (I'm removing some escaping to make it clearer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd /home/rekado &amp;amp;&amp;amp; exec env PS1='/ssh:remote1:/home/rekado $' /ssh:remote1:/home/rekado/my-script.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is why you end up with that &quot;mysterious&quot; message about &lt;code&gt;env&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it needs to generate instead (and that's what's achieved by the command above) is something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd /home/rekado &amp;amp;&amp;amp; exec env PS1='/ssh:remote1:/home/rekado $' /home/rekado/my-script.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do believe the bug is on the eshell side though, since tramp has no way of knowing that &quot;/ssh:remote1:...&quot; is not a valid remote command (although if it was, we'd probably have a lot more problems with multi-hop tramp... but anyways). And eshell indeed does the sane thing when the command is explicitly a tramp path.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-13T14:55:37.510" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2115" PostTypeId="2" ParentId="95" CreationDate="2014-10-13T15:19:41.933" Score="1" Body="&lt;p&gt;As @JordonBiondo reported &lt;a href=&quot;https://emacs.stackexchange.com/a/2110/6&quot;&gt;here&lt;/a&gt; (this answer is a verbatim copy of his answer):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The procedure for reporting bugs, requesting features, and submitting pathces is outlined in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt; C-h &lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt;&lt;kbd&gt;Bugs&lt;/kbd&gt;&lt;kbd&gt;return&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or read online: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Bugs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Bugs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use &lt;code&gt;report-emacs-bug&lt;/code&gt; for bug reporting and feature requests&lt;/li&gt;&#xA;&lt;li&gt;ask the dev mailing list if you think your request requires more discussion&lt;/li&gt;&#xA;&lt;li&gt;check the existing bugs and search the mailing list to see if the topic has already been discussed and concluded upon&lt;/li&gt;&#xA;&lt;li&gt;read the manual for how to send patches&lt;/li&gt;&#xA;&lt;li&gt;subscribe to emacs-devel or even bug-gnu-emacs if you want to be more involved or informed about what is happening in emacs development.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also read &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/etc/CONTRIBUTE&quot; rel=&quot;nofollow noreferrer&quot;&gt;etc/CONTRIBUTE&lt;/a&gt; and &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/BUGS&quot; rel=&quot;nofollow noreferrer&quot;&gt;BUGS&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-10-13T15:19:41.933" CommentCount="5" CommunityOwnedDate="2014-10-13T18:18:54.913" ContentLicense="CC BY-SA 3.0" />
  <row Id="2116" PostTypeId="2" ParentId="2111" CreationDate="2014-10-13T15:26:44.297" Score="5" Body="&lt;p&gt;I'm having exactly the same issue, anything I try to fit gives me the same complaint. I stumbled across &lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-02/msg00161.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; though, which just says it's a bug in 24.3 and fixed in 24.4.&lt;/p&gt;&#xA;" OwnerUserId="692" LastEditorUserId="7" LastEditDate="2014-10-13T18:20:54.923" LastActivityDate="2014-10-13T18:20:54.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2117" PostTypeId="1" CreationDate="2014-10-13T18:59:08.070" Score="3" ViewCount="168" Body="&lt;p&gt;Is there an automated way to discover “well-known” packages related to a given file type, &lt;em&gt;e.g.&lt;/em&gt; &lt;code&gt;scala-mode2&lt;/code&gt; for Scala files, &lt;code&gt;rust-mode&lt;/code&gt; for Rust files, etc., and install them automatically when opening a file of that type for the first time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If several packages apply, the user could be prompted with a list of choices that she can then choose from if she so desires.&lt;/p&gt;&#xA;" OwnerUserId="724" LastEditorUserId="724" LastEditDate="2014-10-13T19:04:57.837" LastActivityDate="2014-10-13T19:21:13.707" Title="Is there a way to automatically install the relevant package when opening an unknown file type?" Tags="|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2118" PostTypeId="2" ParentId="2117" CreationDate="2014-10-13T19:21:13.707" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;noreferrer&quot;&gt;Emacs Prelude&lt;/a&gt; does this. The &lt;a href=&quot;https://github.com/bbatsov/prelude/blob/master/core/prelude-packages.el#L121&quot; rel=&quot;noreferrer&quot;&gt;relevant macro&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro prelude-auto-install (extension package mode)&#xA;  &quot;When file with EXTENSION is opened triggers auto-install of PACKAGE.&#xA;PACKAGE is installed only if not already present.  The file is opened in MODE.&quot;&#xA;  `(add-to-list 'auto-mode-alist&#xA;                `(,extension . (lambda ()&#xA;                                 (unless (package-installed-p ',package)&#xA;                                   (package-install ',package))&#xA;                                 (,mode)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-10-13T19:21:13.707" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2119" PostTypeId="1" CreationDate="2014-10-13T21:09:12.617" Score="6" ViewCount="1420" Body="&lt;p&gt;Is there a way to emulate Vim's folding of &lt;code&gt;.vimrc&lt;/code&gt; from Emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I believe most folding and hiding packages in Emacs rely on open and closing expressions. I am not sure of the internals of these, as I have not tried to learn this much Lisp as of yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Vim, folding seems to be calculated line-by-line, so the writing a function can be based on manipulating the previous fold level, as well as an absolute value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in a &lt;code&gt;.vimrc&lt;/code&gt; file, we can have both &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot; level 1 {{{&#xA;some code&#xA;&quot; level 2 {{{&#xA;some code &#xA;&quot; end of section }}}&#xA;&quot; end of section }}}&#xA;&quot; level 1 {{{&#xA;some code&#xA;&quot; end of section }}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(with pairs &lt;code&gt;{{{&lt;/code&gt; and &lt;code&gt;}}}&lt;/code&gt;) or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot; level 1 {{{1&#xA;some code&#xA;&quot; level 2 {{{2&#xA;some code&#xA;&quot; level 1 {{{1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(with &lt;code&gt;{{{n&lt;/code&gt;) as well as mixes of these; some recommend to use the absolute values for sectioning, and the relative folding for functions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So open and closing expressions seem to correspond with declaring &lt;em&gt;relative&lt;/em&gt; fold levels. Is there an existing way to declare &lt;em&gt;absolute&lt;/em&gt; fold levels in Emacs? Or can anyone point me in the right direction so I can know where to head when I tackle this on a hobby day? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Line by line function of buffer? Overlays? What is the underlying function for folding?) &lt;/p&gt;&#xA;" OwnerUserId="971" LastActivityDate="2014-10-14T17:08:08.847" Title="Absolute fold level in Emacs?" Tags="|code-folding|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2120" PostTypeId="1" AcceptedAnswerId="2128" CreationDate="2014-10-13T21:23:31.607" Score="8" ViewCount="1632" Body="&lt;p&gt;I'd like to insert (programmatically) some text right after the point (without moving it).  I came up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion (insert &quot;my text&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems to work.  Is it a good way to do what I want?  E.g., are there situations where this could break?  (Other than those where &lt;code&gt;insert&lt;/code&gt; would break anyway, like read-only buffers.)  Is it different from what would more experienced Elisp hackers do?&lt;/p&gt;&#xA;" OwnerUserId="642" LastEditorUserId="642" LastEditDate="2014-10-13T21:51:02.407" LastActivityDate="2014-10-14T19:53:28.820" Title="How to insert text after point?" Tags="|text-editing|point|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2121" PostTypeId="2" ParentId="1035" CreationDate="2014-10-13T22:48:28.180" Score="5" Body="&lt;p&gt;The org-mode function &lt;code&gt;org-clock-sum-today&lt;/code&gt; comes pretty close to doing what you want; I found it while digging around in &lt;code&gt;org-clock.el&lt;/code&gt;  One option would be to write a wrapper function around that, then add the wrapper function to your mode line.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun saintaardvark-org-clock-todays-total ()&#xA;  &quot;Display total minutes clocked into org-mode for today.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (set-buffer &quot;test.org&quot;)&#xA;    (format &quot; Today's total: %s &quot; (org-minutes-to-clocksum-string (org-clock-sum-today)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that, you can customize &lt;code&gt;mode-line-format&lt;/code&gt; and insert something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:eval&#xA;  (saintaardvark-org-clock-todays-total))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On my machine, that gives me a mode line like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/10DCg.png&quot; alt=&quot;Mode line showing &amp;quot;Total Time&amp;quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a couple things to note about this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html#Mode-Line-Data&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; for the &lt;code&gt;:eval&lt;/code&gt; form says &quot;Make sure this evaluation cannot load any files, as doing so could cause infinite recursion.&quot;  I presume this means it shouldn't load any other elisp files, and that a &lt;code&gt;save-excursion&lt;/code&gt; is okay...but I could be wrong about this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This does not turn off org-mode's own mode display.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You might want to suggest this feature (showing today's total) as an enhancement to the org-mode project.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This function assumes that everything is in one org file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Up until relatively recently, I &lt;em&gt;think&lt;/em&gt; there was a bug in org-clock-sum-today; it takes &lt;code&gt;headline-filter&lt;/code&gt; as an argument (which would allow you to get total time by subtree), but did not actually use it.  This &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-clock.el#n1729&quot; rel=&quot;noreferrer&quot;&gt;appears to be fixed&lt;/a&gt; in HEAD in the Git repo, but is not in the latest released version (8.2.10).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="291" LastActivityDate="2014-10-13T22:48:28.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2122" PostTypeId="2" ParentId="2120" CreationDate="2014-10-13T23:34:34.410" Score="7" Body="&lt;p&gt;Yes, that is the most idiomatic way of inserting text after point that I know of. &lt;code&gt;save-excursion&lt;/code&gt; is very resilient to changes in the buffer, so it is the preferred way to do destructive editing. The only place you're likely to run into issues is where you would have issues with &lt;code&gt;insert&lt;/code&gt; itself, such as buffers where some text is read-only.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-10-14T19:53:28.820" LastActivityDate="2014-10-14T19:53:28.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2123" PostTypeId="1" AcceptedAnswerId="2125" CreationDate="2014-10-13T23:36:14.813" Score="10" ViewCount="645" Body="&lt;p&gt;I often have many &lt;code&gt;dired&lt;/code&gt; buffers open, including some for folders that have identical names. Occasionally, this causes me to switch to the wrong one, so I am looking for a way to fix this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, if I have multiple identically-named folders open in &lt;code&gt;dired&lt;/code&gt;, then my buffer list looks something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo&#xA;foo&amp;lt;2&amp;gt;&#xA;bar&#xA;foo&amp;lt;3&amp;gt;&#xA;bar&amp;lt;2&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to include the full path (or some portion of it) in the buffer name so I can see which folder I am actually switching to. I would prefer to do it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo&amp;lt;/full/path/to/foo&amp;gt;&#xA;foo&amp;lt;/another/path&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and so on. I could also settle for e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/full/path/to/foo&#xA;/another/path/foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I would prefer the former, because it will usually be easier to find the buffer I want by folder name first, and full path second. How can this be done?&lt;/p&gt;&#xA;" OwnerUserId="675" LastActivityDate="2015-10-09T11:43:23.277" Title="How can I make Dired buffer names include the full path?" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2124" PostTypeId="1" CreationDate="2014-10-13T23:36:49.183" Score="5" ViewCount="849" Body="&lt;p&gt;I know I can get case-insensitive filename completion in the minibuffer using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Completion-Options.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;read-file-name-completion-ignore-case&lt;/code&gt;&lt;/a&gt;, but this doesn't seem to apply to &lt;em&gt;all&lt;/em&gt; filename completion in the minibuffer.  Specifically, it doesn't seem to apply when I'm using &lt;code&gt;shell-command&lt;/code&gt;. Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q&#xA;M-: (setq read-file-name-completion-ignore-case t)&#xA;M-! touch /tmp/HelloThere&#xA;C-x C-f /tmp/hello&amp;lt;TAB&amp;gt;  &amp;lt;-- this completes to HelloThere, as expected&#xA;M-! shell-command&amp;lt;RET&amp;gt;ls /tmp/Hello&amp;lt;TAB&amp;gt;  &amp;lt;-- this completes to HelloThere, as expected&#xA;C-g&#xA;M-! shell-command&amp;lt;RET&amp;gt;ls /tmp/hello&amp;lt;TAB&amp;gt;   &amp;lt;-- no completion&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to get whatever is completing &lt;code&gt;/tmp/HelloThere&lt;/code&gt; while reading from the minibuffer for a &lt;code&gt;shell-command&lt;/code&gt; to respect &lt;code&gt;read-file-name-completion-ignore-case&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="573" LastEditorUserId="573" LastEditDate="2014-10-14T03:51:47.627" LastActivityDate="2014-10-14T03:51:47.627" Title="Case-insensitive filename completion in `shell-command'" Tags="|minibuffer|completion|case-folding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2125" PostTypeId="2" ParentId="2123" CreationDate="2014-10-13T23:54:15.633" Score="8" Body="&lt;p&gt;You can get this behavior by using &lt;code&gt;uniquify&lt;/code&gt; with the following settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'uniquify)&#xA;(setq uniquify-buffer-name-style 'post-forward-angle-brackets&#xA;      uniquify-min-dir-content 999)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note however that uniquify works globally, not only on dired buffers.&lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="5187" LastEditDate="2015-10-09T11:43:23.277" LastActivityDate="2015-10-09T11:43:23.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2126" PostTypeId="1" AcceptedAnswerId="2133" CreationDate="2014-10-14T00:39:15.650" Score="10" ViewCount="334" Body="&lt;p&gt;I'm extending an existing Emacs package and I want to make a part of the buffer not editable (read only).  In fact, I want to make only one line in the middle of the buffer editable and I use the following snippet for achieving that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-text-property (point-min) point-before-editable-text 'read-only t)&#xA;;; (put-text-property point-after-editable-text (point-max) 'read-only t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I can still put cursor at the beginning of buffer and insert some text which is not the desired behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent insertions at the beginning of the buffer?&lt;/p&gt;&#xA;" OwnerUserId="336" LastEditorUserId="105" LastEditDate="2015-05-20T04:33:38.090" LastActivityDate="2015-05-20T04:33:38.090" Title="Prevent inserting text at the beginning of a buffer that starts with read-only text" Tags="|elisp|text-editing|text-properties|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2127" PostTypeId="2" ParentId="2124" CreationDate="2014-10-14T00:43:20.720" Score="-1" Body="&lt;p&gt;Bind &lt;code&gt;tags-case-fold-search&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in a function that otherwise just calls &lt;code&gt;tags-completion-at-point-function&lt;/code&gt;, and put that function on &lt;code&gt;completion-at-point-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem you are running into is that &lt;code&gt;read-file-name-completion-ignore-case&lt;/code&gt; is not used, and that is because &lt;code&gt;read-file-name&lt;/code&gt; is not used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Alternatively, you can bind &lt;code&gt;tags-case-fold-search&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt; and non-&lt;code&gt;t&lt;/code&gt;, and bind &lt;code&gt;case-fold-search&lt;/code&gt; to non-nil.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-14T00:43:20.720" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2128" PostTypeId="2" ParentId="2120" CreationDate="2014-10-14T00:47:31.983" Score="7" Body="&lt;p&gt;A very common example of this behavior is &lt;code&gt;electric-pair-mode&lt;/code&gt; in the Emacs standard library.  If you've never used this mode before, then (quoting from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Matching.html&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Whenever you insert an opening delimiter, the matching closing delimiter is automatically inserted as well, leaving point between the two.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can check out the code for &lt;code&gt;electric-pair-post-self-insert-function&lt;/code&gt; to see how it accomplishes the insertion.  Spoiler:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun electric-pair-post-self-insert-function ()&#xA;  [lots of cond logic to decide if it's time to insert a matching closer]&#xA;      (save-excursion (insert closer)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-10-14T00:47:31.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2129" PostTypeId="1" AcceptedAnswerId="2158" CreationDate="2014-10-14T00:48:31.440" Score="32" ViewCount="2238" Body="&lt;p&gt;While reading through the source code for the &lt;code&gt;dolist&lt;/code&gt; macro, I ran into the following comment.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;;; This is not a reliable test, but it does not matter because both semantics are acceptable, tho one is slightly faster with dynamic scoping and &lt;strong&gt;the other is slightly faster (and has cleaner semantics) with lexical scoping&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which referred to this snippet (which I've simplified for clarity).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if lexical-binding&#xA;    (let ((temp list))&#xA;      (while temp&#xA;        (let ((it (car temp)))&#xA;          ;; Body goes here&#xA;          (setq temp (cdr temp)))))&#xA;  (let ((temp list)&#xA;        it)&#xA;    (while temp&#xA;      (setq it (car temp))&#xA;      ;; Body goes here&#xA;      (setq temp (cdr temp)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It surprised me to see a &lt;code&gt;let&lt;/code&gt; form being used inside a loop. I used to think that's slow compared to repeatedly using &lt;code&gt;setq&lt;/code&gt; on the same external variable (as is done on the second case above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have dismissed that as nothing, if not for the comment immediately above it explicitly saying that's faster than the alternative (with lexical binding). So... Why is that? &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why does the code above differ in performance on lexical vs dynamic binding?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why is the &lt;code&gt;let&lt;/code&gt; form faster with lexical?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastEditorUserId="25" LastEditDate="2014-11-15T23:39:51.830" LastActivityDate="2020-05-30T13:51:38.620" Title="Why is `let' faster with lexical scope?" Tags="|elisp|performance|lexical-scoping|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2131" PostTypeId="2" ParentId="2081" CreationDate="2014-10-14T01:49:01.760" Score="0" Body="&lt;p&gt;I found in my &lt;code&gt;.emacs&lt;/code&gt; the following function which does work as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun kill-back-to-indentation ()&#xA;  &quot;Kill from point back to the first non-whitespace character on the line.&quot;&#xA;  (interactive)&#xA;  (let ((prev-pos (point)))&#xA;    (back-to-indentation)&#xA;    (kill-region (point) prev-pos)))&#xA;&#xA;(global-set-key (kbd &quot;C-M-&amp;lt;backspace&amp;gt;&quot;) 'kill-back-to-indentation)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yes, this function is not ido-specific but rather for general purposes.&lt;/p&gt;&#xA;" OwnerUserId="336" LastActivityDate="2014-10-14T01:49:01.760" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2132" PostTypeId="2" ParentId="812" CreationDate="2014-10-14T02:27:57.900" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;Many interactive commands read minibuffer input.  &lt;code&gt;find-file&lt;/code&gt; is one such&#xA;command.  Reading minibuffer input &quot;activates&quot; the minibuffer window, which&#xA;is why you can switch to it with the &lt;code&gt;other-window&lt;/code&gt; command.  Interactive&#xA;&lt;code&gt;isearch&lt;/code&gt; is special because it's implemented as a minor mode.  It doesn't&#xA;technically read your search string from the minibuffer, but instead&#xA;catches your keypresses as you type and echoes them to the minibuffer with&#xA;&lt;code&gt;message&lt;/code&gt;.  This is why you see &lt;code&gt;other-window&lt;/code&gt; behaving differently.&lt;/li&gt;&#xA;&lt;li&gt;This may or may not help you, but technically you can modify the prompt&#xA;behavior of &lt;code&gt;find-file&lt;/code&gt; by modifying the function stored in&#xA;&lt;code&gt;read-file-name-function&lt;/code&gt;.  I haven't tried advising the function based on&#xA;@kaushalmodi's answer, but if that works I'll update this.&lt;/li&gt;&#xA;&lt;li&gt;I can't speak for any of the hackers who worked on the code in&#xA;minibuffer.el, but from the following description in the&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-Edit.html&quot;&gt;manual&lt;/a&gt;  I'd guess the behavior is designed to let you kill-and-yank text:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When the minibuffer is active, the echo area is treated much like an&#xA;  ordinary Emacs window. For instance, you can switch to another window (with&#xA;  C-x o), edit text there, then return to the minibuffer window to finish the&#xA;  argument. You can even kill text in another window, return to the minibuffer&#xA;  window, and yank the text into the argument.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-10-14T02:27:57.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2133" PostTypeId="2" ParentId="2126" CreationDate="2014-10-14T02:28:34.627" Score="10" Body="&lt;p&gt;You need to (before adding property &lt;code&gt;read-only&lt;/code&gt;), make the first character have a value that includes &lt;code&gt;read-only&lt;/code&gt; for property &lt;code&gt;front-sticky&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-text-property 1 2 'front-sticky '(read-only)) ; Do this one first.&#xA;(put-text-property (point-min) 50 'read-only t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sticky-Properties.html&quot;&gt;&lt;code&gt;Sticky Properties&lt;/code&gt;&lt;/a&gt;.&#xA;The problem was that although the first char had a non-&lt;code&gt;nil&lt;/code&gt; property &lt;code&gt;read-only&lt;/code&gt;, insertion before it did not inherit that property, because &lt;code&gt;read-only&lt;/code&gt; was not a &lt;code&gt;front-sticky&lt;/code&gt; property value for the first character.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="115" LastEditDate="2014-10-14T03:35:51.637" LastActivityDate="2014-10-14T03:35:51.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2134" PostTypeId="1" CreationDate="2014-10-14T02:36:17.067" Score="8" ViewCount="249" Body="&lt;p&gt;There is a mode for emacs-lisp buffers which allows one to display the value of each  expression line by line, and updates the value of the expressions as soon as these are edited.  It looks something like: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(+ 1 1) -&gt; 2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(* 2 3) -&gt; 6&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the name of this mode?  I have seen it in action and used it but I have forgotten how it is invoked. &lt;/p&gt;&#xA;" OwnerUserId="2022" LastActivityDate="2014-10-14T08:49:53.147" Title="What is the mode for displaying auto-updating values of s-expressions in an emacs-lisp buffer?" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2135" PostTypeId="2" ParentId="2134" CreationDate="2014-10-14T02:46:48.510" Score="11" Body="&lt;p&gt;I think you're looking for &lt;a href=&quot;https://github.com/Fuco1/litable&quot;&gt;litable&lt;/a&gt;, which is a reimplementation of the corresponding LightTable feature.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-14T02:46:48.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2136" PostTypeId="2" ParentId="2134" CreationDate="2014-10-14T02:48:54.770" Score="7" Body="&lt;p&gt;I think you are referring to &lt;a href=&quot;http://www.emacswiki.org/lively.el&quot;&gt;lively.el&lt;/a&gt;. Download the file, load it into Emacs and execute with &lt;code&gt;M-x lively&lt;/code&gt; on the file. You will see this information periodically updated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;   Current time:      (current-time-string)&#xA;;;;   Last command:      last-command&#xA;;;;   Open buffers:      (length (buffer-list))&#xA;;;;   Unix processes:    (lively-shell-command &quot;ps -a | wc -l&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-10-14T03:25:18.180" LastActivityDate="2014-10-14T03:25:18.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2137" PostTypeId="1" CreationDate="2014-10-14T03:25:41.987" Score="6" ViewCount="1732" Body="&lt;p&gt;Similar to Visual Studio, when working with Rust programs, I'd like to press &lt;em&gt;F5&lt;/em&gt; to save the current file, compile it, and run it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a good way to do this?&lt;/p&gt;&#xA;" OwnerUserId="163" LastEditorUserId="50" LastEditDate="2014-10-14T14:36:16.380" LastActivityDate="2014-10-14T14:36:16.380" Title="Press F5 to save, compile, and run current rust file" Tags="|elisp|key-bindings|compilation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2138" PostTypeId="2" ParentId="2137" CreationDate="2014-10-14T03:26:35.090" Score="6" Body="&lt;p&gt;Below is one approach for Windows. If you're in a rust project, it'll run &lt;code&gt;cargo run&lt;/code&gt;. Otherwise, it'll use &lt;code&gt;rustc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rust-save-compile-and-run ()&#xA;  (interactive)&#xA;  (save-buffer)&#xA;&#xA;  (if (locate-dominating-file (buffer-file-name) &quot;Cargo.toml&quot;)&#xA;&#xA;      (compile &quot;cargo run&quot;)&#xA;&#xA;    (compile&#xA;     (format &quot;rustc %s &amp;amp; %s&quot;&#xA;         (buffer-file-name)&#xA;         (file-name-sans-extension (buffer-file-name))))))&#xA;&#xA;(add-hook 'rust-mode-hook&#xA;      (lambda ()&#xA;        (define-key rust-mode-map (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'rust-save-compile-and-run)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="163" LastEditorUserId="163" LastEditDate="2014-10-14T14:30:03.860" LastActivityDate="2014-10-14T14:30:03.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2139" PostTypeId="2" ParentId="2137" CreationDate="2014-10-14T03:33:03.637" Score="5" Body="&lt;p&gt;Here my version of &lt;code&gt;compile&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) (lambda ()&#xA;                               (interactive)&#xA;                               (save-buffer)&#xA;                               (setq-local compilation-read-command nil)&#xA;                               (call-interactively 'compile)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically it reuses previously executed &lt;code&gt;compile&lt;/code&gt; command; if you supply with a prefix argument, you are prompted for a new &lt;code&gt;compile&lt;/code&gt; command for future reuse.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-14T03:33:03.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2140" PostTypeId="1" CreationDate="2014-10-14T03:34:04.543" Score="15" ViewCount="1599" Body="&lt;p&gt;There are times when I'm editing files (Puppet manifests, for example) where I want to align buffer contents on the fly.  For example, I know that I can use &lt;code&gt;align-regexp&lt;/code&gt; or &lt;code&gt;align&lt;/code&gt; to align code like this, as long as I have it selected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# M-x align-regexp &quot;=&amp;gt;&quot; will line everything up nicely &#xA;file { &quot;/etc/foo&quot;:&#xA;  ensure =&amp;gt; present,&#xA;  mode =&amp;gt; &quot;0666&quot;,&#xA;  source =&amp;gt; &quot;puppet:///modules/example/foo&quot;,&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what I really want is to have this happen &lt;em&gt;on the fly&lt;/em&gt; -- without having to select a region or the whole buffer.  Is there a package or mode that will do this, or is this something that would have to be built in to the mode I'm interested in?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I asked about Puppet and CFEngine, since that's what I code in most these days and I have a strong preference for aligned text.  However,  I was also curious (and did not express this well) to know if on-the-fly alignment is a feature that's common in Emacs modes (mainly in modes for programming languages), or if most people align when saving or at some other point.&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="291" LastEditDate="2014-10-15T13:19:36.537" LastActivityDate="2014-10-15T13:53:36.720" Title="Is there an auto-align package or mode for Emacs?" Tags="|align|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2143" PostTypeId="2" ParentId="2129" CreationDate="2014-10-14T08:38:24.433" Score="3" Body="&lt;p&gt;This comment does not suggest that lexical binding is either faster or slower than dynamic binding. Rather, it suggests that those different forms have different performance characteristics under lexical and dynamic binding, eg, one of them is preferable under one binding discipline, and the other preferable in the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;em&gt;is&lt;/em&gt; lexical scope faster than dynamic scope? I suspect that in this case that there isn't much difference, but I don't know - you'd really have to measure it.&lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="913" LastEditDate="2014-10-14T17:52:59.883" LastActivityDate="2014-10-14T17:52:59.883" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2145" PostTypeId="2" ParentId="2119" CreationDate="2014-10-14T09:41:54.480" Score="5" Body="&lt;pre&gt;&lt;code&gt;(add-hook '???-mode-hook&#xA;          (lambda ()&#xA;            (setq-local orgstruct-heading-prefix-regexp &quot;\\s-*/// &quot;)&#xA;            (turn-on-orgstruct)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace &lt;code&gt;???&lt;/code&gt; with the name of the mode, where you want this to happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will use &lt;code&gt;///&lt;/code&gt; as an indication of the beginning of the sub-tree, which can be folded. The number of &lt;code&gt;*&lt;/code&gt; characters following the &lt;code&gt;///&lt;/code&gt; will indicate how deep this sub-tree should be nested. Some more info here: &lt;a href=&quot;http://orgmode.org/manual/Orgstruct-mode.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Orgstruct-mode.html&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure whether it's possible to use numbers rather than asterisks to tell the orgstruct mode how deep it should nest the section, but that would be most probably possible with slight modification of Org's code, if that was absolutely necessary.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2014-10-14T12:34:16.543" LastActivityDate="2014-10-14T12:34:16.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2146" PostTypeId="1" AcceptedAnswerId="2148" CreationDate="2014-10-14T10:09:04.967" Score="5" ViewCount="1007" Body="&lt;p&gt;After each reboot, I have to painfully re-create and rename the&#xA;&lt;code&gt;multi-term&lt;/code&gt; buffers I use in my daily routine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am completely new to Lisp, but nonetheless, I searched for similar problem on the web and tried to adapt the code snippets I've found. I managed to open a &lt;code&gt;multi-term&lt;/code&gt; buffer, but renaming does not work as expected. Here is what I've tried so far in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'multi-term)&#xA;(setq multi-term-program &quot;/bin/bash&quot;)&#xA;;; Try to recreate my terminals&#xA;(add-hook 'emacs-startup-hook 'multi-term)&#xA;(add-hook 'emacs-startup-hook 'get-buffer)&#xA;(rename-buffer &quot;redshift&quot;)  ;; it renames the previous buffer (not the good one)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a bonus, I would also like to be able to &lt;code&gt;cd&lt;/code&gt; to a specific directory. Thanks for your advice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I work on GNU Emacs 23.4.1 (Debian stable).&lt;/p&gt;&#xA;" OwnerUserId="2015" LastActivityDate="2014-10-14T13:40:26.147" Title="How to open and rename several multi-term buffers on start-up?" Tags="|buffers|init-file|term|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2147" PostTypeId="2" ParentId="2146" CreationDate="2014-10-14T10:58:42.050" Score="3" Body="&lt;p&gt;Technical explanation: that's because &lt;code&gt;emacs-startup-hook&lt;/code&gt; is run &lt;em&gt;after&lt;/em&gt; the init file is processed, therefore your call to &lt;code&gt;multi-term&lt;/code&gt; is run after you do the rename operation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you don't need &lt;code&gt;emacs-startup-hook&lt;/code&gt; at all, what you really want is to run those things in sequence, right from your init file. And you don't need to call &lt;code&gt;get-buffer&lt;/code&gt; (which needs a buffer argument anyway, so that'd never work), since multi-term will display the buffer it creates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, try something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'multi-term)&#xA;(setq multi-term-program &quot;/bin/bash&quot;)&#xA;(multi-term)&#xA;(rename-buffer &quot;redshift&quot;)&#xA;(multi-term)&#xA;(rename-buffer &quot;foo&quot;)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or better yet&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc (lambda (name)&#xA;        (multi-term)&#xA;        (rename-buffer name))&#xA;      '(&quot;redshift&quot; &quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-14T10:58:42.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2148" PostTypeId="2" ParentId="2146" CreationDate="2014-10-14T11:06:40.330" Score="4" Body="&lt;p&gt;Such initialization might (I guess) looks like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(require 'multi-term)&#xA;&#xA;(defun init-multi-term (new-name dir)&#xA;  (let ((mt-buffer-name &quot;*terminal*&quot;))&#xA;    (multi-term)&#xA;    (comint-send-string (get-buffer-process mt-buffer-name) (format &quot;cd %s\n&quot; dir))&#xA;    (with-current-buffer mt-buffer-name&#xA;      (rename-buffer new-name))))&#xA;&#xA;(defun init-multi-terms ()&#xA;  (interactive)&#xA;  (init-multi-term &quot;Downloads&quot; &quot;/home/demi/Downloads/&quot;)&#xA;  (init-multi-term &quot;Github&quot; &quot;/str/development/&quot;))&#xA;&#xA;(setq multi-term-program &quot;/bin/bash&quot;)&#xA;(add-hook 'emacs-startup-hook 'init-multi-terms)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just tested it and it works fine for me. &lt;code&gt;cd&lt;/code&gt; works as well.&lt;/p&gt;&#xA;" OwnerUserId="336" LastEditorUserId="336" LastEditDate="2014-10-14T11:13:05.293" LastActivityDate="2014-10-14T11:13:05.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2150" PostTypeId="1" AcceptedAnswerId="2155" CreationDate="2014-10-14T13:31:16.250" Score="7" ViewCount="1189" Body="&lt;p&gt;I used to have a keyboard shortcut for the following action:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Open the folder containing this file in Dired+, and place point (cursor) on the file&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I believe it was &lt;code&gt;C-x C-j&lt;/code&gt;, and I don't recall setting it up manually. It seems to be gone. Did recent changes to Dired+ perhaps change this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either way, are there any Dired or Dired+ built-in interactive functions that I could use for this? If not, how can I go about building one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can run &lt;code&gt;M-x dired-jump&lt;/code&gt;. The problem seems to be that the keybinding is gone.&#xA;When I do &lt;code&gt;C-h k C-x C-j RET&lt;/code&gt;, I see &lt;code&gt;C-x C-j RET (translated from C-x C-j &amp;lt;return&amp;gt;) is undefined&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="25" LastEditDate="2014-10-14T14:20:52.167" LastActivityDate="2020-08-25T12:26:42.403" Title="The C-x C-j binding for dired-jump stopped working" Tags="|dired|key-bindings|" AnswerCount="5" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2151" PostTypeId="2" ParentId="2150" CreationDate="2014-10-14T13:33:31.783" Score="1" Body="&lt;p&gt;I use this regularly.  Just tested it with &lt;code&gt;emacs -Q&lt;/code&gt;, this is all you need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The functionality is provided by &lt;code&gt;dired-x&lt;/code&gt;, which is different from &lt;code&gt;dired+&lt;/code&gt;.  The former is shipped with core Emacs, the latter is a 3rd party extension library.&lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="330" LastEditDate="2014-10-14T13:40:18.680" LastActivityDate="2014-10-14T13:40:18.680" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2152" PostTypeId="2" ParentId="2150" CreationDate="2014-10-14T13:38:57.080" Score="2" Body="&lt;p&gt;What do you see when you do &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-j&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should see that it is bound to &lt;code&gt;dired-jump&lt;/code&gt;. If it's not then you either haven't done &lt;code&gt;require&lt;/code&gt; of &lt;code&gt;dired-x&lt;/code&gt; or you/some other package overrode that binding with something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can do &lt;code&gt;M-x dired-jump&lt;/code&gt; and just need that binding, then you can do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-j&quot;) 'dired-jump)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if &lt;code&gt;dired-bind-jump&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt; and if you have &lt;code&gt;(require 'dired-x)&lt;/code&gt;, then that package will set that binding for you.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-14T13:56:46.977" LastActivityDate="2014-10-14T13:56:46.977" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2153" PostTypeId="2" ParentId="2146" CreationDate="2014-10-14T13:40:26.147" Score="1" Body="&lt;p&gt;You may want to look at &lt;a href=&quot;https://github.com/pashinin/workgroups2&quot; rel=&quot;nofollow&quot;&gt;Workgroups2&lt;/a&gt;, which is available via &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_package_system.html&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;.  Although I haven't tried it with Multi-Term (thanks for the pointer, I'd never heard of it!), I'm quite happy with it for saving buffer state between Emacs sessions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If workgroups2 doesn't work for you, there are pointers to other packages that manage workspaces &lt;a href=&quot;https://stackoverflow.com/questions/11263960/what-is-the-best-emacs-workspaces-plugin&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="291" LastActivityDate="2014-10-14T13:40:26.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2154" PostTypeId="2" ParentId="2123" CreationDate="2014-10-14T14:31:20.060" Score="6" Body="&lt;p&gt;In my .emacs I set full paths for Dired buffers this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'dired-after-readin-hook&#xA;      (lambda ()&#xA;        ;; Set name of dired buffers to absolute directory name.&#xA;        ;; Use `generate-new-buffer-name' for vc-directory&#xA;        ;; which creates duplicate buffers.&#xA;        (rename-buffer (generate-new-buffer-name dired-directory))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="478" LastActivityDate="2014-10-14T14:31:20.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2155" PostTypeId="2" ParentId="2150" CreationDate="2014-10-14T14:35:18.470" Score="8" Body="&lt;h2&gt;The Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;jabber.el&lt;/code&gt; and &lt;code&gt;dired-x&lt;/code&gt; unfortunately conflict on this keybind.&#xA;Jabber uses &lt;code&gt;C-x C-j&lt;/code&gt; as the prefix for all its keys, while dired&#xA;sets it to your beloved &lt;code&gt;dired-jump&lt;/code&gt; (that’s probably why the latter&#xA;is made optional through the &lt;code&gt;dired-bind-jump&lt;/code&gt; variable).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do complicate things further, if Jabber is installed with &lt;code&gt;package.el&lt;/code&gt;&#xA;it binds this key twice! First on Emacs startup, then upon loading&#xA;&lt;code&gt;jabber.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Bind &lt;code&gt;dired-jump&lt;/code&gt; both before and after Jabber has been loaded. Make&#xA;sure this happens after &lt;code&gt;(package-initialize)&lt;/code&gt; in your init file&#xA;(if you use it).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-j&quot;) #'dired-jump)&#xA;(eval-after-load 'jabber-keymap&#xA;  '(global-set-key (kbd &quot;C-x C-j&quot;) #'dired-jump))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, if you’re using Emacs 24.4, the following is slightly preferred:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-j&quot;) #'dired-jump)&#xA;(with-eval-after-load 'jabber-keymap&#xA;  (global-set-key (kbd &quot;C-x C-j&quot;) #'dired-jump))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To continue using the jabber keymap, you can bind it to a different key sequence, as in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c C-j&quot;) jabber-global-keymap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="3853" LastEditDate="2014-12-11T20:24:14.533" LastActivityDate="2014-12-11T20:24:14.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2156" PostTypeId="2" ParentId="2150" CreationDate="2014-10-14T14:39:48.760" Score="4" Body="&lt;p&gt;As others have already noted, you're thinking of the function &lt;code&gt;dired-jump&lt;/code&gt;, which is provided by Dired-x (not Dired+), and is bound to &lt;code&gt;C-x C-j&lt;/code&gt; when the Dired-x library is loaded. (You can turn off this binding by setting &lt;code&gt;dired-bind-jump&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; before Dired-x is loaded.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that &lt;code&gt;C-x C-j&lt;/code&gt; does something, rather than complaining that &lt;code&gt;C-x C-j&lt;/code&gt; is undefined, what's happening is that something else has defined a binding for it. Whoever defined the binding last wins.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you need to track down what other package that you're loading is overriding &lt;code&gt;C-x C-j&lt;/code&gt;. That package is loaded after Dired-x, so if you're loading &lt;code&gt;dired-x&lt;/code&gt; in your init file, it's either something that you're loading further on or something that gets autoloaded at some point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;C-x C-j&lt;/code&gt; doesn't do anything on its own, but waits for another key to be pressed, it's a prefix key. Press &lt;code&gt;C-x C-j C-h&lt;/code&gt; to see a list of bindings that start with this prefix. This should give you a good idea of the culprit package.&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/2150/open-the-folder-containing-this-file-in-dired-and-place-point-on-the-file#comment2697_2150&quot;&gt;Malabarba's hypothesis&lt;/a&gt; that it's Jabber mode is a plausible one. Once you've identified a key sequence that starts with the prefix &lt;code&gt;C-x C-j&lt;/code&gt;, press &lt;code&gt;C-h k&lt;/code&gt; followed by that key sequence. This will show the help text for that command and the package that provides the command. It's likely that the package that provides the command is the same package that defines the binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's unlikely that you'll need to go that far, but just in case, if there's some key binding you can't track down, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/653/how-can-i-find-out-in-which-keymap-a-key-is-bound/654#654&quot;&gt;How can I find out in which keymap a key is bound?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to load that package that overrides &lt;code&gt;C-x C-j&lt;/code&gt;, but you don't want it to take over that binding, see if it has an option to skip that binding. If it doesn't, you can snatch the binding back: arrange to run &lt;code&gt;(global-set-key &quot;\C-x\C-j&quot; 'dired-jump)&lt;/code&gt; after the offending package is loaded. It may be enough to put that at the end of your init file. If not, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(eval-after-load &quot;&lt;em&gt;NAME-OF-THE-OFFENDING-PACKAGE&lt;/em&gt;&quot; '(global-set-key &quot;\C-x\C-j&quot; 'dired-jump))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2018-12-24T18:52:14.813" LastActivityDate="2018-12-24T18:52:14.813" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2157" PostTypeId="2" ParentId="711" CreationDate="2014-10-14T14:44:18.707" Score="3" Body="&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Totally didn't read all the comments on the answer. Looks like the &lt;code&gt;subfiles&lt;/code&gt; LaTeX package might be a cleaner way. Leaving this here because options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is not a built-in way to do this. After a bit of elisp hacking, I came up with this solution:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun TeX-compile-all-chapters-from-master (cmd prefix)&#xA;  &quot;Compile chapters using `CMD' with prefix `PREFIX'.&#xA;&#xA;Each \include{foo} will be processed by running `CMD' formatted with args `PREFIX', `NAME' (foo in this example) and `TMP-FILE-NAME'.&quot;&#xA;  (let ((text (buffer-string)))&#xA;    (save-excursion&#xA;      (goto-char 0)&#xA;      (while (search-forward-regexp &quot;\\(include\\){\\(.+\\)}&quot; (buffer-size) t)&#xA;        (let* ((name (match-string 2))&#xA;               (tmp-file-name (concat &quot;/tmp/tex-compile-all-&quot; name))&#xA;               (incl-end (match-end 1)))&#xA;          (with-temp-file tmp-file-name&#xA;            (insert text)&#xA;            (goto-char incl-end)&#xA;            (insert &quot;only&quot;))&#xA;          (TeX-run-compile nil (format cmd prefix name tmp-file-name) nil)&#xA;          (delete-file tmp-file-name))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example usage:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(TeX-compile-all-chapters-from-master &quot;pdflatex -jobname %s_%s %s&quot; &quot;Master&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To bind this to a key, use &lt;code&gt;define-key&lt;/code&gt; and either a &lt;code&gt;lambda&lt;/code&gt; containing the above or &lt;code&gt;apply-partially&lt;/code&gt;.&#xA;&lt;em&gt;Note to ELispers:&lt;/em&gt; Fairly sure my code isn't idiomatic in several areas (&lt;code&gt;(insert text)&lt;/code&gt;, tmp file name generation). Please help.&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2014-10-14T14:44:18.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2158" PostTypeId="2" ParentId="2129" CreationDate="2014-10-14T15:28:02.043" Score="40" Body="&lt;h1&gt;Lexical binding versus dynamic binding in general&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Consider the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((lexical-binding nil))&#xA;  (disassemble&#xA;   (byte-compile '(lambda ()&#xA;                    (let ((foo 10))&#xA;                      (message foo)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It compiles and immediately disassembles a simple &lt;code&gt;lambda&lt;/code&gt; with a local variable.  With &lt;code&gt;lexical-binding&lt;/code&gt; disabled, as above, the byte code looks as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0       constant  10&#xA;1       varbind   foo&#xA;2       constant  message&#xA;3       varref    foo&#xA;4       call      1&#xA;5       unbind    1&#xA;6       return    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the &lt;code&gt;varbind&lt;/code&gt; and &lt;code&gt;varref&lt;/code&gt; instructions.  These instructions bind and lookup respectively variables &lt;strong&gt;by their name&lt;/strong&gt; in a &lt;strong&gt;global&lt;/strong&gt; binding environment on &lt;strong&gt;heap memory&lt;/strong&gt;.  All this has an adverse effect on performance:  It involves &lt;strong&gt;string hashing and comparison&lt;/strong&gt;, &lt;strong&gt;synchronisation&lt;/strong&gt; for global data access, and repeated &lt;strong&gt;heap memory access&lt;/strong&gt; which plays badly with CPU caching.  Also, dynamic variable bindings need to be &lt;strong&gt;restored&lt;/strong&gt; to their previous variable at the end of &lt;code&gt;let&lt;/code&gt;, which adds &lt;code&gt;n&lt;/code&gt; additional lookups for each &lt;code&gt;let&lt;/code&gt; block with &lt;code&gt;n&lt;/code&gt; bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you bind &lt;code&gt;lexical-binding&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in the above example, the byte code looks somewhat different:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0       constant  10&#xA;1       constant  message&#xA;2       stack-ref 1&#xA;3       call      1&#xA;4       return    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;varbind&lt;/code&gt; and &lt;code&gt;varref&lt;/code&gt; are entirely gone.  The local variable is simply pushed onto the stack, and referred to by a constant offset via the &lt;code&gt;stack-ref&lt;/code&gt; instruction.  Essentially, the variable is bound and read with &lt;strong&gt;constant time&lt;/strong&gt;, &lt;strong&gt;in-stack memory reads&lt;/strong&gt; and writes, which is entirely local and thus &lt;strong&gt;plays well with concurrency and CPU caching&lt;/strong&gt;, and does not involve any strings at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, with lexical binding lookups of local variables (e.g. &lt;code&gt;let&lt;/code&gt;, &lt;code&gt;setq&lt;/code&gt;, etc.) have &lt;strong&gt;much less runtime and memory complexity&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;This specific example&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;With dynamical binding, each let incurs a performance penalty, for above reasons.  The more lets, the more dynamic variable bindings.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notably, with an additional &lt;code&gt;let&lt;/code&gt; within the &lt;code&gt;loop&lt;/code&gt; body, the bound variable would need to be restored at &lt;strong&gt;every iteration of the loop&lt;/strong&gt;, adding an &lt;strong&gt;additional variable lookup to each iteration&lt;/strong&gt;.  Hence, it's faster to keep the let out of the loop body, so that the iteration variable is only reset &lt;strong&gt;once&lt;/strong&gt;, after the whole loop finished.  However, this is not particularly elegant, since the iteration variable is bound way before it's actually required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With lexical binding, &lt;code&gt;let&lt;/code&gt;s are cheap.  Notably, a &lt;code&gt;let&lt;/code&gt; within a loop body is not worse (performance-wise) than a &lt;code&gt;let&lt;/code&gt; outside of a loop body.  Hence, it's perfectly fine to bind variables as locally as possible, and keep the iteration variable confined to the loop body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also slightly faster, because it compiles to much less instructions.  Consider the followed side-by-side disassembly (local let on the right side):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0       varref    list            0       varref    list         &#xA;1       constant  nil             1:1     dup                    &#xA;2       varbind   it              2       goto-if-nil-else-pop 2 &#xA;3       dup                       5       dup                    &#xA;4       varbind   temp            6       car                    &#xA;5       goto-if-nil-else-pop 2    7       stack-ref 1            &#xA;8:1     varref    temp            8       cdr                    &#xA;9       car                       9       discardN-preserve-tos 2&#xA;10      varset    it              11      goto      1            &#xA;11      varref    temp            14:2    return                 &#xA;12      cdr       &#xA;13      dup       &#xA;14      varset    temp&#xA;15      goto-if-not-nil 1&#xA;18      constant  nil&#xA;19:2    unbind    2&#xA;20      return    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no clue, though, what's causing the difference.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="1979" LastEditDate="2020-05-30T13:51:38.620" LastActivityDate="2020-05-30T13:51:38.620" CommentCount="2" CommunityOwnedDate="2020-05-31T11:05:01.020" ContentLicense="CC BY-SA 4.0" />
  <row Id="2159" PostTypeId="2" ParentId="2140" CreationDate="2014-10-14T15:35:37.640" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/lunaryorn/puppet-mode&quot; rel=&quot;nofollow&quot;&gt;Puppet Mode&lt;/a&gt; provides &lt;code&gt;puppet-align-block&lt;/code&gt;.  You could arrange for this function to be called automatically, e.g. by adding it to &lt;code&gt;post-command-hook&lt;/code&gt; locally (untested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun puppet-auto-align ()&#xA;  (unless (puppet-in-string-or-comment-p)&#xA;    (puppet-align-block)))&#xA;&#xA;(define-minor-mode puppet-auto-align-mode&#xA;  :init-value nil&#xA;  :keymap nil&#xA;  :lighter &quot;PAl&quot;&#xA;  :group 'puppet-lint&#xA;  (if puppet-auto-align-mode&#xA;      (add-hook 'post-command-hook #'puppet-auto-align nil 'local)&#xA;    (remove-hook 'post-command-hook #'puppet-auto-align 'local)))&#xA;&#xA;(add-hook 'puppet-mode-hook #'puppet-auto-align-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note though, that there's a good reason to not do this.  It's not particularly clever, and will overwrite any manual alignment you might do anywhere, which will break particularly badly, if the automatic alignment doesn't work for some more convoluted Puppet code.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence—speaking as Puppet Mode maintainer—I recommend against it, and we won't help you or accept bug reports, if you are using this code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, for large resource blocks, it might be slow, so you probably want to use an idle timer instead of &lt;code&gt;post-command-hook&lt;/code&gt; directly.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-14T15:35:37.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2160" PostTypeId="2" ParentId="2119" CreationDate="2014-10-14T17:01:48.200" Score="4" Body="&lt;p&gt;If you are asking about &quot;&lt;em&gt;absolute&lt;/em&gt; fold levels&quot; then I can only guess that you want Org-mode like packages for the hierarchical tree-like structuring of files:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/tj64/outshine#commentary&quot; rel=&quot;nofollow&quot;&gt;Outshine&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It’s an extension library for outline-minor-mode that gives buffers in different major-modes the 'look-and-feel' of Org-mode buffers and enables the use of outorg and navi-mode on them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;An outshine file is structured like an org file, only that the headlines are outcommented with the current major-mode's comment syntax: e.g.&#xA;&lt;code&gt;;; *** Third Level Header&lt;/code&gt; for elisp and &lt;code&gt;% ** Second Level Header&lt;/code&gt; for LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this package your can write&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot; level 1 {{{1&#xA;some code&#xA;&quot; level 2 {{{2&#xA;some code&#xA;&quot; level 1 {{{1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot; * level 1&#xA;some code&#xA;&quot; ** level 2&#xA;some code&#xA;&quot; * level 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you don’t want asterisks then you can customize &lt;code&gt;outline-regexp&lt;/code&gt; which indicates which lines are considered heading.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Orgstruct-mode.html&quot; rel=&quot;nofollow&quot;&gt;Orgstruct&lt;/a&gt; minor mode&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When this mode is active and the cursor is on a line that looks to Org like a&#xA;  headline or the first line of a list item, most structure editing commands&#xA;  will work, even if the same keys normally have different functionality in&#xA;  the major mode you are using.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can also use Org structure editing to fold and unfold headlines in any file by  defining &lt;code&gt;orgstruct-heading-prefix-regexp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you set this variable to &quot;;; &quot; in Emacs Lisp files, you will be&#xA;  able to fold and unfold headlines in Emacs Lisp commented lines.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;More information at: &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-outside-org.html&quot; rel=&quot;nofollow&quot;&gt;'Org outside org' page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally packages which do not share org-mode philosophy:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/zenozeng/yafolding.el&quot; rel=&quot;nofollow&quot;&gt;yafolding&lt;/a&gt; which folds code blocks based on indentation (no special strings are needed).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/FoldingMode&quot; rel=&quot;nofollow&quot;&gt;Folding mode&lt;/a&gt; where you need to define folding characters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(folding-add-to-marks-list 'ruby-mode &quot;#{{{&quot; &quot;#}}}&quot; nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/HideShow&quot; rel=&quot;nofollow&quot;&gt;Hide Show&lt;/a&gt; which hides balanced-expression code blocks and multi-line comment blocks. Blocks are recognized by regular expressions which match the start and end strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(c-mode &quot;{&quot; &quot;}&quot; &quot;/[*/]&quot; nil nil)&#xA;(java-mode &quot;{&quot; &quot;}&quot; &quot;/[*/]&quot; nil nil)&#xA;(js-mode &quot;{&quot; &quot;}&quot; &quot;/[*/]&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/semantic-tag-folding.el&quot; rel=&quot;nofollow&quot;&gt;Semantic Tag Folding&lt;/a&gt; which allows semantic tags to be expanded or collapsed in the style of folding mode and hideshow mode. In addition to regular semantic tag, comments preceeding tags can also be folded.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Based on your &quot;&lt;em&gt;it behaved unpredictably on the fold syntax of my .vimrc&lt;/em&gt;&quot; I can assume that you really want to ask &quot;&lt;em&gt;How can I handle Vim based folding in Emacs without changing file's content?&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;" OwnerUserId="220" LastEditorUserId="220" LastEditDate="2014-10-14T17:08:08.847" LastActivityDate="2014-10-14T17:08:08.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2161" PostTypeId="2" ParentId="2140" CreationDate="2014-10-14T17:03:56.430" Score="5" Body="&lt;p&gt;If you'd like to mark a region for auto-alignment, then it's probably not too hard to do with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defvar my--auto-align-overlays nil)&#xA;(make-variable-buffer-local 'my--auto-align-overlays)&#xA;&#xA;(defun my-auto-align (beg end regexp)&#xA;  (interactive &quot;r\nsRegexp: &quot;)&#xA;  (let ((ol (make-overlay beg end)))&#xA;    (overlay-put ol 'evaporate t)&#xA;    (overlay-put ol 'my--auto-align-regexp regexp)&#xA;    (overlay-put ol 'modification-hooks '(my--auto-align-function))&#xA;    (push ol my--auto-align-overlays)&#xA;    (add-hook 'post-command-hook 'my--auto-align-pch nil t)))&#xA;&#xA;(defun my--auto-align-function (ol &amp;amp;rest _args)&#xA;  (cl-pushnew ol my--auto-align-overlays)&#xA;  (add-hook 'post-command-hook 'my--auto-align-pch nil t))&#xA;&#xA;(defun my--auto-align-pch ()&#xA;  (dolist (ol my--auto-align-overlays)&#xA;    (align-regexp (overlay-start ol) (overlay-end ol)&#xA;                  (concat &quot;\\(\\s-*\\)&quot; (overlay-get ol 'my--auto-align-regexp))&#xA;                  1 align-default-spacing))&#xA;  (setq my--auto-align-overlays nil)&#xA;  (remove-hook 'post-command-hook 'my--auto-align-pch))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you want it to be fully automatic, you'd need to find a way to characterize which regions you want to auto-align (and with which regexp), which is more difficult.  I guess you could provide some regexps, and then scan the buffer for consecutive lines that match one of those regexps.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-14T17:03:56.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2162" PostTypeId="1" AcceptedAnswerId="2184" CreationDate="2014-10-14T17:34:41.230" Score="24" ViewCount="4964" Body="&lt;p&gt;As far as I can tell, &lt;code&gt;org-mode&lt;/code&gt; attachments solve the same problem as do file hyperlinks but in a clunkier way. In what situations would attachments be the superior solution?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="105" LastEditDate="2014-10-14T19:37:20.610" LastActivityDate="2014-10-15T11:09:59.467" Title="When are org-mode attachments preferable to file hyperlinks?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2163" PostTypeId="1" CreationDate="2014-10-14T17:43:21.157" Score="4" ViewCount="180" Body="&lt;p&gt;I have scripts to setup virtual machine images, where emacs packages are installed for the &lt;strong&gt;root&lt;/strong&gt; account. Currently, I manually copy them to the appropriate site-lisp directory, i.e. one of those defined by package-directory-list --  either /usr/share/emacs/24.3/site-lisp/elpa or /usr/share/emacs/site-lisp/elpa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the above approach works for making installed packages accessible to normal user account, I would prefer to avoid hand editing the packages directory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to automate this process in &lt;code&gt;package.el&lt;/code&gt; itself ?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="50" LastEditDate="2014-10-15T15:06:34.183" LastActivityDate="2014-10-15T15:06:34.183" Title="Automatically move installed packages to site-lisp to benefit all user accounts" Tags="|package|package-repositories|site-lisp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2164" PostTypeId="1" AcceptedAnswerId="2169" CreationDate="2014-10-14T17:58:03.127" Score="16" ViewCount="5917" Body="&lt;p&gt;After visiting a file that is part of a git repository, Projectile acknowledges the existence of my git repository as a project, but it only lists one file (the current file) as being part of the project.  As I visit other files in the project, they become part of the project one at a time.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;How do I create projects in Projectile so that they are immediately aware of &lt;em&gt;all&lt;/em&gt; files in the project?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;All of the tutorials that I have found so far assume that you are visiting a file within an existing project, and that Projectile knows what files that project contains.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Update&lt;/h3&gt;&#xA;&lt;p&gt;When I set up Projectile I took the following suggestion in the Projectile documentation:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;h3&gt;Caching&lt;/h3&gt;&#xA;&lt;p&gt;Since indexing a big project is not exactly quick (especially in Emacs&#xA;Lisp), Projectile supports caching of the project's files. The caching&#xA;is enabled by default whenever native indexing is enabled.&lt;/p&gt;&#xA;&lt;p&gt;To enable caching unconditionally use this snippet of code:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(setq projectile-enable-caching t)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Since I will occasionally be navigating some large projects, I added this to my init file hoping that it would give me a performance boost.  I do not know how Projectile manages its caching, but at the time I assumed that the first time I visited a project, the project tree would be explored, and the cache would be populated with all of the project files. It appears that my assumption was wrong.&lt;/p&gt;&#xA;&lt;p&gt;After I set &lt;code&gt;projectile-enable-caching&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, Projectile was able to find all of the files in my project.  Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/a/2169/93&quot;&gt;alexurba's answer&lt;/a&gt; and follow-up comments, I was able to find the problem.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-14T21:10:08.357" Title="Projectile does not show all files in project" Tags="|git|projectile|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2165" PostTypeId="2" ParentId="2162" CreationDate="2014-10-14T18:54:33.223" Score="8" Body="&lt;p&gt;One major advance of using attachements over links is that &lt;code&gt;org-mode&lt;/code&gt; can take care of commiting any changes to the attached file if they are under version control, &lt;a href=&quot;http://orgmode.org/manual/Attachments.html&quot;&gt;Quote from the Manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...]  If you initialize this directory &lt;em&gt;[the one where the attachement resides in]&lt;/em&gt; with git init, Org will automatically commit changes when it sees them. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(added italics for explanation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If used properly, the attachement feature ensures that the attached files are always up to date and accompagny the &lt;code&gt;.org&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd say that using links is a better choice if you&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;don't want to commit files with the &lt;code&gt;.org&lt;/code&gt; on every change / ever&lt;/li&gt;&#xA;&lt;li&gt;have a mixture of files which could be attached and some which should never be attached (hence, for consistency you don't use attachements)&lt;/li&gt;&#xA;&lt;li&gt;are already working under version control and / or don't need the auto-commit functionality&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To me, attachements are kind of the &lt;code&gt;dwim&lt;/code&gt; (do-what-I-mean) approach to files which are to be included or are referenced in an &lt;code&gt;.org&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="448" LastActivityDate="2014-10-14T18:54:33.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2166" PostTypeId="2" ParentId="958" CreationDate="2014-10-14T19:05:19.980" Score="0" Body="&lt;p&gt;If you're using functions from &lt;code&gt;cl-lib&lt;/code&gt; but don't want to use the deprecated non-namespaced versions, make &lt;a href=&quot;http://elpa.gnu.org/packages/cl-lib.html&quot; rel=&quot;nofollow&quot;&gt;the cl-lib compatibility library&lt;/a&gt; a dependency of your project. That will allow you to use the namespaced &lt;code&gt;cl-&lt;/code&gt; functions but retain backward-compatibility.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-10-14T19:05:19.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2167" PostTypeId="1" CreationDate="2014-10-14T19:53:54.427" Score="20" ViewCount="3610" Body="&lt;p&gt;Because I'm currently doing a lot of non-programming tasks in Emacs, spell-checking became one of my major concerns once again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that there is no question related to the options for spell-checking in Emacs yet, so here we go:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What are my options to do spell-checking in Emacs?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Specifically,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for general purpose spell-checking, i.e. sensible suggestions for typos, spell correction of words &lt;/li&gt;&#xA;&lt;li&gt;for selective spell-checking, e.g. general purpose spell-check but &lt;strong&gt;only&lt;/strong&gt; in comments&lt;/li&gt;&#xA;&lt;li&gt;for anything which I forgot or am not aware of but you can think of (spell-check related, duh...)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Forked off the &lt;em&gt;&quot;other&quot;&lt;/em&gt; stuff in a separate question, &lt;a href=&quot;https://emacs.stackexchange.com/questions/2171/what-options-are-there-for-writing-better-texts-in-emacs&quot;&gt;What options are there for writing better texts in emacs&lt;/a&gt;&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-01-29T21:14:13.680" Title="What options are there for doing spell-checking in emacs" Tags="|spell-checking|writing|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2168" PostTypeId="2" ParentId="2163" CreationDate="2014-10-14T20:03:28.577" Score="2" Body="&lt;p&gt;Would it help to simply set &lt;a href=&quot;http://doc.endlessparentheses.com/Var/package-user-dir&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;package-user-dir&lt;/code&gt;&lt;/a&gt; before installing the packages? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-user-dir &quot;/usr/share/emacs/24.3/site-lisp/elpa&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming you have write access, package.el will install the packages there.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-14T20:03:28.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2169" PostTypeId="2" ParentId="2164" CreationDate="2014-10-14T20:22:20.610" Score="9" Body="&lt;p&gt;Once activated, &lt;code&gt;projectile&lt;/code&gt; works out-of-the-box for git projects.  To activate include&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(projectile-global-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;in your Emacs configuration (or start &lt;code&gt;projectile-mode&lt;/code&gt;) manually.&lt;/p&gt;&#xA;&lt;p&gt;Then &lt;code&gt;projectile-find-file&lt;/code&gt; (default key binding is &lt;code&gt;C-c p f&lt;/code&gt;) works just like &lt;code&gt;find-file&lt;/code&gt;, but will act on all files in the subdirectories of the project's main directory (where the &lt;code&gt;.git&lt;/code&gt; directory is).&lt;/p&gt;&#xA;&lt;p&gt;If you want to avoid git, you can alternatively create a file &lt;code&gt;.projectile&lt;/code&gt; in the project root.  This will have the same effect and can be used to ignore certain files or directories (similar to &lt;code&gt;.gitignore&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Much more info can be found on the &lt;a href=&quot;http://batsov.com/projectile&quot; rel=&quot;noreferrer&quot;&gt;project's github page&lt;/a&gt; (which is too long a read, either).  I especially recommend to read the sections about &lt;code&gt;Ido&lt;/code&gt; and &lt;code&gt;helm&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3&gt;Edit:&lt;/h3&gt;&#xA;&lt;p&gt;Check the value of &lt;code&gt;projectile-indexing-method&lt;/code&gt;. On Linux this should be &lt;code&gt;alien&lt;/code&gt;, and the value of &lt;code&gt;projectile-enable-caching&lt;/code&gt; should be &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2019" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-14T21:10:08.357" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2170" PostTypeId="2" ParentId="2167" CreationDate="2014-10-14T20:32:07.647" Score="10" Body="&lt;ul&gt;&#xA;&lt;li&gt;For general purpose spell-checking, there are quite a few popular alternatives&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;ispell&lt;/code&gt; and friends: Built into emacs &amp;amp; typically called with &lt;code&gt;ispell-buffer&lt;/code&gt;. Checks spelling only on demand. &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;flyspell-mode&lt;/code&gt;: Also built-in and provides on-the-fly spell checking and highlights mistakes. &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;speck-mode&lt;/code&gt;: Available from MELPA, it checks the spelling of the word once you pause after typing. Also has a few distinguishing features from flyspell mode like able to use multiple dictionaries in the same buffer. (Disclaimer : I only used this mode briefly a long time back)&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that all the above require dedicated spell-checking programs such as &lt;code&gt;aspell&lt;/code&gt; or &lt;code&gt;hunspell&lt;/code&gt; and appropriate dictionaries. The modes only provide a convenient emacs interface to the command line programs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For selective spell checking, you can customize &lt;code&gt;flyspell-mode&lt;/code&gt; with the variable &lt;code&gt;flyspell-generic-check-word-predicate&lt;/code&gt; by wiring a function that selects which words must be checked. Your listed example is easy though -- Just use &lt;code&gt;flyspell-prog-mode&lt;/code&gt; which only checks comments in code buffers.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-10-14T21:47:23.613" LastActivityDate="2014-10-14T21:47:23.613" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2171" PostTypeId="1" CreationDate="2014-10-14T21:21:03.593" Score="61" ViewCount="10888" Body="&lt;p&gt;This is a fork from the question &lt;a href=&quot;https://emacs.stackexchange.com/questions/2167/what-options-are-there-for-doing-spell-checking-in-emacs&quot;&gt;What options are there for doing spell-checking in Emacs?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because I'm currently doing a lot of non-programming tasks in Emacs I'm wondering whether Emacs can support me in writing &lt;em&gt;better&lt;/em&gt; texts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, let's open with the obligatory question phrase&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Are there any packages/libraries/built-ins tailored to help me write better, more correct and concise texts in Emacs?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Specifically,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;for &lt;strong&gt;grammar spell check&lt;/strong&gt;. Something similar to (but hopefully better than) the MS Word spell-checker which recognizes if a sentence is grammatically wrong&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;for improving your phrasing and the expressions you are using. Something along the lines of &lt;a href=&quot;http://www.imdb.com/title/tt0097165&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;Dead Poets Society&lt;/em&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So avoid using the word 'very' because it's lazy. A man is not very tired, he is exhausted. Don't use very sad, use morose. [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;for anything which &lt;strong&gt;I&lt;/strong&gt; forgot or am not aware of but you can think of (phrasing/language improvement-related, duh...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="448" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2018-06-04T13:04:32.847" Title="What options are there for writing better non-programming text in Emacs?" Tags="|text-editing|text|writing|" AnswerCount="5" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2172" PostTypeId="2" ParentId="2171" CreationDate="2014-10-14T21:36:31.263" Score="16" Body="&lt;p&gt;The EmacsWiki category &lt;a href=&quot;http://www.emacswiki.org/emacs/CategoryWriting&quot;&gt;&lt;strong&gt;&lt;em&gt;Writing&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; is the place to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It lists dozens of libraries that support writing text using Emacs, with one-liner descriptions and links to the detail pages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no sense listing such info again here - consult it there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(But perhaps others here will have specific recommendations.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will mention only the subcategory page &lt;a href=&quot;http://www.emacswiki.org/emacs/ThesauriAndSynonyms&quot;&gt;Thesauri and Synonyms&lt;/a&gt;, which has more links to information about libraries that support synonym lookup.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-14T21:36:31.263" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2173" PostTypeId="1" AcceptedAnswerId="2174" CreationDate="2014-10-14T21:45:07.233" Score="36" ViewCount="9707" Body="&lt;p&gt;I attempted to install Emacs 24.4 through homebrew with the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --HEAD --use-git-head --cocoa --with-gnutls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It ended up installing (a development build toward what might become) Emacs 25. I haven't been able to find any information about Emacs' roadmap, but since this version is in development I'd assume there is some sort of plan. What are the major features that are planned for Emacs 25?&lt;/p&gt;&#xA;" OwnerUserId="58" LastEditorUserId="14920" LastEditDate="2018-09-04T11:59:07.440" LastActivityDate="2018-09-04T11:59:07.440" Title="What are the major features planned for GNU Emacs 25?" Tags="|emacs-development|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2174" PostTypeId="2" ParentId="2173" CreationDate="2014-10-14T21:57:17.717" Score="66" Body="&lt;p&gt;You have already installed a development build of (what will become) Emacs 25. (Emacs 25 has not yet been released.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So use &lt;strong&gt;&lt;code&gt;C-h N&lt;/code&gt;&lt;/strong&gt; to read the &lt;code&gt;NEWS&lt;/code&gt;.  It is specifically an outline &lt;strong&gt;description of all that will be new in Emacs 25&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is little sense in people repeating that information here.  Of course, particular people might want to draw attention to their favorite changes.  Nothing wrong with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember: Ask Emacs first. If you can't seem to find the info you want from Emacs itself, then ask elsewhere. But you will do yourself a favor by learning to &lt;strong&gt;&lt;em&gt;ask Emacs&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-12T14:38:10.140" LastActivityDate="2015-08-12T14:38:10.140" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2175" PostTypeId="2" ParentId="2171" CreationDate="2014-10-14T22:04:51.360" Score="11" Body="&lt;p&gt;Spin off of the original answer to the &lt;a href=&quot;https://emacs.stackexchange.com/questions/2167/what-options-are-there-for-doing-spell-checking-in-emacs&quot;&gt;linked question&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Grammar Check: I am not aware of any dedicated grammar parsers for emacs yet. I will mention &lt;code&gt;writegood-mode&lt;/code&gt; available in MELPA which highlights &lt;a href=&quot;https://en.wikipedia.org/wiki/Weasel_word&quot; rel=&quot;noreferrer&quot;&gt;weasel words&lt;/a&gt; and passive voice in the buffer. It gets you half the way there.&lt;/p&gt;&#xA;&lt;p&gt;Another possibly useful library is &lt;a href=&quot;http://www.damtp.cam.ac.uk/user/sje30/emacs/dupwords.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;dupwords.el&lt;/code&gt;&lt;/a&gt; which can highlight if a particular word (typically nouns and pronouns) are used more than once in the same sentence. This is more general than finding repeated adjacent words which can be handled by flyspell.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Anything else: Correcting language in general is a hard problem. That being said, if there exists any external program/script in this area, it is usually easy to make it interface with emacs.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If you use &lt;em&gt;LaTeX&lt;/em&gt; for writing, I have personally found the following ruby scripts quite useful for checking style and consistency. I just call the shell command from the minibuffer itself. A viewer capable of forward and inverse search is also valuable when proofreading. On MS Windows, I use &lt;code&gt;sumatra-forward&lt;/code&gt; package from ELPA for forward search in SumatraPDF viewer.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cs.umd.edu/%7Enspring/software/&quot; rel=&quot;noreferrer&quot;&gt;style-check by Neil Spring&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/neilconway/paper-scripts&quot; rel=&quot;noreferrer&quot;&gt;hyphen-consistency by Neil Conway&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="108" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-14T22:20:39.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2176" PostTypeId="2" ParentId="2171" CreationDate="2014-10-14T22:16:29.317" Score="67" Body="&lt;p&gt;I personally stick to writing things in &lt;code&gt;org-mode&lt;/code&gt; with &lt;code&gt;flyspell-mode&lt;/code&gt; and &lt;code&gt;langtool&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; is fantastic for typing any sort of document quickly in Emacs, flyspell takes care of spelling, and langtool worries about the grammar. Everything is highly customizable too, so you can customize anything to your heart's content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a quick little type-up in org-mode with langtool and flyspell enabled; nothing too special.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Sa9lv.png&quot; alt=&quot;&quot; title=&quot;Just a simple org file with no grammatical errors or spelling errors in sight... Right?&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;langtool-correct-buffer&lt;/code&gt; like it suggests, any grammar errors langtool found are highlighted one by one with a number of suggestions in the bottom buffer. I can select any of these candidates with the corresponding number key, or just skip over them with the [Space bar].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PV0IA.png&quot; alt=&quot;&quot; title=&quot;That&amp;#39;s not a typo, silly langtool!&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition flyspell lets me [Middle Click] on misspelled words to see spelling suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/veIVh.png&quot; alt=&quot;&quot; title=&quot;I spelled that right! What are you talkin&amp;#39; about?&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; has a &lt;em&gt;ton&lt;/em&gt; of export formats; you can export your document as a PDF, ODT, or even as HTML. (You can export using &lt;code&gt;C-c C-e&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WvP3A.png&quot; alt=&quot;&quot; title=&quot;Time to publish this work of art!&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that I've published my masterpiece as a PDF using LaTeX, this is what I see when I open it in a PDF viewer...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5683V.png&quot; alt=&quot;&quot; title=&quot;Truly a work of art!&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is probably the easiest way to make fancy-looking documents within a relatively good writing environment in Emacs...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good news is that &lt;code&gt;org-mode&lt;/code&gt; and &lt;code&gt;flyspell-mode&lt;/code&gt; are included by default with most versions of Emacs. The bad news is that langtool is not, and it is somewhat large, and it requires Java... But if that doesn't deter you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.languagetool.org/&quot; rel=&quot;noreferrer&quot;&gt;Langtool&lt;/a&gt; is a grammar checker that is commonly paired with Openoffice or Libreoffice. The tool itself is a simple command line utility, so it is relatively easy to interface with other programs; someone interfaced it with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add it in Emacs, you can install it with &lt;code&gt;M-x package-install langtool&lt;/code&gt;...Or, if you don't have the right repos set up (I use the ones suggested &lt;a href=&quot;http://www.emacswiki.org/emacs/ELPA#toc1&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.), you can get the &lt;code&gt;.el&lt;/code&gt; file and include it manually from &lt;a href=&quot;http://www.emacswiki.org/emacs/langtool.el&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have my org-mode hook set up like this. (Snipping the irrelevant bits.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda ()&#xA;   (progn&#xA;     ;; Snipped&#xA;     (auto-fill-mode t)&#xA;&#xA;     ;; Spelling&#xA;     (flyspell-mode t)&#xA;&#xA;     ;; Grammar&#xA;     (require 'langtool)&#xA;     (setq langtool-language-tool-jar &quot;/path/to/LanguageTool.jar&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, you would want to replace the &lt;code&gt;/path/to/LanguageTool.jar&lt;/code&gt; with the actual path to it on your system. It is a portable .jar file, so the location doesn't really matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, unlike &lt;code&gt;flyspell-mode&lt;/code&gt;, langtool requires you to run &lt;code&gt;M-x langtool-check&lt;/code&gt; when you want to grammar check the buffer... So you don't have fancy grammar checking as you type currently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; can do a ton, and can be used to write simple little notes files, complete essays with fancy graphics, articles, books, you name it... But since it can do so much, it's kind of hard to know where to start. I found it was easiest to learn by starting with &lt;a href=&quot;http://orgmode.org/manual/Exporting.html&quot; rel=&quot;noreferrer&quot;&gt;the possible ways you can export an &lt;code&gt;org-mode&lt;/code&gt; file&lt;/a&gt; after you &lt;a href=&quot;http://www.youtube.com/watch?v=oJTwQvgfgMM&quot; rel=&quot;noreferrer&quot;&gt;learn the basics...&lt;/a&gt;. &lt;a href=&quot;http://orgmode.org/&quot; rel=&quot;noreferrer&quot;&gt;Org-mode's site&lt;/a&gt; is very helpful and informative, and there is a lot of help on it in the info pages too (&lt;code&gt;C-h i&lt;/code&gt;, &lt;code&gt;m Org Mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck..! And hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2015-07-20T17:41:58.690" LastActivityDate="2015-07-20T17:41:58.690" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2177" PostTypeId="1" AcceptedAnswerId="2178" CreationDate="2014-10-14T22:33:52.290" Score="12" ViewCount="2451" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x ibuffer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select a buffer&lt;/li&gt;&#xA;&lt;li&gt;Kill that buffer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After the buffer is killed, the ibuffer buffer re-appears, but it still shows the buffer name killed in step 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have ibuffer auto-refresh the list of buffers?&lt;/p&gt;&#xA;" OwnerUserId="2014" LastEditorUserId="25" LastEditDate="2014-10-14T22:51:53.533" LastActivityDate="2014-10-15T05:53:59.797" Title="How can I make ibuffer auto-refresh the list of buffers?" Tags="|buffers|ibuffer|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2178" PostTypeId="2" ParentId="2177" CreationDate="2014-10-14T22:51:22.113" Score="14" Body="&lt;p&gt;Running the command &lt;code&gt;ibuffer-auto-mode&lt;/code&gt; in an Ibuffer buffer makes it refresh the display after each interactive command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There doesn't appear to be a direct way of activating it automatically. You can put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ibuffer-mode-hook (lambda () (ibuffer-auto-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-14T22:51:22.113" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2179" PostTypeId="2" ParentId="2177" CreationDate="2014-10-15T00:59:57.317" Score="9" Body="&lt;p&gt;The right way to do it is to introduce support in &lt;code&gt;ibuffer&lt;/code&gt; for &lt;code&gt;auto-revert-mode&lt;/code&gt;. This can be achieved by defining &lt;code&gt;buffer-stale-function&lt;/code&gt; for those those buffers.&#xA;Arguably, since &lt;code&gt;buffer-menu&lt;/code&gt; supports that feature, it'd be good to have it upstream for &lt;code&gt;ibuffer&lt;/code&gt; too, but that doesn't seem to be the case for now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, here's a way to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-ibuffer-stale-p (&amp;amp;optional noconfirm)&#xA;  ;; let's reuse the variable that's used for 'ibuffer-auto-mode&#xA;  (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed))&#xA;&#xA;(defun my-ibuffer-auto-revert-setup ()&#xA;  (set (make-local-variable 'buffer-stale-function)&#xA;       'my-ibuffer-stale-p)&#xA;  (set (make-local-variable 'auto-revert-verbose) nil)&#xA;  (auto-revert-mode 1))&#xA;&#xA;(add-hook 'ibuffer-mode-hook 'my-ibuffer-auto-revert-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: in general, one would need to define a value for &lt;code&gt;revert-buffer-function&lt;/code&gt;, but &lt;code&gt;ibuffer&lt;/code&gt; already does that (it's set to &lt;code&gt;ibuffer-update&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="79" LastEditorUserId="79" LastEditDate="2014-10-15T05:53:59.797" LastActivityDate="2014-10-15T05:53:59.797" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2180" PostTypeId="1" AcceptedAnswerId="2187" CreationDate="2014-10-15T01:10:26.667" Score="2" ViewCount="1271" Body="&lt;p&gt;When I try to filter buffers by mode in &lt;code&gt;ibuffer&lt;/code&gt;, I am not able to filter by major mode &lt;code&gt;helm-mode&lt;/code&gt;.  For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; MR Name                 Size Mode&#xA; -- ----                 ---- ----&#xA; *  *helm apropos*        117 Helm             &#xA; *  *helm projectile*    3633 Helm             &#xA; *  *helm-package*        187 Helm             &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;these three buffers say &quot;Helm&quot; in the mode column, but will only match &lt;code&gt;fundamental-mode&lt;/code&gt; when filtering on major mode or derived mode.  Is this a bug?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="25" LastEditDate="2014-10-15T13:42:13.143" LastActivityDate="2014-10-15T16:51:28.983" Title="Filter Helm buffers by mode in ibuffer" Tags="|helm|major-mode|ibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2181" PostTypeId="1" AcceptedAnswerId="2199" CreationDate="2014-10-15T06:54:45.140" Score="9" ViewCount="2902" Body="&lt;p&gt;I'd like to group my buffer list in ibuffer by project. Project is meant in the Projectile sense of the word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to change my Emacs configuration every time I'm working on a new project. Is there a way to achieve this automatically?&lt;/p&gt;&#xA;" OwnerUserId="2037" LastEditorUserId="25" LastEditDate="2014-10-15T09:54:19.493" LastActivityDate="2015-07-13T21:10:20.953" Title="ibuffer: how to automatically create groups per project" Tags="|ibuffer|projectile|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2182" PostTypeId="2" ParentId="2181" CreationDate="2014-10-15T07:06:57.687" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Project is meant in the Projectile sense of the word.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Using Projectile, there is a way to switch to a buffer inside a specific project &lt;code&gt;C-c p b&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;May I suggest &lt;a href=&quot;https://github.com/purcell/ibuffer-vc&quot;&gt;ibuffer-vc&lt;/a&gt;? A way to group your buffers by their parent vc root directory.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-10-15T07:06:57.687" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2183" PostTypeId="2" ParentId="2167" CreationDate="2014-10-15T07:38:25.943" Score="6" Body="&lt;p&gt;@Vamsi's answer already covers general-purpose and selective spell-checking. But what about &lt;strong&gt;personalized auto-correction&lt;/strong&gt;? @Malabarba has a &lt;a href=&quot;http://endlessparentheses.com/ispell-and-abbrev-the-perfect-auto-correct.html&quot; rel=&quot;nofollow&quot;&gt;nice post&lt;/a&gt; about this topic on his &lt;a href=&quot;http://endlessparentheses.com/&quot; rel=&quot;nofollow&quot;&gt;blog&lt;/a&gt;. The basic idea is to store pairs of misspelled words and appropriate corrections as &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html&quot; rel=&quot;nofollow&quot;&gt;Abbrevs&lt;/a&gt;. Here is (a slightly modified version of) the code that lets you do this easily:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ispell-word-then-abbrev (p)&#xA;  &quot;Call `ispell-word'. Then create an abbrev for the correction made.&#xA;With prefix P, create local abbrev. Otherwise it will be global.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((before (downcase (or (thing-at-point 'word) &quot;&quot;)))&#xA;        after)&#xA;    (call-interactively 'ispell-word)&#xA;    (setq after (downcase (or (thing-at-point 'word) &quot;&quot;)))&#xA;    (unless (string= after before)&#xA;      (define-abbrev&#xA;        (if p local-abbrev-table global-abbrev-table) before after))&#xA;      (message &quot;\&quot;%s\&quot; now expands to \&quot;%s\&quot; %sally.&quot;&#xA;               before after (if p &quot;loc&quot; &quot;glob&quot;))))&#xA;&#xA;(define-key ctl-x-map (kbd &quot;C-i&quot;) 'ispell-word-then-abbrev)&#xA;(setq save-abbrevs t)&#xA;(setq-default abbrev-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place, you can simply &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;hit &lt;kbd&gt;C-x C-i&lt;/kbd&gt; after a misspelled word&lt;/li&gt;&#xA;&lt;li&gt;select a correction, and &lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;never worry about it again&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;because from now on Emacs will automatically replace the misspelled version of the word with the correction. It's hard to put into words just how useful this is!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to supercharge Emacs' new-found auto-correction capabilities, you can add the abbrevs defined &lt;a href=&quot;http://www.emacswiki.org/emacs/autocorrection_abbrev_defs&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to your &lt;code&gt;abbrev_defs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-29T21:14:13.680" LastActivityDate="2015-01-29T21:14:13.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2184" PostTypeId="2" ParentId="2162" CreationDate="2014-10-15T07:49:31.683" Score="16" Body="&lt;p&gt;Sometimes a hyperlink might be to something ephemeral like a log file or a file editable by others. Attachments allow you to permanently capture the current state of the file in a way more convenient than you manually copying the file into a good location and linking to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might also extend to Internet accessibility. If you want access to a file without Internet access, you can attach it to your org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But conversely, attachments can soft-link to a location whereas hyperlinks can't store a local copy. When attachments soft-link to a document (&lt;code&gt;C-c C-a y&lt;/code&gt;), org-mode will create a symbolic link to the file if possible on your operating system (equivalent to &lt;code&gt;ln&lt;/code&gt; on a *nix system). The other methods (&lt;code&gt;C-c C-a c/m/l&lt;/code&gt;) provide other behaviour. The default (&lt;code&gt;C-c C-a a&lt;/code&gt;) is one of these, as set by &lt;code&gt;org-attach-method&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also specify the attachment directory and populate that directory. &lt;code&gt;org-attach-sync&lt;/code&gt; then synchronizes your attachment metadata so the headline is aware of the new files. You can't do this with hyperlinks without globbing or scripting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get a list of all the attached files via &lt;code&gt;org-attach-file-list&lt;/code&gt;, which allows you to iterate over them all and do useful things like copy to a Dropbox folder or store in git. Iterating over hyperlinks in a section is much more difficult and error-prone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another reason to consider attachments over hyperlinks is that they associate a link to an org headline, without you having to put it in the text. The attachment metadata is stored in a property drawer which can be hidden with &lt;code&gt;TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hyperlinks have to exist in the text generally in the form &lt;code&gt;[[file:somefile.pdf][My file]]&lt;/code&gt;. You could potentially hide this hyperlink in a property as well, but then you're more-or-less replicating &lt;code&gt;org-attach&lt;/code&gt; without the ease-of-use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, while hyperlinks can associate other documents to a heading, &lt;code&gt;org-attach&lt;/code&gt; makes this association stronger, more robust and in some ways easier to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edited: Added clarification.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="132" LastEditorUserId="132" LastEditDate="2014-10-15T11:09:59.467" LastActivityDate="2014-10-15T11:09:59.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2185" PostTypeId="2" ParentId="613" CreationDate="2014-10-15T09:45:35.997" Score="8" Body="&lt;p&gt;You can do this easily with &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html#sec-1-1&quot; rel=&quot;noreferrer&quot;&gt;helm-projectile-find-file&lt;/a&gt;. Since Projectile keeps track of every files with its relative path, you can easily narrow down to anything. Let's use your example. In your case, you want to open files in &lt;code&gt;hst&lt;/code&gt;, &lt;code&gt;inc&lt;/code&gt;, and &lt;code&gt;lib&lt;/code&gt;. You can retrieves all files belongs to this directory by two ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In Helm prompt of &lt;code&gt;helm-projectile-find-file&lt;/code&gt;, enter each directory and marked files narrowed to that directory. For example, first I enter &lt;code&gt;^hst/&lt;/code&gt; (which narrows to all files that contains &lt;code&gt;hst/&lt;/code&gt; at the beginning of each candidate). &lt;strong&gt;Mark all files with &lt;code&gt;M-a&lt;/code&gt;&lt;/strong&gt;, do something similar for files in the other two directories.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or, you can &lt;strong&gt;retrieve files in all directories using this pattern&lt;/strong&gt;: &lt;code&gt;^hst/\|^inc\|^lib&lt;/code&gt;. Helm accepts regex after all. The regex &lt;code&gt;\|&lt;/code&gt; means &lt;code&gt;or&lt;/code&gt;. Do this if you want to select everything in one go.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With either of these, you will have marked all files you want to open. &lt;strong&gt;Then just press &lt;code&gt;RET&lt;/code&gt; to open them all.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that if you have lots of files in those directories, you need to increase &lt;code&gt;helm-candidate-number-limit&lt;/code&gt;. Otherwise once the number of candidates hits the limit, no more candidates are displayed and you cannot select invisible candidates. Set it to higher number or set to &lt;code&gt;nil&lt;/code&gt; if you don't want this limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good thing with Helm is that you can interactively select files.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="50" LastEditDate="2014-10-15T13:13:32.887" LastActivityDate="2014-10-15T13:13:32.887" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2186" PostTypeId="1" AcceptedAnswerId="2188" CreationDate="2014-10-15T10:59:23.107" Score="8" ViewCount="2317" Body="&lt;p&gt;If I have an org-mode buffer like that looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My headline&#xA;:PROPERTIES:&#xA;:ID: id1&#xA;:END:&#xA;* My second headline&#xA;:PROPERTIES:&#xA;:ID: id2&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I export this to HTML with a table-of-contents, the table of contents uses &lt;code&gt;#sec-1&lt;/code&gt; and &lt;code&gt;#sec-2&lt;/code&gt; as the anchor links for each headline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like it to automatically use &lt;code&gt;#ID-id1&lt;/code&gt; and &lt;code&gt;#ID-id2&lt;/code&gt; so that I can change the order of the headlines without changing where the links point to. Is there a way to tell org-mode to export the table of contents using these anchors instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; As Jonathan suggested below, I have created a custom function to use &lt;code&gt;:CUSTOM_ID:&lt;/code&gt; instead, here is my setup in case others find it useful:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-custom-id-get (&amp;amp;optional pom create prefix)&#xA;  &quot;Get the CUSTOM_ID property of the entry at point-or-marker POM.&#xA;If POM is nil, refer to the entry at point. If the entry does not&#xA;have an CUSTOM_ID, the function returns nil. However, when CREATE&#xA;is non nil, create a CUSTOM_ID if none is present already. PREFIX&#xA;will be passed through to `org-id-new'. In any case, the&#xA;CUSTOM_ID of the entry is returned.&quot;&#xA;  (interactive)&#xA;  (org-with-point-at pom&#xA;    (let ((id (org-entry-get nil &quot;CUSTOM_ID&quot;)))&#xA;      (cond&#xA;       ((and id (stringp id) (string-match &quot;\\S-&quot; id))&#xA;        id)&#xA;       (create&#xA;        (setq id (org-id-new prefix))&#xA;        (org-entry-put pom &quot;CUSTOM_ID&quot; id)&#xA;        (org-id-add-location id (buffer-file-name (buffer-base-buffer)))&#xA;        id)))))&#xA;&#xA;(defun my/org-add-ids-to-headlines-in-file ()&#xA;  &quot;Add CUSTOM_ID properties to all headlines in the&#xA;current file which do not already have one.&quot;&#xA;  (interactive)&#xA;  (org-map-entries (lambda () (my/org-custom-id-get (point) 'create))))&#xA;&#xA;;; automatically add ids to captured headlines&#xA;(add-hook 'org-capture-prepare-finalize-hook&#xA;          (lambda () (my/org-custom-id-get (point) 'create)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which I can then use the &lt;code&gt;my/org-add-ids-to-headlines-in-file&lt;/code&gt; function to add &lt;code&gt;:CUSTOM_ID:&lt;/code&gt; properties to each headline in a file.&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="379" LastEditDate="2014-10-15T13:13:22.550" LastActivityDate="2014-10-15T13:13:22.550" Title="Have org-mode's exported HTML use CUSTOM_ID when linking to sub-sections in TOC" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2187" PostTypeId="2" ParentId="2180" CreationDate="2014-10-15T11:11:39.783" Score="6" Body="&lt;p&gt;It is not a bug. &lt;code&gt;helm.el&lt;/code&gt; does not provide any major mode for helm buffers. So they are infact in &lt;code&gt;fundamental-mode&lt;/code&gt;. However it does set the variable &lt;code&gt;mode-name&lt;/code&gt; to &lt;code&gt;Helm&lt;/code&gt; which is what you are seeing in the mode column. The &lt;code&gt;mode-name&lt;/code&gt; variable is a buffer local variable that can contain a user friendly name for the buffer's major-mode and is/can be different from &lt;code&gt;major-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out the defun &lt;code&gt;helm-create-helm-buffer&lt;/code&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;ibuffer&lt;/code&gt; lets you mark all helm buffers by marking by mode regexp &lt;code&gt;% m&lt;/code&gt;  followed by &lt;code&gt;Helm&lt;/code&gt; at the prompt. The usual &lt;code&gt;* M&lt;/code&gt; does not work though. If you want to create filter groups for helm, you can use the &lt;code&gt;ibuffer-filter-by-predicate&lt;/code&gt; mapped to &lt;code&gt;/ e&lt;/code&gt; and entering the following at the prompt.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;Helm&quot; mode-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For instance, here is a working example of a saved filter group&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GKQwM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and here is the resulting &lt;code&gt;ibuffer&lt;/code&gt; window after &lt;code&gt;ibuffer-switch-to-saved-filter-groups&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/y5bMS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can only guess why Helm does not have a dedicated major mode. Unlike buffers with major modes&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;helm completion buffers are always disposable,&lt;/li&gt;&#xA;&lt;li&gt;do not need any special syntax map,&lt;/li&gt;&#xA;&lt;li&gt;font-lock is dependent upon the command invoked&lt;/li&gt;&#xA;&lt;li&gt;most importantly, keymap is active only for the active helm buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So there is no special reason for these buffers to have a dedicated major-mode. You can &lt;a href=&quot;https://github.com/emacs-helm/helm/issues&quot; rel=&quot;nofollow noreferrer&quot;&gt;ask the maintainer for his reasons though&lt;/a&gt;. Maybe, the overhead of having a major-mode is not worth the trivial advantages it brings.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-10-15T16:51:28.983" LastActivityDate="2014-10-15T16:51:28.983" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2188" PostTypeId="2" ParentId="2186" CreationDate="2014-10-15T11:44:06.190" Score="9" Body="&lt;p&gt;The simplest solution to get this to work would be to substitute your cases of &lt;code&gt;:ID:&lt;/code&gt; with &lt;code&gt;:CUSTOM_ID:&lt;/code&gt;, those will be used without any further work required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both &lt;code&gt;:ID:&lt;/code&gt; and &lt;code&gt;:CUSTOM_ID:&lt;/code&gt; have targets created at the headline to allow for linking using them (in addition to the &lt;code&gt;sec-#&lt;/code&gt; targets).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Source&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;ox-html.el&lt;/code&gt; there is &lt;code&gt;org-html--format-toc-headline&lt;/code&gt; which is used to create the TOC contents for the headline.  Relevant portion of the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;&amp;lt;a href=\&quot;#%s\&quot;&amp;gt;%s&amp;lt;/a&amp;gt;&quot;&#xA;        ;; Label.&#xA;        (org-export-solidify-link-text&#xA;         (or (org-element-property :CUSTOM_ID headline)&#xA;             (concat &quot;sec-&quot;&#xA;                 (mapconcat #'number-to-string headline-number &quot;-&quot;))))&#xA;        ;; Body.&#xA;        (concat&#xA;         (and (not (org-export-low-level-p headline info))&#xA;              (org-export-numbered-headline-p headline info)&#xA;              (concat (mapconcat #'number-to-string headline-number &quot;.&quot;)&#xA;                  &quot;. &quot;))&#xA;         (apply (plist-get info :html-format-headline-function)&#xA;                todo todo-type priority text tags :section-number nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;Using &lt;code&gt;:ID:&lt;/code&gt; by changing ox-html&#xA;&#xA;&lt;p&gt;If you change the link portion above from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-solidify-link-text&#xA;         (or (org-element-property :CUSTOM_ID headline)&#xA;             (concat &quot;sec-&quot;&#xA;                 (mapconcat #'number-to-string headline-number &quot;-&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-solidify-link-text&#xA;         (or (org-element-property :CUSTOM_ID headline)&#xA;             (org-element-property :ID headline)&#xA;             (concat &quot;sec-&quot;&#xA;                 (mapconcat #'number-to-string headline-number &quot;-&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will use the generated/set IDs.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;:ID:&lt;/code&gt; vs &lt;code&gt;:CUSTOM_ID:&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If a property &lt;code&gt;:CUSTOM_ID:&lt;/code&gt; is set, it will be used for the link ID, however an &lt;code&gt;:ID:&lt;/code&gt; property will not.  Looking elsewhere through org code, &lt;code&gt;:ID:&lt;/code&gt; is meant for use by org-internals while &lt;code&gt;:CUSTOM_ID:&lt;/code&gt; is meant for the user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:ID:&lt;/code&gt; is used for determining the folder to store attachments in, with &lt;code&gt;org-id&lt;/code&gt; it is used to allow crosslinking between multiple org-files with guaranteed unique IDs.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-15T11:44:06.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2189" PostTypeId="1" AcceptedAnswerId="2198" CreationDate="2014-10-15T12:15:54.093" Score="17" ViewCount="2485" Body="&lt;p&gt;Typically, I have a frame split into four windows, where two at the bottom are dedicated to my &lt;code&gt;*compilation*&lt;/code&gt; and &lt;code&gt;*grep*&lt;/code&gt; buffers. When browsing compilation errors, &lt;code&gt;next-error&lt;/code&gt; will eventually replace my &lt;code&gt;*grep*&lt;/code&gt; buffer with one of the target file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I configure &lt;code&gt;next-error&lt;/code&gt; to &lt;em&gt;not&lt;/em&gt; use the window containing the &lt;code&gt;*grep*&lt;/code&gt; buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My specific use-case is the &lt;code&gt;next-error&lt;/code&gt; command, but more general answers are welcome as well.&lt;/p&gt;&#xA;" OwnerUserId="2061" LastEditorUserId="50" LastEditDate="2014-10-15T12:46:24.933" LastActivityDate="2015-01-27T15:13:41.403" Title="How can I prevent a command from using specific windows?" Tags="|buffers|window|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2190" PostTypeId="2" ParentId="2189" CreationDate="2014-10-15T12:36:21.560" Score="5" Body="&lt;p&gt;May I suggest &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Dedicated-Windows.html#Dedicated-Windows&quot; rel=&quot;noreferrer&quot;&gt;dedicated-window&lt;/a&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll have to dedicate windows to buffers using this function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;set-window-dedicated-p window flag:&lt;/strong&gt; This function marks window as dedicated to its buffer if flag is non-nil, and non-dedicated otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Dedicated-Windows.html#Dedicated-Windows&quot; rel=&quot;noreferrer&quot;&gt;gnu&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-10-15T12:36:21.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2191" PostTypeId="1" AcceptedAnswerId="2196" CreationDate="2014-10-15T13:51:53.330" Score="8" ViewCount="3618" Body="&lt;p&gt;I need to copy the contents of the current buffer to a temp buffer, set that buffer to a particular major mode to take advantage of its benefits and get the information I need back to the main logic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this complete madness? And if not, what's the structure for this?&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="50" LastEditDate="2014-10-15T15:03:51.560" LastActivityDate="2016-07-09T00:37:10.157" Title="copy contents of current buffer in a temp buffer and operate on that" Tags="|buffers|text-editing|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2193" PostTypeId="2" ParentId="2191" CreationDate="2014-10-15T13:54:57.043" Score="9" Body="&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((old-buffer (current-buffer)))&#xA;  (with-temp-buffer&#xA;    (insert-buffer-substring old-buffer)&#xA;    (my-favourite-major-mode 1)&#xA;    (extract-needed-information)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-10-15T13:54:57.043" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2194" PostTypeId="1" AcceptedAnswerId="2195" CreationDate="2014-10-15T14:20:54.433" Score="13" ViewCount="2624" Body="&lt;p&gt;When committing changes in Magit, it is useful to have the diff view open while adding details about the commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Magit, we see the diff in the &lt;code&gt;*magit ..*&lt;/code&gt; buffer. When you hit &lt;kbd&gt;c&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt; while the cursor is on a &lt;em&gt;Staged&lt;/em&gt; file, the Magit commit buffer &lt;code&gt;.. COMMIT_EDITMSG&lt;/code&gt; pops up. By default, this new buffer replaces the &lt;code&gt;*magit ..*&lt;/code&gt; buffer that was showing the commit diffs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION -&lt;/strong&gt;&#xA;How do I make the &lt;code&gt;.. COMMIT_EDITMSG&lt;/code&gt; buffer open in a new window (reuse a different window or create a new window if the frame had just 1 window to begin with) so that I can see both the &lt;code&gt;*magit ..*&lt;/code&gt; and &lt;code&gt;.. COMMIT_EDITMSG&lt;/code&gt; buffers?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-15T14:52:45.827" LastActivityDate="2015-07-03T14:13:21.500" Title="How do I force a specific buffer to open in a new window?" Tags="|buffers|window|magit|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2195" PostTypeId="2" ParentId="2194" CreationDate="2014-10-15T14:20:54.433" Score="19" Body="&lt;p&gt;It is possible to configure how a buffer opens (in the same frame/window or a different frame/window) using &lt;code&gt;display-buffer-alist&lt;/code&gt;. Refer to the references below to learn more about this variable.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;We need to tell emacs to always open buffers ending with &lt;code&gt;COMMIT_EDITMSG&lt;/code&gt; in a window but not in the same (&lt;code&gt;*magit ..*&lt;/code&gt;) window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the following snippet to the &lt;code&gt;init.el&lt;/code&gt; after &lt;code&gt;(require 'magit)&lt;/code&gt; to specify this action.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist&#xA;                 '(&quot;.*COMMIT_EDITMSG&quot;. ((display-buffer-pop-up-window) .&#xA;                                        ((inhibit-same-window . t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Breakdown of the solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;display-buffer-alist&lt;/code&gt; is an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;alist&lt;/code&gt;&lt;/a&gt; that calls a &lt;code&gt;FUNCTION&lt;/code&gt; (or a list of functions) with &lt;code&gt;ALIST&lt;/code&gt; parameters when a &lt;code&gt;CONDITION&lt;/code&gt; is true. The &lt;code&gt;display-buffer-alist&lt;/code&gt; can be represented as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(CONDITION . (FUNCTION . ALIST))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Here &lt;code&gt;CONDITION&lt;/code&gt; is that the buffer name ends with &lt;code&gt;COMMIT_EDITMSG&lt;/code&gt; and that is represented by &lt;code&gt;&quot;.*COMMIT_EDITMSG&quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;FUNCTION&lt;/code&gt; to call is &lt;code&gt;display-buffer-pop-up-window&lt;/code&gt; as we want to create a window for this buffer. Instead of specifying the function by itself it's put in as a list of a single function &lt;code&gt;(display-buffer-pop-up-window)&lt;/code&gt;so that more functions can be easily added to the list if needed in future.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;ALIST&lt;/code&gt; contains &lt;code&gt;(inhibit-same-window . t)&lt;/code&gt; as we don't want this buffer to open in the same window.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;References&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Variable &lt;a href=&quot;http://doc.endlessparentheses.com/Var/display-buffer-alist.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;display-buffer-alist&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Function &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/display-buffer.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;display-buffer&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Function &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/display-buffer-pop-up-window.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;display-buffer-pop-up-window&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Related emacs SE question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/327/how-can-i-block-a-frame-from-being-split&quot;&gt;How can I block a frame from being split?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-10-15T14:20:54.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2196" PostTypeId="2" ParentId="2191" CreationDate="2014-10-15T14:32:32.190" Score="12" Body="&lt;p&gt;If you want to copy some information to another buffer, and from then on let the buffers evolve independently, you can &lt;a href=&quot;https://emacs.stackexchange.com/a/2193&quot;&gt;do just that&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you want the other buffer to reflect the original content in real time, then Emacs provides this with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html#Indirect-Buffers&quot;&gt;indirect buffers&lt;/a&gt;. An indirect buffer is another buffer that has the same content as the original (modifications in one buffer are reflected in the other buffer), but different settings: a different major mode, different minor modes, different local variables, a different point, different marks, a different narrowing, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can get a view of a part of a buffer in a different major mode, while keeping track of modifications in the original buffer and reflecting modifications back to the original buffer. First make an indirect buffer with &lt;code&gt;M-x clone-indirect buffer&lt;/code&gt;; there's also &lt;code&gt;clone-indirect-buffer-other-window&lt;/code&gt; which is bound to &lt;code&gt;C-x 4 c&lt;/code&gt; (&lt;code&gt;C-x 4&lt;/code&gt; window prefix, and &lt;code&gt;c&lt;/code&gt; for &lt;em&gt;clone&lt;/em&gt;). In the cloned buffer, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Narrowing.html#Narrowing&quot;&gt;narrow&lt;/a&gt; to the region you want: select the interesting part and run &lt;code&gt;C-x n n&lt;/code&gt; (&lt;code&gt;narrow-to-region&lt;/code&gt;). Change the major mode as desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can automate that with a command like this for interactive use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun edit-region-in-foo-mode (beg end)&#xA;  (interactive &quot;@r&quot;)&#xA;  (let ((new-buffer (clone-indirect-buffer nil t)))&#xA;    (narrow-to-region beg end)&#xA;    (foo-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For programming use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-indirect-buffer-in-foo-mode (beg end &amp;amp;rest body)&#xA;  `(with-current-buffer (clone-indirect-buffer nil nil)&#xA;     (narrow-to-region beg end)&#xA;     (foo-mode)&#xA;     (unwind-protect&#xA;         ,body&#xA;       (kill-buffer (current-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-15T14:32:32.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2197" PostTypeId="2" ParentId="2191" CreationDate="2014-10-15T14:39:19.430" Score="1" Body="&lt;p&gt;For a similar use case, I had written an elisp function &lt;a href=&quot;https://emacs.stackexchange.com/questions/80/how-can-i-quickly-toggle-between-a-file-and-a-scratch-buffer-having-the-same-m&quot;&gt;&lt;code&gt;modi/switch-to-scratch-and-back&lt;/code&gt;&lt;/a&gt; that allows you to switch quickly between a buffer FILE and a *scratch* buffer having the same major-mode as the FILE buffer. The above hyperlinked function will lead you to an existing emacs SE question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how you can use that function:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a wrapper function to copy your existing buffer, create a *scratch* buffer with the same major-mode and paste the copied content.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is an example wrapper function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-current-buffer-to-scratch ()&#xA; &quot;Copied the current buffer, open scratch, paste it there.&quot;&#xA;  (interactive)&#xA;  (kill-ring-save (point-min) (point-max))&#xA;  (modi/switch-to-scratch-and-back)&#xA;  (yank))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can now bind this &lt;code&gt;copy-current-buffer-to-scratch&lt;/code&gt; to a key if you wish and executing it will give you a *scratch* buffer with contents from your working buffer.&lt;/li&gt;&#xA;&lt;li&gt;Once you are happy with the edits in the scratch buffer, you will need to manually copy the required section back to the original buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is just another way of doing what you want; you might though want to use indirect buffers that @Gilles' solution talks about. This approach is useful if you need to make some heavy edits in a temporary buffer without risking accidental saves in the original buffer till you have reached a stable solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example use case is trying out experimental elisp functions before saving them to your emacs init.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-10-15T14:39:19.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2198" PostTypeId="2" ParentId="2189" CreationDate="2014-10-15T15:12:54.653" Score="21" Body="&lt;p&gt;I second @Nsukami's suggestion to use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Dedicated-Windows.html&quot; rel=&quot;noreferrer&quot;&gt;dedicated windows&lt;/a&gt;. Since it is a &lt;a href=&quot;https://emacs.stackexchange.com/q/3555/504&quot;&gt;function, not a command&lt;/a&gt;, using &lt;code&gt;set-window-dedicated-p&lt;/code&gt; directly can be cumbersome. With the following command and associated key binding, you can toggle &quot;dedicatedness&quot; of any window by pressing &lt;kbd&gt;C-c t&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-window-dedicated ()&#xA;  &quot;Control whether or not Emacs is allowed to display another&#xA;buffer in current window.&quot;&#xA;  (interactive)&#xA;  (message&#xA;   (if (let (window (get-buffer-window (current-buffer)))&#xA;         (set-window-dedicated-p window (not (window-dedicated-p window))))&#xA;       &quot;%s: Can't touch this!&quot;&#xA;     &quot;%s is up for grabs.&quot;)&#xA;   (current-buffer)))&#xA;&#xA;(global-set-key (kbd &quot;C-c t&quot;) 'toggle-window-dedicated)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-01-27T15:13:41.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2199" PostTypeId="2" ParentId="2181" CreationDate="2014-10-15T15:49:04.340" Score="6" Body="&lt;p&gt;You can define filter groups for known projects using something like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Define ibuffer filter groups for each known project&#xA;(defun my/define-projectile-filter-groups ()&#xA;  (when (boundp 'projectile-known-projects)&#xA;    (setq my/project-filter-groups&#xA;        (mapcar&#xA;         (lambda (it)&#xA;           (let ((name (file-name-nondirectory (directory-file-name it))))&#xA;             `(,name (filename . ,(expand-file-name it)))))&#xA;         projectile-known-projects))))&#xA;&#xA;;; Set up default ibuffer filter groups&#xA;(setq ibuffer-saved-filter-groups&#xA;      (list&#xA;       (cons &quot;default&quot;&#xA;             (append&#xA;              (my/define-projectile-filter-groups)&#xA;              ;; ... whatever other groups you want, e.g.&#xA;              '((&quot;dired&quot; (mode . dired-mode))&#xA;                (&quot;erc&quot; (mode . erc-mode)))&#xA;              ))))&#xA;&#xA;;; Enable default groups by default&#xA;(add-hook 'ibuffer-mode-hook&#xA;              (lambda ()&#xA;                (ibuffer-switch-to-saved-filter-groups &quot;default&quot;)))&#xA;&#xA;;; You probably don't want to see empty project groups&#xA;(setq ibuffer-show-empty-filter-groups nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I originally wrote this answer, @sanityinc has created a variant of &lt;code&gt;ibuffer-vc&lt;/code&gt; that creates filter groups by projectile project root. You can find &lt;code&gt;ibuffer-projectile&lt;/code&gt; on MELPA or on &lt;a href=&quot;https://github.com/purcell/ibuffer-projectile&quot; rel=&quot;nofollow&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-07-13T21:10:20.953" LastActivityDate="2015-07-13T21:10:20.953" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2200" PostTypeId="1" AcceptedAnswerId="2207" CreationDate="2014-10-15T15:55:28.180" Score="28" ViewCount="4270" Body="&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlays.html&quot;&gt;manual&lt;/a&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can use overlays to alter the appearance of a buffer's text on the&#xA;  screen, for the sake of presentation features.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From its name, it suggests it can be used to create “layers” over existing text, but the description above seems to indicate it alters the appearance of text, which feels very similar to what text properties do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a concrete use of overlays?  What do they offer that text properties don't?  Can they be used to write text over text in a buffer, like a popup, info box, etc.?&lt;/p&gt;&#xA;" OwnerUserId="724" LastActivityDate="2014-10-15T19:25:42.037" Title="What are overlays for, and how do they differ from text properties?" Tags="|text-properties|overlays|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2201" PostTypeId="1" CreationDate="2014-10-15T17:50:40.137" Score="9" ViewCount="184" Body="&lt;p&gt;I use several modes that display Unicode characters in my code without changing the underlying file. For example, in Haskell mode, the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo :: forall a. Eq a =&amp;gt; a -&amp;gt; a -&amp;gt; a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gets displayed as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo ∷ ∀ a. Eq a ⇒ a → a → a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is implemented with &lt;code&gt;compose-region&lt;/code&gt;, which can replace a region with a character without changing the actual buffer text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I copy the code, however, it copies the underlying text without the Unicode. Most of the time this is the desired behavior, but sometimes I want to copy the displayed characters instead—I had to type up the second version of my example myself!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I copy the result of character substitutions like this rather than the underlying text? (In fact, I'm not sure this is possible at all!)&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2014-10-15T18:19:59.530" Title="How can I copy and paste characters displayed with compose-region?" Tags="|copy-paste|compose-region|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2202" PostTypeId="2" ParentId="101" CreationDate="2014-10-15T18:05:07.013" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/danieroux&quot; rel=&quot;nofollow noreferrer&quot;&gt;Danie Roux&lt;/a&gt; developed a solution. See: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/danieroux/emacs/blob/master/mine/djr-org-mu4e-capture-sent.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/danieroux/emacs/blob/master/mine/djr-org-mu4e-capture-sent.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;His instructions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Define &lt;code&gt;djr/mu4e-org-mode-capture-template-for-sent-email&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then, either:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call &lt;code&gt;djr/mu4e-compose-new-with-follow-up&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Or set &lt;code&gt;djr/org-mu4e-must-capture-message&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After sending an email, &lt;code&gt;org-capture&lt;/code&gt; will be called with that template. &lt;code&gt;%a&lt;/code&gt; will be the link to that email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-insert-link&lt;/code&gt; will have the email in the list of links, regardless of whether you set the flag or not.&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="724" LastEditDate="2016-12-13T21:39:55.987" LastActivityDate="2016-12-13T21:39:55.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2203" PostTypeId="2" ParentId="2201" CreationDate="2014-10-15T18:19:59.530" Score="4" Body="&lt;p&gt;I tried to do this myself and did not find a good solution. It seems like it CAN be done by manually composing the buffer's text based on the composition property and the composition function table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past I have solved this by running emacs in a terminal and and using my mouse to select and copy the text displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly not a good solution, but it works in times of need, you can then paste &quot;visible&quot; text back in by doing an OS paste into the terminal.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-10-15T18:19:59.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2204" PostTypeId="1" AcceptedAnswerId="2213" CreationDate="2014-10-15T18:20:22.143" Score="8" ViewCount="1309" Body="&lt;p&gt;Inspired by this question: &lt;a href=&quot;https://emacs.stackexchange.com/q/61/93&quot;&gt;Let Emacs move the cursor off-screen&lt;/a&gt;, I am considering writing a minor mode that will keep the cursor in a fixed position that is not affected by scrolling operations.  I have some ideas of how I might implement this, but it would require a hook to let me know when the cursor is being &quot;pushed&quot; off of the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhere within the bowels of Emacs, there exists code that is called when the location of &lt;code&gt;point&lt;/code&gt; is being moved off of the display.  While &lt;a href=&quot;https://stackoverflow.com/a/15903059/1590790&quot;&gt;it has been said&lt;/a&gt; that the code that controls this behavior lives deep with the C source code, I would like to know if there is any way that I can be notified when it is about to happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there any way that I can be notified when a scrolling command is about to move the cursor?&lt;/strong&gt;  Or at least, is there a way that I can be notified when the display is about to be scrolled?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I am no longer planning on writing a minor mode to achieve this because a new package was just released on &lt;a href=&quot;http://elpa.gnu.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU ELPA&lt;/a&gt; called &lt;a href=&quot;http://elpa.gnu.org/packages/scroll-restore.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;scroll-restore&lt;/code&gt;&lt;/a&gt; that provides exactly the features that I was thinking of implementing myself!&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-17T00:39:21.610" Title="Hook that indicates when the cursor has been moved by scrolling" Tags="|elisp|window|hooks|scrolling|c|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2205" PostTypeId="2" ParentId="2200" CreationDate="2014-10-15T18:59:18.453" Score="15" Body="&lt;p&gt;Overlays and text properties have exactly the same capabilities.  They add change margins, buttons, faces, fringe icons, tooltips, images, highlights, etc. to a specific part of of text.  However, there is a huge conceptual difference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overlays are &lt;strong&gt;independent&lt;/strong&gt;, text properties are not.  Emacs has a &lt;strong&gt;distinct&lt;/strong&gt; overlay type, but there is no “text property type”.  Text properties are inherently tied to the string they were set on.  Overlays on the other hand are attached to a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few practical implications of this difference:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can set text properties on strings that are not part of any buffer, whereas you always need a buffer for overlays.  &lt;/li&gt;&#xA;&lt;li&gt;You can't keep a list of text properties you added somewhere, whereas it's easy to keep a list of overlays added to a buffer, and for instance, delete all your overlays in one go.&lt;/li&gt;&#xA;&lt;li&gt;You can have a single overlay that sets multiple overlays on a text (e.g. a face, a tooltip, and a fringe icon), so you can use an overlay to manage a “group” of properties as a single unit, whereas there is no such thing for text properties.  You set them individually, and you manage them individually.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The essence of all this is that you can manage overlays &lt;strong&gt;separately&lt;/strong&gt; from the text content.  Conceptually you'd use them for stuff that you'd show in the buffer, even though it's independent from the text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically, you'd use overlays if the stuff that you'd like to add to text changes frequently, whereas you'd use text properties if the stuff is constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, Emacs uses text properties to create the buttons and input widgets in a &lt;code&gt;M-x customize&lt;/code&gt; buffer.  These widgets are created once, and stay there as long as the buffer is alive, so there's no need to bring in overlays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;a href=&quot;http://flycheck.readthedocs.org/en/latest/&quot;&gt;Flycheck&lt;/a&gt; uses overlays to highlight errors in the buffer, because it frequently needs to remove and add highlights.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-15T18:59:18.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2206" PostTypeId="1" AcceptedAnswerId="2208" CreationDate="2014-10-15T19:17:01.970" Score="20" ViewCount="1075" Body="&lt;p&gt;I write and publish my blog with org-mode and org-page. The thing is that I want to write about Emacs and, I would like to have the keystrokes highlighted as Stack Exchange does with the &lt;code&gt;&amp;lt;kbd&amp;gt;&lt;/code&gt; tag. Getting this: &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-f&lt;/kbd&gt; instead of something else!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In which way or how could I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-10-15T19:38:20.537" Title="I want to have the &lt;kbd&gt; tags for my blog written in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2207" PostTypeId="2" ParentId="2200" CreationDate="2014-10-15T19:25:42.037" Score="17" Body="&lt;h1&gt;What are Overlays?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;First of all, they are elisp objects. This will be relevant later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you said yourself, they represent layers that apply on top of&#xA;regions of the buffer. These layers have text properties, just like&#xA;the actual text in the buffer. Any regular property that an overlay&#xA;has, applies to the text below it. However, there are some properties&#xA;that are special to overlays (they don’t do anything if applied on&#xA;text).&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Why are they Useful?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;For the two reasons I hinted at above:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;They are objects&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This means you can store them in lists and handle them easily. You can&#xA;change their properties without having to keep track of where they are&#xA;right now. Even better, you can use &lt;em&gt;them&lt;/em&gt; to keep track of where&#xA;things are in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/2161/50&quot;&gt;This answer by Stefan&lt;/a&gt; is a&#xA;good example of overlays being used to keep track of buffer regions.&#xA;Here’s a short snippet of it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((ol (make-overlay beg end)))&#xA;  (overlay-put ol 'evaporate t)&#xA;  (overlay-put ol 'my--auto-align-regexp regexp)&#xA;  (push ol my--auto-align-overlays))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It uses overlays to record which regions are to be aligned,&#xA;and which regexp to use on each of them. &lt;code&gt;my--auto-align-overlays&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a list where the overlays are stored, and they can be conveniently&#xA;accessed by looking through this list.&lt;br&gt;&#xA;In contrast, if we were using text properties for this (which is&#xA;possible) we would have no easy way of accessing them. You need to&#xA;parse the buffer to find text properties.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;They are slightly more powerful&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;There are a few text-properties which only have an effect on overlays.&#xA;You can find the entire list&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlay-Properties.html&quot; rel=&quot;noreferrer&quot;&gt;on the manual&lt;/a&gt;.&#xA;It’s too large to include here, but here’s a short highlight.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;before-string&lt;/strong&gt;&lt;br&gt;&#xA;      This property's value is a string to add to the display at the beginning of the overlay. The string does not appear in the buffer in any sense—only on the screen.&lt;br&gt;&#xA;  &lt;strong&gt;line-prefix&lt;/strong&gt;&lt;br&gt;&#xA;      This property specifies a display spec to prepend to each non-continuation line at display-time. See Truncation.&lt;br&gt;&#xA;  &lt;strong&gt;wrap-prefix&lt;/strong&gt;&lt;br&gt;&#xA;      This property specifies a display spec to prepend to each continuation line at display-time. See Truncation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In particular, the &lt;code&gt;before-string&lt;/code&gt; property allows you to affect the&#xA;display of the buffer even with a 0 width overlay. Which is something&#xA;you can’t do with text property. Everything you do with text&#xA;properties needs to either go over an existing text (which might hide&#xA;this text) or go over a new string of text you insert (which alters&#xA;the &lt;em&gt;real&lt;/em&gt; contents of the buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here’s an example snippet about that. Evaluate it on a temporary buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(overlay-put (make-overlay (point) (point)) 'before-string &quot;Hi there!&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;When are they Bad?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Overlays are much more demanding (processing wise) than text&#xA;properties. Some relevant operations (such as text insertion, if I’m&#xA;not mistaken) take time proportional to the number of overlays in a&#xA;buffer. For that reason, they are unsuitable when you need a large&#xA;number of them. In this case you should resign to text properties.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-10-15T19:25:42.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2208" PostTypeId="2" ParentId="2206" CreationDate="2014-10-15T19:38:20.537" Score="20" Body="&lt;p&gt;Here’s what I use for &lt;a href=&quot;http://endlessparentheses.com&quot;&gt;my blog&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map &quot;\C-ck&quot; #'endless/insert-key)&#xA;(defun endless/insert-key (key)&#xA;  &quot;Ask for a key then insert its description.&#xA;Will work on both org-mode and any mode that accepts plain html.&quot;&#xA;  (interactive &quot;kType key sequence: &quot;)&#xA;  (let* ((is-org-mode (derived-mode-p 'org-mode))&#xA;         (tag (if is-org-mode&#xA;                  &quot;@@html:&amp;lt;kbd&amp;gt;%s&amp;lt;/kbd&amp;gt;@@&quot;&#xA;                &quot;&amp;lt;kbd&amp;gt;%s&amp;lt;/kbd&amp;gt;&quot;)))&#xA;    (if (null (equal key &quot;\r&quot;))&#xA;        (insert&#xA;         (format tag (help-key-description key nil)))&#xA;      (insert (format tag &quot;&quot;))&#xA;      (forward-char (if is-org-mode -8 -6)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Invoke it by calling &lt;code&gt;C-c k&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It will prompt you for a key just like &lt;code&gt;C-h k&lt;/code&gt; would do. &lt;/li&gt;&#xA;&lt;li&gt;It inserts that key sorrounded in escaped &lt;code&gt;&amp;lt;kbd&amp;gt;&lt;/code&gt; tags. &lt;/li&gt;&#xA;&lt;li&gt;If you just hit &lt;code&gt;RET&lt;/code&gt;, it will insert the tags and leave point&#xA;inside (instead of inserting any key), so you can type more&#xA;complicated keys.&lt;/li&gt;&#xA;&lt;li&gt;It even has some code to make it usable outside of &lt;code&gt;org-mode&lt;/code&gt;!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-15T19:38:20.537" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2209" PostTypeId="1" AcceptedAnswerId="2210" CreationDate="2014-10-15T19:46:21.093" Score="7" ViewCount="444" Body="&lt;p&gt;When I use font-lock faces that are bold, it messes up my auto-complete overlays so that they look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YZqzH.png&quot; alt=&quot;auto-complete overlay&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/osI3E.png&quot; alt=&quot;auto-complete overlay&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One obvious solution to the problem would be to stop using bold fonts.  But since I am using a color theme that I got from somewhere else, I would have to create my own version of it, and go through and manually remove any bold fonts. And if I decide to try a new theme next week, I will have to do the same thing over again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there any way for auto-complete to adjust to account for bold font faces?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that this is a known limitation of auto-complete, I have a few alternate ideas. The problem is that I am not sure if any of them can be easily achieved (if at all):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Disable bold faces in buffers where auto-complete is enabled&lt;/li&gt;&#xA;&lt;li&gt;Disable bold faces everywhere&lt;/li&gt;&#xA;&lt;li&gt;Use a font whose bold face is the same width as its normal face&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As you can see, I'm okay with throwing out the bold faces if necessary, but I'm also interested in finding the easiest way to do it.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="50" LastEditDate="2014-11-16T13:20:27.043" LastActivityDate="2014-11-16T13:20:27.043" Title="Auto-complete looks funny around bold fonts" Tags="|completion|font-lock|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2210" PostTypeId="2" ParentId="2209" CreationDate="2014-10-15T19:52:25.043" Score="6" Body="&lt;p&gt;This is really a limitation of Emacs' overlay system, upon which &lt;code&gt;auto-complete&lt;/code&gt; and &lt;code&gt;popup&lt;/code&gt; rely: the overlays are positioned using text column offsets, not pixels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your options are indeed as you outlined. The path of least resistance is to use a fixed-width font with a variety of styles. My personal favourite is Input Mono, FWIW.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-10-15T19:52:25.043" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2211" PostTypeId="2" ParentId="2181" CreationDate="2014-10-15T20:09:45.657" Score="3" Body="&lt;p&gt;Using projectile, you can simply type &lt;kbd&gt;C-c p I&lt;/kbd&gt; (projectile-ibuffer) and only the buffers for that project will show up in ibuffer.&lt;/p&gt;&#xA;" OwnerUserId="790" LastEditorUserId="790" LastEditDate="2014-10-16T08:40:10.190" LastActivityDate="2014-10-16T08:40:10.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2212" PostTypeId="2" ParentId="2204" CreationDate="2014-10-15T20:22:02.207" Score="1" Body="&lt;p&gt;&lt;em&gt;@Gilles answer is the right way to go. I’ll keep this one here for the information and the hacks.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the &lt;code&gt;point&lt;/code&gt; movement is performed by the C functions&#xA;&lt;code&gt;window_scroll_line_based&lt;/code&gt; and &lt;code&gt;window_scroll_pixel_based&lt;/code&gt; (dependinyg&#xA;on your frame parameters). These functions are not exposed to the lisp&#xA;machine, so you can’t advise them. You would have to advise functions&#xA;that call them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two of the (lisp accessible) functions that can do this are&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/scroll-up&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;scroll-up&lt;/code&gt;&lt;/a&gt; and&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/scroll-down&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;scroll-down&lt;/code&gt;&lt;/a&gt;.&#xA;Here’s how I found out about them:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to some long buffer.&lt;/li&gt;&#xA;&lt;li&gt;Select a small region.&lt;/li&gt;&#xA;&lt;li&gt;Call, &lt;code&gt;M-x (put-text-property (region-beginning) (region-end) 'point-left (lambda (&amp;amp;rest _) (error &quot;Point leaving&quot;)))&lt;/code&gt;. This will throw an error when point leaves the region.&lt;/li&gt;&#xA;&lt;li&gt;Activate &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Make sure point is inside this region.&lt;/li&gt;&#xA;&lt;li&gt;Scroll with the mouse wheel until point is dragged out of the region.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You will be given a backtrace buffer like this one, which clearly&#xA;points out the &lt;code&gt;scroll-down&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Point leaving&quot;)&#xA;  signal(error (&quot;Point leaving&quot;))&#xA;  error(&quot;Point leaving&quot;)&#xA;  (lambda (&amp;amp;rest _) (error &quot;Point leaving&quot;))(1508 1192)&#xA;  scroll-down(10)&#xA;  funcall(scroll-down 10)&#xA;  mwheel-scroll((double-mouse-4 (#&amp;lt;window 50 on *Backtrace*&amp;gt; 1299 (578 . 545) 77086296 nil 1299 (57 . 25) nil (398 . 20) (10 . 21)) 2))&#xA;  funcall-interactively(mwheel-scroll (double-mouse-4 (#&amp;lt;window 50 on *Backtrace*&amp;gt; 1299 (578 . 545) 77086296 nil 1299 (57 . 25) nil (398 . 20) (10 . 21)) 2))&#xA;  call-interactively(mwheel-scroll nil nil)&#xA;  command-execute(mwheel-scroll)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I followed &lt;code&gt;scroll-down&lt;/code&gt; to its C definition, which led me to&#xA;&lt;code&gt;window_scroll&lt;/code&gt;, which lead me to those two functions above.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What you can do&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can advise &lt;code&gt;scroll-down/up&lt;/code&gt; with an &lt;code&gt;around&lt;/code&gt; advice (as well as&#xA;any other functions that might also result in point movement). Use this&#xA;advice to check if the position of &lt;code&gt;point&lt;/code&gt; has changed and record the&#xA;old position. And then do whatever you want with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be warned, advices are very unreliable when it comes to C functions.&#xA;Some important functions have special addresses in byte-compiled code,&#xA;which means advices on them aren’t called when the code is compiled. I&#xA;don’t think that will be the case here, but I figured you should no.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-15T20:42:56.003" LastActivityDate="2014-10-15T20:42:56.003" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2213" PostTypeId="2" ParentId="2204" CreationDate="2014-10-15T20:27:28.137" Score="6" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Hooks.html#Window-Hooks&quot;&gt;Yes&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The functions in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Hooks.html#index-window_002dscroll_002dfunctions-2456&quot;&gt;&lt;code&gt;window-scroll-functions&lt;/code&gt;&lt;/a&gt; are called just before a redisplay that would cause scrolling. Each function returns two arguments, the window &lt;code&gt;window&lt;/code&gt; and the new window start position &lt;code&gt;new-start&lt;/code&gt;. You can call &lt;code&gt;(&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Start-and-End.html#index-window_002dstart-2386&quot;&gt;window-start&lt;/a&gt; window)&lt;/code&gt; to get the current window start position, &lt;code&gt;(&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Start-and-End.html#index-window_002dend-2386&quot;&gt;window-end&lt;/a&gt; window)&lt;/code&gt; to get the current window end position, and &lt;code&gt;(&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Start-and-End.html#index-window_002dstart-2386&quot;&gt;window-end&lt;/a&gt; window t)&lt;/code&gt; to get the new window end position. If the point isn't between &lt;code&gt;new-start&lt;/code&gt; and &lt;code&gt;(window-end window t)&lt;/code&gt;, it's about to be moved. As far as I can tell, these functions are called in all cases that change a window's extent, including scrolling and resizing. They are also called when a window starts showing a buffer (because it's just been created or because it's now showing a new buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make scrolling commands appear not to move the point, you would probably want to save the current point in this hook, and do something in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Command-Overview.html#index-post_002dcommand_002dhook-1290&quot;&gt;&lt;code&gt;post-command-hook&lt;/code&gt;&lt;/a&gt;. Since the point will have to move due to the scrolling, you presumably would save it, and restore it in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Command-Overview.html#index-pre_002dcommand_002dhook-1289&quot;&gt;&lt;code&gt;pre-command-hook&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-15T20:27:28.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2214" PostTypeId="1" AcceptedAnswerId="2219" CreationDate="2014-10-15T21:38:13.670" Score="20" ViewCount="5128" Body="&lt;p&gt;Is there an easy way to create a list of &quot;to-do&quot; items on-the-fly when writing code? For example, suppose that I am writing a function &lt;code&gt;write-this-now&lt;/code&gt; when I realize that I am also going to need to write a support function &lt;code&gt;write-this-later&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun write-this-now ()&#xA;  (unless (write-this-later) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of pausing to go create &lt;code&gt;write-this-later&lt;/code&gt;, I charge ahead as if it already existed.  However, I also want to make a note for myself that I still need to come back later and create it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution that I have used in the past is to add a comment with the word &lt;code&gt;TODO&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun write-this-now ()&#xA;  (unless (write-this-later) nil))  ; TODO create function `write-this-later`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I can come back at some later time and search the file for occurences of the word &lt;code&gt;TODO&lt;/code&gt;, and I will find this little note that I left for myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Are there any packages or extensions out there to facilitate easy creation and tracking of TODO items within a file or project?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I aggregate all of my TODO items from the current project into a single to-do list?  Can I add bookmarks in my to-do list that link back to the locations where I wrote the TODO items?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="25" LastEditDate="2015-05-03T10:01:43.230" LastActivityDate="2015-05-03T10:01:43.230" Title="Track &quot;TODO&quot; items when writing code" Tags="|programming|todo|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2215" PostTypeId="2" ParentId="11" CreationDate="2014-10-15T22:20:31.217" Score="9" Body="&lt;p&gt;This is very similar to artagnon's answer, but &lt;code&gt;replace-regexp&lt;/code&gt; is not bound to any key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I actually use &lt;code&gt;query-replace-regexp&lt;/code&gt; which is bound by default to &lt;code&gt;C-M-%&lt;/code&gt; and then replace &lt;code&gt;^&lt;/code&gt; with the given prefix &lt;code&gt;I said&lt;/code&gt; and then type &lt;code&gt;!&lt;/code&gt; to replace all without prompting anymore.&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-10-15T22:20:31.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2216" PostTypeId="2" ParentId="18" CreationDate="2014-10-15T22:45:17.580" Score="3" Body="&lt;p&gt;For the sake of completeness: deleting the first 3 characters from each line (formally: from the point on, or in the region) can be done by regexp-replacing &lt;code&gt;^...&lt;/code&gt; (or more generally: &lt;code&gt;^.\{3\}&lt;/code&gt;) with an empty string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Explanation: in regexen, &lt;code&gt;^&lt;/code&gt; means &quot;beginning of line&quot;, &lt;code&gt;.&lt;/code&gt; means &quot;any character&quot;, and &lt;code&gt;\{n\}&lt;/code&gt; means &quot;&lt;em&gt;n&lt;/em&gt; repetitions of the thing before&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has an additional benefit of being interactive (unless one presses &lt;code&gt;!&lt;/code&gt;, which makes &lt;code&gt;query-regexp-replace&lt;/code&gt; replace everything from now on without further questions).&lt;/p&gt;&#xA;" OwnerUserId="642" LastActivityDate="2014-10-15T22:45:17.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2217" PostTypeId="2" ParentId="18" CreationDate="2014-10-15T22:57:02.187" Score="0" Body="&lt;p&gt;And one more possibility:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;F3&lt;/kbd&gt;&lt;kbd&gt;C-a&lt;/kbd&gt;&lt;kbd&gt;C-3&lt;/kbd&gt;&lt;kbd&gt;C-d&lt;/kbd&gt;&lt;kbd&gt;C-n&lt;/kbd&gt;&lt;kbd&gt;F4&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;records a keyboard macro, saying basically &quot;move to the beginning of line, delete three characters, and move to the next line&quot;.  Then, you can replay it until the end of buffer by &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;F4&lt;/kbd&gt;, or &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-k&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt; to apply it to the lines in region.  This has one disadvantage: it will break when any line has less than 3 characters.&lt;/p&gt;&#xA;" OwnerUserId="642" LastActivityDate="2014-10-15T22:57:02.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2218" PostTypeId="1" AcceptedAnswerId="2224" CreationDate="2014-10-15T23:12:38.713" Score="26" ViewCount="3836" Body="&lt;p&gt;I'm aware of several different vim implementations in Emacs. There's evil-mode, viper, vimpulse and vim-mode. Are there others? How do they compare? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I note that there are a lot of &lt;code&gt;evil-*&lt;/code&gt; packages on MELPA, suggesting none of them are 100% feature-complete. What vim features do they provide, and what vim features are missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm not interested in the reverse where &quot;&lt;a href=&quot;http://www.finseth.com/emacs.html#47&quot;&gt;a set of vi macros that [are] a fairly full Emacs implementation&lt;/a&gt;&quot;!)&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-08-28T09:00:41.270" Title="What's the difference between the different vim implementations?" Tags="|vim-emulation|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2219" PostTypeId="2" ParentId="2214" CreationDate="2014-10-15T23:23:49.623" Score="18" Body="&lt;p&gt;You might want to try using &lt;a href=&quot;http://orgmode.org/manual/Capture.html&quot;&gt;org capture&lt;/a&gt;. When you initiate &lt;code&gt;org-capture&lt;/code&gt; from your source file it will insert a TODO item into an org-mode file with a link to the relevant area in the source code. &lt;code&gt;org-capture&lt;/code&gt; is smart enough to capture context-sensitive links--for instance, if you invoke it within a message in GNUS, it will capture a link directly to that message.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-10-16T17:29:03.843" LastActivityDate="2014-10-16T17:29:03.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2220" PostTypeId="2" ParentId="2214" CreationDate="2014-10-15T23:30:22.550" Score="17" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/rolandwalker/fixmee&quot;&gt;fixmee-mode&lt;/a&gt; offers highlighting of such notes and navigation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easily installed from MELPA and supports varying priorities of todo items.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-10-16T00:03:26.573" LastActivityDate="2014-10-16T00:03:26.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2221" PostTypeId="1" AcceptedAnswerId="2228" CreationDate="2014-10-15T23:41:40.280" Score="9" ViewCount="2372" Body="&lt;p&gt;When I want to switch between programs in Windows, I ordinarily use the windows key plus a number key to run a program from my taskbar. Most programs will either start running or, if there's already an instance, bring it to the foreground and focus on it. But Emacs (started with runemacs.exe) will create a new entry on the taskbar, and using the shortcut again will just create a new instance. As far as I can tell, I can't even switch between the different frames using Emacs commands (I tried C-x 5 o).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make it so subsequent uses of the windows hotkeys will just use the existing instance of Emacs and, if not, can I at least make it so I can easily navigate between the different frames? I tried this snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(unless (server-running-p)&#xA;  (start-server)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from the answer to &lt;a href=&quot;https://emacs.stackexchange.com/questions/146/set-up-emacs-on-windows-to-start-a-single-instance-and-open-files-in-the-existin&quot;&gt;this question&lt;/a&gt;, but it didn't make a difference.&lt;/p&gt;&#xA;" OwnerUserId="2088" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-17T17:42:15.093" Title="Running Emacs from Windows taskbar" Tags="|frames|microsoft-windows|integration|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2222" PostTypeId="1" CreationDate="2014-10-15T23:45:30.383" Score="5" ViewCount="2796" Body="&lt;p&gt;I have used a package before which used the header line to show the name of the current function being edited.  Whatever package it was, I don't have it installed now.  What are my options for getting this sort of functionality?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I have a persistent view (e.g. mode-line, header-line, etc.) of the current function being edited when the top of the function is past the top of the window?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-16T00:02:28.690" Title="Show current function in header line" Tags="|programming|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2223" PostTypeId="2" ParentId="268" CreationDate="2014-10-15T23:45:51.360" Score="33" Body="&lt;p&gt;There are several package repositories available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Official&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://elpa.gnu.org/&quot; rel=&quot;noreferrer&quot;&gt;GNU ELPA&lt;/a&gt; is the official package repo.&#xA;It's small, and requires copyright assignment (of all authors of a package) to the FSF to contribute to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Packages on GNU ELPA are really just &lt;a href=&quot;https://savannah.gnu.org/git/?group=emacs&quot; rel=&quot;noreferrer&quot;&gt;a git repo&lt;/a&gt;. The advantage of being hosted here is that the core team try to update packages if Emacs itself adds or deprecates features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Built from source&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://melpa.milkbox.net/&quot; rel=&quot;noreferrer&quot;&gt;MELPA&lt;/a&gt; is the &lt;a href=&quot;http://tracker.endlessparentheses.com/&quot; rel=&quot;noreferrer&quot;&gt;biggest and fastest growing&lt;/a&gt; package repo. It releases a new version every time a new version is pushed to a repo, or an EmacsWiki page is updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's bleeding edge, but it works very well in practice. MELPA is curated to avoid duplicate packages, and to ensure that the canonical home of package is recorded (instead of a random fork).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MELPA does have the problem that versions are just timestamps, e.g. &lt;code&gt;my-package-20131231.2359&lt;/code&gt;. This means if you depend on my-package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Package-Requires: ((my-package &quot;1.2.3&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then Emacs will think that any version on MELPA is new enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://melpa-stable.milkbox.net/&quot; rel=&quot;noreferrer&quot;&gt;MELPA Stable&lt;/a&gt; is the same as MELPA, but rather than using datestamp versions, it uses the versions in git tags. This allows for better dependency resolution, but &lt;a href=&quot;https://github.com/milkypostman/melpa/issues/1955&quot; rel=&quot;noreferrer&quot;&gt;has issues with depending on wiki packages&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;User uploads&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://marmalade-repo.org/&quot; rel=&quot;noreferrer&quot;&gt;Marmalade&lt;/a&gt; is much more like a traditional repository from other programming languages. The package developer uploads the package to Marmalade when they do a release.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle, this gives packages a proper release process (Marmalade predates MELPA stable) and also avoid the autogenerated version number problem. However, there's no identity verification. Anyone can upload a package, even if they didn't write it. This gets difficult if the maintainer of &lt;code&gt;my-package&lt;/code&gt; finds that someone else uploaded &lt;code&gt;my-package&lt;/code&gt; and can't subsequently upload new versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Marmalade used to be a node.js app, and it's now written in elisp. Both versions have had uptime problems occasionally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Project-specific&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;noreferrer&quot;&gt;Org-mode ELPA&lt;/a&gt; is a repo that only hosts &lt;code&gt;org&lt;/code&gt; and &lt;code&gt;org-plus-contrib&lt;/code&gt;. Org-mode is part of Emacs core, but it's developed externally and the code is only synced with Emacs trunk periodically. This repo lets you have the bleeding-edge org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://download.tuxfamily.org/user42/elpa/packages/&quot; rel=&quot;noreferrer&quot;&gt;User42 ELPA&lt;/a&gt; is a repo for a single package developer who has released &lt;a href=&quot;http://user42.tuxfamily.org/index.html&quot; rel=&quot;noreferrer&quot;&gt;quite a range of Emacs packages&lt;/a&gt;. If you like any of his packages, you could add this repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://joseito.republika.pl/sunrise-commander/&quot; rel=&quot;noreferrer&quot;&gt;Sunrise Commander ELPA&lt;/a&gt; is a repo for extensions for &lt;a href=&quot;http://www.emacswiki.org/emacs/Sunrise_Commander&quot; rel=&quot;noreferrer&quot;&gt;Sunrise Commander&lt;/a&gt; (an Emacs package for file browsing, inspired by midnight commander).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Retired&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://tromey.com/elpa/&quot; rel=&quot;noreferrer&quot;&gt;Tromey's ELPA&lt;/a&gt; was the first repo set up. It is officially replaced with GNU ELPA, but it didn't have the same copyright assignment requirements. As of 2010, it is no longer updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://jorgenschaefer.github.io/packages/&quot; rel=&quot;noreferrer&quot;&gt;Elpy package archive&lt;/a&gt; contained various packages developed by Jorgen Schaefer for &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;noreferrer&quot;&gt;'Elpy, the Emacs Python Development Environment'&lt;/a&gt;, but that has migrated to MELPA Stable.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="5444" LastEditDate="2018-06-14T09:13:16.760" LastActivityDate="2018-06-14T09:13:16.760" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2224" PostTypeId="2" ParentId="2218" CreationDate="2014-10-15T23:47:13.400" Score="35" Body="&lt;p&gt;&lt;code&gt;vi&lt;/code&gt;, &lt;code&gt;vip&lt;/code&gt; and &lt;code&gt;viper&lt;/code&gt; (ordered by creation date) come built-in with Emacs, all of those emulate VI. &lt;code&gt;vim-mode&lt;/code&gt; is a newer, stand-alone effort to actually emulate Vim, &lt;code&gt;vimpulse&lt;/code&gt; is a set of extras on top of &lt;code&gt;viper&lt;/code&gt; to give one the most useful Vim features. &lt;code&gt;evil&lt;/code&gt; was created as replacement to &lt;code&gt;vim-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;evil&lt;/code&gt; is the most recent project and the only one that's actively developed. Its goal is to emulate the editing model of Vim faithfully, leveraging existing Emacs functionality wherever it can. Personally I'd say it's about 90% complete, because a few newish commands (such as &lt;code&gt;gn&lt;/code&gt;) are missing, some display-related functionality is fairly hard to recreate (like the display of tildes after the end of a file) and it not implementing a Vimscript interpreter or anything beyond the basics of Ex mode. However it is easier to extend and to introspect than the original, the &lt;code&gt;evil-*&lt;/code&gt; extensions are the Emacs equivalent to Vim plugins in nearly all cases (&lt;code&gt;evil-leader&lt;/code&gt; for example would be an exception because it's not necessary to offer considering Emacs keymap support).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Considering &lt;code&gt;evil&lt;/code&gt; is surpassing Vim at points (see &lt;code&gt;:s&lt;/code&gt; and its visual preview or how little effort &lt;a href=&quot;https://github.com/syl20bnr/evil-lisp-state/blob/master/evil-lisp-state.el&quot; rel=&quot;noreferrer&quot;&gt;creating an useful new mode poses&lt;/a&gt;), I wholeheartedly recommend it to everyone interested in modal editing for Emacs.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-08-28T09:00:41.270" LastActivityDate="2016-08-28T09:00:41.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2225" PostTypeId="2" ParentId="2218" CreationDate="2014-10-15T23:50:11.300" Score="3" Body="&lt;p&gt;The goal of Evil is to emulate Vim, whereas the goal of Viper is to emulate Vi.  Vim-mode and Vimpulse are the predecessors of Evil and to my knowledge not developed anymore.  The Evil project was started to address shortcomings of these projects.&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2014-10-15T23:50:11.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2226" PostTypeId="2" ParentId="2222" CreationDate="2014-10-15T23:55:06.810" Score="11" Body="&lt;p&gt;This sounds a lot like you've followed &lt;a href=&quot;http://emacsredux.com/blog/2014/04/05/which-function-mode/&quot;&gt;this Emacs Redux blog post&lt;/a&gt; which is using &lt;code&gt;which-func-mode&lt;/code&gt;.  It explains its purpose (displaying the current function point is within), demonstrates how to enable and customize it and offers the following snippet to put the indicator in the header line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;;; Show the current function name in the header line&#xA;(which-function-mode)&#xA;(setq-default header-line-format&#xA;              '((which-func-mode (&quot;&quot; which-func-format &quot; &quot;))))&#xA;(setq mode-line-misc-info&#xA;            ;; We remove Which Function Mode from the mode line, because it's mostly&#xA;            ;; invisible here anyway.&#xA;            (assq-delete-all 'which-func-mode mode-line-misc-info))&#xA;&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-10-16T00:02:28.690" LastActivityDate="2014-10-16T00:02:28.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2227" PostTypeId="1" AcceptedAnswerId="2230" CreationDate="2014-10-16T00:02:24.973" Score="5" ViewCount="385" Body="&lt;p&gt;I'm using Mu4e to send emails.  When I encrypt a message, it is encrypted with the receiver's public key and since I don't have the corresponding private key I can't read the message.  Naturally, I want to be able to see the content of messages that I have sent to other people.  However, I don't want these messages to be stored in cleartext.  Some other MUAs encrypt the message two times: once for the receiver with his public key and once for storage in the sent folder with the senders public key.  How can I configure Emacs to replicate this behavior?&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2014-10-16T00:21:45.057" Title="How can I make encrypted messages readable in my sent folder" Tags="|init-file|mu4e|email|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2228" PostTypeId="2" ParentId="2221" CreationDate="2014-10-16T00:04:41.093" Score="8" Body="&lt;p&gt;Add this to your init file to make sure that an edit server is created when emacs starts&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(unless (server-running-p)&#xA;  (server-start)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now make your windows shortcut point to &lt;code&gt;emacsclientw.exe&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C:\path\to\emacsclientw.exe -n -e &quot;(raise-frame)&quot; -a &quot;C:\path\to\runemacs.exe&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should focus an existing Emacs frame (if any), or else call &lt;code&gt;runemacs.exe&lt;/code&gt; otherwise.  (Thanks to Vamsi for help with tuning the command parameters)&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2017-01-17T17:42:15.093" LastActivityDate="2017-01-17T17:42:15.093" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2229" PostTypeId="2" ParentId="2218" CreationDate="2014-10-16T00:13:00.910" Score="10" Body="&lt;p&gt;Since &lt;code&gt;evil&lt;/code&gt; is the only actively developed vim emulation mode to my knowledge, I'll make my answer evil-specific. &lt;code&gt;evil&lt;/code&gt; is highly usable and very close to a vim-like experience, but there are some vim features that most likely won't be implemented (by design) and some that are incomplete but might be added eventually. Some examples of things that most likely &lt;strong&gt;won't&lt;/strong&gt; be added:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There is no vimscript interpreter, and to my knowledge no plans to implement one.&lt;/li&gt;&#xA;&lt;li&gt;Incrementing and decrementing numbers (&lt;code&gt;C-a&lt;/code&gt; and &lt;code&gt;C-x&lt;/code&gt;) won't be added because &lt;code&gt;C-x&lt;/code&gt; is too important of an Emacs keybinding.&lt;/li&gt;&#xA;&lt;li&gt;There is no built-in concept of a leader key; instead, &lt;code&gt;\&lt;/code&gt; is bound to &lt;code&gt;evil-execute-in-emacs-state&lt;/code&gt; by default.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u&lt;/code&gt; isn't bound to scrolling up by default because it's too important as an Emacs keybinding (although you can overwrite this with &lt;code&gt;evil-want-C-u-scroll&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To find a list of vim features that &lt;strong&gt;aren't implemented yet&lt;/strong&gt; (as of the time of writing this answer), the best place to look is the &lt;a href=&quot;https://bitbucket.org/lyro/evil/issues&quot;&gt;issue tracker&lt;/a&gt;. A random sampling of things that are on the list:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/426/ex-appending-to-file-doesnt-work&quot;&gt;Appending a file with &lt;code&gt;ex&lt;/code&gt; isn't implemented&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/51/a-few-motion-commands&quot;&gt;Some motion commands don't behave like vim&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/433/map-make-to-compile&quot;&gt;&lt;code&gt;:make&lt;/code&gt; isn't mapped to &lt;code&gt;M-x compile&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/400/evil-ctrl-o-does-not-behave-as-in-vim&quot;&gt;&lt;code&gt;C-o&lt;/code&gt; in &lt;code&gt;insert&lt;/code&gt; mode doesn't behave quite like it does in vim&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/338/swap-buffers-in-windows-not-implemented&quot;&gt;Swap window buffers isn't implemented&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are many more, including commands that aren't in the open issue list (especially complicated &lt;code&gt;ex&lt;/code&gt; commands), but as you can see from the list they tend to be fairly minor or obscure vim features (vim is a rather large target with which to achieve 100% feature parity). &lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-10-16T00:13:00.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2230" PostTypeId="2" ParentId="2227" CreationDate="2014-10-16T00:21:45.057" Score="5" Body="&lt;p&gt;The usual approach is to force encryption to happen for your own key, in addition to the recipients' (and that's only one encryption).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on what you use exactly, you might want to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mml2015-encrypt-to-self t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;encrypt-to FOO&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your gnupg configuration, or anything similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way, your messages will be stored encrypted, and you'll be asked for your passphrase whenever you want to access them.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-10-16T00:21:45.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2231" PostTypeId="2" ParentId="268" CreationDate="2014-10-16T01:46:21.370" Score="14" Body="&lt;p&gt;Some additional info, to supplement the other answers here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Some info about MELPA and MELPA &quot;stable&quot; -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start by looking at &lt;a href=&quot;https://stackoverflow.com/q/24867376/729907&quot;&gt;&lt;strong&gt;this pretty-much duplicate question&lt;/strong&gt;&lt;/a&gt;, from StackOverflow, including the comments for the question itself. In particular, this comment that I posted, after exchanging email with Donald Curtis (maintainer of MELPA and MELPA stable):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;From his point of view&lt;/em&gt; [Donald Curtis's, and as I understand his communication to me], &lt;em&gt;the &quot;stable&quot; MELPA site is in &lt;strong&gt;maintenance mode only&lt;/strong&gt;. And the only reason that code like mine is not there is that no one has implemented uploading from the wiki&lt;/em&gt; [Emacs Wiki] &lt;em&gt;for the &quot;stable&quot; site. Also, there is no &quot;curating&quot; done by anyone - no filtering to determine whether a package is stable, risky etc. The existence of two sites was requested by some package developers who wanted to distinguish dev versions of their packages from older (&quot;stable&quot;) versions.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In sum, &lt;em&gt;there is nothing that is inherently more &quot;stable&quot; about the content on &quot;MELPA stable&quot;&lt;/em&gt;. The version numbering and feed method can be different; that's all.  And if a particular package maintainer wants to distinguish &quot;stable&quot; from &quot;development&quot; versions, and wants to do that by uploading them to the two different sites, then that is the effect - &lt;em&gt;for that package&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One difference between MELPA and Marmalade (and GNU ELPA) is that it is not required that code contributed to MELPA be sourced from a git repository.  In particular, it can be automatically pulled from the &lt;a href=&quot;http://www.emacswiki.org/emacs/elisp-area-compact-no-bootstrap.html?action=elisp-area;context=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Elisp Area of Emacs Wiki&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that mean, as some have said, that anyone can upload anything, and you have no way of knowing whether the code is actually by the claimed author, etc.? Yes and no.  In general, yes: anyone is free to upload Elisp code to Emacs Wiki.  As the top of the Elisp-Area page says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;This is the EmacsWiki elisp area, where we collect EmacsLisp files. No login required, no version control required, no ftp required, no password required. It’s as simple as the wiki itself. That also means that anybody can place malicious code in these EmacsLisp files. If in doubt, don’t use them.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, just so you know, I am an administrator of the wiki, and my own Lisp libraries in the wiki Elisp Area are locked pages.  That means that only a wiki administrator can upload them.  So in this case, you can be pretty sure that libraries of mine that you download from MELPA or Emacs Wiki were uploaded by me.  As with everything on the Internet, however, there is no ironclad guarantee, just as there is no guarantee with the code itself.  As the GPL blurb in every GPL library says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;HTH.  Happy hacking.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-16T01:46:21.370" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2232" PostTypeId="2" ParentId="212" CreationDate="2014-10-16T04:57:50.843" Score="1" Body="&lt;p&gt;I use this util I wrote&#xA;&lt;a href=&quot;https://github.com/xahlee/xah-find&quot; rel=&quot;nofollow&quot;&gt;xah_find.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote it because:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Pure elisp. No more worry about grep on Windows or Unicode transmission between emacs to Operating System. &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_grep_problem.html&quot; rel=&quot;nofollow&quot;&gt;emacs grep problem&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;If you are heavy unicode user, the unix tools has some semi-bugs. &lt;a href=&quot;http://xahlee.info/comp/unix_uniq_unicode_bug.html&quot; rel=&quot;nofollow&quot;&gt;linux uniq problem&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;I do find/replace every week on 5k files. I was using dired-do-query-replace-regexp for years. I find the interactive nature really zapped my time, yet I do need to check results of the changes. So, my solution is now run batch but have a nice report that I can scan at all find/replace results, with option to write to file.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This elisp util is perhaps 5 to 10 times slower than calling unix grep in emacs, but worked ok for me.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-10-08T06:58:47.290" LastActivityDate="2016-10-08T06:58:47.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2233" PostTypeId="1" AcceptedAnswerId="2248" CreationDate="2014-10-16T07:41:24.623" Score="2" ViewCount="93" Body="&lt;p&gt;I am downloading mail using fetchmail from a pop account and using gnus to read mails from the maildir.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to run elisp code on emails that are matched by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Fancy-Mail-Splitting.html&quot; rel=&quot;nofollow&quot;&gt;fancy split rules&lt;/a&gt;, or something similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My end goal would be to match all mails from export@client.com and run elisp code to extract the data and upload it to a server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read the linked manual and got the idea after reading this portion&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(! func split)&#xA;If the split is a list, and the first element is !, &#xA;then split will be processed, and func will be called as a &#xA;function with the result of split as argument. func should return a split.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would I be able to use the function to run code for the side effects and still return the split, or am I on the completely wrong track?&lt;/p&gt;&#xA;" OwnerUserId="294" LastActivityDate="2014-10-16T14:51:12.213" Title="How do I run elisp code on a filtered email in Gnus?" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2234" PostTypeId="2" ParentId="236" CreationDate="2014-10-16T08:55:52.910" Score="6" Body="&lt;p&gt;The result that you want is already an AUCTeX feature since &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/commit/latex.el?id=f8c1d44c62f958e19d924deeb51c54f2413e1ef6&quot;&gt;October 2013&lt;/a&gt;. This is not yet present in the current release (11.87).&#xA;All you have to do is mark the region and hit &lt;kbd&gt;TAB&lt;/kbd&gt;.&#xA;See &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/tree/latex.el?id=f8c1d44c62f958e19d924deeb51c54f2413e1ef6#n6025&quot;&gt;&lt;code&gt;LaTeX-hanging-ampersand-position&lt;/code&gt;&lt;/a&gt; for how the indentation is implemented.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="25" LastEditDate="2014-10-16T10:14:14.137" LastActivityDate="2014-10-16T10:14:14.137" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2235" PostTypeId="2" ParentId="283" CreationDate="2014-10-16T09:05:34.640" Score="14" Body="&lt;p&gt;Here's how &lt;a href=&quot;https://github.com/abo-abo/lispy&quot;&gt;lispy&lt;/a&gt; re-formatted it for me&#xA;(by pressing &lt;kbd&gt;M&lt;/kbd&gt; at either end of the expression):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-example-function ()&#xA;  (let ((a (do-something))&#xA;        (b (do-something)))&#xA;    (setq someone me)&#xA;    (with-current-buffer b (do-that (or this (and that those)))&#xA;                         (format &quot;%s&quot; a))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get from this to the formatting that you specified, press &lt;kbd&gt;qk C-m [&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-10-16T09:05:34.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2236" PostTypeId="1" AcceptedAnswerId="2238" CreationDate="2014-10-16T09:55:24.097" Score="13" ViewCount="1564" Body="&lt;p&gt;It is sometimes convenient to define file local variables with&#xA;comments such as the following, which &lt;em&gt;must&lt;/em&gt; be at the end of a file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# fill-column: 80&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, in org-mode buffers, this comments are considered to be&#xA;“inside” the very last headline. For instance, in the following&#xA;buffer, the comments will be hidden whenever subtrees &lt;code&gt;C&lt;/code&gt; or &lt;code&gt;B&lt;/code&gt; are&#xA;hidden.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;* B&#xA;** C&#xA;&#xA;# Local Variables:&#xA;# fill-column: 80&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don’t really mind this hiding.&lt;br&gt;&#xA;&lt;strong&gt;The real problem is that the comments will get carried along whenever I move the &lt;code&gt;C&lt;/code&gt; subtree somewhere else.&lt;/strong&gt;&#xA;For instance, if I call &lt;code&gt;org-refile&lt;/code&gt; on &lt;code&gt;C&lt;/code&gt;, or if I move it around&#xA;with &lt;code&gt;org-metaup&lt;/code&gt; (and the likes), the comments are moved along with&#xA;the subtree, and then they obviously stop working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tell &lt;code&gt;org-mode&lt;/code&gt; to stop doing this?&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-16T11:29:25.300" Title="Prevent org-mode from swallowing file-local variables" Tags="|org-mode|file-local-variables|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2237" PostTypeId="1" AcceptedAnswerId="2256" CreationDate="2014-10-16T10:43:00.720" Score="5" ViewCount="276" Body="&lt;p&gt;I'm using Outline mode (usually the minor mode, but it shouldn't matter) or Org mode. I have a file that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    -*-outline-*-&#xA;* Chapter 1&#xA;** Section 1.1&#xA;*** Subsection 1.1.1&#xA;foo&#xA;*** Subsection 1.1.2&#xA;bar&#xA;** Section 1.2&#xA;baz&#xA;* Chapter 2&#xA;** Section 2.1&#xA;qux&#xA;** Section 2.2&#xA;wib&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm editing subsection 1.1.1 (“foo”). I want to focus on this section, so I run &lt;code&gt;C-c C-o&lt;/code&gt; (&lt;code&gt;hide-other&lt;/code&gt;). This is what I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    -*-outline-*-&#xA;* Chapter 1&#xA;** Section 1.1&#xA;*** Subsection 1.1.1&#xA;foo...&#xA;* Chapter 2...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the old days of Emacs 19 (the behavior changed after 19.34 and before 20.7), I saw this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    -*-outline-*-&#xA;* Chapter 1&#xA;** Section 1.1&#xA;*** Subsection 1.1.1&#xA;foo&#xA;*** Subsection 1.1.2...&#xA;** Section 1.2...&#xA;* Chapter 2...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The difference is that the headers for Section 1.2 and Subsection 1.1.2 are shown, because they're a sibling of Section 1.1 which contains Subsection 1.1.1 which I'm viewing. I like that. How can I get this behavior in a modern Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm mainly looking for is a way to make &lt;code&gt;hide-other&lt;/code&gt; (or a separate command) show all siblings of all visible headers (if I'm in Subsection 1.1.1, I want to see the headers for Section 1.2 and Subsection 1.1.2, and so on). More generally, I'd like a command &lt;code&gt;outline-show-all-siblings-of-visible-headers&lt;/code&gt;. Is there such a thing?&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-10-16T17:20:14.523" LastActivityDate="2014-10-18T01:20:00.920" Title="Show siblings of visible headers after hide-other" Tags="|org-mode|outline-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2238" PostTypeId="2" ParentId="2236" CreationDate="2014-10-16T10:49:01.577" Score="12" Body="&lt;p&gt;Based on a quick skim through the documentation on &lt;a href=&quot;http://orgmode.org/worg/dev/org-syntax.html&quot;&gt;Org Syntax&lt;/a&gt;, I don't think there is a built-in way for doing this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possible workaround would be to add a top-level headline such as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* File-local variables&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;above the local variables section and tag it with &lt;code&gt;:noexport:&lt;/code&gt;. Of course, the tag is only necessary if you are planning on exporting the parent document.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to look into implementing a custom solution, looking at how &lt;code&gt;org-mode&lt;/code&gt; uses the &lt;code&gt;org-list-empty-line-terminates-plain-lists&lt;/code&gt; variable &lt;em&gt;might&lt;/em&gt; be helpful. As the name suggests, when this variable is set to a non-&lt;code&gt;nil&lt;/code&gt; value, a single empty line is enough to end a plain list, so it might be possible to get something similar working for subtrees.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-10-16T11:08:06.603" LastActivityDate="2014-10-16T11:08:06.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2239" PostTypeId="2" ParentId="2236" CreationDate="2014-10-16T11:23:58.393" Score="7" Body="&lt;p&gt;I have averted this problem inadvertently as I always use some footnote in my documents. Doing &lt;code&gt;C-c C-x f&lt;/code&gt; will insert a footnote and that will auto create &lt;code&gt;* Footnotes&lt;/code&gt; section at the end of the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a special buffer and it is never exported as a section by org-mode. So you would never need to move this section around in the hierarchy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if you don't use footnotes, it won't hurt to keep an empty &lt;code&gt;* Footnotes&lt;/code&gt; section at the end as it would never export as a section. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I would do: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do &lt;code&gt;C-c C-x f&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Give the footnote some text like &quot;This is a dummy footnote.&quot;. &lt;/li&gt;&#xA;&lt;li&gt;Delete the auto created reference &lt;code&gt;[fn:1]&lt;/code&gt; from the main area (not the Footnotes section). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I suggested doing this as I am not sure if org-mode detects the presence of valid footnote descriptions in the Footnotes section to count it as a special section.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-16T11:29:25.300" LastActivityDate="2014-10-16T11:29:25.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2240" PostTypeId="2" ParentId="2214" CreationDate="2014-10-16T11:24:40.253" Score="2" Body="&lt;p&gt;Whilst not &lt;em&gt;entirely&lt;/em&gt; on-topic for emacs, I use the simple trick of creating the stub of the method/property/whatever when I hit that 'to do' moment, containing nothing more than an assertion that says &quot;Write Me!&quot; or similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code then compiles cleanly, and tells me at runtime where my TODO items are.&lt;/p&gt;&#xA;" OwnerUserId="2102" LastActivityDate="2014-10-16T11:24:40.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2241" PostTypeId="2" ParentId="2236" CreationDate="2014-10-16T11:28:52.523" Score="9" Body="&lt;p&gt;I keep a top level headline at the end of my Org files called &lt;code&gt;* Configuration&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ensure it is tagged &lt;code&gt;:NOEXPORT:ARCHIVE:&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this it does not get exported (thanks to the &lt;code&gt;:noexport:&lt;/code&gt; tag) and additionally the content does not get revealed when cycling globally (thanks to the &lt;code&gt;:ARCHIVE:&lt;/code&gt; tag).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also put the various Org relation configuration options (&lt;code&gt;#+TITLE:&lt;/code&gt;, &lt;code&gt;#+AUTHOR&lt;/code&gt;, &lt;code&gt;#+OPTIONS&lt;/code&gt;, etc) under this headline so they do not take up visual space unless I want to edit them.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-16T11:28:52.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2242" PostTypeId="1" AcceptedAnswerId="2249" CreationDate="2014-10-16T11:56:15.733" Score="6" ViewCount="383" Body="&lt;p&gt;Currently I have a bunch of code snippets in my Org-based presentation. I'm exporting them with &lt;code&gt;ox-reveal&lt;/code&gt;, but the exported code doesn't have any syntax highlighting. Is there any way to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;have syntax highlighting in code blocks in org-mode?&lt;/li&gt;&#xA;&lt;li&gt;ensure that the syntax highlighting is carried through to the exported HTML?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="129" LastEditorUserId="25" LastEditDate="2014-10-16T12:38:17.197" LastActivityDate="2014-10-16T14:54:08.547" Title="Applying major-mode font locking to exported org-babel snippets" Tags="|org-mode|org-export|syntax-highlighting|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2243" PostTypeId="1" AcceptedAnswerId="2247" CreationDate="2014-10-16T13:04:41.410" Score="9" ViewCount="1702" Body="&lt;p&gt;In general all timestamps in Org-mode appears as &lt;code&gt;[YYYY-MM-DD Day]&lt;/code&gt;. I have one file (buffer) where I would like the format to be different. Either just &lt;code&gt;[YYYY-MM-DD]&lt;/code&gt; or &lt;code&gt;[YYYY-MM]&lt;/code&gt;. How do I tell Org-mode to use a custom format for this one buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be happy to have it automatic, which I think means something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- coding: utf-8; eval: (org-time-stamp-custom-formats '(&quot;&amp;lt;%Y-%m&amp;gt;&quot;)); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As the first line, or have a code block that I evaluate with &lt;code&gt;C-c C-c&lt;/code&gt; each time I work in that buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(make-local-variable 'org-time-stamp-custom-formats)&#xA;(make-local-variable 'org-display-custom-times)&#xA;(setq org-time-stamp-custom-formats '(&quot;&amp;lt;%Y-%m&amp;gt;&quot;))&#xA;(setq-default org-display-custom-times t)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2014-10-16T15:55:37.843" Title="How can I change Org-mode time format for one buffer?" Tags="|org-mode|file-local-variables|time-date|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2244" PostTypeId="2" ParentId="2243" CreationDate="2014-10-16T13:24:41.727" Score="5" Body="&lt;p&gt;The following will work:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# org-time-stamp-custom-formats: (&amp;quot;&amp;lt;%Y-%m&amp;gt;&amp;quot; . &amp;quot;&amp;lt;%Y-%m %H:%M&amp;gt;&amp;quot;)&#xA;# eval: (org-toggle-time-stamp-overlays)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Using &lt;code&gt;(org-toggle-time-stamp-overlays)&lt;/code&gt; (&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-t&lt;/kbd&gt;) to ensure they are properly displayed.&lt;/p&gt;&#xA;&lt;p&gt;You will need to confirm that these are safe local variables for them to apply however once they are approved the document will load with them already showing.&lt;/p&gt;&#xA;&lt;p&gt;Toggle command referenced from the &lt;a href=&quot;http://orgmode.org/manual/Custom-time-format.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org Manual&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Edit&lt;/h3&gt;&#xA;&lt;p&gt;Showing differences between the various local variable settings&lt;/p&gt;&#xA;&lt;p&gt;The three pictures below show:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Answer as above&lt;/li&gt;&#xA;&lt;li&gt;Answer without including the &lt;code&gt;eval&lt;/code&gt; line.  This does not show the custom timestamps.  &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-t&lt;/kbd&gt; will toggle them to be visible&lt;/li&gt;&#xA;&lt;li&gt;Incomplete &lt;code&gt;org-time-stamp-custom-formats&lt;/code&gt; specification.  If custom timestamps are toggled the timestamps are no longer fontified.  They will show properly once custom timestamp overlays are removed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HZ3J2.png&quot; alt=&quot;Various Local Variable Settings&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-16T15:14:11.693" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2245" PostTypeId="1" CreationDate="2014-10-16T13:59:49.207" Score="2" ViewCount="132" Body="&lt;p&gt;I don't really like the feeling of &lt;em&gt;not being in control&lt;/em&gt; when using &lt;code&gt;emacs&lt;/code&gt;' abbreviations feature. On the one hand, I don't want to be asked all the time but on the other hand I'd like to know when an abbreviation is expanded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I fired up &lt;code&gt;emacs&lt;/code&gt; (just kidding, it was already running) and did some &lt;code&gt;elisp&lt;/code&gt; coding. Using some &lt;a href=&quot;https://github.com/k-talo/volatile-highlights.el&quot; rel=&quot;nofollow&quot;&gt;inspiration&lt;/a&gt; I got a working prototype, that is a &lt;code&gt;minor-mode&lt;/code&gt; which highlights the expansion inserted by &lt;code&gt;abbrev-mode&lt;/code&gt; for some time (default is 0.5s). You can find the code below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after using this code for some time, I noticed that from time to time, the seemingly random parts of the buffer are highlighted. It appears my &lt;em&gt;&quot;hooking&quot;&lt;/em&gt; into &lt;code&gt;expand-abbrev&lt;/code&gt; is not working. So here comes the actual question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How do you advice &lt;code&gt;expand-abbrev&lt;/code&gt; such that the advised code gets only executed when there really was an expansion?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I did some digging in the &lt;code&gt;abbrev&lt;/code&gt; code, added some debug statements, etc. but could not get it to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, although it has been fun fiddling around with &lt;code&gt;elisp&lt;/code&gt;, I don't think my code is idiomatic and I would not be surprised if there were a better way to approach the problem, thus &lt;strong&gt;any comments&lt;/strong&gt; on the code and how it can be improved are appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here comes the code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice expand-abbrev (after expand-abbrev-after-expansion-flash)&#xA;  (ahl/add-range last-abbrev-location (+ last-abbrev-location (length (symbol-value last-abbrev)))))&#xA;&#xA;(defface ahl/default-face&#xA;  '((((class color) (background light))&#xA;     (:background &quot;yellow1&quot;))&#xA;    (((class color) (background dark))&#xA;     (:background &quot;SkyBlue4&quot;))&#xA;    (t :inverse-video t))&#xA;  &quot;Face used for abbrev highlights.&quot;)&#xA;&#xA;(defvar ahl/default-time 0.5&#xA;  &quot;Time the abbrev high light should last.&quot;)&#xA;&#xA;(defun ahl/add-range (beg end &amp;amp;optional buf face time)&#xA;  &quot;Add a highlight for `TIME' second to the buffer `BUF' at&#xA;the position specified by `BEG' and `END' using the face `FACE'.&#xA;&#xA;When the buffer `BUF' is not specified or its value is `nil',&#xA;highlight will be added to current buffer.&#xA;&#xA;When the face `FACE' is not specified or its value is `nil',&#xA;the default face `ahl/default-face' will be used as the value.&#xA;&#xA;When the time `TIME' is not specified or its value is `nil',&#xA;the default value `ahl/default-time' will be used as the value.&quot;&#xA;  (let* ((face (or face 'ahl/default-face))&#xA;         (hl (ahl/--make-hl beg end buf face))&#xA;         (time (or time ahl/default-time)))&#xA;    (run-with-idle-timer time nil (lambda (hl)&#xA;                                    (ahl/--remove-hl hl)) hl)))&#xA;&#xA;(defun ahl/--make-hl (beg end buf face)&#xA;  &quot;Make a highlight at the position specified by `BEG' and `END'.&quot;&#xA;  (let (hl)&#xA;    ;; GNU Emacs&#xA;    (setq hl (make-overlay beg end buf))&#xA;    (overlay-put hl 'face face)&#xA;    (overlay-put hl 'priority 1)&#xA;    (overlay-put hl 'abbrev-high-light t)&#xA;    hl))&#xA;&#xA;(defun ahl/--remove-hl (hl)&#xA;  &quot;Clear highlight.&quot;&#xA;  (and (overlayp hl)&#xA;       (delete-overlay hl)))&#xA;&#xA;(define-minor-mode abbrev-high-light-mode&#xA;  &quot;Highlight abbreviations upon expansion.&quot; nil&#xA;  :lighter &quot;&quot;&#xA;  (if abbrev-high-light-mode&#xA;      (progn&#xA;        (ad-enable-advice 'expand-abbrev 'after 'expand-abbrev-after-expansion-flash)&#xA;        (ad-activate 'expand-abbrev))&#xA;    (ad-disable-advice 'expand-abbrev 'after 'expand-abbrev-after-expansion-flash)&#xA;    (ad-activate 'expand-abbrev)))&#xA;&#xA;(provide 'abbrev-high-light)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="448" LastActivityDate="2014-10-16T14:26:23.583" Title="Highlight abbrev upon expansion" Tags="|elisp|font-lock|abbrev|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2246" PostTypeId="2" ParentId="2245" CreationDate="2014-10-16T14:26:23.583" Score="2" Body="&lt;p&gt;I'm not sure if this is what you are looking for, but the package you linked to can be extended to capture abbrev expansion like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'volatile-highlights)&#xA;(volatile-highlights-mode t)&#xA;(vhl/define-extension 'abbrev 'expand-abbrev)&#xA;(vhl/install-extension 'abbrev)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2106" LastActivityDate="2014-10-16T14:26:23.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2247" PostTypeId="2" ParentId="2243" CreationDate="2014-10-16T14:48:58.343" Score="8" Body="&lt;p&gt;You need to define the variable &lt;code&gt;org-time-stamp-custom-formats&lt;/code&gt;, not to call a function. What you type after the variable name and colon is a value (what you might type after &lt;code&gt;'&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- org-time-stamp-custom-formats: (&quot;&amp;lt;%Y-%m&amp;gt;&quot; . &quot;&amp;lt;%Y-%m-%d %H:%M&amp;gt;&quot;) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# org-time-stamp-custom-formats: (&quot;&amp;lt;%Y-%m&amp;gt;&quot; . &quot;&amp;lt;%Y-%m-%d %H:%M&amp;gt;&quot;)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the variable must contain two formats — conventionally one with only the date and one with the date and time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org mode doesn't declare this variable as being customizable in file options, so you will get a warning the first time you load a file. Choose &lt;code&gt;!&lt;/code&gt; to accept this particular value of &lt;code&gt;org-time-stamp-custom-formats&lt;/code&gt; (Emacs will update your init file). More generally, you can validate a class of values of &lt;code&gt;org-time-stamp-custom-formats&lt;/code&gt; as being safe by declaring a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Local-Variables.html#File-Local-Variables&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;safe-local-variable&lt;/code&gt; property&lt;/a&gt; (it would make sense for Org mode itself to do it).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-time-stamp-custom-formats-safep (value)&#xA;  (and (consp value)&#xA;       (stringp (car value))&#xA;       (stringp (cdr value))))&#xA;(put 'org-time-stamp-custom-formats 'safe-local-variable #'org-time-stamp-custom-formats-safep)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Furthermore you need to add the &lt;code&gt;customtime&lt;/code&gt; startup option, as described in the documentation of &lt;code&gt;org-display-custom-times&lt;/code&gt;. Thus, in addition to the &lt;code&gt;-*-&lt;/code&gt; lines or &lt;code&gt;Local Variables:&lt;/code&gt; block above, you need this directive anywhere in your file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: customtime&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-10-16T15:55:37.843" LastActivityDate="2014-10-16T15:55:37.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2248" PostTypeId="2" ParentId="2233" CreationDate="2014-10-16T14:51:12.213" Score="1" Body="&lt;p&gt;I spent a few hours reading the docs and testing a solution. I have now solved this as per below.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Set the nnmail split method to &quot;nnmail-split-fancy&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nnmail-split-methods 'nnmail-split-fancy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows one to match incoming emails to groups.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set the var nnmail-split-fancy to define the rules to filter emails&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nnmail-split-fancy '(|&#xA;           (any &quot;deploy@client&quot; (: script-send-mail))&#xA;           &quot;mail.misc&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &quot;|&quot; char can be thought of as an OR and the &quot;:&quot; as &quot;execute function and  return group&quot;.&#xA;The rule above is the equivalent of saying &quot;If any incoming mail's headers match 'deploy@client' then file according to the return of the function 'script-send-mail', else file in 'mail.misc'&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Write function script-send-mail to operate on the current mail's buffer-string&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun script-send-mail ()&#xA;  (save-excursion&#xA;     (save-restriction&#xA;      ;; (widen) is necessary to get body of email&#xA;      (widen)&#xA;      (progn&#xA;        ;; Extract data and send to server&#xA;        (script-extract-data (buffer-string))&#xA;        ;; final return is a gnus group&#xA;        (format &quot;mail.deploy&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, whenever an incoming mail is received matching deploy@client.com The function will run and do what it needs to with the email before it is sent to a group.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;*ps: Not sure if Answering my own question is acceptable. Please close if I have crossed any guidelines.&lt;/p&gt;&#xA;" OwnerUserId="294" LastActivityDate="2014-10-16T14:51:12.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2249" PostTypeId="2" ParentId="2242" CreationDate="2014-10-16T14:54:08.547" Score="4" Body="&lt;p&gt;You can enable syntax highlighting of code blocks in org-mode by setting &lt;code&gt;org-src-fontify-natively&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will probably not help exporting to ox-reveal. In any case &quot;normal&quot; HTML export syntax highlighting (without ox-reveal) is enabled by default if you have &lt;code&gt;htmlize.el&lt;/code&gt; installed, so it may be worthwile checking if you have htmlize installed. See &lt;a href=&quot;https://stackoverflow.com/questions/24082430/org-mode-no-syntax-highlighting-in-exported-html-page&quot;&gt;this answer on SO&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="204" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-16T14:54:08.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2250" PostTypeId="1" CreationDate="2014-10-16T15:22:05.793" Score="13" ViewCount="442" Body="&lt;p&gt;I have a client, a Ph.D. candidate in Computational Chemistry, that is visually impaired. He's pretty self sufficient and he's had some success learning the content by directly reading source, when available, for most texts. He does this to read the LaTeX, when used, in order to understand the math. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He's also trying to learn Python, which relies on indentation to identify code blocks. I've helped him hack the python mode to trigger system alerts every time he uses auto-indent, and this seems to work ok for now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He works on a windows client to access a unix server for his computation. Generally his Emacs is running on the server and he's accessing it through X-forwarding. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've come across &lt;a href=&quot;http://emacspeak.sourceforge.net/&quot;&gt;Emacspeak&lt;/a&gt;, but it appears to target linux boxes. There are a variety of text-to-speech tools for the Windows platform, and I think his preference is to use &lt;a href=&quot;http://www.freedomscientific.com/Products/Blindness/Jaws&quot;&gt;JAWS&lt;/a&gt;. These tools are helpful, but they can complicate the process when they compete with native teach-to-speech features of various applications. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Besides Emacspeak, are there other tools or techniques for efficiently using Emacs if you're visually impaired?&lt;/strong&gt; Are there essential details I need to know about Emacspeak in order to benefit from it?&lt;/p&gt;&#xA;" OwnerUserId="2107" LastEditorUserId="2107" LastEditDate="2014-10-16T15:55:28.373" LastActivityDate="2014-10-17T17:50:15.320" Title="Are there Emacs tools for the visually-impaired?" Tags="|accessibility|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2252" PostTypeId="2" ParentId="2237" CreationDate="2014-10-16T15:43:30.683" Score="1" Body="&lt;p&gt;Here is an modified solution that should reflect the requirements better. Not extensively tested nor optimized.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-outline-show-near-relatives ()&#xA;  &quot;Hides body of all other headings while keeping headers only of siblings and elder relatives.&quot;&#xA;  (interactive)&#xA;  (save-excursion    &#xA;    (let ((level (progn&#xA;                   (outline-back-to-heading)&#xA;                   (funcall outline-level))))&#xA;      (hide-other)&#xA;      (while (&amp;gt; level 1)&#xA;        (outline-up-heading 1)&#xA;        (show-children 1)&#xA;        (setq level (funcall outline-level))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see it in action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XbTHV.gif&quot; alt=&quot;screencast of outlining command&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First attempt for posterity sake&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an attempt that does what I think you want. Not extensively tested&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-outline-show-all-siblings-of-visible-headers ()&#xA;  &quot;Hides body of all other headings while keeping headers of&#xA;only visible siblings.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (hide-other)&#xA;    (outline-up-heading 1)&#xA;    (show-children 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For instance the following layout is outlined as follows depending on where point is.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Chapter 1&#xA;** Section 1.1&#xA;foo&#xA;** Section 1.2&#xA;bar&#xA;*** Section 1.2.1&#xA;lorem&#xA;*** Section 1.2.2&#xA;ipsum&#xA;** Section 1.3&#xA;abracadabra&#xA;*** Section 1.3.1&#xA;hocus pocus&#xA;* Chapter 2&#xA;** Section 2.1&#xA;qux&#xA;** Section 2.2&#xA;wib&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When point ▌is in Section 1.2.2, it becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; * Chapter 1&#xA; ...&#xA; ** Section 1.2&#xA; ...&#xA; *** Section 1.2.1...&#xA; *** Section 1.2.2&#xA; ipsum▌...&#xA; * Chapter 2...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When point is in Section 1.3, it becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Chapter 1&#xA;** Section 1.1...&#xA;** Section 1.2...&#xA;** Section 1.3&#xA;abracadabra▌ ...&#xA;* Chapter 2...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-10-18T01:20:00.920" LastActivityDate="2014-10-18T01:20:00.920" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2253" PostTypeId="1" AcceptedAnswerId="2255" CreationDate="2014-10-16T17:37:34.253" Score="8" ViewCount="941" Body="&lt;p&gt;I was completing the &lt;a href=&quot;https://github.com/gregmalcolm/python_koans&quot;&gt;python koans&lt;/a&gt; in emacs, and I was using a kdb macro to test my changes in a shell buffer and jump back into the python code. I wanted to take the line number of the next error from the shell buffer so that I could leap to it directly, but because the execution took a moment, it killed the previous output instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I insert a pause into a macro while I'm recording it?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-10-18T00:09:42.330" Title="Sleep in an kbd macro" Tags="|keyboard-macros|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2254" PostTypeId="1" AcceptedAnswerId="2257" CreationDate="2014-10-16T17:44:48.093" Score="4" ViewCount="1944" Body="&lt;p&gt;After I did an overhaul of my &lt;code&gt;.emacs&lt;/code&gt; file yesterday (adding/removing packages, organizing, etc.), I'm left with an annoying screen flicker.  It happens when I move the cursor to the edge of the buffer and keep trying to move it in that direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, below is a video in which I start up Emacs, navigate my cursor to the top of the new scratch buffer (&lt;code&gt;C-p&lt;/code&gt;) and then continue pressing &lt;code&gt;C-p&lt;/code&gt;.  It does the same thing if I do &lt;code&gt;C-g&lt;/code&gt; (cancel command) when there are no commands to be cancelled as well as a number of other commands which don't move the cursor.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before adding a list of packages / settings from my &lt;code&gt;.emacs&lt;/code&gt; file into this post, I thought I'd ask if anyone had experienced similar problems and if there were any quick changes to settings that did the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PnUfn.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="25" LastEditDate="2014-10-16T17:54:48.613" LastActivityDate="2014-10-16T18:12:57.470" Title="Emacs flickers when I run certain commands (gif screencast included)" Tags="|error-handling|bell|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2255" PostTypeId="2" ParentId="2253" CreationDate="2014-10-16T17:47:09.663" Score="6" Body="&lt;p&gt;You can try evaluating &lt;code&gt;(sleep-for n)&lt;/code&gt; while executing your macro, using &lt;code&gt;M-:&lt;/code&gt;. This causes Emacs's main thread to sleep, so it will delay the rest of your macro actions, but it should not affect getting the output from other processes like Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this might cause weird behavior with your cursor if you're getting comint output (like the result of a Python process). You should still get all your output, but the cursor might stop tracking the end. At the very least, I've had that happen &lt;em&gt;sometimes&lt;/em&gt; when testing it out now.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2014-10-16T17:47:09.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2256" PostTypeId="2" ParentId="2237" CreationDate="2014-10-16T17:48:32.860" Score="2" Body="&lt;p&gt;Since the change was made as part of the Outline rewrite between Emacs 19 and Emacs 20 to use overlays (or close thereto), I had a look at the differences between &lt;code&gt;hide-other&lt;/code&gt; from Emacs 19.34 and from Emacs 20.7. The change is easy enough to spot: in the Emacs 20+ definition, the body of the loop that traverses the headings upwards shows the heading it reaches only, while in Emacs 19, it calls &lt;code&gt;show-children&lt;/code&gt;. So I tweaked the code of Emacs 23 to call &lt;code&gt;show-children&lt;/code&gt; (hot patching with something like &lt;code&gt;flet&lt;/code&gt; wouldn't work easily since &lt;code&gt;outline-flag-region&lt;/code&gt; is used in many places).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun outline-focus ()&#xA;  &quot;Hide everything except for the current body and the parent headings.&#xA;Unlike `hide-other' since Emacs 20, this function shows all siblings&#xA;of visible headers.&quot;&#xA;  (interactive)&#xA;  (hide-sublevels 1)&#xA;  (let (outline-view-change-hook)&#xA;    (save-excursion&#xA;      (outline-back-to-heading t)&#xA;      (show-entry)&#xA;      (while (condition-case nil (progn (outline-up-heading 1 t) (not (bobp)))&#xA;               (error nil))&#xA;        (show-children))))&#xA;  (run-hooks 'outline-view-change-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In Org mode, &lt;a href=&quot;http://orgmode.org/manual/Global-and-local-cycling.html#index-org_002dreveal-67&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-reveal&lt;/code&gt;&lt;/a&gt; with a prefix argument (&lt;code&gt;C-u C-x C-r&lt;/code&gt;) does what I was looking for: show sibling headers of all headers encountered on the path upwards from the cursor position. Pressing &lt;code&gt;S-tab&lt;/code&gt; (&lt;code&gt;org-global-cycle&lt;/code&gt;) to get to the “overview” state, or &lt;code&gt;C-u 0 S-tab&lt;/code&gt; to get to the “contents” state with minimal depth, followed by &lt;code&gt;C-u C-x C-r&lt;/code&gt; gives me the view I wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's nicer for easy interactive use to mix Outline and Org commands, and call &lt;code&gt;hide-other&lt;/code&gt; followed by &lt;code&gt;org-reveal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'org-reveal &quot;org&quot;)&#xA;(defun gilles/outline-focus-entry ()&#xA;  (interactive &quot;@&quot;)&#xA;  (hide-other)&#xA;  (org-reveal t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This also works in Outline mode, I just need the &lt;code&gt;org-reveal&lt;/code&gt; function to be loaded.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-10-16T20:46:16.540" LastActivityDate="2014-10-16T20:46:16.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2257" PostTypeId="2" ParentId="2254" CreationDate="2014-10-16T17:51:18.013" Score="6" Body="&lt;p&gt;It looks like &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Display-Custom.html#index-visible_002dbell-774&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;visible-bell&lt;/code&gt;&lt;/a&gt; mode is enabled. This means that whenever an Emacs command rings a bell (i.e. fails in some way), it will try to flash the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to turn it off with &lt;code&gt;(setq visible-bell nil)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flickering is annoying, but the bell gives you useful information so I wouldn't want to suppress it completely. You can customize exactly what happens with the bell by setting &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Beeping.html#index-ring_002dbell_002dfunction-4029&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ring-bell-function&lt;/code&gt;&lt;/a&gt;, which will run an arbitrary Elisp function each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also possible that Emacs is using an audio beep that gets translated to flickering by your terminal. This is likely the case if &lt;code&gt;visible-bell&lt;/code&gt; is already &lt;code&gt;nil&lt;/code&gt;. If so, you could try setting &lt;code&gt;visible-bell&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, which will let Emacs handle the flashing itself—that could be less intrusive. Or you could just customize it however you like as described above.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="25" LastEditDate="2014-10-16T18:12:57.470" LastActivityDate="2014-10-16T18:12:57.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2258" PostTypeId="2" ParentId="2254" CreationDate="2014-10-16T17:57:59.153" Score="1" Body="&lt;p&gt;If you're running &lt;code&gt;sublimity-mode&lt;/code&gt;, don't. It does this type of stuff when run in -nw.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-10-16T18:03:10.110" LastActivityDate="2014-10-16T18:03:10.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2259" PostTypeId="1" AcceptedAnswerId="2260" CreationDate="2014-10-16T18:05:13.763" Score="23" ViewCount="3677" Body="&lt;p&gt;How can each top-level heading of an &lt;code&gt;org-mode&lt;/code&gt; buffer be exported to a separate file named after the value of the corresponding &lt;code&gt;CUSTOM_ID&lt;/code&gt; + (sanitized) title? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say a buffer contains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Title of Heading 1&#xA;  :PROPERTIES:&#xA;  :CUSTOM_ID: fibrillogenesis&#xA;  :END:&#xA;  Suspendisse potenti. Mauris ac felis vel velit tristique imperdiet.  &#xA;&#xA;** Sub-Heading&#xA;   Nullam rutrum.&#xA;&#xA;* Another Title for Heading 2&#xA;  :PROPERTIES:&#xA;  :CUSTOM_ID: mitochondrion&#xA;  :END:&#xA;  Mauris mollis tincidunt felis.  Sed bibendum.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The final result would be a directory containing two files, one for each of the two top-level headings, with the format chosen at export time (HTML, LaTeX, etc.), with the following file names and content:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Filename of first exported heading: &lt;code&gt;fibrillogenesis-title-of-heading-1.[ext]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exported content, corresponding to the original first top-level heading:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Title of Heading 1&#xA;  :PROPERTIES:&#xA;  :CUSTOM_ID: fibrillogenesis&#xA;  :END:&#xA;  Suspendisse potenti. Mauris ac felis vel velit tristique imperdiet.  &#xA;&#xA;** Sub-Heading &#xA;   Nullam rutrum.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Filename of second exported heading: &lt;code&gt;mitochondrion-another-title-for-heading-2.[ext]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exported content, corresponding to the original second top-level heading:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Another Title for Heading 2&#xA;:PROPERTIES:&#xA;:CUSTOM_ID: mitochondrion&#xA;:END:&#xA;Mauris mollis tincidunt felis.  Sed bibendum. &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would be very grateful for any hint, direction, pseudocode, or (better) real code.&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="504" LastEditDate="2014-10-16T20:54:27.793" LastActivityDate="2016-04-11T01:32:11.457" Title="How to export top-level headings of org-mode buffer to separate files?" Tags="|org-mode|elisp|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2260" PostTypeId="2" ParentId="2259" CreationDate="2014-10-16T18:13:36.530" Score="33" Body="&lt;p&gt;The following command lets you choose a back-end and then exports each top-level subtree to a separate file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-export-all (backend)&#xA;  &quot;Export all subtrees that are *not* tagged with :noexport: to&#xA;separate files.&#xA;&#xA;Note that subtrees must have the :EXPORT_FILE_NAME: property set&#xA;to a unique value for this to work properly.&quot;&#xA;  (interactive &quot;sEnter backend: &quot;)&#xA;  (let ((fn (cond ((equal backend &quot;html&quot;) 'org-html-export-to-html)&#xA;                  ((equal backend &quot;latex&quot;) 'org-latex-export-to-latex)&#xA;                  ((equal backend &quot;pdf&quot;) 'org-latex-export-to-pdf))))&#xA;    (save-excursion&#xA;      (set-mark (point-min))&#xA;      (goto-char (point-max))&#xA;      (org-map-entries (lambda () (funcall fn nil t)) &quot;-noexport&quot; 'region-start-level))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This currently supports HTML (&lt;code&gt;html&lt;/code&gt;), LaTeX (&lt;code&gt;latex&lt;/code&gt;), and PDF (&lt;code&gt;pdf&lt;/code&gt;) export.&#xA;You can add support for more back-ends by adding more clauses to &lt;code&gt;cond&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the docstring says, for each subtree you need to set the &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; property to the file name you want it to be exported to. (See below for other options.)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Automatically generating export file name from heading text&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If you don't want to add &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; properties to every top-level heading, you can modify &lt;code&gt;org-export-all&lt;/code&gt; to generate the filename automatically from e.g. the heading text, temporarily setting &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; during export:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-export-all (backend)&#xA;  &quot;Export all subtrees that are *not* tagged with :noexport: to&#xA;separate files.&#xA;&#xA;Subtrees that do not have the :EXPORT_FILE_NAME: property set&#xA;are exported to a filename derived from the headline text.&quot;&#xA;  (interactive &quot;sEnter backend: &quot;)&#xA;  (let ((fn (cond ((equal backend &quot;html&quot;) 'org-html-export-to-html)&#xA;                  ((equal backend &quot;latex&quot;) 'org-latex-export-to-latex)&#xA;                  ((equal backend &quot;pdf&quot;) 'org-latex-export-to-pdf)))&#xA;        (modifiedp (buffer-modified-p)))&#xA;    (save-excursion&#xA;      (set-mark (point-min))&#xA;      (goto-char (point-max))&#xA;      (org-map-entries&#xA;       (lambda ()&#xA;         (let ((export-file (org-entry-get (point) &quot;EXPORT_FILE_NAME&quot;)))&#xA;           (unless export-file&#xA;             (org-set-property&#xA;              &quot;EXPORT_FILE_NAME&quot;&#xA;              (replace-regexp-in-string &quot; &quot; &quot;_&quot; (nth 4 (org-heading-components)))))&#xA;           (funcall fn nil t)&#xA;           (unless export-file (org-delete-property &quot;EXPORT_FILE_NAME&quot;))&#xA;           (set-buffer-modified-p modifiedp)))&#xA;       &quot;-noexport&quot; 'region-start-level))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function generates the export filename by replacing spaces with &quot;_&quot; in the headline text. If you want to generate the filename some other way, change the &lt;code&gt;replace-regexp-in-string&lt;/code&gt; sexp to whatever you like.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Generating &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; when setting &lt;code&gt;:CUSTOM_ID:&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;With the following advice, &lt;code&gt;org-set-property&lt;/code&gt; will automatically set an appropriate value for &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; when you set &lt;code&gt;:CUSTOM_ID:&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice org-set-property (after set-export-file-name&#xA;                                   (property value) activate compile)&#xA;  (when (equal org-last-set-property &quot;CUSTOM_ID&quot;)&#xA;    (let ((export-file-name&#xA;           (concat (org-entry-get nil &quot;CUSTOM_ID&quot;)&#xA;                   &quot;-&quot;&#xA;                   (replace-regexp-in-string &quot; &quot; &quot;-&quot; (downcase (org-get-heading t t))))))&#xA;      (org-entry-put nil &quot;EXPORT_FILE_NAME&quot; export-file-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this will not add a file extension to the value of &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; but that doesn't matter because when exporting to a specific back-end, &lt;code&gt;org-mode&lt;/code&gt; &lt;em&gt;will automatically choose the correct extension for the resulting files&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Additional information&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Updating existing subtrees in bulk&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If you have a large number of existing subtrees that you need to set the &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; property for, you can use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html&quot;&gt;keyboard macro&lt;/a&gt;. Position point on the first subtree, then do the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;F3&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... to start recording.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;C-c C-x p&lt;/kbd&gt; &lt;code&gt;CUSTOM_ID&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... to make Emacs set &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt; based on &lt;code&gt;:CUSTOM_ID:&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;C-c C-f&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... to move to the next top-level headline.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;F4&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... to stop recording.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To repeat the macro for the next subtree, press &lt;kbd&gt;F4&lt;/kbd&gt;. To repeat the macro for &lt;em&gt;all&lt;/em&gt; remaining subtrees, press &lt;kbd&gt;M-0&lt;/kbd&gt; &lt;kbd&gt;F4&lt;/kbd&gt; (that's a zero).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Saving macros for future sessions&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;By default, keyboard macros are not saved across sessions. To store the macro in your init-file for later use, do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Name the macro: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;name-last-kbd-macro&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;org-set-export-file-name&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Find your init-file and move to a spot where you would like to insert the macro.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Insert the macro:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;insert-kbd-macro&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;org-set-export-file-name&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs will insert the following code at point:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(fset 'org-set-export-file-name&#xA;   &quot;\C-c\C-xpCUSTOM_ID\C-m\C-m\C-c\C-f&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you squint hard enough you can see that the second argument to &lt;code&gt;fset&lt;/code&gt; contains the sequence of keys that you pressed when you recorded the macro :)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(Optional) For best results, you might want to bind &lt;code&gt;org-set-export-file-name&lt;/code&gt; to a key:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;&amp;lt;f6&amp;gt;&quot;) 'org-set-export-file-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Save.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastEditorUserId="11695" LastEditDate="2016-04-11T01:32:11.457" LastActivityDate="2016-04-11T01:32:11.457" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2261" PostTypeId="1" AcceptedAnswerId="2264" CreationDate="2014-10-16T18:48:05.880" Score="8" ViewCount="3390" Body="&lt;p&gt;I want to run ediff to compare my current version of a file (in git) with a version of the file on a different branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run &lt;code&gt;M-x ediff-revision&lt;/code&gt; from within an open buffer for the file in question.  I answer the two questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compare revisions for file: I blank this answer (the default is the current buffer which is correct).&lt;/li&gt;&#xA;&lt;li&gt;Revision 1 to compare: I accept the default again (&quot;default file's latest version&quot;).&lt;/li&gt;&#xA;&lt;li&gt;Revision 2 to compare: I enter a git branch name&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This works great for viewing the differences between the two files.  However, I want to be able to edit the current version (i.e., by hitting &lt;code&gt;a&lt;/code&gt; or &lt;code&gt;b&lt;/code&gt; in ediff to copy or remove blocks of diff) and the &quot;current version&quot; buffer is a read-only buffer with a manufactured name (&lt;code&gt;file.~git-branch~&lt;/code&gt;).  I want the &quot;current version&quot; buffer to be the read-write buffer that I started with, not a read-only buffer on the current branch's version.&lt;/p&gt;&#xA;" OwnerUserId="2000" LastEditorUserId="25" LastEditDate="2014-10-16T19:57:35.307" LastActivityDate="2014-10-17T05:29:14.860" Title="How do I ediff a buffer against a revision?" Tags="|version-control|ediff|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2262" PostTypeId="1" AcceptedAnswerId="2267" CreationDate="2014-10-16T19:39:05.010" Score="1" ViewCount="799" Body="&lt;p&gt;I would like to keep all emacs related stuff (backup files, emacs-places, ido-last, etc.) in one place, namely &lt;code&gt;~/.emacs.d&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there general option for this or I have to set it individually for each package?&lt;/p&gt;&#xA;" OwnerUserId="871" LastActivityDate="2016-07-22T07:29:03.363" Title="How do I keep all emacs dotfiles in one directory?" Tags="|init-file|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2263" PostTypeId="1" CreationDate="2014-10-16T19:51:14.453" Score="19" ViewCount="3333" Body="&lt;p&gt;It seems the options are gtk, gtk2, gtk3, lucid or athena, motif.  Of course, there are visual differences and one toolkit may be more to your tastes than others.  Apart from that, are there any other differences such as with respect to performance or features?  For visual consistency with other applications, I used to compile Emacs with gtk, however, when I just compiled it with lucid, I had the impression that rendering might be faster with lucid than with gtk.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="50" LastEditDate="2014-11-23T13:03:07.810" LastActivityDate="2014-11-23T13:03:07.810" Title="Are there any benefits of compiling Emacs with one graphical toolkit opposed to another?" Tags="|emacs-internals|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2264" PostTypeId="2" ParentId="2261" CreationDate="2014-10-16T19:56:54.630" Score="8" Body="&lt;p&gt;Emacs is doing what you told it to do instead of what you meant. &lt;code&gt;ediff-revision&lt;/code&gt; asks for three pieces of information:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The file to work on — default: the &lt;em&gt;file&lt;/em&gt; that the current buffer is visiting.&lt;/li&gt;&#xA;&lt;li&gt;The old revision — default: the latest revision.&lt;/li&gt;&#xA;&lt;li&gt;The new revision — default: the current state.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At step 1, you select the file, you aren't telling Emacs that you want to use the file as it is in the buffer. The default for step 2 is the latest revision, not the current working copy. The default for step 3 is the buffer content, which is the working copy if the buffer is not modified. With what you did, you're comparing what you've checked out (typically the latest revision on the current branch) with some other branch, not the working copy with some other branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to give the branch name as the first revision (step 2), and leave the third question blank to say you want to use the buffer state. You can only select the current buffer state for revision 2, not for revision 1 (this is built into &lt;code&gt;ediff-vc-internal&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-16T19:56:54.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2266" PostTypeId="2" ParentId="2262" CreationDate="2014-10-16T20:10:43.413" Score="2" Body="&lt;p&gt;Your init file contains personal EmacsLisp code that you want to execute when you start Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For GnuEmacs, it is ~/.emacs or _emacs or ~/.emacs.d/init.el.&lt;/li&gt;&#xA;&lt;li&gt;For XEmacs, it is ~/.xemacs or ~/.xemacs/init.el.&lt;/li&gt;&#xA;&lt;li&gt;For AquamacsEmacs, it is ~/.emacs or ~/Library/Preferences/Aquamacs Emacs/Preferences.el&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://www.emacswiki.org/emacs/InitFile&quot; rel=&quot;nofollow&quot;&gt;emacswiki&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Emacs is started, it normally tries to load a Lisp program from an initialization file, or init file for short. This file, if it exists, specifies how to initialize Emacs for you. Emacs looks for your init file using the filenames ~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;gnu&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer, I'll say, everything should be inside ~/.emacs.d/ directory and inside this directory, there should be a file named init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, inside ~/.emacs.d/init.el, you can configure whatever you want about your emacs related stuff, among other things, differents paths that should be used by emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;&quot; . &quot;~/.emacs.d/emacs_backup&quot;)))&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/elisp&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq abbrev-file-name &quot;~/.emacs.d/abbrev_definitions&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq recent-save-file &quot;~/.emacs.d/recentf&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-10-16T22:26:39.440" LastActivityDate="2014-10-16T22:26:39.440" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2267" PostTypeId="2" ParentId="2262" CreationDate="2014-10-16T20:48:27.300" Score="6" Body="&lt;p&gt;As far as I know there is no way to globally ensure packages save state only in your &lt;code&gt;user-emacs-directory&lt;/code&gt;. That said, with newer releases of Emacs it is increasingly rare to find packages that don't already do this by default. (To use your example, Ido writes ~/.emacs.d/ido.last by default in my current Emacs 24.4 install.) I've configured this per package in the past and have been able to remove most of those settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious exception is backup files. You do need to configure this using e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/.emacs.d/backups&quot;))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-16T20:48:27.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2268" PostTypeId="1" CreationDate="2014-10-16T20:58:26.460" Score="20" ViewCount="580" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How do I keep &lt;code&gt;org-mode&lt;/code&gt; link faces from bleeding over into the &lt;code&gt;...&lt;/code&gt; selective display characters at the end of a folded header?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a visual tick that drives me a little nutty.  When, in &lt;code&gt;org-mode&lt;/code&gt;, a link is the very last thing on a line, the link face bleeds over into the &lt;code&gt;...&lt;/code&gt; that indicates that the header is folded up.  If there is, say, a blank space after the link, there is no bleeding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The screenshot I've posted demonstrates the issue.  Line three is the problematic line with no characters between the end of the link and the end of line, while line four shows a link, followed by a space:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GAjT7.png&quot; alt=&quot;weird link face behavior&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, why does this happen?  Second, and more to the point, how do I make it stop?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE 1:&lt;/strong&gt; As per comments, posted below are screenshots of the buffer with the headers closed and open.  I've opened Emacs with no init file (ie, &lt;code&gt;emacs -Q&lt;/code&gt;), &lt;code&gt;require&lt;/code&gt;d org-mode, and opened this example file.  So: it does not appear to be something kooky in my setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All headers closed:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/pyseQ.jpg&quot; alt=&quot;weird link face closed&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All headers open:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/nH9BR.jpg&quot; alt=&quot;weird link face open&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The theme I'd been using above is inkpot, although I get the same problem when using the solarized theme as well as the default theme (as in the new screenshots).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version is 24.3.1.  I get the same results when using org version 7.9.3f (ie, the one bundled with that Emacs version), as well as 8.3beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE 2:&lt;/strong&gt; here's a minimum working example in response to a comment request:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* here's a header with a [[~/somefile.txt][link at the end]]&#xA;&#xA;  - This one's a problem&#xA;  - Interesting note:&#xA;    + put the cursor immediately *after* the *d* in &quot;end&quot; with the&#xA;      header closed/folded&#xA;      * the face no longer bleeds over into the dots&#xA;    + move the cursor anywhere else&#xA;      * the face bleeds over into the dots again&#xA;&#xA;* here's another [[~/someotherfile.txt][go at it]]&#xA;  DEADLINE: &amp;lt;2014-10-26 Sun&amp;gt;&#xA;&#xA;  - This one's also a problem&#xA;&#xA;* here's another header with a [[~/anotherfile.txt][link followed by a space]] &#xA;&#xA;  - No bleed-over onto the dots with this one&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-10-26T11:40:27.777" LastActivityDate="2018-03-12T08:52:34.223" Title="how to prevent faces from bleeding onto surrounding areas of buffer?" Tags="|org-mode|faces|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2269" PostTypeId="1" AcceptedAnswerId="2271" CreationDate="2014-10-16T22:10:24.273" Score="11" ViewCount="16972" Body="&lt;p&gt;I have the following in my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (when window-system&#xA;      (set-frame-position (selected-frame) 0 0)&#xA;      (set-frame-size (selected-frame) 91 63))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The value of 63 is supposed to make my initial frame take up the full vertical height of my screen.&lt;/p&gt;&#xA;&lt;p&gt;However, the result is not actually a frame of 91x63. Instead, I get a frame of only 51. Likewise, increasing 63 to 70 doesn't get me a taller frame either. Initially, I see the frame popup with the full screen height, but then it shrinks down to a much smaller size. I believe this may be related to the fact that I have a configured font face and font size and the frame size is taking effect &lt;em&gt;before&lt;/em&gt; the font size is set. So when the frame size is initially set, the frame is too large to fit on the screen so the size is shrunk and then later the font face and size are set, but now there is enough room to grow the frame. Do I need to some how control the order of these settings? If so, how do I do that? Currently, I have the font face and size set in the &lt;code&gt;custom-set-faces&lt;/code&gt; block. Is there a better way to change the frame size so that it happens after the font face is set?&lt;/p&gt;&#xA;&lt;p&gt;By the way, this code came from the &lt;a href=&quot;http://www.emacswiki.org/FrameSize&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs wiki on Frame Size&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This is under Ubuntu Linux, and I'm using the &lt;a href=&quot;https://launchpad.net/%7Ecassou/+archive/ubuntu/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;PPA for Emacs 24&lt;/a&gt;. I am not using any Xresources.&lt;/p&gt;&#xA;&lt;p&gt;For reference, here's my &lt;code&gt;custom-set-faces&lt;/code&gt; block:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (custom-set-faces&#xA;     '(default ((t (:inherit nil&#xA;            :stipple nil&#xA;            :background &amp;quot;white&amp;quot;&#xA;            :foreground &amp;quot;black&amp;quot;&#xA;            :inverse-video nil&#xA;            :box nil&#xA;            :strike-through nil&#xA;            :overline nil&#xA;            :underline nil&#xA;            :slant normal&#xA;            :weight normal&#xA;            :height 95&#xA;            :width normal&#xA;            :foundry &amp;quot;unknown&amp;quot;&#xA;            :family &amp;quot;DejaVu Sans Mono&amp;quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="317" LastEditorUserId="11477" LastEditDate="2020-12-18T07:58:13.123" LastActivityDate="2020-12-18T07:58:13.123" Title="How do I get my initial frame to be the desired size?" Tags="|init-file|frames|faces|" AnswerCount="6" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="2270" PostTypeId="2" ParentId="2269" CreationDate="2014-10-16T22:43:52.927" Score="3" Body="&lt;p&gt;If you really mean the initial frame, then see option &lt;code&gt;initial-frame-alist&lt;/code&gt;.  In particular, see this part of the doc string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You can specify geometry-related options for just the initial&#xA;frame by setting this variable in your init file; however, they&#xA;won't take effect until Emacs reads your init file, which happens&#xA;after creating the initial frame.  If you want the initial frame&#xA;to have the proper geometry as soon as it appears, you need to&#xA;use this three-step process:&#xA;&#xA;* Specify X resources to give the geometry you want.&#xA;* Set `default-frame-alist' to override these options so that they&#xA;  don't affect subsequent frames.&#xA;* Set `initial-frame-alist' in a way that matches the X resources,&#xA;  to override what you put in `default-frame-alist'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this part of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Initial-Parameters&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(elisp) Initial Parameters&lt;/code&gt;&lt;/a&gt; about the same option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; If these settings affect the frame geometry and appearance, you'll&#xA; see the frame appear with the wrong ones and then change to the&#xA; specified ones.  If that bothers you, you can specify the same&#xA; geometry and appearance with X resources; those do take effect&#xA; before the frame is created.  *Note X Resources: (emacs)X&#xA; Resources.&#xA;&#xA; X resource settings typically apply to all frames.  If you want to&#xA; specify some X resources solely for the sake of the initial frame,&#xA; and you don't want them to apply to subsequent frames, here's how&#xA; to achieve this.  Specify parameters in `default-frame-alist' to&#xA; override the X resources for subsequent frames; then, to prevent&#xA; these from affecting the initial frame, specify the same&#xA; parameters in `initial-frame-alist' with values that match the X&#xA; resources.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you mean only frames after the initial frame then see option &lt;code&gt;default-frame-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both of these options let you configure any frame parameters, including &lt;code&gt;font&lt;/code&gt;, so you can control the font size. (You can also customize face &lt;code&gt;default&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize user options (&lt;code&gt;M-x customize-option&lt;/code&gt;), but for these options you will need to be sure that your customizations take effect before the frame gets displayed.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-17T05:53:43.900" LastActivityDate="2014-10-17T05:53:43.900" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2271" PostTypeId="2" ParentId="2269" CreationDate="2014-10-17T00:08:06.730" Score="5" Body="&lt;p&gt;Since this is being caused by changing the default font/size during init, one can avoid this problem by setting the font via &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html#X-Resources&quot; rel=&quot;nofollow&quot;&gt;X resources&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add to (creating if necessary) the file &lt;code&gt;~/.Xresources&lt;/code&gt; in the home directory the following line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Emacs.font: DejaVu Sans Mono-12&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs will normally pick up the change once X has restarted. However, one can get X to recognize changes to &lt;code&gt;.Xresources&lt;/code&gt; by running &lt;code&gt;xrdb ~/.Xresources&lt;/code&gt; in a command-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, one can pass the same option at the command line using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --font=&quot;DejaVu Sans Mono-12&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="108" LastEditorUserId="317" LastEditDate="2014-10-17T00:21:09.200" LastActivityDate="2014-10-17T00:21:09.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2272" PostTypeId="2" ParentId="2269" CreationDate="2014-10-17T00:14:40.970" Score="1" Body="&lt;p&gt;In addition to the answers given so far, if your immediate goal is to make sure emacs opens up at the full height, you can set the &lt;code&gt;fullscreen&lt;/code&gt; parameter of either the &lt;code&gt;default-frame-alist&lt;/code&gt; or the &lt;code&gt;initial-frame-alist&lt;/code&gt;, depending on whether or not you want all your frames to open at the full height, or just the first one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'initial-frame-alist '(fullscreen . fullheight))&#xA;(add-to-list 'default-frame-alist '(fullscreen . fullheight))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="317" LastEditDate="2014-10-17T00:37:37.137" LastActivityDate="2014-10-17T00:37:37.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2273" PostTypeId="2" ParentId="61" CreationDate="2014-10-17T00:32:27.393" Score="11" Body="&lt;p&gt;There is a new package available on &lt;a href=&quot;http://elpa.gnu.org/&quot;&gt;GNU ELPA&lt;/a&gt; called &lt;a href=&quot;http://elpa.gnu.org/packages/scroll-restore.html&quot;&gt;&lt;code&gt;scroll-restore&lt;/code&gt;&lt;/a&gt; that attempts to remedy this problem. There are a handful of different behaviors to choose from, but the way I have configured it for myself (see below) causes the cursor to turn invisible during scrolling commands, and then jump back to its original location when I start typing again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I have encountered a few bugs, but the package seems to work as-advertised for the most part. You can test it out by installing it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET scroll-restore RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After the package is installed, you can enable the minor mode with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x scroll-restore-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Personally, I am binding it to the &lt;kbd&gt;Scroll Lock&lt;/kbd&gt; key because it seems so incredibly apropos! This is what I am adding to my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'scroll-restore)&#xA;(scroll-restore-mode 1)&#xA;;; Allow scroll-restore to modify the cursor face&#xA;(setq scroll-restore-handle-cursor t)&#xA;;; Make the cursor invisible while POINT is off-screen&#xA;(setq scroll-restore-cursor-type nil)&#xA;;; Jump back to the original cursor position after scrolling&#xA;(setq scroll-restore-jump-back t)&#xA;;; Toggle scroll-restore-mode with the Scroll Lock key&#xA;(global-set-key (kbd &quot;&amp;lt;Scroll_Lock&amp;gt;&quot;) 'scroll-restore-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-10-17T13:50:08.737" LastActivityDate="2014-10-17T13:50:08.737" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2274" PostTypeId="2" ParentId="2269" CreationDate="2014-10-17T00:40:36.807" Score="5" Body="&lt;p&gt;This is essentially an addendum to Vamsi's answer which I have discovered after the fact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation on &lt;code&gt;initial-frame-alist&lt;/code&gt;, it says the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can specify geometry-related options for just the initial&#xA;  frame by setting this variable in your init file; however, they&#xA;  won't take effect until Emacs reads your init file, which happens&#xA;  after creating the initial frame.  If you want the initial frame&#xA;  to have the proper geometry as soon as it appears, you need to&#xA;  use this three-step process:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Specify X resources to give the geometry you want.&lt;/li&gt;&#xA;  &lt;li&gt;Set &lt;code&gt;default-frame-alist&lt;/code&gt; to override these options so that they&#xA;  don't affect subsequent frames.&lt;/li&gt;&#xA;  &lt;li&gt;Set &lt;code&gt;initial-frame-alist&lt;/code&gt; in a way that matches the X resources,&#xA;  to override what you put in &lt;code&gt;default-frame-alist&lt;/code&gt;.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This implies that you &lt;strong&gt;must&lt;/strong&gt;  modify &lt;code&gt;~/.Xresources&lt;/code&gt; in order to get consistent behavior for the initial frame. Otherwise, the window bounces around on startup, which is the behavior that I'm seeing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to round out my final solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still using this in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when window-system&#xA;  (set-frame-position (selected-frame) 0 0)&#xA;  (set-frame-size (selected-frame) 91 63))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As well as this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; '(default ((t (:inherit nil :stipple nil :background &quot;white&quot; :foreground &quot;black&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 95 :width normal :foundry &quot;unknown&quot; :family &quot;DejaVu Sans Mono&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But also setting this in my &lt;code&gt;~/.Xresources&lt;/code&gt; as pointed out by Vamsi:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs.font: DejaVu Sans Mono-9.5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And being sure to run &lt;code&gt;xrdb&lt;/code&gt; after the fact.&lt;/p&gt;&#xA;" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-10-17T18:24:56.463" LastActivityDate="2014-10-17T18:24:56.463" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2275" PostTypeId="1" CreationDate="2014-10-17T03:40:14.247" Score="11" ViewCount="5113" Body="&lt;p&gt;The &lt;code&gt;emacsclient&lt;/code&gt; program allows a flag &lt;code&gt;--no-wait&lt;/code&gt; (abbreviated as &lt;code&gt;-n&lt;/code&gt;) which will cause the emacs server to visit the specified file, and return immediately.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -n ~/.bashrc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I provide an alternate editor, then this will still work in cases where there is no running Emacs server&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -n -a &quot;/usr/local/bin/emacs&quot; ~/.bashrc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this gives me inconsistent behavior because in cases where the server is running, this call will return right away.  In cases where there is no server running, and the alternate editor is used, the call becomes a blocking call, and will not return until I exit Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to tell &lt;code&gt;emacs&lt;/code&gt; (as opposed to &lt;code&gt;emacsclient&lt;/code&gt;) to create a new frame and then return?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-18T17:30:32.133" Title="Equivalent to --no-wait for emacs" Tags="|emacsclient|server|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2277" PostTypeId="2" ParentId="2275" CreationDate="2014-10-17T04:26:56.647" Score="4" Body="&lt;p&gt;I am unsure of how to do that strictly within Emacs, but luckily there are other ways to get what you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have something in your &lt;code&gt;.emacs&lt;/code&gt; to start a server, you could always make a small script that starts up Emacs with the file you want to edit and start the server forked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;emacs --eval '(server-start)' $* &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then pass that to &lt;code&gt;-a&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However...&lt;/em&gt;&lt;br&gt;&#xA;If you have the server start in your &lt;code&gt;.emacs&lt;/code&gt;, you don't really need to create a script; you have a slightly more terse option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -n -a &quot;/usr/local/bin/emacs&quot; ~/.bashrc &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The ampersand will background the process and instantly give you back your shell, even when Emacs starts for the first time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might have to &lt;code&gt;disown&lt;/code&gt; the process if bash kills jobs on exit. If that is the case, you simply add a &lt;code&gt;disown&lt;/code&gt; to the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -n -a &quot;/usr/local/bin/emacs&quot; ~/.bashrc &amp;amp; disown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On Windows, the closest equivalent would be the &quot;&lt;code&gt;start&lt;/code&gt;&quot; command...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, like the script suggestion above, you would likely have to create a batch file that had something in it like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;start /b C:\path\to\emacs %*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then point the &lt;code&gt;-a&lt;/code&gt; argument at it.&lt;br&gt;&#xA;That should run the batch file and return immediately after starting up Emacs with the appropriate file.&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2014-10-17T05:16:22.330" LastActivityDate="2014-10-17T05:16:22.330" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2278" PostTypeId="2" ParentId="2261" CreationDate="2014-10-17T05:29:14.860" Score="8" Body="&lt;p&gt;When using &lt;a href=&quot;https://github.com/magit/magit&quot;&gt;magit&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;l&lt;/code&gt; &lt;code&gt;-al&lt;/code&gt; &lt;code&gt;l&lt;/code&gt; to view the revisions of all branches in your history&lt;/li&gt;&#xA;&lt;li&gt;go to the line containing the revision you want to compare your current buffer content against.&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;d&lt;/code&gt; and you are asked for which revision to compare the current working tree against (the default is the revision at point). Confirm.&lt;/li&gt;&#xA;&lt;li&gt;You'll get a diff overview over changes of all file differences between the current working tree and the revision. Put point on the file your interested in and hit &lt;code&gt;e&lt;/code&gt; for invoking an ediff session on it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Magit offers a number of options to display the revisions (step 1). You may choose  If you have a very complex branch structure, you may want to use some more filtering to find the desired revision.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2014-10-17T05:29:14.860" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2279" PostTypeId="1" AcceptedAnswerId="2282" CreationDate="2014-10-17T06:38:28.587" Score="6" ViewCount="638" Body="&lt;p&gt;I use &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot; rel=&quot;nofollow&quot;&gt;markdown-mode&lt;/a&gt; to edit markdown, but it's missing one very useful feature. Whenever I press &lt;code&gt;M-a&lt;/code&gt; (&lt;code&gt;backward-sentence&lt;/code&gt;) or &lt;code&gt;M-e&lt;/code&gt; (&lt;code&gt;forward-sentence&lt;/code&gt;) it takes me to the start or end of the paragraph, respectively. I want it to send me to start/end of the sentence (to the nearest period, question mark, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there way to get markdown-mode to properly go to the start or end of the sentence?&lt;/p&gt;&#xA;" OwnerUserId="2120" LastEditorUserId="105" LastEditDate="2022-06-01T14:44:45.160" LastActivityDate="2022-06-01T14:44:45.160" Title="backword-sentence and forward-sentence are moving over paragraphs" Tags="|motion|markdown|sentences|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2281" PostTypeId="2" ParentId="2263" CreationDate="2014-10-17T07:36:24.357" Score="11" Body="&lt;p&gt;There is at least one documented difference: apparently, there is a bug causing a crash of gtk+ emacs daemon, but not lucid emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you start emacs as a daemon, you will see the following warning:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning: due to a long standing Gtk+ bug&#xA;  &lt;a href=&quot;http://bugzilla.gnome.org/show_bug.cgi?id=85715&quot;&gt;http://bugzilla.gnome.org/show_bug.cgi?id=85715&lt;/a&gt; Emacs might crash when&#xA;  run in daemon mode and the X11 connection is unexpectedly lost. Using&#xA;  an Emacs configured with --with-x-toolkit=lucid does not have this&#xA;  problem.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Long-standing is definitely appropriate, this bug was reported back in 2002. But some people are still facing it as of 2014 (&lt;a href=&quot;http://www.reddit.com/r/emacs/comments/2ans0z/have_you_encountered_that_gtk_bug_in_daemon_mode/&quot;&gt;link&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2014-10-17T08:23:21.143" LastActivityDate="2014-10-17T08:23:21.143" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2282" PostTypeId="2" ParentId="2279" CreationDate="2014-10-17T08:11:55.533" Score="10" Body="&lt;p&gt;You're probably using single space sentences, which is fine, but you need to tell Emacs about it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq sentence-end-double-space nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-17T08:11:55.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2283" PostTypeId="1" AcceptedAnswerId="4194" CreationDate="2014-10-17T09:49:49.607" Score="11" ViewCount="1611" Body="&lt;p&gt;I often use GNU Screen to keep remote sessions alive.  Since I live in Emacs, I'd really like to be able to resume a running remote shell session from within Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Screen implements all sorts of fancy things like terminal multiplexing and character drawing that I really don't need.  I'm really only interested in having detachable and resumable shell sessions, so something as simple as &lt;a href=&quot;http://dtach.sourceforge.net/&quot;&gt;&lt;code&gt;dtach&lt;/code&gt;&lt;/a&gt; might be sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using this function to open an SSH session and reconnect to a running &lt;code&gt;dtach&lt;/code&gt; session in &lt;code&gt;shell-mode&lt;/code&gt; (taken from &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00232.html&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ssh-dtach (host)&#xA;  &quot;Open SSH connection to remote host and attach to dtach session.&quot;&#xA;  (interactive)&#xA;  (let ((explicit-shell-file-name &quot;dtach&quot;)&#xA;        (explicit-dtach-args '(&quot;-A&quot; &quot;/tmp/emacs.dtach&quot; &quot;-z&quot;&#xA;                               &quot;/bin/bash&quot; &quot;--noediting&quot; &quot;-login&quot;))&#xA;        (default-directory (format  &quot;/ssh:%s:&quot; host)))&#xA;    (shell (format &quot;*ssh %s*&quot; host))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Despite minor quirks, this works almost fine for &lt;code&gt;shell-mode&lt;/code&gt;, but in Eshell this just starts a subprocess, so the terminal becomes very limited (e.g. no path autocompletion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure Eshell to connect to a running &lt;code&gt;dtach&lt;/code&gt; session upon connecting to a remote server?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&#xA;As I thought about this problem again, I realised that it isn't entirely clear what I actually want.  Here's a list:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I want to stay in eshell, not in some subprocess&lt;/li&gt;&#xA;&lt;li&gt;upon reattaching I want the output of the remote session to be replayed and the remote command history to be available&lt;/li&gt;&#xA;&lt;li&gt;I want to be able to interact with a running remote process (e.g. a running &lt;code&gt;yum install&lt;/code&gt; waiting for my input)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It seems that I'll need to write a bit of elisp code to make this all work with dtach.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-11-07T12:33:01.857" LastActivityDate="2014-12-07T11:49:58.867" Title="Attach to running remote shell with eshell/TRAMP/dtach" Tags="|eshell|shell|remote|ssh|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2284" PostTypeId="1" CreationDate="2014-10-17T10:12:03.120" Score="6" ViewCount="371" Body="&lt;p&gt;I am using Emacs's &lt;code&gt;table.el&lt;/code&gt; mode to fill a lot of tables in rst documents.&#xA;&lt;code&gt;table.el&lt;/code&gt; is really fine to do the job, but it lacks the possibility to have one space between vertical separator and cell content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, by default, it fills tables like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+-------+-----+&#xA;|content|stuff|&#xA;+-------+-----+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want to achieve is to have a one space padding before and after each separator to match the RST syntax like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------+-------+&#xA;| content | stuff |&#xA;+---------+-------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2122" LastEditorUserId="25" LastEditDate="2014-10-17T11:06:53.663" LastActivityDate="2024-03-21T09:07:50.910" Title="Have table.el insert space after vertical separator for reStructuredText" Tags="|table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2285" PostTypeId="1" CreationDate="2014-10-17T10:36:15.887" Score="7" ViewCount="955" Body="&lt;p&gt;Inside my &lt;code&gt;org-mode&lt;/code&gt; documents, I'd like to do sub-TOCs for individual&#xA;sections and subsections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TOC: headlines 1         # This is the &quot;main&quot; table of contents,&#xA;                           # showing just the level-1 headings&#xA;&#xA;* Business operations      # This is a level-1 heading&#xA;&#xA;{{{SUBTOC}}}               # Inserts just the *level-2* headings for this *level-1* section&#xA;&#xA;** Services                # This is a level-2 heading&#xA;&#xA;{{{SUBTOC}}}               # Shows just the *level-3* headings for this *level-2* section&#xA;&#xA;*** Statements of work&#xA;*** Changes to statements of work&#xA;*** No obligation to agree to statement of work&#xA;&#xA;** Sales of goods          # The next level-2 heading&#xA;&#xA;{{{SUBTOC}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="2123" LastEditorUserId="50" LastEditDate="2014-10-17T11:54:18.300" LastActivityDate="2016-11-28T09:14:22.937" Title="Org-mode -- sub-TOCs for individual sections?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2286" PostTypeId="1" AcceptedAnswerId="2291" CreationDate="2014-10-17T10:36:22.590" Score="46" ViewCount="5158" Body="&lt;p&gt;What are some basic things I could do to reduce the start-up time? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything in particular I should pay attention to, for that matter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: Startup time can be mitigated by starting Emacs less often (once per session) and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server&quot; rel=&quot;noreferrer&quot;&gt;opening files in a running instance&lt;/a&gt;. This question is about minimizing the startup time, for the session start or any other time when starting Emacs is necessary.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also the &lt;a href=&quot;https://stackoverflow.com/questions/778716/how-can-i-make-emacs-start-up-faster&quot;&gt;same question&lt;/a&gt; answered on Stack Overflow, with question and answer scores over 50 and 30-some &quot;favorite&quot; bookmarks. Good answers here should go beyond what is available on Stack Overflow.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-11-01T14:01:33.623" Title="What can I do to speed up my start-up?" Tags="|init-file|performance|start-up|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2287" PostTypeId="2" ParentId="384" CreationDate="2014-10-17T11:50:36.103" Score="1" Body="&lt;p&gt;Ok, I ended up programming this myself. I bind it to &lt;code&gt;C-c v&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun java/find-or-define-variable ()&#xA;  &quot;Go to definition of variable at point. Define it if doesn't exist.&quot;&#xA;  (interactive)&#xA;  (push-mark)&#xA;  (unless (or (looking-at &quot;[[:alnum:]_]&quot;) (looking-back &quot;[[:alnum:]_]&quot;))    &#xA;    (search-forward-regexp &quot;[[:alnum:]_]&quot;)&#xA;    (forward-char -1))&#xA;  (let (name dest file)&#xA;    (cond&#xA;     ((thing-at-point-looking-at &quot;\\bR\\.\\([[:alnum:]_]+\\)\\.\\([[:alnum:]_]+\\)&quot;)&#xA;      (if (string= (match-string 1) &quot;id&quot;)&#xA;          (java/find-id-definition (match-string 2))&#xA;        (setq name (match-string 2))&#xA;        (setq file (concat (android-root) &quot;res/values/&quot; (match-string 1) &quot;.xml&quot;))&#xA;        (unless (file-readable-p file)&#xA;          (setq file (concat (android-root) &quot;res/values/&quot; (match-string 1) &quot;s.xml&quot;)))&#xA;        (find-file file)&#xA;        (if (search-forward (format &quot;name=%S&quot; name) nil t)&#xA;            (search-forward &quot;&amp;gt;&quot;)&#xA;          (goto-char (point-max))&#xA;          (save-match-data &#xA;            (search-backward-regexp &quot;&amp;lt;/\\s-*string&amp;gt;&quot;)&#xA;            (goto-char (match-end 0)))&#xA;          (insert &quot;\n&amp;lt;string name=\&quot;&quot; name &quot;\&quot;&amp;gt;&amp;lt;/string&amp;gt;&quot;)&#xA;          (search-backward &quot;&amp;lt;/&quot;)&#xA;          (indent-according-to-mode))))&#xA;     (t&#xA;      (setq name (thing-at-point 'symbol))&#xA;      (setq dest (save-excursion&#xA;                   (when (looking-at &quot;[[:alnum:]_]&quot;) (forward-sexp 1))&#xA;                   (let ((definitionRegexp (concat &quot;\\b[[:alnum:]_]+\\(\\[\\]\\)?\\s-+\\(&quot; name &quot;\\)\\b&quot;)))&#xA;                     (search-backward-regexp definitionRegexp nil t)&#xA;                     (while (save-match-data (looking-at (concat &quot;\\breturn+\\s-+&quot; name &quot;\\b&quot;)))&#xA;                       (search-backward-regexp definitionRegexp nil t))&#xA;                     (match-beginning 2))))&#xA;      (if dest&#xA;          (goto-char dest)&#xA;        (java/previous-end-of-statement)&#xA;        (newline) (indent-according-to-mode)&#xA;        (insert name &quot;;&quot;)&#xA;        (back-to-indentation)&#xA;        (insert &quot; &quot;)&#xA;        (forward-char -1))))))&#xA;&#xA;(defun java/previous-end-of-statement ()&#xA;  &quot;&quot;&#xA;  (forward-line 0)&#xA;  (forward-char -1)&#xA;  (when (null (looking-back &quot;[;{]\\s-*\\(//.*\\)?&quot;))&#xA;    (forward-line -1)))&#xA;&#xA;(defun java/find-id-definition (id)&#xA;  &quot;Used find-grep to look for the \&quot;@+id/ID\&quot; string everywhere.&quot;&#xA;  (let ((null-device nil))      ; see grep&#xA;    (grep-find (format &quot;find %s -type f -exec grep -nH -e 'android:id=\&quot;@+id/%s' {} +&quot; (android-root) id))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-17T11:50:36.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2288" PostTypeId="1" AcceptedAnswerId="2290" CreationDate="2014-10-17T12:43:03.157" Score="16" ViewCount="1399" Body="&lt;p&gt;I want to use &lt;code&gt;rx&lt;/code&gt; to create regular expressions with runtime values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I'm doing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq strings '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;))&#xA;(eval `(rx symbol-start (or ,@strings) symbol-end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I'd rather avoid using &lt;code&gt;eval&lt;/code&gt;. I've found &lt;code&gt;rx-to-string&lt;/code&gt;, but it's not clear what FORM I should write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; error: Unknown rx form `symbol-start&#xA;(rx-to-string '(symbol-start (or ,@strings) symbol-end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I build an &lt;code&gt;rx&lt;/code&gt; expression at runtime?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-06-20T09:01:26.097" Title="How do I create a dynamic regexp with rx?" Tags="|regular-expressions|rx|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2290" PostTypeId="2" ParentId="2288" CreationDate="2014-10-17T13:03:39.600" Score="16" Body="&lt;p&gt;&lt;code&gt;rx-to-string&lt;/code&gt; takes a regexp form as an argument. The syntax is the same as the argument of &lt;code&gt;rx&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rx-to-string '(or &quot;foo&quot; &quot;bar&quot;))&#xA;&quot;\\(?:\\(?:bar\\|foo\\)\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What you tried passing is not a regexp form, but a list of regexp forms. Since what you mean is the sequence of regular expressions &lt;code&gt;symbol-start&lt;/code&gt; followed by one of a bunch of strings followed by &lt;code&gt;symbol-end&lt;/code&gt;, you need to lead with the sequence operator &lt;code&gt;sequence&lt;/code&gt; (which can be abbreviated to &lt;code&gt;seq&lt;/code&gt; or &lt;code&gt;:&lt;/code&gt;, or weirdly even &lt;code&gt;and&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rx-to-string `(: symbol-start (or ,@strings) symbol-end))&#xA;&quot;\\(?:\\_&amp;lt;\\(?:ba[rz]\\|foo\\)\\_&amp;gt;\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;rx&lt;/code&gt; is in fact a tiny wrapper around &lt;code&gt;rx-to-string&lt;/code&gt; that operates at compile time because it's a macro. What makes this confusing is that if you pass multiple arguments to &lt;code&gt;rx&lt;/code&gt;, there is an implicit &lt;code&gt;sequence&lt;/code&gt; operator. The documentation of &lt;code&gt;rx&lt;/code&gt; could stand to be clarified.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rx (: symbol-start (or &quot;foo&quot; &quot;bar&quot; &quot;baz&quot;) symbol-end))&#xA;&quot;\\_&amp;lt;\\(?:ba[rz]\\|foo\\)\\_&amp;gt;&quot;&#xA;(rx symbol-start (or &quot;foo&quot; &quot;bar&quot; &quot;baz&quot;) symbol-end)&#xA;&quot;\\_&amp;lt;\\(?:ba[rz]\\|foo\\)\\_&amp;gt;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="304" LastEditDate="2016-06-20T09:01:26.097" LastActivityDate="2016-06-20T09:01:26.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2291" PostTypeId="2" ParentId="2286" CreationDate="2014-10-17T13:28:21.570" Score="48" Body="&lt;p&gt;Here's my points on reducing &lt;code&gt;emacs-init-time&lt;/code&gt;, this does not cover things like using a daemon or the server, it goes without saying that you should rarely ever close emacs.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Don't:&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Don't require packages in your init, if the package doesn't have proper autoload cookies, ensure you set up autoloads on the entry commands. So if the first time you use package &lt;code&gt;foobar&lt;/code&gt; will be by calling &lt;code&gt;foobar-mode&lt;/code&gt; and &lt;code&gt;foobar&lt;/code&gt; was did not come pre-autoloaded you'll need something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'foobar-mode &quot;foobar&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this will allow you to call &lt;code&gt;foobar-mode&lt;/code&gt; even when the &lt;code&gt;foobar&lt;/code&gt; package has not yet been loaded. This way &lt;code&gt;foobar&lt;/code&gt; won't be loaded until you actually call &lt;code&gt;foobar-mode&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Don't run &lt;code&gt;package-refresh-contents&lt;/code&gt; if you don't need to install packages on startup. If you're init is setup to auto install missing packges, consider setting up a command line arg for you to specify when auto installing should occur.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Like above, don't do anything network related.&lt;/li&gt;&#xA;&lt;li&gt;Don't load your &lt;code&gt;desktop&lt;/code&gt; on init unless you really really want to.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Do&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Do use something like &lt;code&gt;use-package&lt;/code&gt; to manage your packages. This makes it easy to specify what to require, what to load later, what autoloads what and makes profiling your init on a package by package basis easy.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do know the difference between loading a theme and enabling it. In short, you can load as many as you want, but make sure you are not enabling more than one. Ideally, only load and enable one theme. &lt;code&gt;load-theme&lt;/code&gt; needs an optional arg to prevent the enabling of the theme. It can be easy to accidentally enable multiple themes which is slow and ugly during startup.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do cheat: There are often large global modes that you'll want to load on init, things like undo-tree, autocomplete, ido-mode etc. Ensure the entry functions have autoloads setup then start idle timers in your init to load the packages. I do this will &lt;code&gt;undo-tree-mode&lt;/code&gt;, &lt;code&gt;ido&lt;/code&gt; and others and never notice a delay because by the time I actually need to use them, they are already loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update: use-package has changed a bit, read the official readme before you start using the timer features.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: if you wanted to slightly delay the loading of &lt;code&gt;global-undo-tree-mode&lt;/code&gt; you could put this in your init:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-idle-timer 1 nil (lambda () (global-undo-tree-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now your init can continue along happily and &lt;code&gt;global-undo-tree-mode&lt;/code&gt; won't actually be activated until after everything else is ready to go and you are behind the wheel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;use-package&lt;/code&gt; has support for this kind of behavior built in using the :idle keyword. Here is the &lt;code&gt;undo-tree&lt;/code&gt; config from my .init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package undo-tree&#xA;  :idle (global-undo-tree-mode 1)&#xA;  :bind ((&quot;C-c j&quot; . undo-tree-undo)&#xA;         (&quot;C-c k&quot; . undo-tree-redo)&#xA;         (&quot;C-c l&quot; . undo-tree-switch-branch)&#xA;         (&quot;C-c ;&quot; . undo-tree-visualize))&#xA;  :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do profile your init, it's always surprising to see where the real slow downs are. &lt;a href=&quot;http://www.randomsample.de/profile-dotemacs.el&quot;&gt;profile-dotemacs.el&lt;/a&gt; is an incredible tool that I've used to help me take my init down from ~6 seconds to &amp;lt; 1 second.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A well configured &lt;code&gt;use-package&lt;/code&gt; init can be incredibly fast. I do not byte-compile my init and it uses &lt;code&gt;use-package&lt;/code&gt; to configure 95 packages and starts up in &amp;lt; 1 second.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-05-05T19:46:38.920" LastActivityDate="2015-05-05T19:46:38.920" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2292" PostTypeId="1" CreationDate="2014-10-17T14:05:49.450" Score="35" ViewCount="4116" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get ESS (R) to plot directly to an Emacs buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When interacting with R through ESS, R defaults to spawning a separate graphics window outside of Emacs to draw its plots.  (One can, of course, choose other graphical devices, which is how we plot to PDF, etc.)  Two issues: first, the new window steals focus from Emacs, and second, it sure would be nice to keep everything nice and tidy within the Emacs ecosystem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: is there any way to plot &quot;directly&quot; (or even indirectly) to an Emacs buffer and, more importantly, do so without a lot of manual intervention by the user?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There had been some prior discussion in &lt;a href=&quot;https://stackoverflow.com/questions/5053321/pop-up-windows-in-r-emacs&quot;&gt;this old Stack Overflow thread&lt;/a&gt;, but the partial solutions proposed are not ideal.  They mostly involve changing the plotting device in R (say, to PNG), plotting to a temporary file, and then manually visiting that file in an Emacs buffer.  That all strikes me as very clunky, especially if the goal is to use the plot window/buffer interactively and draw many plots in a session (or add layers to them on the fly).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm speculating here, but it strikes me that, since both R and Emacs support SVG, that might be a useful format to use.  However, it's not clear to me if/how one could hook into the R process to communicate on the fly.  Is there a way to have R spit SVG code directly into an Emacs buffer, or would it need to go through the intermediary of a temporary file?  How could one convince Emacs to visit a new temporary file automagically when R creates it, or update such a plot buffer when the temporary file gets updated/overwritten by a new plot?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2023-07-17T01:04:37.427" Title="ESS plot directly to an Emacs buffer?" Tags="|ess|r|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2293" PostTypeId="1" CreationDate="2014-10-17T14:40:30.007" Score="9" ViewCount="994" Body="&lt;p&gt;I want to start a python-shell &lt;code&gt;M-x python-shell&lt;/code&gt;. If I'm not happy with the syntax highlighting, is it possible to improve it (put more colors in the buffer) without changing major mode? In vim this would be simple with &lt;code&gt;set filetype=python&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The python syntax itself is not highlighted in python-shell mode, I want it to be highlighted.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple solution will be favored because I'm just learning about emacs.&lt;/p&gt;&#xA;" OwnerUserId="2126" LastEditorUserId="50" LastEditDate="2014-10-17T16:46:42.060" LastActivityDate="2014-11-16T08:49:32.193" Title="Change syntax highlighting without changing major mode?" Tags="|shell|syntax-highlighting|repl|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2294" PostTypeId="1" AcceptedAnswerId="2296" CreationDate="2014-10-17T15:17:46.960" Score="4" ViewCount="581" Body="&lt;p&gt;I got the following snippet in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode sticky-buffer-mode&#xA;  &quot;Make the current window always display this buffer.&quot;&#xA;  nil &quot; locked&quot; nil&#xA;  (set-window-dedicated-p (selected-window) sticky-buffer-mode))&#xA;(global-set-key [f11] 'sticky-buffer-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, I can use F11 to lock one window, but the minor mode indicator &quot;locked&quot; shows in the mode line is not easy to see when more than one windows exist in one frame, so I wonder how can I change the color of mode-line-buffer-id or something like &lt;code&gt;filename(locked)&lt;/code&gt; in mode line(change color would be better). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: the original version is able to toggle the status with the same key, so the modified version should be so. Since the minor mode is unnecessary, it would be better to modify &lt;code&gt;define-minor-mode&lt;/code&gt; to &lt;code&gt;defun&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2016-05-21T10:24:00.080" Title="How to show the sticky(lock) window status in the mode line?" Tags="|window|mode-line|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2295" PostTypeId="2" ParentId="2294" CreationDate="2014-10-17T16:32:49.497" Score="5" Body="&lt;p&gt;You could install &lt;a href=&quot;https://github.com/Bruce-Connor/rich-minority&quot;&gt;&lt;code&gt;rich-minority&lt;/code&gt;&lt;/a&gt; from Melpa. It is a minor mode that can highlight or even hide certain minor modes from the mode line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can configure it to highlight &lt;code&gt;&quot; locked&quot;&lt;/code&gt; and to hide other stuff to make more space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq rm-text-properties '((&quot;\\` locked\\'&quot; 'face 'font-lock-warning-face))&#xA;(add-to-list 'rm-blacklist &quot; company&quot;) ; company will be hidden.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can also install &lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line&quot;&gt;&lt;code&gt;smart-mode-line&lt;/code&gt;&lt;/a&gt;, which comes bundled with &lt;code&gt;rich-minority&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-17T16:32:49.497" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2296" PostTypeId="2" ParentId="2294" CreationDate="2014-10-17T16:41:10.670" Score="4" Body="&lt;p&gt;The following command toggles the dedicated status of a window &lt;em&gt;and&lt;/em&gt; changes the color of the mode line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun make-buffer-sticky ()&#xA;  &quot;Make the current window always display this buffer.&quot;&#xA;  (interactive)&#xA;  (let* ((window (get-buffer-window (current-buffer)))&#xA;         (dedicated (window-dedicated-p window)))&#xA;    (if (not dedicated)&#xA;        (face-remap-add-relative 'mode-line '(:background &quot;#0000FF&quot;))&#xA;      (face-remap-add-relative 'mode-line '(:background &quot;#FF0000&quot;)))&#xA;    (set-window-dedicated-p window (not dedicated))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bind it to a convenient key sequence:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c s&quot;) 'make-buffer-sticky)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently, the command toggles between a red (&lt;code&gt;#FF0000&lt;/code&gt;) and a blue (&lt;code&gt;#0000FF&lt;/code&gt;) background for the mode line. You'll have to adjust the colors to your liking.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to use the default mode line color (of your theme) for non-sticky buffers, you can do&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;describe-face&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;mode-line&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to check the current &lt;code&gt;background&lt;/code&gt; color of the mode line.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-28T14:27:28.740" LastActivityDate="2015-01-28T14:27:28.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2297" PostTypeId="2" ParentId="2250" CreationDate="2014-10-17T17:50:15.320" Score="3" Body="&lt;p&gt;Emacspeak is generally the &quot;standard&quot; answer, but you might also like to try speechd-el (at &lt;a href=&quot;http://devel.freebsoft.org/speechd-el&quot; rel=&quot;nofollow&quot;&gt;http://devel.freebsoft.org/speechd-el&lt;/a&gt; ).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-17T17:50:15.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2298" PostTypeId="1" AcceptedAnswerId="2302" CreationDate="2014-10-17T18:14:59.540" Score="27" ViewCount="3973" Body="&lt;p&gt;Suppose I have an Emacs lisp buffer that contains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I call &lt;code&gt;eval-last-sexp&lt;/code&gt; or &lt;code&gt;eval-buffer&lt;/code&gt;, &lt;code&gt;foo&lt;/code&gt; is bound to 1. If I then edit this buffer to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eval-last-sexp&lt;/code&gt; and &lt;code&gt;eval-buffer&lt;/code&gt; do not re-execute this line, so &lt;code&gt;foo&lt;/code&gt; is still 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is particularly challenging when there are multiple such statements and I have to track down which lines are not being re-evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at just restarting Emacs and then &lt;code&gt;(require 'foo)&lt;/code&gt;, but then I have to be careful to avoid loading any older .elc files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I be absolutely, positively sure that the variables and functions defined in the current file are in the same state as loading code afresh in a new Emacs instance?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2014-10-17T21:37:55.607" LastActivityDate="2021-12-14T18:57:20.303" Title="How do I force re-evaluation of a defvar?" Tags="|interactive-development|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2299" PostTypeId="2" ParentId="2298" CreationDate="2014-10-17T18:29:10.410" Score="0" Body="&lt;p&gt;The problem is not that the line is not getting re-evaluated.  The problem is that &lt;code&gt;defvar&lt;/code&gt; defines a variable and its &lt;em&gt;default value&lt;/em&gt;.  If a variable already exists, then changing its default value does not modify the current value.  Unfortunately, I think you will need to run a &lt;code&gt;setq&lt;/code&gt; for every variable whose value you wish to update.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may be overkill, but you could update your file like this if you want to be able to easily update &lt;code&gt;foo&lt;/code&gt; to its new default value.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo 2)&#xA;(setq foo 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that requires that you maintain the default value in two places in your code.  You could also do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(makunbound 'foo)&#xA;(defvar foo 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but if there is a chance that &lt;code&gt;foo&lt;/code&gt; is declared elsewhere you may have some side effects to deal with.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-10-17T18:50:05.913" LastActivityDate="2014-10-17T18:50:05.913" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2300" PostTypeId="2" ParentId="2298" CreationDate="2014-10-17T18:33:53.243" Score="3" Body="&lt;p&gt;The &lt;code&gt;defvar&lt;/code&gt; is being evaluated and doing exactly what you've specified. However, &lt;code&gt;defvar&lt;/code&gt; only sets an initial value: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The optional argument INITVALUE is evaluated, and used to set SYMBOL,&#xA;  only if SYMBOL's value is void. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So to achieve what you want you would either need to unbind the variable before re-evaluating, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(makunbound 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or use &lt;code&gt;setq&lt;/code&gt; to set the value, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo nil &quot;My foo variable.&quot;)&#xA;(setq foo 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't need to specify a docstring here you can skip the &lt;code&gt;defvar&lt;/code&gt; altogether.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to use &lt;code&gt;defvar&lt;/code&gt; and automatically unbind this, you will need to write a function to find &lt;code&gt;defvar&lt;/code&gt; calls in the current buffer (or region, or last sexp, etc); call &lt;code&gt;makunbound&lt;/code&gt; for each one; and then do the actual eval. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-17T18:33:53.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2301" PostTypeId="2" ParentId="2298" CreationDate="2014-10-17T18:51:58.323" Score="6" Body="&lt;p&gt;Like the other answers say, this is just the way defvar works, but you can get around it, this is elisp after all.&lt;/p&gt;&#xA;&lt;p&gt;You can temporarily redefine how defvar works if you'd like and during that time, reload the packages you'd like to reset.&lt;/p&gt;&#xA;&lt;p&gt;I wrote a macro where during the evaluation of the body, defvars values will always be reevaluated.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro my-fake-defvar (name value &amp;amp;rest _)&#xA;  &amp;quot;defvar impersonator that forces reeval.&amp;quot;&#xA;  `(progn (setq ,name ,value)&#xA;          ',name))&#xA;&#xA;(defmacro with-forced-defvar-eval (&amp;amp;rest body)&#xA;  &amp;quot;While evaluating, any defvars encountered are reevaluated&amp;quot;&#xA;  (declare (indent defun))&#xA;  (let ((dv-sym (make-symbol &amp;quot;old-defvar&amp;quot;)))&#xA;    `(let ((,dv-sym (symbol-function 'defvar)))&#xA;       (unwind-protect&#xA;           (progn&#xA;             (fset 'defvar (symbol-function 'my-fake-defvar))&#xA;             ,@body)&#xA;         (fset 'defvar ,dv-sym)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;Example Usage:&lt;/h2&gt;&#xA;&lt;h2&gt;file_a.el&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-var 10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;file_b.el&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;(with-forced-defvar-eval&#xA;  (load-file &amp;quot;file_a.el&amp;quot;)&#xA;  (assert (= my-var 10))&#xA;  (setq my-var 11)&#xA;  (assert (= my-var 11)&#xA;  (load-file &amp;quot;file_a.el&amp;quot;)&#xA;  (assert (= my-var 10))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This this should only be used for the purpose of reevaluating defvars, as it just ignores docstrings when reevaluating. You can modify the macro to support re-evaluating that applies docstrings as well, but I will leave that up to you.&lt;/p&gt;&#xA;&lt;p&gt;In your case you could do&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(with-forced-defvar-eval (require 'some-package))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But know what those who write elisp do so expecting defvar to work as specified, it could be they use defvar to define and setq in some init function to specify the value, so you may end up nil'ing variables you don't intend but this is probably rare.&lt;/p&gt;&#xA;&lt;h2&gt;Alternative Implementation&lt;/h2&gt;&#xA;&lt;p&gt;Using this you can just redefine defvar globally and control whether or not it will set the symbol's value to the INIT-VALUE arg even if the symbol is defined by changing the value of the new &lt;code&gt;defvar-always-reeval-values&lt;/code&gt; symbol.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;;; save the original defvar definition&#xA;(fset 'original-defvar (symbol-function 'defvar))&#xA;&#xA;(defvar defvar-always-reeval-values nil&#xA;  &amp;quot;When non-nil, defvar will reevaluate the init-val arg even if the symbol is defined.&amp;quot;)&#xA;&#xA;(defmacro my-new-defvar (name &amp;amp;optional init-value docstring)&#xA;  &amp;quot;Like defvar, but when `defvar-always-reeval-values' is non-nil, it will set the symbol's value to INIT-VALUE even if the symbol is defined.&amp;quot;&#xA;  `(progn&#xA;     (when defvar-always-reeval-values (condition-case nil&#xA;         (makunbound ',name)&#xA;       (error nil)))&#xA;     (original-defvar ,name ,init-value ,docstring)))&#xA;&#xA;;; globally redefine defvar to the new form&#xA;(fset 'defvar (symbol-function 'my-new-defvar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="33991" LastEditDate="2021-12-14T18:57:20.303" LastActivityDate="2021-12-14T18:57:20.303" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="2302" PostTypeId="2" ParentId="2298" CreationDate="2014-10-17T18:52:59.193" Score="33" Body="&lt;p&gt;As explained in other answers, evaluating a &lt;code&gt;defvar&lt;/code&gt; form using &lt;code&gt;eval-last-sexp&lt;/code&gt; does not reset the default value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, you can use &lt;code&gt;eval-defun&lt;/code&gt; (bound to &lt;code&gt;C-M-x&lt;/code&gt; in &lt;code&gt;emacs-lisp-mode&lt;/code&gt; by default), which implements the behaviour you want as a special exception:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the current defun is actually a call to &lt;code&gt;defvar&lt;/code&gt; or &lt;code&gt;defcustom&lt;/code&gt;,&#xA;  evaluating it this way resets the variable using its initial value&#xA;  expression even if the variable already has some other value.&#xA;  (Normally &lt;code&gt;defvar&lt;/code&gt; and &lt;code&gt;defcustom&lt;/code&gt; do not alter the value if there&#xA;  already is one.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you need to evaluate the full contents of a buffer, you can write a function that walks the top-level forms in turn and calls &lt;code&gt;eval-defun&lt;/code&gt; on each. Something like this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/eval-buffer ()&#xA;  &quot;Execute the current buffer as Lisp code.&#xA;Top-level forms are evaluated with `eval-defun' so that `defvar'&#xA;and `defcustom' forms reset their default values.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (not (eobp))&#xA;      (forward-sexp)&#xA;      (eval-defun nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-10-17T21:40:33.293" LastActivityDate="2014-10-17T21:40:33.293" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2303" PostTypeId="1" CreationDate="2014-10-17T19:25:41.527" Score="11" ViewCount="1243" Body="&lt;p&gt;I have an image generated by plantuml which I open in an Image mode buffer. I want to use Auto-Revert mode so it auto-refreshes, but it doesn't seem to work on Image mode buffers for some reason. Is there something I'm missing?&lt;/p&gt;&#xA;" OwnerUserId="215" LastEditorUserId="25" LastEditDate="2014-10-18T00:07:25.047" LastActivityDate="2015-09-23T12:41:18.820" Title="Making an image (ie. image-mode) auto reload changes from disk" Tags="|image-mode|auto-revert-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2304" PostTypeId="1" CreationDate="2014-10-17T21:07:58.750" Score="8" ViewCount="1971" Body="&lt;p&gt;Has the org-mode text syntax been adopted anywhere besides emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only place I can think of is that Github allows you to write readmes in org mode and can display it like it can markdown. Are there other pieces of software that support the org-mode syntax? I was thinking maybe there are other editors that support it?&lt;/p&gt;&#xA;" OwnerUserId="2131" LastActivityDate="2014-10-18T00:17:57.803" Title="Alternative Org Mode Implementations" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ClosedDate="2014-10-18T01:18:30.120" ContentLicense="CC BY-SA 3.0" />
  <row Id="2305" PostTypeId="2" ParentId="900" CreationDate="2014-10-17T21:15:30.597" Score="3" Body="&lt;p&gt;This answer doesn't really involve emacs per se, but you can use the Unix or GNU &lt;code&gt;od&lt;/code&gt; command to solve your problem. In particular, &lt;code&gt;od -f&lt;/code&gt; is probably what you are looking for regarding floats and &lt;code&gt;od -t fD&lt;/code&gt; will format doubles. You could always use &lt;code&gt;M-!&lt;/code&gt; to get the command output into a buffer if you really need it inside of emacs. ;)&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2014-10-17T21:15:30.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2306" PostTypeId="2" ParentId="2304" CreationDate="2014-10-17T21:47:33.113" Score="2" Body="&lt;p&gt;Github allows for text files written in org syntax (say, in a Readme.org file), but I can't say for sure if they support all the features of the org syntax.&lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2014-10-17T21:47:33.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2307" PostTypeId="2" ParentId="2303" CreationDate="2014-10-17T22:00:36.253" Score="4" Body="&lt;p&gt;You don't provide much information about what you are doing or what you are seeing. Try to give a step-by-step recipe, preferably starting from &lt;code&gt;emacs -Q&lt;/code&gt;, and say what you expect versus what you see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does &lt;em&gt;manually reverting&lt;/em&gt; the buffer work (&lt;code&gt;M-x revert-buffer&lt;/code&gt;, after setting the current buffer to the image buffer)? If so, then investigate what is different about auto-reversion.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you using &lt;code&gt;global-auto-revert-mode&lt;/code&gt;?  If not, is your image buffer on &lt;code&gt;auto-revert-buffer-list&lt;/code&gt;? If not, then that would explain things: &lt;code&gt;auto-revert-mode&lt;/code&gt; adds the current buffer to that list, and &lt;code&gt;auto-revert-buffers&lt;/code&gt; reverts buffers that are on that list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm no expert on &lt;code&gt;image-mode&lt;/code&gt;, but searching for &lt;code&gt;revert&lt;/code&gt; in &lt;code&gt;image-mode.el&lt;/code&gt; I see function &lt;code&gt;image-after-revert-hook&lt;/code&gt;. If it were I, I might start by &lt;code&gt;M-x debug-on-entry image-after-revert-hook&lt;/code&gt; (after loading &lt;code&gt;image-mode.el&lt;/code&gt;, not &lt;code&gt;image-mode.elc&lt;/code&gt;), and then stepping through the debugger (e.g., using &lt;code&gt;d&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A wild guess tells me that that function is not even called, and that the image buffer is not a candidate for reverting. See above.  Maybe try &lt;code&gt;global-auto-revert-mode&lt;/code&gt;, to start with.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-17T22:00:36.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2308" PostTypeId="1" AcceptedAnswerId="2311" CreationDate="2014-10-17T22:09:10.553" Score="7" ViewCount="802" Body="&lt;p&gt;Let me define a keyboard-macro: I enter &lt;kbd&gt;C-x (&lt;/kbd&gt;, then go to beginning with &lt;kbd&gt;M-&amp;lt;&lt;/kbd&gt;, then type &lt;kbd&gt;M-%&lt;/kbd&gt; to query-replace some occurrences of &lt;em&gt;foo&lt;/em&gt; by &lt;em&gt;bar&lt;/em&gt;. Out of 3 occurrences found, I replace only the last 2, then save with &lt;kbd&gt;C-x C-s&lt;/kbd&gt; and finish the kbd-macro with &lt;kbd&gt;C-x )&lt;/kbd&gt;. Well done!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I now run the kbd-macro on another buffer, it will not ask me whether I want to replace &lt;em&gt;foo&lt;/em&gt; by &lt;em&gt;bar&lt;/em&gt;, it will reproduce exactly my previous no-yes-yes answers and replace the 2nd and 3rd occurrences! It will not ask for the 4th or 5th occurrences (this 2nd buffer contains more &lt;em&gt;foo&lt;/em&gt;s)!! This is not what I expected when I defined the macro. I wanted it to call &lt;code&gt;query-replace&lt;/code&gt; and let me answer its queries...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside question: Don't you find this wrong? [I can &lt;code&gt;M-x edit-last-kbd-macro&lt;/code&gt; and see what is recorded and understand the logic of it all but I still find this wrong.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Real question: What could I have used instead of &lt;code&gt;query-replace&lt;/code&gt; to make my kbd-macro work as expected?&lt;/p&gt;&#xA;" OwnerUserId="1992" LastEditorUserId="104" LastEditDate="2014-10-20T08:50:54.393" LastActivityDate="2014-10-20T08:50:54.393" Title="query-replace in keyboard macro" Tags="|replace|keyboard-macros|recursive-edit|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2309" PostTypeId="1" AcceptedAnswerId="2326" CreationDate="2014-10-17T22:29:25.513" Score="2" ViewCount="1023" Body="&lt;p&gt;I have the host &lt;code&gt;chat.deshackra.com&lt;/code&gt; pointing to &lt;code&gt;tigase.im&lt;/code&gt; (with a CNAME entry), and I want to use the starttls connection type for my jabber.el account, however the connection fails:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnutls.c: [1] Note that the security level of the Diffie-Hellman key exchange has been lowered to 256 bits and this may allow decryption of the session data&#xA;&#xA;jorge@chat.deshackra.com/emacs: connection lost: `STARTTLS negotiation failed: Certificate validation failed chat.deshackra.com, verification code 66'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, how can I set &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/emacs-gnutls.html#index-gnutls_002dverify_002derror-5&quot; rel=&quot;nofollow&quot;&gt;gnutls-verify-error&lt;/a&gt; to ignore any error for my domain name?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; If I disable any encryption at all, I get this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Connecting to chat.deshackra.com:5222...&#xA;STARTTLS encryption required, but disabled/non-functional at our end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and my account is not connected.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="11" LastEditDate="2014-10-18T17:52:19.180" LastActivityDate="2014-10-18T17:52:19.180" Title="How do I set `gnutls-verify-error` to not check if certain hostname matches the certificate?" Tags="|jabber|gnutls|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2310" PostTypeId="1" AcceptedAnswerId="2312" CreationDate="2014-10-17T22:59:37.923" Score="31" ViewCount="2281" Body="&lt;p&gt;In C there is the magic variable &lt;code&gt;__func__&lt;/code&gt; that holds the current function name. In Bash, there is an array &lt;code&gt;FUNCNAME&lt;/code&gt; holding the names of all functions in the calling stack !!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar thing in Emacs Lisp? Or any simple way for a function to have access to its name?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not found any answer in the Emacs Lisp manual (chapter 12 on Functions or index of variables and functions and ..) &lt;/p&gt;&#xA;" OwnerUserId="1992" LastEditorUserId="1992" LastEditDate="2016-08-21T15:16:45.263" LastActivityDate="2016-08-21T15:16:45.263" Title="Can functions access their name?" Tags="|elisp|functions|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2311" PostTypeId="2" ParentId="2308" CreationDate="2014-10-17T23:13:56.433" Score="6" Body="&lt;p&gt;Emacs macros playback everything the user enters over the course of the macro, unless they escape the macro. The way to escape a macro in progress is with &lt;kbd&gt;C-x q&lt;/kbd&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macro-Query.html#Keyboard-Macro-Query&quot;&gt;&lt;code&gt;kbd-macro-query&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically I believe you need to enter recursive edit, which can prompt for a command in minibuffer before continuing the macro. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you want to define your &lt;code&gt;query-replace&lt;/code&gt; when calling the macro. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;F3&lt;/kbd&gt; start the macro&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-&amp;lt;&lt;/kbd&gt; jump to beginning&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u C-x q&lt;/kbd&gt; to enter a recursive edit&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-M-c&lt;/kbd&gt; to exit recursive edit&lt;/li&gt;&#xA;&lt;li&gt;... rest of macro actions&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;F4&lt;/kbd&gt; to save, and repeat&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On the next &lt;code&gt;kmacro-end-or-call-macro&lt;/code&gt;, it will jump to the beginning of the buffer, and enter a recursive edit, where you can call &lt;code&gt;query-replace&lt;/code&gt;. Then when you exit recursive edit &lt;kbd&gt;C-M-c&lt;/kbd&gt; it will continue the macro from that point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wish to prompt for an alternate argument to &lt;code&gt;query-replace&lt;/code&gt;, it might make sense to write a simple interactive wrapper function around &lt;code&gt;query-replace&lt;/code&gt; instead of using a recursive edit.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-10-17T23:37:44.090" LastActivityDate="2014-10-17T23:37:44.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2312" PostTypeId="2" ParentId="2310" CreationDate="2014-10-17T23:21:51.290" Score="26" Body="&lt;h2&gt;Updated answer with expansion time lookup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I said in my original answer that there may be a way to do this at expansion/compile time instead of run time to give better performance and I finally implemented that today while working on my answer for this question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/7396/how-can-i-determine-which-function-was-called-interactively-in-the-stack/7405#7405&quot;&gt;How can I determine which function was called interactively in the stack?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a function that yields all current backtrace frames&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun call-stack ()&#xA;  &quot;Return the current call stack frames.&quot;&#xA;  (let ((frames)&#xA;        (frame)&#xA;        (index 5))&#xA;    (while (setq frame (backtrace-frame index))&#xA;      (push frame frames)&#xA;      (incf index))&#xA;    (remove-if-not 'car frames)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using that in a macro we can look up the expansion stack to see what function definition is being expanded at the time and put that value right in the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the function to do the expansion:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro compile-time-function-name ()&#xA;  &quot;Get the name of calling function at expansion time.&quot;&#xA;  (symbol-name&#xA;   (cadadr&#xA;    (third&#xA;     (find-if (lambda (frame) (ignore-errors (equal (car (third frame)) 'defalias)))&#xA;              (reverse (call-stack)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here it is in action.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-test-function ()&#xA;  (message &quot;This function is named '%s'&quot; (compile-time-function-name)))&#xA;&#xA;(symbol-function 'my-test-function)&#xA;;; you can see the function body contains the name, not a lookup&#xA;(lambda nil (message &quot;This function is named '%s'&quot; &quot;my-test-function&quot;))&#xA;&#xA;(my-test-function)&#xA;;; results in:&#xA;&quot;This function is named 'my-test-function'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Original Answer:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;backtrace-frame&lt;/code&gt; to look up the stack until you see frame that represents a direct function call and get the name from that.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun get-current-func-name ()&#xA;  &quot;Get the symbol of the function this function is called from.&quot;&#xA;  ;; 5 is the magic number that makes us look &#xA;  ;; above this function&#xA;  (let* ((index 5)&#xA;         (frame (backtrace-frame index)))&#xA;    ;; from what I can tell, top level function call frames&#xA;    ;; start with t and the second value is the symbol of the function&#xA;    (while (not (equal t (first frame)))&#xA;      (setq frame (backtrace-frame (incf index))))&#xA;    (second frame)))&#xA;&#xA;(defun my-function ()&#xA;  ;; here's the call inside my-function&#xA;  (when t (progn (or (and (get-current-func-name))))))&#xA;&#xA;(defun my-other-function ()&#xA;  ;; we should expect the return value of this function&#xA;  ;; to be the return value of my-function which is the&#xA;  ;; symbol my-function&#xA;  (my-function))&#xA;&#xA;(my-other-function) ;; =&amp;gt; 'my-function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here I am doing the function name lookup at runtime though it is probably possible to implement this at a macro that expands directly into the function symbol which would be more performant for repeat calls and compiled elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this information while trying to write a sort of function call logger for elisp which can be found here in it's incomplete form, but it might be useful to you. &lt;a href=&quot;https://github.com/jordonbiondo/call-log&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/jordonbiondo/call-log&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-01-15T22:12:09.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2313" PostTypeId="2" ParentId="2303" CreationDate="2014-10-17T23:48:15.987" Score="3" Body="&lt;p&gt;I tried opening a png in emacs, enabling &lt;code&gt;auto-revert-mode&lt;/code&gt; and then from a shell, copying another image over it and then replacing that file with a copy of the original png.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I found is that the file is sometimes updated to the new files binary contents, but not the rendered content. If it opens the binary content, try using &lt;kbd&gt;C-c C-c&lt;/kbd&gt; to convert it to an image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After doing that conversion at least once, it starts auto-reverting as I would expect by keeping it an image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I tried this with Emacs 25.1, so it may be a new feature. What version are you using?&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-17T23:48:15.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2314" PostTypeId="2" ParentId="2253" CreationDate="2014-10-18T00:09:42.330" Score="1" Body="&lt;p&gt;I'm guessing from the description, you are running python in the shell buffer? It might make more sense to run python as a synchronous command, or at least use &lt;code&gt;compile&lt;/code&gt; to run python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;compile&lt;/code&gt;, I think it's easier to just bind a key to that, and then using &lt;kbd&gt;C-x `&lt;/kbd&gt; (&lt;code&gt;command-next-error&lt;/code&gt;) or &lt;kbd&gt;M-g n&lt;/kbd&gt;, &lt;kbd&gt;M-g p&lt;/kbd&gt; (&lt;code&gt;next-error&lt;/code&gt;, &lt;code&gt;previous-error&lt;/code&gt;) to jump through errors with the built in error parsing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just tested using the builtin &lt;code&gt;python-mode&lt;/code&gt;, and &lt;kbd&gt;C-c C-c&lt;/kbd&gt; runs &lt;code&gt;python-shell-send-buffer&lt;/code&gt; which starts python and sends the buffer to it. The python shell appears to be error aware so repeatedly calling &lt;kbd&gt;C-x `&lt;/kbd&gt; will jump to each line with an error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not quite following what you mean by it &quot;killing the previous output&quot;? Are you trying to step through errors while simultaneously running the program again?&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-18T00:09:42.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2315" PostTypeId="2" ParentId="2304" CreationDate="2014-10-18T00:17:57.803" Score="10" Body="&lt;p&gt;Yes: &lt;a href=&quot;http://orgmode.org/worg/org-tools/&quot;&gt;http://orgmode.org/worg/org-tools/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is &lt;a href=&quot;https://github.com/wallyqs/org-ruby&quot;&gt;org-ruby&lt;/a&gt;.  It is a ruby implementation of org-mode syntax.  This is what github uses to render org syntax files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pandoc also has Org-mode support and can convert from and to Org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-js is a parser, converter, and editor for org-mode syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also various parsers for org-syntax available for different languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course none of these tools will ever be a fully replacement for the real deal because org-mode and its features heavily rely on Emacs and its environment.&lt;/p&gt;&#xA;" OwnerUserId="2090" LastActivityDate="2014-10-18T00:17:57.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2316" PostTypeId="2" ParentId="2308" CreationDate="2014-10-18T00:41:55.307" Score="3" Body="&lt;p&gt;This doesn't seem like a great fit for a keyboard macro, since you want to ask for user input.  Presumably you are wanting to record a macro because this is a &lt;code&gt;query-replace&lt;/code&gt; that you intend to do frequently. If you can't make the keyboard macro do what you are after, you could create a keybinding to your specific call to &lt;code&gt;query-replace&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c q&quot;)   ;; Create a key binding for &quot;Ctrl+c, q&quot;&#xA;  (lambda () (interactive)      ;; Define an anonymous interactive funcion&#xA;  (query-replace &quot;foo&quot; &quot;bar&quot;    ;; Query-replace &quot;foo&quot; with &quot;bar&quot;&#xA;   nil                          ;; Don't require matching whole words&#xA;   1 (buffer-end 1))))          ;; Run from beginning to end of buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can either add this to your init file and it will be available to you next time you start emacs, or you can take it for a test drive by pasting it into the &lt;code&gt;*scratch*&lt;/code&gt; buffer and running &lt;code&gt;M-x eval-buffer&lt;/code&gt;.  It is bound to &lt;code&gt;C-c q&lt;/code&gt;, but that can easily be modified to whatever you want.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-18T00:41:55.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2317" PostTypeId="2" ParentId="2221" CreationDate="2014-10-18T02:30:50.277" Score="12" Body="&lt;p&gt;I stumbled on &lt;a href=&quot;https://superuser.com/questions/259146/why-latest-emacs-version-dont-support-windows-7-taskbar/283150#283150&quot;&gt;another answer to the problem on SuperUser&lt;/a&gt; today. It seems more hackish, but the result is more consistent with other programs on Windows.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Run runemacs.exe with no pre-existing icon in the taskbar.&lt;/li&gt;&#xA;  &lt;li&gt;Right click on the running Emacs icon in the taskbar, and click on &quot;pin this program to taskbar.&quot;&lt;/li&gt;&#xA;  &lt;li&gt;Close Emacs&lt;/li&gt;&#xA;  &lt;li&gt;Shift right-click on the pinned Emacs icon on the taskbar, click on Properties, and change the target from emacs.exe to runemacs.exe.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2088" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2014-10-18T02:30:50.277" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2318" PostTypeId="1" AcceptedAnswerId="2352" CreationDate="2014-10-18T02:37:37.587" Score="5" ViewCount="217" Body="&lt;p&gt;Is there a way to get &lt;code&gt;info&lt;/code&gt; to display the current node in any of &lt;code&gt;buffer-list/ibuffer/helm-buffers&lt;/code&gt;, especially when there are multiple &lt;code&gt;info&lt;/code&gt; buffers ? Ideally &lt;code&gt;uniquify&lt;/code&gt; should be sufficient to distinguish amongst multiple info buffers, but currently I only see &lt;code&gt;*info*&amp;lt;n&amp;gt;&lt;/code&gt; (n being a natural number). My &lt;code&gt;uniquify-buffer-name-style&lt;/code&gt; is set to &lt;code&gt;post-forward-angle-brackets&lt;/code&gt; if it makes any difference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since emacs makes it relatively hard to open multiple info buffers, I am assuming my scenario is not idiomatic. I would prefer for a way to get uniquify do the right thing automatically, though I would be happy to hack something if someone can point to me the right way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I want to identify individual info buffers when switching in the buffer-list, preferably in the same manner as uniquify does.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Previously, I was not seeing the node name in the modeline as well and phrased the question as such. But turned out a modeline customization was overwriting it. So Drew's answer &lt;code&gt;info+.el&lt;/code&gt; only solves the previous iteration of this question caused by a misconfiguration on my part. I have now emphasized my actual question. &lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2014-10-18T05:24:47.110" LastActivityDate="2014-10-19T17:28:01.813" Title="Info: Display the current node name in the buffer-list or uniquify *info* buffers" Tags="|mode-line|info|uniquify|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2319" PostTypeId="1" AcceptedAnswerId="2401" CreationDate="2014-10-18T02:43:32.570" Score="6" ViewCount="1089" Body="&lt;p&gt;I am writing an Org document with some large figures (images) which I would like to place on a separate page in landscape orientation when exporting to LaTeX.  In LaTeX I can achieve what I want by using &lt;code&gt;\begin{sidewaysfigure}&lt;/code&gt;.  What is the easiest way to get Org to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google turns up &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot; rel=&quot;noreferrer&quot;&gt;this documentation&lt;/a&gt;, which mentions sideways tables but not sideways figures AFAICT, and &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-04/msg00185.html&quot; rel=&quot;noreferrer&quot;&gt;this patch&lt;/a&gt;, which should add support for sideways figures, but I don't think it has been merged into the version I installed from the Org-mode ELPA repository.  (&lt;code&gt;M-x org-version&lt;/code&gt; displays &lt;code&gt;Org-mode version 8.2.9 (8.2.9-elpaplus @ […] ~/.emacs.d/elpa/org-plus-contrib-20141012/&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to get this behavior with my current version of Org?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Edited to add: It looks like the patch above has been merged into the bleeding-edge Org snapshot, so perhaps I should just install that.  However, I would still be interested to know if there is a way to get this functionality using the current stable release of Org from October 2014).&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorUserId="50" LastEditDate="2014-10-18T09:02:30.280" LastActivityDate="2014-10-21T10:55:53.290" Title="How can I have Org use `sidewaysfigure` in LaTeX export?" Tags="|org-mode|latex|org-export|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2320" PostTypeId="2" ParentId="2318" CreationDate="2014-10-18T02:46:00.440" Score="5" Body="&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/InfoPlus&quot;&gt;&lt;strong&gt;Info+&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/info%2b.el&quot;&gt;&lt;code&gt;info+.el&lt;/code&gt;&lt;/a&gt;) then the current node name is in the mode line by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, breadcrumbs are shown in the mode line by default (and the breadcrumbs end in the current node name). This is controlled by option and command &lt;strong&gt;&lt;code&gt;Info-breadcrumbs-in-mode-line-mode&lt;/code&gt;&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can alternatively or additionally show breadcrumbs in the header line - option &lt;code&gt;Info-breadcrumbs-in-header-flag&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for opening multiple Info buffers: most often I use &lt;code&gt;M-n&lt;/code&gt; to clone the current Info buffer and navigate to where I want the clone to go.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-18T02:51:10.330" LastActivityDate="2014-10-18T02:51:10.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2321" PostTypeId="2" ParentId="2275" CreationDate="2014-10-18T08:03:27.753" Score="7" Body="&lt;h2&gt;Description&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The default behavior when invoking emacsclient is a little conservative.&#xA;Check out this comment from&#xA;&lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lib-src/emacsclient.c?h=emacs-24#n1636&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacsclient.c&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  /* Unless we are certain we don't want to occupy the tty, send our&#xA;     tty information to Emacs.  For example, in daemon mode Emacs may&#xA;     need to occupy this tty if no other frame is available.  */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From your description and comments, it sounds like you're trying to start the&#xA;Emacs server on demand while also using the &lt;code&gt;-n&lt;/code&gt; flag.  The &quot;for example&quot; comment here is&#xA;why &lt;code&gt;emacsclient -n -a '' FILE&lt;/code&gt; doesn't satisfy what you're looking for when no server is running.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;code&gt;-a ''&lt;/code&gt; logic starts up a daemon.&lt;/li&gt;&#xA;&lt;li&gt;Then &lt;code&gt;emacsclient&lt;/code&gt; tells it to create a new terminal frame, because that's&#xA;the default unless you're evaluating elisp.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;-n&lt;/code&gt; logic immediately kills that new terminal frame.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you could change Step 2 to create a new graphical frame by default, then&#xA;&lt;code&gt;emacsclient -n -a '' FILE&lt;/code&gt; would do what you want.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Elisp Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can cause Emacs to create a new graphical frame by default if you advise&#xA;the function &lt;code&gt;server-process-filter&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice server-process-filter (before prefer-graphical activate)&#xA;  ;; STRING is a sequence of commands sent from emacsclient to the server.&#xA;  (when (and&#xA;         ;; Check that we're editing a file, as opposed to evaluating elisp.&#xA;         (string-match &quot;-file&quot; string)&#xA;         ;; Check that there are no frames beyond the Emacs daemon's terminal.&#xA;         (daemonp)&#xA;         (null (cdr (frame-list)))&#xA;         (eq (selected-frame) terminal-frame)&#xA;         ;; Check that we have a graphical display.&#xA;         ;; `display-graphic-p' doesn't work here.&#xA;         (getenv &quot;DISPLAY&quot;))&#xA;    (setq string (concat&#xA;                  ;; STRING must be all one line, but comes to us&#xA;                  ;; newline-terminated.  Strip off the trailing newline.&#xA;                  (replace-regexp-in-string &quot;\n$&quot; &quot;&quot; string)&#xA;                  ;; Add the commands to create a graphical frame.&#xA;                  &quot;-window-system &quot;&#xA;                  &quot;-display &quot; (getenv &quot;DISPLAY&quot;)&#xA;                  ;; Add back the newline.&#xA;                  &quot;\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put that in your init-file, then, as said, &lt;code&gt;emacsclient -n -a '' FILE&lt;/code&gt; and Bob's your uncle.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Compare to Shell Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;On the one hand, I can point to a few advantages to using this defadvice&#xA;approach as compared to using the&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/a/2277/372&quot;&gt;script suggested by Archenoth&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;emacs --eval '(server-start)' $* &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as the alternate editor.  With the defadvice:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;save-buffers-kill-terminal&lt;/code&gt; (&lt;code&gt;C-x C-c&lt;/code&gt; by default) behaves consistently&#xA;across all frames.  It never kills the Emacs process, because every frame&#xA;is always a client frame.&lt;/li&gt;&#xA;&lt;li&gt;The daemon's terminal frame hangs around.  Commands like &lt;code&gt;find-grep&lt;/code&gt; that&#xA;shell out to external processes behave better when the dumb terminal is&#xA;there.  At least, I experience fewer shell-escaping related headaches.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;On the other hand ... yeah.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;That shell script is beautifully simple.&lt;/li&gt;&#xA;&lt;li&gt;Advising Emacs' communication protocol is not.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Conclusion&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Maybe there's a compromise?  This is the best I could come up with.  You set it as your $EDITOR.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;&#xA;emacsclient -e &quot;(frames-on-display-list \&quot;${DISPLAY}\&quot;)&quot; 1&amp;gt;/dev/null 2&amp;gt;/dev/null&#xA;if [ &quot;$?&quot; = &quot;1&quot; ]; then&#xA;    emacsclient -c -n -a &quot;&quot; &quot;$@&quot;&#xA;else&#xA;    emacsclient -n &quot;$@&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="372" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-10-18T17:30:32.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2322" PostTypeId="1" AcceptedAnswerId="2324" CreationDate="2014-10-18T08:07:20.607" Score="15" ViewCount="1118" Body="&lt;p&gt;Is there a set of tools to enable testing a package on multiple Emacs versions.&#xA;For example 24.4 is almost released. Can I install it and still safely test my package in 24.1?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How would I deal with a conflicting .emacs.d/?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I came across a &lt;a href=&quot;https://github.com/Bruce-Connor/names#version-compatibility&quot;&gt;repo&lt;/a&gt; on Github that says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Currently, Names is being supported on the entire Emacs 24 family (24.1–24.4)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And realized I have no idea how to accomplish testing cleanly on multiple Emacs versions.&lt;/p&gt;&#xA;" OwnerUserId="294" LastActivityDate="2014-10-18T11:02:14.907" Title="How to run multiple versions of emacs for package development?" Tags="|version-compatibilty|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2323" PostTypeId="1" AcceptedAnswerId="2325" CreationDate="2014-10-18T10:00:21.457" Score="10" ViewCount="1555" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/d7XGr.png&quot; alt=&quot;Inactive Minibuffer&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried it with the following settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'minibuffer-setup-hook&#xA;      (lambda ()&#xA;        (make-local-variable 'face-remapping-alist)&#xA;        (add-to-list 'face-remapping-alist '(default (:background &quot;green&quot;)))))&#xA;&#xA;(set-face-background 'minibuffer-prompt &quot;blue&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but they only affected the active minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kXFi4.png&quot; alt=&quot;Active Minibuffer&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="50" LastEditDate="2014-10-18T12:38:24.220" LastActivityDate="2021-07-01T06:32:37.197" Title="Can I change the background color of the inactive minibuffer?" Tags="|customize|faces|minibuffer|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2324" PostTypeId="2" ParentId="2322" CreationDate="2014-10-18T11:02:14.907" Score="13" Body="&lt;p&gt;There is a good collection of tools for Emacs Lisp testing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/rejeep/evm&quot;&gt;evm&lt;/a&gt; - Emacs Version Manager.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/cask/cask&quot;&gt;Cask&lt;/a&gt; - project management tool for Emacs that helps automate the package development cycle; development, dependencies, testing, building, packaging and more.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/rejeep/ert-runner.el&quot;&gt;ert-runner&lt;/a&gt; - tool for Emacs projects tested using Ert.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/ecukes/ecukes&quot;&gt;ecukes&lt;/a&gt; - testing framework for integration testing.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://travis-ci.org/&quot;&gt;Travis CI&lt;/a&gt; - continuous integration service.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/sviridov/undercover.el&quot;&gt;undercover.el&lt;/a&gt; - test coverage library for Emacs Lisp.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There is also a lot of useful information about Emacs Lisp testing at Johan Andersson's &lt;a href=&quot;http://tuxicity.se/&quot;&gt;blog&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="716" LastActivityDate="2014-10-18T11:02:14.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2325" PostTypeId="2" ParentId="2323" CreationDate="2014-10-18T15:43:37.907" Score="6" Body="&lt;p&gt;&lt;code&gt;minibuffer-setup-hook&lt;/code&gt; is used only when the minibuffer is set up, i.e., activated, not when it is deactivated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;minibuffer-exit-hook&lt;/code&gt; takes effect when the minibuffer is exited. There is also &lt;code&gt;minibuffer-inactive-mode-hook&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But although those do initiate the color change (as shown by adding &lt;code&gt;(debug)&lt;/code&gt; at the beginning of the hook function, and then stepping through the debugger with &lt;code&gt;d&lt;/code&gt;), it seems that &lt;code&gt;kill-local-variables&lt;/code&gt; removes the added color at some point. I don't have time now to check further, but perhaps you can, or perhaps someone else has a quick solution. Sorry for providing only incomplete info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gotta go now - but quickly, I'm guessing that maybe you don't need to fiddle with hooks at all, and you can just do the face remapping for all buffers with names matching &lt;code&gt;\` \*Minibuf-[0-9]+\*\'&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;FWIW, I use a &lt;a href=&quot;https://www.emacswiki.org/emacs/download/oneonone.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;separate minibuffer frame&lt;/a&gt;, and I put this on &lt;code&gt;minibuffer-exit-hook&lt;/code&gt; to color the frame background:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun 1on1-color-minibuffer-frame-on-exit ()&#xA;  &quot;Change background of minibuffer frame to reflect the minibuffer depth.&#xA;Use this when reducing the minibuffer recursion depth.&quot;&#xA;  (when 1on1-minibuffer-frame&#xA;    (save-window-excursion&#xA;      (select-frame 1on1-minibuffer-frame)&#xA;      (cond ((= (minibuffer-depth) 2)&#xA;             (set-background-color 1on1-active-minibuffer-frame-background))&#xA;            ((&amp;lt; (minibuffer-depth) 2)&#xA;             (set-background-color 1on1-inactive-minibuffer-frame-background))&#xA;            (t&#xA;             (set-background-color (hexrgb-increment-hue ; Change bg hue slightly.&#xA;                                    (frame-parameter nil 'background-color)&#xA;                                    1on1-color-minibuffer-frame-on-exit-increment)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-08-28T04:26:11.517" LastActivityDate="2018-08-28T04:26:11.517" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="2326" PostTypeId="2" ParentId="2309" CreationDate="2014-10-18T15:46:14.283" Score="3" Body="&lt;p&gt;As jabber.el started using the GnuTLS facility of Emacs before the variable &lt;code&gt;gnutls-verify-error&lt;/code&gt; existed, it uses its own variable &lt;code&gt;jabber-invalid-certificate-servers&lt;/code&gt;.  That variable contains a list of all servers for which certificate errors should be ignored.  Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq jabber-invalid-certificate-servers '(&quot;chat.deshackra.com&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-10-18T15:46:14.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2327" PostTypeId="1" AcceptedAnswerId="2386" CreationDate="2014-10-18T17:09:23.007" Score="5" ViewCount="1304" Body="&lt;p&gt;I don't understand how &lt;code&gt;setq-mode-local&lt;/code&gt; works (mode-local is a package from cedet). &#xA;The macro's documentation says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;setq-mode-local is a Lisp macro in `mode-local.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(setq-mode-local MODE &amp;amp;rest ARGS)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Assign new values to variables local in MODE.&lt;br&gt;&#xA;  MODE must be a major mode symbol.&lt;br&gt;&#xA;  ARGS is a list (SYM VAL SYM VAL ...).&lt;br&gt;&#xA;  The symbols SYM are variables; they are literal (not evaluated).&lt;br&gt;&#xA;  The values VAL are expressions; they are evaluated.&lt;br&gt;&#xA;  Set each SYM to the value of its VAL, locally in buffers already in&lt;br&gt;&#xA;  MODE, or in buffers switched to that mode.&lt;br&gt;&#xA;  Return the value of the last VAL.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does the mode need to be loaded?&lt;/li&gt;&#xA;&lt;li&gt;How does this differ from just adding a &lt;code&gt;setq-local&lt;/code&gt; call to a mode-hook?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="98" LastEditorUserId="50" LastEditDate="2014-10-18T19:32:29.570" LastActivityDate="2014-10-20T20:35:46.303" Title="What is the difference between setq-mode-local and setq-local" Tags="|hooks|cedet|buffer-local|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2328" PostTypeId="1" AcceptedAnswerId="2343" CreationDate="2014-10-18T17:42:15.970" Score="21" ViewCount="5433" Body="&lt;p&gt;If I have a code snippet that I tangle to a file, but I expect the file name to change over time, Is there a cleaner way to change the filename than Query-replace?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say I tangle code to ~/dir/my-file.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle ~/dir/my-file.el&#xA;(setq myvar1 &quot;value1&quot;)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC emacs-lisp :tangle ~/dir/my-file.el&#xA;(defun foo (bar) ... )&#xA;#+END_SRC&#xA;&#xA;etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then later on I realize that the file would be better placed in another location:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle ~/dir/my/file.el&#xA;(setq myvar1 &quot;value1&quot;)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC emacs-lisp :tangle ~/dir/my/file.el&#xA;(defun foo (bar) ... )&#xA;#+END_SRC&#xA;&#xA;etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to change the argument to :tangle dynamically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have investigated and discovered that I can feed elisp into the :tangle argument. If I evaluate &lt;code&gt;(setq myfile &quot;~/dir/file.el)&lt;/code&gt; and then tangle the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle (print myfile)&#xA;(setq myvar1 &quot;value1&quot;)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC emacs-lisp :tangle (print myfile)&#xA;(defun foo (bar) ... )&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the desired result I am looking for.&#xA;I could then execute an elisp snippet to set the variable using org-babel, but I was wondering if there is a cleaner way to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The docs on the :tangle header do not stipulate a native way.&lt;/p&gt;&#xA;" OwnerUserId="294" LastEditorUserId="50" LastEditDate="2014-10-18T17:44:26.570" LastActivityDate="2022-08-12T15:21:54.560" Title="Using Org Babel to tangle to a variable file name" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2329" PostTypeId="2" ParentId="2269" CreationDate="2014-10-18T18:02:33.183" Score="1" Body="&lt;p&gt;The font size will affect the size of the window at startup, this problem occurred to me when I start to configure it for different screen resolution(home and work use, I put the configuration in Github) months ago. Actually, you can set the size of the window and font at the same time, here is the solution.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-frame-size-according-to-resolution ()&#xA;  (interactive)&#xA;  (if window-system&#xA;      (progn&#xA;        ;; use 120 char wide window for largish displays&#xA;        ;; and smaller 80 column windows for smaller displays&#xA;        ;; pick whatever numbers make sense for you&#xA;        (if (&amp;gt; (x-display-pixel-width) 1500)&#xA;            (setq default-frame-alist&#xA;                  '((top . 0)(left . 0)&#xA;                    (width . 85)(height . 48)&#xA;                    (font . &quot;Menlo-13&quot;)&#xA;                    ))&#xA;          (setq default-frame-alist&#xA;                '((top . 0)(left . 0)&#xA;                  (width . 85)(height . 35)&#xA;                  (font . &quot;Menlo-13&quot;)&#xA;                  )))&#xA;        ))&#xA;)&#xA;(set-frame-size-according-to-resolution)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Adjust the 1500, top/left width/height, font/font-size as you like. Remove the resolution related if you use only one (same resolution)screen, use only the &lt;code&gt;setq default-frame-alist&lt;/code&gt; part.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2014-10-18T18:02:33.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2330" PostTypeId="1" AcceptedAnswerId="2342" CreationDate="2014-10-18T19:16:37.123" Score="4" ViewCount="334" Body="&lt;p&gt;I'm trying to add more symbols to &lt;code&gt;haskell-mode&lt;/code&gt;'s &lt;code&gt;haskell-font-lock&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation for &lt;code&gt;haskell-font-lock-symbols-alist&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alist mapping Haskell symbols to chars. Each element has the form&#xA;  (STRING . CHAR) or (STRING CHAR PREDICATE). STRING is the Haskell&#xA;  symbol. CHAR is the character with which to represent this symbol.&#xA;  PREDICATE if present is a function of one argument (the start position&#xA;  of the symbol) which should return non-nil if this mapping should be&#xA;  disabled at that position.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm trying something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'haskell-font-lock-symbols-alist `(&quot;heart&quot; . 2665))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when typing 'heart' in haskell mode the font-lock won't work, although it works for &lt;code&gt;-&amp;gt;&lt;/code&gt;, &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;=&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing ?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="105" LastEditDate="2014-12-21T03:56:28.587" LastActivityDate="2014-12-21T03:56:28.587" Title="Add more symbols to haskell `haskell-font-lock-symbols-alist`" Tags="|elisp|font-lock|haskell-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2331" PostTypeId="1" AcceptedAnswerId="2332" CreationDate="2014-10-18T19:17:29.287" Score="8" ViewCount="1060" Body="&lt;p&gt;When I print messages using &lt;code&gt;(message (propertize &quot;text&quot; 'face 'some-face))&lt;/code&gt; properties get printed as text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#(&quot;text&quot; 0 4 (face some-face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I have faces displayed properly?&lt;/p&gt;&#xA;" OwnerUserId="98" LastEditorUserId="105" LastEditDate="2014-10-19T14:25:55.483" LastActivityDate="2014-10-19T14:25:55.483" Title="How can I set face for echo-area message" Tags="|faces|echo-area|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2332" PostTypeId="2" ParentId="2331" CreationDate="2014-10-18T19:42:28.973" Score="14" Body="&lt;p&gt;No they don't get printed as text. :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluate the following function, then call &lt;code&gt;M-x mes&lt;/code&gt;. Doesn't it work?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mes ()&#xA;  &quot;message me&quot;&#xA;  (interactive)&#xA;  (message (propertize &quot;text&quot; 'face 'font-lock-warning-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The problem, I imagine, is that you're evaluating your snippet with&#xA;something like &lt;code&gt;eval-last-sexp&lt;/code&gt; (&lt;code&gt;C-x C-e&lt;/code&gt;). This function (and its&#xA;brethren) prints the form's return value on the echo area, which is&#xA;what you're seeing (the &lt;code&gt;message&lt;/code&gt; function also returns the string it&#xA;prints).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your test code is working, but the message in the mode-line is getting&#xA;immediately replaced by the return value. That's why you can't see it.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-18T21:33:03.457" LastActivityDate="2014-10-18T21:33:03.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2334" PostTypeId="5" CreationDate="2014-10-19T01:43:50.140" Score="0" Body="&lt;p&gt;A keymap is a Lisp data structure that specifies key bindings for various key sequences. A single keymap directly specifies definitions for individual events. When a key sequence consists of a single event, its binding in a keymap is the keymap's definition for that event.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The binding of a longer key sequence is found by an iterative process: first find the definition of the first event (which must itself be a keymap); then find the second event's definition in that keymap, and so on until all the events in the key sequence have been processed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the binding of a key sequence is a keymap, we call the key sequence a prefix key. Otherwise, we call it a complete key (because no more events can be added to it). If the binding is nil, we call the key undefined. Examples of prefix keys are &lt;code&gt;C-c&lt;/code&gt;, &lt;code&gt;C-x&lt;/code&gt;, and &lt;code&gt;C-x 4&lt;/code&gt;. Examples of defined complete keys are &lt;code&gt;X&lt;/code&gt;, &lt;code&gt;enter&lt;/code&gt;, and &lt;code&gt;C-x 4 C-f&lt;/code&gt;. Examples of undefined complete keys are &lt;code&gt;C-x C-g&lt;/code&gt;, and &lt;code&gt;C-c 3&lt;/code&gt;. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Keys.html#Prefix-Keys&quot; rel=&quot;nofollow&quot;&gt;Prefix Keys&lt;/a&gt;, for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rule for finding the binding of a key sequence assumes that the intermediate bindings (found for the events before the last) are all keymaps; if this is not so, the sequence of events does not form a unit—it is not really one key sequence. In other words, removing one or more events from the end of any valid key sequence must always yield a prefix key. For example, &lt;code&gt;C-f C-n&lt;/code&gt; is not a key sequence; &lt;code&gt;C-f&lt;/code&gt; is not a prefix key, so a longer sequence starting with &lt;code&gt;C-f&lt;/code&gt; cannot be a key sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The set of possible multi-event key sequences depends on the bindings for prefix keys; therefore, it can be different for different keymaps, and can change when bindings are changed. However, a one-event sequence is always a key sequence, because it does not depend on any prefix keys for its well-formedness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At any time, several primary keymaps are active—that is, in use for finding key bindings. These are the global map, which is shared by all buffers; the local keymap, which is usually associated with a specific major mode; and zero or more minor mode keymaps, which belong to currently enabled minor modes. (Not all minor modes have keymaps.) The local keymap bindings shadow (i.e., take precedence over) the corresponding global bindings. The minor mode keymaps shadow both local and global keymaps. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Active-Keymaps.html#Active-Keymaps&quot; rel=&quot;nofollow&quot;&gt;Active Keymaps&lt;/a&gt;, for details.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2014-10-20T03:47:07.823" LastActivityDate="2014-10-20T03:47:07.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2335" PostTypeId="4" CreationDate="2014-10-19T01:43:50.140" Score="0" Body="A keymap is a Lisp data structure that specifies key bindings for various key sequences. A single keymap directly specifies definitions for individual events. When a key sequence consists of a single event, its binding in a keymap is the keymap's definition for that event." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-19T05:36:28.030" LastActivityDate="2014-10-19T05:36:28.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2336" PostTypeId="5" CreationDate="2014-10-19T01:46:46.940" Score="0" Body="&lt;p&gt;Anything related to key-bindings (a.k.a. &lt;em&gt;keyboard shortcuts&lt;/em&gt;, &lt;em&gt;hotkeys&lt;/em&gt;, etc.), i.e. the associations between key combinations and the corresponding actions triggered when the user presses such combinations. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For example, pressing keyboard key &lt;kbd&gt;Alt + F4&lt;/kbd&gt; closes an application on Microsoft Windows, while &lt;kbd&gt;Ctrl + C&lt;/kbd&gt; copies the selected text into the clipboard for both Linux and Windows GUI applications.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs (logical) &lt;em&gt;key sequences&lt;/em&gt; that are associated with such &lt;em&gt;physical keyboard keys&lt;/em&gt; are typically &lt;code&gt;M-&amp;lt;f4&amp;gt;&lt;/code&gt; (or &lt;code&gt;ESC &amp;lt;f4&amp;gt;&lt;/code&gt;) and &lt;code&gt;C-c&lt;/code&gt;, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is Emacs &lt;strong&gt;&lt;em&gt;key sequences&lt;/em&gt;&lt;/strong&gt; that are used in Emacs key bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html#Key-Sequences&quot; rel=&quot;nofollow&quot;&gt;Key Sequences&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2014-10-19T20:21:03.383" LastActivityDate="2014-10-19T20:21:03.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2337" PostTypeId="4" CreationDate="2014-10-19T01:46:46.940" Score="0" Body="Keyboard shortcuts, key chords, key sequences, hotkeys, or any association between key combinations and corresponding actions in Emacs. " OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-09T11:15:38.857" LastActivityDate="2017-02-09T11:15:38.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2338" PostTypeId="1" AcceptedAnswerId="2346" CreationDate="2014-10-19T03:05:48.173" Score="11" ViewCount="3351" Body="&lt;p&gt;I would like to be able to see the location of the current file's parent directory, independent of the current buffer name.&lt;/p&gt;&#xA;" OwnerUserId="2145" LastActivityDate="2015-10-16T16:10:45.520" Title="How can I display the parent directory of the current file in the modeline?" Tags="|mode-line|directories|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2339" PostTypeId="2" ParentId="2338" CreationDate="2014-10-19T06:08:50.280" Score="10" Body="&lt;p&gt;I assume you mean that you want to see the directory &lt;em&gt;instead of&lt;/em&gt; the buffer name.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default mode-line-buffer-identification&#xA;              '(:eval default-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you want your home directory abbreviated to &lt;code&gt;~/&lt;/code&gt; (instead of an absolute file name, from the root), then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default mode-line-buffer-identification&#xA;              '(:eval (abbreviate-file-name default-directory)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you want only the parent directory name, as a single directory-component name, then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default mode-line-buffer-identification&#xA;              '(:eval (file-name-nondirectory&#xA;                        (directory-file-name default-directory))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you do want to keep also the buffer name, as @Malabarba supposes, then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default mode-line-buffer-identification&#xA;              (let ((orig  (car mode-line-buffer-identification)))&#xA;                `(:eval (cons (concat ,orig (abbreviate-file-name default-directory))&#xA;                              (cdr mode-line-buffer-identification)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The point is that you just need to use the value of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Expansion.html#File-Name-Expansion&quot;&gt;&lt;strong&gt;&lt;code&gt;default-directory&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; (possibly simplified from an absolute name, if you want) in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Variables.html#Mode-Line-Variables&quot;&gt;&lt;strong&gt;&lt;code&gt;mode-line-buffer-identification&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;. You can set that variable to just the directory name, or you can set it to a value that keeps also the buffer name.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If what you ask is all you want, it is simple to configure the mode line to include the &lt;code&gt;default-directory&lt;/code&gt;, however you want it to appear.  No need to load multiple libraries for this (which is what &lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line&quot;&gt;&lt;code&gt;smart-mode-line&lt;/code&gt;&lt;/a&gt; does).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-19T14:22:08.030" LastActivityDate="2014-10-19T14:22:08.030" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2340" PostTypeId="2" ParentId="2096" CreationDate="2014-10-19T08:14:49.947" Score="9" Body="&lt;p&gt;You cannot do this using different themes. The solution is to create a theme that has different face definitions depending on the terminal. If you look at an example like &lt;code&gt;font-lock-comment-face&lt;/code&gt;, you'll see how it works. Instead of specifying &lt;code&gt;((class color) (min-colors 88) (background dark))&lt;/code&gt; you could also specifcy &lt;code&gt;(type tty)&lt;/code&gt; or &lt;code&gt;(type graphic)&lt;/code&gt; etc. The manual &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Faces.html&quot; rel=&quot;noreferrer&quot;&gt;has more info&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface font-lock-comment-face&#xA;  '((((class grayscale) (background light))&#xA; :foreground &quot;DimGray&quot; :weight bold :slant italic)&#xA;(((class grayscale) (background dark))&#xA; :foreground &quot;LightGray&quot; :weight bold :slant italic)&#xA;(((class color) (min-colors 88) (background light))&#xA; :foreground &quot;Firebrick&quot;)&#xA;(((class color) (min-colors 88) (background dark))&#xA; :foreground &quot;chocolate1&quot;)&#xA;(((class color) (min-colors 16) (background light))&#xA; :foreground &quot;red&quot;)&#xA;(((class color) (min-colors 16) (background dark))&#xA; :foreground &quot;red1&quot;)&#xA;(((class color) (min-colors 8) (background light))&#xA; :foreground &quot;red&quot;)&#xA;(((class color) (min-colors 8) (background dark))&#xA; :foreground &quot;yellow&quot;)&#xA;(t :weight bold :slant italic))&#xA;  &quot;Font Lock mode face used to highlight comments.&quot;&#xA;  :group 'font-lock-faces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess you could write a function that takes two themes and produces a merged theme, with faces from one theme being assigned &lt;code&gt;(type tty)&lt;/code&gt; and faces from the other theme being assigned &lt;code&gt;(type graphic)&lt;/code&gt; where both of the original themes use &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="360" LastEditorUserId="360" LastEditDate="2014-10-19T09:18:23.157" LastActivityDate="2014-10-19T09:18:23.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2341" PostTypeId="2" ParentId="2338" CreationDate="2014-10-19T09:09:34.510" Score="7" Body="&lt;p&gt;You install use&#xA;&lt;strong&gt;&lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line&quot;&gt;smart-mode-line&lt;/a&gt;.&lt;/strong&gt;&#xA;It's configured to display the file path in the mode-line, whenever&#xA;that's relevant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/Bruce-Connor/smart-mode-line/master/screenshot-2013-11-11-dark.png&quot; alt=&quot;dark theme&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just install it, and then turn it on with &lt;code&gt;(sml/setup)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also has a lot of features to make that display more concise. For&#xA;instance, &lt;em&gt;“~/.emacs.d/”&lt;/em&gt; gets replaced with &lt;em&gt;“:ED:”&lt;/em&gt; (and you can&#xA;configure further replacements).&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-19T09:09:34.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2342" PostTypeId="2" ParentId="2330" CreationDate="2014-10-19T09:33:28.370" Score="4" Body="&lt;p&gt;The important value at runtime is &lt;code&gt;haskell-font-lock-keywords&lt;/code&gt;, which is generated from the alist when loading &lt;code&gt;haskell-font-lock.el&lt;/code&gt;.  After changing &lt;code&gt;haskell-font-lock-symbols-alist&lt;/code&gt; you will also have to recompute the value of &lt;code&gt;hakskell-font-lock-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This snippet will add the heart character to the alist and recompute &lt;code&gt;haskell-font-lock-keywords&lt;/code&gt; such that &lt;code&gt;heart&lt;/code&gt; in a Haskell source file is rendered as   &lt;code&gt;♥&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'haskell-font-lock&#xA; '(progn&#xA;    (add-to-list 'haskell-font-lock-symbols-alist `(&quot;heart&quot; . 9829))&#xA;    (setq haskell-font-lock-keywords&#xA;          (haskell-font-lock-keywords-create nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-19T09:33:28.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2343" PostTypeId="2" ParentId="2328" CreationDate="2014-10-19T12:30:21.203" Score="19" Body="&lt;p&gt;You should not repeat such things, but define them in one place.&#xA;For example you can define output file in a &lt;a href=&quot;https://orgmode.org/manual/Drawers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;drawer&lt;/a&gt; as &lt;a href=&quot;https://orgmode.org/manual/Header-arguments.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;header args&lt;/a&gt; for &lt;strong&gt;whole tree and subtrees&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Header&#xA;:PROPERTIES:&#xA;:tangle: ~/dir/my/testfile.el&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;or for &lt;em&gt;:dir&lt;/em&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Header&#xA;:PROPERTIES:&#xA;:header-args: :dir ~/dir/my/dir/&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As described in &lt;a href=&quot;https://orgmode.org/manual/Using-Header-Arguments.html#Using-header-arguments&quot; rel=&quot;nofollow noreferrer&quot;&gt;docs&lt;/a&gt; you can have:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;System-wide header arguments&lt;/li&gt;&#xA;&lt;li&gt;Language-specific header arguments&lt;/li&gt;&#xA;&lt;li&gt;Header arguments in Org mode properties&lt;/li&gt;&#xA;&lt;li&gt;Language-specific header arguments in Org mode properties&lt;/li&gt;&#xA;&lt;li&gt;Code block specific header arguments&lt;/li&gt;&#xA;&lt;li&gt;Header arguments in function calls&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="220" LastEditorUserId="13175" LastEditDate="2022-08-12T15:21:54.560" LastActivityDate="2022-08-12T15:21:54.560" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2344" PostTypeId="5" CreationDate="2014-10-19T12:55:59.970" Score="0" Body="&lt;p&gt;Emacs includes a facility that lets you easily download and install packages that implement additional features. Each package is a separate Emacs Lisp program, sometimes including other components such as an Info manual.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;list-packages&lt;/code&gt; brings up a buffer named &lt;em&gt;Packages&lt;/em&gt; with a list of all packages. You can install or uninstall packages via this buffer. See Package Menu below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt; (describe-package) prompts for the name of a package, and displays a help buffer describing the attributes of the package and the features that it implements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, Emacs downloads packages from a package archive maintained by the Emacs developers and hosted by the GNU project. Optionally, you can also download packages from archives maintained by third parties. See Package Installation below.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Menu.html#Package-Menu&quot; rel=&quot;nofollow&quot;&gt;Package Menu&lt;/a&gt;: Buffer for viewing and managing packages.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html#Package-Installation&quot; rel=&quot;nofollow&quot;&gt;Package Installation&lt;/a&gt;: Options for package installation.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Files.html#Package-Files&quot; rel=&quot;nofollow&quot;&gt;Package Files&lt;/a&gt;: Where packages are installed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-19T20:20:35.870" LastActivityDate="2014-10-19T20:20:35.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2345" PostTypeId="4" CreationDate="2014-10-19T12:55:59.970" Score="0" Body="Emacs includes a facility that lets you easily download and install packages that implement additional features. Each package is a separate Emacs Lisp program, sometimes including other components such as an Info manual." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-20T03:47:38.027" LastActivityDate="2014-10-20T03:47:38.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2346" PostTypeId="2" ParentId="2338" CreationDate="2014-10-19T12:56:40.113" Score="13" Body="&lt;p&gt;You can configure the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html#Mode-Line-Format&quot;&gt;mode line format&lt;/a&gt; as you wish. If you want to show the parent directory together with the buffer name (which is usually the file name, for a buffer that's visiting a file), modify &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Variables.html#index-mode_002dline_002dbuffer_002didentification-1752&quot;&gt;&lt;code&gt;mode-line-buffer-identification&lt;/code&gt;&lt;/a&gt;; otherwise, add an entry to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Top.html#index-mode_002dline_002dformat-1748&quot;&gt;&lt;code&gt;mode-line-format&lt;/code&gt;&lt;/a&gt;. There isn't a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/_0025_002dConstructs.html#g_t_0025_002dConstructs&quot;&gt;built-in construct&lt;/a&gt; for “parent directory of the current file”, so you'll need to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html#Mode-Line-Data&quot;&gt;build that yourself&lt;/a&gt;, for example with &lt;code&gt;:eval&lt;/code&gt;. Here's an example that adds the directory name after the buffer name, and does nothing in buffers that aren't visiting files (including Dired); you may want to refine it with formatting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mode-line-buffer-file-parent-directory ()&#xA;  (when buffer-file-name&#xA;    (concat &quot;[&quot; (file-name-nondirectory (directory-file-name (file-name-directory buffer-file-name))) &quot;]&quot;)))&#xA;(setq-default mode-line-buffer-identification&#xA;      (cons (car mode-line-buffer-identification) '((:eval (mode-line-buffer-file-parent-directory)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another method would be to set a variable containing the text you want in &lt;code&gt;find-file-hooks&lt;/code&gt;. I also show how you can set properties with the &lt;code&gt;:propertize&lt;/code&gt; construct.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar buffer-file-parent-directory nil&#xA;  &quot;Parent directory of the current directory.&#xA;This variable is nil if the current buffer isn't visiting a file.&quot;)&#xA;(make-variable-buffer-local 'buffer-file-parent-directory)&#xA;(put 'buffer-file-parent-directory 'permanent-local t)&#xA;(defconst mode-line-buffer-file-parent-directory&#xA;  '(:propertize (list buffer-file-parent-directory &quot;/&quot;) face mode-line-buffer-id))&#xA;(defun set-buffer-file-parent-directory ()&#xA;  (when buffer-file-name&#xA;    (setq buffer-file-parent-directory&#xA;          (file-name-as-directory (file-name-nondirectory (directory-file-name (file-name-directory buffer-file-name)))))))&#xA;(add-hook 'find-file-hook 'set-buffer-file-parent-directory)&#xA;(let ((list mode-line-format))&#xA;  (while (not (eq (car list) 'mode-line-buffer-identification))&#xA;    (setq list (cdr list)))&#xA;  (setcdr list (cons (car list) (cdr list)))&#xA;  (setcar list 'mode-line-buffer-file-parent-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If what you really wanted was to have the directory name in case you have multiple files with the same name in different directories, Emacs has this built in, with the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html#Uniquify&quot;&gt;uniquify library&lt;/a&gt;. When there would be multiple buffers with the same name, this library causes the buffer name to look like &lt;code&gt;file.ext&amp;lt;foo&amp;gt;&lt;/code&gt; and &lt;code&gt;file.ext&amp;lt;bar&amp;gt;&lt;/code&gt; instead of &lt;code&gt;file.ext&lt;/code&gt; and &lt;code&gt;file.ext&amp;lt;2&amp;gt;&lt;/code&gt;. You can fine-tune the format by customizing &lt;code&gt;uniquify-buffer-name-style&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'uniquify)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-10-19T12:56:40.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2347" PostTypeId="1" CreationDate="2014-10-19T14:00:31.450" Score="34" ViewCount="11482" Body="&lt;p&gt;I do &lt;code&gt;C-a&lt;/code&gt; &lt;code&gt;C-k&lt;/code&gt; &lt;code&gt;C-k&lt;/code&gt; to kill the entire line point is on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to &lt;em&gt;copy&lt;/em&gt; the line instead of killing it, I can hit &lt;code&gt;C-/&lt;/code&gt; &lt;code&gt;C-/&lt;/code&gt;&#xA;right after typing the sequence above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, I can do &lt;code&gt;C-a&lt;/code&gt; &lt;code&gt;C-SPC&lt;/code&gt; &lt;code&gt;C-n&lt;/code&gt; &lt;code&gt;M-w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a faster way to kill or copy the entire line point is on?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="253" LastEditDate="2016-09-12T17:19:21.707" LastActivityDate="2020-12-18T20:16:58.410" Title="Kill or copy current line with minimal keystrokes" Tags="|copy-paste|editing|" AnswerCount="10" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2348" PostTypeId="2" ParentId="2347" CreationDate="2014-10-19T14:00:31.450" Score="44" Body="&lt;p&gt;You can use &lt;code&gt;kill-whole-line&lt;/code&gt; to kill the entire line point is on. Position of point does not matter. This command is bound to &lt;kbd&gt;C-S-DEL&lt;/kbd&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also instruct &lt;code&gt;kill-line&lt;/code&gt; (bound to &lt;kbd&gt;C-k&lt;/kbd&gt;) to kill the entire line by setting the &lt;em&gt;variable&lt;/em&gt; &lt;code&gt;kill-whole-line&lt;/code&gt; to a non-&lt;code&gt;nil&lt;/code&gt; value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq kill-whole-line t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that point has to be at the beginning of the line for this to work.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Then there are &lt;strong&gt;these two gems&lt;/strong&gt; (via &lt;a href=&quot;http://emacs-fu.blogspot.de/2009/11/copying-lines-without-selecting-them.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-fu&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice kill-region (before slick-cut activate compile)&#xA;  &quot;When called interactively with no active region, kill a single line instead.&quot;&#xA;  (interactive&#xA;   (if mark-active&#xA;       (list (region-beginning) (region-end))&#xA;     (list (line-beginning-position) (line-beginning-position 2)))))&#xA;&#xA;(defadvice kill-ring-save (before slick-copy activate compile)&#xA;  &quot;When called interactively with no active region, copy a single line instead.&quot;&#xA;  (interactive&#xA;   (if mark-active&#xA;       (list (region-beginning) (region-end))&#xA;     (message &quot;Copied line&quot;)&#xA;     (list (line-beginning-position) (line-beginning-position 2)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With these in place you can kill or copy the line point is on with &lt;strong&gt;a single keystroke&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-w&lt;/kbd&gt; kills the current line&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-w&lt;/kbd&gt; copies the current line&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that if there is an active region, &lt;code&gt;kill-region&lt;/code&gt; and &lt;code&gt;kill-ring-save&lt;/code&gt; will continue to do what they normally do: Kill or copy it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Porting &lt;code&gt;slick-cut&lt;/code&gt; and &lt;code&gt;slick-copy&lt;/code&gt; to new advice system&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.4 introduces a &lt;a href=&quot;https://emacs.stackexchange.com/q/3079/504&quot;&gt;new advice system&lt;/a&gt;. While &lt;code&gt;defadvice&lt;/code&gt; &lt;a href=&quot;https://emacs.stackexchange.com/a/3087/504&quot;&gt;still works&lt;/a&gt;, there is a chance that it might be deprecated in favor of the new system in future versions of Emacs. To prepare for that, you might want to use updated versions of &lt;code&gt;slick-cut&lt;/code&gt; and &lt;code&gt;slick-copy&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun slick-cut (beg end)&#xA;  (interactive&#xA;   (if mark-active&#xA;       (list (region-beginning) (region-end))&#xA;     (list (line-beginning-position) (line-beginning-position 2)))))&#xA;&#xA;(advice-add 'kill-region :before #'slick-cut)&#xA;&#xA;(defun slick-copy (beg end)&#xA;  (interactive&#xA;   (if mark-active&#xA;       (list (region-beginning) (region-end))&#xA;     (message &quot;Copied line&quot;)&#xA;     (list (line-beginning-position) (line-beginning-position 2)))))&#xA;&#xA;(advice-add 'kill-ring-save :before #'slick-copy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorDisplayName="user12563" LastEditDate="2019-02-24T11:26:53.087" LastActivityDate="2019-02-24T11:26:53.087" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="2349" PostTypeId="2" ParentId="2347" CreationDate="2014-10-19T15:20:30.393" Score="5" Body="&lt;p&gt;Besides @itsjeyd answer, may I suggest those two functions?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xah-copy-line-or-region ()&#xA;  &quot;Copy current line, or text selection.&#xA;When `universal-argument' is called first, copy whole buffer (but respect `narrow-to-region').&quot;&#xA;  (interactive)&#xA;  (let (p1 p2)&#xA;    (if (null current-prefix-arg)&#xA;        (progn (if (use-region-p)&#xA;                   (progn (setq p1 (region-beginning))&#xA;                          (setq p2 (region-end)))&#xA;                 (progn (setq p1 (line-beginning-position))&#xA;                        (setq p2 (line-end-position)))))&#xA;      (progn (setq p1 (point-min))&#xA;             (setq p2 (point-max))))&#xA;    (kill-ring-save p1 p2)))&#xA;&#xA;(defun xah-cut-line-or-region ()&#xA;  &quot;Cut current line, or text selection.&#xA;When `universal-argument' is called first, cut whole buffer (but respect `narrow-to-region').&quot;&#xA;  (interactive)&#xA;  (let (p1 p2)&#xA;    (if (null current-prefix-arg)&#xA;        (progn (if (use-region-p)&#xA;                   (progn (setq p1 (region-beginning))&#xA;                          (setq p2 (region-end)))&#xA;                 (progn (setq p1 (line-beginning-position))&#xA;                        (setq p2 (line-beginning-position 2)))))&#xA;      (progn (setq p1 (point-min))&#xA;             (setq p2 (point-max))))&#xA;    (kill-region p1 p2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, key definitions (you'll probably want to adapt them):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f2&amp;gt;&quot;) 'xah-cut-line-or-region) ; cut&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f3&amp;gt;&quot;) 'xah-copy-line-or-region) ; copy&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f4&amp;gt;&quot;) 'yank) ; paste&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_copy_cut_current_line.html&quot;&gt;ErgoEmacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-10-19T15:20:30.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2350" PostTypeId="1" AcceptedAnswerId="2351" CreationDate="2014-10-19T15:58:29.170" Score="17" ViewCount="17950" Body="&lt;p&gt;This is such a basic question but I am really at a loss (a google search only revealed solutions for OS X).&lt;/p&gt;&#xA;&lt;p&gt;Until recently, I primarily used terminal mode (which I can make full-screen using my desktop environment's full-screen shortcut for the shell window) but switched to GUI because I'd like to be able to pick a font.&lt;/p&gt;&#xA;&lt;p&gt;Any suggestions?  Maximizing using the buttons in the window title bar doesn't go to true full screen - I can still see the task bar and the window title bar.&lt;/p&gt;&#xA;&lt;p&gt;Edit: I should add that the &lt;code&gt;Full-screen&lt;/code&gt; option (i.e., after right-clicking the window title bar) is greyed out (see exhibit 1 below).  Also, changing the &lt;code&gt;Full Screen&lt;/code&gt; setting under &lt;code&gt;Special Applications Settings&lt;/code&gt; automatically reverts to being disabled.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;No border&lt;/code&gt; option does offer a partial solution in that it makes the window title bar disappear (though task bar is still visible) - it would be nice if there was a way to easily toggle full-screen using a keyboard shortcut and given KDE's and emacs' customizability, I think it's probaby due to my being a KDE and emacs n00b.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Exhibit 1:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VwPaL.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In order to safeguard against any settings I may have inadvertently customized, I ended up resetting my kde desktop (by deleting the relevant plasma file).  Upon reboot, I was able to use the &lt;code&gt;Special Window Settings&lt;/code&gt; dialog box to &lt;code&gt;Force&lt;/code&gt; the application into full-screen mode (the dialog box is accessed by invoking the menu via &lt;code&gt;Alt+F3&lt;/code&gt; -&amp;gt; &lt;code&gt;More actions&lt;/code&gt; -&amp;gt; &lt;code&gt;Special window settings&lt;/code&gt;).  (Screenshot below.)&lt;/p&gt;&#xA;&lt;p&gt;In a general sense, &lt;strong&gt;I still prefer paprika's answer which involves creating a global keyboard shortcut&lt;/strong&gt; as it's the better solution.   Just wanted to include my roundabout fix in case other folks also find that their emacs is refusing to accept the &lt;code&gt;full screen&lt;/code&gt; global keyboard shortcut.&lt;/p&gt;&#xA;&lt;p&gt;Forcing full-screen mode from the &lt;code&gt;Special Window Settings&lt;/code&gt; dialog box:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/3l57p.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-03-03T23:38:12.383" Title="How to toggle fullscreen in Emacs GUI mode (`Full Screen` option is greyed out in Kubuntu)?" Tags="|frames|integration|linux|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2351" PostTypeId="2" ParentId="2350" CreationDate="2014-10-19T16:12:00.590" Score="28" Body="&lt;p&gt;GNU Emacs has built-in support for fullscreen since version 24.4.  From the changelog:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;New commands &lt;code&gt;toggle-frame-fullscreen&lt;/code&gt; and &lt;code&gt;toggle-frame-maximized&lt;/code&gt;,&#xA;  bound to &lt;code&gt;&amp;lt;f11&amp;gt;&lt;/code&gt; and &lt;code&gt;M-&amp;lt;f10&amp;gt;&lt;/code&gt;, respectively.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that you don't need to use the latest Emacs version just for this feature.  Your window manager (KDE/KWin) is able to put any application window into fullscreen mode, &lt;a href=&quot;https://askubuntu.com/a/522891&quot;&gt;as explained here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2015-03-03T23:38:12.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2352" PostTypeId="2" ParentId="2318" CreationDate="2014-10-19T17:28:01.813" Score="3" Body="&lt;p&gt;In the buffer list displayed by &lt;code&gt;list-buffers&lt;/code&gt; you can see the current node and Info file in the last column (named &lt;code&gt;File&lt;/code&gt;). But if you want to add the current node name to the buffer name, then when visiting a new node just type the prefix arg &lt;code&gt;C-u&lt;/code&gt; before a navigation command (e.g. &lt;code&gt;C-u f&lt;/code&gt; where &lt;code&gt;f&lt;/code&gt; is bound to &lt;code&gt;Info-follow-reference&lt;/code&gt;, or &lt;code&gt;C-u RET&lt;/code&gt; where &lt;code&gt;RET&lt;/code&gt; is bound to &lt;code&gt;Info-follow-nearest-node&lt;/code&gt;, etc.) and it will display a forked node with the name &lt;code&gt;*info-&amp;lt;node-name&amp;gt;*&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="478" LastActivityDate="2014-10-19T17:28:01.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2353" PostTypeId="2" ParentId="2347" CreationDate="2014-10-19T22:40:53.210" Score="15" Body="&lt;p&gt;&lt;a href=&quot;http://endlessparentheses.com/kill-entire-line-with-prefix-argument.html&quot;&gt;The solution I've found for myself&lt;/a&gt; is to use prefix arguments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, killing half a line is a useful feature, but I want an easier&#xA;way of killing entire lines too. So I made it so that&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/kill-line&quot;&gt;&lt;code&gt;kill-line&lt;/code&gt;&lt;/a&gt; just&#xA;murders everything in sight when given a prefix argument.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro bol-with-prefix (function)&#xA;  &quot;Define a new function which calls FUNCTION.&#xA;Except it moves to beginning of line before calling FUNCTION when&#xA;called with a prefix argument. The FUNCTION still receives the&#xA;prefix argument.&quot;&#xA;  (let ((name (intern (format &quot;endless/%s-BOL&quot; function))))&#xA;    `(progn&#xA;       (defun ,name (p)&#xA;         ,(format &#xA;           &quot;Call `%s', but move to BOL when called with a prefix argument.&quot;&#xA;           function)&#xA;         (interactive &quot;P&quot;)&#xA;         (when p&#xA;           (forward-line 0))&#xA;         (call-interactively ',function))&#xA;       ',name)))&#xA;&#xA;(global-set-key [remap paredit-kill] (bol-with-prefix paredit-kill))&#xA;(global-set-key [remap org-kill-line] (bol-with-prefix org-kill-line))&#xA;(global-set-key [remap kill-line] (bol-with-prefix kill-line))&#xA;(global-set-key &quot;\C-k&quot; (bol-with-prefix kill-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this little macro, &lt;code&gt;C-k&lt;/code&gt; still kills from point, but&#xA;&lt;code&gt;C-3 C-k&lt;/code&gt; swallows three whole lines. As a bonus, we get the&#xA;&lt;code&gt;kill-whole-line&lt;/code&gt; behavior by doing &lt;code&gt;C-1 C-k&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-20T14:01:09.593" LastActivityDate="2014-10-20T14:01:09.593" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2354" PostTypeId="1" AcceptedAnswerId="2362" CreationDate="2014-10-19T23:03:11.010" Score="14" ViewCount="600" Body="&lt;p&gt;I'm writing a function which, in principle, takes an arbitrary number&#xA;of arguments. In practice, however, it should only ever be passed an&#xA;&lt;strong&gt;even&lt;/strong&gt; number of arguments, and will produce undesirable results&#xA;otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a dummy example for context:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-caller (&amp;amp;rest args)&#xA;  (while args&#xA;    (call-other-function (pop args) (pop args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When an elisp file is byte-compiled, the byte-compiler throws a&#xA;warning when it sees a function being invoked with the wrong number of&#xA;arguments. Obviously, that's never going to happen with &lt;code&gt;my-caller&lt;/code&gt;,&#xA;since it's defined to take any number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, maybe there's a symbol property I can set, or a &lt;code&gt;(declare)&lt;/code&gt; form I can&#xA;add to its definition. Something to notify the user that this function should only be given an even number of arguments.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Is there a way to inform the byte-compiler of this restriction?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;If not, &lt;strong&gt;Is it possible with a macro, instead of a function?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-20T11:35:18.730" LastActivityDate="2015-10-01T23:14:22.083" Title="Can a function or macro specify byte-compiler warnings?" Tags="|elisp|byte-compilation|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2355" PostTypeId="1" AcceptedAnswerId="2356" CreationDate="2014-10-20T00:52:57.290" Score="12" ViewCount="5285" Body="&lt;p&gt;I am using emacs &lt;a href=&quot;http://web-mode.org/&quot;&gt;web-mode&lt;/a&gt;, and the tabbing in JS files seems to be acting strangely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tab set to indent 2 spaces, but when the indent reaches 8 spaces, web-mode turns them into a tab, and then continues to tab 2 spaces until in reaches another 8, and converts that into another tab, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I stop this from happening and tell emacs/web-mode to only ever indent spaces?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a short nested function example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(function() {&#xA;  function() {&#xA;    function() {&#xA;      function() {&#xA;    function() {&#xA;      // Indenting problem.&#xA;    }&#xA;      }&#xA;    }&#xA;  }&#xA;})()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's obviously showing up fine in Emacs, but you can see the indentation problem here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will note here that this also occurs in javascript-mode.&lt;/p&gt;&#xA;" OwnerUserId="292" LastEditorUserId="104" LastEditDate="2014-10-20T06:55:10.590" LastActivityDate="2015-08-30T15:14:40.453" Title="Make web-mode always indent with spaces" Tags="|indentation|web-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2356" PostTypeId="2" ParentId="2355" CreationDate="2014-10-20T01:47:43.187" Score="13" Body="&lt;p&gt;In general, if you want indentation to use spaces only, I would recommend customizing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This forces indentation to use spaces and no tabs. I'm not sure if &lt;code&gt;web-mode&lt;/code&gt; uses the regular methods for indentation though, so it may not respect this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you give an example file to demonstrate?&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="25" LastEditDate="2014-10-21T16:40:09.803" LastActivityDate="2014-10-21T16:40:09.803" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2357" PostTypeId="2" ParentId="2354" CreationDate="2014-10-20T02:00:37.967" Score="10" Body="&lt;p&gt;Yes you can using &lt;code&gt;byte-defop-compiler&lt;/code&gt; to actually specify a function that compiles your function, &lt;code&gt;byte-defop-compiler&lt;/code&gt; has some built in niceties to help you specify that your functions should yield warnings based on having a number of args.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Documentation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add a compiler-form for FUNCTION.If function is a symbol, then the variable &quot;byte-SYMBOL&quot; must name the opcode to be used.  If function is a list, the first element is the function and the second element is the bytecode-symbol. The second element may be nil, meaning there is no opcode. COMPILE-HANDLER is the function to use to compile this byte-op, or may be the abbreviations 0, 1, 2, 3, 0-1, or 1-2. If it is nil, then the handler is &quot;byte-compile-SYMBOL.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Usage&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In your specific case you could use one of the abbreviations to define that your function should be given two args.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(byte-defop-compiler my-caller 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you're function will give warnings when compiled with anything but 2 args.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to give more specific warnings and write your own compiler functions. Look at &lt;code&gt;byte-compile-one-arg&lt;/code&gt; and other similar functions in bytecomp.el for reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you are not just specifying some function to handle validation, but actually the compiling too. Again compile functions in bytecomp.el will provide you with a good reference.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Safer Routes&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is not something I've seen documented or discussed online but overall I would say this is ill-advised a route to take. The correct route (IMO) would be to write your defuns with descriptive signatures or use a macro that will provide warnings at expansion time, checking the length of your args and using &lt;code&gt;byte-compile-warn&lt;/code&gt; or &lt;code&gt;error&lt;/code&gt; to show errors. It may also benefit your to make use of &lt;code&gt;eval-when-compile&lt;/code&gt; to do error checking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll also need for your function to be defined before it is ever used, and the call to &lt;code&gt;byte-defop-compiler&lt;/code&gt; will need to be before the compiler gets to actual calls of your function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, seems to not really be documented or advised from what I've seen (could be wrong) but I imagine the pattern to follow here would be to specify some sort of header file for your package that is full of a bunch of empty defuns and calls to &lt;code&gt;byte-defop-compiler&lt;/code&gt;. This would basically be a package that's required before your real package can be compiled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Opinion: &#xA;Based on what I know, which is not much, because I just learned about all of this, I would advise you to never do any of this. ever&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-10-20T13:32:25.427" LastActivityDate="2014-10-20T13:32:25.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2358" PostTypeId="5" CreationDate="2014-10-20T02:26:42.177" Score="0" Body="&lt;p&gt;Google Docs is a freeware web-based office suite offered by Google within its Google Drive service. It was formerly a storage service as well, but has since been replaced by Drive. It allows users to create and edit documents online while collaborating with other users live. Google Docs combines the features of Writely and Spreadsheets with a presentation program incorporating technology designed by Tonic Systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data storage of files up to 1 GB total in size was introduced on January 13, 2010, but has since been increased to 15 GB. Documents using Google Docs native formats do not count towards this limit. On April 24, 2012, Google launched Google Drive which supplants Google Docs. Google Drive incorporates the Google Docs office suite into itself alongside providing improved storage functionality&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-20T08:50:36.710" LastActivityDate="2014-10-20T08:50:36.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2359" PostTypeId="4" CreationDate="2014-10-20T02:26:42.177" Score="0" Body="Google Docs is a free, Web-based word processor, spreadsheet, slide show, form, and data storage service offered by Google." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-20T08:50:40.213" LastActivityDate="2014-10-20T08:50:40.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2360" PostTypeId="5" CreationDate="2014-10-20T02:30:41.877" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-20T02:30:41.877" LastActivityDate="2014-10-20T02:30:41.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2361" PostTypeId="4" CreationDate="2014-10-20T02:30:41.877" Score="0" Body="Indenting is used to organize code by indicating blocks, closures, conditionals, and other constructs. It makes code easier to read, and in some languages is used to handle control flow." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-21T07:54:47.637" LastActivityDate="2014-10-21T07:54:47.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2362" PostTypeId="2" ParentId="2354" CreationDate="2014-10-20T06:50:21.080" Score="13" Body="&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: A better way to do this in recent Emacs is by defining a &lt;em&gt;compiler macro&lt;/em&gt; to check the number of arguments.  My original answer using a normal macro is preserved below, but a compiler-macro is superior because it does not prevent passing the function to &lt;code&gt;funcall&lt;/code&gt; or &lt;code&gt;apply&lt;/code&gt; at runtime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In recent versions of Emacs, you can do this by defining a compiler-macro for your function which checks the number of arguments and produces a warning (or even an error) if it doesn't match.  The only subtlety is that the compiler macro should return the original function call form unchanged for evaluation or compilation.  This is done by using a &lt;code&gt;&amp;amp;whole&lt;/code&gt; argument and returning its value.  This could be accomplished like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun my-caller (&amp;amp;rest args)&#xA;  (while args&#xA;    (message &quot;%S %S&quot; (pop args) (pop args))))&#xA;&#xA;(define-compiler-macro my-caller (&amp;amp;whole form &amp;amp;rest args)&#xA;  (when (not (cl-evenp (length args)))&#xA;    (byte-compile-warn &quot;`my-caller' requires an even number of arguments&quot;))&#xA;  form)&#xA;&#xA;(my-caller 1 2 3 4)&#xA;(my-caller 1 2)&#xA;(funcall #'my-caller 1 2 3 4)       ; ok&#xA;(apply #'my-caller '(1 2))          ; also ok&#xA;(my-caller 1)                       ; produces a warning&#xA;(funcall #'my-caller 1 2 3)         ; no warning!&#xA;(apply #'my-caller '(1 2 3))        ; also no warning&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;funcall&lt;/code&gt; and &lt;code&gt;apply&lt;/code&gt; can now be used, but they bypass argument checking by the compiler macro.  Despite their name, compiler macros also seem to be expanded in the course of 'interpreted' evaluation via &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-e&lt;/kbd&gt;, &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;kbd&gt;eval-buffer&lt;/kbd&gt;, so you will get errors on evaluating as well as on compiling this example.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Original answer follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how you could implement Jordon's suggestion to &quot;use a macro that will provide warnings at expansion time&quot;.  It turns out to be very easy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defmacro my-caller (&amp;amp;rest args)&#xA;  (if (cl-evenp (length args))&#xA;      `(my-caller--function ,@args)&#xA;    (error &quot;Function `my-caller' requires an even number of arguments&quot;)))&#xA;&#xA;(defun my-caller--function (&amp;amp;rest args)&#xA;  ;; function body goes here&#xA;  args)&#xA;&#xA;(my-caller 1 2 3 4)&#xA;(my-caller 1 2 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Trying to compile the above in a file will fail (no &lt;code&gt;.elc&lt;/code&gt; file is produced), with a nice clickable error message in the compile log, stating:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test.el:14:1:Error: `my-caller' requires an even number of arguments&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also replace &lt;code&gt;(error …)&lt;/code&gt; with &lt;code&gt;(byte-compile-warn …)&lt;/code&gt; to produce a warning instead of an error, allowing compilation to continue. (Thanks to Jordon for pointing this out in comments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since macros are expanded at compilation time, there is no run-time penalty associated with this check.  Of course, you cannot stop other people calling &lt;code&gt;my-caller--function&lt;/code&gt; directly, but you can at least advertise it as a &quot;private&quot; function using the double-hyphen convention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A notable &lt;em&gt;disadvantage&lt;/em&gt; of using a macro for this purpose is that &lt;code&gt;my-caller&lt;/code&gt; is no longer a first-class function: you can't pass it to &lt;code&gt;funcall&lt;/code&gt; or &lt;code&gt;apply&lt;/code&gt; at runtime (or at least it won't do what you expect).  In that respect, this solution isn't quite as good as being able to simply declare a compiler warning for a real function.  Of course, using &lt;code&gt;apply&lt;/code&gt; would make it impossible to check the number of arguments being passed to the function at compile-time anyway, so perhaps this is an acceptable trade-off.&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorDisplayName="user1968" LastEditDate="2015-10-01T23:14:22.083" LastActivityDate="2015-10-01T23:14:22.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2363" PostTypeId="2" ParentId="27" CreationDate="2014-10-20T07:58:41.053" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2231902/originate-edit-of-remote-file-using-emacs-tramp-from-ssh-session&quot;&gt;https://stackoverflow.com/questions/2231902/originate-edit-of-remote-file-using-emacs-tramp-from-ssh-session&lt;/a&gt; has a fairly simple accepted answer which amounts to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq server-use-tcp t)&#xA;(setq server-host &quot;name_of_local_machine&quot;)&#xA;(server-start)&#xA;;; Maybe also muck with `server-auth-dir`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -f ~/.emacs.d/server/server /`hostname`:/path/to/local/file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is also &lt;a href=&quot;https://stackoverflow.com/questions/12546722/using-emacs-server-and-emacsclient-on-other-machines-as-other-users&quot;&gt;https://stackoverflow.com/questions/12546722/using-emacs-server-and-emacsclient-on-other-machines-as-other-users&lt;/a&gt; which is more complex but where the answers also (roughly) touch similar bases.&lt;/p&gt;&#xA;" OwnerUserId="2057" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-20T08:09:30.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2364" PostTypeId="1" AcceptedAnswerId="2365" CreationDate="2014-10-20T08:23:16.347" Score="25" ViewCount="894" Body="&lt;p&gt;I was browing through &lt;code&gt;compile.el&lt;/code&gt; and I noticed this &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/e91da7f8f2523057fa93ea4aace36863315abb5b/lisp/progmodes/compile.el#L697&quot; rel=&quot;noreferrer&quot;&gt;construction&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom compile-command (purecopy &quot;make -k &quot;)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;purecopy&lt;/code&gt; docs state:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;purecopy is a built-in function in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(purecopy OBJ)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Make a copy of object OBJ in pure storage. Recursively copies contents&#xA;  of vectors and cons cells. Does not copy symbols.  Copies strings&#xA;  without text properties.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So I think I understand why it might be necessary if it was expected that &lt;code&gt;compile-command&lt;/code&gt; contained a complex alist that might require modification at a later date. However its just a simple string, so why is &lt;code&gt;purecopy&lt;/code&gt; necessary? More generally, when is &lt;code&gt;purecopy&lt;/code&gt; needed?&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="12534" LastEditDate="2017-09-09T17:43:45.880" LastActivityDate="2017-09-09T17:43:45.880" Title="What is the function `purecopy` needed for?" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2365" PostTypeId="2" ParentId="2364" CreationDate="2014-10-20T10:31:19.230" Score="32" Body="&lt;p&gt;&lt;code&gt;purecopy&lt;/code&gt; &lt;strong&gt;never&lt;/strong&gt; needed in user configuration or 3rd party libraries.  In fact, it is a &lt;strong&gt;no-op&lt;/strong&gt; when called from a normal Emacs instance.  From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Pure-Storage.html#Pure-Storage&quot;&gt;Pure Storage&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function is a &lt;strong&gt;no-op except while Emacs is being built and dumped&lt;/strong&gt;; it is usually called only in preloaded Lisp files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Some background information follows.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Pure Storage&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Emacs has a two-stage build process.  It first builds a plain binary, and then runs this binary, loads a selected set of built-in libraries, and then dumps a memory image of the process, and creates the real &lt;code&gt;emacs&lt;/code&gt; binary from this dump.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reasons for this convoluted process are better performance and less memory usage:  Pre-loading essential Emacs Lisp libraries allows for faster startup, since no further IO is required to load built-in libraries, and decreases memory usage, since the pre-loaded libraries can be shared among all Emacs instances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This particular memory area which contains the pre-loaded libraries is the “pure storage”.  It's readonly, hence “pure”, to allow for the aforementioned memory sharing.  Hence, &lt;code&gt;purecopy&lt;/code&gt; is a no-op in normal Emacs instances:  It couldn't write into pure storage anyway.  Consequently, pure storage is also exempt from garbage collection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, while creating and dumping the memory image for pre-loaded libraries, these libraries can use &lt;code&gt;purecopy&lt;/code&gt; to “mark” specific objects for allocation in pure storage, typically frequently used objects that are needed for the entire lifetime of Emacs anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strings in pure storage are essentially global static constant strings.  Since &lt;code&gt;&quot;make -k&quot;&lt;/code&gt; is going to be used frequently in running Emacs sessions (it's likely the most frequently used compilation command, even today), it makes sense to keep this string constant and static, to avoid unnecessary re-allocation and garbage collection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This concept of pure storage is also the reason why modifying the &lt;code&gt;.el&lt;/code&gt; files of some built-in libraries (notably &lt;code&gt;startup.el&lt;/code&gt;, &lt;code&gt;subr.el&lt;/code&gt;, and others) has no effect:  Emacs never actually loads the source files of these libraries.   Instead, it has their byte code built into its binary, and loads them from a special memory area.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-20T10:31:19.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2366" PostTypeId="2" ParentId="476" CreationDate="2014-10-20T12:29:39.617" Score="26" Body="&lt;p&gt;My preferred tool for live-editing HTML documents is &lt;a href=&quot;https://github.com/skeeto/skewer-mode&quot;&gt;skewer-mode&lt;/a&gt;. It updates the document in the browser without a refresh, so you get &lt;em&gt;instant&lt;/em&gt; feedback on your changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's &lt;a href=&quot;http://youtu.be/4tyTgyzUJqM&quot;&gt;a demo video&lt;/a&gt; that shows it in action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has modes for live-editing HTML, CSS, and JavaScript. It's most useful for JavaScript, as it enables a workflow a lot like hacking on Emacs Lisp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several extensions available for skewer-mode, like &lt;a href=&quot;https://github.com/purcell/skewer-less&quot;&gt;skewer-less&lt;/a&gt;, for editing LESS stylesheets, and &lt;a href=&quot;https://github.com/NateEag/skewer-reload-stylesheets&quot;&gt;skewer-reload-stylesheets&lt;/a&gt;, for live-editing CSS in multiple stylesheets (disclosure: I wrote that one).&lt;/p&gt;&#xA;" OwnerUserId="351" LastActivityDate="2014-10-20T12:29:39.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2367" PostTypeId="1" AcceptedAnswerId="2391" CreationDate="2014-10-20T13:38:21.153" Score="5" ViewCount="1050" Body="&lt;p&gt;Color codes are not working on my Windows 7 box. I have working colors in Git Bash that comes with the Git install.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2TfYQ.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-01-10T21:55:05.657" Title="How to get colors in Magit diffs on Windows?" Tags="|magit|microsoft-windows|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2368" PostTypeId="2" ParentId="2347" CreationDate="2014-10-20T13:50:49.407" Score="10" Body="&lt;p&gt;This is not an answer for orthodox emacs.  If, however, you're willing to blaspheme with &lt;code&gt;evil&lt;/code&gt;'s modal editing, you can:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;dd&lt;/code&gt; for kill line&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;yy&lt;/code&gt; for copy/yank line&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Both can be prefixed by the number of lines to kill/copy (eg, &lt;code&gt;4yy&lt;/code&gt; will copy the next 4 lines).&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2020-12-18T20:16:58.410" LastActivityDate="2020-12-18T20:16:58.410" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2369" PostTypeId="2" ParentId="633" CreationDate="2014-10-20T15:08:22.680" Score="5" Body="&lt;p&gt;You could use &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-27&quot; rel=&quot;noreferrer&quot;&gt;helm-eshell-history&lt;/a&gt; for interactive history selection, and replace the original &lt;code&gt;C-c C-l&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm-eshell)&#xA;&#xA;(add-hook 'eshell-mode-hook&#xA;          #'(lambda ()&#xA;              (define-key eshell-mode-map (kbd &quot;M-l&quot;)  'helm-eshell-history)))&#xA;&#xA;;; for shell-mode&#xA;(define-key shell-mode-map (kbd &quot;C-c C-l&quot;) 'helm-comint-input-ring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9zEhO.gif&quot; alt=&quot;helm-eshell-history&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-20T15:08:22.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2370" PostTypeId="5" CreationDate="2014-10-20T15:09:06.077" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Killing.html#Killing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs manual&lt;/a&gt; and help (documentation strings) generally use the terms &lt;code&gt;killing&lt;/code&gt; and &lt;code&gt;yanking&lt;/code&gt; for cutting and pasting. The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Cut-and-Paste.html#Cut-and-Paste&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; speaks of copying, cutting, and pasting when it mentions interoperating with the underlying operating system's &lt;a href=&quot;/questions/tagged/clipboard&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;clipboard&amp;#39;&quot; rel=&quot;tag&quot;&gt;clipboard&lt;/a&gt; using the &lt;a href=&quot;/questions/tagged/primay-selection&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;primay-selection&amp;#39;&quot; rel=&quot;tag&quot;&gt;primay-selection&lt;/a&gt; and the &lt;a href=&quot;/questions/tagged/secondary-selection&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;secondary-selection&amp;#39;&quot; rel=&quot;tag&quot;&gt;secondary-selection&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2017-02-20T18:06:25.047" LastActivityDate="2017-02-20T18:06:25.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2371" PostTypeId="4" CreationDate="2014-10-20T15:09:06.077" Score="0" Body="is about the editor operations cut, copy, and paste as they apply to Emacs. In Emacs, cut is called &quot;kill&quot; and paste is called &quot;yank&quot; (but Emacs enhances the standard cut and paste behavior)." OwnerUserId="45" LastEditorUserId="105" LastEditDate="2017-02-20T18:09:54.367" LastActivityDate="2017-02-20T18:09:54.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2372" PostTypeId="5" CreationDate="2014-10-20T15:18:11.163" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.xemacs.org/&quot; rel=&quot;nofollow&quot;&gt;XEmacs&lt;/a&gt; is a fork of &lt;a href=&quot;http://www.gnu.org/software/emacs/&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs&lt;/a&gt;, created in the late 1980's with an emphasis on incorporating &quot;modern&quot; editor capabilities (colors, images, menus, etc.).  Most of the functionality originally available in XEmacs is now available in GNU Emacs, and development of XEmacs appears relatively stagnant.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-20T16:08:08.823" LastActivityDate="2014-10-20T16:08:08.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2373" PostTypeId="4" CreationDate="2014-10-20T15:18:11.163" Score="0" Body="XEmacs is fork of GNU Emacs, providing much of the same functionality.  XEmacs development is stagnant." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-20T16:08:21.820" LastActivityDate="2014-10-20T16:08:21.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2374" PostTypeId="2" ParentId="866" CreationDate="2014-10-20T15:33:38.927" Score="5" Body="&lt;p&gt;As of &lt;a href=&quot;https://github.com/flycheck/flycheck/commit/40469d58728a00cf0db18e487f1482c2a92245f0&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;40469d5&lt;/code&gt;&lt;/a&gt;, Flycheck includes the warning code of ShellCheck in the messages, and provides a new option &lt;code&gt;flycheck-shellcheck-excluded-warnings&lt;/code&gt; to exclude warnings from ShellCheck reports.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To suppress a ShellCheck warning for Flycheck, use the error list at &lt;code&gt;C-c ! l&lt;/code&gt; to find out the corresponding error code (in square brackets at the end of the message), and add it to &lt;code&gt;flycheck-shellcheck-excluded-warnings&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To globally suppress &lt;code&gt;SC2029&lt;/code&gt;, add the following to your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default flycheck-shellcheck-excluded-warnings '(&quot;SC2029&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To suppress this type just for a specific file, type &lt;code&gt;M-x add-file-local-variable RET flycheck-shellcheck-excluded-warnings RET (&quot;SC2029&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that these suppressions only work for Flycheck.  The message still appears if you run ShellCheck from the terminal, or as part of your CI or testing system.  To suppress a message for all instances of ShellCheck, as in &lt;a href=&quot;https://emacs.stackexchange.com/a/885/227&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-10-20T15:33:38.927" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2375" PostTypeId="1" AcceptedAnswerId="2383" CreationDate="2014-10-20T18:08:21.433" Score="13" ViewCount="4017" Body="&lt;p&gt;One of the things I miss from vim is being able to type in a substitution command that will work over multiple lines, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:/begin/,/end/s/foo/bar/g&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above command substitutes &quot;foo&quot; for &quot;bar&quot; starting with the first line containing &quot;begin&quot; and ending with the next line after that containing &quot;end&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do something similar in emacs?&lt;/p&gt;&#xA;" OwnerUserId="14" LastEditorUserId="253" LastEditDate="2014-12-02T14:08:06.347" LastActivityDate="2024-02-07T17:09:51.023" Title="Is there an equivalent to sed-style substitution commands from vim?" Tags="|regular-expressions|replace|evil|vim-emulation|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2376" PostTypeId="1" AcceptedAnswerId="2515" CreationDate="2014-10-20T18:31:42.553" Score="22" ViewCount="7070" Body="&lt;p&gt;I am currently struggling to use skewer-mode in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I downloaded and installed skewer-mode via MELPA, so all the dependencies should be inplace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For testing purposes I even downloaded the &lt;code&gt;boidsjs&lt;/code&gt; &lt;a href=&quot;https://github.com/skeeto/boids-js&quot;&gt;demo&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll open up &lt;code&gt;boids.js&lt;/code&gt;, then type &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;run-skewer&lt;/code&gt; (opens up the browser with URL &lt;code&gt;http://127.0.0.1:8080/skewer/demo&lt;/code&gt;) and then finally run &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;skewer-mode&lt;/code&gt; (-&gt; skewer-mode enabled).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in the browser &lt;em&gt;nothing&lt;/em&gt; happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2158" LastEditorUserId="193" LastEditDate="2014-10-23T19:30:00.380" LastActivityDate="2018-09-22T07:16:54.480" Title="How to use skewer-mode?" Tags="|package|skewer-mode|javascript|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2377" PostTypeId="5" CreationDate="2014-10-20T18:37:30.783" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-20T18:37:30.783" LastActivityDate="2014-10-20T18:37:30.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2378" PostTypeId="4" CreationDate="2014-10-20T18:37:30.783" Score="0" Body="Hooks are an important mechanism for customizing Emacs. A hook is a Lisp variable which holds a list of functions, to be called on some well-defined occasion." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-21T07:53:17.493" LastActivityDate="2014-10-21T07:53:17.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2379" PostTypeId="5" CreationDate="2014-10-20T18:40:39.157" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://melpa.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt; is a collection of &lt;code&gt;package.el&lt;/code&gt;-compatible &lt;a href=&quot;/questions/tagged/emacs&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;emacs&amp;#39;&quot; rel=&quot;tag&quot;&gt;emacs&lt;/a&gt; Lisp packages that are built automatically on the server from upstream source code locations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main features of MELPA are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Up-to-date packages&lt;/li&gt;&#xA;&lt;li&gt;Installable in any recent Emacs using &quot;package.el&quot;&lt;/li&gt;&#xA;&lt;li&gt;Curated &lt;/li&gt;&#xA;&lt;li&gt;Comprehensive&lt;/li&gt;&#xA;&lt;li&gt;Automatic updates&lt;/li&gt;&#xA;&lt;li&gt;Extensible&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://melpa.org/#/getting-started&quot; rel=&quot;nofollow noreferrer&quot;&gt;Configure Emacs&lt;/a&gt; init file to download from MELPA.  For Emacs versions 24 and prior, add the GNU ELPA archive to the repositories list because it provides &lt;code&gt;cl-lib&lt;/code&gt; and other needed libraries. For Emacs versions 24 and later, these libraries are included by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/emacs.html#Packages&quot; rel=&quot;nofollow noreferrer&quot;&gt;packages section&lt;/a&gt; of the manual for details.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-18T04:44:35.767" LastActivityDate="2017-02-18T04:44:35.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2380" PostTypeId="4" CreationDate="2014-10-20T18:40:39.157" Score="0" Body="for questions about repositories of Emacs packages on well-known servers, such as MELPA, GNU ELPA, and Marmalade. Emacs uses library package.el to download and install updates to packages you choose. " OwnerUserId="45" LastEditorUserId="1979" LastEditDate="2019-10-15T16:07:24.447" LastActivityDate="2019-10-15T16:07:24.447" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2381" PostTypeId="2" ParentId="2376" CreationDate="2014-10-20T18:56:45.157" Score="12" Body="&lt;p&gt;Instead of running the demo, just perform these minimal steps to ensure that everything is working correctly.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open a new buffer with the name myskewer.js&lt;/li&gt;&#xA;&lt;li&gt;Enable JS2-mode (a dependency of skewer)&lt;/li&gt;&#xA;&lt;li&gt;Enable skewer-mode&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;run-skewer&lt;/code&gt; (a browser opens, go back to myskewer.js)&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;alert(&quot;hello&quot;);&lt;/code&gt; and hit &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-e&lt;/kbd&gt; at the end of that line&lt;/li&gt;&#xA;&lt;li&gt;Go back to the browser.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You should see an alert box on the page.&lt;/p&gt;&#xA;" OwnerUserId="294" LastEditorUserId="294" LastEditDate="2014-10-20T19:10:51.383" LastActivityDate="2014-10-20T19:10:51.383" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2382" PostTypeId="2" ParentId="2375" CreationDate="2014-10-20T19:02:00.010" Score="10" Body="&lt;p&gt;Here is one way of doing it that uses built-in functionality only:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With point in the line that contains first occurrence of &lt;code&gt;begin&lt;/code&gt;, press &lt;kbd&gt;C-SPC&lt;/kbd&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Move to next occurrence of &lt;code&gt;end&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; &lt;code&gt;end&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Replace &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-%&lt;/kbd&gt; &lt;code&gt;foo&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;bar&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;!&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This makes use of the fact that &lt;a href=&quot;http://doc.endlessparentheses.com/Fun%2Fquery-replace.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;query-replace&lt;/code&gt;&lt;/a&gt; will work on the active region instead of the whole buffer if there is one.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Of course, you can also define a custom command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun replace-from-to (beg end str repl)&#xA;  (interactive &quot;sBegin: \nsEnd: \nsString: \nsReplacement: &quot;)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (let ((start-pos (search-forward beg))&#xA;          (end-pos (search-forward end)))&#xA;      (replace-string str repl nil start-pos end-pos))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This command will always search from the beginning of the buffer, so point can be after &lt;code&gt;begin&lt;/code&gt;/&lt;code&gt;foo&lt;/code&gt;/&lt;code&gt;end&lt;/code&gt; when you invoke it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set up a key binding for it via:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c r&quot;) 'replace-from-to)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-27T08:30:28.823" LastActivityDate="2015-01-27T08:30:28.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2383" PostTypeId="2" ParentId="2375" CreationDate="2014-10-20T19:16:21.800" Score="7" Body="&lt;p&gt;&lt;code&gt;evil&lt;/code&gt; provides a stripped-down version of &lt;code&gt;ex&lt;/code&gt;, so it's probably best to presume that it's not an exact drop-in.  However, the example you provided works out of the box, provided that point is &lt;em&gt;prior&lt;/em&gt; to the first line (ie, the &lt;code&gt;begin&lt;/code&gt; line in your example).&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-20T19:16:21.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2384" PostTypeId="1" AcceptedAnswerId="2478" CreationDate="2014-10-20T20:09:49.863" Score="11" ViewCount="1058" Body="&lt;p&gt;I'm wondering whether it's possible to display the result of calculations performed on table data, outside of a table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I have a table of with a list of names. Is it possible to have plain text that says something like &quot;&lt;code&gt;This below list contains [ ] names.&lt;/code&gt;&quot; and have &lt;code&gt;[ ]&lt;/code&gt; contain the result of counting the table?&lt;/p&gt;&#xA;" OwnerUserId="655" LastEditorUserId="50" LastEditDate="2014-10-20T22:25:16.110" LastActivityDate="2014-10-23T06:03:38.450" Title="Org Mode: Using table formula outside of a table?" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2385" PostTypeId="1" CreationDate="2014-10-20T20:27:23.303" Score="1" ViewCount="258" Body="&lt;p&gt;I'm trying to create a &quot;calendar only&quot; view of my org-mode agenda -- only headlines that have a &quot;cal&quot; category. The &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; below (the first block) works brilliantly for viewing within emacs, but the filter doesn't work when I &lt;code&gt;C-a a e&lt;/code&gt; to export. That is, &lt;code&gt;calendar.txt&lt;/code&gt; ends up with headlines from all categories, instead of only &quot;cal&quot; categories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug, or am I misunderstanding something?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; custom agenda views&#xA;(setq org-agenda-custom-commands&#xA;&#xA;      ;; bug?: exporting to calendar ignores my category filter, but&#xA;      ;; it works when I view in emacs&#xA;      '((&quot;c&quot; &quot;Calendar only&quot; agenda &quot;&quot;&#xA;         ((org-agenda-category-filter-preset '(&quot;+cal&quot;))&#xA;          (org-agenda-span 'week)&#xA;          (org-agenda-use-time-grid nil))&#xA;         (&quot;~/Dropbox/wiki/calendar.txt&quot;))&#xA;&#xA;        ;; the default block view that comes with org mode&#xA;        (&quot;n&quot; &quot;Agenda and all TODO's&quot;&#xA;         ((agenda &quot;&quot; nil)&#xA;          (alltodo &quot;&quot; nil))&#xA;         nil&#xA;         (&quot;~/Dropbox/wiki/agenda.txt&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2014-10-27T18:07:58.287" LastActivityDate="2014-10-27T18:07:58.287" Title="org-mode ignoring category filter on export" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2386" PostTypeId="2" ParentId="2327" CreationDate="2014-10-20T20:35:46.303" Score="4" Body="&lt;p&gt;The immediate difference is that &lt;code&gt;setq-mode-local&lt;/code&gt; will also affect already existing buffers, whereas adding a &lt;code&gt;setq-local&lt;/code&gt; to the mode hook will only affect future buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there are other differences due to the underlying mechanisms used, but I think to a first approximation, this is the only real difference.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-20T20:35:46.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2387" PostTypeId="1" CreationDate="2014-10-20T20:41:35.383" Score="10" ViewCount="3538" Body="&lt;p&gt;Org-mode can export as HTML and open on a browser with &lt;kbd&gt;C-c C-e h o&lt;/kbd&gt; (&lt;code&gt;org-export-dispatch&lt;/code&gt;), but the problem is that the generated html file opens in a buffer inside emacs. There is no error in the message buffer, either. How can I make it work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I click a link inside org-mode, the browser opens correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running org-mode 8.2.10, emacs 24.3.1 on manjaro linux 0.8.10. I checked preferred applications in KDE and it points web browsing to firefox.&lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2021-08-23T17:31:07.037" Title="Browser not opening when exporting HTML from org-mode" Tags="|org-mode|org-export|" AnswerCount="5" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2388" PostTypeId="1" AcceptedAnswerId="2485" CreationDate="2014-10-20T21:44:38.817" Score="2" ViewCount="271" Body="&lt;p&gt;The functions &lt;code&gt;org-lookup-first&lt;/code&gt;, &lt;code&gt;org-lookup-last&lt;/code&gt;, and &lt;code&gt;org-lookup-all&lt;/code&gt; do not seem to be available to me. These functions are documented at the following link: &lt;a href=&quot;http://orgmode.org/manual/Lookup-functions.html#Lookup-functions&quot; rel=&quot;nofollow&quot;&gt;Lookup Functions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't look them up in the help system, and they don't work when I try to use the functions replicating tutorials. It seems like something is preventing these functions from being available. I don't think that there is anything in my config that would be doing this though. Does anyone have any ideas why this might be happening?&lt;/p&gt;&#xA;" OwnerUserId="655" LastEditorUserId="504" LastEditDate="2014-10-21T10:21:51.173" LastActivityDate="2014-10-23T11:37:50.407" Title="Org Mode: org-lookup-* functions missing" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2389" PostTypeId="2" ParentId="2387" CreationDate="2014-10-20T22:07:03.380" Score="-1" Body="&lt;p&gt;I suspect that you have a mixed installation of org-mode. See the FAQ here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-faq.html#mixed-install&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-faq.html#mixed-install&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When this has happened to me what I have done is (assuming you install via ELPA):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;uninstall org-mode&lt;/li&gt;&#xA;&lt;li&gt;quit emacs&lt;/li&gt;&#xA;&lt;li&gt;restart emacs using &lt;code&gt;emacs -q&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;manually add &lt;code&gt;(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)&lt;/code&gt; to &lt;code&gt;package-archives&lt;/code&gt; and run &lt;code&gt;(package-initialize)&lt;/code&gt; `&lt;/li&gt;&#xA;&lt;li&gt;install org-mode&lt;/li&gt;&#xA;&lt;li&gt;restart emacs&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="838" LastActivityDate="2014-10-20T22:07:03.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2390" PostTypeId="2" ParentId="2388" CreationDate="2014-10-20T22:11:23.037" Score="1" Body="&lt;p&gt;You need to load the &lt;code&gt;org-table&lt;/code&gt; library. You can customize the &lt;code&gt;org-modules&lt;/code&gt; variable to include it.&lt;/p&gt;&#xA;" OwnerUserId="838" LastActivityDate="2014-10-20T22:11:23.037" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2391" PostTypeId="2" ParentId="2367" CreationDate="2014-10-20T22:28:12.387" Score="4" Body="&lt;p&gt;Except for &quot;log&quot; Magit never tells Git to &lt;code&gt;--color&lt;/code&gt; its output. It also doesn't &lt;code&gt;--no-color&lt;/code&gt; explicitly, because that usually is not necessary. In my experience Git is usually capable of figuring out when to use colors and when not. So the most likely cause for this issue that you have (or some tool you use has) explicitly told Git to always color its output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the values of &lt;code&gt;color.ui&lt;/code&gt; and &lt;code&gt;color.diff&lt;/code&gt; (&lt;code&gt;git config --list | grep color&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;color.ui&#xA;    This variable determines the default value for variables such as&#xA;    color.diff and color.grep that control the use of color per&#xA;    command family. Its scope will expand as more commands learn&#xA;    configuration to set a default for the --color option. Set it to&#xA;    false or never if you prefer Git commands not to use color unless&#xA;    enabled explicitly with some other configuration or the --color&#xA;    option. Set it to always if you want all output not intended for&#xA;    machine consumption to use color, to true or auto (this is the&#xA;    default since Git 1.8.4) if you want such output to use color&#xA;    when written to the terminal.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am a bit confused about the &quot;since Git 1.8.4&quot;, I was pretty sure that was always the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, if you cannot set this in your Git configuration, then appending &lt;code&gt;(&quot;-c&quot; &quot;core.ui=false&quot;)&lt;/code&gt; to &lt;code&gt;magit-git-standard-options&lt;/code&gt; should also work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will add that to the &lt;a href=&quot;https://github.com/magit/magit/wiki/FAQ&quot; rel=&quot;nofollow&quot;&gt;FAQ&lt;/a&gt;. The above is actually a copy of &lt;a href=&quot;https://github.com/magit/magit/issues/1122#issuecomment-31129495&quot; rel=&quot;nofollow&quot;&gt;my answer&lt;/a&gt; to a similar question.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-10T21:55:05.657" LastActivityDate="2015-01-10T21:55:05.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2392" PostTypeId="1" AcceptedAnswerId="2408" CreationDate="2014-10-21T02:53:33.237" Score="7" ViewCount="1996" Body="&lt;p&gt;In a large file, I want to find which lines which do not contain a given string, &lt;code&gt;grep -v&lt;/code&gt; basically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x &lt;code&gt;grep&lt;/code&gt;&lt;/kbd&gt; helps, but it forces to protect special characters, is not interactive nor incremental, and doesn't let me edit the file at matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to find such lines ?&lt;/p&gt;&#xA;" OwnerUserId="2047" LastActivityDate="2020-03-10T14:53:51.690" Title="How to search for lines not containing some text?" Tags="|search|interactive|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2393" PostTypeId="2" ParentId="2392" CreationDate="2014-10-21T04:57:54.580" Score="1" Body="&lt;p&gt;May I suggest:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is not interactive nor incremental&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can use emacs re-builder &lt;code&gt;M-x regexp-builder&lt;/code&gt; for interactive/incremental search.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I want to find which lines which do not contain a given string, &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Using &quot;complemented char set&quot; syntax &lt;code&gt;[^...]&lt;/code&gt; is the only thing I have for doing something close to to &lt;code&gt;grep -v&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;and doesn't let me edit the file at matches.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Once you're satisfied with the regex you built inside the regexp-builder, you can &lt;code&gt;M-x reb-copy&lt;/code&gt; to copy it, then paste it in, &lt;code&gt;M-x query-replace-regexp&lt;/code&gt; for finding and replacing operation&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-10-21T04:57:54.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2394" PostTypeId="1" AcceptedAnswerId="2397" CreationDate="2014-10-21T05:08:26.343" Score="5" ViewCount="441" Body="&lt;p&gt;If I make a table (with &lt;code&gt;M-x table-insert&lt;/code&gt;), the background color is a dark blue, and the text color is a light grey. I'd like to make the face different, but I'm not sure what face I need to change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html#Text-Based-Tables&quot; rel=&quot;nofollow&quot;&gt;emacs documentation for tables&lt;/a&gt; doesn't say what the face is. I'd like to find the face used without having to look through all the Emacs code, so I can change it.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-10-21T08:26:56.873" Title="In table-mode, how do I change the face used for cells?" Tags="|customize|faces|table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2395" PostTypeId="2" ParentId="2375" CreationDate="2014-10-21T06:04:49.157" Score="5" Body="&lt;p&gt;In general, this is something that you would use &lt;code&gt;narrow-to-region&lt;/code&gt; for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You move the cursor (for example, by searching) to the beginning of the region and press &lt;code&gt;C-SPC&lt;/code&gt;, then move to the end of the region and type &lt;code&gt;M-x narrow-to-region&lt;/code&gt;. Now you can issue any search and replace commands that you want and they will only apply to narrowed part of the buffer. Once you're done, type &lt;code&gt;M-x widen&lt;/code&gt; to restore the buffer content.&lt;/p&gt;&#xA;" OwnerUserId="161" LastActivityDate="2014-10-21T06:04:49.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2396" PostTypeId="1" AcceptedAnswerId="2398" CreationDate="2014-10-21T06:05:11.117" Score="4" ViewCount="776" Body="&lt;p&gt;In ansi-term's &quot;char run&quot; mode, I can use &lt;kbd&gt;C-&amp;lt;left&amp;gt;&lt;/kbd&gt; and &lt;kbd&gt;C-&amp;lt;right&amp;gt;&lt;/kbd&gt; to move around in steps of one word, but as soon as I start typing again, the point moves back to where it was. They work fine in &quot;line run&quot; mode (&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-j&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to I get the point to stay where I moved it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, &lt;kbd&gt;C-w&lt;/kbd&gt; seems to use a different definition of &quot;word&quot; than &lt;code&gt;backward-kill-word&lt;/code&gt;, which I have also bound to &lt;kbd&gt;C-w&lt;/kbd&gt; for normal buffers. For Instance, hitting &lt;kbd&gt;C-w&lt;/kbd&gt; on the end of &lt;code&gt;ls /usr/local/bin&lt;/code&gt; gives me &lt;code&gt;ls /usr/local/&lt;/code&gt; in a scratch buffer, but in ansi-term it leaves me with &lt;code&gt;ls&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to configure these things more granularly?&lt;/p&gt;&#xA;" OwnerUserId="2118" LastActivityDate="2014-10-21T07:40:38.890" Title="How do I configure moving by and deleting words in ansi-term?" Tags="|key-bindings|ansi-term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2397" PostTypeId="2" ParentId="2394" CreationDate="2014-10-21T07:06:01.013" Score="5" Body="&lt;p&gt;Move the point to the region of interest and enter &lt;kbd&gt;C-u C-x =&lt;/kbd&gt;, ie the extended &lt;code&gt;what-cursor-position&lt;/code&gt; that includes all the &lt;code&gt;describe-char&lt;/code&gt; information, which includes the current active face for that character.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             position: 52052 of 94583 (55%), column: 3&#xA;            character: f (displayed as f) (codepoint 102, #o146, #x66)&#xA;    preferred charset: ascii (ASCII (ISO646 IRV))&#xA;code point in charset: 0x66&#xA;               script: latin&#xA;               syntax: w    which means: word&#xA;             category: .:Base, L:Left-to-right (strong), a:ASCII, l:Latin, r:Roman&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #x66&#xA;            file code: #x66 (encoded by coding system prefer-utf-8-unix)&#xA;              display: by this font (glyph code)&#xA;    xft:-unknown-Inconsolata-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 (#x66)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: LATIN SMALL LETTER F&#xA;  general-category: Ll (Letter, Lowercase)&#xA;  decomposition: (102) ('f')&#xA;&#xA;There are text properties here:&#xA;  face                 font-lock-keyword-face&#xA;  fontified            t&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Following the link to the face (&lt;code&gt;font-lock-keyword-face&lt;/code&gt; in my example) gives a buffer like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Face: font-lock-keyword-face (sample) (customize this face)&#xA;&#xA;Documentation:&#xA;Font Lock mode face used to highlight keywords.&#xA;&#xA;Defined in `font-lock.el'.&#xA;&#xA;           Family: unspecified&#xA;          Foundry: unspecified&#xA;            Width: unspecified&#xA;           Height: unspecified&#xA;           Weight: bold&#xA;            Slant: unspecified&#xA;       Foreground: #F0DFAF&#xA;DistantForeground: unspecified&#xA;       Background: unspecified&#xA;        Underline: unspecified&#xA;         Overline: unspecified&#xA;   Strike-through: unspecified&#xA;              Box: unspecified&#xA;          Inverse: unspecified&#xA;          Stipple: unspecified&#xA;             Font: unspecified&#xA;          Fontset: unspecified&#xA;          Inherit: unspecified&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which tells where the face was originally defined, and all of it's properties. This method allows discovery and customization of any font face used in Emacs that is accessible using the point, even in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not certain how to find the equivalent information for faces used in the modeline.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-10-21T08:26:56.873" LastActivityDate="2014-10-21T08:26:56.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2398" PostTypeId="2" ParentId="2396" CreationDate="2014-10-21T07:07:16.193" Score="6" Body="&lt;p&gt;In ansi-term's &quot;char run mode&quot;, &lt;kbd&gt;C-&amp;lt;left&amp;gt;&lt;/kbd&gt; &amp;amp; co are by default intercepted by emacs, which moves the point instead of telling the undelying terminal to do it. This leads to the situation you describe: the point moves in the emacs buffer, but the next insertion will use the real cursor position in the terminal, which hasn't changed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You thus need to reassign &lt;kbd&gt;C-&amp;lt;left&amp;gt;&lt;/kbd&gt; and &lt;kbd&gt;C-&amp;lt;right&amp;gt;&lt;/kbd&gt; to commands that actually forward the correct keys to the terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun term-send-Cright () (interactive) (term-send-raw-string &quot;\e[1;5C&quot;))&#xA;(defun term-send-Cleft  () (interactive) (term-send-raw-string &quot;\e[1;5D&quot;))&#xA;(define-key term-raw-map (kbd &quot;C-&amp;lt;right&amp;gt;&quot;)      'term-send-Cright)&#xA;(define-key term-raw-map (kbd &quot;C-&amp;lt;left&amp;gt;&quot;)       'term-send-Cleft)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;FYI, I found the &lt;code&gt;\e[1;5C&lt;/code&gt; and &lt;code&gt;\e[1;5D&lt;/code&gt; codes using the following trick:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;run &lt;code&gt;cat &amp;gt;/dev/null&lt;/code&gt; in a terminal&lt;/li&gt;&#xA;&lt;li&gt;type &lt;kbd&gt;C-&amp;lt;left&amp;gt;&lt;/kbd&gt; and &lt;kbd&gt;C-&amp;lt;right&amp;gt;&lt;/kbd&gt; and see what is echoed back in the terminal&lt;/li&gt;&#xA;&lt;li&gt;exit with &lt;kbd&gt;C-d&lt;/kbd&gt; or &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Another way to find them would be to type in a terminal: &lt;kbd&gt;C-v&lt;/kbd&gt;&lt;kbd&gt;C-&amp;lt;left&amp;gt;&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As for the &lt;kbd&gt;C-w&lt;/kbd&gt; problem, it is of a different kind: as you said, emacs and bash do not have the same definition of what a word is. The only solution I would see would be to change one of them (either emacs or bash) to make it consistent with the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like bash's default &lt;kbd&gt;M-&amp;lt;backspace&amp;gt;&lt;/kbd&gt; binding is closer to the behaviour of Emacs' &lt;code&gt;backward-kill-word&lt;/code&gt;. You could thus bind &lt;kbd&gt;C-w&lt;/kbd&gt; to a command which forwards the &lt;kbd&gt;M-&amp;lt;backspace&amp;gt;&lt;/kbd&gt;&#xA;key sequence to the terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun term-send-Mbackspace () (interactive)(term-send-raw-string &quot;\e\d&quot;))&#xA;(define-key term-raw-map (kbd &quot;C-w&quot;) 'term-send-Mbackspace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-10-21T07:40:38.890" LastActivityDate="2014-10-21T07:40:38.890" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2399" PostTypeId="1" CreationDate="2014-10-21T09:32:08.963" Score="14" ViewCount="3316" Body="&lt;p&gt;Is it possible to have, in the same org file, two code blocks in the same language that are run in different interpreters by specifying different options at the top of the code block? &lt;/p&gt;&#xA;" OwnerUserId="2177" LastActivityDate="2014-10-26T12:01:09.207" Title="Code-block specific interpreter in Org Babel" Tags="|org-mode|org-babel|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2400" PostTypeId="1" AcceptedAnswerId="2405" CreationDate="2014-10-21T10:07:26.240" Score="4" ViewCount="137" Body="&lt;p&gt;I have a mediawiki table with three columns and some rows, eg.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{| class=&quot;sortable&quot;&#xA;! Column header (one) !! Middle column !! Last column&#xA;|-&#xA;| value 1 || loong value ... and some more || another value&#xA;|-&#xA;| some|| more ||rows&#xA;|}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I efficiently swap the second column (the one with the &lt;em&gt;Middle column&lt;/em&gt; heading) with the last one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just did it with &lt;code&gt;query-replace-regexp&lt;/code&gt; and it wasn't so bad, but I suppose there must be a nicer way. Answers either for stock GNU Emacs 24.3, or using some generally useful packages (eg. multiple-cursors) will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="235" LastActivityDate="2014-10-21T21:20:38.047" Title="Swap columns in a mediawiki table" Tags="|editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2401" PostTypeId="2" ParentId="2319" CreationDate="2014-10-21T10:08:40.463" Score="4" Body="&lt;p&gt;Using a current &lt;code&gt;org&lt;/code&gt; version (at least 8.2.10, which is the one&#xA;currently shipped with Emacs), you can achieve what you want by simply using&#xA;&lt;code&gt;#+begin_sidewaysfigure&lt;/code&gt; instead of &lt;code&gt;#+begin_figure&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer (insert&#xA;&quot;#+LATEX_HEADER: \\usepackage{rotating}&#xA;#+NAME: sideway&#xA;#+CAPTION: test&#xA;#+begin_sidewaysfigure&#xA;[[file:test.png]]&#xA;#+end_sidewaysfigure&quot;)&#xA;(org-mode)&#xA;(org-latex-export-as-latex nil nil nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{sidewaysfigure}&#xA;\caption{\label{sideway}test}&#xA;\includegraphics[width=.9\linewidth]{test.png}&#xA;\end{sidewaysfigure}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For html you could get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;sidewaysfigure&quot;&amp;gt;&#xA;&#xA;&amp;lt;div class=&quot;figure&quot;&amp;gt;&#xA;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;test.png&quot; alt=&quot;test.png&quot; /&amp;gt;&#xA;&amp;lt;/p&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is then for you to fix via css or whatnot.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="50" LastEditDate="2014-10-21T10:55:53.290" LastActivityDate="2014-10-21T10:55:53.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2402" PostTypeId="2" ParentId="156" CreationDate="2014-10-21T10:40:08.667" Score="5" Body="&lt;p&gt;Note for the code snippets you must use the current development-version, &lt;code&gt;(org-version) =&amp;gt; &quot;8.3beta&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please use &lt;code&gt;CUSTOM_ID&lt;/code&gt; and internal linking.  See &lt;a href=&quot;http://orgmode.org/org.html#index-property_002c-CUSTOM_005fID-486&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(info &quot;(org) Handling links&quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most cases you should not be concerned about the exported result of internal naming in Org.  Links to figures and headlines, say, will be correct when exported.  See &lt;a href=&quot;http://orgmode.org/org.html#Internal-links&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(info &quot;(org) Internal links&quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For LaTeX try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (let ((org-latex-prefer-user-labels t))&#xA;(insert &quot;&#xA;* h&#xA;:PROPERTIES:&#xA;:CUSTOM_ID: h&#xA;:END:&quot;)&#xA;(org-mode)&#xA;(org-latex-export-as-latex nil nil nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{h}&#xA;\label{h}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In exporters such as &lt;code&gt;ox-odt&lt;/code&gt; and &lt;code&gt;ox-html&lt;/code&gt; headlines contain both internal id, &lt;code&gt;ID&lt;/code&gt; and &lt;code&gt;CUSTOM_ID&lt;/code&gt;.  Which link is used depends on the the link:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (let ((org-export-with-toc nil))&#xA;(insert &quot;&#xA;* h&#xA;:PROPERTIES:&#xA;:CUSTOM_ID: h&#xA;:END:&#xA;[[*h]] [[#h]]&quot;)&#xA;(org-mode)&#xA;(org-html-export-as-html nil nil nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;div id=&quot;outline-container-h&quot; class=&quot;outline-2&quot;&amp;gt;&#xA;&amp;lt;h2 id=&quot;h&quot;&amp;gt;&amp;lt;a id=&quot;sec-1&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;span class=&quot;section-number-2&quot;&amp;gt;1&amp;lt;/span&amp;gt; h&amp;lt;/h2&amp;gt;&#xA;&amp;lt;div class=&quot;outline-text-2&quot; id=&quot;text-h&quot;&amp;gt;&#xA;&amp;lt;p&amp;gt;&#xA;&amp;lt;a href=&quot;#sec-1&quot;&amp;gt;1&amp;lt;/a&amp;gt; &amp;lt;a href=&quot;#h&quot;&amp;gt;1&amp;lt;/a&amp;gt;&#xA;&amp;lt;/p&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2015-04-20T20:34:37.560" LastActivityDate="2015-04-20T20:34:37.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2403" PostTypeId="2" ParentId="2399" CreationDate="2014-10-21T12:06:28.023" Score="1" Body="&lt;p&gt;I believe by default each block runs in an independent interpreter even if it's the same language. The behavior may be different for some languages. For instance, I'm not sure that emacs-lisp blocks support the session property.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ruby&#xA;  a = &quot;foo&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: foo&#xA;&#xA;#+BEGIN_SRC ruby&#xA;  a ||= &quot;bar&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: bar&#xA;&#xA;#+BEGIN_SRC ruby :session foo&#xA;  a ||= &quot;session foo&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: session foo&#xA;&#xA;#+BEGIN_SRC ruby :session foo&#xA;  a += &quot; with bar&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: session foo with bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first two blocks use independent interpreters, but the third and fourth block share a session &lt;code&gt;:foo&lt;/code&gt;, so that they evaluate in the same interpreter.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-10-21T12:23:32.400" LastActivityDate="2014-10-21T12:23:32.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2404" PostTypeId="1" AcceptedAnswerId="17038" CreationDate="2014-10-21T13:15:00.067" Score="6" ViewCount="1857" Body="&lt;p&gt;Is there a way to convince org-mode to export nested blocks as nested &lt;code&gt;&amp;lt;blockquote&amp;gt;&lt;/code&gt; elements?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would be really cool to handle nested quotes in html emails with mu4e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_QUOTE&#xA;hey ho&#xA;#+BEGIN_QUOTE&#xA; hey hey&#xA;#+END_QUOTE&#xA;ho ho&#xA;#+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently the exporter outputs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;&#xA;    &amp;lt;p&amp;gt;&#xA;        hey ho&#xA;    &amp;lt;/p&amp;gt;&#xA;    &amp;lt;p&amp;gt;&#xA;        #+BEGIN&amp;lt;sub&amp;gt;QUOTE&amp;lt;/sub&amp;gt;&#xA;        hey hey&#xA;    &amp;lt;/p&amp;gt;&#xA;&amp;lt;/blockquote&amp;gt;&#xA;&amp;lt;p&amp;gt;&#xA;    ho ho&#xA;&amp;lt;/p&amp;gt;&#xA;&amp;lt;p&amp;gt;&#xA;    #+END&amp;lt;sub&amp;gt;QUOTE&amp;lt;/sub&amp;gt;&#xA;&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While I would expect it to output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;&#xA;    &amp;lt;p&amp;gt;&#xA;        hey ho&#xA;    &amp;lt;/p&amp;gt;&#xA;    &amp;lt;blockquote&amp;gt;&#xA;        &amp;lt;p&amp;gt;&#xA;            hey hey&#xA;        &amp;lt;/p&amp;gt;&#xA;    &amp;lt;/blockquote&amp;gt;&#xA;    &amp;lt;p&amp;gt;&#xA;        ho ho&#xA;    &amp;lt;/p&amp;gt;&#xA;&amp;lt;/blockquote&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2182" LastEditorUserId="50" LastEditDate="2014-10-23T13:49:35.740" LastActivityDate="2015-10-01T03:48:16.523" Title="exporting org-mode nested blocks to html" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2405" PostTypeId="2" ParentId="2400" CreationDate="2014-10-21T13:26:38.833" Score="4" Body="&lt;h3&gt;Solution&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You can easily do with with &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/align-regexp&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;align-regexp&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/kill-rectangle&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;kill-rectangle&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/yank-rectangle&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;yank-rectangle&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Explanation&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select the region you want to align (rows with &lt;code&gt;!!&lt;/code&gt; and &lt;code&gt;||&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;align-regexp&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In &lt;em&gt;Complex align using regexp:&lt;/em&gt; field: &lt;code&gt;[|!][|!]&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;em&gt;NOTE: Just append this to the auto-inserted &lt;code&gt;\(\s-*\)&lt;/code&gt; expression; don't replace!&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;In &lt;em&gt;Parenthesis group to modify..&lt;/em&gt;: Hit &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;In &lt;em&gt;Amount of spacing..&lt;/em&gt;: Hit &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;In &lt;em&gt;Repeat throughout the line? (y or n)&lt;/em&gt;: &lt;code&gt;y&lt;/code&gt;  &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If everything went alright, you should get this (based on the original example in your question):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;{| class=&quot;sortable&quot;&#xA;! Column header (one) !! Middle column                 !! Last column&#xA;|-&#xA;| value 1             || loong value ... and some more || another value&#xA;|-&#xA;| some                || more                          ||rows&#xA;|}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Now select the region between points as shown below, between the &lt;em&gt;point&lt;/em&gt; and &lt;em&gt;mark&lt;/em&gt; represented by black rectangles:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre&gt;&#xA;{| class=&quot;sortable&quot;&#xA;! Column header (one)▮!! Middle column                 !! Last column&#xA;|-&#xA;| value 1             || loong value ... and some more || another value&#xA;|-&#xA;| some                || more                         ▮||rows&#xA;|}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;strong&gt;&lt;kbd&gt;k&lt;/kbd&gt;&lt;/strong&gt; - Kill/cut that rectangular region&lt;/li&gt;&#xA;&lt;li&gt;Now bring the cursor to the point where you want to &lt;em&gt;move&lt;/em&gt; that cut rectangular region:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre&gt;&#xA;{| class=&quot;sortable&quot;&#xA;! Column header (one) !! Last column   ▮&#xA;|-&#xA;| value 1             || another value&#xA;|-&#xA;| some                ||rows&#xA;|}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;.. and paste that area. &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;strong&gt;&lt;kbd&gt;y&lt;/kbd&gt;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;{| class=&quot;sortable&quot;&#xA;! Column header (one) !! Last column   !! Middle column                 &#xA;|-                                                                      &#xA;| value 1             || another value || loong value ... and some more &#xA;|-                                                                      &#xA;| some                ||rows           || more                          &#xA;|}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This whole operation takes only about 10-15 seconds. So don't be discouraged by the length of this post.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="45" LastEditDate="2014-10-21T21:20:38.047" LastActivityDate="2014-10-21T21:20:38.047" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2406" PostTypeId="1" AcceptedAnswerId="2407" CreationDate="2014-10-21T13:52:46.237" Score="3" ViewCount="177" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How often/quickly is the official Emacs manual updated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00713.html&quot; rel=&quot;nofollow&quot;&gt;release announcement of Emacs 24.4&lt;/a&gt; has a blurb at the bottom stating that the FSF's official Emacs manual has been updated to correspond to version 24.2.  It also notes that buying the manual is a good way to support the FSF's work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, aside from &lt;a href=&quot;http://shop.fsf.org/category/donate/&quot; rel=&quot;nofollow&quot;&gt;donating&lt;/a&gt;, buying the paper copy of the manual seems like a decent way to support the FSF, even though it's possible to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/pdf/emacs_7x9.pdf&quot; rel=&quot;nofollow&quot;&gt;download a PDF copy for free&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Roughly speaking, how frequently is the manual updated (in terms of dates and/or Emacs versions)?  I'd be happy to throw some money the FSF's way on this, but I'd be less happy if the manual were updated to, say, version 24.4 a month after I bought a copy of this version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; The plot thickens.  The paper copy available from &lt;a href=&quot;http://shop.fsf.org/product/Emacs_Manual_24/&quot; rel=&quot;nofollow&quot;&gt;the FSF store&lt;/a&gt; corresponds to Emacs version 24.2.  Yet there is also an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/pdf/emacs.pdf&quot; rel=&quot;nofollow&quot;&gt;updated PDF version of the manual&lt;/a&gt; that corresponds to Emacs version 24.4.  (Oddly enough, it's about 40 pages shorter than the 24.2 version.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-10-21T14:17:57.410" LastActivityDate="2014-10-23T22:45:20.673" Title="how often is the official Emacs manual updated?" Tags="|documentation|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2407" PostTypeId="2" ParentId="2406" CreationDate="2014-10-21T14:52:20.790" Score="3" Body="&lt;p&gt;The Info (hypertext) manual that is distributed with Emacs and available from Emacs by &lt;code&gt;C-h r&lt;/code&gt; is updated periodically by fixing doc bugs.  It is also updated for each Emacs release, to be accurate with respect to changes in the program, including new features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you see something that needs to be improved, please file an enhancement request or bug report, using &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Non-Info versions of the manual are something else again. I don't have a good answer for your query about that. If you don't get a satisfactory answer here, try asking in a mail message to &lt;code&gt;emacs-devel@gnu.org&lt;/code&gt; or &lt;code&gt;help-gnu-emacs@gnu.org&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-21T14:52:20.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2408" PostTypeId="2" ParentId="2392" CreationDate="2014-10-21T15:25:58.000" Score="3" Body="&lt;p&gt;This is simple if you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt; search&lt;/a&gt; to search contexts of any kind, including lines. For searching lines the command is &lt;code&gt;icicle-occur&lt;/code&gt;, bound to &lt;code&gt;C-c '&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During &lt;strong&gt;Icicles&lt;/strong&gt; search you type text (it can be a regexp, substring, etc.) as a search pattern to match, and the contexts that match that pattern are retained as candidates to visit/show.  In other words, your search is narrowed to contexts (e.g. lines) that match what you type. And this is dynamic: change the text in the minibuffer to another pattern, and the matching contexts change immediately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During &lt;strong&gt;Icicles&lt;/strong&gt; search (and during completion more generally), you can use &lt;strong&gt;&lt;code&gt;C-~&lt;/code&gt;&lt;/strong&gt; anytime to narrow &lt;em&gt;subtract&lt;/em&gt; the current matching contexts from the previous set of contexts (e.g. the original domain of contexts, such as all lines in the buffer). That is, &lt;code&gt;C-~&lt;/code&gt; &lt;strong&gt;complements&lt;/strong&gt; the current set of matches.  Which is what you asked for.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Peripherally related to your question, you can also use &lt;strong&gt;&lt;code&gt;C-M-~&lt;/code&gt;&lt;/strong&gt; (same key, but with &lt;em&gt;Meta-&lt;/em&gt; added) to complement, not the current search candidates, but the domain of &lt;strong&gt;contexts&lt;/strong&gt; used from then on.  This is useless if the contexts (areas to be searched) are all of the lines in the buffer, but it is quite &lt;em&gt;useful for contexts that are not contiguous&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, there are &lt;strong&gt;Icicles&lt;/strong&gt; search commands to search various THINGs (e.g., different types of sexps) as contexts, and these are not necessarily contiguous.  When you hit &lt;code&gt;C-M-~&lt;/code&gt; during search, instead of searching the contexts you define, &lt;strong&gt;Icicles&lt;/strong&gt; &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview#SearchOutsideContexts&quot; rel=&quot;nofollow noreferrer&quot;&gt;searches the &lt;strong&gt;non-contexts&lt;/strong&gt;&lt;/a&gt;. That is, &lt;code&gt;C-M-~&lt;/code&gt; changes to searching the &lt;em&gt;complement&lt;/em&gt; of the set of contexts. &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2020-03-10T14:53:51.690" LastActivityDate="2020-03-10T14:53:51.690" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2409" PostTypeId="1" AcceptedAnswerId="2412" CreationDate="2014-10-21T15:54:43.287" Score="8" ViewCount="359" Body="&lt;p&gt;I was reading through the Changelog for emacs 24.4 (&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt;) and was trying to see what the File Notification feature is. I tried doing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; of a related variable &lt;code&gt;auto-revert-use-notify&lt;/code&gt; but nothing showed up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then grepped for that variable name in the emacs source code and found that it was used in &lt;code&gt;lisp/autorevert.el&lt;/code&gt;. After doing &lt;code&gt;(require 'autorevert)&lt;/code&gt;, all the underlying functions and variables got defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How do I know if and what I need to &lt;code&gt;require&lt;/code&gt; if I want to use a then-inactive emacs built-in feature? Is there a list of such packages available? &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="45" LastEditDate="2014-10-21T19:56:20.730" LastActivityDate="2014-10-21T19:56:20.730" Title="How can I know which built-in emacs package needs to be 'require'd?" Tags="|package|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2410" PostTypeId="1" AcceptedAnswerId="5391" CreationDate="2014-10-21T16:15:25.403" Score="65" ViewCount="1939" Body="&lt;h1&gt;Emacs as a StackExchange client?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;How can I use Emacs to edit questions, answers, and comments here on the Emacs Stack Exchange site?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Broadly, what possible methods exist?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Kill and yank&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This works, but the method is so cumbersome that it's not worth it for short posts or even medium-length posts.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Browser plugin&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There is a relatively well know browser plugin for Firefox that lets your push the text content of any &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt; back and forth between the editor of your choice.  I presume it works via temp files and I haven't evaluated it.  &lt;a href=&quot;https://stackoverflow.com/questions/10383986/emacs-mode-for-stack-overflows-markdown/10386560#10386560&quot;&gt;Using the plugin with emacs has been discussed on StackOverflow&lt;/a&gt;.  I don't use Chrome any more.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Stack Exchange API&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Something called &lt;a href=&quot;https://stackapps.com/questions/3950/stack-exchange-mode-for-emacs&quot;&gt;Stack Exchange Mode for Emacs&lt;/a&gt; exists.  I have not evaluated it.  &lt;a href=&quot;https://github.com/vermiculus/stack-mode&quot; rel=&quot;noreferrer&quot;&gt;The source&lt;/a&gt; isn't too stale, but the project is obviously not completed.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Other options?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I seek suggestions!&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Motivations&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Regardless of what method is used to edit questions, answers, and comments in emacs, I am sure that doing so will enable us to do some common tasks with ease:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Adhere to &lt;a href=&quot;https://emacs.meta.stackexchange.com/questions/tagged/conventions&quot;&gt;conventions&lt;/a&gt;.  Something like &lt;code&gt;M-x record-keystrokes-and-write-them-out-as-markdown RET C-x C-s C-g RET&lt;/code&gt; ...might yield: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x C-s C-g&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ask what an error message means: &lt;code&gt;M-x post-region-on-emacs-se-as-question RET&lt;/code&gt; ...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="870" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2020-03-13T05:14:42.770" Title="How can I use Emacs to edit questions, answers, and comments here?" Tags="|major-mode|integration|" AnswerCount="8" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2411" PostTypeId="1" AcceptedAnswerId="2442" CreationDate="2014-10-21T16:21:56.223" Score="7" ViewCount="892" Body="&lt;p&gt;I'm currently experimenting with moving more of my development workflow into org-mode so I can keep better track of what testing I've done. However some of the steps involve asynchronous calls to RPC services. The following snippet shows the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: simple-async-example&#xA;#+begin_src emacs-lisp &#xA;  (async-start&#xA;     ;; What to do in the child process&#xA;     (lambda ()&#xA;       (message &quot;This is a test&quot;)&#xA;       (sleep-for 3)&#xA;       222)&#xA;&#xA;     ;; What to do when it finishes&#xA;     (lambda (result)&#xA;       (format &quot;Async process done - result should be 222: %s&quot; result)))&#xA;#+end_src&#xA;&#xA;#+RESULTS: simple-async-example&#xA;: #&amp;lt;process emacs&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see the result comes from the first task. What I need to do is append the actual result once the processing has been completed. Is there any way to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-10-22T14:33:45.610" LastActivityDate="2015-03-21T17:48:42.953" Title="Returning org-babel results from an asynchronous call" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2412" PostTypeId="2" ParentId="2409" CreationDate="2014-10-21T16:46:02.777" Score="6" Body="&lt;p&gt;The answer, as far as I know, to your questions are &quot;&lt;em&gt;You cannot know&lt;/em&gt;&quot; and &quot;&lt;em&gt;There is no such list of libraries&lt;/em&gt;.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;apropos&lt;/code&gt; and similar commands are based only on what is &lt;em&gt;currently&lt;/em&gt; loaded or autoloaded, not what is distributed with Emacs.  Unless something is (a) built in (i.e., in C code), (b) available from an already loaded library, or (c) autoloaded, it is not picked by such commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, your only resort is to search the source code (as far as I know).  Grepping is one way to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a variable such as &lt;code&gt;auto-revert-use-notify&lt;/code&gt; (which is a user option) is explicitly mentioned in the Emacs NEWS (&lt;code&gt;C-h N&lt;/code&gt;), then it would be great if that mention were linked to the source library that defines it, so you could just hit &lt;code&gt;RET&lt;/code&gt; or click &lt;code&gt;mouse-2&lt;/code&gt; on its name to open the library file to its definition.  You might want to use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; to file that as an enhancement request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It might also be useful to have a command to do that in general: look up a variable's or a functions's definition in the distributed source code, without the library needing to be loaded. In this case, you knew the exact variable name, but had to &lt;code&gt;grep&lt;/code&gt; to find where it is defined.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-21T16:46:02.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2413" PostTypeId="2" ParentId="2410" CreationDate="2014-10-21T17:28:31.970" Score="5" Body="&lt;p&gt;I have always found kill and yank to be sufficient, but I do have a stackoverflow specific copy function I use.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-el-for-so (beg end)&#xA;  &quot;copy region and format for SO.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((text (buffer-substring-no-properties beg end)))&#xA;    (with-temp-buffer&#xA;      (insert &quot;&amp;lt;!--Language: lang-lisp --&amp;gt;\n&quot;)&#xA;      (replace-string &quot;\n&quot; &quot;\n    &quot; nil (point)&#xA;                      (progn&#xA;                        (insert &quot;\n&quot; text)&#xA;                        (point)))&#xA;      (copy-region-as-kill (point-min) (point-max))&#xA;      (message &quot;copied&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which takes things like:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun process-exit-code-and-output (program &amp;amp;rest args)&#xA;  &quot;Run PROGRAM with ARGS and return the exit code and output in a list.&quot;&#xA;  (with-temp-buffer&#xA;    (list (apply 'call-process program nil (current-buffer) nil args)&#xA;          (buffer-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and turn them into:   &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!--Language: lang-lisp --&amp;gt;&#xA;&#xA;    (defun process-exit-code-and-output (program &amp;amp;rest args)&#xA;      &quot;Run PROGRAM with ARGS and return the exit code and output in a list.&quot;&#xA;      (with-temp-buffer&#xA;        (list (apply 'call-process program nil (current-buffer) nil args)&#xA;              (buffer-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alternatively, I find the &lt;a href=&quot;https://chrome.google.com/webstore/detail/edit-with-emacs/ljobjlafonikaiipfkggjbhkghgicgoh?hl=en&quot;&gt;Edit With Emacs&lt;/a&gt; chrome extensions to be very nice.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-10-21T17:28:31.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2415" PostTypeId="2" ParentId="2399" CreationDate="2014-10-21T20:21:24.597" Score="10" Body="&lt;p&gt;The original question has been modified to concern running multiple versions of an executable, and not simply independent interpreters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;find-library&lt;/code&gt; I inspected the source of &lt;code&gt;ob-ruby&lt;/code&gt;, which includes this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar org-babel-ruby-command &quot;ruby&quot;&#xA;  &quot;Name of command to use for executing ruby code.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have seen references elsewhere for python using &lt;code&gt;org-babel-python-command&lt;/code&gt;, so it exists in some other languages, check the appropriate &lt;code&gt;ob-$lang&lt;/code&gt; support to see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This allows the following to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :results none&#xA;(setq org-babel-python-command &quot;python3&quot;)&#xA;#+end_src&#xA;&#xA;#+begin_src python :results output&#xA;import sys&#xA;print(sys.version)&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: 3.4.0 (default, Apr 11 2014, 13:05:11) &#xA;: [GCC 4.8.2]&#xA;&#xA;#+begin_src emacs-lisp :results none&#xA;(setq org-babel-python-command &quot;python2&quot;)&#xA;#+end_src&#xA;&#xA;#+begin_src python :results output&#xA;import sys&#xA;print(sys.version)&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: 2.7.6 (default, Mar 22 2014, 22:59:56) &#xA;: [GCC 4.8.2]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This could be combined with &lt;code&gt;:session python3&lt;/code&gt; and &lt;code&gt;:session python2&lt;/code&gt; to avoid calling elisp before each block. It does seem like there should be a simpler way to do this though.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-21T20:21:24.597" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2416" PostTypeId="1" CreationDate="2014-10-21T21:01:25.670" Score="2" ViewCount="290" Body="&lt;p&gt;I'm looking for the most convenient way to set up a Customize options page to enter a set of directories and then select one of those directories and one file in the selected directory (if possible, without spelling out the implied extension). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like a constrained file picker, presumably using a pop-up or in the minibuffer, or autocompletion within the text field but the &lt;code&gt;directory&lt;/code&gt; and &lt;code&gt;file&lt;/code&gt; data types in my widgets give basic text fields instead; this means a lot of copying and pasting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a convenient way to choose between non-constant values and/or to modify widgets on the fly beyond &lt;code&gt;widget-value-set&lt;/code&gt; (I would need to populate a list of files when the selected directory changes)? Can packages like ido, helm, icicles etc. be configured to provide autocompletion in Customize widgets?&lt;/p&gt;&#xA;" OwnerUserId="2113" LastActivityDate="2023-12-12T11:01:25.170" Title="Choosing files and directories from widgets" Tags="|customize|widget|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2417" PostTypeId="1" CreationDate="2014-10-21T21:31:47.477" Score="6" ViewCount="357" Body="&lt;p&gt;Is there a way to designate a specific frame in which files opened with &lt;code&gt;emacsclient&lt;/code&gt; will appear?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have one monitor that is dedicated to a fullscreen Emacs frame.  I do most of my editing in that monitor, but from time to time I will open a second frame on another monitor temporarily.  I want to ensure that every time I open a file using &lt;code&gt;emacsclient&lt;/code&gt;, it gets sent to my fullscreen frame and doesn't end up on any other frames that might be open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ideal workflow would be that my &lt;strong&gt;initial&lt;/strong&gt; emacs frame gets tagged as the recipient of all &lt;code&gt;emacsclient&lt;/code&gt; requests, and the rest is automatic.  I always use the initial frame as my primary emacs frame, and other frames come and go as needed.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2014-10-22T15:10:07.550" LastActivityDate="2014-10-31T21:27:14.510" Title="Open edit-server files from emacsclient in a specific frame" Tags="|frames|emacsclient|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2418" PostTypeId="1" AcceptedAnswerId="2419" CreationDate="2014-10-21T21:35:29.620" Score="18" ViewCount="5911" Body="&lt;p&gt;Is there any way I can move the mode line and the minibuffer from the bottom to the top of the screen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minibuffer is covered by the previous question &lt;a href=&quot;https://emacs.stackexchange.com/q/1074&quot;&gt;How to display the content of minibuffer in the middle of the emacs frame?&lt;/a&gt;, so this question is primarily about the mode line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have just dropped my laptop and cracked the screen, so can't see much along the bottom row.&lt;/p&gt;&#xA;" OwnerUserId="2194" LastEditorUserId="2194" LastEditDate="2014-10-24T07:52:25.150" LastActivityDate="2014-10-24T07:52:25.150" Title="Moving the mode line and minibuffer to the top" Tags="|window|frames|mode-line|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2419" PostTypeId="2" ParentId="2418" CreationDate="2014-10-21T21:42:35.040" Score="24" Body="&lt;p&gt;The content of the &lt;code&gt;mode-line&lt;/code&gt; are stored in the variable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;mode-line-format&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;Emacs&lt;/code&gt; also supports a header line whose content is steered by the variable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Header-Lines.html#Header-Lines&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;header-line-format&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq header-line-format mode-line-format)&#xA;(setq-default mode-line-format nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to make the format of the &lt;code&gt;header-line&lt;/code&gt; be equal to that of your current mode line and remove the &lt;code&gt;mode-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; If you want to use this setting permanently put &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default header-line-format mode-line-format)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your init file (thanks to nispio for that suggestion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you also want the &lt;code&gt;minibuffer&lt;/code&gt; to appear at the top, I will re-link @Malabarba's answer to the question&lt;a href=&quot;https://emacs.stackexchange.com/questions/1074/how-to-display-the-content-of-minibuffer-in-the-middle-of-the-emacs-frame&quot;&gt;How to display the content of minibuffer in the middle of the emacs frame?&lt;/a&gt; which can be adapted to show the minibuffer at the top. Also, consider @phils answer to the question &lt;a href=&quot;https://stackoverflow.com/questions/3050011/is-it-possible-to-move-the-emacs-minibuffer-to-the-top-of-the-screen&quot;&gt;Is it possible to move the emacs minibuffer to the top of the screen?&lt;/a&gt; on the &lt;em&gt;&quot;old&quot;&lt;/em&gt; &lt;code&gt;emacs&lt;/code&gt; tag on stackoverflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, there is no way to directly put the minibuffer at the top. The only approach (which is also used by the above answers) is to use a second frame.&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-22T17:37:28.573" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2420" PostTypeId="2" ParentId="2410" CreationDate="2014-10-21T23:01:38.440" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/mooz/keysnail&quot; rel=&quot;nofollow&quot;&gt;Keysnail&lt;/a&gt; implements Emacs keybindings for Firefox.  It also serves as a platform for plug-ins, extending the architecture of Firefox in a distinctively Emacsesque fashion.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="2057" LastEditDate="2014-10-23T13:43:53.223" LastActivityDate="2014-10-23T13:43:53.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2421" PostTypeId="1" AcceptedAnswerId="2422" CreationDate="2014-10-21T23:06:36.710" Score="2" ViewCount="99" Body="&lt;p&gt;There command-line option &lt;code&gt;-e&lt;/code&gt; behaves &lt;em&gt;similar&lt;/em&gt; to the &lt;code&gt;--eval&lt;/code&gt; option, but yet it is not the same.  For example, of these two invocations, only the first one works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(global-linum-mode)'&#xA;emacs     -e '(global-linum-mode)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And of these two invocations, only the second one works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval 'global-linum-mode'&#xA;emacs     -e 'global-linum-mode'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had mistakenly assumed that &lt;code&gt;-e&lt;/code&gt; was the &quot;short form&quot; for &lt;code&gt;--eval&lt;/code&gt; based on this line from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Invocation.html#Emacs-Invocation&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There are two ways of writing options: the short forms that start with&#xA;  a single ‘-’, and the long forms that start with ‘--’. For example,&#xA;  ‘-d’ is a short form and ‘--display’ is the corresponding long form.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But as I noted, it has a behavior which differs from the long option. Is this mysterious &lt;code&gt;-e&lt;/code&gt; option documented anywhere?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-21T23:13:40.267" Title="Behavior of '-e' option during emacs invocation" Tags="|invocation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2422" PostTypeId="2" ParentId="2421" CreationDate="2014-10-21T23:13:40.267" Score="5" Body="&lt;p&gt;It's a synonym for &lt;code&gt;-f&lt;/code&gt; / &lt;code&gt;--funcall&lt;/code&gt;, included for backwards compatibility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The argument-handling code in &lt;code&gt;command-line-1&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;-f&quot;    ; what the manual claims&#xA;&quot;-funcall&quot;&#xA;&quot;-e&quot;))  ; what the source used to say&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-10-21T23:13:40.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2423" PostTypeId="1" AcceptedAnswerId="2449" CreationDate="2014-10-22T02:06:48.410" Score="24" ViewCount="4642" Body="&lt;p&gt;I understand that &lt;code&gt;nil&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; and/or &lt;code&gt;-1&lt;/code&gt; are used for disabling some features and &lt;code&gt;t&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt; and/or &lt;code&gt;+1&lt;/code&gt; are used for enabling some features.  When assigning variables or enabling/disabling minor modes, which should I choose?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen all of these variations used at one point or another. It leads me to wonder if there's actually a difference between them. I have seen that sometimes using &lt;code&gt;0&lt;/code&gt; doesn't work for me, while &lt;code&gt;nil&lt;/code&gt; does. Are there differences of where they are used?&lt;/p&gt;&#xA;" OwnerUserId="2200" LastEditorUserId="105" LastEditDate="2022-07-01T00:58:20.883" LastActivityDate="2022-07-01T00:58:20.883" Title="How to choose between nil and 0, or t and 1 when setting variables or enabling modes" Tags="|boolean|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2424" PostTypeId="2" ParentId="2423" CreationDate="2014-10-22T02:16:10.917" Score="0" Body="&lt;p&gt;These are all different things. 0, 1, and -1 are different numbers; &lt;code&gt;nil&lt;/code&gt; is a symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are each used all over the place, for many different things. To find out what each is used for &lt;strong&gt;in a particular context&lt;/strong&gt;, &lt;em&gt;consult the doc for that context&lt;/em&gt;.  And that includes contexts of turning different modes on or off, enabling and disabling different things using variables, and lots of other contexts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your question is far too broad to be useful.&lt;/li&gt;&#xA;&lt;li&gt;You need to consult the doc: (a) in general, to learn a little about Emacs Lisp, and (b) in particular contexts (e.g., the doc for a particular mode).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The doc for a given mode generally tells you how to turn it on and off.  If it tells you to use 1 or -1 or &lt;code&gt;nil&lt;/code&gt; or non-&lt;code&gt;nil&lt;/code&gt; for something, then that's what it means. There are some &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Modes.html#Modes&quot; rel=&quot;nofollow&quot;&gt;general rules for turning modes on and off&lt;/a&gt; (interactively and from Lisp code). But it sounds like you really need to start by getting some general background. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consult the Emacs doc to learn how to &lt;strong&gt;ask for help and other information from Emacs itself&lt;/strong&gt;: how to check the value of a variable, how to see the doc of a variable or a function (including a function that turns a mode on/off), and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;em&gt;start by using&lt;/em&gt; &lt;strong&gt;&lt;code&gt;C-h C-h&lt;/code&gt;&lt;/strong&gt; (&lt;kbd&gt;Ctrl-h&lt;/kbd&gt; &lt;kbd&gt;Ctrl-h&lt;/kbd&gt;), to learn about the Emacs help system. And build from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h r&lt;/code&gt;&lt;/strong&gt; puts you into the Emacs manual. Try the Emacs tutorial: &lt;code&gt;C-h t&lt;/code&gt;. And check the Emacs Wiki &lt;a href=&quot;http://www.emacswiki.org/EmacsNewbie&quot; rel=&quot;nofollow&quot;&gt;Newbie&lt;/a&gt; page and the page about &lt;a href=&quot;http://www.emacswiki.org/LearningEmacs&quot; rel=&quot;nofollow&quot;&gt;LearningEmacs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start learning about Emacs Lisp: &lt;strong&gt;&lt;code&gt;C-h i&lt;/code&gt;&lt;/strong&gt;, then choose the manual named &lt;code&gt;Emacs Lisp Intro&lt;/code&gt;, and start reading. And check the Emacs Wiki page about &lt;a href=&quot;http://www.emacswiki.org/LearnEmacsLisp&quot; rel=&quot;nofollow&quot;&gt;Learning Emacs Lisp&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-22T02:28:12.957" LastActivityDate="2014-10-22T02:28:12.957" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2425" PostTypeId="2" ParentId="2417" CreationDate="2014-10-22T05:12:34.207" Score="2" Body="&lt;p&gt;If your windowing system is X and your monitors are configured as separate screens, you can pass the appropriate &lt;code&gt;DISPLAY&lt;/code&gt; value (e.g. &lt;code&gt;:0.0&lt;/code&gt; or &lt;code&gt;:0.1&lt;/code&gt;) to emacsclient with the &lt;code&gt;-d&lt;/code&gt; option.  That's kind of a big &quot;if&quot;.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-10-22T05:12:34.207" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2426" PostTypeId="1" AcceptedAnswerId="2566" CreationDate="2014-10-22T06:07:05.600" Score="7" ViewCount="1356" Body="&lt;p&gt;If I load a local file, I'd like eww to refresh when the source is changed. This would be similar to auto-revert mode. Is there any way to do this? Right now I have to manually refresh by hitting &lt;code&gt;g&lt;/code&gt; in the &lt;code&gt;*eww*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="2204" LastActivityDate="2019-10-13T14:00:27.123" Title="How do I auto-refresh eww pages?" Tags="|eww|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2427" PostTypeId="1" CreationDate="2014-10-22T07:55:38.733" Score="44" ViewCount="14985" Body="&lt;p&gt;I'm putting together an app, and want to be able to test the api end points. I figured Emacs would be a cool way to go - especially if JSON responses could be parsed and the return data used in subsequent tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to go about this, or is this just crazy?&lt;/p&gt;&#xA;" OwnerUserId="395" LastActivityDate="2022-11-03T11:40:33.373" Title="How to test REST API with Emacs?" Tags="|package|" AnswerCount="6" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2428" PostTypeId="1" AcceptedAnswerId="2439" CreationDate="2014-10-22T08:00:17.253" Score="9" ViewCount="4626" Body="&lt;p&gt;I have been going through the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Picture-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; of &lt;code&gt;picture-mode&lt;/code&gt; and have been wondering if it's possible to draw a rectangle and connect it with another rectangle or something like that?&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="25" LastEditDate="2015-05-03T09:57:52.943" LastActivityDate="2015-05-03T09:57:52.943" Title="Example of drawing rectangle in picture-mode" Tags="|picture-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2429" PostTypeId="1" CreationDate="2014-10-22T08:08:01.990" Score="1" ViewCount="198" Body="&lt;p&gt;I'm trying to be able to answer to &quot;sublime users&quot; using a curated list of package, if not a working emacs config (like prelude or starter-kit does), but couldn't find any list or dotfiles for that on the web.&#xA;So looking around and from my packages and my very limited knowledge of sublime (from user questions), I gathered&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;emacs built-ins: show-paren, save-desktop, frame-restore, package, theme&lt;/li&gt;&#xA;&lt;li&gt;projectile (projects...)&lt;/li&gt;&#xA;&lt;li&gt;sr-speedbar (for inside window project tree)&lt;/li&gt;&#xA;&lt;li&gt;project-persist (save the project, switch project, save windows)&lt;/li&gt;&#xA;&lt;li&gt;ido-flx ( C-M-o to projectile-find-file with ido-flx for &quot;anything&quot;)&lt;/li&gt;&#xA;&lt;li&gt;anything-project &lt;/li&gt;&#xA;&lt;li&gt;smex&lt;/li&gt;&#xA;&lt;li&gt;recentf&lt;/li&gt;&#xA;&lt;li&gt;company (auto-complete)&lt;/li&gt;&#xA;&lt;li&gt;flycheck and its linters&lt;/li&gt;&#xA;&lt;li&gt;multi-occur (search in open buffers)&lt;/li&gt;&#xA;&lt;li&gt;iedit (&quot;mutiple cursor&quot;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As I guess many other emacs user had that question, and answered, I'm looking for what I missed and can use/suggest to sublime user looking for switching ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: &lt;strong&gt;If I'm to build a &quot;sublime-starter-kit&quot; emacs distribution like &quot;prelude&quot;&lt;/strong&gt; , what packages and features would I need other than those listed ?&lt;/p&gt;&#xA;" OwnerUserId="703" LastEditorUserId="703" LastEditDate="2014-10-24T12:31:42.780" LastActivityDate="2014-10-24T12:31:42.780" Title="Emacs dot files &amp; packages List for user switching from sublime and not founding a starter kit tailored for them" Tags="|package|customize|" AnswerCount="1" CommentCount="3" ClosedDate="2014-10-22T20:10:17.620" ContentLicense="CC BY-SA 3.0" />
  <row Id="2430" PostTypeId="2" ParentId="2427" CreationDate="2014-10-22T08:09:01.280" Score="0" Body="&lt;p&gt;It's perfectly possible to do because I do almost exactly that same thing myself. There are a couple of caveats though. First of all I have a locally patch xmlrpc.el &lt;a href=&quot;https://github.com/stsquad/xml-rpc/commits/extra-headers&quot; rel=&quot;nofollow&quot;&gt;library&lt;/a&gt;. This solves two problems, an incompatibility with modern emacs and the ability to pass authentication headers in the request. The data I'm processing is JSON in XML but you may be able to skip the XML step depending on your setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the heavy RPC lifting is done in &lt;a href=&quot;https://git.linaro.org/people/alex.bennee/lava-mode.git/blob/HEAD:/lava-rpc.el&quot; rel=&quot;nofollow&quot;&gt;lava-rpc.el&lt;/a&gt; but it shouldn't be hard to follow. You can see the call to submit a stringified piece of json &lt;a href=&quot;https://git.linaro.org/people/alex.bennee/lava-mode.git/blob/HEAD:/lava-mode.el#l99&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-10-22T08:09:01.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2431" PostTypeId="1" AcceptedAnswerId="2432" CreationDate="2014-10-22T08:57:17.377" Score="12" ViewCount="673" Body="&lt;p&gt;I created a keyboard macro to join lines in a buffer using:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;F3&lt;/kbd&gt; &lt;kbd&gt;C-n&lt;/kbd&gt; &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;join-line&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;F4&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works fine, except when lines get too long and start to wrap – which makes this macro dependent on the width of the frame. &lt;code&gt;next-line&lt;/code&gt; doesn’t seem to go to the next actual line, but to the “wrapping” part of the current line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to get around that issue?&lt;/p&gt;&#xA;" OwnerUserId="724" LastEditorUserId="504" LastEditDate="2014-10-23T09:55:09.903" LastActivityDate="2017-03-04T15:41:34.013" Title="How to handle next-line in keyboard macro?" Tags="|keyboard-macros|line-break|motion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2432" PostTypeId="2" ParentId="2431" CreationDate="2014-10-22T09:29:22.747" Score="14" Body="&lt;p&gt;You have &lt;strike&gt;two&lt;/strike&gt; &lt;strong&gt;three&lt;/strong&gt; options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;next-logical-line&lt;/code&gt; instead of &lt;code&gt;next-line&lt;/code&gt; when defining the macro:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Move cursor vertically down &lt;code&gt;ARG&lt;/code&gt; lines.&#xA;  This is identical to &lt;code&gt;next-line&lt;/code&gt;, except that it always moves&#xA;  by logical lines instead of visual lines, ignoring the value of&#xA;  the variable &lt;code&gt;line-move-visual&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set &lt;code&gt;line-move-visual&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq line-move-visual nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This makes &lt;code&gt;next-line&lt;/code&gt; behave like &lt;code&gt;next-logical-line&lt;/code&gt; by default.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Turn on line truncation by doing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;toggle-truncate-lines&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;before recording the macro.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-26T08:01:25.723" LastActivityDate="2015-01-26T08:01:25.723" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2433" PostTypeId="1" AcceptedAnswerId="2453" CreationDate="2014-10-22T10:31:48.130" Score="22" ViewCount="10564" Body="&lt;p&gt;With Emacs' doc-view-mode I can easily shrink/zoom/etc PDFs, however, I would like to be able to do the same thing with images. Currently when I open an image I cannot adjust the zoom level to fit it to the frame. I know there is &lt;code&gt;image-mode-fit-frame&lt;/code&gt;, however, it does not help when the image is larger than my screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a package or mode that will allow me zoom in and out on an image?&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="105" LastEditDate="2018-03-08T14:40:29.757" LastActivityDate="2020-09-01T19:08:52.650" Title="Shrink/Zoom/Scale images in image-mode" Tags="|images|image-mode|zooming|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2435" PostTypeId="2" ParentId="2410" CreationDate="2014-10-22T11:02:01.497" Score="11" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/stsquad/emacs_chrome&quot;&gt;&lt;code&gt;edit-server&lt;/code&gt;&lt;/a&gt; might be of some help. It lets you edit any text field inside Chrome with Emacs and then send the text back to the browser with minimum effort. Not exactly what you wanted, but its an improvement.&lt;/p&gt;&#xA;" OwnerUserId="246" LastEditorUserId="2057" LastEditDate="2014-10-23T08:23:17.533" LastActivityDate="2014-10-23T08:23:17.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2436" PostTypeId="1" CreationDate="2014-10-22T11:53:58.337" Score="0" ViewCount="502" Body="&lt;p&gt;Emacs 24.4 installed on OS X via homebrew: &lt;code&gt;brew install --with-gnutls --cocoa&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dropdown menus work fine with &lt;code&gt;&amp;lt;F10&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7A9KQ.png&quot; alt=&quot;Dropdown menus work fine with &amp;lt;code&amp;gt;&amp;lt;F10&amp;gt;&amp;lt;/code&amp;gt;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But fail when clicked on with the mouse:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6Wxyz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have recompiled as many files as I can, and the problem persists. Some clues, if not an outright solution, would be great. Is something else eating the mouse clicks? Might Helm be interfering?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My base Emacs configuration is prelude, but I am about to remove all my configuration and revert to a vanilla setup to see if I can make the dropdowns work.&lt;/p&gt;&#xA;" OwnerUserId="2211" LastEditorUserId="184" LastEditDate="2014-10-22T19:41:35.997" LastActivityDate="2014-10-23T05:49:55.073" Title="Dropdown Menus fail on mouse click with 'Wrong type argument'" Tags="|osx|menu-bar|emacs24.4|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2437" PostTypeId="1" CreationDate="2014-10-22T12:04:03.220" Score="5" ViewCount="168" Body="&lt;p&gt;When I run &lt;code&gt;hg commit&lt;/code&gt; (or &lt;code&gt;git commit&lt;/code&gt;, same difference...) from the command line without supplying a commit message it pops up an emacs buffer with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.&#xA;.&#xA;HG: Enter commit message.  Lines beginning with 'HG:' are removed.&#xA;HG: Leave message empty to abort commit.&#xA;HG: --&#xA;HG: user: Myself &amp;lt;me@example.com&amp;gt;&#xA;HG: branch 'default'&#xA;HG: changed filename&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I use Emacs' &lt;code&gt;C-x v v&lt;/code&gt; the message buffer is empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I have the vc message buffer pre-populated with useful information, but have it stripped out of the final message before commit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't have to be the message that mercurial (or git) supplies. In fact, in the case above I would prefer if a diffstat were included.&lt;/p&gt;&#xA;" OwnerUserId="2213" LastEditorUserId="50" LastEditDate="2014-10-23T08:29:54.187" LastActivityDate="2014-12-22T12:27:48.423" Title="Insert and strip helpful comments from vc commit message buffer" Tags="|git|version-control|mercurial|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2439" PostTypeId="2" ParentId="2428" CreationDate="2014-10-22T12:50:52.490" Score="14" Body="&lt;p&gt;Finally managed to draw some rectangles. These were the steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Enable picture mode via &lt;code&gt;M-x picture-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Write the content that you want to place inside each rectangle.&lt;/li&gt;&#xA;&lt;li&gt;Draw the rectangles by selecting rectangle regions around each piece of text and running the command &lt;code&gt;picture-draw-rectangle&lt;/code&gt; (bound to &lt;code&gt;C-c C-r&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Now connect them using commands available in &lt;code&gt;artist-mode&lt;/code&gt;. Enable artist minor mode via &lt;code&gt;M-x artist-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Now go near one rectangle and run the command &lt;code&gt;artist-key-set-point&lt;/code&gt; (&lt;code&gt;RET&lt;/code&gt;) and then continue to your destination rectangle to connect them and press &lt;code&gt;RET&lt;/code&gt; again.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Sample rectangles drawn using that method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   +------------+           +------------+&#xA;   | Rectangle1 |-----------+ Rectangle2 |&#xA;   +------------+           +------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would be happy to know if there are any other methods.&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="504" LastEditDate="2014-10-23T06:41:55.097" LastActivityDate="2014-10-23T06:41:55.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2440" PostTypeId="1" AcceptedAnswerId="2441" CreationDate="2014-10-22T14:06:32.383" Score="8" ViewCount="1941" Body="&lt;p&gt;Is it possible to mark all unread messages as read with a single key? &lt;kbd&gt;r&lt;/kbd&gt; marks only the selected message as read.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-22T16:05:50.273" LastActivityDate="2014-10-22T16:05:50.273" Title="Elfeed: mark all messages as read" Tags="|elfeed|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2441" PostTypeId="2" ParentId="2440" CreationDate="2014-10-22T15:08:23.787" Score="14" Body="&lt;p&gt;You can select the whole buffer and mark everything as read using the &lt;kbd&gt;r&lt;/kbd&gt; default binding in &lt;code&gt;elfeed-search-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also write a little function like below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun elfeed-mark-all-as-read ()&#xA;      (interactive)&#xA;      (mark-whole-buffer)&#xA;      (elfeed-search-untag-all-unread))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bind that to &lt;kbd&gt;R&lt;/kbd&gt; in &lt;code&gt;elfeed-search-mode-map&lt;/code&gt; if you wish.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(define-key elfeed-search-mode-map (kbd &quot;R&quot;) 'elfeed-mark-all-as-read)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that at the time of writing this, this mapping was unused in &lt;code&gt;elfeed-search-mode-map&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-22T15:55:30.123" LastActivityDate="2014-10-22T15:55:30.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2442" PostTypeId="2" ParentId="2411" CreationDate="2014-10-22T15:18:47.780" Score="4" Body="&lt;p&gt;OK Solving for the (async) example I've come up with this hack. It would be nice if I could automatically get the name of the source block rather than having to repeat it as a var.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Post-modify the org-result&#xA;#+name: simple-async-with-post-modify&#xA;#+begin_src emacs-lisp :var this-buffer=(buffer-name (current-buffer)) this-name=&quot;simple-async-with-post-modify&quot;&#xA;  (async-start&#xA;     ;; What to do in the child process&#xA;   `(lambda ()&#xA;     (message &quot;This is a test&quot;)&#xA;     (sleep-for 3)&#xA;     ,(async-inject-variables &quot;this-buffer&quot;)&#xA;     ,(async-inject-variables &quot;this-name&quot;)&#xA;     (list&#xA;        (cons 'buffer this-buffer)&#xA;        (cons 'name this-name)&#xA;        (cons 'result 222)))&#xA;&#xA;     ;; What to do when it finishes&#xA;   (lambda (result)&#xA;     (let ((buf (cdr (assoc 'buffer result)))&#xA;           (name (cdr (assoc 'name result)))&#xA;           (res (cdr (assoc 'result result))))&#xA;       (save-excursion&#xA;         (with-current-buffer buf&#xA;           (org-babel-goto-named-result name)&#xA;           (next-line)&#xA;           (goto-char (org-babel-result-end))&#xA;           (org-babel-insert-result (format &quot;we got: %s&quot; res)))))))&#xA;#+end_src&#xA;&#xA;#+RESULTS: simple-async-with-post-modify&#xA;: #&amp;lt;process emacs&amp;gt;&#xA;: we got: 222&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-10-22T15:18:47.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2443" PostTypeId="2" ParentId="2433" CreationDate="2014-10-22T15:31:34.980" Score="2" Body="&lt;p&gt;&lt;code&gt;image-transform-set-scale&lt;/code&gt; may be what you are looking for. However it requires Emacs to be compiled with Imagemagick support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a commented out &lt;code&gt;image-transform-mode&lt;/code&gt; in &lt;code&gt;image-mode.el&lt;/code&gt; labeled &quot;Not yet implemented.&quot;&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-22T15:31:34.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2444" PostTypeId="2" ParentId="2418" CreationDate="2014-10-22T15:46:44.050" Score="4" Body="&lt;p&gt;Your real question is how to make Emacs avoid the defective portion of your screen; the mode line and minibuffer are only what tends to end up unreadable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than moving them and leaving something else (like text) in the unreadable screen portion, the more clean and general solution is shrinking and moving the Emacs &lt;em&gt;frame&lt;/em&gt; (i.e. what's usually called a window) so that it's completely contained in the good region of the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As usual with Emacs, there are specific tools for that. The Maxframe library (&lt;a href=&quot;https://github.com/rmm5t/maxframe.el&quot; rel=&quot;nofollow&quot;&gt;Github home&lt;/a&gt;) is designed to automatically fill the whole screen with the Emacs frame, the opposite of what you need, but it exposes a useful &lt;code&gt;mf-set-frame-pixel-size&lt;/code&gt; function, which can be called from the init file along with the standard &lt;code&gt;set-frame-position&lt;/code&gt; function to place your frame in the proper position automatically when you open Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2113" LastActivityDate="2014-10-22T15:46:44.050" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2445" PostTypeId="1" AcceptedAnswerId="2446" CreationDate="2014-10-22T16:03:46.130" Score="9" ViewCount="2357" Body="&lt;p&gt;To prevent creation of a buffer every single time I enter a directory in dired I use this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(put 'dired-find-alternate-file 'disabled nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem now is that when I visit a file from dired pressing &lt;kbd&gt;RET&lt;/kbd&gt; and then kill it, dired buffer is killed too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to reuse dired buffer only for directories?&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2021-02-16T11:55:13.890" Title="Dired: only reuse buffer for directories" Tags="|dired|customize|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2446" PostTypeId="2" ParentId="2445" CreationDate="2014-10-22T16:25:30.917" Score="6" Body="&lt;p&gt;Load library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/emacs-en/download/dired%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;dired+.el&lt;/a&gt;). Then use &lt;code&gt;C-M-R&lt;/code&gt; (aka &lt;code&gt;C-M-S-r&lt;/code&gt;) to toggle whether Dired should reuse dired buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to turn this reuse on by default, do this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(diredp-toggle-find-file-reuse-dir 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-10-13T14:22:34.400" LastActivityDate="2017-10-13T14:22:34.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2449" PostTypeId="2" ParentId="2423" CreationDate="2014-10-22T17:04:14.470" Score="20" Body="&lt;h2&gt;TL;DR&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Before you set any variable, you must know how that variable is to be interpreted. Similarly, before you call any function (inluding those used to toggle minor modes), you must know how the arguments of that function are interpreted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; and &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; to look at the documentation for the function or variable in question.  It should specify the values that are expected.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Non-nil&quot; means &lt;em&gt;literally anything&lt;/em&gt; that is not &lt;code&gt;nil&lt;/code&gt;. This includes &lt;code&gt;0&lt;/code&gt; and negative numbers.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Minor Modes&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's take a specific example. Type &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;blink-cursor-mode&lt;/code&gt;  and hit &lt;kbd&gt;RET&lt;/kbd&gt; to see the function documentation for &lt;code&gt;blink-cursor-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(blink-cursor-mode &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Toggle cursor blinking (Blink Cursor mode). With a prefix argument&#xA;  ARG, enable Blink Cursor mode if ARG is positive, and disable it&#xA;  otherwise.  If called from Lisp, enable the mode if ARG is omitted or&#xA;  nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We can enable Blink Cursor mode in any of the following ways:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(blink-cursor-mode)           ; Omitted argument&#xA;(blink-cursor-mode 1)         ; Positive argument&#xA;(blink-cursor-mode t)         ; True argument&#xA;(blink-cursor-mode nil)       ; nil argument (don't use this)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that an argument of &lt;code&gt;t&lt;/code&gt; will work, even though the doc string didn't specifically mention it.  While this is often the case, your safest bet is to use what the doc string tells you to use, which in this case is a positive value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, notice that an argument of &lt;code&gt;nil&lt;/code&gt; will work.  I would strongly recommend against &lt;code&gt;nil&lt;/code&gt; in this way because it makes your intention unclear.  If I were skimming over your lisp code and I saw a &lt;code&gt;nil&lt;/code&gt; argument, I would assume that you wanted to disable the minor mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can also disable &lt;code&gt;blink-cursor-mode&lt;/code&gt; in the following ways:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(blink-cursor-mode 0)         ; Non-positive argument&#xA;(blink-cursor-mode -1)        ; Negative argument&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice again that &lt;code&gt;nil&lt;/code&gt; is &lt;strong&gt;not&lt;/strong&gt; one of the ways to disable this minor mode. This is true of almost any minor mode you will encounter.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Variables&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now let's look at an example of a variable.  Type &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;truncate-lines&lt;/code&gt; and hit &lt;kbd&gt;RET&lt;/kbd&gt; to look at the documentation for the variable &lt;code&gt;truncate-lines&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;truncate-lines is a variable defined in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Non-nil means do not display continuation lines. Instead, give each&#xA;  line of text just one screen line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can turn on truncation in any of the following ways:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq truncate-lines t)       ; Boolean true value (non-nil)&#xA;(setq truncate-lines 1)       ; Positive value (non-nil)&#xA;(setq truncate-lines 0)       ; Zero value (non-nil)&#xA;(setq truncate-lines -1)      ; Negative value (non-nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It may surprise you that the &lt;code&gt;0&lt;/code&gt; and the &lt;code&gt;-1&lt;/code&gt; will work. Again, I would recommend against using them because it makes your intentions unclear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way to disable truncation is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq truncate-lines nil)     ; nil value&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words you can set &lt;code&gt;truncate-lines&lt;/code&gt; equal to numbers, letters, strings, lists, or anything else you want, as long as it does not evaluate to &lt;code&gt;nil&lt;/code&gt; it will &lt;strong&gt;enable&lt;/strong&gt; truncation. (But you should really stick with &lt;code&gt;t&lt;/code&gt; or &lt;code&gt;1&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="45" LastEditDate="2014-10-22T23:31:17.193" LastActivityDate="2014-10-22T23:31:17.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2450" PostTypeId="5" CreationDate="2014-10-22T17:37:27.967" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/skeeto/elfeed&quot; rel=&quot;nofollow&quot;&gt;Elfeed&lt;/a&gt; is an extensible web feed reader for Emacs, supporting both Atom and RSS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It requires Emacs 24 and is available for download from &lt;a href=&quot;http://melpa.milkbox.net/&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt; or &lt;a href=&quot;https://github.com/dimitri/el-get&quot; rel=&quot;nofollow&quot;&gt;el-get&lt;/a&gt;. Elfeed was inspired by &lt;a href=&quot;http://notmuchmail.org/&quot; rel=&quot;nofollow&quot;&gt;notmuch&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-22T20:57:50.703" LastActivityDate="2014-10-22T20:57:50.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2451" PostTypeId="4" CreationDate="2014-10-22T17:37:27.967" Score="0" Body="Elfeed is an extensible web feed reader for Emacs, supporting both Atom and RSS." OwnerUserId="219" LastEditorUserId="219" LastEditDate="2014-10-22T20:45:15.737" LastActivityDate="2014-10-22T20:45:15.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2452" PostTypeId="2" ParentId="2429" CreationDate="2014-10-22T17:44:59.890" Score="3" Body="&lt;p&gt;My &lt;a href=&quot;http://tuhdo.github.io/&quot; rel=&quot;nofollow&quot;&gt;series of guides&lt;/a&gt; contain a lot of demos for cool features in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to look at my &lt;a href=&quot;http://tuhdo.github.io/emacs-tutor.html&quot; rel=&quot;nofollow&quot;&gt;mini manual&lt;/a&gt;, look at my &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot; rel=&quot;nofollow&quot;&gt;Helm guide&lt;/a&gt; and &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot; rel=&quot;nofollow&quot;&gt;Helm Projectile guide&lt;/a&gt; for many demos.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example: You can move between Semantic units of your programming language with &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt;. &lt;a href=&quot;http://tuhdo.github.io/static/part3/helm-semantic-or-imenu-2.gif&quot; rel=&quot;nofollow&quot;&gt;Demo&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow&quot;&gt;Emacs Prelude&lt;/a&gt; is a nice example of dot files and starter kit.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-22T17:44:59.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2453" PostTypeId="2" ParentId="2433" CreationDate="2014-10-22T17:48:59.693" Score="18" Body="&lt;p&gt;Such functionality is provied by packages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Image_002dDired.html&quot;&gt;&lt;code&gt;image-dired-thumbnail-mode&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With point in the thumbnail buffer, you can type &lt;kbd&gt;RET&lt;/kbd&gt; (&lt;code&gt;image-dired-display-thumbnail-original-image&lt;/code&gt;) to display a sized version of it in another window. &lt;strong&gt;This sizes the image to fit the window.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It uses ImageMagick's &lt;code&gt;convert&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;image-dired-external-viewer&lt;/code&gt; to avoid the problem and display your images in an external image viewer such as &lt;a href=&quot;http://feh.finalrewind.org/&quot;&gt;&lt;code&gt;feh&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/eimp.el&quot;&gt;&lt;code&gt;eimp&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'image-mode-hook 'eimp-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It uses the &lt;code&gt;mogrify&lt;/code&gt; utility from ImageMagick to do the actual transformations.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(kbd &quot;+&quot;) 'eimp-increase-image-size&#xA;(kbd &quot;-&quot;) 'eimp-decrease-image-size&#xA;(kbd &quot;&amp;lt;&quot;) 'eimp-rotate-image-anticlockwise&#xA;(kbd &quot;&amp;gt;&quot;) 'eimp-rotate-image-clockwise&#xA;(kbd &quot;B +&quot;) 'eimp-blur-image&#xA;(kbd &quot;B -&quot;) 'eimp-sharpen-image&#xA;(kbd &quot;B E&quot;) 'eimp-emboss-image&#xA;(kbd &quot;B G&quot;) 'eimp-gaussian-blur-image&#xA;(kbd &quot;B R&quot;) 'eimp-radial-blur-image&#xA;(kbd &quot;C B +&quot;) 'eimp-increase-image-brightness&#xA;(kbd &quot;C B -&quot;) 'eimp-decrease-image-brightness&#xA;(kbd &quot;C C +&quot;) 'eimp-increase-image-contrast&#xA;(kbd &quot;C C -&quot;) 'eimp-decrease-image-contrast&#xA;(kbd &quot;F ^&quot;) 'eimp-flip-image&#xA;(kbd &quot;F &amp;gt;&quot;) 'eimp-flop-image&#xA;(kbd &quot;F &amp;lt;&quot;) 'eimp-flop-image&#xA;(kbd &quot;N&quot;) 'eimp-negate-image&#xA;&#xA;; Commands most relevant to you:&#xA;(kbd &quot;S f&quot;) 'eimp-fit-image-to-window&#xA;(kbd &quot;S h&quot;) 'eimp-fit-image-height-to-window&#xA;(kbd &quot;S w&quot;) 'eimp-fit-image-width-to-window&#xA;&#xA;(kbd &quot;&amp;lt;right&amp;gt;&quot;) 'eimp-roll-image-right&#xA;(kbd &quot;&amp;lt;left&amp;gt;&quot;) 'eimp-roll-image-left&#xA;(kbd &quot;&amp;lt;up&amp;gt;&quot;) 'eimp-roll-image-up&#xA;(kbd &quot;&amp;lt;down&amp;gt;&quot;) 'eimp-roll-image-down&#xA;(kbd &quot;&amp;lt;down-mouse-1&amp;gt;&quot;) 'eimp-mouse-resize-image&#xA;(kbd &quot;&amp;lt;S-down-mouse-1&amp;gt;&quot;) 'eimp-mouse-resize-image-preserve-aspect&#xA;(kbd &quot;C-c C-k&quot;) 'eimp-stop-all&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/eiv.el&quot;&gt;&lt;code&gt;eiv&lt;/code&gt;&lt;/a&gt; - It also uses the ImageMagick package which should provide &lt;code&gt;mogrify&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Complete command list:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;eiv-fit-image-to-window&lt;/code&gt; - &lt;strong&gt;Resize image to current window size.&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;eiv-rotate-current-image&lt;/code&gt; - Rotate current image at 90 degrees.   &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;eiv-dec-or-inc-image&lt;/code&gt; - Resize image to current window size.   &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;eiv-diaporama&lt;/code&gt; - Start a diaporama on tree.    &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;eiv-viewer&lt;/code&gt; - The &lt;code&gt;emacs-image-viewer&lt;/code&gt;. Allows to navigate in a tree of dir and subdir.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="220" LastEditorUserId="504" LastEditDate="2014-10-22T21:46:44.640" LastActivityDate="2014-10-22T21:46:44.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2454" PostTypeId="1" CreationDate="2014-10-22T18:27:58.233" Score="5" ViewCount="527" Body="&lt;p&gt;I have both eldoc and flycheck enabled in a .el buffer.  I have a line, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-dirs (concat emacs-repos-dir &quot;internal&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, load-dirs is underlined by flycheck as an error, but if point is over load-dirs then eldoc will display the definition of 'setq' for about half a second before the flycheck message is printed.  How do I reduce this timeout?&lt;/p&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="50" LastEditDate="2014-10-23T13:48:04.667" LastActivityDate="2014-10-28T08:32:07.977" Title="have flycheck override eldoc faster" Tags="|flycheck|eldoc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2455" PostTypeId="2" ParentId="2427" CreationDate="2014-10-22T18:36:35.007" Score="57" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/pashky/restclient.el&quot; rel=&quot;noreferrer&quot;&gt;restclient&lt;/a&gt; is the most &quot;interactive&quot; mode.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a tool to manually explore and test HTTP REST webservices.&#xA;  Runs queries from a plain-text query sheet, displays results as a&#xA;  pretty-printed XML, JSON and even images.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/c4Jhi.png&quot; alt=&quot;restclient&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check a workflow example at &lt;a href=&quot;http://jakemccrary.com/blog/2014/07/04/using-emacs-to-explore-an-http-api/&quot; rel=&quot;noreferrer&quot;&gt;http://jakemccrary.com/blog/2014/07/04/using-emacs-to-explore-an-http-api/&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://tkf.github.io/emacs-request/&quot; rel=&quot;noreferrer&quot;&gt;request.el&lt;/a&gt; - HTTP swiss knife.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(request&#xA; &quot;http://httpbin.org/get&quot;&#xA; :params '((&quot;key&quot; . &quot;value&quot;) (&quot;key2&quot; . &quot;value2&quot;))&#xA; :parser 'json-read&#xA; :success (function*&#xA;           (lambda (&amp;amp;key data &amp;amp;allow-other-keys)&#xA;             (message &quot;I sent: %S&quot; (assoc-default 'args data)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/nicferrier/emacs-web&quot; rel=&quot;noreferrer&quot;&gt;emacs-web&lt;/a&gt; - &quot;The idea is to always use callbacks to collect the response.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The JSON callback form allows just data to be collected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;(require 'web)&#xA;&#xA;(web-json-post &#xA;  (lambda (data &amp;amp;rest stuff)&#xA;     (message &quot;%S&quot; data))&#xA;  :url &quot;https://httpbin.org/post&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="220" LastEditorUserId="724" LastEditDate="2017-04-01T14:36:16.000" LastActivityDate="2017-04-01T14:36:16.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2456" PostTypeId="1" AcceptedAnswerId="2487" CreationDate="2014-10-22T18:42:07.477" Score="8" ViewCount="2372" Body="&lt;p&gt;I noticed that I can't use virtualenvwrapper commands (like &lt;code&gt;workon&lt;/code&gt;) in an eshell but they do work within a shell environment. Is there a virtualenvwrapper-like mode for Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2199" LastEditorUserId="25" LastEditDate="2014-10-22T20:57:40.033" LastActivityDate="2014-10-23T12:19:08.573" Title="Using virtualenvwrapper in Eshell" Tags="|eshell|python|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2457" PostTypeId="1" CreationDate="2014-10-22T19:09:13.417" Score="3" ViewCount="143" Body="&lt;p&gt;My specific use case concerns the &quot;All Mail&quot; folder exposed by Gmail over IMAP.  I keep the folder permanently visible so I can search it when I need to, but I'm tired of pressing &lt;code&gt;c&lt;/code&gt; (&lt;code&gt;gnus-group-catchup-current&lt;/code&gt;) every time it gets new mail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked for a relevant group parameter in the manual, but couldn't find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can write an appropriate function and either add it to &lt;code&gt;gnus-group-update-group-hook&lt;/code&gt; or set the &lt;code&gt;gnus-group-update-group-function&lt;/code&gt;, but first I thought I'd ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a more idiomatic way?&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-12-27T13:20:04.050" Title="In Gnus, for a specific group, can I have all incoming messages automatically marked as read?" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2458" PostTypeId="2" ParentId="2433" CreationDate="2014-10-22T19:48:11.030" Score="9" Body="&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&lt;p&gt;I used the source code in &lt;code&gt;lisp/image-mode.el&lt;/code&gt; to write this up. Calling this function in any image buffer will resize it to fit to width or height depending on the image and window height/width ratios.&lt;/p&gt;&#xA;&lt;p&gt;You do need these 2 things for this function to work:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your Emacs needs to have been compiled with &lt;strong&gt;ImageMagick&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;By default &lt;code&gt;libjpeg&lt;/code&gt; loader is used to handle JPEG images. The hack shown in next part of this answer is used to force emacs to use &lt;code&gt;imagemagick&lt;/code&gt; loader.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre&gt;&#xA;(defun modi/image-transform-fit-to-window()&#xA;  &quot;Resize the image to fit the width or height based on the image and window ratios.&#xA;Imagemagick is required to run this function.&quot;&#xA;  (interactive)&#xA;  (let* ( (img-size (image-display-size (image-get-display-property) t))&#xA;          (img-width (car img-size))&#xA;          (img-height (cdr img-size))&#xA;          (img-h/w-ratio (/ (float img-height) (float img-width)))&#xA;          (win-width (- (nth 2 (window-inside-pixel-edges))&#xA;                        (nth 0 (window-inside-pixel-edges))))&#xA;          (win-height (- (nth 3 (window-inside-pixel-edges))&#xA;                         (nth 1 (window-inside-pixel-edges))))&#xA;          (win-h/w-ratio (/ (float win-height) (float win-width))))&#xA;    ;; Fit image by width if the h/w ratio of window is &gt; h/w ratio of the image&#xA;    (if (&gt; win-h/w-ratio img-h/w-ratio)&#xA;        (image-transform-fit-to-width)&#xA;      ;; Else fit by height&#xA;      (image-transform-fit-to-height))))&#xA;&lt;/pre&gt;&#xA;&lt;h2&gt;Hack to force Emacs to use ImageMagick for loading images&lt;/h2&gt;&#xA;&lt;p&gt;After following through the emacs bug reports &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18797&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;#18797&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10746&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;#10746&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10112&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;#10112&lt;/code&gt;&lt;/a&gt;, the following solution worked for forcing Imagemagick to load images; put it somewhere in your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;I have forced Emacs to use ImageMagick only for the image files familiar to me: PNG, TIFF, JPEG, SVG; the rest are kept as default. I have chosen to allow &lt;code&gt;gif&lt;/code&gt; files to be opened by the default loader as emacs 24.4 has improved support for viewing multi-frame images. The whole regexp is taken from &lt;code&gt;lisp/image.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; (setq image-type-header-regexps&#xA;       `(&#xA;         (&amp;quot;\\`/[\t\n\r ]*\\*.*XPM.\\*/&amp;quot; . xpm)&#xA;         (&amp;quot;\\`P[1-6]\\\(?:\&#xA;              \\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\&#xA;              \\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\&#xA;              \\)\\{2\\}&amp;quot; . pbm)&#xA;         (&amp;quot;\\`GIF8[79]a&amp;quot; . gif)&#xA;         ;; (&amp;quot;\\`\x89PNG\r\n\x1a\n&amp;quot; . png) ;; Uncomment this (and comment the below line) to enable inline PNG images in org-mode&#xA;         (&amp;quot;\\`\x89PNG\r\n\x1a\n&amp;quot; . imagemagick) ; PNG&#xA;         (&amp;quot;\\`[\t\n\r ]*#define \\([a-z0-9_]+\\)_width [0-9]+\n\&#xA;              #define \\1_height [0-9]+\n\\(\&#xA;              #define \\1_x_hot [0-9]+\n\&#xA;              #define \\1_y_hot [0-9]+\n\\)?\&#xA;              static \\(unsigned \\)?char \\1_bits&amp;quot; . xbm)&#xA;         ;; (&amp;quot;\\`\\(?:MM\0\\*\\|II\\*\0\\)&amp;quot; . tiff)&#xA;         (&amp;quot;\\`\\(?:MM\0\\*\\|II\\*\0\\)&amp;quot; . imagemagick) ; TIFF&#xA;         (&amp;quot;\\`[\t\n\r ]*%!PS&amp;quot; . postscript)&#xA;         ;; (&amp;quot;\\`\xff\xd8&amp;quot; . jpeg) ;; Uncomment this (and comment the below line) to enable inline JPEG images in org-mode&#xA;         (&amp;quot;\\`\xff\xd8&amp;quot; . imagemagick)    ; JPEG&#xA;         (&amp;quot;\\`\377\330&amp;quot; . imagemagick)    ; JPEG&#xA;         (,(let* ((incomment-re &amp;quot;\\(?:[^-]\\|-[^-]\\)&amp;quot;)&#xA;                  (comment-re (concat &amp;quot;\\(?:!--&amp;quot; incomment-re &amp;quot;*--&amp;gt;[ \t\r\n]*&amp;lt;\\)&amp;quot;)))&#xA;             (concat &amp;quot;\\(?:&amp;lt;\\?xml[ \t\r\n]+[^&amp;gt;]*&amp;gt;\\)?[ \t\r\n]*&amp;lt;&amp;quot;&#xA;                     comment-re &amp;quot;*&amp;quot;&#xA;                     &amp;quot;\\(?:!DOCTYPE[ \t\r\n]+[^&amp;gt;]*&amp;gt;[ \t\r\n]*&amp;lt;[ \t\r\n]*&amp;quot; comment-re &amp;quot;*\\)?&amp;quot;&#xA;                     &amp;quot;[Ss][Vv][Gg]&amp;quot;))&#xA;          ;; . svg)  ;; Uncomment this (and comment the below line) to enable inline SVG images in org-mode&#xA;          . imagemagick) ; SVG&#xA;         ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;Drawback&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Image types chosen to be loaded by ImageMagick will not show up as inline images in Org mode.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;References&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/image-transform-fit-to-width&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;image-transform-fit-to-width&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/image-transform-fit-to-height&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;image-transform-fit-to-height&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Emacs bug reports: &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18797&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;#18797&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10746&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;#10746&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10112&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;#10112&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="2506" LastEditDate="2020-09-01T19:08:52.650" LastActivityDate="2020-09-01T19:08:52.650" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2459" PostTypeId="1" AcceptedAnswerId="2460" CreationDate="2014-10-22T19:52:37.337" Score="8" ViewCount="2496" Body="&lt;p&gt;Similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/275/dired-quick-view-key-to-preview-the-file-at-point&quot;&gt;this question&lt;/a&gt;, I'd like a tool/minor mode to quickly preview my files by merely having the cursor positioned over them (e.g. the currently selected file is displayed in the active buffer window). I don't care about depressing events and I don't want an overlay. If it's selected, I want it displayed in the active window. Pressing enter and switching to the buffer is too slow to skim through a bunch of raw data files. How could I do this?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-08-27T10:06:57.913" Title="Rapidly preview files" Tags="|buffers|cycling|previewing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2460" PostTypeId="2" ParentId="2459" CreationDate="2014-10-22T20:47:10.537" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/q/19907939/729907&quot;&gt;This StackOverflow question&lt;/a&gt; is the same as yours.  And the &lt;a href=&quot;https://stackoverflow.com/a/19933337/729907&quot;&gt;accepted answer&lt;/a&gt; by the OP is a good one.  There are other good answers there, as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2013-10/msg00304.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this question&lt;/a&gt; to help-gnu-emacs@gnu.org is essentially the same also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My own answer to both questions is to use &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; and to define this command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;    (defun my-find-file ()&#xA;      &quot;Like `icicle-find-file', but alt action views file temporarily.&#xA;    Alternate action keys such as `C-S-down' visit the candidate file in&#xA;    `view-mode' and kill the buffer of the last such viewed candidate.&quot;&#xA;      (interactive)&#xA;      (let ((icicle-candidate-alt-action-fn&#xA;             (lambda (file)&#xA;               (when (and my-last-viewed&#xA;                          (get-file-buffer my-last-viewed))&#xA;                 (kill-buffer (get-file-buffer my-last-viewed)))&#xA;               (setq my-last-viewed  (abbreviate-file-name file))&#xA;               (view-file file)&#xA;               (select-frame-set-input-focus&#xA;                  (window-frame (active-minibuffer-window))))))&#xA;        (icicle-find-file-of-content)))&#xA;&#xA;    (defvar my-last-viewed nil&#xA;      &quot;Last file viewed by alternate action of `my-find-file'.&quot;)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;M-x my-find-file&lt;/code&gt; (or bind it to a key - e.g., &lt;code&gt;C-x C-f&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Optionally type part of a file name, to limit the matching names.&lt;/li&gt;&#xA;&lt;li&gt;Optionally use &lt;code&gt;down&lt;/code&gt; or &lt;code&gt;up&lt;/code&gt; to cycle among file names.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;C-S-down&lt;/code&gt; to visit the next file in order.&lt;/li&gt;&#xA;&lt;li&gt;Repeat #4 to see other files in order.&lt;/li&gt;&#xA;&lt;li&gt;Repeat #2 or #3 to see other sets of files.&lt;/li&gt;&#xA;&lt;li&gt;End with &lt;code&gt;RET&lt;/code&gt; to choose a file to visit or &lt;code&gt;C-g&lt;/code&gt; to cancel.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;See the linked posts for more info.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-22T20:47:10.537" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2461" PostTypeId="1" AcceptedAnswerId="2471" CreationDate="2014-10-22T20:56:22.770" Score="33" ViewCount="8050" Body="&lt;p&gt;Is it possible to simulate an arbitrary key event from elisp?  I am aware of ways that I can find the binding for a given key, and then call that command interactively, but what if that key event is not bound to a command?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As &lt;em&gt;one example&lt;/em&gt;, what if I wanted to bind &lt;code&gt;C-`&lt;/code&gt; to behave the same as the &lt;code&gt;ESC&lt;/code&gt; key &lt;em&gt;in all contexts&lt;/em&gt;?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="105" LastEditDate="2015-07-11T04:56:58.200" LastActivityDate="2015-07-11T04:56:58.200" Title="How can I simulate an arbitary key event from Elisp?" Tags="|elisp|key-bindings|events|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2462" PostTypeId="2" ParentId="2445" CreationDate="2014-10-22T20:58:26.420" Score="6" Body="&lt;p&gt;If you get used to the fact that &lt;kbd&gt;a&lt;/kbd&gt; replaces the current (dired) buffer with the selected file/directory, then you're not limited by a default approach; you just use the option you want at the time.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-10-22T20:58:26.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2463" PostTypeId="2" ParentId="2459" CreationDate="2014-10-22T21:02:16.290" Score="11" Body="&lt;p&gt;I discovered this functionality is already built-in to &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;Helm&lt;/a&gt;. To use it, use the up and down arrows and press C-up/C-down.&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="9322" LastEditDate="2015-08-27T10:06:57.913" LastActivityDate="2015-08-27T10:06:57.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2464" PostTypeId="2" ParentId="2461" CreationDate="2014-10-22T21:25:35.800" Score="4" Body="&lt;p&gt;Taken from &lt;a href=&quot;https://stackoverflow.com/a/4535803/2499035&quot;&gt;this answer&lt;/a&gt;, you can use global-set-key like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-`&quot;) (kbd &quot;&amp;lt;escape&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will treat &lt;code&gt;C-`&lt;/code&gt; as &lt;kbd&gt;escape&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does seem to have some problems though if the second combination doesn't execute a function. So if &lt;kbd&gt;escape&lt;/kbd&gt; is being used like &lt;code&gt;Meta&lt;/code&gt;, then it doesn't work correctly. But it seems to work for commands bound to functions.&lt;/p&gt;&#xA;" OwnerUserId="2088" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-10-22T21:31:56.253" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2465" PostTypeId="5" CreationDate="2014-10-22T22:51:57.793" Score="0" Body="&lt;p&gt;Font Lock mode is a minor mode, always local to a particular buffer, which assigns faces to the text in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Each buffer's major mode tells Font Lock mode which text to fontify; for instance, programming language modes fontify syntactically relevant constructs like comments, strings, and function names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Font Lock mode is enabled by default. To toggle it in the current buffer, type &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;font-lock-mode&lt;/code&gt;. A positive numeric argument unconditionally enables Font Lock mode, and a negative or zero argument disables it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;global-font-lock-mode&lt;/code&gt; to toggle Font Lock mode in all buffers. To impose this setting for future Emacs sessions, customize the variable global-font-lock-mode (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html#Easy-Customization&quot; rel=&quot;nofollow&quot;&gt;Easy Customization&lt;/a&gt;), or add the following line to your init file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-font-lock-mode 0)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-23T03:14:41.160" LastActivityDate="2014-10-23T03:14:41.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2466" PostTypeId="4" CreationDate="2014-10-22T22:51:57.793" Score="0" Body="Font Lock mode is a minor mode, always local to a particular buffer, which assigns faces to the text in the buffer." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-23T03:14:51.263" LastActivityDate="2014-10-23T03:14:51.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2467" PostTypeId="5" CreationDate="2014-10-22T22:53:35.967" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/&quot; rel=&quot;nofollow&quot;&gt;Babel: active code in Org-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Evaluating-code-blocks.html#Evaluating-code-blocks&quot; rel=&quot;nofollow&quot;&gt;Org-mode manual: section 14.5&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html&quot; rel=&quot;nofollow&quot;&gt;How to Use Emacs Org-Babel Mode to Write Literate Programming Document in R Language&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-23T03:14:30.653" LastActivityDate="2014-10-23T03:14:30.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2468" PostTypeId="4" CreationDate="2014-10-22T22:53:35.967" Score="0" Body="feature of Org mode that handles source code for multiple languages. It can execute source code from within Org mode documents, making it convenient for producing literate programming documents and managing reproducible research. Note that Org-babel is now incorporated into Org-mode as 'working with source code' and no longer a separate extension." OwnerUserId="45" LastEditorUserId="14920" LastEditDate="2021-02-03T10:14:44.583" LastActivityDate="2021-02-03T10:14:44.583" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2469" PostTypeId="5" CreationDate="2014-10-22T23:01:14.020" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-22T23:01:14.020" LastActivityDate="2014-10-22T23:01:14.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2470" PostTypeId="4" CreationDate="2014-10-22T23:01:14.020" Score="0" Body="Questions about search mechanics inside of Emacs. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-23T03:14:48.067" LastActivityDate="2014-10-23T03:14:48.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2471" PostTypeId="2" ParentId="2461" CreationDate="2014-10-23T00:14:37.313" Score="28" Body="&lt;p&gt;You can feed arbitrary events (keystrokes, mouse clicks, etc.) to the command loop by putting them onto &lt;code&gt;unread-command-events&lt;/code&gt;.  For example, the following will cause the command loop to execute a break the next time it is run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq unread-command-events (listify-key-sequence &quot;\C-g&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this only feeds events to the command loop, so it will do nothing interesting if you're looping in your own code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A different approach, which you seem to be aware of, is to find the function a given key is bound to, and execute it yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall (global-key-binding &quot;\C-g&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will execute the command immediately.  Beware, however, that some commands have different behaviour depending on whether they are called interactively, such as defaulting arguments.  You'll want to compensate for that by using &lt;code&gt;call-interactively&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-interactively (global-key-binding &quot;\C-g&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-10-23T00:14:37.313" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2472" PostTypeId="2" ParentId="383" CreationDate="2014-10-23T00:40:06.657" Score="8" Body="&lt;p&gt;Since Emacs is extensible, any feature that's missing in Emacs can be added by suitable ELisp packages.  The important differences are internal:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;XEmacs uses proper opaque types for characters, events, keymaps etc. where Emacs uses integers and lists;&lt;/li&gt;&#xA;&lt;li&gt;XEmacs has extents as a unifying abstraction where Emacs has text properties and overlays.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since XEmacs is mostly unmaintained nowadays, it is well worth working around the minor deficiencies in Emacs' type system and use the maintained version.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-10-23T00:40:06.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2473" PostTypeId="2" ParentId="2461" CreationDate="2014-10-23T03:11:30.130" Score="14" Body="&lt;p&gt;The simplest way I know of is just to use &lt;code&gt;execute-kbd-macro&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo () (interactive) (execute-kbd-macro (kbd &quot;&amp;lt;escape&amp;gt;&quot;)))&#xA;(global-set-key (kbd &quot;C-`&quot;) 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-10-23T04:36:33.450" LastActivityDate="2014-10-23T04:36:33.450" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2474" PostTypeId="2" ParentId="2461" CreationDate="2014-10-23T03:49:47.003" Score="2" Body="&lt;p&gt;After reading the suggestion from &lt;a href=&quot;https://emacs.stackexchange.com/a/2471/93&quot;&gt;jch&lt;/a&gt; to use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Event-Input-Misc.html#index-unread_002dcommand_002devents-1448&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;unread-command-events&lt;/code&gt;&lt;/a&gt;, I was able to hack together a solution that will do some of the things that I am looking for.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-simulate-key-event (event &amp;amp;optional N)&#xA;  &quot;Simulate an arbitrary keypress event.&#xA;&#xA;This function sets the `unread-command-events' variable in order to simulate a&#xA;series of key events given by EVENT. Can also For negative N, simulate the&#xA;specified key EVENT directly.  For positive N, removes the last N elements from&#xA;the list of key events in `this-command-keys' and then appends EVENT.  For N nil,&#xA;treat as N=1.&quot;&#xA;  (let ((prefix (listify-key-sequence (this-command-keys)))&#xA;         (key (listify-key-sequence event))&#xA;         (n (prefix-numeric-value N)))&#xA;     (if (&amp;lt; n 0)&#xA;         (setq prefix key)&#xA;       (nbutlast prefix n)&#xA;       (nconc prefix key))&#xA;       (setq unread-command-events prefix)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are still a number of kinks to work out.  Namely, I don't get the correct result if I call this function twice in a row within a single &lt;code&gt;defun&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Side Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After checking out &lt;a href=&quot;https://emacs.stackexchange.com/questions/2461/how-can-i-simulate-an-arbitary-key-event-from-elisp?noredirect=1#comment3252_2461&quot;&gt;phils'&lt;/a&gt; suggestion to use &lt;code&gt;key-translation-map&lt;/code&gt; I was able to find &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-local_002dfunction_002dkey_002dmap-1627&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;local-function-key-map&lt;/code&gt;&lt;/a&gt; which is also very helpful in achieving some of my broader goals.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-10-23T03:49:47.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2475" PostTypeId="2" ParentId="2285" CreationDate="2014-10-23T04:08:29.803" Score="2" Body="&lt;p&gt;I don't think what you ask for is supported by org-mode. As far as I know, org-mode manages one TOC per export, the only exceptions being for tables or figures listings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do suggest is a somehow manual solution, if you really want the TOC code generated automatically. Once all the subsections are defined, export each section in which you want a subheadings TOC as a subtree export (&lt;code&gt;C-s&lt;/code&gt; in the &lt;code&gt;C-c C-e&lt;/code&gt; export menu), asking for a 1-level TOC (your &lt;code&gt;#+TOC&lt;/code&gt; line). Export in a buffer, and copy the TOC code, then insert it back in your document, enclosed in convenient markup (corresponding to what you export to).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on the export backend, this makes sense or doesn't. For LaTeX, I suggest looking for &lt;code&gt;\tableofcontents&lt;/code&gt; options.&lt;/p&gt;&#xA;" OwnerUserId="2047" LastActivityDate="2014-10-23T04:08:29.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2476" PostTypeId="1" AcceptedAnswerId="2505" CreationDate="2014-10-23T05:35:05.383" Score="2" ViewCount="2156" Body="&lt;p&gt;Any suggestions on how to disable completion-at-point in Emacs shell (see below)?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion-in-Buffers.html&quot; rel=&quot;nofollow&quot;&gt;GNU docs on the relevant hook&lt;/a&gt; (which is oddly named) - completion-at-point-functions - but given that the hook's value is simply a list of available functions, it's not clear to me how I can use it as a toggle.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to be able to have my &lt;code&gt;TAB&lt;/code&gt; key back when using the Emacs shell.  I'd also be okay with turning off &lt;code&gt;completion-at-point-functions&lt;/code&gt; globally (since I'm an &lt;code&gt;ido&lt;/code&gt; junkie) but I'm not sure how to do that for global minor modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As reference, this is the window I'm referring to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Click &amp;lt;mouse-2&amp;gt; on a completion to select it.&#xA;In this buffer, type RET to select the completion near point.&#xA;&#xA;Possible completions are:&#xA;CLUTTER_IM_MODULE   DBUS_SESSION_BUS_ADDRESS    DEFAULTS_PATH&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="105" LastEditDate="2015-05-14T00:34:49.257" LastActivityDate="2015-05-14T00:34:49.257" Title="How to disable completion-at-point in emacs shell (i.e., so I can have my `TAB` key back)?" Tags="|key-bindings|completion|shell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2477" PostTypeId="2" ParentId="2436" CreationDate="2014-10-23T05:49:55.073" Score="1" Body="&lt;p&gt;You have two problems in one question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, the error message on mouse event in your screenshots is likely to be caused by your configuration, you should try to isolate it by dichotomy (comment out half of your init file, see if the problem still appears, etc.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the fact that &lt;code&gt;emacs -Q&lt;/code&gt; does not provide mouse support. That seems to imply that mouse support needs to be enabled somehow. Several functions for this purpose seem to exist (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text_002dOnly-Mouse.html#Text_002dOnly-Mouse&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;xterm-mouse-mode&lt;/code&gt;: enables very basic mouse functionality (&quot;only non-modified single-mouse clicks&quot;); as you noticed, it also uses the old menus with &lt;code&gt;tmm&lt;/code&gt;, rather than the new one that appears with &lt;code&gt;&amp;lt;f10&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;t-mouse-support&lt;/code&gt;, alias for &lt;code&gt;gpm-mouse-support&lt;/code&gt;: if your system has &lt;a href=&quot;http://en.wikipedia.org/wiki/GPM_(software)&quot; rel=&quot;nofollow noreferrer&quot;&gt;gpm&lt;/a&gt; running, and if your emacs was compiled with gpm, enable mouse support in the terminal. This is reportedly only for GNU/Linux, &lt;a href=&quot;https://serverfault.com/questions/104494/the-way-to-use-mouse-over-ssh-on-mac-osx&quot;&gt;it appears to be available for mac if you use X11&lt;/a&gt; (I have no idea how hard to achieve it is).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;None of this provides multi-platform, out-of-the-box mouse support. On the other hand, Drew reported that on w32, it works with &lt;code&gt;emacs -Q&lt;/code&gt;. Mouse support indeed seems to be &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/MS_002dDOS-Mouse.html#MS_002dDOS-Mouse&quot; rel=&quot;nofollow noreferrer&quot;&gt;handled differently&lt;/a&gt; in w32 consoles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that the manual doesn't seem to mention anything more, I will go with a guess: the &quot;if your terminal supports a mouse&quot; in the news corresponds to having one of the mouse modes enabled (either dos mouse, xterm mouse or gpm mouse). Then the news is not about supporting the mouse out of the box, but rather about having it work for the menus &lt;em&gt;as well&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why not use a graphical frame? &lt;code&gt;:)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="-1" LastEditDate="2017-04-13T12:14:55.040" LastActivityDate="2014-10-23T05:49:55.073" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2478" PostTypeId="2" ParentId="2384" CreationDate="2014-10-23T06:03:38.450" Score="10" Body="&lt;p&gt;You can use an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Structure-of-code-blocks.html&quot;&gt;inline babel code block&lt;/a&gt;&#xA;and the lisp function &lt;strong&gt;org-table-get-remote-range&lt;/strong&gt; for getting access to table ranges like in the following example (the number 3 after the source block is what it produced when C-c C-c is executed on it)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  #+TBLNAME: table1&#xA;  | Name    | Points |&#xA;  |---------+--------|&#xA;  | Andreas |      5 |&#xA;  | Barbara |      8 |&#xA;  | Carl    |      7 |&#xA;  |---------+--------|&#xA;  | Total   |     20 |&#xA;  #+TBLFM: @5$2=vsum(@I..@II)&#xA;&#xA;  Now I insert in the text the number of names in the above table: &#xA;  src_emacs-lisp[:results raw]{(length (org-table-get-remote-range &quot;table1&quot; &quot;@I$1..@II$1&quot; ))} 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2014-10-23T06:03:38.450" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2479" PostTypeId="2" ParentId="2437" CreationDate="2014-10-23T06:23:17.757" Score="4" Body="&lt;p&gt;&lt;code&gt;C-x v v&lt;/code&gt; does not call &lt;code&gt;hg commit&lt;/code&gt; as you'd do from the terminal.  Instead it lets you enter a message first, and only then runs &lt;code&gt;hg commit -m MESSAGE&lt;/code&gt; with the &lt;strong&gt;whole&lt;/strong&gt; message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, if you'd like to have some message in that buffer, you'd need to implement it yourself.  You'd need to define a new major mode &lt;code&gt;vc-hg-log-edit-mode&lt;/code&gt;, deriving from &lt;code&gt;log-edit-mode&lt;/code&gt;.  VC will automatically use this major mode for Mercurial commit messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the mode function you can then call out to Mercurial to obtain a diffstat and insert that into the buffer.  Before committing, you need to remove this again, lest it ends up in the commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, your mode needs to have a keymap which overrides the original &lt;code&gt;log-edit-done&lt;/code&gt; binding at &lt;code&gt;C-c C-c&lt;/code&gt;.  Your own binding would first remove whatever you inserted automatically into the buffer, and then call real &lt;code&gt;log-edit-done&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="504" LastEditDate="2014-10-23T06:48:33.253" LastActivityDate="2014-10-23T06:48:33.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2480" PostTypeId="2" ParentId="2456" CreationDate="2014-10-23T06:27:09.407" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/jorgenschaefer/pyvenv&quot; rel=&quot;nofollow&quot;&gt;pyvenv&lt;/a&gt; lets you use a virtualenv from within Emacs.  Note however that due to some limitations of Emacs this package switches your &lt;strong&gt;entire&lt;/strong&gt; Emacs session to a specific virtualenv.  If I remember correctly, it is not possible to switch just one buffer to a virtualenv.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-23T06:27:09.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2481" PostTypeId="2" ParentId="2410" CreationDate="2014-10-23T08:25:17.400" Score="8" Body="&lt;p&gt;I'm using &lt;code&gt;w3m&lt;/code&gt; to submit this answer from within Emacs.  The StackExchange sites don't look very nice in w3m, but submitting forms works just fine.  (I've not been able to submit an answer with the new &lt;code&gt;eww&lt;/code&gt; browser.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't recommend actually doing this, because it seems rather painful compared to using a regular browser with a Emacs-like bindings (e.g. keysnail for Firefox).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I had to solve a captcha to submit my answer.  Unfortunately, no captcha was shown in the w3m buffer, so I had to visit the captcha URL in a traditional browser.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-10-23T08:30:32.073" LastActivityDate="2014-10-23T08:30:32.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2482" PostTypeId="2" ParentId="2410" CreationDate="2014-10-23T09:16:20.013" Score="1" Body="&lt;p&gt;I have been using &lt;a href=&quot;https://github.com/kazu-yamamoto/Firemacs&quot; rel=&quot;nofollow&quot;&gt;Firemacs&lt;/a&gt; and have been very happy with it. It is a firefox extension which gives you emacs keybinding. It supports many keybindings including kill and yank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be installed from &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/firemacs/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="904" LastEditDate="2014-12-04T17:29:54.247" LastActivityDate="2014-12-04T17:29:54.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2483" PostTypeId="1" AcceptedAnswerId="2601" CreationDate="2014-10-23T10:16:34.913" Score="5" ViewCount="2715" Body="&lt;p&gt;This is tangentially related to my previous question on &lt;a href=&quot;https://emacs.stackexchange.com/questions/2411/returning-org-babel-results-from-an-asynchronous-call&quot;&gt;dealing with asynchronous babel scripts&lt;/a&gt;. Currently I have to manually specify the name of the src block the babel function is in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: elisp-block-name&#xA;#+begin_src emacs-lisp :var src=&quot;elisp-block-name&quot;&#xA;(format &quot;My src-block is %s&quot; src)&#xA;#+end_src&#xA;&#xA;#+RESULTS: elisp-block-name&#xA;: My src-block is elisp-block-name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously this is prone to error so it would be nice to generate it programmaticaly. Is there any environment/variables always passed to tangled block that indicates this or do I need to just call some elisp for my :var block?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2018-08-25T05:19:45.620" Title="Referring to the org-babel src block name from within the script" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2484" PostTypeId="1" AcceptedAnswerId="2489" CreationDate="2014-10-23T11:24:34.123" Score="5" ViewCount="375" Body="&lt;p&gt;Emacs buttonizes specific expression in the buffers. For example, email ids, urls attachments in gnus buffer, and [back], [forward] in help buffers and so on. When we click on those with mouse, they act appropriately. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to know which function is called when clicking (with mouse) on such a buttons?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h k&lt;/code&gt; isn't of much help here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; this question is already answered. The reason I wanted to know is to bind keys like firefox to go back and forth in the history of help buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I have the following in my &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key help-mode-map (kbd &quot;M-&amp;lt;left&amp;gt;&quot;) 'help-go-back)&#xA;(define-key help-mode-map (kbd &quot;M-&amp;lt;right&amp;gt;&quot;) 'help-go-forward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="224" LastEditorUserId="105" LastEditDate="2014-10-23T16:09:21.740" LastActivityDate="2014-10-23T16:18:05.857" Title="how to reveal function names that are bound to mouse buttons (eg &lt;down-mouse-1&gt;)?" Tags="|key-bindings|mouse|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2485" PostTypeId="2" ParentId="2388" CreationDate="2014-10-23T11:37:50.407" Score="2" Body="&lt;p&gt;Your org is too old. These functions were added to pre8 version of org. Upgrade your org package to version 8 and org-table should be automatically included.&lt;/p&gt;&#xA;" OwnerUserId="903" LastActivityDate="2014-10-23T11:37:50.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2486" PostTypeId="1" CreationDate="2014-10-23T11:57:27.030" Score="11" ViewCount="1158" Body="&lt;p&gt;Getting tired of the poor editing capabilities of software like &lt;a href=&quot;http://www.omegat.org/&quot; rel=&quot;nofollow&quot;&gt;OmegaT&lt;/a&gt;, I would like to know if there is a way to turn Emacs into a CAT (Computer-Assisted Translation) tool. I was thinking about writing a major-mode, but feel free to share your ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, this is what I need:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs must be able to identify a segment (i.e.: a sentence ending with a full stop) already translated and suggest the translation. This implies the creation of a translation memory (a .tmx file, for example) which contains all the original segments and the translated segments;&lt;/li&gt;&#xA;&lt;li&gt;The translator must be able to create and edit a glossary of terms and Emacs should suggest the translation if the term is in the current segment;&lt;/li&gt;&#xA;&lt;li&gt;Emacs should be able to recognize the formatting of the original file (i.e.: bold, italic, different fonts size, tables) in order to keep the formatting as close as possible to the original file when exporting the translation;&lt;/li&gt;&#xA;&lt;li&gt;Emacs should ideally be able to export the translated document into the same format as the original.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Are any of these requirements actually possible or am I just hoping for something out of reach?&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="2731" LastEditDate="2016-01-06T03:10:45.557" LastActivityDate="2020-03-12T13:21:46.493" Title="Emacs as a CAT (Computer-Assisted Translation) tool" Tags="|translation|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2487" PostTypeId="2" ParentId="2456" CreationDate="2014-10-23T12:19:08.573" Score="6" Body="&lt;p&gt;&lt;code&gt;virtualenvwrapper&lt;/code&gt; (in melpa) gives the command &lt;code&gt;venv-workon&lt;/code&gt; to switch environment, but for all emacs session too. It works with eshell with &lt;code&gt;venv-initialize-eshell&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;support for eshell is turned on by calling venv-initialize-eshell.&#xA;  After doing this, any new eshells you launch will be in the correct&#xA;  virtualenv and have access to installed executables, etc. The mode&#xA;  also provides a variety of virtualenvwrapper commands that work&#xA;  identically to their bash/zsh counterparts (described in detail&#xA;  below). Note that in contrast to how interactive shells work, Eshell&#xA;  shares an environment with Emacs, so if you activate or deactivate in&#xA;  one, the other is affected as well. Note that this requires the&#xA;  variable eshell-modify-global-environment to be set to true. Running&#xA;  venv-initialize-eshell causes this to occur. If this doesn't work for&#xA;  you, open an issue! It's technically possible to separate the two, but&#xA;  it requires some hacking around with the different namespaces that I&#xA;  won't bother to do unless someone really needs it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and on modifying the eshell prompt:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Eshell prompt customization&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You also might want to have the name of your current virtualenv appear&#xA;  on the eshell prompt. You can do this by a pretty similar mechanism,&#xA;  just include venv-current-name in your eshell-prompt-function&#xA;  somewhere. Here is a simple example of a prompt that includes the&#xA;  current virtualenv name followed by a dollar sign:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(setq eshell-prompt-function&#xA;      (lambda ()&#xA;        (concat venv-current-name &quot; $ &quot;)))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Make sure you also adjust your eshell-prompt-regexp if you do this.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;More about customizing the eshell prompt on the EmacsWiki.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Works with (e)shells, has auto-activation, displays in the mode line.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://wikemacs.org/index.php/Python#See_also&quot; rel=&quot;noreferrer&quot;&gt;http://wikemacs.org/index.php/Python#See_also&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/porterjamesj/virtualenvwrapper.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/porterjamesj/virtualenvwrapper.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would be interested to know the differences betwwen it and pyvenv.&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2014-10-23T12:19:08.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2488" PostTypeId="2" ParentId="275" CreationDate="2014-10-23T12:44:51.090" Score="1" Body="&lt;p&gt;I gave my solution in this SO question &lt;a href=&quot;https://stackoverflow.com/questions/26409768/how-to-show-buffer-content-in-real-time-in-other-window-when-focus-is-in-buffer&quot;&gt;https://stackoverflow.com/questions/26409768/how-to-show-buffer-content-in-real-time-in-other-window-when-focus-is-in-buffer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and my answer is to change the behaviour of the navigation keys &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; to show the file at point in another window. Focus stays in the dired buffer and we kill the visited buffer when we carry on browsing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I created a minor-mode to enable/disable this feature easily. Note that we still have the arrows keys for «normal» navigation. Call &lt;code&gt;M-x dired-show-mode&lt;/code&gt; (or &lt;code&gt;ranger-mode&lt;/code&gt; since this is a feature I discovered in the &lt;a href=&quot;http://ranger.nongnu.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ranger&lt;/a&gt; file manager).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code: (any review and bug report appreciated !)&#xA;&lt;a href=&quot;https://gitlab.com/emacs-stuff/my-elisp/blob/master/dired-show.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gitlab.com/emacs-stuff/my-elisp/blob/master/dired-show.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defgroup dired-show nil&#xA;  &quot;See the file at point when browsing in a Dired buffer.&quot;&#xA;  :group 'dired&#xA;  )&#xA;&#xA;(setq show-next-current-buffer nil)&#xA;&#xA;(defun show-next ()&#xA;     (interactive)&#xA;     (next-line 1)&#xA;     (dired-find-file-other-window)&#xA;     (if show-next-current-buffer (kill-buffer show-next-current-buffer))&#xA;     (setq show-next-current-buffer (current-buffer))&#xA;     (other-window 1)&#xA;     )&#xA;&#xA;(defun show-previous ()&#xA;     (interactive)&#xA;     (previous-line 1)&#xA;     (dired-find-file-other-window)&#xA;     (if show-next-current-buffer (kill-buffer show-next-current-buffer))&#xA;     (setq show-next-current-buffer (current-buffer))&#xA;     (other-window 1)&#xA;     )&#xA;&#xA;&#xA;(define-minor-mode dired-show-mode&#xA;  &quot;Toggle preview of files when browsing in a Dired buffer.&quot;&#xA;  :global t&#xA;  :group 'dired-show&#xA;  (if dired-show-mode&#xA;      (progn&#xA;        (define-key dired-mode-map &quot;n&quot; 'show-next)&#xA;        (define-key dired-mode-map &quot;p&quot; 'show-previous)&#xA;        )&#xA;  (define-key dired-mode-map &quot;n&quot; 'diredp-next-line)&#xA;  (define-key dired-mode-map &quot;p&quot; 'diredp-previous-line)&#xA;  ))&#xA;&#xA;(defalias 'ranger-mode 'dired-show-mode)&#xA;&#xA;(provide 'dired-show)&#xA;;;; dired-show ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="739" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-05-12T21:27:08.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2489" PostTypeId="2" ParentId="2484" CreationDate="2014-10-23T12:50:46.267" Score="9" Body="&lt;p&gt;You can view a considerable amount of information about buttons (and other text properties and overlays) by placing point on them and using &lt;code&gt;what-cursor-position&lt;/code&gt; with a prefix arg, that is, &lt;code&gt;C-u C-x =&lt;/code&gt;. The help page this brings up has links describing the button information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, take the &lt;code&gt;[back]&lt;/code&gt; buttons in &lt;code&gt;*Help*&lt;/code&gt;. &lt;code&gt;C-u C-x =&lt;/code&gt; with point on that button brings up an help page listing various text properties: click on the link next to &lt;code&gt;category&lt;/code&gt; and you should see something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Category help-back-button:&#xA;&#xA;  action               help-button-action&#xA;  evaporate            t&#xA;  face                 button&#xA;  follow-link          t&#xA;  help-echo            [Show]&#xA;  help-function        help-xref-go-back&#xA;  keymap               [Show]&#xA;  mouse-face           highlight&#xA;  rear-nonsticky       t&#xA;  supertype            help-xref&#xA;  type                 help-back&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see that the action function is &lt;code&gt;help-button-action&lt;/code&gt; (which as it happens will look at some of the other properties here to decide what to do).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that this all has more to do with &lt;em&gt;buttons&lt;/em&gt; than the mouse itself. Using the keyboard will fire the same function.)&lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="913" LastEditDate="2014-10-23T16:18:05.857" LastActivityDate="2014-10-23T16:18:05.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2490" PostTypeId="1" AcceptedAnswerId="2491" CreationDate="2014-10-23T13:27:45.540" Score="9" ViewCount="15539" Body="&lt;p&gt;From the &lt;a href=&quot;https://github.com/senny/emacs-eclim&quot; rel=&quot;noreferrer&quot;&gt;Emacs Eclim&lt;/a&gt; github page:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Install emacs-eclim. You have two options:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Installation from the MELPA package archive.&lt;/p&gt;&#xA;&lt;p&gt;Just add the archive to package-archives if you&#xA;haven't already, and&lt;/p&gt;&#xA;&lt;p&gt;then install emacs-eclim with the package-install&#xA;command.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Manual installation from GitHub.&lt;/p&gt;&#xA;&lt;p&gt;(git clone git://github.com/senny/emacs-eclim.git)&lt;/p&gt;&#xA;&lt;p&gt;Add (add-to-list 'load-path &amp;quot;/path/to/emacs-eclim/&amp;quot;) to your&#xA;startup script.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;If followed the first option and:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Added the following package-archives to my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives '((&amp;quot;gnu&amp;quot; . &amp;quot;http://elpa.gnu.org/packages/&amp;quot;)&#xA;                         (&amp;quot;marmalade&amp;quot; . &amp;quot;http://marmalade-repo.org/packages/&amp;quot;)&#xA;                         (&amp;quot;melpa&amp;quot; . &amp;quot;http://melpa.milkbox.net/packages/&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then typed &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;package-install&lt;/code&gt; and hit &lt;kbd&gt;RET&lt;/kbd&gt; and the following message poped up:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Install package: emacs-eclim [No Match]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Why does this error pop up?&lt;/p&gt;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2020-11-11T15:43:54.430" Title="package-install reports &quot;no match&quot;" Tags="|package|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2491" PostTypeId="2" ParentId="2490" CreationDate="2014-10-23T13:37:30.693" Score="24" Body="&lt;p&gt;Maybe refreshing package contents could help: try evaluating &lt;code&gt;(package-refresh-contents)&lt;/code&gt; or typing &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;package-refresh-contents&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="45" LastEditDate="2014-10-23T20:32:16.647" LastActivityDate="2014-10-23T20:32:16.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2492" PostTypeId="5" CreationDate="2014-10-23T13:41:48.670" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Terminal-emulator.html#Terminal-emulator&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ansi Term&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html#Term-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Key bindings&lt;/a&gt; for &lt;a href=&quot;/questions/tagged/term-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;term-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html#Shell-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Key bindings&lt;/a&gt; for &lt;a href=&quot;/questions/tagged/shell-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2118" LastEditorUserId="7045" LastEditDate="2017-03-02T13:51:40.340" LastActivityDate="2017-03-02T13:51:40.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2493" PostTypeId="4" CreationDate="2014-10-23T13:41:48.670" Score="0" Body="is for the Emacs ansi terminal emulator. Emacs supports ANSI-standard VT100-style escape sequences recognized by such modern terminals as xterm. `M-x ansi-term` command starts a terminal, which by default runs in a sub-shell in a buffer named `*ansi-term*` with `term-mode`. " OwnerUserId="2118" LastEditorUserId="7045" LastEditDate="2017-03-02T13:51:45.603" LastActivityDate="2017-03-02T13:51:45.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2494" PostTypeId="2" ParentId="2084" CreationDate="2014-10-23T13:48:18.790" Score="0" Body="&lt;p&gt;A possible solution would be to have a permanent interpreter live in a dedicated buffer (sort-of like the &lt;code&gt;*compilation*&lt;/code&gt; buffer, but where the underlying process would never return). You could then have a &lt;code&gt;recompile&lt;/code&gt;-like command to send a predefined compilation command to the interpreter, and display the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a tentative implementation of such a strategy. The &lt;code&gt;persistent-compile&lt;/code&gt; command takes care both of the initialization of the process (when it is called for the first time or with a prefix argument), and the recompilation (if the interpreter process is already up and running). Compilation results are displayed in a &lt;code&gt;*persistent-compilation*&lt;/code&gt; buffer, put in &lt;code&gt;compilation-shell-minor-mode&lt;/code&gt; to benefit from the usual &lt;code&gt;compilation-mode&lt;/code&gt; features to navigate between errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example usage, along with the resulting contents of the &lt;code&gt;*persistent-compilation*&lt;/code&gt; buffer: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;persistent-compile&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;/bin/bash&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;FOO=bar&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;echo $FOO&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ FOO=bar&#xA;$ echo $FOO&#xA;bar&#xA;$&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;persistent-compile&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo $FOO&#xA;bar&#xA;$&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Beware, the following code wasn't tested much. For example, I'm not sure what happens when you try recompiling before the termination of the previous compilation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar persistent-compile-interpreter &quot;/bin/bash&quot;&#xA;  &quot;Interpreter to be used for persistent compilations.&quot;)&#xA;&#xA;(defvar persistent-compile-init &quot;&quot;&#xA;  &quot;Initialization command for persistent compilations.&quot;)&#xA;&#xA;(defvar persistent-compile-command &quot;make -k&quot;&#xA;  &quot;Compilation command for persistent compilations.&quot;)&#xA;&#xA;;; Local variable in the persistent compilation buffer&#xA;(defvar persistent-compile--next-action)&#xA;&#xA;(defun persistent-compile (&amp;amp;optional edit-command)&#xA;  &quot;(Re-)run a persistent compilation.&#xA;&#xA;The first time a persistent compilation is run, the user is asked&#xA;for an interpreter, an initialization command and a compilation&#xA;command.&#xA;The interpreter is started and optionally set up with the&#xA;initialization command.  The compilation command is then sent to&#xA;the interpreter.&#xA;&#xA;All subsequent recompilations are sent to the same,&#xA;already-initialized interpreter, so as to keep the customized&#xA;environment.&#xA;&#xA;If EDIT-COMMAND is non-nil, the user can edit the&#xA;parameters (interpreter, initialization command and compilation&#xA;command) and the interpreter is restarted.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (when (or edit-command&#xA;            (null (get-buffer &quot;*persistent-compilation*&quot;))&#xA;            (not persistent-compile-interpreter)&#xA;            (not persistent-compile-init)&#xA;            (not persistent-compile-command))&#xA;    (setq persistent-compile-interpreter (read-from-minibuffer &quot;Interpreter: &quot;&#xA;                                                               persistent-compile-interpreter)&#xA;          persistent-compile-init        (read-from-minibuffer &quot;Initialization command: &quot;&#xA;                                                               persistent-compile-init)&#xA;          persistent-compile-command     (read-from-minibuffer &quot;Command: &quot;&#xA;                                                               persistent-compile-command)))&#xA;  (with-current-buffer (get-buffer-create &quot;*persistent-compilation*&quot;)&#xA;    (if (and edit-command&#xA;             (get-buffer-process (current-buffer)))&#xA;        ;; Kill an existing process and schedule for a recompilation with&#xA;        ;; the new parameters&#xA;        (progn&#xA;          (set-process-sentinel&#xA;           (get-buffer-process (current-buffer))&#xA;           (lambda (process event)&#xA;             (persistent-recompile nil)))&#xA;          (kill-process (get-buffer-process (current-buffer))))&#xA;&#xA;      (if (not (get-buffer-process (current-buffer)))&#xA;          ;; Start and initialize a new process&#xA;          (progn&#xA;            (erase-buffer)&#xA;            (make-comint-in-buffer &quot;persistent-compile&quot; (current-buffer) persistent-compile-interpreter)&#xA;            (compilation-shell-minor-mode 1)&#xA;            (make-local-variable 'persistent-compile--next-action)&#xA;            (setq persistent-compile--next-action 'persistent-compile--initialize)&#xA;            (add-hook 'comint-output-filter-functions 'persistent-compile--at-prompt))&#xA;&#xA;        ;; Run command&#xA;        (erase-buffer)&#xA;        (persistent-compile--send-command)))))&#xA;&#xA;(defun persistent-compile--at-prompt (&amp;amp;optional output)&#xA;  (when persistent-compile--next-action&#xA;    ;; There is probably a better way of checking whether we are&#xA;    ;; just after a prompt, but I didn't find it...&#xA;    (let ((p1 (point))&#xA;          (p2 (save-excursion (comint-bol))))&#xA;      (unless (= p1 p2)&#xA;        (let ((action persistent-compile--next-action))&#xA;          (setq persistent-compile--next-action nil)&#xA;          (funcall action))))))&#xA;&#xA;(defun persistent-compile--initialize ()&#xA;  (setq persistent-compile--next-action 'persistent-compile--send-command)&#xA;  (display-buffer (current-buffer))&#xA;  (insert persistent-compile-init)&#xA;  (comint-send-input nil t))&#xA;&#xA;(defun persistent-compile--send-command ()&#xA;  (display-buffer (current-buffer))&#xA;  (insert persistent-compile-command)&#xA;  (comint-send-input nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-10-23T13:48:18.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2495" PostTypeId="1" CreationDate="2014-10-23T14:07:59.700" Score="3" ViewCount="1973" Body="&lt;p&gt;When I install emacs-eclimd, I get two errors &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/ac-emacs-eclim-source.el at Thu Oct 23 09:47:40 2014&#xA;Entering directory `/home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/'&#xA;ac-emacs-eclim-source.el:33:1:Error: Cannot open load file: auto-complete&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/company-emacs-eclim.el at Thu Oct 23 09:47:40 2014&#xA;company-emacs-eclim.el:34:1:Error: Cannot open load file: company&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and a bunch of warnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't figure out  the output of compilation by searching. Do I need to do something to fix the errors and warnings and others? &#xA;I wonder if I have successfully installed the package? Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The complete output of compilation is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Leaving directory `/home/tim/.emacs.d/elpa/emacs-eclim-20140809.207'&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/ac-emacs-eclim-source.el at Thu Oct 23 09:47:40 2014&#xA;Entering directory `/home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/'&#xA;ac-emacs-eclim-source.el:33:1:Error: Cannot open load file: auto-complete&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/company-emacs-eclim.el at Thu Oct 23 09:47:40 2014&#xA;company-emacs-eclim.el:34:1:Error: Cannot open load file: company&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclim-ant.el at Thu Oct 23 09:47:40 2014&#xA;&#xA;In eclim-ant-validate:&#xA;eclim-ant.el:91:8:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In end of data:&#xA;eclim-ant.el:105:21:Warning: the function&#xA;    `eclim--convert-find-result-to-string' is not known to be defined.&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclim-completion.el at Thu Oct 23 09:47:40 2014&#xA;&#xA;In eclim--completion-candidates-filter:&#xA;eclim-completion.el:75:52:Warning: function `search' from cl package called at&#xA;    runtime&#xA;eclim-completion.el:76:51:Warning: function `search' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim--completion-action-java:&#xA;eclim-completion.el:183:74:Warning: reference to free variable&#xA;    `yas-minor-mode'&#xA;&#xA;In eclim--completion-action-xml:&#xA;eclim-completion.el:199:61:Warning: reference to free variable&#xA;    `yas-minor-mode'&#xA;&#xA;In eclim--completion-action-default:&#xA;eclim-completion.el:206:56:Warning: reference to free variable&#xA;    `yas-minor-mode'&#xA;&#xA;In eclim--completion-documentation:&#xA;eclim-completion.el:234:100:Warning: function `find' from cl package called at&#xA;    runtime&#xA;&#xA;In end of data:&#xA;eclim-completion.el:239:1:Warning: the function `yas/expand-snippet' is not&#xA;    known to be defined.&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclim-java.el at Thu Oct 23 09:47:40 2014&#xA;&#xA;In eclim--java-parse-method-signature:&#xA;eclim-java.el:156:44:Warning: `flet' is an obsolete macro (as of 24.3); use&#xA;    either `cl-flet' or `cl-letf'.&#xA;&#xA;In eclim-soft-revert-imports:&#xA;eclim-java.el:427:4:Warning: `flet' is an obsolete macro (as of 24.3); use&#xA;    either `cl-flet' or `cl-letf'.&#xA;eclim-java.el:427:4:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;eclim-java.el:433:36:Warning: `end-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In eclim-java-import:&#xA;eclim-java.el:460:4:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In format-type:&#xA;eclim-java.el:484:106:Warning: function `mapcan' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim-java-implement:&#xA;eclim-java.el:517:108:Warning: `flet' is an obsolete macro (as of 24.3); use&#xA;    either `cl-flet' or `cl-letf'.&#xA;eclim-java.el:523:30:Warning: function `reduce' from cl package called at&#xA;    runtime&#xA;eclim-java.el:506:77:Warning: function `mapcan' from cl package called at&#xA;    runtime&#xA;eclim-java.el:518:77:Warning: function `remove-if-not' from cl package called&#xA;    at runtime&#xA;eclim-java.el:527:86:Warning: function `find' from cl package called at&#xA;    runtime&#xA;eclim-java.el:527:128:Warning: function `subseq' from cl package called at&#xA;    runtime&#xA;eclim-java.el:527:128:Warning: function `remove-if-not' from cl package called&#xA;    at runtime&#xA;eclim-java.el:529:66:Warning: function `find' from cl package called at&#xA;    runtime&#xA;eclim-java.el:529:66:Warning: function `remove-if' from cl package called at&#xA;    runtime&#xA;eclim-java.el:529:98:Warning: function `remove-if' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim-java-correct:&#xA;eclim-java.el:578:13:Warning: assignment to free variable&#xA;    `eclim-corrections-previous-window-config'&#xA;eclim-java.el:580:13:Warning: assignment to free variable&#xA;    `eclim-correction-command-info'&#xA;&#xA;In eclim-java-correct-choose:&#xA;eclim-java.el:599:15:Warning: `string-to-int' is an obsolete function (as of&#xA;    22.1); use `string-to-number' instead.&#xA;eclim-java.el:601:19:Warning: reference to free variable&#xA;    `eclim-correction-command-info'&#xA;eclim-java.el:602:35:Warning: reference to free variable&#xA;    `eclim-corrections-previous-window-config'&#xA;&#xA;In eclim-java-correct-quit:&#xA;eclim-java.el:619:29:Warning: reference to free variable&#xA;    `eclim-corrections-previous-window-config'&#xA;&#xA;In eclim--java-show-documentation-and-format:&#xA;eclim-java.el:656:19:Warning: reference to free variable&#xA;    `eclim-java-show-documentation-history'&#xA;eclim-java.el:656:19:Warning: assignment to free variable&#xA;    `eclim-java-show-documentation-history'&#xA;&#xA;In eclim-java-show-documentation-follow-link:&#xA;eclim-java.el:714:35:Warning: function `some' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim--java-show-documentation-go-back:&#xA;eclim-java.el:722:16:Warning: reference to free variable&#xA;    `eclim-java-show-documentation-history'&#xA;eclim-java.el:722:16:Warning: assignment to free variable&#xA;    `eclim-java-show-documentation-history'&#xA;&#xA;In end of data:&#xA;eclim-java.el:727:1:Warning: the function `yas/expand-snippet' is not known to&#xA;    be defined.&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclim-maven.el at Thu Oct 23 09:47:40 2014&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclim-problems.el at Thu Oct 23 09:47:41 2014&#xA;&#xA;In eclim-problems-highlight:&#xA;eclim-problems.el:170:133:Warning: function `remove-if-not' from cl package&#xA;    called at runtime&#xA;&#xA;In eclim--problems-get-current-problem:&#xA;eclim-problems.el:189:24:Warning: function `find-if' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim--with-problems-list:&#xA;eclim-problems.el:210:15:Warning: function `gensym' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim-problems-buffer-refresh:&#xA;eclim-problems.el:229:90:Warning: function `remove-if-not' from cl package&#xA;    called at runtime&#xA;eclim-problems.el:229:90:Warning: function `remove-if-not' from cl package&#xA;    called at runtime&#xA;eclim-problems.el:229:90:Warning: function `remove-if-not' from cl package&#xA;    called at runtime&#xA;eclim-problems.el:229:90:Warning: function `remove-if-not' from cl package&#xA;    called at runtime&#xA;&#xA;In eclim--problems-cleanup-filename:&#xA;eclim-problems.el:232:61:Warning: reference to free variable `problem'&#xA;&#xA;In eclim--problems-buffer-redisplay:&#xA;eclim-problems.el:258:21:Warning: Use `with-current-buffer' rather than&#xA;    save-excursion+set-buffer&#xA;&#xA;In eclim--problems-filtered:&#xA;eclim-problems.el:292:4:Warning: function `remove-if-not' from cl package&#xA;    called at runtime&#xA;&#xA;In eclim--insert-problem:&#xA;eclim-problems.el:296:70:Warning: function `position' from cl package called&#xA;    at runtime&#xA;&#xA;In eclim-problems-next:&#xA;eclim-problems.el:387:21:Warning: reference to free variable `hl-line-overlay'&#xA;&#xA;In eclim-problems-previous:&#xA;eclim-problems.el:396:21:Warning: reference to free variable `hl-line-overlay'&#xA;&#xA;In end of data:&#xA;eclim-problems.el:446:1:Warning: the function `hl-line-move' is not known to&#xA;    be defined.&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclim-project.el at Thu Oct 23 09:47:41 2014&#xA;&#xA;In eclim--project-buffer-refresh:&#xA;eclim-project.el:103:17:Warning: `goto-line' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In eclim--project-get-marked:&#xA;eclim-project.el:133:45:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In eclim-project-create:&#xA;eclim-project.el:251:62:Warning: assignment to free variable `target'&#xA;eclim-project.el:251:77:Warning: assignment to free variable `application'&#xA;eclim-project.el:252:50:Warning: reference to free variable `target'&#xA;eclim-project.el:252:50:Warning: reference to free variable `application'&#xA;&#xA;In eclim-project-mark-all:&#xA;eclim-project.el:295:4:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In eclim-project-unmark-all:&#xA;eclim-project.el:307:4:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In eclim-project-goto:&#xA;eclim-project.el:319:33:Warning: function `find' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim-project-mode:&#xA;eclim-project.el:370:33:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclim.el at Thu Oct 23 09:47:41 2014&#xA;&#xA;In eclim--make-command:&#xA;eclim.el:153:61:Warning: function `reduce' from cl package called at runtime&#xA;&#xA;In eclim--call-process-async:&#xA;eclim.el:196:71:Warning: function `find' from cl package called at runtime&#xA;eclim.el:206:118:Warning: function `remove-if' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim--args-contains:&#xA;eclim.el:224:84:Warning: function `find' from cl package called at runtime&#xA;&#xA;In eclim--project-name:&#xA;eclim.el:345:39:Warning: `labels' is an obsolete macro (as of 24.3); use&#xA;    `cl-labels' instead.&#xA;&#xA;In eclim--find-file:&#xA;eclim.el:362:8:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;eclim.el:370:10:Warning: `beginning-of-buffer' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In eclim--find-display-results:&#xA;eclim.el:375:125:Warning: function `remove-if' from cl package called at&#xA;    runtime&#xA;&#xA;In eclim--visit-declaration:&#xA;eclim.el:401:46:Warning: `goto-line' used from Lisp code&#xA;That command is designed for interactive use only&#xA;&#xA;In eclim--accepted-filename-p:&#xA;eclim.el:494:8:Warning: function `member-if' from cl package called at runtime&#xA;&#xA;In end of data:&#xA;eclim.el:545:1:Warning: the function `archive-extract' is not known to be&#xA;    defined.&#xA;&#xA;Compiling file /home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/eclimd.el at Thu Oct 23 09:47:41 2014&#xA;&#xA;In wait-eclimd-start:&#xA;eclimd.el:112:54:Warning: assignment to free variable `eclimd-port'&#xA;eclimd.el:113:5:Warning: reference to free variable `eclimd-port'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There is error when running &lt;code&gt;(require 'eclimd)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;eclimd&quot;)&#xA;  require(eclimd)&#xA;  eval((require (quote eclimd)) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="120" LastEditorUserId="50" LastEditDate="2014-10-23T15:42:37.540" LastActivityDate="2014-11-22T21:00:36.360" Title="Error while installing emacs-eclimd &quot;Cannot open load file: auto-complete&quot;" Tags="|package|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2496" PostTypeId="1" AcceptedAnswerId="2498" CreationDate="2014-10-23T14:28:11.990" Score="3" ViewCount="834" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I switch to a new buffer with &lt;code&gt;ido&lt;/code&gt; without needing to confirm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I open up a lot of temporary buffers to do scratchpad work.  When &lt;code&gt;ido-switch-buffer&lt;/code&gt; can't find a match for the buffer name I'm entering in the minibuffer (because, as per use case, it's a new one), it asks me to confirm that I really wanted this unknown buffer.  I'd rather not have that extra step (admittedly small) to break my concentration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I presume there is a setting I'm missing, but how do I turn off the &quot;confirm&quot; query?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-23T15:06:09.410" Title="how to switch to a new buffer with ido without needing to confirm?" Tags="|ido|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2497" PostTypeId="1" AcceptedAnswerId="2519" CreationDate="2014-10-23T14:43:59.647" Score="14" ViewCount="1103" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get new &lt;em&gt;buffers&lt;/em&gt; to honor the mapping in &lt;code&gt;auto-mode-alist&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When finding a &lt;em&gt;file&lt;/em&gt;, Emacs compares the file extension to the &lt;code&gt;auto-mode-alist&lt;/code&gt; to determine which major mode to use for the file's buffer.  Is there a way to use the information in &lt;code&gt;auto-mode-alist&lt;/code&gt; to determine the mode for a buffer that does not (yet) have a file associated with it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is: if I open a new &lt;em&gt;buffer&lt;/em&gt; whose name has something that looks like a file extension, can I get it to open automatically in the expected mode?  For example, if I were to open a new buffer &lt;code&gt;a-new-buffer.el&lt;/code&gt; that is not yet associated with a file, I want it to open in &lt;code&gt;emacs-lisp-mode&lt;/code&gt; rather than in the default mode.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-25T13:22:18.387" Title="how to get buffers (not just files) to honor auto-mode-alist?" Tags="|buffers|major-mode|" AnswerCount="6" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2498" PostTypeId="2" ParentId="2496" CreationDate="2014-10-23T15:00:16.983" Score="7" Body="&lt;p&gt;Found the answer to this question with some additional digging, but I'll leave it up in case others have this question in the future.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable in question is &lt;code&gt;confirm-nonexistent-file-or-buffer&lt;/code&gt;.  It looks like the default is &lt;code&gt;after-completion&lt;/code&gt;, but setting it to &lt;code&gt;nil&lt;/code&gt; turns of the confirmation request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable is relevant not just for &lt;code&gt;ido&lt;/code&gt; and family, but also for a wider range of functions like &lt;code&gt;switch-to-buffer&lt;/code&gt; and &lt;code&gt;find-file&lt;/code&gt;.  Rather than change the default everywhere, we can  turn off confirmation for just this one functionwith a little bit of advice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice ido-switch-buffer (around no-confirmation activate)&#xA;  (let ((confirm-nonexistent-file-or-buffer nil))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-23T15:00:16.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2499" PostTypeId="2" ParentId="2496" CreationDate="2014-10-23T15:06:09.410" Score="3" Body="&lt;p&gt;Set &lt;code&gt;ido-create-new-buffer&lt;/code&gt; variable to &lt;code&gt;(quote always)&lt;/code&gt;&#xA; using customize, or by adding &lt;code&gt;(setq ido-create-new-buffer 'always)&lt;/code&gt; to your init file.&lt;/p&gt;&#xA;" OwnerUserId="724" LastActivityDate="2014-10-23T15:06:09.410" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2500" PostTypeId="2" ParentId="2497" CreationDate="2014-10-23T15:19:47.507" Score="5" Body="&lt;p&gt;The &lt;code&gt;set-auto-mode&lt;/code&gt; function sets the mode based on the file associated with a buffer. Here's a function that temporarily sets &lt;code&gt;buffer-file-name&lt;/code&gt; from the buffer name in order to set the mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/set-buffer-mode (buffer &amp;amp;optional again)&#xA;  &quot;Set the mode for BUFFER from the name.  &#xA;When called repeatedly for the same buffer only set the mode the first&#xA;time, unless the optional argument AGAIN is specified.&#xA;Does nothing if the buffer is associated with a file.&quot;&#xA;&#xA;  (with-current-buffer buffer&#xA;    (when again (kill-local-variable 'my/buffer-mode-set))&#xA;    (unless (or buffer-file-name &#xA;            (local-variable-p 'my/buffer-mode-set))&#xA;      (let ((buffer-file-name (buffer-name)))&#xA;        (set-auto-mode t)&#xA;        (setq-local my/buffer-mode-set t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can run this when a buffer is renamed using advice: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice rename-buffer (after my/rename-update-mode activate)&#xA;  (my/set-buffer-mode (current-buffer) 'again))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure about the best place to hook this in to affect new buffers. Here I'm using the &lt;code&gt;buffer-list-update-hook&lt;/code&gt;, but that gets called in more cases than we need. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'buffer-list-update-hook&#xA;      '(lambda ()&#xA;         (my/set-buffer-mode (car (buffer-list)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-10-23T21:11:23.387" LastActivityDate="2014-10-23T21:11:23.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2501" PostTypeId="1" AcceptedAnswerId="2547" CreationDate="2014-10-23T15:47:06.780" Score="46" ViewCount="60458" Body="&lt;p&gt;I can't set Inconsolata as default font in Emacs 24.4 Linux.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I changed the font in the menu -&amp;gt; Save options. The font changed but after a&#xA;restart the font is the same as it was by default.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Added this to &lt;code&gt;~/.Xresources&lt;/code&gt;:  &lt;code&gt;Emacs.font: Inconsolata LGC&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then in &lt;code&gt;init.el&lt;/code&gt;: &lt;code&gt;(set-default-font &amp;quot;Inconsolata LGC&amp;quot;)&lt;/code&gt;. Same story.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;What I'm doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2230" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2020-12-01T17:56:20.790" Title="How can I set default font in Emacs?" Tags="|fonts|linux|" AnswerCount="6" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2502" PostTypeId="1" AcceptedAnswerId="2507" CreationDate="2014-10-23T15:50:14.193" Score="6" ViewCount="1045" Body="&lt;p&gt;Inside org-mode, RETURN is bound to &lt;code&gt;(org-return &amp;amp;optional INDENT)&lt;/code&gt;. This command apparently ignores &lt;code&gt;C-u&lt;/code&gt; numeric prefixes and so if you want to enter 10 newlines, you can't just type &lt;code&gt;C-u 1 0 RET&lt;/code&gt; and have it work. You can do &lt;code&gt;C-u 1 0 M-x newline&lt;/code&gt; and get expected behavior, but I would like to know if there's a simpler set of default keystrokes?&lt;/p&gt;&#xA;" OwnerUserId="466" LastEditorUserId="25" LastEditDate="2014-12-25T00:23:13.410" LastActivityDate="2015-01-02T02:23:02.630" Title="How to insert a specific number of newlines in org-mode" Tags="|org-mode|text-editing|newlines|insert|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2503" PostTypeId="2" ParentId="2501" CreationDate="2014-10-23T15:52:14.073" Score="32" Body="&lt;p&gt;I use this in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Set default font&#xA;(set-face-attribute 'default nil&#xA;                    :family &quot;Source Code Pro&quot;&#xA;                    :height 110&#xA;                    :weight 'normal&#xA;                    :width 'normal)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could try the same using Inconsolata instead of Source Code Pro.&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2014-10-23T15:52:14.073" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2504" PostTypeId="2" ParentId="2495" CreationDate="2014-10-23T16:06:50.287" Score="1" Body="&lt;p&gt;Put the directory containing &lt;code&gt;autocomplete.el&lt;/code&gt; in your &lt;code&gt;load-path&lt;/code&gt;. Likewise, for &lt;code&gt;company.el&lt;/code&gt;.  E.g. if that directory is &lt;code&gt;/home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/foobar/&lt;/code&gt; then do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/home/tim/.emacs.d/elpa/emacs-eclim-20140809.207/foobar/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;(require 'autocomplete)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-23T16:06:50.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2505" PostTypeId="2" ParentId="2476" CreationDate="2014-10-23T16:22:21.307" Score="2" Body="&lt;pre&gt;&lt;code&gt;(add-hook 'comint-mode-hook (lambda () (define-key comint-mode-map &quot;\t&quot; 'self-insert-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-23T17:12:11.413" LastActivityDate="2014-10-23T17:12:11.413" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2506" PostTypeId="2" ParentId="2502" CreationDate="2014-10-23T16:30:20.237" Score="1" Body="&lt;p&gt;You can redefine &lt;code&gt;org-return&lt;/code&gt; and &lt;code&gt;org-return-indent&lt;/code&gt; as follows in your &lt;code&gt;init.el&lt;/code&gt; (I have redefined the function found in &lt;code&gt;emacs/24.4/lisp.org/org.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the redefinition, you can do &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt;&lt;kbd&gt;0&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun org-return (&amp;optional arg indent)&#xA;  &quot;Goto next table row or insert a newline.&#xA;&#xA;Calls `org-table-next-row' or `newline', depending on context.&#xA;See the individual commands for more information.&#xA;With ARG, call `org-return' that many times.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let (org-ts-what)&#xA;    (cond&#xA;     ((or (bobp) (org-in-src-block-p))&#xA;      (if indent (newline-and-indent) (newline arg)))&#xA;     ((org-at-table-p)&#xA;      (org-table-justify-field-maybe)&#xA;      (call-interactively 'org-table-next-row))&#xA;     ;; when `newline-and-indent' is called within a list, make sure&#xA;     ;; text moved stays inside the item.&#xA;     ((and (org-in-item-p) indent)&#xA;      (if (and (org-at-item-p) (&gt;= (point) (match-end 0)))&#xA;          (progn&#xA;            (save-match-data (newline arg))&#xA;            (org-indent-line-to (length (match-string 0))))&#xA;    (let ((ind (org-get-indentation)))&#xA;      (newline arg)&#xA;      (if (org-looking-back org-list-end-re)&#xA;              (org-indent-line)&#xA;        (org-indent-line-to ind)))))&#xA;     ((and org-return-follows-link&#xA;       (org-at-timestamp-p t)&#xA;       (not (eq org-ts-what 'after)))&#xA;      (org-follow-timestamp-link))&#xA;     ((and org-return-follows-link&#xA;       (let ((tprop (get-text-property (point) 'face)))&#xA;         (or (eq tprop 'org-link)&#xA;         (and (listp tprop) (memq 'org-link tprop)))))&#xA;      (call-interactively 'org-open-at-point))&#xA;     ((and (org-at-heading-p)&#xA;       (looking-at&#xA;        (org-re &quot;\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$&quot;)))&#xA;      (org-show-entry)&#xA;      (end-of-line 1)&#xA;      (newline arg))&#xA;     (t (if indent (newline-and-indent) (newline arg))))))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that in &lt;code&gt;newline-and-indent&lt;/code&gt;, the &lt;code&gt;ARG&lt;/code&gt; input of &lt;code&gt;newline&lt;/code&gt; is set to &lt;code&gt;nil&lt;/code&gt;. So the same is done in the renewed definition of &lt;code&gt;org-return-indent&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun org-return-indent ()&#xA;  &quot;Goto next table row or insert a newline and indent.&#xA;Calls `org-table-next-row' or `newline-and-indent', depending on&#xA;context.  See the individual commands for more information.&quot;&#xA;  (interactive)&#xA;  (org-return nil t))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-10-23T16:30:20.237" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2507" PostTypeId="2" ParentId="2502" CreationDate="2014-10-23T16:39:11.147" Score="3" Body="&lt;p&gt;If you just want to insert newlines, without any automation for indentation or support for soft newlines, then you can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Inserting-Text.html#index-quoted_002dinsert-72&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;quoted-insert&lt;/code&gt;&lt;/a&gt; (&lt;code&gt;C-q&lt;/code&gt;), which lets you enter any character including control characters. A newline character is &lt;code&gt;C-j&lt;/code&gt;, but the &lt;kbd&gt;Return&lt;/kbd&gt; key sends &lt;code&gt;C-m&lt;/code&gt;, so you need to type &lt;code&gt;C-u 1 0 C-q C-j&lt;/code&gt; (insert a newline, times 10).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to call the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Inserting-Text.html#index-newline-69&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;newline&lt;/code&gt;&lt;/a&gt; function, you can advise &lt;code&gt;org-return&lt;/code&gt;. Untested.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-return&#xA;  (around org-return-prefix-argument (&amp;amp;optional indent arg) activate compile)&#xA;  (interactive (list nil current-prefix-arg))&#xA;  (letf (((symbol-function 'true-newline) (symbol-function 'newline)&#xA;          (symbol-function 'newline) (lambda () (true-newline arg))))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-01-02T02:23:02.630" LastActivityDate="2015-01-02T02:23:02.630" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2508" PostTypeId="1" CreationDate="2014-10-23T16:43:54.757" Score="8" ViewCount="1192" Body="&lt;p&gt;Is it possible for Emacs to highlight backslash escape (e.g. &lt;code&gt;\n&lt;/code&gt;) and format keyword (e.g. &lt;code&gt;%s&lt;/code&gt;) &lt;strong&gt;inside string&lt;/strong&gt;, without messing up current modes' faces? Like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Pu0cl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2014-10-25T11:59:56.637" LastActivityDate="2015-04-09T23:27:48.217" Title="Highlight \n and %s &quot;inside&quot; strings" Tags="|customize|faces|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2509" PostTypeId="2" ParentId="2502" CreationDate="2014-10-23T16:52:15.960" Score="3" Body="&lt;p&gt;Here's another solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun my-org-return (&amp;optional arg indent)&#xA;  (interactive &quot;*p&quot;)&#xA;  (dotimes (number arg) (org-return indent)))&#xA;(define-key org-mode-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) 'my-org-return)&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-10-23T16:52:15.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2510" PostTypeId="1" CreationDate="2014-10-23T16:52:47.503" Score="7" ViewCount="1273" Body="&lt;p&gt;I use &lt;code&gt;python-mode&lt;/code&gt; for my Python code, and every once in a while the syntax highlighter gets confused and thinks everything in the buffer is a string literal. This typically seems to happen when I create a docstring; for a few seconds after I type the quotes, everything after the cursor is highlighted as a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to prevent this entirely? Or, if not, is there some way to make emacs/python-mode recover more quickly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;ed:&lt;/strong&gt; To be clear, the incorrect highlighting persists even after the quotes have been closed and the buffer saved. But again, this is not &lt;em&gt;every&lt;/em&gt; time, just sometimes.&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="216" LastEditDate="2014-10-24T05:49:35.987" LastActivityDate="2015-05-12T01:41:29.770" Title="How can I prevent python-mode from occasionally highlighting everything as string" Tags="|syntax-highlighting|python|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2511" PostTypeId="2" ParentId="2508" CreationDate="2014-10-23T17:22:28.230" Score="3" Body="&lt;p&gt;One way to do this is using library &lt;a href=&quot;http://www.emacswiki.org/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;Highlight&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/highlight.el&quot; rel=&quot;nofollow&quot;&gt;highlight.el&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use command &lt;code&gt;hlt-highlight-regexp-region&lt;/code&gt; (bound by default to &lt;code&gt;C-x X h x&lt;/code&gt;), specifying a regexp that matches either or both things you want to highlight.  Examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Interactively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x X h x \\. RET&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;From Lisp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hlt-highlight-regexp-region nil nil &quot;\\\\.&quot; 'success)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-24T15:52:17.783" LastActivityDate="2014-10-24T15:52:17.783" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2512" PostTypeId="2" ParentId="2508" CreationDate="2014-10-23T17:40:20.440" Score="2" Body="&lt;p&gt;There's the highly incomplete &lt;a href=&quot;https://github.com/dgutov/highlight-escape-sequences&quot; rel=&quot;nofollow&quot;&gt;highlight-escape-sequences&lt;/a&gt; package that does exactly that, it seems to support Ruby and Javascript only. It's one of the very many briefly illustrated packages from &lt;a href=&quot;http://www.wilfred.me.uk/blog/2014/09/27/the-definitive-guide-to-syntax-highlighting/&quot; rel=&quot;nofollow&quot;&gt;Wilfred's guide to syntax highlighting&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-10-23T17:40:20.440" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2513" PostTypeId="1" AcceptedAnswerId="2514" CreationDate="2014-10-23T17:55:41.953" Score="11" ViewCount="4388" Body="&lt;p&gt;After upgrading to Emacs 24.4.1, when I call org-agenda with no splits it will show on the bottom half of the frame.  Previously, it would show on the right half.  How do I configure this behaviour?&lt;/p&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="50" LastEditDate="2014-10-23T17:59:23.550" LastActivityDate="2023-10-18T13:59:54.537" Title="How to get org-agenda to prefer split-window-right" Tags="|org-mode|window|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2514" PostTypeId="2" ParentId="2513" CreationDate="2014-10-23T18:18:20.067" Score="15" Body="&lt;p&gt;I believe this behavior is not specific to org-agenda, but rather depends on the size of the window and the variables &lt;code&gt;split-width-threshold&lt;/code&gt; and &lt;code&gt;split-height-threshold&lt;/code&gt;. If your window is wide enough the agenda will open on the right. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to try a lower &lt;code&gt;split-width-threshold&lt;/code&gt; if you prefer to split things vertically (new window on the right). If you &lt;em&gt;really&lt;/em&gt; only want to do this for org-agenda, some advice might work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-agenda (around split-vertically activate)&#xA;  (let ((split-width-threshold 80))  ; or whatever width makes sense for you&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another option is to define a command to toggle from a horizontal split to a vertical split, as described here: &lt;a href=&quot;http://whattheemacsd.com/buffer-defuns.el-03.html&quot;&gt;http://whattheemacsd.com/buffer-defuns.el-03.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-23T18:18:20.067" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2515" PostTypeId="2" ParentId="2376" CreationDate="2014-10-23T18:31:26.333" Score="20" Body="&lt;p&gt;&lt;strong&gt;TLDR;&lt;/strong&gt; You have to start the http server (&lt;a href=&quot;https://github.com/skeeto/emacs-web-server&quot; rel=&quot;noreferrer&quot;&gt;simple-http&lt;/a&gt;) and load your HTML files through it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say you have a HTML file named &lt;code&gt;hello.html&lt;/code&gt; and a JS script file named &lt;code&gt;script.js&lt;/code&gt; in &lt;code&gt;/home/user/Documents/javascript&lt;/code&gt; folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;hello.html&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;&#xA;&amp;lt;html&amp;gt;&#xA;&amp;lt;head&amp;gt;&#xA;    &amp;lt;!-- Include skewer.js as a script --&amp;gt;&#xA;    &amp;lt;script src=&quot;http://localhost:8080/skewer&quot;&amp;gt;&amp;lt;/script&amp;gt;&#xA;    &amp;lt;!-- Include my script.js file --&amp;gt;&#xA;    &amp;lt;script src=&quot;script.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&#xA;&amp;lt;/head&amp;gt;&#xA;&amp;lt;body&amp;gt;&#xA;    &amp;lt;p&amp;gt;Hello world&amp;lt;/p&amp;gt;&#xA;&amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;script.js&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alert('hey!');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;init.el&lt;/strong&gt; (or &lt;strong&gt;.emacs&lt;/strong&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'simple-httpd)&#xA;;; set root folder for httpd server&#xA;(setq httpd-root &quot;/home/user/Documents/javascript&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's time to start the server: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;httpd-start&lt;/code&gt;, and open the &lt;code&gt;index.html&lt;/code&gt; file in the browser, by visiting &lt;code&gt;http://localhost:8080/hello.html&lt;/code&gt;. You should get the alert in the browser and now call &lt;code&gt;skwer-repl&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can further interact with the browser through the repl. So, everything you evaluate in the repl will be transmitted to the browser. For example if you type &lt;code&gt;console.log('hey!')&lt;/code&gt; in the repl, you will get this message in the browser's console. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to interactively modify HTML (e.g. live update HTML tags from emacs), add to your &#xA;&lt;strong&gt;init.el&lt;/strong&gt; (or &lt;strong&gt;.emacs&lt;/strong&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'html-mode-hook 'skewer-html-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when you are in your &lt;em&gt;.html&lt;/em&gt; file you can evaluate tags with &lt;kbd&gt;C-M-x&lt;/kbd&gt; (&lt;code&gt;skewer-html-eval-tag&lt;/code&gt;), and these will be immediately updated in your browser. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that conversely, this also applies to CSS and CSS files.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2018-09-22T07:16:54.480" LastActivityDate="2018-09-22T07:16:54.480" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2516" PostTypeId="2" ParentId="2497" CreationDate="2014-10-23T18:49:46.957" Score="6" Body="&lt;p&gt;Figured out an advice-based way using ideas that came from @Drew's comments and @glucas's answer which I'll record here in case they're useful for anyone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short version: use &lt;code&gt;after&lt;/code&gt; advice to query whether the buffer has an associated file name, set one temporarily if it doesn't, and then let the rest of the &lt;code&gt;set-auto-mode&lt;/code&gt; machinery take care of the details.  After a bit of testing (not extensive), it seems to be working just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;code&gt;ido-switch-buffer&lt;/code&gt; and vanilla &lt;code&gt;switch-to-buffer&lt;/code&gt;, the two bits of advice would be:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice ido-switch-buffer (after set-mode activate)&#xA;  (unless buffer-file-name&#xA;    (let ((buffer-file-name (buffer-name)))&#xA;      (set-auto-mode t))))&#xA;&#xA;(defadvice switch-to-buffer (after set-mode activate)&#xA;  (unless buffer-file-name&#xA;    (let ((buffer-file-name (buffer-name)))&#xA;      (set-auto-mode t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I find this option helpful on top of the &lt;code&gt;find-file&lt;/code&gt; point that @Drew raised because my fingers can get ahead of my brain: muscle memory will often get me into switch-to-buffer territory before it fully occurs to me that &lt;code&gt;find-file&lt;/code&gt; would do what I need.  Now, both options are available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; small but potentially-irritating bug in the above code: it will re-run the mode hook on the buffer each time you switch to it.  The following gives it an actual filename off of the &lt;code&gt;/tmp&lt;/code&gt; directory and avoids that problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice ido-switch-buffer (after set-mode activate)&#xA;  (unless buffer-file-name&#xA;    (setq buffer-file-name (concat &quot;/tmp/&quot; (buffer-name)))&#xA;    (set-auto-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-10-23T19:29:43.533" LastActivityDate="2014-10-23T19:29:43.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2517" PostTypeId="1" AcceptedAnswerId="2518" CreationDate="2014-10-23T19:05:23.140" Score="1" ViewCount="46" Body="&lt;p&gt;In a buffer in fundamental mode, I type Ctrl-x Ctrl-e at the end of the line &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'eclimd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the minibuffer at the bottom says &lt;code&gt;eclimd&lt;/code&gt;. Does it mean I run the command successfully?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, why does &lt;code&gt;require&lt;/code&gt; output &lt;code&gt;eclimd&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="105" LastEditDate="2014-10-24T01:51:59.267" LastActivityDate="2014-10-24T01:51:59.267" Title="Do I evaluate &quot;(require 'eclimd)&quot; successfully?" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2518" PostTypeId="2" ParentId="2517" CreationDate="2014-10-23T19:16:10.190" Score="3" Body="&lt;p&gt;It did not give you an error message, so you successfully &lt;code&gt;require&lt;/code&gt;d it.  Have a look at the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html&quot; rel=&quot;nofollow&quot;&gt;manual on named features&lt;/a&gt; and &lt;code&gt;require&lt;/code&gt;'s docstring; they indicate that, when you &lt;code&gt;(require FEATURE)&lt;/code&gt;, &quot;normally the return value is FEATURE.&quot;  That is, it returns the symbol naming the feature you just &lt;code&gt;require&lt;/code&gt;d.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-23T19:16:10.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2519" PostTypeId="2" ParentId="2497" CreationDate="2014-10-23T19:55:48.577" Score="9" Body="&lt;p&gt;File visiting commands such as &lt;code&gt;C-x C-f&lt;/code&gt; &lt;em&gt;do not create a file&lt;/em&gt; to visit. They do what you are looking for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is only &lt;em&gt;if and when you try to&lt;/em&gt; &lt;strong&gt;&lt;em&gt;save the buffer&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;that a file gets created&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not try to save the buffer, no file is created. What you want, from what I understand so far, is to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Visiting-Files.html&quot;&gt;&quot;&lt;strong&gt;visit a file&lt;/strong&gt;&quot;&lt;/a&gt; (which really means open a buffer in the proper mode).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-23T19:55:48.577" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2520" PostTypeId="1" CreationDate="2014-10-23T20:20:00.240" Score="29" ViewCount="9278" Body="&lt;ol&gt;&#xA;&lt;li&gt;When we add more and more lines into &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; for various&#xA;purposes (for python-mode, for emacs-eclim, for ...), the file&#xA;becomes lengthy and less readable. Is there a way to help organize its content?&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;My current &lt;code&gt;~/.emacs.d&lt;/code&gt; looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ls *&#xA;init.el&#xA;&#xA;auto-save-list:&#xA;&#xA;elisp:&#xA;python-mode.el-6.1.3&#xA;&#xA;elpa:&#xA;archives        auctex-readme.txt         s-20140910.334&#xA;auctex-11.87.7  emacs-eclim-20140809.207&#xA;&#xA;eshell:&#xA;history&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;python-mode.el-6.1.3&lt;/code&gt; was manually installed, while&#xA;&lt;code&gt;emacs-eclim-20140809.207&lt;/code&gt; was installed by &lt;code&gt;elpa&lt;/code&gt;, and I am not 100% sure that the other things under &lt;code&gt;elpa/&lt;/code&gt; were by &lt;code&gt;elpa&lt;/code&gt;. How can I&#xA;organize the content of &lt;code&gt;~/.emacs.d/&lt;/code&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="120" LastEditorUserId="2096" LastEditDate="2014-10-26T00:02:24.760" LastActivityDate="2020-03-10T14:52:52.193" Title="Organize the content of ~/.emacs.d/init.el and ~/emacs.d?" Tags="|init-file|" AnswerCount="12" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2521" PostTypeId="2" ParentId="2520" CreationDate="2014-10-23T20:30:51.923" Score="10" Body="&lt;p&gt;Just move pieces of code from &lt;code&gt;init.el&lt;/code&gt; to separate files (libraries), which you then &lt;code&gt;require&lt;/code&gt;.  (Use &lt;code&gt;provide&lt;/code&gt; in the libraries to be &lt;code&gt;require&lt;/code&gt;d.) Put those files wherever you want, and update &lt;code&gt;load-path&lt;/code&gt; accordingly.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-23T20:40:59.510" LastActivityDate="2014-10-23T20:40:59.510" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2522" PostTypeId="2" ParentId="2520" CreationDate="2014-10-23T20:34:19.160" Score="24" Body="&lt;p&gt;A classic way of doing this is splitting your &lt;code&gt;.emacs&lt;/code&gt; into separate files. For example, you could move all your web stuff into &lt;code&gt;~/.emacs.d/web-config.el&lt;/code&gt; and then load it inside &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/.emacs.d/web-config.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to keep your &lt;code&gt;~/.emacs.d&lt;/code&gt; a bit more organized, you could also shift these config files into their own directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/.emacs.d/config/web.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can just jump to the appropriate file when making changes to your config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing that's missing from this are variables set via the customize system. These will still all be in your main init.el. Apparently, there's a little utility called &lt;a href=&quot;http://www.emacswiki.org/emacs/InitSplit&quot; rel=&quot;noreferrer&quot;&gt;init split&lt;/a&gt; which lets you make rules about which customize setting goes where, but I've never used it myself.  Alternatively, the “customize” system can be configured to use a separate file for its modifications to your settings. Set the &lt;code&gt;custom-file&lt;/code&gt; variable to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Customizations.html&quot; rel=&quot;noreferrer&quot;&gt;specify where the “customize” settings should be read from and written to&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as the directory itself goes, I've always been happy with the default layout. The main change I made was creating a directory for all of my own custom packages and libraries that are &lt;em&gt;not&lt;/em&gt; managed by &lt;code&gt;package.el&lt;/code&gt;. This gives a single home to my custom elisp that isn't related to configuration.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorDisplayName="user2005" LastEditDate="2014-11-11T06:46:04.147" LastActivityDate="2014-11-11T06:46:04.147" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2523" PostTypeId="2" ParentId="2520" CreationDate="2014-10-23T20:35:06.653" Score="7" Body="&lt;p&gt;I use the suggestion by &lt;a href=&quot;https://www.emacswiki.org/emacs/targzeta&quot; rel=&quot;nofollow noreferrer&quot;&gt;targzeta&lt;/a&gt; found on the Emacs Wiki: &lt;a href=&quot;https://www.emacswiki.org/emacs/DotEmacsModular#LoadDirectory&quot; rel=&quot;nofollow noreferrer&quot;&gt;Load directory&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I have a ~/.emacs.d/load-directory.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;; ~/.emacs.d/load-directory.el&#xA;&#xA;;; Handy function to load recursively all '.el' files in a given directory&#xA;(defun load-directory (directory)&#xA;  &quot;Load recursively all '.el' files in DIRECTORY.&quot;&#xA;  (dolist (element (directory-files-and-attributes directory nil nil nil))&#xA;    (let* ((path (car element))&#xA;           (fullpath (concat directory &quot;/&quot; path))&#xA;           (isdir (car (cdr element)))&#xA;           (ignore-dir (or (string= path &quot;.&quot;) (string= path &quot;..&quot;))))&#xA;      (cond&#xA;       ((and (eq isdir t) (not ignore-dir))&#xA;        (load-directory fullpath))&#xA;       ((and (eq isdir nil) (string= (substring path -3) &quot;.el&quot;))&#xA;        (load (file-name-sans-extension fullpath)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I just put separate files in my ~/.emacs.d/config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d/config ls&#xA;01-packages.el  02-style.el  03-modes.el  04-keybindings.el  05-functions.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And finally I have this in my ~/.emacs.d/init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Load all &quot;.el&quot; files under ~/.emacs.d/config directory.&#xA;(load &quot;~/.emacs.d/load-directory&quot;)&#xA;(load-directory &quot;~/.emacs.d/config&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="219" LastEditorUserId="21935" LastEditDate="2020-03-10T14:52:52.193" LastActivityDate="2020-03-10T14:52:52.193" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="2524" PostTypeId="2" ParentId="2520" CreationDate="2014-10-23T21:09:31.127" Score="33" Body="&lt;p&gt;People using lesser editors like to split their code into multiple files.  If you're using Emacs, there's no reason to do that: just use a single large file, which you split into sections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each section should start with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^L&#xA;;;; title of the section&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where you insert the &lt;code&gt;^L&lt;/code&gt; character by typing &lt;code&gt;C-q C-l&lt;/code&gt;.  You can then use commands such as &lt;code&gt;C-x ]&lt;/code&gt; (&lt;code&gt;forward-page&lt;/code&gt;) or &lt;code&gt;C-x n p&lt;/code&gt; (&lt;code&gt;narrow-to-page&lt;/code&gt;) to navigate through the file.  See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Pages.html&quot; rel=&quot;noreferrer&quot;&gt;Section 25.4 (Pages)&lt;/a&gt; of the Emacs manual for more.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="11871" LastEditDate="2016-06-27T22:41:18.140" LastActivityDate="2016-06-27T22:41:18.140" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2525" PostTypeId="2" ParentId="2497" CreationDate="2014-10-23T21:13:23.927" Score="0" Body="&lt;p&gt;There are some good answers here but I wanted to add one more thing.  Emacs has a ton of features and there are often several ways to do something.  You can add tags at the top of any file which tell emacs what type its, regardless of extension.  For example adding this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*-Python-*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At the top of a file will let emacs know it's a Python file even with out the &lt;code&gt;.py&lt;/code&gt; extension.  Note that the &lt;code&gt;#&lt;/code&gt; at the beginning of the line is a Python style comment.  For different file types you can use different comments.  For example to specify a Lisp file you use &lt;code&gt;;&lt;/code&gt; to start a comment line and set the mode in emacs like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; -*- mode: Lisp;-*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Specifying File Variables&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html&quot; rel=&quot;nofollow&quot;&gt;Choosing File Modes&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2231" LastEditorUserId="45" LastEditDate="2014-10-24T03:30:51.500" LastActivityDate="2014-10-24T03:30:51.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2526" PostTypeId="2" ParentId="2520" CreationDate="2014-10-23T22:33:41.860" Score="17" Body="&lt;p&gt;If you like Org-mode, you can use it to organize your &lt;code&gt;.emacs&lt;/code&gt; without splitting it. Under my current configuration my &lt;code&gt;.emacs&lt;/code&gt; file just bootstraps an init.org file I have under &lt;code&gt;~/.emacs.d/init/init.org&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;&#xA;;; Load the actual configuration file&#xA;(org-babel-load-file&#xA;  (expand-file-name (concat user-emacs-directory &quot;init/init.org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By using different files you need to &lt;code&gt;grep&lt;/code&gt; instead of simple &lt;code&gt;C-s&lt;/code&gt; to search for something, and so on. Also, it's easier to add several levels to your organization.&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="93" LastEditDate="2014-10-23T22:55:09.853" LastActivityDate="2014-10-23T22:55:09.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2527" PostTypeId="5" CreationDate="2014-10-23T22:44:59.160" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-23T22:44:59.160" LastActivityDate="2014-10-23T22:44:59.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2528" PostTypeId="4" CreationDate="2014-10-23T22:44:59.160" Score="0" Body="Use this tag for questions about modifying a particular action or task within Emacs." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-03T21:09:33.200" LastActivityDate="2014-11-03T21:09:33.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2529" PostTypeId="2" ParentId="2406" CreationDate="2014-10-23T22:45:20.673" Score="3" Body="&lt;p&gt;In answer to the question of how often the &lt;em&gt;paper&lt;/em&gt; copy of the manual is updated, the kind folks in the FSF sales department responded with the following (circa late-October 2014 for future reference; quoted with their permission):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Thank you for supporting the Free Software Foundation.&lt;/p&gt;&#xA;&lt;p&gt;So, we usually order a new version of the Emacs manual when the older version sells out. Based on our inventory, I am not sure if the next version will be 24.4 or 24.5, but it will be another couple months at least. When we release a new version of the Emacs manual, we announce it in the Free Software Supporter and in the GNU Press mailing list. I am told that 24.2's documentation is almost entirely compatible. Thank you!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In a follow-up email, they reported:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I looked back at my documentation, and it seems we release a new edition every couple years.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt;&#xA;They update the paper manual when they sell out of the old copy, which for the jump from 24.2 will be at least a couple of months.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-23T22:45:20.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2530" PostTypeId="1" AcceptedAnswerId="2557" CreationDate="2014-10-24T01:47:10.580" Score="2" ViewCount="901" Body="&lt;p&gt;I am trying to remap globally &lt;code&gt;C-/&lt;/code&gt; but the &lt;code&gt;undo-tree&lt;/code&gt; package hinders me from doing so. When calling this command (in my init file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-/&quot;) 'left-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;after&lt;/em&gt; having loaded &lt;code&gt;undo-tree&lt;/code&gt; (of course), the binding still refers to the undo command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to override &lt;code&gt;undo-tree&lt;/code&gt;'s pervasiveness? &lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2020-03-19T16:01:21.147" Title="Global key binding overriden by undo-tree" Tags="|key-bindings|undo-tree-mode|" AnswerCount="3" CommentCount="3" ClosedDate="2014-10-24T19:47:25.517" ContentLicense="CC BY-SA 3.0" />
  <row Id="2531" PostTypeId="2" ParentId="2530" CreationDate="2014-10-24T02:02:06.477" Score="1" Body="&lt;p&gt;I guess you're using Emacs under terminal? Check &lt;code&gt;C-h k C-/&lt;/code&gt; to see what it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case, when pressing &lt;code&gt;C-/&lt;/code&gt; in terminal, it actually invokes &lt;code&gt;C-_&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="515" LastActivityDate="2014-10-24T02:02:06.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2532" PostTypeId="1" CreationDate="2014-10-24T02:39:54.013" Score="1" ViewCount="779" Body="&lt;p&gt;I got someone ask this question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I prevent errors that should really just be a bell or flashing&#xA;  screen not open a window with an error?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-24T03:52:24.323" Title="How to prevent Emacs from opening error buffer" Tags="|error-handling|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2533" PostTypeId="1" AcceptedAnswerId="2541" CreationDate="2014-10-24T03:43:25.903" Score="10" ViewCount="3710" Body="&lt;p&gt;I've configured Emacs to open files named &lt;code&gt;*.cfg&lt;/code&gt; in shell-script-mode.  These are config files, of course, rather than shell scripts, but 90% of the time it does what I want (mainly, good guesses about faces for comments and variable assignment).  I use &lt;a href=&quot;https://flycheck.readthedocs.org/&quot; rel=&quot;noreferrer&quot;&gt;flycheck-mode&lt;/a&gt;, and I like it enough to have &lt;code&gt;global-flycheck-mode&lt;/code&gt; enabled.  The problem is that, in the case of &lt;code&gt;*.cfg&lt;/code&gt; files, flycheck-mode suggests lots of errors that aren't relevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to disable flycheck-mode automagically based on either file name or the path to the file?  The closest I've seen is &lt;a href=&quot;https://flycheck.readthedocs.org/en/latest/guide/usage.html#el.variable.flycheck-before-syntax-check-hook&quot; rel=&quot;noreferrer&quot;&gt;flycheck-before-syntax-check-hook&lt;/a&gt;...I could imagine sticking in a check for path or filename, but it runs before each syntax check (rather than disabling checks entirely).&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorDisplayName="user227" LastEditDate="2016-01-13T13:59:08.107" LastActivityDate="2016-01-13T13:59:08.107" Title="How can I prevent flycheck-mode from checking certain files?" Tags="|flycheck|local-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2534" PostTypeId="2" ParentId="2532" CreationDate="2014-10-24T03:52:24.323" Score="5" Body="&lt;p&gt;Not exactly sure what the context is or what you mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If by &quot;open a window with an error&quot; and &quot;opening error buffer&quot; you mean opening the debugger in buffer &lt;code&gt;*Backtrace*&lt;/code&gt;, then set variable &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; to prevent that. The error message will then simply be shown in the echo area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variable &lt;code&gt;visible-bell&lt;/code&gt; controls whether a bell (ding) sound is heard or the frame is flashed (&quot;visible bell&quot;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-24T03:52:24.323" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2535" PostTypeId="2" ParentId="2530" CreationDate="2014-10-24T04:22:48.030" Score="6" Body="&lt;p&gt;You can try this, if you want to remap &lt;em&gt;all&lt;/em&gt; keys bound to &lt;code&gt;undo-tree-undo&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-set-key [remap undo-tree-undo] 'left-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also try making your binding in &lt;code&gt;undo-tree-mode-map&lt;/code&gt;, assuming that is what is used by &lt;code&gt;undo-tree-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'undo-tree-mode-hook&#xA;          (lambda () (define-key undo-tree-map (kbd &quot;C-/&quot;) 'left-char)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Usually there is a keymap &lt;code&gt;[mode-name]-map&lt;/code&gt; like &lt;code&gt;undo-tree-mode-map&lt;/code&gt;. In this case the name is actually &lt;code&gt;undo-tree-map&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="26301" LastEditDate="2020-03-19T16:01:21.147" LastActivityDate="2020-03-19T16:01:21.147" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="2536" PostTypeId="2" ParentId="2497" CreationDate="2014-10-24T04:29:01.640" Score="3" Body="&lt;p&gt;You can use *scratch* buffers for the purpose of creating temporary buffers that have the same major mode as the file that you might be working on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here an an emacs SE answer that might solve your problem: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/80/115&quot;&gt;How can I quickly toggle between a file and a *scratch* buffer having the same major mode?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The referenced question and answer were both posted by me. The answer in the function does the following: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you are working in X major mode in a file, calling this function creates a new scratch buffer called &lt;code&gt;*scratch-X-mode*&lt;/code&gt; if one doesn't already exist, and switches to this newly created buffer. &lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;*scratch-X-mode*&lt;/code&gt; already exists, it simply switches to that buffer. &lt;/li&gt;&#xA;&lt;li&gt;Calling this function again while in that scratch buffer will bring you back to the file buffer you were originally working on. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-10-24T04:29:01.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2537" PostTypeId="2" ParentId="2533" CreationDate="2014-10-24T04:55:44.577" Score="9" Body="&lt;p&gt;You can easily disable checkers using&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq flycheck-disabled-checkers '(sh-shellscript sh-bash sh-zsh))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Flycheck documentation adds more information  &lt;a href=&quot;http://flycheck.readthedocs.org/en/latest/guide/releases/flycheck-0.16.html?highlight=disable#disable-syntax-checkers-easily&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also disable checkers in a lambda for &lt;code&gt;auto-mode-alist&lt;/code&gt; to have it only disable on &lt;code&gt;.cfg&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist&#xA;             '(&quot;\\.cfg\\'&quot; . (lambda ()&#xA;                               (setq flycheck-disabled-checkers  (append '(sh-shellscript sh-bash sh-zsh) flycheck-disabled-checkers))&#xA;                               (shell-script-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="294" LastEditorUserId="50" LastEditDate="2014-10-24T08:22:18.507" LastActivityDate="2014-10-24T08:22:18.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2538" PostTypeId="1" AcceptedAnswerId="2559" CreationDate="2014-10-24T06:53:08.863" Score="18" ViewCount="3746" Body="&lt;p&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun%2Felectric-pair-mode.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;electric-pair-mode&lt;/code&gt;&lt;/a&gt; is a &lt;em&gt;built-in&lt;/em&gt; mode for automatically inserting matching pairs of delimiters (parentheses, square brackets, etc.) based on the current major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can define additional pairs (which will be &lt;em&gt;global&lt;/em&gt;) like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(?\' . ?\') electric-pair-pairs)      ; Automatically pair single-quotes&#xA;(push '(?\' . ?\') electric-pair-text-pairs) ; ... in comments&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is&lt;/strong&gt;, how can I define &lt;em&gt;mode-specific&lt;/em&gt; pairs (e.g., &lt;code&gt;//&lt;/code&gt;, &lt;code&gt;==&lt;/code&gt; for &lt;code&gt;org-mode&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-10-25T20:43:52.200" LastActivityDate="2019-08-15T19:31:07.370" Title="How to define additional mode-specific pairs for electric-pair-mode" Tags="|pairing|balanced-parentheses|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2539" PostTypeId="1" AcceptedAnswerId="2540" CreationDate="2014-10-24T07:59:25.167" Score="5" ViewCount="2171" Body="&lt;p&gt;Am going through &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot; rel=&quot;noreferrer&quot;&gt;this Helm tutorial&lt;/a&gt; at the moment; I pasted in the code verbatim (for now, I'll adapt it to suit my preferences later).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a quick google search for this particular error but it doesn't seem common.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For context, prior to adding the elisp code from the tutorial, I was indeed able to use the helm mini-buffer (i.e., helm is indeed installed correctly; i did it through MELPA).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am including below the full error message that I see after running &lt;code&gt;emacs --debug-init&lt;/code&gt; - please see top two lines.  (The initialization looks a bit funky in the lines further down because I have Emacs load from the &lt;code&gt;init.el&lt;/code&gt; file in my Dropbox.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable helm-map)&#xA;  (define-key helm-map (kbd &quot;C-i&quot;) (quote helm-execute-persistent-action))&#xA;  eval-buffer(#&amp;lt;buffer  *load*-462666&amp;gt; nil &quot;/home/dchaudh/Dropbox/dchaudhUbuntu/emacs/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 3629&#xA;  load-with-code-conversion(&quot;/home/dchaudh/Dropbox/dchaudhUbuntu/emacs/.emacs.d/init.el&quot; &quot;/home/dchaudh/Dropbox/dchaudhUbuntu/emacs/.emacs.d/init.el&quot; nil nil)&#xA;  load(&quot;~/Dropbox/dchaudhUbuntu/emacs/.emacs.d/init.el&quot;)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/dchaudh/.emacs&quot; nil t)  ; Reading at buffer position 220&#xA;  load-with-code-conversion(&quot;/home/dchaudh/.emacs&quot; &quot;/home/dchaudh/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 &quot;\205\262 \306=\203\307\310Q\202; \311=\204\307\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB\321\202;\316\322\323\322\211#\210\322=\203a\324\325\326\307\327Q!\&quot;\323\322\211#\210\322=\203`\210\203\243\330!\331\232\203\243\332!\211\333P\334!\203}\211\202\210\334!\203\207\202\210\314\262\203\241\335\&quot;\203\237\336\337#\210\340\341!\210\266\f?\205\260\314\323\342\322\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; (initialization &quot;`_emacs' init file is deprecated, please use `.emacs'&quot;) &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7 &quot;\n\n(fn)&quot;]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2084" LastActivityDate="2018-09-24T15:10:10.323" Title="Defining key-bindings within `helm-map`: getting a `void-variable helm-map` error" Tags="|key-bindings|helm|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2540" PostTypeId="2" ParentId="2539" CreationDate="2014-10-24T09:23:43.757" Score="6" Body="&lt;p&gt;The problem is that you are trying to configure Helm before it has been loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your init file contains code which depends on packages being available, then you need to call &lt;code&gt;(package-initialize)&lt;/code&gt; beforehand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://stackoverflow.com/q/11127109/324105&quot;&gt;Emacs 24 Package System Initialization Problems&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-11-24T23:10:39.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2541" PostTypeId="2" ParentId="2533" CreationDate="2014-10-24T10:21:38.213" Score="11" Body="&lt;h1&gt;The good way&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Simply do not use Sh Mode for buffers which do not contain shell scripts.  Write your own mode instead.  This is &lt;strong&gt;the canonical way&lt;/strong&gt; to handle such situations in Emacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Write a custom major mode is easy.  You can simply inherit from Sh Mode to get all of its features and commands, while still having an independent mode.  Just add the following to your &lt;code&gt;init.el&lt;/code&gt; for a simple start:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode my-cfg-mode sh-mode &quot;My CFg Mode&quot;&#xA;  &quot;A mode for my CFg files.&quot;&#xA;  (sh-set-shell &quot;bash&quot;))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.cfg\\'&quot; . my-cfg-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since this new mode is independent from Sh Mode, Flycheck won't try to use syntax checkers for Sh Mode in this new mode.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a separate mode also has other advantages:  You can setup your own keybindings, independent from Sh Mode, or extend syntax highlighting specifically for this style of configuration files.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The bad way&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As a quick hack, you can also simply disable Flycheck again in such files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'flycheck-mode-hook #'my-keep-flycheck-off)&#xA;&#xA;(defun my-keep-flycheck-off ()&#xA;  (when (and (eq major-mode 'sh-mode)&#xA;             (buffer-file-name)&#xA;             (string= (file-name-extension (buffer-file-name)) &quot;cfg&quot;))&#xA;    (flycheck-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, though, that speaking as the Flycheck maintainer, I'd recommend against this solution.  Be a good Emacs citizen, and write your own mode, really.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-24T10:21:38.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2542" PostTypeId="1" AcceptedAnswerId="2543" CreationDate="2014-10-24T10:27:45.793" Score="5" ViewCount="161" Body="&lt;p&gt;I'm currently writing a major mode (for interacting with a remote Grid Engine) which involves fetching data, parsing it into an alist, formating the alist into a string and then inserting the formatted string into a buffer.  This is done for many rows of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to add a way for users to interact with the data in the buffer, e.g. to tab from one field to the next, or to press RET on a field to invoke a function on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems silly to me to &quot;lose&quot; the underlying data structure after rendering it to the buffer.  Parsing the line at point (e.g. with &lt;code&gt;(thing-at-point 'word)&lt;/code&gt;) to partially recover the data structure just seems like a bad idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of one of these alists:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((job-id   . 123)&#xA; (priority . 0.844)&#xA; (name     . &quot;some job name&quot;)&#xA; (owner    . &quot;rekado&quot;)&#xA; (state    . &quot;r&quot;)&#xA; (time     . &quot;2014-10-24&quot;)&#xA; (queue    . &quot;standard&quot;)&#xA; (slots    . 12))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This may be rendered with a format string like this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun format-job-record (job)&#xA;  (format &quot;&quot;%-10s %-10s %-15s %-10s\n&quot;&#xA;          (cdr (assoc 'job-id   job))&#xA;          (cdr (assoc 'priority job))&#xA;          (cdr (assoc 'owner    job))&#xA;          (cdr (assoc 'state    job))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an alternative way (an idiom perhaps), that allows me to specify a way to display this alist while keeping the underlying data intact?  I would like to be able to retrieve the whole alist when point is on the row, and any given field when point is on the rendered text for the field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this might be done by storing the alist as special properties on the generated string, and by storing the field keys along with each individual field string, but I'm not sure if this is the best way to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to separate representation in the buffer from the underlying data and only work on data structures instead of text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the most &quot;natural&quot; approach to achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better more &quot;disciplined&quot; approach than what is outlined in my answer below, or are custom text properties the idiomatic way to go?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-10-24T11:06:46.707" LastActivityDate="2014-10-24T17:03:25.040" Title="elisp: retaining data structure after inserting string representation to buffer?" Tags="|elisp|major-mode|text-properties|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2543" PostTypeId="2" ParentId="2542" CreationDate="2014-10-24T11:03:08.067" Score="3" Body="&lt;p&gt;Here is what works in general as described above (associating text with data using the 'field property).  The string for each field is augmented with a &lt;code&gt;'field&lt;/code&gt; text property containing the underlying data.  The string for the whole row is augmented with a custom property prefixed with the name of the major mode (e.g. &lt;code&gt;'grid-engine-job&lt;/code&gt;) which contains the underlying data structure for the row.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun field-as-text (field obj &amp;amp;optional format-string)&#xA;  (let* ((value (cdr (assoc field obj)))&#xA;         (format-string (if format-string format-string &quot;%s&quot;))&#xA;         (text  (format format-string value)))&#xA;    (propertize text 'field value)))&#xA;&#xA;(defun format-job-record (job)&#xA;  (let ((text (format row-pattern&#xA;                      (field-as-text 'job-id job)&#xA;                      (field-as-text 'priority job)&#xA;                      (field-as-text 'owner job)&#xA;                      (field-as-text 'state job))))&#xA;    (propertize text 'grid-engine-job job)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To access the data one only needs to get retrieve the text property at point with &lt;code&gt;(get-text-property pos prop)&lt;/code&gt;, where &lt;code&gt;pos&lt;/code&gt; is the position of point and &lt;code&gt;prop&lt;/code&gt; is &lt;code&gt;'field&lt;/code&gt; or the custom property name (e.g. &lt;code&gt;'grid-engine-job&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-10-24T14:53:59.697" LastActivityDate="2014-10-24T14:53:59.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2544" PostTypeId="1" AcceptedAnswerId="2546" CreationDate="2014-10-24T12:23:07.347" Score="17" ViewCount="722" Body="&lt;p&gt;Sometimes I'm inside a long function where the start of the function is not visible. While I have recently learned about &lt;a href=&quot;http://www.emacswiki.org/emacs/WhichFuncMode&quot;&gt;&lt;code&gt;(which-function-mode)&lt;/code&gt;&lt;/a&gt; which tells me in the modeline the name of the function, I'd like to be able to quickly jump to the start of the function and then back as easily as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I've found two solutions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Using a mark&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-SPC&lt;/code&gt;        Mark current point&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-M-a&lt;/code&gt;        Move backward to start of function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x C-x&lt;/code&gt;      Exchange mark with current point (jumps you back)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-g&lt;/code&gt;          Cancel marked region&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using a register&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x r SPC p&lt;/code&gt; Save current point in register 'p'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-M-a&lt;/code&gt;       Move backward to start of function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x r j p&lt;/code&gt;   Jump to point saved in register 'p'&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there a better way? I'm not opposed to adding some elisp to my &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="2240" LastEditorUserId="253" LastEditDate="2016-09-12T17:19:15.610" LastActivityDate="2016-09-12T17:19:15.610" Title="Best (minimal keystrokes) method of jumping to the start of a function and then back to current point?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2545" PostTypeId="1" AcceptedAnswerId="2549" CreationDate="2014-10-24T12:44:24.697" Score="8" ViewCount="1518" Body="&lt;p&gt;When I &lt;code&gt;C-s&lt;/code&gt; I can search. How should I do a function which I could bind for example to &lt;code&gt;C-r&lt;/code&gt; which would let me search in the results of some predefined search query?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like contents of window would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function xyz(a, b)&#xA;  return a + b&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can &lt;code&gt;C-M-s&lt;/code&gt; with &lt;code&gt;function.*&lt;/code&gt; as a query and the result will be &lt;code&gt;function xyz(a, b)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to have a function where I could enter a query and search in those results(which would be generated behind my eyes automatically).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all for the solutions. &lt;code&gt;occur&lt;/code&gt;, &lt;code&gt;helm-occur&lt;/code&gt; also works very well, but I have accepted Jordon Biondo answer because he provided the code I needed to answer my question fully.&lt;/p&gt;&#xA;" OwnerUserId="367" LastEditorUserId="105" LastEditDate="2016-12-28T03:21:57.307" LastActivityDate="2016-12-28T03:21:57.307" Title="How do I search in search results" Tags="|search|narrowing|" AnswerCount="5" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2546" PostTypeId="2" ParentId="2544" CreationDate="2014-10-24T13:05:28.220" Score="20" Body="&lt;p&gt;This works for me:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-a&lt;/code&gt; to move to the beginning of the function; this sets mark automatically&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u C-SPC&lt;/code&gt; to pop the mark and return to the previous position&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-24T13:05:28.220" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2547" PostTypeId="2" ParentId="2501" CreationDate="2014-10-24T13:09:29.737" Score="40" Body="&lt;p&gt;I have the following in my .emacs using Emacs for OSX:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(default ((t (:stipple nil :background &quot;white&quot; :foreground &quot;black&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :family &quot;Inconsolata&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Setting the font&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It's easiest to set the font using the menus if you're running Emacs in a graphical environment. Use &quot;Options -&gt; Set Default Font...&quot; from the menus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you're not done because you've only changed the font temporarily. The easiest method that I know of is to use the customization mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-face RET default RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now change the options you wish to change, if any. If you've already changed the font using the menus, you should see your changes here.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Saving to your init file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Save For Future Sessions&lt;/em&gt; by either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Click on the &lt;em&gt;State&lt;/em&gt; button and choose &lt;em&gt;Save For Future Sessions&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-s&lt;/code&gt; while in the Customization buffer which &lt;del&gt;will&lt;/del&gt; &lt;em&gt;should&lt;/em&gt; do the same thing &lt;em&gt;but doesn't always work, e.g. after &lt;code&gt;(set-default-font &quot;Inconsolata&quot;)&lt;/code&gt;&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;If all else fails...&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You may have luck with the &lt;a href=&quot;http://www.emacswiki.org/emacs/SetFonts&quot;&gt;Set Fonts&lt;/a&gt; page.&lt;/p&gt;&#xA;" OwnerUserId="2240" LastEditorUserId="2240" LastEditDate="2014-10-24T13:17:48.650" LastActivityDate="2014-10-24T13:17:48.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2549" PostTypeId="2" ParentId="2545" CreationDate="2014-10-24T13:22:37.933" Score="5" Body="&lt;p&gt;The simple approach would be to just use rgrep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;use &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;rgrep&lt;/code&gt; and specify searching for &quot;function&quot; in the current file in the current directory. You can wrap this up in a command so you don't have to specify the options each time like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rgrep-lua-functions ()&#xA;  &quot;run `rgrep` searching for 'function' in the current file.&quot;&#xA;  (interactive)&#xA;  (rgrep &quot;function&quot; (file-name-nondirectory (buffer-file-name)) &quot;.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will yield a searchable buffer with the function signatures and you can jump to the definitions if you want.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-10-24T13:31:54.917" LastActivityDate="2014-10-24T13:31:54.917" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2550" PostTypeId="2" ParentId="2542" CreationDate="2014-10-24T13:25:21.423" Score="2" Body="&lt;p&gt;tabulated-list-mode (used by list-packages) might be what you need. &lt;/p&gt;&#xA;" OwnerUserId="2173" LastActivityDate="2014-10-24T13:25:21.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2551" PostTypeId="1" AcceptedAnswerId="2628" CreationDate="2014-10-24T13:40:40.880" Score="4" ViewCount="1454" Body="&lt;p&gt;When trying to install the new emacs I'm getting an error about libpng15 being missing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ./configure&#xA;...&#xA;$ make all&#xA;...&#xA;/usr/bin/ld: cannot find -lpng15&#xA;collect2: ld returned 1 exit status&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have libpng12 installed. How can I make emacs use that library instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is the configuration output of &lt;code&gt;./configure&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Configured for `x86_64-unknown-linux-gnu'.&#xA;&#xA;  Where should the build process find the source code?    .&#xA;  What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2&#xA;  Should Emacs use the GNU version of malloc?             yes&#xA;      (Using Doug Lea's new malloc from the GNU C Library.)&#xA;  Should Emacs use a relocating allocator for buffers?    no&#xA;  Should Emacs use mmap(2) for buffer allocation?         no&#xA;  What window system should Emacs use?                    x11&#xA;  What toolkit should Emacs use?                          GTK2&#xA;  Where do we find X Windows header files?                Standard dirs&#xA;  Where do we find X Windows libraries?                   Standard dirs&#xA;  Does Emacs use -lXaw3d?                                 no&#xA;  Does Emacs use -lXpm?                                   yes&#xA;  Does Emacs use -ljpeg?                                  yes&#xA;  Does Emacs use -ltiff?                                  yes&#xA;  Does Emacs use a gif library?                           yes -lgif&#xA;  Does Emacs use a png library?                           yes -lpng15 -lz -lm&#xA;  Does Emacs use -lrsvg-2?                                no&#xA;  Does Emacs use imagemagick?                             no&#xA;  Does Emacs support sound?                               yes&#xA;  Does Emacs use -lgpm?                                   no&#xA;  Does Emacs use -ldbus?                                  yes&#xA;  Does Emacs use -lgconf?                                 yes&#xA;  Does Emacs use GSettings?                               no&#xA;  Does Emacs use a file notification library?             yes -lgio (gfile)&#xA;  Does Emacs use access control lists?                    no&#xA;  Does Emacs use -lselinux?                               yes&#xA;  Does Emacs use -lgnutls?                                yes&#xA;  Does Emacs use -lxml2?                                  yes&#xA;  Does Emacs use -lfreetype?                              yes&#xA;  Does Emacs use -lm17n-flt?                              no&#xA;  Does Emacs use -lotf?                                   no&#xA;  Does Emacs use -lxft?                                   yes&#xA;  Does Emacs directly use zlib?                           yes&#xA;  Does Emacs use toolkit scroll bars?                     yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ImageMagick is installed, so I'm not sure why Emacs doesn't see that. But more importantly, Emacs seems to think the libpng15 is available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And earlier...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;checking png.h usability... yes&#xA;checking png.h presence... yes&#xA;checking for png.h... yes&#xA;checking for png_get_channels in -lpng... yes&#xA;checking whether png_longjmp is declared... no&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="55" LastEditorUserId="50" LastEditDate="2014-10-30T20:38:18.750" LastActivityDate="2015-03-04T20:30:23.667" Title="installing Emacs 24.4 from source on CentOS5 with libpng12" Tags="|emacs24.4|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2552" PostTypeId="2" ParentId="2538" CreationDate="2014-10-24T14:13:23.207" Score="7" Body="&lt;p&gt;The correct way: fill a bug report through the proper channel of your project, e.g. &lt;code&gt;org-submit-bug-report&lt;/code&gt; or &lt;code&gt;report-emacs-bug&lt;/code&gt; and argue why the syntax class of your favourite character should be changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could modify the proper syntax-table, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;(info &quot;(elisp) Syntax Tables&quot;)&lt;/code&gt;&lt;/a&gt;, in your &lt;code&gt;init.el&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's try Org:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'org&#xA;  (modify-syntax-entry ?/ &quot;(/&quot; org-mode-syntax-table)&#xA;  (modify-syntax-entry ?= &quot;(=&quot; org-mode-syntax-table)&#xA;  (add-hook 'org-mode-hook 'electric-pair-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use the fallback variables.  Here's a defun that should work, but that you might want to make prettier:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun rasmus/electric-pairs-with-local-pairs (pairs)&#xA;  &quot;Start electric pair with buffer-local PAIRS.&#xA;&#xA;  PAIRS is a list of strings and/or cons of strings.&quot;&#xA;  (require 'elec-pair)&#xA;  (let ((ec-lists '(electric-pair-pairs electric-pair-text-pairs)))&#xA;    (mapc 'make-local-variable ec-lists)        &#xA;    (mapc (lambda (L)&#xA;            (mapc (lambda (elm) (add-to-list L elm))&#xA;                  (mapcar (lambda (x)&#xA;                            (if (consp x)&#xA;                                (cons (string-to-char (car x))&#xA;                                      (string-to-char (cdr x)))&#xA;                              (cons (string-to-char x)&#xA;                                    (string-to-char x))))&#xA;                          pairs)))&#xA;          ec-lists))&#xA;  (electric-pair-mode t))&#xA;&#xA;(with-eval-after-load 'org&#xA;  (add-hook 'org-mode-hook&#xA;            (lambda ()&#xA;              (rasmus/electric-pairs-with-local-pairs&#xA;               '(&quot;/&quot; &quot;=&quot; (&quot;`&quot; . &quot;'&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="13416" LastEditDate="2019-08-15T19:31:07.370" LastActivityDate="2019-08-15T19:31:07.370" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="2553" PostTypeId="2" ParentId="2545" CreationDate="2014-10-24T14:52:06.933" Score="7" Body="&lt;p&gt;Would &lt;code&gt;occur&lt;/code&gt; work for you?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;occur&lt;/code&gt; or &lt;code&gt;M-s o&lt;/code&gt; then entering your query will provide you with a list of lines matching that regexp.  You can then use &lt;code&gt;C-s&lt;/code&gt; to search within the Occur buffer to refine your search within the matching lines.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-10-24T14:52:06.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2554" PostTypeId="2" ParentId="2538" CreationDate="2014-10-24T15:02:14.577" Score="2" Body="&lt;p&gt;This answer doesn't answer your question on how to configure &lt;code&gt;electric-pair-mode&lt;/code&gt;. But it might lead you to the results you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/rejeep/wrap-region.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;wrap-region&lt;/code&gt;&lt;/a&gt; package available on Melpa might be the answer to your problem. Here is its brief description from its github:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wrap Region is a minor mode for Emacs that wraps a region with punctuations. For &quot;tagged&quot; markup modes, such as HTML and XML, it wraps with tags.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is how I have set it to work in my selected modes. The snippet also covers the points you raised in your question; about &lt;code&gt;org-mode&lt;/code&gt; font property markers. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'wrap-region)&#xA;&#xA;;; Enable wrap-region in the following major modes&#xA;(dolist (hook '(emacs-lisp-mode-hook&#xA;                org-mode-hook))&#xA;  (add-hook hook 'wrap-region-mode))&#xA;&#xA;(wrap-region-add-wrapper &quot;`&quot; &quot;'&quot;) ; select region, hit ` then region -&amp;gt; `region'&#xA;&#xA;(wrap-region-add-wrapper &quot;=&quot; &quot;=&quot; nil 'org-mode) ; select region, hit = then region -&amp;gt; =region= in org-mode&#xA;(wrap-region-add-wrapper &quot;*&quot; &quot;*&quot; nil 'org-mode) ; select region, hit * then region -&amp;gt; *region* in org-mode&#xA;(wrap-region-add-wrapper &quot;/&quot; &quot;/&quot; nil 'org-mode) ; select region, hit / then region -&amp;gt; /region/ in org-mode&#xA;(wrap-region-add-wrapper &quot;_&quot; &quot;_&quot; nil 'org-mode) ; select region, hit _ then region -&amp;gt; _region_ in org-mode&#xA;(wrap-region-add-wrapper &quot;+&quot; &quot;+&quot; nil 'org-mode))) ; select region, hit + then region -&amp;gt; +region+ in org-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to add that this package works really well with the &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;expand-region&lt;/code&gt;&lt;/a&gt; package (also available on Melpa).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With these 2 packages, when I am in &lt;code&gt;org-mode&lt;/code&gt;, doing: &lt;code&gt;MY-EXPAND-REGION-BINDING&lt;/code&gt; &lt;code&gt;*&lt;/code&gt; on a word will make it bold.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-24T15:11:06.070" LastActivityDate="2014-10-24T15:11:06.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2555" PostTypeId="2" ParentId="2497" CreationDate="2014-10-24T15:03:14.217" Score="10" Body="&lt;p&gt;If have been using &lt;strong&gt;Juri Linkov&lt;/strong&gt;'s solution for years.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I create temporary buffers with something like &lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;b&lt;/code&gt; &lt;code&gt;test.org&lt;/code&gt; &lt;code&gt;C-j&lt;/code&gt;.  The &lt;code&gt;major-mode&lt;/code&gt; is determined by file extension via &lt;code&gt;auto-mode-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; http://thread.gmane.org/gmane.emacs.devel/115520/focus=115794&#xA;(setq-default major-mode&#xA;              (lambda () (if buffer-file-name&#xA;                          (fundamental-mode)&#xA;                            (let ((buffer-file-name (buffer-name)))&#xA;                          (set-auto-mode)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To test the effect you can try &lt;code&gt;(prog1 (and (switch-to-buffer &quot;my-new.org&quot;) major-mode) (kill-buffer &quot;my-new.org&quot;))&lt;/code&gt; &lt;code&gt;=&amp;gt;&lt;/code&gt; &lt;code&gt;org-mode&lt;/code&gt;.  In a clean &lt;code&gt;emacs -q&lt;/code&gt; the test would return &lt;code&gt;fundamental-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2014-10-25T13:22:18.387" LastActivityDate="2014-10-25T13:22:18.387" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2556" PostTypeId="2" ParentId="2545" CreationDate="2014-10-24T15:20:02.260" Score="4" Body="&lt;p&gt;Emacs has a command called &lt;code&gt;occur&lt;/code&gt; that is very well suited to this type of task.  If you have Helm installed, then you can use &lt;code&gt;helm-occur&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Occur&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;occur&lt;/code&gt; command is part of vanilla emacs, and is bound to &lt;code&gt;M-s o&lt;/code&gt; by default.  Occur will prompt you for a regexp to search for, and then it will open a new window showing all of the lines in the current buffer that contain a match.  The resulting &lt;code&gt;*Occur*&lt;/code&gt; buffer is searchable using &lt;code&gt;isearch&lt;/code&gt; (&lt;code&gt;C-s&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-s o function RET&lt;/code&gt;  to show all lines matching &quot;function&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x o&lt;/code&gt; to move focus to the &lt;code&gt;*Occur*&lt;/code&gt; buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s&lt;/code&gt; to start a search within the search results&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Helm Occur&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you have helm installed you can use &lt;code&gt;helm-occur&lt;/code&gt; to do something similar.  In this case, the &lt;code&gt;*Helm Occur*&lt;/code&gt; buffer will not be directly searchable with &lt;code&gt;C-s&lt;/code&gt;.  In Helm you can search for multiple search terms just by separating them with a space.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x helm-occur RET&lt;/code&gt; to open a Helm Occur window&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;function&lt;/code&gt; to show all lines containing &quot;function&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SPC foo&lt;/code&gt; to narrow the results to lines also containing foo&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In either of these modes, selecting the match in the occur buffer and pressing enter will jump you to that line in the code.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-24T15:20:02.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2557" PostTypeId="2" ParentId="2530" CreationDate="2014-10-24T15:28:35.700" Score="2" Body="&lt;p&gt;You solution can be achieved in one of the two ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You define your own minor mode whose key-bindings overrides the bindings set by all other minor/major modes.&lt;/li&gt;&#xA;&lt;li&gt;You set that particular key-binding in that minor/major mode to &lt;code&gt;nil&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These solutions can be implemented in multiple ways and they have been presented in detail in these Emacs SE and SO posts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs SE Question: &lt;a href=&quot;https://emacs.stackexchange.com/q/352/115&quot;&gt;How to override major mode bindings&lt;/a&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;My preferred solution is to have &lt;a href=&quot;https://emacs.stackexchange.com/a/358/115&quot;&gt;my own minor-mode&lt;/a&gt; so that I have full control of enabling/disabling the overrides done by my minor mode. By default I set all the key-bindings in my minor mode key map. I do &lt;code&gt;global-set-key&lt;/code&gt; only for the bindings that I want to be overriden (very few cases).&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;SO Question: &lt;a href=&quot;https://stackoverflow.com/q/683425/1219634&quot;&gt;Globally override key binding in Emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-24T15:28:35.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2558" PostTypeId="2" ParentId="2404" CreationDate="2014-10-24T15:43:39.540" Score="4" Body="&lt;p&gt;You get the correct and expected output.  Per the Org Syntax, (Greater) Elements cannot contain (Greater) Elements of the same type.  Please refer to the &lt;a href=&quot;http://orgmode.org/worg/dev/org-syntax.html#Greater_Elements&quot; rel=&quot;nofollow&quot;&gt;Org Syntax&lt;/a&gt;.  You are free to install violations/hacks of the syntax via filters but I think it won't be easy in this case.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Syntax makes sense.  I only know &lt;em&gt;your&lt;/em&gt; expected output of the given input because you told me!  There is not a unique way to match the &lt;code&gt;#+BEGIN_QUOTE&lt;/code&gt; and &lt;code&gt;#+END_QUOTE&lt;/code&gt; in your example and naturally the first match is assumed to be the matching ending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use another &lt;code&gt;special block&lt;/code&gt; within your &lt;code&gt;quote&lt;/code&gt; block and fix it with a filter ex post. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rasmus/org-html-myquote-to-quote (block backend info)&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (when (string-match &quot;\\`&amp;lt;div class=\&quot;MYQUOTE\&quot;&amp;gt;&quot; block)&#xA;      (setq block (replace-match &quot;&amp;lt;blockquote&amp;gt;&quot; t nil block))&#xA;      (string-match &quot;&amp;lt;/div&amp;gt;\n\\'&quot; block)&#xA;      (setq block (replace-match &quot;&amp;lt;/blockquote&amp;gt;\n&quot; t nil block))&#xA;      block)))&#xA;&#xA;(let ((org-export-filter-special-block-functions&#xA;      '(rasmus/org-html-myquote-to-quote)))&#xA;    (with-temp-buffer&#xA;      (insert &quot;&#xA;#+BEGIN_QUOTE&#xA;hey ho&#xA;#+BEGIN_MYQUOTE&#xA; hey hey&#xA;#+END_MYQUOTE&#xA;#+BEGIN_ANOTHER_SPECIAL_BLOCK&#xA;is preserved as is&#xA;#+END_ANOTHER_SPECIAL_BLOCK&#xA;ho ho&#xA;#+END_QUOTE&quot;)&#xA;      (org-html-export-as-html nil nil nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;=&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;&#xA;&amp;lt;p&amp;gt;&#xA;hey ho&#xA;&amp;lt;/p&amp;gt;&#xA;&amp;lt;blockquote&amp;gt;&#xA;&amp;lt;p&amp;gt;&#xA;hey hey&#xA;&amp;lt;/p&amp;gt;&#xA;&#xA;&amp;lt;/blockquote&amp;gt;&#xA;&amp;lt;div class=&quot;ANOTHER_SPECIAL_BLOCK&quot;&amp;gt;&#xA;&amp;lt;p&amp;gt;&#xA;is preserved as is&#xA;&amp;lt;/p&amp;gt;&#xA;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;p&amp;gt;&#xA;ho ho&#xA;&amp;lt;/p&amp;gt;&#xA;&amp;lt;/blockquote&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2014-10-24T15:43:39.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2559" PostTypeId="2" ParentId="2538" CreationDate="2014-10-24T15:47:46.367" Score="12" Body="&lt;p&gt;An easy way to do this is by making &lt;code&gt;electric-pair-pairs&lt;/code&gt; and &lt;code&gt;electric-pair-text-pairs&lt;/code&gt; buffer-local and customizing them in hooks for relevant modes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Working example&lt;/strong&gt; for &lt;code&gt;org-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar org-electric-pairs '((?/ . ?/) (?= . ?=)) &amp;quot;Electric pairs for org-mode.&amp;quot;)&#xA;&#xA;(defun org-add-electric-pairs ()&#xA;  (setq-local electric-pair-pairs (append electric-pair-pairs org-electric-pairs))&#xA;  (setq-local electric-pair-text-pairs electric-pair-pairs))&#xA;&#xA;(add-hook 'org-mode-hook 'org-add-electric-pairs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that this approach is generalizable to other situations in which you want to modify the value of a global variable for specific modes.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Additional info: &lt;code&gt;setq-local&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/elisp.html&quot; rel=&quot;noreferrer&quot;&gt;Creating and Deleting Buffer-Local Bindings&lt;/a&gt; section of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/elisp.html&quot; rel=&quot;noreferrer&quot;&gt;Elisp manual&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Macro: &lt;code&gt;setq-local&lt;/code&gt; &lt;code&gt;variable&lt;/code&gt; &lt;code&gt;value&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This macro creates a buffer-local binding in the current buffer for &lt;code&gt;VARIABLE&lt;/code&gt;, and gives it the buffer-local value &lt;code&gt;VALUE&lt;/code&gt;. It is equivalent to calling &lt;code&gt;make-local-variable&lt;/code&gt; followed by &lt;code&gt;setq&lt;/code&gt;. &lt;code&gt;VARIABLE&lt;/code&gt; should be an unquoted symbol.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-25T14:00:26.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2561" PostTypeId="2" ParentId="2545" CreationDate="2014-10-24T16:13:19.777" Score="3" Body="&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can easily do this kind of thing. What you are asking for (if I understand correctly), is to &lt;em&gt;search only within certain&lt;/em&gt; &lt;strong&gt;&lt;em&gt;search contexts&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, as in this case, you might want to search only within &lt;em&gt;function definitions&lt;/em&gt; - the search contexts are function definitions. In Lisp, this would be things like &lt;code&gt;defun&lt;/code&gt;s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Icicles&lt;/strong&gt; has several predefined &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt; search commands&lt;/a&gt; for searching &lt;strong&gt;definitions&lt;/strong&gt; like this.  These are collectively called &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Other_Search_Commands#IciclesImenu&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt; Imenu commands&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To search only command definitions, you can use command &lt;code&gt;icicle-imenu-command-full&lt;/code&gt;.  To search only non-interactive function definitions, use command &lt;code&gt;icicle-imenu-non-interactive-function-full&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond searching definitions, you can easily define any kind of contexts to be searched. The simplest way is by providing a regexp. Command &lt;code&gt;icicle-search&lt;/code&gt; prompts you for the search context-defining regexp. You can alternatively use a function to define the search contexts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other possibilities include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Searching the text of different kinds of THINGs (e.g., sexps, sentences, lists,&#xA;strings, comments, XML elements,...), i.e., ignoring other text outside the THINGs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Searching zones of text that have given text or overlay properties, i.e., ignoring other text.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other answers here that mention &lt;code&gt;occur&lt;/code&gt; and similar (&lt;code&gt;helm-occur&lt;/code&gt;) provide a limited kind of context searching:  the search contexts are just the &lt;strong&gt;lines&lt;/strong&gt; of a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is much more limited that, say, searching within whole function definitions, which is what I think you are asking for.  With &lt;strong&gt;Icicles&lt;/strong&gt;, command &lt;code&gt;icicle-occur&lt;/code&gt; (bound to &lt;code&gt;C-c '&lt;/code&gt;) lets you search within lines as search contexts.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-24T16:13:19.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2562" PostTypeId="2" ParentId="2542" CreationDate="2014-10-24T17:03:25.040" Score="3" Body="&lt;p&gt;A followup to @rekado's great answer -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do this kind of thing all the time. I often put the entire alist on the buffer text (or on a string, depending on the use case), as a text-property value: &lt;code&gt;(propertize string 'my-data the-alist)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's worth pointing out, because it might not be obvious to everyone, that the &lt;strong&gt;actual data - not a copy&lt;/strong&gt; of it, is being used as the property value (including in what @rekado described).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mention this not because it means that there is little cost (just a pointer). It is important because it means that any &lt;strong&gt;changes to the object&lt;/strong&gt; (the alist, or parts of it as in @rekado's example) are &lt;strong&gt;automatically reflected&lt;/strong&gt; in any string or text that holds such a property. You always have access to the current state of the object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And note that this trick works even when the &lt;em&gt;propertized string is itself&lt;/em&gt; &lt;strong&gt;&lt;em&gt;part of the object&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;whose value is put on the string&lt;/em&gt;! (For example, the object is a cons whose car is the propertized string.) This kind of sharing is what nasty-old-side-effecty Lisp is about - as opposed to a functional language, for example.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-24T17:03:25.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2563" PostTypeId="1" AcceptedAnswerId="2572" CreationDate="2014-10-24T17:53:31.400" Score="12" ViewCount="5134" Body="&lt;p&gt;A pretty basic Helm question.  What is the Helm window/command/feature that lets us search for text (preferably using &lt;code&gt;regexp&lt;/code&gt;) within any type of buffer (i.e., including read-only such as &lt;code&gt;w3m&lt;/code&gt;)?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I'm looking for Helm's equivalent of Emacs' native commands for &lt;code&gt;isearch-forward&lt;/code&gt; (&lt;code&gt;C-s&lt;/code&gt;) / &lt;code&gt;isearch-backward&lt;/code&gt; (&lt;code&gt;C-r&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate: after invoking one of the native &lt;code&gt;isearch&lt;/code&gt; commands (&lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;C-r&lt;/code&gt;), we can exit search mode in one of two ways: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;we can exit and return to original point (via &lt;code&gt;C-g&lt;/code&gt;), or&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;we can exit and continue browsing buffer from current point i.e., from the&#xA;currently-matched text (via &lt;code&gt;RET&lt;/code&gt; among others).  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm looking for the second of these two options.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's what I've tried so far:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;helm-regexp&lt;/code&gt;: this is the closest thing to what I'm looking for but it only performs the equivalent of &lt;code&gt;C-s&lt;/code&gt;/&lt;code&gt;C-r&lt;/code&gt; + &lt;code&gt;C-g&lt;/code&gt; (i.e., it takes us back to the original point; no option for terminating the search and continuing to browse the buffer from the currently matched point).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;helm-do-grep&lt;/code&gt;: it seems like this is only for searching for text within files (i.e., doesn't work on w3m)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;helm-buffer-run-grep&lt;/code&gt; / &lt;code&gt;-zgrep&lt;/code&gt;: running this command/function results in an error message in the mini-buffer: &lt;code&gt;Running helm command outside of context&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;when &lt;code&gt;helm-mode&lt;/code&gt; is enabled, invoking &lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;C-r&lt;/code&gt; brings up Emacs' native &lt;code&gt;isearch&lt;/code&gt; feature (it isn't replaced by Helm's interface).  (maybe there's a setting we can change so Helm can take over this command?  i.e., similar to how Helm takes over the native command for &lt;code&gt;write-file&lt;/code&gt; (&lt;code&gt;C-x C-w&lt;/code&gt;) which can be used to rename a file in an open buffer.  just brainstorming.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2084" LastActivityDate="2014-10-25T00:54:20.703" Title="Helm: search within buffer feature?" Tags="|helm|search|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2564" PostTypeId="2" ParentId="2501" CreationDate="2014-10-24T17:55:07.507" Score="14" Body="&lt;p&gt;If you changed something in &lt;em&gt;.Xresources&lt;/em&gt; file then you need to &lt;strong&gt;reread&lt;/strong&gt; it to see any changes in current session.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;To &lt;strong&gt;keep&lt;/strong&gt; your old resources settings and apply new one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xrdb -merge ~/.Xresources&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To &lt;strong&gt;throw away&lt;/strong&gt; your old resources and apply only settings from &lt;em&gt;.Xresources&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xrdb ~/.Xresources&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Adjustments in &lt;em&gt;.Xresources&lt;/em&gt; file are better, because they are applied before mapping emacs' X11 window. Customizations in init files (.emacs, .emacs.d/) are re-applied to already created window.&#xA;You can for example avoid toolbars &quot;flickering&quot; during startup when you add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;! UI elements&#xA;Emacs.menuBar: 0&#xA;Emacs.toolBar: 0&#xA;Emacs.verticalScrollBars: off&#xA;! Font settings&#xA;Emacs.FontBackend: xft,x&#xA;Emacs.font: Inconsolata LGC:size=16&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;em&gt;.Xresources&lt;/em&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check what else is available at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="220" LastEditorUserId="220" LastEditDate="2014-10-24T18:03:16.460" LastActivityDate="2014-10-24T18:03:16.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2565" PostTypeId="2" ParentId="2508" CreationDate="2014-10-24T18:02:30.950" Score="3" Body="&lt;p&gt;You can use the built-in &lt;code&gt;hi-lock&lt;/code&gt; feature to highlight patterns in the current buffer. As @Drew suggested in his answer, you can use this interactively or in a mode hook to highlight interesting patterns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;highlight-regexp&lt;/code&gt; is bound to &lt;code&gt;M-s h r&lt;/code&gt; by default and prompts for a regular expression and a highlight color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also define a mode hook to highlight patterns automatically. For example you can highlight alphabetic characters preceded by &lt;code&gt;\&lt;/code&gt; or &lt;code&gt;%&lt;/code&gt; in all programming modes using something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook '(lambda () &#xA;        (highlight-regexp &quot;%[[:alpha:]]\\|\\\\[[:alpha:]]&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-24T18:02:30.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2566" PostTypeId="2" ParentId="2426" CreationDate="2014-10-24T18:28:36.357" Score="4" Body="&lt;h1&gt;Solution&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start a &lt;code&gt;file-notify&lt;/code&gt; watch when opening a file in &lt;code&gt;eww&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;In the callback function for that watch, do 2 things:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reload the *eww* buffer every time the function is triggered by &lt;code&gt;file-notify&lt;/code&gt; event.&lt;/li&gt;&#xA;&lt;li&gt;Log the event descriptors specific to file opening actions in &lt;code&gt;eww&lt;/code&gt;. This is because you need to know which &lt;code&gt;file-notify&lt;/code&gt; watches to remove when you quit &lt;code&gt;eww&lt;/code&gt; (especially if you use the watches for other purposes than this too).&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;On quitting &lt;code&gt;eww&lt;/code&gt; remove all the watches related to &lt;code&gt;eww&lt;/code&gt;. You have to make sure that you call this specific function to quit &lt;code&gt;eww&lt;/code&gt; and clean up the now-not-required watches.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;How to use&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Copy the below implementation to your &lt;code&gt;init.el&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Launch any file you want to load in &lt;code&gt;eww&lt;/code&gt; using &lt;code&gt;C-u M-x eww-open-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Make sure you quit &lt;code&gt;eww&lt;/code&gt; by calling &lt;code&gt;modi/eww-quit-and-update-fn-descriptors&lt;/code&gt;. For convenience, the default binding &lt;kbd&gt;q&lt;/kbd&gt; in &lt;code&gt;eww-mode-map&lt;/code&gt; is now bound to this function. If you use any other binding to quit &lt;code&gt;eww&lt;/code&gt; or to kill windows, make sure you call this function. &lt;code&gt;modi/eww-quit-and-update-fn-descriptors&lt;/code&gt; ensures that the eww-specific file-notify watches are removed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Implementation&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar modi/eww--file-notify-descriptors-list ()&#xA;  &quot;List to store file-notify descriptor for all files that have an&#xA;associated auto-reloading eww buffer.&quot;)&#xA;&#xA;(defun modi/advice-eww-open-file-to-auto-reload (orig-fun &amp;amp;rest args)&#xA;  &quot;When `eww-open-file' is called with \\[universal-argument], open&#xA;the file in eww and also add `file-notify' watch for it so that the eww&#xA;buffer auto-reloads when the HTML file changes.&quot;&#xA;  (prog1&#xA;      (apply orig-fun args)&#xA;    (when current-prefix-arg ; C-u M-x eww-open-file&#xA;      (require 'filenotify)&#xA;      (let ((file-name (car args)))&#xA;        (file-notify-add-watch file-name&#xA;                               '(change attribute-change)&#xA;                               #'modi/file-notify-callback-eww-reload)&#xA;        ;; Show the HTML file and its rendered form in eww side-by-side&#xA;        (find-file-other-window file-name))&#xA;      ;; Redefine the `q' binding in `eww-mode-map'&#xA;      (bind-key &quot;q&quot; #'modi/eww-quit-and-update-fn-descriptors eww-mode-map))))&#xA;(advice-add 'eww-open-file :around #'modi/advice-eww-open-file-to-auto-reload)&#xA;&#xA;(defun modi/file-notify-callback-eww-reload (event)&#xA;  &quot;On getting triggered, switch to the eww buffer, reload and switch&#xA;back to the working buffer. Also save the `file-notify-descriptor' of the&#xA;triggering event.&quot;&#xA;  (let* ((working-buffer (buffer-name)))&#xA;    (switch-to-buffer-other-window &quot;eww&quot;)&#xA;    (eww-reload)&#xA;    (switch-to-buffer-other-window working-buffer))&#xA;  ;; `(car event)' will return the event descriptor&#xA;  (add-to-list 'modi/eww--file-notify-descriptors-list (car event)))&#xA;&#xA;(defun modi/eww-quit-and-update-fn-descriptors ()&#xA;  &quot;When quitting `eww', first remove any saved file-notify descriptors&#xA;specific to eww, while also updating `modi/eww--file-notify-descriptors-list'.&quot;&#xA;  (interactive)&#xA;  (dotimes (index (safe-length modi/eww--file-notify-descriptors-list))&#xA;    (file-notify-rm-watch (pop modi/eww--file-notify-descriptors-list)))&#xA;  (quit-window :kill))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Assumptions&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You have only one *eww* buffer open.&lt;/li&gt;&#xA;&lt;li&gt;This solution requires emacs 24.4 or newer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-02-18T18:15:44.063" LastActivityDate="2016-02-18T18:15:44.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2567" PostTypeId="1" AcceptedAnswerId="2579" CreationDate="2014-10-24T19:02:13.887" Score="11" ViewCount="796" Body="&lt;p&gt;I have a list of file names (with full path) and I want to create a Dired buffer listing this set of files. How would I go about doing that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I create a Dired buffer from a list of file names?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without using external dependencies.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="50" LastEditDate="2014-10-24T21:38:53.077" LastActivityDate="2015-05-01T18:33:59.620" Title="Programmatically insert files into Dired buffer" Tags="|elisp|dired|files|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2568" PostTypeId="1" AcceptedAnswerId="2840" CreationDate="2014-10-24T19:07:32.653" Score="12" ViewCount="2809" Body="&lt;p&gt;I started using Emacs and I wrote a text in Greek. The problem is that the stress that is used upon some letters (ό, ύ, ί, ύ) doesn't work! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is usually inserted by pressing the &lt;code&gt;;&lt;/code&gt; (I mean by pressing the key next to L) and then the letter upon which will be inserted. That's standard for a Greek keyboard. When I press the &lt;code&gt;;&lt;/code&gt; it says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;dead-acute&amp;gt; is undefined. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h c ;&lt;/code&gt; says the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to be able to use this key?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works in other applications, such as a browser. I use Ubuntu 14.04 and I installed its &lt;code&gt;emacs&lt;/code&gt; package (Emacs 24.3.1).&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="25" LastEditDate="2015-01-02T02:26:47.757" LastActivityDate="2020-08-24T15:20:45.803" Title="Problem &quot;&lt;dead-acute&gt; is undefined&quot; appearing when typing Greek stress ( ' )" Tags="|key-bindings|input-method|linux|" AnswerCount="5" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2569" PostTypeId="2" ParentId="2508" CreationDate="2014-10-24T19:48:46.487" Score="3" Body="&lt;p&gt;The following handles the basic case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface my-backslash-escape-backslash-face&#xA;  '((t :inherit font-lock-regexp-grouping-backslash))&#xA;  &quot;Face for the back-slash component of a back-slash escape.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface my-backslash-escape-char-face&#xA;  '((t :inherit font-lock-regexp-grouping-construct))&#xA;  &quot;Face for the charcter component of a back-slash escape.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface my-format-code-format-face&#xA;  '((t :inherit font-lock-regexp-grouping-backslash))&#xA;  &quot;Face for the % component of a printf format code.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface my-format-code-directive-face&#xA;  '((t :inherit font-lock-regexp-grouping-construct))&#xA;  &quot;Face for the directive component of a printf format code.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;&#xA;(font-lock-add-keywords 'c-mode&#xA;   '((&quot;\\(\\\\\\).&quot; 1 'my-backslash-escape-backslash-face prepend)&#xA;     (&quot;\\\\\\(.\\)&quot; 1 'my-backslash-escape-char-face      prepend)&#xA;     (&quot;\\(%\\).&quot;    1 'my-format-code-format-face         prepend)&#xA;     (&quot;%\\(.\\)&quot;    1 'my-format-code-directive-face      prepend)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't often type backslash escapes outside of strings but a more elaborate regex might handle that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Format specifiers have a lot of options so you might also want a more elaborate regex to handle those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Feel free to edit this if you're a regex ninja...)&lt;/p&gt;&#xA;" OwnerUserId="2249" LastActivityDate="2014-10-24T19:48:46.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2570" PostTypeId="1" CreationDate="2014-10-24T20:00:57.197" Score="1" ViewCount="712" Body="&lt;p&gt;Ever since upgrading to emacs 24.4.1, when I set something as 'done' from the agenda, I frequently get the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in post-command-hook (org-add-log-note): (error &quot;Variable binding depth exceeds   max-specpdl-size&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When this happens, the Agenda does not reappear and the org buffer being modified continues being show.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to debug this?&lt;/p&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="45" LastEditDate="2014-10-24T20:21:42.320" LastActivityDate="2014-10-25T02:13:48.533" Title="Error in post-command-hook during org-agenda-todo" Tags="|org-mode|error-handling|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2571" PostTypeId="1" AcceptedAnswerId="2588" CreationDate="2014-10-24T21:59:49.537" Score="18" ViewCount="2705" Body="&lt;p&gt;Please maintain a community wiki answer which describes email lists, wikis, blogs, irc channels, forums, or other communities in which GNU Emacs is the primary topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to be listed, a community must be 'open', meaning that anyone can participate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exceptions to that rule can, should, and have been made.  Employ judgement.  For example: of course Sacha's blog and Xah's site belong on this list.&lt;/p&gt;&#xA;" OwnerUserId="870" LastEditorUserId="870" LastEditDate="2014-10-29T16:32:47.447" LastActivityDate="2018-08-27T02:30:42.220" Title="What emacs communities exist?" Tags="|learning|" AnswerCount="4" CommentCount="6" CommunityOwnedDate="2014-11-10T21:34:36.060" ContentLicense="CC BY-SA 3.0" />
  <row Id="2572" PostTypeId="2" ParentId="2563" CreationDate="2014-10-24T22:31:49.900" Score="17" Body="&lt;p&gt;You can use helm-occur as a tool that comes with the basic helm module for this.&#xA;But to me, one of the best helm based tools for buffer searching is Shingo Fukuyama's &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot;&gt;helm-swoop&lt;/a&gt;. You can get it from github and via MELPA. It has your required functionality of being able to drop your point at the position of the match (which can be a regexp). But you can also use C-g to have the cursor back where you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the helm-swoop github page you'll find a whole bunch of other useful functions that this package offers (including multi-buffer searches by helm-multi-swoop and the ability of editing the lines of the results, so that the changes are applied to the underlying buffer).&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="2025" LastEditDate="2014-10-24T23:01:03.220" LastActivityDate="2014-10-24T23:01:03.220" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2573" PostTypeId="1" AcceptedAnswerId="3045" CreationDate="2014-10-24T23:14:31.300" Score="10" ViewCount="3202" Body="&lt;p&gt;I am trying to get &lt;code&gt;shell-command&lt;/code&gt; and &lt;code&gt;async-shell-command&lt;/code&gt; to integrate seamlessly with a couple of programs in my &lt;code&gt;.bashrc&lt;/code&gt; file, specifically &lt;a href=&quot;http://direnv.net/&quot;&gt;direnv&lt;/a&gt; in this example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that if I customized &lt;code&gt;shell-command-switch&lt;/code&gt;, I could get shell processes to load my profile as if it were a regular interactive login shell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;(setq shell-command-switch (purecopy &quot;-ic&quot;))&#xA;(setq explicit-bash-args '(&quot;-ic&quot; &quot;export EMACS=; stty echo; bash&quot;))&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am also using &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have a &lt;code&gt;~/.bashrc&lt;/code&gt; file with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;...&#xA;&#xA;eval &quot;$(direnv hook $0)&quot;&#xA;echo &quot;foo&quot;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inside &lt;code&gt;~/code/foo&lt;/code&gt; I have a &lt;code&gt;.envrc&lt;/code&gt; file with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;export PATH=$PWD/bin:$PATH&#xA;echo &quot;bar&quot;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;M-x shell&lt;/code&gt; with &lt;code&gt;default-directory&lt;/code&gt; set to &lt;code&gt;~/code/foo&lt;/code&gt;, a bash shell will correctly load my profile and run the direnv hook to add that to my path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;direnv: loading .envrc&#xA;bar&#xA;direnv: export ~PATH&#xA;~/code/foo $ echo $PATH&#xA;/Users/username/code/foo/bin:/usr/local/bin:... # rest of $PATH&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However if &lt;code&gt;default-directory&lt;/code&gt; is still &lt;code&gt;~/code/foo&lt;/code&gt; and I run &lt;code&gt;M-! echo $PATH&lt;/code&gt;, it correctly loads my .bashrc but doesn't execute the direnv hook of the current directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;foo&#xA;/usr/local/bin:... # rest of $PATH without ./bin&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the same result if I run &lt;code&gt;M-! cd ~/code/foo &amp;amp;&amp;amp; echo $PATH&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can advise or hook into &lt;code&gt;shell-command&lt;/code&gt; or &lt;code&gt;start-process&lt;/code&gt; to make it behave as if it were being sent from an interactive shell buffer?&lt;/p&gt;&#xA;" OwnerUserId="264" LastEditorUserId="264" LastEditDate="2014-11-03T02:00:42.073" LastActivityDate="2017-03-14T10:37:41.193" Title="How to make shell-command run using shell profile and current directory hooks (ex. direnv)" Tags="|shell|process|comint|environment|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2574" PostTypeId="1" AcceptedAnswerId="2576" CreationDate="2014-10-25T00:42:41.980" Score="7" ViewCount="2148" Body="&lt;p&gt;In order to uninstall a package from Emacs I read that I must delete the specific folder from the elpa folder. As the .emacs file is being written by itself when I install a package does that mean that it will also delete itself when I uninstall a package or I must delete specific entries by myself? Also I installed an auto complete package and inside elpa folder I found a folder with the name &lt;code&gt;popup-20141002.320&lt;/code&gt;. Why was that folder in there? Can packages install other packages? If so then when I uninstall the first package I must uninstall also the one it installed by itself?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2018-11-02T08:04:32.397" Title="Concerns regarding uninstalling packages" Tags="|package|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2575" PostTypeId="2" ParentId="2563" CreationDate="2014-10-25T00:54:20.703" Score="5" Body="&lt;p&gt;You can use &lt;code&gt;helm-occur&lt;/code&gt; to see all of the lines that contain matches for your search pattern.  You can use &lt;code&gt;C-n&lt;/code&gt; and &lt;code&gt;C-p&lt;/code&gt; to navigate the list, and then press &lt;code&gt;RET&lt;/code&gt; to close the Helm buffer and jump your cursor to the matching line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to enable &lt;code&gt;helm-follow-mode&lt;/code&gt; when I use &lt;code&gt;helm-occur&lt;/code&gt; so that the source window always shows the context of currently-selected match.  You can enable follow-mode automatically as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm-config)&#xA;&#xA;(defvar my-helm-follow-sources ()&#xA;  &quot;List of sources for which helm-follow-mode should be enabled&quot;)&#xA;&#xA;;; Use helm-follow-mode for the following sources:&#xA;(add-to-list 'my-helm-follow-sources 'helm-source-occur)&#xA;&#xA;(defun my-helm-set-follow ()&#xA;  &quot;Enable helm-follow-mode for the sources specified in the list&#xA;variable `my-helm-follow-sources'. This function is meant to&#xA;be run during `helm-initialize' and should be added to the hook&#xA;`helm-before-initialize-hook'.&quot;&#xA;  (mapc (lambda (source)&#xA;          (when (memq source my-helm-follow-sources)&#xA;            (helm-attrset 'follow 1 (symbol-value source))))&#xA;        helm-sources))&#xA;&#xA;;; Add hook to enable helm-follow mode for specified helm &#xA;(add-hook 'helm-before-initialize-hook 'my-helm-set-follow)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-25T00:54:20.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2576" PostTypeId="2" ParentId="2574" CreationDate="2014-10-25T01:02:27.573" Score="10" Body="&lt;p&gt;When you uninstall a package, it is deleted for you. This is actually the entirety of the uninstall operation (see the &lt;code&gt;package-delete&lt;/code&gt; function). Deletion can also be done manually by removing it from the installation directory (defaulting to &lt;code&gt;.emacs.d/elpa/&lt;/code&gt; for user-installed packages). This manual deletion does &lt;em&gt;not&lt;/em&gt; have any adverse side-effects on the package-management system, which simplifies recovery should things go wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Packages may depend on other packages in order to function properly. These &lt;em&gt;dependencies&lt;/em&gt; are automatically installed when you install a package through the built-in package manager (&lt;code&gt;package.el&lt;/code&gt;). If you are using &lt;code&gt;M-x package-list-packages&lt;/code&gt; to view available packages, then you can see what packages will be installed (if they are not present) by pressing &lt;code&gt;RET&lt;/code&gt; or clicking on a package name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Uninstalling a package through the interface does &lt;em&gt;not&lt;/em&gt; remove dependencies. This information is not documented ăs far as I can tell. You can see for yourself by reading through the &lt;code&gt;package-menu-execute&lt;/code&gt; and &lt;code&gt;package-delete&lt;/code&gt; functions or by installing a package with a dependency that you do not have installed, then removing the main package and observing the dependency's status.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt; Since emacs 25.1 there is a command &lt;code&gt;package-autoremove&lt;/code&gt; that deletes packages no longer needed because they were only installed as a dependency of deleted package.  If you delete an installed package from the package list, then emacs pops up a suggestion to run this command when appropriate.&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="2710" LastEditDate="2018-11-02T08:04:32.397" LastActivityDate="2018-11-02T08:04:32.397" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2578" PostTypeId="2" ParentId="2570" CreationDate="2014-10-25T02:13:48.533" Score="5" Body="&lt;p&gt;&lt;code&gt;debug-on-error&lt;/code&gt;, and more generally the debugger, are &lt;strong&gt;not available for errors raised from &lt;code&gt;post-command-hook&lt;/code&gt;&lt;/strong&gt; (for example, to prevent runaway recursion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do is what programmers have done from Day One: print information. But before you do that, bisect the list of functions that you have on &lt;code&gt;post-command-hook&lt;/code&gt;, narrowing the problem down to determine the function (probably only one) that is causing the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then place calls to function &lt;code&gt;message&lt;/code&gt; at various places in that function's code (e.g. use a copy of the function definition). Use &lt;code&gt;message&lt;/code&gt; to print info about the code path executed, and also various state information - e.g., the value of relevant variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open buffer &lt;code&gt;*Messages*&lt;/code&gt; in a separate frame (&lt;code&gt;C-x 5 b&lt;/code&gt;), and place the cursor at the end of the buffer, so you can see what's going on. Then do what you do normally, which provokes the problem. You should be able to see, in &lt;code&gt;*Messages*&lt;/code&gt;, what is going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pretty much anything the debugger could tell you you can see using this method, anyway.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-25T02:13:48.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2579" PostTypeId="2" ParentId="2567" CreationDate="2014-10-25T02:18:05.307" Score="21" Body="&lt;p&gt;&lt;code&gt;C-h f dired&lt;/code&gt; tells you the answer.  Just pass to &lt;code&gt;dired&lt;/code&gt;, as the &lt;code&gt;DIRNAME&lt;/code&gt; argument, a list that has as its car the Dired buffer name you want (any string) and as cdr the list of file names you want listed in the buffer. Generally, you want to use absolute file names.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dired (list &quot;My Dired Buffer Name*&quot;     ; The Dired buffer name&#xA;             &quot;/usr/foo/file1.el&quot;         ; First file&#xA;             &quot;/usr/bar/toto/some-file.c&quot; ; Second file&#xA;             &quot;/whatever/directory/&quot;      ; Third is a directory&#xA;             &quot;/a/file/somewhere.zzz&quot;))   ; Fourth&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depending on your platform, names of any &lt;em&gt;nonexistent&lt;/em&gt; files and directories you enter might be ignored (not listed), or might raise an error.  The former happens if you use &lt;code&gt;ls-lisp.el&lt;/code&gt; (e.g. MS Windows).  You can force the use of &lt;code&gt;ls-lisp&lt;/code&gt; on any platform, if you like (but &lt;code&gt;ls-lisp&lt;/code&gt; has fewer &lt;code&gt;ls&lt;/code&gt; options), by doing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ls-lisp-use-insert-directory-program nil)&#xA;(require 'ls-lisp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/dired%2b.el&quot;&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/a&gt;) then you can interactively choose files and directories to list: just give &lt;code&gt;dired&lt;/code&gt; a non-positive prefix argument (i.e., &amp;lt;= 0). You are then prompted repeatedly for the directories and file names you want listed.  You can use file-name wildcards (i.e., &lt;code&gt;*&lt;/code&gt; for globbing), to include the matching files and directories.  Use &lt;code&gt;C-g&lt;/code&gt; to end inputting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, instead of listing a single directory, the Dired&#xA;buffer can list any number of directories and file names, which can&#xA;even belong to different directory trees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A non-negative prefix arg (i.e., &gt;= 0) prompts you for the &lt;code&gt;ls&lt;/code&gt; listing switches.  So a zero prefix arg prompts you for both switches and files/dirs to list: first the &lt;code&gt;ls&lt;/code&gt; switches and then the files/dirs.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-25T20:08:04.547" LastActivityDate="2014-10-25T20:08:04.547" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="2580" PostTypeId="1" AcceptedAnswerId="2581" CreationDate="2014-10-25T03:26:40.977" Score="1" ViewCount="560" Body="&lt;p&gt;I want to make it so that org-agenda-mode defaults to always having (org-agenda-follow-mode) toggled on.&lt;/p&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2244" LastEditDate="2014-10-25T04:31:50.893" LastActivityDate="2014-10-25T04:31:50.893" Title="make org-agenda-mode always have (org-agenda-follow-mode) toggled on" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2581" PostTypeId="2" ParentId="2580" CreationDate="2014-10-25T04:10:27.057" Score="6" Body="&lt;p&gt;You can set the variable &lt;code&gt;org-agenda-start-with-follow-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-10-25T04:10:27.057" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2582" PostTypeId="1" CreationDate="2014-10-25T05:05:19.800" Score="4" ViewCount="2739" Body="&lt;p&gt;I'm trying to set up haskell-mode following this instructions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[0] &lt;a href=&quot;https://github.com/haskell/haskell-mode/wiki/Haskell-Interactive-Mode-Setup&quot; rel=&quot;nofollow&quot;&gt;https://github.com/haskell/haskell-mode/wiki/Haskell-Interactive-Mode-Setup&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;http://tim.dysinger.net/posts/2014-02-18-haskell-with-emacs.html&quot; rel=&quot;nofollow&quot;&gt;http://tim.dysinger.net/posts/2014-02-18-haskell-with-emacs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but when I try to bring the REPL in a .hs file I'm getting the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Starting inferior `cabal repl' process using cabal ...&#xA;-&amp;gt; :set prompt &quot;\4&quot;&#xA;-&amp;gt; Prelude.putStrLn &quot;&quot;&#xA;-&amp;gt; :set -v1&#xA;&amp;lt;- cabal: unrecognised command: repl (try --help)&#xA;&#xA;Event: &quot;exited abnormally with code 1&#xA;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the &quot;cabal repl&quot; working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know what I'm missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I followed these steps [1]:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cabal --v&#xA;cabal-install version 1.20.0.3&#xA;using version 1.20.0.2 of the Cabal library &#xA;&#xA;$ cabal install happy alex&#xA;$ cabal install ghc-mod structured-haskell-mode stylish-haskell&#xA;&#xA;$ mkdir haskell-hello&#xA;$ cd haskell-hello&#xA;$ cabal init&#xA;$ touch LICENSE&#xA;$ cabal sandbox init&#xA;&#xA;$ perl -p -i -e 's/^.*main-is.*$/  main-is: Main.hs/' haskell-hello.cabal&#xA;$ echo 'main = putStrLn &quot;hello world&quot;' &amp;gt; Main.hs&#xA;$ cabal install&#xA;$ ./.cabal-sandbox/bin/haskell-hello&#xA;  hello world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I open the Main.hs in Emacs. In haskell-mode I try to open a REPL with &lt;code&gt;haskell-process-load-or-reload&lt;/code&gt; or &lt;code&gt;haskell-interactive-bring&lt;/code&gt; but this error appears:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;- cabal: unrecognised command: repl (try --help)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;cabal repl&lt;/code&gt; working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cabal repl&#xA;GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help&#xA;Loading package ghc-prim ... linking ... done.&#xA;Loading package integer-gmp ... linking ... done.&#xA;Loading package base ... linking ... done.&#xA;Prelude&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I eval&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(process-lines &quot;cabal repl&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the following result&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Searching for program: no such file or directory, cabal repl&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit 3:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My haskell configuration on .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; haskell&#xA;(require-package 'haskell-mode)&#xA;&#xA;(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)&#xA;&#xA;(eval-after-load &quot;haskell-mode&quot;&#xA;  '(progn&#xA;     (define-key haskell-mode-map (kbd &quot;C-,&quot;) 'haskell-move-nested-left)&#xA;     (define-key haskell-mode-map (kbd &quot;C-.&quot;) 'haskell-move-nested-right)))&#xA;&#xA;(define-key haskell-mode-map [f7] 'haskell-navigate-imports)&#xA;&#xA;(custom-set-variables '(haskell-stylish-on-save t))&#xA;&#xA;(add-hook 'haskell-mode-hook 'interactive-haskell-mode)&#xA;&#xA;(custom-set-variables '(haskell-process-type 'cabal-repl))&#xA;&#xA;(setq haskell-ghci-program-name &quot;cabal&quot;)&#xA;(setq haskell-ghci-program-args '(&quot;repl&quot;))&#xA;&#xA;(custom-set-variables&#xA;  '(haskell-process-suggest-remove-import-lines t)&#xA;  '(haskell-process-auto-import-loaded-modules t)&#xA;  '(haskell-process-log t))&#xA;&#xA;(define-key haskell-mode-map (kbd &quot;C-c C-g&quot;) 'haskell-interactive-bring)&#xA;(define-key haskell-mode-map (kbd &quot;C-c C-l&quot;) 'haskell-process-load-or-reload)&#xA;(define-key haskell-mode-map (kbd &quot;C-c C-t&quot;) 'haskell-process-do-type)&#xA;(define-key haskell-mode-map (kbd &quot;C-c C-i&quot;) 'haskell-process-do-info)&#xA;(define-key haskell-mode-map (kbd &quot;C-c C-c&quot;) 'haskell-process-cabal-build)&#xA;(define-key haskell-mode-map (kbd &quot;C-c C-k&quot;) 'haskell-interactive-mode-clear)&#xA;(define-key haskell-mode-map (kbd &quot;C-c c&quot;) 'haskell-process-cabal)&#xA;(define-key haskell-mode-map (kbd &quot;SPC&quot;) 'haskell-mode-contextual-space)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2254" LastEditorUserId="2254" LastEditDate="2014-10-25T20:26:13.767" LastActivityDate="2014-11-05T13:23:14.080" Title="Haskell Interactive Mode Setup - cabal unrecognised command: repl" Tags="|repl|haskell-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2583" PostTypeId="1" AcceptedAnswerId="2584" CreationDate="2014-10-25T06:12:00.347" Score="5" ViewCount="222" Body="&lt;p&gt;When I enable line numbers in Emacs the cursor starts in a line with no number in it. If you press enter then the numbers increment but always there is a line with no number. Why is that happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XpnrK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zWY2S.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="50" LastEditDate="2014-10-25T10:29:16.873" LastActivityDate="2014-10-25T11:30:13.440" Title="Confusion with line numbers" Tags="|linum-mode|line-numbers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2584" PostTypeId="2" ParentId="2583" CreationDate="2014-10-25T06:34:35.677" Score="5" Body="&lt;p&gt;Because the last line hasn't started yet. Adding newline symbol to the end makes the cursor jump from the current line to the next one, but it doesn't add anything to it (new one). Strictly speaking, it is not a line yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Supposing that every newline symbol was visible, you would get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. &amp;lt;newline_symbol&amp;gt;&#xA;2. &amp;lt;newline_symbol&amp;gt;&#xA;3. &amp;lt;newline_symbol&amp;gt;&#xA;   &amp;lt;cursor_there_and_nothing_else&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you start typing in this line, it receives some content, so the number will appear.&lt;/p&gt;&#xA;" OwnerUserId="7" LastEditorUserId="7" LastEditDate="2014-10-25T11:30:13.440" LastActivityDate="2014-10-25T11:30:13.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2586" PostTypeId="1" CreationDate="2014-10-25T09:12:09.550" Score="0" ViewCount="675" Body="&lt;p&gt;Let's say that I have a &lt;code&gt;makefile&lt;/code&gt; in &lt;code&gt;./&lt;/code&gt; and a file &lt;code&gt;./package/myclass.java&lt;/code&gt;. From &lt;code&gt;./&lt;/code&gt;, &lt;code&gt;make&lt;/code&gt; works just normally, but using flymake-mode in Emacs, I always get the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Flymake: No buildfile (Makefile) found for &amp;lt;/absolute/path/to/myclass.java&amp;gt;. Flymake will be switched OFF.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The flymake manual says something about a customizable variable called &lt;code&gt;flymake-buildfile-dirs&lt;/code&gt;, but this variable actually doesn't exist. I tried &lt;code&gt;cd&lt;/code&gt; to &lt;code&gt;./&lt;/code&gt;, and to add &lt;code&gt;../&lt;/code&gt; to &lt;code&gt;flymake-master-file-dirs&lt;/code&gt;, which didn't help either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strange thing is that on my Macbook, this works with the same configuration, while on my Debian GNU/Linux Desktop, it doesn't. Does anyone have an idea?&lt;/p&gt;&#xA;" OwnerUserId="2157" LastActivityDate="2015-01-27T23:01:11.177" Title="Flymake: no buildfile (Makefile) found" Tags="|compilation|java|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2587" PostTypeId="1" AcceptedAnswerId="2621" CreationDate="2014-10-25T10:55:46.677" Score="4" ViewCount="123" Body="&lt;p&gt;When using &lt;a href=&quot;http://fmg-www.cs.ucla.edu/geoff/ispell.html&quot; rel=&quot;nofollow&quot;&gt;ispell&lt;/a&gt; to check spelling and encountering an incorrect word, pressing &lt;code&gt;r&lt;/code&gt; takes you to the minibuffer where you can enter a replacement for the misspelled word. By default the minibuffer already contains the incorrectly spelled word and so I need to clear the minibuffer first before being able to type in the replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I add a hook to clear the input prompt automatically?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2256" LastEditorUserId="50" LastEditDate="2014-10-25T16:52:23.540" LastActivityDate="2014-10-27T12:01:01.150" Title="Make ispell automatically clear minibuffer when replacing word" Tags="|spell-checking|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2588" PostTypeId="2" ParentId="2571" CreationDate="2014-10-25T11:46:21.620" Score="23" Body="&lt;h3&gt;Emacs communities and forums, in addition to this site&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsWiki&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://wikemacs.org/wiki/Main_Page&quot; rel=&quot;nofollow noreferrer&quot;&gt;WikiEmacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;GNU Emacs &lt;a href=&quot;https://lists.gnu.org/mailman/listinfo/&quot; rel=&quot;nofollow noreferrer&quot;&gt;mailing lists&lt;/a&gt; (search for &quot;emacs&quot; in the list)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;help-gnu-emacs@gnu.org&lt;/a&gt; archive (also available via news:gnu.emacs.help and &lt;a href=&quot;http://groups.google.com/forum/#!forum/gnu.emacs.help&quot; rel=&quot;nofollow noreferrer&quot;&gt;google groups&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-devel@gnu.org&lt;/a&gt; archive&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://lists.gnu.org/archive/html/help-emacs-windows/&quot; rel=&quot;nofollow noreferrer&quot;&gt;help-emacs-windows@gnu.org&lt;/a&gt; archive&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/tagged/emacs?sort=votes&amp;amp;pageSize=50&quot;&gt;Stack Overflow with &lt;code&gt;emacs&lt;/code&gt; tag&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Similarly, filter these for &lt;a href=&quot;/questions/tagged/emacs&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;emacs&amp;#39;&quot; rel=&quot;tag&quot;&gt;emacs&lt;/a&gt; or &lt;a href=&quot;/questions/tagged/elisp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;elisp&amp;#39;&quot; rel=&quot;tag&quot;&gt;elisp&lt;/a&gt;: &lt;a href=&quot;https://unix.stackexchange.com/&quot;&gt;Unix &amp;amp; Linux&lt;/a&gt;, &lt;a href=&quot;https://tex.stackexchange.com/&quot;&gt;TeX – LaTeX&lt;/a&gt;, &lt;a href=&quot;https://askubuntu.com/&quot;&gt;Ask Ubuntu&lt;/a&gt;, &lt;a href=&quot;https://apple.stackexchange.com/&quot;&gt;Ask Different&lt;/a&gt;, &lt;a href=&quot;https://softwareengineering.stackexchange.com/&quot;&gt;Programmers&lt;/a&gt;, &lt;a href=&quot;https://serverfault.com/&quot;&gt;Server Fault&lt;/a&gt;, &lt;a href=&quot;https://codereview.stackexchange.com/&quot;&gt;Code Review&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Or use &lt;a href=&quot;https://stackexchange.com/filters/148229/emacs&quot;&gt;this filter&lt;/a&gt; across all of StackExchange.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.quora.com/Emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs on Quora&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://plus.google.com/communities/114815898697665598016&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs on Google Plus&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacs.livejournal.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs on Live Journal&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://reddit.com/r/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Reddit's /r/emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://community.linuxmint.com/software/view/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs on http://community.linuxmint.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;IRC: #emacs on freenode&lt;/li&gt;&#xA;&lt;li&gt;IRC: #org-mode on freenode&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Blogs&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://planet.emacsen.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Planet Emacsen (blog aggreggator)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://endlessparentheses.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Endless Parentheses&lt;/a&gt; (it is &lt;a href=&quot;https://emacs.stackexchange.com/users/50/malabarba&quot;&gt;Malabarba's&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacsredux.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Redux&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.masteringemacs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mastering Emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://nullprogram.com/tags/emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Null program&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://irreal.org/blog/?tag=emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Irreal&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacsrocks.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Rocks!&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.lunaryorn.com/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lunarsite&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/category/emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Kitchin Research Group&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://sachachua.com/blog/category/emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sacha Chua&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://yoo2080.wordpress.com/category/emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Yoo Box&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ergoemacs.org/emacs/blog.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ergoemacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://tuhdo.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Mini Manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7" LastEditorUserId="1979" LastEditDate="2018-08-27T02:30:42.220" LastActivityDate="2018-08-27T02:30:42.220" CommentCount="3" CommunityOwnedDate="2014-10-25T13:42:03.323" ContentLicense="CC BY-SA 4.0" />
  <row Id="2589" PostTypeId="1" AcceptedAnswerId="2591" CreationDate="2014-10-25T11:50:26.187" Score="6" ViewCount="405" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I make &lt;code&gt;org-mode&lt;/code&gt; understand alternate day/month abbreviations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; uses the function &lt;code&gt;org-read-date&lt;/code&gt; when entering timestamps, scheduling dates, and creating deadlines.  One may enter three-letter day or month abbreviations (e.g., &quot;sun&quot; for Sunday, &quot;oct&quot; for October), and &lt;code&gt;org-read-date&lt;/code&gt; recognizes them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;But:&lt;/em&gt; a few common abbreviations are longer than three letters -- e.g., I almost always write &quot;tues&quot; (rather than &quot;tue&quot;) for Tuesday, &quot;thurs&quot; (rather than &quot;thu&quot;) for Thursday, &quot;sept&quot; (rather than &quot;sep&quot;) for September, and so on.  The problem is that, the instant one gets past the third letter, &lt;code&gt;org-read-date&lt;/code&gt; no longer recognizes the abbreviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So the question is:&lt;/strong&gt; how can I tell &lt;code&gt;org-read-date&lt;/code&gt; to accept these longer abbreviations in addition to the three-letter versions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NB:&lt;/em&gt; I realize, of course, that I could just stop typing at the third letter, but the muscle memory is strongly-ingrained and I often don't realize I've used the longer abbreviation until much later when the item does not show up on the correct date in the agenda.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-10-25T12:32:41.137" LastActivityDate="2014-10-25T20:38:14.933" Title="How to make org-mode understand alternate day/month abbreviations?" Tags="|org-mode|parse-time|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2590" PostTypeId="1" AcceptedAnswerId="2596" CreationDate="2014-10-25T12:12:30.947" Score="9" ViewCount="254" Body="&lt;p&gt;When a new version of Emacs is released it is usually the case that some variables/commands/functions become obsolete. They are usually marked as such in the corresponding documentation:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;turn-on-eldoc-mode&lt;/code&gt; is an alias for &lt;code&gt;eldoc-mode&lt;/code&gt; in &lt;code&gt;eldoc.el&lt;/code&gt;. [...]&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;This function is obsolete since 24.4&lt;/strong&gt;; use &lt;code&gt;eldoc-mode&lt;/code&gt; instead.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I'd like to make sure I am not referencing any obsolete variables in my init-file, but I'd also like to avoid checking the whole thing manually.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;So my question is&lt;/strong&gt;: Is there a way to automatically identify all obsolete variables in my init-file (that possibly also works for third-party packages installed via the package manager)?&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-25T16:41:44.673" Title="Automatically identify obsolete variables in init-file" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2591" PostTypeId="2" ParentId="2589" CreationDate="2014-10-25T12:16:20.667" Score="8" Body="&lt;p&gt;You have to change &lt;code&gt;parse-time-weekdays&lt;/code&gt; and &lt;code&gt;parse-time-months&lt;/code&gt;. For example, something like this will do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar parse-time-weekdays-longer&#xA;  '((&quot;sund&quot; . 0) (&quot;tues&quot; . 2) (&quot;thurs&quot; . 4))&#xA;&#xA;(defvar parse-time-months-longer&#xA;  '((&quot;janu&quot; . 1) (&quot;dece&quot; . 12)))&#xA;&#xA;(eval-after-load 'parse-time&#xA;  '(progn&#xA;    (setq parse-time-weekdays (nconc parse-time-weekdays&#xA;                                     parse-time-weekdays-longer))&#xA;    (setq parse-time-months (nconc parse-time-months&#xA;                                   parse-time-months-longer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In weekdays, 0 is Sunday, 1 is Monday... 6 is Saturday, in months it is the obvious number of the month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;eval-after-load&lt;/code&gt; to add my abbreviations to the default one: one need to wait for &lt;code&gt;parse-time&lt;/code&gt; to be loaded for &lt;code&gt;parse-time-weekdays&lt;/code&gt; and &lt;code&gt;parse-time-months&lt;/code&gt; to have their default value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is not only for abbreviations, I use translation of the weekday name for example.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="504" LastEditDate="2014-10-25T20:38:14.933" LastActivityDate="2014-10-25T20:38:14.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2592" PostTypeId="1" CreationDate="2014-10-25T12:22:17.880" Score="3" ViewCount="1222" Body="&lt;p&gt;I have spent several days trying to debug &lt;code&gt;auto-complete&lt;/code&gt;, it is working properly in Elisp mode, but when I go in Ruby mode it stops working. &lt;code&gt;auto-complete-mode&lt;/code&gt; runs successfully, but the menu of candidates does not appear when I type the word or invoke the command &lt;code&gt;auto-complete&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed &lt;code&gt;auto-complete&lt;/code&gt; using &lt;code&gt;package.el&lt;/code&gt; from &lt;a href=&quot;http://melpa.milkbox.net/&quot; rel=&quot;nofollow&quot;&gt;melpa&lt;/a&gt;. I have not added any settings to my &lt;code&gt;.emacs&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I do to identify the bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.3.&lt;/p&gt;&#xA;" OwnerUserId="2257" LastEditorUserId="45" LastEditDate="2014-11-16T21:52:05.530" LastActivityDate="2014-11-16T21:52:05.530" Title="Why doesn't auto-complete work in ruby-mode?" Tags="|completion|debugging|auto-complete-mode|ruby-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2593" PostTypeId="2" ParentId="2292" CreationDate="2014-10-25T12:33:55.900" Score="6" Body="&lt;p&gt;Not completly an answer to the question, but when one use R in org-mode's babel:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My example&#xA;#+name: simple-org-example&#xA;#+begin_src R :session *my-R* :dir &quot;.&quot; :results output graphics :file example.svg :width 18 :height 9&#xA;  plot(cyl~mpg,data=mtcars)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing a &lt;code&gt;C-c C-c&lt;/code&gt; on this in org-mode will create a &lt;code&gt;*my-R*&lt;/code&gt; buffer with an interacting ESS buffer, create the plot in the &lt;code&gt;example.svg&lt;/code&gt; file and then you can click (or press enter) on the created link to the file, that will open it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode is able to inline image, but it do it when toggling this functionality (with &lt;code&gt;M-x org-toggle-inline-images&lt;/code&gt;) or on opening the file, but not on running a code in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is not a complete solution.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastActivityDate="2014-10-25T12:33:55.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2594" PostTypeId="1" CreationDate="2014-10-25T12:50:06.310" Score="9" ViewCount="4997" Body="&lt;p&gt;I am compiling Emacs from source and can't figure out what libraries I need to enable &lt;a href=&quot;http://www.imagemagick.org/&quot; rel=&quot;noreferrer&quot;&gt;imagemagick&lt;/a&gt; and &lt;a href=&quot;http://www.nongnu.org/m17n/&quot; rel=&quot;noreferrer&quot;&gt;m17n&lt;/a&gt;. I have imagemagick and libm17n-dev installed (I am on Debian).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;./configure&lt;/code&gt; script says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Does Emacs use imagemagick?                             no&#xA;  [...]&#xA;  Does Emacs use -lm17n-flt?                              no&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="98" LastEditorUserId="454" LastEditDate="2015-01-20T08:33:42.223" LastActivityDate="2016-01-26T07:54:23.053" Title="Where to find missing dependencies (imagemagick and m17n)" Tags="|compilation|debian|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2595" PostTypeId="1" AcceptedAnswerId="2599" CreationDate="2014-10-25T14:21:17.507" Score="10" ViewCount="5649" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;According to &lt;a href=&quot;https://github.com/senny/emacs-eclim&quot;&gt;Emacs Eclim&lt;/a&gt;, I added the following to &lt;code&gt;~/.emacs.d/init.d&lt;/code&gt; for &lt;code&gt;emacs-eclim&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'eclim)&#xA;(global-eclim-mode)&#xA;&#xA;; If you want to control eclimd from emacs, also add:&#xA;(require 'eclimd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output of &lt;code&gt;emacs -nw --debug-init&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;eclim&quot;)&#xA;  require(eclim)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/tim/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 4117&#xA;  load-with-code-conversion(&quot;/home/tim/.emacs.d/init.el&quot; &quot;/home/tim/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/tim/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;^H\205\262^@     \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\202;^@\313\307\314\317#\$&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I add the following line at the beginning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/elpa/emacs-eclim-20140809.207/&quot;)&#xA;&#xA;(require 'eclim)&#xA;(global-eclim-mode)&#xA;&#xA;; If you want to control eclimd from emacs, also add:&#xA;(require 'eclimd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output of &lt;code&gt;emacs -nw --debug-init&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;s&quot;)&#xA;  require(s)&#xA;  byte-code(&quot;\300\301!\210\300\302!\210\303\304\305\306\307\310%\210\311\312\313\314\315\316\307\304&amp;amp;^G\207&quot;&#xA;[require etags s custom-declare$&#xA;  require(eclim)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/tim/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 4115&#xA;  load-with-code-conversion(&quot;/home/tim/.emacs.d/init.el&quot; &quot;/home/tim/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/tim/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;^H\205\262^@     \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\202;^@\313\307\314\317#\$&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I instead add a different line at the beginning, it works without&#xA;error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;(require 'eclim)&#xA;(global-eclim-mode)&#xA;&#xA;; If you want to control eclimd from emacs, also add:&#xA;(require 'eclimd)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I add both lines at the beginning, it also works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/elpa/emacs-eclim-20140809.207/&quot;)&#xA;(package-initialize)&#xA;&#xA;(require 'eclim)&#xA;(global-eclim-mode)&#xA;&#xA;; If you want to control eclimd from emacs, also add:&#xA;(require 'eclimd)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I wonder what the two lines I added do, and why they can work or not work? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="504" LastEditDate="2014-10-25T21:22:17.640" LastActivityDate="2014-10-25T21:22:17.640" Title="problem of loading a package at emacs startup" Tags="|package|" AnswerCount="2" CommentCount="0" ClosedDate="2015-03-25T13:22:30.470" ContentLicense="CC BY-SA 3.0" />
  <row Id="2596" PostTypeId="2" ParentId="2590" CreationDate="2014-10-25T14:36:56.727" Score="13" Body="&lt;p&gt;&lt;strong&gt;Byte-compile the file.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, it's best to not byte-compile your init file, but here it's useful. The byte-compiler will warn you about a lot of bad practices, among them is the usage of obsolete variables or functions. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Just call &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;byte-compile-file&lt;/code&gt; and give your init file. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Afterwards, make sure you delete the generated &lt;code&gt;.elc&lt;/code&gt; file. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-25T16:41:44.673" LastActivityDate="2014-10-25T16:41:44.673" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2598" PostTypeId="2" ParentId="2595" CreationDate="2014-10-25T14:49:51.450" Score="3" Body="&lt;p&gt;It simply initializes all packages before running .emacs file. This way, you already have symbol &lt;code&gt;eclim&lt;/code&gt; created, and you can use function &quot;require&quot; to require it. If you don't add package-initialize, then this package isn't initialized, &lt;code&gt;eclim&lt;/code&gt; symbol is unbound, and you get situation that you had before :)&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2014-10-25T14:49:51.450" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2599" PostTypeId="2" ParentId="2595" CreationDate="2014-10-25T15:03:28.863" Score="12" Body="&lt;p&gt;Your problem is that the package &lt;code&gt;eclim&lt;/code&gt; as a dependency on the package &lt;code&gt;s&lt;/code&gt;, so when you require eclim, you need to have &lt;code&gt;s&lt;/code&gt; in your &lt;code&gt;load-path&lt;/code&gt;. &lt;code&gt;package-initialize&lt;/code&gt; ensure that every installed package are in you &lt;code&gt;load-path&lt;/code&gt;, and load them too, so: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you don't need to require eclim when you call package-initialize&lt;/li&gt;&#xA;&lt;li&gt;you need to add s to the load path if you don't call package-initialize&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As you have installed those extension using package, better (and simpler) to use package-initialize.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastActivityDate="2014-10-25T15:03:28.863" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2600" PostTypeId="1" CreationDate="2014-10-25T15:46:02.523" Score="4" ViewCount="380" Body="&lt;p&gt;&lt;code&gt;M-x shell&lt;/code&gt; has been my friend for decades, and I've always been comfortable even sympathetic with his insistence on being a dumb terminal (i.e. &lt;code&gt;TERM=dumb&lt;/code&gt;).  But recently I've found my self setting &lt;code&gt;LC_ALL&lt;/code&gt; by hand so that python won't default to ASCII on its standard streams.  I vaguely recall having similar problems at other times with ruby and perl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question: What is a good approach to setting things up so I don't have to set &lt;code&gt;LC_ALL&lt;/code&gt; by hand?  For example, should I just slam this in &lt;code&gt;shell-mode-hook&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="105" LastEditDate="2014-10-25T15:58:37.513" LastActivityDate="2016-04-04T02:00:38.233" Title="Advice on setting shell's character set" Tags="|shell|character-encoding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2601" PostTypeId="2" ParentId="2483" CreationDate="2014-10-25T16:05:29.857" Score="10" Body="&lt;p&gt;You can use the &lt;strong&gt;org-babel-get-src-block-info&lt;/strong&gt; function. I add a few examples to show that it indeed yields back the name of the block that is executing the code, even if called by other blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first define a block echoing its src block name&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: blockA&#xA;#+BEGIN_SRC emacs-lisp :results value&#xA;  (format &quot;I am %s&quot; (nth 4 (org-babel-get-src-block-info)))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: blockA&#xA;: I am blockA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I use the org-sbe function to call blockA from within the lisp code&#xA;of another block. The code running in blockA correctly identifies itself&#xA;as blockA.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: blockB&#xA;#+BEGIN_SRC emacs-lisp :results value&#xA;(org-sbe blockA)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: blockB&#xA;: I am blockA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org mode CALL syntax also yields the correct result...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CALL: blockB() :results value&#xA;&#xA;#+RESULTS:&#xA;: I am blockA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... as does running the code in table formulas&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: tableA&#xA;| col1        | col2        |&#xA;|-------------+-------------|&#xA;| I am blockA | I am blockA |&#xA;#+TBLFM: @2$1='(org-sbe blockA)::@2$2='(org-sbe blockB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2014-10-25T16:05:29.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2602" PostTypeId="1" CreationDate="2014-10-25T16:39:25.303" Score="1" ViewCount="68" Body="&lt;h2&gt;What I want:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I have a clojure program on a remote site, let's call it &lt;code&gt;mccarthy&lt;/code&gt;.&#xA;What I want to do is connect to a &lt;code&gt;nrepl-ritz&lt;/code&gt; from my laptop, preferably using &lt;code&gt;nrepl-ritz-jack-in&lt;/code&gt;.  The jack in works fine for a local program, but doesn't seem to connect to a remote program.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Attempt 1&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-f&lt;/kbd&gt; on &lt;code&gt;/mccarthy:code/program/project.clj&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'nrepl-ritz)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;nrepl-ritz-jack-in&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Result&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Emacs appears to hang.  If I go to the &lt;code&gt;*nrepl-server*&lt;/code&gt; buffer, I see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Exception in thread &quot;main&quot; java.lang.reflect.InvocationTargetException&#xA;    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&#xA;    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)&#xA;    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&#xA;    at java.lang.reflect.Method.invoke(Method.java:601)&#xA;    at org.flatland.drip.Main.invoke(Main.java:117)&#xA;    at org.flatland.drip.Main.start(Main.java:88)&#xA;    at org.flatland.drip.Main.main(Main.java:64)&#xA;Caused by: java.lang.AssertionError: Assert failed: project&#xA;    at leiningen.ritz_nrepl$start_jpda_server.invoke(ritz_nrepl.clj:23)&#xA;    at leiningen.ritz_nrepl$ritz_nrepl.doInvoke(ritz_nrepl.clj:95)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(and tons of other lines, too...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;drip&lt;/code&gt; on my laptop, but not on &lt;code&gt;mccarthy&lt;/code&gt;, so clearly &lt;code&gt;nrepl-ritz-jack-in&lt;/code&gt; is not detecting that it's a remote file.  Regular old &lt;code&gt;nrepl-jack-in&lt;/code&gt; will work as expected in this case, however.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Attempt 2&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I also tried starting an &lt;code&gt;nrepl-ritz&lt;/code&gt; using &lt;code&gt;lein&lt;/code&gt; on &lt;code&gt;mccarthy&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mattox@mccarthy$ lein ritz-nrepl&#xA;nREPL server started on port 42874&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From my laptop I forward a port so local &lt;code&gt;42874&lt;/code&gt; connects to &lt;code&gt;42874&lt;/code&gt; on &lt;code&gt;mccarthy&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh -L 42874:localhost:42874 -N mccarthy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, from my local Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'nrepl-ritz)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;nrepl&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Host: &lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Port: &lt;code&gt;42874&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives me a connection:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; nREPL 0.1.7-preview&#xA;user&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So to test it out, I run&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;nrepl-ritz-threads&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gives me a nice table of threads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;nrepl-ritz-break-on-exception&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (/ 1 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Result&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This hangs, but sometimes shows a hidden debugging buffer with some restarts available.  If I tell it to pass the exception back to the program, it never gives control back to the REPL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done plenty of searches but have not been able to get anything more specific than &quot;make sure lein is on your path&quot;.  (And I did do that, on both machines...)  Thanks for reading a (I hope not too) long question!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This question was originally &lt;a href=&quot;https://stackoverflow.com/questions/15330810/how-can-i-make-nrepl-ritz-jack-in-work-remotely-over-tramp-emacs&quot;&gt;asked&lt;/a&gt; by &lt;a href=&quot;https://stackoverflow.com/users/10354/mattoxbeckman&quot;&gt;MattoxBeckman&lt;/a&gt;, but has yet to be answered. &lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-25T16:39:25.303" Title="How can I make nrepl-ritz-jack-in work remotely over TRAMP / Emacs" Tags="|clojure|nrepl|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2603" PostTypeId="2" ParentId="2" CreationDate="2014-10-25T16:59:41.437" Score="2" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/nschum/guess-style/blob/master/guess-style.el&quot; rel=&quot;nofollow&quot;&gt;guess-style.el&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does pretty well at guessing a file's preferred indentation style.&lt;/p&gt;&#xA;" OwnerUserId="351" LastActivityDate="2014-10-25T16:59:41.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2604" PostTypeId="1" CreationDate="2014-10-25T17:32:07.837" Score="4" ViewCount="1175" Body="&lt;p&gt;I've been seeing this issue for some time now, but I don't know how to debug it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start up a emacs instance, using say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs foo.tex &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I run &lt;code&gt;C-c C-c&lt;/code&gt; to compile. &#xA;A new window pops open, and I see the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (server): Unable to start the Emacs server.&#xA;There is an existing Emacs server, named &quot;server&quot;.&#xA;To start the server in this Emacs process, stop the existing&#xA;server or call `M-x server-force-delete' to forcibly disconnect it.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is annoying. I'd appreciate help tracking down the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to be related to the emacs server. The only place I have the emacs server mentioned, as far as I can see, is in my &lt;code&gt;.emacs&lt;/code&gt;, which has&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Enable Synctex&#xA;(setq TeX-source-correlate-mode t)&#xA;(setq TeX-source-correlate-start-server t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this causing a problem, and if so, why? I do not have an emacs server running, as far as I can see.&lt;/p&gt;&#xA;" OwnerUserId="100" LastActivityDate="2014-10-25T18:21:42.433" Title="Debugging server related warning message" Tags="|debugging|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2605" PostTypeId="2" ParentId="2604" CreationDate="2014-10-25T18:21:42.433" Score="4" Body="&lt;h2&gt;TL;DR&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Either run &lt;code&gt;M-x server-force-delete&lt;/code&gt; to delete any existing servers, or remove the lines which enable &lt;code&gt;TeX-source-correlate-mode&lt;/code&gt; from your init file.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From the AUCTeX documentation (found via &lt;code&gt;C-h i&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Upon opening the viewer you will be asked if you want to start a&#xA;  server process (Gnuserv or Emacs server) which is necessary for&#xA;  inverse search.  This happens only if there is no server running&#xA;  already.  You can customize the variable&#xA;  'TeX-source-correlate-start-server' to inhibit the question and always&#xA;  or never start the server respectively.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;-- User Option: TeX-source-correlate-start-server&#xA;       If 'TeX-source-correlate-mode' is active and a viewer is invoked,&#xA;       the default behavior is to ask if a server process should be&#xA;       started.  Set this variable to 't' if the question should be&#xA;       inhibited and the server should always be started.  Set it to 'nil'&#xA;       if the server should never be started.  Inverse search will not be&#xA;       available in the latter case.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Inverse search, i.e.  jumping to the part of your document source&#xA;  in Emacs corresponding to a certain position in the viewer, is&#xA;  triggered from the viewer, typically by a mouse click.  Refer to the&#xA;  documentation of your viewer to find out how it has to be configured&#xA;  and what you have to do exactly.  In xdvi you normally have to use&#xA;  'C-down-mouse-1'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, starting an edit server lets you click a location in your typeset output file and it will jump you to the corresponding location in the source.  If this is not a feature you use, or plan to use, then you can simply remove those lines from your init.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most likely cause of your problem is a lingering server socket that is preventing emacs from starting a new edit server in this emacs process.  The most likely cause is that emacs was not shut down properly at some point, and did not have a chance to delete the socket.  If you call &lt;code&gt;M-x server-force-delete&lt;/code&gt; it should fix all of your problems.  Once the old server is deleted, the current emacs process will be free to create its own server socket and things should work as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as Emacs is closed properly each time (by &lt;code&gt;C-x C-c&lt;/code&gt; or similar) then you should not see this problem again.  If Emacs crashes or is force killed in the future, then you may have to manually delete the server again.  You could also add the following to your init file to automatically kill any old servers when Emacs is started:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(server-force-delete)  ;; WARNING: Kills any existing edit server&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you only ever have one instance of Emacs running at a time, this should never cause you any problems.  If you open a second instance of Emacs (not just a second frame, but a whole new process) then only the most recent instance will behave as the server.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-25T18:21:42.433" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2606" PostTypeId="1" AcceptedAnswerId="2608" CreationDate="2014-10-25T18:28:02.473" Score="34" ViewCount="4751" Body="&lt;p&gt;Emacs has the function &lt;code&gt;fill-paragraph&lt;/code&gt;. Is there any function which will do the opposite of that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a paragraph which is already filled and instead I want it in a plain single line?&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="50" LastEditDate="2014-10-25T21:09:28.513" LastActivityDate="2022-05-31T12:11:47.257" Title="Opposite of fill-paragraph" Tags="|text-editing|" AnswerCount="6" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2607" PostTypeId="1" AcceptedAnswerId="2615" CreationDate="2014-10-25T18:36:34.967" Score="12" ViewCount="811" Body="&lt;p&gt;Dired lets me mark files and pass their names as arguments to arbitrary shell commands. I would like a way to supply the marked names as arguments to Emacs Lisp functions, either built-in or those I write myself.&lt;/p&gt;&#xA;" OwnerUserId="890" LastEditorUserId="105" LastEditDate="2021-08-09T15:30:17.530" LastActivityDate="2021-08-09T15:30:17.530" Title="How to use Dired marked files as arguments to arbitrary Emacs Lisp functions?" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2608" PostTypeId="2" ParentId="2606" CreationDate="2014-10-25T18:39:31.070" Score="25" Body="&lt;p&gt;Quoting from &lt;a href=&quot;https://www.emacswiki.org/emacs/UnfillParagraph&quot; rel=&quot;noreferrer&quot;&gt;Emacs Wiki&lt;/a&gt;, by Stefan Monnier: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unfilling a paragraph joins all the lines in a paragraph into a single&#xA;  line. It is the contrary of &lt;a href=&quot;http://www.emacswiki.org/emacs/FillParagraph&quot; rel=&quot;noreferrer&quot;&gt;FillParagraph&lt;/a&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It works where a line ends with a newline character (”\n”) and&#xA;  paragraphs are separated by blank lines. To make a paragraph end in a&#xA;  single newline then use the function below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; It is the opposite of fill-paragraph    &#xA;(defun unfill-paragraph ()&#xA;  &quot;Takes a multi-line paragraph and makes it into a single line of text.&quot;&#xA;  (interactive)&#xA;  (let ((fill-column (point-max)))&#xA;    (fill-paragraph nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;And to bind it to a key:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; Handy key definition&#xA; (define-key global-map &quot;\M-Q&quot; 'unfill-paragraph)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;See also &lt;a href=&quot;http://www.emacswiki.org/emacs/UnfillRegion&quot; rel=&quot;noreferrer&quot;&gt;UnfillRegion&lt;/a&gt;, and &lt;a href=&quot;http://www.emacswiki.org/emacs/UnwrapLine&quot; rel=&quot;noreferrer&quot;&gt;UnwrapLine&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="45" LastEditorUserId="119" LastEditDate="2017-07-20T19:02:07.187" LastActivityDate="2017-07-20T19:02:07.187" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2609" PostTypeId="5" CreationDate="2014-10-25T18:45:37.367" Score="0" Body="&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://clojure.org/&quot; rel=&quot;nofollow&quot;&gt;Clojure&lt;/a&gt;&lt;/strong&gt; is a Lisp dialect for the Java Virtual Machine (with versions for &lt;a href=&quot;https://github.com/clojure/clojure-clr&quot; rel=&quot;nofollow&quot;&gt;the CLR&lt;/a&gt; and JavaScript).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clojure is a modern Lisp dialect with an emphasis on functional programming (lazy/impure), running on the JVM with transparent access to all Java libraries, an interactive REPL development environment, dynamic runtime polymorphism, Lisp-style macro meta-programming and concurrent programming capabilities supported by software transactional memory.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Key features:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Lisp heritage&lt;/strong&gt; - Clojure is a fully &lt;a href=&quot;http://en.wikipedia.org/wiki/Homoiconicity&quot; rel=&quot;nofollow&quot;&gt;homoiconic&lt;/a&gt; language with support for macro-based metaprogramming. The full features of the language are available at compile time, and it is possible to manipulate &quot;code as data&quot;. These mechanisms are frequently used to extend the language itself or create new domain-specific languages.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Functional programming&lt;/strong&gt; - Clojure is primarily a functional language. It features immutable data structures and lazy sequences. Like many other Lisps, it is eagerly evaluated (although lazy sequences, macros and closures can be introduced to obtain lazy behavior) and impure.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Concurrent programming&lt;/strong&gt;, supported by &lt;a href=&quot;http://en.wikipedia.org/wiki/Software_transactional_memory&quot; rel=&quot;nofollow&quot;&gt;software transactional memory&lt;/a&gt;, and designed for multi-core environments.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dynamic&lt;/strong&gt; - Clojure is a dynamic language. However it should be noted that it is still fully compiled, exploits primitive operations on the JVM where needed for performance and can also support (optional) static type hints.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Hosted on the JVM&lt;/strong&gt;, allowing for easy and transparent access to the wide ecosystem of Java libraries. &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open source&lt;/strong&gt; - Clojure is run as a collaborative open source project (&lt;a href=&quot;https://github.com/clojure/clojure&quot; rel=&quot;nofollow&quot;&gt;hosted on GitHub&lt;/a&gt;) and there is a rapidly growing ecosystem of open source libraries for Clojure, in addition to all the open source tools already available for Java&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Portable&lt;/strong&gt; - Clojure can run on any platform that supports the JVM, and Clojure versions are also available for the CLR (ClojureCLR) and JavaScript (ClojureScript)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Code Samples:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Hello world is simple....&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (println &quot;Hello World!&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &quot;infamous&quot; Lisp parentheses are used to apply a function, which is always the first item in the list: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (+ 1 2 3 4)&#xA;  =&amp;gt; 10 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Functions can easily be defined and passed to higher order functions like &lt;code&gt;map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defn triple [x]&#xA;    (+ x x x))&#xA;&#xA;  (map triple [1 2 3 4 5 10])&#xA;  =&amp;gt; (3 6 9 12 15 30)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Infinite lazy sequences are fully supported:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (take 7 (iterate (partial str &quot;a&quot;) &quot;b&quot;))&#xA;  =&amp;gt; (&quot;b&quot; &quot;ab&quot; &quot;aab&quot; &quot;aaab&quot; &quot;aaaab&quot; &quot;aaaaab&quot; &quot;aaaaaab&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can even do powerful computations on infinite sequences, such as defining the complete &lt;a href=&quot;http://en.wikipedia.org/wiki/Fibonacci_number&quot; rel=&quot;nofollow&quot;&gt;Fibonacci&lt;/a&gt; series:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (def fibonaccis&#xA;    (lazy-cat [0 1] (map + fibonaccis (rest fibonaccis))))&#xA;&#xA;  (take 10 fibonaccis)&#xA;  =&amp;gt; (0 1 1 2 3 5 8 13 21 34)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Resources:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The &lt;a href=&quot;http://dev.clojure.org/display/doc/Getting+Started&quot; rel=&quot;nofollow&quot;&gt;Getting Started&lt;/a&gt; wiki&lt;/strong&gt; (including instructions on IDE / Emacs / Vim setup and build tools)&lt;/li&gt;&#xA;&lt;li&gt;The Clojure &lt;a href=&quot;http://groups.google.com/group/clojure&quot; rel=&quot;nofollow&quot;&gt;Google group&lt;/a&gt; archives&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://faustus.webatu.com/clj-quick-ref.html&quot; rel=&quot;nofollow&quot;&gt;Clojure quick reference&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://clojuredocs.org/&quot; rel=&quot;nofollow&quot;&gt;ClojureDocs&lt;/a&gt; -- &quot;Community powered Clojure Documentation and Examples&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://disclojure.org/&quot; rel=&quot;nofollow&quot;&gt;Disclojure&lt;/a&gt; -- daily summary of Clojure intertweets&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://planet.clojure.in/&quot; rel=&quot;nofollow&quot;&gt;Planet Clojure&lt;/a&gt; -- the Clojure blog aggregator&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://4clojure.com/&quot; rel=&quot;nofollow&quot;&gt;4Clojure&lt;/a&gt;, &lt;a href=&quot;https://github.com/functional-koans/clojure-koans&quot; rel=&quot;nofollow&quot;&gt;Clojure Koans&lt;/a&gt; -- Interactive fill-in-the-blank Clojure problems&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://coderwall.com/n/clojure&quot; rel=&quot;nofollow&quot;&gt;Coderwall Clojure Network&lt;/a&gt; -- Tips from a network of Clojure developers&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.clojure-toolbox.com/&quot; rel=&quot;nofollow&quot;&gt;Clojure Toolbox&lt;/a&gt; -- A categorised directory of libraries and tools for Clojure&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Clojure Web Frameworks&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/weavejester/compojure/wiki&quot; rel=&quot;nofollow&quot;&gt;Compojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/ring-clojure/ring&quot; rel=&quot;nofollow&quot;&gt;Ring&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Clojure Video Tutorials&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;General Clojure&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure/&quot; rel=&quot;nofollow&quot;&gt;Inside Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/channels/fulldisclojure&quot; rel=&quot;nofollow&quot;&gt;Sean Devlin's screencasts&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.youtube.com/user/briantwill#g/c/AC43CFB134E85266&quot; rel=&quot;nofollow&quot;&gt;Intro to Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/10896148&quot; rel=&quot;nofollow&quot;&gt;Clojure's basics &lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/8672404&quot; rel=&quot;nofollow&quot;&gt;Concurrent programming in Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/11236603&quot; rel=&quot;nofollow&quot;&gt;Clojure 1.2 Protocols&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/interviews/hickey-clojure-protocols&quot; rel=&quot;nofollow&quot;&gt;Rich Hickey on Protocols and Clojure 1.3&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/presentations/Clojure-Expression-Problem&quot; rel=&quot;nofollow&quot;&gt;Clojure's Solutions to the Expression Problem&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://link.pluralsight.com/clojure&quot; rel=&quot;nofollow&quot;&gt;Clojure Concurrency On-Demand!&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/interviews/hickey-clojure&quot; rel=&quot;nofollow&quot;&gt;Rich Hickey on Clojure's Features and Implementation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/presentations/hickey-clojure&quot; rel=&quot;nofollow&quot;&gt;Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey&quot; rel=&quot;nofollow&quot;&gt;Are We There Yet?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/presentations/Value-Identity-State-Rich-Hickey&quot; rel=&quot;nofollow&quot;&gt;Persistent Data Structures and Managed References&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/interviews/stuart_holloway_clojure&quot; rel=&quot;nofollow&quot;&gt;Stuart Halloway on Clojure and Functional Programming&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1934356336&quot; rel=&quot;nofollow&quot;&gt;Programming Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/presentations/Clojure-in-the-Field&quot; rel=&quot;nofollow&quot;&gt;Clojure in the Field&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://java.dzone.com/videos/clojure-and-simplicty&quot; rel=&quot;nofollow&quot;&gt;Clojure and Simplicty&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/9090935&quot; rel=&quot;nofollow&quot;&gt;Clojure in Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.parleys.com/#st=5&amp;amp;id=1518&amp;amp;sl=1&quot; rel=&quot;nofollow&quot;&gt;Clojure: Functional Concurrency for the JVM&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://devoxx.com&quot; rel=&quot;nofollow&quot;&gt;Devoxx'09&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/18970727&quot; rel=&quot;nofollow&quot;&gt;Asynchronous Events in Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/22675078&quot; rel=&quot;nofollow&quot;&gt;Clojure for Schemers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=ObR3qi4Guys&quot; rel=&quot;nofollow&quot;&gt;Introduction to Monads&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.vimeo.com/user5897815/videos&quot; rel=&quot;nofollow&quot;&gt;several video lectures&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/15046335&quot; rel=&quot;nofollow&quot;&gt;Clojure - Up Close and Personal&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/9770382&quot; rel=&quot;nofollow&quot;&gt;circumspec, inferior-lisp, clojure, and slime&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vimeo.com/8356990&quot; rel=&quot;nofollow&quot;&gt;Compojure/Emacs Intro&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://peepcode.com/products/functional-programming-with-clojure&quot; rel=&quot;nofollow&quot;&gt;Functional Programming with Clojure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Clojure Web Development&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=qqNevHwH47w&quot; rel=&quot;nofollow&quot;&gt;Mark McGranaghan: &quot;One Ring to Bind Them&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/presentations/Clojure-and-the-Web&quot; rel=&quot;nofollow&quot;&gt;Clojure and the Web&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;ClojureScript&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=tVooR-dF_Ag&quot; rel=&quot;nofollow&quot;&gt;Rich Hickey Unveils ClojureScript&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:46:40.517" LastActivityDate="2014-10-26T03:46:40.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2610" PostTypeId="4" CreationDate="2014-10-25T18:45:37.367" Score="0" Body="Clojure is a modern Lisp dialect for the Java Virtual Machine (with versions for the CLR and JavaScript). " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:46:57.003" LastActivityDate="2014-10-26T03:46:57.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2611" PostTypeId="5" CreationDate="2014-10-25T18:46:25.233" Score="0" Body="&lt;p&gt;nREPL is a networked Clojure REPL: it provides a server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments. Several Clojure development tools connect to nREPL servers, such as Leiningen, Counterclockwise, and nrepl.el.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/clojure/tools.nrepl&quot; rel=&quot;nofollow&quot;&gt;nREPL's source on GitHub&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/kingtim/nrepl.el&quot; rel=&quot;nofollow&quot;&gt;nrepl.el&lt;/a&gt;, an emacs mode that builds on NREPL&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/counterclockwise/&quot; rel=&quot;nofollow&quot;&gt;Counterclockwise&lt;/a&gt;, a Clojure plugin for Eclipse&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/tpope/vim-fireplace&quot; rel=&quot;nofollow&quot;&gt;fireplace.vim&lt;/a&gt;, providing Clojure + nREPL support for vim&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:47:18.780" LastActivityDate="2014-10-26T03:47:18.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2612" PostTypeId="4" CreationDate="2014-10-25T18:46:25.233" Score="0" Body="nREPL is a networked Clojure REPL: it provides a server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments. Several Clojure development tools connect to nREPL servers, such as Leiningen, Counterclockwise, and nrepl.el." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:46:22.810" LastActivityDate="2014-10-26T03:46:22.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2613" PostTypeId="5" CreationDate="2014-10-25T18:48:53.747" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-25T18:48:53.747" LastActivityDate="2014-10-25T18:48:53.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2614" PostTypeId="4" CreationDate="2014-10-25T18:48:53.747" Score="0" Body="Replacing is the action of searching a string for a sub-string and replacing it with a different string. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:46:33.583" LastActivityDate="2014-10-26T03:46:33.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2615" PostTypeId="2" ParentId="2607" CreationDate="2014-10-25T18:49:29.710" Score="13" Body="&lt;p&gt;Just use function &lt;code&gt;dired-get-marked-files&lt;/code&gt;.  It gives you a list of the marked file and directory names.  And then just use &lt;code&gt;funcall&lt;/code&gt; or &lt;code&gt;apply&lt;/code&gt; to pass them to a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can also use &lt;code&gt;w&lt;/code&gt; in Dired to copy the marked names, separated by spaces, to a (single) string on the &lt;code&gt;kill-ring&lt;/code&gt;, which you can then yank to insert them as a group wherever you want.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-25T19:14:34.273" LastActivityDate="2014-10-25T19:14:34.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2616" PostTypeId="1" AcceptedAnswerId="2617" CreationDate="2014-10-25T19:47:28.637" Score="4" ViewCount="96" Body="&lt;p&gt;My friend has changed email account, but I only have his old key (which only lists his other email, now defunct). How can I tell Gnus to use the key I have, but to send it to a different email?&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2014-10-25T20:05:04.143" LastActivityDate="2014-10-25T20:05:04.143" Title="Gnus, send PGP encrypted message to address distinct from the one registered with the key?" Tags="|gnus|pgp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2617" PostTypeId="2" ParentId="2616" CreationDate="2014-10-25T20:01:13.497" Score="3" Body="&lt;p&gt;I've got an answer at #gnus IRC channel. I suspected there has to be a description of this tag, but didn't know what it's called, so here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs-mime/MML-Definition.html&quot; rel=&quot;nofollow&quot;&gt;MML Definition&lt;/a&gt;, the part I needed was &lt;code&gt;recipients=some@email&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-10-25T20:01:13.497" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2618" PostTypeId="2" ParentId="2606" CreationDate="2014-10-25T21:10:56.333" Score="1" Body="&lt;p&gt;As always, there are several ways to do this, so I'll throw another answer in the ring:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Mark paragraph: &lt;kbd&gt;M-h&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Query replace newline with space in region:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-%&lt;/kbd&gt; &lt;kbd&gt;C-q C-j&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;SPC&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;!&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastActivityDate="2014-10-25T21:10:56.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2619" PostTypeId="2" ParentId="2606" CreationDate="2014-10-25T21:24:42.713" Score="9" Body="&lt;p&gt;My method would be placing the cursor in the last line of the paragraph and hitting &lt;kbd&gt;M-^&lt;/kbd&gt; several times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The beauty of this shortcut is that beside joining lines it reduces any amount of indentation spaces into single one.&lt;/p&gt;&#xA;" OwnerUserId="2261" LastEditorUserId="2261" LastEditDate="2014-10-26T23:45:05.407" LastActivityDate="2014-10-26T23:45:05.407" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2620" PostTypeId="1" AcceptedAnswerId="2630" CreationDate="2014-10-25T23:28:54.867" Score="2" ViewCount="342" Body="&lt;p&gt;I'm using Flycheck with GCC as my checker for C. However, Flycheck gives warnings on OpenMP pragmas, regardless of whether they're correct or not! Is there any setting I can change to turn off these warnings?&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2014-10-26T10:18:02.070" Title="Flycheck and OpenMP pragmas for GCC" Tags="|syntax-highlighting|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2621" PostTypeId="2" ParentId="2587" CreationDate="2014-10-25T23:57:51.313" Score="3" Body="&lt;p&gt;Honestly, I don't know if this is a good way to solve this issue, but it works (though fragile) and it shows a method that is applicable in other case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test case (since the Young Grandfather (&lt;em&gt;tYG)&lt;/em&gt; forgot to post one):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (setq ispell-program-name &quot;hunspell&quot;)&#xA;  (switch-to-buffer (current-buffer))&#xA;  (insert &quot;speling&quot;)&#xA;  (ispell-word))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You see what &lt;em&gt;tYG&lt;/em&gt; talks about by evaluating and clicking &lt;code&gt;r&lt;/code&gt;.&#xA;(Leave out the &lt;code&gt;hunspell&lt;/code&gt; part if that's better for you).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;ispell-command-loop&lt;/code&gt; is very complicated, it's not easy to mess with its internals.  But we can use a fragile advice around it, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(info &quot;(elisp) Advising Functions&quot;)&lt;/code&gt;&lt;/a&gt;.  Note that we are using Stefan Monnier's new, hip and super-nice &lt;code&gt;nadvice.el&lt;/code&gt; package!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rasmus/ispell-loop-get-rid-of-misspeled-word (orig-fun &amp;amp;rest args)&#xA;  &quot;Around-advice to avoid the misspeled word when typing r in ispell.&quot;&#xA;  (require 'cl)&#xA;  (cl-letf* (((symbol-function #'read-string*) (symbol-function #'read-string))&#xA;     ((symbol-function #'read-string)&#xA;      (lambda (prompt &amp;amp;optional initial-input history default-value&#xA;             inherit-input-method)&#xA;        (if (equal prompt &quot;Replacement for: &quot;)&#xA;        (read-string* prompt)&#xA;          (read-string* prompt initial-input history default-value&#xA;                inherit-input-method)))))&#xA;(apply orig-fun args)))&#xA;&#xA;(advice-add 'ispell-command-loop :around&#xA;    #'rasmus/ispell-loop-get-rid-of-misspeled-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Run the test again.  The misspelled word should be gone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus: do &lt;code&gt;C-h&lt;/code&gt; &lt;code&gt;f&lt;/code&gt; &lt;code&gt;ispell-command-loop&lt;/code&gt; &lt;code&gt;C-j&lt;/code&gt;.  It should contain a line like &#xA;&lt;code&gt;:around advice: `rasmus/ispell-loop-get-rid-of-misspeled-word'&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2014-10-25T23:57:51.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2622" PostTypeId="5" CreationDate="2014-10-26T02:05:34.950" Score="0" Body="&lt;p&gt;Pretty Good Privacy (PGP) is a data encryption and decryption computer program that provides cryptographic privacy and authentication for data communication. PGP is often used for signing, encrypting and decrypting texts, E-mails, files, directories and whole disk partitions to increase the security of e-mail communications. It was created by &lt;a href=&quot;http://www.philzimmermann.com/&quot; rel=&quot;nofollow&quot;&gt;Phil Zimmermann&lt;/a&gt; in 1991.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PGP and similar products follow the OpenPGP standard (&lt;a href=&quot;http://tools.ietf.org/html/rfc4880&quot; rel=&quot;nofollow&quot;&gt;RFC 4880&lt;/a&gt;) for encrypting and decrypting data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://openpgp.nominet.org.uk/cgi-bin/trac.cgi&quot; rel=&quot;nofollow&quot;&gt;OpenPGP SDK&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.openpgp.org/&quot; rel=&quot;nofollow&quot;&gt;OpenPGP Alliance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.symantec.com/business/theme.jsp?themeid=pgp&quot; rel=&quot;nofollow&quot;&gt;Symantec PGP products&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Pretty_Good_Privacy&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:46:53.400" LastActivityDate="2014-10-26T03:46:53.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2623" PostTypeId="4" CreationDate="2014-10-26T02:05:34.950" Score="0" Body="Pretty Good Privacy (PGP) is a data encryption and decryption computer program that provides cryptographic privacy and authentication for data communication." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-26T03:47:14.113" LastActivityDate="2014-10-26T03:47:14.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2624" PostTypeId="1" CreationDate="2014-10-26T02:28:03.307" Score="3" ViewCount="1208" Body="&lt;p&gt;&lt;strong&gt;This only occurs when I turn evil-mode on!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I make a selection, either through evil or the mouse, the selection gets automatically copied into the clipboard. I have set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq select-active-regions nil)&#xA;(setq mouse-drag-copy-region nil)&#xA;(setq x-select-enable-primary nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that doesn't seem to do anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help? Please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I am using the GUI version of the the build found at emacsformacosx.com&lt;/p&gt;&#xA;" OwnerUserId="2263" LastEditorUserId="2263" LastEditDate="2014-10-26T14:34:45.640" LastActivityDate="2016-07-09T21:16:35.523" Title="How to disable copy on selection with evil-mode (Mac/24.4)?" Tags="|osx|mouse|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2625" PostTypeId="1" AcceptedAnswerId="2626" CreationDate="2014-10-26T04:28:34.430" Score="8" ViewCount="1321" Body="&lt;p&gt;I have the following documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mc/keymap is a variable defined in `multiple-cursors-core.el'.&#xA;Its value is (keymap&#xA; (67108903 . mc-hide-unmatched-lines-mode)&#xA; (27 keymap&#xA;     (118 . mc/cycle-backward))&#xA; (22 . mc/cycle-forward)&#xA; (return . multiple-cursors-mode)&#xA; (7 . mc/keyboard-quit))&#xA;&#xA;&#xA;Documentation:&#xA;Keymap while multiple cursors are active.&#xA;Main goal of the keymap is to rebind C-g and &amp;lt;return&amp;gt; to conclude&#xA;multiple cursors editing.&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that &lt;code&gt;C-g&lt;/code&gt; and &lt;code&gt;C-v&lt;/code&gt; are &lt;code&gt;7&lt;/code&gt; and &lt;code&gt;22&lt;/code&gt;, respectively, but I've no idea what any of the others are.  Is there a function I can use to do this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(equal (??? (kbd x)) x) =&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-10-26T07:12:11.277" Title="How can I go from a key 'code' back to its keyboard equivalency?" Tags="|keymap|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2626" PostTypeId="2" ParentId="2625" CreationDate="2014-10-26T07:02:44.457" Score="15" Body="&lt;p&gt;&lt;code&gt;help-key-description&lt;/code&gt; is used to display a humanly-readable key in the documentation when you invoke &lt;code&gt;describe-key&lt;/code&gt; (&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(help-key-description [22] nil)       ;; --&amp;gt; &quot;C-v&quot;&#xA;&#xA;(help-key-description [67108903] nil) ;; --&amp;gt; &quot;C-'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string=&#xA;  (help-key-description (kbd &quot;C-g&quot;) nil)&#xA;  &quot;C-g&quot;)&#xA;;; --&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-10-26T07:12:11.277" LastActivityDate="2014-10-26T07:12:11.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2627" PostTypeId="1" CreationDate="2014-10-26T08:45:27.807" Score="3" ViewCount="299" Body="&lt;p&gt;I am using company-mode and python-mode (note the same issue does not happen with python.el) and something about the combination is causing emacs to automatically expand at point. For example, if I type &quot;R&quot; it will expand immediately to &quot;REDISTRIBUTING&quot;, it seems to be looking in all of my buffers for dabbrevs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimal working init is below. How can I disable this behaviour or at least figure out where the bug lies so that I can report it. I am using emacs 24.4 on OSX (Yamamoto Mitsuharu's port). I would also be interested in knowing whether others can replicate this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook 'global-company-mode)&#xA;&#xA;(autoload 'python-mode &quot;python-mode&quot; &quot;Python Mode.&quot; t)&#xA; (add-to-list 'auto-mode-alist '(&quot;\\.py\\'&quot; . python-mode))&#xA; (add-to-list 'interpreter-mode-alist '(&quot;python&quot; . python-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2268" LastEditorUserId="50" LastEditDate="2014-10-26T16:18:37.427" LastActivityDate="2014-10-26T16:18:37.427" Title="Undesired auto expansion with company-mode and python-mode" Tags="|python|company-mode|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2628" PostTypeId="2" ParentId="2551" CreationDate="2014-10-26T09:16:12.343" Score="4" Body="&lt;p&gt;I suffered from the same situation.&#xA;Investigating in the &lt;strong&gt;configure.ac&lt;/strong&gt; file reveals that the configure script in my case got the -lpng15 from the invocation of the &lt;em&gt;libpng-config&lt;/em&gt; utility:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dnl Some systems, eg NetBSD 6, only provide eg &quot;libpng16&quot;, not &quot;libpng&quot;.&#xA;lpng=`libpng-config --libs 2&amp;gt; /dev/null`&#xA;case $lpng in&#xA;  -l*) : ;;&#xA;  *) lpng=&quot;-lpng&quot; ;;&#xA;esac&#xA;LIBPNG=&quot;$lpng -lz -lm&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Checking for the result that the utility yields, confirms the source of the link flag. In my case the error is due to a libpng installation from my external anaconda environment that gets mixed up with the build (and the anaconda env lacks the dev files for building... else it probably would have worked).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/desk/emacs-24.4$ libpng-config --libs&#xA;   -lpng15&#xA;~/desk/emacs-24.4$ which libpng-config&#xA;   /opt/anaconda/python2.7/bin/libpng-config&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, my guess is that you also should have a look at the PATH settings of your build environment and test where the libpng-config comes from. Correct it and then re-run configure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After correcting the PATH my build works cleanly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2014-10-26T09:16:12.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2629" PostTypeId="2" ParentId="2520" CreationDate="2014-10-26T09:21:04.613" Score="5" Body="&lt;p&gt;There is obviously more than one way to skin this particular cat. My current favourite is to use &lt;code&gt;outline-minor-mode&lt;/code&gt; with &lt;a href=&quot;https://github.com/tj64/outshine&quot; rel=&quot;nofollow&quot;&gt;outshine&lt;/a&gt;. Excerpt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; * This here is my emacs init file&#xA;;; ** Many subsections with headlines like this one omitted&#xA;;; ** Customising modes&#xA;;; […] more lines omitted&#xA;;; *** Org and outline modes&#xA;(autoload 'outshine-hook-function &quot;outshine&quot;)&#xA;(add-hook 'outline-minor-mode-hook 'outshine-hook-function)&#xA;;; […] and more&#xA;;; * Emacs Magic&#xA;;;; Local Variables:&#xA;;;; mode: emacs-lisp&#xA;;;; coding: utf-8&#xA;;;; mode: outline-minor&#xA;;;; fill-column: 79&#xA;;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you will need to get outshine from your favourite package repository.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2014-10-26T09:21:04.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2630" PostTypeId="2" ParentId="2620" CreationDate="2014-10-26T10:18:02.070" Score="2" Body="&lt;p&gt;As of &lt;a href=&quot;http://flycheck.readthedocs.org/en/latest/guide/releases/flycheck-0.21.html&quot; rel=&quot;nofollow&quot;&gt;Flycheck 0.21&lt;/a&gt; you can now use the new option &lt;code&gt;flycheck-gcc-openmp&lt;/code&gt; to enable OpenMP in GCC for C and C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable OpenMP globally, add the following to your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default flycheck-gcc-openmp t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd recommend to set this variable with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;File Variables&lt;/a&gt; or &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables&quot; rel=&quot;nofollow&quot;&gt;Directory Variables&lt;/a&gt;, for each file or project where you'd like to use OpenMP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I'm the Flycheck maintainer.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-26T10:18:02.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2631" PostTypeId="2" ParentId="141" CreationDate="2014-10-26T10:42:26.313" Score="5" Body="&lt;p&gt;The Yamamoto Mitsuharu port of emacs doesn't support multi-tty unfortunately (see this &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport/issues/52&quot; rel=&quot;nofollow noreferrer&quot;&gt;issue&lt;/a&gt;). This means that you can't start the emacs daemon from the terminal and launch a gui window with emacsclient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I do: In my init.el I have &lt;code&gt;(server-start)&lt;/code&gt;and I launch Emacs.app at login. The annoyance here is that this brings up a window which I have to manually minimise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then have a bash script called &lt;code&gt;emacsc&lt;/code&gt; with the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash                                                                          &#xA;export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin&#xA;emacsclient -n -c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then create an app with applescript which contains the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tell application &quot;Emacs&quot;&#xA;    activate&#xA;end tell&#xA;do shell script &quot;~/bin/emacsc&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is important to pass the &lt;code&gt;-n&lt;/code&gt; flag to emacsclient otherwise you will only be able to use the emacsc app to open one client at a time. Setting the path variable makes sure that OS X can find the correct version of emacsclient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Telling Emacs to &quot;activate&quot; ensures that your client window will be launched in the foreground.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said the annoyance is that you have to manually minimise the emacs window on login and then have it sitting down in the dock. One way to avoid this is to automatically &quot;hide&quot; Emacs after login but then having it activate will cause it to unhide.&lt;/p&gt;&#xA;" OwnerUserId="2268" LastEditorUserId="13444" LastEditDate="2017-05-13T00:43:32.520" LastActivityDate="2017-05-13T00:43:32.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2632" PostTypeId="2" ParentId="2399" CreationDate="2014-10-26T12:01:09.207" Score="1" Body="&lt;p&gt;It turns out that more almost all languages supported by Org Babel there is no option to use a different interpreter for a specific code-block. One notable exception (and the one that interests me) is Javascript. In this case one can use the &lt;code&gt;:cmd&lt;/code&gt; option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard JS interpreter is &lt;code&gt;node&lt;/code&gt;, as defined in the variable &lt;code&gt;org-babel-js-cmd&lt;/code&gt;. To run a specific code block through a different interpreter pass the &lt;code&gt;:cmd&lt;/code&gt; option as in the following example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src js :cmd &quot;/usr/bin/osascript -l JavaScript&quot;&#xA;app = Application.currentApplication()&#xA;app.includeStandardAdditions = true&#xA;app.say(&quot;Hello&quot;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2177" LastActivityDate="2014-10-26T12:01:09.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2633" PostTypeId="1" AcceptedAnswerId="2638" CreationDate="2014-10-26T12:16:39.460" Score="4" ViewCount="375" Body="&lt;p&gt;Flycheck has a brilliant ability to warn about when I'm using a function &lt;code&gt;foo-bar&lt;/code&gt; but have forgotten to add &lt;code&gt;(require 'foo)&lt;/code&gt; at the top of my file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it's inconsistent. It doesn't always warn for functions from some packages, even if the function is not autoloaded. How can I make Emacs warn me about these?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This produces a warning&#xA;;; &quot;the function `which-function' is not known to be defined.&quot;&#xA;(defun which-func-not-required ()&#xA;  (which-function))&#xA;&#xA;;; This produces no warning.&#xA;(defun cl-not-required (x)&#xA;  (cl-copy-list x))&#xA;&#xA;;; This produces no warning either.&#xA;(defun byte-comp-not-required (f)&#xA;  (byte-compile-top-level f))&#xA;&#xA;;; end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(inspired by &lt;a href=&quot;https://github.com/Bruce-Connor/names/pull/1&quot; rel=&quot;nofollow&quot;&gt;this PR&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2014-10-26T14:03:16.023" Title="How can I get lint warnings when I've forgotten to require a package?" Tags="|flycheck|byte-compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2634" PostTypeId="1" AcceptedAnswerId="2657" CreationDate="2014-10-26T12:27:09.447" Score="6" ViewCount="217" Body="&lt;p&gt;When I change the state of a TODO item in Org-Agenda (i.e., by hitting &lt;code&gt;t&lt;/code&gt;), it repositions the buffer so that that item is at the top of the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want it to do that — I'd rather just keep the buffer where it is (so I can see the entire day view, for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this configurable?&lt;/p&gt;&#xA;" OwnerUserId="505" LastEditorUserId="50" LastEditDate="2014-10-26T19:48:05.177" LastActivityDate="2014-10-26T20:25:01.433" Title="Don't reposition Org Agenda buffer when starting TODO" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2635" PostTypeId="2" ParentId="2600" CreationDate="2014-10-26T12:34:23.603" Score="0" Body="&lt;p&gt;Here's what I have been doing to address this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun force-lc-all-for-shell ()&#xA;  &quot;For the benefit of python we force LC_ALL to utf-8.&quot;&#xA;  (comint-send-string (get-buffer-process (current-buffer)) &quot;LC_ALL=en_US.UTF-8\n&quot;))&#xA;&#xA;(add-hook 'shell-mode-hook 'force-lc-all-for-shell)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it seems quite ad hoc, and obviously doesn't affect other ways of running programs from Emacs.&lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="2355" LastEditDate="2014-11-25T15:35:00.120" LastActivityDate="2014-11-25T15:35:00.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2636" PostTypeId="1" CreationDate="2014-10-26T12:38:37.320" Score="5" ViewCount="1991" Body="&lt;p&gt;&lt;strong&gt;How can I permanently rebind keys?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to rebind &lt;code&gt;C-i&lt;/code&gt;, &lt;code&gt;C-j&lt;/code&gt;, &lt;code&gt;C-k&lt;/code&gt;, and &lt;code&gt;C-l&lt;/code&gt; to act like the arrow keys.  However, when using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-l&quot;) 'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it will only do so for the session; the bindings don't persist after restarting Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way to automatically do this every time on startup or via a config file or something?&lt;/p&gt;&#xA;" OwnerUserId="2271" LastEditorUserId="105" LastEditDate="2014-10-26T16:59:20.107" LastActivityDate="2014-10-27T19:08:10.263" Title="How can I permanently rebind keys?" Tags="|keymap|key-bindings|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2637" PostTypeId="2" ParentId="141" CreationDate="2014-10-26T12:53:24.947" Score="0" Body="&lt;p&gt;On the mac daemons are, 90% of the time, managed using &lt;a href=&quot;https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html#//apple_ref/doc/uid/10000172i-SW7-BCIEDDBJ&quot; rel=&quot;nofollow&quot;&gt;launchd&lt;/a&gt;.  It's can run them on many triggers, including user login/logout.  There is a pretty Mac Application called &lt;a href=&quot;https://www.peterborgapps.com/lingon/&quot; rel=&quot;nofollow&quot;&gt;Lingon&lt;/a&gt; for viewing and editing the various things launchd is managing.  The emacs wiki has &lt;a href=&quot;https://duckduckgo.com/?q=launchd%20site%3Aemacswiki.org&quot; rel=&quot;nofollow&quot;&gt;some mentions&lt;/a&gt; of this, including and example &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsAsDaemon#toc7&quot; rel=&quot;nofollow&quot;&gt;config file&lt;/a&gt;.  But that looks like it doesn't address your concern, i.e. how to shut down the daemon on logout.&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2014-10-26T12:53:24.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2638" PostTypeId="2" ParentId="2633" CreationDate="2014-10-26T14:03:16.023" Score="3" Body="&lt;p&gt;You will &lt;strong&gt;never&lt;/strong&gt; get warnings about functions from &lt;code&gt;bytecomp.el&lt;/code&gt; being undefined during byte-compilation, for a very obvious reason:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;bytecomp.el&lt;/code&gt; &lt;strong&gt;implements&lt;/strong&gt; the byte compiler, so it is naturally loaded and all functions therein defined during byte-compilation, whether the compiled files loads it or not.  This also affects all libraries loaded by &lt;code&gt;bytecomp.el&lt;/code&gt;, notably &lt;code&gt;macroexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is &lt;strong&gt;nothing&lt;/strong&gt; that you or Flycheck (or, for that matter, any Emacs Lisp code) could do about this.  It is a &lt;strong&gt;fundamental flaw&lt;/strong&gt; in Emacs:  Libraries are compiled within the running Emacs session, and thus inherit the entire environment (including all definitions) of this session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You &lt;strong&gt;should&lt;/strong&gt; get warnings about undefined functions from &lt;code&gt;cl-lib&lt;/code&gt;, though.  If you don't, you do not compile in a clean session.  Check your settings.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-26T14:03:16.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2639" PostTypeId="2" ParentId="2624" CreationDate="2014-10-26T14:43:55.403" Score="4" Body="&lt;p&gt;It turns out it was evil-mode that did that! The answer can be found here: &lt;a href=&quot;https://stackoverflow.com/questions/17127009/how-to-disable-emacs-evil-selection-auto-copies-to-clipboard/23254728#23254728&quot;&gt;https://stackoverflow.com/questions/17127009/how-to-disable-emacs-evil-selection-auto-copies-to-clipboard/23254728#23254728&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code snippet that solved it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Override the default x-select-text function because it doesn't&#xA;; respect x-select-enable-clipboard on OS X.&#xA;(defun x-select-text (text))&#xA;(setq x-select-enable-clipboard nil)&#xA;(setq x-select-enable-primary nil)&#xA;(setq mouse-drag-copy-region nil)&#xA;&#xA;(setq interprogram-cut-function 'ns-set-pasteboard)&#xA;(setq interprogram-paste-function 'ns-get-pasteboard)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2263" LastActivityDate="2014-10-26T14:43:55.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2640" PostTypeId="2" ParentId="2636" CreationDate="2014-10-26T15:10:39.793" Score="7" Body="&lt;p&gt;As @Dan mentioned in his comment to your question above, you can do that by putting your customizations in a config file like &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But&lt;/strong&gt; I would recommend not overriding the &lt;code&gt;C-i&lt;/code&gt; &lt;code&gt;C-j&lt;/code&gt; &lt;code&gt;C-k&lt;/code&gt; &lt;code&gt;C-l&lt;/code&gt; keys as they serve some core functions like joining lines, killing text, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try out &lt;code&gt;evil-mode&lt;/code&gt; instead if you need vim-style navigation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got used to &lt;code&gt;C-b&lt;/code&gt; &lt;code&gt;C-n&lt;/code&gt; &lt;code&gt;C-p&lt;/code&gt; &lt;code&gt;C-f&lt;/code&gt; keys by installing &lt;code&gt;hardcore-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-10-26T15:10:39.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2641" PostTypeId="5" CreationDate="2014-10-26T15:15:02.910" Score="0" Body="&lt;p&gt;Here is a screenshot that shows a windows with it's mode line (the gray bar at the bottom):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://notatnik.mekk.waw.pl/img/posts/a_wlasnie_ze_nie_scrollbar/4505001451-normal.jpg&quot; alt=&quot;The mode-line&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For complete information on the contents of &lt;a href=&quot;http://www.emacswiki.org/cgi-bin/info-ref?find=mode%20line&quot; rel=&quot;nofollow noreferrer&quot;&gt;mode lines&lt;/a&gt;, see mode line in the &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsManual&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsManual&lt;/a&gt;. The information in a mode line usually includes the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Whether or not the buffer has been modified:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;**&lt;/code&gt; – modified since last save&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--&lt;/code&gt; – not modified since last save&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;%*&lt;/code&gt; – read-only, but modified&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;%%&lt;/code&gt; – read-only, not modified&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Buffer name.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The name of one or more MajorModes or MinorModes of the buffer&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Line number of the TextCursor (and Point), and perhaps the column number.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Position in buffer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Top&lt;/code&gt; – the beginning of the buffer is shown in the window&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Bot&lt;/code&gt; – the end of the buffer is shown in the window&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;All&lt;/code&gt; – all of the buffer is shown in the window&lt;/li&gt;&#xA;&lt;li&gt;a percentage – percentage of the buffer above the top of the window. &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Coding system of the buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;End-of-line translation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;: &lt;a href=&quot;http://www.emacswiki.org/ModeLine&quot; rel=&quot;nofollow noreferrer&quot;&gt;ModeLine | Emacs Wiki&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.233" LastActivityDate="2014-10-26T16:48:26.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2642" PostTypeId="4" CreationDate="2014-10-26T15:15:02.910" Score="0" Body="The mode line is a useful summary information about the buffer shown in the window, including its name and current modes. It is located at the bottom of every Emacs Window aside from MiniBuffer windows. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T01:11:44.127" LastActivityDate="2014-10-27T01:11:44.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2643" PostTypeId="1" CreationDate="2014-10-26T16:02:53.223" Score="8" ViewCount="1076" Body="&lt;p&gt;In my .emacs file, I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default major-mode&#xA;          (lambda ()&#xA;            (let ((buffer-file-name&#xA;                   (replace-regexp-in-string&#xA;                    &quot;\\.tmp$&quot; &quot;&quot;&#xA;                    (or buffer-file-name (buffer-name)))))&#xA;              (set-auto-mode)&#xA;              )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This ended up causing files such as 'foo.el.tmp' to open in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I upgraded Emacs, this started breaking; when I open a buffer that doesn't exist that should be open in fundamental-mode, such as 'asdfg', I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;image-type-from-buffer: Variable binding depth exceeds max-specpdl-size&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to be due to (set-auto-mode) in major-mode calling now being recursive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="50" LastEditDate="2014-10-26T19:17:18.033" LastActivityDate="2014-10-26T20:01:20.700" Title="Specify major-mode for files with multiple extensions" Tags="|major-mode|files|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2644" PostTypeId="1" AcceptedAnswerId="2692" CreationDate="2014-10-26T16:35:10.730" Score="36" ViewCount="9488" Body="&lt;p&gt;I've read the Emacs documentation for &lt;code&gt;align-regexp&lt;/code&gt; but still have difficulty in understanding how it works. What I'm talking about is its prefixed form &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;align-regexp&lt;/code&gt;, not the simple form &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;align-regexp&lt;/code&gt;. Here are my questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does the first parameter (the regex) have to match the whole line of string? What if the regex only matchs a part of the string?&lt;/li&gt;&#xA;&lt;li&gt;What to supply to the second parameter (Parenthesis group to modify (justify if negative))? As I understand here I need to supply a captured group number (count from 1), right? Does &quot;justify if negative&quot; means, if I want group 3 to right aligned, I'll supply &lt;code&gt;-3&lt;/code&gt; as the input?&lt;/li&gt;&#xA;&lt;li&gt;What does the third parameter &quot;amount of spacing (or column if negative)&quot; mean? I just totally don't understand what this parameter does.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've collect some text examples to practice. If anyone can use below text as examples that will be very helpful.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;From&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class CreateStudents &amp;lt; ActiveRecord::Migration&#xA;  def change&#xA;    create_table :students, :comment =&amp;gt; &quot;学生信息表&quot; do |t|&#xA;      t.string :political_status, :comment =&amp;gt; &quot;政治面貌&quot;&#xA;      t.string :education_level, :comment =&amp;gt; &quot;培养层次&quot;&#xA;      t.string :enroll_method, :comment =&amp;gt; &quot;入学方式&quot;&#xA;      t.date :enrolled_at, :comment =&amp;gt; &quot;入学时间&quot;&#xA;      t.string :charge_type, :comment =&amp;gt; &quot;收费类别&quot;&#xA;      t.string :enrolled_year, :comment =&amp;gt; &quot;学籍年度&quot;&#xA;      t.string :enrolled_place, :comment =&amp;gt; &quot;生源所在地&quot;&#xA;      t.string :bank_card_number, :comment =&amp;gt; &quot;银行卡号&quot;&#xA;      t.string :bank_account_number,  :comment =&amp;gt; &quot;银行账号&quot;&#xA;      t.boolean :is_active_duty, :default =&amp;gt; false, :comment =&amp;gt; &quot;是否现役军人&quot;&#xA;      t.boolean :is_equivalent_degree, :default =&amp;gt; false, :comment =&amp;gt; &quot;是否同等学历&quot;&#xA;      t.boolean :is_on_record, :default =&amp;gt; true, :comment =&amp;gt; &quot;是否在籍&quot;&#xA;      t.boolean :is_at_school, :default =&amp;gt; true, :comment =&amp;gt; &quot;是否在校&quot;&#xA;      t.timestamps&#xA;    end&#xA;  end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class CreateStudents &amp;lt; ActiveRecord::Migration&#xA;  def change&#xA;    create_table :students, :comment =&amp;gt; &quot;学生信息表&quot; do |t|&#xA;      t.string  :political_status,     :comment =&amp;gt; &quot;政治面貌&quot;&#xA;      t.string  :education_level,      :comment =&amp;gt; &quot;培养层次&quot;&#xA;      t.string  :enroll_method,        :comment =&amp;gt; &quot;入学方式&quot;&#xA;      t.date    :enrolled_at,          :comment =&amp;gt; &quot;入学时间&quot;&#xA;      t.string  :charge_type,          :comment =&amp;gt; &quot;收费类别&quot;&#xA;      t.string  :enrolled_year,        :comment =&amp;gt; &quot;学籍年度&quot;&#xA;      t.string  :enrolled_place,       :comment =&amp;gt; &quot;生源所在地&quot;&#xA;      t.string  :bank_card_number,     :comment =&amp;gt; &quot;银行卡号&quot;&#xA;      t.string  :bank_account_number,  :comment =&amp;gt; &quot;银行账号&quot;&#xA;      t.boolean :is_active_duty,       :default =&amp;gt; false,  :comment =&amp;gt; &quot;是否现役军人&quot;&#xA;      t.boolean :is_equivalent_degree, :default =&amp;gt; false,  :comment =&amp;gt; &quot;是否同等学历&quot;&#xA;      t.boolean :is_on_record,         :default =&amp;gt; true,   :comment =&amp;gt; &quot;是否在籍&quot;&#xA;      t.boolean :is_at_school,         :default =&amp;gt; true,   :comment =&amp;gt; &quot;是否在校&quot;&#xA;      t.timestamps&#xA;    end&#xA;  end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;From&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;my @primes = (&#xA;    1,2,3,5,7,&#xA;    11,13,17,19,23,&#xA;    29,31,37,41,43,&#xA;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;my @primes = (&#xA;    1,  2,  3,  5,  7,&#xA;    11, 13, 17, 19, 23,&#xA;    29, 31, 37, 41, 43,&#xA;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2273" LastEditorUserId="50" LastEditDate="2014-10-26T20:04:21.247" LastActivityDate="2021-03-19T21:18:21.190" Title="Understanding of emacs align-regexp" Tags="|regular-expressions|align|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2645" PostTypeId="5" CreationDate="2014-10-26T17:00:55.250" Score="0" Body="&lt;p&gt;Written in a declarative language, patterns for matching text use a combination of special characters and ordinary characters. Many Emacs commands can use &lt;a href=&quot;/questions/tagged/regular-expressions&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;regular-expressions&amp;#39;&quot; rel=&quot;tag&quot;&gt;regular-expressions&lt;/a&gt; for searching, matching, replacing, and navigating. Emacs has several methods of entering search patterns, including the interactive &lt;code&gt;re-builder&lt;/code&gt; and alternative syntax styles. Regex versions of &lt;a href=&quot;/questions/tagged/search&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;search&amp;#39;&quot; rel=&quot;tag&quot;&gt;search&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/replace&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;replace&amp;#39;&quot; rel=&quot;tag&quot;&gt;replace&lt;/a&gt; commands can also work incrementally like the &lt;a href=&quot;/questions/tagged/query-replace&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;query-replace&amp;#39;&quot; rel=&quot;tag&quot;&gt;query-replace&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some commands include &lt;code&gt;regex&lt;/code&gt; or &lt;code&gt;regexp&lt;/code&gt; prefixes or suffixes. Common ones are &lt;code&gt;replace-regexp&lt;/code&gt;, &lt;code&gt;query-replace-regexp&lt;/code&gt;, &lt;code&gt;align-regexp&lt;/code&gt;, &lt;code&gt;highlight-regexp&lt;/code&gt;. But not all commands have &lt;a href=&quot;/questions/tagged/regexp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;regexp&amp;#39;&quot; rel=&quot;tag&quot;&gt;regexp&lt;/a&gt; in their names, such as &lt;code&gt;multi-occur&lt;/code&gt;, &lt;code&gt;how-many&lt;/code&gt;, &lt;code&gt;keep-lines&lt;/code&gt;, &lt;code&gt;flush-lines&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;lgrep&lt;/code&gt;, and &lt;code&gt;rgrep&lt;/code&gt;. Emacs uses &lt;a href=&quot;/questions/tagged/regexp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;regexp&amp;#39;&quot; rel=&quot;tag&quot;&gt;regexp&lt;/a&gt; patterns extensively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions tagged with &lt;a href=&quot;/questions/tagged/regexp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;regexp&amp;#39;&quot; rel=&quot;tag&quot;&gt;regexp&lt;/a&gt; or &lt;a href=&quot;/questions/tagged/regular-expressions&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;regular-expressions&amp;#39;&quot; rel=&quot;tag&quot;&gt;regular-expressions&lt;/a&gt; should include additional tags or clarify which command is being used for regex matching.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-12T16:47:38.447" LastActivityDate="2017-02-12T16:47:38.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2646" PostTypeId="4" CreationDate="2014-10-26T17:00:55.250" Score="0" Body="is for patterns specifying search or replace strings. Also known as `regex` or `regexp`, the patterns describe strings to match when searching or replacing. Emacs provides extensive support for `regex` patterns in many commands. Emacs also provides an interactive expression builder for such patterns. " OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-03-03T12:54:14.257" LastActivityDate="2017-03-03T12:54:14.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2647" PostTypeId="1" CreationDate="2014-10-26T17:08:06.947" Score="3" ViewCount="1512" Body="&lt;p&gt;With the following init file, emacs chokes on the first line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash-4.3$ pwd&#xA;/Users/sean/.emacs.d&#xA;&#xA;bash-4.3$ cat init.el &#xA;(require 'use-package)&#xA;(use-package package)&#xA;&#xA;bash-4.3$ emacs --version | head -n 1&#xA;GNU Emacs 24.4.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I run emacs 'normally' (with this init file) and perform the &lt;code&gt;require&lt;/code&gt; manually, it succeeds.  Why would this happen?  What can I do to fix it that won't have me changing load-paths every time I update &lt;code&gt;use-package&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It is interesting to note that, by specifying the load manually, no errors are reported:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash-4.3$ emacs --batch -L init.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, starting emacs interactively shows the issue.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2015-05-20T04:34:00.223" LastActivityDate="2015-05-20T04:34:00.223" Title="Why does (require 'use-package) fail from my init file, but succeed interactively?" Tags="|elisp|init-file|package|" AnswerCount="2" CommentCount="3" ClosedDate="2014-10-27T09:23:03.693" ContentLicense="CC BY-SA 3.0" />
  <row Id="2648" PostTypeId="1" AcceptedAnswerId="2707" CreationDate="2014-10-26T17:09:11.170" Score="10" ViewCount="752" Body="&lt;p&gt;As the title suggests, how do I get all the file entries in a Dired buffer using Elisp?&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-29T22:46:54.987" Title="Get all filenames in current Dired buffer with Elisp" Tags="|elisp|dired|files|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2649" PostTypeId="2" ParentId="2648" CreationDate="2014-10-26T17:19:25.013" Score="6" Body="&lt;p&gt;I don't know if there's a single function that does this, but this can work for you:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let (r)&#xA;  (dired-unmark-all-files ?\r nil)&#xA;  (dired-toggle-marks)&#xA;  (setq r (dired-get-marked-files))&#xA;  (dired-toggle-marks)&#xA;  r)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sometimes you can simplify it to:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn (dired-toggle-marks)&#xA;       (dired-get-marked-files))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-10-26T17:19:25.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2650" PostTypeId="1" AcceptedAnswerId="2669" CreationDate="2014-10-26T17:23:33.343" Score="15" ViewCount="16026" Body="&lt;p&gt;I have a sentence with the words &lt;code&gt;42 m s^{-1}&lt;/code&gt;. When this is exported to LaTeX it exports as  &lt;code&gt;42 m s$^{\text{-1}}$&lt;/code&gt;. How should I write it, or what flags should I set in the &lt;code&gt;#+OPTIONS:&lt;/code&gt; line, so that it exports as &lt;code&gt;42 m s^{-1}&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2014-10-28T10:05:02.747" Title="How should I write inline equations in Org Mode so they export to LaTeX properly?" Tags="|org-mode|latex|org-export|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2651" PostTypeId="2" ParentId="2650" CreationDate="2014-10-26T17:36:11.847" Score="8" Body="&lt;p&gt;Just wrap it with the TeX-dollars:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$x^2$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;exports to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;$x^2$&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-10-26T17:36:11.847" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2652" PostTypeId="2" ParentId="2647" CreationDate="2014-10-26T17:56:52.233" Score="0" Body="&lt;p&gt;Library &lt;code&gt;use-package.el&lt;/code&gt; is not in your &lt;code&gt;load-path&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;-l&lt;/code&gt; command-line option expects a file name, not a library name. You need to use option &lt;code&gt;-L&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Action-Arguments.html&quot; rel=&quot;nofollow&quot;&gt;(emacs) &lt;code&gt;Action Arguments&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html&quot; rel=&quot;nofollow&quot;&gt;(elisp) &lt;code&gt;Library Search&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-26T18:04:00.480" LastActivityDate="2014-10-26T18:04:00.480" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2653" PostTypeId="2" ParentId="2647" CreationDate="2014-10-26T18:10:50.267" Score="7" Body="&lt;p&gt;It is &lt;code&gt;package.el&lt;/code&gt; (with &lt;code&gt;package-initialize&lt;/code&gt;) that adds the subdirectories of &lt;code&gt;.emacs.d/elpa&lt;/code&gt; to your load path; these are not loaded automatically.  Since &lt;code&gt;use-package&lt;/code&gt; is in this directory, emacs doesn't see it until it encounters &lt;code&gt;(package-initialize)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;(require 'use-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would appear that &lt;code&gt;(package-initialize)&lt;/code&gt; is called sometime &lt;em&gt;after&lt;/em&gt; the initialization file has been loaded.  More information on the initialization sequence can be found in the manual:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Starting-Up.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;(emacs) Starting Up&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;@Drew pointed out &lt;a href=&quot;https://emacs.stackexchange.com/questions/2647/why-does-require-use-package-fail-from-my-init-file-but-succeed-interactivel/2652?noredirect=1#comment3615_2652&quot;&gt;in a comment&lt;/a&gt; that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;… now that there is &lt;code&gt;package-enable-at-startup&lt;/code&gt;, with &lt;code&gt;t&lt;/code&gt; as the default value, &lt;code&gt;package-initialize&lt;/code&gt; does get called after loading your init file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-10-26T18:28:08.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2654" PostTypeId="2" ParentId="2643" CreationDate="2014-10-26T19:09:51.423" Score="14" Body="&lt;p&gt;The &lt;code&gt;auto-mode-alist&lt;/code&gt; variable does what you need. Never bind anything to the &lt;code&gt;major-mode&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation explains how you can set major-modes per file extension &lt;strong&gt;and&lt;/strong&gt;, most importantly, it explains how to treat multiple extensions.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alist of filename patterns vs corresponding major mode functions. Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL). (NON-NIL stands for anything that is not nil; the value does not matter.) Visiting a file whose name matches REGEXP specifies FUNCTION as the mode function to use. FUNCTION will be called, unless it is nil.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the element has the form (REGEXP FUNCTION NON-NIL), then after calling FUNCTION (if it's not nil), we delete the suffix that matched REGEXP and search the list again for another match.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you just need to tell Emacs to ignore the &quot;tmp&quot; extension and to look at the next extension.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.tmp\\'&quot; ignore t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you also want to apply major-modes to buffers not associated to any file, see&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/q/2497/50&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-10-26T20:01:20.700" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2655" PostTypeId="1" CreationDate="2014-10-26T19:14:37.797" Score="6" ViewCount="475" Body="&lt;p&gt;I am aware that org-mode derives from outline-mode, in the same way as outline-mode derives from text-mode, which derives from nil. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have always wonder if there exists something similar to a documented tree of major modes allowing to follow hooks, so that fundamental-mode might be at the base of them all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a list of major-modes, with their respective hierarchies, documented anywhere?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="546" LastEditorUserId="50" LastEditDate="2014-10-26T19:21:03.183" LastActivityDate="2014-10-26T20:33:42.830" Title="hierarchy of modes" Tags="|major-mode|learning|documentation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2656" PostTypeId="2" ParentId="2648" CreationDate="2014-10-26T19:56:08.047" Score="3" Body="&lt;p&gt;In addition to @abo-abo's answer, which tells you how to get a &lt;strong&gt;list&lt;/strong&gt; of the file (&amp;amp; dir) names:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on what you want, you can alternatively use &lt;strong&gt;&lt;code&gt;dired-copy-filename-as-kill&lt;/code&gt;&lt;/strong&gt; (bound to &lt;code&gt;w&lt;/code&gt;) instead of &lt;code&gt;dired-get-marked-files&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It puts the file names into a single, space-separated &lt;strong&gt;string&lt;/strong&gt;, and pushes that string to the &lt;code&gt;kill-ring&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Space separation means, of course, that it is not so helpful when some of the file names themselves contain space characters. ;-))&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-26T19:56:08.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2657" PostTypeId="2" ParentId="2634" CreationDate="2014-10-26T20:08:09.177" Score="2" Body="&lt;p&gt;This has been fixed as of Org version &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tag/?id=release_8.2.6&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;8.2.6&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was changed in this commit:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=6ba3b2d03d277f6e8b67f9ca5ef6de19476bfc09&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;6ba3b2 2014-03-18 19:54:02&lt;/code&gt;&lt;/a&gt;&lt;br&gt;&#xA;    org-agenda.el (org-agenda-todo): Restore the window correctly&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* org-agenda.el (org-agenda-todo): Always restore the window&#xA;state after `org-agenda-change-all-lines' has been called.&#xA;&#xA;`org-agenda-change-all-lines' is narrowing to the line it needs to&#xA;update.  In the narrowed state, `org-agenda-finalize' is called,&#xA;which may lead to a change in the way the window is displayed.  We&#xA;use `save-window-excursion' to ensure the window state is restored&#xA;correctly.&#xA;&#xA;Thanks to Francesco Pizzolante for reporting this with a&#xA;detailed recipe.&#xA;&#xA;diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el&#xA;index 54529d4..e20a55e 100644&#xA;--- a/lisp/org-agenda.el&#xA;+++ b/lisp/org-agenda.el&#xA;@@ -8792,7 +8792,7 @@ the same tree node, and the headline of ...&#xA;    (org-back-to-heading)&#xA;    (move-marker org-last-heading-marker (point))))&#xA;       (beginning-of-line 1)&#xA;-      (save-excursion&#xA;+      (save-window-excursion&#xA;  (org-agenda-change-all-lines newhead hdmarker 'fixface just-one))&#xA;       (when (org-bound-and-true-p org-clock-out-when-done)&#xA;          (string-match (concat &quot;^&quot; (regexp-opt org-done-keywords-for-agenda))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you don't want to update, simply apply the patch above.  It's only one line.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-10-26T20:25:01.433" LastActivityDate="2014-10-26T20:25:01.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2658" PostTypeId="1" AcceptedAnswerId="3885" CreationDate="2014-10-26T20:25:21.477" Score="2" ViewCount="1945" Body="&lt;p&gt;I use js2-mode with emacs-prelude, imenu displays the list of functions and I can collapse and uncollapse the functions defined in a regular js file like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function testFunction1(){&#xA;    console.debug(&quot;test function&quot;);&#xA;}&#xA;&#xA;function testFunction2(arg1, arg2){&#xA;    console.debug(&quot;test function2&quot;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It however doesn't work on a angular js file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'use strict';&#xA;app.controller('TestController', ['$scope', 'TestService',&#xA;    function($scope, TestService){&#xA;&#xA;        function testFunction1(obj) {&#xA;            console.debug(&quot;Test Function&quot;);&#xA;        }&#xA;&#xA;        var testVariable = {&#xA;            'field1': 'val1',&#xA;            'field2': 'val2'&#xA;        };&#xA;&#xA;        $scope.scopeFunction1 = function(){&#xA;            console.debug(&quot;Scope Function &quot;);&#xA;       };&#xA;&#xA;       $scope.scopeVar ={&#xA;        'field1': 'val1',&#xA;        'field2': 'val2'&#xA;    };&#xA;}]);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't recognize - testFunction1 or scopeFunction1 as a function, they are not displayed on the iMenu and I couldn't collapse/uncollapse them.&#xA;How can we configure emacs for working with angular js files.&lt;/p&gt;&#xA;" OwnerUserId="895" LastEditorUserId="7" LastEditDate="2014-10-26T21:15:42.030" LastActivityDate="2014-11-26T12:23:45.293" Title="How to display the list of functions in iMenu and collapse/uncollapse functions in angular js file" Tags="|javascript|js2-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2659" PostTypeId="2" ParentId="2655" CreationDate="2014-10-26T20:33:42.830" Score="4" Body="&lt;pre&gt;&lt;code&gt;(defun modes-tree ()&#xA;  (cl-loop&#xA;   with result = (make-hash-table)&#xA;   for maybe-mode in (apropos-internal &quot;-mode$&quot;)&#xA;   ;; This doesn't really filter all non-modes, but it gets close&#xA;   when (fboundp maybe-mode) do&#xA;   (setf (gethash maybe-mode result)&#xA;         (get maybe-mode 'derived-mode-parent))&#xA;   finally (cl-return result)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Something to get you started. This will produce a hash-map containing every symbol which looks like it is a mode as a key. And, if it is a derived, mode, then the value pointed by that symbol will be the parent mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But printing this is a much, much harder problem :) Graph printing is in general very non-trivial. Maybe you could export this as &lt;a href=&quot;http://www.graphviz.org/&quot; rel=&quot;nofollow&quot;&gt;Dot&lt;/a&gt; and then use something like &lt;a href=&quot;http://www.ogdf.net/doku.php&quot; rel=&quot;nofollow&quot;&gt;OGDF&lt;/a&gt; to print it nicely (Graphiz can also print graphs, but, quite frankly, it doesn't look very good / it's hard to get it to lay out the graph exactly the way you want).&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-10-26T20:33:42.830" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2661" PostTypeId="1" AcceptedAnswerId="2667" CreationDate="2014-10-26T20:51:36.113" Score="13" ViewCount="1154" Body="&lt;p&gt;I want to add a specific key binding  to latex-mode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key latex-mode-map (kbd &quot;&amp;lt;f6&amp;gt;&quot;) 'my-latex-defun)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time I want to set it only when the specific mode is loaded. So I would like to know if there is a preference (best practice) between using the appropriate hook (&lt;code&gt;latex-mode-hook&lt;/code&gt;) to accomplish that or using the clause &lt;code&gt;(with-eval-after-load &quot;tex-mode&quot; ...&lt;/code&gt; to wrap the key binding definition. I tested both and they work fine, however I wonder which one is the right way to do it.&lt;/p&gt;&#xA;" OwnerUserId="2275" LastEditorUserId="50" LastEditDate="2014-10-26T23:03:45.713" LastActivityDate="2015-11-20T19:54:28.987" Title="Where should I include a lazy initialization?" Tags="|init-file|hooks|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2662" PostTypeId="2" ParentId="2661" CreationDate="2014-10-26T21:13:35.907" Score="5" Body="&lt;p&gt;In addition to your suggestions of &lt;code&gt;eval-after-load&lt;/code&gt; and using a hook, let me suggest &lt;code&gt;use-package.el&lt;/code&gt;.  You can do what you need to with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package latex&#xA;  :ensure auctex&#xA;  :bind (&quot;&amp;lt;f6&amp;gt;&quot; . my-latex-defun))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;LaTeX won't be loaded until &lt;em&gt;after&lt;/em&gt; you request it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as a side note: careful use of &lt;code&gt;use-package&lt;/code&gt; has cut my startup times down to under a second.  (It used to take around four seconds.)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-11-20T19:54:28.987" LastActivityDate="2015-11-20T19:54:28.987" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2663" PostTypeId="2" ParentId="2658" CreationDate="2014-10-26T21:23:11.303" Score="1" Body="&lt;p&gt;Someone else can provide more details, hopefully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short answer, as far as I can see, is that the &lt;code&gt;js2-mode.el&lt;/code&gt; code &lt;em&gt;uses a parser&lt;/em&gt; to add items to the Imenu menu, and this parser does not recognize the function definitions you have that are nested inside &lt;code&gt;function($scope, TestService)&lt;/code&gt; - which is itself inside an array argument passed to &lt;code&gt;app.controller&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imenu typically fills out its menu by regexp matching. But &lt;code&gt;js2-mode.el&lt;/code&gt; uses a parser to do that. You will need to descend into the details of this parsing to see what the problem is in this case. (At least it's not obvious to me, at first view.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-26T21:23:11.303" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2664" PostTypeId="1" AcceptedAnswerId="2665" CreationDate="2014-10-27T00:00:10.710" Score="15" ViewCount="2622" Body="&lt;p&gt;I thought that org-mode highlighted source blocks with the relevant mode. So for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC clojure&#xA;(defn plus [a b]&#xA;  (+ a b))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This would show up with the syntax highlighting one would expect if in a Clojure buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason, my setup is just showing the above example in one monotone of gray.&lt;/p&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="25" LastEditDate="2014-11-09T23:30:00.647" LastActivityDate="2014-11-09T23:30:00.647" Title="syntax highlighting in source blocks" Tags="|org-mode|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2665" PostTypeId="2" ParentId="2664" CreationDate="2014-10-27T00:03:27.007" Score="16" Body="&lt;p&gt;Org-mode fontifies these blocks if you enable the corresponding setting. Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-fontify-natively t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-10-27T00:03:27.007" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2666" PostTypeId="1" AcceptedAnswerId="3515" CreationDate="2014-10-27T00:17:59.537" Score="6" ViewCount="564" Body="&lt;p&gt;Consider the following Org file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+PROPERTY: tangle &quot;init.el&quot;&#xA;#+PROPERTY: noweb yes&#xA;&#xA;* A&#xA;#+begin_src elisp&#xA;; initialization code&#xA;; this *must* come first&#xA;#+end_src&#xA;&#xA;* B&#xA;#+begin_src emacs-lisp&#xA;&amp;lt;&amp;lt;support-functions&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&#xA;** Cool Stuff&#xA;#+begin_src elisp :noweb-ref &quot;support-functions&quot; :tangle no&#xA;(message &quot;willkommen&quot;)&#xA;#+end_src&#xA;&#xA;** Test&#xA;#+begin_src elisp :noweb-ref &quot;support-functions&quot; :tangle no&#xA;(message &quot;hi&quot;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yields&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(message &quot;willkommen&quot;)&#xA;(message &quot;hi&quot;)&#xA;&#xA;; initialization code&#xA;; this *must* come first&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yet removing the &lt;code&gt;:tangle&lt;/code&gt; header argument on one of the blocks in &lt;code&gt;Cool Stuff&lt;/code&gt; fixes the issue, but duplicates code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;; initialization code&#xA;; this *must* come first&#xA;&#xA;(message &quot;hi&quot;)&#xA;&#xA;(message &quot;willkommen&quot;)&#xA;(message &quot;hi&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What must I do to ensure correct behavior?  I know I &lt;em&gt;could&lt;/em&gt; simply turn off tangling for the document and have everything be noweb, but this feels like a workaround rather than a solution.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="10633" LastEditDate="2015-12-31T04:02:58.297" LastActivityDate="2015-12-31T07:38:16.840" Title="Controlling the order of output with Org-Babel" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2667" PostTypeId="2" ParentId="2661" CreationDate="2014-10-27T00:26:21.863" Score="19" Body="&lt;h1&gt;A lazy init is a good init.&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;(IMO)&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;When to use &lt;code&gt;with-eval-after-load&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-eval-after-load&lt;/code&gt; is loaded &lt;em&gt;once&lt;/em&gt; when a certain &lt;em&gt;feature&lt;/em&gt; or &lt;em&gt;file&lt;/em&gt; is &lt;em&gt;first&lt;/em&gt; loaded, so a keymap-change clearly goes inside one of these.  Not the least because the keymap may not be known at init-time [try something like &lt;code&gt;(define-key message-mode-map (kbd &quot;C-c f&quot;) 'Footnote-add-footnote)&lt;/code&gt; in &lt;code&gt;emacs -q&lt;/code&gt;].  A hook is not a &lt;em&gt;nice&lt;/em&gt; solution here since it binds the function to a key &lt;em&gt;every&lt;/em&gt; time the hook is started.  As &lt;a href=&quot;https://emacs.stackexchange.com/users/306/tarsius&quot;&gt;tarsius&lt;/a&gt; notes, you can &lt;a href=&quot;https://emacs.stackexchange.com/questions/990/differences-between-setting-major-mode-keys-with-a-hook-versus-adding-them-to-th/996#996&quot;&gt;read more&lt;/a&gt; about why &lt;em&gt;not&lt;/em&gt; to &lt;code&gt;local-set-key&lt;/code&gt; in hooks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that &lt;code&gt;with-eval-after-load&lt;/code&gt; of GNU Emacs 24.4 is a 2 line wrapper around &lt;code&gt;eval-after-load&lt;/code&gt; where &lt;code&gt;body&lt;/code&gt; need not be quoted.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;When to use hooks&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Hooks are list of functions loaded every time a criterion is met, e.g. a certain mode is started.  A common use of hooks is to load minor-modes, such as &lt;code&gt;flyspell-mode&lt;/code&gt; or &lt;code&gt;hl-line-mode&lt;/code&gt;.  E.g. &lt;code&gt;(add-hook 'org-agenda-mode-hook 'hl-line-mode)&lt;/code&gt;.  As &lt;a href=&quot;https://emacs.stackexchange.com/users/2237/r%c3%a9mi&quot;&gt;Rémi&lt;/a&gt; points out, &lt;code&gt;add-hooks&lt;/code&gt; is smart and will do the right thing even if the hook-variable has yet to been loaded.  Nonetheless, I have many clauses like the following, which may be negligible for speed-gains, but does gives a sense of organization and dependency-structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org-agenda&#xA;  (add-hook 'org-agenda-mode-hook 'hl-line-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why add to hook after &lt;code&gt;org-agenda&lt;/code&gt;?  As always, &lt;code&gt;C-h v org-agenda-mode-hook C-j&lt;/code&gt; delivers.  The hook is defined in &lt;code&gt;org-agenda.el&lt;/code&gt; as shown in &lt;code&gt;*help*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Loading extra features &lt;code&gt;with-eval-after-load&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-eval-after-load&lt;/code&gt; is also important for loading extra features.  You'd probably want something like &lt;code&gt;(with-eval-after-load 'org  (require 'org-inlinetask))&lt;/code&gt; to load org inlinetasks.  To see why &lt;code&gt;(find-library &quot;org-inlinetask&quot;)&lt;/code&gt;.  Since &lt;code&gt;org-inlinetasks.el&lt;/code&gt; directly &lt;code&gt;(require 'org)&lt;/code&gt;, all of the nice &lt;code&gt;autoload&lt;/code&gt; that your friendly Emacs maintainers took great care to provide will be &quot;ignored&quot; and all of &lt;code&gt;org.el(c)&lt;/code&gt; will be loaded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if your (personal) &lt;code&gt;defun&lt;/code&gt; is required several places?  If you are really picky, you could put the &lt;code&gt;defun&lt;/code&gt;s in another file in your &lt;code&gt;load-path&lt;/code&gt; and add &lt;code&gt;autoload&lt;/code&gt; cookies, or you can tell Emacs where to find the function with the &lt;code&gt;autoload&lt;/code&gt; function.  Then something like this would work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'org-cdlatex-mode &quot;org&quot; &quot;cdlatex mode from org.&quot;)&#xA;(with-eval-after-load &quot;latex&quot;&#xA;  (add-hook 'TeX-mode-hook 'org-cdlatex-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you could just &lt;code&gt;require&lt;/code&gt; &lt;code&gt;org&lt;/code&gt; as it in turn would pull &lt;code&gt;cdlatex&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, honestly, personal defun ain't gonna matter much for init time most of the time.  The 1150 lines of personal defuns (84 defuns) in my &lt;code&gt;init.el&lt;/code&gt; adds 0.02s over vanilla Emacs.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Measuring initialization time&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;An easy way to approximate intitialization time is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;time emacs --eval &quot;(kill-emacs)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(benchmark against &lt;code&gt;emacs -q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to get a more detailed approximation of where the initialization bottlenecks are check out Joe Schafer's &lt;a href=&quot;https://github.com/jschaf/esup/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;esup&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, loading time does not disappear magically.  You are only pushing it forward (to the extend that you use all features in each session).&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-10-28T00:18:24.090" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2668" PostTypeId="1" AcceptedAnswerId="2680" CreationDate="2014-10-27T00:46:04.957" Score="2" ViewCount="680" Body="&lt;p&gt;I know that I can setup custom agenda commands with sorting specified using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-sorting-strategy '(priority-down todo-state-up))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to set the global agenda sorting somehow?&lt;/p&gt;&#xA;" OwnerUserId="2244" LastActivityDate="2014-10-27T01:38:12.220" Title="Is there a way to set the global agenda sorting?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2669" PostTypeId="2" ParentId="2650" CreationDate="2014-10-27T00:52:46.713" Score="15" Body="&lt;p&gt;Also, it is good to know that the dollar syntax &lt;code&gt;$...$&lt;/code&gt; is not always recommended in LaTeX (and the double dollar syntax, &lt;code&gt;$$...$$&lt;/code&gt;, for displayed equations, in strongly discouraged).  For further info see &lt;a href=&quot;https://tex.stackexchange.com/questions/503&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://tex.stackexchange.com/questions/510&quot;&gt;this question on TeX.SE&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Needless to say, Org-mode supports both &lt;code&gt;\(...\)&lt;/code&gt; and &lt;code&gt;\[...\]&lt;/code&gt;.  Try exporting this to LaTeX:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Dollars&#xA;hello $E=mc^2$&#xA;* Parens&#xA;hello \(E=mc^2\)&#xA;* Double dollars&#xA;hello $$E=mc^2$$&#xA;* Brackets&#xA;hello \[E=mc^2\]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2014-10-27T00:52:46.713" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2670" PostTypeId="2" ParentId="2606" CreationDate="2014-10-27T00:56:00.027" Score="2" Body="&lt;p&gt;A poor man's unfill can also be done by first setting the &lt;code&gt;fill-column&lt;/code&gt; to some ridiculously high value (I use 9999) and then filling.  For instance, &lt;code&gt;C-u 9999 C-x f M-q C-u 70 C-x f&lt;/code&gt;.  (Also, you might prefer &lt;code&gt;C-9 C-9 C-9 C-9&lt;/code&gt; to &lt;code&gt;C-u 9999&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="642" LastActivityDate="2014-10-27T00:56:00.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2671" PostTypeId="1" AcceptedAnswerId="2679" CreationDate="2014-10-27T01:00:21.063" Score="28" ViewCount="8425" Body="&lt;p&gt;When using ReSharper in Visual Studio symbols can be auto-completed using fuzzy matching instead of prefix matching. For example if I'm looking for a function named &lt;code&gt;DoSomethingAmazing&lt;/code&gt; I could write &lt;code&gt;DoSoAm&lt;/code&gt; and it would try to expand my query to match all symbols containing &lt;code&gt;Do&lt;/code&gt;, &lt;code&gt;So&lt;/code&gt; and &lt;code&gt;Am&lt;/code&gt; somewhere in their name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example can be found in the below gif. You can see several expansions where non-prefix strings are expanded to the correct symbol. (Ignore the snippet expansion as in this question I'm only concerned with fuzzy matching). &lt;img src=&quot;https://i.stack.imgur.com/AggWN.gif&quot; alt=&quot;A gif showing several examples of fuzzy matching in action&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example can be seen in the YouCompleteMe plugin for Vim: &lt;img src=&quot;https://i.stack.imgur.com/Tmx3y.gif&quot; alt=&quot;A gif showing more examples of fuzzy matching in action in vim&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cx4a.org/software/auto-complete/&quot;&gt;Autocomplete&lt;/a&gt; and &lt;a href=&quot;http://company-mode.github.io/&quot;&gt;Company Mode&lt;/a&gt; both seem to have prefix matching but I can't find a way to enable fuzzy matching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally the solution would be language agnostic and apply to whatever symbol completion package I'm using but I'm also interested in language-specific solutions. I've looked at &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;Helm&lt;/a&gt; but haven't found a way to apply it to code completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have considered alternatives such as having a keybinding to activate symbol completion using a &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;Helm&lt;/a&gt; buffer but I'm hoping there's a way to do this using popup-style completion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also open to doing manual configuration on a per-language basis since some languages separate symbols with dashes while others use underscores or dashes which I assume would affect how the matching would be done.&lt;/p&gt;&#xA;" OwnerUserId="2279" LastActivityDate="2020-04-05T04:18:28.733" Title="How can I get fuzzy code completion" Tags="|helm|completion|company-mode|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2672" PostTypeId="5" CreationDate="2014-10-27T01:18:29.627" Score="0" Body="&lt;p&gt;You can download it &lt;a href=&quot;http://code.google.com/p/js2-mode/downloads/list&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Features:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Variable (adjustable) indentation&lt;/li&gt;&#xA;&lt;li&gt;Accurate syntax highlighting&lt;/li&gt;&#xA;&lt;li&gt;Highlighting of syntactic errors and many semantic errors&lt;/li&gt;&#xA;&lt;li&gt;Strict-mode warning reporting (such as duplicate var declaration)&lt;/li&gt;&#xA;&lt;li&gt;Smart line-wrapping in comments and strings&lt;/li&gt;&#xA;&lt;li&gt;Typing helpers (e.g. matching quotes/brackets)&lt;/li&gt;&#xA;&lt;li&gt;Code-folding (collapse element as {...})&lt;/li&gt;&#xA;&lt;li&gt;Supports JavaScript 1.5, 1.6 (including E4X), 1.7 and 1.8&lt;/li&gt;&#xA;&lt;li&gt;Customizable colors, or use font-lock defaults&lt;/li&gt;&#xA;&lt;li&gt;Many customization options &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; - this mode is for GNU Emacs, version 22 and higher. It does not support XEmacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;js2-mode&lt;/code&gt; was written by Steve Yegge. You can find more information on &lt;code&gt;js2-mode&lt;/code&gt; at the official website: &lt;a href=&quot;http://code.google.com/p/js2-mode/&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/js2-mode/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T12:04:16.280" LastActivityDate="2014-10-27T12:04:16.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2673" PostTypeId="4" CreationDate="2014-10-27T01:18:29.627" Score="0" Body="An improved JavaScript mode for GNU Emacs that emulates many desirable features of IDEs." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T12:04:52.973" LastActivityDate="2014-10-27T12:04:52.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2674" PostTypeId="5" CreationDate="2014-10-27T01:20:01.487" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-27T01:20:01.487" LastActivityDate="2014-10-27T01:20:01.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2675" PostTypeId="4" CreationDate="2014-10-27T01:20:01.487" Score="0" Body="Autocomplete is a UI feature provided by Emacs, where it predicts a word or phrase that the user wants to type without the user actually typing it completely." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T12:04:06.483" LastActivityDate="2014-10-27T12:04:06.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2676" PostTypeId="2" ParentId="2671" CreationDate="2014-10-27T01:20:13.450" Score="2" Body="&lt;p&gt;There are several packages that offer fuzzy completion of one kind or another. I imagine that Helm does, for example (since you mention it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can choose (on the fly) among &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion&quot; rel=&quot;nofollow noreferrer&quot;&gt;several fuzzy-completion methods&lt;/a&gt; - more choice than I've seen offered elsewhere. (I am not particularly a fan of fuzzy completion, myself, but I offer it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Icicles&lt;/strong&gt; completion (hence fuzzy completion, if you choose that) applies pretty much everywhere, but there are not a whole lot of &lt;strong&gt;Icicles&lt;/strong&gt;-specific &lt;em&gt;code&lt;/em&gt;-completion features. &lt;a href=&quot;https://www.emacswiki.org/Icicles_-_Completion_in_Other_Buffers&quot; rel=&quot;nofollow noreferrer&quot;&gt;This&lt;/a&gt; page of the &lt;strong&gt;Icicles&lt;/strong&gt; doc speaks about such buffer-text completion.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;With&lt;/em&gt; &lt;strong&gt;Icicles&lt;/strong&gt;, &lt;em&gt;using Stefan's example of completing &lt;strong&gt;&lt;code&gt;(wi-sy&lt;/code&gt;&lt;/strong&gt; in Emacs Lisp mode:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;strong&gt;Icicles&lt;/strong&gt; &lt;em&gt;&lt;code&gt;vanilla&lt;/code&gt; completion&lt;/em&gt; (what Emacs provides, respecting &lt;code&gt;completion-styles&lt;/code&gt;), you get the same symbols that Stefan mentions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;strong&gt;Icicles&lt;/strong&gt; &lt;em&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion#SwankCompletion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Swank fuzzy symbol completion&lt;/a&gt;&lt;/em&gt; (from library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/el-swank-fuzzy.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;el-swank-fuzzy.el&lt;/code&gt;&lt;/a&gt;) as the current TAB-completion method, you get these completion candidates:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre&gt;&#xA;    window-system                &#xA;    with-syntax-table&#xA;    window-system-for-display&#xA;    widget-coding-system-action&#xA;    widget-symbol-prompt-internal&#xA;    widget-coding-system-prompt-value&#xA;    with-swfy-struct&#xA;    widget-specify-doc&#xA;    with-swfy-timedout&#xA;    widget-specify-field&#xA;    widget-specify-active&#xA;    widget-specify-button&#xA;    widget-specify-insert&#xA;    widget-specify-sample&#xA;    widget-specify-secret&#xA;    widget-specify-inactive&#xA;    window-safely-shrinkable-p&#xA;    widget-types-copy&#xA;    window-resize-apply&#xA;    window--resize-root-window-vertically&#xA;    window-display-table&#xA;    window--display-buffer&#xA;    window--resize-apply-p&#xA;    window-resize-apply-total&#xA;    widgetp-display-Completions&#xA;    window-redisplay-end-trigger&#xA;    with-displayed-buffer-window&#xA;    widget-visibility-value-create&#xA;    widget-emacs-library-link-action&#xA;    widget-editable-list-entry-create&#xA;    widget-emacs-commentary-link-action&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first 3 candidates are, again, those that Stefan mentions.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;With plain &lt;em&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion#FuzzyMatchCompletion&quot; rel=&quot;nofollow noreferrer&quot;&gt;fuzzy-match completion&lt;/a&gt;&lt;/em&gt; (library &lt;a href=&quot;https://www.emacswiki.org/emacs-en/download/fuzzy-match.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;fuzzy-match.el&lt;/code&gt;&lt;/a&gt;), the only candidate is &lt;code&gt;with-syntax-table&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;strong&gt;Icicles&lt;/strong&gt; &lt;em&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion#ScatterMatchCompletion&quot; rel=&quot;nofollow noreferrer&quot;&gt;scatter fuzzy completion&lt;/a&gt;&lt;/em&gt;, you get all of the candidates that Swank fuzzy completion offers, plus the following:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre&gt;&#xA;    ange-ftp-wait-not-busy&#xA;    dired-into-dir-with-symlinks&#xA;    ediff-choose-window-setup-function-automatically&#xA;    ediff-make-wide-display&#xA;    ediff-toggle-wide-display&#xA;    ediff-window-display-p&#xA;    ediff-window-ok-for-display&#xA;    ediff-with-syntax-table&#xA;    find-new-buffer-file-coding-system&#xA;    gnus-frame-or-window-display-name&#xA;    help-window-display-message&#xA;    icicle-choose-window-for-buffer-display&#xA;    revert-buffer-with-coding-system&#xA;    set-w32-system-coding-system&#xA;    set-window-display-table&#xA;    set-window-redisplay-end-trigger&#xA;    shell-write-history-on-exit&#xA;    split-window-sensibly&#xA;    tree-widget--locate-sub-directory&#xA;    w32-find-file-not-found-set-buffer-file-coding-system&#xA;    w32-initialize-window-system&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;With &lt;strong&gt;Icicles&lt;/strong&gt; &lt;em&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion#LevenshteinMatchCompletion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Levenshtein (1) fuzzy substring completion&lt;/a&gt;&lt;/em&gt; (Levenshtein distance of 1), you get only these completions:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre&gt;&#xA;    help-follow-symbol&#xA;    message-check-news-syntax&#xA;    w32-initialize-window-system window-system&#xA;    window-system-for-display&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;6&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;With a Levenshtein distance of 2 instead of 1, there are &lt;em&gt;more than 300&lt;/em&gt; completion candidates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;em&gt;strict Levenshtein&lt;/em&gt; (1 or 2) completion there are &lt;strong&gt;no&lt;/strong&gt; candidates. Likewise, for &lt;strong&gt;Icicles&lt;/strong&gt; &lt;em&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion#JaroWinklerMatchCompletion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jaro-Winkler fuzzy completion&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2020-04-05T04:18:28.733" LastActivityDate="2020-04-05T04:18:28.733" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2677" PostTypeId="5" CreationDate="2014-10-27T01:22:48.843" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-27T01:22:48.843" LastActivityDate="2014-10-27T01:22:48.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2678" PostTypeId="4" CreationDate="2014-10-27T01:22:48.843" Score="0" Body="Configuration is the process of specifying the settings used for Emacs." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T12:04:56.423" LastActivityDate="2014-10-27T12:04:56.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2679" PostTypeId="2" ParentId="2671" CreationDate="2014-10-27T01:31:41.613" Score="19" Body="&lt;p&gt;Emacs's builtin completion functionality offers similar fuzzy matching (tho by default it's used for &quot;do-so-am&quot; rather than for &quot;DoSoAm&quot;) and IIUC recent versions of company-mode do use this at least in some cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if you open an Elisp buffer using Emacs-24.4 and the latest company-mode, if you type &lt;code&gt;(wi-sy&lt;/code&gt; company will pop up a completion menu showing &lt;code&gt;window-system&lt;/code&gt;, &lt;code&gt;window-system-for-display&lt;/code&gt; and &lt;code&gt;with-syntax-table&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-27T01:31:41.613" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2680" PostTypeId="2" ParentId="2668" CreationDate="2014-10-27T01:38:12.220" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;org-agenda-sorting-strategy&lt;/code&gt; works for built-in agenda&#xA;commands. Its default value is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((agenda habit-down time-up priority-down category-keep)&#xA; (todo priority-down category-keep)&#xA; (tags priority-down category-keep)&#xA; (search category-keep))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, for the agenda, you should tweak the first line. For example, this&#xA;would sort alphabetically by the category name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-sorting-strategy&#xA;      '((agenda category-up)&#xA;        (todo priority-down category-up)&#xA;        (tags priority-down category-keep)&#xA;        (search category-keep)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-10-27T01:38:12.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2681" PostTypeId="5" CreationDate="2014-10-27T01:46:18.837" Score="0" Body="&lt;p&gt;Character encoding is the act or result of representing characters (human readable text) as a series of bytes (computer readable zeroes and ones). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A useful reference is &lt;a href=&quot;http://www.joelonsoftware.com/articles/Unicode.html&quot; rel=&quot;nofollow&quot;&gt;The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;See also&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/ascii&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ascii&amp;#39;&quot; rel=&quot;tag&quot;&gt;ascii&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/codepages&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;codepages&amp;#39;&quot; rel=&quot;tag&quot;&gt;codepages&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/encoding&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;encoding&amp;#39;&quot; rel=&quot;tag&quot;&gt;encoding&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/extended-ascii&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;extended-ascii&amp;#39;&quot; rel=&quot;tag&quot;&gt;extended-ascii&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/latin1&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;latin1&amp;#39;&quot; rel=&quot;tag&quot;&gt;latin1&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/unicode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;unicode&amp;#39;&quot; rel=&quot;tag&quot;&gt;unicode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/utf-8&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;utf-8&amp;#39;&quot; rel=&quot;tag&quot;&gt;utf-8&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/utf-16&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;utf-16&amp;#39;&quot; rel=&quot;tag&quot;&gt;utf-16&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T12:05:02.530" LastActivityDate="2014-10-27T12:05:02.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2682" PostTypeId="4" CreationDate="2014-10-27T01:46:18.837" Score="0" Body="Character encoding refers to the way characters are represented as a series of bytes" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T12:03:57.553" LastActivityDate="2014-10-27T12:03:57.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2683" PostTypeId="5" CreationDate="2014-10-27T02:13:14.957" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Common_Lisp&quot; rel=&quot;nofollow&quot;&gt;Common Lisp&lt;/a&gt; is a dialect of Lisp that was standardized by ANSI. Note that Emacs's extension language, Emacs Lisp, is not a dialect of Common Lisp; &lt;strong&gt;for questions about the Emacs Lisp dialect, use the tag &lt;a href=&quot;/questions/tagged/elisp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;elisp&amp;#39;&quot; rel=&quot;tag&quot;&gt;elisp&lt;/a&gt;&lt;/strong&gt;. Emacs has limited support for some Common Lisp features in the &lt;code&gt;cl-lib&lt;/code&gt; library &lt;a href=&quot;/questions/tagged/cl-lib&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;cl-lib&amp;#39;&quot; rel=&quot;tag&quot;&gt;cl-lib&lt;/a&gt; since Emacs 24.3, and in the &lt;code&gt;cl&lt;/code&gt; library &lt;a href=&quot;/questions/tagged/cl&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;cl&amp;#39;&quot; rel=&quot;tag&quot;&gt;cl&lt;/a&gt; in earlier versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ANSI Common Lisp, the programmable programming language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have a &lt;a href=&quot;http://en.wikipedia.org/wiki/Common_Lisp&quot; rel=&quot;nofollow&quot;&gt;Wikipedia page&lt;/a&gt; on Common Lisp, an online version of the &lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Front/&quot; rel=&quot;nofollow&quot;&gt;ANSI Common Lisp standard&lt;/a&gt; and a list of recommended &lt;a href=&quot;http://common-lisp.net/~dlw/LispSurvey.html&quot; rel=&quot;nofollow&quot;&gt;Common Lisp implementations&lt;/a&gt;. Many Lisp specific mailing lists are archived at &lt;a href=&quot;http://dir.gmane.org/index.php?prefix=gmane.lisp&quot; rel=&quot;nofollow&quot;&gt;Gmane&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Popular Common Lisp implementations&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sbcl.org/&quot; rel=&quot;nofollow&quot;&gt;Steel Bank Common Lisp (SBCL)&lt;/a&gt;, a high performance Common Lisp compiler&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.clisp.org/&quot; rel=&quot;nofollow&quot;&gt;CLISP&lt;/a&gt;, a portable implementation that compiles to bytecode&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://common-lisp.net/project/armedbear/&quot; rel=&quot;nofollow&quot;&gt;Armed Bear Common Lisp&lt;/a&gt;, an implementation on top of JVM&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ccl.clozure.com/&quot; rel=&quot;nofollow&quot;&gt;Clozure CL&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;See also&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.lispworks.com/documentation/common-lisp.html&quot; rel=&quot;nofollow&quot;&gt;Common Lisp HyperSpec&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/tags/lisp/info&quot;&gt;Lisp&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2015-09-21T18:18:15.303" LastActivityDate="2015-09-21T18:18:15.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2684" PostTypeId="4" CreationDate="2014-10-27T02:13:14.957" Score="0" Body="Editing Common Lisp code and working with inferior Common Lisp read-eval-print loops. Note that Emacs's Lisp dialect is not Common Lisp; for Emacs Lisp, use the tag [elisp]." OwnerUserId="45" LastEditorUserId="25" LastEditDate="2015-09-21T18:18:15.303" LastActivityDate="2015-09-21T18:18:15.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2685" PostTypeId="5" CreationDate="2014-10-27T02:14:01.953" Score="0" Body="&lt;p&gt;A minor mode for interacting with a Common Lisp process which provides compilation, documentation lookup, and REPL services in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T03:08:28.193" LastActivityDate="2014-10-27T03:08:28.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2686" PostTypeId="4" CreationDate="2014-10-27T02:14:01.953" Score="0" Body="The Superior Lisp Interaction Mode for Emacs. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T03:09:45.397" LastActivityDate="2014-10-27T03:09:45.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2687" PostTypeId="5" CreationDate="2014-10-27T02:16:27.867" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-27T02:16:27.867" LastActivityDate="2014-10-27T02:16:27.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2688" PostTypeId="4" CreationDate="2014-10-27T02:16:27.867" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-27T02:16:27.867" LastActivityDate="2014-10-27T02:16:27.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2689" PostTypeId="5" CreationDate="2014-10-27T02:22:14.700" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-27T02:22:14.700" LastActivityDate="2014-10-27T02:22:14.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2690" PostTypeId="4" CreationDate="2014-10-27T02:22:14.700" Score="0" Body="Code folding is a feature of Emacs that allows one to ‘fold’ (collapse/hide) and ‘unfold’ (expand/reveal) large blocks of code." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-27T03:09:36.630" LastActivityDate="2014-10-27T03:09:36.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2691" PostTypeId="1" AcceptedAnswerId="2696" CreationDate="2014-10-27T02:42:19.757" Score="2" ViewCount="270" Body="&lt;p&gt;I'm using Emacs to write LaTeX. For example, in the following code, I have write to the &lt;code&gt;level 3&lt;/code&gt;. When I press &lt;code&gt;C-j&lt;/code&gt;, the cursor will indent to the third level. I what the newline to be indent at &lt;code&gt;level 2&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I be able to do this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\level 1&#xA;\level 1&#xA;  \level 2&#xA;  \level 2&#xA;     \level 3&#xA;     \level 3&#xA;  \level 2 % &amp;lt;- I want to end up here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Update: Thanks, I'm using &lt;a href=&quot;https://github.com/sdaps/sdaps&quot; rel=&quot;nofollow noreferrer&quot;&gt;sdaps&lt;/a&gt; package to write a survey. Here is a question example. BTW, I don't know list environment yet. Is it related to this?&lt;/p&gt;&#xA;" OwnerDisplayName="user2280" LastEditorDisplayName="user2280" LastEditDate="2018-09-16T19:41:59.770" LastActivityDate="2018-09-16T19:41:59.770" Title="How to indent back one level when writing a newline?" Tags="|latex|indentation|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="2692" PostTypeId="2" ParentId="2644" CreationDate="2014-10-27T02:49:10.477" Score="38" Body="&lt;p&gt;OK, first the alignments and then the explanation of how it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To align the first one, select the lines, do &lt;code&gt;C-u M-x align-regexp&lt;/code&gt; and choose: &lt;code&gt;\(\s-*\):&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, and &lt;code&gt;y&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second, use &lt;code&gt;,\(\)&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, and &lt;code&gt;y&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How it works:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regexp is tried on every line in the region. On each, if the lines are not aligned already, it will match on a different column. More specifically, the group you chose (the second parameter, “parenthesis group to modify”) will end on a different column on each line. The function will add spaces to the end of some of them and delete characters from others until all groups end at the same column, respecting the spacing constraints entered in the third parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, taking some lines from the first case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  t.string( ):enroll_method, :comment =&amp;gt; &quot;入学方式&quot;&#xA;  t.date( ):enrolled_at, :comment =&amp;gt; &quot;入学时间&quot;&#xA;  t.boolean( ):is_active_duty, :default =&amp;gt; false, :comment =&amp;gt; &quot;是否现役军人&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The parenthesis &lt;code&gt;( )&lt;/code&gt; represent the first group of the matching regexp. As you can see, on each line it ends on a different column. To align, the function will add one space to the one in the first line, three spaces to the one in the second line, and none in the third.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How many spaces it will add (or delete) is set by the third parameter, “amount of spacing”. This parameter really means, what the “natural” length of the parenthesis group should be. In the lines that don't need alignment, it will be exactly this length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, on the second case, if you choose to align by regexp &lt;code&gt;\(,\)&lt;/code&gt;, spacing &lt;code&gt;1&lt;/code&gt;, you'll see that on the second and third lines no space is added, because the comma already provides a “spacing” of 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to recap:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;regexp:&lt;/strong&gt; match the place you are interested in aligning; to do it, one of its parenthesis groups will be extended with spaces, or shortened by deleting characters&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;parenthesis group:&lt;/strong&gt; choose which one&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;spacing:&lt;/strong&gt; if the group is shorter than this, spaces will be added to it; if it's longer, characters will be deleted from it, starting at the end (unless it's longer for the purposes of alignment, of course)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;repeat:&lt;/strong&gt; well, this is obvious, I think&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The parameter variants (prepend minus sign):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;justify:&lt;/strong&gt; non-blank characters inside the group won't be deleted, and necessary spaces will be added/deleted from the left. On your second case, try: regexp &lt;code&gt;\([0-9]+\)&lt;/code&gt;, group &lt;code&gt;-1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;column (instead of spacing):&lt;/strong&gt; align to that fixed column (of course, it doesn't work well with “repeat”).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="807" LastEditorUserId="807" LastEditDate="2014-10-27T02:58:15.113" LastActivityDate="2014-10-27T02:58:15.113" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2693" PostTypeId="2" ParentId="2671" CreationDate="2014-10-27T02:57:37.660" Score="10" Body="&lt;p&gt;With &lt;code&gt;company-mode&lt;/code&gt;, you can use &lt;code&gt;C-s&lt;/code&gt; to search from available candidates that it display. The search query is displayed in the modeline (not really easy to spot, I know. I filed &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/144&quot;&gt;an issue here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use Helm for completion, consider using &lt;a href=&quot;https://github.com/yasuyk/helm-company&quot;&gt;helm-company&lt;/a&gt; or &lt;a href=&quot;https://github.com/yasuyk/ac-helm&quot;&gt;ac-helm&lt;/a&gt;. Haven't tried with &lt;code&gt;ac-helm&lt;/code&gt;, but with &lt;code&gt;helm-company&lt;/code&gt;, you can directly bind it to a key to replace the standard interface of &lt;code&gt;company-complete&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-27T02:57:37.660" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2694" PostTypeId="2" ParentId="18" CreationDate="2014-10-27T03:11:45.487" Score="4" Body="&lt;p&gt;Another possibility: I really like to use multiple cursors for tasks like this.  Available in &lt;code&gt;package.el&lt;/code&gt; via MELPA, it's become an indispensable part of my emacs.  I would simply select &lt;code&gt;I said&lt;/code&gt; (and possibly include the line break before it), use &lt;code&gt;M-x mc/mark-all-like-this&lt;/code&gt;, and be on my way.  If you want more fine-grained control, you can use &lt;code&gt;mc/mark-next-like-this&lt;/code&gt; or &lt;code&gt;mc/mark-next-lines&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My keybindings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package multiple-cursors&#xA;  :bind ((&quot;C-&amp;gt;&quot;   . mc/mark-next-like-this)&#xA;         (&quot;C-M-&amp;gt;&quot; . mc/mark-all-like-this-dwim)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The obligatory Emacs Rocks! episode: &lt;a href=&quot;http://emacsrocks.com/e13.html&quot; rel=&quot;nofollow&quot;&gt;http://emacsrocks.com/e13.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-10-27T03:11:45.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2695" PostTypeId="1" AcceptedAnswerId="2698" CreationDate="2014-10-27T04:04:08.220" Score="1" ViewCount="185" Body="&lt;p&gt;Is there a way to do this for both non-Elisp and Elisp? For Elisp, the only thing I can think of is to create a new Dired buffer from a new list of files, but is there a better way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I want to do this without external dependency.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-10-27T04:48:34.293" LastActivityDate="2014-10-27T09:02:31.820" Title="Remove entries in Dired buffer without deleting actual underlying objects" Tags="|elisp|dired|files|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2696" PostTypeId="2" ParentId="2691" CreationDate="2014-10-27T04:12:05.713" Score="2" Body="&lt;p&gt;I think I understand now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are at least two ways you can get at the behavior you need, assuming you are using AUCTeX (which you &lt;em&gt;should&lt;/em&gt; be if you are writing LaTeX):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c ] runs the command LaTeX-close-environment, which is an&#xA;interactive compiled Lisp function in `latex.el'.&#xA;&#xA;It is bound to C-c ], &amp;lt;menu-bar&amp;gt; &amp;lt;LaTeX&amp;gt; &amp;lt;Close Environment&amp;gt;.&#xA;&#xA;(LaTeX-close-environment &amp;amp;optional REOPEN)&#xA;&#xA;Create an \end{...} to match the current environment.&#xA;With prefix-argument, reopen environment afterwards.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will close the environment on a new line and advance point to the next line after that, or the even &lt;em&gt;more&lt;/em&gt; convenient&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-e runs the command LaTeX-environment, which is an interactive&#xA;compiled Lisp function in `latex.el'.&#xA;&#xA;It is bound to C-c C-e.&#xA;&#xA;(LaTeX-environment ARG)&#xA;&#xA;Make LaTeX environment (\begin{...}-\end{...} pair).&#xA;With optional ARG, modify current environment.&#xA;&#xA;It may be customized with the following variables:&#xA;&#xA;`LaTeX-default-environment'       Your favorite environment.&#xA;`LaTeX-default-style'             Your favorite document class.&#xA;`LaTeX-default-options'           Your favorite document class options.&#xA;`LaTeX-float'                     Where you want figures and tables to float.&#xA;`LaTeX-table-label'               Your prefix to labels in tables.&#xA;`LaTeX-figure-label'              Your prefix to labels in figures.&#xA;`LaTeX-default-format'            Format for array and tabular.&#xA;`LaTeX-default-width'             Width for minipage and tabular*.&#xA;`LaTeX-default-position'          Position for array and tabular.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both of these ease the insertion of LaTeX environments and take care of the indentation.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-10-27T04:12:05.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2697" PostTypeId="2" ParentId="2695" CreationDate="2014-10-27T04:47:22.397" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/dired-hacks/blob/master/dired-narrow.el&quot; rel=&quot;nofollow&quot;&gt;dired-narrow&lt;/a&gt;&#xA;may be a good place to look, both for a way to filter dired content&#xA;interactively and for exploring a method for implementing this in elisp.&#xA;To do this, it seems that dired-narrow adds the invisible property to&#xA;lines for files that don't match the search criteria and then&#xA;&lt;a href=&quot;https://github.com/Fuco1/dired-hacks/blob/cdb22f2f082a6084dcbe979a56e40c86624f3d09/dired-narrow.el#L65-75&quot; rel=&quot;nofollow&quot;&gt;deletes these lines&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-10-27T04:47:22.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2698" PostTypeId="2" ParentId="2695" CreationDate="2014-10-27T05:07:00.297" Score="5" Body="&lt;p&gt;Mark files (e.g. with &lt;kbd&gt;m&lt;/kbd&gt;, but there are lots of marking functions), and then remove them with &lt;kbd&gt;k&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The scenario in question appears to be a virtual dired buffer (or similar) using a custom source of file listings, and the problem is how, after modifications to the initial dired contents, to refresh the dired buffer without also reverting to the original contents (i.e. how to retain the modifications, even after reverting the dired buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dired-revert&lt;/code&gt; (which re-runs the command to generate the original list of files) does remember a bunch of things already, but not killed lines (and one can easily argue that remembering killed lines is a bad idea), but you could provide a custom &lt;code&gt;revert-buffer-function&lt;/code&gt; which did remember which lines had been killed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect if you're creating a dired buffer with custom contents, it's up to you to handle the &lt;code&gt;revert-buffer&lt;/code&gt; case with similar custom logic.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-10-27T09:02:31.820" LastActivityDate="2014-10-27T09:02:31.820" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2699" PostTypeId="1" CreationDate="2014-10-27T05:42:22.157" Score="1" ViewCount="75" Body="&lt;p&gt;When running &lt;code&gt;TeX-doc&lt;/code&gt; on this buffer (with &lt;code&gt;?&lt;/code&gt; indicating point)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{geo?metry}&#xA;\begin{document}&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;not only is &lt;code&gt;geometry&lt;/code&gt; not the default (there is no default provided), but the options for completion are mostly nonsense:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Click on a completion to select it.&#xA;In this buffer, type RET to select the completion near point.&#xA;&#xA;Possible completions are:&#xA;APAamerican                            APAbritish&#xA;APAczech                               APAdutch&#xA;APAenglish                             APAgerman&#xA;APAgreek                               APAngerman&#xA;DDC-01                                 DDC-03&#xA;DDC-07                                 DDC-09&#xA;DDC-19                                 DDC-21&#xA;DDC-22                                 DDC-24&#xA;DDC-25                                 DDC-27&#xA;DDC-28                                 DDC-30&#xA;EuropeFlagBW                           EuropeFlagBlueCMYK&#xA;EuropeFlagCMYK                         EuropeFlagWB&#xA;README-run                             TCSgradlogo&#xA;TCSlogo                                TU_Logo_HKS41&#xA;TU_Logo_SW                             TU_Logo_WS&#xA;USEngLogo                              USEngLogo-BW&#xA;USEngLogo-BW-top                       USEngLogo-top&#xA;USleaf-BW                              USleaf-gold&#xA;USleaf-grey                            USleaf-maroon&#xA;USlogo                                 USlogo-BW&#xA;USlogo-BW-left                         USlogo-BW-stack&#xA;USlogo-BW-top                          USlogo-left&#xA;USlogo-stack                           USlogo-top&#xA;angleHG                                arrow-glow&#xA;atari                                  barre-rico&#xA;beamericonarticle                      beamericonarticle.20&#xA;beamericonbook                         beamericonbook.20&#xA;beamericononline                       beamericononline.20&#xA;bibitem                                blue-inverted-arrow&#xA;budget                                 bullet-glow&#xA;but                                    button&#xA;button1c                               button1e&#xA;buttonec                               buttonee&#xA;buttongc                               buttonge&#xA;cmp-logo                               context-version&#xA;cow                                    dccpaper-by&#xA;dice                                   europasslogo&#xA;example-grid-100x100bp                 example-grid-100x100pt&#xA;example-image                          example-image-10x16&#xA;example-image-16x10                    example-image-16x9&#xA;example-image-1x1                      example-image-4x3&#xA;example-image-9x16                     example-image-a&#xA;example-image-a3                       example-image-a3-landscape&#xA;example-image-a4                       example-image-a4-landscape&#xA;example-image-a5                       example-image-a5-landscape&#xA;example-image-b                        example-image-c&#xA;example-image-golden                   example-image-golden-upright&#xA;example-image-letter                   example-image-letter-landscape&#xA;example_graph_for_ascii_displayer      fancytipmark&#xA;files                                  flower&#xA;ghsystem_acid                          ghsystem_acid-8&#xA;ghsystem_aqpol                         ghsystem_bottle&#xA;ghsystem_bottle-2-black                ghsystem_bottle-2-white&#xA;ghsystem_exclam                        ghsystem_explos&#xA;ghsystem_explos-1                      ghsystem_explos-2&#xA;ghsystem_explos-3                      ghsystem_explos-4&#xA;ghsystem_explos-5                      ghsystem_explos-6&#xA;ghsystem_flame                         ghsystem_flame-2-black&#xA;ghsystem_flame-2-white                 ghsystem_flame-3-black&#xA;ghsystem_flame-3-white                 ghsystem_flame-4-1&#xA;ghsystem_flame-4-2                     ghsystem_flame-4-3-black&#xA;ghsystem_flame-4-3-white               ghsystem_flame-5-2-black&#xA;ghsystem_flame-5-2-white               ghsystem_flame-O&#xA;ghsystem_flame-O-5-1                   ghsystem_health&#xA;ghsystem_skull                         ghsystem_skull-2&#xA;ghsystem_skull-6                       green-bullet-on-blue&#xA;green-bullet-on-blue-wc                green-bullet-on-white&#xA;green-inverted-arrow                   gyom&#xA;hand                                   hyph-af.chr&#xA;hyph-af.hyp                            hyph-af.lic&#xA;hyph-af.pat                            hyph-as.chr&#xA;hyph-as.hyp                            hyph-as.lic&#xA;hyph-as.pat                            hyph-bg.chr&#xA;hyph-bg.hyp                            hyph-bg.lic&#xA;hyph-bg.pat                            hyph-bn.chr&#xA;hyph-bn.hyp                            hyph-bn.lic&#xA;hyph-bn.pat                            hyph-ca.chr&#xA;hyph-ca.hyp                            hyph-ca.lic&#xA;hyph-ca.pat                            hyph-cop.chr&#xA;hyph-cop.hyp                           hyph-cop.lic&#xA;hyph-cop.pat                           hyph-cs.chr&#xA;hyph-cs.hyp                            hyph-cs.lic&#xA;hyph-cs.pat                            hyph-cy.chr&#xA;hyph-cy.hyp                            hyph-cy.lic&#xA;hyph-cy.pat                            hyph-da.chr&#xA;hyph-da.hyp                            hyph-da.lic&#xA;hyph-da.pat                            hyph-de-1901.chr&#xA;hyph-de-1901.hyp                       hyph-de-1901.lic&#xA;hyph-de-1901.pat                       hyph-de-1996.chr&#xA;hyph-de-1996.hyp                       hyph-de-1996.lic&#xA;hyph-de-1996.pat                       hyph-de-ch-1901.chr&#xA;hyph-de-ch-1901.hyp                    hyph-de-ch-1901.lic&#xA;hyph-de-ch-1901.pat                    hyph-el-monoton.chr&#xA;hyph-el-monoton.hyp                    hyph-el-monoton.lic&#xA;hyph-el-monoton.pat                    hyph-el-polyton.chr&#xA;hyph-el-polyton.hyp                    hyph-el-polyton.lic&#xA;hyph-el-polyton.pat                    hyph-en-gb.chr&#xA;hyph-en-gb.hyp                         hyph-en-gb.lic&#xA;hyph-en-gb.pat                         hyph-en-us.chr&#xA;hyph-en-us.hyp                         hyph-en-us.lic&#xA;hyph-en-us.pat                         hyph-eo.chr&#xA;hyph-eo.hyp                            hyph-eo.lic&#xA;hyph-eo.pat                            hyph-es.chr&#xA;hyph-es.hyp                            hyph-es.lic&#xA;hyph-es.pat                            hyph-et.chr&#xA;hyph-et.hyp                            hyph-et.lic&#xA;hyph-et.pat                            hyph-eu.chr&#xA;hyph-eu.hyp                            hyph-eu.lic&#xA;hyph-eu.pat                            hyph-fi.chr&#xA;hyph-fi.hyp                            hyph-fi.lic&#xA;hyph-fi.pat                            hyph-fr.chr&#xA;hyph-fr.hyp                            hyph-fr.lic&#xA;hyph-fr.pat                            hyph-fur.chr&#xA;hyph-fur.hyp                           hyph-fur.lic&#xA;hyph-fur.pat                           hyph-ga.chr&#xA;hyph-ga.hyp                            hyph-ga.lic&#xA;hyph-ga.pat                            hyph-gl.chr&#xA;hyph-gl.hyp                            hyph-gl.lic&#xA;hyph-gl.pat                            hyph-grc.chr&#xA;hyph-grc.hyp                           hyph-grc.lic&#xA;hyph-grc.pat                           hyph-gu.chr&#xA;hyph-gu.hyp                            hyph-gu.lic&#xA;hyph-gu.pat                            hyph-hi.chr&#xA;hyph-hi.hyp                            hyph-hi.lic&#xA;hyph-hi.pat                            hyph-hr.chr&#xA;hyph-hr.hyp                            hyph-hr.lic&#xA;hyph-hr.pat                            hyph-hsb.chr&#xA;hyph-hsb.hyp                           hyph-hsb.lic&#xA;hyph-hsb.pat                           hyph-hu.chr&#xA;hyph-hu.hyp                            hyph-hu.lic&#xA;hyph-hu.pat                            hyph-hy.chr&#xA;hyph-hy.hyp                            hyph-hy.lic&#xA;hyph-hy.pat                            hyph-ia.chr&#xA;hyph-ia.hyp                            hyph-ia.lic&#xA;hyph-ia.pat                            hyph-id.chr&#xA;hyph-id.hyp                            hyph-id.lic&#xA;hyph-id.pat                            hyph-is.chr&#xA;hyph-is.hyp                            hyph-is.lic&#xA;hyph-is.pat                            hyph-it.chr&#xA;hyph-it.hyp                            hyph-it.lic&#xA;hyph-it.pat                            hyph-ka.chr&#xA;hyph-ka.hyp                            hyph-ka.lic&#xA;hyph-ka.pat                            hyph-kmr.chr&#xA;hyph-kmr.hyp                           hyph-kmr.lic&#xA;hyph-kmr.pat                           hyph-kn.chr&#xA;hyph-kn.hyp                            hyph-kn.lic&#xA;hyph-kn.pat                            hyph-la-x-classic.chr&#xA;hyph-la-x-classic.hyp                  hyph-la-x-classic.lic&#xA;hyph-la-x-classic.pat                  hyph-la.chr&#xA;hyph-la.hyp                            hyph-la.lic&#xA;hyph-la.pat                            hyph-lt.chr&#xA;hyph-lt.hyp                            hyph-lt.lic&#xA;hyph-lt.pat                            hyph-lv.chr&#xA;hyph-lv.hyp                            hyph-lv.lic&#xA;hyph-lv.pat                            hyph-ml.chr&#xA;hyph-ml.hyp                            hyph-ml.lic&#xA;hyph-ml.pat                            hyph-mn-cyrl.chr&#xA;hyph-mn-cyrl.hyp                       hyph-mn-cyrl.lic&#xA;hyph-mn-cyrl.pat                       hyph-mr.chr&#xA;hyph-mr.hyp                            hyph-mr.lic&#xA;hyph-mr.pat                            hyph-mul-ethi.chr&#xA;hyph-mul-ethi.hyp                      hyph-mul-ethi.lic&#xA;hyph-mul-ethi.pat                      hyph-nb.chr&#xA;hyph-nb.hyp                            hyph-nb.lic&#xA;hyph-nb.pat                            hyph-nl.chr&#xA;hyph-nl.hyp                            hyph-nl.lic&#xA;hyph-nl.pat                            hyph-nn.chr&#xA;hyph-nn.hyp                            hyph-nn.lic&#xA;hyph-nn.pat                            hyph-or.chr&#xA;hyph-or.hyp                            hyph-or.lic&#xA;hyph-or.pat                            hyph-pa.chr&#xA;hyph-pa.hyp                            hyph-pa.lic&#xA;hyph-pa.pat                            hyph-pl.chr&#xA;hyph-pl.hyp                            hyph-pl.lic&#xA;hyph-pl.pat                            hyph-pms.chr&#xA;hyph-pms.hyp                           hyph-pms.lic&#xA;hyph-pms.pat                           hyph-pt.chr&#xA;hyph-pt.hyp                            hyph-pt.lic&#xA;hyph-pt.pat                            hyph-rm.chr&#xA;hyph-rm.hyp                            hyph-rm.lic&#xA;hyph-rm.pat                            hyph-ro.chr&#xA;hyph-ro.hyp                            hyph-ro.lic&#xA;hyph-ro.pat                            hyph-ru.chr&#xA;hyph-ru.hyp                            hyph-ru.lic&#xA;hyph-ru.pat                            hyph-sa.chr&#xA;hyph-sa.hyp                            hyph-sa.lic&#xA;hyph-sa.pat                            hyph-sh-cyrl.chr&#xA;hyph-sh-cyrl.hyp                       hyph-sh-cyrl.lic&#xA;hyph-sh-cyrl.pat                       hyph-sh-latn.chr&#xA;hyph-sh-latn.hyp                       hyph-sh-latn.lic&#xA;hyph-sh-latn.pat                       hyph-sk.chr&#xA;hyph-sk.hyp                            hyph-sk.lic&#xA;hyph-sk.pat                            hyph-sl.chr&#xA;hyph-sl.hyp                            hyph-sl.lic&#xA;hyph-sl.pat                            hyph-sr-cyrl.chr&#xA;hyph-sr-cyrl.hyp                       hyph-sr-cyrl.lic&#xA;hyph-sr-cyrl.pat                       hyph-sv.chr&#xA;hyph-sv.hyp                            hyph-sv.lic&#xA;hyph-sv.pat                            hyph-ta.chr&#xA;hyph-ta.hyp                            hyph-ta.lic&#xA;hyph-ta.pat                            hyph-te.chr&#xA;hyph-te.hyp                            hyph-te.lic&#xA;hyph-te.pat                            hyph-th.chr&#xA;hyph-th.hyp                            hyph-th.lic&#xA;hyph-th.pat                            hyph-tk.chr&#xA;hyph-tk.hyp                            hyph-tk.lic&#xA;hyph-tk.pat                            hyph-tr.chr&#xA;hyph-tr.hyp                            hyph-tr.lic&#xA;hyph-tr.pat                            hyph-uk.chr&#xA;hyph-uk.hyp                            hyph-uk.lic&#xA;hyph-uk.pat                            hyph-zh-latn-pinyin.chr&#xA;hyph-zh-latn-pinyin.hyp                hyph-zh-latn-pinyin.lic&#xA;hyph-zh-latn-pinyin.pat                ifmlogoc&#xA;ifmlogog                               info&#xA;keystroke_left                         keystroke_middle&#xA;keystroke_right                        left&#xA;lily-crescHairpin                      lily-crotchet&#xA;lily-crotchetDotted                    lily-crotchetDottedDouble&#xA;lily-crotchetDottedDoubleDown          lily-crotchetDottedDown&#xA;lily-crotchetDown                      lily-decrescHairpin&#xA;lily-demisemiquaver                    lily-demisemiquaverDotted&#xA;lily-demisemiquaverDottedDouble        lily-demisemiquaverDottedDoubleDown&#xA;lily-demisemiquaverDottedDown          lily-demisemiquaverDown&#xA;lily-fancyExample                      lily-halfNote&#xA;lily-halfNoteDotted                    lily-halfNoteDottedDouble&#xA;lily-halfNoteDottedDoubleDown          lily-halfNoteDottedDown&#xA;lily-halfNoteDown                      lily-quaver&#xA;lily-quaverDotted                      lily-quaverDottedDouble&#xA;lily-quaverDottedDoubleDdown           lily-quaverDottedDoubleDown&#xA;lily-quaverDottedDown                  lily-quaverDown&#xA;lily-semiquaver                        lily-semiquaverDotted&#xA;lily-semiquaverDottedDouble            lily-semiquaverDottedDoubleDown&#xA;lily-semiquaverDottedDown              lily-semiquaverDown&#xA;lily-threeBeamedQuavers                lily-threeBeamedQuaversI&#xA;lily-threeBeamedQuaversII              lily-threeBeamedQuaversIII&#xA;lily-twoBeamedQuavers                  lines&#xA;metablue                               metagray&#xA;metagreen                              metalgray&#xA;overlay                                overlay0&#xA;overlay1                               overlay10&#xA;overlay2                               overlay3&#xA;overlay4                               overlay5&#xA;overlay6                               overlay7&#xA;overlay8                               overlay9&#xA;pkulogo                                pkuword&#xA;powerdot-default                       red-bullet-on-blue&#xA;red-bullet-on-blue-wc                  red-bullet-on-white&#xA;red-inverted-arrow                     rico&#xA;rico_bullet1                           rico_bullet2&#xA;rico_bullet3                           right&#xA;rotation                               rule-glow&#xA;sample                                 sapienza-MLblack-pos&#xA;sapienza-MLred-pos                     status-files&#xA;status-lua                             t-transliterator&#xA;ua_color                               udesoftec-cover-uba&#xA;udesoftec-cover-ude-de                 udesoftec-cover-ude-en&#xA;ul_p                                   warn&#xA;yellow-bullet-on-blue                  yellow-bullet-on-blue-wc&#xA;yellow-bullet-on-white&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's going wrong here?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-10-27T05:42:22.157" Title="TeX-doc doesn't recognize most symbols and packages" Tags="|auctex|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2700" PostTypeId="1" AcceptedAnswerId="2760" CreationDate="2014-10-27T07:12:03.197" Score="8" ViewCount="1484" Body="&lt;p&gt;I have some item in an org buffer marked as TODO and having a scheduled timestamp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO do something&#xA;  SCHEDULED: &amp;lt;2014-11-02 Sun&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I cause the SCHEDULED timestamp to be removed when I move this item to the 'waiting' state?&lt;/p&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="50" LastEditDate="2014-10-28T16:29:11.400" LastActivityDate="2014-10-28T16:38:15.570" Title="How to remove 'SCHEDULED' timestamp when changing TODO state to WAITING" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2701" PostTypeId="1" AcceptedAnswerId="2705" CreationDate="2014-10-27T09:41:01.700" Score="4" ViewCount="613" Body="&lt;p&gt;I would like to wrap &lt;code&gt;kill-ring-save&lt;/code&gt; in order to only execute &lt;code&gt;kill-ring-save&lt;/code&gt; if text has been highlighted - same as in most text editors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes I accidentally hit copy instead of paste and then my clipboard is over written, but I have not selected any text for copying. Personally it's a complete workflow killer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-kill-ring-save()&#xA;  (interactive)&#xA;  (if (TEXT IS HIGHLIGHTED)&#xA;    (kill-ring-save)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2256" LastEditorUserId="25" LastEditDate="2014-11-09T23:33:46.087" LastActivityDate="2014-11-09T23:33:46.087" Title="Only allow kill-ring-save if there is highlighted text" Tags="|copy-paste|mark|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2702" PostTypeId="2" ParentId="2701" CreationDate="2014-10-27T10:39:10.217" Score="5" Body="&lt;p&gt;Do not worry about the kill ring (&quot;clipboard&quot;) being overwritten: you can recover previous kill ring entries by typing &lt;code&gt;C-y M-y&lt;/code&gt; (repeat &lt;code&gt;M-y&lt;/code&gt; as many times as you need).  See Section 12.2.2 of the Emacs manual for more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to disable &lt;code&gt;M-w&lt;/code&gt; when the region is inactive (&quot;not highlighted&quot;), which I do not recommend, you can probably do something like this (untested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-kill-ring-save (beg end &amp;amp;optional region)&#xA;  (interactive (mark) (point) (prefix-numeric-value current-prefix-arg))&#xA;  (if (region-active-p)&#xA;      (kill-ring-save beg end region)&#xA;      (error &quot;Eek!&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-10-27T10:39:10.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2703" PostTypeId="2" ParentId="2701" CreationDate="2014-10-27T11:17:42.140" Score="3" Body="&lt;p&gt;As a Mac Os X user, the only regret that I have about emacs is its lack of integration with the rest of the so user-friedly Mac desktop. In particular, I have a mental problem when switching apps, to or from emacs, that is, the change of the copy-and-paste key shortcuts. Even Mac OS X’s Terminal.app understands the &lt;code&gt;M-c&lt;/code&gt; and &lt;code&gt;M-v&lt;/code&gt; shortcuts, while in emacs, We’re stuck with those ugly &lt;code&gt;M-w&lt;/code&gt; and &lt;code&gt;C-y&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I don’t needed it (I have the “prior page” and “next page” keys on my keyboard) , I quickly replaced my &lt;code&gt;M-v&lt;/code&gt; shortcut by a yank : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (global-set-key (kbd &quot;M-v&quot;) 'yank)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I still had the &lt;code&gt;M-c&lt;/code&gt; problem: I could not just bind &lt;code&gt;M-c&lt;/code&gt; to kill-ring-save, because I really often use the traditional command bound to &lt;code&gt;M-c&lt;/code&gt;: capitalize-word. So I wrote this little function in my .emacs, and it really made my life easier :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (defun capitalize-word-or-kill-ring-save ()&#xA;      (interactive)&#xA;      (if mark-active&#xA;          (kill-ring-save (region-beginning) (region-end))&#xA;        (capitalize-word 1)&#xA;        )&#xA;    )&#xA;(global-set-key (kbd &quot;M-c&quot;) 'capitalize-word-or-kill-ring-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I posted this a long time ago on the &lt;a href=&quot;http://www.emacswiki.org/emacs-se/CapitalizeWordOrKillRingSave&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki&lt;/a&gt; but an Emacs.SX site is a great home for this trick too !&lt;/p&gt;&#xA;" OwnerUserId="2282" LastActivityDate="2014-10-27T11:17:42.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2704" PostTypeId="2" ParentId="2587" CreationDate="2014-10-27T12:01:01.150" Score="2" Body="&lt;p&gt;@rasmus provided a nice programmatic solution.  Here's another solution that is more interactive - it emulates what you manually do to clear the minibuffer when it's displayed with initial input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'minibuffer-setup-hook&#xA;          (lambda ()&#xA;            (when (equal (minibuffer-prompt) &quot;Replacement for: &quot;)&#xA;              (delete-minibuffer-contents))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="478" LastActivityDate="2014-10-27T12:01:01.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2705" PostTypeId="2" ParentId="2701" CreationDate="2014-10-27T12:51:52.770" Score="2" Body="&lt;p&gt;I think you simply want to &lt;code&gt;(setq mark-even-if-inactive nil)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-27T12:51:52.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2706" PostTypeId="1" AcceptedAnswerId="2716" CreationDate="2014-10-27T13:00:03.767" Score="46" ViewCount="4497" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Why does elisp not have namespaces, and how could we get them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elisp does not have namespaces other than the global one, which has led to the coding convention of prefixing all global functions, variables, and constants with a unique prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from the annoyance factor, it also strikes me as a simmering issue given 1) the ever-expanding number of great libraries and packages, and 2) the continued existence of legacy functions and variables that either don't respect the prefix convention, or are sufficiently idiosyncratic that there isn't really a good prefix option they could use.   It also means that periodic attempts to rationalize older code (as with the transition from &lt;code&gt;cl&lt;/code&gt; to &lt;code&gt;cl-lib&lt;/code&gt;) is a non-trivial amount of work.  (Although I'm glad for the clean-up, I still shed a tear every time I type something like &lt;code&gt;cl-find&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went poking around to see if I could find out why elisp still doesn't have namespaces after a few decades of use, but was a little surprised at the modest harvest.  The &lt;a href=&quot;http://www.emacswiki.org/emacs/Namespaces&quot; rel=&quot;noreferrer&quot;&gt;wiki page on namespaces&lt;/a&gt; is quite short.  &lt;a href=&quot;http://nic.ferrier.me.uk/blog/2013_06/adding-namespaces-to-elisp&quot; rel=&quot;noreferrer&quot;&gt;Nic Ferrier&lt;/a&gt; has a slightly longer treatment of the issue, and there's a fairly recent thread on &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00748.html&quot; rel=&quot;noreferrer&quot;&gt;emacs-devel&lt;/a&gt; on it as well.  There's an &lt;a href=&quot;https://stackoverflow.com/questions/4410620/emacs-namespaces-and-defuns&quot;&gt;old Stack Overflow thread&lt;/a&gt; from 2010 that discusses the possibility of using macros to implement namespaces; another example of the macro approach can be found &lt;a href=&quot;http://draketo.de/licht/freie-software/emacs/namespaces-elisp&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. There are at least a couple of implementations (&lt;a href=&quot;https://github.com/chrisbarrett/elisp-namespaces&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://github.com/skeeto/elisp-fakespace&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, with a description of the latter &lt;a href=&quot;http://nullprogram.com/blog/2011/08/18/&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;) out there, but they haven't seen much activity for a couple of years, and I've not run across any libraries that use them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I presume that, if adding namespaces were easy, it would already be done.  So:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What are the technical barriers to adding namespaces to elisp?  &lt;/li&gt;&#xA;&lt;li&gt;Would adding namespaces break a lot of existing code?  &lt;/li&gt;&#xA;&lt;li&gt;Is this functionality something that needs to be organic to elisp (changes to the interpreter itself), or could it really be built on top via macros?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastEditorUserId="18121" LastEditDate="2019-01-16T06:39:52.313" LastActivityDate="2023-06-19T17:55:14.353" Title="Why does elisp not have namespaces?" Tags="|elisp|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="2707" PostTypeId="2" ParentId="2648" CreationDate="2014-10-27T13:24:48.857" Score="7" Body="&lt;p&gt;Manipulating marks seems unnecessary, and perhaps problematic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously there is functionality within dired to do this sort of thing (albeit not well documented). Here's a simple approach:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Silence compile-time warning:&#xA;(declare-function dired-map-dired-file-lines &quot;dired-aux&quot;)&#xA;&#xA;(defun my-dired-files ()&#xA;  &quot;Return a list of files (only) in the current dired buffer.&quot;&#xA;  (eval-when-compile (require 'cl-lib))&#xA;  (require 'dired-aux)&#xA;  (let (flist)&#xA;    (cl-flet ((fpush (fname) (push fname flist)))&#xA;      (dired-map-dired-file-lines #'fpush))&#xA;    (nreverse flist)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the comments you say you'd like the resulting list to include the directory paths as well as the file paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dired-map-dired-file-lines&lt;/code&gt; explicitly excludes directories, and there's no option to include them; but it's easy to define a function which does, simply by copying the original and omitting the unwanted test:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-dired-map-over-files-and-dirs (fun)&#xA;  &quot;Perform FUN with point at the end of each file or directory line.&#xA;FUN takes one argument, the absolute filename.&quot;&#xA;  (save-excursion&#xA;    (let (file buffer-read-only)&#xA;      (goto-char (point-min))&#xA;      (while (not (eobp))&#xA;        (save-excursion&#xA;          (and (not (eolp))&#xA;               (setq file (dired-get-filename nil t)) ; nil on non-file&#xA;               (progn (end-of-line)&#xA;                      (funcall fun file))))&#xA;        (forward-line 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just use this in place of &lt;code&gt;dired-map-dired-file-lines&lt;/code&gt; in the initial function. You can then also exclude the &lt;code&gt;declare-function&lt;/code&gt; call as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could, of course, further modify this new function to build the desired list directly, instead of calling a function to do that. I feel the more general approach is fine in practice, but you might prefer the idea of wrapping it all into a single function.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-10-29T22:46:54.987" LastActivityDate="2014-10-29T22:46:54.987" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2708" PostTypeId="1" CreationDate="2014-10-27T13:28:38.773" Score="8" ViewCount="2290" Body="&lt;p&gt;I want to be able to link to an .xls file from org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading up online this seems to be the way to get the links to open correctly, however even if I change the link type to `file+sys' the file still gets opened within Emacs, instead of in Excel.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file+sys:./foo/bar.xls]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2244" LastEditDate="2014-10-27T17:39:58.617" LastActivityDate="2014-10-27T20:46:10.960" Title="Relative path link to .xls file from org-mode" Tags="|org-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2709" PostTypeId="2" ParentId="2706" CreationDate="2014-10-27T13:49:31.437" Score="22" Body="&lt;p&gt;Last time this was discussed on emacs-devel, the discussion stopped when people like Lars pointed out that they like to be able to &lt;code&gt;M-x grep&lt;/code&gt; for something. Adding namespaces to Elisp shouldn't be too hard, but getting all the familiar tools to handle them right is another issue.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-27T13:49:31.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2710" PostTypeId="1" AcceptedAnswerId="2714" CreationDate="2014-10-27T14:02:41.193" Score="31" ViewCount="10273" Body="&lt;p&gt;When I configure a custom layout and then just need to temporary look into one file fullscreen and once I want that layout back - I need manually to reflow it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like a plugin/elisp code to save my layouts and to be able to switch between saved layouts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;abo-abo&lt;/strong&gt; suggestion to use winner mode is really nice and I got it working in zero time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;wasamasa&lt;/strong&gt; suggested a bunch of great plugins I have never heared of and provided information how to use registers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Jordon Biondo&lt;/strong&gt; explained me how to use the registers and this stuff is actually what I wanted in the simplest way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all.&lt;/p&gt;&#xA;" OwnerUserId="367" LastEditorUserId="367" LastEditDate="2014-10-27T14:39:37.447" LastActivityDate="2021-04-26T13:15:52.853" Title="Switching between window layouts" Tags="|window|package|frames|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2711" PostTypeId="1" AcceptedAnswerId="2792" CreationDate="2014-10-27T14:09:24.363" Score="4" ViewCount="731" Body="&lt;p&gt;I keep track of my activity in an org-file. The latest status is always under the heading &quot;Current&quot; which I usually just cut and paste into IRC for our weekly meetings. However we are now asked to send the status out ahead of time as an email. I'm trying to work out the best way to create a draft email based on the contents of the an org subtree. Currently I have a babel snippet that will fill the &lt;em&gt;kill-ring&lt;/em&gt; but that seems a little hackish. It would be nice to create a complete draft together with address and subject lines.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-11-17T11:06:23.413" Title="How can I draft an mu4e message using the contents of an org subtree?" Tags="|org-mode|mu4e|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2712" PostTypeId="2" ParentId="2710" CreationDate="2014-10-27T14:11:35.260" Score="24" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.emacswiki.org/emacs/WinnerMode&quot;&gt;&lt;code&gt;winner-mode&lt;/code&gt;&lt;/a&gt;. Here's my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(winner-mode)&#xA;(global-set-key [f7] 'winner-undo)&#xA;(global-set-key [C-f7] 'winner-redo)&#xA;(global-set-key [f9] 'delete-other-windows)&#xA;(global-set-key [C-f9] 'delete-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know if there's a way to bookmark a layout or something, but being able to&#xA;continuously switch back to previous layout is enough for me.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="253" LastEditDate="2014-10-27T14:13:16.440" LastActivityDate="2014-10-27T14:13:16.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2713" PostTypeId="2" ParentId="2710" CreationDate="2014-10-27T14:29:27.933" Score="11" Body="&lt;p&gt;Emacs offers registers to save and apply data such as your current window configuration, this can be done with &lt;code&gt;C-x r w&lt;/code&gt; and &lt;code&gt;C-x r j&lt;/code&gt;. However this approach gets unwieldy since you need to remember the window registers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few packages to improve this. &lt;a href=&quot;https://github.com/atykhonov/iregister.el&quot;&gt;iregister&lt;/a&gt; makes this basic feature more inspectable and interactive. The other ones I'm aware of use it without impacting the registers, such as &lt;a href=&quot;https://github.com/shosti/elscreen&quot;&gt;elscreen&lt;/a&gt; and &lt;a href=&quot;https://github.com/emacsmirror/escreen&quot;&gt;escreen&lt;/a&gt; which use the header bar to display tabs. &lt;a href=&quot;https://github.com/tlh/workgroups.el&quot;&gt;workgroups&lt;/a&gt; and &lt;a href=&quot;https://github.com/pashinin/workgroups2&quot;&gt;workgroups2&lt;/a&gt; are two newer and more extensive approaches to this problem. I personally didn't like either and therefore &lt;a href=&quot;https://github.com/wasamasa/eyebrowse&quot;&gt;wrote my own&lt;/a&gt; that's somewhere in between and has hopefully less bugs and complexity.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-10-27T14:29:27.933" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2714" PostTypeId="2" ParentId="2710" CreationDate="2014-10-27T14:31:50.090" Score="33" Body="&lt;p&gt;The built in way to do this is with registers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance use &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;w&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; to save the current window configuration to register a.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can use the built in binding &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt; to run &lt;code&gt;delete-other-windows&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;after you're done looking at the single file, use &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;j&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; to pop back to the saved window configuration in register a.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;w&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; (save config into register)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt; (delete other windows)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;j&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; (reapply saved window config)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I do find registers to be unwieldy though, I use a custom window config stack to manage my configs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two bindings that push the current config onto the stack, and pop and apply the top config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in your sceneario, I would perform my push binding, then C-x 1, then perform my pop binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar winstack-stack '()&#xA;  &quot;A Stack holding window configurations.&#xA;Use `winstack-push' and&#xA;`winstack-pop' to modify it.&quot;)&#xA;&#xA;(defun winstack-push()&#xA;  &quot;Push the current window configuration onto `winstack-stack'.&quot;&#xA;  (interactive)&#xA;  (if (and (window-configuration-p (first winstack-stack))&#xA;         (compare-window-configurations (first winstack-stack) (current-window-configuration)))&#xA;      (message &quot;Current config already pushed&quot;)&#xA;    (progn (push (current-window-configuration) winstack-stack)&#xA;           (message (concat &quot;pushed &quot; (number-to-string&#xA;                                       (length (window-list (selected-frame)))) &quot; frame config&quot;)))))&#xA;&#xA;(defun winstack-pop()&#xA;  &quot;Pop the last window configuration off `winstack-stack' and apply it.&quot;&#xA;  (interactive)&#xA;  (if (first winstack-stack)&#xA;      (progn (set-window-configuration (pop winstack-stack))&#xA;             (message &quot;popped&quot;))&#xA;    (message &quot;End of window stack&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then bind &lt;code&gt;winstack-push&lt;/code&gt; to something like &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;, and &lt;code&gt;winstack-pop&lt;/code&gt; to  &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-o&lt;/kbd&gt; to easily jump around.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-10-27T14:38:27.433" LastActivityDate="2014-10-27T14:38:27.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2715" PostTypeId="2" ParentId="2710" CreationDate="2014-10-27T14:33:42.600" Score="2" Body="&lt;p&gt;You can save the current window layout to a register and then restore it using &lt;code&gt;jump-to-register&lt;/code&gt;. The command &lt;code&gt;window-configuration-to-register&lt;/code&gt; is bound to &lt;code&gt;C-x r w&lt;/code&gt; by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when you have your windows arranged in a useful way you can save them to registe &lt;code&gt;i&lt;/code&gt; using: &lt;code&gt;C-x r w i&lt;/code&gt; and restore the layout later using &lt;code&gt;C-x r j i&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-27T14:33:42.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2716" PostTypeId="2" ParentId="2706" CreationDate="2014-10-27T15:20:27.390" Score="33" Body="&lt;h2&gt;Why no Namespaces?&lt;/h2&gt;&#xA;&lt;p&gt;Because it's complicated, and no one has considered it urgent enough to take the full plunge yet. This has been discussed in the dev list before (more times than&#xA;one), and there have been promises of fixing this after the move to&#xA;git.&lt;/p&gt;&#xA;&lt;p&gt;In the meantime, I wrote &lt;a href=&quot;https://github.com/Bruce-Connor/names&quot; rel=&quot;nofollow noreferrer&quot;&gt;a solution of my own&lt;/a&gt; (see below for a list of options).&lt;/p&gt;&#xA;&lt;h2&gt;What are the technical barriers?&lt;/h2&gt;&#xA;&lt;p&gt;Just out of the door you have 3 large obstacles, which you need to&#xA;surpass so that namespaces even have a chance of working on a current Emacs:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to change how symbols are interned (this is the easy part).&lt;/li&gt;&#xA;&lt;li&gt;The byte-compiler needs to understand namespaces.&lt;/li&gt;&#xA;&lt;li&gt;The autoload generation used by &lt;code&gt;package.el&lt;/code&gt; needs to understand namespaces.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Patching these 3 things to work with however you come to implement&#xA;namespaces isn't trivial. If you're dedicated only to the most recent&#xA;Emacs version it's certainly doable. If you're looking to write some&#xA;sort of package which also supports previous versions (like the entire&#xA;24 family), it turns into one hell of a challenge.&lt;/p&gt;&#xA;&lt;p&gt;Beyond that, there are tons of other optional obstacles. Elisp is&#xA;great because of all the power in the tools available to you and &lt;em&gt;ALL&lt;/em&gt;&#xA;of these would need to be patched to work with namespaces. Amongst the&#xA;most important are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;edebug&lt;/li&gt;&#xA;&lt;li&gt;eval-defun&lt;/li&gt;&#xA;&lt;li&gt;eval-last-sexp&lt;/li&gt;&#xA;&lt;li&gt;slime&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Would it break a lot of existing code?&lt;/h2&gt;&#xA;&lt;p&gt;Not if you do it right.&lt;/p&gt;&#xA;&lt;h2&gt;Is this something that needs to be organic, or could it really be built on top via macros?&lt;/h2&gt;&#xA;&lt;p&gt;Ideally it would be organic, that's what is usually discussed when it&#xA;comes up in the dev list. But it can be made &lt;em&gt;good enough&lt;/em&gt; while being&#xA;built on top.&lt;br /&gt;&#xA;Here are a few examples of this, taken from &lt;a href=&quot;https://github.com/Bruce-Connor/names/blob/master/Other-Packages.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;this list&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Bruce-Connor/names&quot; rel=&quot;nofollow noreferrer&quot;&gt;Names&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Wilfred/with-namespace.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;with-namespace&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/sigma/codex&quot; rel=&quot;nofollow noreferrer&quot;&gt;Codex&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/skeeto/elisp-fakespace/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fakespace&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/chrisbarrett/elisp-namespaces&quot; rel=&quot;nofollow noreferrer&quot;&gt;elisp-namespaces&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://elpa.gnu.org/packages/nameless.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;nameless&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastEditorUserId="31372" LastEditDate="2022-10-23T15:33:12.090" LastActivityDate="2022-10-23T15:33:12.090" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="2717" PostTypeId="1" CreationDate="2014-10-27T15:36:02.070" Score="8" ViewCount="543" Body="&lt;p&gt;I just upgraded to Emacs 24.4 (from 24.3).  Now, whenever I run &lt;code&gt;vc-next-action&lt;/code&gt; on a modified file, the &lt;code&gt;*vc-log*&lt;/code&gt; buffer that comes up starts with the word &quot;Summary:&quot; in &lt;code&gt;log-edit-header&lt;/code&gt; face, followed by a line of inverse video.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This wasn't happening in 24.3, but I can't find anything about it in NEWS.  What's going on?  I see this in both Git and Subversion working copies.&lt;/p&gt;&#xA;" OwnerUserId="859" LastActivityDate="2014-11-04T10:20:23.690" Title="Why does my *vc-log* buffer start with &quot;Summary:&quot; in Emacs 24.4?" Tags="|version-control|emacs24.4|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2718" PostTypeId="2" ParentId="2268" CreationDate="2014-10-27T16:21:16.003" Score="10" Body="&lt;p&gt;This looks like a bug triggered by &lt;code&gt;org-mode&lt;/code&gt;'s &lt;code&gt;org-activate-bracket-links&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what this function looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-activate-bracket-links (limit)&#xA;  &quot;Run through the buffer and add overlays to bracketed links.&quot;&#xA;  (if (and (re-search-forward org-bracket-link-regexp limit t)&#xA;       (not (org-in-src-block-p)))&#xA;      (let* ((hl (org-match-string-no-properties 1))&#xA;         (help (concat &quot;LINK: &quot; (save-match-data (org-link-unescape hl))))&#xA;         (ip (org-maybe-intangible&#xA;          (list 'invisible 'org-link&#xA;            'keymap org-mouse-map 'mouse-face 'highlight&#xA;            'font-lock-multiline t 'help-echo help&#xA;            'htmlize-link `(:uri ,hl))))&#xA;         (Vp (list 'keymap org-mouse-map 'mouse-face 'highlight&#xA;               'font-lock-multiline t 'help-echo help&#xA;               'htmlize-link `(:uri ,hl))))&#xA;    ;; We need to remove the invisible property here.  Table narrowing&#xA;    ;; may have made some of this invisible.&#xA;    (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))&#xA;    (remove-text-properties (match-beginning 0) (match-end 0)&#xA;                '(invisible nil))&#xA;    (if (match-end 3)&#xA;        (progn&#xA;          (add-text-properties (match-beginning 0) (match-beginning 3) ip)&#xA;          (org-rear-nonsticky-at (match-beginning 3))&#xA;          (add-text-properties (match-beginning 3) (match-end 3) vp)&#xA;          (org-rear-nonsticky-at (match-end 3))&#xA;          (add-text-properties (match-end 3) (match-end 0) ip)&#xA;          (org-rear-nonsticky-at (match-end 0)))&#xA;      (add-text-properties (match-beginning 0) (match-beginning 1) ip)&#xA;      (org-rear-nonsticky-at (match-beginning 1))&#xA;      (add-text-properties (match-beginning 1) (match-end 1) vp)&#xA;      (org-rear-nonsticky-at (match-end 1))&#xA;      (add-text-properties (match-end 1) (match-end 0) ip)&#xA;      (org-rear-nonsticky-at (match-end 0)))&#xA;    t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It searches for a match for a bracketed link (e.g. &lt;code&gt;[[target][label]]&lt;/code&gt;, hides the &lt;code&gt;[[target][&lt;/code&gt; part by adding &lt;code&gt;ip&lt;/code&gt; to the text properties, then linkifies the &lt;code&gt;label&lt;/code&gt; by adding &lt;code&gt;vp&lt;/code&gt; to the text properties, and finally removes the trailing &lt;code&gt;]]&lt;/code&gt; by adding &lt;code&gt;ip&lt;/code&gt; to the text properties again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This all looks right.  &lt;code&gt;org-rear-nonsticky-at&lt;/code&gt; should take care of property bleeding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behaviour is triggered by &lt;code&gt;(add-text-properties (match-end 3) (match-end 0) ip)&lt;/code&gt;, which hides the trailing &lt;code&gt;]]&lt;/code&gt;.  Only the &lt;code&gt;'invisible 'org-link&lt;/code&gt; property triggers this behaviour, the other properties appear to be innocent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could overwrite &lt;code&gt;org-activate-bracket-links&lt;/code&gt; such that &lt;code&gt;ip&lt;/code&gt; no longer sets &lt;code&gt;'invisible&lt;/code&gt; but &lt;code&gt;'display &quot;&quot;&lt;/code&gt;, which has the same effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-activate-bracket-links (limit)&#xA;  &quot;Run through the buffer and add overlays to bracketed links.&quot;&#xA;  (if (and (re-search-forward org-bracket-link-regexp limit t)&#xA;       (not (org-in-src-block-p)))&#xA;      (let* ((hl (org-match-string-no-properties 1))&#xA;         (help (concat &quot;LINK: &quot; (save-match-data (org-link-unescape hl))))&#xA;         (ip (org-maybe-intangible&#xA;          (list 'display &quot;&quot;&#xA;            'keymap org-mouse-map 'mouse-face 'highlight&#xA;            'font-lock-multiline t 'help-echo help&#xA;            'htmlize-link `(:uri ,hl))))&#xA;         (Vp (list 'keymap org-mouse-map 'mouse-face 'highlight&#xA;               'font-lock-multiline t 'help-echo help&#xA;               'htmlize-link `(:uri ,hl))))&#xA;    ;; We need to remove the invisible property here.  Table narrowing&#xA;    ;; may have made some of this invisible.&#xA;    (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))&#xA;    (remove-text-properties (match-beginning 0) (match-end 0)&#xA;                '(invisible nil))&#xA;    (if (match-end 3)&#xA;        (progn&#xA;          (add-text-properties (match-beginning 0) (match-beginning 3) ip)&#xA;          (org-rear-nonsticky-at (match-beginning 3))&#xA;          (add-text-properties (match-beginning 3) (match-end 3) vp)&#xA;          (org-rear-nonsticky-at (match-end 3))&#xA;          (add-text-properties (match-end 3) (match-end 0) ip)&#xA;          (org-rear-nonsticky-at (match-end 0)))&#xA;      (add-text-properties (match-beginning 0) (match-beginning 1) ip)&#xA;      (org-rear-nonsticky-at (match-beginning 1))&#xA;      (add-text-properties (match-beginning 1) (match-end 1) vp)&#xA;      (org-rear-nonsticky-at (match-end 1))&#xA;      (add-text-properties (match-end 1) (match-end 0) ip)&#xA;      (org-rear-nonsticky-at (match-end 0)))&#xA;    t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Clearly, this is an ugly hack.  But it works for me and might work for you.  I still recommend filing a bug report.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-10-28T08:31:59.863" LastActivityDate="2014-10-28T08:31:59.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2719" PostTypeId="2" ParentId="2717" CreationDate="2014-10-27T17:23:39.863" Score="5" Body="&lt;p&gt;Since around Emacs-24, the &lt;em&gt;vc-log&lt;/em&gt; buffer supports/expects an RFC822-style format, with some headers handled specially (e.g. &lt;code&gt;Author:&lt;/code&gt;, &lt;code&gt;Fixes:&lt;/code&gt;, and &lt;code&gt;Summary:&lt;/code&gt;).  In Emacs-24.4, the default message content was changed to make this more clear.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-27T17:23:39.863" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2720" PostTypeId="1" AcceptedAnswerId="2726" CreationDate="2014-10-27T17:39:54.070" Score="19" ViewCount="887" Body="&lt;p&gt;&lt;sup&gt;In the spirit of &lt;a href=&quot;https://tex.stackexchange.com/q/94889/17423&quot;&gt;How can I explain the meaning of LaTeX to my grandma?&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is wonderful editor for any text-based purpose—this much is clear to those of us who use it.  Often times I'm trying to explain to one of my friends why I use something that 'looks so old' and I struggle to find a good answer.  I'm not necessarily interested in 'converting' them to use Emacs; like I said—they don't necessarily have a reason to.  I just want to explain why I use Emacs as opposed to Visual Studio, Sublime, Atom, or any of the flashy-and-featureful graphical editors.  What makes it the best choice among these?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2015-08-13T18:02:35.940" Title="How would you explain Emacs to a non-technical person?" Tags="|learning|" AnswerCount="9" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2721" PostTypeId="2" ParentId="2720" CreationDate="2014-10-27T18:16:00.293" Score="4" Body="&lt;p&gt;To a non-initiate, I used to say: &quot;Emacs is more than an editor. It is actually a powerful tool which lets you build your own editor.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This actually scared many away from Emacs, because they felt like it was something too complex to being worth the effort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now I just say: &quot;Emacs is a powerful editor that can make your text writing better in many different ways. Editing and creating text documents with Emacs is more efficient.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that works, listener will ask for some explanation about how Emacs works.&#xA;If that doesn't work, I just show some Elisp and scare my listener away forever. ;)&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2014-10-27T18:16:00.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2722" PostTypeId="1" CreationDate="2014-10-27T18:34:15.333" Score="6" ViewCount="1934" Body="&lt;p&gt;My version of &lt;code&gt;ls&lt;/code&gt; supports a &lt;code&gt;time-style&lt;/code&gt; format (with a space) as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--time-style=+%m-%d-%Y %H:%M:%S&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The entire &lt;code&gt;dired-listing-switches&lt;/code&gt; looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;-alh --group-directories-first --time-style=+%m-%d-%Y %H:%M:%S&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The space between the date and the time breaks the functionality.  Any ideas on how to use &lt;code&gt;(setq dired-listing-switches . . .)&lt;/code&gt; &lt;em&gt;with a space between the date and time&lt;/em&gt; would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried single quotes and I've tried &lt;code&gt;\&quot;&lt;/code&gt; but that format is rejected.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; (October 28, 2014)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried single quotes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--time-style='+%m-%d-%Y %H:%M:%S'&#xA;'--time-style=+%m-%d-%Y %H:%M:%S'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried escaped double quotes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--time-style=\&quot;+%m-%d-%Y %H:%M:%S\&quot;&#xA;&#xA;\&quot;--time-style=+%m-%d-%Y %H:%M:%S\&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Based on Drew's suggestion below, I tried an escaped space:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--time-style=+%m-%d-%Y\ %H:%M:%S&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following link is the thread for the new Emacs bug report that I filed today:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18875&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18875&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; October 29, 2014:  For clarification purposes, the proposed &lt;code&gt;dired-listing-switches&lt;/code&gt; string will either generate an error, or it will omit &lt;code&gt;hours:minutes:seconds&lt;/code&gt;.  Although dired-mode does not support a list for &lt;code&gt;switches&lt;/code&gt; when using &lt;code&gt;dired-insert-directory&lt;/code&gt;, it is interesting to note that &lt;code&gt;insert-directory&lt;/code&gt; from &lt;code&gt;files.el&lt;/code&gt; permits a list format which works.  The following screen shot was generated with &lt;code&gt;insert-directory&lt;/code&gt; using a &lt;code&gt;list&lt;/code&gt; format for the &lt;code&gt;switches&lt;/code&gt; argument.  I have already updated the bug report to mention the following expression (which bypasses dired-mode altogether). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-directory &quot;/&quot; '(&quot;--dired&quot; &quot;-alth&quot; &quot;--time-style=+%m-%d-%Y %H:%M:%S&quot;) nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/dired_listing_switch_example.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.357" LastActivityDate="2018-08-09T19:31:10.680" Title="dired-listing-switches -- time-style format (with a space)" Tags="|dired|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2723" PostTypeId="2" ParentId="2636" CreationDate="2014-10-27T19:08:10.263" Score="2" Body="&lt;p&gt;I use a similar cursor movement layout to what you want (IJKL, making for an inverse T), and absolutely love it. I got the initial idea from Xah Lee's &lt;a href=&quot;http://ergoemacs.org/emacs/ergonomic_emacs_keybinding.html&quot; rel=&quot;nofollow&quot;&gt;ErgoEmacs keybinding&lt;/a&gt; project, now moved to Github: &lt;a href=&quot;https://ergoemacs.github.io/&quot; rel=&quot;nofollow&quot;&gt;https://ergoemacs.github.io/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only drawback is that when I first start using a new mode, I may have to clean up its keymap to follow my pattern, but this is fairly rare and a one-time-only operation.&lt;/p&gt;&#xA;" OwnerUserId="2290" LastActivityDate="2014-10-27T19:08:10.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2724" PostTypeId="1" AcceptedAnswerId="2734" CreationDate="2014-10-27T19:18:22.820" Score="7" ViewCount="1051" Body="&lt;p&gt;The usual behavior of &lt;code&gt;Alt-Tab&lt;/code&gt; in window managers is that as long as &lt;code&gt;Alt&lt;/code&gt; is pressed, the user can &lt;code&gt;Tab&lt;/code&gt; or &lt;code&gt;Shift-Tab&lt;/code&gt; through the list of windows, and then when &lt;code&gt;Alt&lt;/code&gt; is released the currently selected window is made active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be replicated with Emacs? AFAIK, keybindings are activated on &lt;code&gt;key-down&lt;/code&gt;, and there is no way to say: enter a mode where additional  switch through a list and exit (and activate) when &lt;code&gt;Alt&lt;/code&gt; is released. (Replace &lt;code&gt;&amp;lt;alt&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; with a modifier + key of choice, I understand that &lt;code&gt;Alt-Tab&lt;/code&gt; may be fully under the WM's control.)&lt;/p&gt;&#xA;" OwnerUserId="2290" LastEditorUserId="45" LastEditDate="2014-10-27T21:06:33.433" LastActivityDate="2014-10-28T16:12:19.710" Title="How to define a keybinding with a key-down/up (Alt-Tab-like) behaviour" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2725" PostTypeId="2" ParentId="141" CreationDate="2014-10-27T19:27:33.823" Score="1" Body="&lt;p&gt;I'm not sure how railwaycat Emacs is different from the regular home-brew formula, but with the latter you would do &lt;code&gt;ln -sfv /usr/local/opt/emacs/*.plist ~/Library/LaunchAgents&lt;/code&gt;, which would run &lt;code&gt;emacs --daemon&lt;/code&gt; on login.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The plist is included as a HERE-document in the &lt;a href=&quot;https://github.com/Homebrew/homebrew/blob/master/Library/Formula/emacs.rb&quot; rel=&quot;nofollow&quot;&gt;formula&lt;/a&gt;. All you'd need to adopt it is change the path to your emacs app in the line &lt;code&gt;&amp;lt;string&amp;gt;#{opt_bin}/emacs&amp;lt;/string&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, you can also get Emacs as an OS X app with Homebrew Emacs if you install it with the &lt;code&gt;--cocoa&lt;/code&gt; option. (You would also need to run &lt;code&gt;brew linkapps&lt;/code&gt; afterwards, to link it to &lt;code&gt;/Applications&lt;/code&gt;, or create the link yourself.&lt;/p&gt;&#xA;" OwnerUserId="2290" LastActivityDate="2014-10-27T19:27:33.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2726" PostTypeId="2" ParentId="2720" CreationDate="2014-10-27T20:04:21.117" Score="10" Body="&lt;p&gt;Emacs is a popular text editor used mainly on Unix-based systems by programmers, scientists, engineers, students, writers, and system administrators. It is popular because of its functionality and is highly extensible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, it is a text-editor built around you, extended by you, made for you. Unlike other text editors where you have to adjust to it. Emacs can be adjusted by you to suit your needs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In my opinion&lt;/strong&gt;: Yes, Emacs is basically like a personal text-editor conforming to your needs/specifications but it so much more! But it is so much more than just a text-editor, you can:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/20979918/reading-email-from-gmail-in-emacs-24&quot;&gt;Read your email&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.masteringemacs.org/article/running-shells-in-emacs-overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;Run  a shell&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/2728/using-emacs-to-send-tweets-or-queets&quot;&gt;Send tweets&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/vermiculus/sx.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;Even answer SE questions&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And so much more! I believe that no one uses Emacs the same way and that we all use it differently. Meaning no two Emacs user or Emacs application are the same. &lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-08-12T22:11:46.967" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2727" PostTypeId="1" CreationDate="2014-10-27T20:19:22.240" Score="9" ViewCount="847" Body="&lt;p&gt;Quite a few Emacs modes use (something like) forms: the customization interface is one of them, the Message mode (read: its header part) is another one; there are more of them, unfortunately not always very similar.  By a &quot;form&quot; I mean here a buffer with read-only parts and places designated to enter text; it may or may not contain buttons (it probably should accept &lt;code&gt;C-c C-c&lt;/code&gt; as the confirmation/committing key, irrespective of the presence of an &lt;em&gt;OK&lt;/em&gt; button).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am particularly interested in auto-completion in the fields (and in particular, enabling fields with &lt;em&gt;lists&lt;/em&gt; of values from some designated set, say, comma-separated).  My question is: is there any Emacs library enabling easy (by &quot;easy&quot;, I mean not reinventing the wheel) creation of such forms, or should I code everything myself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I imagine that what I should do in the latter case would be (1) set some parts of the buffer read-only, (2) prepare a special major mode, so that e.g. &lt;code&gt;TAB&lt;/code&gt; and &lt;code&gt;S-TAB&lt;/code&gt; switch between &quot;fields&quot;, and (3) maybe use something like Icicles or Helm for autocompletion.)&lt;/p&gt;&#xA;" OwnerUserId="642" LastEditorUserId="105" LastEditDate="2014-10-27T23:55:30.977" LastActivityDate="2014-10-27T23:55:30.977" Title="Are there any libraries for input fields in Emacs?" Tags="|completion|text-properties|libraries|widget|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2728" PostTypeId="1" CreationDate="2014-10-27T20:32:28.633" Score="10" ViewCount="430" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://quitter.se/qbi&quot;&gt;Quitter&lt;/a&gt; or &lt;a href=&quot;https://twitter.com/qbi/&quot;&gt;Twitter&lt;/a&gt; to send out short messages. Most of my Queets/Tweets go out through the web interface. However I'd like to use Emacs for it. Does anyone a good method/mode to use with Quitter or Twitter? &lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2014-10-27T22:17:58.763" Title="Using Emacs to send Tweets or Queets" Tags="|web|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2729" PostTypeId="2" ParentId="2728" CreationDate="2014-10-27T20:34:54.520" Score="9" Body="&lt;p&gt;Have a look at &lt;a href=&quot;http://www.emacswiki.org/emacs/Twitter&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki's page on Twitter&lt;/a&gt; for suggestions.  Personally, I've had good luck with &lt;a href=&quot;http://www.emacswiki.org/emacs/TwitteringMode&quot; rel=&quot;nofollow&quot;&gt;Twittering Mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/hayamiz/twittering-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;twittering-mode&lt;/code&gt;&lt;/a&gt; on GitHub&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;code&gt;M-x twit&lt;/code&gt; as an entry point. It will handle authorization as part of its process.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;i&lt;/code&gt; to display profile pictures&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;j&lt;/code&gt;/&lt;code&gt;k&lt;/code&gt; next/previous tweet&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;u&lt;/code&gt; tweet&lt;/li&gt;&#xA;&lt;li&gt;…&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x twittering-update-status-from-minibuffer&lt;/code&gt; (not &lt;code&gt;(interactive)&lt;/code&gt; by default; recommend using an interactive wrapper function and binding to a key)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="291" LastEditorUserId="2264" LastEditDate="2014-10-27T22:17:58.763" LastActivityDate="2014-10-27T22:17:58.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2730" PostTypeId="2" ParentId="2708" CreationDate="2014-10-27T20:44:04.487" Score="8" Body="&lt;p&gt;You can configure how Org handles file links by customizing the variable &lt;code&gt;org-file-apps&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default Org will check &lt;code&gt;auto-mode-alist&lt;/code&gt; and open the file in Emacs if it finds a match. If you would rather use the default system application for &lt;code&gt;.xls&lt;/code&gt; files you can add something like this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-file-apps '(&quot;\\.xls\\'&quot; . default))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use prefix arguments to choose how to open a link on a case-by-case basis:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-o&lt;/code&gt; will open the link according to your configuration&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u C-c C-o&lt;/code&gt; will visit the file in Emacs&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u C-u C-c C-o&lt;/code&gt; will let the system decide how to open the file&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-27T20:44:04.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2731" PostTypeId="2" ParentId="2708" CreationDate="2014-10-27T20:46:10.960" Score="3" Body="&lt;p&gt;You can use the &lt;a href=&quot;https://bitbucket.org/jpkotta/openwith&quot; rel=&quot;nofollow&quot;&gt;openwith&lt;/a&gt; package for configuring associations of file types with external applications. This then opens the files in the defined applications and works for &lt;code&gt;find-file&lt;/code&gt;, &lt;code&gt;dired&lt;/code&gt;, and naturally also for &lt;code&gt;C-C C-o&lt;/code&gt; in org-mode. The associations are defined in a list of lists (q.v. documentation of the &lt;code&gt;openwith-associations&lt;/code&gt; variable). E.g. here are my settings for my ubuntu installation. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;\\.pdf\\'&quot; &quot;evince&quot; (file))&#xA; (&quot;\\.mp3\\'&quot; &quot;xmms&quot; (file))&#xA; (&quot;\\.\\(?:mpe?g\\|mp4\\|MP4\\|avi\\|wmv\\)\\'&quot; &quot;mplayer&quot; (&quot;-idx&quot; file))&#xA; (&quot;\\.odp\\|\\.odt\\|\\.doc\\|\\.docx\\'&quot; &quot;libreoffice&quot; (file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Openwith is available from MELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relative links in org mode then work easily, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:images/mypicture.pdf][this picture]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2014-10-27T20:46:10.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2732" PostTypeId="5" CreationDate="2014-10-27T21:09:50.600" Score="0" Body="&lt;p&gt;The Org mode export facilities include a full complement of exporting, printing, converting, and publishing functions. Use the &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt; tag for any question pertaining to these topics and augment with more specific tags related to these specific functions. For example, if the question is about creating a PDF file, then tag with both &lt;a href=&quot;/questions/tagged/pdf&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;pdf&amp;#39;&quot; rel=&quot;tag&quot;&gt;pdf&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Some features of &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt; also operate on buffers unrelated to Org mode. They are primarily used in &lt;a href=&quot;/questions/tagged/orgtbl-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;orgtbl-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;orgtbl-mode&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/orgstruct-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;orgstruct-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;orgstruct-mode&lt;/a&gt; in foreign buffers for in-place conversion of lists and tables from Org syntax to another. For such questions, add a tag for the &lt;a href=&quot;/questions/tagged/major-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;major-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;major-mode&lt;/a&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt; facility in Org mode now has a centralized dispatch menu from which various export formats can be accessed. Each format has its own specialized back-end engine that caters to the specifics of that format. For example, one back-end generates a simple ASCII output, while another may rely on an external &lt;a href=&quot;/questions/tagged/latex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;latex&amp;#39;&quot; rel=&quot;tag&quot;&gt;latex&lt;/a&gt; engine to produce sophisticated layouts for offset printing. Some engines, such as &lt;a href=&quot;/questions/tagged/odt&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;odt&amp;#39;&quot; rel=&quot;tag&quot;&gt;odt&lt;/a&gt;, provide direct conversion from org format to ODT format. Some engines, such as &lt;a href=&quot;/questions/tagged/html&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;html&amp;#39;&quot; rel=&quot;tag&quot;&gt;html&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/markdown&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;markdown&amp;#39;&quot; rel=&quot;tag&quot;&gt;markdown&lt;/a&gt;, convert Org markup tags during export. Some built-in features of Emacs and Org mode, such Contacts, Calendar or Reminders, rely on &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt; for conversions as well. When tagging questions, please include the appropriate specific tags besides &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-12T19:35:24.050" LastActivityDate="2017-02-12T19:35:24.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2733" PostTypeId="4" CreationDate="2014-10-27T21:09:50.600" Score="0" Body="exporting, converting, printing, and publishing Org documents to a variety of other formats using Org mode's export facilities. PDF, HTML, ASCII, etc., are some of the common export formats." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-10T18:10:56.607" LastActivityDate="2017-02-10T18:10:56.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2734" PostTypeId="2" ParentId="2724" CreationDate="2014-10-27T21:45:34.050" Score="6" Body="&lt;p&gt;As has been &lt;a href=&quot;https://emacs.stackexchange.com/q/275/93&quot;&gt;discussed before&lt;/a&gt;, you cannot bind commands to key-up events.  One alternative that comes to mind to achieve similar workflow is to use a transient map like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-cycling-var 0 &quot;Some variable that I am interested in modifying&quot;)&#xA;&#xA;(defvar my-transient-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;     (define-key map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'my-forward-command)&#xA;     (define-key map (kbd &quot;&amp;lt;C-tab&amp;gt;&quot;) 'my-forward-command)&#xA;     (define-key map (kbd &quot;&amp;lt;S-tab&amp;gt;&quot;) 'my-backward-command)&#xA;     (define-key map (kbd &quot;&amp;lt;C-S-tab&amp;gt;&quot;) 'my-backward-command)&#xA;     map)&#xA;  &quot;A key map used for a demonstration of transient maps&quot;)&#xA;&#xA;(defun my-cycling-command ()&#xA;&quot;Starts the cycling command and sets the transient key map&quot;&#xA;  (interactive)&#xA;  (my-forward-command)&#xA;  (set-transient-map my-transient-map 'my-keep-keymap))&#xA;&#xA;(defun my-keep-keymap ()&#xA;  &quot;This function is called each time a key is pressed while the&#xA;transient map is active. If this function returns non-nil, the&#xA;keymap will stay active.&quot;&#xA;  (let* ((key (this-command-keys))&#xA;         (binding (lookup-key my-transient-map key)))&#xA;    (unless binding&#xA;      (my-end-repeatable-command))&#xA;    binding))&#xA;&#xA;(defun my-forward-command ()&#xA;  &quot;Increment my-cycling-var by one&quot;&#xA;  (interactive)&#xA;  (setq my-cycling-var (+ 1 my-cycling-var))&#xA;  (message &quot;my-cycling-var is %d&quot; my-cycling-var))&#xA;&#xA;(defun my-backward-command ()&#xA;  &quot;Decrement my-cycling-var by one&quot;&#xA;  (interactive)&#xA;  (setq my-cycling-var (+ -1 my-cycling-var))&#xA;  (message &quot;my-cycling-var is %d&quot; my-cycling-var))&#xA;&#xA;(defun my-end-repeatable-command ()&#xA;  &quot;Take any necessary action after cycling&quot;&#xA;  (message &quot;my-cycling-var was set to %d&quot; my-cycling-var))&#xA;&#xA;;; Bind my-repeatable-command to Ctrl+TAB&#xA;(global-set-key (kbd &quot;&amp;lt;C-tab&amp;gt;&quot;) 'my-cycling-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This binds &lt;code&gt;my-cycling-command&lt;/code&gt; to &lt;code&gt;C-TAB&lt;/code&gt;. Subsequent presses of &lt;code&gt;TAB&lt;/code&gt; and &lt;code&gt;S-TAB&lt;/code&gt; or &lt;code&gt;C-TAB&lt;/code&gt; and &lt;code&gt;C-S-TAB&lt;/code&gt; will have a cycling effect.  As soon as you press any key that is not &lt;code&gt;TAB&lt;/code&gt;, &lt;code&gt;S-TAB&lt;/code&gt;, or &lt;code&gt;RET&lt;/code&gt;, the overlay map disappears and you resume normal editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Important Note:&lt;/strong&gt;  Prior to Emacs 24.4, &lt;code&gt;set-transient-map&lt;/code&gt; was named &lt;code&gt;set-temporary-overlay-map&lt;/code&gt;.  To be compatible with earlier versions, you will have to use that function name instead.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-10-28T16:12:19.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2735" PostTypeId="1" CreationDate="2014-10-27T21:52:49.127" Score="9" ViewCount="3797" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I format/fill poorly-formatted items in an &lt;code&gt;org-mode&lt;/code&gt; bulleted list?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to figure out how to make &lt;code&gt;fill-paragraph&lt;/code&gt; work on poorly formatted bulleted items in an &lt;code&gt;org-mode&lt;/code&gt; list.  By &quot;poorly formatted,&quot; I mean long-ish bullets that use multiple lines but need to be cleaned up to make them readable.  The difficulty is that &lt;code&gt;org-mode&lt;/code&gt; does not seem to recognize subsequent lines as part of the same bullet when the first non-whitespace character is in the same column as the bullet itself.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, in the example below, bullet (1) does not need filling, bullets (2) and (3) need filling and respond as expected to &lt;code&gt;fill-paragraph&lt;/code&gt;, but bullets (4) and (5) do not fill as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a header&#xA;&#xA;  1) a simple bullet&#xA;  2) a bullet that responds nicely&#xA;     to&#xA;     fill-paragraph&#xA;     (try it!)&#xA;  3) another bullet that also responds nicely&#xA;    to&#xA;     fill-paragraph&#xA;    even though the &quot;t&quot; in &quot;to&quot; and the&#xA;     &quot;e&quot; in &quot;even&quot; line up with the space&#xA;         in between the &quot;4)&quot; and the start of the bullet&#xA;  4) a bullet that does&#xA;  NOT respond to fill-paragraph&#xA;  because the &quot;N&quot; in &quot;NOT&quot; is in the same column&#xA;  as the start of the bullet&#xA;  5) a similar problem:&#xA;the text is flush entirely to the left&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First of all, why does this happen?  Second, and more to the point, how can I convince &lt;code&gt;org-mode&lt;/code&gt; to treat all of the lines up to the next bullet as part of the same bullet for &lt;code&gt;fill-paragraph&lt;/code&gt; purposes?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2024-01-22T03:52:44.997" Title="How to format/fill poorly-formatted bullet items in org-mode?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2736" PostTypeId="1" CreationDate="2014-10-27T22:41:09.517" Score="2" ViewCount="1403" Body="&lt;p&gt;What is the recommended terminal emulator in emacs to use ncurses applications? I use things like wicd-curses, cmake and other applications with rich ncurses interfaces and I am having trouble in finding an appropriate configuration where keyboard interaction works well and terminal content is not accidentally scrambled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="2295" LastActivityDate="2016-09-02T15:46:58.803" Title="terminal emulator for ncurses applications" Tags="|term|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2737" PostTypeId="1" CreationDate="2014-10-27T23:02:12.950" Score="8" ViewCount="2005" Body="&lt;p&gt;I have a table in &lt;code&gt;org-mode&lt;/code&gt; which has the following format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name       | email           | number |&#xA;|------------+-----------------+--------|&#xA;| Doe, John  | jod@example.org |      7 |&#xA;| Doe, Jane  | jod@example.org |        |&#xA;|------------+-----------------+--------|&#xA;| Foo, Pete  | pf@example.com  |      5 |&#xA;|------------+-----------------+--------|&#xA;| Bar, Mary  | maba@127.0.0.1  |      3 |&#xA;| Quux, Mike | bz@192.168.12.1 |        |&#xA;|------------+-----------------+--------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I want the table to be formatted to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name       | email           | number |&#xA;|------------+-----------------+--------|&#xA;| Bar, Mary  | maba@127.0.0.1  |      3 |&#xA;| Quux, Mike | bz@192.168.12.1 |        |&#xA;|------------+-----------------+--------|&#xA;| Doe, John  | jod@example.org |      7 |&#xA;| Doe, Jane  | jod@example.org |        |&#xA;|------------+-----------------+--------|&#xA;| Foo, Pete  | pf@example.com  |      5 |&#xA;|------------+-----------------+--------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This table should be sorted alphabetically. So the last two rows should be the first. The separation with the horizontal lines should stay. If there are different words in in grouped columns, it doesn't matter how they are sorted. So the last group in the table above can either be &lt;code&gt;Bar&lt;/code&gt; followed by &lt;code&gt;Baz&lt;/code&gt; or &lt;code&gt;Baz&lt;/code&gt; followed by &lt;code&gt;Bar&lt;/code&gt;. How can I do this with Emacs &lt;code&gt;org-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="504" LastEditDate="2014-10-28T07:06:08.570" LastActivityDate="2014-10-28T16:54:54.163" Title="Sorting an org-mode table with horizontal lines" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2738" PostTypeId="2" ParentId="2735" CreationDate="2014-10-27T23:13:09.717" Score="10" Body="&lt;p&gt;It happens because Org uses indentation to define text as belonging to&#xA;an item.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(info &quot;(org)Plain lists&quot;)&#xA;&#xA;Items belonging to the same list must have the same indentation on&#xA;the first line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To convince Org to do what you want, you need to get the text indented&#xA;to the level of the item. You can use &lt;code&gt;C-x r t&lt;/code&gt; (&lt;code&gt;string-rectangle&lt;/code&gt;) or&#xA;&lt;code&gt;C-x C-i&lt;/code&gt; (&lt;code&gt;indent-rigidly&lt;/code&gt;) to do this&#xA;and then filling will work like in #2 and #3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are on the item line and you want to enter text below it, you can&#xA;use &lt;code&gt;C-j&lt;/code&gt; (&lt;code&gt;org-return-indent&lt;/code&gt;) to move to the same indentation on the next&#xA;line. That way, you can avoid formatting like in #4 and #5.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-10-28T02:45:17.643" LastActivityDate="2014-10-28T02:45:17.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2739" PostTypeId="2" ParentId="2727" CreationDate="2014-10-27T23:55:01.650" Score="7" Body="&lt;p&gt;See libraries &lt;code&gt;cus-edit.el&lt;/code&gt; and &lt;code&gt;wid-edit.el&lt;/code&gt; (and their top-level libraries &lt;code&gt;custom.el&lt;/code&gt; and &lt;code&gt;widget.el&lt;/code&gt;, and associated component libraries), which are included with GNU Emacs. The former makes use of the latter. The latter defines basic (and not-so-basic) form-entry thingies, called &quot;&lt;em&gt;widgets&lt;/em&gt;&quot;, in a hierarchy. You can use these predefined widgets and functions in the library to create your own widgets and widget types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, be warned that the code of these libraries, particularly that of &lt;code&gt;wid-edit.el&lt;/code&gt;, is &lt;em&gt;not very easy&lt;/em&gt; to follow. Your best bet is to start by reusing existing widgets or using existing widget-definition code as a guide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Two minor extension libraries for this are &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/cus-edit%2b.el&quot;&gt;&lt;code&gt;cus-edit+.el&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/wid-edit%2b.el&quot;&gt;&lt;code&gt;wid-edit+.el&lt;/code&gt;&lt;/a&gt;. They also present some usage examples.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an Info manual for widgets, distributed with GNU Emacs, entitled &quot;&lt;strong&gt;The Emacs Widget Library&lt;/strong&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also library &lt;code&gt;forms.el&lt;/code&gt;, included with GNU Emacs, but I am not familiar with it. Perhaps someone else has something useful to say about it. There is a manual for forms, distributed with GNU Emacs, entitled &quot;&lt;strong&gt;Forms Mode&lt;/strong&gt;&quot;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-27T23:55:01.650" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2740" PostTypeId="1" CreationDate="2014-10-28T00:42:03.203" Score="5" ViewCount="1869" Body="&lt;p&gt;I'm trying to setup priorities other than A, B, C.  (I want to do U, I, O; short for Urgent, Important, Other).  Previously, I had set up custom agenda commands that sorted &lt;code&gt;priority-down&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I configured my priorities like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-highest-priority ?U)&#xA;(setq org-default-priority ?I)&#xA;(setq org-lowest-priority ?O)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when I viewed my agendas I noticed that rather than sorting in priority order, it seems to be using alphabetical order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong here?&lt;/p&gt;&#xA;" OwnerUserId="2244" LastActivityDate="2019-09-29T01:09:11.557" Title="Trouble sorting customized priorities in org-mode" Tags="|org-mode|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2741" PostTypeId="2" ParentId="2740" CreationDate="2014-10-28T00:45:32.560" Score="3" Body="&lt;p&gt;Just looked at the source for org.el, and found this frustrating snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom org-highest-priority ?A&#xA;  &quot;The highest priority of TODO items.  A character like ?A, ?B etc.&#xA;   Must have a smaller ASCII number than `org-lowest-priority'.&quot;&#xA;  :group 'org-priorities&#xA;  :type 'character)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would appear that org-mode wants the custom priorities to also be alphabetically ordered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought you might've been able to use &lt;code&gt;org-get-priority-function&lt;/code&gt; to work around this, but the source code appears to be simply calling the priority fn with no args, instead of taking the string as an arg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempted work-around was to use these priorities:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-highest-priority ?U)&#xA;(setq org-default-priority ?i)&#xA;(setq org-lowest-priority ?o)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this didn't work because of this pesky regex in org.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar org-priority-regexp &quot;.*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)&quot;&#xA;  &quot;Regular expression matching the priority indicator.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what I've finally come up with is to use these priorities:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-highest-priority ?G) ;; UrGent&#xA;(setq org-default-priority ?I) ;; Important&#xA;(setq org-lowest-priority ?O) ;; Other&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2244" LastEditDate="2014-10-28T01:04:50.090" LastActivityDate="2014-10-28T01:04:50.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2742" PostTypeId="1" AcceptedAnswerId="2743" CreationDate="2014-10-28T00:49:28.463" Score="7" ViewCount="545" Body="&lt;p&gt;I would like to understand what is the difference between &lt;code&gt;M-x shell&lt;/code&gt; and &lt;code&gt;M-x term&lt;/code&gt;? Also under which circumstances should be used the first and under which the second?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="253" LastEditDate="2014-11-16T19:08:30.120" LastActivityDate="2014-11-16T19:08:30.120" Title="Difference between shell and term" Tags="|shell|term|" AnswerCount="1" CommentCount="0" ClosedDate="2014-11-18T14:59:23.090" ContentLicense="CC BY-SA 3.0" />
  <row Id="2743" PostTypeId="2" ParentId="2742" CreationDate="2014-10-28T01:02:48.637" Score="8" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;shell&lt;/code&gt;&lt;/a&gt; is the oldest of the two.  It uses Emacs's &lt;code&gt;comint-mode&lt;/code&gt; to run a subshell (e.g. &lt;code&gt;bash&lt;/code&gt;).  In this mode, you're using Emacs to edit a command line.  The subprocess doesn't see any input until you press Enter.  Emacs is acting like a dumb terminal.  It does support color codes, but not things like moving the cursor around, so you can't run curses-based applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;term&lt;/code&gt;&lt;/a&gt; is a terminal emulator written in Emacs Lisp.  In this mode, the keys you press are sent directly to the subprocess; you're using whatever line editing capabilities the shell presents, not Emacs's.  It also allows you to run programs that use advanced terminal capabilities like cursor movement (e.g. you could run &lt;code&gt;nano&lt;/code&gt; or &lt;code&gt;less&lt;/code&gt; inside Emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;https://unix.stackexchange.com/questions/104325/what-is-the-difference-between-shell-eshell-and-term-in-emacs&quot;&gt;question&lt;/a&gt; was originally &lt;a href=&quot;https://unix.stackexchange.com/questions/104325/what-is-the-difference-between-shell-eshell-and-term-in-emacs&quot;&gt;answered&lt;/a&gt;  by &lt;a href=&quot;https://unix.stackexchange.com/users/2421/cjm&quot;&gt;cjm&lt;/a&gt; on the Unix Stack Exchange Site.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2014-10-28T01:14:16.063" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2744" PostTypeId="2" ParentId="2736" CreationDate="2014-10-28T01:54:06.603" Score="2" Body="&lt;p&gt;&lt;code&gt;ansi-term&lt;/code&gt; is a terminal emulator, and appears to work well enough to support ncurses applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some sticky issues with terminfo, particularly after sshing into remote systems, &lt;a href=&quot;http://www.emacswiki.org/emacs/AnsiTermHints#toc6&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/AnsiTermHints#toc6&lt;/a&gt; has discussion about this.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-10-28T02:06:28.960" LastActivityDate="2014-10-28T02:06:28.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2745" PostTypeId="1" AcceptedAnswerId="2758" CreationDate="2014-10-28T02:19:03.280" Score="18" ViewCount="1277" Body="&lt;p&gt;I type a python docstring all on one line like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;&#xA;This is a long docstring. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis.&#xA;&quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I hit M-q (&lt;code&gt;fill-paragraph&lt;/code&gt;), and I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;This is a long docstring. Lorem ipsum dolor sit amet, consectetur&#xA;adipiscing elit. Donec a diam lectus. Sed sit amet ipsum&#xA;mauris. Maecenas congue ligula ac quam viverra nec consectetur ante&#xA;hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas&#xA;mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem&#xA;lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non&#xA;tortor. Lorem ipsum dolor sit amet, consectetur adipiscing&#xA;elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed,&#xA;adipiscing id dolor. Pellentesque auctor nisi id magna consequat&#xA;sagittis.&#xA;&#xA;&quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have two problems with this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The docstring starts on the same line as the &lt;code&gt;&quot;&quot;&quot;&lt;/code&gt; -- I'd prefer to have the triple-quote stay on its own line.&lt;/li&gt;&#xA;&lt;li&gt;(Much lower priority.) The docstring ends with a blank line.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The example above is contrived, but I run into this frequently especially when editing existing docstrings where I'd like to simply &lt;code&gt;M-q&lt;/code&gt; and have the whole para reflowed.&lt;/p&gt;&#xA;" OwnerUserId="2072" LastActivityDate="2014-10-28T13:32:25.063" Title="Make fill-paragraph in python docstring leave the triple-quotes on separate line" Tags="|fill-paragraph|python|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2746" PostTypeId="2" ParentId="2720" CreationDate="2014-10-28T02:27:40.590" Score="0" Body="&lt;p&gt;&lt;em&gt;Summary:&lt;/em&gt; It's not a great question &lt;strong&gt;&lt;em&gt;as posed so far&lt;/em&gt;&lt;/strong&gt;: too general. I think it should be closed as too broad or primarily opinion-based. (Just one opinion.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, what is a &quot;&lt;em&gt;non-technical person&lt;/em&gt;&quot;?  Just knowing that (you think) some person is &quot;&lt;em&gt;non-technical&lt;/em&gt;&quot; doesn't help much. Non-technical wrt what techniques? And how does that particular lack of technique relate to Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer of how to explain &lt;em&gt;anything&lt;/em&gt; to &lt;em&gt;anyone&lt;/em&gt; is to first find out who you are talking to, what interests them, and why.  If I were to &quot;explain&quot; Emacs to Person X, I would try to find out what use Emacs might be to Person X. And I'd work from there: from Person X's presumed motivation and use cases to how Emacs might fit these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, of course you can try to characterize a particular &lt;em&gt;set&lt;/em&gt; of people as an audience for some presentation: a book, article, video, demo, whatever. But even then, (1) a better characterization of your audience than &quot;&lt;em&gt;non-technical people&lt;/em&gt;&quot; would be helpful to you. And (2) it would also help you to be more specific about the presentation itself: what form/medium, how long, how, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, ask yourself who, what, when, how, why,... What do you think Emacs has to offer your audience? What do you think they might be interested in that relates to Emacs?&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-28T16:37:37.733" LastActivityDate="2014-10-28T16:37:37.733" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2747" PostTypeId="1" AcceptedAnswerId="2748" CreationDate="2014-10-28T02:27:53.323" Score="7" ViewCount="377" Body="&lt;p&gt;I am using the &lt;code&gt;term&lt;/code&gt; of Emacs to compile some code, with &lt;code&gt;linum-mode&lt;/code&gt; enabled to display the line numbers for the terminal, and the line numbers stop increasing as soon as they reach 2049.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I write source code and I reach 2049 lines will this happen too?  Why is that happening? Shouldn't the numbers keep increasing?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="8723" LastEditDate="2016-09-09T19:19:51.933" LastActivityDate="2016-09-09T19:19:51.933" Title="Problem with line number limit in linum-mode" Tags="|term|linum-mode|line-numbers|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2748" PostTypeId="2" ParentId="2747" CreationDate="2014-10-28T03:04:12.610" Score="12" Body="&lt;p&gt;Like most terminals, Emacs' &lt;code&gt;term&lt;/code&gt; has a scrollback limit -- which will naturally mess with the consistency of linum's counting, as lines will be deleted from the beginning of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;term-buffer-maximum-size&lt;/code&gt; variable controls this, and sure enough it has a default value of 2048.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So linum was telling you the truth: the terminal buffer was never more than 2049 lines long at any time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you customize this variable&lt;sup&gt;1&lt;/sup&gt; and set the default value to zero, Emacs will not delete lines in this way, so linum will remain accurate. Of course without this protection, a runaway -- or intentional -- process outputting vast amounts of data into the terminal may cause Emacs to eat up large amounts of memory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Failing that, I'd say don't use linum and term together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; Start here: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;term-buffer-maximum-size&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-10-28T03:20:18.117" LastActivityDate="2014-10-28T03:20:18.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2749" PostTypeId="1" AcceptedAnswerId="2753" CreationDate="2014-10-28T05:46:56.073" Score="4" ViewCount="283" Body="&lt;p&gt;I have a cool looking (at least for me) prompt for my bash shell. This mean that tramp hangs if I try to use sudo to open a file because my prompt looks like something unexpected to tramp. And I really don't like to deal with regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I was wondering how can I reset the prompt of my machine before using tramp!&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-10-29T07:46:17.897" Title="How can I reset the prompt of my machine before using tramp without having this setting being permanent?" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2750" PostTypeId="2" ParentId="2454" CreationDate="2014-10-28T08:32:07.977" Score="3" Body="&lt;p&gt;You can change &lt;code&gt;eldoc-idle-delay&lt;/code&gt; (default is 0.5) and &lt;code&gt;flycheck-display-errors-delay&lt;/code&gt; (default is 0.9). Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq eldoc-idle-delay 0.1&#xA;      flycheck-display-errors-delay 0.2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="716" LastActivityDate="2014-10-28T08:32:07.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2751" PostTypeId="1" AcceptedAnswerId="2752" CreationDate="2014-10-28T08:39:01.767" Score="0" ViewCount="113" Body="&lt;p&gt;I'm using the &quot;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/its-all-text/&quot; rel=&quot;nofollow&quot;&gt;It's all Text&quot; addon for Firefox&lt;/a&gt; so I can edit textarea's in Emacs. As I spend some time on a phpBB forum, I was wondering if there is an Emacs mode for phpBB with it's syntax of using &lt;code&gt;[tag]&lt;/code&gt; and &lt;code&gt;[/tag]&lt;/code&gt;. I'm mainly interested in syntax highlighting, so if no phpBB mode exists, is there something that comes close?&lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2014-10-28T08:52:11.157" Title="Is there a mode for phpBB?" Tags="|major-mode|font-lock|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2752" PostTypeId="2" ParentId="2751" CreationDate="2014-10-28T08:52:11.157" Score="4" Body="&lt;p&gt;There is &lt;a href=&quot;https://github.com/ejmr/bbcode-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;bbcode-mode&lt;/code&gt;&lt;/a&gt;.  After installing it (e.g. from melpa) add this to your configuration file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'bbcode-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are also &lt;a href=&quot;http://www.emacswiki.org/emacs/BbCode&quot; rel=&quot;nofollow&quot;&gt;other modes for BBCode&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-28T08:52:11.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2753" PostTypeId="2" ParentId="2749" CreationDate="2014-10-28T08:57:24.320" Score="6" Body="&lt;p&gt;You could change the &lt;code&gt;.bashrc&lt;/code&gt; such that it doesn't modify the prompt when the &lt;code&gt;TERM&lt;/code&gt; variable is set to &quot;dumb&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if test $TERM = &quot;dumb&quot;&#xA;   # leave the prompt alone&#xA;else&#xA;   # set up fancy prompt&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to the manual &lt;code&gt;TERM&lt;/code&gt; is governed by &lt;code&gt;tramp-terminal-type&lt;/code&gt;, which defaults to &lt;code&gt;dumb&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="690" LastEditDate="2014-10-29T07:46:17.897" LastActivityDate="2014-10-29T07:46:17.897" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2754" PostTypeId="1" AcceptedAnswerId="2756" CreationDate="2014-10-28T09:42:18.920" Score="6" ViewCount="536" Body="&lt;p&gt;I am trying to set &lt;code&gt;isearch-string&lt;/code&gt; from the command line. The purpose is to have a Perl script start Emacs with a given search string, and go directly to the first line of the string and enter search mode. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs +2 t.txt -l srep.el &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;code&gt;t.txt&lt;/code&gt; the text file to search in, for example here is a dummy file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a bb c&#xA;aa&#xA;aa bb c d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The Lisp file &lt;code&gt;srep.el&lt;/code&gt; (generated by the Perl script) sets the &lt;code&gt;isearch-string&lt;/code&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq isearch-string &quot;aa&quot;)&#xA;(isearch-search-and-update)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this does not work. I get a &lt;code&gt;wrong-type-argument&lt;/code&gt; error from the debugger.&#xA;I then modified &lt;code&gt;srep.el&lt;/code&gt; to :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-set-search-word()&#xA;  (interactive)&#xA;  (setq isearch-string &quot;aa&quot;))&#xA;&#xA;(add-hook 'isearch-mode-hook 'my-set-search-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works in the beginning. I can press &lt;code&gt;C-s&lt;/code&gt; to search for the string &lt;code&gt;aa&lt;/code&gt;, but if I try to escape &lt;code&gt;isearch-mode&lt;/code&gt; (press arrow up key for example) and do some editing and later try to search for another string (by pressing &lt;code&gt;C-s&lt;/code&gt; again) for example the string &lt;code&gt;b&lt;/code&gt;. I get error &lt;code&gt;Failing I-search&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to solve this by changing &lt;code&gt;srep.el&lt;/code&gt; to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-set-search-word()&#xA;  (interactive)&#xA;  (if *my-search-str-flag*&#xA;      (setq isearch-string &quot;aa&quot;)&#xA;    (setq *my-search-str-flag* nil)))&#xA;&#xA;(defun my-set-search-word()&#xA;  (interactive)&#xA;  (setq isearch-string &quot;aa&quot;))&#xA;&#xA;(defvar *my-search-str-flag* t)&#xA;(add-hook 'isearch-mode-hook 'my-set-search-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I still get same behavior. I am using Emacs 24.3 on Ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="25" LastEditDate="2015-05-10T15:38:25.580" LastActivityDate="2015-05-10T15:38:25.580" Title="Preset search isearch-string from command line" Tags="|search|invocation|command-line-arguments|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2755" PostTypeId="2" ParentId="2650" CreationDate="2014-10-28T10:05:02.747" Score="7" Body="&lt;p&gt;Actually, in this case where you are working with units, you might consider using &lt;a href=&quot;http://ctan.org/pkg/siunitx&quot; rel=&quot;noreferrer&quot;&gt;the &lt;code&gt;siunitx&lt;/code&gt; LaTeX package&lt;/a&gt;. After loading the package in your org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_+HEADER: \usepackage{siunitx} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can use &lt;code&gt;\SI{42}{m.s^{-1}}&lt;/code&gt; in your text. This will make sure that the spaces between quantity and unit are appropriate, e.g. not allowing line breaks between any of the components. Moreover, the &lt;code&gt;siunitx&lt;/code&gt; package also knows how to properly format numbers like &lt;code&gt;1.23e45&lt;/code&gt; as &lt;code&gt;1.23 \times 10^{45}&lt;/code&gt;, etc. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2014-10-28T10:05:02.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2756" PostTypeId="2" ParentId="2754" CreationDate="2014-10-28T11:22:00.173" Score="7" Body="&lt;p&gt;What I recommend you to try is to start Isearch first and then yank your word to the search string, effectively doing the same what you would do manually to add words in &lt;code&gt;isearch-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-search-word ()&#xA;  (interactive)&#xA;  (isearch-forward nil 1)&#xA;  (isearch-yank-string &quot;aa&quot;))&#xA;&#xA;(my-search-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you need to match word boundaries, then try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-search-word ()&#xA;  (interactive)&#xA;  (isearch-forward-word nil 1)&#xA;  (isearch-yank-string &quot;aa&quot;))&#xA;&#xA;(my-search-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="478" LastActivityDate="2014-10-28T11:22:00.173" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2757" PostTypeId="2" ParentId="2745" CreationDate="2014-10-28T12:39:52.460" Score="-1" Body="&lt;p&gt;W.r.t the empty line at the end, it looks like a plain bug, please report it with &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.  But for the first element, I'm not sure if it's a bug or a feature, so you might want to mention it in your bug report, but maybe the answer will be that it's just following the &quot;PEP-NNN&quot; convention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, you might be able to fix the first problem with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (set (make-local-variable 'paragraph-separate)&#xA;                 (concat paragraph-separate &quot;\\|^[ \t]*\&quot;\&quot;\&quot;[ \t]*$&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-28T12:39:52.460" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2758" PostTypeId="2" ParentId="2745" CreationDate="2014-10-28T13:32:25.063" Score="17" Body="&lt;p&gt;Customize &lt;code&gt;python-fill-docstring-style&lt;/code&gt; accordingly, presuming that you are using the built-in Python Mode in Emacs 24.4.  The default is &lt;code&gt;pep-257&lt;/code&gt;, which leads to the style you observed, i.e. no newline at the beginning and two newlines before the end of a docstring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change this variable to &lt;code&gt;symmetric&lt;/code&gt; or &lt;code&gt;django&lt;/code&gt; to have Python Mode obey your preferred style, i.e. a newline at the beginning of the docstring, and a newline before the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-fill-docstring-style 'django)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, set it via &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot;&gt;Directory Variables&lt;/a&gt;, to configure the docstring style individually per project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;symmetric&lt;/code&gt; and &lt;code&gt;django&lt;/code&gt; are different w.r.t. single-line docstrings.  The former puts the triple quotes on the same line if a docstring fits on one line, whereas the latter puts the triple quotes on separate lines in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at the &lt;a href=&quot;https://bruce-connor.github.io/emacs-online-documentation/Var%2Fpython-fill-docstring-style.html&quot;&gt;docstring of &lt;code&gt;python-fill-docstring-style&lt;/code&gt;&lt;/a&gt; to see all available options.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-28T13:32:25.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2759" PostTypeId="2" ParentId="2737" CreationDate="2014-10-28T15:40:08.913" Score="4" Body="&lt;p&gt;Unfortunately, &lt;code&gt;org-mode&lt;/code&gt; does not keep a data structure around that could be used to perform modifications that are then reflected directly in the table, so we have to slurp up the lines into a list, do some list processing, and then convert the resulting list back into text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general the approach is this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;compute the group sizes from information in &lt;code&gt;org-table-hlines&lt;/code&gt;; this variable holds the row numbers of horizontal lines&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;store the lines relating to each group in a list and put each group in a list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;| Doe, John...|&quot; &quot;| Doe, Jane...|&quot;)&#xA;  (&quot;| Foo, Pete...|&quot;)&#xA;  (&quot;| Bar, Mary...|&quot; &quot;| Quux, Mike...|&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;sort this list by the value of the &lt;code&gt;car&lt;/code&gt; of each item, getting something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;| Bar, Mary...|&quot; &quot;| Quux, Mike...|&quot;)&#xA;  (&quot;| Doe, John...|&quot; &quot;| Doe, Jane...|&quot;)&#xA;  (&quot;| Foo, Pete...|&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;then rebuild the table from this list by iterating over each group&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's something to get you started.  It's rather awkward, but it's just to illustrate the idea.  (&lt;code&gt;rows-by-group&lt;/code&gt; actually contains duplicates, so this is not completely correct.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-sort-lines ()&#xA;  (interactive)&#xA;  (org-table-recalculate 'iterate)&#xA;  (let* ((hlines org-table-hlines)&#xA;         (rows-by-group (let* ((xs (cdr (append hlines nil)))&#xA;                               (xs2 (mapcar #'1+ xs))&#xA;                               (ys (mapcar #'1- (cdr (copy-sequence xs)))))&#xA;                          (mapcar* #'list (setcdr (last xs2) xs2) ys)))&#xA;         ;; fetch rows and store as nested list&#xA;         (groups (mapcar (lambda (group)&#xA;                           (mapcar (lambda (row-id)&#xA;                                     (goto-line row-id)&#xA;                                     (beginning-of-line)&#xA;                                     (let ((beg (point)))&#xA;                                       (end-of-line)&#xA;                                       (buffer-substring beg (point))))&#xA;                                   group))&#xA;                           rows-by-group))&#xA;         ;; sort groups by first row&#xA;         (sorted (sort groups (lambda (a b)&#xA;                                (string-lessp (car a) (car b))))))&#xA;&#xA;    ;; remove existing table rows and rebuild from group list&#xA;    (goto-char (org-table-begin))&#xA;    (next-line 1)&#xA;    (kill-region (point) (org-table-end))&#xA;    (mapcar (lambda (group)&#xA;              (insert &quot;|---&quot;)(org-table-recalculate)(next-line)&#xA;              (mapcar (lambda (row)&#xA;                        (insert row)(newline)) group))&#xA;            sorted))&#xA;  (insert &quot;|---&quot;)&#xA;  (org-table-recalculate))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-10-28T16:54:54.163" LastActivityDate="2014-10-28T16:54:54.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2760" PostTypeId="2" ParentId="2700" CreationDate="2014-10-28T16:27:02.177" Score="4" Body="&lt;p&gt;Maybe something like this (tested briefly from buffer and agenda)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rasmus/remove-schedule ()&#xA;  &quot;Remove SCHEDULED-cookie is switching state to WAITING.&quot;&#xA;  (save-excursion&#xA;(and (equal (org-get-todo-state) &quot;WAITING&quot;)&#xA;     (org-get-scheduled-time (point))&#xA;     (when (search-forward-regexp org-scheduled-time-regexp nil t)&#xA;       (or (delete-region (match-beginning 0) (match-end 0)) t))&#xA;     (get-buffer &quot;*Org Agenda*&quot;)&#xA;     (with-current-buffer &quot;*Org Agenda*&quot;&#xA;       (org-agenda-redo)))))&#xA;&#xA;(add-hook 'org-after-todo-state-change-hook&#xA;     'rasmus/remove-schedule)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2014-10-28T16:27:02.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2761" PostTypeId="2" ParentId="2700" CreationDate="2014-10-28T16:38:15.570" Score="1" Body="&lt;p&gt;If you're doing this so that &lt;code&gt;WAITING&lt;/code&gt; items don't show up in the&#xA;agenda buffer, I'd like to suggest an alternative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define &lt;code&gt;WAITING&lt;/code&gt; to be a &lt;code&gt;DONE&lt;/code&gt;-type keyword. These can easily&#xA;be configured to not display in the agenda, even when they have a&#xA;schedule. You can do that globally with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords '((sequence &quot;TODO&quot; &quot;|&quot; &quot;WAITING&quot; &quot;DONE&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or on a per-file basis with this header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SEQ_TODO: TODO | WAITING DONE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, to have these items not display in the agenda, just make sure you set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-skip-scheduled-if-done t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Finally, if you occasionally need a &lt;code&gt;WAITING&lt;/code&gt; item to be displayed in&#xA;the agenda, set a &lt;code&gt;DEADLINE&lt;/code&gt; on it instead of a &lt;code&gt;SCHEDULE&lt;/code&gt;. The&#xA;display of deadlines is controlled by a different variable&#xA;(&lt;code&gt;org-agenda-skip-deadline-if-done&lt;/code&gt; ), so they will still display in the agenda.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-28T16:38:15.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2762" PostTypeId="1" AcceptedAnswerId="3752" CreationDate="2014-10-28T16:51:10.890" Score="11" ViewCount="2129" Body="&lt;p&gt;I have recently switched from &lt;code&gt;auto-complete-mode&lt;/code&gt; to &lt;code&gt;company-mode&lt;/code&gt; and I having fun. Recently I had to write some Emacs Lisp code. I start typing my function, completion candidates are shown, I press &lt;code&gt;F1&lt;/code&gt; and the documentation opens up in another buffer. I would like to &lt;em&gt;jump to the documentation buffer&lt;/em&gt;, but, as I type &lt;code&gt;C-x o&lt;/code&gt; it gets closed. Any hint?&lt;/p&gt;&#xA;" OwnerUserId="201" LastEditorUserId="201" LastEditDate="2014-11-20T14:38:52.967" LastActivityDate="2014-11-20T15:50:03.120" Title="Jump to documentation buffer with company-mode" Tags="|company-mode|documentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2763" PostTypeId="2" ParentId="2762" CreationDate="2014-10-28T17:33:04.267" Score="4" Body="&lt;p&gt;Author's comment on a page &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/68&quot; rel=&quot;nofollow noreferrer&quot;&gt;comparing company-mode to auto-complete&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;What happens when you press F1 in company mode&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It uses pop-to-window to display the help buffer, but hides it before the next command (unless that command is scroll-other-window or scroll-other-window-down).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Based on that, you can only scroll the documentation buffer, not jump to it.&lt;/p&gt;&#xA;&lt;p&gt;But, looking at the &lt;a href=&quot;https://github.com/company-mode/company-mode/blob/master/company.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;code&lt;/a&gt; for &lt;code&gt;company-show-doc-buffer&lt;/code&gt;, I noticed that it uses &lt;code&gt;company--electric-do&lt;/code&gt;, which will call interactively any commands in &lt;code&gt;company--electric-commands&lt;/code&gt;. Normally, it contains only &lt;code&gt;scroll-other-window&lt;/code&gt; and &lt;code&gt;scroll-other-window-down&lt;/code&gt;, but maybe you can add &lt;code&gt;other-window&lt;/code&gt; to that list.&lt;/p&gt;&#xA;" OwnerUserId="2290" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-28T17:44:34.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2764" PostTypeId="1" AcceptedAnswerId="2765" CreationDate="2014-10-28T17:47:27.630" Score="3" ViewCount="414" Body="&lt;p&gt;I wanted an alternative to the awful &lt;code&gt;C-^&lt;/code&gt; shortcut for moving up one directory so I added the following to &lt;code&gt;init&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun dc/dired-mode-keys ()&#xA;   &quot;User defined keys for dired mode.&quot;&#xA;   (interactive)&#xA;   (local-set-key (kbd &quot;s-m&quot; 'dired-up-directory)))&#xA; (add-hook 'dired-mode-hook 'dc/dired-mode-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I open Emacs with this code enabled (i.e., uncommented in the init file), I lose basic dired functionality.  For example, when I press &lt;code&gt;a&lt;/code&gt; to open a directory (in the same buffer), I get the following error in the mini-buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong number of arguments: (1 . 1), 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've confirmed that &lt;code&gt;s-m&lt;/code&gt; is not a native key-binding in &lt;code&gt;dired-mode&lt;/code&gt; (I believe very few if any &lt;code&gt;super&lt;/code&gt; key combos are natively bound), and I'm pretty sure my code doesn't unbind any of the native key-bindings in dired-mode.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong in the function above?&lt;/p&gt;&#xA;" OwnerUserId="2084" LastActivityDate="2014-10-28T17:49:42.993" Title="Elisp: Added one key-binding to dired-mode and lost basic dired functionality" Tags="|dired|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2765" PostTypeId="2" ParentId="2764" CreationDate="2014-10-28T17:49:42.993" Score="6" Body="&lt;p&gt;The &quot;wrong number of arguments&quot; error comes from the &lt;code&gt;kbd&lt;/code&gt; inside &lt;code&gt;dc/dired-mode-keys&lt;/code&gt;. Your parentheses are nested incorrectly, so you pass 2 arguments to &lt;code&gt;kbd&lt;/code&gt;, but it expects only 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key (kbd &quot;s-m&quot;) 'dired-up-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-10-28T17:49:42.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2766" PostTypeId="1" AcceptedAnswerId="2768" CreationDate="2014-10-28T18:42:31.373" Score="10" ViewCount="1309" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; What practical reasons are there &lt;em&gt;not&lt;/em&gt; to set &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A recently-revived thread on &lt;a href=&quot;https://emacs.stackexchange.com/questions/475/recognizing-sentences-that-dont-end-in-two-spaces&quot;&gt;recognizing sentences that don't end in two spaces&lt;/a&gt; inspired this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Sentences.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs manual node on sentences&lt;/a&gt; notes that the sentence commands assume that we use the American typist's convention of putting two spaces at the end of a sentence (as opposed to, say, the French convention of one space).  Arguments for/against the two-space convention apparently gets pretty polemical (eg, &lt;a href=&quot;http://www.slate.com/articles/technology/technology/2011/01/space_invaders.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this Slate piece&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't particularly care about looks insofar as I let LaTeX handle my type-setting, but the two-space convention is pounded into muscle memory.  However, when I paste text into an Emacs buffer from other sources (webpages, etc.), it's almost always in the one-space convention.  That's kind of annoying in a how-dare-they-differ-from-me sort of way, and I'm tempted to set &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; to Deal With Reality.  I never have, however, because I've always assumed that Something Will Break if I did so.  I just don't have any firm basis for that assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: are there any practical consequences in terms of loss of functionality for setting &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;?  The only significant change I can think of is that the fill functions will change the two-space convention into the one-space convention.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-10-28T21:01:25.217" Title="Any functionality differences using a two-space vs one-space convention at the end of a sentence?" Tags="|sentences|typography|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2767" PostTypeId="1" AcceptedAnswerId="2773" CreationDate="2014-10-28T19:05:40.770" Score="6" ViewCount="872" Body="&lt;p&gt;I am using Emacs24, and my auto-complete plugin was working when I opened my &lt;code&gt;.emacs&lt;/code&gt; file. However, it doesn't work when I open some file like : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;whatever.c&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add to this, the auto-complete-c-headers do not work. I believe that auto-complete doesn't work on c/c++ mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/elpa/neotree&quot;)&#xA;(require 'neotree)&#xA;(global-set-key [f8] 'neotree-toggle)&#xA;&#xA;(defun my:ac-c-header-init()&#xA;    (require 'auto-complete-c-headers)&#xA;    (add-to-list 'ac-sources 'ac-source-c-header))&#xA;(add-hook 'c++-mode-hook 'my:a-c-header-init)&#xA;(add-hook 'c-mode-hook 'my:ac-c-header-init)&#xA;&#xA;(require 'cc-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.h\\'&quot; . c++-mode))&#xA;&#xA;(setq-default c-basic-offset 2 c-default-style &quot;linux&quot;)&#xA;(setq-default tab-width 2 indent-tabs-mode t)&#xA;(define-key c-mode-base-map (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;&#xA;(add-to-list 'load-path&#xA;              &quot;~/.emacs.d/plugins/yasnippet&quot;)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa&quot;)&#xA;(require 'linum)&#xA;(global-linum-mode 1)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/auto-complete-1.3.1&quot;)&#xA;(require 'auto-complete)&#xA;(require 'auto-complete-config)&#xA;(define-globalized-minor-mode real-global-auto-complete-mode&#xA;  auto-complete-mode (lambda ()&#xA;                       (if (not (minibufferp (current-buffer)))&#xA;                         (auto-complete-mode 1))&#xA;                       ))&#xA;(real-global-auto-complete-mode t)&#xA;(ac-config-default)&#xA;(ac-set-trigger-key &quot;TAB&quot;)&#xA;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="50" LastEditDate="2014-11-16T13:21:05.767" LastActivityDate="2014-11-16T13:21:05.767" Title="Auto-Complete stops working with C files" Tags="|completion|yasnippet|auto-complete-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2768" PostTypeId="2" ParentId="2766" CreationDate="2014-10-28T19:06:39.457" Score="10" Body="&lt;p&gt;The only consequence I'm seeing, is the ability to recognize periods from abbreviations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As stated by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Sentences.html&quot; rel=&quot;noreferrer&quot;&gt;gnu.org&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you want to use just one space between sentences, you can set the&#xA;  variable &lt;code&gt;sentence-end-double-space&lt;/code&gt; to nil to make the sentence&#xA;  commands stop for single spaces. However, this has a drawback: there&#xA;  is no way to distinguish between &lt;em&gt;periods that end sentences&lt;/em&gt; and&#xA;  &lt;em&gt;those that indicate abbreviations&lt;/em&gt;. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For convenient and reliable editing, we therefore recommend you follow&#xA;  the two-space convention. The variable &lt;code&gt;sentence-end-double-space&lt;/code&gt; also&#xA;  affects&#xA;  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Fill-Commands.html#Fill-Commands&quot; rel=&quot;noreferrer&quot;&gt;filling&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've never used the two-space convention, I think, it depends on how/what you are editing.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="7" LastEditDate="2014-10-28T19:11:47.847" LastActivityDate="2014-10-28T19:11:47.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2769" PostTypeId="1" AcceptedAnswerId="2781" CreationDate="2014-10-28T19:59:41.230" Score="9" ViewCount="897" Body="&lt;p&gt;When I run the command &lt;code&gt;LaTeX-environment&lt;/code&gt; (bound to &lt;code&gt;C-c C-e&lt;/code&gt; by default) Helm properly selects from a list of all relevant environments (i.e. the same list I'd get without Helm turned on). The prompt reads &quot;Environment type: (default foo)&quot; where 'foo' is the value stored in &lt;code&gt;LaTeX-default-environment&lt;/code&gt; (which is in turn set to whatever I ended up using in the last call to &lt;code&gt;LaTeX-environment&lt;/code&gt;). If I hit return now, however, I get an 'abstract' environment, the first entry in the Helm buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get Helm to respect &lt;code&gt;LaTeX-default-environment&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="313" LastActivityDate="2014-10-28T23:20:37.880" Title="Helm and LaTeX mode" Tags="|helm|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2770" PostTypeId="1" CreationDate="2014-10-28T20:45:37.587" Score="3" ViewCount="354" Body="&lt;p&gt;It looks as if the promotion and demotion of headers using &lt;kbd&gt;M-Right&lt;/kbd&gt;, &lt;kbd&gt;M-S-Right&lt;/kbd&gt;, &lt;kbd&gt;M-Left&lt;/kbd&gt;, &lt;kbd&gt;M-S-Left&lt;/kbd&gt; is disabled in &lt;code&gt;orgstruct-mode&lt;/code&gt; as per &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg00560.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this emacs-orgmode GNU thread&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, making direct function calls like &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;orgstruct-hijacker-org-metaright&lt;/code&gt; do nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a patch that enables that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I can't have &lt;code&gt;orgstruct-heading-prefix-regexp&lt;/code&gt; as &lt;code&gt;nil&lt;/code&gt;; &lt;strong&gt;I need to set it at least to the comment characters of the major mode in which I am using orgstruct.&lt;/strong&gt; And I am not planning on using block commenting for each orgstruct heading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case I am setting this var to &lt;code&gt;//;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also curious... why would anyone not use the org mode directly if they are able to use orgstruct with this variable set to &lt;code&gt;nil&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorDisplayName="user8748" LastEditDate="2019-01-26T20:28:45.633" LastActivityDate="2019-01-26T20:28:45.633" Title="Promoting and demoting headers in orgstruct mode" Tags="|org-mode|header-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2771" PostTypeId="2" ParentId="2766" CreationDate="2014-10-28T21:01:25.217" Score="3" Body="&lt;p&gt;This is not really an answer to the question as stated (&quot;what do I lose if I set &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;&quot;), but rather something like the &lt;a href=&quot;http://www.xkcd.com/1285/&quot; rel=&quot;nofollow&quot;&gt;third way&lt;/a&gt;;-).  (Also, it is a (partial) copy from a &lt;a href=&quot;http://mbork.pl/2014-10-28_Single_vs_double_spaces&quot; rel=&quot;nofollow&quot;&gt;post I've just written on my blog&lt;/a&gt;; if this is inappropriate, someone please delete this, but I hope this might be helpful.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, basically, why do you want to &lt;em&gt;lose&lt;/em&gt; anything by setting something against your liking?  This is Emacs, after all!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar sentence-end-double-space-threshold 2&#xA;  &quot;How many occurrences of \&quot;.  \&quot; per kilobyte should be enough&#xA;  to declare this file as using two spaces after sentences.&quot;)&#xA;&#xA;(defun set-sentence-end-double-space ()&#xA;  &quot;Set `sentence-end-double-space' according to how often the&#xA;  literal string \&quot;.  \&quot; occurs in the current buffer.&quot;&#xA;  (make-local-variable 'sentence-end-double-space)&#xA;  (if (&amp;gt;= (* (count-matches &quot;\\.  &quot;) 1024)&#xA;      (* (buffer-size) sentence-end-double-space-threshold))&#xA;      (setq sentence-end-double-space t)&#xA;    (setq sentence-end-double-space nil)))&#xA;&#xA;(add-hook 'find-file-hook 'set-sentence-end-double-space)     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when you open a file, Emacs decides (using the very conservative value of &lt;code&gt;sentence-end-double-space-threshold&lt;/code&gt;, which you can &lt;code&gt;setq&lt;/code&gt; to whatever you feel right) which style it is. (Obviously, this does not help in case of pasting from the browser or whatever. It could be done, advising &lt;code&gt;yank&lt;/code&gt; and – if needed – replacing spaces in the yanked text as necessary, but hey, I only had 15 minutes for that!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. Of course, it does not take into account periods at EOLs etc.; but again, the threshold is very low.&lt;/p&gt;&#xA;" OwnerUserId="642" LastActivityDate="2014-10-28T21:01:25.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2772" PostTypeId="2" ParentId="2586" CreationDate="2014-10-28T21:29:50.957" Score="1" Body="&lt;p&gt;I finally found out what was wrong. I simply re-wrote the makefile, which was initially written on my Macbook, on a different Computer. Flymake is now working correctly. I guess there was a problem with the character encoding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I forgot to mention that I renamed it from &lt;code&gt;makefile&lt;/code&gt; to &lt;code&gt;Makefile&lt;/code&gt;. I tried renaming it back and the same error message came up. So I reverted it again to &lt;code&gt;Makefile&lt;/code&gt; and flymake works. Very strange.&lt;/p&gt;&#xA;" OwnerUserId="2157" LastEditorUserId="2157" LastEditDate="2014-10-29T21:11:56.410" LastActivityDate="2014-10-29T21:11:56.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2773" PostTypeId="2" ParentId="2767" CreationDate="2014-10-28T21:36:26.277" Score="7" Body="&lt;p&gt;I added the following code to solve most of my problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ac-source-yasnippet nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, it caused complexity between yasnippet and auto-complete so I added this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;backtab&amp;gt;&quot;) 'yas-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Modified some keys: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ac-set-trigger-key &quot;TAB&quot;)&#xA;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And solved all of my problems.&lt;/p&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="45" LastEditDate="2014-10-28T21:48:29.003" LastActivityDate="2014-10-28T21:48:29.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2774" PostTypeId="1" AcceptedAnswerId="2808" CreationDate="2014-10-28T21:37:39.457" Score="12" ViewCount="3216" Body="&lt;p&gt;I would like to have an org-mode file with the following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: My awesome Emacs file&#xA;&#xA;* My Header&#xA;Here's some information under the header&#xA;&#xA;#+BEGIN_SRC sh&#xA;echo &quot;this is some code&quot;&#xA;#+END_SRC&#xA;&#xA;More text and =verbatim= things&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have Emacs display the header and text in a variable-width font and only the &lt;code&gt;#+BEGIN_SRC&lt;/code&gt;, &lt;code&gt;#+END_SRC&lt;/code&gt;, &lt;code&gt;=verbatim=&lt;/code&gt; and source code in a fixed-width font?&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2020-06-08T16:42:48.967" Title="Using both fixed-width and variable-width font in org-mode" Tags="|org-mode|fonts|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2775" PostTypeId="5" CreationDate="2014-10-28T21:40:13.047" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-28T21:40:13.047" LastActivityDate="2014-10-28T21:40:13.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2776" PostTypeId="4" CreationDate="2014-10-28T21:40:13.047" Score="0" Body="Flyspell enables on-the-fly spell checking in Emacs by the means of a minor mode (called Flyspell). " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-28T22:40:18.713" LastActivityDate="2014-10-28T22:40:18.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2777" PostTypeId="1" AcceptedAnswerId="2786" CreationDate="2014-10-28T22:52:07.173" Score="3" ViewCount="2340" Body="&lt;p&gt;I'm already used to press &lt;kbd&gt;C-h f&lt;/kbd&gt; and type a function name to ask for help on that function. But if the function name is already under the cursor (e.g. while visiting the .emacs configuration file), is there a way to avoid typing the whole thing again?  &lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2020-12-21T21:58:36.797" Title="How to get the function help without typing?" Tags="|help|functions|" AnswerCount="7" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2778" PostTypeId="2" ParentId="2777" CreationDate="2014-10-28T23:03:26.133" Score="12" Body="&lt;p&gt;From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Name-Help.html&quot;&gt;gnu.org&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you type &lt;code&gt;C-h f &amp;lt;RET&amp;gt;&lt;/code&gt;, it describes the function called by the&#xA;  innermost Lisp expression in the buffer around point, provided that&#xA;  function name is a valid, defined Lisp function. (That name appears as&#xA;  the default while you enter the argument.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7" LastEditorUserId="7" LastEditDate="2014-10-28T23:08:29.157" LastActivityDate="2014-10-28T23:08:29.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2779" PostTypeId="2" ParentId="2777" CreationDate="2014-10-28T23:06:00.270" Score="6" Body="&lt;p&gt;Just hitting RET should be enough. Alternatively, try the following snippet to define a function that describes the function at point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-describe-function-at-point ()&#xA;  (interactive)&#xA;  (describe-function (function-called-at-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="306" LastEditDate="2014-10-29T00:29:40.210" LastActivityDate="2014-10-29T00:29:40.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2780" PostTypeId="2" ParentId="2777" CreationDate="2014-10-28T23:08:04.260" Score="3" Body="&lt;p&gt;As Sean Alfred commented above, the default for &lt;kbd&gt;C-h f&lt;/kbd&gt; is to already preselect the function at point as the default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you could also use &lt;code&gt;helm-apropos&lt;/code&gt; which is part of the standard &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;helm&lt;/a&gt; package (available from package repositories, e.g. from MELPA).&#xA;Helm apropos will preselect the function under the cursor, and I find it one of the nicest tool to locate documentation.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="2025" LastEditDate="2014-10-28T23:14:52.833" LastActivityDate="2014-10-28T23:14:52.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2781" PostTypeId="2" ParentId="2769" CreationDate="2014-10-28T23:20:37.880" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/207&quot;&gt;You cannot&lt;/a&gt;. According to &lt;code&gt;helm&lt;/code&gt;'s author it is AUCTEX' fault for not using &lt;code&gt;completing-read&lt;/code&gt; correctly which makes &lt;code&gt;helm-mode&lt;/code&gt; return the candidate verbatim. A possible workaround is described in the linked thread which is either making AUCTEX' authors fix the bug for every instance of &lt;code&gt;completing-read&lt;/code&gt; or patching it yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do the latter, the following should work (untested, most code taken from AUCTEX):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'latex&#xA;  '(defun LaTeX-environment (arg)&#xA;      (interactive &quot;*P&quot;)&#xA;      (let ((environment (completing-read (concat &quot;Environment type: (default &quot;&#xA;                                                  (if (TeX-near-bobp)&#xA;                                                      &quot;document&quot;&#xA;                                                    LaTeX-default-environment)&#xA;                                                  &quot;) &quot;)&#xA;                                          (LaTeX-environment-list) nil t nil&#xA;                                          'LaTeX-environment-history LaTeX-default-environment)))&#xA;        ;; Get default&#xA;        (cond ((and (zerop (length environment))&#xA;                    (TeX-near-bobp))&#xA;               (setq environment &quot;document&quot;))&#xA;              ((zerop (length environment))&#xA;               (setq environment LaTeX-default-environment))&#xA;              (t&#xA;               (setq LaTeX-default-environment environment)))&#xA;&#xA;        (let ((entry (assoc environment (LaTeX-environment-list))))&#xA;          (if (null entry)&#xA;              (LaTeX-add-environments (list environment)))&#xA;&#xA;          (if arg&#xA;              (LaTeX-modify-environment environment)&#xA;            (LaTeX-environment-menu environment))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-10-28T23:20:37.880" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2782" PostTypeId="5" CreationDate="2014-10-28T23:24:49.207" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-28T23:24:49.207" LastActivityDate="2014-10-28T23:24:49.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2783" PostTypeId="4" CreationDate="2014-10-28T23:24:49.207" Score="0" Body="YASnippet is a template system for Emacs. It allows you to type an abbreviation and automatically expand it into function templates. Bundled language templates includes: C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, CSS and more." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-29T08:44:07.813" LastActivityDate="2014-10-29T08:44:07.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2784" PostTypeId="2" ParentId="2777" CreationDate="2014-10-29T00:01:52.623" Score="3" Body="&lt;p&gt;In addition to what others have said, if you use library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/help-fns%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; then the defaulting is a bit better - the cursor needs only to be near the symbol (e.g. function name) that you want to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The vanilla Emacs behavior picks up only the symbol used for the function call surrounding the cursor, even if the cursor is on top of another function name that you want to investigate. Not too good for a language that passes functions around as arguments etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also &lt;a href=&quot;http://www.emacswiki.org/HelpPlus&quot; rel=&quot;nofollow&quot;&gt;other enhancements&lt;/a&gt; to the Emacs help functions in &lt;code&gt;help-fns+.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-29T00:01:52.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2785" PostTypeId="2" ParentId="271" CreationDate="2014-10-29T01:58:10.370" Score="26" Body="&lt;p&gt;A few factual corrections about Aquamacs.   While it maintains its own source tree, it is very regularly merged with Emacs, and pretty much immediately so with every Emacs release.   Aquamacs 3.1 came out the day Emacs 24.4 was released (and it incorporated all of Emacs 24.4 features and a subset of its bugs).  Aquamacs has &gt;10k regular users, is actively supported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs Mac Port originated much later than the Cocoa and Nextstep port in Emacs; it is considered experimental and the original author advises against redistribution outside of his patch set.  As such, support will be much more limited than for any of the other solutions.  It is an interesting line of development, however, that will eventually provide much value to the community if adopted by developers.  Users should consider themselves &quot;beta testers&quot;, though, and contribute back what they can with good bug reports and patches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of Aquamacs lies in its &quot;ready to roll&quot; philosophy: LaTeX, EmacsSpeaksStatistics, and Mac integration work out of the box.  No complex configuration needed.&lt;/p&gt;&#xA;" OwnerUserId="2310" LastEditorUserId="2310" LastEditDate="2017-04-27T11:23:38.680" LastActivityDate="2017-04-27T11:23:38.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2786" PostTypeId="2" ParentId="2777" CreationDate="2014-10-29T03:23:42.527" Score="2" Body="&lt;p&gt;My current favorite reference defun (requires &lt;a href=&quot;https://github.com/auto-complete/popup-el&quot; rel=&quot;nofollow&quot;&gt;popup.el&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(require 'popup)&#xA;&#xA;(defun describe-thing-in-popup ()&#xA;  (interactive)&#xA;  (let* ((thing (symbol-at-point))&#xA;         (help-xref-following t)&#xA;         (description (save-window-excursion&#xA;                        (with-temp-buffer&#xA;                          (help-mode)&#xA;                          (help-xref-interned thing)&#xA;                          (buffer-string)))))&#xA;    (popup-tip description&#xA;               :point (point)&#xA;               :around t&#xA;               :height 20&#xA;               :scroll-bar t&#xA;               :margin t)))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use that with your key binding of choice for unobtrusive help reference for &lt;code&gt;symbol-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2014-10-29T03:23:42.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2787" PostTypeId="2" ParentId="2774" CreationDate="2014-10-29T07:19:48.563" Score="1" Body="&lt;p&gt;I'm not very familiar with how &lt;code&gt;org-mode&lt;/code&gt; delimits blocks, so I can only give a general answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a standard face called &lt;code&gt;variable-pitch&lt;/code&gt;, which you can apply to a given region like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-text-properties (region-beginning) (region-end) '(face (variable-pitch))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This only works when automatic fontification is inhibited, though.  You may be able to hook into &lt;code&gt;org-mode&lt;/code&gt;'s fontification code and override the face of selected regions with &lt;code&gt;variable-pitch&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-29T07:19:48.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2788" PostTypeId="2" ParentId="2777" CreationDate="2014-10-29T08:21:28.820" Score="1" Body="&lt;p&gt;I get Elisp documentation with &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow noreferrer&quot;&gt;lispy&lt;/a&gt;.&#xA;There, &lt;kbd&gt;C-1&lt;/kbd&gt; toggles the inline doc for current function.&#xA;Here's how it looks:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qLEKy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qLEKy.png&quot; alt=&quot;image&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the docstring is very large, &lt;code&gt;*Help*&lt;/code&gt; window is used instead.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="14920" LastEditDate="2020-12-21T21:58:36.797" LastActivityDate="2020-12-21T21:58:36.797" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2789" PostTypeId="2" ParentId="2770" CreationDate="2014-10-29T08:51:34.350" Score="1" Body="&lt;p&gt;A little later in that &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2013-03/msg00740.html&quot; rel=&quot;nofollow&quot;&gt;same thread&lt;/a&gt;, its a bit confusing but there is a commit that solves this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 03b1edf org.el: Disable {pro,de}motion commands in orgstruct-mode if &#xA;orgstruct-heading-prefix-regexp is non-nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which isn't entirely true. Setting &lt;code&gt;orgstruct-heading-prefix-regexp&lt;/code&gt; to nil did not enable Pro/Demotion but setting it to an empty string did.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evalute the following in a buffer to allow promotion/demotion of headers in an orgstruct-mode buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq orgstruct-heading-prefix-regexp &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have confirmed this on emacs-24.4 with the latest org-mode from melpa&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="294" LastActivityDate="2014-10-29T08:51:34.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2790" PostTypeId="2" ParentId="2720" CreationDate="2014-10-29T09:16:41.153" Score="7" Body="&lt;p&gt;I don't usually try to explain tools I use to other people, unless they made an explicit request as to how they could improve their workflow.  I don't see a benefit in converting people to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, when people in IT who don't use Emacs but are quite familiar with a web browser ask me why I would use something as &quot;bloated&quot; as Emacs for text editing, I usually describe it as a platform for anything that can &quot;reasonably&quot; (this is up for interpretation) be mapped to buffers of text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A text buffer could be the trail of a shell session (&lt;code&gt;shell-mode&lt;/code&gt;), an email (&lt;code&gt;message-mode&lt;/code&gt;), a TODO list (&lt;code&gt;org-mode&lt;/code&gt;), a directory listing (&lt;code&gt;dired&lt;/code&gt;), a text file on disk, a web page (&lt;code&gt;eww&lt;/code&gt;), the output produced by an external command, etc.  Just like a modern web browser represents an environment in which a programming language can be used to manipulate and interact with HTML documents, Emacs is an environment for text buffers with a language that can be used to manipulate and interact with text buffers.  It is my main user agent, much like the browser is the main user agent for documents and applications on the web to many people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Understanding Emacs as a generic tool providing a text interface (one of which may be an editor) usually clears up any confusion (or at least reduces mockery).  I would not explain Emacs to people who do not understand their web browsers, which is my interpretation of &quot;non-technical&quot;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-29T09:16:41.153" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2791" PostTypeId="2" ParentId="2720" CreationDate="2014-10-29T09:41:41.177" Score="2" Body="&lt;p&gt;I would redirect this person to the &lt;a href=&quot;https://tuhdo.github.io/emacs-tutor.html#sec-11&quot; rel=&quot;nofollow&quot;&gt;place&lt;/a&gt; where experienced users explain clearly why they are using emacs. Then, I would invite them to have a look at this same page to have a visual outlook of what can be&#xA;accomplished with emacs.&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2014-10-29T09:41:41.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2792" PostTypeId="2" ParentId="2711" CreationDate="2014-10-29T11:25:58.463" Score="3" Body="&lt;p&gt;You could write a function that copies the subtree to the kill ring, creates a new buffer in &lt;code&gt;message-mode&lt;/code&gt;, inserts a couple of lines and pastes the contents of the kill ring, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-status-as-email ()&#xA;  (interactive)&#xA;&#xA;  ;; TODO: copy org subtree to kill ring&#xA;  ;; ...&#xA;&#xA;  (set-buffer (get-buffer-create &quot;*draft*&quot;))&#xA;  (message-mode)&#xA;  (insert &quot;From: me\n&quot;)&#xA;  (insert &quot;To: you\n&quot;)&#xA;  (insert &quot;Subject: my status\n&quot;)&#xA;  (insert &quot;--text follows this line--\n&quot;)&#xA;  (yank)&#xA;  (pop-to-buffer-same-window (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively and more elegantly, use &lt;code&gt;compose-mail&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (compose-mail &quot;receiver@localhost.net&quot; &quot;my subject&quot;)&#xA;  (insert &quot;my awesome summary:&quot;)&#xA;  (yank)&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-11-11T22:18:10.673" LastActivityDate="2014-11-11T22:18:10.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2793" PostTypeId="1" AcceptedAnswerId="2801" CreationDate="2014-10-29T12:25:28.580" Score="11" ViewCount="1943" Body="&lt;p&gt;I was about to post the question but then I saw &lt;a href=&quot;https://stackoverflow.com/q/14495344/1836949&quot;&gt;it on Stack Overflow&lt;/a&gt; while searching for auto-correct possibilities. The linked question has no answers, so I thought it'd have more luck on this site. Here's the text:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I wish there were a way so that when I mistype a word, flyspell could autocorrect it to the &amp;quot;most likely&amp;quot; correction. When I mistype a word and then hit OPTION-TAB to correct it, flyspell ALMOST ALWAYS picks the correct correction by default as the main suggestion.&lt;/p&gt;&#xA;&lt;p&gt;However, I want flyspell to do this with every word I mistype, WITHOUT my having to hit OPTION-TAB. Just from hitting the SPACE bar and moving on to the next word.&lt;/p&gt;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So basically something like auto-correct on mobile phones. Such a feature would be useful to have for modes like &lt;code&gt;jabber&lt;/code&gt; and &lt;code&gt;capture&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;I'd rather have this feature as a separate minor mode than overwriting the default fly-spell functionality. It could be activated in addition or instead of fly-spell when needed&lt;/p&gt;&#xA;" OwnerUserId="969" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-03-07T16:14:14.363" Title="Is it possible to auto-correct spelling “on space”?" Tags="|flyspell|abbrev|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2794" PostTypeId="2" ParentId="2793" CreationDate="2014-10-29T12:31:55.007" Score="2" Body="&lt;p&gt;Here's a simple attempt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-flyspell-correct-on-space ()&#xA;  (interactive)&#xA;  (when flyspell-mode&#xA;    (flyspell-auto-correct-word))&#xA;  (self-insert-command 1))&#xA;(local-set-key &quot; &quot; 'my-flyspell-correct-on-space)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It behaves strangely when you insert more than one space in a row, and sometimes it splits off part of the word being corrected.  Thus this post is community wiki; feel free to improve it.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-10-29T12:31:55.007" CommentCount="1" CommunityOwnedDate="2014-10-29T12:31:55.007" ContentLicense="CC BY-SA 3.0" />
  <row Id="2795" PostTypeId="1" AcceptedAnswerId="2803" CreationDate="2014-10-29T13:12:23.630" Score="5" ViewCount="69" Body="&lt;p&gt;I'm planning to move StackMode to a literate program once it matures, but until then I'm using the conventional &lt;code&gt;^L&lt;/code&gt; section markers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My files look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Code:&#xA;&#xA;^L&#xA;;;; Section 1 Title&#xA;&#xA;(defun code () things)&#xA;&#xA;^L&#xA;;;; Section 2 Title&#xA;&#xA;(defun bleh () bergh)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to add a hook that creates a table of contents at some marker, say &lt;code&gt;^;;; Contents:$&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Contents:&#xA;&#xA;;;;  1. Section 1 Title&#xA;;;;  2. Section 2 Title&#xA;&#xA;;;; Code:&#xA;&#xA;^L&#xA;;;; Section 1 Title&#xA;&#xA;(defun code () things)&#xA;&#xA;^L&#xA;;;; Section 2 Title&#xA;&#xA;(defun bleh () bergh)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For extra fun, subsections could be repeated linefeed characters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^L^L&#xA;;;; Subsection&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-10-29T15:45:21.320" Title="How can I create an function to build a table of contents at a marker?" Tags="|functions|automation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2796" PostTypeId="1" AcceptedAnswerId="2802" CreationDate="2014-10-29T14:51:11.160" Score="5" ViewCount="996" Body="&lt;p&gt;In an &lt;code&gt;org&lt;/code&gt; file, is it possible to customize the task sequence by category? For instance, if I have a meeting, I would like to have it evolving through the states &lt;code&gt;TODO&lt;/code&gt; and &lt;code&gt;DONE&lt;/code&gt;, while if I'm tracking my progress on a MOOC, I may want to have &lt;code&gt;TODO&lt;/code&gt;, &lt;code&gt;STARTED&lt;/code&gt;, &lt;code&gt;SUSPENDED&lt;/code&gt;, &lt;code&gt;COMPLETE&lt;/code&gt;. Any hint?&lt;/p&gt;&#xA;" OwnerUserId="201" LastActivityDate="2014-10-29T18:47:53.700" Title="org-mode: task sequence by categories" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2797" PostTypeId="1" CreationDate="2014-10-29T14:58:02.200" Score="35" ViewCount="51518" Body="&lt;p&gt;I've installed the solarized theme package via MELPA. I can select one of the two solarized themes via `customize-theme and it activates it. When I save the theme settings it adds the following to my init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(custom-enabled-themes (quote (solarized-dark)))&#xA; '(custom-safe-themes&#xA;   (quote&#xA;    (&quot;8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4&quot; default))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I launch Emacs it doesn't load the theme but I don't get an error message either. In fact running &lt;code&gt;eval-buffer&lt;/code&gt; in the init.el file loads the theme. &lt;/p&gt;&#xA;" OwnerUserId="2312" LastActivityDate="2022-06-14T15:56:56.320" Title="Emacs won't load theme on startup" Tags="|init-file|themes|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2798" PostTypeId="2" ParentId="2797" CreationDate="2014-10-29T15:11:35.607" Score="32" Body="&lt;p&gt;add to your init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'solarized-dark t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can ignore stuff emacs added there, just delete it.&lt;/p&gt;&#xA;" OwnerUserId="98" LastActivityDate="2014-10-29T15:11:35.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2799" PostTypeId="1" AcceptedAnswerId="2804" CreationDate="2014-10-29T15:16:43.520" Score="5" ViewCount="555" Body="&lt;p&gt;I used to read my emails from command line with &lt;code&gt;emacs -f gnus&lt;/code&gt;. To read my emails using emacsclient, I'm doing &lt;code&gt;emacsclient -c --eval '(gnus)'&lt;/code&gt;. Just want to know, is there a simpler alternative to that? Something that will be closer to &lt;code&gt;emacs -f gnus&lt;/code&gt;? In fact, what is the proper way to call an emacs functions from command line using emacsclient?&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-10-29T15:47:45.140" Title="function calls from command line, using emacsclient" Tags="|emacsclient|functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2800" PostTypeId="2" ParentId="2796" CreationDate="2014-10-29T15:22:22.523" Score="3" Body="&lt;p&gt;You can split your tasks across files and then at the top of each file add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TODO: TODO(t) STARTED(s) REVIEW(r) LIST(l) PULL(p) | DONE(d) CANCELED(c) UPSTREAM(u)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-10-29T15:22:22.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2801" PostTypeId="2" ParentId="2793" CreationDate="2014-10-29T15:43:31.197" Score="6" Body="&lt;p&gt;Let me refer you to &lt;a href=&quot;http://endlessparentheses.com/ispell-and-abbrev-the-perfect-auto-correct.html&quot;&gt;my post on this&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've found that abbrevs are the best way to do correction on &lt;code&gt;SPC&lt;/code&gt;,&#xA;you only need to define the corrections that you want. For that, I&#xA;take the following approach:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Add the code below to your init file.&lt;/li&gt;&#xA;&lt;li&gt;Whever you type something wrong, hit &lt;code&gt;C-x C-i&lt;/code&gt; and choose one of the corrections offered.&lt;/li&gt;&#xA;&lt;li&gt;That's it! The correction will be automatically replaced there, and&#xA;will automatically be performed every time you make this mistake&#xA;from now on.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's the code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ctl-x-map &quot;\C-i&quot; 'endless/ispell-word-then-abbrev)&#xA;&#xA;(defun endless/ispell-word-then-abbrev (p)&#xA;  &quot;Call `ispell-word'. Then create an abbrev for the correction made.&#xA;With prefix P, create local abbrev. Otherwise it will be global.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((bef (downcase (or (thing-at-point 'word) &quot;&quot;))) aft)&#xA;    (call-interactively 'ispell-word)&#xA;    (setq aft (downcase (or (thing-at-point 'word) &quot;&quot;)))&#xA;    (unless (string= aft bef)&#xA;      (message &quot;\&quot;%s\&quot; now expands to \&quot;%s\&quot; %sally&quot;&#xA;               bef aft (if p &quot;loc&quot; &quot;glob&quot;))&#xA;      (define-abbrev&#xA;        (if p local-abbrev-table global-abbrev-table)&#xA;        bef aft))))&#xA;&#xA;(setq save-abbrevs t)&#xA;(setq-default abbrev-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Manually, adding the corrections might sound cumbersome, but it's really not. You're just hitting a couple of keys, and you'll notice a few corrections will get you a long way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, the alternative (letting ispell choose the correction for you&#xA;&lt;em&gt;every time&lt;/em&gt; the word doesn't exist) will get you wrong corrections more often than not. So it's best to define your own anyway. It even solves the problem of when you actually &lt;em&gt;want&lt;/em&gt; to type non-words.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-29T15:43:31.197" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2802" PostTypeId="2" ParentId="2796" CreationDate="2014-10-29T15:44:40.577" Score="4" Body="&lt;p&gt;stsquad's answer is the way to go if you have one file where you want to&#xA;use a different sequence. If the keywords are all different, it's also possible to make both sequences available in the same file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords&#xA;      '((sequence &quot;TODO&quot; &quot;|&quot; &quot;DONE&quot;)&#xA;        (sequence &quot;MOOC&quot; &quot;STARTED&quot; &quot;|&quot; &quot;COMPLETE&quot; &quot;SUSPENDED&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;(info &quot;(org) TODO extensions&quot;)&lt;/code&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(As pointed out in the comments, this question was about choosing a TODO&#xA;sequence based on categories.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's one (not thoroughly tested) approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set up multiple sequences using the standard approach.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords&#xA;      '((sequence &quot;TODO&quot; &quot;|&quot; &quot;DONE&quot;)&#xA;        (sequence &quot;MOOC&quot; &quot;STARTED&quot; &quot;|&quot; &quot;COMPLETE&quot; &quot;SUSPENDED&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then create a custom function that starts the TODO in the desired state&#xA;based on the current category. After that, let the interactive&#xA;&lt;code&gt;org-todo&lt;/code&gt; take over, because it will stay in that sequence.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun km/org-todo ()&#xA;  &quot;Change TODO state of item, considering current category.&#xA;&#xA;Run `org-todo', but choose the initial state based on the&#xA;category. If the the heading does not already have a TODO state&#xA;and the current category is in `km/org-category-todo-starts',&#xA;change the heading to that state.&#xA;&#xA;Otherwise, run `org-todo' interactively.&quot;&#xA;  (interactive)&#xA;  (let ((current-todo (org-get-todo-state))&#xA;        (category-todo (km/org-select-todo-by-category)))&#xA;    (if (and (not current-todo)&#xA;             category-todo)&#xA;        (org-todo category-todo)&#xA;      (call-interactively 'org-todo))))&#xA;&#xA;(defun km/org-select-todo-by-category ()&#xA;  &quot;Choose starting TODO keyword based on the category.&#xA;If no value is found for the category, return the value for&#xA;`default'.&quot;&#xA;  (or (cdr (assoc (org-no-properties (org-get-category))&#xA;                  km/org-category-todo-starts))&#xA;      (cdr (assoc 'default km/org-category-todo-starts))))&#xA;&#xA;(defvar km/org-category-todo-starts '((default . &quot;TODO&quot;)&#xA;                                      (&quot;mooc&quot; . &quot;MOOC&quot;))&#xA;  &quot;List of properties and first TODO keyword to start with.&#xA;The TODO keyword should be present in `org-todo-keywords'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can be remapped so that &lt;code&gt;C-c C-t&lt;/code&gt; will call this function instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map [remap org-todo] 'km/org-todo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that if you use speed commands, &lt;code&gt;t&lt;/code&gt; will still call &lt;code&gt;org-todo&lt;/code&gt;, so&#xA;you'd have to override that separately.)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-10-29T18:47:53.700" LastActivityDate="2014-10-29T18:47:53.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2803" PostTypeId="2" ParentId="2795" CreationDate="2014-10-29T15:45:21.320" Score="5" Body="&lt;p&gt;This function will find all section headers and collect them in a list, then print the list in reverse order:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-table-of-contents ()&#xA;  (interactive)&#xA;  (goto-char (point-min))&#xA;  (let ((results nil))&#xA;    (while (re-search-forward &quot;^^L\n;;; \\(.+\\)&quot; nil t)&#xA;      (setq results (cons (match-string 1) results)))&#xA;&#xA;    ;; print table of contents&#xA;    (goto-char (point-min))&#xA;    (insert &quot;;;; Contents:\n\n&quot;)&#xA;    (let ((n 1))&#xA;      (dolist (heading (reverse results))&#xA;        (insert (format &quot;;;; %d. %s\n&quot; n heading))&#xA;        (setq n (1+ n))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;^L&lt;/code&gt; in the regular expression string should be input as an actual control character (&lt;code&gt;C-q C-l&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-29T15:45:21.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2804" PostTypeId="2" ParentId="2799" CreationDate="2014-10-29T15:47:45.140" Score="4" Body="&lt;p&gt;Using &lt;code&gt;--eval&lt;/code&gt; is the way to go. If &lt;code&gt;-f&lt;/code&gt;/&lt;code&gt;--funcall&lt;/code&gt; were supported then &lt;code&gt;emacsclient --help&lt;/code&gt; would mention it. Alternatively ask the Emacs maintainers to implement &lt;code&gt;--funcall&lt;/code&gt; too. I cannot see a reason why &lt;code&gt;emacsclient&lt;/code&gt; should not support it when &lt;code&gt;emacs&lt;/code&gt; does.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-10-29T15:47:45.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2805" PostTypeId="1" AcceptedAnswerId="2806" CreationDate="2014-10-29T17:17:03.043" Score="2" ViewCount="1175" Body="&lt;p&gt;In Emacs, I show the newline convention used by emacs for the current file, by &#xA;&lt;code&gt;M-x describe-variable&lt;/code&gt;, then &lt;code&gt;buffer-file-coding-system&lt;/code&gt;. The result is &lt;code&gt;utf8-mac&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does &lt;code&gt;mac&lt;/code&gt;, &lt;code&gt;dos&lt;/code&gt;, &lt;code&gt;unix&lt;/code&gt; after the hyphen mean the newline convention only? or do they also give information about other things, beside the newline convention?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2014-10-29T17:23:12.270" Title="What does `mac` in `utf8-mac` mean?" Tags="|character-encoding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2806" PostTypeId="2" ParentId="2805" CreationDate="2014-10-29T17:23:12.270" Score="3" Body="&lt;p&gt;&lt;code&gt;mac&lt;/code&gt;, &lt;code&gt;dos&lt;/code&gt; and &lt;code&gt;unix&lt;/code&gt; only specify the newline convention.  &lt;code&gt;mac&lt;/code&gt; stands for the (pre-OSX?) convention of CR only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;utf-8-mac&lt;/code&gt; should not be confused with &lt;code&gt;utf-8-nfd&lt;/code&gt;, which is the UTF-8 variant that OSX uses for file names.  In it, non-ASCII characters are decomposed, so that for example &lt;code&gt;Ä&lt;/code&gt; is stored as &lt;code&gt;A&lt;/code&gt; followed by the combining version of &lt;code&gt;¨&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-10-29T17:23:12.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2807" PostTypeId="1" AcceptedAnswerId="2813" CreationDate="2014-10-29T18:23:56.220" Score="43" ViewCount="6948" Body="&lt;p&gt;I have used the mark to select regions of a buffer. For example, I know the sequence &lt;code&gt;C-&amp;lt;space&amp;gt; C-s foo&lt;/code&gt; can be used to select all text between the current point and the point after a search for &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently discovered the existence of the mark ring, so I can &lt;code&gt;C-&amp;lt;space&amp;gt; C-&amp;lt;space&amp;gt;&lt;/code&gt; to leave a mark, move the point in the buffer, and then &lt;code&gt;C-u C-&amp;lt;space&amp;gt;&lt;/code&gt; to jump back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any suggestions, guides, or tips to effectively navigating using the mark ring?&lt;/p&gt;&#xA;" OwnerUserId="313" LastEditorUserId="105" LastEditDate="2015-03-27T19:54:31.470" LastActivityDate="2017-01-30T18:29:14.910" Title="Effectively using the mark ring" Tags="|mark|cycling|mark-ring|" AnswerCount="6" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2808" PostTypeId="2" ParentId="2774" CreationDate="2014-10-29T18:34:28.733" Score="7" Body="&lt;p&gt;This is all-but-a-dupe of &lt;a href=&quot;https://stackoverflow.com/q/3758139&quot;&gt;this question&lt;/a&gt; on SO.  As of this writing, the accepted answer over there is (mutatis mutandis):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(set-face-attribute 'org-verbatim nil :inherit 'fixed-pitch)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Actually read your question.  Since you want to change multiple faces, this is a more complete answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (face '(org-block-begin-line &#xA;                org-block-end-line &#xA;                org-verbatim &#xA;                org-block-background))&#xA;  (set-face-attribute face nil :inherit 'fixed-pitch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this will overwrite any existing &lt;code&gt;:inherit&lt;/code&gt; parameters on the faces.  If that's a problem, another answer to the same SO question provides code to work around the issue.&lt;/p&gt;&#xA;" OwnerUserId="372" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2014-10-30T04:13:43.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2809" PostTypeId="2" ParentId="2807" CreationDate="2014-10-29T19:06:26.107" Score="14" Body="&lt;p&gt;I find it easier to use registers to mark locations: &lt;code&gt;C-x r &amp;lt;space&amp;gt;&lt;/code&gt; and then a letter to mark, &lt;code&gt;C-x r j&lt;/code&gt; and a letter to jump back. I can maintain a number of marks, very useful when alternating between multiple buffers&lt;/p&gt;&#xA;" OwnerUserId="2317" LastActivityDate="2014-10-29T19:06:26.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2810" PostTypeId="1" AcceptedAnswerId="2814" CreationDate="2014-10-29T19:38:29.613" Score="3" ViewCount="207" Body="&lt;p&gt;I find myself refactoring code fairly frequently and my screen space is at a premium. I'd like to be able to move to a particular scope (class, function, or even if-statement/for-loop blocks) and either cut the code and append it to another file or copy the code and append it to another file. Ideally, I'd like to do this in Fortran, C and C++. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can open multiple windows and stack them and use the usual kill on lines or marked regions then change to the other window and yank the lines or regions into that buffer. But I don't want to have multiple windows open, it makes it harder to see where I am in the file from which I'm moving code. Plus, code from one file may be going to multiple places. So I'd like to just dump it at the end of a a different file and then move it around in that file later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I move/copy the code within the scope of the cursor to the end of another file for those languages? If there isn't a method that would work in each language, is there a way to do it on marked regions of code and single lines?&lt;/p&gt;&#xA;" OwnerUserId="835" LastActivityDate="2014-10-29T20:30:59.567" Title="How to copy or move code in current scope to end of another file" Tags="|key-bindings|editing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2813" PostTypeId="2" ParentId="2807" CreationDate="2014-10-29T20:15:17.810" Score="28" Body="&lt;p&gt;Helm has an interface for browsing both local and global mark-rings: &lt;code&gt;helm-all-mark-rings&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#orgheadline21&quot; rel=&quot;noreferrer&quot;&gt;mini-guide&lt;/a&gt; for a brief description and a screenshot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you prefer &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;noreferrer&quot;&gt;Ivy/Swiper/Counsel&lt;/a&gt;, see &lt;code&gt;counsel-mark-ring&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2290" LastEditorUserId="2290" LastEditDate="2017-01-30T18:29:14.910" LastActivityDate="2017-01-30T18:29:14.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2814" PostTypeId="2" ParentId="2810" CreationDate="2014-10-29T20:30:33.150" Score="3" Body="&lt;p&gt;Select the code you want to copy or move, then use &lt;strong&gt;&lt;code&gt;M-x append-to-file&lt;/code&gt;&lt;/strong&gt;. To remove the selected code from the current buffer, use &lt;code&gt;C-w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt; I define command &lt;code&gt;region-to-file&lt;/code&gt; as follows. (I bind it to &lt;code&gt;C-S-backspace&lt;/code&gt; and to &lt;code&gt;C-x M-f&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun region-to-file (start end filename arg)&#xA;  &quot;With prefix arg, this is `append-to-file'.  Without, it is `write-region'.&#xA;START and END are the region boundaries.&#xA;Prefix ARG non-nil means append region to end of file FILENAME.&#xA;Prefix ARG nil means write region to FILENAME, replacing contents.&quot;&#xA;  (interactive&#xA;   (list (region-beginning)&#xA;         (region-end)&#xA;         (read-file-name (concat (if current-prefix-arg &quot;Append&quot; &quot;Write&quot;)&#xA;                                 &quot; region to file: &quot;))&#xA;         current-prefix-arg))&#xA;  (let* ((curr-file    (buffer-file-name))&#xA;         (same-file-p  (and curr-file  (string= curr-file filename))))&#xA;    (cond ((or (not same-file-p)&#xA;               (progn (when (fboundp 'flash-ding) (flash-ding))&#xA;                      (yes-or-no-p&#xA;                       (format&#xA;                        &quot;Do you really want to REPLACE the contents of `%s' by \&#xA;just the REGION? &quot;&#xA;                        (file-name-nondirectory curr-file)))))&#xA;           (write-region start end filename arg)&#xA;           (when same-file-p (revert-buffer t t)))&#xA;          (t (message &quot;OK.  Not written.&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-10-29T20:30:33.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2815" PostTypeId="2" ParentId="2810" CreationDate="2014-10-29T20:30:59.567" Score="1" Body="&lt;p&gt;&lt;code&gt;mark-defun&lt;/code&gt; is bound to &lt;code&gt;C-M-h&lt;/code&gt; and will mark the current function. Different modes use the same keybinding (&lt;code&gt;c-mark-function&lt;/code&gt; for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;append-to-file&lt;/code&gt; will prompt for a file name and append the current region to that file.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2014-10-29T20:30:59.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2816" PostTypeId="2" ParentId="2807" CreationDate="2014-10-29T20:39:33.723" Score="6" Body="&lt;p&gt;(Your question is pretty open-ended, so it might get closed as being primarily opinion-based.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I use: &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Multi-Commands&quot; rel=&quot;noreferrer&quot;&gt;multi-command&lt;/a&gt; &lt;code&gt;icicle-goto-marker&lt;/code&gt; (bound to &lt;strong&gt;&lt;code&gt;C-- C-SPC&lt;/code&gt;&lt;/strong&gt;) to trip around the marks in any buffer (&lt;code&gt;mark-ring&lt;/code&gt;), and &lt;code&gt;icicle-goto-global-marker&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;C-- C-x C-SPC&lt;/code&gt;&lt;/strong&gt;) to trip among the global marks (&lt;code&gt;global-mark-ring&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lines of text where the markers are located are used as completion candidates. You can type some text (e.g., substring, regexp) to narrow the candidates to the lines that match. You can cycle among the matching lines, visiting any that you like. If you also use library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/crosshairs.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;crosshairs.el&lt;/code&gt;&lt;/a&gt; then position of a marker you visit is highlighted temporarily with crosshairs, so you can quickly see where it is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is part of the doc string for &lt;code&gt;icicle-goto-marker&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Go to a marker in this buffer, choosing it by the line that includes it.&#xA;If `crosshairs.el' is loaded, then the target position is highlighted.&#xA;&#xA;By default, candidates are sorted in marker order, that is, with&#xA;respect to their buffer positions.  Use `C-M-,' or `C-,' to change the&#xA;sort order.&#xA;&#xA;During completion you can use these keys:&#xA;&#xA;`C-RET'   - Goto marker named by current completion candidate&#xA;`C-down'  - Goto marker named by next completion candidate&#xA;`C-up'    - Goto marker named by previous completion candidate&#xA;`C-next'  - Goto marker named by next apropos-completion candidate&#xA;`C-prior' - Goto marker named by previous apropos-completion candidate&#xA;`C-end'   - Goto marker named by next prefix-completion candidate&#xA;`C-home'  - Goto marker named by previous prefix-completion candidate&#xA;`&amp;lt;S-delete&amp;gt;' - Delete marker named by current completion candidate&#xA;&#xA;Use `mouse-2', `RET', or `S-RET' to choose a candidate as the final&#xA;destination, or `C-g' to quit.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-29T20:52:53.170" LastActivityDate="2014-10-29T20:52:53.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2817" PostTypeId="2" ParentId="2807" CreationDate="2014-10-29T21:16:16.407" Score="11" Body="&lt;p&gt;&lt;kbd&gt;C-x C-x&lt;/kbd&gt; for &lt;code&gt;exchange-mark-and-point&lt;/code&gt; has similar use to &lt;kbd&gt;C-u C-space&lt;/kbd&gt;. It lets you bounce between a point and the last mark. It's a little weird for bouncing with &lt;code&gt;transient-mark-mode&lt;/code&gt; as it activates the mark and selects the region.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-10-30T08:55:05.783" LastActivityDate="2014-10-30T08:55:05.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2818" PostTypeId="2" ParentId="2807" CreationDate="2014-10-29T21:27:31.200" Score="16" Body="&lt;p&gt;When you set &lt;code&gt;set-mark-command-repeat-pop&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; via&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq set-mark-command-repeat-pop t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can keep pressing &lt;kbd&gt;C-SPC&lt;/kbd&gt; after the first invocation of &lt;kbd&gt;C-u C-SPC&lt;/kbd&gt; to jump to previous locations stored in the mark ring.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-24T19:34:52.730" LastActivityDate="2015-01-24T19:34:52.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2819" PostTypeId="1" AcceptedAnswerId="2823" CreationDate="2014-10-29T21:51:19.773" Score="29" ViewCount="3864" Body="&lt;p&gt;When searching using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-s SPC SPC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also matches single spaces. I want to match exactly two space.&lt;/p&gt;&#xA;" OwnerUserId="2325" LastEditorUserId="2325" LastEditDate="2015-12-03T12:53:33.837" LastActivityDate="2022-03-31T18:45:49.777" Title="Match two spaces with incremental search" Tags="|search|whitespace|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2820" PostTypeId="2" ParentId="2819" CreationDate="2014-10-29T21:51:19.773" Score="4" Body="&lt;p&gt;Using regexp incremental search solves the problem, if you escape the space characters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-M-s \SPC\SPC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use search and replace without the backslashes, if that's what you're after:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-% SPC SPC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2325" LastActivityDate="2014-10-29T21:51:19.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2821" PostTypeId="1" AcceptedAnswerId="2825" CreationDate="2014-10-29T21:54:42.687" Score="6" ViewCount="248" Body="&lt;p&gt;TL;DR: Any suggestions as to what function(s) can help me restore (to any given window) the buffer that was visible most recently?  It's important that the currently visible buffer is not killed, just moved to the back.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is partly an exercise in Elisp for me so my preference is for building such a function myself instead of using off-the-shelf packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The long version:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to create a function which effectively &quot;throws&quot; a newly created buffer to the other window.  I've captured some but not all of the necessary functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let's say that my current frame is split vertically into two windows,&#xA;&lt;code&gt;|Window 1|Window 2|&lt;/code&gt;; I'm editing &lt;code&gt;foo.el&lt;/code&gt; in &lt;code&gt;Window 1&lt;/code&gt; and&#xA;&lt;code&gt;some-junk.el&lt;/code&gt; in &lt;code&gt;Window 2&lt;/code&gt;.  &lt;/li&gt;&#xA;&lt;li&gt;Now, let's say that I open a file&#xA;&lt;code&gt;bar.el&lt;/code&gt; which I want to see alongside &lt;code&gt;foo.el&lt;/code&gt; (via &lt;code&gt;ido&lt;/code&gt;, &lt;code&gt;helm&lt;/code&gt;,&#xA;etc.).  &lt;/li&gt;&#xA;&lt;li&gt;However, I accidentally opened &lt;code&gt;bar.el&lt;/code&gt; in in &lt;code&gt;Window 1&lt;/code&gt;,&#xA;thereby covering up &lt;code&gt;foo.el&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;(I find myself in similar non-accidental situations, hence the motivation for such a function)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The goal is to have a function which will &quot;throw&quot; &lt;code&gt;bar.el&lt;/code&gt; to &lt;code&gt;Window 2&lt;/code&gt;, i.e., two steps: (i) have &lt;code&gt;Window 2&lt;/code&gt; show &lt;code&gt;bar.el&lt;/code&gt; and (ii) have &lt;code&gt;Window 1&lt;/code&gt; show &lt;code&gt;foo.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I've been able to come up with an implementation of (i) but am stuck on (ii).  in other words, I can get &lt;code&gt;Window 2&lt;/code&gt; to show &lt;code&gt;bar.el&lt;/code&gt; but I'm having trouble getting &lt;code&gt;Window 1&lt;/code&gt; to revert to &lt;code&gt;foo.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dc/move-top-buffer-to-other-window ()&#xA;  (interactive)&#xA;  (let* ((current (selected-window))&#xA;         (other   (next-window))&#xA;     (current-buffer (window-buffer current)))&#xA;     (set-window-buffer other current-buffer)&#xA;     (other-window 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought there might be a variable that represents a notion of &quot;buffer-order&quot; for each window (e.g., in the example 1, such a variable for &lt;code&gt;Window 2&lt;/code&gt; would hold a list of buffers in the following order, as per the example above, [&lt;code&gt;bar.el&lt;/code&gt; &lt;code&gt;foo.el&lt;/code&gt; ...]), since Emacs is able to &quot;remember&quot; which buffer I had open last.  But I haven't been able to find it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="2084" LastEditDate="2014-10-29T22:45:31.897" LastActivityDate="2014-10-29T22:58:08.893" Title="Creating function to move top-buffer to other window" Tags="|buffers|window|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2822" PostTypeId="2" ParentId="2821" CreationDate="2014-10-29T22:03:40.457" Score="3" Body="&lt;p&gt;Take a look at source of &lt;code&gt;winner-mode&lt;/code&gt;. It provides some of the functionality you are looking for, and it may give some hints on how to track a ring of buffers per window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After enabling &lt;code&gt;winner-mode&lt;/code&gt;, by default, &lt;kbd&gt;C-c &amp;lt;left&amp;gt;&lt;/kbd&gt; and &lt;kbd&gt;C-c &amp;lt;right&amp;gt;&lt;/kbd&gt; are bound to &lt;code&gt;winner-undo&lt;/code&gt;, and &lt;code&gt;winner-redo&lt;/code&gt;. It then tracks which buffer was in each window, and what windows were visible in the frame. So if you switch to another buffer in either window, and then run &lt;code&gt;winner-undo&lt;/code&gt; the buffer will return to point in the original window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fun part is that if a windows is split again, executing &lt;code&gt;winner-undo&lt;/code&gt; will return to two visible windows. After executing &lt;code&gt;winner-redo&lt;/code&gt;, the third window will re-open with the last buffer it held.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if the functionality needed is to simply display the current (new) buffer in the next window, &lt;a href=&quot;http://www.emacswiki.org/emacs/TransposeWindows&quot; rel=&quot;nofollow&quot;&gt;transpose-window&lt;/a&gt; might be all you need to swap visible buffers:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun transpose-windows (arg)&#xA;   &quot;Transpose the buffers shown in two windows.&quot;&#xA;   (interactive &quot;p&quot;)&#xA;   (let ((selector (if (&amp;gt;= arg 0) 'next-window 'previous-window)))&#xA;     (while (/= arg 0)&#xA;       (let ((this-win (window-buffer))&#xA;             (next-win (window-buffer (funcall selector))))&#xA;         (set-window-buffer (selected-window) next-win)&#xA;         (set-window-buffer (funcall selector) this-win)&#xA;         (select-window (funcall selector)))&#xA;       (setq arg (if (plusp arg) (1- arg) (1+ arg))))))&#xA;&#xA; (define-key ctl-x-4-map (kbd &quot;t&quot;) 'transpose-windows)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2014-10-29T22:40:34.197" LastActivityDate="2014-10-29T22:40:34.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2823" PostTypeId="2" ParentId="2819" CreationDate="2014-10-29T22:04:04.317" Score="33" Body="&lt;p&gt;Use &lt;code&gt;M-s SPC&lt;/code&gt; during Isearch to toggle matching whitespace literally. When matching literally, each &lt;code&gt;SPC&lt;/code&gt; char you type is matched individually.  (This used to be the default Emacs behavior, BTW.)&lt;/p&gt;&#xA;&lt;p&gt;To configure this as the default behavior customize option &lt;code&gt;search-whitespace-regexp&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. (&lt;code&gt;M-x customize-option search-whitespace-regexp&lt;/code&gt;.)&lt;/p&gt;&#xA;&lt;p&gt;See the GNU Emacs manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Special-Isearch.html#Special-Isearch&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;Special Isearch&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;C-h v search-whitespace-regexp&lt;/code&gt; tells us this (showing the default value):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;search-whitespace-regexp&lt;/code&gt;&lt;/strong&gt; is a variable defined in &lt;code&gt;isearch.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Its value is &lt;code&gt;&amp;quot;\\s-+&amp;quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Documentation:&lt;/p&gt;&#xA;&lt;p&gt;If non-&lt;code&gt;nil&lt;/code&gt;, regular expression to match a sequence of whitespace chars.&lt;/p&gt;&#xA;&lt;p&gt;When you enter a space or spaces in the incremental search, it&#xA;will match any sequence matched by this regexp.  As an exception,&#xA;spaces are treated normally in regexp incremental search if they&#xA;occur in a regexp construct like &lt;code&gt;[...]&lt;/code&gt; or &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt; or &lt;code&gt;?&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If the value is a string, it applies to both ordinary and&#xA;regexp incremental search.  If the value is &lt;code&gt;nil&lt;/code&gt;, or&#xA;&lt;code&gt;isearch-lax-whitespace&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; for ordinary incremental search, or&#xA;&lt;code&gt;isearch-regexp-lax-whitespace&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; for regexp incremental search,&#xA;then each space you type matches literally, against one space.&lt;/p&gt;&#xA;&lt;p&gt;You might want to use something like &lt;code&gt;&amp;quot;[ \t\r\n]+&amp;quot;&lt;/code&gt; instead.&#xA;In the Customization buffer, that is &lt;code&gt;[&lt;/code&gt; followed by a space,&#xA;a tab, a carriage return (control-M), a newline, and &lt;code&gt;]+&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;p&gt;This variable was introduced, or its default value was changed, in&#xA;version 24.3 of Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2022-03-31T18:45:49.777" LastActivityDate="2022-03-31T18:45:49.777" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="2824" PostTypeId="2" ParentId="2821" CreationDate="2014-10-29T22:43:45.183" Score="2" Body="&lt;p&gt;My alternate solution for any who are interested.  It turns out I was one line away from the desired functionality!  (The key function was &lt;code&gt;bury-buffer&lt;/code&gt;.)  Full function below, as reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dan's version above is better, though - it's shorter and sweeter since it leverages the &lt;code&gt;save-selected-window&lt;/code&gt; function (which I'm only just learning about!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, for readers: I am a big fan of &lt;code&gt;winner-mode&lt;/code&gt; (as per the other post) and would recommend it also.  Part of the motivation behind creating this function was because winner-mode is more for undoing/redoing changes to your windows/buffers and not for shifting around your current windows/buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dc/move-top-buffer-to-other-window ()&#xA;  &quot;If you're viewing 'foo.el' and 'some-junk.el' in two-window&#xA;frame (e.g., |Window 1|Window 2|) as&#xA;follows (|foo.el|some-junk.el|) and you (possibly accidentally)&#xA;open another buffer, 'bar.el' in Window 1, then calling this&#xA;function will move 'bar.el' to Window 2 and will restore 'foo.el'&#xA;to Window 1.&quot;&#xA;  (interactive)&#xA;  (let* ((current (selected-window))&#xA;         (other (next-window))&#xA;         (current-buffer (window-buffer current)))&#xA;    (set-window-buffer other current-buffer)&#xA;    (bury-buffer)&#xA;    (other-window 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="2084" LastEditDate="2014-10-29T22:58:08.893" LastActivityDate="2014-10-29T22:58:08.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2825" PostTypeId="2" ParentId="2821" CreationDate="2014-10-29T22:49:36.410" Score="5" Body="&lt;p&gt;Here's a simple, no-frills function that does what you're asking.  No need to &lt;code&gt;let&lt;/code&gt;-bind anything:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun switcheroo ()&#xA;  &quot;Throw current buffer to other window, display previous buffer&#xA;in this window.&quot;&#xA;  (interactive)&#xA;  (save-selected-window&#xA;    (switch-to-buffer-other-window (current-buffer)))&#xA;  (switch-to-buffer (other-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-29T22:49:36.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2826" PostTypeId="2" ParentId="2819" CreationDate="2014-10-29T23:38:13.483" Score="3" Body="&lt;p&gt;Using regexp search helps, but you can also make sure of literal spaces for the search using &lt;kbd&gt;C-q SPC&lt;/kbd&gt; to quote a space into the search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To riff off of @Rovanion's answer then, using &lt;code&gt;isearch-forward-regexp&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-M-s&lt;/kbd&gt; &lt;kbd&gt;C-q SPC&lt;/kbd&gt; &lt;kbd&gt;C-q SPC&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will search for two consecutive spaces. Interestingly, &lt;code&gt;isearch-forward-regexp&lt;/code&gt; requires discrete matches. Searching &lt;code&gt;aaa&lt;/code&gt; for &lt;code&gt;aa&lt;/code&gt; will only match once and not again at the second character.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2014-10-29T23:38:13.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2827" PostTypeId="1" CreationDate="2014-10-29T23:58:58.740" Score="2" ViewCount="224" Body="&lt;p&gt;When using &lt;code&gt;C-x C-f&lt;/code&gt; (ido-find-file) to open files use I can use &lt;code&gt;M-s&lt;/code&gt; to enable fuzzy matching. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;C-x C-f&lt;/code&gt; then &lt;code&gt;M-s&lt;/code&gt; and then enter the the fuzzy search string, things work as they should. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if I type &lt;code&gt;C-x C-f&lt;/code&gt; then enter the fuzzy string and then type &lt;code&gt;M-s&lt;/code&gt; I get something like this in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;my-fuzzy-search[correct-completion]{some-totally-unrelated-file |&#xA;  correct-completion | ... }&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Some unrelated file is always first in the list of results, and if I press enter here ido will open it. Is there a way to configure ido so that the correct match will be first in the list in this case?&lt;/p&gt;&#xA;" OwnerUserId="2327" LastActivityDate="2014-10-30T04:13:54.530" Title="ido-find-file: lists of results in wrong order" Tags="|ido|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2828" PostTypeId="1" AcceptedAnswerId="2829" CreationDate="2014-10-30T00:20:53.933" Score="11" ViewCount="1109" Body="&lt;p&gt;I'm changing up the API of my package pretty frequently, but &lt;code&gt;company-mode&lt;/code&gt; pulls &lt;em&gt;every&lt;/em&gt; defined symbol (as it should) in its completions. I don't want to accidentally use an unbound name, so how can I unbind all variables and functions that start with, say, &lt;code&gt;my-package-&lt;/code&gt;?  After this, I'll simply be able to &lt;code&gt;load-file&lt;/code&gt; again.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-05-30T20:10:45.533" LastActivityDate="2015-05-30T20:10:45.533" Title="How can I unbind all symbol definitions with a certain prefix?" Tags="|elisp|completion|interactive-development|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2829" PostTypeId="2" ParentId="2828" CreationDate="2014-10-30T00:43:37.280" Score="10" Body="&lt;p&gt;Call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Unloading.html#index-unload_002dfeature-924&quot;&gt;&lt;code&gt;unload-feature&lt;/code&gt;&lt;/a&gt; to undefine all symbols that were defined as part of loading an Elisp source or byte-compiled file. Make sure that your file ends by calling &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html#index-provide-917&quot;&gt;&lt;code&gt;provide&lt;/code&gt;&lt;/a&gt; at the end. This assumes that you loaded the file with one of the &lt;code&gt;load&lt;/code&gt; functions or via &lt;code&gt;require&lt;/code&gt;, it won't undefined symbols defined by &lt;code&gt;C-M-x&lt;/code&gt; (&lt;code&gt;eval-defun&lt;/code&gt;) or similar mechanisms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to unbind symbols based on their name rather than based on the package that defined them, you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html#index-mapatoms-502&quot;&gt;&lt;code&gt;mapatoms&lt;/code&gt;&lt;/a&gt; to iterate over all symbols.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapatoms (lambda (symbol)&#xA;            (if (string-prefix-p &quot;foo-&quot; (symbol-name symbol))&#xA;                (unintern symbol))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-10-30T01:11:37.360" LastActivityDate="2014-10-30T01:11:37.360" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2830" PostTypeId="2" ParentId="2828" CreationDate="2014-10-30T00:56:14.390" Score="7" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;makunbound&lt;/code&gt; to remove the use of a symbol as a dynamic variable (i.e., to void its &lt;code&gt;symbol-value&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;fmakunbound&lt;/code&gt; to remove the use of a symbol as a function (i.e., to void its &lt;code&gt;symbol-function&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;mapatoms&lt;/code&gt; to iterate over all symbols.  Act on each whose &lt;code&gt;symbol-name&lt;/code&gt; is matched by the particular prefix you are interested in: call both &lt;code&gt;makunbound&lt;/code&gt; and &lt;code&gt;fmakunbound&lt;/code&gt; on it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You do not need to &lt;code&gt;unintern&lt;/code&gt; the symbol, &lt;em&gt;unless&lt;/em&gt; you are also using completion against symbols themselves, and not just over their use as variables or functions. But if you &lt;em&gt;do&lt;/em&gt; want to completely remove a symbol then use &lt;code&gt;unintern&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-10-30T01:01:23.613" LastActivityDate="2014-10-30T01:01:23.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2831" PostTypeId="5" CreationDate="2014-10-30T01:20:37.517" Score="0" Body="&lt;p&gt;Ediff user manual: &lt;a href=&quot;http://www.delorie.com/gnu/docs/emacs/ediff_1.html&quot; rel=&quot;nofollow&quot;&gt;http://www.delorie.com/gnu/docs/emacs/ediff_1.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ediff page on Emacs wiki: &lt;a href=&quot;http://emacswiki.org/emacs/EdiffMode&quot; rel=&quot;nofollow&quot;&gt;http://emacswiki.org/emacs/EdiffMode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-30T11:01:32.927" LastActivityDate="2014-10-30T11:01:32.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2832" PostTypeId="4" CreationDate="2014-10-30T01:20:37.517" Score="0" Body="Ediff is a feature of Emacs which allows comparing two or more files or buffers, as well as merging two files or buffers into one." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-30T11:01:21.580" LastActivityDate="2014-10-30T11:01:21.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2833" PostTypeId="5" CreationDate="2014-10-30T01:23:47.560" Score="0" Body="&lt;p&gt;Emacs provides extensive editing, parsing, printing, and programming support for handling white spaces.  The &lt;a href=&quot;/questions/tagged/whitespace-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;whitespace-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;whitespace-mode&lt;/a&gt; in one such feature, which has consolidated &lt;code&gt;blank-mode&lt;/code&gt; and many other &lt;code&gt;space&lt;/code&gt; functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs can clean up spurious &lt;a href=&quot;/questions/tagged/whitespace&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;whitespace&amp;#39;&quot; rel=&quot;tag&quot;&gt;whitespace&lt;/a&gt; characters in buffers without clobbering spacing needs of the underlying programming language syntax. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs also uses the same &lt;a href=&quot;/questions/tagged/whitespace&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;whitespace&amp;#39;&quot; rel=&quot;tag&quot;&gt;whitespace&lt;/a&gt; definitions for determining boundaries between words, sentences, expression, etc., for text selections, insertions, deletions, and general navigation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some &lt;a href=&quot;/questions/tagged/whitespace&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;whitespace&amp;#39;&quot; rel=&quot;tag&quot;&gt;whitespace&lt;/a&gt; functions insert customizable visual characters for easy visibility.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful link:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html#Useless-Whitespace&quot; rel=&quot;nofollow noreferrer&quot;&gt;Whitespace in the manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-21T17:25:40.930" LastActivityDate="2017-02-21T17:25:40.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2834" PostTypeId="4" CreationDate="2014-10-30T01:23:47.560" Score="0" Body="for questions about handling white or blank spaces. Besides space characters, Emacs is configured to handle the following as white space characters: tabs, indents, newlines that create blank space between text, either horizontally or vertically." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-21T17:25:30.750" LastActivityDate="2017-02-21T17:25:30.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2835" PostTypeId="5" CreationDate="2014-10-30T01:40:16.077" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://company-mode.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Company&lt;/a&gt; is a text completion framework for Emacs. The name stands for &amp;quot;complete anything&amp;quot;. It uses pluggable back-ends and front-ends to retrieve and display completion candidates.&lt;/p&gt;&#xA;&lt;p&gt;It comes with several back-ends such as Elisp, Clang, Semantic, Ispell, CMake, BBDB, Yasnippet, Dabbrev, Etags, Gtags, Files, Keywords and a few others.&lt;/p&gt;&#xA;&lt;p&gt;The CAPF back-end provides a bridge to the standard &lt;code&gt;completion-at-point-functions&lt;/code&gt; facility, and thus works with any major mode that defines a proper completion function.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2022-02-18T19:26:46.893" LastActivityDate="2022-02-18T19:26:46.893" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2836" PostTypeId="4" CreationDate="2014-10-30T01:40:16.077" Score="0" Body="Company-mode is a text completion framework for Emacs. The name stands for &quot;complete anything&quot;. It uses pluggable back-ends and front-ends to retrieve and display completion candidates." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-10-30T11:01:51.673" LastActivityDate="2014-10-30T11:01:51.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2837" PostTypeId="1" AcceptedAnswerId="2853" CreationDate="2014-10-30T02:32:04.537" Score="10" ViewCount="4425" Body="&lt;p&gt;I'm trying to create a function that places/aligns/indents curly brackets according to Allman-style formatting (for coding in C).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally speaking, I am fan of Smartparens' interface available to users for customizing functionality.  I've written a bunch of other functions using the Smartparens interface so would have a strong preference not to switch packages at this point.  That said, I'm open to package-agnostic implementations (e.g., could &lt;code&gt;defadvice&lt;/code&gt; be relevant here?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On to the problem at hand.  What's the end goal?  Let's suppose we're coding and we reach the state represented below.  The pipe symbol represents the cursor; I've typed the function header and the opening brace &lt;code&gt;{&lt;/code&gt;, and Smartparens has automatically added the closing brace  &lt;code&gt;}&lt;/code&gt;.  At this point, I'd like it so that pressing &lt;code&gt;RET&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main {|}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...leads to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main&#xA;{&#xA;    |&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've been able to write the function that results in this behavior but it only works for the first level of indentation (e.g., for our main function in the example above).  I can't get it to work for subsequent levels of indentation (see gif):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/crFvi.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relevant code is below.  The function isn't pretty but I think it should work...  The very last line is the interface to Smartparens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-create-newline-and-enter-sexp (&amp;amp;rest _ignored)&#xA;  &quot;Open a new brace or bracket expression, with relevant newlines and indent. &quot;&#xA;  (interactive)&#xA;  (progn&#xA;    (backward-char 2) (newline) (forward-char) (newline)     &#xA;    (indent-according-to-mode)                               &#xA;    (previous-line 2) (indent-according-to-mode)         &#xA;    (next-line) (next-line) (indent-according-to-mode)))      &#xA;&#xA;(sp-local-pair 'c-mode &quot;{&quot; nil :post-handlers '((my-create-newline-and-enter-sexp &quot;RET&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="2084" LastEditDate="2014-10-30T03:09:36.303" LastActivityDate="2017-03-27T16:51:33.233" Title="Automatically formatting brackets" Tags="|elisp|smartparens|balanced-parentheses|formatting|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2838" PostTypeId="2" ParentId="2837" CreationDate="2014-10-30T04:08:37.790" Score="7" Body="&lt;p&gt;Solved.  The sequence of cursor movements from my first version (in the original post) was funky.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As reference for future readers, the following code should work.  It obv needs the Smartparens package (which you can get from git-hub).  I'm running Emacs 24.4.  It works with electric-indent mode enabled or disabled.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-create-newline-and-allman-format (&amp;amp;rest _ignored)&#xA;&quot;Allman-style formatting for C.&quot;&#xA;  (interactive)&#xA;  (progn&#xA;    (newline-and-indent)&#xA;    (previous-line) (previous-line) (search-forward &quot;{&quot;) (backward-char) (newline-and-indent)&#xA;    (next-line) (indent-according-to-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you'll need to include the following in your init file as well, somewhere after loading the Smartparens package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair '(c-mode) &quot;{&quot; nil :post-handlers '((my-create-newline-and-allman-format &quot;RET&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="13536" LastEditDate="2017-03-27T16:51:33.233" LastActivityDate="2017-03-27T16:51:33.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2839" PostTypeId="2" ParentId="2827" CreationDate="2014-10-30T04:13:54.530" Score="4" Body="&lt;p&gt;Ido doesn't have very smart fuzzy matching by default.  Essentially, if you put in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;horse&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ido will try to match&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.*h.*o.*r.*s.*e.*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;against its candidates.  This isn't really how we think about matching, since we would expect a file literally called &lt;code&gt;horse-feathers.txt&lt;/code&gt; to score higher than &lt;code&gt;hogs-raging-senial.png&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out the &lt;a href=&quot;https://github.com/lewang/flx&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;flx-ido&lt;/code&gt;&lt;/a&gt; package.  From the &lt;a href=&quot;https://github.com/lewang/flx#usage&quot; rel=&quot;nofollow&quot;&gt;readme&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The sorting algorithm is a balance between word beginnings&#xA;  (abbreviation) and contiguous matches (substring).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The longer the substring match, the higher it scores.  This maps well&#xA;  to how we think about matching.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In general, it's better form queries with only lowercase characters so&#xA;  the sorting algorithm can do something smart.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example, if you have these files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    projects/clojure-mode/clojure-mode.el&#xA;    projects/prelude/core/prelude-mode.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;If the search term was &lt;em&gt;pre-mode&lt;/em&gt;, you might expect &quot;prelude-mode.el&quot;&#xA;  to rank higher.  However because the substring match &quot;re-mode&quot; is so&#xA;  long, &quot;clojure-mode.el&quot; actually scores higher.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Here, using &lt;em&gt;premode&lt;/em&gt; would give the expected order.&lt;/strong&gt; Notice that the &quot;-&quot; actually prevents the algorithm from helping you.&lt;/p&gt;&#xA;  &#xA;  &lt;h3&gt;uppercase letters&lt;/h3&gt;&#xA;  &#xA;  &lt;p&gt;Flx always folds lowercase letters to match uppercase.  However, you&#xA;  can use uppercase letters for force flx to only match uppercase.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This is similar to Emacs' case-folding.  The difference is mixing in&#xA;  uppercase letters &lt;strong&gt;does not disable&lt;/strong&gt; folding.&lt;/p&gt;&#xA;  &#xA;  &lt;h3&gt;completing file names&lt;/h3&gt;&#xA;  &#xA;  &lt;p&gt;Matches within the basepath score higher.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-10-30T04:13:54.530" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2840" PostTypeId="2" ParentId="2568" CreationDate="2014-10-30T05:40:34.913" Score="5" Body="&lt;p&gt;After extensive search and experimentation I found a way to succeed using the stress. Also it must be noted that is not the best way (technically it doesn't solve the problem but you get what you want). I used the following key bind command for every letter that uses a stress: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;dead-acute&amp;gt; α&quot;) &quot;ά&quot;)&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;dead-acute&amp;gt; ε&quot;) &quot;έ&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suffice to say that if anyone finds a better way is welcome to share it with us as this is obviously just a compromise.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2014-10-30T05:40:34.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2842" PostTypeId="1" AcceptedAnswerId="2844" CreationDate="2014-10-30T09:50:14.600" Score="6" ViewCount="377" Body="&lt;p&gt;Is there a way in Helm to first match substrings from the beginning and only after that in the middle of candidates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, I have the following directory structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/&#xA;    .emacs.d/&#xA;    .gem/&#xA;    .microemulator/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I want to open a file in the directory &lt;code&gt;.emacs.d&lt;/code&gt;. I start to type &lt;code&gt;.em&lt;/code&gt; and Helm matches &lt;code&gt;.gem&lt;/code&gt; first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make Helm match &lt;code&gt;.emacs.d&lt;/code&gt; first, without prepending the beginning of line symbol (&lt;code&gt;^&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/E08kI.png&quot; alt=&quot;Imgur&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2332" LastActivityDate="2014-10-30T10:38:04.140" Title="How to make Helm always add ^ to the input pattern" Tags="|helm|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2843" PostTypeId="2" ParentId="2837" CreationDate="2014-10-30T09:50:49.290" Score="0" Body="&lt;p&gt;Here's the code that I use, just to give you more ideas to amend your code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ins-c++-curly ()&#xA;  &quot;Insert {}.&#xA;Threat is as function body when from endline before )&quot;&#xA;  (interactive)&#xA;  (cond ((eq major-mode 'term-mode)&#xA;         (term-send-raw-string &quot;{}&quot;)&#xA;         (term-send-raw-string &quot;^B&quot;))&#xA;        ((looking-back &quot;\\()\\|try\\|else\\|const\\|:\\)$&quot;)&#xA;         (insert &quot; {\n\n}&quot;)&#xA;         (indent-according-to-mode)&#xA;         (forward-line -1)&#xA;         (indent-according-to-mode))&#xA;        ((region-active-p)&#xA;         (let ((beg (region-beginning))&#xA;               (end (region-end)))&#xA;           (deactivate-mark)&#xA;           (goto-char beg)&#xA;           (insert &quot;{&quot;)&#xA;           (goto-char (1+ end))&#xA;           (insert &quot;}&quot;)))&#xA;        (t&#xA;         (insert &quot;{}&quot;)&#xA;         (indent-according-to-mode)&#xA;         (backward-char))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do prefer the hanging brace style, as it saves space.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-10-30T09:50:49.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2844" PostTypeId="2" ParentId="2842" CreationDate="2014-10-30T09:55:43.150" Score="5" Body="&lt;p&gt;It's possible with a &lt;code&gt;pattern-transformer&lt;/code&gt;.&#xA;Here's a sample code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(helm :sources&#xA;          `((name . &quot;Headings&quot;)&#xA;            (candidates . ,candidates)&#xA;            (action . (lambda (x) (goto-char x)&#xA;                         (call-interactively 'show-branches)&#xA;                         (worf-more)))&#xA;            (pattern-transformer . worf--pattern-transformer)))&#xA;&#xA;(defun worf--pattern-transformer (x)&#xA;  &quot;Transform X to make 1-9 select the heading level in `worf-goto'.&quot;&#xA;  (if (string-match &quot;^[1-9]&quot; x)&#xA;      (setq x (format &quot;^%s&quot; x))&#xA;    x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-10-30T09:55:43.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2845" PostTypeId="2" ParentId="2797" CreationDate="2014-10-30T10:29:56.713" Score="22" Body="&lt;p&gt;I've added the following to my &lt;code&gt;init.el&lt;/code&gt; file (I don't have a &lt;code&gt;.emacs&lt;/code&gt;file in &lt;code&gt;~&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq package-enable-at-startup nil) (package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and then at the end&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(custom-enabled-themes (quote (solarized-dark)))&#xA; '(custom-safe-themes&#xA;   (quote&#xA;        (&amp;quot;8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4&amp;quot; default))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That seems to work. I'm not very familiar with emacs so I have no idea whether this is a bad workaround...&lt;/p&gt;&#xA;" OwnerUserId="2312" LastEditorUserId="38241" LastEditDate="2022-06-14T15:56:56.320" LastActivityDate="2022-06-14T15:56:56.320" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="2846" PostTypeId="2" ParentId="2842" CreationDate="2014-10-30T10:38:04.140" Score="2" Body="&lt;p&gt;The reason the character is not included because potentially a filename can contain that character. Btw, you are using the Helm version of &lt;code&gt;find-file&lt;/code&gt;, not the actual &lt;code&gt;helm-find-files&lt;/code&gt;. The &lt;code&gt;helm-find-files&lt;/code&gt; command can fuzzy match, so you can just type &quot;emd&quot; to get to &lt;code&gt;~/.emacs.d&lt;/code&gt;, and even if you type &quot;em&quot;, the command should give you &lt;code&gt;~/.emacs.d&lt;/code&gt; first. Check the &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-7&quot; rel=&quot;nofollow&quot;&gt;helm-find-files section&lt;/a&gt; in my guide.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-30T10:38:04.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2847" PostTypeId="1" AcceptedAnswerId="2848" CreationDate="2014-10-30T10:49:17.753" Score="2" ViewCount="2486" Body="&lt;p&gt;I'm using Emacs 24.4.1 from Debian unstable and have added the lines from question &quot;&lt;a href=&quot;https://emacs.stackexchange.com/a/850/2291&quot;&gt;How do I switch buffers quickly?&lt;/a&gt;&quot;. However this results in an error message and I found no way to resolve it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can reproduce it by adding the following line into the &lt;code&gt;*scratch*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ido-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;j&lt;/kbd&gt; I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function use-package)&#xA;  (use-package ido-mode)&#xA;  eval((use-package ido-mode) nil)&#xA;  eval-last-sexp-1(t)&#xA;  eval-last-sexp(t)&#xA;  eval-print-last-sexp(nil)&#xA;  call-interactively(eval-print-last-sexp)&#xA;  popup-menu((keymap (new-file menu-item &quot;Visit New File...&quot; find-file :enable (menu-bar-non-minibuffer-window-p) :help &quot;Specify a new file's name, to edit th$&#xA;  menu-bar-open()&#xA;  call-interactively(menu-bar-open nil nil)&#xA;  command-execute(menu-bar-open)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why occurs this message and what should I do to get &lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="25" LastEditDate="2014-11-10T00:35:30.867" LastActivityDate="2014-11-10T00:35:30.867" Title="void-function when loading ido-mode in Emacs24" Tags="|package|use-package|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2848" PostTypeId="2" ParentId="2847" CreationDate="2014-10-30T10:55:00.660" Score="9" Body="&lt;p&gt;&lt;em&gt;use-package&lt;/em&gt; is not part of standard Emacs. It's an extension you can install via the package manager from Melpa &lt;a href=&quot;http://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;or download direct&lt;/a&gt; and as such you will need to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'use-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before you can use it to manage you package loads.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="115" LastEditDate="2014-10-30T10:59:06.863" LastActivityDate="2014-10-30T10:59:06.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2849" PostTypeId="1" AcceptedAnswerId="2854" CreationDate="2014-10-30T11:14:57.473" Score="20" ViewCount="8419" Body="&lt;p&gt;My files have long filenames and a part of the filename is a date and a version number. Often I'd like to save the file in the buffer using &lt;em&gt;nearly&lt;/em&gt; the same name, just change version number or date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would be much easier, if I had a command which puts the filename of the current buffer into the kill ring, so that I can open a file, then type &lt;code&gt;C-x C-w&lt;/code&gt; (write file),  yank the current name with C-y, change it and save it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.3 on Windows and 24.4 on Linux. I have to use different filenames and not git for various reasons. I'd be happy if this command worked with AUCTeX / LaTeX as major mode. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made a mistake: I don't want to type &lt;code&gt;C-x C-f&lt;/code&gt; (=find file), but &lt;code&gt;C-x C-w&lt;/code&gt; (=write file). I corrected this above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Found a duplicate question and answer: &lt;a href=&quot;https://unix.stackexchange.com/a/45381&quot;&gt;https://unix.stackexchange.com/a/45381&lt;/a&gt; But there is no better anwswer!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Components.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Components.html&lt;/a&gt; is a function, which selects the &quot;nondirectory&quot; part of the filname:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Function: file-name-nondirectory filename&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This function returns the nondirectory part of filename.&#xA;&#xA;          (file-name-nondirectory &quot;lewis/foo&quot;)&#xA;               ⇒ &quot;foo&quot;&#xA;          (file-name-nondirectory &quot;foo&quot;)&#xA;               ⇒ &quot;foo&quot;&#xA;          (file-name-nondirectory &quot;lewis/&quot;)&#xA;               ⇒ &quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I only knew lisp...&lt;/p&gt;&#xA;" OwnerUserId="2334" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2014-10-30T15:31:01.030" Title="Save current file with a slightly different name" Tags="|files|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2850" PostTypeId="2" ParentId="2849" CreationDate="2014-10-30T11:26:49.160" Score="4" Body="&lt;h3&gt;Copying the name of file in the current buffer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Here is a function I use from &lt;a href=&quot;http://camdez.com/blog/2013/11/14/emacs-show-buffer-file-name&quot; rel=&quot;nofollow&quot;&gt;Cameron Desautels' blog&lt;/a&gt; that copies the current buffer file name and displays it in minibuffer. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt; &#xA;;; Source: http://camdez.com/blog/2013/11/14/emacs-show-buffer-file-name/&#xA;(defun show-copy-buffer-file-name ()&#xA;  &quot;Show the full path to the current file in the minibuffer and also copy it to the kill-ring.&quot;&#xA;  (interactive)&#xA;  (let ((file-name (buffer-file-name)))&#xA;    (if file-name&#xA;        (progn&#xA;          (message file-name)&#xA;          (kill-new file-name))&#xA;      (error &quot;Buffer not visiting a file&quot;))))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Renaming the name of file in current buffer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/magnars&quot; rel=&quot;nofollow&quot;&gt;Magnar Sveen&lt;/a&gt; has implemented the below function in &lt;a href=&quot;http://www.whattheemacsd.com/&quot; rel=&quot;nofollow&quot;&gt;one of his blogs&lt;/a&gt; that conveniently renames the current buffer in one go. This is not what you asked for but I thought it could be related to your use case. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;;; Source: http://www.whattheemacsd.com/&#xA;(defun rename-current-buffer-file ()&#xA;  &quot;Renames current buffer and file it is visiting.&quot;&#xA;  (interactive)&#xA;  (let ((name (buffer-name))&#xA;        (filename (buffer-file-name)))&#xA;    (if (not (and filename (file-exists-p filename)))&#xA;        (error &quot;Buffer '%s' is not visiting a file!&quot; name)&#xA;      (let ((new-name (read-file-name &quot;New name: &quot; filename)))&#xA;        (if (get-buffer new-name)&#xA;            (error &quot;A buffer named '%s' already exists!&quot; new-name)&#xA;          (rename-file filename new-name 1)&#xA;          (rename-buffer new-name)&#xA;          (set-visited-file-name new-name)&#xA;          (set-buffer-modified-p nil)&#xA;          (message &quot;File '%s' successfully renamed to '%s'.&quot;&#xA;                   name (file-name-nondirectory new-name)))))))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-10-30T11:56:00.693" LastActivityDate="2014-10-30T11:56:00.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2851" PostTypeId="1" AcceptedAnswerId="2859" CreationDate="2014-10-30T11:55:05.860" Score="3" ViewCount="639" Body="&lt;p&gt;I'm using GNUS to access a bunch of IMAP servers. When composing new messages it would be nice to have access to the companies ldap server for autocompletion on address headers TO/CC/BCC. Is this possible, and if, how?&lt;/p&gt;&#xA;" OwnerUserId="295" LastActivityDate="2014-10-30T23:55:34.787" Title="How can I access an LDAP-Server to autocomplete address headers in message-mode/GNUS" Tags="|gnus|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2852" PostTypeId="1" AcceptedAnswerId="2855" CreationDate="2014-10-30T12:19:08.900" Score="1" ViewCount="971" Body="&lt;p&gt;I'm running &lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)&#xA; of 2014-10-20 on builder10-9.porkrind.org&lt;/code&gt;, the one available form gnuemacsformacosx.com. After upgrading, my modeline was mostly blank, and it seemed that this error was due to something involving &lt;code&gt;powerline&lt;/code&gt;. In any case, I decided to switch to &lt;code&gt;smart-mode-line&lt;/code&gt;. So I installed the latter package and have attempted to delete &lt;code&gt;powerline&lt;/code&gt; by&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;deleting it from the package list using &lt;code&gt;d&lt;/code&gt;, &lt;code&gt;x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;deleting all occurrences of expressions containing 'powerline' in my &lt;code&gt;.emacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However, I am still receiving the following error in my messages when I launch Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Eager macro-expansion failure: (error &quot;Autoloading failed to define function defpowerline&quot;)&#xA;Error: (file-error &quot;Cannot open load file&quot; &quot;no such file or directory&quot; &quot;powerline&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I cannot figure out how to track down the cause of this error. I'm most grateful for any help!&lt;/p&gt;&#xA;" OwnerUserId="293" LastActivityDate="2014-10-30T14:49:29.337" Title="How do I fully uninstall/erradicate powerline?" Tags="|package|emacs24.4|powerline|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2853" PostTypeId="2" ParentId="2837" CreationDate="2014-10-30T12:31:43.127" Score="13" Body="&lt;p&gt;Emacs-24.4's &lt;code&gt;electric-pair-mode&lt;/code&gt; does one part of what you want already (this mode is very similar to autopair.el, not sure how it compares to smartparens).&#xA;And &lt;code&gt;c-toggle-auto-newline&lt;/code&gt; does the other part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But sadly they don't work right together.  Please &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; so we can fix that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;code&gt;c-toggle-auto-newline&lt;/code&gt;, you can also use &lt;code&gt;electric-layout-mode&lt;/code&gt; with a setting like &lt;code&gt;(setq electric-layout-rules '((?\{ . around) (?\} . around)))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2014-10-30T12:42:55.530" LastActivityDate="2014-10-30T12:42:55.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2854" PostTypeId="2" ParentId="2849" CreationDate="2014-10-30T13:02:42.253" Score="31" Body="&lt;p&gt;&lt;strong&gt;There's no need to do all that.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Still in the original file, hit &lt;code&gt;C-x C-w&lt;/code&gt;. You will be prompted for a new filename.&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;M-n&lt;/code&gt;, and the current filename will be inserted for you.&lt;/li&gt;&#xA;&lt;li&gt;Edit what you want and hit &lt;code&gt;RET&lt;/code&gt; to save the file to this new name.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You will still have the original file. If you want to go back to it, just visit it again with &lt;code&gt;C-x C-f&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-10-30T13:02:42.253" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2855" PostTypeId="2" ParentId="2852" CreationDate="2014-10-30T14:21:41.373" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;deleting it from the package list using d, x &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Normally, it should have worked nice. What about reinstall the powerline package by first deleting it in elpa folder and restart emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, isn't there a byte compiled file loaded somewhere? You will probably need to recompile it after removing powerline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've just found this &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/33#issuecomment-60463015&quot; rel=&quot;nofollow&quot;&gt;github issue&lt;/a&gt;. Not really the same environment, but I think it could help.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-10-30T14:49:29.337" LastActivityDate="2014-10-30T14:49:29.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2856" PostTypeId="1" CreationDate="2014-10-30T14:42:14.490" Score="17" ViewCount="3729" Body="&lt;p&gt;In org-mode I can define external links for example as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file+sys:path/to/document.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The file document.pdf is then opened with an external pdf viewer. The &lt;a href=&quot;http://orgmode.org/manual/External-links.html&quot;&gt;org-mode documentation&lt;/a&gt; claims that this command &quot;open[s] via OS, like double-click&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is, however, a difference to &quot;double-click&quot;, as I find that the system-specific default applications (for documents, websites, videos, etc.) are not respected in my setup; On Ubuntu 12.04 the default application for webpages was set to Firefox and only through org-mode local .html files are still openend with Chromium. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I configure org-mode to respect my default application settings?&lt;/p&gt;&#xA;" OwnerUserId="338" LastActivityDate="2022-10-21T02:56:59.837" Title="How to configure org-mode to respect system-specific default applications for external links?" Tags="|org-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2857" PostTypeId="1" AcceptedAnswerId="2863" CreationDate="2014-10-30T14:48:12.347" Score="12" ViewCount="226" Body="&lt;p&gt;I maintain a number of elisp packages (e.g. codesearch, emacs-ycmd, traad) that would benefit from being able to install the external programs that they use, saving time and effort for some users. For example, with codesearch.el it would be nice to be able to download, compile, and install the codesearch tools (written in go, not elisp) for users. This would remove at least one barrier for using the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any &quot;best practices&quot; for doing this? For example, where should I put the external programs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If if you don't have any direct advice, can you refer me to any packages that do something like this (and, ideally, that do it well)?&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="25" LastEditDate="2014-11-10T00:47:18.083" LastActivityDate="2014-11-10T04:51:59.580" Title="Proper approach to providing external programs along with packages?" Tags="|package|package-development|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2858" PostTypeId="2" ParentId="2856" CreationDate="2014-10-30T15:04:44.757" Score="9" Body="&lt;p&gt;Here are my settings:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-file-apps&#xA;      '((auto-mode . emacs)&#xA;        (&quot;\\.x?html?\\'&quot; . &quot;firefox %s&quot;)&#xA;        (&quot;\\.pdf\\'&quot; . &quot;evince \&quot;%s\&quot;&quot;)&#xA;        (&quot;\\.pdf::\\([0-9]+\\)\\'&quot; . &quot;evince \&quot;%s\&quot; -p %1&quot;)&#xA;        (&quot;\\.pdf.xoj&quot; . &quot;xournal %s&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-10-30T15:04:44.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2859" PostTypeId="2" ParentId="2851" CreationDate="2014-10-30T15:15:05.413" Score="1" Body="&lt;p&gt;[Update per comments]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer: I'm not using EUDC or LDAP at this time, thus I have no current setup of it.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've had success with &lt;a href=&quot;http://www.emacswiki.org/emacs/EUDC&quot; rel=&quot;nofollow&quot;&gt;EUDC&lt;/a&gt; in the past, it wasn't complicated to setup with autocompletion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I copied exactly the configuration described in the &lt;code&gt;EUDC&lt;/code&gt; wiki page. &#xA;The only thing that I recall being an issue was making sure that I had the right LDAP &lt;code&gt;base&lt;/code&gt;, &lt;code&gt;address&lt;/code&gt; and &lt;code&gt;binddn&lt;/code&gt; fields setup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ended up setting credentials via &lt;code&gt;M-x customize-group&lt;/code&gt; as I far as I know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then replaced all the related server fields with my configuration (Copying wiki stuff here, just for inline reference...).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ldap)&#xA;(require 'eudc)&#xA;&#xA;(setq eudc-default-return-attributes nil&#xA;      eudc-strict-return-matches nil)&#xA;&#xA;(setq ldap-ldapsearch-args (quote (&quot;-tt&quot; &quot;-LLL&quot; &quot;-x&quot;)))&#xA;(setq eudc-inline-query-format '((name)&#xA;                                 (firstname)&#xA;                                 (firstname name)&#xA;                                 (email)&#xA;                                 ))&#xA;&#xA;(setq ldap-host-parameters-alist&#xA;      (quote ((&quot;your_server&quot; base &quot;ou=addressbook,dc=your_dc_here,dc=fr&quot;&#xA;               binddn &quot;cn=admin,dc=your_dc_here,dc=fr&quot;&#xA;               passwd &quot;your_password&quot;))))&#xA;&#xA;(eudc-set-server &quot;your_server&quot; 'ldap t)&#xA;(setq eudc-server-hotlist '((&quot;your_server&quot; . ldap)))&#xA;(setq eudc-inline-expansion-servers 'hotlist)&#xA;&#xA;(defun enz-eudc-expand-inline()&#xA;  (interactive)&#xA;  (move-end-of-line 1)&#xA;  (insert &quot;*&quot;)&#xA;  (unless (condition-case nil&#xA;              (eudc-expand-inline)&#xA;            (error nil))&#xA;    (backward-delete-char-untabify 1))&#xA;  )&#xA;&#xA;;; Adds some hooks&#xA;&#xA;(eval-after-load &quot;message&quot;&#xA;  '(define-key message-mode-map (kbd &quot;TAB&quot;) 'enz-eudc-expand-inline))&#xA;(eval-after-load &quot;sendmail&quot;&#xA;  '(define-key mail-mode-map (kbd &quot;TAB&quot;) 'enz-eudc-expand-inline))&#xA;(eval-after-load &quot;post&quot;&#xA;  '(define-key post-mode-map (kbd &quot;TAB&quot;) 'enz-eudc-expand-inline))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="943" LastEditorUserId="943" LastEditDate="2014-10-30T23:55:34.787" LastActivityDate="2014-10-30T23:55:34.787" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2860" PostTypeId="1" AcceptedAnswerId="2892" CreationDate="2014-10-30T16:40:21.673" Score="1" ViewCount="387" Body="&lt;p&gt;TL;DR: How can I force evaluation of a &lt;code&gt;setq&lt;/code&gt; statement at start-up so that &lt;code&gt;imenu&lt;/code&gt; updates appropriately?  (You can skip down to the second code-block below, if you want.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I love the concept of &lt;code&gt;imenu&lt;/code&gt; (esp. when integrated with &lt;code&gt;helm&lt;/code&gt;) and I think it has great potential to improve my workflow...assuming I learn how to correctly set definitions for &lt;code&gt;imenu&lt;/code&gt; categories.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a simplified example, let's say that I'd like to add a few definitions to my &lt;code&gt;init&lt;/code&gt; file's &lt;code&gt;imenu&lt;/code&gt; which would be useful when making updates - namely, the list of imported packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's consider the following three lines as the code we want to parse (purely illustrative; my &lt;code&gt;init&lt;/code&gt; file doesn't actually have an explicit line for importing &lt;code&gt;dired&lt;/code&gt; and &lt;code&gt;electric&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst dc/default-directory &quot;/path/to/directory&quot;)&#xA;(use-package dired)&#xA;(use-package electric)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to extract the constants and package names in &lt;code&gt;imenu&lt;/code&gt;, I've included the code below in my &lt;code&gt;init.el&lt;/code&gt; file.  This code works BUT only after I manually &lt;code&gt;eval&lt;/code&gt; the second line, (i.e., the second &lt;code&gt;setq&lt;/code&gt; statement below).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dc-additions '((&quot;Imported packages&quot; &quot;.*(use-package \\(.*\\))*&quot; 1)&#xA;                     (&quot;Defined constants&quot; &quot;.*(defconst \\(.*\\))*&quot;    1)))&#xA;(setq imenu-generic-expression (copy-sequence `(,@dc-additions ,@imenu-generic-expression)))&#xA;(add-hook 'emacs-lisp-mode 'imenu-generic-expression)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I don't manually evaluate the second step, the &lt;code&gt;imenu&lt;/code&gt; list shows only the default definitions.  However, after I &lt;code&gt;eval&lt;/code&gt; the second statement above, the &lt;code&gt;imenu&lt;/code&gt; list correctly include includes items based on my definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I force evaluation of the second statement?  In other words, what can I do to to ensure that &lt;code&gt;imenu&lt;/code&gt; will automatically consider items based on my definition?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Exhibit 1: &lt;code&gt;imenu&lt;/code&gt; after start-up but before I manually &lt;code&gt;eval&lt;/code&gt; the second &lt;code&gt;setq&lt;/code&gt; statement:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Kv78R.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exhibit 2: &lt;code&gt;imenu&lt;/code&gt; after I manually &lt;code&gt;eval&lt;/code&gt; the statement:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iKKqe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="2084" LastEditDate="2014-10-31T01:48:50.700" LastActivityDate="2014-11-10T06:28:44.320" Title="How to force evaluation of a statement in my `init` file?" Tags="|elisp|helm|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2861" PostTypeId="1" CreationDate="2014-10-30T18:49:51.120" Score="28" ViewCount="7315" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; can Emacs be installed/used on a tablet with a minimum number of tears?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had been under the assumption that Emacs ran on basically everything.  However, after some poking around, it looks like running Emacs on a tablet could be an enormous &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsOnAndroid&quot;&gt;headache&lt;/a&gt;.  But what do I know?  Hence, the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have a tablet so my terminology will probably be grandma-level out-of-touch. My limited understanding is that Apple won't let Emacs into the Appstore, but there's possibly a &lt;a href=&quot;https://chriskohlhepp.wordpress.com/emacs-ocaml-on-ipad/&quot;&gt;jailbroken version&lt;/a&gt; that exists in the ether.  There was a time when one could get it in the Google Play store for Android, but it's &lt;a href=&quot;http://quoderat.megginson.com/2014/02/17/how-to-install-a-usable-emacs-in-android-feb-2014/&quot;&gt;old, broken, and requires some non-trivial fiddling&lt;/a&gt;. I find it hard to believe that the only viable option is to use &lt;a href=&quot;http://yoo2080.wordpress.com/2014/03/26/using-emacs-with-windows-8-touch-keyboard/&quot;&gt;Emacs on a Windows tablet&lt;/a&gt;, perhaps because the irony is just too great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm mostly interested in whether we can do this on an Apple or Android tablet, not out of rapturous love for either platform, but simply because they're so ubiquitous and yet seemingly unsupported.  So:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;can we get a fully (or even mostly) functional Emacs running, preferably one that is not a one-shot deal, but rather updated with new releases?&lt;/li&gt;&#xA;&lt;li&gt;install it with a minimum of tears, meaning without jailbreaking a device or spending an inordinate amount of time on a &lt;a href=&quot;http://www.rubegoldberg.com/&quot;&gt;Rube Goldberg-esque&lt;/a&gt; installation?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastEditorUserId="25" LastEditDate="2015-04-19T14:04:29.050" LastActivityDate="2023-02-11T11:32:47.703" Title="Emacs on a tablet?" Tags="|android|ios|" AnswerCount="9" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2862" PostTypeId="2" ParentId="2861" CreationDate="2014-10-30T18:58:18.293" Score="14" Body="&lt;p&gt;I use &lt;a href=&quot;https://play.google.com/store/apps/details?id=ru.meefik.linuxdeploy&amp;amp;hl=en&quot;&gt;Linux Deploy&lt;/a&gt; to run Debian in a &lt;code&gt;chroot&lt;/code&gt; environment on my Nexus 7 tablet. With that, I can do whatever I want, including running Emacs. It's fully functional, complete with all the latest updates and packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you choose to go with an Android device and don't use a bluetooth keyboard, I'd recommend looking into the &lt;a href=&quot;https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard&amp;amp;hl=en&quot;&gt;Hacker's Keyboard&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you absolutely don't want to root your device (which is trivial for most devices), you can try &lt;a href=&quot;https://play.google.com/store/apps/details?id=champion.gnuroot&amp;amp;hl=en&quot;&gt;GNURoot&lt;/a&gt;, though I haven't tested that myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess to make my process a little more clear, here it is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install Linux Deploy on tablet&lt;/li&gt;&#xA;&lt;li&gt;Use Linux Deploy to install a Debian, or Arch, or Ubuntu environment&lt;/li&gt;&#xA;&lt;li&gt;Start the environment in Linux Deploy&lt;/li&gt;&#xA;&lt;li&gt;SSH into the environment using the SSH application of your choice (mine is &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.sonelli.juicessh&amp;amp;hl=en&quot;&gt;JuiceSSH&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;You are now basically using a Linux device. Use whatever package manager you choose to install whatever packages you choose.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2014-10-30T19:03:40.430" LastActivityDate="2014-10-30T19:03:40.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2863" PostTypeId="2" ParentId="2857" CreationDate="2014-10-30T20:15:08.207" Score="3" Body="&lt;p&gt;There's no &quot;best practices&quot; for that, no.  Nor any kind of existing support for it.  I think if it's installed specifically for package Foo, then the place to install it would be within the directory of package Foo.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for how to do it, asuming your Elisp package is installed via ELPA, then you might want to try to add in your main Elisp file something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile (call-process &quot;make&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then provide an appropriate Makefile.  Of course, for it to work in &quot;most&quot; platforms, you'll probably want something a bit more sophisticated.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-30T20:15:08.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2864" PostTypeId="1" AcceptedAnswerId="2866" CreationDate="2014-10-30T20:19:17.157" Score="7" ViewCount="1869" Body="&lt;p&gt;I'm trying to install &lt;a href=&quot;https://github.com/ejmr/php-mode&quot;&gt;php-mode&lt;/a&gt;, but I keep encountering this error when I run &lt;code&gt;M-x php-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: cl-macroexpand-all&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error persists whether I install php-mode via MELPA or manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Environment: Emacs 24.3.94.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)&#xA; of 2014-10-04 on builder10-9.porkrind.org&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why won't php-mode run? Note: I'm relatively new to Emacs, and inexperienced.&lt;/p&gt;&#xA;" OwnerUserId="2342" LastEditorUserId="50" LastEditDate="2014-10-30T20:37:39.883" LastActivityDate="2014-12-19T22:02:47.477" Title="&quot;Symbol's function definition is void: cl-macroexpand-all&quot; when trying to install php-mode" Tags="|package|cl-lib|php-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2866" PostTypeId="2" ParentId="2864" CreationDate="2014-10-30T20:34:30.743" Score="7" Body="&lt;p&gt;The function &lt;code&gt;cl-macroexpand-all&lt;/code&gt; has been obsoleted in Emacs 24.3; you are now supposed to use &lt;code&gt;macroexpand-all&lt;/code&gt; instead, which is part of core Emacs, not the CL library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CL library defines &lt;code&gt;cl-macroexpand-all&lt;/code&gt; as an alias for &lt;code&gt;macroexpand-all&lt;/code&gt;, so in principle you could do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your init file to fix the problem.  However, the &lt;code&gt;cl&lt;/code&gt; library itself is being deprecated, and using it is not recommended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you should contact the authors of &lt;code&gt;php-mode&lt;/code&gt; and tell them to use &lt;code&gt;macroexpand-all&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-10-30T20:34:30.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2867" PostTypeId="1" AcceptedAnswerId="2880" CreationDate="2014-10-30T20:35:22.850" Score="43" ViewCount="11069" Body="&lt;p&gt;As an Emacs newbie, I found IDO and loved it since it made searching for files so much quicker. After spending some time on this site, I've read more and more about Helm and I'm planning on making the switch. Some of my questions are: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What are the biggest differences? &lt;/li&gt;&#xA;&lt;li&gt;Specifically, how should my workflow change when finding files, switching buffers, or calling new commands?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I used &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot;&gt;this post&lt;/a&gt; to set up Helm, but my file searches (&lt;code&gt;C-x C-f&lt;/code&gt;) and buffer switches (&lt;code&gt;C-x b&lt;/code&gt;) look pretty much the same as they did before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm)&#xA;(require 'helm-config)&#xA;&#xA;;; The default &quot;C-x c&quot; is quite close to &quot;C-x C-c&quot;, which quits Emacs.&#xA;;; Changed to &quot;C-c h&quot;. Note: We must set &quot;C-c h&quot; globally, because we&#xA;;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.&#xA;(global-set-key (kbd &quot;C-c h&quot;) 'helm-command-prefix)&#xA;(global-unset-key (kbd &quot;C-x c&quot;))&#xA;&#xA;(define-key helm-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'helm-execute-persistent-action) ; rebihnd tab to do persistent action&#xA;(define-key helm-map (kbd &quot;C-i&quot;) 'helm-execute-persistent-action) ; make TAB works in terminal&#xA;(define-key helm-map (kbd &quot;C-z&quot;)  'helm-select-action) ; list actions using C-z&#xA;&#xA;(when (executable-find &quot;curl&quot;)&#xA;  (setq helm-google-suggest-use-curl-p t))&#xA;&#xA;(setq helm-quick-update                     t ; do not display invisible candidates&#xA;      helm-split-window-in-side-p           t ; open helm buffer inside current window, not occupy whole other window&#xA;      helm-buffers-fuzzy-matching           t ; fuzzy matching buffer names when non--nil&#xA;      helm-move-to-line-cycle-in-source     t ; move to end or beginning of source when reaching top or bottom of source.&#xA;      helm-ff-search-library-in-sexp        t ; search for library in `require' and `declare-function' sexp.&#xA;      helm-scroll-amount                    8 ; scroll 8 lines other window using M-&amp;lt;next&amp;gt;/M-&amp;lt;prior&amp;gt;&#xA;      helm-ff-file-name-history-use-recentf t)&#xA;&#xA;(helm-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastEditorUserId="45" LastEditDate="2014-10-30T21:57:19.753" LastActivityDate="2014-11-20T12:46:03.317" Title="How should I change my workflow when moving from IDO to Helm" Tags="|helm|ido|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2868" PostTypeId="1" AcceptedAnswerId="2898" CreationDate="2014-10-30T21:02:13.810" Score="15" ViewCount="1859" Body="&lt;p&gt;In a recent &lt;a href=&quot;https://emacs.stackexchange.com/questions/145/what-are-some-built-in-packages-with-nice-source-code/151#151&quot;&gt;answer&lt;/a&gt; by &lt;a href=&quot;https://emacs.stackexchange.com/users/227/lunaryorn&quot;&gt;lunaryorn&lt;/a&gt;, he stated: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, I'd recommend against most other parts of Org, for reasons&#xA;  already stated in comments: It's old, and full of legacy and harmful&#xA;  practices (e.g. find-file-noselect to read files non-interactively).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain why is &lt;code&gt;find-file-noselect&lt;/code&gt; a bad idea to read files in Elisp programs? Is there a better way? I'm asking because I was thinking of using it in one of my projects.&lt;/p&gt;&#xA;" OwnerUserId="642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-10-31T10:02:39.010" Title="What's wrong with `find-file-noselect`?" Tags="|files|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2869" PostTypeId="1" AcceptedAnswerId="2885" CreationDate="2014-10-30T21:11:22.627" Score="17" ViewCount="1950" Body="&lt;p&gt;I'm writting a package which dowloads a list of healines, contents,&#xA;and some other properties, which are to be displayed to the user. For&#xA;the moment, an &lt;code&gt;org-mode&lt;/code&gt; buffer seems like a good way of displaying&#xA;these headlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is an example of how this list might be structured. It is merely&#xA;illustrative, I can easily convert it to any other structure as&#xA;necessary.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;One headline&quot; &quot;Some much longer content.&quot;&#xA;   (property1 . value)&#xA;   (property2 . value))&#xA;  (&quot;Second headline&quot; &quot;More much longer content.&quot;&#xA;   (property1 . value)&#xA;   (property2 . value)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a function or package which prints such a list into an &lt;code&gt;org-mode&lt;/code&gt; buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the desired output.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* One headline&#xA;  :PROPERTIES:&#xA;  :property1: value&#xA;  :property2: value&#xA;  :END:&#xA;Some much longer content.&#xA;&#xA;* Second headline&#xA;  :PROPERTIES:&#xA;  :property1: value&#xA;  :property2: value&#xA;  :END:&#xA;More much longer content.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could do this manually, I'm just wondering if there might be&#xA;something out there.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2016-02-06T18:13:19.480" Title="Turn a list or data structure into an org document" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2870" PostTypeId="1" AcceptedAnswerId="2872" CreationDate="2014-10-30T21:12:00.517" Score="7" ViewCount="347" Body="&lt;p&gt;Org mode indents scheduling by default even though I don't indent my text. Can I configure it so that &lt;code&gt;org-schedule&lt;/code&gt; doesn't indent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/p0M5N.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="253" LastEditDate="2015-12-22T00:45:51.650" LastActivityDate="2015-12-22T00:45:51.650" Title="How to control SCHEDULED indenting" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2871" PostTypeId="1" CreationDate="2014-10-30T21:34:36.200" Score="45" ViewCount="19329" Body="&lt;p&gt;How can I keep my .org files up to date across several computers, perhaps across multiple platforms(linux/windows)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could keep all the .org files in git for example, but that would require me to remember to pull and push to keep the repo updated. Could work with a few scripts to automatically handle the files, as I don't have that many.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could try using dropbox for this as well. I'd assume dropbox syncs the files often enough to not cause problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does org-mode offer any functionality to help with synchronizing the files across multiple locations?&lt;/p&gt;&#xA;" OwnerUserId="2042" LastActivityDate="2021-04-05T07:02:30.553" Title="Keeping my .org files in sync across multiple computers" Tags="|org-mode|" AnswerCount="10" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2872" PostTypeId="2" ParentId="2870" CreationDate="2014-10-30T21:36:15.450" Score="9" Body="&lt;p&gt;The variable &lt;code&gt;org-adapt-indentation&lt;/code&gt; controls the indentation relative to the outline level.  It defaults to &lt;code&gt;t&lt;/code&gt;; setting it to &lt;code&gt;nil&lt;/code&gt; will turn it off, with the practical effect that things like the scheduling, deadlines, property drawers, etc., will start in the first column.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-30T21:36:15.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2873" PostTypeId="2" ParentId="2871" CreationDate="2014-10-30T21:46:18.473" Score="9" Body="&lt;p&gt;Org files are just plain text files, so any technique that is able to synchronise plain text files will work fine with org files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My favourite synchronisation tool is &lt;a href=&quot;http://www.cis.upenn.edu/~bcpierce/unison/&quot; rel=&quot;noreferrer&quot;&gt;Unison&lt;/a&gt;.  With the right configuration file, I type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;unison org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and Unison will compare files in my &lt;code&gt;~/org/&lt;/code&gt; directories on both my machines, let me interactively review its actions, then copy the files that need to be copied and invoke an external merge tool for the files that need merging.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2014-10-31T00:23:29.863" LastActivityDate="2014-10-31T00:23:29.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2874" PostTypeId="2" ParentId="2871" CreationDate="2014-10-30T22:00:55.627" Score="4" Body="&lt;p&gt;Org mode does not provide any syncing functionality itself. You would have to rely on a separate application like Dropbox to sync your files. Dropbox syncs not just often, but immediately when files change, so unless you change a file and immediately shut off your computer, you will keep your files in sync.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-10-30T22:00:55.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2875" PostTypeId="2" ParentId="2856" CreationDate="2014-10-30T22:10:46.673" Score="6" Body="&lt;p&gt;If you are using a Linux desktop environment, chances are that it is using xdg-utils. See &lt;a href=&quot;http://jordiinglada.net/wp/2014/10/29/xdg-open-or-computer-do-what-i-mean-3/&quot; rel=&quot;noreferrer&quot;&gt;this blog post&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, you may do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-file-apps&#xA;      '((auto-mode . emacs)&#xA;        (&quot;\\.x?html?\\'&quot; . &quot;xdg-open %s&quot;)&#xA;        (&quot;\\.pdf\\'&quot; . &quot;xdg-ope, \&quot;%s\&quot;&quot;)&#xA;        (&quot;\\.pdf::\\([0-9]+\\)\\'&quot; . &quot;xdg-open \&quot;%s\&quot; -p %1&quot;)&#xA;        (&quot;\\.pdf.xoj&quot; . &quot;xournal %s&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2295" LastActivityDate="2014-10-30T22:10:46.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2876" PostTypeId="2" ParentId="2871" CreationDate="2014-10-30T22:23:34.480" Score="0" Body="&lt;p&gt;Dropbox (or any other cloud storage I guess) is the way to go. In addition, this is really handy to synchronize the Emacs setup in &lt;code&gt;~/.emacs.d&lt;/code&gt; (use &lt;code&gt;mklink&lt;/code&gt; on Windows).&lt;/p&gt;&#xA;" OwnerUserId="2317" LastActivityDate="2014-10-30T22:23:34.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2877" PostTypeId="2" ParentId="2869" CreationDate="2014-10-30T23:00:04.340" Score="2" Body="&lt;p&gt;I've sort of tangentially looked at this issue. Take a look at the &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-protocol.html&quot; rel=&quot;nofollow&quot;&gt;org-protocol.el&lt;/a&gt;. It's bundled with org-mode. Specifically, the org-protocol-do-capture function converts a list, &quot;parts&quot; (which you seem to already have), to org-mode properties using org-store-link-props function and then calls org-capture. This assumes that you have a capture template with placeholders such as %:link. You can define the properties to be whatever you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done &lt;a href=&quot;https://github.com/sk8ingdom/.emacs.d/blob/master/org-mode-config/org-protocol-templates.el&quot; rel=&quot;nofollow&quot;&gt;something similar&lt;/a&gt; to scrape title, author, date, source, etc. from site APIs. If you end up looking at this code, be sure to also look at capture-templates.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're working with JSON data, the json.el and / or request.el might be useful.&lt;/p&gt;&#xA;" OwnerUserId="804" LastActivityDate="2014-10-30T23:00:04.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2878" PostTypeId="2" ParentId="2868" CreationDate="2014-10-30T23:01:56.920" Score="10" Body="&lt;p&gt;From section 24.3 in the Elisp manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To copy the contents of a file into a buffer, use the function&#xA;  &lt;code&gt;insert-file-contents&lt;/code&gt;.  (Don't use the command &lt;code&gt;insert-file&lt;/code&gt; in a&#xA;  Lisp program, as that sets the mark.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Searching the Elisp documentation for &lt;code&gt;find-file-noselect&lt;/code&gt; it is obvious that it does much more than just reading a file into a buffer. Perhaps people who think using this function is a bad idea are thinking about the, possibly unwanted, side-effects? I guess it depends on what you want to achieve. If you want to have as clean/untouched buffer content as possible, it might be a good idea to use the old and trusty &lt;code&gt;with-temp-buffer&lt;/code&gt; + &lt;code&gt;insert-file-contents&lt;/code&gt;combination. If you want the buffer contents to be as close to what &lt;code&gt;find-file&lt;/code&gt; produce, perhaps you &lt;em&gt;do&lt;/em&gt; want to use &lt;code&gt;find-file-noselect&lt;/code&gt;? Or perhaps he was thinking about &lt;code&gt;find-file&lt;/code&gt; ;)&lt;/p&gt;&#xA;" OwnerUserId="320" LastActivityDate="2014-10-30T23:01:56.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2879" PostTypeId="2" ParentId="2807" CreationDate="2014-10-30T23:13:10.133" Score="11" Body="&lt;p&gt;Apart from the other tips you have got here I thought I should mention that &lt;code&gt;C-s&lt;/code&gt; sets the mark for you, so there is no need to do it explicitly. Also, many commands that &quot;move a potentially long way&quot; (&lt;code&gt;beginning-of-buffer&lt;/code&gt; and &lt;code&gt;end-of-buffer&lt;/code&gt; for example) also sets the mark where you started. Together with the other ways to work with the mark (pop, exchange point and mark, etc) it is a quite powerful way to work with a buffer, once you understand how it works. Also note that if you yank text into a buffer, point and mark surrounds the yanked text.&lt;/p&gt;&#xA;" OwnerUserId="320" LastActivityDate="2014-10-30T23:13:10.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2880" PostTypeId="2" ParentId="2867" CreationDate="2014-10-30T23:14:53.977" Score="29" Body="&lt;p&gt;&lt;strong&gt;UPDATED&lt;/strong&gt; (Helm changes, personal config changes, and Tu Do comments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I switched from IDO to Helm few years ago and I never looked back.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I find the presentation cleaner than let's say ido-vertical-mode for example. &lt;/li&gt;&#xA;&lt;li&gt;Helm doesn't have flex matching though.&lt;/li&gt;&#xA;&lt;li&gt;You don't need smex, etc. Helm does it all.&lt;/li&gt;&#xA;&lt;li&gt;The Tu do article is good as it provides some nice animated screenshots of what Helm can do.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I use Helm projectile, Helm swoop, Helm semantic, Helm ag and some of the Helm interactive commands. Checkout the &lt;a href=&quot;http://melpa.org/#/&quot;&gt;Melpa page&lt;/a&gt; for Helm related packages that might interest you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some of my Helm related setup :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-ff-transformer-show-only-basename nil&#xA;      helm-adaptive-history-file             &quot;~/.emacs.d/data/helm-history&quot;&#xA;      helm-yank-symbol-first                 t&#xA;      helm-move-to-line-cycle-in-source      t&#xA;      helm-buffers-fuzzy-matching            t&#xA;      helm-ff-auto-update-initial-value      t)&#xA;&#xA;(autoload 'helm-descbinds      &quot;helm-descbinds&quot; t)&#xA;(autoload 'helm-eshell-history &quot;helm-eshell&quot;    t)&#xA;(autoload 'helm-esh-pcomplete  &quot;helm-eshell&quot;    t)&#xA;&#xA;(global-set-key (kbd &quot;C-h a&quot;)    #'helm-apropos)&#xA;(global-set-key (kbd &quot;C-h i&quot;)    #'helm-info-emacs)&#xA;(global-set-key (kbd &quot;C-h b&quot;)    #'helm-descbinds)&#xA;&#xA;(add-hook 'eshell-mode-hook&#xA;          #'(lambda ()&#xA;              (define-key eshell-mode-map (kbd &quot;TAB&quot;)     #'helm-esh-pcomplete)&#xA;              (define-key eshell-mode-map (kbd &quot;C-c C-l&quot;) #'helm-eshell-history)))&#xA;&#xA;(global-set-key (kbd &quot;C-x b&quot;)   #'helm-mini)&#xA;(global-set-key (kbd &quot;C-x C-b&quot;) #'helm-buffers-list)&#xA;(global-set-key (kbd &quot;C-x C-m&quot;) #'helm-M-x)&#xA;(global-set-key (kbd &quot;C-x C-f&quot;) #'helm-find-files)&#xA;(global-set-key (kbd &quot;C-x C-r&quot;) #'helm-recentf)&#xA;(global-set-key (kbd &quot;C-x r l&quot;) #'helm-filtered-bookmarks)&#xA;(global-set-key (kbd &quot;M-y&quot;)     #'helm-show-kill-ring)&#xA;(global-set-key (kbd &quot;M-s o&quot;)   #'helm-swoop)&#xA;(global-set-key (kbd &quot;M-s /&quot;)   #'helm-multi-swoop)&#xA;&#xA;(require 'helm-config)&#xA;(helm-mode t)&#xA;(helm-adaptative-mode t)&#xA;&#xA;(global-set-key (kbd &quot;C-x c!&quot;)   #'helm-calcul-expression)&#xA;(global-set-key (kbd &quot;C-x c:&quot;)   #'helm-eval-expression-with-eldoc)&#xA;(define-key helm-map (kbd &quot;M-o&quot;) #'helm-previous-source)&#xA;&#xA;(global-set-key (kbd &quot;M-s s&quot;)   #'helm-ag)&#xA;&#xA;(require 'helm-projectile)&#xA;(setq helm-projectile-sources-list (cons 'helm-source-projectile-files-list&#xA;                                         (remove 'helm-source-projectile-files-list &#xA;                                              helm-projectile-sources-list)))&#xA;(helm-projectile-on)&#xA;&#xA;(define-key projectile-mode-map (kbd &quot;C-c p /&quot;)&#xA;  #'(lambda ()&#xA;      (interactive)&#xA;      (helm-ag (projectile-project-root))))&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-x c o h&quot;) #'helm-org-headlines)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="943" LastEditorUserId="943" LastEditDate="2014-11-20T12:46:03.317" LastActivityDate="2014-11-20T12:46:03.317" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2881" PostTypeId="1" AcceptedAnswerId="2894" CreationDate="2014-10-31T00:13:52.823" Score="4" ViewCount="198" Body="&lt;p&gt;I am having difficulties composing a regexp that will highlight certain &lt;em&gt;folder&lt;/em&gt; extensions -- &lt;strong&gt;including the preceding dot&lt;/strong&gt; -- with colors that are different than the rest of the folder -- e.g., &lt;code&gt;.app&lt;/code&gt; would be colored red; and &lt;code&gt;.git&lt;/code&gt; would be colored blue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The folder &lt;code&gt;Emacs.app&lt;/code&gt; would be colorized with &lt;code&gt;Emacs&lt;/code&gt; being a gray color and &lt;code&gt;.app&lt;/code&gt; would be a red color.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The folder &lt;code&gt;.0.context-menu.git&lt;/code&gt; would be colorized with &lt;code&gt;.0.context-menu&lt;/code&gt; being a gray color and &lt;code&gt;.git&lt;/code&gt; would be a blue color.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have a regexp that gets me from the left margin all the way to the beginning of the folder -- the variable for that regexp is named &lt;code&gt;folder-listing-before-filename-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I am having is that the regex &lt;code&gt;.*&lt;/code&gt; swallows up the folder extensions.  If I add &lt;code&gt;[^.]&lt;/code&gt;, that prevents me from using the dot later on with extensions like &lt;code&gt;.app&lt;/code&gt; and &lt;code&gt;.git&lt;/code&gt; -- I want the extension to include the dot when colored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regexp that leads up to the folder looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar folder-listing-before-filename-regexp&#xA;  (concat&#xA;    &quot;\\(^ +d[slrwxt+-]+\\)&quot;    ;; 1  permissions&#xA;    &quot;\\(\s\\)&quot;                 ;; 2&#xA;    &quot;\\([0-9]+\\|\s+[0-9]+\\)&quot; ;; 3  some small numbers&#xA;    &quot;\\(\s\\)&quot;                 ;; 4&#xA;    &quot;\\([a-zA-Z]+\\)&quot;          ;; 5  group&#xA;    &quot;\\(\s\\)&quot;                 ;; 6&#xA;    &quot;\\([a-zA-Z]+\\)&quot;          ;; 7  user&#xA;    &quot;\\(\s\\)&quot;                 ;; 8&#xA;    &quot;\\([\s0-9.kKMGT]+\\)&quot;     ;; 9  size&#xA;    &quot;\\(\s\\)&quot;                 ;; 10&#xA;    &quot;\\([0-9-]+\\)&quot;            ;; 11 date&#xA;    &quot;\\(\s\\)&quot;                 ;; 12&#xA;    &quot;\\([0-9:]+\\)&quot;            ;; 13 time&#xA;    &quot;\\(\s\\)&quot;))               ;; 14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is some test data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  drwxr-xr-x  79 HOME staff 2.7K 10-30-2014 16:42:18 .&#xA;  drwxr-xr-x  27 HOME staff  918 10-28-2014 13:08:59 ..&#xA;  drwxr-xr-x 162 HOME staff 5.4K 10-11-2014 11:34:16 .0.apel_flim_simi&#xA;  drwxr-xr-x 432 HOME staff  15K 10-29-2014 15:37:44 .0.backup&#xA;  drwxr-xr-x   5 HOME staff  170 10-19-2014 09:34:37 .0.context-menu.git&#xA;  drwxr-xr-x   5 HOME staff  170 10-19-2014 13:06:36 .0.dired-read-filename.git&#xA;  drwx------   4 HOME staff  136 04-29-2014 17:40:13 .0.eshell&#xA;  drwxr-xr-x   3 HOME staff  102 10-11-2014 10:29:03 .0.gh&#xA;  drwxr-xr-x   5 HOME staff  170 10-09-2014 21:16:35 .0.lorg-calendar.git&#xA;  drwxr-xr-x   5 HOME staff  170 10-09-2014 20:06:09 .0.lorg-search.git&#xA;  drwxr-xr-x  10 HOME staff  340 01-31-2014 19:37:31 .0.mail&#xA;  drwxr-xr-x  25 HOME staff  850 10-14-2014 13:23:31 .0.snippets&#xA;  drwxr-xr-x  23 HOME staff  782 12-03-2013 17:15:50 .0.sound&#xA;  drwxr-xr-x  27 HOME staff  918 10-18-2014 11:53:56 .0.sources&#xA;  drwxr-xr-x  67 HOME staff 2.3K 05-05-2014 23:19:12 .0.w3m&#xA;  drwxr-xr-x 146 HOME staff 4.9K 09-08-2014 10:54:40 .0.wl&#xA;  drwxr-xr-x   3 HOME staff  102 06-03-2014 11:37:02 Emacs.app&#xA;  drwxr-xr-x   3 HOME staff  102 06-01-2014 10:39:02 Emacs_06_01_2014.app&#xA;  drwxr-xr-x   3 HOME staff  102 10-01-2014 07:31:45 Emacs_10_01_2014.app&#xA;  drwxr-xr-x 195 HOME staff 6.5K 10-18-2014 12:06:25 bin&#xA;  drwxr-xr-x   3 HOME staff  102 06-26-2013 07:59:44 etc&#xA;  drwxr-xr-x  10 HOME staff  340 09-30-2014 18:07:42 include&#xA;  drwxr-xr-x   9 HOME staff  306 06-05-2013 22:50:05 info&#xA;  drwxr-xr-x  27 HOME staff  918 10-18-2014 12:06:42 lib&#xA;  drwxr-xr-x  12 HOME staff  408 09-30-2014 18:10:42 libexec&#xA;  drwxr-xr-x   4 root staff  136 09-30-2014 18:07:42 man&#xA;  drwxr-xr-x   4 root staff  136 09-30-2014 18:10:42 sbin&#xA;  drwxr-xr-x   9 HOME staff  306 09-30-2014 18:10:42 share&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/dired_font_lock.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.383" LastActivityDate="2014-10-31T07:55:31.173" Title="Composing a regexp to highlight folder extensions differently" Tags="|dired|regular-expressions|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2882" PostTypeId="2" ParentId="2871" CreationDate="2014-10-31T00:39:28.933" Score="4" Body="&lt;p&gt;I personally have this problem and have been using copy instead of Dropbox to have my files in sync. (I don't use Dropbox because of privacy issues). Just like Dropbox, Copy offers clients for all the major platforms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes I forget to save my org buffers, so I have hacked the following functions to save all org files whenever I save some file. Not a great solution, but it serves my purpose.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-save-hook 'org-save-all-org-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, if you hold sensitive data in your org files, I recommend you to take a look at &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/encrypting-files.html&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt;. I use org-crypt which is amazing.&lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2014-10-31T00:39:28.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2883" PostTypeId="1" AcceptedAnswerId="2897" CreationDate="2014-10-31T01:55:18.707" Score="9" ViewCount="1570" Body="&lt;p&gt;This is admittedly a superficial question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although &lt;code&gt;ansi-term&lt;/code&gt; starts out behaving correctly when I first open it, it seems to degrade into an 'editable' mode after a few commands, e.g., when I do &lt;code&gt;C-a&lt;/code&gt; (start of line) followed by &lt;code&gt;C-k&lt;/code&gt; (kill line), it wipes out the whole prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my aesthetic sanity, is there any way to make the prompts and previous output uneditable (for &lt;code&gt;shell&lt;/code&gt;)?  (Updated to exclude ansi-term given the meaningful differences.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using zsh in Emacs 24.4; OS is LXDE (Ubuntu 14.04) via Virtual Box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Ideally I'd still be able to move my cursor around...)&lt;/p&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="2084" LastEditDate="2014-12-18T04:36:58.837" LastActivityDate="2017-06-25T02:19:17.297" Title="Any way to make prompts and previous-output uneditable in shell/term-mode?" Tags="|shell|ansi-term|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2884" PostTypeId="1" AcceptedAnswerId="3157" CreationDate="2014-10-31T02:02:30.047" Score="46" ViewCount="8437" Body="&lt;p&gt;I'm doing quite a bit of manual XML editing (the source definition of some code generation I'm doing is a custom XML format) and of course prefer to use Emacs over any special purpose  (usually ugly) XML editors. nXml mode has stood me well in the past, but I cannot get my head around its &quot;outline&quot; support. Various internet and SO posts effectively say nothing - I'm wondering if anyone has any practical experience with outlining/folding XML in Emacs (any mode) whether or not that requires altering the XML structure itself.&lt;/p&gt;&#xA;" OwnerUserId="215" LastEditorUserId="504" LastEditDate="2014-11-01T09:16:34.130" LastActivityDate="2024-04-01T17:44:27.887" Title="The old &quot;how to fold XML&quot; question" Tags="|xml|nxml|outline|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2885" PostTypeId="2" ParentId="2869" CreationDate="2014-10-31T02:18:32.197" Score="19" Body="&lt;p&gt;This is the job of &lt;a href=&quot;http://orgmode.org/worg/dev/org-element-api.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-element&lt;/code&gt;&lt;/a&gt;, the &lt;em&gt;awesome&lt;/em&gt;(!) work of &lt;strong&gt;Nicolas Goaziou&lt;/strong&gt;.  If you don't know &lt;code&gt;org-element&lt;/code&gt; and you care about org-development this is something you should look into.  It is not only a great tool to work with, it is also increasingly powering &lt;code&gt;org&lt;/code&gt;.  Most notably the &lt;code&gt;org-export&lt;/code&gt; (&lt;a href=&quot;http://orgmode.org/org.html#Exporting&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ox&lt;/code&gt;&lt;/a&gt;), but also functions in e.g. &lt;code&gt;org.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the &quot;lisp representation&quot; of an element under point use &lt;code&gt;org-element-at-point&lt;/code&gt; or &lt;code&gt;org-element-context&lt;/code&gt;.  To get the representation of the buffer use &lt;code&gt;org-element-parse-buffer&lt;/code&gt;.  While not directly relevant here, be aware of &lt;code&gt;org-element-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To go from the &quot;lisp representation&quot; of an &lt;code&gt;element&lt;/code&gt;, &lt;code&gt;secondary string&lt;/code&gt; or &lt;code&gt;parse tree&lt;/code&gt; back to the &lt;a href=&quot;http://orgmode.org/worg/dev/org-syntax.html&quot; rel=&quot;noreferrer&quot;&gt;&quot;Org syntax representation&quot;&lt;/a&gt; use &lt;code&gt;org-element-interpret-data&lt;/code&gt;.  This is &lt;em&gt;the&lt;/em&gt; (only) way to turn a &quot;lisp representation&quot; into a &quot;Org syntax representation&quot;.  You will probably not want to write this representation manually, though.  Here's is a pretty small representation of your first headline&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-element-interpret-data&#xA; '(headline (:title &quot;One headline&quot; :level 1)&#xA;            (property-drawer nil ((node-property (:key &quot;property1&quot; :value &quot;value1&quot;))&#xA;                                  (node-property (:key &quot;property2&quot; :value &quot;value2&quot;))))&#xA;            (#(&quot;Some much longer content.&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you must add both headlines add a &lt;code&gt;parse tree&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-element-interpret-data&#xA; '(org-data nil (headline (:title &quot;One headline&quot; :level 1)&#xA;                          (property-drawer nil ((node-property (:key &quot;property1&quot; :value &quot;value1&quot;))&#xA;                                                (node-property (:key &quot;property2&quot; :value &quot;value2&quot;))))&#xA;                          (#(&quot;Some much longer content.&quot;)))&#xA;            (headline (:title &quot;Second headline&quot; :level 1)&#xA;                          (property-drawer nil ((node-property (:key &quot;property1&quot; :value &quot;value1&quot;))&#xA;                                                (node-property (:key &quot;property2&quot; :value &quot;value2&quot;))))&#xA;                          (#(&quot;More much longer content.&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may find that &lt;strong&gt;Thorsten Jolitz&lt;/strong&gt;'s &lt;a href=&quot;https://github.com/tj64/org-dp&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-dp&lt;/code&gt;&lt;/a&gt; library will aid you in such efforts (&lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.orgmode/104890&quot; rel=&quot;noreferrer&quot;&gt;on MELPA&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The library &lt;code&gt;org-dp&lt;/code&gt; is meant for programming at the local level,&#xA;  i.e. without any (contextual) information except those about the&#xA;  parsed element at point. It is designed to make using the Org&#xA;  parser/interpreter framework at the local level as convenient as using&#xA;  it at the global level (with a complete parse-tree produced by&#xA;  &lt;code&gt;org-element-parse-buffer&lt;/code&gt; available)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A more complete description by Thorsten can be found &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.orgmode/104901&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For further clarifications &lt;a href=&quot;http://dir.gmane.org/gmane.emacs.orgmode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;gmane.emacs.orgmode&lt;/code&gt;&lt;/a&gt; is really the appropriate forum.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2016-02-06T18:13:19.480" LastActivityDate="2016-02-06T18:13:19.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2886" PostTypeId="2" ParentId="2871" CreationDate="2014-10-31T02:45:18.063" Score="11" Body="&lt;p&gt;I use git-annex assistant to sync my org files across my computers and even my phone (a jolla so the linux binary works out of the box but there is also an android version).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works like dropbox in that whenever you save a file it will try to sync it but it is decentralized and free (as in free speech and free beer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The setup is straightforward if you know git but you need some time to familiarize yourself with all the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more at &lt;a href=&quot;http://git-annex.branchable.com&quot;&gt;http://git-annex.branchable.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2344" LastActivityDate="2014-10-31T02:45:18.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2887" PostTypeId="1" AcceptedAnswerId="2912" CreationDate="2014-10-31T03:17:19.407" Score="11" ViewCount="2937" Body="&lt;p&gt;I hate the way that elisp (not sure if LISP in general) handles multiline docstrings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  &quot;This is&#xA;a multi&#xA;liner&#xA;docstring&quot;&#xA;  (do-stuff))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I sure do wish that I could do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (eval-when-compile &#xA;    (concat&#xA;      &quot;This is\n&quot;&#xA;       &quot;a multi\n&quot;&#xA;       &quot;line\n&quot;&#xA;       &quot;docstring&quot;))&#xA;  (do-stuff))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that the indentation was consistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, eval-when-compile does not do the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2345" LastEditorUserId="105" LastEditDate="2015-07-11T04:52:21.860" LastActivityDate="2024-04-01T22:38:23.397" Title="Is there a better way to handle multiline docstrings in elisp?" Tags="|elisp|doc-strings|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2888" PostTypeId="1" AcceptedAnswerId="2915" CreationDate="2014-10-31T03:21:12.927" Score="13" ViewCount="1581" Body="&lt;p&gt;When I close a frame, I'd like for its buffer to be killed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the buffer is displayed in other frames, the buffer should not be killed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do nothing if more than one buffer is displayed in a frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a good way to set this up?&lt;/p&gt;&#xA;" OwnerUserId="163" LastActivityDate="2016-06-22T15:56:10.087" Title="Kill buffer when frame is deleted" Tags="|buffers|frames|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2889" PostTypeId="2" ParentId="2888" CreationDate="2014-10-31T03:22:10.603" Score="1" Body="&lt;p&gt;Here's a simple approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun close-frame-buffer (frame)&#xA;  (kill-buffer&#xA;    (window-buffer&#xA;      (frame-root-window frame))))&#xA;&#xA;(add-hook 'delete-frame-functions 'close-frame-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will kill a buffer even if it's open in another frame however.&lt;/p&gt;&#xA;" OwnerUserId="163" LastEditorUserId="163" LastEditDate="2016-06-22T15:56:10.087" LastActivityDate="2016-06-22T15:56:10.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2890" PostTypeId="1" AcceptedAnswerId="2895" CreationDate="2014-10-31T04:39:21.657" Score="7" ViewCount="1142" Body="&lt;p&gt;I got &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default fill-column 80)&#xA;(setq-default truncate-lines nil) ;; which is default&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When using magit in Emacs, I know that I should avoid long commit messages, but sometimes they just cannot be avoid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is: &lt;code&gt;(setq-default truncate-lines nil)&lt;/code&gt; which is default setting does not work in &lt;strong&gt;magit: project&lt;/strong&gt; buffer(there is a straight right arrow at the end of line), the &lt;code&gt;(setq-default fill-column 80)&lt;/code&gt; does not work in &lt;strong&gt;COMMIT_EDITMSG&lt;/strong&gt; buffer, and the &lt;code&gt;fill-column&lt;/code&gt; value in it is 72 not 80.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what I really want is: make the &lt;code&gt;truncate-lines&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in &lt;strong&gt;magit: project&lt;/strong&gt; buffer as well so I can see long lines in one window but not break it into several different lines, &lt;strong&gt;AND&lt;/strong&gt; turn on auto-fill-mode in &lt;strong&gt;COMMIT_EDITMSG&lt;/strong&gt; buffer, so long commit messages won't be broken into several different lines while I'm typing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: DO NOT affect other buffers like &lt;strong&gt;magit-log&lt;/strong&gt; buffer&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2014-10-31T23:38:48.727" LastActivityDate="2015-07-03T14:16:39.673" Title="How to make `truncate-lines` nil and `auto-fill-mode` off in magit buffers" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2891" PostTypeId="1" AcceptedAnswerId="2924" CreationDate="2014-10-31T06:10:34.320" Score="4" ViewCount="375" Body="&lt;p&gt;At times I want to browse the code of projects to which I have read-only access.  This makes it impossible for me to drop a &lt;code&gt;.projectile&lt;/code&gt; file at the root of the project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to define projects for use with projectile when I do not have write access to the project directories?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-31T19:38:04.773" Title="Projectile project in folder without write access?" Tags="|projectile|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2892" PostTypeId="2" ParentId="2860" CreationDate="2014-10-31T06:15:53.150" Score="4" Body="&lt;p&gt;&lt;code&gt;imenu-generic-expression&lt;/code&gt; is a buffer local variable. When opening a new buffer, imenu will set imenu-generic-expression local value to something interesting for the current buffer. So setting imenu-generic-expression in init won't be useful, as its default-value is never used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want to set is the variable that it used by imenu for setting imenu-generic-expression in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;. It seem that it is the value from &lt;code&gt;lisp-imenu-generic-expression&lt;/code&gt;, that is define in &lt;code&gt;lisp-mode&lt;/code&gt;. So you just have to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'lisp-mode&#xA;    (setq lisp-imenu-generic-expression (append dc-additions lisp-imenu-generic-expression)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you must eval the &lt;code&gt;setq lisp-imenu-generic-expression&lt;/code&gt; in a &lt;code&gt;with-eval-after-load&lt;/code&gt; because you depend on the default value of &lt;code&gt;lisp-imenu-generic-expression&lt;/code&gt; that won't be known to Emacs before lisp-mode is loaded.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="2237" LastEditDate="2014-11-10T06:28:44.320" LastActivityDate="2014-11-10T06:28:44.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2893" PostTypeId="2" ParentId="2891" CreationDate="2014-10-31T06:18:57.740" Score="1" Body="&lt;p&gt;In that case, you can temporary disable &lt;code&gt;projectile-require-project-root&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-require-project-root nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you can activate Projectile everywhere.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-10-31T06:18:57.740" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2894" PostTypeId="2" ParentId="2881" CreationDate="2014-10-31T07:55:31.173" Score="1" Body="&lt;p&gt;The following is just a tweak to Dired+ -- adopting the same manner to highlight folder extensions as is already done with file extensions; with the additional tweak to the beginning regexp to get me over to the files / folders.  My custom time-style of &lt;code&gt;ls&lt;/code&gt; is not compatible with dired-mode or the corresponding regexp in files.el, so I composed my own regexp.  The section below relating to &lt;code&gt;diredp-font-lock-keywords-1&lt;/code&gt; is just the relevant excerpt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the next few days, I'll continue to think about the regexp proposed by @Malabarba &lt;code&gt;.*\\(\\.[^.]*\\)$&lt;/code&gt; to see if I can create a whopper regexp that covers the majority of situations.  I ended up with about 5 different regexp strings, which is not as clean as Dired+ presently offers.&lt;/p&gt;&#xA;&#xA;  &#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar folder-listing-before-filename-regexp&#xA;  (concat&#xA;    &quot;\\(^ +d[slrwxt+-]+\\)&quot;    ;; 1  permissions&#xA;    &quot;\\(\s\\)&quot;                 ;; 2&#xA;    &quot;\\([0-9]+\\|\s+[0-9]+\\)&quot; ;; 3  some small numbers&#xA;    &quot;\\(\s\\)&quot;                 ;; 4&#xA;    &quot;\\([a-zA-Z]+\\)&quot;          ;; 5  user&#xA;    &quot;\\(\s\\)&quot;                 ;; 6&#xA;    &quot;\\([a-zA-Z]+\\)&quot;          ;; 7  group&#xA;    &quot;\\(\s\\)&quot;                 ;; 8&#xA;    &quot;\\([\s0-9.kKMGT]+\\)&quot;     ;; 9  size&#xA;    &quot;\\(\s\\)&quot;                 ;; 10&#xA;    &quot;\\([0-9-]+\\)&quot;            ;; 11 date&#xA;    &quot;\\(\s\\)&quot;                 ;; 12&#xA;    &quot;\\([0-9:]+\\)&quot;            ;; 13 time&#xA;    &quot;\\(\s\\)&quot;))               ;; 14&#xA;&#xA;(defvar file-listing-before-filename-regexp&#xA;  (concat&#xA;    &quot;\\(^ +[^d][slrwxt+-]+\\)&quot; ;; 1  permissions&#xA;    &quot;\\(\s\\)&quot;                 ;; 2&#xA;    &quot;\\([0-9]+\\|\s+[0-9]+\\)&quot; ;; 3  some small numbers&#xA;    &quot;\\(\s\\)&quot;                 ;; 4&#xA;    &quot;\\([a-zA-Z]+\\)&quot;          ;; 5  user&#xA;    &quot;\\(\s\\)&quot;                 ;; 6&#xA;    &quot;\\([a-zA-Z]+\\)&quot;          ;; 7  group&#xA;    &quot;\\(\s\\)&quot;                 ;; 8&#xA;    &quot;\\([\s0-9.kKMGT]+\\)&quot;     ;; 9  size&#xA;    &quot;\\(\s\\)&quot;                 ;; 10&#xA;    &quot;\\([0-9-]+\\)&quot;            ;; 11 date&#xA;    &quot;\\(\s\\)&quot;                 ;; 12&#xA;    &quot;\\([0-9:]+\\)&quot;            ;; 13 time&#xA;    &quot;\\(\s\\)&quot;))               ;; 14&#xA;&#xA;(defvar diredp-font-lock-keywords-1&#xA;  (list&#xA;    '(&quot;[^ .]\\.\\(git\\)$&quot; 1 'diredp-git-face t)&#xA;    '(&quot;[^ .]\\.\\(app\\)$&quot; 1 'diredp-app-face t)&#xA;&#xA;  (list folder-listing-before-filename-regexp&#xA;    (list &quot;\\(.+\\)$&quot; nil nil (list 0 diredp-dir-priv 'keep t))) ; folder-name&#xA;&#xA;  (list file-listing-before-filename-regexp&#xA;    (list &quot;\\(.+\\)$&quot; nil nil (list 0 diredp-file-name 'keep t))) ; file-name&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-10-31T07:55:31.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2895" PostTypeId="2" ParentId="2890" CreationDate="2014-10-31T08:42:37.247" Score="9" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can add setting specific to &lt;code&gt;magit-status&lt;/code&gt; to &lt;code&gt;magit-status-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'magit-status-mode-hook&#xA;          (lambda () &#xA;             (setq truncate-lines nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Starting with Magit &lt;code&gt;v2.1.0&lt;/code&gt;, &lt;code&gt;COMMIT_EDITMSG&lt;/code&gt; files are edited using&lt;code&gt;text-mode&lt;/code&gt; with the &lt;em&gt;minor&lt;/em&gt; mode &lt;code&gt;git-commit-mode&lt;/code&gt; also turned on. You need to add your configuration to &lt;code&gt;git-commit-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'git-commit-mode-hook 'turn-off-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="306" LastEditDate="2015-07-03T14:16:39.673" LastActivityDate="2015-07-03T14:16:39.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2896" PostTypeId="2" ParentId="2887" CreationDate="2014-10-31T08:59:05.453" Score="5" Body="&lt;p&gt;You could use a macro like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro my-defun (name arglist &amp;amp;rest forms)&#xA;  &quot;Like `defun', but concatenates strings.&quot;&#xA;  (declare (indent defun))&#xA;  (let (doc-lines)&#xA;    (while (and (stringp (car-safe forms))&#xA;                (&amp;gt; (length forms) 1))&#xA;      (setq doc-lines&#xA;            (append doc-lines (list (pop forms)))))&#xA;    `(defun ,name ,arglist&#xA;       ,(mapconcat #'identity doc-lines &quot;\n&quot;)&#xA;       ,@forms)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can define your functions like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(my-defun test (a)&#xA;  &quot;Description&quot;&#xA;  &quot;asodksad&quot;&#xA;  &quot;ok&quot;&#xA;  (interactive)&#xA;  (+ 1 a))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Still, I'd &lt;strong&gt;strongly&lt;/strong&gt; recommend not going against the standards for&#xA;such a marginal benefit. The “irregular indentation” that bothers you&#xA;is just by 2 columns, not to mention it helps highlight the first line&#xA;of documentation which is more important.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-10-31T14:05:54.007" LastActivityDate="2014-10-31T14:05:54.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2897" PostTypeId="2" ParentId="2883" CreationDate="2014-10-31T09:48:14.087" Score="16" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/ComintMode&quot;&gt;comint&lt;/a&gt;-derived modes (like &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;ielm&lt;/code&gt;, ...) support filter functions, the following snippet makes the output and prompt read-only:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comint-prompt-read-only t)&#xA;&#xA;(defun my-comint-preoutput-turn-buffer-read-only (text)&#xA;  (propertize text 'read-only t))&#xA;&#xA;(add-hook 'comint-preoutput-filter-functions 'my-comint-preoutput-turn-buffer-read-only)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;ansi-term&lt;/code&gt; (which is not derived from &lt;a href=&quot;http://www.emacswiki.org/emacs/ComintMode&quot;&gt;comint&lt;/a&gt;), it features two modes of operation, &lt;code&gt;char mode&lt;/code&gt; which stays as truthful to the bindings of the shell and the software running in it as possible and &lt;code&gt;line mode&lt;/code&gt; which allows you to edit the buffer as you please. You should generally stay in &lt;code&gt;char mode&lt;/code&gt; (bound to &lt;code&gt;C-c C-k&lt;/code&gt;) and occasionally switch to &lt;code&gt;line mode&lt;/code&gt; (bound to &lt;code&gt;C-c C-j&lt;/code&gt;) for editing command output.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-12-18T09:16:37.853" LastActivityDate="2014-12-18T09:16:37.853" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2898" PostTypeId="2" ParentId="2868" CreationDate="2014-10-31T10:02:39.010" Score="21" Body="&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: With &lt;code&gt;find-file-noselect&lt;/code&gt; you have &lt;strong&gt;no control&lt;/strong&gt; about what actually happens, and you may end up with arbitrary minor modes enabling in the buffer, depending on what the user enabled in their &lt;code&gt;init.el&lt;/code&gt;.  Also, cleanup is hard.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;with-temp-buffer&lt;/code&gt; and &lt;code&gt;insert-file-contents&lt;/code&gt; instead.  If you need specific major or minor modes in the buffer, enable them &lt;strong&gt;explicitly&lt;/strong&gt;.  To write files, use &lt;code&gt;with-temp-file&lt;/code&gt; instead, which—despite its name—lets you write to arbitrary files.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Side effects&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;find-file-noselect&lt;/code&gt; has &lt;strong&gt;a lot&lt;/strong&gt; of side-effects, including&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;interactively asking questions (that alone is a no-go in non-interactive use),&lt;/li&gt;&#xA;&lt;li&gt;automatically enabling view mode for readonly files,&lt;/li&gt;&#xA;&lt;li&gt;entering normal mode otherwise,&lt;/li&gt;&#xA;&lt;li&gt;and running &lt;code&gt;find-file-hook&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Normal Mode itself &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;automatically selects a proper major mode for the current buffer,&lt;/li&gt;&#xA;&lt;li&gt;runs all corresponding major and minor mode hooks,&lt;/li&gt;&#xA;&lt;li&gt;and reads all local variables for the current buffer, i.e. file variables and directory variables, which again may ask interactive questions about unsafe local variables.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since all hooks are run, you get &lt;strong&gt;all minor modes and hook functions&lt;/strong&gt; the user enabled in their &lt;code&gt;init.el&lt;/code&gt;, which can cause everything, from minor inconveniences (if undesirable minor modes are enabled) to major havoc (if the user added a hook function that expects to be called from an interactive context).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/366&quot;&gt;https://github.com/flycheck/flycheck/issues/366&lt;/a&gt; for an example.  The use of &lt;code&gt;find-file-noselect&lt;/code&gt; caused a data file to be syntax-checked by Flycheck, and since it was happening at Emacs shut-down, there was no time to properly clean up again, leaving a temporary file behind.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Cleanup&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;find-file-noselect&lt;/code&gt; you need to be extra careful to kill the buffer again.  &lt;code&gt;find-file-noselect&lt;/code&gt; does not do that for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to remember the buffer at some place, and carefully use &lt;code&gt;unwind-protect&lt;/code&gt; to make sure that the buffer gets killed even in case of non-local exits.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Alternatives&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;To read files, use &lt;code&gt;with-temp-buffer&lt;/code&gt; and &lt;code&gt;insert-file-contents&lt;/code&gt;, which only does the most basic things, e.g. coding system conversion, but does not ask questions, enable hooks, or setup local variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (insert-file-contents (locate-user-emacs-file &quot;foo.el&quot;))&#xA;  ;; Enter the major mode explicitly&#xA;  (emacs-lisp-mode)&#xA;  ;; …&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-temp-buffer&lt;/code&gt; takes care to properly kill the temporary buffer at the end of its body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To write files, use &lt;code&gt;with-temp-file&lt;/code&gt;, which creates a temporary buffer and writes the contents to the given file name at the end of its body:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-file  (locate-user-emacs-file &quot;foo.el&quot;)&#xA;  (prin1 (list 'my 'data) (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-10-31T10:02:39.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2899" PostTypeId="1" CreationDate="2014-10-31T10:12:23.403" Score="6" ViewCount="455" Body="&lt;p&gt;I'm on OSX 10.9.4 and I was previously running emacs 24.3 installed via brew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This morning I got around to asking brew to upgrade me to 24.4. Everything seemed to go smoothly, except csharp-mode no longer functions correctly. On opening a .cs file I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File mode specification error: (error &quot;Recursive load&quot; &#xA;    &quot;/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc&quot; &#xA;    &quot;/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc&quot; &#xA;    &quot;/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc&quot; &#xA;    &quot;/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc&quot; &#xA;    &quot;/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I still have 24.3 on my machine and I can open .cs files correctly in that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately csharp mode &lt;a href=&quot;http://www.emacswiki.org/CSharpMode&quot;&gt;seems to be dead&lt;/a&gt; - it's not been touched in a few years. Any help or pointers as to how I can hack this to work would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="110" LastEditorUserId="25" LastEditDate="2014-11-10T00:51:12.673" LastActivityDate="2014-11-10T00:51:12.673" Title="Recursive load error in csharp mode on upgrading to 24.4" Tags="|byte-compilation|upgrade|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2900" PostTypeId="2" ParentId="2899" CreationDate="2014-10-31T10:37:27.737" Score="9" Body="&lt;p&gt;My problem was that the byte-compiled version of csharp-mode wasn't compatible with the upgrade. It seems it's a good idea to recompile all files on upgrading emacs, see this question: &lt;a href=&quot;https://stackoverflow.com/questions/24725778/how-to-rebuild-elpa-packages-after-upgrade-of-emacs&quot;&gt;https://stackoverflow.com/questions/24725778/how-to-rebuild-elpa-packages-after-upgrade-of-emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tl;dr: &lt;code&gt;M-: (byte-recompile-directory package-user-dir nil 'force)&lt;/code&gt; fixes all problems.&lt;/p&gt;&#xA;" OwnerUserId="110" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-10-31T10:37:27.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2901" PostTypeId="1" AcceptedAnswerId="3317" CreationDate="2014-10-31T11:17:02.717" Score="1" ViewCount="237" Body="&lt;p&gt;I'm trying to set upt &lt;code&gt;org-mode&lt;/code&gt; and &lt;code&gt;reftex-mode&lt;/code&gt; but I'm getting some troubles. Here is my &lt;code&gt;init.el&lt;/code&gt; file:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ORG-MODE&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.org\\'&quot; . org-mode))&#xA;(setq org-agenda-files '(&quot;~/.../&quot;))&#xA;(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA;(add-hook 'org-mode-hook&#xA;      (lambda ()&#xA;        (reftex-mode)&#xA;        (visual-line-mode)&#xA;        (company-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm trying to load a &lt;code&gt;.bib&lt;/code&gt; file with &lt;code&gt;(setq reftex-default-bibliography '(&quot;path/to/bibfile.bib&quot;))&lt;/code&gt; and it seems to work fine, but as I type &lt;code&gt;C-c [&lt;/code&gt; in order to add a new reference I got this error:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;reftex-using-biblatex-p: Stack overflow in regexp matcher&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hint? Thanks in advance.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P.S. couldn't tag with&lt;/em&gt; &lt;code&gt;reftex-mode&lt;/code&gt; &lt;em&gt;nor&lt;/em&gt; &lt;code&gt;bibtex&lt;/code&gt; &lt;em&gt;as I have no enough reputation score. If anyone could, I think thah would be good!&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="201" LastEditorUserId="10" LastEditDate="2014-10-31T11:27:23.140" LastActivityDate="2014-11-09T10:28:38.800" Title="org-mode and reftex giving this error: reftex-using-biblatex-p: Stack overflow in regexp matcher" Tags="|org-mode|reftex-mode|bibtex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2902" PostTypeId="1" AcceptedAnswerId="2908" CreationDate="2014-10-31T11:39:21.500" Score="9" ViewCount="738" Body="&lt;p&gt;I log into numerous machines as part of my job (+- 20 per day). I only spend a few days/weeks with each machine. Many run ftp only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For seamless access Tramp is amazing, but it is the &lt;em&gt;managing&lt;/em&gt; of these server's access by hand that has become tedious. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I manage a .netrc and a .ssh/config by hand, along with any keys. Often a password/key will change during my time with the machine, and I will have to re-edit the files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an effective solution for managing (machines/passwords/keys) from within emacs?&lt;/p&gt;&#xA;" OwnerUserId="294" LastEditorUserId="25" LastEditDate="2014-11-11T22:13:18.963" LastActivityDate="2014-11-11T22:13:18.963" Title="Password/Key Management for multiple machines in emacs" Tags="|tramp|ftp|passwords|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2903" PostTypeId="1" AcceptedAnswerId="2941" CreationDate="2014-10-31T11:41:14.303" Score="6" ViewCount="1057" Body="&lt;p&gt;I'm using the Dvorak keyboard layout and have swapped &lt;code&gt;C-x&lt;/code&gt; and &lt;code&gt;C-t&lt;/code&gt;, because I find it easier to type on Dvorak.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map [?\C-x] [?\C-t])&#xA;(define-key key-translation-map [?\C-t] [?\C-x])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm also using &lt;code&gt;god-mode&lt;/code&gt;, though, so I'd like &lt;code&gt;x&lt;/code&gt; to be swapped with &lt;code&gt;t&lt;/code&gt; when in &lt;code&gt;god-local-mode&lt;/code&gt;, such that typing &lt;code&gt;x&lt;/code&gt; results in &lt;code&gt;C-t&lt;/code&gt; and typing &lt;code&gt;t&lt;/code&gt; results in &lt;code&gt;C-x&lt;/code&gt;.  I have a very crude solution using &lt;code&gt;keyboard-translate&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-god-swap-on ()&#xA;  (interactive)&#xA;  (keyboard-translate ?x ?t)&#xA;  (keyboard-translate ?t ?x))&#xA;&#xA;(defun my-god-swap-off ()&#xA;  (interactive)&#xA;  (aset keyboard-translate-table ?t nil)&#xA;  (aset keyboard-translate-table ?x nil))&#xA;&#xA;(add-hook 'god-mode-enabled-hook 'my-god-swap-on)&#xA;(add-hook 'god-mode-disabled-hook 'my-god-swap-off)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although this works it is extremely inelegant as it modifies global state.  If I switched to a buffer where god-mode is not enabled, the translation would still be active.  I could add yet another hook for buffer switching to make sure that the translation is disabled when &lt;code&gt;god-local-mode&lt;/code&gt; is inactive in the current buffer, but this seems like a very ugly mitigation technique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to restrict the effects to a keyboard translation to only a single minor mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is not possible, is there another more elegant way I could swap keys in &lt;code&gt;god-mode&lt;/code&gt;?  I see that &lt;code&gt;god-mode&lt;/code&gt; rewires all keys bound to &lt;code&gt;self-insert-command&lt;/code&gt; to &lt;code&gt;god-mode-self-insert&lt;/code&gt;, but this uses &lt;code&gt;this-command-keys-vector&lt;/code&gt; to determine with what key it was called and I cannot seem to shadow the definition of &lt;code&gt;this-command-keys-vector&lt;/code&gt; with a let binding to swap &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;t&lt;/code&gt; in a wrapper before passing control to &lt;code&gt;god-mode-self-insert&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-06-05T08:45:48.920" Title="god-mode: swap keys" Tags="|key-bindings|keymap|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2904" PostTypeId="1" AcceptedAnswerId="2965" CreationDate="2014-10-31T12:05:59.970" Score="1" ViewCount="6433" Body="&lt;p&gt;I used to have a configuration for &lt;kbd&gt;TAB&lt;/kbd&gt; which was doing something like this :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code before hitting &lt;kbd&gt;TAB&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;template&amp;lt;typename T&amp;gt;&#xA;class A&#xA;{&#xA;&#xA;    }; // This is where I hit TAB&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code auto-indented as below after hitting &lt;kbd&gt;TAB&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;template&amp;lt;typename T&amp;gt;&#xA;class A&#xA;{&#xA;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;kbd&gt;TAB&lt;/kbd&gt; key used to work as above but now it does only auto-complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I fix this ? I can use &lt;kbd&gt;TAB&lt;/kbd&gt; with &lt;kbd&gt;C-q&lt;/kbd&gt;&lt;kbd&gt;TAB&lt;/kbd&gt; but it is hard to do always. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/jdee-2.4.1/lisp&quot;)&#xA;(load &quot;jde&quot;)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d&quot;)&#xA;(require 'linum)&#xA;(global-linum-mode 1)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/yasnippet-0.8.0&quot;)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;; care about this place&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;backtab&amp;gt;&quot;) 'yas-expand)&#xA;; care about this place&#xA;(setq ac-source-yasnippet nil)&#xA;&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/auto-complete-1.3.1&quot;)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;)&#xA;(global-auto-complete-mode t) ; section1&#xA;(ac-set-trigger-key &quot;TAB&quot;)&#xA;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;&#xA;(defun my:ac-c-headers-init ()&#xA;  (require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-headers))&#xA;&#xA;(add-hook 'c++-mode-hook 'my:ac-c-headers-init)&#xA;(add-hook 'c-mode-hook 'my:ac-c-headers-init)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/iedit&quot;)&#xA;(require 'iedit)&#xA;(define-key global-map (kbd &quot;C-c ;&quot;) 'iedit-mode)&#xA;&#xA;(semantic-mode 1)&#xA;(defun my:add-semantic-to-autocomplete() &#xA;  (add-to-list 'ac-sources 'ac-source-semantic)&#xA;)&#xA;(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(ansi-color-names-vector [&quot;#242424&quot; &quot;#e5786d&quot; &quot;#95e454&quot; &quot;#cae682&quot; &quot;#8ac6f2&quot; &quot;#333366&quot; &quot;#ccaa8f&quot; &quot;#f6f3e8&quot;])&#xA; '(cua-mode t nil (cua-base))&#xA; '(custom-enabled-themes (quote (tango-dark)))&#xA; '(font-use-system-font t)&#xA; '(show-paren-mode t)&#xA; '(uniquify-buffer-name-style (quote forward) nil (uniquify)))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(default ((t (:family &quot;DejaVu Sans Mono&quot; :foundry &quot;unknown&quot; :slant normal :weight bold :height 113 :width normal)))))&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 2)&#xA;(setq indent-line-function 'insert-tab)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; When I add JDE it fixed but now I cannot use auto-complete ? It doesn't complete anything.&lt;/p&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="25" LastEditDate="2014-11-10T23:23:42.790" LastActivityDate="2014-11-10T23:23:42.790" Title="TAB does not auto-indent lines anymore" Tags="|key-bindings|indentation|completion|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2905" PostTypeId="2" ParentId="363" CreationDate="2014-10-31T12:17:18.357" Score="4" Body="&lt;p&gt;As a reference to debug with gdb you'll want to use src/temacs from the build tree. This is Emacs without the pre-dumped elisp which confuses the debugger.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gdb --args src/temacs -nw&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-10-31T12:17:18.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2906" PostTypeId="2" ParentId="2864" CreationDate="2014-10-31T12:45:12.223" Score="4" Body="&lt;p&gt;It's &lt;a href=&quot;http://debbugs.gnu.org/db/18/18845.html&quot; rel=&quot;nofollow&quot;&gt;bug #18845&lt;/a&gt; in Emacs-24.4.  To work around it, you need to add &lt;code&gt;(require 'cl)&lt;/code&gt; somewhere before you load php-mode.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="25" LastEditDate="2014-11-10T00:52:34.353" LastActivityDate="2014-11-10T00:52:34.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2907" PostTypeId="1" AcceptedAnswerId="2913" CreationDate="2014-10-31T12:50:46.397" Score="3" ViewCount="457" Body="&lt;p&gt;Since the update, a certain style of formatting code is highlighted with &lt;code&gt;font-lock-warning-face&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I turn off this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ur3aG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="50" LastEditDate="2014-10-31T14:34:24.510" LastActivityDate="2014-10-31T14:34:24.510" Title="How to turn off &quot;error&quot; highlighting in emacs-lisp-mode for Emacs 25?" Tags="|elisp|font-lock|emacs-lisp-mode|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2908" PostTypeId="2" ParentId="2902" CreationDate="2014-10-31T12:56:13.317" Score="7" Body="&lt;p&gt;I use a simple password manager called &lt;a href=&quot;http://www.passwordstore.org/&quot;&gt;pass&lt;/a&gt;. It offers a simple command line interface with is ideal for integrating with Emacs. The backing store is a GPG encrypted GIT repo. It actually ships with an &lt;a href=&quot;http://git.zx2c4.com/password-store/tree/contrib/emacs/password-store.el&quot;&gt;Emacs package&lt;/a&gt; although I don't use it. My interface is laughably simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-fixup-gpg-agent (frame)&#xA;  &quot;Tweak DISPLAY and GPG_TTY environment variables as appropriate to `FRAME'.&quot;&#xA;  (when (fboundp 'keychain-refresh-environment)&#xA;    (keychain-refresh-environment))&#xA;  (if (display-graphic-p frame)&#xA;      (setenv &quot;DISPLAY&quot; (terminal-name frame))&#xA;    (setenv &quot;GPG_TTY&quot; (terminal-name frame))&#xA;    (setenv &quot;DISPLAY&quot; nil)))&#xA;&#xA;(add-hook 'after-make-frame-functions 'my-fixup-gpg-agent)&#xA;&#xA;;; Simple caching&#xA;(defvar my-cached-passwords&#xA;  nil&#xA;  &quot;Cache of passwords. Stored in plain text so you only want to cache&#xA;  them if of low value.&quot;)&#xA;&#xA;(defun my-pass-password (pass-name &amp;amp;optional cache)&#xA;  &quot;Return the password for the `PASS-NAME'.&quot;&#xA;  (let ((cached-pass (assoc-default pass-name my-cached-passwords)))&#xA;    (if cached-pass&#xA;        cached-pass&#xA;      (when (selected-frame)&#xA;        (my-fixup-gpg-agent (selected-frame))&#xA;        (let ((new-pass (chomp&#xA;                         (shell-command-to-string&#xA;                          (format &quot;pass %s&quot; pass-name)))))&#xA;          (when (and new-pass cache)&#xA;            (add-to-list 'my-cached-passwords (cons pass-name new-pass)))&#xA;          new-pass)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-10-31T12:56:13.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2909" PostTypeId="2" ParentId="2888" CreationDate="2014-10-31T13:10:11.993" Score="6" Body="&#xA;&#xA;&lt;p&gt;Below is a function (tested, but not extensively) that meets your first requirement: it kills the current buffer when you close a frame &lt;em&gt;UNLESS&lt;/em&gt; the buffer is also visible in another frame.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-buffer-when-frame-delete-dwim (frame)&#xA;  &quot;Kill current buffer unless it's visible in another frame&#xA;besides current FRAME.&quot;&#xA;  (unless (delq nil (mapcar #'(lambda (x)&#xA;                                (memq (current-buffer)&#xA;                                      (mapcar #'window-buffer x)))&#xA;                            (mapcar #'window-list&#xA;                                    (delq frame (frame-list)))))&#xA;    (kill-buffer (current-buffer))))&#xA;&#xA;(add-hook 'delete-frame-functions 'kill-buffer-when-frame-delete-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm unclear on the second requirement:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;By &lt;em&gt;more than one buffer displayed in the frame&lt;/em&gt;, do you mean the frame has a) two or more windows, &lt;em&gt;and&lt;/em&gt; b) the windows have different buffers displayed in them?  &lt;/li&gt;&#xA;&lt;li&gt;By &lt;em&gt;do nothing&lt;/em&gt;, do you mean a) delete the frame but do &lt;em&gt;not&lt;/em&gt; kill the current buffer, &lt;em&gt;or&lt;/em&gt; b) really do nothing at all: do not delete the frame or kill the current buffer?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-10-31T13:10:11.993" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2910" PostTypeId="2" ParentId="2903" CreationDate="2014-10-31T13:23:42.310" Score="1" Body="&lt;p&gt;I now use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun original-god-mode-lookup-key-sequence (&amp;amp;optional key key-string-so-far) ())&#xA;(fset 'original-god-mode-lookup-key-sequence (symbol-function 'god-mode-lookup-key-sequence))&#xA;&#xA;(defun god-mode-lookup-key-sequence (&amp;amp;optional key key-string-so-far)&#xA;  &quot;Wrap original-god-mode-lookup-key-sequence.  Swap x and t.&quot;&#xA;  (interactive)&#xA;  (case key&#xA;    (?x (original-god-mode-lookup-key-sequence ?t key-string-so-far))&#xA;    (?t (original-god-mode-lookup-key-sequence ?x key-string-so-far))&#xA;    (t (original-god-mode-lookup-key-sequence key key-string-so-far))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It makes a copy of &lt;code&gt;god-mode-lookup-key-sequence&lt;/code&gt; as &lt;code&gt;original-god-mode-lookup-key-sequence&lt;/code&gt; and then overrides it with a wrapper that performs the swap for &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;t&lt;/code&gt;.  It's not elegant, but at least it won't leak.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-10-31T13:23:42.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2911" PostTypeId="2" ParentId="2887" CreationDate="2014-10-31T13:32:02.520" Score="-1" Body="&lt;p&gt;I've seen packages that define docstrings like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-function (x y) &quot;&#xA;this is my docstring&#xA;that lines always lines up&#xA;across multiple lines.&quot;&#xA;  (+ x y))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Placing the first quote on the first line then starting the text on the next so they all line up. It's definitely not the standard but you wouldn't be the only one doing it.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-10-31T13:32:02.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2912" PostTypeId="2" ParentId="2887" CreationDate="2014-10-31T13:32:16.803" Score="8" Body="&lt;p&gt;Of course a &lt;code&gt;my-defun&lt;/code&gt; macro is the easy way out.&#xA;But a simpler solution would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'eval-when-compile :filter-return&#xA;            (lambda (exp)&#xA;              (if (and (eq 'quote (car-safe exp))&#xA;                       (stringp (cadr exp)))&#xA;                  (cadr exp)&#xA;                exp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which should make your trick work, at least in all the cases where the function is macroexpanded before it's actually defined, which should include the main use cases (e.g. if it'sloaded from a file, if it's byte-compiled, or if it's defined via &lt;code&gt;M-C-x&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, this won't fix all the existing code, so maybe a better answer is something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding:t -*-&#xA;&#xA;(defun my-shift-docstrings (orig ppss)&#xA;  (let ((face (funcall orig ppss)))&#xA;    (when (eq face 'font-lock-doc-face)&#xA;      (save-excursion&#xA;        (let ((start (point)))&#xA;          (parse-partial-sexp (point) (point-max) nil nil ppss 'syntax-table)&#xA;          (while (search-backward &quot;\n&quot; start t)&#xA;            (put-text-property (point) (1+ (point)) 'display&#xA;                               (propertize &quot;\n  &quot; 'cursor 0))))))&#xA;    face))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook&#xA;          (lambda ()&#xA;            (font-lock-mode 1)&#xA;            (push 'display font-lock-extra-managed-props)&#xA;            (add-function :around (local 'font-lock-syntactic-face-function)&#xA;                          #'my-shift-docstrings)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which should just shift the docstrings by 2 spaces, but only on the display side, without affecting the buffer's actual content.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2014-10-31T13:46:06.413" LastActivityDate="2014-10-31T13:46:06.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2913" PostTypeId="2" ParentId="2907" CreationDate="2014-10-31T13:41:28.097" Score="8" Body="&lt;h1&gt;There are two ways&lt;/h1&gt;&#xA;&lt;h2&gt;Redefine &lt;code&gt;lisp--match-hidden-arg&lt;/code&gt;:&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun lisp--match-hidden-arg (limit) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;Remove &lt;code&gt;lisp--match-hidden-arg&lt;/code&gt; from &lt;code&gt;lisp-cl-font-lock-keywords-2&lt;/code&gt; and &lt;code&gt;lisp-el-font-lock-keywords-2&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq lisp-el-font-lock-keywords-2&#xA;      (cl-delete 'lisp--match-hidden-arg lisp-el-font-lock-keywords-2&#xA;                 :key #'car))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h1&gt;Please Do &lt;em&gt;NOT&lt;/em&gt; Do That!&lt;/h1&gt;&#xA;&lt;p&gt;The coding style detected by &lt;code&gt;lisp--match-hidden-arg&lt;/code&gt; is not very readable.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;... a computer language is not just a way of getting a computer to&#xA;perform operations, but rather ... it is a novel formal medium for&#xA;expressing ideas about methodology&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Abelson/Sussman &amp;quot;Structure and&#xA;Interpretation of Computer Programs&amp;quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You write code so that people (and you yourself a year from today!) will read and &lt;em&gt;understand&lt;/em&gt; it.&#xA;Coding conventions serve a purpose.&#xA;Please think before rejecting them.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-10-31T13:46:51.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2914" PostTypeId="1" AcceptedAnswerId="2916" CreationDate="2014-10-31T14:27:44.627" Score="10" ViewCount="286" Body="&lt;p&gt;When playing around with data in &lt;code&gt;calc&lt;/code&gt;, I often want to generate a vector from an interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I easily create a vector from just a start point, end point &amp;amp; step value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like &lt;code&gt;1 &amp;lt;RET&amp;gt; 10 &amp;lt;RET&amp;gt; 1 MAKE-VECTOR&lt;/code&gt; to give me &lt;code&gt;[1,2,3,4,5,6,7,8,9,10]&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="503" LastActivityDate="2014-10-31T14:47:15.493" Title="How can I turn [1..10] into [1,2,3,4,5,6,7,8,9,10] in calc?" Tags="|calc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2915" PostTypeId="2" ParentId="2888" CreationDate="2014-10-31T14:27:46.067" Score="12" Body="&lt;p&gt;If I've understood the question, here's a function that does what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun maybe-delete-frame-buffer (frame)&#xA;  &quot;When a dedicated FRAME is deleted, also kill its buffer.&#xA;A dedicated frame contains a single window whose buffer is not&#xA;displayed anywhere else.&quot;&#xA;  (let ((windows (window-list frame)))&#xA;    (when (eq 1 (length windows))&#xA;      (let ((buffer (window-buffer (car windows))))&#xA;        (when (eq 1 (length (get-buffer-window-list buffer nil t)))&#xA;          (kill-buffer buffer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can add it as a hook that gets called whenever a frame is closed using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'delete-frame-functions #'maybe-delete-frame-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-10-31T14:27:46.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2916" PostTypeId="2" ParentId="2914" CreationDate="2014-10-31T14:47:15.493" Score="13" Body="&lt;p&gt;&lt;kbd&gt;v x 10 RET&lt;/kbd&gt; should do it. Uses &lt;code&gt;calc-index&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-10-31T14:47:15.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2917" PostTypeId="1" AcceptedAnswerId="2918" CreationDate="2014-10-31T14:54:04.833" Score="1" ViewCount="748" Body="&lt;p&gt;After a recent update &lt;code&gt;eldoc&lt;/code&gt; is turned on by default, even for &lt;code&gt;emacs -Q&lt;/code&gt;.&#xA;I don't appreciate the noise it generates when I'm using &lt;code&gt;eval-expression&lt;/code&gt;.&#xA;How do I turn it off?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-08-12T14:36:15.280" LastActivityDate="2015-08-12T14:36:15.280" Title="How to disable eldoc for `eval-expression`?" Tags="|elisp|eldoc|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2918" PostTypeId="2" ParentId="2917" CreationDate="2014-10-31T15:16:50.623" Score="1" Body="&lt;p&gt;Disable it globally:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-eldoc-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Disable it locally - make sure that &lt;code&gt;eldoc-mode&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; in all your buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A less drastic solution would be to increase &lt;code&gt;eldoc-idle-delay&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2014-10-31T17:26:34.933" LastActivityDate="2014-10-31T17:26:34.933" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2919" PostTypeId="1" AcceptedAnswerId="2936" CreationDate="2014-10-31T15:47:48.293" Score="9" ViewCount="1735" Body="&lt;p&gt;&lt;strong&gt;TLDR: I've got a large tags file that loads multiple times per session, making it unusable.  Can't find the source of issue or how to disable it -- main goal is to jump to tags, but completion would be nice&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently posted on the emacs subreddit and a user recommended that I join this group because it's also friendly towards newbies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been using emacs as a C++ IDE, and I'm slowly correcting things that are annoying.  I'm essentially using &lt;a href=&quot;https://github.com/redguardtoo/emacs.d&quot; rel=&quot;noreferrer&quot;&gt;redguardtoo's emacs.d file&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a tag file that is 225MB (1.6M Tags).  My intent for the tag is not necessarily completion (using &lt;code&gt;company&lt;/code&gt;), but more for jumping around source code.  I'm working with an unfamiliar code base and often need to see macro or class definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start typing, at random times, I'll see a message in the minibuffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Making tag completion table for [tag file]...0-100%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, a popup listbox shows up with autocompletion options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because this tag file is so large, and it doesn't seem like the tag loading is asynchronous, it freezes emacs for around a minute.  This also happens multiple times per a session (with the same file, and with other files in the same directory that use the same tag file)!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does anyone know what's initializing the loading of the tag table for completion and how to disable it?  I did a grep on my emacs.d directory for &quot;Making tag completion&quot; and found nothing (note, IIRC the loading tags was present regardless of using &lt;code&gt;company&lt;/code&gt; or &lt;code&gt;auto-complete&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Completion would be nice, but I'd settle just for the ability to jump to the tag location.  Is there a way to get this? &lt;/li&gt;&#xA;&lt;li&gt;What is the mindset to take when approaching problems like this?  I'd like to be able to troubleshoot further on my own next time.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional info&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enabled minor modes (C-h m)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Abbrev Auto-Composition Auto-Compression&#xA;Auto-Encryption Blink-Cursor Column-Number Company Desktop-Save&#xA;Display-Time Electric-Indent Electric-Pair Evil Evil-Local&#xA;Evil-Matchit Evil-Surround Fic File-Name-Shadow Flyspell-Lazy&#xA;Font-Lock Ggtags Global-Auto-Revert Global-Company Global-Eldoc&#xA;Global-Evil-Matchit Global-Evil-Surround Global-Font-Lock Global-Linum&#xA;Global-Page-Break-Lines Global-Pointback Global-Undo-Tree Helm&#xA;Helm-Match-Plugin Helm-Occur-Match-Plugin Line-Number Linum Menu-Bar&#xA;Mouse-Wheel Override-Global Pointback Recentf Savehist Shell-Dirtrack&#xA;Subword Tooltip Undo-Tree Which-Function Window-Numbering Winner Yas&#xA;Yas-Global&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package-activated-list&lt;/code&gt; is equal to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ace-jump-mode ag s dash anaconda-mode f dash s dash json-rpc auto-compile packed bbdb bookmark+ browse-kill-ring buffer-move clean-aindent-mode cmake-mode coffee-mode color-theme company cpputils-cmake crontab-mode csharp-mode diminish dired+ dired-details dropdown-list dsvn elnode kv db kv fakir kv dash noflet creole kv noflet s noflet dash web s dash emmet-mode erlang evil-args evil goto-chg undo-tree evil-search-highlight-persist exec-path-from-shell expand-region f dash s fakir kv dash noflet fancy-narrow flymake-coffee flymake-easy flymake-css flymake-easy flymake-haml flymake-easy flymake-jslint flymake-easy flymake-lua flymake-python-pyflakes flymake-easy flymake-ruby flymake-easy flymake-sass flymake-easy flymake-shell flymake-easy flyspell-lazy fringe-helper ggtags git-gutter git-timemachine gitconfig-mode gitignore-mode goto-chg haskell-mode helm-descbinds helm async helm-gtags helm async hl-sexp htmlize ibuffer-vc idomenu iedit json-mode json-snatcher json-reformat json-reformat json-rpc json-snatcher kv legalese less-css-mode lua-mode magit git-rebase-mode git-commit-mode markdown-mode maxframe mic-paren move-text multi-term mwe-log-commands noflet org-fstree packed page-break-lines paredit pointback pomodoro pretty-mode project-local-variables quack rainbow-delimiters regex-tool rinari jump inflections findr ruby-compilation inf-ruby inf-ruby robe inf-ruby ruby-compilation inf-ruby rvm sass-mode haml-mode scratch scss-mode session sr-speedbar string-edit dash switch-window tagedit dash s textile-mode undo-tree unfill w3m web s dash wgrep ws-butler yaml-mode yasnippet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2265" LastEditorUserId="2265" LastEditDate="2014-11-25T19:34:26.383" LastActivityDate="2014-11-25T19:34:26.383" Title="&quot;Making tag completion table&quot; Freezes/Blocks -- how to disable" Tags="|completion|performance|ctags|" AnswerCount="1" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="2920" PostTypeId="1" CreationDate="2014-10-31T15:48:23.150" Score="1" ViewCount="400" Body="&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   #+NAME: sys5&#xA;   #+HEADER: :exports both&#xA;   #+BEGIN_SRC maxima :results raw&#xA;     programmode: false;&#xA;     solution: triangularize(coefmatrix(&#xA;     [ -3*x - 11*y + 7*z = 0,&#xA;        2*x +  6*y - 2*z = 0,&#xA;          x +  2*y +   z = 0],&#xA;          [x, y, z]));&#xA;     print(solution);&#xA;   #+END_SRC&#xA;&#xA;   # (1)&#xA;   #+RESULTS: sys5&#xA;   : [ - 3  - 11   7  ]&#xA;   : [                ]&#xA;   : [  0    4    - 8 ] &#xA;   : [                ]&#xA;   : [  0    0     0  ]&#xA;   # (2)&#xA;   #+BEGIN_EXAMPLE&#xA;     [ - 3  - 11   7  ]&#xA;     [                ]&#xA;     [  0    4    - 8 ] &#xA;     [                ]&#xA;     [  0    0     0  ]&#xA;   #+END_EXAMPLE&#xA;&#xA;   Triangulated matrix of the above solution doesn't have pivot in the third&#xA;   column, thus it doesn't have a unique solution.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(1) is printed like so: &lt;code&gt;[-3 -11 7] [] [0 4 -8] [] [0 0 0]&lt;/code&gt;, but (2) prints properly, i.e. every line on the separate line. Interestingly, if there's some text after the &lt;code&gt;#+RESULTS:&lt;/code&gt;, then export doesn't add &lt;code&gt;=&lt;/code&gt; around the result, otherwise, it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything special about &lt;code&gt;[]&lt;/code&gt; in results?&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2014-10-31T15:56:02.933" LastActivityDate="2016-01-28T07:55:36.437" Title="Babel doesn't wrap results in verbatim" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2921" PostTypeId="2" ParentId="2884" CreationDate="2014-10-31T16:39:23.857" Score="13" Body="&lt;p&gt;&lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;web-mode&lt;/code&gt;&lt;/a&gt; has element folding built in and bound to &lt;code&gt;C-c C-f&lt;/code&gt;. But you will lose some of the features of using &lt;code&gt;nxml-mode&lt;/code&gt; obviously.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="105" LastEditDate="2024-04-01T17:44:27.887" LastActivityDate="2024-04-01T17:44:27.887" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2922" PostTypeId="1" CreationDate="2014-10-31T16:54:50.797" Score="7" ViewCount="828" Body="&lt;p&gt;How can I use the focus hooks to attenuate all colours in visible buffers when the Emacs frame loses focus?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried using the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter (selected-frame) 'alpha '(100 80))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To make the frame become translucent, but it would flicker when I hit &lt;kbd&gt;Ctrl&lt;/kbd&gt; (apparently that's because I let GNOME highlight the mouse cursor when I hit &lt;kbd&gt;Ctrl&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making the frame transparent isn't what I want anyway.  Is it possible to desaturate all colours instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;  a less ambitious goal is to change/attenuate the colours of the mode line on focus change and restore them to normal when focus returns.  With two monitors I often find myself typing into the void when Emacs is displayed but not focussed, so I need some better visual indicator of focus.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-11-11T22:23:24.793" LastActivityDate="2015-05-09T20:49:39.787" Title="Focus-hook: attenuate colours when losing focus" Tags="|frames|hooks|focus|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2923" PostTypeId="2" ParentId="972" CreationDate="2014-10-31T17:10:51.973" Score="13" Body="&lt;p&gt;With &lt;code&gt;csv-mode&lt;/code&gt; I can see some lags with your file, but only with syntax highlighting enabled. After disabling fontification with &lt;code&gt;M-x font-lock-mode&lt;/code&gt; it works without problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable it permanently for &lt;code&gt;csv-mode&lt;/code&gt; add to your config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'csv-mode-hook (lambda () (font-lock-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you are a &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;use-package&lt;/a&gt; user:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package csv-mode&#xA;  :mode (&quot;\\.csv\\'&quot; . csv-mode)&#xA;  :init (add-hook 'csv-mode-hook (lambda () (font-lock-mode -1)))&#xA;  :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="220" LastActivityDate="2014-10-31T17:10:51.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2924" PostTypeId="2" ParentId="2891" CreationDate="2014-10-31T19:38:04.773" Score="3" Body="&lt;p&gt;GitHub user thomasf &lt;a href=&quot;https://github.com/bbatsov/projectile/issues/364#issuecomment-61296248&quot; rel=&quot;nofollow&quot;&gt;provided a workaround&lt;/a&gt; which I modified only slightly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; (source: https://github.com/bbatsov/projectile/issues/364#issuecomment-61296248)&#xA;(defun projectile-root-child-of (dir &amp;amp;optional list)&#xA;  (projectile-locate-dominating-file&#xA;   dir&#xA;   (lambda (dir)&#xA;     (--first&#xA;      (if (and&#xA;           (s-equals? (file-remote-p it) (file-remote-p dir))&#xA;           (string-match-p (expand-file-name it) (expand-file-name dir)))&#xA;          dir)&#xA;      (or list project-root-regexps (list))))))&#xA;&#xA;(defvar project-root-regexps ()&#xA;  &quot;List of regexps to match against when projectile is searching&#xA;  for project root directories.&quot;)&#xA;&#xA;(add-to-list 'project-root-regexps &quot;/path/to/some/project/$&quot;)&#xA;(add-to-list 'project-root-regexps &quot;/path/to/another/project/$&quot;)&#xA;(add-to-list 'project-root-regexps &quot;/path/to/one/more/project/$&quot;)&#xA;&#xA;(nconc projectile-project-root-files-functions '(projectile-root-child-of))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lets me add projects to to the list &lt;code&gt;project-root-regexps&lt;/code&gt;, and as far as I can tell they behave just as if they had a &lt;code&gt;.projectile&lt;/code&gt; file at their root.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-10-31T19:38:04.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2925" PostTypeId="2" ParentId="2323" CreationDate="2014-10-31T19:41:52.380" Score="4" Body="&lt;p&gt;You might try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (buf '(&quot; *Echo Area 0*&quot; &quot; *Echo Area 1*&quot;))&#xA;  (with-current-buffer (get-buffer buf)&#xA;    (make-local-variable 'face-remapping-alist)&#xA;    (add-to-list 'face-remapping-alist '(default (:background &quot;green&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-10-31T19:41:52.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2926" PostTypeId="2" ParentId="2920" CreationDate="2014-10-31T19:49:28.650" Score="1" Body="&lt;p&gt;You clearly did not &lt;a href=&quot;http://orgmode.org/manual/results.html#results&quot; rel=&quot;nofollow&quot;&gt;consult the manual&lt;/a&gt; before posting this.  Upon reading the manual, you will not only know that you could have gotten what you desired result by using the header &lt;code&gt;#+BEGIN_SRC maxima :results value verbatim&lt;/code&gt; or &lt;code&gt;#+BEGIN_SRC maxima :results value code&lt;/code&gt; you will also know that &lt;code&gt;raw&lt;/code&gt; means raw Org code.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2014-10-31T19:49:28.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2927" PostTypeId="5" CreationDate="2014-10-31T20:23:54.683" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-31T20:23:54.683" LastActivityDate="2014-10-31T20:23:54.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2928" PostTypeId="4" CreationDate="2014-10-31T20:23:54.683" Score="0" Body="**DO NOT USE THIS TAG** unless your question applies ONLY to Emacs version 24.4." OwnerUserId="-1" LastEditorUserId="253" LastEditDate="2015-04-30T17:25:56.333" LastActivityDate="2015-04-30T17:25:56.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2929" PostTypeId="5" CreationDate="2014-10-31T20:25:58.090" Score="0" Body="&lt;p&gt;This tag is meant for questions about textual tables in Emacs. The tables that are subsumed by this tag are described in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs manual&lt;/a&gt; in the section entitled &lt;code&gt;Editing text-based tables&lt;/code&gt;, but the tag can also be used for generic &lt;code&gt;table&lt;/code&gt; questions.&lt;/p&gt;&#xA;&lt;p&gt;Note that Org mode provides a&#xA;&lt;em&gt;different&lt;/em&gt; tables facility. For Org mode tables, please use the &lt;a href=&quot;https://emacs.stackexchange.com/tags/org-table/info&quot;&gt;org-table&lt;/a&gt; tag.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="14825" LastEditDate="2022-11-05T01:26:19.763" LastActivityDate="2022-11-05T01:26:19.763" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2930" PostTypeId="4" CreationDate="2014-10-31T20:25:58.090" Score="0" Body="Question about making, using, and editing tables inside of Emacs. This tag is meant mainly for table.el tables as described in the Emacs manual, but it should also be used for generic table questions. If you have a question about tables in Org mode, please use the &quot;org-table&quot; tag instead.&#xD;&#xA;&#xD;&#xA;" OwnerUserId="45" LastEditorUserId="14825" LastEditDate="2022-11-05T01:26:19.763" LastActivityDate="2022-11-05T01:26:19.763" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2931" PostTypeId="1" AcceptedAnswerId="2978" CreationDate="2014-10-31T21:06:18.983" Score="2" ViewCount="1200" Body="&lt;p&gt;I know that I can use the &lt;a href=&quot;https://unix.stackexchange.com/a/63920&quot;&gt;&lt;code&gt;file&lt;/code&gt;&lt;/a&gt; command to determine this, but I'd like a cross-platform solution using elisp only (or as few subprocesses as possible).  I have the compressed data in a variable called &lt;code&gt;response&lt;/code&gt;; you can use the following shell command to get a sample of the data I'm trying to profile:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;curl --silent &quot;http://api.stackexchange.com/2.2/filter/create&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Piping the above through &lt;code&gt;gunzip&lt;/code&gt; will give a readable result.  The problem is that my mechanism for retrieving the information has different behavior when it is run locally and when it is run on Travis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the &lt;code&gt;Content-Encoding&lt;/code&gt; header &lt;em&gt;lies&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2014-12-21T04:03:02.017" Title="How can I determine if a file is compressed from Elisp?" Tags="|elisp|compression|url|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2932" PostTypeId="5" CreationDate="2014-10-31T21:06:52.937" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-10-31T21:06:52.937" LastActivityDate="2014-10-31T21:06:52.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2933" PostTypeId="4" CreationDate="2014-10-31T21:06:52.937" Score="0" Body="The `url` package is used to retrieve URLs and is standard in GNU Emacs." OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-10-31T23:51:40.040" LastActivityDate="2014-10-31T23:51:40.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2934" PostTypeId="2" ParentId="2417" CreationDate="2014-10-31T21:27:14.510" Score="2" Body="&lt;p&gt;I have &lt;em&gt;some&lt;/em&gt; success with the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &quot;(select-frame (car (frames-on-display-list)))&quot;; sleep 1s; emacsclient -n file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The lisp code selects the first frame. To select the second one you should replace car with cadr. But I have not found a way to know which frame is the first ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bests,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jacek&lt;/p&gt;&#xA;" OwnerUserId="2353" LastActivityDate="2014-10-31T21:27:14.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2935" PostTypeId="1" AcceptedAnswerId="2938" CreationDate="2014-10-31T21:53:07.650" Score="17" ViewCount="596" Body="&lt;p&gt;I've accidentally run the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unintern variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;variable&lt;/code&gt;'s value was &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get &lt;code&gt;nil&lt;/code&gt; back without restarting Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="50" LastEditDate="2014-10-31T23:44:33.097" LastActivityDate="2016-01-21T21:11:31.757" Title="How can I bring back `nil`?" Tags="|elisp|interactive-development|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2936" PostTypeId="2" ParentId="2919" CreationDate="2014-10-31T22:04:48.173" Score="2" Body="&lt;p&gt;For your use case, there's still hope though. Since you use &lt;code&gt;etags&lt;/code&gt;, it can be used with &lt;code&gt;helm-etags-select&lt;/code&gt;, the Helm built-in command. To use it, simply follow theses steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First, run the command to generate TAGS file.&lt;/li&gt;&#xA;&lt;li&gt;Second, use &lt;code&gt;find-tag&lt;/code&gt; to feed it to Emacs; if the TAGS file is too large and Emacs asks you to confirm, just accept it. Your whole TAGS file will be loaded in Emacs and there's no more reloading.&lt;/li&gt;&#xA;&lt;li&gt;Finally, just execute &lt;code&gt;helm-etags-select&lt;/code&gt; on any symbol on your Emacs. If there exists only one definition in your project, jump instantly; otherwise, display a  Helm buffer for you to choose from.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For completion, since you have a large tag database, you would not want to use &lt;code&gt;auto-complete&lt;/code&gt; or &lt;code&gt;company&lt;/code&gt; popup because it would freeze your Emacs. In that case, you can use &lt;a href=&quot;https://github.com/yasuyk/helm-company&quot; rel=&quot;nofollow&quot;&gt;helm-company&lt;/a&gt;; it replaces &lt;code&gt;company&lt;/code&gt; popup with Helm buffer. You can simply add it to your &lt;code&gt;c-mode-hook&lt;/code&gt; or &lt;code&gt;c++-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-company-setup ()&#xA;   (local-set-key (kbd &quot;C-i&quot;) 'helm-company)&#xA;   (local-set-key (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'helm-company))&#xA;&#xA;(add-hook 'c-mode-hook 'helm-company-setup)&#xA;(add-hook 'c++-mode-hook 'helm-company-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-11-02T09:10:28.197" LastActivityDate="2014-11-02T09:10:28.197" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="2937" PostTypeId="1" AcceptedAnswerId="3077" CreationDate="2014-10-31T22:45:19.567" Score="4" ViewCount="1669" Body="&lt;p&gt;I am using the Tomorrow-Eighties color theme from the &lt;code&gt;color-theme-sanityinc-tomorrow&lt;/code&gt; package. Unfortunately when using Helm, not all of the correct colors seem to be applied. I've had an interaction with the developer of the theme, and he's not seeing the same thing I'm seeing, so I'm worried it's something unique to my setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The screenshot below shows what my &lt;code&gt;helm-find-files&lt;/code&gt; buffer looks like. As you can see, the background color for directories gets messed up, and the current line highlight is also ugly, and not typical for this theme. What do I need to change to get helm to use the theme defaults for background colors and the current selection?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fjfDP.png&quot; alt=&quot;Current line and directory background colors are incorrect&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-11-04T12:37:34.610" Title="Helm color theme gets mixed results" Tags="|helm|themes|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2938" PostTypeId="2" ParentId="2935" CreationDate="2014-10-31T23:35:52.950" Score="18" Body="&lt;p&gt;&lt;code&gt;(defconst nil ())&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;seems to have the right effect; note that &lt;code&gt;nil&lt;/code&gt; and an empty list are indistinguishable in Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/lread.c?a=25e3ff01d472b6514dea61b1c8cbc9ce88b6979a#n4034&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;lread.c:4034&lt;/code&gt;&lt;/a&gt; to see how &lt;code&gt;nil&lt;/code&gt; is created in an &lt;code&gt;obarray&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the comment at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/lread.c?a=25e3ff01d472b6514dea61b1c8cbc9ce88b6979a#n3896&quot; rel=&quot;nofollow&quot;&gt;line 3896 in &lt;code&gt;lread.c&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* There are plenty of other symbols which will screw up the Emacs&#xA;     session if we unintern them, as well as even more ways to use&#xA;     `setq' or `fset' or whatnot to make the Emacs session&#xA;     unusable.  Let's not go down this silly road.  --Stef  */&#xA;  /* if (EQ (tem, Qnil) || EQ (tem, Qt))&#xA;       error (&quot;Attempt to unintern t or nil&quot;); */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This explains why Emacs does not protect against &lt;code&gt;(unintern nil)&lt;/code&gt; and &lt;code&gt;(unintern t)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-01-21T21:11:31.757" LastActivityDate="2016-01-21T21:11:31.757" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2939" PostTypeId="2" ParentId="2937" CreationDate="2014-11-01T00:05:19.583" Score="2" Body="&lt;p&gt;I don't see such colours mismatches in my setup, I also use Helm.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Check whether or not you have multiple themes applied &lt;code&gt;M-x disable-theme&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Check your init file for &lt;code&gt;set-face-background&lt;/code&gt;, &lt;code&gt;set-face-foreground&lt;/code&gt;, &lt;code&gt;set-face-attribute&lt;/code&gt; declarations and remove them.&lt;/li&gt;&#xA;&lt;li&gt;Verify again how you are loading the theme: &lt;code&gt;(load-theme 'somename t)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;See whether or not an empty init file with just &lt;code&gt;helm-mode&lt;/code&gt; enabled and your selected theme looks fine.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I guess it's time to post some of your init file then. Are you using the theme as a MELPA package or another mechanism? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a screenshot on OSX within a tmux session (no fancy tricks)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LUtP2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="943" LastEditorUserId="943" LastEditDate="2014-11-01T03:41:39.717" LastActivityDate="2014-11-01T03:41:39.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2940" PostTypeId="2" ParentId="2937" CreationDate="2014-11-01T00:07:50.733" Score="0" Body="&lt;p&gt;I use &lt;code&gt;moe-theme&lt;/code&gt;, it's pretty like your &lt;code&gt;color-theme-sanityinc-tomorrow&lt;/code&gt; here. There is no difference with the color of files and directories, and the color of current line is nice as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: I customize the color of the mode line by myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6NDlC.png&quot; alt=&quot;Screenshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2014-11-01T00:15:05.610" LastActivityDate="2014-11-01T00:15:05.610" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2941" PostTypeId="2" ParentId="2903" CreationDate="2014-11-01T00:08:18.057" Score="5" Body="&lt;p&gt;FWIW, here's your solution in 'before' advice form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. this is untested (I don't use god-mode).&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice god-mode-lookup-key-sequence (before my-swap-x-t)&#xA;  &quot;Swap ?x and ?t KEY arguments.&quot;&#xA;  (case (ad-get-arg 0)&#xA;    (?x (ad-set-arg 0 ?t))&#xA;    (?t (ad-set-arg 0 ?x))))&#xA;(ad-activate 'god-mode-lookup-key-sequence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-11-01T00:08:18.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2942" PostTypeId="1" CreationDate="2014-11-01T00:16:19.243" Score="7" ViewCount="4780" Body="&lt;p&gt;I'm trying to get eldoc-mode to work in python-mode.  If I enter a python buffer and do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eldoc-mode&#xA;M-x python-mode-switch-to-shell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work for some built-in functions, but mostly doesn't:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;dir(&lt;/code&gt; gives imformation&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;import os&lt;/code&gt; gives imformation&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;import subprocess&lt;/code&gt; does not&lt;/li&gt;&#xA;&lt;li&gt;A function I define does not&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there anything else I need to do?&lt;/p&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="25" LastEditDate="2014-11-20T21:17:57.333" LastActivityDate="2014-11-20T21:17:57.333" Title="eldoc in python-mode" Tags="|python|eldoc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2943" PostTypeId="1" AcceptedAnswerId="3062" CreationDate="2014-11-01T01:17:27.863" Score="2" ViewCount="709" Body="&lt;p&gt;Calc supports displaying results as percentages with &lt;code&gt;c %&lt;/code&gt;. How can I make babel return this?  I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC calc&#xA;1&#xA;2&#xA;'/&#xA;'c%&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this just gives an error. I also tried with a space separating &lt;code&gt;c&lt;/code&gt; and &lt;code&gt;%&lt;/code&gt; as well several other variations. How can I input this command? These kinds of commands are fairly common in calc, so surely there is a way to input them from babel.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-11-06T20:21:34.270" Title="Calling the calc stack from babel: displaying percentages" Tags="|org-mode|org-babel|calc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2944" PostTypeId="1" AcceptedAnswerId="2967" CreationDate="2014-11-01T01:22:57.680" Score="0" ViewCount="753" Body="&lt;p&gt;When you set Emacs to recognize 4 spaces as 1 tab, then copy text from an Emacs buffer to another program, will the other program see 4 spaces or interpret it as 1 tab (which may correspond to a different number of spaces, depending on setup)?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="25" LastEditDate="2014-11-10T23:18:26.730" LastActivityDate="2014-11-10T23:18:26.730" Title="Interpretation of tabs in text copied from Emacs and pasted in other programs/editors" Tags="|copy-paste|whitespace|tabs|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2945" PostTypeId="1" CreationDate="2014-11-01T01:25:11.550" Score="6" ViewCount="5743" Body="&lt;p&gt;According to &lt;a href=&quot;https://github.com/fniessen/refcard-org-babel#eval&quot; rel=&quot;noreferrer&quot;&gt;fniessen's babel reference&lt;/a&gt; I should be able to set &lt;code&gt;:eval yes&lt;/code&gt; on a babel header line to make a source block evaluate without confirmation. However, this doesn't seem to work for me on Emacs 24.4 and Org 8.2.10.  Is this capability only available in org version 8.3 and beyond? If not, what do I need to do to enable it?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-11-20T14:48:32.283" Title="org babel eval with no confirmation is explicit: :eval yes" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2946" PostTypeId="1" AcceptedAnswerId="2948" CreationDate="2014-11-01T02:49:14.653" Score="17" ViewCount="545" Body="&lt;p&gt;It happens quite often that I want to undo changes locally or line-wise. For example, when I change multiple lines in a source code and I want to revert only one of them, then I have to step through the entire undo tree to find the state I want to return to. It would be better if I could only revert the marked region or the line where the point is. Is there something like this already in existence?&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="25" LastEditDate="2014-11-10T23:13:11.707" LastActivityDate="2014-11-10T23:13:11.707" Title="Is there a 'local undo' extension for Emacs?" Tags="|editing|undo|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2947" PostTypeId="1" CreationDate="2014-11-01T03:26:37.397" Score="1" ViewCount="60" Body="&lt;p&gt;Consider the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((url-inhibit-uncompression t))&#xA;  (switch-to-buffer&#xA;   (url-retrieve-synchronously&#xA;    &quot;http://api.stackexchange.com/2.2/filter/create&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect to get something that looks mostly like garbage as the content (gzipped response), but instead I get a 'reasonable' JSON object (formatted for sanity):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;HTTP/1.1 200 OK&#xA;Cache-Control: private&#xA;Content-Type: application/json; charset=utf-8&#xA;Content-Encoding: gzip&#xA;Access-Control-Allow-Origin: *&#xA;Access-Control-Allow-Methods: GET, POST&#xA;Access-Control-Allow-Credentials: false&#xA;X-Content-Type-Options: nosniff&#xA;Date: Sat, 01 Nov 2014 03:19:40 GMT&#xA;Content-Length: 1903&#xA;&#xA;{&#xA;  &quot;quota_remaining&quot;: 178,&#xA;  &quot;quota_max&quot;: 300,&#xA;  &quot;has_more&quot;: false,&#xA;  &quot;items&quot;: [&#xA;    {&#xA;      &quot;filter&quot;: &quot;default&quot;,&#xA;      &quot;filter_type&quot;: &quot;safe&quot;,&#xA;      &quot;included_fields&quot;: [&#xA;        &quot;.backoff&quot;,&#xA;        &quot;.error_id&quot;,&#xA;        &quot;.error_message&quot;,&#xA;        .................&#xA;        &quot;write_permission.min_seconds_between_actions&quot;,&#xA;        &quot;write_permission.object_type&quot;,&#xA;        &quot;write_permission.user_id&quot;&#xA;      ]&#xA;    }&#xA;  ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is &lt;code&gt;url-inhibit-uncompression&lt;/code&gt; not doing anything here?  Spoiler alert: It's not used anywhere in the source (that I can find).  How can I force output similar to &lt;code&gt;curl&lt;/code&gt; without using &lt;code&gt;curl&lt;/code&gt; (i.e. compressed and without headers)?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-11-02T10:36:21.243" Title="`url-inhibit-uncompression` is ineffective; emulating curl with url.el" Tags="|compression|url|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2948" PostTypeId="2" ParentId="2946" CreationDate="2014-11-01T03:27:52.070" Score="23" Body="&lt;p&gt;This is standard Emacs functionality (since 1998 / 20.3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you have transient mark mode enabled, just mark the region, and use undo as normal, and Emacs will perform undo operations relevant to the (active) region only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With transient mark mode off, or if the marked region is not active, use a &lt;kbd&gt;C-u&lt;/kbd&gt; prefix argument to the undo command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;undo&lt;/code&gt;&lt;br&gt;&#xA;or &quot;selective undo&quot; in the manual: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Undo&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-01T03:42:03.887" LastActivityDate="2014-11-01T03:42:03.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2949" PostTypeId="1" AcceptedAnswerId="2950" CreationDate="2014-11-01T04:41:06.310" Score="18" ViewCount="1358" Body="&lt;p&gt;We already have a question about &lt;a href=&quot;https://emacs.stackexchange.com/q/2322/2264&quot;&gt;tools useful specifically for testing&lt;/a&gt;, but what about actually &lt;em&gt;writing&lt;/em&gt; the code?  Which packages do you find speed up your development?  Which aids do you use to quickly and easily navigate and understand your projects?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-03T22:08:23.193" Title="What are good tools for Emacs package development?" Tags="|elisp|interactive-development|package-development|" AnswerCount="1" CommentCount="13" ClosedDate="2014-11-05T06:17:09.637" ContentLicense="CC BY-SA 3.0" />
  <row Id="2950" PostTypeId="2" ParentId="2949" CreationDate="2014-11-01T04:41:06.310" Score="21" Body="&lt;h2&gt;Authoring&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;edebug&lt;/code&gt;&lt;/strong&gt;: Step-by-step debugging of Elisp code.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;checkdoc&lt;/code&gt;&lt;/strong&gt;: Learn about style errors in your comments and docs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;elint&lt;/code&gt;&lt;/strong&gt;: Linter for Emacs Lisp.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.emacswiki.org/ParEdit&quot;&gt;&lt;code&gt;paredit&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Manipulate lisp code as trees instead of lines. Never have unbalanced parentheses.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/abo-abo/lispy&quot;&gt;&lt;code&gt;lispy&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: vi-like alternative / superset of &lt;code&gt;paredit&lt;/code&gt;. Additionally includes shortcuts&#xA;for outlines, narrowing, edebug, ediff, semantic, ace-jump-mode, multiple-cursors, cider, slime and geiser.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Simultaneously edit multiple similar expressions. Amognst other things, useful for code refactoring.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/erefactor.el&quot;&gt;&lt;code&gt;erefactor&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Code refactoring.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.foldr.org/~michaelw/emacs/redshank/&quot;&gt;&lt;code&gt;redshank&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Another refactoring library (designed for Common Lisp, but works well with Emacs Lisp).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/joddie/macrostep&quot;&gt;&lt;code&gt;macrostep&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Interactive in-buffer macro expansion.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot;&gt;&lt;code&gt;yasnippet&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Code snippets for quick expansion of repetitive idioms (examples &lt;a href=&quot;https://github.com/bmaland/yasnippet-emacs-lisp-mode&quot;&gt;here&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Navigation&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;speedbar&lt;/code&gt;&lt;/strong&gt;: The speedbar is a great way to navigate through your project.  It recognizes 'tags' as &lt;code&gt;defun&lt;/code&gt;s and &lt;code&gt;defvar&lt;/code&gt;s (and the like) and provides visible bookmarks as an outline.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/zk-phi/outlined-elisp-mode&quot;&gt;&lt;code&gt;outlined-elisp-mode&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: A collection of settings for the &lt;code&gt;outline&lt;/code&gt; minor mode for Elisp buffers.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/purcell/elisp-slime-nav&quot;&gt;&lt;code&gt;elisp-slime-nav&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Instant jumping to function and variable definitions with &lt;code&gt;M-.&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Profiling&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;elp&lt;/code&gt;&lt;/strong&gt;: Interactive frontend for the Emacs Lisp Profiler, useful for exploring what exactly is slow in your profiled function and how it interacts with the rest of Emacs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Management&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://github.com/Bruce-Connor/names&quot;&gt;&lt;code&gt;names&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: Provides a macro to create namespaces&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Version control&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://git-scm.com/&quot;&gt;&lt;code&gt;Git&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt; and its Emacs front-end &lt;strong&gt;&lt;a href=&quot;http://magit.github.io/&quot;&gt;&lt;code&gt;Magit&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: arguably the best version control system and a very well-thought Emacs front-end for it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Misc&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/InferiorEmacsLispMode&quot;&gt;&lt;code&gt;ielm&lt;/code&gt;&lt;/a&gt;&lt;/strong&gt;: interactive REPL&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="8" LastEditDate="2014-11-03T22:08:23.193" LastActivityDate="2014-11-03T22:08:23.193" CommentCount="2" CommunityOwnedDate="2014-11-01T04:41:06.310" ContentLicense="CC BY-SA 3.0" />
  <row Id="2951" PostTypeId="1" AcceptedAnswerId="3514" CreationDate="2014-11-01T07:15:46.127" Score="20" ViewCount="4401" Body="&lt;p&gt;I have an &lt;code&gt;org-mode&lt;/code&gt; file containing a table of data and two Python code blocks to extract different summaries from it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to share some common constants and functions between these two code blocks.  Ideally, I'd do this by factoring out the common code into a separate code block, which would be automatically included and evaluated whenever either of the other two blocks is evaluated.  In made-up syntax, it would look something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: init_block&#xA;#+BEGIN_SRC python&#xA;  ... common constants and functions here ...&#xA;#+END_SRC&#xA;&#xA;#+NAME: summary_1&#xA;#+BEGIN_SRC python :prepend init_block&#xA;  ... data-processing code depending on init code goes here ...&#xA;#+END_SRC&#xA;&#xA;#+NAME: summary_2&#xA;#+BEGIN_SRC python :prepend init_block&#xA;  ... more processing which also depends on init code ...&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suppose I could use the &lt;code&gt;:session&lt;/code&gt; option, but I would prefer not to, for two reason.  First, it sets up a stateful system, rather than one which runs from scratch each time I use &lt;code&gt;C-c C-c&lt;/code&gt; on a code block.  Second, and relatedly, I now have to remember to manually evaluate the common initialization code each time I open the file: I can't just update the data table, go to one of the summary blocks and hit &lt;code&gt;C-c C-c&lt;/code&gt; to update it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a good way to do this?&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorDisplayName="user1968" LastEditDate="2014-11-01T08:04:38.893" LastActivityDate="2023-12-01T08:29:11.400" Title="Can I include a common code block in two different code blocks in Org mode?" Tags="|org-mode|org-babel|python|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2952" PostTypeId="1" AcceptedAnswerId="3569" CreationDate="2014-11-01T07:40:38.717" Score="18" ViewCount="4535" Body="&lt;p&gt;I would like to be able to report warnings and errors when evaluating a Python code block in an Org file.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a code block has Python syntax errors, Org helpfully pops them up in a separate buffer called &lt;code&gt;*Org-Babel Error Output*&lt;/code&gt;.  It would be nice to be able to send my own warnings there too, while retaining the ability to return an array result to Org mode as a table using &lt;code&gt;:results value&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, here is a dummy example of the kind of thing I thought might work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python &#xA;    import sys&#xA;    sys.stderr.write('Warning.\n')&#xA;    sys.stderr.flush()&#xA;    return [['Table', 'header'], ['table', 'data']]&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| Table | header |&#xA;| table | data   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edited to add: This &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00048.html&quot; rel=&quot;noreferrer&quot;&gt;discussion on the org-mode list&lt;/a&gt; suggests that error output is only displayed when the code-block evaluation fails.  So it looks like this is possible, but only by aborting the evaluation using &lt;code&gt;exit(1)&lt;/code&gt; or similar.&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastActivityDate="2022-08-12T15:30:09.087" Title="Display errors and warnings in an org-mode code block" Tags="|org-mode|org-babel|python|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2953" PostTypeId="2" ParentId="2951" CreationDate="2014-11-01T08:16:10.693" Score="5" Body="&lt;p&gt;After thinking a little more I found a partial solution to this problem.  It does use &lt;code&gt;:session&lt;/code&gt;, but I can at least ensure that the common initialisation code is always run automatically before evaluating one of the other blocks.  The 'trick' is to use a dummy header variable that refers to the header block, causing it to be evaluated each time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: init_block&#xA;#+BEGIN_SRC python :session t&#xA;  constant=19&#xA;  def some_function(x):&#xA;    return constant * x&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :session t :var dummy=init_block&#xA;some_function(13)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 247&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I can change definitions in &lt;code&gt;init_block&lt;/code&gt; and have them automatically re-evaluated whenever another block which refers to it using &lt;code&gt;:var dummy=init_block&lt;/code&gt; is evaluated.  This works well provided that the definitions in &lt;code&gt;init_block&lt;/code&gt; are idempotent and stateless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that when changing Python blocks to &lt;code&gt;:session&lt;/code&gt; mode you have to remove any &lt;code&gt;return&lt;/code&gt; statements, which are needed in functional mode to return a value from the block).&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastActivityDate="2014-11-01T08:16:10.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2955" PostTypeId="1" AcceptedAnswerId="3523" CreationDate="2014-11-01T10:28:47.840" Score="22" ViewCount="1696" Body="&lt;p&gt;I just installed emacs 24.4 and I've started using eww. But one annoying thing is that when I visit google.com I get a grey background which makes text really hard to read for my theme.&lt;/p&gt;&#xA;&lt;p&gt;This is how it looks: &lt;img src=&quot;https://i.stack.imgur.com/YiKWU.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Is there any way I could change the color of the background? I first thought I could customize eww faces but there is no option for this. I'm also curious why is this background color there, in the first place.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-11-14T03:47:04.330" Title="How to customize background color for some web pages opened with eww?" Tags="|themes|eww|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2957" PostTypeId="1" AcceptedAnswerId="2968" CreationDate="2014-11-01T12:48:24.773" Score="10" ViewCount="1618" Body="&lt;p&gt;I would like to change the syntax highlighting in my &lt;code&gt;lua-mode.el&lt;/code&gt; without affecting other major modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as an example, I would like &quot;key words&quot; like &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;then&lt;/code&gt;, &lt;code&gt;else&lt;/code&gt; to be in bold and blue typeface when in &lt;code&gt;lua-mode&lt;/code&gt; (instead of the default pink) without having the same highlighting style while editing a &lt;code&gt;.tex&lt;/code&gt; file with AUCTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have tried to put the following code in my &lt;code&gt;.emacs&lt;/code&gt; and then also in my &lt;code&gt;lua-mode.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA;  '(font-lock-builtin-face ((t (:foreground &quot;maroon3&quot;))))&#xA;  '(font-lock-comment-face ((t (:foreground &quot;green4&quot;))))&#xA;  '(font-lock-keyword-face ((t (:foreground &quot;dark blue&quot; :weight bold))))&#xA;  '(font-lock-string-face ((t (:foreground &quot;dark cyan&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this way I get the same syntax highlighting for every mode I work with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question might be related: &lt;a href=&quot;https://emacs.stackexchange.com/questions/2293/change-syntax-highlighting-without-changing-major-mode&quot;&gt;Change syntax highlighting without changing major mode?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a (hopefully simple and general) way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2360" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-10T23:22:38.777" Title="How to customize syntax highlight for just a given mode" Tags="|customize|faces|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2959" PostTypeId="1" AcceptedAnswerId="2979" CreationDate="2014-11-01T13:42:21.047" Score="19" ViewCount="3322" Body="&lt;p&gt;I'm writing an extension that talks to an outside process, so it is a given to lower the amount of 'hey whats up' requests when my buffer isn't focused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what is the best way to recognize:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;When my buffer is visible and focused&lt;/li&gt;&#xA;&lt;li&gt;When my buffer is visible but not focused &lt;/li&gt;&#xA;&lt;li&gt;When my buffer is neither visible nor focused&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="98" LastEditorUserId="504" LastEditDate="2014-11-01T15:56:17.230" LastActivityDate="2014-11-01T20:23:22.537" Title="How to know my buffer's visible/focused status?" Tags="|elisp|buffers|focus|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2960" PostTypeId="2" ParentId="265" CreationDate="2014-11-01T13:48:17.830" Score="4" Body="&lt;pre&gt;&lt;code&gt;(add-to-list 'focus-out-hook (lambda () (save-some-buffers t nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will save all unsaved buffers visiting file, on emacs 24.4&lt;/p&gt;&#xA;" OwnerUserId="98" LastActivityDate="2014-11-01T13:48:17.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2961" PostTypeId="1" AcceptedAnswerId="2962" CreationDate="2014-11-01T14:34:43.317" Score="18" ViewCount="2602" Body="&lt;p&gt;The only thing I've found that works is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval `(vector ,@(mapcar #'1+ [1 2 3 4])))&#xA;=&amp;gt; [2 3 4 5]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that seems &lt;em&gt;far&lt;/em&gt; too complicated to be the 'right' way.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2015-07-11T04:40:49.013" LastActivityDate="2019-06-19T02:05:15.933" Title="How can I map over a vector and get a vector?" Tags="|elisp|mapping|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2962" PostTypeId="2" ParentId="2961" CreationDate="2014-11-01T14:50:06.303" Score="19" Body="&lt;p&gt;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/Mapping-over-Sequences.html&quot;&gt;&lt;code&gt;cl-map&lt;/code&gt;&lt;/a&gt;, instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-map 'vector #'1+ [1 2 3 4])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A little extra background: &lt;code&gt;cl-map&lt;/code&gt; is the &lt;a href=&quot;http://clhs.lisp.se/Body/f_map.htm&quot;&gt;Common Lisp &lt;code&gt;map&lt;/code&gt; function&lt;/a&gt; that generalizes to sequence types:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-map 'vector #'1+ '[1 2 3 4]) ;; ==&amp;gt; [2 3 4 5]&#xA;(cl-map 'list   #'1+ '(1 2 3 4)) ;; ==&amp;gt; (2 3 4 5)&#xA;(cl-map 'string #'upcase &quot;abc&quot;)  ;; ==&amp;gt; &quot;ABC&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It can also convert between sequence types (eg, here, the input is a list and the output is a vector):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-map 'vector #'1+ '(1 2 3 4)) ;; ==&amp;gt; [2 3 4 5]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-01T15:06:24.023" LastActivityDate="2014-11-01T15:06:24.023" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2963" PostTypeId="2" ParentId="2961" CreationDate="2014-11-01T14:50:21.323" Score="15" Body="&lt;p&gt;Since I was beat by 18 seconds, here's a simpler and safer way to do it without the cl library. It also doesn't evaluate the elements. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply #'vector (mapcar #'1+ [1 2 3 4])) ;; =&amp;gt; [2 3 4 5]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-01T15:22:26.453" LastActivityDate="2014-11-01T15:22:26.453" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2964" PostTypeId="1" CreationDate="2014-11-01T14:56:21.700" Score="5" ViewCount="916" Body="&lt;p&gt;I manage packages in Emacs using &lt;a href=&quot;http://cask.readthedocs.org/en/latest/index.html&quot;&gt;Cask&lt;/a&gt; and &lt;a href=&quot;https://github.com/rdallasgray/pallet&quot;&gt;Pallet&lt;/a&gt;.  Yesterday I upgraded to Emacs 24.4; it went well enough, but all of a sudden all my packages were missing.  Cask installs packages in separate directories by Emacs version, so everything was in &lt;code&gt;.cask/24.3.1&lt;/code&gt;; there was nothing in &lt;code&gt;.cask/24.4.1&lt;/code&gt;, and in fact the directory didn't exist.  Once I figured this out, I was able to run &lt;code&gt;cask&lt;/code&gt; and install everything again -- but is there a way to make this happpen automagically, from within Emacs itself, when upgrading?&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="25" LastEditDate="2014-11-10T23:22:56.223" LastActivityDate="2014-11-10T23:22:56.223" Title="How can I get Cask or Pallet to automatically install packages on startup?" Tags="|package|cask|upgrade|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2965" PostTypeId="2" ParentId="2904" CreationDate="2014-11-01T14:59:22.157" Score="3" Body="&lt;p&gt;If you didn't have other packages bound to TAB, I think the behavior you want is provided by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq tab-always-indent 'complete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setting the TAB key will first try to re-indent the current line. If the line is already indented properly it will call &lt;code&gt;completion-at-point&lt;/code&gt; instead. You can customize the variable &lt;code&gt;completion-styles&lt;/code&gt; to tune how the built-in completion behaves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use the &lt;code&gt;auto-complete&lt;/code&gt; package instead, you can hook ac in to &lt;code&gt;completion-at-point&lt;/code&gt; so that it works with the setting above. This example configuration might be helpful:  &lt;a href=&quot;https://github.com/purcell/emacs.d/blob/master/lisp/init-auto-complete.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/purcell/emacs.d/blob/master/lisp/init-auto-complete.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That example basically adds &lt;code&gt;auto-complete-at-point&lt;/code&gt; to &lt;code&gt;completion-at-point-functions&lt;/code&gt;, with a wrapper to handle some edge cases and a hook to wire things up when &lt;code&gt;auto-complete&lt;/code&gt; is enabled.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-01T14:59:22.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2966" PostTypeId="2" ParentId="2917" CreationDate="2014-11-01T15:05:56.023" Score="4" Body="&lt;p&gt;If you want to control the behavior from the minibuffer when using &lt;code&gt;eval-expression&lt;/code&gt;, use &lt;code&gt;eval-expression-minibuffer-setup-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you have eldoc on globally and want it off only in this one case, use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun turn-off-eldoc () (eldoc-mode -1))&#xA;(add-hook 'eval-expression-minibuffer-setup-hook #'turn-off-eldoc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This hook is new in Emacs 24.4.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-01T15:15:05.403" LastActivityDate="2014-11-01T15:15:05.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2967" PostTypeId="2" ParentId="2944" CreationDate="2014-11-01T15:52:01.163" Score="3" Body="&lt;p&gt;This depends on how you have configured Emacs, which is not clear to me from the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your buffer text might contain spaces or tab characters, depending on your settings. Copying and pasting the text won't change the actual characters. If you copy text containing a tab control character it will be pasted as a tab (&lt;code&gt;\t&lt;/code&gt;) and the way it is displayed will depend on the editor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indentation.html#Indentation&quot; rel=&quot;nofollow&quot;&gt;Indentation (in the Emacs manual)&lt;/a&gt; for more detail. The setting &lt;code&gt;indent-tabs-mode&lt;/code&gt; controls whether Emacs inserts tab or space characters when you indent. By default it is set to insert tab characters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use the commands &lt;code&gt;tabify&lt;/code&gt; and &lt;code&gt;untabify&lt;/code&gt; to convert spaces to tabs (or vice versa).&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-01T15:52:01.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2968" PostTypeId="2" ParentId="2957" CreationDate="2014-11-01T18:02:49.757" Score="9" Body="&lt;p&gt;Faces are global so changing its attributes anywhere changes it&#xA;everywhere, as you've noticed.  To change it locally, make a copy of&#xA;the face, change the attributes in the copy and then use a mode hook&#xA;to locally set the old face to the copy on a per-buffer basis.  The&#xA;sample below does it for &lt;code&gt;font-lock-comment-face&lt;/code&gt;, but the same&#xA;incantation will work for any face.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-variable-buffer-local 'font-lock-comment-face)&#xA;(copy-face 'font-lock-comment-face 'lua-comment-face)&#xA;(set-face-foreground 'lua-comment-face &quot;green4&quot;)&#xA;&#xA;(add-hook 'lua-mode-hook&#xA;          (lambda ()&#xA;            (setq font-lock-comment-face 'lua-comment-face)            &#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-11-01T18:02:49.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2969" PostTypeId="1" AcceptedAnswerId="2989" CreationDate="2014-11-01T18:28:08.890" Score="36" ViewCount="6838" Body="&lt;p&gt;I use melpa-stable as an additional package repository, but one of the packages I like to use (icicles) isn't available on melpa-stable. Is there any way to configure package.el to normally use melpa-stable, but use melpa for a specific subset of packages?&lt;/p&gt;&#xA;" OwnerUserId="2167" LastEditorUserId="105" LastEditDate="2014-11-10T23:41:41.867" LastActivityDate="2018-10-09T19:42:20.127" Title="Is it possible to use both MELPA and MELPA-stable at the same time?" Tags="|package|package-repositories|icicles|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2970" PostTypeId="5" CreationDate="2014-11-01T18:41:31.683" Score="0" Body="&lt;h3&gt;Useful links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Cursor-Display.html#Cursor-Display&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cursor display&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-Point.html#Moving-Point&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cursor moving&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shift-Selection.html#Shift-Selection&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cursor selecting&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-23T19:49:53.270" LastActivityDate="2017-02-23T19:49:53.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2971" PostTypeId="4" CreationDate="2014-11-01T18:41:31.683" Score="0" Body="is for the cursor display and cursor moving operations in Emacs. The cursor point features prominently in Emacs for editing, selecting, and navigating around Emacs buffers." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-23T19:50:13.933" LastActivityDate="2017-02-23T19:50:13.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2972" PostTypeId="5" CreationDate="2014-11-01T18:47:54.740" Score="0" Body="&lt;p&gt;Emacs can split a frame into two or more windows. Multiple windows can display parts of different &lt;a href=&quot;/questions/tagged/buffers&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;buffers&amp;#39;&quot; rel=&quot;tag&quot;&gt;buffers&lt;/a&gt;, or different parts of one buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that what most operating systems call a &lt;em&gt;window&lt;/em&gt; is called a &lt;em&gt;frame&lt;/em&gt; in Emacs. For questions related to operating system windows, see the tag &lt;a href=&quot;/questions/tagged/frames&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;frames&amp;#39;&quot; rel=&quot;tag&quot;&gt;frames&lt;/a&gt;. What Emacs calls a windows is called a &lt;em&gt;pane&lt;/em&gt; in some other systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For questions about running Emacs on Microsoft's family of operating systems, see &lt;a href=&quot;/questions/tagged/microsoft-windows&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;microsoft-windows&amp;#39;&quot; rel=&quot;tag&quot;&gt;microsoft-windows&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Multiple &lt;a href=&quot;/questions/tagged/frames&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;frames&amp;#39;&quot; rel=&quot;tag&quot;&gt;frames&lt;/a&gt; always imply multiple windows, because each frame has its own set of windows. Each &lt;a href=&quot;/questions/tagged/window&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;window&amp;#39;&quot; rel=&quot;tag&quot;&gt;window&lt;/a&gt; belongs to one and only one frame. The active window's &lt;a href=&quot;/questions/tagged/mode-line&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;mode-line&amp;#39;&quot; rel=&quot;tag&quot;&gt;mode-line&lt;/a&gt; is highlighted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tag questions about &lt;a href=&quot;/questions/tagged/window&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;window&amp;#39;&quot; rel=&quot;tag&quot;&gt;window&lt;/a&gt; with appropriate additional tags to avoid confusion with frames and GUI conventions.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Window.html#Basic-Window&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Basic Window&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows.html#Windows&quot; rel=&quot;nofollow noreferrer&quot;&gt;Multiple Windows&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="25" LastEditDate="2017-02-17T12:26:07.830" LastActivityDate="2017-02-17T12:26:07.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2973" PostTypeId="4" CreationDate="2014-11-01T18:47:54.740" Score="0" Body="In Emacs, a window is one part of a frame, displaying one buffer. For questions about operating system windows, see the tag 'frame." OwnerUserId="45" LastEditorUserId="25" LastEditDate="2017-02-17T12:23:07.823" LastActivityDate="2017-02-17T12:23:07.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2974" PostTypeId="5" CreationDate="2014-11-01T18:52:35.703" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-01T18:52:35.703" LastActivityDate="2014-11-01T18:52:35.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2975" PostTypeId="4" CreationDate="2014-11-01T18:52:35.703" Score="0" Body="are the graphical system-level “windows” of Emacs. It initially contains one window and normally also contains a menu bar, tool bar, and echo area." OwnerUserId="45" LastEditorUserId="118" LastEditDate="2014-11-08T16:00:13.620" LastActivityDate="2014-11-08T16:00:13.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2976" PostTypeId="2" ParentId="2969" CreationDate="2014-11-01T19:04:15.257" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://blog.jorgenschaefer.de/2014/06/the-sorry-state-of-emacs-lisp-package.html&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you a have&#xA;a discussion about using both repositories in parallel, so this should be possible with 24.4; have you tried for example with a defun to update the list of repos, then &lt;a href=&quot;http://endlessparentheses.com/require-feature-or-install-package.html&quot; rel=&quot;nofollow&quot;&gt;paradox-require&lt;/a&gt;, and finally getting back to the original repo list ?&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2014-11-01T19:04:15.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2977" PostTypeId="2" ParentId="2964" CreationDate="2014-11-01T19:25:23.190" Score="6" Body="&lt;p&gt;Without using cask or pallet, you can achieve this with code such as the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-user-dir (expand-file-name (concat &quot;elpa/&quot; emacs-version) user-emacs-directory))&#xA;(setq package-enable-at-startup nil)&#xA;(package-initialize)&#xA;&#xA;(defun require-package (package &amp;amp;optional min-version no-refresh)&#xA;  &quot;Install given PACKAGE, optionally requiring MIN-VERSION.&#xA;If NO-REFRESH is non-nil, the available package lists will not be&#xA;re-downloaded in order to locate PACKAGE.&quot;&#xA;  (if (package-installed-p package min-version)&#xA;      t&#xA;    (if (or (assoc package package-archive-contents) no-refresh)&#xA;        (package-install package)&#xA;      (progn&#xA;        (package-refresh-contents)&#xA;        (require-package package min-version t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can sprinkle &lt;code&gt;(require-package ...)&lt;/code&gt; calls throughout your config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require-package 'flycheck)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The packages will be installed into a version-specific package directory at startup, unless they're already there. (Disclaimer: I haven't tried the modification to &lt;code&gt;package-user-dir&lt;/code&gt; above, so YMMV.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This won't &quot;lock&quot; package versions, but I don't personally care about that. To upgrade packages, you'd go through the usual &lt;code&gt;M-x package-list-packages&lt;/code&gt; procedure.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-11-01T19:25:23.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2978" PostTypeId="2" ParentId="2931" CreationDate="2014-11-01T19:45:02.690" Score="5" Body="&lt;p&gt;It seems to me that the question is a little vague: is the goal to recognize &lt;em&gt;gzip-compressed&lt;/em&gt; data? If not, what formats need to be supported?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Focussing on the &lt;code&gt;gzip&lt;/code&gt; case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I see it, possible approaches depend on the use case. For instance, if the length of a possibly compressed &lt;code&gt;response&lt;/code&gt; is expected to be small, one can try decompressing to test if it was compressed in the first place.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; get sample data for testing&#xA;(setq response&#xA;      (with-temp-buffer&#xA;        (set-buffer-multibyte nil)&#xA;        (shell-command &quot;curl --silent 'http://api.stackexchange.com/2.2/filter/create'&quot; t)&#xA;        (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Now I can test the code below using data in &lt;code&gt;response&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun zlib-compressed-p (string)&#xA;  &quot;Return t if STRING is compressed with zlib, nil otherwise.&quot;&#xA;  (when (not (zlib-available-p))&#xA;    (error &quot;This function requires zlib!&quot;))&#xA;  (with-temp-buffer&#xA;    (set-buffer-multibyte nil)&#xA;    (insert string)&#xA;    (if (zlib-decompress-region (point-min) (point-max))&#xA;        t&#xA;      nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A small modification returns human-readable data regardless of whether it was compressed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun zlib-decompress-if-compressed (string)&#xA;  &quot;Decompress STRING if it is recognized as a compressed&#xA;unibyte string by zlib, otherwise return STRING unchanged.&#xA;&#xA;Requires zlib.&quot;&#xA;  (when (not (zlib-available-p))&#xA;    (error &quot;zlib-decompress-if-compressed requires zlib!&quot;))&#xA;  (with-temp-buffer&#xA;    (set-buffer-multibyte nil)&#xA;    (insert string)&#xA;    (if (zlib-decompress-region (point-min) (point-max))&#xA;        (buffer-string)&#xA;      string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I know, &lt;code&gt;zlib&lt;/code&gt; is the only compression library Emacs can be compiled with, so we can't handle other formats this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original question states &quot;I have the compressed data in a variable called &lt;code&gt;response&lt;/code&gt;...&quot;, and &lt;code&gt;zlib-decompress-if-compressed&lt;/code&gt; can process it &lt;em&gt;without&lt;/em&gt; writing it to a file. It is easy to create versions that takes a file name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun zlib-file-compressed-p (filename)&#xA;  &quot;Return t if file is compressed with zlib, nil otherwise.&quot;&#xA;  (with-temp-buffer&#xA;    (set-buffer-multibyte nil)&#xA;    (insert-file-contents-literally filename nil)&#xA;    (zlib-compressed-p (buffer-string))))&#xA;&#xA;(defun zlib-decompress-file (filename)&#xA;  &quot;Return the contents of the file FILENAME as a string,&#xA;decompressed using zlib if the file is recognized as compressed.&#xA;If the file is not compressed with zlib, return its contents&#xA;literally.&quot;&#xA;  (with-temp-buffer&#xA;    (set-buffer-multibyte nil)&#xA;    (insert-file-contents-literally filename nil)&#xA;    (zlib-decompress-if-compressed (buffer-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For other formats, or if a &lt;code&gt;response&lt;/code&gt; is too long to attempt decompressing, one can check if the first two bytes of a string match the magic number defined by the &lt;a href=&quot;http://www.gzip.org/zlib/rfc-gzip.html&quot; rel=&quot;nofollow&quot;&gt;gzip&lt;/a&gt; file format specification.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun gzip-check-magic (data)&#xA;  &quot;Check if the first two bytes of a string in DATA match magic&#xA;numbers identifying the gzip file format. See&#xA;http://www.gzip.org/zlib/rfc-gzip.html for the file format&#xA;description.&quot;&#xA;  (equal (substring (string-as-unibyte data) 0 2) (unibyte-string 31 139)))&#xA;&#xA;(defun gzip-compressed-p (filename)&#xA;  &quot;Check if the file FILENAME is gzip-compressed by checking&#xA;magic numbers identifying the gzip file format. See&#xA;`gzip-check-magic' for details.&quot;&#xA;  (let ((first-two-bytes (with-temp-buffer&#xA;                           (set-buffer-multibyte nil)&#xA;                           (insert-file-contents-literally filename nil 0 2)&#xA;                           (buffer-string))))&#xA;    (gzip-check-magic first-two-bytes)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This method is also limited to &lt;code&gt;gzip&lt;/code&gt;, may give a &lt;em&gt;false positive&lt;/em&gt; result, but is truly cross-platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It can be extended to other formats that use &quot;magic numbers&quot; to identify the format, for example &lt;a href=&quot;http://en.wikipedia.org/wiki/Bzip2#File_format&quot; rel=&quot;nofollow&quot;&gt;bzip2&lt;/a&gt;, but this is certainly not scalable.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, using &lt;code&gt;call-process&lt;/code&gt; and &lt;code&gt;file&lt;/code&gt; or similar seems to be the most flexible approach.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-12T16:47:17.523" LastActivityDate="2014-11-12T16:47:17.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2979" PostTypeId="2" ParentId="2959" CreationDate="2014-11-01T20:23:22.537" Score="28" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;window-buffer&lt;/code&gt; returns the buffer currently displayed by a given window.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;get-buffer-window&lt;/code&gt;, on the contrary, returns &lt;em&gt;a&lt;/em&gt; window currently displaying the given buffer (or &lt;code&gt;nil&lt;/code&gt; if there is no such window; play with the optional 2nd argument to tell it how to behave in cases where you have multiple frames).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With these two ingredients, you should be able to discriminate all your cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; my-buffer is supposed to be the buffer you are looking for&#xA;(cond ((eq my-buffer (window-buffer (selected-window)))&#xA;       (message &quot;Visible and focused&quot;))&#xA;      ((get-buffer-window my-buffer)&#xA;       (message &quot;Visible and unfocused&quot;)) &#xA;      (t&#xA;       (message &quot;Not visible&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-11-01T20:23:22.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2980" PostTypeId="2" ParentId="2947" CreationDate="2014-11-01T22:06:17.713" Score="1" Body="&lt;p&gt;This looks like a bug in &lt;code&gt;url-handle-content-transfer-encoding&lt;/code&gt;: I believe it should check &lt;code&gt;url-inhibit-uncompression&lt;/code&gt;. Consider submitting a bug report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime you can add advice to this function, making it possible to (temporarily) disable it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar url-handle-content-transfer-encoding-disable nil)&#xA;(advice-add 'url-handle-content-transfer-encoding :around&#xA;  (lambda (orig &amp;amp;rest args)&#xA;    (if url-handle-content-transfer-encoding-disable nil&#xA;      (apply orig args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((url-handle-content-transfer-encoding-disable t))&#xA;  (switch-to-buffer&#xA;   (url-retrieve-synchronously&#xA;    &quot;http://api.stackexchange.com/2.2/filter/create&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns the HTTP header followed by compressed data.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-01T22:14:35.140" LastActivityDate="2014-11-01T22:14:35.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2981" PostTypeId="2" ParentId="2947" CreationDate="2014-11-01T22:43:58.827" Score="2" Body="&lt;p&gt;I agree with @Constantine, this looks like a bug. Consider submitting a bug report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for how to fix it, I personally prefer temporary overriding instead of advices (too many bad experiences with them), but none of the options is ideal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can temporarily override functions by &lt;a href=&quot;http://endlessparentheses.com/understanding-letf-and-how-it-replaces-flet.html#sec-1&quot; rel=&quot;nofollow&quot;&gt;wrapping your code in a &lt;code&gt;cl-letf&lt;/code&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-letf (((symbol-function 'url-handle-content-transfer-encoding)&#xA;           #'ignore))&#xA;  (switch-to-buffer&#xA;   (url-retrieve-synchronously&#xA;    &quot;http://api.stackexchange.com/2.2/filter/create&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This assumes you want this function to do nothing. If you want to change its behaviour, just use a lambda or a function name instead of ignore. &lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-02T10:36:21.243" LastActivityDate="2014-11-02T10:36:21.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2982" PostTypeId="1" AcceptedAnswerId="2995" CreationDate="2014-11-01T23:37:46.943" Score="3" ViewCount="901" Body="&lt;p&gt;From &lt;a href=&quot;http://www.emacswiki.org/HexColour&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki: Hex Colour&lt;/a&gt;, it is explained how to get in-line syntax highlighting of hex code, and other formats of color. For instance with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar hexcolour-keywords&#xA;  '((&quot;#[abcdef[:digit:]]\\{6\\}&quot;&#xA;      (0 (put-text-property (match-beginning 0)&#xA;                            (match-end 0)&#xA;                            'face (list :background &#xA;                                        (match-string-no-properties 0)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I try this with some emacs-lisp such as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'org-todo nil&#xA;                    :weight 'bold :box '(:line-width 1 :color &quot;#D8ABA7&quot;)&#xA;                    :foreground &quot;#D8ABA7&quot; :background &quot;#FFE6E4&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the hex is not given the color face. If I try &lt;code&gt;M-x describe-face&lt;/code&gt; on these, I find face is &lt;code&gt;org-block-background&lt;/code&gt;. Is there a good way to override this? &lt;/p&gt;&#xA;" OwnerUserId="971" LastActivityDate="2014-11-02T13:58:58.570" Title="Override syntax highlighting with color of hex code." Tags="|faces|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2983" PostTypeId="1" AcceptedAnswerId="3029" CreationDate="2014-11-02T04:26:31.693" Score="8" ViewCount="137" Body="&lt;p&gt;Having written a couple of custom &lt;code&gt;comint&lt;/code&gt;-derived modes, I often find it tricky to decide how to keep track of buffers and processes: for instance, to associate different source buffers with different interpreters.  Is it better to keep a reference to the buffer or the process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a buffer, one can find its associated process using &lt;code&gt;get-buffer-process&lt;/code&gt;.  Conversely, given a process, &lt;code&gt;process-buffer&lt;/code&gt; returns its associated buffer.  Both buffers and processes also permit an extra layer of indirection by looking them up by unique name, but this seems fragile compared to just keeping a reference to the object itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possibility seems clearly bad, since it violates the principle of storing data once-and-only-once: namely, keeping references to both the buffer &lt;em&gt;and&lt;/em&gt; the process.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most &lt;code&gt;comint-&lt;/code&gt; functions for sending input take a process rather than a buffer as an argument, which argues for hanging on to the process object, not the buffer.  On the other hand, buffers tend to stick around longer than processes: a process might finish or be killed and a new process started in the buffer it previously used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there other convincing arguments for referencing the process or its buffer?&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorDisplayName="user1968" LastEditDate="2014-11-02T04:33:30.743" LastActivityDate="2014-11-03T15:02:42.117" Title="How should comint-derived modes keep track of buffers and processes?" Tags="|elisp|programming|comint|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2984" PostTypeId="1" AcceptedAnswerId="2985" CreationDate="2014-11-02T04:35:20.257" Score="2" ViewCount="282" Body="&lt;p&gt;Since I discovered &lt;code&gt;multi-term&lt;/code&gt;, I use it exclusively over &lt;code&gt;term&lt;/code&gt; or &lt;code&gt;eshell&lt;/code&gt;. But, I'm lazy and would prefer to be able to simply type &lt;em&gt;term&lt;/em&gt; to activate &lt;code&gt;multi-term&lt;/code&gt;. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2272" LastActivityDate="2014-11-02T04:45:39.377" Title="Is it possible to alias an internal command?" Tags="|eshell|term|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2985" PostTypeId="2" ParentId="2984" CreationDate="2014-11-02T04:45:39.377" Score="4" Body="&lt;p&gt;Yes, with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Functions.html#index-function-aliases-752&quot; rel=&quot;nofollow&quot;&gt;defalias&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this code in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'term 'multi-term)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will make it so calling &lt;code&gt;M-x term&lt;/code&gt; calls the same function as &lt;code&gt;M-x multi-term&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-11-02T04:45:39.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2986" PostTypeId="1" CreationDate="2014-11-02T08:28:45.707" Score="3" ViewCount="195" Body="&lt;p&gt;I create my widget with the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(widget-create 'editable-list&#xA;                   :entry-format &quot;%i %d %v&quot;&#xA;                   :value '(&quot;&quot;)&#xA;                   '(editable-field&#xA;                     :valid-regexp &quot;\\(?:ftp://\\|http\\(?:s?://\\)\\|magnet:\\)&quot;&#xA;                     :error &quot;Url does not match supported type.&quot;&#xA;                     :value &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately input validation is not working.&#xA;How does one define a widget of type editable-list with validation?&lt;/p&gt;&#xA;" OwnerUserId="98" LastEditorUserId="105" LastEditDate="2014-12-21T04:01:12.177" LastActivityDate="2014-12-21T04:01:12.177" Title="How does one define a widget of type editable-list with validation?" Tags="|elisp|error-handling|widget|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2987" PostTypeId="2" ParentId="2986" CreationDate="2014-11-02T10:33:14.833" Score="4" Body="&lt;p&gt;I don't think that input validation of top-level widgets happens automatically.  Neither the info manual nor the source code suggest otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Composite widgets (e.g. &lt;code&gt;editable-list&lt;/code&gt;) automatically validate their childs upon validation, but you need to explicitly validate top-level widgets yourself before using their values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if your form has some kind of “Apply” button, you'd iterate through all relevant input widgets in its &lt;code&gt;:notify&lt;/code&gt; action, and validate each widget by calling its &lt;code&gt;:validate&lt;/code&gt; property, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((unvalidated-widgets my-widgets)&#xA;      form-invalid)&#xA;  (while (and unvalidated-widgets (not form-invalid))&#xA;    (let ((widget (pop unvalidated-widgets)))&#xA;      (when (widget-apply input-field :validate)&#xA;        (setq form-invalid t)&#xA;        (message &quot;Widget %s failed verification: %s&quot;&#xA;                 (widget-get widget :tag)&#xA;                 (widget-get widget :error)))))&#xA;  (unless form-invalid&#xA;    ;; The form is valid, do whatever you want to do with its data&#xA;    ;; …&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;my-widgets&lt;/code&gt; is a list of widgets in your form.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-11-02T10:33:14.833" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2988" PostTypeId="1" AcceptedAnswerId="2990" CreationDate="2014-11-02T10:40:10.967" Score="12" ViewCount="4184" Body="&lt;p&gt;I don't like the default &lt;kbd&gt;M-n&lt;/kbd&gt; and &lt;kbd&gt;M-p&lt;/kbd&gt; keys for &lt;code&gt;company-select-next&lt;/code&gt; and &lt;code&gt;company-select-previous&lt;/code&gt; so I was wondering if it's possible to remap those to &lt;kbd&gt;C-n&lt;/kbd&gt; and &lt;kbd&gt;C-p&lt;/kbd&gt; without affecting the mappings when company's tooltip is not active.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="105" LastEditDate="2015-03-27T19:10:36.607" LastActivityDate="2015-03-27T19:10:36.607" Title="How to remap Company's select next and select previous keys?" Tags="|key-bindings|keymap|company-mode|tooltip|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2989" PostTypeId="2" ParentId="2969" CreationDate="2014-11-02T10:46:40.830" Score="50" Body="&lt;p&gt;Use the option &lt;code&gt;package-archive-priorities&lt;/code&gt; which was made for this very purpose.   To prefer MELPA Stable over MELPA, add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives&#xA;      '((&quot;GNU ELPA&quot;     . &quot;https://elpa.gnu.org/packages/&quot;)&#xA;        (&quot;MELPA Stable&quot; . &quot;https://stable.melpa.org/packages/&quot;)&#xA;        (&quot;MELPA&quot;        . &quot;https://melpa.org/packages/&quot;))&#xA;      package-archive-priorities&#xA;      '((&quot;MELPA Stable&quot; . 10)&#xA;        (&quot;GNU ELPA&quot;     . 5)&#xA;        (&quot;MELPA&quot;        . 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The higher the number, the higher the priority of a package archive.  For any package that exists in multiple archives Emacs' package manager picks the package from the archive with the highest priority, and ignores packages in other archives, even if the version number is higher.  If the package exists in two archives of the same priority, the higher version number wins, and ultimately I think the order in &lt;code&gt;package-archives&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend to explicitly assign a priority to all archives, including the default GNU ELPA archive, to avoid any ambiguities.  Although archives that are not in &lt;code&gt;package-archive-priorities&lt;/code&gt; have a default priority of 0, it's all too easy to forget that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package-archive-priorities&lt;/code&gt; was introduced in Emacs 25.1, for earlier releases see the old answer below:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In Emacs 24 it's not possible to default to MELPA Stable and use MELPA only for specific packages in a general way.  Without any customization package.el defaults to the archive &lt;strong&gt;providing the highest version&lt;/strong&gt;, which is MELPA.  There is no interface to change that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as of Emacs 24.4 the new option &lt;code&gt;package-pinned-packages&lt;/code&gt; allows you to pin individual packages to archives, but this only lets you implement the inverse of your requirement: Default to MELPA, and use MELPA Stable for specific packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, currently your only option is to fill &lt;code&gt;package-pinned-packages&lt;/code&gt; with all packages that you'd like to use, either manually or with some piece of Emacs Lisp code.  Note that &lt;code&gt;package-pinned-packages&lt;/code&gt; must be set &lt;strong&gt;before&lt;/strong&gt; calling &lt;code&gt;package-refresh-contents&lt;/code&gt; because the pinning is evaluated while &lt;strong&gt;building the package index&lt;/strong&gt;, and not when installing packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A long-term solution would be to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; to ask the Emacs developers to implement some kind of “default archive” feature, or to ask the maintainer of icicles to make properly tagged releases so that MELPA Stable can build stable packages for it.  Neither might turn out to be easy, though, since the former requires larger changes to package.el, and the latter that icicles is moved from EmacsWiki into some proper VCS repository with tags, which I presume its maintainer is not willing to do, for if they were, they would have done it long ago.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="97" LastEditDate="2018-10-09T19:42:20.127" LastActivityDate="2018-10-09T19:42:20.127" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="2990" PostTypeId="2" ParentId="2988" CreationDate="2014-11-02T10:58:10.313" Score="23" Body="&lt;p&gt;Modify &lt;code&gt;company-active-map&lt;/code&gt; accordingly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'company&#xA;  (define-key company-active-map (kbd &quot;M-n&quot;) nil)&#xA;  (define-key company-active-map (kbd &quot;M-p&quot;) nil)&#xA;  (define-key company-active-map (kbd &quot;C-n&quot;) #'company-select-next)&#xA;  (define-key company-active-map (kbd &quot;C-p&quot;) #'company-select-previous))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2014-11-02T18:29:39.120" LastActivityDate="2014-11-02T18:29:39.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2991" PostTypeId="1" AcceptedAnswerId="2992" CreationDate="2014-11-02T11:37:29.710" Score="7" ViewCount="949" Body="&lt;p&gt;I am having trouble creating images with just data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(web-http-get&#xA; (lambda (con hdr data)&#xA;   (setq nic-profile-img-data data))&#xA; :url &quot;http://pbs.twimg.com/profile_images/494606908385288192/Vq16xxxu_normal.jpeg&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;downloads an image from Twitter (yes, I'm writing a Twitter tool).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (insert-image (create-image nic-profile-img-data 'jpeg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just get a blank square.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this however:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-image&#xA; (progn&#xA;   (with-temp-file &quot;/tmp/nic.jpg&quot;&#xA;     (insert nic-profile-img-data))&#xA;   (create-image &quot;/tmp/nic.jpg&quot; 'jpeg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get a nice picture of a really good looking Englishman.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand the difference here. I thought it might be encoding of the image data somehow, so I tried all sorts of different decoding and encoding (who understands that stuff in Emacs anyway?), but none of it made any difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The create-image with data stuff seems fairly new, and most code I've found uses files. I can use files, but it's an extra layer I didn't want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How might this work and what, if anything I'm doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Platform: Emacs 24-4 on GNU/Linux.&lt;/p&gt;&#xA;" OwnerUserId="362" LastEditorUserId="2096" LastEditDate="2014-11-03T01:37:25.453" LastActivityDate="2014-11-03T01:37:25.453" Title="Using 'create-image' with data, not a file" Tags="|images|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2992" PostTypeId="2" ParentId="2991" CreationDate="2014-11-02T12:09:37.027" Score="11" Body="&lt;p&gt;First of all: &lt;strong&gt;Use the third argument.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both &lt;code&gt;data&lt;/code&gt; and &lt;code&gt;file&lt;/code&gt; are represented by a string, you need to tell &lt;code&gt;create-image&lt;/code&gt; which one you're using. If you don't tell it, it defaults to file, which is why your &lt;code&gt;data&lt;/code&gt; version wasn't working.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (insert-image (create-image nic-profile-img-data 'jpeg t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The third argument, when non-nil, specifies that the first argument is a data string instead of a filename.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Secondly: &lt;strong&gt;Use Unibyte&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even when doing the above, I still get a blank square. The reason is that the string you get from &lt;code&gt;web-http-get&lt;/code&gt; is multibyte, and &lt;code&gt;insert-image&lt;/code&gt; needs an unibyte string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's one way to solve that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-image (create-image (string-as-unibyte nic-profile-img-data)&#xA;                            'jpeg t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As for an example package which uses &lt;code&gt;create-image&lt;/code&gt; from a data string, see the &lt;code&gt;nethack-tiles.el&lt;/code&gt; file in &lt;a href=&quot;http://download.savannah.gnu.org/releases/nethack-el/&quot;&gt;nethack-el&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-02T13:47:35.787" LastActivityDate="2014-11-02T13:47:35.787" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2993" PostTypeId="2" ParentId="2991" CreationDate="2014-11-02T13:40:32.487" Score="0" Body="&lt;p&gt;Here's how to do it with files and a lot of crazy depends:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-image&#xA; (match-let* (((alist 'content-md5 md5) nic-image-meta)&#xA;              ((list* filename dir) (reverse (split-string md5 &quot;/&quot;)))&#xA;              (directory (cons &quot;/tmp/twaddle-avatars/&quot; (reverse dir)))&#xA;              (dirpath (s-join &quot;/&quot; directory))&#xA;              (filepath (expand-file-name filename dirpath)))&#xA;   (unless (file-exists-p filepath)&#xA;     (make-directory dirpath t)&#xA;     (let ((coding-system-for-write 'raw-text))&#xA;       (with-temp-file filepath&#xA;         (insert nic-profile-img-data))))&#xA;   (create-image filepath'jpeg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This requires shadchen and dash at least. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I post it because it shows how to handle saving the file where you have the meta-data. The twitter meta-data for the file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nic-image-meta&#xA;      '((x-content-type-options . &quot;nosniff&quot;)&#xA;        (expires . &quot;Mon, 17 Nov 2014 03:55:30 GMT&quot;)&#xA;        (x-cache-hits . &quot;1&quot;)&#xA;        (x-cache . &quot;HIT&quot;)&#xA;        (x-served-by . &quot;cache-tw-lon2-cr1-5-TWLON2&quot;)&#xA;        (connection . &quot;keep-alive&quot;)&#xA;        (age . &quot;250298&quot;)&#xA;        (via . &quot;1.1 varnish&quot;)&#xA;        (date . &quot;Sun, 02 Nov 2014 03:55:30 GMT&quot;)&#xA;        (accept-ranges . &quot;bytes&quot;)&#xA;        (content-length . &quot;1731&quot;)&#xA;        (x-ton-expected-size . &quot;1731&quot;)&#xA;        (server . &quot;tfe&quot;)&#xA;        (last-modified . &quot;Mon, 29 Sep 2014 04:37:52 GMT&quot;)&#xA;        (etag . &quot;\&quot;CmzKxLI/Fm2pvQV04q6cZA==\&quot;&quot;)&#xA;        (content-type . &quot;image/jpeg&quot;)&#xA;        (content-md5 . &quot;CmzKxLI/Fm2pvQV04q6cZA==&quot;)&#xA;        (status-string . &quot;OK&quot;)&#xA;        (status-code . &quot;200&quot;)&#xA;        (status-version . &quot;1.1&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Dealing with the filename as a function of the md5 seems like a good idea and results in a very distributed storage across directories (which is good).&lt;/p&gt;&#xA;" OwnerUserId="362" LastActivityDate="2014-11-02T13:40:32.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2995" PostTypeId="2" ParentId="2982" CreationDate="2014-11-02T13:58:58.570" Score="6" Body="&lt;p&gt;You can also achieve this using &lt;a href=&quot;http://elpa.gnu.org/packages/rainbow-mode.html&quot;&gt;&lt;code&gt;rainbow-mode&lt;/code&gt;&lt;/a&gt;, which is part of ELPA.  Install it with &lt;code&gt;M-x package-install rainbow-mode&lt;/code&gt; and activate it with &lt;code&gt;M-x rainbow-mode&lt;/code&gt;.  It seems that the color changes don't occur until you edit the buffer.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-11-02T13:58:58.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2996" PostTypeId="1" CreationDate="2014-11-02T15:41:10.790" Score="8" ViewCount="194" Body="&lt;p&gt;I found that a killed buffer is still shown by a buffer created earlier by &lt;code&gt;C-x C-b&lt;/code&gt;. How can we get the up-to-date buffer list?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="25" LastEditDate="2014-11-11T00:24:31.410" LastActivityDate="2014-11-11T00:24:31.410" Title="Killed buffer still shown by an earlier Ctrl-x Ctrl-b" Tags="|buffers|buffer-list|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2997" PostTypeId="2" ParentId="2996" CreationDate="2014-11-02T15:43:29.393" Score="9" Body="&lt;p&gt;&lt;kbd&gt;g&lt;/kbd&gt; calls &lt;code&gt;revert-buffer&lt;/code&gt;.&#xA;Not updating each time is by design and can be seen as an advantage.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-02T15:43:29.393" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2998" PostTypeId="1" AcceptedAnswerId="3020" CreationDate="2014-11-02T16:54:24.327" Score="5" ViewCount="448" Body="&lt;p&gt;I'm trying &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE.html&quot; rel=&quot;nofollow&quot;&gt;SMIE&lt;/a&gt; to describe the &lt;a href=&quot;https://github.com/NixOS/nix/blob/master/doc/manual/nix-lang-ref.xml&quot; rel=&quot;nofollow&quot;&gt;Nix language&lt;/a&gt;. Unfortunately when I use it, I have the following problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There are 4 messages saying: &lt;code&gt;Warning (smie): token } is both closer and neither&lt;/code&gt;. Which I do not understand. &lt;/li&gt;&#xA;&lt;li&gt;A message asks you for a comment syntax : but the syntax table has a comment character. So again, I don't understand&lt;/li&gt;&#xA;&lt;li&gt;If you enter &lt;code&gt;#&lt;/code&gt; as comment character, you will see that indentation is 28 instead of the expected 2.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I put all my code on &lt;a href=&quot;https://github.com/DamienCassou/nix-mode&quot; rel=&quot;nofollow&quot;&gt;Github | nix-mode&lt;/a&gt;. You can reproduce by cloning the repository, running &lt;code&gt;cask&lt;/code&gt; and then running &lt;code&gt;cask exec ecukes&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the SMIE grammar for Nix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar nix+-smie-grammar&#xA;  (smie-prec2-&amp;gt;grammar&#xA;   (smie-bnf-&amp;gt;prec2&#xA;    '((id)&#xA;      (expr (exprfunction))&#xA;      (exprfunction (&quot;{&quot; formals &quot;}&quot; &quot;:&quot; exprfunction)&#xA;                    (exprassert))&#xA;      (exprassert (&quot;assert&quot; expr &quot;;&quot; exprassert)&#xA;                  (exprif))&#xA;      (exprif (&quot;if&quot; expr &quot;then&quot; expr &quot;else&quot; expr)&#xA;              (exprop))&#xA;      (exprop (&quot;!&quot; exprop)&#xA;              (exprop &quot;==&quot; exprop)&#xA;              (exprop &quot;!=&quot; exprop)&#xA;              (exprop &quot;&amp;amp;&amp;amp;&quot; exprop)&#xA;              (exprop &quot;||&quot; exprop)&#xA;              (exprop &quot;-&amp;gt;&quot; exprop)&#xA;              (exprop &quot;//&quot; exprop)&#xA;              (exprop &quot;~&quot; exprop)&#xA;              (exprop &quot;?&quot; id)&#xA;              (exprapp))&#xA;      (exprapp (exprapp &quot;.&quot; exprselect)&#xA;               (exprselect))&#xA;      (exprselect (exprsimple))&#xA;      (exprsimple (id)&#xA;                  (&quot;true&quot;)&#xA;                  (&quot;false&quot;)&#xA;                  (&quot;null&quot;)&#xA;                  (&quot;(&quot; expr &quot;)&quot;)&#xA;                  (&quot;{&quot; binds &quot;}&quot;)&#xA;                  (&quot;let&quot; &quot;{&quot; binds &quot;}&quot;)&#xA;                  (&quot;rec&quot; &quot;{&quot; binds &quot;}&quot;)&#xA;                  (&quot;[&quot; exprselects &quot;]&quot;))&#xA;      (binds (binds &quot;;&quot; binds)&#xA;             (bind))&#xA;      (exprselects (expreselect))&#xA;      (bind (id &quot;=&quot; expr)&#xA;            (&quot;inherit&quot; exprp))&#xA;      (exprp (&quot;(&quot; expr &quot;)&quot;))&#xA;      (formals (formals &quot;,&quot; formals)&#xA;               (formal))&#xA;      (formal (id)&#xA;              (id &quot;?&quot; expr)))&#xA;    '((assoc &quot;;&quot;))&#xA;    '((assoc &quot;,&quot;))&#xA;    '((assoc &quot;==&quot;)&#xA;      (assoc &quot;!=&quot;)&#xA;      (assoc &quot;&amp;amp;&amp;amp;&quot;)&#xA;      (assoc &quot;||&quot;)&#xA;      (assoc &quot;-&amp;gt;&quot;)&#xA;      (assoc &quot;//&quot;)&#xA;      (assoc &quot;~&quot;)&#xA;      (assoc &quot;?&quot;)&#xA;      (assoc &quot;!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2222" LastEditorUserId="25" LastEditDate="2014-11-10T23:58:31.817" LastActivityDate="2014-11-10T23:58:31.817" Title="Some warnings and unexpected indentation with SMIE" Tags="|indentation|syntax|smie|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2999" PostTypeId="1" AcceptedAnswerId="3008" CreationDate="2014-11-02T17:07:20.403" Score="92" ViewCount="45180" Body="&lt;p&gt;&lt;em&gt;Is there a way to maximize my window on start-up?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I hit &lt;kbd&gt;Control&lt;/kbd&gt;+&lt;kbd&gt;&lt;img src=&quot;https://i.stack.imgur.com/T0oPO.png&quot; alt=&quot;Windows Key&quot;&gt;&lt;/kbd&gt;+&lt;kbd&gt;Up&lt;/kbd&gt; on my keyboard but it is very bothersome to do that every time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.4 on Ubuntu 12.04.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="253" LastEditDate="2015-07-28T14:45:47.673" LastActivityDate="2019-11-23T15:13:02.700" Title="How to maximize my Emacs frame on start-up?" Tags="|frames|" AnswerCount="6" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3000" PostTypeId="2" ParentId="2999" CreationDate="2014-11-02T17:22:50.120" Score="35" Body="&lt;p&gt;On Emacs 24.4, &lt;code&gt;(toggle-frame-maximized)&lt;/code&gt; toggles the maximized state of the current frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also, the &lt;a href=&quot;https://stackoverflow.com/questions/7763847/maximize-emacs-on-start-up-not-the-fullscreen&quot;&gt;Maximize Emacs on start up&lt;/a&gt; question on stackoverflow and the &lt;a href=&quot;http://www.emacswiki.org/emacs/FullScreen&quot; rel=&quot;noreferrer&quot;&gt;Full Screen&lt;/a&gt; page on the EmacsWiki.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-11-02T17:42:58.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3001" PostTypeId="2" ParentId="2999" CreationDate="2014-11-02T17:36:48.530" Score="12" Body="&lt;p&gt;@Constantine's answer already covers how this can be achieved by modifying your init-file (if you use Emacs 24.4).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you start Emacs from the command line, from the dash, or from a launcher like &lt;a href=&quot;https://launchpad.net/synapse-project&quot; rel=&quot;noreferrer&quot;&gt;Synapse&lt;/a&gt; or &lt;a href=&quot;https://userbase.kde.org/Plasma/Krunner&quot; rel=&quot;noreferrer&quot;&gt;krunner&lt;/a&gt;, you can specify the &lt;code&gt;-mm&lt;/code&gt; option (short for &lt;code&gt;--maximized&lt;/code&gt;) to achieve the same result:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;emacs -mm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;-mm&lt;/code&gt; option was first &lt;a href=&quot;https://www.gnu.org/software/emacs/news/NEWS.23.2&quot; rel=&quot;noreferrer&quot;&gt;introduced in Emacs 23.2&lt;/a&gt;, so this solution is not limited to the latest stable release.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What distinguishes this solution from other suggestions posted here (all of which are great) is that it allows you to decide on a case-by-case basis whether you want the Emacs frame maximized at start-up or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a more permanent solution, you can set up an &lt;code&gt;alias&lt;/code&gt; for the command shown above by adding the following to your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;alias emacs='emacs -mm'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-23T18:09:27.970" LastActivityDate="2015-01-23T18:09:27.970" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3002" PostTypeId="5" CreationDate="2014-11-02T18:13:37.390" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-02T18:13:37.390" LastActivityDate="2014-11-02T18:13:37.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3003" PostTypeId="4" CreationDate="2014-11-02T18:13:37.390" Score="0" Body="Questions about editing or manipulating text inside of Emacs. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-03T20:45:18.247" LastActivityDate="2014-11-03T20:45:18.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3004" PostTypeId="5" CreationDate="2014-11-02T18:19:43.723" Score="0" Body="&lt;p&gt;Emacs &lt;a href=&quot;/questions/tagged/themes&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;themes&amp;#39;&quot; rel=&quot;tag&quot;&gt;themes&lt;/a&gt; may contain any combination of specifications for &lt;a href=&quot;/questions/tagged/colors&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;colors&amp;#39;&quot; rel=&quot;tag&quot;&gt;colors&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/coloring&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;coloring&amp;#39;&quot; rel=&quot;tag&quot;&gt;coloring&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/faces&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;faces&amp;#39;&quot; rel=&quot;tag&quot;&gt;faces&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/fonts&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;fonts&amp;#39;&quot; rel=&quot;tag&quot;&gt;fonts&lt;/a&gt;, and &lt;a href=&quot;/questions/tagged/font-locking&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;font-locking&amp;#39;&quot; rel=&quot;tag&quot;&gt;font-locking&lt;/a&gt;. Some &lt;a href=&quot;/questions/tagged/themes&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;themes&amp;#39;&quot; rel=&quot;tag&quot;&gt;themes&lt;/a&gt; are optimized for a specific &lt;a href=&quot;/questions/tagged/major-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;major-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;major-mode&lt;/a&gt;. Besides tagging with &lt;a href=&quot;/questions/tagged/themes&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;themes&amp;#39;&quot; rel=&quot;tag&quot;&gt;themes&lt;/a&gt;, specify as many related tags as possible when asking questions or searching for answers in &lt;a href=&quot;/questions/tagged/themes&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;themes&amp;#39;&quot; rel=&quot;tag&quot;&gt;themes&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-10T18:09:04.250" LastActivityDate="2017-02-10T18:09:04.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3005" PostTypeId="4" CreationDate="2014-11-02T18:19:43.723" Score="0" Body="Questions about using, creating, and modifying color themes and custom themes." OwnerUserId="45" LastEditorUserId="105" LastEditDate="2017-02-09T18:14:13.280" LastActivityDate="2017-02-09T18:14:13.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3006" PostTypeId="5" CreationDate="2014-11-02T18:26:23.270" Score="0" Body="&lt;p&gt;SMIE is a package that provides a generic navigation and indentation engine. Based on a very simple parser using an “operator precedence grammar”, it lets major modes extend the sexp-based navigation of Lisp to non-Lisp languages as well as provide a simple to use but reliable auto-indentation.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Operator precedence grammar is a very primitive technology for parsing compared to some of the more common techniques used in compilers. It has the following characteristics: its parsing power is very limited, and it is largely unable to detect syntax errors, but it has the advantage of being algorithmically efficient and able to parse forward just as well as backward. In practice that means that SMIE can use it for indentation based on backward parsing, that it can provide both forward-sexp and backward-sexp functionality, and that it will naturally work on syntactically incorrect code without any extra effort. The downside is that it also means that most programming languages cannot be parsed correctly using SMIE, at least not without resorting to some special tricks (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE-Tricks.html#SMIE-Tricks&quot; rel=&quot;nofollow&quot;&gt;SMIE Tricks&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, please see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE.html&quot; rel=&quot;nofollow&quot;&gt;Simple Minded Indentation Engine&lt;/a&gt; on the online GNU Emacs manual.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-03T18:51:00.983" LastActivityDate="2014-11-03T18:51:00.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3007" PostTypeId="4" CreationDate="2014-11-02T18:26:23.270" Score="0" Body="SMIE (Simple Minded Indentation Engine) is a package that provides a generic navigation and indentation engine. Based on a very simple parser using an “operator precedence grammar”, it lets major modes extend the sexp-based navigation of Lisp to non-Lisp languages as well as provide a simple to use but reliable auto-indentation." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-03T18:51:44.053" LastActivityDate="2014-11-03T18:51:44.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3008" PostTypeId="2" ParentId="2999" CreationDate="2014-11-02T18:33:30.897" Score="115" Body="&lt;p&gt;I have another method, which I have tested with Emacs 24.3 and 24.4, as well as on both Windows and GNU/Linux. I have placed the following in &lt;a href=&quot;https://github.com/501st-alpha1/emacs&quot;&gt;my init file&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(fullscreen . maximized))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe this was modified slightly from a StackOverflow answer I found a while ago, but I can't seem to find it again now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Another bonus of this method is that it also applies to new clients that connect to your Emacs server (with e.g. &lt;code&gt;emacsclient -c&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2014-11-02T18:39:26.637" LastActivityDate="2014-11-02T18:39:26.637" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3009" PostTypeId="5" CreationDate="2014-11-02T19:33:56.993" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-02T19:33:56.993" LastActivityDate="2014-11-02T19:33:56.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3010" PostTypeId="4" CreationDate="2014-11-02T19:33:56.993" Score="0" Body="The mode that determines the editing behavior of Emacs while that buffer is current. The mode line normally shows the name of the current major mode, in parentheses." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-05T06:08:30.973" LastActivityDate="2014-11-05T06:08:30.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3011" PostTypeId="1" AcceptedAnswerId="3012" CreationDate="2014-11-02T20:54:27.977" Score="9" ViewCount="1407" Body="&lt;p&gt;I struggle to pronounce many computer terms, and to this day still mispronounce latex in my head - it just sounds better rhyming with flex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I pronounce Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2256" LastActivityDate="2014-11-02T21:06:31.920" Title="How do I pronounce Emacs?" Tags="|learning|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3012" PostTypeId="2" ParentId="3011" CreationDate="2014-11-02T20:57:27.717" Score="8" Body="&lt;p&gt;Just think of E-max. The letter E is pronounced like the name of the letter is pronounced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I has the same sound as in need, clean, feel, green etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I recommend this video: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=FW8hqLCEOJI&quot;&gt;How to Say or Pronounce Emacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-02T21:06:31.920" LastActivityDate="2014-11-02T21:06:31.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3013" PostTypeId="1" AcceptedAnswerId="3016" CreationDate="2014-11-02T21:43:35.263" Score="4" ViewCount="3573" Body="&lt;p&gt;I don't know what the formal name of it is (this being one of the reasons that I can't find how to achieve it). But, what I want is to make Emacs start the second bracket with the same amount of space that is used in the first one and when you press Enter to go in a new line, that line to start with the same amount of spaces if there is a bracket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not looking for a weird customization (unless it is a last resort). I just am looking for a typical feature in most IDE, that I am sure you use if you write code in your Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to achieve is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(i=0;i&amp;lt;10;i++)&#xA;{&#xA;    if(i&amp;lt;5)&#xA;    {&#xA;&#xA;        /* I want by pressing Enter the cursor to start in here &#xA;        so to write the print */&#xA;        print(&quot;Text&quot;)&#xA;&#xA;&#xA;    }&#xA;    /* I want this bracket to close automatically &#xA;    under the first one (of the if) and not in the beginning. */&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="25" LastEditDate="2014-11-11T00:05:21.367" LastActivityDate="2014-11-11T00:05:21.367" Title="Indentation after braces in C" Tags="|indentation|cc-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3015" PostTypeId="2" ParentId="3013" CreationDate="2014-11-02T23:34:53.890" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/smartparens/&quot;&gt;smartparens&lt;/a&gt;, a solution for advanced handling of pairs (such as &lt;code&gt;()&lt;/code&gt;, &lt;code&gt;[]&lt;/code&gt;, &lt;code&gt;{}&lt;/code&gt;, &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;, ...) supports &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Permissions#pre-and-post-action-hooks&quot;&gt;pre- and post-action hooks&lt;/a&gt;. With these it's possible to make Emacs indent the content of a &lt;code&gt;{}&lt;/code&gt; pair after hitting &lt;code&gt;RET&lt;/code&gt; after the beginning &lt;code&gt;{&lt;/code&gt;, the &lt;code&gt;}&lt;/code&gt; is inserted at the same time as the &lt;code&gt;{&lt;/code&gt;. The following snippet is taken from the documentation and sets up the described behaviour for C++:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair 'c++-mode &quot;{&quot; nil :post-handlers '((my-create-newline-and-enter-sexp &quot;RET&quot;)))&#xA;&#xA;(defun my-create-newline-and-enter-sexp (&amp;amp;rest _ignored)&#xA;  &quot;Open a new brace or bracket expression, with relevant newlines and indent. &quot;&#xA;  (newline)&#xA;  (indent-according-to-mode)&#xA;  (forward-line -1)&#xA;  (indent-according-to-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-11-02T23:34:53.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3016" PostTypeId="2" ParentId="3013" CreationDate="2014-11-03T00:36:10.673" Score="9" Body="&lt;p&gt;Your question appears to be dealing with two independent issues:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;you want the &lt;kbd&gt;RET&lt;/kbd&gt; character to automatically indent; and&lt;/li&gt;&#xA;&lt;li&gt;you want an indentation style that is different from the Emacs default.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h1&gt;Electric &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;A character that performs something else than just inserting itself is called &lt;em&gt;electric&lt;/em&gt; in Emacs.  There are two ways in Emacs to make &lt;kbd&gt;RET&lt;/kbd&gt; electric: the generic &lt;em&gt;electric-mode&lt;/em&gt;, which you enable by doing &lt;code&gt;M-x electric-indent-mode&lt;/code&gt;, and works in all modes; and the CC-mode specific minor mode &lt;em&gt;electric mode&lt;/em&gt;, which you enable by typing &lt;code&gt;C-c C-l&lt;/code&gt; in a CC-mode buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please try both, and choose whichever your prefer.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Changing the style of indentation&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Your preferred indentation style differs from Emacs' default in two ways: it uses 4 spaces indentation, while Emacs uses 2, and it puts curly braces beneath the control operators, rather than on the same line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former issue is easily solved:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default c-basic-offset 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The latter is hardly more involved:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq c-default-style (cons '(c-mode . &quot;k&amp;amp;r&quot;) c-default-style)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can change the used style for a single buffer by doing &lt;code&gt;M-x c-set-style&lt;/code&gt;.  Please see the CC-Mode info manual for the available styles.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2014-11-03T02:42:18.273" LastActivityDate="2014-11-03T02:42:18.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3017" PostTypeId="2" ParentId="2999" CreationDate="2014-11-03T01:36:28.010" Score="44" Body="&lt;p&gt;Adjust the &lt;code&gt;...-frame-alist&lt;/code&gt; in your init file to tell Emacs how to maximize the frame.  You also have multiple options for how, exactly, to maximize it.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;code&gt;alist&lt;/code&gt; options&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You have two &lt;code&gt;...-frame-alist&lt;/code&gt; options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;default-frame-alist&lt;/code&gt; (as in @Scott Weldon's answer)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;initial-frame-alist&lt;/code&gt;  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;default-frame-alist&lt;/code&gt;, it will maximize &lt;em&gt;all&lt;/em&gt; frames: both the first one and any others you create.  That may not be what you want (or maybe it is: who am I to judge?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;initial-frame-alist&lt;/code&gt;, it will maximize &lt;em&gt;only&lt;/em&gt; the frame that Emacs creates at startup, but will not touch any subsequent frames you create.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;maximization options&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For your maximization options, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Size-Parameters.html#Size-Parameters&quot;&gt;this node of the manual&lt;/a&gt; for details.  The short version is that you can set the &lt;code&gt;fullscreen&lt;/code&gt; parameter to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;fullwidth&lt;/code&gt; (make the frame as wide as possible, don't touch the vertical)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;fullheight&lt;/code&gt; (make the frame as tall as possible, don't touch the horizontal)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;fullboth&lt;/code&gt; (set height and width to to size of the screen)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;maximized&lt;/code&gt; (make it, well, maximized)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The difference between &lt;code&gt;fullboth&lt;/code&gt; and &lt;code&gt;maximized&lt;/code&gt; is that you can resize the former with the mouse, while with the latter you cannot.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;So, for example, these lines will 1) create a maximized initial frame, and 2) create fullheight (but not fullwidth) frames on every subsequent frame:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'initial-frame-alist '(fullscreen . maximized))&#xA;(add-to-list 'default-frame-alist '(fullscreen . fullheight))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-03T01:36:28.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3018" PostTypeId="1" AcceptedAnswerId="3019" CreationDate="2014-11-03T01:53:03.460" Score="13" ViewCount="460" Body="&lt;p&gt;How can I bookmark Info page to continue reading later ?&lt;/p&gt;&#xA;" OwnerUserId="2382" LastEditorUserId="25" LastEditDate="2014-11-10T23:57:16.243" LastActivityDate="2014-11-10T23:57:16.243" Title="How can I bookmark Info page to continue reading later?" Tags="|info|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3019" PostTypeId="2" ParentId="3018" CreationDate="2014-11-03T02:11:08.863" Score="11" Body="&lt;p&gt;Some bookmarking commands to get you started:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-x r m&lt;/code&gt; – set a bookmark at the current location (e.g. in a file)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-x r b&lt;/code&gt; – jump to a bookmark&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-x r l&lt;/code&gt; – list your bookmarks&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x bookmark-delete&lt;/code&gt; – delete a bookmark by name&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://www.emacswiki.org/emacs/BookMarks&quot;&gt;emacswiki&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-11-03T02:11:08.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3020" PostTypeId="2" ParentId="2998" CreationDate="2014-11-03T03:01:51.133" Score="6" Body="&lt;p&gt;Regarding 2, the problem is simple: your major-mode function needs to set &lt;code&gt;comment-start&lt;/code&gt;.  This part has nothing to do with SMIE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding 3, I'm not sure exactly what it is you're doing (where is point? what does the buffer contain?  what command have you run?).  But I suggest to first concentrate on indentation of the non-comment parts of the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for 1 the issue is that you have rules like &lt;code&gt;(&quot;{&quot; binds &quot;}&quot;)&lt;/code&gt; and &lt;code&gt;(&quot;let&quot; &quot;{&quot; binds &quot;}&quot;)&lt;/code&gt; and &lt;code&gt;(&quot;{&quot; formals &quot;}&quot; &quot;:&quot; exprfunction)&lt;/code&gt;.  SMIE likes to distinguish tokens that only appear at the beginning or only at the end or rules (these are treated like open/close parens) from those that only appear within rules (so called &quot;neither&quot;).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is useful for example when parsing forward from a &lt;code&gt;{&lt;/code&gt;: once we find the matching &lt;code&gt;}&lt;/code&gt; should we just keep on parsing, looking for the &lt;code&gt;:&lt;/code&gt; that should follow  (assuming we've jump seen the beginning of an &lt;code&gt;exprfunction&lt;/code&gt;) or should we stop and say we've jumped over one AST node?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to solve these issues for your grammar, replace rules like &lt;code&gt;(&quot;let&quot; &quot;{&quot; binds &quot;}&quot;)&lt;/code&gt; by a rule like &lt;code&gt;(&quot;let&quot; brace-binds-brace)&lt;/code&gt; where &lt;code&gt;brace-binds-brace&lt;/code&gt; is defined with a single rule &lt;code&gt;(&quot;{&quot; binds &quot;}&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[ BTW, if at the end of this ordeal you could suggest improvements to the Texinfo docs, or even better provide a patch for it, that would be greatly appreciated.  ]&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-03T03:01:51.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3021" PostTypeId="1" AcceptedAnswerId="3028" CreationDate="2014-11-03T06:24:32.330" Score="7" ViewCount="224" Body="&lt;p&gt;What's the best way to detect keystrokes (e.g. via a hook) which don't edit the buffer? I mean things like arrow-keys for point motion, calls to &lt;code&gt;beginning-of-buffer&lt;/code&gt;, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for this is that I'm working on some &lt;code&gt;ycmd&lt;/code&gt; bindings for emacs, and I'd like to be able to detect (at least heuristically) when the user has stopped editing and is moving around the buffer. This is a good time for shipping the buffer contents off for parsing. The vim client does this when the user exits insertion mode, and I'm trying to emulate that behavior.&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="50" LastEditDate="2014-11-03T09:42:30.587" LastActivityDate="2014-11-05T05:40:11.217" Title="How to detect keystrokes which don't edit the buffer?" Tags="|key-bindings|" AnswerCount="2" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3022" PostTypeId="1" AcceptedAnswerId="3024" CreationDate="2014-11-03T09:02:45.353" Score="31" ViewCount="4762" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Using Elisp, how can I reset a variable to its default value without knowing what that value is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to figure out how to do this by bringing up the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html&quot;&gt;Customize interface&lt;/a&gt; for a variable I set to a non-default value in my init-file and pressing &lt;kbd&gt;C-h k&lt;/kbd&gt; followed by a click on the &quot;Revert...&quot; button. That brought up the documentation for &lt;a href=&quot;http://doc.endlessparentheses.com/Fun%2Fwidget-button-click.html&quot;&gt;&lt;code&gt;widget-button-click&lt;/code&gt;&lt;/a&gt;, which obviously didn't help much. (Similarly, &lt;kbd&gt;C-h k&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; with point on the button shows help for &lt;a href=&quot;http://doc.endlessparentheses.com/Fun%2FCustom-newline.html&quot;&gt;&lt;code&gt;Custom-newline&lt;/code&gt;&lt;/a&gt;, which is also not what I am looking for.)&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="50" LastEditDate="2015-04-20T20:25:47.703" LastActivityDate="2020-07-22T09:51:11.597" Title="Reset custom variable to default value programmatically" Tags="|elisp|variables|custom|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3023" PostTypeId="2" ParentId="2573" CreationDate="2014-11-03T09:43:51.667" Score="6" Body="&lt;p&gt;This doesn't seem to be a problem with Emacs but with bash.  &lt;code&gt;shell-command&lt;/code&gt; just executes &lt;code&gt;call-process&lt;/code&gt; on the shell and passes arguments.  I tried this on a regular shell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash -ic &quot;cd ~/code/foo &amp;amp;&amp;amp; echo $PATH&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/.bashrc&lt;/code&gt; is sourced, but the direnv hook is not run.  When &lt;code&gt;direnv hook bash&lt;/code&gt; is executed, a function &lt;code&gt;_direnv_hook&lt;/code&gt; is output and prepended to &lt;code&gt;PROMPT_COMMAND&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_direnv_hook() {&#xA;  eval &quot;$(direnv export bash)&quot;;&#xA;};&#xA;if ! [[ &quot;$PROMPT_COMMAND&quot; =~ _direnv_hook ]]; then&#xA;  PROMPT_COMMAND=&quot;_direnv_hook;$PROMPT_COMMAND&quot;;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suspect that &lt;code&gt;PROMPT_COMMAND&lt;/code&gt; simply won't work.  That's not a problem, though, because the &lt;code&gt;_direnv_hook&lt;/code&gt; is really simple.  We can simply prepend &lt;code&gt;eval $(direnv export bash)&lt;/code&gt; to the shell command and it will work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;~/code/foo/&quot;))&#xA;  (shell-command &quot;eval \&quot;$(direnv export bash)\&quot; &amp;amp;&amp;amp; echo $PATH&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will print the augmented path to the messages buffer.  Alternatively, execute with &lt;code&gt;M-!&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~/code/foo &amp;amp;&amp;amp; eval &quot;$(direnv export bash)&quot; &amp;amp;&amp;amp; echo $PATH&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't need to &lt;code&gt;(setq shell-command-switch &quot;-ic&quot;)&lt;/code&gt; for this to work.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-11-03T09:43:51.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3024" PostTypeId="2" ParentId="3022" CreationDate="2014-11-03T09:47:05.363" Score="28" Body="&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Variable Definitions&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Internally, &lt;code&gt;defcustom&lt;/code&gt; uses the symbol property &lt;code&gt;standard-value&lt;/code&gt; to record the expression for the standard value, &lt;code&gt;saved-value&lt;/code&gt; to record the value saved by the user with the customization buffer, and &lt;code&gt;customized-value&lt;/code&gt; to record the value set by the user with the customization buffer, but not saved. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Properties.html&quot;&gt;Symbol Properties&lt;/a&gt;. These properties are lists, the &lt;code&gt;car&lt;/code&gt; of which is an expression that evaluates to the value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo (eval (car (get 'foo 'standard-value))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this only applies to &lt;code&gt;defcustom&lt;/code&gt; variables (i.e. &quot;user options&quot;). Emacs does not save the initial value of a &lt;code&gt;defvar&lt;/code&gt; variable anywhere.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="504" LastEditDate="2014-11-04T08:01:28.530" LastActivityDate="2014-11-04T08:01:28.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3025" PostTypeId="1" AcceptedAnswerId="3033" CreationDate="2014-11-03T10:49:44.340" Score="4" ViewCount="555" Body="&lt;p&gt;I can generate plots using gnuplot source blocks with org-babel like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src gnuplot :file plot.png&#xA;  plot x   w l t &quot;$\epsilon$ = 1&quot;, \&#xA;       1-x w l t &quot;ε = 0.1&quot;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I then export to HTML using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-html-export-to-html)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/r3u0p.png&quot; alt=&quot;rendered plot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that I would like to put greek characters in the axis labels. As demonstrated in my example, either using a LaTeX formula or an UTF-8 character would be fine for my immediate use (although using LaTeX formulas would be more general and thus better in the long run).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything I can set-up so that &lt;code&gt;org-babel&lt;/code&gt; can export plot with nicely rendered greek characters?&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-11-04T10:59:10.687" Title="Greek characters in graphs produced by org-babel and gnuplot" Tags="|org-mode|org-babel|org-export|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3026" PostTypeId="5" CreationDate="2014-11-03T13:31:06.517" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://batsov.com/projectile/&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt; is a project management package and framework that facilitates operations against the project as a whole, such as &lt;code&gt;*-find-file&lt;/code&gt;, &lt;code&gt;*-multi-occur&lt;/code&gt;, &lt;code&gt;*-test-project&lt;/code&gt;, and an alternate implementation of &lt;code&gt;ff-find-other-file&lt;/code&gt;.  It also has integrations with Helm via &lt;code&gt;helm-projectile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="934" LastEditDate="2016-02-06T18:05:19.200" LastActivityDate="2016-02-06T18:05:19.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3027" PostTypeId="4" CreationDate="2014-11-03T13:31:06.517" Score="0" Body="Projectile is a project management package and framework that facilitates operations against the project as a whole." OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-03T18:51:39.247" LastActivityDate="2014-11-03T18:51:39.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3028" PostTypeId="2" ParentId="3021" CreationDate="2014-11-03T13:48:20.967" Score="2" Body="&lt;p&gt;Add the following hooks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To &lt;code&gt;pre-command-hook&lt;/code&gt;, set some sentinel variable to &lt;code&gt;t&lt;/code&gt; – this signals the command was non-changing.&lt;/li&gt;&#xA;&lt;li&gt;To &lt;code&gt;after-change-functions&lt;/code&gt;, set this sentinel value to &lt;code&gt;nil&lt;/code&gt;.  (It is a hook, it just doesn't sound like one; thanks to @phils for pointing this out.)&lt;/li&gt;&#xA;&lt;li&gt;To &lt;code&gt;post-command-hook&lt;/code&gt;, check this sentinel value and run your function.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This may or may not work depending on the order of execution.  If it doesn't, let me know in the comments below.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When I get off work, I will post an example.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-03T21:26:47.250" LastActivityDate="2014-11-03T21:26:47.250" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3029" PostTypeId="2" ParentId="2983" CreationDate="2014-11-03T15:02:42.117" Score="5" Body="&lt;p&gt;For the reasons you provided, I generally prefer to hold on to the buffer.&#xA;Then I write a &lt;code&gt;foo-proc&lt;/code&gt; function which returns the corresponding process, potentially re-starting it if needed.  And I even sometimes then write a &lt;code&gt;foo-buffer&lt;/code&gt; function which calls &lt;code&gt;foo-proc&lt;/code&gt; so that not only it gives me the buffer but it also ensures that the process is running.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-03T15:02:42.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3030" PostTypeId="1" AcceptedAnswerId="3379" CreationDate="2014-11-03T16:33:31.337" Score="9" ViewCount="945" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I temporarily show text in a window at screen locations with no text to propertize/overlay?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm familiar with the basic idea behind &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;text properties&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlays.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;overlays&lt;/a&gt; (see also &lt;a href=&quot;https://emacs.stackexchange.com/questions/2200/what-are-overlays-for-and-how-do-they-differ-from-text-properties&quot;&gt;this thread&lt;/a&gt;), have used them a few times, but am by no means adept with them.  My limited understanding is that there needs to be text to propertize or overlay, but I'm wondering how to use sections of a window that do not have any text in them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a screenshot for an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/a7sKY.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could one put text (temporarily) in one of the red boxes in the screenshot, that is, the blank space to the right of the text, or below the last line in the buffer?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-21T04:01:43.923" Title="Temporary text in window location with no text to propertize/overlay?" Tags="|elisp|text-properties|overlays|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3031" PostTypeId="2" ParentId="2717" CreationDate="2014-11-03T17:00:58.553" Score="3" Body="&lt;p&gt;It's surprising that there is no way to configure this.  You can choose whether the Author: header should appear, but Summary: is jammed in by default no matter what.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had to redefine a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;log-edit&quot;)&#xA;(defun log-edit-insert-message-template ()&#xA;  &quot;Insert the default template.&quot;&#xA;  (interactive)&#xA;  (when (or (called-interactively-p 'interactive)&#xA;            (log-edit-empty-buffer-p))&#xA;    (when log-edit-setup-add-author&#xA;      (insert &quot;\nAuthor: &quot;))&#xA;    (message-position-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Compared with the vanilla version in log-edit.el, I deleted the lines adding &quot;Summary:&quot; and &quot;\n\n&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Loading &lt;code&gt;log-edit&lt;/code&gt; first is needed (if you put the above code in your &lt;code&gt;.emacs&lt;/code&gt;) because otherwise the new definition would be overwritten when that library is loaded the first time you do a commit operation.&lt;/p&gt;&#xA;" OwnerUserId="2390" LastEditorUserId="2390" LastEditDate="2014-11-04T10:20:23.690" LastActivityDate="2014-11-04T10:20:23.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3032" PostTypeId="1" CreationDate="2014-11-03T19:09:39.673" Score="1" ViewCount="244" Body="&lt;p&gt;I want to change a couple of key bindings for &lt;a href=&quot;https://emacs.stackexchange.com/users/10/wasamasa&quot;&gt;@wasamasa&lt;/a&gt;'s &lt;a href=&quot;https://github.com/wasamasa/eyebrowse&quot; rel=&quot;nofollow noreferrer&quot;&gt;eyebrowse&lt;/a&gt; package, because I'm on a laptop and the keys &lt;kbd&gt;&amp;lt;&lt;/kbd&gt; and &lt;kbd&gt;&gt;&lt;/kbd&gt; aren't easy to access.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, this package defines a custom prefix for all bindings (&lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-w&lt;/kbd&gt;). This confuses me because I don't know if a normal&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key eyebrowse-mode-keymap (kbd &quot;z&quot;) 'eyebrowse-prev-window-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will do the job.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-11-03T21:14:36.123" Title="How do I change a key binding which also has its own prefix key?" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3033" PostTypeId="2" ParentId="3025" CreationDate="2014-11-03T19:12:46.047" Score="4" Body="&lt;pre&gt;&lt;code&gt;#+begin_src gnuplot :file plot.png :term pngcairo&#xA;  plot x   w l t &quot;$\epsilon$ = 1&quot;, \&#xA;       1-x w l t &quot;ε = 0.1&quot;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;seems to work with labels set using Unicode characters, although this feature is not documented. I discovered it by reading &lt;code&gt;ob-gnuplot.el&lt;/code&gt; and using the elisp debugger.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/15Xg5.png&quot; alt=&quot;Plot using labels with Unicode characters&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-03T19:12:46.047" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3034" PostTypeId="2" ParentId="3032" CreationDate="2014-11-03T19:15:53.217" Score="1" Body="&lt;p&gt;If I understand the question correctly, you should be able to change bindings in the &lt;code&gt;eyebrowse-mode-map&lt;/code&gt; (note, not &lt;code&gt;...-keymap&lt;/code&gt;) and access them with the default &lt;code&gt;C-c C-w&lt;/code&gt; prefix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key eyebrowse-mode-map &quot;z&quot; 'eyebrowse-prev-window-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;code&gt;C-c C-w z&lt;/code&gt; and &lt;code&gt;C-c C-w &amp;lt;&lt;/code&gt; (the original default) should both call &lt;code&gt;eyebrowse-prev-window-config&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;  I'm a bit surprised that the above code didn't work (just tested it myself), but the following does.  Note that you could also do &lt;code&gt;(kbd &quot;C-c C-w z&quot;)&lt;/code&gt;, but the advantage of the &lt;code&gt;concat&lt;/code&gt; version is that it will reflect whatever you customized choice of prefix keys is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key eyebrowse-mode-map&#xA;  (kbd (concat eyebrowse-keymap-prefix &quot;z&quot;)) 'eyebrowse-prev-window-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-03T19:54:46.380" LastActivityDate="2014-11-03T19:54:46.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3035" PostTypeId="1" AcceptedAnswerId="3036" CreationDate="2014-11-03T19:34:06.767" Score="10" ViewCount="1821" Body="&lt;p&gt;I want to know if emacs is running as a daemon, so I can load some parts of my configuration according, I want to know this from within emacs.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="690" LastEditDate="2014-11-03T19:54:21.007" LastActivityDate="2014-11-03T19:54:21.007" Title="How to know if emacs is running as a daemon?" Tags="|daemon|server|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3036" PostTypeId="2" ParentId="3035" CreationDate="2014-11-03T19:34:06.767" Score="11" Body="&lt;p&gt;Simply use &lt;code&gt;(daemonp)&lt;/code&gt; which will return &lt;code&gt;t&lt;/code&gt; if emacs is running as a daemon.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-11-03T19:34:06.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3037" PostTypeId="2" ParentId="2573" CreationDate="2014-11-03T19:40:54.717" Score="6" Body="&lt;p&gt;Running &lt;code&gt;eval &quot;$(direnv hook $0)&quot;&lt;/code&gt; defines a function that hooks into &lt;code&gt;$PROMPT_COMMAND&lt;/code&gt;, which is never called when bash is run as &lt;code&gt;bash -ic&lt;/code&gt; because there is no prompt. You can change the line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;eval &quot;$(direnv hook $0)&quot;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;eval &quot;$(direnv hook $0)&quot; &amp;amp;&amp;amp; _direnv_hook&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to explicitly call the hook function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Just realized rekado gave a very similar answer.&lt;/p&gt;&#xA;" OwnerUserId="838" LastEditorUserId="838" LastEditDate="2014-11-03T19:56:21.290" LastActivityDate="2014-11-03T19:56:21.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3038" PostTypeId="1" AcceptedAnswerId="3044" CreationDate="2014-11-03T19:52:06.467" Score="22" ViewCount="6632" Body="&lt;p&gt;Is it possible to set different fonts following the major mode? Say &lt;code&gt;Inconsolata-12&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; buffers and &lt;code&gt;Symbola-12&lt;/code&gt; in all remaining modes. &#xA;Or at least, is it possible to do a&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-font &quot;Inconsolata&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after switching to &lt;code&gt;org-mode&lt;/code&gt; buffers?&lt;/p&gt;&#xA;" OwnerUserId="546" LastEditorUserId="504" LastEditDate="2014-11-03T21:20:59.687" LastActivityDate="2014-11-03T21:20:59.687" Title="Using a different font for each major mode" Tags="|major-mode|fonts|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3041" PostTypeId="1" AcceptedAnswerId="3047" CreationDate="2014-11-03T20:03:27.537" Score="2" ViewCount="246" Body="&lt;p&gt;I have several lists with regexp matching categories of file extensions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* (&#xA;    (txt-regexp '(&quot;txt&quot; &quot;md&quot; &quot;log&quot; &quot;org&quot; &quot;conf&quot; &quot;rtf&quot;))&#xA;    (el-regexp '(&quot;el&quot; &quot;lisp&quot;))&#xA;    (tex-regexp '(&quot;tex&quot;))&#xA;    (pdf-regexp '(&quot;pdf&quot;))&#xA;    (image-regexp '(&quot;tif&quot; &quot;bmp&quot; &quot;jpg&quot; &quot;png&quot; &quot;gif&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to match only extensions with word boundaries -- e.g., &lt;code&gt;\\btxt\\b&lt;/code&gt; for file extensions ending in &lt;code&gt;txt&lt;/code&gt;.  However, I would like to avoid writing every file extension with &lt;code&gt;\\b&lt;/code&gt;&lt;em&gt;name-of-extension&lt;/em&gt;&lt;code&gt;\\b&lt;/code&gt;.  An example of how to convert each category of lists into extensions with word boundaries would be great:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(txt-regexp '(&quot;txt&quot; &quot;md&quot; &quot;log&quot; &quot;org&quot; &quot;conf&quot; &quot;rtf&quot;))&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;would be converted into&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(txt-regexp-modified '(&quot;\\btxt\\b&quot; &quot;\\bmd\\b&quot; &quot;\\blog\\b&quot; &quot;\\borg\\b&quot; &quot;\\bconf\\b&quot; &quot;\\brtf\\b&quot;))&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-11-03T20:50:56.060" Title="Convert regexp list so that each member has word boundaries" Tags="|regular-expressions|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3042" PostTypeId="2" ParentId="3038" CreationDate="2014-11-03T20:09:42.567" Score="4" Body="&lt;p&gt;You can do the change by using the &lt;code&gt;org-mode-hook&lt;/code&gt;, like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda () (set-frame-font &quot;Inconsolata&quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will change the font whenever you enter org mode. The downside is that it doesn't change the font back after you leave org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: as pointed out by &lt;a href=&quot;https://emacs.stackexchange.com/users/35/ryan&quot;&gt;Ryan&lt;/a&gt;, you can follow the advice on &lt;a href=&quot;http://www.emacswiki.org/emacs/FacesPerBuffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;this wiki page&lt;/a&gt; to do it per buffer. I haven't tested extensively, but this seems to work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda ()&#xA;                            (setq buffer-face-mode-face '(:family &quot;Inconsolata&quot;))&#xA;                            (buffer-face-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It might have issues if you want to use &lt;code&gt;buffer-face-mode&lt;/code&gt; in other buffers, but if you only use it for this then it should work.&lt;/p&gt;&#xA;" OwnerUserId="2088" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-11-03T20:17:49.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3043" PostTypeId="1" CreationDate="2014-11-03T20:17:26.980" Score="5" ViewCount="621" Body="&lt;p&gt;How can I get org-babel to properly render ' and not ’ when exporting to LaTeX and to Beamer?&#xA;I didn't find any good solution yet, and I would like the code to be copy-pasteable.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="115" LastEditDate="2014-11-04T17:49:20.030" LastActivityDate="2014-11-04T17:49:20.030" Title="apostrophe in org-babel export to latex and beamer" Tags="|org-mode|latex|org-babel|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3044" PostTypeId="2" ParentId="3038" CreationDate="2014-11-03T20:19:32.147" Score="26" Body="&lt;p&gt;&lt;code&gt;buffer-face-set&lt;/code&gt; and &lt;code&gt;buffer-face-mode&lt;/code&gt; in Emacs 23 or later is designed for exactly this. From the &lt;a href=&quot;http://www.emacswiki.org/emacs/FacesPerBuffer#toc3&quot;&gt;Emacs wiki&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Use variable width font faces in current buffer&#xA; (defun my-buffer-face-mode-variable ()&#xA;   &quot;Set font to a variable width (proportional) fonts in current buffer&quot;&#xA;   (interactive)&#xA;   (setq buffer-face-mode-face '(:family &quot;Symbola&quot; :height 100 :width semi-condensed))&#xA;   (buffer-face-mode))&#xA;&#xA; ;; Use monospaced font faces in current buffer&#xA; (defun my-buffer-face-mode-fixed ()&#xA;   &quot;Sets a fixed width (monospace) font in current buffer&quot;&#xA;   (interactive)&#xA;   (setq buffer-face-mode-face '(:family &quot;Inconsolata&quot; :height 100))&#xA;   (buffer-face-mode))&#xA;&#xA; ;; Set default font faces for Info and ERC modes&#xA; (add-hook 'erc-mode-hook 'my-buffer-face-mode-variable)&#xA; (add-hook 'Info-mode-hook 'my-buffer-face-mode-variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-11-03T20:19:32.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3045" PostTypeId="2" ParentId="2573" CreationDate="2014-11-03T20:20:02.750" Score="5" Body="&lt;p&gt;Thanks to Rekado and Erik for pointing out how the direnv hook works by using &lt;code&gt;$PROMPT_COMMAND&lt;/code&gt;. Since &lt;code&gt;shell-command&lt;/code&gt; doesn't use a prompt, this wasn't getting executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While Erik's answer works in my example of calling a shell command with &lt;code&gt;M-!&lt;/code&gt; with &lt;code&gt;default-directory&lt;/code&gt; set, it wouldn't work in the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;~/code/&quot;))&#xA;  (shell-command &quot;cd ~/code/foo &amp;amp;&amp;amp; echo $PATH&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After some googling, I &lt;a href=&quot;https://superuser.com/a/175802&quot;&gt;found a way to create a preexec hook&lt;/a&gt; in bash to execute something before a command is executed. I took this idea and modified to fit my need for direnv. Here's what the relevant part of my ~/.bashrc looks like now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eval &quot;$(direnv hook $0)&quot;&#xA;direnv_preexec () {&#xA;  [ -n &quot;$COMP_LINE&quot; ] &amp;amp;&amp;amp; return # don't execute on completion&#xA;  [ &quot;$BASH_COMMAND&quot; \&amp;lt; &quot;$PROMPT_COMMAND&quot; ] &amp;amp;&amp;amp; return # don't double execute on prompt hook&#xA;  eval &quot;$(direnv export bash)&quot;&#xA;}&#xA;trap &quot;direnv_preexec &amp;amp;&amp;amp; $BASH_COMMAND&quot; DEBUG&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="264" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2014-11-03T20:20:02.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3046" PostTypeId="2" ParentId="3041" CreationDate="2014-11-03T20:21:34.467" Score="4" Body="&lt;p&gt;Converting the strings to include boundaries is easy using standard Elisp functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-boundaryize (regexp)&#xA;  (concat &quot;\\b&quot; regexp &quot;\\b&quot;))&#xA;&#xA;(let ((txt-regexp-modified (mapcar #'my-boundaryize txt-regexp)))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're feeling fancy, you could use a macro to make this automatic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-convert-to-boundaryized (var-val) ;; Converts a single (var val) pair in the let clause&#xA;  (let ((var (car var-val))&#xA;        (val (cadr var-val)))&#xA;    (list (intern (concat (symbol-name var) &quot;-modified&quot;)) ;; changes the let variable by appending &quot;-modified&quot;&#xA;          `(mapcar #'my-boundaryize ,val)))) ;; maps my-boundaryize over the let value&#xA;&#xA;(defmacro let-boundaryized (vars-vals &amp;amp;rest body)&#xA;  (let ((let-clauses (mapcar #'my-convert-to-boundaryized vars-vals)))&#xA;    `(let ,let-clauses&#xA;       ,@body)))&#xA;&#xA;(let-boundaryized ((txt-regexp '(&quot;txt&quot; &quot;org&quot;))&#xA;                   (el-regexp '(&quot;el&quot; &quot;lisp&quot;)))&#xA;  txt-regexp-modified) ; =&amp;gt; '(&quot;\\btxt\\b&quot; &quot;\\borg\\b&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is almost certainly overkill for this particular problem (and not particularly good macro style since it introduces magical variable names); I'm including it as an example of how you might use macros to solve this general type of problem.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-11-03T20:48:41.460" LastActivityDate="2014-11-03T20:48:41.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3047" PostTypeId="2" ParentId="3041" CreationDate="2014-11-03T20:33:44.213" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;rx-to-string&lt;/code&gt; to build a regular expression form and convert it to a string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq txt-regexp-modified &#xA;    (mapcar (lambda (elt) &#xA;            (rx-to-string `(sequence word-boundary ,elt word-boundary) t))&#xA;         txt-regexp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case the regular expression you want is simple enough you could do this with string concat, but the &lt;code&gt;rx&lt;/code&gt; functions are handy when you are building more complicated expressions.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-03T20:39:20.063" LastActivityDate="2014-11-03T20:39:20.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3048" PostTypeId="1" AcceptedAnswerId="3131" CreationDate="2014-11-03T20:41:57.933" Score="5" ViewCount="386" Body="&lt;p&gt;If I write a command that calls &lt;code&gt;(interactive &quot;f&quot;)&lt;/code&gt;, Emacs will prompt the user to select a file when the command is run interactively. With Helm enabled, this selection is done through Helm with no additional effort -- this is great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I mark multiple files in the Helm selection window, it is not clear to me that this information is passed on to the command. Is there a way to get custom commands to cooperate with Helm and multiple selections?&lt;/p&gt;&#xA;" OwnerUserId="313" LastActivityDate="2014-11-05T05:21:15.310" Title="Helm and custom commands" Tags="|helm|interactive|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3049" PostTypeId="2" ParentId="3041" CreationDate="2014-11-03T20:50:56.060" Score="2" Body="&lt;p&gt;For a simple list, a &lt;code&gt;mapcar&lt;/code&gt; would return the modified list you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq txt-regexp '(&quot;txt&quot; &quot;md&quot; &quot;log&quot; &quot;org&quot; &quot;conf&quot; &quot;rtf&quot;))&#xA;(mapcar #'(lambda (x) (concat &quot;\\b&quot; x &quot;\\b&quot;)) txt-regexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure about the use-case without context in your &lt;code&gt;let*&lt;/code&gt; binding, but if, instead, you had a list of lists, you could wrap the &lt;code&gt;mapcar&lt;/code&gt; in a &lt;code&gt;dolist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((re '((txt-regexp   (&quot;txt&quot; &quot;md&quot; &quot;log&quot; &quot;org&quot; &quot;conf&quot; &quot;rtf&quot;))&#xA;            (el-regexp    (&quot;el&quot; &quot;lisp&quot;))&#xA;            (tex-regexp   (&quot;tex&quot;))&#xA;            (pdf-regexp   (&quot;pdf&quot;))&#xA;            (image-regexp (&quot;tif&quot; &quot;bmp&quot; &quot;jpg&quot; &quot;png&quot; &quot;gif&quot;)))))&#xA;  (let (bounded)&#xA;    (cl-dolist (i re (nreverse bounded))&#xA;      (push (mapcar #'(lambda (x) (concat &quot;\\b&quot; x &quot;\\b&quot;)) (cadr i)) bounded))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-03T20:50:56.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3050" PostTypeId="2" ParentId="3043" CreationDate="2014-11-03T21:06:07.420" Score="3" Body="&lt;p&gt;Smart quotes render &lt;code&gt;'text'&lt;/code&gt; as &lt;code&gt;`text'&lt;/code&gt; in LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That can be done in following ways.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Enable smart quotes for all exports&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Put this in your &lt;code&gt;init.el&lt;/code&gt; after loading org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-export-with-smart-quotes t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Enable smart quotes on export only a particular org file&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Put this in the beginning of the org file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: ':t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/org-export-with-smart-quotes&quot; rel=&quot;nofollow&quot;&gt;org-export-with-smart-quotes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/org-export-smart-quotes-alist&quot; rel=&quot;nofollow&quot;&gt;org-export-smart-quotes-alist&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/org-export-smart-quotes-regexps&quot; rel=&quot;nofollow&quot;&gt;org-export-smart-quotes-regexps&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-11-04T17:40:28.893" LastActivityDate="2014-11-04T17:40:28.893" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3051" PostTypeId="1" AcceptedAnswerId="3052" CreationDate="2014-11-03T21:15:11.030" Score="20" ViewCount="3019" Body="&lt;p&gt;Emacs 24.4 came with native eww browser.&#xA;What is the proper way to use eww as a renderer for mu4e messages?&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2014-11-03T23:23:56.713" Title="How can I use eww as a renderer for mu4e?" Tags="|mu4e|eww|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3052" PostTypeId="2" ParentId="3051" CreationDate="2014-11-03T21:56:49.603" Score="18" Body="&lt;p&gt;&lt;code&gt;eww&lt;/code&gt; is basically an interactive wrapper around the &lt;code&gt;shr&lt;/code&gt; package, which renders HTML as Emacs text (the actual HTML parsing is done by the &lt;code&gt;libxml&lt;/code&gt; package). You can use it in &lt;code&gt;mu4e&lt;/code&gt; by setting &lt;code&gt;mu4e-html2text-command&lt;/code&gt; to a simple custom function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-render-html-message ()&#xA;  (let ((dom (libxml-parse-html-region (point-min) (point-max))))&#xA;    (erase-buffer)&#xA;    (shr-insert-document dom)&#xA;    (goto-char (point-min))))&#xA;&#xA;(setq mu4e-html2text-command 'my-render-html-message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The git version of &lt;code&gt;mu4e&lt;/code&gt; includes this built-in as &lt;code&gt;mu4e-shr2text&lt;/code&gt;, and it can be set like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'mu4e-contrib) &#xA;(setq mu4e-html2text-command 'mu4e-shr2text) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2014-11-03T23:23:56.713" LastActivityDate="2014-11-03T23:23:56.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3053" PostTypeId="2" ParentId="1017" CreationDate="2014-11-03T22:31:55.967" Score="8" Body="&lt;p&gt;From the CL side the function you are looking for is &lt;code&gt;swank::eval-in-emacs&lt;/code&gt; to which you pass a the code you want to evaluate in emacs. You can see an example &lt;a href=&quot;https://github.com/PuercoPop/cl-datastructures/blob/master/src/binary-tree.lisp#L172&quot;&gt;here&lt;/a&gt;, to make emacs run the graphivz command and open the resulting png in a buffer. From the emacs side the function you are looking for is slime-eval (found in slime.el)&lt;/p&gt;&#xA;" OwnerUserId="2395" LastActivityDate="2014-11-03T22:31:55.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3055" PostTypeId="1" AcceptedAnswerId="3057" CreationDate="2014-11-03T23:03:00.513" Score="8" ViewCount="150" Body="&lt;p&gt;I use AUCTeX for type-setting mathematical texts. Often I have to type equations with sums, integrals etc. which all have the same sub- or superscripts. I'd like to autofill the current sub-/superscript with the value which it had before.&#xA;Example: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\sum_{i=1}^{\infty} a_i = \sum…&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;kbd&gt;_&lt;/kbd&gt; at the equation above Emacs should write &lt;code&gt;_{i=1}&lt;/code&gt;. Optional it would be good if the second superscript also is filled in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be realised?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="253" LastEditDate="2014-12-10T12:26:32.957" LastActivityDate="2014-12-10T12:26:32.957" Title="Auto-inserting last used sub-/superscript values in math formulae" Tags="|latex|auctex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3056" PostTypeId="1" AcceptedAnswerId="3473" CreationDate="2014-11-03T23:56:40.623" Score="2" ViewCount="583" Body="&lt;p&gt;Using Emacs 24.4 with &lt;code&gt;projectile&lt;/code&gt; and &lt;code&gt;helm&lt;/code&gt; I am trying to customize some faces of the grep results.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Helm face customization (M-x helm-colors)&#xA;(set-face-underline-p 'helm-selection nil)&#xA;(set-face-underline-p 'helm-grep-file t)&#xA;(set-face-background 'helm-match &quot;#002b36&quot;)&#xA;(set-face-foreground 'helm-match &quot;#CB4B16&quot;)&#xA;(set-face-background 'helm-grep-match &quot;#002b36&quot;)&#xA;(set-face-foreground 'helm-grep-match &quot;#CB4B16&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default with &lt;code&gt;solarized-theme&lt;/code&gt; files are underlined and candidates on cursor as well. What I'm trying to achieve with lines 1 and 2 is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Disable underlining on cursor&lt;/li&gt;&#xA;&lt;li&gt;Keep files underlined, even on cursor&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/krCge.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that &lt;code&gt;'helm-selection&lt;/code&gt; is computed everytime I move my cursor and update the styles, thus files won't be underlined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to provide something like &lt;code&gt;!important&lt;/code&gt; (CSS) to face attributes in Elisp ?&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2015-10-18T10:21:54.577" Title="Persistent effects on overwriting faces" Tags="|helm|faces|emacs24.4|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3057" PostTypeId="2" ParentId="3055" CreationDate="2014-11-03T23:59:44.183" Score="9" Body="&lt;p&gt;Add to your init file:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar mg-TeX-insert-subscript-history nil)&#xA;(defvar mg-TeX-insert-superscript-history nil)&#xA;&#xA;(defun TeX-insert-sub-or-superscript (arg)&#xA;  &quot;Insert typed key ARG times and possibly a pair of braces.&#xA;Brace insertion is only done if point is in a math construct and&#xA;`TeX-electric-sub-and-superscript' has a non-nil value.&quot;&#xA;  (interactive &quot;*p&quot;)&#xA;  (self-insert-command arg)&#xA;  (when (and TeX-electric-sub-and-superscript (texmathp))&#xA;    (let* ((history (cond&#xA;             ((equal last-input-event ?_)&#xA;              'mg-TeX-insert-subscript-history)&#xA;             ((equal last-input-event ?^)&#xA;              'mg-TeX-insert-superscript-history)))&#xA;       (content (read-string &quot;Content: &quot; (car (symbol-value history)) history)))&#xA;      (insert (concat TeX-grop content TeX-grcl))&#xA;      (if (zerop (length content))&#xA;      (backward-char)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make sure &lt;code&gt;TeX-electric-sub-and-superscript&lt;/code&gt; is set to non-nil.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2014-11-03T23:59:44.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3058" PostTypeId="5" CreationDate="2014-11-04T04:04:35.457" Score="0" Body="&lt;p&gt;Adapted from the Emacs manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs can display text in several different styles, called &quot;faces&quot;.&#xA;  Each face can specify various &quot;face attributes&quot;, such as the font,&#xA;  height, weight, slant, foreground and background color, and underlining&#xA;  or overlining.  Most major modes assign faces to the text&#xA;  automatically, via Font Lock mode. […]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To see what faces are currently defined, and what they look like,&#xA;  type &lt;code&gt;M-x list-faces-display&lt;/code&gt;.  With a prefix argument, this prompts&#xA;  for a regular expression, and displays only faces with names matching&#xA;  that regular expression […].&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It's possible for a given face to look different in different&#xA;  frames.  For instance, some text terminals do not support all face&#xA;  attributes, particularly font, height, and width, and some support a&#xA;  limited range of colors.  In addition, most Emacs faces are defined so&#xA;  that their attributes are different on light and dark frame&#xA;  backgrounds, for reasons of legibility.  By default, Emacs&#xA;  automatically chooses which set of face attributes to display on each&#xA;  frame, based on the frame's current background color.  However, you can&#xA;  override this by giving the variable &lt;code&gt;frame-background-mode&lt;/code&gt; a&#xA;  non-&lt;code&gt;nil&lt;/code&gt; value.  A value of &lt;code&gt;dark&lt;/code&gt; makes Emacs treat all frames as if&#xA;  they have a dark background, whereas a value of &lt;code&gt;light&lt;/code&gt; makes it treat&#xA;  all frames as if they have a light background.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize a face to alter its attributes, and save those&#xA;  customizations for future Emacs sessions.  […]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The &lt;code&gt;default&lt;/code&gt; face is the default for displaying text, and all of&#xA;  its attributes are specified.  Its background color is also used as the&#xA;  frame's background color.  […]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Another special face is the &lt;code&gt;cursor&lt;/code&gt; face.  On graphical displays,&#xA;  the background color of this face is used to draw the text cursor.&#xA;  None of the other attributes of this face have any effect; the&#xA;  foreground color for text under the cursor is taken from the background&#xA;  color of the underlying text.  On text terminals, the appearance of the&#xA;  text cursor is determined by the terminal, not by the &lt;code&gt;cursor&lt;/code&gt; face.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can also use X resources to specify attributes of any particular&#xA;  face.  […]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Emacs can display variable-width fonts, but some Emacs commands,&#xA;  particularly indentation commands, do not account for variable&#xA;  character display widths.  Therefore, we recommend not using&#xA;  variable-width fonts for most faces, particularly those assigned by&#xA;  Font Lock mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-04T10:59:50.583" LastActivityDate="2014-11-04T10:59:50.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3059" PostTypeId="4" CreationDate="2014-11-04T04:04:35.457" Score="0" Body="A 'face' in Emacs is the visual presentation of text using fonts and highlighting. A default face, for example, specifies both the font and the foreground and background colors." OwnerUserId="2264" LastEditorUserId="7045" LastEditDate="2017-02-12T19:35:35.437" LastActivityDate="2017-02-12T19:35:35.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3060" PostTypeId="1" AcceptedAnswerId="3085" CreationDate="2014-11-04T05:15:26.557" Score="4" ViewCount="892" Body="&lt;p&gt;I want to force Emacs to do (quasi-)dumb indentation à la Eclipse. By this I mean the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the point is at the beginning of a line and I press &lt;code&gt;tab&lt;/code&gt;, force shift the line 2 spaces to the right.&lt;/li&gt;&#xA;&lt;li&gt;If a region is selected and I press &lt;code&gt;tab&lt;/code&gt;, force shift each new line 2 spaces to the right.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At least in &lt;code&gt;LaTeX-mode&lt;/code&gt; (which is the one I mainly use), the current behavior is that pressing &lt;code&gt;tab&lt;/code&gt; does not shift at all my lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I could make Emacs obey my dumb indenting?&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2014-11-05T14:49:07.223" Title="Dumb indentation" Tags="|indentation|" AnswerCount="3" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3061" PostTypeId="1" AcceptedAnswerId="3080" CreationDate="2014-11-04T06:22:45.833" Score="5" ViewCount="1750" Body="&lt;p&gt;When I write a long line while composing a mail in &lt;code&gt;mu4e&lt;/code&gt;, the lines are truncated for viewing (&lt;code&gt;toggle-truncate-lines&lt;/code&gt;), but as soon as I hit Enter fixed line breaks (column width seems to be 70 or something) are introduced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I stop &lt;code&gt;mu4e&lt;/code&gt; from introducing these line breaks?&lt;/p&gt;&#xA;" OwnerUserId="2400" LastEditorUserId="504" LastEditDate="2014-11-04T10:58:53.667" LastActivityDate="2018-04-06T16:51:00.327" Title="How to stop mu4e from inserting line breaks?" Tags="|mu4e|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3062" PostTypeId="2" ParentId="2943" CreationDate="2014-11-04T07:09:43.647" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I input this command?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I believe you cannot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am convinced that this is a bug in &lt;code&gt;org-babel-execute:calc&lt;/code&gt;: see &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/ob-calc.el?id=fdd9b18598239dd0e8b18383ac930110d51ed22e#n67&quot; rel=&quot;nofollow&quot;&gt;ob-calc.el, line 67&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-babel-execute:calc&lt;/code&gt; expects every Calc &quot;stack operation&quot; to be a function taking a prefix argument which specifies the number of times it is applied. &lt;code&gt;calc-divide&lt;/code&gt;, for example, takes a prefix argument, so line 3 of the script in the question works fine. The &quot;&lt;code&gt;c%&lt;/code&gt;&quot; command corresponds to &lt;code&gt;calc-convert-percent&lt;/code&gt;, which takes no arguments, and this results in a  &quot;Wrong number of arguments&quot; error (it is called as &lt;code&gt;(calc-convert-percent nil)&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider submitting a bug report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update (November 6, 2014)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An answer stating that this is a bug is not complete unless it contains a bug fix. :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are &lt;em&gt;two&lt;/em&gt; problems here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;As stated above, &lt;code&gt;org-babel-execute:calc&lt;/code&gt; expects stack operations to take one argument.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some Calc operations (&lt;code&gt;c%&lt;/code&gt; is one of them) &lt;em&gt;do not&lt;/em&gt; change the value but change the way it is printed. So, even after fixing the bug evaluating the source code block given in the question produces &lt;code&gt;0.5&lt;/code&gt;, &lt;strong&gt;not&lt;/strong&gt; &lt;code&gt;50%&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I extended &lt;code&gt;org-babel-execute:calc&lt;/code&gt; (see code below) so that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# this is equivalent to using &quot;:results value&quot;&#xA;#+BEGIN_SRC calc&#xA;1&#xA;2&#xA;'/&#xA;'c%&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: 0.5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC calc :results output&#xA;1&#xA;2&#xA;'/&#xA;'c%&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: 50%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(The reasoning is that &lt;code&gt;c%&lt;/code&gt; changes the &lt;em&gt;output&lt;/em&gt; of Calc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-babel-execute:calc (body params)&#xA;  &quot;Execute a block of calc code with Babel.&quot;&#xA;  (unless (get-buffer &quot;*Calculator*&quot;)&#xA;    (save-window-excursion (calc) (calc-quit)))&#xA;  (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))&#xA;         (org--var-syms (mapcar #'car vars))&#xA;         (var-names (mapcar #'symbol-name org--var-syms)))&#xA;    (mapc&#xA;     (lambda (pair)&#xA;       (calc-push-list (list (cdr pair)))&#xA;       (calc-store-into (car pair)))&#xA;     vars)&#xA;    (mapc&#xA;     (lambda (line)&#xA;       (when (&amp;gt; (length line) 0)&#xA;         (cond&#xA;          ;; simple variable name&#xA;          ((member line var-names) (calc-recall (intern line)))&#xA;          ;; stack operation&#xA;          ((string= &quot;'&quot; (substring line 0 1))&#xA;           (let ((f (lookup-key calc-mode-map (substring line 1))))&#xA;             (condition-case nil&#xA;                 (funcall f nil)        ;; try calling with one arg&#xA;               (error (funcall f)))))   ;; if failed, call without args&#xA;          ;; complex expression&#xA;          (t&#xA;           (calc-push-list&#xA;            (list (let ((res (calc-eval line)))&#xA;                    (cond&#xA;                     ((numberp res) res)&#xA;                     ((math-read-number res) (math-read-number res))&#xA;                     ((listp res) (error &quot;Calc error \&quot;%s\&quot; on input \&quot;%s\&quot;&quot;&#xA;                                         (cadr res) line))&#xA;                     (t (replace-regexp-in-string&#xA;                         &quot;'&quot; &quot;&quot;&#xA;                         (calc-eval&#xA;                          (math-evaluate-expr&#xA;                           ;; resolve user variables, calc built in&#xA;                           ;; variables are handled automatically&#xA;                           ;; upstream by calc&#xA;                           (mapcar #'org-babel-calc-maybe-resolve-var&#xA;                                   ;; parse line into calc objects&#xA;                                   (car (math-read-exprs line)))))))))&#xA;                  ))))))&#xA;     (mapcar #'org-babel-trim&#xA;             (split-string (org-babel-expand-body:calc body params) &quot;[\n\r]&quot;))))&#xA;  (save-excursion&#xA;    (with-current-buffer (get-buffer &quot;*Calculator*&quot;)&#xA;      (if (equal (cdr (assoc :result-type params)) 'output)&#xA;          (math-format-value (calc-top 1)) ; return formatted value if asked for the output&#xA;        (calc-eval (calc-top 1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-06T20:21:34.270" LastActivityDate="2014-11-06T20:21:34.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3063" PostTypeId="1" AcceptedAnswerId="3064" CreationDate="2014-11-04T08:00:52.493" Score="13" ViewCount="2964" Body="&lt;p&gt;I use &lt;code&gt;ido-mode&lt;/code&gt;, but one thing I hate about it is that after &lt;code&gt;C-x C-f&lt;/code&gt; I cannot use &lt;code&gt;up/down&lt;/code&gt; keys to cycle through recently opened files, as it used to be for example with &lt;code&gt;iswitchb&lt;/code&gt;. How can I set &lt;code&gt;ido&lt;/code&gt; to work this way?&lt;/p&gt;&#xA;" OwnerUserId="871" LastEditorUserId="105" LastEditDate="2015-03-27T19:24:03.823" LastActivityDate="2020-07-08T13:14:44.343" Title="Recently opened files in ido-mode" Tags="|ido|find-file|cycling|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3064" PostTypeId="2" ParentId="3063" CreationDate="2014-11-04T08:59:30.740" Score="16" Body="&lt;p&gt;Looking at the customization options for &lt;code&gt;ido-mode&lt;/code&gt; (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-group&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;ido&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;), I don't see any options for enabling the cycling behavior you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can, however, add the following to your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'recentf)&#xA;&#xA;(defun ido-recentf-open ()&#xA;  &quot;Use `ido-completing-read' to find a recent file.&quot;&#xA;  (interactive)&#xA;  (if (find-file (ido-completing-read &quot;Find recent file: &quot; recentf-list))&#xA;      (message &quot;Opening file...&quot;)&#xA;    (message &quot;Aborting&quot;)))&#xA;&#xA;(global-set-key (kbd &quot;C-x C-r&quot;) 'ido-recentf-open)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place you can press &lt;kbd&gt;C-x C-r&lt;/kbd&gt; to get Ido completion for selecting recently opened files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, the 20 most recent files will be kept in the history. I suggest you crank that up to something like 150 by setting &lt;code&gt;recentf-max-saved-items&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq recentf-max-saved-items 150)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Bonus: Accessing recent files, on-steroids edition&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I don't see it mentioned in a lot of places, but &lt;strong&gt;Ido Virtual Buffers&lt;/strong&gt; make it &lt;em&gt;super easy&lt;/em&gt; to access recent files. Enable them like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ido-use-virtual-buffers t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The behavior you get is this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If non-&lt;code&gt;nil&lt;/code&gt;, refer to past (&quot;virtual&quot;) buffers as well as existing ones.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Essentially it works as follows: Say you are visiting a file and&#xA;  the buffer gets cleaned up by &lt;code&gt;midnight.el&lt;/code&gt;.  Later, you want to&#xA;  switch to that buffer, but find it's no longer open.  With virtual&#xA;  buffers enabled, the buffer name stays in the buffer list (using&#xA;  the &lt;code&gt;ido-virtual&lt;/code&gt; face, and always at the end), and if you select&#xA;  it, it opens the file back up again.  This allows you to think&#xA;  less about whether recently opened files are still open or not.&#xA;  Most of the time you can quit Emacs, restart, and then switch to&#xA;  a file buffer that was previously open as if it still were.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-23T07:22:19.563" LastActivityDate="2015-01-23T07:22:19.563" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3065" PostTypeId="1" AcceptedAnswerId="3066" CreationDate="2014-11-04T09:04:07.093" Score="4" ViewCount="742" Body="&lt;p&gt;When I do &lt;code&gt;C-x C-f&lt;/code&gt; &lt;code&gt;.emacs.d/i&lt;/code&gt; &lt;code&gt;TAB&lt;/code&gt; Emacs displays a new buffer which presents &quot;Possible completions&quot;, which are in my case &lt;code&gt;auto-save-list/&lt;/code&gt;, &lt;code&gt;history&lt;/code&gt; and &lt;code&gt;init.el&lt;/code&gt;. I would like to have it complete to just &lt;code&gt;.emacs.d/init.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following inside &lt;code&gt;init.el&lt;/code&gt; regarding &lt;code&gt;ido&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ido)&#xA;(ido-mode 1)&#xA;(setq ido-enable-flex-matching t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="871" LastEditorUserId="504" LastEditDate="2015-01-22T20:02:18.050" LastActivityDate="2015-01-22T20:02:50.400" Title="How do I use TAB instead of Enter for completion in ido-mode?" Tags="|ido|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3066" PostTypeId="2" ParentId="3065" CreationDate="2014-11-04T09:14:06.977" Score="4" Body="&lt;p&gt;You can control this by setting the variable &lt;code&gt;ido-enable-prefix&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ido-enable-prefix t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-&lt;code&gt;nil&lt;/code&gt; means only match if the entered text is a prefix of file name.&#xA;  This behavior is like the standard Emacs completion.&#xA;  If &lt;code&gt;nil&lt;/code&gt;, match if the entered text is an arbitrary substring.&#xA;  Value can be toggled within Ido using &lt;code&gt;ido-toggle-prefix&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The value of &lt;code&gt;ido-enable-flex-matching&lt;/code&gt; does not interfere with this setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if &lt;code&gt;.emacs.d/i&lt;/code&gt; is a prefix for more than one file, Emacs will still list possible completions.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-22T20:02:50.400" LastActivityDate="2015-01-22T20:02:50.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3067" PostTypeId="1" AcceptedAnswerId="3376" CreationDate="2014-11-04T10:39:10.207" Score="1" ViewCount="128" Body="&lt;p&gt;I'm using Aquamacs 2.x in MacOS X 10.6.&#xA;(I'm using the Command key as M and the Ctrl key as C.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;WHen I try to use keybindings containing &quot;@&quot;, it does not work, e. g. &lt;code&gt;C-c @ C-t&lt;/code&gt; in &lt;code&gt;outline-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can type the @ sign in Aquamacs buffers with Alt-L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try to hit&#xA;Ctrl-C, Alt-L, I get the message &quot;^C ⌘L is undefined&quot; even before I can add Ctrl-t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;it seems that I can use the Alt key and the Command key as well as META-Key, which is not necessary. I only want to use the Command key as META (to be &quot;compatible&quot; with WIndows and UNIX computers).&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="253" LastEditDate="2014-11-21T14:35:55.130" LastActivityDate="2014-11-21T14:35:55.130" Title="How to use keybindings containing @ in MacOS X?" Tags="|key-bindings|osx|aquamacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3068" PostTypeId="2" ParentId="3063" CreationDate="2014-11-04T10:40:49.970" Score="1" Body="&lt;p&gt;The answer given by @itsjeyd is pretty complete. Let me just suggest a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ido-choose-from-recentf ()&#xA;  &quot;Use ido to select a recently visited file from the `recentf-list'&quot;&#xA;  (interactive)&#xA;  (find-file (ido-completing-read &quot;Open file: &quot; recentf-list nil t)))&#xA;&#xA;;; bind it to &quot;C-c f&quot;&#xA;(global-set-key (kbd &quot;C-c f&quot;) 'ido-choose-from-recentf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://wikemacs.org/wiki/Recentf#Use_Ido_selection&quot; rel=&quot;nofollow&quot;&gt;WikEmacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-11-04T10:40:49.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3069" PostTypeId="2" ParentId="2996" CreationDate="2014-11-04T10:43:08.380" Score="4" Body="&lt;p&gt;You can enable automatic updating of the buffer list by adding to your ~/.emacs: &lt;code&gt;(add-hook 'Buffer-menu-mode-hook 'auto-revert-mode)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="478" LastActivityDate="2014-11-04T10:43:08.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3070" PostTypeId="1" AcceptedAnswerId="3073" CreationDate="2014-11-04T10:55:03.053" Score="5" ViewCount="1632" Body="&lt;p&gt;I have text like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;myvariable = ABCD,&#xA;EFGH,&#xA;IJKL,&#xA;~subsection1&#xA;MNOP,&#xA;QRST,&#xA;UVWX,&#xA;YZ&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which I want to transform to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;myvariable = &quot;ABCD,&quot;&#xA;&quot;EFGH,\n&quot; \&#xA;&quot;IJKL,\n&quot; \&#xA;&quot;~subsection1\n&quot; \&#xA;&quot;MNOP,\n&quot; \&#xA;&quot;QRST,\n&quot; \&#xA;&quot;UVWX,\n&quot; \&#xA;&quot;YZ&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To insert a &lt;code&gt;&quot;&lt;/code&gt; character at the beginning of each line I do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-M-%&lt;/kbd&gt; &lt;code&gt;^.*&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;&quot;\&amp;amp;&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But appending &lt;code&gt;\n&quot; \&lt;/code&gt; at the end of each line is trickier. I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;replace-regexp&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;$&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;\\n\\&quot; \\&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;myvariable = ABCD,\n\&quot; \&#xA;EFGH,\n&quot; \&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you have to do it this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;replace-regexp&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;$&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;\\n&quot; \\&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thinking was that the &lt;code&gt;&quot;&lt;/code&gt; character had to be escaped with &lt;code&gt;\&lt;/code&gt;, but that's obviously not the case. Why do I have to escape &lt;code&gt;\&lt;/code&gt; but not &lt;code&gt;&quot;&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2343" LastEditorUserId="50" LastEditDate="2014-11-04T13:16:55.627" LastActivityDate="2014-11-04T13:16:55.627" Title="Why are double quotes not escaped in the replace-regexp command?" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3071" PostTypeId="2" ParentId="3025" CreationDate="2014-11-04T10:59:10.687" Score="3" Body="&lt;p&gt;Playing a bit more with the code in &lt;code&gt;ob-gnuplot.el&lt;/code&gt;, I came up with the following advising function, which allows inserting custom preambles and postambles according to the output file extension: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *org-babel-gnuplot-preambles* nil&#xA;  &quot;Alist of file extensions and the associated gnuplot preambles.&#xA;Preambles will be added in front of the block body.&quot;)&#xA;&#xA;(defvar *org-babel-gnuplot-postambles* nil&#xA;  &quot;Alist of file extensions and the associated gnuplot postambles.&#xA;Postambles will be added at the very end of the generated gnuplot&#xA;script, after the `:epilogue'&quot;)&#xA;&#xA;(defun my/org-babel-expand-body:gnuplot (orig &amp;amp;rest args)&#xA;  (let* ((body     (nth 0 args))&#xA;         (params   (nth 1 args))&#xA;         (epilogue (cdr (assoc :epilogue params)))&#xA;         (out-file (cdr (assoc :file params)))&#xA;         (size     (or (cdr (assoc :size params)) &quot;640x480&quot;))&#xA;         (replace-vars (lambda (str)&#xA;                         (setq str (replace-regexp-in-string &quot;\\${output}&quot; (or out-file &quot;&quot;) str))&#xA;                         (setq str (replace-regexp-in-string &quot;\\${size}&quot;   (or size &quot;&quot;)     str))&#xA;                         str))&#xA;         (get-var-by-ext (lambda (alist)&#xA;                           (funcall replace-vars&#xA;                                    (or&#xA;                                     (when out-file&#xA;                                       (let ((ext (file-name-extension out-file)))&#xA;                                         (cdr (assoc (intern (downcase ext))&#xA;                                                     alist))))&#xA;                                     &quot;&quot;))))&#xA;         (preamble  (funcall get-var-by-ext *org-babel-gnuplot-preambles*))&#xA;         (postamble (funcall get-var-by-ext *org-babel-gnuplot-postambles*))&#xA;         (new-params (cons `(:epilogue . ,(concat epilogue &quot;\n&quot; postamble)) params))&#xA;         (new-body (concat preamble &quot;\n&quot; body)))&#xA;    (funcall orig new-body new-params)))&#xA;(advice-add 'org-babel-expand-body:gnuplot&#xA;            :around #'my/org-babel-expand-body:gnuplot)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By means of gnuplot's &lt;code&gt;!&lt;/code&gt; operator (which executes arbitrary shell commands), this allows to set up complex workflows for generating a given image type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with the following configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq *org-babel-gnuplot-preambles* '((png . &quot;&#xA;set terminal epslatex standalone color colortext 10&#xA;set output '/tmp/plot.tex'&quot;)))&#xA;&#xA;(setq *org-babel-gnuplot-postambles* '((png . &quot;&#xA;! latex  /tmp/plot.tex&#xA;! dvipdf /tmp/plot.dvi&#xA;! convert -density 600 -resize ${size} plot.pdf ${output}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it is possible to include full LaTeX formulas in an org-src block and still generate a PNG file for the HTML export:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src gnuplot :file plot.png :exports both :session none&#xA;  set title '$\displaystyle I = \int_0^x f_\varepsilon(x^\prime) \; dx^\prime$'&#xA;  set xlabel '$x$'&#xA;  set ylabel '$I$'&#xA;  plot x   w l t '$\varepsilon$ = 1', \&#xA;       1-x w l t '$\varepsilon$ = 0.1'&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jdnRn.png&quot; alt=&quot;Rendered plot using LaTeX formulas&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-11-04T10:59:10.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3072" PostTypeId="1" CreationDate="2014-11-04T11:03:15.560" Score="8" ViewCount="4289" Body="&lt;p&gt;I'd like to easily hide or show the text below individual headings in a large Latex document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought this should be possible with &lt;code&gt;outline-minor-mode&lt;/code&gt;, however I can not get it to work. I can activate the mode, but I don't see how to hide or show something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The AUCTeX documentation says that AUCTeX can &lt;a href=&quot;http://www.gnu.org/software/auctex/manual/auctex/Outline.html&quot;&gt;work together with &lt;code&gt;outline-minor-mode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also looked at the documentation on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Outline-Mode&quot;&gt;Outline Mode&lt;/a&gt;, but&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;motion commands do not have any effect (and seem to conflict with AUCTeX keybindings)&lt;/li&gt;&#xA;&lt;li&gt;same for folding commands&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When using AUCTeX folding commands like &lt;code&gt;C-c C-o C-b&lt;/code&gt; for folding the whole buffer, only some labels and small things are hidden, but not enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm familiar with using &lt;code&gt;org-mode&lt;/code&gt;, so it would be nice if I could use key bindings similar to &lt;code&gt;org-mode&lt;/code&gt;'s for expanding/collapsing sections or navigating between headings.&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="504" LastEditDate="2014-11-04T11:32:04.460" LastActivityDate="2014-11-04T12:26:04.630" Title="How to use AUCTeX and outline-minor-mode together for folding?" Tags="|auctex|outline-mode|" AnswerCount="1" CommentCount="3" ClosedDate="2014-11-04T16:28:20.463" ContentLicense="CC BY-SA 3.0" />
  <row Id="3073" PostTypeId="2" ParentId="3070" CreationDate="2014-11-04T11:39:51.267" Score="5" Body="&lt;p&gt;You can match the beginning of line with only &lt;code&gt;^&lt;/code&gt; and &quot;replace&quot; it with &lt;code&gt;&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the backslash:&#xA;Since the backslash is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Escape_character&quot;&gt;escape character&lt;/a&gt; in Emacs and you want to insert a literal backslash you have to escape the escape character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that you don't have to escape the double-quote here is because you are using a command (&lt;code&gt;replace-regexp&lt;/code&gt;).  If you would be writing the regular expression as part of an Emacs Lisp program it would be a string and &lt;em&gt;then&lt;/em&gt; you would need to escape the double-quote as well.&lt;/p&gt;&#xA;" OwnerUserId="330" LastActivityDate="2014-11-04T11:39:51.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3074" PostTypeId="1" AcceptedAnswerId="3644" CreationDate="2014-11-04T11:47:57.617" Score="11" ViewCount="2120" Body="&lt;p&gt;In my makefiles, I prefer the following indentation for continuation lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FILES:=                \&#xA;    file1.cpp          \&#xA;    file2.cpp          \&#xA;    fileYetAnother.cpp&#xA;&#xA;LIBS:=                 \&#xA;    libsth1.so         \&#xA;    libelsewhere.so&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;still, makefile mode indents it in the following way (when asked to reindent file or region):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FILES:=            \&#xA;file1.cpp          \&#xA;file2.cpp          \&#xA;fileYetAnother.cpp&#xA;&#xA;LIBS:=             \&#xA;libsth1.so         \&#xA;libelsewhere.so&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure it somehow to use the former variant (= indent continuation lines by 4 spaces or tab) ?&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="25" LastEditDate="2014-11-12T04:31:52.437" LastActivityDate="2019-06-09T08:09:56.460" Title="Customizing indentation in makefile mode?" Tags="|indentation|makefile-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3075" PostTypeId="2" ParentId="408" CreationDate="2014-11-04T12:02:04.540" Score="3" Body="&lt;p&gt;I have ~/emacs directory which is mercurial-version controlled and contains everything my emacs setup consists of (~/emacs/site-lisp for manually downloaded libraries, ~/emacs/elpa for elpa-installed libraries, ~/emacs/etc/ for splitted .emacs, ~/emacs/dot-emacs.el which I symlink as ~/.emacs). It required some tweaking of some packages to have all important files inside this tree, but it works well. Those few bits which are machine-specific I have implemented by conditionals on system name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after I install/reconfigure/change anything, I simply commit pull/push all the changes between all machines I use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extra benefit is that I have complete history of my config and can go back/bisect/revert in case anything goes wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS mercurial seems particularly suitable as it has natural two-side pull/push, but similar setup should not be hard to achieve with git or any other dvcs. &lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2014-11-04T12:02:04.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3076" PostTypeId="2" ParentId="3072" CreationDate="2014-11-04T12:26:04.630" Score="11" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html&quot;&gt;Outline mode&lt;/a&gt; and the AUCTeX &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Folding.html&quot;&gt;folding facilities&lt;/a&gt; are two different beasts that are meant to do broadly the same thing:  hide and show selected parts of the buffer.  Personally, I find the AUCTeX facilities to be rather jarring and rarely use them, but your mileage may vary.  I use the outlining functionality all the time, however.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html&quot;&gt;&lt;code&gt;outline-minor-mode&lt;/code&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A key element to recognize when using &lt;code&gt;outline-minor-mode&lt;/code&gt; is that it's got a different prefix key that &lt;code&gt;outline-mode&lt;/code&gt; (ie, the major mode) -- precisely to avoid the key conflicts with motion keys, etc.  That prefix defaults to the awkward-to-type &lt;code&gt;C-c @&lt;/code&gt; (although you can change that by customizing &lt;code&gt;outline-minor-mode-prefix&lt;/code&gt;).  All the keybindings listed on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Visibility.html#Outline-Visibility&quot;&gt;this node of the manual&lt;/a&gt; should still work, but with the twist that you replace the &lt;em&gt;major&lt;/em&gt; mode prefix of &lt;code&gt;C-c&lt;/code&gt; with the &lt;em&gt;minor&lt;/em&gt; mode prefix of &lt;code&gt;C-c @&lt;/code&gt;.  Hence, &lt;code&gt;C-c @ C-c&lt;/code&gt; runs &lt;code&gt;hide-entry&lt;/code&gt;, &lt;code&gt;C-c @ C-e&lt;/code&gt; runs &lt;code&gt;show-entry&lt;/code&gt;, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use these facilities, you need to enable &lt;code&gt;outline-minor-mode&lt;/code&gt;. The simplest way is with a mode hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'outline-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;adding new outline headings&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As an added bonus, you can also customize which outline headers can get folded, and to what levels.  I, for example, like to be able to make &quot;fake&quot; section headers to hide away text that doesn't have a true LaTeX header, but logically is kept at the same level of the document.  With the following code, you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%section{a fake section}&#xA;&#xA;Blah blah blah blah blah, LaTeX doesn't recognize me as a section...&#xA;&#xA;\section{a real section}&#xA;&#xA;Blah blah blah blah blah, LaTeX treats me as a real section&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you will be able to manipulate the fake section just like any other one, but LaTeX will ignore it when you compile the document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; extra outline headers &#xA;(setq TeX-outline-extra&#xA;      '((&quot;%chapter&quot; 1)&#xA;        (&quot;%section&quot; 2)&#xA;        (&quot;%subsection&quot; 3)&#xA;        (&quot;%subsubsection&quot; 4)&#xA;        (&quot;%paragraph&quot; 5)))&#xA;&#xA;;; add font locking to the headers&#xA;(font-lock-add-keywords&#xA; 'latex-mode&#xA; '((&quot;^%\\(chapter\\|\\(sub\\|subsub\\)?section\\|paragraph\\)&quot;&#xA;    0 'font-lock-keyword-face t)&#xA;   (&quot;^%chapter{\\(.*\\)}&quot;       1 'font-latex-sectioning-1-face t)&#xA;   (&quot;^%section{\\(.*\\)}&quot;       1 'font-latex-sectioning-2-face t)&#xA;   (&quot;^%subsection{\\(.*\\)}&quot;    1 'font-latex-sectioning-3-face t)&#xA;   (&quot;^%subsubsection{\\(.*\\)}&quot; 1 'font-latex-sectioning-4-face t)&#xA;   (&quot;^%paragraph{\\(.*\\)}&quot;     1 'font-latex-sectioning-5-face t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/OutlineMagic&quot;&gt;&lt;code&gt;outline-magic&lt;/code&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/OutlineMagic&quot;&gt;&lt;code&gt;outline-magic&lt;/code&gt;&lt;/a&gt; extends the outline modes to use &lt;code&gt;org-mode&lt;/code&gt;-like hiding/showing with the magic tab key.  In other words, you can probably add this in to your workflow and make your LaTeX documents behave more like &lt;code&gt;org&lt;/code&gt; documents.  (I don't use it myself, so can't comment on functionality.)&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Folding.html&quot;&gt;AUCTeX folding facilities&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;These were the facilities you were mentioning when you cited the bindings like &lt;code&gt;C-c C-o C-b&lt;/code&gt;.  Note that you need to enable them with &lt;code&gt;TeX-fold-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These facilities work differently from outline mode, and hide environments (eg, &lt;code&gt;\begin{itemize} ... \end{itemize}&lt;/code&gt; and what AUCTeX refers to as &quot;macros&quot;, such as &lt;code&gt;\footnote{...}&lt;/code&gt; rather than sections per se.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use both &lt;code&gt;outline-minor-mode&lt;/code&gt; and AUCTeX's folding facilities together in the same document: they do different things on different parts of it.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-04T12:26:04.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3077" PostTypeId="2" ParentId="2937" CreationDate="2014-11-04T12:37:34.610" Score="2" Body="&lt;p&gt;Upgrading from Emacs 24.3 to 24.4 corrected the issue.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-11-04T12:37:34.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3078" PostTypeId="2" ParentId="3055" CreationDate="2014-11-04T13:18:19.780" Score="3" Body="&lt;p&gt;Here is a version which non-interactively inserts the last sub/super-script occuring for the token at point: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/electric-sub-super-script (arg)&#xA;  &quot;Insert typed character ARG times and possibly a sub/super-script.&#xA;Sub/super-script insertion is done only in a (La)TeX math mode region.&#xA;The inserted sub/super-script is copied from the last occurence of a&#xA;sub/superscript for the token at point.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (self-insert-command arg)&#xA;  (when (texmathp)&#xA;    (insert&#xA;     (save-excursion&#xA;       (let ((current-token (let ((end (point)))&#xA;                              (backward-sexp 1)&#xA;                              (buffer-substring-no-properties (point) end))))&#xA;         (if (search-backward current-token nil t)&#xA;             (progn&#xA;               (search-forward current-token)&#xA;               (let ((begin (point)))&#xA;                 (forward-sexp 1)&#xA;                 (buffer-substring-no-properties begin (point))))&#xA;           &quot;&quot;))))))&#xA;&#xA;(define-key TeX-mode-map (kbd &quot;_&quot;) #'my/electric-sub-super-script)&#xA;(define-key TeX-mode-map (kbd &quot;^&quot;) #'my/electric-sub-super-script)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Taking the example in the question, below is the sequence of buffer states obtained by starting with the first line and typing &lt;kbd&gt;&amp;#95;&lt;/kbd&gt;&lt;kbd&gt;^&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt;&lt;kbd&gt;&amp;#95;&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\sum_{i=1}^{\infty} a_i = \sum▮&#xA;\sum_{i=1}^{\infty} a_i = \sum_{i=1}▮&#xA;\sum_{i=1}^{\infty} a_i = \sum_{i=1}^{\infty}▮&#xA;\sum_{i=1}^{\infty} a_i = \sum_{i=1}^{\infty} a▮&#xA;\sum_{i=1}^{\infty} a_i = \sum_{i=1}^{\infty} a_i▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-11-04T16:23:13.010" LastActivityDate="2014-11-04T16:23:13.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3079" PostTypeId="1" CreationDate="2014-11-04T13:25:42.537" Score="55" ViewCount="3901" Body="&lt;p&gt;Emacs 24.4 comes with a new advice system. The &lt;code&gt;NEWS&lt;/code&gt; file says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;** New package &lt;code&gt;nadvice.el&lt;/code&gt; offers lighter-weight advice facilities.&#xA;  It is layered as:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;*** &lt;code&gt;add-function&lt;/code&gt;/&lt;code&gt;remove-function&lt;/code&gt;, which can be used to add/remove code on&#xA;  any function-carrying place, such as process filters or &lt;code&gt;&amp;lt;foo&amp;gt;-function&lt;/code&gt; hooks.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;*** &lt;code&gt;advice-add&lt;/code&gt;/&lt;code&gt;advice-remove&lt;/code&gt; to add/remove a piece of advice on a named&#xA;  function, much like &lt;code&gt;defadvice&lt;/code&gt; does.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; What are the practical benefits and implications of this new package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am especially interested in answers addressing the following points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If I am only using advice to customize Emacs (as opposed to writing add-on packages), do I need to switch to the new system? Will it replace the old system at some point?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What &lt;em&gt;exactly&lt;/em&gt; can I do with the new system that I can't accomplish with &lt;code&gt;defadvice&lt;/code&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the significance of being able to &quot;add/remove code on any function-carrying place&quot;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="504" LastActivityDate="2018-11-24T06:37:08.450" Title="Practical benefits of new advice system in Emacs 24.4" Tags="|emacs24.4|advice|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3080" PostTypeId="2" ParentId="3061" CreationDate="2014-11-04T13:26:09.863" Score="5" Body="&lt;p&gt;You can turn off &lt;code&gt;auto-fill-mode&lt;/code&gt; in the &lt;code&gt;mu4e&lt;/code&gt; message buffer.  You can do so automatically by adding a function to the &lt;code&gt;mu4e-compose-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun no-auto-fill ()&#xA;  &quot;Turn off auto-fill-mode.&quot;&#xA;  (auto-fill-mode -1))&#xA;&#xA;(add-hook 'mu4e-compose-mode-hook #'no-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-04T13:26:09.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3081" PostTypeId="2" ParentId="3060" CreationDate="2014-11-04T13:33:11.710" Score="0" Body="&lt;p&gt;I just checked the behaviour for an example text.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;Hello&#xA;world&#xA;!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When marking the region and pressing tab, they were indented automatically according to the indentation rules, i.e. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;  Hello&#xA;  world&#xA;  !&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can you verify whether this happens for you? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to force a specific behaviour of &lt;code&gt;Tab&lt;/code&gt;, I came up with this solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom dumb-indent-string &quot;  &quot;&#xA;  &quot;What string should be used for indenting?&quot;&#xA;  :group 'dumb-indent&#xA;  :type 'string &#xA;  :safe #'booleanp) ;; &amp;lt;- Considered safe as a buffer local variable.&#xA;&#xA;(defun dumb-indent-line ()&#xA;  (interactive)&#xA;  (save-excursion &#xA;    (goto-char (line-beginning-position))&#xA;    (search-forward-regexp &quot;[[:blank:]]*&quot;) &#xA;    (insert dumb-indent-string)&#xA;    (setq deactivate-mark nil)))&#xA;&#xA;(defun dumb-indent-region (start end)&#xA;  (interactive (list (region-beginning) (region-end)))&#xA;  (save-excursion&#xA;    (goto-char start)&#xA;    (while (&amp;lt; (point) end)&#xA;      (dumb-indent-line)&#xA;      (forward-line))&#xA;    (setq deactivate-mark nil))) ;; Works only when calling function directly.&#xA;&#xA;(defun dumb-indent-activate ()&#xA;  &quot;A hook function for activating dumb indenting. Can also be used as &#xA;`M-x dumb-indent-activate'.&quot;&#xA;  (interactive)&#xA;  (setq-local indent-line-function #'dumb-indent-line)&#xA;  (setq-local indent-region-function #'dumb-indent-region))&#xA;&#xA;(add-hook 'latex-mode-hook #'dumb-indent-activate) ;; preinstalled latex-mode&#xA;(add-hook 'LaTeX-mode-hook #'dumb-indent-activate) ;; AucTeX LaTeX-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a little flaw though. Pressing tab will remove highlighting, because &lt;code&gt;indent-region&lt;/code&gt; explicitly calls &lt;code&gt;(deactivate-mark)&lt;/code&gt; without querying the &lt;code&gt;deactivate-mark&lt;/code&gt; variable. I could have written a function, that is bound to &lt;code&gt;TAB&lt;/code&gt; instead of &lt;code&gt;indent-for-tab-command&lt;/code&gt;, but I hope for someone having a better idea. &lt;/p&gt;&#xA;" OwnerUserId="2308" LastActivityDate="2014-11-04T13:33:11.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3082" PostTypeId="2" ParentId="3060" CreationDate="2014-11-04T14:50:33.320" Score="0" Body="&lt;p&gt;You're probably better off figuring out how to get the smart indentation facilities to work to your advantage, but if you really want to do dumb indentation, this no-frills function will do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dumb-indent ()&#xA;  &quot;Indent two spaces when at the beginning of a line, or to each&#xA;line of a region.&quot;&#xA;  (interactive)&#xA;  (let ((prefix &quot;  &quot;))&#xA;    (cond ((region-active-p)&#xA;           (string-insert-rectangle (region-beginning) (region-end) prefix))&#xA;          ((bolp)&#xA;           (insert prefix))&#xA;          (t&#xA;           (message &quot;Can't dumb-indent here!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd suggest that, rather than binding such a function to &lt;code&gt;tab&lt;/code&gt;, you consider something like &lt;code&gt;shift-tab&lt;/code&gt; or &lt;code&gt;C-tab&lt;/code&gt; so that you don't clobber bindings you might want to keep.  That way, you can still use dumb indentation if you really want it, but it doesn't get in the way when you don't.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-04T14:58:16.797" LastActivityDate="2014-11-04T14:58:16.797" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3083" PostTypeId="1" AcceptedAnswerId="3100" CreationDate="2014-11-04T15:44:49.920" Score="17" ViewCount="4011" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get &quot;proper&quot; indentation of LaTeX &lt;code&gt;itemize&lt;/code&gt; environments in &lt;code&gt;auctex&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's where I'd like to be with an &lt;code&gt;item&lt;/code&gt; in an &lt;code&gt;itemize&lt;/code&gt; environment:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;\item&lt;/code&gt; line is indented two spaces relative to the beginning of the environment&lt;/li&gt;&#xA;&lt;li&gt;continuation lines in the item are indented an additional two spaces relative to the &lt;code&gt;\item&lt;/code&gt; line&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is what I would like/expect to see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{itemize}&#xA;  \item Here's a really long item in a LaTeX itemize environment;&#xA;    note how the *initial* item line is indented two spaces, and the&#xA;    continuation lines are indented another two spaces.&#xA;\end{itemize}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One can adjust the initial indentation of the item with the &lt;code&gt;LaTeX-item-indent&lt;/code&gt; variable, which defaults to &lt;code&gt;-2&lt;/code&gt;.  With this default, I get the undesirable behavior of the &lt;code&gt;\item&lt;/code&gt; not being indented, but I &lt;em&gt;do&lt;/em&gt; get the desired behavior of the continuation lines being offset by an additional two spaces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{itemize}&#xA;\item Here's a really long item in a LaTeX itemize environment;&#xA;  note how the *initial* item line is *NOT* indented two spaces,&#xA;  but the continuation lines are indented two spaces.&#xA;\end{itemize}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;code&gt;LaTeX-item-indent&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; gets me the desired indentation on the &lt;code&gt;\item&lt;/code&gt; line (two spaces in), but does &lt;em&gt;not&lt;/em&gt; get me the second half of the desired behavior of the continuation lines being offset by an additional two spaces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{itemize}&#xA;  \item Here's a really long item in a LaTeX itemize environment;&#xA;  note how the *initial* item line is indented two spaces, but the&#xA;  continuation lines are *NOT* indented an additional two spaces.&#xA;\end{itemize}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So: how does one get &lt;em&gt;both&lt;/em&gt; desired behaviors:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;initial indent of the &lt;code&gt;\item&lt;/code&gt; line two spaces, and&lt;/li&gt;&#xA;&lt;li&gt;continuation lines an additional two spaces indented?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Note &lt;a href=&quot;https://stackoverflow.com/questions/2477195/latex-indentation-formatting-in-emacs&quot;&gt;Related SO thread&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-11-19T14:13:51.650" Title="How to indent items in LaTeX/AUCTeX itemize environments?" Tags="|indentation|latex|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3084" PostTypeId="2" ParentId="408" CreationDate="2014-11-04T15:48:21.910" Score="5" Body="&lt;p&gt;I use a little trick &quot;stolen&quot; from emacs-starter-kit (I think):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun maybe-install-and-require (p)&#xA;  (when (not (package-installed-p p))&#xA;   (package-install p))&#xA;  (require p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when I require a package, I simply use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(maybe-install-and-require 'magit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On emacs startups, evaluating my config, &lt;code&gt;package.el&lt;/code&gt; will provide to install magit if it's not installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find my configuration here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/mdallastella/emacs-config/&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mdallastella/emacs-config/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="223" LastEditorUserId="675" LastEditDate="2015-05-12T23:46:35.933" LastActivityDate="2015-05-12T23:46:35.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3085" PostTypeId="2" ParentId="3060" CreationDate="2014-11-04T16:16:53.630" Score="5" Body="&lt;p&gt;The &lt;code&gt;indent-rigidly&lt;/code&gt; command can be used to indent the region by some fixed amount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;C-x TAB&lt;/code&gt; is bound to &lt;code&gt;indent-rigidly&lt;/code&gt; and puts you in an interactive mode where you can indent the region left or right with additional keys. With a prefix argument you can directly indent by some number of columns. For example, to indent by 5:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; C-5 C-x TAB&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't need this flexibility, you could rebind the key to a function that always indents by the same amount. Here's an example that will indent the active region or the current line by 2 spaces. If there is no region and point is not at the beginning of the line, it does nothing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun simple-indent (start end)&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((size 2))&#xA;    (if (region-active-p)&#xA;        (indent-rigidly start end size)   &#xA;      (if  (bolp)&#xA;          (indent-rigidly (line-beginning-position) (line-end-position) size)))))&#xA;&#xA;(global-set-key (kbd &quot;C-x &amp;lt;tab&amp;gt;&quot;) #'simple-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-05T14:49:07.223" LastActivityDate="2014-11-05T14:49:07.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3087" PostTypeId="2" ParentId="3079" CreationDate="2014-11-04T16:34:34.523" Score="8" Body="&lt;p&gt;From the file header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Commentary:&#xA;&#xA;;; This package lets you add behavior (which we call &quot;piece of advice&quot;) to&#xA;;; existing functions, like the old `advice.el' package, but with much fewer&#xA;;; bells and whistles.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As I read it, the primary goal is to be simpler than the old advice system, not to have more capabilities. Reading the docs, it seems that &lt;code&gt;advice-add&lt;/code&gt; contains a subset of &lt;code&gt;defadvice&lt;/code&gt;'s functionality, while &lt;code&gt;add-function&lt;/code&gt; contains some nice functionality for advising non-traditional functions such as process filters (which was probably possible with &lt;code&gt;defadvice&lt;/code&gt;, but I'm not sure how).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, &lt;code&gt;defadvice&lt;/code&gt; is not officially deprecated so you should feel free to keep using it for now (and if you're a package author, you probably want to keep using it until 24.4 becomes more widely adopted). However, it sounds like the Emacs authors want to migrate completely to the new system eventually, so it probably makes sense to slowly switch over.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-11-04T16:34:34.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3088" PostTypeId="1" CreationDate="2014-11-04T16:41:15.263" Score="12" ViewCount="834" Body="&lt;p&gt;Emacs implements an interpreter for elisp in C which serves as the &lt;em&gt;de facto&lt;/em&gt; reference implementation. Are there any other implementations of elisp in other languages (particularly Javascript)?  What is a minimal set of primitives necessary to fully reimplement elisp?  What are the essential difficulties in doing so (e.g. dynamic scoping)?&lt;/p&gt;&#xA;" OwnerUserId="852" LastActivityDate="2022-01-07T05:25:06.470" Title="Elisp reimplementations" Tags="|elisp|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3089" PostTypeId="1" AcceptedAnswerId="3094" CreationDate="2014-11-04T16:59:18.697" Score="9" ViewCount="792" Body="&lt;p&gt;I have a mechanism for burning items to disc from a &lt;code&gt;dired&lt;/code&gt; buffer.  Unfortunately,  the file's I've patched are strewn accross the file system.  How can I create a &lt;code&gt;dired&lt;/code&gt; buffer from all open files?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="25" LastEditDate="2014-11-11T00:29:05.583" LastActivityDate="2014-11-11T00:29:05.583" Title="How can I create a dired buffer listing all open files?" Tags="|buffers|dired|files|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3090" PostTypeId="2" ParentId="408" CreationDate="2014-11-04T17:09:37.933" Score="2" Body="&lt;p&gt;In order to mirror my config I decided to go for a different approach, using &lt;a href=&quot;https://ind.ie/pulse/&quot; rel=&quot;nofollow&quot;&gt;Syncthing&lt;/a&gt;; every change in any of my config files propagates to&#xA;any other of my pcs without having to care about it, so when I upgrade packages I only have to do it in one of the pcs.&lt;/p&gt;&#xA;" OwnerUserId="546" LastEditorUserId="546" LastEditDate="2014-11-04T20:39:58.573" LastActivityDate="2014-11-04T20:39:58.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3091" PostTypeId="2" ParentId="3088" CreationDate="2014-11-04T17:28:18.427" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/GuileEmacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Guile Emacs&lt;/a&gt; is an Emacs implementation where the original Emacs Lisp interpreter was replaced by libguile recently. There are still interoperation issues (Guile and Emacs have different ideas about strings for instance), but existing Emacs Lisp code can already used (though with rather intimidating performance regressions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, there's &lt;a href=&quot;https://emacs.stackexchange.com/users/362/nic-ferrier&quot;&gt;nicferrier&lt;/a&gt;'s &lt;a href=&quot;https://github.com/nicferrier/emacs-ejit&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ejit&lt;/a&gt;. Its README does describe the difficulties involved, such as certain things only making context in Emacs and how a minimal set of primitives is chosen before compiling Emacs Lisp to Javascript. It is therefore not really a reimplementation, but might help answering your latter questions.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-11-04T21:27:30.217" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3092" PostTypeId="2" ParentId="3043" CreationDate="2014-11-04T17:36:05.990" Score="0" Body="&lt;p&gt;I misunderstood your question when writing my first answer. Here's a second try, tested out.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Solution&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You need to use a combination of &lt;code&gt;alltt&lt;/code&gt; and &lt;code&gt;upquote&lt;/code&gt; latex packages. Here is my solution based on the below referenced solutions from TeX SE and the use of org-mode &lt;a href=&quot;http://orgmode.org/manual/Macro-replacement.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Macro Replacement&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below MWE was tested on &lt;code&gt;emacs -Q&lt;/code&gt;, emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;#+LaTeX_HEADER: \usepackage{alltt}&#xA;#+LaTeX_HEADER: \usepackage{upquote}&#xA;&#xA;#+LaTeX_HEADER: \makeatletter&#xA;#+LaTeX_HEADER: \newcommand*{\textalltt}{}&#xA;#+LaTeX_HEADER: \DeclareRobustCommand*{\textalltt}{%&#xA;#+LaTeX_HEADER:   \begingroup&#xA;#+LaTeX_HEADER:     \let\do\@makeother&#xA;#+LaTeX_HEADER:     \dospecials&#xA;#+LaTeX_HEADER:     \catcode`\\=\z@&#xA;#+LaTeX_HEADER:     \catcode`\{=\@ne&#xA;#+LaTeX_HEADER:     \catcode`\}=\tw@&#xA;#+LaTeX_HEADER:     \verbatim@font\@noligs&#xA;#+LaTeX_HEADER:     \@vobeyspaces&#xA;#+LaTeX_HEADER:     \frenchspacing&#xA;#+LaTeX_HEADER:     \@textalltt&#xA;#+LaTeX_HEADER: }&#xA;#+LaTeX_HEADER: \newcommand*{\@textalltt}[1]{%&#xA;#+LaTeX_HEADER:     #1%&#xA;#+LaTeX_HEADER:   \endgroup&#xA;#+LaTeX_HEADER: }&#xA;#+LaTeX_HEADER: \makeatother&#xA;&#xA;#+MACRO: UPQUOTE @@latex:\textalltt{'}@@&#xA;&#xA;Without upquotes: 'How' about this?&#xA;&#xA;With upquotes: {{{UPQUOTE}}}How{{{UPQUOTE}}} about this?&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mKYGb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Requirements&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;alltt&lt;/code&gt; and &lt;code&gt;upquote&lt;/code&gt; LaTeX packages. &lt;em&gt;If you use TexLive, you can do &lt;code&gt;tlmgr install alltt&lt;/code&gt; and &lt;code&gt;tlmgr install upquote&lt;/code&gt;.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How to make a real apostrophe or single-quote in LaTeX - &lt;a href=&quot;https://tex.stackexchange.com/questions/63345/how-to-make-a-real-apostrophe-or-single-quote-in-latex&quot;&gt;TeX-SE&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;alltt package's \alltt{} makes a newline - &lt;a href=&quot;https://tex.stackexchange.com/questions/70652/alltt-packages-alltt-makes-a-newline&quot;&gt;TeX-SE&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2014-11-04T17:36:05.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3093" PostTypeId="1" AcceptedAnswerId="3110" CreationDate="2014-11-04T17:38:09.573" Score="11" ViewCount="3657" Body="&lt;p&gt;I'm currently working on a JavaScript project using Backbone.js and I wonder how can I navigate between files, based on method and object definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I keep references to some of my views in the global object &lt;code&gt;App.Views&lt;/code&gt;, and I would like to be able to navigate to each individual definition (&lt;code&gt;App.Views.Home&lt;/code&gt;, &lt;code&gt;App.Views.SomePage&lt;/code&gt;, etc.) if I encounter one. Also, there are a lot of closures used for avoiding namespace leaking, and I want to know how can I automatically follow these definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen &lt;a href=&quot;http://ternjs.net/&quot;&gt;&lt;code&gt;tern&lt;/code&gt;&lt;/a&gt; but there are not many examples on how to configure it so I have not been able to do much. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some good tools for this?&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="504" LastEditDate="2014-11-04T22:18:56.367" LastActivityDate="2014-11-05T02:03:38.067" Title="How to navigate a JavaScript project?" Tags="|init-file|javascript|tern|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3094" PostTypeId="2" ParentId="3089" CreationDate="2014-11-04T18:12:04.067" Score="12" Body="&lt;p&gt;The &lt;code&gt;dired&lt;/code&gt; command accepts a list of file-names as argument. Just create one and pass to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dired&#xA; (cons&#xA;  &quot;Open Files&quot;&#xA;  (sort (remove nil (mapcar #'buffer-file-name (buffer-list)))&#xA;       #'string&amp;lt;))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-04T19:32:23.920" LastActivityDate="2014-11-04T19:32:23.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3095" PostTypeId="1" CreationDate="2014-11-04T18:16:39.657" Score="3" ViewCount="314" Body="&lt;p&gt;For some reason I can't get Sauron to see my org-mode events.  I can see that the sauron-org module has started though.  Is there something else I need to enable/turn on to get Sauron to see org-mode events?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;(require 'sauron)&lt;/code&gt; in my init, and when I start sauron, it reports that the relevant sauron-org module is loaded, but I never get any sauron notifications of events from org.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected behaviour is that it would notify me 15 minutes, 10 minutes, 5 minutes, 2 minutes before events scheduled in org-mode.&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="891" LastEditDate="2014-11-16T18:42:28.647" LastActivityDate="2014-11-16T18:42:28.647" Title="How to get sauron-org to work for org-mode events?" Tags="|org-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3096" PostTypeId="2" ParentId="3089" CreationDate="2014-11-04T18:23:38.750" Score="1" Body="&lt;p&gt;Just provide a list of strings, to the dired function, example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dired '(&quot;custom dired&quot; &quot;.emacs.d/init.el&quot; &quot;mydotfiles/.bashrc&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Malabarba answer is the best way to go.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-11-04T18:36:31.033" LastActivityDate="2014-11-04T18:36:31.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3097" PostTypeId="2" ParentId="3056" CreationDate="2014-11-04T18:33:36.077" Score="3" Body="&lt;p&gt;The easiest way to do this is to just manually update the colors for what you need. I suggest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;a.&lt;/strong&gt; taking a look at all the helm faces: &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-group&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;helm&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There you can browse to the one you want to customize, and just do it. (Read the description to find what every one is about.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;b.&lt;/strong&gt; If you already know what you want to customize:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-face&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;helm-selection&lt;/code&gt; (or the name of the face you want to change).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These settings will be added to your &lt;code&gt;custom&lt;/code&gt; file. (You can change the location and name of this file by setting the &lt;code&gt;custom-file&lt;/code&gt; variable).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to customize the faces inside your &lt;code&gt;init&lt;/code&gt; file, use &lt;code&gt;set-face-attribute&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find out more about it with &lt;kbd&gt;C-h f&lt;/kbd&gt;&lt;code&gt;set-face-attribute&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. &#xA;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(set-face-attribute 'helm-selection nil :background &quot;#073642&quot; :underline nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will override your &lt;code&gt;helm-selection&lt;/code&gt; face for all frames and give it a  &lt;em&gt;#073642&lt;/em&gt; background and no &lt;em&gt;underline&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find what attributes you can customize, check &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html&quot; rel=&quot;nofollow&quot;&gt;the manual section&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this is tedious work, but once you get the hang of it you will be able to customize or create your theme in no time.&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2014-11-04T18:33:36.077" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3098" PostTypeId="1" CreationDate="2014-11-04T19:10:15.970" Score="6" ViewCount="3056" Body="&lt;p&gt;I'm a beginning emacs and org-mode user interested in the mode for personal project management. For example, I have a database of photo images:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;2014-10-steven-and-his-cats.jpg&lt;/li&gt;&#xA;&lt;li&gt;2014-10-steven-author-photo.jpg&lt;/li&gt;&#xA;&lt;li&gt;2014-11-james-with-his-giant-peach.tif&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Etc, for hundreds (not thousands) of pictures. I'd like to treat this as a database from which I could draw information for various (fairly simple, some longterm) projects. I'm wondering if people employ org-mode to organize data in this way using, for instance, org links, or if there's a better tool than org-mode. I have limited technical expertise, and am not a programmer.&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="45" LastEditDate="2014-11-04T19:46:05.717" LastActivityDate="2014-11-05T03:03:41.707" Title="Simple project management---org-mode, or another tool?" Tags="|org-mode|project|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3099" PostTypeId="2" ParentId="3079" CreationDate="2014-11-04T19:37:39.373" Score="9" Body="&lt;p&gt;One of the clear benefits of advice being normal functions is that you can visit a definition with &lt;code&gt;find-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At present, when viewing the help for a (new-style) advised function, it provides a link to the help for the advice function, and from there a link to the source (as usual for function help).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The old system provided the advice docstring inline, but there was no way to see the code (I usually resorted to &lt;code&gt;rgrep&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Personally I'd like to see a blend of the old and new approaches to displaying the help, as I liked having the inline docstring, but I'm sure that's possible down the track.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-04T19:45:05.467" LastActivityDate="2014-11-04T19:45:05.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3100" PostTypeId="2" ParentId="3083" CreationDate="2014-11-04T20:02:41.160" Score="15" Body="&lt;p&gt;@sykora's comment about &lt;code&gt;(setq LaTeX-item-indent -2 LaTeX-indent-level 4)&lt;/code&gt; is almost there, but it does mean we spill over to every other environment as well.  So, for example, we would also have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{abstract}&#xA;    This indents to the 4th column, which is way too far!&#xA;\end{abstract}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following function builds off an old (and seemingly broken?) code snippet from &lt;a href=&quot;http://comments.gmane.org/gmane.emacs.auctex.general/5182&quot;&gt;Tassilo Horn&lt;/a&gt;.  It gets the indentation correct, including for nested environments.  It works for &lt;code&gt;itemize&lt;/code&gt;, &lt;code&gt;enumerate&lt;/code&gt;, and &lt;code&gt;description&lt;/code&gt; environments, to boot:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun LaTeX-indent-item ()&#xA;  &quot;Provide proper indentation for LaTeX \&quot;itemize\&quot;,\&quot;enumerate\&quot;, and&#xA;\&quot;description\&quot; environments.&#xA;&#xA;  \&quot;\\item\&quot; is indented `LaTeX-indent-level' spaces relative to&#xA;  the the beginning of the environment.&#xA;&#xA;  Continuation lines are indented either twice&#xA;  `LaTeX-indent-level', or `LaTeX-indent-level-item-continuation'&#xA;  if the latter is bound.&quot;&#xA;  (save-match-data&#xA;    (let* ((offset LaTeX-indent-level)&#xA;           (contin (or (and (boundp 'LaTeX-indent-level-item-continuation)&#xA;                            LaTeX-indent-level-item-continuation)&#xA;                       (* 2 LaTeX-indent-level)))&#xA;           (re-beg &quot;\\\\begin{&quot;)&#xA;           (re-end &quot;\\\\end{&quot;)&#xA;           (re-env &quot;\\(itemize\\|\\enumerate\\|description\\)&quot;)&#xA;           (indent (save-excursion&#xA;                     (when (looking-at (concat re-beg re-env &quot;}&quot;))&#xA;                       (end-of-line))&#xA;                     (LaTeX-find-matching-begin)&#xA;                     (current-column))))&#xA;      (cond ((looking-at (concat re-beg re-env &quot;}&quot;))&#xA;             (or (save-excursion&#xA;                   (beginning-of-line)&#xA;                   (ignore-errors&#xA;                     (LaTeX-find-matching-begin)&#xA;                     (+ (current-column)&#xA;                        (if (looking-at (concat re-beg re-env &quot;}&quot;))&#xA;                            contin&#xA;                          offset))))&#xA;                 indent))&#xA;             ((looking-at (concat re-end re-env &quot;}&quot;))&#xA;              indent)&#xA;            ((looking-at &quot;\\\\item&quot;)&#xA;             (+ offset indent))&#xA;            (t&#xA;             (+ contin indent))))))&#xA;&#xA;(defcustom LaTeX-indent-level-item-continuation 4&#xA;  &quot;*Indentation of continuation lines for items in itemize-like&#xA;environments.&quot;&#xA;  :group 'LaTeX-indentation&#xA;  :type 'integer)&#xA;&#xA;(eval-after-load &quot;latex&quot;&#xA;  '(setq LaTeX-indent-environment-list&#xA;         (nconc '((&quot;itemize&quot; LaTeX-indent-item)&#xA;                  (&quot;enumerate&quot; LaTeX-indent-item)&#xA;                  (&quot;description&quot; LaTeX-indent-item))&#xA;                LaTeX-indent-environment-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't help but feel that there is a very simple setting I'm missing and this is the &lt;a href=&quot;http://www.rubegoldberg.com/&quot;&gt;Rube Goldberg&lt;/a&gt; version.  Still, it works, and it scratches an itch I've had for &lt;em&gt;years&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; in response to @sykora's comment, I have revised the function to take out the hard coding.  &lt;code&gt;\item&lt;/code&gt;s are now indented &lt;code&gt;LaTeX-indent-level&lt;/code&gt; spaces.  Continuation lines can take the value of a new variable, &lt;code&gt;LaTeX-indent-level-item-continuation&lt;/code&gt;, or, if you don't want to bind the latter, twice the value of &lt;code&gt;LaTeX-indent-level&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it happens, binding and setting &lt;code&gt;LaTeX-indent-level-item-continuation&lt;/code&gt; to 8 gives aesthetically-pleasing results.  I might even switch to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{itemize}&#xA;  \item Example with LaTeX-indent-level-item-continuation set to 8.&#xA;  \item Here's a really long item that will spill over onto the&#xA;        continuation line; text lines up pretty nicely this way!&#xA;        \begin{itemize} &#xA;          \item And here's a sub-item, with the environment&#xA;                indented to the relevant continuation line.&#xA;        \end{itemize}&#xA;\end{itemize}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-19T14:13:51.650" LastActivityDate="2014-11-19T14:13:51.650" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="3101" PostTypeId="7" CreationDate="2014-11-04T20:19:38.113" Score="0" Body="&lt;p&gt;&lt;b&gt;Emacs Stack Exchange&lt;/b&gt; is a question and answer site for those using, extending, or developing the Emacs text editor. It's built and run &lt;i&gt;by you&lt;/i&gt; as part of the &lt;a href=&quot;https://stackexchange.com&quot;&gt;Stack Exchange&lt;/a&gt; network of Q&amp;amp;A sites. With your help, we're working together to build a library of detailed answers to every question about Emacs.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="25" LastEditDate="2019-01-02T22:39:29.657" LastActivityDate="2019-01-02T22:39:29.657" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3102" PostTypeId="2" ParentId="3079" CreationDate="2014-11-04T20:40:50.173" Score="59" Body="&lt;p&gt;The new advice system has the following advantages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;add-function&lt;/code&gt;: This is brand new functionality that simply was not part of defadvice.  It is a kind of hybrid between &lt;code&gt;add-hook&lt;/code&gt; and &lt;code&gt;defadvice&lt;/code&gt;.  In the future, expect more &lt;code&gt;foo-function&lt;/code&gt; variables (modified via &lt;code&gt;add-function&lt;/code&gt;) and less &lt;code&gt;foo-functions&lt;/code&gt; (modified via &lt;code&gt;add-hook&lt;/code&gt;).  This functionality was the main motivation to implement the new advice system, triggered by a bug report asking how to &quot;share&quot; a process-filter between different packages.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Implementation simplicity: once &lt;code&gt;add-function&lt;/code&gt; was implemented, it takes only 8KB to implement the &lt;code&gt;advice-add&lt;/code&gt; functionality which brings pretty much all the functionality of the 100KB of advice.el.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Design simplicity: defadvice has various notions that are generally difficult to understand precisely and/or rarely used.  E.g. the difference between &quot;enabling&quot; and &quot;activating&quot; advices.  Or the meaning of &quot;pre&quot; and/or &quot;compiled&quot;.  There are also quirks in the handling of &lt;code&gt;ad-do-it&lt;/code&gt;, such as the fact that it looks like a variable-reference rather than a call, or the fact that you need to &lt;code&gt;(setq ad-return-value ...)&lt;/code&gt; explicitly rather than simply returning the value.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Defadvice suffers from various problems w.r.t macroexpansion and compilation: the body of an advice is not exposed as &quot;code&quot; (which the compiler and macroexpander see) but as &quot;data&quot; which is later on combined to make up an expression.  So macroexpansion happens late (which can causes surprises if you use things like &lt;code&gt;(eval-when-compile (require 'foo))&lt;/code&gt;) and lexical-scoping is hard to preserve correctly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As for whether you need to switch to the new system: I do intend to get rid of the old defadvice at some point in the future, but I think this future is relatively distant (and it'll first have to move to &lt;code&gt;lisp/obsolete&lt;/code&gt;, then later to GNU ELPA).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="304" LastEditDate="2016-05-09T10:54:32.643" LastActivityDate="2016-05-09T10:54:32.643" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3103" PostTypeId="2" ParentId="361" CreationDate="2014-11-04T21:03:30.540" Score="19" Body="&lt;p&gt;&lt;strong&gt;&lt;em&gt;NB:&lt;/strong&gt; much of this text came from an answer to a question that &lt;a href=&quot;https://emacs.stackexchange.com/questions/3072/how-to-use-auctex-and-outline-minor-mode-together-for-folding&quot;&gt;turned out to be a duplicate of this question&lt;/a&gt;.  Some of the material is sufficiently different that it seemed worthwhile to add it to this question.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;Outline mode&lt;/a&gt; and the AUCTeX &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Folding.html&quot; rel=&quot;noreferrer&quot;&gt;folding facilities&lt;/a&gt; are two different beasts that are meant to do broadly the same thing:  hide and show selected parts of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;outline-minor-mode&lt;/code&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A key element to recognize when using &lt;code&gt;outline-minor-mode&lt;/code&gt; is that it's got a different prefix key than &lt;code&gt;outline-mode&lt;/code&gt; (ie, the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;major mode&lt;/a&gt;) -- precisely to avoid key conflicts with motion keys, etc.  That prefix defaults to the awkward-to-type &lt;code&gt;C-c @&lt;/code&gt; (although you can change that by customizing &lt;code&gt;outline-minor-mode-prefix&lt;/code&gt;).  All the keybindings listed on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Visibility.html#Outline-Visibility&quot; rel=&quot;noreferrer&quot;&gt;this node of the manual&lt;/a&gt; should still work, but with the twist that you replace the &lt;em&gt;major&lt;/em&gt; mode prefix of &lt;code&gt;C-c&lt;/code&gt; with the &lt;em&gt;minor&lt;/em&gt; mode prefix of &lt;code&gt;C-c @&lt;/code&gt;.  Hence, &lt;code&gt;C-c @ C-c&lt;/code&gt; runs &lt;code&gt;hide-entry&lt;/code&gt;, &lt;code&gt;C-c @ C-e&lt;/code&gt; runs &lt;code&gt;show-entry&lt;/code&gt;, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use these facilities, you need to enable &lt;code&gt;outline-minor-mode&lt;/code&gt;. The simplest way is with a mode hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'outline-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;changing &lt;code&gt;outline-minor-mode-prefix&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It &lt;em&gt;should&lt;/em&gt; be a simple thing to change &lt;code&gt;outline-minor-mode-prefix&lt;/code&gt; (it &lt;a href=&quot;http://zhangda.wordpress.com/2009/08/09/outline-minor-mode-prefix-manually-changed-to-c-o-again/&quot; rel=&quot;noreferrer&quot;&gt;used to be&lt;/a&gt; back in the day).  But it's not.  What fun!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The docstring now gives a cryptic note that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Prefix key to use for Outline commands in Outline minor mode.&#xA;  The value of this variable is checked as part of loading Outline mode.&#xA;  After that, changing the prefix key requires manipulating keymaps.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, very helpful.  Oddly enough, even &lt;code&gt;customize&lt;/code&gt; doesn't set this variable in time to avoid &quot;manipulating keymaps&quot; (despite it being defined with &lt;code&gt;defcustom&lt;/code&gt; in the source code).  The practical work-around: set this variable in your init file &lt;em&gt;before&lt;/em&gt; you load &lt;code&gt;outline&lt;/code&gt; or anything else built off of it (eg,&lt;code&gt;org-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might, for example, want the prefix to be &lt;code&gt;C-o&lt;/code&gt; (which means you're losing &lt;code&gt;open-line&lt;/code&gt;, but you can rebind that if you really want it).  Putting the following early in your init file will do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key &quot;\C-o&quot;)&#xA;(setq outline-minor-mode-prefix &quot;\C-o&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, you should be able to access all of the outline mode functionality using the &lt;code&gt;C-o&lt;/code&gt; prefix -- &lt;code&gt;C-o C-c&lt;/code&gt; to call &lt;code&gt;hide-entry&lt;/code&gt;, &lt;code&gt;C-o C-e&lt;/code&gt; to call &lt;code&gt;show-entry&lt;/code&gt;, and so on.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;adding new outline headings&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As an added bonus, you can also customize which outline headers can get folded, and to what levels.  I, for example, like to be able to make &quot;fake&quot; section headers to hide away text that doesn't have a true LaTeX header, but logically is kept at the same level of the document.  With the following code, you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%section{a fake section}&#xA;&#xA;Blah blah blah blah blah, LaTeX doesn't recognize me as a section...&#xA;&#xA;\section{a real section}&#xA;&#xA;Blah blah blah blah blah, LaTeX treats me as a real section&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you will be able to manipulate the fake section just like any other one, but LaTeX will ignore it when you compile the document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; extra outline headers &#xA;(setq TeX-outline-extra&#xA;      '((&quot;%chapter&quot; 1)&#xA;        (&quot;%section&quot; 2)&#xA;        (&quot;%subsection&quot; 3)&#xA;        (&quot;%subsubsection&quot; 4)&#xA;        (&quot;%paragraph&quot; 5)))&#xA;&#xA;;; add font locking to the headers&#xA;(font-lock-add-keywords&#xA; 'latex-mode&#xA; '((&quot;^%\\(chapter\\|\\(sub\\|subsub\\)?section\\|paragraph\\)&quot;&#xA;    0 'font-lock-keyword-face t)&#xA;   (&quot;^%chapter{\\(.*\\)}&quot;       1 'font-latex-sectioning-1-face t)&#xA;   (&quot;^%section{\\(.*\\)}&quot;       1 'font-latex-sectioning-2-face t)&#xA;   (&quot;^%subsection{\\(.*\\)}&quot;    1 'font-latex-sectioning-3-face t)&#xA;   (&quot;^%subsubsection{\\(.*\\)}&quot; 1 'font-latex-sectioning-4-face t)&#xA;   (&quot;^%paragraph{\\(.*\\)}&quot;     1 'font-latex-sectioning-5-face t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/OutlineMagic&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;outline-magic&lt;/code&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/OutlineMagic&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;outline-magic&lt;/code&gt;&lt;/a&gt; extends the outline modes to use &lt;code&gt;org-mode&lt;/code&gt;-like hiding/showing with the magic tab key.  In other words, you can probably add this in to your workflow and make your LaTeX documents behave more like &lt;code&gt;org&lt;/code&gt; documents.  (I don't use it myself, so can't comment on functionality.)&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Folding.html&quot; rel=&quot;noreferrer&quot;&gt;AUCTeX folding facilities&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;AUCTeX's folding facilities work on &lt;em&gt;environments&lt;/em&gt; and what they (confusingly) call &lt;em&gt;macros&lt;/em&gt;, rather than sections.  To use this functionality, you'll need to enable it with &lt;code&gt;TeX-fold-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the &lt;code&gt;itemize&lt;/code&gt; &lt;em&gt;environment&lt;/em&gt;, unfolded, might look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{itemize}&#xA;  \item An item&#xA;  \item Another item&#xA;\end{itemize}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling &lt;code&gt;TeX-fold-env&lt;/code&gt; (default: &lt;code&gt;C-c C-o C-e&lt;/code&gt;) inside the environment folds it up to look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[itemize]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Placing the cursor somewhere inside &lt;code&gt;[itemize]&lt;/code&gt; will temporarily expand it again while you edit it, and then will fold back down to &lt;code&gt;[itemize]&lt;/code&gt; when you move the cursor out of the environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By a &quot;macro,&quot; AUCTeX means things like &lt;code&gt;\footnote{...}&lt;/code&gt;.  Hence, calling &lt;code&gt;TeX-fold-macro&lt;/code&gt; (default: &lt;code&gt;C-c C-o C-m&lt;/code&gt;) when inside &lt;code&gt;\footnote{This is a footnote}&lt;/code&gt; will fold it up to &lt;code&gt;[f]&lt;/code&gt;; it will expand and contract in analogous fashion to what happens with environments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use both &lt;code&gt;outline-minor-mode&lt;/code&gt; and AUCTeX's folding facilities together in the same document: they do different things on different parts of it.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-11-04T21:34:16.773" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3104" PostTypeId="1" AcceptedAnswerId="3404" CreationDate="2014-11-04T21:13:58.533" Score="19" ViewCount="1618" Body="&lt;p&gt;I often use the &lt;code&gt;TeX&lt;/code&gt; input method to type Unicode characters like &lt;code&gt;λ&lt;/code&gt;, which is quite handy. However, some of the characters I want to type are not supported like various subscripts (say &lt;code&gt;ᵢ&lt;/code&gt;), script characters (like &lt;code&gt;&lt;/code&gt;) and other various symbols (like &lt;code&gt;⦅&lt;/code&gt; and &lt;code&gt;⦆&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I extend the TeX input method to support some of these characters with custom input string (ie &lt;code&gt;_i&lt;/code&gt; for &lt;code&gt;ᵢ&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2020-12-16T13:39:52.177" Title="How can I add characters to an input method?" Tags="|input-method|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3105" PostTypeId="1" AcceptedAnswerId="3106" CreationDate="2014-11-04T22:20:47.640" Score="52" ViewCount="18470" Body="&lt;p&gt;When I &lt;code&gt;M-x find-file&lt;/code&gt; a PDF, it is opened in Emacs.  While this is nice, Emacs' PDF viewer lacks many features that I need and I would prefer to open PDFs in an external program instead.  How can I configure Emacs to use an external program as the default viewer for PDFs?&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="25" LastEditDate="2014-11-11T22:09:51.267" LastActivityDate="2022-11-29T18:14:22.283" Title="How to use an external program as the default way to open PDFs from Emacs?" Tags="|pdf|find-file|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3106" PostTypeId="2" ParentId="3105" CreationDate="2014-11-04T22:25:23.157" Score="42" Body="&lt;p&gt;Try &lt;a href=&quot;https://www.emacswiki.org/emacs/OpenWith&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;openwith&lt;/code&gt;&lt;/a&gt;.  The following code will enable it, and allow you to open PDFs with &lt;code&gt;evince&lt;/code&gt; (change to your favorite PDF viewer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'openwith)&#xA;(openwith-mode t)&#xA;(setq openwith-associations '((&quot;\\.pdf\\'&quot; &quot;evince&quot; (file))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="17895" LastEditDate="2018-11-27T21:48:09.807" LastActivityDate="2018-11-27T21:48:09.807" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="3107" PostTypeId="2" ParentId="3098" CreationDate="2014-11-04T23:26:35.980" Score="6" Body="&lt;p&gt;Here is one piece of an approach to organizing. No doubt it can be used together with other organizing approaches.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Put libraries &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; in your &lt;code&gt;load-path&lt;/code&gt; (i.e., &quot;install&quot; them), and load them (&lt;code&gt;require&lt;/code&gt;) when you start Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Put your image files in one or more directories. You can take advantage of the directory structure as a first level of organization. (You probably do this already.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In any such directory, use &lt;code&gt;C-u C-u C-M-b&lt;/code&gt; to &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#BookmarkingFilesYouCannotVisitWithEmacs&quot;&gt;&lt;em&gt;automatically bookmark each file&lt;/em&gt;&lt;/a&gt; in the directory in a bookmark file whose name you specify, and create a &lt;em&gt;bookmark for that bookmark-file&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can later &lt;strong&gt;&quot;jump&quot; to that bookmark-file bookmark&lt;/strong&gt;, to load its set of&#xA;bookmarks.  If you use &lt;code&gt;C-u&lt;/code&gt; when you jump to it, then you &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#BookmarkingFilesYouCannotVisitWithEmacs&quot;&gt;&lt;em&gt;switch&lt;/em&gt;&#xA;bookmark files&lt;/a&gt;, so that &lt;code&gt;C-x p e&lt;/code&gt; (or &lt;code&gt;C-x r l&lt;/code&gt;) displays only the&#xA;bookmarks created from the files in that directory.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Without &lt;code&gt;C-u&lt;/code&gt;, jumping&#xA;to the bookmark-file bookmark simply loads its bookmarks into the&#xA;current set of bookmarks. That is, instead of switching, it adds the bookmarked bookmark-file's bookmarks to the current set of bookmarks.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using different bookmark files (e.g. via different bookmark-file bookmarks) is a powerful way to organize sets of bookmarks, bringing one or the other set into focus.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When you bookmark a file that Emacs recognizes as an image file &#xA;or a sound file, an appropriate handler is used automatically. That means that &quot;jumping&quot; to an image-file bookmark automatically displays the image.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After you create individual bookmarks for, say, music or image&#xA;files, you can use &lt;code&gt;P B&lt;/code&gt; in the bookmark-list display to show only&#xA;those bookmarks, and then use &lt;code&gt;C-x r m&lt;/code&gt; to &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#BookmarkListViews&quot;&gt;&lt;em&gt;bookmark that state of&#xA;the bookmark-list&lt;/em&gt;&lt;/a&gt;. In other words, even if your image files are mixed in with other stuff in the same directory, you can create a bookmark that shows only the image files, and later &quot;jump&quot; to it, to restore that display.  This gives you a &quot;playlist&quot; of music or a &quot;slideshow&quot; of images.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#BookmarkTags&quot;&gt;&lt;strong&gt;&lt;em&gt;tag&lt;/em&gt;&lt;/strong&gt; any bookmark&lt;/a&gt;.  A tag is just an arbitrary string (or it is a string together with an associated Lisp value).  You use tags for classifying, searching, and accessing bookmarks. In this case, the bookmarks are your image files (they are autofile bookmarks) - and perhaps also your bookmark-file bookmarks (each of which is a collection of image-file bookmarks, these sets possibly overlapping). You might have tags representing different characteristics of the images: date, subject matter, occasion, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In addition to tagging a bookmark with any number of tags, you can &lt;strong&gt;annotate&lt;/strong&gt; it with a textual description. By default, this text is in &lt;strong&gt;Org mode&lt;/strong&gt;, which gives you yet another way to organize information about your image files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also bookmark a Dired buffer itself - or a Dired tree (directory and its descendents).  This records the &lt;code&gt;ls&lt;/code&gt; switches, which files are marked, which subdirectories are inserted, and which (sub)directories are hidden.  That too gives you a means of organization and access.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-04T23:33:41.383" LastActivityDate="2014-11-04T23:33:41.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3108" PostTypeId="1" AcceptedAnswerId="3111" CreationDate="2014-11-05T01:34:15.097" Score="0" ViewCount="269" Body="&lt;p&gt;I've never really used &lt;code&gt;vc&lt;/code&gt; but it looks like it only supports add or commit actions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reckon &lt;code&gt;magit&lt;/code&gt; must have some of the machinery to achieve this, but browsing its codebase didn't reveal anything obvious.&lt;/p&gt;&#xA;" OwnerUserId="2307" LastActivityDate="2014-11-05T02:17:20.100" Title="git-stage the current file-visiting buffer?" Tags="|git|version-control|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3109" PostTypeId="2" ParentId="3022" CreationDate="2014-11-05T02:03:32.890" Score="17" Body="&lt;p&gt;Another, probably cleaner, way to reset the value of a variable:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;custom-reevaluate-setting&lt;/code&gt; is a compiled Lisp function in &lt;code&gt;custom.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(custom-reevaluate-setting SYMBOL)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Reset the value of &lt;code&gt;SYMBOL&lt;/code&gt; by re-evaluating its saved or standard value.&#xA;  Use the &lt;code&gt;:set&lt;/code&gt; function to do so.  This is useful for customizable options&#xA;  that are defined before their standard value can really be computed.&#xA;  E.g. dumped variables whose default depends on run-time information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-reevaluate-setting 'emms-player-next-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will replace the previous value with that symbol's &lt;code&gt;standard-value&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read @phils comment below for a very important detail regarding this function.&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="920" LastEditDate="2015-04-27T02:29:44.360" LastActivityDate="2015-04-27T02:29:44.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3110" PostTypeId="2" ParentId="3093" CreationDate="2014-11-05T02:03:38.067" Score="9" Body="&lt;p&gt;I would absolutely recommend tern. I discovered it halfway through my internship (working in Node.js) last summer, and it worked wonderfully with &lt;code&gt;company-mode&lt;/code&gt; and &lt;code&gt;js2-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;js2-mode&lt;/code&gt; by itself is quite powerful. It can handle the usual &lt;code&gt;M-.&lt;/code&gt; jumping within a file most of the time, and &lt;code&gt;tern&lt;/code&gt; complements it nicely with inter-file/module jumping (esp. in the node ecosystem).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first step to using tern is installing the binary. I personally used npm to do so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo npm install -g tern&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then install in Emacs. The relevant section from my &lt;code&gt;init.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; tern&#xA;(package-require 'tern)&#xA;(add-hook 'js2-mode-hook (lambda () (tern-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The final step is to set up a &lt;code&gt;.tern-project&lt;/code&gt; file &lt;em&gt;in the root directory of your project&lt;/em&gt;. For Node.js projects, I use this as a starting point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;    &quot;loadEagerly&quot;: [&#xA;        &quot;src/**.js&quot;&#xA;    ],&#xA;    &quot;plugins&quot;: {&#xA;        &quot;node&quot;: {&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;company-mode&lt;/code&gt;, then installing &lt;code&gt;company-tern&lt;/code&gt; is also highly recommended:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-require 'company-tern)&#xA;(eval-after-load 'company&#xA;    '(add-to-list 'company-backends 'company-tern))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a note, I did have some trouble with the tern server occasionally dying this past summer (2014). Running the following fixed it consistently:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (delete-process &quot;Tern&quot;) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wasn't able to figure out exactly what was causing it, but it happened infrequently enough to be little more than a nuisance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/mooz/js2-mode&quot;&gt;js2-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ternjs.net/doc/manual.html#configuration&quot;&gt;the &lt;code&gt;.tern-project&lt;/code&gt; file&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="147" LastActivityDate="2014-11-05T02:03:38.067" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3111" PostTypeId="2" ParentId="3108" CreationDate="2014-11-05T02:17:20.100" Score="2" Body="&lt;p&gt;I guess you don't want to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;first: call magit-status&lt;/li&gt;&#xA;&lt;li&gt;second: press s to stage the file you want&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, let me suggest this function, courtesy of &lt;a href=&quot;https://github.com/nicholasbishop/emacs-conf/blob/master/git.el&quot; rel=&quot;nofollow&quot;&gt;Nicholas Bishop&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun git-add-current-buffer ()&#xA;  &quot;call 'git add [current-buffer]'&quot;      &#xA;  (interactive)&#xA;  (let* ((buffile (buffer-file-name))&#xA;         (output (shell-command-to-string&#xA;                  (concat &quot;git add &quot; (buffer-file-name)))))&#xA;    (message (if (not (string= output &quot;&quot;))&#xA;                 output&#xA;               (concat &quot;Added &quot; buffile)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The next thing is probably set a custom shortcut for that function. &lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-11-05T02:17:20.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3112" PostTypeId="1" AcceptedAnswerId="3114" CreationDate="2014-11-05T02:36:12.223" Score="29" ViewCount="10124" Body="&lt;p&gt;When I'm trying different color themes out, it seems if a particular element is not defined in the new theme the old theme value is retained, and this leads to some clashing. This happens in emacs 24 and also previous versions using &lt;code&gt;color-theme&lt;/code&gt;. Is there a way to reset all colors in between to default so that each color theme looks as intended?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastActivityDate="2017-09-29T20:40:56.683" Title="How to reset color theme?" Tags="|themes|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3113" PostTypeId="1" AcceptedAnswerId="3412" CreationDate="2014-11-05T02:38:55.550" Score="1" ViewCount="318" Body="&lt;p&gt;Whenever I select a region and execute an extended command (&lt;code&gt;M-x&lt;/code&gt;), &lt;code&gt;Helm&lt;/code&gt; opens and I immediately lose the ring selection highlighting. Is there a way of stopping &lt;code&gt;Helm&lt;/code&gt; from doing so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;Helm&lt;/code&gt; configuration (which I adapted from &lt;a href=&quot;http://pages.sachachua.com/.emacs.d/Sacha.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package helm&#xA;  :init&#xA;  (progn &#xA;    (require 'helm-config) &#xA;    (setq helm-candidate-number-limit 10)&#xA;    ;; From https://gist.github.com/antifuchs/9238468&#xA;    (setq helm-idle-delay 0.0 ; update fast sources immediately (doesn't).&#xA;          helm-input-idle-delay 0.01  ; this actually updates things&#xA;                                        ; reeeelatively quickly.&#xA;          helm-quick-update t&#xA;          helm-M-x-requires-pattern nil&#xA;          helm-split-window-in-side-p t&#xA;          helm-buffers-fuzzy-matching t&#xA;          helm-move-to-line-cycle-in-source t&#xA;          helm-ff-search-library-in-sexp t&#xA;          helm-ff-file-name-history-use-recentf t&#xA;          helm-ff-skip-boring-files t)&#xA;    (helm-mode))&#xA;  :config&#xA;  (progn&#xA;    ;; I don't like the way switch-to-buffer uses history, since&#xA;    ;; that confuses me when it comes to buffers I've already&#xA;    ;; killed. Let's use ido instead.&#xA;    (add-to-list 'helm-completing-read-handlers-alist '(switch-to-buffer . ido)))&#xA;  :bind ((&quot;C-c h&quot; . helm-mini)))&#xA;(ido-mode -1) ;; Turn off ido mode in case I enabled it accidentally&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="516" LastActivityDate="2014-11-12T04:37:32.420" Title="How to avoid losing selection with Helm" Tags="|helm|region|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3114" PostTypeId="2" ParentId="3112" CreationDate="2014-11-05T03:02:56.673" Score="26" Body="&lt;p&gt;Are you sure that you are using color themes and not Emacs custom themes?  &lt;strong&gt;Color themes&lt;/strong&gt; are defined by library &lt;a href=&quot;http://www.nongnu.org/color-theme&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;color-theme.el&lt;/code&gt;&lt;/a&gt;. &lt;strong&gt;Custom themes&lt;/strong&gt; are available starting with Emacs 24 - and they are &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; the same as color themes.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are using &lt;em&gt;color&lt;/em&gt; themes then the answer is simple: just enable the pseudo color-theme named &lt;code&gt;[Reset]&lt;/code&gt;.  That completely undoes the theme: removes all effects that it imposed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are in fact using Emacs &lt;em&gt;custom&lt;/em&gt; themes then the answer is not so simple. You &lt;strong&gt;&lt;em&gt;cannot&lt;/em&gt;&lt;/strong&gt; undo the application of a custom theme.  What you can do, which will help a lot, is to &lt;strong&gt;&lt;em&gt;disable&lt;/em&gt;&lt;/strong&gt; each custom theme, using &lt;code&gt;disable-theme&lt;/code&gt;, after it has been enabled and &lt;strong&gt;&lt;em&gt;before enabling another&lt;/em&gt;&lt;/strong&gt; custom theme. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two ways to do this &quot;semi-automatically&quot;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Advise &lt;code&gt;load-theme&lt;/code&gt;, so that it first &lt;em&gt;disables all&lt;/em&gt; custom themes before loading (enabling) another one.  This was suggested in &lt;a href=&quot;https://stackoverflow.com/a/15595000/729907&quot;&gt;this StackOverflow answer&lt;/a&gt; by &lt;a href=&quot;https://stackoverflow.com/users/401539/tungd&quot;&gt;Tungd at tungdao.com&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice load-theme (before theme-dont-propagate activate)&#xA; (mapcar #'disable-theme custom-enabled-themes))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Define and use a function that &lt;a href=&quot;https://stackoverflow.com/a/13033317/729907&quot;&gt;disables the current theme before enabling a theme&lt;/a&gt;. This was suggested by &lt;a href=&quot;https://stackoverflow.com/users/570144/maris-orbidans&quot;&gt;Maris Orbidans&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun enab-theme (theme) &#xA; (if current-t43m3 (disable-theme current-t43m3))&#xA; (setq current-t43m3 theme) &#xA; (load-theme theme t)) &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See those original S.O. posts for a little more info, and see the question and other answers to it on the same S.O. page.  (Caveat: The accepted answer on that page is &lt;em&gt;not&lt;/em&gt; an answer to the problem of undoing a custom theme.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Be aware that even the solutions described in #2 are &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; general solutions: they do not &lt;em&gt;undo&lt;/em&gt; the application of a custom theme - there is &lt;em&gt;no&lt;/em&gt; way to do that.  That is, &lt;strong&gt;disabling a custom theme does not restore&lt;/strong&gt; any &lt;strong&gt;&lt;em&gt;non-theme&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;customizations&lt;/strong&gt; (e.g., face changes) that you might have made before enabling that theme and that were overridden by that theme.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In other words, undoing a &lt;em&gt;color&lt;/em&gt; theme is trivial; undoing a &lt;em&gt;custom&lt;/em&gt; theme is impossible.  The best you can do for a custom theme is to disable it relative to other custom themes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best reference for this question and for ways of switching (e.g. cycling) among both color and custom themes is the Emacs Wiki page &lt;a href=&quot;http://www.emacswiki.org/ColorAndCustomThemes&quot; rel=&quot;noreferrer&quot;&gt;Color and Custom Themes&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;And be forewarned:&lt;/em&gt; There is a fair amount of misleading information in various places about Emacs custom themes in this regard.  People were rightfully excited that Emacs added custom themes as a feature in Emacs 24, and some of them jumped immediately to the mistaken conclusion that custom themes were a &lt;em&gt;replacement&lt;/em&gt; for color themes. They are not. Each has some advantages. Not being able to undo is a major disadvantage of custom themes, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15687&quot; rel=&quot;noreferrer&quot;&gt;This GNU Emacs bug report&lt;/a&gt; is an enhancement request to remedy the inability to undo a custom theme (and thus restore earlier customizations).]&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-11-05T03:51:46.407" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3115" PostTypeId="2" ParentId="3098" CreationDate="2014-11-05T03:03:41.707" Score="2" Body="&lt;p&gt;If you want a list of files in a project, &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;projectile&lt;/a&gt; is a currently a popular project manager in Emacs. If you use a version control system (i.e. Git), Projectile automatically recognizes it as a project and gives you a list of files with &lt;code&gt;projectile-find-files&lt;/code&gt;. If you don't use a project manager, then add a &lt;code&gt;.projectile&lt;/code&gt; file at project root will turn that directory into a project. Or, you can set &lt;code&gt;projectile-require-project-root&lt;/code&gt; to nil and you can use &lt;code&gt;projectile&lt;/code&gt; in any directory. If you use Helm, you can insert any entry with &lt;code&gt;C-c C-i&lt;/code&gt; into the current buffer. Have a look at &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot; rel=&quot;nofollow&quot;&gt;my guide&lt;/a&gt; for demos.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-11-05T03:03:41.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3116" PostTypeId="1" AcceptedAnswerId="3118" CreationDate="2014-11-05T03:04:47.270" Score="12" ViewCount="457" Body="&lt;p&gt;Is it possible to display a message in the echo area without logging it in buffer  &lt;code&gt;*Messages*&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="105" LastEditDate="2014-11-05T03:56:42.650" LastActivityDate="2023-04-25T08:52:42.847" Title="How to display a message in echo-area only" Tags="|echo-area|message|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3117" PostTypeId="2" ParentId="3116" CreationDate="2014-11-05T03:55:35.867" Score="2" Body="&lt;p&gt;I couldn't find a built in way to do it, so I hacked this weird function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun echo-and-ignore-message-buffer (message)&#xA;  (let ((prev-msg-log-max message-log-max))&#xA;    (unwind-protect&#xA;        (progn (setq message-log-max nil)&#xA;               (message message))&#xA;      (setq message-log-max prev-msg-log-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Check out the documentation for &lt;code&gt;message-log-max&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2014-11-05T03:55:35.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3118" PostTypeId="2" ParentId="3116" CreationDate="2014-11-05T03:55:44.167" Score="12" Body="&lt;p&gt;Bind &lt;code&gt;message-log-max&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (let ((message-log-max nil))&#xA;    (message &quot;EEEEEEEEEEEEEEEEEE&quot;)))&#xA;&#xA;M-x foo RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[P.S. Don't be misled by tests using things such as &lt;code&gt;M-: (let ((message-log-max nil)) (message &quot;EEEEEEEEEEEEEEEEEE&quot;))&lt;/code&gt; into thinking that the &lt;code&gt;EEEEEEEEEEEEEEEEEE&lt;/code&gt; &lt;em&gt;from evaluating the&lt;/em&gt; &lt;code&gt;let&lt;/code&gt; &lt;em&gt;sexp&lt;/em&gt; is the message that was output by &lt;code&gt;message&lt;/code&gt;. It is instead the value returned by that evaluation. &lt;code&gt;message&lt;/code&gt; does not log anything to &lt;code&gt;*Messages*&lt;/code&gt; if &lt;code&gt;message-log-max&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.]&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:52:36.597" LastActivityDate="2015-05-09T20:52:36.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3119" PostTypeId="1" AcceptedAnswerId="3120" CreationDate="2014-11-05T04:07:00.220" Score="6" ViewCount="3690" Body="&lt;p&gt;I'm working with a large codebase and often find it to be tedious and hard to understand class relationships.  I found the following &lt;a href=&quot;http://www.emacswiki.org/emacs/WhatAreTheNeedsOfProgrammers&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt; that describes various tools for working with OOP in C++, but they're either outdated or do not work!  What Emacs tools are available for working with large OO codebases?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have found:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/ObjectOrientedBrowser&quot; rel=&quot;nofollow&quot;&gt;Object Oriented Browser&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hasn't been updated since 2002!  Defunct&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ebrowse/&quot; rel=&quot;nofollow&quot;&gt;Ebrowse&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;s&gt;I can't even find a download link for the parser...my target would either be Windows or Mac OS X&lt;/s&gt; Thanks @tu-do for pointing out it's in the emacs bin directory&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ecb.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Emacs Code Browser&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Only seems to support Etags, but not Global tags or cscope&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2265" LastEditorUserId="50" LastEditDate="2014-11-05T10:21:18.253" LastActivityDate="2018-12-26T17:31:49.787" Title="Class Browsing in C++" Tags="|c++|ctags|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3120" PostTypeId="2" ParentId="3119" CreationDate="2014-11-05T04:14:13.743" Score="6" Body="&lt;p&gt;I'm writing a guide for Ebrowse and will release it in this week.Ebrowse is a fast parser used to process C++ source files to produce a database that contains the class hierarchy that is later processed by Emacs to produce a class tree representation. It is somewhat like GNU Global, but is built-into Emacs and produce a class tree, so it will take longer to process in large source tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use Ebrowse:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find . -name '*.cpp' -or -name '*.h' | ebrowse&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add more extension if you want. If your project only has hundreds of files, then =Ebrowse= works really well. After executing the command, a file named &lt;code&gt;BROWSE&lt;/code&gt; is generated; this is the database that contains the class hierarchy. Simply open this file and Emacs automatically recognizes the file and process it. After done processing the database, Emacs displays an index of all classes in the database in a tree format: if a class is derived from a class, it is nested inside the parent class. This buffer is called a &lt;code&gt;Tree buffer&lt;/code&gt;. Emacs provides three ways to interact with &lt;code&gt;Ebrowse&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Tree&lt;/code&gt; buffer: a buffer that displays the tree.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Member&lt;/code&gt; buffer: a buffer that displays members of each class. You&#xA;can toggle between declarations and definitions of a class and jump&#xA;to the location of each in the corresponding source file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Source&lt;/code&gt; buffer: your code buffer. You can interact &lt;code&gt;Ebrowse&lt;/code&gt;&#xA;database like finding and viewing (open for read-only) declaration&#xA;and definition, open a =Member= buffer of a class that contains the&#xA;tag at point...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you have a large project (i.e. more than 10000 cpp files), but all classes are in &lt;code&gt;.h&lt;/code&gt; files, then don't add &lt;code&gt;.cpp&lt;/code&gt; or else it would take very long to generate &lt;code&gt;BROWSE&lt;/code&gt; file. You will lose the ability to switch to definition though; but this can be done by using &lt;code&gt;ctags&lt;/code&gt; or &lt;code&gt;GNU Global&lt;/code&gt;. The most important thing is to view class hierarchy in &lt;code&gt;Tree buffer&lt;/code&gt;, and this is the advantage of Ebrowse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;WIP guide is &lt;a href=&quot;https://github.com/tuhdo/tuhdo.github.io/blob/master/emacs-tutor/ebrowse.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Alternatively, you can use &lt;a href=&quot;http://www.doxygen.nl/manual/external.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;doxygen&lt;/a&gt; to generate all kinds of graphs (caller/callee graphs, dependency graphs, class hierarchy graphs...) but it also takes a long time to generate all, even for small source tree like &lt;a href=&quot;https://git.ipxe.org/ipxe.git&quot; rel=&quot;nofollow noreferrer&quot;&gt;ipxe&lt;/a&gt;. This is not that &lt;code&gt;doxygen&lt;/code&gt; is slow, in fact it's quite optimized, but to compute dependency for whole code base is not a trivial task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;: If you work with C and want to see call graph, use GNU Cflow. See &lt;a href=&quot;http://www.reddit.com/r/emacs/comments/2az5t2/how_do_i_find_function_call_hierarchy/&quot; rel=&quot;nofollow noreferrer&quot;&gt;my Reddit annswer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="21155" LastEditDate="2018-12-26T17:31:49.787" LastActivityDate="2018-12-26T17:31:49.787" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="3121" PostTypeId="5" CreationDate="2014-11-05T04:29:50.323" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-05T04:29:50.323" LastActivityDate="2014-11-05T04:29:50.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3122" PostTypeId="4" CreationDate="2014-11-05T04:29:50.323" Score="0" Body="Questions relating to commands for passing single command lines to shell sub-processes, running a shell interactively with input and output to an Emacs buffer, and for running a shell in a terminal emulator window." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-05T06:08:38.123" LastActivityDate="2014-11-05T06:08:38.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3123" PostTypeId="1" AcceptedAnswerId="3130" CreationDate="2014-11-05T04:47:33.800" Score="1" ViewCount="84" Body="&lt;p&gt;As I use a different language from English often I would like to create some keymaps to avoid changing languages all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know the name of the commands that I have to place in the section &lt;code&gt;interactive-command-here&lt;/code&gt; of the keymap: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key KEYMAP (kbd &quot;key-bind-here&quot;) 'interactive-command-here)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance how can I say that I want &lt;code&gt;C-σ&lt;/code&gt; to mean Save? How you denote the Save in the keymap?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="253" LastEditDate="2014-11-16T19:20:27.077" LastActivityDate="2014-11-16T19:20:27.077" Title="Name of the commands in keymap creation" Tags="|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3124" PostTypeId="2" ParentId="3105" CreationDate="2014-11-05T04:47:36.830" Score="14" Body="&lt;p&gt;You asked about &lt;code&gt;find-file&lt;/code&gt;.  In addition to what others (e.g., Dan) say about that, it is worthwhile to also know about opening files using an application associated with the file type (e.g. extension) in option &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt;. And if you use Emacs on MS Windows, then it is worthwhile knowing how to open a file using Windows file associations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option &lt;strong&gt;&lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt;&lt;/strong&gt; is available after you load standard library &lt;code&gt;dired-x.el&lt;/code&gt;.  The default association of a PDF file is defined in variable &lt;code&gt;dired-guess-shell-alist-default&lt;/code&gt;, and it is program &lt;code&gt;xpdf&lt;/code&gt; (available on UNIX and GNU/Linux).  Using option &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt; you can, for instance, associate it instead with Adobe Acrobat Reader by adding this association to the alist: &lt;code&gt;(&quot;\.pdf$&quot; . &quot;AcroRd32.exe&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can open a PDF file in Dired just by using &lt;code&gt;!&lt;/code&gt;.  That provides default programs as &quot;guesses&quot;, which you can access by repeating &lt;code&gt;M-n&lt;/code&gt;.  So &lt;code&gt;!&lt;/code&gt; followed by &lt;code&gt;M-n&lt;/code&gt; will give you the shell command &lt;code&gt;AcroRd32.exe&lt;/code&gt; if point is on a PDF file name and if that command/program is associated with regexp &lt;code&gt;\.pdf$&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to Dired, you can make use of the file associations in &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt; as a bookmark file handler, that is, have the PDF file association take effect for any bookmarks to PDF files, if you use library &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;. The current value of &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt; is used as the default value of option &lt;strong&gt;&lt;code&gt;bmkp-default-handlers-for-file-types&lt;/code&gt;&lt;/strong&gt;, which controls this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of options &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt; and &lt;code&gt;bmkp-default-handlers-for-file-types&lt;/code&gt; as somewhat analogous to &lt;code&gt;auto-mode-alist&lt;/code&gt;. But they map file-name patterns to file actions instead of mapping them to buffer modes. And they take effect only when you use certain commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use MS Windows then you can instead (or also) take advantage of existing &lt;em&gt;Windows file associations&lt;/em&gt; when you open a file in Dired or &quot;jump&quot; to a bookmark.  For this you need library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/w32-browser.el&quot;&gt;&lt;code&gt;w32-browser.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Dired, you also need library &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; - see &lt;a href=&quot;http://www.emacswiki.org/DiredPlus#w32-browser&quot;&gt;Using Windows File Associations in Dired&lt;/a&gt;. For bookmarks, you also need &lt;strong&gt;Bookmark+&lt;/strong&gt; - see &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#BookmarkingFilesYouCannotVisitWithEmacs&quot;&gt;Bookmarking Files You Cannot Visit With Emacs&lt;/a&gt; and&#xA;&lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#WindowsFileAssociations&quot;&gt;Opening Bookmarks Using Windows File Associations&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-05T04:47:36.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3125" PostTypeId="2" ParentId="3105" CreationDate="2014-11-05T05:02:02.770" Score="24" Body="&lt;p&gt;If you want to view PDF with many features (highlighting search, highlighting selection, annotate, content tree), use &lt;a href=&quot;https://github.com/politza/pdf-tools&quot;&gt;pdf-tools&lt;/a&gt;. As you can see in &lt;a href=&quot;http://tuhdo.github.io/static/emacs-read-pdf.gif&quot;&gt;the demo&lt;/a&gt;, I can using Isearch with highlighting. Emacs is now my favourite PDF reader. You can also bookmark specific PDF page by using Bookmark(+).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: If you use &lt;code&gt;helm&lt;/code&gt; and want to use external program, &lt;code&gt;helm&lt;/code&gt; already has one in the action menu for opening external file: &lt;code&gt;Open file externally C-c C-x. C-u to choose again&lt;/code&gt;. What it does it that it offers a list of &lt;strong&gt;all&lt;/strong&gt; available programs in your system and present you with a nice Helm interface to select from; once you select, Helm remembers it until you run the command with prefix argument &lt;code&gt;C-u&lt;/code&gt; to select a new one.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-11-05T11:01:44.577" LastActivityDate="2014-11-05T11:01:44.577" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3126" PostTypeId="5" CreationDate="2014-11-05T05:04:29.917" Score="0" Body="&lt;p&gt;CEDET provides number of features: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Projects management system&lt;/li&gt;&#xA;&lt;li&gt;Smart Completion&lt;/li&gt;&#xA;&lt;li&gt;Smart Help/Jump&lt;/li&gt;&#xA;&lt;li&gt;Symbol References&lt;/li&gt;&#xA;&lt;li&gt;Code Generation&lt;/li&gt;&#xA;&lt;li&gt;UML Diagrams&lt;/li&gt;&#xA;&lt;li&gt;Advanced Code Browsing&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-05T10:02:58.333" LastActivityDate="2014-11-05T10:02:58.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3127" PostTypeId="4" CreationDate="2014-11-05T05:04:29.917" Score="0" Body="CEDET is a Collection of Emacs Development Environment Tools written with the end goal of creating an advanced development environment in Emacs" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-05T06:08:23.227" LastActivityDate="2014-11-05T06:08:23.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3128" PostTypeId="5" CreationDate="2014-11-05T05:10:13.023" Score="0" Body="&lt;p&gt;Emacs Speaks Statistics (ESS) is an add-on package for emacs text editors such as GNU Emacs and XEmacs. It is designed to support editing of scripts and interaction with various statistical analysis programs such as R, S-Plus, SAS, Stata and JAGS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ESS is freely available under the GNU General Public License (GPL).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Resources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ess.r-project.org&quot; rel=&quot;nofollow&quot;&gt;Project page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ess.r-project.org/Manual/ess.html&quot; rel=&quot;nofollow&quot;&gt;Manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ess.r-project.org/refcard.pdf&quot; rel=&quot;nofollow&quot;&gt;ESS Reference Card for R and S&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stat.ethz.ch/mailman/listinfo/ess-help&quot; rel=&quot;nofollow&quot;&gt;ESS Mailing List&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-05T06:08:43.200" LastActivityDate="2014-11-05T06:08:43.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3129" PostTypeId="4" CreationDate="2014-11-05T05:10:13.023" Score="0" Body="ESS (Emacs Speaks Statistics) is an emacs add-on for editing scripts and interacting with statistical programs such as R, Stata or SAS.&#xD;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-05T06:08:46.777" LastActivityDate="2014-11-05T06:08:46.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3130" PostTypeId="2" ParentId="3123" CreationDate="2014-11-05T05:13:15.683" Score="6" Body="&lt;p&gt;Here's how to set &lt;code&gt;C-o&lt;/code&gt; to save the current buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;C-o&quot;) 'save-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How did I find that function? Well, I know that the command to save the current file is &lt;code&gt;C-x C-s&lt;/code&gt;, so ask Emacs what the function is when you press those keys. &lt;code&gt;C-h c C-x C-s&lt;/code&gt;. The minibuffer tells you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-s runs the command save-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I set the keybinding in the global keymap. You may or may not want to do that. If you want the keybinding only in certain modes, you should change the map specified. But if you want to always be able to press &lt;code&gt;C-o&lt;/code&gt; to save, that's what to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, in fact, there's a slightly shorter way to set keys globally, with &lt;code&gt;global-set-key&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-o&quot;) 'save-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note also that a very useful thing is the documentation for &lt;code&gt;define-key&lt;/code&gt;. Press &lt;code&gt;C-h f define-key &amp;lt;RET&amp;gt;&lt;/code&gt;. The beginning explains what the arguments are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;define-key is a built-in function in `C source code'.&#xA;&#xA;(define-key KEYMAP KEY DEF)&#xA;&#xA;In KEYMAP, define key sequence KEY as DEF.&#xA;KEYMAP is a keymap.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-11-05T05:13:15.683" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3131" PostTypeId="2" ParentId="3048" CreationDate="2014-11-05T05:21:15.310" Score="3" Body="&lt;p&gt;If you want to pass multiple selections, you have to explicitly retrieve:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(helm-marked-candidates :with-wildcard t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and explicitly process the selections. Try printing the return value of the above form to see if you get correct set of candidates.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-11-05T05:21:15.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3132" PostTypeId="2" ParentId="3021" CreationDate="2014-11-05T05:40:11.217" Score="0" Body="&lt;p&gt;Just a thought -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should not really be about &quot;keystrokes&quot;, but about &lt;em&gt;commands&lt;/em&gt; - no matter how they are executed, &lt;em&gt;no&lt;/em&gt;?  If I understand correctly, you are really looking for a way to tell whether a given command that gets invoked modifies the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, then maybe do something like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Put a function on &lt;code&gt;pre-command-hook&lt;/code&gt; that (1) records the current value of &lt;code&gt;(buffer-modified-p)&lt;/code&gt; and then (2) uses &lt;code&gt;set-modified-p&lt;/code&gt; to make the buffer unmodified.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Put a function on &lt;code&gt;post-command-hook&lt;/code&gt; that (1) checks whether the command modified the buffer (by comparing the recorded value against the new current value of &lt;code&gt;(buffer-modified-p)&lt;/code&gt;), then acts accordingly, and (2) if the new value is &lt;code&gt;nil&lt;/code&gt; then resets to the pre-change value using &lt;code&gt;set-modified-p&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Kind of heavy-handed (it checks for each command that is invoked), but it might be worth a try. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the &quot;&lt;em&gt;acts accordingly&lt;/em&gt;&quot; part is just a no-op for all buffer modifying commands, and if it is also a no-op for many non-modifying commands (e.g. because you just did it on a previous non-modifying command), then at least you will not be doing that &quot;&lt;em&gt;acts accordingly&lt;/em&gt;&quot; action more than necessary.  But the checking part alone might be expensive/overkill (slow things down too much) - try it to see.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-05T05:40:11.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3133" PostTypeId="1" AcceptedAnswerId="3144" CreationDate="2014-11-05T06:02:47.667" Score="4" ViewCount="2183" Body="&lt;p&gt;How to make cursor stop at the last character of a line instead of at the linefeed character? I use evil-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Steps to reproduce the issue:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start Emacs in shell via &lt;code&gt;emacs -nw -Q&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;C-e&lt;/kbd&gt; to move focus to the end of the line.&lt;/li&gt;&#xA;&lt;li&gt;You can see the yellow cursor stops at the linefeed character instead of the &lt;code&gt;{&lt;/code&gt; character.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6LihF.png&quot; alt=&quot;Example screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&#xA;Thanks guys. It turns out it's not a bug but just default behavior of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My issue is actually I'm using evil-mode and I mistakenly turn off a useful feature of evil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the CORRECT setup code to turn that flag on in evil-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-move-cursor-back t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="25" LastEditDate="2014-11-24T19:33:51.547" LastActivityDate="2015-05-09T20:52:09.733" Title="Make the cursor stop at the last character of a line instead of the newline character" Tags="|cursor|newlines|motion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3134" PostTypeId="2" ParentId="3133" CreationDate="2014-11-05T06:10:41.883" Score="5" Body="&lt;p&gt;Bind &lt;code&gt;C-e&lt;/code&gt; to a command that puts the cursor one char to the left of the line end.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (end-of-line arg)&#xA;  (unless (bolp) (backward-char)))&#xA;&#xA;(global-set-key &quot;\C-e&quot; 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Although I cannot imagine why you would want to move the cursor there.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:52:09.733" LastActivityDate="2015-05-09T20:52:09.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3135" PostTypeId="1" AcceptedAnswerId="3136" CreationDate="2014-11-05T08:06:28.577" Score="3" ViewCount="765" Body="&lt;p&gt;I use Emacs for Android development and this has been bugging me lately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to get the following indentation behaviour:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;submitBtn.setOnClickListener(new OnClickListener() {&#xA;  @Override&#xA;  public void onClick(View v) {&#xA;    submitEnquiry();&#xA;  }&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and with my current setup I'm getting this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;submitBtn.setOnClickListener(new OnClickListener() {&#xA;    @Override&#xA;    public void onClick(View v) {&#xA;      submitEnquiry();&#xA;    }&#xA;  });&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Quite a specific case I know, but one that I'm running into very often. I'm using Emacs 24.4 and I'm only modifying &lt;code&gt;c-basic-offset&lt;/code&gt; in my &lt;code&gt;java-mode-hook&lt;/code&gt; at the moment.&lt;/p&gt;&#xA;" OwnerUserId="2423" LastEditorUserId="504" LastEditDate="2014-11-05T08:40:14.953" LastActivityDate="2014-11-05T08:40:36.327" Title="Modifying Java indentation style" Tags="|indentation|java|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3136" PostTypeId="2" ParentId="3135" CreationDate="2014-11-05T08:26:13.373" Score="4" Body="&lt;p&gt;After some poking around, it looks like this has fixed it (getting called in &lt;code&gt;java-mode-hook&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(c-set-offset 'inexpr-class 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default it is set to &lt;code&gt;+&lt;/code&gt;. &lt;code&gt;inexpr-class&lt;/code&gt; controls the indentation level for anonymous classes and anonymous initialisation.&lt;/p&gt;&#xA;" OwnerUserId="2423" LastEditorUserId="504" LastEditDate="2014-11-05T08:40:36.327" LastActivityDate="2014-11-05T08:40:36.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3137" PostTypeId="2" ParentId="3105" CreationDate="2014-11-05T09:05:16.577" Score="3" Body="&lt;p&gt;I'm using &lt;a href=&quot;http://www.emacswiki.org/emacs/Runner&quot; rel=&quot;nofollow&quot;&gt;runner&lt;/a&gt;. Here is an excerpt of my configuration file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun my:open-file-with-dired (file)&#xA;      &quot;Ask dired how it would open FILE.&#xA;This code is useful if dired is well configured to open files&#xA;with external applications. I recommend using the `runner`&#xA;package to do so.&quot;&#xA;      (use-package dired-aux)&#xA;      (dired-do-async-shell-command&#xA;       (dired-guess-shell-command (format  &quot;Open %s &quot; file) (list file))&#xA;       0&#xA;       (list file)))&#xA;&#xA;    (add-to-list 'org-file-apps '(t . (my:open-file-with-dired file)))&#xA;    (add-to-list 'org-file-apps '(&quot;\\.png\\'&quot; . default))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2222" LastActivityDate="2014-11-05T09:05:16.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3138" PostTypeId="1" AcceptedAnswerId="3141" CreationDate="2014-11-05T09:40:06.293" Score="12" ViewCount="5280" Body="&lt;p&gt;I recently ran into the problem of decoding html entities. I have the&#xA;following two strings (&lt;em&gt;Note how two methods of encoding are used,&#xA;named and numbered&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The old &amp;amp;quot;how to fold xml&amp;amp;quot; question&#xA;Babel doesn&amp;amp;#39;t wrap results in verbatim&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I need to convert them to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The old &quot;how to fold xml&quot; question&#xA;Babel doesn't wrap results in verbatim&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Searching around, I found &lt;a href=&quot;https://stackoverflow.com/questions/1631807/decoding-html-entities-in-emacs-elisp&quot;&gt;this old question&lt;/a&gt; on SO (which is what I'm&#xA;doing for the moment), but I refuse to believe Emacs has no built-in&#xA;way of doing this. We have several web browsers, at least two of which&#xA;I know are built-in, not to mention mail clients and feed readers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there not a built-in way of decoding html entities?&lt;/strong&gt;&lt;br&gt;&#xA;I'm looking for a function that takes a string from the first example and returns a string from the second example.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2023-10-04T13:49:31.470" Title="Built-in way of decoding HTML entities (i.e. &amp;quot; or &amp;#39;)" Tags="|html|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3139" PostTypeId="2" ParentId="3104" CreationDate="2014-11-05T10:03:08.290" Score="1" Body="&lt;p&gt;I was using &lt;code&gt;insert-char&lt;/code&gt; to insert Unicode chars. However I didn't appreciate the default completion for that command. So here's one that completes with &lt;code&gt;helm&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-insert-char ()&#xA;  (interactive)&#xA;  (helm :sources&#xA;      `((name . &quot;Unicode char name&quot;)&#xA;        (candidates . ,(ucs-names))&#xA;        (action . insert))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here are the types of lambdas that I can insert: &lt;code&gt;λ&lt;/code&gt;, &lt;code&gt;Λ&lt;/code&gt;, &lt;code&gt;ƛ&lt;/code&gt;, &lt;code&gt;ƛ&lt;/code&gt;. I've bound the command to &lt;kbd&gt;f2 u&lt;/kbd&gt;, so the sequence to insert these was:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;f2 u&lt;/kbd&gt; &lt;code&gt;lambda&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;f2 u&lt;/kbd&gt; &lt;kbd&gt;M-p&lt;/kbd&gt; &lt;kbd&gt;C-n&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;f2 u&lt;/kbd&gt; &lt;kbd&gt;M-p&lt;/kbd&gt; &lt;kbd&gt;C-n&lt;/kbd&gt; &lt;kbd&gt;C-n&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... &lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="504" LastEditDate="2015-01-13T08:42:54.630" LastActivityDate="2015-01-13T08:42:54.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3140" PostTypeId="2" ParentId="3119" CreationDate="2014-11-05T10:04:34.557" Score="2" Body="&lt;p&gt;You can have a nice &lt;strong&gt;helm interface&lt;/strong&gt; to interactively use &lt;code&gt;cscope&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://wikemacs.org/wiki/Python#Indexing_sources:_ctags.2C_cscope.2C_pycscope&quot; rel=&quot;nofollow&quot;&gt;http://wikemacs.org/wiki/Python#Indexing_sources:_ctags.2C_cscope.2C_pycscope&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/sergey-pashaev/helm-cscope&quot; rel=&quot;nofollow&quot;&gt;https://github.com/sergey-pashaev/helm-cscope&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We then have functions like &lt;code&gt;M-x helm-cscope-find-global-definition&lt;/code&gt; available. The navigation is quicker.&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2014-11-05T10:04:34.557" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3141" PostTypeId="2" ParentId="3138" CreationDate="2014-11-05T10:09:03.287" Score="10" Body="&lt;p&gt;Emacs includes a pure-Elisp XML parser in &lt;code&gt;xml.el&lt;/code&gt;, whose &lt;code&gt;xml-parse-string&lt;/code&gt; function does the job, though it seems a bit like an undocumented internal function.  I'm not sure if there are any HTML-only entities which won't be properly handled by treating the string as an XML fragment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This wrapper function will simply omit any trailing tags from the input string, although you could make it stricter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun decode-entities (html)&#xA;  (with-temp-buffer&#xA;    (save-excursion (insert html))&#xA;    (xml-parse-string)))&#xA;&#xA;(decode-entities &quot;The old &amp;amp;quot;how to fold xml&amp;amp;quot; question&quot;)&#xA;;; =&amp;gt; &quot;The old \&quot;how to fold xml\&quot; question&quot;&#xA;&#xA;(decode-entities &quot;doesn&amp;amp;#39;t&quot;)&#xA;;; =&amp;gt; &quot;doesn't&quot;&#xA;&#xA;(decode-entities &quot;string with trailing tag: &amp;lt;tag/&amp;gt;&quot;)&#xA;;; =&amp;gt; &quot;string with trailing tag: &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In Emacs with LibXML support, another slightly hackish way would be to write a wrapper around &lt;code&gt;libxml-html-parse-region&lt;/code&gt;.  Since the LibXML parser assumes its argument is a complete HTML document, the wrapper function has to extract the parsed character data from the returned document structure, using &lt;code&gt;pcase&lt;/code&gt;.  Trying to decode a string that contains any HTML tags will produce an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun decode-entities/libxml (html)&#xA;  (with-temp-buffer&#xA;    (insert html)&#xA;    (let ((document&#xA;           (libxml-parse-html-region (point-min) (point-max))))&#xA;      (pcase document&#xA;        (`(html nil&#xA;                (body nil&#xA;                      (p nil&#xA;                         ,(and (pred stringp)&#xA;                               content))))&#xA;          content)&#xA;        (_ (error &quot;Unexpected parse result: %S&quot; document))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(decode-entities/libxml &quot;The old &amp;amp;quot;how to fold xml&amp;amp;quot; question&quot;)&#xA;     ; =&amp;gt; &quot;The old \&quot;how to fold xml\&quot; question&quot;&#xA;(decode-entities/libxml &quot;doesn&amp;amp;#39;t&quot;) ; =&amp;gt; &quot;doesn't&quot;&#xA;&#xA;(decode-entities/libxml &quot;&amp;lt;html&amp;gt;&quot;)              ; produces an error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does seem a little backward to decode a document fragment by parsing it as a complete document, only to immediately strip off the surrounding tags.  On the other hand, using LibXML should be fast and give accurate results.&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorDisplayName="user1968" LastEditDate="2014-11-30T19:17:27.380" LastActivityDate="2014-11-30T19:17:27.380" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3142" PostTypeId="2" ParentId="3138" CreationDate="2014-11-05T10:27:12.713" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://web-mode.org&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;web-mode.el&lt;/code&gt;&lt;/a&gt; does this with &lt;code&gt;web-mode-dom-entities-replace&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="197" LastEditorUserId="504" LastEditDate="2014-11-05T11:53:20.113" LastActivityDate="2014-11-05T11:53:20.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3143" PostTypeId="1" CreationDate="2014-11-05T10:57:09.110" Score="55" ViewCount="21838" Body="&lt;p&gt;My &lt;code&gt;.emacs&lt;/code&gt; configuration file gets bigger and bigger and I'd like to get a better overview and structuring by adding headings, subheadings and being able to hide or show them like I can do with Emacs &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that I can activate &lt;code&gt;org-mode&lt;/code&gt; also in the &lt;code&gt;.emacs&lt;/code&gt; buffer and that it is possible to add headings and collapse them. But will Emacs/Aquamacs still be able to load the Elisp code from the document if I add &lt;code&gt;org-mode&lt;/code&gt; headings (i.e., lines starting with one or more asterisks)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I have all that in one file or would I have to have one &lt;code&gt;.*org&lt;/code&gt; file and then regularly export the Elisp code to another file?&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="25" LastEditDate="2014-11-12T04:30:53.917" LastActivityDate="2019-03-01T21:28:47.040" Title="Can I use org-mode to structure my .emacs or other .el configuration file?" Tags="|org-mode|elisp|org-babel|outline-mode|literate-programming|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3144" PostTypeId="2" ParentId="3133" CreationDate="2014-11-05T10:57:14.497" Score="8" Body="&lt;p&gt;&lt;sub&gt;(This is too long for a comment, and while not literally an answer, I hope it might help the OP.)&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While Drew's answer covers what you literally &lt;em&gt;want&lt;/em&gt;, this is probably not what you &lt;em&gt;need&lt;/em&gt;.  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Point.html&quot;&gt;Point&lt;/a&gt; in Emacs is never &lt;em&gt;on&lt;/em&gt; a character, it is &lt;em&gt;between&lt;/em&gt; characters:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Like other positions, point designates a place between two characters&#xA;  (or before the first character, or after the last character), rather&#xA;  than a particular character. Usually terminals display the cursor over&#xA;  the character that immediately follows point; point is actually before&#xA;  the character on which the cursor sits.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Of course, both the display &lt;em&gt;and&lt;/em&gt; some commands might mislead you.  For instance, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Position-Info.html&quot;&gt;&lt;code&gt;what-cursor-position&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;shows information about the current cursor position and the buffer&#xA;  contents at that position [...] After &lt;code&gt;Char:&lt;/code&gt;, this shows the&#xA;  character in the buffer at point.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am not sure whether the wording &quot;at that position&quot; and &quot;at point&quot; in this excerpt are bugs in the manual or not; I would consider reporting them with e.g. &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="642" LastActivityDate="2014-11-05T10:57:14.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3145" PostTypeId="1" AcceptedAnswerId="3148" CreationDate="2014-11-05T11:01:42.437" Score="12" ViewCount="1692" Body="&lt;p&gt;I would like to display the opening part of a scope when this one get out of screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;namespace a  &#xA;{  &#xA;...  &#xA;--------------------- &amp;lt;- display frame &#xA;...                 |  &#xA;}*                  | * when cursor is here display &quot;namespace a&quot; in the minibuffer&#xA;---------------------   or on screen&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This could work for many programming language but I am mainly thinking of C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify a bit more and for those who know VS, I would like a similar feature as what exist for Visual Studio. i.e. positioning the cursor at the end of a scope display the beginning of the scope at the top of the edit buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this feature already existing somewhere ?&lt;/p&gt;&#xA;" OwnerUserId="2401" LastActivityDate="2015-03-13T10:56:15.657" Title="Display the beginning of a scope when it is out of screen" Tags="|minibuffer|c++|programming|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3146" PostTypeId="2" ParentId="3143" CreationDate="2014-11-05T11:07:01.307" Score="14" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Literate_programming&quot; rel=&quot;noreferrer&quot;&gt;Literate programming&lt;/a&gt; takes you the most way there, &lt;a href=&quot;http://orgmode.org/&quot; rel=&quot;noreferrer&quot;&gt;org-mode&lt;/a&gt; supports it via &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/index.html&quot; rel=&quot;noreferrer&quot;&gt;org-babel&lt;/a&gt;. &lt;a href=&quot;http://endlessparentheses.com/init-org-Without-org-mode.html&quot; rel=&quot;noreferrer&quot;&gt;Two possible solutions&lt;/a&gt; are explained on &lt;a href=&quot;https://emacs.stackexchange.com/users/50/malabarba&quot;&gt;@malabarba&lt;/a&gt;'s blog:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest way is loading org-mode, then using its untangling feature to load a literate Emacs configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;(org-babel-load-file&#xA; (expand-file-name &quot;emacs-init.org&quot;&#xA;                   user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively (to avoid loading org entirely), untangling can be done with the Emacs Lisp primitives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar endless/init.org-message-depth 3&#xA;  &quot;What depth of init.org headers to message at startup.&quot;)&#xA;&#xA;(with-temp-buffer&#xA;  (insert-file &quot;~/.emacs.d/init.org&quot;)&#xA;  (goto-char (point-min))&#xA;  (search-forward &quot;\n* init.el&quot;)&#xA;  (while (not (eobp))&#xA;    (forward-line 1)&#xA;    (cond&#xA;     ;; Report Headers&#xA;     ((looking-at&#xA;       (format &quot;\\*\\{2,%s\\} +.*$&quot;&#xA;               endless/init.org-message-depth))&#xA;      (message &quot;%s&quot; (match-string 0)))&#xA;     ;; Evaluate Code Blocks&#xA;     ((looking-at &quot;^#\\+BEGIN_SRC +emacs-lisp.*$&quot;)&#xA;      (let ((l (match-end 0)))&#xA;        (search-forward &quot;\n#+END_SRC&quot;)&#xA;        (eval-region l (match-beginning 0))))&#xA;     ;; Finish on the next level-1 header&#xA;     ((looking-at &quot;^\\* &quot;)&#xA;      (goto-char (point-max))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-11-05T11:07:01.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3147" PostTypeId="2" ParentId="3143" CreationDate="2014-11-05T11:10:15.873" Score="54" Body="&lt;p&gt;Yes, you certainly can, you can use &lt;code&gt;org-babel-load-file&lt;/code&gt; to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your &lt;code&gt;init.el&lt;/code&gt;, put the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;(org-babel-load-file&#xA; (expand-file-name &quot;settings.org&quot;&#xA;                   user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I'm using ~/.emacs.d/settings.org but that is personal preference). In the &lt;code&gt;settings.org&lt;/code&gt; file you can arrange it however you would like, wrapping elisp in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Turn off menu bar&#xA;#+BEGIN_SRC emacs-lisp&#xA;(menu-bar-mode -1)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you start Emacs, it will automatically determine if the settings.org file has changed, and if needed, tangle it to produce a &lt;code&gt;settings.el&lt;/code&gt; file which will be loaded.&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2014-11-05T11:10:15.873" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3148" PostTypeId="2" ParentId="3145" CreationDate="2014-11-05T11:11:34.083" Score="15" Body="&lt;p&gt;If you are writing C/C++/Java/Emacs Lisp/Python, then &lt;a href=&quot;http://tuhdo.github.io/c-ide.html#sec-9-2&quot; rel=&quot;noreferrer&quot;&gt;semantic-sticky-func-mode&lt;/a&gt; will do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: This seems to be working with CEDET from Git, not stock CEDET currently in Emacs 24.4. To get Emacs from Git:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;git clone &lt;a href=&quot;http://git.code.sf.net/p/cedet/git&quot; rel=&quot;noreferrer&quot;&gt;http://git.code.sf.net/p/cedet/git&lt;/a&gt; cedet&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And load CEDET first above everything else in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file (concat user-emacs-directory &quot;/cedet/cedet-devel-load.el&quot;))&#xA;(add-to-list 'load-path (concat user-emacs-directory &quot;cedet/contrib&quot;))&#xA;(load-file (concat user-emacs-directory &quot;cedet/contrib/cedet-contrib-load.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When enable, this mode shows the function point is currently in at the first line of the current buffer. This is useful when you have a very long function that spreads more than a screen, and you don't have to scroll up to read the function name and then scroll down to original position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It displays &lt;strong&gt;full&lt;/strong&gt; function interface (return type, function name and parameters), not just function name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable it, put this code in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'semantic)&#xA;(semantic-mode 1)&#xA;(global-semantic-stickyfunc-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: One of the problem with current &lt;code&gt;semantic-stickyfunc-mode&lt;/code&gt; is that it does not display all parameters that are scattered on multiple lines. To solve this problem, I created the package &lt;a href=&quot;https://github.com/tuhdo/semantic-stickyfunc-enhance&quot; rel=&quot;noreferrer&quot;&gt;stickyfunc-enhance&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;DEMO&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a demo in C:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8YNYQ.gif&quot; alt=&quot;semantic-sticky-func-mode-c&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a demo in Emacs Lisp:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/T66DP.gif&quot; alt=&quot;semantic-sticky-func-mode-elisp&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Alternatively, you can use &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-9&quot; rel=&quot;noreferrer&quot;&gt;helm-semantic-or-imenu&lt;/a&gt;. When you are inside a function and run the command, the cursor is placed right at the function in the list, so you can always see the full function interface. DEMO:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First, I use &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; to move to the function &lt;code&gt;helm-define-key-with-subkeys&lt;/code&gt; and move point there.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then, I start &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; again and &lt;code&gt;helm-define-key-with-subkeys&lt;/code&gt; is pre-selected.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then, I move point to the variable helm-map and execute &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; again on two function: helm-next-source and helm-previous-source. This time, instead of showing the current semantic tag I'm operating in (which is helm-map), it shows the other two tags in Helm Semantic buffer. This is because I supplied a prefix argument before running the command. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also this demo is in Emacs Lisp, it works for C/C++ as well and it's more flexible if you got a really long function interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tffBD.gif&quot; alt=&quot;helm-semantic-or-imenu&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-03-13T10:56:15.657" LastActivityDate="2015-03-13T10:56:15.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3149" PostTypeId="1" AcceptedAnswerId="3150" CreationDate="2014-11-05T11:13:01.930" Score="5" ViewCount="407" Body="&lt;p&gt;I'm trying to develop a &lt;code&gt;git&lt;/code&gt; hook that warns me if any files that belong to a repo are unsaved in the editor. For that I need a list of open files/buffers and their state, so basically a non-interactive version of &lt;code&gt;(list-buffers)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run Emacs in server mode so I know I can do &lt;code&gt;emacsclient -e '(command)'&lt;/code&gt;, but how do I dump the list of current buffers?&lt;/p&gt;&#xA;" OwnerUserId="2425" LastEditorUserId="504" LastEditDate="2014-11-05T11:51:31.247" LastActivityDate="2014-11-05T11:51:31.247" Title="How to non-interactively dump list of open buffers, associated filenames and saved/unsaved state?" Tags="|elisp|buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3150" PostTypeId="2" ParentId="3149" CreationDate="2014-11-05T11:51:00.560" Score="6" Body="&lt;p&gt;The function &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-List.html#index-buffer_002dlist-2189&quot;&gt;&lt;code&gt;buffer-list&lt;/code&gt;&lt;/a&gt; returns a list of buffers. Call &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Modification.html#index-buffer_002dmodified_002dp-2168&quot;&gt;&lt;code&gt;buffer-modified-p&lt;/code&gt;&lt;/a&gt; to test if a buffer has been modified and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-File-Name.html#index-buffer_002dfile_002dname-2158&quot;&gt;&lt;code&gt;buffer-file-name&lt;/code&gt;&lt;/a&gt; to test if a buffer is visiting a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following snippet from the code of &lt;code&gt;save-buffers-kill-emacs&lt;/code&gt; tests if there are any unsaved open files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(memq t (mapcar (function&#xA;                  (lambda (buf) (and (buffer-file-name buf)&#xA;                                     (buffer-modified-p buf))))&#xA;                (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Rather than enumerate all buffers, you may be better off testing only the buffers that are visiting files that are about to be committed. You can call &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-File-Name.html#index-find_002dbuffer_002dvisiting-2163&quot;&gt;&lt;code&gt;find-buffer-visiting&lt;/code&gt;&lt;/a&gt; to get the buffer visiting a particular file, if any. Thus, given a list of file names in &lt;code&gt;filenames&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((unsaved 0))&#xA;  (mapc (lambda (filename)&#xA;          (let ((buffer (find-buffer-visiting filename)))&#xA;            (when filename&#xA;              (setq unsaved (1+ unsaved))&#xA;              (princ (concat &quot;File not saved: &quot; filename &quot;\n&quot;)))))&#xA;        filenames)&#xA;  (when (&amp;gt; unsaved 0)&#xA;    (printc &quot;There were unsaved files, aborting\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs 24, it's possible to make &lt;code&gt;emacsclient&lt;/code&gt; exit with a nonzero status, but this doesn't look easy: you have to &lt;a href=&quot;https://superuser.com/questions/295156/how-to-set-the-exit-status-for-emacsclient/542916#542916&quot;&gt;send the &lt;code&gt;die&lt;/code&gt; command to the appropriate client&lt;/a&gt; of which there can be many. Anyway &lt;code&gt;emacsclient&lt;/code&gt; could also fail because there's no running Emacs, which is a success condition for you. So I suggest to check whether &lt;code&gt;emacsclient&lt;/code&gt; emits output on stdout.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;files=&#xA;for x; do&#xA;  files=&quot;$files \&quot;`absolute_path &quot;$x&quot; | sed 's/[\\\\\\\&quot;]/\\\\&amp;amp;/g'`\&quot;&quot;&#xA;done&#xA;unsaved=$(emacsclient -e '(let ((filenames ('&quot;$files&quot;'))) …)' 2&amp;gt;/dev/null)&#xA;if [ -n &quot;$unsaved&quot; ]; then&#xA;  echo &quot;$unsaved&quot;&#xA;  exit 1&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-11-05T11:51:00.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3151" PostTypeId="2" ParentId="3145" CreationDate="2014-11-05T12:07:32.603" Score="6" Body="&lt;p&gt;You can turn on &lt;code&gt;which-function-mode&lt;/code&gt; by doing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;which-function-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the setting permanent, add&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(which-function-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init-file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Toggle mode line display of current function (Which Function mode). [...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Which Function mode is a global minor mode.  &lt;strong&gt;When enabled, the&#xA;  current function name is continuously displayed in the mode line&lt;/strong&gt;,&#xA;  in certain major modes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The name doesn't really suggest it, but this works not only for &quot;functions&quot;, but for other types of scopes as well. For example, in &lt;code&gt;org-mode&lt;/code&gt;, &lt;code&gt;which-function-mode&lt;/code&gt; displays the heading of the current subtree.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-22T19:57:24.207" LastActivityDate="2015-01-22T19:57:24.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3152" PostTypeId="2" ParentId="2582" CreationDate="2014-11-05T13:23:14.080" Score="4" Body="&lt;p&gt;On my system (Fedora 20) the default cabal version that comes with the &lt;code&gt;haskell-platform&lt;/code&gt; package is &lt;code&gt;1.16.0.2&lt;/code&gt;.  After installing the latest &lt;code&gt;cabal-install&lt;/code&gt; (&lt;code&gt;cabal install cabal-install&lt;/code&gt;), I have a new cabal binary in &lt;code&gt;~/.cabal/bin/cabal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I don't do any particular configuration in Emacs, &lt;code&gt;haskell-interactive-bring&lt;/code&gt; will fail with the same error you report.  When I correct the path to the cabal binary, though, everything works just fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq haskell-process-path-cabal &quot;~/.cabal/bin/cabal&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make sure that Emacs uses the correct cabal executable.  If it does not, try setting &lt;code&gt;haskell-process-path-cabal&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-11-05T13:23:14.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3153" PostTypeId="2" ParentId="3143" CreationDate="2014-11-05T14:47:17.173" Score="4" Body="&lt;p&gt;On the following SO answer you will see how to do it, example projects using one single org file or many, what's the benefit of using Cask and links to documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/25430029/whats-the-best-way-to-package-my-emacs-installation-packages-and-config-so-tha/25430745#25430745&quot;&gt;https://stackoverflow.com/questions/25430029/whats-the-best-way-to-package-my-emacs-installation-packages-and-config-so-tha/25430745#25430745&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I turned my config to org a few months ago, and I am not totally satisfied with it. It requires some config and reading of the org manual to have a useful org file that makes it easy to edit elisp code. One has to enable src block fontifying (off by default -&gt; use a per-file variable), check that other modes don't conflict for editing src blocks (auto-fill mode), etc. One doesn't want to use C-c &lt;code&gt;(backtick) (&lt;/code&gt;org-edit-src-block`) to edit a src block. And it gets a little bit in the way for debug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice would be: start by breaking your init file into small elisp pieces, try some narrowing package out there, use &lt;code&gt;helm-swoop&lt;/code&gt; for quick navigation, and then consider using &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-11-05T14:47:17.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3154" PostTypeId="1" AcceptedAnswerId="3162" CreationDate="2014-11-05T14:51:12.387" Score="14" ViewCount="606" Body="&lt;p&gt;I just discovered &lt;code&gt;C-x 8 RET&lt;/code&gt; as a way to insert Unicode characters by Unicode name or hex code.  I have not (yet?) memorised all Unicode character names, so I don't always find the right character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is, for example, the character &quot;SNOW CAPPED MOUNTAIN&quot;.  If I type just &quot;MOUNTAIN&quot; this character will not appear the completion list.  I need to remember to search for &quot;SNOW&quot; to see this particular character in the list of completions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As someone who has become dependent on IDO for anything involving completion, this lack of flexibility is rather unnerving.  I use &lt;code&gt;ido-ubiquitous-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use IDO-like matching for Unicode input?  How can I use flexible completion for &lt;em&gt;ALL THE THINGS&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I would be okay with abandoning IDO mode if there was something better.)&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="25" LastEditDate="2014-11-11T22:18:10.257" LastActivityDate="2023-07-14T10:34:44.413" Title="Fuzzy completion when inserting Unicode characters" Tags="|ido|unicode|completion|" AnswerCount="5" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3155" PostTypeId="2" ParentId="2902" CreationDate="2014-11-05T15:14:04.577" Score="3" Body="&lt;p&gt;Tramp uses the auth-sources backend for managing passwords. It needs some specialized entries in .authinfo, like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; machine melancholia port scp login daniel password geheim&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Read the Tramp manual, chapter &quot;Password handling&quot;, for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;auth-sources have also some functionality to create password entries on-the-fly. I've never tried this functionality with Tramp, but maybe you investigate a little bit.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2014-11-05T15:14:04.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3156" PostTypeId="1" AcceptedAnswerId="3160" CreationDate="2014-11-05T15:43:45.063" Score="10" ViewCount="1407" Body="&lt;p&gt;I wanted to look at different portions of a buffer in two different frames, as I have two monitors of different shapes that I can't easily span a single frame over. Some googling led me to use &lt;code&gt;clone-indirect-buffer&lt;/code&gt;, which works nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;buffer-file-name&lt;/code&gt; for the new buffer is &lt;code&gt;nil&lt;/code&gt;. How can I reliably determine the filename of the original buffer (that this one is a clone of)?&lt;/p&gt;&#xA;" OwnerUserId="753" LastEditorUserId="25" LastEditDate="2014-11-11T22:14:51.563" LastActivityDate="2014-11-11T22:14:51.563" Title="How should I get the filename of the original buffer in an indirect cloned buffer?" Tags="|buffers|files|indirect-buffers|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3157" PostTypeId="2" ParentId="2884" CreationDate="2014-11-05T15:52:03.627" Score="47" Body="&lt;p&gt;I found this SO post: &lt;a href=&quot;https://stackoverflow.com/questions/944614/emacs-does-hideshow-work-with-xml-mode-sgml-mode&quot;&gt;https://stackoverflow.com/questions/944614/emacs-does-hideshow-work-with-xml-mode-sgml-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'hideshow)&#xA;(require 'sgml-mode)&#xA;(require 'nxml-mode)&#xA;&#xA;(add-to-list 'hs-special-modes-alist&#xA;             '(nxml-mode&#xA;               &quot;&amp;lt;!--\\|&amp;lt;[^/&amp;gt;]*[^/]&amp;gt;&quot;&#xA;               &quot;--&amp;gt;\\|&amp;lt;/[^/&amp;gt;]*[^/]&amp;gt;&quot;&#xA;&#xA;               &quot;&amp;lt;!--&quot;&#xA;               sgml-skip-tag-forward&#xA;               nil))&#xA;&#xA;&#xA;&#xA;(add-hook 'nxml-mode-hook 'hs-minor-mode)&#xA;&#xA;;; optional key bindings, easier than hs defaults&#xA;(define-key nxml-mode-map (kbd &quot;C-c h&quot;) 'hs-toggle-hiding)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use the code from there, slightly modified, for nxml-mode easily. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will allow you to toggle hiding/unhiding of xml elements with &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;h&lt;/kbd&gt; and will support underscores in the names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/e8ub0.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-05-22T22:10:02.760" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3158" PostTypeId="2" ParentId="3156" CreationDate="2014-11-05T15:54:09.380" Score="4" Body="&lt;p&gt;This is an indirect answer to your question -- I'm not sure how to figure out what the original buffer's filename is without doing the following. &lt;em&gt;(EDIT: @purple_arrows's answer fills in the details: you can use &lt;code&gt;buffer-base-buffer&lt;/code&gt;.  Please accept that answer as most correct.)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following piece of advice will associate the original buffer's filename with each of its indirect clones:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice clone-indirect-buffer (around associate-filename activate)&#xA;  &quot;Associate the original filename with the cloned buffer.&quot;&#xA;  (let ((filename buffer-file-name))&#xA;    ad-do-it&#xA;    (setq buffer-file-name filename)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, each of the clones has the same filename as the original buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use indirectly-cloned buffers a lot, and like to be able to, eg, save the associated file when I'm working with &lt;em&gt;any&lt;/em&gt; of the buffers, rather than the original.  This piece of advice was my solution to that desired workflow.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-05T16:02:32.370" LastActivityDate="2014-11-05T16:02:32.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3160" PostTypeId="2" ParentId="3156" CreationDate="2014-11-05T15:57:39.500" Score="14" Body="&lt;p&gt;I keep the Emacs manual and Elisp manual on speed dial for questions like these.&lt;/p&gt;&#xA;&lt;p&gt;From the Elisp manual &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Indirect-Buffers.html&quot; rel=&quot;noreferrer&quot;&gt;on indirect buffers&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Function: buffer-base-buffer &amp;amp;optional buffer&lt;/p&gt;&#xA;&lt;p&gt;This function returns the base buffer of buffer, which defaults to the current buffer. If buffer is not indirect, the value is nil. Otherwise, the value is another buffer, which is never an indirect buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You probably want &lt;code&gt;(buffer-file-name (buffer-base-buffer))&lt;/code&gt; or something like that.&lt;/p&gt;&#xA;" OwnerUserId="372" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-11-05T15:57:39.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3162" PostTypeId="2" ParentId="3154" CreationDate="2014-11-05T16:21:44.577" Score="9" Body="&lt;p&gt;As @wasamasa suggested, &lt;code&gt;ido-ubiquitous&lt;/code&gt; should take care of completion when &lt;code&gt;insert-char&lt;/code&gt; is used.  There is a &lt;a href=&quot;https://github.com/DarwinAwardWinner/ido-ubiquitous/issues/38&quot; rel=&quot;nofollow&quot;&gt;bug report that was closed in 2013&lt;/a&gt;, but I still see this behaviour with Emacs 24.4 and &lt;code&gt;ido-ubiquitous&lt;/code&gt; version 20140904.1547, so I filed another &lt;a href=&quot;https://github.com/DarwinAwardWinner/ido-ubiquitous/issues/56&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maintainer of &lt;code&gt;ido-ubiquitous&lt;/code&gt; wrote this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Ok, I figured out the problem. There are a lot of unicode characters, so the list of completions is exceeding &lt;code&gt;ido-ubiquitous-max-items&lt;/code&gt; and &lt;code&gt;ido-ubiquitous&lt;/code&gt; is disabling itself for that reason. On my system, there are almost 40k completions available, and the default for &lt;code&gt;ido-ubiquitous-max-items&lt;/code&gt; is 30k. Setting it to 50k enables &lt;code&gt;ido&lt;/code&gt; completion for &lt;code&gt;insert-char&lt;/code&gt; for me. So try customizing that.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed, &lt;code&gt;(setq ido-ubiquitous-max-items 50000)&lt;/code&gt; fixes it.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="504" LastEditDate="2015-01-13T08:50:38.907" LastActivityDate="2015-01-13T08:50:38.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3163" PostTypeId="2" ParentId="3154" CreationDate="2014-11-05T18:13:33.423" Score="5" Body="&lt;p&gt;To get &lt;code&gt;snow capped mountain&lt;/code&gt; included when you just type &lt;code&gt;mount&lt;/code&gt;, you may want to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(unicode-name (styles substring)) completion-category-overrides)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually, maybe this &lt;code&gt;substring&lt;/code&gt; style should be enabled by default for unicode names, like it is for buffer names.  Maybe you should lobby for it via &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-05T18:13:33.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3166" PostTypeId="1" AcceptedAnswerId="9960" CreationDate="2014-11-05T19:35:09.903" Score="7" ViewCount="4029" Body="&lt;p&gt;When I press &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-r&lt;/kbd&gt; to print the clock report I get something like the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Clock summary at [2014-11-05 Wed 13:33]&#xA;&#xA;| Headline     | Time   |&#xA;|--------------+--------|&#xA;| *Total time* | *0:01* |&#xA;|--------------+--------|&#xA;| test         | 0:01   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that I have many entries at the same level. Like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     * test&#xA;     CLOCK: [2014-11-05 Wed 13:13]--[2014-11-05 Wed 13:13] =&amp;gt;  0:00&#xA;     CLOCK: [2014-11-05 Wed 13:08]--[2014-11-05 Wed 13:09] =&amp;gt;  0:01&#xA;     CLOCK: [2014-11-05 Wed 13:08]--[2014-11-05 Wed 13:08] =&amp;gt;  0:00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org-mode only recognizes details in sub-trees like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Haha&#xA;  #+BEGIN: clocktable :maxlevel 2 :scope subtree :timestamp t&#xA;  Clock summary at [2014-11-05 Wed 13:44]&#xA;&#xA;  | Timestamp            | Headline     | Time   |      |&#xA;  |----------------------+--------------+--------+------|&#xA;  |                      | *Total time* | *0:03* |      |&#xA;  |----------------------+--------------+--------+------|&#xA;  |                      | Haha         | 0:03   |      |&#xA;  | 2014-11-05 Wed 13:40 | \__ test     |        | 0:03 |&#xA;  #+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to print all the details within the same level, that is, all the clock entries and the length of each period?&lt;/p&gt;&#xA;" OwnerUserId="130" LastEditorUserId="45" LastEditDate="2014-11-09T04:32:21.013" LastActivityDate="2015-06-04T14:28:59.007" Title="Clock Table Details in Org Mode" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3167" PostTypeId="2" ParentId="3154" CreationDate="2014-11-05T19:39:47.713" Score="3" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then &lt;code&gt;C-x 8 RET&lt;/code&gt; lets you use &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Apropos_Completions&quot; rel=&quot;nofollow&quot;&gt;substring or regexp&lt;/a&gt; or &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Fuzzy_Completion&quot; rel=&quot;nofollow&quot;&gt;fuzzy&lt;/a&gt; matching during completion.  And you can use &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow&quot;&gt;progressive &lt;/a&gt;completion, to match against multiple (e.g. simple) patterns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, if option &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Customization_and_General_Tips#icicle-read-char-by-name-multi-completion-flag&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-read-char-by-name-multi-completion-flag&lt;/code&gt;&lt;/a&gt; is non-&lt;code&gt;nil&lt;/code&gt;, which it is by default, then you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi-Completions&quot; rel=&quot;nofollow&quot;&gt;multi-completion&lt;/a&gt; to match against any combination of these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the Unicode &lt;em&gt;name&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;the Unicode &lt;em&gt;code point&lt;/em&gt;, as a hexidecimal numeral&lt;/li&gt;&#xA;&lt;li&gt;the &lt;em&gt;character&lt;/em&gt; itself (as it appears in text, not an integer)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Completion candidates you see in buffer &lt;code&gt;*Completions*&lt;/code&gt; contain all of these components - WYSIWYG.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why might you want to match against the &lt;em&gt;character&lt;/em&gt; itself?&#xA;To see the corresponding Unicode code points and character name(s),&#xA;including any old names.  For example, for the character &lt;code&gt;`&lt;/code&gt;&#xA;(grave accent) you get these two completion candidates:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GRAVE ACCENT      60      `&#xA;SPACING GRAVE     60      `&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-05T21:25:51.720" LastActivityDate="2014-11-05T21:25:51.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3168" PostTypeId="1" CreationDate="2014-11-05T21:04:03.390" Score="4" ViewCount="1475" Body="&lt;p&gt;I have a custom &lt;code&gt;comment-dwim-line&lt;/code&gt; command that I want to bind to the key combination &lt;code&gt;C-M-;&lt;/code&gt; (in other words, &lt;code&gt;control&lt;/code&gt;, &lt;code&gt;meta&lt;/code&gt; and &lt;code&gt;;&lt;/code&gt; buttons pressed simultaneously). The built-in &lt;code&gt;comment-dwim&lt;/code&gt; command is bound to &lt;code&gt;M-;&lt;/code&gt; by default, and I want to keep this binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-M-;&quot; 'comment-dwim-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which throws &lt;code&gt;global-set-key: Key sequence RET - ; starts with non-prefix key RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-\M-;&quot; 'comment-dwim-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which throws &lt;code&gt;load-with-code-conversion: Invalid modifier in string&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;C-\M-;&quot; 'comment-dwim-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which throws &lt;code&gt;global-set-key: Key sequence C - M-; starts with non-prefix key C&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [?\C-M-;] 'next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which throws &lt;code&gt;read--expression: Invalid read syntax: &quot;?&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [?\C-\M-;] 'next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which throws &lt;code&gt;Symbol's value as variable is void: M-&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-M-;&quot;) 'comment-dwim-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does not throw an error, but the key binding has no effect: when I actually press &lt;code&gt;C-M-;&lt;/code&gt; it behaves the same as &lt;code&gt;M-;&lt;/code&gt;(default &lt;code&gt;comment-dwim&lt;/code&gt; is called).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.4 on Mac OS X 10.10, running in iTerm2.&lt;/p&gt;&#xA;" OwnerUserId="2431" LastEditorUserId="25" LastEditDate="2014-11-11T22:47:35.490" LastActivityDate="2019-01-15T18:47:56.377" Title="Custom C-M-; key binding" Tags="|key-bindings|terminal-emacs|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3169" PostTypeId="2" ParentId="3168" CreationDate="2014-11-05T21:28:21.450" Score="4" Body="&lt;p&gt;Your terminal likely translates &lt;code&gt;C-M-;&lt;/code&gt; to &lt;code&gt;M-;&lt;/code&gt;. Try testing it out in GUI Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it works in the GUI, you'll know it's iTerm2 causing the issue.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-11-05T21:28:21.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3170" PostTypeId="2" ParentId="3168" CreationDate="2014-11-05T21:28:38.343" Score="1" Body="&lt;p&gt;You forgot a backslash, &lt;code&gt;\&lt;/code&gt;, before &lt;code&gt;M&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [?\C-\M-;] 'next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This one is OK (except you forgot the final &lt;code&gt;)&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-M-;&quot;) 'comment-dwim-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This one does not work for &lt;code&gt;;&lt;/code&gt; (but it would work for &lt;code&gt;&quot;\C-\M-y&quot;&lt;/code&gt;, for instance).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;\C-\M-;&quot; 'comment-dwim-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Finally, you say:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;C-M-;&quot;) 'comment-dwim-line)&lt;/code&gt;&#xA;  does not throw an error, but the key binding has no effect: when I actually press &lt;code&gt;C-M-;&lt;/code&gt; it behaves the same as &lt;code&gt;M-;&lt;/code&gt; (default &lt;code&gt;comment-dwim&lt;/code&gt; is called).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't see that.  Do you see this problem if you start Emacs using &lt;code&gt;emacs -Q&lt;/code&gt; (no init file)? If so, provide a step-by-step recipe, starting with &lt;code&gt;emacs -Q&lt;/code&gt; to reproduce it.  If not, bisect your init file to find the culprit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works fine for me, on MS Windows, with all versions of Emacs (20 and later):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;emacs -Q --debug-init -nw&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Evaluate this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comment-dwim-line () (interactive) (message &quot;FOOOOOOOOO&quot;))&#xA;(global-set-key (kbd &quot;C-M-;&quot;) 'comment-dwim-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-h k C-M-;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-M-;&lt;/code&gt; runs the command &lt;code&gt;comment-dwim-line&lt;/code&gt; (found in &lt;code&gt;global-map&lt;/code&gt;), which&#xA;  is an interactive Lisp function.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;C-M-;&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(comment-dwim-line)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Not documented.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-M-;&lt;/code&gt; shows the message &lt;code&gt;FOOOOOOOOO&lt;/code&gt; in the echo area.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorDisplayName="user12563" LastEditDate="2019-01-15T18:47:56.377" LastActivityDate="2019-01-15T18:47:56.377" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="3171" PostTypeId="1" AcceptedAnswerId="3172" CreationDate="2014-11-06T00:39:36.750" Score="16" ViewCount="3235" Body="&lt;p&gt;Is there a function I can call that opens my init file for editing or returns its path?&lt;/p&gt;&#xA;" OwnerUserId="870" LastEditorUserId="105" LastEditDate="2022-01-14T18:10:23.860" LastActivityDate="2022-01-14T18:10:23.860" Title="Function to open my init file for editing or return its path" Tags="|init-file|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3172" PostTypeId="2" ParentId="3171" CreationDate="2014-11-06T00:56:20.370" Score="26" Body="&lt;p&gt;See the variable &lt;code&gt;user-init-file&lt;/code&gt; described in section &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Init-File.html&quot;&gt;38.1.2 The Init File&lt;/a&gt; of the Emacs Lisp manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this variable it is easy to build an interactive command that opens the init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-open-init-file ()&#xA;  &quot;Open the init file.&quot;&#xA;  (interactive)&#xA;  (find-file user-init-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-06T05:11:22.910" LastActivityDate="2014-11-06T05:11:22.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3173" PostTypeId="1" AcceptedAnswerId="3174" CreationDate="2014-11-06T06:02:11.587" Score="12" ViewCount="704" Body="&lt;p&gt;I frequently extract a rectangle of text from a buffer, but then find I want to yank the text as if it was not a rectangle.  Is there a way to add the current killed rectangle to the kill ring?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html&quot;&gt;GNU Emacs Manual&lt;/a&gt; has this to say:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;“Killing” a rectangle is not killing in the usual sense; the rectangle&#xA;  is not stored in the kill ring, but in a special place that only&#xA;  records the most recent rectangle killed. This is because yanking a&#xA;  rectangle is so different from yanking linear text that different yank&#xA;  commands have to be used. Yank-popping is not defined for rectangles.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, I can basically get the behavior I want with&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-&amp;gt;&lt;/code&gt;     go to end of buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x r y&lt;/code&gt; yank rectangle&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-x&lt;/code&gt; exchange point and mark (selects newly-yanked lines)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-w&lt;/code&gt;     kill the selection to the kill ring&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to turn a killed rectangle into a kill-ring entry?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2017-02-13T06:34:19.157" Title="How to copy killed rectangle to the kill ring" Tags="|rectangle|kill-ring|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3174" PostTypeId="2" ParentId="3173" CreationDate="2014-11-06T06:30:26.463" Score="7" Body="&lt;p&gt;If I understood your question, your are looking to something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun youngfrog/copy-rectangle-to-kill-ring (start end)&#xA;  &quot;Saves a rectangle to the normal kill ring. Not suitable for yank-rectangle.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((lines (extract-rectangle start end)))&#xA;    (with-temp-buffer&#xA;      (while lines ;; insert-rectangle, but without the unneeded stuff&#xA;        ;; (most importantly no push-mark)&#xA;        (insert-for-yank (car lines))&#xA;        (insert &quot;\n&quot;)&#xA;        (setq lines (cdr lines)))&#xA;      (kill-ring-save (point-min) (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_copy_rectangle_text_to_clipboard.html&quot;&gt;ErgoEmacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-11-06T06:30:26.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3175" PostTypeId="1" AcceptedAnswerId="3176" CreationDate="2014-11-06T08:31:56.227" Score="6" ViewCount="4104" Body="&lt;p&gt;For posting code to stackexchange I repeatedly have to do indentation in emacs. I mark a piece of text and then do M-X indent-rigidly four times. Is there an elegant way to do this indentation of text by four blanks in one go?&lt;/p&gt;&#xA;" OwnerUserId="2440" LastEditorUserId="105" LastEditDate="2015-05-14T00:38:35.823" LastActivityDate="2015-05-19T13:29:20.547" Title="Repeating a command n times" Tags="|key-bindings|indentation|commands|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3176" PostTypeId="2" ParentId="3175" CreationDate="2014-11-06T08:50:47.110" Score="9" Body="&lt;p&gt;The documentation for &lt;code&gt;indent-rigidly&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If called from a program, or interactively with prefix ARG, indent all&#xA;  lines starting in the region forward by ARG columns. If called from a&#xA;  program, START and END specify the beginning and end of the text to&#xA;  act on, in place of the region.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To indent by four columns, just pass the prefix argument with &lt;code&gt;C-u&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u C-x TAB&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-11-06T08:50:47.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3177" PostTypeId="2" ParentId="3175" CreationDate="2014-11-06T10:58:05.480" Score="0" Body="&lt;p&gt;I've written this snippet when Stack Overflow for some reason stopped&#xA;recognizing lisp syntax in the code blocks. Might be useful:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun stackoverflow-block (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((str (buffer-substring-no-properties beg end)))&#xA;    (delete-region beg end)&#xA;    (insert&#xA;     &quot;&amp;lt;!-- language: lang-lisp --&amp;gt;\n\n&quot;&#xA;     (mapconcat&#xA;      (lambda (x) (format &quot;    %s&quot; x))&#xA;      (split-string str &quot;\n&quot;)&#xA;      &quot;\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-06T10:58:05.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3178" PostTypeId="1" AcceptedAnswerId="3407" CreationDate="2014-11-06T12:52:38.523" Score="1" ViewCount="69" Body="&lt;p&gt;When editing an Autoconf (&lt;code&gt;configure.ac&lt;/code&gt;) file I observe strange behaviour when using &lt;code&gt;M-;&lt;/code&gt; (&lt;code&gt;comment-dwim&lt;/code&gt;) to uncomment a selected region. When a region with comments is selected &lt;code&gt;comment-dwim&lt;/code&gt; calls &lt;code&gt;uncomment-region&lt;/code&gt;, so maybe the problem is in that function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commenting a region works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# ACML&#xA;AC_SEARCH_LIBS(dgemm, acml_mp,&#xA;   [found_blas=1 AM_CPPFLAGS=&quot;-D_acml_ $AM_CPPFLAGS&quot;],&#xA;   [AC_MSG_NOTICE([NOT using AMD the ACML library])],&#xA;   [-lgfortran]&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dnl # ACML&#xA;dnl AC_SEARCH_LIBS(dgemm, acml_mp,&#xA;dnl    [found_blas=1 AM_CPPFLAGS=&quot;-D_acml_ $AM_CPPFLAGS&quot;],&#xA;dnl    [AC_MSG_NOTICE([NOT using AMD the ACML library])],&#xA;dnl    [-lgfortran]&#xA;dnl )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when trying to uncomment the region, the result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dnl ACML&#xA;dnl AC_SEARCH_LIBS(dgemm, acml_mp,&#xA;   [found_blas=1 AM_CPPFLAGS=&quot;-D_acml_ $AM_CPPFLAGS&quot;],&#xA;dnl    [AC_MSG_NOTICE([NOT using AMD the ACML library])],&#xA;   [-lgfortran]&#xA;dnl )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Did I miss something or have I hit a bug?&lt;/p&gt;&#xA;" OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-06T14:37:44.167" LastActivityDate="2014-11-11T22:42:40.603" Title="Weird behaviour of M-; (`comment-dwim`) in Autoconf-mode" Tags="|comment|autoconf-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3179" PostTypeId="1" AcceptedAnswerId="3320" CreationDate="2014-11-06T13:06:01.893" Score="6" ViewCount="679" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I make &lt;code&gt;org-mode&lt;/code&gt; read the time in timestamps intelligently?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; uses &lt;code&gt;org-read-date&lt;/code&gt; (which in turn relies on &lt;code&gt;parse-time-string&lt;/code&gt;) to create/modify timestamps, scheduled items, and deadlines.  I'm trying to figure out how to make it smarter when it reads in the time of an event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can enter times:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;on a 24-hour clock (&lt;code&gt;9:00&lt;/code&gt; =&gt; 9:00AM, &lt;code&gt;21:00&lt;/code&gt; =&gt; 9:00PM), or&lt;/li&gt;&#xA;&lt;li&gt;with AM or PM suffixes (&lt;code&gt;9am&lt;/code&gt; =&gt; 9:00AM, &lt;code&gt;9pm&lt;/code&gt; =&gt; 9:00PM).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That's all well and good, but here's where I'd like it to be smarter in a DWIM fashion.  There are whole stretches of the day during which, on a 12-hour clock, I &lt;em&gt;always&lt;/em&gt; mean PM (ie, for times in the middle of the night).  For example, if I enter &lt;code&gt;2:00&lt;/code&gt;, I &lt;em&gt;always&lt;/em&gt; mean &quot;2:00PM&quot;, but on the 24-hour clock it means &quot;2:00AM&quot;.  The problem is that I commonly forget to append the &lt;code&gt;pm&lt;/code&gt; part, and then my agenda informs me that the meeting I have for 2:00 in the afternoon is actually scheduled for 2:00 in the morning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: how can I convince &lt;code&gt;org-read-date&lt;/code&gt; to accept a range of times to mean PM unless I explicitly add the &lt;code&gt;am&lt;/code&gt; suffix?  I'd like to be able to enter any time from, say, &lt;code&gt;1:00&lt;/code&gt; to &lt;code&gt;6:59&lt;/code&gt; and have it mean 1:00PM to 6:59PM unless I explicitly enter something like &lt;code&gt;1:00am&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NB:&lt;/em&gt; see &lt;a href=&quot;https://emacs.stackexchange.com/questions/2589/how-to-make-org-mode-understand-alternate-day-month-abbreviations&quot;&gt;this related thread&lt;/a&gt; on getting &lt;code&gt;org-mode&lt;/code&gt; to understand alternative day/month abbreviations.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-11-11T02:16:53.217" Title="How to make org-mode DWIM when it reads times in timestamps?" Tags="|org-mode|parse-time|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3180" PostTypeId="1" AcceptedAnswerId="3181" CreationDate="2014-11-06T13:21:10.573" Score="7" ViewCount="1140" Body="&lt;p&gt;I use &lt;a href=&quot;https://bitbucket.org/jpkotta/openwith&quot;&gt;&lt;code&gt;openwith&lt;/code&gt;&lt;/a&gt; to open images and a number of other types of files in external applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works a treat, but gets in the way of displaying inline images in &lt;code&gt;org-mode&lt;/code&gt; buffers: When I do &lt;kbd&gt;C-c C-x C-v&lt;/kbd&gt; (&lt;code&gt;org-toggle-inline-images&lt;/code&gt;) with &lt;code&gt;openwith-mode&lt;/code&gt; turned on, the first image file linked in the current buffer is opened in an external viewer. The contents of the buffer itself don't change, i.e., no images are displayed inside the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I stop &lt;code&gt;openwith-mode&lt;/code&gt; from interfering with the display of inline images in &lt;code&gt;org-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-04-09T09:53:35.297" Title="Org-mode: Can't display inline images when openwith-mode is turned on" Tags="|org-mode|images|openwith|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3181" PostTypeId="2" ParentId="3180" CreationDate="2014-11-06T13:21:10.573" Score="5" Body="&lt;p&gt;Internally, &lt;code&gt;org-toggle-inline-images&lt;/code&gt; calls &lt;code&gt;org-display-inline-images&lt;/code&gt; to handle display of inline images. You can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;advise&lt;/a&gt; this function to turn off &lt;code&gt;openwith-mode&lt;/code&gt; while it is doing its thing, and to turn it back on afterwards:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice org-display-inline-images&#xA;  (around handle-openwith&#xA;          (&amp;amp;optional include-linked refresh beg end) activate compile)&#xA;  (if openwith-mode&#xA;      (progn&#xA;        (openwith-mode -1)&#xA;        ad-do-it&#xA;        (openwith-mode 1))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place, no external viewers are opened when doing &lt;kbd&gt;C-c C-x C-v&lt;/kbd&gt; in an &lt;code&gt;org-mode&lt;/code&gt; buffer containing inline images.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-04-09T09:53:35.297" LastActivityDate="2015-04-09T09:53:35.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3182" PostTypeId="1" CreationDate="2014-11-06T13:34:07.353" Score="1" ViewCount="124" Body="&lt;p&gt;I just realised (after playing with different colour themes) that &lt;code&gt;bmkp-desktop-jump&lt;/code&gt; from &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmarks+&lt;/a&gt; changes the colour theme to the one selected before - this is nice, but can cause unwanted effects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, these questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Where is the colour theme stored? I could not find it in the &lt;code&gt;bookmarks&lt;/code&gt; file, and it's also not in the &lt;code&gt;.emacs.desktop&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I disable this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Can I disable this for certain bookmarks?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="225" LastEditorUserId="25" LastEditDate="2014-11-12T04:02:52.163" LastActivityDate="2014-11-12T04:02:52.163" Title="Why does bmkp-desktop-jump change colour scheme?" Tags="|themes|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3183" PostTypeId="1" AcceptedAnswerId="3185" CreationDate="2014-11-06T13:48:43.267" Score="11" ViewCount="3441" Body="&lt;p&gt;I am using the ample theme and I quite like it, but I can't see the mouser pointer when moving over emacs and emacs is activated; as the emacs background and the mouse pointer are black, I would like to have the mouse pointer in e.g. red. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the colour of the mouse pointer?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, Carbon Version 157 AppKit 1343.14) of 2014-10-27 on Rainers-MBP-4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OS X Yosemite&lt;/p&gt;&#xA;" OwnerUserId="225" LastEditorUserId="25" LastEditDate="2014-11-11T22:21:09.627" LastActivityDate="2014-11-11T22:21:09.627" Title="How to change the mouse pointer colour?" Tags="|themes|mouse|colors|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3184" PostTypeId="2" ParentId="3183" CreationDate="2014-11-06T14:05:28.977" Score="3" Body="&lt;p&gt;Perhaps you want to customize the face:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-face RET mouse RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2014-11-06T14:11:37.570" LastActivityDate="2014-11-06T14:11:37.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3185" PostTypeId="2" ParentId="3183" CreationDate="2014-11-06T14:17:51.390" Score="14" Body="&lt;p&gt;Just found &lt;a href=&quot;http://www.emacswiki.org/emacs/PointerShape&quot;&gt;this&lt;/a&gt;, did not tried it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-mouse-color &quot;red&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-11-06T14:17:51.390" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3186" PostTypeId="5" CreationDate="2014-11-06T14:41:22.917" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-06T14:41:22.917" LastActivityDate="2014-11-06T14:41:22.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3187" PostTypeId="4" CreationDate="2014-11-06T14:41:22.917" Score="0" Body="Major mode for editing Autoconf configure.ac files." OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-06T22:10:49.010" LastActivityDate="2014-11-06T22:10:49.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3188" PostTypeId="5" CreationDate="2014-11-06T14:44:14.490" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-06T14:44:14.490" LastActivityDate="2014-11-06T14:44:14.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3189" PostTypeId="4" CreationDate="2014-11-06T14:44:14.490" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-06T14:44:14.490" LastActivityDate="2014-11-06T14:44:14.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3190" PostTypeId="5" CreationDate="2014-11-06T14:47:19.630" Score="0" Body="&lt;p&gt;This is an RPN calculator featuring arbitrary-precision integer, rational, floating-point, complex, matrix, and symbolic arithmetic.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;RPN calculation:  2 RET 3 +    produces 5.&lt;/li&gt;&#xA;&lt;li&gt;Algebraic style:  ' 2+3 RET    produces 5.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Basic operators are +, -, *, /, ^, &amp;amp; (reciprocal), % (modulo), n (change-sign).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;?&lt;/code&gt; repeatedly for more complete help.  Press &lt;code&gt;h i&lt;/code&gt; to read the Calc manual on-line, &lt;code&gt;h s&lt;/code&gt; to read the summary, or &lt;code&gt;h t&lt;/code&gt; for the tutorial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;3.14e6     3.14 * 10^6&lt;/li&gt;&#xA;&lt;li&gt;_23        negative number -23 (or type `23 n')&lt;/li&gt;&#xA;&lt;li&gt;17:3       the fraction 17/3&lt;/li&gt;&#xA;&lt;li&gt;5:2:3      the fraction 5 and 2/3&lt;/li&gt;&#xA;&lt;li&gt;16#12C     the integer 12C base 16 = 300 base 10&lt;/li&gt;&#xA;&lt;li&gt;8#177:100  the fraction 177:100 base 8 = 127:64 base 10&lt;/li&gt;&#xA;&lt;li&gt;(2, 4)     complex number 2 + 4i&lt;/li&gt;&#xA;&lt;li&gt;(2; 4)     polar complex number (r; theta)&lt;/li&gt;&#xA;&lt;li&gt;[1, 2, 3]  vector  ([[1, 2], [3, 4]] is a matrix)&lt;/li&gt;&#xA;&lt;li&gt;[1 .. 4)   semi-open interval, 1 &amp;lt;= x &amp;lt; 4&lt;/li&gt;&#xA;&lt;li&gt;2 +/- 3    (p key) number with mean 2, standard deviation 3&lt;/li&gt;&#xA;&lt;li&gt;2 mod 3    (M key) number 2 computed modulo 3&lt;/li&gt;&#xA;&lt;li&gt;&amp;lt;1 jan 91&gt; Date form (enter using ' key)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-06T18:14:56.257" LastActivityDate="2014-11-06T18:14:56.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3191" PostTypeId="4" CreationDate="2014-11-06T14:47:19.630" Score="0" Body="Calculator mode: Calculator major mode." OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-07T05:34:32.783" LastActivityDate="2014-11-07T05:34:32.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3192" PostTypeId="1" CreationDate="2014-11-06T15:27:08.433" Score="0" ViewCount="35" Body="&lt;p&gt;Anybody know why this may be occurring?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an outline of how I recreate the issue...&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I copy or kill something to my kill ring.&lt;/li&gt;&#xA;&lt;li&gt;I scroll up or down with the mouse.&lt;/li&gt;&#xA;&lt;li&gt;I then yank and get an unexpected chunk of code&lt;/li&gt;&#xA;&lt;li&gt;Pressing &lt;code&gt;M-y&lt;/code&gt; steps back one position in the kill ring and I get what I wanted to yank.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is my config file. Something in there must be doing it I'm guessing.&lt;/p&gt;&#xA;" OwnerUserId="512" LastActivityDate="2014-11-06T15:32:14.593" Title="Scrolling seems to add an unwanted chunk into my kill ring" Tags="|init-file|copy-paste|debugging|scrolling|kill-ring|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3193" PostTypeId="2" ParentId="3192" CreationDate="2014-11-06T15:32:14.593" Score="2" Body="&lt;p&gt;You didn't post your config file.  But instead of posting it, do this: Start from &lt;code&gt;emacs -Q&lt;/code&gt;, that is, with no init file. If you do not see the problematic behavior, then do this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recursively bisect your init file (by commenting-out blocks of code), until you narrow the problem down to find just what is causing it. You can use &lt;code&gt;comment-region&lt;/code&gt; to comment out code: first 1/2, then 3/4, then 7/8 of the code, etc.  Use &lt;code&gt;C-u&lt;/code&gt; with &lt;code&gt;comment-region&lt;/code&gt; to uncomment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing you can try, but don't bother until you have narrowed things down (and at that point you probably will not need to try this) is to use &lt;code&gt;M-x debug-on-entry kill-new&lt;/code&gt;, to see what code is pushing the unexpected entries to your &lt;code&gt;kill-ring&lt;/code&gt;. Just look at the backtrace to see what is happening, or step through the debugger using &lt;code&gt;d&lt;/code&gt;, if you want. Use &lt;code&gt;q&lt;/code&gt; to exit the debugger. Use &lt;code&gt;M-x cancel-debug-on-entry&lt;/code&gt; to cancel using the debugger.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-06T15:32:14.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3194" PostTypeId="2" ParentId="3182" CreationDate="2014-11-06T15:41:19.340" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/cgi-bin/wiki/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; does nothing with color themes.  And as far as I know, neither does &lt;code&gt;desktop.el&lt;/code&gt; do anything with them.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;See whether changing the value of option &lt;code&gt;bmkp-desktop-jump-save-before-flag&lt;/code&gt; makes any difference (I don't think it will).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;However, starting with Emacs 24.4, &lt;code&gt;desktop.el&lt;/code&gt; can save also frame and window configurations (e.g. frame parameters, which includes face &lt;code&gt;default&lt;/code&gt;). If you are using Emacs 24.4 or later then check which desktop file you are using. You can use any number of desktop files with &lt;strong&gt;Bookmark+&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Check the particular bookmark(s) that lead to this behavior.  You can use &lt;code&gt;M-x debug-on-entry bmkp-jump-1&lt;/code&gt; to step through the debugger using &lt;code&gt;d&lt;/code&gt; (and &lt;code&gt;c&lt;/code&gt; to skip through obvious steps). (Be sure to load the &lt;strong&gt;source&lt;/strong&gt; files before using the debugger - it is not so useful if only byte-compiled files are loaded.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If after investigating you think the behavior really is due to &lt;strong&gt;Bookmark+&lt;/strong&gt; then you can follow up with me by email (see the file header).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-06T22:47:18.080" LastActivityDate="2014-11-06T22:47:18.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3195" PostTypeId="2" ParentId="3175" CreationDate="2014-11-06T16:32:43.550" Score="5" Body="&lt;p&gt;Besides the obvious answer of using a prefix arg to specify the number of columns to indent (i.e., &lt;code&gt;C-4 C-x TAB&lt;/code&gt;), if you use Emacs 24.4 or later then you can simply use arrow keys to repeat indenting, i.e., to incrementally indent. E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x TAB &amp;lt;right&amp;gt; &amp;lt;right&amp;gt; &amp;lt;right&amp;gt;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use Shift with &lt;code&gt;&amp;lt;right&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;left&amp;gt;&lt;/code&gt; then each repetition indents by a tab stop. Without Shift, each repetition indents by one column.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-06T16:32:43.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3196" PostTypeId="2" ParentId="3168" CreationDate="2014-11-06T16:44:22.667" Score="1" Body="&lt;p&gt;Terminal emulators do not forward all possible key combinations to the shell, so Emacs likely does not see &lt;code&gt;C-M-;&lt;/code&gt; when used in the terminal.  You can visualize the command processed by your terminal emulator (iTerm2 in your case) by pressing &lt;code&gt;C+v&lt;/code&gt; (&lt;code&gt;CTRL&lt;/code&gt;+&lt;code&gt;v&lt;/code&gt;) in the terminal, followed by a key combination.  For &lt;code&gt;C-v C-M-;&lt;/code&gt; I get with the XFCE terminal under Linux&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ^[;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is the same as &lt;code&gt;M-;&lt;/code&gt;, so the &lt;code&gt;CTRL&lt;/code&gt; key is basically ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible workaround is to define an alternate key combination in Emacs, let us say &lt;code&gt;C-c M-;&lt;/code&gt;, and to instruct iTerm2 to forward this combination when you press &lt;code&gt;C-M-;&lt;/code&gt;.  This way you can use the keys that you want in iTerm2, but Emacs will behave as if you pressed &lt;code&gt;C-M-;&lt;/code&gt;.  I have done this previously, but I do not have a Mac at hand right now to search for the iTerm2 options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;Just found this related question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/977&quot;&gt;Shift+Up isn't recognized by Emacs in a terminal&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2019" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-11-06T16:51:35.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3197" PostTypeId="1" AcceptedAnswerId="3208" CreationDate="2014-11-06T17:40:01.477" Score="12" ViewCount="2934" Body="&lt;p&gt;Suppose I've got an assoc-list like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x '((foo . ((bar . &quot;llama&quot;)&#xA;                  (baz . &quot;monkey&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I want the value at &lt;code&gt;bar&lt;/code&gt;. I can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assoc-default 'bar (assoc-default 'foo x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what I'd really like is something that accepts multiple keys, like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assoc-multi-key 'foo 'bar x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does such a thing exist, perhaps in a package somewhere? I'm sure I could write it, but I feel like my Google-fu is just failing and I can't find it.&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="330" LastEditDate="2014-11-07T01:16:31.847" LastActivityDate="2014-11-07T01:16:31.847" Title="Best way to retrieve values in nested assoc-lists?" Tags="|elisp|association-lists|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3198" PostTypeId="2" ParentId="3171" CreationDate="2014-11-06T18:20:44.000" Score="3" Body="&lt;p&gt;One simple alternative would be to add a bookmark for your init file (&lt;code&gt;bookmark-set&lt;/code&gt;, bound to &lt;code&gt;C-x r m&lt;/code&gt; by default).  Then you can use &lt;code&gt;bookmark-jump&lt;/code&gt; (&lt;code&gt;C-x r b&lt;/code&gt;) to return to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you enable &lt;code&gt;recentf-mode&lt;/code&gt; and use either Helm, or Ido with the &lt;code&gt;ido-use-virtual-buffers&lt;/code&gt; mode, then switching to any recent file is as quick as &lt;code&gt;C-x b &amp;lt;filename&amp;gt;&lt;/code&gt;.  After enabling this and setting &lt;code&gt;recentf-max-saved-items&lt;/code&gt; to a nice high value (1000), I practically never even think about whether a file is already open or not -- everything is accessible through a single key binding all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't so helpful if you use Emacs on multiple systems which put the init file in different places, or if you don't edit your &lt;code&gt;init.el&lt;/code&gt; frequently (but what kind of Emacs user would that be true of?!?)&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastActivityDate="2014-11-06T18:20:44.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3199" PostTypeId="2" ParentId="3197" CreationDate="2014-11-06T18:25:33.257" Score="0" Body="&lt;p&gt;Here's a simple function that works with an alist nested inside another alist:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun assoc2 (outer inner alist)&#xA;  &quot;`assoc', but for an assoc list inside an assoc list.&quot;&#xA;  (assoc inner (assoc outer alist)))&#xA;&#xA;(setq alist2 '((puppies (tail . &quot;waggly&quot;) (ears . &quot;floppy&quot;))&#xA;               (kitties (paws . &quot;fuzzy&quot;)  (coat . &quot;sleek&quot;))))&#xA;&#xA;(assoc2 'kitties 'coat alist2)       ;; =&amp;gt; (coat . &quot;sleek&quot;)&#xA;(cdr (assoc2 'kitties 'coat alist2)) ;; =&amp;gt; &quot;sleek&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-06T18:25:33.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3200" PostTypeId="1" CreationDate="2014-11-06T18:26:05.230" Score="1" ViewCount="304" Body="&lt;p&gt;I'm trying to get started using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;, but I'm wondering if &lt;code&gt;ido&lt;/code&gt; is interfering with functionality. So far:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I installed Icicles from the repo and added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'icicles)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I used &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;customize&lt;/code&gt; to turn off &lt;code&gt;ido&lt;/code&gt;, resulting in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(ido-mode nil nil (ido))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the &lt;code&gt;custom-set-variables&lt;/code&gt; section of &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Restarted Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now, running &lt;code&gt;C-h c&lt;/code&gt; &lt;code&gt;C-x C-f&lt;/code&gt; gives me the result of&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-x C-f&lt;/code&gt; runs the command &lt;code&gt;ido-find-file&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, the EmacsWiki page on Icicles says this command should have been automatically remapped to &lt;code&gt;icicle-file&lt;/code&gt;. There are some other functions that also don't seem to be working. By contrast, though, &lt;code&gt;C-h c&lt;/code&gt; &lt;code&gt;M-x&lt;/code&gt; results in&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; runs the command &lt;code&gt;icicle-execute-extended-command&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How do I fix this?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="504" LastEditDate="2014-11-06T18:45:57.333" LastActivityDate="2014-11-07T03:49:23.660" Title="Invoking &quot;Icicles&quot;" Tags="|ido|icicles|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3201" PostTypeId="2" ParentId="3197" CreationDate="2014-11-06T18:28:05.137" Score="3" Body="&lt;p&gt;Here's a more generic solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun assoc-multi-key (path nested-alist)&#xA;   &quot;Find element in nested alist by path.&quot;&#xA;   (if (equal nested-alist nil)&#xA;       (error &quot;cannot lookup in empty list&quot;))&#xA;   (let ((key (car path))&#xA;         (remainder (cdr path)))&#xA;     (if (equal remainder nil)&#xA;         (assoc key nested-alist)&#xA;       (assoc-multi-key remainder (assoc key nested-alist)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It can take any &quot;path&quot; of keys.  This will return &lt;code&gt;(bar . &quot;llama&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assoc-multi-key '(foo bar)&#xA;    '((foo (bar . &quot;llama&quot;) (baz . &quot;monkey&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;whereas this will return &lt;code&gt;(baz . &quot;monkey&quot;)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assoc-multi-key '(foo bar baz)&#xA;    '((foo (bar (bozo . &quot;llama&quot;) (baz . &quot;monkey&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-11-06T18:55:39.080" LastActivityDate="2014-11-06T18:55:39.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3202" PostTypeId="1" CreationDate="2014-11-06T20:00:02.373" Score="8" ViewCount="1160" Body="&lt;p&gt;Right now, I have my Emacs frame vertically split, and am looking at two different buffers in the two windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to go to a word in one buffer, hit some keys, and have the ocurrences of that word (if any) highlighted in the &lt;em&gt;other&lt;/em&gt; buffer, scrolling to it if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5Ci8C.png&quot; alt=&quot;Screenshot to explain&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the screenshot above, with my cursor just before &quot;bar&quot; in the left buffer, I'd like to be able to &amp;lt;do something&amp;gt; and quickly see where &quot;bar&quot; is in the right buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note: This is related to &lt;a href=&quot;https://emacs.stackexchange.com/questions/737/how-do-i-find-text-across-multiple-open-buffers&quot;&gt;How do I find text across multiple open buffers?&lt;/a&gt; in the sense that, if I could do an isearch across the &quot;other&quot; buffer, it would do what I want. But none of the answers there are exactly what I want:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;code&gt;occur&lt;/code&gt; based solutions open a new window that shows matching lines, while I'd like to keep my two windows still displayed -- I'm actually going to be looking in the other buffer for context &lt;em&gt;around&lt;/em&gt; the match, so showing only the matching line is not very helpful.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;multi-isearch-buffers&lt;/code&gt; requires me to specify the list of buffers every time I want to do this search (a lot of times), instead of automatically picking it up as the two displayed buffers. More importantly, when I start from one window and perform the isearch, when it finds the match in the other buffer it displays that buffer in this window, so that both windows display the same (other) buffer. Then C-g puts everything back, and I can't see the word highlighted in the other buffer any more.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;icicle-search&lt;/code&gt; has so many features that one of them may be able to do this, but I wasn't able to find anything after a cursory look at the documentation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="862" LastActivityDate="2014-11-07T16:13:31.677" Title="Highlighting text in open (displayed) buffers/windows -- searching for text from one buffer in another" Tags="|buffers|search|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3203" PostTypeId="1" AcceptedAnswerId="3205" CreationDate="2014-11-06T20:06:17.490" Score="12" ViewCount="1408" Body="&lt;p&gt;I found this code in the manual &lt;code&gt;An Introduction to Programming in Emacs Lisp&lt;/code&gt; demonstrating recursion with the help of &lt;code&gt;cond&lt;/code&gt; function to find out the number of pebbles based on the entered number of rows, i.e. if rows = 2, then pebbles should be 3, if 4 rows then it should be 10 pebbles there. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun triangle-using-cond (number)&#xA;  (cond ((&amp;lt;= number 0) 0)&#xA;        ((= number 1) 1)&#xA;        ((&amp;gt; number 1)&#xA;         (+ number (triangle-using-cond (1- number))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;evaluate to 10 after passing argument 4:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(triangle-using-cond 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The manual did not explain clearly what happens at each step in this example code in particular and I couldn't figure out how recursion works here. Can you pls help me understand the mechanics &lt;em&gt;step-by-step&lt;/em&gt; what happens at each instance?  &lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="50" LastEditDate="2014-11-06T20:25:48.113" LastActivityDate="2015-04-24T16:39:42.413" Title="How to understand this recursion code?" Tags="|elisp|learning|" AnswerCount="5" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3204" PostTypeId="2" ParentId="3202" CreationDate="2014-11-06T20:25:21.193" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://emacs-helm.github.io/helm/&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm&lt;/a&gt; has interfaces that can accomplish this goal, I've recorded a Gifcast to demonstrate the &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm-swoop&lt;/a&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/dgoBHL7.gif&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After starting the &lt;code&gt;helm-swoop&lt;/code&gt; search I can either narrow down to less candidates by entering further space-separated tokens or hit &lt;code&gt;C-p&lt;/code&gt; and &lt;code&gt;C-n&lt;/code&gt; to switch to the next one &lt;em&gt;and&lt;/em&gt; scroll in the target buffer at the same time.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-11-06T20:41:37.860" LastActivityDate="2014-11-06T20:41:37.860" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3205" PostTypeId="2" ParentId="3203" CreationDate="2014-11-06T20:32:26.827" Score="15" Body="&lt;h2&gt;Using &quot;printf debugging&quot;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You could let Emacs help you understand by modifying the function definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun triangle-using-cond (number)&#xA;  (message (format &quot;called with %d&quot; number))&#xA;  (cond ((&amp;lt;= number 0) 0)&#xA;        ((= number 1) 1)&#xA;        ((&amp;gt; number 1)&#xA;         (+ number (triangle-using-cond (1- number))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just add &lt;code&gt;(message ...)&lt;/code&gt; somewhere to have a trail printed to the &lt;code&gt;*Messages*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Using Edebug&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Place point anywhere inside the function definition and hit &lt;code&gt;C-u C-M-x&lt;/code&gt; to &quot;instrument&quot; it.  Then evaluate the function, e.g. by placing point after &lt;code&gt;(triangle-using-cond 3)&lt;/code&gt; and hitting &lt;code&gt;C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are now in Edebug mode.  Hit the space bar to step through the function.  The intermediate values of each expression are shown in the echo area.  To exit Edebug mode just hit &lt;code&gt;q&lt;/code&gt;.  To remove the instrumentation, put point anywhere inside the definition and hit &lt;code&gt;C-M-x&lt;/code&gt; to re-evaluate the definition.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Using the standard Emacs debugger&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x debug-on-entry triangle-using-cond&lt;/code&gt;&lt;/strong&gt;, then, when &lt;code&gt;triangle-using-cond&lt;/code&gt; is invoked, you are placed in the Emacs debugger (buffer &lt;code&gt;*Backtrace*&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step through the evaluation using &lt;strong&gt;&lt;code&gt;d&lt;/code&gt;&lt;/strong&gt; (or &lt;code&gt;c&lt;/code&gt; to skip through any uninteresting evaluations).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see intermediate state (variable values, etc.) you can use &lt;code&gt;e&lt;/code&gt; anytime. You are prompted to enter a sexp to evaluate, and the evaluation result is printed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While you use the debugger, keep a copy of the source code visible in another frame, so you can follow what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also insert explicit calls to enter the debugger (more or less breakpoints) at arbitrary places in the source code.  You insert &lt;code&gt;(debug)&lt;/code&gt; or &lt;code&gt;(debug nil SOME-SEXP-TO-EVALUATE)&lt;/code&gt;. In the latter case, when the debugger is entered &lt;code&gt;SOME-SEXP-TO-EVALUATE&lt;/code&gt; is evaluated and the result is printed. (Remember that you can insert such code into the source code and use &lt;code&gt;C-M-x&lt;/code&gt; to evaluate it, then undo - you need not save the edited file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Debugger.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Using Debugger&lt;/code&gt;&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Recursion as a loop&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Anyway, think of recursion as a loop.  There are two termination cases defined: &lt;code&gt;(&amp;lt;= number 0)&lt;/code&gt; and &lt;code&gt;(= number 1)&lt;/code&gt;.  In these cases the function returns a simple number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the recursive case the function returns the sum of that number and the result of the function with &lt;code&gt;number - 1&lt;/code&gt;.  Eventually, the function will be called with either &lt;code&gt;1&lt;/code&gt; or  a number smaller than or equal to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The recursive case result is hence:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ number (+ (1- number) (+ (1- (1- number)) ... 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Take for example &lt;code&gt;(triangle-using-cond 4)&lt;/code&gt;.  Let's accumulate the final expression:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;in the first iteration &lt;code&gt;number&lt;/code&gt; is &lt;code&gt;4&lt;/code&gt;, so the &lt;code&gt;(&amp;gt; number 1)&lt;/code&gt; branch is followed.  We start building an expression &lt;code&gt;(+ 4 ...&lt;/code&gt; and call the function with &lt;code&gt;(1- 4)&lt;/code&gt;, i.e. &lt;code&gt;(triangle-using-cond 3)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;now &lt;code&gt;number&lt;/code&gt; is &lt;code&gt;3&lt;/code&gt;, and the result is &lt;code&gt;(+ 3 (triangle-using-cond 2))&lt;/code&gt;.  The total result expression is &lt;code&gt;(+ 4 (+ 3 (triangle-using-cond 2)))&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;number&lt;/code&gt; is &lt;code&gt;2&lt;/code&gt; now, so the expression is &lt;code&gt;(+ 4 (+ 3 (+ 2 (triangle-using-cond 1))))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;number&lt;/code&gt; is &lt;code&gt;1&lt;/code&gt; now, and we take the &lt;code&gt;(= number 1)&lt;/code&gt; branch, resulting in a boring &lt;code&gt;1&lt;/code&gt;.  The whole expression is &lt;code&gt;(+ 4 (+ 3 (+ 2 1)))&lt;/code&gt;.  Evaluate that from the inside out and you get: &lt;code&gt;(+ 4 (+ 3 3))&lt;/code&gt;, &lt;code&gt;(+ 4 6)&lt;/code&gt;, or just &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="105" LastEditDate="2015-04-24T16:39:42.413" LastActivityDate="2015-04-24T16:39:42.413" CommentCount="8" CommunityOwnedDate="2015-04-24T08:09:35.953" ContentLicense="CC BY-SA 3.0" />
  <row Id="3206" PostTypeId="2" ParentId="3203" CreationDate="2014-11-06T20:37:25.460" Score="2" Body="&lt;p&gt;The calculation steps for your example would be like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(4 +               ;; step 1&#xA;   (3 +            ;; step 2&#xA;      (2 +         ;; step 3&#xA;         (1))))    ;; step 4&#xA;=&amp;gt; 10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The 0 condition is actually never met because 1 as an input already ends the recursion.&lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="330" LastEditDate="2014-11-06T20:49:14.877" LastActivityDate="2014-11-06T20:49:14.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3207" PostTypeId="2" ParentId="3203" CreationDate="2014-11-06T21:15:12.497" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.5&quot;&gt;The Substitution Model for Procedure Application&lt;/a&gt;&#xA;from SICP can explain the algorithm to understanding code like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote some code to facilitate this as well.&#xA;&lt;code&gt;lispy-flatten&lt;/code&gt; from &lt;a href=&quot;https://github.com/abo-abo/lispy&quot;&gt;lispy&lt;/a&gt; package does this.&#xA;Here's the result of applying &lt;code&gt;lispy-flatten&lt;/code&gt; to &lt;code&gt;(triangle-using-cond 4)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond ((&amp;lt;= 4 0)&#xA;       0)&#xA;      ((= 4 1)&#xA;       1)&#xA;      ((&amp;gt; 4 1)&#xA;       (+ 4 (triangle-using-cond (1- 4)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can simplify the above expression to just:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 4 (triangle-using-cond 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then flatten once more:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 4 (cond ((&amp;lt;= 3 0)&#xA;            0)&#xA;           ((= 3 1)&#xA;            1)&#xA;           ((&amp;gt; 3 1)&#xA;            (+ 3 (triangle-using-cond (1- 3))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The final result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 4 (+ 3 (+ 2 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-06T21:15:12.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3208" PostTypeId="2" ParentId="3197" CreationDate="2014-11-06T21:38:18.817" Score="17" Body="&lt;p&gt;Here's an option which takes the exact syntax that you asked for but in a generalized way, and is quite simple to understand. The only difference is that the &lt;code&gt;ALIST&lt;/code&gt; parameter needs to come first (you could adapt it to come last, if that's important to you).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun assoc-recursive (alist &amp;amp;rest keys)&#xA;  &quot;Recursively find KEYs in ALIST.&quot;&#xA;  (while keys&#xA;    (setq alist (cdr (assoc (pop keys) alist))))&#xA;  alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can call it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assoc-recursive x 'foo 'bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-06T21:38:18.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3209" PostTypeId="1" CreationDate="2014-11-06T21:39:56.687" Score="6" ViewCount="1005" Body="&lt;p&gt;I use emacs in the terminal, typically with many emacs instances running at once in different tabs. This is a perfect use case for emacsclient, but it has always had various glitches that have stopped me from using it. In particular, sometimes one client will &quot;block&quot; the other, preventing it from doing anything. It looks like things work better in emacs 24.4, but it still happens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if I start two clients, and run &lt;code&gt;M-g M-g&lt;/code&gt; in one, to get the &quot;Goto line&quot; entry, the other client will be completely locked down until I quit in the first one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using emacs 24.4 compiled without windowed support in Mac OS X 10.10 (in iTerm 2). I can reproduce it by starting &lt;code&gt;emacs --daemon -Q&lt;/code&gt;. If you want the exact emacs binary I am using, download &lt;a href=&quot;http://conda.pydata.org/miniconda.html&quot; rel=&quot;noreferrer&quot;&gt;Miniconda&lt;/a&gt; for OS X and run &lt;code&gt;conda install -c asmeurer emacs&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="25" LastEditDate="2014-11-12T04:34:25.843" LastActivityDate="2023-11-22T11:56:00.910" Title="Prevent emacsclient from blocking other instances" Tags="|emacsclient|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3210" PostTypeId="1" AcceptedAnswerId="3212" CreationDate="2014-11-06T21:49:01.897" Score="1" ViewCount="1224" Body="&lt;p&gt;CEDET prevents me from doing &lt;code&gt;M-x load-file&lt;/code&gt; &lt;code&gt;init.el&lt;/code&gt; with the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;progn: CEDET Version 2.0 already loaded.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I modify my CEDET load line to load conditionally? The current line looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;~/.emacs.d/cedet/cedet-devel-load.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24" LastActivityDate="2014-11-13T18:47:12.177" Title="Reload init.el without restart, with CEDET" Tags="|init-file|cedet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3211" PostTypeId="1" CreationDate="2014-11-06T22:13:17.413" Score="10" ViewCount="819" Body="&lt;p&gt;Classic use-case:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You start recording a macro: &lt;code&gt;C-x (&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;You do some stuff, let's say &lt;code&gt;hello&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You run a command that throws an error, let's say &lt;code&gt;C-g&lt;/code&gt; (e.g. you mistakenly run &lt;code&gt;C-s&lt;/code&gt; and you have to cancel that with &lt;code&gt;C-g&lt;/code&gt;, now your work is lost).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now your recording so far is lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to resume where I left off before I ran a command which interrupted my recording. I looked at &lt;code&gt;C-h f start-kbd-macro&lt;/code&gt;, but it's written in C, so I can't tweak it. I also hunted around for a variable like &lt;code&gt;current-kbd-macro&lt;/code&gt;, but found none so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can it be recovered?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't figure out why &lt;code&gt;C-u C-x (&lt;/code&gt; wasn't working for me, but I've discovered it's because I was testing with &lt;code&gt;C-g&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out that &lt;code&gt;C-g&lt;/code&gt; is special -- if you trigger a different kind of error e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x ( M-: (signal 'quit nil) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then this will stop the recording, but &lt;code&gt;last-kbd-macro&lt;/code&gt; will contain &lt;code&gt;&quot;M-: M-( signal 'quit nil&quot;&lt;/code&gt;, but with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x ( C-g&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This stops recording and discards anything recorded. As a C-g-happy user (as are at least two of my friends), this is a rather unfortunate distinction. I tried editing &lt;code&gt;keyboard-quit&lt;/code&gt;, but there's nothing I can do in there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like the only way to recover this is via &lt;code&gt;recent-keys&lt;/code&gt; and automatically figuring out where a start-kbd-macro (or similar) was called, as in &lt;code&gt;kmacro-edit-lossage&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2445" LastEditorUserId="2445" LastEditDate="2014-11-07T13:27:17.187" LastActivityDate="2019-11-03T00:35:51.200" Title="How to resume an INCOMPLETE keyboard macro recording?" Tags="|keyboard-macros|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3212" PostTypeId="2" ParentId="3210" CreationDate="2014-11-06T22:17:27.477" Score="3" Body="Simplest method&#xA;&#xA;&lt;p&gt;Assuming you're not worried about it not being available because the file is missing/in error&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ignore-errors&#xA;  (load-file &quot;~/.emacs.d/cedet/cedet-devel-load.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will bypass the error and allow you to continue loading.&lt;/p&gt;&#xA;&#xA;Require instead of load&#xA;&#xA;&lt;p&gt;Looking at &lt;code&gt;cedet-devel-load.el&lt;/code&gt; on &lt;a href=&quot;https://github.com/emacsmirror/cedet/blob/master/cedet-devel-load.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacsmirror/cedet/blob/master/cedet-devel-load.el&lt;/a&gt; the last line is &lt;code&gt;(provide 'cedet-devel-load)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means you can replace your load line with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If you haven't already added it to load path above&#xA;(add-to-list 'load-path &quot;~/.emacs.d/cedet&quot;)&#xA;(require 'cedet-devel-load)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will use the library and ensure you do not have to worry about it being loaded more than the initial time.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2014-11-13T18:47:12.177" LastActivityDate="2014-11-13T18:47:12.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3213" PostTypeId="2" ParentId="3203" CreationDate="2014-11-06T22:22:08.130" Score="3" Body="&lt;p&gt;This is not specific to Emacs / Elisp, but if you have a mathematics background, then &lt;a href=&quot;http://okasaki.blogspot.com/2008/10/score-one-for-induction.html&quot; rel=&quot;nofollow&quot;&gt;recursion is like mathematical induction&lt;/a&gt;. (Or if you don't: then when you learn induction, it's like recursion!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start with the definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun triangle-using-cond (number)&#xA;  (cond ((&amp;lt;= number 0) 0)&#xA;        ((= number 1) 1)&#xA;        ((&amp;gt; number 1)&#xA;         (+ number (triangle-using-cond (1- number))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;number&lt;/code&gt; is &lt;code&gt;4&lt;/code&gt;, neither of the first two conditions hold, so it's evaluated according to the third condition:&lt;br&gt;&#xA;&lt;code&gt;(triangle-using-cond 4)&lt;/code&gt; is evaluated as&lt;br&gt;&#xA;&lt;code&gt;(+ number (triangle-using-cond (1- number)))&lt;/code&gt;, namely as&lt;br&gt;&#xA;&lt;code&gt;(+ 4 (triangle-using-cond 3))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly,&lt;br&gt;&#xA;&lt;code&gt;(triangle-using-cond 3)&lt;/code&gt; is evaluated as&lt;br&gt;&#xA;&lt;code&gt;(+ 3 (triangle-using-cond 2))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly,&#xA;&lt;code&gt;(triangle-using-cond 2)&lt;/code&gt; is evaluated as&lt;br&gt;&#xA;&lt;code&gt;(+ 2 (triangle-using-cond 1))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for &lt;code&gt;(triangle-using-cond 1)&lt;/code&gt;, the second condition holds, and it is evaluated as &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A piece of advice for anyone learning recursion: try to avoid&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the common beginner mistake of trying to think about what happens during the recursive call instead of trusting that the recursive call works (sometimes called the recursive leap of faith).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you're trying to convince yourself whether &lt;code&gt;(triangle-using-cond 4)&lt;/code&gt; will return the correct answer, just &lt;em&gt;assume&lt;/em&gt; that &lt;code&gt;(triangle-using-cond 3)&lt;/code&gt; will return the right answer, and verify whether it will be correct in that case. Of course you have to verify the base case too.&lt;/p&gt;&#xA;" OwnerUserId="862" LastActivityDate="2014-11-06T22:22:08.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3214" PostTypeId="2" ParentId="3211" CreationDate="2014-11-06T22:57:34.823" Score="0" Body="&lt;p&gt;The canonical solution is &lt;kbd&gt;C-x C-k C-e&lt;/kbd&gt; (&lt;code&gt;kmacro-edit-macro&lt;/code&gt;) which will allow you to step through each key-press and insert/delete whatever you want. The command syntax for the editor is a little terse but &lt;code&gt;?&lt;/code&gt; will bring up a guide. There is a more natural editor bound to &lt;kbd&gt;C-x C-k e&lt;/kbd&gt; (&lt;code&gt;edit-kbd-macro&lt;/code&gt;) which gives a plain text macro editor with commentary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;insert-kbd-macro&lt;/code&gt; which will allow you to edit the macro as Lisp but it's not the most readable thing in the world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as variables are concerned you are looking for &lt;code&gt;last-kbd-macro&lt;/code&gt; and &lt;code&gt;kmacro-ring&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you mention you haven't completed your macro, you can just create it from your lossage. &lt;kbd&gt;C-x C-k e&lt;/kbd&gt; &lt;kbd&gt;C-h l&lt;/kbd&gt; and delete up to 300 preceding characters.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="504" LastEditDate="2014-11-07T09:02:22.507" LastActivityDate="2014-11-07T09:02:22.507" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3215" PostTypeId="2" ParentId="3211" CreationDate="2014-11-07T00:05:23.723" Score="2" Body="&lt;p&gt;Execute &lt;code&gt;kmacro-start-macro-or-insert-counter&lt;/code&gt; with prefix (&lt;code&gt;C-u&lt;/code&gt;) to append to the previous macro.&lt;/p&gt;&#xA;" OwnerUserId="24" LastActivityDate="2014-11-07T00:05:23.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3216" PostTypeId="1" AcceptedAnswerId="3217" CreationDate="2014-11-07T01:12:43.293" Score="6" ViewCount="900" Body="&lt;p&gt;Before Emacs 24.4, indentation in &lt;code&gt;c-mode&lt;/code&gt; happened after typing things like &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;,&lt;/code&gt; and so on and I like this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in Emacs 24.4, &lt;code&gt;c-mode&lt;/code&gt; also indents on &lt;kbd&gt;RET&lt;/kbd&gt;. This causes a lot of problems for me because if I want to insert a blank line, I need to press &lt;kbd&gt;RET&lt;/kbd&gt; and then delete any spaces or tabs that &lt;code&gt;electric-&lt;/code&gt; inserts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would like to disable indent on &lt;kbd&gt;RET&lt;/kbd&gt;, but keep all other electric-indent functionality, like indent on &lt;code&gt;;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried calling &lt;code&gt;(electric-indent-local-mode -1)&lt;/code&gt; in &lt;code&gt;c-mode&lt;/code&gt; hooks,&#xA;but this disabled not only indent on &lt;kbd&gt;RET&lt;/kbd&gt;, but also indent on &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;,&lt;/code&gt; and so on.&lt;/p&gt;&#xA;" OwnerUserId="2448" LastEditorUserId="25" LastEditDate="2014-11-12T04:55:36.227" LastActivityDate="2014-11-12T04:55:36.227" Title="Customizing c-mode indentation behavior in Emacs 24.4" Tags="|indentation|emacs24.4|cc-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3217" PostTypeId="2" ParentId="3216" CreationDate="2014-11-07T01:52:14.267" Score="4" Body="&lt;p&gt;You could rebind &lt;code&gt;RET&lt;/code&gt; to &lt;code&gt;electric-indent-just-newline&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c-mode-hook&#xA;          (lambda() (local-set-key (kbd &quot;&amp;lt;RET&amp;gt;&quot;) 'electric-indent-just-newline)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="330" LastEditorUserId="330" LastEditDate="2014-11-07T17:47:20.407" LastActivityDate="2014-11-07T17:47:20.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3218" PostTypeId="2" ParentId="3200" CreationDate="2014-11-07T03:49:23.660" Score="1" Body="&lt;p&gt;Starting with &lt;code&gt;emacs -Q&lt;/code&gt; and manually entering &lt;code&gt;icicle-mode&lt;/code&gt; solved the problem, so it turned out that &lt;code&gt;ido&lt;/code&gt; was still active despite my attempts to disable it through the &lt;code&gt;customize&lt;/code&gt; interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a newbie hunch I opened my init.el, added&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(ido-mode nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and restarted emacs. This worked. Now &lt;code&gt;C-x C-f&lt;/code&gt; is bound to &lt;code&gt;icicle-file&lt;/code&gt; and other functionality seems normal.&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2014-11-07T03:49:23.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3219" PostTypeId="1" AcceptedAnswerId="3224" CreationDate="2014-11-07T06:06:37.587" Score="14" ViewCount="7294" Body="&lt;p&gt;For example, I got a demo to show a command and its output, and I want to insert them into an &lt;code&gt;.org&lt;/code&gt; file like a source code snippet of C or something. I then want to be able to export the file to an HTML file, and have the block highlighted just like examples are in many books.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC shell&#xA;$ ls&#xA;dir1&#xA;dir2&#xA;file1&#xA;file2&#xA;...&#xA;or any other examples like this&#xA;...&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it cannot be converted to HTML: An error message that reads&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;shell-mode&lt;/code&gt;: Wrong type argument: processp, nil&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;shows up all the time. What mode should I use to replace &lt;code&gt;shell&lt;/code&gt;, and if I should not use the &lt;code&gt;#+BEGIN_SRC...#+END_SRC&lt;/code&gt; format, what should I use instead?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="504" LastEditDate="2014-11-07T12:59:09.237" LastActivityDate="2015-09-07T20:02:06.490" Title="How to include the output of a shell command in org-mode source code block?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3220" PostTypeId="2" ParentId="3074" CreationDate="2014-11-07T06:13:49.900" Score="0" Body="&lt;p&gt;Yes.  It is possible to configure it, somehow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(With apologies for the snark.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Write a function that indents a line the way you want, then set that function as the value of the variable &lt;code&gt;indent-line-function&lt;/code&gt; for &lt;code&gt;makefile-mode&lt;/code&gt;.  Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-makefile-indent-line ()&#xA;  ...)&#xA;&#xA;(add-hook 'makefile-mode-hook (lambda () (setq-local indent-line-function 'my-makefile-indent-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="372" LastEditorUserId="372" LastEditDate="2014-11-07T06:26:07.310" LastActivityDate="2014-11-07T06:26:07.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3221" PostTypeId="1" AcceptedAnswerId="3241" CreationDate="2014-11-07T06:42:35.247" Score="2" ViewCount="365" Body="&lt;p&gt;If I would like to keep my emacs settings and packages in another computer or after a format &lt;strong&gt;is there a way to avoid having to install all the packages from the beginning?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't just mean saving the &lt;code&gt;.emacs&lt;/code&gt; as to have the customizations but also the packages that come with it. I was wondering &lt;strong&gt;if I copy and save my elpa file and then paste it in a new PC is there going to be any problem?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do the packages install files also in other folders of a system, so the aforementioned technique may cause problems, or is this a good way to keep your Emacs always with you?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2014-11-14T23:00:12.210" LastActivityDate="2014-11-14T23:00:12.210" Title="Keep Emacs packages after reformatting" Tags="|package|init-file|" AnswerCount="5" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3222" PostTypeId="5" CreationDate="2014-11-07T07:26:00.203" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-07T07:26:00.203" LastActivityDate="2014-11-07T07:26:00.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3223" PostTypeId="4" CreationDate="2014-11-07T07:26:00.203" Score="0" Body="Emacs can run entirely inside of a TTY terminal, by using the `-nw` flag at startup, or by compiling emacs with the `--without-x` flag. " OwnerUserId="118" LastEditorUserId="118" LastEditDate="2014-11-07T10:46:20.633" LastActivityDate="2014-11-07T10:46:20.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3224" PostTypeId="2" ParentId="3219" CreationDate="2014-11-07T07:46:36.510" Score="19" Body="&lt;p&gt;If you want to construct examples yourself (that's what I'm getting from your question, but correct me if I'm wrong), use an &lt;code&gt;EXAMPLE&lt;/code&gt; block instead of a &lt;code&gt;SRC&lt;/code&gt; block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_EXAMPLE&#xA;$ ls&#xA;dir1&#xA;dir2&#xA;file1&#xA;file2&#xA;...&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When exporting to HTML, this block becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;pre class=&quot;example&quot;&amp;gt;&#xA;$ ls&#xA;dir1&#xA;dir2&#xA;file1&#xA;file2&#xA;...&#xA;&amp;lt;/pre&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the contents of the exported block are exactly the same as the contents of the original &lt;code&gt;EXAMPLE&lt;/code&gt; block.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you actually want to &lt;em&gt;run&lt;/em&gt; one or more commands to produce output dynamically and include both the commands and the results in your HTML document, you need to modify the &lt;code&gt;SRC&lt;/code&gt; block to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports both&#xA;ls&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the output of the &lt;code&gt;ls&lt;/code&gt; command includes the directories and files you listed in your example (&lt;code&gt;dir1&lt;/code&gt;, &lt;code&gt;dir2&lt;/code&gt;, &lt;code&gt;file1&lt;/code&gt;, &lt;code&gt;file2&lt;/code&gt;), this will export to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;div class=&quot;org-src-container&quot;&amp;gt;&#xA;  &amp;lt;pre class=&quot;src src-sh&quot;&amp;gt;&#xA;    ls&#xA;  &amp;lt;/pre&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&#xA;&amp;lt;table&amp;gt;&#xA;  &amp;lt;colgroup&amp;gt;&#xA;    &amp;lt;col class=&quot;left&quot; /&amp;gt;&#xA;  &amp;lt;/colgroup&amp;gt;&#xA;  &amp;lt;tbody&amp;gt;&#xA;    &amp;lt;tr&amp;gt;&#xA;      &amp;lt;td class=&quot;left&quot;&amp;gt;dir1&amp;lt;/td&amp;gt;&#xA;    &amp;lt;/tr&amp;gt;&#xA;    &amp;lt;tr&amp;gt;&#xA;      &amp;lt;td class=&quot;left&quot;&amp;gt;dir2&amp;lt;/td&amp;gt;&#xA;    &amp;lt;/tr&amp;gt;&#xA;    &amp;lt;tr&amp;gt;&#xA;      &amp;lt;td class=&quot;left&quot;&amp;gt;file1&amp;lt;/td&amp;gt;&#xA;    &amp;lt;/tr&amp;gt;&#xA;    &amp;lt;tr&amp;gt;&#xA;      &amp;lt;td class=&quot;left&quot;&amp;gt;file2&amp;lt;/td&amp;gt;&#xA;    &amp;lt;/tr&amp;gt;&#xA;  &amp;lt;/tbody&amp;gt;&#xA;&amp;lt;/table&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the code itself is wrapped in a code block, and the results are listed in a table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; that you will need to enable support for &lt;code&gt;sh&lt;/code&gt; code blocks explicitly via:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ob-sh)&#xA;(org-babel-do-load-languages 'org-babel-load-languages '((sh . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is because by default &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/&quot; rel=&quot;noreferrer&quot;&gt;Org Babel&lt;/a&gt; only enables support for Emacs Lisp code blocks (as explained &lt;a href=&quot;http://doc.endlessparentheses.com/Var%2Forg-babel-load-languages.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-09-07T20:02:06.490" LastActivityDate="2015-09-07T20:02:06.490" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3225" PostTypeId="1" AcceptedAnswerId="3232" CreationDate="2014-11-07T08:00:36.193" Score="3" ViewCount="602" Body="&lt;p&gt;In pretty much every mode, whenever the word 'fix' occurs, whether its in a comment or not, it gets highlighted in a &lt;em&gt;very&lt;/em&gt; visible way. I'm not sure what's causing this, and would like to turn it off. How do I do that?&lt;/p&gt;&#xA;" OwnerUserId="561" LastEditorUserId="421" LastEditDate="2014-11-07T10:37:05.583" LastActivityDate="2014-11-07T11:57:16.600" Title="Emacs keeps highlighting the word 'fix' in every context - how do I turn it off?" Tags="|font-lock|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3226" PostTypeId="2" ParentId="3209" CreationDate="2014-11-07T08:16:49.733" Score="5" Body="&lt;p&gt;No, you can't &quot;prevent emacsclient from blocking other [emacsclient] instances&quot;, because that's not what's happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacsclient isn't running any elisp at all, so it's not the cause of the blockage. The Emacs &lt;strong&gt;server&lt;/strong&gt; is running the elisp code, and Emacs is single-threaded -- so if the server thread is blocked then none of the clients will be receiving any output. There's nothing that a client can do about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can, as mentioned in the comments, run multiple independent servers side by side. The simplest way to do this is via the &lt;code&gt;--daemon=NAME&lt;/code&gt; command line argument:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon=foo&#xA;emacs --daemon=bar&#xA;emacsclient --socket-name=foo&#xA;emacsclient --socket-name=bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or short-cut it to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -a &quot;&quot; --socket-name=foo&#xA;emacsclient -a &quot;&quot; --socket-name=bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-07T08:39:12.973" LastActivityDate="2014-11-07T08:39:12.973" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3227" PostTypeId="2" ParentId="3225" CreationDate="2014-11-07T08:19:02.137" Score="6" Body="&lt;p&gt;Put point (the cursor) on the word &lt;code&gt;fix&lt;/code&gt; and do &lt;kbd&gt;C-u C-x =&lt;/kbd&gt; (&lt;code&gt;what-cursor-position&lt;/code&gt;). In the buffer that comes up, look for a section that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;There are text properties here:&#xA;  face                 font-lock-comment-face&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Move point to whatever it says instead of &lt;code&gt;font-lock-comment-face&lt;/code&gt; (you can use &lt;kbd&gt;TAB&lt;/kbd&gt; to navigate there), and hit &lt;kbd&gt;RET&lt;/kbd&gt;. You can also click the name of the face with the mouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will bring up a &lt;code&gt;*Help*&lt;/code&gt; buffer showing you properties of the face in question. The first line will look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Face: font-lock-comment-face (sample) (customize this face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To modify the face, click &lt;code&gt;customize this face&lt;/code&gt;. You will probably want to change the &quot;Foreground&quot; and &quot;Background&quot; properties. When you are done, click &quot;Apply and Save&quot; to make the changes permanent.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is &lt;strong&gt;another way&lt;/strong&gt; to find out what's going on:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Quit Emacs and start it again via &lt;code&gt;emacs -Q&lt;/code&gt;. The &lt;code&gt;-Q&lt;/code&gt; flag tells Emacs to refrain from loading any customizations. If &lt;code&gt;fix&lt;/code&gt; is not being highlighted any more, this means that the problem is coming from your personal customizations (or from a third-party package you are using).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Recursively bisect&lt;/em&gt; your init-file: Start by commenting out half of it, restart Emacs, and see if &lt;code&gt;fix&lt;/code&gt; gets highlighted. If it does, you know that the code that's causing the highlighting is in the portion of the code that is currently &lt;em&gt;not&lt;/em&gt; commented out (and vice versa). Repeat the process for the portion of the code you know contains the offending code: Comment out half of it, and see if the problem persists. Keep going until you have narrowed the problem down to a small chunk of code. Add the offending code to your question if you need more assistance with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To comment out a chunk of code, put it in a region and hit &lt;kbd&gt;M-;&lt;/kbd&gt; (bound to &lt;code&gt;comment-dwim&lt;/code&gt; by default). If a region is already commented out, you can use the same command to uncomment it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-11-07T11:03:04.657" LastActivityDate="2014-11-07T11:03:04.657" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="3228" PostTypeId="1" AcceptedAnswerId="3231" CreationDate="2014-11-07T10:10:55.013" Score="7" ViewCount="709" Body="&lt;p&gt;Imagine that I have the following files in my (ridiculous) package:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;File &lt;code&gt;test1.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; test1.el ---                                   &#xA;&#xA;;;; Code:&#xA;&#xA;(defvar test-var1)&#xA;&#xA;(defun test-fun1 (test)&#xA;  nil)&#xA;&#xA;(require 'test2 &quot;./test2.el)&#xA;&#xA;(provide 'test1)&#xA;;;; test1.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;File &lt;code&gt;test2.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; test2.el ---  &#xA;&#xA;;;; Code:&#xA;&#xA;(defun test-fun2 ()&#xA;  (let ((test test-var1))&#xA;    (test-fun1 test)))&#xA;&#xA;(provide 'test2)&#xA;;;; test2.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If then I run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -batch -f batch-byte-compile *.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Compiling .../test1.el...&#xA;Wrote .../test1.elc&#xA;Compiling .../test2.el...&#xA;&#xA;In test-fun2:&#xA;test2.el:9:15:Warning: reference to free variable `test-var1'&#xA;&#xA;In end of data:&#xA;test2.el:14:1:Warning: the function `test-fun1' is not known to be defined.&#xA;Wrote .../test2.elc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand why these warnings appear, and I understand that they are only warnings. However, it would be easy to miss a typo in a function name by dismissing all warnings of this kind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I somehow thought that adding a &lt;code&gt;(require 'test2)&lt;/code&gt; line in &lt;code&gt;test2.el&lt;/code&gt; should fix it. However, in this case I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Compiling .../test1.el...&#xA;&#xA;In toplevel form:&#xA;test1.el:10:1:Error: Recursive `require' for feature `test2'&#xA;Compiling .../test2.el...&#xA;&#xA;In toplevel form:&#xA;test2.el:5:1:Error: Recursive `require' for feature `test1'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is cryptic, because I thought that the point of &lt;code&gt;require&lt;/code&gt; was precisely to avoid recursive loading. I assume that &lt;code&gt;require&lt;/code&gt; is behaving like &lt;code&gt;load&lt;/code&gt; during compilation time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a good (and safe) way to get rid of these warnings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual gives a work-around (I post it as a better-than-nothing answer below), but ultimately, I'd like the solution to be rather automatic (not requiring me to list all functions and variables that I will need in every file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ideal solution would be built-in in emacs or provided with Cask. If it doesn't exist, I will take what is available of course.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2014-11-07T10:16:37.757" LastActivityDate="2014-11-07T14:27:41.887" Title="Byte-compilation of a multi-file package: &quot;the function is not known to be defined&quot;" Tags="|byte-compilation|cask|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3229" PostTypeId="2" ParentId="3228" CreationDate="2014-11-07T10:10:55.013" Score="3" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Compiler-Errors.html#Compiler-Errors&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; suggests adding &lt;code&gt;declare-function&lt;/code&gt; and &lt;code&gt;defvar&lt;/code&gt; lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The resulting &lt;code&gt;test2&lt;/code&gt; file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; test2.el ---  &#xA;&#xA;;;; Code:&#xA;&#xA;(declare-function test-fun1 &quot;./test1.el&quot;)&#xA;(defvar test-var1)&#xA;&#xA;(defun test-fun2 ()&#xA;  (let ((test test-var1))&#xA;    (test-fun1 test)))&#xA;&#xA;(provide 'test2)&#xA;;;; test2.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this needs to be done for all functions and all variables defined in &quot;parent&quot; files. &lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2014-11-07T10:10:55.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3230" PostTypeId="2" ParentId="3216" CreationDate="2014-11-07T10:49:40.380" Score="0" Body="&lt;p&gt;Can't you simply use &lt;code&gt;C-j&lt;/code&gt; to insert empty lines on Emacs 24.4?&lt;/p&gt;&#xA;" OwnerUserId="223" LastActivityDate="2014-11-07T10:49:40.380" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3231" PostTypeId="2" ParentId="3228" CreationDate="2014-11-07T11:52:31.653" Score="8" Body="&lt;h3&gt;About require&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;require&lt;/code&gt; is not meant to avoid recusive loading, it is meant to avoid &lt;em&gt;repetitive&lt;/em&gt; loading. So no, it does not solve you problem here.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;About the problem&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The right way to approach this (in my opinion) would be to avoid the&#xA;mutual dependency. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;test1&lt;/code&gt; file in your example has no reason to require &lt;code&gt;test2&lt;/code&gt;.&#xA;Even if that's not true for your actual package, maybe you can&#xA;redesign how you're delegating code between the files. It is &lt;em&gt;in&#xA;general&lt;/em&gt; possible to avoid mutual dependency between your files.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Work arounds&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If the mutual dependency cannot be avoided, the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Compiler-Errors.html#Compiler-Errors&quot;&gt;manual&lt;/a&gt;&#xA;mentions a solution. You'll have to add lines like the following&#xA;for each function/variable you need.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(declare-function test-fun1 &quot;./test1.el&quot;)&#xA;(defvar test-var1)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another option is to &lt;code&gt;require&lt;/code&gt; the files only conditionally. Add something like this to file &lt;code&gt;1&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test1-is-loading t)&#xA;(unless (and (boundp 'test2-is-loading)&#xA;             test2-is-loading)&#xA;  (require 'test2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And something like this to file &lt;code&gt;2&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test2-is-loading t)&#xA;(unless (and (boundp 'test1-is-loading)&#xA;             test1-is-loading)&#xA;  (require 'test1))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-07T11:52:31.653" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3232" PostTypeId="2" ParentId="3225" CreationDate="2014-11-07T11:57:16.600" Score="3" Body="&lt;p&gt;What you are seeing is probably a font lock customization that one can add to their &lt;code&gt;init.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following that highlights the occurrences of &lt;code&gt;FIXME&lt;/code&gt;, &lt;code&gt;TODO&lt;/code&gt; and &lt;code&gt;BUG&lt;/code&gt; in &lt;code&gt;font-lock-warning-face&lt;/code&gt; face. But I have bound this to happen only in a particular major mode hook (i.e. only when a particular major mode is active). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt; &#xA;(font-lock-add-keywords nil '((&quot;\\b\\(FIXME\\|TODO\\|BUG\\)\\b&quot; 1 font-lock-warning-face t)))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My gut feeling is that you have a similar &lt;code&gt;(font-lock-add-keywords nil '((&quot;\\b\\(FIX\\|...&lt;/code&gt; statement somewhere in your &lt;code&gt;init.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would do a recursive grep of &lt;code&gt;FIX\\\\&lt;/code&gt; in the emacs setup folder ( which usually is &lt;code&gt;~/.emacs.d&lt;/code&gt; ) to find the location of that statement. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-11-07T11:57:16.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3233" PostTypeId="1" AcceptedAnswerId="3234" CreationDate="2014-11-07T12:09:37.347" Score="5" ViewCount="602" Body="&lt;p&gt;I didn't know byte compiled emacs files (&lt;code&gt;.elc&lt;/code&gt;) were actually version-specific until &lt;a href=&quot;https://emacs.stackexchange.com/users/50/malabarba&quot;&gt;Malabarba&lt;/a&gt; pointed that to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this made me ask what do those files actually contain and how does their execution compare to the execution of normal &lt;code&gt;.el&lt;/code&gt; files? What is the benefit of compiling an emacs file and how does emacs takes advantage of this?&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2014-11-07T12:50:12.547" Title="What does a byte compiled Emacs file contains and how is it executed?" Tags="|byte-compilation|bytecode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3234" PostTypeId="2" ParentId="3233" CreationDate="2014-11-07T12:42:06.720" Score="6" Body="&lt;p&gt;The Emacs manual node on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Byte-Compilation.html&quot; rel=&quot;nofollow&quot;&gt;byte compilation&lt;/a&gt; explains that elisp&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... has a compiler that translates functions written in Lisp into a special representation called byte-code that can be executed more efficiently. The compiler replaces Lisp function definitions with byte-code.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;These byte-codes are basically numeric codes that are not human readable (&lt;code&gt;byte-car&lt;/code&gt;, for example, is 64, and &lt;code&gt;byte-forward-char&lt;/code&gt; is 123).  There is, however, a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Disassembly.html#Disassembly&quot; rel=&quot;nofollow&quot;&gt;disassembler&lt;/a&gt; provided to &quot;satisfy a cat-like curiosity&quot; if you want to see how the sausage gets made.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what the all-knowing Wikipedia page on &lt;a href=&quot;http://en.wikipedia.org/wiki/Bytecode&quot; rel=&quot;nofollow&quot;&gt;Bytecode&lt;/a&gt; has to say:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Bytecode... is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references... which encode the result of parsing and semantic analysis of things like type, scope, and nesting depths of program objects. They therefore allow much better performance than direct interpretation of source code.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Speed-of-Byte_002dCode.html#Speed-of-Byte_002dCode&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; gives a simple example of the speedup from using a byte-compiled versus interpreted function -- 2 to 3 times in their looping example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;New bytecodes get added to Emacs as new versions are released -- hence, new versions know about the old versions' bytecodes, but not the other way around.  To see some of this in action, you can browse through the &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/bytecomp.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;bytecomp&lt;/code&gt;&lt;/a&gt; library (or &lt;code&gt;M-x find-library RET bytecomp&lt;/code&gt;) to take a look at what's in it.  Note that, at various points in the code, it defines new bytecodes for newer versions of Emacs (look for comments around &lt;code&gt;byte-defop&lt;/code&gt; lines).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an example of someone digging into the byte-code to understand why he couldn't seem to advise the narrowing/widening functions, see &lt;a href=&quot;http://nullprogram.com/blog/2013/01/22/&quot; rel=&quot;nofollow&quot;&gt;limits of advice&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE:&lt;/em&gt; as @Malabarba's comment points out, there's a great post over at Null Program on &lt;a href=&quot;http://nullprogram.com/blog/2014/01/04/&quot; rel=&quot;nofollow&quot;&gt;Emacs Byte-Code Internals&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-07T12:50:12.547" LastActivityDate="2014-11-07T12:50:12.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3235" PostTypeId="2" ParentId="3221" CreationDate="2014-11-07T13:01:00.980" Score="1" Body="&lt;p&gt;You can copy and paste your entire &lt;code&gt;.emacs.d&lt;/code&gt; folder to a new computer and not have any problems as long as you are using the same version of emacs on the new computer. You can also put the entirety of your configuration, including &lt;code&gt;elpa/&lt;/code&gt; in distributed version control and pull it to any new computer.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-11-07T13:01:00.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3236" PostTypeId="2" ParentId="3211" CreationDate="2014-11-07T13:02:27.253" Score="2" Body="&lt;p&gt;Combining the good answers from stsquad and artagnon gives (to my mind) a total solution to the problem which is entirely reasonable:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-k&lt;/kbd&gt;&lt;kbd&gt;e&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;l&lt;/kbd&gt; to edit a macro generated from the lossage&lt;/li&gt;&#xA;&lt;li&gt;edit the macro, to reduce it to the original recording&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt; to store the edited macro&lt;/li&gt;&#xA;&lt;li&gt;Either &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;f3&gt;&lt;/kbd&gt; to firstly replay that macro, and then continue recording subsequent keystrokes which will be appended to the macro definition&lt;/li&gt;&#xA;&lt;li&gt;...or &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;f3&gt;&lt;/kbd&gt; to continue recording &lt;em&gt;without&lt;/em&gt; the initial replay of the macro-thus-far.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Maybe the need to edit the lossage-as-macro isn't &lt;em&gt;ideal&lt;/em&gt;, but (a) you were bound to need to edit the macro regardless, if you aborted the recording, and (b) this shouldn't be happening very often, if you just remember how to stop the macro normally (e.g. with &lt;kbd&gt;&amp;lt;f4&gt;&lt;/kbd&gt; rather than &lt;kbd&gt;C-g&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;None of which is to say that it wouldn't be useful if the aborted macro was stored somewhere; it's just that I don't think this actually happens. It would probably be worth &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;report-emacs-bug&lt;/code&gt; to suggest this feature.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-11-07T13:02:27.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3237" PostTypeId="2" ParentId="3211" CreationDate="2014-11-07T13:18:02.363" Score="8" Body="&lt;p&gt;I started &lt;a href=&quot;https://github.com/chrisdone/chrisdone-emacs/blob/master/packages/resmacro/resmacro.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;an implementation here&lt;/a&gt; which lets you rebind your &lt;code&gt;C-x (&lt;/code&gt; to &lt;code&gt;resmacro-start-macro&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suppose you get half way through a macro and make a mistake and&#xA;hit &lt;code&gt;C-g&lt;/code&gt;, e.g. you run &lt;code&gt;C-s&lt;/code&gt; by mistake and so you hit &lt;code&gt;C-g&lt;/code&gt; to&#xA;cancel it, or w/e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x ( hello C-s C-g &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now run &lt;code&gt;C-u C-x (&lt;/code&gt; which will prompt in the minibuffer with:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Resume macro with (RET: continue, DEL: remove last): &lt;code&gt;h e l l o&lt;/code&gt; &lt;strong&gt;&lt;code&gt;C-s&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you hit backspace (&lt;code&gt;DEL&lt;/code&gt;) to delete the &lt;code&gt;C-s&lt;/code&gt; and then &lt;code&gt;RET&lt;/code&gt; to&#xA;proceed. Now it says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Appending to kbd macro...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And you can continue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In total:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x (      -- start macro&#xA;hello&#xA;C-s        -- mistake&#xA;C-g        -- cancel mistake (and macro)&#xA;C-u C-x (  -- recover lost macro&#xA;DEL        -- remove mistake&#xA;RET        -- continue recording&#xA;world!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Convenient, no context switch, minimum keybindings to achieve task, automatically&#xA;figures out where your macro started (at &lt;code&gt;C-x (&lt;/code&gt;) from &lt;code&gt;(recent-keys)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2445" LastEditorUserId="14825" LastEditDate="2019-11-03T00:35:51.200" LastActivityDate="2019-11-03T00:35:51.200" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="3238" PostTypeId="2" ParentId="3173" CreationDate="2014-11-07T14:04:32.057" Score="3" Body="&lt;p&gt;Not sure what is special about having the rectangle in the kill-ring, but if you upgrade to Emacs-24.4, then you can do: &lt;code&gt;C-x SPC .... M-w&lt;/code&gt; to select a rectangle and place it on the kill-ring.  After that &lt;code&gt;C-y&lt;/code&gt; will yank that rectangle (in the same was that &lt;code&gt;C-x r y&lt;/code&gt; does, tho).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-07T14:04:32.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3239" PostTypeId="2" ParentId="408" CreationDate="2014-11-07T14:17:08.547" Score="4" Body="&lt;p&gt;I have this &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/master/setup-packages.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;setup-packages.el&lt;/code&gt;&lt;/a&gt; in my emacs setup which is a hybrid of code from &lt;a href=&quot;https://github.com/bbatsov/prelude/blob/master/core/prelude-packages.el&quot; rel=&quot;nofollow&quot;&gt;Prelude&lt;/a&gt; and &lt;a href=&quot;http://toumorokoshi.github.io/emacs-from-scratch-part-2-package-management.html&quot; rel=&quot;nofollow&quot;&gt;Tomorokoshi's blog on Package Management&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;setup-packages.el&lt;/code&gt; does the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a directory for &lt;code&gt;elpa&lt;/code&gt; packages if one doesn't exists and add it and its sub-directories to the &lt;code&gt;load-path&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Update &lt;code&gt;package-archives&lt;/code&gt; list with Melpa.&lt;/li&gt;&#xA;&lt;li&gt;Check if you have all the packages listed in &lt;code&gt;my-packages&lt;/code&gt; list installed. If a package is not installed, install it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;How to implement&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Save the &lt;code&gt;setup-packages.el&lt;/code&gt; below to your &lt;code&gt;~/.emacs.d/&lt;/code&gt; directory.&lt;/li&gt;&#xA;&lt;li&gt;Set &lt;code&gt;user-emacs-directory&lt;/code&gt;, &lt;code&gt;setup-packages-file&lt;/code&gt; and &lt;code&gt;my-packages&lt;/code&gt; variables in your &lt;code&gt;init.el&lt;/code&gt; and do &lt;code&gt;(load setup-packages-file)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you start emacs for the first time on a machine that does not have these packages installed, all the pacakges listed in &lt;code&gt;my-packages&lt;/code&gt; will get auto-installed.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;setup-packages.el&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; setup-packages.el - Package management&#xA;&#xA;(require 'cl)&#xA;(require 'package)&#xA;&#xA;;; Set the directory where you want to install the packages&#xA;(setq package-user-dir (concat user-emacs-directory &quot;elpa/&quot;))&#xA;&#xA;;; Add melpa package source when using package list&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;&#xA;;; Load emacs packages and activate them&#xA;;; This must come before configurations of installed packages.&#xA;;; Don't delete this line.&#xA;(package-initialize)&#xA;;; `package-initialize' call is required before any of the below&#xA;;; can happen&#xA;&#xA;;; Auto install the required packages&#xA;;; Method to check if all packages are installed&#xA;(defun packages-installed-p ()&#xA;  (loop for p in my-packages&#xA;        when (not (package-installed-p p)) do (return nil)&#xA;        finally (return t)))&#xA;&#xA;;; if not all packages are installed, check one by one and install the missing ones.&#xA;(unless (packages-installed-p)&#xA;  ;; check for new packages (package versions)&#xA;  (message &quot;%s&quot; &quot;Emacs is now refreshing its package database...&quot;)&#xA;  (package-refresh-contents)&#xA;  (message &quot;%s&quot; &quot; done.&quot;)&#xA;  ;; install the missing packages&#xA;  (dolist (p my-packages)&#xA;    (when (not (package-installed-p p))&#xA;      (package-install p))))&#xA;&#xA;(provide 'setup-packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;init.el&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You would need the following in your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq user-home-directory  (getenv &quot;HOME&quot;))&#xA;(setq user-emacs-directory (concat user-home-directory &quot;.emacs.d/&quot;))&#xA;(setq setup-packages-file  (expand-file-name &quot;setup-packages.el&quot; user-emacs-directory))&#xA;&#xA;;; A list of packages to ensure are installed at launch&#xA;(setq my-packages&#xA;      '(&#xA;        ;; package1&#xA;        ;; package2&#xA;       ))&#xA;&#xA;(load setup-packages-file nil :nomessage) ; Load the packages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-28T15:15:28.150" LastActivityDate="2015-05-28T15:15:28.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3240" PostTypeId="2" ParentId="3216" CreationDate="2014-11-07T14:20:31.310" Score="4" Body="&lt;p&gt;You want to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'c-mode-hook&#xA;           (lambda ()&#xA;             (setq-local electric-indent-chars&#xA;                         (remq ?\n electric-indent-chars))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-07T14:20:31.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3241" PostTypeId="2" ParentId="3221" CreationDate="2014-11-07T14:25:05.633" Score="3" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;If I would like to keep my emacs settings and packages in another computer or after a format is there a way to avoid having to install all the packages from the beginning?&lt;/p&gt;&#xA;&lt;p&gt;I don't just mean saving the .emacs as to have the customizations but also the packages that come with it. I was wondering if I copy and save my elpa file and then paste it in a new PC is there going to be any problem?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I posted &lt;a href=&quot;https://emacs.stackexchange.com/a/3239/115&quot;&gt;an answer&lt;/a&gt; on &lt;a href=&quot;https://emacs.stackexchange.com/q/408/115&quot;&gt;Synchronize packages between different machines&lt;/a&gt; describing how I manage installation of packages from scratch when I want to install emacs on a new machine.&lt;/p&gt;&#xA;&lt;p&gt;On the new machine, you simply need to copy your emacs customizations. &lt;em&gt;Make sure that the &lt;code&gt;my-packages&lt;/code&gt; list and the &lt;code&gt;setup-packages.el&lt;/code&gt; that I explain in detail in my above referenced answer are also copied to the new machine.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Are the packages install files also in other folders of a system so to cause the aforementioned technique problems or is this a good way to keep your Emacs always with you?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Till now I haven't faced a situation like that. You would have to review what packages you have installed and where they save stuff that you would want to port to a new machine. Let me take &lt;code&gt;multiple-cursors&lt;/code&gt; package as an example. By default, it creates a file &lt;code&gt;.mc-lists.el&lt;/code&gt; in &lt;code&gt;.emacs.d&lt;/code&gt;. But that is not a problem as I copy my whole emacs setup folder (&lt;code&gt;.emacs.d&lt;/code&gt;) when porting my emacs customization to a new machine.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-11-07T14:25:05.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3242" PostTypeId="2" ParentId="3228" CreationDate="2014-11-07T14:27:41.887" Score="4" Body="&lt;p&gt;Your example is weird:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You &lt;code&gt;require&lt;/code&gt; test2 at the &lt;em&gt;end&lt;/em&gt; of test1, whereas &lt;code&gt;require&lt;/code&gt; should &quot;always&quot; be at the beginning of a file.&lt;/li&gt;&#xA;&lt;li&gt;Your test1 does not call any test2 functions, so it doesn't need test2 to work (hence it &lt;code&gt;require&lt;/code&gt;s it, unnecessarily), and OTOH your test2 does call test1 functions, so it does need test1, yet it fails to &lt;code&gt;require&lt;/code&gt; it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;IOW, you have your &lt;code&gt;require&lt;/code&gt;s backward.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-07T14:27:41.887" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3243" PostTypeId="2" ParentId="3202" CreationDate="2014-11-07T14:46:27.710" Score="5" Body="&lt;p&gt;You can use a package called &lt;a href=&quot;https://github.com/glen-dai/highlight-global&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;highlight-global&lt;/code&gt;&lt;/a&gt; that's available from github but not on Melpa (as of writing this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;highlight-frame-toggle&lt;/code&gt; function defined in this pacakge will highlight the word at point or the selected region everywhere in the frame (in all the buffers). This, though, would not do the autoscroll to the highlighted word that you need. It picks a different highlighting color as you highlight more words without clearing the earlier hightlights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a screenshot of what it looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xm1Yi.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/xm1Yi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;Click for better view of the screenshot&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-11-07T15:45:12.473" LastActivityDate="2014-11-07T15:45:12.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3244" PostTypeId="1" AcceptedAnswerId="3247" CreationDate="2014-11-07T15:37:17.810" Score="4" ViewCount="836" Body="&lt;p&gt;What face/text/other property should I use to have mode-line text look like a button/link/stuff to click on while I am hovering over it with the cursor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;different background, &lt;/li&gt;&#xA;&lt;li&gt;3D-like button decoration,&lt;/li&gt;&#xA;&lt;li&gt;colorful frame/border displayed around it&lt;/li&gt;&#xA;&lt;li&gt;other visual cues would be fine as well (as I don't know what choices are avaliable).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Otherwise it should just look like any ordinary text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a fragment of my custom mode-line which I'd like to enhance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-line-format&#xA;   (list&#xA;     (propertize&#xA;      (concat &quot;[&quot; (propertize &quot;f&quot; 'face 'aria2-modeline-key-face) &quot;]:add file&quot;)&#xA;      'local-map (make-mode-line-mouse-map 'mouse-1 'aria2-add-file)) &quot; &quot;&#xA;     ;; [...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS: Is there some list of available text properties (for header/mode-line, buffer, frame border etc.) and their meanings?&lt;/p&gt;&#xA;" OwnerUserId="98" LastEditorUserId="50" LastEditDate="2014-12-21T08:11:50.203" LastActivityDate="2019-05-27T04:28:26.030" Title="How to make mode-line text look like a link/button on hover" Tags="|mode-line|faces|text-properties|mouse|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3245" PostTypeId="1" AcceptedAnswerId="3363" CreationDate="2014-11-07T15:45:00.227" Score="8" ViewCount="419" Body="&lt;p&gt;The &lt;code&gt;save-some-buffers&lt;/code&gt; command prompts to save or ignore each modified file, and also provides an option to diff the modified file against the file it is visiting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like the same behavior from &lt;code&gt;kill-buffer&lt;/code&gt; or &lt;code&gt;kill-this-buffer&lt;/code&gt;. If the buffer is modified there is already a yes/no prompt but I'd also like the option to see the diffs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a built-in way to do this, or an appropriate extension point? Or should I just bind my own kill-buffer command?&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="25" LastEditDate="2014-11-12T23:51:48.137" LastActivityDate="2015-05-09T20:50:54.847" Title="Kill-buffer prompt with option to diff the changes" Tags="|buffers|kill-buffer|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3246" PostTypeId="2" ParentId="3244" CreationDate="2014-11-07T15:53:22.350" Score="2" Body="&lt;p&gt;Face &lt;code&gt;button&lt;/code&gt; or face &lt;code&gt;link&lt;/code&gt;.  Use &lt;code&gt;M-x list-faces-display&lt;/code&gt; to see all faces currently defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(That said, I personally think that the standard behavior is not bad: mouseover to see whether a particular part of the mode line is a link/button and whether it has a menu etc.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2019-05-27T04:28:26.030" LastActivityDate="2019-05-27T04:28:26.030" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3247" PostTypeId="2" ParentId="3244" CreationDate="2014-11-07T15:56:37.420" Score="6" Body="&lt;p&gt;You can use the &lt;code&gt;mouse-face&lt;/code&gt; property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following snippet will make &quot;f&quot; look like a button when you hover the mouse pointer over it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-line-format&#xA;   (list&#xA;     (propertize&#xA;      (concat &quot;[&quot; (propertize &quot;f&quot; 'mouse-face 'mode-line-highlight) &quot;]:add file&quot;)&#xA;      'local-map (make-mode-line-mouse-map 'mouse-1 'aria2-add-file)) &quot; &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-11-07T15:56:37.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3248" PostTypeId="1" AcceptedAnswerId="3251" CreationDate="2014-11-07T16:05:36.670" Score="1" ViewCount="161" Body="&lt;p&gt;I did install projectile from melpa and now want to give it try. So I fiddled together this lines to get projectile mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (use-package projectile&#xA;   :config&#xA;   (setq projectile-enable-caching t)&#xA;   (global-set-key (kbd &quot;C-c p f&quot;) 'helm-projectile)&#xA;   (projectile-global-mode)&#xA;   ) ;; end of use-package&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also did &quot;touch ~/.emacs.d/.projectile&quot;. Now when I open init.el I have projectile minor mode. Actually whati expected... But when I do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;     (use-package projectile&#xA;;;       :config&#xA;;;       (setq projectile-enable-caching t)&#xA;;;       (global-set-key (kbd &quot;C-c p f&quot;) 'helm-projectile)&#xA;;;       (projectile-global-mode)&#xA;;;       ) ;; end of use-package&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and start a new emacs instance and open init.el it still has projectile minor mode enabled. Now I wonder why is that? Where may this be configured? There is no other version (other then the installed-by-me elpa version) of projectile installed on my hosting machine.&lt;/p&gt;&#xA;" OwnerUserId="970" LastEditorUserId="7" LastEditDate="2014-11-07T16:19:57.913" LastActivityDate="2014-11-07T16:39:46.303" Title="projectile minor mode is enabled even though all projectile related is commented in init.el" Tags="|init-file|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3249" PostTypeId="2" ParentId="3202" CreationDate="2014-11-07T16:13:31.677" Score="0" Body="&lt;p&gt;How about using &lt;code&gt;highlight-regexp&lt;/code&gt; to highlight the current symbol (or word, region, etc) in the other window? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a couple functions that could work. The first one will find the symbol at point, then jump to the other window and highlight it. The second one jumps to the other window and removes the highlights.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (require 'thingatpt)&#xA;&#xA; (defun highlight-other-window ()&#xA;   (interactive)&#xA;   (let ((match (thing-at-point 'symbol t)))&#xA;     (when match&#xA;       (save-excursion&#xA;         (other-window 1)&#xA;         (highlight-regexp (regexp-quote match))&#xA;         (other-window 1)))))&#xA;&#xA; (defun unhighlight-other-window ()&#xA;   (interactive)&#xA;   (save-excursion&#xA;     (other-window 1)&#xA;     (unhighlight-regexp t) &#xA;     (other-window 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In both cases this jumps back so the current window remains active at the end. Not sure if that's what you want, otherwise leave off the final &lt;code&gt;other-window&lt;/code&gt; call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These functions could also be improved by checking for and matching the active region; dealing with the case where there is no other window visible; etc.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-07T16:13:31.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3250" PostTypeId="1" CreationDate="2014-11-07T16:38:48.420" Score="5" ViewCount="654" Body="&lt;p&gt;I want to write an emacs function for debug purposes in c++ code. Basically I'm fed up typing the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::cout &amp;lt;&amp;lt; &quot;variable is: &quot; &amp;lt;&amp;lt; variable &amp;lt;&amp;lt; std::endl;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead I want to define an emacs function called say &quot;td&quot; for temp debug such that I do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x td RETURN&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it will print&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::cout &amp;lt;&amp;lt; &quot;foo is: &quot; &amp;lt;&amp;lt; foo &amp;lt;&amp;lt; std::endl;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want it to behave like &lt;code&gt;M-x goto-line&lt;/code&gt; whereby I type &lt;code&gt;M-x goto-line&lt;/code&gt; and press enter then it prompts me for an input, in my case I want my input to be the variable name and something like td instead of goto-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open to other suggestions, but I'd like to know how to code this type of function for future reference anyway.&lt;/p&gt;&#xA;" OwnerUserId="2453" LastEditorUserId="25" LastEditDate="2014-11-12T04:58:42.767" LastActivityDate="2014-11-15T04:01:44.960" Title="Define an emacs function to take arguments in the same way as something like M-x goto-line" Tags="|text-editing|functions|commands|insert|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3251" PostTypeId="2" ParentId="3248" CreationDate="2014-11-07T16:39:46.303" Score="3" Body="&lt;p&gt;Use &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt; &lt;code&gt;:disable&lt;/code&gt; prop&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package projectile&#xA;  :disabled t&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because you installed it from melpa, it's loaded automatically even if you comment out the code.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-11-07T16:39:46.303" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3252" PostTypeId="1" AcceptedAnswerId="3253" CreationDate="2014-11-07T16:41:03.953" Score="4" ViewCount="649" Body="&lt;p&gt;I have &lt;code&gt;(set-register ?E '(file . user-init-file))&lt;/code&gt;, so that I can easily jump to my config file.  Previously I used a string to specify the path to my init file, but I figured I'd tidy it up a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it doesn't work, and emacs complains about &lt;code&gt;(wrong-type-argument stringp user-init-file)&lt;/code&gt;, giving the following stack trace with &lt;code&gt;debug-on-error&lt;/code&gt; enabled.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp user-init-file)&#xA;  expand-file-name(user-init-file)&#xA;  find-file-noselect(user-init-file nil nil nil)&#xA;  find-file(user-init-file)&#xA;  ad-Orig-jump-to-register(69 nil)&#xA;  jump-to-register(69 nil)&#xA;  call-interactively(jump-to-register nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For reference, this happens if I load emacs with -Q, and then eval the &lt;code&gt;set-register...&lt;/code&gt; and then attempt to jump to the register.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's going on here? Things like &lt;code&gt;(find-file user-init-file)&lt;/code&gt; don't throw this error.&lt;/p&gt;&#xA;" OwnerUserId="503" LastEditorUserId="105" LastEditDate="2016-03-20T01:47:08.960" LastActivityDate="2016-03-20T01:47:08.960" Title="Why did I get an error message: wrong-type-argument stringp user-init-file" Tags="|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3253" PostTypeId="2" ParentId="3252" CreationDate="2014-11-07T16:48:40.750" Score="7" Body="&lt;p&gt;In your code &lt;code&gt;user-init-file&lt;/code&gt; is not evaluated (it is quoted), so &lt;code&gt;expand-file-name&lt;/code&gt; gets a symbol (and not a string), and complains about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-register ?E (cons 'file user-init-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS: You can also use the backquote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-register ?E `(file . ,user-init-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PPS: A side note: as far as I can tell this case is hard to debug by running emacs with &lt;code&gt;-Q&lt;/code&gt;: &lt;code&gt;user-init-file&lt;/code&gt; evaluates to &lt;code&gt;nil&lt;/code&gt; under &lt;code&gt;emacs -Q&lt;/code&gt;, so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-register ?E `(file . ,user-init-file))&#xA;(jump-to-register ?E)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fails for a different reason.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-07T17:00:59.360" LastActivityDate="2014-11-07T17:00:59.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3254" PostTypeId="2" ParentId="3250" CreationDate="2014-11-07T17:12:24.417" Score="5" Body="&lt;p&gt;Like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun example(name)&#xA;  (interactive &quot;sWhat's your name: &quot;)&#xA;  (message &quot;Hello, %s&quot; name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The key part is the &lt;code&gt;&quot;s&quot;&lt;/code&gt; prefix. Use &lt;code&gt;s&lt;/code&gt; for plain strings, &lt;code&gt;b&lt;/code&gt; for buffers, etc.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-11-07T17:12:24.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3255" PostTypeId="2" ParentId="3250" CreationDate="2014-11-07T17:13:16.930" Score="9" Body="&lt;p&gt;The &lt;code&gt;interactive&lt;/code&gt; special form provides the easiest way to get input from a user.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun td (variable)&#xA;  (interactive &quot;sVariable:&quot;)&#xA;  (insert (format &quot;std::cout &amp;lt;&amp;lt; \&quot;%s is: \&quot; &amp;lt;&amp;lt; %s &amp;lt;&amp;lt; std::endl;&quot; variable variable)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here &lt;code&gt;&quot;sVariable:&quot;&lt;/code&gt; consists of the &lt;code&gt;&quot;s&quot;&lt;/code&gt; code character (read a string) and the prompt. (See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&quot; rel=&quot;nofollow&quot;&gt;Using interactive&lt;/a&gt; in the Emacs Lisp Manual for more.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to using a string with with code characters, the &lt;code&gt;interactive&lt;/code&gt; special form can use a lisp form as its argument descriptor; this form should evaluate to a list of arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This lets an interactive command compute its arguments from the context, record argument history, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html#Text-from-Minibuffer&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;read-from-minibuffer&lt;/code&gt;&lt;/a&gt; supports &lt;em&gt;both&lt;/em&gt; setting the initial value and recording history; with its help we can make &lt;code&gt;td&lt;/code&gt; remember what was entered and offer it upon next invocation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun td (stream variable)&#xA;  (interactive&#xA;   (list&#xA;    (read-from-minibuffer &quot;Stream: &quot;&#xA;                          (when (boundp 'td-history) (car td-history))&#xA;                          nil nil 'td-history)&#xA;    (read-from-minibuffer &quot;Variable: &quot;)))&#xA;  (insert (format &quot;%s &amp;lt;&amp;lt; \&quot;%s is: \&quot; &amp;lt;&amp;lt; %s &amp;lt;&amp;lt; std::endl;&quot; stream variable variable)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS: Since you are debugging C++ code, you can add &lt;code&gt;__FILE__&lt;/code&gt; and &lt;code&gt;__LINE__&lt;/code&gt; macros, to get something similar to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun td (variable)&#xA;  (interactive &quot;sVariable:&quot;)&#xA;  (insert (format &quot;std::cout &amp;lt;&amp;lt; \&quot;file \&quot; &amp;lt;&amp;lt; __FILE__ &amp;lt;&amp;lt; \&quot; line \&quot; &amp;lt;&amp;lt; __LINE__ &amp;lt;&amp;lt; \&quot; %s is: \&quot; &amp;lt;&amp;lt; %s &amp;lt;&amp;lt; std::endl;&quot; variable variable)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-15T04:01:44.960" LastActivityDate="2014-11-15T04:01:44.960" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3256" PostTypeId="5" CreationDate="2014-11-07T17:37:37.737" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-07T17:37:37.737" LastActivityDate="2014-11-07T17:37:37.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3257" PostTypeId="4" CreationDate="2014-11-07T17:37:37.737" Score="0" Body="Questions related to the C++ language or the cc-mode" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-11-07T17:46:22.333" LastActivityDate="2014-11-07T17:46:22.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3258" PostTypeId="5" CreationDate="2014-11-07T17:43:30.850" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-07T17:43:30.850" LastActivityDate="2014-11-07T17:43:30.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3259" PostTypeId="4" CreationDate="2014-11-07T17:43:30.850" Score="0" Body="a command which wraps the words or redistributes the newlines within a paragraph as defined by the current major-mode" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-11-07T21:01:21.277" LastActivityDate="2014-11-07T21:01:21.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3260" PostTypeId="5" CreationDate="2014-11-07T17:45:10.970" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-07T17:45:10.970" LastActivityDate="2014-11-07T17:45:10.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3261" PostTypeId="4" CreationDate="2014-11-07T17:45:10.970" Score="0" Body="Questions about using the built-in help system in Emacs or how to find help." OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-11-07T22:22:35.327" LastActivityDate="2014-11-07T22:22:35.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3262" PostTypeId="5" CreationDate="2014-11-07T17:58:02.490" Score="0" Body="&lt;p&gt;The name &quot;ctags&quot; can refer to several different implementations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The traditional ctags executable from BSD Unix&lt;/li&gt;&#xA;&lt;li&gt;The etags executable which may also be installed as ctags that comes with Emacs&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ctags.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Exuberant Ctags&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/global/&quot; rel=&quot;nofollow&quot;&gt;GNU Global&lt;/a&gt; which also has a gtags executable and can be used with the ggtags-mode in Emacs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-11-07T22:22:50.443" LastActivityDate="2014-11-07T22:22:50.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3263" PostTypeId="4" CreationDate="2014-11-07T17:58:02.490" Score="0" Body="A tool that indexes the symbols (functions, variables, classes, and class methods) of various programming languages." OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-11-07T22:08:01.883" LastActivityDate="2014-11-07T22:08:01.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3264" PostTypeId="5" CreationDate="2014-11-07T18:02:52.983" Score="0" Body="&lt;p&gt;Secure Shell (SSH) is both a command and a cryptographic network protocol for operating network services securely over an unsecured network. Remote logins, remote data transfer, and interacting with remote shells are some common &lt;a href=&quot;/questions/tagged/ssh&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ssh&amp;#39;&quot; rel=&quot;tag&quot;&gt;ssh&lt;/a&gt; functions that rely on encryption provided by &lt;a href=&quot;/questions/tagged/ssh&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ssh&amp;#39;&quot; rel=&quot;tag&quot;&gt;ssh&lt;/a&gt;. With such encryption, no longer are passwords sent in plaintext over the network.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs uses &lt;a href=&quot;/questions/tagged/ssh&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ssh&amp;#39;&quot; rel=&quot;tag&quot;&gt;ssh&lt;/a&gt; as an underlying layer for many commands and operations. For example, &lt;a href=&quot;/questions/tagged/tramp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;tramp&amp;#39;&quot; rel=&quot;tag&quot;&gt;tramp&lt;/a&gt; access relies on &lt;a href=&quot;/questions/tagged/ssh&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ssh&amp;#39;&quot; rel=&quot;tag&quot;&gt;ssh&lt;/a&gt; connections by default, &lt;a href=&quot;/questions/tagged/eshell&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;eshell&amp;#39;&quot; rel=&quot;tag&quot;&gt;eshell&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/shell&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell&lt;/a&gt; provide seamless &lt;a href=&quot;/questions/tagged/ssh&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ssh&amp;#39;&quot; rel=&quot;tag&quot;&gt;ssh&lt;/a&gt; protocol support. The secure shell itself comes in two major versions, supports several operations and  encryption schemes, and interoperates with other secure hardware and software components. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs provides a broad range of support for &lt;a href=&quot;/questions/tagged/ssh&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ssh&amp;#39;&quot; rel=&quot;tag&quot;&gt;ssh&lt;/a&gt; operations, protocols and encryptions, some of which are not readily apparent. For example, encrypting for &lt;a href=&quot;/questions/tagged/backup&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;backup&amp;#39;&quot; rel=&quot;tag&quot;&gt;backup&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/version-control&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;version-control&amp;#39;&quot; rel=&quot;tag&quot;&gt;version-control&lt;/a&gt; operations, or interacting with the &lt;code&gt;ssh-agent&lt;/code&gt; to simulate password-less login services.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When tagging with &lt;a href=&quot;/questions/tagged/ssh&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ssh&amp;#39;&quot; rel=&quot;tag&quot;&gt;ssh&lt;/a&gt;, include other tags to indicate which aspect of Emacs operations, protocols, or encryptions the question pertains. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-20T16:21:10.397" LastActivityDate="2017-02-20T16:21:10.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3265" PostTypeId="4" CreationDate="2014-11-07T18:02:52.983" Score="0" Body="is the secure shell program that encrypts network communications over unsecured networks. " OwnerUserId="317" LastEditorUserId="7045" LastEditDate="2017-02-20T15:35:29.840" LastActivityDate="2017-02-20T15:35:29.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3266" PostTypeId="5" CreationDate="2014-11-07T18:04:54.893" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-07T18:04:54.893" LastActivityDate="2014-11-07T18:04:54.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3267" PostTypeId="4" CreationDate="2014-11-07T18:04:54.893" Score="0" Body="a major-mode for editing code written in the Haskell programming language." OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-11-07T21:03:10.050" LastActivityDate="2014-11-07T21:03:10.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3268" PostTypeId="5" CreationDate="2014-11-07T18:29:16.770" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-07T18:29:16.770" LastActivityDate="2014-11-07T18:29:16.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3269" PostTypeId="4" CreationDate="2014-11-07T18:29:16.770" Score="0" Body="an ELPA compatible Emacs package repository" OwnerUserId="317" LastEditorUserId="317" LastEditDate="2014-11-07T21:01:10.377" LastActivityDate="2014-11-07T21:01:10.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3270" PostTypeId="1" CreationDate="2014-11-07T18:44:29.847" Score="4" ViewCount="503" Body="&lt;p&gt;This is superficially similar to a question I asked &lt;a href=&quot;https://emacs.stackexchange.com/questions/3200/invoking-icicles&quot;&gt;here&lt;/a&gt; but I think the answer might be different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to use &lt;code&gt;dired+&lt;/code&gt; and &lt;code&gt;highlight&lt;/code&gt; but I don't seem to be getting the full functionality. When I do &lt;code&gt;C-x d&lt;/code&gt; the resulting buffer is a regular &lt;code&gt;dired&lt;/code&gt; buffer, without the dired+ formatting I've seen in various screenshots (where, for instance, autofile bookmarks are highlighted). &lt;code&gt;C-h c C-x d&lt;/code&gt; tells me that the command being run is &lt;code&gt;dired&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/15363695/emacs-how-to-install-and-use-dired&quot;&gt;This&lt;/a&gt; 1.5-year-old discussion at Stack Overflow suggests adding the following keybinding to &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ctl-x-map   &quot;d&quot; 'diredp-dired-files)&#xA;(define-key ctl-x-4-map &quot;d&quot; 'diredp-dired-files-other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this results in &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's function definition is void&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;when I invoke &lt;code&gt;C-x d&lt;/code&gt; after evaluation. Perhaps the name of these functions has changed since that answer was given, but looking at the completion possibilities when I try `M-x diredp-' I'm not sure where to turn.&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-11-07T21:01:54.663" Title="Invoking &quot;dired+&quot;" Tags="|dired|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3271" PostTypeId="1" CreationDate="2014-11-07T20:04:31.623" Score="2" ViewCount="103" Body="&lt;p&gt;Some files in Emacs should not be modified, for example:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;an .el.gz library file which is expected to behave &quot;properly&quot;&lt;/li&gt;&#xA;&lt;li&gt;an external extension, which will be overwritten on update&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Anyway, there are ways to change default behaviours but not through changing of the source code bundled with Emacs or it's packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the best ways to prevent oneself (or at least warn) from editing those files.&lt;/p&gt;&#xA;" OwnerUserId="98" LastActivityDate="2014-11-08T05:18:52.627" Title="Warning about modification of files which should be static" Tags="|files|saving|development|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3272" PostTypeId="1" AcceptedAnswerId="3385" CreationDate="2014-11-07T20:36:04.813" Score="11" ViewCount="1244" Body="&lt;p&gt;I have a keyboard which, for some inexplicable reason, features a key that sends the Danish Dollar symbol to OS X - &lt;code&gt;§&lt;/code&gt;. With shift it sends the plus/minus symbol - &lt;code&gt;±&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible within Emacs to see the &lt;code&gt;§&lt;/code&gt; key and convert that into Hyper or Super? So if I hold down that &lt;code&gt;§&lt;/code&gt; key and press &lt;code&gt;f&lt;/code&gt;, it will activate &lt;code&gt;H-f&lt;/code&gt; in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the following, which does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;§&quot;) (kbd &quot;&amp;lt;Hyper&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It just says &lt;code&gt;&amp;lt;Hyper&amp;gt; is undefined&lt;/code&gt; upon pressing the key, and doesn't act as a modifier at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;§&quot;) &quot;&amp;lt;Hyper&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that just turns the &lt;code&gt;§&lt;/code&gt; key into a &lt;code&gt;&amp;lt;&lt;/code&gt;key.&lt;/p&gt;&#xA;" OwnerUserId="2459" LastActivityDate="2014-11-11T15:51:23.483" Title="Convert a normal key into a modifier key" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3273" PostTypeId="2" ParentId="2520" CreationDate="2014-11-07T20:42:06.037" Score="1" Body="&lt;p&gt;I added &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (when (string= (buffer-name) &quot;init.el&quot;)&#xA;    (setq imenu-generic-expression&#xA;      '((nil &quot;^;; \\[ \\(.*\\)&quot; 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to emacs-lisp-mode-hook. Then add to the file sections &quot;yasnippet&quot;, &quot;packaging&quot;, &quot;java mode&quot;, etc. This Works nice for my 1000 lines of code (comments included).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Finally i switch between sections with helm-imenu. Actually helm hooks into normal imenu function automagically so all i need is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       (local-set-key (kbd &quot;C-*&quot;) 'imenu)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="970" LastEditorUserId="970" LastEditDate="2014-11-08T21:14:56.497" LastActivityDate="2014-11-08T21:14:56.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3274" PostTypeId="2" ParentId="3271" CreationDate="2014-11-07T20:43:29.880" Score="2" Body="&lt;h3&gt;Safe way to tweak an emacs uilt-in or 3rd party function&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You can always re-define a function defined in the source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the emacs SE question &lt;a href=&quot;https://emacs.stackexchange.com/q/107/115&quot;&gt;How do I disable ffap (find file at point) when the first two non-space characters in a line are '//'?&lt;/a&gt;, Sigma suggested in &lt;a href=&quot;https://emacs.stackexchange.com/a/132/115&quot;&gt;his answer&lt;/a&gt; to re-define the &lt;code&gt;ffap-string-at-point&lt;/code&gt; function to solve the problem described in that question. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;How can one avoid re-defining built-in functions by mistake&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can adopt a practice to use a prefix like &lt;code&gt;my/&lt;/code&gt; for your own functions and variables. e.g. &lt;code&gt;my/find-file&lt;/code&gt;. That way you can be rest assured that you are not overriding any of the emacs built-in functions/variables.&lt;/li&gt;&#xA;&lt;li&gt;Before defining a new function of your own, you can check if an interactive function by the same name already exists by doing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;FUNCTION-NAME&lt;/code&gt;. If that function exists, you will see its description.&lt;/li&gt;&#xA;&lt;li&gt;You can grep for a function or variable name in emacs source code and &lt;code&gt;elpa&lt;/code&gt; folder to check if that function/variable already exists.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The easiest way to be safe is the first bullet mentioned above. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-11-08T05:18:52.627" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3275" PostTypeId="2" ParentId="3270" CreationDate="2014-11-07T21:01:54.663" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Bookmark highlighting, including highlighting of autofile bookmarks, is provided by &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;, not by &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;https://stackoverflow.com/questions/15363695/emacs-how-to-install-and-use-dired&quot;&gt;old S.O. post you cite&lt;/a&gt; was up-to-date when it was written. Today, you just use command &lt;code&gt;dired&lt;/code&gt;. It is advised, and functions it calls are modified, to do what the &lt;strong&gt;Dired+&lt;/strong&gt; doc says.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You do not need to explicitly &lt;code&gt;require&lt;/code&gt; &lt;code&gt;dired-x.el&lt;/code&gt; - &lt;strong&gt;Dired+&lt;/strong&gt; does that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;All the information you need should be in the &lt;code&gt;dired+.el&lt;/code&gt; file header.  If something is missing, please send me an email about it. Thx.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-11-07T21:01:54.663" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3276" PostTypeId="1" AcceptedAnswerId="3281" CreationDate="2014-11-07T21:04:10.377" Score="3" ViewCount="582" Body="&lt;p&gt;Some context:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm doing some linux kernel development on a Debian VM so naturally I'm using tramp. I want to use semantic-symref, but the trouble is that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Semantic will eventually call &lt;code&gt;cedet-gnu-global-call&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Which will use the value of &lt;code&gt;cedet-global-command&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Which will crap out because it uses 'call-process.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So from what I understand, I need it to be using &lt;code&gt;tramp-call-process&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, can I monkey patch a function, namely &lt;code&gt;cedet-gnu-global-call&lt;/code&gt;? I have seen stuff like &lt;code&gt;defadvice&lt;/code&gt;, is this a use case for my problem? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By monkey patching, I mean that I want to replace &lt;code&gt;cedet-gnu-global-call&lt;/code&gt; with mine, but at runtime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there some way to get &lt;code&gt;cedet-global to be smart&lt;/code&gt; when used over tramp?&lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="25" LastEditDate="2014-11-12T05:00:26.200" LastActivityDate="2014-11-12T05:01:25.017" Title="Monkey patching a function" Tags="|elisp|functions|advice|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3279" PostTypeId="1" AcceptedAnswerId="3284" CreationDate="2014-11-07T21:58:30.970" Score="0" ViewCount="134" Body="&lt;p&gt;sometimes I see a &quot;unkosher&quot; use of autoload coookie, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;###autoload&#xA;(add-hook 'some-hook 'some-fun)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How will the above work? Will it add a hook just by being installed (as autoloads get loaded automatically)?&lt;/p&gt;&#xA;" OwnerUserId="98" LastEditorUserId="105" LastEditDate="2015-05-20T05:11:43.950" LastActivityDate="2015-05-20T05:11:43.950" Title="How does autoload cookie work on non defun form" Tags="|elisp|package|hooks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3280" PostTypeId="1" AcceptedAnswerId="3285" CreationDate="2014-11-07T22:06:10.623" Score="12" ViewCount="4455" Body="&lt;p&gt;Is there a simple way to insert an org-mode link directly from the system clipboard? I'm thinking of selecting an URL in Safari, and inserting that link directly in an org-mode document.&lt;/p&gt;&#xA;" OwnerUserId="2317" LastActivityDate="2015-10-14T03:49:34.623" Title="Orgmode insert link from clipboard?" Tags="|org-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3281" PostTypeId="2" ParentId="3276" CreationDate="2014-11-07T22:10:18.593" Score="3" Body="&lt;p&gt;In Emacs ≥24.4, you could try something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-call-process-hack (orig program &amp;amp;rest args)&#xA;  (apply (if (equal program cedet-global-command) #'process-file orig)&#xA;         program args))&#xA;(advice-add 'call-process :around #'my-call-process-hack)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="25" LastEditDate="2014-11-12T05:01:25.017" LastActivityDate="2014-11-12T05:01:25.017" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3282" PostTypeId="2" ParentId="3245" CreationDate="2014-11-07T22:13:08.343" Score="5" Body="&lt;p&gt;The big question is whether you want this behavior for &lt;code&gt;kill-buffer&lt;/code&gt; itself, which means not only when you call it interactively but for every use of it in existing Lisp code, or whether you want it only for interactive use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll assume the latter.  In that case, leave &lt;code&gt;kill-buffer&lt;/code&gt; alone, define your own command that does what you want, and remap the keys that are normally bound to &lt;code&gt;kill-buffer&lt;/code&gt; to your command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [remap kill-buffer] 'my-kill-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For your &lt;code&gt;my-kill-buffer&lt;/code&gt; command, just check at the outset whether the buffer has been modified, and if so then launch &lt;code&gt;ediff&lt;/code&gt; for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To check whether it has been modified, use &lt;code&gt;buffer-modified-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To &lt;code&gt;ediff&lt;/code&gt; you would presumably want to grab the file (i.e., the buffer as saved), and diff it against the current, modified buffer. You might need to fiddle a bit to do that - I don't know of an existing &lt;code&gt;ediff&lt;/code&gt; command that does that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But maybe all you really need is something like &lt;code&gt;highlight-changes-mode&lt;/code&gt;.  See the Emacs manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Highlight-Interactively.html#Highlight-Interactively&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Highlight Interactively&lt;/code&gt;&lt;/a&gt;.&#xA;In other words, maybe all you need is to invoke &lt;code&gt;highlight-changes-mode&lt;/code&gt; if the buffer has been modified.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:50:54.847" LastActivityDate="2015-05-09T20:50:54.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3283" PostTypeId="1" AcceptedAnswerId="5816" CreationDate="2014-11-07T22:15:47.353" Score="6" ViewCount="1162" Body="&lt;p&gt;When I open multiple files at once with &lt;code&gt;emacs&lt;/code&gt;, like &lt;code&gt;emacs file1 file2&lt;/code&gt;, it opens the two files side-by-side (in different windows in the same frame). But when I do the same with &lt;code&gt;emacsclient&lt;/code&gt;, it only shows the first one. The others are also opened but not visible. How do I get the emacs behavior with emacsclient?&lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="25" LastEditDate="2014-11-12T23:31:44.960" LastActivityDate="2018-04-05T06:36:16.633" Title="Make emacsclient open multiple files in separate windows" Tags="|window|emacsclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3284" PostTypeId="2" ParentId="3279" CreationDate="2014-11-07T22:34:40.750" Score="2" Body="&lt;p&gt;You can find the answer yourself, by using &lt;code&gt;i autoload&lt;/code&gt; in the Elisp manual. That takes you to node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html#Autoload&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Autoload&lt;/code&gt;&lt;/a&gt; (funny about that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This part of that node gives you the answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The same magic comment can copy any kind of form into &lt;code&gt;loaddefs.el&lt;/code&gt;.&#xA;  The form following the magic comment is copied verbatim, &lt;em&gt;except&lt;/em&gt; if it&#xA;  is one of the forms which the autoload facility handles specially&#xA;  (e.g., by conversion into an &lt;code&gt;autoload&lt;/code&gt; call).  The forms which are not&#xA;  copied verbatim are the following:...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That means that your &lt;code&gt;(add-hook 'some-hook 'some-fun)&lt;/code&gt; is executed when the file is loaded, and it is also added to &lt;code&gt;loaddefs.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the form is on the same line as the autoload cookie then it is just copied to &lt;code&gt;loaddefs.el&lt;/code&gt;.  If on the same line, the form is effectively commented out, so it has no effect when the file is loaded. From the same node:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can also use a magic comment to execute a form at build time&#xA;  &lt;em&gt;without&lt;/em&gt; executing it when the file itself is loaded.  To do this,&#xA;  write the form &lt;em&gt;on the same line&lt;/em&gt; as the magic comment.  Since it is in&#xA;  a comment, it does nothing when you load the source file; but &lt;code&gt;M-x update-file-autoloads&lt;/code&gt; copies it to &lt;code&gt;loaddefs.el&lt;/code&gt;, where it is executed&#xA;  while building Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-07T22:40:14.830" LastActivityDate="2014-11-07T22:40:14.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3285" PostTypeId="2" ParentId="3280" CreationDate="2014-11-07T22:52:02.133" Score="14" Body="&lt;p&gt;Your question isn't very specific with respect to what type of link you want and what you would consider to be &quot;simple&quot;. Assuming that you mean a link of the following form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[target][description]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the default workflow (after putting the URL in your clipboard) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-c C-l&lt;/kbd&gt; &lt;kbd&gt;C-y&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;description&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Entering a &lt;code&gt;description&lt;/code&gt; is optional; if you don't specify one, the link will be of the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[target]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastActivityDate="2014-11-07T22:52:02.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3286" PostTypeId="2" ParentId="3221" CreationDate="2014-11-07T22:56:35.337" Score="0" Body="&lt;p&gt;This does not respond to the part about updating/installing/loading the same packages etc. But with respect to porting some other aspects of your Emacs setup, you can also try using a &lt;em&gt;saved desktop&lt;/em&gt; in the other environment (e.g. on the other machine). Just copy your desktop file(s) to the other environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can have any number of saved Emacs desktops (desktop files). And starting with Emacs 24.4, they can even restore frame and window configurations, buffer associations, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A handy way to switch among desktops is to use &lt;strong&gt;desktop bookmarks&lt;/strong&gt;.  For that, you just need library &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;. &lt;strong&gt;&lt;code&gt;C-x p K&lt;/code&gt;&lt;/strong&gt; saves the current setup as a &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#DesktopBookmarks&quot; rel=&quot;nofollow&quot;&gt;desktop bookmark&lt;/a&gt;.  Just &quot;jump&quot; to the bookmark to restore that particular desktop.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-07T23:07:54.543" LastActivityDate="2014-11-07T23:07:54.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3287" PostTypeId="2" ParentId="3280" CreationDate="2014-11-07T23:12:33.567" Score="4" Body="&#xA;&#xA;&lt;p&gt;Depending on which of the two you prefer, here are two functions that check to see if there's a URL on the clipboard and, if so, insert it at point as an &lt;code&gt;org-mode&lt;/code&gt; link.  The former does it in the form of &lt;code&gt;[[url]]&lt;/code&gt;, and the latter in the form of &lt;code&gt;[[url][description]]&lt;/code&gt; and leaves you in the &lt;code&gt;description&lt;/code&gt; field.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-url-as-org-link-sparse ()&#xA;  &quot;If there's a URL on the clipboard, insert it as an org-mode&#xA;link in the form of [[url]].&quot;&#xA;  (interactive)&#xA;  (let ((link (substring-no-properties (x-get-selection 'CLIPBOARD)))&#xA;        (url  &quot;\\(http[s]?://\\|www\\.\\)&quot;))&#xA;    (save-match-data&#xA;      (if (string-match url link)&#xA;          (insert (concat &quot;[[&quot; link &quot;]]&quot;))&#xA;        (error &quot;No URL on the clipboard&quot;)))))&#xA;&#xA;(defun insert-url-as-org-link-fancy ()&#xA;  &quot;If there's a URL on the clipboard, insert it as an org-mode&#xA;link in the form of [[url][*]], and leave point at *.&quot;&#xA;  (interactive)&#xA;  (let ((link (substring-no-properties (x-get-selection 'CLIPBOARD)))&#xA;        (url  &quot;\\(http[s]?://\\|www\\.\\)&quot;))&#xA;    (save-match-data&#xA;      (if (string-match url link)&#xA;          (progn&#xA;            (insert (concat &quot;[[&quot; link &quot;][]]&quot;))&#xA;            (backward-char 2))&#xA;        (error &quot;No URL on the clipboard&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="115" LastEditDate="2015-10-14T03:29:35.630" LastActivityDate="2015-10-14T03:29:35.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3289" PostTypeId="1" AcceptedAnswerId="3299" CreationDate="2014-11-08T02:16:58.417" Score="7" ViewCount="743" Body="&lt;p&gt;When I press the &quot;l&quot; key in the main Magit status mode, it pops up a window where I can adjust the options to be passed to the &lt;code&gt;magit log&lt;/code&gt; command.  Can I arrange for the &lt;code&gt;--all&lt;/code&gt; option to always be initially selected, just as the &lt;code&gt;--graph&lt;/code&gt; option is?&lt;/p&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2015-07-03T14:56:49.607" Title="Can I have the git-log &quot;--all&quot; option be initially selected?" Tags="|magit|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3291" PostTypeId="1" CreationDate="2014-11-08T09:47:58.307" Score="6" ViewCount="595" Body="&lt;p&gt;I use precompiled Emacs binaries (24.3) right now.  AFAIK, v24.4 is already available as binaries, so there is no incentive for me to compile Emacs myself to stay current.  I'm thinking, however, whether there are not other advantages of building Emacs myself, especially in terms of performance and/or learning (i.e., the possibility of inspecting C source code easily).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: what do I gain if I compile Emacs myself?&lt;/p&gt;&#xA;" OwnerUserId="642" LastEditorUserId="50" LastEditDate="2014-11-08T10:36:59.847" LastActivityDate="2014-11-08T13:55:52.777" Title="What are the advantages of building Emacs from source?" Tags="|compilation|performance|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3292" PostTypeId="1" AcceptedAnswerId="3293" CreationDate="2014-11-08T09:48:59.000" Score="10" ViewCount="403" Body="&lt;p&gt;When writing a major mode, it's often useful to know 'is point in a string?' 'is point in a comment?'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most major modes seem to attempt to parse the programming language. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;python-syntax-content&lt;/code&gt; calls &lt;code&gt;syntax-ppss&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;haskell-fill-paragraph&lt;/code&gt; calls &lt;code&gt;syntax-ppss&lt;/code&gt; and &lt;code&gt;re-search-forward&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;c-in-comment-line-prefix-p&lt;/code&gt; moves point around and calls &lt;code&gt;looking-at&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;sp-point-in-comment&lt;/code&gt; calls &lt;code&gt;syntax-ppss&lt;/code&gt; but also checks if it's on a comment delimeter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, this doesn't work in some cases. In org-mode buffers, comments in source blocks are not correctly detected by these approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also seems pointless, since &lt;em&gt;the buffer is already showing comments highlighted&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, you could simply inspect the faces at point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wh--get-faces (pos)&#xA;  &quot;Get all the font faces at POS.&quot;&#xA;  (remq nil&#xA;        (list&#xA;         (get-char-property pos 'read-face-name)&#xA;         (get-char-property pos 'face)&#xA;         (plist-get (text-properties-at pos) 'face))))&#xA;&#xA;(defun wh-string-p (pos)&#xA;  &quot;Return non-nil if POS is inside a string.&quot;&#xA;  (memq 'font-lock-string-face (wh--get-faces pos)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why don't major modes do this? The buffer is already fontified, so I would expect this to be faster, more robust, and require less code.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2014-11-08T10:37:49.910" LastActivityDate="2014-11-08T16:00:38.620" Title="Why don't major modes just inspect the faces?" Tags="|major-mode|syntax-highlighting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3293" PostTypeId="2" ParentId="3292" CreationDate="2014-11-08T10:01:19.337" Score="12" Body="&lt;p&gt;The problem is that it is not more robust.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, the major modes are precisely the ones responsible for deciding what's a comment or a string. If they were able to successfully define them for the purpose of font-locking, they should be able to do the same for other purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, reading the syntax to determine the context that point is inside is the more robust way of doing it if it is done right. If you have found instances where that fails, it's worth submitting a bug report to the major-mode author.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The reason why inspecting the faces is less robust is because it can fail in some situations. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For starters, the user could have disabled &lt;code&gt;font-lock-mode&lt;/code&gt; (maybe it's a huge buffer), but even with &lt;code&gt;font-lock-mode&lt;/code&gt; enabled, faces are somewhat unstable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also, the user could have a minor-mode that adds some &lt;code&gt;font-lock-keywords&lt;/code&gt; (like highlighting &lt;code&gt;TODO&lt;/code&gt; in comments). Or there might be a minor mode that dynamically applies some faces after font-lock has fontified the buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In summary, the major mode has no guarantee that the faces defined by it are the faces currently applied.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="304" LastEditDate="2014-11-08T16:00:38.620" LastActivityDate="2014-11-08T16:00:38.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3294" PostTypeId="2" ParentId="3291" CreationDate="2014-11-08T10:27:02.883" Score="5" Body="&lt;ul&gt;&#xA;&lt;li&gt;Deploy different versions of Emacs at the same machine (for Emacs plugin development)&lt;/li&gt;&#xA;&lt;li&gt;If your OS is too old and you are not a super user, install the latest stable Emacs at your $HOME is the only solution.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There is no performance advantage if you compile it by yourself.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="2096" LastEditDate="2014-11-08T13:55:52.777" LastActivityDate="2014-11-08T13:55:52.777" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3295" PostTypeId="2" ParentId="3221" CreationDate="2014-11-08T10:31:13.960" Score="0" Body="&lt;p&gt;check my project elpa-mirror &lt;a href=&quot;https://github.com/redguardtoo/elpa-mirror&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/elpa-mirror&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you build a package repository on your memory stick. redirect your .emacs to that local repository. end of story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;copy ~/.emacs.d may not work. because different versions of Emacs will compile the same package into in-compatible *.elc&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2014-11-08T10:31:13.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3296" PostTypeId="2" ParentId="2520" CreationDate="2014-11-08T10:43:20.513" Score="1" Body="&lt;p&gt;Follow the setup of an Emacs master, e.g., &lt;a href=&quot;https://github.com/purcell/emacs.d&quot; rel=&quot;nofollow&quot;&gt;https://github.com/purcell/emacs.d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, regarding how to organize manually installed packages and packages installed from ELPA, &lt;a href=&quot;https://github.com/purcell/emacs.d/blob/master/README.md&quot; rel=&quot;nofollow&quot;&gt;Steven Purcell's setup has&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a place for 3rd party code which isn't available in MELPA or other&#xA;package repositories. This directory and its immediate&#xA;subdirectories will be added to load-path at start-up time.&#xA;&#xA;Notably, in Emacs 23.x, a backported package.el is automatically&#xA;downloaded and installed here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why follow a master? A major point of my &lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide&quot; rel=&quot;nofollow&quot;&gt;&quot;Master emacs in one year&quot;&lt;/a&gt; is that newbies can thus efficiently avoid setup overhead and &quot;gotchas.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that many people don't agree with me, but here's my case (detailed in &lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide&quot; rel=&quot;nofollow&quot;&gt;my article&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started using Emacs by using Purcell's well-respected (&lt;strong&gt;1403&lt;/strong&gt; GitHub stars as of Nov 2014!), stable (5 years in development) configuration. Despite starting from that, I still had &lt;a href=&quot;https://github.com/purcell/emacs.d/issues?q=author%3Aredguardtoo+&quot; rel=&quot;nofollow&quot;&gt;many problems&lt;/a&gt;. Steve Purcell helped me solve all those problems. (I actually became his &lt;a href=&quot;https://en.wikipedia.org/wiki/Jedi#Padawan&quot; rel=&quot;nofollow&quot;&gt;Padawan&lt;/a&gt; for over a year.) By using his setup, and using his repo's issues to report problems, and taking advantage of his experience, I avoided wasting much time. Even today, I still observe many people using &lt;code&gt;git submodule&lt;/code&gt; to manage the third-party plugins. Both Steve and I &lt;a href=&quot;https://github.com/purcell/emacs.d/issues/8&quot; rel=&quot;nofollow&quot;&gt;gave up using &lt;code&gt;git submodule&lt;/code&gt; for this&lt;/a&gt; because it can be such a &lt;a href=&quot;https://en.wiktionary.org/wiki/PITA&quot; rel=&quot;nofollow&quot;&gt;PITA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you are very confident of your skills or much prefer self-learning, this is not the path for you.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="5444" LastEditDate="2016-09-18T04:55:15.693" LastActivityDate="2016-09-18T04:55:15.693" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3297" PostTypeId="2" ParentId="3203" CreationDate="2014-11-08T10:55:22.410" Score="0" Body="&lt;p&gt;I think it's pretty easy, you don't need emacs lisp to under this, it's just elementary school math.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f(0) = 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f(1) = 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f(n) = f(n-1) + n when n &gt; 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so f(5) = 5 + f(4) = 5 + 4 + f(3) = 5 + 4 + 3 + 2 + 1 + 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it's obvious.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2014-11-08T10:55:22.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3299" PostTypeId="2" ParentId="3289" CreationDate="2014-11-08T12:21:11.297" Score="8" Body="&lt;p&gt;You can define a custom command to do what you want, and bind it to &lt;code&gt;l&lt;/code&gt; to override the default behavior:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun magit-log-all ()&#xA;  (interactive)&#xA;  (magit-key-mode-popup-logging)&#xA;  (magit-key-mode-toggle-option (quote logging) &quot;--all&quot;))&#xA;&#xA;(define-key magit-mode-map (kbd &quot;l&quot;) 'magit-log-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place, pressing &lt;kbd&gt;l&lt;/kbd&gt; in &lt;code&gt;magit-mode&lt;/code&gt; automatically selects the &lt;code&gt;--all&lt;/code&gt; option in the menu that comes up.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Additional information&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In case you are curious, here is how I arrived at the solution above: There are two steps involved in what you are currently doing to set options for &lt;code&gt;git log&lt;/code&gt;. First, you bring up the menu for choosing options by pressing &lt;kbd&gt;l&lt;/kbd&gt;. To tell &lt;code&gt;magit&lt;/code&gt; to pass the &lt;code&gt;--all&lt;/code&gt; option to &lt;code&gt;git log&lt;/code&gt;, you then have to press &lt;code&gt;-al&lt;/code&gt;. If you want to define a custom command to automate this process, you need to know which commands are bound to these key presses. This information can be obtained by pressing &lt;kbd&gt;C-h c&lt;/kbd&gt; (&lt;code&gt;describe-key-briefly&lt;/code&gt;) or &lt;kbd&gt;C-h k&lt;/kbd&gt; (&lt;code&gt;describe-key&lt;/code&gt;) followed by the key sequence you want to examine.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;C-h c&lt;/kbd&gt; &lt;kbd&gt;l&lt;/kbd&gt; in a &lt;code&gt;magit-mode&lt;/code&gt; buffer gives:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;l&lt;/code&gt; runs the command &lt;code&gt;magit-key-mode-popup-logging&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;C-h c&lt;/kbd&gt; &lt;kbd&gt;-al&lt;/kbd&gt; &lt;em&gt;after pressing&lt;/em&gt; &lt;kbd&gt;l&lt;/kbd&gt; in a &lt;code&gt;magit-mode&lt;/code&gt; buffer gives:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;- a l&lt;/code&gt; runs the command &lt;code&gt;(lambda nil (interactive) (magit-key-mode-toggle-option (quote logging) &quot;--all&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Equipped with this information, all that's left to do is create a command that calls the relevant functions in the right order.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-20T13:20:31.460" LastActivityDate="2015-01-20T13:20:31.460" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3300" PostTypeId="2" ParentId="3292" CreationDate="2014-11-08T14:42:46.663" Score="2" Body="&lt;p&gt;I guess the main reason is because font-lock uses &lt;code&gt;syntax-ppss&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-08T14:42:46.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3301" PostTypeId="2" ParentId="3272" CreationDate="2014-11-08T15:08:26.053" Score="3" Body="&lt;p&gt;You may nor may not be able to rebind the section sign key (§ key) to send the hyper command, however you could rebind the caps-lock key to send Hyper, using &lt;a href=&quot;https://pqrs.org/osx/karabiner/seil.html&quot; rel=&quot;nofollow&quot;&gt;Seil PCKeyboardHack&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to rebind the caps-lock key in Seil, just do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open up Seil and click 'Change the caps lock key'.&lt;/li&gt;&#xA;&lt;li&gt;Select the checkbox next to 'Change the caps lock key'.&lt;/li&gt;&#xA;&lt;li&gt;Double click on the keycode, and enter the keycode 80.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2469" LastEditorUserId="2469" LastEditDate="2014-11-10T17:25:08.380" LastActivityDate="2014-11-10T17:25:08.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3302" PostTypeId="1" AcceptedAnswerId="9813" CreationDate="2014-11-08T18:04:10.123" Score="9" ViewCount="3216" Body="&lt;p&gt;Recently I've noticed the function I had been using to do refresh had stopped working and I had to change to a simpler call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun k/org-babel-refresh-inline-images ()&#xA;  (org-display-inline-images nil t))&#xA;&#xA;(add-hook 'org-babel-after-execute-hook 'k/org-babel-refresh-inline-images)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which had been recommended on the &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2014-07/msg00309.html&quot; rel=&quot;noreferrer&quot;&gt;mailing list&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, that stopped working and I've found:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'org-babel-after-execute-hook 'org-display-inline-images)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to work, but I'm not sure why the original stopped working. Presumably, the original version might be more efficient if it worked. Why doesn't it, and why was the original preferred?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2020-07-10T08:48:31.787" Title="live refresh of inline images with org-display-inline-images" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3303" PostTypeId="1" AcceptedAnswerId="3315" CreationDate="2014-11-08T19:06:05.343" Score="0" ViewCount="65" Body="&lt;p&gt;I'm editing a large book in one file (78K according to Emacs; should I divide each chapter in files instead?), when I call &lt;code&gt;muse-publish-this-file&lt;/code&gt; it makes Emacs hangs (to not respond, unless I press &lt;kbd&gt;C-&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt;), when this command is execute the RAM use of Emacs grows to 95%!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just have this in my Emacs configuration regarding Muse:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'muse-mode)&#xA;(require 'muse-docbook)&#xA;(require 'muse-project)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have DocBook installed on my GNU/Linux machine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ &amp;gt; LC_ALL=C pacman -Qs docbook                                                                                                             &#xA;local/docbook-xml 4.5-6&#xA;    A widely used XML scheme for writing documentation and help&#xA;local/docbook-xsl 1.78.1-1&#xA;    XML stylesheets for Docbook-xml transformations&#xA;~ &amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not using/defining a Muse project since I'm putting everything in one file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have noticed that the amount of RAM doesn't decrease if I stop the command, only after I close Emacs the amount of RAM in use go back to normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the &lt;em&gt;*Backtrace*&lt;/em&gt; using &lt;code&gt;toggle-debug-on-quit&lt;/code&gt; and quitting after reproducing the hang.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (quit)&#xA;  looking-at(&quot;^\\(&amp;lt;\\(/?\\)quote&amp;gt;\\)&quot;)&#xA;  #[(indent) &quot;\301 \210\302\225b\210`dW\205�\303!?\207&quot; [quote-regexp muse-forward-paragraph 0 looking-at] 2](&quot;[[:blank:]]+&quot;)&#xA;  muse-publish-surround-text(&quot;&amp;lt;para&amp;gt;&quot; &quot;&amp;lt;/para&amp;gt;&quot; #[(indent) &quot;\301 \210\302\225b\210`dW\205�\303!?\207&quot; [quote-regexp muse-forward-paragraph 0 looking-at] 2] nil nil nil &quot;^\\(&amp;lt;\\(/?\\)quote&amp;gt;\\)&quot;)&#xA;  muse-publish-quote-tag(44306 #&amp;lt;marker at 5860133 in  *muse-temp*&amp;gt;)&#xA;  apply(muse-publish-quote-tag (44306 #&amp;lt;marker at 5860133 in  *muse-temp*&amp;gt;))&#xA;  muse-publish-markup-tag()&#xA;  muse-publish-markup(&quot;en donde dice la biblia que&quot; ((1000 &quot;\\(\\`\n+\\|\n+\\'\\)&quot; 0 &quot;&quot;) (1100 &quot;[[:blank:]]+$&quot; 0 &quot;&quot;) (1200 &quot;\\`#\\([a-zA-Z-]+\\)\\s-+\\(.+\\)\n+&quot; 0 directive) (1250 &quot;^;\\(?:[[:blank:]]+\\(.+\\)\\|$\\|'\\)&quot; 0 comment) (1300 muse-tag-regexp 0 tag) (1400 muse-explicit-link-regexp 0 muse-publish-mark-link) (1600 &quot;\\(^\\|[-[[:blank:]&amp;lt;('`\&quot;\n]\\)\\(=[^=[:blank:]\n]\\|_[^_[:blank:]\n]\\|\\*+[^*[:blank:]\n]\\)&quot; 2 word) (1700 &quot;^\\(\\*+\\)\\s-+&quot; 0 heading) (1800 &quot;\\.\\.\\.\\.&quot; 0 enddots) (1850 &quot;\\.\\.\\.&quot; 0 dots) (1900 &quot;^----+&quot; 0 rule) (1950 &quot;~~&quot; 0 no-break-space) (2000 &quot;^Footnotes:?\\s-*&quot; 0 fn-sep) (2100 &quot;\\[\\([1-9][0-9]*\\)\\]&quot; 0 footnote) (2200 &quot;^[[:blank:]]*\\(\\([^\n[:blank:]].*?\\)?::\\(?:[[:blank:]]+\\|$\\)\\|[[:blank:]]-[[:blank:]]*\\|[[:blank:]][0-9]+\\.[[:blank:]]*\\)&quot; 0 list) (2300 &quot;^[[:blank:]]*\\+\\(-*\\+\\)+[[:blank:]]*\n\\(\\([[:blank:]]*|\\(.*|\\)*[[:blank:]]*\n\\)+\\([[:blank:]]*\\+\\(-*\\+\\)+[[:blank:]]*\\)\\(\n\\|\\'\\)\\)+&quot; 0 table-el) (2350 &quot;\\(\\([[:blank:]]*\n\\)?\\(\\(?:.*[[:blank:]]+\\(|+\\)\\(?:[[:blank:]]\\|$\\).*\\|[[:blank:]]*|[-+]+|[[:blank:]]*\\)\\(?:\n\\|\\'\\)\\)\\)+&quot; 0 table) (2400 &quot;^\\([[:blank:]]+\\).+&quot; 0 quote) (2500 &quot;\\(^\\|[[:blank:]]*\\)---?\\($\\|[[:blank:]]*\\)&quot; 0 emdash) (2600 &quot;^[[:blank:]]*&amp;gt; &quot; 0 verse) (2700 &quot;^\\(\\W*\\)#\\(\\S-+\\)\\s-*&quot; 0 anchor) (2900 muse-explicit-link-regexp 0 link) (3000 muse-url-regexp 0 url) (3500 &quot;\\([^[]\\)[-a-zA-Z0-9._]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+&quot; 0 email) (10000 &quot;\\(\\(\n\\(?:[[:blank:]]*\n\\)*\\([[:blank:]]*\n\\)\\)\\|\\`\\s-*\\|\\s-*\\'\\)&quot; 3 muse-docbook-markup-paragraph)))&#xA;  muse-publish-markup-region(1 78473 &quot;en donde dice la biblia que&quot; (&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file))&#xA;  muse-publish-markup-buffer(&quot;en donde dice la biblia que&quot; (&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file))&#xA;  byte-code(&quot;rq\210\306 !\210\307\310!\210\n\203�\311 \210\312\313\314  !\f\&quot;\210)\315&#xA;!\203,�\316\317\f   &#xA;%\210)\306\207&quot; [temp-buffer file muse-publish-enable-local-variables muse-inhibit-before-publish-hook style output-path muse-insert-file-contents run-hooks muse-before-publish-hook hack-local-variables t muse-publish-markup-buffer muse-page-name muse-write-file muse-style-run-hooks :final target] 6)&#xA;  muse-publish-file(&quot;/home/jorge/Documentos/en donde dice la biblia que.muse&quot; (&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file) &quot;/home/jorge/Documentos/&quot; nil)&#xA;  muse-publish-this-file((&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file) &quot;/home/jorge/Documentos/&quot; nil)&#xA;  call-interactively(muse-publish-this-file record nil)&#xA;  command-execute(muse-publish-this-file record)&#xA;  execute-extended-command(nil &quot;muse-publish-this-file&quot;)&#xA;  call-interactively(execute-extended-command nil nil)&#xA;  command-execute(execute-extended-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; seems like Muse cannot export the quote tag to docbook. I have a large quote in the document, and since I changed the tags to &lt;code&gt;verse&lt;/code&gt; I can export to docbook correctly (however, the RAM use by Emacs don't decrease after exporting). If I change the quote content with a couple of lines and try to export, this error is yelled by Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range -1 -1)&#xA;  replace-match(&quot;&quot; t t nil 1)&#xA;  muse-publish-surround-text(&quot;&amp;lt;para&amp;gt;&quot; &quot;&amp;lt;/para&amp;gt;&quot; #[(indent) &quot;\301 \210\302\225b\210`dW\205�\303!?\207&quot; [quote-regexp muse-forward-paragraph 0 looking-at] 2] nil nil nil &quot;^\\(&amp;lt;\\(/?\\)quote&amp;gt;\\)&quot;)&#xA;  muse-publish-quote-tag(44306 #&amp;lt;marker at 44376 in  *muse-temp*-62374&amp;gt;)&#xA;  apply(muse-publish-quote-tag (44306 #&amp;lt;marker at 44376 in  *muse-temp*-62374&amp;gt;))&#xA;  muse-publish-markup-tag()&#xA;  muse-publish-markup(&quot;prueba1&quot; ((1000 &quot;\\(\\`\n+\\|\n+\\'\\)&quot; 0 &quot;&quot;) (1100 &quot;[[:blank:]]+$&quot; 0 &quot;&quot;) (1200 &quot;\\`#\\([a-zA-Z-]+\\)\\s-+\\(.+\\)\n+&quot; 0 directive) (1250 &quot;^;\\(?:[[:blank:]]+\\(.+\\)\\|$\\|'\\)&quot; 0 comment) (1300 muse-tag-regexp 0 tag) (1400 muse-explicit-link-regexp 0 muse-publish-mark-link) (1600 &quot;\\(^\\|[-[[:blank:]&amp;lt;('`\&quot;\n]\\)\\(=[^=[:blank:]\n]\\|_[^_[:blank:]\n]\\|\\*+[^*[:blank:]\n]\\)&quot; 2 word) (1700 &quot;^\\(\\*+\\)\\s-+&quot; 0 heading) (1800 &quot;\\.\\.\\.\\.&quot; 0 enddots) (1850 &quot;\\.\\.\\.&quot; 0 dots) (1900 &quot;^----+&quot; 0 rule) (1950 &quot;~~&quot; 0 no-break-space) (2000 &quot;^Footnotes:?\\s-*&quot; 0 fn-sep) (2100 &quot;\\[\\([1-9][0-9]*\\)\\]&quot; 0 footnote) (2200 &quot;^[[:blank:]]*\\(\\([^\n[:blank:]].*?\\)?::\\(?:[[:blank:]]+\\|$\\)\\|[[:blank:]]-[[:blank:]]*\\|[[:blank:]][0-9]+\\.[[:blank:]]*\\)&quot; 0 list) (2300 &quot;^[[:blank:]]*\\+\\(-*\\+\\)+[[:blank:]]*\n\\(\\([[:blank:]]*|\\(.*|\\)*[[:blank:]]*\n\\)+\\([[:blank:]]*\\+\\(-*\\+\\)+[[:blank:]]*\\)\\(\n\\|\\'\\)\\)+&quot; 0 table-el) (2350 &quot;\\(\\([[:blank:]]*\n\\)?\\(\\(?:.*[[:blank:]]+\\(|+\\)\\(?:[[:blank:]]\\|$\\).*\\|[[:blank:]]*|[-+]+|[[:blank:]]*\\)\\(?:\n\\|\\'\\)\\)\\)+&quot; 0 table) (2400 &quot;^\\([[:blank:]]+\\).+&quot; 0 quote) (2500 &quot;\\(^\\|[[:blank:]]*\\)---?\\($\\|[[:blank:]]*\\)&quot; 0 emdash) (2600 &quot;^[[:blank:]]*&amp;gt; &quot; 0 verse) (2700 &quot;^\\(\\W*\\)#\\(\\S-+\\)\\s-*&quot; 0 anchor) (2900 muse-explicit-link-regexp 0 link) (3000 muse-url-regexp 0 url) (3500 &quot;\\([^[]\\)[-a-zA-Z0-9._]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+&quot; 0 email) (10000 &quot;\\(\\(\n\\(?:[[:blank:]]*\n\\)*\\([[:blank:]]*\n\\)\\)\\|\\`\\s-*\\|\\s-*\\'\\)&quot; 3 muse-docbook-markup-paragraph)))&#xA;  muse-publish-markup-region(1 44459 &quot;prueba1&quot; (&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file))&#xA;  muse-publish-markup-buffer(&quot;prueba1&quot; (&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file))&#xA;  muse-publish-file(&quot;/tmp/prueba1.muse&quot; (&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file) &quot;/tmp/&quot; nil)&#xA;  muse-publish-this-file((&quot;docbook&quot; :suffix muse-docbook-extension :regexps muse-docbook-markup-regexps :functions muse-docbook-markup-functions :strings muse-docbook-markup-strings :specials muse-xml-decide-specials :before-end muse-docbook-munge-buffer :after muse-docbook-finalize-buffer :header muse-docbook-header :footer muse-docbook-footer :browser find-file) &quot;/tmp/&quot; nil)&#xA;  call-interactively(muse-publish-this-file record nil)&#xA;  command-execute(muse-publish-this-file record)&#xA;  execute-extended-command(nil &quot;muse-publish-this-file&quot;)&#xA;  call-interactively(execute-extended-command nil nil)&#xA;  command-execute(execute-extended-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I should mark the quotes with another method in the meanwhile...&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="690" LastEditDate="2014-11-09T03:14:31.250" LastActivityDate="2014-11-09T07:58:24.887" Title="`muse-publish-this-file` makes Emacs hang and use 95% of my RAM" Tags="|muse|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3304" PostTypeId="5" CreationDate="2014-11-08T19:07:38.150" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-08T19:07:38.150" LastActivityDate="2014-11-08T19:07:38.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3305" PostTypeId="4" CreationDate="2014-11-08T19:07:38.150" Score="0" Body="Emacs Muse is an authoring and publishing environment for Emacs. It simplifies the process of writings documents and publishing them to various output formats." OwnerUserId="690" LastEditorUserId="690" LastEditDate="2014-11-09T01:03:19.033" LastActivityDate="2014-11-09T01:03:19.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3306" PostTypeId="1" CreationDate="2014-11-08T21:20:18.663" Score="2" ViewCount="431" Body="&lt;p&gt;I am a new to Emacs , i downloaded auto-complete , moved it to ~/.emacs.d/plugins/ then modified the .emacs file to look like : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path (file-name-as-directory&#xA;                     (expand-file-name &quot;~/.emacs.d/plugins/auto-complete&quot;))\&#xA;)&#xA;&#xA;(require 'auto-complete)&#xA;(global-auto-complete-mode t)&#xA;&#xA;(ac-config-default)&#xA;(custom-set-variables&#xA;;; custom-set-variables was added by Custom.                                   &#xA;;; If you edit it by hand, you could mess it up, so be careful.                &#xA;;; Your init file should contain only one such instance.                       &#xA;;; If there is more than one, they won't work right.                           &#xA;'(menu-bar-mode nil)&#xA;'(package-archives (quote ((&quot;melpa&quot; . &quot;http://stable.melpa.org/packages/&quot;) (&quot;g\&#xA;nu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))))&#xA;(custom-set-faces&#xA;;; custom-set-faces was added by Custom.                                       &#xA;;; If you edit it by hand, you could mess it up, so be careful.                &#xA;;; Your init file should contain only one such instance.                       &#xA;;; If there is more than one, they won't work right.                           &#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when i restart emacs , it displays the following error :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/Users/zeaksilva/.emacs':&#xA;&#xA;File error: Cannot open load file, auto-complete&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2476" LastEditorUserId="50" LastEditDate="2014-11-16T13:21:35.480" LastActivityDate="2014-11-16T13:21:35.480" Title="How to debug inability to load library `auto-complete`" Tags="|package|init-file|auto-complete-mode|load-path|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3307" PostTypeId="2" ParentId="3306" CreationDate="2014-11-08T21:41:01.363" Score="1" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst additional-lisp-dir (expand-file-name &quot;plugins&quot; user-emacs-directory))&#xA;(add-to-list 'load-path additional-lisp-dir)&#xA;;; Add subdirs to load-path&#xA;(let ((default-directory additional-lisp-dir))&#xA;  (normal-top-level-add-subdirs-to-load-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way you'll add only the top level directory and subdirs will be added automatically&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, why do you install packages manually and not via package-list-packages?&lt;/p&gt;&#xA;" OwnerUserId="2477" LastActivityDate="2014-11-08T21:41:01.363" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3308" PostTypeId="2" ParentId="3306" CreationDate="2014-11-08T22:34:39.987" Score="2" Body="&lt;p&gt;Repeating my response at &lt;a href=&quot;https://stackoverflow.com/a/26822197/729907&quot;&gt;S.O.&lt;/a&gt; - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put &lt;code&gt;(setq debug-on-error t)&lt;/code&gt; at the beginning of your init file. Or better yet, append &lt;code&gt;--debug-init&lt;/code&gt; to the command line you use to invoke Emacs. That will open the debugger when the error occurs. But it seems that the file that has &lt;code&gt;(provide 'autocomplete)&lt;/code&gt; in it, or that file's directory, is not in your &lt;code&gt;load-path&lt;/code&gt;. When the debugger opens, use &lt;code&gt;C-h v load-path&lt;/code&gt;, and see whether it is correct. If not, correct it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, to be loaded by &lt;code&gt;require&lt;/code&gt;, the library needs to be &lt;code&gt;provide&lt;/code&gt;d, and its location needs to be in your &lt;code&gt;load-path&lt;/code&gt;. That's all.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-11-08T22:34:39.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3309" PostTypeId="2" ParentId="3303" CreationDate="2014-11-08T22:57:07.230" Score="0" Body="&lt;p&gt;The first thing to do is to separate out (remove) everything you can that might not be relevant. Get rid of using the hook, for now, to see if that makes a difference. If it makes no difference, remove it from your problem description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens when you use a smaller book?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you think having DocBook installed has to do with this problem? What happens if you use a document that is not docbook XML, i.e., if you do not use &lt;code&gt;muse-docbook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is &lt;code&gt;muse-project&lt;/code&gt; needed, to reproduce the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, simplify, to break the problem down and discover what the real problem is. As it stands now, you have a lot of stuff in a big sack, you throw the sack up in the air, and you say &quot;What's wrong?&quot;.  Trim down your problem search space.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-08T22:57:07.230" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3310" PostTypeId="1" AcceptedAnswerId="3311" CreationDate="2014-11-09T00:45:44.450" Score="23" ViewCount="7310" Body="&lt;p&gt;I went through the documentation of both the function but they don't seem to shed much information. What is the actual difference between them apart from the fact that &lt;code&gt;load&lt;/code&gt; is a built-in function in C source code whereas load-file is an interactive list compiled function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the recommended function to use in &lt;code&gt;init.el&lt;/code&gt; since both seem to be doing the same job ?&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2014-11-10T11:50:58.537" Title="Difference between load-file and load" Tags="|elisp|functions|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3311" PostTypeId="2" ParentId="3310" CreationDate="2014-11-09T00:58:13.853" Score="24" Body="&lt;p&gt;There are several ways to load Lisp files in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;load-file&lt;/code&gt; takes a literal filename (relative or absolute) and loads the code. Example: &lt;code&gt;(load-file &quot;/usr/local/share/site-lisp/foo.el&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;load&lt;/code&gt; is like &lt;code&gt;load-file&lt;/code&gt;, except that it is more flexible--you can leave out the extension and it will automatically load the &quot;elc&quot; or &quot;el&quot; file as appropriate.&lt;br&gt;&#xA;It also looks into the &lt;code&gt;load-path&lt;/code&gt; directories.&lt;br&gt;&#xA;Example: &lt;code&gt;(load &quot;foo&quot;)&lt;/code&gt; (if &quot;foo.el&quot; is in the current directory or in the load-path&quot;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;load-library&lt;/code&gt; is an interactive interface for &lt;code&gt;load&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;require&lt;/code&gt; is similar to &lt;code&gt;load&lt;/code&gt;, except it prevents the file from being loaded more than once (it also requires a corresponding &lt;code&gt;provide&lt;/code&gt; statement at the end of the file in question). Example: &lt;code&gt;(require 'foo)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8" LastEditorUserId="50" LastEditDate="2014-11-10T11:50:58.537" LastActivityDate="2014-11-10T11:50:58.537" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3312" PostTypeId="2" ParentId="3310" CreationDate="2014-11-09T02:10:09.363" Score="10" Body="&lt;p&gt;&lt;code&gt;load-file&lt;/code&gt; and &lt;code&gt;load-library&lt;/code&gt; are &lt;em&gt;commands&lt;/em&gt; for interactive use (where&#xA;the main difference is in the initial content of the prompt).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;load&lt;/code&gt; is the underlying &lt;em&gt;function&lt;/em&gt; to use when you write Elisp (such as&#xA;in your .emacs).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-09T02:10:09.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3313" PostTypeId="2" ParentId="3221" CreationDate="2014-11-09T03:09:28.410" Score="1" Body="&lt;p&gt;Providing you will be using the same version of Emacs, you can duplicate your .emacs.d with all compiled / packages in-place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is also true of keeping your .emacs.d in version control.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I would recommend this method.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a current trend of using require-package (in various forms) which will implicitly install a package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is useful if you use many versions of Emacs, although a compiled .elc isn't always incompatible across point releases and re-compiling a broken package is relatively trivial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The drawback of tools like require-package, is when a package (or version) or repository isn't available.  This has happened to me often enough to be a problem.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2014-11-09T03:09:28.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3314" PostTypeId="1" AcceptedAnswerId="3396" CreationDate="2014-11-09T06:13:12.540" Score="4" ViewCount="127" Body="&lt;p&gt;This one is honestly a bit of a mystery for me.  The strange behavior is caused by the lambda symbol: the line goes to normal height if I remove the lambda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UcRRo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get Emacs to display such symbols correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(oops, typo in the image)&lt;/p&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="2084" LastEditDate="2014-11-11T19:37:12.567" LastActivityDate="2014-11-11T19:37:12.567" Title="Certain symbols resulting in really tall line (and cursor)" Tags="|font-lock|fonts|display|symbols|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3315" PostTypeId="2" ParentId="3303" CreationDate="2014-11-09T06:23:26.917" Score="1" Body="&lt;p&gt;Seems like there is a bug with muse exporting to docbook and the &lt;code&gt;&amp;lt;quote&amp;gt;&lt;/code&gt; tag when the quote content is large, I have already &lt;a href=&quot;http://gna.org/bugs/?22924&quot; rel=&quot;nofollow&quot;&gt;reported it to the Muse developers&lt;/a&gt;. in the meantime I'll use just a &lt;a href=&quot;http://mwolson.org/projects/MuseQuickStart.html#sec6&quot; rel=&quot;nofollow&quot;&gt;whitespace before the line to denote a quote&lt;/a&gt; allowing me to export my book.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="690" LastEditDate="2014-11-09T07:58:24.887" LastActivityDate="2014-11-09T07:58:24.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3316" PostTypeId="1" AcceptedAnswerId="3340" CreationDate="2014-11-09T07:43:19.673" Score="4" ViewCount="533" Body="&lt;p&gt;I'm reading GNU Emacs Manual to learn how to use Emacs in its full power. I now I'm trying to make use of keyboard macros. It's fairly easy, but I cannot understand why the first defined macro repeats infinitely, while all subsequent macros are executed only once (on pressing &lt;kbd&gt;F4&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it normal behavior? I like when I press &lt;kbd&gt;F4&lt;/kbd&gt; and the macro is executed once. I don't see why the first defined macro should repeat indefinitely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;F3 boo F4&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if I press &lt;kbd&gt;F4&lt;/kbd&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;booboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboobooboob&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now if I redefine it again, I will get:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;booboo&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What's going on?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I think it has something to do with Flyspell. I use Flyspell always. It's active in text mode and also in programming modes, but via &lt;code&gt;flyspell-prog-mode&lt;/code&gt;. I think that Flyspell is involved here because of this part of my &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Defining kbd macro...&#xA;Keyboard macro defined&#xA;Error in post-command-hook (flyspell-post-command-hook): (error &quot;Variable binding depth exceeds max-specpdl-size&quot;)&#xA;After 0 kbd macro iterations: self-insert-command: Variable binding depth exceeds max-specpdl-size&#xA;Defining kbd macro...&#xA;Keyboard macro defined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Result of &lt;kbd&gt;C-u M-x emacs-version&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.3) of 2014-10-21 on bitzer.hoetzel.info&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2014-11-09T08:19:12.277" LastActivityDate="2014-11-09T20:07:41.057" Title="Keyboard macro repeats indefinitely" Tags="|keyboard-macros|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3317" PostTypeId="2" ParentId="2901" CreationDate="2014-11-09T10:28:38.800" Score="3" Body="&lt;p&gt;&lt;code&gt;reftex-using-biblatex-p&lt;/code&gt; is a simple function that finds whether the tex package &lt;code&gt;biblatex&lt;/code&gt; is used by searching the text. The error may occur when the &lt;code&gt;org&lt;/code&gt; file to be parsed is very large. So you can try a small file, or disable this function temporarily by &lt;code&gt;(fset 'reftex-using-biblatex-p 'ignore)&lt;/code&gt;, and see if &lt;code&gt;reftex&lt;/code&gt; works.&lt;/p&gt;&#xA;" OwnerUserId="455" LastActivityDate="2014-11-09T10:28:38.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3318" PostTypeId="1" AcceptedAnswerId="3336" CreationDate="2014-11-09T11:30:33.390" Score="14" ViewCount="1815" Body="&lt;p&gt;org-mode goto last heading in the current tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say This is my org-file, pipe indicates the cursor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Top|&#xA;** Apple&#xA;** Banana&#xA;** Cherry&#xA;* Middle&#xA;** Ape&#xA;** Bear&#xA;** Cat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to run a command and have my cursor now be here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Top|&#xA;** Apple&#xA;** Banana&#xA;** Cherry|&#xA;* Middle&#xA;** Ape&#xA;** Bear&#xA;** Cat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2244" LastEditDate="2014-11-09T13:12:14.987" LastActivityDate="2015-01-20T13:19:39.713" Title="org-mode goto last heading?" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3319" PostTypeId="1" CreationDate="2014-11-09T11:31:52.410" Score="5" ViewCount="951" Body="&lt;p&gt;How can I skip to next heading in org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say This is my org-file, pipe indicates the cursor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Top&#xA;** Apple|&#xA;** Banana&#xA;** Cherry&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to run a command and have my cursor now be here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Top&#xA;** Apple&#xA;** Banana|&#xA;** Cherry&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="105" LastEditDate="2015-03-27T20:41:43.013" LastActivityDate="2015-03-27T20:41:43.013" Title="org-mode skip to next headline?" Tags="|org-mode|cycling|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3320" PostTypeId="2" ParentId="3179" CreationDate="2014-11-09T11:39:59.823" Score="8" Body="&lt;p&gt;&lt;code&gt;org-read-date-analyze&lt;/code&gt; is the underlying function for parsing&#xA;the input with &lt;code&gt;org-mode&lt;/code&gt; time format, e.g., understanding AM/PM suffixes.&#xA;It is a complicated function containing many parts, and IMO &lt;code&gt;advice&lt;/code&gt; is the&#xA;easiest way. Below is an example. This advice adds 12 hours to&#xA;the final time when the input doesn't contain &lt;code&gt;am&lt;/code&gt; and the final&#xA;time is between &lt;code&gt;1:00&lt;/code&gt; and &lt;code&gt;6:59&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the new &lt;code&gt;advice&lt;/code&gt; system in Emacs 24.4:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar time-range-with-pm-suffix '(&quot;1:00&quot; . &quot;6:59&quot;))&#xA;&#xA;(defun org-analyze-date-dwim (original-fun ans org-def org-defdecode)&#xA;  (let* ((time (funcall original-fun ans org-def org-defdecode))&#xA;         (minute (nth 1 time))&#xA;         (hour (nth 2 time))&#xA;         (minutes (+ minute (* 60 hour)))&#xA;         s)&#xA;    (when (and (&amp;lt; hour 12)&#xA;               (not (string-match &quot;am&quot; ans))&#xA;               (&amp;gt;= minutes (org-hh:mm-string-to-minutes (car time-range-with-pm-suffix)))&#xA;               (&amp;lt;= minutes (org-hh:mm-string-to-minutes (cdr time-range-with-pm-suffix))))&#xA;      (setf (nth 2 time) (+ hour 12))&#xA;      (when (boundp 'org-end-time-was-given)&#xA;        (setq s org-end-time-was-given)&#xA;        (if (and s (string-match &quot;^\\([0-9]+\\)\\(:[0-9]+\\)$&quot; s))&#xA;            (setq org-end-time-was-given&#xA;                  (concat (number-to-string (+ 12 (string-to-number (match-string 1 s))))&#xA;                          (match-string 2 s))))))&#xA;    time))&#xA;&#xA;(advice-add 'org-read-date-analyze :around #'org-analyze-date-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the old &lt;code&gt;defadvice&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar time-range-with-pm-suffix '(&quot;1:00&quot; . &quot;6:59&quot;))&#xA;&#xA;(defadvice org-read-date-analyze (around org-analyze-date-dwim activate)&#xA;  (let ((ans (ad-get-arg 0))&#xA;        minute hour minutes s)&#xA;    ad-do-it&#xA;    (setq minute (nth 1 ad-return-value)&#xA;          hour (nth 2 ad-return-value)&#xA;          minutes (+ minute (* 60 hour)))&#xA;    (when (and ans&#xA;               (&amp;lt; hour 12)&#xA;               (not (string-match &quot;am&quot; ans))&#xA;               (&amp;gt;= minutes (org-hh:mm-string-to-minutes (car time-range-with-pm-suffix)))&#xA;               (&amp;lt;= minutes (org-hh:mm-string-to-minutes (cdr time-range-with-pm-suffix))))&#xA;      (setf (nth 2 ad-return-value) (+ hour 12))&#xA;      (when (boundp 'org-end-time-was-given)&#xA;        (setq s org-end-time-was-given)&#xA;        (if (and s (string-match &quot;^\\([0-9]+\\)\\(:[0-9]+\\)$&quot; s))&#xA;            (setq org-end-time-was-given&#xA;                  (concat (number-to-string (+ 12 (string-to-number (match-string 1 s))))&#xA;                          (match-string 2 s))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="455" LastEditorUserId="455" LastEditDate="2014-11-11T02:16:53.217" LastActivityDate="2014-11-11T02:16:53.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3321" PostTypeId="2" ParentId="3319" CreationDate="2014-11-09T11:49:21.797" Score="11" Body="&lt;p&gt;&lt;code&gt;org-next-item&lt;/code&gt; is the built-in way to move forward in a plain list.  However, a &lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html&quot;&gt;plain list&lt;/a&gt; in &lt;code&gt;org-mode&lt;/code&gt; actually looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* here's the headline&#xA;&#xA;  - An item&#xA;  - Another item&#xA;  - Another item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The example you give is of &lt;a href=&quot;http://orgmode.org/guide/Headlines.html#Headlines&quot;&gt;headlines&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Top&#xA;** Apple&#xA;** Banana&#xA;** Cherry&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To move forward to the next headline, you can use &lt;code&gt;org-forward-heading-same-level&lt;/code&gt; (default &lt;code&gt;C-c C-f&lt;/code&gt;).  Also, since &lt;code&gt;org-mode&lt;/code&gt; is built on top of &lt;code&gt;outline-mode&lt;/code&gt;, you can also use the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Motion.html#Outline-Motion&quot;&gt;outline motion commands&lt;/a&gt; such as  &lt;code&gt;outline-next-visible-heading&lt;/code&gt; (default &lt;code&gt;C-c C-n&lt;/code&gt;).  Note that &lt;code&gt;org-forward-heading-same-level&lt;/code&gt; takes over for &lt;code&gt;outline-forward-same-level&lt;/code&gt;, and there's also &lt;code&gt;outline-next-heading&lt;/code&gt; that is not bound to a key combination by default.  &lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-09T15:12:49.980" LastActivityDate="2014-11-09T15:12:49.980" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3322" PostTypeId="1" AcceptedAnswerId="3338" CreationDate="2014-11-09T12:20:59.767" Score="11" ViewCount="4273" Body="&lt;p&gt;I'm using Emacs 24.4. When writing Python code, Emacs behaves strangely with respect to indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in range(10):&#xA;    print(i)&#xA;for i in range(10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I input &lt;code&gt;:&lt;/code&gt;, Emacs adds a needless indent at the beginning of the third line. This is quite strange, is this a bug?&lt;/p&gt;&#xA;" OwnerUserId="2488" LastEditorUserId="504" LastEditDate="2014-11-09T13:11:53.547" LastActivityDate="2014-11-21T13:57:18.247" Title="python auto indent problem" Tags="|indentation|python|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3323" PostTypeId="1" AcceptedAnswerId="3337" CreationDate="2014-11-09T12:21:43.207" Score="16" ViewCount="3327" Body="&lt;h2&gt;The context&lt;/h2&gt;&#xA;&lt;p&gt;I'm using the &lt;code&gt;after-make-frame-functions&lt;/code&gt; hook to load properly the themes in an &lt;strong&gt;emacs client/server configuration&lt;/strong&gt;. Specifically this is the code snippet that I use to make that (based in this &lt;a href=&quot;https://stackoverflow.com/a/23668935/634816&quot;&gt;SO answer&lt;/a&gt;):&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(if (daemonp)&#xA;    (add-hook 'after-make-frame-functions&#xA;              (lambda (frame)&#xA;                (select-frame frame)&#xA;                (load-theme 'monokai t)&#xA;                ;; setup the smart-mode-line and its theme&#xA;                (sml/setup))) &#xA;  (progn (load-theme 'monokai t)&#xA;         (sml/setup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;When a new &lt;code&gt;emacsclient -c/t&lt;/code&gt; session is started the hook is executed not only in the new frame, but in all the previous existent frames (other &lt;em&gt;emacsclient&lt;/em&gt; sessions) and &lt;strong&gt;it makes a very annoying visual effect (the themes are loaded again in all those frames)&lt;/strong&gt;. Even worse, in the terminal clients already opened the theme color get completely messed up. Obviously that happens only on the emacs clients connected to the same emacs server. The reason for this behavior is clear, the hook is run on the server and all of its clients are affected.&lt;/p&gt;&#xA;&lt;h2&gt;The question&lt;/h2&gt;&#xA;&lt;p&gt;Is there any way to execute this function only once or getting the same result without using the hook?&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;A partial solution&lt;/h2&gt;&#xA;&lt;p&gt;I have now this code, thanks to the @Drew's answer. But still has a problem, once you start a client session in the terminal, the GUI does not load the themes properly and vice-versa. After a lot of tests, I realized that the behavior depends on which emacsclient starts first, and after discard various things, I think that it is maybe related with the color palette that is loaded. If you reload manually the theme all works fine and that's the reason why this behavior does not appear when the function is called by the hook every time as in my initial configuration.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun emacsclient-setup-theme-function (frame)&#xA;  (progn&#xA;    (select-frame frame)&#xA;    (load-theme 'monokai t)&#xA;    ;; setup the smart-mode-line and its theme&#xA;    (sml/setup)&#xA;    (remove-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)))&#xA;&#xA;(if (daemonp)&#xA;    (add-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)&#xA;  (progn (load-theme 'monokai t)&#xA;         (sml/setup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;The final solution&lt;/h1&gt;&#xA;&lt;p&gt;Finally I have totally working code that solves the behavior seen in the partial solution, to achieve this I run the function once by mode (terminal or gui) when then pertinent emacsclient is started for first time, then remove the function from the hook because is no needed any more. Now, I am happy! :)&#xA;Thanks again @Drew!&lt;/p&gt;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq myGraphicModeHash (make-hash-table :test 'equal :size 2))&#xA;(puthash &amp;quot;gui&amp;quot; t myGraphicModeHash)&#xA;(puthash &amp;quot;term&amp;quot; t myGraphicModeHash)&#xA;&#xA;(defun emacsclient-setup-theme-function (frame)&#xA;  (let ((gui (gethash &amp;quot;gui&amp;quot; myGraphicModeHash))&#xA;        (ter (gethash &amp;quot;term&amp;quot; myGraphicModeHash)))&#xA;    (progn&#xA;      (select-frame frame)&#xA;      (when (or gui ter) &#xA;        (progn&#xA;          (load-theme 'monokai t)&#xA;          ;; setup the smart-mode-line and its theme&#xA;          (sml/setup)&#xA;          (sml/apply-theme 'dark)&#xA;          (if (display-graphic-p)&#xA;              (puthash &amp;quot;gui&amp;quot; nil myGraphicModeHash)&#xA;            (puthash &amp;quot;term&amp;quot; nil myGraphicModeHash))))&#xA;      (when (not (and gui ter))&#xA;        (remove-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)))))&#xA;&#xA;(if (daemonp)&#xA;    (add-hook 'after-make-frame-functions 'emacsclient-setup-theme-function)&#xA;  (progn (load-theme 'monokai t)&#xA;         (sml/setup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="560" LastEditorUserId="39388" LastEditDate="2023-06-23T20:45:17.920" LastActivityDate="2023-06-23T20:45:17.920" Title="Run a Function Only Once, Though a Hook Many Times" Tags="|elisp|hooks|frames|emacsclient|themes|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="3324" PostTypeId="2" ParentId="3318" CreationDate="2014-11-09T12:59:11.690" Score="4" Body="&lt;p&gt;I don't think there's a built-in command for this, but you can easily define one yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-goto-last-heading-in-tree ()&#xA;  (interactive)&#xA;  (org-forward-heading-same-level 1)     ; 1. Move to next tree&#xA;  (outline-previous-visible-heading 1)   ; 2. Move to last heading in previous tree&#xA;  (let ((org-special-ctrl-a/e t))        ; 3. Ignore tags when&#xA;    (org-end-of-line)))                  ;    moving to the end of the line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And bind it to a key sequence of your choosing via:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c g&quot;) 'org-goto-last-heading)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-20T13:19:39.713" LastActivityDate="2015-01-20T13:19:39.713" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3325" PostTypeId="1" AcceptedAnswerId="3328" CreationDate="2014-11-09T13:56:34.977" Score="3" ViewCount="1247" Body="&lt;p&gt;So, I can send emails with Emacs now. But reading emails seems to be more difficult task. I want to do it with &lt;code&gt;rmail&lt;/code&gt;. &lt;a href=&quot;http://www.emacswiki.org/emacs/GettingMail&quot; rel=&quot;nofollow&quot;&gt;This article&lt;/a&gt; says that I need to add the following lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;MAILHOST&quot; &quot;pop.openmailbox.org&quot;)&#xA;(setq rmail-primary-inbox-list '(&quot;po:username@openmailbox.org&quot;)&#xA;      rmail-pop-password-required t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into my &lt;code&gt;.emacs&lt;/code&gt; file. As you can see I'm trying to use my &lt;a href=&quot;https://www.openmailbox.org/&quot; rel=&quot;nofollow&quot;&gt;Openmailbox&lt;/a&gt; account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if I execute &lt;kbd&gt;M-x rmail&lt;/kbd&gt;, after entering my password I see the following message in the echo area:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;movemail: Error connecting to POP server: -ERR [AUTH] Plaintext authentication disallowed on non-secure (SSL/TLS) connections.&lt;br&gt;&#xA;  (No new mail has arrived)&lt;br&gt;&#xA;  0 new messages read&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm wondering why I don't have to supply port number (for example I used &lt;code&gt;587&lt;/code&gt; to send emails) and why do I get this error. How to read emails with Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="25" LastEditDate="2014-11-12T23:37:41.927" LastActivityDate="2021-03-31T12:08:52.513" Title="Problems reading emails with rmail" Tags="|email|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3326" PostTypeId="2" ParentId="3318" CreationDate="2014-11-09T15:41:59.453" Score="5" Body="&lt;p&gt;Here's a command, based on @itsjeyd's answer, that is robust to the edge case listed in the comment to that answer (that is, when you're on the last heading/subtree):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-end-of-subtree ()&#xA;  (interactive)&#xA;  (let ((org-special-ctrl-a/e t))&#xA;    (if (condition-case nil&#xA;            (outline-forward-same-level 1)&#xA;          (error t))&#xA;        (progn&#xA;          (goto-char (point-max))&#xA;          (outline-back-to-heading))&#xA;      (outline-previous-visible-heading 1))&#xA;    (org-end-of-line 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="504" LastEditDate="2014-11-09T15:54:21.290" LastActivityDate="2014-11-09T15:54:21.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3327" PostTypeId="1" CreationDate="2014-11-09T15:50:26.797" Score="5" ViewCount="668" Body="&lt;p&gt;After exiting &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;yasnippet&lt;/code&gt;&lt;/a&gt; snippets that contain one or more &lt;a href=&quot;https://capitaomorte.github.io/yasnippet/snippet-development.html#sec-3-3&quot; rel=&quot;nofollow&quot;&gt;tab stops&lt;/a&gt;, I often find myself wanting to go back and modify content that I entered at the tab stops. Of course, I can do this using standard movement and editing commands, but it would be much easier if I could simply &lt;em&gt;reactivate&lt;/em&gt;, say, the last snippet I inserted and &lt;kbd&gt;TAB&lt;/kbd&gt; through the fields again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another frequent use case is exiting snippets prematurely. I sometimes do this on purpose, but more often than not this happens because I accidentally hit &lt;kbd&gt;C-g&lt;/kbd&gt; (or some other command that cancels the snippet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there a way to resume or reactivate a snippet after exiting it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;apropos&lt;/code&gt; for various combinations of &lt;code&gt;yas&lt;/code&gt;/&lt;code&gt;yasnippet&lt;/code&gt; and &lt;code&gt;resume&lt;/code&gt;/&lt;code&gt;reactivate&lt;/code&gt;, but that didn't turn up anything useful.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Stefan helpfully points out in the comments, it is possible to call &lt;code&gt;undo&lt;/code&gt; to reactivate a snippet. However, this is only useful as long as the current buffer stays unmodified: If I exit a snippet, make some unrelated modifications in other parts of the buffer, and then hit &lt;kbd&gt;C-/&lt;/kbd&gt; (&lt;code&gt;undo&lt;/code&gt;), Emacs first reverts the most recent changes instead of resuming the snippet, which (in most cases) is not what I want.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-11-10T08:21:34.660" LastActivityDate="2018-11-24T17:42:13.507" Title="YASnippet: How to resume (or reactivate) snippets after exiting them" Tags="|yasnippet|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3328" PostTypeId="2" ParentId="3325" CreationDate="2014-11-09T16:02:50.907" Score="3" Body="&lt;p&gt;You need to connect to the server over TLS.  In order to do that, you need to add &lt;code&gt;--tls&lt;/code&gt; to &lt;code&gt;rmail-movemail-flags&lt;/code&gt;.  You can use &lt;code&gt;customize&lt;/code&gt; to set this variable interactively; if you wish to set it in your init file instead, you can do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq rmail-movemail-flags '(&quot;--tls&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note however that Rmail is a fairly primitive mailer.  There are better mailers for Emacs, notably &lt;em&gt;Wanderlust&lt;/em&gt; (probably the best for IMAP if you wish to keep all your mail on the server), &lt;em&gt;Mew&lt;/em&gt;, &lt;em&gt;VM&lt;/em&gt;, &lt;em&gt;mu4e&lt;/em&gt;, &lt;em&gt;notmuch&lt;/em&gt;, etc.  Some people also like to use &lt;em&gt;Gnus&lt;/em&gt;, the Emacs newsreader, for reading mail.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2014-11-09T16:37:12.833" LastActivityDate="2014-11-09T16:37:12.833" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3329" PostTypeId="1" CreationDate="2014-11-09T16:38:55.710" Score="3" ViewCount="324" Body="&lt;p&gt;I got a file(for instance, ~/.mozilla/firefox/xxx.default/sessionstore-backups/recovery.bak) that its content is &lt;code&gt;one whole line&lt;/code&gt; and size of over 1MB, if I open it in Emacs, Emacs will become very laggy, so I put some configuration in Emacs: if a buffer you are going to open is over 1MB, use fundamental-mode and disables some other minor modes such as font-lock-mode and linum-mode and other configs for high performance, but this configuration is only working for buffers that size is over 1MB AND contents is not very long lines(for example, /var/log/messages), IF the content of the file is long lines, the configuration is totally not working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun check-large-file-hook ()&#xA;  &quot;If a file is over a given size, turn off minor modes&quot;&#xA;  (when (&amp;gt; (buffer-size) (* 1024 1024)) ;; 1 MB&#xA;    (fundamental-mode)&#xA;    (font-lock-mode -1)&#xA;    (linum-mode -1)&#xA;    (setq buffer-read-only t)&#xA;    (buffer-disable-undo)&#xA;    ))&#xA;(add-hook 'find-file-hooks 'check-large-file-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any solution for this kind of problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Viewing long lines buffer is laggy is not my problem, so the VLF package would not be the solution to my post, my problem is configuration for lone lines buffer is not working.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="25" LastEditDate="2014-11-12T23:49:55.287" LastActivityDate="2015-10-22T22:20:45.560" Title="`find-file-hook` problem for large buffer that is just one long line" Tags="|files|hooks|line-break|large-files|find-file|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="3330" PostTypeId="1" AcceptedAnswerId="3334" CreationDate="2014-11-09T16:46:11.760" Score="38" ViewCount="6338" Body="&lt;p&gt;Sometimes I accidentally kill a buffer and want to reopen it, just like C-S-t to undo closed tab in Firefox, but there is no built-in command in Emacs, the &lt;code&gt;defun undo-kill-buffer&lt;/code&gt; in &lt;a href=&quot;http://www.emacswiki.org/RecentFiles&quot;&gt;http://www.emacswiki.org/RecentFiles&lt;/a&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun undo-kill-buffer (arg)&#xA;  &quot;Re-open the last buffer killed.  With ARG, re-open the nth buffer.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((recently-killed-list (copy-sequence recentf-list))&#xA;     (buffer-files-list&#xA;      (delq nil (mapcar (lambda (buf)&#xA;                  (when (buffer-file-name buf)&#xA;                (expand-file-name (buffer-file-name buf)))) (buffer-list)))))&#xA;    (mapc&#xA;     (lambda (buf-file)&#xA;       (setq recently-killed-list&#xA;         (delq buf-file recently-killed-list)))&#xA;     buffer-files-list)&#xA;    (find-file&#xA;     (if arg (nth arg recently-killed-list)&#xA;       (car recently-killed-list)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;doesn't work at all. If you know elisp, how to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it can show a list of the closed buffers and them I can choose one from them to reopen, that would be better.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="25" LastEditDate="2014-11-12T23:47:06.413" LastActivityDate="2017-07-14T20:36:30.707" Title="How to reopen just killed buffer, like C-S-t in Firefox Browser?" Tags="|buffers|undo|kill-buffer|" AnswerCount="6" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3331" PostTypeId="1" CreationDate="2014-11-09T16:58:36.930" Score="4" ViewCount="217" Body="&lt;p&gt;Is there a way to get an occur-style summary that contains all of the function definitions of the current file?  Perhaps using &lt;code&gt;semantic-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm particularly concerned about C. Emacs Lisp, Caml (&lt;code&gt;tuareg-mode&lt;/code&gt;) and Haskell would be welcome additions, but not required.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2014-11-09T18:23:43.500" LastActivityDate="2014-11-09T18:23:43.500" Title="Semantic occur?" Tags="|semantic-mode|c-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3332" PostTypeId="2" ParentId="3330" CreationDate="2014-11-09T17:07:11.263" Score="4" Body="&lt;p&gt;I use this solution from &lt;a href=&quot;https://stackoverflow.com/questions/10394213/emacs-reopen-previous-killed-buffer&quot;&gt;this SO post&lt;/a&gt; and it works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is elegant but not perfect; it stores a list of active buffers and returns the first file from the the recentf-list that doesn't belong to the list of active buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;;; Reopen the last killed buffer&#xA;;; Source: https://stackoverflow.com/questions/10394213/emacs-reopen-previous-killed-buffer&#xA;(require 'cl)&#xA;(require 'recentf)&#xA;(recentf-mode 1)&#xA;(defun undo-kill-buffer ()&#xA;  (interactive)&#xA;  (let ((active-files (loop for buf in (buffer-list)&#xA;                            when (buffer-file-name buf) collect it)))&#xA;    (loop for file in recentf-list&#xA;          unless (member file active-files) return (find-file file))))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2014-11-09T17:07:11.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3333" PostTypeId="2" ParentId="3330" CreationDate="2014-11-09T17:07:54.107" Score="3" Body="&lt;p&gt;You need to turn on &lt;code&gt;recentf-mode&lt;/code&gt;. To do that, run &lt;code&gt;M-x recentf-mode&lt;/code&gt;. Then, the function might not work until you open or kill some new buffers; I don't think you'll have &lt;code&gt;recentf-list&lt;/code&gt; filled out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want this to be enabled when Emacs starts up, put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(recentf-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then put the &lt;code&gt;defun&lt;/code&gt; you found in there, and bind it to a key, if you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One downside of this mode appears to be that recentf mode is built to track &lt;code&gt;opened&lt;/code&gt; files, not killed ones. So, if you run the function twice, it won't reopen your second-most-recently killed file.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-11-09T17:07:54.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3334" PostTypeId="2" ParentId="3330" CreationDate="2014-11-09T17:11:30.460" Score="28" Body="&lt;p&gt;Here's another, simple alternative that doesn't require &lt;code&gt;recentf&lt;/code&gt;.  Hooking the first function into &lt;code&gt;kill-buffer-hook&lt;/code&gt; will push the filename associated with the buffer onto a list.  (Note that, if you kill a buffer that's not visiting a file, it's gone for good.)  The latter function pops that file off of the list and visits it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar killed-file-list nil&#xA;  &quot;List of recently killed files.&quot;)&#xA;&#xA;(defun add-file-to-killed-file-list ()&#xA;  &quot;If buffer is associated with a file name, add that file to the&#xA;`killed-file-list' when killing the buffer.&quot;&#xA;  (when buffer-file-name&#xA;    (push buffer-file-name killed-file-list)))&#xA;&#xA;(add-hook 'kill-buffer-hook #'add-file-to-killed-file-list)&#xA;&#xA;(defun reopen-killed-file ()&#xA;  &quot;Reopen the most recently killed file, if one exists.&quot;&#xA;  (interactive)&#xA;  (when killed-file-list&#xA;    (find-file (pop killed-file-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;killed-file-list&lt;/code&gt; is a list, so you could, for example, write a more intricate function to cycle through that list, rather than the simple one described here: it's up to you how much you want to do with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; sorry, I missed the last provision in your Q about wanting a list of files from which to choose.  The following function is slightly fancier than the version above insofar as it uses &lt;code&gt;completing-read&lt;/code&gt; to let you specify which of the killed files you want.  If you're using something like &lt;code&gt;ido&lt;/code&gt;, it'll let you cycle through all of the files you've killed in the current session, defaulting to the most recent.  Note that it presumes that you've already required &lt;code&gt;cl-lib&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun reopen-killed-file-fancy ()&#xA;  &quot;Pick a file to revisit from a list of files killed during this&#xA;Emacs session.&quot;&#xA;  (interactive)&#xA;  (if killed-file-list&#xA;      (let ((file (completing-read &quot;Reopen killed file: &quot; killed-file-list&#xA;                                   nil nil nil nil (car killed-file-list))))&#xA;        (when file&#xA;          (setq killed-file-list (cl-delete file killed-file-list :test #'equal))&#xA;          (find-file file)))&#xA;    (error &quot;No recently-killed files to reopen&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-06-17T19:51:57.590" LastActivityDate="2015-06-17T19:51:57.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3335" PostTypeId="2" ParentId="3331" CreationDate="2014-11-09T17:18:22.050" Score="5" Body="&lt;p&gt;If you use Helm, then yes, there's &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-9&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm-semantic-or-imenu&lt;/a&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Demo with C:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dNyMz.gif&quot; alt=&quot;c&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Demo with Emacs Lisp:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/688q2.gif&quot; alt=&quot;elisp&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Caml and Haskell, you can use this command but there's probably only Imenu support (so you won't get full function interface like the above 2 demos).&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-11-09T17:18:22.050" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3336" PostTypeId="2" ParentId="3318" CreationDate="2014-11-09T17:51:12.357" Score="15" Body="&lt;p&gt;There's actually an &lt;code&gt;org-end-of-subtree&lt;/code&gt; function, but it's not interactive. You can simply define your own command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun goto-last-heading ()&#xA;  (interactive)&#xA;  (org-end-of-subtree))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2489" LastEditorUserId="105" LastEditDate="2014-11-09T18:10:15.567" LastActivityDate="2014-11-09T18:10:15.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3337" PostTypeId="2" ParentId="3323" CreationDate="2014-11-09T18:01:21.713" Score="11" Body="&lt;p&gt;I'm guessing that you are &lt;strong&gt;not&lt;/strong&gt; really looking for a way to &quot;&lt;em&gt;execute the hook only once&lt;/em&gt;&quot;.  I'm guessing that you are looking for a way to execute that particular function only once, whenever the hook is run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The conventional, and simple, answer to &lt;em&gt;that&lt;/em&gt; question is for your function to remove itself from the hook, after carrying out the one-time action that you want.  In other words use &lt;code&gt;add-hook&lt;/code&gt; in a context where you know that the function should be executed when the hook is run, and have the function itself remove itself from the hook, after the function does its thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am guessing correctly about what you really want, then please consider editing your question to something like &quot;&lt;em&gt;Is there any way to run a hook&lt;/em&gt; &lt;strong&gt;&lt;em&gt;function&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;only once?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example, from standard library &lt;code&gt;facemenu.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun facemenu-set-self-insert-face (face)&#xA;  &quot;Arrange for the next self-inserted char to have face `face'.&quot;&#xA;  (setq facemenu-self-insert-data (cons face this-command))&#xA;  (add-hook 'post-self-insert-hook 'facemenu-post-self-insert-function))&#xA;&#xA;(defun facemenu-post-self-insert-function ()&#xA;  (when (and (car facemenu-self-insert-data)&#xA;             (eq last-command (cdr facemenu-self-insert-data)))&#xA;    (put-text-property (1- (point)) (point)&#xA;                       'face (car facemenu-self-insert-data))&#xA;    (setq facemenu-self-insert-data nil))&#xA;  (remove-hook 'post-self-insert-hook 'facemenu-post-self-insert-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:50:27.407" LastActivityDate="2015-05-09T20:50:27.407" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3338" PostTypeId="2" ParentId="3322" CreationDate="2014-11-09T18:27:51.710" Score="17" Body="&lt;p&gt;This is caused by &lt;code&gt;electric-indent-mode&lt;/code&gt;, which is enabled by default in&#xA;Emacs 24.4. You can turn it off with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(electric-indent-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you don't want to disable electric indent mode entirely but want to&#xA;stop the colon from activating electric indent mode in Python mode, then&#xA;you could remove the colon character from &lt;code&gt;electric-indent-chars&lt;/code&gt;, which&#xA;Python mode gives a local value.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (setq electric-indent-chars (delq ?: electric-indent-chars))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="1979" LastEditDate="2014-11-21T13:57:18.247" LastActivityDate="2014-11-21T13:57:18.247" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3339" PostTypeId="2" ParentId="3323" CreationDate="2014-11-09T19:29:18.067" Score="4" Body="&lt;p&gt;Here is a macro that you can use instead of &lt;code&gt;add-hook&lt;/code&gt; (not extensively tested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro add-hook-run-once (hook function &amp;amp;optional append local)&#xA;  &quot;Like add-hook, but remove the hook after it is called&quot;&#xA;  (let ((sym (make-symbol &quot;#once&quot;)))&#xA;    `(progn&#xA;       (defun ,sym ()&#xA;         (remove-hook ,hook ',sym ,local)&#xA;         (funcall ,function))&#xA;       (add-hook ,hook ',sym ,append ,local))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: &lt;code&gt;make-symbol&lt;/code&gt; creates an uninterned symbol with the given name. I included a &lt;code&gt;#&lt;/code&gt; in the name to flag the symbol as somewhat unusual, in case you come across it while looking at a hook variable.&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2014-11-09T21:37:30.530" LastActivityDate="2014-11-09T21:37:30.530" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3340" PostTypeId="2" ParentId="3316" CreationDate="2014-11-09T20:07:41.057" Score="1" Body="&lt;p&gt;I've submitted bug report to bug-gnu-emacs@gnu.org, &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19001&quot; rel=&quot;nofollow&quot;&gt;this is the link&lt;/a&gt; that provides access to information about this bug and its status. I will update this answer when the bug is fixed.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2014-11-09T20:07:41.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3341" PostTypeId="1" AcceptedAnswerId="3344" CreationDate="2014-11-09T20:36:43.750" Score="5" ViewCount="922" Body="&lt;p&gt;I have a &lt;code&gt;hash-table&lt;/code&gt; (named &lt;em&gt;ztree-line-to-node-table&lt;/em&gt;) that stores the &lt;code&gt;line-number&lt;/code&gt; and the corresponding &lt;code&gt;absolute-file-name&lt;/code&gt;.  The &lt;code&gt;absolute-file-name&lt;/code&gt; is extracted using &lt;code&gt;(gethash line ztree-line-to-node-table)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:   How, please, can I extract the &lt;code&gt;line-number&lt;/code&gt; if I know what the &lt;code&gt;absolute-file-name&lt;/code&gt; is?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 data&#xA;      (1&#xA;       #(&quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app&quot; 0 49&#xA;     (face ztree-start-node-face))&#xA;       2 &quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents&quot; 3 &quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents/MacOS&quot; 4 &quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents/Resources&quot; 5 &quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents/Info.plist&quot; 6 &quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents/PkgInfo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;code&gt;absolute-file-name&lt;/code&gt; is a path:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;code&gt;line-number&lt;/code&gt; is &lt;strong&gt;2&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am looking for a means of programmatically querying the &lt;code&gt;hash-table&lt;/code&gt; using the &lt;code&gt;absolute-file-name&lt;/code&gt; to extract the &lt;code&gt;line-number&lt;/code&gt; -- the result of the query in this example is &lt;strong&gt;2&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="25" LastEditDate="2014-11-12T23:41:48.923" LastActivityDate="2014-11-12T23:41:48.923" Title="How to extract key from hash-table" Tags="|elisp|data-structures|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3342" PostTypeId="2" ParentId="3341" CreationDate="2014-11-09T21:35:45.260" Score="2" Body="  &#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ztree-get-line-number (absolute-filename)&#xA;  (catch 'done&#xA;    (maphash&#xA;      (lambda (line filename)&#xA;        (when (equal filename absolute-filename)&#xA;          (throw 'done line)))&#xA;      ztree-line-to-node-table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above-function is a modification of the example in the Elisp Cookbook:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/ElispCookbook#toc44&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/ElispCookbook#toc44&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((nick-table (make-hash-table :test 'equal))&#xA;      nicks)&#xA;  (puthash &quot;kensanata&quot; &quot;Alex Schroeder&quot; nick-table)&#xA;  (puthash &quot;e1f&quot; &quot;Luis Fernandes&quot; nick-table)&#xA;  (puthash &quot;pjb&quot; &quot;Pascal J. Bourguignon&quot; nick-table)&#xA;  (maphash (lambda (nick real-name)&#xA;             (setq nicks (cons nick nicks)))&#xA;           nick-table)&#xA;  nicks)&#xA;  ==&amp;gt; (&quot;pjb&quot; &quot;e1f&quot; &quot;kensanata&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-11-09T22:16:20.747" LastActivityDate="2014-11-09T22:16:20.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3343" PostTypeId="2" ParentId="3341" CreationDate="2014-11-09T22:37:02.143" Score="1" Body="&lt;p&gt;Instead of an hashtable &lt;code&gt;ztree-line-to-node-table&lt;/code&gt; I suggest creating a &lt;code&gt;bidirectional&lt;/code&gt; hashtable &lt;code&gt;ztree-line&amp;lt;-&amp;gt;node-table&lt;/code&gt;, whose key and values type would both be strings, and whose key value pairs would be duplicated in both directions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; (gethash &quot;2&quot; ztree-line&amp;lt;-&amp;gt;node-table)&#xA;  &quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents&quot;&#xA;&#xA;&amp;gt; (gethash &quot;/Users/HOME/.0.data/.0.emacs/Emacs_10_01_2014.app/Contents&quot; ztree-line&amp;lt;-&amp;gt;node-table)&#xA;  &quot;2&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2482" LastEditorUserId="2482" LastEditDate="2014-11-09T23:01:07.003" LastActivityDate="2014-11-09T23:01:07.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3344" PostTypeId="2" ParentId="3341" CreationDate="2014-11-09T23:34:37.147" Score="6" Body="&lt;p&gt;If you need bidirectional mapping, you are probably using the wrong data structures — hashtables provide fast mapping in one direction, but mapping in the reverse direction requires iterating over the whole hashtable (as in lawlist's answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't say how many entries you expect there to be in the table.  If it's just a few hundred, then you could probably get away with an association list, and use the functions &lt;code&gt;assoc&lt;/code&gt; and &lt;code&gt;rassoc&lt;/code&gt; to perform the direct and reverse mapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have many entries, the simplest solution is to use two hashtables, one that maps line numbers to filenames, and one that maps filenames to line numbers.  Of course, you will need to make sure that the two tables are kept in sync — that you always insert and delete an entry from both hashtables; if you don't, you'll end up with confusing bugs that will be difficult to identify.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2014-11-10T00:03:45.120" LastActivityDate="2014-11-10T00:03:45.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3345" PostTypeId="1" CreationDate="2014-11-10T04:45:13.210" Score="1" ViewCount="340" Body="&lt;p&gt;I really like typing in vim, but vimscript makes zero sense. Since I'm getting interested in Lisp/Clojure, and I've heard nice things about evil mode for emacs, I thought I'd give it a try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I got weird behavior within moments of my first test file. I expected &lt;code&gt;S&lt;/code&gt; to delete a line and drop me into insert mode; instead I got a &quot;Wrong number of arguments&quot; error and a lot of noise in the minibuffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discovered that using &lt;code&gt;c-h k&lt;/code&gt; while in insert mode will tell you what command is run by the following keystroke. Emacs tells me that &lt;code&gt;S&lt;/code&gt; runs the &lt;code&gt;self-insert-command&lt;/code&gt;, but googling around suggests this might be a red herring, as this command is evidently run frequently by processes and not so much by users. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get the key behavior that I want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ETA: I'm using someone else's .emacs.d. They did define a keybinding for &quot;s-s&quot;, but the behavior persists after it's commented out. I don't know how to find if the key is defined elsewhere other than grepping for &quot;s-s&quot; and eyeballing the large number of results.&lt;/p&gt;&#xA;" OwnerUserId="2493" LastEditorUserId="253" LastEditDate="2014-11-11T15:07:45.747" LastActivityDate="2015-02-09T17:14:00.090" Title="&quot;S&quot; key throws error in Evil mode normal state" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="7" ClosedDate="2015-02-09T18:38:04.473" ContentLicense="CC BY-SA 3.0" />
  <row Id="3346" PostTypeId="2" ParentId="2857" CreationDate="2014-11-10T04:45:55.747" Score="1" Body="&lt;p&gt;You might want to look into providing an &lt;a href=&quot;https://github.com/dimitri/el-get&quot; rel=&quot;nofollow&quot;&gt;el-get&lt;/a&gt; recipe for installing your package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See section 9 &quot;Authoring Recipes&quot; in the &lt;a href=&quot;https://github.com/dimitri/el-get/blob/master/el-get.info&quot; rel=&quot;nofollow&quot;&gt;info file&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:build/system-type&lt;/code&gt; facility may be of particular interest, if you have variable requirements across different platforms. See section 9.5 &quot;Build&quot; for details.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-10T04:51:59.580" LastActivityDate="2014-11-10T04:51:59.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3347" PostTypeId="2" ParentId="141" CreationDate="2014-11-10T07:38:13.490" Score="6" Body="&lt;p&gt;I really don't mind Emacs.app always running, but the fact that I couldn't close the window without accidentally killing the Emacs server was annoying. And even if you try really hard to kill the last frame, it still doesn't let you: &amp;quot;Attempt to delete the sole visible or iconified frame&amp;quot;. ...So we cheat.&lt;/p&gt;&#xA;&lt;p&gt;This solution just hides Emacs (like &lt;kbd&gt;Command&lt;/kbd&gt;+&lt;kbd&gt;h&lt;/kbd&gt;) when you try to close the last window by clicking the close button.&lt;/p&gt;&#xA;&lt;p&gt;Add the following to your Emacs init somewhere:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice handle-delete-frame (around my-handle-delete-frame-advice activate)&#xA;  &amp;quot;Hide Emacs instead of closing the last frame&amp;quot;&#xA;  (let ((frame   (posn-window (event-start event)))&#xA;        (numfrs  (length (frame-list))))&#xA;    (if (&amp;gt; numfrs 1)&#xA;      ad-do-it&#xA;      (do-applescript &amp;quot;tell application \&amp;quot;System Events\&amp;quot; to tell process \&amp;quot;Emacs\&amp;quot; to set visible to false&amp;quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And add Emacs to &amp;quot;Users &amp;amp; Groups &amp;gt; Login Items&amp;quot;, and click the &amp;quot;Hide&amp;quot; checkbox.&lt;/p&gt;&#xA;&lt;p&gt;Your Emacs init also needs to call &lt;code&gt;(start-server)&lt;/code&gt; somewhere.&lt;/p&gt;&#xA;&lt;p&gt;I'm using this &lt;code&gt;emacsclient&lt;/code&gt; wrapper to bring Emacs to the front first:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;osascript -e 'tell application &amp;quot;Emacs&amp;quot; to activate'&#xA;exec emacsclient &amp;quot;$@&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Issues:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Activating/unhiding Emacs brings &lt;em&gt;all&lt;/em&gt; windows to the front. This is slightly annoying.&lt;/li&gt;&#xA;&lt;li&gt;&lt;s&gt;Clicking the Emacs icon in the Dock seems to randomly create a new window sometimes. But not always.&lt;/s&gt;&lt;/li&gt;&#xA;&lt;li&gt;TODO: Maybe make &lt;kbd&gt;Command&lt;/kbd&gt;+&lt;kbd&gt;w&lt;/kbd&gt; on the last frame also hide Emacs?&lt;/li&gt;&#xA;&lt;li&gt;NEW with edit: clicking the dock icon when all windows are minimized doesn't automatically maximize one of them.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This is based off of @noaham's &lt;a href=&quot;https://emacs.stackexchange.com/a/2631/2490&quot;&gt;answer&lt;/a&gt; suggesting to minimize Emacs, and &lt;a href=&quot;https://superuser.com/a/328356/161642&quot;&gt;this answer&lt;/a&gt; explaining how to hook trying to close the last window.&lt;/p&gt;&#xA;&lt;h2&gt;EDIT:&lt;/h2&gt;&#xA;&lt;p&gt;Searching through the source, I found the &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port/blob/2e5ff4921e4474713878c587965b7e45a0cd12bf/lisp/term/mac-win.el#L1112-L1115&quot; rel=&quot;nofollow noreferrer&quot;&gt;&amp;quot;key binding&amp;quot; for &lt;code&gt;mac-apple-event-map&lt;/code&gt;&lt;/a&gt; which calls &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port/blob/2e5ff4921e4474713878c587965b7e45a0cd12bf/lisp/term/mac-win.el#L883-L894&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;mac-ae-reopen-application&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;mac-ae-reopen-application&lt;/code&gt; seems to check for visible and iconified frames and must somehow miss our hidden one. This is possibly a bug.&lt;/p&gt;&#xA;&lt;p&gt;The easy fix is to just disable the key binding in your init:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(define-key mac-apple-event-map [core-event reopen-application] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This introduces a new minor bug: clicking the dock icon when all windows are minimized doesn't automatically maximize one of them. The correct fix would be to rewrite &lt;code&gt;mac-ae-reopen-application&lt;/code&gt;, but I barely know emacs and elisp.&lt;/p&gt;&#xA;" OwnerUserId="2490" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-11-19T09:16:24.640" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3349" PostTypeId="1" CreationDate="2014-11-10T11:37:49.133" Score="8" ViewCount="617" Body="&lt;p&gt;I've written a simple mode for handling JSON. It uses the derived machinery to re-use most of json-mode's code. However one addition is you can insert elisp into the JSON text which is evaluated at JSON submission time. For example an excerpt of the json looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;    &quot;parameters&quot;: {&#xA;        &quot;IRC_USER&quot;: &quot;stsquad&quot;,&#xA;        &quot;PUB_KEY&quot;: `(format &quot;\&quot;%s\&quot;&quot; (s-trim (shell-command-to-string &quot;cat ~/.ssh/id_rsa.pub&quot;)))`&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently the syntax highlighting of this text is broken as the JSON syntax hightlighter get's thrown by the elisp. I'd like to set-up a nested syntax table so the elisp is properly recognised as elisp when inside the escape characters (I've chosen ` in this case). I understand you can join char-tables (which syntax-tables are built from) with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar lava-mode-syntax-table&#xA;  (let ((json-table (copy-syntax-table json-mode-syntax-table))&#xA;        (elisp-table (copy-syntax-table lisp-mode-syntax-table)))&#xA;    (set-char-table-parent elisp-table json-table)&#xA;    (modify-syntax-entry ?` &quot;(`&quot; json-table)&#xA;    (modify-syntax-entry ?` &quot;)`&quot; json-table)&#xA;    json-table)&#xA;  &quot;LAVA Mode syntax table.&#xA;This is a combination of json-mode-syntax-table with an escape into&#xA;  lisp-mode-syntax table for the embedded elisp.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I don't understand how I can modify the syntax table to start using the child (elisp) syntax table while between the escape characters?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-11-17T11:11:43.283" LastActivityDate="2018-08-24T10:50:36.160" Title="How can I nest one syntax table in another?" Tags="|syntax-highlighting|syntax|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3350" PostTypeId="2" ParentId="2347" CreationDate="2014-11-10T12:54:37.307" Score="17" Body="&lt;p&gt;There's a package called &lt;code&gt;whole-line-or-region&lt;/code&gt; which advises various built-in commands so that they act on the current line if no region is active, so &lt;code&gt;M-w&lt;/code&gt; will copy the current line, and &lt;code&gt;C-w&lt;/code&gt; will kill it, for example. I've been using the package for years, and find it indispensable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, this package makes it so that a numeric prefix will indicate the number of lines to act upon, so &lt;code&gt;M-2 M-w&lt;/code&gt; will copy two lines. The other answers here do not provide that handy functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took over maintenance of the package &lt;a href=&quot;https://github.com/purcell/whole-line-or-region&quot;&gt;at my github account&lt;/a&gt; when the author stopped maintaining it and became unresponsive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;whole-line-or-region&lt;/code&gt; also provides facilities for adding this behaviour to further commands, should you need that.&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2014-11-10T13:24:37.170" LastActivityDate="2014-11-10T13:24:37.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3351" PostTypeId="2" ParentId="3327" CreationDate="2014-11-10T13:23:06.780" Score="1" Body="&lt;p&gt;As mentioned in my comment, you can &lt;code&gt;undo&lt;/code&gt; to reactive a snippet.  And if you want to reactivate a yasnippet without first undoing your subsequent changes, you can use &lt;code&gt;undo-in-region&lt;/code&gt;, i.e. select a region of text that contains the snippet and do &lt;code&gt;undo&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-10T13:23:06.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3352" PostTypeId="2" ParentId="2347" CreationDate="2014-11-10T13:47:36.090" Score="4" Body="&lt;p&gt;As an extension to @itsjeyd's answer above I have the following.  (The logic could probably be cleaned up slightly and I will when I port to the new advice system, I'll likely also extend it to extend to &lt;code&gt;sexp&lt;/code&gt;/&lt;code&gt;paragraph&lt;/code&gt; if repeated again).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An initial &lt;code&gt;C-w&lt;/code&gt;/&lt;code&gt;M-w&lt;/code&gt; will grab only the word at point, while calling it a second time will grab the entire line.  &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; *** Copy word/line without selecting&#xA;(defadvice kill-ring-save (before slick-copy-line activate compile)&#xA;  &quot;When called interactively with no region, copy the word or line&#xA;&#xA;Calling it once without a region will copy the current word.&#xA;Calling it a second time will copy the current line.&quot;&#xA;    (interactive&#xA;     (if mark-active (list (region-beginning) (region-end))&#xA;       (if (eq last-command 'kill-ring-save)&#xA;           (progn&#xA;             ;; Uncomment to only keep the line in the kill ring&#xA;             ;; (kill-new &quot;&quot; t)&#xA;             (message &quot;Copied line&quot;)&#xA;             (list (line-beginning-position)&#xA;                   (line-beginning-position 2)))&#xA;         (save-excursion&#xA;           (forward-char)&#xA;           (backward-word)&#xA;           (mark-word)&#xA;           (message &quot;Copied word&quot;)&#xA;           (list (mark) (point)))))))&#xA;&#xA;;; *** Kill word/line without selecting&#xA;(defadvice kill-region (before slick-cut-line first activate compile)&#xA;  &quot;When called interactively kill the current word or line.&#xA;&#xA;Calling it once without a region will kill the current word.&#xA;Calling it a second time will kill the current line.&quot;&#xA;  (interactive&#xA;   (if mark-active (list (region-beginning) (region-end))&#xA;    (if (eq last-command 'kill-region)&#xA;        (progn&#xA;          ;; Return the previous kill to rebuild the line&#xA;          (yank)&#xA;          ;; Add a blank kill, otherwise the word gets appended.&#xA;          ;; Change to (kill-new &quot;&quot; t) to remove the word and only&#xA;          ;; keep the whole line.&#xA;          (kill-new &quot;&quot;)&#xA;          (message &quot;Killed Line&quot;)&#xA;          (list (line-beginning-position)&#xA;                (line-beginning-position 2)))&#xA;      (save-excursion&#xA;        (forward-char)&#xA;        (backward-word)&#xA;        (mark-word)&#xA;        (message &quot;Killed Word&quot;)&#xA;        (list (mark) (point)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-11-10T13:47:36.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3353" PostTypeId="2" ParentId="2520" CreationDate="2014-11-10T14:00:39.207" Score="1" Body="&lt;p&gt;I split my relatively small &lt;code&gt;.emacs&lt;/code&gt; file into three parts: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;emacs-custom.el&lt;/strong&gt; for customizations, ripping out lots of bulky and useless data; the file is automatically rewritten without touching the main &lt;strong&gt;.emacs&lt;/strong&gt; file, preventing spurious changes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-file &quot;~/.emacs-custom.el&quot;)&#xA;(load custom-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;lg-lib.el&lt;/strong&gt; for code rather than configuration: loading my own libraries from nonstandard source locations rather than from the packages directory and defining various functions (mostly copied and hacked in the absence of a proper package); it is another large reduction of &lt;strong&gt;.emacs&lt;/strong&gt; line count.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/lg-lib&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The main &lt;strong&gt;.emacs&lt;/strong&gt; file: without bulky code and bulky customization variables, it contains &lt;code&gt;require&lt;/code&gt; calls for packages, variables that aren't part of the Customize system, and assorted function calls to load and initialize packages. I &quot;organize&quot; it by carefully keeping all lines pertaining to the same package or feature together, and further separating package loading and package-related settings from &quot;core&quot; functionality. A fairly representative excerpt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ido)&#xA;(ido-mode t)&#xA;&#xA;(require 'auto-complete)&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;)&#xA;&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(global-auto-complete-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These sections are tiny, but they would remain manageable with many more lines of configuration for each package. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2113" LastActivityDate="2014-11-10T14:00:39.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3354" PostTypeId="2" ParentId="2520" CreationDate="2014-11-10T14:54:37.570" Score="4" Body="&lt;p&gt;I use the following structure to keep track of packages and files&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d&#xA;|-- elpa            ;; Package.el packages&#xA;|-- hack            ;; Development versions of packages (e.g. org, personal packages)&#xA;|-- single-lisp     ;; Individual lisp files from outside sources (e.g. EmacsWiki)&#xA;|-- site-lisp       ;; Lisp packages not managed by package.el (directories)&#xA;|-- user-config     ;; Machine/situation specific customization (work vs home)&#xA;|   `-- custom.el   ;; Customization settings&#xA;|-- lisp            ;; Individual .el files to keep init.el clean&#xA;|   `-- defaults.el ;; Default configuration settings&#xA;`-- init.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then use &lt;code&gt;use-package&lt;/code&gt; to manage which packages are loaded and which customizations are set for each package.  Most of the time only &lt;code&gt;hack&lt;/code&gt; and &lt;code&gt;elpa&lt;/code&gt; require updating, the other folders are often for one-off packages that I want to test or use briefly but do not need to load (even idly).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;custom.el&lt;/code&gt; is for Customize settings, which I prefer not to use (and do not version even if I do use).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defaults.el&lt;/code&gt; is for general configuration (menu-bar, font, encoding, etc) that can then be overwritten in any .el file in &lt;code&gt;user-config/&lt;/code&gt; to allow for a system that will work as I expect, but can be adjusted to fit the environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had previously tried to keep &lt;code&gt;functions&lt;/code&gt;, &lt;code&gt;macros&lt;/code&gt;, &lt;code&gt;advice&lt;/code&gt; in separate packages to allow for delineation between content, but ran into definition/require issues so have put those back into &lt;code&gt;init.el&lt;/code&gt;.  They may eventually be put back into &lt;code&gt;~/.emacs.d/lisp/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to keep &lt;code&gt;init.el&lt;/code&gt; tidy, sort content by function and purpose so that finding it again will be straightforward.  I've had the monolithic &lt;code&gt;init.el&lt;/code&gt; file and kept adding new content at the end (or where I thought it might fit) and then would end up not knowing what I had added or where I had added it when I went to look for it (and sometimes searching using &lt;code&gt;isearch&lt;/code&gt; did not help since I could not remember how I named things at the time).&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2014-11-10T15:17:42.933" LastActivityDate="2014-11-10T15:17:42.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3355" PostTypeId="2" ParentId="728" CreationDate="2014-11-10T15:00:05.297" Score="10" Body="&lt;p&gt;As @kuanyui says in a comment, &lt;code&gt;next-buffer&lt;/code&gt; &amp;amp; &lt;code&gt;previous-buffer&lt;/code&gt; are very quick, if you have only a few buffers to cycle among. (For more than a few, and for more buffer-choosing features, I use &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Buffer-Name_Input&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;icicle-buffer&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, by default, &lt;em&gt;&lt;code&gt;next-buffer&lt;/code&gt; and &lt;code&gt;previous-buffer&lt;/code&gt; are on a prefix key, &lt;code&gt;C-x&lt;/code&gt;&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means that &lt;strong&gt;they are not repeatable&lt;/strong&gt;: you cannot just hit &lt;code&gt;C-x &amp;lt;right&amp;gt; &amp;lt;right&amp;gt; &amp;lt;right&amp;gt;...&lt;/code&gt;. You must instead either bind these commands to different, repeatable keys, or you must use &lt;code&gt;C-x &amp;lt;right&amp;gt; C-x &amp;lt;right&amp;gt; C-x &amp;lt;right&amp;gt;...&lt;/code&gt;, which is not very quick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For repeatable versions of these commands, load library &lt;a href=&quot;http://www.emacswiki.org/emacs/misc-cmds.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt; and remap the vanilla, unrepeatable versions to the repeatable ones defined there:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [remap previous-buffer] 'previous-buffer-repeat)&#xA;(global-set-key [remap next-buffer]     'next-buffer-repeat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Similarly, in the same library you will find a version of &lt;code&gt;undo&lt;/code&gt; that is repeatable even when on a prefix key: &lt;code&gt;undo-repeat&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;BTW, you can make pretty much &lt;em&gt;any&lt;/em&gt; command repeatable (even on a prefix key), by using function &lt;code&gt;repeat-command&lt;/code&gt; (from &lt;a href=&quot;http://www.emacswiki.org/emacs/misc-cmds.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt;).  This is all that was needed to define the repeatable version of &lt;code&gt;next-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun previous-buffer-repeat ()&#xA;  &quot;Switch to the previous buffer in the selected window.&#xA;You can repeat this by hitting the last key again...&quot;&#xA;  (interactive)&#xA;  (require 'repeat nil t) ; Library `repeat.el' is in Emacs 22.1 and later&#xA;  (repeat-command 'next-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="20059" LastEditDate="2018-09-13T21:48:33.830" LastActivityDate="2018-09-13T21:48:33.830" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="3356" PostTypeId="1" AcceptedAnswerId="3357" CreationDate="2014-11-10T15:35:08.673" Score="16" ViewCount="1154" Body="&lt;p&gt;I do &quot;C-h f&quot; a lot for emacs lisp functions. I prefer to have the window displaying the &lt;em&gt;Help&lt;/em&gt; buffer selected (right after C-h f) and then press &quot;q&quot; when im done to close the window. Is there a way to achive this?&lt;/p&gt;&#xA;" OwnerUserId="970" LastActivityDate="2014-11-10T15:39:58.950" Title="Select *Help* window buffer after C-h f" Tags="|help-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3357" PostTypeId="2" ParentId="3356" CreationDate="2014-11-10T15:39:58.950" Score="23" Body="&lt;p&gt;Try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq help-window-select t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or customize this variable. The full documentation states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Documentation:&#xA;Non-nil means select help window for viewing.&#xA;Choices are:&#xA; never (nil) Select help window only if there is no other window&#xA;             on its frame.&#xA; other       Select help window unless the selected window is the&#xA;             only other window on the help window's frame.&#xA; always (t)  Always select the help window.&#xA;&#xA;This option has effect if and only if the help window was created&#xA;by `with-help-window'&#xA;&#xA;You can customize this variable.&#xA;&#xA;This variable was introduced, or its default value was changed, in&#xA;version 23.1 of Emacs.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-10T15:39:58.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3358" PostTypeId="1" CreationDate="2014-11-10T18:17:11.803" Score="24" ViewCount="6866" Body="&lt;p&gt;The default undo behavior in Evil is too coarse-grained because it considers anything taking place between entering insert mode and leaving it as one edit operation.  When you enter a whole paragraph of text during one insert and then execute undo, the whole paragraph is removed.  In contrast to that, Vim starts a new undo unit whenever you move the cursor in insert mode by means other than entering text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evil has a customization variable that can be used to get a more fine-grained undo history:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-want-fine-undo t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setting, Evil starts a new undo unit when the cursor is moved in insert mode, just like Vim does.  However, this setting also messes with how the replace operation is handled: if you replace a word using &lt;code&gt;cw&lt;/code&gt;, you have to undo twice to restore the original word: once for removing the new word and once for reinserting the original word.  This is inconsistent with Vim and doesn't make much sense because replace should be atomic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question: How can I configure Evil and undo-tree in order to get Vim's undo behavior?&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2022-03-08T17:42:48.877" Title="How can I get undo behavior in Evil similar to Vim's?" Tags="|init-file|customize|evil|undo-tree-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3359" PostTypeId="1" CreationDate="2014-11-10T18:31:13.857" Score="12" ViewCount="3893" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Semantic.html&quot;&gt;&lt;code&gt;Semantic&lt;/code&gt;&lt;/a&gt; &lt;em&gt;seems&lt;/em&gt; to be able to do this, but I cannot get it to work as I would expect it to.  For example, if I &lt;code&gt;#include &quot;Type.h&quot;&lt;/code&gt; and declare &lt;code&gt;Type t&lt;/code&gt;, using &lt;code&gt;semantic-complete-analyze-inline&lt;/code&gt; when point is after &lt;code&gt;t.&lt;/code&gt; consistently gives me the error&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Cannot find types for `Type t'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;instead of giving me all of the public (or otherwise appropriate) members of &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get the result I'm looking for here?  Ideally, how can I use whatever Semantic might provide as a backend for Company?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2015-12-19T21:52:09.250" LastActivityDate="2016-11-24T08:42:06.290" Title="How can I get C/C++ context-sensitive completion with Company?" Tags="|completion|company-mode|c++|semantic-mode|" AnswerCount="3" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3360" PostTypeId="1" CreationDate="2014-11-10T19:51:56.250" Score="5" ViewCount="3608" Body="&lt;p&gt;One way to look into the source code of any function in Emacs is to use the &lt;code&gt;M-.&lt;/code&gt; (find tag). When I do this in Windows platform Emacs 24 I get &lt;code&gt;Find tag:&lt;/code&gt; in the minibuffer asking to enter the name of a function like for example, &lt;code&gt;forward-paragraph&lt;/code&gt; function I don't get any. It seems there is no TAGS file there. When I wanted to create one, using &lt;code&gt;M-x compile RET etags *.el RET&lt;/code&gt;, of no avail. Can you pls help me figure out what is the right way to get TAGS file in Windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;I managed to make TAGS file in &lt;code&gt;c:\GNU Emacs 24.3\&lt;/code&gt; from Windows Terminal: &lt;code&gt;etags -o c:\GNU Emacs 24.3\TAGS c:/GNU Emacs 24.3/lisp/*.el&lt;/code&gt;. After some googling, and the &lt;code&gt;-o&lt;/code&gt; option is to tell where to write the generated TAGS file (destination). But, first as nanny pointed out, this should be run where &lt;code&gt;etags.exe&lt;/code&gt; file resides. So I ran this from the &lt;code&gt;c:\GNU Emacs 24.3\bin\&lt;/code&gt;. My questions:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Where to put the TAGS file, what is the best practice?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why pressing &lt;code&gt;M-.&lt;/code&gt;: find tag, then asks about table tags and I should point out to same dir where TAGS is, that is too much, how to make emacs automatically recognize TAGS?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Even after finding TAGS by emacs, the function &lt;code&gt;forward-paragraph&lt;/code&gt; was not among the  completion items? How to cover all &lt;code&gt;.el&lt;/code&gt; files given a default dir structure of Emacs in Windows platform?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I found beside &lt;code&gt;etags&lt;/code&gt;  there is &lt;code&gt;exuberant ctags&lt;/code&gt;, which one is better in Windows? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="25" LastEditDate="2014-12-12T21:44:34.763" LastActivityDate="2020-07-01T19:41:33.987" Title="Emacs TAGS file in Windows?" Tags="|microsoft-windows|ctags|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3361" PostTypeId="1" AcceptedAnswerId="3496" CreationDate="2014-11-10T20:00:58.583" Score="5" ViewCount="309" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I shift a window &lt;em&gt;column&lt;/em&gt; left and right in a frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use a single frame with multiple windows side-by-side.  Usually each window takes up the full height of the frame, but occasionally, one of those windows will be split vertically (eg, when reading mail, the headers above and the message body below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now: I often swap buffers from window to window, which is easy enough to do.  But: the vertically-split windows almost always contain buffers that logically go together (as in the email example), and I want to move their &lt;em&gt;columns&lt;/em&gt; together, rather than just one buffer at a time.  In other words, in involves manipulating the window layout itself, rather than just which buffer is visible in which window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visual example: I'd like to be able to move the column containing windows (A) and (D) from the left-most column to the middle column:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+-------+-------+-------+    +-------+-------+-------+&#xA;|       |       |       |    |       |       |       |&#xA;|  (A)  |       |       |    |       |  (A)  |       |&#xA;|       |  (B)  |  (C)  | =&amp;gt; |  (B)  |       |  (C)  |&#xA;+-------+       |       |    |       +-------+       |&#xA;|  (D)  |       |       |    |       |  (D)  |       |&#xA;+-------+-------+-------+    +-------+-------+-------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can one accomplish this cleanly?  I say &quot;cleanly&quot; because I've hacked together something that is pretty slow, pretty ugly, and pretty convoluted -- strong suggesting that I'm Doing It Wrong™.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="25" LastEditDate="2014-11-12T23:49:13.670" LastActivityDate="2014-11-17T12:55:15.013" Title="How to shift vertical column of windows left and right in a frame?" Tags="|window|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3362" PostTypeId="2" ParentId="3329" CreationDate="2014-11-10T20:09:59.633" Score="1" Body="&lt;p&gt;The question is confusing, but the comments seem to clarify that your code isn't working with a combination of an .org file &gt; 1MB with a very long line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can replicate this with a .org file in which the &lt;em&gt;first&lt;/em&gt; line of the file is very long (I used 1MB of dots).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(edit: In fact the failure begins -- for me, at least -- at an aesthetically-pleasing 33333 characters :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that instance I see:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Stack overflow in regexp matcher&quot;)&#xA;  looking-at(&quot;.*:ARCHIVE:&quot;)&#xA;  org-cycle-hide-archived-subtrees(all)&#xA;  org-set-startup-visibility()&#xA;  org-mode()&#xA;  set-auto-mode-0(org-mode nil)&#xA;  set-auto-mode()&#xA;  normal-mode(t)&#xA;  after-find-file(nil t)&#xA;  find-file-noselect-1(#&amp;lt;buffer foo.org&amp;gt; &quot;~/foo.org&quot; nil nil &quot;~/foo.org&quot; (3151235 2051))&#xA;  find-file-noselect(&quot;~/foo.org&quot; nil nil t)&#xA;  find-file(&quot;~/foo.org&quot; t)&#xA;  call-interactively(find-file nil nil)&#xA;  command-execute(find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you could &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;report-emacs-bug&lt;/code&gt;. I think your org-mode file must be slightly bizarre to have triggered this, though (assuming this is indeed the same issue).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can work around this by starting with a blank line (or indeed pretty much &lt;em&gt;anything&lt;/em&gt; that's of a sane length).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-10T20:25:46.953" LastActivityDate="2014-11-10T20:25:46.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3363" PostTypeId="2" ParentId="3245" CreationDate="2014-11-10T20:12:03.837" Score="5" Body="&lt;p&gt;Based on the other answers and comments, here's a custom kill command that provides the option to diff a modified buffer with the file it is visiting. I've mapped this to &lt;code&gt;C-x C-k&lt;/code&gt; but could also remap &lt;code&gt;kill-buffer&lt;/code&gt; as suggested in @Drew's answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/kill-this-buffer ()&#xA;  (interactive)&#xA;  (catch 'quit&#xA;    (save-window-excursion&#xA;      (let (done)&#xA;        (when (and buffer-file-name (buffer-modified-p))&#xA;          (while (not done)&#xA;            (let ((response (read-char-choice&#xA;                             (format &quot;Save file %s? (y, n, d, q) &quot; (buffer-file-name))&#xA;                             '(?y ?n ?d ?q))))&#xA;              (setq done (cond&#xA;                          ((eq response ?q) (throw 'quit nil))&#xA;                          ((eq response ?y) (save-buffer) t)&#xA;                          ((eq response ?n) (set-buffer-modified-p nil) t)&#xA;                          ((eq response ?d) (diff-buffer-with-file) nil))))))&#xA;        (kill-buffer (current-buffer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the same basic implementation, you could also advise &lt;code&gt;kill-buffer&lt;/code&gt;. With this approach you get the option to see diffs anywhere that &lt;code&gt;kill-buffer&lt;/code&gt; is called -- for example, when killing marked buffers from Ibuffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/kill-buffer (orig-func &amp;amp;optional buffer-or-name)&#xA;  (catch 'quit&#xA;    (save-window-excursion&#xA;      (with-current-buffer buffer-or-name&#xA;        (let (done (buf (current-buffer)))&#xA;          (when (and buffer-file-name (buffer-modified-p))&#xA;            (while (not done)&#xA;              (let ((response (read-char-choice&#xA;                               (format &quot;Save file %s? (y, n, d, q) &quot; (buffer-file-name buf))&#xA;                               '(?y ?n ?d ?q))))&#xA;                (setq done (cond&#xA;                            ((eq response ?q) (throw 'quit nil))&#xA;                            ((eq response ?y) (save-buffer) t)&#xA;                            ((eq response ?n) (set-buffer-modified-p nil) t)&#xA;                            ((eq response ?d) (diff-buffer-with-file) nil))))))&#xA;          (apply orig-func (list (current-buffer))))))))&#xA;&#xA;(advice-add 'kill-buffer :around #'my/kill-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-11T04:09:07.023" LastActivityDate="2014-11-11T04:09:07.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3364" PostTypeId="5" CreationDate="2014-11-10T20:24:40.670" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-10T20:24:40.670" LastActivityDate="2014-11-10T20:24:40.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3365" PostTypeId="4" CreationDate="2014-11-10T20:24:40.670" Score="0" Body="Reftex mode is a minor mode with distinct support for `\label`, `\ref` and `\cite` in LaTeX." OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-10T21:50:03.800" LastActivityDate="2014-11-10T21:50:03.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3366" PostTypeId="5" CreationDate="2014-11-10T20:32:36.167" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-10T20:32:36.167" LastActivityDate="2014-11-10T20:32:36.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3367" PostTypeId="4" CreationDate="2014-11-10T20:32:36.167" Score="0" Body="Major mode for editing programming language source code. Typically, it is not used directly, instead many programming-related major modes are derived from this mode." OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-10T21:49:27.450" LastActivityDate="2014-11-10T21:49:27.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3368" PostTypeId="2" ParentId="3360" CreationDate="2014-11-10T20:37:05.033" Score="2" Body="&lt;p&gt;etags can't find any &lt;code&gt;*.el&lt;/code&gt; files because there are none in the directory that you ran it in (see, the compile command says: &lt;code&gt;default-directory &amp;quot;~/&amp;quot;&lt;/code&gt;). etags is not recursive. If you'd like it to be, you need to pass it file names like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;dir /b /s *.el | etags&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or on Unix-like systems/with &lt;code&gt;find&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;find . -type f -iname &amp;quot;*.el&amp;quot; | xargs etags --append&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;See also: &lt;a href=&quot;http://www.emacswiki.org/emacs/BuildTags&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/BuildTags&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="15305" LastEditDate="2020-07-01T19:41:33.987" LastActivityDate="2020-07-01T19:41:33.987" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="3370" PostTypeId="1" CreationDate="2014-11-10T23:49:41.130" Score="3" ViewCount="1444" Body="&lt;p&gt;This is somewhat of a follow up to &lt;a href=&quot;https://emacs.stackexchange.com/questions/3209/prevent-emacsclient-from-blocking-other-instances&quot;&gt;Prevent emacsclient from blocking other instances&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;emacsclient -a '' -nw --socket-name=$TTY&lt;/code&gt; where &lt;code&gt;TTY=$(basename tty)&lt;/code&gt;. I use emacs in the terminal and this gives a unique daemon for each terminal session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start the daemon by running &lt;code&gt;emacsclient&lt;/code&gt; with no arguments, it starts and everything works fine. However, if I start it by running &lt;code&gt;emacsclient file&lt;/code&gt;, it locks down. It opens the scratch buffer and then gets frozen. The only way to fix it is to &lt;code&gt;kill -9&lt;/code&gt; the daemon process and to restart it without opening a file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using emacs 24.4 compiled with &lt;code&gt;--without-x&lt;/code&gt; with Mac OS X in iTerm 2. You can get the exact build of emacs I am using with &lt;a href=&quot;http://conda.pydata.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;conda&lt;/a&gt; &lt;code&gt;conda install -c asmeurer emacs&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found after disabling flyspell (commenting out &lt;a href=&quot;https://github.com/asmeurer/dotfiles/blob/29f6c3ae344a784cb536ddbc07bf53b3a234bbd2/.emacs#L614-L637&quot; rel=&quot;nofollow noreferrer&quot;&gt;these lines&lt;/a&gt; from my .emacs), it fixes it. It still hangs on the scratch buffer for a few seconds, but then goes to the file. I suspect it has something to do with starting the hunspell process. &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2020-02-19T22:44:55.903" Title="emacs --daemon frozen when started with emacsclient file" Tags="|emacsclient|daemon|terminal-emacs|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="3371" PostTypeId="2" ParentId="728" CreationDate="2014-11-10T23:54:43.187" Score="7" Body="&lt;p&gt;Others have discussed packages that are useful to make life easier with regards to buffer/window/frame switching.  (I personally use &lt;code&gt;helm&lt;/code&gt; which is phenomenal.)  I want to discuss simpler changes that can make for a more enjoyable Emacs experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, the solution to my buffer/frame woes (because I think &lt;code&gt;C-x o&lt;/code&gt; is the worst) was not a package; it was simply:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;mapping &lt;code&gt;C-;&lt;/code&gt; to &lt;code&gt;other-window&lt;/code&gt; (cycling through windows)&lt;/li&gt;&#xA;&lt;li&gt;mapping &lt;code&gt;C-'&lt;/code&gt; to &lt;code&gt;other-frame&lt;/code&gt; (cycling through frames).  I actually started using frames a lot more after adding this shortcut). &lt;/li&gt;&#xA;&lt;li&gt;mapping other easy single-keystroke key-bindings to simple, custom functions for manipulating buffers in the visible frame.  Examples include: throwing a buffer to the other window (in a 2-window set-up), toggling between the current buffer and last buffer in a given window, burying the other buffer (this one is great for replacing the &lt;code&gt;help&lt;/code&gt; window that pops up (when reading man pages, apropos, etc) with whatever window was previously visible).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I also thought I'd share a few thoughts on key-bindings which newbies might find helpful.  (Sorry if this is the wrong place.)  I don't have specific suggestions but, rather, a &quot;philosophy&quot; that lets me maintain an effective set of keybindings for myself.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Unfrequently used commands do not deserve easy key-bindings.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Download &lt;code&gt;keyfreq.el&lt;/code&gt; and see what you &lt;em&gt;really&lt;/em&gt; use a lot.  I use a survival-of-the-fittest method to decide which commands are awarded the most valuable real-estate on my keyboard.&lt;/li&gt;&#xA;&lt;li&gt;Don't be afraid to get rid of the default Emacs keybindings, some of which are just absurd.  &lt;code&gt;C-\&lt;/code&gt; is a great shortcut (for the reasons discussed in #2)...and it would be a crime to leave it mapped to its default command: &lt;code&gt;change-input-method&lt;/code&gt;.  (Maybe some of you use it a lot, I certainly don't.) &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The following factors determine the ease and speed of a keyboard shortcut (starting with the most important):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Continuously pressing the modifier key&lt;/em&gt; (whatever it may be, &lt;code&gt;Ctrl&lt;/code&gt;, &lt;code&gt;Meta&lt;/code&gt;, etc.).  For example, it's way faster for me to hit &lt;code&gt;C-c C-l C-p&lt;/code&gt; than it is to hit &lt;code&gt;C-x o&lt;/code&gt;.  I personally find it very inconvenient to have to lift off the &lt;code&gt;Ctrl&lt;/code&gt; key in between successive key-strokes of a given key sequence; it's so much easier just to keep mashing the modifier button (in this case, &lt;code&gt;Ctrl&lt;/code&gt;).  (This specific example might be influenced by the fact that I've remapped my &lt;code&gt;Ctrl&lt;/code&gt; key and my &lt;code&gt;Caps-Lock&lt;/code&gt; key.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Alternation in your friend&lt;/em&gt;.  It's way faster for me to hit &lt;code&gt;C-c C-l C-p&lt;/code&gt; than it is to hit &lt;code&gt;C-p C-' C-;&lt;/code&gt;.  (Give it a try and it should be obvious.)  Generally speaking, it's a lot easier to use keystroke sequences that use alternating hands (or, at the least, alternating fingers on the same hand).  &lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Degree of departure from standard hand position.&lt;/em&gt;  This doesn't apply to the hunt-and-peck enthusiasts out there.  But for the rest of us, our most frequently used keyboard shortcuts should allow us to return to our standard touch-typing position quickly and easily.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Just a couple of thoughts that I thought might be helpful to newbies.  I may add some more later.  &lt;/p&gt;&#xA;" OwnerUserId="2084" LastActivityDate="2014-11-10T23:54:43.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3372" PostTypeId="1" AcceptedAnswerId="3395" CreationDate="2014-11-11T00:20:28.903" Score="13" ViewCount="2410" Body="&lt;p&gt;Consider the following two snapshots: The first below is coming from Emacs on Python mode (with Jedi &amp;amp; Elpy)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QpT9H.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This second one below comes from manually photoshopping the previous one to make it easier to distinguish between so many indentation levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7JZpF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any packages that can &lt;strong&gt;help&lt;/strong&gt; accomplish the latter effect? In the example above, I used two colors (enough to distinguish indentation levels from their neighbors), but other color schemes using more colors could make navigation even easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that in Emacs, the indentation character is dictated by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Insert multiple spaces for indentation:&#xA;(setq indent-tabs-mode nil)&#xA;&#xA;# Insert TAB for indentation:&#xA;(setq indent-tabs-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2015-01-28T02:59:21.333" LastActivityDate="2015-01-28T02:59:21.333" Title="Coloring indentation levels" Tags="|indentation|coloring|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3373" PostTypeId="1" CreationDate="2014-11-11T08:48:25.847" Score="2" ViewCount="406" Body="&lt;p&gt;Given the org-mode file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* File Description&#xA;  :PROPERTIES:&#xA;  :comments: org&#xA;  :tangle:   file.sh&#xA;  :noweb: yes&#xA;  :END:&#xA;&#xA;** A function call&#xA;This is foo&#xA;#+BEGIN_SRC sh :noweb-ref myfunction :tangle no&#xA;hello_world()&#xA;#+END_SRC&#xA;&#xA;** Additional info&#xA;This is bar&#xA;#+BEGIN_SRC sh :noweb yes&#xA;  hello_person()&#xA;  &amp;lt;&amp;lt;myfunction&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I tangle the file with &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-v&lt;/kbd&gt; &lt;kbd&gt;t&lt;/kbd&gt;, my expectation would be the following result.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Additional info&#xA;# This is bar&#xA;&#xA;hello_person()&#xA;&#xA;# A function call&#xA;# This is foo&#xA;&#xA;hello_world()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this isn't what happens, The comment from the &lt;code&gt;myfunction&lt;/code&gt; noweb-ref is stripped from the final result and it looks like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Additional info&#xA;# This is bar&#xA;&#xA;hello_person()&#xA;hello_world()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a native way to get this behaviour or do I advise &lt;code&gt;org-babel-expand-noweb-references&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="294" LastActivityDate="2016-10-24T17:57:24.077" Title="How do I get comments in a noweb expansion?" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3374" PostTypeId="1" AcceptedAnswerId="3512" CreationDate="2014-11-11T09:57:58.663" Score="32" ViewCount="5568" Body="&lt;p&gt;I export org-mode files quite often, and almost all of them have code in them. When I do export code, it ends up coloring the text depending on my theme, however, I switch between a dark theme and a light theme regularly. In the case of the light theme, the &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; blocks need to have a light background, and for a dark theme they need to have a dark background (otherwise I end up with light yellow text on a greyish background and it's unreadable).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to add this line for dark backgrounds:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD: &amp;lt;style&amp;gt;pre.src {background-color: #303030; color: #e5e5e5;}&amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then remember to remove it any time I switch to a light colored background&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can automatically detect the background color of the current theme at export time and use it in the exported HTML's CSS?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going with Jordon's answer (thanks Jordon, you get the karma points!), however I wanted to post the solution I ended up adding to my code, since it was a slightly modified version of his answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-inline-css-hook (exporter)&#xA;  &quot;Insert custom inline css to automatically set the&#xA;background of code to whatever theme I'm using's background&quot;&#xA;  (when (eq exporter 'html)&#xA;    (let* ((my-pre-bg (face-background 'default))&#xA;           (my-pre-fg (face-foreground 'default)))&#xA;      (setq&#xA;       org-html-head-extra&#xA;       (concat&#xA;        org-html-head-extra&#xA;        (format &quot;&amp;lt;style type=\&quot;text/css\&quot;&amp;gt;\n pre.src {background-color: %s; color: %s;}&amp;lt;/style&amp;gt;\n&quot;&#xA;                my-pre-bg my-pre-fg))))))&#xA;&#xA;(add-hook 'org-export-before-processing-hook 'my/org-inline-css-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This sets not only the background color, but also the foreground color. It also appends the line to the existing &lt;code&gt;org-html-head-extra&lt;/code&gt; setting so other HTML isn't overwritten accidentally. I've tested and this works great for me!&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="379" LastEditDate="2014-11-14T10:25:12.410" LastActivityDate="2016-09-17T22:47:07.480" Title="Set the background of org-exported &lt;code&gt; blocks according to theme" Tags="|org-mode|org-export|html|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3375" PostTypeId="1" AcceptedAnswerId="3381" CreationDate="2014-11-11T11:28:10.893" Score="20" ViewCount="13487" Body="&lt;p&gt;I'm trying to use &lt;code&gt;org-mode&lt;/code&gt; to do almost everything. In my scientific writing activity, I would like to sketch a whole paper in an &lt;code&gt;.org&lt;/code&gt; file and then export in LaTeX. I don't want to load the &lt;code&gt;.bib&lt;/code&gt; bibtex file in the &lt;code&gt;init.el&lt;/code&gt; as I could have multiple ones. For now, I've added this at the head of my &lt;code&gt;.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp&#xA;(setq reftex-default-bibliography '(&quot;./references.bib&quot;))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I have to execute it manually every time. Is there any way to make it automatic? The optimal would be to have a directive at the beginning of each &lt;code&gt;.org&lt;/code&gt; file saying emacs: &quot;ok, now you should load &lt;em&gt;this&lt;/em&gt; &lt;code&gt;.bib&lt;/code&gt; file&quot;. Any hint? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="201" LastActivityDate="2020-10-25T18:10:29.200" Title="Loading bibtex file in org-mode file" Tags="|org-mode|reftex-mode|bibtex|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3376" PostTypeId="2" ParentId="3067" CreationDate="2014-11-11T11:32:24.497" Score="4" Body="&lt;p&gt;In Aquamacs, I had the Option &lt;code&gt;...Meta &amp;amp; German&lt;/code&gt; activated, which seemed to be the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now with another setting, I can enter also commands which contain the @ sign.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We'll see, if there are some side effects...&lt;/p&gt;&#xA;" OwnerUserId="2377" LastActivityDate="2014-11-11T11:32:24.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3377" PostTypeId="2" ParentId="3030" CreationDate="2014-11-11T13:51:01.883" Score="2" Body="&lt;p&gt;You can temporarily display text in a buffer with the function &lt;code&gt;momentary-string-display&lt;/code&gt;.  It takes a message to display and a position in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(momentary-string-display &quot;hello there&quot; 200)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will place the string &quot;hello there&quot; at position 200 in the buffer.  It will move all other text at this point to the side to make room for &quot;hello world&quot;, but everything will be restored to where it was when you hit any key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't need text in the buffer to create overlays, although that's a requirement for text-properties.  Here's an overlay with zero width that results in additional text to be displayed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((ov (make-overlay 1 1)))&#xA;  (overlay-put ov 'before-string &quot;this text is not part of the buffer&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this overlay will push away the buffer text; it will not cover the text at the given position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not seem to be possible to place an overlay at any position in the buffer that is greater than &lt;code&gt;point-max&lt;/code&gt; / &lt;code&gt;buffer-size&lt;/code&gt;, i.e. you probably won't be able to place text at some specific position below the buffer text unless you hack around this restriction.  You can, of course, place text right after the buffer text with the &lt;code&gt;after-string&lt;/code&gt; property on an overlay pinned to the &lt;code&gt;point-max&lt;/code&gt; position.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-11-11T13:51:01.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3378" PostTypeId="1" CreationDate="2014-11-11T14:05:52.547" Score="8" ViewCount="748" Body="&lt;p&gt;After packages have been updated, the location of the loaded elisp files will change to be in the folder of the new version of the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yasnippet attempts to lazily load snippets for the file it was installed it, when I open a file in a major mode yasnippet hasn't seen before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that loading things with previously unseen major modes once emacs has been updated fails, because yasnippet breaks the whole thing by complaining about &quot;no such file or directory&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a good general way to solve this, such as not letting updates break things? (I get a similar but less tedious problem when ag is updated). Alternatively, would advising something in yasnippet to just swallow the errors so it merely warns instead of erroring when it couldn't load packages be a better plan?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clarification:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I start emacs, and yasnippet is loaded.&lt;/li&gt;&#xA;&lt;li&gt;I load no files whose major mode is (for example) makefiles. &lt;/li&gt;&#xA;&lt;li&gt;I update to a new version of yasnippet, using the package manager&lt;/li&gt;&#xA;&lt;li&gt;I load a makefile, and yasnippet attempts to load the snippets for makefiles&#xA;but it fails, because the folder it was using for snippets no longer exists. Not only that, but practically &lt;em&gt;every&lt;/em&gt; other command fails, because the pre-hook to them that yasnippet installed fails. &lt;/li&gt;&#xA;&lt;li&gt;Workaround: Open the message buffer, find which folder cannot be opened and run &lt;code&gt;mkdir ~/.blargh/folder-yasnippet-wants&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Clearly, one could could write some advice for some bit of yasnippet, but I'm hoping for a more global solution (and it'd take a while of playing with elisp to get the advice to work I'm sure).&lt;/p&gt;&#xA;" OwnerUserId="503" LastEditorUserId="503" LastEditDate="2014-11-12T12:15:04.673" LastActivityDate="2014-11-13T10:33:39.213" Title="How can I prevent yasnippet from breaking when I update my packages?" Tags="|elisp|init-file|yasnippet|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3379" PostTypeId="2" ParentId="3030" CreationDate="2014-11-11T14:22:46.987" Score="6" Body="&lt;p&gt;I've whipped up a working example of a function that takes a string and temporarily displays it with a timeout after the buffer text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-momentarily-display-after-buffer-end (string &amp;amp;optional timeout)&#xA;  (let ((ov (make-overlay (point-max) (point-max))))&#xA;    (overlay-put ov 'after-string&#xA;                 (concat (propertize &quot; &quot; 'display&#xA;                                     '(space :align-to (+ left-fringe 10)))&#xA;                         (propertize string 'display&#xA;                                     '(raise -1))&#xA;                         &quot;\n\n&quot;))&#xA;    (sit-for (or timeout 5))&#xA;    (delete-overlay ov)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following incantation will result in your lower red box example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(my-momentarily-display-after-buffer-end &quot;Nothing to see here...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason this works is because overlays use markers as positions to be displayed between. Using the outermost position as start and end of the overlay enables you to display text &lt;em&gt;after&lt;/em&gt; it by using the &lt;code&gt;after-string&lt;/code&gt; property. Since overlays can contain propertized text, I set it up to appear indented and with whitespace around it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other example can use the same idea to display text after the end&#xA;of the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-momentarily-display-after-line-end (string &amp;amp;optional timeout)&#xA;  (let ((ov (make-overlay (line-end-position) (line-end-position))))&#xA;    (overlay-put&#xA;     ov 'after-string&#xA;     (concat (propertize &quot; &quot; 'display&#xA;                         `(space :align-to (- right-fringe&#xA;                                              ,(1+ (length string)))))&#xA;             string))&#xA;    (sit-for (or timeout 5))&#xA;    (delete-overlay ov)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following invocation will result in your right side red box example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(my-momentarily-display-after-line-end &quot;annotation&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can go a lot more crazy and add faces to distinguish these&#xA;overlays from buffer text, display them longer than for a timeout,&#xA;adjust their position, detect when there's no empty space and use&#xA;normal overlays of propertized text, etc.  I recommend looking at the&#xA;source code of&#xA;&lt;a href=&quot;https://github.com/company-mode/company-mode&quot;&gt;company-mode&lt;/a&gt; because&#xA;it's very readable and demonstrates a more elaborate (and mostly&#xA;bugfree) usage of overlays to create a flexible popup menu with the&#xA;suggested features.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-11-11T14:44:27.943" LastActivityDate="2014-11-11T14:44:27.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3380" PostTypeId="1" AcceptedAnswerId="3389" CreationDate="2014-11-11T15:22:20.383" Score="8" ViewCount="401" Body="&lt;p&gt;In the &lt;code&gt;magit-status&lt;/code&gt; buffer, pressing &lt;kbd&gt;TAB&lt;/kbd&gt; shows or hides a given section, which is handy when looking at unstaged content and see what hunks can be staged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when tabbing on a section, the buffer goes down, so the section I am trying to expand goes to the bottom of the buffer, thus hiding the expanded part of the section.  I then have to cycle using &lt;code&gt;recenter-top-bottom&lt;/code&gt; to bring the section back to the top of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to automatically bring the section / entry to the top of the buffer when expanding it?&lt;/p&gt;&#xA;" OwnerUserId="724" LastEditorUserId="724" LastEditDate="2014-11-11T15:42:59.663" LastActivityDate="2015-04-28T20:14:12.770" Title="How to scroll up when expanding a section in magit-status?" Tags="|magit|" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3381" PostTypeId="2" ParentId="3375" CreationDate="2014-11-11T15:37:02.167" Score="23" Body="&lt;p&gt;Adding a line like the following is enough to tell &lt;code&gt;org-mode&lt;/code&gt; which &lt;code&gt;.bib&lt;/code&gt; file to consult:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BIBLIOGRAPHY: refs plain&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;refs&lt;/code&gt; is the name of the BibTeX file (&lt;code&gt;.bib&lt;/code&gt; extension omitted), and &lt;code&gt;plain&lt;/code&gt; is the &lt;code&gt;bibliographystyle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then call &lt;code&gt;org-reftex-citation&lt;/code&gt; (bound to &lt;code&gt;C-c C-x [&lt;/code&gt; by default) to insert references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(org-reftex-citation)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use &lt;code&gt;reftex-citation&lt;/code&gt; to insert a citation into the buffer.&#xA;  This looks for a line like&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;#+BIBLIOGRAPHY: foo plain option:-d&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;and derives from it that &lt;code&gt;foo.bib&lt;/code&gt; is the bibliography file relevant&#xA;  for this document.  It then installs the necessary environment for RefTeX&#xA;  to work in this buffer and calls &lt;code&gt;reftex-citation&lt;/code&gt; to insert a citation&#xA;  into the buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Export of such citations to both LaTeX and HTML is handled by the contributed&#xA;  package &lt;code&gt;ox-bibtex&lt;/code&gt; by Taru Karttunen.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As the last sentence suggests, you'll need to add&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;(require 'ox-bibtex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init-file to make sure references get exported to LaTeX properly. When I set this up for myself, I found that I also needed to customize &lt;code&gt;org-latex-pdf-process&lt;/code&gt; in order to make PDF exports work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-latex-pdf-process '(&quot;texi2dvi -p -b -V %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Addendum&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If you don't want to use the default binding for &lt;code&gt;org-reftex-citation&lt;/code&gt;, you can set up a custom key binding for it. For example, the following binds &lt;code&gt;org-reftex-citation&lt;/code&gt; to the default binding for &lt;code&gt;reftex-citation&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c [&quot;) 'org-reftex-citation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-19T15:01:55.433" LastActivityDate="2015-01-19T15:01:55.433" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3382" PostTypeId="2" ParentId="3360" CreationDate="2014-11-11T15:37:16.460" Score="2" Body="&lt;p&gt;If you use Cygwin, just download &lt;a href=&quot;http://ctags.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Exuberant Ctags&lt;/a&gt; and compiled then install it; or install via Cygwin installer. Then, you can simply run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ctags -e -R &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At your project root to generate Emacs-compatible TAGS file for your project.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-11-11T15:37:16.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3383" PostTypeId="2" ParentId="3380" CreationDate="2014-11-11T15:40:12.247" Score="4" Body="&lt;p&gt;On the &lt;code&gt;next&lt;/code&gt; branch that's already supported. (Which shouldn't keep anybody from giving another answer here, explaining how to get the same effect with &lt;code&gt;master&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-11-11T15:40:12.247" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3384" PostTypeId="2" ParentId="3345" CreationDate="2014-11-11T15:42:18.950" Score="0" Body="&lt;p&gt;The quick and dirty version: it sounds like there's Something Odd in the &lt;code&gt;.emacs.d&lt;/code&gt; setup that you're using.  To get back to the original binding for &lt;code&gt;S&lt;/code&gt; in normal state, evaluate the following after loading the rest of your init file (simplest way: stick this line at the end of that file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;S&quot; #'evil-change-whole-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This line will clobber whatever binding clobbered the original binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, follow the advice given in the comments about bisecting your init file and report the problem to the originator of the &lt;code&gt;.emacs.d&lt;/code&gt; that you're using in order to figure out what/where the problem is.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-11T15:42:18.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3385" PostTypeId="2" ParentId="3272" CreationDate="2014-11-11T15:51:23.483" Score="4" Body="&lt;p&gt;&lt;strong&gt;Short version&lt;/strong&gt;: in Emacs terms, what I really needed was &lt;a href=&quot;http://www.emacswiki.org/emacs/key-chord.el&quot; rel=&quot;nofollow&quot;&gt;key-chords&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;@Malabarba and @XinUmbralis seem to be right - Emacs doesn't let you turn a normal key into a modifier key normally. I don't really like the idea of combining every modifier key on the keyboard and calling that &quot;Hyper&quot;, because it could conflict with other things in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already use Karabiner, and apparently you can create &lt;a href=&quot;https://pqrs.org/osx/karabiner/xml.html.en#modifier&quot; rel=&quot;nofollow&quot;&gt;custom modifiers&lt;/a&gt; with it. But that requires mapping every combination at the OS level so that, say, &lt;code&gt;§-a&lt;/code&gt; sends something that Emacs knows how to handle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I remembered the &lt;a href=&quot;http://www.emacswiki.org/emacs/key-chord.el&quot; rel=&quot;nofollow&quot;&gt;key-chord library&lt;/a&gt;, and realized that was the real Emacs terminology for what I wanted. Example config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'key-chord)&#xA;(key-chord-mode 1)&#xA;(key-chord-define-global &quot;§a&quot; 'other-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The one issue I have with key-chord is that the semantics of a key-chord are a bit different from a modifier+key - there's no repetition allowed, and the whole chord has to be entered really quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I come up with a solution to those problems, I'll write about it somewhere and provide a link in an edit to this answer.&lt;/p&gt;&#xA;" OwnerUserId="2459" LastActivityDate="2014-11-11T15:51:23.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3386" PostTypeId="1" CreationDate="2014-11-11T16:06:23.633" Score="12" ViewCount="1170" Body="&lt;p&gt;I'm using Emacs, AUCTeX, and &lt;code&gt;latex-preview-pane-mode&lt;/code&gt; to create a PDF presentation. However, the preview only displays one page at a time.&lt;br&gt;&#xA;Is this the only way? It wastes some of the vertical space available on the screen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible for Docview to preview several pages of a PDF in one page?&lt;/p&gt;&#xA;" OwnerDisplayName="user2280" LastEditorDisplayName="user2280" LastEditDate="2018-09-16T19:40:55.350" LastActivityDate="2018-09-16T19:40:55.350" Title="How to display several pages of a PDF simultaneously in Docview?" Tags="|preview-latex|docview|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="3387" PostTypeId="1" CreationDate="2014-11-11T16:34:42.510" Score="16" ViewCount="2853" Body="&lt;p&gt;I'm using &lt;code&gt;org-mode&lt;/code&gt; in emacs, but I think the question is also relevant for &lt;code&gt;auctex&lt;/code&gt; users.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt; you can show latex fragments, as the &lt;a href=&quot;http://orgmode.org/manual/Previewing-LaTeX-fragments.html&quot;&gt;manual&lt;/a&gt; demonstrates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But: these fragments (mostly math formulae) seem to have &lt;em&gt;constant&lt;/em&gt; size.  When I type &lt;code&gt;C-x C-+&lt;/code&gt; or &lt;code&gt;C-x C--&lt;/code&gt; &lt;em&gt;only&lt;/em&gt; the buffer text size changes.  How can I change the fragments size from the buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know I can make the fragments larger or smaller with &lt;code&gt;org-format-latex-options&lt;/code&gt;, but this is permanent. I want to change the size of the fragments (the png files) like the text.)&lt;/p&gt;&#xA;" OwnerUserId="2512" LastEditorUserId="50" LastEditDate="2014-11-11T17:25:34.387" LastActivityDate="2023-02-21T12:20:28.377" Title="How to enlarge latex fragments in org mode at the same time as the buffer text?" Tags="|org-mode|latex|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3388" PostTypeId="1" AcceptedAnswerId="3409" CreationDate="2014-11-11T16:39:17.600" Score="4" ViewCount="284" Body="&lt;p&gt;I'm completely new to elisp, and I want a function which&#xA;cycles through 3 options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Highlight the word.&lt;/li&gt;&#xA;&lt;li&gt;Highlight the sentence.&lt;/li&gt;&#xA;&lt;li&gt;Then highlight the paragraph.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the proper way to get the function to &lt;code&gt;(setq setnewpoint t)&lt;/code&gt; and &lt;code&gt;(setq cyclemarker 1)&lt;/code&gt; if I &lt;code&gt;C-g&lt;/code&gt; mid-cycle?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq cyclemarker 1)&#xA;(setq setnewpoint t)&#xA;&#xA;(defun highlight-cycle ()&#xA;  (interactive)&#xA;  (if setnewpoint&#xA;      (progn&#xA;        (forward-word)&#xA;        (backward-word)&#xA;        (point-to-register 1)&#xA;        (setq setnewpoint nil)))&#xA;  (cond ((= cyclemarker 1)&#xA;           (progn&#xA;             (register-to-point 1)&#xA;             (setq setnewpoint t)&#xA;             (setq cyclemarker 2)&#xA;             (keyboard-quit)))&#xA;        ((= cyclemarker 2)&#xA;           (progn&#xA;             (register-to-point 1)                   &#xA;             (mark-word)&#xA;             (setq cyclemarker 3)))&#xA;        ((= cyclemarker 3)&#xA;           (progn&#xA;             (register-to-point 1)&#xA;             (mark-end-of-sentence 1)&#xA;             (forward-sentence 1)&#xA;             (backward-sentence 1)&#xA;             (setq cyclemarker 4)&#xA;             ))&#xA;        ((= cyclemarker 4)&#xA;           (progn&#xA;             (register-to-point 1)&#xA;             (mark-paragraph)&#xA;             (cond ((/= (line-beginning-position) (point-min))&#xA;             (next-line)&#xA;             (beginning-of-line)))&#xA;             (setq cyclemarker 1)))&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2511" LastEditorUserId="105" LastEditDate="2015-03-27T19:23:13.337" LastActivityDate="2015-03-27T19:23:13.337" Title="How to reset a counter if `C-g` is pressed" Tags="|elisp|cycling|" AnswerCount="4" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="3389" PostTypeId="2" ParentId="3380" CreationDate="2014-11-11T17:03:55.360" Score="5" Body="&lt;p&gt;If you're using Emacs v24.3.x, put his in your &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice magit-toggle-section (after magit-section-hidden activate)&#xA;  (recenter-top-bottom 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're using Emacs v24.4.x, here is what I have come up with using an advice – although I am sure it is not perfect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun magit-toggle-scroll-to-top () (recenter-top-bottom 0))&#xA;(advice-add 'magit-toggle-section :after #'magit-toggle-scroll-to-top)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="724" LastEditorUserId="724" LastEditDate="2015-04-28T11:01:13.390" LastActivityDate="2015-04-28T11:01:13.390" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3390" PostTypeId="2" ParentId="3388" CreationDate="2014-11-11T17:13:03.313" Score="1" Body="&lt;p&gt;You shouldn't sweat about keyboard interrupts for such an undemanding task as you described.&#xA;But the way to do it is though &lt;code&gt;unwind-protect&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(defun lispy--mark (bnd)&#xA;  &quot;Mark BND.  BND is a cons of beginning and end positions.&quot;&#xA;  (destructuring-bind (beg . end) bnd&#xA;    (goto-char beg)&#xA;    (push-mark-command t t)&#xA;    (goto-char end)))&#xA;&#xA;(defun highlight-cycle ()&#xA;  (interactive)&#xA;  (unwind-protect&#xA;       (progn&#xA;         (sit-for 2)&#xA;         (let ((bnd (if (region-active-p)&#xA;                        (cons (region-beginning)&#xA;                              (region-end))&#xA;                      (bounds-of-thing-at-point 'word))))&#xA;           (if (region-active-p)&#xA;               (cond ((equal bnd (bounds-of-thing-at-point 'word))&#xA;                      (lispy--mark (bounds-of-thing-at-point 'sentence)))&#xA;                     ((equal bnd (bounds-of-thing-at-point 'page))&#xA;                      (deactivate-mark t)&#xA;                      (lispy--mark (get 'highlight-cycle 'word)))&#xA;                     (t&#xA;                      (lispy--mark (bounds-of-thing-at-point 'page))))&#xA;             (put 'highlight-cycle 'word bnd)&#xA;             (lispy--mark bnd))))&#xA;    (error &quot;Have some patience, please&quot;)))&#xA;&#xA;(global-set-key (kbd &quot;M-m&quot;) 'highlight-cycle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;highlight-cycle&lt;/code&gt; will cycle between word, sentence and page, but it will wait for 2 seconds before&#xA;doing anything. If the user interrupts with &lt;kbd&gt;C-g&lt;/kbd&gt;, it will complain. You can put something&#xA;other than complaint there, of course.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-11T17:13:03.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3391" PostTypeId="2" ParentId="3388" CreationDate="2014-11-11T17:28:33.420" Score="1" Body="&lt;p&gt;If I don't invoke keyboard-quit mid code above, advising&#xA;keyboard-quit directly answers the question.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice keyboard-quit (before highlight-cycle-counter)&#xA;&quot;reset counter for highlight-cycle&quot;&#xA;     (progn&#xA;         (setq setnewpoint t)&#xA;         (setq cyclemarker 1)&#xA;      )&#xA;)&#xA;&#xA;(ad-activate 'keyboard-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This might not be the &lt;em&gt;right&lt;/em&gt; answer to the problem, but it is&#xA;sufficient for now.&lt;/p&gt;&#xA;" OwnerUserId="2511" LastActivityDate="2014-11-11T17:28:33.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3392" PostTypeId="1" AcceptedAnswerId="3394" CreationDate="2014-11-11T18:29:07.060" Score="3" ViewCount="246" Body="&lt;p&gt;C-e C-j will insert a newline below and jump to it indented.&#xA;C-a C-o TAB will insert a newline above and jump to it indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a single bind to these or where/how should I bind these commands?&lt;/p&gt;&#xA;" OwnerUserId="2464" LastActivityDate="2014-11-11T18:39:02.043" Title="Bind C-e C-j and C-a C-o TAB to single key, aka insert and jump to newline" Tags="|key-bindings|commands|newlines|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3393" PostTypeId="2" ParentId="3388" CreationDate="2014-11-11T18:29:35.123" Score="4" Body="&lt;p&gt;This is tangential to the elisp related question but you might find the behaviour of &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow&quot;&gt;expand-region&lt;/a&gt; what you are looking for. You may also find it's &lt;a href=&quot;https://github.com/magnars/expand-region.el/blob/master/expand-region-core.el#L62&quot; rel=&quot;nofollow&quot;&gt;implementation&lt;/a&gt; interesting from an idiomatic approach to the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically the main expander wraps the per-word, per-sentence and per-paragraph hooks in a &lt;em&gt;save-excursion&lt;/em&gt; loop and then uses the &quot;best&quot; results going forward.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-11-11T20:15:24.507" LastActivityDate="2014-11-11T20:15:24.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3394" PostTypeId="2" ParentId="3392" CreationDate="2014-11-11T18:39:02.043" Score="6" Body="&lt;p&gt;You can always check what function some keys are bound to using &lt;code&gt;C-h k&lt;/code&gt;. For example, if we type &lt;code&gt;C-h k C-e&lt;/code&gt;, we see that it is bound to &lt;code&gt;(move-end-of-line ARG)&lt;/code&gt;; similarly, &lt;code&gt;C-j&lt;/code&gt; is bound to &lt;code&gt;(newline-and-indent)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, it turns out that &lt;code&gt;C-e C-j&lt;/code&gt; is a sequence of two commands rather than a single thing. (The same with &lt;code&gt;C-a C-o TAB&lt;/code&gt;.) To bind this to a single key, we first have to wrap it in a function. You can define this function in your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-newline-below ()&#xA;  &quot;Insert a newline below and jump to it indented.&quot;&#xA;  (interactive)&#xA;  (move-end-of-line nil)&#xA;  (newline-and-indent))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All this function does is run the two commands we found. The string on top is just some documentation, and &lt;code&gt;(interactive)&lt;/code&gt; is needed so that you can bind it to a key (or call it directly from &lt;code&gt;M-x&lt;/code&gt;). &lt;code&gt;move-end-of-line&lt;/code&gt; takes an argument, so we just pass in &lt;code&gt;nil&lt;/code&gt; to get the default behavior. Happily, the output of &lt;code&gt;C-h k&lt;/code&gt; tells us we can do this, so we don't have to guess what &lt;code&gt;ARG&lt;/code&gt; is for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we can just globally set this to some key:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-M-j&quot;) 'my-newline-below)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And voilà: the first command you wanted, bound to &lt;code&gt;C-M-j&lt;/code&gt;. Now you can do the second one the same way, which is a great exercise to learn how to define your own custom commands like this.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2014-11-11T18:39:02.043" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3395" PostTypeId="2" ParentId="3372" CreationDate="2014-11-11T19:12:22.997" Score="7" Body="&lt;p&gt;Here are a few minor modes that look like they could be tweaked to meet the needs of the original poster:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.github.com/skeeto/visual-indentation-mode&quot; rel=&quot;noreferrer&quot;&gt;http://www.github.com/skeeto/visual-indentation-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FOrPH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.github.com/antonj/Highlight-Indentation-for-Emacs&quot; rel=&quot;noreferrer&quot;&gt;http://www.github.com/antonj/Highlight-Indentation-for-Emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/CqhPa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.github.com/zk-phi/indent-guide&quot; rel=&quot;noreferrer&quot;&gt;http://www.github.com/zk-phi/indent-guide&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[No screenshot due to no *.gif support when adding links.]&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There are also a few minor modes out there that create a vertical line that tracks the cursor position, which the original poster may find helpful. &lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-11-11T19:12:22.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3396" PostTypeId="2" ParentId="3314" CreationDate="2014-11-11T19:36:54.777" Score="0" Body="&lt;p&gt;The culprit was...my font choice of &lt;code&gt;Inconsolata&lt;/code&gt;...which makes me sad because I really liked it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Also, recursively bisecting the .emacs file is a great method for quickly isolating problems - thanks for the suggestion.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br&gt;&#xA;My findings re: fonts which properly showed symbols:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;s&gt;Inconsolata&lt;/s&gt; ✗  &lt;/li&gt;&#xA;&lt;li&gt;&lt;s&gt;Source Code Pro&lt;/s&gt; ✗  &lt;/li&gt;&#xA;&lt;li&gt;Consolas ✓&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Microsoft wins this round, I suppose)&lt;/p&gt;&#xA;" OwnerUserId="2084" LastActivityDate="2014-11-11T19:36:54.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3397" PostTypeId="1" CreationDate="2014-11-11T20:49:17.757" Score="57" ViewCount="10859" Body="&lt;p&gt;I have this by default in my &lt;code&gt;auto-mode-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;\\.js\\'&quot; . javascript-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(even with &lt;code&gt;emacs -Q&lt;/code&gt;).  I'd like to substitute &lt;code&gt;js2-mode&lt;/code&gt; for &lt;code&gt;javascript-mode&lt;/code&gt;.  Of course, I could use &lt;code&gt;assq-delete-all&lt;/code&gt; and then &lt;code&gt;add-to-list&lt;/code&gt; again, but I'm wondering whether there isn't a better way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I explicitly &lt;em&gt;do not want&lt;/em&gt; to use Customize, I prefer crafting my &lt;code&gt;init.el&lt;/code&gt; myself.&lt;/p&gt;&#xA;" OwnerUserId="642" LastEditorUserId="253" LastEditDate="2014-11-11T23:55:11.397" LastActivityDate="2022-06-20T12:38:29.933" Title="How to replace an element of an alist?" Tags="|elisp|association-lists|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3398" PostTypeId="2" ParentId="3397" CreationDate="2014-11-11T20:55:07.380" Score="55" Body="&lt;p&gt;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Setting-Generalized-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;setf&lt;/code&gt;&lt;/a&gt; to change the value in place:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setf (cdr (rassoc 'javascript-mode auto-mode-alist)) 'js2-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you want to &lt;em&gt;replace&lt;/em&gt; a value in the list, then &lt;code&gt;setf&lt;/code&gt; is the generalized machinery you need to do so.  For the more idiomatic way to deal with the &lt;code&gt;auto-mode-alist&lt;/code&gt;, see @Drew's answer (and his explanation of shadowing).&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="38139" LastEditDate="2022-06-20T12:38:29.933" LastActivityDate="2022-06-20T12:38:29.933" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="3399" PostTypeId="5" CreationDate="2014-11-11T21:12:35.243" Score="0" Body="&lt;p&gt;See &lt;a href=&quot;http://www.r-project.org&quot; rel=&quot;nofollow&quot;&gt;http://www.r-project.org&lt;/a&gt; for more details on R. More information on ESS can be found at its tag: &lt;a href=&quot;/questions/tagged/ess&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged 'ess'&quot; rel=&quot;tag&quot;&gt;ess&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-11T22:36:17.747" LastActivityDate="2014-11-11T22:36:17.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3400" PostTypeId="4" CreationDate="2014-11-11T21:12:35.243" Score="0" Body="R is a free software environment for statistical computing and graphics. R can be run from within Emacs using the ESS (Emacs Speaks Statistics) package, which also provides a major mode for editing `.R` files." OwnerUserId="421" LastEditorUserId="421" LastEditDate="2014-11-11T21:30:11.853" LastActivityDate="2014-11-11T21:30:11.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3401" PostTypeId="1" CreationDate="2014-11-11T21:33:46.980" Score="2" ViewCount="3500" Body="&lt;p&gt;Is there any way to bind a command to a key combination like &lt;code&gt;AltGr-f&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I ask is the following:  I use the “US international” keyboard layout (on Linux), which remaps the right Alt key to AltGr (aka Level3 shift), so that I can type certain accented characters I need. But this keyboard layout also has the nice side-effect of making some new (and very convenient) key combinations available; for instance, &lt;code&gt;AltGr-t&lt;/code&gt; inserts þ, which I never use, so I can rebind it to something else.  The problem is that &lt;code&gt;AltGr-f&lt;/code&gt; inserts an f, and not some useless symbol, so I can't bind that key to a command (similar issue with the characters g, h, b).  I know I could use xmodmap to assign some random symbol to &lt;code&gt;AltGr-f&lt;/code&gt;, but is there a pure Emacs way to do that?&lt;/p&gt;&#xA;" OwnerUserId="2514" LastActivityDate="2017-12-10T00:40:21.970" Title="Keybindings with AltGr" Tags="|key-bindings|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3402" PostTypeId="2" ParentId="3397" CreationDate="2014-11-11T21:34:32.783" Score="58" Body="&lt;p&gt;While @Dan's answer is a perfectly fine solution, it is unnecessary. One of the reasons Emacs uses an &lt;strong&gt;&lt;em&gt;alist&lt;/em&gt;&lt;/strong&gt; here is that with an alist you can simply add a new element to the front of the list and it will &lt;em&gt;shadow matches further down the list&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.js\\'&quot; . js2-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:49:51.633" LastActivityDate="2015-05-09T20:49:51.633" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3404" PostTypeId="2" ParentId="3104" CreationDate="2014-11-11T22:14:44.703" Score="16" Body="&lt;p&gt;As explained in &lt;a href=&quot;http://emacswiki.org/emacs/TeXInputMethod&quot; rel=&quot;nofollow noreferrer&quot;&gt;this EmacsWiki article&lt;/a&gt;, you can append stuff to an input method like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(let ((quail-current-package (assoc &amp;quot;TeX&amp;quot; quail-package-alist)))&#xA;  (quail-define-rules ((append . t))&#xA;                      (&amp;quot;_i&amp;quot; ?ᵢ)&#xA;                      (&amp;quot;^\\alpha&amp;quot; ?ᵅ)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I also find it convenient to use &lt;code&gt;;&lt;/code&gt; instead of the cumbersome &lt;code&gt;\&lt;/code&gt; as a prefix for my symbols, so I do the following&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(let ((quail-current-package (assoc &amp;quot;TeX&amp;quot; quail-package-alist)))&#xA;   (quail-defrule &amp;quot;;&amp;quot; (quail-lookup-key &amp;quot;\\&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Finally, note that the file &lt;a href=&quot;https://github.com/vitoshka/ac-math/blob/master/ac-math.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;ac-math.el&lt;/a&gt; contains a list of unicode math characters and the corresponding TeX macro names, and can be easily changed into a new and much more complete TeX-esque input method (I can even type &lt;code&gt;\gamma\dot&lt;/code&gt; to get γ̇.)&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;ADDENDUM&lt;/strong&gt;  Using the new package &lt;a href=&quot;https://github.com/vspinu/math-symbol-lists&quot; rel=&quot;nofollow noreferrer&quot;&gt;math-symbol-lists&lt;/a&gt; (available on MELPA) one can define a comprehensive mathematical input method as follows:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;(require 'math-symbol-lists)&#xA;(quail-define-package &amp;quot;math&amp;quot; &amp;quot;UTF-8&amp;quot; &amp;quot;Ω&amp;quot; t)&#xA;(quail-define-rules ; whatever extra rules you want to define...&#xA; (&amp;quot;\\from&amp;quot;    #X2190)&#xA; (&amp;quot;\\to&amp;quot;      #X2192)&#xA; (&amp;quot;\\lhd&amp;quot;     #X22B2)&#xA; (&amp;quot;\\rhd&amp;quot;     #X22B3)&#xA; (&amp;quot;\\unlhd&amp;quot;   #X22B4)&#xA; (&amp;quot;\\unrhd&amp;quot;   #X22B5))&#xA;(mapc (lambda (x)&#xA;        (if (cddr x)&#xA;            (quail-defrule (cadr x) (car (cddr x)))))&#xA;      (append math-symbol-list-basic math-symbol-list-extended))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To activate the input method, type &lt;code&gt;C-u C-\ math RET&lt;/code&gt;.  Then, typing \mscrC yields , \lParen yields ⦅, etc.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;ADDENDUM 2&lt;/strong&gt; There is now &lt;a href=&quot;https://melpa.org/#/unicode-math-input&quot; rel=&quot;nofollow noreferrer&quot;&gt;a package&lt;/a&gt; on Melpa that provides a very comprehensive TeX-like input method.&lt;/p&gt;&#xA;" OwnerUserId="2514" LastEditorUserId="2514" LastEditDate="2020-12-16T13:39:52.177" LastActivityDate="2020-12-16T13:39:52.177" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="3405" PostTypeId="2" ParentId="2922" CreationDate="2014-11-11T22:33:16.063" Score="5" Body="&lt;p&gt;See if &lt;code&gt;auto-dim-other-buffers-mode&lt;/code&gt; works for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Out of the box it dims frames when they lose focus as well as buffers when they lose &lt;code&gt;current-buffer&lt;/code&gt; status.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's available on MELPA.  Source here:&#xA;&lt;a href=&quot;https://github.com/mina86/auto-dim-other-buffers.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/mina86/auto-dim-other-buffers.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-11-11T22:33:16.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3406" PostTypeId="2" ParentId="2922" CreationDate="2014-11-11T22:37:57.950" Score="1" Body="&lt;p&gt;Different answer based on your edit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to change the mode line, check out what the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Standard-Faces.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual&lt;/a&gt; has to say about &lt;code&gt;mode-line-inactive&lt;/code&gt; face.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Like mode-line, but used for mode lines of the windows other than the selected one (if mode-line-in-non-selected-windows is non-nil). This face inherits from mode-line, so changes in that face affect mode lines in all windows. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could make &lt;code&gt;mode-line&lt;/code&gt; have a bright red background and &lt;code&gt;mode-line-inactive&lt;/code&gt; a bland grey background, for instance.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-11-11T22:37:57.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3407" PostTypeId="2" ParentId="3178" CreationDate="2014-11-11T22:42:40.603" Score="1" Body="&lt;p&gt;Works in Emacs 23.4, reproduced in Emacs 24.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14046&quot; rel=&quot;nofollow&quot;&gt;Bug #14046&lt;/a&gt;, with no resolution as I write.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's a duplicate of &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15822&quot; rel=&quot;nofollow&quot;&gt;Bug #15822&lt;/a&gt;, which is fixed by &lt;a href=&quot;http://bzr.savannah.gnu.org/lh/emacs/emacs-24/revision/115027&quot; rel=&quot;nofollow&quot;&gt;revision 115027 to &lt;code&gt;autoconf.el&lt;/code&gt;&lt;/a&gt; released in Emacs 24.4.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-11-11T22:42:40.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3408" PostTypeId="2" ParentId="2922" CreationDate="2014-11-11T22:43:31.750" Score="2" Body="&lt;p&gt;Sure.  See function &lt;code&gt;doremi-increment-color&lt;/code&gt; in library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/doremi-frm.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;doremi-frm.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, you want to use a negative &lt;code&gt;INCREMENT&lt;/code&gt; argument and specify &lt;code&gt;s&lt;/code&gt; (for saturation) as the &lt;code&gt;COMPONENT&lt;/code&gt; argument to increment (decrement, in this case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would call &lt;strong&gt;&lt;code&gt;doremi-increment-color&lt;/code&gt;&lt;/strong&gt; on any color of any UI feature you like (or on all of them), to calculate a less saturated version of the color.  See also function &lt;code&gt;hexrgb-increment-saturation&lt;/code&gt; in library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/hexrgb.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;hexrgb.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get an interactive idea of applying this across the board by using command &lt;code&gt;doremi-all-faces-bg+&lt;/code&gt; or &lt;code&gt;doremi-all-frames-bg+&lt;/code&gt; (or the same, with &lt;code&gt;fg+&lt;/code&gt; instead of &lt;code&gt;bg+&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More &lt;strong&gt;Do Re Mi&lt;/strong&gt; color-changing described &lt;a href=&quot;http://www.emacswiki.org/DoReMi#OneSolution&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;here&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;With respect to your request about dynamically desaturating and saturating the mode line: See, for example, function &lt;code&gt;1on1-color-minibuffer-frame-on-setup&lt;/code&gt; in library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/oneonone.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;oneonone.el&lt;/code&gt;&lt;/a&gt;, which does the same kind of thing for a standalone minibuffer frame. It uses function &lt;code&gt;hexrgb-increment-hue&lt;/code&gt;, but you would use &lt;strong&gt;&lt;code&gt;hexrgb-increment-saturation&lt;/code&gt;&lt;/strong&gt; instead (or &lt;code&gt;doremi-increment-color&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the meat of that function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-background-color (hexrgb-increment-hue ; Change bg hue slightly.&#xA;                       (frame-parameter nil 'background-color)&#xA;                       1on1-color-minibuffer-frame-on-setup-increment))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:49:39.787" LastActivityDate="2015-05-09T20:49:39.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3409" PostTypeId="2" ParentId="3388" CreationDate="2014-11-11T23:31:56.887" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;last-command&lt;/code&gt; contains the last command executed.  If the last command was &lt;code&gt;keyboard-quit&lt;/code&gt;, it will contain the symbol &lt;code&gt;keyboard-quit&lt;/code&gt;.  You can test this command in your function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar highlight-something-counter 0)&#xA;&#xA;(defun highlight-something ()&#xA;  (interactive)&#xA;  (if (eql last-command 'keyboard-quit)&#xA;    (setq highlight-something-counter 0))&#xA;  (message &quot;Highlight counter is now %d, last command was %s&quot;&#xA;           highlight-something-counter last-command)&#xA;  (incf highlight-something-counter))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note however that this will only work when the user pressed &lt;code&gt;C-g&lt;/code&gt; immediately before invoking your command, so you will probably want to reset the counter on any command other than yours:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar highlight-something-counter 0)&#xA;&#xA;(defun highlight-something ()&#xA;  (interactive)&#xA;  (unless (eql last-command 'highlight-something)&#xA;    (setq highlight-something-counter 0))&#xA;  (message &quot;Highlight counter is now %d, last command was %s&quot;&#xA;           highlight-something-counter last-command)&#xA;  (incf highlight-something-counter))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you really want only &lt;code&gt;C-g&lt;/code&gt; to reset your counter and allow intervening commands, then you will need to use a different solution — advising &lt;code&gt;keyboard-quit&lt;/code&gt;, as suggested by Malabarba, might be workable.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-11-11T23:31:56.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3410" PostTypeId="2" ParentId="2129" CreationDate="2014-11-12T00:11:09.467" Score="8" Body="&lt;p&gt;In short — dynamic binding is very slow.  Lexical binding is extremely fast at runtime.  The fundamental reason is that lexical binding can be resolved at compile time, while dynamic binding cannot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((x 42))&#xA;    (foo)&#xA;    (message &quot;%d&quot; x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When its compiling the &lt;code&gt;let&lt;/code&gt;, the compiler cannot know whether &lt;code&gt;foo&lt;/code&gt; will acess the (dynamically bound) variable &lt;code&gt;x&lt;/code&gt;, so it must create a binding for &lt;code&gt;x&lt;/code&gt;, and must retain the name of the variable.  With lexical binding, the compiler just dumps the &lt;em&gt;value&lt;/em&gt; of &lt;code&gt;x&lt;/code&gt; on the bindings stack, without its name, and accesses the right entry directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But wait — there's more.  With lexical binding, the compiler is able to verify that this particular binding of &lt;code&gt;x&lt;/code&gt; is only used in the code to &lt;code&gt;message&lt;/code&gt;; since &lt;code&gt;x&lt;/code&gt; is never modified, it is safe to inline &lt;code&gt;x&lt;/code&gt; and yield&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (foo)&#xA;  (message &quot;%d&quot; 42))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't think that the current bytecode compiler performs this optimisation, but I am confident that it will do so in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in short:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;dynamic binding is a heavy-weight operation that allows few oportunities for optimisation;&lt;/li&gt;&#xA;&lt;li&gt;lexical binding is a lightweight operation;&lt;/li&gt;&#xA;&lt;li&gt;lexical binding of a read-only value can often be optimised away.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-11-12T00:11:09.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3411" PostTypeId="1" AcceptedAnswerId="3428" CreationDate="2014-11-12T01:39:49.423" Score="18" ViewCount="12935" Body="&lt;p&gt;When I'm in the package manager (&lt;code&gt;M-x package-list-packages&lt;/code&gt;), I'd like to quickly navigate to my installed packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/e0O6i.png&quot; alt=&quot;emacs packages&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are literally thousands of packages marked as &lt;em&gt;available&lt;/em&gt;, &lt;em&gt;installed&lt;/em&gt;, or &lt;em&gt;built-in&lt;/em&gt;, but all of the navigation appears to be line-by-line.  Is this an oversight with the package manager or am I overlooking something obvious (aside from basic string search, of course)?&lt;/p&gt;&#xA;" OwnerUserId="2516" LastActivityDate="2022-04-08T15:58:33.227" Title="How to navigate quickly to my installed packages?" Tags="|package|navigation|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3412" PostTypeId="2" ParentId="3113" CreationDate="2014-11-12T02:29:08.663" Score="2" Body="&lt;p&gt;You should update Helm again, to at least version 20141105.654. It was fixed after the &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/690&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt; was reported.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="25" LastEditDate="2014-11-12T04:37:32.420" LastActivityDate="2014-11-12T04:37:32.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3413" PostTypeId="1" AcceptedAnswerId="3414" CreationDate="2014-11-12T04:09:40.357" Score="1" ViewCount="626" Body="&lt;p&gt;Generally in the LaTeX or &lt;code&gt;beamer&lt;/code&gt; preamble, we add some packages and options for reference and enable them if required. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%\usepackage{someusefulpackage}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Org mode export to LaTeX or &lt;code&gt;beamer&lt;/code&gt;, when I specify options in the file header, how to comment them out &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEAMER_COLOR_THEME: dove&#xA;#+LATEX_HEADER: \usepackage{usefulPkg}&#xA;#+LATEX_HEADER: \usepackage{notRequired}&#xA;#+OPTIONS: toc:nil &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I comment out some of them ? &lt;/p&gt;&#xA;" OwnerUserId="2517" LastEditorUserId="2264" LastEditDate="2014-11-12T04:13:41.713" LastActivityDate="2014-11-12T04:13:41.713" Title="How to comment options in org-mode export to beamer?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3414" PostTypeId="2" ParentId="3413" CreationDate="2014-11-12T04:12:21.043" Score="2" Body="&lt;p&gt;You should be able to simply add a &lt;code&gt;#&lt;/code&gt; in front.  You will have to restart Org though for this to take effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that 'restarting Org' is exactly what &lt;code&gt;C-c C-c&lt;/code&gt; on one of these lines would normally do.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEAMER_COLOR_THEME: dove&#xA;#+LATEX_HEADER: \usepackage{usefulPkg}&#xA;# #+LATEX_HEADER: \usepackage{notRequired}&#xA;#+OPTIONS: toc:nil &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-11-12T04:12:21.043" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3415" PostTypeId="2" ParentId="3397" CreationDate="2014-11-12T04:26:39.390" Score="27" Body="&lt;p&gt;The fastest way to actually change the cons cell is probably &lt;code&gt;setcdr&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;setcdr is a built-in function in `C source code'.&#xA;&#xA;(setcdr CELL NEWCDR)&#xA;&#xA;Set the cdr of CELL to be NEWCDR.  Returns NEWCDR.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's worth noting that &lt;code&gt;setf&lt;/code&gt; isn't available in older Emacsen, but &lt;code&gt;setcdr&lt;/code&gt; is.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Welcome to IELM ***  Type (describe-mode) for help.&#xA;ELISP&amp;gt; (setq tmp '((one . 1) (two . 2) (three . 4)))&#xA;((one . 1)&#xA; (two . 2)&#xA; (three . 4))&#xA;&#xA;ELISP&amp;gt; (setcdr (assq 'three tmp) 3)&#xA;3 (#o3, #x3, ?\C-c)&#xA;ELISP&amp;gt; tmp&#xA;((one . 1)&#xA; (two . 2)&#xA; (three . 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-07-05T17:20:19.333" LastActivityDate="2015-07-05T17:20:19.333" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3416" PostTypeId="2" ParentId="3143" CreationDate="2014-11-12T04:30:29.327" Score="27" Body="&lt;p&gt;If all you want is selective showing of sections and navigation between headings, you don't need Org mode. All you need is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html#Outline-Mode&quot;&gt;Outline mode&lt;/a&gt;. Outline mode is basically the header level and section visibility management of Org mode. In fact, Org mode was originally the author's extensions to Outline mode, and grew, and grew, and grew… Even today, &lt;code&gt;org-mode&lt;/code&gt; is derived from &lt;code&gt;outline-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Outline mode exists both as a major mode and as a minor mode. The minor mode can be used in any major mode. You can configure it to use a header format that's compatible with your program syntax, and many major modes do so, by setting the &lt;code&gt;outline-regexp&lt;/code&gt; variable to a regexp that matches the start of a header. For example, this is the default value in Emacs Lisp mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;;;;\\(;* [^ \t\n]\\|###autoload\\)\\|(&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. section headers start with three or more semicolons and a single space, or an opening parenthesis in the left margin. The variable &lt;code&gt;outline-level&lt;/code&gt; contains the name of a function to determine the depth of a header; the default value is the length of the string matched by &lt;code&gt;outline-regexp&lt;/code&gt;, and Emacs Lisp mode overrides it to assign a larger depth to &lt;code&gt;(&lt;/code&gt; and &lt;code&gt;;;;###autoload&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't like the default header format, set the variable &lt;code&gt;outline-regexp&lt;/code&gt; in a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot;&gt;file local variable declaration&lt;/a&gt;. This is what I use — my section headers all consists of &lt;code&gt;;;;&lt;/code&gt; followed by the classic sequence of stars:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Local Variables:&#xA;;;; outline-regexp: &quot;;;;\\*+\\|\\`&quot;&#xA;;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want Outline minor mode to be automatically turned on when you load the file, add the following line in the Local Variables section — note that this will warn you about unsafe code in Emacs ≤23.x.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; eval: (outline-minor-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The commands for outline minor mode use the rather inconvenient &lt;code&gt;C-c @&lt;/code&gt; prefix by default. I move it to &lt;code&gt;M-o&lt;/code&gt; (I never use the facemenu bindings), you may prefer another key, or to replicate Org mode's bindings (which have diverged quite a bit from Outline mode).&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-11-12T04:30:29.327" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3418" PostTypeId="1" AcceptedAnswerId="3438" CreationDate="2014-11-12T04:46:07.367" Score="9" ViewCount="490" Body="&lt;p&gt;I sometimes run multiple versions of Emacs from the same home directory. I have a number of byte-compiled files. Bytecode is not compatible across all Emacs versions, so I maintain separate directories for &lt;code&gt;.elc&lt;/code&gt; files for each version range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the version ranges for which the bytecode is compatible? I currently have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnu-19.29&#xA;gnu-20&#xA;gnu-21&#xA;gnu-22&#xA;gnu-23&#xA;gnu-24&#xA;source&#xA;x-19&#xA;x-20&#xA;x-21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. directories for each major release, with an additional separation at 19.29 (I've never used an older version on this machine, otherwise there'd be &lt;code&gt;gnu-19&lt;/code&gt;), and separate directories for GNU Emacs and XEmacs. I'm probably overly cautious, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the official policy regarding bytecode compatibility across Emacs versions? Can I confidently keep using the major version? Can I merge some versions? Is there a bytecode version indication or checksum that I could query when compiling to create the directory name instead of relying on the Emacs version?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I'm primarily interested in full compatibility, not just backward compatibility. I might run Emacs 27.3 and byte-compile some files, and then later Emacs 27.2 with the same home directory.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-11-12T13:44:34.560" Title="Portability of bytecode between Emacs versions" Tags="|bytecode|upgrade|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3419" PostTypeId="1" AcceptedAnswerId="3425" CreationDate="2014-11-12T04:47:13.353" Score="7" ViewCount="2777" Body="&lt;p&gt;I have been trying to include citations in the org file which I then export to beamer and using biblatex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that slide of bibliography needs specifying environment like &lt;code&gt;fragile&lt;/code&gt; or &lt;code&gt;allowpagebreaks&lt;/code&gt;. So far that seems to be the reason why bibliography is not getting printed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the header &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage{biblaltex}&#xA;#+LATEX_HEADER: \bibliography{file.bib}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Citation gets written as [[bib::author03]]. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* References &#xA;&#xA;#+BEGIN_LaTeX&#xA;&#xA;  \printbibliography&#xA;&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could you help get the citations working properly in the org-mode ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.   &lt;/p&gt;&#xA;" OwnerUserId="2517" LastEditorUserId="2517" LastEditDate="2014-11-12T05:16:46.203" LastActivityDate="2015-03-02T12:10:30.173" Title="In org mode, how to export slide with bibliography?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3420" PostTypeId="1" CreationDate="2014-11-12T05:06:38.863" Score="3" ViewCount="201" Body="&lt;p&gt;I've been using literate programming using org-mode for my initialization file. I've a &lt;code&gt;init.el&lt;/code&gt; which loads a org file converts it to .el and uses it as startup file. &lt;a href=&quot;https://github.com/copyninja/dotfiles/tree/master/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is my configuration files. When starting with &lt;code&gt;--daemon&lt;/code&gt; option emacs crashes if &lt;code&gt;~/.emacs.d\copyninja-emacs.el&lt;/code&gt; file exists, if I remove it and start it launches fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the crash log&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;/home/vasudev/.emacs.d/copyninja-emacs.org&quot;)&#xA;Loading /home/vasudev/.emacs.d/copyninja-emacs.el (source)...&#xA;&#xA;Backtrace:&#xA;emacs[0x8143ee3]&#xA;emacs[0x812a323]&#xA;emacs[0x81422ae]&#xA;[0xb7774400]&#xA;emacs[0x808ec89]&#xA;emacs[0x80b0a24]&#xA;emacs[0x819dde7]&#xA;emacs[0x81d1987]&#xA;emacs[0x819d89e]&#xA;emacs[0x819db63]&#xA;emacs[0x819e037]&#xA;emacs[0x81a413c]&#xA;emacs[0x81a6aeb]&#xA;emacs[0x819dde7]&#xA;emacs[0x81d1987]&#xA;emacs[0x819d89e]&#xA;emacs[0x819db63]&#xA;emacs[0x81d1987]&#xA;emacs[0x819d89e]&#xA;emacs[0x819db63]&#xA;emacs[0x81d1987]&#xA;emacs[0x819d89e]&#xA;emacs[0x819db63]&#xA;emacs[0x81d1987]&#xA;emacs[0x819d89e]&#xA;emacs[0x819db63]&#xA;emacs[0x81d1987]&#xA;emacs[0x819d89e]&#xA;emacs[0x819ccdb]&#xA;emacs[0x819cff4]&#xA;emacs[0x81bc645]&#xA;emacs[0x81c0349]&#xA;emacs[0x81c0a4d]&#xA;emacs[0x819dd8d]&#xA;emacs[0x81d1987]&#xA;emacs[0x819d81d]&#xA;emacs[0x819db63]&#xA;emacs[0x819df7f]&#xA;emacs[0x81c13ff]&#xA;emacs[0x819dd8d]&#xA;emacs[0x81d1987]&#xA;...&#xA;Error: server did not start correctly&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm unable to figure out what is the reason this crash is happening. If some one can point me what might be wrong in my setup it would be great. I use emacs-snapshot package and this used to work fine before and started a couple of month back. I tried emacs from the git and it happens there to.&lt;/p&gt;&#xA;" OwnerUserId="2518" LastActivityDate="2014-11-12T05:06:38.863" Title="Launching in daemon mode crashes emacs while loading configuration from .org file" Tags="|org-babel|emacs24.4|daemon|crash|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3421" PostTypeId="1" AcceptedAnswerId="3430" CreationDate="2014-11-12T05:52:32.203" Score="48" ViewCount="8759" Body="&lt;p&gt;Sometimes I find myself frequently alternating between two functions that I am editing in conjunction with each other. In these situations, it is tedious and painful to keep on doing a &lt;code&gt;C-s &amp;lt;functionname&amp;gt;&lt;/code&gt; to switch to the other function and then to find the exact place I was editing previously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I set markers and then jump back and forth between two locations in the buffer with ease?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2519" LastEditorUserId="262" LastEditDate="2016-08-23T17:17:13.373" LastActivityDate="2020-02-20T16:01:19.450" Title="How to switch back and forth between two locations in a buffer" Tags="|navigation|cycling|mark-ring|registers|" AnswerCount="12" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3422" PostTypeId="2" ParentId="3421" CreationDate="2014-11-12T06:10:20.297" Score="72" Body="&lt;p&gt;&lt;strong&gt;Registers:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt; runs &lt;code&gt;point-to-register&lt;/code&gt;&lt;br&gt;&#xA;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;j&lt;/kbd&gt; runs &lt;code&gt;jump-to-register&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type any character to specify a register when prompted.&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bookmarks:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt; runs &lt;code&gt;bookmark-set&lt;/code&gt;&lt;br&gt;&#xA;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;b&lt;/kbd&gt; runs &lt;code&gt;bookmark-jump&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mark ring:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-SPC&lt;/kbd&gt;&lt;kbd&gt;C-SPC&lt;/kbd&gt; pushes the current position to the mark ring (without leaving it active).&lt;br&gt;&#xA;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-SPC&lt;/kbd&gt; pops the mark ring, jumping to the previous position. You can use this repeatedly to navigate through the entire ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that some commands (especially ones which are liable to move you an an unknown or arbitrary distance from your original location) will automatically push to the mark ring so that you can use &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-SPC&lt;/kbd&gt; to return afterwards. This includes &lt;code&gt;isearch&lt;/code&gt;, so after using &lt;kbd&gt;C-s&lt;/kbd&gt; to go somewhere, you can easily jump back again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Exchange point and mark:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And as Tu Do comments, &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt; runs &lt;code&gt;exchange-point-and-mark&lt;/code&gt; which is very useful for jumping between two locations. It also activates the mark/region, but you can use &lt;kbd&gt;C-SPC&lt;/kbd&gt; to clear the highlighting.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; If you're taking advantage of register functionality in elisp, use some non-conflicting symbol for the name, rather than a char, so that you can't conflict with interactively-set registers (unless, of course, you &lt;em&gt;want&lt;/em&gt; to do that).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-12T09:56:32.793" LastActivityDate="2014-11-12T09:56:32.793" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3423" PostTypeId="2" ParentId="3421" CreationDate="2014-11-12T06:20:16.560" Score="21" Body="&lt;p&gt;In addition to phils's answer, there are some more options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-17&quot; rel=&quot;noreferrer&quot;&gt;helm-all-mark-rings&lt;/a&gt;: It allows you to view the content of the both the local and global mark rings in a friendly interface, so you can always jump back to where you were. You can push mark with &lt;kbd&gt;C-SPC C-SPC&lt;/kbd&gt;. Demo: &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dL35P.gif&quot; alt=&quot;helm-all-mark-rings&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-9&quot; rel=&quot;noreferrer&quot;&gt;helm-semantic-or-imenu&lt;/a&gt;: List all available definitions in the current file. If cursor is inside a definition, when activating the highlighter preselects that definition.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://tuhdo.github.io/static/c-ide/sr-speedbar.gif&quot; rel=&quot;noreferrer&quot;&gt;sr-speedbar&lt;/a&gt;: A file browser that lists its definitions in each file. It is similar to outline tree in IDE.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-11-12T06:20:16.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3424" PostTypeId="2" ParentId="3421" CreationDate="2014-11-12T06:41:21.103" Score="9" Body="&lt;p&gt;Besides registers and markers (see @phils's answer about both and my other, &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; answer about markers), &lt;strong&gt;&lt;em&gt;bookmarks&lt;/em&gt;&lt;/strong&gt;, particularly either autonamed or temporary bookmarks, can be helpful for this. You need library &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; for these special bookmark types.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;An &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#AutonamedBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;autonamed&lt;/strong&gt; bookmark&lt;/a&gt; is one that you do not need to name. It is quick to create and delete: just hit a key. The same key creates or deletes a bookmark at point. (By default, this is bound to &lt;code&gt;C-x p RET&lt;/code&gt;, but you can of course use any key.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Autonamed bookmarks are, like bookmarks in general, persistent. But you can optionally have them be deleted automatically.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also create &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#TemporaryBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;temporary&lt;/strong&gt; bookmarks&lt;/a&gt; or make any existing bookmarks temporary. You can, for example, choose to make autonamed bookmarks be temporary automatically.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can quickly &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#CyclingDynamicSetsOfBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;cycle&lt;/a&gt; among a given set of bookmarks. For example, to cycle among autonamed bookmarks, use commands &lt;code&gt;bmkp-next-autonamed-bookmark-repeat&lt;/code&gt; and &lt;code&gt;bmkp-previous-autonamed-bookmark-repeat&lt;/code&gt; (binding them to keys).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#HighlightingBookmarkLocations&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight bookmarked locations&lt;/a&gt; in different ways, so it is easy to spot them.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2020-02-20T16:01:19.450" LastActivityDate="2020-02-20T16:01:19.450" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3425" PostTypeId="2" ParentId="3419" CreationDate="2014-11-12T06:46:28.917" Score="8" Body="&lt;p&gt;Additional frame options can be specified using the &lt;code&gt;BEAMER_OPT&lt;/code&gt; property. (You can set it using &lt;code&gt;org-set-property&lt;/code&gt;, which is bound to &lt;code&gt;C-c C-x p&lt;/code&gt; by default.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get Org to produce a &lt;code&gt;beamer&lt;/code&gt; presentation PDF with references I also had to customize the value of &lt;code&gt;org-latex-pdf-process&lt;/code&gt;, making sure that Org runs &lt;code&gt;bibtex&lt;/code&gt; when exporting to LaTeX. (Note the manually specified &lt;code&gt;biblatex&lt;/code&gt; backend, too.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a minimal example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main &lt;code&gt;beamer-test.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+startup: beamer&#xA;#+LaTeX_CLASS: beamer&#xA;#+LATEX_HEADER: \usepackage[backend=bibtex]{biblatex}&#xA;#+LATEX_HEADER: \bibliography{file.bib}&#xA;&#xA;* Frame with content&#xA;  See \cite{AbramowitzStegun}.&#xA;&#xA;* Frame with references&#xA;  :PROPERTIES:&#xA;  :BEAMER_OPT: fragile,allowframebreaks,label=&#xA;  :END:      &#xA;  \printbibliography&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my tests the &lt;code&gt;file.bib&lt;/code&gt; bibliography database contained:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@book {AbramowitzStegun,&#xA;    EDITOR = {M. Abramowitz and I. A. Stegun},&#xA;     TITLE = {Handbook of {M}athematical {F}unctions, with {F}ormulas, {G}raphs,&#xA;              and {M}athematical {T}ables},&#xA;    SERIES = {Graduate Studies in Mathematics},&#xA; PUBLISHER = {Dover},&#xA;   ADDRESS = {New York},&#xA;      YEAR = {1965},&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I discovered &lt;code&gt;BEAMER_OPT&lt;/code&gt; by reading the code of &lt;code&gt;org-beamer--format-frame&lt;/code&gt; defined in &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/ox-beamer.el?id=release_8.2.10#n391&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ox-beamer.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tested using &lt;code&gt;GNU Emacs 24.4.1&lt;/code&gt; with &lt;code&gt;Org-mode version 8.2.10&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2457" LastEditDate="2015-03-02T12:10:30.173" LastActivityDate="2015-03-02T12:10:30.173" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3426" PostTypeId="2" ParentId="3421" CreationDate="2014-11-12T06:59:16.287" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can quickly navigate among the markers in the &lt;code&gt;mark-ring&lt;/code&gt; of each buffer or the &lt;code&gt;global-mark-ring&lt;/code&gt; (which has a single marker in each buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You do this using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow&quot;&gt;multi-command&lt;/a&gt; &lt;code&gt;C-- C-SPC&lt;/code&gt; (for a buffer's &lt;code&gt;mark-ring&lt;/code&gt;) or &lt;code&gt;C-- C-x C-SPC&lt;/code&gt; (for the &lt;code&gt;global-mark-ring&lt;/code&gt;).  After hitting the key once, you use the usual &lt;strong&gt;Icicles&lt;/strong&gt; cycling keys etc., to move among the markers of the ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The same keys without a prefix arg set the mark (&lt;code&gt;set-mark-command&lt;/code&gt;) and pop the global mark (&lt;code&gt;pop-global-mark&lt;/code&gt;), respectively, just as they do in vanilla Emacs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The text of the line of each marker is used as a completion candidate. As you type, your minibuffer input narrows the candidates to those that match (e.g., substring or regexp matching). You can quickly cycle among matching markers or visit any of them directly. You can even change the sort order (&lt;code&gt;C-,&lt;/code&gt;) for cycling.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-12T06:59:16.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3427" PostTypeId="1" AcceptedAnswerId="7426" CreationDate="2014-11-12T07:18:12.480" Score="5" ViewCount="1296" Body="&lt;p&gt;Is there a way, via &lt;code&gt;cider&lt;/code&gt; or some other emacs extension, to run all of the tests in a leiningen project? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cider&lt;/code&gt; has the function &lt;code&gt;cider-test-run-tests&lt;/code&gt; which attempts to just run the tests &#xA;related to the code in the current buffer. That's fine, but often I want to run &lt;em&gt;all&lt;/em&gt; of the tests in a project. (In fact, I'd like to run this all the time while editing.) I can't seem to find a simple way to say &quot;find all of the tests in this project and run them.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to do this?&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="216" LastEditDate="2014-11-12T09:01:14.103" LastActivityDate="2016-03-28T20:07:08.583" Title="Running all tests in a leiningen project?" Tags="|clojure|cider|testing|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3428" PostTypeId="2" ParentId="3411" CreationDate="2014-11-12T08:25:18.943" Score="11" Body="&lt;p&gt;I tend to end up using &lt;em&gt;occur&lt;/em&gt; (or more specifically &lt;em&gt;helm-swoop&lt;/em&gt;) to narrow down my choices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However you can also use &lt;a href=&quot;https://github.com/Malabarba/paradox&quot; rel=&quot;nofollow noreferrer&quot;&gt;paradox&lt;/a&gt;, which extends the functionality of the basic package manager. This include &lt;kbd&gt;S x&lt;/kbd&gt; sorting options as well as single key next and status. It also has its own filter options: notably, &lt;kbd&gt;f u&lt;/kbd&gt; will narrow down to all packages affected by an upgrade.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="5444" LastEditDate="2018-06-13T09:10:56.010" LastActivityDate="2018-06-13T09:10:56.010" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3429" PostTypeId="1" AcceptedAnswerId="3505" CreationDate="2014-11-12T08:32:36.393" Score="4" ViewCount="606" Body="&lt;p&gt;In &lt;a href=&quot;http://jblevins.org/projects/deft/&quot; rel=&quot;nofollow&quot;&gt;deft mode&lt;/a&gt; I can change the default text extension using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq deft-extension &quot;txt&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to support multiple file types? (e.g. I have a mix of .txt .md and .org files in my directory)&lt;/p&gt;&#xA;" OwnerUserId="2521" LastEditorUserId="2521" LastEditDate="2014-11-12T14:08:22.957" LastActivityDate="2015-09-18T20:31:55.287" Title="How to support multiple extensions in Deft?" Tags="|files|deft-mode|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3430" PostTypeId="2" ParentId="3421" CreationDate="2014-11-12T08:37:40.047" Score="25" Body="&lt;p&gt;&lt;strong&gt;Emacs windows&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x 2&lt;/code&gt; will open another window (=split the frame) below the current one, attached to the same buffer. You can move point in either window without affecting the other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can move from one window to the other using &lt;code&gt;C-x o&lt;/code&gt;. The built-in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Convenience.html#Window-Convenience&quot; rel=&quot;noreferrer&quot;&gt;windmove&lt;/a&gt; library provides some function that makes navigating between windows easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this method suits you, you may also want to have a look at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html&quot; rel=&quot;noreferrer&quot;&gt;indirect buffers&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zciJl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-07-28T17:55:56.947" LastActivityDate="2015-07-28T17:55:56.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3431" PostTypeId="2" ParentId="3421" CreationDate="2014-11-12T10:48:33.187" Score="4" Body="&lt;p&gt;if you use &lt;code&gt;evil-mode&lt;/code&gt;, the vim layer, then &lt;code&gt;C-o&lt;/code&gt; and &lt;code&gt;C-i&lt;/code&gt; will work the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They run the commands &lt;code&gt;evil-jump-backward&lt;/code&gt; / &lt;code&gt;forward&lt;/code&gt;. &lt;code&gt;C-o&lt;/code&gt; jumps to the older position in the jump list, which is set automatically (marks are set on motion commands). &lt;code&gt;C-i&lt;/code&gt; goes in reverse. We can also use &lt;code&gt;TAB&lt;/code&gt; after a &lt;code&gt;C-o&lt;/code&gt; instead of &lt;code&gt;C-i&lt;/code&gt;. So using both functions will take you back and forth in your current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want this feature to be cross-buffers, check out &lt;code&gt;evil-jumpers&lt;/code&gt;: &lt;a href=&quot;http://melpa.org/#/evil-jumper&quot; rel=&quot;nofollow&quot;&gt;http://melpa.org/#/evil-jumper&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;«&lt;br&gt;&#xA;evil-jumper is an add-on for evil-mode which replaces the implementation of  the jump list such that it mimics more closely with Vim's behavior. Specifically, it will jump across buffer boundaries and revive dead buffers if necessary. The jump list can also be persisted to a file and restored between sessions.&#xA;»&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I learnt it &lt;a href=&quot;http://wikemacs.org/wiki/Evil&quot; rel=&quot;nofollow&quot;&gt;on this wiki&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="739" LastEditDate="2014-11-12T14:05:07.317" LastActivityDate="2014-11-12T14:05:07.317" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3432" PostTypeId="1" AcceptedAnswerId="9737" CreationDate="2014-11-12T11:48:03.037" Score="6" ViewCount="1974" Body="&lt;p&gt;My default shell is &lt;code&gt;eshell&lt;/code&gt;.  I just discovered &lt;code&gt;iimage-mode&lt;/code&gt; that allows me to display images in buffers that contain some reference to an image file.  Unfortunately, I doesn't seem to have any effect when it is enabled in eshell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any other buffer something like &lt;code&gt;file:///home/rekado/Pictures/test.png&lt;/code&gt; is replaced with an inlined image loaded from the file &lt;code&gt;test.png&lt;/code&gt;.  In an eshell buffer, however, I cannot seem to make this work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;echo&lt;/code&gt;ing the string &lt;code&gt;file:///home/rekado/Pictures/test.png&lt;/code&gt;, but this just results in a boring string and no pretty test image.  I also made sure to use &lt;code&gt;/bin/echo&lt;/code&gt; instead of the elisp/eshell implementation of echo, but with no success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I disable and reenable &lt;code&gt;iimage-mode&lt;/code&gt; it works all right (the file name is replaced with an inline image), but that's a rather inconvenient workaround.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there's no way to make &lt;code&gt;eshell&lt;/code&gt; work with &lt;code&gt;iimage-mode&lt;/code&gt; maybe there is another method to display images right in the eshell buffer?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2019-07-27T20:21:52.673" Title="Display images in eshell with `iimage-mode`" Tags="|eshell|image-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3433" PostTypeId="2" ParentId="3432" CreationDate="2014-11-12T12:25:42.143" Score="6" Body="&lt;p&gt;Based on what happens behind the scenes when you call &lt;code&gt;iimage-mode&lt;/code&gt;, you can define a function that takes care of displaying images for you, and have Emacs run this function every time you issue an &lt;code&gt;echo&lt;/code&gt; command in Eshell:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun iimage-mode-refresh (command args)&#xA;  (when (string= command &quot;echo&quot;)&#xA;    (let ((image-path (cons default-directory iimage-mode-image-search-path))&#xA;          file)&#xA;      (with-silent-modifications&#xA;        (save-excursion&#xA;          (eshell-previous-prompt 0) ; Start scanning from most recent prompt&#xA;                                     ; to avoid having to re-display all images.&#xA;          (dolist (pair iimage-mode-image-regex-alist)&#xA;            (while (re-search-forward (car pair) nil t)&#xA;              (when (and (setq file (match-string (cdr pair)))&#xA;                         (setq file (locate-file file image-path)))&#xA;                (add-text-properties (match-beginning 0) (match-end 0)&#xA;                                     `(display ,(create-image file)&#xA;                                               modification-hooks&#xA;                                               (iimage-modification-hook)))))))))))&#xA;&#xA;(add-hook 'eshell-named-command-hook 'iimage-mode-refresh)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main difference between this function and the function that gets run when you enable &lt;code&gt;iimage-mode&lt;/code&gt; (&lt;code&gt;iimage-mode-buffer&lt;/code&gt;) is that it does not check the whole buffer for image references. Instead, it starts scanning from the most recent prompt, which means that calling the function does not become more expensive as the &lt;code&gt;*eshell*&lt;/code&gt; buffer grows in size. Each invocation of the function will cause only a single additional image (i.e., the most recent image you requested) to be displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that existing images stay visible, i.e., they are not &quot;reset&quot; to strings representing file paths.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-19T15:00:10.370" LastActivityDate="2015-01-19T15:00:10.370" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3434" PostTypeId="2" ParentId="3421" CreationDate="2014-11-12T12:50:38.430" Score="1" Body="&lt;p&gt;&lt;code&gt;evil-mode&lt;/code&gt; implements &lt;a href=&quot;http://vim.wikia.com/wiki/Using_marks&quot; rel=&quot;nofollow&quot;&gt;Vim-style markers&lt;/a&gt;.  You can set markers with (&lt;code&gt;m&lt;/code&gt;, that is, &lt;code&gt;evil-set-marker&lt;/code&gt;) and jump to the mark with the backtick ` (&lt;code&gt;evil-goto-mark&lt;/code&gt;) or to the mark's line &lt;code&gt;'&lt;/code&gt; (&lt;code&gt;evil-goto-mark-line&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, you could create mark &quot;a&quot; at the first location with &lt;code&gt;ma&lt;/code&gt;, create mark &quot;b&quot; at the second location with &lt;code&gt;ma&lt;/code&gt;, and then &lt;code&gt;'a&lt;/code&gt; to jump to mark &quot;a&quot; and &lt;code&gt;'b&lt;/code&gt; to jump to mark &quot;b&quot;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-12T13:52:04.197" LastActivityDate="2014-11-12T13:52:04.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3435" PostTypeId="2" ParentId="3418" CreationDate="2014-11-12T13:31:48.040" Score="5" Body="&lt;p&gt;You should not expect bytecode files to be compatible between different Emacs versions.  The actual bytecode format is mostly upwards compatible, but you will run into trouble with expanded macros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me explain.  When the byte-compiler encounters a macro, it computes the macro's expansion and compiles the result.  If the macro expanded to a call to a function, then the resulting bytecode file will contain a reference to the function.  If an internal function that appears in the expansion of a macro changes between Emacs versions, then the bytecode will not be compatible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, the Emacs developers try to avoid macros that expand to internal functions that might change.  However, this is sometimes difficult to achieve, and I would not count on that, especially in the presence of large changes such as the introduction of &lt;code&gt;gv.el&lt;/code&gt; in Emacs 24.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-11-12T13:31:48.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3436" PostTypeId="5" CreationDate="2014-11-12T13:33:11.997" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://gitorious.org/evil/pages/Home&quot; rel=&quot;nofollow&quot;&gt;Evil Mode&lt;/a&gt; is a &lt;a href=&quot;http://www.vim.org/&quot; rel=&quot;nofollow&quot;&gt;Vim&lt;/a&gt; emulation layer for Emacs.  It is the successor to &lt;a href=&quot;http://www.emacswiki.org/emacs/VimMode&quot; rel=&quot;nofollow&quot;&gt;Vim Mode&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/Vimpulse&quot; rel=&quot;nofollow&quot;&gt;Vimpulse&lt;/a&gt;, which extended &lt;a href=&quot;http://www.emacswiki.org/emacs/ViperMode&quot; rel=&quot;nofollow&quot;&gt;Viper's&lt;/a&gt; vi compatibility layer to include a range of Vim functionality.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-12T16:40:28.217" LastActivityDate="2014-11-12T16:40:28.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3437" PostTypeId="4" CreationDate="2014-11-12T13:33:11.997" Score="0" Body="Evil Mode is a Vim emulation layer for Emacs." OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-12T14:24:24.190" LastActivityDate="2014-11-12T14:24:24.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3438" PostTypeId="2" ParentId="3418" CreationDate="2014-11-12T13:44:34.560" Score="10" Body="&lt;p&gt;As maintainer, I strive to preserve the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Backward compatibility of byte-code.  I.e. you should be able to take your .elc file compiled with Emacs-19 and run it in Emacs-27 successfully.  Of course, in practice it doesn't always work, because backward incompatibilities are introduced either by accident or consciously (tho these are usually not specific to bytecompiled files).&lt;/li&gt;&#xA;&lt;li&gt;Full byte-code compatibility within a major version.  This is followed with less care, mostly because it tends to happen automatically, but normally you should be able to byte-compile on 27.N and run it successfully on 27.1.  This said, it's always recommended to byte-compile on the older version.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Of course, the above is specifically about the byte compiled code, and still depends on actual general compatibility: if &lt;code&gt;foo.el&lt;/code&gt; runs in Emacs-19 and Emacs-27, then a &lt;code&gt;foo.elc&lt;/code&gt; compiled on Emacs-19 should work on Emacs-27.  But if that &lt;code&gt;foo.el&lt;/code&gt; doesn't work on Emacs-19 or on Emacs-27, then the &lt;code&gt;foo.elc&lt;/code&gt; compiled on Emacs-19 probably won't work on Emacs-27.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there are a few cases where we consciously break backward compatibility of byte-compiled code.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-12T13:44:34.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3439" PostTypeId="1" CreationDate="2014-11-12T14:28:15.287" Score="2" ViewCount="1328" Body="&lt;p&gt;Is there a way to stop Yasnippet from autoloading? I installed it from melpa (v.20141102.1554), and have &lt;strong&gt;no&lt;/strong&gt; reference to it in my init files. However, keeps up autoloading whenever I run emacs. I only wish it to initialize on my express command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried this &lt;code&gt;use-package&lt;/code&gt; command with no avail:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package yasnippet&#xA;  :defer t&#xA;  :commands (yas-load-directory)&#xA;  :config&#xA;  (progn&#xA;    (yas-load-directory &quot;/home/nivaca/emacs_x/snippets/&quot;)&#xA;    (setq yas-indent-line nil)&#xA;  )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;UPDATE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed it with this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package yasnippet&#xA;  :if (not noninteractive)&#xA;  :diminish yas-minor-mode&#xA;  :commands (yas-global-mode yas-minor-mode)&#xA;  :config&#xA;  (progn&#xA;    (setq yas-indent-line nil)&#xA;    (setq yas-snippet-dirs&#xA;      '(&quot;~/Dropbox/emacs_x/snippets&quot;&#xA;        ))&#xA;  )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I am not sure what's going on...&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2014-11-12T15:15:33.107" LastActivityDate="2014-11-12T15:15:33.107" Title="Stop Yasnippet from autoloading" Tags="|yasnippet|use-package|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3440" PostTypeId="1" CreationDate="2014-11-12T14:29:44.337" Score="4" ViewCount="442" Body="&lt;p&gt;I'd like to extends this function to work as usual in most cases but if current line starts with &lt;code&gt;*&lt;/code&gt; then it should indent and then insert &lt;code&gt;*&lt;/code&gt;. Particularly i want to use it in multi line comments, i.e:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA;  * multiline comment&#xA;  */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when i press &lt;code&gt;Ret&lt;/code&gt;, while writing a comment, it would add &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2361" LastActivityDate="2014-11-12T15:27:10.260" Title="Customize newline-and-indent function" Tags="|indentation|newlines|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3441" PostTypeId="1" AcceptedAnswerId="3446" CreationDate="2014-11-12T14:40:09.677" Score="21" ViewCount="1647" Body="&lt;p&gt;Especially when copying text from things like Google docs, I would like Emacs to automatically remove smart double quotes, smart single quotes, and all manner of em-dash and en-dash characters, replacing them with their ascii equivalents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to configure Emacs to do this automatically? Or, baring that, a function I can call that will do it on the buffer or region?&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2015-05-09T20:49:18.527" Title="Removing smart quotes automatically" Tags="|text-editing|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3443" PostTypeId="1" CreationDate="2014-11-12T15:12:19.720" Score="1" ViewCount="225" Body="&lt;pre&gt;&lt;code&gt;tcsh$ cd ~&#xA;^[]0;sallred@calamity:/home/sallred^G&#xA;tcsh$ cd bin&#xA;^[]0;sallred@calamity:/home/sallred/bin^G&#xA;tcsh$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is this cruft that is appearing before my prompt (or perhaps more appropriately, &lt;em&gt;after&lt;/em&gt; my command) and how can I remove it?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-09T18:45:58.067" Title="Where is this cruft coming from in shell-mode and term-mode?" Tags="|shell|term|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3444" PostTypeId="2" ParentId="49" CreationDate="2014-11-12T15:26:09.113" Score="23" Body="&lt;p&gt;You can give a try to &lt;a href=&quot;https://github.com/vedang/pdf-tools&quot; rel=&quot;nofollow noreferrer&quot;&gt;pdf-tools&lt;/a&gt;, which provides &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/2ixp7m/pdf_tools/&quot; rel=&quot;nofollow noreferrer&quot;&gt;most&lt;/a&gt; of the requested functionality&lt;/p&gt;&#xA;" OwnerUserId="546" LastEditorUserId="18414" LastEditDate="2022-10-25T12:26:33.637" LastActivityDate="2022-10-25T12:26:33.637" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="3445" PostTypeId="2" ParentId="3440" CreationDate="2014-11-12T15:27:10.260" Score="3" Body="&lt;p&gt;I think the command you want to use is &lt;code&gt;comment-indent-new-line&lt;/code&gt; which is normally bound to &lt;code&gt;M-j&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-12T15:27:10.260" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3446" PostTypeId="2" ParentId="3441" CreationDate="2014-11-12T15:29:01.903" Score="18" Body="&lt;p&gt;Based on &lt;a href=&quot;https://superuser.com/questions/603421/how-to-remove-smart-quotes-in-copy-paste&quot;&gt;SU : How to remove smart quotes in copy Paste&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom smart-to-ascii '((&quot;\x201C&quot; . &quot;\&quot;&quot;)&#xA;                (&quot;\x201D&quot; . &quot;\&quot;&quot;)&#xA;                (&quot;\x2018&quot; . &quot;'&quot;)&#xA;                            (&quot;\x2019&quot; . &quot;'&quot;)&#xA;                            ;; en-dash&#xA;                            (&quot;\x2013&quot; . &quot;-&quot;)&#xA;                            ;; em-dash&#xA;                            (&quot;\x2014&quot; . &quot;-&quot;))&#xA;  &quot;&quot;&#xA;  :type '(repeat (cons (string :tag &quot;Smart Character  &quot;)&#xA;                       (string :tag &quot;Ascii Replacement&quot;))))&#xA;&#xA;(defun replace-smart-to-ascii (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (format-replace-strings smart-to-ascii&#xA;                          nil beg end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using it as a defcustom to allow for adding/adjusting characters to match what is desired.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="-1" LastEditDate="2017-03-20T10:04:44.717" LastActivityDate="2014-11-12T15:29:01.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3447" PostTypeId="1" AcceptedAnswerId="3583" CreationDate="2014-11-12T17:21:15.917" Score="16" ViewCount="36712" Body="&lt;p&gt;I have the following two lines of code in my init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shell-file-name &quot;bash&quot;)&#xA;(setq shell-command-switch &quot;-ic&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried executing the following script to get a list of executables using the shell script dmenu_path.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dmenu-path-out ()&#xA;  (shell-command-to-string &quot;dmenu_path&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash: cannot set terminal process group (-1): Inappropriate ioctl for device&#xA;bash: no job control in this shell&#xA;[&#xA;0ad&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I prevent bash from returning that error when using &lt;code&gt;shell-command&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="50" LastEditDate="2014-11-12T17:57:25.780" LastActivityDate="2019-05-30T04:52:24.667" Title="&quot;cannot set terminal process group&quot; error when running bash script" Tags="|shell-command|bash|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3448" PostTypeId="2" ParentId="3441" CreationDate="2014-11-12T17:26:05.250" Score="8" Body="&lt;p&gt;To add to what @Jonathan posted, you can make that automatic (so that yanking does not even add those chars in the first place) by doing this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add 'yank :after (lambda (&amp;amp;optional ignore)&#xA;                           (replace-smart-to-ascii (mark) (point)))&#xA;            '(name replace-smart))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:49:18.527" LastActivityDate="2015-05-09T20:49:18.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3449" PostTypeId="2" ParentId="3411" CreationDate="2014-11-12T17:29:42.927" Score="3" Body="&lt;p&gt;Here's another option, if you just want to use &lt;code&gt;completing-read&lt;/code&gt; (perhaps with &lt;code&gt;ido&lt;/code&gt; via &lt;code&gt;ido-everywhere&lt;/code&gt; or &lt;code&gt;ido-ubiquitous&lt;/code&gt;) to quickly open an installed package outside of the package list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun open-package ()&#xA;  (interactive)&#xA;  (let* ((packages (mapcar 'symbol-name (mapcar 'car package-alist)))&#xA;         (package (completing-read &quot;Open package: &quot; packages nil t)))&#xA;    (find-library package)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="264" LastActivityDate="2014-11-12T17:29:42.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3450" PostTypeId="1" AcceptedAnswerId="3452" CreationDate="2014-11-12T18:56:09.480" Score="19" ViewCount="914" Body="&lt;p&gt;I have &lt;a href=&quot;https://github.com/Wilfred/ag.el/blob/a3a6e0f5856e225876e6944f8206218111bf8714/ag.el#L110&quot;&gt;some code&lt;/a&gt; that uses &lt;code&gt;flet&lt;/code&gt; to temporarily change the behaviour of functions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; prevent changing the window&#xA;(flet ((pop-to-buffer (buffer &amp;amp;rest args)&#xA;                      (switch-to-buffer buffer)))&#xA;   (compilation-next-error-function n reset))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, Emacs' byte compiler gives a warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In ag/next-error-function:&#xA;ag.el:103:7:Warning: `flet' is an obsolete macro (as of 24.3); use either&#xA;    `cl-flet' or `cl-letf'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;cl-flet&lt;/code&gt; works differently and doesn't suit some use cases, and I believe this is one of those cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The options I can see are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Tell Emacs to ignore the warning somehow.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Roll my own &lt;code&gt;flet&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;a href=&quot;http://nic.ferrier.me.uk/blog/2013_06/noflet-for-object-style-functions&quot;&gt;noflet&lt;/a&gt; or &lt;a href=&quot;https://github.com/sigma/el-x/blob/master/lisp/dflet.el&quot;&gt;dflet&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What is the best approach?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2014-11-13T09:46:18.220" LastActivityDate="2014-11-13T09:46:18.220" Title="What's the correct replacement for flet on new emacsen?" Tags="|cl-lib|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3451" PostTypeId="1" AcceptedAnswerId="3770" CreationDate="2014-11-12T18:58:28.203" Score="1" ViewCount="83" Body="&lt;p&gt;I've noticed that since updating to Emacs 24.4, installing packages doesn't refresh their status after installation. If I install, it still appears available to install. How can I force it to refresh?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IXzD3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2014-11-12T20:47:43.473" LastActivityDate="2014-11-21T01:20:13.827" Title="package status in *Help* doesn't refresh after install" Tags="|package|emacs24.4|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3452" PostTypeId="2" ParentId="3450" CreationDate="2014-11-12T19:11:55.520" Score="14" Body="&lt;p&gt;To get the same behavior you're used to with &lt;code&gt;flet&lt;/code&gt;, use &lt;code&gt;cl-letf&lt;/code&gt; to change a symbols function value.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-letf (((symbol-function 'pop-to-buffer)&#xA;           (lambda (buffer &amp;amp;rest _) (switch-to-buffer buffer))))&#xA;  (compilation-next-error-function n reset))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you were to roll your own &lt;code&gt;flet&lt;/code&gt;, the easy way would be macro that expands to a &lt;code&gt;cl-letf&lt;/code&gt; form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit: rolled it&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro myflet (bindings &amp;amp;rest body)&#xA;  &quot;Works like the old `flet'. Does not validate form structure.&quot;&#xA;  (declare (indent defun))&#xA;  `(cl-letf ,(mapcar (lambda (binding)&#xA;                       `((symbol-function ',(car binding))&#xA;                         (lambda ,(cadr binding) ,@(cddr binding))))&#xA;                     bindings)&#xA;     ,@body))&#xA;&#xA;(myflet ((+ (&amp;amp;rest args) (apply '- args)))&#xA;  (+ 10 3 2)) ;; =&amp;gt; 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-11-12T19:23:38.820" LastActivityDate="2014-11-12T19:23:38.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3453" PostTypeId="1" AcceptedAnswerId="3455" CreationDate="2014-11-12T19:15:46.573" Score="0" ViewCount="190" Body="&lt;p&gt;Is this possible? For example, determining the version of anaconda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results output&#xA;  conda -V | grep &quot;conda&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I remove the grep part I get no output at all, with it I at least get an Error Output window showing the conda version.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-11-12T19:18:57.497" Title="How to bash command output that isn't STDOUT from babel shell command" Tags="|org-babel|bash|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3454" PostTypeId="2" ParentId="3450" CreationDate="2014-11-12T19:17:32.233" Score="14" Body="&lt;p&gt;Artur Malabarba wrote this up recently, in &lt;a href=&quot;http://endlessparentheses.com/understanding-letf-and-how-it-replaces-flet.html&quot;&gt;Understanding letf and how it replaces flet&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;letf&lt;/code&gt; is an alias for &lt;code&gt;cl-letf&lt;/code&gt;, and while it's most likely what you want, there's a minor caveat which Artur points out:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unfortunately, cl-flet is not identical to the original flet—it's lexical, not dynamic.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Nic's &lt;code&gt;noflet&lt;/code&gt; package provides extended functionality along these lines.)&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="50" LastEditDate="2014-11-12T19:32:27.387" LastActivityDate="2014-11-12T19:32:27.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3455" PostTypeId="2" ParentId="3453" CreationDate="2014-11-12T19:18:57.497" Score="0" Body="&lt;p&gt;This can be done directly with bash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; conda -V 2&amp;gt;&amp;amp;1 | grep &quot;conda&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-11-12T19:18:57.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3457" PostTypeId="1" CreationDate="2014-11-12T20:18:24.903" Score="1" ViewCount="72" Body="&lt;p&gt;When running &lt;code&gt;C-c C-c&lt;/code&gt; to typeset/compile the LaTeX code in the current buffer, a second buffer pops up to show the compilation -- is there a way to suppress this buffer if there are no errors?&lt;/p&gt;&#xA;" OwnerUserId="513" LastActivityDate="2014-11-12T20:18:24.903" Title="Suppress new buffer when running typeset command (C-c C-c) in AUCTeX" Tags="|buffers|auctex|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3458" PostTypeId="1" AcceptedAnswerId="3459" CreationDate="2014-11-12T20:23:05.123" Score="128" ViewCount="81592" Body="&lt;p&gt;&lt;strong&gt;How do I switch between windows quickly?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often have multiple windows open and need to switch between them.  Right now, I use &lt;code&gt;C-x o&lt;/code&gt; to get to the one I want. Is there a more efficient workflow available for this?&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="105" LastEditDate="2015-03-27T20:47:16.430" LastActivityDate="2023-12-06T06:29:23.937" Title="How to switch between windows quickly?" Tags="|window|cycling|navigation|" AnswerCount="14" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3459" PostTypeId="2" ParentId="3458" CreationDate="2014-11-12T20:27:36.913" Score="80" Body="&lt;p&gt;I obviously prefer &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;noreferrer&quot;&gt;ace-window&lt;/a&gt; for this.&#xA;You can switch between visible windows and frames. It's in MELPA, you can install it quickly.&#xA;The only thing left to do is to bind it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x o&quot;) 'ace-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or maybe use a shorter key chord, since switching windows is a common task:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-p&quot;) 'ace-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Summary of &lt;code&gt;ace-window&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It's a drop-in replacement for &lt;code&gt;other-window&lt;/code&gt;. Unlike the latter, you never have to call &lt;code&gt;ace-window&lt;/code&gt; two or more times to select a window: you select a window you want in one call (possibly across multiple frames).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides switching windows, &lt;code&gt;ace-window&lt;/code&gt; can do more (delete or swap windows, etc), see &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;noreferrer&quot;&gt;README&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2017-10-16T07:40:56.397" LastActivityDate="2017-10-16T07:40:56.397" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3460" PostTypeId="2" ParentId="3458" CreationDate="2014-11-12T20:31:00.657" Score="149" Body="&lt;p&gt;One way is to use &lt;code&gt;windmove&lt;/code&gt;. With its default keybindings, it allows switching to the window next to the currently active one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's built in Emacs, so there is no need to install anything; just activate it with the following minimal setup in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(windmove-default-keybindings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then switch to neighbouring windows using the following keys (where the arrow used intuitively defines the direction in which you move): &lt;code&gt;S-&amp;lt;left&amp;gt;&lt;/code&gt;, &lt;code&gt;S-&amp;lt;right&amp;gt;&lt;/code&gt;, &lt;code&gt;S-&amp;lt;up&amp;gt;&lt;/code&gt;, &lt;code&gt;S-&amp;lt;down&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you'd prefer using another modifier instead of &lt;kbd&gt;shift&lt;/kbd&gt;, you can provide it as an argument to &lt;code&gt;windmove-default-keybindings&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(windmove-default-keybindings 'meta)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(windmove-default-keybindings 'control)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More info at &lt;a href=&quot;https://www.emacswiki.org/emacs/WindMove&quot; rel=&quot;noreferrer&quot;&gt;Emacs Wiki&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2018-08-23T21:20:48.027" LastActivityDate="2018-08-23T21:20:48.027" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="3461" PostTypeId="2" ParentId="3458" CreationDate="2014-11-12T20:40:37.397" Score="13" Body="&lt;p&gt;Without using any additional add-ons, you can continue to use &lt;code&gt;C-x o&lt;/code&gt; with an optional prefix to skip over that many windows.  Eg: &lt;code&gt;C-u 1 C-x o&lt;/code&gt; will go to the next window in the order (ie, what you would get with plain &lt;code&gt;C-x o&lt;/code&gt;), &lt;code&gt;C-u 2 C-x o&lt;/code&gt; goes two windows over, &lt;code&gt;C-u 3 C-x o&lt;/code&gt; goes three windows over, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An excerpt from the &lt;code&gt;other-window&lt;/code&gt; docstring (the function called by &lt;code&gt;C-x o&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;COUNT specifies the number of windows to skip, starting with the&#xA;  selected window, before making the selection.  If COUNT is&#xA;  positive, skip COUNT windows forwards.  If COUNT is negative,&#xA;  skip -COUNT windows backwards.  COUNT zero means do not skip any&#xA;  window, so select the selected window.  In an interactive call,&#xA;  COUNT is the numeric prefix argument.  Return nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-12T20:40:37.397" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3462" PostTypeId="2" ParentId="3458" CreationDate="2014-11-12T20:48:06.977" Score="3" Body="&lt;p&gt;If you use &lt;code&gt;evil-mode&lt;/code&gt;, you can just use a numeric prefix with &lt;code&gt;C-w C-w&lt;/code&gt; (&lt;code&gt;evil-window-next&lt;/code&gt;) to pick the window you want.  So: &lt;code&gt;1 C-w C-w&lt;/code&gt; picks the first window in cyclic order, &lt;code&gt;3 C-w C-w&lt;/code&gt; picks the third window in cyclic order, and so forth.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-12T20:48:06.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3463" PostTypeId="1" AcceptedAnswerId="3475" CreationDate="2014-11-12T21:10:12.603" Score="2" ViewCount="1450" Body="&lt;p&gt;I have emacs configured to start &lt;code&gt;org-agenda&lt;/code&gt; automatically and show it instead of &lt;em&gt;*scratch*&lt;/em&gt;. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook (quote after-init-hook)&#xA;              (lambda ()&#xA;              ;; ...&#xA;              (org-agenda-list 1)&#xA;              (delete-other-windows)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the same trick don't works with &lt;code&gt;emacsclient&lt;/code&gt;, the &lt;code&gt;org-agenda&lt;/code&gt; buffer is there in the buffer list, but the &lt;em&gt;*scratch*&lt;/em&gt; buffer is shown instead.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="25" LastEditDate="2014-11-15T23:51:42.120" LastActivityDate="2014-11-15T23:51:42.120" Title="Open a frame for the first time (using `emacsclient -c`) showing other buffer than *scratch*" Tags="|buffers|emacsclient|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3464" PostTypeId="1" AcceptedAnswerId="3468" CreationDate="2014-11-12T21:15:26.810" Score="10" ViewCount="239" Body="&lt;p&gt;This is a really nice feature, but it only displays when inserting a paren, not when changing to a cursor position. Is there an interactive command that I can call to display this? Can I configure it to show up on cursor move?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2JuKq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="50" LastEditDate="2014-11-12T21:38:34.783" LastActivityDate="2014-11-12T22:36:15.717" Title="What minor mode prints opening paren in the echo area?" Tags="|balanced-parentheses|echo-area|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3465" PostTypeId="1" CreationDate="2014-10-20T00:58:47.163" Score="8" ViewCount="559" Body="&lt;p&gt;When opening &lt;code&gt;.org&lt;/code&gt; files, Emacs asks for a master file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is that and how can I disable this feature? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it is because of using latex-related packages like &lt;code&gt;ox-latex&lt;/code&gt; and &lt;code&gt;ox-beamer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make the master file for &lt;code&gt;.org&lt;/code&gt; files latex mode-specific or switch it off completely?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="2517" OwnerDisplayName="Anusha" LastEditorUserId="504" LastEditDate="2014-11-13T08:09:08.797" LastActivityDate="2015-01-12T09:24:25.090" Title="Why does Emacs org-mode ask for master file?" Tags="|org-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3466" PostTypeId="2" ParentId="3463" CreationDate="2014-11-12T21:39:26.353" Score="1" Body="&lt;p&gt;Try adding a function to the &lt;code&gt;after-make-frame-functions&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;after-make-frame-functions is a variable defined in `frame.el'.&#xA;&#xA;Documentation:&#xA;Functions to run after a frame is created.&#xA;The functions are run with one arg, the newly created frame.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-11-12T21:39:26.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3467" PostTypeId="2" ParentId="3464" CreationDate="2014-11-12T22:08:02.103" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;M-x blink-matching-open RET&lt;/code&gt; to display the message if you're right after a paren.  To do it more &quot;on the fly&quot; you might like to try &lt;code&gt;M-x show-paren-mode&lt;/code&gt;, tho it doesn't actually give you this message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, you could use something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook&#xA;          (lambda ()&#xA;            (if (and (not (bobp))&#xA;                     (eq ?\) (char-syntax (char-before))))&#xA;                (blink-matching-open))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-12T22:08:02.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3468" PostTypeId="2" ParentId="3464" CreationDate="2014-11-12T22:11:08.327" Score="6" Body="&lt;p&gt;That message is printed when the beginning of the sexp is not visible in the window; otherwise, the opening paren is temporarily highlighted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior is implemented in &lt;code&gt;simple.el&lt;/code&gt; and is not associated with any minor mode. It is implemented using a hook that runs when a character is inserted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actual blinking/message comes from command &lt;code&gt;blink-matching-open&lt;/code&gt;, which you can call yourself. For example you could start an idle-timer that will call this command whenever you pause for a short time on a closing paren. This is the way that the built-in &lt;code&gt;show-paren-mode&lt;/code&gt; works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar match-paren--idle-timer nil)&#xA;(defvar match-paren--delay 0.5)&#xA;(setq match-paren--idle-timer (run-with-idle-timer match-paren--delay t #'blink-matching-open))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-12T22:36:15.717" LastActivityDate="2014-11-12T22:36:15.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3469" PostTypeId="2" ParentId="3458" CreationDate="2014-11-12T22:48:54.393" Score="14" Body="&lt;p&gt;window-numbering.el !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assign the hotkey &quot;,1&quot;, &quot;,2&quot;, &quot;,3&quot; to switch specific window (please note I use evil-mode)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;besides, I display the window number at the mode line in PINK color, underlined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a visual hint you can never ignore,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's &lt;strong&gt;quickest way&lt;/strong&gt; to switch window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;check &lt;a href=&quot;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-evil.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-evil.el&lt;/a&gt; and &lt;a href=&quot;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-modeline.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-modeline.el&lt;/a&gt; for my setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sylvain Benner adopted my idea in spacemacs but &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#window-manipulation&quot; rel=&quot;noreferrer&quot;&gt;keybindings are different&lt;/a&gt;. So if you use spacemacs, you get the quickest solution out of the box.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-10-24T02:53:32.903" LastActivityDate="2016-10-24T02:53:32.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3470" PostTypeId="2" ParentId="3458" CreationDate="2014-11-12T22:55:15.193" Score="7" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then &lt;strong&gt;&lt;code&gt;C-x o&lt;/code&gt;&lt;/strong&gt; lets you select windows by &lt;em&gt;name&lt;/em&gt; (or by cycling).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;With no prefix arg, &lt;code&gt;C-x o&lt;/code&gt; is the same as usual, &lt;code&gt;other-window&lt;/code&gt;, unless the frame has only one window, in which case it is &lt;code&gt;other-frame&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With a prefix arg, &lt;code&gt;C-x o&lt;/code&gt; is a &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;multi-command&lt;/em&gt;&lt;/a&gt; that lets you navigate among windows or frames by name (or by cycling). Navigating among windows uses multi-command  &lt;strong&gt;&lt;code&gt;icicle-select-window&lt;/code&gt;&lt;/strong&gt;; navigating among frames uses &lt;strong&gt;&lt;code&gt;icicle-select-frame&lt;/code&gt;&lt;/strong&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Which navigation is used depends on the prefix arg:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Zero&lt;/em&gt; prefix arg (e.g. &lt;code&gt;C-0&lt;/code&gt;): If the selected frame has multiple windows, then this is&#xA;&lt;code&gt;icicle-select-window&lt;/code&gt;, with windows in the &lt;strong&gt;same frame&lt;/strong&gt; as candidates.&#xA;Otherwise (single-window frame), this is &lt;code&gt;icicle-select-frame&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-u&lt;/code&gt;: If the selected frame has multiple windows, then this is&#xA;&lt;code&gt;icicle-select-window&lt;/code&gt;, with windows from all &lt;strong&gt;visible frames&lt;/strong&gt; as&#xA;candidates.  Otherwise, this is &lt;code&gt;icicle-select-frame&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-u C-u&lt;/code&gt;: &lt;code&gt;icicle-select-window&lt;/code&gt;, with windows from &lt;strong&gt;all frames&lt;/strong&gt; as&#xA;candidates (including iconified or hidden frames).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As always in &lt;strong&gt;Icicles&lt;/strong&gt;, you can combine (a) &lt;strong&gt;completion&lt;/strong&gt;, typing text to narrow the set of matching candidates (window or frame names, in this case), with (b) &lt;strong&gt;cycling&lt;/strong&gt; (among matching candidates).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="119" LastEditDate="2018-09-19T22:12:55.867" LastActivityDate="2018-09-19T22:12:55.867" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3471" PostTypeId="2" ParentId="3458" CreationDate="2014-11-12T23:29:44.420" Score="32" Body="&lt;p&gt;You can bind &lt;code&gt;other-window&lt;/code&gt; to an easier-to-type key sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have &lt;code&gt;C-.&lt;/code&gt; bound to &lt;code&gt;other-window&lt;/code&gt;, and &lt;code&gt;C-,&lt;/code&gt; bound to go to the previous window.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-.&quot;) #'other-window)&#xA;(global-set-key (kbd &quot;C-,&quot;) #'prev-window)&#xA;&#xA;(defun prev-window ()&#xA;  (interactive)&#xA;  (other-window -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is especially useful for moving multiple windows; once you hold down Control, you only have to press a single button to move to the next window. This is much easier than three keypresses per move.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2017-11-30T03:49:00.927" LastActivityDate="2017-11-30T03:49:00.927" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3472" PostTypeId="2" ParentId="3463" CreationDate="2014-11-12T23:51:00.250" Score="2" Body="&lt;p&gt;The simple solution I have, is calling emacsclient plus some lisp evaluation. For example: &lt;code&gt;emacsclient -c -e '(switch-to-buffer &quot;init.el&quot;)'&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll have to replace &lt;em&gt;init.el&lt;/em&gt; by the buffer you want to open. That one suppose the init.el buffer was already launched and exists with the emacs server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if using emacsclient, you want to launch the org-agenda-list function: &lt;code&gt;emacsclient -c -e '(org-agenda-list)'&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-11-13T01:13:36.670" LastActivityDate="2014-11-13T01:13:36.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3473" PostTypeId="2" ParentId="3056" CreationDate="2014-11-12T23:51:28.603" Score="3" Body="&lt;p&gt;Found help on GitHub, here is what should be done when attempting at &lt;em&gt;removing&lt;/em&gt; a property:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'helm-selection nil :underline 'unspecified)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the GitHub issue: &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/697#issuecomment-62362671&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/issues/697#issuecomment-62362671&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2014-11-12T23:51:28.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3474" PostTypeId="1" AcceptedAnswerId="3502" CreationDate="2014-11-13T00:34:17.717" Score="3" ViewCount="1204" Body="&lt;p&gt;I am trying to use &lt;code&gt;windmove&lt;/code&gt; with the default bindings and am unable to get the shift key bindings working correctly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I hit &lt;code&gt;Shift-&amp;lt;up&amp;gt;&lt;/code&gt;, instead of selecting another window, the point moves and a region is selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;code&gt;C-h k RET Shift-&amp;lt;up&amp;gt;&lt;/code&gt; simply shows &lt;code&gt;&amp;lt;up&amp;gt;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Using GNU Emacs 24.3.&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the entry from my &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\e[1;2A&quot; 'windmove-up)&#xA;(global-set-key &quot;\e[1;2B&quot; 'windmove-down)&#xA;(global-set-key &quot;\e[1;2C&quot; 'windmove-right)&#xA;(global-set-key &quot;\e[1;2D&quot; 'windmove-left)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using these entries, instead of &lt;code&gt;windmove-default-keybindings&lt;/code&gt; since the default wasn't working when I opened a non-windowed emacs through tmux.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2014-11-13T01:04:18.777" LastActivityDate="2014-11-13T17:22:04.993" Title="windmove keybinds are not loaded" Tags="|key-bindings|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3475" PostTypeId="2" ParentId="3463" CreationDate="2014-11-13T02:32:25.283" Score="7" Body="&lt;p&gt;Check the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html&quot;&gt;manual&lt;/a&gt; for &lt;code&gt;initial-buffer-choice&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If non-&lt;code&gt;nil&lt;/code&gt;, this variable is a string that specifies a file or directory for Emacs to display after starting up, instead of the startup screen. If its value is a function, Emacs calls that function which must return a buffer which is then displayed. If its value is &lt;code&gt;t&lt;/code&gt;, Emacs displays the *scratch* buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The web manual may not say it, but &lt;code&gt;C-h v&lt;/code&gt; for me clarifies that this also affects emacsclient use with no target file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can just set this to a function that returns the org agenda buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-buffer-choice '(lambda () (get-buffer org-agenda-buffer-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that, with this solution, you don't need the after-init-hook.  Just call &lt;code&gt;org-agenda-list&lt;/code&gt; sometime in your init file to ensure the buffer is available for the initial choice.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-11-13T02:32:25.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3476" PostTypeId="2" ParentId="3349" CreationDate="2014-11-13T03:27:25.187" Score="6" Body="&lt;p&gt;You don't want to nest one syntax table (which is a vector structure) inside another, you want to set up a buffer where, depending on the position, one syntax table would be used instead of the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other answer describes how to do this using the &lt;code&gt;syntax-table&lt;/code&gt; text property. Here's how to do it using one of the &quot;multiple major mode&quot; packages, &lt;a href=&quot;https://github.com/purcell/mmm-mode/&quot; rel=&quot;nofollow&quot;&gt;mmm-mode&lt;/a&gt;. It will use the primary mode's everything at the top level of the buffer, and the submode' syntax table, font-lock rules, keymap, etc in the &quot;subregions&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'mmm-auto)&#xA;(setq mmm-global-mode 'auto)&#xA;&#xA;(mmm-add-classes&#xA; '((eljson :submode emacs-lisp-mode&#xA;           :front &quot;: *\\(`\\)&quot; :back &quot;`&quot;&#xA;           :front-match 1&#xA;           :face mmm-code-submode-face)))&#xA;&#xA;(mmm-add-mode-ext-class 'json-mode &quot;\\.el\\.json\\'&quot; 'eljson)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This assumes that your mixed-mode files are named &lt;code&gt;*.el.json&lt;/code&gt;. Adjust as appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, install &lt;code&gt;mmm-mode&lt;/code&gt;, evaluate the above and (only then) open one of the files in question.&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorUserId="124" LastEditDate="2014-11-18T01:51:20.977" LastActivityDate="2014-11-18T01:51:20.977" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3477" PostTypeId="2" ParentId="3465" CreationDate="2014-11-13T05:29:07.703" Score="4" Body="&lt;p&gt;Use &lt;code&gt;debug-on-message&lt;/code&gt; to see a stacktrace when this message appears.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;— Variable: debug-on-message&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If you set debug-on-message to a regular expression, Emacs will enter the debugger if it displays a matching message in the echo area. For example, this can be useful when trying to find the cause of a particular message.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, eval &lt;code&gt;(setq debug-on-message &quot;Master file&quot;)&lt;/code&gt; then open an org file.  That should point you to why it happens.  As for how to disable ... that might be worth a second question.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-11-13T05:29:07.703" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3478" PostTypeId="2" ParentId="3378" CreationDate="2014-11-13T08:15:31.213" Score="1" Body="&lt;p&gt;What I do is a little complex: I advise the function &lt;code&gt;package-activate&lt;/code&gt; such that every time a package is activated, Emacs will look for a file called &lt;code&gt;[package]-conf.el&lt;/code&gt; and execute it using &lt;code&gt;load&lt;/code&gt; instead of &lt;code&gt;require&lt;/code&gt;, so it can be executed multiple times.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kzn-package-dir (package)&#xA;  &quot;Return the full path of the directory where the package is installed.&quot;&#xA;  (interactive)&#xA;  (let ((desc (cadr (assq package package-alist))))&#xA;    (if desc&#xA;        (package-desc-dir desc))))&#xA;&#xA;(defadvice package-activate (after kzn-package-activate-load-conf activate)&#xA;  &quot;Load kzn/&amp;lt;package.el&amp;gt; file after the package is activated.&quot;&#xA;  (let* ((package-name (symbol-name package))&#xA;         (dir (kzn-package-dir package))&#xA;         (pkg-conf (kzn-path :lisp (concat (file-name-as-directory &quot;pkg-confs&quot;) package-name &quot;-conf.el&quot;))))&#xA;    (if ad-return-value&#xA;        (progn&#xA;          (message (concat package-name &quot;: activated (dir: &quot; dir &quot;)&quot;))&#xA;          (if (file-exists-p pkg-conf)&#xA;              (progn&#xA;                (message (concat &quot;loading package configuration file: '&quot; pkg-conf &quot;'&quot;))&#xA;                (load pkg-conf))))&#xA;      (message (concat package-name &quot;: couldn't be activated with dir: &quot; dir )))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in my &lt;code&gt;pkg-configs/yasnippet-conf.el&lt;/code&gt;, I set the &lt;code&gt;yas-snippet-dirs&lt;/code&gt; variable to point where the &lt;code&gt;yasnippet&lt;/code&gt; package is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs&#xA;      `(,(kzn-path :emacsd &quot;snippets&quot;)&#xA;        ,(concat (file-name-as-directory (kzn-package-dir 'yasnippet)) &quot;snippets&quot;)&#xA;        ,(kzn-path :vendor &quot;yasnippets-rails/rails-snippets&quot;)&#xA;        ,(kzn-path :vendor &quot;yasnippets-shoulda&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;kzn-path&lt;/code&gt; is a function I use to find my custom directories by symbol; you can replace it for directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this is copied directly from my configuration files. I think it's every thing you need, or it should at least point you in the right direction.&lt;/p&gt;&#xA;" OwnerUserId="2026" LastEditorUserId="504" LastEditDate="2014-11-13T10:33:39.213" LastActivityDate="2014-11-13T10:33:39.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3479" PostTypeId="1" AcceptedAnswerId="3506" CreationDate="2014-11-13T08:59:19.257" Score="16" ViewCount="3393" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I tell &lt;code&gt;org-mode&lt;/code&gt; to exclude specific headlines from the table of contents when exporting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, exporting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 1: Put me in TOC&#xA;* Headline 2: Put me in TOC&#xA;* Headline 3: DO NOT put me in TOC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to HTML produces&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;&amp;lt;div id=&quot;text-table-of-contents&quot;&amp;gt;&#xA;  &amp;lt;ul&amp;gt;&#xA;    &amp;lt;li&amp;gt;&amp;lt;a href=&quot;#sec-1&quot;&amp;gt;1. Headline 1: Put me in TOC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;&amp;lt;a href=&quot;#sec-2&quot;&amp;gt;2. Headline 2: Put me in TOC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;&amp;lt;a href=&quot;#sec-3&quot;&amp;gt;3. Headline 3: DO NOT put me in TOC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;  &amp;lt;/ul&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I want it to produce&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;&amp;lt;div id=&quot;text-table-of-contents&quot;&amp;gt;&#xA;  &amp;lt;ul&amp;gt;&#xA;    &amp;lt;li&amp;gt;&amp;lt;a href=&quot;#sec-1&quot;&amp;gt;1. Headline 1: Put me in TOC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;&amp;lt;a href=&quot;#sec-2&quot;&amp;gt;2. Headline 2: Put me in TOC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;  &amp;lt;/ul&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/manual/Table-of-contents.html&quot;&gt;Table of contents&lt;/a&gt; section of the &lt;code&gt;org-mode&lt;/code&gt; manual doesn't have any information on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I know that I can keep &lt;code&gt;org-mode&lt;/code&gt; from exporting headlines by setting the &lt;code&gt;COMMENT&lt;/code&gt; keyword via &lt;kbd&gt;C-c ;&lt;/kbd&gt; (&lt;code&gt;org-toggle-comment&lt;/code&gt;) or by tagging them with &lt;code&gt;:noexport:&lt;/code&gt;. While this does keep affected headlines from showing up in the TOC, it also causes their contents to be omitted from the resulting document, which is not what I want.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-11-13T12:29:59.930" LastActivityDate="2022-04-22T11:49:02.980" Title="Org-mode: Exclude specific headlines from TOC when exporting" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3480" PostTypeId="1" CreationDate="2014-11-13T09:03:33.330" Score="4" ViewCount="2396" Body="&lt;p&gt;When I launch my emacs software (Aquamacs.app) I see a message &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File mode specification error: (error &quot;:END: line missing at position 23740&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I do not know in which file this problem occurs. It must be an org-mode buffer, where I have a drawer like :PROPERTIES: or :LOGBOOK: where I accidentally deleted the corresponding :END: line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see how to find the corresponding place in my files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to check all open buffers for such inconsistency or get a clearer error message which also specifies the buffer where the problem occurs?&lt;/p&gt;&#xA;" OwnerUserId="2377" LastActivityDate="2014-12-22T16:20:47.983" Title="File mode specification error: How to find syntax problem: Missing :END: line in org-mode properties?" Tags="|org-mode|syntax|error-handling|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3481" PostTypeId="1" AcceptedAnswerId="3483" CreationDate="2014-11-13T09:46:29.580" Score="4" ViewCount="359" Body="&lt;p&gt;I am using &lt;code&gt;ido-mode&lt;/code&gt; to select files from Emacs. This works well for most cases, but for some cases I would like to modify the files that are shown in the completion buffer with &lt;code&gt;ido-find-file&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some folders I have a lot of &lt;code&gt;*.bak&lt;/code&gt; files, and I would like to have the possiblity to remove them from the completion buffer by pressing the &lt;kbd&gt;F1&lt;/kbd&gt; key, for example. This is how far I got on this task:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ido-minibuffer-setup-hook 'ido-my-keys)&#xA;&#xA;(defun ido-my-keys ()&#xA;  (define-key ido-file-completion-map (kbd &quot;&amp;lt;f1&amp;gt;&quot;) 'my-modify-files))&#xA;&#xA;(defun my-modify-files ()&#xA;  (interactive)&#xA;  (message-box &quot;Here I would like to delete the .bak files from the minibuffer&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2020-05-16T20:02:50.893" Title="Remove *.bak files from ido-mode minibuffer" Tags="|ido|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3482" PostTypeId="2" ParentId="3480" CreationDate="2014-11-13T09:49:46.910" Score="3" Body="&lt;p&gt;This appears to be coming from the function &lt;code&gt;org-flag-drawer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;C-h f&lt;/kbd&gt; to find where this function is defined, and modify it to also give the buffer name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-flag-drawer (flag)&#xA;  &quot;When FLAG is non-nil, hide the drawer we are within.&#xA;    Otherwise make it visible.&quot;&#xA;  (save-excursion&#xA;    (beginning-of-line 1)&#xA;    (when (looking-at &quot;^[ \t]*:[a-zA-Z][a-zA-Z0-9]*:&quot;)&#xA;      (let ((b (match-end 0)))&#xA;        (if (re-search-forward&#xA;             &quot;^[ \t]*:END:&quot;&#xA;             (save-excursion (outline-next-heading) (point)) t)&#xA;            (outline-flag-region b (point-at-eol) flag)&#xA;          (user-error (concat (buffer-name) &quot; :END: line missing at position %s&quot; b)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="504" LastEditDate="2014-11-13T10:35:02.033" LastActivityDate="2014-11-13T10:35:02.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3483" PostTypeId="2" ParentId="3481" CreationDate="2014-11-13T10:02:29.920" Score="8" Body="&lt;p&gt;&lt;code&gt;ido-mode&lt;/code&gt; has built-in support for hiding files matching specific regexps. All you need to do is add &lt;code&gt;\.bak&lt;/code&gt; to &lt;code&gt;ido-ignore-files&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'ido-ignore-files &quot;\.bak&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After invoking &lt;code&gt;ido-find-file&lt;/code&gt;, you can then hit &lt;kbd&gt;C-a&lt;/kbd&gt; (&lt;code&gt;ido-toggle-ignore&lt;/code&gt;) to toggle hiding of &lt;code&gt;.bak&lt;/code&gt; files.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-16T08:29:22.087" LastActivityDate="2015-01-16T08:29:22.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3484" PostTypeId="2" ParentId="3458" CreationDate="2014-11-13T10:06:49.510" Score="4" Body="&lt;p&gt;Consider using a &lt;a href=&quot;http://www.emacswiki.org/KeyChord&quot; rel=&quot;nofollow&quot;&gt;key-chord&lt;/a&gt; for quickly jumping between windows. I find it much quicker than reaching for a modifier key(and less straining on my hands, as well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My choice of package to use is &lt;code&gt;ace-window&lt;/code&gt;, which lets you navigate multiple windows easier than just &lt;code&gt;other-window&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'key-chord)&#xA;(key-chord-define-global &quot;xo&quot; 'ace-window)&#xA;(key-chord-mode +1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously to use this you need &lt;code&gt;key-chord&lt;/code&gt; and &lt;code&gt;ace-window&lt;/code&gt;, both are available in melpa.&lt;/p&gt;&#xA;" OwnerUserId="2042" LastEditorUserId="2042" LastEditDate="2014-11-13T12:24:06.537" LastActivityDate="2014-11-13T12:24:06.537" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3485" PostTypeId="1" CreationDate="2014-11-13T10:44:48.260" Score="4" ViewCount="304" Body="&lt;p&gt;I've written a helper function for mu4e to run checkpatch against a message. However I want to be easily able to switch between previous calls to checkpatch and this seems difficult with &lt;em&gt;ido-read-file-name&lt;/em&gt;. This is my code so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;&#xA;;; Checkpatch in emails&#xA;;;&#xA;(defvar my-checkpatch-script-history nil&#xA;  &quot;History of checkpatch invocations.&quot;)&#xA;&#xA;(defun my-mu4e-action-run-check-patch (msg)&#xA;  &quot;Run checkpatch against the [patch] `MSG'.&quot;&#xA;  (let*&#xA;      ((ido-work-file-list my-checkpatch-script-history)&#xA;       (script (ido-read-file-name&#xA;                &quot;Checkpatch Script: &quot; (directory-file-name (or (car&#xA;                                                                ido-work-file-list)&#xA;                                                               default-directory)))))&#xA;    (setf my-checkpatch-script-history&#xA;        (cons script (delete script my-checkpatch-script-history)))&#xA;    ;; actual check patch handling...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However C-n/C-p cycle through previous directories instead of files. The code I use to specify directories to apply patches which works a lot more naturally:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mu4e-action-git-apply-patch (msg)&#xA;  &quot;Apply the git [patch] message.&quot;&#xA;  (let ((path (ido-read-directory-name &quot;Target directory: &quot;&#xA;                                       (car ido-work-directory-list)&#xA;                                       &quot;~/&quot; t)))&#xA;    (setf ido-work-directory-list&#xA;          (cons path (delete path ido-work-directory-list)))&#xA;    ;; actual apply-patch handling&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this just a limitation of dealing with files rather than directories? &lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="105" LastEditDate="2015-03-27T19:25:30.903" LastActivityDate="2015-09-23T23:07:00.687" Title="How do I maintain a history of ido-read-filenames?" Tags="|ido|interactive|cycling|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3486" PostTypeId="2" ParentId="3421" CreationDate="2014-11-13T10:55:52.070" Score="7" Body="&lt;p&gt;With regard to indirect buffers mentioned in the accepted answer...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x clone-indirect-buffer&lt;/code&gt; will create an indirect buffer for the current buffer. The name of the new buffer will have '&amp;lt;2&gt;' added to it (or a greater number if you've already got duplicate buffer names). The new buffer is opened in a new window. You can switch back to a single window using &lt;code&gt;C-x 0&lt;/code&gt; or &lt;code&gt;C-x 1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;M-x winner-mode&lt;/code&gt; you can easily switch between the two locations. &lt;code&gt;C-c &amp;lt;left&amp;gt;&lt;/code&gt; / &lt;code&gt;M-x winner-undo&lt;/code&gt; and &lt;code&gt;C-c &amp;lt;right&amp;gt;&lt;/code&gt; / &lt;code&gt;M-x winner-redo&lt;/code&gt; switches between window configurations. In this case the configurations will be positions in the two buffers viewing the one file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: the &lt;code&gt;winner-undo&lt;/code&gt; and &lt;code&gt;winner-redo&lt;/code&gt; functions work on a list of configurations. If the configuration is changed, e.g. moving point, then the current configuration becomes the head of the list and &lt;code&gt;winner-redo&lt;/code&gt; is invalid, in this case &lt;code&gt;winner-undo&lt;/code&gt; will bring back the previous position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the OP's situation this leads to the following process;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Turn on winner mode &lt;code&gt;M-x winner-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Visit file (filename: File1.txt, buffer name: File1.txt)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x clone-indirect-buffer&lt;/code&gt; (new indirect buffer name: File1.txt&amp;lt;2&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Make current window the only window &lt;code&gt;C-x 1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Find first edit location, make changes.&lt;/li&gt;&#xA;&lt;li&gt;Switch to original buffer visiting file, &lt;code&gt;C-x b&lt;/code&gt; (default will be original buffer unless a switch to another buffer took place since step 3). This creates a new configuration for winner to switch back to.&lt;/li&gt;&#xA;&lt;li&gt;Find alternative edit location, make changes.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A switch to the previous edit location (window configuration) depends on whether a change is made to the window configuration between switches;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If a change is made switch using &lt;code&gt;C-c &amp;lt;left&amp;gt;&lt;/code&gt; / &lt;code&gt;M-x winner-undo&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If no change is made switch using &lt;code&gt;C-c &amp;lt;left&amp;gt;&lt;/code&gt; / &lt;code&gt;M-x winner-undo&lt;/code&gt; for back and &lt;code&gt;C-c &amp;lt;right&amp;gt;&lt;/code&gt; / &lt;code&gt;M-x winner-redo&lt;/code&gt; for forward.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A change is anything other than another &lt;code&gt;winner-undo&lt;/code&gt; or &lt;code&gt;winner-redo&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2542" LastEditorUserId="2542" LastEditDate="2014-11-13T11:16:35.190" LastActivityDate="2014-11-13T11:16:35.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3487" PostTypeId="2" ParentId="3458" CreationDate="2014-11-13T11:08:39.303" Score="15" Body="&lt;p&gt;Some people may remember the editor Brief (funnily enough produced by a company called Underware).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It had a neat way to switch between visible windows. M-arrow would move the cursor into the window directly in line with the direction of the arrow key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I mapped the &lt;code&gt;winmove-left&lt;/code&gt;, &lt;code&gt;winmove-right&lt;/code&gt;, &lt;code&gt;winmove-up&lt;/code&gt; and &lt;code&gt;winmove-down&lt;/code&gt; functions to &lt;code&gt;M-left&lt;/code&gt;, &lt;code&gt;M-right&lt;/code&gt;, &lt;code&gt;M-up&lt;/code&gt; and &lt;code&gt;M-down&lt;/code&gt; keys as follows in my .emacs file -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [M-left] 'windmove-left)          ; move to left window&#xA;(global-set-key [M-right] 'windmove-right)        ; move to right window&#xA;(global-set-key [M-up] 'windmove-up)              ; move to upper window&#xA;(global-set-key [M-down] 'windmove-down)          ; move to lower window&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I can move with ease between windows, regardless of how cluttered I have the configuration... And it can get quite cluttered with the size of displays nowadays...&lt;/p&gt;&#xA;" OwnerUserId="2542" LastActivityDate="2014-11-13T11:08:39.303" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3488" PostTypeId="1" AcceptedAnswerId="3489" CreationDate="2014-11-13T11:17:03.317" Score="11" ViewCount="1254" Body="&lt;p&gt;I'm trying to add some functionality to someone else's package, and so&#xA;I'd like to respect their patterns. Unfortunately, one of these&#xA;patterns is to not use &lt;code&gt;kbd&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to bind a function to &lt;code&gt;C-S-b&lt;/code&gt;, but I can't figure out how. I&#xA;know how to do this with a single modifier (e.g. &lt;code&gt;&quot;\S-b&quot;&lt;/code&gt;), but I&#xA;can't get it to work with multiple modifiers. &#xA;I know I can just&#xA;evaluate &lt;code&gt;(kbd &quot;C-S-b&quot;)&lt;/code&gt; and use its output (&lt;code&gt;[33554434]&lt;/code&gt;), but I'd&#xA;like something easier to read.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few things I've tried: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key emacs-lisp-mode-map&#xA;  &quot;\C-\S-b&quot; 'test-command)&#xA;;;; Invalid modifier&#xA;&#xA;(define-key emacs-lisp-mode-map&#xA;  [C-S-b] 'test-command)&#xA;;;; Does nothing&#xA;&#xA;(define-key emacs-lisp-mode-map&#xA;  &quot;\C-B&quot; 'test-command)&#xA;;;; Binds C-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-15T11:41:41.997" Title="Define Control+Shift keys without kbd" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3489" PostTypeId="2" ParentId="3488" CreationDate="2014-11-13T11:23:44.120" Score="15" Body="&lt;p&gt;You are missing a &lt;code&gt;?&lt;/code&gt; and two backslashes in the vector representation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [?\C-\S-b] 'test-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The section on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html&quot; rel=&quot;noreferrer&quot;&gt;Key Sequences&lt;/a&gt; in the Elisp manual says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Key sequences containing function keys, mouse button events, system&#xA;  events, or non-ASCII characters such as &lt;code&gt;C-=&lt;/code&gt; or &lt;code&gt;H-a&lt;/code&gt; cannot be&#xA;  represented as strings; they have to be represented as vectors.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In the vector representation, each element of the vector represents&#xA;  an input event, &lt;strong&gt;in its Lisp form&lt;/strong&gt;. For example, the vector &lt;code&gt;[?\C-x ?l]&lt;/code&gt; represents the key sequence &lt;code&gt;C-x l&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And under &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Other-Char-Bits.html&quot; rel=&quot;noreferrer&quot;&gt;Other Character Modifier Bits&lt;/a&gt; it says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Lisp syntax for the shift bit is &lt;code&gt;\S-&lt;/code&gt;; thus, &lt;code&gt;?\C-\S-o&lt;/code&gt; or &lt;code&gt;?\C-\S-O&lt;/code&gt; represents the shifted-control-o character.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-15T11:41:41.997" LastActivityDate="2015-01-15T11:41:41.997" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3492" PostTypeId="5" CreationDate="2014-11-13T12:22:33.750" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-13T12:22:33.750" LastActivityDate="2014-11-13T12:22:33.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3493" PostTypeId="4" CreationDate="2014-11-13T12:22:33.750" Score="0" Body="is the feature of displaying text, especially source code, in different colors and fonts according to the meaning of different terms." OwnerUserId="45" LastEditorUserId="50" LastEditDate="2014-11-13T14:25:21.183" LastActivityDate="2014-11-13T14:25:21.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3494" PostTypeId="1" AcceptedAnswerId="3495" CreationDate="2014-11-13T13:18:51.023" Score="13" ViewCount="3318" Body="&lt;p&gt;Just as the question stated, I would like a function that would count of the windows that are currently being shown in that frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------------+-------------+&#xA;|              |             |&#xA;|              |             |&#xA;|  *scratch*   | *Messages*  |&#xA;|              |             |&#xA;|              |             |&#xA;|              |             |&#xA;+--------------+-------------+&#xA;|           *Help*           |&#xA;|                            |&#xA;+----------------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would return &lt;code&gt;=&amp;gt; 3&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started a function below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun count-windows ()&#xA;  &quot;Count how many buffers are currently being shown.&quot;&#xA;  (interactive)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="45" LastEditorUserId="50" LastEditDate="2014-11-13T14:18:12.543" LastActivityDate="2014-11-13T14:18:12.543" Title="How to count all of the windows in a frame?" Tags="|elisp|window|frames|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3495" PostTypeId="2" ParentId="3494" CreationDate="2014-11-13T13:29:23.997" Score="26" Body="&lt;p&gt;If you mean the number of &lt;em&gt;windows&lt;/em&gt; regardless of which buffers are showing, then: &lt;code&gt;(length (window-list))&lt;/code&gt; will do it.  Better still, you can just use the existing &lt;code&gt;(count-windows)&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to count the number of &lt;em&gt;unique buffers&lt;/em&gt; visible in windows on the frame, then you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(length (cl-delete-duplicates (mapcar #'window-buffer (window-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that &lt;code&gt;window-list&lt;/code&gt; can also take an optional FRAME argument if you want something other than the selected frame.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wrapping the latter in your function call will give you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun count-unique-visible-buffers (&amp;amp;optional frame)&#xA;  &quot;Count how many buffers are currently being shown.  Defaults to&#xA;selected frame.&quot;&#xA;  (length (cl-delete-duplicates (mapcar #'window-buffer (window-list frame)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that this function assumes you have loaded &lt;code&gt;'cl-lib&lt;/code&gt;.  As per comments, you could use &lt;code&gt;delete-dups&lt;/code&gt; in place of &lt;code&gt;cl-delete-duplicates&lt;/code&gt; if you want to avoid &lt;code&gt;cl-lib&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-13T14:08:30.470" LastActivityDate="2014-11-13T14:08:30.470" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3496" PostTypeId="2" ParentId="3361" CreationDate="2014-11-13T13:44:26.030" Score="5" Body="&lt;p&gt;I don't know of any built-in way to do what you want. But if you want to roll your own implementation, perhaps you could use the &lt;code&gt;window-state-get&lt;/code&gt; and &lt;code&gt;window-state-put&lt;/code&gt; functions to get an abstract representation of the window splitting configuration, modify it, and then install the modified version as the new configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a tentative implementation of this concept to do a rotation of all columns (this is not exactly what you want since it performs a circular permutation of all columns instead of moving the current one left or right): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+-------+-------+-------+    +-------+-------+-------+&#xA;|       |       |       |    |       |       |       |&#xA;|  (A)  |       |       |    |       |  (A)  |       |&#xA;|       |  (B)  |  (C)  | =&amp;gt; |  (C)  |       |  (B)  |&#xA;+-------+       |       |    |       +-------+       |&#xA;|  (D)  |       |       |    |       |  (D)  |       |&#xA;+-------+-------+-------+    +-------+-------+-------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rotate-columns ()&#xA;  &quot;Perform a circular permutation of all columns in the current frame&quot;&#xA;  (interactive)&#xA;  (let ((win-state (window-state-get (frame-root-window))))&#xA;    ;; Don't do anything if the root window is not split side-by-side&#xA;    (when (eq 'hc (nth 1 win-state))&#xA;      (let ((split-state (cddr win-state))&#xA;            header columns)&#xA;&#xA;        ;; Isolate the list of columns from the window parameters&#xA;        (mapc (lambda (param)&#xA;                (if (memq (car param) '(vc leaf))&#xA;                    ;; Column: potentially remove the (last . t) parameter&#xA;                    (push (cons (car param)&#xA;                                (remove-if&#xA;                                 (lambda (p) (eq (car p) 'last))&#xA;                                 (cdr param)))&#xA;                          columns)&#xA;                  ;; Header&#xA;                  (push param header)))&#xA;              split-state)&#xA;&#xA;        ;; Rotate the columns&#xA;        ;;   (this is where more complex behaviour should be implemented to&#xA;        ;;   detect the currently active column and move it)&#xA;        (let* ((first  (car columns))&#xA;               (rest   (cdr columns))&#xA;               (last   (car rest)))&#xA;          ;; Add the (last . t) parameter to the last column&#xA;          (setcdr last (cons '(last . t)&#xA;                             (cdr last)))&#xA;          (setq columns (cons&#xA;                         first&#xA;                         (nreverse rest))))&#xA;&#xA;        ;; Update the window state data structure...&#xA;        (setf (cddr win-state)&#xA;              (concatenate 'list&#xA;                           (nreverse header)&#xA;                           columns)))&#xA;      ;; ...and actually install it in the root window&#xA;      (delete-other-windows)&#xA;      (window-state-put win-state nil 'safe))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Building upon this stub, I started a more full-fledged library to do this: &lt;a href=&quot;https://github.com/ffevotte/colshift&quot; rel=&quot;nofollow&quot;&gt;colshift&lt;/a&gt;. It should already implement correctly the shifting operation you asked for...&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-11-17T12:55:15.013" LastActivityDate="2014-11-17T12:55:15.013" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3497" PostTypeId="1" AcceptedAnswerId="3498" CreationDate="2014-11-13T14:12:36.757" Score="14" ViewCount="1155" Body="&lt;p&gt;When I switch buffers, emacs will switch to an existing frame if the buffer is already opened there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found how to prevent that when switching with ido using :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ido-default-buffer-method 'selected-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's not enough : for exemple if there's a lisp error emacs will automatically switch to the buffer *Backtrace*, and will switch frames if it's already open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to prevent completely emacs from switching to an existent frame?&lt;/p&gt;&#xA;" OwnerUserId="2489" LastEditorUserId="253" LastEditDate="2014-11-13T14:15:33.787" LastActivityDate="2014-11-13T15:02:57.750" Title="When switching buffers, prevent emacs from automatically switching frame" Tags="|buffers|frames|ido|navigation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3498" PostTypeId="2" ParentId="3497" CreationDate="2014-11-13T15:02:57.750" Score="4" Body="&lt;p&gt;There does not appear to be an option for this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function to find a buffer &lt;em&gt;does&lt;/em&gt; allow you to specify whether to look in all frames or only in the current frame:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-buffer-window &amp;amp;optional BUFFER-OR-NAME ALL-FRAMES)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the implementation of &lt;code&gt;switch-to-buffer&lt;/code&gt; passes 0 for the &lt;code&gt;ALL-FRAMES&lt;/code&gt; argument, which means it will look in all frames. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose you could use &lt;code&gt;:around&lt;/code&gt; advice with &lt;code&gt;get-buffer-window&lt;/code&gt; to replace that argument, if you truly wanted to globally prevent this behavior... but I suspect that would break other things.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-13T15:02:57.750" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3499" PostTypeId="1" AcceptedAnswerId="3500" CreationDate="2014-11-13T15:18:35.240" Score="11" ViewCount="2039" Body="&lt;p&gt;I often have a situation where I need to apply text around a region. For HTML and simple cases there are libraries for this already. But what about the general case? I'd like to be asked what I'm gonna insert beginning and end of the region.&lt;/p&gt;&#xA;" OwnerUserId="318" LastActivityDate="2014-11-13T21:38:20.730" Title="How to wrap given text around region" Tags="|elisp|text-editing|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3500" PostTypeId="2" ParentId="3499" CreationDate="2014-11-13T15:18:35.240" Score="8" Body="&lt;p&gt;I googled around and found &lt;a href=&quot;http://www.johndcook.com/blog/2010/08/05/emacs-command-to-add-html-tags/&quot;&gt;this post by John D. Cook&lt;/a&gt;. He demonstrates how to build a simple interactive function to get HTML/XML tags around region easily. From that I modified the function to ask twice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tag-word-or-region (text-begin text-end)&#xA;  &quot;Surround current word or region with given text.&quot;&#xA;  (interactive &quot;sStart tag: \nsEnd tag: &quot;)&#xA;  (let (pos1 pos2 bds)&#xA;    (if (and transient-mark-mode mark-active)&#xA;        (progn&#xA;          (goto-char (region-end))&#xA;          (insert text-end)&#xA;          (goto-char (region-beginning))&#xA;          (insert text-begin))&#xA;      (progn&#xA;        (setq bds (bounds-of-thing-at-point 'symbol))&#xA;        (goto-char (cdr bds))&#xA;        (insert text-end)&#xA;        (goto-char (car bds))&#xA;        (insert text-begin)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More importantly, this function can be also used as an auxiliary tool, for instance when you want to bind keys to map some specific bits of text.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tag-php ()&#xA;  (interactive)&#xA;  (tag-word-or-region &quot;&amp;lt;?php &quot; &quot;?&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="318" LastActivityDate="2014-11-13T15:18:35.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3501" PostTypeId="2" ParentId="3429" CreationDate="2014-11-13T15:20:38.377" Score="1" Body="&lt;p&gt;As pointed out by @glucas this does not seem to be possible right now. A somewhat acceptable workaround for multiple file types is (for me) to set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq deft-extension &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which matches all files in the directory. Unfortunately new files then have an dot extension &lt;code&gt;.&lt;/code&gt; e.g., &lt;code&gt;todo_test.&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2521" LastActivityDate="2014-11-13T15:20:38.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3502" PostTypeId="2" ParentId="3474" CreationDate="2014-11-13T17:22:04.993" Score="2" Body="&lt;p&gt;With &lt;code&gt;(tty-type)&lt;/code&gt; being of the xterm family, &lt;code&gt;\e[1;2A&lt;/code&gt; wasn't being mapped to &lt;code&gt;S-&amp;lt;up&amp;gt;&lt;/code&gt;. The bindings introduced by &lt;code&gt;windmove-default-keybindings&lt;/code&gt; work in my non-windowed emacs setup after redefining this input as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map &quot;\e[1;2A&quot; [S-up])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2011-05/msg00211.html&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; has a description of this issue and solution.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2014-11-13T17:22:04.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3503" PostTypeId="1" CreationDate="2014-11-13T18:01:04.740" Score="1" ViewCount="134" Body="&lt;p&gt;I'm wondering why this hook never works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'gnus-group-prepared-hook 'gnus-group-list-all-groups)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Description of the hook:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is called as the very last thing after the group buffer has been generated. It may be used to move point around, for instance.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've also tried &lt;code&gt;gnus-group-mode-hook&lt;/code&gt; (specified function is called, but no effect) and &lt;code&gt;gnus-group-prepare-hook&lt;/code&gt; (never called).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected behavior: when I start Gnus via &lt;kbd&gt;M-x gnus&lt;/kbd&gt;, it should list all groups immediately.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2014-11-14T08:02:32.387" LastActivityDate="2015-04-13T10:32:55.903" Title="Why is `gnus-group-prepared-hook` never called?" Tags="|hooks|gnus|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3504" PostTypeId="2" ParentId="3499" CreationDate="2014-11-13T18:23:22.480" Score="5" Body="&lt;p&gt;I would suggest a different approach. When there is a region, by definition &lt;code&gt;point&lt;/code&gt; must be at the beginning (or end) of the region, and &lt;code&gt;mark&lt;/code&gt; will be at the end (or beginning). Which means you can enter the text you want at point, and then use &lt;code&gt;exchange-point-and-mark&lt;/code&gt;, i.e. &lt;code&gt;C-x C-x&lt;/code&gt;, to jump to the other end of the region.  Enter the second half of your wrapper and you're done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't get explicitly asked prompted for the insertion text, but I can't imagine there would be a way to accomplish the same thing with less effort.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2014-11-13T19:48:18.687" LastActivityDate="2014-11-13T19:48:18.687" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3505" PostTypeId="2" ParentId="3429" CreationDate="2014-11-13T18:52:14.457" Score="1" Body="&lt;p&gt;Building on the workaround in @ws6079's answer, you can use advice to specify a default extension for new files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example that defaults to &lt;code&gt;txt&lt;/code&gt; (using Emacs 24.4-style advice):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq deft-extension &quot;&quot;)&#xA;(defvar deft-default-extension &quot;txt&quot;)&#xA;&#xA;(defun my/deft-default-extension (orig-func &amp;amp;rest args)&#xA;  (let ((deft-extension deft-default-extension))&#xA;    (apply orig-func args)))&#xA;&#xA;(when (not (version&amp;lt; emacs-version &quot;24.4&quot;))         &#xA;  (advice-add 'deft-new-file :around #'my/deft-default-extension))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="2521" LastEditDate="2015-02-05T14:43:10.843" LastActivityDate="2015-02-05T14:43:10.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3506" PostTypeId="2" ParentId="3479" CreationDate="2014-11-13T20:07:43.710" Score="14" Body="&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; that as of 2014-10-03 20:06:34 (GMT) check of UNNUMBERED is &lt;a href=&quot;https://orgmode.org/manual/Table-of-Contents.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;built-in already&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Org uses &lt;code&gt;org-export-collect-headlines&lt;/code&gt; to collect headlines that should be in the TOC. This function already includes &lt;em&gt;two&lt;/em&gt; criteria for excluding headlines: the headline depth and whether it is a &amp;quot;footnote section&amp;quot; (*), so it is easy to add another one.&lt;/p&gt;&#xA;&lt;p&gt;See the modified version of &lt;code&gt;org-export-collect-headlines&lt;/code&gt; below. This version makes it possible to prevent a headline from showing up in the TOC by setting the &lt;code&gt;NOTOC&lt;/code&gt; property.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Section 1: shows up in the TOC&#xA;&#xA;* Section 2: modified Org code (not in the TOC)&#xA;  :PROPERTIES:&#xA;  :NOTOC:    t&#xA;  :END:&#xA;&#xA;  This is the modified =org-export-collect-headlines=:&#xA;&#xA;  #+BEGIN_SRC elisp&#xA;  (defun org-export-collect-headlines (info &amp;amp;optional n)&#xA;    &amp;quot;Collect headlines in order to build a table of contents. [...]&#xA;&#xA;  Return a list of all exportable headlines as parsed elements.&#xA;  Footnote sections, if any, will be ignored.&amp;quot;&#xA;    (let ((limit (plist-get info :headline-levels)))&#xA;      (setq n (if (wholenump n) (min n limit) limit))&#xA;      (org-element-map (plist-get info :parse-tree) 'headline&#xA;        #'(lambda (headline)&#xA;            (unless (or (org-element-property :NOTOC headline)               ; new condition&#xA;                        (org-element-property :footnote-section-p headline)) ; old condition&#xA;              (let ((level (org-export-get-relative-level headline info)))&#xA;                (and (&amp;lt;= level n) headline))))&#xA;        info)))&#xA;  #+END_SRC&#xA;&#xA;** Sub-section&#xA;   This shows up in the TOC: property inheritance is off by default.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;(*) I don't know what &amp;quot;footnote sections&amp;quot; are, though.&lt;/p&gt;&#xA;&lt;p&gt;This works for export backends that build the TOC manually. LaTeX, Beamer, and Texinfo backends don't.&lt;/p&gt;&#xA;&lt;p&gt;By adding this advice to &lt;code&gt;org-export-numbered-headline-p&lt;/code&gt; one can make headlines with the &lt;code&gt;UNNUMBERED&lt;/code&gt; property export as &lt;code&gt;\section*{...}&lt;/code&gt;, excluding them from TOC when exporting to  LaTeX and Beamer:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-export-numbered-headline-p :around&#xA;            (lambda (orig headline info)&#xA;              (and (funcall orig headline info)&#xA;                   (not (org-element-property :UNNUMBERED headline)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="32139" LastEditDate="2022-04-22T11:49:02.980" LastActivityDate="2022-04-22T11:49:02.980" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="3508" PostTypeId="2" ParentId="3358" CreationDate="2014-11-13T20:48:03.683" Score="14" Body="&lt;p&gt;Since @shosti pointed out that Evil considers deviation from Vim behavior as bugs, I filed a bug and one of the authors of Evil added a new possible value for &lt;code&gt;evil-want-fine-undo&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-want-fine-undo 'fine)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setting, you get new undo units when moving the cursor in insert mode, but replace operations are undone in one step.  As far as I can tell this is consistent with Vim.  See &lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/444/evils-undo-granularity-is-too-coarse&quot;&gt;here&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2014-11-13T20:48:03.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3509" PostTypeId="1" AcceptedAnswerId="3511" CreationDate="2014-11-13T21:27:38.507" Score="4" ViewCount="486" Body="&lt;p&gt;At work, I have a dual-monitor setup and, naturally, both of them are fullscreened to emacs.  I have bindings to switch between the two frames with &lt;code&gt;other-frame&lt;/code&gt;, but sometimes I just want particular content on the screen directly in front of me.  (One is off to the side.)  How can I rotate window configurations among frames (in this case, effectively swapping them)?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-13T22:27:41.730" LastActivityDate="2014-11-14T03:14:27.503" Title="How can I rotate window configurations among frames?" Tags="|window|frames|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3510" PostTypeId="2" ParentId="3499" CreationDate="2014-11-13T21:38:20.730" Score="3" Body="&lt;p&gt;Just for the sake of variety: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to do this with some arbitrary start and end text would be to use &lt;code&gt;replace-regexp&lt;/code&gt; on the region: match &lt;code&gt;.+&lt;/code&gt; and replace with &lt;code&gt;before \&amp;amp; after&lt;/code&gt;, or whatever text you want to use for &lt;code&gt;before&lt;/code&gt; and &lt;code&gt;after&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could write a command do to this, but I'm thinking of a case where in a given file you want to apply the same start/end text in multiple places. You can record a macro or just use minibuffer history to repeat on another region. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course if the text you want to wrap can be expressed as a regular expression then you won't even need to select a region and can do a &lt;code&gt;query-replace-regexp&lt;/code&gt; on the buffer, but presumably the text you want to wrap is not that consistent.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-13T21:38:20.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3511" PostTypeId="2" ParentId="3509" CreationDate="2014-11-13T21:43:51.883" Score="6" Body="&lt;p&gt;Try swapping window states of root windows of the frames in question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun swap-frames (a b)&#xA;  &quot;Swap window states of root windows of two frames.&quot;&#xA;  (let ((state-a (window-state-get (frame-root-window a)))&#xA;        (state-b (window-state-get (frame-root-window b))))&#xA;  (window-state-put state-a (frame-root-window b))&#xA;  (window-state-put state-b (frame-root-window a))))&#xA;&#xA;(defun swap-two-frames ()&#xA;  &quot;Swap states of the first two frames in frame-list.&quot;&#xA;  (interactive)&#xA;  (swap-frames (nth 0 (frame-list)) (nth 1 (frame-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's one way to generalize this to implement cyclic rotation of window states.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun apply-window-states (states windows)&#xA;  &quot;Apply states in STATES to all WINDOWS by calling&#xA;`window-state-put'.&quot;&#xA;  (when (&amp;lt; (length states) (length windows))&#xA;    (error &quot;not enough window states to apply to all windows&quot;))&#xA;  (when windows&#xA;    (window-state-put (car states) (car windows))&#xA;    (apply-window-states (cdr states) (cdr windows))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This helper function just calls &lt;code&gt;window-state-put&lt;/code&gt; for all pairs of provided &lt;code&gt;states&lt;/code&gt; and &lt;code&gt;windows&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There must be a better way to do this. Does Emacs Lisp have &lt;code&gt;zip&lt;/code&gt;? If it does, we could just map over the result of zipping lists of &lt;code&gt;states&lt;/code&gt; and &lt;code&gt;windows&lt;/code&gt; and remove this function.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can define&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rotate-frames (arg)&#xA;  &quot;Cyclically rotate window states through all frames.&#xA;Use the prefix argument to switch direction.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((windows (mapcar (lambda (f) (frame-root-window f)) (frame-list)))&#xA;         (states (mapcar (lambda (w) (window-state-get w)) windows)))&#xA;    (if (not arg)&#xA;        ;; cycle in one direction&#xA;        (progn&#xA;          (apply-window-states (cdr states) (butlast windows))&#xA;          (window-state-put (car states) (car (last windows))))&#xA;      ;; cycle in the other direction&#xA;      (apply-window-states (butlast states) (cdr windows))&#xA;      (window-state-put (car (last states)) (car windows)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, set some key bindings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;S-&amp;lt;right&amp;gt;&quot;) #'rotate-frames)&#xA;(global-set-key (kbd &quot;S-&amp;lt;left&amp;gt;&quot;) (lambda () (interactive) (rotate-frames t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I like it. I might actually use this myself. :-)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-14T03:14:27.503" LastActivityDate="2014-11-14T03:14:27.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3512" PostTypeId="2" ParentId="3374" CreationDate="2014-11-13T22:19:34.793" Score="16" Body="&lt;p&gt;First, I believe org can use &lt;a href=&quot;https://www.emacswiki.org/emacs/Htmlize&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;htmlize&lt;/code&gt;&lt;/a&gt; to automatically color your source code blocks according to your theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out &lt;a href=&quot;https://web.archive.org/web/20130817065759/http://definitelyaplug.b0.cx/post/custom-inlined-css-in-org-mode-html-export/&quot; rel=&quot;noreferrer&quot;&gt;http://definitelyaplug.b0.cx/post/custom-inlined-css-in-org-mode-html-export/&lt;/a&gt;. It has a great example of how to use the &lt;code&gt;org-export-before-processing-hook&lt;/code&gt; to throw custom css onto an org document before an html export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code in case the site goes down:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here on an html export, org will look for a file called styles.css in the current directory or a default file in the .emacs.d directory and inject that css into the document. This is nice but not perfect for your use case.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-inline-css-hook (exporter)&#xA;  &quot;Insert custom inline css&quot;&#xA;  (when (eq exporter 'html)&#xA;    (let* ((dir (ignore-errors (file-name-directory (buffer-file-name))))&#xA;           (path (concat dir &quot;style.css&quot;))&#xA;           (homestyle (or (null dir) (null (file-exists-p path))))&#xA;           (final (if homestyle &quot;~/.emacs.d/org-style.css&quot; path)))&#xA;      (setq org-html-head-include-default-style nil)&#xA;      (setq org-html-head (concat&#xA;                           &quot;&amp;lt;style type=\&quot;text/css\&quot;&amp;gt;\n&quot;&#xA;                           &quot;&amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/\n&quot;&#xA;                           (with-temp-buffer&#xA;                             (insert-file-contents final)&#xA;                             (buffer-string))&#xA;                           &quot;/*]]&amp;gt;*/--&amp;gt;\n&quot;&#xA;                           &quot;&amp;lt;/style&amp;gt;\n&quot;)))))&#xA;&#xA;(add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can customize this in a few ways to make it work how you'd like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way would be to manually build the css based on your theme and insert that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a modified version that sets the background of &lt;code&gt;pre.src&lt;/code&gt; to the hex value of the default faces :background property.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-inline-css-hook (exporter)&#xA;  &quot;Insert custom inline css&quot;&#xA;  (when (eq exporter 'html)&#xA;    (let ((my-pre-bg (face-background 'default)))&#xA;      (setq org-html-head-include-default-style nil)&#xA;      (setq org-html-head&#xA;            (format &quot;&amp;lt;style type=\&quot;text/css\&quot;&amp;gt;\n pre.src { background-color: %s;}&amp;lt;/style&amp;gt;\n&quot; my-pre-bg)))))&#xA;&#xA;(add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="5254" LastEditDate="2016-09-17T22:47:07.480" LastActivityDate="2016-09-17T22:47:07.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3513" PostTypeId="1" AcceptedAnswerId="3516" CreationDate="2014-11-13T22:19:45.193" Score="1" ViewCount="500" Body="&lt;p&gt;Whenever I currently do &lt;code&gt;M-x slime&lt;/code&gt;, it creates a split buffer, with SLIME going in the bottom half. This is not really very desirable - I'd much rather SLIME appeared in a separate frame, and kept its REPL there. Is there a way I can make it so that when I do &lt;code&gt;M-x slime&lt;/code&gt;, it will create a new frame, and open the SLIME REPL there?&lt;/p&gt;&#xA;" OwnerUserId="561" LastEditorUserId="115" LastEditDate="2014-11-14T13:20:58.243" LastActivityDate="2014-11-14T13:20:58.243" Title="Starting SLIME in a pop-up frame" Tags="|window|frames|repl|slime|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3514" PostTypeId="2" ParentId="2951" CreationDate="2014-11-13T22:23:45.843" Score="17" Body="&lt;p&gt;You can do this most easily using org-babel's &lt;a href=&quot;http://orgmode.org/manual/Noweb-reference-syntax.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;noweb reference syntax&lt;/a&gt; for literate programming.  Here is an example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Initialization block containing function definition&#xA;#+NAME: init_block&#xA;#+BEGIN_SRC python&#xA;  constant=19&#xA;  def some_function(x):&#xA;    return constant * x&#xA;#+END_SRC&#xA;&#xA;* Call the function on an integer&#xA;#+BEGIN_SRC python :noweb yes &#xA;  &amp;lt;&amp;lt;init_block&amp;gt;&amp;gt;&#xA;  return some_function(13)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 247&#xA;&#xA;* Call the function on a string&#xA;:PROPERTIES:&#xA;:noweb:    yes&#xA;:END:&#xA;&#xA;#+BEGIN_SRC python :noweb yes &#xA;  &amp;lt;&amp;lt;init_block&amp;gt;&amp;gt;&#xA;  return some_function('abc')&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="40926" LastEditDate="2023-12-01T08:29:11.400" LastActivityDate="2023-12-01T08:29:11.400" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="3515" PostTypeId="2" ParentId="2666" CreationDate="2014-11-13T22:58:01.510" Score="5" Body="&lt;p&gt;I think the problem is simply that you are using two different ways of specifying the language of the source blocks: &lt;code&gt;emacs-lisp&lt;/code&gt; for some and &lt;code&gt;elisp&lt;/code&gt; for others.  It seems that all the &lt;code&gt;elisp&lt;/code&gt; blocks are tangled before all the &lt;code&gt;emacs-lisp&lt;/code&gt; ones (alphabetical order?).  If you consistently use one or the other, then the order of the blocks in your file is respected: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+PROPERTY: tangle &quot;init.el&quot;&#xA;#+PROPERTY: noweb yes&#xA;&#xA;* A&#xA;#+begin_src emacs-lisp&#xA;; initialization code&#xA;; this *must* come first&#xA;#+end_src&#xA;&#xA;* B&#xA;#+begin_src emacs-lisp&#xA;&amp;lt;&amp;lt;support-functions&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&#xA;** Cool Stuff&#xA;#+begin_src emacs-lisp :noweb-ref &quot;support-functions&quot; :tangle no&#xA;(message &quot;willkommen&quot;)&#xA;#+end_src&#xA;&#xA;** Test&#xA;#+begin_src emacs-lisp :noweb-ref &quot;support-functions&quot; :tangle no&#xA;(message &quot;hi&quot;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;tangles to&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;; initialization code&#xA;; this *must* come first&#xA;&#xA;(message &quot;willkommen&quot;)&#xA;(message &quot;hi&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="10633" LastEditDate="2015-12-31T07:38:16.840" LastActivityDate="2015-12-31T07:38:16.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3516" PostTypeId="2" ParentId="3513" CreationDate="2014-11-13T22:58:40.500" Score="2" Body="&lt;p&gt;You can achieve this by adjusting the value of &lt;code&gt;display-buffer-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-buffer-alist&#xA;      (quote ((&quot;\\*inferior-lisp\\*&quot; display-buffer-pop-up-frame&#xA;         (nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This setting tells Emacs that a buffer with the name matching the regular expression &quot;&lt;code&gt;\*inferior-lisp\*&lt;/code&gt;&quot; should be displayed in a new (pop-up) frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can also customize this variable.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-13T22:58:40.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3517" PostTypeId="2" ParentId="3480" CreationDate="2014-11-14T00:35:21.670" Score="3" Body="&lt;p&gt;The error message tells you where the error is: position 23740.  You can go there with &lt;code&gt;goto-char&lt;/code&gt;.  Doing &lt;code&gt;M-x goto-char 23740&lt;/code&gt; will take you to the error.  org-mode's folding may make it hard to see what's going on, so switching to &lt;code&gt;fundamental-mode&lt;/code&gt; (with &lt;code&gt;M-x fundamental-mode&lt;/code&gt;) first may help you see what's going on.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2014-11-14T11:48:01.803" LastActivityDate="2014-11-14T11:48:01.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3518" PostTypeId="1" AcceptedAnswerId="3522" CreationDate="2014-11-14T00:56:25.203" Score="5" ViewCount="1027" Body="&lt;p&gt;By analogy to the &lt;code&gt;mode-line-inactive&lt;/code&gt; face, I'd like to dim the header line for inactive windows.  But I can't find a &quot;header-line-inactive&quot; face, nor can I find an appropriate hook to modify.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following in my init file, so every window gets a header line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default header-line-format &#xA;              '(&quot;%e&quot;&#xA;                mode-line-front-space&#xA;                mode-line-buffer-identification&#xA;                (vc-mode vc-mode)&#xA;                mode-line-end-spaces))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="372" LastEditorUserId="372" LastEditDate="2014-11-14T06:35:00.023" LastActivityDate="2014-11-14T18:42:25.290" Title="How should I dim the header line of inactive windows?" Tags="|window|header-line|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3519" PostTypeId="2" ParentId="3503" CreationDate="2014-11-14T01:02:35.313" Score="0" Body="&lt;p&gt;Your answer is in the question.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is called as the very last thing after the group buffer has been generated.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, &lt;code&gt;gnus-group-list-all-groups&lt;/code&gt; essentially regenerates the group buffer. This means that the hook will be called again when &lt;code&gt;gnus-group-list-all-groups&lt;/code&gt; is about to finish. But &lt;code&gt;gnus-group-list-all-groups&lt;/code&gt; is contained in the hook, so it will run again and again and again...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eventually, Emacs throws a max-lisp-depth error (which you should find somewhere in your Messages buffer) and the function quits.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-14T01:02:35.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3520" PostTypeId="1" CreationDate="2014-11-14T01:21:16.360" Score="4" ViewCount="541" Body="&lt;p&gt;The new version of &lt;a href=&quot;https://wiki.gnome.org/Apps/Videos&quot; rel=&quot;nofollow&quot;&gt;Totem&lt;/a&gt; removed the playlist feature, so I'm looking for a simple way to choose 2 or 3 podcasts from a selection of 12 or so recently cached to a &lt;code&gt;~/Podcasts&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/dbrock/bongo&quot; rel=&quot;nofollow&quot;&gt;bongo&lt;/a&gt; music player looks simpler than &lt;a href=&quot;https://www.gnu.org/software/emms/&quot; rel=&quot;nofollow&quot;&gt;EMMS&lt;/a&gt;, and although like EMMS it doesn't support sort-by-date in the library, it does hook into dired so I can sort most-recently-downloaded to the top in there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I can't get it to play tracks continuously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I queue a track to the playlist by pressing &lt;kbd&gt;e&lt;/kbd&gt; in a dired buffer. I then press &lt;kbd&gt;e&lt;/kbd&gt; with the point on another file in the dired buffer. There are now two tracks queued in the playlist buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With my point on the first track I press &lt;kbd&gt;RET&lt;/kbd&gt; and the track starts playing. When it ends, the audio stops. It does not start playing the next track in the playlist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;bongo-next-action&lt;/code&gt; is the default &lt;code&gt;bongo-play-next-or-stop&lt;/code&gt;, but I've tried setting it to &lt;code&gt;bongo-play-next&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default bongo-next-action #'bongo-play-next)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;kbd&gt;C-u C-c C-n&lt;/kbd&gt; but that seems to makes no difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make Bongo play more than one track without intervention?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.4 on Linux, and mpg321.&lt;/p&gt;&#xA;" OwnerUserId="2552" LastEditorUserId="105" LastEditDate="2015-03-27T20:35:45.470" LastActivityDate="2016-12-25T17:46:22.137" Title="Bongo music player won't play next track in sequence" Tags="|cycling|bongo|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3521" PostTypeId="2" ParentId="3518" CreationDate="2014-11-14T01:25:10.197" Score="1" Body="&lt;p&gt;As a fairly incomplete answer (I'm in the bus so I'll flesh it out in a little while.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the &lt;code&gt;buffer-list-update-hook&lt;/code&gt;&#xA;This hook runs whenever the buffer list changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then determine which buffer is now current and update the &lt;code&gt;header-line-format&lt;/code&gt; accordingly.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2014-11-14T01:25:10.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3522" PostTypeId="2" ParentId="3518" CreationDate="2014-11-14T01:29:37.013" Score="7" Body="&lt;p&gt;You can set the face of the header line by setting properties of the text in &lt;code&gt;header-line-format&lt;/code&gt;, but you would need to update &lt;code&gt;header-line-format&lt;/code&gt; on every window switch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned by @Slomojo, &lt;code&gt;buffer-list-update-hook&lt;/code&gt; is the hook to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can start with this draft of a hook and adjust the format string and text properties:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-update-header ()&#xA;  (mapc&#xA;   (lambda (window)&#xA;     (with-current-buffer (window-buffer window)&#xA;       (if (eq window (selected-window))&#xA;           (setq header-line-format (propertize &quot;selected&quot; 'face 'mode-line))&#xA;         (setq header-line-format (propertize &quot;inactive&quot; 'face 'mode-line-inactive)))))&#xA;   (window-list)))&#xA;&#xA;(add-hook 'buffer-list-update-hook #'my-update-header)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update Nov 14, 2014:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an extension of the idea used above to arbitrary header formats:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-update-header ()&#xA;  (mapc&#xA;   (lambda (window)&#xA;     (with-current-buffer (window-buffer window)&#xA;       ;; don't mess with buffers that don't have a header line&#xA;       (when header-line-format&#xA;         (let ((original-format (get 'header-line-format 'original))&#xA;               (inactive-face 'warning)) ; change this to your favorite inactive header line face&#xA;           ;; if we didn't save original format yet, do it now&#xA;           (when (not original-format)&#xA;             (put 'header-line-format 'original header-line-format)&#xA;             (setq original-format header-line-format))&#xA;           ;; check if this window is selected, set faces accordingly&#xA;           (if (eq window (selected-window))&#xA;               (setq header-line-format original-format)&#xA;             (setq header-line-format `(:propertize ,original-format face ,inactive-face)))))))&#xA;   (window-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I save the original value of &lt;code&gt;header-line-format&lt;/code&gt; as a property of &lt;code&gt;header-line-format&lt;/code&gt; so it can be restored later. To change the face of inactive header lines I use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html#Mode-Line-Data&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;:propertize&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This breaks if a buffer is displayed by more than one window, and I am convinced that there is no way to do this right: you can't set different buffer-local values of &lt;code&gt;header-line-format&lt;/code&gt; in the selected window and the rest of windows displaying the same buffer. (The mode line gets special treatment in the Emacs redisplay code implemented in C.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-14T18:42:25.290" LastActivityDate="2014-11-14T18:42:25.290" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3523" PostTypeId="2" ParentId="2955" CreationDate="2014-11-14T03:47:04.330" Score="22" Body="&lt;p&gt;I'm not sure &lt;em&gt;why&lt;/em&gt; the background color is there either, but it seems to be controlled by the function &lt;code&gt;shr-color-check&lt;/code&gt;, which is supposed to check that the contrast between the fg and bg is sufficient for the text to be visible.  I agree that the readability is not very good in your example.  Luckily, there are some variables that can be tweaked: &lt;code&gt;shr-color-visible-luminance-min&lt;/code&gt; and &lt;code&gt;shr-color-visible-distance-min&lt;/code&gt;.  I tried setting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shr-color-visible-luminance-min 70)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the results are much more readable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cYFzY.png&quot; alt=&quot;Screenshot of eww window with better contrast&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2014-11-14T03:47:04.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3526" PostTypeId="2" ParentId="3503" CreationDate="2014-11-14T08:44:04.557" Score="1" Body="&lt;p&gt;I'm still unable to make &lt;code&gt;gnus-group-prepared-hook&lt;/code&gt; work. Empty groups are not displayed on start of Gnus and I don't get any error messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have succeeded in my initial intention to display all groups automatically. In order to achieve this behavior, one should set value of variable &lt;code&gt;gnus-permanently-visible-groups&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Description of this variable:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Groups matching this regexp will always be listed in the group buffer, whether they are empty or not.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, if you want to display all groups on start of Gnus, add this line to your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-permanently-visible-groups &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2014-11-14T08:54:01.387" LastActivityDate="2014-11-14T08:54:01.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3527" PostTypeId="2" ParentId="3458" CreationDate="2014-11-14T09:46:27.900" Score="-1" Body="&lt;p&gt;You can also decide to use &lt;a href=&quot;http://tapoueh.org/emacs/switch-window.html&quot; rel=&quot;nofollow&quot;&gt;switch-window&lt;/a&gt; as a visual replacement for &lt;code&gt;C-x o&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2014-11-14T09:46:27.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3528" PostTypeId="1" AcceptedAnswerId="3530" CreationDate="2014-11-14T10:46:13.923" Score="0" ViewCount="348" Body="&lt;p&gt;When working in LaTeX (specifically, with AUCTeX), I want to bind the following functionality to the &lt;code&gt;C-{&lt;/code&gt; and &lt;code&gt;C-}&lt;/code&gt; keys:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-{&lt;/code&gt;: insert &lt;code&gt;\begingroup&lt;/code&gt; followed by a newline&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-}&lt;/code&gt;: insert &lt;code&gt;\endgroup&lt;/code&gt; followed by a newline&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As per &lt;a href=&quot;https://tex.stackexchange.com/questions/212156/add-key-binding-to-emacs-in-auctex-does-not-fully-work/212160#212160&quot;&gt;this thread on LaTeX Stack Exchange&lt;/a&gt; I've tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;latex&quot;&#xA;  '(progn&#xA;     (define-key LaTeX-mode-map (kbd &quot;C-{&quot;) &quot;\\begingroup\n&quot;)&#xA;     (define-key LaTeX-mode-map (kbd &quot;C-}&quot;) &quot;\\endgroup\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't work, however, and if I try &lt;code&gt;C-h k C-}&lt;/code&gt; nothing happens.  How can I make my keybindings work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tested the above behavior in at least three modes, Emacs-Lisp, LaTeX (AucTex) and XML mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using GNU Emacs 24 in Ubuntu 14.04.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I completely emptied my init file and then restarted emacs. The odd behavior persists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;All&lt;/em&gt; the proposed solutions, including my original one, has started to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am without a clue.&lt;/p&gt;&#xA;" OwnerUserId="2557" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2014-11-14T12:08:03.577" Title="How can I bind the Ctrl-} key for a LaTeX command?" Tags="|key-bindings|latex|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3529" PostTypeId="2" ParentId="3528" CreationDate="2014-11-14T11:06:20.687" Score="1" Body="&lt;p&gt;If you just want to insert &lt;code&gt;\endgroup RET&lt;/code&gt; into buffer, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key LaTeX-mode-map (kbd &quot;C-}&quot;)&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (insert &quot;\\endgroup\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You also can do similar thing for &lt;kbd&gt;C-{&lt;/kbd&gt; and &lt;code&gt;\begingroup RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2014-11-14T11:06:20.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3530" PostTypeId="2" ParentId="3528" CreationDate="2014-11-14T11:11:41.547" Score="3" Body="&lt;p&gt;It's much more common to bind a key to a &lt;em&gt;command&lt;/em&gt; rather than a string, although, as @Malabarba notes in the comment, you actually can bind a key to a string which is self-inserted (news to me, but it works!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Functions.html&quot; rel=&quot;nofollow&quot;&gt;define two new functions&lt;/a&gt; (note the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;interactive&lt;/code&gt;&lt;/a&gt; part, which makes them commands):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-begin-group ()&#xA;  &quot;Inserts \&quot;\\begingroup\&quot; followed by a newline.&quot;&#xA;  (interactive)&#xA;  (insert &quot;\\begingroup\n&quot;))&#xA;&#xA;(defun insert-end-group ()&#xA;  &quot;Inserts \&quot;\\endgroup\&quot; followed by a newline.&quot;&#xA;  (interactive)&#xA;  (insert &quot;\\endgroup\n&quot;))&#xA;&#xA;(define-key LaTeX-mode-map (kbd &quot;C-{&quot;) 'insert-begin-group)&#xA;(define-key LaTeX-mode-map (kbd &quot;C-}&quot;) 'insert-end-group)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To make sure they get bound after you load AUCTeX, you can adjust the code you were trying earlier:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;latex&quot;&#xA;  '(progn&#xA;     (define-key LaTeX-mode-map (kbd &quot;C-{&quot;) 'insert-begin-group)&#xA;     (define-key LaTeX-mode-map (kbd &quot;C-}&quot;) 'insert-end-group)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-14T11:32:10.803" LastActivityDate="2014-11-14T11:32:10.803" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3531" PostTypeId="1" AcceptedAnswerId="3536" CreationDate="2014-11-14T11:24:52.070" Score="5" ViewCount="203" Body="&lt;p&gt;I am writing &lt;a href=&quot;https://github.com/vermiculus/stack-mode/&quot; rel=&quot;nofollow&quot;&gt;a major-mode&lt;/a&gt; which displays a list to the user. It is similar to &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/tabulated-list-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;tabulated-list-mode&lt;/code&gt;&lt;/a&gt;, except each entry takes up 3 lines, as opposed to just one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  0   0 Ctrl-} key in emacs &#xA;        5m ago [keymap] &#xA;&#xA;  6   1 Set the background of org-exported &amp;lt;code&amp;gt; blocks according to theme &#xA;        40m ago [org-mode] [org-export] [html] &#xA;&#xA;  7  10 How to switch between windows quickly? &#xA;        79m ago [window] [navigation] &#xA;&#xA;  3   1 Org-mode: Exclude specific headlines from TOC when exporting &#xA;        96m ago [org-mode] [org-export] &#xA; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've defined all movement keys so that the user navigates by entry&#xA;instead of by line, but there's one thing I can't quite fix. Whenever&#xA;the window is split below or above, there's a decent chance that the first line in the (original) window will &lt;em&gt;not&lt;/em&gt; be the first line of an entry. This happens because the buffer is scrolled to make sure point is still visible after the split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of what I might get when splitting (note this can&#xA;happen even if I ensure the size is a multiple of 3).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        5m ago [keymap] &#xA;&#xA;  6   1 Set the background of org-exported &amp;lt;code&amp;gt; blocks according to theme &#xA;        40m ago [org-mode] [org-export] [html] &#xA;&#xA;  7  10 How to switch between windows quickly? &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I would like this buffer to reposition itself, every time the window&#xA;  size changes, so as to ensure the &lt;em&gt;first visible line is always a&#xA;  (multiple of 3) minus 1&lt;/em&gt;.&lt;/strong&gt;&lt;br&gt;&#xA;&lt;em&gt;(Whether it scrolls up or down is irrelevant, as long as &lt;code&gt;point&lt;/code&gt; is not moved.)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the example above should display something like.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  0   0 Ctrl-} key in emacs &#xA;        5m ago [keymap] &#xA;&#xA;  6   1 Set the background of org-exported &amp;lt;code&amp;gt; blocks according to theme &#xA;        40m ago [org-mode] [org-export] [html] &#xA; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT:&lt;/em&gt; Note, I'd like to scroll the window as little as possible---always 1 or 2 lines.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-14T13:10:57.580" LastActivityDate="2015-01-15T10:48:38.510" Title="How to ensure lines are always displayed in groups of 3?" Tags="|window|hooks|scrolling|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3532" PostTypeId="2" ParentId="3528" CreationDate="2014-11-14T11:56:40.737" Score="1" Body="&lt;p&gt;[ I am posting an answer, as I do not have enough reputation to post a comment. Feel free to delete this answer and turn it into a comment to the question. ]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you are on Ubuntu, you can use the command line utility &lt;code&gt;xev&lt;/code&gt; to test what X11 spits out when you press a certain key. If the key works with xev, it should be your window manager intercepting the key press, as @Malabarba already pointed out.&lt;/p&gt;&#xA;" OwnerUserId="2523" LastActivityDate="2014-11-14T11:56:40.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3533" PostTypeId="1" CreationDate="2014-11-14T12:34:26.590" Score="2" ViewCount="772" Body="&lt;p&gt;I want to make Emacs aware of the &lt;em&gt;language&lt;/em&gt; I input -- in my case, Arabic, English, German -- so that I can use different fonts for each of them.  So, for example, I'd like Emacs to use the following fonts when I'm entering text in the following languages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Arabic  - DejaVu Sans Mono 14  &#xA;English - Consolas 11  &#xA;German  - Consolas 12  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How can I set this up in my init file?&lt;/li&gt;&#xA;&lt;li&gt;Where do I find the exact names of languages in Emacs to be recognized by the code?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Side note: I'm new to Emacs and am just starting to learn &lt;code&gt;elisp&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Clarifying to follow-up on comments:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm using Windows.  Ideally, I'd like Emacs to understand what language I'm using based on the Language Bar.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br&gt;&#xA;A better approach to this problem is posted &lt;a href=&quot;https://emacs.stackexchange.com/questions/5519/how-to-assign-a-certain-font-for-each-text-input-method-in-emacs-24/5525#5525&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="105" LastEditDate="2017-07-20T21:58:14.163" LastActivityDate="2017-07-20T21:58:14.163" Title="How to use different fonts based on the language of the currently active keyboard layout?" Tags="|microsoft-windows|fonts|" AnswerCount="1" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="3534" PostTypeId="2" ParentId="3531" CreationDate="2014-11-14T12:40:22.227" Score="3" Body="&lt;p&gt;The following function checks a window to see if it's top line is a multiple of three, and scrolls if needed to make it so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun first-window-line-in-threes (&amp;amp;optional window)&#xA;  &quot;Make sure that the first line in the window is a multiple of&#xA;three (0-based rather than 1-based).  Scroll if necessary, but&#xA;leave point where it is.&quot;&#xA;  (interactive)&#xA;  (let ((offset (mod (1- (line-number-at-pos (window-start window))) 3)))&#xA;    (unless (zerop offset)&#xA;      (scroll-down offset)&#xA;      (forward-line offset))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Hooks.html&quot; rel=&quot;nofollow&quot;&gt;relevant hooks/functions&lt;/a&gt; are &lt;code&gt;window-configuration-change-hook&lt;/code&gt; and &lt;code&gt;window-size-change-functions&lt;/code&gt;.  Using the former almost works, but it seems to respond to curious events like minibuffer resizing.  The latter requires a bit of fiddling, and I hadn't quite gotten it right before dashing out the door.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-14T12:40:22.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3535" PostTypeId="1" AcceptedAnswerId="3542" CreationDate="2014-11-14T12:47:47.413" Score="11" ViewCount="418" Body="&lt;p&gt;It's quite common that I'll look through a command's documentation&#xA;with &lt;code&gt;C-h f&lt;/code&gt;, and then invoke the command with &lt;code&gt;M-x&lt;/code&gt; immediately&#xA;afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, the shortest way I've found to “invoke the last view&#xA;command” is to copy its name (either from the help buffer or from the&#xA;history) and yank it into &lt;code&gt;M-x&lt;/code&gt;'s minibuffer prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would really like is for command names given to&#xA;&lt;code&gt;describe-function&lt;/code&gt; to be part of the history of&#xA;&lt;code&gt;execute-extended-command&lt;/code&gt;. So I could just do &lt;code&gt;M-x M-p RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the easiest way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2018-07-07T14:49:08.617" Title="How to make M-x and C-h f share the history?" Tags="|documentation|m-x|history-variables|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3536" PostTypeId="2" ParentId="3531" CreationDate="2014-11-14T12:53:51.520" Score="4" Body="&lt;p&gt;Here is an alternative function that respects the major mode and works with &lt;code&gt;window-size-change-functions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun reposition-buffer (frame)&#xA;  (when (eq major-mode 'fundamental-mode) ; Substitute name of your major-mode here&#xA;    (save-excursion&#xA;      (let* ((current-line (line-number-at-pos (point)))&#xA;             (offset (mod current-line 3)))&#xA;        (cond ((= offset 0) (previous-line 2))&#xA;              ((= offset 2) (previous-line 1))&#xA;              (t nil))&#xA;        (recenter-top-bottom 0)))))&#xA;&#xA;(add-hook 'window-size-change-functions 'reposition-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The logic is as follows (&lt;code&gt;&amp;lt;n&amp;gt;&lt;/code&gt; denotes a line number):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;1&amp;gt; 0   0 Ctrl-} key in emacs &#xA;&amp;lt;2&amp;gt;       5m ago [keymap] &#xA;&amp;lt;3&amp;gt;&#xA;&amp;lt;4&amp;gt; 6   1 Set the background of org-exported &amp;lt;code&amp;gt; blocks according to theme &#xA;&amp;lt;5&amp;gt;       40m ago [org-mode] [org-export] [html]&#xA;&amp;lt;6&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If point is in line &lt;code&gt;1&lt;/code&gt; or &lt;code&gt;4&lt;/code&gt; (&lt;code&gt;n modulo 3 == 1&lt;/code&gt;) , we don't have to move, as each of these lines starts a new entry.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If point is in line &lt;code&gt;2&lt;/code&gt; or &lt;code&gt;5&lt;/code&gt; (&lt;code&gt;n modulo 3 == 2&lt;/code&gt;), we have to move up &lt;em&gt;one&lt;/em&gt; line to get to the beginning of the corresponding entry.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If point is in line &lt;code&gt;3&lt;/code&gt; or &lt;code&gt;6&lt;/code&gt; (&lt;code&gt;n modulo 3 == 0&lt;/code&gt;), we have to move up &lt;em&gt;two&lt;/em&gt;&#xA;lines to get to the beginning of the corresponding entry.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As a last step, we recenter the current line to the top of the window.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-15T10:48:38.510" LastActivityDate="2015-01-15T10:48:38.510" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3537" PostTypeId="1" AcceptedAnswerId="3539" CreationDate="2014-11-14T13:13:39.807" Score="11" ViewCount="1614" Body="&lt;p&gt;While writing RoR code I often need to run drop into a &lt;a href=&quot;https://github.com/pry/pry&quot;&gt;pry&lt;/a&gt; session or a debugger. So I place my &lt;code&gt;binding.pry&lt;/code&gt; line in the implementation code and run my spec(s). That works fine if I run the specs in a terminal but from inside Emacs, I get a messy output and it's very hard to use the debugger/pry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are you guys doing that ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yJuLY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="94" LastEditorUserId="253" LastEditDate="2014-11-16T19:10:24.783" LastActivityDate="2014-11-16T19:10:24.783" Title="How do you run pry from emacs" Tags="|pry|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3538" PostTypeId="2" ParentId="3535" CreationDate="2014-11-14T13:23:29.243" Score="8" Body="&lt;p&gt;I can add not an exact answer to your question, but a workflow that eliminates the need for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;smex&lt;/code&gt; instead of &lt;code&gt;execute-extended-command&lt;/code&gt;.&#xA;Once in the minibuffer of &lt;code&gt;smex&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;RET&lt;/kbd&gt; calls &lt;code&gt;execute-extended-command&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h f&lt;/kbd&gt; calls &lt;code&gt;smex-describe-function&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-.&lt;/kbd&gt; calls &lt;code&gt;smex-find-function&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I don't like the default bindings, so I've customized them:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'smex&#xA;  `(defun smex-prepare-ido-bindings ()&#xA;     (define-key ido-completion-map (kbd &quot;TAB&quot;) 'minibuffer-complete)&#xA;     (define-key ido-completion-map (kbd &quot;C-,&quot;) 'smex-describe-function)&#xA;     (define-key ido-completion-map (kbd &quot;C-w&quot;) 'smex-where-is)&#xA;     (define-key ido-completion-map (kbd &quot;C-.&quot;) 'smex-find-function)&#xA;     (define-key ido-completion-map (kbd &quot;C-a&quot;) 'move-beginning-of-line)&#xA;     (define-key ido-completion-map &quot;\C-i&quot; 'smex-helm)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-14T13:23:29.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3539" PostTypeId="2" ParentId="3537" CreationDate="2014-11-14T14:29:52.913" Score="11" Body="&lt;p&gt;&lt;code&gt;rspec-mode&lt;/code&gt; has recently added a &lt;a href=&quot;https://github.com/pezra/rspec-mode/#debugging&quot;&gt;section in the README&lt;/a&gt; on this subject. It says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install &lt;code&gt;inf-ruby&lt;/code&gt; and add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook 'inf-ruby-switch-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you've hit the breakpoint, hit &lt;code&gt;C-x C-q&lt;/code&gt; to enable &lt;code&gt;inf-ruby&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2014-11-14T14:29:52.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3540" PostTypeId="1" AcceptedAnswerId="3541" CreationDate="2014-11-14T14:46:21.960" Score="10" ViewCount="1958" Body="&lt;p&gt;We can center text with &lt;kbd&gt;M-x center-region&lt;/kbd&gt; and &lt;kbd&gt;M-o M-s&lt;/kbd&gt;.  Is there something similar for right-alignment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Item 0: value                                                       |&#xA;Item 100: value                                                     |&#xA;Item 30: value                                                      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                                                       Item 0: value|&#xA;                                                     Item 100: value|&#xA;                                                      Item 30: value|&#xA;                                                       fill-column  ^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's easiest way to right-align text?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="253" LastEditDate="2015-07-28T12:31:38.097" LastActivityDate="2015-07-28T12:38:35.153" Title="How to right align region and/or line?" Tags="|text-editing|align|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3541" PostTypeId="2" ParentId="3540" CreationDate="2014-11-14T15:05:44.493" Score="13" Body="&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Filling.html&quot; rel=&quot;nofollow&quot;&gt;manual node on Filling&lt;/a&gt;, several of the fill functions take an optional JUSTIFY argument that you can use.  So, for example, to fill a paragraph with right justification, you can use &lt;code&gt;(fill-paragraph 'right)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;(justify-current-line 'right)&lt;/code&gt; for a single line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you plan to use these options a lot, you could wrap them in functions, such as the following, and then bind these functions to the keys of your choice:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun right-justify-current-line ()&#xA;  &quot;Right-justify this line.&quot;&#xA;  (interactive)&#xA;  (justify-current-line 'right))&#xA;&#xA;(defun right-fill-paragraph ()&#xA;  &quot;Fill paragraph with right justification.&quot;&#xA;  (interactive)&#xA;  (fill-paragraph 'right))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a function you might drop in as a replacement for &lt;code&gt;fill-paragraph&lt;/code&gt;.  With various prefixes, it allows you to decide what kind of justification to use on the paragraph you're filling:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun fill-paragraph-dwim (&amp;amp;optional arg)&#xA;  &quot;Fills the paragraph as normal with no prefix. With C-u,&#xA;right-justify.  With C-u C-u, center-justify.  With C-u C-u C-u,&#xA;full-justify.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (fill-paragraph (cond ((= arg 4)  'right)&#xA;                        ((= arg 16) 'center)&#xA;                        ((= arg 64) 'full))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want to &lt;em&gt;fill&lt;/em&gt; when you're right-aligning, you can use the following function, which is cribbed directly from the &lt;code&gt;center-region&lt;/code&gt; function with a single-line change to make it align right instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun right-region (from to)&#xA;  &quot;Right-justify each nonblank line starting in the region.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (if (&amp;gt; from to)&#xA;      (let ((tem to))&#xA;    (setq to from from tem)))&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (narrow-to-region from to)&#xA;      (goto-char from)&#xA;      (while (not (eobp))&#xA;    (or (save-excursion (skip-chars-forward &quot; \t&quot;) (eolp))&#xA;        ;; (center-line))              ; this was the original code&#xA;        (justify-current-line 'right)) ; this is the new code&#xA;    (forward-line 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="115" LastEditDate="2015-07-28T12:38:35.153" LastActivityDate="2015-07-28T12:38:35.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3542" PostTypeId="2" ParentId="3535" CreationDate="2014-11-14T15:32:35.397" Score="7" Body="&lt;p&gt;The &quot;easiest way&quot; is to just define your own version of &lt;code&gt;describe-function&lt;/code&gt;, and bind that to &lt;code&gt;C-h f&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the vanilla code, and change only the call to &lt;code&gt;completing-read&lt;/code&gt; so that it uses the same history list that &lt;code&gt;M-x&lt;/code&gt; (&lt;code&gt;execute-extended-command&lt;/code&gt;) uses, which is &lt;code&gt;extended-command-history&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-describe-function (function)&#xA;  &quot;Display the full documentation of FUNCTION (a symbol).&quot;&#xA;  (interactive&#xA;   (let ((fn (function-called-at-point))&#xA;         (enable-recursive-minibuffers t)&#xA;         val)&#xA;     (setq val (completing-read&#xA;                (if fn&#xA;                    (format &quot;Describe function (default %s): &quot; fn)&#xA;                  &quot;Describe function: &quot;)&#xA;                obarray 'fboundp t nil&#xA;                'extended-command-history ; &amp;lt;======================&#xA;                (and fn (symbol-name fn))))&#xA;     (list (if (equal val &quot;&quot;) fn (intern val)))))&#xA;  (if (null function)&#xA;      (message &quot;You didn't specify a function&quot;)&#xA;    (help-setup-xref (list #'describe-function function)&#xA;                     (called-interactively-p 'interactive))&#xA;    (save-excursion&#xA;      (with-help-window (help-buffer)&#xA;        (prin1 function)&#xA;        (princ &quot; is &quot;)&#xA;        (describe-function-1 function)&#xA;        (with-current-buffer standard-output&#xA;          (buffer-string))))))&#xA;&#xA;(global-set-key &quot;\C-hf&quot; 'my-describe-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How did I find the original code? &lt;code&gt;C-h f describe-function&lt;/code&gt;, &lt;code&gt;C-h k M-x&lt;/code&gt;, &lt;code&gt;C-h f execute-extended-command&lt;/code&gt;.  In the code for &lt;code&gt;execute-extended-command&lt;/code&gt; I saw that it reads the command name using &lt;code&gt;read-extended-command&lt;/code&gt;, and that calls &lt;code&gt;completing-read&lt;/code&gt; passing &lt;code&gt;extended-command-history&lt;/code&gt; as the &lt;code&gt;HISTORY&lt;/code&gt; argument.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="9589" LastEditDate="2018-07-07T14:49:08.617" LastActivityDate="2018-07-07T14:49:08.617" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3543" PostTypeId="2" ParentId="3537" CreationDate="2014-11-14T15:53:04.520" Score="6" Body="&lt;p&gt;I find that &lt;a href=&quot;https://github.com/Mon-Ouie/pry-remote&quot;&gt;pry-remote&lt;/a&gt; is the best way to run pry within Emacs, since then pry gets its own dedicated buffer and can attach to a ruby process from anywhere (included a non-Emacs terminal or things like &lt;a href=&quot;http://pow.cx/&quot;&gt;pow&lt;/a&gt;). I use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-run-remote-pry (&amp;amp;rest args)&#xA;  (interactive)&#xA;  (let ((buffer (apply 'make-comint &quot;pry-remote&quot; &quot;pry-remote&quot; nil args)))&#xA;    (switch-to-buffer buffer)&#xA;    (setq-local comint-process-echoes t)))&#xA;&#xA;(define-key ruby-mode-map (kbd &quot;C-c r d&quot;) 'my-run-remote-pry) ; (or whatever keybinding)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you'll put &lt;code&gt;binding.remote_pry&lt;/code&gt; in your code; you attach to a waiting &lt;code&gt;pry&lt;/code&gt; with &lt;code&gt;C-c r d&lt;/code&gt; (or whatever) and exit pry (continuing the process) with &lt;code&gt;C-c C-d&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll also probably want to disable paging in your &lt;code&gt;~/.pryrc&lt;/code&gt;, since it doesn't play well with &lt;code&gt;comint&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Pry.config.pager = false&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-11-14T15:53:04.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3544" PostTypeId="1" AcceptedAnswerId="3545" CreationDate="2014-11-14T16:03:24.110" Score="5" ViewCount="496" Body="&lt;p&gt;Navigation with C-n, C-p etc. is quite easy in emacs, but I have to stretch my hand a lot to hit RETURN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another standard key binding with the same effect as the RETURN key?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;background of my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discovered that in many applications (like e. g. Safari on MacOS X) at least some of the motion commands of emacs do work, e. g. C-n and C-p, C-a and C-e. &#xA;As using the arrow keys forces me to leave the normal hands position during typing, I find it really helpful to use those instead of the arrow keys, e. g. for typing an address in the URL field of the Safari browser and then cycling to the matching suggestions of Safari:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RTWwM.png&quot; alt=&quot;screenshot URL selection&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thats really cool, but then I have to stretch my pinky or move my hand to hit RETURN to select one of those, so I wondered if there might be a hidden way of directly going to the selected URL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that it is not yet defined, but I will try to define &lt;code&gt;C-m&lt;/code&gt; to get an Emacs-compatible key-binding also in Safari.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even cooler: with the &lt;a href=&quot;http://dbergey.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Type-to-navigate&lt;/strong&gt; extension&lt;/a&gt; I can type some characters and then can cycle through the found occurrences on the open web page with Cmd-G and then (again with RETURN) directly open a URL which contains this text.. navigation without the mouse is very helpful for me. But again, RETURN forces me to leave the normal hands position on my keyboard a little.&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2377" LastEditDate="2014-11-14T22:46:30.233" LastActivityDate="2014-11-14T22:46:30.233" Title="Is there a more convenient key binding for RETURN?" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3545" PostTypeId="2" ParentId="3544" CreationDate="2014-11-14T16:05:47.290" Score="14" Body="&lt;p&gt;&lt;code&gt;C-m&lt;/code&gt; should have the same effect, &lt;code&gt;C-j&lt;/code&gt; and &lt;code&gt;M-j&lt;/code&gt; come close, but do subtly different things depending on your active modes and configuration, such as indenting the current line.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-11-14T16:05:47.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3546" PostTypeId="1" AcceptedAnswerId="3550" CreationDate="2014-11-14T16:32:34.663" Score="2" ViewCount="390" Body="&lt;p&gt;I'm working with a LaTeX document.  I want to type &lt;code&gt;&quot;&quot;&lt;/code&gt; since I need this for &lt;code&gt;german.sty&lt;/code&gt; in LaTeX.  Starting some time ago, Emacs thinks this is not a good idea.  I do not agree. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I have to write &lt;code&gt;&quot; SPC &quot;&lt;/code&gt; and then manually remove the blank space in between the quotation marks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I type two quotation marks in a row?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2440" LastEditorUserId="25" LastEditDate="2014-11-16T00:24:09.987" LastActivityDate="2014-11-16T00:24:09.987" Title="Typing two quote characters in a LaTeX document?" Tags="|latex|tex-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3547" PostTypeId="2" ParentId="3546" CreationDate="2014-11-14T16:37:54.813" Score="6" Body="&lt;p&gt;You can type &lt;code&gt;C-q &quot;&lt;/code&gt; for the second quote to do a &quot;quoted insert&quot;. This should override whatever behavior is preventing the insertion of two quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-q&lt;/code&gt; is commonly used for inserting literal characters, such as &lt;code&gt;C-q C-l&lt;/code&gt; for a &lt;code&gt;^L&lt;/code&gt; control character.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-11-14T16:37:54.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3548" PostTypeId="1" AcceptedAnswerId="3549" CreationDate="2014-11-14T16:40:18.097" Score="4" ViewCount="338" Body="&lt;p&gt;How to change key-bindings for Calendar Mode only? I'm trying to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; original bindings require pressing alt and shift simultaneously&#xA;; alt+shift change keyboard layout, so I cannot use those bindings&#xA;(define-key calendar-mode-map (kbd &quot;M-]&quot;) 'calendar-forward-month)&#xA;(define-key calendar-mode-map (kbd &quot;M-[&quot;) 'calendar-backward-month)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but &lt;code&gt;calendar-mode-map&lt;/code&gt; is void. How can I get name of keymap of Calendar mode (or any arbitrary mode).&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2014-11-14T16:43:23.623" Title="How to change key bindings for Calendar mode?" Tags="|key-bindings|keymap|calendar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3549" PostTypeId="2" ParentId="3548" CreationDate="2014-11-14T16:43:23.623" Score="9" Body="&lt;p&gt;&lt;code&gt;calendar-mode-map&lt;/code&gt; is void since it's not loaded yet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;calendar&quot;&#xA;  `(progn&#xA;     (define-key calendar-mode-map (kbd &quot;M-]&quot;) 'calendar-forward-month)&#xA;     (define-key calendar-mode-map (kbd &quot;M-[&quot;) 'calendar-backward-month)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-14T16:43:23.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3550" PostTypeId="2" ParentId="3546" CreationDate="2014-11-14T16:44:14.923" Score="7" Body="&lt;p&gt;It sounds like you are in tex-mode, and &lt;code&gt;&quot;&lt;/code&gt; is bound to &lt;code&gt;tex-insert-quote&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you never want that behavior, rebind the key to &lt;code&gt;self-insert-command&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key tex-mode-map &quot;\&quot;&quot; #'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want the default tex behavior but occasionally want to insert a pair of quotes, use a prefix arg: &lt;code&gt;C-2 &quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively it seems like you can type &lt;code&gt;&quot;&quot;&quot;&quot;&lt;/code&gt; to get &lt;code&gt;&quot;&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="253" LastEditDate="2014-11-14T22:03:53.780" LastActivityDate="2014-11-14T22:03:53.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3552" PostTypeId="1" AcceptedAnswerId="3559" CreationDate="2014-11-14T18:06:48.813" Score="10" ViewCount="562" Body="&lt;p&gt;When an error occurs inside a process sentinel or during font-locking, then Emacs doesn't show a backtrace even though &lt;code&gt;debug-on-error&lt;/code&gt; was previously enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand why these errors are caught, the same error might be triggered again while trying to present the backtrace. However when I want to actually debug that error it is not very helpful. I would rather risk Emacs becoming unresponsive than having to work from this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error in process sentinel: Wrong type argument: stringp, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After all I can just start a second instance, if the first starts going crazy. A little more context would help when there are many places where such an error could theoretically occur in a sentinel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I force Emacs to show a backtrace even in cases where &lt;code&gt;debug-on-error&lt;/code&gt; has no effect?&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-11-14T21:42:27.850" LastActivityDate="2017-12-04T13:23:03.060" Title="How to debug errors in sentinels and during font-lock" Tags="|debugging|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3553" PostTypeId="1" AcceptedAnswerId="3561" CreationDate="2014-11-14T18:26:09.670" Score="8" ViewCount="553" Body="&lt;p&gt;Recent versions of Emacs have a really good renderer for HTML written entirely in Elisp.  This renderer (shr) can be used for displaying HTML emails, documentation, etc.  However, it seems that shr retrieves remote resources referenced in HTML documents (e.g. images).  If the HTML is untrusted, as in the case of spam emails, this leads to a number of security and privacy concerns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: How is it possible to prevent shr from accessing remote resources when rendering HTML?&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2014-11-14T21:41:35.707" Title="How to prevent shr from making network connections" Tags="|eww|security|shr|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3554" PostTypeId="1" AcceptedAnswerId="3791" CreationDate="2014-11-14T19:07:02.373" Score="2" ViewCount="121" Body="&lt;p&gt;I had bookmarks to some files on windows servers for quick and easy access. Well, I lost access to the server (the account's password changed), so I 1) removed those entries from my bookmarks list and 2) saved the contents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I verified that there are no references to these servers in the bookmarks, or in registers, however Emacs is still prompting me to log into these remote windows servers. I can't find out what is attempting to connect and where it's been configured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to &quot;Cancel&quot; the Windows login/authentication dialog requests to server A three times, and server B 12 times, causing an incredibly long and painful start up process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried starting with --debug-init, but don't know where to find the log.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start Emacs with -Q I'm &lt;strong&gt;not&lt;/strong&gt; prompted to log into those resources, but see no references to those hosts in my .emacs or any other config files. Where could it be coming from?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2559" LastEditorUserId="50" LastEditDate="2014-11-14T21:23:16.350" LastActivityDate="2014-11-21T18:41:06.913" Title="Why is emacs attempting to connect to remote bookmarks after I deleted them?" Tags="|networking|bookmarks|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3555" PostTypeId="1" AcceptedAnswerId="3556" CreationDate="2014-11-14T19:38:25.257" Score="43" ViewCount="4035" Body="&lt;p&gt;When posting questions and answers here, people sometimes use the terms &quot;function&quot; and &quot;command&quot; interchangeably. In other cases, people only use one of the two terms to discuss specific pieces of code. As their posts usually focus on other topics, they don't explain why they are using one term but not the other. So:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; In Emacs Lisp, what is the difference between a function and a command?&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="105" LastEditDate="2017-09-21T23:50:57.247" LastActivityDate="2017-09-21T23:50:57.247" Title="What is the difference between a function and a command?" Tags="|functions|commands|help|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3556" PostTypeId="2" ParentId="3555" CreationDate="2014-11-14T19:38:25.257" Score="55" Body="&lt;p&gt;&lt;strong&gt;Every command is a function, but not every function is also a command.&lt;/strong&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A command includes a call to &lt;code&gt;interactive&lt;/code&gt;; this is why commands are commonly referred to as &quot;interactive functions&quot;. Commands can be invoked via &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;name-of-command&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, and they can also be bound to a key sequence. Regular functions do &lt;em&gt;not&lt;/em&gt; include a call to &lt;code&gt;interactive&lt;/code&gt;, can &lt;em&gt;not&lt;/em&gt; be called using &lt;kbd&gt;M-x&lt;/kbd&gt;, and you can't bind them to a key sequence. To run a function that is not interactive, you can press &lt;kbd&gt;M-:&lt;/kbd&gt; (&lt;code&gt;eval-expression&lt;/code&gt;), enter the name of the function followed by values for any arguments it needs enclosed in parentheses, and press &lt;kbd&gt;RET&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(name-of-function arg1 arg2 arg3)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the function is not supposed to operate on the current buffer, you can also enter&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(name-of-function arg1 arg2 arg3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the &lt;code&gt;*scratch*&lt;/code&gt; buffer and press &lt;kbd&gt;C-x C-e&lt;/kbd&gt; (&lt;code&gt;eval-last-sexp&lt;/code&gt;) with point positioned after the closing parenthesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make a function &lt;code&gt;bar&lt;/code&gt; available as a command you can wrap it in a custom interactive function (&lt;code&gt;foo&lt;/code&gt;) as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, if &lt;code&gt;bar&lt;/code&gt; takes one or more arguments, you will have to supply them in order to make &lt;code&gt;foo&lt;/code&gt; work correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you see people using the terms &quot;function&quot; and &quot;command&quot; interchangeably, this &lt;em&gt;might&lt;/em&gt; indicate (depending on context) that they are not aware of the differences between the underlying concepts.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; Note that I am talking about &lt;code&gt;defun&lt;/code&gt;s here. As @Stefan points out in the comments, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html&quot;&gt;keyboard macros&lt;/a&gt; are a special case: They &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Keyboard-Macros.html&quot;&gt;can be considered commands&lt;/a&gt;, but they are not functions.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-04-28T11:58:37.723" LastActivityDate="2015-04-28T11:58:37.723" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3557" PostTypeId="2" ParentId="3520" CreationDate="2014-11-14T20:01:20.627" Score="2" Body="&lt;p&gt;When the audio is playing but also after the first track stops I can see that mpg321 is till running in the background:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ps aux | grep mpg&#xA;me       29748  6.8  0.0 2437324 6308 ?        Ssl  19:31   0:07 /usr/bin/mpg123 --skip-printing-frames 30 -R dummy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to the man page &lt;code&gt;-R dummy&lt;/code&gt; means run mpg123 in command mode. Looks like bongo is maybe waiting for it to exit rather than feeding it the next track to play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I fixed this by disabling all the backends except for &lt;code&gt;mplayer&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default bongo-enabled-backends '(mplayer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And now bongo is playing all queued tracks in the playlist.&lt;/p&gt;&#xA;" OwnerUserId="2552" LastActivityDate="2014-11-14T20:01:20.627" CommentCount="0" CommunityOwnedDate="2014-11-14T20:01:20.627" ContentLicense="CC BY-SA 3.0" />
  <row Id="3558" PostTypeId="1" AcceptedAnswerId="3571" CreationDate="2014-11-14T20:39:07.180" Score="12" ViewCount="6637" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I switch between input methods for different languages when using a non-standard keyboard layout?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to edit text in two different languages.  I would like to be able to use my keybindings across the two languages, except, of course, when inserting text into the buffer.  It looks like I should be able to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html#Select-Input-Method&quot;&gt;&lt;code&gt;toggle-input-method&lt;/code&gt;&lt;/a&gt; (&lt;code&gt;C-\&lt;/code&gt;) and select the alternate language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, &lt;em&gt;almost&lt;/em&gt; so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the rub: I use the English Dvorak layout, which I set at the OS level (ie, with &lt;a href=&quot;http://www.x.org/releases/X11R7.7/doc/man/man1/setxkbmap.1.xhtml&quot;&gt;&lt;code&gt;setxkbmap&lt;/code&gt;&lt;/a&gt;).  When I &lt;code&gt;toggle-input-method&lt;/code&gt;, the text I insert would be correct if I had a QWERTY layout (the standard in the US), but comes out as gibberish because I'm on Dvorak.  (FWIW, when I switch my layout to standard US, it works fine.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;em&gt;how do I inform Emacs that I'm using Dvorak&lt;/em&gt; so that &lt;code&gt;toggle-input-method&lt;/code&gt; and friends translate my keypresses to the correct characters in the other language?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-15T12:29:40.243" Title="How to switch keyboard layouts for different languages?" Tags="|keymap|input-method|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3559" PostTypeId="2" ParentId="3552" CreationDate="2014-11-14T21:14:24.213" Score="9" Body="&lt;p&gt;For process sentinels, I don't think there's a good reason.  IOW I think it's just a missing feature, so I suggest you &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For font-lock, the issue is more tricky because what really happens is that the error is triggered during jit-lock, i.e. during redisplay, and we can't easily enter the debugger at that moment (IIRC at some point Gerd tried to make it work, but there were some serious problems, still).  So you can debug it in one of the following ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x jit-lock-debug-mode&lt;/code&gt; which changes jit-lock to run right after redisplay, so that we can enter the debugger.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-: (setq font-lock-support-mode nil) RET&lt;/code&gt; and then disable+reenable font-lock.  This way font-lock does not use jit-lock any more, so it runs during the user's command rather than during the subsequent redisplay.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-12-04T13:23:03.060" LastActivityDate="2017-12-04T13:23:03.060" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3560" PostTypeId="2" ParentId="3554" CreationDate="2014-11-14T21:22:39.423" Score="1" Body="&lt;p&gt;Normally, bookmark information is persistently saved (across sessions) in a file designated by the &lt;code&gt;bookmark-default-file&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To investigate you problem, you could:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;look where your bookmarks are stored: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;bookmark-default-file&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;look at the contents of the bookmarks file to see if the reference to your old bookmarks are still there.&lt;/li&gt;&#xA;&lt;li&gt;If there is still a reference of the old locations, delete it using &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;bookmark-delete&lt;/code&gt;, save your bookmarks using &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;bookmark-save&lt;/code&gt;, and recheck point 2 to see if the reference has disappeared from your bookmarks file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-11-14T21:22:39.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3561" PostTypeId="2" ParentId="3553" CreationDate="2014-11-14T21:25:36.623" Score="6" Body="&lt;p&gt;shr.el has a &lt;code&gt;(defvar shr-inhibit-images nil)&lt;/code&gt;, and a&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom shr-blocked-images nil&#xA;  &quot;Images that have URLs matching this regexp will be blocked.&quot;&#xA;  :version &quot;24.1&quot;&#xA;  :group 'shr&#xA;  :type '(choice (const nil) regexp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems like &lt;code&gt;(setq shr-inhibit-images t)&lt;/code&gt; stops the web requests when I view HTML emails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it turns off image display for &lt;code&gt;eww&lt;/code&gt; entirely. That is OK for me but might not work for you. You can of course add an &lt;code&gt;eww-mode&lt;/code&gt; keybinding that would toggle this + reload a given page when turning images on.&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="91" LastEditDate="2014-11-14T21:41:35.707" LastActivityDate="2014-11-14T21:41:35.707" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3562" PostTypeId="1" CreationDate="2014-11-14T22:15:55.503" Score="3" ViewCount="77" Body="&lt;p&gt;I have been using a forked version of python.el for some time in which I have changed the indentation rules so that instead of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;something.method1()\&#xA;         .method2()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stuff = (1, 2, 3,&#xA;         4, 5, 6)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;something.method1()\&#xA;    .method2()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stuff = (1, 2, 3,&#xA;    4, 5, 6)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My changes are on GitHub at &lt;a href=&quot;https://github.com/asmeurer/python.el/commit/fb3e50234583406174cb725727ef7242951b9875&quot; rel=&quot;nofollow&quot;&gt;this commit&lt;/a&gt; and &lt;a href=&quot;https://github.com/asmeurer/python.el/commit/5d5253f46235af8d9ec1f0519aee0e769956de58&quot; rel=&quot;nofollow&quot;&gt;this commit&lt;/a&gt;, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that my forked version of python.el is out of date, and there's been a lot of development since then.  So my question is: &lt;em&gt;how can I make the same changes by modifying my init file, without modifying the source of python.el?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="253" LastEditDate="2014-11-14T23:46:12.107" LastActivityDate="2014-11-15T00:11:41.850" Title="How can I enable my modifications to a library/package without modifying its source?" Tags="|elisp|python|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3563" PostTypeId="2" ParentId="3554" CreationDate="2014-11-14T23:40:47.487" Score="1" Body="&lt;p&gt;In addition to what @Francesco said -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are sure that the problem comes from bookmarks, then double-check your bookmarks file(s). (I know you said that you did that, but check again.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the value of variable &lt;code&gt;bookmark-default-file&lt;/code&gt;, and look in that location (file). If you use &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then check also the value of option &lt;code&gt;bmkp-last-as-first-bookmark-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not sure that the problem comes from a bookmark then check whether it might be coming from a file listed in the value of variable &lt;code&gt;recentf-list&lt;/code&gt;.  (This does not apply if you do not (and did not) use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Conveniences.html&quot; rel=&quot;nofollow&quot;&gt;standard library &lt;code&gt;recentf.el&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-15T01:24:48.957" LastActivityDate="2014-11-15T01:24:48.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3564" PostTypeId="1" AcceptedAnswerId="3567" CreationDate="2014-11-15T00:08:48.230" Score="3" ViewCount="1254" Body="&lt;p&gt;&lt;code&gt;auto-insert-alist&lt;/code&gt; by default matches files created in &lt;code&gt;.../bin/&lt;/code&gt; directories and enables &lt;code&gt;sh-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are &lt;a href=&quot;https://www.emacswiki.org/emacs/AutoInsertMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;examples on the wiki&lt;/a&gt; showing how to use a skeleton to insert some text, but I want to both insert some text and enable &lt;code&gt;sh-mode&lt;/code&gt;. Some other examples show using a &lt;code&gt;vector&lt;/code&gt; to run multiple actions, but not with a skeleton.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm unsure of the syntax. This doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auto-insert-mode +1)&#xA;(setq-default auto-insert-query nil)&#xA;&#xA;(define-auto-insert&#xA;  '(&quot;/bin/.*[^/]\\'&quot; . &quot;Shell-Script&quot;)&#xA;  ['(&quot;Default shell script: &quot;&#xA;    &quot;#!/bin/bash&quot; \n \n&#xA;    &amp;gt; _)&#xA;   sh-mode])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can you show the correct way to use vectors and skeletons?&lt;/p&gt;&#xA;" OwnerUserId="2562" LastEditorUserId="2520" LastEditDate="2017-10-29T18:15:30.697" LastActivityDate="2017-10-29T18:15:30.697" Title="auto-insert a skeleton and run a function when creating a new file" Tags="|find-file|skeleton|auto-insert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3565" PostTypeId="2" ParentId="3562" CreationDate="2014-11-15T00:11:41.850" Score="3" Body="&lt;p&gt;That's what the advice mechanism is for.  Look up &lt;code&gt;advice-add&lt;/code&gt; or &lt;code&gt;defadvice&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, what you describe sounds not terribly specific to your use-case, so an even better solution is to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; and attach your changes as a patch.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-15T00:11:41.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3566" PostTypeId="1" CreationDate="2014-11-15T01:34:23.660" Score="-1" ViewCount="215" Body="&lt;p&gt;I am trying to set up &lt;a href=&quot;https://github.com/mlf176f2/auto-indent-mode.el/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-indent-mode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added it to my init-file like this, but it won't run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auto-indent-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I tell Emacs to enable &lt;code&gt;auto-indent-mode&lt;/code&gt; at startup?&lt;/p&gt;&#xA;" OwnerUserId="2565" LastEditorUserId="504" LastEditDate="2014-11-15T15:07:12.613" LastActivityDate="2014-11-15T15:07:12.613" Title="Emacs won't enable auto-indent-mode at startup" Tags="|init-file|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3567" PostTypeId="2" ParentId="3564" CreationDate="2014-11-15T02:25:12.407" Score="5" Body="&lt;p&gt;This works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-auto-insert&#xA;  '(&quot;/bin/.*[^/]\\'&quot; . &quot;Shell-Script&quot;)&#xA;  [(lambda () (sh-mode))&#xA;   (&quot;Default shell script: &quot;&#xA;    &quot;#!/bin/bash\n\n&quot;&#xA;    &amp;gt; _)])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are two issues here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;auto-insert&lt;/code&gt; &lt;strong&gt;can&lt;/strong&gt; call functions as a part of the action, but for some reason it has to be a &lt;code&gt;lambda&lt;/code&gt; form. (I wonder why it checks for &lt;code&gt;lambda&lt;/code&gt; instead of calling &lt;code&gt;functionp&lt;/code&gt;...)&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;[...]&lt;/code&gt; format for creating vectors does not evaluate its contents. (See section &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Vectors.html#Vectors&quot; rel=&quot;nofollow&quot;&gt;Vectors&lt;/a&gt; of the Emacs Lisp Manual.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The second issue means that these two expressions have the same value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(vector (lambda () (sh-mode))&#xA;        '(&quot;Default shell script: &quot;&#xA;          &quot;#!/bin/bash\n\n&quot;&#xA;          \&amp;gt; _))&#xA;&#xA;[(lambda () (sh-mode))&#xA;   (&quot;Default shell script: &quot;&#xA;    &quot;#!/bin/bash\n\n&quot;&#xA;    &amp;gt; _)]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that in the second expression vector elements are not quoted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to this, one needs to be careful when using &lt;code&gt;\n&lt;/code&gt; at the end of a skeleton, so I added newlines to the string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation for &lt;code&gt;skeleton-insert&lt;/code&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Note that \n as the last element of the skeleton only inserts a&#xA;newline if not at eol.  If you want to unconditionally insert a newline&#xA;at the end of the skeleton, use &quot;\n&quot; instead.  Likewise with \n&#xA;as the first element when at bol.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-15T02:25:12.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3568" PostTypeId="2" ParentId="3566" CreationDate="2014-11-15T03:26:18.937" Score="3" Body="&lt;p&gt;Alright, the solution was to use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(auto-indent-global-mode)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2565" LastActivityDate="2014-11-15T03:26:18.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3569" PostTypeId="2" ParentId="2952" CreationDate="2014-11-15T07:15:51.463" Score="9" Body="&lt;p&gt;As described by Eric Schulte on the &lt;code&gt;org-mode&lt;/code&gt; mailing list (see the link in the question) we can modify &lt;code&gt;org-babel-eval&lt;/code&gt; to achieve this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar org-babel-eval-verbose t&#xA;  &amp;quot;A non-nil value makes `org-babel-eval' display&amp;quot;)&#xA;&#xA;(defun org-babel-eval (command query)&#xA;  &amp;quot;Run COMMAND on QUERY.&#xA;Writes QUERY into a temp-buffer that is processed with&#xA;`org-babel--shell-command-on-region'.  If COMMAND succeeds then return&#xA;its results, otherwise display STDERR with&#xA;`org-babel-eval-error-notify'.&amp;quot;&#xA;  (let ((error-buffer (get-buffer-create &amp;quot; *Org-Babel Error*&amp;quot;)) exit-code)&#xA;    (with-current-buffer error-buffer (erase-buffer))&#xA;    (with-temp-buffer&#xA;      (insert query)&#xA;      (setq exit-code&#xA;        (org-babel--shell-command-on-region&#xA;         command error-buffer))&#xA;&#xA;      (if (or (not (numberp exit-code)) (&amp;gt; exit-code 0)&#xA;              (and org-babel-eval-verbose (&amp;gt; (buffer-size error-buffer) 0)))&#xA;      (progn&#xA;        (with-current-buffer error-buffer&#xA;          (org-babel-eval-error-notify exit-code (buffer-string)))&#xA;        (save-excursion&#xA;          (when (get-buffer org-babel-error-buffer-name)&#xA;        (with-current-buffer org-babel-error-buffer-name&#xA;          (unless (derived-mode-p 'compilation-mode)&#xA;            (compilation-mode))&#xA;          ;; Compilation-mode enforces read-only, but Babel expects the buffer modifiable.&#xA;          (setq buffer-read-only nil))))&#xA;        nil)&#xA;    (buffer-string)))))&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now if &lt;code&gt;org-babel-eval-verbose&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;, output printed to stderr during evaluation of a source code block show up in a separate window just as if source code evaluation failed.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="14825" LastEditDate="2022-08-12T15:30:09.087" LastActivityDate="2022-08-12T15:30:09.087" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3570" PostTypeId="2" ParentId="2945" CreationDate="2014-11-15T07:52:53.023" Score="8" Body="&lt;p&gt;According to &lt;a href=&quot;http://orgmode.org/manual/eval.html#eval&quot; rel=&quot;noreferrer&quot;&gt;the Org Mode Manual&lt;/a&gt;, &lt;code&gt;:eval yes&lt;/code&gt; is not recognized by &lt;code&gt;org-mode&lt;/code&gt;. (I also failed to find any uses of &lt;code&gt;:eval yes&lt;/code&gt; reading Org sources, both the 8.2.10 release and the &lt;code&gt;master&lt;/code&gt; branch.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;a href=&quot;https://github.com/fniessen/refcard-org-babel/issues/1&quot; rel=&quot;noreferrer&quot;&gt;opened an issue&lt;/a&gt; so we can get Fabrice Niessen's take on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, one can customize &lt;code&gt;org-confirm-babel-evaluate&lt;/code&gt;. Its documentation states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Confirm before evaluation.&#xA;  Require confirmation before interactively evaluating code&#xA;  blocks in Org-mode buffers.  The default value of this variable&#xA;  is t, meaning confirmation is required for any code block&#xA;  evaluation.  This variable can be set to nil to inhibit any&#xA;  future confirmation requests.  This variable can also be set to a&#xA;  function which takes two arguments the language of the code block&#xA;  and the body of the code block.  Such a function should then&#xA;  return a non-nil value if the user should be prompted for&#xA;  execution or nil if no prompt is required.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;em&gt;Warning:&lt;/em&gt; Disabling confirmation may result in accidental&#xA;  evaluation of potentially harmful code.  It may be advisable&#xA;  remove code block execution from C-c C-c as further protection&#xA;  against accidental code block evaluation.  The&#xA;  &lt;code&gt;org-babel-no-eval-on-ctrl-c-ctrl-c&lt;/code&gt; variable can be used to&#xA;  remove code block execution from the C-c C-c keybinding.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example, I want &lt;code&gt;org-mode&lt;/code&gt; to evaluate LaTeX and Maxima blocks without confirmation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ck/org-confirm-babel-evaluate (lang body)&#xA;  (not (or (string= lang &quot;latex&quot;) (string= lang &quot;maxima&quot;))))&#xA;(setq org-confirm-babel-evaluate 'ck/org-confirm-babel-evaluate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-15T07:52:53.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3571" PostTypeId="2" ParentId="3558" CreationDate="2014-11-15T08:36:59.603" Score="8" Body="&lt;p&gt;There is a method to change the physical layout definition for input method by setting &lt;code&gt;quail-keyboard-layout-type&lt;/code&gt;. But it looks Dvorak is not among the possible candidates in &lt;code&gt;quail-keyboard-layout-alist&lt;/code&gt; in my Emacs 24.4. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either define a new physical keyboard layout by looking at definition of &lt;code&gt;quail-keyboard-layout-alist&lt;/code&gt; in &lt;code&gt;quail.el&lt;/code&gt; or create a new input method by defining corresponding Arabic keys for Dvorak layout. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not experienced in the first, but I can testify the second approach is easier than you think. (I had to create an Ottoman Turkish input method on top of Farsi.) Copy &lt;code&gt;arabic.el&lt;/code&gt; (which resides in my Debian system at &lt;code&gt;/usr/share/emacs/24.4/lisp/leim/quail/arabic.el.gz&lt;/code&gt;) to your home &lt;code&gt;site-lisp&lt;/code&gt; and change the keys per your preferences. Also, don't forget to change the input method names etc. You just created a new Dvorak-Arabic input method. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can update the answer with more details if anything seems complex. &lt;/p&gt;&#xA;" OwnerUserId="2569" LastActivityDate="2014-11-15T08:36:59.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3572" PostTypeId="1" AcceptedAnswerId="3578" CreationDate="2014-11-15T11:11:04.560" Score="9" ViewCount="2809" Body="&lt;p&gt;I've been playing around with &lt;code&gt;rx&lt;/code&gt; lately, and I just noticed there are (at least) 3 different ways of indicating whitespaces in regular expressions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;[:blank:]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[:space:]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\s-&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What are the differences between each of them? Does it depend on the major-mode?&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-15T23:02:49.323" LastActivityDate="2023-10-30T15:58:57.293" Title="In regular expressions, what's the difference between [:blank:], [:space:], and \s-?" Tags="|regular-expressions|syntax|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3573" PostTypeId="1" AcceptedAnswerId="3575" CreationDate="2014-11-15T12:23:02.860" Score="1" ViewCount="1284" Body="&lt;p&gt;I have the following in &lt;code&gt;.bashrc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export ALTERNATE_EDITOR=&quot;&quot;&#xA;export EDITOR=&quot;emacsclient -t&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run, for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient something.tex &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when running X, in a Konsole terminal (Konsole is the KDE X term client), the file opens up inside the Konsole terminal displaying the file (as though I had called &lt;code&gt;-nw&lt;/code&gt;), when it should start up an emacs X frame. Also, the file is not normally editable. I cannot type, and when  enter it behaves like I am still in the terminal, except the cursor jumps around on the screen when I try to type, and &lt;code&gt;echo $TERM&lt;/code&gt; still gives &lt;code&gt;xterm&lt;/code&gt;. Also, I'm seeing stuff like &lt;code&gt;Auto-saving...done&lt;/code&gt; at the bottom of the terminal. Checking the processes gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ps aux | grep emacs&#xA;faheem   31260  0.0  0.0  12516   800 pts/2    S    17:40   0:00 emacsclient something.tex&#xA;faheem   31269  0.2  0.1 230896 27408 ?        Ss   17:40   0:01 emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After further investigation, it seems the backgrouding &lt;code&gt;&amp;amp;&lt;/code&gt;. Is causing the problem. Leaving it out causes emacs to open in &lt;code&gt;-nw&lt;/code&gt; mode. But I want a full X emacs frame. Why is it not doing that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see the &lt;code&gt;-c&lt;/code&gt; option says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-c, --create-frame&#xA;          create a new frame instead of trying to use the current Emacs frame&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this does create a emacs X frame, but if there is no existing frame, why doesn't it create one instead of opening in the terminal?&lt;/p&gt;&#xA;" OwnerUserId="100" LastEditorUserId="100" LastEditDate="2014-11-15T12:44:40.000" LastActivityDate="2014-11-15T12:44:40.000" Title="Emacs client starts in no windows mode" Tags="|emacsclient|server|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3574" PostTypeId="2" ParentId="3558" CreationDate="2014-11-15T12:29:40.243" Score="7" Body="&lt;p&gt;@EmreSahin put me on the right path to answer this question, so I'm laying out a little bit of the detail in case anyone else ever has to deal with a problem like this themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Emre points out, we need to add a Dvorak layout to &lt;code&gt;quail-keyboard-layout-alist&lt;/code&gt;.  It turns out that the &lt;code&gt;quail&lt;/code&gt; library is not well-documented in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html#Select-Input-Method&quot;&gt;manual&lt;/a&gt;, in which two related functions are mentioned in passing on one node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after consulting &lt;a href=&quot;http://comments.gmane.org/gmane.emacs.help/92887&quot;&gt;this help thread&lt;/a&gt; and, especially, the &lt;a href=&quot;http://www.emacswiki.org/emacs/WritingRussianWithDvorak&quot;&gt;EmacsWiki page on Russian with Dvorak&lt;/a&gt; (from which this answer cribs), I've think I've got it figured out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The docstring for the variable &lt;code&gt;quail-keyboard-layout&lt;/code&gt; describes what we need to put in &lt;code&gt;quail-keyboard-layout-alist&lt;/code&gt;.  It's a long string corresponding to 6 rows of 15 keys each.  Each row corresponds to the unshifted and shifted values of each key, for a total of 30 characters per row.  I'm less sure about the following point, but it appears that, for what I'll call &quot;semi-standard&quot; keyboards with 4 rows of keys, the first and sixth rows should each be 30 blank spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The big reveal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'quail)&#xA;&#xA;(add-to-list 'quail-keyboard-layout-alist&#xA;             `(&quot;dvorak&quot; . ,(concat &quot;                              &quot;&#xA;                                   &quot;  1!2@3#4$5%6^7&amp;amp;8*9(0)[{]}`~  &quot;&#xA;                                   &quot;  '\&quot;,&amp;lt;.&amp;gt;pPyYfFgGcCrRlL/?=+    &quot;&#xA;                                   &quot;  aAoOeEuUiIdDhHtTnNsS-_\\|    &quot;&#xA;                                   &quot;  ;:qQjJkKxXbBmMwWvVzZ        &quot;&#xA;                                   &quot;                              &quot;)))&#xA;&#xA;(quail-set-keyboard-layout &quot;dvorak&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-15T12:29:40.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3575" PostTypeId="2" ParentId="3573" CreationDate="2014-11-15T12:44:10.013" Score="2" Body="&lt;p&gt;Use the &lt;code&gt;-c&lt;/code&gt; option to force opening a new graphical frame.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-11-15T12:44:10.013" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3576" PostTypeId="1" AcceptedAnswerId="3585" CreationDate="2014-11-15T12:47:46.643" Score="4" ViewCount="732" Body="&lt;p&gt;I want to call a command asynchronously, and define a function that handles output from that command. I don't want to simply write output to a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the Elisp info (36.9.2 Process Filter Functions) I need to set a process filter function. I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-echo-filter (proc string)&#xA;  (message &quot;proc: %s string: %s&quot; proc string))&#xA;&#xA;(let ((my-proc (start-file-process &quot;foo&quot; nil &quot;date&quot;)))&#xA;  (set-process-filter my-proc #'my-echo-filter)) ; writes the time to *Messages*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this makes me nervous. I'm starting the process first, and only afterwards am I attaching the process filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do anything between creating the process and attaching the process filter, I can miss output.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((my-proc (start-file-process &quot;foo&quot; nil &quot;date&quot;)))&#xA;  (sleep-for 2)&#xA;  (set-process-filter my-proc #'my-echo-filter)) ; Does not write the time!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I create a process and ensure that my process filter doesn't miss anything?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2014-11-15T19:21:32.650" Title="How do I pass all the output of process to a function?" Tags="|process|subprocess|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3577" PostTypeId="1" AcceptedAnswerId="3582" CreationDate="2014-11-15T12:51:52.567" Score="2" ViewCount="88" Body="&lt;p&gt;I would like to check whether a new file has been visited by an interactive command (e.g. visited using &lt;kbd&gt;C-x C-f&lt;/kbd&gt;) or if it has been visited programmatically by some Lisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use case:&lt;/strong&gt;&#xA;I cooked my own template/auto-insert/skeleton functionality using &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;yasnippet&lt;/code&gt;&lt;/a&gt;, and I mainly use it for LaTeX files. I would like the template functionality to apply only if I create the file by hand, and not whenever some Lisp code does that. In particular, my template function interactively asks for some input, and this should not happen when executing Lisp code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&#xA;AUCTeX creates LaTeX buffers (with the corresponding files) from time to time, for example the &lt;code&gt;region.tex&lt;/code&gt; file if you use &lt;code&gt;TeX-pin-region&lt;/code&gt; functionality. I don't want the template function to apply here.&lt;/p&gt;&#xA;" OwnerUserId="74" LastEditorUserId="504" LastEditDate="2014-11-15T14:56:45.263" LastActivityDate="2014-11-15T15:55:27.337" Title="Detect whether a new file has been visited by user or by lisp code" Tags="|elisp|files|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3578" PostTypeId="2" ParentId="3572" CreationDate="2014-11-15T13:48:06.087" Score="6" Body="&lt;p&gt;The &lt;code&gt;[:blank:]&lt;/code&gt; character class matches only the SPC and TAB characters. The other two match whitespace based on the active syntax table. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There does not seem to be a difference between &lt;code&gt;[:space:]&lt;/code&gt; and &lt;code&gt;\s-&lt;/code&gt;. The latter is an instance of the general &lt;strong&gt;\s&lt;em&gt;code&lt;/em&gt;&lt;/strong&gt; pattern for matching based on a syntax class. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-15T14:51:03.557" LastActivityDate="2014-11-15T14:51:03.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3580" PostTypeId="1" AcceptedAnswerId="3581" CreationDate="2014-11-15T14:43:20.087" Score="4" ViewCount="221" Body="&lt;p&gt;I have a strange behavior - sometimes while editing, permissions of &lt;code&gt;.rs&lt;/code&gt; files are changed from 0644 to 0755. I'm not sure if it is specific for &lt;code&gt;rust-mode&lt;/code&gt; or not as so far it is the only mode I regularly use. The most annoying thing is that it happens absolutely randomly.&lt;/p&gt;&#xA;" OwnerUserId="474" LastActivityDate="2014-11-17T14:30:54.713" Title="Sporadical change of permissions of file being edited" Tags="|files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3581" PostTypeId="2" ParentId="3580" CreationDate="2014-11-15T15:00:36.547" Score="6" Body="&lt;h3&gt;What causes files to automatically become executable&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Emacs auto-sets the file permissions to &lt;code&gt;0755&lt;/code&gt; when the following 2 conditions meet:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The file has hash-bang/shebang &lt;code&gt;#!&lt;/code&gt; at the start of file.&lt;/li&gt;&#xA;&lt;li&gt;The following is added to &lt;code&gt;init.el&lt;/code&gt; to take effect globally or in particular major modes.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use this to auto-add execute permissions to my shell and perl scripts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that the &lt;code&gt;0755&lt;/code&gt; permission is auto set for you only for the files that have something like &lt;code&gt;#!/usr/bin/env rustx&lt;/code&gt; in the beginning of the file and you have the above hook added globally or only for &lt;code&gt;rust-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Customizing the hook for a particular major mode&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Below will remove the &lt;code&gt;executable-make-buffer-file-executable-if-script-p&lt;/code&gt; function from the &lt;code&gt;after-save-hook&lt;/code&gt; only when &lt;code&gt;rust-mode-hook&lt;/code&gt; is activated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun my-rust-mode-customizations()&#xA;  (remove-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p :local))&#xA;(add-hook 'rust-mode-hook 'my-rust-mode-customizations)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I would recommend keeping this hook at least for the shell script modes.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-11-17T14:30:54.713" LastActivityDate="2014-11-17T14:30:54.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3582" PostTypeId="2" ParentId="3577" CreationDate="2014-11-15T15:55:27.337" Score="3" Body="&lt;h2&gt;Ideally&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add your setup function to &lt;code&gt;find-file-hook&lt;/code&gt;. That hook is meant for files visited by the user, and packages &lt;a href=&quot;https://emacs.stackexchange.com/a/2898/50&quot;&gt;shouldn't trigger it&lt;/a&gt; during non-interactive processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If AucTeX triggers this hook when it shouldn't, please file a bug report.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Realistically&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, there are instances in which &lt;code&gt;find-file&lt;/code&gt; is wrongly used, which leads to that hook being triggered for non-interactive stuff like temp files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In these situations, you should be able to check whether the file was visited by the user with the predicate &lt;code&gt;(called-interactively-p 'any)&lt;/code&gt;. Use this inside your setup function.&lt;br&gt;&#xA;It will return &lt;code&gt;nil&lt;/code&gt; if your function is called as part of an idle timer, so it might serve your purpose.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-15T15:55:27.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3583" PostTypeId="2" ParentId="3447" CreationDate="2014-11-15T19:16:45.960" Score="13" Body="&lt;p&gt;The &lt;code&gt;-i&lt;/code&gt; flag requests that Bash run in interactive mode, which requires a terminal.  The solution is to leave the &lt;code&gt;shell-command-switch&lt;/code&gt; variable at its default value, which is just &lt;code&gt;-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really need to run Bash in interactive mode, you will need to run it in a pseudo-terminal, by using &lt;code&gt;start-file-process&lt;/code&gt; with &lt;code&gt;process-connection-type&lt;/code&gt; bound to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-11-15T19:16:45.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3584" PostTypeId="1" AcceptedAnswerId="3587" CreationDate="2014-11-15T19:17:08.083" Score="12" ViewCount="2485" Body="&lt;p&gt;If I define font lock keywords using existing faces, I can highlight the string 'foo'.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst my-mode-font-lock-keywords&#xA;  (list&#xA;   (cons &quot;foo&quot; 'font-lock-type-face)))&#xA;&#xA;(define-derived-mode my-mode fundamental-mode &quot;My mode&quot;&#xA;  &quot;A demo mode.&quot;&#xA;  (set (make-local-variable 'font-lock-defaults) '(my-mode-font-lock-keywords)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This highlights correctly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wv8KW.png&quot; alt=&quot;foo highlighted correctly&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I define my own face:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defface my-mode-foo-face&#xA;  '((t :inherit font-lock-preprocessor-face))&#xA;  &quot;Face for highlighting 'foo'.&quot;)&#xA;&#xA;(defconst my-mode-font-lock-keywords&#xA;  (list&#xA;   (cons &quot;foo&quot; 'my-mode-foo-face)))&#xA;&#xA;(define-derived-mode my-mode fundamental-mode &quot;My mode&quot;&#xA;  &quot;A demo mode.&quot;&#xA;  (set (make-local-variable 'font-lock-defaults) '(my-mode-font-lock-keywords)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No highlighting is applied:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SnP5M.png&quot; alt=&quot;no highlighting&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use &lt;code&gt;font-lock-defaults&lt;/code&gt; with a face I've defined myself?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2017-05-02T12:46:48.547" LastActivityDate="2017-05-02T12:46:48.547" Title="How do I specify a custom face with font-lock-defaults?" Tags="|font-lock|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3585" PostTypeId="2" ParentId="3576" CreationDate="2014-11-15T19:21:32.650" Score="7" Body="&lt;p&gt;As I understand it, this is a non-issue.  Emacs is single-threaded, and only processes output from subprocesses when idle.  Therefore, there is no time between calling &lt;code&gt;start-file-process&lt;/code&gt; and &lt;code&gt;set-process-filter&lt;/code&gt; when process output could arrive without being handled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The info page &lt;code&gt;(elisp) Accepting Output&lt;/code&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Output from asynchronous subprocesses normally arrives only while Emacs is waiting for some sort of external event, such as elapsed time or terminal input.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For this to become a problem, you would have to separate creating the process and setting the filter function with a call to &lt;code&gt;sit-for&lt;/code&gt;, &lt;code&gt;accept-process-output&lt;/code&gt;, or some other command that involves user interaction via the event loop.&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastActivityDate="2014-11-15T19:21:32.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3586" PostTypeId="1" AcceptedAnswerId="3599" CreationDate="2014-11-15T19:26:46.697" Score="1" ViewCount="575" Body="&lt;p&gt;I re-installed Emacs and I tried to change the color theme. I saved the changes and the &lt;code&gt;.emacs&lt;/code&gt; file was updated but when I restarted Emacs the theme was not active! I want to point out that the package is installed in the elpa folder. The theme was loaded when I pressed it and took effect but it was not working after the restart. When I did the same for the custom themes they were working fine. I had used the same theme previously with no problem. Also the problem is not because of the theme as I tried to install more with no success. What is the problem?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="50" LastEditDate="2014-11-16T02:07:00.530" LastActivityDate="2014-11-16T02:07:00.530" Title="Problem with installed color themes" Tags="|themes|" AnswerCount="1" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="3587" PostTypeId="2" ParentId="3584" CreationDate="2014-11-15T20:05:04.773" Score="9" Body="&lt;p&gt;Take a look at the &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; value of &lt;code&gt;font-lock-type-face&lt;/code&gt; the value is just the symbol &lt;code&gt;font-lock-type-face&lt;/code&gt;. Now look at the &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; value of &lt;code&gt;my-mode-foo-face&lt;/code&gt;. Oh no! you can't! It's not a variable!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need a variable to access your face. Declaring the &lt;code&gt;foo-face&lt;/code&gt; face does not declare the &lt;code&gt;foo-face&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add &lt;code&gt;(defvar my-mode-foo-face 'my-mode-foo-face)&lt;/code&gt; after the face definition and then font-lock can use your &lt;code&gt;my-mode-foo-face&lt;/code&gt; var to access the &lt;code&gt;my-mode-foo-face&lt;/code&gt; face. Confusing I know.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit: there seems to be a better solution based on what font-lock.el says:&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Originally these variable values were face names such as `bold' etc.&#xA;;; Now we create our own faces, but we keep these variables for compatibility&#xA;;; and they give users another mechanism for changing face appearance.&#xA;;; We now allow a FACENAME in `font-lock-keywords' to be any expression that&#xA;;; returns a face.  So the easiest thing is to continue using these variables,&#xA;;; rather than sometimes evalling FACENAME and sometimes not.  sm.&#xA;&#xA;;; Note that in new code, in the vast majority of cases there is no&#xA;;; need to create variables that specify face names.  Simply using&#xA;;; faces directly is enough.  Font-lock is not a template to be&#xA;;; followed in this area.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That may be Wilfred's solution of double quoting the face in the keywords.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2014-11-15T20:24:02.873" LastActivityDate="2014-11-15T20:24:02.873" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3588" PostTypeId="1" AcceptedAnswerId="3592" CreationDate="2014-11-15T20:56:48.937" Score="8" ViewCount="723" Body="&lt;p&gt;&lt;code&gt;Q&lt;/code&gt;:  How, please, can I incorporate a visual seconds counter that will disappear when an option is selected, or when the clock runs out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Example&lt;/em&gt; -- &lt;code&gt;*Messages*&lt;/code&gt; buffer&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You have 10 seconds to make your selction.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You have 9 seconds to make your selection.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;. . .&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Time's up!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have a variable that is called &lt;code&gt;init-variable&lt;/code&gt;.  When &lt;code&gt;non-nil&lt;/code&gt;, Emacs loads with a full configuration of various user customizations.  When &lt;code&gt;nil&lt;/code&gt;, Emacs loads with the equivalent of &lt;code&gt;Emacs -Q&lt;/code&gt; -- i.e., no user customizations are loaded.  The function &lt;code&gt;read-char-exclusive&lt;/code&gt; has a nice feature for a seconds counter, and I've incorporated that feature into the code snippet below. Option number &lt;code&gt;1&lt;/code&gt; sets the &lt;code&gt;init-variable&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;; option number &lt;code&gt;2&lt;/code&gt; or no action result in the default setting of &lt;code&gt;non-nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar init-variable t)&#xA;&#xA;(let* (&#xA;    (emacs-q (read-char-exclusive nil nil 10)))&#xA;  (cond&#xA;    ((eq emacs-q ?1)&#xA;      (setq init-variable nil)&#xA;      (message &quot;Emacs -Q&quot;))&#xA;    ((eq emacs-q ?2)&#xA;      (message &quot;Regular Loading.&quot;))&#xA;    (t (message &quot;This is the default.&quot;)) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-11-15T23:15:18.180" LastActivityDate="2014-11-16T17:11:57.850" Title="How to display a visual seconds clock counter -- 10, 9, 8, . . time's up!" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3589" PostTypeId="1" AcceptedAnswerId="3591" CreationDate="2014-11-15T21:15:56.223" Score="9" ViewCount="4786" Body="&lt;p&gt;&lt;strong&gt;How do I split my windows on startup like so:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_____________&#xA;|  A  |  B  |&#xA;|_____|_____|&#xA;|     C     |&#xA;|___________|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2565" LastEditorUserId="253" LastEditDate="2014-11-16T00:06:53.497" LastActivityDate="2014-11-17T16:04:26.250" Title="Splitting windows on startup" Tags="|window|init-file|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3591" PostTypeId="2" ParentId="3589" CreationDate="2014-11-15T21:18:27.123" Score="13" Body="&lt;p&gt;Put the following code in your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(split-window-below)&#xA;(split-window-right)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another option that you can add to your &lt;code&gt;.emacs&lt;/code&gt; file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(split-window-vertically)&#xA;(split-window-horizontally)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-16T21:35:24.927" LastActivityDate="2014-11-16T21:35:24.927" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3592" PostTypeId="2" ParentId="3588" CreationDate="2014-11-15T21:46:11.400" Score="7" Body="&lt;p&gt;From its docstring, I'm guessing that you can't incorporate the countdown message functionality into &lt;code&gt;read-char-exclusive&lt;/code&gt;.  However, you &lt;em&gt;can&lt;/em&gt; wrap it up in your own timer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((choice nil)&#xA;      (count  3))&#xA;  (while (&amp;gt;= count 0)&#xA;    (message (format &quot;Seconds left to make your choice: %d&quot; count))&#xA;    (setq count (if (setq choice (read-char-exclusive nil nil 1))&#xA;                    -1&#xA;                  (1- count))))&#xA;  (cond ((eq choice ?1)&#xA;         (message &quot;You entered 1&quot;))&#xA;        ((eq choice ?2)&#xA;         (message &quot;You entered 2&quot;))&#xA;        (t&#xA;         (message &quot;The default&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually, this might be sufficiently useful to wrap it up in a function.  Here's a quick sketch that works for a few functions that take the same arguments in the same order (&lt;code&gt;read-char&lt;/code&gt;, &lt;code&gt;read-char-exclusive&lt;/code&gt;, &lt;code&gt;read-event&lt;/code&gt;, and perhaps others) -- extend as you like to do things with &lt;code&gt;read-string&lt;/code&gt; and others that take a different argument list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun countdown-read (fnx &amp;amp;optional prompt inherit-input-method seconds)&#xA;  &quot;Reads a character or event and provides a countdown of SECONDS&#xA;to provide input.  Return nil if no input arrives in time.&#xA;&#xA;FNX is a function that supports the rest of the&#xA;arguments (currently, `read-char', `read-char-exclusive',&#xA;`read-event', and maybe others).&#xA;If the optional argument PROMPT is non-nil, display that as a&#xA;prompt.&#xA;If the optional argument INHERIT-INPUT-METHOD is non-nil and some&#xA;input method is turned on in the current buffer, that input&#xA;method is used for reading a character.&#xA;If the optional argument SECONDS is non-nil, it should be a&#xA;number specifying the maximum number of seconds to wait for&#xA;input (default: 5).&quot;&#xA;  (let (choice (seconds (or seconds 5)))&#xA;    (while (&amp;gt;= seconds 0)&#xA;      (message (format (concat (or prompt &quot;&quot;) &quot; (%d): &quot;) seconds))&#xA;      (setq seconds (if (setq choice&#xA;                              (funcall fnx nil inherit-input-method 1))&#xA;                        -1&#xA;                      (1- seconds))))&#xA;    choice))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using it would look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(countdown-read #'read-char-exclusive &quot;Please enter a character&quot; nil 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-16T17:11:57.850" LastActivityDate="2014-11-16T17:11:57.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3593" PostTypeId="1" CreationDate="2014-11-15T22:50:04.200" Score="2" ViewCount="335" Body="&lt;p&gt;Is there any way to enable the following behavior. Let's say i have some code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def main(args: List[String]): Unit = {&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of cause the blank line between braces is indented, but when i move cursor to that position i need to hit tab to place it on the proper column according to my indentation settings, can i enable such behavior by default? E.g in the given example, if i move cursor up or down, the cursor would be in this position:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def main(args: List[String]): Unit = {&#xA;|    &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But i want it to be in this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def main(args: List[String]): Unit = {&#xA;  |    &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2361" LastActivityDate="2020-01-13T06:11:03.037" Title="Move cursor with respect to indentation" Tags="|indentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3594" PostTypeId="2" ParentId="3593" CreationDate="2014-11-15T23:15:27.730" Score="2" Body="&lt;p&gt;The command &lt;code&gt;back-to-indentation&lt;/code&gt; (bound to &lt;kbd&gt;M-m&lt;/kbd&gt; by default) moves point to the first non-whitespace character on the current line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Arranging for it to be called whenever you move the cursor is a matter of advising the correct function. For example, the following will cause &lt;code&gt;back-to-indentation&lt;/code&gt; to be called whenever you move up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'previous-line :after #'back-to-indentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I strongly advise against such a customization: you most probably want to go to the indentation only in a limited set of occasions (maybe for whitespace-only lines?). Most of the time, you probably expect your cursor to stay on the same column when moving up or down.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-11-15T23:15:27.730" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3595" PostTypeId="1" AcceptedAnswerId="3596" CreationDate="2014-11-15T23:17:40.133" Score="36" ViewCount="4505" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; When, if ever, is it useful to sharp-quote a &lt;code&gt;lambda&lt;/code&gt;, and when, if ever, must we &lt;em&gt;not&lt;/em&gt; sharp-quote a &lt;code&gt;lambda&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;People use &lt;code&gt;lambda&lt;/code&gt;s in three ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;plain: &lt;code&gt;(lambda (x) x)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;quoted: &lt;code&gt;'(lambda (x) x)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;sharp-quoted: &lt;code&gt;#'(lambda (x) x)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1852844/emacs-lisp-difference-between-function-lambda-and-lambda&quot;&gt;This SO thread&lt;/a&gt; discusses the three types, &lt;a href=&quot;https://stackoverflow.com/questions/20948325/why-not-quoting-lambda&quot;&gt;this SO thread&lt;/a&gt; explains why not to quote (NB: not &lt;em&gt;sharp-quote&lt;/em&gt;) &lt;code&gt;lambda&lt;/code&gt;s, and &lt;a href=&quot;https://stackoverflow.com/questions/16801396/when-should-emacs-function-syntax-be-used&quot;&gt;this SO thread&lt;/a&gt; also discusses the distinctions between quoting and sharp-quoting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html#Anonymous-Functions&quot; rel=&quot;noreferrer&quot;&gt;manual node on anonymous functions&lt;/a&gt; and the docstring for &lt;code&gt;lambda&lt;/code&gt; note that &lt;code&gt;lambda&lt;/code&gt;s are self-quoting:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A call of the form &lt;code&gt;(lambda ARGS DOCSTRING INTERACTIVE BODY)&lt;/code&gt; is&#xA;  self-quoting; the result of evaluating the lambda expression is the&#xA;  expression itself.  The lambda expression may then be treated as a&#xA;  function...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, it appears that &lt;code&gt;(lambda (x) x)&lt;/code&gt; and &lt;code&gt;#'(lambda (x) x)&lt;/code&gt; are equivalent, but &lt;code&gt;'(lambda (x) x)&lt;/code&gt; is not (most importantly, when byte-compiling).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like one would rarely want to &lt;em&gt;quote&lt;/em&gt; a &lt;code&gt;lambda&lt;/code&gt;, but it's unclear to me when, if ever, we should, or should not, sharp-quote:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is sharp-quoting a &lt;code&gt;lambda&lt;/code&gt; simply a stylistic choice, or are there circumstances in which sharp-quoting is actually useful?&lt;/li&gt;&#xA;&lt;li&gt;Are there circumstances in which we must &lt;em&gt;not&lt;/em&gt; sharp-quote a &lt;code&gt;lambda&lt;/code&gt;, that is, when doing so would alter the meaning of the code?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2019-04-18T13:28:45.480" Title="When to sharp-quote a lambda expression?" Tags="|elisp|functions|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3596" PostTypeId="2" ParentId="3595" CreationDate="2014-11-15T23:41:29.047" Score="33" Body="&lt;p&gt;&lt;a href=&quot;http://endlessparentheses.com/get-in-the-habit-of-using-sharp-quote.html&quot;&gt;Once upon a time&lt;/a&gt;, the sharp quote was necessary for lambdas, now that's no longer the case.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. In fact, the first two are completely identical when evaluated. As described in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html#Anonymous-Functions&quot;&gt;manual page&lt;/a&gt; you linked:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The following forms are all equivalent:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda (x) (* x x)) &#xA;(function (lambda (x) (* x x))) &#xA;#'(lambda (x) (* x x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So don't.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As a sidenote:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Hard quoting a lambda (with &lt;code&gt;'&lt;/code&gt;) does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-16T02:37:41.193" LastActivityDate="2014-11-16T02:37:41.193" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3598" PostTypeId="2" ParentId="3595" CreationDate="2014-11-16T00:33:21.817" Score="5" Body="&lt;p&gt;Since &lt;code&gt;lambda&lt;/code&gt; doesn't make any sense when it's not quoted, recent versions of Emacs Lisp follow (ANSI) Common Lisp in interpreting unquoted &lt;code&gt;(lambda...)&lt;/code&gt; as &lt;code&gt;#'(lambda...)&lt;/code&gt;.  The two notations are almost exactly equivalent (except within quoted structure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether to prefer &lt;code&gt;(lambda...)&lt;/code&gt; or &lt;code&gt;#'(lambda...)&lt;/code&gt; is therefore purely a matter of style.  Some people prefer the naked form, which avoids syntactic noise, while others (including myself) prefer the quoted form.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-11-16T00:33:21.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3599" PostTypeId="2" ParentId="3586" CreationDate="2014-11-16T00:43:05.650" Score="4" Body="&lt;p&gt;&lt;strong&gt;STEP 1&lt;/strong&gt;:  Place the following code in the &lt;code&gt;.emacs&lt;/code&gt; file, and restart Emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA; (add-to-list 'package-archives&#xA;   '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP 2&lt;/strong&gt;:  &lt;code&gt;M-x list-packages RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP 3&lt;/strong&gt;:  Click on and install &lt;code&gt;dakrone-theme&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP 4&lt;/strong&gt;:  Open up the &lt;code&gt;.emacs&lt;/code&gt; file and add the following line of code &lt;strong&gt;at the very bottom&lt;/strong&gt; and then restart Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'dakrone t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP 5&lt;/strong&gt;:  Crack open your favorite beverage and enjoy your new color theme.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-11-16T00:43:05.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3600" PostTypeId="1" AcceptedAnswerId="3605" CreationDate="2014-11-16T03:45:24.060" Score="5" ViewCount="241" Body="&lt;p&gt;I installed &lt;code&gt;auto-complete&lt;/code&gt; and also &lt;code&gt;auto-complete-latex&lt;/code&gt; so to be able to use it with LaTeX files. Because in a document I use an external file with the preamble commands in it, Emacs recognises only the external one as a LaTeX file and the other is recognised as a plain TeX file, preventing the auto-completion. What can I do so fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use AUCTeX.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="25" LastEditDate="2014-11-16T13:52:04.250" LastActivityDate="2014-11-16T18:48:39.853" Title="Recognize LaTeX partial files (with no preamble) as LaTeX" Tags="|latex|auctex|auto-complete-mode|tex-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3601" PostTypeId="2" ParentId="3533" CreationDate="2014-11-16T08:41:17.673" Score="1" Body="&lt;p&gt;In the comments you said you wanted to depend on the Windows language bar. The Windows &lt;a href=&quot;http://technet.microsoft.com/en-us/library/hh852165.aspx&quot; rel=&quot;nofollow&quot;&gt;Get-WinDefaultInputMethodOverride&lt;/a&gt; Cmdlet in Window PowerShell provides the necessary information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, when creating a new buffer, you need to run &lt;code&gt;PowerShell Get-WinDefaultInputMethodOverride&lt;/code&gt; and parse the ouput. If you do this for &lt;em&gt;every&lt;/em&gt; buffer, even for temporary buffers, my guess is that this slow you down very much. It would be better to write a function that can be added to hooks such as &lt;code&gt;find-file-hooks&lt;/code&gt;. The functions on this hook are only called when you open a file for editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calling a command and capturing the output happens using &lt;code&gt;(shell-command-to-string COMMAND)&lt;/code&gt;. Comparing a string to some other values happens via &lt;code&gt;(string-match REGEXP STRING)&lt;/code&gt;. Setting the font for a particular buffer involves calling &lt;code&gt;(face-remap-add-relative FACE &amp;amp;rest SPECS)&lt;/code&gt;. The face you are interested in is called &lt;code&gt;default&lt;/code&gt;. The specs you want are &lt;code&gt;:family&lt;/code&gt; and &lt;code&gt;:height&lt;/code&gt;, the font family and the font size in tenths of points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, perhaps (untested, since I'm not on Windows):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-buffer-setup ()&#xA;  (let ((output (shell-command-to-string &quot;PowerShell Get-WinDefaultInputMethodOverride&quot;)))&#xA;    (cond ((string-match &quot;arabic&quot; output)&#xA;           (face-remap-add-relative 'default :family &quot;DejaVu Sans Mono&quot; :height 140))&#xA;          ((string-match &quot;english&quot; output)&#xA;           (face-remap-add-relative 'default :family &quot;Consolas&quot; :height 110))&#xA;          ((string-match &quot;german&quot; output)&#xA;           (face-remap-add-relative 'default :family &quot;Consolas&quot; :height 120)))))&#xA;&#xA;(add-hook 'find-file-hook 'my-buffer-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Good luck. :)      &lt;/p&gt;&#xA;" OwnerUserId="360" LastActivityDate="2014-11-16T08:41:17.673" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3602" PostTypeId="2" ParentId="2293" CreationDate="2014-11-16T08:49:32.193" Score="4" Body="&lt;p&gt;Every major mode that supports font-lock does so via &lt;code&gt;font-lock-defaults&lt;/code&gt;. If you check &lt;code&gt;python-mode&lt;/code&gt;, you'll see the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'font-lock-defaults)&#xA;     '(python-font-lock-keywords nil nil nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're in a different major mode, you should be able to set &lt;code&gt;font-lock-defaults&lt;/code&gt; to &lt;code&gt;(python-font-lock-keywords nil nil nil nil)&lt;/code&gt; either interactively using &lt;code&gt;M-:&lt;/code&gt; or via a hook.&lt;/p&gt;&#xA;" OwnerUserId="360" LastActivityDate="2014-11-16T08:49:32.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3603" PostTypeId="1" AcceptedAnswerId="5588" CreationDate="2014-11-16T11:57:39.477" Score="1" ViewCount="578" Body="&lt;p&gt;When I start Emacs 24.4.1 (with &lt;code&gt;-Q&lt;/code&gt; parameter), my welcome screen looks quite strange:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wb5eS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This text is in plain English, right? What is so special about it that causes this peculiar rendering? For all other buffers everything is fine... There are 'buttons', but buttons in other windows work OK. Perhaps it has something to do with the logo?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The cause of the problem;&lt;/li&gt;&#xA;&lt;li&gt;How to fix it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="50" LastEditDate="2014-11-16T13:52:24.113" LastActivityDate="2014-12-20T13:24:38.603" Title="Problems with font in the Startup Screen" Tags="|fonts|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3605" PostTypeId="2" ParentId="3600" CreationDate="2014-11-16T13:50:01.223" Score="5" Body="&lt;p&gt;When Emacs opens a &lt;code&gt;.tex&lt;/code&gt; file, it runs the &lt;code&gt;tex-mode&lt;/code&gt; function, which tries to guess what format the file is for and invokes &lt;code&gt;plain-tex-mode&lt;/code&gt; or &lt;code&gt;latex-mode&lt;/code&gt; (or &lt;code&gt;slitex-mode&lt;/code&gt;) accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to force a specific file to be opened in LaTeX mode, use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes&quot; rel=&quot;nofollow&quot;&gt;file variable&lt;/a&gt;. Put this line near the top of your &lt;code&gt;.tex&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% -*-latex-*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or these lines near the bottom:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% Local Variables:&#xA;%% mode: latex&#xA;%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This applies to both Emacs's default &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/TeX-Mode.html#TeX-Mode&quot; rel=&quot;nofollow&quot;&gt;tex-mode&lt;/a&gt; and to &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/auctex.html&quot; rel=&quot;nofollow&quot;&gt;AUCTeX&lt;/a&gt;. Both use a configuration variable which defaults to LaTeX for an empty file (&lt;code&gt;tex-default-mode&lt;/code&gt; for tex-mode, &lt;code&gt;TeX-default-mode&lt;/code&gt; for AUCTeX). Apart from that, they have similar but not identical heuristics to guess between LaTeX and plain TeX. Both select LaTeX if the first command in the file is an environment or a LaTeX sectioning command. Look at the code of &lt;a href=&quot;http://bzr.savannah.gnu.org/lh/emacs/emacs-24/annotate/head:/lisp/textmodes/tex-mode.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;tex-guess-mode&lt;/code&gt;&lt;/a&gt; (built-in) or &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/tree/tex.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;TeX-tex-mode&lt;/code&gt;&lt;/a&gt; (AUCTeX) if you want to know the details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to force all files to use LaTeX mode regardless of content, AUCTeX lets you do that easily with the following line in your init file (you can also use the Customize interface to set this variable):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Always use `TeX-default-mode', which defaults to `latex-mode'&#xA;(setq TeX-force-default-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With Emacs's default tex-mode, there's no similar variable. You could instead redefine the &lt;code&gt;tex-guess-mode&lt;/code&gt; function. To systematically force LaTeX mode, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'tex-guess-mode 'latex-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, for both tex-mode and AUCTeX, you can change the mode associated with &lt;code&gt;.tex&lt;/code&gt; files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list auto-mode-alist '(&quot;\\.[tT]e[xX]\\'&quot; . latex-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Auto-complete-latex attaches itself to &lt;code&gt;latex-mode-hook&lt;/code&gt; (and &lt;code&gt;LaTeX-mode-hook&lt;/code&gt; for AUCTeX, and &lt;code&gt;yatex-mode-hook&lt;/code&gt; for YaTeX), so if your buffer is in LaTeX mode, it should be active.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2014-11-16T18:48:39.853" LastActivityDate="2014-11-16T18:48:39.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3606" PostTypeId="1" AcceptedAnswerId="3607" CreationDate="2014-11-16T14:05:41.413" Score="3" ViewCount="2712" Body="&lt;p&gt;I'm trying to get work &lt;code&gt;auto-complete&lt;/code&gt;. I've installed the package from MELPA successfully. However, it just does not work. When I enable &lt;code&gt;auto-complete-mode&lt;/code&gt; the mode seems to be active (I see &lt;code&gt;AC&lt;/code&gt; in the list of minor modes), but there is no pop-up window displaying completions when I enter some text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that it should work out-of-box, but may be it's not the case. I cannot find instructions how to configure the package installed via package manager, not manually. What actions should I undertake?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2014-11-16T14:25:41.227" Title="How to install auto-complete via package system?" Tags="|package|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3607" PostTypeId="2" ParentId="3606" CreationDate="2014-11-16T14:25:41.227" Score="5" Body="&lt;p&gt;Package installation isn't intended to &lt;em&gt;enable&lt;/em&gt; packages. Rather, installation makes code &lt;em&gt;available&lt;/em&gt; for use. So some config is generally required for non-trivial packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, &lt;code&gt;auto-complete&lt;/code&gt; comes with &lt;code&gt;auto-complete-config&lt;/code&gt;, so you might try initialization code like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete-config)&#xA;(global-auto-complete-mode t)&#xA;(set-default 'ac-sources&#xA;             '(ac-source-imenu&#xA;               ac-source-dictionary&#xA;               ac-source-words-in-buffer&#xA;               ac-source-words-in-same-mode-buffers&#xA;               ac-source-words-in-all-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-11-16T14:25:41.227" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3608" PostTypeId="1" CreationDate="2014-11-16T14:44:18.693" Score="5" ViewCount="77" Body="&lt;p&gt;I put 'portable' in quotes because, as we all know, Emacs works with plain text and this plain text is innately portable. However, the &lt;em&gt;format&lt;/em&gt; of this plain text is not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My particular use-case is with Org documents.  I have various customizations set up for Org, but I would like to use the defaults for one particular document as to use a 'neutral third-party' format.  Normally I would use my defaults, but this document is being shared among peer developers – each likely to have their own customizations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get a list of variables that have been customized in the buffer and insert either (with a &lt;code&gt;C-u&lt;/code&gt; prefix) their default values or their local values?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-16T15:48:21.203" LastActivityDate="2014-11-17T09:38:54.823" Title="How can I make documents 'portable' between Emacsen?" Tags="|file-local-variables|local-variables|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3609" PostTypeId="1" AcceptedAnswerId="3611" CreationDate="2014-11-16T18:02:45.137" Score="9" ViewCount="968" Body="&lt;p&gt;That is, can I specify for a particular file that I don't want Emacs to notify me that the file has changed on disk and prompt me about whether I want to accept changes or not?  I don't want to do this globally, just for files I know will frequently be changed outside of Emacs (in particular, calendar-related Org files).&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="50" LastEditDate="2014-11-16T18:21:08.017" LastActivityDate="2014-11-18T13:27:50.653" Title="Can I set a particular file to automatically and silently accept changes?" Tags="|org-mode|file-local-variables|local-variables|auto-revert-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3610" PostTypeId="2" ParentId="3609" CreationDate="2014-11-16T18:06:54.130" Score="3" Body="&lt;p&gt;Yes.  Put this at the end of your file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* COMMENT Config&#xA;Local Variables:&#xA;eval: (auto-revert-mode 1)&#xA;End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This assumes Org-mode, for other modes use comments in the language used as explained in the link given below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Local Variables in Files&lt;/a&gt; in the manual for the background, safety information and a caveat that this might not always be a good idea.  Also, the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html&quot; rel=&quot;nofollow&quot;&gt;section on reverting&lt;/a&gt; says e.g. how to change the default, 5-secind interval for auto-reverting.&lt;/p&gt;&#xA;" OwnerUserId="642" LastEditorUserId="642" LastEditDate="2014-11-16T18:13:37.133" LastActivityDate="2014-11-16T18:13:37.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3611" PostTypeId="2" ParentId="3609" CreationDate="2014-11-16T18:11:47.987" Score="9" Body="&lt;p&gt;You can do this for a specific buffer with &lt;code&gt;M-x auto-revert-mode&lt;/code&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;). For file buffers, this will check every &lt;code&gt;auto-revert-interval&lt;/code&gt; seconds (defaults to 5) for changes and update the buffer from disk automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your title says &quot;a particular file&quot; while your question's body mentions a file type (org files). Depending on your circumstances, here are a few ways you might set this mode to get the desired effect in a persistent manner. The earlier methods are arguably cleaner and more efficient if they apply to your particular use case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know you want this for every file of a certain type, consider adding a mode hook to your init setup.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda () (auto-revert-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you know you want it for everything in a certain directory, consider setting it in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow&quot;&gt;.dir-locals.el&lt;/a&gt; in the relevant location, making sure to VCS-ignore the local settings file if appropriate. This example will apply to all org-mode buffers for files under the same directory (and subdirs). You can also run &lt;code&gt;M-x add-dir-local-variable&lt;/code&gt; to have Emacs generate and save this for you automatically.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&#xA;  (org-mode . ((auto-revert-mode . 1)))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If neither of the two approaches above works well for you, consider a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;file local variable&lt;/a&gt; set in each file. The shortest, most general way to set one of these is to include the following in the first line of the target file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- eval: (auto-revert-mode 1); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In source files, the text can follow a comment delimiter (//, #, etc). You can run &lt;code&gt;M-x add-file-local-variable-propline&lt;/code&gt; to have Emacs generate this for you automatically, or &lt;code&gt;M-x add-file-local-variable&lt;/code&gt; for a format that uses the bottom of your file instead of the top.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use this method only if you're not sharing the file with anyone else. From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;GNU manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is often a mistake to specify minor modes this way. Minor modes represent individual user preferences, and it may be inappropriate to impose your preferences on another user who might edit the file. If you wish to automatically enable or disable a minor mode in a situation-dependent way, it is often better to do it in a major mode hook.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2574" LastEditorUserId="2574" LastEditDate="2014-11-18T13:27:50.653" LastActivityDate="2014-11-18T13:27:50.653" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3612" PostTypeId="1" AcceptedAnswerId="3937" CreationDate="2014-11-16T18:39:25.893" Score="2" ViewCount="1217" Body="&lt;p&gt;So &lt;a href=&quot;http://melpa.org/#/irony&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;irony-mode&lt;/code&gt;&lt;/a&gt; scans include directories through a file called &lt;code&gt;.clang_complete&lt;/code&gt;, which looks like something like: &lt;code&gt;-I./include/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it does not automatically load this file. Rather, I have to go into the source file  and call &lt;code&gt;irony-cdb&lt;/code&gt; and then load it manually by hitting &lt;code&gt;l&lt;/code&gt;. I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'c++-mode-hook 'irony-cdb-load-compile-options)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it did not do anything. In fact, &lt;code&gt;irony-mode&lt;/code&gt; wouldn't work period. I am trying to use &lt;code&gt;irony-mode&lt;/code&gt; as a &lt;code&gt;company-mode&lt;/code&gt; backend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How would I make this process automatic? &lt;/p&gt;&#xA;" OwnerUserId="2565" LastEditorUserId="2355" LastEditDate="2014-12-06T16:27:45.280" LastActivityDate="2014-12-06T16:27:45.280" Title="Get irony-mode to automatically load .config_clang" Tags="|hooks|completion|company-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3613" PostTypeId="5" CreationDate="2014-11-16T19:18:19.260" Score="0" Body="&lt;p&gt;Pry is a REPL (Read Eval Print Loop) interpreter.  It allows you to access the source code and the documentation, edit methods, and execute shell commands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pry.github.com/&quot; rel=&quot;nofollow&quot;&gt;http://pry.github.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="253" LastEditDate="2014-11-16T22:46:13.727" LastActivityDate="2014-11-16T22:46:13.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3614" PostTypeId="4" CreationDate="2014-11-16T19:18:19.260" Score="0" Body="Pry is an alternative to the standard Ruby interpreter, IRB." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2014-11-16T22:46:23.133" LastActivityDate="2014-11-16T22:46:23.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3616" PostTypeId="1" AcceptedAnswerId="3619" CreationDate="2014-11-16T21:51:28.220" Score="2" ViewCount="1836" Body="&lt;p&gt;The command &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Killing-by-Lines.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;kill-whole-line&lt;/code&gt;&lt;/a&gt; does just what it says.  With a prefix argument, it allows me to kill multiple lines at the same time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I get the same functionality, but with &lt;em&gt;copying&lt;/em&gt; instead of killing?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="253" LastEditDate="2014-11-16T22:39:35.857" LastActivityDate="2018-01-17T08:28:31.777" Title="Copy multiple lines?" Tags="|copy-paste|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3617" PostTypeId="2" ParentId="3616" CreationDate="2014-11-16T21:58:01.750" Score="0" Body="&lt;pre&gt;&lt;code&gt;(defun copy-multiple-lines (&amp;amp;optional arg)&#xA;  &quot;replace default `copy-line` function to copy whole lines to the kill ring.&#xA;With prefix argument ARG, copy that many lines including current one.&#xA;Negative arguments copy lines backward including current one.&#xA;If ARG is zero, copy current line but exclude the trailing newline.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (or arg (setq arg 1))&#xA;  (if (and (&amp;gt; arg 0) (eobp) (save-excursion (forward-visible-line 0) (eobp)))&#xA;      (signal 'end-of-buffer nil))&#xA;  (if (and (&amp;lt; arg 0) (bobp) (save-excursion (end-of-visible-line) (bobp)))&#xA;      (signal 'beginning-of-buffer nil))&#xA;  (cond ((zerop arg)&#xA;         (save-excursion&#xA;           (copy-region-as-kill&#xA;            (progn (beginning-of-line) (point))&#xA;            (progn (forward-visible-line 0) (point))))&#xA;         (copy-region-as-kill&#xA;          (progn (beginning-of-line) (point))&#xA;          (progn (end-of-visible-line) (point))))&#xA;        ((&amp;lt; arg 0)&#xA;         (save-excursion&#xA;           (copy-region-as-kill (point) (progn (end-of-visible-line) (point))))&#xA;         (copy-region-as-kill&#xA;          (progn (end-of-line) (point))&#xA;          (progn (forward-visible-line (1+ arg))&#xA;                 (unless (bobp) (backward-char))&#xA;                 (point))))&#xA;        (t&#xA;         (save-excursion&#xA;           (copy-region-as-kill&#xA;            (progn (beginning-of-line) (point))&#xA;            (progn (forward-visible-line 0) (point))))&#xA;         (copy-region-as-kill&#xA;          (progn (beginning-of-line) (point))&#xA;          (progn (forward-visible-line arg) (point))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bind it to a key and use it like &lt;code&gt;kill-whole-line&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2014-11-16T21:58:01.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3618" PostTypeId="1" AcceptedAnswerId="3623" CreationDate="2014-11-16T22:11:18.440" Score="13" ViewCount="4572" Body="&lt;p&gt;I would like to launch emacs to ediff either files or directories.  For example, I'd like something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -f ediff-files file1 file2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I do this, it doesn't take file1 and file2 as the two files to diff.  Rather, emacs prompts me for the files to difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to do this in one command line?&lt;/p&gt;&#xA;" OwnerUserId="2588" LastEditorUserId="25" LastEditDate="2015-05-10T15:38:43.717" LastActivityDate="2021-03-31T13:40:38.237" Title="Launch emacs with ediff-files (of ediff-directories) from command line" Tags="|ediff|invocation|command-line-arguments|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3619" PostTypeId="2" ParentId="3616" CreationDate="2014-11-16T22:24:03.367" Score="2" Body="&lt;p&gt;Install and activate the whole-line-or-region package. Now your M-w and C-w will work the way you want (including prefix arguments) when there is no region active.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-11-16T22:24:03.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3620" PostTypeId="2" ParentId="3616" CreationDate="2014-11-16T22:36:09.720" Score="3" Body="&lt;p&gt;Here's a simple function, slightly adapted from the &lt;a href=&quot;http://www.emacswiki.org/emacs/CopyingWholeLines&quot; rel=&quot;nofollow&quot;&gt;Copying Whole Lines&lt;/a&gt; node on EmacsWiki:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-whole-line (&amp;amp;optional arg)&#xA;  &quot;Like `kill-whole-line', but copy instead.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((buffer-read-only  t)&#xA;        (kill-whole-line   t)&#xA;        (kill-read-only-ok t))&#xA;    (save-excursion (kill-whole-line arg))&#xA;    (message &quot;&quot;)))  ; clear minibuffer (not strictly necessary)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-16T23:08:03.600" LastActivityDate="2014-11-16T23:08:03.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3621" PostTypeId="1" AcceptedAnswerId="3625" CreationDate="2014-11-16T22:48:10.473" Score="9" ViewCount="293" Body="&lt;p&gt;I'm editing a text in org-mode, several lines are repeated since they where part of different files from the same topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use &lt;code&gt;delete-duplicate-lines&lt;/code&gt; to delete the repeated lines, however, the command removes the blank lines too, which is something I don't want (otherwise I wouldn't have paragraphs!). I want to ignore certain words that exists alone in lines, for instance, &lt;em&gt;&quot;Resume&quot;&lt;/em&gt;, it is repeated a lot of times in the text, but I want to keep it since is required.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-01-14T23:54:03.130" Title="make `delete-duplicate-lines` ignore blank lines and certain words" Tags="|text-editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3622" PostTypeId="1" AcceptedAnswerId="4285" CreationDate="2014-11-16T22:58:55.277" Score="7" ViewCount="2190" Body="&lt;p&gt;I saw this question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/2955/&quot;&gt;How to customize background color for some web pages opened with eww?&lt;/a&gt; but this won't work for me. I'm trying to read Wikipedia pages and in many places Wikipedia uses images to render mathematical formulae. When these have transparent background, the appear not to render acceptably (example below). So, I'd like to have white-ish background theme for eww, while keeping everything else with a dark-background theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/AylCZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-12-11T20:21:24.070" Title="Use a different color theme for eww buffers" Tags="|themes|eww|coloring|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3623" PostTypeId="2" ParentId="3618" CreationDate="2014-11-16T22:59:41.877" Score="15" Body="&lt;p&gt;I'm pretty sure there are other solutions, but you can do this using &lt;code&gt;--eval&lt;/code&gt; instead of &lt;code&gt;-f&lt;/code&gt; (&lt;code&gt;--funcall&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(ediff-files &amp;quot;file1&amp;quot; &amp;quot;file2&amp;quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In fact, the Emacs manual on &amp;quot;Command Line Arguments for Emacs Invocation&amp;quot; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Action-Arguments.html&quot; rel=&quot;noreferrer&quot;&gt;says&lt;/a&gt; that &lt;code&gt;-f function&lt;/code&gt; and &lt;code&gt;--funcall function&lt;/code&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Call Lisp function &lt;em&gt;function&lt;/em&gt;. If it is an interactive function (a command), &lt;strong&gt;it reads the arguments interactively&lt;/strong&gt; just as if you had called the same function with a key sequence. Otherwise, it calls the function with no arguments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This explains why you can not get the behavior you want with &lt;code&gt;-f&lt;/code&gt;/&lt;code&gt;--funcall&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;code&gt;ediff-directories&lt;/code&gt; takes three arguments, so the command shown above changes to&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(ediff-directories &amp;quot;dir1&amp;quot; &amp;quot;dir2&amp;quot; &amp;quot;regexp&amp;quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;e.g. to compare everything in both directories (i.e. unfiltered) use .* as a regexp:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(ediff-directories &amp;quot;dir1&amp;quot; &amp;quot;dir2&amp;quot; &amp;quot;.*&amp;quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As explained &lt;a href=&quot;http://doc.endlessparentheses.com/Fun%2Fediff-meta-mode.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, &lt;code&gt;ediff-directories&lt;/code&gt; causes Emacs to enter &lt;code&gt;ediff-meta-mode&lt;/code&gt;, so you'll be dropped into the &amp;quot;Ediff Session Group Panel&amp;quot; first. From the Ediff manual on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ediff/Session-Groups.html&quot; rel=&quot;noreferrer&quot;&gt;Session Groups&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Several major entries of Ediff perform comparison and merging on directories. On entering &lt;code&gt;ediff-directories&lt;/code&gt;, &lt;code&gt;ediff-directories3&lt;/code&gt;, [...] the user is presented with a Dired-like buffer that lists files common to the directories involved along with their sizes. [...] We call this buffer &lt;em&gt;Session Group Panel&lt;/em&gt; because all Ediff sessions associated with the listed files will have this buffer as a common focal point. [...]&lt;/p&gt;&#xA;&lt;p&gt;In directory comparison or merging, a session group panel displays only the files common to all directories involved. The differences are kept in a separate directory difference buffer and are conveniently displayed by typing &lt;kbd&gt;D&lt;/kbd&gt; to the corresponding session group panel. [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So to display the actual diff, just hit &lt;kbd&gt;D&lt;/kbd&gt; (&lt;code&gt;ediff-show-dir-diffs&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="29818" LastEditDate="2020-08-12T14:24:46.740" LastActivityDate="2020-08-12T14:24:46.740" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="3624" PostTypeId="1" AcceptedAnswerId="3626" CreationDate="2014-11-16T23:21:56.077" Score="14" ViewCount="3709" Body="&lt;p&gt;I've found the rather useful &lt;a href=&quot;http://www.emacswiki.org/emacs/ELPA#toc4&quot;&gt;How Packages work in Emacs 24&lt;/a&gt;, however, I'd like a definitive answer from an experienced user or a core developer as to which of these is actually preferred in the typical case on 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Afaik, &lt;code&gt;(add-hook 'after-init-hook ...)&lt;/code&gt; is the so-to-say brute-force approach to setting up customizations for packages. However, &lt;code&gt;eval-after-load&lt;/code&gt; and its more syntactically sugary &lt;code&gt;with-eval-after-load&lt;/code&gt; seem more appropriate for more dynamic and fine grained configuration that plays well with the gradual, separate and lazy loading of extensions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my understand correct? What else should I keep in mind?&lt;/p&gt;&#xA;" OwnerUserId="2515" LastEditorUserId="50" LastEditDate="2014-11-16T23:34:08.327" LastActivityDate="2014-11-16T23:42:04.117" Title="after-init-hook vs eval-after-load/with-eval-after-load" Tags="|init-file|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3625" PostTypeId="2" ParentId="3621" CreationDate="2014-11-16T23:29:08.003" Score="5" Body="&lt;h3&gt;Ignoring blank lines&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You can tell &lt;code&gt;delete-duplicate-lines&lt;/code&gt; to ignore blank lines by calling it via&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;delete-duplicate-lines&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to have to hit &lt;kbd&gt;C-u&lt;/kbd&gt; that many times when you call &lt;code&gt;delete-duplicate-lines&lt;/code&gt;, you can wrap it in a custom command and bind that command to a key sequence of your choice:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-duplicate-lines-keep-blanks ()&#xA;  (interactive)&#xA;  (delete-duplicate-lines (region-beginning) (region-end) nil nil t))&#xA;&#xA;(global-set-key (kbd &quot;C-c d&quot;) 'delete-duplicate-lines-keep-blanks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Ignoring lines matching regexp&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;As for the second part of your question, I don't think you can achieve what you want using the built-in version of &lt;a href=&quot;http://doc.endlessparentheses.com/Fun%2Fdelete-duplicate-lines.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;delete-duplicate-lines&lt;/code&gt;&lt;/a&gt;. You can, however, use a &lt;em&gt;modified&lt;/em&gt; version of the command (which also keeps blank lines by default):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-duplicate-lines&#xA;    (beg end keep &amp;amp;optional reverse adjacent keep-blanks interactive)&#xA;  (interactive&#xA;   (progn&#xA;     (barf-if-buffer-read-only)&#xA;     (list (region-beginning) (region-end)&#xA;           (read-string &quot;Keep lines matching regexp: &quot;) ; Prompt for regexp to keep&#xA;           (equal current-prefix-arg '(4))&#xA;           (equal current-prefix-arg '(16))&#xA;           t                                            ; Keep blanks by default&#xA;           t)))&#xA;  (let ((lines (unless adjacent (make-hash-table :test 'equal)))&#xA;        line prev-line&#xA;        (count 0)&#xA;        (beg (copy-marker beg))&#xA;        (end (copy-marker end)))&#xA;    (save-excursion&#xA;      (goto-char (if reverse end beg))&#xA;      (if (and reverse (bolp)) (forward-char -1))&#xA;      (while (if reverse&#xA;             (and (&amp;gt; (point) beg) (not (bobp)))&#xA;               (and (&amp;lt; (point) end) (not (eobp))))&#xA;        (setq line (buffer-substring-no-properties&#xA;                (line-beginning-position) (line-end-position)))&#xA;        (if (or (and keep-blanks (string= &quot;&quot; line))&#xA;                (string-match keep line))               ; Ignore line if it&#xA;                                                        ; matches regexp to keep&#xA;            (forward-line 1)&#xA;          (if (if adjacent (equal line prev-line) (gethash line lines))&#xA;              (progn&#xA;                (delete-region (progn (forward-line 0) (point))&#xA;                               (progn (forward-line 1) (point)))&#xA;                (if reverse (forward-line -1))&#xA;                (setq count (1+ count)))&#xA;            (if adjacent (setq prev-line line) (puthash line t lines))&#xA;            (forward-line (if reverse -1 1))))))&#xA;    (set-marker beg nil)&#xA;    (set-marker end nil)&#xA;    (when interactive&#xA;      (message &quot;Deleted %d %sduplicate line%s%s&quot;&#xA;               count&#xA;               (if adjacent &quot;adjacent &quot; &quot;&quot;)&#xA;               (if (= count 1) &quot;&quot; &quot;s&quot;)&#xA;               (if reverse &quot; backward&quot; &quot;&quot;)))&#xA;    count))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This version of &lt;code&gt;delete-duplicate-lines&lt;/code&gt; will prompt you for a regexp and keep all lines that match the regexp. For instance, to keep all lines consisting of the word &lt;code&gt;Resume&lt;/code&gt; you would do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;delete-duplicate-lines&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;^Resume$&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-14T23:54:03.130" LastActivityDate="2015-01-14T23:54:03.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3626" PostTypeId="2" ParentId="3624" CreationDate="2014-11-16T23:42:04.117" Score="12" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Afaik, &lt;code&gt;(add-hook 'after-init-hook ...)&lt;/code&gt; is the so-to-say brute-force approach to setting up customizations for packages.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. If you want to configure packages in your init file, the typical&#xA;approach is to call &lt;code&gt;(package-initialize)&lt;/code&gt; at the top of the file, and&#xA;then do the configurations. &lt;code&gt;after-init-hook&lt;/code&gt; is unnecessarily&#xA;complicated for this purpose.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, &lt;code&gt;eval-after-load&lt;/code&gt; and its more syntactically sugary &lt;code&gt;with-eval-after-load&lt;/code&gt; seem more appropriate for more dynamic and fine grained configuration that plays well with the gradual, separate and lazy loading of extensions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(with-)eval-after-load&lt;/code&gt; is used for things you want to do &lt;em&gt;after&lt;/em&gt; a&#xA;package is loaded. &lt;code&gt;package-initialize&lt;/code&gt; doesn't load the packages, it&#xA;only “prepares” them (loads their autoloads). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;eval-after-load&lt;/code&gt; around every set of configurations, you&#xA;won't need to call &lt;code&gt;(package-initialize)&lt;/code&gt; at the top. But what people&#xA;usually do is to call &lt;code&gt;(package-initialize)&lt;/code&gt;, so that most&#xA;configurations can be written straight to the init file, and then only&#xA;&lt;code&gt;eval-after-load&lt;/code&gt; code which is very long or which depends on the&#xA;package being loaded.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-16T23:42:04.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3627" PostTypeId="1" AcceptedAnswerId="3628" CreationDate="2014-11-16T23:45:37.860" Score="5" ViewCount="1219" Body="&lt;p&gt;I have used &quot;Customize&quot; to set a value for &lt;code&gt;semantic-lex-c-preprocessor-symbol-file&lt;/code&gt;. However, after loading up .emacs, this isn't the value I see. On opening up the &quot;Customize&quot; menu for this variable, I see that its state is &quot;Changed outside customize&quot;. How do I find it where this was changed? Also, what is the right way of customizing variables to avoid such issues?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2020-01-23T14:57:19.147" Title="Detecting variable changed outside customize" Tags="|customize|semantic-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3628" PostTypeId="2" ParentId="3627" CreationDate="2014-11-17T00:42:52.740" Score="4" Body="&lt;p&gt;It is not easy to find &lt;em&gt;where&lt;/em&gt; such a change was made.  The easiest way to find it is to &lt;em&gt;recursively bisect your init file&lt;/em&gt;, to find out which part of it causes this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do that you can use command &lt;code&gt;comment-region&lt;/code&gt;.  With &lt;code&gt;C-u&lt;/code&gt; it uncomments the region.  Comment out 1/2, then 3/4, then 7/8, then 15/16,... of your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond that, code such as this will detect &lt;em&gt;which&lt;/em&gt; variables have been changed outside Customize (but I think you already know which variables are concerned):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((vars  ()))&#xA;  (mapatoms&#xA;   (lambda (symbol)&#xA;     (let ((cval  (or (get symbol 'customized-value)&#xA;                      (get symbol 'saved-value)&#xA;                      (get symbol 'standard-value))))&#xA;       (when (and cval                  ; It is declared with defcustom.&#xA;                  (default-boundp symbol) ; It has a value.&#xA;                  (not (equal (eval (car cval)) ; Value does not match customize's.&#xA;                              (default-value symbol))))&#xA;         (push symbol vars)))))&#xA;  (message &quot;Variables changed outside: %s&quot; vars))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to let something change a value outside Customize, but you want Customize to consider that it was changed inside Customize, you can do it using library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/cus-edit%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;cus-edit+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.  See also &lt;a href=&quot;http://www.emacswiki.org/emacs/CustomizingAndSaving&quot; rel=&quot;nofollow&quot;&gt;Customizing and Saving&lt;/a&gt; on Emacs Wiki.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the right way to avoid such issues: use Customize to change and save the value.  But you already did that.  As you say, some other code seems to be changing the value after your saved value is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Wrt where to let Customize save changes, I recommend that you use a separate &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Customizations.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;custom-file&lt;/code&gt;&lt;/a&gt;, instead of letting Customize write stuff to your init file.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:38:16.497" LastActivityDate="2015-05-09T20:38:16.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3629" PostTypeId="1" AcceptedAnswerId="3647" CreationDate="2014-11-17T01:16:17.427" Score="15" ViewCount="4935" Body="&lt;p&gt;There is a lot written for using emacs as a full-blown primary email program. I am looking for something with a simple setup so that I can keep Thunderbird as my primary email management program but compose and send email in emacs. Since python can send mail from the command line, I suspect this would not be too difficult for emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next step: if possible I'd still like to be able to sync with an imap server to pull off the last ~100 emails so I can compose responses in emacs. This wouldn't require folder management, but some amount of syncing, though I don't need to keep the messages locally available to emacs after the session. Would it still require offlineimap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions for a suitable configuration?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastEditorDisplayName="user2005" LastEditDate="2014-11-17T15:52:56.190" LastActivityDate="2023-01-26T08:20:33.100" Title="Using emacs with thunderbird to compose and respond to mail" Tags="|email|" AnswerCount="4" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3630" PostTypeId="1" AcceptedAnswerId="3634" CreationDate="2014-11-17T01:30:45.143" Score="8" ViewCount="175" Body="&lt;p&gt;When selecting an item from the occur buffer, the highlighted line is at the very bottom of the visible screen. This is less useful than having it 25-50% of the way down the screen(so it's easy to read the text around the found line). Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="99" LastActivityDate="2015-05-09T20:38:00.807" Title="Can Occur center the found text in the buffer?" Tags="|occur|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3631" PostTypeId="1" AcceptedAnswerId="3632" CreationDate="2014-11-17T01:39:55.320" Score="14" ViewCount="1729" Body="&lt;p&gt;I'm trying to write a function that will retrieve the docstrings from any sexps in a file that match &lt;code&gt;(def.*)&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd want to both be able to retrieve any functions/macros, as well as any variables that are defined.  For variables I would want the docstring, while for any functions I would also want the argument lists.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="105" LastEditDate="2015-07-11T04:46:32.560" LastActivityDate="2015-07-11T04:46:32.560" Title="How to retrieve docstrings from functions and variables?" Tags="|elisp|doc-strings|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3632" PostTypeId="2" ParentId="3631" CreationDate="2014-11-17T01:54:12.633" Score="14" Body="&lt;p&gt;If the goal is to get information about functions and variables &lt;em&gt;already in the environment&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For docstrings of functions and macros, see the &lt;code&gt;documentation&lt;/code&gt; function.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For variable docstrings, use &lt;code&gt;documentation-property&lt;/code&gt;; for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(documentation-property&#xA; 'user-init-file 'variable-documentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For function arity and the argument list, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/971/argspec-or-arity-of-a-bytecode-function-in-emacs-24&quot;&gt;this Emacs.SE question&lt;/a&gt;, the answer, and comments to the question.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(I found this by pressing &lt;code&gt;C-h k C-h f&lt;/code&gt; and skimming the source code of &lt;code&gt;describe-function&lt;/code&gt; (same for variable docstrings, but studying &lt;code&gt;describe-variable&lt;/code&gt;).)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To analyze an Emacs Lisp source code file, assuming that the goal is to get information about top-level &lt;code&gt;def.*&lt;/code&gt; forms, one can do something similar to the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-defun-info (buffer)&#xA;  &quot;Get information about all `defun' top-level sexps in a buffer&#xA;BUFFER. Returns a list with elements of the form (symbol args docstring).&quot;&#xA;  (with-current-buffer buffer&#xA;    (save-excursion&#xA;      (save-restriction&#xA;        (widen)&#xA;        (goto-char (point-min))&#xA;        (let (result)&#xA;          ;; keep going while reading succeeds&#xA;          (while (condition-case nil&#xA;                     (progn&#xA;                       (read (current-buffer))&#xA;                       (forward-sexp -1)&#xA;                       t)&#xA;                   (error nil))&#xA;            (let ((form (read (current-buffer))))&#xA;              (cond&#xA;               ((not (listp form))      ; if it's not a list, skip it&#xA;                nil)&#xA;               ((eq (nth 0 form) 'defun) ; if it's a defun, collect info&#xA;                (let ((sym (nth 1 form))&#xA;                      (args (nth 2 form))&#xA;                      (doc (when (stringp (nth 3 form)) (nth 3 form))))&#xA;                  (push (list sym args doc) result))))))&#xA;          result)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can be easily extended to &lt;code&gt;defvar&lt;/code&gt;, &lt;code&gt;defconst&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To handle &lt;code&gt;defun&lt;/code&gt; appearing &lt;em&gt;inside&lt;/em&gt; top-level forms one would have to descend &lt;em&gt;into&lt;/em&gt; these forms, possibly using recursion.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-17T09:18:04.613" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3634" PostTypeId="2" ParentId="3630" CreationDate="2014-11-17T02:39:43.907" Score="9" Body="&lt;p&gt;I don't see the behavior that you describe, at all.  For me, when I choose an occurrence in buffer &lt;code&gt;*Occur*&lt;/code&gt; it visits the occurrence in the source buffer, putting that smack in the middle of the source-buffer window (vertically).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you see what you describe, then just put some window-recentering code on &lt;strong&gt;&lt;code&gt;occur-mode-find-occurrence-hook&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this.  You can use any comparison condition you like. Here, I used &quot;within 10 lines of the top or bottom&quot;, but you could use percentages etc.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (let ((line   (line-number-at-pos)))&#xA;    (cond ((&amp;lt;= line (+ (line-number-at-pos (window-start)) 10))&#xA;           (recenter 10))&#xA;          ((&amp;gt;= line (- (line-number-at-pos (window-end)) 10))&#xA;           (recenter -10)))))&#xA;&#xA;(add-hook 'occur-mode-find-occurrence-hook 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:38:00.807" LastActivityDate="2015-05-09T20:38:00.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3635" PostTypeId="2" ParentId="3629" CreationDate="2014-11-17T02:40:41.707" Score="5" Body="&lt;p&gt;This should at least, get you started:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;but compose and send email in emacs. Since python can send mail from the command line, I suspect this would not be too difficult for emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is what I have in my init file for composing mail, and send them using gmail, gnutsl should be installed in your OS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; send mail&#xA;(setq&#xA; send-mail-function 'smtpmail-send-it&#xA; message-send-mail-function 'smtpmail-send-it&#xA; user-mail-address &quot;patrick.nsukami@gmail.com&quot;&#xA; smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; &quot;587&quot; nil nil))&#xA; smtpmail-auth-credentials  (expand-file-name &quot;~/.authinfo&quot;)&#xA; smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-service 587&#xA; smtpmail-debug-info t&#xA; starttls-extra-arguments nil&#xA; starttls-gnutls-program &quot;/usr/bin/gnutls-cli&quot;&#xA; starttls-extra-arguments nil&#xA; starttls-use-gnutls t&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Next step: if possible I'd still like to be able to sync with an imap server to pull off the last ~100 emails so I can compose responses in emacs. This wouldn't require folder management, but some amount of syncing, though I don't need to keep the messages locally available to emacs after the session&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You should configure your mailbox and enable &lt;a href=&quot;https://support.google.com/mail/troubleshooter/1668960?hl=en&quot; rel=&quot;noreferrer&quot;&gt;IMAP&lt;/a&gt;, you'll be able to manage your mails from many devices. This is my config, for reading mails from gmail using emacs &amp;amp; gnus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;read mail w/ gnus&#xA;(setq gnus-select-method '(nnimap &quot;gmail&quot;&#xA;(nnimap-address &quot;imap.gmail.com&quot;)&#xA;(nnimap-server-port 993)&#xA;(nnimap-stream ssl)))&#xA;(setq mm-discouraged-alternatives '(&quot;text/html&quot; &quot;text/richtext&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Would it still require offlineimap?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've never used &lt;a href=&quot;http://www.emacswiki.org/emacs/OfflineIMAP&quot; rel=&quot;noreferrer&quot;&gt;offlineimap&lt;/a&gt;, but you should if you want to manage your mails when offline, then, as soon as you're online, the sync will occur between your computer and the server&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.emacswiki.org/emacs/GnusAuthinfo&quot; rel=&quot;noreferrer&quot;&gt;~/.authinfo&lt;/a&gt; file will be used to store your credentials, and it will have at least two lines, the first line for sending mails:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;machine smtp.gmail.com port 587 login you@somewhere.com password NotsoiNcreDiblePassword&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second one for retrieving mails:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;machine imap.gmail.com secret port 993 login you@somewhere.com password NotsoiNcreDiblePassword&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-11-17T02:51:09.913" LastActivityDate="2014-11-17T02:51:09.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3636" PostTypeId="1" CreationDate="2014-11-17T03:30:22.617" Score="1" ViewCount="338" Body="&lt;p&gt;I have a very long document inside one org file, I plan to add more documents to it making many top level headers in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there is a way to set a property to an org section making it and it's sub-sections read only, and avoid flyspell check the spelling too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2014/09/13/Make-some-org-sections-read-only/&quot; rel=&quot;nofollow&quot;&gt;The Kitchin Research Group: Make some org-sections read-only&lt;/a&gt; for the read only part, but I'm not sure if that way covers the all sub-sections too.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-11-17T03:30:22.617" Title="org :PROPERTY: &quot;read only&quot; and &quot;no spell check&quot;?" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3637" PostTypeId="1" CreationDate="2014-11-17T04:55:38.203" Score="6" ViewCount="257" Body="&lt;p&gt;I have a docstring to a simple function, but the docstring uses many escape sequences to explain the reasoning for the function. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sx-encoding-normalize-line-endings (string)&#xA;  &quot;Normalize the line endings for STRING.&#xA;&#xA;The API returns strings that use Windows-style line endings.&#xA;These are largely useless in an Emacs environment.  Windows uses&#xA;\&quot;\\r\\n\&quot;, Unix uses just \&quot;\\n\&quot;.  Deleting \&quot;\\r\&quot; is&#xA;sufficient for conversion.&quot;&#xA;  (delete ?\r string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The docstring evaluates to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Normalize the line endings for STRING.&#xA;&#xA;The API returns strings that use Windows-style line endings.&#xA;These are largely useless in an Emacs environment.  Windows uses&#xA;&quot;\r\n&quot;, Unix uses just &quot;\n&quot;.  Deleting &quot;\r&quot; is&#xA;sufficient for conversion.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the next-to-last line is needlessly short; 'sufficient' can be put onto the preceding line.  Even 'for' fits:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The API returns strings that use Windows-style line endings.&#xA;These are largely useless in an Emacs environment.  Windows uses&#xA;&quot;\r\n&quot;, Unix uses just &quot;\n&quot;.  Deleting &quot;\r&quot; is sufficient for&#xA;conversion.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I reach Emacs to fill according to the &lt;em&gt;value&lt;/em&gt; of the string rather than its input syntax?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I have a solution sketch for this, but I'm having trouble implementing it.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Check to see if we're inside a string literal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (unless (nth 3 (syntax-ppss))&#xA;   (user-error &quot;Not inside a string literal&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Evaluate the string.  &lt;code&gt;re-search-forward&lt;/code&gt; for &lt;code&gt;[^\\]&quot;&lt;/code&gt; (string version: &lt;code&gt;&quot;[^\\\\]\&quot;&quot;&lt;/code&gt;).  Use &lt;code&gt;eval-last-sexp&lt;/code&gt; and insert the result into a temporary buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Record line endings.  Push onto a list every &lt;code&gt;point&lt;/code&gt; where char-at-point is a new line.  Start at &lt;code&gt;point-max&lt;/code&gt; to keep the list sorted.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Returning to the original string, insert the line breaks where they're needed and remove them where they do not align with the list created.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Alternatively, just evaluate the string into a temp buffer, fill it, replace instances of &lt;code&gt;&quot;&lt;/code&gt; with &lt;code&gt;\&quot;&lt;/code&gt;, and bring that string back in to replace the old one.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-19T03:18:24.017" LastActivityDate="2014-11-19T21:13:41.650" Title="How can I fill-paragraph a string according to its value rather than its input syntax?" Tags="|fill-paragraph|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3638" PostTypeId="1" AcceptedAnswerId="3657" CreationDate="2014-11-17T05:28:14.247" Score="8" ViewCount="141" Body="&lt;p&gt;Is it possible to teach customize to save its variables using single quote &lt;code&gt;'&lt;/code&gt; instead of &lt;code&gt;quote&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;…&#xA;'(package-archives '((&quot;gnu&quot;   . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                     (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))&#xA;…&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;…&#xA;'(package-archives (quote ((&quot;gnu&quot;   . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                           (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))))&#xA;…&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="450" LastEditorUserId="2355" LastEditDate="2014-11-17T16:58:06.983" LastActivityDate="2014-11-18T08:36:20.227" Title="How can I make customize use single quote for quotation?" Tags="|customize|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3639" PostTypeId="1" AcceptedAnswerId="3642" CreationDate="2014-11-17T07:55:28.540" Score="3" ViewCount="105" Body="&lt;p&gt;I'm editing a 4.7M pure-text document, the task is simple, every book have chapters, and every chapter have each of its lines enumerated at the begin of the line, what I'm doing it putting the name of the book, the chapter number next to the verse number of each line. Let me illustrate the text structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A very important book&#xA;&#xA;** The old part&#xA;&#xA;*** BOOK ONE&#xA;&#xA;**** Chapter 1&#xA;1 Lorem ipsum dolor sit amet, consectetur adipiscing elit.&#xA;2 Donec pharetra venenatis felis, non mollis ligula pharetra sit amet. Fusce sodales, arcu vel imperdiet rhoncus.&#xA;&#xA;**** Chapter 2&#xA;1 nulla felis fermentum neque&#xA;2 at posuere urna quam et eros. Sed sed rhoncus felis&#xA;&#xA;*** BOOK TWO&#xA;&#xA;**** Chapter 1&#xA;1 a lacinia velit. Aliquam erat volutpat.&#xA;2 Donec at congue sapien.&#xA;&#xA;**** Chapter 2&#xA;1 Integer arcu erat, luctus quis orci et,&#xA;2 feugiat placerat tortor.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this is what I want to achieve:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A very important book&#xA;&#xA;** The old part&#xA;&#xA;*** BOOK ONE&#xA;&#xA;**** Chapter 1&#xA;Book one 1, 1: Lorem ipsum dolor sit amet, consectetur adipiscing elit.&#xA;Book one 1, 2: Donec pharetra venenatis felis, non mollis ligula pharetra sit amet. Fusce sodales, arcu vel imperdiet rhoncus.&#xA;&#xA;**** Chapter 2&#xA;Book one 2, 1: nulla felis fermentum neque&#xA;Book one 2, 2: at posuere urna quam et eros. Sed sed rhoncus felis&#xA;&#xA;*** BOOK TWO&#xA;&#xA;**** Chapter 1&#xA;Book two 1, 1: a lacinia velit. Aliquam erat volutpat.&#xA;Book two 1, 2: Donec at congue sapien.&#xA;&#xA;**** Chapter 2&#xA;Book two 2, 1: Integer arcu erat, luctus quis orci et,&#xA;Book two 2, 2: feugiat placerat tortor.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm looking to build a function that works over the entire buffer. What I want to know is: How can I get the information regarding the heading where the regular expression have a coincidence and is going to apply the replacement string? I need to know that to prepare the correct replacement string.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-11-17T10:50:54.433" Title="How to know the first and second level heading above the cursor?" Tags="|org-mode|text-editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3640" PostTypeId="2" ParentId="3608" CreationDate="2014-11-17T08:37:51.027" Score="1" Body="&lt;p&gt;You could start with the following. Be sure to go through the list of &lt;code&gt;setq&lt;/code&gt; statements and remove &lt;code&gt;buffer-undo-list&lt;/code&gt; or &lt;code&gt;mark-ring&lt;/code&gt; and the like.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-local-variables (&amp;amp;optional buffer)&#xA;  (interactive)&#xA;  (setq buffer (or buffer (current-buffer)))&#xA;  (mapatoms (lambda (sym)&#xA;              (condition-case err&#xA;                  (when (and (boundp sym)&#xA;                             (not (equal (buffer-local-value sym buffer)&#xA;                                         (default-value sym))))&#xA;                    (insert (format &quot;(setq %S %s%S); default: %S\n&quot;&#xA;                                    sym&#xA;                                    (if (listp (buffer-local-value sym buffer)) &quot;'&quot; &quot;&quot;)&#xA;                                    (buffer-local-value sym buffer)&#xA;                                    (default-value sym))))&#xA;                ;; handle &quot;Local in buffer *scratch*; globally void&quot; variables&#xA;                (error nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="360" LastActivityDate="2014-11-17T08:37:51.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3641" PostTypeId="2" ParentId="3608" CreationDate="2014-11-17T09:30:32.603" Score="1" Body="&lt;p&gt;Evaluating this at the end of the file will give you a Local Variables block to work from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The important bit is the function &lt;code&gt;buffer-local-variables&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The list will likely be much bigger than you expected, and the output most likely wouldn't actually evaluate as-is, so you'll certainly need to manually edit out all the bits you don't need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(progn (insert &quot;# Local Variables:\n&quot;) (mapcar (lambda (x) (insert (format &quot;# %s: %S\n&quot; (car x) (cdr x)))) (buffer-local-variables)) (insert &quot;# End:\n&quot;))&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-17T09:38:54.823" LastActivityDate="2014-11-17T09:38:54.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3642" PostTypeId="2" ParentId="3639" CreationDate="2014-11-17T10:05:50.100" Score="3" Body="&lt;p&gt;Here you have a function that I think do what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-bookfy ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (let ((book &quot;&quot;)&#xA;      (chapter &quot;&quot;))&#xA;      (goto-char 0)&#xA;      (while (not (= (point) (point-max)))&#xA;    (let ((line (buffer-substring-no-properties (point-at-bol) (point-at-eol))))&#xA;      (cond ((string-match &quot;^\\*\\*\\*\\* Chapter \\(.*\\)$&quot; line)&#xA;         (setq chapter (match-string 1 line)))&#xA;        ((string-match &quot;^\\*\\*\\* \\(.*\\)$&quot; line)&#xA;         (setq book (match-string 1 line)))&#xA;        ((not (string-match &quot;^\\([[:space:]]\\|\\*.*\\)*$&quot; line))&#xA;         (insert (concat book &quot; &quot; chapter &quot;, &quot;))))&#xA;      )&#xA;    (forward-line 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you want to know strictly what you ask for, here you got a function that return the two levels up of point.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-get-up-2-elements ()&#xA;  (interactive)&#xA;&#xA;  (let ((chapter &quot;&quot;)&#xA;    (book &quot;&quot;))&#xA;    (save-excursion&#xA;      (setq chapter (org-get-heading t t))&#xA;      (outline-up-heading 1)&#xA;      (setq book (org-get-heading t t)))&#xA;    (message (concat book &quot; &quot; chapter))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2026" LastEditorUserId="2026" LastEditDate="2014-11-17T10:50:54.433" LastActivityDate="2014-11-17T10:50:54.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3643" PostTypeId="2" ParentId="3387" CreationDate="2014-11-17T10:15:42.460" Score="5" Body="&lt;p&gt;Updated answer: (thanks for the feedback)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun update-org-latex-fragments ()&#xA;  (org-latex-preview '(64))&#xA;  (plist-put org-format-latex-options :scale text-scale-mode-amount)&#xA;  (org-latex-preview '(16)))&#xA;(add-hook 'text-scale-mode-hook 'update-org-latex-fragments)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Old answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a start: hook into &lt;code&gt;text-scale-mode-hook&lt;/code&gt; and update &lt;code&gt;org-format-latex-options&lt;/code&gt; accordingly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun update-org-latex-fragments ()&#xA;  (org-toggle-latex-fragment '(16))&#xA;  (plist-put org-format-latex-options :scale text-scale-mode-amount)&#xA;  (org-toggle-latex-fragment '(16)))&#xA;(add-hook 'text-scale-mode-hook 'update-org-latex-fragments)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A scaling factor might be needed before &lt;code&gt;text-scale-mode-amount&lt;/code&gt; though...&lt;/p&gt;&#xA;" OwnerUserId="700" LastEditorUserId="700" LastEditDate="2020-02-03T10:47:42.733" LastActivityDate="2020-02-03T10:47:42.733" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="3644" PostTypeId="2" ParentId="3074" CreationDate="2014-11-17T11:03:19.347" Score="2" Body="&lt;p&gt;Building on purple_arrows' solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-makefile-indent-line ()&#xA;  (save-excursion&#xA;(forward-line 0)&#xA;(cond&#xA; ;; keep TABs&#xA; ((looking-at &quot;\t&quot;)&#xA;  t)&#xA; ;; indent continuation lines to 4&#xA; ((and (not (bobp))&#xA;       (= (char-before (1- (point))) ?\\))&#xA;  (delete-horizontal-space)&#xA;  (indent-to 4))&#xA; ;; delete all other leading whitespace&#xA; ((looking-at &quot;\\s-+&quot;)&#xA;  (replace-match &quot;&quot;)))))&#xA;&#xA;(add-hook 'makefile-mode-hook&#xA;      (lambda ()&#xA;    (setq-local indent-line-function 'my-makefile-indent-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="360" LastActivityDate="2014-11-17T11:03:19.347" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3645" PostTypeId="2" ParentId="2711" CreationDate="2014-11-17T11:06:23.413" Score="0" Body="&lt;p&gt;I'm accepting @rekado's answer as he got me there. But here is the org-babel snippet I'm now using for sake of completeness:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: draft-status-email&#xA;#+begin_src emacs-lisp &#xA;    (let ((end-of-week&#xA;           (chomp&#xA;            (shell-command-to-string &quot;date --date='09:00 next Fri' +'%b. %e %Y'&quot;))))&#xA;      (save-excursion&#xA;        (goto-char (point-min))&#xA;        (re-search-forward &quot;** Current&quot;)&#xA;        (org-copy-subtree)&#xA;        (kill-whole-line)&#xA;        (insert (format &quot;** Team Email %s\n&quot; (format-time-string &quot;%e/%m/%Y&quot;))))&#xA;      (compose-mail&#xA;       &quot;team@team.list.org&quot;&#xA;       (format &quot;[weekly] week ending %s&quot; end-of-week)&#xA;       nil&#xA;       t)&#xA;      (insert &quot;Summary of activity:\n&quot;)&#xA;      (yank 2))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-11-17T11:06:23.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3646" PostTypeId="2" ParentId="3349" CreationDate="2014-11-17T12:18:15.883" Score="7" Body="&lt;p&gt;Ok, let's get some basics straight.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Nesting syntax tables is possible&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Syntax tables don't have to be global to the entire buffer.&#xA;You can apply them as text properties to specific regions. This means&#xA;you &lt;em&gt;can&lt;/em&gt; indeed apply the &lt;code&gt;elisp&lt;/code&gt; syntax table only to regions&#xA;surrounded by backticks.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How do you do that?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here's one way you can do that. This method does it immediately before&#xA;font-lock runs through the buffer, so it should specifically prevent&#xA;your font-locking issues.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/set-syntax-then-fontify (beg end loudly)&#xA;  &quot;Apply elisp syntax table to relevant regions before calling font-lock.&quot;&#xA;  (save-match-data&#xA;    (save-excursion&#xA;      (save-restriction&#xA;        (widen)&#xA;        (narrow-to-region beg end)&#xA;        (while (search-forward &quot;`&quot; nil 'noerror)&#xA;          ;; Using `end' here excludes the `, I don't know which syntax you&#xA;          ;; want to apply to that.&#xA;          (let ((left (match-end 0)))&#xA;            (when (search-forward &quot;`&quot; nil 'noerror)&#xA;              (add-text-properties&#xA;               left (match-beginning 0)&#xA;               (list 'syntax-table emacs-lisp-mode-syntax-table))))))))&#xA;  (font-lock-default-fontify-region beg end loudly))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your major-mode definition, you'll need to add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'font-lock-fontify-region-function)&#xA;     #'endless/set-syntax-then-fontify)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Syntax tables are not the same as syntax highlighting&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The syntax highlighter (the font-lock system) uses Syntax Tables as&#xA;part of its information, so the solution above should prevent the&#xA;highlighter from going nuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, that is only part of the data, if you also want the text in&#xA;backticks to be colored exactly as you would see in an elisp buffer,&#xA;you'll have to extend the function above to do that specifically.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/set-syntax-then-fontify (beg end loudly)&#xA;  &quot;Apply elisp syntax table to relevant regions before calling font-lock.&quot;&#xA;  (save-match-data&#xA;    (save-excursion&#xA;      (save-restriction&#xA;        (widen)&#xA;        (narrow-to-region beg end)&#xA;        (while (search-forward &quot;`&quot; nil 'noerror)&#xA;          ;; Using `end' here excludes the `, I don't know which syntax you&#xA;          ;; want to apply to that.&#xA;          (let ((left (match-end 0)))&#xA;            (when (search-forward &quot;`&quot; nil 'noerror)&#xA;              (add-text-properties&#xA;               left (match-beginning 0)&#xA;               (list 'syntax-table emacs-lisp-mode-syntax-table))))))))&#xA;  (font-lock-default-fontify-region beg end loudly)&#xA;  ;; Do some specific elisp fontifying here&#xA;  (save-match-data&#xA;    (save-excursion&#xA;      (save-restriction&#xA;        (widen)&#xA;        (narrow-to-region beg end)&#xA;        (while (search-forward &quot;`&quot; nil 'noerror)&#xA;          (let ((left (match-end 0)))&#xA;            (when (search-forward &quot;`&quot; nil 'noerror)&#xA;              ;; Call some function to fontify elisp between `left' and (match-beginning 0)&#xA;              )))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="304" LastEditDate="2018-08-24T10:50:36.160" LastActivityDate="2018-08-24T10:50:36.160" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="3647" PostTypeId="2" ParentId="3629" CreationDate="2014-11-17T12:49:58.687" Score="10" Body="&lt;p&gt;You can use the External Editor add-on to Thunderbird, and then set your external editor to emacs. If you go to &lt;a href=&quot;http://globs.org/articles.php?lng=en&amp;amp;pg=2&quot;&gt;this site&lt;/a&gt;, you can download the file &lt;code&gt;exteditor_v100.xpi&lt;/code&gt;. Then from inside of Thunderbird, from the add-ons manager, you can &quot;install add-on from file&quot;. After you restart, you can find the options for External Editor in the add-ons manager, and from there you can put the path to your emacs as your external editor. That should suit your needs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With all of that being said:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I am looking for something with a simple setup so that I can keep Thunderbird as my primary email management program but compose and send email in emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is a problem, and I'm not sure you actually want this. Any &lt;em&gt;simple&lt;/em&gt; setup that edits mail inside of emacs won't use Thunderbird as your primary email management. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I highly recommend using mu4e and offlineimap. I started using it before I knew anything about emacs, and it was about as straightforward as an email client can be.&lt;/p&gt;&#xA;" OwnerUserId="2511" LastEditorUserId="2511" LastEditDate="2014-11-21T05:24:41.360" LastActivityDate="2014-11-21T05:24:41.360" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3648" PostTypeId="1" AcceptedAnswerId="3649" CreationDate="2014-11-17T12:59:50.360" Score="14" ViewCount="615" Body="&lt;p&gt;In two of my packages I have a macro where the body depends on a variable defined in a &lt;code&gt;defcustom&lt;/code&gt; form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When installing the packages from Melpa, the byte-compilation ends with:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error: Symbol's value as variable is void: my-defcustom-variable&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then, manually byte-compiling the file by opening it in a buffer works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried with an &lt;code&gt;autoload&lt;/code&gt; cookie but still have the same behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm missing something important here.&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="50" LastEditDate="2014-11-17T13:53:13.547" LastActivityDate="2014-11-17T13:53:13.547" Title="Macro with defcustom leads to &quot;Symbol's value as variable is void&quot; error when byte-compiled" Tags="|byte-compilation|elisp-macros|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3649" PostTypeId="2" ParentId="3648" CreationDate="2014-11-17T13:38:57.940" Score="16" Body="&lt;p&gt;The &lt;code&gt;defcustom&lt;/code&gt; expression are not evaluated during byte-compilation, so when your macro is expanded, the variable does not exist yet because that defcustom was compiled but not run.  You can either move the defcustom to another file (which you then &lt;code&gt;require&lt;/code&gt; at the beginning of your file), or you can wrap the defcustom inside &lt;code&gt;eval-and-compile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-17T13:38:57.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3650" PostTypeId="1" AcceptedAnswerId="3910" CreationDate="2014-11-17T13:41:24.433" Score="18" ViewCount="2820" Body="&lt;p&gt;I set the &lt;code&gt;Alt Gr&lt;/code&gt; key on my keyboard as compose key in my system (Ubuntu 14.04) in order to type letters like &lt;code&gt;éóèàùçü&lt;/code&gt; and so on. But when I am on Emacs and try to press the &lt;code&gt;Alt Gr&lt;/code&gt; key, I have a message saying that:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;Multi_key&amp;gt; is undefines&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ho can I make it work? Thanks.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. as I don't have enough reputation, I couldn't tag this post with more meaningful tags. So, please, if you want to suggest tags, you are welcome. &lt;/p&gt;&#xA;" OwnerUserId="201" LastEditorUserId="503" LastEditDate="2014-11-17T13:45:28.910" LastActivityDate="2015-01-30T22:10:19.093" Title="Compose key in Emacs: &lt;Multi_key&gt; is undefined" Tags="|key-bindings|text-editing|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3651" PostTypeId="1" AcceptedAnswerId="3692" CreationDate="2014-11-17T14:57:15.600" Score="4" ViewCount="48" Body="&lt;p&gt;When I'm composing a message in &lt;code&gt;message-mode&lt;/code&gt; I sometimes want to remove a recipient from a long list of recipients on the &lt;code&gt;To:&lt;/code&gt; line.  It seems that there is no semantic kill command that would delete a complete recipient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could zap to the next delimiter, I suppose, but the different formats available for recipients and their display names makes this a lot harder.  When on a &lt;code&gt;To:&lt;/code&gt;, &lt;code&gt;Cc:&lt;/code&gt; or &lt;code&gt;Bcc:&lt;/code&gt; line, I really don't need to be able to delete words or sentences or s-expressions, I just need to be able to remove a recipient as a syntactic unit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I easily augment &lt;code&gt;kill-sexp&lt;/code&gt; to remove a recipient (i.e. name and email address in the various common formats) when I'm on a recipient line?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-11-18T11:29:27.533" Title="message-mode: delete recipient easily" Tags="|email|message|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3652" PostTypeId="1" CreationDate="2014-11-17T15:11:08.590" Score="3" ViewCount="355" Body="&lt;p&gt;Say I open a new buffer by &lt;code&gt;eww-browse-url &quot;emacs.stackexchange.com&quot;&lt;/code&gt;. Then, I navigate for a while, so the &lt;code&gt;eww-se&lt;/code&gt; buffer updates its name to the current url. Same history for another buffer &lt;code&gt;eww-ew&lt;/code&gt;, lets say by doing &lt;code&gt;eww-browse-url &quot;emacswiki.org&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, I switch to another different buffer, loosing the pointer to the eww buffers, so that I don't know how to refer to them programmatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if there is a way to switch back to a given eww buffer (&lt;code&gt;eww-se&lt;/code&gt;, for example), without&#xA;knowing its current name, or a way to check if this buffer is already open. Obviously, I don't want to go&#xA;visually through the list of all open buffers. Maybe labeling the buffer or something ... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how can I refer to an already eww open buffer without knowing its current name ?&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2014-12-22T01:45:51.440" Title="How can I refer to an already open eww buffer without knowing its current name?" Tags="|buffers|eww|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3653" PostTypeId="2" ParentId="3629" CreationDate="2014-11-17T15:21:06.610" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Next step: if possible I'd still like to be able to sync with an imap server to pull off the last ~100 emails so I can compose responses in emacs. This wouldn't require folder management, but some amount of syncing, though I don't need to keep the messages locally available to emacs after the session. Would it still require offlineimap?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want synchronization with an IMAP server I recommend working with a local maildir and offlineimap to sync it with a remote server.  Dependent on your folder structure you could limit synchronisation to a single directory and purge it once you're done.  (Offlineimap won't delete emails that you deleted locally if you also delete the cache.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your maildir is already managed by Thunderbird, however, you really don't need offineimap at all as you can simply open existing emails as files (that's the beauty of maildir compared to some more dense format).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To write emails you really only need to create text files with the right headers.  &lt;code&gt;message-mode&lt;/code&gt; does this for you.  (Most email clients for Emacs simply reuse &lt;code&gt;message-mode&lt;/code&gt; instead of inventing their own interface for composing emails.)  Once you have a valid email file you can use a separate command (such as msmtp) to send it.  You can configure &lt;code&gt;message-mode&lt;/code&gt; to use msmtp like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mail-specify-envelope-from t)&#xA;(setq mail-envelope-from 'header)&#xA;(setq message-sendmail-envelope-from 'header)&#xA;(setq message-send-mail-function 'message-send-mail-with-sendmail)&#xA;&#xA;;;use msmtp instead of sendmail&#xA;(setq sendmail-program &quot;/usr/bin/msmtp&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your msmtp configuration is independent from Emacs and you can use it outside of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you're only a small step from also reading your email in Emacs.  For this task I recommend using &lt;code&gt;mu4e&lt;/code&gt;.  Of course, this is completely optional as you can read your sync'd maildir with any other mail client.  Thunderbird, for example, can use a local maildir as the storage backend.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-11-17T15:50:09.867" LastActivityDate="2014-11-17T15:50:09.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3654" PostTypeId="1" AcceptedAnswerId="3656" CreationDate="2014-11-17T15:37:54.727" Score="13" ViewCount="6106" Body="&lt;p&gt;I enabled company using the following commands in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However I'm not getting filename completion, although there is some provider in the source and also the website mentions it's supported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start typing /home/emmanuel... and nothing happens, although I would expect the completion to start offering options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how does company-mode autodetect completion for relative paths, I think I read it's supported, but I'm not sure how it would detect it, without the initial &quot;/&quot; as a tip?&lt;/p&gt;&#xA;" OwnerUserId="2592" LastEditorUserId="780" LastEditDate="2014-11-18T18:33:27.940" LastActivityDate="2021-07-30T09:51:29.507" Title="filename completion using company-mode" Tags="|completion|company-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3655" PostTypeId="2" ParentId="3589" CreationDate="2014-11-17T16:04:26.250" Score="6" Body="&lt;p&gt;An alternative, which offers far more than you require, is to use &lt;a href=&quot;https://github.com/tlh/workgroups.el&quot; rel=&quot;noreferrer&quot;&gt;workgroups.el&lt;/a&gt;. It will open Emacs in any of several definable configurations, let you switch among them and load the files you require. When you are doing development which requires several files open at once, it &#xA;enables you to start working much faster. I use it a lot.&lt;/p&gt;&#xA;" OwnerUserId="2348" LastActivityDate="2014-11-17T16:04:26.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3656" PostTypeId="2" ParentId="3654" CreationDate="2014-11-17T16:41:03.197" Score="8" Body="&lt;p&gt;You have to run &lt;code&gt;company-files&lt;/code&gt; for file completion. You can bind a different map for the files completion completion with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;C-.&quot;) 'company-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also make sure you have the company-files in company-backends (&lt;code&gt;M-x&lt;/code&gt; &gt; customize-group &gt; company &gt; company backends)&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2014-11-17T16:41:03.197" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3657" PostTypeId="2" ParentId="3638" CreationDate="2014-11-17T16:48:31.243" Score="12" Body="&lt;p&gt;Whether Lisp objects are printed using &lt;code&gt;'&lt;/code&gt; and &lt;code&gt;#'&lt;/code&gt; is controlled by &lt;code&gt;print-quoted&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See section &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Output-Variables.html&quot;&gt;Output Variables&lt;/a&gt; of the Emacs Lisp manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'custom-save-all :around&#xA;            (lambda (orig)&#xA;              (let ((print-quoted t))&#xA;                (funcall orig))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;tells customize to use &lt;code&gt;'&lt;/code&gt; instead of &lt;code&gt;(quote ...)&lt;/code&gt; and &lt;code&gt;#'&lt;/code&gt; instead of &lt;code&gt;(function ...)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-17T16:48:31.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3658" PostTypeId="1" CreationDate="2014-11-17T17:14:33.173" Score="1" ViewCount="507" Body="&lt;p&gt;In a &lt;a href=&quot;https://github.com/ensime/ensime-emacs&quot; rel=&quot;nofollow&quot;&gt;library&lt;/a&gt; I use a prefix key defined like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom ensime-mode-key-prefix [?\C-c]&#xA;  &quot;The prefix key for ensime-mode commands.&quot;&#xA;  :group 'ensime-mode&#xA;  :type 'sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my config file I've redefined it like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ensime-mode-key-prefix [?\C-c ?e])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Even though this has changed the prefix, all commands refuse to work with this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: ensime-mode-key-prefix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've also tried to set it this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(customize-set-value 'ensime-mode-key-prefix [?\C-c ?e])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It also doesn't work, but with a different message - &lt;code&gt;C-c e is undefined&lt;/code&gt;, which is strange cause in description it's set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ensime-mode-key-prefix is a variable defined in `ensime-vars.el'.&#xA;Its value is [3 101]&#xA;Original value was [3]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to change the prefix to &lt;code&gt;C-c e&lt;/code&gt;, tried to do that with std &lt;code&gt;kbd&lt;/code&gt;, but that didn't help. &lt;/p&gt;&#xA;" OwnerUserId="2361" LastEditorUserId="25" LastEditDate="2014-12-25T00:22:33.820" LastActivityDate="2019-01-10T21:26:18.667" Title="How to properly change defcustom prefix key" Tags="|key-bindings|prefix-keys|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3659" PostTypeId="1" AcceptedAnswerId="3661" CreationDate="2014-11-17T17:23:59.640" Score="18" ViewCount="1476" Body="&lt;p&gt;Here's what Vim's documentation has to say about it:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Virtual editing means that the cursor can be positioned where there is&#xA;          no actual character.  This can be halfway into a tab or beyond the end&#xA;          of the line.  Useful for selecting a rectangle in Visual mode and&#xA;          editing a table.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'd preferably like to see this implemented as a minor mode or a built in setting.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="50" LastEditDate="2014-11-19T10:49:31.583" LastActivityDate="2014-11-19T10:49:31.583" Title="How to act on rectangles beyond the end-of-line?" Tags="|text-editing|vim-emulation|rectangle|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3660" PostTypeId="1" CreationDate="2014-11-17T18:00:47.950" Score="1" ViewCount="452" Body="&lt;p&gt;When I call run-python, I get the buffer with python REPL and the prompt.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I can type stuff, but when I press enter there is no reaction (except the cursor moves in new line).&lt;/li&gt;&#xA;&lt;li&gt;If I press C-c C-c (comint-interrupt-subjob), I get a new prompt, but I don't see any output of the previous commands.&lt;/li&gt;&#xA;&lt;li&gt;If I use python-shell-send-region or if I evaluate (comint-send-string &quot;&lt;em&gt;Python&lt;/em&gt;&quot; &quot;print 5\n&quot;), I don't see any output in Python buffer, but the elisp function returns without error.&lt;/li&gt;&#xA;&lt;li&gt;I can end the python process by pressing C-d (comint-delchar-or-maybe-eof).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The same problem occurs both with python and ipython (I tried python-shell-switch-to-shell with both). The Emacs communication also doesn't work when trying to use Mozart programming system, which also uses comint. Some other comint based modes on the other hand (scheme, shell) work without problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run python inside emacs shell I get the same behavior as above. After C-d, the python ends and the shell works normally again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried starting emacs without init files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Versions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Python 2.7.8&lt;/li&gt;&#xA;&lt;li&gt;Emacs 24.3.1 (also saw the problem with 24.4.1)&lt;/li&gt;&#xA;&lt;li&gt;built-in python.el&lt;/li&gt;&#xA;&lt;li&gt;Debian Jessie&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2594" LastActivityDate="2014-11-17T18:00:47.950" Title="Python-emacs communication broken" Tags="|python|comint|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3661" PostTypeId="2" ParentId="3659" CreationDate="2014-11-17T18:19:13.170" Score="11" Body="&lt;p&gt;The &lt;code&gt;extend-rectangle-to-end&lt;/code&gt; function in the &lt;code&gt;rectangle-utils&lt;/code&gt; package is what you want. It's on &lt;code&gt;melpa&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It inserts spaces to make the current rectangle selection extend to cover the longest line in the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get this behaviour, I've got  this in my init.el. &lt;code&gt;C-x r e&lt;/code&gt; is not bound to anything else in vanilla emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'rectangle-utils)&#xA;(global-set-key (kbd &quot;C-x r e&quot;) 'extend-rectangle-to-end)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="503" LastEditorUserId="503" LastEditDate="2014-11-19T10:48:03.497" LastActivityDate="2014-11-19T10:48:03.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3662" PostTypeId="2" ParentId="478" CreationDate="2014-11-17T18:39:35.597" Score="3" Body="&lt;p&gt;If you haven't already done so, I would recommend using SSH instead of HTTP as many have recommended to me during my investigation of this.  That said, I was able to resolve this issue using the below FAQ:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/magit/magit/wiki/FAQ#windows-cannot-push-with-ssh-passphrase&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magit/magit/wiki/FAQ#windows-cannot-push-with-ssh-passphrase&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The missing component (from Github's Git Bash .bashrc script) is that it doesn't handle ssh-agent startup for interfaces such as the Windows command line or emacs.  Following the above steps initiates ssh-agent upon emacs startup.  Note, you will have to start Git Bash and enter your SSH passphrase upon starting/restarting your machine.&lt;/p&gt;&#xA;" OwnerUserId="598" LastEditorUserId="598" LastEditDate="2014-11-18T14:58:41.053" LastActivityDate="2014-11-18T14:58:41.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3663" PostTypeId="2" ParentId="3659" CreationDate="2014-11-17T19:06:47.220" Score="19" Body="&lt;p&gt;Another answer: use &lt;strong&gt;&lt;code&gt;M-x picture-mode&lt;/code&gt;&lt;/strong&gt;.  You can kill or copy rectangles through the middle of tab chars etc., send them to registers, etc.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-17T19:06:47.220" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3664" PostTypeId="2" ParentId="478" CreationDate="2014-11-17T19:57:00.690" Score="0" Body="&lt;p&gt;As @bastibe pointed, Magit is probably waiting for a password input and just hangs in there...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recall the following working when I was forced to used Windows :-). I don't recall the exact command name, also make sure that the &lt;code&gt;exec-path&lt;/code&gt; contains &lt;code&gt;c:/Program Files (x86)/Git/bin/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;GIT_ASKPASS&quot; &quot;git-gui--askpass&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="943" LastActivityDate="2014-11-17T19:57:00.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3665" PostTypeId="2" ParentId="27" CreationDate="2014-11-17T22:13:39.040" Score="0" Body="&lt;p&gt;Harold Abnabit came up with this approach&lt;sup&gt;1&lt;/sup&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blog.habnab.it/blog/2013/06/25/emacsclient-and-tramp/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blog.habnab.it/blog/2013/06/25/emacsclient-and-tramp/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; based on an earlier article by Ryan Barrett (to which he links).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW there's also &lt;a href=&quot;https://stackoverflow.com/q/5154224/324105&quot;&gt;https://stackoverflow.com/q/5154224/324105&lt;/a&gt; in which Petri Lehtinen came up with &lt;a href=&quot;https://gist.github.com/akheron/850795&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/akheron/850795&lt;/a&gt;. I imagine the more complex solutions are better, but a very simple approach might still be of interest.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-11-17T22:22:07.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3666" PostTypeId="2" ParentId="3654" CreationDate="2014-11-17T22:52:30.273" Score="15" Body="&lt;p&gt;As @Jesse already pointed out, what you want here is the &lt;code&gt;company-files&lt;/code&gt; backend. There are several different ways to use it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Bind a key to call &lt;code&gt;company-files&lt;/code&gt; directly. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use command &lt;code&gt;company-begin-backend&lt;/code&gt;. This prompts you for the backend to use, then offers completion candidates. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;company-other-backend&lt;/code&gt; to rotate through the list of backends (see next item). This can be used to trigger completion or it can be used after company mode has been triggered to switch to a different set of completion candidates. You may want to assign a key binding in the company map, e.g. &lt;code&gt;(define-key company-active-map (kbd &quot;C-e&quot;) #'company-other-backend)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Configure the variable &lt;code&gt;company-backends&lt;/code&gt;. Company mode traverses this list in order to find a backend that accepts the current prefix (i.e. the text before point). It is entirely possible to have a backend in the list that accepts the current prefix but does not offer any completion candidates, at which point company mode won't auto-complete anything. You can customize the list to order the backends in a way that meets your needs. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A few examples of modifying &lt;code&gt;company-backends&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you only ever wanted to complete filenames, you could make that your only backend:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-backends '(company-files))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That seems unlikely, so you're better off putting your most commonly used backend first and then using one of options mentioned earlier to switch backends or invoke one by name when you need something else. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also configure a 'group' backend that creates a merged set of completion candidates. Try this, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-backends '((company-capf company-dabbrev-code company-files)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This specifies a single backend that merges the candidates from three other backends. It will give you results from completion-at-point, dabbrev, and the file system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use mode hooks to specify a different set of backends for different major modes. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (setq-local company-backends '((company-files company-dabbrev)))))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook&#xA;          (lambda ()&#xA;            (setq-local company-backends '((company-capf company-dabbrev-code)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-24T15:56:41.627" LastActivityDate="2014-11-24T15:56:41.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3667" PostTypeId="1" CreationDate="2014-11-17T23:07:37.750" Score="28" ViewCount="9440" Body="&lt;p&gt;I have a bunch of music (&lt;code&gt;.mp3&lt;/code&gt;) files on my disk, and I would like to play them from within Emacs.  I tried &lt;a href=&quot;http://www.gnu.org/software/emms/&quot;&gt;EMMS&lt;/a&gt;, but it seems rather bloated. I'm curious about other possibilities, with comparison of features.  In particular, I am interested in these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simple&lt;/strong&gt; - Whether the given player is simple enough to start using it within a few minutes, including installation and learning the basics.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;dired&lt;/code&gt; integration&lt;/strong&gt; - So that I can e.g. mark some music files in &lt;code&gt;dired&lt;/code&gt; and have them played/added to the playlist.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Editing capabilities&lt;/strong&gt; - I would like the ability to edit id3 tags.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="642" LastEditorUserId="253" LastEditDate="2014-11-20T13:49:41.723" LastActivityDate="2017-09-13T16:06:03.300" Title="What are the options to play music from within Emacs?" Tags="|bongo|emms|music-player|" AnswerCount="3" CommentCount="7" CommunityOwnedDate="2014-11-20T13:47:03.487" ContentLicense="CC BY-SA 3.0" />
  <row Id="3668" PostTypeId="2" ParentId="478" CreationDate="2014-11-17T23:09:43.620" Score="2" Body="&lt;p&gt;I too have experienced this behavior for a while, and until today haven't gotten around to really trying to fix it. I did so by placed the following in my init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setenv &quot;GIT_SSH&quot; &quot;C:/Path/to/PuTTY/plink.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tested this by opening up a clean Emacs (&lt;code&gt;emacs -Q&lt;/code&gt;), loading &lt;code&gt;magit&lt;/code&gt;, and evaluating that line, and it worked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works with &lt;code&gt;Pageant&lt;/code&gt;, so there is no need to mess with &lt;code&gt;ssh-agent&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2018-11-07T17:30:22.893" LastActivityDate="2018-11-07T17:30:22.893" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="3669" PostTypeId="1" CreationDate="2014-11-17T23:36:45.210" Score="8" ViewCount="3169" Body="&lt;p&gt;I'm using GNU Emacs 24.3 on Windows 7 and normally I don't have any problems with speed/responsiveness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm launching Emacs with &lt;code&gt;runemacs.exe&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I am travelling and try to connect to my company network via VPN (or just working offline without a connection to the company network), Emacs often becomes incredibly slow — it might take many minutes to open a buffer and it just does not respond to keyboard commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm still highly interested in a solution)&#xA;All relevant text and configuration files are saved in my user directory &lt;code&gt;C:\Users\myusername.domainname\Documents&lt;/code&gt; which is located on the local hard disk (so should not need accessing remote servers), but I wonder if Windows 7 might try to sync those files with a server &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also using the &quot;offline files&quot; feature for other directories and I wonder if this could have an effect on my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem occurs not only when VPN is used, but also when the computer is just offline and not connected to the company network. &lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2377" LastEditDate="2015-05-31T06:33:24.860" LastActivityDate="2021-01-05T13:56:00.127" Title="Emacs on Windows 7 very slow when computer is outside company network" Tags="|microsoft-windows|performance|networking|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3670" PostTypeId="2" ParentId="3667" CreationDate="2014-11-17T23:58:01.807" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/cgi-bin/wiki/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;.  Search for &quot;&lt;em&gt;music&lt;/em&gt;&quot; (and &quot;&lt;em&gt;navigation list&lt;/em&gt;&quot;) on that page.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can bookmark individual sound files. &quot;Jumping&quot; to such a bookmark plays it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can display only your sound-file bookmarks in the &lt;code&gt;*Bookmark List*&lt;/code&gt; display, and navigate among them, as a playlist. Use &lt;code&gt;C-x p B&lt;/code&gt; and then &lt;code&gt;C-x p next&lt;/code&gt; to cycle the playlist.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;P B&lt;/code&gt; in  &lt;code&gt;*Bookmark List*&lt;/code&gt;, to show only your sound-file bookmarks, then use &lt;code&gt;C-x r m&lt;/code&gt; there to bookmark that state of the bookmark-list.  &quot;Jumping&quot; to that bookmark-list bookmark presents you with that same display (playlist).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use bookmark tags to tag sound bookmarks any way you like, to organize them into arbitrary sets, which can overlap.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also have a separate bookmark file for a given set of bookmarks. That is another way to organize them.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, note that currently Emacs itself supports only &lt;code&gt;*.au&lt;/code&gt; and &lt;code&gt;*.wav&lt;/code&gt; sound files - see the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sound-Output.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Sound Output&lt;/code&gt;&lt;/a&gt;. &lt;strong&gt;Bookmark+&lt;/strong&gt; thus recognizes only these files automatically as sound files, and gives them a &lt;code&gt;file-handler&lt;/code&gt; property of &lt;code&gt;play-sound-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use MS Windows, however, then you can take advantage of file associations for bookmarks to any files.  So if, for example, you have associated a Windows program &lt;code&gt;Foobar&lt;/code&gt; with, say, files that have extension &lt;code&gt;.mp3&lt;/code&gt;, then you can use &lt;strong&gt;Bookmark+&lt;/strong&gt; to play them.  This is no different from taking advantage of any other &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus#WindowsFileAssociations&quot; rel=&quot;nofollow&quot;&gt;Windows file association&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-18T21:25:42.323" LastActivityDate="2014-11-18T21:25:42.323" CommentCount="0" CommunityOwnedDate="2014-11-20T13:47:03.487" ContentLicense="CC BY-SA 3.0" />
  <row Id="3671" PostTypeId="1" CreationDate="2014-11-18T00:18:33.310" Score="3" ViewCount="723" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I make &lt;code&gt;org-read-date&lt;/code&gt; understand an abbreviation that calls a function that returns tomorrow's day of the week?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The super-short version: I'm trying to get the timestamp functionality of &lt;code&gt;+1d&lt;/code&gt; when typing &lt;code&gt;tom&lt;/code&gt; as a more finger-friendly way of saying &quot;tomorrow.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question follows up on &lt;a href=&quot;https://emacs.stackexchange.com/questions/2589/how-to-make-org-mode-understand-alternate-day-month-abbreviations&quot;&gt;this thread on dates&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/3179/how-to-make-org-mode-dwim-when-it-reads-times-in-timestamps&quot;&gt;this thread on times&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to train &lt;code&gt;org-read-date&lt;/code&gt; to understand new, easier-to-type abbreviations when I'm entering timestamps, scheduled items, and deadlines.  In particular, when entering a timestamp, I'd like to be able to enter &lt;code&gt;tom&lt;/code&gt; and have &lt;code&gt;org-read-date&lt;/code&gt; recognize it as &quot;whatever day tomorrow is&quot; (yes, I know I can type &lt;code&gt;+1d&lt;/code&gt;, but it's an awfully awkward sequence of keys).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;parse-time&lt;/code&gt; functionality on which &lt;code&gt;org-read-date&lt;/code&gt; relies expects an integer from 0 (Sunday) to 6 (Saturday).  Fair enough, here's a little function that does it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tomorrow-day ()&#xA;  &quot;Returns the day of the week for tomorrow.&quot;&#xA;  (let ((day (1+ (string-to-number (format-time-string &quot;%w&quot;)))))&#xA;    (if (= day 7)&#xA;        0&#xA;      day)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm stuck at the following point.  Following &lt;a href=&quot;https://emacs.stackexchange.com/questions/2589/how-to-make-org-mode-understand-alternate-day-month-abbreviations&quot;&gt;this prior thread&lt;/a&gt;, I've &lt;code&gt;push&lt;/code&gt;ed this function onto the &lt;code&gt;parse-time-weekdays&lt;/code&gt; alist:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push `(&quot;tom&quot; . ,(tomorrow-day)) parse-time-weekdays)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the problem: quasi-quoting pushes the &lt;em&gt;literal value&lt;/em&gt; that &lt;code&gt;tomorrow-day&lt;/code&gt; returns &lt;em&gt;only at the time it was first evaluated&lt;/em&gt; (so, if today is Monday, &lt;code&gt;tom&lt;/code&gt; refers to day number 2 from here to eternity).  Instead, I need &lt;code&gt;tomorrow-day&lt;/code&gt; evaluated each time I invoke &lt;code&gt;tom&lt;/code&gt; when entering a timestamp.  Why?  Because I commonly leave an Emacs session running for days at a time, meaning that &lt;code&gt;tom&lt;/code&gt; no longer refers to &quot;tomorrow&quot; after the day on which it was evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried various forms of quoting and quasi-quoting, and eventually got quite silly with an intricate combination of &lt;code&gt;funcall&lt;/code&gt;s and &lt;code&gt;eval&lt;/code&gt;s, all to no avail.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;strong&gt;how do I get this function (&lt;code&gt;tomorrow-day&lt;/code&gt;) evaluated every time I enter &lt;code&gt;tom&lt;/code&gt; in a timestamp?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-18T17:50:25.493" Title="How to make org-mode timestamps understand a new abbreviation for &quot;tomorrow&quot;?" Tags="|org-mode|parse-time|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3672" PostTypeId="1" AcceptedAnswerId="3689" CreationDate="2014-11-18T03:30:57.217" Score="7" ViewCount="817" Body="&lt;p&gt;IntelliJ has a keybind on a double-tap of &lt;kbd&gt;Shift&lt;/kbd&gt;. I'm curious if Emacs can emulate this functionality - my first thought was key-chord.el, since it allows double taps of regular keys like &lt;kbd&gt;qq&lt;/kbd&gt;. But, reading the key-chord.el documentation, it doesn't seem like it's possible to use modifiers keys as the keybind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other packages that might be able to duplicate this functionality ?&lt;/p&gt;&#xA;" OwnerUserId="672" LastActivityDate="2014-11-18T11:15:36.873" Title="Is there a package that can bind S-S (shift-shift) to an interactive function?" Tags="|key-bindings|key-chord-mode|keystrokes|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3673" PostTypeId="1" AcceptedAnswerId="3696" CreationDate="2014-11-18T03:51:08.557" Score="4" ViewCount="1001" Body="&lt;p&gt;Say, I got &lt;code&gt;~/.emacs&lt;/code&gt; which is a soft link to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;(using &lt;code&gt;ln -s ~/.emacs.d/init.el ~/.emacs&lt;/code&gt;) which is in a git repo, because this will make it easier to reach &lt;code&gt;init.el&lt;/code&gt;, outside or inside Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I edit the file using bookmarks(bookmark for &lt;code&gt;~/.emacs&lt;/code&gt; not &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;) or &lt;code&gt;C-x C-f&lt;/code&gt; to &lt;code&gt;~/.emacs&lt;/code&gt; directly, it will only edit the link, I use &lt;code&gt;(setq vc-follow-symlinks 'nil)&lt;/code&gt; to not prompt to ask yes/no and not follow to the real file, (e.g., &lt;code&gt;M-: (buffer-file-name)&lt;/code&gt; shows the &lt;code&gt;/home/user/.emacs&lt;/code&gt; not &lt;code&gt;/home/user/.emacs.d/init.el&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But sometimes I want to show the diff of this file, the &lt;code&gt;C-x v =&lt;/code&gt; will not work for the link, it works in the file if I follow the link to it or open &lt;code&gt;~/.emacs,d/init.el&lt;/code&gt; directly. I don't want to do &lt;code&gt;M-x magit-status&lt;/code&gt; and then &lt;code&gt;~/.emacs.d/&lt;/code&gt; repo and then find the init.el and then &lt;code&gt;TAB&lt;/code&gt;, so is there an easy way to show the diff of the file??&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2015-03-14T03:13:33.333" LastActivityDate="2016-11-30T18:12:06.343" Title="How to make vc-* and magit treat a symbolic link to a real file in git repo just like the original file?" Tags="|magit|ediff|symbolic-links|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3674" PostTypeId="2" ParentId="3652" CreationDate="2014-11-18T04:22:09.267" Score="-1" Body="&lt;p&gt;If you are using &lt;a href=&quot;http://www.emacswiki.org/emacs/IbufferMode&quot; rel=&quot;nofollow&quot; title=&quot;IBuffer&quot;&gt;IBuffer&lt;/a&gt; you can filter by major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within IBuffer press &lt;code&gt;/m&lt;/code&gt; and then enter &lt;code&gt;eww-mode&lt;/code&gt; to only see your eww buffers.&lt;/p&gt;&#xA;" OwnerUserId="146" LastActivityDate="2014-11-18T04:22:09.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3675" PostTypeId="2" ParentId="3672" CreationDate="2014-11-18T05:15:01.753" Score="2" Body="&lt;p&gt;See &lt;a href=&quot;https://stackoverflow.com/questions/26500567/can-i-bind-something-to-alt-meta&quot;&gt;https://stackoverflow.com/questions/26500567/can-i-bind-something-to-alt-meta&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I admit to being surprised that IntelliJ can do that, as I was under the impression that all applications would be in the same boat when it came to receiving input from modifier keys alone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone can provide some details, I'd be interested. My initial guess is that it's related to terminal limitations? (in which case GUI Emacs might &lt;em&gt;in theory&lt;/em&gt; be able to do likewise, but possibly not without breaking terminal compatibility?)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-11-18T05:15:01.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3676" PostTypeId="1" AcceptedAnswerId="3678" CreationDate="2014-11-18T06:34:47.877" Score="11" ViewCount="1666" Body="&lt;p&gt;When I browse Emacs help for functions via &lt;code&gt;C-h f&lt;/code&gt;, I often want to peek into the Elisp/C implementation. I want to enter &lt;code&gt;view-mode&lt;/code&gt; automatically when I access source code this way to avoid unnecessary modification. Is there a hook or function I can advise to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="2607" LastEditorUserId="504" LastEditDate="2014-11-18T10:24:25.613" LastActivityDate="2018-11-16T00:18:58.877" Title="How to enter view-only mode when browsing Emacs source code from help?" Tags="|elisp|hooks|advice|help-mode|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3677" PostTypeId="1" AcceptedAnswerId="3679" CreationDate="2014-11-18T07:02:30.273" Score="2" ViewCount="1558" Body="&lt;p&gt;Whenever I'm in Python mode and do &lt;code&gt;C-c C-c&lt;/code&gt;, I have to answer two questions - firstly, what command to run (which defaults to &lt;code&gt;/usr/bin/python2 -i&lt;/code&gt; for me) and secondly, whether I want a dedicated process. However, I want these things to be the same all the time (namely, use &lt;code&gt;/usr/bin/python2 -i&lt;/code&gt; and &lt;em&gt;not&lt;/em&gt; create a dedicated process), and don't want to have to tell Emacs this explicitly every time. How do I set it up so that these are defaults for &lt;code&gt;C-c C-c&lt;/code&gt;, and won't require me to tell Emacs anything extra to just pressing &lt;code&gt;C-c C-c&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I would like to have Python start in a pop-up frame after the first call to &lt;code&gt;C-c C-c&lt;/code&gt;. I tried code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-buffer-alist&#xA;  (quote ((&quot;\\*Python\\*&quot; display-buffer-pop-up-frame&#xA;     (nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this doesn't seem to affect the &lt;code&gt;*Python*&lt;/code&gt; I get from &lt;code&gt;C-c C-c&lt;/code&gt;. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2015-01-14T23:47:35.283" Title="Python mode - bypassing dialogue on C-c C-c, and having Python appear in its own frame" Tags="|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3678" PostTypeId="2" ParentId="3676" CreationDate="2014-11-18T07:13:32.483" Score="2" Body="&lt;p&gt;&lt;strong&gt;Update (after a night of sleep):&lt;/strong&gt; This answer has a major flaw: it enables &lt;code&gt;view-mode&lt;/code&gt; when navigating to &lt;em&gt;any&lt;/em&gt; function, not just Emacs sources. This can be fixed, but you're better off using &lt;a href=&quot;https://emacs.stackexchange.com/a/3681/2355&quot;&gt;the answer by &lt;strong&gt;@phils&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By doing &lt;code&gt;C-h f describe-function RET&lt;/code&gt; and then reading the source code of &lt;code&gt;describe-function&lt;/code&gt; I discovered that it creates a &quot;button&quot; of a special type for links to function definitions: &lt;code&gt;help-function-def&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;zrgrep&lt;/code&gt; with this string (&quot;&lt;code&gt;help-function-def&lt;/code&gt;&quot;) pointed me to &lt;code&gt;help-mode.el.gz&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After all this digging around we can replace this button type with our own (note the comment in the code):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-button-type 'help-function-def&#xA;  :supertype 'help-xref&#xA;  'help-function (lambda (fun file)&#xA;               (require 'find-func)&#xA;               (when (eq file 'C-source)&#xA;                 (setq file&#xA;                       (help-C-file-name (indirect-function fun) 'fun)))&#xA;               ;; Don't use find-function-noselect because it follows&#xA;               ;; aliases (which fails for built-in functions).&#xA;               (let ((location&#xA;                      (find-function-search-for-symbol fun nil file)))&#xA;                 (pop-to-buffer (car location))&#xA;                 (if (cdr location)&#xA;                     (goto-char (cdr location))&#xA;                   (message &quot;Unable to find location in file&quot;)))&#xA;                   (view-mode t)) ; &amp;lt;= new line: enable view-mode&#xA;  'help-echo (purecopy &quot;mouse-2, RET: find function's definition&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell there is no function to add advice to: Emacs uses a &lt;code&gt;lambda&lt;/code&gt; here. On the other hand (as pointed out by &lt;strong&gt;@rationalrevolt&lt;/strong&gt;) one can replace the &lt;code&gt;help-function&lt;/code&gt; property of the &lt;code&gt;help-function-def&lt;/code&gt; button type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'help-mode)&#xA;(let ((help-func (button-type-get 'help-function-def 'help-function)))&#xA;  (button-type-put 'help-function-def 'help-function&#xA;                   `(lambda (func file)&#xA;                      (funcall ,help-func func file) (view-mode t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-11-18T15:47:35.173" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3679" PostTypeId="2" ParentId="3677" CreationDate="2014-11-18T08:14:35.287" Score="5" Body="&lt;p&gt;&lt;code&gt;C-c C-c&lt;/code&gt; is bound to &lt;code&gt;python-shell-send-buffer&lt;/code&gt; by default. Normally, you'd run this command &lt;em&gt;after&lt;/em&gt; creating a Python process via &lt;kbd&gt;C-c C-p&lt;/kbd&gt; (&lt;code&gt;run-python&lt;/code&gt;), which will &lt;em&gt;not&lt;/em&gt; prompt for anything by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you always want to be able to hit &lt;kbd&gt;C-c C-c&lt;/kbd&gt;, irrespective of whether there is a Python process or not, you can advise &lt;code&gt;python-shell-send-buffer&lt;/code&gt; as follows&lt;sup&gt;1&lt;/sup&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun python-shell-send-buffer-no-prompt (&amp;amp;optional arg)&#xA;  (python-shell-get-or-create-process &quot;/usr/bin/python -i&quot; nil t))&#xA;&#xA;(advice-add 'python-shell-send-buffer :before #'python-shell-send-buffer-no-prompt)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In conjunction with the code you posted, this also takes care of popping to a new frame and displaying the &lt;code&gt;*Python*&lt;/code&gt; buffer there when it is first created: As the signature of &lt;code&gt;python-shell-get-or-create-process&lt;/code&gt; indicates, the last argument specifies whether the &lt;code&gt;*Python*&lt;/code&gt; buffer should be shown or not:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(python-shell-get-or-create-process &amp;amp;optional CMD DEDICATED SHOW)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; This code was written to make use of the &lt;a href=&quot;https://emacs.stackexchange.com/q/3079/504&quot;&gt;new advice system introduced in Emacs 24.4&lt;/a&gt;. If you are using an earlier version of Emacs, the following code will work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice python-shell-send-buffer&#xA;    (before python-shell-send-buffer-no-prompt (&amp;amp;optional arg) activate compile)&#xA;  (python-shell-get-or-create-process &quot;/usr/bin/python -i&quot; nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-01-14T23:47:35.283" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3680" PostTypeId="2" ParentId="3638" CreationDate="2014-11-18T08:36:20.227" Score="1" Body="&lt;p&gt;If you need compatibility with Emacs older than 24.4 this will do as well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice custom-save-all (around custom-save-all-around)&#xA;  &quot;Use abbreviated quotes for customize.&quot;&#xA;  (let ((print-quoted t))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Porting-old-advices.html#Porting-old-advices&quot; rel=&quot;nofollow&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="450" LastActivityDate="2014-11-18T08:36:20.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3681" PostTypeId="2" ParentId="3676" CreationDate="2014-11-18T10:20:12.330" Score="17" Body="&lt;p&gt;You can use &lt;a href=&quot;http://www.emacswiki.org/emacs/DirectoryVariables&quot; rel=&quot;noreferrer&quot;&gt;directory-local variables&lt;/a&gt; to make Emacs' source files read-only by default. (See also &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Directory Variables&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create a file called &lt;code&gt;.dir-locals.el&lt;/code&gt; at the root of the directory tree you wish to protect, with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((nil . ((eval . (view-mode 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Michał Politowski points out in the comments that enabling &lt;code&gt;view-mode&lt;/code&gt; in this way is problematic, because when you dismiss the buffer with &lt;kbd&gt;q&lt;/kbd&gt; it also disables the mode, meaning that the next time you visit that buffer &lt;code&gt;view-mode&lt;/code&gt; will not be enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; Constantine has provided a solution to that problem in the comments below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((nil . ((eval . (when buffer-file-name (view-mode-enter nil #'kill-buffer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This usefully adds a test to ensure that the buffer is already visiting a file, but the key change is the use of &lt;code&gt;view-mode-enter&lt;/code&gt; instead of &lt;code&gt;view-mode&lt;/code&gt;, as the former takes an &lt;code&gt;EXIT-ACTION&lt;/code&gt; argument which determines what to do when &lt;kbd&gt;q&lt;/kbd&gt; is typed. In this case the exit action is to kill the buffer, ensuring that the next time the file is visited it will again end up in &lt;code&gt;view-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 3:&lt;/strong&gt; Following that path, we can also see that the specified &lt;code&gt;EXIT-ACTION&lt;/code&gt; is ultimately passed to the &lt;code&gt;view-mode-exit&lt;/code&gt; function, and its docstring gives us an alternative solution:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;view-no-disable-on-exit is a variable defined in `view.el'.&#xA;Its value is nil&#xA;&#xA;Documentation:&#xA;If non-nil, View mode &quot;exit&quot; commands don't actually disable View mode.&#xA;Instead, these commands just switch buffers or windows.&#xA;This is set in certain buffers by specialized features such as help commands&#xA;that use View mode automatically.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence we can use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((nil . ((eval . (when buffer-file-name&#xA;                   (setq-local view-no-disable-on-exit t)&#xA;                   (view-mode-enter))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;I use the alternative approach which you can specify entirely in your init file (as opposed to creating a &lt;code&gt;.dir-locals.el&lt;/code&gt; file), and I simply make the files read-only rather than using &lt;code&gt;view-mode&lt;/code&gt;. My config looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Emacs&#xA;(dir-locals-set-class-variables&#xA; 'emacs&#xA; '((nil . ((buffer-read-only . t)&#xA;           (show-trailing-whitespace . nil)&#xA;           (tab-width . 8)&#xA;           (eval . (whitespace-mode -1))))))&#xA;&#xA;(dir-locals-set-directory-class &quot;/usr/local/src/emacs&quot; 'emacs)&#xA;(dir-locals-set-directory-class &quot;/usr/local/share/emacs&quot; 'emacs)&#xA;(dir-locals-set-directory-class &quot;/usr/share/emacs&quot; 'emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously you can do the same thing for your elpa directory, and any other directory which contains third-party source code.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-01-24T00:36:45.847" LastActivityDate="2016-01-24T00:36:45.847" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3682" PostTypeId="1" AcceptedAnswerId="3684" CreationDate="2014-11-18T10:26:57.530" Score="0" ViewCount="204" Body="&lt;p&gt;So, whenever I open a new buffer, &lt;code&gt;auto-fill-mode&lt;/code&gt; is enabled. I have checked my configuration and have verified that I'm not enabling it in the &lt;code&gt;init.el&lt;/code&gt; file. How do I find out from where it is getting enabled ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how do I disable it in a certain mode like html-mode. I tried some &lt;a href=&quot;https://stackoverflow.com/questions/9878623/how-can-i-disable-auto-fill-mode-in-emacs&quot;&gt;suggestions&lt;/a&gt; in this thread but this doesn't seem to work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(remove-hook 'html-mode-hook 'turn-on-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="904" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-11-18T11:26:36.940" Title="Finding the place where auto-fill-mode is getting enabled and disabling it" Tags="|html|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3683" PostTypeId="1" AcceptedAnswerId="3685" CreationDate="2014-11-18T10:38:21.160" Score="7" ViewCount="4266" Body="&lt;p&gt;I am editing a large file.  I would like the current line where the cursor is at to be always in the middle of the screen. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorDisplayName="user2005" LastEditDate="2014-11-18T10:46:13.430" LastActivityDate="2014-11-18T11:23:17.130" Title="How to force the current line to be always in the middle of the screen" Tags="|display|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3684" PostTypeId="2" ParentId="3682" CreationDate="2014-11-18T10:38:40.557" Score="3" Body="&lt;p&gt;What I usually do is look at the doc string first and search for &quot;hook&quot;. This gives me &lt;code&gt;html-mode-hook&lt;/code&gt; and the hooks of its parents. Search for &quot;parent&quot; and this gives me &lt;code&gt;sgml-mode&lt;/code&gt;. Keep repeating. I end up with:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;html-mode-hook&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;sgml-mode-hook&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;text-mode-hook&lt;/code&gt; &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Still in the &lt;code&gt;*Help*&lt;/code&gt; buffer, you can click on all of those and see what's there. In my case, I see &lt;code&gt;turn-on-auto-fill&lt;/code&gt; on &lt;code&gt;text-mode-hook&lt;/code&gt;. The solution was this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'html-mode-hook 'turn-off-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Text Mode will have auto-fill enabled and HTML Mode will have auto-fill disabled. You could argue that I probably don't want SGML Mode to have auto-fill enabled, but since I don't use it, I don't care. :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Looking at Doc Strings&lt;/strong&gt;: If it's a function, use &lt;code&gt;C-h f&lt;/code&gt;. If it's a variable, use &lt;code&gt;C-h v&lt;/code&gt;. If you don't know what your major mode is, examine the &lt;em&gt;variable&lt;/em&gt; &lt;code&gt;major-mode&lt;/code&gt; using  &lt;code&gt;C-h v&lt;/code&gt;. This should tell you the major mode such as &lt;code&gt;html-mode&lt;/code&gt;. This is a &lt;em&gt;function&lt;/em&gt;, so you need to use &lt;code&gt;C-h f&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="360" LastEditorUserId="360" LastEditDate="2014-11-18T10:46:31.743" LastActivityDate="2014-11-18T10:46:31.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3685" PostTypeId="2" ParentId="3683" CreationDate="2014-11-18T10:40:53.547" Score="8" Body="&lt;p&gt;There is a mode for that:  &lt;code&gt;centered-cursor-mode&lt;/code&gt;.  It can be installed from MELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not play well with a couple of modes, so this is my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; keep the cursor centered to avoid sudden scroll jumps&#xA;(require 'centered-cursor-mode)&#xA;&#xA;;; disable in terminal modes&#xA;;; http://stackoverflow.com/a/6849467/519736&#xA;;; also disable in Info mode, because it breaks going back with the backspace key&#xA;(define-global-minor-mode my-global-centered-cursor-mode centered-cursor-mode&#xA;  (lambda ()&#xA;    (when (not (memq major-mode&#xA;                     (list 'Info-mode 'term-mode 'eshell-mode 'shell-mode 'erc-mode)))&#xA;      (centered-cursor-mode))))&#xA;(my-global-centered-cursor-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @Nsukami mentioned, an alternative is the built-in &lt;code&gt;scroll-lock-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2014-11-18T11:23:17.130" LastActivityDate="2014-11-18T11:23:17.130" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3686" PostTypeId="2" ParentId="3667" CreationDate="2014-11-18T10:44:47.960" Score="11" Body="&lt;p&gt;You may be looking for &lt;strong&gt;Bongo&lt;/strong&gt;: &lt;a href=&quot;http://wikemacs.org/index.php/Media_player#Bongo&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://wikemacs.org/index.php/Media_player#Bongo&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it is &lt;strong&gt;simple&lt;/strong&gt; (and much simpler than Emms !!) because when you start it, you have all the commands listed in the buffer. You can get it &lt;a href=&quot;https://melpa.org/#/bongo&quot; rel=&quot;nofollow noreferrer&quot;&gt;from MELPA&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;is has got the &lt;strong&gt;Dired&lt;/strong&gt; integration. I never used it but we can either read it &lt;a href=&quot;http://www.emacswiki.org/emacs/BongoHacks&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; or ask &lt;a href=&quot;https://emacs.stackexchange.com/questions/3520/bongo-music-player-wont-play-next-track-in-sequence&quot;&gt;another user&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;not sure about id3tags, but you can edit custom tags (on link above).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My favourite though is mpg123. Very simple and many commands available. I didn't integrate it to Dired but I quickly add files or folders to the playlist thanks to Ido.&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="12534" LastEditDate="2017-09-13T16:06:03.300" LastActivityDate="2017-09-13T16:06:03.300" CommentCount="0" CommunityOwnedDate="2014-11-20T13:47:03.487" ContentLicense="CC BY-SA 3.0" />
  <row Id="3687" PostTypeId="1" AcceptedAnswerId="3690" CreationDate="2014-11-18T10:54:53.460" Score="9" ViewCount="2437" Body="&lt;p&gt;I want to use the same basic keybindings for copy (&lt;code&gt;C-c&lt;/code&gt;), paste (&lt;code&gt;C-v&lt;/code&gt;), cut (&lt;code&gt;C-x&lt;/code&gt;), etc. that are supported in some other software.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="2610" LastEditorUserId="105" LastEditDate="2015-07-05T21:34:37.793" LastActivityDate="2015-07-05T21:34:37.793" Title="Use standard keybindings for copy, paste, cut, etc. as in other software?" Tags="|key-bindings|cua-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3688" PostTypeId="2" ParentId="3682" CreationDate="2014-11-18T11:07:14.727" Score="5" Body="&lt;p&gt;You can get Emacs to show you a stack trace when the function is called, so that you can figure out what called it.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;debug-on-entry&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;auto-fill-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;trigger the issue&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Check the stack trace. Depending on the details, the &lt;em&gt;exact&lt;/em&gt; cause may not be 100% clear, but it should certainly give you a good idea of where to look next.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;c&lt;/kbd&gt; to continue execution of the function, or &lt;kbd&gt;q&lt;/kbd&gt; to quit the debugger.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;cancel-debug-on-entry&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The documentation for the debugger is in the manual:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Debugger&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be sure to read the &quot;Debugger Commands&quot; node.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-18T11:26:36.940" LastActivityDate="2014-11-18T11:26:36.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3689" PostTypeId="2" ParentId="3672" CreationDate="2014-11-18T11:15:36.873" Score="6" Body="&lt;p&gt;Applications written with/for GUI frameworks such as X11 can generally receive individual key-up/key-down events, so it would be possible if only Emacs exposed that functionality to the land of Elisp, but it doesn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a surprise though, in e.g. an X11 frame, hit &lt;code&gt;C-h k&lt;/code&gt;, then click down with your mouse, drag it around, and release it somewhere. The up/down functionality is there for mouse buttons already, and even dragging is considered a key. Scrolling the mouse wheel likewise; it even generates double- and triple- events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, for modkeys, we're sadly out of luck until someone patches the C code. What you might also try is mess with your X keymap; possibly a key can be made a modkey and a normal key simultaneously, but I don't know.&lt;/p&gt;&#xA;" OwnerUserId="2612" LastActivityDate="2014-11-18T11:15:36.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3690" PostTypeId="2" ParentId="3687" CreationDate="2014-11-18T11:19:27.290" Score="16" Body="&lt;p&gt;As others commented, &lt;code&gt;cua-mode&lt;/code&gt; does this, which ships with Emacs. Just &lt;code&gt;M-x cua-mode RET&lt;/code&gt; to enable it, or put &lt;code&gt;(cua-mode 1)&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;.emacs.d/init.el&lt;/code&gt; to enable it at startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless it changed in 24.4, it will also enable using &lt;code&gt;DEL&lt;/code&gt; (usually backspace) to delete (without cutting) a selected region, simply starting to type to overwrite (without cutting) a selected region, and holding down Shift and navigating to select a region, just like all &quot;normal&quot; text editing software does. Possibly some of this functionality has been split up in 24.4; looking into the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html&quot;&gt;Emacs manual&lt;/a&gt; should tell you.&lt;/p&gt;&#xA;" OwnerUserId="2612" LastActivityDate="2014-11-18T11:19:27.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3692" PostTypeId="2" ParentId="3651" CreationDate="2014-11-18T11:29:27.533" Score="1" Body="&lt;p&gt;&lt;code&gt;message-kill-address&lt;/code&gt; (&lt;code&gt;C-c M-k&lt;/code&gt;) gets you most of the way there: it will kill from point to the end of the address.  You would need to advise/adapt it to go to the beginning of the address to have complete functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For what it's worth, &lt;code&gt;message-kill-address&lt;/code&gt; relies internally on &lt;code&gt;message-skip-to-next-address&lt;/code&gt;, but as far as I can tell, there's no analogous &lt;code&gt;message-skip-to-previous-address&lt;/code&gt;.  You could probably adapt the former to get a working version of the latter.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-18T11:29:27.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3693" PostTypeId="2" ParentId="3671" CreationDate="2014-11-18T11:40:44.170" Score="1" Body="&lt;p&gt;I figured out a somewhat convoluted way to get the functionality without modifying &lt;code&gt;org-read-date&lt;/code&gt; or &lt;code&gt;org-read-date-analyze&lt;/code&gt;.  It uses the same approach in the question, but defining a timer that runs every 24-hours at midnight that resets the value of &lt;code&gt;tom&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tomorrow-day ()&#xA;  &quot;Returns the day of the week for tomorrow.&quot;&#xA;  (let ((day (1+ (string-to-number (format-time-string &quot;%w&quot;)))))&#xA;    (if (= day 7)&#xA;        0&#xA;      day)))&#xA;&#xA;(eval-after-load 'parse-time&#xA;   '(progn&#xA;     (setq parse-time-weekdays (nconc parse-time-weekdays&#xA;                                      `((&quot;tom&quot; . ,(tomorrow-day))))&#xA;     (defvar parse-time-tomorrow-timer&#xA;       (run-at-time &quot;12am&quot;&#xA;                    (* 24 60 60)&#xA;                    (lambda ()&#xA;                      (setf (cdr (assoc &quot;tom&quot; parse-time-weekdays))&#xA;                            (tomorrow-day))))&#xA;       &quot;Timer to reset the day to which \&quot;tom\&quot; refers in timestamps.&quot;))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What it lacks in elegance, it makes up in obscurity!&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-18T11:40:44.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3694" PostTypeId="2" ParentId="3687" CreationDate="2014-11-18T11:41:28.647" Score="3" Body="&lt;p&gt;You also might want to check out ergoemacs mode, &lt;a href=&quot;https://ergoemacs.github.io/&quot; rel=&quot;nofollow&quot;&gt;https://ergoemacs.github.io/&lt;/a&gt;. It remaps emacs keybindings to ones that make more sense to users acclimated to modern editing software, among many other changes.&lt;/p&gt;&#xA;" OwnerUserId="2613" LastActivityDate="2014-11-18T11:41:28.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3695" PostTypeId="2" ParentId="3535" CreationDate="2014-11-18T12:50:22.233" Score="6" Body="&lt;p&gt;Please note that it's very easy to invoke the command from its Help buffer. After typing &lt;code&gt;C-h f&lt;/code&gt; just type &lt;code&gt;M-x M-n RET&lt;/code&gt;. This works because in a new Help buffer the command name is at the top of the buffer under the cursor, and &lt;code&gt;M-n&lt;/code&gt; retrieves it to the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you want to add a command to &lt;code&gt;extended-command-history&lt;/code&gt; every time you visit its documentation, then you can do this with a small advice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun describe-function-extended-command-history (function)&#xA;  &quot;Add command name to the history.&quot;&#xA;  (when (commandp function)&#xA;    (add-to-history 'extended-command-history (symbol-name function))))&#xA;&#xA;(advice-add 'describe-function :before #'describe-function-extended-command-history)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or using the new macro &lt;code&gt;define-advice&lt;/code&gt; just added in 25.0.50:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-advice describe-function (:before (function))&#xA;  &quot;Add command name to the history.&quot;&#xA;  (when (commandp function)&#xA;    (add-to-history 'extended-command-history (symbol-name function))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="478" LastEditorUserId="478" LastEditDate="2014-11-20T23:32:30.620" LastActivityDate="2014-11-20T23:32:30.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3696" PostTypeId="2" ParentId="3673" CreationDate="2014-11-18T13:20:37.793" Score="7" Body="&lt;p&gt;I had the same problem and added &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; When opening a file that is a symbolic link, don't ask whether I&#xA;;;; want to follow the link. Just do it&#xA;(setq find-file-visit-truename t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;.emacs&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I can't remember where on the web I found this, so no source credits.&lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2014-11-18T13:20:37.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3697" PostTypeId="2" ParentId="3676" CreationDate="2014-11-18T13:54:54.310" Score="0" Body="&lt;p&gt;I think all you need is to add a &lt;a href=&quot;http://www.emacswiki.org/emacs/FindFunc&quot; rel=&quot;nofollow&quot;&gt;hook&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'find-function-after-hook 'view-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastEditorUserId="2355" LastEditDate="2014-11-18T15:20:32.950" LastActivityDate="2014-11-18T15:20:32.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3698" PostTypeId="1" AcceptedAnswerId="3699" CreationDate="2014-11-18T15:10:05.547" Score="7" ViewCount="884" Body="&lt;p&gt;When I use &lt;code&gt;!&lt;/code&gt; on a &lt;code&gt;*.tar.bz2&lt;/code&gt; file in Dired, I'm presented with the following prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;! on WANem_3.0_Beta2.tar.bz2: {3 guesses} [bunzip2 -c * | tar xvf -] -!-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I add similar functionality for other file types?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2014-12-21T04:06:24.490" LastActivityDate="2014-12-22T14:41:30.143" Title="How can I add default shell commands for various file types?" Tags="|elisp|dired|shell-command|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3699" PostTypeId="2" ParentId="3698" CreationDate="2014-11-18T15:10:05.547" Score="8" Body="&lt;h3&gt;TL;DR:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This functionality comes from &lt;code&gt;dired-x&lt;/code&gt;, not Dired. Use &lt;code&gt;(require 'dired-x)&lt;/code&gt; in your init file and then customize &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;We can see though where Dired plugs into &lt;code&gt;dired-x&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-read-shell-command (prompt arg files)&#xA;  &quot;Read a dired shell command.&#xA;PROMPT should be a format string with one \&quot;%s\&quot; format sequence,&#xA;which is replaced by the value returned by `dired-mark-prompt',&#xA;with ARG and FILES as its arguments.  FILES should be a list of&#xA;file names.  The result is used as the prompt.&#xA;&#xA;This normally reads using `read-shell-command', but if the&#xA;`dired-x' package is loaded, use `dired-guess-shell-command' to&#xA;offer a smarter default choice of shell command.&quot;&#xA;  (minibuffer-with-setup-hook&#xA;      (lambda ()&#xA;    (set (make-local-variable 'minibuffer-default-add-function)&#xA;         'minibuffer-default-add-dired-shell-commands))&#xA;    (setq prompt (format prompt (dired-mark-prompt arg files)))&#xA;    (if (functionp 'dired-guess-shell-command) ; &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&#xA;    (dired-mark-pop-up nil 'shell files&#xA;               'dired-guess-shell-command prompt files)&#xA;      (dired-mark-pop-up nil 'shell files&#xA;             'read-shell-command prompt nil nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After reading the &lt;code&gt;dired-x&lt;/code&gt; manual &lt;code&gt;(info &quot;dired-x&quot;)&lt;/code&gt;, you learn of the variable &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt;, which you can customize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of changing &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq dired-guess-shell-alist-user&#xA;      '((&quot;\\.e?ps$&quot; &quot;gv&quot; &quot;xloadimage&quot; &quot;lpr&quot;)&#xA;        (&quot;\\.chm$&quot; &quot;xchm&quot;)&#xA;        (&quot;\\.rar$&quot; &quot;unrar x&quot;)&#xA;        (&quot;\\.e?ps\\.g?z$&quot; &quot;gunzip -qc * | gv -&quot;)&#xA;        (&quot;\\.pdf$&quot; &quot;zathura&quot;)&#xA;        (&quot;\\.flv$&quot; &quot;mplayer&quot;)&#xA;        (&quot;\\.mov$&quot; &quot;mplayer&quot;)&#xA;        (&quot;\\.3gp$&quot; &quot;mplayer&quot;)&#xA;        (&quot;\\.png$&quot; &quot;feh&quot;)&#xA;        (&quot;\\.jpg$&quot; &quot;feh&quot;)&#xA;        (&quot;\\.JPG$&quot; &quot;feh&quot;)&#xA;        (&quot;\\.avi$&quot; &quot;mplayer&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-22T14:41:30.143" LastActivityDate="2014-12-22T14:41:30.143" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3700" PostTypeId="2" ParentId="3676" CreationDate="2014-11-18T15:42:43.263" Score="0" Body="&lt;p&gt;This does not address your specific case, but the more general case of switching to &lt;code&gt;view-mode&lt;/code&gt; whenever you visit a source file from a help buffer. I'm offering it as an alternative  to @Constantine's answer, since it wasn't readable as a comment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looks like I originally got this from the &lt;a href=&quot;http://www.emacswiki.org/emacs/ViewMode&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice find-function-search-for-symbol (after view-function-source last (symbol type library) activate)&#xA;  &quot;When visiting function source via Help, switch to view-mode&quot;&#xA;  (with-current-buffer (car ad-return-value)&#xA;    (view-mode 1)))&#xA;&#xA;(defadvice find-variable-noselect (after view-var-source last (variable &amp;amp;optional file) activate)&#xA;  &quot;When visiting variable source via Help, switch to view-mode&quot;&#xA;  (with-current-buffer (car ad-return-value)&#xA;    (view-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-18T15:42:43.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3701" PostTypeId="1" AcceptedAnswerId="3703" CreationDate="2014-11-18T15:47:07.377" Score="23" ViewCount="1810" Body="&lt;p&gt;I need to add a single integer to a list that's already sorted, such&#xA;that it goes in the right place. My first tought was something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sort (cons newelt list) #'&amp;lt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, given that &lt;code&gt;list&lt;/code&gt; is already sorted, only one insertion is&#xA;really needed, which means this solution could be horribly unsuitable&#xA;depending on the algorithm used by &lt;code&gt;sort&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, &lt;strong&gt;which is the algorithm that &lt;code&gt;sort&lt;/code&gt; uses?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would I be better off doing something like the following?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((tail list))&#xA;  ;; The first element is never less-than&#xA;  (while (and tail (&amp;lt; newelt (cadr tail)))&#xA;    (setq tail (cdr tail)))&#xA;  (setcdr tail (cons newelt (cdr tail)))&#xA;  list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-23T13:02:48.113" LastActivityDate="2014-11-23T13:02:48.113" Title="What algorithm does sort use?" Tags="|elisp|performance|emacs-internals|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3702" PostTypeId="2" ParentId="3671" CreationDate="2014-11-18T15:55:09.830" Score="3" Body="&lt;p&gt;Seems like we can build on &lt;strong&gt;@lawlist&lt;/strong&gt;'s idea and do something similar to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-read-date-analyze :around&#xA;            (lambda (orig ans org-def org-defdecode)&#xA;              (funcall orig (if (string-match &quot;tom&quot; ans) &quot;+1d&quot; ans) org-def org-defdecode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-18T17:50:25.493" LastActivityDate="2014-11-18T17:50:25.493" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3703" PostTypeId="2" ParentId="3701" CreationDate="2014-11-18T15:56:53.777" Score="25" Body="&lt;p&gt;If you have the Emacs source code installed, you can find the source code for &lt;code&gt;sort&lt;/code&gt; with &lt;code&gt;M-x find-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There you can see that &lt;code&gt;sort&lt;/code&gt; performs a merge sort.  It checks the length of the list, breaks the list into half, sorts the &quot;front&quot; and the &quot;back&quot; parts separately through recursion, and then merges the two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for whether your implementation would be faster — measure it!  It is more efficient in theory (O(n) vs O(n log n)), but &lt;code&gt;sort&lt;/code&gt; has the advantage of being written in C, so the result might go either way.  (Of course, don't forget to byte-compile your function.)&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-11-18T15:56:53.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3704" PostTypeId="1" AcceptedAnswerId="3705" CreationDate="2014-11-18T16:04:43.427" Score="0" ViewCount="531" Body="&lt;p&gt;With regular &lt;code&gt;find-file&lt;/code&gt; it's possible to supply &lt;code&gt;*.[ch]&lt;/code&gt; to open all &lt;code&gt;.c&lt;/code&gt; or &lt;code&gt;.h&lt;/code&gt; files in a directory.  &lt;code&gt;ido-find-file&lt;/code&gt; doesn't seem to support this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can press &lt;kbd&gt;C-f&lt;/kbd&gt; while &lt;code&gt;ido-find-file&lt;/code&gt; is open to switch back to regular &lt;code&gt;find-file&lt;/code&gt;, but is there a way to tell &lt;code&gt;ido&lt;/code&gt; that I always want to use the regular  expression matching?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help says that &lt;kbd&gt;C-t&lt;/kbd&gt; toggles regular expression matching, but it doesn't seem to have any affect to me.&lt;/p&gt;&#xA;" OwnerUserId="138" LastEditorUserId="105" LastEditDate="2017-05-16T22:39:21.197" LastActivityDate="2017-05-16T22:39:21.197" Title="selecting files with regular expression using ido-find-file" Tags="|files|ido|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3705" PostTypeId="2" ParentId="3704" CreationDate="2014-11-18T16:26:22.513" Score="3" Body="&lt;p&gt;Ido cannot select multiple items. You'll have to use the normal &lt;code&gt;find-file&lt;/code&gt; or Helm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the Emacs wiki there seems to be a gist for multi selecting items in Ido but I'm not sure if it works: &lt;a href=&quot;http://www.emacswiki.org/InteractivelyDoThings&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/InteractivelyDoThings&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2014-11-18T17:07:18.470" LastActivityDate="2014-11-18T17:07:18.470" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3706" PostTypeId="1" AcceptedAnswerId="3737" CreationDate="2014-11-18T18:54:36.327" Score="5" ViewCount="538" Body="&lt;p&gt;I've become accustomed to using &lt;code&gt;C-x p&lt;/code&gt; for switching to the previous window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, I recently had to start including a company-wide &lt;code&gt;startup.el&lt;/code&gt; file that defines the prefix &lt;code&gt;C-x p-&lt;/code&gt;. I don't use any of the &lt;code&gt;C-x p-&lt;/code&gt; shortcuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way that I can undefine the &lt;code&gt;C-x p-&lt;/code&gt; prefix after it's been defined?&lt;/p&gt;&#xA;" OwnerUserId="2619" LastEditorUserId="25" LastEditDate="2014-12-25T00:22:24.917" LastActivityDate="2018-01-02T15:44:43.843" Title="Undefine prefix binding" Tags="|key-bindings|prefix-keys|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3707" PostTypeId="2" ParentId="3706" CreationDate="2014-11-18T19:10:25.293" Score="2" Body="&lt;p&gt;From &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rebinding.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;gnu.org&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x local-unset-key &amp;lt;RET&amp;gt; key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Make key undefined locally (in the major mode now in effect).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So you can use&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(local-unset-key (kbd &amp;quot;C-x p-&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-11-21T14:36:27.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3711" PostTypeId="1" AcceptedAnswerId="7256" CreationDate="2014-11-18T21:28:56.943" Score="3" ViewCount="1247" Body="&lt;p&gt;I use pdb with gud to debug python scripts. I am just wondering if there is way to highlight the lines with breakpoints? For example, in some screenshots of gud-gdb, some people seem to have red circles to the left of lines with breakpoints. How to achieve that with pdb? And is there a way to list all breakpoints (like the breakpoints buffer of gud-gdb)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I actually tried realgud once, and it did have this feature. However, realgud is lacking documentation, and I find it extremely confusing to use. I have very limited knowledge of elisp, so I cannot figure out what is going on without a more detailed guide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, why gud with pdb does not have the function gud-until?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2622" LastEditorUserId="5163" LastEditDate="2015-06-29T15:38:00.580" LastActivityDate="2018-09-24T02:12:25.987" Title="highlight breakpoints with pdb" Tags="|python|gud|realgud|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3712" PostTypeId="1" AcceptedAnswerId="3713" CreationDate="2014-11-18T21:42:49.863" Score="8" ViewCount="1343" Body="&lt;p&gt;I'm used to have display of the number of selected characters in the mode line when there is an active selection (in vim).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to achieve this in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I managed to display the column index besides the line index, which is something... But not quite enough. I also looked at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html&quot; rel=&quot;nofollow&quot;&gt;the mode line format documentation&lt;/a&gt;, but without success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found &lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line&quot; rel=&quot;nofollow&quot;&gt;smart mode line&lt;/a&gt; but I think that it doesn't offer the feature as of now.&lt;/p&gt;&#xA;" OwnerUserId="2592" LastEditorUserId="105" LastEditDate="2015-05-20T04:57:22.733" LastActivityDate="2023-12-10T22:12:59.223" Title="display in the mode-line the number of characters in the selection" Tags="|elisp|mode-line|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3713" PostTypeId="2" ParentId="3712" CreationDate="2014-11-18T22:10:01.693" Score="9" Body="&lt;p&gt;Use library &lt;a href=&quot;https://www.emacswiki.org/emacs/ModeLinePosition&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Mode-Line Position&lt;/em&gt;&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/modeline-posn.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;modeline-posn.el&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows you the size of the selection (active region) in the mode line, using the &lt;code&gt;region&lt;/code&gt; face. It optionally tells you also the number of selected characters or characters and lines, etc.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2019-03-18T01:56:55.030" LastActivityDate="2019-03-18T01:56:55.030" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="3714" PostTypeId="2" ParentId="3712" CreationDate="2014-11-18T22:23:21.057" Score="1" Body="&lt;p&gt;The following code could be a good start for you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-line-format '(&quot;%e&quot; (:eval (number-to-string (abs (- (point) (mark)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This sets the mode line to display the number of selected characters. It only updates after some events, e.g. &lt;code&gt;C-l&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To finish this off you'd just want to add the specified form to an existing mode-line-format variable.&lt;/p&gt;&#xA;" OwnerUserId="313" LastActivityDate="2014-11-18T22:23:21.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3715" PostTypeId="1" AcceptedAnswerId="3884" CreationDate="2014-11-18T22:48:39.387" Score="4" ViewCount="221" Body="&lt;p&gt;I'm trying to write a major mode for a language that supports normal strings and triple-quoted strings (&lt;code&gt;&quot;foo&quot;&lt;/code&gt; and &lt;code&gt;&quot;&quot;&quot;foo&quot;&quot;&quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst my-string-mode-syntax-table&#xA;  (let ((table (make-syntax-table)))&#xA;    (modify-syntax-entry ?\&quot; &quot;\&quot;&quot; table)&#xA;    table))&#xA;&#xA;(defconst my-string-mode-triple-quoted&#xA;  (rx &quot;\&quot;\&quot;\&quot;&quot; (group (*? anything) &quot;\&quot;\&quot;\&quot;&quot;)))&#xA;&#xA;(define-derived-mode my-string-mode prog-mode &quot;My Mode&quot;&#xA;  &quot;testing&quot;&#xA;  :syntax-table my-string-mode-syntax-table&#xA;  (set (make-local-variable 'font-lock-defaults)&#xA;       `(((,my-string-mode-triple-quoted 1 'font-lock-string-face t))))&#xA;  (font-lock-fontify-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've marked &lt;code&gt;&quot;&lt;/code&gt; as a string delimiter, and highlighted triple-quoted strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works in some cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;foo &quot;bar&quot; baz&quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, string highlighting is broken when I have an odd number of double quotes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &quot;&quot;&quot;foo &quot; bar&quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It also breaks &lt;code&gt;parse-partial-sexp&lt;/code&gt; as it no longer returns strings in the correct places.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the correct emacs functionality to handle this?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2017-05-02T12:47:07.233" LastActivityDate="2017-05-02T12:47:07.233" Title="How do I handle multiple string delimeters in a major mode?" Tags="|major-mode|font-lock|syntax-highlighting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3718" PostTypeId="1" AcceptedAnswerId="3723" CreationDate="2014-11-19T01:39:11.267" Score="3" ViewCount="713" Body="&lt;p&gt;I am trying to use &lt;code&gt;aggressive-indent&lt;/code&gt;, which I find great, but when I am writing Python code it doesn't seem to work (although general it works fine). I may miss something in the usage of &lt;code&gt;aggressive-indent&lt;/code&gt;, making this my fault, but I can't see why. Can someone see what is the problem?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="50" LastEditDate="2014-11-19T02:34:24.977" LastActivityDate="2014-11-19T02:34:24.977" Title="Python and aggressive-indent" Tags="|indentation|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3719" PostTypeId="1" AcceptedAnswerId="3722" CreationDate="2014-11-19T01:40:45.987" Score="3" ViewCount="181" Body="&lt;p&gt;In &lt;a href=&quot;http://emacsrocks.com/e13.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; &quot;Emacs Rocks&quot; video relating to the library &lt;code&gt;multiple-cursors&lt;/code&gt; ( &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magnars/multiple-cursors.el&lt;/a&gt; ), the author demonstrates a way of swiftly performing calculations, getting the result in the main window (not in the mini buffer). However, he does not explain what commands are being used. I haven't been able to replicate them, having consulted the available documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how he does it?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="2287" LastEditDate="2014-11-19T02:06:25.330" LastActivityDate="2014-11-19T02:06:25.330" Title="Calculations à la Emacs Rocks -- with `multiple-cursors`" Tags="|calc|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3720" PostTypeId="2" ParentId="3715" CreationDate="2014-11-19T01:52:31.797" Score="2" Body="&lt;p&gt;You want to setup a &lt;code&gt;syntax-propertize-function&lt;/code&gt;.&#xA;As Patrick Steele suggests, you can look for an existing example in python.el.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-19T01:52:31.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3721" PostTypeId="2" ParentId="3719" CreationDate="2014-11-19T01:53:01.950" Score="6" Body="&lt;p&gt;The &lt;a href=&quot;http://emacsrocks.com/e13.html&quot;&gt;same&lt;/a&gt; Emacs Rocks page links to &lt;a href=&quot;https://github.com/magnars/.emacs.d/blob/master/defuns/lisp-defuns.el&quot;&gt;an implementation of &lt;code&gt;eval-and-replace&lt;/code&gt;&lt;/a&gt; used to replace a sexp with its value in this episode.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-19T01:53:01.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3722" PostTypeId="2" ParentId="3719" CreationDate="2014-11-19T01:54:48.257" Score="5" Body="&lt;p&gt;The idea is to evaluate some Elisp inline and replace it with the result. It looks like he did it with a &lt;a href=&quot;https://github.com/magnars/.emacs.d/blob/master/defuns/lisp-defuns.el&quot; rel=&quot;noreferrer&quot;&gt;custom function&lt;/a&gt; he defined and bound to &lt;code&gt;C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;C-x C-e&lt;/code&gt; is bound to &lt;code&gt;eval-last-sexp&lt;/code&gt; by default, which does something very similar. It evaluates the s-expression just before your cursor. If you call it with a prefix argument, it will paste the result into the current buffer, but it won't delete the expression. So play around with it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(* 100 200)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put your cursor at the end of that and do &lt;code&gt;C-u C-x C-e&lt;/code&gt; to get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(* 100 200)20000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17" LastActivityDate="2014-11-19T01:54:48.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3723" PostTypeId="2" ParentId="3718" CreationDate="2014-11-19T02:28:21.637" Score="5" Body="&lt;p&gt;Aggressive-indent intentionally disables itself on major modes where it wouldn't make sense. &lt;code&gt;python-mode&lt;/code&gt; is one of them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that indentation is not absolute in python, so Emacs has no way of performing it automatically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can disable this safeguard (at your own risk) with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq aggressive-indent-excluded-modes&#xA;      (remove 'python-mode aggressive-indent-excluded-modes)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-19T02:28:21.637" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3724" PostTypeId="1" AcceptedAnswerId="3731" CreationDate="2014-11-19T02:37:54.700" Score="2" ViewCount="489" Body="&lt;p&gt;I have this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/JwFiN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug? Is this something I can avoid now while a patch comes to Helm?&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-11-19T17:08:42.673" Title="how to make HELM stop when TRAMP asks me for my password?" Tags="|helm|tramp|" AnswerCount="1" CommentCount="16" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3725" PostTypeId="1" AcceptedAnswerId="12830" CreationDate="2014-11-19T03:10:22.377" Score="5" ViewCount="324" Body="&lt;p&gt;I am modifying &lt;code&gt;desktop.el&lt;/code&gt; to support restoring the &lt;code&gt;buffer-undo-list&lt;/code&gt;, and am &lt;code&gt;push&lt;/code&gt;-ing that list at the tail end of the function &lt;code&gt;desktop-buffer-info&lt;/code&gt; because the &lt;code&gt;buffer-undo-list&lt;/code&gt; is not included in the output of the function &lt;code&gt;buffer-local-variables&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  Is there a built-in method to include the &lt;code&gt;buffer-undo-list&lt;/code&gt; in the output of the function &lt;code&gt;buffer-local-variables&lt;/code&gt;?  If not, is there a reason why it's not included?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the &lt;code&gt;buffer-undo-list&lt;/code&gt; get stored into the desktop file, I add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push (cons 'buffer-undo-list buffer-undo-list) ll)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, but I'd like to understand why a seemingly buffer-local variable is excluded from the function &lt;code&gt;buffer-local-variables&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-06-01T15:16:15.553" Title="Why is the `buffer-undo-list` excluded from `(buffer-local-variables)`?" Tags="|elisp|undo|desktop|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3726" PostTypeId="2" ParentId="3637" CreationDate="2014-11-19T04:27:30.813" Score="2" Body="&lt;p&gt;My answer? Just do it by hand. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-x C-q&lt;/code&gt; in &lt;code&gt;*Help*&lt;/code&gt;.  And do &lt;code&gt;M-x text-mode&lt;/code&gt; or something [*].&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then fill or otherwise adjust it there to you liking.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then make the source code correspond (DTRT, to produce the effect you want). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Same thing for alignment, where there is a list of terms (e.g., a commands or keys), with each one followed by some number of &lt;code&gt;\t&lt;/code&gt;'s and then some description. IOW, do your editing in &lt;code&gt;*Help*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[*] Unfortunately, Emacs Dev screwed &lt;code&gt;*Help*&lt;/code&gt; by making it so that if you just use &lt;code&gt;C-x C-q&lt;/code&gt; there are some keys (e.g., &lt;code&gt;q&lt;/code&gt;, &lt;code&gt;RET&lt;/code&gt;, &lt;code&gt;Backspace&lt;/code&gt;) that you cannot use for editing normally.  So you now need to change the mode as well.  On n'arrete pas le progres...&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-19T04:33:29.043" LastActivityDate="2014-11-19T04:33:29.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3727" PostTypeId="1" CreationDate="2014-11-19T13:17:49.073" Score="3" ViewCount="575" Body="&lt;p&gt;I try to create an interaction between &lt;code&gt;Emacs&lt;/code&gt; and other applications, e. g. Microsoft Office.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I have defined a VBA Macro in &lt;code&gt;MS Outlook&lt;/code&gt; which starts a search in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;strEmacsclientPath = &quot;C:\emacs\emacs-24.3\bin\emacsclient.exe&quot;&#xA;&#xA;strShellCommand = strEmacsclientPath &amp;amp; &quot; -c --eval &quot; &amp;amp; Chr(34) &amp;amp; &quot;(org-search-view nil&quot; &amp;amp; Chr(34) &amp;amp; Chr(34) &amp;amp; Chr(34) _&#xA;    &amp;amp; strSearchText _&#xA;    &amp;amp; Chr(34) &amp;amp; Chr(34) &amp;amp; Chr(34) &amp;amp; &quot;)&quot; &amp;amp; Chr(34)&#xA;&#xA;Call Shell(strShellCommand, vbHide)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works, but if the text to search (defined in variable &lt;em&gt;strSearchText&lt;/em&gt; ) contains special characters like &lt;strong&gt;äöü&lt;/strong&gt;, it fails, as e. g. with the search term &quot;für&quot;, in Emacs I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Search words: f\374r &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In consequence, it also does not find real occurrences of the search term &quot;für&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I avoid that?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've redefined the encoding settings, as I also had problems in the past:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;(setq coding-system-for-read 'utf-8)&#xA;(setq coding-system-for-write 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are the complete current encoding settings (obtained with &lt;code&gt;C-h C RET&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Coding system for saving this buffer:   U -- utf-8-dos (alias:&#xA;  mule-utf-8-dos)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Default coding system (for new files):   U -- utf-8 (alias:&#xA;  mule-utf-8)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Coding system for keyboard input:   1 -- iso-latin-1-unix (alias:&#xA;  iso-8859-1-unix latin-1-unix)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Coding system for terminal output:   * -- cp1252 (alias of&#xA;  windows-1252)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Coding system for inter-client cut and paste:   U -- utf-16le-dos&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Defaults for subprocess I/O:   decoding: U -- utf-8-unix (alias:&#xA;  mule-utf-8-unix)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;encoding: U -- utf-8-unix (alias: mule-utf-8-unix)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Priority order for recognizing coding systems when reading files:&#xA;    1. utf-8 (alias: mule-utf-8)&lt;br&gt;&#xA;    2. iso-2022-7bit&lt;br&gt;&#xA;    3. iso-latin-1 (alias: iso-8859-1 latin-1)&lt;br&gt;&#xA;    4. iso-2022-7bit-lock (alias: iso-2022-int-1)&lt;br&gt;&#xA;    5. iso-2022-8bit-ss2&lt;br&gt;&#xA;    6. emacs-mule&lt;br&gt;&#xA;    7. raw-text&lt;br&gt;&#xA;    8. iso-2022-jp (alias: junet)&lt;br&gt;&#xA;    9. in-is13194-devanagari (alias: devanagari)&lt;br&gt;&#xA;    10. chinese-iso-8bit (alias: cn-gb-2312 euc-china euc-cn cn-gb gb2312)&lt;br&gt;&#xA;    11. utf-8-auto&lt;br&gt;&#xA;    12. utf-8-with-signature&lt;br&gt;&#xA;    13. utf-16&lt;br&gt;&#xA;    14. utf-16be-with-signature (alias: utf-16-be)&lt;br&gt;&#xA;    15. utf-16le-with-signature (alias: utf-16-le)&lt;br&gt;&#xA;    16. utf-16be&lt;br&gt;&#xA;    17. utf-16le&lt;br&gt;&#xA;    18. japanese-shift-jis (alias: shift_jis sjis)&lt;br&gt;&#xA;    19. chinese-big5 (alias: big5 cn-big5 cp950)&lt;br&gt;&#xA;    20. undecided   &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Other coding systems cannot be distinguished automatically   from&#xA;  these, and therefore cannot be recognized automatically   with the&#xA;  present coding system priorities.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Particular coding systems specified for certain file names:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;OPERATION   TARGET PATTERN      CODING SYSTEM(s)&lt;br&gt;&#xA;  --------- --------------      ----------------&lt;br&gt;&#xA;  File I/O   &quot;\.dz\'&quot;      (no-conversion . no-conversion) &#xA;        &quot;\.xz\'&quot;      (no-conversion . no-conversion)&lt;br&gt;&#xA;        &quot;\.lzma\'&quot;        (no-conversion . no-conversion)&lt;br&gt;&#xA;        &quot;\.lz\'&quot;      (no-conversion . no-conversion)&lt;br&gt;&#xA;        &quot;\.g?z\'&quot;     (no-conversion . no-conversion)&lt;br&gt;&#xA;        &quot;\.\(?:tgz\|svgz\|sifz\)\'&quot;&lt;br&gt;&#xA;                    (no-conversion . no-conversion)         &quot;\.tbz2?\'&quot;         (no-conversion . no-conversion)       &quot;\.bz2\'&quot;     (no-conversion . no-conversion)&lt;br&gt;&#xA;        &quot;\.Z\'&quot;       (no-conversion . no-conversion)&lt;br&gt;&#xA;        &quot;\.elc\'&quot;     utf-8-emacs         &quot;\.utf\(-8\)?\'&quot;    utf-8&lt;br&gt;&#xA;        &quot;\.xml\'&quot;     xml-find-file-coding-system&lt;br&gt;&#xA;        &quot;\(\`\|/\)loaddefs.el\'&quot;&lt;br&gt;&#xA;                    (raw-text . raw-text-unix)      &quot;\.tar\'&quot;     (no-conversion .   no-conversion)       &quot;\.po[tx]?\'\|\.po\.&quot;&lt;br&gt;&#xA;                    po-find-file-coding-system      &quot;\.\(tex\|ltx\|dtx\|drv\)\'&quot;&#xA;                    latexenc-find-file-coding-system        &quot;&quot;          find-buffer-file-type-coding-system   Process&#xA;  I/O   &quot;[pP][lL][iI][nN][kK]&quot;  (undecided-dos . undecided-dos)&#xA;        &quot;[cC][mM][dD][pP][rR][oO][xX][yY]&quot;&#xA;                    (undecided-dos . undecided-dos)   Network I/O   nothing specified&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2377" LastEditDate="2014-11-19T15:01:46.223" LastActivityDate="2015-02-17T16:03:42.880" Title="How to transfer special characters like äöü in the command line to emacsclient?" Tags="|emacsclient|microsoft-windows|character-encoding|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3728" PostTypeId="2" ParentId="3727" CreationDate="2014-11-19T14:21:13.050" Score="1" Body="&lt;p&gt;As @nanny says, this is a problem of character encoding.  I suggest you try something like (beware, I know nothing about VBA, so I'm just guessing at the syntax):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;strShellCommand = strEmacsclientPath &amp;amp; &quot; -c --eval &quot; &amp;amp; Chr(34) _&#xA;    &amp;amp; &quot;(org-search-view nil (decode-coding-string &quot; &amp;amp; Chr(34) &amp;amp; Chr(34) &amp;amp; Chr(34) _&#xA;    &amp;amp; strSearchText _&#xA;    &amp;amp; Chr(34) &amp;amp; Chr(34) &amp;amp; Chr(34) &amp;amp; &quot; locale-coding-system))&quot; &amp;amp; Chr(34)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-19T14:21:13.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3729" PostTypeId="1" AcceptedAnswerId="3730" CreationDate="2014-11-19T15:43:51.963" Score="7" ViewCount="950" Body="&lt;p&gt;I'm trying &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;Projectile&lt;/a&gt; + &lt;a href=&quot;http://www.emacswiki.org/InteractivelyDoThings&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ido&lt;/code&gt;&lt;/a&gt; + &lt;a href=&quot;https://github.com/lewang/flx/blob/master/flx-ido.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;flx-ido&lt;/code&gt;&lt;/a&gt; (just for Projectile, &lt;code&gt;ido-mode&lt;/code&gt; disabled otherwise).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But: I don't like using &lt;kbd&gt;right&lt;/kbd&gt; and &lt;kbd&gt;left&lt;/kbd&gt; to switch between items. I want to change them into &lt;kbd&gt;up&lt;/kbd&gt; and &lt;kbd&gt;down&lt;/kbd&gt;, but have been unsuccessful:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ido-common-completion-map (kbd &quot;&amp;lt;down&amp;gt;&quot;) 'ido-next-match)&#xA;(define-key ido-common-completion-map (kbd &quot;&amp;lt;up&amp;gt;&quot;) 'ido-prev-match)&#xA;(define-key ido-completion-map (kbd &quot;&amp;lt;down&amp;gt;&quot;) 'ido-next-match)&#xA;(define-key ido-completion-map (kbd &quot;&amp;lt;up&amp;gt;&quot;) 'ido-prev-match)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question, therefore, is: &lt;strong&gt;How do I bind keys in &lt;code&gt;ido-mode&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="253" LastEditDate="2014-11-19T16:01:16.170" LastActivityDate="2014-11-19T16:01:16.170" Title="How do I bind keys in ido?" Tags="|key-bindings|ido|projectile|flx-ido|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3730" PostTypeId="2" ParentId="3729" CreationDate="2014-11-19T15:56:13.537" Score="7" Body="&lt;p&gt;According to the source code, you need to modify keybindings via &lt;code&gt;ido-setup-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Customization&#xA;;; -------------&#xA;;;&#xA;;; Customize the `ido' group to change the `ido' functionality.&#xA;;;&#xA;;; To modify the keybindings, use the ido-setup-hook.  For example:&#xA;;;(add-hook 'ido-setup-hook 'ido-my-keys)&#xA;;;&#xA;;;(defun ido-my-keys ()&#xA;;;  &quot;Add my keybindings for ido.&quot;&#xA;;;  (define-key ido-completion-map &quot; &quot; 'ido-next-match)&#xA;;;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bind-ido-keys ()&#xA;  &quot;Keybindings for ido mode.&quot;&#xA;  (define-key ido-completion-map (kbd &quot;&amp;lt;down&amp;gt;&quot;) 'ido-next-match) &#xA;  (define-key ido-completion-map (kbd &quot;&amp;lt;up&amp;gt;&quot;)   'ido-prev-match))&#xA;&#xA;(add-hook 'ido-setup-hook #'bind-ido-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-19T15:56:13.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3731" PostTypeId="2" ParentId="3724" CreationDate="2014-11-19T16:32:44.797" Score="2" Body="&lt;p&gt;It was fixed in the commit &lt;a href=&quot;https://github.com/emacs-helm/helm/commit/9f64244881c24e31bb2efc7da5b63703ae620220&quot; rel=&quot;nofollow&quot;&gt;9f64244&lt;/a&gt;. You could try again without any error now. The error is not related to the interaction between Tramp and Helm but AngeFTP and Helm.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="10" LastEditDate="2014-11-19T17:08:42.673" LastActivityDate="2014-11-19T17:08:42.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3732" PostTypeId="1" AcceptedAnswerId="3733" CreationDate="2014-11-19T18:37:26.067" Score="9" ViewCount="921" Body="&lt;p&gt;The default of key binding &lt;code&gt;C-a/C-e&lt;/code&gt; is only for one thing, move to the beginning/end of the line, is there any package that can make Emacs act like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If I'm not at the end of a line, &lt;code&gt;C-e&lt;/code&gt; will go to the end of the line, otherwise, go the end of next line&lt;/li&gt;&#xA;&lt;li&gt;If I'm not at the beginning of a line, &lt;code&gt;C-a&lt;/code&gt; will go to beginning of the line, otherwise go to the beginning of the next line. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The point is you can just keep hitting &lt;code&gt;C-a/e&lt;/code&gt; to go to beginning/end of every line without moving your finger to reach &lt;code&gt;C-n/p&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And with a prefix(&lt;code&gt;C-u&lt;/code&gt;) they will go to the beginning/end of line in the opposite direction.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2014-11-19T19:15:39.180" LastActivityDate="2015-05-09T20:37:31.363" Title="Keep moving to the end of lines" Tags="|key-bindings|line-break|motion|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3733" PostTypeId="2" ParentId="3732" CreationDate="2014-11-19T19:00:29.923" Score="11" Body="&lt;p&gt;I don't know of a package that would enable this behavior, but here's one way to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;C-h k C-a&lt;/code&gt; to discover that &lt;code&gt;C-a&lt;/code&gt; is bound to &lt;code&gt;move-beginning-of-line&lt;/code&gt;; this is the function we need to modify --- or just use to implement the &quot;moving to the beginning&quot; part. Similarly, with &lt;code&gt;C-h k&lt;/code&gt; I can find &lt;code&gt;forward-line&lt;/code&gt;, which will be used to move up/down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be able to bind a function to a key we need to make it a &lt;em&gt;command&lt;/em&gt;, so we need to use the &lt;code&gt;interactive&lt;/code&gt;special form (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html#Using-Interactive&quot;&gt;Using Interactive&lt;/a&gt;). To take the &lt;code&gt;C-u&lt;/code&gt; prefix argument we need the &lt;code&gt;&quot;P&quot;&lt;/code&gt; code character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining this with &lt;code&gt;bolp&lt;/code&gt; (check if at the beginning of a line) and &lt;code&gt;eolp&lt;/code&gt; (check if at an end of a line), we can write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-move-beginning-of-line (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (when (bolp) (previous-line (if arg -1 1)))&#xA;  (move-beginning-of-line nil))&#xA;&#xA;(defun my-move-end-of-line (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (when (eolp) (forward-line (if arg -1 1)))&#xA;  (move-end-of-line nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we can re-bind &lt;code&gt;C-a&lt;/code&gt; and &lt;code&gt;C-e&lt;/code&gt; to call these:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [remap move-beginning-of-line] #'my-move-beginning-of-line)&#xA;(global-set-key [remap move-end-of-line] #'my-move-end-of-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, one could &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot;&gt;add advice&lt;/a&gt; to &lt;code&gt;move-beginning-of-line&lt;/code&gt; and &lt;code&gt;move-end-of-line&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-24T15:22:14.117" LastActivityDate="2014-11-24T15:22:14.117" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3734" PostTypeId="2" ParentId="3732" CreationDate="2014-11-19T19:02:12.897" Score="1" Body="&lt;p&gt;The following two functions perform the desired actions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun move-beginning-of-line-or-previous (&amp;amp;optional pre)&#xA;  &quot;Move to the start of the line. If we are already at the start&#xA;of the line, move to the start of the previous line or, if called &#xA;with a prefix argument, the next line.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((pos (point)))&#xA;    (move-beginning-of-line nil)&#xA;    (if (= (point) pos)&#xA;        (if pre&#xA;            (next-line)&#xA;          (previous-line)))))&#xA;&#xA;(defun move-end-of-line-or-next (&amp;amp;optional pre)&#xA;  &quot;Move to the end of the line. If we are already at the end of&#xA;the line, move to the end of the next line or, if called with a &#xA;prefix argument, the previous line.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((pos (point)))&#xA;    (move-end-of-line nil)&#xA;    (if (= (point) pos)&#xA;        (if pre&#xA;            (previous-line)&#xA;          (next-line)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="313" LastActivityDate="2014-11-19T19:02:12.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3735" PostTypeId="2" ParentId="3732" CreationDate="2014-11-19T19:05:44.150" Score="8" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt; has long had this feature.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the relevant commands, and suggested key bindings (these bindings are made in &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/setup-keys.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;setup-keys.el&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cond ((fboundp 'move-beginning-of-line)&#xA;       (substitute-key-definition 'move-beginning-of-line 'beginning-of-line+ global-map)&#xA;       (substitute-key-definition 'move-end-of-line 'end-of-line+ global-map))&#xA;      (t&#xA;       (substitute-key-definition 'beginning-of-line 'beginning-of-line+ global-map)&#xA;       (substitute-key-definition 'end-of-line 'end-of-line+ global-map)))&#xA;(when (boundp 'visual-line-mode-map)&#xA;  (define-key visual-line-mode-map [remap move-beginning-of-line] nil)&#xA;  (define-key visual-line-mode-map [remap move-end-of-line]       nil)&#xA;  (define-key visual-line-mode-map [home] 'beginning-of-line+)&#xA;  (define-key visual-line-mode-map [end]  'end-of-line+)&#xA;  (define-key visual-line-mode-map &quot;\C-a&quot; 'beginning-of-visual-line+)&#xA;  (define-key visual-line-mode-map &quot;\C-e&quot; 'end-of-visual-line+)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is what &lt;code&gt;C-h f end-of-line+&lt;/code&gt; says, as one example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;end-of-line+ is an interactive compiled Lisp function in&#xA;`misc-cmds.el'.&#xA;&#xA;It is bound to C-e, end.&#xA;&#xA;(end-of-line+ &amp;amp;optional N)&#xA;&#xA;Move cursor to end of current line or end of next line if repeated.&#xA;This is similar to `end-of-line', but:&#xA;  If called interactively with no prefix arg:&#xA;     If the previous command was also `end-of-line+', then move to the&#xA;     end of the next line.  Else, move to the end of the current line.&#xA;  Otherwise, move to the end of the Nth next line (Nth previous line&#xA;     if N&amp;lt;0).  Command `end-of-line', by contrast, moves to the end of&#xA;     the (N-1)th next line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:37:31.363" LastActivityDate="2015-05-09T20:37:31.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3736" PostTypeId="2" ParentId="3637" CreationDate="2014-11-19T20:45:14.100" Score="3" Body="&lt;p&gt;Here's what I managed to come up with: &lt;code&gt;fill-paragraph&lt;/code&gt; uses &lt;code&gt;fill-region&lt;/code&gt;, which uses &lt;code&gt;current-fill-column&lt;/code&gt; to decide how to break a particular line. This means that we can tweak &lt;code&gt;current-fill-column&lt;/code&gt; to &lt;em&gt;change the current fill column depending on the context&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function increases the fill column by 1 for each &lt;code&gt;\\&lt;/code&gt; and &lt;code&gt;\&quot;&lt;/code&gt; to the left of the tentative line break location &lt;strong&gt;if&lt;/strong&gt; we're currently in a string.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-current-fill-column (orig)&#xA;  (let ((fill-col (funcall orig))&#xA;        (linebeg (line-beginning-position)))&#xA;    (if (nth 3 (syntax-ppss))&#xA;        (+ fill-col (count-matches&#xA;                     (rx (or &quot;\\\\\\\\&quot; &quot;\\\&quot;&quot;)) linebeg (+ linebeg fill-col)))&#xA;      fill-col)))&#xA;&#xA;(advice-add 'current-fill-column :around&#xA;            #'my-current-fill-column)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm sure there is a corner case in which it will break but it seems to work with the example you provided.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-19T21:13:41.650" LastActivityDate="2014-11-19T21:13:41.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3737" PostTypeId="2" ParentId="3706" CreationDate="2014-11-19T23:19:33.947" Score="6" Body="&lt;p&gt;I found a solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-x p-&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't find documentation of this anywhere, so I&quot;m not sure if it works by coincidence or by design. However, the reproducible effect is that it disables the keymap and allows me to redefine &quot;C-x p&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2619" LastEditorUserId="45" LastEditDate="2014-11-20T20:39:36.223" LastActivityDate="2014-11-20T20:39:36.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3738" PostTypeId="1" AcceptedAnswerId="3772" CreationDate="2014-11-20T00:09:06.290" Score="6" ViewCount="216" Body="&lt;p&gt;In Emacs 24.4, every time I evaluate a form in &lt;code&gt;ielm&lt;/code&gt; or using &lt;code&gt;C-x C-e&lt;/code&gt; it prints a lot of extraneous output that while useful, sometimes gets in the way. As an example, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 1 1)&#xA;;=&amp;gt; 2 (#o2, #x2, ?\C-b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a variable I can use to disable printing this extra information and have it just display &lt;code&gt;2&lt;/code&gt; like it used to?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="105" LastEditDate="2019-04-12T14:09:05.307" LastActivityDate="2019-04-12T14:09:05.307" Title="Is there a variable to toggle Emacs 24.4 elisp return &quot;noise&quot;?" Tags="|echo-area|eval-expression|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3739" PostTypeId="1" CreationDate="2014-11-20T00:15:02.997" Score="4" ViewCount="218" Body="&lt;p&gt;Following this &lt;a href=&quot;http://blog.jenkster.com/2013/12/popup-help-in-emacs-lisp.html&quot; rel=&quot;nofollow&quot;&gt;blog post&lt;/a&gt;, I am interested in using &lt;code&gt;popup.el&lt;/code&gt; for my own purposes. In the post, he mentions to add a scroll bar with the &lt;code&gt;:scroll-bar&lt;/code&gt; argument. If I include the &lt;code&gt;:scroll-bar t&lt;/code&gt; option in &lt;code&gt;popup-tip&lt;/code&gt; a scroll bar is displayed, but I couldn't find any way to actually use it. Is this functionality just not implemented? If it is, could you provide an example?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hlwm/object-tree ()&#xA;  &quot;Show the current hlwm object tree in a buffer.&quot;&#xA;  (let* ((shell-command-switch &quot;-c&quot;)&#xA;     (object-tree-string&#xA;      (shell-command-to-string &quot;herbstclient object_tree&quot;)))&#xA;    (popup-tip object-tree-string&#xA;           :point (point)&#xA;           :around t&#xA;           :height 30&#xA;           :scroll-bar t&#xA;           :margin t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2014-11-24T20:09:22.540" LastActivityDate="2014-11-24T20:09:22.540" Title="How to actually scroll with popup-tip :scroll-bar t?" Tags="|scrolling|popup|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3740" PostTypeId="2" ParentId="3738" CreationDate="2014-11-20T00:19:29.587" Score="4" Body="&lt;p&gt;You can override &lt;code&gt;eval-expression-print-format&lt;/code&gt; to return &lt;code&gt;&quot;&quot;&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eval-expression-print-format (value)&#xA;  ; return an empty string&#xA;  &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://emacs.stackexchange.com/a/3772/2355&quot;&gt;answer by &lt;strong&gt;@Harald Hanche-Olsen&lt;/strong&gt;&lt;/a&gt; for a way to override it temporarily.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-11-21T18:36:36.377" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3741" PostTypeId="2" ParentId="3667" CreationDate="2014-11-20T00:35:43.423" Score="28" Body="&lt;h1&gt;The Emacs Multimedia System (EMMS)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Your initial rant suggests that you did not really give EMMS a try...  Maybe you should?  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;With the recent release of version 4, &lt;strong&gt;Yoni Rabkin&lt;/strong&gt;, the maintainer, put a lot of effort into the &lt;a href=&quot;https://www.gnu.org/software/emms/manual/&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt;.  It's &lt;em&gt;very good&lt;/em&gt; these days.&lt;/li&gt;&#xA;&lt;li&gt;It is &lt;em&gt;simple&lt;/em&gt; since it mostly uses default Emacs bindings.  Want to remove a song from the playlist?  &lt;code&gt;C-a&lt;/code&gt; &lt;code&gt;C-k&lt;/code&gt; (in git version just &lt;code&gt;C-k&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;It is &lt;em&gt;flexible&lt;/em&gt; because you can display and play back your music how you want.  Want to use &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emms.git/tree/lisp/emms-player-mplayer.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;mplayer&lt;/code&gt;&lt;/a&gt;?  Or &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emms.git/tree/lisp/emms-player-vlc.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;vlc&lt;/code&gt;&lt;/a&gt;?  Note, EMMS is pretty good at picking up sensible playback options out of the box, see &lt;code&gt;emms-default-players&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;It's very modular so you can get it as &quot;bloated&quot; as you want.  AFAIK, &lt;em&gt;YR&lt;/em&gt; does not use the ID3-browser, but I want as much &quot;bloat&quot; as possible.&lt;/li&gt;&#xA;&lt;li&gt;If you like &lt;code&gt;dired&lt;/code&gt; keybindings there's &lt;code&gt;emms-mark-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;From within EMMS, you can jump to the track under &lt;code&gt;point&lt;/code&gt; in &lt;code&gt;dired&lt;/code&gt; with &lt;code&gt;d&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You can play marked files in &lt;code&gt;dired&lt;/code&gt; with &lt;code&gt;emms-play-dired&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;(Rudimentary) &lt;a href=&quot;http://www.hep.by/gnu/emms/emms_31.html&quot; rel=&quot;noreferrer&quot;&gt;tag editing&lt;/a&gt;: Just hit &lt;code&gt;E&lt;/code&gt; on a track.&lt;/li&gt;&#xA;&lt;li&gt;The ID3-browser is &lt;a href=&quot;https://www.gnu.org/software/emms/manual/#Displaying-Covers&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;pretty&lt;/em&gt;&lt;/a&gt; out of the box, (you may have to produce covers in the right sizes, see &lt;code&gt;emms-browser-covers&lt;/code&gt; and below).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2GMPi.png&quot; alt=&quot;Screenshot of EMMS&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Quick setup of the EMMS-browser&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add something like this to your &lt;code&gt;init.el&lt;/code&gt; (after installing EMMS):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;;** EMMS&#xA; ;; Autoload the id3-browser and bind it to F7.&#xA; ;; You can change this to your favorite EMMS interface.&#xA; (autoload 'emms-smart-browse &quot;emms-browser.el&quot; &quot;Browse with EMMS&quot; t)&#xA; (global-set-key [(f7)] 'emms-smart-browse)&#xA;&#xA; (with-eval-after-load 'emms&#xA;   (emms-standard) ;; or (emms-devel) if you want all features&#xA;   (setq emms-source-file-default-directory &quot;~/music&quot;&#xA;         emms-info-asynchronously t&#xA;         emms-show-format &quot;♪ %s&quot;)&#xA;&#xA;   ;; Might want to check `emms-info-functions',&#xA;   ;; `emms-info-libtag-program-name',&#xA;   ;; `emms-source-file-directory-tree-function'&#xA;   ;; as well.&#xA;&#xA;   ;; Determine which player to use.&#xA;   ;; If you don't have strong preferences or don't have&#xA;   ;; exotic files from the past (wma) `emms-default-players`&#xA;   ;; is probably all you need.&#xA;   (if (executable-find &quot;mplayer&quot;)&#xA;       (setq emms-player-list '(emms-player-mplayer))&#xA;     (emms-default-players))&#xA;&#xA;   ;; For libre.fm see `emms-librefm-scrobbler-username' and&#xA;   ;; `emms-librefm-scrobbler-password'.&#xA;   ;; Future versions will use .authoinfo.gpg.&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Click &lt;code&gt;F7&lt;/code&gt; to see initialization instructions.  To add music do &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;emms-add-directory-tree&lt;/code&gt;.  This will add all music to &lt;code&gt;*EMMS Playlist*&lt;/code&gt; (available through &lt;code&gt;F7&lt;/code&gt; &lt;code&gt;F7&lt;/code&gt;) and eventually to your library.  Feel free to opt out of the library and use the playlist only.  Just adjust what &lt;code&gt;F7&lt;/code&gt; calls.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Pretty cover art&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Getting pretty cover art in EMMS is decently simple.  First, read the manual (click the &quot;pretty&quot;-link above).  The gist is that for each &lt;code&gt;~/music/artist/album&lt;/code&gt; you need the set: &lt;code&gt;cover_small.jpg&lt;/code&gt; of 100px × 100px, as used on the left above, and a &lt;code&gt;cover_med.jpg&lt;/code&gt; of 200px × 200px, as used on the right above (adjust the sizes to your liking).  The no-cover (&lt;em&gt;Selmasongs&lt;/em&gt; above) is set via &lt;code&gt;emms-browser-default-covers&lt;/code&gt;.  &lt;a href=&quot;http://beets.radbox.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;beet&lt;/code&gt;&lt;/a&gt; can &lt;a href=&quot;http://beets.readthedocs.org/en/latest/plugins/fetchart.html&quot; rel=&quot;noreferrer&quot;&gt;fetch covers&lt;/a&gt; for you.  Then use &lt;code&gt;find&lt;/code&gt; and &lt;code&gt;convert&lt;/code&gt; (of &lt;code&gt;imagemagick&lt;/code&gt;) to resize and rename covers.  It's a bit &quot;manual&quot; at the moment. . .  I use the following script, which is probably copied or inspired by the interwebs.  I'm not proficient with &lt;code&gt;shell&lt;/code&gt; so do let me know if you know a better way.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;MUSICDIR=&quot;/home/rasmus/music/&quot;&#xA;# fetch new art&#xA;beet fetchart&#xA;&#xA;# resize covers&#xA;find &quot;$MUSICDIR&quot; -iname &quot;cover.jpg&quot; |&#xA;find . -type f -iname 'cover.jpg' -exec bash -c '&#xA;  for file do&#xA;    EXTENSION=&quot;${file##*.}&quot;&#xA;    FILENAME=&quot;${file%.*}&quot;&#xA;    NEW_MED_NAME=&quot;${FILENAME}_med.${EXTENSION}&quot;&#xA;    NEW_SMALL_NAME=&quot;${FILENAME}_small.${EXTENSION}&quot;&#xA;    if [ ! -f &quot;${NEW_MED_NAME}&quot; ]; then&#xA;        convert &quot;${file}&quot; -adaptive-resize 200x200 &quot;${NEW_MED_NAME}&quot;&#xA;    fi&#xA;    if [ ! -f &quot;${NEW_SMALL_NAME}&quot; ]; then&#xA;       convert &quot;${file}&quot; -adaptive-resize 100x100 &quot;${NEW_SMALL_NAME}&quot;&#xA;    fi&#xA;  done&#xA;' bash {} +&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2016-07-26T18:19:44.043" LastActivityDate="2016-07-26T18:19:44.043" CommentCount="3" CommunityOwnedDate="2014-11-20T13:47:03.487" ContentLicense="CC BY-SA 3.0" />
  <row Id="3742" PostTypeId="1" AcceptedAnswerId="3818" CreationDate="2014-11-20T00:45:36.987" Score="3" ViewCount="767" Body="&lt;p&gt;I am trying to use gofmt on my go before I save it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Run gofmt before save&#xA;(setq gofmt-command &quot;goimports&quot;)&#xA;(setq exec-path (cons &quot;/usr/lib/go/bin&quot; exec-path))&#xA;(add-to-list 'exec-path &quot;/home/giodamelio/Projects/go/bin&quot;)&#xA;(add-hook 'before-save-hook 'gofmt-before-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is, whenever I try to move the cursor(either with C-n/C-p, or with evil), the contents of the buffer seem to flicker. It is not the entire buffer(not visual bell), and it is not the same bits of text each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I comment out those four lines it goes away, so I know it has somthing to do with them, but my understanding of the &lt;code&gt;before-save-hook&lt;/code&gt; is that is will only run before I save, not whenever I move the cursor&quot;&lt;/p&gt;&#xA;" OwnerUserId="2639" LastActivityDate="2014-11-25T02:35:27.257" Title="Emacs flickering when using before-save-hook with gofmt" Tags="|hooks|motion|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3743" PostTypeId="1" AcceptedAnswerId="3744" CreationDate="2014-11-20T04:30:30.327" Score="6" ViewCount="576" Body="&lt;p&gt;How can I automatically move selected to the other window? Trying to streamline my split-window workflow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I have so far. Doesn't work yet. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun move-region-to-other-window (start end)&#xA;  &quot;Move selected text to other window&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (if (use-region-p) &#xA;      (let ((count (count-words-region start end)))&#xA;        (save-excursion&#xA;          (kill-region start end)&#xA;          (other-window)          &#xA;          (yank)&#xA;          (newline))&#xA;        (other-window)         &#xA;        (message &quot;Moved %s words&quot; count))&#xA;    (message &quot;No region selected&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Attribution: Code above is based on danielsz's excellent package &lt;a href=&quot;https://github.com/danielsz/Palimpsest&quot; rel=&quot;nofollow&quot;&gt;Palimpsest Mode&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2014-11-20T18:35:50.143" LastActivityDate="2014-11-20T18:35:50.143" Title="how to move region to other window?" Tags="|window|text-editing|kill-ring|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3744" PostTypeId="2" ParentId="3743" CreationDate="2014-11-20T04:48:14.430" Score="7" Body="&lt;p&gt;Your code is alright except that it is missing the mandatory arguments to the &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/other-window&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;other-window&lt;/code&gt;&lt;/a&gt; command.&lt;/p&gt;&#xA;&lt;p&gt;From the function documentation (&lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;other-window&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;),&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(other-window COUNT &amp;amp;optional ALL-FRAMES)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Select another window in cyclic ordering of windows.&#xA;COUNT specifies the number of windows to skip, starting with the&#xA;selected window, before making the selection. If COUNT is&#xA;positive, skip COUNT windows forwards. If COUNT is negative,&#xA;skip -COUNT windows backwards. COUNT zero means do not skip any&#xA;window, so select the selected window. In an interactive call,&#xA;COUNT is the numeric prefix argument. Return nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h3&gt;Fixed code&lt;/h3&gt;&#xA;&lt;pre&gt;&#xA;(defun move-region-to-other-window (start end)&#xA;  &quot;Move selected text to other window&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (if (use-region-p) &#xA;      (let ((count (count-words-region start end)))&#xA;        (save-excursion&#xA;          (kill-region start end)&#xA;          (other-window 1)   &#xA;          (yank)&#xA;          (newline))&#xA;        (other-window -1)     &#xA;        (message &quot;Moved %s words&quot; count))&#xA;    (message &quot;No region selected&quot;)))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-11-20T04:48:14.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3745" PostTypeId="2" ParentId="2942" CreationDate="2014-11-20T09:35:29.167" Score="8" Body="&lt;p&gt;The default eldoc integration of python.el will show functions defined in the Python shell. If you send the definition of your function to the Python shell in Emacs, eldoc should also show information on that function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get better results, you need to use a package that uses a more advanced approach to finding documentation, like &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot;&gt;elpy&lt;/a&gt; or &lt;a href=&quot;https://github.com/tkf/emacs-jedi&quot;&gt;emacs-jedi&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-11-20T09:35:29.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3746" PostTypeId="1" AcceptedAnswerId="7170" CreationDate="2014-11-20T09:39:04.823" Score="19" ViewCount="1355" Body="&lt;p&gt;I'm looking for a minor mode to keep paragraphs filled at all times while typing (similar to what &lt;a href=&quot;https://github.com/Bruce-Connor/aggressive-indent-mode&quot;&gt;&lt;code&gt;aggressive-indent-mode&lt;/code&gt;&lt;/a&gt; does for indentation). It also needs to be smart enough to only fill comments (and maybe strings depending on the language).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some things that I've tried are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;auto-fill-mode&lt;/code&gt; automatically fills while you are typing new paragraphs but doesn't refill when you edit paragraphs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;refill-mode&lt;/code&gt; does constantly refill paragraphs but it tries to wrap code into paragraphs as well as comments.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I tried adding &lt;code&gt;fill-paragraph&lt;/code&gt; to the &lt;code&gt;after-change-functions&lt;/code&gt; hook but it screws up undo and plenty of other things (this is probably all fixable but would take some effort).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any better ideas?&lt;/p&gt;&#xA;" OwnerUserId="237" LastEditorUserId="50" LastEditDate="2014-12-25T12:55:31.787" LastActivityDate="2015-01-21T14:43:26.613" Title="Is there fully-automatic fill-paragraph-mode for code comments?" Tags="|hooks|fill-paragraph|comment|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3747" PostTypeId="1" AcceptedAnswerId="3756" CreationDate="2014-11-20T13:00:19.803" Score="25" ViewCount="17402" Body="&lt;p&gt;I have limited emacs experience. Tried to find a solution to disable line wrapping in &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot;&gt;Spacemacs&lt;/a&gt; but couldn't find any. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to this problem in Vim is to execute &lt;code&gt;set nowrap&lt;/code&gt;. But it's not working in Spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any solution to this would be much appreciated. &lt;/p&gt;&#xA;" OwnerUserId="2646" LastEditorUserId="253" LastEditDate="2014-11-20T13:03:58.753" LastActivityDate="2023-11-03T15:38:21.997" Title="How to disable line wrapping in Spacemacs?" Tags="|customization|spacemacs|" AnswerCount="6" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3748" PostTypeId="2" ParentId="95" CreationDate="2014-11-20T13:17:23.167" Score="3" Body="&lt;p&gt;You can browse the requests correctly filed in &lt;a href=&quot;http://debbugs.gnu.org/db/pa/lemacs.html&quot; rel=&quot;nofollow&quot;&gt;debbugs&lt;/a&gt; from Emacs: just install the &lt;code&gt;debbugs&lt;/code&gt; package (e.g. using &lt;code&gt;M-x package-install&lt;/code&gt;), and then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x debbugs-gnu&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="111" LastEditorUserId="111" LastEditDate="2014-11-21T10:41:49.140" LastActivityDate="2014-11-21T10:41:49.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3749" PostTypeId="1" CreationDate="2014-11-20T13:30:59.137" Score="4" ViewCount="822" Body="&lt;p&gt;Are there any tools for making UI-based or email-based DEADLINE notifications in org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It'd be nice to convert org-mode's pull-based DEADLINE access (via C-c a a) into a push-based system :)&lt;/p&gt;&#xA;" OwnerUserId="2244" LastActivityDate="2014-11-21T23:43:17.933" Title="any tools for making UI-based or email-based DEADLINE notifications in org-mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3750" PostTypeId="1" CreationDate="2014-11-20T13:34:19.680" Score="0" ViewCount="621" Body="&lt;p&gt;My org-capture setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA; '((&quot;t&quot; &quot;Todo&quot; entry (file+headline &quot;~/org/gtd.org&quot; &quot;@computer&quot;)&#xA;        &quot;* TODO %?\n %i\n&quot;)&#xA;   (&quot;j&quot; &quot;Journal&quot; entry (file+datetree &quot;~/org/gtd.org&quot; &quot;Journal&quot;)&#xA;        &quot;* %?\nEntered on %U\n %i\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I file a note via &lt;code&gt;org-capture&lt;/code&gt; as a journal entry, it is not saved in the dateree below &quot;Journal&quot; but in the first &quot;2014&quot; node of the document (which does not have a &quot;Journal&quot; parent node).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have an idea why this happens or how I can prevent this?&lt;/p&gt;&#xA;" OwnerUserId="2400" LastActivityDate="2014-11-22T19:18:52.783" Title="org-capture files entry under wrong datetree" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3751" PostTypeId="2" ParentId="2945" CreationDate="2014-11-20T14:48:32.283" Score="2" Body="&lt;p&gt;Indeed, &quot;:eval yes&quot; is not an official value -- I wasn't aware of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Though&lt;/strong&gt;, every value other than the listed official values does WELL function as an &quot;:eval yes&quot; (see &quot;:eval foo&quot;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY:  eval no&#xA;&#xA;* Testing evaluation&#xA;&#xA;#+begin_src emacs-lisp&#xA;(message &quot;evaluated?&quot;)&#xA;#+end_src&#xA;&#xA;#+begin_src emacs-lisp :eval yes&#xA;(message &quot;evaluated as well?&quot;)&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: evaluated as well?&#xA;&#xA;#+begin_src emacs-lisp :eval query&#xA;(message &quot;evaluated after confirmation&quot;)&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: evaluated after confirmation&#xA;&#xA;#+begin_src emacs-lisp :eval query-export&#xA;(message &quot;evaluated -- but requires confirmation for export&quot;)&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: evaluated -- but requires confirmation for export&#xA;&#xA;#+begin_src emacs-lisp :eval never&#xA;(message &quot;never evaluated&quot;)&#xA;#+end_src&#xA;&#xA;#+begin_src emacs-lisp :eval never-export&#xA;(message &quot;never evaluated during export&quot;)&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: never evaluated during export&#xA;&#xA;#+begin_src emacs-lisp :eval foo&#xA;(message &quot;evaluated when misc value is given?&quot;)&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: evaluated when misc value is given?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Otherwise, how do you counter the property &quot;eval no&quot; in a subtree or on a code block?&lt;/p&gt;&#xA;" OwnerUserId="2649" LastActivityDate="2014-11-20T14:48:32.283" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3752" PostTypeId="2" ParentId="2762" CreationDate="2014-11-20T15:50:03.120" Score="10" Body="&lt;p&gt;I don't see a way built in to company-mode to do this, but you can add your own key binding to &lt;code&gt;company-active-map&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a quick experiment I took the &lt;code&gt;company-show-doc-buffer&lt;/code&gt; implementation and simply removed the &lt;code&gt;company--electric-do&lt;/code&gt; wrapper:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/company-show-doc-buffer ()&#xA;  &quot;Temporarily show the documentation buffer for the selection.&quot;&#xA;  (interactive)&#xA;  (let* ((selected (nth company-selection company-candidates))&#xA;         (doc-buffer (or (company-call-backend 'doc-buffer selected)&#xA;                         (error &quot;No documentation available&quot;))))&#xA;    (with-current-buffer doc-buffer&#xA;      (goto-char (point-min)))&#xA;    (display-buffer doc-buffer t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could bind this to another key, for example C-F1, to &quot;permanently&quot; open the doc buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (define-key company-active-map (kbd &quot;C-&amp;lt;f1&amp;gt;&quot;) #'my/company-show-doc-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-20T15:50:03.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3753" PostTypeId="1" AcceptedAnswerId="3773" CreationDate="2014-11-20T16:27:32.953" Score="7" ViewCount="1436" Body="&lt;p&gt;I'm using the new emacs 24.4 &lt;code&gt;prettify-symbols-mode&lt;/code&gt;, but it isn't behaving consistently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I turn it on with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prettify-symbols-mode t)&#xA;(global-prettify-symbols-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I'm trying to change the way python source code looks with the&#xA;follownig setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (push '(&quot;**2&quot; . ?²) prettify-symbols-alist)&#xA;            (push '(&quot;_x&quot; . ?ᵪ) prettify-symbols-alist)&#xA;            (push '(&quot;sum&quot; . ?∑) prettify-symbols-alist)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works, but not consistently. For example,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;x**2 x_x and sum(x)&lt;/code&gt; all look good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inconsistent part is that x**23 maintains the superscript 2, but&#xA;the 3 is regular. But if I say &lt;code&gt;x**2+2&lt;/code&gt;, or &lt;code&gt;x**2,&lt;/code&gt; then the &lt;code&gt;**2&lt;/code&gt; is not pretty (and it should be). I'd like the 2 to only be superscript when it is&#xA;followed by certain characters (space, plus, comma, etc.).&#xA;Alternatively, not superscript if followed by [0-9].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, sum behaves correctly. &lt;code&gt;sum(&lt;/code&gt;, &lt;code&gt;sum**2&lt;/code&gt;, &lt;code&gt;sum+&lt;/code&gt;, and others are&#xA;pretty (as they should be) and &lt;code&gt;summer&lt;/code&gt; is not (correctly).&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="15748" LastEditDate="2018-09-06T08:42:36.560" LastActivityDate="2020-05-05T18:34:37.690" Title="prettify-symbols-mode character replacement regex" Tags="|python|prettify-symbols-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3754" PostTypeId="2" ParentId="3747" CreationDate="2014-11-20T17:19:55.823" Score="9" Body="&lt;p&gt;&lt;code&gt;M-x toggle-truncate-lines RET&lt;/code&gt; is the Emacs equivalent of Vim's &lt;code&gt;:set wrap!&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-11-20T17:19:55.823" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3755" PostTypeId="1" AcceptedAnswerId="3780" CreationDate="2014-11-20T18:56:29.137" Score="4" ViewCount="227" Body="&lt;p&gt;I'm trying to write a Flycheck checker definition based on &lt;a href=&quot;http://docs.hylang.org/en/latest/index.html&quot; rel=&quot;nofollow&quot;&gt;Hy&lt;/a&gt;, using the &lt;a href=&quot;http://flycheck.readthedocs.org/en/latest/dev/extending.html#el.function.flycheck-define-checker&quot; rel=&quot;nofollow&quot;&gt;API here&lt;/a&gt;. As part of that, I have to define a pattern for error matching. Now, Hy gives quite a large error spew, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Traceback (most recent call last):&#xA;  File &quot;/usr/bin/hy&quot;, line 9, in &amp;lt;module&amp;gt;&#xA;    load_entry_point('hy==0.10.1', 'console_scripts', 'hy')()&#xA;  File &quot;/usr/lib/python3.4/site-packages/hy/cmdline.py&quot;, line 305, in hy_main&#xA;    sys.exit(cmdline_handler(&quot;hy&quot;, sys.argv))&#xA;  File &quot;/usr/lib/python3.4/site-packages/hy/cmdline.py&quot;, line 293, in cmdline_handler&#xA;    return run_file(options.args[0])&#xA;  File &quot;/usr/lib/python3.4/site-packages/hy/cmdline.py&quot;, line 194, in run_file&#xA;    import_file_to_module(&quot;__main__&quot;, filename)&#xA;  File &quot;/usr/lib/python3.4/site-packages/hy/importer.py&quot;, line 74, in import_file_to_module&#xA;    eval(ast_compile(_ast, fpath, &quot;exec&quot;), mod.__dict__)&#xA;  File &quot;helloworld.hy&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;    (prin &quot;Hello world&quot;)&#xA;NameError: name 'prin' is not defined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only part of interest to the checker is the very last bit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  File &quot;helloworld.hy&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;    (prin &quot;Hello world&quot;)&#xA;NameError: name 'prin' is not defined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I need to write a &lt;code&gt;:error-patters&lt;/code&gt; form that will match the following exactly:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A tab character&lt;/li&gt;&#xA;&lt;li&gt;The string &lt;code&gt;File &quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;The name of my file (Flycheck does this using &lt;code&gt;(file-name)&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;The string &lt;code&gt;&quot;, line&lt;/code&gt; (with a terminating space)&lt;/li&gt;&#xA;&lt;li&gt;The line number (Flycheck does this using &lt;code&gt;line&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;The string &lt;code&gt;, in &amp;lt;module&amp;gt;\n\t\t&lt;/code&gt; (where &lt;code&gt;\n\t\t&lt;/code&gt; is a newline followed by two tabs)&lt;/li&gt;&#xA;&lt;li&gt;Whatever follows until the next newline (including that newline)&lt;/li&gt;&#xA;&lt;li&gt;Whatever remains is the error message (which Flycheck matches with &lt;code&gt;(message)&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So far, I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:error-patterns ((error line-start &quot;\tFile \&quot;&quot; (file-name) &quot;\&quot;, line &quot; line &quot;, in &amp;lt;module&amp;gt;\n\t\t&quot;)) ;something more needs to go here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This gets me as far as step 6, but I'm not sure what to do for step 7, as I don't know &lt;code&gt;rx&lt;/code&gt; at all. Any and all help would be very much appreciated, both by me and the fledgling Hy community.&lt;/p&gt;&#xA;" OwnerUserId="561" LastEditorUserId="561" LastEditDate="2014-11-21T03:07:37.207" LastActivityDate="2014-11-21T13:52:53.297" Title="Regexp to parse Hy errors for Flycheck" Tags="|regular-expressions|flycheck|rx|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3756" PostTypeId="2" ParentId="3747" CreationDate="2014-11-20T19:02:30.433" Score="12" Body="&lt;p&gt;Add this to your &lt;code&gt;~/.spacemacs&lt;/code&gt; config function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'hack-local-variables-hook (lambda () (setq truncate-lines t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="167" LastEditorUserId="2355" LastEditDate="2014-11-20T20:22:33.817" LastActivityDate="2014-11-20T20:22:33.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3757" PostTypeId="1" AcceptedAnswerId="3758" CreationDate="2014-11-20T19:31:15.503" Score="2" ViewCount="607" Body="&lt;p&gt;&lt;em&gt;(Environment: Emacs 24.4 stable with built-in org-mode.)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to have a &lt;code&gt;file+datetree&lt;/code&gt; for Org-mode's Capture, so I set like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;      '((&quot;D&quot; &quot;Diary + Timer&quot; entry&#xA;         (file+datetree (concat org-directory &quot;/diary/diary.org&quot;))&#xA;         &quot;* %^{Description: } %^g  \n  %i %?\n&quot; :clock-in t :clock-keep t)&#xA;        (&quot;d&quot; &quot;Diary&quot; entry&#xA;         (file+datetree (concat org-directory &quot;/diary/diary.org&quot;))&#xA;         &quot;* %? %U&quot;)&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And use these captures to add items for &lt;code&gt;diary.org&lt;/code&gt; several times. I expect the file has:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 2014   &#xA;** 2014-11 11 月&#xA;*** 2014-11-21 金曜日&#xA;**** test1 [2014-11-21 金 03:08]&#xA;**** test2 [2014-11-21 金 03:08]&#xA;**** test3 [2014-11-21 金 03:08]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what I get is like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 2014&#xA;** 2014-11 11 月&#xA;*** 2014-11-21 金曜日&#xA;**** test1 [2014-11-21 金 03:08]&#xA;** 2014-11 11 月&#xA;*** 2014-11-21 金曜日&#xA;**** test2 [2014-11-21 金 03:09]&#xA;** 2014-11 11 月&#xA;*** 2014-11-21 金曜日&#xA;**** test3 [2014-11-21 金 03:09]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to solve this problem...? (I've ever used Org's Capture one year ago, and it worked just liked I wish; I have no idea why it becomes this.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[Edited] Finally, totally out of expect, the problem is resulted from Pangu-Spacing....&#xA;&lt;a href=&quot;https://github.com/coldnew/pangu-spacing/issues/5&quot; rel=&quot;nofollow&quot;&gt;https://github.com/coldnew/pangu-spacing/issues/5&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2014-11-23T18:26:35.537" LastActivityDate="2014-11-23T18:26:35.537" Title="Org's Capture: annoying duplicated date tree outlines" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3758" PostTypeId="2" ParentId="3757" CreationDate="2014-11-20T20:26:32.977" Score="4" Body="&lt;p&gt;The problem seems to be a mismatch with how org-datetree is creating the month line and the regexp it uses when you create a second entry for the same month. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my machine (with my locale etc) the current month line is generated as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** 2014-11 November&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org is using a regular expression like this one to match the line when I create a new entry:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;^\\*+[     ]+2014-\\([01][0-9]\\) \\w+$&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This matches properly for me. In your example, it looks like the month name is written as two &quot;words&quot; rather than one: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** 2014-11 11 月&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Therefore the regular expression will never match, and org-datetree will create a new month line every time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-datetree is generating the month name using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot; %s&quot; &#xA;    (format-time-string&#xA;     &quot;%B&quot; (encode-time 0 0 0 1 11 2014)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;%B&lt;/code&gt; means to use the current locale's full name for the month. Not matching your locale's default representation of the month seems like a bug in Org mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To work around it you either need to figure out how to change that locale representation, or perhaps hack your org-datetree.el to fix the regexp to match an additional word (in &lt;code&gt;org-datetree-find-month-create&lt;/code&gt;, e.g. &lt;code&gt;\\w+ \\w+$&lt;/code&gt;). You might also be able to use 'after' advice on &lt;code&gt;org-datetree-insert-line&lt;/code&gt; to revise the month line after it is written.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-11-20T20:41:56.597" LastActivityDate="2014-11-20T20:41:56.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3759" PostTypeId="1" AcceptedAnswerId="3760" CreationDate="2014-11-20T21:04:05.727" Score="8" ViewCount="4965" Body="&lt;p&gt;Does something already exist to do this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun good (var)&#xA;     (and (boundp 'var) var))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2654" LastEditorUserId="2654" LastEditDate="2014-11-20T22:42:01.640" LastActivityDate="2014-11-20T22:42:01.640" Title="Test variable is bound and non-nil" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3760" PostTypeId="2" ParentId="3759" CreationDate="2014-11-20T21:08:44.827" Score="15" Body="&lt;p&gt;There is a macro defined in &lt;code&gt;bindings.el&lt;/code&gt; that does exactly that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defmacro bound-and-true-p (var)&#xA;  &quot;Return the value of symbol VAR if it is bound, else nil.&quot;&#xA;  `(and (boundp (quote ,var)) ,var))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-11-20T21:08:44.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3761" PostTypeId="2" ParentId="3759" CreationDate="2014-11-20T21:08:56.270" Score="11" Body="&lt;p&gt;How about this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bound-and-true-p is a Lisp macro in `bindings.el'.&#xA;&#xA;(bound-and-true-p VAR)&#xA;&#xA;Return the value of symbol VAR if it is bound, else nil.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-20T21:08:56.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3762" PostTypeId="1" AcceptedAnswerId="3763" CreationDate="2014-11-20T21:12:08.093" Score="4" ViewCount="825" Body="&lt;p&gt;I've been fiddling around a bit with CC-mode lately and figured that since I prefer to comment my functions/classes with javadoc-like syntax, I'd like to use the built-in comment highlighting provided by the corresponding &lt;code&gt;c-doc-comment-style&lt;/code&gt;. This works rather well, it highlights something like this rather easily:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/** @brief This is function foo.&#xA;    @param a this is a parameter.&#xA;    @return I return this.&#xA;*/&#xA;int foo(unsigned a) {...}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I noticed that the comment suddenly changed color as well to a default one I don't really like. Any idea how to change that color back to the one defined by the current theme instead?&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="25" LastEditDate="2014-11-21T22:47:23.250" LastActivityDate="2017-02-28T13:40:48.463" Title="CC-Mode - Javadoc Comment Colors in C/C++" Tags="|font-lock|c++|cc-mode|c-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3763" PostTypeId="2" ParentId="3762" CreationDate="2014-11-20T21:41:27.920" Score="3" Body="&lt;p&gt;After fiddling a bit longer with this, I think I figured it out. Adding the following snippet to my CC-mode init-configuration fixed this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cc-init-hook ()&#xA;  &quot;Initialization hook for CC-mode runs before any other hooks.&quot;&#xA;  (setq c-doc-comment-style&#xA;    '((java-mode . javadoc)&#xA;      (pike-mode . autodoc)&#xA;      (c-mode    . javadoc)&#xA;      (c++-mode  . javadoc)))&#xA;  (set-face-foreground 'font-lock-doc-face&#xA;               (face-foreground font-lock-comment-face)))&#xA;(add-hook 'c-initialization-hook 'my-cc-init-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This basically copies the foreground color of the comment face to the &quot;doc&quot;-face that the javadoc style defines. Any improvements to this is appreciated! &lt;/p&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2014-11-20T21:41:27.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3764" PostTypeId="1" AcceptedAnswerId="3771" CreationDate="2014-11-20T22:58:43.553" Score="2" ViewCount="93" Body="&lt;p&gt;I have the following issue with &lt;code&gt;comint&lt;/code&gt;, it could be a bug.  It holds&#xA;true in different derived modes, such as python or gdb.  How to see&#xA;the strange behavior:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;run-python&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Enter some stuff: &lt;kbd&gt;M-20 a&lt;/kbd&gt;, don't press &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Eval &lt;code&gt;(- (line-end-position) (line-beginning-position))&lt;/code&gt;. It returns 20, which is correct.&lt;/li&gt;&#xA;&lt;li&gt;Move point before &lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;. &lt;kbd&gt;C-a&lt;/kbd&gt; won't work, do &lt;kbd&gt;C-p C-a C-n&lt;/kbd&gt; instead.&lt;/li&gt;&#xA;&lt;li&gt;Eval &lt;code&gt;(- (line-end-position) (line-beginning-position))&lt;/code&gt;. It returns 4, which is wrong.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Could someone explain this behavior? And if it's not a bug, what's the&#xA;work-around to get 20 instead of 4?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="25" LastEditDate="2014-11-21T22:46:59.483" LastActivityDate="2014-11-21T22:46:59.483" Title="How to explain this strange comint behavior?" Tags="|comint|point|motion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3765" PostTypeId="2" ParentId="3750" CreationDate="2014-11-20T23:25:38.917" Score="1" Body="&lt;p&gt;If it's the only one headline to host a datetree. You can set the DATE_TREE property in the Journal headline, and then there are placed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you want to have more datetrees in the gtd.org file, you should use a file+function target. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been developing a solution for this problem taking in consideration multiple DATETREES for the same file and here is my function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-capture-func ()&#xA;  (org-capture-put-target-region-and-position)&#xA;  (widen)&#xA;  (goto-char 1)&#xA;  (search-forward-regexp &quot;^\\*+ Journal&quot;)&#xA;  (let* ((lvl (org-current-level))&#xA;         (org-datetree-base-level (+ 1 lvl)))&#xA;    (org-narrow-to-subtree)&#xA;    (move-end-of-line 1)&#xA;    (let* ((date (calendar-gregorian-from-absolute (org-today)))&#xA;           (year (nth 2 date))&#xA;           (month (car date))&#xA;           (day (nth 1 date)))&#xA;      (save-restriction&#xA;        (goto-char (point-min))&#xA;        (org-datetree-find-year-create year)&#xA;        (org-datetree-find-month-create year month)&#xA;        (org-datetree-find-day-create year month day)&#xA;        (goto-char (prog1 (point) (widen)))))&#xA;    (org-narrow-to-subtree)&#xA;    (org-capture-put :exact-position nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's a problem the org implementation of the function &lt;strong&gt;org-capture-set-target-location&lt;/strong&gt;, needs a small modification I'm going to propose to the org developers. The problem is that when you use the &lt;strong&gt;function&lt;/strong&gt; or &lt;strong&gt;file+function&lt;/strong&gt; target, it set the &lt;strong&gt;:exact-position&lt;/strong&gt; property to &lt;strong&gt;(point)&lt;/strong&gt; in the &lt;strong&gt;org-capture-plist&lt;/strong&gt;, so you can't append the template as subheading of the current position heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modification is in the function or file+function target, change the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-capture-put :exact-position (point))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (memq :exact-position org-capture-plist)&#xA;  (org-capture-put :exact-position (point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this way now, you can set in your function &lt;strong&gt;:exact-position&lt;/strong&gt; to nil, as I do in the function above, and then capture puts the templates inside the heading at point.&lt;/p&gt;&#xA;" OwnerUserId="2026" LastEditorUserId="2026" LastEditDate="2014-11-22T19:18:52.783" LastActivityDate="2014-11-22T19:18:52.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3766" PostTypeId="1" AcceptedAnswerId="3768" CreationDate="2014-11-20T23:59:22.830" Score="4" ViewCount="224" Body="&lt;p&gt;Is there a build-in shortcut for inserting &lt;code&gt;\mathrm{}&lt;/code&gt; and putting the cursor between &lt;code&gt;{}&lt;/code&gt; in AUCTeX? &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="253" LastEditDate="2014-11-21T00:22:56.430" LastActivityDate="2014-11-21T00:22:56.430" Title="Is there a shortcut for \mathrm in AUCTeX?" Tags="|key-bindings|auctex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3767" PostTypeId="1" AcceptedAnswerId="3769" CreationDate="2014-11-20T23:59:27.290" Score="4" ViewCount="1645" Body="&lt;p&gt;Is there any way to see what dependencies has a package installed? In other words what other packages were installed with the first one?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2014-11-22T11:12:09.467" Title="Dependencies of installed packages" Tags="|package|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3768" PostTypeId="2" ParentId="3766" CreationDate="2014-11-21T00:21:08.800" Score="7" Body="&lt;p&gt;&lt;code&gt;C-c C-f C-r&lt;/code&gt; will do it.  Check out &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Font-Specifiers.html&quot;&gt;the AUCTeX manual&lt;/a&gt; for the keybindings for all of the standards.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-21T00:21:08.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3769" PostTypeId="2" ParentId="3767" CreationDate="2014-11-21T00:28:57.630" Score="5" Body="&lt;p&gt;You can see what dependencies a package &lt;em&gt;has&lt;/em&gt; by opening the &lt;code&gt;*Packages*&lt;/code&gt; menu with &lt;code&gt;M-x list-packages&lt;/code&gt;. Then navigate to your package of interest and hit &lt;code&gt;RET&lt;/code&gt;.&lt;br&gt;&#xA;This will display a buffer describing the package, which includes a list of dependencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no way of knowing which of these packages were actually installed as dependencies, and which were manually installed by you. Though there's been talk of implementing that in the dev list. &lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-21T00:28:57.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3770" PostTypeId="2" ParentId="3451" CreationDate="2014-11-21T01:20:13.827" Score="0" Body="&lt;p&gt;It turns out the &lt;em&gt;Help&lt;/em&gt; for packages changed in 24.4 so that the information I thought wasn't getting updated &lt;em&gt;is&lt;/em&gt; and is shown on the &lt;strong&gt;Other versions&lt;/strong&gt; line. &lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-11-21T01:20:13.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3771" PostTypeId="2" ParentId="3764" CreationDate="2014-11-21T07:01:38.603" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Could someone explain this behavior?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The documentation of &lt;code&gt;line-end-position&lt;/code&gt; has a note at the end that explains this behavior:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function constrains the returned position to the current field&#xA;  unless that would be on a different line than the original,&#xA;  unconstrained result.  If N is nil or 1, and a rear-sticky field ends&#xA;  at point, the scan stops as soon as it starts.  &lt;strong&gt;To ignore field&#xA;  boundaries bind &lt;code&gt;inhibit-field-text-motion&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Same for &lt;code&gt;line-beginning-position&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in your example &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((inhibit-field-text-motion t)) (- (line-end-position) (line-beginning-position)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;consistently evaluates to &lt;code&gt;24&lt;/code&gt; at any position on that line (&lt;code&gt;4&lt;/code&gt; characters of the prompt and &lt;code&gt;20&lt;/code&gt; &lt;code&gt;a&lt;/code&gt;s).&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-21T07:01:38.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3772" PostTypeId="2" ParentId="3738" CreationDate="2014-11-21T07:35:52.793" Score="3" Body="&lt;p&gt;If you don't want a permanent change, you can arrange things with a bit of advice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar mute-eval-expression-print-format nil&#xA;  &quot;Set to t to mute eval-expression-print-format&quot;)&#xA;(defun mute-eval-expression-print-format (orig-fun value)&#xA;  (if mute-eval-expression-print-format&#xA;      &quot;&quot;&#xA;    (funcall orig-fun value)))&#xA;(advice-add 'eval-expression-print-format&#xA;        :around #'mute-eval-expression-print-format)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now set &lt;code&gt;mute-eval-expression-print-format&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in order to mute the extra output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this uses the new advice mechanism (introduced with emacs 24, I think).&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2014-11-21T07:35:52.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3773" PostTypeId="2" ParentId="3753" CreationDate="2014-11-21T10:43:15.233" Score="4" Body="&lt;p&gt;According to the documentation for &lt;code&gt;prettify-symbols-alist&lt;/code&gt;, you cannot use regular expressions here:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each element looks like (SYMBOL . CHARACTER), where the symbol matching SYMBOL &lt;strong&gt;(a string, not a regexp)&lt;/strong&gt; will be shown as CHARACTER instead.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pretty-symbols-mode&lt;/code&gt; uses &lt;code&gt;regexp-opt&lt;/code&gt; internally, which creates a big regular expression from all the strings in the car position of each of the alist pairs.  If you really want regular expressions, you are probably better off defining font-lock keywords yourself, outside of the confines of &lt;code&gt;prettify-symbols-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-11-21T10:43:15.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3774" PostTypeId="1" AcceptedAnswerId="3777" CreationDate="2014-11-21T11:28:38.520" Score="6" ViewCount="753" Body="&lt;p&gt;Is there a document (pdf if any) that contains a comprehensive list of all shortcuts provided by AUCTeX? I mean a kind of &lt;strong&gt;AUCTEX Reference Card&lt;/strong&gt; but for all shortcuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is related to my previous question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/3766/is-there-a-shortcut-for-mathrm-in-auctex&quot;&gt;Is there a shortcut for \mathrm in AUCTeX?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2021-05-05T16:11:16.233" Title="A comprehensive list of shortcuts provided by AUCTeX" Tags="|key-bindings|auctex|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3775" PostTypeId="2" ParentId="3774" CreationDate="2014-11-21T11:35:45.803" Score="7" Body="&lt;p&gt;You can run &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;b&lt;/kbd&gt; to see the current bindings.&lt;/p&gt;&#xA;" OwnerUserId="2526" LastActivityDate="2014-11-21T11:35:45.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3776" PostTypeId="1" AcceptedAnswerId="3778" CreationDate="2014-11-21T11:40:47.040" Score="58" ViewCount="4220" Body="&lt;p&gt;Sometimes it happens: emacs prompts you about recovering unsaved changes to a file, but you cannot remember if you want those changes or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting at the &lt;code&gt;recover-this-file&lt;/code&gt; buffer, is there a way to view a diff or otherwise directly see the changes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, something like what &lt;code&gt;magit-mode&lt;/code&gt; gives when tabbing on a edited file in the status buffer.&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="870" LastEditDate="2014-11-21T18:26:21.970" LastActivityDate="2014-11-22T04:17:09.430" Title="How to view diff when emacs suggests to recover this file?" Tags="|buffers|saving|ediff|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3777" PostTypeId="2" ParentId="3774" CreationDate="2014-11-21T11:54:19.563" Score="10" Body="&lt;p&gt;Yes, there is an index of keybindings: it's in the index of the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Indices&quot;&gt;AUCTeX manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I got to this index by googling &quot;auctex manual&quot;, opening up the first hit, which is the manual, selecting the HTML option (although any of them would work), selecting &quot;Indices,&quot; and finally selecting &quot;Key Index.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Likewise, a google search for &quot;AUCTEX reference card&quot;, the phrase you asked about, turns up quite a lot of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please consider doing a little background research in the relevant manual.  Although manuals vary in their comprehensiveness, and sometimes it's hard to know what to look for when the software does &lt;a href=&quot;http://xkcd.com/293/&quot;&gt;something astonishing&lt;/a&gt;, keybindings are generally pretty well documented.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-21T11:59:32.793" LastActivityDate="2014-11-21T11:59:32.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3778" PostTypeId="2" ParentId="3776" CreationDate="2014-11-21T12:27:54.357" Score="58" Body="&lt;p&gt;After running &lt;code&gt;recover-this-file&lt;/code&gt; and accepting the autosave version, you'll have a modified buffer containing the autosave contents. At this point you can use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;diff-buffer-with-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to see the differences between the modified buffer and the saved file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key I've bound for this actually runs a custom function, in order to produce a unified diff, and to skip the prompt for the buffer (it assumes the current buffer).&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-diff-buffer-with-file ()&#xA;  &quot;Compare the current modified buffer with the saved version.&quot;&#xA;  (interactive)&#xA;  (let ((diff-switches &quot;-u&quot;)) ;; unified diff&#xA;    (diff-buffer-with-file (current-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's also an ediff equivalent (which I generally prefer, although I do use both) which is available at &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;ediff-current-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wish to reject the modifications after checking the diff, you should be able to simply &lt;code&gt;undo&lt;/code&gt; the recovery. (Failing that you can always use &lt;code&gt;revert-buffer&lt;/code&gt; or &lt;code&gt;find-alternate-file&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As keybindings for diff commands often involve &lt;kbd&gt;=&lt;/kbd&gt;, I find the following convenient (n.b. I've unbound the default &lt;code&gt;C-z&lt;/code&gt; binding, and moved it instead to &lt;code&gt;C-z C-z&lt;/code&gt;, which opens up &lt;code&gt;C-z&lt;/code&gt; as a prefix for custom bindings):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-z =&quot;) 'my-diff-buffer-with-file)&#xA;(global-set-key (kbd &quot;C-z C-=&quot;) 'ediff-current-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-22T04:17:09.430" LastActivityDate="2014-11-22T04:17:09.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3779" PostTypeId="1" CreationDate="2014-11-21T13:21:55.837" Score="3" ViewCount="1198" Body="&lt;p&gt;I find smartparens awkward. It's easier for me to type the matching paren/quote than to arrow over or &lt;code&gt;C-f&lt;/code&gt; over. I want to turn off smartparens everywhere. I'm using prelude though and I can see that prelude turns on smartparens for a variety of the language specific packages that it uses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to globally turn off smartparens?&lt;/strong&gt; I'm assuming that it goes somewhere in my &lt;code&gt;personal/&lt;/code&gt; directory in one of my custom init files.&lt;/p&gt;&#xA;" OwnerUserId="653" LastEditorUserId="25" LastEditDate="2014-11-21T22:49:27.260" LastActivityDate="2020-01-04T05:39:22.180" Title="How do I turn-off smartparens when using prelude?" Tags="|smartparens|prelude|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3780" PostTypeId="2" ParentId="3755" CreationDate="2014-11-21T13:52:53.297" Score="3" Body="&lt;p&gt;I'm not sure whether you can really parse that with regular expressions only.  I think you are better off with a custom &lt;code&gt;:error-parser&lt;/code&gt;, i.e. a function that parses this error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function would insert the output into a temporary buffer, search forwards to search for occurrences of &lt;code&gt;Traceback …&lt;/code&gt;, skip over all indented lines to extract the error message, and then search backwards to the first occurrence of &lt;code&gt;File &quot;...&quot;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun flycheck-parse-hy-traceback (output _checker _buffer)&#xA;  (with-temp-buffer&#xA;    ;; Insert output of Hy&#xA;    (insert output)&#xA;    (goto-char (point-min))&#xA;&#xA;    (let (errors)&#xA;      ;; Search forward for the next traceback&#xA;      (while (re-search-forward &quot;^Traceback&quot; nil 'noerror)&#xA;        ;; Goto to the first line of the backtrace,…&#xA;        (forward-line 1)&#xA;        ;; …, and skip over indented lines, that is all lines of the backtrace up&#xA;        ;; to the error message&#xA;        (while (looking-at (rx line-start blank))&#xA;          (forward-line 1))&#xA;        ;; Extract the message&#xA;        (let ((message (buffer-substring-no-properties&#xA;                        (line-beginning-position) (line-end-position)))&#xA;              (end (point)))&#xA;          ;; Search backwards for the last error location&#xA;          (when (re-search-backward (rx line-start&#xA;                                        (one-or-more blank)&#xA;                                        &quot;File \&quot;&quot;&#xA;                                        (group-n 1 (one-or-more (not (any &quot;\&quot;&quot;))))&#xA;                                        &quot;\&quot;, line &quot;&#xA;                                        (group-n 2 (one-or-more digit)))&#xA;                                    nil 'noerror)&#xA;            ;; Extract the file name and the line, and create a new error object&#xA;            (push (flycheck-error-new :filename (match-string 1)&#xA;                                      :line (flycheck-string-to-number-safe&#xA;                                             (match-string 2))&#xA;                                      :level 'error&#xA;                                      :message message)&#xA;                  errors))&#xA;          ;; Move out of this error to continue searching for other errors&#xA;          (goto-char end)))&#xA;      errors)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use &lt;code&gt;:error-parser flycheck-parse-hy-traceback&lt;/code&gt; instead of &lt;code&gt;:error-patterns&lt;/code&gt; in the definition of your syntax checker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, a &lt;strong&gt;word of warning&lt;/strong&gt;:  It looks like your syntax checker &lt;strong&gt;runs&lt;/strong&gt; Hy files to check them.  That's a bad idea, for many reasons, and you should really &lt;strong&gt;not&lt;/strong&gt; do that, if there's any other way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I'm the Flycheck maintainer.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-11-21T13:52:53.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3781" PostTypeId="2" ParentId="3779" CreationDate="2014-11-21T14:33:44.257" Score="4" Body="&lt;p&gt;I don't see an option in prelude to disable &lt;code&gt;smartparens&lt;/code&gt; globally -- looks like it is enabled in a &lt;code&gt;prog-mode-hook&lt;/code&gt; and a few other places. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could advise &lt;code&gt;smartparens-mode&lt;/code&gt; (and perhaps &lt;code&gt;smartparens-strict-mode&lt;/code&gt;as well) to prevent them from enabling the mode. Assuming you are on Emacs 24.4, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add #'smartparens-mode :before-until (lambda (&amp;amp;rest args) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This effectively makes &lt;code&gt;smartparens-mode&lt;/code&gt; return &lt;code&gt;t&lt;/code&gt; and do nothing.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-11-21T14:33:44.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3782" PostTypeId="5" CreationDate="2014-11-21T14:41:09.150" Score="0" Body="&lt;p&gt;From the &lt;a href=&quot;http://www.emacswiki.org/emacs/AquamacsEmacs&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki page&lt;/a&gt;:  Aquamacs... is an Aqua-native build of the powerful Emacs text editor. By &quot;Aqua-native,&quot; we mean more than just the fact that this version of Emacs runs as a standard OS X application. Aquamacs features extensive customization that enables it to conform better with Apple’s standard Human Interface Guidelines (HIG) than standard versions of the editor do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://aquamacs.org/&quot; rel=&quot;nofollow&quot;&gt;Aquamacs project page&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-21T14:46:49.053" LastActivityDate="2014-11-21T14:46:49.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3783" PostTypeId="4" CreationDate="2014-11-21T14:41:09.150" Score="0" Body="An extensively-customized spin of Emacs for use on Apple's macOS." OwnerUserId="253" LastEditorUserId="14920" LastEditDate="2020-12-29T19:32:10.710" LastActivityDate="2020-12-29T19:32:10.710" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3784" PostTypeId="1" AcceptedAnswerId="3805" CreationDate="2014-11-21T14:44:19.377" Score="5" ViewCount="2052" Body="&lt;p&gt;I've encountered two very nice modes when it comes to developing C++ in Emacs. First we have flycheck-mode which on the fly checks the syntax of my code using various backends such as clang or gcc. The second one is company-mode which provides auto-completion in various situations, function names, method names, object fields, using a back end such as clang.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that both likes to rewrite the contents of the buffer. Company-mode adds it's list of completions while flycheck-mode adds underscoring to problematic parts of the code. These collide for example when a user starts typing a function name, company-mode pops up the completion list, the user reads the available options which disappear half a second later because flycheck rewrites the display due to the incorrect, half-written, function call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After further investigation it turns out that this bug only occurs in terminal emacs when the buffer can't be displayed in a single window. A video of the bug can be found on youtube: &lt;a href=&quot;https://www.youtube.com/watch?v=Lg40mtSk_u8&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=Lg40mtSk_u8&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is it possible to make these two modes play nicely together? Or are there any good alternative modes that do work together and provide the same functionality?&lt;/p&gt;&#xA;" OwnerUserId="2325" LastEditorUserId="2325" LastEditDate="2014-11-24T22:30:24.860" LastActivityDate="2014-12-02T08:42:01.130" Title="Is it possible to make flycheck-mode and company-mode play nice together?" Tags="|company-mode|flycheck|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3785" PostTypeId="1" AcceptedAnswerId="3806" CreationDate="2014-11-21T15:45:42.733" Score="24" ViewCount="7497" Body="&lt;p&gt;I'm tying to set default header arguments to the code blocks within my org file, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args  :session *my_python_session*&#xA;#+PROPERTY: header-args  :results silent&#xA;#+PROPERTY: header-args  :tangle yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My code blocks look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python&#xA;  import pandas as pd&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I call &lt;code&gt;org-babel-tangle&lt;/code&gt; from this buffer, I get &lt;em&gt;Tangled 0 code blocks from filename.org&lt;/em&gt;.  When I add &lt;code&gt;:tangle yes&lt;/code&gt; to the end of the &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; line, the code block is exported when I call &lt;code&gt;org-babel-tangle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would expect that I don't need to set &lt;code&gt;:tangle yes&lt;/code&gt; on each code block.  What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2021-02-25T20:39:31.100" Title="How to specify default header arguments in orgmode code blocks" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3786" PostTypeId="1" AcceptedAnswerId="3868" CreationDate="2014-11-21T15:58:22.090" Score="4" ViewCount="1333" Body="&lt;p&gt;I am new to Emacs, using it to structure text/ideas. After enabling word wrap from the menu and doing &lt;code&gt;M-x org-indent-mode&lt;/code&gt;, I would like my document to look like this (the returns in the middle of sentences should be soft returns that adapt to the width of the window):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* The idea&#xA;  * Example One&#xA;    Curabitur suscipit et dui quis placerat. Nunc aliquam posuere elit,&#xA;    maximus velit elementum non. Cras accumsan ex velit, eu semper arcu&#xA;    fermentum vel.&#xA;    + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin&#xA;      gravida tincidunt magna, mattis mattis massa maximus sed. Donec&#xA;      varius vestibulum nibh imperdiet tristique. Vestibulum sit amet&#xA;      lacinia nibh.&#xA;      - Integer eu dapibus nulla.&#xA;      - Nam varius risus dolor, eu ultricies lorem ultrices et. Nulla&#xA;        bibendum lectus dui, eget iaculis velit posuere sed. Donec&#xA;        imperdiet felis dui, eget sodales sem feugiat nec.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas now it looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* The idea&#xA;  * Example One&#xA;    Curabitur suscipit et dui quis placerat. Nunc aliquam posuere elit,&#xA;    maximus velit elementum non. Cras accumsan ex velit, eu semper arcu&#xA;    fermentum vel.&#xA;    + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin&#xA;    gravida tincidunt magna, mattis mattis massa maximus sed. Donec&#xA;    varius vestibulum nibh imperdiet tristique. Vestibulum sit amet&#xA;    lacinia nibh.&#xA;      - Integer eu dapibus nulla.&#xA;      - Nam varius risus dolor, eu ultricies lorem ultrices et. Nulla&#xA;    bibendum lectus dui, eget iaculis velit posuere sed. Donec&#xA;    imperdiet felis dui, eget sodales sem feugiat nec.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... because the indentation always reverts to that used below the last *-marked header. The - and + list bullets (and their manually given indentation) are not considered in the automatic indentation of the wrapped text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using headers throughout would be messy/clumsy/overkill since the text blocks at the + and - marks are not titles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="2658" LastEditorUserId="2658" LastEditDate="2014-11-21T18:04:44.680" LastActivityDate="2014-11-25T04:56:59.370" Title="Indented multi-tiered lists (and headings), with org-indent-mode?" Tags="|org-mode|indentation|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3787" PostTypeId="1" AcceptedAnswerId="3814" CreationDate="2014-11-21T16:20:56.080" Score="3" ViewCount="347" Body="&lt;p&gt;I changed the &lt;code&gt;C-h&lt;/code&gt; key binding to be used as backspace.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;C-h&quot;) (kbd &quot;&amp;lt; DEL &amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, this works flawlessy pretty much everywhere except in &lt;code&gt;html-mode&lt;/code&gt;. When I'm in an HTML command minibuffer and press &lt;kbd&gt;C-h&lt;/kbd&gt;, instead of deleting the last character this message appears:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You are inserting a skeleton.  Standard text gets inserted into the buffer&#xA;  automatically, and you are prompted to fill in the variable parts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How could I solve this problem if possible?&lt;/p&gt;&#xA;" OwnerUserId="2660" LastEditorUserId="504" LastEditDate="2014-11-21T19:53:27.367" LastActivityDate="2016-03-18T16:07:42.910" Title="html-mode and custom backspace keybinding" Tags="|keymap|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3789" PostTypeId="1" AcceptedAnswerId="3790" CreationDate="2014-11-21T17:57:43.367" Score="5" ViewCount="689" Body="&lt;p&gt;I thought I could just use &lt;code&gt;minibuffer-local-map&lt;/code&gt; but it isn't working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;emacs -Q&lt;/code&gt; I eval:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key minibuffer-local-map (kbd &quot;TAB&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then open up &lt;code&gt;M-:&lt;/code&gt; and hit &lt;code&gt;C-h c TAB&lt;/code&gt; and it says TAB runs the command completion-at-point. What gives? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I really want to do is map tab in the minibuffer to &lt;code&gt;helm-lisp-completion-at-point&lt;/code&gt;. It also would be helpful if I could map it only for &lt;code&gt;eval-expression&lt;/code&gt; but that's not required.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-11-21T18:00:57.533" Title="How can I remap keys in the minibuffer?" Tags="|keymap|minibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3790" PostTypeId="2" ParentId="3789" CreationDate="2014-11-21T18:00:57.533" Score="6" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'minibuffer-setup-hook&#xA;          (lambda ()&#xA;            (local-set-key (kbd &quot;TAB&quot;) nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-21T18:00:57.533" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3791" PostTypeId="2" ParentId="3554" CreationDate="2014-11-21T18:41:06.913" Score="1" Body="&lt;p&gt;To troubleshoot the issue I started Emacs with a completely commented out .emacs init file then uncommented and executed my .emacs file one line/block at a time until came across a command that prompted the remote login authentication. ido-mode was the offending package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a variable, ido-save-directory-list-file which pointed to ~/.ido.last which had references to files on the 2 remote windows servers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe ido was caching the file contents of the last 100 directories I'd visited, causing windows to prompt me for authentication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To resolve my problem, I attempted to modify and save the file, ido managed to overwrite what it had in memory back into the file. My final solution was to &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;modify the contents of .ido.last to remove the offending references as ido2.last&lt;/li&gt;&#xA;&lt;li&gt;close Emacs&lt;/li&gt;&#xA;&lt;li&gt;delete ido.last, rename ido2.last as ido.last&lt;/li&gt;&#xA;&lt;li&gt;Start up Emacs again&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There's probably an ido function to re-load ido history from the file, but I didn't have time to dig through the docs. But my blunt approach seemed to do the job!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem Solved!&lt;/p&gt;&#xA;" OwnerUserId="2559" LastActivityDate="2014-11-21T18:41:06.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3793" PostTypeId="2" ParentId="3749" CreationDate="2014-11-21T23:43:17.933" Score="2" Body="&lt;p&gt;You can do this indirectly by exporting your org files to icalendar with &lt;code&gt;C-c C-e c a&lt;/code&gt; and loading the resulting ics file in Thunderbird or Google Calendar or some other calendaring tool.   Most such tools can give notifications about deadlines. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Thunderbird, import the file as a &quot;on the network&quot; calendar with a url of &lt;code&gt;file:///path/to/calendar.ics&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-11-21T23:43:17.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3794" PostTypeId="1" CreationDate="2014-11-22T03:19:45.033" Score="6" ViewCount="220" Body="&lt;p&gt;Some people in IRC channels I frequent have elected to use extremely common words for their nicks, including &quot;a&quot; and &quot;me&quot;. I use &lt;code&gt;erc-hl-nicks&lt;/code&gt;, and was able to block those particular nicks from getting colored, but I would like to block them from being &lt;strong&gt;bolded&lt;/strong&gt; as well. It seems it's ERC's default behavior to &lt;strong&gt;bold&lt;/strong&gt; nicks when they are mentioned. See the attached screenshots, where &quot;a&quot; and &quot;D&quot; are highlighted in bold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I indicate to ERC that those nicks should not be bolded or highlighted? I've played around with the &lt;code&gt;erc-fools&lt;/code&gt; list, but I can't get that to do anything, and every time I turn it on, it breaks nick coloring for most people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/njrxh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="15458" LastEditDate="2019-12-26T11:41:04.503" LastActivityDate="2024-01-04T22:01:25.167" Title="How to block highlighting of certain nicks in ERC?" Tags="|faces|erc|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="3795" PostTypeId="1" AcceptedAnswerId="3796" CreationDate="2014-11-22T04:19:55.060" Score="0" ViewCount="681" Body="&lt;p&gt;I want to have &lt;a href=&quot;https://marmalade-repo.org/packages/ido-ubiquitous&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ido-ubiquitous&lt;/code&gt;&lt;/a&gt; available in every buffer at all times, but I can't find what I have to add to my &lt;code&gt;.emacs&lt;/code&gt; to do it. Could someone please point me in the right direction?&lt;/p&gt;&#xA;" OwnerUserId="561" LastEditorUserId="50" LastEditDate="2014-11-22T10:03:30.317" LastActivityDate="2014-11-22T10:03:30.317" Title="How to enable ido-ubiquitous globally" Tags="|ido|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3796" PostTypeId="2" ParentId="3795" CreationDate="2014-11-22T05:23:11.287" Score="5" Body="&lt;p&gt;From a comment at the top of &lt;a href=&quot;https://github.com/DarwinAwardWinner/ido-ubiquitous/blob/bleeding-edge/ido-ubiquitous.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ido-ubiquitous.el&lt;/code&gt;&lt;/a&gt; (the relevant part is in &lt;strong&gt;bold&lt;/strong&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To use this package, call &lt;code&gt;ido-ubiquitous-mode&lt;/code&gt; to enable the mode,&#xA;  or &lt;strong&gt;use &lt;code&gt;M-x customize-variable ido-ubiquitous-mode&lt;/code&gt; it to enable it&#xA;  permanently&lt;/strong&gt;. Note that &lt;code&gt;ido-ubiquotous-mode&lt;/code&gt; has no effect unless&#xA;  &lt;code&gt;ido-mode&lt;/code&gt; is also enabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-22T05:23:11.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3797" PostTypeId="1" CreationDate="2014-11-22T05:52:46.323" Score="0" ViewCount="429" Body="&lt;p&gt;I'm getting &lt;em&gt;very&lt;/em&gt; strange behaviour when I try to &lt;code&gt;C-c C-k&lt;/code&gt; the following code into the SLIME REPL running SBCL:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when (:compile-toplevel :load-toplevel :execute)&#xA;  (ql:quickload &quot;serapeum&quot;))&#xA;&#xA;(defpackage #:foo&#xA;  (:use #:cl #:serapeum)) ;no symbols to export currently&#xA;&#xA;(in-package #:foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The operation fails, and SLIME spews the following into my face:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    failed AVER: (NULL CURRENT)&#xA;This is probably a bug in SBCL itself. (Alternatively, SBCL&#xA;might have been corrupted by bad user code, e.g. by an undefined&#xA;Lisp operation like (FMAKUNBOUND 'COMPILE), or by stray pointers&#xA;from alien code or from unsafe Lisp code; or there might be a&#xA;bug in the OS or hardware that SBCL is running on.) If it seems&#xA;to be a bug in SBCL itself, the maintainers would like to know&#xA;about it. Bug reports are welcome on the SBCL mailing lists,&#xA;which you can find at &amp;lt;http://sbcl.sourceforge.net/&amp;gt;.&#xA;    [Condition of type SB-INT:BUG]&#xA;&#xA;Backtrace:&#xA;  0: (SB-C:COMPILER-ERROR SB-C::INPUT-ERROR-IN-LOAD :CONDITION #&amp;lt;SB-INT:SIMPLE-FILE-ERROR &quot;~@&amp;lt;~?: ~2I~_~A~:&amp;gt;&quot; {1004F4CAD3}&amp;gt; :POSITION 0 :STREAM #&amp;lt;SB-SYS:FD-STREAM for &quot;file /home/koz/quicklisp/dists/quickl..&#xA;  1: (SB-C::READ-FOR-COMPILE-FILE #&amp;lt;SB-SYS:FD-STREAM for &quot;file /home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd&quot; {1004EEABD3}&amp;gt; 0 SB-C::INPUT-ERROR-IN-LOAD)&#xA;  2: (SB-INT:LOAD-AS-SOURCE #&amp;lt;SB-SYS:FD-STREAM for &quot;file /home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd&quot; {1004EEABD3}&amp;gt; :VERBOSE NIL :PRINT NIL :CONTEXT &quot;loading&quot;)&#xA;  3: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #&amp;lt;SB-SYS:FD-STREAM for &quot;file /home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd&quot; {1004EEABD3}&amp;gt; NIL)&#xA;  4: (LOAD #P&quot;/home/koz/quicklisp/dists/quicklisp/software/split-sequence-1.1/split-sequence.asd&quot; :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :UTF-8)&#xA;  5: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #&amp;lt;CLOSURE (LAMBDA NIL :IN UIOP/LISP-BUILD:LOAD*) {1004EE584B}&amp;gt; (&quot;Overwriting already existing readtable ~S.&quot; #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and so on for ages and ages. I've checked and this does &lt;em&gt;not&lt;/em&gt; happen if I just load it into SBCL using &lt;code&gt;sbcl --load&lt;/code&gt; on the file that contains this code. Basically, what the actual hell is going on, and how can I make it not do that?&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2014-11-22T05:52:46.323" Title="SBCL and Slime do strange things when I try to use Serapeum" Tags="|slime|common-lisp|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3798" PostTypeId="1" AcceptedAnswerId="7896" CreationDate="2014-11-22T06:50:17.337" Score="27" ViewCount="4388" Body="&lt;p&gt;When I run &lt;code&gt;#'helm-find-files&lt;/code&gt;, and move point to a directory, pressing &lt;code&gt;&amp;lt;ret&amp;gt;&lt;/code&gt; results in opening that directory in dired mode. One has to press &lt;code&gt;C-j&lt;/code&gt; to enter that directory in Helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to have &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt; act as &lt;code&gt;C-j&lt;/code&gt; does here, but not necessarily everywhere else. I checked, and &lt;code&gt;C-j&lt;/code&gt; is bound to &lt;code&gt;#'helm-maybe-exit-minibuffer&lt;/code&gt;, whereas &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt; is bound to &lt;code&gt;#'helm-execute-persistent-action&lt;/code&gt;. Binding &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt; to &lt;code&gt;#'helm-maybe-exit-minibuffer&lt;/code&gt; works for this case, but breaks other cases: for example, the helm autocomplete in &lt;code&gt;describe-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, when using Helm to find a file, how can I make pressing &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt; open that directory in Helm?&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="45" LastEditDate="2014-11-22T16:02:51.467" LastActivityDate="2017-11-02T11:53:23.123" Title="How do I make pressing &lt;RET&gt; in helm-find-files open the directory?" Tags="|key-bindings|helm|" AnswerCount="3" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3799" PostTypeId="1" CreationDate="2014-11-22T10:49:32.000" Score="4" ViewCount="195" Body="&lt;p&gt;I am looking for a solution for recently visited files and/or directories by applications run in gnome terminal &lt;a href=&quot;https://askubuntu.com/questions/529838/is-there-a-terminal-solution-for-recent-visited-files&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I saw that question I thought of Emacs. Emacs has &lt;code&gt;recentf-mode&lt;/code&gt;, does that mean that if I open a shell buffer by &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;shell&lt;/code&gt; or &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;term&lt;/code&gt;, all the files I visited by calling specific programs (e.g. evince for pdf, emacs for text files) from the shell buffer, will be recorded by the &lt;code&gt;recentf-mode&lt;/code&gt; and accessed by &lt;code&gt;recentf-open-files&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of &quot;visit&quot; is qualified to be recorded?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2014-11-22T16:05:10.533" Title="Most recent files visited" Tags="|files|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3800" PostTypeId="2" ParentId="3799" CreationDate="2014-11-22T11:00:53.280" Score="3" Body="&lt;p&gt;The manual describes what visiting means:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Visiting a file means reading a file into a buffer. Once this is done,&#xA;  we say that the buffer is visiting that file, and call the file “the&#xA;  visited file” of the buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Visiting-Files.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Visiting-Files.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to add files used in the shell buffers to recent files, but it has to be implemented. One should write a hook which is executed after every shell command, parses the command line and adds the file to recent files. One obvious problem is that you have to add knowledge of different commands, because they can have file arguments in different positions on the command line, there can be mutiple file arguments for the command, etc.&lt;/p&gt;&#xA;" OwnerUserId="2498" LastActivityDate="2014-11-22T11:00:53.280" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3801" PostTypeId="2" ParentId="3767" CreationDate="2014-11-22T11:12:09.467" Score="-1" Body="&lt;pre&gt;&lt;code&gt;(let ((desc (assoc '{YOUR_PAcKAGE} package-archive-contents)))&#xA;  (if desc&#xA;      (-map (lambda (elem) (car elem))&#xA;            (aref (cadr desc) 4))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2014-11-22T11:12:09.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3802" PostTypeId="1" AcceptedAnswerId="3807" CreationDate="2014-11-22T13:20:56.693" Score="8" ViewCount="303" Body="&lt;p&gt;This often trips me up when building Linux kernels. I'll kick of a compile and after a while I realise it's not completed. What's usually happened is because the default config has changed it's waiting for user input in the compilation window. For example I find the &lt;em&gt;compilation&lt;/em&gt; window stalled on the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: compilation; default-directory: &quot;~/lsrc/kvm/kernel-v8.build/&quot; -*-&#xA;Compilation started at Tue Nov 25 10:34:20&#xA;&#xA;cd /home/alex/lsrc/kvm/kernel-v8.build &amp;amp;&amp;amp; ARCH=arm64 make -j9&#xA;  GEN     ./Makefile&#xA;scripts/kconfig/conf --silentoldconfig Kconfig&#xA;*&#xA;* Restart config...&#xA;*&#xA;*&#xA;* File systems&#xA;*&#xA;Second extended fs support (EXT2_FS) [Y/n/m/?] y&#xA;  Ext2 extended attributes (EXT2_FS_XATTR) [N/y/?] n&#xA;  Ext2 execute in place support (EXT2_FS_XIP) [N/y/?] n&#xA;Ext3 journalling file system support (EXT3_FS) [Y/n/m/?] y&#xA;  Default to 'data=ordered' in ext3 (EXT3_DEFAULTS_TO_ORDERED) [N/y/?] n&#xA;  Ext3 extended attributes (EXT3_FS_XATTR) [N/y/?] n&#xA;The Extended 4 (ext4) filesystem (EXT4_FS) [Y/n/m/?] y&#xA;  Ext4 POSIX Access Control Lists (EXT4_FS_POSIX_ACL) [N/y/?] n&#xA;  Ext4 Security Labels (EXT4_FS_SECURITY) [N/y/?] n&#xA;  EXT4 debugging support (EXT4_DEBUG) [N/y/?] n&#xA;JBD (ext3) debugging support (JBD_DEBUG) [N/y/?] n&#xA;JBD2 (ext4) debugging support (JBD2_DEBUG) [N/y/?] n&#xA;Reiserfs support (REISERFS_FS) [N/m/y/?] n&#xA;JFS filesystem support (JFS_FS) [N/m/y/?] n&#xA;XFS filesystem support (XFS_FS) [N/m/y/?] n&#xA;GFS2 file system support (GFS2_FS) [N/m/y/?] n&#xA;Btrfs filesystem support (BTRFS_FS) [N/m/y/?] n&#xA;NILFS2 file system support (NILFS2_FS) [N/m/y/?] n&#xA;Dnotify support (DNOTIFY) [Y/n/?] y&#xA;Inotify support for userspace (INOTIFY_USER) [Y/n/?] y&#xA;Filesystem wide access notification (FANOTIFY) [Y/n/?] y&#xA;  fanotify permissions checking (FANOTIFY_ACCESS_PERMISSIONS) [Y/n/?] y&#xA;Quota support (QUOTA) [N/y/?] n&#xA;Kernel automounter version 4 support (also supports v3) (AUTOFS4_FS) [N/m/y/?] n&#xA;FUSE (Filesystem in Userspace) support (FUSE_FS) [Y/n/m/?] y&#xA;  Character device in Userspace support (CUSE) [Y/n/m/?] y&#xA;Overlay filesystem support (OVERLAY_FS) [N/m/y/?] (NEW) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would be useful if I could detect this programatically so I could flag a notification in my mode-line. Any idea how I could detect this?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-11-25T10:40:35.510" LastActivityDate="2014-11-25T15:33:00.147" Title="How can I detect compilation-mode is waiting for input" Tags="|compilation-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3803" PostTypeId="1" AcceptedAnswerId="3804" CreationDate="2014-11-22T14:02:32.440" Score="4" ViewCount="1177" Body="&lt;p&gt;Just noticed this message after emacs startup &quot;Package assoc is obsolete!&quot;, but everything seems to work nice. The requirement seems to be called by yasnippet only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want to know if I should do something to fix this warning.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-11-22T15:13:12.293" Title="Is there something I should do about &quot;package assoc is obsolete&quot; message?" Tags="|init-file|yasnippet|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3804" PostTypeId="2" ParentId="3803" CreationDate="2014-11-22T15:13:12.293" Score="5" Body="&lt;p&gt;No, you don't need to do anything.  Actually, you can't even do anything about it without patching the source of the affected package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, as a user you don't need to be concerned about warnings.  Only if you actually develop packages, you should care about warnings in your packages, and try to fix them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you like to, you can report the warning to the YASnippet maintainers to make them aware of the warning, and get them to update their code, but it's by no means necessary.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-11-22T15:13:12.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3805" PostTypeId="2" ParentId="3784" CreationDate="2014-11-22T15:40:39.987" Score="8" Body="&lt;p&gt;This issue is the result of a faulty interaction between overlays with &lt;code&gt;before-string&lt;/code&gt;/&lt;code&gt;after-string&lt;/code&gt; properties whose contents have a &lt;code&gt;display&lt;/code&gt; property attached.  It was been reported to Emacs as &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19201&quot; rel=&quot;nofollow&quot;&gt;bug #19201&lt;/a&gt;, and since been fixed in Emacs.  The fix will make it into the next release.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, you can work around this issue by disabling Flycheck's fringe indicators in TTY frames with the following code in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'flycheck-mode-hook&#xA;          (lambda ()&#xA;            (when (display-graphic-p)&#xA;              (setq-local flycheck-indication-mode nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will not see any difference, since TTY frames do not have a fringe anyway, but this code will prevent Flycheck from setting a &lt;code&gt;before-string&lt;/code&gt; on its overlay, thus avoiding conflicts with the Company overlays.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2014-12-02T08:42:01.130" LastActivityDate="2014-12-02T08:42:01.130" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3806" PostTypeId="2" ParentId="3785" CreationDate="2014-11-22T16:26:52.610" Score="36" Body="&lt;p&gt;You should have every header argument in one line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :session *my_python_session* :results silent :tangle yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Having several &lt;code&gt;#+PROPERTY&lt;/code&gt; lines is accepted, but not in the way you're trying to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Org manual (&lt;a href=&quot;http://orgmode.org/manual/Property-syntax.html&quot; rel=&quot;noreferrer&quot;&gt;7.1 Property syntax&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you want to add to the value of an existing property, append a ‘+’&#xA;      to the property name.  The following results in the property ‘var’&#xA;      having the value “foo=1 bar=2”.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: var  foo=1&#xA;#+PROPERTY: var+ bar=2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, since &lt;code&gt;header-args&lt;/code&gt; is the property and &lt;code&gt;:session&lt;/code&gt;, &lt;code&gt;:results&lt;/code&gt; and &lt;code&gt;:tangle&lt;/code&gt; are its values, it should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :session *my_python_session*&#xA;#+PROPERTY: header-args+ :results silent&#xA;#+PROPERTY: header-args+ :tangle yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's easier to have just one line IMO.&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="591" LastEditDate="2017-02-01T15:43:30.470" LastActivityDate="2017-02-01T15:43:30.470" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3807" PostTypeId="2" ParentId="3802" CreationDate="2014-11-22T17:05:06.417" Score="6" Body="&lt;p&gt;Emacs cannot detect why a child process is waiting.  It might wait because it is calling &lt;code&gt;read()&lt;/code&gt; on &lt;code&gt;stdin&lt;/code&gt;, but it might just as well just perform an expensive computation while optimizing C code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what you &lt;strong&gt;can&lt;/strong&gt; detect is whether the compilation process has written a prompt.  Compilation Mode runs &lt;code&gt;compilation-filter-hook&lt;/code&gt; whenever it has inserted output from the compilation process into the compilation buffer.  You are free to add your own functions to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, you could write a function that searches for a particular prompt in the output, and emits a warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-compilation-mode-warn-about-prompt ()&#xA;  (save-excursion&#xA;    (let ((re '(rx &quot;[&quot; (one-or-more (any &quot;n&quot; &quot;N&quot; &quot;m&quot; &quot;M&quot; &quot;Y&quot; &quot;y&quot;) &quot;/&quot;) &quot;?]&quot;&#xA;                   (optional &quot; (NEW)&quot;) (zero-or-more whitespace) buffer-end)))&#xA;      (when (re-search-backward re nil 'no-error)&#xA;        (lwarn 'emacs :warning &quot;Compilation process in %s seems stalled!&quot;&#xA;               (buffer-name))))))&#xA;&#xA;(add-hook 'compilation-filter-hook&#xA;          #'my-compilation-mode-warn-about-prompt)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will popup a warning buffer whenever the compilation process prints a prompt at the end of the buffer.  The prompt is recognized by looking for variations of the &lt;code&gt;[Y/n/?]&lt;/code&gt; part.  I use &lt;code&gt;rx&lt;/code&gt; to write a readable regular expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should handle the case where the compilation process prints a prompt and then waits for input.  In this case, the prompt will be the last text inserted into the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might cause some false-positives (I didn't try), but since it's only a warning, these should be tolerable.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2014-11-25T15:33:00.147" LastActivityDate="2014-11-25T15:33:00.147" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3808" PostTypeId="1" AcceptedAnswerId="3841" CreationDate="2014-11-22T19:34:02.953" Score="2" ViewCount="126" Body="&lt;p&gt;I'm trying to use ERT to test the ycmd package, and part of what I need to do is pass bodies of code to the ycmd server and ask for completion candidates. I'd like to be able to keep these bodies of code in separate files, partly for organization and partly because that makes it simpler to determine the position in the code for which I would like to do completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I can't figure out the right way to address these files when the test is running. The crux of what I want to do is read the contents of a file which is in a location relative to the elisp file which defines the test. How can I do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I've tried &lt;code&gt;load-file-name&lt;/code&gt;, and it appears that this might work for batch mode testing. However, it doesn't work for interactive testing inside emacs, so at best it's an incomplete solution.)&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2014-11-23T23:30:27.417" Title="Accessing resource files in ERT tests" Tags="|testing|ert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3809" PostTypeId="1" AcceptedAnswerId="3810" CreationDate="2014-11-22T19:52:05.630" Score="5" ViewCount="1008" Body="&lt;p&gt;I am writing source code and a lot of times I need to press Enter and have the newline indented with 4 spaces more than the previous. As I don't want to do it always, I would like to be able to use &lt;code&gt;C-RET&lt;/code&gt; to achieve this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While searching I found &lt;code&gt;C-j&lt;/code&gt; (newline-and-indent) but it always indents with the same amount of spaces  and not relatively to the current line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make myself clear, what I want is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;First line&#xA;&#xA;/* Not indented. */&#xA;&#xA;    Second line &#xA;&#xA;    /* Second line indented with 4 spaces. */&#xA;&#xA;        Third line&#xA;&#xA;        /* Third line indented with 4 spaces&#xA;        but relative to the second so now it&#xA;        has 8 spaces. */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2014-11-22T19:57:47.413" LastActivityDate="2014-11-22T21:38:00.847" Title="Indentation of newlines" Tags="|indentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3810" PostTypeId="2" ParentId="3809" CreationDate="2014-11-22T20:31:33.677" Score="6" Body="&lt;p&gt;Here's a simple function that indents (with spaces) 4 spaces relative to the previous line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun indent-relative (&amp;amp;optional arg)&#xA;  &quot;Newline and indent 4 spaces relative to previous line.  With&#xA;C-u, indent to same level as previous line.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((amount (if arg 0 4))&#xA;         (indent (+ amount (save-excursion&#xA;                             (back-to-indentation)&#xA;                             (current-column)))))&#xA;    (newline 1)&#xA;    (insert (make-string indent ?\s))))&#xA;&#xA;(global-set-key (kbd &quot;C-&amp;lt;return&amp;gt;&quot;) #'indent-relative)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-22T21:38:00.847" LastActivityDate="2014-11-22T21:38:00.847" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3811" PostTypeId="2" ParentId="3809" CreationDate="2014-11-22T20:35:02.217" Score="3" Body="&lt;p&gt;You can bind the &lt;code&gt;C-RET&lt;/code&gt; to do exactly that: newline and 4 spaces.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-&amp;lt;return&amp;gt;&quot;) &quot;\C-j    &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-22T20:35:02.217" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3812" PostTypeId="2" ParentId="2495" CreationDate="2014-11-22T21:00:36.360" Score="0" Body="&lt;p&gt;If you don't use &lt;code&gt;company&lt;/code&gt; mode you don't have to fix it. The error about &lt;code&gt;auto-complete&lt;/code&gt; could stem from having &lt;code&gt;(require 'ac-emacs-eclim-source)&lt;/code&gt; and &lt;code&gt;(ac-emacs-eclim-config)&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt;. If so, make sure that your &lt;code&gt;emacs-eclim&lt;/code&gt; configuration takes place &lt;em&gt;after&lt;/em&gt; your auto-complete configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have &lt;code&gt;auto-complete&lt;/code&gt; installed use the instructions &lt;a href=&quot;https://emacs.stackexchange.com/a/2504/2670&quot;&gt;above&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2670" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-11-22T21:00:36.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3813" PostTypeId="1" AcceptedAnswerId="3817" CreationDate="2014-11-22T22:15:39.587" Score="5" ViewCount="1759" Body="&lt;p&gt;According to &lt;code&gt;describe-key&lt;/code&gt; (&lt;code&gt;C-h k&lt;/code&gt;), every character I type runs &lt;code&gt;self-insert-command&lt;/code&gt; and I suspect that &lt;code&gt;self-insert-command&lt;/code&gt; calls some undocumented hook to perform text completition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to debug &lt;a href=&quot;http://company-mode.github.io&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;company-mode&lt;/code&gt;&lt;/a&gt;, which occasionally fails to complete my input. So, &lt;code&gt;describe-function&lt;/code&gt; says that &lt;code&gt;self-insert-command&lt;/code&gt; calls &lt;code&gt;post-self-insert-hook&lt;/code&gt;. I set it to &lt;code&gt;nil&lt;/code&gt; and tried to type something that would be autocompleted — and it &lt;em&gt;was&lt;/em&gt; completed anyway! In addition to this, &lt;code&gt;self-insert-command&lt;/code&gt; calls &lt;code&gt;expand-abbrev&lt;/code&gt; and &lt;code&gt;auto-fill-function&lt;/code&gt;, but I tried to call both, and neither shows a popup text. So, it seems like every keypress runs some other hook used by &lt;code&gt;company-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that &lt;code&gt;company-complete-common&lt;/code&gt; is the function that does autocompletition, so I set a breakpoint there to find this mysterious hook by using a backtrace. And… it didn't work! It works if I call &lt;code&gt;company-complete-common&lt;/code&gt; interactively, but if I trigger completion by typing a character, and the same window pops up, the breakpoint is ignored!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm out of ideas, I hope somebody knows how this works.&lt;/p&gt;&#xA;" OwnerUserId="2671" LastEditorUserId="2355" LastEditDate="2014-11-23T05:16:46.773" LastActivityDate="2014-11-23T14:34:50.007" Title="What is the hook used by company-mode to perform autocompletion?" Tags="|completion|company-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3814" PostTypeId="2" ParentId="3787" CreationDate="2014-11-22T22:21:10.907" Score="4" Body="&lt;p&gt;This was an interesting one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;html-mode&lt;/code&gt; is derived from &lt;code&gt;sgml-mode&lt;/code&gt;, which uses &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/autotype/Using-Skeletons.html&quot; rel=&quot;nofollow&quot;&gt;skeletons&lt;/a&gt;, which may read input from the minibuffer, which, underneath it all, uses &lt;code&gt;read-char&lt;/code&gt; to get keyboard input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Reading-One-Event.html#index-read_002dchar-1434&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;read-char&lt;/code&gt;&lt;/a&gt; gets one event (one key press) &lt;em&gt;before&lt;/em&gt; the &lt;code&gt;key-translation-map&lt;/code&gt; is used. On top of that, if the &lt;code&gt;help-form&lt;/code&gt; (&lt;code&gt;minibuffer-help-form&lt;/code&gt; when reading from the minibuffer) variable is bound and is not &lt;code&gt;nil&lt;/code&gt;, characters equal to &lt;code&gt;help-char&lt;/code&gt; are captured and trigger the evaluation of &lt;code&gt;help-form&lt;/code&gt; (or &lt;code&gt;minibuffer-help-form&lt;/code&gt;), the value of which, if it is a string, is displayed in the &lt;code&gt;*Char Help*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the problem: &lt;code&gt;C-h&lt;/code&gt; is the default value of &lt;code&gt;help-char&lt;/code&gt;. This makes it impossible to input &lt;code&gt;C-h&lt;/code&gt; (or whatever &lt;code&gt;help-char&lt;/code&gt; is set to) if &lt;code&gt;minibuffer-help-form&lt;/code&gt; is set, and &lt;code&gt;skeleton-read&lt;/code&gt; &lt;em&gt;does&lt;/em&gt; set it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This suggests that the issue described in the question should affect other modes too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;C-h&quot;) (kbd &quot;&amp;lt;DEL&amp;gt;&quot;))&#xA;&#xA;(let ((minibuffer-help-form &quot;Help!&quot;))&#xA;  (read-from-minibuffer &quot;Try using ^H now! &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get around this, you can just&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq help-char nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or customize this variable. This disables evaluation of &lt;code&gt;help-form&lt;/code&gt; and &lt;code&gt;minibuffer-help-form&lt;/code&gt; everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can add advice to &lt;code&gt;skeleton-read&lt;/code&gt; to allow using &lt;code&gt;C-h&lt;/code&gt; in skeleton prompts and keep the default behavior elsewhere:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'skeleton-read :around&#xA;            (lambda (orig &amp;amp;rest args)&#xA;              (let ((help-char nil))&#xA;                (apply orig args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-22T22:49:17.463" LastActivityDate="2014-11-22T22:49:17.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3815" PostTypeId="1" AcceptedAnswerId="3816" CreationDate="2014-11-22T23:27:57.843" Score="1" ViewCount="2105" Body="&lt;p&gt;As a result of an answer in a previous question of mine I am trying to translate  &lt;code&gt;M-RET&lt;/code&gt; in &lt;code&gt;C-u C-RET&lt;/code&gt; using the following code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;M-RET&quot;) (kbd &quot;C-u C-RET&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have used the same code to translate other functions and it worked flawlessly so I don't know what is wrong with it. Does anyone?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="25" LastEditDate="2015-06-07T21:13:37.783" LastActivityDate="2015-06-07T21:13:37.783" Title="Key translation" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3816" PostTypeId="2" ParentId="3815" CreationDate="2014-11-23T00:04:29.147" Score="2" Body="&lt;p&gt;I don't know what is wrong with using &lt;code&gt;key-translation-map&lt;/code&gt; (I hope somebody else will chime in). My guess is that it makes Emacs look up the binding of &lt;code&gt;C-u C-RET&lt;/code&gt;, not &lt;code&gt;C-RET&lt;/code&gt; with a prefix argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This alternative seems to work, though:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-RET&quot;) (kbd &quot;C-u C-&amp;lt;return&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-23T00:04:29.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3817" PostTypeId="2" ParentId="3813" CreationDate="2014-11-23T01:34:08.737" Score="8" Body="&lt;p&gt;Unless you invoke one of the completion commands directly (such as &lt;code&gt;M-x company-complete-common&lt;/code&gt;), the completion maybe-happens and the popup is rendered in &lt;code&gt;company-post-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks at the current command, sees if it satisfies the value of &lt;code&gt;company-begin-commands&lt;/code&gt;, and calls &lt;code&gt;company--perform&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter looks at the buffer contents, and checks whether the prefix value returned by the currently used backend satisfies &lt;code&gt;company-minimum-prefix-length&lt;/code&gt;, if so then asks for completions from the backend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If completions were found, &lt;code&gt;company-post-command&lt;/code&gt; calls all currently configured frontends with an argument &lt;code&gt;post-command&lt;/code&gt;. That's where the popup rendering happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When completion doesn't work (and you don't see any errors in &lt;code&gt;*Messages*&lt;/code&gt;), check whether it works with &lt;code&gt;M-x company-complete-common&lt;/code&gt;, at the same buffer position. If it does, you might need to figure out the exact command your keypress was calling (try &lt;code&gt;C-h k&lt;/code&gt;), and then add it to &lt;code&gt;company-begin-commands&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorUserId="124" LastEditDate="2014-11-23T14:34:50.007" LastActivityDate="2014-11-23T14:34:50.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3818" PostTypeId="2" ParentId="3742" CreationDate="2014-11-23T03:17:11.243" Score="5" Body="&lt;p&gt;Load library &lt;code&gt;simple.el&lt;/code&gt; (not &lt;code&gt;simple.elc&lt;/code&gt;), then do &lt;code&gt;M-x debug-on-entry RET next-line RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use &lt;code&gt;C-n&lt;/code&gt; and step through the debugger using &lt;code&gt;d&lt;/code&gt; (or &lt;code&gt;c&lt;/code&gt; to skip through an evaluation) to see what happens (when the flickering occurs etc.).  If the flicker happens during evaluation of a function call for a function that is not defined in &lt;code&gt;simple.el&lt;/code&gt;, you can load its source file too, to get better debugging about it.  And so on.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update after your comment:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sounds like an error is occurring during redisplay. Typically that is because of one of these:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;An error in &lt;code&gt;post-command-hook&lt;/code&gt; (or perhaps &lt;code&gt;pre-command-hook&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;An error in something that updates the mode line (e.g., something in &lt;code&gt;mode-line-format&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;An error in font-locking.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Check what you are doing in these 3 areas.  Remove stuff from &lt;code&gt;post-command-hook&lt;/code&gt; to see if it stops the flickering. Likewise, if you do anything to the mode line, stop doing it to see if that stops the flickering. Similarly, turn off font-lock mode to see if that helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can stop the flickering this way then you'll know which code to investigate.  You cannot use the debugger on it (because the debugger is inhibited during redisplay). But you can add calls to &lt;code&gt;message&lt;/code&gt; to print program state &amp;amp; other info.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-11-23T06:28:51.207" LastActivityDate="2014-11-23T06:28:51.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3819" PostTypeId="1" AcceptedAnswerId="3820" CreationDate="2014-11-23T04:51:21.950" Score="6" ViewCount="2061" Body="&lt;p&gt;I'm trying to send an Org table as a lisp object to a code block for further processing with an elisp function. For testing I set up two code blocks, one that generates the table and another that receives the table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first block works fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: from-r&#xA;#+BEGIN_SRC R :results value :colnames yes&#xA;  q &amp;lt;- data.frame(something1 = c(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;), something2 = c(1, 5, 100))&#xA;  q&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: from-r&#xA;| something1 | something2 |&#xA;|------------+------------|&#xA;| a          |          1 |&#xA;| b          |          5 |&#xA;| c          |        100 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the second block is not receiving the whole table!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :var the-table=from-r :results output&#xA;  (print the-table)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &#xA;: ((&quot;a&quot; 1) (&quot;b&quot; 5) (&quot;c&quot; 100))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looking at the messages buffer...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;executing R code block (from-r)...&#xA;Wrote /tmp/babel-1755OIV/ob-input-17558YA&#xA;((&quot;something1&quot; &quot;something2&quot;) hline (&quot;a&quot; 1) (&quot;b&quot; 5) (&quot;c&quot; 100))&#xA;executing Emacs-Lisp code block...&#xA;&#xA;(the-table (quote ((&quot;a&quot; 1) (&quot;b&quot; 5) (&quot;c&quot; 100))))&#xA;&#xA;Code block evaluation complete.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...it's clear to me that the output of the 1st block is the complete table but the second block somehow removes the table header. For clarity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Complete table: &lt;code&gt;((&quot;something1&quot; &quot;something2&quot;) hline (&quot;a&quot; 1) (&quot;b&quot; 5) (&quot;c&quot; 100))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Table w/o header: &lt;code&gt;((&quot;a&quot; 1) (&quot;b&quot; 5) (&quot;c&quot; 100))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm I missing something?&lt;/p&gt;&#xA;" OwnerUserId="920" LastActivityDate="2014-11-23T06:26:30.600" Title="Org code block receives table without header" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3820" PostTypeId="2" ParentId="3819" CreationDate="2014-11-23T06:01:48.027" Score="9" Body="&lt;p&gt;You need to add &lt;code&gt;:colnames no&lt;/code&gt; to the second code block. (Org uses &lt;code&gt;org-babel-disassemble-tables&lt;/code&gt; to take apart a table and this function uses &lt;code&gt;:colnames&lt;/code&gt; to decide if it needs to strip column names.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add &lt;code&gt;:hlines yes&lt;/code&gt; to keep &lt;code&gt;hline&lt;/code&gt; too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have R installed, but this seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: make-table&#xA;#+BEGIN_SRC elisp :results value&#xA;'((&quot;something1&quot; &quot;something2&quot;) hline (&quot;a&quot; 1) (&quot;b&quot; 5) (&quot;c&quot; 100))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: make-table&#xA;| something1 | something2 |&#xA;|------------+------------|&#xA;| a          |          1 |&#xA;| b          |          5 |&#xA;| c          |        100 |&#xA;&#xA;#+BEGIN_SRC elisp :var table=make-table :results output :colnames no&#xA;(print table)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &#xA;: ((&quot;something1&quot; &quot;something2&quot;) (&quot;a&quot; 1) (&quot;b&quot; 5) (&quot;c&quot; 100))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-23T06:26:30.600" LastActivityDate="2014-11-23T06:26:30.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3821" PostTypeId="1" AcceptedAnswerId="3822" CreationDate="2014-11-23T07:48:54.483" Score="22" ViewCount="4418" Body="&lt;p&gt;The function &lt;code&gt;line-number-at-pos&lt;/code&gt; (when repeated about 50 times) is causing a noticeable slow-down in semi-large buffers -- e.g., 50,000 lines -- when point is near the end of the buffer.  By slow-down, I mean a combined total of about 1.35 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of using a 100% &lt;code&gt;elisp&lt;/code&gt; funciton to count-lines and goto the top of the buffer, I'd be interested in a hybrid method that taps into the built-in C abilities responsible for the line number appearing on the mode-line.  The line-number that appears on the mode-line occurs at light speed, regardless of the size of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a test function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro measure-time (&amp;amp;rest body)&#xA;&quot;Measure the time it takes to evaluate BODY.&#xA;http://lists.gnu.org/archive/html/help-gnu-emacs/2008-06/msg00087.html&quot;&#xA;  `(let ((time (current-time)))&#xA;     ,@body&#xA;     (message &quot;%.06f&quot; (float-time (time-since time)))))&#xA;&#xA;(measure-time&#xA;  (let* (&#xA;      line-numbers&#xA;      (window-start (window-start))&#xA;      (window-end (window-end)))&#xA;    (save-excursion&#xA;      (goto-char window-end)&#xA;      (while&#xA;        (re-search-backward &quot;\n&quot; window-start t)&#xA;        (push (line-number-at-pos) line-numbers)))&#xA;    line-numbers))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-11-23T08:00:39.257" LastActivityDate="2021-05-02T01:06:35.180" Title="A faster method to obtain `line-number-at-pos` in large buffers" Tags="|elisp|mode-line|line-numbers|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3822" PostTypeId="2" ParentId="3821" CreationDate="2014-11-23T08:05:48.703" Score="20" Body="&lt;p&gt;Try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-to-number (format-mode-line &quot;%l&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can extract other information using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/_0025_002dConstructs.html#g_t_0025_002dConstructs&quot; rel=&quot;noreferrer&quot;&gt;%-Constructs&lt;/a&gt; described in the Emacs Lisp Manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Caveat:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In addition&lt;/em&gt; to limitations pointed out by &lt;strong&gt;wasamasa&lt;/strong&gt;  and &lt;strong&gt;Stefan&lt;/strong&gt; (see comments below) this does not work for buffers that are not displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (dotimes (i 10000)&#xA;    (insert (format &quot;%d\n&quot; i)))&#xA;  (string-to-number (format-mode-line &quot;%l&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and compare to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (dotimes (i 10000)&#xA;    (insert (format &quot;%d\n&quot; i)))&#xA;  (line-number-at-pos))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-23T17:52:03.927" LastActivityDate="2014-11-23T17:52:03.927" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3823" PostTypeId="1" AcceptedAnswerId="3826" CreationDate="2014-11-23T09:11:30.380" Score="2" ViewCount="310" Body="&lt;p&gt;I'm omitting certain files in dired mode using this hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'dired-mode-hook (lambda () (dired-omit-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible for me to display parent directory &lt;code&gt;..&lt;/code&gt; in the omit-mode ?&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2014-11-23T17:05:18.447" Title="Dired show specific files in default omit-mode" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3824" PostTypeId="1" AcceptedAnswerId="3827" CreationDate="2014-11-23T09:43:32.350" Score="25" ViewCount="2907" Body="&lt;p&gt;I'm using &lt;code&gt;line-number-mode&lt;/code&gt; to have an indicator of the current line in my modeline, however for large files or rather, files with long lines, it starts displaying two question marks instead of a line number. I've digged a bit and found out that while &lt;code&gt;line-number-mode&lt;/code&gt; is defined in &lt;code&gt;simple.el&lt;/code&gt;, the customizable variables (and probably all logic involved) are defined in &lt;code&gt;xdisp.c&lt;/code&gt;.  Changing the &lt;code&gt;line-number-display-width&lt;/code&gt; variable to an arbitrarily high number might fix this, but I'm far more interested in the piece of code and the logic that makes it print the two question marks. It'd be very useful if any of you could find it for me, maybe even explain the logic behind it.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="50" LastEditDate="2014-11-23T13:02:22.083" LastActivityDate="2015-04-22T09:16:47.670" Title="What piece of code in Emacs makes `line-number-mode` print &quot;??&quot; as line number in buffers with long lines?" Tags="|mode-line|emacs-internals|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3825" PostTypeId="1" CreationDate="2014-11-23T10:34:35.267" Score="3" ViewCount="822" Body="&lt;p&gt;&lt;em&gt;How do I get key-chords to work with &lt;code&gt;evil&lt;/code&gt; and alternate input-methods?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I enabled Korean input by &lt;code&gt;M-x set-input-method&lt;/code&gt; and chose &lt;code&gt;korean-hangul&lt;/code&gt;, which I found from following the first few instructions from &lt;a href=&quot;http://www.emacswiki.org/emacs/WritingKorean&quot; rel=&quot;nofollow&quot;&gt;this Emacs Wiki&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;evil-mode&lt;/code&gt;, which I really enjoy, but my custom &quot;smash escape&quot; function does not work. The function allows me to exit &lt;code&gt;insert&lt;/code&gt; state by quickly pressing &lt;code&gt;jk&lt;/code&gt; or &lt;code&gt;kj&lt;/code&gt;. Here are the functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Set 'kj' to exit insert mode&#xA;(define-key evil-insert-state-map &quot;k&quot; #'cofi/maybe-exit-kj)&#xA;(evil-define-command cofi/maybe-exit-kj ()&#xA;  :repeat change&#xA;  (interactive)&#xA;  (let ((modified (buffer-modified-p)))&#xA;    (insert &quot;k&quot;)&#xA;    (let ((evt (read-event (format &quot;Insert %c to exit insert state&quot; ?j)&#xA;               nil 0.5)))&#xA;      (cond&#xA;       ((null evt) (message &quot;&quot;))&#xA;       ((and (integerp evt) (char-equal evt ?j))&#xA;    (delete-char -1)&#xA;    (set-buffer-modified-p modified)&#xA;    (push 'escape unread-command-events))&#xA;       (t (setq unread-command-events (append unread-command-events&#xA;                          (list evt))))))))&#xA;&#xA;(define-key evil-insert-state-map &quot;j&quot; #'cofi/maybe-exit-jk)&#xA;(evil-define-command cofi/maybe-exit-jk ()&#xA;  :repeat change&#xA;  (interactive)&#xA;  (let ((modified (buffer-modified-p)))&#xA;    (insert &quot;j&quot;)&#xA;    (let ((evt (read-event (format &quot;Insert %c to exit insert state&quot; ?k)&#xA;               nil 0.5)))&#xA;      (cond&#xA;       ((null evt) (message &quot;&quot;))&#xA;       ((and (integerp evt) (char-equal evt ?k))&#xA;    (delete-char -1)&#xA;    (set-buffer-modified-p modified)&#xA;    (push 'escape unread-command-events))&#xA;       (t (setq unread-command-events (append unread-command-events&#xA;                          (list evt))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My attempt was to substitute &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; with the corresponding Korean characters. Here is my attempt at re-implementing the &lt;code&gt;kj&lt;/code&gt; smash escape, where the character &lt;code&gt;ㅏ&lt;/code&gt; is bound to &lt;code&gt;k&lt;/code&gt; and the character &lt;code&gt;ㅓ&lt;/code&gt; is bound to &lt;code&gt;j&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map &quot;ㅏ&quot; #'cofi/maybe-exit-ㅏㅓ)&#xA;;; Set 'ㅏㅓ' to exit insert mode&#xA;(evil-define-command cofi/maybe-exit-ㅏㅓ ()&#xA;  :repeat change&#xA;  (interactive)&#xA;  (let ((modified (buffer-modified-p)))&#xA;    (insert &quot;ㅏ&quot;)&#xA;    (let ((evt (read-event (format &quot;Insert %c to exit insert state&quot; ?ㅓ)&#xA;               nil 0.5)))&#xA;      (cond&#xA;       ((null evt) (message &quot;&quot;))&#xA;       ((and (integerp evt) (char-equal evt ?ㅓ))&#xA;    (delete-char -1)&#xA;    (set-buffer-modified-p modified)&#xA;    (push 'escape unread-command-events))&#xA;       (t (setq unread-command-events (append unread-command-events&#xA;                          (list evt))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All I did was substitute &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; with &lt;code&gt;ㅓ&lt;/code&gt; and &lt;code&gt;ㅏ&lt;/code&gt;, respectively. Unfortunately, it does not work. Any suggestions on how to proceed?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="253" LastEditDate="2014-11-23T13:15:51.513" LastActivityDate="2014-11-23T13:27:11.330" Title="How to add a key-chord escape in Evil for input in other languages?" Tags="|key-bindings|evil|input-method|key-chord-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3826" PostTypeId="2" ParentId="3823" CreationDate="2014-11-23T11:17:24.950" Score="3" Body="&lt;p&gt;Yes, the &lt;code&gt;dired-omit-files&lt;/code&gt; variable controls this. (Note that &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;dired-omit-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; tells you this.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had the same requirement because, although I prefer to use &lt;code&gt;dired-jump&lt;/code&gt; when I want to open an &lt;em&gt;additional&lt;/em&gt; dired buffer for the parent directory, I regularly use &lt;kbd&gt;a&lt;/kbd&gt; on the &lt;code&gt;..&lt;/code&gt; entry to &lt;em&gt;replace&lt;/em&gt; the original dired buffer with its parent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also including the advice I wrote to revert (buffer-locally) this behaviour automatically when inserting subdirectory contents, because I realised I never want the &lt;code&gt;..&lt;/code&gt; entry in those listings.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Do not omit .. in dired -- it's useful...&#xA;(setq dired-omit-files &quot;^\\.?#\\|^\\.$&quot;)&#xA;;; ...except when we are inserting sub-directories,&#xA;;; as it just makes things messy in those cases.&#xA;(defadvice dired-insert-subdir (before my-dired-omit-parents)&#xA;  &quot;Omit parent .. directories if inserting subdirectories.&quot;&#xA;  (setq-local dired-omit-files &quot;^\\.?#\\|^\\.$\\|^\\.\\.$&quot;))&#xA;(ad-activate 'dired-insert-subdir)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That advice does mean that if you refresh the entire buffer after inserting a sub-directory, you once again lose the top-most &lt;code&gt;..&lt;/code&gt; entry. In practice I find this isn't a problem for me, because inserting subdirectories typically means I'm building dired contents that I want to keep around for a while, and therefore I'm unlikely to want to replace that buffer with a different one.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; This Q&amp;amp;A did make me question whether what I really wanted was a convenient way to tell &lt;code&gt;dired-jump&lt;/code&gt; to kill the buffer of origin, given that navigating to the &lt;code&gt;..&lt;/code&gt; entry is sometimes annoying. Here's some code to do that.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-dired-jump (arg)&#xA;  &quot;Like `dired-jump', but a single (C-u) prefix arg means \&quot;replace the&#xA;current buffer with the target dired buffer\&quot; (i.e. kill the original&#xA;buffer). A double (C-u C-u) prefix argument triggers the normal prefix&#xA;argument behaviour of `dired-jump'.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (cond&#xA;   ((equal arg '(4))&#xA;    (let ((origin (current-buffer))&#xA;          (current-prefix-arg nil))&#xA;      (call-interactively 'dired-jump)&#xA;      (kill-buffer origin)))&#xA;   ((equal arg '(16))&#xA;    (let ((current-prefix-arg '(4)))&#xA;      (call-interactively 'dired-jump)))&#xA;   (t&#xA;    (call-interactively 'dired-jump))))&#xA;&#xA;(eval-after-load 'dired-x&#xA;  '(global-set-key [remap dired-jump] 'my-dired-jump))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-23T12:34:45.210" LastActivityDate="2014-11-23T12:34:45.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3827" PostTypeId="2" ParentId="3824" CreationDate="2014-11-23T11:27:02.977" Score="31" Body="&lt;p&gt;Thanks to @lunaryorn's suggestions I've been able to locate the piece of code causing this. It looks like &lt;code&gt;format-mode-line&lt;/code&gt; eventually calls &lt;code&gt;decode_mode_spec&lt;/code&gt; to turn the format codes given into values. For the case of &lt;code&gt;%l&lt;/code&gt; this function does a few sanity checks to avoid spending too much time calculating, then checks whether the current line is exceeding &lt;code&gt;line-number-display-limit-width&lt;/code&gt;. Since that is the case for my file in question, it jumps to a &lt;code&gt;no_value&lt;/code&gt; label which returns a padded &lt;code&gt;??&lt;/code&gt; as value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Solving&quot; this involves setting the variable to a sufficiently high value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq line-number-display-limit-width 2000000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This value was derived by looking at the corresponding heuristics in &lt;code&gt;xdisp.c&lt;/code&gt; which takes the window height times two plus thirty and multiplies it with &lt;code&gt;line-number-display-limit-width&lt;/code&gt;, to avoid overflowing &lt;code&gt;most-positive-fixnum&lt;/code&gt; on a 32bit system, a value of 2000000 would be a safe bet.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-04-22T09:16:47.670" LastActivityDate="2015-04-22T09:16:47.670" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3828" PostTypeId="2" ParentId="3825" CreationDate="2014-11-23T13:12:57.737" Score="2" Body="&lt;p&gt;First of all, I presume you're aware of &lt;a href=&quot;http://www.emacswiki.org/KeyChord&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;key-chord&lt;/code&gt;&lt;/a&gt; (see also &lt;a href=&quot;https://stackoverflow.com/questions/19150003/binding-the-escape-key-to-a-keychord-for-evil-mode&quot;&gt;this SO thread&lt;/a&gt;).  I've never used it, and have hazy memories that it &lt;a href=&quot;http://emacsredux.com/blog/2013/04/28/execute-commands-ninja-style-with-key-chord-mode/&quot; rel=&quot;nofollow noreferrer&quot;&gt;doesn't always interact well with &lt;code&gt;evil&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer is 95% of the way there.  The last snag looks like it's in the actual binding of the key, but I don't know how to fix it because I don't know how Korean input methods work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a version using &lt;em&gt;Arabic&lt;/em&gt; (helpful, right?) that &lt;em&gt;does&lt;/em&gt; work; I've left comments on which lines you need to change to switch it over to Korean:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-command cofi/maybe-exit-kj ()&#xA;  :repeat change&#xA;  (interactive)&#xA;  (let ((modified (buffer-modified-p)))&#xA;    (self-insert-command 1)&#xA;    (let ((evt (read-event (format &quot;Insert %c to exit insert state&quot;&#xA;                                   (if (equal current-input-method&#xA;                                              &quot;arabic&quot;) ; &quot;korean-hangul&quot;&#xA;                                       ?ؤ               ; ?ㅓ&#xA;                                     ?j))&#xA;                           nil 0.5)))&#xA;      (cond&#xA;       ((null evt) (message &quot;&quot;))&#xA;       ((and (integerp evt) (memq evt '(?j ?ؤ))) ; '(?j ?ㅓ)&#xA;        (delete-char -1)&#xA;        (set-buffer-modified-p modified)&#xA;        (push 'escape unread-command-events))&#xA;       (t&#xA;        (setq unread-command-events (append unread-command-events&#xA;                                            (list evt))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now: it turns out that you also need to bind the key in the relevant alphabet to this function as well (with &lt;code&gt;ر&lt;/code&gt; standing in for the &lt;code&gt;k&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map &quot;ر&quot; #'cofi/maybe-exit-kj) ; &quot;ㅏ&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like the problem is with the &lt;code&gt;define-key&lt;/code&gt; part:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-my-key ()&#xA;  (interactive)&#xA;  (self-insert-command 1)&#xA;  (message &quot;This key works!&quot;)&#xA;  (sit-for 2))&#xA;&#xA;(define-key evil-insert-state-map &quot;a&quot; #'test-my-key)&#xA;(define-key evil-insert-state-map &quot;ㅏ&quot; #'test-my-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, when entering &lt;code&gt;a&lt;/code&gt;, it self-inserts an &lt;code&gt;a&lt;/code&gt; into the buffer, but you don't get anything when entering &lt;code&gt;ㅏ&lt;/code&gt; -- I presume because Emacs is waiting for you to complete the character with another key?  At any rate, you'll know better how to deal with Korean input methods, so will be able to adjust the function as needed.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-11-23T13:27:11.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3829" PostTypeId="2" ParentId="3821" CreationDate="2014-11-23T14:54:18.403" Score="5" Body="&lt;p&gt;nlinum.el uses the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar nlinum--line-number-cache nil)&#xA;(make-variable-buffer-local 'nlinum--line-number-cache)&#xA;&#xA;;; We could try and avoid flushing the cache at every change, e.g. with:&#xA;;;   (defun nlinum--before-change (start _end)&#xA;;;     (if (and nlinum--line-number-cache&#xA;;;              (&amp;lt; start (car nlinum--line-number-cache)))&#xA;;;         (save-excursion (goto-char start) (nlinum--line-number-at-pos))))&#xA;;; But it's far from clear that it's worth the trouble.  The current simplistic&#xA;;; approach seems to be good enough in practice.&#xA;&#xA;(defun nlinum--after-change (&amp;amp;rest _args)&#xA;  (setq nlinum--line-number-cache nil))&#xA;&#xA;(defun nlinum--line-number-at-pos ()&#xA;  &quot;Like `line-number-at-pos' but sped up with a cache.&quot;&#xA;  ;; (assert (bolp))&#xA;  (let ((pos&#xA;         (if (and nlinum--line-number-cache&#xA;                  (&amp;gt; (- (point) (point-min))&#xA;                     (abs (- (point) (car nlinum--line-number-cache)))))&#xA;             (funcall (if (&amp;gt; (point) (car nlinum--line-number-cache))&#xA;                          #'+ #'-)&#xA;                      (cdr nlinum--line-number-cache)&#xA;                      (count-lines (point) (car nlinum--line-number-cache)))&#xA;           (line-number-at-pos))))&#xA;    ;;(assert (= pos (line-number-at-pos)))&#xA;    (setq nlinum--line-number-cache (cons (point) pos))&#xA;    pos))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the following extra config in the mode function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-change-functions #'nlinum--after-change nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-23T14:54:18.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3830" PostTypeId="1" AcceptedAnswerId="3836" CreationDate="2014-11-23T15:44:24.800" Score="20" ViewCount="2639" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Why does &lt;code&gt;lisp-interaction-mode&lt;/code&gt; exist, and are there any reasons to use it instead of &lt;code&gt;emacs-lisp-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Executing-Lisp.html&quot;&gt;manual&lt;/a&gt; states that &lt;code&gt;emacs-lisp-mode&lt;/code&gt; and &lt;code&gt;lisp-interaction-mode&lt;/code&gt; are identical except that the latter binds &lt;code&gt;C-j&lt;/code&gt; to &lt;code&gt;eval-print-last-sexp&lt;/code&gt;.  Beyond that, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Interaction.html&quot;&gt;&quot;all other commands in Lisp Interaction mode are the same as in Emacs Lisp mode.&quot;&lt;/a&gt;  As far as I can tell, only the &lt;code&gt;*scratch*&lt;/code&gt; buffer uses the latter mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It strikes me as odd that there is an entire mode that differs from another by only a single keybinding, so I presume I'm missing either some history or context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why does &lt;code&gt;lisp-interaction-mode&lt;/code&gt; exist?&lt;/li&gt;&#xA;&lt;li&gt;Not counting the &lt;code&gt;C-j&lt;/code&gt; keybinding, are there any circumstances in which it would be preferable to &lt;code&gt;emacs-lisp-mode&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Would there be any unexpected consequences to &lt;a href=&quot;http://emacsredux.com/blog/2014/07/25/configure-the-scratch-buffers-mode/&quot;&gt;changing the &lt;code&gt;*scratch*&lt;/code&gt; buffer's mode to &lt;code&gt;emacs-lisp-mode&lt;/code&gt;&lt;/a&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The motivation for this question is that, right now, I'm binding keys twice (in the two modes) so that my &lt;code&gt;*scratch*&lt;/code&gt; buffer behaves like buffers visiting &lt;code&gt;*.el&lt;/code&gt; files.  If there's no practical reason to keep &lt;code&gt;lisp-interaction-mode&lt;/code&gt; around, I'll just &lt;code&gt;(setq initial-major-mode 'emacs-lisp-mode)&lt;/code&gt; and be done with it.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2023-01-15T14:27:20.280" Title="Why does lisp-interaction-mode exist, and do we ever need it?" Tags="|elisp|emacs-lisp-mode|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3831" PostTypeId="2" ParentId="3830" CreationDate="2014-11-23T15:53:28.067" Score="4" Body="&lt;p&gt;FWIW, I use &lt;code&gt;emacs-lisp-mode&lt;/code&gt; in the &lt;code&gt;*scratch*&lt;/code&gt; buffer myself. If I wish to evaluate something, I just do &lt;kbd&gt;C-x C-e&lt;/kbd&gt;, with a &lt;kbd&gt;C-u&lt;/kbd&gt; prefix when needed. I see no downside to this practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to why the mode is there, it is just a few lines of lisp code in &lt;code&gt;elisp-mode.el&lt;/code&gt;, and it's been there like &lt;em&gt;forever&lt;/em&gt;, so removing it seems pointless.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2014-11-23T15:53:28.067" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3832" PostTypeId="2" ParentId="3830" CreationDate="2014-11-23T16:01:14.817" Score="15" Body="&lt;p&gt;A new derived mode is cheap: &lt;code&gt;lisp-interaction-mode&lt;/code&gt; inherits from &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, its implementation is just a dozen lines of code or so.  It differs from &lt;code&gt;emacs-lisp-mode&lt;/code&gt; in just the following ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it has a different name;&lt;/li&gt;&#xA;&lt;li&gt;it has a different keymap;&lt;/li&gt;&#xA;&lt;li&gt;it has a different syntax table;&lt;/li&gt;&#xA;&lt;li&gt;it has an additional hook.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On the other hand, it shares its abbrev table with &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; as noted by @phils in his answer (which see), the keymaps of &lt;code&gt;emacs-lisp-mode&lt;/code&gt; and &lt;code&gt;lisp-interaction-mode&lt;/code&gt; share a common parent, &lt;code&gt;lisp-mode-shared-map&lt;/code&gt;.  There is therefore no reason to duplicate keybindings — just define them in &lt;code&gt;lisp-mode-shared-map&lt;/code&gt;, and they will apply to both modes (and &lt;code&gt;lisp-mode&lt;/code&gt; too, but that's probably fine).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Would there be any unexpected consequences to changing the &lt;code&gt;*scratch*&lt;/code&gt; buffer's mode to &lt;code&gt;emacs-lisp-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The most obvious consequence would be that &lt;code&gt;lisp-interaction-mode-hook&lt;/code&gt; would no longer be run in the &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2014-11-26T12:35:54.463" LastActivityDate="2014-11-26T12:35:54.463" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3833" PostTypeId="2" ParentId="3823" CreationDate="2014-11-23T17:05:18.447" Score="3" Body="&lt;p&gt;You can use options &lt;code&gt;dired-omit-files&lt;/code&gt; (mentioned by @phils) and &lt;code&gt;dired-omit-extensions&lt;/code&gt; to control what gets omitted by default.  You can of course also bind these variables in commands you write. As @phils also mentioned, use &lt;code&gt;C-h f dired-omit-mode&lt;/code&gt; as your starting point for information about omitting entries in Dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also bookmark Dired buffers that you use frequently. If you use &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then Dired bookmarks record the current omit settings (and markings and subdir insertions etc.).  That gives you a quick way to &quot;jump&quot; to a Dired buffer with particular omit settings.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-23T17:05:18.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3834" PostTypeId="2" ParentId="2671" CreationDate="2014-11-23T17:37:13.193" Score="5" Body="&lt;p&gt;As was mentioned in a comment earlier, &lt;code&gt;ycmd&lt;/code&gt; supports fuzzy matching. You can using it via &lt;code&gt;company-ycmd&lt;/code&gt;. Configured properly, you can get language-specific completion as well as simple identifier-based completion in a pretty seamless experience.&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2014-11-23T17:37:13.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3835" PostTypeId="1" AcceptedAnswerId="4264" CreationDate="2014-11-23T21:24:38.327" Score="2" ViewCount="585" Body="&lt;p&gt;I tried to follow &lt;a href=&quot;http://www.emacswiki.org/JabberEl&quot; rel=&quot;nofollow&quot;&gt;emacswiki article about Jabber.el&lt;/a&gt; to configure it on my Emacs. However, my changes do not works.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Alerts stealth the minibuffer, and its annoying to see an alert when I'm doing something there.&lt;/li&gt;&#xA;&lt;li&gt;I get alerts for every message people send to MUCs, which is something I would really like to avoid and instead being alerted when somebody highlights me.&lt;/li&gt;&#xA;&lt;li&gt;I cannot set xmessage for alerts (I tried linnotify, but it doesn't works; maybe is something with my tiled window manager SpectrWM), and when some activity happens the MUC's name is added to the modeline, clobbering it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Jabber.el is a great package, but this things make it annoying and distracting, how can I fix them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs conf for Jabber.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf&#xA; jabber-history-enabled t&#xA; jabber-use-global-history nil&#xA; jabber-backlog-number 40&#xA; jabber-backlog-days 30&#xA; jabber-alert-presence-message-function (lambda (who oldstatus newstatus statusnext) nil)&#xA; jabber-invalid-certificate-servers '(&quot;chat.deshackra.com&quot;)&#xA;)&#xA;&#xA;(defun notify-jabber-notify (from buf text proposed-alert)&#xA;  &quot;Notifica sobre nuevos mensajes en Jabber vía notify.el&quot;&#xA;  (when (or jabber-message-alert-same-buffer&#xA;           (not (memq (selected-window) (get-buffer-window-list buf))))&#xA;    (if (jabber-muc-sender-p from)&#xA;        (notify (format &quot;(MP) %s&quot;&#xA;                        (jabber-jid-displayname (jabber-jid-user from)))&#xA;                (format &quot;%s: %s&quot; (jabber-jid-resource from) text)))&#xA;    (notify (format &quot;%s&quot; (jabber-jid-displayname from))&#xA;            text)))&#xA;&#xA;(defun my-jabber-chat-delete-or-bury ()&#xA;  (interactive)&#xA;  (if (eq 'jabber-chat-mode major-mode)&#xA;      (condition-case e &#xA;          (delete-frame)&#xA;        (error &#xA;         (if (string= &quot;Attempt to delete the sole visible or iconified frame&quot; &#xA;                      (cadr e))&#xA;             (bury-buffer))))))&#xA;&#xA;;;(define-key jabber-chat-mode-map [escape] 'my-jabber-chat-delete-or-bury)&#xA;;;(add-hook 'jabber-alert-message-hooks 'notify-jabber-notify)&#xA;&#xA;(if (daemonp)&#xA;    ;; nos conecta a todas las cuentas jabber!&#xA;    (progn &#xA;      (load-file (expand-file-name &quot;jabber.secret.gpg&quot; user-emacs-directory))&#xA;      (ignore-errors &#xA;        (jabber-connect-all))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="690" LastEditorUserId="2264" LastEditDate="2014-12-10T18:54:23.607" LastActivityDate="2014-12-10T18:54:23.607" Title="Make Jabber.el stop alerting me when new messages are written on MUC, unless I'm highlighted" Tags="|jabber|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3836" PostTypeId="2" ParentId="3830" CreationDate="2014-11-23T21:25:04.123" Score="14" Body="&lt;p&gt;Unless you hate the &lt;code&gt;C-j&lt;/code&gt; behaviour (and I'm sure most elisp authors find it handy), just keep things the way they are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define your keys for &lt;code&gt;lisp-mode-shared-map&lt;/code&gt; instead of duplicating them for the mode-specific keymaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of &lt;code&gt;lisp-mode-map&lt;/code&gt;, &lt;code&gt;emacs-lisp-mode-map&lt;/code&gt;, and &lt;code&gt;lisp-interaction-mode-map&lt;/code&gt; have &lt;code&gt;lisp-mode-shared-map&lt;/code&gt; as their parent keymap.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-11-23T21:25:04.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3837" PostTypeId="5" CreationDate="2014-11-23T21:25:06.010" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-11-23T21:25:06.010" LastActivityDate="2014-11-23T21:25:06.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3838" PostTypeId="4" CreationDate="2014-11-23T21:25:06.010" Score="0" Body="jabber.el aims to be a minimal Jabber client." OwnerUserId="690" LastEditorUserId="690" LastEditDate="2014-11-24T07:28:12.733" LastActivityDate="2014-11-24T07:28:12.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3839" PostTypeId="2" ParentId="3815" CreationDate="2014-11-23T21:27:20.430" Score="9" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#Translation-Keymaps&quot; rel=&quot;nofollow noreferrer&quot;&gt;input translation maps&lt;/a&gt; (&lt;code&gt;input-decode-map&lt;/code&gt;, &lt;code&gt;local-function-key-map&lt;/code&gt;, &lt;code&gt;function-key-map&lt;/code&gt;, &lt;code&gt;key-translation-map&lt;/code&gt;) apply only within a key sequence. While you can specify multiple keys in the output of the translation, they'll only be counted towards binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map [f12] [?\C-x ?\C-f ?a])&#xA;(define-key key-translation-map [f11] [?\C-u C-return])&#xA;(define-key key-translation-map [f10] &quot;abc&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;F12&lt;/kbd&gt; is translated to &lt;code&gt;C-x C-f a&lt;/code&gt;. The key sequence &lt;code&gt;C-x C-f&lt;/code&gt; is bound to &lt;code&gt;find-file&lt;/code&gt;, so pressing &lt;kbd&gt;F12&lt;/kbd&gt; will invoke &lt;code&gt;find-file&lt;/code&gt;, and the extra &lt;code&gt;a&lt;/code&gt; input event will be discarded. Similarly, &lt;kbd&gt;F11&lt;/kbd&gt; is translated to &lt;code&gt;C-u C-return&lt;/code&gt;, which invokes &lt;code&gt;universal-argument&lt;/code&gt; and discards the extraneous event &lt;code&gt;C-return&lt;/code&gt;. Pressing &lt;kbd&gt;F10&lt;/kbd&gt; invokes the command bound to &lt;code&gt;a&lt;/code&gt;, which is &lt;code&gt;self-insert-command&lt;/code&gt;; the character &lt;code&gt;c&lt;/code&gt; is actually inserted, because &lt;code&gt;self-insert-command&lt;/code&gt; inserts the character based on the last input event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;code&gt;M-RET&lt;/code&gt; to be equivalent to &lt;code&gt;C-u C-return&lt;/code&gt; in all contexts where &lt;code&gt;M-RET&lt;/code&gt; is not bound, then you can bind it in the global keymap. In keymaps other than the translation maps, if the binding for a key is an array of events (such as constructed by &lt;code&gt;kbd&lt;/code&gt;) or a string, then the binding is interpreted as a sequence of events to replay — a macro. Note that &lt;code&gt;C-RET&lt;/code&gt; isn't normally generated; &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Return&lt;/kbd&gt; is &lt;code&gt;C-return&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-RET&quot;) (kbd &quot;C-u C-&amp;lt;return&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Given that &lt;code&gt;C-return&lt;/code&gt; is not globally bound by default, it would probably make more sense to define &lt;code&gt;M-RET&lt;/code&gt; in the mode where you want to use it. It would be clearer to bind &lt;code&gt;M-RET&lt;/code&gt; to a function which does whatever you want — if &lt;code&gt;C-return&lt;/code&gt; invokes &lt;code&gt;foo-frobnicate&lt;/code&gt; then you might do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo-frobnicate-harder ()&#xA;  (interactive)&#xA;  (frobnicate t))&#xA;(define-key foo-mode-map (kbd &quot;M-RET&quot;) 'foo-frobnicate-harder)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you really want &lt;code&gt;M-RET&lt;/code&gt; to be equivalent to &lt;code&gt;C-u C-return&lt;/code&gt; in every context, you can stuff events into &lt;code&gt;unread-command-events&lt;/code&gt; — see &lt;a href=&quot;https://emacs.stackexchange.com/questions/967/simulating-mouse-operations-with-keyboard/999#999&quot;&gt;Simulating mouse operations with keyboard&lt;/a&gt; for an example.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-23T21:27:20.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3840" PostTypeId="1" AcceptedAnswerId="3843" CreationDate="2014-11-23T21:29:30.443" Score="8" ViewCount="1108" Body="&lt;p&gt;I'm looking for a means to extract individual &lt;em&gt;and&lt;/em&gt; marked files from archives (e.g., *.zip; *.gz, etc.) to the hard-drive (without opening them in a buffer) using &lt;code&gt;archive-mode&lt;/code&gt;.  A suggested modification of that major-mode (that would permit this new feature) will be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Archives.html&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Archives.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-11-25T08:06:11.063" Title="Extract file(s) to hard-drive from `archive-mode`" Tags="|elisp|archive-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3841" PostTypeId="2" ParentId="3808" CreationDate="2014-11-23T23:30:27.417" Score="2" Body="&lt;p&gt;When a file is loaded, &lt;code&gt;load-file-name&lt;/code&gt; is set. When a form is evaluated interactively from a file, &lt;code&gt;buffer-file-name&lt;/code&gt; is set. So you can use &lt;code&gt;(or load-file-name buffer-file-name)&lt;/code&gt; as the value of a global variable. You can then use &lt;code&gt;file-name-directory&lt;/code&gt; and such to get parent directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use the f.el file name library, you can use something like &lt;code&gt;(f-parent (f-dirname (f-this-file)))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-11-23T23:30:27.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3842" PostTypeId="1" AcceptedAnswerId="3851" CreationDate="2014-11-23T23:56:22.383" Score="11" ViewCount="2478" Body="&lt;p&gt;With that I mean UI elements (for example text fields and animated buttons) that are not restricted to the monospaced character grid of terminal emulators, but can be arbitrary shapes at arbitrary pixel positions on the screen.  I’m simply curious whether and how that is possible, and if it’s not possible, whether it’s planned for the future.&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="25" LastEditDate="2014-11-24T19:39:14.270" LastActivityDate="2018-03-04T01:18:04.407" Title="How can I draw pixel- or vector-based UI elements in Emacs?" Tags="|elisp|editing|images|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3843" PostTypeId="2" ParentId="3840" CreationDate="2014-11-24T00:48:12.813" Score="7" Body="&lt;p&gt;Here's a sketch of an implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Archive mode stores maps from archive types to commands used to extract data in variables &lt;code&gt;archive-TYPE-extract&lt;/code&gt;; we can find the right variable using &lt;code&gt;(archive-name &quot;extract&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All commands are tailored for extracting to standard out; luckily we can still use them if we redirect &lt;code&gt;stdout&lt;/code&gt; to a file of our choice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun archive-extract-to-file (archive-name item-name command dir)&#xA;  &quot;Extract ITEM-NAME from ARCHIVE-NAME using COMMAND. Save to&#xA;DIR.&quot;&#xA;  (unwind-protect&#xA;      ;; remove the leading / from the file name to force&#xA;      ;; expand-file-name to interpret its path as relative to dir&#xA;      (let* ((file-name (if (string-match &quot;\\`/&quot; item-name)&#xA;                            (substring item-name 1)&#xA;                          item-name))&#xA;             (output-file (expand-file-name file-name dir))&#xA;             (output-dir (file-name-directory output-file)))&#xA;        ;; create the output directory (and its parents) if it does&#xA;        ;; not exist yet&#xA;        (unless (file-directory-p output-dir)&#xA;          (make-directory output-dir t))&#xA;        ;; execute COMMAND, redirecting output to output-file&#xA;        (apply #'call-process&#xA;               (car command)            ;program&#xA;               nil                      ;infile&#xA;               `(:file ,output-file)    ;destination&#xA;               nil                      ;display&#xA;               (append (cdr command) (list archive-name item-name))))&#xA;    ;; FIXME: add unwind forms&#xA;    nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I modified &lt;code&gt;archive-extract-by-file&lt;/code&gt; to get this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun archive-extract-marked-to-file (output-dir)&#xA;  &quot;Extract marked archive items to OUTPUT-DIR.&quot;&#xA;  (interactive &quot;sOutput directory: &quot;)&#xA;  (let ((command (symbol-value (archive-name &quot;extract&quot;)))&#xA;        (archive (buffer-file-name))&#xA;        (items (archive-get-marked ?* t))) ; get marked items; t means&#xA;                                           ; get item under point if&#xA;                                           ; nothing is marked&#xA;    (mapc&#xA;     (lambda (item)&#xA;       (archive-extract-to-file archive&#xA;                                (aref item 0) ; get the name from the descriptor&#xA;                                command output-dir))&#xA;     items)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here I use &lt;code&gt;mapc&lt;/code&gt; to loop over all marked files and extract them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we just need to add a key binding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'arc-mode)&#xA;(define-key archive-mode-map &quot;F&quot; #'archive-extract-marked-to-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tested this on a dummy &lt;code&gt;.zip&lt;/code&gt; file containing a subdirectory, but your mileage may vary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;archive-mode&lt;/code&gt; supports &lt;code&gt;Arc&lt;/code&gt;, &lt;code&gt;Lzh&lt;/code&gt;, &lt;code&gt;Zip&lt;/code&gt;, &lt;code&gt;Zoo&lt;/code&gt;, &lt;code&gt;Rar&lt;/code&gt;, and &lt;code&gt;7z&lt;/code&gt;. It does &lt;strong&gt;not&lt;/strong&gt; support &lt;code&gt;.tgz&lt;/code&gt;, &lt;code&gt;.tbz&lt;/code&gt;, &lt;code&gt;.tar.gz&lt;/code&gt; and friends, which are opened using &lt;code&gt;tar-mode&lt;/code&gt; and &lt;code&gt;uncompress.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-25T08:06:11.063" LastActivityDate="2014-11-25T08:06:11.063" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3844" PostTypeId="1" AcceptedAnswerId="5821" CreationDate="2014-11-24T02:24:05.573" Score="51" ViewCount="13615" Body="&lt;p&gt;I would like to have alarms set off based on org-mode events associated with specific times (or start times).  Ideally these would be audio and visual, and able to be customised to some extent.  I used to use &lt;a href=&quot;http://emacs-fu.blogspot.nl/2011/12/sauron-keeping-eye-on-whats-going-on.html&quot;&gt;&lt;code&gt;Sauron&lt;/code&gt;&lt;/a&gt;, but I can't get it to work with org-mode events (or email notificiations) anymore.  What are other good methods?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm particularly interested in having the notification be displayed not only on screen via the notification daemon, but also spoken (text-to-speech). I'm on Linux.)&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="891" LastEditDate="2014-11-26T21:14:40.770" LastActivityDate="2016-10-19T08:58:55.040" Title="Good methods for setting up alarms (audio + visual) triggered by org-mode events?" Tags="|org-mode|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3845" PostTypeId="2" ParentId="2501" CreationDate="2014-11-24T03:14:25.777" Score="7" Body="&lt;p&gt;This always works whenever I want to try other fonts (put it in your init.el or .emacs file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(font . &quot;Inconsolata&quot;) default-frame-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(font . &quot;Inconsolata&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case both expressions are equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, these forms set the font for the current and all future Emacs frames. Since these are saved in your configuration file, the setup is not lost on restart.&lt;/p&gt;&#xA;" OwnerUserId="920" LastActivityDate="2014-11-24T03:14:25.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3846" PostTypeId="1" AcceptedAnswerId="3849" CreationDate="2014-11-24T04:42:14.490" Score="6" ViewCount="1550" Body="&lt;p&gt;I'm trying to connect to Gitter's IRC servers to join the chat room &lt;code&gt;vermiculus/stack-mode&lt;/code&gt;, but according to Gitter, &lt;a href=&quot;https://irc.gitter.im&quot;&gt;they offer this service over SSL&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      _                 _ _   _            _           &#xA;     (_)_ __ ___   __ _(_) |_| |_ ___ _ __(_)_ __ ___  &#xA;     | | '__/ __| / _` | | __| __/ _ \ '__| | '_ ` _ \ &#xA;     | | | | (__ | (_| | | |_| ||  __/ |_ | | | | | | |&#xA;     |_|_|  \___(_)__, |_|\__|\__\___|_(_)|_|_| |_| |_|&#xA;                  |___/                                &#xA;&#xA;&quot;Life is really simple, and so is to use Gitter IRC&quot; - Confucius&#xA;what is Gitter?&#xA;&#xA;man irc.gitter.im (this service is still very much beta)&#xA;1. Connect to irc.gitter.im with your IRC client using SSL&#xA;2. /PASS &amp;lt;my token has been redacted for obvious reasons&amp;gt;&#xA;3. /NICK vermiculus&#xA;4. Profit&#xA;&#xA;100% compatible with Lynx. Seriously.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I cannot find any mention of SSL in ERC's Info manual.  How can I specify that the connection should be secure?  I believe this is the reason I receive the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Sun Nov 23 2014]&#xA;&#xA;&#xA;Connection failed!  Re-establishing connection...               [23:21]&#xA;&#xA;&#xA;&#xA;[Sun Nov 23 2014]&#xA;ERC&amp;gt; /join vermiculus/stack-mode                                [23:22]&#xA;ERC&amp;gt; /join vermiculus/stack-mode&#xA;&#xA;&#xA;Connection failed!  Re-establishing connection...&#xA;&#xA;&#xA;&#xA;[Sun Nov 23 2014]&#xA;&#xA;&#xA;Connection failed!  Re-establishing connection...               [23:23]&#xA;&#xA;&#xA;&#xA;[Sun Nov 23 2014]&#xA;ERC&amp;gt; /PASS &amp;lt;again, redacted&amp;gt;                                    [23:23]&#xA;ERC&amp;gt; /NICK vermiculus&#xA;&#xA;&#xA;Connection failed!  Re-establishing connection...               [23:24]&#xA;&#xA;&#xA;&#xA;[Sun Nov 23 2014]&#xA;&#xA;&#xA;Connection failed!  Re-establishing connection...               [23:24]&#xA;&#xA;&#xA;ERC&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-11-24T13:15:58.033" Title="How can I use ERC with an IRC offered over SSL?" Tags="|erc|gnutls|ssl|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3847" PostTypeId="5" CreationDate="2014-11-24T04:55:44.997" Score="0" Body="&lt;p&gt;&lt;sup&gt;Shamelessly ripped from the &lt;a href=&quot;http://www.gnutls.org&quot; rel=&quot;nofollow&quot;&gt;GnuTLS project pages&lt;/a&gt;.&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Overview&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;GnuTLS is a secure communications library implementing the &lt;a href=&quot;http://datatracker.ietf.org/wg/tls/charter/&quot; rel=&quot;nofollow&quot;&gt;SSL, TLS, and DTLS protocols&lt;/a&gt; and technologies around them. It provides a simple C language application programming interface (API) to access the secure communications protocols as well as APIs to parse and write X.509, PKCS #12, OpenPGP and other required structures. It is aimed to be portable and efficient with focus on security and interoperability.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Features&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Support for &lt;a href=&quot;http://tools.ietf.org/html/rfc5247&quot; rel=&quot;nofollow&quot;&gt;TLS 1.2&lt;/a&gt;, TLS 1.1, TLS 1.0, and SSL 3.0 protocols&lt;/li&gt;&#xA;&lt;li&gt;Support for &lt;a href=&quot;http://tools.ietf.org/html/rfc6347&quot; rel=&quot;nofollow&quot;&gt;DTLS 1.2&lt;/a&gt;, and DTLS 1.0, protocols&lt;/li&gt;&#xA;&lt;li&gt;Support for certificate path validation, as well as &lt;a href=&quot;http://www.gnutls.org/manual/html_node/Verifying-a-certificate-using-DANE.html#Verifying-a-certificate-using-DANE&quot; rel=&quot;nofollow&quot;&gt;DANE&lt;/a&gt; and &lt;a href=&quot;http://www.gnutls.org/manual/html_node/Verifying-a-certificate-using-trust-on-first-use-authentication.html#Verifying-a-certificate-using-trust-on-first-use-authentication&quot; rel=&quot;nofollow&quot;&gt;trust on first use&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Support for the &lt;a href=&quot;http://www.gnutls.org/manual/html_node/OCSP-certificate-status-checking.html&quot; rel=&quot;nofollow&quot;&gt;Online Certificate Status Protocol (OCSP)&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Support for multiple certificate types including X.509 and &lt;a href=&quot;http://www.gnutls.org/openpgp.html&quot; rel=&quot;nofollow&quot;&gt;OpenPGP&lt;/a&gt; certificates.&lt;/li&gt;&#xA;&lt;li&gt;Support for public key methods, including RSA and Elliptic curves, as well as password and key authentication methods such as &lt;a href=&quot;http://www.gnutls.org/manual/html_node/Authentication-using-SRP.html#Authentication-using-SRP&quot; rel=&quot;nofollow&quot;&gt;SRP&lt;/a&gt; and &lt;a href=&quot;http://www.gnutls.org/manual/html_node/Authentication-using-PSK.html#Authentication-using-PSK&quot; rel=&quot;nofollow&quot;&gt;PSK&lt;/a&gt; protocols.&lt;/li&gt;&#xA;&lt;li&gt;Support for all the strong encryption algorithms, including AES and Camellia.&lt;/li&gt;&#xA;&lt;li&gt;Support for CPU-assisted cryptography with VIA padlock and AES-NI instruction sets.&lt;/li&gt;&#xA;&lt;li&gt;Support for cryptographic accelerator drivers via &lt;a href=&quot;http://cryptodev-linux.org&quot; rel=&quot;nofollow&quot;&gt;/dev/crypto&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Supports natively &lt;a href=&quot;http://www.gnutls.org/manual/html_node/Smart-cards-and-HSMs.html#Smart-cards-and-HSMs&quot; rel=&quot;nofollow&quot;&gt;HSMs and cryptographic tokens&lt;/a&gt;, via PKCS #11 and the &lt;a href=&quot;http://www.gnutls.org/manual/html_node/Trusted-Platform-Module.html#Trusted-Platform-Module&quot; rel=&quot;nofollow&quot;&gt;Trusted Platform Module (TPM)&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Runs on most Unix platforms and Windows.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;License&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The core library licensed under the &lt;a href=&quot;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&quot; rel=&quot;nofollow&quot;&gt;GNU Lesser General Public License version 2.1&lt;/a&gt; (LGPLv2.1+). The LGPL license is compatible with a wide range of free licenses, and even permit you to use GnuTLS in non-free proprietary programs.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Documentation&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can obtain the &lt;a href=&quot;http://www.lulu.com/shop/nikos-mavrogiannopoulos-and-simon-josefsson/the-gnutls-manual/paperback/product-21784651.html&quot; rel=&quot;nofollow&quot;&gt;GnuTLS manual at lulu.com&lt;/a&gt; or download &lt;a href=&quot;http://www.gnutls.org/documentation.html&quot; rel=&quot;nofollow&quot;&gt;any of the electronic formats&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information on GnuTLS features, see &lt;a href=&quot;https://en.wikipedia.org/wiki/Comparison_of_TLS_implementations&quot; rel=&quot;nofollow&quot;&gt;the Wikipedia article comparing different TLS implementations&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-25T00:35:55.070" LastActivityDate="2014-11-25T00:35:55.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3848" PostTypeId="4" CreationDate="2014-11-24T04:55:44.997" Score="0" Body="GnuTLS is a secure communications library implementing the SSL, TLS, and DTLS protocols and technologies around them.  It provides a simple C language application programming interface (API) to access the secure communications protocols as well as APIs to parse and write X.509, PKCS #12, OpenPGP and other required structures.  It is aimed to be portable and efficient with focus on security and interoperability." OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-11-24T07:27:38.203" LastActivityDate="2014-11-24T07:27:38.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3849" PostTypeId="2" ParentId="3846" CreationDate="2014-11-24T05:35:30.620" Score="7" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;However, I cannot find any mention of SSL in ERC's Info manual.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've found a mention of SSL &lt;a href=&quot;http://www.emacswiki.org/emacs/ErcSSL&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I specify that the connection should be secure?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What about &lt;code&gt;M-x erc-tls&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-11-24T05:35:30.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3850" PostTypeId="1" CreationDate="2014-11-24T05:45:51.937" Score="5" ViewCount="859" Body="&lt;p&gt;CEDET Version:  2.0&#xA;I have EMACS version&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-w64-mingw32) of 2014-10-20 on KAEL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which comes with CEDET version&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        Requested   File        Loaded&#xA;Package     Version     Version     Version&#xA;----------------------------------------------------------&#xA;cedet:      2.0     nil     ok&#xA;eieio:      1.4     nil     ok&#xA;semantic:       2.2     nil     ok&#xA;srecode:        1.2     nil     Not Loaded&#xA;ede:            1.2     nil     Not Loaded&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this the best version to be using for java development?  I can find no mention of javap in the code yet it is mentioned often in the various documentation sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am in the process if rewriting malabar-mode which relies heavily upon CEDET.  I am hoping to find the &quot;correct&quot; version so when malabar-mode is released, it will be based on the right CEDET.&lt;/p&gt;&#xA;" OwnerUserId="181" LastEditorUserId="181" LastEditDate="2014-11-24T15:59:41.753" LastActivityDate="2015-03-24T17:24:38.483" Title="Which version of CEDET should be used with EMACS 24.4.1 for java development?" Tags="|cedet|java|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3851" PostTypeId="2" ParentId="3842" CreationDate="2014-11-24T09:29:19.620" Score="8" Body="&lt;p&gt;Textfields and buttons (like, in the Customize buffers) are actually subject to the grid Emacs aligns characters on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you &lt;em&gt;can&lt;/em&gt; do is telling Emacs to display an image of the SVG (vector) or XPM (bitmap) type.  Since those aren't limited to be read in from a file, you can generate a string and turn it into an image.  I've seen examples of both canvas-like usage where the image occupies most of the window and is freely drawn on (see &lt;a href=&quot;https://github.com/sabof/svg-thing&quot;&gt;svg-thing&lt;/a&gt;, &lt;a href=&quot;https://github.com/fitzsim/slime-volleyball&quot;&gt;slime-volley&lt;/a&gt;, &lt;a href=&quot;http://elpa.gnu.org/packages/svg-clock.html&quot;&gt;svg-clock&lt;/a&gt;, my own &lt;a href=&quot;https://github.com/wasamasa/svg-2048&quot;&gt;svg-2048&lt;/a&gt;) and less obnoxious usage which rather resemble UI elements (see the icons in &lt;a href=&quot;http://elpa.gnu.org/packages/auctex.html&quot;&gt;AUCTEX&lt;/a&gt;, &lt;a href=&quot;http://gnus.org/&quot;&gt;gnus&lt;/a&gt;' modeline icon, the graphical version of &lt;code&gt;M-x tetris&lt;/code&gt;, &lt;a href=&quot;https://github.com/sabof/svg-mode-line-themes&quot;&gt;svg-modeline&lt;/a&gt;).  There's still quite a bit of footwork to do considering Emacs does not have a canvas-like image type, but it's possible to displace these images and to use them as display property of other UI elements like the modeline or margin and bind keys including the mouse ones to them.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-11-24T09:29:19.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3852" PostTypeId="2" ParentId="3421" CreationDate="2014-11-24T09:48:40.743" Score="1" Body="&lt;p&gt;use imenu and below code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar rimenu-position-pair nil &quot;positions before and after imenu jump&quot;)&#xA;(add-hook 'imenu-after-jump-hook&#xA;          (lambda ()&#xA;            (let ((start-point (marker-position (car mark-ring)))&#xA;                  (end-point (point)))&#xA;              (setq rimenu-position-pair (list start-point end-point)))))&#xA;&#xA;(defun rimenu-jump ()&#xA;  &quot;jump to the closest before/after position of latest imenu jump&quot;&#xA;  (interactive)&#xA;  (when rimenu-position-pair&#xA;    (let ((p1 (car rimenu-position-pair))&#xA;          (p2 (cadr rimenu-position-pair)))&#xA;&#xA;      ;; jump to the far way point of the rimenu-position-pair&#xA;      (if (&amp;lt; (abs (- (point) p1))&#xA;             (abs (- (point) p2)))&#xA;          (goto-char p2)&#xA;          (goto-char p1))&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastActivityDate="2014-11-24T09:48:40.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3853" PostTypeId="1" AcceptedAnswerId="5379" CreationDate="2014-11-24T10:19:57.570" Score="0" ViewCount="108" Body="&lt;p&gt;I'm in the process of writing &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow&quot;&gt;an Emacs package that helps you controlling popup windows&lt;/a&gt; and have hit a minor roadblock while developing a new feature for it.  Currently I'm using &lt;code&gt;window-configuration-change-hook&lt;/code&gt; to track certain buffers and their windows that have either been buried or closed, however this hook cannot catch if the buffer in question has been killed since this isn't a window configuration change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: There is a &lt;code&gt;kill-buffer-hook&lt;/code&gt; that could help me solve this minor annoyance, however it's run differently than &lt;code&gt;window-configuration-change-hook&lt;/code&gt;. &lt;code&gt;window-configuration-change-hook&lt;/code&gt; is run &lt;em&gt;after&lt;/em&gt; the window configuration changes, &lt;code&gt;kill-buffer-hook&lt;/code&gt; is run before the buffer is killed with the buffer selected.  This means that if I add my function to both hooks, I cannot detect if the buffer has been killed because it hasn't been killed yet when the hook is run. That means I'd need to either use a different function in &lt;code&gt;kill-buffer-hook&lt;/code&gt; that operates on the selected buffer than in &lt;code&gt;window-configuration-change-hook&lt;/code&gt; where the selected buffer has different semantics or would need to know what hook has run it.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-11-24T11:43:50.743" LastActivityDate="2014-12-14T18:10:08.447" Title="How can I use two hooks with overlapping usecases?" Tags="|hooks|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3854" PostTypeId="2" ParentId="3850" CreationDate="2014-11-24T10:43:05.917" Score="1" Body="&lt;p&gt;My &lt;a href=&quot;https://github.com/alexott/cedet/tree/devel&quot; rel=&quot;nofollow&quot;&gt;dev branch&lt;/a&gt; of CEDET has some extensions for better work with Java, like basic Maven &amp;amp; Ant support, etc. But it wasn't updated for at least a year - I plan to spend some time over the Christmas to sync it with current HEAD...&lt;/p&gt;&#xA;" OwnerUserId="190" LastActivityDate="2014-11-24T10:43:05.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3855" PostTypeId="2" ParentId="3846" CreationDate="2014-11-24T12:57:21.180" Score="8" Body="&lt;p&gt;Testing it this morning:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'erc)&#xA;(erc-tls :server &quot;irc.gitter.im&quot; :port 6667) ;; M-x erc-tls -&amp;gt; irc.gitter.im -&amp;gt; accept default PORT.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when prompted:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;NICK: jleechpe&#xA;PASS: &amp;lt;redacted&amp;gt;&#xA;&#xA;/join #vermiculus/stack-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2014-11-24T13:15:58.033" LastActivityDate="2014-11-24T13:15:58.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3856" PostTypeId="1" AcceptedAnswerId="3857" CreationDate="2014-11-24T14:43:04.397" Score="5" ViewCount="422" Body="&lt;p&gt;How do I convert 1:6 into 0.166666 using the org spreadsheet?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking it should be &lt;code&gt;$4=$3;%f&lt;/code&gt; but it's clearly not.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| x | y |   z |        f |&#xA;|---+---+-----+----------|&#xA;| 1 | 1 |   1 | 1.000000 |&#xA;| 1 | 2 | 1:2 | 1.000000 |&#xA;| 1 | 3 | 1:3 | 1.000000 |&#xA;| 1 | 6 | 1:6 | 1.000000 |&#xA;#+TBLFM: $3=$1/$2;F::$4=$3;%f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="55" LastActivityDate="2014-12-10T22:11:44.110" Title="convert fraction to decimal in org spreadsheet" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3857" PostTypeId="2" ParentId="3856" CreationDate="2014-11-24T15:02:08.263" Score="7" Body="&lt;p&gt;Just multiply with a float:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| x | y |   z |          f |&#xA;|---+---+-----+------------|&#xA;| 1 | 1 |   1 |         1. |&#xA;| 1 | 2 | 1:2 |        0.5 |&#xA;| 1 | 3 | 1:3 | 0.33333333 |&#xA;| 1 | 6 | 1:6 | 0.16666667 |&#xA;#+TBLFM: $3=$1/$2;F::$4=$3*1.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-24T15:02:08.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3858" PostTypeId="2" ParentId="582" CreationDate="2014-11-24T16:18:04.200" Score="1" Body="&lt;p&gt;I've ever written a simple minor-mode (for my personal usage) to interactively &lt;code&gt;resize-frame&lt;/code&gt;. I think this should be convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/kuanyui/65a408d393871048771c&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/kuanyui/65a408d393871048771c&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x resize-frame&lt;/code&gt;to enable the &lt;code&gt;resize-frame&lt;/code&gt; minor-mode:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Press &lt;code&gt;arrow keys&lt;/code&gt; to adjust size horizontally/vertically.&lt;/li&gt;&#xA;&lt;li&gt;Press any other keys to disable.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="515" LastActivityDate="2014-11-24T16:18:04.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3859" PostTypeId="1" AcceptedAnswerId="3892" CreationDate="2014-11-24T17:17:57.790" Score="7" ViewCount="966" Body="&lt;p&gt;Can someone point me to a working setup for using babel with IPython?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm witnessing strange indentation behavior when I try to define functions. This happens whether or not I specify the &lt;code&gt;--classic&lt;/code&gt; flag in &lt;code&gt;org-babel-python-command&lt;/code&gt;. My current command (running linux with Emacs 24.4):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-babel-python-command &#xA;      &quot;ipython --pylab=qt4 --pdb --nosep --classic --no-banner --no-confirm-exit&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work with function definitions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session *Broken IPython* :results output pp&#xA;  def g(x, lst):&#xA;      if isinstance(x, float):&#xA;          x = x + 0&#xA;      return [item + x for item in lst]&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GMTtl.png&quot; alt=&quot;screenshot of my ipython buffer&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem related to &lt;code&gt;--classic&lt;/code&gt; either as I get the same error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ugSJ0.png&quot; alt=&quot;screenshot of my modern ipython buffer&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus points if you have a working setup that doesn't force me to use &lt;code&gt;--classic&lt;/code&gt; as I do like the formatting of &quot;modern&quot; interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the magic command lets me define functions and evaluate a session, but I can't get a value output without one. Instead, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :results output&#xA;   def f(x):&#xA;       return x + 2&#xA;&#xA;   f(2)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &amp;gt;&amp;gt;&amp;gt; ... ... &amp;gt;&amp;gt;&amp;gt; 4&#xA;: &amp;gt;&amp;gt;&amp;gt; &#xA;&#xA;#+BEGIN_SRC python :results value&#xA;   def f(x):&#xA;       return x + 2&#xA;&#xA;   f(2)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No results are returned, seemingly because of all the &lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; in the output not being parsed correctly.&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2014-12-01T18:52:33.800" LastActivityDate="2014-12-01T18:52:33.800" Title="working setup for ipython in babel" Tags="|org-babel|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3861" PostTypeId="1" AcceptedAnswerId="3862" CreationDate="2014-11-24T20:32:22.657" Score="0" ViewCount="358" Body="&lt;p&gt;Following the same steps as Dipak C in his question regarding &lt;a href=&quot;https://emacs.stackexchange.com/questions/2539/defining-key-bindings-within-helm-map-getting-a-void-variable-helm-map-erro&quot;&gt;void-variable helm-map error&lt;/a&gt; but still cannot solve the problem even after adding &lt;code&gt;(package-initialize)&lt;/code&gt; just after &lt;code&gt;(require 'helm-config)&lt;/code&gt; as I understand from the solution.&lt;/p&gt;&#xA;" OwnerUserId="2691" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-24T21:31:21.483" Title="Defining key-bindings within `helm-map`: getting a `void-variable helm-map` error [continuation]" Tags="|key-bindings|helm|" AnswerCount="1" CommentCount="3" ClosedDate="2014-11-25T09:29:45.927" ContentLicense="CC BY-SA 3.0" />
  <row Id="3862" PostTypeId="2" ParentId="3861" CreationDate="2014-11-24T21:31:21.483" Score="0" Body="&lt;p&gt;Calling &lt;code&gt;package-initialize&lt;/code&gt; after loading helm won't make a difference, doing it &lt;em&gt;before&lt;/em&gt; loading helm &lt;em&gt;might&lt;/em&gt;. Also see &lt;a href=&quot;https://github.com/emacs-helm/helm#install-from-emacs-packaging-system&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm#install-from-emacs-packaging-system&lt;/a&gt; and &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#faq&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/wiki#faq&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-11-24T21:31:21.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3863" PostTypeId="1" CreationDate="2014-11-25T00:05:17.177" Score="33" ViewCount="5992" Body="&lt;p&gt;I use Org mode for keeping track of everything; ideas, notes, to-do lists, code snippets, etc. You name it. One problem I have though, is that I can't easily pull up my Org-mode data on my phone, even if it is only for quickly checking my notes or searching within them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, I store my org files within a Github repository, which is great, but this is still not amenable for smartphone browsing and searching. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally what I am looking for is a way to synchronize org-mode notes with &lt;strong&gt;Evernote&lt;/strong&gt;. Is this doable? If not, what are my alternatives for browsing org-mode files on my phone?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I easily sync, and later browse and search my org-mode files from my phone?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2014-11-25T00:16:23.217" LastActivityDate="2015-07-30T00:26:57.477" Title="Org-mode on the phone or on Evernote?" Tags="|org-mode|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3864" PostTypeId="1" AcceptedAnswerId="3890" CreationDate="2014-11-25T01:26:19.763" Score="5" ViewCount="172" Body="&lt;p&gt;I want to create a skeleton, triggered by the abbrev keyword 'func' which checks its context and runs one of two possible sub-skeletons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton my-func-skeleton &quot;func skeleton&quot;&#xA;  &quot;&quot;&#xA;  (if (looking-back &quot;\n&quot;)&#xA;      ;; A function at left of screen is a top level function.&#xA;      '((setq str (skeleton-read &quot;Function name: &quot;))&#xA;        &quot;// &quot; str &quot; .&quot; \n&#xA;        &quot;func &quot; str &quot;(&quot; @ &quot;) {&quot; \n&#xA;        _ @ \n&#xA;        -1 &quot;}&quot;)&#xA;     ;; Otherwise it is an anonymous function. &#xA;     '(&quot;func () {&quot; \n&#xA;       _ \n&#xA;       -1 &quot;}&quot;)))&#xA;&#xA;(expand-add-abbrevs go-mode-abbrev-table&#xA;                    '((&quot;func&quot; my-func-skeleton)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this just recursively executes the appropriate sub-skeleton until I quit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make expressions within skeletons return sub-skeletons that work correctly?&lt;/p&gt;&#xA;" OwnerUserId="2694" LastEditorUserId="50" LastEditDate="2014-11-26T01:46:01.707" LastActivityDate="2014-11-26T01:59:03.890" Title="Context sensitive skeleton triggered by abbrev stuck in loop" Tags="|abbrev|skeleton|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3865" PostTypeId="2" ParentId="3742" CreationDate="2014-11-25T02:35:27.257" Score="2" Body="&lt;p&gt;My guess is that some other part of your config causes constant saves, tho I wouldn't know why nor of what.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might like to try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'go-mode-hook&#xA;          (lambda ()&#xA;            (add-hook 'before-save-hook 'gofmt-before-save nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so the gofmt-before-save only happens in go-mode buffers, rather than everywhere.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-25T02:35:27.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3866" PostTypeId="1" CreationDate="2014-11-25T03:34:07.587" Score="6" ViewCount="749" Body="&lt;p&gt;Is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Notifications.html&quot; rel=&quot;nofollow&quot;&gt;Notifications on File Changes&lt;/a&gt; supported on Mac OS X? I can't seem to find any documentation about how to do this anywhere.&lt;/p&gt;&#xA;" OwnerUserId="2564" LastEditorUserId="253" LastEditDate="2015-08-24T18:14:01.273" LastActivityDate="2016-03-10T13:50:24.870" Title="file-notify support on OSX" Tags="|osx|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3867" PostTypeId="2" ParentId="3866" CreationDate="2014-11-25T03:44:22.580" Score="5" Body="&lt;p&gt;The short answer is: no.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://www.gnu.org/software/emacs/news/NEWS.24.4&quot; rel=&quot;nofollow&quot;&gt;gnu.org&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;** Emacs can now be compiled with file notification support. This happens by default if a suitable system library is found at build&#xA;  time.  To prevent this, use the configure option&#xA;  `--without-file-notification'.  See below for file-notify features.&#xA;  This feature is not available for the Nextstep port.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that &quot;Nextstep&quot;, in this context, means &quot;OS X&quot;.  There's a lengthy explanation of this confusing terminology &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/etc/NEXTSTEP&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://en.wikipedia.org/wiki/NeXTSTEP&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] Apple's OS X and iOS are direct descendants of NeXTSTEP, through the&#xA;  OPENSTEP lineage. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Quote 1 + quote 2 = Notification on file changes is not supported on Mac OSX.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="786" LastEditDate="2015-05-10T19:13:36.500" LastActivityDate="2015-05-10T19:13:36.500" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3868" PostTypeId="2" ParentId="3786" CreationDate="2014-11-25T04:56:59.370" Score="2" Body="&lt;p&gt;I think you just need to update your Org-mode a more recent version.  6.33 is very old.  It works fine for me with &lt;code&gt;org-indent-mode&lt;/code&gt; and soft word wrap using Emacs 24.4.1 and Org-mode 8.2.10 - see screenshot below.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have customised the &lt;code&gt;org-indent&lt;/code&gt; face to be underlined in gray so you can see the visual prefix that is added to each line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6HxeS.png&quot; alt=&quot;screenshot illustrating &quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2014-11-25T04:56:59.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3869" PostTypeId="1" AcceptedAnswerId="3873" CreationDate="2014-11-25T09:50:27.373" Score="5" ViewCount="1995" Body="&lt;p&gt;How do I get Emacs to use the Mac OS Keychain for my SMTP email password?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to eschew an .authinfo file in favour of the Mac OS Keychain&#xA;but can't seem to get it going. I keep receiving the error &lt;code&gt;auth-source-macos-keychain-search: The MacOS Keychain auth-source backend doesn't support creation yet&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some relevant excerpts from my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(auth-sources (quote (macos-keychain-internet macos-keychain-generic)))&#xA;'(smtpmail-smtp-server &quot;mail.example.com&quot;)&#xA;'(smtpmail-smtp-service 465)&#xA;'(smtpmail-smtp-user &quot;user@example.com&quot;)&#xA;'(smtpmail-stream-type (quote ssl))&#xA;'(send-mail-function (quote smtpmail-send-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have created an entry with Keychain Access in my default keychain with&#xA;the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Keychain Item Name: &lt;code&gt;mail.example.com&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Account Name: &lt;code&gt;address@hidden&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Password: &lt;code&gt;password12345&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following commands return the password:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ security find-generic-password -l mail.example.com -a address@hidden -w&#xA;=&amp;gt; password12345&#xA;$ security find-generic-password -s mail.example.com -a address@hidden -w&#xA;=&amp;gt; password12345&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I eval&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auth-source-search :label &quot;mail.example.com&quot;)&#xA;=&amp;gt; nil&#xA;(auth-source-search :server &quot;mail.example.com&quot;)&#xA;= nil&#xA;(auth-source-search :label &quot;mail.example.com&quot; :user &quot;address@hidden&quot;)&#xA;=&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The Mac OS authorisation popup appears, but I can't tell whether it's&#xA;returning the password...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the &lt;code&gt;security&lt;/code&gt; retrieval method working for OfflineIMAP using the&#xA;real Keychain entry, so it's not a user/password problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm happy to switch to another &lt;code&gt;send-mail-function&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2697" LastActivityDate="2014-11-25T13:32:45.177" Title="Mac OS Keychain with SMTP email password" Tags="|osx|email|passwords|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3870" PostTypeId="1" AcceptedAnswerId="3871" CreationDate="2014-11-25T10:50:38.357" Score="11" ViewCount="3362" Body="&lt;p&gt;I've just tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set 'global-map (make-sparse-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but issuing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;b&lt;/kbd&gt; still shows tons of crap, especially in the &lt;em&gt;Global Bindings&lt;/em&gt; section:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Global Bindings:&#xA;key             binding&#xA;---             -------&#xA;&#xA;C-@             set-mark-command&#xA;C-a             move-beginning-of-line&#xA;C-b             backward-char&#xA;C-d             delete-char&#xA;C-e             move-end-of-line&#xA;C-f             forward-char&#xA;C-g             keyboard-quit&#xA;C-h             help-command&#xA;TAB             indent-for-tab-command&#xA;C-k             kill-line&#xA;C-l             recenter-top-bottom&#xA;RET             newline&#xA;C-n             next-line&#xA;C-o             open-line&#xA;...             ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and there are so many more to come.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get rid of these completely. How can I possibly do that in one simple function call? I would like the solution to be a total wipeout, rather than a loop which is setting all of these maps to &lt;code&gt;nil&lt;/code&gt;. Thank you in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Please, no teaching answers or spam comments like &lt;em&gt;&quot;These keys are essential for productivity, don't do that!&quot;&lt;/em&gt;. I have highly customized emulation layer for modal text editing here, so I don't need these default bindings at all.&lt;/p&gt;&#xA;" OwnerUserId="2454" LastEditorUserId="50" LastEditDate="2014-11-25T21:42:33.260" LastActivityDate="2015-08-21T20:13:09.640" Title="How to truly unbind ALL global keybinds?" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3871" PostTypeId="2" ParentId="3870" CreationDate="2014-11-25T11:40:10.593" Score="19" Body="&lt;p&gt;Taken from the Emacs Lisp Manual (see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html&quot;&gt;Controlling Active Maps&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-global-map (make-sparse-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To quote the manual: &quot;It is very unusual to change the global keymap.&quot;. Safety note: Make sure you can save buffers and cleanly exit Emacs afterwards with a different keymap, otherwise you'll have to kill it without saved changes.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-11-25T16:48:41.733" LastActivityDate="2014-11-25T16:48:41.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3872" PostTypeId="2" ParentId="3869" CreationDate="2014-11-25T12:41:22.240" Score="2" Body="&lt;p&gt;I didn't know about `auth-source-search, so I wrote this code instead, in order to extract a password from the keychain:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-keychain-password (service)&#xA;  &quot;Get a generic password from the OS X keychain.&#xA;The password is associated with the string SERVICE.&#xA;This corresponds to the Account field in the Keychain Access GUI.&#xA;BUG: If there is no matching password, or the output of /usr/bin/security&#xA;is on an unexpected format, the function silently returns NIL.&quot;&#xA;  (with-temp-buffer&#xA;    (call-process &quot;/usr/bin/security&quot;&#xA;                  nil (list (current-buffer) t) nil&#xA;                  &quot;find-generic-password&quot; &quot;-ws&quot; service)&#xA;    (let ((max (point-max)))&#xA;      (when (&amp;gt; max 1)&#xA;        (buffer-substring-no-properties 1 (- max 1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2014-11-25T12:49:28.773" LastActivityDate="2014-11-25T12:49:28.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3873" PostTypeId="2" ParentId="3869" CreationDate="2014-11-25T13:32:45.177" Score="2" Body="&lt;p&gt;A few days ago I reported a bug against Emacs for this very problem (bug &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19074&quot; rel=&quot;nofollow&quot;&gt;19074&lt;/a&gt;). If you're comfortable doing so, I'd suggest applying the patch I supplied - and please report back with your results so I can fix any problems :)&lt;/p&gt;&#xA;" OwnerUserId="621" LastActivityDate="2014-11-25T13:32:45.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3874" PostTypeId="1" AcceptedAnswerId="34015" CreationDate="2014-11-25T13:38:44.220" Score="16" ViewCount="7017" Body="&lt;p&gt;I installed binaries of Emacs 24.4 for Windows and want to install the support libraries described in the &lt;a href=&quot;https://ftp.gnu.org/gnu/emacs/windows/README&quot;&gt;Emacs for Windows README&lt;/a&gt;. The latest precompiled libraries are available from the &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/&quot;&gt;ezwinports&lt;/a&gt; project, but installing them is a little time-consuming. I have to select all of the libraries mentioned in Emacs's README, scan the &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot;&gt;ezwinports README&lt;/a&gt; for any further prerequisites, and download each one of the zip archives. Then unpack them, move them to a permanent location, and add the individual directories to my &lt;code&gt;PATH&lt;/code&gt; variable. There are duplicate files within these archives, so I am wary of unpacking them all to the same directory without checking that they are identical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an automated way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2701" LastActivityDate="2019-03-01T18:22:58.783" Title="Easiest way to install Emacs Windows support libraries" Tags="|microsoft-windows|libraries|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3875" PostTypeId="2" ParentId="3874" CreationDate="2014-11-25T13:57:22.157" Score="6" Body="&lt;p&gt;This isn't a fully-automated solution, but it's part of the way there. As far as I can tell, the current set of support libraries and their prerequisites is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;libpng-1.6.12&lt;/li&gt;&#xA;&lt;li&gt;cairo-1.12.16&lt;/li&gt;&#xA;&lt;li&gt;gdk-pixbuf-2.30.2&lt;/li&gt;&#xA;&lt;li&gt;giflib-5.1.0&lt;/li&gt;&#xA;&lt;li&gt;glib-2.38.2&lt;/li&gt;&#xA;&lt;li&gt;gnutls-3.0.9&lt;/li&gt;&#xA;&lt;li&gt;jpeg-v9a&lt;/li&gt;&#xA;&lt;li&gt;libcroco-0.6.8&lt;/li&gt;&#xA;&lt;li&gt;libffi-3.0.13&lt;/li&gt;&#xA;&lt;li&gt;librsvg-2.40.1-2&lt;/li&gt;&#xA;&lt;li&gt;libxml2-2.7.8&lt;/li&gt;&#xA;&lt;li&gt;lzo-2.06&lt;/li&gt;&#xA;&lt;li&gt;pango-1.36.1-2&lt;/li&gt;&#xA;&lt;li&gt;pixman-0.32.4&lt;/li&gt;&#xA;&lt;li&gt;tiff-4.0.3&lt;/li&gt;&#xA;&lt;li&gt;zlib-1.2.8-2&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Download all of these from the &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot;&gt;ezwinports files&lt;/a&gt; area to a staging directory. Then use &lt;a href=&quot;https://pypi.python.org/pypi/unp/0.3&quot;&gt;unp&lt;/a&gt; to unpack each of these to directories of their own. Use the &lt;code&gt;rename&lt;/code&gt; command in Cygwin to eliminate any &lt;code&gt;-w32-bin&lt;/code&gt; suffixes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rename -- -w32-bin &quot;&quot; *-w32-bin&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use a command like the following to get the list of directories you need to add to your &lt;code&gt;PATH&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;command ls -1 | perl -pe 's/^/C:\\Program Files (x86)\\/; s/\n/\\bin;/'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then move all of these to a location like &lt;code&gt;C:\Program Files (x86)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2701" LastEditorUserId="2701" LastEditDate="2014-11-25T14:34:01.737" LastActivityDate="2014-11-25T14:34:01.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3877" PostTypeId="1" CreationDate="2014-11-25T15:36:22.300" Score="4" ViewCount="157" Body="&lt;p&gt;I already make extensive use of &lt;em&gt;flyspell-mode&lt;/em&gt; to keep my errant spelling in check. However I'm currently trying to break the bad habit of using &quot;it's&quot; for possessive statements. I've had a brief look around and haven't found any grammar checkers but really all I need is to visually hi-light common errors in any buffer which can accept textual prose. Any suggestions of the easiest way to achieve this? &lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-12-03T14:49:25.670" Title="Hi-lighting common grammar mistakes in all prose across modes with English text" Tags="|text-editing|text|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3878" PostTypeId="1" CreationDate="2014-11-25T15:58:09.940" Score="5" ViewCount="736" Body="&lt;p&gt;While trying to run a python script in an Inferior Python buffer for Python 3.3.5 in my Emacs 24.3.1 GTK+ window, I get a&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;  File &quot;/usr/local/lib/python3.3/encodings/ascii.py&quot;, line 26, in decode&#xA;    return codecs.ascii_decode(input, self.errors)[0]&#xA;UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1332:&#xA; ordinal not in range(128)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This even happens when all my buffer contains is the minimum to make it a python script containing a unicode character.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3&#xA;&quot;ε&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There appears to also be some magic that replaces all non-ascii characters from the first line (?) of input with whitespace, because just&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;ε&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives me the string &lt;code&gt;&quot; &quot;&lt;/code&gt;, trying to do &lt;code&gt;ε=4&lt;/code&gt; results in an &lt;code&gt;IndentationError&lt;/code&gt;, and &lt;code&gt;ord(&quot;ε&quot;)&lt;/code&gt; on the first line of a file returns &lt;code&gt;32&lt;/code&gt;. This may be related; however, if the non-ascii symbols appear after the first line, all these constructions result in a &lt;code&gt;UnicodeDecodeError&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, I haven't even started outputting any unicode symbols, and the Inferior Python buffer accepts input of unicode characters. Running the same python script in a terminal (&lt;code&gt;urxvt&lt;/code&gt; or a random tty) works without problems as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do I need to change to make it work?&lt;/p&gt;&#xA;" OwnerUserId="2702" LastEditorUserId="2702" LastEditDate="2014-11-25T16:24:13.510" LastActivityDate="2015-04-06T11:05:30.110" Title="UnicodeDecodeError in my Inferior Python buffer" Tags="|python|character-encoding|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3879" PostTypeId="2" ParentId="3877" CreationDate="2014-11-25T16:50:37.383" Score="2" Body="&lt;p&gt;A brief Google search (&quot;open source English grammar checker&quot; and &quot;langtool emacs&quot;) led me to &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-langtool&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;langtool.el&lt;/code&gt;&lt;/a&gt;, which can be installed using &lt;a href=&quot;http://melpa.org/#/langtool&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I haven't tried it yet, but I definitely will.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-25T16:57:56.130" LastActivityDate="2014-11-25T16:57:56.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3881" PostTypeId="1" AcceptedAnswerId="3882" CreationDate="2014-11-25T17:10:04.540" Score="11" ViewCount="759" Body="&lt;p&gt;During the work with tex files with auctex+emacs (LateX-mode), I use more frequently _ (underline) instead of - (minus sign).&#xA;The same as ^ instead of 6.&#xA;The inconvenience is that I should press more frequently the shift-key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be desirable to customize emacs in such a way that when emacs is in LateX-mode (&lt;strong&gt;and just in this mode&lt;/strong&gt;), when I type - the the emacs types _ and when I type _ the emacs types -.&#xA;i.e., the following key-bindings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;- gives _&lt;/p&gt;&#xA;&#xA;&lt;p&gt;_ gives -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6 gives ^&lt;/p&gt;&#xA;&#xA;&lt;p&gt;^ gives 6&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="50" LastEditDate="2014-11-25T17:21:41.797" LastActivityDate="2014-11-25T17:27:03.717" Title="changing the role of the underline and the minus-sign just in LateX-mode" Tags="|key-bindings|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3882" PostTypeId="2" ParentId="3881" CreationDate="2014-11-25T17:27:03.717" Score="16" Body="&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'my-latex-hook)&#xA;&#xA;(defun my-latex-hook ()&#xA;  (require 'tex-site)&#xA;  (define-key LaTeX-mode-map &quot;-&quot; (lambda () (interactive) (insert &quot;_&quot;)))&#xA;  (define-key LaTeX-mode-map &quot;_&quot; (lambda () (interactive) (insert &quot;-&quot;)))&#xA;  (define-key LaTeX-mode-map &quot;6&quot; (lambda () (interactive) (insert &quot;^&quot;)))&#xA;  (define-key LaTeX-mode-map &quot;^&quot; (lambda () (interactive) (insert &quot;6&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-25T17:27:03.717" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3883" PostTypeId="2" ParentId="3870" CreationDate="2014-11-25T21:28:47.180" Score="10" Body="&lt;p&gt;Although the following information is not a direct answer to the question (since it was already answered by @wasamasa), I still believe that it is an essential addition to the answer. The point is that after issuing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-global-map (make-sparse-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;one indeed wipes out the &lt;em&gt;Global Bindings&lt;/em&gt; section completely, and as a consequence, one &lt;strong&gt;cannot&lt;/strong&gt; even type text anymore! In overwhelming majority of cases, one of course would want to restore the ability to type text as it is essential for any text editor anyway. Thus, here is the one way to do that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [t] #'self-insert-command)&#xA;(let ((c ?\s))&#xA;  (while (&amp;lt; c ?\d)&#xA;    (global-set-key (vector c) #'self-insert-command)&#xA;    (setq c (1+ c)))&#xA;  (when (eq system-type 'ms-dos)&#xA;    (setq c 128)&#xA;    (while (&amp;lt; c 160)&#xA;      (global-set-key (vector c) #'self-insert-command)&#xA;      (setq c (1+ c))))&#xA;  (setq c 160)&#xA;  (while (&amp;lt; c 256)&#xA;    (global-set-key (vector c) #'self-insert-command)&#xA;    (setq c (1+ c))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just so that you guys believe that this Emacs Lisp code is a correct way to do that, I will provide the source which I used to produce it. By default the ability to type text with the current 8-bit ASCII code page is implemented in the &lt;code&gt;cmds.c&lt;/code&gt; translation unit of the Emacs C source code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  for (n = 040; n &amp;lt; 0177; n++)&#xA;    initial_define_key (global_map, n, &quot;self-insert-command&quot;);&#xA;#ifdef MSDOS&#xA;  for (n = 0200; n &amp;lt; 0240; n++)&#xA;    initial_define_key (global_map, n, &quot;self-insert-command&quot;);&#xA;#endif&#xA;  for (n = 0240; n &amp;lt; 0400; n++)&#xA;    initial_define_key (global_map, n, &quot;self-insert-command&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the Emacs Lisp code above is the exact replication of this C code, except for one additional line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [t] #'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Consider it a caveat, but this line is &lt;strong&gt;important&lt;/strong&gt; to have! Otherwise only 7-bits of the current ASCII code page would be available (regardless of the fact that we have initialized all the 8-bits).&lt;/p&gt;&#xA;" OwnerUserId="2454" LastEditorUserId="2454" LastEditDate="2015-08-21T20:13:09.640" LastActivityDate="2015-08-21T20:13:09.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3884" PostTypeId="2" ParentId="3715" CreationDate="2014-11-25T22:18:44.440" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;syntax-propertize-function&lt;/code&gt; or &lt;code&gt;font-lock-syntactic-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a simple example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst my-string-mode-syntax-table&#xA;  (make-syntax-table))&#xA;&#xA;(defconst my-string-mode-triple-quoted&#xA;  (rx (group &quot;\&quot;&quot;) (group &quot;\&quot;\&quot;&quot; (*? anything) &quot;\&quot;\&quot;&quot;) (group &quot;\&quot;&quot;)))&#xA;&#xA;(define-derived-mode my-string-mode prog-mode &quot;My Mode&quot;&#xA;  &quot;testing&quot;&#xA;  :syntax-table my-string-mode-syntax-table&#xA;  (set (make-local-variable 'font-lock-syntactic-keywords)&#xA;       (list&#xA;        `(,my-string-mode-triple-quoted&#xA;          (1 &quot;\&quot;&quot;)&#xA;          (2 &quot;.&quot;)&#xA;          (3 &quot;\&quot;&quot;)&#xA;          )))&#xA;  (font-lock-fontify-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastActivityDate="2014-11-25T22:18:44.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3885" PostTypeId="2" ParentId="2658" CreationDate="2014-11-25T23:16:46.633" Score="3" Body="&lt;p&gt;Solution 1 (recommended):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A perfect solution for BOTH js-mode and js2-mode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-javascript.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-javascript.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Screen shot,&#xA;&lt;img src=&quot;https://i.stack.imgur.com/0EL07.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution 2 (js2-mode only):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a little bit more complex to set up, but the imenu item will display more context and I GUESS imenu functions extracted this way could be hide/show by js2-mode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you need change &lt;code&gt;js2-imenu-extension-styles&lt;/code&gt;, please make sure you've installed latest js2-mode. Only in latest version of js2-mode, that variable is configurable since my pull request was merged just a few days ago (&lt;a href=&quot;https://github.com/mooz/js2-mode/commit/31c49e02b58de7aa959b1cd03fe8381c545da810&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/mooz/js2-mode/commit/31c49e02b58de7aa959b1cd03fe8381c545da810&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;code&gt;:call-re&lt;/code&gt; part, use the regex I provided in solution1, for other parts, just copy/paste from samples defined in &lt;a href=&quot;https://github.com/mooz/js2-mode/blob/master/js2-imenu-extras.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/mooz/js2-mode/blob/master/js2-imenu-extras.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, solution 1 is simpler to setup which I recommend. solution 2 is more official and will give you more context information. so your choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, for anyone who are interested in tech details,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This article explains the problem, my plan of the solution:&#xA;&lt;a href=&quot;http://blog.binchen.org/posts/why-emacs-is-better-editor-part-two.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blog.binchen.org/posts/why-emacs-is-better-editor-part-two.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This is the actual implementation, after one month discussion with the js2-mode maintainers&#xA;&lt;a href=&quot;https://github.com/mooz/js2-mode/pull/169&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/mooz/js2-mode/pull/169&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;you can use BOTH solution 1 and solution 2, the imenu items in solution 2 will take priority, you will NOT get duplicated imenu items&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2014-11-26T12:23:45.293" LastActivityDate="2014-11-26T12:23:45.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3886" PostTypeId="1" AcceptedAnswerId="3888" CreationDate="2014-11-25T23:40:34.820" Score="9" ViewCount="1363" Body="&lt;p&gt;How can I bind an f-key using jwiegley's &lt;code&gt;use-package&lt;/code&gt; package? Any of these combinations produces an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; :bind (&quot;f11&quot; . multi-term)&#xA; :bind (&amp;lt;f11&amp;gt; . multi-term)&#xA; :bind ([f11] . multi-term)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Of course, this falls under the scope of a &lt;code&gt;use-package&lt;/code&gt; declaration.)&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2014-11-26T12:30:50.580" Title="Bind f-key in use-package" Tags="|key-bindings|use-package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3887" PostTypeId="1" AcceptedAnswerId="3891" CreationDate="2014-11-25T23:42:06.273" Score="6" ViewCount="129" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How do I find the visual line number of point (so that I can restore it after an operation)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &lt;em&gt;“visual line number”&lt;/em&gt;, I'm referring to the number &lt;code&gt;N&lt;/code&gt; of lines&#xA;between the top of the &lt;em&gt;window&lt;/em&gt; (or the screen) and the cursor, not&#xA;the top of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first I thought I could calculate &lt;code&gt;N&lt;/code&gt; with the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(- (line-number-at (point))&#xA;   (line-number-at (window-start)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, to complicate things, I have sections of the buffer which are invisible. &#xA;So the snippet above usually returns values much larger than &lt;code&gt;N&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Context:&lt;/strong&gt;&lt;br&gt;&#xA;I need to perform an operation that essentially erases the entire&#xA;buffer and writes it again, but I want it to be mostly invisible to&#xA;the user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the buffer contents are created anew, &lt;code&gt;save-excursion&lt;/code&gt; doesn't&#xA;help in this situation. Still, I manage to preserve point position by&#xA;saving it as a number, instead of a marker.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((point (point)))&#xA;  (recreate-buffer)&#xA;  (goto-char point))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q (alternative wording):&lt;/strong&gt; Is there a similar method I can use to preserve the &lt;em&gt;visual height&lt;/em&gt; of the cursor?&lt;br&gt;&#xA;By that, I mean that if the cursor is initially on the &lt;code&gt;N&lt;/code&gt;&lt;sup&gt;th&lt;/sup&gt; visible line of the &lt;strong&gt;screen&lt;/strong&gt;, the window should be scrolled after the operation so that this remains true.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-26T16:27:09.977" LastActivityDate="2014-11-26T16:27:09.977" Title="How to preserve the visual height of the cursor after an operation?" Tags="|window|scrolling|point|excursion|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3888" PostTypeId="2" ParentId="3886" CreationDate="2014-11-25T23:47:02.150" Score="11" Body="&lt;p&gt;You need to quote &lt;code&gt;&quot;&amp;lt;f11&amp;gt;&quot;&lt;/code&gt;, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:bind (&quot;&amp;lt;f11&amp;gt;&quot; . multi-term)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here's a full example, with ace-jump-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ace-jump-mode&#xA;         :commands ace-jump-mode&#xA;         :init&#xA;         :bind (&quot;&amp;lt;f7&amp;gt;&quot; . ace-jump-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2707" LastActivityDate="2014-11-25T23:47:02.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3890" PostTypeId="2" ParentId="3864" CreationDate="2014-11-26T01:59:03.890" Score="4" Body="&lt;p&gt;The manual says the following.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Subskeletons are inserted recursively, &lt;strong&gt;not once&lt;/strong&gt;, but as often as the user enters something at the subskeletons interactor. Thus there must be a &lt;code&gt;str&lt;/code&gt; in the subskeleton. They can also be used non-interactively, when prompt is a lisp-expression that returns successive list-elements.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Emphasis is mine, see section &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/autotype/Skeleton-Language.html#Skeleton-Language&quot; rel=&quot;nofollow&quot;&gt;Skeleton Language&lt;/a&gt; for more.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what this means:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default it repeats until you hit &lt;code&gt;RET&lt;/code&gt; or &lt;code&gt;C-g&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton skeleton-repeat-until-tired &quot;repeat until tired&quot;&#xA;  &quot;&quot;                                     ; empty top-level interactor&#xA;  (&quot;Enter something here, or press %s: &quot; ; stops on empty input string&#xA;   &quot;You entered '&quot; str &quot;'.\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To execute a subskeleton once, use &lt;code&gt;(&quot;&quot;)&lt;/code&gt; as the interactor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton skeleton-once &quot;executes a subskeletons once&quot;&#xA;  &quot;&quot;                                    ; empty top-level interactor&#xA;&#xA;  ((&quot;&quot;)&#xA;   &quot;insert stuff\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is just a special case of an &lt;em&gt;interactor&lt;/em&gt; used to loop over several strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton skeleton-loop-1 &quot;subskeletons as loops&quot;&#xA;  &quot;&quot;                                    ; empty top-level interactor&#xA;&#xA;  ((&quot;a&quot; &quot;b&quot; &quot;c&quot;)                        ; list if strings, execute subskeleton once per element&#xA;   &quot;str is &quot; str &quot;\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can compute these strings based on the context, too:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-strings ()&#xA;  (list (format &quot;you were at line %d&quot; (line-number-at-pos))))&#xA;&#xA;(define-skeleton skeleton-loop-2 &quot;subskeletons as loops&quot;&#xA;  &quot;&quot;                                    ; empty top-level interactor&#xA;&#xA;  `(,(my-strings)                        ; list if strings, execute subskeleton once per element&#xA;    &quot;str is &quot; str &quot;\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's one way to use this information to fix your skeleton:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton my-func-skeleton &quot;func skeleton&quot;&#xA;  &quot;&quot;&#xA;  (if (looking-back &quot;\n&quot;)&#xA;      ;; A function at left of screen is a top level function.&#xA;      `((,(skeleton-read &quot;Function name: &quot;))&#xA;        &quot;// &quot; str &quot; .&quot; \n&#xA;        &quot;func &quot; str &quot;(&quot; @ &quot;) {&quot; \n&#xA;        _ @ \n&#xA;        -1 &quot;}&quot;)&#xA;     ;; Otherwise it is an anonymous function. &#xA;    '((&quot;&quot;)&#xA;      &quot;func () {&quot; \n&#xA;       _ \n&#xA;       -1 &quot;}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-26T01:59:03.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3891" PostTypeId="2" ParentId="3887" CreationDate="2014-11-26T02:31:58.223" Score="5" Body="&lt;p&gt;You can use &lt;code&gt;(count-screen-lines &amp;amp;optional beg end count-final-newline window)&lt;/code&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Screen-Lines.html&quot; rel=&quot;noreferrer&quot;&gt;(manual page)&lt;/a&gt; to find the number of lines shown between two points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do the following to re-create the point's position on the screen:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((lines-down (count-screen-lines nil (point) t))&#xA;      (lines-from-top-of-window (count-screen-lines (window-start) (point) t))&#xA;      (diff-beg-of-line (- (point) (line-beginning-position))))&#xA;  ;; Code that redraws screen goes here:&#xA;  ;; &amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;&#xA;  ;; Now, to find your old position:&#xA;  (if (equal lines-down 0)&#xA;      ;; When the point is 1, lines-down is 0. In all other cases,&#xA;      ;; `count-screen-lines' is 1-indexed by the line. Set&#xA;      ;; `lines-down' to 1 to compensate for this edge case.&#xA;      (setq lines-down 1))&#xA;  (move-to-window-line (- lines-down 1))&#xA;  (recenter lines-from-top-of-window)&#xA;  (goto-char (+ (point) diff-beg-of-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2707" LastEditorUserId="2707" LastEditDate="2014-11-26T02:44:44.313" LastActivityDate="2014-11-26T02:44:44.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3892" PostTypeId="2" ParentId="3859" CreationDate="2014-11-26T06:11:55.767" Score="2" Body="&lt;p&gt;The problem is that you cannot directly paste code into an ipython session.  A &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2013-12/msg00087.html&quot; rel=&quot;nofollow&quot; title=&quot;post&quot;&gt;post on the Org mailing list&lt;/a&gt; by Arun Persaud gives a workaround that employs the &lt;code&gt;%cpaste&lt;/code&gt; magic command.  Here is a slightly simplified version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;; use %cpaste to paste code into ipython in org mode&#xA;(defadvice org-babel-python-evaluate-session&#xA;  (around org-python-use-cpaste&#xA;         (session body &amp;amp;optional result-type result-params) activate)&#xA;  &quot;add a %cpaste and '--' to the body, so that ipython does the right thing.&quot;&#xA;  (setq body (concat &quot;%cpaste -q \n&quot; body &quot;\n--&quot;))&#xA;  ad-do-it&#xA;  )&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After evaluating the above &lt;code&gt;defadvice&lt;/code&gt; your example works for me.  I have to ask though, what is the benefit of using ipython for the inferior shell?  If you are using babel, then surely you won't be interacting with the shell directly.&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2014-11-26T06:11:55.767" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3893" PostTypeId="1" AcceptedAnswerId="13683" CreationDate="2014-11-26T06:56:34.643" Score="18" ViewCount="2238" Body="&lt;p&gt;Right now, instead of pressing just &lt;code&gt;cc&lt;/code&gt; in magit-mode, I have to press &lt;code&gt;c-vc&lt;/code&gt; every time to enable &lt;code&gt;--verbose&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to make it enabled by default?&lt;/p&gt;&#xA;" OwnerUserId="2028" LastActivityDate="2019-04-02T03:46:38.350" Title="How can I make `--verbose` flag be enabled by default in magit commit screen?" Tags="|magit|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3894" PostTypeId="2" ParentId="3893" CreationDate="2014-11-26T08:21:22.937" Score="7" Body="&lt;p&gt;As far as I can tell Magit does not keep track of &quot;default&quot; options, but we can make &lt;strong&gt;it&lt;/strong&gt; &quot;press &lt;code&gt;-v&lt;/code&gt;&quot; every time the Committing buffer pops up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add #'magit-key-mode-popup-committing :after&#xA;            (lambda ()&#xA;              (magit-key-mode-toggle-option (quote committing) &quot;--verbose&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To find what function to advise, I opened a &lt;code&gt;magic-status&lt;/code&gt; buffer and pressed &lt;code&gt;C-h k c&lt;/code&gt;. This led me to &lt;code&gt;magit-key-mode-popup-committing&lt;/code&gt;. Then (with the Committing buffer still displayed) I pressed &lt;code&gt;C-h k -v&lt;/code&gt; to find the &lt;code&gt;lambda&lt;/code&gt; form Magit calls when &lt;em&gt;you&lt;/em&gt; press &lt;code&gt;-v&lt;/code&gt; in the Committing window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I did write this answer independently, but see &lt;a href=&quot;https://emacs.stackexchange.com/q/3289/2355&quot;&gt;Can I have the git-log “--all” option be initially selected?&lt;/a&gt;, the answer given there, and comments to that answer.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-11-27T06:55:19.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3895" PostTypeId="1" AcceptedAnswerId="10248" CreationDate="2014-11-26T09:31:01.913" Score="18" ViewCount="6386" Body="&lt;p&gt;Currently, my compilation command is as follow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~/somedir &amp;amp;&amp;amp; ./somescript.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This prevents emacs from finding the file in which an error happens (and opening it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I can run &lt;code&gt;M-x cd&lt;/code&gt; manually but is there a way to tell the buffer to change its current directory programmatically?&lt;/p&gt;&#xA;" OwnerUserId="2709" LastActivityDate="2020-03-10T02:36:23.253" Title="Changing the compilation mode current directory automatically?" Tags="|compilation-mode|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3896" PostTypeId="2" ParentId="3895" CreationDate="2014-11-26T09:40:52.410" Score="6" Body="&lt;p&gt;This alternate command should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun compile-in-dir (dir command)&#xA;  (interactive &quot;DCompile in directory: \nsCommand: &quot;)&#xA;  (let ((default-directory dir))&#xA;    (compile command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, after you have run the compilation using the regular &lt;code&gt;compile&lt;/code&gt; command, you can eval &lt;code&gt;(setq default-directory &quot;~/somedir&quot;)&lt;/code&gt; in the &lt;code&gt;*compilation*&lt;/code&gt; buffer. That should make the error navigation work, but it might stop &lt;code&gt;recompile&lt;/code&gt; and friends from doing the right thing.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-11-26T09:40:52.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3897" PostTypeId="2" ParentId="3886" CreationDate="2014-11-26T09:50:54.180" Score="1" Body="&lt;p&gt;I just wanted to say that there's value in top-level &lt;code&gt;global-set-key&lt;/code&gt;&#xA;statements.  In the screenshot below, I'm able to jump around my Emacs&#xA;config, including jumping to &lt;code&gt;global-set-key&lt;/code&gt; statements. You can see&#xA;that it matches just &lt;code&gt;ace&lt;/code&gt; in all my config files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And one more thing: many commands, such as &lt;code&gt;ace-jump-mode&lt;/code&gt; are autoloaded&#xA;so you can just bind them without &lt;code&gt;require&lt;/code&gt; or &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gVW5P.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function to jump is &lt;code&gt;lispy-goto&lt;/code&gt; from &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow noreferrer&quot;&gt;lispy&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-26T09:50:54.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3898" PostTypeId="1" AcceptedAnswerId="19319" CreationDate="2014-11-26T11:38:59.567" Score="24" ViewCount="4461" Body="&lt;p&gt;Let's say I have a merge conflict. I see a conflicted file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unstaged changes:&#xA;    Unmerged   Foo/bar/wibble/plop/elbow.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can hit tab here to open the changes and maybe jump to a point inside the file to fix by hand, but if it's a big file with lots of conflicts that can be time consuming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I ask git, through magit, to checkout the ours or theirs version of the file, to resolve the conflict? I can copy the path, then use &lt;code&gt;Shift-:&lt;/code&gt; to enter a custom git command, but it seems like there must be a keyboard shortcut for this. I can't see anything obvious in the magit menu or the &lt;code&gt;?&lt;/code&gt; pop-up.&lt;/p&gt;&#xA;" OwnerUserId="110" LastActivityDate="2016-01-06T20:53:44.657" Title="How to checkout ours/theirs on a file in magit?" Tags="|magit|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3900" PostTypeId="1" AcceptedAnswerId="3919" CreationDate="2014-11-26T13:23:35.053" Score="15" ViewCount="851" Body="&lt;p&gt;It's very common that, after pushing a given branch upstream, I'll want to visit it on github and create a pull request. I'm starting to get annoyed at having to manually visit the repo, find the branch, and create the PR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I write a command that visits the PR url in a browser?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PR url is given by &lt;code&gt;https://github.com/ORIGIN-REPO/compare/BRANCH-NAME&lt;/code&gt;. Since both the &lt;code&gt;origin&lt;/code&gt; and the &lt;code&gt;branch-name&lt;/code&gt; known by Magit (and by plain &lt;code&gt;git&lt;/code&gt;), it should be easy to write a command that builds that URL and calls &lt;code&gt;browse-url&lt;/code&gt; on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I know nothing about the internals workings of Magit,&#xA;so I don't know how to get that information.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2017-02-11T01:16:51.277" Title="Command to visit Github pull request of current branch with Magit" Tags="|magit|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3901" PostTypeId="1" CreationDate="2014-11-26T13:29:57.370" Score="4" ViewCount="2954" Body="&lt;p&gt;I am getting the following message when I do &lt;code&gt;C-x C-c&lt;/code&gt; to exit Emacs:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;error in process sentinel: Selecting deleted buffer&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So instead of exiting Emacs like normal, I am forced to close it through Task Manager. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An Internet search and some testing shows that it might be because of package prelude or flycheck but I have not installed it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How to find which package is causing this error and remove it? How can I debug this error?&lt;/p&gt;&#xA;" OwnerUserId="2517" LastEditorUserId="45" LastEditDate="2014-12-07T22:17:44.667" LastActivityDate="2014-12-27T18:08:24.657" Title="&quot;Error in process sentinel: Selecting deleted buffer&quot; when exiting Emacs?" Tags="|debugging|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3902" PostTypeId="1" AcceptedAnswerId="3903" CreationDate="2014-11-26T13:38:54.210" Score="1" ViewCount="355" Body="&lt;p&gt;Is it possible to avoid the &quot;File X is too large, really open?&quot; confirmation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, would it be possible for Emacs to remember my answer the first time I visited a large file? If I visited it once, I will surely want to really visit it again.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="25" LastEditDate="2014-11-26T15:58:04.183" LastActivityDate="2014-11-26T15:58:04.183" Title="docview: suppress &quot;File X is too large, really open?&quot; confirmation" Tags="|find-file|docview|large-files|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3903" PostTypeId="2" ParentId="3902" CreationDate="2014-11-26T13:41:49.933" Score="7" Body="&lt;p&gt;The variable is &lt;code&gt;large-file-warning-threshold&lt;/code&gt;. Documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;large-file-warning-threshold is a variable defined in `files.el'.&#xA;Its value is 10000000&#xA;&#xA;Documentation:&#xA;Maximum size of file above which a confirmation is requested.&#xA;When nil, never request confirmation.&#xA;&#xA;You can customize this variable.&#xA;&#xA;This variable was introduced, or its default value was changed, in&#xA;version 22.1 of Emacs.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found this by using &lt;code&gt;helm-apropos&lt;/code&gt; and searching for &quot;large file&quot;. &lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-11-26T13:41:49.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3904" PostTypeId="1" AcceptedAnswerId="3906" CreationDate="2014-11-26T14:32:38.570" Score="4" ViewCount="144" Body="&lt;p&gt;I cannot find a shortcut for the command \neq (not equal) in AUCTeX by the answers provided to my previous question &lt;a href=&quot;https://emacs.stackexchange.com/questions/3774&quot;&gt;A comprehensive list of shortcuts provided by AUCTeX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be great if it would be possible to associate the shortcut `= to \neq when working with emacs+auctex just in LaTeX-mode. Is is possible?   &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-11-26T15:18:32.283" Title="shortcut for \neq in AUCTeX" Tags="|key-bindings|auctex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3905" PostTypeId="1" AcceptedAnswerId="3907" CreationDate="2014-11-26T14:55:18.603" Score="4" ViewCount="401" Body="&lt;p&gt;I'm using &lt;code&gt;define-error&lt;/code&gt; to throw custom errors.&#xA;But it looks like this function wasn't yet implemented in &lt;code&gt;emacs-24.3&lt;/code&gt;, for instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It still seems to work for &lt;code&gt;emacs-24.3&lt;/code&gt; if I write this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (version&amp;lt; emacs-version &quot;24.4&quot;)&#xA;  (defun define-error (name message &amp;amp;optional parent)&#xA;    &quot;Define NAME as a new error signal.&#xA;MESSAGE is a string that will be output to the echo area if such an error&#xA;is signaled without being caught by a `condition-case'.&#xA;PARENT is either a signal or a list of signals from which it inherits.&#xA;Defaults to `error'.&quot;&#xA;    (unless parent (setq parent 'error))&#xA;    (let ((conditions&#xA;           (if (consp parent)&#xA;               (apply #'nconc&#xA;                      (mapcar (lambda (parent)&#xA;                                (cons parent&#xA;                                      (or (get parent 'error-conditions)&#xA;                                          (error &quot;Unknown signal `%s'&quot; parent))))&#xA;                              parent))&#xA;             (cons parent (get parent 'error-conditions)))))&#xA;      (put name 'error-conditions&#xA;           (delete-dups (copy-sequence (cons name conditions))))&#xA;      (when message (put name 'error-message message)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this the proper way to get &lt;code&gt;define-error&lt;/code&gt; in older Emacs? What was used before it was implemented?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-07-11T04:35:07.113" LastActivityDate="2015-07-11T04:35:07.113" Title="define-error for older Emacs?" Tags="|elisp|error-handling|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3906" PostTypeId="2" ParentId="3904" CreationDate="2014-11-26T15:08:17.070" Score="6" Body="&lt;p&gt;The variable &lt;code&gt;LaTeX-math-list&lt;/code&gt; allows you to add additional math shortcuts and menu entries. You can either customize it, or use &lt;code&gt;(add-to-list 'LaTeX-math-list '(?= &quot;neq&quot; &quot;Relational&quot; 8800))&lt;/code&gt; for your case. Each element of the list contains a key binding, the macro to insert, a submenu of the Math-menu to add an entry to, and a unicode code point for the corresponding symbol. Note that when not setting this through custom, you may have to call &lt;code&gt;(LaTeX-math-initialize)&lt;/code&gt; afterwards.&lt;/p&gt;&#xA;" OwnerUserId="735" LastEditorUserId="735" LastEditDate="2014-11-26T15:18:32.283" LastActivityDate="2014-11-26T15:18:32.283" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3907" PostTypeId="2" ParentId="3905" CreationDate="2014-11-26T15:46:17.603" Score="4" Body="&lt;p&gt;That looks fine, except that I'd use &lt;code&gt;(fboundp 'define-error)&lt;/code&gt; instead of testing the version number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until Emacs-24.3 what was used instead were manual calls to &lt;code&gt;put&lt;/code&gt; as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'foo-error 'error-conditions '(foo-error error))&#xA;(put 'foo-error 'error-message &quot;Foo on you!&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-11-26T15:46:17.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3908" PostTypeId="2" ParentId="3063" CreationDate="2014-11-26T16:11:10.573" Score="4" Body="&lt;p&gt;Though the bindings have evolved over time, as of today, when you invoke &lt;code&gt;ido-find-file&lt;/code&gt; or &lt;code&gt;ido-find-file-read-only&lt;/code&gt;, you can use the following bindings available in the default configuration:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-o&lt;/kbd&gt; invokes &lt;code&gt;ido-prev-work-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-M-o&lt;/kbd&gt; invokes &lt;code&gt;ido-next-work-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Apart from these not being as ergonomically pleasant as the &lt;kbd&gt;M-p&lt;/kbd&gt; and &lt;kbd&gt;M-n&lt;/kbd&gt; bindings I had been used to before trying &lt;em&gt;ido&lt;/em&gt;, they're also slow, and the consequent minibuffer chatter is distracting and confusing. &lt;em&gt;ido&lt;/em&gt; does something more than just show a recently opened file name; it reports that it's &quot;Searching for '&lt;em&gt;file name&lt;/em&gt;'...&quot;, perhaps out of reluctance to offer a name for a file that no longer exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;Searching for&quot; message comes from function &lt;code&gt;ido-make-merged-file-list&lt;/code&gt;. Reading &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/ido.el&quot; rel=&quot;nofollow&quot;&gt;the source&lt;/a&gt;, I don't see any way to disable whatever magic this function is doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may consider rebinding the &lt;code&gt;ido-prev-work-file&lt;/code&gt; and &lt;code&gt;ido-next-work-file&lt;/code&gt; pair to something more natural like &lt;kbd&gt;C-M-p&lt;/kbd&gt; and &lt;kbd&gt;C-M-n&lt;/kbd&gt;, or swapping the current &lt;kbd&gt;M-p&lt;/kbd&gt; (&lt;code&gt;ido-prev-work-directory&lt;/code&gt;) and &lt;kbd&gt;M-n&lt;/kbd&gt; (&lt;code&gt;ido-next-work-directory&lt;/code&gt;) bindings for these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the Emacs Lisp code to restore &lt;kbd&gt;M-p&lt;/kbd&gt; and &lt;kbd&gt;M-n&lt;/kbd&gt; to cycle through recent files, moving the default directory-focused bindings to &lt;kbd&gt;C-M-p&lt;/kbd&gt; and &lt;kbd&gt;C-M-n&lt;/kbd&gt; respectively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ido-setup-hook&#xA;          (lambda ()&#xA;            (let ((kmap ido-file-dir-completion-map))&#xA;              (let ((key '(meta ?n)))&#xA;                (define-key kmap (vector (cons 'control key))&#xA;                  (lookup-key kmap (vector key)))&#xA;                (define-key kmap (vector key) 'ido-next-work-file))&#xA;              (let ((key '(meta ?p)))&#xA;                (define-key kmap (vector (cons 'control key))&#xA;                  (lookup-key kmap (vector key)))&#xA;                (define-key kmap (vector key) 'ido-prev-work-file)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="643" LastEditorUserId="643" LastEditDate="2014-11-26T17:21:00.400" LastActivityDate="2014-11-26T17:21:00.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3909" PostTypeId="2" ParentId="3898" CreationDate="2014-11-26T17:19:01.153" Score="7" Body="&lt;p&gt;There are several solution:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use smerge-ediff. In the file with the conflict, you run &lt;code&gt;M-x smerge-ediff&lt;/code&gt;. It will put you in the ediff resolve mode, with four open buffer: yours, theirs, merge, and the command buffer. In the command buffer, you use &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; to go to next or previous hunk, &quot;a&quot; or &quot;b&quot; to accept change from the first or second buffer, or you can go to the merge buffer, and edit it to your liking.&lt;/li&gt;&#xA;&lt;li&gt;use ediff from magit, with &lt;code&gt;e&lt;/code&gt; on the stable version of magit, or &lt;code&gt;M-e&lt;/code&gt; or &lt;code&gt;M-m&lt;/code&gt; (&lt;code&gt;magit-ediff-resolve&lt;/code&gt;) in the next branch of magit, and then you will find yourself mostly like in the first case&lt;/li&gt;&#xA;&lt;li&gt;there is also smerge-mode, &lt;code&gt;C-c ^ n&lt;/code&gt; and &lt;code&gt;C-c ^ p&lt;/code&gt; will help you go from an hunk to the previous or next one, you can then edit them, or use &lt;code&gt;C-c ^ o&lt;/code&gt; to keep the 'other' version, &lt;code&gt;C-c ^ m&lt;/code&gt; to keep the 'mine' version, &lt;code&gt;C-c ^ b&lt;/code&gt; to keep the old version and &lt;code&gt;C-c ^ a&lt;/code&gt; to keep them all.&lt;/li&gt;&#xA;&lt;li&gt;you can use magit-find-file to open a file as it was in some commit.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="2237" LastEditDate="2014-11-26T20:56:52.493" LastActivityDate="2014-11-26T20:56:52.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3910" PostTypeId="2" ParentId="3650" CreationDate="2014-11-26T18:08:32.220" Score="17" Body="&lt;p&gt;Run emacs with XMODIFIERS set to @im=none:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XMODIFIERS=@im=none emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm surprised this still happens; I found this workaround some time ago, and forgot about it.  I would have assumed it would get fixed by now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some bug reports around for this; I can't find the (Debian) one that I originally read to get this workaround, but one relevant to Ubuntu is &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/emacs23/+bug/493766&quot;&gt;https://bugs.launchpad.net/ubuntu/+source/emacs23/+bug/493766&lt;/a&gt;.  There's also a discussion on the emacs-devel mailing list here: &lt;a href=&quot;http://thread.gmane.org/gmane.emacs.devel/170835&quot;&gt;http://thread.gmane.org/gmane.emacs.devel/170835&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2712" LastEditorUserId="2712" LastEditDate="2014-11-26T18:19:32.630" LastActivityDate="2014-11-26T18:19:32.630" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3911" PostTypeId="1" AcceptedAnswerId="3938" CreationDate="2014-11-26T19:06:08.907" Score="4" ViewCount="2572" Body="&lt;p&gt;When I hit &lt;kbd&gt;C-f2&lt;/kbd&gt; in any Mac OS X app (e.g., terminal, firefox), I get&#xA;keyboard access to the menu bar (file/edit/options &amp;amp;c)&#xA;In emacs I get a message &lt;code&gt;&amp;lt;C-f2&amp;gt; is undefined&lt;/code&gt; in the Echo Area.&#xA;When I hit &lt;kbd&gt;f10&lt;/kbd&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;menu-bar-open&lt;/code&gt;&lt;/a&gt;) in Emacs, get the 2 item menu &lt;code&gt;search with google&lt;/code&gt; and&#xA;&lt;code&gt;add to itunes as a spoken track&lt;/code&gt; or sometimes the single grayed-out item menu &lt;code&gt;select&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do i get Emacs to pass &lt;kbd&gt;C-f2&lt;/kbd&gt; to the OS?&lt;/li&gt;&#xA;&lt;li&gt;How do I get &lt;kbd&gt;f10&lt;/kbd&gt; to invoke the real menu in Emacs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="795" LastEditorUserId="1980" LastEditDate="2014-11-26T23:24:25.867" LastActivityDate="2021-01-23T09:38:03.287" Title="Access menu-bar using keyboard on Mac OS X" Tags="|key-bindings|osx|menu-bar|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3912" PostTypeId="1" AcceptedAnswerId="16604" CreationDate="2014-11-26T20:03:00.787" Score="14" ViewCount="4101" Body="&lt;p&gt;What's the simplest way of forcing Emacs org-mode to use the same fixed-width Font Family and Height everywhere (but keeping other properties distinct, like Foreground)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could make all &lt;code&gt;org-level-n&lt;/code&gt; faces inherit from &lt;code&gt;fixed-pitch&lt;/code&gt;, or make &lt;code&gt;variable-pitch&lt;/code&gt; actually reference a fixed-width font, for instance, but that would be cumbersome, I guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="340" LastActivityDate="2015-09-14T14:46:55.327" Title="Force using fixed-width font in org-mode" Tags="|org-mode|fonts|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3913" PostTypeId="1" CreationDate="2014-11-26T21:02:14.927" Score="-2" ViewCount="128" Body="&lt;p&gt;Are there definitive must-have modes when developing on rails, I usually get absorbed on the sea of different packages out there, is there some place that list them?&lt;/p&gt;&#xA;" OwnerUserId="131" LastActivityDate="2014-11-26T21:50:15.747" Title="Indispensable emacs modes for rails?" Tags="|ruby-mode|" AnswerCount="2" CommentCount="2" ClosedDate="2014-11-28T06:59:27.300" ContentLicense="CC BY-SA 3.0" />
  <row Id="3914" PostTypeId="2" ParentId="3913" CreationDate="2014-11-26T21:45:50.490" Score="1" Body="&lt;p&gt;You should definitely check both &lt;a href=&quot;https://github.com/pezra/rspec-mode&quot; rel=&quot;nofollow&quot;&gt;rspec-mode&lt;/a&gt; and &lt;a href=&quot;https://github.com/dgutov/robe&quot; rel=&quot;nofollow&quot;&gt;robe&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2014-11-26T21:45:50.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3915" PostTypeId="2" ParentId="3913" CreationDate="2014-11-26T21:50:15.747" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/asok/projectile-rails&quot; rel=&quot;nofollow&quot;&gt;projectile-rails&lt;/a&gt; is a nice all-around mode, especially for navigating between files within a project.&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2014-11-26T21:50:15.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3916" PostTypeId="2" ParentId="3912" CreationDate="2014-11-26T22:32:58.820" Score="4" Body="&lt;p&gt;I would use &lt;code&gt;face-remap-add-relative&lt;/code&gt;; see the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot; rel=&quot;nofollow&quot;&gt;Face Remapping&lt;/a&gt; section of the Emacs Lisp manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a hook that sets the &quot;family&quot; property of the &lt;code&gt;default&lt;/code&gt; face in Org mode buffers to &quot;Monospace&quot;, effectively turning &lt;code&gt;default&lt;/code&gt; into &lt;code&gt;fixed-pitch&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda () (face-remap-add-relative 'default :family &quot;Monospace&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-26T22:32:58.820" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3917" PostTypeId="2" ParentId="3911" CreationDate="2014-11-26T23:07:56.097" Score="0" Body="&lt;p&gt;This does work for me with &lt;kbd&gt;Fn ^F2&lt;/kbd&gt; (control function F2) using YAMAMOTO Mitsuharu's &quot;&lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot; rel=&quot;nofollow&quot;&gt;Emacs Mac Port&lt;/a&gt;&quot;, installed via Homebrew.  More precisely, my current OS and emacs versions are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;OS X 10.10.1 (14B25)&#xA;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, Carbon Version 157 AppKit 1343.14) of 2014-10-21 on iris-mac.crya.privado&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;kbd&gt;Fn ^F2&lt;/kbd&gt; shortcut is intercepted by the OS and never gets to Emacs.  It gives keyboard access to the menubar just as in other apps.  You have presumably turned on the option &quot;Use all F1, F2, etc keys as standard function keys&quot; in the Keyboard sheet of System Preferences, so you can just type &lt;kbd&gt;^F2&lt;/kbd&gt; without using the &lt;kbd&gt;Fn&lt;/kbd&gt; key. &lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2014-11-26T23:07:56.097" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3919" PostTypeId="2" ParentId="3900" CreationDate="2014-11-26T23:28:54.630" Score="9" Body="&lt;p&gt;Here's what I came up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pull-request-url ()&#xA;  &quot;Build the URL or the pull requestion on GitHub corresponding&#xA;to the current branch. Uses Magit.&quot;&#xA;  (interactive)&#xA;  (format &quot;%s/compare/%s&quot;&#xA;           (replace-regexp-in-string&#xA;            (rx (and string-start (1+ any) &quot;github.com:&quot; (group (1+ any)) &quot;.git&quot; string-end))&#xA;            &quot;https://github.com/\\1&quot;&#xA;            (magit-get &quot;remote&quot; (magit-get-current-remote) &quot;url&quot;))&#xA;          (magit-get-current-branch)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;magit.el&lt;/code&gt; is pretty easy to read, by the way.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-27T14:46:39.880" LastActivityDate="2014-11-27T14:46:39.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3920" PostTypeId="1" AcceptedAnswerId="3921" CreationDate="2014-11-27T00:22:17.110" Score="0" ViewCount="719" Body="&lt;p&gt;I am setting up my ERC client to connect to my ZNC IRC proxy server, and I am following &lt;a href=&quot;http://www.emacswiki.org/emacs/ErcZNC&quot; rel=&quot;nofollow noreferrer&quot;&gt;this Emacs wiki&lt;/a&gt;. At the following step:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Configure&#xA;M-x customize-group znc RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am in the Emacs customize menu where I enter my ZNC server information, but this information is only saved for the current session, and I have to re-enter for every session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the menu, with a warning at the top indicating that I cannot save my custom settings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FtvgH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to save with &lt;code&gt;C-x C-s&lt;/code&gt;, but I get the following message in the mini buffer:&#xA;&lt;code&gt;Saving settings from &quot;emacs -q&quot; would overwrite existing customizations&lt;/code&gt;. This doesn't make sense to me because I am not starting Emacs with a &lt;code&gt;-q&lt;/code&gt; flag. I am using the default Emacs desktop file from my Ubuntu installation, which loads my &lt;code&gt;.emac.d/init.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried investigating &lt;a href=&quot;http://www.emacswiki.org/emacs/CustomizingAndSaving#GetCustomizeToRecognizeChangedPreference&quot; rel=&quot;nofollow noreferrer&quot;&gt;this Emacs wiki page&lt;/a&gt;, where it says: &lt;code&gt;Customize stores saved values (for future sessions) in the property saved-value&lt;/code&gt;, but I'm not sure how to set this value, or where to begin with setting variables inside the Customize code. Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only other hint I have is that clicking on &lt;code&gt;State&lt;/code&gt; &gt; &lt;code&gt;Show Saved Lisp Expression&lt;/code&gt; at the bottom of the page, reveals my values as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;irc.lukeswart.net&quot; 5005 nil&#xA;   ((irc\.freenode\.net &quot;zncuser&quot; &quot;foo&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for the tips, it led me to discover the underlying problem and eventually fix it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem was in my Ubuntu desktop file, saved under &lt;code&gt;~/.local/share/applications/emacs24.desktop&lt;/code&gt;. Under this file, Emacs was starting with &lt;code&gt;emacs -q --load ~/path/to/my/init.el&lt;/code&gt;. I initially missed this desktop file because I was checking under &lt;code&gt;/usr/share/applications/emacs24.desktop&lt;/code&gt;. Anyway, here is the code that Customize adds to my &lt;code&gt;init.el&lt;/code&gt;, although this should not be added manually:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(markdown-command &quot;/usr/bin/pandoc&quot;)&#xA; '(znc-servers (quote ((&quot;irc.lukeswart.net&quot; 5005 nil ((irc\.freenode\.net &quot;zncuser&quot; &quot;foo&quot;)))))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2014-11-27T02:54:20.427" LastActivityDate="2014-11-27T02:54:20.427" Title="Emacs ZNC-ERC: How to make Customize save my preferences for all sessions" Tags="|customize|session|erc|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3921" PostTypeId="2" ParentId="3920" CreationDate="2014-11-27T00:40:18.273" Score="2" Body="&lt;p&gt;If you started Emacs normally, so that it read your init file, then yes, Customize should let you save any changes you make. If it does not, then that sounds like a bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you did not start Emacs using switch &lt;code&gt;q&lt;/code&gt; or &lt;code&gt;Q&lt;/code&gt; (or equivalent, which means not to read your init file), and if you tried to save Customize settings and Emacs gave you that error message, then that is a bug, I think. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;, describing just what you did so that the Emacs developers can reproduce the problem.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-27T00:40:18.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3922" PostTypeId="1" CreationDate="2014-11-27T03:42:08.080" Score="1" ViewCount="820" Body="&lt;p&gt;I've been having trouble with navigating in &lt;a href=&quot;http://melpa.org/#/paredit&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;paredit&lt;/code&gt;&lt;/a&gt;. When I try using &lt;code&gt;C-M-f&lt;/code&gt; and &lt;code&gt;C-M-b&lt;/code&gt; to go forward and backward, nothing happens. The minibuffer doesn't respond and the point doesn't move. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type &lt;code&gt;C-h f paredit-forward/backward&lt;/code&gt; it confirms that the function is bound to the keys mentioned above, and when I type &lt;code&gt;C-h m&lt;/code&gt; in a buffer with &lt;code&gt;paredit-mode&lt;/code&gt; enabled it shows the same binding. Other &lt;code&gt;paredit&lt;/code&gt; functionality works just fine - I'm slurping and barfing all over the place. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm beginning to suspect it's a problem with the &lt;code&gt;C-M&lt;/code&gt; combination. When I try to use &lt;code&gt;C-h k&lt;/code&gt; to identify the combination, nothing registers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Emacs on Windows 7 and Bodhi Linux (a Ubuntu derivative), and I see the same (lack of) behavior on both. Any insight would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2720" LastEditorUserId="2355" LastEditDate="2014-11-27T04:19:19.693" LastActivityDate="2014-11-27T04:19:19.693" Title="Paredit: paredit-forward and paredit-backward don't work" Tags="|key-bindings|balanced-parentheses|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3923" PostTypeId="1" AcceptedAnswerId="3924" CreationDate="2014-11-27T05:41:50.690" Score="6" ViewCount="1094" Body="&lt;p&gt;With C++11, the keyword &lt;code&gt;auto&lt;/code&gt; attained a new syntax and semantics.  However, it seems that CC-mode has not been aware of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I write &lt;code&gt;auto var = exp&lt;/code&gt;, I get &lt;code&gt;var&lt;/code&gt; in green, in which various types are displayed.  I don't like this; &lt;code&gt;var&lt;/code&gt; should look like other variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I teach CC-mode to do this?&lt;/p&gt;&#xA;" OwnerUserId="2721" LastActivityDate="2016-06-09T14:54:59.300" Title="Change the way CC-mode font-lock the C++11 `auto` syntax" Tags="|font-lock|c++|cc-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3924" PostTypeId="2" ParentId="3923" CreationDate="2014-11-27T06:21:22.710" Score="6" Body="&lt;p&gt;One option is to add &quot;auto&quot; to extra types recognized by &lt;code&gt;c++-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cc-mode)&#xA;(add-to-list 'c++-font-lock-extra-types &quot;auto&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The downside is that now it is not highlighted as a keyword any more. (But &quot;auto&quot; is both a type and a keyword, in a way.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-27T06:21:22.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3925" PostTypeId="1" AcceptedAnswerId="3926" CreationDate="2014-11-27T10:24:47.633" Score="30" ViewCount="10706" Body="&lt;p&gt;I use quite a few minor modes and usually I know which minor mode is enabled in every major mode. If I really want to see the full list, I can run &lt;kbd&gt;C-h v minor-mode-list&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, my mode line get really clogged, so when I vertically split frame, sometimes I cannot read end of the mode line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actual question: how to disable showing of minor modes list in mode line? For example, now it may look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-:--- main.c        All (7,12)     (C/l FlyC SScr Abbrev Fill) [main] 16:19 0.45&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want it to look more concise:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-:--- main.c        All (7,12)     (C/l) [main] 16:19&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="50" LastEditDate="2014-11-27T20:55:32.607" LastActivityDate="2020-05-27T05:18:38.920" Title="Hide list of minor modes in mode-line" Tags="|mode-line|minor-mode|" AnswerCount="9" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3926" PostTypeId="2" ParentId="3925" CreationDate="2014-11-27T10:44:02.743" Score="21" Body="&lt;p&gt;Diminish mode (available in Melpa) will do this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(diminish 'projectile-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="146" LastActivityDate="2014-11-27T10:44:02.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3927" PostTypeId="2" ParentId="3925" CreationDate="2014-11-27T11:42:58.177" Score="19" Body="&lt;p&gt;As mbork commented, you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/DelightedModes&quot;&gt;delight.el&lt;/a&gt; to selectively modify or disable minor (and indeed major) mode text in the mode line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the advantages is that it takes care of the &lt;code&gt;eval-after-load&lt;/code&gt; (which you need to write manually with diminish.el in most use-cases), which makes the configuration cleaner. You still need the same information -- the name of the mode, and the library which implements it (which Emacs will tell you if you ask it about the mode) -- but you can wrap it all up into a single form:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (require 'delight)&#xA; (delight '((some-mode nil &quot;some-library&quot;)&#xA;            (some-other-mode nil &quot;some-other-library&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Or follow the link above for some real usage examples.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend taking this approach, because even if you don't want &lt;em&gt;most&lt;/em&gt; minor mode lighter text, there's a good chance that you'll find some of them useful (and you can still modify those ones to be shorter).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you truly want to eliminate &lt;strong&gt;all&lt;/strong&gt; minor mode lighter text (and again, I don't recommend it), you could modify the &lt;code&gt;mode-line-modes&lt;/code&gt; variable. The mode line variables changed a while back, so you may want to use &lt;code&gt;M-x find-variable RET mode-line-modes RET&lt;/code&gt; and then manually adapt your default definition, editing out the section concerning &lt;code&gt;minor-modes-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course then you'd need to maintain it, which isn't so flash, so you might prefer replacing the &lt;code&gt;minor-mode-alist&lt;/code&gt; symbol &lt;em&gt;within&lt;/em&gt; the existing value. The following is somewhat implementation-specific, but certainly nicer than setting &lt;code&gt;mode-line-modes&lt;/code&gt; in its entirety, and you can toggle it on and off.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode minor-mode-blackout-mode&#xA;  &quot;Hides minor modes from the mode line.&quot;&#xA;  t)&#xA;&#xA;(catch 'done&#xA;  (mapc (lambda (x)&#xA;          (when (and (consp x)&#xA;                     (equal (cadr x) '(&quot;&quot; minor-mode-alist)))&#xA;            (let ((original (copy-sequence x)))&#xA;              (setcar x 'minor-mode-blackout-mode)&#xA;              (setcdr x (list &quot;&quot; original)))&#xA;            (throw 'done t)))&#xA;        mode-line-modes))&#xA;&#xA;(global-set-key (kbd &quot;C-c m&quot;) 'minor-mode-blackout-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-28T22:14:45.807" LastActivityDate="2014-11-28T22:14:45.807" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3928" PostTypeId="2" ParentId="3925" CreationDate="2014-11-27T12:41:48.273" Score="9" Body="&lt;p&gt;Here is what worked for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar hidden-minor-modes ; example, write your own list of hidden&#xA;  '(abbrev-mode            ; minor modes&#xA;    auto-fill-function&#xA;    flycheck-mode&#xA;    flyspell-mode&#xA;    inf-haskell-mode&#xA;    haskell-indent-mode&#xA;    haskell-doc-mode&#xA;    smooth-scroll-mode))&#xA;&#xA;(defun purge-minor-modes ()&#xA;  (interactive)&#xA;  (dolist (x hidden-minor-modes nil)&#xA;    (let ((trg (cdr (assoc x minor-mode-alist))))&#xA;      (when trg&#xA;        (setcar trg &quot;&quot;)))))&#xA;&#xA;(add-hook 'after-change-major-mode-hook 'purge-minor-modes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/questions/3925/hide-list-of-minor-modes-in-status-line/3928#comment5945_3928&quot;&gt;Drew's comment&lt;/a&gt;, I've improved realization of this solution. Now it uses benefits of association lists and should be a bit more efficient ;-)&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-27T18:39:42.967" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3929" PostTypeId="1" CreationDate="2014-11-27T15:19:38.747" Score="12" ViewCount="765" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I tell &lt;code&gt;isearch&lt;/code&gt; to ignore the contents of folded blocks by default in &lt;code&gt;org-mode&lt;/code&gt; buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I'd like &lt;code&gt;isearch&lt;/code&gt; to ignore contents of &lt;a href=&quot;http://orgmode.org/manual/Comment-lines.html&quot;&gt;comment blocks&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/manual/Drawers.html&quot;&gt;drawers&lt;/a&gt;: When authoring documents in &lt;code&gt;org-mode&lt;/code&gt; I often use comment blocks and custom drawers to store different kinds of notes about the text I am writing. I keep them folded by default to make sure their contents don't distract me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook #'org-hide-block-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works really well, but won't stop &lt;code&gt;org-mode&lt;/code&gt; from expanding these blocks if they contain matches for a string I am &lt;code&gt;isearch&lt;/code&gt;ing.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2014-11-28T04:25:24.967" Title="Make isearch skip folded content in org-mode" Tags="|org-mode|isearch|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3930" PostTypeId="2" ParentId="3929" CreationDate="2014-11-27T16:42:50.360" Score="8" Body="&lt;p&gt;While using &lt;code&gt;isearch&lt;/code&gt; you can toggle the search on invisible text with &lt;code&gt;M-s i&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also customize this behaviour with &lt;code&gt;M-x customize-group isearch&lt;/code&gt; and searching for &lt;code&gt;Search Invisible&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this will ignore everything in a folded block, I can't ignore only the text in a commented block.&lt;/p&gt;&#xA;" OwnerUserId="2489" LastActivityDate="2014-11-27T16:42:50.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3931" PostTypeId="2" ParentId="3929" CreationDate="2014-11-27T16:42:58.543" Score="13" Body="&lt;p&gt;You can set &lt;code&gt;search-invisible&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt; or using Customize. Then, if you &lt;em&gt;do&lt;/em&gt; want to show matches in invisible text, press &lt;code&gt;M-s i&lt;/code&gt; while using &lt;code&gt;isearch&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I found this by reading the docs of &lt;code&gt;isearch-forward&lt;/code&gt; and &lt;code&gt;isearch-toggle-invisible&lt;/code&gt;, but it is also documented in the manual: see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Special-Isearch.html#Special-Isearch&quot;&gt;Special Isearch&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This affects &lt;em&gt;all&lt;/em&gt; buffers, not just Org; if you want to use &lt;code&gt;nil&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; buffers and the default elsewhere you can create a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Intro-to-Buffer_002dLocal.html&quot;&gt;buffer-local binding&lt;/a&gt; in Org buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (make-local-variable 'search-invisible)&#xA;            (setq search-invisible nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-11-28T04:25:24.967" LastActivityDate="2014-11-28T04:25:24.967" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3932" PostTypeId="1" AcceptedAnswerId="3936" CreationDate="2014-11-27T17:16:38.827" Score="10" ViewCount="1110" Body="&lt;p&gt;Is there anyway to show outline with its &lt;a href=&quot;http://orgmode.org/manual/Checkboxes.html&quot;&gt;checkboxes&lt;/a&gt; in Org Agenda views like this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO Checkboxes [1/3]&#xA;   SCHEDULED: &amp;lt;2014-11-28 Fri 12:00&amp;gt;&#xA;- [X] Wash cloths&#xA;- [ ] Buy milk&#xA;- [ ] Wash dishes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently, my Agenda can only show its title outline:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;Friday     28 November 2014&#xA;               1:12...... now - - - - - - - - - - - - - - - - - - - - - - - - -&#xA;               8:00...... ----------------&#xA;              10:00...... ----------------&#xA;  Todo:       12:00...... Scheduled: TODO Checkboxes [1/3]&#xA;              12:00...... ----------------&#xA;              14:00...... ----------------&#xA;              16:00...... ----------------&#xA;              18:00...... ----------------&#xA;              20:00...... ----------------&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="515" LastActivityDate="2014-11-27T17:52:59.573" Title="Org - show checkboxes in Agenda?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3933" PostTypeId="2" ParentId="3925" CreationDate="2014-11-27T17:20:00.720" Score="9" Body="&lt;p&gt;Use &lt;a href=&quot;https://github.com/Bruce-Connor/rich-minority&quot; rel=&quot;noreferrer&quot;&gt;Rich-minority&lt;/a&gt; with config:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'rich-minority)&#xA;(rich-minority-mode 1)&#xA;(setf rm-blacklist &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have the thought like you, but I shorten the mode-line &lt;strong&gt;more paranoid&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Remove all unwanted spaces&lt;/li&gt;&#xA;&lt;li&gt;Remove all spaces and &quot;min-width&quot; of the buffer position info field.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Remove all unwanted spaces&#xA;(setq-default mode-line-format&#xA;          '(&quot;%e&quot; mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-buffer-identification mode-line-position&#xA;        (vc-mode vc-mode) &quot; &quot;&#xA;        mode-line-modes mode-line-misc-info mode-line-end-spaces))&#xA;;; Remove all spaces and &quot;min-width&quot; of position info on mode-line&#xA;(setq mode-line-position&#xA;      `((1 ,(propertize&#xA;         &quot; %p&quot;&#xA;         'local-map mode-line-column-line-number-mode-map&#xA;         'mouse-face 'mode-line-highlight&#xA;         ;; XXX needs better description&#xA;         'help-echo &quot;Size indication mode\n\&#xA;mouse-1: Display Line and Column Mode Menu&quot;))&#xA;    (size-indication-mode&#xA;     (2 ,(propertize&#xA;          &quot;/%I&quot;&#xA;          'local-map mode-line-column-line-number-mode-map&#xA;          'mouse-face 'mode-line-highlight&#xA;          ;; XXX needs better description&#xA;          'help-echo &quot;Size indication mode\n\&#xA;mouse-1: Display Line and Column Mode Menu&quot;)))&#xA;    (line-number-mode&#xA;     ((column-number-mode&#xA;       (1 ,(propertize&#xA;        &quot;(%l,%c)&quot;&#xA;        'local-map mode-line-column-line-number-mode-map&#xA;        'mouse-face 'mode-line-highlight&#xA;        'help-echo &quot;Line number and Column number\n\&#xA;mouse-1: Display Line and Column Mode Menu&quot;))&#xA;       (1 ,(propertize&#xA;        &quot;L%l&quot;&#xA;        'local-map mode-line-column-line-number-mode-map&#xA;        'mouse-face 'mode-line-highlight&#xA;        'help-echo &quot;Line Number\n\&#xA;mouse-1: Display Line and Column Mode Menu&quot;))))&#xA;     ((column-number-mode&#xA;       (1 ,(propertize&#xA;        &quot;C%c&quot;&#xA;        'local-map mode-line-column-line-number-mode-map&#xA;        'mouse-face 'mode-line-highlight&#xA;        'help-echo &quot;Column number\n\&#xA;mouse-1: Display Line and Column Mode Menu&quot;))))))&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I can always see Twittering-mode notification and Org-mode's timer :D&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2014-12-02T11:11:51.887" LastActivityDate="2014-12-02T11:11:51.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3934" PostTypeId="1" AcceptedAnswerId="3935" CreationDate="2014-11-27T17:22:49.443" Score="7" ViewCount="1505" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/vermiculus/sx.el&quot;&gt;&lt;code&gt;sx.el&lt;/code&gt;&lt;/a&gt;, we have a case where we need to verify if we've passed &lt;code&gt;GET&lt;/code&gt; or &lt;code&gt;POST&lt;/code&gt; as an argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently we have the argument passing as a string and are using &lt;code&gt;(string= &quot;GET&quot; url-method)&lt;/code&gt; to compare it to &lt;code&gt;&quot;GET&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any elisp/byte-compilation advantage to changing it to a symbol &lt;code&gt;(equal url-method 'GET)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2016-07-03T04:46:14.617" Title="Performance differences in comparing symbols and strings" Tags="|elisp|byte-compilation|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3935" PostTypeId="2" ParentId="3934" CreationDate="2014-11-27T17:26:37.460" Score="11" Body="&lt;p&gt;New users of Lisp who come from other languages sometimes use strings for such purposes out of habit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbols can be compared with &lt;code&gt;eq&lt;/code&gt; instead of just &lt;code&gt;equal&lt;/code&gt;.  &lt;code&gt;string=&lt;/code&gt; uses code similar to &lt;code&gt;equal&lt;/code&gt;, to test each character until a mismatch is found. So yes, symbol comparison can be slightly faster. If you are using the comparison in a loop, for instance, the difference might matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, depending on the particular code, it can often make the code simpler or more readable to use symbols instead of strings. And there are functions (and macros etc.) that expect symbols or that compare things using &lt;code&gt;eq&lt;/code&gt; (or &lt;code&gt;eql&lt;/code&gt;) by default. To use those with strings you need to anyway convert to symbols.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-27T17:26:37.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3936" PostTypeId="2" ParentId="3932" CreationDate="2014-11-27T17:52:59.573" Score="10" Body="&lt;p&gt;View the EntryText in Agenda view by pressing &quot;v&quot; then &quot;E&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot interact with the checkboxes, but you can view them this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, &quot;follow mode&quot; (press &quot;F&quot; in Agenda view) might also help you get what you want. The checkboxes won't be in the Agenda, but you have easy access to them.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2014-11-27T17:52:59.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3937" PostTypeId="2" ParentId="3612" CreationDate="2014-11-27T18:09:12.493" Score="3" Body="&lt;p&gt;You have to use a more recent version of irony-mode to have automatic loading. This feature is supported since irony-mode's version &lt;code&gt;0.2.0-cvs&lt;/code&gt;. &lt;code&gt;M-x irony-version&lt;/code&gt; to know you version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To load the compile options manually the method has changed, you can call the interactive function &lt;code&gt;irony-cdb-autosetup-compile-options&lt;/code&gt; manually: &lt;code&gt;M-x irony-cdb-autosetup-compile-options RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make this process automatic, you only need to add call this function automatically when irony-mode is enabled. This is easily done with a the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Setting-Hooks.html#Setting-Hooks&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;add-hook&lt;/code&gt; function&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your irony-mode configuration add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://github.com/Sarcasm/irony-mode#configuration&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Sarcasm/irony-mode#configuration&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="901" LastEditorUserId="901" LastEditDate="2014-12-06T12:29:23.817" LastActivityDate="2014-12-06T12:29:23.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3938" PostTypeId="2" ParentId="3911" CreationDate="2014-11-27T18:19:42.490" Score="3" Body="&lt;p&gt;Here is the solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;C-&amp;lt;f2&amp;gt;&quot;)&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (x-popup-menu (list '(0 0) (selected-frame))&#xA;                  (mouse-menu-bar-map))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=07efa3f0ba196c1eea130032c765d5d1a62fa627&quot; rel=&quot;nofollow&quot;&gt;fixed in the source tree&lt;/a&gt; so that now &lt;kbd&gt;f10&lt;/kbd&gt; does the right thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives mouse-less access to the menu-bar &lt;em&gt;functionality&lt;/em&gt;, not the OS menu &lt;em&gt;interface&lt;/em&gt;, so the question of how to tell Emacs to pass certain keys to the OS remains open.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2014-11-27T19:37:20.900" LastActivityDate="2014-11-27T19:37:20.900" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3939" PostTypeId="1" AcceptedAnswerId="3940" CreationDate="2014-11-27T19:37:51.000" Score="5" ViewCount="227" Body="&lt;p&gt;I'm uploading a .el file to my server, and I'd like to set my &lt;code&gt;.htaccess&lt;/code&gt; so that the file gets downloaded rather than displayed in the browser.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-11-27T19:37:51.000" Title="What is the proper MIME type for .el files?" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3940" PostTypeId="2" ParentId="3939" CreationDate="2014-11-27T19:37:51.000" Score="7" Body="&lt;p&gt;The proper type for Emacs Lisp files is &lt;code&gt;text/elisp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be added to your &lt;code&gt;.htaccess&lt;/code&gt; with this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AddType text/elisp el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Firefox, for example, now recognizes it as &quot;Emacs Lisp source code&quot;, and offers to download it.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-11-27T19:37:51.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3941" PostTypeId="1" AcceptedAnswerId="3942" CreationDate="2014-11-27T21:20:55.887" Score="6" ViewCount="376" Body="&lt;p&gt;I would like the period at the end of a sentence to be added automatically when two spaces are typed (similar to how typing works in iPhones).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use two spaces between sentences, so the transformation I would like to happen would look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;b l a h SPC SPC  --&amp;gt;  b l a h . SPC SPC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I plan to use this along with the auto-capitalize mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2014-12-01T09:08:12.287" Title="When typing, automatically transform SPC SPC into PERIOD SPC SPC" Tags="|key-bindings|capitalization|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3942" PostTypeId="2" ParentId="3941" CreationDate="2014-11-27T21:30:06.947" Score="10" Body="&lt;p&gt;Give this a go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun freaky-space ()&#xA;  (interactive)&#xA;  (cond ((looking-back &quot;\\(?:^\\|\\.\\)  +&quot;)&#xA;         (insert &quot; &quot;))&#xA;        ((eq this-command&#xA;             last-command)&#xA;         (backward-delete-char 1)&#xA;         (insert &quot;.  &quot;))&#xA;        (t&#xA;         (insert &quot; &quot;))))&#xA;&#xA;(define-key text-mode-map &quot; &quot; 'freaky-space)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-11-27T21:30:06.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3944" PostTypeId="2" ParentId="3941" CreationDate="2014-11-27T21:33:14.763" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/KeyChord&quot; rel=&quot;nofollow&quot;&gt;Keychords&lt;/a&gt; would let you do this. You would also want &lt;code&gt;SPC SPC&lt;/code&gt; to be translated to &lt;code&gt;. SPC&lt;/code&gt; only when you type them fast enough. That's exactly what keychords would do. After installing &lt;code&gt;key-chord&lt;/code&gt; you can define something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define-local (kbd &quot;SPC SPC&quot;) (lambda () (insert &quot;. &quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="264" LastEditDate="2014-12-01T09:08:12.287" LastActivityDate="2014-12-01T09:08:12.287" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3945" PostTypeId="1" CreationDate="2014-11-28T00:49:36.097" Score="5" ViewCount="1461" Body="&lt;p&gt;I was trying to operate on remote host using eshell and was disappointed to discover that majority of operations would hang emacs for several seconds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found it surprising considering that normally eshell executes subprocesses asynchronously and upon further investigation found that eshell reopens TRAMP connections for any external command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is sequence of commands which I pass eshell buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ cd /ssh:aws:&#xA;/ssh:aws:/home/ubuntu $ ps&#xA;  PID TTY          TIME CMD&#xA;12212 pts/3    00:00:00 ps&#xA;/ssh:aws:/home/ubuntu $ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And messages which indicate that eshell opens connection several times:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for aws using ssh...&#xA;Tramp: Sending command `exec ssh   -o ControlPath=/tmp/tramp.32766gT7.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none aws'&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Tramp: Found remote shell prompt on `aws'&#xA;Tramp: Opening connection for aws using ssh...done&#xA;Tramp: Opening connection for aws using ssh...&#xA;Tramp: Sending command `exec ssh -q   -o ControlPath=/tmp/tramp.32766gT7.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none aws'&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Tramp: Found remote shell prompt on `aws'&#xA;Tramp: Opening connection for aws using ssh...done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it a limitation of eshell that it needs to spawn new shell every invocation of non-builtin command or could I make it use TRAMP shell which, judging by list-processes, appears to persist since I first navigated to a path handled by TRAMP?&lt;/p&gt;&#xA;" OwnerUserId="279" LastActivityDate="2014-12-02T13:00:37.130" Title="Eshell doesn't reuse TRAMP connection for remote subprocesses" Tags="|tramp|eshell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3946" PostTypeId="2" ParentId="3934" CreationDate="2014-11-28T06:01:14.307" Score="7" Body="&lt;p&gt;Note that the lisp reader &lt;em&gt;interns&lt;/em&gt; symbols, such that independent references to a given symbol give you the &lt;em&gt;exact same lisp object&lt;/em&gt;, and consequently you're able to compare them with &lt;code&gt;eq&lt;/code&gt; (which only needs to compare the object addresses).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely, independent strings are always &lt;em&gt;different lisp objects&lt;/em&gt;, and therefore you have to compare their contents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would therefore expect the &lt;code&gt;eq&lt;/code&gt; comparison to win for performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Curiously enough (I'm certainly very surprised), some trivial testing with &lt;code&gt;benchmark-run&lt;/code&gt; is giving &lt;code&gt;string=&lt;/code&gt; the win by quite a margin. This seems very odd to me. YMMV?&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Edit: So I just noticed this answer (and its comment) again, and felt inspired to see if I could recreate and explain the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. Nothing is byte-compiled initially.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first realisation was that my symbols were &lt;code&gt;quote&lt;/code&gt;d and the strings were not, and I immediately found that the &lt;code&gt;quote&lt;/code&gt; was responsible for bulk of the speed difference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark-run 10000000&#xA;  (string= &quot;foo&quot; &quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is, for smallish strings, consistently quicker than:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark-run 10000000&#xA;  (eq 'foo 'foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;however, if we also quote the string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark-run 10000000&#xA;  (string= '&quot;foo&quot; '&quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that almost evens things out entirely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, on average, unless the string is quite large, the string comparison &lt;em&gt;still&lt;/em&gt; seems to win by a hair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative approach is to bind the objects to variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((foo 'test)&#xA;      (bar 'test))&#xA;  (benchmark-run 10000000&#xA;    (eq foo bar)))&#xA;&#xA;(let ((foo &quot;test&quot;)&#xA;      (bar &quot;test&quot;))&#xA;  (benchmark-run 10000000&#xA;    (string= foo bar)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once again, I'm seeing the string comparison faster by a nose, on average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After byte-compilation, I'm only seeing a consistent result for the let-bound variable cases, where &lt;code&gt;eq&lt;/code&gt; is consistently faster than &lt;code&gt;string=&lt;/code&gt; (taking about 2/3 of the time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the other examples I'm getting nonsensical (to me) outcomes like the quoted strings being quicker than the unquoted strings, which I can only guess is effectively noise from other aspects of the execution and/or &lt;code&gt;benchmark-run&lt;/code&gt; itself. There was enough variety between different runs of the same function to entirely obscure any differences between runs of different functions.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;My conclusions are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) &lt;code&gt;eq&lt;/code&gt; comparisons with a symbol can (somewhat counter-intuitively) be &lt;em&gt;slower&lt;/em&gt; than a string comparison, if the symbol is quoted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) Unless the strings are rather large, the practical differences are utterly negligible, and so I wouldn't bother converting one to the other for purely performance reasons.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-07-03T04:46:14.617" LastActivityDate="2016-07-03T04:46:14.617" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3947" PostTypeId="1" CreationDate="2014-11-28T06:41:49.237" Score="0" ViewCount="269" Body="&lt;p&gt;I am using &lt;code&gt;filecache&lt;/code&gt; as a source to &lt;code&gt;helm-for-files&lt;/code&gt; because it ends up being faster than using something like &lt;code&gt;helm-ls-git&lt;/code&gt;(EDITED) or &lt;code&gt;helm-projectile&lt;/code&gt;. This approach works fine till the cache has around 16000 files. On trying to append another list of around 2000 files, I see emacs memory usage spike until it gets terminated by the OS. At around a file-cache of 16000 file names, the mem usage is around 400mb(that's the gc-limit I have set). On adding these 2000 more files, it hits 10gb and gets killed, since thats the value of &lt;code&gt;ulimit -v&lt;/code&gt;. This sounds very much like a bug. Has anyone run into this?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="14920" LastEditDate="2018-09-24T21:20:52.780" LastActivityDate="2018-09-24T21:20:52.780" Title="Trouble with file-cache" Tags="|helm-for-files|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3948" PostTypeId="2" ParentId="3947" CreationDate="2014-11-28T06:52:51.260" Score="3" Body="&lt;p&gt;Projectile can cache if you enable it with &lt;code&gt;(setq projectile-enable-caching t)&lt;/code&gt;. After caching is enabled and after you open the file list with &lt;code&gt;helm-projectile-find-file&lt;/code&gt;/&lt;code&gt;projectile-find-file&lt;/code&gt; for &lt;strong&gt;once&lt;/strong&gt;, the subsequent invocations gives you the list instanly (~1 second). It works with the Linux kernel source tree with more than 36000 files. My work laptop is using an average hard drive with only 5400 RPM, the &lt;a href=&quot;http://storage.toshiba.com/storagesolutions/archived-models/mkxx65gsx-series&quot; rel=&quot;nofollow&quot;&gt;MKxx65GSX Hard Disk Drive&lt;/a&gt;. Here is &lt;a href=&quot;http://www.harddrivebenchmark.net/hdd.php?hdd=TOSHIBA+MK3265GS&quot; rel=&quot;nofollow&quot;&gt;its ranking&lt;/a&gt;. Not very impressive, as you can see, and the first invocation of &lt;code&gt;helm-projectile-find-file&lt;/code&gt; took around ~3 seconds on it, including ignoring files and sorting files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried once with my home directory that contains 100k files and &lt;code&gt;git init&lt;/code&gt; it. It took quite a while to retrieve the files, but once the files are retrieved and cached, subsequent invocations of &lt;code&gt;helm-projectile-find-file&lt;/code&gt; happens instantly, with no lag when entering pattern and get results immediately. This is just a test and I don't use Projectile with my home directory though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, there was no memory spike as you suggested because essentially Projectile only stores file list as plain text and does some fancy text processing to manipulate the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: &lt;code&gt;helm-git&lt;/code&gt; is an old package (from 2012). If you want real speed, use &lt;code&gt;helm-ls-git&lt;/code&gt; that is created from Helm maintainer. It is fast because essentially it only retrieve the list of files from the command &lt;code&gt;git ls-files&lt;/code&gt; without fancy processing like removing ignore files and sorting files and create directory list. Took ~1 second on the Linux source tree to for &lt;code&gt;helm-ls-git&lt;/code&gt; command to present me the file list. &lt;code&gt;helm-projectile-find-file&lt;/code&gt; needs more time because it does more, but you are compensated by its caching.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-11-28T07:07:09.910" LastActivityDate="2014-11-28T07:07:09.910" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3949" PostTypeId="1" AcceptedAnswerId="3980" CreationDate="2014-11-28T07:17:20.730" Score="3" ViewCount="612" Body="&lt;p&gt;I want the &lt;a href=&quot;http://melpa.org/#/auto-capitalize&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-capitalize&lt;/code&gt;&lt;/a&gt; minor mode to work well with org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, auto-capitalize does not capitalize the first word in headings or list items (i.e., the word after '*' or '-').  For example, the following transformations are not working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* heading      --&amp;gt;   * Heading&#xA;** subheading  --&amp;gt;   ** Subheading&#xA; - item        --&amp;gt;    - Item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to fix auto-capitalize to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried changing the sentence-end regexp (which is used by auto-capitalize to decide what to capitalize), but it didn't work out.  I added the following without success: &lt;code&gt;\\(^\\*+ \\|^ +- \\)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="2355" LastEditDate="2014-11-30T04:41:16.117" LastActivityDate="2014-11-30T04:41:16.117" Title="fixing auto-capitalize to work with org-mode headings and lists" Tags="|org-mode|capitalization|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3950" PostTypeId="1" CreationDate="2014-11-28T09:51:20.137" Score="1" ViewCount="234" Body="&lt;p&gt;As a c# coder and emacs user, I've been playing with omnisharp (&lt;a href=&quot;https://github.com/OmniSharp/omnisharp-emacs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/OmniSharp/omnisharp-emacs&lt;/a&gt;). It mostly seems to be working - following the instructions on that page I got company integrated well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However m-x doesn't find almost all of the helm integrations, omnisharp-helm-find-usages and the like. helm-imenu works, with all the functions from the local file listed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A brief look at the source shows that the helm integrations are included under this conditional:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (require 'helm-grep nil 'noerror)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...using m-x, I can't find helm-grep. I have helm-grep-mode and helm-grep-help, but no individual helm-grep. I can't find a package called that on elpa or melpa either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought maybe I need to require 'helm &lt;em&gt;before&lt;/em&gt; omnisharp in my init.el, but the docs linked above don't actually ask me to require 'omnisharp, just to add the hook to csharp-mode. &lt;/p&gt;&#xA;" OwnerUserId="110" LastActivityDate="2014-11-28T09:51:20.137" Title="Omnisharp not making helm integrations available" Tags="|helm|csharp-mode|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3951" PostTypeId="2" ParentId="3925" CreationDate="2014-11-28T12:02:12.283" Score="3" Body="&lt;p&gt;I'll throw my solution to this into the ring as well:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modeline-set-lighter (minor-mode lighter)&#xA;  (when (assq minor-mode minor-mode-alist)&#xA;    (setcar (cdr (assq minor-mode minor-mode-alist)) lighter)))&#xA;&#xA;(defun modeline-remove-lighter (minor-mode)&#xA;  (modeline-set-lighter minor-mode &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;modeline-set-lighter&lt;/code&gt; allows you to set the lighter of a minor mode to any string you like. &lt;code&gt;modeline-remove-lighter&lt;/code&gt; allows you to remove the lighter of a minor mode completely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, at the end of my init-file I just call these functions for the minor modes whose lighters I want to modify:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(modeline-remove-lighter 'auto-complete-mode)&#xA;(modeline-remove-lighter 'git-gutter+-mode)&#xA;(modeline-remove-lighter 'guide-key-mode)&#xA;(modeline-remove-lighter 'whitespace-mode)&#xA;(modeline-set-lighter 'abbrev-mode &quot; Abbr&quot;)&#xA;(modeline-set-lighter 'auto-fill-function (string 32 #x23ce))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-14T09:15:40.123" LastActivityDate="2015-01-14T09:15:40.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3952" PostTypeId="2" ParentId="271" CreationDate="2014-11-28T13:45:10.573" Score="11" Body="&lt;p&gt;I have tried all of the above options (even the tap recommended by Reiner in a comment above) by none have worked well for me (trackpad scrolling problems, hangings, etc.). I am quite happy, however, with Yamamoto Mitsuharu's fork, as mantained by railway's github page. It is up-to-date with respect to the official GNU version. Simply download the &lt;code&gt;.dmg&lt;/code&gt; image here: &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port/wiki/Downloads&quot;&gt;https://github.com/railwaycat/emacs-mac-port/wiki/Downloads&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2014-11-28T13:45:10.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3953" PostTypeId="1" AcceptedAnswerId="3967" CreationDate="2014-11-28T14:04:42.937" Score="1" ViewCount="508" Body="&lt;p&gt;I am using a slightly modified version of &lt;code&gt;doc-view&lt;/code&gt; mode and would like to maintain focus in a different window, while hovering with the mouse over the &lt;code&gt;doc-view&lt;/code&gt; window and scroll the image page-up or page-down -- &lt;em&gt;without&lt;/em&gt; actually selecting the window.  When not selecting the window and attempting to scroll with the mouse, I get the following error message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case it makes a difference, my operating system is OSX 10.6.8 (Snow Leopard).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp t)&#xA;  image-mode-winprops(nil)&#xA;  image-mode-window-get(page nil)&#xA;  (+ (image-mode-window-get (quote page) nil) (or arg 1))&#xA;  (dv-goto-page (+ (image-mode-window-get (quote page) nil) (or arg 1)))&#xA;  dv-next-page(1)&#xA;  funcall-interactively(dv-next-page 1)&#xA;  call-interactively(dv-next-page nil nil)&#xA;  command-execute(dv-next-page)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; (November 28, 2014):  The following is the debugger readout for the stock version of &lt;code&gt;doc-view-mode&lt;/code&gt; using the following mouse wheel assignments that I added:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Key assignments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key doc-view-mode-map (kbd &quot;&amp;lt;wheel-down&amp;gt;&quot;) 'doc-view-next-page)&#xA;&#xA;(define-key doc-view-mode-map (kbd &quot;&amp;lt;wheel-up&amp;gt;&quot;) 'doc-view-previous-page)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs version: &lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin10.8.0, NS appkit-1038.36 Version 10.6.8 (Build 10K549)) of 2014-10-01 on MP.local&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Debugger readout:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp t)&#xA;  image-mode-winprops(nil)&#xA;  image-mode-window-get(page nil)&#xA;  doc-view-next-page(1)&#xA;  funcall-interactively(doc-view-next-page 1)&#xA;  call-interactively(doc-view-next-page nil nil)&#xA;  command-execute(doc-view-next-page)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="105" LastEditDate="2014-12-21T04:10:16.683" LastActivityDate="2014-12-21T04:10:16.683" Title="Scroll other window (doc-view) -- by page -- with mouse wheel" Tags="|elisp|osx|docview|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3954" PostTypeId="1" AcceptedAnswerId="3956" CreationDate="2014-11-28T16:09:48.533" Score="0" ViewCount="152" Body="&lt;p&gt;I am using emacs 24.4 in Org-mode and try to narrow/widen to/from subtrees using &lt;kbd&gt;C-x n s&lt;/kbd&gt; and &lt;kbd&gt;C-x n w&lt;/kbd&gt;, repsectively. However Widening is not working and once I have narrowed down to a particular subtree I am stuck there until the next time I visit the file. I would appreciate any thoughts to resolve the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: complete beginner here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solved: My bad; I failed to scroll up after widening, it was there, I just couldn't see it.&lt;/p&gt;&#xA;" OwnerUserId="2734" LastEditorUserId="2734" LastEditDate="2014-11-28T17:40:08.363" LastActivityDate="2014-11-28T17:45:23.203" Title="Buffer widening not working in Org-mode" Tags="|org-mode|buffers|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3955" PostTypeId="1" AcceptedAnswerId="14011" CreationDate="2014-11-28T16:58:21.683" Score="7" ViewCount="1214" Body="&lt;p&gt;If I insert an image into a latex file (via &lt;code&gt;\includegraphics&lt;/code&gt;) auctex lets me select the file and inserts the filename. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However using this dialogue, I can only choose the filename and cannot see previews of images as in file chooser dialogues of usual GUI programs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get this in emacs too? I.e. have image thumbnail previews when selecting an image for my tex file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; I just discovered &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;icicles&lt;/code&gt;&lt;/a&gt; mode which generates thumbnails for &lt;code&gt;find-file&lt;/code&gt;. However it doesn't seem to work with auctex and completion in &lt;code&gt;\includegraphics&lt;/code&gt; out of the box. &lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2014-12-18T16:18:39.133" LastActivityDate="2015-09-04T14:25:24.360" Title="Select images in auctex with preview" Tags="|latex|auctex|icicles|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3956" PostTypeId="2" ParentId="3954" CreationDate="2014-11-28T17:45:23.203" Score="0" Body="&lt;p&gt;I can't reproduce your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't it just a display issue when you are in the last portion of the file? After widening, try going to the buffer beginning (&lt;kbd&gt;M-&amp;lt;&lt;/kbd&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2526" LastActivityDate="2014-11-28T17:45:23.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3957" PostTypeId="2" ParentId="3863" CreationDate="2014-11-28T20:07:02.277" Score="4" Body="&lt;p&gt;There is also &lt;a href=&quot;http://www.geeknote.me/&quot; rel=&quot;nofollow&quot;&gt;Geeknote&lt;/a&gt;, which at least gets Evernote to the command-line. You would still have to manually move things between org-mode and Geeknote though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Now there is &lt;a href=&quot;https://github.com/avendael/emacs-geeknote&quot; rel=&quot;nofollow&quot;&gt;geeknote.el&lt;/a&gt;. Haven't tried it yet but it looks nice.&lt;/p&gt;&#xA;" OwnerUserId="2736" LastEditorUserId="2736" LastEditDate="2015-07-29T14:22:23.680" LastActivityDate="2015-07-29T14:22:23.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3958" PostTypeId="1" AcceptedAnswerId="3959" CreationDate="2014-11-28T20:46:55.290" Score="5" ViewCount="2268" Body="&lt;p&gt;If I set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ac-set-trigger-key &quot;C-o&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;.emacs&lt;/code&gt;, &lt;code&gt;C-o&lt;/code&gt; does trigger auto-completion but TAB still does too. It seems that &lt;code&gt;C-o&lt;/code&gt; is added to the triggers, while I want it to substitute TAB, so that when I press TAB no auto-completion is performed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With YASnippet you can do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So that the binding is removed, is there something similar for auto-complete?&lt;/p&gt;&#xA;" OwnerUserId="2737" LastEditorUserId="253" LastEditDate="2014-12-29T12:56:56.233" LastActivityDate="2015-01-14T09:11:29.797" Title="Remove TAB trigger from auto-complete" Tags="|key-bindings|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3959" PostTypeId="2" ParentId="3958" CreationDate="2014-11-28T21:26:06.703" Score="4" Body="&lt;p&gt;&lt;code&gt;auto-complete&lt;/code&gt; defines three keymaps that might be relevant here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;ac-mode-map&lt;/code&gt;: This map is active when &lt;code&gt;auto-complete-mode&lt;/code&gt; is enabled. &lt;code&gt;ac-set-trigger-key&lt;/code&gt; adds the binding for the trigger key to this map.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;ac-completing-map&lt;/code&gt;: This map is active during completion. By default, &lt;code&gt;TAB&lt;/code&gt; is bound to &lt;code&gt;ac-expand&lt;/code&gt; in this map.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;ac-menu-map&lt;/code&gt;: This map is active while the popup showing possible completions is displayed (in addition to &lt;code&gt;ac-completing-map&lt;/code&gt;), but only if &lt;code&gt;ac-use-menu-map&lt;/code&gt; is set to a non-&lt;code&gt;nil&lt;/code&gt; value.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to make sure &lt;code&gt;TAB&lt;/code&gt; won't do anything that's even remotely related to completion, you should probably &quot;unset&quot; the bindings in all of these maps (using the same technique you demonstrate for &lt;code&gt;yas-minor-mode-map&lt;/code&gt; in your question).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a minimal configuration that keeps &lt;code&gt;TAB&lt;/code&gt; from doing completion:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(define-key ac-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key ac-completing-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key ac-completing-map [tab] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can try it out by starting Emacs via &lt;code&gt;emacs -Q&lt;/code&gt;, copying the code into the &lt;code&gt;*scratch*&lt;/code&gt; buffer and running &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;eval-buffer&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-14T09:11:29.797" LastActivityDate="2015-01-14T09:11:29.797" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3960" PostTypeId="2" ParentId="798" CreationDate="2014-11-28T22:55:19.267" Score="24" Body="&lt;p&gt;Yes there is a package for recording screencasts in Emacs, it's called&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://github.com/Bruce-Connor/camcorder.el&quot;&gt;camcorder.el&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I can't promise anything yet, as I've only tested it on my computer,&#xA;but I can tell you it works for me. :-)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To use it, simply call &lt;code&gt;M-x camcorder-record&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;A new smaller frame will popup and recording starts.&lt;/li&gt;&#xA;&lt;li&gt;When you're finished, hit &lt;code&gt;F12&lt;/code&gt; and wait for the conversion to finish.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Screencasts can be generated in any format understood by&#xA;&lt;code&gt;imagemagick&lt;/code&gt;'s &lt;code&gt;convert&lt;/code&gt; command. &#xA;You can even pause the recording with &lt;code&gt;F11&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to record without a popup frame, use &lt;code&gt;M-x camcorder-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Dependencies&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For the recording, &lt;code&gt;camcorder.el&lt;/code&gt; uses the following linux utilities.&#xA;If you have these, it should work out of the box. If you use something&#xA;else, you should still be able to make it work by configuring the&#xA;&lt;code&gt;camcorder-recording-command&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;recordmydesktop&lt;/li&gt;&#xA;&lt;li&gt;mplayer&lt;/li&gt;&#xA;&lt;li&gt;imagemagick&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Troubleshooting&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;On my machine, I noticed that the window-id Emacs reported with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;%x&quot; &#xA; (string-to-number&#xA;  (frame-parameter (selected-frame) 'window-id)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;differed from the id that the WM reported with the &lt;code&gt;wminfo&lt;/code&gt; utility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the variable &lt;code&gt;camcorder-window-id-offset&lt;/code&gt; to correct that.&#xA;The default value is &lt;code&gt;-4&lt;/code&gt;, but you might need to increase or decrease&#xA;that to make those two numbers match.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-29T20:39:30.150" LastActivityDate="2014-11-29T20:39:30.150" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3961" PostTypeId="1" AcceptedAnswerId="3966" CreationDate="2014-11-28T22:57:55.880" Score="9" ViewCount="4091" Body="&lt;p&gt;Is there any easy way to flush all output in the &lt;code&gt;shell&lt;/code&gt; buffer? Since recently (I believe Emacs 24.4 already has this) &lt;code&gt;*shell*&lt;/code&gt; buffers aren't editable, they behave similar to how typical terminal would behave, i.e. only allowing you to append text at the end, or to flush the last output, but you can't add text at any place or remove part of it arbitrarily. It feels like I'm missing something important about this improvement (?). It actually makes it more annoying. I searched the docs for the &lt;code&gt;*shell*&lt;/code&gt; and &lt;code&gt;*Messages*&lt;/code&gt; buffers, but couldn't find a mention of the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the original question: what's the point of this change? To me this doesn't feel like an improvement at all, so, unless there's &quot;a catch&quot;, I'd like to set it to read-write as default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm talking about Emacs &lt;s&gt;24.4&lt;/s&gt;, 25.0.50.1 of course.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2014-11-29T18:18:38.490" LastActivityDate="2016-11-05T17:28:19.960" Title="Flush all output in shell buffer (and *Messages* too)" Tags="|shell|message|read-only-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3962" PostTypeId="2" ParentId="3961" CreationDate="2014-11-28T23:23:51.253" Score="17" Body="&lt;p&gt;You can clean up the &lt;code&gt;*Messages*&lt;/code&gt; buffer the same way you always could, with the &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/kill-buffer&quot;&gt;&lt;code&gt;kill-buffer&lt;/code&gt;&lt;/a&gt; command.&#xA;The next time a message is signaled, the buffer will be recreated anew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that this buffer is read-only now, is that it has been granted&#xA;&lt;a href=&quot;http://endlessparentheses.com/new-messages-buffer-mode.html&quot;&gt;its own major-mode&lt;/a&gt;, which inherits from&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/special-mode&quot;&gt;&lt;code&gt;special-mode&lt;/code&gt;&lt;/a&gt;,&#xA;which is read-only. The advantages behind that are several.&#xA;&lt;code&gt;special-mode&lt;/code&gt; is designed for reading, so it has several keybindings&#xA;that are very convenient for buffers that are not meant to be edited.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what &lt;code&gt;*shell*&lt;/code&gt; has to do with anything. But if you want&#xA;to erase it, &lt;code&gt;M-x&lt;/code&gt;&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/erase-buffer&quot;&gt;&lt;code&gt;erase-buffer&lt;/code&gt;&lt;/a&gt;&#xA;should do.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-11-28T23:23:51.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3963" PostTypeId="1" AcceptedAnswerId="3972" CreationDate="2014-11-29T00:47:49.887" Score="11" ViewCount="391" Body="&lt;p&gt;I've run into a few situations where it would be highly convenient to&#xA;have to have the keymap of one major-mode act as a fallback keymap for&#xA;another major-mode. For instance:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I write a lot of LaTeX in some of my org documents, so it would be&#xA;great to have &lt;code&gt;latex-mode&lt;/code&gt; commands easily available while editing&#xA;&lt;code&gt;org-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I frequent an irc room with Markdown support, so it would also be&#xA;nice to have &lt;code&gt;markdown-mode&lt;/code&gt; keybinds added to &lt;code&gt;erc-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In both cases this extra keymap should act as a &lt;strong&gt;fallback&lt;/strong&gt; (this why&#xA;I can't just use a minor mode for this). I don't want latex commands&#xA;to override any &lt;code&gt;org-mode&lt;/code&gt; keys. What I want is:&lt;br&gt;&#xA;&lt;em&gt;If a key is defined in &lt;code&gt;latex-mode-map&lt;/code&gt; AND it is not defined in&#xA;&lt;code&gt;org-mode-map&lt;/code&gt; then use the &lt;code&gt;latex-mode-map&lt;/code&gt; binding&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I set a keymap as a fallback keymap for a major-mode?&lt;br&gt;&#xA;&lt;strong&gt;OR&lt;/strong&gt;&lt;br&gt;&#xA;&lt;strong&gt;Q:&lt;/strong&gt; How can copy keys from one major-mode-map to another, without overriding anything?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Just to be clear. I know I could define these keys one by one, but&#xA;it would be infinitely more convenient to have an automated solution. &lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="253" LastEditDate="2014-12-29T12:56:42.940" LastActivityDate="2016-07-14T12:55:13.037" Title="Use two major-mode-maps in the same buffer" Tags="|key-bindings|keymap|major-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3964" PostTypeId="1" CreationDate="2014-11-17T15:24:24.027" Score="20" ViewCount="3426" Body="&lt;p&gt;One may set &lt;code&gt;org-deadline-warning-days&lt;/code&gt; to have &lt;code&gt;DEADLINE&lt;/code&gt; items show up a default number of days &lt;em&gt;before&lt;/em&gt; the deadline in the agenda, or one may do it on a case-by-case basis by adding, e.g., &lt;code&gt;-3d&lt;/code&gt; to the &lt;code&gt;DEADLINE&lt;/code&gt; timestamp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, using the same warning notation &lt;code&gt;-3d&lt;/code&gt; on a &lt;code&gt;SCHEDULED&lt;/code&gt; item produces the reverse effect: the item is not added but skipped from the Agenda view for that number of days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Org-mode manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt; If you want to _delay_ the display of this task in the agenda, use&#xA; `SCHEDULED: &amp;lt;2004-12-25 Sat -2d&amp;gt;': the task is still scheduled on&#xA; the 25th but will appear two days later.  In case the task&#xA; contains a repeater, the delay is considered to affect all&#xA; occurrences; if you want the delay to only affect the first&#xA; scheduled occurrence of the task, use `--2d' instead.  See&#xA; `org-scheduled-delay-days' and&#xA; `org-agenda-skip-scheduled-delay-if-deadline' for details on how to&#xA; control this globally or per agenda.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What can this be useful for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is if you want to start working on an item and you schedule it for a specific date, you want to start seeing the item in the agenda &lt;strong&gt;at least&lt;/strong&gt; on the scheduled day, and may be even earlier, but definitely not later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="2590" OwnerDisplayName="Alexander Shcheblikin" LastEditorUserId="2274" LastEditDate="2015-07-30T00:35:45.677" LastActivityDate="2016-01-17T09:47:26.667" Title="What's the point of delaying SCHEDULED items from displaying in org-mode Agenda?" Tags="|org-mode|org-agenda|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3966" PostTypeId="2" ParentId="3961" CreationDate="2014-11-29T04:57:34.847" Score="5" Body="&lt;p&gt;&lt;code&gt;(erase-buffer)&lt;/code&gt; won't work on comint and shell buffers if they are read-only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the defun I use quite often for clearing shellish buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun clear-comint-buffer ()&#xA;  (interactive)&#xA;  (let ((old-max comint-buffer-maximum-size))&#xA;    (setq comint-buffer-maximum-size 0)&#xA;    (comint-truncate-buffer)&#xA;    (setq comint-buffer-maximum-size old-max)&#xA;    (goto-char (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could perhaps bind this to &lt;code&gt;s-k&lt;/code&gt; in your relevant modes to mimic the clearing behavior of OSX's Terminal.app.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 11/2016&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhere in Emacs 25 development (and also in my latest build which is &quot;26.0.50.1&quot;), &lt;code&gt;(comint-clear-buffer)&lt;/code&gt; was added to &lt;code&gt;comint-mode&lt;/code&gt;, which is a more concise version of my custom defun. Here's the source for reference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comint-clear-buffer ()&#xA;  &quot;Clear the comint buffer.&quot;&#xA;  (interactive)&#xA;  (let ((comint-buffer-maximum-size 0))&#xA;    (comint-truncate-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This built-in solution also works if you have &lt;code&gt;(setq comint-prompt-read-only t)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="264" LastEditorUserId="264" LastEditDate="2016-11-05T17:28:19.960" LastActivityDate="2016-11-05T17:28:19.960" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3967" PostTypeId="2" ParentId="3953" CreationDate="2014-11-29T08:33:22.553" Score="1" Body="&lt;p&gt;When &lt;code&gt;doc-view-mode&lt;/code&gt; is enabled, &lt;code&gt;mwheel-scroll-up-function&lt;/code&gt; is set locally to be &lt;code&gt;doc-view-scroll-up-or-next-page&lt;/code&gt;; and, &lt;code&gt;mwheel-scroll-down-function&lt;/code&gt; is set locally to be &lt;code&gt;doc-view-scroll-down-or-previous-page&lt;/code&gt;.  The preferred behavior sought by the original poster in the question above is that the mouse-wheel activate &lt;code&gt;doc-view-next-page&lt;/code&gt; and &lt;code&gt;doc-view-previous-page&lt;/code&gt; when focus is in another unrelated buffer window, and the mouse is hovering over the &lt;code&gt;doc-view-mode&lt;/code&gt; buffer window.  The code set out below resolves that issue.  Although the original poster tried binding &lt;code&gt;doc-view-next-page&lt;/code&gt; to &lt;code&gt;wheel-down&lt;/code&gt; and &lt;code&gt;doc-view-previous-page&lt;/code&gt; to &lt;code&gt;wheel-up&lt;/code&gt;, that is not correct and this is why the original poster received the error message that was cited above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behavior of &lt;code&gt;doc-view-scroll-up-or-next-page&lt;/code&gt; and &lt;code&gt;doc-view-scroll-down-or-previous-page&lt;/code&gt; is slightly different than &lt;code&gt;doc-view-next-page&lt;/code&gt; and &lt;code&gt;doc-view-previous-page&lt;/code&gt;.  Ultimately, this is a matter of personal preference and the issue was simply how to implement that preference.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun doc-view-mouse-turn-page ()&#xA;  (when (boundp 'mwheel-scroll-up-function)&#xA;    (setq-local mwheel-scroll-up-function #'doc-view-next-page))&#xA;  (when (boundp 'mwheel-scroll-down-function)&#xA;    (setq-local mwheel-scroll-down-function #'doc-view-previous-page)))&#xA;&#xA;(add-hook 'doc-view-mode-hook 'doc-view-mouse-turn-page)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-11-29T08:53:41.533" LastActivityDate="2014-11-29T08:53:41.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3968" PostTypeId="1" AcceptedAnswerId="3969" CreationDate="2014-11-29T09:42:00.893" Score="3" ViewCount="453" Body="&lt;p&gt;How can I use &lt;code&gt;yasnippet&lt;/code&gt; to invoke LaTeX commands interactively? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;code&gt;auctex&lt;/code&gt; to insert &lt;code&gt;\usepackage&lt;/code&gt; it starts a minibuffer which lets me select the desired package (including tab completion). Similar for other commands like &lt;code&gt;includegraphics&lt;/code&gt;. Is it possible to make &lt;code&gt;yasnippet&lt;/code&gt; to do the same, i.e. help me choosing the package or image etc.?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="253" LastEditDate="2014-11-29T15:39:33.003" LastActivityDate="2014-11-29T15:39:33.003" Title="Yasnippet prompt when using commands interactively?" Tags="|latex|auctex|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3969" PostTypeId="2" ParentId="3968" CreationDate="2014-11-29T12:12:24.827" Score="4" Body="&lt;p&gt;You can tell &lt;code&gt;yasnippet&lt;/code&gt; to interpret its &lt;a href=&quot;https://capitaomorte.github.io/yasnippet/snippet-development.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;type&lt;/code&gt;&lt;/a&gt; as a &lt;code&gt;command&lt;/code&gt; rather than a &lt;code&gt;snippet&lt;/code&gt; to interpret the body as lisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example allows you to enter LaTeX environments (e.g., as if you had used &lt;code&gt;C-c C-e&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: environment&#xA;# key: env&#xA;# type: command&#xA;# --&#xA;(call-interactively #'LaTeX-environment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here's another option to insert the &lt;code&gt;\includegraphics&lt;/code&gt; macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: includegraphics&#xA;# key: ingr&#xA;# type: command&#xA;# --&#xA;(TeX-insert-macro &quot;includegraphics&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-11-29T13:11:31.777" LastActivityDate="2014-11-29T13:11:31.777" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3970" PostTypeId="1" CreationDate="2014-11-29T12:50:50.160" Score="6" ViewCount="293" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I make &lt;code&gt;org-mode&lt;/code&gt; warn me when I'm about to schedule a task on top of another task?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I frequently schedule tasks or meetings (with &lt;code&gt;org-deadline&lt;/code&gt; or &lt;code&gt;org-schedule&lt;/code&gt;) at a specific hour on some day in the distant future.  However, I rarely remember what I already have scheduled on that day, and often discover later that I have double-booked a time slot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: I use &lt;code&gt;org-deadline&lt;/code&gt; to schedule a meeting for next Thursday from 9am-10am, but already have a preexisting meeting next Thursday from 8:30am-10:30am.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way, when entering a timestamp/scheduled event/deadline, to have &lt;code&gt;org-mode&lt;/code&gt; warn me when I'm about to double-book a timeslot?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-11-30T20:25:54.097" Title="org-mode warning when scheduling task on top of another task?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3971" PostTypeId="1" AcceptedAnswerId="3991" CreationDate="2014-11-29T15:10:43.057" Score="4" ViewCount="1973" Body="&lt;p&gt;I'm having a hell of a time with getting Org Mode's key bindings to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that maybe the difficulties I was having had to do with what &lt;a href=&quot;http://orgmode.org/manual/TTY-keys.html&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; describes, since I was using Emacs text-mode via &lt;code&gt;Terminal.app&lt;/code&gt; (on a Mac).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I decided to try &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;Emacs for Mac&lt;/a&gt;, which (presumably) I could use as a free-standing application, thereby circumventing whatever problems &lt;code&gt;Terminal.app&lt;/code&gt; may be causing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it turns out that, &lt;em&gt;with Emacs for Mac I can type even fewer Org Mode key-bound commands!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In this post, I will abbreviate Emacs for Mac as McE, and Emacs via &lt;code&gt;Terminal.app&lt;/code&gt; as TME, short for &quot;text-mode Emacs&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me start with the case of &lt;code&gt;&amp;lt;M-right&amp;gt;&lt;/code&gt;, by way of example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;code&gt;describe-bindings&lt;/code&gt; (&lt;code&gt;C-h b&lt;/code&gt;) for Org Mode, &lt;code&gt;&amp;lt;M-right&amp;gt;&lt;/code&gt; should be bound to &lt;code&gt;org-metaright&lt;/code&gt;.  This is not terribly informative, but the documentation for &lt;code&gt;org-metaright&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-metaright is an interactive compiled Lisp function in `org.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(org-metaright &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Demote a subtree, a list item or move table column to right.&#xA;  In front of a drawer or a block keyword, indent it correctly.&#xA;  With no specific context, calls the Emacs default `forward-word'.&#xA;  See the individual commands for more information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Now, suppose that &lt;code&gt;org-mode&lt;/code&gt; is the buffer's major mode, point is at a subtree's heading, and I type the key sequence I'd use for &lt;code&gt;&amp;lt;M-right&amp;gt;&lt;/code&gt;, namely, &lt;kbd&gt;esc&lt;/kbd&gt; followed by &lt;kbd&gt;&amp;rarr;&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do this in TME, the subtree is demoted, exactly as the documentation says, but if I do it in McE, all I get is that point advances forward by one word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, in McE, if I type the same sequence (&lt;kbd&gt;esc&lt;/kbd&gt; , &lt;kbd&gt;&amp;rarr;&lt;/kbd&gt;) into &lt;code&gt;describe-key&lt;/code&gt; (&lt;code&gt;C-h k&lt;/code&gt;), I don't get the documentation for &lt;code&gt;org-metaright&lt;/code&gt;, but rather the one for &lt;code&gt;forward-word&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ESC &amp;lt;right&amp;gt; (translated from &amp;lt;escape&amp;gt; &amp;lt;right&amp;gt;) runs the command&#xA;  forward-word, which is an interactive built-in function in `C source&#xA;  code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to M-f, ESC &amp;lt;right&amp;gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(forward-word &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move point forward ARG words (backward if ARG is negative).&#xA;  If ARG is omitted or nil, move point forward one word.&#xA;  Normally returns t.&#xA;  If an edge of the buffer or a field boundary is reached, point is left there&#xA;  and the function returns nil.  Field boundaries are not noticed if&#xA;  `inhibit-field-text-motion' is non-nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It gets worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;M-right&amp;gt;&lt;/code&gt; at least works correctly in TME, but &lt;code&gt;&amp;lt;M-S-right&amp;gt;&lt;/code&gt; I can't get to work anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;code&gt;describe-bindings&lt;/code&gt;, &lt;code&gt;&amp;lt;M-S-right&amp;gt;&lt;/code&gt; is supposed to be bound to (you guessed it) &lt;code&gt;org-shiftmetaright&lt;/code&gt;.  In McE, however, if I type into &lt;code&gt;describe-key&lt;/code&gt; the sequence for &lt;code&gt;&amp;lt;M-S-right&amp;gt;&lt;/code&gt; (namely, &lt;kbd&gt;esc&lt;/kbd&gt;, &lt;kbd&gt;shift&lt;/kbd&gt; + &lt;kbd&gt;&amp;rarr;&lt;/kbd&gt;, where I'm pressing the last two keys simultaneously), I again get the docs for &lt;code&gt;forward-word&lt;/code&gt; pretty much as shown earlier, except for a small change in the first line:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ESC &amp;lt;right&amp;gt; (translated from &amp;lt;escape&amp;gt; &amp;lt;S-right&amp;gt;) runs the command&#xA;  forward-word, which is an interactive built-in function in `C source&#xA;  code'.&lt;br/&gt;&#xA;  ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The silver lining is the mention of &amp;lt;escape&amp;gt; &amp;lt;S-right&amp;gt; in this first line, because it shows that McE is at least detecting the &lt;kbd&gt;shift&lt;/kbd&gt; press (which is the reason I bothered to install McE in the first place).  Unfortunately, it is discarding that piece information, and mistranslating what's left (after all ESC &amp;lt;right&amp;gt; should be bound to &lt;code&gt;org-metaright&lt;/code&gt;, not to &lt;code&gt;forward-word&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing the same thing in TME produces:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ESC &amp;lt;right&amp;gt; (translated from ESC M-O C) runs the command&lt;br&gt;&#xA;  org-metaright, which is an interactive compiled Lisp function in&#xA;  `org.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &amp;lt;M-right&amp;gt;, ESC &amp;lt;right&amp;gt;, C-c C-x r, &amp;lt;menu-bar&amp;gt; &amp;lt;Org&amp;gt;&lt;br&gt;&#xA;  &amp;lt;Edit Structure&amp;gt; &amp;lt;Demote Heading&amp;gt;, &amp;lt;menu-bar&amp;gt; &amp;lt;Tbl&amp;gt; &amp;lt;Column&amp;gt; &amp;lt;Move&lt;br&gt;&#xA;  Column Right&amp;gt;.                                                                                                                                         &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(org-metaright &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Demote a subtree, a list item or move table column to right.&#xA;  In front of a drawer or a block keyword, indent it correctly.&#xA;  With no specific context, calls the Emacs default `forward-word'.&#xA;  See the individual commands for more information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;...which sounds a bit better (it's the documentation for &lt;em&gt;some&lt;/em&gt; Org Mode command at least!), but it seems that the shift is not getting through at all.  I can't figure out what the &lt;code&gt;M-O C&lt;/code&gt; in the first line is referring to. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What can I do to get these key bindings to work properly?&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2014-11-29T16:19:30.820" LastActivityDate="2018-09-12T15:13:40.000" Title="How to type Org Mode's `M-` bindings in Emacs for Mac?" Tags="|org-mode|key-bindings|osx|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3972" PostTypeId="2" ParentId="3963" CreationDate="2014-11-29T15:45:49.033" Score="12" Body="&lt;p&gt;This turned out to be simpler then expected. As suggested in the comments here and on the question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'erc&#xA;  (require 'markdown-mode)&#xA;  (require 'cl-lib)&#xA;  (setq erc-mode-map&#xA;        (make-composed-keymap (cl-copy-list erc-mode-map)&#xA;                              markdown-mode-map)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will create a keymap which is a copy of &lt;code&gt;erc-mode-map&lt;/code&gt; but which&#xA;also inherits from &lt;code&gt;markdown-mode-map&lt;/code&gt;. So all &lt;code&gt;markdown&lt;/code&gt; keys will be&#xA;shadowed whenever they collide with &lt;code&gt;erc&lt;/code&gt; keys. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you &lt;strong&gt;do&lt;/strong&gt; want some keys of the fallback keymap to outshine the&#xA;main kemap, just disable them in main one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key erc-mode-map &quot;\C-c\C-a&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-06-08T13:59:01.737" LastActivityDate="2015-06-08T13:59:01.737" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3973" PostTypeId="1" AcceptedAnswerId="3986" CreationDate="2014-11-29T16:56:57.873" Score="2" ViewCount="168" Body="&lt;p&gt;I have files like &lt;code&gt;model.rb&lt;/code&gt; and &lt;code&gt;model_spec.rb&lt;/code&gt; in my Rails project. &#xA;Both have ruby as major mode and using a regex doesn't work on the Specs filter group.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ibuffer-saved-filter-groups&#xA;  (quote ((&quot;default&quot;&#xA;            (&quot;Ruby&quot; &#xA;              (mode . ruby-mode))&#xA;            (&quot;Specs&quot;&#xA;              (name . &quot;spec\.rb$&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2742" LastEditorUserId="2355" LastEditDate="2014-11-29T17:21:30.037" LastActivityDate="2014-11-30T13:25:27.003" Title="ibuffer: how to filter ruby and rspec buffer into separate groups?" Tags="|ibuffer|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3974" PostTypeId="1" AcceptedAnswerId="3984" CreationDate="2014-11-29T18:09:49.353" Score="3" ViewCount="383" Body="&lt;p&gt;Normally &lt;code&gt;return&lt;/code&gt; key is just &lt;code&gt;newline&lt;/code&gt;, I believe a lot of people bind it to &lt;code&gt;newline-and-indent&lt;/code&gt;, but &lt;code&gt;return&lt;/code&gt; is relatively common used key, the &lt;code&gt;C-u RET&lt;/code&gt; and &lt;code&gt;C-- RET&lt;/code&gt; basically do nothing but same as &lt;code&gt;return&lt;/code&gt;, I don't want to waste prefix features. How can I make it do these?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If I type &lt;code&gt;return&lt;/code&gt;, it will do normal things(e.g., it will create a new line and indent if I type &lt;code&gt;return&lt;/code&gt; at the end of a line; it will split the line from here, create new line, jump to it and then indent if I type &lt;code&gt;return&lt;/code&gt; in the middle of the line.)&lt;/li&gt;&#xA;&lt;li&gt;If I type &lt;code&gt;C-u return&lt;/code&gt;(whether in the middle or at the end of the line), it will create a new line(not split), jump to it but not indent.(like &lt;code&gt;C-e C-o C-n&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;If I type &lt;code&gt;C-- return&lt;/code&gt;(whether in the middle or at the end of the line), it will create a new line above the current line and jump to it.(like &lt;code&gt;C-a C-o&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I already made these happen using &lt;code&gt;global-set-key&lt;/code&gt;, but wasted &lt;code&gt;S-return&lt;/code&gt; and &lt;code&gt;M-S-return&lt;/code&gt;, if anyone can advance the default &lt;code&gt;return&lt;/code&gt; key using prefix argument feature, that would be better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: &#xA;I got the following &lt;code&gt;defun&lt;/code&gt;, but it doesn't work, what's wrong with it?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun advanced-return (&amp;amp;optional arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (if (equal arg '-)&#xA;      (progn&#xA;        (beginning-of-line)&#xA;        (open-line))&#xA;    (if (equal arg '(4))&#xA;        (progn&#xA;          (end-of-line)&#xA;          (open-line)&#xA;          (next-line))&#xA;      (newline-and-indent))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you can make it work, is it possible not to &lt;code&gt;defun&lt;/code&gt; a new function, but just put them inside &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;return&amp;gt;&quot;)&#xA;...&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2014-11-30T00:48:37.707" LastActivityDate="2014-11-30T03:52:27.517" Title="Make `return` key more powerful" Tags="|indentation|line-break|newlines|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3975" PostTypeId="1" AcceptedAnswerId="3988" CreationDate="2014-11-29T18:40:36.473" Score="13" ViewCount="1033" Body="&lt;p&gt;I have an &lt;code&gt;org-mode&lt;/code&gt; table that needs to have some math text in each cell. Wrapping every cell with &lt;code&gt;$&lt;/code&gt; both looks ugly and takes much more space than it deserves. Is there any way to somehow put the whole table in math (LaTeX) environment so that all text inside the table would be interpreted as formulas?&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="50" LastEditDate="2014-11-29T20:20:12.907" LastActivityDate="2014-12-01T17:47:46.007" Title="Is it possible to have the entire org-table use math environment?" Tags="|org-mode|latex|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3976" PostTypeId="1" CreationDate="2014-11-29T20:38:35.663" Score="2" ViewCount="299" Body="&lt;p&gt;I need to add a text-property to the entire buffer. However, parts of&#xA;the buffer might already have that property with a different value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; What's the easiest way to apply a text property only to regions&#xA;  that don't already have it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I've been adding the properties to the content of the buffer, but I'd be willing to switch to overlays if it's way easier with overlays.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For instance, take the following buffer contents, and imagine the text&#xA;in each line is saying the truth.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This text has no face.&#xA;This text has a blue-colored face.&#xA;This also has no face.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to call a function like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-low-precedence-text-property&#xA; (point-min) (point-max) 'face 'some-red-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and have everything but the second line become red. &lt;em&gt;(the face is just&#xA;an example, I actually need this for other properties).&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-11-29T21:20:20.973" LastActivityDate="2014-11-29T23:14:20.177" Title="Simplest way to add-text-properties without overriding existing ones" Tags="|text-properties|overlays|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3978" PostTypeId="2" ParentId="3964" CreationDate="2014-11-29T20:51:13.963" Score="4" Body="&lt;p&gt;As the &lt;a href=&quot;http://orgmode.org/org.html#Global-TODO-list&quot; rel=&quot;nofollow&quot;&gt;manual says&lt;/a&gt; of hiding scheduled items from the TODO list:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Some people view a TODO item that has been scheduled for execution or have a deadline (see Timestamps) as no longer open. Configure the variables org-agenda-todo-ignore-scheduled, org-agenda-todo-ignore-deadlines, org-agenda-todo-ignore-timestamp and/or org-agenda-todo-ignore-with-date to exclude such items from the global TODO list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;While it isn't my way of working, I can see how this might appeal to some. It also isn't directly speaking to the context of your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in that context, I could imagine someone wanting to suppress the scheduled item from their agenda until some time after the scheduled date. (I've not played with it, but I would  expect that the TODO item would still come up in views like the log view and the TODO list.) Such a way of working would involve thinking of the agenda as a list of items on fire, rather than a list of all items. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not to my taste and likely not to yours, given your comments. But, one glory of org mode is that it doesn't enforce its model of task management anywhere nearly so much as do most other tools that I have tried. (It is sort of like a tool for building your own tool.)&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="2744" LastEditDate="2016-01-17T09:47:26.667" LastActivityDate="2016-01-17T09:47:26.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3979" PostTypeId="2" ParentId="798" CreationDate="2014-11-29T20:57:03.983" Score="4" Body="&lt;p&gt;I used &lt;a href=&quot;https://askubuntu.com/a/123515/13847&quot;&gt;Byzanz&lt;/a&gt; to record gifs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install it first, put this snippet into rr(record region) into your $PATH:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;# record screencast of a region into a gif using `byzanz-record`&#xA;&#xA;# Delay before starting&#xA;DELAY=5&#xA;&#xA;# Sound notification to let one know when recording is about to start (and ends)&#xA;beep() {&#xA;    paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &amp;amp;&#xA;}&#xA;&#xA;printf &quot;usage: rr [time] [file]\n&quot;&#xA;&#xA;# Duration and output file&#xA;if [ $# -gt 0 ]; then&#xA;    D=&quot;--duration=$@&quot;&#xA;else&#xA;    echo Default recording duration 10s to $HOME/recorded.gif&#xA;    D=&quot;--duration=10 $HOME/rarecorded.gif&quot;&#xA;fi&#xA;&#xA;# xrectsel from https://github.com/lolilolicon/xrectsel&#xA;ARGUMENTS=$(xrectsel &quot;--x=%x --y=%y --width=%w --height=%h&quot;) || exit -1&#xA;&#xA;echo Delaying $DELAY seconds. After that, byzanz will start&#xA;for (( i=$DELAY; i&amp;gt;0; --i )) ; do&#xA;    echo $i&#xA;    sleep 1&#xA;done&#xA;beep&#xA;byzanz-record --verbose --delay=0 ${ARGUMENTS} $D&#xA;beep&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this into rw(record window) into your $PATH:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;# record screencast of a region into a gif using `byzanz-record`&#xA;&#xA;# Delay before starting&#xA;DELAY=5&#xA;&#xA;# Sound notification to let one know when recording is about to start (and ends)&#xA;beep() {&#xA;    paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &amp;amp;&#xA;}&#xA;&#xA;printf &quot;usage: rr [time] [file]\n&quot;&#xA;&#xA;# Duration and output file&#xA;if [ $# -gt 0 ]; then&#xA;    D=&quot;--duration=$@&quot;&#xA;else&#xA;    echo Default recording duration 10s to $HOME/recorded.gif&#xA;    D=&quot;--duration=10 $HOME/rarecorded.gif&quot;&#xA;fi&#xA;&#xA;&#xA;XWININFO=$(xwininfo)&#xA;read X &amp;lt; &amp;lt;(awk -F: '/Absolute upper-left X/{print $2}' &amp;lt;&amp;lt;&amp;lt; &quot;$XWININFO&quot;)&#xA;read Y &amp;lt; &amp;lt;(awk -F: '/Absolute upper-left Y/{print $2}' &amp;lt;&amp;lt;&amp;lt; &quot;$XWININFO&quot;)&#xA;read W &amp;lt; &amp;lt;(awk -F: '/Width/{print $2}' &amp;lt;&amp;lt;&amp;lt; &quot;$XWININFO&quot;)&#xA;read H &amp;lt; &amp;lt;(awk -F: '/Height/{print $2}' &amp;lt;&amp;lt;&amp;lt; &quot;$XWININFO&quot;)&#xA;&#xA;echo Delaying $DELAY seconds. After that, byzanz will start&#xA;for (( i=$DELAY; i&amp;gt;0; --i )) ; do&#xA;    echo $i&#xA;    sleep 1&#xA;done&#xA;beep&#xA;byzanz-record --verbose --delay=0 ${ARGUMENTS} $D&#xA;beep&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can use rr and rw to record region/window to gifs(you can change the time and position for your needs.) &lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2015-05-25T13:33:23.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3980" PostTypeId="2" ParentId="3949" CreationDate="2014-11-29T23:04:01.300" Score="2" Body="&lt;p&gt;First of all, &lt;code&gt;sentence-end&lt;/code&gt; should match everything &lt;em&gt;up to the fist&#xA;word of the next sentence&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following sets a buffer-local binding of &lt;code&gt;sentence-end&lt;/code&gt; in&#xA;&lt;code&gt;org-mode&lt;/code&gt; buffers, which seems to work for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-auto-capitalize-headings-and-lists ()&#xA;  &quot;Create a buffer-local binding of sentence-end to auto-capitalize&#xA;section headings and list items.&quot;&#xA;  (make-local-variable 'sentence-end)&#xA;  (setq sentence-end (concat (rx (or&#xA;                                  ;; headings&#xA;                                  (seq line-start (1+ &quot;*&quot;) (1+ space))&#xA;                                  ;; list and checklist items&#xA;                                  (seq line-start (0+ space) &quot;-&quot; (1+ space) (? (or &quot;[ ]&quot; &quot;[X]&quot;) (1+ space)))))&#xA;                             &quot;\\|&quot; (sentence-end))))&#xA;&#xA;(add-hook 'org-mode-hook #'org-auto-capitalize-headings-and-lists)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this is not enough; &lt;code&gt;auto-capitalize&lt;/code&gt; checks if &lt;code&gt;this-command&lt;/code&gt; is&#xA;&quot;equivalent&quot; to &lt;code&gt;self-insert-command&lt;/code&gt;, &lt;strong&gt;or&lt;/strong&gt; if it is &lt;code&gt;newline&lt;/code&gt; or&#xA;&lt;code&gt;newline-and-indent&lt;/code&gt;. Org-mode rebinds &lt;code&gt;RET&lt;/code&gt; to &lt;code&gt;org-return&lt;/code&gt;, so&#xA;&lt;code&gt;auto-capitalize&lt;/code&gt; does not detect that it should try to capitalize&#xA;after the user hits &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this is a bug in &lt;code&gt;auto-capitalize&lt;/code&gt;; below is a fixed version&#xA;of &lt;code&gt;auto-capitalize&lt;/code&gt; which &lt;em&gt;does&lt;/em&gt; work with &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun auto-capitalize (beg end length)&#xA;  &quot;If `auto-capitalize' mode is on, then capitalize the previous word.&#xA;The previous word is capitalized (or upcased) if it is a member of the&#xA;`auto-capitalize-words' list; or if it begins a paragraph or sentence.&#xA;&#xA;Capitalization occurs only if the current command was invoked via a&#xA;self-inserting non-word character (e.g. whitespace or punctuation)\; but&#xA;if the `auto-capitalize-yank' option is set, then the first word of&#xA;yanked sentences will be capitalized as well.&#xA;&#xA;Capitalization can be disabled in specific contexts via the&#xA;`auto-capitalize-predicate' variable.&#xA;&#xA;This should be installed as an `after-change-function'.&quot;&#xA;  (if (and auto-capitalize&#xA;           (or (null auto-capitalize-predicate)&#xA;               (funcall auto-capitalize-predicate)))&#xA;      (cond ((or (and (or (eq this-command 'self-insert-command)&#xA;                          ;; LaTeX mode binds &quot;.&quot; to TeX-insert-punctuation,&#xA;                          ;; and &quot;\&quot;&quot; to TeX-insert-quote:&#xA;                          (let ((key (this-command-keys)))&#xA;                            ;; XEmacs `lookup-key' signals &quot;unable to bind&#xA;                            ;; this type of event&quot; for commands invoked via&#xA;                            ;; the mouse:&#xA;                            (and (if (and (vectorp key)&#xA;                                          (&amp;gt; (length key) 0)&#xA;                                          (fboundp 'misc-user-event-p)&#xA;                                          (misc-user-event-p (aref key 0)))&#xA;                                     nil&#xA;                                   (memq (lookup-key global-map key t) ;new code&#xA;                                          '(self-insert-command newline newline-and-indent))) ;new code&#xA;                                 ;; single character insertion?&#xA;                                 (= length 0)&#xA;                                 (= (- end beg) 1))))&#xA;                      (let ((self-insert-char&#xA;                             (cond ((featurep 'xemacs) ; XEmacs&#xA;                                    (event-to-character last-command-event&#xA;                                                        nil nil t))&#xA;                                   (t last-command-event)))) ; GNU Emacs&#xA;                        (not (equal (char-syntax self-insert-char) ?w))))&#xA;                 (eq this-command 'newline)&#xA;                 (eq this-command 'newline-and-indent))&#xA;             ;; self-inserting, non-word character&#xA;             (if (and (&amp;gt; beg (point-min))&#xA;                      (equal (char-syntax (char-after (1- beg))) ?w))&#xA;                 ;; preceded by a word character&#xA;                 (save-excursion&#xA;                   (forward-word -1)&#xA;                   (save-match-data&#xA;                     (let* ((word-start (point))&#xA;                            (text-start&#xA;                             (progn&#xA;                               (while (or (minusp (skip-chars-backward &quot;\&quot;&quot;))&#xA;                                          (minusp (skip-syntax-backward &quot;\&quot;(&quot;)))&#xA;                                 t)&#xA;                               (point)))&#xA;                            lowercase-word)&#xA;                       (cond ((and auto-capitalize-words&#xA;                                   (let ((case-fold-search nil))&#xA;                                     (goto-char word-start)&#xA;                                     (looking-at&#xA;                                      (concat &quot;\\(&quot;&#xA;                                              (mapconcat 'downcase&#xA;                                                         auto-capitalize-words&#xA;                                                         &quot;\\|&quot;)&#xA;                                              &quot;\\)\\&amp;gt;&quot;))))&#xA;                              ;; user-specified capitalization&#xA;                              (if (not (member (setq lowercase-word&#xA;                                                     (buffer-substring ; -no-properties?&#xA;                                                      (match-beginning 1)&#xA;                                                      (match-end 1)))&#xA;                                               auto-capitalize-words))&#xA;                                  ;; not preserving lower case&#xA;                                  (progn ; capitalize!&#xA;                                    (undo-boundary)&#xA;                                    (replace-match (find lowercase-word&#xA;                                                         auto-capitalize-words&#xA;                                                         :key 'downcase&#xA;                                                         :test 'string-equal)&#xA;                                                   t t))))&#xA;                             ((and (or (equal text-start (point-min)) ; (bobp)&#xA;                                       (progn ; beginning of paragraph?&#xA;                                         (goto-char text-start)&#xA;                                         (and (= (current-column) left-margin)&#xA;                                              (zerop (forward-line -1))&#xA;                                              (looking-at paragraph-separate)))&#xA;                                       (progn ; beginning of paragraph?&#xA;                                         (goto-char text-start)&#xA;                                         (and (= (current-column) left-margin)&#xA;                                              (re-search-backward paragraph-start&#xA;                                                                  nil t)&#xA;                                              (= (match-end 0) text-start)&#xA;                                              (= (current-column) left-margin)))&#xA;                                       (progn ; beginning of sentence?&#xA;                                         (goto-char text-start)&#xA;                                         (save-restriction&#xA;                                           (narrow-to-region (point-min)&#xA;                                                             word-start)&#xA;                                           (and (re-search-backward (auto-capitalize-sentence-end)&#xA;                                                                    nil t)&#xA;                                                (= (match-end 0) text-start)&#xA;                                                ;; verify: preceded by&#xA;                                                ;; whitespace?&#xA;                                                (let ((previous-char&#xA;                                                       (char-after&#xA;                                                        (1- text-start))))&#xA;                                                  ;; In some modes, newline&#xA;                                                  ;; (^J, aka LFD) is comment-&#xA;                                                  ;; end, not whitespace:&#xA;                                                  (or (equal previous-char&#xA;                                                             ?\n)&#xA;                                                      (equal (char-syntax&#xA;                                                              previous-char)&#xA;                                                             ? )))&#xA;                                                ;; verify: not preceded by&#xA;                                                ;; an abbreviation?&#xA;                                                (let ((case-fold-search nil)&#xA;                                                      (abbrev-regexp&#xA;                                                       (if (featurep 'xemacs)&#xA;                                                           &quot;\\&amp;lt;\\([A-Z�-��-�]?[a-z�-��-�]+\\.\\)+\\=&quot;&#xA;                                                         &quot;\\&amp;lt;\\([[:upper:]]?[[:lower:]]+\\.\\)+\\=&quot;)))&#xA;                                                  (goto-char&#xA;                                                   (1+ (match-beginning 0)))&#xA;                                                  (or (not&#xA;                                                       (re-search-backward abbrev-regexp&#xA;                                                                           nil t))&#xA;                                                      (not&#xA;                                                       (member&#xA;                                                        (buffer-substring ; -no-properties?&#xA;                                                         (match-beginning 0)&#xA;                                                         (match-end 0))&#xA;                                                        auto-capitalize-words))))&#xA;                                                ))))&#xA;                                   ;; inserting lowercase text?&#xA;                                   (let ((case-fold-search nil))&#xA;                                     (goto-char word-start)&#xA;                                     (looking-at (if (featurep 'xemacs)&#xA;                                                     &quot;[a-z�-��-�]+&quot;&#xA;                                                   &quot;[[:lower:]]+&quot;)))&#xA;                                   (or (eq auto-capitalize t)&#xA;                                       (prog1 (y-or-n-p&#xA;                                               (format &quot;Capitalize \&quot;%s\&quot;? &quot;&#xA;                                                       (buffer-substring&#xA;                                                        (match-beginning 0)&#xA;                                                        (match-end 0))))&#xA;                                         (message &quot;&quot;))))&#xA;                              ;; capitalize!&#xA;                              (undo-boundary)&#xA;                              (goto-char word-start)&#xA;                              (capitalize-word 1))))))))&#xA;            ((and auto-capitalize-yank&#xA;                  ;; `yank' sets `this-command' to t, and the&#xA;                  ;; after-change-functions are run before it has been&#xA;                  ;; reset:&#xA;                  (or (eq this-command 'yank)&#xA;                      (and (= length 0) ; insertion?&#xA;                           (eq this-command 't))))&#xA;             (save-excursion&#xA;               (goto-char beg)&#xA;               (save-match-data&#xA;                 (while (re-search-forward &quot;\\Sw&quot; end t)&#xA;                   ;; recursion!&#xA;                   (let* ((this-command 'self-insert-command)&#xA;                          (non-word-char (char-after (match-beginning 0)))&#xA;                          (last-command-event&#xA;                           (cond ((featurep 'xemacs) ; XEmacs&#xA;                                  (character-to-event non-word-char))&#xA;                                 (t non-word-char)))) ; GNU Emacs&#xA;                     (auto-capitalize (match-beginning 0)&#xA;                                      (match-end 0)&#xA;                                      0)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-29T23:04:01.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3981" PostTypeId="1" AcceptedAnswerId="3990" CreationDate="2014-11-29T23:09:46.460" Score="25" ViewCount="8377" Body="&lt;p&gt;There's lots of documentation about inserting or storing org-mode-links, but apparently none about copying them to buffers in other formats.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you copy the URL of an org-mode-link from an org file into the clipboard/kill ring with as few keystrokes as possible? I tried &lt;code&gt;org-store-link&lt;/code&gt; and &lt;code&gt;org-insert-link&lt;/code&gt;, but it dumps the whole org-mode syntax into whatever other buffer you have open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: buffer 1 org-mode, buffer 2 Markdown.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Visit buffer 1, &lt;kbd&gt;C-s&lt;/kbd&gt; search for link.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Magic happens&lt;/strong&gt;, URL is in clipboard&lt;/li&gt;&#xA;&lt;li&gt;Visit buffer 2. &lt;kbd&gt;C-y&lt;/kbd&gt; to yank URL into buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2023-10-28T11:53:34.643" Title="How to copy links OUT of org-mode?" Tags="|org-mode|" AnswerCount="9" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3982" PostTypeId="2" ParentId="3976" CreationDate="2014-11-29T23:14:20.177" Score="3" Body="&lt;p&gt;Use &lt;code&gt;next-single-property-change&lt;/code&gt; in a loop, to scan forward for the particular property. Examine the property value each time there is a change in it, and DTRT at that location.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-11-29T23:14:20.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3983" PostTypeId="1" AcceptedAnswerId="3987" CreationDate="2014-11-30T00:37:52.067" Score="3" ViewCount="73" Body="&lt;p&gt;I would like the &lt;a href=&quot;http://melpa.org/#/auto-capitalize&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-capitalize&lt;/code&gt;&lt;/a&gt; minor mode not to capitalize mathematical text in AUCTeX and org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid this, when running in either of these modes, auto-capitalize should only capitalize when the function &lt;code&gt;texmathp&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The auto-capitalize code is quite messy, so I don't know what is the best place to make this modification so that everything keeps running efficiently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="2355" LastEditDate="2014-11-30T04:40:37.023" LastActivityDate="2014-11-30T04:40:37.023" Title="Do not auto-capitalize when editing an equation in AUCTeX or org-mode" Tags="|org-mode|auctex|capitalization|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3984" PostTypeId="2" ParentId="3974" CreationDate="2014-11-30T00:39:04.037" Score="5" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You need &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt; (not &lt;code&gt;&quot;p&quot;&lt;/code&gt;) to get a raw prefix argument (i.e. the ability to distinguish between &lt;code&gt;C-u&lt;/code&gt; and &lt;code&gt;C-u 4&lt;/code&gt;). See &lt;code&gt;C-h f&lt;/code&gt; &lt;code&gt;interactive&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The raw prefix argument for &lt;code&gt;C--&lt;/code&gt; is not &lt;code&gt;(-1)&lt;/code&gt;, but &lt;code&gt;-&lt;/code&gt;. See &lt;code&gt;C-h i g&lt;/code&gt; &lt;code&gt;(elisp) Prefix Command Arguments&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;open-line&lt;/code&gt; takes a required argument.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun advanced-return (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (if (equal arg '-) ;; C--&#xA;      (progn&#xA;        (beginning-of-line)&#xA;        (open-line 1))&#xA;    (if (equal arg '(4)) ;; C-u&#xA;        (progn&#xA;          (end-of-line)&#xA;          (open-line 1)&#xA;          (next-line))&#xA;      (newline-and-indent))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You might also write this as a &lt;code&gt;cond&lt;/code&gt; expression, rather than a series of nested &lt;code&gt;if&lt;/code&gt;s. That would be structurally cleaner (although I always think the (lack of) indentation is a problem for readability with &lt;code&gt;cond&lt;/code&gt;, so YMMV).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun advanced-return (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (cond ((equal arg '-) ;; C--&#xA;         (beginning-of-line)&#xA;         (open-line 1))&#xA;        ((equal arg '(4)) ;; C-u&#xA;         (end-of-line)&#xA;         (open-line 1)&#xA;         (next-line))&#xA;        (t ;; Otherwise&#xA;         (newline-and-indent))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-11-30T03:52:27.517" LastActivityDate="2014-11-30T03:52:27.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3985" PostTypeId="1" CreationDate="2014-11-30T01:57:51.803" Score="6" ViewCount="2142" Body="&lt;p&gt;Exporting to Beamer from org-mode creates a myriad of temporary files (the .tex file + files ending in .aux, .log, .toc, .fls, .nav, .vrb, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most LaTeX implementations now have an option (&lt;code&gt;-outdir&lt;/code&gt;) to keep all these temporary files outside from the current directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can the export to Beamer be modified to use this facility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-03-07T05:10:29.910" Title="Make org-mode export to Beamer keep temporary files out of the current directory" Tags="|org-mode|latex|org-export|beamer|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3986" PostTypeId="2" ParentId="3973" CreationDate="2014-11-30T02:10:57.060" Score="2" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ibuffer-saved-filter-groups&#xA;      '((&quot;default&quot;&#xA;         (&quot;Ruby&quot;&#xA;          (predicate . (and (eq major-mode 'ruby-mode)&#xA;                            (not (string-match-p &quot;spec\\.rb\\'&quot;&#xA;                                                 buffer-file-name)))))&#xA;         (&quot;Specs&quot;&#xA;          (name . &quot;spec\\.rb\\'&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using a more complex check seems necessary, since you want &lt;code&gt;Ruby&lt;/code&gt; to be at the top. I also fixed the spec regexp a bit (really escape the dot and use the &quot;end of string&quot; anchor instead of the &quot;end of line&quot;).&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorUserId="124" LastEditDate="2014-11-30T13:25:27.003" LastActivityDate="2014-11-30T13:25:27.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3987" PostTypeId="2" ParentId="3983" CreationDate="2014-11-30T04:38:19.460" Score="3" Body="&lt;p&gt;Auto-capitalize defines the variable &lt;code&gt;auto-capitalize-predicate&lt;/code&gt;, which can be used to check whether to enable auto-capitalization based on context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-capitalize-predicate (lambda () (not (texmathp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to turn it off in LaTeX formulas.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-11-30T04:38:19.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3988" PostTypeId="2" ParentId="3975" CreationDate="2014-11-30T05:01:56.507" Score="10" Body="&lt;p&gt;Try using &lt;code&gt;:mode math&lt;/code&gt; and &lt;code&gt;:mode inline-math&lt;/code&gt; LaTeX attributes together with &lt;code&gt;:environment array&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_LaTeX: :mode math :environment array&#xA;| Column 1 | Column 2 |&#xA;|----------+----------|&#xA;| \sin(x)  | \tan(x)  |&#xA;&#xA;#+ATTR_LaTeX: :mode inline-math :environment array&#xA;| Column 1 | Column 2 |&#xA;|----------+----------|&#xA;| \sin(x)  | \tan(x)  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See section &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot;&gt;LaTeX specific attributes&lt;/a&gt; of the Org mode manual for more.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-01T17:47:46.007" LastActivityDate="2014-12-01T17:47:46.007" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3989" PostTypeId="2" ParentId="3970" CreationDate="2014-11-30T07:27:20.370" Score="3" Body="&lt;p&gt;This example contemplates the existence of the following criteria:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A range of time for a particular meeting / appointment is not presently supported.  The initial testing has been done with only one start time -- e.g., &lt;code&gt;DEADLINE: &amp;lt;2014-12-01 Mon 08:30&amp;gt;  SCHEDULED: &amp;lt;2014-12-01 Mon&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;TODO&quot;, &quot;WORK&quot; and &quot;DONE&quot; are among some of the &lt;code&gt;org-todo-keywords&lt;/code&gt; that have been predefined by the user.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Line 21 needs to be modified with the name of the &lt;code&gt;*.org&lt;/code&gt; buffer that contains the TODO that need to be checked against for availability.  This is the raw &lt;code&gt;*.org&lt;/code&gt; file (which &lt;em&gt;must&lt;/em&gt; already be in the major-mode &lt;code&gt;org-mode&lt;/code&gt;), NOT an &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer.  In my testing, the &lt;code&gt;*.org&lt;/code&gt; buffer is named &lt;code&gt;.todo&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The example checks both deadlines and scheduled time-stamps.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The regexp is looking for just one star to the left of the keyword -- it can be tweaked to be more precise to match the needs of the user.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The example assumes the &lt;code&gt;*.org&lt;/code&gt; buffer (containing the TODO to be checked against) is already open -- burried or visible will work.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is certainly possible to get more elaborate by creating a custom &lt;code&gt;org-read-date&lt;/code&gt; function that performs the check when manually entering a time-stamp; however, that is beyond the scope of this basic example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another idea would be to use the &lt;code&gt;check-availability&lt;/code&gt; function following the usage of &lt;code&gt;org-deadline&lt;/code&gt; -- i.e., the let-bound variable &lt;code&gt;date-time&lt;/code&gt; (in this example) would be set to &lt;code&gt;(org-time-string-to-time org-last-inserted-timestamp)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun check-availability (&amp;amp;optional date)&#xA;&quot;Doc-string.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      not-available&#xA;      (date (if date date (read-string &quot;Date:  &quot;)))&#xA;      (date-parsed (parse-time-string date))&#xA;      (date-time&#xA;        (cond&#xA;          ((and&#xA;               (not (null (nth 0 date-parsed)))&#xA;               (not (null (nth 1 date-parsed)))&#xA;               (not (null (nth 2 date-parsed))))&#xA;            (date-to-time date))&#xA;          ((and&#xA;              (null (nth 0 date-parsed))&#xA;              (null (nth 1 date-parsed))&#xA;              (null (nth 2 date-parsed)))&#xA;            (date-to-time (concat date &quot; 00:00&quot;)))))&#xA;      (date-seconds (time-to-seconds date-time)) )&#xA;    (with-current-buffer (get-buffer &quot;.todo&quot;)&#xA;      (save-excursion&#xA;        (goto-char (point-max))&#xA;        (catch 'found&#xA;          (while (re-search-backward &quot;\\* \\(TODO\\|WORK\\|DONE\\)&quot; nil t)&#xA;            (unless (org-at-heading-p)&#xA;              (org-back-to-heading t))&#xA;            (let* (&#xA;                (element (org-element-at-point))&#xA;                (deadline (org-element-property :deadline element))&#xA;                (deadline-seconds&#xA;                  (when deadline&#xA;                    (time-to-seconds&#xA;                      (org-time-string-to-time&#xA;                        (org-element-property :raw-value deadline)))))&#xA;                (scheduled (org-element-property :scheduled element))&#xA;                (scheduled-seconds&#xA;                  (when scheduled&#xA;                    (time-to-seconds&#xA;                      (org-time-string-to-time&#xA;                        (org-element-property :raw-value scheduled))))) )&#xA;              (when&#xA;                  (or&#xA;                    (and&#xA;                      deadline-seconds&#xA;                      (= date-seconds deadline-seconds))&#xA;                    (and&#xA;                      scheduled-seconds&#xA;                      (= date-seconds scheduled-seconds)))&#xA;                (setq not-available t)&#xA;                (throw 'found (message &quot;Not Available!&quot;)))))))&#xA;      (unless not-available &#xA;        (message &quot;Congratulations -- you are available!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-11-30T20:25:54.097" LastActivityDate="2014-11-30T20:25:54.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3990" PostTypeId="2" ParentId="3981" CreationDate="2014-11-30T07:48:02.113" Score="13" Body="&lt;p&gt;Here is one way of achieving what you want, using text properties. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can go to the link in the&#xA;org file you want to copy and execute the command&#xA;&lt;code&gt;my-org-retrieve-url-from-point&lt;/code&gt; this will copy the org link at current point to&#xA;the clipboard. Before adding the link to clipboard a yank-handler&#xA;(&lt;code&gt;my-yank-org-link&lt;/code&gt;) is registered which is called while pasting the link. The&#xA;yank-handler checks if the current buffer is in org-mode or a mode derived from&#xA;org-mode, if so it inserts the link as it is (a org-link), otherwise it extracts&#xA;the URL from the link and inserts it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-yank-org-link (text)&#xA;  (if (derived-mode-p 'org-mode)&#xA;      (insert text)&#xA;    (string-match org-bracket-link-regexp text)&#xA;    (insert (substring text (match-beginning 1) (match-end 1)))))&#xA;&#xA;(defun my-org-retrieve-url-from-point ()&#xA;  (interactive)&#xA;  (let* ((link-info (assoc :link (org-context)))&#xA;         (text (when link-info&#xA;                 ;; org-context seems to return nil if the current element&#xA;                 ;; starts at buffer-start or ends at buffer-end&#xA;                 (buffer-substring-no-properties (or (cadr link-info) (point-min))&#xA;                                                 (or (caddr link-info) (point-max))))))&#xA;    (if (not text)&#xA;        (error &quot;Not in org link&quot;)&#xA;      (add-text-properties 0 (length text) '(yank-handler (my-yank-org-link)) text)&#xA;      (kill-new text))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a DWIM version of &lt;code&gt;kill-ring-save&lt;/code&gt;, which uses &lt;code&gt;kill-ring-save&lt;/code&gt; if region is active or copies the org-link at point &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-smarter-kill-ring-save ()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (call-interactively #'kill-ring-save)&#xA;    (when (eq major-mode 'org-mode)&#xA;      (call-interactively #'my-org-retrieve-url-from-point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This does not currently distinguish between a URL link and internal links.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2014-11-30T11:12:17.303" LastActivityDate="2014-11-30T11:12:17.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3991" PostTypeId="2" ParentId="3971" CreationDate="2014-11-30T13:31:34.697" Score="4" Body="&lt;p&gt;You can always access the meta prefix via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x @ m     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is bound to &lt;code&gt;event-apply-meta-modifier&lt;/code&gt;.&#xA;Thus &lt;code&gt;C-x @ m &amp;lt;right&amp;gt;&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; is bound to &lt;code&gt;org-metaright&lt;/code&gt; and &lt;code&gt;C-x @ m S-&amp;lt;right&amp;gt;&lt;/code&gt; is bound to &lt;code&gt;org-shiftmetaright&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general the &lt;code&gt;ESC&lt;/code&gt; key is only related to the meta prefix in front of ordinary characters, not in front of special keys such as &lt;code&gt;&amp;lt;f11&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;right&amp;gt;&lt;/code&gt;. The following two paragraphs of the Elisp manual explain this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Keymaps do not directly record bindings for the meta characters.&#xA;  Instead, meta characters are regarded for purposes of key lookup as&#xA;  sequences of two characters, the first of which is &amp;lt;ESC&amp;gt; (or whatever&#xA;  is currently the value of ‘meta-prefix-char’).  Thus, the key ‘M-a’ is&#xA;  internally represented as ‘&amp;lt;ESC&amp;gt; a’, and its global binding is found&#xA;  at the slot for ‘a’ in ‘esc-map’ (*note Prefix Keys::).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This conversion applies only to characters, not to function keys or&#xA;  other input events; thus, ‘M-&amp;lt;end&amp;gt;’ has nothing to do with ‘&amp;lt;ESC&amp;gt;&#xA;  &amp;lt;end&amp;gt;’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;from section 21.3 &quot;Format of Keymaps&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach is to use the option &lt;code&gt;org-use-extra-keys&lt;/code&gt;.  This is turned on automatically for emacs in a terminal and provides a number of alternative bindings.  In particular &lt;code&gt;M-&amp;lt;right&amp;gt;&lt;/code&gt; may be invoked by either &lt;code&gt;C-c C-x r&lt;/code&gt; or &lt;code&gt;&amp;lt;ESC&amp;gt; &amp;lt;right&amp;gt;&lt;/code&gt;.  Also it defines a speed key &lt;code&gt;r&lt;/code&gt; for use when at the beginning of a headline.  See &quot;Using Org on a tty&quot; under the &quot;Miscellaneous&quot; section of the org manual.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2017-06-05T16:58:09.343" LastActivityDate="2017-06-05T16:58:09.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3992" PostTypeId="1" CreationDate="2014-11-30T15:30:41.800" Score="6" ViewCount="1117" Body="&lt;p&gt;This question is a follow-up to &lt;a href=&quot;https://emacs.stackexchange.com/a/3991/882&quot;&gt;this answer&lt;/a&gt; (q.v.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that Emacs interprets &lt;kbd&gt;esc&lt;/kbd&gt; as &lt;code&gt;M-&lt;/code&gt; only when the keystroke that follows it corresponds to a &quot;character&quot; (e.g. &lt;kbd&gt;A&lt;/kbd&gt;, &lt;kbd&gt;5&lt;/kbd&gt;, &lt;kbd&gt;;&lt;/kbd&gt;, etc.), as opposed to, e.g., &lt;kbd&gt;&amp;larr;&lt;/kbd&gt;, &lt;kbd&gt;F5&lt;/kbd&gt;, &lt;kbd&gt;home&lt;/kbd&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I add to my &lt;code&gt;.emacs&lt;/code&gt; file to extend the &lt;kbd&gt;esc&lt;/kbd&gt;&amp;nbsp;&amp;rArr;&amp;nbsp;&lt;code&gt;M-&lt;/code&gt; interpretation to the case where the following key is a &quot;non-character&quot; key?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;OK, the following snippet takes care of my immediate problem, &lt;strong&gt;but it's not an answer to my question&lt;/strong&gt; (see below):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;    (lambda ()&#xA;        (define-key org-mode-map [27 S-down] 'org-shiftmetadown)&#xA;        (define-key org-mode-map [27 S-up] 'org-shiftmetaup)&#xA;        (define-key org-mode-map [27 S-right] 'org-shiftmetaright)&#xA;        (define-key org-mode-map [27 S-left] 'org-shiftmetaleft)&#xA;        (define-key org-mode-map [27 down] 'org-metadown)&#xA;        (define-key org-mode-map [27 up] 'org-metaup)&#xA;        (define-key org-mode-map [27 right] 'org-metaright)&#xA;        (define-key org-mode-map [27 left] 'org-metaleft)&#xA;        (define-key org-mode-map [27 return] 'org-meta-return)&#xA;        (define-key org-mode-map [27 S-return] 'org-insert-todo-heading)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To find the bindings I needed to define, I got a listing of &lt;code&gt;org-mode-map&lt;/code&gt; (with &lt;code&gt;C-h v&lt;/code&gt;), and searched for &lt;code&gt;M-&lt;/code&gt; to get all the bindings beginning with &lt;code&gt;M-&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (M-S-down . org-shiftmetadown)&#xA;  (M-S-up . org-shiftmetaup)&#xA;  (M-S-right . org-shiftmetaright)&#xA;  (M-S-left . org-shiftmetaleft)&#xA;  (M-down . org-metadown)&#xA;  (M-up . org-metaup)&#xA;  (M-right . org-metaright)&#xA;  (M-left . org-metaleft)&#xA;  (M-return . org-meta-return)&#xA;  (M-S-return . org-insert-todo-heading)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each one of these lines is the basis for a corresponding &lt;code&gt;define-key&lt;/code&gt; expression in the mode-hook shown above.  The transformation should be pretty obvious.  (The 27 in the &lt;code&gt;define-key&lt;/code&gt; expressions is the code for &lt;kbd&gt;esc&lt;/kbd&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One would need to do this sort of thing for every single mode &lt;em&gt;X&lt;/em&gt; that defines a key binding of the form &lt;code&gt;M-&lt;/code&gt; followed by a non-character key sequence.  Specifically, for every such binding, one would have to include a &lt;code&gt;define-key&lt;/code&gt; expression in a mode-hook for mode &lt;em&gt;X&lt;/em&gt;.  Therefore, this approach is obviously a very laborious, fragile, and hard-to-maintain hack.  It does not do what the question requests, but instead painstakingly simulates it for certain special cases.  For this reason I did not post it as an answer, in the hopes that someone will post an actual answer to the original question.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-11-30T19:54:15.893" Title="How to extend the &lt;ESC&gt; =&gt; M- translation to non-character keys?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3993" PostTypeId="2" ParentId="3992" CreationDate="2014-11-30T19:54:15.893" Score="6" Body="&lt;p&gt;Emacs already has a key binding for “apply meta to the next key”, but it's awkward to type: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html#Modifier-Keys&quot;&gt;&lt;code&gt;C-x @ m&lt;/code&gt;&lt;/a&gt; (alongside &lt;code&gt;C-x @ c&lt;/code&gt; for “apply control to the next key”, etc.). It's implemented by a binding to &lt;code&gt;event-apply-meta-modifier&lt;/code&gt; in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-local_002dfunction_002dkey_002dmap-1627&quot;&gt;&lt;code&gt;function-key-map&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Binding &lt;code&gt;escape&lt;/code&gt; to &lt;code&gt;event-apply-meta-modifier&lt;/code&gt; in &lt;code&gt;function-key-map&lt;/code&gt; won't work because bindings there are shadowed by bindings in the global map or in minor mode maps, and these do have bindings for &lt;code&gt;escape&lt;/code&gt;. (You could remove the global binding for &lt;code&gt;escape&lt;/code&gt; but that would leave you at the mercy of minor modes.) Instead, you can bind &lt;code&gt;escape&lt;/code&gt; in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-input_002ddecode_002dmap-1626&quot;&gt;&lt;code&gt;input-decode-map&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map [escape] 'event-apply-meta-modifier)&#xA;(define-key global-map [?\M-\e M-escape] 'keyboard-escape-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second command binds &lt;code&gt;keyboard-escape-quit&lt;/code&gt; to four presses of the &lt;kbd&gt;Escape&lt;/kbd&gt; key; it's normally bound to three presses but that binding won't be accessible any longer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a terminal, this won't work, because the &lt;kbd&gt;Escape&lt;/kbd&gt; key sends the &lt;code&gt;?\e&lt;/code&gt; (ESC) character, not the &lt;code&gt;escape&lt;/code&gt; key. Adding the same binding for &lt;code&gt;&quot;\e&quot;&lt;/code&gt; would break all function keys that are encoded as escape sequences in a terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;code&gt;M-key&lt;/code&gt; bindings to take precedence over &lt;code&gt;ESC key&lt;/code&gt; in a terminal, I can't think of a good way that doesn't require binding every key. You don't have to do it in every mode though: you can add a series of macros in the global map.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;(dolist (key '(f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12&#xA;               left right up down prior next home end))&#xA;  (dolist ((chord `((,key)&#xA;                    (shift ,key)&#xA;                    (control ,key)&#xA;                    (control shift ,key))))&#xA;    (global-set-key (vector ?\e chord) (vector (cons 'meta chord)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On Linux, I do find that Org mode bindings work when I press &lt;kbd&gt;Escape&lt;/kbd&gt; followed by &lt;kbd&gt;Left&lt;/kbd&gt; etc., so you shouldn't need the terminal part, only the &lt;code&gt;input-decode-map&lt;/code&gt; binding for &lt;code&gt;escape&lt;/code&gt; for GUI-based Emacs.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-11-30T19:54:15.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3994" PostTypeId="1" AcceptedAnswerId="3996" CreationDate="2014-11-30T22:20:33.317" Score="9" ViewCount="841" Body="&lt;p&gt;I know I can set something like &lt;code&gt;-*- mode: read-only-mode -*-&lt;/code&gt; inside a commentary and Emacs will open the corresponding file as read-only. My problem is that I still want to read files that include such a line with the &lt;code&gt;org-mode&lt;/code&gt; major mode; Emacs opens these files in &lt;code&gt;fundamental-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell Emacs to open a file as read-only and still make it use the correct major mode?&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="504" LastEditDate="2014-12-02T08:44:11.430" LastActivityDate="2014-12-02T08:44:11.430" Title="Make buffer read-only on a per-file basis" Tags="|major-mode|read-only-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3996" PostTypeId="2" ParentId="3994" CreationDate="2014-11-30T22:31:18.140" Score="11" Body="&lt;p&gt;&lt;code&gt;read-only-mode&lt;/code&gt; is a &lt;em&gt;minor&lt;/em&gt; mode, and should not be set that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's true that using &lt;code&gt;mode:&lt;/code&gt; with minor modes used to work. I'm not sure offhand if it &lt;em&gt;still&lt;/em&gt; does, but it's definitely deprecated (and if it's clobbering &lt;code&gt;org-mode&lt;/code&gt;, then maybe it no longer works at all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only use &lt;code&gt;mode:&lt;/code&gt; to set the major mode, and use &lt;code&gt;eval:&lt;/code&gt; to enable minor modes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can probably use either of these:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- eval: (read-only-mode 1) -*-&#xA;-*- buffer-read-only: t -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-11-30T22:31:18.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3997" PostTypeId="2" ParentId="3994" CreationDate="2014-11-30T22:36:02.813" Score="6" Body="&lt;p&gt;The normal way would be to make the file read-only in your operating system. With the file open, run &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-File-Ops.html#index-set_002dfile_002dmodes-1208&quot;&gt;&lt;code&gt;M-x set-file-modes RET&lt;/code&gt;&lt;/a&gt; (or its alias &lt;code&gt;chmod&lt;/code&gt;), press &lt;kbd&gt;down&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to enter the name of the current file, and enter &lt;code&gt;a=r&lt;/code&gt; (for “all becomes read” — see &lt;a href=&quot;http://www.gnu.org/software/coreutils/manual/coreutils.html#File-permissions&quot;&gt;file permissions&lt;/a&gt; for details). You can also do this from Dired or any other file manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you want the file to be read-only in Emacs but writable in other applications, set the file variable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Buffer.html#index-buffer_002dread_002donly-1313&quot;&gt;&lt;code&gt;buffer-read-only&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- buffer-read-only: t -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-11-30T22:36:02.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3998" PostTypeId="1" AcceptedAnswerId="3999" CreationDate="2014-11-30T23:07:05.137" Score="6" ViewCount="1163" Body="&lt;p&gt;Newer versions of org-mode remap C-up to &lt;code&gt;org-backward-paragraph&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like C-up not to be remapped (and continue to use the standard Emacs' &lt;code&gt;backward-paragraph&lt;/code&gt; instead).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the standard ways of avoiding this remap do not work with org-mode (i.e., &lt;code&gt;(local-unset-key [C-up])&lt;/code&gt; and &lt;code&gt;(define-key org-mode-map [C-up] 'backward-paragraph)&lt;/code&gt;) don't do anything).  It seems that org-mode achieves this by remapping functions, not key bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to disable org-mode from remapping C-up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2014-11-30T23:28:06.617" Title="How to remap control up in org-mode" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3999" PostTypeId="2" ParentId="3998" CreationDate="2014-11-30T23:28:06.617" Score="7" Body="&lt;p&gt;Org mode &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Remapping-Commands.html#Remapping-Commands&quot; rel=&quot;noreferrer&quot;&gt;remaps&lt;/a&gt; all bindings of &lt;code&gt;forward-paragraph&lt;/code&gt; and &lt;code&gt;backward-paragraph&lt;/code&gt; to their Org counterparts with the following code which is executed when &lt;code&gt;org.el&lt;/code&gt; is loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-defkey org-mode-map [remap forward-paragraph] 'org-forward-paragraph)&#xA;(org-defkey org-mode-map [remap backward-paragraph] 'org-backward-paragraph)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can undo this by overriding the remappings after &lt;code&gt;org.el&lt;/code&gt; is loaded.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-take-back-paragraph-bindings ()&#xA;  (define-key org-mode-map [remap backward-paragraph] nil)&#xA;  (define-key org-mode-map [remap forward-paragraph] nil))&#xA;(eval-after-load &quot;org&quot; '(org-take-back-paragraph-bindings))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-11-30T23:28:06.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4000" PostTypeId="1" CreationDate="2014-12-01T00:31:21.117" Score="9" ViewCount="929" Body="&lt;p&gt;&lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;markdown-mode&lt;/code&gt;&lt;/a&gt; is&#xA;pretty good at filling paragraphs overall, but there's one flaw that&#xA;really bothers me. If a paragraph contains a line which ends in two&#xA;spaces, it only starts filling &lt;em&gt;never&lt;/em&gt; fills that line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, take the following example, where the second line ends in two spaces. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If I hit M-q right here at the start, this line will get broken into two, but the others won't.&#xA;If I hit M-q right here only the NEXT line will get split. All because this line here ends in two spaces.__&#xA;If I hit M-q right here, this line will get broken into two, but the others won't.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The example explains itself. Even If I hit &lt;code&gt;M-q&lt;/code&gt; at the start of each line, I'm still left with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If I hit M-q right here at the start this line will get broken into&#xA;two, but the others won't.&#xA;If I hit M-q right here only the NEXT line will get split. All because this line here ends in two spaces.__&#xA;If I hit M-q right here, this line will get broken into two, but the&#xA;others won't.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I would like to have is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If I hit M-q right here at the start this line will get broken into&#xA;two, but the others won't. If I hit M-q right here only the NEXT line&#xA;will get split. All because this line here ends in two spaces.__&#xA;If I hit M-q right here, this line will get broken into two, but the&#xA;others won't.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I get &lt;code&gt;fill-paragraph&lt;/code&gt; to behave like this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, &lt;code&gt;markdown-mode&lt;/code&gt; is considering the entire middle line to be a&#xA;paragraph separator, when it should be just the spaces at the end.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-12-01T02:14:41.973" LastActivityDate="2014-12-01T10:46:41.010" Title="How to fix markdown-mode's fill-paragraph?" Tags="|fill-paragraph|markdown|markdown-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4001" PostTypeId="1" AcceptedAnswerId="4009" CreationDate="2014-12-01T00:46:24.820" Score="5" ViewCount="615" Body="&lt;p&gt;I have some log files that I spend a lot of time reading, and I find myself doing the same series of commands to get useful highlighting each time I open a new log. Typically some combination of &lt;code&gt;M-x highlight-phrase&lt;/code&gt; and &lt;code&gt;M-x highlight-lines-matching-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to consolidate this down to a single command (macro perhaps?) Or better yet, have the highlighting applied whenever I open a file matching a specific name pattern?&lt;/p&gt;&#xA;" OwnerUserId="951" LastEditorUserId="25" LastEditDate="2014-12-01T08:58:24.370" LastActivityDate="2015-01-07T00:13:35.650" Title="Saving and restoring highlighting patterns" Tags="|syntax-highlighting|keyboard-macros|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4002" PostTypeId="2" ParentId="4001" CreationDate="2014-12-01T03:49:42.227" Score="1" Body="&lt;p&gt;May I suggest using a hook?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'find-file-hook (lambda () (highlight-regexp &quot;\\&amp;lt;ImportantWord\\&amp;gt;&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also throw an eye to &lt;a href=&quot;http://www.emacswiki.org/emacs/FixmeMode&quot; rel=&quot;nofollow&quot;&gt;FixmeMode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-12-01T03:49:42.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4003" PostTypeId="1" AcceptedAnswerId="4007" CreationDate="2014-12-01T04:13:02.750" Score="6" ViewCount="214" Body="&lt;p&gt;I'm trying to write a simple function to divide the Emacs frame into four quadrants.  Once I get the splitting to work, each window will have Dired for a different directory.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The splitting isn't giving the results I want, because I can't move point to the window I want to split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I have for the window splitting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun split-into-quadrants () &quot;Manipulate windows&quot; (interactive)&#xA;       (delete-other-windows)&#xA;       (split-window-vertically)&#xA;       (split-window-horizontally)&#xA;       (next-window)&#xA;       (next-window)&#xA;       (split-window-horizontally)&#xA;       (next-window)&#xA;       (next-window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The splits work fine. &lt;code&gt;next-window&lt;/code&gt; has no effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I issue these commands interactively, Emacs does exactly what I want.  But when I execute the function, point remains in the first window and I end up with three windows in the top half of the frame and one in the bottom half.  What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="2754" LastEditorUserId="504" LastEditDate="2014-12-01T08:14:20.563" LastActivityDate="2015-01-14T09:10:33.807" Title="How to move point to new window, within a function?" Tags="|window|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4004" PostTypeId="2" ParentId="4003" CreationDate="2014-12-01T05:05:35.093" Score="5" Body="&lt;p&gt;The functions &lt;code&gt;split-window-horizontally&lt;/code&gt; and &lt;code&gt;split-window-vertically&lt;/code&gt; return the new window created.&#xA;You can use use the function &lt;code&gt;select-window&lt;/code&gt; to select the newly created window, for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(select-window (split-window-horizontally))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is one way (not necessarily the best way) to achieve what you want&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun split-into-quadrants ()&#xA;  &quot;Manipulate windows&quot;&#xA;  (interactive)&#xA;  (delete-other-windows)&#xA;  (let ((current-window (selected-window))&#xA;        (new-window (split-window-vertically)))&#xA;    (split-window-horizontally)&#xA;    (select-window new-window)&#xA;    (split-window-horizontally)&#xA;    (select-window current-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2014-12-01T05:11:24.187" LastActivityDate="2014-12-01T05:11:24.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4005" PostTypeId="1" AcceptedAnswerId="4027" CreationDate="2014-12-01T05:08:34.943" Score="8" ViewCount="1986" Body="&lt;p&gt;I was looking at&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/26107243/centering-display-equations-with-org-latex-preview&quot;&gt;this&lt;/a&gt;&#xA;on StackOverflow and was wondering if there was a nice way built-in to&#xA;edit strings of text stored in variables as if they were buffers? &lt;code&gt;M-x set-variable&lt;/code&gt; doesn't really cut it when you have a long string of LaTeX options inside a variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for behavior similar to the package &lt;a href=&quot;https://github.com/magnars/string-edit.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;string-edit&lt;/a&gt;, but in order to edit emacs variables.&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2022-01-10T19:35:01.420" Title="interactively edit emacs variable in buffer" Tags="|variables|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4006" PostTypeId="2" ParentId="4000" CreationDate="2014-12-01T05:23:49.470" Score="1" Body="&lt;p&gt;So one inelegant hammer of a solution for this is to set &lt;code&gt;paragraph-separate&lt;/code&gt; as a file-local variable.  The mode sets it to &lt;code&gt;&quot;\\(?:[ \t\f]\\|.*  \\)*$&quot;&lt;/code&gt; as a mode-local-variable; if I set it back to its default value (taken from the help string for &lt;code&gt;paragraph-separate&lt;/code&gt;) like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: markdown; paragraph-separate: &quot;[  ^L]*$&quot; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I get the behaviour you're searching for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If I hit M-q right here at the start, this line will get broken into&#xA;two, but the others won't.  If I hit M-q right here only the NEXT line&#xA;will get split. All because this line here ends in two spaces.__If I&#xA;hit M-q right here, this line will get broken into two, but the others&#xA;won't.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The comment in the &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot; rel=&quot;nofollow&quot;&gt;git repo&lt;/a&gt; that introduces this says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Respect hard line breaks when filling paragraphs&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A downside of this patch is that paragraph movement commands will also&#xA;  stop at hard line breaks, thus slightly changing the definition of&#xA;  &quot;paragraph&quot; in this mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After a lot of tracing, I &lt;em&gt;think&lt;/em&gt; I've got the function actually invoked by &lt;code&gt;M-q&lt;/code&gt; down to &lt;code&gt;fill-individual-paragraphs&lt;/code&gt;; but it's complicated, and even after looking at that comment I still haven't figured out exactly what's going on...thus, blunt hammer, and I don't know what other consequences it'll have.  But it seems to work. :-)&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="504" LastEditDate="2014-12-01T10:46:41.010" LastActivityDate="2014-12-01T10:46:41.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4007" PostTypeId="2" ParentId="4003" CreationDate="2014-12-01T09:11:35.883" Score="3" Body="&lt;p&gt;You are on the right track, but you should use &lt;code&gt;other-window&lt;/code&gt; instead of &lt;code&gt;next-window&lt;/code&gt; to navigate to a specific window. Conveniently, &lt;code&gt;other-window&lt;/code&gt; allows you to specify how many windows to skip, which means that you don't need to call it multiple times when navigating to a window that is multiple hops away:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun split-into-quadrants () &quot;Manipulate windows&quot; (interactive)&#xA;       (delete-other-windows)&#xA;       (split-window-vertically)&#xA;       (split-window-horizontally)&#xA;       (other-window 2)&#xA;       (split-window-horizontally)&#xA;       (other-window 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-14T09:10:33.807" LastActivityDate="2015-01-14T09:10:33.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4008" PostTypeId="2" ParentId="4001" CreationDate="2014-12-01T09:57:45.973" Score="0" Body="&lt;p&gt;There is a possibility to save highlighting regexps, but to the buffer at point so not sure it is useful to put in a log file. Anyway, it is the function &lt;code&gt;hi-lock-write-interactive-patterns&lt;/code&gt;, bound to &lt;code&gt;C-x w b&lt;/code&gt; (see the Edit menu).&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2014-12-01T09:57:45.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4009" PostTypeId="2" ParentId="4001" CreationDate="2014-12-01T10:12:16.883" Score="7" Body="&lt;p&gt;Using a keyboard macro is a valid option, as is defining a custom command. The main advantage of using a keyboard macro is that you don't have to know any Elisp to create it. On the other hand, custom commands are easier to modify later on. I'm going to outline both solutions; feel free to pick the one you're most comfortable with.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Solution 1: Keyboard macro&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;To &lt;strong&gt;record&lt;/strong&gt; the macro:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;F3&lt;/kbd&gt; in a buffer showing a log file to start recording the macro.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Execute commands for highlighting lines and phrases as you normally would.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When you're done, press &lt;kbd&gt;F4&lt;/kbd&gt; to stop recording.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To &lt;strong&gt;persist&lt;/strong&gt; the macro:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Name the macro by doing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;name-last-kbd-macro&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;highlight-log-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Find your init-file, move point to a place where you would like to insert the macro, and do&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;insert-kbd-macro&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;highlight-log-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optional&lt;/strong&gt;: Bind the macro to a key via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c h&quot;) 'highlight-log-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Save your init-file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Solution 2: Custom command&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's say you want to highlight&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;all occurrences of &lt;code&gt;foo&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;all lines containing the phrase &lt;code&gt;bar&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;in your log files. To achieve this you can define the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun highlight-log-file ()&#xA;  (interactive)&#xA;  (highlight-phrase &quot;foo&quot;)&#xA;  (highlight-lines-matching-regexp &quot;bar&quot;))&#xA;&#xA;(global-set-key (kbd &quot;C-c h&quot;) 'highlight-log-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you need to highlight additional phrases/lines, just add more calls to &lt;code&gt;highlight-phrase&lt;/code&gt; and &lt;code&gt;highlight-lines-matching-regexp&lt;/code&gt; to the body of the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that you can instruct Emacs to highlight phrases/lines using a specific color by passing a second argument to the &lt;code&gt;highlight-*&lt;/code&gt; functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(highlight-phrase &quot;bar&quot; 'hi-green)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Automated highlighting&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;After defining &lt;code&gt;highlight-log-file&lt;/code&gt; using one of the methods shown above you can instruct Emacs to automatically highlight relevant phrases/lines in &lt;code&gt;.log&lt;/code&gt; files as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun apply-highlighting ()&#xA;  (when (string= (file-name-extension (buffer-file-name)) &quot;log&quot;)&#xA;    (highlight-log-file)))&#xA;&#xA;(add-hook 'find-file-hook 'apply-highlighting)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-07T00:13:35.650" LastActivityDate="2015-01-07T00:13:35.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4010" PostTypeId="2" ParentId="474" CreationDate="2014-12-01T11:28:05.717" Score="1" Body="&lt;p&gt;As has been mentioned in pieces above, projectile (optionally with helm) is a brilliant solution for project management. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ycmd is great for code completion and some navigation, and the best client for it is &lt;a href=&quot;https://github.com/abingham/emacs-ycmd&quot; rel=&quot;nofollow&quot;&gt;emacs-ycmd&lt;/a&gt; (full disclosure: I wrote the emacs client.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &quot;tags&quot; and indexing, the best overall solution I've found is &lt;a href=&quot;https://github.com/abingham/codesearch.el&quot; rel=&quot;nofollow&quot;&gt;codesearch&lt;/a&gt; (more disclosure: I wrote this one, too.) It's fairly dumb in that it really just does regex searching, but it's blazingly fast and generally all you need, and it works well across multiple languages.&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2014-12-01T11:28:05.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4011" PostTypeId="1" AcceptedAnswerId="4012" CreationDate="2014-12-01T12:57:47.593" Score="7" ViewCount="4377" Body="&lt;p&gt;When typing in a buffer with company-mode the completions popup shows after typing the third character:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vg7Ok.png&quot; alt=&quot;emacs company popup&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do this after typing the first or second charater?&lt;/p&gt;&#xA;" OwnerUserId="2757" LastEditorUserId="124" LastEditDate="2014-12-01T20:05:52.283" LastActivityDate="2014-12-01T20:05:52.283" Title="I want company-mode to show completions list after the second character" Tags="|completion|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4012" PostTypeId="2" ParentId="4011" CreationDate="2014-12-01T13:10:35.190" Score="16" Body="&lt;p&gt;You can set &lt;code&gt;company-minimum-prefix-length&lt;/code&gt; to a desire value of your choice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-minimum-prefix-length 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use the customize interface &lt;code&gt;M-x customize&lt;/code&gt; and search for &lt;code&gt;company&lt;/code&gt; in there using the search box. It will list relevant options related to the package. You can also search for a variable with &lt;kbd&gt;C-h v&lt;/kbd&gt; or search for a command with &lt;kbd&gt;C-h a&lt;/kbd&gt;, which is &lt;code&gt;apropos-command&lt;/code&gt; is bound to by default. If you like interactive apropos that gives you everything: functions, commands and variables, and gives you instant feedback for every character entered), you can use &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-14&quot; rel=&quot;noreferrer&quot;&gt;helm-apropos&lt;/a&gt;. Helm in general is really convenient and user friendly. See &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot; rel=&quot;noreferrer&quot;&gt;my Helm guide&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-12-01T17:20:08.187" LastActivityDate="2014-12-01T17:20:08.187" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4013" PostTypeId="2" ParentId="4005" CreationDate="2014-12-01T15:34:26.823" Score="4" Body="&lt;p&gt;If they are user options, then &lt;code&gt;M-x customize-option&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If they are defvars, not options, then edit the value in the source buffer or in a copy of the defvar in another buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or use &lt;code&gt;M-: (setq THE-VAR &quot;edit the text in the minibuffer)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-01T15:34:26.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4014" PostTypeId="1" AcceptedAnswerId="4015" CreationDate="2014-12-01T18:22:08.043" Score="6" ViewCount="1265" Body="&lt;p&gt;My init.el loads company with &lt;code&gt;(global-company-mode)&lt;/code&gt;. I want to make an exception for Javascript buffers, and instead use &lt;code&gt;auto-complete-mode&lt;/code&gt; for that mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; I am struggling to find a way to unhook company mode for only a particular mode. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="655" LastEditorUserId="50" LastEditDate="2014-12-01T18:26:22.870" LastActivityDate="2014-12-01T18:26:22.870" Title="How do I use company-mode in some buffers and auto-complete-mode in others?" Tags="|company-mode|auto-complete-mode|local-variables|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4015" PostTypeId="2" ParentId="4014" CreationDate="2014-12-01T18:24:51.170" Score="9" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'js-mode-hook 'my-javascript-hook)&#xA;&#xA;(defun my-javascript-hook ()&#xA;  (company-mode -1)&#xA;  (auto-complete-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-01T18:24:51.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4016" PostTypeId="1" CreationDate="2014-12-01T20:38:48.363" Score="3" ViewCount="640" Body="&lt;p&gt;I'm relatively new to Emacs and like it a lot, especially the navigation commands such as: &lt;code&gt;C-e&lt;/code&gt;, &lt;code&gt;C-a&lt;/code&gt;, &lt;code&gt;C-f&lt;/code&gt;, &lt;code&gt;M-f&lt;/code&gt;, &lt;code&gt;C-n&lt;/code&gt;, &lt;code&gt;C-p&lt;/code&gt;, &lt;code&gt;etc.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I often find myself trying to use them in other applications like Microsoft Office, Internet Browsers, etc. without success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key bindings sometimes work, such as &lt;code&gt;C-e&lt;/code&gt;, &lt;code&gt;C-a&lt;/code&gt;, &lt;code&gt;C-n&lt;/code&gt;, &lt;code&gt;C-p&lt;/code&gt; while I'm writing in the Safari Browser on OSX. But most other applications don't do this and I find it quite perplexing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gets even more confusing if you are using several operating systems. In Microsoft Windows, the Control key is used for all standard commands, so &lt;code&gt;C-n&lt;/code&gt; usually creates a new document or &lt;code&gt;C-p&lt;/code&gt; for printing, while on OSX the &lt;code&gt;Alt&lt;/code&gt; or &lt;code&gt;Cmd&lt;/code&gt; key is blocked for those. So to get a consistent set of key bindings on Windows and OSX and Emacs seems very difficult without at least breaking the most basic standards of one of those operating systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q: How do you manage to do this on most operating systems?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do you redefine key bindings also in other applications to match those of Emacs?&lt;/li&gt;&#xA;&lt;li&gt;Or do you redefine standard key bindings in Emacs to avoid conflicts with standard key bindings of the operating system?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2377" LastEditDate="2014-12-02T08:57:00.007" LastActivityDate="2014-12-02T08:59:45.520" Title="Managing Emacs key-bindings in other applications?" Tags="|key-bindings|osx|microsoft-windows|" AnswerCount="1" CommentCount="9" ClosedDate="2019-01-14T07:09:11.643" ContentLicense="CC BY-SA 3.0" />
  <row Id="4017" PostTypeId="1" AcceptedAnswerId="4026" CreationDate="2014-12-01T22:25:53.770" Score="3" ViewCount="545" Body="&lt;p&gt;Emacs Lisp has &lt;code&gt;regexp-quote&lt;/code&gt; to quote any string to match it literally.  Apparently, there is no equivalent function to quote an arbitrary replacement string to use it literally.  I mean, what could I use instead of the imaginary &lt;code&gt;regexp-quote-replacement&lt;/code&gt; in the following contrived[1] code?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp (regexp-quote &quot;^$&quot;) (regexp-quote-replacement &quot;\\&amp;amp;\\?&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code would be meant to replace a literal &lt;code&gt;^$&lt;/code&gt; with a literal &lt;code&gt;\&amp;amp;\?&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] I know that I could use &lt;code&gt;replace-string&lt;/code&gt; in this case to achieve the same result.&lt;/p&gt;&#xA;" OwnerUserId="2763" LastActivityDate="2014-12-02T02:27:32.867" Title="Quoting a replacement string for a regular expression" Tags="|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4018" PostTypeId="1" CreationDate="2014-12-01T22:51:39.213" Score="4" ViewCount="558" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/d73QM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the demo, there are 6 spaces between &lt;code&gt;main.c&lt;/code&gt; (buffer name) and &lt;code&gt;[parse-early_param&lt;/code&gt; (from &lt;code&gt;which-func&lt;/code&gt;), 4 spaces between &lt;code&gt;which-func&lt;/code&gt; and &lt;code&gt;53%&lt;/code&gt;, and 2 or 3 spaces elsewhere. How can I set the space between them just 1 (or maybe 2) in order to save space in the mode line?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="105" LastEditDate="2015-05-20T04:57:42.540" LastActivityDate="2015-05-20T04:57:42.540" Title="Reduce the space between elements in modeline" Tags="|elisp|mode-line|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4019" PostTypeId="2" ParentId="4018" CreationDate="2014-12-01T23:01:10.000" Score="4" Body="&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/_0025_002dConstructs.html#g_t_0025_002dConstructs&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;%-Constructs&lt;/code&gt;&lt;/a&gt;.  In particular, this part:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In any construct except &lt;code&gt;%%&lt;/code&gt;, you can add a decimal integer after&#xA;  the &lt;code&gt;%&lt;/code&gt; to specify a minimum field width.  If the width is less, the&#xA;  field is padded to that width.  Purely numeric constructs (&lt;code&gt;c&lt;/code&gt;, &lt;code&gt;i&lt;/code&gt;,&#xA;  &lt;code&gt;I&lt;/code&gt;, and &lt;code&gt;l&lt;/code&gt;) are padded by inserting spaces to the left, and others&#xA;  are padded by inserting spaces to the right.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For the format of the mode line as a whole, see variable &lt;code&gt;mode-line-format&lt;/code&gt;, which is covered in the manual at node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html#Mode-Line-Format&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Mode Line Format&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, you do not modify &lt;code&gt;mode-line-format&lt;/code&gt; directly, but you modify one or more of the variables that it uses as constituents.  These are covered in node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Variables.html#Mode-Line-Variables&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Mode Line Variables&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You ask, in particular, about the space between what comes from variable &lt;code&gt;mode-line-buffer-identification&lt;/code&gt; and what comes from variable &lt;code&gt;mode-line-modes&lt;/code&gt;.  This is controlled by the right padding for the first of these variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if &lt;code&gt;mode-line-buffer-identification&lt;/code&gt; is &lt;code&gt;(&quot;%12b&quot;)&lt;/code&gt; then if you change it to &lt;code&gt;(&quot;%1b&quot;)&lt;/code&gt; the right padding will be reduced from 12 spaces to 1 space.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-12-01T23:13:26.003" LastActivityDate="2014-12-01T23:13:26.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4020" PostTypeId="1" AcceptedAnswerId="4024" CreationDate="2014-12-01T23:08:56.057" Score="18" ViewCount="1031" Body="&lt;p&gt;If some emacs-lisp function, such as a major mode hook, is taking longer than expected to execute, I would sometimes like to interrupt it and look at the current stack. Ideally, I'd also like to be able to look at variable values, and so on, in the debugger. I'm not talking about code that I am deliberately executing in emacs-lisp mode, but rather code that gets executed in the normal operation of emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I interrupt execution of emacs-lisp code directly in emacs? I do not know up front which function I need to debug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, typing &lt;code&gt;C-g&lt;/code&gt;, while it interrupts execution, also tells me nothing about which function was interrupted.&lt;/p&gt;&#xA;" OwnerUserId="875" LastActivityDate="2014-12-02T02:53:39.877" Title="Interrupt evaluation and observe current stack in the emacs-lisp debugger?" Tags="|elisp|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4021" PostTypeId="1" AcceptedAnswerId="4022" CreationDate="2014-12-01T23:13:22.817" Score="4" ViewCount="3225" Body="&lt;p&gt;I would like Projectile Mode to recognize other projects besides the default ones (GIT, Maven, etc.) The &lt;code&gt;README.md&lt;/code&gt; describes how to customize project root files, however it doesn't explain how Projectile learns what files belong to a project once it has found a project root file.  Therefore, what are the steps needed to configure a custom project root file?&lt;/p&gt;&#xA;" OwnerUserId="2763" LastActivityDate="2014-12-02T02:57:16.697" Title="Adding a new project type to Projectile Mode" Tags="|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4022" PostTypeId="2" ParentId="4021" CreationDate="2014-12-01T23:53:29.903" Score="5" Body="&lt;p&gt;Assuming you have &lt;code&gt;projectile-indexing-method&lt;/code&gt; set to 'alien' (the&#xA;default except for Windows), if the VCS isn't recognized, projectile&#xA;will call &lt;code&gt;projectile-generic-command&lt;/code&gt;, which is &quot;find . -type f&#xA;-print0&quot; by default. If you want to take a closer look,&#xA;&lt;code&gt;projectile-get-ext-command&lt;/code&gt; is the function that decides to what to&#xA;call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think there's any easy way to add a custom project type, but for an example of what you'd need to add, you can follow &lt;a href=&quot;https://github.com/bbatsov/projectile/commit/8576b3a776f7e8554d5bf3865f03d9a1de23951e&quot; rel=&quot;nofollow&quot;&gt;this commit&lt;/a&gt; that added support for fossil.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It's probably wrong for me to use the term 'project type' above since&#xA;projectile has a &lt;code&gt;projectile-project-type&lt;/code&gt; that determines a project&#xA;type that is unrelated to the VCS used (django, python, rails,...). This&#xA;information is only used for setting the test and compilation commands.&#xA;As described above, it is the VCS (or lack of one) that determines how&#xA;project files are collected.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-12-02T02:57:16.697" LastActivityDate="2014-12-02T02:57:16.697" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4024" PostTypeId="2" ParentId="4020" CreationDate="2014-12-02T00:06:45.587" Score="18" Body="&lt;p&gt;You can make &lt;code&gt;C-g&lt;/code&gt; trigger the debugger by turning on &lt;code&gt;debug-on-quit&lt;/code&gt;. Just do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x toggle-debug-on-quit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now every time you hit &lt;code&gt;C-g&lt;/code&gt; you'll get a backtrace of what was going&#xA;on. This backtrace is interactive, so you can keep stepping through the function with &lt;code&gt;d&lt;/code&gt;, and you can start moving out with &lt;code&gt;c&lt;/code&gt;. (Give it a try, it's easier to see than to read).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the same backtrace you get by adding &lt;code&gt;(debug)&lt;/code&gt; inside your&#xA;code. Here's a &lt;a href=&quot;http://endlessparentheses.com/debugging-elisp-part-2-advanced-topics.html&quot;&gt;short blog post&lt;/a&gt;&#xA;on it, and the relevant &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Debugging.html&quot;&gt;Elisp manual page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="105" LastEditDate="2014-12-02T02:53:39.877" LastActivityDate="2014-12-02T02:53:39.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4025" PostTypeId="2" ParentId="4018" CreationDate="2014-12-02T00:14:16.733" Score="0" Body="&lt;p&gt;To set the space between elements of your modeline, you just have to &quot;type&quot; the space key. For example, in this &lt;a href=&quot;https://github.com/LeMeteore/emacs.d/blob/master/lisp/init_modeline.el&quot; rel=&quot;nofollow&quot;&gt;modeline configuration&lt;/a&gt;, I use &lt;code&gt;&quot; -- &quot;&lt;/code&gt; or &lt;code&gt;&quot; &quot;&lt;/code&gt; to separate elements of my modeline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is one part of the setup, just to show you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; line and column&#xA;&quot; -- &quot;;;&quot;[&quot; ;; '%02' to set to 2 chars at least; prevents flickering&#xA;(propertize &quot;%02l&quot; 'face 'font-lock-type-face) &quot;,&quot;&#xA;(propertize &quot;%02c&quot; 'face 'font-lock-type-face)&#xA;;;&quot;] &quot;&#xA;;; relative position, size of file&#xA;&quot; -- &quot;&#xA;(propertize &quot;%p&quot; 'face 'font-lock-constant-face) ;; % above top&#xA;&quot; &quot;&#xA;(propertize &quot;%I&quot; 'face 'font-lock-constant-face) ;; size&#xA;;;&quot;] &quot;&#xA;&quot; &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-12-02T00:14:16.733" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4026" PostTypeId="2" ParentId="4017" CreationDate="2014-12-02T02:01:56.047" Score="6" Body="&lt;p&gt;Use a &lt;code&gt;search&lt;/code&gt; and &lt;code&gt;replace&lt;/code&gt; loop instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the doc of &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/replace-regexp&quot;&gt;&lt;code&gt;replace-regexp&lt;/code&gt;&lt;/a&gt; indicates:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function is for interactive use only;&lt;br&gt;&#xA;  in Lisp code use &lt;code&gt;re-search-forward&lt;/code&gt; and &lt;code&gt;replace-match&lt;/code&gt; instead.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One of the advantages of this approach is that &lt;code&gt;replace-match&lt;/code&gt; has a&#xA;&lt;code&gt;LITERAL&lt;/code&gt; argument, which does what you're asking for.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while (search-forward-regexp SOME-RX nil 'noerror)&#xA;  ;; This \\1 will be inserted literally as \1&#xA;  (replace-match &quot; \\1&quot; nil 'literal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-12-02T02:27:32.867" LastActivityDate="2014-12-02T02:27:32.867" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4027" PostTypeId="2" ParentId="4005" CreationDate="2014-12-02T08:49:12.050" Score="4" Body="&lt;p&gt;Combining &lt;a href=&quot;https://github.com/magnars/string-edit.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;string-edit&lt;/code&gt;&lt;/a&gt; with a bit of custom elisp can provide the feature you&#xA;want. For example, the function below will enable you to edit the value of a&#xA;variable in &lt;code&gt;string-edit-mode&lt;/code&gt;, provided that this variable is string-valued. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/edit-string-variable-at-point ()&#xA;  &quot;If the symbol at point is a string-valued variable, update it&#xA;using `string-edit' to provide the new value.&quot;&#xA;  (interactive)&#xA;  (let ((variable (intern (thing-at-point 'symbol t))))&#xA;    (with-current-buffer (get-buffer-create &quot;*edit-variable*&quot;)&#xA;      (erase-buffer)&#xA;      (print `(setq ,variable ,(symbol-value variable))&#xA;             (current-buffer))&#xA;      (goto-char (- (point-max) 3))&#xA;      (if (string-edit-at-point)&#xA;          ;; Variable value is a string&#xA;          ;; Overrides C-c C-c so that the new value is evaluated after `string-edit-conclude'&#xA;          (let ((oldmap (cdr (assoc 'string-edit-mode minor-mode-map-alist)))&#xA;                (newmap (make-sparse-keymap)))&#xA;            (set-keymap-parent newmap oldmap)&#xA;            (define-key newmap (kbd &quot;C-c C-c&quot;)&#xA;              #'(lambda ()&#xA;                  (interactive)&#xA;                  (string-edit-conclude)&#xA;                  (eval-buffer)&#xA;                  (kill-buffer)))&#xA;            (make-local-variable 'minor-mode-overriding-map-alist)&#xA;            (push `(string-edit-mode . ,newmap) minor-mode-overriding-map-alist))&#xA;        ;; Variable value was not a string&#xA;        (message &quot;`%s' is not a string!&quot; variable)&#xA;        (kill-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2014-12-03T07:21:13.123" LastActivityDate="2014-12-03T07:21:13.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4028" PostTypeId="2" ParentId="4016" CreationDate="2014-12-02T08:59:45.520" Score="2" Body="&lt;p&gt;I see &lt;strong&gt;different options&lt;/strong&gt; for solving this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;to &quot;outsource&quot; text editing to Emacs by copying the text into an Emacs buffer, edit it there and then copy it back to the original application.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There is e. g. the &lt;a href=&quot;https://addons.mozilla.org/en-us/firefox/addon/its-all-text/&quot; rel=&quot;nofollow&quot;&gt;It's all text extension for Firefox&lt;/a&gt; which makes that possible.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;redefine the same keybindings like in Emacs in other Applications&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;as I wrote before, this seems to be nearly impossible in a multi-platform environment, where the Alt-Key is &quot;blocked&quot; by system wide commands in &lt;code&gt;MacOS X&lt;/code&gt;, while the Ctrl-Key is blocked in the same way in &lt;code&gt;MS Windows&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;some of those &lt;code&gt;Emacs&lt;/code&gt; navigation keybindings do already work in &lt;code&gt;Mac OS X&lt;/code&gt;, e. g. in Safari in text fields, which is really cool. But then I try to use others (like M-f, M-b) which are already bound to system wide commands like Cmd-f for searching, and it fails...&lt;/li&gt;&#xA;&lt;li&gt;for Firefox there is e. g. the &lt;a href=&quot;http://www.mew.org/~kazu/proj/firemacs/en/&quot; rel=&quot;nofollow&quot;&gt;Firemacs&lt;/a&gt; extension, which redefines the key bindings. I liked it a lot in the beginning, but then got really really confused and frustrated using other computers without this extension, so I disabled it.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2377" LastActivityDate="2014-12-02T08:59:45.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4029" PostTypeId="1" AcceptedAnswerId="5787" CreationDate="2014-12-02T09:51:18.973" Score="5" ViewCount="678" Body="&lt;p&gt;I'm so close to getting two 80-char vertical buffers side by side on a 1366px wide monitor. I've got a cool frame font,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-font (font-spec :family &quot;Monkey&quot; :size 20 :antialias nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've removed my scrollbars, set my fringe to 1px width, and my line numbers to dynamic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm &lt;strong&gt;one column&lt;/strong&gt; away from editing heaven. The thing is, my eyes can't handle the tiny fonts anymore, so I can't go down to size 19. I tried setting 19.5, but it just made the font larger.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set a fractional font size in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Environment:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ubuntu 14.04 amd64&lt;/li&gt;&#xA;&lt;li&gt;Emacs 24.3.1, installed from package&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2014-12-04T01:00:07.697" LastActivityDate="2014-12-31T00:59:48.690" Title="How to set a fractional font size in Emacs?" Tags="|fonts|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4030" PostTypeId="1" AcceptedAnswerId="4032" CreationDate="2014-12-02T09:52:36.380" Score="6" ViewCount="422" Body="&lt;p&gt;Is there a setting  in &lt;code&gt;auctex&lt;/code&gt; that can hide (fold) comments (paragraphs which start with &lt;code&gt;%&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="253" LastEditDate="2014-12-02T11:56:25.603" LastActivityDate="2014-12-02T11:56:25.603" Title="AucTeX: can I hide comments?" Tags="|latex|auctex|code-folding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4031" PostTypeId="1" AcceptedAnswerId="4039" CreationDate="2014-12-02T11:17:45.940" Score="10" ViewCount="1223" Body="&lt;p&gt;I've been using Emacs for quite a number of years now, but I only recently stumbled over the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html#Coding-Conventions&quot;&gt;coding standards&lt;/a&gt;. There it is stated:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Don't make a habit of putting close-parentheses on lines by themselves; Lisp programmers find this disconcerting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is exactly the habit I've built up, since I find the code to be easier to read. I see mixed styles in the packages delivered with Emacs. My question is if this disconcert is common to most elisp programmers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Looking at my code, I'm not strictly following this. Then the code would be quite horrible. It's mostly defun, let, if and so forth. But, it seems to be against the grain, so I should probably stop doing this. Cheers for the input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Borderline opinion based, but it seems related to closing braces in C++, where it shouldn't be controversial to state that they generally should be on their own lines).&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="105" LastEditDate="2015-07-11T04:58:03.193" LastActivityDate="2015-07-11T04:58:03.193" Title="Closing parenthesis on own line unacceptable?" Tags="|elisp|coding-conventions|" AnswerCount="3" CommentCount="11" ClosedDate="2014-12-03T13:03:35.737" ContentLicense="CC BY-SA 3.0" />
  <row Id="4032" PostTypeId="2" ParentId="4030" CreationDate="2014-12-02T11:49:47.460" Score="8" Body="&lt;p&gt;You can use &lt;code&gt;TeX-fold-comment&lt;/code&gt; (&lt;code&gt;C-c C-o C-c)&lt;/code&gt; to hide the comment.  You need to enable &lt;code&gt;TeX-fold-mode&lt;/code&gt; to make use of this functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Folding.html&quot;&gt;AUCTeX manual on folding macros and environments&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-02T11:49:47.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4033" PostTypeId="1" AcceptedAnswerId="4036" CreationDate="2014-12-02T12:37:09.153" Score="3" ViewCount="442" Body="&lt;p&gt;I have just been using Hexl-mode to investigate some binary files.  What I would like though, is some way of highlighting the byte under consideration: at the moment the line and column indices are highlighted.  It would be very helpful if the intersection of that line and column could be highlighted with a color.  For example: the highlighted square in this picture have some color or background which distinguishes it from its surrounds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XNhoH.jpg&quot; alt=&quot;hexl-mode with current position highlighted&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way of doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, I'm using:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)&#xA; of 2014-03-08 on lamiak, modified by Debian&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in Ubuntu 14.04 LTS&lt;/p&gt;&#xA;" OwnerUserId="2767" LastActivityDate="2014-12-02T13:01:51.080" Title="Hexl-mode with colors?" Tags="|font-lock|hexl-mode|coloring|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4034" PostTypeId="1" AcceptedAnswerId="5297" CreationDate="2014-12-02T12:50:19.347" Score="4" ViewCount="797" Body="&lt;p&gt;While it is easy to run the whole test suite with &lt;code&gt;projectile-rails&lt;/code&gt;, this takes too much time. I'd like to be able to run the current test (i.e., the test point is located in) with a shortcut. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2037" LastEditorUserId="504" LastEditDate="2014-12-04T11:27:21.913" LastActivityDate="2014-12-11T14:34:55.497" Title="projectile-rails: run the current test" Tags="|projectile|testing|ruby|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4035" PostTypeId="2" ParentId="3945" CreationDate="2014-12-02T13:00:37.130" Score="4" Body="&lt;p&gt;eshell commands are send using &lt;code&gt;start-file-process&lt;/code&gt;. This spawns an asynchronous process; and Tramp handles them the way you have seen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not an error of Tramp a priori; dumb Tramp does what it is instructed to do ...&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2014-12-02T13:00:37.130" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4036" PostTypeId="2" ParentId="4033" CreationDate="2014-12-02T13:01:51.080" Score="4" Body="&lt;p&gt;I recomend you try &lt;code&gt;nhexl-mode&lt;/code&gt; (install it from &lt;code&gt;M-x package-install&lt;/code&gt; or &lt;code&gt;M-x package-list&lt;/code&gt;).  It does do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, hexl-mode almost does what you want, since it places the cursor right in front of the byte you want highlighted.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-02T13:01:51.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4037" PostTypeId="1" AcceptedAnswerId="4038" CreationDate="2014-12-02T14:02:57.097" Score="4" ViewCount="566" Body="&lt;p&gt;I've been trying evil mode in emacs. Unfortunately, it does not remind me to &quot;Help poor children in Uganda!&quot; when I start emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to simulate this? Hopefully there's just a setting for evil-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks MrBones&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Xc6IA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find it very soothing...&lt;/p&gt;&#xA;" OwnerUserId="2139" LastEditorUserId="2139" LastEditDate="2014-12-02T18:42:07.623" LastActivityDate="2021-04-28T10:46:05.617" Title="Simulate vim splash screen" Tags="|evil|vim-emulation|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4038" PostTypeId="2" ParentId="4037" CreationDate="2014-12-02T14:05:58.127" Score="6" Body="&lt;p&gt;Add this to your init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inhibit-startup-screen t)&#xA;(setq initial-scratch-message &quot;;; Message goes here&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first bit hides the startup screen, so the default buffer when you open emacs will &lt;code&gt;*scratch*&lt;/code&gt;. The second lines sets the default contents in the scratch buffer.&lt;/p&gt;&#xA;" OwnerUserId="503" LastActivityDate="2014-12-02T14:05:58.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4039" PostTypeId="2" ParentId="4031" CreationDate="2014-12-02T14:16:02.440" Score="7" Body="&lt;p&gt;Well &lt;strong&gt;a&lt;/strong&gt; short answer is &quot;there is no need&quot;. As Emacs can parse the s-expressions of LISP it knows exactly where the forms balance out and can re-indent the code correctly. In this case putting moving a bracket down to it's own line simply wastes an extra line of space and at the same time is non-idomatic and jarring to other LISP programmers who are used to the canonical style. As has been mentioned in the comments this doesn't preclude you from using vertical white-space to visually separate chunks of code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice a lot of Emacs using LISP programmers use a variety of additional visual cues like &lt;em&gt;show-paren-mode&lt;/em&gt; that help navigating through a dense nest of closing parenthesis. Engineers that have subsumed modules like &lt;em&gt;paredit&lt;/em&gt; and &lt;em&gt;smart-parens&lt;/em&gt; into their editing cycle have become at one with the AST and are simply manipulating its structure directly in a way that expressions are always balanced and complete.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-12-03T10:09:26.773" LastActivityDate="2014-12-03T10:09:26.773" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4040" PostTypeId="1" CreationDate="2014-12-02T15:07:28.867" Score="7" ViewCount="182" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I change &lt;code&gt;org-mode&lt;/code&gt;'s definition of a commented line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the manual, &lt;a href=&quot;http://orgmode.org/manual/Comment-lines.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-mode&lt;/code&gt; comments&lt;/a&gt; work as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Lines starting with zero or more whitespace characters followed by one '#' and a whitespace are treated as comments&lt;/strong&gt; and will never be exported. Also entire subtrees starting with the word ‘COMMENT’ will never be exported. Finally, regions surrounded by '#+BEGIN_COMMENT' ... '#+END_COMMENT' will not be exported. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'd like to adjust the single-&lt;code&gt;#&lt;/code&gt; notation to allow multiple &lt;code&gt;#&lt;/code&gt;s so that Emacs will correctly fontify such lines as comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wUt8z.jpg&quot; alt=&quot;comment lines&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm doing this because I have timestamp blocks at the top of the file that start with multiple comment characters:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bBzrW.jpg&quot; alt=&quot;comment block&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I can't figure out which variables I need to adjust.  I've tried modifying &lt;code&gt;comment-start&lt;/code&gt;, &lt;code&gt;comment-start-skip&lt;/code&gt;, and even &lt;code&gt;comment-padding&lt;/code&gt;, but with no luck (&lt;code&gt;org-comment-string&lt;/code&gt; appears not to be relevant here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;em&gt;how can I get &lt;code&gt;org-mode&lt;/code&gt; to treat lines starting with multiple &lt;code&gt;#&lt;/code&gt;s as comments?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="50" LastEditDate="2014-12-03T00:03:10.473" LastActivityDate="2014-12-03T00:03:10.473" Title="Modify org-mode's definition of comment lines?" Tags="|org-mode|font-lock|comment|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4041" PostTypeId="2" ParentId="4031" CreationDate="2014-12-02T15:50:36.590" Score="3" Body="&lt;p&gt;I've been writing Elisp for about 2-3 years now.  At first, I was&#xA;doing the hanging parens thing, but since I've discovered the rule&#xA;that you mentioned, I've started doing it myself. And I can say now&#xA;that it's much easier to read the code when it's properly styled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I even wrote some LISP prettifying code here:&#xA;&lt;a href=&quot;http://abo-abo.github.io/lispy/#lispy-tab&quot; rel=&quot;nofollow&quot;&gt;lispy-tab&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, of course, I have &lt;code&gt;show-paren-mode&lt;/code&gt; on all the time.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-02T15:50:36.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4042" PostTypeId="2" ParentId="4031" CreationDate="2014-12-02T16:02:53.303" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://mumble.net/~campbell/scheme/style.txt&quot;&gt;Riastradh's Lisp Style Guide&lt;/a&gt; elaborates a bit more on this specific topic. While he generally discourages from placing closing parentheses on their own line, he recognizes several exceptions, such as a previous line with a closing paren being commented out and really long lists that would otherwise constantly mess up diffs when adding new elements at their beginning or end.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-02T16:02:53.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4043" PostTypeId="1" AcceptedAnswerId="4044" CreationDate="2014-12-02T17:21:24.437" Score="9" ViewCount="4895" Body="&lt;p&gt;I am using auto-insert so that I can get the usual things I use for org mode when opening a new .org file, example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+AUTHOR:   Edgar Aroutiounian&#xA;#+EMAIL:    edgar.factorial@gmail.com&#xA;#+STARTUP:  indent&#xA;#+LANGUAGE: en&#xA;#+OPTIONS:  toc:nil num:0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this gets inserted into every new .org file because I added a &lt;code&gt;define-auto-insert&lt;/code&gt; for .org files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The startup in-buffer setting is important to me, unfortunately I can't get it org-mode to respect it. (Before discovering auto-insert, I used a one off function that inserted this stuff and then called org-mode-restart)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding a call to revert-buffer at the end of the org-mode-hook doesn't work either because for new files there is nothing to revert to, and obviously putting a org-mode-restart in the add-hook for org-mode will crap out as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt; will redo the in-buffer settings if the mark is placed over the &lt;code&gt;#+STARTUP: indent&lt;/code&gt;, so I tried adding &#xA;&lt;code&gt;(org-ctrl-c-ctrl-c &quot;#+STARTUP:  indent\n&quot;)&lt;/code&gt; to my org-mode-hook, but that didn't work either. (Was that even a good approach?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get org-mode to reparse my in-buffer settings for all .org files? &lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="780" LastEditDate="2014-12-02T20:37:02.300" LastActivityDate="2014-12-02T20:37:02.300" Title="Best way to make org-mode reload in-buffer settings" Tags="|org-mode|auto-insert|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4044" PostTypeId="2" ParentId="4043" CreationDate="2014-12-02T18:01:33.867" Score="10" Body="&lt;p&gt;You can use a function for your auto-insert action, and in that function call &lt;code&gt;org-mode-restart&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-template ()&#xA;  (insert &quot;#+STARTUP: indent&quot;)&#xA;  (org-mode-restart))&#xA;&#xA;(define-auto-insert &quot;\\.org$&quot; #'my/org-template)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;(insert-file FILENAME)&lt;/code&gt; to insert the contents of a template file instead of just a string. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, the simpler approach (as I commented earlier) would be to customize org-mode with the settings you want, so that you do not need to rely on inserting and re-reading content.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-12-02T18:01:33.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4045" PostTypeId="1" AcceptedAnswerId="4052" CreationDate="2014-12-02T18:42:32.590" Score="12" ViewCount="2089" Body="&lt;p&gt;I'm a bit compulsive about updating packages for all of my systems, so I find myself running &lt;code&gt;list-packages&lt;/code&gt; -&gt; &lt;code&gt;U&lt;/code&gt; -&gt; &lt;code&gt;x&lt;/code&gt; -&gt; &lt;code&gt;y&lt;/code&gt; -&gt; &lt;code&gt;y&lt;/code&gt; pretty much daily to update my packages and delete old versions once the update is complete. How can I automate this process so that at the very least I have to run only one function to update, compile, and delete my packages? Or is there some reason I might not want to do that?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2017-04-04T17:02:27.263" Title="Automatically update packages and delete old versions" Tags="|package|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4046" PostTypeId="2" ParentId="4045" CreationDate="2014-12-02T18:46:23.490" Score="3" Body="&lt;p&gt;You can automate this with &lt;a href=&quot;https://github.com/cask/cask&quot; rel=&quot;nofollow&quot;&gt;Cask&lt;/a&gt;. This works for package development, but also for user configuration. The &lt;a href=&quot;http://cask.readthedocs.org/en/latest/guide/usage.html&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; provides details for setting this up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;a href=&quot;https://github.com/rdallasgray/pallet&quot; rel=&quot;nofollow&quot;&gt;Pallet&lt;/a&gt; is useful for keeping your Cask file up-to-date with changes you make in the *Packages* buffer.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-12-02T18:46:23.490" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4047" PostTypeId="2" ParentId="4040" CreationDate="2014-12-02T19:29:36.810" Score="3" Body="&lt;p&gt;The following is a &lt;em&gt;partial&lt;/em&gt; answer that addresses the cosmetic issue (get the font-locking visuals correct), but it does not actually modify what &lt;code&gt;org-mode&lt;/code&gt; considers to be a comment (e.g., for exporting purposes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add a font lock keyword:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'org-mode '((&quot;^\\s-*#+\\s-?.*&quot; . 'font-lock-comment-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-02T19:29:36.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4049" PostTypeId="1" AcceptedAnswerId="4051" CreationDate="2014-12-02T19:55:16.563" Score="4" ViewCount="498" Body="&lt;p&gt;I have a read-only file that I open in Emacs. I have created a keyboard shortcut to hide some regions of the file. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hide-beginning ()&#xA;  (interactive)&#xA;  (setq buffer-read-only nil)&#xA;  (put-text-property 1 10 'invisible t)&#xA;  (setq buffer-read-only t)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I exit the buffer with &lt;code&gt;kill-buffer&lt;/code&gt; or rather &lt;code&gt;ido-kill-buffer&lt;/code&gt;, I get the question&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Buffer myfile.txt modified; kill anyway? (yes or no)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can this question be avoided?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-06T19:34:21.747" Title="Prevent Emacs from asking &quot;kill anyway&quot; when only text properties have changed" Tags="|text-properties|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4050" PostTypeId="2" ParentId="4049" CreationDate="2014-12-02T20:03:56.000" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Modification.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; notes that you can use &lt;code&gt;set-buffer-modified-p&lt;/code&gt; with a &lt;code&gt;nil&lt;/code&gt; argument to flag the buffer as unmodified.  Hence, if you want your function not to modify the buffer, you could do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hide-beginning ()&#xA;  (interactive)&#xA;  (let ((buffer-read-only nil)&#xA;        (buffer-modified (buffer-modified-p)))&#xA;    (put-text-property 1 10 'invisible t)&#xA;    (set-buffer-modified-p buffer-modified)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="25" LastEditDate="2014-12-04T00:24:54.707" LastActivityDate="2014-12-04T00:24:54.707" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4051" PostTypeId="2" ParentId="4049" CreationDate="2014-12-02T20:07:47.370" Score="5" Body="&lt;p&gt;If you only care about changes that occur in this function, you can use &lt;code&gt;buffer-modified-p&lt;/code&gt; and &lt;code&gt;set-buffer-modified-p&lt;/code&gt; to store the modified state and restore it after changing the properties.&lt;/p&gt;&#xA;" OwnerUserId="735" LastActivityDate="2014-12-02T20:07:47.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4052" PostTypeId="2" ParentId="4045" CreationDate="2014-12-02T21:17:38.357" Score="17" Body="&lt;p&gt;The following is now part of the Paradox package. Just invoke &lt;code&gt;paradox-upgrade-packages&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This should do it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/upgrade ()&#xA;  &quot;Upgrade all packages, no questions asked.&quot;&#xA;  (interactive)&#xA;  (save-window-excursion&#xA;    (list-packages)&#xA;    (package-menu-mark-upgrades)&#xA;    (package-menu-execute 'no-query)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just check which function is called by each of the steps you enumerated, and throw them inside an interactive function. Normally, the &lt;code&gt;(y or n)&lt;/code&gt; prompts would be an issue, but &lt;code&gt;package-menu-execute&lt;/code&gt; conveniently takes a &lt;code&gt;NO-QUERY&lt;/code&gt; argument.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-01-03T21:32:27.217" LastActivityDate="2015-01-03T21:32:27.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4053" PostTypeId="1" AcceptedAnswerId="4058" CreationDate="2014-12-02T21:34:49.077" Score="10" ViewCount="1594" Body="&lt;p&gt;In Vim you can press &lt;code&gt;.&lt;/code&gt; to repeat the latest change, including inserting text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While in Emacs &lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;z&lt;/code&gt; only repeats the last command. I am aware that macros can be used here, but more than often I realize that I need to re-insert the same text too late. When I need to re-insert it only &lt;em&gt;one more time&lt;/em&gt;, defining a macro then is pointless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there a way to repeat the insertion of text inside of Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2775" LastEditorUserId="45" LastEditDate="2014-12-02T21:40:07.443" LastActivityDate="2015-02-19T13:47:50.313" Title="Repeat last text insert" Tags="|text-editing|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4054" PostTypeId="2" ParentId="4053" CreationDate="2014-12-02T21:55:57.657" Score="4" Body="&lt;p&gt;I think &lt;code&gt;dabbrev-expand&lt;/code&gt; function could do the trick. Let's suppose you've already typed some words: emacs, emotion, emoji, ... The next time you'll type a word beginning by 'em', you can hit &lt;code&gt;M-/&lt;/code&gt; and emacs will propose you to insert one of the already inserted words begining by 'em'. Keep hitting &lt;code&gt;M-/&lt;/code&gt; and emacs will show you 'emoji', then 'emotion, then ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also have a look to &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_repeat_command.html&quot; rel=&quot;nofollow&quot;&gt;repeat-complex-command&lt;/a&gt;. The popular example being: you want to repeat the command &lt;code&gt;query-replace&lt;/code&gt; in many different buffers always using the same arguments, replace “pitt” by “patt”. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You run it once, go to a different window, and type &lt;code&gt;C-x ESC ESC&lt;/code&gt; to run it again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And to finish, may I suggest &lt;a href=&quot;http://www.emacswiki.org/emacs/repeat-insert.el&quot; rel=&quot;nofollow&quot;&gt;repeat-insert&lt;/a&gt;? This el file will help you to do insertion, using some kind of logic. It is more like, &quot;reapeat last insertion, but for each iteration, the arguments will change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This example could be found in the &lt;a href=&quot;http://www.emacswiki.org/emacs/repeat-insert.el&quot; rel=&quot;nofollow&quot;&gt;el&lt;/a&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; You can also iterate over lists:&#xA;;;   My desk is cluttered&#xA;;;   My desk is a real mess&#xA;;;   My desk is very hard to see&#xA;;;   My desk is buried&#xA;;;&#xA;;; from m-x insert-patterned&#xA;;;    &quot;;;   My desk is %s&quot;&#xA;;;    (cluttered &quot;a real mess&quot; &quot;very hard to see&quot; buried)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope that will help.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-12-03T00:41:31.087" LastActivityDate="2014-12-03T00:41:31.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4055" PostTypeId="1" AcceptedAnswerId="4101" CreationDate="2014-12-02T22:01:44.777" Score="2" ViewCount="576" Body="&lt;p&gt;I have used &lt;code&gt;customize-group&lt;/code&gt; on &lt;code&gt;semantic&lt;/code&gt; to set &lt;code&gt;global-semantic-idle-summary-mode&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. My &lt;code&gt;.emacs&lt;/code&gt; has this entry in &lt;code&gt;custom-set-variables&lt;/code&gt; : &lt;code&gt;'(global-semantic-idle-summary-mode t)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, on starting emacs and opening a C++ source file, I don't see the idle summary at point.&lt;br&gt;&#xA;On disabling and re-enabling idle summary mode with two calls to &lt;code&gt;M-x global-idle-summary-mode&lt;/code&gt;, the summary items start showing up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I set this up correctly?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="50" LastEditDate="2014-12-02T23:08:53.117" LastActivityDate="2014-12-04T03:42:26.553" Title="Global semantic summary mode not enabled at startup" Tags="|init-file|semantic-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4056" PostTypeId="1" AcceptedAnswerId="4057" CreationDate="2014-12-02T22:55:54.280" Score="5" ViewCount="358" Body="&lt;p&gt;I would like to replace a two-line string not ending in digit with a one line string. For example, replacing the following two-line string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Extensions of the Single—Sa1e&#xA;Model 414&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With a one line string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Extensions of the Single—Sa1e Model 414&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;replace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My regex pattern to match is &lt;code&gt;[^[:digit:]]^J&lt;/code&gt;, but I don't know how to capture the non digit part and then refer it in the replace string. How can I do this? Also, how can I specify the new line character?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="45" LastEditDate="2014-12-02T23:03:11.603" LastActivityDate="2014-12-04T00:37:31.977" Title="Replace a two-line string not ending in digit with a one line string" Tags="|regular-expressions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4057" PostTypeId="2" ParentId="4056" CreationDate="2014-12-02T23:07:01.027" Score="4" Body="&lt;p&gt;Type the newline char using &lt;code&gt;C-q C-j&lt;/code&gt;. Capture parts of the match that you want using regexp groups.  Reuse such group matches using &lt;code&gt;\N&lt;/code&gt; syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x replace-regexp&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt; &lt;code&gt;\([^:digit:]]\)&lt;/code&gt; &lt;code&gt;C-q C-j&lt;/code&gt; &lt;code&gt;\(.+\)&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt; &lt;code&gt;\1 \2&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you enter 3 things, with &lt;code&gt;RET&lt;/code&gt;: the command name, the regexp, and the replacement. The replacement uses &lt;code&gt;\N&lt;/code&gt; syntax to reuse groups.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to write a command that does this, you write a quick-and-dirty one that just calls what is written above (with backslashes doubled and with &lt;code&gt;&quot;\n&quot;&lt;/code&gt; in place of &lt;code&gt;C-q C-j&lt;/code&gt;). But if you want to write a command as it should be written, you would use write a loop that calls &lt;code&gt;re-search-forward&lt;/code&gt; to find a match and then calls &lt;code&gt;replace-match&lt;/code&gt; to replace it.  See the Elisp manual, nodes &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Search.html#Regexp-Search&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Regexp Search&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Replacing-Match.html#Replacing-Match&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Replacing Match&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="25" LastEditDate="2014-12-04T00:37:31.977" LastActivityDate="2014-12-04T00:37:31.977" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4058" PostTypeId="2" ParentId="4053" CreationDate="2014-12-02T23:47:38.657" Score="10" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/wyrickre/dot-mode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;dot-mode&lt;/code&gt;&lt;/a&gt; is a &quot;minor mode to repeat typing or commands,&quot; and may do what you need.  It basically just repeats the last insertions/deletions that you do.  It is pretty similar to &lt;code&gt;.&lt;/code&gt; in Vi(m).&lt;/p&gt;&#xA;" OwnerUserId="2778" LastEditorUserId="184" LastEditDate="2014-12-03T19:50:50.443" LastActivityDate="2014-12-03T19:50:50.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4060" PostTypeId="2" ParentId="4056" CreationDate="2014-12-03T00:12:59.767" Score="3" Body="&lt;p&gt;This does not answer your question, since you asked for a regexp to do it, but I think it's worth mentioning that the same can be done easily using a keyboard macro. Start recording with &lt;code&gt;F3&lt;/code&gt;, search for the regexp with &lt;code&gt;C-s M-r [^[:digit:]]^J &amp;lt;RET&amp;gt;&lt;/code&gt;, press &lt;code&gt;Backspace&lt;/code&gt; to join the lines and &lt;code&gt;F4&lt;/code&gt; to finish the macro. Then repeat by pressing &lt;code&gt;F4&lt;/code&gt; until all lines are joined.&lt;/p&gt;&#xA;" OwnerUserId="735" LastActivityDate="2014-12-03T00:12:59.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4061" PostTypeId="1" CreationDate="2014-12-03T00:28:08.420" Score="2" ViewCount="239" Body="&lt;p&gt;Often when I'm editing a file with many uncommon unicode symbols (e.g., in languages like haskell, julia or c++), and (I think) especially with an ornate color theme, I experience delays of maybe about five seconds when switching between buffers. Running emacs under lldb show a stack trace below; I get a similar stack trace from running &lt;code&gt;emacs -Q&lt;/code&gt; and typing &lt;code&gt;C-h h&lt;/code&gt; (&lt;code&gt;view-hello-file&lt;/code&gt;), which takes quite a while to display the hello file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do about these window redrawing delays? I am not sure what I have misconfigured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does emacs reload all fonts every time I switch to a different frame or buffer? It also seems to have a delay sometimes when a previously invisible overlay is shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also related is that &lt;code&gt;fontd&lt;/code&gt; CPU usage spikes during the delay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;OS X 10.9.5&lt;/code&gt; with emacs compiled from source&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I've had this problem with git development version as well some time ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stack trace from &lt;code&gt;-Q&lt;/code&gt;. This is similar to the one below from regular emacs use, so I suspect the slowness of &lt;code&gt;view-hello-file&lt;/code&gt; is related.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* thread #1: tid = 0xfc87d, 0x00007fff86f26a1a libsystem_kernel.dylib`mach_msg_trap + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP&#xA;  * frame #0: 0x00007fff86f26a1a libsystem_kernel.dylib`mach_msg_trap + 10&#xA;    frame #1: 0x00007fff86f25d18 libsystem_kernel.dylib`mach_msg + 64&#xA;    frame #2: 0x00007fff91f0c78d libFontRegistry.dylib`XTSendCopyPropertyForFonts + 227&#xA;    frame #3: 0x00007fff91f2987c libFontRegistry.dylib`TGlobalFontRegistryImp::CopyPropertyForFonts(__CFArray const*, __CFString const*, TFontQueryOptions const&amp;amp;) const + 292&#xA;    frame #4: 0x00007fff91f0c16f libFontRegistry.dylib`XTCopyPropertyForFonts + 115&#xA;    frame #5: 0x00007fff86e20817 CoreText`TBaseFont::CreateTraitsValuesPerFontInfo() const + 143&#xA;    frame #6: 0x00007fff86e2068f CoreText`TBaseFont::CopyTraitsInternal() const + 87&#xA;    frame #7: 0x00007fff86e22e81 CoreText`TBaseFont::CreateTraitsValues() const + 29&#xA;    frame #8: 0x00007fff86e22e49 CoreText`TBaseFont::GetSymbolicTraitsInternal() const + 21&#xA;    frame #9: 0x00007fff86e22e17 CoreText`TBaseFont::GetSymbolicTraits(bool) const + 17&#xA;    frame #10: 0x00007fff86e7fe63 CoreText`CompareLocalizedDescriptorsByTraitsAndPrecedence(void const*, void const*, void*, bool, bool) + 353&#xA;    frame #11: 0x00007fff92040547 CoreFoundation`__CFSimpleMergeSort + 455&#xA;    frame #12: 0x00007fff9204034b CoreFoundation`CFSortIndexes + 443&#xA;    frame #13: 0x00007fff92040048 CoreFoundation`CFQSortArray + 232&#xA;    frame #14: 0x00007fff9203fefe CoreFoundation`CFArraySortValues + 1054&#xA;    frame #15: 0x00007fff86e7f008 CoreText`TDescriptorSource::CopyAllDescriptorsInternal(bool, CFComparisonResult (*)(void const*, void const*, void*)) const + 186&#xA;    frame #16: 0x00007fff86e7f142 CoreText`TDescriptorSource::CopyAllDescriptorsSorted() const + 26&#xA;    frame #17: 0x00007fff86e25bfd CoreText`TDescriptor::CreateMatchingDescriptors(__CFSet const*, unsigned long) const + 249&#xA;    frame #18: 0x00007fff86e6bf36 CoreText`CTFontDescriptorCreateMatchingFontDescriptors + 87&#xA;    frame #19: 0x00007fff8b55c521 AppKit`-[NSCTFontDescriptor matchingFontDescriptorsWithMandatoryKeys:] + 12&#xA;    frame #20: 0x00000001001c5d60 Emacs`ns_findfonts(font_spec=4345331237, isMatch='\0') + 1600 at nsfont.m:564&#xA;    frame #21: 0x000000010014ab10 Emacs`font_list_entities(f=0x000000010282b648, spec=4330619989) + 720 at font.c:2759&#xA;    frame #22: 0x000000010014cc33 Emacs`font_find_for_lface(f=0x000000010282b648, attrs=0x00000001077b2780, spec=&amp;lt;unavailable&amp;gt;, c=-1) + 1971 at font.c:3235&#xA;    frame #23: 0x00000001001985bb Emacs`fontset_find_font(fontset=4329826901, c=3626, face=0x00000001077b2780, id=&amp;lt;unavailable&amp;gt;, fallback=false) + 1755 at fontset.c:636&#xA;    frame #24: 0x0000000100194f13 Emacs`fontset_font(fontset=4339946117, c=3626, face=0x00000001077b2780, id=38) + 323 at fontset.c:754&#xA;    frame #25: 0x0000000100194d41 Emacs`face_for_char(f=0x000000010282b648, face=0x00000001077b2780, c=3626, pos=&amp;lt;unavailable&amp;gt;, object=&amp;lt;unavailable&amp;gt;) + 337 at fontset.c:956&#xA;    frame #26: 0x000000010001b19b Emacs`get_next_display_element(it=&amp;lt;unavailable&amp;gt;) + 2907 at xdisp.c:7193&#xA;    frame #27: 0x00000001000284d8 Emacs`display_line(it=0x00007fff5fbf76c8) + 1304 at xdisp.c:20183&#xA;    frame #28: 0x0000000100027de6 Emacs`try_window(window=&amp;lt;unavailable&amp;gt;, flags=1, pos=&amp;lt;unavailable&amp;gt;) + 214 at xdisp.c:16972&#xA;    frame #29: 0x000000010004bb43 Emacs`redisplay_window(window=4337071693, just_this_one_p=false) + 13651 at xdisp.c:16451&#xA;    frame #30: 0x00000001000524f6 Emacs`redisplay_window_0(window=&amp;lt;unavailable&amp;gt;) + 38 at xdisp.c:14348&#xA;    frame #31: 0x0000000100138b34 Emacs`internal_condition_case_1(bfun=0x00000001000524d0, arg=4337071693, handlers=&amp;lt;unavailable&amp;gt;, hfun=&amp;lt;unavailable&amp;gt;) + 260 at eval.c:1372&#xA;    frame #32: 0x0000000100048554 Emacs`redisplay_windows(window=&amp;lt;unavailable&amp;gt;) + 180 at xdisp.c:14328&#xA;    frame #33: 0x0000000100048512 Emacs`redisplay_windows(window=&amp;lt;unavailable&amp;gt;) + 114 at xdisp.c:14322&#xA;    frame #34: 0x0000000100026938 Emacs`redisplay_internal + 6184 at xdisp.c:13927&#xA;    frame #35: 0x00000001000c1a5e Emacs`read_char(commandflag=1, map=4329109910, prev_event=4328534074, used_mouse_menu=0x00007fff5fbff31f, end_time=0x0000000000000000) + 1982 at keyboard.c:2570&#xA;    frame #36: 0x00000001000bf0dc Emacs`read_key_sequence(bufsize=&amp;lt;unavailable&amp;gt;, keybuf=&amp;lt;unavailable&amp;gt;, prompt=&amp;lt;unavailable&amp;gt;, dont_downcase_last=&amp;lt;unavailable&amp;gt;, can_return_switch_frame=&amp;lt;unavailable&amp;gt;, fix_current_buffer=&amp;lt;unavailable&amp;gt;, prevent_redisplay=&amp;lt;unavailable&amp;gt;) + 1964 at keyboard.c:9088&#xA;    frame #37: 0x00000001000be6f0 Emacs`command_loop_1 + 4736 at keyboard.c:1452&#xA;    frame #38: 0x0000000100138a1b Emacs`internal_condition_case(bfun=0x00000001000bd470, handlers=&amp;lt;unavailable&amp;gt;, hfun=&amp;lt;unavailable&amp;gt;) + 251 at eval.c:1348&#xA;    frame #39: 0x00000001000ceb6e Emacs`command_loop_2(ignore=&amp;lt;unavailable&amp;gt;) + 62 at keyboard.c:1177&#xA;    frame #40: 0x00000001001383a3 Emacs`internal_catch(tag=&amp;lt;unavailable&amp;gt;, func=0x00000001000ceb30, arg=4328534074) + 243 at eval.c:1112&#xA;    frame #41: 0x00000001000bcaad Emacs`recursive_edit_1 [inlined] command_loop + 68 at keyboard.c:1156&#xA;    frame #42: 0x00000001000bca69 Emacs`recursive_edit_1 + 265 at keyboard.c:777&#xA;    frame #43: 0x00000001000bcbf2 Emacs`Frecursive_edit + 242 at keyboard.c:848&#xA;    frame #44: 0x00000001000bb7da Emacs`main(argc=0, argv=&amp;lt;unavailable&amp;gt;) + 5850 at emacs.c:1646&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Stack trace from regular emacs use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* thread #1: tid = 0xd3a52, 0x00007fff86f2a5da libsystem_kernel.dylib`__open + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP&#xA;  * frame #0: 0x00007fff86f2a5da libsystem_kernel.dylib`__open + 10&#xA;    frame #1: 0x00007fff8c6ec4f7 libFontParser.dylib`TFileDescriptorContext::TFileDescriptorContext(char const*) + 67&#xA;    frame #2: 0x00007fff8c6ec2f5 libFontParser.dylib`TFileDataReference::TFileDataReference(char const*) + 117&#xA;    frame #3: 0x00007fff8c6ec0fc libFontParser.dylib`TFileDataSurrogate::TFileDataSurrogate(char const*, bool) + 142&#xA;    frame #4: 0x00007fff8c6eaa3b libFontParser.dylib`TFont::CreateFontEntitiesForFile(char const*, bool, TSimpleArray&amp;lt;TFont*&amp;gt;&amp;amp;, bool, short, char const*) + 1847&#xA;    frame #5: 0x00007fff8c6e9e1f libFontParser.dylib`FPFontCreateFontsWithPath + 253&#xA;    frame #6: 0x00007fff9190b1f4 libCGXType.A.dylib`create_private_data_with_path + 19&#xA;    frame #7: 0x00007fff8df42185 CoreGraphics`CGFontCreateFontsWithPath + 40&#xA;    frame #8: 0x00007fff8df41d9a CoreGraphics`CGFontCreateFontsWithURL + 383&#xA;    frame #9: 0x00007fff86e0f2ec CoreText`CreateFontWithFontURL(__CFURL const*, bool) + 60&#xA;    frame #10: 0x00007fff86e0f10b CoreText`TCGFontCache::CopyFont(__CFURL const*, bool) const + 91&#xA;    frame #11: 0x00007fff86e0ef35 CoreText`TBaseFont::CopyNativeFont() const + 69&#xA;    frame #12: 0x00007fff86e0eeb6 CoreText`TBaseFont::CopyGraphicsFont() const + 26&#xA;    frame #13: 0x00007fff86e14a6b CoreText`TBaseFont::CopyAvailableTables(unsigned int) const + 31&#xA;    frame #14: 0x00007fff86e1471b CoreText`TBaseFont::GetFormat() const + 249&#xA;    frame #15: 0x00007fff86e7713b CoreText`TBaseFont::CopyFormat() const + 21&#xA;    frame #16: 0x00007fff86e2039a CoreText`TBaseFont::CopyAttribute(unsigned long) const + 874&#xA;    frame #17: 0x00007fff86e0e291 CoreText`TDescriptor::CopyAttribute(__CFString const*) const + 175&#xA;    frame #18: 0x00007fff86e0e1bf CoreText`CTFontDescriptorCopyAttribute + 99&#xA;    frame #19: 0x00000001001c6f1a Emacs`macfont_list(f=&amp;lt;unavailable&amp;gt;, spec=4345331237) + 2986 at macfont.m:2313&#xA;    frame #20: 0x000000010014ab10 Emacs`font_list_entities(f=0x000000010104f248, spec=4782535053) + 720 at font.c:2759&#xA;    frame #21: 0x000000010014cc33 Emacs`font_find_for_lface(f=0x000000010104f248, attrs=0x000000010d1adb60, spec=&amp;lt;unavailable&amp;gt;, c=949) + 1971 at font.c:3235&#xA;    frame #22: 0x0000000100198711 Emacs`fontset_find_font(fontset=4325821517, c=&amp;lt;unavailable&amp;gt;, face=0x000000010d1adb60, id=&amp;lt;unavailable&amp;gt;, fallback=false) + 2097 at fontset.c:681&#xA;    frame #23: 0x0000000100194f13 Emacs`fontset_font(fontset=4440753229, c=949, face=0x000000010d1adb60, id=-1) + 323 at fontset.c:754&#xA;    frame #24: 0x0000000100194d41 Emacs`face_for_char(f=0x000000010104f248, face=0x000000010d1adb60, c=949, pos=&amp;lt;unavailable&amp;gt;, object=&amp;lt;unavailable&amp;gt;) + 337 at fontset.c:956&#xA;    frame #25: 0x000000010001b19b Emacs`get_next_display_element(it=&amp;lt;unavailable&amp;gt;) + 2907 at xdisp.c:7193&#xA;    frame #26: 0x000000010002d4cf Emacs`display_string(string=&amp;lt;unavailable&amp;gt;, lisp_string=&amp;lt;unavailable&amp;gt;, face_string=&amp;lt;unavailable&amp;gt;, face_string_pos=&amp;lt;unavailable&amp;gt;, start=&amp;lt;unavailable&amp;gt;, it=0x00007fff5fbf7678, field_width=&amp;lt;unavailable&amp;gt;, precision=&amp;lt;unavailable&amp;gt;, max_x=&amp;lt;unavailable&amp;gt;, multibyte=&amp;lt;unavailable&amp;gt;) + 1599 at xdisp.c:23391&#xA;    frame #27: 0x00000001000303fb Emacs`display_mode_element(it=0x00007fff5fbf7678, depth=&amp;lt;unavailable&amp;gt;, field_width=&amp;lt;unavailable&amp;gt;, precision=&amp;lt;unavailable&amp;gt;, elt=&amp;lt;unavailable&amp;gt;, props=&amp;lt;unavailable&amp;gt;, risky=1) + 9115 at xdisp.c:21980&#xA;    frame #28: 0x000000010002e428 Emacs`display_mode_element(it=&amp;lt;unavailable&amp;gt;, depth=&amp;lt;unavailable&amp;gt;, field_width=&amp;lt;unavailable&amp;gt;, precision=&amp;lt;unavailable&amp;gt;, elt=&amp;lt;unavailable&amp;gt;, props=4328534074, risky=1) + 968 at xdisp.c:22274&#xA;    frame #29: 0x000000010002e428 Emacs`display_mode_element(it=&amp;lt;unavailable&amp;gt;, depth=&amp;lt;unavailable&amp;gt;, field_width=&amp;lt;unavailable&amp;gt;, precision=&amp;lt;unavailable&amp;gt;, elt=&amp;lt;unavailable&amp;gt;, props=4328534074, risky=1) + 968 at xdisp.c:22274&#xA;    frame #30: 0x0000000100019df2 Emacs`display_mode_line(w=&amp;lt;unavailable&amp;gt;, face_id=MODE_LINE_FACE_ID, format=4322675206) + 402 at xdisp.c:21791&#xA;    frame #31: 0x0000000100050ac7 Emacs`display_mode_lines(w=0x0000000101046248) + 359 at xdisp.c:21734&#xA;    frame #32: 0x0000000100049c1a Emacs`redisplay_window(window=4312031821, just_this_one_p=false) + 5674 at xdisp.c:16804&#xA;    frame #33: 0x00000001000524f6 Emacs`redisplay_window_0(window=&amp;lt;unavailable&amp;gt;) + 38 at xdisp.c:14348&#xA;    frame #34: 0x0000000100138b34 Emacs`internal_condition_case_1(bfun=0x00000001000524d0, arg=4312031821, handlers=&amp;lt;unavailable&amp;gt;, hfun=&amp;lt;unavailable&amp;gt;) + 260 at eval.c:1372&#xA;    frame #35: 0x0000000100048554 Emacs`redisplay_windows(window=&amp;lt;unavailable&amp;gt;) + 180 at xdisp.c:14328&#xA;    frame #36: 0x0000000100048512 Emacs`redisplay_windows(window=&amp;lt;unavailable&amp;gt;) + 114 at xdisp.c:14322&#xA;    frame #37: 0x0000000100026938 Emacs`redisplay_internal + 6184 at xdisp.c:13927&#xA;    frame #38: 0x00000001000c1a5e Emacs`read_char(commandflag=1, map=4326491702, prev_event=4328534074, used_mouse_menu=0x00007fff5fbff31f, end_time=0x0000000000000000) + 1982 at keyboard.c:2570&#xA;    frame #39: 0x00000001000bf0dc Emacs`read_key_sequence(bufsize=&amp;lt;unavailable&amp;gt;, keybuf=&amp;lt;unavailable&amp;gt;, prompt=&amp;lt;unavailable&amp;gt;, dont_downcase_last=&amp;lt;unavailable&amp;gt;, can_return_switch_frame=&amp;lt;unavailable&amp;gt;, fix_current_buffer=&amp;lt;unavailable&amp;gt;, prevent_redisplay=&amp;lt;unavailable&amp;gt;) + 1964 at keyboard.c:9088&#xA;    frame #40: 0x00000001000be6f0 Emacs`command_loop_1 + 4736 at keyboard.c:1452&#xA;    frame #41: 0x0000000100138a1b Emacs`internal_condition_case(bfun=0x00000001000bd470, handlers=&amp;lt;unavailable&amp;gt;, hfun=&amp;lt;unavailable&amp;gt;) + 251 at eval.c:1348&#xA;    frame #42: 0x00000001000ceb6e Emacs`command_loop_2(ignore=&amp;lt;unavailable&amp;gt;) + 62 at keyboard.c:1177&#xA;    frame #43: 0x00000001001383a3 Emacs`internal_catch(tag=&amp;lt;unavailable&amp;gt;, func=0x00000001000ceb30, arg=4328534074) + 243 at eval.c:1112&#xA;    frame #44: 0x00000001000bcaad Emacs`recursive_edit_1 [inlined] command_loop + 68 at keyboard.c:1156&#xA;    frame #45: 0x00000001000bca69 Emacs`recursive_edit_1 + 265 at keyboard.c:777&#xA;    frame #46: 0x00000001000bcbf2 Emacs`Frecursive_edit + 242 at keyboard.c:848&#xA;    frame #47: 0x00000001000bb7da Emacs`main(argc=0, argv=&amp;lt;unavailable&amp;gt;) + 5850 at emacs.c:1646&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="875" LastEditorUserId="875" LastEditDate="2014-12-04T01:46:51.170" LastActivityDate="2014-12-04T01:46:51.170" Title="Debugging an emacs font configuration problem on OS X" Tags="|fonts|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4062" PostTypeId="1" AcceptedAnswerId="4064" CreationDate="2014-12-03T00:49:20.757" Score="4" ViewCount="2852" Body="&lt;p&gt;I followed &lt;a href=&quot;http://juanjoalvarez.net/es/detail/2014/sep/19/vim-emacsevil-chaotic-migration-guide/&quot; rel=&quot;nofollow&quot;&gt;this guide&lt;/a&gt; to make escape quit from various modes...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; esc quits&#xA;(defun minibuffer-keyboard-quit ()&#xA;  &quot;Abort recursive edit.&#xA;In Delete Selection mode, if the mark is active, just deactivate it;&#xA;then it takes a second \\[keyboard-quit] to abort the minibuffer.&quot;&#xA;  (interactive)&#xA;  (if (and delete-selection-mode transient-mark-mode mark-active)&#xA;      (setq deactivate-mark  t)&#xA;    (when (get-buffer &quot;*Completions*&quot;) (delete-windows-on &quot;*Completions*&quot;))&#xA;    (abort-recursive-edit)))&#xA;(define-key evil-normal-state-map [escape] 'keyboard-quit)&#xA;(define-key evil-visual-state-map [escape] 'keyboard-quit)&#xA;(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)&#xA;(global-set-key [escape] 'evil-exit-emacs-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To make helm quit using escape, I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key helm-map [escape] 'helm-keyboard-quit)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This didn't work. Setting other keys instead of escape works fine though.&lt;/p&gt;&#xA;" OwnerUserId="2704" LastEditorUserId="45" LastEditDate="2014-12-03T00:53:08.393" LastActivityDate="2014-12-03T20:38:39.073" Title="evil mode - make helm quit with the escape key" Tags="|helm|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4063" PostTypeId="1" CreationDate="2014-12-03T02:05:17.457" Score="10" ViewCount="1619" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I have &lt;code&gt;org-mode&lt;/code&gt; return the raw data for an agenda view without actually creating an agenda view?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to access my agenda for an arbitrary day.  However, I do not want to create an &lt;a href=&quot;http://orgmode.org/manual/Agenda-Views.html&quot;&gt;&lt;em&gt;agenda view&lt;/em&gt;&lt;/a&gt; per se.  Instead, I want &lt;code&gt;org-mode&lt;/code&gt; to collect and sort all of the elements that would go into the agenda view for that day and return them (ideally in a list) for further inspection and manipulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had presumed that &lt;code&gt;org-agenda-list&lt;/code&gt; would be the place to start.  However, that function is a tangled beast and seems to intermingle the collecting, sorting, and displaying processes.  As such, I presume (hope?) that I've simply missed the relevant function somewhere that provides the functionality I'm after.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-10-15T23:34:46.607" Title="How to get the raw data for an org-mode agenda without an agenda view?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4064" PostTypeId="2" ParentId="4062" CreationDate="2014-12-03T02:12:38.673" Score="4" Body="&lt;p&gt;Define a function &lt;code&gt;my-helm-init&lt;/code&gt; which runs &lt;code&gt;(define-key helm-map (kbd &quot;ESC&quot;) 'helm-keyboard-quit)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Call &lt;code&gt;my-helm-init&lt;/code&gt; from the &lt;code&gt;after-init-hook&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="573" LastEditorUserId="2704" LastEditDate="2014-12-03T20:38:39.073" LastActivityDate="2014-12-03T20:38:39.073" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4065" PostTypeId="1" CreationDate="2014-12-03T02:14:16.263" Score="0" ViewCount="296" Body="&lt;p&gt;I'm trying to execute shell-commands in emacs which play sounds or otherwise involve audio output, but I'm not having much luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I execute:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command&#xA; (concat &quot;espeak -v mb-en1 -k5 -s150 &quot; &quot;'&quot; &quot;hello&quot; &quot; &quot; &quot;world&quot; &quot;'&quot; &quot; --stdout|paplay&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No audio output is generated and I find the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Connection failure: Connection refused&#xA;pa_context_connect() failed: Connection refused&#xA;1 (#o1, #x1, ?\C-a)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A different though related problem, if I try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command&#xA;                (concat &quot;mplayer -really-quiet &quot; &quot;/usr/share/sounds/speech-dispatcher/test.wav&quot; &quot; 2&amp;gt; /dev/null&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again, I don't actually get any audio output and I find the message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(Shell command succeeded with no output)&#xA;0 (#o0, #x0, ?\C-@)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both commands work as expected from the actual terminal shell (i.e. they produce audio output).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Ok, this seems to be part of a more general problem.  On my home computer I finally got everything to work by allowing greater permissions to pulse-audio. However, now on my office computer, I'm having trouble getting &lt;code&gt;notify-send&lt;/code&gt; to work when issued in &lt;code&gt;shell-command&lt;/code&gt; in Emacs.  I'm getting the same odd &lt;code&gt;0 (#o0, #x0, ?\C-@)&lt;/code&gt; message when I try to do this.&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="891" LastEditDate="2014-12-03T18:40:15.940" LastActivityDate="2014-12-05T15:19:29.130" Title="Pulseaudio and `shell-command` calls in Emacs" Tags="|shell-command|linux|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4066" PostTypeId="1" AcceptedAnswerId="4067" CreationDate="2014-12-03T02:37:11.930" Score="1" ViewCount="578" Body="&lt;p&gt;With &lt;code&gt;semantic-mode&lt;/code&gt; enabled and reading a C++ source file in &lt;code&gt;cc-mode&lt;/code&gt;, running &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; correctly shows all the classes, variables and functions defined in that file. However, all the descriptions have the characters &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;*&lt;/code&gt; missing. So, by simply looking at the entries shown in the &lt;code&gt;helm semantic/imenu&lt;/code&gt; buffer, I can't tell the correct signatures. For example, a member variable defined as &lt;code&gt;const char* fileName&lt;/code&gt; shows up as &lt;code&gt;const char fileName&lt;/code&gt;. Is there some variable which would change this display behaviour?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT : More information thanks to @TuDo - Both &lt;code&gt;semantic-ia-show-summary&lt;/code&gt; and &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; use &lt;code&gt;semantic-format-tag-summarize&lt;/code&gt; to parse the tag info. However, the latter correctly outputs &lt;code&gt;const char* fileName&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2014-12-03T05:34:24.807" LastActivityDate="2014-12-24T08:17:32.953" Title="helm-semantic-imenu doesn't identify pointers and references in C++ code" Tags="|c++|semantic-mode|imenu|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4067" PostTypeId="2" ParentId="4066" CreationDate="2014-12-03T03:06:24.907" Score="2" Body="&lt;p&gt;In a buffer with only the line &lt;code&gt;const char* fileName&lt;/code&gt; as above, running &lt;code&gt;(semantic-fetch-tags)&lt;/code&gt; returns this tag that gives back &lt;code&gt;char&lt;/code&gt; as type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;filename&quot; variable (:pointer 1 :constant-flag t :type &quot;char&quot;) nil #&amp;lt;overlay from 1 to 22 in 03-095759.c&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The type is &quot;char&quot;, although it has the attribute &lt;code&gt;:pointer 1&lt;/code&gt; to denote the level of pointer. &lt;code&gt;helm-semantic&lt;/code&gt; does not account for this attribute, so I will try to update it and create a PR for Helm to fix this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: But then, the Helm function uses &lt;code&gt;semantic-format-tag-summarize&lt;/code&gt; to format tag for displaying in Helm, so this is a bug in Semantic itself for not returning correct original appearance of tag. I will report this to CEDET maintainer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT2&lt;/strong&gt;: As a workaround until this got fixed. you can at least press &lt;code&gt;TAB&lt;/code&gt; to temporary jump to function signature and view the correct one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT3&lt;/strong&gt;: I finally reproduced the error with a minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((tag (car (semantic-fetch-tags))))&#xA;  (with-temp-buffer&#xA;    (insert (semantic-format-tag-summarize tag nil t))&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Eval the above code in a file with a pointer. For some reason, when the buffer string is returned, characters like &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;&amp;amp;&lt;/code&gt; is deleted. Maybe it should be escaped when ``semantic-format-tag-summarize` returns tag string? I already reported this issue to CEDET maintainer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT4&lt;/strong&gt;: This bug was fixed with commit &lt;a href=&quot;https://github.com/emacs-helm/helm/commit/9ea601ec45210fb1a20309b710afc74a0a301353&quot; rel=&quot;nofollow&quot;&gt;9ea601e&lt;/a&gt;. The problem is solved.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-12-24T08:17:32.953" LastActivityDate="2014-12-24T08:17:32.953" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4068" PostTypeId="1" AcceptedAnswerId="4070" CreationDate="2014-12-03T03:07:51.797" Score="1" ViewCount="330" Body="&lt;p&gt;I've been using emacs for 3 months and I never have problem like this, I installed a theme then my emacs had lag. Actually it is not a big deal there is small diffrence between without theme and with theme but I wanted to know why is this happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacsfodder/emacs-clues-theme&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacsfodder/emacs-clues-theme&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the theme which I said above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think it is not about theme here is my init file(currently I'm kind of newbie) : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; load theme&#xA;(load-theme 'ritchie t)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/&quot;)&#xA;; for dirtree package&#xA;(require 'dirtree)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/yasnippet-0.8.0&quot;)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;; care about this place&#xA;;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;backtab&amp;gt;&quot;) 'yas-expand)&#xA;; care about this place&#xA;(setq ac-source-yasnippet nil)&#xA;&#xA;(semantic-mode 1)&#xA;(defun my:add-semantic-to-autocomplete() &#xA;  (add-to-list 'ac-sources 'ac-source-semantic)&#xA;)&#xA;(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/auto-complete-1.3.1&quot;)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/auto-complete-1.3.1/dict&quot;)&#xA;(global-auto-complete-mode t) ; section1&#xA;;(ac-set-trigger-key &quot;TAB&quot;)&#xA;;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;&#xA;(defun my:ac-c-headers-init ()&#xA;  (require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-headers))&#xA;&#xA;(add-hook 'c++-mode-hook 'my:ac-c-headers-init)&#xA;(add-hook 'c-mode-hook 'my:ac-c-headers-init)&#xA;&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/ajc-java-complete/&quot;)&#xA;(require 'ajc-java-complete-config)&#xA;(add-hook 'java-mode-hook 'ajc-java-complete-mode)&#xA;(add-hook 'find-file-hook 'ajc-4-jsp-find-file-hook)&#xA;(setq ajc-tag-file-list (list (expand-file-name &quot;~/.java_base.tag&quot;)))&#xA;(setq ajc-use-plain-method-completion t)&#xA;&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/jdee-2.4.1/lisp&quot;)&#xA;(add-hook 'java-mode-hook 'load &quot;jde&quot;)&#xA;;(load &quot;jde&quot;)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d&quot;)&#xA;(require 'linum)&#xA;(global-linum-mode 1)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/yasnippet-0.8.0&quot;)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;; care about this place&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;backtab&amp;gt;&quot;) 'yas-expand)&#xA;; care about this place&#xA;(setq ac-source-yasnippet nil)&#xA;&#xA;&#xA;;(add-to-list 'load-path &quot;~/.emacs.d/auto-complete-1.3.1&quot;)&#xA;;(require 'auto-complete-config)&#xA;;(ac-config-default)&#xA;;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;)&#xA;;(global-auto-complete-mode t) ; section1&#xA;;(ac-set-trigger-key &quot;TAB&quot;)&#xA;;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;&#xA;;(defun my:ac-c-headers-init ()&#xA; ; (require 'auto-complete-c-headers)&#xA;  ;(add-to-list 'ac-sources 'ac-source-c-headers))&#xA;&#xA;;(add-hook 'c++-mode-hook 'my:ac-c-headers-init)&#xA;;(add-hook 'c-mode-hook 'my:ac-c-headers-init)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/iedit&quot;)&#xA;(require 'iedit)&#xA;(define-key global-map (kbd &quot;C-c ;&quot;) 'iedit-mode)&#xA;&#xA;;(semantic-mode 1)&#xA;;(defun my:add-semantic-to-autocomplete() &#xA; ; (add-to-list 'ac-sources 'ac-source-semantic)&#xA;;)&#xA;;(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 2)&#xA;(setq indent-line-function 'insert-tab)&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(default ((t (:family &quot;Ubuntu Mono&quot; :foundry &quot;unknown&quot; :slant normal :weight normal :height 113 :width normal)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="2305" LastEditDate="2014-12-03T03:13:32.387" LastActivityDate="2014-12-03T05:46:05.413" Title="emacs 24 lag problem" Tags="|themes|emacs24.4|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4069" PostTypeId="1" CreationDate="2014-12-03T04:45:39.787" Score="5" ViewCount="161" Body="&lt;p&gt;I'm sending some commands to my emacs using emacsclient --eval on a timer. The only problem with this is if at the time I happen to be using emacs and press C-g to cancel something, instead of canceling what I intended to cancel it will cancel the commands that emacsclient is sending, printing the message &quot;Quit emacsclient request.&quot; I actually want to let the emacsclient code finish, and then have C-g cancel whatever I originally intended to cancel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I could wrap the commands I'm sending in &lt;code&gt;(let ((inhibit-quit t)) ...)&lt;/code&gt;. But it turns out if you look at the source for server-execute and server-eval-and-print that they &lt;strong&gt;override&lt;/strong&gt; inhibit-quit, on the reasoning that emacsclient actions are usually instigated by the user and that must be what they want to have quit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd have two hotkeys, C-g for quitting my normal interactive stuff, and something else, say C-S-g for quitting emacsclient stuff (in case I accidentally send an infinite loop). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I could copy pasta the server-execute function and rip out the quit handling bit, but then I'd be left at the mercy of infinite loops when they do come up. Ideas?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2014-12-03T07:48:12.107" LastActivityDate="2014-12-03T21:59:10.737" Title="How to have C-g *not* cancel emacsclient eval commands?" Tags="|emacsclient|server|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4070" PostTypeId="2" ParentId="4068" CreationDate="2014-12-03T05:46:05.413" Score="2" Body="&lt;p&gt;As always, recursively bisect your init file, to determine where the problem is. Don't just hand us a big sack and ask what's wrong, and don't try to guess, yourself, with tons of stuff in a big grabbag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To bisect your file, comment out 1/2 of it (you can use &lt;code&gt;M-x comment-region&lt;/code&gt; to comment and &lt;code&gt;C-u M-x comment-region&lt;/code&gt; to uncomment), then 3/4, then 7/8,... It is very quick to do - it's a binary search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you will know just what causes the problem. Within the theme code, if that is the problem, you can apply the same approach, to see what part(s) of it are problematic.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-03T05:46:05.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4071" PostTypeId="2" ParentId="4053" CreationDate="2014-12-03T06:59:21.503" Score="7" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;It's &lt;strong&gt;as if I forgot to start defining a macro&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could use &lt;code&gt;kmacro-edit-lossage&lt;/code&gt; (&lt;code&gt;C-x C-k l&lt;/code&gt;) for that: it allows you to view your 300 last keystrokes (including simple insertions), and edit them as a macro. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simple usage, you would just locate the beginning of the insertion you want to repeat, delete all text from &quot;Macro:&quot; to that point, and press &lt;code&gt;C-c C-c&lt;/code&gt;. Now you have a macro you can use to perform the same actions, as if you didn't forget to record it in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sadly, this fails if the last 300 keystrokes include mouse clicks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; The following code changes it so that only the keys after the last mouse event are kept. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice recent-keys (after tv/recent-keys-no-mouse first ())&#xA;  &quot;Return only the keys since the last mouse event&quot;&#xA;  (let* ((vec ad-return-value)&#xA;         (lst (append vec nil))&#xA;         (nmax (length vec))&#xA;         (i (- nmax 1)))&#xA;    (while&#xA;        (and&#xA;         (&amp;gt;= i 0)&#xA;         (not&#xA;          (let ((mod (event-modifiers (elt vec i))))&#xA;            (or (memq 'click mod)&#xA;                (memq 'double mod)&#xA;                (memq 'triple mod)&#xA;                (memq 'drag mod)&#xA;                (memq 'down mod)))))&#xA;      (setq i (- i 1)))&#xA;    (setq ad-return-value (vconcat (nthcdr (+ i 1) lst) nil))))&#xA;&#xA;(defun tv/kmacro-edit-lossage-no-mouse ()&#xA;  &quot;Same as `kmacro-edit-lossage', but fallback if the keys contain mouse events.&#xA;&#xA;Source: http://emacs.stackexchange.com/a/4071/184&quot;&#xA;  (interactive)&#xA;  (ad-activate-regexp &quot;tv/recent-keys-no-mouse&quot;)&#xA;  (call-interactively #'kmacro-edit-lossage)&#xA;  (ad-deactivate-regexp &quot;tv/recent-keys-no-mouse&quot;))&#xA;&#xA;;; If you want this function to replace the default one, uncomment this line:&#xA;; (global-set-key (kbd &quot;C-x C-k l&quot;) 'tv/kmacro-edit-lossage-no-mouse)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-02-19T13:47:50.313" LastActivityDate="2015-02-19T13:47:50.313" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4072" PostTypeId="1" AcceptedAnswerId="4073" CreationDate="2014-12-03T07:44:03.197" Score="1" ViewCount="204" Body="&lt;p&gt;I am trying to hide some text in my buffer using text property invisible. This works fine, except that the cursor is not moving correctly when the text is hidden. To reproduce this clearly I think I need a large text file, so to generate a dummy text file &lt;code&gt;t.txt&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ awk 'BEGIN { for (i=1; i&amp;lt;1400; i++) { printf &quot;%4d &quot;, i ; print &quot;abcdedfghijklmnopqrstuvwxyz&quot;; }}' &amp;gt; t.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then consider the lisp code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *my-hide* nil)&#xA;(defun my-hide ()&#xA;  (interactive)&#xA;  (setq *my-hide* (not *my-hide*))&#xA;  (put-text-property 1 32968 'invisible *my-hide*))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open open the file &lt;code&gt;t.txt&lt;/code&gt; and position the cursor at the beginning of the buffer and run &lt;code&gt;(my-hide)&lt;/code&gt; it correctly hides the first 1000 lines. But if I now try to move the cursor with, for example, the page down key, it is moving one character position to the right on the first line but the right scroll bar is still moving. If I hit it again, it jumps to line 1026, the next time it jumps to line 1013 (the right scroll bar is moving down each time)..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs version 24.3.1 on Ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="1979" LastEditDate="2018-12-01T16:37:16.227" LastActivityDate="2018-12-01T16:37:16.227" Title="Strange cursor behavior with text property invisible" Tags="|text-properties|cursor|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="4073" PostTypeId="2" ParentId="4072" CreationDate="2014-12-03T08:20:24.910" Score="2" Body="&lt;p&gt;The problem seems to be related to that I used &lt;code&gt;(global-set-key [next] 'pager-page-down)&lt;/code&gt; and &lt;code&gt;(require 'pager)&lt;/code&gt; in my &lt;code&gt;~/.emacs&lt;/code&gt; init file. It seems to work correctly if I remove those lines..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2014-12-03T08:20:24.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4074" PostTypeId="2" ParentId="4069" CreationDate="2014-12-03T08:24:21.987" Score="4" Body="&lt;p&gt;After a lot of experimenting with writing wrappers around keyboard-quit (the default binding of C-g), I discovered that C-g has special behavior. If you bind C-S-g to keyboard-quit, it will &lt;em&gt;not&lt;/em&gt; interrupt emacsclient requests. Only C-g will. In fact, C-g will do so even if you unbind it with global-unset-key! I don't know why, but in the end this gives me the behavior I want. C-S-g doesn't interrupt emacsclient evals and C-g does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Turns out I was wrong. Sometimes it still interrupts, it's just more rare.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2014-12-03T21:59:10.737" LastActivityDate="2014-12-03T21:59:10.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4075" PostTypeId="2" ParentId="4066" CreationDate="2014-12-03T08:42:41.647" Score="1" Body="&lt;p&gt;I've just patched&#xA;&lt;a href=&quot;https://github.com/abo-abo/function-args#moo-jump-local&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;moo-jump-local&lt;/code&gt;&lt;/a&gt;&#xA;to properly handle &lt;code&gt;const char* fileName&lt;/code&gt;.&#xA;It seems that semantic can't currently parse top-level references. Although it parses them&#xA;in the arguments lists, as you can see here: &lt;img src=&quot;https://i.stack.imgur.com/G6qta.png&quot; alt=&quot;moo-jump-local&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-03T08:42:41.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4076" PostTypeId="1" AcceptedAnswerId="4077" CreationDate="2014-12-03T11:33:51.880" Score="10" ViewCount="636" Body="&lt;p&gt;Is there a way to run ielm, but with variables bound to a certain buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;code&gt;M-:&lt;/code&gt;, but having a shell like ielm to inspect things would be much easier.&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2014-12-03T11:35:53.553" Title="ielm, bound to a certain buffer" Tags="|interactive|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4077" PostTypeId="2" ParentId="4076" CreationDate="2014-12-03T11:35:53.553" Score="14" Body="&lt;p&gt;Hit &lt;code&gt;C-c C-b&lt;/code&gt; to select a buffer for IELM to work upon.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-03T11:35:53.553" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4078" PostTypeId="1" AcceptedAnswerId="4080" CreationDate="2014-12-03T12:46:32.980" Score="3" ViewCount="196" Body="&lt;p&gt;With Emacs 24.3 I get certain keywords highlighted in an inferior Python buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mcYvO.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is no longer the case for Emacs 24.4:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0c9f5.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could possibly cause this? I've made sure it's not my configuration by running &lt;code&gt;emacs -q&lt;/code&gt; and am not sure whether font-locking generally changed or the packaged &lt;code&gt;python.el&lt;/code&gt; has regressed.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-03T14:14:52.523" Title="Emacs 24.4 no longer highlights keywords in `M-x run-python`" Tags="|font-lock|python|comint|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4079" PostTypeId="1" AcceptedAnswerId="4081" CreationDate="2014-12-03T13:15:51.690" Score="2" ViewCount="89" Body="&lt;p&gt;I use AucTeX to edit LaTeX files and a PDF viewer that supports inverse search using SyncTeX. When I click on a location in the PDF, it simply calls emacsclient with the corresponding file and line. Often I want to make a quick change and jump back to where I was before. Unfortunately, point is not pushed to the mark ring, so I have to navigate back manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to have emacsclient set the mark before jumping in an already opened file?&lt;/p&gt;&#xA;" OwnerUserId="735" LastActivityDate="2020-01-21T02:25:29.790" Title="Set mark when jumping from emacsclient" Tags="|emacsclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4080" PostTypeId="2" ParentId="4078" CreationDate="2014-12-03T14:06:44.800" Score="1" Body="&lt;p&gt;I think it's intentional, since the old behaviour isn't really what you'd want. C-h n gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Changes in Specialized Modes and Packages in Emacs 24.4&#xA;...&#xA;*** Python mode&#xA;...&#xA;*** Automatic shell prompt detection.  New user options:&#xA;**** `python-shell-interpreter-interactive-arg'.&#xA;**** `python-shell-prompt-detect-enabled'.&#xA;**** `python-shell-prompt-detect-failure-warning'.&#xA;**** `python-shell-prompt-input-regexps'.&#xA;**** `python-shell-prompt-output-regexps'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That could possibly be related?&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="2688" LastEditDate="2014-12-03T14:14:52.523" LastActivityDate="2014-12-03T14:14:52.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4081" PostTypeId="2" ParentId="4079" CreationDate="2014-12-03T14:18:06.927" Score="2" Body="&lt;p&gt;To give a possible answer to my own question (hope that's ok), here's a solution I just came up with by looking through server.el. It's possible to advise the function that does the jumping:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun server-goto-line-column@push-mark (orig &amp;amp;rest args)&#xA;  (let ((p (save-excursion&#xA;             (apply orig args)&#xA;             (point))))&#xA;    (unless (eq p (point))&#xA;      (push-mark))&#xA;    (goto-char p)))&#xA;(advice-add 'server-goto-line-column :around&#xA;            #'server-goto-line-column@push-mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="735" LastEditorUserId="1979" LastEditDate="2014-12-03T14:43:05.760" LastActivityDate="2014-12-03T14:43:05.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4082" PostTypeId="2" ParentId="4065" CreationDate="2014-12-03T14:18:29.523" Score="-1" Body="&lt;p&gt;Running &lt;code&gt;paprefs&lt;/code&gt; and checking the box next to &quot;enable network access to local sound devices&quot; and under that also the &quot;don't require authentication&quot; box worked as a workaround for the problem.&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="891" LastEditDate="2014-12-05T15:19:29.130" LastActivityDate="2014-12-05T15:19:29.130" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4083" PostTypeId="2" ParentId="3877" CreationDate="2014-12-03T14:49:25.670" Score="0" Body="&lt;p&gt;My very low rent solution for this particular problem was to use hi-lock mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-hightlight-non-possessive-its ()&#xA;  &quot;Turn on hi-lock mode for any (potentially incorrect) usage of it's&quot;&#xA;  (interactive)&#xA;  (hi-lock-face-phrase-buffer &quot;it's&quot;))&#xA;&#xA;;; Hooks for non-possessive its&#xA;(add-hook 'text-mode-hook 'my-hightlight-non-possessive-its)&#xA;(add-hook 'prog-mode-hook 'my-hightlight-non-possessive-its))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-12-03T14:49:25.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4084" PostTypeId="1" AcceptedAnswerId="4114" CreationDate="2014-12-03T15:37:57.803" Score="6" ViewCount="975" Body="&lt;p&gt;One of the convenient features of in-browser inspectors like Firebug is that it is so easy to tweak CSS stylesheets.  As you type in the attribute position, all possible attributes are shown in a dropdown list and can be picked from.  On the right hand side of a declaration, input is restricted to only valid values (which for some attributes is really just a very small number of values).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a CSS mode that makes editing CSS stylesheets easier by offering sensible contextual completion suggestions, or that even restricts my inputs to only valid values.  Does anything like that already exist?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="50" LastEditDate="2014-12-03T18:23:58.480" LastActivityDate="2015-01-07T00:15:18.380" Title="CSS code completion as in Firebug" Tags="|major-mode|completion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4086" PostTypeId="1" AcceptedAnswerId="4087" CreationDate="2014-12-03T16:22:26.990" Score="1" ViewCount="550" Body="&lt;p&gt;I want to manually set up my own Emacs CL environment on Mac OS X 7 without the SLIME package i.e. it will only use Clozure CL. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put it other way, I want to use the Emacs CL just like I use the &quot;Inferior Emacs Lisp Mode&quot; (&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;ielm&lt;/code&gt;) but instead of the plain old Emacs Lisp, it'll use the Clozure CL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I've downloaded Emacs-24.4 installed it under the &lt;code&gt;/Applications&lt;/code&gt; and Clozure CL 1.6 under the &lt;code&gt;/Users/macmini/ccl-1.6&lt;/code&gt; and edited the &lt;code&gt;~/.emacs&lt;/code&gt; to have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inferior-lisp-program &quot;/Users/macmini/ccl-1.6/dx86cl64&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then restarted Emacs to start to use the Clozure CL but I couldn't use it. Can someone show how to use Clozure CL? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2784" LastEditorUserId="2784" LastEditDate="2019-08-14T12:43:06.653" LastActivityDate="2019-08-14T12:43:06.653" Title="How to set up Emacs with Clozure CL but without SLIME" Tags="|subprocess|common-lisp|clojure|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="4087" PostTypeId="2" ParentId="4086" CreationDate="2014-12-03T16:28:30.413" Score="4" Body="&lt;p&gt;Just &lt;code&gt;run-lisp&lt;/code&gt;.&#xA;Afterwards, you can use e.g.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c C-l&lt;/kbd&gt; (&lt;code&gt;lisp-load-file&lt;/code&gt;) to eval a source file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c C-e&lt;/kbd&gt; (&lt;code&gt;lisp-eval-defun&lt;/code&gt;) to eval a statement.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Still, I can't imagine why someone wouldn't want to run SLIME.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-03T16:28:30.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4089" PostTypeId="1" AcceptedAnswerId="4103" CreationDate="2014-12-03T18:17:20.480" Score="12" ViewCount="1784" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/politza/pdf-tools&quot;&gt;pdf-tools&lt;/a&gt; to read PDFs inside of Emacs and greatly prefer it to DocView. I just noticed that when I try to open a URL thar points to a PDF in eww, it uses DocView instead of the pdf-view-mode from pdf-tools. This is particularly annoying since DocView fails to display the PDF! Switching the buffer to pdf-view-mode manually then succesfully shows it. Can I configure things so that eww uses pdf-view-mode on the first try?&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2020-01-14T11:36:19.843" Title="Can I configure eww to use pdf-view-mode (from pdf-tools) for PDFs instead of DocView?" Tags="|eww|pdf|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4090" PostTypeId="1" CreationDate="2014-12-03T19:40:08.317" Score="2" ViewCount="4486" Body="&lt;p&gt;When I try to export an &lt;code&gt;org&lt;/code&gt; file to &lt;code&gt;pdf&lt;/code&gt; using &lt;code&gt;C-c C-e l o&lt;/code&gt; I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Saving file /Users/user/tmp/test.tex...&#xA;Wrote /Users/user/tmp/test.tex&#xA;Processing LaTeX file ./test.tex...&#xA;/bin/bash: pdflatex: command not found [3 times]&#xA;org-latex-compile: PDF file ./test.pdf wasn't produced&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This happens when I open emacs by clicking on the icon that can be found in &lt;code&gt;/Applications&lt;/code&gt;. However, if I open emacs from the command line: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Applications/Emacs.app/Contents/MacOS/Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can export the &lt;code&gt;org&lt;/code&gt; file without any problem. It seems like in both cases the same init file is loaded and I fail to understand the problem. Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: &lt;code&gt;version&lt;/code&gt; returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2014-10-21 on builder10-9.porkrind.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;org-version&lt;/code&gt; returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org-mode version 8.2.10 (8.2.10-21-ga712ce-elpaplus @ /Users/drorata/.emacs.d/elpa/org-plus-contrib-20141201/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, I'm using OS X 10.10.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The &lt;code&gt;$PATH&lt;/code&gt;:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I tried to include either &lt;code&gt;(add-to-list 'exec-path &quot;/usr/texbin/pdflatex&quot;)&lt;/code&gt; or &lt;code&gt;(add-to-list 'exec-path &quot;/usr/texbin&quot;)&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt; but this didn't help.&lt;/p&gt;&#xA;" OwnerUserId="861" LastEditorUserId="861" LastEditDate="2014-12-03T20:18:11.343" LastActivityDate="2015-01-02T20:50:13.960" Title="org-mode cannot find pdflatex using Mac OS" Tags="|org-mode|org-export|osx|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4091" PostTypeId="1" AcceptedAnswerId="4248" CreationDate="2014-12-03T20:12:12.697" Score="0" ViewCount="882" Body="&lt;p&gt;I've downloaded and installed Emacs 24.1 on my PowerPC Mac and it works perfectly. And I've just added the Clozure CL to it and that works perfectly too using &lt;a href=&quot;https://emacs.stackexchange.com/questions/4086/how-to-set-up-emacs-with-clozure-cl-but-without-slime&quot;&gt;this tutorial&lt;/a&gt;. Now, I want to use SLIME. So I installed the SLIME package by:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;package-install&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;slime&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;SLIME seems to have installed itself into the directory &lt;code&gt;~/.emacs.d/elpa/slime-20141126.1323&lt;/code&gt;. So, I added the following code to my &lt;code&gt;~/.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inferior-lisp-program &quot;/Users/haansgruber/lisp/ccl-1.6/dppccl&quot;)&#xA;;; slime&#xA;(add-to-list 'load-path &quot;Users/haansgruber/.emacs.d/elpa/slime-20141126.1323&quot;)&#xA;(require 'slime)&#xA;(slime-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, restarted Emacs to see SWANK loaded SLIME but nothing happened. I entered:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;slime&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, this time it gave an error and fell back to &lt;em&gt;inferior-lisp&lt;/em&gt; which is Clozure CL as shown below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ABvTa.png&quot; alt=&quot;Emacs 24.1 PowerPC Mac&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There must be some wrong lines on the &lt;code&gt;.emacs&lt;/code&gt; config file. There are different &lt;code&gt;.emacs&lt;/code&gt; conf lines available on the Internet and I tried several of them and they all ended up more or less with the same error, so I gave up. Could you help me find the solution?&lt;/p&gt;&#xA;" OwnerUserId="2784" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2019-02-16T17:24:21.687" Title="Trouble setting up Emacs SLIME on PowerPC Mac" Tags="|osx|slime|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4093" PostTypeId="2" ParentId="4090" CreationDate="2014-12-03T20:48:28.873" Score="5" Body="&lt;p&gt;Two hints helped me solve the issue:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;$PATH&lt;/code&gt; and&lt;/li&gt;&#xA;&lt;li&gt;codename &lt;em&gt;Mavericks&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It seems like the problem is indeed related to the path, and the way around it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-exec-path-from-shell-PATH ()&#xA;  &quot;Sets the exec-path to the same value used by the user shell&quot;&#xA;  (let ((path-from-shell&#xA;         (replace-regexp-in-string&#xA;          &quot;[[:space:]\n]*$&quot; &quot;&quot;&#xA;          (shell-command-to-string &quot;$SHELL -l -c 'echo $PATH'&quot;))))&#xA;    (setenv &quot;PATH&quot; path-from-shell)&#xA;    (setq exec-path (split-string path-from-shell path-separator))))&#xA;&#xA;;; call function now&#xA;(set-exec-path-from-shell-PATH)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Taken from &lt;a href=&quot;https://gist.github.com/bradleywright/2046593&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and linked to &lt;a href=&quot;https://stackoverflow.com/a/22158330/671013&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question why there is a different behaviour between the two emacs opening methods remains unanswered.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="861" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-12-03T20:48:28.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4094" PostTypeId="2" ParentId="4091" CreationDate="2014-12-03T20:51:54.643" Score="1" Body="&lt;p&gt;SLIME from &lt;code&gt;package-install&lt;/code&gt; can be finicky at times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~/git&#xA;git clone https://github.com/slime/slime&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/git/slime&quot;)&#xA;(require 'slime-autoloads)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After this, &lt;kbd&gt;M-x slime&lt;/kbd&gt;. It will take a short time to compile&#xA;before the first run. Try sbcl if Clozure doesn't work (I'm using sbcl and I just installed it on my laptop).&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-03T20:51:54.643" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="4095" PostTypeId="1" AcceptedAnswerId="4096" CreationDate="2014-12-03T21:03:00.420" Score="1" ViewCount="79" Body="&lt;p&gt;Is there a major mode for &lt;code&gt;.inf&lt;/code&gt; files (&lt;a href=&quot;https://en.wikipedia.org/wiki/INF_file&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/INF_file&lt;/a&gt;)? If there is one, it's proving to be most unGoogleable. &lt;/p&gt;&#xA;" OwnerUserId="118" LastActivityDate="2014-12-03T21:35:39.113" Title="emacs major mode for INF files" Tags="|major-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4096" PostTypeId="2" ParentId="4095" CreationDate="2014-12-03T21:35:39.113" Score="5" Body="&lt;p&gt;You should be able to use &lt;code&gt;conf-windows-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;INF files are essentially &lt;code&gt;conf-mode&lt;/code&gt; files, so the configuration should work fine.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-12-03T21:35:39.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4098" PostTypeId="1" CreationDate="2014-12-04T00:16:31.920" Score="7" ViewCount="286" Body="&lt;p&gt;&lt;code&gt;latex-mode&lt;/code&gt; is has a nice display of superscripts and subscripts. Not&#xA;only are they reduced in size, but they are respectively raised and&#xA;lowered a bit relative to the current line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I make part of the text in a line look like a superscript?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to make text small (with the &lt;code&gt;height&lt;/code&gt;face property), but I&#xA;don't know how to raise it. I tried to investigate &lt;code&gt;latex-mode&lt;/code&gt;, but&#xA;all I could find was that &lt;code&gt;font-latex-superscript-face&lt;/code&gt; had a small&#xA;&lt;code&gt;height&lt;/code&gt; property (which doesn't account for the raising).&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-12-04T00:37:03.427" LastActivityDate="2014-12-04T00:37:03.427" Title="How does AucTeX display superscripts?" Tags="|auctex|faces|text-properties|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4099" PostTypeId="2" ParentId="4098" CreationDate="2014-12-04T00:23:46.350" Score="7" Body="&lt;p&gt;Use the &lt;code&gt;raise&lt;/code&gt; display property.  As explained in &lt;code&gt;(info &quot;(elisp) Other Display Specs&quot;)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(raise FACTOR)'&#xA;     This kind of display specification raises or lowers the text it&#xA;     applies to, relative to the baseline of the line.&#xA;&#xA;     FACTOR must be a number, which is interpreted as a multiple of the&#xA;     height of the affected text.  If it is positive, that means to&#xA;     display the characters raised.  If it is negative, that means to&#xA;     display them lower down.&#xA;&#xA;     If the text also has a `height' display specification, that does&#xA;     not affect the amount of raising or lowering, which is based on the&#xA;     faces used for the text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For AUCTeX specifically, this behavior is effected by &lt;code&gt;font-latex-script&lt;/code&gt; and controlled by &lt;code&gt;font-latex-script-display&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-04T00:36:49.320" LastActivityDate="2014-12-04T00:36:49.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4100" PostTypeId="1" AcceptedAnswerId="4117" CreationDate="2014-12-04T01:10:26.050" Score="6" ViewCount="431" Body="&lt;p&gt;In an &lt;a href=&quot;https://stackapps.com/q/3950/11299&quot;&gt;ongoing project&lt;/a&gt;, we are inserting multibyte text into a&#xA;buffer and experiencing strange behavior.  When the question is first&#xA;viewed, we receive something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Quote Environment à la Strunk\341\200\231s \342\200\230The Elements of Style\342\200\231&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which, obviously, should be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Quote Environment à la Strunk’s ‘The Elements of Style’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the special quotes; reference question &lt;a href=&quot;https://tex.stackexchange.com/q/211984/17423&quot;&gt;here&lt;/a&gt;.  Interestingly, using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-buffer-multibyte nil)&#xA;(set-buffer-multibyte t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in succession &lt;a href=&quot;https://github.com/vermiculus/sx.el/pull/125&quot; rel=&quot;nofollow noreferrer&quot;&gt;will fix the issue&lt;/a&gt;.  Note not one or the other, but &lt;em&gt;both&lt;/em&gt; in this order. What is going on here?  It's interesting to note that &lt;code&gt;à&lt;/code&gt; is &lt;a href=&quot;https://i.stack.imgur.com/9xQFj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;correctly displayed&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Shameless plug: that &lt;a href=&quot;https://stackapps.com/q/3950/11299&quot;&gt;ongoing project&lt;/a&gt; posted this question.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2014-12-04T14:15:44.453" Title="Why must I set and reset `buffer-multibyte` to correctly view multibyte buffers?" Tags="|buffers|character-encoding|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4101" PostTypeId="2" ParentId="4055" CreationDate="2014-12-04T03:42:26.553" Score="1" Body="&lt;p&gt;I also had this problem, then I updated it to latest bzr and the problem goes away. You can checkout the bzr version: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bzr checkout bzr://cedet.bzr.sourceforge.net/bzrroot/cedet/code/trunk cedet&#xA;cd cedet&#xA;make&#xA;cd contrib&#xA;make&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then load your Emacs with the new CEDET. You must load it at the very start of your &lt;code&gt;init.el&lt;/code&gt; otherwise once the built-in CEDET is loaded, you won't be able to load the bzr version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for those global modes, they are actually minor modes and you have to enable it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-mru-bookmark-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)&#xA;&#xA;(semantic-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-12-04T03:42:26.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4102" PostTypeId="1" AcceptedAnswerId="4127" CreationDate="2014-12-04T07:02:23.160" Score="7" ViewCount="463" Body="&lt;p&gt;I have an org-mode file with more than 12000 footnotes (maybe less), I was cleaning it and found that after the conversion some footnotes weren't converted to org-mode footnotes, so I had to manually make them footnotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, since that addition the reference number inside the square brackets must be re-done otherwise I will end with repeated numbers, like: &lt;code&gt;[12] ... [12]&lt;/code&gt; or &lt;code&gt;[10678] ... [10678]&lt;/code&gt;. Is there a way to build a regexp that look for all numbers inside square brackets and replace the text inside them with their respective coincidence number (?) for instance: &lt;code&gt;[12]&lt;/code&gt; is the coincidence number 10 and this other &lt;code&gt;[12]&lt;/code&gt; is coincidence number 11 so &lt;code&gt;[12] ... [12]&lt;/code&gt; becomes &lt;code&gt;[10] ... [11]&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;especial petition:&lt;/strong&gt; if you are going to post an elisp snippet that solves this problem, please, please, please, comment it on detail because I want to learn elisp too!&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-12-04T18:01:13.983" Title="Using the count of coincidence from a regexp as replacement text?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4103" PostTypeId="2" ParentId="4089" CreationDate="2014-12-04T08:22:09.430" Score="7" Body="&lt;p&gt;&lt;strong&gt;Warning: dirty work-around ahead&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you &quot;&lt;em&gt;greatly prefer [pdf-tools] to DocView&lt;/em&gt;&quot;, is it safe to assume that using it to view all pdfs is acceptable? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code snippet will switch the document to &lt;code&gt;pdf-view-mode&lt;/code&gt; anytime &lt;code&gt;doc-view&lt;/code&gt;is entered with a &lt;code&gt;pdf&lt;/code&gt; document.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar tv/prefer-pdf-tools (fboundp 'pdf-view-mode))&#xA;(defun tv/start-pdf-tools-if-pdf ()&#xA;  (when (and tv/prefer-pdf-tools&#xA;             (eq doc-view-doc-type 'pdf))&#xA;    (pdf-view-mode)))&#xA;&#xA;(add-hook 'doc-view-mode-hook 'tv/start-pdf-tools-if-pdf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The behavior can be enabled or disabled by &lt;code&gt;setq&lt;/code&gt;-ing the variable &lt;code&gt;tv/prefer-pdf-tools&lt;/code&gt; to t or nil.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2014-12-04T13:20:43.270" LastActivityDate="2014-12-04T13:20:43.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4104" PostTypeId="1" AcceptedAnswerId="4105" CreationDate="2014-12-04T08:31:15.573" Score="16" ViewCount="5619" Body="&lt;p&gt;I have defined the following TODO states in a org-mode file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SEQ_TODO: TODO(t) WAIT(w) | DONE(d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I have customized the colors for the TODO states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;Hide Org Todo Keyword Faces:&#xA;INS DEL Cons-cell:&#xA;            Keyword: TODO&#xA;            Face   : Value Menu Color: red&#xA;INS DEL Cons-cell:&#xA;            Keyword: WAIT&#xA;            Face   : Value Menu Color: orange&#xA;INS DEL Cons-cell:&#xA;            Keyword: DONE&#xA;            Face   : Value Menu Color: green&#xA;INS&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like to customize the colors of the TODO states at the same place, where I have defined them: in the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be done?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2014-12-05T22:59:57.450" Title="How to put TODO faces in the file?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4105" PostTypeId="2" ParentId="4104" CreationDate="2014-12-04T08:56:12.767" Score="19" Body="&lt;p&gt;You can add the following to the top of your &lt;code&gt;.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- org-todo-keyword-faces: ((&quot;TODO&quot; . &quot;red&quot;) (&quot;WAIT&quot; . &quot;orange&quot;) (&quot;DONE&quot; . &quot;green&quot;)); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;-*- ... -*-&lt;/code&gt; syntax is used to specify &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot;&gt;File-Local Variables&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-12-04T09:21:03.187" LastActivityDate="2014-12-04T09:21:03.187" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4106" PostTypeId="1" CreationDate="2014-12-04T09:29:56.960" Score="4" ViewCount="447" Body="&lt;p&gt;Org-Mode &lt;a href=&quot;http://orgmode.org/manual/Breaking-down-tasks.html&quot; rel=&quot;nofollow&quot;&gt;proposes&lt;/a&gt; to use the following &lt;code&gt;org-summary-todo&lt;/code&gt; function in the &lt;code&gt;org-after-todo-statistics-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-summary-todo (n-done n-not-done)&#xA;  &quot;Switch entry to DONE when all subentries are done, to TODO otherwise.&quot;&#xA;  (let (org-log-done org-log-states)   ; turn off logging&#xA;    (org-todo (if (= n-not-done 0) &quot;DONE&quot; &quot;TODO&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I have added a WAIT state to the TODO states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SEQ_TODO: TODO WAIT | DONE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;org-summary-todo&lt;/code&gt; will mark headlines as TODO although all sub tasks are in WAIT state, which is obviously wrong, because there is nothing to do.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Tasks [0/2]&#xA;** WAIT Bob&#xA;** WAIT Alice&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to extend the &lt;code&gt;org-summary-todo&lt;/code&gt; function in that way, that headlines are marked with WAIT instead of TODO, when all sub tasks are marked with WAIT?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it also possible to extend the brackets tag in that way that it distinguishes between all TODO states and not only done and not done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are mixed states I would prefer the following summary:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* WAIT All others [0/2/2]&#xA;** WAIT Bob&#xA;** WAIT Alice&#xA;* TODO Mixed [1/1/2]&#xA;** TODO My job&#xA;** WAIT Others job&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2014-12-04T09:29:56.960" Title="How to distinguish between TODO and WAIT in org-summary-todo?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4107" PostTypeId="1" CreationDate="2014-12-04T10:21:12.490" Score="2" ViewCount="1364" Body="&lt;p&gt;Just wanted to capture the advantages of CUA mode over the usual emacs copy and paste commands. One advantage which is quite obvious is it similar to the keybindings which are present in other editors. What would a more better explanation on using CUA mode in emacs.&lt;/p&gt;&#xA;" OwnerUserId="866" LastActivityDate="2014-12-04T12:31:07.440" Title="Is CUA Mode good over usual Emacs Cut and yank commands" Tags="|yank|kill-ring|undo|" AnswerCount="2" CommentCount="2" ClosedDate="2014-12-04T14:29:53.883" ContentLicense="CC BY-SA 3.0" />
  <row Id="4108" PostTypeId="1" AcceptedAnswerId="4115" CreationDate="2014-12-04T02:08:16.287" Score="16" ViewCount="5115" Body="&lt;p&gt;When I'm in &lt;code&gt;org-mode&lt;/code&gt;, I want Emacs to execute a bash script I wrote whenever I hit &lt;kbd&gt;C-x s&lt;/kbd&gt; to save.  The script automatically syncs the file I am saving to my Raspberry Pi. It expects the file name as argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I tell Emacs to run the external script on &lt;code&gt;org&lt;/code&gt; files when I save?&lt;/p&gt;&#xA;" OwnerUserId="3954" OwnerDisplayName="qacwnfq q" LastEditorUserId="253" LastEditDate="2014-12-04T14:47:51.380" LastActivityDate="2014-12-04T14:47:51.380" Title="Execute external script upon save when in a certain mode?" Tags="|hooks|saving|shell-command|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4109" PostTypeId="2" ParentId="4107" CreationDate="2014-12-04T10:32:51.410" Score="1" Body="&lt;p&gt;I suppose that I can give a silly answer to a silly question.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Is French language good over German?&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Well, French it's a bit better if you're French, but then German is&#xA;better for Germans.&#xA;Neither are my mother tongue, but I like both, French maybe more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same thing for CUA: it's familiar to you if you're a die-hard Windows&#xA;user, and therefore maybe better. But Emacs bindings are more familiar&#xA;if you're using bash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I'd never give up &lt;code&gt;scroll-up-command&lt;/code&gt; on &lt;kbd&gt;C-v&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-04T10:32:51.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4110" PostTypeId="1" CreationDate="2014-12-04T11:05:15.997" Score="3" ViewCount="306" Body="&lt;p&gt;I am getting this error &lt;code&gt;&quot;defconst: Symbol's value as variable is void: org-list-allow-alphabetical&quot;&lt;/code&gt; while starting org2blog. I see the issue is that the builtin org-mode which is installed with emacs is org mode version 7.9.3, while I installed the org2blog mode from mepla and it installed a newer org mode version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how I can use the newer installed version instead of the inbuild org-mode.&lt;/p&gt;&#xA;" OwnerUserId="866" LastEditorUserId="8430" LastEditDate="2016-01-11T22:33:17.533" LastActivityDate="2016-01-11T22:33:17.533" Title="How to use new version of a mode instead of the default built version?" Tags="|org-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4111" PostTypeId="2" ParentId="4084" CreationDate="2014-12-04T12:12:07.280" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://auto-complete.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;auto-complete&lt;/code&gt;&lt;/a&gt; offers contextual completion for values of CSS properties:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mXpEN.png&quot; alt=&quot;auto-complete in css-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default setup for &lt;code&gt;auto-complete&lt;/code&gt; (which will also enable completion in &lt;code&gt;css-mode&lt;/code&gt; buffers) is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to enable &lt;code&gt;auto-complete&lt;/code&gt; for &lt;code&gt;css-mode&lt;/code&gt; buffers &lt;em&gt;only&lt;/em&gt;, add the following to your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'auto-complete-config)&#xA;&#xA;(defun css-setup-ac ()&#xA;  (setq ac-sources '(ac-source-dictionary ac-source-words-in-same-mode-buffers))&#xA;  (ac-css-mode-setup)&#xA;  (auto-complete-mode 1))&#xA;&#xA;(add-hook 'css-mode-hook #'css-setup-ac)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know of any existing modes that &lt;em&gt;restrict&lt;/em&gt; property values to valid values.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-07T00:15:18.380" LastActivityDate="2015-01-07T00:15:18.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4112" PostTypeId="1" CreationDate="2014-12-04T12:15:15.403" Score="2" ViewCount="553" Body="&lt;p&gt;On this site i found a very nice snippet of code to center a textblock of fixed width in my frame &lt;a href=&quot;https://stackoverflow.com/a/23731757/4310112&quot;&gt;https://stackoverflow.com/a/23731757/4310112&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is that whenever the window size is change, the margins of the window are adjusted in a way that the text block keeps a pre defined fixed size. (The code is below.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it does not exactly what i expected. When i resize the window the text width changes as well. The will be some margins but not of the size intended. If i switch to another buffer and back the margins change to the correct size. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something similar happens when i execute some command, for example &lt;code&gt;C-c C-c&lt;/code&gt; in AucTex or just &lt;code&gt;M-x C-g&lt;/code&gt;. Then all margins vanish and the text occupies the whole frame width. Again, switching buffers will restore the intended frame width.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;Add left and right margins, when file is markdown or text.&#xA;(defun center-window (window) &quot;&quot;&#xA;  (let* ((current-extension (file-name-extension (or (buffer-file-name) &quot;foo.unknown&quot;)))&#xA;         (max-text-width 80)&#xA;         (margin (max 0 (/ (- (window-width window) max-text-width) 2))))&#xA;    (if (and (not (string= current-extension &quot;md&quot;))&#xA;             (not (string= current-extension &quot;tex&quot;)))&#xA;        ;; Do nothing if this isn't an .md or .tex file.&#xA;        ()&#xA;  (set-window-margins window margin margin))))&#xA;&#xA;;; Adjust margins of all windows.&#xA;(defun center-windows () &quot;&quot;&#xA;  (walk-windows (lambda (window) (center-window window)) nil 1))&#xA;&#xA;;; Listen to window changes.&#xA;(add-hook 'window-configuration-change-hook 'center-windows)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2789" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-02-26T14:29:08.763" Title="Centering text in emacs window is unresponsive" Tags="|window|frames|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4113" PostTypeId="2" ParentId="4107" CreationDate="2014-12-04T12:31:07.440" Score="1" Body="&lt;p&gt;The answers to this question will be highly subjective. The following is obviously my own opinion, and different opinions are certainly possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason the CUA commands are desirable is because of familiarity, not because there is some inherent superiority of &lt;code&gt;C-x&lt;/code&gt; over &lt;code&gt;C-w&lt;/code&gt; (etc.). Muscle memory is important for editor interaction, and if you are very used to the standard keys, cua-mode might make life easier for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, cua-mode, even in its limited form with the keys only working with an active region, interferes with a number of Emacs commands. For example, rectangle commands (&lt;code&gt;C-x r&lt;/code&gt;) will not be available anymore without deactivating the region first, same as &lt;code&gt;narrow-to-region&lt;/code&gt; (&lt;code&gt;C-x n n&lt;/code&gt;), and a few other commands, in addition to whatever commands your current mode includes under the &lt;code&gt;C-c&lt;/code&gt; prefix that act special for an active region (e.g. Elpy will send the current region to a subprocess on &lt;code&gt;C-c C-c&lt;/code&gt; if one is active).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is a question of very personal advantages and disadvantages. The main reason for using cua-mode is familiarity with the standard bindings. This is useful for people who are new to or rarely use Emacs, but I do not think that learning the slightly different bindings is particularly problematic. On the other hand, if you intend to use Emacs a lot, cua-mode will more often than not stand in your way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In general, I would &lt;em&gt;love&lt;/em&gt; if Emacs would use the standard bindings. But I do not hold any delusions about the feasibility of that happening. Emacs predates those bindings, and the assumptions about key bindings are deeply ingrained in Emacs and the extensions. For example, almost every mode assumes that mode maps are on &lt;code&gt;C-c&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2014-12-04T12:31:07.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4114" PostTypeId="2" ParentId="4084" CreationDate="2014-12-04T13:09:36.750" Score="9" Body="&lt;p&gt;&lt;a href=&quot;http://company-mode.github.io/&quot;&gt;company-mode&lt;/a&gt; provides slightly better results than &lt;code&gt;auto-complete&lt;/code&gt; using the bundled &lt;code&gt;company-css&lt;/code&gt; backend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get completion of property names (up-to-date with the current state of CSS3, AFAIK), and &lt;em&gt;some&lt;/em&gt; completion of property values, where they are simple, like a fixed set of options.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2014-12-04T13:09:36.750" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4115" PostTypeId="2" ParentId="4108" CreationDate="2014-12-04T13:24:16.310" Score="20" Body="&lt;p&gt;Here's a simple setup that you can modify that allows you to sync &lt;code&gt;org&lt;/code&gt; files to your Raspberry Pi, based on your bash script (untested, of course, because I have neither a Pi nor your script).  Modify the function with your script name.  It uses &lt;code&gt;shell-command-to-string&lt;/code&gt; to put the command line output somewhere; you could also just use &lt;code&gt;shell-command&lt;/code&gt; if that's not a concern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then add it to &lt;code&gt;after-save-hook&lt;/code&gt;, as @IqbalAnsari's comment suggested.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sync-to-pi ()&#xA;  &quot;Sync org file to Raspberry Pi with external script.&quot;&#xA;  (when (eq major-mode 'org-mode)&#xA;    (shell-command-to-string (format &quot;your-script-name %s&quot; buffer-file-name))))&#xA;&#xA;(add-hook 'after-save-hook #'sync-to-pi)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-04T13:24:16.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4116" PostTypeId="2" ParentId="2510" CreationDate="2014-12-04T13:39:18.833" Score="6" Body="&lt;p&gt;When you modify the buffer, only the lines you modified get re-highlighted right away.  If the modification affects highlighting of lines futher down, these get re-highlighted later via an idle timer (i.e. it happens after you stop typing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This delay is controlled by &lt;code&gt;jit-lock-context-time&lt;/code&gt; and defaults to 0.5s.  Note that it really means &quot;Emacs has been idle for half a second&quot;, so as long as you keep giving Emacs commands without leaving more than half a second between commands, the re-highlighting does not happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think it takes more than 0.5s and can come up with a recipe that triggers this excessive delay, then you'll want to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-05-12T01:41:29.770" LastActivityDate="2015-05-12T01:41:29.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4117" PostTypeId="2" ParentId="4100" CreationDate="2014-12-04T14:15:44.453" Score="5" Body="&lt;p&gt;IIUC the problem is that the string you insert is undecoded, i.e. it's a string of &lt;em&gt;bytes&lt;/em&gt; you received over the network.  So you need to find out what character encoding is used/assumed by the sender (typically utf-8 these days), then call &lt;code&gt;decode-coding-string&lt;/code&gt; with this encoding, and then insert the string it returns (which will be a string of &lt;em&gt;characters&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, maybe this is not The Right Solution: if your string arrives over the network via HTTP, it may very well be that the encoding is actually provided by the server in the response headers, so that the URL package should do the decoding for you.  In that case, maybe you're hitting a bug (or a lack of functionality) in the URL package.  To figure that out, we'd need to see the header of the HTTP response, the way you can the URL package and the answer you get.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-04T14:15:44.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4118" PostTypeId="2" ParentId="4089" CreationDate="2014-12-04T14:24:04.947" Score="3" Body="&lt;p&gt;You can use an advise around &lt;code&gt;eww-display-pdf&lt;/code&gt; to override the definition of &lt;code&gt;doc-view-mode&lt;/code&gt; temporarily.  With the new &lt;code&gt;nadvice&lt;/code&gt; library this is as easy as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'eww-display-pdf&#xA;            :around (lambda (orig &amp;amp;rest args)&#xA;                      (cl-letf (((symbol-function 'doc-view-mode) #'pdf-view-mode))&#xA;                        (apply orig args)))&#xA;            '((name . eww-display-pdf-tools)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To revert back to the original &lt;code&gt;doc-view-mode&lt;/code&gt;, use &lt;code&gt;(advice-remove 'eww-display-pdf 'eww-display-pdf-tools)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have opened &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19270&quot; rel=&quot;nofollow&quot;&gt;Emacs bug 19270&lt;/a&gt; to make the EWW PDF Mode customizable.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-04T14:24:04.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4119" PostTypeId="1" AcceptedAnswerId="4120" CreationDate="2014-12-04T15:12:48.170" Score="1" ViewCount="79" Body="&lt;p&gt;Having previously set &lt;code&gt;emacs-user-directory&lt;/code&gt; thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-emacs-directory &quot;~/Dropbox/emacs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would now want to set &lt;code&gt;desktop-path&lt;/code&gt; and &lt;code&gt;desktop-dirname&lt;/code&gt; in this manner:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA;  desktop-path user-emacs-directory&#xA;  desktop-dirname user-emacs-directory&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I start Emacs and it runs that code (by loading the &lt;code&gt;desktop&lt;/code&gt; package) I get this error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: listp, &quot;~/Dropbox/emacs_x&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2014-12-04T15:21:58.130" Title="Problem assigning variables" Tags="|elisp|variables|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4120" PostTypeId="2" ParentId="4119" CreationDate="2014-12-04T15:15:58.527" Score="2" Body="&lt;p&gt;Try it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq desktop-path `(,user-emacs-directory &quot;~&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  List of directories to search for the desktop file.&#xA;  The base name of the file is specified in `desktop-base-file-name'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2014-12-04T15:21:58.130" LastActivityDate="2014-12-04T15:21:58.130" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4121" PostTypeId="1" AcceptedAnswerId="4122" CreationDate="2014-12-04T15:21:10.453" Score="4" ViewCount="542" Body="&lt;p&gt;I'm attempting to get the name of the character (or multibyte character) at point, and just the name, programmatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;describe-char&lt;/code&gt; tells me what the character's name is, along with a bunch of other stuff that I don't want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;get-char-property&lt;/code&gt; appears to be what I want, except that I tell what property I want. Neither &lt;code&gt;'name&lt;/code&gt;, &lt;code&gt;'Name&lt;/code&gt;, &lt;code&gt;&quot;Name&quot;&lt;/code&gt;, or &lt;code&gt;&quot;name&quot;&lt;/code&gt; seem to do anything (when used as e.g. &lt;code&gt;(get-char-property ?&amp;amp; 'name)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="503" LastEditorUserId="105" LastEditDate="2015-07-11T04:56:17.270" LastActivityDate="2015-07-11T04:56:17.270" Title="How can I programmatically get the canonical unicode name of a character?" Tags="|elisp|characters|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4122" PostTypeId="2" ParentId="4121" CreationDate="2014-12-04T15:23:35.513" Score="7" Body="&lt;p&gt;From digging around in the source code for &lt;code&gt;describe-char&lt;/code&gt;, &lt;code&gt;get-char-code-property&lt;/code&gt; seems to be the right function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-char-code-property ?&amp;amp; 'name)&#xA;&quot;AMPERSAND&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-12-04T15:23:35.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4123" PostTypeId="2" ParentId="4110" CreationDate="2014-12-04T16:04:11.580" Score="-1" Body="&lt;p&gt;I believe that you can add the following at the end of your init file to ensure that the latest version of &lt;code&gt;org-mode&lt;/code&gt; is loaded.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc #'require '(org-version org))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="943" LastActivityDate="2014-12-04T16:04:11.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4124" PostTypeId="1" AcceptedAnswerId="4154" CreationDate="2014-12-04T16:51:49.753" Score="9" ViewCount="1211" Body="&lt;p&gt;Such as in the built-in variable &lt;code&gt;mode-line-modified&lt;/code&gt; which displays an asterisk in the mode line if the buffer is modified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I want to turn &lt;code&gt;hl-line-mode&lt;/code&gt; off when the buffer is modified and on when it's not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read the documentation about &quot;Change Hooks&quot;, but I want &lt;code&gt;hl-line-mode&lt;/code&gt; to toggle when I undo a change like the mode line asterisk.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="25" LastEditDate="2014-12-25T00:38:13.653" LastActivityDate="2014-12-25T00:38:13.653" Title="How to hook into buffer modified state?" Tags="|hooks|buffer-modified|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4125" PostTypeId="1" AcceptedAnswerId="4126" CreationDate="2014-12-04T17:08:05.390" Score="7" ViewCount="266" Body="&lt;p&gt;&lt;code&gt;this-command-keys&lt;/code&gt; and &lt;code&gt;this-command-keys-vector&lt;/code&gt; return the entire key sequence that fired the current command.  However, such sequence will contain any prefix argument, too.  Is there a function or variable - let's call it &lt;code&gt;this-command-key-binding&lt;/code&gt; - to get just the key sequence for the command, without any prefix, so that &lt;code&gt;(key-binding (this-command-binding))&lt;/code&gt; returns the same value as &lt;code&gt;this-command&lt;/code&gt;, even in the presence of a prefix argument?&lt;/p&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="25" LastEditDate="2014-12-25T00:21:59.247" LastActivityDate="2014-12-25T00:21:59.247" Title="Getting the key binding for the current command" Tags="|key-bindings|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4126" PostTypeId="2" ParentId="4125" CreationDate="2014-12-04T17:42:12.440" Score="11" Body="&lt;p&gt;I think you're looking for &lt;code&gt;this-single-command-keys&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-04T17:42:12.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4127" PostTypeId="2" ParentId="4102" CreationDate="2014-12-04T18:01:13.983" Score="9" Body="&lt;p&gt;To re-number &lt;strong&gt;all&lt;/strong&gt; footnotes starting from 1 you can use &lt;code&gt;M-x query-replace-regexp&lt;/code&gt; (or, if you're feeling confident, just &lt;code&gt;M-x replace-regexp&lt;/code&gt;) and type in&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\[[0-9]+\]&lt;/code&gt; as the regexp to replace and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[\,(1+ \#)]&lt;/code&gt; as the replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here &lt;code&gt;\#&lt;/code&gt; is the match count &lt;em&gt;starting from zero&lt;/em&gt;, so I used &lt;code&gt;\,&lt;/code&gt; and a lisp form which adds one to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get (most of) this information, press &lt;code&gt;C-h f replace-regexp&lt;/code&gt; and hit &lt;code&gt;RETURN&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-04T18:01:13.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4128" PostTypeId="2" ParentId="4034" CreationDate="2014-12-04T19:04:09.403" Score="3" Body="&lt;p&gt;Assuming rspec:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install &lt;code&gt;rspec-mode&lt;/code&gt;, which will activate itself automatically in &lt;code&gt;ruby-mode&lt;/code&gt; or &lt;code&gt;enh-ruby-mode&lt;/code&gt; then you can use &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;kbd&gt;s&lt;/kbd&gt; to run &lt;code&gt;rspec-verify-single&lt;/code&gt; which will run the test at point.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-12-04T19:04:09.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4129" PostTypeId="1" AcceptedAnswerId="4156" CreationDate="2014-12-04T19:17:48.140" Score="4" ViewCount="713" Body="&lt;p&gt;I use &lt;code&gt;ido&lt;/code&gt; for switching buffers, and it is awesome. I also have &lt;code&gt;(flx-ido mode t)&lt;/code&gt; in &lt;a href=&quot;https://github.com/501st-alpha1/emacs/blob/master/init.el#L457&quot; rel=&quot;nofollow&quot;&gt;my init file&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have run into a problem that causes me to switch to a buffer different from what I was expecting. I will explain with an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have two buffers, &lt;code&gt;EmacsBuffer&lt;/code&gt;, and &lt;code&gt;EightyMegabytesAndConstantlySwapping&lt;/code&gt;. I switch to a different buffer, e.g. &lt;code&gt;*scratch*&lt;/code&gt;, and now I want to get back to &lt;code&gt;EmacsBuffer&lt;/code&gt;, so I do &lt;code&gt;C-x b&lt;/code&gt; and start typing: &lt;code&gt;e m a c&lt;/code&gt;... This is what I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Buffer: emac[sBuffer]{EightyMegabytesAndConstantlySwapping}&#xA;EmacsBuffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the candidate for tab-completion is &lt;code&gt;EmacsBuffer&lt;/code&gt;, as I would expect. However, because I have &lt;code&gt;flex&lt;/code&gt; enabled, the other buffer is fuzzy-matched, and so it is the candidate to immediately switch to. Since I usually am looking only at what I am typing, I see that &lt;code&gt;EmacsBuffer&lt;/code&gt; is the candidate for tab-completion, so I immediately hit &lt;code&gt;RET&lt;/code&gt;, and am surprised when it switches to &lt;code&gt;EightyMegabytesAndConstantlySwapping&lt;/code&gt;. How do I change this so that the immediate-switch buffer is the same as the tab-completion buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could just disable &lt;code&gt;flex&lt;/code&gt;, but I do find it useful, because e.g. if I don't have a buffer named &lt;code&gt;EmacsBuffer&lt;/code&gt;, I like that &lt;code&gt;e m a c s&lt;/code&gt; matches &lt;code&gt;EightyMegabytesAndConstantlySwapping&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="675" LastActivityDate="2014-12-05T22:50:34.573" Title="How do I make ido switch to the buffer suggested by the tab-completion candidate?" Tags="|buffers|ido|flx-ido|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4130" PostTypeId="1" AcceptedAnswerId="4186" CreationDate="2014-12-04T21:25:50.153" Score="0" ViewCount="403" Body="&lt;p&gt;I just started using &lt;code&gt;ido-mode&lt;/code&gt; and can't seem to get it to give a buffer list on switch-buffer. It works fine for visit file (&lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;C-f&lt;/code&gt;) and kill buffer (&lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;k&lt;/code&gt;), but not on &lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;b&lt;/code&gt;, which is a much more common event. I've just updated to Emacs 24.4.1 (i686-pc-mingw32), but that didn't solve the problem.&lt;/p&gt;&#xA;" OwnerUserId="2791" LastEditorUserId="45" LastEditDate="2014-12-04T21:36:09.100" LastActivityDate="2014-12-07T02:46:03.827" Title="ido mode not previewing buffers names on switch buffer C-x b" Tags="|ido|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4131" PostTypeId="1" CreationDate="2014-12-04T22:30:38.973" Score="4" ViewCount="1257" Body="&lt;p&gt;When I try to start a Python shell in Emacs 24.4.1 running on Windows, I get an error &quot;invalid argument&quot; when Emacs tries to spawn the process. This is occurring because Python is installed under &lt;code&gt;c:\Program Files (x86)&lt;/code&gt;, which of course has those nasty embedded spaces. When I try to run Python from Emacs, it gets the path right in the prompt, but then the call fails because the spaces cause the command to look like there are multiple arguments. I can manually add quotes around the path in the mini-buffer prompt, but that's obviously not a solution. Oddly enough, Emacs 23.2.1 on the same machine has no problem with invoking Python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd prefer not to change the location of Python if I don't have to. &lt;/p&gt;&#xA;" OwnerUserId="2791" LastEditorUserId="25" LastEditDate="2014-12-10T20:10:22.467" LastActivityDate="2015-01-12T11:26:12.103" Title="Can't run Python shell in Emacs 24.4 due to a space in the path" Tags="|python|emacs24.4|shell-command|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4132" PostTypeId="1" AcceptedAnswerId="4136" CreationDate="2014-12-04T22:35:06.560" Score="2" ViewCount="235" Body="&lt;p&gt;I have the following line of code in my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-&amp;lt;tab&amp;gt;&quot;) 'next-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This key-binding allows me to &lt;code&gt;C-&amp;lt;tab&amp;gt;&lt;/code&gt; my way around Emacs. However, because of certain buffers that I have open by default this becomes very tedious. So I would like a function that switches to the next buffer unless the next buffer is a certain file/buffer. More specifically the following buffers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;*GNU Emacs*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;*scratch*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;*Messages*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;.emacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Just because I want to skip them when I call &lt;code&gt;next-buffer&lt;/code&gt; does not mean that I want to kill that buffer. I rather just get to it by pressing &lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;b&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2015-03-27T20:41:13.450" LastActivityDate="2015-03-27T20:41:13.450" Title="Switch to next buffer under certain circumstances" Tags="|buffers|cycling|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4133" PostTypeId="2" ParentId="4132" CreationDate="2014-12-04T22:43:56.160" Score="1" Body="&lt;p&gt;Here are some functions to cycle through user's buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xah-next-user-buffer ()&#xA;  &quot;Switch to the next user buffer.&#xA; (buffer name does not start with “*”.)&quot;&#xA;  (interactive)&#xA;  (next-buffer)&#xA;  (let ((i 0))&#xA;    (while (and (string-equal &quot;*&quot; (substring (buffer-name) 0 1)) (&amp;lt; i 20))&#xA;      (setq i (1+ i)) (next-buffer))))&#xA;&#xA;(defun xah-previous-user-buffer ()&#xA;  &quot;Switch to the previous user buffer.&#xA; (buffer name does not start with “*”.)&quot;&#xA;  (interactive)&#xA;  (previous-buffer)&#xA;  (let ((i 0))&#xA;    (while (and (string-equal &quot;*&quot; (substring (buffer-name) 0 1)) (&amp;lt; i 20))&#xA;      (setq i (1+ i)) (previous-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here are some functions to cycle through Emacs buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xah-next-emacs-buffer ()&#xA;  &quot;Switch to the next emacs buffer.&#xA; (buffer name that starts with “*”)&quot;&#xA;  (interactive)&#xA;  (next-buffer)&#xA;  (let ((i 0))&#xA;    (while (and (not (string-equal &quot;*&quot; (substring (buffer-name) 0 1))) (&amp;lt; i 20))&#xA;      (setq i (1+ i)) (next-buffer))))&#xA;&#xA;(defun xah-previous-emacs-buffer ()&#xA;  &quot;Switch to the previous emacs buffer.&#xA; (buffer name that starts with “*”)&quot;&#xA;  (interactive)&#xA;  (previous-buffer)&#xA;  (let ((i 0))&#xA;    (while (and (not (string-equal &quot;*&quot; (substring (buffer-name) 0 1))) (&amp;lt; i 20))&#xA;      (setq i (1+ i)) (previous-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The next step will be to set some custom shortcuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_next_prev_user_buffer.html&quot; rel=&quot;nofollow&quot;&gt;ErgoEmacs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="45" LastEditDate="2014-12-04T22:52:04.160" LastActivityDate="2014-12-04T22:52:04.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4134" PostTypeId="1" CreationDate="2014-12-04T22:54:25.770" Score="6" ViewCount="299" Body="&lt;p&gt;I'd like to set up a schedule for an habit such that the task has to be performed three days in a row and then skipped the fourth day. So, assuming the first recorded day is monday, I'll have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Mon ✓ &#xA;Tue ✓ &#xA;Wed ✓ &#xA;Thu x&#xA;Fri ✓ &#xA;Sat ✓ &#xA;Sun ✓ &#xA;Mon x&#xA;etc. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to set such a repeating schedule using the &lt;code&gt;.+&lt;/code&gt; syntax?&lt;/p&gt;&#xA;" OwnerUserId="2737" LastEditorUserId="253" LastEditDate="2014-12-05T01:09:24.273" LastActivityDate="2014-12-05T19:17:20.290" Title="Three days ON one day OFF schedule in org-mode?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4135" PostTypeId="2" ParentId="4130" CreationDate="2014-12-04T22:59:21.820" Score="4" Body="&lt;p&gt;To activate ido mode, put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; make buffer switch command auto suggestions, also for find-file command&#xA;(ido-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, &lt;code&gt;C-x b&lt;/code&gt; will call the ido version of switch buffer function, and you can press tab key for completion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting this in your init file, may be interesting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; make ido display choices vertically&#xA;(setq ido-separator &quot;\n&quot;)&#xA;&#xA;;; display any item that contains the chars you typed&#xA;(setq ido-enable-flex-matching t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the setup above, everything should work as expected. If the &lt;code&gt;TAB&lt;/code&gt; key is not working as expected, try with the &lt;code&gt;SPC&lt;/code&gt; key to check. Not sure, but you may have a minor mode active with a keymap overriding some keybinding of ido. &lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-12-05T03:01:40.707" LastActivityDate="2014-12-05T03:01:40.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4136" PostTypeId="2" ParentId="4132" CreationDate="2014-12-04T23:35:36.997" Score="3" Body="&lt;p&gt;The &quot;abort after twenty attempts&quot; code in the ErgoEmacs functions -- presumably to avoid loops -- is kinda ugly and arbitrary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm inclined to suggest using my answer from &lt;a href=&quot;https://stackoverflow.com/a/24840977/324105&quot;&gt;Make emacs next-buffer skip *Messages* buffer&lt;/a&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-12-04T23:46:42.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4137" PostTypeId="1" CreationDate="2014-12-05T03:50:34.703" Score="0" ViewCount="470" Body="&lt;p&gt;I'm trying to edit a code snippet in org-mode. When I type &lt;code&gt;C-c '&lt;/code&gt; in org mode buffer, it opens up the editor window in R-mode, but it doesn't know about C-c ' and cannot be killed by &lt;code&gt;C-x k&lt;/code&gt; since when I execute that command I get a message in the message buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wrong type argument: overlayp, nil&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there a way to force kill a buffer? Right now I'm restarting Emacs. Is there a faster way? Why is this doing in the first place?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The elisp debugger gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument overlayp nil)&#xA;  delete-overlay(nil)&#xA;  #[nil &quot;\301!\207&quot; [org-edit-src-overlay delete-overlay] 2]()&#xA;  kill-buffer(&quot;*Org Src notes.org&amp;lt;lec&amp;gt;[ R ]*&quot;)&#xA;  call-interactively(kill-buffer nil nil)&#xA;  command-execute(kill-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I try to use &lt;code&gt;org-edit-src-exit&lt;/code&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-edit-src-exit: This is not a sub-editing buffer, something is wrong&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-09-25T17:29:23.297" Title="*Org Src file.org[ R ]*: C-c ' is undefined" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4138" PostTypeId="1" AcceptedAnswerId="9791" CreationDate="2014-12-05T05:17:49.953" Score="6" ViewCount="2239" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How do I use feedly.com as an RSS feed source in Emacs 24.4?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched sporadically for months. I haven't found anything to even point me in the right direction to get started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've opened a ticket with Feedly as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While not required for the question at hand, if you're interested please see my &lt;a href=&quot;http://www.thinknix.net/2014/12/05/how-do-i-use-feedly-com-as-an-rss-feed-source-in-emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog post&lt;/a&gt;. It provides additional information as well as my end game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2015-02-17&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I updated the title according to the suggestion in the comments. My intent is for Emacs to fill the role Reeder and Readkit perform on OS X as well as on Gnu/Linux and MS Windows, where no analog resides.&lt;/p&gt;&#xA;" OwnerUserId="2794" LastEditorDisplayName="user8748" LastEditDate="2019-01-26T17:54:55.193" LastActivityDate="2019-01-26T17:54:55.193" Title="How do I use Emacs as a feedly.com client?" Tags="|xml|web|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="4139" PostTypeId="1" AcceptedAnswerId="4144" CreationDate="2014-12-05T09:47:14.970" Score="4" ViewCount="303" Body="&lt;p&gt;I recently found yascroll and have added it to my .emacs to enable it permanently. Specifically, I added this line (as described here: &lt;a href=&quot;https://github.com/m2ym/yascroll-el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/m2ym/yascroll-el&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-yascroll-bar-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When Emacs starts, evaluation of my .emacs halts with this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: global-yascroll-bar-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Strangely, though, everything works if I open .emacs and run M-x eval-buffer, which I thought was in essence the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can also enable yascroll by simply running M-x global-yascroll-bar-mode. The problem only appears when Emacs is starting. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2797" LastActivityDate="2014-12-05T11:37:37.777" Title="Mode not enabled when Emacs starts, but working fine after M-x eval-buffer on .emacs" Tags="|init-file|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4140" PostTypeId="2" ParentId="4139" CreationDate="2014-12-05T10:05:14.003" Score="1" Body="&lt;p&gt;I solved it by running M-x customize-group RET yascroll RET and changing the &lt;em&gt;Global-Yascroll-Bar-Mode&lt;/em&gt; setting to &quot;on&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(global-yascroll-bar-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my custom-set-variables section in .emacs (the value does not have to be t, it can also be 1). That works. I'm still not sure why I can't enable the mode the other way.&lt;/p&gt;&#xA;" OwnerUserId="2797" LastActivityDate="2014-12-05T10:05:14.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4142" PostTypeId="1" CreationDate="2014-12-05T10:33:55.370" Score="3" ViewCount="261" Body="&lt;p&gt;I tried to customize Wanderlust's summary buffer by changing &lt;code&gt;wl-summary-line-format&lt;/code&gt;. I would like to see the age of a message in the summary buffer. But I can not find any abbreviation for the age of a message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Gnus it was possible to define a &lt;code&gt;gnus-user-format-function-x&lt;/code&gt;, which could be referenced in the &lt;code&gt;gnus-summary-line-format&lt;/code&gt;. But I can not find anything similar in Wanderlust.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to show the age of a message in the summary buffer?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="25" LastEditDate="2014-12-07T18:01:44.920" LastActivityDate="2014-12-09T19:49:59.830" Title="How to show the message age in Wanderlust's summary buffer?" Tags="|email|wanderlust|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4143" PostTypeId="2" ParentId="4134" CreationDate="2014-12-05T11:15:45.187" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/tiny&quot; rel=&quot;nofollow noreferrer&quot;&gt;tiny&lt;/a&gt; can do this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kzJLM.gif&quot; alt=&quot;tiny-schedule.gif&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the thing to expand:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m\n10|** TODO Habit \nSCHEDULED: &amp;lt;%(date &quot;Mon&quot; (do31 x))&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the yasnippet to produce something close to the above snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: todo_schedule&#xA;# key: ts&#xA;# --&#xA;m\n${1:4}|`(make-string (org-current-level) ?*)` TODO $2 %(+ x 1)\nSCHEDULED: &amp;lt;%(date &quot;${3:today}&quot; (* x 7))&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the code of &lt;code&gt;do31&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun do31 (x)&#xA;  (+ x (/ x 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can do some variations as well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m\n20|** TODO Habit \nSCHEDULED: &amp;lt;%(date &quot;Mon&quot; (do31 x))&amp;gt;&#xA;m\n20|** TODO Habit %(+ x 1)\nSCHEDULED: &amp;lt;%(date &quot;Mon&quot; (do31 x))&amp;gt;&#xA;m\n20|** TODO Habit %(+ x 1)\nSCHEDULED: &amp;lt;%(date &quot;Mon 10:00&quot; (do31 x))&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-05T11:15:45.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4144" PostTypeId="2" ParentId="4139" CreationDate="2014-12-05T11:37:37.777" Score="8" Body="&lt;p&gt;It looks like your forgot to &lt;a href=&quot;https://emacs.stackexchange.com/a/2653/227&quot;&gt;call &lt;code&gt;package-initialize&lt;/code&gt;&lt;/a&gt; in your init file before enabling &lt;code&gt;global-yascroll-bar-mode&lt;/code&gt;.  Add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;&#xA;(global-yascroll-bar-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the argument to &lt;code&gt;global-yascroll-bar-mode&lt;/code&gt; is redundant:  A mode is always enabled if it's function is called from Emacs Lisp.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-12-05T11:37:37.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4145" PostTypeId="1" CreationDate="2014-12-05T11:40:57.593" Score="1" ViewCount="244" Body="&lt;p&gt;(Manually moved by copy/pasting from &lt;a href=&quot;https://unix.stackexchange.com/q/171644/50557&quot;&gt;this Unix SE deleted question&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm debugging my &lt;a href=&quot;https://github.com/bstarynk/melt-monitor&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELT monitor&lt;/a&gt;, in relation with &lt;a href=&quot;http://gcc-melt.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELT&lt;/a&gt; (a domain specific language &amp;amp; meta-plugin to extend &amp;amp; customize the &lt;a href=&quot;http://gcc.gnu.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GCC&lt;/a&gt; compiler).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;emacs24&lt;/code&gt; (24.4.1) on Debian/Sid/x86-64 with its &lt;code&gt;gdb-mode&lt;/code&gt;; most often, I am typing &lt;code&gt;gdb&lt;/code&gt; commands in the &lt;code&gt;*gud-monimelt*&lt;/code&gt; emacs &quot;window&quot; (inside an emacs frame which is a toplevel window for my LXDE window manager).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't get rid of an annoying behavior; after every successfully typed &lt;code&gt;gdb&lt;/code&gt; command (e.g. &lt;code&gt;bt&lt;/code&gt;, or &lt;code&gt;print&lt;/code&gt; ...) , the &lt;code&gt;*gud-monimelt*&lt;/code&gt; emacs &quot;window&quot; is undisplayed or deleted (as if I typed &lt;kbd&gt;Ctrl-X 0&lt;/kbd&gt;) and I have to type again &lt;kbd&gt;Ctrl-X b&lt;/kbd&gt; &lt;code&gt;*gud&lt;/code&gt; &lt;kbd&gt;Tab&lt;/kbd&gt; to get it back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, &lt;code&gt;gdb&lt;/code&gt; is version 7.7.1 (but with a GDB 7.8 from Debian/Experimental the same is happenning).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm getting the same annoyance on every computer I'm using (and also on emacs-trunk &lt;code&gt;25.0.50.6&lt;/code&gt; compiled daily from the latest emacs &lt;code&gt;.git&lt;/code&gt;). My &lt;code&gt;.emacs&lt;/code&gt; is quite small and has no occurrence of &lt;code&gt;gud&lt;/code&gt; or of &lt;code&gt;gdb&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know any setting to remove this automatic undisplay? I have several emacs frames and several emacs &quot;windows&quot; within my &lt;code&gt;emacs&lt;/code&gt; session, and I don't want GUD to close automagically any emacs windows.&lt;/p&gt;&#xA;" OwnerUserId="2798" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2014-12-05T12:27:34.237" Title="emacs gdb *gud* &quot;window&quot; undisplayed/deleted after command" Tags="|window|gud|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4146" PostTypeId="1" AcceptedAnswerId="4149" CreationDate="2014-12-05T13:12:45.373" Score="7" ViewCount="453" Body="&lt;p&gt;I am maintaining a mode for a programming language with... let's say&#xA;&quot;annoying&quot; syntax constructs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the angle brackets (no idea if it is the correct word)&#xA;&lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; are parentheses. However, the word &lt;code&gt;-&amp;gt;&lt;/code&gt; is also a valid&#xA;token, does not count as a closing parenthesis, and to top it all,&#xA;should only occur &lt;em&gt;inside&lt;/em&gt; a pair of &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand correctly, there is no way to get emacs to recognise&#xA;this using only syntax tables, is that correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the question: the mode is using &lt;code&gt;smie&lt;/code&gt; for what cannot be done&#xA;with syntax tables, and &lt;a href=&quot;https://stackoverflow.com/q/10633301/1083706&quot;&gt;smie is also the&#xA;canonical answer to define multi-character parens&lt;/a&gt;. So I guess that I will have to get smie to replace the syntax table for this pair of parentheses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: &lt;em&gt;what does need to be set up in smie, in order to&#xA;replace syntax table features for a particular paren pair?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is motivated by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE-Lexer.html#SMIE-Lexer&quot; rel=&quot;nofollow noreferrer&quot;&gt;the manual&lt;/a&gt;: it is advised to let syntax tables do their job whenever&#xA;possible. Hence, I'm afraid that with a naive set-up, I will run into&#xA;problems later, or worse, that it will cause problems behind the&#xA;scenes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I can think of (aka the &quot;naive set-up&quot; mentioned above):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;removing the paren category for characters &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; in the&#xA;syntax table;&lt;/li&gt;&#xA;&lt;li&gt;adding &lt;code&gt;(&quot;&amp;lt;&quot; whatever &quot;&amp;gt;&quot;)&lt;/code&gt; in the BNF grammar;&lt;/li&gt;&#xA;&lt;li&gt;making the lexer recognize the token &lt;code&gt;&amp;lt;&lt;/code&gt; (resp &lt;code&gt;&amp;gt;&lt;/code&gt;) as &lt;code&gt;&quot;&amp;lt;&quot;&lt;/code&gt;&#xA;(resp. &lt;code&gt;&quot;&amp;gt;&quot;&lt;/code&gt;) instead of &lt;code&gt;&quot;&quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is it enough?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, in case it would actually be, bonus question: &lt;em&gt;is there any good reason to leave the handling&#xA;of sexps to the syntax table instead of smie?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-12-05T13:50:30.883" Title="Parsing parentheses: smie vs syntax table" Tags="|smie|syntax-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4147" PostTypeId="1" AcceptedAnswerId="4153" CreationDate="2014-12-05T13:19:26.620" Score="4" ViewCount="482" Body="&lt;p&gt;In the following minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;- Item Foo&#xA;#+BEGIN_SRC sh&#xA;echo &quot;Hello World!&quot;&#xA;#+END_SRC&#xA;- Item Bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is impossible to move the &lt;code&gt;bar&lt;/code&gt; item above &lt;code&gt;foo&lt;/code&gt; using &lt;code&gt;org-move-item-up&lt;/code&gt;. Is there a way around this?&lt;/p&gt;&#xA;" OwnerUserId="861" LastActivityDate="2014-12-05T15:49:52.557" Title="Moving list item that contains a code block in org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4148" PostTypeId="2" ParentId="4104" CreationDate="2014-12-05T13:26:51.253" Score="8" Body="&lt;p&gt;&lt;em&gt;I&lt;/em&gt; can't make the &quot;# -*-...&quot; syntax work in my .org file (I can accept that I probably did something wrong. :-).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got the following to work.  Place this at the bottom of your .org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;# Local Variables:&#xA;# mode: org&#xA;# org-todo-keyword-faces: ((&quot;ANSWER&quot; . &quot;orange&quot;) (&quot;ARCHIVED&quot; . &quot;blue&quot;) (&quot;DATE&quot; . &quot;red&quot;) (&quot;DOING&quot; . &quot;yellow&quot;) (&quot;DONE&quot; . &quot;green&quot;) (&quot;HPSM&quot; . &quot;red&quot;) (&quot;JIRA&quot; . &quot;red&quot;) (&quot;TODO&quot; . org-warning) (&quot;WAITING&quot; . &quot;orange&quot;))&#xA;# End:&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="2778" LastEditorUserId="50" LastEditDate="2014-12-05T22:59:57.450" LastActivityDate="2014-12-05T22:59:57.450" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4149" PostTypeId="2" ParentId="4146" CreationDate="2014-12-05T13:50:30.883" Score="7" Body="&lt;p&gt;Speed is a good reason to let the paren-matching be performed by syntax-tables where possible.  In your case, the &quot;parens&quot; are not multi-char, so you can definitely use syntax-tables for them.  In order to avoid treating &lt;code&gt;-&amp;gt;&lt;/code&gt; as a paren closer, you can setup a &lt;code&gt;syntax-propertize-function&lt;/code&gt; which modifies the syntax of those &lt;code&gt;&amp;gt;&lt;/code&gt; which appear in &lt;code&gt;-&amp;gt;&lt;/code&gt;.  Something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local syntax-propertize-function&#xA;            (syntax-propertize-rules&#xA;             (&quot;-\\(&amp;gt;\\)&quot;&#xA;              (1 (let ((ppss (save-excursion (syntax-ppss (match-beginning 0)))))&#xA;                   (and (nth 1 ppss) ;; Inside at least one level of parens.&#xA;                        (eq ?&amp;lt; (char-after (nth 1 ppss))) ;; Last level is &amp;lt;...&amp;gt;&#xA;                        (string-to-syntax &quot;.&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-05T13:50:30.883" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4150" PostTypeId="1" AcceptedAnswerId="4152" CreationDate="2014-12-05T14:01:56.987" Score="11" ViewCount="1756" Body="&lt;p&gt;If I have to do some variable name refactoring, I use &lt;a href=&quot;https://emacs.stackexchange.com/a/243/115&quot;&gt;ag and multiple-cursors&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I have to do some code block removal/addition/moving, I use keyboard macros. But I need to switch to each buffer and initiate that macro run manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to simply selected the open buffers from Ibuffer (or files from dired) and execute the last recorded keyboard macro on all of them?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2019-03-26T22:21:32.123" Title="How can I run a keyboard macro in selected buffers from Ibuffer or selected files from dired?" Tags="|buffers|dired|ibuffer|keyboard-macros|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4151" PostTypeId="2" ParentId="4150" CreationDate="2014-12-05T14:19:52.883" Score="3" Body="&lt;p&gt;You simply include the buffer-switching in the macro. You're not restricted to a single buffer -- a keyboard macro can do anything you can do!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I answered pretty much this same question the other day on S.O., so refer to &lt;a href=&quot;https://stackoverflow.com/a/27260855/324105&quot;&gt;emacs cross-file keyboard macro&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-12-05T14:19:52.883" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4152" PostTypeId="2" ParentId="4150" CreationDate="2014-12-05T14:30:49.087" Score="9" Body="&lt;h3&gt;Modify selected Ibuffer buffers&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;After recording the keyboard macro, switch to Ibuffer and,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mark the desired buffers using &lt;code&gt;m&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;W&lt;/code&gt; - Eval while viewing buffer &lt;em&gt;(The plain eval &lt;code&gt;E&lt;/code&gt; does NOT work for macro calls)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(kmacro-end-or-call-macro 1)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2014-12-05T14:50:52.913" LastActivityDate="2014-12-05T14:50:52.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4153" PostTypeId="2" ParentId="4147" CreationDate="2014-12-05T15:49:52.557" Score="9" Body="&lt;p&gt;It is possible: be careful to indent the code block under the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;- Item Foo&#xA;  #+BEGIN_SRC sh&#xA;  echo &quot;Hello World!&quot;&#xA;  #+END_SRC&#xA;- Item Bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="739" LastActivityDate="2014-12-05T15:49:52.557" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4154" PostTypeId="2" ParentId="4124" CreationDate="2014-12-05T18:00:43.293" Score="6" Body="&lt;p&gt;Building off of the comments, here are two ways to achieve what you're trying to do.  (Not extensively tested, so YMMV.)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Option 1: &lt;code&gt;post-command-hook&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Create a function that tests whether or not the buffer is modified, and then hook it into &lt;code&gt;post-command-hook&lt;/code&gt;:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hl-line-mode-toggle-maybe ()&#xA;  &quot;Turn on `hl-line-mode' when buffer is unmodified, turn it off&#xA;when it is modified.&quot;&#xA;  (hl-line-mode (if (buffer-modified-p) -1 1)))&#xA;&#xA;(add-hook 'post-command-hook #'hl-line-mode-toggle-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advantage is that it's pretty simple.  The disadvantage is that Emacs will run this test after &lt;em&gt;every single command&lt;/em&gt;, which seems like overkill.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Option 2: &lt;code&gt;first-change-hook&lt;/code&gt;, &lt;code&gt;after-save-hook&lt;/code&gt;, and &lt;code&gt;undo&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Create a function to turn &lt;code&gt;hl-line-mode&lt;/code&gt; off and hook it into &lt;code&gt;first-change-hook&lt;/code&gt;.  Create a function to turn &lt;code&gt;hl-line-mode&lt;/code&gt; on and hook it into &lt;code&gt;after-save-hook&lt;/code&gt;.  Provide &lt;code&gt;after&lt;/code&gt; advice on &lt;code&gt;undo&lt;/code&gt; such that it turns &lt;code&gt;hl-line-mode&lt;/code&gt; on when an undo had returned the buffer to an unmodified state:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hl-line-mode-off ()&#xA;  &quot;Turn off `hl-line-mode'.&quot;&#xA;  (hl-line-mode -1))&#xA;&#xA;(defun hl-line-mode-on ()&#xA;  &quot;Turn off `hl-line-mode'.&quot;&#xA;  (hl-line-mode 1))&#xA;&#xA;(add-hook 'first-change-hook #'hl-line-mode-off)&#xA;(add-hook 'after-save-hook   #'hl-line-mode-on)&#xA;&#xA;(defadvice undo (after hl-line-when-unmodified activate)&#xA;  (unless (buffer-modified-p)&#xA;    (hl-line-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advantage is that it calls these functions infrequently rather than after every command.  The disadvantage is that you've had to delve into advice, and there may be other, unanticipated ways to get a buffer to an unmodified state that don't trigger the &quot;turn &lt;code&gt;hl-line-mode&lt;/code&gt; back on&quot; step.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-05T18:00:43.293" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4155" PostTypeId="2" ParentId="4134" CreationDate="2014-12-05T19:17:20.290" Score="1" Body="&lt;p&gt;I don't believe that &lt;code&gt;org-habit&lt;/code&gt; has any concept of &quot;Do it X times then skip Y times&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I can see for approximating would be:  &lt;code&gt;.+1d/2&lt;/code&gt; (Do every day, or at worst every second day).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using multiple habits you could get the desired effect:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Habit&#xA;SCHEDULED: &amp;lt;2014-12-05 Fri .+4d&amp;gt;&#xA;:PROPERTIES:&#xA;:STYLE: habit&#xA;:END:&#xA;* TODO Habit&#xA;SCHEDULED: &amp;lt;2014-12-06 Sat .+4d&amp;gt;&#xA;:PROPERTIES:&#xA;:STYLE: habit&#xA;:END:&#xA;* TODO Habit&#xA;SCHEDULED: &amp;lt;2014-12-07 Sun .+4d&amp;gt;&#xA;:PROPERTIES:&#xA;:STYLE: habit&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastActivityDate="2014-12-05T19:17:20.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4156" PostTypeId="2" ParentId="4129" CreationDate="2014-12-05T19:51:57.207" Score="2" Body="&lt;p&gt;From looking at the source, &lt;code&gt;flx-ido-mode&lt;/code&gt; favors the longest potential match. There aren't any options to tune this behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be able to get what you want by tweaking the ido key bindings. Ido has a few different key maps, so depending on exactly what you want you could modify &lt;code&gt;ido-common-completion-map&lt;/code&gt;, &lt;code&gt;ido-file-completion-map&lt;/code&gt;, or &lt;code&gt;ido-buffer-completion-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple thoughts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You could add an ido binding to toggle &lt;code&gt;flx-ido-mode&lt;/code&gt; on and off. Perhaps leave it off by default and toggle it on when you need it. This seems to work: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; always start ido with flx matching off&#xA;(add-hook 'ido-setup-hook (lambda () (flx-ido-mode -1)))&#xA;&#xA;;; toggle flx matching without writing to the minibuffer&#xA;(defun quietly-toggle-flx-ido-mode ()&#xA;  (interactive)&#xA;  (let ((minibuffer-message-timeout 0))&#xA;    (flx-ido-mode 'toggle)))&#xA;&#xA;;; define a key to toggle flx matching while in ido&#xA;(define-key ido-common-completion-map (kbd &quot;&amp;lt;f8&amp;gt;&quot;) #'quietly-toggle-flx-ido-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You could rebind RET to first trigger tab completion. I haven't played with this, but something like: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ido-complete-and-exit ()&#xA;  (interactive)&#xA;  (ido-complete)&#xA;  (ido-exit-minibuffer))&#xA;&#xA;(define-key ido-common-completion-map (kbd &quot;RET&quot;) #'ido-complete-and-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted in the comments, the second example above does not work. Unfortunately I'm not familiar enough with ido internals to propose a solution along these lines that doesn't break other ido behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best solution would be to revise how flx sorts the candidates. I see some open issues along these lines, e.g. &lt;a href=&quot;https://github.com/lewang/flx/issues/63&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lewang/flx/issues/63&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-12-05T22:50:34.573" LastActivityDate="2014-12-05T22:50:34.573" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4157" PostTypeId="1" CreationDate="2014-12-05T21:06:44.493" Score="2" ViewCount="165" Body="&lt;p&gt;Is it possible to export Facebook events to org-mode automatically? &lt;/p&gt;&#xA;" OwnerUserId="2191" LastActivityDate="2014-12-05T21:06:44.493" Title="Sync Facebook events and org-mode" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4160" PostTypeId="1" AcceptedAnswerId="4162" CreationDate="2014-12-05T22:56:36.080" Score="2" ViewCount="90" Body="&lt;p&gt;I just installed a new version of Emacs (24.3.1 through Fedora). For some reason, when I use &lt;code&gt;C-s&lt;/code&gt; to search for a single space character, it jumps my cursor to the &lt;em&gt;end&lt;/em&gt; of contiguous spaces rather than the beginning. For example, if I'm at the start of this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;type thread_id        = ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and do &lt;code&gt;C-s SPC&lt;/code&gt;, all the spaces in the buffer are highlighted. But when I advance up to the spaces before the &lt;code&gt;=&lt;/code&gt;, my cursor is immediately positioned &lt;em&gt;on&lt;/em&gt; the &lt;code&gt;=&lt;/code&gt; rather than after the &lt;em&gt;first&lt;/em&gt; space (ie two positions after the end of &lt;code&gt;thread_id&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get my cursor to be at the first single character rather than the end of the range?&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="25" LastEditDate="2014-12-07T18:08:15.840" LastActivityDate="2014-12-07T18:08:15.840" Title="How can I configure incremental search to put my cursor at the start of whitespace rather than the end?" Tags="|search|whitespace|isearch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4161" PostTypeId="1" AcceptedAnswerId="4197" CreationDate="2014-12-05T23:30:12.367" Score="6" ViewCount="1443" Body="&lt;p&gt;I'm using Emacs 24.4.1 on OSX (installed with Homebrew), with the built in &lt;code&gt;python.el&lt;/code&gt;, and Python 3 (also installed with Homebrew), along with IPython 2.3.0. I have this in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; python-shell-interpreter &quot;/usr/local/bin/ipython3&quot;&#xA; python-shell-prompt-regexp &quot;In \\[[0-9]+\\]: &quot;&#xA; python-shell-prompt-output-regexp &quot;Out\\[[0-9]+\\]: &quot;&#xA; python-shell-completion-setup-code&#xA; &quot;from IPython.core.completerlib import module_completion&quot;&#xA; python-shell-completion-module-string-code&#xA; &quot;';'.join(module_completion('''%s'''))\n&quot;&#xA; python-shell-completion-string-code&#xA; &quot;';'.join(get_ipython().Completer.all_completions('''%s'''))\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works correctly when I invoke &lt;code&gt;M-x run-python&lt;/code&gt;, except one thing: the &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;-completion of module names doesn't work in the REPL (it says &quot;No match&quot; in the &lt;code&gt;*Messages*&lt;/code&gt; buffer). I'm pretty sure it was working with Emacs 24.3, which I upgraded very recently, but I'm not 100% sure. Anyone has an idea what might cause this, or how I could try to debug it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After having set &lt;code&gt;debug-on-message&lt;/code&gt; to &lt;code&gt;&quot;No match&quot;&lt;/code&gt; as suggested by @Constantine below, trying to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [4]: import nump&amp;lt;tab&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yields:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: &quot;No match&quot;&#xA;  message(&quot;%s&quot; &quot;No match&quot;)&#xA;  minibuffer-message(&quot;No match&quot;)&#xA;  completion--message(&quot;No match&quot;)&#xA;  completion--do-completion(#&amp;lt;marker at 406 in *Python*&amp;gt; 410)&#xA;  completion--in-region-1(#&amp;lt;marker at 406 in *Python*&amp;gt; 410)&#xA;  #[1028 &quot;\n\203!\304!\203\202\305!\305\306\&quot;F\307\310!\210\311\&quot;*\207&quot; [minibuffer-completion-predicate minibuffer-completion-table completion-in-region-mode-predicate completion-in-region--data markerp copy-marker t completion-in-region-mode 1 completion--in-region-1] 8 &quot;\n\n(fn START END COLLECTION PREDICATE)&quot;](#&amp;lt;marker at 406 in *Python*&amp;gt; 410 #[771 &quot;\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207&quot; [(closure (t) (&amp;amp;rest args) (apply (quote python-shell-completion-get-completions) (quote #&amp;lt;process Python&amp;gt;) (quote &quot;import nump&quot;) args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 &quot;\n\n(fn STRING PRED ACTION)&quot;] nil)&#xA;  apply(#[1028 &quot;\n\203!\304!\203\202\305!\305\306\&quot;F\307\310!\210\311\&quot;*\207&quot; [minibuffer-completion-predicate minibuffer-completion-table completion-in-region-mode-predicate completion-in-region--data markerp copy-marker t completion-in-region-mode 1 completion--in-region-1] 8 &quot;\n\n(fn START END COLLECTION PREDICATE)&quot;] (#&amp;lt;marker at 406 in *Python*&amp;gt; 410 #[771 &quot;\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207&quot; [(closure (t) (&amp;amp;rest args) (apply (quote python-shell-completion-get-completions) (quote #&amp;lt;process Python&amp;gt;) (quote &quot;import nump&quot;) args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 &quot;\n\n(fn STRING PRED ACTION)&quot;] nil))&#xA;  #[771 &quot;:\2030@\301=\203\300\242\302A\&quot;\303#\207\304@\305\306\307\310\311\312\300!\313\&quot;\314\315%A##\207\304\316\&quot;\207&quot; [(#0) t append nil apply apply-partially make-byte-code 642 &quot;\300\242#\207&quot; vconcat vector [] 7 &quot;\n\n(fn FUNS GLOBAL &amp;amp;rest ARGS)&quot; #[1028 &quot;\n\203!\304!\203\202\305!\305\306\&quot;F\307\310!\210\311\&quot;*\207&quot; [minibuffer-completion-predicate minibuffer-completion-table completion-in-region-mode-predicate completion-in-region--data markerp copy-marker t completion-in-region-mode 1 completion--in-region-1] 8 &quot;\n\n(fn START END COLLECTION PREDICATE)&quot;]] 12 &quot;\n\n(fn FUNS GLOBAL ARGS)&quot;](nil nil (#&amp;lt;marker at 406 in *Python*&amp;gt; 410 #[771 &quot;\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207&quot; [(closure (t) (&amp;amp;rest args) (apply (quote python-shell-completion-get-completions) (quote #&amp;lt;process Python&amp;gt;) (quote &quot;import nump&quot;) args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 &quot;\n\n(fn STRING PRED ACTION)&quot;] nil))&#xA;  completion--in-region(#&amp;lt;marker at 406 in *Python*&amp;gt; 410 #[771 &quot;\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207&quot; [(closure (t) (&amp;amp;rest args) (apply (quote python-shell-completion-get-completions) (quote #&amp;lt;process Python&amp;gt;) (quote &quot;import nump&quot;) args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 &quot;\n\n(fn STRING PRED ACTION)&quot;] nil)&#xA;  completion-in-region(#&amp;lt;marker at 406 in *Python*&amp;gt; 410 #[771 &quot;\211\242\301=\206\n\211\302=?\205+r\303 \304!\203\305!\202p\262q\210\306\300!$)\207&quot; [(closure (t) (&amp;amp;rest args) (apply (quote python-shell-completion-get-completions) (quote #&amp;lt;process Python&amp;gt;) (quote &quot;import nump&quot;) args)) boundaries metadata minibuffer-selected-window window-live-p window-buffer complete-with-action] 8 &quot;\n\n(fn STRING PRED ACTION)&quot;] nil)&#xA;  completion-at-point()&#xA;  python-shell-completion-complete-or-indent()&#xA;  call-interactively(python-shell-completion-complete-or-indent nil nil)&#xA;  command-execute(python-shell-completion-complete-or-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My current Emacs-fu is not enough to allow me to understand the problem from that stacktrace alone, but perhaps someone could?&lt;/p&gt;&#xA;" OwnerUserId="2807" LastEditorUserId="2807" LastEditDate="2014-12-06T05:32:36.027" LastActivityDate="2014-12-07T15:54:50.903" Title="Emacs 24's python.el + ipython cannot complete module names" Tags="|completion|python|emacs24.4|ipython|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4162" PostTypeId="2" ParentId="4160" CreationDate="2014-12-05T23:57:23.137" Score="4" Body="&lt;p&gt;The Emacs Manual (section &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Special-Isearch.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Special Isearch&lt;/a&gt;) says this:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;By default, incremental search performs lax space matching: each space, or sequence of spaces, matches any sequence of one or more spaces in the text. Hence, &amp;quot;&lt;code&gt;foo bar&lt;/code&gt;&amp;quot; matches &amp;quot;&lt;code&gt;foo bar&lt;/code&gt;&amp;quot;, &amp;quot;&lt;code&gt;foo  bar&lt;/code&gt;&amp;quot;, &amp;quot;&lt;code&gt;foo   bar&lt;/code&gt;&amp;quot;, and so on (but not &amp;quot;&lt;code&gt;foobar&lt;/code&gt;&amp;quot;). More precisely, Emacs matches each sequence of space characters in the search string to a regular expression specified by the variable &lt;code&gt;search-whitespace-regexp&lt;/code&gt;. For example, to make spaces match sequences of newlines as well as spaces, set it to &lt;code&gt;&amp;quot;[[:space:]\n]+&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To toggle lax space matching, type &lt;code&gt;M-s &amp;lt;SPC&amp;gt;&lt;/code&gt; (&lt;code&gt;isearch-toggle-lax-whitespace&lt;/code&gt;). To disable this feature entirely, change &lt;code&gt;search-whitespace-regexp&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;; then each space in the search string matches exactly one space.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So, set &lt;code&gt;search-whitespace-regexp&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; (or set &lt;code&gt;isearch-lax-whitespace&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; -- it seems to have the same effect).&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-12-05T23:57:23.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4163" PostTypeId="1" CreationDate="2014-12-06T03:08:48.990" Score="2" ViewCount="382" Body="&lt;p&gt;There are two bindings for &lt;code&gt;undo-tree-undo&lt;/code&gt;(&lt;code&gt;C-_&lt;/code&gt; and &lt;code&gt;C-/&lt;/code&gt;) and &lt;code&gt;undo-tree-redo&lt;/code&gt;(&lt;code&gt;M-_&lt;/code&gt; and &lt;code&gt;C-?&lt;/code&gt;) defined in &lt;a href=&quot;https://github.com/emacsmirror/undo-tree&quot; rel=&quot;nofollow&quot;&gt;undo-tree&lt;/a&gt;, but now I don't want those bindings(&lt;code&gt;delete&lt;/code&gt; those), I just want to bind &lt;code&gt;C-z&lt;/code&gt; to &lt;code&gt;undo-tree-undo&lt;/code&gt; and &lt;code&gt;C-S-z&lt;/code&gt; to &lt;code&gt;undo-tree-redo&lt;/code&gt;(short and simple), I tried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key undo-tree-map (kbd &quot;C-_&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-_&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to delete the bindings, they all doesn't work(only work for current session), if I restart Emacs, the &lt;code&gt;C-_&lt;/code&gt; will still be bound to &lt;code&gt;undo-tree-undo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I set above two lines at the same time, the binding will be gone, that's really weird, how can I use one line to delete the bound. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, if you can delete the old bindings and set the new binding(&lt;code&gt;C-z&lt;/code&gt;) at the same time, that would be better?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="105" LastEditDate="2018-12-24T16:58:16.530" LastActivityDate="2018-12-24T16:58:16.530" Title="Unable to disable binding defined by undo-tree" Tags="|key-bindings|keymap|undo-tree-mode|eval-after-load|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4164" PostTypeId="2" ParentId="4131" CreationDate="2014-12-06T04:30:46.967" Score="4" Body="&lt;p&gt;I think I've found the problem and a work-around.&#xA;If you look at the python.el file, you will find this function to determine the path to the python executable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun python-shell-parse-command ()    ;FIXME: why name it &quot;parse&quot;?&#xA;  &quot;Calculate the string used to execute the inferior Python process.&quot;&#xA;  ;; FIXME: process-environment doesn't seem to be used anywhere within&#xA;  ;; this let.&#xA;  (let ((process-environment (python-shell-calculate-process-environment))&#xA;        (exec-path (python-shell-calculate-exec-path)))&#xA;    (format &quot;%s %s&quot;&#xA;            ;; FIXME: Why executable-find?&#xA;            (executable-find python-shell-interpreter)&#xA;            python-shell-interpreter-args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(BTW - the FIXME notes are in the code - they are not my comments)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the problem is the executable-find returns an unquoted fully defined path, which in turn is passed to the shell and creates the &quot;invalid argument&quot; error. executable-find (defined in files.el) in turn calls locate-file which has the same problematical behavior for paths with embedded spaces. The real fix is probably to correct locate-file, but I'm not at all familiar with the emacs code base to even remotely guess at the broader consequences of changing this. Perhaps there should also be a check if the code is running on a Windows system. I really don't know. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, here's the workaround. Change the format statement to add the quotes you need&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (format &quot;\&quot;%s\&quot; %s&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the shell opens error-free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&#xA;The emacs team replied to my &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19289&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt; pointing out the correct way to fix this is with the function shell-quote-argument which handles the differences between OSs. &lt;/p&gt;&#xA;" OwnerUserId="2791" LastEditorUserId="11" LastEditDate="2015-01-12T11:26:12.103" LastActivityDate="2015-01-12T11:26:12.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4165" PostTypeId="1" AcceptedAnswerId="7867" CreationDate="2014-12-06T04:56:51.450" Score="1" ViewCount="227" Body="&lt;p&gt;I find the way that the cursor scrolls in small frames unintuitive. When I press &lt;code&gt;C-p&lt;/code&gt; I expect the cursor to move up a line. Instead, in the org-mode file below, right before the cursor gets to the &lt;code&gt;#+RESULTS&lt;/code&gt; line it jumps up several lines to the displayed image. Maybe this is a bug? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EEL60.gif&quot; alt=&quot;weird scrolling in org-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I experience the same behavior in a small frame containing a shell buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/rxmoD.gif&quot; alt=&quot;weird scrolling in *shell*&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, and this is the intended scrolling behavior in small frames, is there a way to disable it to get &lt;em&gt;line-by-line&lt;/em&gt; scrolling? &lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2014-12-06T05:20:20.070" LastActivityDate="2015-02-01T19:07:08.780" Title="How disable &quot;unexpected&quot; scrolling behavior in small frames" Tags="|frames|scrolling|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4166" PostTypeId="2" ParentId="4165" CreationDate="2014-12-06T06:42:00.523" Score="3" Body="&lt;p&gt;Adjust option &lt;strong&gt;&lt;code&gt;scroll-margin&lt;/code&gt;&lt;/strong&gt; to your liking.  (You might also want to look at option &lt;code&gt;scroll-step&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Number of lines of margin at the top and bottom of a window.&#xA;  Recenter the window whenever point gets within this many lines&#xA;  of the top or bottom of the window.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-06T06:42:00.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4167" PostTypeId="1" AcceptedAnswerId="4176" CreationDate="2014-12-06T06:53:22.877" Score="13" ViewCount="1284" Body="&lt;p&gt;When part of a &lt;code&gt;defun&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(interactive &quot;c(C)hoose (A)n (O)ption&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will prompt the user for a single character; &lt;code&gt;RET&lt;/code&gt; is not required.  How can I replicate this reading behavior without the need for &lt;code&gt;interactive&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2018-09-04T20:59:14.830" Title="How can I read a single character from the minibuffer?" Tags="|minibuffer|interactive|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4168" PostTypeId="2" ParentId="4167" CreationDate="2014-12-06T08:39:49.030" Score="4" Body="&lt;p&gt;&lt;code&gt;call-interactively&lt;/code&gt; is what interprets the &lt;code&gt;(interactive &quot;cPROMPT&quot;)&lt;/code&gt; specification, the &lt;code&gt;c&lt;/code&gt; option is dispatched to &lt;code&gt;read-char&lt;/code&gt;.  Therefore, the following should work in a non-interactive context:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read-char &quot;(C)hoose (A)n (O)ption&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-12-06T19:44:48.663" LastActivityDate="2014-12-06T19:44:48.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4169" PostTypeId="2" ParentId="4163" CreationDate="2014-12-06T09:08:09.640" Score="6" Body="&lt;p&gt;To make these bindings persistent, put them into your init file. For them to be able to redefine the undo-tree keymap, undo-tree has to be active first. This can either be guaranteed by enabling undo-tree first (which only works after the packages have been enabled in the respective &lt;code&gt;after-init-hook&lt;/code&gt; or after using &lt;code&gt;package-initialize&lt;/code&gt; in your init file) or by applying them after its file has been loaded with &lt;code&gt;eval-after-load&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for rebinding existing functionality, you're able to remap a command to another or swap out a command for the keybinding in question.  Neither of those are what you're after.  Here's a snippet you can put in your init file that's using `eval-after-load' and explicitly rebinds everything:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'undo-tree&#xA;  '(progn&#xA;     (define-key undo-tree-map (kbd &quot;C-/&quot;) nil)&#xA;     (define-key undo-tree-map (kbd &quot;C-_&quot;) nil)&#xA;     (define-key undo-tree-map (kbd &quot;C-?&quot;) nil)&#xA;     (define-key undo-tree-map (kbd &quot;M-_&quot;) nil)&#xA;     (define-key undo-tree-map (kbd &quot;C-z&quot;) 'undo-tree-undo)&#xA;     (define-key undo-tree-map (kbd &quot;C-S-z&quot;) 'undo-tree-redo)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-06T09:08:09.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4170" PostTypeId="1" AcceptedAnswerId="4172" CreationDate="2014-12-06T11:13:32.223" Score="8" ViewCount="194" Body="&lt;p&gt;Let's say I'm editing my config file and there is a very long string like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-string &quot;very\nlong\nstring [...] \&quot;hello world\&quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do edit the string without the escape characters (and maybe in a different mode) and than save the result back in the config file with the escape characters?&lt;/p&gt;&#xA;" OwnerUserId="2660" LastActivityDate="2015-11-08T12:56:23.497" Title="Editing a string with lots of escape characters" Tags="|text-editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4171" PostTypeId="2" ParentId="4167" CreationDate="2014-12-06T13:55:17.710" Score="5" Body="&lt;p&gt;In addition to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Reading-One-Event.html&quot; rel=&quot;nofollow&quot;&gt;built-in ways to read single events&lt;/a&gt; such as &lt;code&gt;read-char&lt;/code&gt; and &lt;code&gt;read-char-exclusive&lt;/code&gt;, here's an option to read a single character, but also specify which characters are acceptable input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun read-char-picky (prompt chars &amp;amp;optional inherit-input-method seconds)&#xA;  &quot;Read characters like in `read-char-exclusive', but if input is&#xA;not one of CHARS, return nil.  CHARS may be a list of characters,&#xA;single-character strings, or a string of characters.&quot;&#xA;  (let ((chars (mapcar (lambda (x)&#xA;                         (if (characterp x) x (string-to-char x)))&#xA;                       (append chars nil)))&#xA;        (char  (read-char-exclusive prompt inherit-input-method seconds)))&#xA;    (when (memq char chars)&#xA;      char)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So all of the following will accept either &quot;C&quot;, &quot;A&quot;, or &quot;O&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read-char-picky &quot;(C)hoose (A)n (O)ption: &quot; &quot;CAO&quot;)&#xA;(read-char-picky &quot;(C)hoose (A)n (O)ption: &quot; '(&quot;C&quot; &quot;A&quot; &quot;O&quot;))&#xA;(read-char-picky &quot;(C)hoose (A)n (O)ption: &quot; '(?C ?A ?O))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here's an example way to loop for the correct input into a &lt;code&gt;response&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let (response)&#xA;  (while (null (setq response&#xA;                     (read-char-picky &quot;(C)hoose (A)n (O)ption: &quot; &quot;CAO&quot;)))&#xA;    (message &quot;Please pick one of \&quot;C\&quot;, \&quot;A\&quot;, or \&quot;O\&quot;!&quot;)&#xA;    (sit-for .5))&#xA;  response)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-12-06T19:35:15.930" LastActivityDate="2014-12-06T19:35:15.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4172" PostTypeId="2" ParentId="4170" CreationDate="2014-12-06T14:23:33.527" Score="9" Body="&lt;p&gt;You can use the package &lt;a href=&quot;https://github.com/magnars/string-edit.el&quot; rel=&quot;nofollow&quot;&gt;string-edit&lt;/a&gt; for that purpose. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, it does exactly what you want: simply call &lt;code&gt;string-edit-at-point&lt;/code&gt; to edit the string at point, then &lt;code&gt;C-c C-c&lt;/code&gt; to return to the original buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation on github includes a &lt;a href=&quot;https://asciinema.org/a/3040&quot; rel=&quot;nofollow&quot;&gt;demonstration&lt;/a&gt; (if the link appears to be dead, please see the github page directly).&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-11-08T12:56:23.497" LastActivityDate="2015-11-08T12:56:23.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4173" PostTypeId="1" AcceptedAnswerId="4178" CreationDate="2014-12-06T18:04:14.543" Score="5" ViewCount="362" Body="&lt;p&gt;I have made the following function to count how many &lt;code&gt;C-u&lt;/code&gt; prefixes a command was given (assuming it is called interactively), but I feel this is a common-enough problem that there should be a built-in function (or a package that solves this problem more robustly).  Is there a better way to do this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tmp:how-many (arg)&#xA;  ;; Return zero if `arg' is 1 or nil&#xA;  (if (or (null arg) (equal arg 1)) 0&#xA;    ;; If `arg' is a list (as it is when called interactively), extract&#xA;    ;; the number.&#xA;    (when (listp arg)&#xA;      (setq arg (car arg)))&#xA;    ;; Recurse&#xA;    (if arg&#xA;        (1+ (tmp:how-many (/ arg 4)))&#xA;      0)))&#xA;&#xA;(defun tmp:test (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (message &quot;%S&quot; (tmp:how-many arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2022-04-23T21:33:20.990" LastActivityDate="2022-04-23T21:33:20.990" Title="Is there an easy way to detect how many `C-u`s a command was given?" Tags="|prefix-argument|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4174" PostTypeId="1" AcceptedAnswerId="4179" CreationDate="2014-12-06T18:09:52.510" Score="0" ViewCount="706" Body="&lt;p&gt;I have written till the 35th line in Emacs with activated line numbers (so my last line number is 35). When I am writing in the 32nd line there are line numbers flickering up to the 43rd line number (appearing only while writing) and when I stop they disappear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The line numbers I mentioned (35 32 43) are just to explain the problem and they are simply my current line numbers. The same happens if I have 5 or 10 or any number of lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are those line numbers flickering and how can I make them stop appearing?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2014-12-06T18:15:41.603" LastActivityDate="2014-12-06T21:25:30.757" Title="Non-existent line numbers flickering" Tags="|linum-mode|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4175" PostTypeId="1" AcceptedAnswerId="4188" CreationDate="2014-12-06T18:36:58.577" Score="7" ViewCount="3709" Body="&lt;p&gt;In Eclipse, I can hit &lt;code&gt;CTRL + SHIFT + F&lt;/code&gt; which not only corrects the indentation but also whitespace (for example: &lt;code&gt;c=a +b ;&lt;/code&gt; is corrected to &lt;code&gt;c = a + b;&lt;/code&gt;) and the line length. I am looking for a similar tool for Emacs. All I know is &lt;code&gt;C-x h TAB&lt;/code&gt; that corrects the indentation, but nothing more. Do you know any automatic way how to completely format a (espacially C/C++) source file in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2157" LastActivityDate="2016-03-02T07:59:41.287" Title="&quot;Format Code&quot; like in Eclipse" Tags="|indentation|whitespace|formatting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4176" PostTypeId="2" ParentId="4167" CreationDate="2014-12-06T20:13:00.357" Score="9" Body="&lt;p&gt;Rather than &lt;code&gt;read-char&lt;/code&gt; I recommend &lt;code&gt;read-key&lt;/code&gt;.  The difference is that &lt;code&gt;read-key&lt;/code&gt; obeys all the usual remappings such as &lt;code&gt;input-decode-map&lt;/code&gt; and &lt;code&gt;function-key-map&lt;/code&gt;, so it will work properly in a tty.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-06T20:13:00.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4177" PostTypeId="1" AcceptedAnswerId="4183" CreationDate="2014-12-06T20:22:32.887" Score="11" ViewCount="733" Body="&lt;p&gt;I'm using &lt;code&gt;eww&lt;/code&gt; lately for browsing the web looking for documentation and things like that. I dislike that &lt;code&gt;eww&lt;/code&gt; receives the same web page as it were Firefox or Google Chrome, it cannot render web pages as those web browsers do. Then, what I want to achieve is to make &lt;code&gt;eww&lt;/code&gt; tell the web sites that it visits that send the &lt;em&gt;mobile friendly&lt;/em&gt; version of their web pages, thus, I would have a simpler layout rendered by &lt;code&gt;eww&lt;/code&gt; (or at least that's my assumption).&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="2810" LastEditDate="2014-12-07T02:36:47.260" LastActivityDate="2015-06-06T18:27:31.667" Title="How can I ask for a web server to serve their &quot;mobile friendly&quot; version of their web pages with eww?" Tags="|eww|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4178" PostTypeId="2" ParentId="4173" CreationDate="2014-12-06T21:08:55.960" Score="5" Body="&lt;p&gt;I will assume that you want to distinguish only uses of a plain prefix arg, e.g., &lt;code&gt;C-u&lt;/code&gt;, &lt;code&gt;C-u C-u&lt;/code&gt;, &lt;code&gt;C-u C-u C-u&lt;/code&gt;, etc., and not uses of a numeric prefix arg, e.g., &lt;code&gt;C-u 23&lt;/code&gt;, &lt;code&gt;C-9&lt;/code&gt;, &lt;code&gt;C-- 5&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test both, in order:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Whether the value of &lt;code&gt;current-prefix-arg&lt;/code&gt; is a cons, using &lt;code&gt;consp&lt;/code&gt;.  If not, then a plain prefix arg was not used.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;prefix-numeric-value&lt;/code&gt; of &lt;code&gt;current-prefix-arg&lt;/code&gt;, to see which power of 4 it is.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (consp current-prefix-arg)&#xA;    (case (prefix-numeric-value current-prefix-arg)&#xA;      (4   (do-C-u-stuff))&#xA;      (16  (do-C-u-C-u-stuff))&#xA;      (64  (do-C-u-C-u-C-u-stuff))&#xA;      ...)&#xA;  ...) ; Do something for absent prefix arg or non-plain prefix arg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;case&lt;/code&gt; is a macro from the CL libraries.  Use &lt;code&gt;(eval-when-compile '(require 'cl))&lt;/code&gt;.  (Or you can use &lt;code&gt;cl-case&lt;/code&gt;, if your Emacs version has it.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:35:48.017" LastActivityDate="2015-05-09T20:35:48.017" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4179" PostTypeId="2" ParentId="4174" CreationDate="2014-12-06T21:25:30.757" Score="3" Body="&lt;p&gt;Line numbers (of the kind that's displayed as a strip with every line number on a window's side) are known for their performance and redrawing issues.  One of them is that they're using the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Margins.html#Display-Margins&quot; rel=&quot;nofollow&quot;&gt;display margin&lt;/a&gt; which interferes with other packages that (indirectly) manipulate the margins.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more prominent examples would be &lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow&quot;&gt;auto-complete-mode&lt;/a&gt; and &lt;a href=&quot;https://github.com/company-mode/company-mode&quot; rel=&quot;nofollow&quot;&gt;company-mode&lt;/a&gt;.  &lt;code&gt;auto-complete-mode&lt;/code&gt; inserts extra text into the buffer for its popup which can be seen by extra whitespace (without line numbers) at the end of the file when completing at a place with sufficient lines of text after it or by lots of non-existant lines (with line numbers) when completing at a place with not enough lines after it. &lt;code&gt;company-mode&lt;/code&gt; on the other hand does not insert extra text, but does instead mask the margin so that whenever you complete at a place with sufficient lines of text after it, &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/234&quot; rel=&quot;nofollow&quot;&gt;the line numbers covered by the popup are hidden&lt;/a&gt;.  I suggest giving &lt;code&gt;company-mode&lt;/code&gt; a try since its behaviour is a bit less jarring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative &quot;solution&quot; would be foregoing &lt;code&gt;linum-mode&lt;/code&gt; entirely and instead display the current line number in the mode line with &lt;code&gt;line-number-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-06T21:25:30.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4181" PostTypeId="2" ParentId="4173" CreationDate="2014-12-06T21:54:02.943" Score="6" Body="&lt;p&gt;Assuming you &lt;em&gt;only&lt;/em&gt; want to understand arguments given using &lt;em&gt;only&lt;/em&gt; &lt;code&gt;C-u&lt;/code&gt;, you can use a base-four logarithm:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tmp:how-many (arg)&#xA;  (when (consp arg)&#xA;    (truncate&#xA;     (log (car arg) 4))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that such a function is doomed to fail if a sequence like &lt;code&gt;C-3 M-x tmp:test&lt;/code&gt; is used; the only appropriate response to such usage is to signal an error or return &lt;code&gt;nil&lt;/code&gt;, which was what I do here.  (Returning &lt;code&gt;arg&lt;/code&gt; would imply ambiguous results between, e.g., &lt;code&gt;C-3 M-x tmp:test&lt;/code&gt; and &lt;code&gt;C-u C-u C-u M-x tmp:test&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-07T01:42:08.117" LastActivityDate="2014-12-07T01:42:08.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4182" PostTypeId="1" AcceptedAnswerId="4193" CreationDate="2014-12-06T22:17:58.513" Score="4" ViewCount="200" Body="&lt;p&gt;skewer-mode works perfectly with their default demo page&#xA;(&lt;code&gt;http://127.0.0.1:8080/skewer/demo&lt;/code&gt;). I'm able to send commands from&#xA;&lt;code&gt;skewer-repl&lt;/code&gt; like &lt;code&gt;alert('hello world')&lt;/code&gt; and it appears on that particular URL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how to make the same functionality to work with external sites ?&#xA;I have already injected the &lt;a href=&quot;https://github.com/skeeto/skewer-mode/blob/master/skewer-everything.user.js&quot; rel=&quot;nofollow&quot;&gt;greasemonkey&#xA;script&lt;/a&gt;&#xA;in the external site but it doesn't seem to work for me. The problem&#xA;is that &lt;code&gt;skewer-repl&lt;/code&gt; seems to only interact with it's demo url:&#xA;&lt;code&gt;http://127.0.0.1:8080/skewer/demo&lt;/code&gt; . Is there a way to make it work&#xA;with external sites ?&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2014-12-07T11:09:53.557" Title="Making skewer-repl work on external sites" Tags="|web|skewer-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4183" PostTypeId="2" ParentId="4177" CreationDate="2014-12-06T22:53:01.107" Score="11" Body="&lt;p&gt;&lt;code&gt;eww&lt;/code&gt; uses the &lt;code&gt;url&lt;/code&gt; library, so we can add advice to &lt;code&gt;url-http-user-agent-string&lt;/code&gt; to fake the &lt;code&gt;User-Agent&lt;/code&gt; string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'url-http-user-agent-string :around&#xA;            (lambda (ignored)&#xA;              &quot;Pretend to be a mobile browser.&quot;&#xA;              (concat&#xA;               &quot;User-Agent: &quot;&#xA;               &quot;Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I took a mobile browser User-Agent string from &lt;a href=&quot;http://www.useragentstring.com/pages/Mobile%20Browserlist/&quot;&gt;&lt;code&gt;www.useragentstring.com&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this advice I get the mobile version of &lt;code&gt;google.com&lt;/code&gt;; your mileage may vary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I found this by using &lt;code&gt;M-x apropos RET user-agent RET&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-06T22:53:01.107" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4185" PostTypeId="2" ParentId="4130" CreationDate="2014-12-07T01:42:23.533" Score="2" Body="&lt;p&gt;Make sure that &lt;code&gt;C-x b&lt;/code&gt; is bound to &lt;code&gt;ido-switch-buffer&lt;/code&gt;, not to something else. You can check what it is currently bound to by running &lt;code&gt;M-x describe-key &amp;lt;RET&amp;gt; C-x b&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2810" LastActivityDate="2014-12-07T01:42:23.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4186" PostTypeId="2" ParentId="4130" CreationDate="2014-12-07T02:46:03.827" Score="0" Body="&lt;p&gt;my .emacs file remapped C-x b to a function called s-switch-to-buffer, which probably got added back in the lisp machine days and I had completely forgotten it was there. Once I removed that, everything behaved as expected. Thanks to Dan for prompting to look at the key-binding. &lt;/p&gt;&#xA;" OwnerUserId="2791" LastActivityDate="2014-12-07T02:46:03.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4187" PostTypeId="1" AcceptedAnswerId="4191" CreationDate="2014-12-07T03:16:07.790" Score="11" ViewCount="967" Body="&lt;p&gt;I save the &lt;code&gt;kill-ring&lt;/code&gt; using the &lt;code&gt;savehist&lt;/code&gt; package. &lt;code&gt;savehist&lt;/code&gt; saves the kill ring with text-properties intact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this is a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a rather large emacs config, and I use a lot of highlighting. Here is the first element of my &lt;code&gt;kill-ring&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#(&quot;avehist-printable value)\n         (prin1 `(setq ,symbol ',value) (current-buffer))\n          (insert ?\\n))))))\n    ;; If autosaving, avoid writing if nothing has changed since the\n    ;; last write.&quot; 0 23   (fontified t wrap-prefix     #(&quot;     &quot; 0 5        (fontified t)))   23 24   (fontified t face     (rainbow-delimiters-depth-8-face)     wrap-prefix     #(&quot;      &quot; 0 5        (fontified t)))   24 25   (fontified t wrap-prefix     #(&quot;     &quot; 0 5        (fontified t)))   25 32   (fontified t wrap-prefix     #(&quot;       &quot; 0 7        (fontified t)))   32 33   (fontified t face     (rainbow-delimiters-depth-8-face)     wrap-prefix     #(&quot;          &quot; 0 7        (fontified t)))   33 40   (fontified t wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   40 41   (fontified t face     (rainbow-delimiters-depth-9-face)     wrap-prefix     #(&quot;          &quot; 0 7        (fontified t)))   41 61   (fontified t wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   61 62   (fontified t face     (rainbow-delimiters-depth-9-face)     wrap-prefix     #(&quot;          &quot; 0 7        (fontified t)))   62 63   (fontified t wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   63 64   (fontified t face     (rainbow-delimiters-depth-9-face)     wrap-prefix     #(&quot;          &quot; 0 7        (fontified t)))   64 78   (fontified t wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   78 79   (fontified t face     (rainbow-delimiters-depth-9-face)     wrap-prefix     #(&quot;          &quot; 0 7        (fontified t)))   79 80   (fontified t face     (rainbow-delimiters-depth-8-face)     wrap-prefix     #(&quot;          &quot; 0 7        (fontified t)))   80 81   (fontified t wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   81 88   (fontified t wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   88 89   (fontified t face     (rainbow-delimiters-depth-8-face)     wrap-prefix     #(&quot;          &quot; 0 7        (fontified t)))   89 99   (fontified t wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   99 100   (fontified t face     (rainbow-delimiters-depth-8-face)     wrap-prefix     #(&quot;         &quot; 0 7        (fontified t)))   100 101   (fontified t face     (rainbow-delimiters-depth-7-face)     wrap-prefix     #(&quot;        &quot; 0 7        (fontified t)))   101 102   (fontified t face     (rainbow-delimiters-depth-6-face)     wrap-prefix     #(&quot;        &quot; 0 7        (fontified t)))   102 103   (fontified t face     (rainbow-delimiters-depth-5-face)     wrap-prefix     #(&quot;        &quot; 0 7        (fontified t)))   103 104   (fontified t face     (rainbow-delimiters-depth-4-face)     wrap-prefix     #(&quot;        &quot; 0 7        (fontified t)))   104 105   (fontified t face     (rainbow-delimiters-depth-3-face)     wrap-prefix     #(&quot;        &quot; 0 7        (fontified t)))   105 106   (fontified t wrap-prefix     #(&quot;       &quot; 0 7        (fontified t)))   106 110   (fontified t wrap-prefix     #(&quot;    ;; &quot; 0 4        (fontified t)        4 7        (fontified t face font-lock-comment-delimiter-face)))   110 113   (fontified t face font-lock-comment-delimiter-face wrap-prefix     #(&quot;    ;; &quot; 0 4        (fontified t)        4 7        (fontified t face font-lock-comment-delimiter-face)))   113 175   (fontified t face font-lock-comment-face wrap-prefix     #(&quot;    ;; &quot; 0 4        (fontified t)        4 7        (fontified t face font-lock-comment-delimiter-face)))   175 179   (fontified t wrap-prefix     #(&quot;    ;; &quot; 0 4        (fontified t)        4 7        (fontified t face font-lock-comment-delimiter-face)))   179 182   (fontified t face font-lock-comment-delimiter-face wrap-prefix     #(&quot;    ;; &quot; 0 4        (fontified t)        4 7        (fontified t face font-lock-comment-delimiter-face)))   182 193   (fontified t face font-lock-comment-face wrap-prefix     #(&quot;    ;; &quot; 0 4        (fontified t)        4 7        (fontified t face font-lock-comment-delimiter-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In essence, text properties bloat my &lt;code&gt;~/.emacs.d/savehist&lt;/code&gt; by almost a factor of 100. I'm looking at ~30MB of kill ring. This is bad for all sorts of reasons. Not least because it makes emacs very slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell &lt;code&gt;savehist&lt;/code&gt; to strip text properties from the &lt;code&gt;kill-ring&lt;/code&gt; before saving, without deleting the properties for the current session?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-12-10T23:05:58.133" LastActivityDate="2015-12-10T23:05:58.133" Title="Strip text properties in savehist" Tags="|text-properties|saving|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4188" PostTypeId="2" ParentId="4175" CreationDate="2014-12-07T04:31:23.117" Score="8" Body="&lt;p&gt;You can use &lt;a href=&quot;http://clang.llvm.org/docs/ClangFormat.html&quot;&gt;ClangFormat&lt;/a&gt; to achieve this. After installing the &lt;code&gt;clang-format&lt;/code&gt; tool, you can use &lt;a href=&quot;https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format.el&quot;&gt;&lt;code&gt;clang-format.el&lt;/code&gt;&lt;/a&gt; to perform the appropriate actions from emacs. &lt;code&gt;clang-format.el&lt;/code&gt; is also available from &lt;a href=&quot;http://melpa.org/#/clang-format&quot;&gt;MELPA&lt;/a&gt;. The emacs commands provided are &lt;code&gt;clang-format-buffer&lt;/code&gt; and &lt;code&gt;clang-format-region&lt;/code&gt; which you can bind as you need. Note that you can customize formatting options by using a &lt;code&gt;.clang-format&lt;/code&gt; file located in an ancestor directory.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2014-12-07T04:31:23.117" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4189" PostTypeId="1" AcceptedAnswerId="4190" CreationDate="2014-12-07T04:47:26.050" Score="6" ViewCount="296" Body="&lt;p&gt;Is it possible to scroll the minibuffer history without using arrow keys?  My preference would be to not have my fingers leave the home row.&lt;/p&gt;&#xA;" OwnerUserId="2516" LastEditorUserId="50" LastEditDate="2015-03-28T23:51:57.643" LastActivityDate="2015-03-28T23:51:57.643" Title="Access minibuffer history without using arrow keys" Tags="|key-bindings|minibuffer|history|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4190" PostTypeId="2" ParentId="4189" CreationDate="2014-12-07T05:15:42.220" Score="13" Body="&lt;p&gt;From &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-History.html#Minibuffer-History&quot;&gt;the manual&lt;/a&gt;, &lt;code&gt;M-p&lt;/code&gt; moves to the previous item, and &lt;code&gt;M-n&lt;/code&gt; moves to the next.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-12-07T05:15:42.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4191" PostTypeId="2" ParentId="4187" CreationDate="2014-12-07T10:50:20.683" Score="15" Body="&lt;p&gt;Add the following to your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun unpropertize-kill-ring ()&#xA;  (setq kill-ring (mapcar 'substring-no-properties kill-ring)))&#xA;&#xA;(add-hook 'kill-emacs-hook 'unpropertize-kill-ring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;How it works&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;substring-no-properties&lt;/code&gt; removes any text properties from a given string. &lt;code&gt;kill-ring&lt;/code&gt; is a list of strings; we're using &lt;code&gt;mapcar&lt;/code&gt; to apply &lt;code&gt;substring-no-properties&lt;/code&gt; to each string that is currently in the kill ring. The result of the &lt;code&gt;mapcar&lt;/code&gt; call (i.e., a list of strings without any text properties) is used to override the original value of &lt;code&gt;kill-ring&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;savehist-mode&lt;/code&gt; saves the minibuffer history and any additional variables in &lt;code&gt;savehist-additional-variables&lt;/code&gt; when you quit Emacs. So in the last line we simply tell Emacs to &quot;unpropertize&quot; the kill ring on quit. Note that this happens before &lt;code&gt;savehist&lt;/code&gt; does its thing because &lt;code&gt;add-hook&lt;/code&gt; &lt;em&gt;prepends&lt;/em&gt; functions by default, so &lt;code&gt;unpropertize-kill-ring&lt;/code&gt; will be called before &lt;code&gt;savehist-autosave&lt;/code&gt; (which is the actual function that gets executed when you quit Emacs).&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-12-27T17:44:20.473" LastActivityDate="2014-12-27T17:44:20.473" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4193" PostTypeId="2" ParentId="4182" CreationDate="2014-12-07T11:00:31.887" Score="4" Body="&lt;p&gt;Finally figured this out. Make sure that the following line is present in the greasemonkey script which you inject:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// @include /^https?:///&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That will enable skewering of every site. Now do a refresh of the the&#xA;page. Now at the top right hand side of the window (firefox window)&#xA;there will be a red triangle. Press on that triangle to inject the&#xA;greasemonkey script. You will observe that the color will change from&#xA;red to green. Only now, you can start communicating from&#xA;&lt;code&gt;skewer-repl&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: Make sure that you scroll to the top of the page to find the red&#xA;triangle, the triangle doesn't move with scrollbar.&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="904" LastEditDate="2014-12-07T11:09:53.557" LastActivityDate="2014-12-07T11:09:53.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4194" PostTypeId="2" ParentId="2283" CreationDate="2014-12-07T11:49:58.867" Score="2" Body="&lt;p&gt;Maybe not satisfactorily, but this issue is on the Tramp wish list. Maybe it will be implemented some day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the discussion on the Emacs Devel ML &lt;a href=&quot;http://thread.gmane.org/gmane.emacs.devel/174131&quot; rel=&quot;nofollow&quot;&gt;http://thread.gmane.org/gmane.emacs.devel/174131&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2014-12-07T11:49:58.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4195" PostTypeId="1" AcceptedAnswerId="4196" CreationDate="2014-12-07T15:15:10.540" Score="2" ViewCount="1214" Body="&lt;p&gt;I have inserted the following code in my init file.  This code insert a space+\ (ie, &quot; \&quot;) when typing &lt;code&gt;\&lt;/code&gt; in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despite the fact that the function &lt;code&gt;ddd&lt;/code&gt; works without problem in any buffer, the shortcut &lt;code&gt;\&lt;/code&gt; doesn't work when the file is in LaTeX mode (AUCTeX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any solution to solve this problem, i.e. typing &lt;code&gt;\&lt;/code&gt; executes the function &lt;code&gt;ddd&lt;/code&gt;? The function &lt;code&gt;ddd&lt;/code&gt; is just an example, the same problem occurs for any function I bind to the backslash.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ddd ()&#xA;  &quot;Insert a dollar sign with a space in front.&quot;&#xA;  (interactive)&#xA;  (insert &quot; \\&quot;))&#xA;&#xA;(global-set-key (kbd &quot;\\&quot;) 'ddd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="253" LastEditDate="2014-12-07T15:23:37.380" LastActivityDate="2014-12-07T15:30:47.197" Title="How to define backslash as keybinding in AUCTeX" Tags="|key-bindings|auctex|latex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4196" PostTypeId="2" ParentId="4195" CreationDate="2014-12-07T15:23:00.590" Score="6" Body="&lt;p&gt;When using AUCTeX, &lt;code&gt;\&lt;/code&gt; is bound to &lt;code&gt;TeX-insert-backslash&lt;/code&gt; by default, which you can discover by entering &lt;code&gt;C-h k \&lt;/code&gt; (ie, &lt;code&gt;describe-key&lt;/code&gt;) when in a buffer in &lt;code&gt;latex-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to override &lt;code&gt;TeX-insert-backslash&lt;/code&gt; with &lt;code&gt;ddd&lt;/code&gt;, define the key in the &lt;code&gt;LaTeX-mode-map&lt;/code&gt; as such:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key LaTeX-mode-map (kbd &quot;\\&quot;) #'ddd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You need to bind this key &lt;em&gt;after&lt;/em&gt; loading AUCTeX so that Emacs knows about the keymap -- you could, for example, do an &lt;code&gt;eval-after-load&lt;/code&gt; to achieve this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;latex&quot;&#xA;  '(define-key LaTeX-mode-map (kbd &quot;\\&quot;) #'ddd))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-12-07T15:30:47.197" LastActivityDate="2014-12-07T15:30:47.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4197" PostTypeId="2" ParentId="4161" CreationDate="2014-12-07T15:54:50.903" Score="4" Body="&lt;h1&gt;How to Debug?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;It's tough to spot until you know what you're looking for, but in the middle of the stacktrace you see that the byte-compiled functions are calling &lt;code&gt;python-shell-completion-get-completions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can step through this function with &lt;code&gt;edebug&lt;/code&gt; to see what's happening, or you can appeal to divine inspiration to conclude that it ultimately sends the following to the IPython interpreter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;';'.join(get_ipython().Completer.all_completions('''import nump'''))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On my setup (Linux but with same Emacs, python, and IPython version numbers) this command yields an empty string.  Hence why you're seeing a &quot;No match&quot; message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So ... yay?  It doesn't look like there's any more debugging to do within Emacs.  Gotta figure out how to make that IPython completion command work, then adjust your configuration appropriately.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;How to Fix?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I haven't looked at Emacs, python, and IPython in a while.  I have the same configuration in my init file (I think the comments in &lt;code&gt;python.el&lt;/code&gt; used to tell you to do that) but as of 24.4 it looks like a lot of IPython support is built into the default config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, remove the completion-related &lt;code&gt;setq&lt;/code&gt; and you should be good to go.  Works for me, at least.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Side note: I think you can remove the prompt-related &lt;code&gt;setq&lt;/code&gt; as well.)&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-12-07T15:54:50.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4198" PostTypeId="1" AcceptedAnswerId="4199" CreationDate="2014-12-07T16:59:22.923" Score="9" ViewCount="2771" Body="&lt;pre&gt;&lt;code&gt;(mystery-function &quot;a neat\nstring\&quot;&quot;)&#xA;=&amp;gt; &quot;\&quot;a neat \\nstring\\\&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This question was asked on &lt;code&gt;freenode#emacs&lt;/code&gt; by user &lt;code&gt;dropdrive&lt;/code&gt;.  How could I write (or use) a function that takes a string literal and returns the string literal that, when &lt;code&gt;read&lt;/code&gt;, would return the original string?  That is,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((s (any-string)))&#xA;  (should (equal s (read (mystery-function s)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this &lt;code&gt;let&lt;/code&gt;-form is a bit misleading – the session at the very top of this question should be used for testing. Sorry for any confusion!&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-07T17:10:17.137" LastActivityDate="2014-12-11T22:18:19.950" Title="How can I turn a string into its literal representation?" Tags="|elisp|string|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4199" PostTypeId="2" ParentId="4198" CreationDate="2014-12-07T17:05:38.190" Score="19" Body="&lt;p&gt;You're looking for &lt;code&gt;prin1-to-string&lt;/code&gt;. Also, set &lt;code&gt;print-escape-newlines&lt;/code&gt; to a true value to get the &lt;code&gt;&quot;\n&quot;&lt;/code&gt; behavior you specified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((print-escape-newlines t))&#xA;  (prin1-to-string &quot;foo\nbar&quot;))&#xA;=&amp;gt; &quot;\&quot;foo\\nbar\&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2014-12-07T17:14:24.583" LastActivityDate="2014-12-07T17:14:24.583" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4200" PostTypeId="2" ParentId="4187" CreationDate="2014-12-07T18:24:50.817" Score="6" Body="&lt;p&gt;One simple solution is to use &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/savehist-20%2b.el&quot;&gt;&lt;code&gt;savehist-20.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a version of &lt;code&gt;savehist.el&lt;/code&gt; that works with all Emacs versions (20+). It automatically strips history elements of properties, and it does not save variables in &lt;code&gt;savehist-additional-variables&lt;/code&gt; whose values are propertized strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, you can read the file it saves even in an Emacs version (e.g. 20) that barfs on propertized strings.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-07T18:24:50.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4201" PostTypeId="1" AcceptedAnswerId="4202" CreationDate="2014-12-07T19:10:09.597" Score="3" ViewCount="196" Body="&lt;pre&gt;&lt;code&gt;(defun tmp:interactive (&amp;amp;optional scope pos-style)&#xA;  &quot;POS-STYLE has no effect when SCOPE is `directory'.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (cdr (assoc (read-char-choice&#xA;                 &quot;Copy (f)ull name, (d)irectory, or just the (b)asename? &quot;&#xA;                 '(?f ?d ?b))&#xA;                '((?f . full)&#xA;                  (?d . directory)&#xA;                  (?b . basename))))&#xA;    (when (and (not (equal scope 'directory)) current-prefix-arg)&#xA;      (cdr (assoc (read-char-choice&#xA;                   &quot;Style: (n)one, (l)ine, (c)olumn, or (p)oint? &quot;&#xA;                   '(?n ?l ?c ?p))&#xA;                  '((?n . nil)&#xA;                    (?l . line)&#xA;                    (?c . line-column)&#xA;                    (?p . point)))))))&#xA;  (message &quot;%S %S&quot; scope pos-style))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Above is a skeleton of a function that copies the appropriate file name for the current buffer.  However, it doesn't really make sense to include position information when the user is copying the directory name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to ignore a prefix argument within the &lt;code&gt;(interactive ...)&lt;/code&gt; form based on previous input?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(An alternative solution to this end would be to test &lt;code&gt;called-interactively-p&lt;/code&gt; and leave the optional argument as nil to test in the body of the &lt;code&gt;defun&lt;/code&gt;, but that's very fragmented.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2017-12-24T16:15:09.877" LastActivityDate="2017-12-24T16:15:09.877" Title="Can I accept a prefix argument based on another argument within an `(interactive ...)` form?" Tags="|elisp|interactive|prefix-argument|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4202" PostTypeId="2" ParentId="4201" CreationDate="2014-12-07T19:17:27.113" Score="3" Body="&lt;p&gt;You cannot refer to &lt;code&gt;SCOPE&lt;/code&gt; within the &lt;code&gt;interactive&lt;/code&gt; form, because it is that form that defines &lt;code&gt;SCOPE&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do is use &lt;code&gt;let&lt;/code&gt; to save the result of &lt;code&gt;read-char-choice&lt;/code&gt; and then test that in the rest of the &lt;code&gt;interactive&lt;/code&gt; spec.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun tmp:interactive (&amp;amp;optional scope pos-style)&#xA;  &quot;POS-STYLE has no effect when SCOPE is `directory'.&quot;&#xA;  (interactive&#xA;   (let ((scop  (cdr (assoc (read-char-choice&#xA;                             &quot;Copy (f)ull name, (d)irectory, or just the (b)asename? &quot;&#xA;                             '(?f ?d ?b))&#xA;                            '((?f . full)&#xA;                              (?d . directory)&#xA;                              (?b . basename))))))&#xA;&#xA;     (list scop (and (not (equal scop 'directory))&#xA;                     current-prefix-arg&#xA;                     (cdr (assoc (read-char-choice&#xA;                                  &quot;Style: (n)one, (l)ine, (c)olumn, or (p)oint? &quot;&#xA;                                  '(?n ?l ?c ?p))&#xA;                                 '((?n . nil)&#xA;                                   (?l . line)&#xA;                                   (?c . line-column)&#xA;                                   (?p . point))))))))&#xA;  (message &quot;%S %S&quot; scope pos-style))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:36:05.697" LastActivityDate="2015-05-09T20:36:05.697" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="4203" PostTypeId="1" AcceptedAnswerId="4207" CreationDate="2014-12-07T19:37:56.957" Score="5" ViewCount="282" Body="&lt;p&gt;I'm trying to find which map &lt;code&gt;C-c C-x&lt;/code&gt; is bound to on my system, but &lt;code&gt;C-c C-x C-h&lt;/code&gt; reveals &lt;em&gt;nothing&lt;/em&gt;.  &lt;code&gt;(describe-key (kbd &quot;C-c C-x&quot;))&lt;/code&gt; reports that the sequence is unbound, yet I can still type &lt;code&gt;C-c C-x&lt;/code&gt; and Emacs awaits more input (as if it were waiting for another key in the sequence).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's going on?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-08T13:22:17.900" LastActivityDate="2014-12-08T19:14:22.063" Title="Why does C-c C-x look like an empty keymap?" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4204" PostTypeId="1" AcceptedAnswerId="4216" CreationDate="2014-12-07T19:55:52.417" Score="22" ViewCount="836" Body="&lt;p&gt;Now that Emacs is maintained in a &lt;code&gt;git&lt;/code&gt; repository (AFAIK), this opens the door (at least for me) to intelligently explore Emacs as a F/OSS project to contribute to :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trouble is, I have &lt;em&gt;no&lt;/em&gt; idea how to start doing so.  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Contributing.html&quot;&gt;&lt;code&gt;CONTRIBUTING&lt;/code&gt;&lt;/a&gt; instructs the developer to mail &lt;code&gt;emacs-devel&lt;/code&gt;, but there are surely steps that are common to all contributors.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-12-08T09:49:33.737" Title="What steps are necessary to start contributing to Emacs proper?" Tags="|emacs-development|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4205" PostTypeId="1" AcceptedAnswerId="4206" CreationDate="2014-12-07T20:11:05.533" Score="6" ViewCount="1665" Body="&lt;p&gt;I am trying to get a list of buffers through elisp. So I created the following function:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(mapcar (function buffer-name) (buffer-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This works when I do something like:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(minibuffer-message (mapcar (function buffer-name) (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;However, the following line of code does not work:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(insert (mapcar (function buffer-name) (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Could this just be a noob mistake? Is there a better way of doing it?&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="37922" LastEditDate="2024-03-19T16:48:52.277" LastActivityDate="2024-03-19T16:53:01.930" Title="How to get a list of all the buffers in elisp?" Tags="|elisp|buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="4206" PostTypeId="2" ParentId="4205" CreationDate="2014-12-07T20:14:00.487" Score="9" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Insertion.html#Insertion&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;insert&lt;/code&gt;&lt;/a&gt; takes an arbitrary number of strings or characters as arguments, so it bails when you hand it a list of strings.&lt;/p&gt;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(insert (mapconcat (function buffer-name) (buffer-list) &amp;quot; &amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(apply #'insert (mapcar (function buffer-name) (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="37922" LastEditDate="2024-03-19T16:53:01.930" LastActivityDate="2024-03-19T16:53:01.930" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="4207" PostTypeId="2" ParentId="4203" CreationDate="2014-12-07T20:49:50.370" Score="7" Body="&lt;p&gt;Indeed, interactively &lt;code&gt;C-h k&lt;/code&gt; can't be used if you're trying to find where a prefix map is defined.  And even the question itself may be somewhat meaningless in the sense that it can be defined at various places at the same time (Typically the &lt;code&gt;C-c&lt;/code&gt; prefix is bound to a keymap which is a dynamically-computed combination of various keymaps, e.g. from the major-mode and from various minor modes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can still do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (describe-key [?\C-c ?\C-x]) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which should tell you (in a recent enough Emacs, and in the case where all bindings in this prefix come from a single keymap) which keymap defines this prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;C-c C-x&lt;/code&gt; might wait for more input as if it were a prefix even if it isn't.  This is because determining &quot;the end of a key-sequence&quot; is quite tricky: while there's no binding for C-c C-x maybe what you're trying to see is if there's a binding for C-c é and you're doing that by hitting C-c C-x 8 ' e, so after the C-x Emacs keeps waiting for more input to figure out what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to investigate key prefixes is with &lt;code&gt;C-h&lt;/code&gt;, so you'd do &lt;code&gt;C-c C-x C-h&lt;/code&gt; and it should show you the bindings available in &lt;code&gt;C-c C-x&lt;/code&gt;.  Sadly in this case it only shows you the &quot;normal&quot; bindings and not the key-remapping bindings, so it won't explain why Emacs is waiting.  This probably deserves a feature request via &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;, so that &lt;code&gt;C-c C-x C-h&lt;/code&gt; shows that it can be followed by &lt;code&gt;8 ' e&lt;/code&gt; and things like that.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2014-12-08T19:14:22.063" LastActivityDate="2014-12-08T19:14:22.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4208" PostTypeId="1" CreationDate="2014-12-08T00:15:48.097" Score="7" ViewCount="825" Body="&lt;p&gt;When using the newly added ruby formatting functionality I face the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really like for my rspec code to be formatted like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;it do&#xA;  is_expected.to match(/\[Error\]/)&#xA;    .and match(/#{result}/)&#xA;    .and match(/-+$/)&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what I get when having &lt;code&gt;ruby-use-smie&lt;/code&gt; set to nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have the variable &lt;code&gt;ruby-use-smie&lt;/code&gt; set to &lt;code&gt;non-nil&lt;/code&gt; however, the code gets formatted like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;it do&#xA;  is_expected.to match(/\[Error\]/)&#xA;                  .and match(/#{result}/)&#xA;                        .and match(/-+$/)&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have fiddled with the following variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ruby-align-chained-calls&#xA;ruby-align-to-stmt-keywords&#xA;ruby-deep-indent-paren&#xA;ruby-deep-indent-paren-style&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And yet have not found a way to have the desired formatting when using &lt;code&gt;ruby-smie&lt;/code&gt;. I'm really in &lt;strong&gt;love&lt;/strong&gt; with the s-expression navigation functionality provided by smie.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing some configuration ? Is it impossible for me to achieve the first form while using ruby smie?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="184" LastEditDate="2014-12-16T09:43:40.190" LastActivityDate="2024-04-04T10:07:05.840" Title="Do not align nested calls when using ruby-smie" Tags="|indentation|ruby-mode|smie|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4209" PostTypeId="1" AcceptedAnswerId="4250" CreationDate="2014-12-08T01:16:06.813" Score="7" ViewCount="1242" Body="&lt;p&gt;Is there a way to auto-complete email addresses in the mu4e compose window using Ido or Helm rather than the standard *Completions* buffer?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="45" LastEditDate="2014-12-08T02:39:29.347" LastActivityDate="2014-12-11T17:54:30.250" Title="Using ido or helm to auto complete email addresses in mu4e" Tags="|helm|completion|ido|email|mu4e|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4210" PostTypeId="2" ParentId="801" CreationDate="2014-12-08T01:45:15.940" Score="9" Body="&lt;p&gt;I've had great success with &lt;a href=&quot;https://github.com/Andersbakken/rtags&quot;&gt;RTags&lt;/a&gt; + &lt;a href=&quot;https://github.com/company-mode/company-mode&quot;&gt;Company&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;RTags needs a separate daemon &lt;code&gt;rdm&lt;/code&gt; running that uses clang for code-completion, code-navigation and refactoring. &lt;code&gt;rdm&lt;/code&gt; also functions as a database of symbols, meaning that autocompletion is much faster than any solution just directly calling &lt;code&gt;clang_codeCompleteAt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rdm needs info of compilation flags for your projects which can be a hassle, but if you follow the advice from the &lt;a href=&quot;https://github.com/Andersbakken/rtags&quot;&gt;RTags&lt;/a&gt; page and symlink &lt;code&gt;gcc-rtags-wrapper.sh&lt;/code&gt; to &lt;code&gt;gcc&lt;/code&gt;, &lt;code&gt;g++&lt;/code&gt;, &lt;code&gt;cc&lt;/code&gt; and &lt;code&gt;c++&lt;/code&gt; rdm automatically gets updated with new compilation flags on recompile. &lt;/p&gt;&#xA;" OwnerUserId="450" LastEditorUserId="450" LastEditDate="2014-12-08T01:50:17.130" LastActivityDate="2014-12-08T01:50:17.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4211" PostTypeId="2" ParentId="4209" CreationDate="2014-12-08T02:09:13.113" Score="0" Body="&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: I don't use mu4e anymore, so this is not a copy/paste or tested answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function  &lt;code&gt;mu4e~compose-complete-contact&lt;/code&gt; seems to provide a list of contacts available for completion : &#xA;&lt;a href=&quot;https://github.com/djcb/mu/blob/master/mu4e/mu4e-compose.el#L236&quot; rel=&quot;nofollow&quot;&gt;https://github.com/djcb/mu/blob/master/mu4e/mu4e-compose.el#L236&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could just feed the list to &lt;code&gt;ido-completing-read&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ido-completing-read &quot;Complete contact: &quot; (mu4e~compose-complete-contact)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="943" LastActivityDate="2014-12-08T02:09:13.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4212" PostTypeId="1" CreationDate="2014-12-08T05:00:04.117" Score="5" ViewCount="2205" Body="&lt;p&gt;I got the not terribly helpful error message recently trying to connect &lt;code&gt;emacsclient&lt;/code&gt; to a emacs daemon using tcp sockets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacsclient: error accessing server file &quot;server&quot;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the source, its not obvious what is going wrong - &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lib-src/emacsclient.c?h=emacs-24#n1356&quot; rel=&quot;noreferrer&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/tree/lib-src/emacsclient.c?h=emacs-24#n1356&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I tried to recompile emacs and attach a gdb, but I didn't have much luck with that)&lt;/p&gt;&#xA;" OwnerUserId="2813" LastActivityDate="2015-01-26T17:51:34.530" Title="Debugging - emacsclient: error accessing server file &quot;server&quot;" Tags="|emacsclient|daemon|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4213" PostTypeId="1" CreationDate="2014-12-08T05:10:58.137" Score="10" ViewCount="1766" Body="&lt;p&gt;I'm having trouble walking through emacs source code in gdb.  I think I'm missing debug symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following a suggestion from &lt;a href=&quot;https://stackoverflow.com/a/4298982/2752242&quot;&gt;https://stackoverflow.com/a/4298982/2752242&lt;/a&gt;, I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;./configure CFLAGS=&quot;-ggdb3 -O0&quot; CXXFLAGS=&quot;-ggdb3 -O0&quot; LDFLAGS=&quot;-ggdb3&quot; --with-gif=no --prefix=$HOME/local/apps/emacs-24.4/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, that didn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there instructions on compiling with debug symbols?  Thanks!&lt;/p&gt;&#xA;" OwnerUserId="2813" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-04-08T19:40:20.570" Title="How to compile emacs with debug symbols?" Tags="|debugging|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4214" PostTypeId="1" AcceptedAnswerId="4215" CreationDate="2014-12-08T09:34:55.350" Score="5" ViewCount="1663" Body="&lt;p&gt;I think the best way to explain what I'm trying to do is using an example. Suppose one would want to replace all underlined words with italic ones in org-mode using a regular expression:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_example_ --&amp;gt; /example/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using Perl regex, one could easily accomplish such a task with the grouping variables &lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt;, etc... using the expression &lt;code&gt;s/_([^_]+)_/\/$1\//g&lt;/code&gt; for this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there similar &quot;grouping variables&quot; in Emacs? If not, then what is the most efficient way to perform such a replacement operation?&lt;/p&gt;&#xA;" OwnerUserId="969" LastActivityDate="2014-12-08T18:03:19.923" Title="How to save part of a regular expression during search and replace?" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4215" PostTypeId="2" ParentId="4214" CreationDate="2014-12-08T09:39:24.923" Score="10" Body="&lt;p&gt;Use &lt;code&gt;\(...\)&lt;/code&gt;for grouping and &lt;code&gt;\1&lt;/code&gt; to reference the first saved group (&lt;code&gt;\2&lt;/code&gt; for the second, all the way up to &lt;code&gt;\9&lt;/code&gt;). E.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;query-replace-regexp&lt;/code&gt;: &lt;code&gt;_\([^_]+\)_&lt;/code&gt; into &lt;code&gt;/\1/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html#Regexp-Backslash&quot; rel=&quot;noreferrer&quot;&gt;Regexp Backslash&lt;/a&gt; in the Emacs Lisp Manual for more.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2355" LastEditDate="2014-12-08T18:03:19.923" LastActivityDate="2014-12-08T18:03:19.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4216" PostTypeId="2" ParentId="4204" CreationDate="2014-12-08T09:49:33.737" Score="16" Body="&lt;p&gt;There are no steps that you need to take yourself prior to actually contributing.  Just go ahead and start.  Pick a bug, or a feature, that you'd like to have implemented, and do it.  If you go for a larger feature, it's a good idea to ask emacs-devel first, though, since there might be objections to your intended design or interface, and you better collect feedback before writing a thousand lines of code :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are done, or if you are at a point where you'd like some feedback about your changes, mail a patch to the bug report (if there is one), or to emacs-devel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's your first contribution below the cumulative 15 line limit, and if there are no technical objections, you'll find your change merged quite fast.  Emacs lacks man-power, and is glad for any contribution it gets.  I got my first simple patch merged within a day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are over the 15 line limit, you'll be asked for copyright assignments.  There is nothing that you need to do in advance, though:  You'll be guided through the process.  Note that copyright assignments are &lt;strong&gt;mandatory&lt;/strong&gt;:  If you refuse to sign, you are barred from contributing to Emacs.  Even if your patch is technically perfect, it won't be merged for legal and political reasons.  Hence, I never contributed a second patch:  I don't want to sign any assignment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have signed one, and completed the process, you can however just continue to contribute as before, and at some point, if you make continuous contributions to Emacs, you'll eventually be given write access to the repository.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-08T09:49:33.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4217" PostTypeId="1" CreationDate="2014-12-08T13:26:06.763" Score="12" ViewCount="882" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How do I insert/modify text in a buffer without &lt;code&gt;undo&lt;/code&gt; noticing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the use case.  I have a comment block at the start of every file that, among other things, updates a timestamp for the most recent change to a file.  I'd like to be able to modify that timestamp without the &lt;code&gt;undo&lt;/code&gt; facilities noticing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I want to short-circuit &lt;code&gt;undo&lt;/code&gt; here is due to the following edge case, which comes up when editing/compiling LaTeX documents (and probably others, but this is the one that drives me nuts most frequently):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make a small change to the file to see how it will affect the compiled doc&lt;/li&gt;&#xA;&lt;li&gt;Save the file (which updates the timestamp)&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;latex&lt;/code&gt; on the file&lt;/li&gt;&#xA;&lt;li&gt;Decide that the change is a bad one&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;undo&lt;/code&gt; the changes&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The problem at step (5) (&lt;code&gt;undo&lt;/code&gt;) is that it does not undo the change made in step (1), but rather undoes the timestamp updating in step (2).  That wouldn't bother me (I could just &lt;code&gt;undo&lt;/code&gt; again) except that it also moves point all the way to the timestamp at the top of the file, which is almost always many, many lines away from the actual substantive change.  It's very jarring and completely breaks my concentration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pitching the question with respect to a file I'm visiting, but it's more generally about modifying buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;em&gt;how can I prevent &lt;code&gt;undo&lt;/code&gt; from noticing a specific modification to a buffer?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="25" LastEditDate="2014-12-25T00:38:29.073" LastActivityDate="2014-12-25T00:38:29.073" Title="How to modify a buffer without undo noticing?" Tags="|buffers|undo|buffer-modified|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4218" PostTypeId="1" AcceptedAnswerId="4224" CreationDate="2014-12-08T13:33:29.263" Score="6" ViewCount="312" Body="&lt;p&gt;Some of my projects are organised in way that the there isn't one make file at the top route of the project (git/svn/...) folder but I have several small Makefiles in subfolders of the project. Normally I use Projectile to save only files related to my current project and call the main Makefile but this doesn't work if the Makefiles are more distributed in the project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have a function that saves all open/unsaved files from the current folder and it's subfolder and then run the Makefile in the current folder.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun max/save-compile-current-folder ()&#xA;    (interactive)&#xA;    (max/save-current-and-subfolder-files ...)&#xA;    (compile t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I currently don't know how to write the function &lt;code&gt;max/save-current-and-subfolder-files&lt;/code&gt;. I would appreciate any hints how to write this function or links to libraries that already implement it.&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="50" LastEditDate="2014-12-11T01:35:05.370" LastActivityDate="2014-12-11T01:35:05.370" Title="Save all open files in current folder and subfolders" Tags="|files|saving|directories|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4219" PostTypeId="2" ParentId="4217" CreationDate="2014-12-08T13:58:28.970" Score="2" Body="&lt;p&gt;The problem with what you suggest is that the undo-tree is a list of deltas to get from where you are to where you want to be. While it is perfectly possible to disable undo tracking on a buffer I'm not sure what the effect of not actively recording changes would be. I currently have a toggle to turn undo on/off on a particular buffer as it doesn't make sense to have undo information on a growing log or refreshing page. However it nixes the changes on toggle:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-toggle-buffer-undo ()&#xA;  &quot;Toggle undo tracking in current buffer.&quot;&#xA;  (interactive)&#xA;  (with-current-buffer (current-buffer)&#xA;    (if (eq buffer-undo-list t)&#xA;        (setq buffer-undo-list nil)&#xA;      (buffer-disable-undo (current-buffer)))))&#xA;&#xA;(define-key my-toggle-map &quot;u&quot; 'my-toggle-buffer-undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;buffer-disable-undo&lt;/em&gt; actually just sets &lt;em&gt;buffer-undo-list&lt;/em&gt; to &lt;em&gt;nil&lt;/em&gt;. Maybe if you saved the state of &lt;em&gt;buffer-undo-list&lt;/em&gt; on you toggle you could restore it afterwards?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2014-12-08T13:58:28.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4220" PostTypeId="2" ParentId="2568" CreationDate="2014-12-08T14:00:37.060" Score="8" Body="&lt;p&gt;Try adding &lt;code&gt;(require 'iso-transl)&lt;/code&gt; to your &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="2504" LastActivityDate="2014-12-08T14:00:37.060" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4221" PostTypeId="1" CreationDate="2014-12-08T14:18:19.267" Score="12" ViewCount="902" Body="&lt;p&gt;I can't make Emacs remember the history for &lt;code&gt;*ielm*&lt;/code&gt; buffers between sessions.  As far as I can tell, such history is recorded in the buffer-local variable &lt;code&gt;comint-input-ring&lt;/code&gt;.  Therefore I have added the following expression to my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq desktop-locals-to-save&#xA;    (append desktop-locals-to-save&#xA;            '((comint-input-ring . 50))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't work.  I know that the &lt;code&gt;desktop&lt;/code&gt; package is working because Emacs remembers the global variables that I have added to &lt;code&gt;desktop-globals-to-save&lt;/code&gt; in my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: &lt;code&gt;savehist&lt;/code&gt; does not work either.  I suppose that is because &lt;code&gt;comint-input-ring&lt;/code&gt; is a buffer-local variable.&lt;/p&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="2763" LastEditDate="2014-12-08T18:13:02.710" LastActivityDate="2014-12-08T18:58:31.653" Title="Remembering history between sessions in Inferior Emacs Lisp Mode" Tags="|comint|desktop|history-variables|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4222" PostTypeId="2" ParentId="4217" CreationDate="2014-12-08T14:29:32.367" Score="6" Body="&lt;p&gt;@stsquad's answer got me on the right path.  Basically, the steps are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;save &lt;code&gt;buffer-undo-list&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;disable &lt;code&gt;undo&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;do your thing&lt;/li&gt;&#xA;&lt;li&gt;re-enable &lt;code&gt;undo&lt;/code&gt; and restore the &lt;code&gt;buffer-undo-list&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So here's a sketch of such a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun disable-undo-one-off ()&#xA;  (let ((undo buffer-undo-list))        ; save the undo list&#xA;    (buffer-disable-undo)               ; disable undo&#xA;    (do-some-stuff)                     ; do your thing&#xA;    (buffer-enable-undo)                ; re-enable undo&#xA;    (setq buffer-undo-list undo)))      ; restore the undo list&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; actually, it turns out that a simpler solution still is simply to &lt;code&gt;let&lt;/code&gt;-bind &lt;code&gt;buffer-undo-list&lt;/code&gt; so that changes to the list in the body of the &lt;code&gt;let&lt;/code&gt; get clobbered when the original list is restored:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun disable-undo-one-off ()&#xA;  (let (buffer-undo-list)&#xA;    (do-some-stuff)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main limitation with this is that it seems to work for modifications that do not change the number of characters in the buffer (eg, changing &quot;kittens&quot; to &quot;puppies&quot;, but not &quot;cats&quot;), because otherwise the rest of the undo list is now referring to the wrong points.  Hence, &lt;em&gt;this is only a partial solution&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-12-08T21:12:32.173" LastActivityDate="2014-12-08T21:12:32.173" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4223" PostTypeId="1" CreationDate="2014-12-08T14:30:59.177" Score="2" ViewCount="438" Body="&lt;p&gt;I've been having a really annoying bug when editing elisp files recently: dead keys do not work, but only when I am in Emacs-Lisp mode. If I type a key that is configured as a dead key (say, &lt;code&gt;'&lt;/code&gt;), I get a prompt that says &lt;code&gt;Emacs-Lisp:&lt;/code&gt; on my mini buffer. Then, typing any normal letter gives me the corresponding accented character (say, &lt;code&gt;á&lt;/code&gt;), but hitting &lt;code&gt;SPC&lt;/code&gt;, which &lt;em&gt;should&lt;/em&gt; give me the single quote character &lt;code&gt;'&lt;/code&gt;, does nothing instead. Deactivating Emacs-Lisp mode and going into fundamental mode solves the issue. Does anyone know how to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a disclaimer: some people (including myself) were affected a while ago by a &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2009-05/msg00167.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;seemingly similar issue&lt;/a&gt; that required them to explicitly require &lt;code&gt;iso-transl&lt;/code&gt; to get dead keys. I've already done this, and it did fix most of my problems with dead keys, but this weird issue in Emacs-Lisp mode appeared afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I don't require &lt;code&gt;iso-transl&lt;/code&gt; (or do &lt;code&gt;emacs -q&lt;/code&gt;) then the problem changes: I get undefined dead keys, just like I did before, but they don't bring up the &lt;code&gt;Emacs-Lisp:&lt;/code&gt; prompt on my mini buffer. If I do e.g. &lt;code&gt;C-h k &amp;lt;dead-acute&amp;gt;&lt;/code&gt;, then the &lt;code&gt;Emacs-Lisp:&lt;/code&gt; prompt comes up and no help gets shown, &lt;em&gt;except&lt;/em&gt; that if I try to type &lt;code&gt;&amp;lt;dead-acute&amp;gt;&lt;/code&gt; several times and then hit &lt;code&gt;C-g&lt;/code&gt; the following slightly different message pops up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;dead-acute&amp;gt; C-g (translated from &amp;lt;dead-acute&amp;gt; &amp;lt;dead-acute&amp;gt; &amp;lt;dead-acute&amp;gt; C-g) is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs 24.3.1 on Ubuntu 14.04. I &lt;em&gt;think&lt;/em&gt; before I had it compiled from source and it was giving me the same problem, but I can't quite remember.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do &lt;code&gt;(describe-key [dead-acute])&lt;/code&gt;, Emacs says that it is undefined. If I try &lt;a href=&quot;https://emacs.stackexchange.com/a/654/2504&quot;&gt;this trick&lt;/a&gt; to find where the key is bound, it still shows me the &lt;code&gt;Emacs-Lisp:&lt;/code&gt; prompt as above, except that if I hit &lt;code&gt;C-g&lt;/code&gt; right after I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;At Point: (nil nil nil nil)&#xA;Minor-mode: &#xA;Local: 1&#xA;Global: 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is different from the message it prints for &lt;code&gt;C-g&lt;/code&gt; on its own. If I try to do the same on a different mode, I need to press &lt;code&gt;SPC&lt;/code&gt; after &lt;code&gt;&amp;lt;dead-acute&amp;gt;&lt;/code&gt; to get an answer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;At Point: (nil nil nil nil)&#xA;Minor-mode: &#xA;Local: &#xA;Global: self-insert-command&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-13T16:41:44.747" Title="Dead keys not working in Emacs-Lisp mode *only*" Tags="|input-method|emacs-lisp-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4224" PostTypeId="2" ParentId="4218" CreationDate="2014-12-08T16:12:21.297" Score="4" Body="&lt;p&gt;I just added this feature to &lt;a href=&quot;https://github.com/abo-abo/helm-make&quot; rel=&quot;nofollow&quot;&gt;helm-make&lt;/a&gt;.&#xA;Give it a go and let me know if it works as you wanted, you&#xA;just need to set the custom:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-make-do-save t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the code that does it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when helm-make-do-save&#xA;  (let* ((regex (format &quot;^%s&quot; (regexp-quote default-directory)))&#xA;         (buffers&#xA;          (cl-remove-if-not&#xA;           (lambda (b)&#xA;             (let ((name (buffer-file-name b)))&#xA;               (and name&#xA;                    (string-match regex (expand-file-name name)))))&#xA;           (buffer-list))))&#xA;    (mapc&#xA;     (lambda (b)&#xA;       (with-current-buffer b&#xA;         (save-buffer)))&#xA;     buffers))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="25" LastEditDate="2014-12-11T01:20:36.077" LastActivityDate="2014-12-11T01:20:36.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4226" PostTypeId="2" ParentId="4221" CreationDate="2014-12-08T18:58:31.653" Score="9" Body="&lt;p&gt;You can save the buffer-local value of &lt;code&gt;comint-input-ring&lt;/code&gt; in a global variable when an &lt;code&gt;*ielm*&lt;/code&gt; buffer is killed and restore it in &lt;code&gt;inferior-emacs-lisp-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; global copy of the buffer-local variable&#xA;(defvar ielm-comint-input-ring nil)&#xA;&#xA;(defun set-ielm-comint-input-ring ()&#xA;  ;; create a buffer-local binding of kill-buffer-hook&#xA;  (make-local-variable 'kill-buffer-hook)&#xA;  ;; save the value of comint-input-ring when this buffer is killed&#xA;  (add-hook 'kill-buffer-hook #'save-ielm-comint-input-ring)&#xA;  ;; restore saved value (if available)&#xA;  (when ielm-comint-input-ring&#xA;    (message &quot;Restoring comint-input-ring...&quot;)&#xA;    (setq comint-input-ring ielm-comint-input-ring)))&#xA;&#xA;(defun save-ielm-comint-input-ring ()&#xA;  (message &quot;Saving comint-input-ring...&quot;)&#xA;  (setq ielm-comint-input-ring comint-input-ring))&#xA;&#xA;(require 'ielm)&#xA;(add-hook 'inferior-emacs-lisp-mode-hook #'set-ielm-comint-input-ring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you should be able to add &lt;code&gt;ielm-comint-input-ring&lt;/code&gt; to &lt;code&gt;savehist-additional-variables&lt;/code&gt; to get the behavior you want. (I tested this approach; you should be able to use &lt;code&gt;desktop-locals-to-save&lt;/code&gt; too, though.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-08T18:58:31.653" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4227" PostTypeId="1" CreationDate="2014-12-08T19:46:05.237" Score="4" ViewCount="307" Body="&lt;p&gt;&lt;code&gt;font-lock-mode&lt;/code&gt; sets font lock for the entire buffer -- normally to provide syntax highlighting.  Sometimes though, when I'm preparing a tutorial, I want to call attention out to certain lines.  It would be great if I could underline them (&lt;code&gt;M-o u&lt;/code&gt; with active region), but it has no effect with &lt;code&gt;font-lock-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use or emulate &lt;code&gt;M-o&lt;/code&gt; (&lt;code&gt;facemenu-keymap&lt;/code&gt;) with &lt;code&gt;font-lock-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-11-17T15:41:24.167" Title="How can I apply faces interactively under `font-lock-mode`?" Tags="|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4228" PostTypeId="2" ParentId="4227" CreationDate="2014-12-08T23:06:24.917" Score="5" Body="&lt;p&gt;Instead of the hack of using &lt;code&gt;font-lock-face&lt;/code&gt; (which also means no highlighting unless font-lock is turned on), you can just use library &lt;a href=&quot;https://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Highlight&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/highlight.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It lets you highlight arbitrary text in many ways, using either text properties or overlays, and its highlighting is &lt;em&gt;independent of font-lock highlighting&lt;/em&gt;. IOW, it gives you an easy way to keep font lock's hands off of your highlighting. You can even save such highlighting persistently, if you like.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="2370" LastEditDate="2017-11-17T15:41:24.167" LastActivityDate="2017-11-17T15:41:24.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4229" PostTypeId="1" AcceptedAnswerId="4233" CreationDate="2014-12-09T00:17:27.387" Score="8" ViewCount="1996" Body="&lt;p&gt;I would like to have whitespace mode turned on for all buffer except for org-mode ones.  It is easy to do this when emacs starts up, but since I use a persistant copy of emacs with emacs daemon mode I can't just do it that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'whitespace)&#xA;(setq whitespace-line-column 80)&#xA;(setq whitespace-style '(face lines-tail))&#xA;(global-whitespace-mode t)&#xA;(add-hook 'org-mode-hook&#xA;      (lambda ()&#xA;          (visual-line-mode 1)&#xA;          (auto-fill-mode -1)&#xA;          (setq whitespace-style nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but as soon as I visit an org-mode buffer all of my future buffers don't have whitespace mode any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought of adding a hook to turn whitespace mode on for other major-modes but that seems like a bad way to go since I don't want to enumerate all the other possible modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that there is whitespace-mode along with global-whitespace-mode, but I'm not sure how I can use that to help here either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some other way to accomplish this that I'm not thinking of?&lt;/p&gt;&#xA;" OwnerUserId="2824" LastEditorUserId="50" LastEditDate="2014-12-09T21:13:40.613" LastActivityDate="2014-12-09T21:13:40.613" Title="Only enable whitespace mode in certain buffers" Tags="|elisp|local-variables|whitespace-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4230" PostTypeId="1" AcceptedAnswerId="4231" CreationDate="2014-12-09T00:20:41.387" Score="6" ViewCount="631" Body="&lt;p&gt;I can highlight text like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;constant:'variable,variable'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with code like this which uses the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html#Search_002dbased-Fontification&quot; rel=&quot;noreferrer&quot;&gt;anchored matcher&lt;/a&gt; form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords&#xA; nil&#xA; '((&quot;\\(constant\\):'&quot; (1 font-lock-constant-face t)&#xA;    (&quot;\\(variable\\)[,']&quot; nil nil (1 font-lock-variable-name-face t))))&#xA; 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which works fine. The 'constant' and 'variable' parts are highlighted correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it fails on text like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;constant&lt;/em&gt;:'&lt;strong&gt;variable&lt;/strong&gt;,&lt;strong&gt;variable&lt;/strong&gt;' constant:'&lt;strong&gt;variable&lt;/strong&gt;,&lt;strong&gt;variable&lt;/strong&gt;' constant:''&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first 'constant' is correctly matched by the anchor, the first 2 'variable' are matched by the variable regexp, but then it rampages on to match the other 'variable's, so when the anchor regexp resumes it can't match the second 'constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I need to make the 'variable' matcher give up after it matches a closing quote. So I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-variable-search (limit)&#xA;  (if (save-excursion&#xA;        (re-search-backward &quot;variable'\'&quot; 0 'go))&#xA;      nil&#xA;    (re-search-forward &quot;\\(variable\\)[,']&quot; limit 'go)))&#xA;&#xA;(font-lock-add-keywords&#xA; nil&#xA; '((&quot;\\(constant\\):'&quot; (1 font-lock-constant-face t)&#xA;    (my-variable-search nil nil (1 font-lock-variable-name-face t))))&#xA; 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I completely off track or have I made a stupid mistake?&lt;/p&gt;&#xA;" OwnerUserId="2825" LastEditorUserId="2825" LastEditDate="2014-12-09T00:25:54.617" LastActivityDate="2014-12-09T00:44:36.677" Title="Function matcher with font-lock-keywords anchored highlighter" Tags="|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4231" PostTypeId="2" ParentId="4230" CreationDate="2014-12-09T00:37:33.307" Score="5" Body="&lt;p&gt;From &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html&quot; rel=&quot;noreferrer&quot;&gt;this in the documentation of &lt;code&gt;font-lock-keywords&lt;/code&gt;&lt;/a&gt;, it sounds like you could use the &lt;code&gt;PRE-MATCH-FORM&lt;/code&gt; to return the limit of the search for &quot;variable&quot;, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords nil&#xA;  '((&quot;\\(constant\\):'&quot; (1 font-lock-constant-face t)&#xA;     (&quot;\\(variable\\)[,']&quot;&#xA;      (save-excursion (search-forward-regexp &quot;\\(variable,\\)*variable'&quot;))&#xA;      nil&#xA;      (1 font-lock-variable-name-face t))))&#xA;  'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It sounds like it is acceptable for PRE-MATCH-FORM to modify match data, so &lt;code&gt;save-match-data&lt;/code&gt; is probably not necessary here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the relevant documentation quote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MATCH-ANCHORED should be of the form:&#xA;&#xA; (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...)&#xA;&#xA;where MATCHER is a regexp to search for or the function name to call to make&#xA;the search, as for MATCH-HIGHLIGHT above, but with one exception; see below.&#xA;PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after&#xA;the last, instance MATCH-ANCHORED's MATCHER is used.  Therefore they can be&#xA;used to initialize before, and cleanup after, MATCHER is used.  Typically,&#xA;PRE-MATCH-FORM is used to move to some position relative to the original&#xA;MATCHER, before starting with MATCH-ANCHORED's MATCHER.  POST-MATCH-FORM might&#xA;be used to move back, before resuming with MATCH-ANCHORED's parent's MATCHER.&#xA;&#xA;For example, an element of the form highlights (if not already highlighted):&#xA;&#xA; (&quot;\\&amp;lt;anchor\\&amp;gt;&quot; (0 anchor-face) (&quot;\\&amp;lt;item\\&amp;gt;&quot; nil nil (0 item-face)))&#xA;&#xA; discrete occurrences of &quot;anchor&quot; in the value of `anchor-face', and subsequent&#xA; discrete occurrences of &quot;item&quot; (on the same line) in the value of `item-face'.&#xA; (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil.  Therefore &quot;item&quot; is&#xA; initially searched for starting from the end of the match of &quot;anchor&quot;, and&#xA; searching for subsequent instances of &quot;anchor&quot; resumes from where searching&#xA; for &quot;item&quot; concluded.)&#xA;&#xA;The above-mentioned exception is as follows.  The limit of the MATCHER search&#xA;defaults to the end of the line after PRE-MATCH-FORM is evaluated.&#xA;However, if PRE-MATCH-FORM returns a position greater than the position after&#xA;PRE-MATCH-FORM is evaluated, that position is used as the limit of the search.&#xA;It is generally a bad idea to return a position greater than the end of the&#xA;line, i.e., cause the MATCHER search to span lines.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="875" LastEditorUserId="875" LastEditDate="2014-12-09T00:44:36.677" LastActivityDate="2014-12-09T00:44:36.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4232" PostTypeId="2" ParentId="4229" CreationDate="2014-12-09T00:52:27.187" Score="4" Body="&lt;p&gt;It is probably easier to turn off whitespace mode directly, using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (whitespace-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;code&gt;whitespace-style&lt;/code&gt; is not a buffer-local variable, so it is modified for all other buffers as well. Try instead&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'whitespace-style) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="875" LastActivityDate="2014-12-09T00:52:27.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4233" PostTypeId="2" ParentId="4229" CreationDate="2014-12-09T03:40:59.327" Score="20" Body="&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq whitespace-global-modes '(not org-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;whitespace-global-modes&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-12-09T03:40:59.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4234" PostTypeId="1" CreationDate="2014-12-09T03:58:33.950" Score="6" ViewCount="621" Body="&lt;p&gt;I got &lt;code&gt;~/.authinfo.gpg&lt;/code&gt; to store my multiple email accounts for &lt;code&gt;gnus&lt;/code&gt;, but if &lt;code&gt;~/.authinfo.gpg&lt;/code&gt; exists, the &lt;code&gt;tramp&lt;/code&gt; won't work. It will always say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Decrypting /home/chz/.authinfo.gpg...done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs won't even load the file into Emacs. If I remove that file, the &lt;code&gt;tramp&lt;/code&gt; will work fine and &lt;code&gt;gnus&lt;/code&gt; will not work as I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;tramp&lt;/code&gt; configuration is like &lt;a href=&quot;http://emacsredux.com/blog/2013/04/21/edit-files-as-root/&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; or &lt;a href=&quot;http://www.emacswiki.org/emacs/SudoSave&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt;(I've tried several versions, defun, defadvice, etc.), and the &lt;code&gt;~/.authinfo.gpg&lt;/code&gt; file contains lines of my emails accounts and &lt;code&gt;machine localhost port sudo login root password my-password&lt;/code&gt; suggested by &lt;a href=&quot;https://github.com/m00natic/m00natic.github.com/blob/master/org/emacs/emacs-wiki.org#dont-ask-for-sudo-or-ssh-passwords&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; to edit file as root.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even I don't use the &lt;code&gt;tramp&lt;/code&gt; configuration mentioned above, just use &lt;code&gt;C-x C-f /sudo::/etc/hosts&lt;/code&gt;, after I finished typing the second &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;Decrypting /home/chz/.authinfo.gpg...done&lt;/code&gt; will automatically exist in minibuffer and stuck  Emacs, then I have to &lt;code&gt;C-g&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I use edit-as-root and gnus at the same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use other ways other than ~/.authinfo.gpg to store account info for my multiple emails accounts so edit-as-root will work too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;===============================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After testing my init.el piece by piece, it turned out that the &lt;code&gt;which-function-mode&lt;/code&gt; and &lt;code&gt;projectile&lt;/code&gt; don't work with tramp very well, I have to disable them when using tramp.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2014-12-11T10:58:54.010" LastActivityDate="2014-12-11T10:58:54.010" Title="Cannot edit a file as root if ~/.authinfo.gpg file exists" Tags="|gnus|sudo|root|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4235" PostTypeId="2" ParentId="4217" CreationDate="2014-12-09T09:00:12.857" Score="5" Body="&lt;p&gt;An undo operation combines several elements from the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Undo.html#Undo&quot; rel=&quot;noreferrer&quot;&gt;undo list&lt;/a&gt;. A &lt;code&gt;nil&lt;/code&gt; entry in the list marks the boundary between two change groups. By removing the &lt;code&gt;nil&lt;/code&gt; at the start of the list which is automatically inserted by the toplevel loop¹, you can group the timestamp update with the last buffer change, which technically doesn't match your request but practically should solve the problem in your scenario.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun time-stamp-group-undo ()&#xA;  (if (eq nil (car buffer-undo-list))&#xA;      (setq buffer-undo-list (cdr buffer-undo-list)))&#xA;  (time-stamp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Warning: untested, the undo list might require more massaging.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also play with the undo list in a different way, by modifying the &lt;em&gt;position&lt;/em&gt; entry (an integer) for the timestamp update.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;¹ &lt;sub&gt; &lt;code&gt;self-insert-command&lt;/code&gt; does a similar removal to group insertions. &lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-12-09T09:00:12.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4237" PostTypeId="1" AcceptedAnswerId="4240" CreationDate="2014-12-09T11:42:53.730" Score="16" ViewCount="1481" Body="&lt;p&gt;Let's say I have two files &lt;code&gt;file1&lt;/code&gt; and &lt;code&gt;file2&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo aaa &amp;gt;file1&#xA;$ ln file1 file2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I check that the inodes are the same:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ls -i&#xA;18749779 file1  18749779 file2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which shows that the two files are actually the same. Now I edit &lt;code&gt;file1&lt;/code&gt; in Emacs, and add a line with for example the text &lt;code&gt;bbb&lt;/code&gt;, and save it and exit Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ls -i&#xA;18749781 file1  18749779 file2&#xA;$ cat file1&#xA;aaa&#xA;bbb&#xA;$ cat file2&#xA;aaa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the hard link is broken. Note that this does not happen when I edit the file in &lt;code&gt;vim&lt;/code&gt;, or if I simply do &lt;code&gt;echo bbb &amp;gt;&amp;gt;file1&lt;/code&gt;.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent Emacs from breaking hard links?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'backup-dir)&#xA;(setq bkup-backup-directory-info&#xA;      '((t  &quot;~/.emacs-backups/&quot; ok-create full-path )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;~/.emacs&lt;/code&gt; init file. If I edit &lt;code&gt;file1&lt;/code&gt; using &lt;code&gt;emacs -Q file1&lt;/code&gt; instead, I get a file called &lt;code&gt;file1~&lt;/code&gt; in the current directory that links to &lt;code&gt;file2&lt;/code&gt; (has the same inode) but the &lt;code&gt;file1~&lt;/code&gt; has not been modified (so it is identical to the old &lt;code&gt;file1&lt;/code&gt;).. This is not what I desire. I would like both &lt;code&gt;file1&lt;/code&gt; and &lt;code&gt;file2&lt;/code&gt; to be the same file, and to include the updated file contents..&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2014-12-09T12:03:06.017" LastActivityDate="2014-12-09T19:20:50.943" Title="How to prevent Emacs from breaking hard links?" Tags="|files|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4238" PostTypeId="1" AcceptedAnswerId="4263" CreationDate="2014-12-09T13:19:23.227" Score="3" ViewCount="242" Body="&lt;p&gt;Disclaimer: I'm using &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow&quot;&gt;Emacs Prelude&lt;/a&gt;, but I don't think this is a problem of that specific distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some time ago I discovered that pressing &lt;code&gt;M-S-up&lt;/code&gt; or &lt;code&gt;C-S-up&lt;/code&gt; with no selection just swaps the line above the current one and current one. The point stays on lower line and doesn't follow the moved line. It was not the case earlier, although I can't tell what broke it (maybe some update). The both sequences are bound to &lt;code&gt;move-text-up&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;move-text-down&lt;/code&gt; still works properly - moving unselected line and point both down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't modify my &lt;code&gt;move-text.el&lt;/code&gt;... Toggling &lt;code&gt;transient-mark-mode&lt;/code&gt; doesn't help either. I use &lt;code&gt;move-text-20140307.1644&lt;/code&gt; and GNU Emacs 24.4.1 which I built from sources myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I debug and fix the problem?..&lt;/p&gt;&#xA;" OwnerUserId="733" LastEditorUserId="105" LastEditDate="2015-03-27T20:39:53.790" LastActivityDate="2015-03-27T20:39:53.790" Title="Moving line with move-text-up doesn't move point" Tags="|text-editing|cycling|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4239" PostTypeId="1" AcceptedAnswerId="4261" CreationDate="2014-12-09T13:57:22.833" Score="9" ViewCount="1102" Body="&lt;p&gt;The first line of a plain-text file reads:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- eval: (auto-revert-tail-mode 1); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet Emacs does not enable &lt;code&gt;auto-revert-tail-mode&lt;/code&gt; after opening this file.  What is wrong?&lt;/p&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="25" LastEditDate="2014-12-10T22:33:29.717" LastActivityDate="2014-12-10T22:33:29.717" Title="Enabling a minor mode with a file-local variable prop line" Tags="|file-local-variables|minor-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4240" PostTypeId="2" ParentId="4237" CreationDate="2014-12-09T15:13:58.710" Score="14" Body="&lt;p&gt;@Hakon solved his own problem with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-by-copying t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you prefer to retain the default behaviour, and use &lt;code&gt;back-up-by-copying&lt;/code&gt; only for hard-linked files, you can use this instead (and leave &lt;code&gt;backup-by-copying&lt;/code&gt; set to &lt;code&gt;nil&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-by-copying-when-linked t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In addition, as pointed out by @Harald you can set &lt;code&gt;back-up-by-copying&lt;/code&gt; as a file-local variable instead, to turn on this feature only for individual files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The explanation of this behaviour from the Emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Copying.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Backup files can be made by copying the old file or by renaming it. This makes a difference when the old file has multiple names (hard links). If the old file is renamed into the backup file, then the alternate names become names for the backup file. If the old file is copied instead, then the alternate names remain names for the file that you are editing, and the contents accessed by those names will be the new contents.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the linked page for further discussion.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2014-12-09T19:20:50.943" LastActivityDate="2014-12-09T19:20:50.943" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4241" PostTypeId="2" ParentId="4213" CreationDate="2014-12-09T16:03:59.613" Score="5" Body="&lt;p&gt;I was able to get line numbers in gdb if I run the &lt;code&gt;emacsclient&lt;/code&gt; binary that is produced by make that lives in &lt;code&gt;emacs/lib-src&lt;/code&gt;.  If I do &lt;code&gt;make install&lt;/code&gt; and try to attach a debugger to the installed binary, no line numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what worked for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ CFLAGS=&quot;-ggdb3 -O0&quot; CXXFLAGS=&quot;-ggdb3 -O0&quot; LDFLAGS=&quot;-ggdb3&quot; ./configure --enable-checking --with-gif=no --prefix=$HOME/local/apps/emacs-24.4/&#xA;$ make&#xA;$ gdb lib-src/emacsclient&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ CFLAGS=&quot;-ggdb3 -O0&quot; CXXFLAGS=&quot;-ggdb3 -O0&quot; LDFLAGS=&quot;-ggdb3&quot; ./configure --enable-checking --with-gif=no --prefix=$HOME/local/apps/emacs-24.4/&#xA;$ make&#xA;$ make install&#xA;$ gdb $HOME/local/apps/emacs-24.4/bin/emacsclient&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2813" LastActivityDate="2014-12-09T16:03:59.613" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4243" PostTypeId="1" AcceptedAnswerId="4252" CreationDate="2014-12-09T17:05:59.137" Score="4" ViewCount="501" Body="&lt;p&gt;Something changed recently with Helm and now the matching order of helm-recentf has become less useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, in the latest version of Helm (just downloaded from Melpa) if the last visited file was &lt;code&gt;~/.emacs.d/&lt;strong&gt;ini&lt;/strong&gt;t.el&lt;/code&gt;, and in helm-recentf I type &quot;ini&quot;, the first matched file will be &lt;code&gt;~/b&lt;strong&gt;in&lt;/strong&gt;/un&lt;strong&gt;i&lt;/strong&gt;son&lt;/code&gt; (or some other file containing &quot;i&quot;, &quot;n&quot;, and &quot;i&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The logical first match should have been ~/.emacs.d/init.el, as this is the most recently visited file and it has the three letters I'm typing together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I go back to the previous (and correct) behavior?  I imagine that this could be achieved by disabling fuzzy matching in helm-recentf or by changing the scoring rule.  Is there an easy way to achieve any of this?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2014-12-10T04:32:11.753" Title="How to fix problem with fuzzy matching in helm-recentf" Tags="|helm|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4244" PostTypeId="1" CreationDate="2014-12-09T18:33:28.517" Score="4" ViewCount="320" Body="&lt;p&gt;Whenever &lt;code&gt;package&lt;/code&gt; updates a package in Emacs 24.4, and it asks me if I want to delete the previous version, it fails to do so even when I answer &lt;code&gt;y&lt;/code&gt;. It gives me the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Delete package `rich-minority-20140821.2020'? (y or n) y&#xA;Renaming&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to fix this?&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2015-03-11T16:59:07.447" Title="`package` does not delete old version on update" Tags="|package|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="4245" PostTypeId="2" ParentId="4142" CreationDate="2014-12-09T19:49:59.830" Score="4" Body="&lt;p&gt;You'll have to write the &lt;code&gt;wl-summary-line-age&lt;/code&gt; function yourself, but the way to add a new summary line format string, e.g. &lt;code&gt;%a&lt;/code&gt; is to use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wl-summary-line-age ()&#xA;  ... some magic with the wl-datevec variable (see wl-summary-line-year, etc.)&#xA;&#xA;(setq wl-summary-line-format-spec-alist&#xA;      (put-alist '?a&#xA;         '((wl-summary-line-age))&#xA;         wl-summary-line-format-spec-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="838" LastActivityDate="2014-12-09T19:49:59.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4247" PostTypeId="1" AcceptedAnswerId="4249" CreationDate="2014-12-09T21:24:31.237" Score="5" ViewCount="222" Body="&lt;p&gt;&lt;code&gt;paredit&lt;/code&gt; restricts my editing freedom to guarantee me that my s-expressions are never unbalanced.  Unfortunately, &lt;code&gt;hippie-expand&lt;/code&gt; doesn't care a bit about rules and manages to disturb the balance by expanding to syntactically wrong text (e.g. text containing a couple of parentheses more than would be appropriate in the current context).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cleaning up after the hippie is a chore; I have to disable &lt;code&gt;paredit&lt;/code&gt; temporarily to delete the superfluous parentheses and reenable it afterward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can the hippie be made aware of paredit's efforts to keep the buffer clean?  Is there an alternative expansion feature that is more well-behaved when paredit is around?  Or is there a way to make paredit (or something like it) clean up invalid expansions automatically?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2014-12-10T00:58:58.277" Title="hippie-expand disturbes paredit" Tags="|paredit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4248" PostTypeId="2" ParentId="4091" CreationDate="2014-12-09T23:51:39.330" Score="0" Body="&lt;p&gt;The solution that works starts off with the lines &lt;a href=&quot;https://emacs.stackexchange.com/users/2094/abo-abo&quot;&gt;abo-abo&lt;/a&gt; has given, that is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;downloading the SLIME package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~/git&#xA;git clone https://github.com/slime/slime&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and adding these to &lt;code&gt;~/.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/git/slime&quot;)&#xA;(require 'slime-autoloads)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and additionally add this line to &lt;code&gt;~/.emacs&lt;/code&gt;, assuming sbcl is installed into &lt;code&gt;/usr/local/bin&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inferior-lisp-program &quot;/usr/local/bin/sbcl&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you only do the above, you end up with an Emacs running SLIME on the background. To have the SLIME come to the foreground you should add these lines to &lt;code&gt;~/.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://franz.com/emacs/slime.lhtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;franz.com/emacs/slime.lhtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;slime&quot;&#xA;  '(progn&#xA;    (add-to-list 'load-path &quot;/usr/local/slime/contrib&quot;)&#xA;    (slime-setup '(slime-fancy slime-banner))&#xA;    (setq slime-complete-symbol*-fancy t)&#xA;    (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Having added those lines, restarted Emacs and entered &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;slime&lt;/code&gt; I finally got what I wanted:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ypRIq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ypRIq.png&quot; alt=&quot;Emacs Screenshot&quot;&gt;&lt;/a&gt;&lt;br&gt;&#xA;&lt;sub&gt;(source: &lt;a href=&quot;https://i.hizliresim.com/122VBj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;hizliresim.com&lt;/a&gt;)&lt;/sub&gt;  &lt;/p&gt;&#xA;" OwnerUserId="2784" LastEditorUserId="14920" LastEditDate="2019-02-16T17:24:21.687" LastActivityDate="2019-02-16T17:24:21.687" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="4249" PostTypeId="2" ParentId="4247" CreationDate="2014-12-10T00:58:58.277" Score="5" Body="&lt;p&gt;The problem you mentioned is why I remove the functions &lt;code&gt;try-expand-line&lt;/code&gt; and &lt;code&gt;try-expand-list&lt;/code&gt; from the list of functions &lt;code&gt;hippie-expand&lt;/code&gt; uses to produce expansions. This doesn't really solve the problem but may be an acceptable workaround.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (f '(try-expand-line try-expand-list))&#xA;  (setq hippie-expand-try-functions-list&#xA;        (remq f hippie-expand-try-functions-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;hippie-expand&lt;/code&gt; will still complete words, symbols, etc., but not full lines or lists - the things that are probably introducing excess delimiters.&lt;/p&gt;&#xA;" OwnerUserId="621" LastActivityDate="2014-12-10T00:58:58.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4250" PostTypeId="2" ParentId="4209" CreationDate="2014-12-10T01:13:04.737" Score="5" Body="&lt;p&gt;The variable &lt;code&gt;mu4e~contacts-for-completion&lt;/code&gt; stores a list of contacts that &lt;code&gt;mu4e&lt;/code&gt; knows about. The contacts are conveniently stored as &lt;code&gt;&quot;name &amp;lt;email&amp;gt;&quot;&lt;/code&gt; strings, which is the same thing you want to insert.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example function that uses the variable together with &lt;code&gt;ido&lt;/code&gt; to select and insert a contact:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun select-and-insert-contact ()&#xA;  (interactive)&#xA;  (insert (ido-completing-read &quot;Contact: &quot; mu4e~contacts-for-completion)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a more elaborate version which will use the partial contact before point (if any) as the initial input when completing. (Most of the code is directly from &lt;code&gt;mu4e~compose-complete-contact&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun select-and-insert-contact (&amp;amp;optional start)&#xA;  (interactive)&#xA;  (let ((mail-abbrev-mode-regexp mu4e~compose-address-fields-regexp)&#xA;        (eoh ;; end-of-headers&#xA;         (save-excursion&#xA;           (goto-char (point-min))&#xA;           (search-forward-regexp mail-header-separator nil t))))&#xA;    (when (and eoh (&amp;gt; eoh (point)) (mail-abbrev-in-expansion-header-p))&#xA;      (let* ((end (point))&#xA;             (start&#xA;              (or start&#xA;                  (save-excursion&#xA;                    (re-search-backward &quot;\\(\\`\\|[\n:,]\\)[ \t]*&quot;)&#xA;                    (goto-char (match-end 0))&#xA;                    (point))))&#xA;             (contact&#xA;              (ido-completing-read &quot;Contact: &quot;&#xA;                                   mu4e~contacts-for-completion&#xA;                                   nil&#xA;                                   nil&#xA;                                   (buffer-substring-no-properties start end))))&#xA;        (unless (equal contact &quot;&quot;)&#xA;          (kill-region start end)&#xA;          (insert contact))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="621" LastEditorUserId="621" LastEditDate="2014-12-11T17:54:30.250" LastActivityDate="2014-12-11T17:54:30.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4251" PostTypeId="2" ParentId="2861" CreationDate="2014-12-10T01:34:22.753" Score="9" Body="&lt;p&gt;A note about iOS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apple will certainly never let Emacs on the App Store, as it runs against everything Apple stands for. Here are some reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Apple does not allow users to run downloaded code (see &lt;a href=&quot;https://stackoverflow.com/questions/4891642/interpreter-for-the-iphone&quot;&gt;this&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This would kill all usage of &lt;code&gt;package.el&lt;/code&gt; which would be pretty bad, IMHO. Given that Emacs is basically a lisp VM, the chances of you running downloaded code is practically 100%.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Apple does not allow apps to modify arbitrary files.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You would need to create a little walled off garden for Emacs to play in, because it can't stray out of its sandbox.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Apple lacks an environment for Emacs to run in.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;By this, I mean the coreutils, compilers, interpreters, etc.. Emacs only gets really good when it has access to programs that understand the languages it supports. Say goodbye to syntax checkers, linters, spellcheckers, smart completion engines, and just about anything that exists outside of Emacs. In theory you could port these as well, but that's really not feasible without root, for a lot of reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The truth is that Emacs is just too powerful for Apple to condone. To do so would be to go against their philosophy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this changes with root. Jailbroken, we no longer have to listen to what Apple says, and unsurprisingly a Cydia Emacs does exist (although I can say little more about it).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On Android, point 3. still stands, but not very well because root is easy to get. The &lt;em&gt;best&lt;/em&gt; way is to just install Linux in a chroot (which is super easy, and detailed in another answer) and go on your merry way. That said there's no technical reason why a clever developer can't just build Emacs for Android again and put it on the app store, its just that nobody has. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose this is simply because few people are eager to use an entirely keyboard driven program that uses a ton of modifier keys on tablets with questionably high quality text input.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-07-15T00:17:06.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4252" PostTypeId="2" ParentId="4243" CreationDate="2014-12-10T04:32:11.753" Score="3" Body="&lt;p&gt;As answer by Helm maintainer in this &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/145&quot; rel=&quot;nofollow&quot;&gt;thread&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Fuzzy match against basename to match &quot;ini&quot; by either entering &quot; -b&quot;&#xA;after &quot;ini&quot; or by switching to basename with `C-]'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Adding a space after &quot;ini&quot; to make a regexp match (fall back to&#xA;matchplugin as soon a space is detected).&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-12-10T04:32:11.753" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4253" PostTypeId="1" AcceptedAnswerId="78739" CreationDate="2014-12-10T06:58:02.867" Score="76" ViewCount="42444" Body="&lt;p&gt;I'm working on a custom and small Emacs configuration that I want to share with some friends as a git repository for them to use as a baseline for their own future configurations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this I need some way to test my configuration and the simplest solution I can come up with is something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;$ emacs --eval &quot;(setq user-emacs-directory \&quot;~/Code/my_custom_emacs.d/\&quot;)&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't seem to make it work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="450" LastEditorUserId="450" LastEditDate="2014-12-10T07:13:05.477" LastActivityDate="2024-03-17T17:39:46.290" Title="How to start emacs with a custom user-emacs-directory" Tags="|init-file|" AnswerCount="14" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4254" PostTypeId="1" AcceptedAnswerId="4256" CreationDate="2014-12-10T07:09:46.590" Score="6" ViewCount="387" Body="&lt;p&gt;When, while executing an emacs-lisp function, point is at the beginning of a line, how can I check whether that line is part of a block comment, inside it, or starting it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stupid approach, that I am doing now, is to go to the first non-whitespace character and see if its face is &lt;code&gt;font-lock-comment-face&lt;/code&gt; or some such:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion&#xA;  (skip-syntax-forward &quot;\\s-&quot;)&#xA;  (let ((face (get-char-property (point) 'face)))&#xA;    (or (eq face 'font-lock-comment-face)&#xA;        (eq face 'font-lock-comment-delimiter-face)&#xA;        (eq face 'font-lock-doc-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this fails sometimes, because the function that invokes this might be run &lt;em&gt;before&lt;/em&gt; fontification is performed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some standard way of doing this? (Please include, if you can, a link to the emacs lisp manual section that I've missed.)&lt;/p&gt;&#xA;" OwnerUserId="875" LastActivityDate="2014-12-10T15:25:36.097" Title="Check whether a line is in the middle of a block comment?" Tags="|elisp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4255" PostTypeId="2" ParentId="4253" CreationDate="2014-12-10T07:29:41.677" Score="43" Body="&lt;p&gt;The basic approach I use for this is to modify &lt;code&gt;$HOME&lt;/code&gt;, by running:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;env HOME=/path/to/dir emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You then use &lt;code&gt;/path/to/dir/.emacs.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may wish to also symlink any files or directories of importance in this fake home dir back to the real ones, so that Emacs will see them.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-12-10T07:29:41.677" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4256" PostTypeId="2" ParentId="4254" CreationDate="2014-12-10T07:48:08.830" Score="8" Body="&lt;p&gt;As far as I know the standard way of checking if a point is within a comment is by calling &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Position-Parse.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;syntax-ppss&lt;/code&gt;&lt;/a&gt;. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Parser-State.html#Parser-State&quot; rel=&quot;nofollow&quot;&gt;Parser state&lt;/a&gt; for the meaning of its return value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nth 4 (syntax-ppss))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is not &lt;code&gt;nil&lt;/code&gt; when the point is in a comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To determine if this is a &lt;em&gt;block comment&lt;/em&gt;, try checking if the text at the beginning of the comment (position &lt;code&gt;(nth 8 (syntax-ppss))&lt;/code&gt;) matches a regular expression (for example by using &lt;code&gt;looking-at&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-10T15:25:36.097" LastActivityDate="2014-12-10T15:25:36.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4257" PostTypeId="2" ParentId="4253" CreationDate="2014-12-10T08:17:26.750" Score="4" Body="&lt;p&gt;Expanding on the answer from @phils I made this little shell script (called &lt;code&gt;testrun.sh&lt;/code&gt;) for testing out my new emacs config. This might make sense to do in other cases as well (for example when testing changes to your init.el that might break emacs).&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;&#xA;cd $(dirname &amp;quot;${BASH_SOURCE[0]}&amp;quot;)&#xA;[ -d .testrun ] || mkdir .testrun&#xA;cd .testrun&#xA;[ -h .emacs.d ] || ln -s .. .emacs.d&#xA;&#xA;env HOME=`pwd` emacs&#xA;&#xA;rm .emacs.d&#xA;cd ..&#xA;rm -rf .testrun&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;EDIT(2022-12-09):&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I don't know how well the above works, haven't used it for a long time.&lt;/li&gt;&#xA;&lt;li&gt;In Emacs 29 you can set &lt;code&gt;user-emacs-directory&lt;/code&gt; using &lt;code&gt;--init-directory&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;From the Changelog:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;* Startup Changes in Emacs 29.1&lt;/p&gt;&#xA;&lt;p&gt;+++&#xA;** Emacs now supports setting 'user-emacs-directory' via '--init-directory'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="450" LastEditorUserId="450" LastEditDate="2022-12-09T02:59:02.527" LastActivityDate="2022-12-09T02:59:02.527" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="4258" PostTypeId="2" ParentId="4253" CreationDate="2014-12-10T10:19:32.240" Score="53" Body="&lt;p&gt;The way I use to maintain several &lt;code&gt;.emacs.d&lt;/code&gt; directories in parallel is the following.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;emacs is started like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias emacs='emacs -q --load &quot;/path/to/init.el&quot;'&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Each &lt;code&gt;init.el&lt;/code&gt; file begins like this, to correctly set up the &lt;code&gt;user-init-file&lt;/code&gt; and &lt;code&gt;user-emacs-directory&lt;/code&gt; variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-init-file (or load-file-name (buffer-file-name)))&#xA;(setq user-emacs-directory (file-name-directory user-init-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have found this to work very reliably over the past months. Here are a few remarks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;it breaks &lt;code&gt;emacs-init-time&lt;/code&gt;, which only reports the time needed to load the default system configuration, but not your own init file. If you're interested in benchmarking your init time, you'll have to do it another way (see for example &lt;a href=&quot;https://emacs.stackexchange.com/q/539/221&quot;&gt;How do I measure performance of elisp code?&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it is not equivalent to a normal startup and you'll need to take care of a few specific points. In particular:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;after-init-hook&lt;/code&gt; is run &lt;em&gt;before&lt;/em&gt; the init file is loaded.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;*scratch*&lt;/code&gt; buffer is created &lt;em&gt;before&lt;/em&gt; the init file is loaded. You'll have to change its mode explicitly (instead of using &lt;code&gt;initial-major-mode&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;You'll need to explicitly call &lt;code&gt;package-initialize&lt;/code&gt;; it won't be done automatically&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the path to &lt;code&gt;init.el&lt;/code&gt; can be arbitrarily chosen; in particular, the directory in which &lt;code&gt;init.el&lt;/code&gt; resides doesn't have to be named &lt;code&gt;.emacs.d&lt;/code&gt;. I use this to have for example &lt;code&gt;.emacs.d.23&lt;/code&gt; alongside &lt;code&gt;.emacs.d.24&lt;/code&gt; in order to be able to switch between different versions of emacs (the system I'm using at work is passably outdated, and I can't install emacs 24 on all the machines I use).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;this workflow doesn't require modifying the environment (and especially the &lt;code&gt;HOME&lt;/code&gt; envvar), which can be desirable if you run programs from within emacs, which could be affected by the modified environment).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="221" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-12-11T08:00:01.647" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4260" PostTypeId="1" CreationDate="2014-12-10T11:58:58.337" Score="12" ViewCount="2101" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;noreferrer&quot;&gt;spacemacs&lt;/a&gt; with AUCTeX for LaTeX editing and would like to make &lt;a href=&quot;https://github.com/Fanael/rainbow-delimiters&quot; rel=&quot;noreferrer&quot;&gt;rainbow-delimiters&lt;/a&gt; and/or &lt;a href=&quot;https://github.com/istib/rainbow-blocks&quot; rel=&quot;noreferrer&quot;&gt;rainbow-blocks&lt;/a&gt; highlight LaTeX math equations. Unfortunately this only works partly, i.e., some equations get highlighted and some don't:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qrkza.png&quot; alt=&quot;Example: rainbow-delimiters&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example screenshot, in-line math enclosed in &lt;code&gt;$&lt;/code&gt; does not get highlighted while the rest - including in-line math enclosed in &lt;code&gt;\(...\)&lt;/code&gt; - does. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;rainbow-blocks&lt;/code&gt; it gets worse, as it will sometimes work in one place of the document and sometimes won't work regardless of scope.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SZA8n.png&quot; alt=&quot;Example: rainbow-blocks&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Does anyone know why this happens or how to get &lt;code&gt;rainbow-blocks&lt;/code&gt; working for in-line math in LaTeX? Are there any working alternatives?&lt;/p&gt;&#xA;" OwnerUserId="2837" LastEditorUserId="504" LastEditDate="2015-01-12T23:47:25.893" LastActivityDate="2024-01-04T06:26:31.250" Title="How to get rainbow-delimiters/rainbow-blocks to highlight in-line math in LaTeX equations" Tags="|latex|syntax-highlighting|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4261" PostTypeId="2" ParentId="4239" CreationDate="2014-12-10T13:38:52.023" Score="7" Body="&lt;p&gt;Take a look at the variables &lt;code&gt;enable-local-eval&lt;/code&gt; and &lt;code&gt;enable-local-variables&lt;/code&gt;. If you've changed one or both of these from their default values it could explain the behavior you are seeing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if &lt;code&gt;enable-local-eval&lt;/code&gt; is nil then that eval line in your file would be ignored. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-12-10T13:38:52.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4262" PostTypeId="1" CreationDate="2014-12-10T13:57:45.897" Score="1" ViewCount="253" Body="&lt;p&gt;I have &lt;code&gt;fill-column&lt;/code&gt; set to 75 by default and use &lt;code&gt;fill-paragraph&lt;/code&gt; to insert line breaks in the paragraphs of text that I write. On certain occasions though, I need to remove the line breaks but want to retain the spacing between the paragraphs. Up until now I used to set &lt;code&gt;fill-column&lt;/code&gt; to a very large number, then filled the entire selected region, and then went back to the default 75. Is there a better way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2839" LastEditorUserId="253" LastEditDate="2014-12-10T14:03:28.807" LastActivityDate="2014-12-10T14:03:28.807" Title="How to remove line breaks but retain paragraphs" Tags="|text-editing|fill-paragraph|line-break|" AnswerCount="0" CommentCount="1" ClosedDate="2014-12-10T14:07:49.817" ContentLicense="CC BY-SA 3.0" />
  <row Id="4263" PostTypeId="2" ParentId="4238" CreationDate="2014-12-10T14:34:00.787" Score="2" Body="&lt;p&gt;Here is a solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun move-text-internal (arg)&#xA;  (cond&#xA;   ((and mark-active transient-mark-mode)&#xA;    (let ((column (current-column))&#xA;          (pos (&amp;lt; (point) (mark)))&#xA;          (text (delete-and-extract-region (point) (mark))))&#xA;      (forward-line arg)&#xA;      (move-to-column column t)&#xA;      (set-mark (point))&#xA;      (insert text)&#xA;      (and pos (exchange-point-and-mark))&#xA;      (setq deactivate-mark nil)))&#xA;   (t&#xA;    (let ((column (current-column)))&#xA;      (beginning-of-line)&#xA;      (when (or (&amp;gt; arg 0) (not (bobp)))&#xA;        (forward-line)&#xA;        (when (or (&amp;lt; arg 0) (not (eobp)))&#xA;          (transpose-lines arg)&#xA;          ;; Account for changes to transpose-lines in Emacs 24.3&#xA;          (when (and (eval-when-compile&#xA;                       (not (version-list-&amp;lt;&#xA;                             (version-to-list emacs-version)&#xA;                             '(24 3 50 0))))&#xA;                     (&amp;lt; arg 0))&#xA;            (forward-line -1)))&#xA;        (forward-line -1))&#xA;      (move-to-column column t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;pos&lt;/code&gt; keeps track of where the point was to restore it. Another tricky behaviour (yet to solve) is when moving up the last line of a buffer...&lt;/p&gt;&#xA;" OwnerUserId="700" LastActivityDate="2014-12-10T14:34:00.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4264" PostTypeId="2" ParentId="3835" CreationDate="2014-12-10T14:57:11.563" Score="1" Body="&lt;p&gt;If you customize the variable &lt;code&gt;jabber-alert-muc-hooks&lt;/code&gt; (&lt;code&gt;M-x customize-option RET jabber-alert-muc-hooks&lt;/code&gt;), you'll see that most of the alerts come in pairs, one with &lt;code&gt;-personal&lt;/code&gt; appended, i.e. &lt;code&gt;jabber-muc-echo&lt;/code&gt; and &lt;code&gt;jabber-muc-echo-personal&lt;/code&gt;.  Disable &lt;code&gt;jabber-muc-echo&lt;/code&gt; and enable &lt;code&gt;jabber-muc-echo-personal&lt;/code&gt;, and you'll only see alerts when someone highlights you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Highlighting&quot; is defined as a message starting with your nick, followed by one of the symbols in &lt;code&gt;jabber-muc-looks-personalising-symbols&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-12-10T14:57:11.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4265" PostTypeId="1" AcceptedAnswerId="4266" CreationDate="2014-12-10T15:10:08.870" Score="8" ViewCount="1072" Body="&lt;p&gt;When executing the following I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun caller (func)&#xA;  (url-retrieve &quot;http://m0smith.freeshell.org/&quot;&#xA;   (lambda (status) (funcall func))))&#xA;&#xA;&#xA;(caller (lambda() (message &quot;called&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error in process filter: Symbol's value as variable is void: func&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the best way to solve this problem?  Basically I need to accept a callback from somewhere else, wrap it in another lambda and use that as the callback to url-retrieve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I change caller to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun caller (func)&#xA;  (url-retrieve &quot;http://m0smith.freeshell.org/&quot;&#xA;   `(lambda (status) (funcall ,func))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it works.  However, I cannot do this as func is being passed by flycheck and the macro expansion breaks it.  To see the full context of what I am doing: &lt;a href=&quot;https://gist.github.com/m0smith/b5961fda6afd71e82983&quot;&gt;https://gist.github.com/m0smith/b5961fda6afd71e82983&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="181" LastEditorUserId="181" LastEditDate="2014-12-10T15:16:36.830" LastActivityDate="2014-12-11T11:58:17.410" Title="'Symbol's value as variable is void' in callback from url-retrieve" Tags="|flycheck|lexical-scoping|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4266" PostTypeId="2" ParentId="4265" CreationDate="2014-12-10T15:20:15.423" Score="5" Body="&lt;p&gt;You can achieve this locally by using cl.el's &lt;em&gt;lexical-let&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile '(require 'cl))&#xA;&#xA;(defun my-test-caller (func)&#xA;  (lexical-let ((ext-func func))&#xA;    (url-retrieve &quot;http://www.google.com&quot;&#xA;                  (lambda (status) (funcall ext-func)))))&#xA;&#xA;(my-test-caller #'(lambda() (message &quot;called&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To be explicit as the help says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Like `let', but lexically scoped.&#xA;The main visible difference is that lambdas inside BODY will create&#xA;lexical closures as in Common Lisp.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can get the same effect by enabling &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html&quot; rel=&quot;nofollow&quot;&gt;lexical-binding&lt;/a&gt; which was added in Emacs 24.1. This is a buffer local variable that can be set and will enable lexical closures on &lt;strong&gt;all code&lt;/strong&gt; in the buffer. So your buffer would look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t; -*-&#xA;&#xA;(defun my-lexical-test-caller (func)&#xA;  (url-retrieve &quot;http://www.google.com&quot;&#xA;                (lambda (status) (funcall func))))&#xA;&#xA;(my-lexical-test-caller&#xA; #'(lambda()&#xA;     (message &quot;called from lexical-binding def&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-12-11T11:58:17.410" LastActivityDate="2014-12-11T11:58:17.410" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4267" PostTypeId="1" AcceptedAnswerId="50840" CreationDate="2014-12-10T15:28:03.960" Score="7" ViewCount="451" Body="&lt;p&gt;When collaborating on a project, certain editing variables are set to&#xA;make sure everyone is producing a similar style of code.  In Emacs,&#xA;these are usually implemented as either file-local variables or&#xA;directory-local variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;File-local variables are best when you want to keep the variable's&#xA;value attached to the file itself, but they get cumbersome when it is&#xA;the same variable over and over again for every file in the project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a directory-local variable would be the obvious choice, but I'm&#xA;personally using this to set the email I use in the project (as&#xA;opposed to my work email, etc.) to make sure I'm never inconsistent&#xA;with my commit data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way around this problem? Can I have two files holding&#xA;directory-local variables in the same directory (one personal file and&#xA;one version-controlled file)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer: &lt;a href=&quot;https://github.com/vermiculus/sx.el/commit/3a5afcc8225e52baaaba92c27d1d594eeb1cf729&quot;&gt;&lt;code&gt;sx.el@3a5afcc&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="50" LastEditDate="2014-12-10T18:32:42.617" LastActivityDate="2019-06-04T13:28:10.297" Title="How can I have a second .dir-locals?" Tags="|init-file|directories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4268" PostTypeId="1" AcceptedAnswerId="4269" CreationDate="2014-12-10T15:39:16.093" Score="6" ViewCount="499" Body="&lt;p&gt;I have a variable that I want to switch between two different values and have it apply for the whole session. I'm able to do this using &lt;code&gt;M-x customize-variable&lt;/code&gt; and picking &quot;Set for Current Session&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What functions is this calling? I'd love to be able to set a variable for the current session (NOT just for the current buffer, and NOT for future sessions) without using &lt;code&gt;customize&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="752" LastActivityDate="2018-05-03T23:20:18.623" Title="What does customize: Set for Current Session do?" Tags="|customize|variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4269" PostTypeId="2" ParentId="4268" CreationDate="2014-12-10T15:52:49.427" Score="7" Body="&lt;p&gt;Any change to the variable is equivalent here, so just &lt;code&gt;M-x set-variable&lt;/code&gt; or &lt;code&gt;(setq THE-VAR A-NEW-VALUE)&lt;/code&gt; is sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function called when you click &lt;code&gt;Set for Current Session&lt;/code&gt; is &lt;code&gt;custom-variable-set&lt;/code&gt;. (Well, actually it is more complicated - it boils down to calling either the value of &lt;code&gt;(get SYMBOL 'custom-set)&lt;/code&gt;, where &lt;code&gt;SYMBOL&lt;/code&gt; is the option symbol or function &lt;code&gt;set-default&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of using &lt;code&gt;Set for Current Session&lt;/code&gt; in the Customize UI is that you can use the Customize UI to edit the value - e.g., menus, completion, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the Customize UI there are thus two steps to changing a variable value:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Edit the value.&lt;/li&gt;&#xA;&lt;li&gt;Set for session.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you do not set the value (set for session) and you only edit it, then the variable value is not changed at all.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;UPDATE, per comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Customize, when editing the custom group, you can call function &lt;code&gt;custom-group-set&lt;/code&gt; on the widget for the group. In terms of existing keyboard key bindings, you can use &lt;code&gt;TAB&lt;/code&gt; to move to the &lt;code&gt;State&lt;/code&gt; button, then &lt;code&gt;RET&lt;/code&gt; to &quot;push&quot; the button. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you are shown a plain-text menu, with indications of number keys you can hit to choose one of the menu items. In this case, you hit &lt;code&gt;0&lt;/code&gt; to choose the &lt;code&gt;Set for Current Session&lt;/code&gt; action. IOW, you can use keyboard keybindings to set the edited changes for a group in Customize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other key bindings in Customize:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-c&lt;/code&gt; for &lt;code&gt;Custom-set/[Set for Current Session]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-s&lt;/code&gt; for &lt;code&gt;Custom-save/[Save for Future Sessions]&lt;/code&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-05-03T23:20:18.623" LastActivityDate="2018-05-03T23:20:18.623" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="4270" PostTypeId="2" ParentId="4265" CreationDate="2014-12-10T15:53:53.523" Score="5" Body="&lt;p&gt;Enable &lt;code&gt;lexical-binding&lt;/code&gt; for your library, with &lt;code&gt;M-x add-file-local-variable-prop-line RET lexical-binding RET t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please do not use &lt;code&gt;lexical-let&lt;/code&gt; as suggested by the other answer.  Flycheck itself is not compatible with Emacs 23, so there is no point in trying to maintain Emacs 23 compatibility in your own code.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-10T15:53:53.523" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4271" PostTypeId="1" AcceptedAnswerId="4274" CreationDate="2014-12-10T16:09:11.190" Score="19" ViewCount="4802" Body="&lt;p&gt;I often use multiple invocations of &lt;code&gt;forward-word&lt;/code&gt; followed by a single &lt;code&gt;backward-word&lt;/code&gt; to move point to the beginning of a word on a line.  I guess I never got used to the way &lt;code&gt;forward-word&lt;/code&gt; differs from vim's &lt;code&gt;w&lt;/code&gt; and even after years of using Emacs I cannot get used to the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a function I could use instead of &lt;code&gt;forward-word&lt;/code&gt; that doesn't jump over words but stops at the beginning of a word as well?  Are there other strategies to move to the beginning of a word when moving point forward that don't involve repeatedly executing &lt;code&gt;forward-char&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2019-08-28T22:09:06.243" Title="Stop at beginning of a word on `forward-word`" Tags="|motion|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4272" PostTypeId="2" ParentId="4271" CreationDate="2014-12-10T16:20:50.180" Score="4" Body="&#xA;&#xA;&lt;p&gt;You can bind the below function to &lt;code&gt;M-f&lt;/code&gt; and bind the original &lt;code&gt;forward-word&lt;/code&gt; to &lt;code&gt;M-F&lt;/code&gt;. This function simply takes the &lt;code&gt;arg&lt;/code&gt; and passes it on to the &lt;code&gt;forward-word&lt;/code&gt; function. So the universal arguments will work just as fine as with the original function.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/forward-word-begin (arg)&#xA;  &quot;Move forward a word and end up with the point being at the beginning of the&#xA;next word.  Move point forward ARG words (backward if ARG is negative).&#xA;If ARG is omitted or nil, move point forward one word.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (forward-word arg)&#xA;  (forward-word 1)&#xA;  (backward-word 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Word of caution though that the above function might not always &lt;strong&gt;do the right thing&lt;/strong&gt;; it's very much dependent on if the point is already on the beginning of a word or not.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's another way of implementing the above where the &lt;em&gt;word&lt;/em&gt; boundary is not as per the syntax table but strictly on whitespace separation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/forward-word-begin (arg)&#xA;  &quot;Move forward ARG (defaults to 1) number of words.&#xA;Here 'words' are defined as characters separated by whitespace.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (dotimes (_ arg)&#xA;    (forward-whitespace 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Credit goes to &lt;a href=&quot;https://emacs.stackexchange.com/a/26098/115&quot;&gt;&lt;strong&gt;@glucas&lt;/strong&gt;&lt;/a&gt; for this idea.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-08-05T15:15:52.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4273" PostTypeId="2" ParentId="4271" CreationDate="2014-12-10T16:24:59.453" Score="0" Body="&lt;p&gt;If you're willing to use &lt;code&gt;evil&lt;/code&gt;,  &lt;code&gt;w&lt;/code&gt; in normal state is bound to &lt;code&gt;evil-forward-word-begin&lt;/code&gt;, which is the Vim-style functionality you're after.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-10T16:24:59.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4274" PostTypeId="2" ParentId="4271" CreationDate="2014-12-10T16:26:39.613" Score="24" Body="&lt;p&gt;The &lt;code&gt;misc&lt;/code&gt; package (shipped with emacs) has the built-in function &lt;code&gt;forward-to-word&lt;/code&gt;, which does what I think you want: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;forward-to-word is an interactive compiled Lisp function in `misc.el'.&#xA;&#xA;It is bound to M-f.&#xA;&#xA;(forward-to-word ARG)&#xA;&#xA;Move forward until encountering the beginning of a word.&#xA;With argument, do this that many times.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use it, first add &lt;code&gt;(require 'misc)&lt;/code&gt; to your config file.&lt;/p&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="1980" LastEditDate="2014-12-10T16:32:02.110" LastActivityDate="2014-12-10T16:32:02.110" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4275" PostTypeId="2" ParentId="4268" CreationDate="2014-12-10T17:06:41.563" Score="3" Body="&lt;p&gt;One option is to use &lt;code&gt;customize-set-variable&lt;/code&gt;, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(customize-set-variable 'some-variable &quot;some value&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Variables set this way (after your custom file has been loaded) will be considered as unsaved customizations, just like variables &lt;code&gt;Set for Current Session&lt;/code&gt;. You can list unsaved customizations using &lt;code&gt;customize-unsaved&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-12-10T17:16:35.623" LastActivityDate="2014-12-10T17:16:35.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4276" PostTypeId="1" AcceptedAnswerId="5319" CreationDate="2014-12-10T18:47:55.470" Score="5" ViewCount="3156" Body="&lt;p&gt;I'm just learning about org-mode, and of course blown away by its sheer level of usability. I of course want to use it everywhere, so I want to create tables with it. Including tables in markdown-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I'm running into is that the row-and-column separators in org-mode look like &lt;code&gt;+&lt;/code&gt; while in markdown-mode they look like &lt;code&gt;|&lt;/code&gt;, so I don't end up with nice-looking tables on, say, Github.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can orgtbl-mode be configured so that a separator row will look more like &lt;code&gt;|---|---|&lt;/code&gt; instead of &lt;code&gt;|---+---|&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2017-09-12T13:22:57.573" Title="Correct markdown-format tables with orgtbl-mode?" Tags="|table|markdown-mode|org-table|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4277" PostTypeId="5" CreationDate="2014-12-10T18:55:38.850" Score="0" Body="&lt;p&gt;See &lt;a href=&quot;http://www.jabber.org&quot; rel=&quot;nofollow&quot;&gt;http://www.jabber.org&lt;/a&gt; for details about the protocol. More information about the Emacs client can be found at &lt;a href=&quot;http://emacs-jabber.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;http://emacs-jabber.sourceforge.net/&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="11" LastEditDate="2015-08-13T18:24:30.043" LastActivityDate="2015-08-13T18:24:30.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4278" PostTypeId="4" CreationDate="2014-12-10T18:55:38.850" Score="0" Body="Jabber is a client for Jabber, a chat protocol" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-10T19:04:24.580" LastActivityDate="2014-12-10T19:04:24.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4279" PostTypeId="1" CreationDate="2014-12-10T19:09:10.603" Score="40" ViewCount="22415" Body="&lt;p&gt;The emacs functions mentioned in the docs don't seem to exist in my org version 7.9.3f.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Markdown-export.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Markdown-export.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how I can get org-mode to export to markdown for me without pulling my hair out?&lt;/p&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2355" LastEditDate="2014-12-10T19:49:29.407" LastActivityDate="2021-12-20T08:43:31.017" Title="Exporting from org-mode to markdown" Tags="|org-mode|" AnswerCount="5" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4280" PostTypeId="1" CreationDate="2014-12-10T19:21:58.773" Score="2" ViewCount="1678" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xlfjc.jpg&quot; alt=&quot;enter image description here&quot;&gt;I am trying to change my emacs theme to spacegray because my current one is not the most appealing but when i to &lt;code&gt;M-x load-theme spacegray&lt;/code&gt; the theme only loads on the line numbers, and when i reload emacs with &lt;code&gt;c-x c-c&lt;/code&gt; the previous theme comes back again.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="2843" LastEditDate="2014-12-10T19:26:35.023" LastActivityDate="2016-02-01T15:37:27.037" Title="Emacs theme won't change" Tags="|themes|" AnswerCount="1" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4282" PostTypeId="2" ParentId="4267" CreationDate="2014-12-10T20:56:38.337" Score="7" Body="&lt;p&gt;This seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice hack-dir-local-variables (around second-dir-locals-file activate)&#xA;  ad-do-it&#xA;  (let ((dir-locals-file &quot;.alt-dir-locals.el&quot;))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2014-12-10T20:56:38.337" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4283" PostTypeId="2" ParentId="3856" CreationDate="2014-12-10T22:00:45.070" Score="2" Body="&lt;p&gt;Since division is multiplication with inverse, you could skip the extra step:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| x | y |   z |          f |            |&#xA;|---+---+-----+------------+------------|&#xA;| 1 | 1 |   1 |          1 |         1. |&#xA;| 1 | 2 | 1:2 |        0.5 |        0.5 |&#xA;| 1 | 3 | 1:3 | 0.33333333 | 0.33333333 |&#xA;| 1 | 6 | 1:6 | 0.16666667 | 0.16666667 |&#xA;#+TBLFM: $3=$1/$2;F::$4=$1*inv($2)::$5=float($1/$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another way would be to simply convert the rational result to float. Also notice how in the first case Calc will create nicer (subjectively) output: wherever the result is a whole number, it will be an integer rather than a float (this may be important due to possible rounding errors with floats). &lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2014-12-10T22:07:26.007" LastActivityDate="2014-12-10T22:07:26.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4285" PostTypeId="2" ParentId="3622" CreationDate="2014-12-11T00:59:41.723" Score="10" Body="&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://melpa.org/#/load-theme-buffer-local&quot;&gt;&lt;code&gt;load-theme-buffer-local.el&lt;/code&gt;&lt;/a&gt; (&lt;a href=&quot;https://github.com/vic/color-theme-buffer-local&quot;&gt;GitHub repository&lt;/a&gt;) is supposed to do what I tried to do, but do it &lt;em&gt;the right way&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use it with &lt;code&gt;eww&lt;/code&gt;, install it and add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'eww-mode-hook&#xA;          (lambda () (load-theme-buffer-local 'tango (current-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;PS: I cannot test this approach myself, so let me know if this works.&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Original answer (kept just for the record):&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot;&gt;&lt;code&gt;face-remap-add-relative&lt;/code&gt;&lt;/a&gt; to set faces in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a little bit of digging around I came up with this hack. It extracts face settings from a theme and applies them in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-theme-faces-in-buffer (theme)&#xA;  &quot;Use face remapping to set faces from a theme in the current&#xA;buffer. THEME should be a symbol.&quot;&#xA;  (dolist (setting (get theme 'theme-settings))&#xA;    (when (eq (car setting) 'theme-face)&#xA;      (let ((face (nth 1 setting))&#xA;            (spec (cadar (nth 3 setting))))&#xA;        (ignore-errors&#xA;          (apply #'face-remap-add-relative face spec))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can combine this with an &lt;code&gt;eww-mode-hook&lt;/code&gt; to set a different theme in &lt;code&gt;eww&lt;/code&gt; buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'eww-mode-hook&#xA;          (lambda () (set-theme-faces-in-buffer 'tango)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Replace &lt;code&gt;tango&lt;/code&gt; with your favorite light theme.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-11T20:21:24.070" LastActivityDate="2014-12-11T20:21:24.070" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4286" PostTypeId="2" ParentId="4218" CreationDate="2014-12-11T01:19:46.940" Score="2" Body="&lt;p&gt;The simple thing would be to save everything with &lt;code&gt;C-u C-x s&lt;/code&gt; (mnemonic: &lt;code&gt;C-x s&lt;/code&gt; is a slightly awkward modification of &lt;code&gt;C-x C-s&lt;/code&gt; which is the normal save command). The computer takes less time to save everything than you'd lose worrying what not to save. This runs the command &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Save-Commands.html#index-save_002dsome_002dbuffers-1062&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;save-some-buffers&lt;/code&gt;&lt;/a&gt;. With no prefix argument, you'll be prompted whether to save each modified buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to save only some files, you can write a function that only saves files based on your chosen criteria.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun save-buffers-in-directory-tree (directory)&#xA;  &quot;Save buffers that are visiting a file in the current directory and its children.&quot;&#xA;  (interactive (list default-directory))&#xA;  (setq directory (file-name-as-directory (file-truename directory)))&#xA;  (mapc (lambda (buffer)&#xA;          (let ((filename (buffer-file-name buffer)))&#xA;            (when (and (buffer-modified-p buffer) filename)&#xA;              (setq filename (file-truename filename))&#xA;              (when (string-prefix-p directory filename)&#xA;                (with-current-buffer buffer&#xA;                  (save-buffer))))))&#xA;        (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-12-11T01:19:46.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4287" PostTypeId="2" ParentId="3622" CreationDate="2014-12-11T04:07:40.870" Score="1" Body="&lt;p&gt;Alternatively, if you are comfortable with reading LaTeX markup, you might prefer to configure wikipedia to not use images for rendering math.  This requires you to create a wikipedia account, then go to Preferences-&gt;Appearance-&gt;Math to select an option.  I would recommend &quot;Client-side MathJax&quot;, since this will render prettily in a browser that understands javascript, but will just show the LaTeX source in a browser like &lt;code&gt;eww&lt;/code&gt; that does not.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, your page looks like this for me:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/xNrOk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps in the future someone might adapt code from &lt;code&gt;preview-latex&lt;/code&gt; or &lt;code&gt;org-preview-latex-fragment&lt;/code&gt; to allow display of the formatted math in &lt;code&gt;eww&lt;/code&gt; in a way that is aware of the color scheme. (Or integrate a javascript interpreter!)&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2014-12-11T04:07:40.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5287" PostTypeId="1" AcceptedAnswerId="5304" CreationDate="2014-12-11T06:39:04.997" Score="4" ViewCount="652" Body="&lt;p&gt;When I am using incremental search, a backspace erases the character from the &lt;em&gt;matched string&lt;/em&gt; in the buffer, instead of erasing the character from the search string I am typing. I saw that this is not the case with another emacs user... is there something I have messed up that is causing this issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did rebind my backspace and delete keys, just to be consistent across terminals/keyboards:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Lock DEL and backspace key behavior&#xA;(global-set-key (kbd &quot;&amp;lt;delete&amp;gt;&quot;) 'delete-char)&#xA;(global-set-key (kbd &quot;&amp;lt;backspace&amp;gt;&quot;) 'delete-backward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, I generally correct my search string using &#xA;    M-e &amp;lt;&lt;/p&gt;&#xA;" OwnerUserId="3849" LastEditorUserId="53" LastEditDate="2014-12-11T12:02:47.657" LastActivityDate="2014-12-11T16:28:56.937" Title="How to use backspace to erase last character in search string?" Tags="|isearch|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5288" PostTypeId="1" AcceptedAnswerId="5303" CreationDate="2014-12-11T09:01:26.087" Score="6" ViewCount="603" Body="&lt;p&gt;I am currently writing a user-script for a simulation software, and the program requires the use of Fortran90 syntax in 132-columns fixed format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has two Fortran modes that I know of, &lt;code&gt;fortran-mode&lt;/code&gt; and &lt;code&gt;f90-mode&lt;/code&gt;. Fixed formmat is not supported in &lt;code&gt;f90-mode&lt;/code&gt; so I am stuck using &lt;code&gt;fortran-mode&lt;/code&gt;. The number of columns can be fixed, but the syntax highlighting is not correct. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Keywords such as &lt;code&gt;use&lt;/code&gt;, &lt;code&gt;contains&lt;/code&gt;, &lt;code&gt;intent&lt;/code&gt;, &lt;code&gt;dimension&lt;/code&gt;, &lt;code&gt;end subroutine &amp;lt;name&amp;gt;&lt;/code&gt; are not recognized. &lt;/li&gt;&#xA;&lt;li&gt;Variables aren't being highlighted after the &lt;code&gt;::&lt;/code&gt; operator.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;While these are simple inconveniences and they do not affect the programming experience much, Emacs is all about convenience. So my question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to achieve the &lt;code&gt;f90-mode&lt;/code&gt;syntax highlighting in &lt;code&gt;fortran-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="969" LastActivityDate="2014-12-11T16:23:14.120" Title="Editing Fortran90 in a fixed format mode" Tags="|formatting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5289" PostTypeId="1" CreationDate="2014-12-11T11:12:05.003" Score="7" ViewCount="2550" Body="&lt;p&gt;is there any way to get a separator like the one for the split buffers (line in the middle of the image) for the line numbers/fringe?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;(setq linenum-format &quot;%4d \u2502 &quot;)&lt;/code&gt; but that gives me a buggy weird broken lines with varying widths -.-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/oKpzl.png&quot; alt=&quot;broken separator lines&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2837" LastActivityDate="2019-08-24T14:47:46.467" Title="Any way to get a working separator line between fringe/line numbers and the buffer?" Tags="|linum-mode|line-numbers|fringe-mode|fringe|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5290" PostTypeId="1" AcceptedAnswerId="5295" CreationDate="2014-12-11T12:08:21.747" Score="13" ViewCount="490" Body="&lt;p&gt;This was inspired by the discussion of &lt;em&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;lexical-binding&lt;/a&gt;&lt;/em&gt; vs &lt;em&gt;lexical-let&lt;/em&gt; in &lt;a href=&quot;https://emacs.stackexchange.com/questions/4265/symbols-value-as-variable-is-void-in-callback-from-url-retrieve&quot;&gt;this question&lt;/a&gt;. As &lt;em&gt;lexical-binding&lt;/em&gt; gives you the ability to have useful closures people may be used to in other languages like JavaScript why wouldn't you enabled it all the time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming backwards compatibility with older Emacsen is not a concern what pitfalls should you be looking for if enabling it in legacy code buffers?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-11T15:34:27.217" Title="What are the potential pitfalls of enabling lexical-binding for a buffer?" Tags="|elisp|lexical-scoping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5291" PostTypeId="2" ParentId="2735" CreationDate="2014-12-11T13:01:59.787" Score="2" Body="&lt;p&gt;As @KyleMeyer explains in his answer, &lt;code&gt;org-mode&lt;/code&gt; does not consider text to be part of a list item if it is not indented past the level of the corresponding bullet. So essentially, we need a way to &lt;strong&gt;absorb paragraphs into list items&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With point positioned inside a list item, the following command lets you do that without having to take care of indentation manually:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-back-to-item ()&#xA;  (re-search-backward &quot;^ *[-+*]\\|^ *[1-9]+[)\.] &quot; nil nil 1))&#xA;&#xA;(defun org-fill-paragraph-handle-lists (&amp;amp;optional num-paragraphs)&#xA;  (interactive &quot;p&quot;)&#xA;  (save-excursion&#xA;    (let ((bound (if mark-active&#xA;                     (- (region-end) 2)&#xA;                   (progn&#xA;                     (org-back-to-item)&#xA;                     (while (&amp;gt;= num-paragraphs 0)&#xA;                       (call-interactively 'org-mark-element)&#xA;                       (setq num-paragraphs (1- num-paragraphs)))&#xA;                     (- (region-end) 2)))))&#xA;      (while (search-forward &quot;\n&quot; bound t)&#xA;        (replace-match &quot; &quot;)))&#xA;    (org-fill-paragraph)))&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-M-q&quot;) 'org-fill-paragraph-handle-lists)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main idea is to replace occurrences of &lt;code&gt;\n&lt;/code&gt; with &lt;code&gt;SPC&lt;/code&gt; in the list item to fill before calling &lt;code&gt;org-fill-paragraph&lt;/code&gt; on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you have more than one paragraph inside a list item:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ...&#xA;  4) a bullet that does&#xA;  NOT respond to fill-paragraph&#xA;  because the &quot;N&quot; in &quot;NOT&quot; is in the same column&#xA;  as the start of the bullet&#xA;&#xA;  Some more text&#xA;  5) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can make &lt;code&gt;Some more text&lt;/code&gt; (the second paragraph) become part of the list item by calling the command like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-2&lt;/kbd&gt; &lt;kbd&gt;C-M-q&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, &lt;code&gt;org-fill-paragraph-handle-lists&lt;/code&gt; will absorb a single paragraph below a list item by default, but can be instructed to absorb any number of paragraphs by calling it with a numeric prefix arg.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2014-12-27T16:44:17.807" LastActivityDate="2014-12-27T16:44:17.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5292" PostTypeId="1" AcceptedAnswerId="5301" CreationDate="2014-12-11T13:10:57.237" Score="0" ViewCount="311" Body="&lt;p&gt;I have seen a lot of times that Emacs perform auto-save and I have some questions regarding it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What are the reasons for that?&lt;/li&gt;&#xA;&lt;li&gt;Where can I find the saved file?&lt;/li&gt;&#xA;&lt;li&gt;What are the advantages of having it activated?&lt;/li&gt;&#xA;&lt;li&gt;How can I deactivate it?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2014-12-11T13:43:51.420" LastActivityDate="2014-12-11T16:16:45.933" Title="Questions regarding auto-save" Tags="|auto-save|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5293" PostTypeId="1" CreationDate="2014-12-11T13:56:14.997" Score="8" ViewCount="2985" Body="&lt;p&gt;If I run the following babel shell blocks &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :session one :results output&#xA;  ssh staging&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC sh :session one :results output&#xA;  hostname&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org creates a shell buffer called &lt;code&gt;one&lt;/code&gt;, runs &lt;code&gt;ssh staging&lt;/code&gt; and then after connecting, executes &lt;code&gt;hostname&lt;/code&gt; on staging. However, if I tweak the ssh command and run it again it attempts to run it from within session one, from the staging host. If I close the buffer &lt;code&gt;one&lt;/code&gt; it resets the session as the next time any command is run with that session name it recreates it. What I haven't been able to find is a method to force a particular babel block to always initialize a new session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware that for some languages (elisp in particular) this would not be possible. I suppose I could prepend the session with an elisp block containing &lt;code&gt;(kill-buffer &quot;one&quot;)&lt;/code&gt;, but would rather this was a header argument if possible. I'm also aware that for this example I could simply combine the two into a single block with no session, but I'm interested in more complicated sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a &lt;code&gt;:prologue&lt;/code&gt; command or some other special argument to &lt;code&gt;:session&lt;/code&gt; that forces that block to initialize a new shell on every invocation? &lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2019-09-25T00:21:34.267" Title="How to force an org-babel session to reset or initialize?" Tags="|org-babel|shell|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5294" PostTypeId="2" ParentId="4244" CreationDate="2014-12-11T14:01:34.537" Score="1" Body="&lt;p&gt;Following the advice of Malabarba and lunaryon, I noticed this piece of code that was blocking the &lt;code&gt;delete-directory&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq delete-by-moving-to-trash t&#xA;       trash-directory &quot;~/.Trash/emacs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I commented it and everything works fine now.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After trying a recommendation from &lt;code&gt;Emacswiki&lt;/code&gt;, the following works fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq delete-by-moving-to-trash t)&#xA;  (defun system-move-file-to-trash (file)&#xA;    &quot;Use \&quot;trash\&quot; to move FILE to the system trash.&#xA;  When using Homebrew, install it using \&quot;brew install trash\&quot;.&quot;&#xA;    (call-process (executable-find &quot;trash&quot;)&#xA;      nil 0 nil&#xA;      file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2014-12-11T14:56:32.627" LastActivityDate="2014-12-11T14:56:32.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5295" PostTypeId="2" ParentId="5290" CreationDate="2014-12-11T14:04:48.643" Score="14" Body="&lt;p&gt;A major pitfall is that the binding semantics for &lt;strong&gt;undefined&lt;/strong&gt; variables—i.e. variables not defined with &lt;code&gt;defvar&lt;/code&gt; and friends—change with &lt;code&gt;lexical-binding&lt;/code&gt;:  Without it, &lt;code&gt;let&lt;/code&gt; binds everything dynamically, but with &lt;code&gt;lexical-binding&lt;/code&gt; enabled undefined variables are bound &lt;strong&gt;lexically&lt;/strong&gt;, and even elided completely if unused in the current lexical scope.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Old code sometimes relies on this.  To avoid hard dependencies for optional features, it'd bind dynamic variables &lt;strong&gt;without&lt;/strong&gt; requiring the corresponding library or declaring the variable itself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((cook-eggs-enabled t))&#xA;  (cook-my-meal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the cooking feature is optional, we don't want to force unnecessary dependencies onto the user, so we don't use &lt;code&gt;(require 'cook)&lt;/code&gt; and instead rely on autoloading of the &lt;code&gt;cook-my-meal&lt;/code&gt; function.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's obvious for the human reader that &lt;code&gt;cook-eggs-enabled&lt;/code&gt; is not a local variable, but still refers to some global dynamic variable from the &lt;code&gt;cook&lt;/code&gt; library here.  Without &lt;code&gt;lexical-binding&lt;/code&gt; this code works as intended:  &lt;code&gt;cook-eggs-enabled&lt;/code&gt; is bound dynamically, whether defined or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;lexical-binding&lt;/code&gt; however, it breaks:  &lt;code&gt;cook-eggs-enabled&lt;/code&gt; is now bound &lt;strong&gt;lexically&lt;/strong&gt; (and then optimized away, because it's not used), so the global dynamic variable &lt;code&gt;cook-eggs-enabled&lt;/code&gt; is &lt;strong&gt;not&lt;/strong&gt; ever touched at all and still  &lt;code&gt;nil&lt;/code&gt; by the time &lt;code&gt;cook-my-meal&lt;/code&gt; is called, so we surprisingly won't have any eggs in our meal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, these issues are &lt;strong&gt;very easy to spot&lt;/strong&gt;: The byte compiler naturally &lt;strong&gt;warns&lt;/strong&gt; about an unused lexical binding here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fix is simple:  Either add a &lt;code&gt;(require 'cook)&lt;/code&gt; (for features that aren't really optional anyway), or—to avoid hard dependencies—declare the variable as dynamic variable &lt;strong&gt;in your own code&lt;/strong&gt;.  There is a special &lt;code&gt;defvar&lt;/code&gt; form for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar cook-eggs-enabled)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This defines &lt;code&gt;cook-eggs-enabled&lt;/code&gt; as dynamic variable, but doesn't affect the docstring, the &lt;code&gt;load-history&lt;/code&gt; (and thus &lt;code&gt;find-variable&lt;/code&gt; and friends) or anything else, except the binding nature of the variable.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-11T14:04:48.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5296" PostTypeId="1" AcceptedAnswerId="5317" CreationDate="2014-12-11T14:30:27.680" Score="4" ViewCount="3640" Body="&lt;p&gt;I have a command &lt;code&gt;my_cmd&lt;/code&gt; that is aliased to another command in my &lt;code&gt;~/.bashrc&lt;/code&gt;. From Perl and Python, I can run this command as &lt;code&gt;bash -ic &quot;my_cmd&quot;&lt;/code&gt; (this also works from the terminal window, but here it is not necessary, and I can simply type &lt;code&gt;my_cmd&lt;/code&gt; since bash already has loaded my &lt;code&gt;~/.bashrc&lt;/code&gt;). When I try this from Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(print (shell-command-to-string &quot;bash -ic 'my_cmd'&quot;) (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash: cannot set terminal process group (-1): Inappropriate ioctl for device&#xA;bash: no job control in this shell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am running Emacs 24.3.1 on Ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-02T20:25:02.723" Title="How to run interactive bash command from Emacs?" Tags="|shell|" AnswerCount="3" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5297" PostTypeId="2" ParentId="4034" CreationDate="2014-12-11T14:34:55.497" Score="1" Body="&lt;p&gt;This way it works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-current-test-name ()&#xA;  (save-excursion&#xA;    (let ((pos)&#xA;          (test-name))&#xA;      (re-search-backward &quot;test \&quot;\\([^\&quot;]+\\)\&quot; do&quot;)&#xA;      (setq test-name (buffer-substring-no-properties (match-beginning 1) (match-end 1)))&#xA;      (concat &quot;test_&quot; (replace-regexp-in-string &quot; &quot; &quot;_&quot; test-name)))))&#xA;&#xA;&#xA;(defun run-test-at-point ()&#xA;  (interactive)&#xA;  (let ((root-dir (projectile-project-root)))&#xA;    (compile (format &quot;ruby -Ilib:test -I%s/test %s -n %s&quot; root-dir (expand-file-name (buffer-file-name)) (get-current-test-name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2037" LastActivityDate="2014-12-11T14:34:55.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5298" PostTypeId="1" AcceptedAnswerId="5299" CreationDate="2014-12-11T15:10:36.327" Score="21" ViewCount="3834" Body="&lt;p&gt;I sometimes want to read mailing list archives for projects that I'm not subscribed to.  There are nice HTML archives online (e.g. &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00347.html&quot;&gt;https://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00347.html&lt;/a&gt;), but I don't enjoy reading mails in the browser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an interface for Emacs to read mailing list archives?  I already use mu4e to read my personal email inside of Emacs, but I'd also like to be able to read &lt;em&gt;other people's&lt;/em&gt; email in Emacs (to the extend that these other people have posted to public mailing lists).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's got to be a mode for that.  (I suspect gnus is the answer, but I have never used it.)&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2021-02-23T11:16:23.247" Title="Reading mailing list archives in Emacs?" Tags="|email|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5299" PostTypeId="2" ParentId="5298" CreationDate="2014-12-11T15:43:07.007" Score="22" Body="&lt;p&gt;Sure GNUS is &lt;em&gt;an&lt;/em&gt; answer. From &lt;a href=&quot;http://wikemacs.org/wiki/Gnus#Using_Gnus_with_Gmane&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacswiki&lt;/a&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x gnus&#xA;B&#xA;nntp&#xA;news.gmane.io&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And select gmane.emacs.devel. From here you can browse through the threads using GNUs NNTP interface (which is what it was originally written to do). This is probably the best solution for browsing through historical mailing lists.&lt;/p&gt;&#xA;&lt;p&gt;As others have mentioned you may only want to read a small set of emails perhaps attached to a bug or patchwork. In this case if you can download the mbox file you can browse it directly without dealing with network latency. Again Emacs has many solutions for email however built in you can use Rmail quite easily. The steps for this are:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x rmail&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This will bring up your default inbox (most likely your systems /var/mail/$USER and copy it in ~/RMAIL). However to load in a &amp;quot;foreign&amp;quot; mail box you type:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;i&#xA;path/to/mbox&#xA;h&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This will put you at the summary view of the mail box which you can then browse with the usual Emacs navigation.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2021-02-23T11:16:23.247" LastActivityDate="2021-02-23T11:16:23.247" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="5300" PostTypeId="2" ParentId="5296" CreationDate="2014-12-11T16:03:10.587" Score="0" Body="&lt;p&gt;ok so i don't know how the whole thing works. i'll try to find out interactively&lt;/p&gt;&#xA;&#xA;&lt;p&gt;googling job control gives me &lt;a href=&quot;http://www.gnu.org/software/libc/manual/html_node/Job-Control.html#Job-Control&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/libc/manual/html_node/Job-Control.html#Job-Control&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/questions/11821378/what-does-bashno-job-control-in-this-shell-mean&quot;&gt;https://stackoverflow.com/questions/11821378/what-does-bashno-job-control-in-this-shell-mean&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so what exactly does &quot;shell-command-to-string&quot; do? C-h f shell-command-to-string RET&#xA;Then I click on the link to the file to get me source code. (Ch-f = M-x describe-function)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shell-command-to-string (command)&#xA;  &quot;Execute shell command COMMAND and return its output as a string.&quot;&#xA;  (with-output-to-string&#xA;    (with-current-buffer&#xA;      standard-output&#xA;      (process-file shell-file-name nil t nil shell-command-switch command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;what is &quot;shell-file-name&quot;, you have to check by your place but for me C-h v shell-file-name RET returns &quot;bash&quot;. (C-h v is M-x describe-variable)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and for me shell-command-switch is &quot;-c&quot;. So no -i be default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[WRONG]&lt;/strong&gt;&lt;em&gt;So by default you start an interactive bash in a non interactive bash. So yeah, doesn't work. I don't know much about the whole thing so can't tell you how to fix it. Maybe changing shell-command-switch would help, I'd try that out. Maybe it opens a whole another can of worms ^^!&lt;/em&gt;&lt;strong&gt;[WRONG]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;well actually I was quite wrong!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;bash -c &quot;bash -ic 'll'&quot; (with ll aliased to ls -l in .bashrc) actually works!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess I'd need to know what you tried to run to test it at home :)&lt;/p&gt;&#xA;" OwnerUserId="2756" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-12-11T17:34:58.103" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="5301" PostTypeId="2" ParentId="5292" CreationDate="2014-12-11T16:03:55.457" Score="4" Body="&lt;p&gt;You should read the appropriate section of the Emacs Manual, but here is a quick overview:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Auto-save is a safeguard to prevent you from losing changes that have not yet been saved, should Emacs crash or be killed in some way. As with everything in Emacs, the behavior is configurable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs will automatically save a copy of the buffer after:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a certain number of edits, see &lt;code&gt;auto-save-interval&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;a certain amount of idle time, see &lt;code&gt;auto-save-timeout&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you visit a file, Emacs checks to see if there as an auto-save file that is newer than the file itself. If so, it offers to recover the auto-saved changes. See commands &lt;code&gt;recover-file&lt;/code&gt; and &lt;code&gt;recover-this-file&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default auto-save files are written in the same place as the original file, with the name wrapped in &lt;code&gt;#&lt;/code&gt; characters. See &lt;code&gt;auto-save-file-name-transforms&lt;/code&gt; to change this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable auto-save altogether, see &lt;code&gt;auto-save-default&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that auto-save files are usually cleaned up automatically: when you successfully save a set of changes Emacs will delete the no-longer needed auto-save file. See &lt;code&gt;delete-auto-save-files&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-12-11T16:16:45.933" LastActivityDate="2014-12-11T16:16:45.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5302" PostTypeId="1" AcceptedAnswerId="5306" CreationDate="2014-12-11T16:22:10.550" Score="13" ViewCount="1236" Body="&lt;p&gt;I ran a command and received a warning in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact warning was &lt;code&gt;comint-completion-at-point failed to return valid completion data&lt;/code&gt;, after I autocompleted a command in &lt;code&gt;shell-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I determine the elisp origin of the warning?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="2355" LastEditDate="2014-12-11T17:01:28.573" LastActivityDate="2014-12-11T22:46:48.957" Title="Find elisp origin of warning" Tags="|debugging|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5303" PostTypeId="2" ParentId="5288" CreationDate="2014-12-11T16:23:14.120" Score="5" Body="&lt;p&gt;Yes, there is nothing to stop you from using F90 highlighting in &lt;code&gt;fortran-mode&lt;/code&gt;.  Just put something like this in your config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'f90)&#xA;(add-hook 'fortran-mode-hook 'f90-font-lock-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the number at the end (1 to 4) controls the degree of gaudiness. Here is an example with the default color scheme and &lt;code&gt;f90-font-lock-4&lt;/code&gt; (maximum gaudiness). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bIM8H.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2014-12-11T16:23:14.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5304" PostTypeId="2" ParentId="5287" CreationDate="2014-12-11T16:28:56.937" Score="5" Body="&lt;p&gt;You'll want to change&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;backspace&amp;gt;&quot;) 'delete-backward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;either to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;DEL&quot;) 'delete-backward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or to nothing at all.  The definition you use prevents Emacs from remapping &lt;code&gt;backspace&lt;/code&gt; to &lt;code&gt;DEL&lt;/code&gt;, and the Isearch behavior you want is bound to &lt;code&gt;DEL&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-11T16:28:56.937" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5306" PostTypeId="2" ParentId="5302" CreationDate="2014-12-11T17:00:44.110" Score="19" Body="&lt;p&gt;As pointed out in the other answer you'll find &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Debugging.html#Debugging&quot;&gt;the fine manual&lt;/a&gt; useful for all the debug tools it has. For you specific problem I'd consider:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq debug-on-message &quot;comint-completion-at-point failed to return valid completion data&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As the help text states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If non-nil, debug if a message matching this regexp is displayed.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this you should get a backtrace when the failure hits. You can then instrument the functions in question with &lt;em&gt;C-u C-M-x&lt;/em&gt; and step through the failure next time it occurs for more information.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2014-12-11T22:46:48.957" LastActivityDate="2014-12-11T22:46:48.957" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5307" PostTypeId="1" CreationDate="2014-12-11T17:07:09.433" Score="3" ViewCount="373" Body="&lt;p&gt;Assume that I have already opened a file with emacs. Is it possible to force emacs to re-open that file in another frame when I re-open that file intentionally or a third party program open that file with emacs ?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2014-12-11T17:09:30.787" Title="How to force emacs to open a file always as a new frame rather than a new window" Tags="|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5308" PostTypeId="2" ParentId="5307" CreationDate="2014-12-11T17:09:30.787" Score="3" Body="&lt;p&gt;Yes. Use &lt;strong&gt;&lt;code&gt;C-x 5 f&lt;/code&gt;&lt;/strong&gt; instead of &lt;code&gt;C-x C-f&lt;/code&gt; or &lt;code&gt;C-x 4 f&lt;/code&gt;. Or set &lt;code&gt;pop-up-frames&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; and use &lt;code&gt;C-x 4 f&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to open the &lt;em&gt;currently visited&lt;/em&gt; file in another frame, use &lt;strong&gt;&lt;code&gt;C-x 5 2&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-11T17:09:30.787" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5310" PostTypeId="2" ParentId="5289" CreationDate="2014-12-11T17:57:54.547" Score="3" Body="&lt;p&gt;There are a few ways to do this -- my preferred method is to set the frame defaults for the fringes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'fringe nil :background &quot;red&quot;)&#xA;(add-to-list 'default-frame-alist '(left-fringe . 11))&#xA;(add-to-list 'default-frame-alist '(right-fringe . 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is possible to set the windows fringes globally:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default left-fringe-width 11)&#xA;(setq-default right-fringe-width 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is also possible to set the windows fringes locally:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq left-fringe-width 11)&#xA;(setq right-fringe-width 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the doc-string for &lt;code&gt;left-fringe-width&lt;/code&gt; and &lt;code&gt;right-fringe-width&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Automatically becomes buffer-local when set.&#xA;&#xA;Documentation:&#xA;Width of this buffer's left/right fringe (in pixels).&#xA;A value of 0 means no left/right fringe is shown in this buffer's window.&#xA;A value of nil means to use the left/right fringe width from the window's frame.&#xA;&#xA;Setting this variable does not take effect until a new buffer is displayed&#xA;in a window.  To make the change take effect, call `set-window-buffer'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/fringe_example.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.437" LastActivityDate="2015-06-26T16:03:08.870" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5311" PostTypeId="1" AcceptedAnswerId="5322" CreationDate="2014-12-11T18:32:40.727" Score="24" ViewCount="2013" Body="&lt;p&gt;It seems that the order of helm results is never useful... I either have to navigate through the long list or keep typing until I've narrowed the list enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to sort the results in order of usage frequency?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: That is, the most commonly selected helm results should appear at the top of the list, whether it's for files, commands, variables, etc&lt;/p&gt;&#xA;" OwnerUserId="3852" LastEditorUserId="50" LastEditDate="2014-12-11T19:15:22.370" LastActivityDate="2015-05-24T21:40:48.407" Title="Is there any way to order helm results by commonly used?" Tags="|helm|completion|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5312" PostTypeId="1" CreationDate="2014-12-11T19:00:04.943" Score="1" ViewCount="81" Body="&lt;p&gt;After a command terminates in &lt;code&gt;shell-mode&lt;/code&gt;, I want to execute an additional command conditional on &lt;code&gt;stdout&lt;/code&gt;. How can this be automated?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-12-11T19:28:34.877" Title="Shell-mode conditional execution" Tags="|shell-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5313" PostTypeId="2" ParentId="5312" CreationDate="2014-12-11T19:28:34.877" Score="1" Body="&lt;p&gt;Add a hook to &lt;code&gt;comint-output-filter-functions&lt;/code&gt;. In the example below, &lt;code&gt;ls&lt;/code&gt; is sent to the shell if the output from a command matches &lt;code&gt;&quot;foo&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-hook (str)&#xA;  (when (string-match &quot;foo&quot; str)&#xA;    (insert &quot;ls&quot;)&#xA;    (comint-send-input)))&#xA;&#xA;(add-hook 'shell-mode-hook&#xA;          (lambda ()&#xA;            (make-local-variable 'comint-output-filter-functions)&#xA;            (add-hook 'comint-output-filter-functions #'my-hook)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-11T19:28:34.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5314" PostTypeId="1" AcceptedAnswerId="5315" CreationDate="2014-12-11T20:51:42.557" Score="7" ViewCount="625" Body="&lt;p&gt;What is the simplest way of getting the number of distinct repeated in a region?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, from&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;THIS IS LINE A&#xA;THIS IS LINE A&#xA;THIS IS LINE A&#xA;THIS IS LINE B&#xA;THIS IS LINE B&#xA;THIS IS LINE C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;THIS IS LINE A    3&#xA;THIS IS LINE B    2&#xA;THIS IS LINE C    1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output could be made over the same region (replacing the current selection).&lt;/p&gt;&#xA;" OwnerUserId="340" LastEditorUserId="340" LastEditDate="2014-12-12T12:05:48.507" LastActivityDate="2014-12-12T16:20:16.177" Title="GROUP BY + COUNT over lines in a region" Tags="|text-editing|replace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5315" PostTypeId="2" ParentId="5314" CreationDate="2014-12-11T21:37:43.807" Score="10" Body="&lt;p&gt;On Linux, and I assume Mac, you can pipe the region through the &lt;code&gt;uniq&lt;/code&gt; shell command to get almost exactly what you want.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Mark the region&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sort the lines with &lt;code&gt;M-x sort-lines&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Call &lt;code&gt;shell-command-on-region&lt;/code&gt; with the prefix key: &lt;code&gt;C-u M-|&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Enter &lt;code&gt;uniq --count&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The contents of the buffer will be replaced by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  3 THIS IS LINE A&#xA;  2 THIS IS LINE B&#xA;  1 THIS IS LINE C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can further automate this with keyboard macros etc., but this may be good enough as is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: as @phils points out, you can do the sorting with a shell command instead of with the Emacs function. In this case, drop step 2, and for step 4 enter &lt;code&gt;sort | uniq -c&lt;/code&gt; instead of just &lt;code&gt;uniq -c&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2014-12-12T16:20:16.177" LastActivityDate="2014-12-12T16:20:16.177" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="5316" PostTypeId="2" ParentId="5314" CreationDate="2014-12-11T21:38:36.997" Score="5" Body="&lt;p&gt;I see three tasks here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Get a list of lines in a region, without duplicates.&lt;/li&gt;&#xA;&lt;li&gt;For each line in this list count how many times it occurred in the original region and collect this information.&lt;/li&gt;&#xA;&lt;li&gt;Insert the summary.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun uniqify-lines (beg end)&#xA;  &quot;Return a list of lines in a region (without duplicates). Omit empty lines.&quot;&#xA;  (let ((text (buffer-substring beg end)))&#xA;    (with-temp-buffer&#xA;      (insert text)&#xA;      (delete-duplicate-lines (point-min) (point-max))&#xA;      (split-string (buffer-string) &quot;\n&quot; t))))&#xA;&#xA;(defun count-duplicates (beg end)&#xA;  &quot;Count duplicate lines in a region. Returns a list of the&#xA;    form ((line . count) ...).&quot;&#xA;  (mapcar (lambda (str)&#xA;            (cons str (how-many (regexp-quote str) beg end)))&#xA;          (uniqify-lines beg end)))&#xA;&#xA;(defun insert-line-stats (beg end)&#xA;  &quot;Remove duplicate lines in the region. Append the number of&#xA;    occurences to each line in the result. Replaces current region.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((stats (count-duplicates beg end)))&#xA;    (kill-region beg end)&#xA;    (mapc (lambda (line)&#xA;            (insert (format &quot;%s %d\n&quot; (car line) (cdr line))))&#xA;          stats)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-11T21:38:36.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5317" PostTypeId="2" ParentId="5296" CreationDate="2014-12-11T21:45:03.183" Score="3" Body="&lt;p&gt;I tried it as well. I got the errors, but I got the output of the command, too. So, a partial solution would be to redirect the errors away:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(print (shell-command-to-string &quot;bash -ic 'my_cmd' 2&amp;gt;/dev/null&quot;)&#xA;       (current-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Including the redirection inside single quotes doesn't help, because it's the outer bash that reports the problems, not the command.&lt;/p&gt;&#xA;" OwnerUserId="2526" LastActivityDate="2014-12-11T21:45:03.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5318" PostTypeId="2" ParentId="4198" CreationDate="2014-12-11T22:18:19.950" Score="8" Body="&lt;p&gt;This is not exactly the purpose it was invented for, but seems to be useful:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'json)&#xA;(json-encode-string &quot;a neat\nstring\&quot; with tab\t and feed \f, also vertical tab \v&quot;)&#xA;&quot;\&quot;a neat\\nstring\\\&quot; with tab\\t and feed \\f, also vertical tab \\u000b\&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-12-11T22:18:19.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5319" PostTypeId="2" ParentId="4276" CreationDate="2014-12-12T02:57:40.267" Score="5" Body="&lt;p&gt;What I've found so far is this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;simplest&quot; way is, as described in this &lt;a href=&quot;https://stackoverflow.com/a/20912535/234025&quot;&gt;stackoverflow answer&lt;/a&gt; and &lt;a href=&quot;https://gist.github.com/yryozo/5807243&quot; rel=&quot;nofollow noreferrer&quot;&gt;this gist&lt;/a&gt;, and as hinted by @Constantine &lt;a href=&quot;https://emacs.stackexchange.com/questions/4276/correct-markdown-format-tables-with-orgtbl-mode#comment6722_4276&quot;&gt;in a comment&lt;/a&gt;, is to create a converter function and then use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went a tad further in laziness (this might already exist somewhere, but hey, I've only got the one use case right now). So here's what I have:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The converter function&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun orgtbl-to-gfm (table params)&#xA;  &quot;Convert the Orgtbl mode TABLE to GitHub Flavored Markdown.&quot;&#xA;  (let* ((alignment (mapconcat (lambda (x) (if x &quot;|--:&quot; &quot;|---&quot;))&#xA;                   org-table-last-alignment &quot;&quot;))&#xA;     (params2&#xA;      (list&#xA;       :splice t&#xA;       :hline (concat alignment &quot;|&quot;)&#xA;       :lstart &quot;| &quot; :lend &quot; |&quot; :sep &quot; | &quot;)))&#xA;    (orgtbl-to-generic table (org-combine-plists params2 params))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Sample usage:&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Usage Example:&#xA;;;&#xA;;; &amp;lt;!-- BEGIN RECEIVE ORGTBL ${1:YOUR_TABLE_NAME} --&amp;gt;&#xA;;; &amp;lt;!-- END RECEIVE ORGTBL $1 --&amp;gt;&#xA;;;&#xA;;; &amp;lt;!--&#xA;;; #+ORGTBL: SEND $1 orgtbl-to-gfm&#xA;;; | $0 |&#xA;;; --&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;My lazy inserter&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This is about the laziest piece of code I've written in years, but hey, it's gonna make sure that when I'm writing markdown, I'm really just writing markdown. I'll also welcome all improvements to this code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus: Github-Flavored Markdown, and Github's preview itself, doesn't show HTML-style comments, therefore this is completely transparent. Love it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun stag-insert-org-to-md-table (table-name)&#xA;  (interactive &quot;*sEnter table name: &quot;)&#xA;  (insert &quot;&amp;lt;!---&#xA;#+ORGTBL: SEND &quot; table-name &quot; orgtbl-to-gfm&#xA;&#xA;--&amp;gt;&#xA;&amp;lt;!--- BEGIN RECEIVE ORGTBL &quot; table-name &quot; --&amp;gt;&#xA;&amp;lt;!--- END RECEIVE ORGTBL &quot; table-name &quot; --&amp;gt;&quot;)&#xA;  (previous-line)&#xA;  (previous-line)&#xA;  (previous-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="61" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2014-12-12T02:57:40.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5320" PostTypeId="1" AcceptedAnswerId="5321" CreationDate="2014-12-12T06:05:04.743" Score="3" ViewCount="249" Body="&lt;p&gt;Each major mode seems to (quite unfortunately) have its own naming conventions for the special variable used to control indentation level.  For example, &lt;code&gt;c-mode&lt;/code&gt; has &lt;code&gt;c-basic-offset&lt;/code&gt;, &lt;code&gt;python-mode&lt;/code&gt; has &lt;code&gt;python-indent-offset&lt;/code&gt;, &lt;code&gt;perl-mode&lt;/code&gt; has &lt;code&gt;cperl-indent-level&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I determine which variable I should set for any given mode?&lt;/p&gt;&#xA;" OwnerUserId="573" LastActivityDate="2014-12-12T07:20:30.040" Title="How to determine which variable controls indentation offset for any given mode" Tags="|indentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5321" PostTypeId="2" ParentId="5320" CreationDate="2014-12-12T07:14:18.450" Score="4" Body="&lt;p&gt;There are some common patterns (you've already noted that &quot;offset&quot; and &quot;indent&quot; are likely terms), but ultimately each mode is free to implement indentation however it likes using any arbitrary variable name(s) it wants to use, so there is no guaranteed way to determine this information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore a derived mode might rely entirely on its parent mode for indentation, and consequently the variable(s) in question may not even have the name prefix you expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My best advice is check the &lt;code&gt;customize-group&lt;/code&gt; interface for the library in question, or to use &lt;code&gt;apropos-variable&lt;/code&gt; with the pattern &lt;code&gt;offset\|indent&lt;/code&gt;, and if that fails, be sure to check the parent mode (if any; use &lt;code&gt;describe-function&lt;/code&gt; or &lt;code&gt;find-function&lt;/code&gt;) so that you can chase up the same things in that mode (or indeed its own parent, etc...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also SMIE, which is the nearest thing to a &quot;standard&quot; approach to indentation in Emacs that I know of, but which is &lt;em&gt;relatively&lt;/em&gt; new and so presumably unlikely to have been adopted by very many pre-existing modes. I don't know too much about it, but you can read about it in the manual: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) SMIE Customization&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-12-12T07:20:30.040" LastActivityDate="2014-12-12T07:20:30.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5322" PostTypeId="2" ParentId="5311" CreationDate="2014-12-12T08:13:24.690" Score="13" Body="&lt;p&gt;There is an adaptive sorting option for Helm which sorts the result according to their usage frequency. According to the helm source code it can be activated with the minor mode &lt;code&gt;helm-adaptive-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/blob/master/helm-adaptive.el&quot;&gt;https://github.com/emacs-helm/helm/blob/master/helm-adaptive.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2498" LastActivityDate="2014-12-12T08:13:24.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5323" PostTypeId="1" AcceptedAnswerId="5327" CreationDate="2014-12-12T11:03:34.530" Score="17" ViewCount="1851" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there a way to prepend zeros to &lt;code&gt;org-mode&lt;/code&gt; numbered lists?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Text alignment in numbered lists starts to look unpleasant when numbers get into the double digits:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A numbered list&#xA;&#xA;  1. Item 1&#xA;  2. Item 2&#xA;  3. Item 3&#xA;  4. Item 4&#xA;  5. Item 5&#xA;  6. Item 6&#xA;  7. Item 7&#xA;  8. Item 8&#xA;  9. Item 9&#xA;  10. Item 10   # ah, my eyes!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;org-mode&lt;/code&gt; manual on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Plain-lists.html&quot; rel=&quot;noreferrer&quot;&gt;plain lists&lt;/a&gt; states that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Items belonging to the same list must have the same indentation on the first line. In particular, if an ordered list reaches number ‘10.’, then the &lt;strong&gt;2–digit numbers must be written left-aligned with the other numbers in the list.&lt;/strong&gt; An item ends before the next line that is less or equally indented than its bullet/number. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it looks like &lt;code&gt;org-mode&lt;/code&gt; needs the digits to left-align.  As such, I'm wondering if it's possible to prepend zeros onto the single-digit items so that the text aligns nicely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A zero-padded numbered list&#xA;&#xA;  01. Item 1&#xA;  02. Item 2&#xA;  03. Item 3&#xA;  04. Item 4&#xA;  05. Item 5&#xA;  06. Item 6&#xA;  07. Item 7&#xA;  08. Item 8&#xA;  09. Item 9&#xA;  10. Item 10   # much better!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Out of curiosity, I tried hand-entering the zeros in a list and hitting &lt;code&gt;C-c C-c&lt;/code&gt;, which simply strips them out again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;em&gt;is there any way to convince &lt;code&gt;org-mode&lt;/code&gt; to prepend zeros in numbered lists?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: question inspired by &lt;a href=&quot;https://stackoverflow.com/questions/27432613/emacs-clean-up-numbered-lists-with-more-than-9-lines&quot;&gt;this S.O. thread&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-12-12T14:25:40.863" Title="Text alignment in org-mode numbered lists?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5324" PostTypeId="1" AcceptedAnswerId="5704" CreationDate="2014-12-12T12:05:17.173" Score="0" ViewCount="301" Body="&lt;p&gt;I use &lt;code&gt;company-mode&lt;/code&gt; for auto-completion and sometimes I have a strange problem with Emacs-Lisp. Variables are not shown among the completion candidates. Sometimes, if shown, pressing &lt;code&gt;&amp;lt;f1&amp;gt;&lt;/code&gt; doesn't open any documentation. I have to shut down Emacs and reboot. This behavior seems to be completely random. Any hint?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(By the way: this used to happen also when I was using auto-complete-mode)&lt;/p&gt;&#xA;" OwnerUserId="201" LastEditorUserId="201" LastEditDate="2014-12-12T15:58:50.313" LastActivityDate="2014-12-24T14:40:18.223" Title="Variables not shown in company-mode" Tags="|company-mode|documentation|variables|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5325" PostTypeId="1" AcceptedAnswerId="5326" CreationDate="2014-12-12T13:01:21.163" Score="6" ViewCount="584" Body="&lt;p&gt;When editing LaTeX code, the command &lt;code&gt;latex-close-block&lt;/code&gt; inserts an &lt;code&gt;\end{..}&lt;/code&gt; that matches the last unclosed &lt;code&gt;\begin{..}&lt;/code&gt;. Very handy!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar command in &lt;code&gt;c-mode&lt;/code&gt; that would close a pending &lt;code&gt;#ifdef&lt;/code&gt;? Ideally, I would close &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#ifdef __A_COND__ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with a nicely commented &lt;code&gt;#endif&lt;/code&gt;, like in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#endif /* __A_COND__ */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If such a command does not exist, how would you program it? From scratch or using &lt;code&gt;skeleton.el&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="1992" LastActivityDate="2014-12-12T17:39:29.827" Title="Automatically closing #ifdef block when editing C code" Tags="|c-mode|skeleton|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5326" PostTypeId="2" ParentId="5325" CreationDate="2014-12-12T13:27:45.363" Score="6" Body="&lt;p&gt;I'm using this yasnippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: ifndef&#xA;# key: ifndef&#xA;# --&#xA;#ifndef ${1:`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_HH_}&#xA;#define $1&#xA;&#xA;$0&#xA;#endif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can quickly customize it to do what you want.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;In case you're not using yasnippet yet&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here's my personal config (you can take the parts that you like):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package yasnippet&#xA;    :diminish yas-minor-mode&#xA;    :init&#xA;    (progn&#xA;      (setq yas-fallback-behavior 'return-nil)&#xA;      (setq yas-triggers-in-field t)&#xA;      (setq yas-verbosity 0)&#xA;      ;; I'm using my own snippets, turn bundled snippets off&#xA;      ;; (setq yas-snippet-dirs (list (concat emacs.d &quot;snippets/&quot;)))&#xA;      (define-key yas-minor-mode-map [(tab)] nil)&#xA;      (define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;      (yas-global-mode)))&#xA;&#xA;;; (package-install 'auto-yasnippet)&#xA;(global-set-key &quot;\C-o&quot; 'aya-open-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It needs &lt;code&gt;auto-yasnippet&lt;/code&gt; (it's in MELPA, &lt;code&gt;yasnippet&lt;/code&gt; is a dependency).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now &lt;kbd&gt;C-o&lt;/kbd&gt; will try in order to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;expand abbrev&lt;/li&gt;&#xA;&lt;li&gt;expand yasnippet or move to the next yasnippet field if already expanding&lt;/li&gt;&#xA;&lt;li&gt;open line&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2014-12-12T17:39:29.827" LastActivityDate="2014-12-12T17:39:29.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5327" PostTypeId="2" ParentId="5323" CreationDate="2014-12-12T13:57:45.463" Score="14" Body="&lt;p&gt;The following diff on &lt;code&gt;org-list.el&lt;/code&gt; does the trick!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff --git a/lisp/org-list.el b/lisp/org-list.el&#xA;index b1d47c9..509e79f 100644&#xA;--- a/lisp/org-list.el&#xA;+++ b/lisp/org-list.el&#xA;@@ -1641,7 +1641,8 @@ as returned by `org-list-prevs-alist'.&quot;&#xA;      ;; Num bullet: increment it.&#xA;      ((string-match &quot;[0-9]+&quot; bullet)&#xA;       (replace-match&#xA;-       (number-to-string (1+ (string-to-number (match-string 0 bullet))))&#xA;+       (format (format &quot;%%0%dd&quot; (length (match-string 0 bullet)))&#xA;+          (1+ (string-to-number (match-string 0 bullet))))&#xA;        nil nil bullet))&#xA;      ;; Alpha bullet: increment it.&#xA;      ((string-match &quot;[A-Za-z]&quot; bullet)&#xA;@@ -1715,7 +1716,7 @@ This function modifies STRUCT.&quot;&#xA;          (replace-match &quot;a&quot; nil nil bullet))&#xA;         ;; First bullet is num: use &quot;1&quot;.&#xA;         ((string-match &quot;\\([0-9]+\\|[A-Za-z]\\)&quot; bullet)&#xA;-         (replace-match &quot;1&quot; nil nil bullet))&#xA;+         (replace-match (format (format &quot;%%0%dd&quot; (1+ (log (length struct) 10))) 1) nil nil bullet))&#xA;         ;; Not an ordered list: keep bullet.&#xA;         (t bullet)))))))))&#xA;     (mapc fix-bul (mapcar 'car struct))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first chunk patches function &lt;code&gt;org-list-inc-bullet-maybe&lt;/code&gt; to keep&#xA;the padding used on the first item. The second chunk patches function&#xA;&lt;code&gt;org-list-struct-fix-bul&lt;/code&gt; to calculate the padding based on the number&#xA;of elements in the list.&lt;/p&gt;&#xA;" OwnerUserId="700" LastEditorUserId="700" LastEditDate="2014-12-12T14:25:40.863" LastActivityDate="2014-12-12T14:25:40.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5328" PostTypeId="2" ParentId="5325" CreationDate="2014-12-12T14:35:52.830" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt; (and some other &quot;auto pair&quot; packages) allows you to do something similar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;#ifdef&quot; &quot;#endif&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This won't easily get you that ending comment like a snippet engine can (I believe it's possible with &lt;code&gt;smartparens&lt;/code&gt;, though), but it answers your title so I thought it was close enough to warrant an answer.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-12-12T14:35:52.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5329" PostTypeId="1" AcceptedAnswerId="5331" CreationDate="2014-12-12T15:50:12.707" Score="3" ViewCount="352" Body="&lt;p&gt;I have discovered that a recent update to some of my emacs packages have caused &lt;code&gt;C-x C-f&lt;/code&gt; while on a dired file to perform some operation on the entire file before prompting me for other files/directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I need to track down what is causing this issue, but in the meantime, &lt;strong&gt;is there a way I can tell dired to ignore the current file-at-point when invoking &lt;code&gt;C-x C-f&lt;/code&gt; in a dired buffer?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I frequently invoke this in a dired buffer containing videos around 500mb-1gb, and even with &lt;code&gt;(setq debug-on-quit t)&lt;/code&gt; I cannot interrupt the process after hitting &lt;code&gt;C-x C-f&lt;/code&gt;, emacs simply spins at 100% cpu for a few minutes until the ido prompt comes up.&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="105" LastEditDate="2014-12-12T17:07:41.763" LastActivityDate="2014-12-12T17:07:41.763" Title="Tell Dired to ignore file-at-point when invoking `ido-find-file` (`C-x C-f` in Ido mode)" Tags="|dired|ido|find-file|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="5330" PostTypeId="1" CreationDate="2014-12-12T16:37:21.843" Score="14" ViewCount="2351" Body="&lt;p&gt;This is similar to &lt;a href=&quot;https://emacs.stackexchange.com/q/443/2264&quot;&gt;Editing files with one-sentence-per-line&lt;/a&gt; (in function as well as motive), but I wish to have a full, flowing paragraph rather than visual breaks at every sentence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have a minor mode that, when active, will visually join lines from the same paragraph (not separated by &lt;code&gt;\n\n&lt;/code&gt; or &lt;code&gt;paragraph-separate&lt;/code&gt; or ...) and then activate behavior (perhaps derived from &lt;code&gt;visual-line-mode&lt;/code&gt;) that will wrap the line without actually inserting &lt;code&gt;\n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does such a mode exist?  If not, how would I go about the process of altering a paragraph's display properties to achieve the result?  (After all, this is the crux of such a mode and one could be developed from the snippet.)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-03-24T20:59:20.790" Title="How can I split paragraph into one-line-per-sentence but still keep it wrapped visually?" Tags="|fill-paragraph|line-break|display|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5331" PostTypeId="2" ParentId="5329" CreationDate="2014-12-12T16:45:32.333" Score="5" Body="&lt;p&gt;If you are using &lt;code&gt;ido-find-file&lt;/code&gt; and have configured ido to use the filename at point (e.g. you have &lt;code&gt;ido-use-filename-at-point&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt; or &lt;code&gt;'guess&lt;/code&gt;), you can prevent ido from using the name at point from a dired buffer with a hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/ido-ignore-file-at-point ()&#xA;  &quot;Disable ido-use-filename-at-point for the current buffer.&quot;&#xA;  (when (bound-and-true-p ido-use-filename-at-point)&#xA;    (setq-local ido-use-filename-at-point nil)))&#xA;&#xA;(add-hook 'dired-mode-hook #'my/ido-ignore-file-at-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you never want ido to use the name at point, set &lt;code&gt;ido-use-filename-at-point&lt;/code&gt; to nil. I believe that is the default behavior though, so you may have customized it at some point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you experience issues with ido completion in large directories you may also want to customize &lt;code&gt;ido-max-directory-size&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-12-12T16:55:03.763" LastActivityDate="2014-12-12T16:55:03.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5332" PostTypeId="2" ParentId="5311" CreationDate="2014-12-12T16:56:52.290" Score="1" Body="&lt;p&gt;Although helm-adaptive-mode is supposed to do this as Tom pointed out, unfortunately not many helm commands use it as per: &lt;a href=&quot;https://groups.google.com/forum/#!topic/emacs-helm/S6FXhGfDFqA&quot; rel=&quot;nofollow&quot;&gt;https://groups.google.com/forum/#!topic/emacs-helm/S6FXhGfDFqA&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will leave his answer as accepted since it is the closest answer possible and raised &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/751&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/issues/751&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3852" LastEditorUserId="3852" LastEditDate="2014-12-12T17:20:37.340" LastActivityDate="2014-12-12T17:20:37.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5333" PostTypeId="1" AcceptedAnswerId="5334" CreationDate="2014-12-12T17:24:36.673" Score="6" ViewCount="795" Body="&lt;p&gt;I know that I can hide the modebar for the current buffer using&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M&lt;/kbd&gt; - &lt;kbd&gt;:&lt;/kbd&gt; &lt;code&gt;(setq mode-line-format nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'd like to hide the mode-line for the 'MINIMAP' buffer created by the &lt;a href=&quot;http://www.emacswiki.org/MiniMap&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;minimap&lt;/code&gt; package&lt;/a&gt;, which is never the &quot;current&quot; buffer since as soon as you click anywhere on the minimap, the cursor is automatically moved to the original buffer. So the previous method does not work in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The perfect solution would be to put something into my &lt;code&gt;.emacs&lt;/code&gt; file so that every time I open a minimap the mode-line is automatically hidden from the buffer. Is it possible?&lt;/p&gt;&#xA;" OwnerUserId="2737" LastEditorUserId="780" LastEditDate="2014-12-12T18:21:04.297" LastActivityDate="2014-12-14T16:55:16.073" Title="Hide mode-line for minimap buffers" Tags="|mode-line|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5334" PostTypeId="2" ParentId="5333" CreationDate="2014-12-12T18:34:37.793" Score="8" Body="&lt;p&gt;To disable the mode line in Minimap sidebars, add a hook to &lt;code&gt;minimap-sb-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'minimap-sb-mode-hook (lambda () (setq mode-line-format nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-14T16:55:16.073" LastActivityDate="2014-12-14T16:55:16.073" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5335" PostTypeId="1" AcceptedAnswerId="5353" CreationDate="2014-12-12T19:52:54.560" Score="3" ViewCount="965" Body="&lt;p&gt;Say I have a file named &lt;code&gt;foo&lt;/code&gt; in directory &lt;code&gt;bar&lt;/code&gt;. I also have &lt;code&gt;helm-mode&lt;/code&gt; enabled and am trying to rename &lt;code&gt;foo&lt;/code&gt; to &lt;code&gt;fo&lt;/code&gt; through &lt;code&gt;dired&lt;/code&gt;. Rename here ends up opening &lt;code&gt;helm-mode-dired-do-rename&lt;/code&gt; and on typing &lt;code&gt;fo&lt;/code&gt;, the only &lt;code&gt;helm&lt;/code&gt; candidate is &lt;code&gt;foo&lt;/code&gt;. How do I tell &lt;code&gt;helm&lt;/code&gt; that the name I want to use is &lt;code&gt;fo&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2022-06-30T22:12:08.113" Title="Helm-mode-dired-do-rename change name of file to a prefix of itself" Tags="|helm|dired|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5336" PostTypeId="1" AcceptedAnswerId="5337" CreationDate="2014-12-12T20:17:30.780" Score="13" ViewCount="1340" Body="&lt;p&gt;Whenever I'm editing a shell script in emacs and type three chevrons to redirect a raw string to stdin, emacs inserts the characters 'EOF' and a new line in between them, so&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat &amp;lt;&amp;lt;&amp;lt; 'some string'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat &amp;lt;&amp;lt;EOF&#xA;&amp;lt; 'some string'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can go back and delete the extra characters to get the buffer in the state I want, but this is very obnoxious behavior, and it only seems to happen in shell-script mode, which is usually the only time I type this pattern. Is there way to disable this behavior?&lt;/p&gt;&#xA;" OwnerUserId="3860" LastEditorUserId="50" LastEditDate="2014-12-12T22:24:33.823" LastActivityDate="2014-12-12T22:24:33.823" Title="Why does typing '&lt;&lt;&lt;' instead produce '&lt;&lt;EOF\n&lt;' when in shell-script mode?" Tags="|bash|shell-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5337" PostTypeId="2" ParentId="5336" CreationDate="2014-12-12T20:26:02.907" Score="13" Body="&lt;p&gt;This is caused by &lt;code&gt;sh-electric-here-document-mode&lt;/code&gt;. When enabled, &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; will insert a here document skeleton. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is enabled by default. You can disable it with a hook, such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'sh-mode-hook (lambda () (sh-electric-here-document-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-12-12T20:38:00.260" LastActivityDate="2014-12-12T20:38:00.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5338" PostTypeId="2" ParentId="5336" CreationDate="2014-12-12T20:51:31.467" Score="16" Body="&lt;p&gt;glucas is exactly correct, but to supplement his answer I have this piece of code I've used myself to make here doc insertion a little smarter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This advice, coupled with &lt;code&gt;sh-electric-here-document-mode&lt;/code&gt; enabled, make it so that if you type two chevrons the automatic here doc will be created, but then if the next character you type is another chevron, it will revert and you will be left with just &amp;lt;&amp;lt;&amp;lt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice sh--maybe-here-document (around be-smart-about-it activate)&#xA;  &quot;Do normal here doc auto insert, but if you type another chevron, revert and leave just &amp;lt;&amp;lt;&amp;lt;.&quot;&#xA;  (if (and (= (current-column) 1)&#xA;           (looking-back &quot;^&amp;lt;&quot;)&#xA;           (looking-at &quot;\nEOF&quot;)&#xA;           (save-excursion&#xA;             (forward-line -1)&#xA;             (end-of-line 1)&#xA;             (looking-back &quot;&amp;lt;&amp;lt;EOF&quot;)))&#xA;      (progn (delete-region (search-backward &quot;EOF&quot;) (search-forward &quot;EOF&quot; nil t 2))&#xA;             (insert &quot;&amp;lt;&quot;))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course this means that if you actually want to start a here doc with a chevron, you'll need to raw insert it, &lt;kbd&gt;C-q&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;&lt;/kbd&gt;. So it depends on what you do more of, if you do more here strings than here docs, this can be nice to have, even if you don't, it's rare that you'll want to start a here doc with a chevron and be inconvenienced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TZn8J.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2014-12-12T20:51:31.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5339" PostTypeId="2" ParentId="3325" CreationDate="2014-12-12T21:45:40.160" Score="1" Body="&lt;p&gt;I have used RMAIL for the past fifteen years or so (and I think there are highly respected persons on gnu.emacs.help who do). What I always did was have an external script get the mail from the POP server (I do not use IMAP) and write it to a spool file, say ~/mail/spool/inbox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setq rmail-primary-inbox-list '(&quot;~/mail/spool/inbox&quot;))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is enough for RMAIL to find the mail. I use a self-written Perl script to do the fetching, but there must be tried-and-testing programs around (there used to be a program called fetchmail - I do not know if that is still an option. Movemail is really an external program that comes with Emacs. I am not sure if movemail does the same as fetchmail, but the above pretty much sounds like it, and that it is called from within Rmail.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RMAIL can be a little confusing at first because there are so many possibilities of how you can use it. On the other hand, I have always been completely happy with it because of its simplicity -- I still do not even make use of all its functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also important to note that Rmail is not &quot;a mailer&quot;, but only a mode for reading and keeping mail. It can call a different mode for writing and sending mail, but there are also different choices available for that. Again, I use the most old-fashioned and simple one, by setting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setq mail-user-agent 'sendmail-user-agent)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The default is now a mode called message-mode.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do wish to use Rmail, and these tips do not help you, you might want to ask for help on gnu.emacs.help. Some very impressive authorities read this list and very often provide helpful answers. The Rmail info page (C-h i m Emacs m Rmail) also explains that there is also an independent movemail program available (part of 'mailutils'), which has additional options. If the plain vanilla movemail (the one which comes with Emacs) does not work for some reason, maybe the mailutils one can.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom line is: Rmail works. It sometimes requires some fiddling, but once it works, it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Florian&lt;/p&gt;&#xA;" OwnerUserId="3861" LastActivityDate="2014-12-12T21:45:40.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5340" PostTypeId="2" ParentId="4279" CreationDate="2014-12-13T02:03:03.930" Score="8" Body="&lt;p&gt;I just ran into this package:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/larstvei/ox-gfm&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/larstvei/ox-gfm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want specifically Github-Flavored Markdown, that should help.&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2014-12-13T02:03:03.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5342" PostTypeId="1" AcceptedAnswerId="5343" CreationDate="2014-12-13T07:56:20.767" Score="15" ViewCount="6760" Body="&lt;p&gt;I am using a distraction-free mode that uses giant fringes to center the buffer called &lt;a href=&quot;https://gist.github.com/bzg/8578998&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;bzg-big-fringe-mode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem is, these fringes often have a different color than the background which give an ugly visual effect (see the picture at the end).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not have a problem with fixing this manually, by setting the fringe color to the background color, like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(set-face-attribute 'fringe nil :background &quot;#3F3F3F&quot; :foreground &quot;#3F3F3F&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem is, when changing themes the fringe colors remain gray, even though that does not make sense for the new theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to programmatically set the fringe to the background color?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I need two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The ability to set the fringe background color to the default&#xA;background color. &lt;/li&gt;&#xA;&lt;li&gt;A function that is hooked to changing themes&#xA;and that does 1. above.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think I should be able to do 2) even though I have no emacs skills, but how do I do 1)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is this a bad idea for some reason? If so, what would a better approach look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/24Af7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2019-05-10T12:48:12.823" Title="How do I set the fringe colors to whatever is the background color?" Tags="|fringe|colors|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5343" PostTypeId="2" ParentId="5342" CreationDate="2014-12-13T10:37:00.477" Score="15" Body="&lt;p&gt;The official way would be customizing the theme in question to make the fringe face look the same as the background face. A face spec along the lines of &lt;code&gt;(fringe :inherit default)&lt;/code&gt; should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can modify it on the fly using a code snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-tone-down-fringes ()&#xA;  (set-face-attribute 'fringe nil&#xA;                      :foreground (face-foreground 'default)&#xA;                      :background (face-background 'default)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only problem left would be applying it on every theme change. I can't find any hook looking like it could do the job which is a bit sad, &lt;code&gt;defadvice&lt;/code&gt; doesn't seem to work out properly either. At least not in Emacs 24.4&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-12-13T17:02:28.683" LastActivityDate="2014-12-13T17:02:28.683" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5344" PostTypeId="1" AcceptedAnswerId="5345" CreationDate="2014-12-13T13:27:11.210" Score="1" ViewCount="242" Body="&lt;p&gt;I use Emacs a lot including for most terminal sessions. One of activities includes typing git commands inside a shell buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a very interesting color puzzle.&#xA;After downloading forked repository &lt;a href=&quot;https://github.com/yaitskov/java-nio-tcp-proxy&quot; rel=&quot;nofollow&quot;&gt;https://github.com/yaitskov/java-nio-tcp-proxy&lt;/a&gt; &#xA;I encountered that new lines which should be green are blank.&#xA;And only deleted lines are visible (in red color).&#xA;It was a big surprise for me because I did it a lot of times with different repositories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After trying different combinations there are facts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git diff --color&lt;/code&gt; works well in other existing and new GIT repositories&#xA;in Emacs shell, Emacs term, Emacs ansi-term and gnome-terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git diff --color&lt;/code&gt; works well for any GIT repo in&#xA;Emacs term, Emacs ansi-term and gnome-terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not all files in the repo have the bug. But most of them do (java files, &lt;code&gt;pom.xml&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But green lines are visible for &lt;code&gt;config.properties&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I aware that a shell buffer is not 100% terminal. &#xA;But I'm thrilled by this instability.&lt;/p&gt;&#xA;" OwnerUserId="3866" LastEditorUserId="25" LastEditDate="2014-12-15T23:49:54.290" LastActivityDate="2014-12-15T23:49:54.290" Title="Green lines are invisible in diff output for some files in *shell*" Tags="|shell|colors|text|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5345" PostTypeId="2" ParentId="5344" CreationDate="2014-12-13T13:57:55.637" Score="1" Body="&lt;p&gt;It seems to me that it only happens on files with DOS line endings. The carriage return at the end is apparently messing with the rendering of those lines in shell-mode.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-12-13T13:57:55.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5347" PostTypeId="1" CreationDate="2014-12-13T15:14:01.287" Score="3" ViewCount="133" Body="&lt;p&gt;I use &lt;code&gt;siunitx&lt;/code&gt; to typeset units in LaTeX. This is quite painless when typesetting it directly because of Emacs's &lt;code&gt;siunitx.el&lt;/code&gt; (see below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, sometimes I copy exercises or solutions containing units from the Web or other sources which are not formatted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I paste something like &lt;code&gt;50 m&lt;/code&gt;, &lt;code&gt;50m/s&lt;/code&gt;, &lt;code&gt;1.2 m&lt;/code&gt; or &lt;code&gt;1,2 m&lt;/code&gt; (german comma) into a file in Emacs. Now I want to be able to mark this, type &lt;code&gt;C-c C-m \SI&lt;/code&gt; and make Emacs automatically recognize units and transform them to &lt;code&gt;\SI{50}{m}&lt;/code&gt;, &lt;code&gt;\SI{50}{m\per s}&lt;/code&gt;, &lt;code&gt;\SI{1,2}{m}&lt;/code&gt; and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to modify &lt;code&gt;siunitx.el&lt;/code&gt; to achieve this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; siunitx.el --- AUCTeX style file for Siunitx&#xA;(TeX-add-style-hook &quot;siunitx&quot;&#xA;              (function&#xA;               (lambda ()&#xA;             (TeX-add-symbols&#xA;              '(&quot;SI&quot;       &quot;Value&quot; &quot;Unit&quot;)&#xA;                      '(&quot;ang&quot;      &quot;Angle&quot;)&#xA;              ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2355" LastEditDate="2014-12-13T22:56:01.770" LastActivityDate="2014-12-13T22:56:01.770" Title="Make siunitx.el automatically recognize values and unit of unformatted text" Tags="|latex|auctex|automation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5348" PostTypeId="1" AcceptedAnswerId="5393" CreationDate="2014-12-13T17:19:31.970" Score="12" ViewCount="5670" Body="&lt;p&gt;When I write C or Java code it's extremely regular, but with assembly (&lt;code&gt;asm-mode&lt;/code&gt;), it's so disorganized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;auto-complete&lt;/code&gt; and &lt;code&gt;yasnippet&lt;/code&gt;.  I created snippets and am using them, but the code organization and indentation are disorganized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What package(s) would help me:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;easily indent code and comments properly, so that I can see what each piece of code is doing;&lt;/li&gt;&#xA;&lt;li&gt;navigate that large mass of code, so I can easily jump between pieces of code?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="25" LastEditDate="2015-01-02T03:58:05.437" LastActivityDate="2015-09-04T04:55:11.677" Title="Better indentation and navigation in assembly source code" Tags="|indentation|navigation|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5349" PostTypeId="2" ParentId="5347" CreationDate="2014-12-13T18:37:34.077" Score="3" Body="&lt;p&gt;Instead of changing the existing &lt;code&gt;LaTeX-arg-siunitx-unit&lt;/code&gt; function, which is designed for interactive use, I would define a new function to do this, to be inserted in your init file.  Here is a start of a solution&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mg-LaTeX-siunitx-SI-region (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (goto-char end)&#xA;  (insert TeX-grcl)&#xA;  (goto-char beg)&#xA;  (insert (concat TeX-esc &quot;SI{&quot;))&#xA;  (skip-chars-forward &quot;[0-9\.,]&quot;)&#xA;  (insert (concat TeX-grcl TeX-grop)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It can be improved to automatically remove space between value and unit.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2014-12-13T18:37:34.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5350" PostTypeId="2" ParentId="5347" CreationDate="2014-12-13T19:08:42.180" Score="4" Body="&lt;p&gt;Something, perhaps a tad more automatic (but in general it's hard to get the representation right, you'd probably need to adjust that for your specific use-cases).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun try-replace-units (begin end)&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (goto-char begin)&#xA;    (while&#xA;        (re-search-forward&#xA;         &quot;\\&amp;lt;\\([-+]?\\([0-9]+\\|[0-9]*[.,][0-9]+\\)\\(e[0-9]+\\)?\\)\\s-*\\([a-zA-Z/]+\\)&quot; end)&#xA;      (replace-match&#xA;       (let ((num (replace-regexp-in-string&#xA;                   &quot;\\.&quot; &quot;,&quot; (match-string 1)))&#xA;             (unit (match-string 4)))&#xA;         (setf end (+ end 8))&#xA;         (format &quot;\\SI{%s}{%s}&quot;&#xA;                 num&#xA;                 (replace-regexp-in-string&#xA;                  &quot;/&quot; &quot;\\per &quot; (or unit &quot;&quot;) nil t)))&#xA;       nil t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-12-13T19:08:42.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5351" PostTypeId="1" CreationDate="2014-12-13T20:11:22.350" Score="18" ViewCount="2851" Body="&lt;p&gt;I want to perform a variant of anchored font lock matching. I have function definitions that start with a list of names, and I want those names to be highlighted inside the function body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have created a function that does this and registered it as a jit-lock function with jit-lock-register, however, performance is pretty poor and scrolling lags in larger files.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How can I measure performance? If I just time calling my function on a large file (with float-time before and after or with elp) I get wildly varying performance, it takes anything from 0.65 to 12 seconds. Is there a recommended way to benchmark font lock performance? &lt;/li&gt;&#xA;&lt;li&gt;Is there any difference in performance between an anchored matcher defined in font-lock-keywords and adding a function via jit-lock-register?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit: It seems that the variability in performance is related to garbage collection, invocations of my jit-lock function get successively slower with each invocation until garbage collection is run, at which point they get fast again.&lt;/p&gt;&#xA;" OwnerUserId="3858" LastEditorUserId="3858" LastEditDate="2014-12-16T11:18:53.687" LastActivityDate="2017-01-14T23:17:06.700" Title="Optimizing font lock performance" Tags="|font-lock|performance|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5352" PostTypeId="1" CreationDate="2014-12-13T20:52:20.883" Score="3" ViewCount="248" Body="&lt;p&gt;I read that Emacs 24.4 should restore the desktop by default. It works perfectly except that the window configuration is not retained. It is saved because I can clearly read it in the desktop file, but when it starts up there is only one window in full screen. The others are loaded in their buffers but they are not displayed.&lt;/p&gt;&#xA;" OwnerUserId="2585" LastEditorUserId="504" LastEditDate="2015-01-15T14:28:45.357" LastActivityDate="2015-06-17T06:53:14.883" Title="Emacs 24.4 in OS X 10.10 is not restoring windows configuration (desktop)" Tags="|osx|desktop|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="5353" PostTypeId="2" ParentId="5335" CreationDate="2014-12-13T21:48:20.443" Score="4" Body="&lt;p&gt;Select &lt;code&gt;foo&lt;/code&gt; &lt;kbd&gt;R&lt;/kbd&gt;, enter the new name (&lt;code&gt;fo&lt;/code&gt; in this case) and &lt;kbd&gt;C-p&lt;/kbd&gt; (to select &lt;code&gt;[?]fo&lt;/code&gt; candidate) &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2014-12-14T07:24:42.087" LastActivityDate="2014-12-14T07:24:42.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5354" PostTypeId="1" CreationDate="2014-12-13T22:22:14.327" Score="2" ViewCount="440" Body="&lt;p&gt;I have followed the instructions on &lt;a href=&quot;https://github.com/swank-js/swank-js&quot; rel=&quot;nofollow&quot;&gt;Github&lt;/a&gt; for setting up &lt;code&gt;swank-js&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed &lt;code&gt;slime&lt;/code&gt; and &lt;code&gt;slime-js&lt;/code&gt; from github and have the following in my &lt;code&gt;.emacs&lt;/code&gt; file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/slime/&quot;)  &#xA;(require 'slime-autoloads)&#xA;(setq slime-contribs '(slime-fancy slime-repl slime-js))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when I run &lt;code&gt;slime-connect&lt;/code&gt; and enter my host and port emacs tells me: &lt;code&gt;void-variable package).&lt;/code&gt; Here is the output from my node server:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Handler.prototype.receive(): (:emacs-rex (swank:connection-info) &quot;COMMON-LISP-USER&quot; t 1)&#xA;info = {&quot;pid&quot;:6145,&quot;encoding&quot;:{&quot;codingSystems&quot;:[&quot;utf-8-unix&quot;]},&quot;packageSpec&quot;:{&quot;name&quot;:&quot;NODE&quot;,&quot;prompt&quot;:&quot;NODE&quot;},&quot;implementation&quot;:{&quot;type&quot;:&quot;JS&quot;,&quot;name&quot;:&quot;JS&quot;,&quot;version&quot;:&quot;1.5&quot;},&quot;version&quot;:&quot;2012-02-12&quot;}&#xA;response: 0000c1(:return (:ok (:encoding (:coding-systems (&quot;utf-8-unix&quot;)) :lisp-implementation (:name &quot;JS&quot; :type &quot;JS&quot; :version &quot;1.5&quot;) :package (:name &quot;NODE&quot; :prompt &quot;NODE&quot;) :pid 6145 :version &quot;2012-02-12&quot;)) 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What can I do to get &lt;code&gt;swank-js&lt;/code&gt; to work? &lt;/li&gt;&#xA;&lt;li&gt;What is the &lt;code&gt;package&lt;/code&gt; variable supposed to be?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3869" LastEditorUserId="45" LastEditDate="2014-12-13T23:35:27.970" LastActivityDate="2018-04-17T18:57:50.233" Title="Can't get a Node REPL with swank-js" Tags="|slime|repl|javascript|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5355" PostTypeId="1" AcceptedAnswerId="9652" CreationDate="2014-12-14T00:01:48.947" Score="7" ViewCount="1218" Body="&lt;p&gt;I have a list of tasks I need to complete for a project I'm working on in a org file. The thing is that I would like to display the &lt;a href=&quot;https://app.wercker.com/status/74ab8b25b7c66f8c3c16b35d4682f1c9/m&quot;&gt;Wercker's status images&lt;/a&gt; of my project on that file to know how the unit tests are doing without visiting the Wercker site or the front page of my project's repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-02-27T17:09:06.293" Title="Make org-mode display images from the Internet in your org file" Tags="|org-mode|buffers|images|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5356" PostTypeId="1" CreationDate="2014-12-14T00:11:50.040" Score="5" ViewCount="249" Body="&lt;p&gt;I &lt;code&gt;\input{b.tex}&lt;/code&gt; in &lt;code&gt;a.tex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made changes to &lt;code&gt;b.tex&lt;/code&gt;, and tried to recompile &lt;code&gt;a.tex&lt;/code&gt; by &lt;code&gt;C-c C-c&lt;/code&gt; in AUCTeX, but it didn't work since &lt;code&gt;a.tex&lt;/code&gt; hadn't been changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I recompile then?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="253" LastEditDate="2014-12-14T00:50:12.293" LastActivityDate="2014-12-14T00:50:12.293" Title="Recompile tex file without modification" Tags="|latex|auctex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5357" PostTypeId="2" ParentId="5356" CreationDate="2014-12-14T00:43:39.440" Score="7" Body="&lt;p&gt;&lt;code&gt;C-c C-c&lt;/code&gt; calls &lt;code&gt;TeX-command-master&lt;/code&gt;, which prompts you for a command (with what it expects you to choose as the default option).  Even if it does not detect that the document has changed, you can always force it to compile by entering &lt;code&gt;LaTeX&lt;/code&gt; after you &lt;code&gt;C-c C-c&lt;/code&gt; and it prompts you.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-14T00:43:39.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5358" PostTypeId="1" AcceptedAnswerId="5364" CreationDate="2014-12-14T00:59:27.633" Score="35" ViewCount="13225" Body="&lt;p&gt;I have &lt;em&gt;foo-mode&lt;/em&gt; and would enable &lt;em&gt;bar-minor-mode&lt;/em&gt; for it. So which way is more common and preferable?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;A&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'foo-mode-hook 'bar-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;B&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'foo-mode-hook (lambda ()&#xA;                           &quot;Turn on `bar-minor-mode' mode.&quot;&#xA;                           (bar-minor-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;C&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bar-minor-mode-on ()&#xA;  &quot;Turn on `bar-minor-mode' mode.&quot;&#xA;  (interactive)&#xA;  (bar-minor-mode 1))&#xA;&#xA;(add-hook 'foo-mode-hook 'bar-minor-mode-on)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;D&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;• variant C, but function pushed to upstream&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;E&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;• variant C, but function stored in plugin's recipe&lt;/p&gt;&#xA;" OwnerUserId="210" LastEditorUserId="1979" LastEditDate="2014-12-14T13:21:17.007" LastActivityDate="2014-12-15T08:47:24.280" Title="Proper way to enable minor mode" Tags="|hooks|minor-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5359" PostTypeId="1" AcceptedAnswerId="5438" CreationDate="2014-12-14T01:39:11.973" Score="59" ViewCount="25678" Body="&lt;p&gt;I am writing a document and I have a problem with Emacs' performance that I think appeared just yesterday. I haven't made any alterations in my init file or installed any new packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that while I am writing, there's a very noticeable lag between pressing the letters on the keyboard and having them show up on the screen. Sometimes I watch them still printing on the screen after I have finished typing the word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if there are other issues except the speed of typing (I can only guess that there are) but I haven't noticed them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What can cause this problem?&lt;/strong&gt;&lt;br&gt;&#xA;Is it caused by Emacs or it is due to my pc's performance? Generally what are the variables that affect Emacs' performance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;My Emacs' version is GNU Emacs 24.3.1&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The major active mode is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;LaTeX&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;and the minor active modes are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Auto-Complete&lt;/li&gt;&#xA;&lt;li&gt;Auto-Composition&lt;/li&gt;&#xA;&lt;li&gt;Auto-Compression&lt;/li&gt;&#xA;&lt;li&gt;Auto-Encryption&lt;/li&gt;&#xA;&lt;li&gt;Blink-Cursor&lt;/li&gt;&#xA;&lt;li&gt;File-Name-Shadow&lt;/li&gt;&#xA;&lt;li&gt;Font-Lock&lt;/li&gt;&#xA;&lt;li&gt;Global-Auto-Complete&lt;/li&gt;&#xA;&lt;li&gt;Global-Font-Lock Global-Hl-Line&lt;/li&gt;&#xA;&lt;li&gt;Line-Number&lt;/li&gt;&#xA;&lt;li&gt;Mouse-Wheel&lt;/li&gt;&#xA;&lt;li&gt;Shell-Dirtrack&lt;/li&gt;&#xA;&lt;li&gt;Show-Paren&lt;/li&gt;&#xA;&lt;li&gt;Smartparens&lt;/li&gt;&#xA;&lt;li&gt;Smartparens-Global&lt;/li&gt;&#xA;&lt;li&gt;Tooltip Transient-Mark&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="50" LastEditDate="2014-12-16T11:54:48.990" LastActivityDate="2021-07-25T06:36:33.527" Title="How can I troubleshoot a very slow Emacs?" Tags="|performance|" AnswerCount="3" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="5360" PostTypeId="2" ParentId="5358" CreationDate="2014-12-14T02:08:04.547" Score="9" Body="&lt;p&gt;Why would you define a new command that does exactly what &lt;code&gt;bar-minor-mode&lt;/code&gt; does? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with 24.1, all of these are completely equivalent, so just use the less redundant one: option &lt;strong&gt;A&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'foo-mode-hook #'bar-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorDisplayName="user227" LastEditDate="2014-12-15T08:47:24.280" LastActivityDate="2014-12-15T08:47:24.280" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5361" PostTypeId="1" AcceptedAnswerId="5367" CreationDate="2014-12-14T03:49:59.637" Score="5" ViewCount="675" Body="&lt;p&gt;How can I insert some text (thing) at point from the buffer into the minibuffer at a text prompt or during an incremental search? Is there a convenient way to insert, e.g., the sexp &lt;em&gt;around&lt;/em&gt; point?&lt;/p&gt;&#xA;" OwnerUserId="210" LastEditorUserId="25" LastEditDate="2014-12-22T00:35:21.840" LastActivityDate="2014-12-22T00:35:21.840" Title="Use thing-at-point for isearch and minibuffer commands" Tags="|minibuffer|isearch|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="5363" PostTypeId="1" AcceptedAnswerId="5369" CreationDate="2014-12-14T04:06:34.557" Score="6" ViewCount="1886" Body="&lt;p&gt;When org-mode exports figures to LaTeX, the figure shows up left justified.  Is there an easy way to have all the figures centered?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to avoid having to type &lt;code&gt;#+ATTR_LATEX: :float t&lt;/code&gt; above each figure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would simply like each &lt;code&gt;\includegraphics&lt;/code&gt; in the exported LaTeX code to be wrapped in a &lt;code&gt;\begin{center} ... \end{center}&lt;/code&gt; block.&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2014-12-16T03:47:15.393" Title="Centered figures in org-mode LaTeX export" Tags="|org-mode|org-babel|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5364" PostTypeId="2" ParentId="5358" CreationDate="2014-12-14T04:38:30.053" Score="33" Body="&lt;p&gt;It depends on which version(s) of Emacs you are using (or targeting). Iff you are exclusively using Emacs 24+ then you can safely use variant A:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Incompatible Lisp Changes in Emacs 24.1&#xA;&#xA;** Passing a nil argument to a minor mode function call now ENABLES&#xA;the minor mode unconditionally.  This is so that you can write e.g.&#xA;&#xA; (add-hook 'text-mode-hook 'foo-mode)&#xA;&#xA;to enable foo-mode in Text mode buffers, removing the need for&#xA;`turn-on-foo-mode' style functions.  This affects all mode commands&#xA;defined by `define-minor-mode'.  If called interactively, the mode&#xA;command still toggles the minor mode.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's from the NEWS file, but as per the comments it's good practice to use function-quoting for function symbols, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'text-mode-hook #'foo-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the code might need to run under Emacs 23 (or earlier), then I would go with variant C, as personally I dislike seeing anonymous functions in hook variables. (I'm not sure I understand what you mean by variants D &amp;amp; E, mind).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-12-14T21:05:42.613" LastActivityDate="2014-12-14T21:05:42.613" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5365" PostTypeId="2" ParentId="5354" CreationDate="2014-12-14T04:38:45.240" Score="1" Body="&lt;p&gt;If you use the slime version that matches swank-js then everything just works. Specifically, I checked out the 2012-02-12 slime branch and made sure that slime-js.el was in that slime/contrib directory and everything just worked!&lt;/p&gt;&#xA;" OwnerUserId="3869" LastActivityDate="2014-12-14T04:38:45.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5366" PostTypeId="1" AcceptedAnswerId="5368" CreationDate="2014-12-14T07:16:13.607" Score="14" ViewCount="1464" Body="&lt;p&gt;Org-mode keymapping defaults to using the arrow keys for commons functions.  Has anyone sanely remapped their org-mode settings to entirely avoid arrow keys?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please share.&lt;/p&gt;&#xA;" OwnerUserId="2516" LastActivityDate="2014-12-14T16:42:34.473" Title="org-mode sans arrow keys" Tags="|org-mode|keymap|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5367" PostTypeId="2" ParentId="5361" CreationDate="2014-12-14T07:36:44.393" Score="7" Body="&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can use &lt;strong&gt;&lt;code&gt;M-.&lt;/code&gt;&lt;/strong&gt; at any time from the minibuffer to insert a thing-at-point from the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can repeat &lt;code&gt;M-.&lt;/code&gt; to either (a) append subsequent such things from the buffer or (b) change the kind of thing, inserting a different kind instead (cycling through thing types).&#xA;This is explained at &lt;a href=&quot;http://www.emacswiki.org/Icicles_-_Inserting_Text_from_Cursor&quot;&gt;Icicles - Inserting Text from Cursor&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/ThingAtPointPlus&quot;&gt;ThingAtPoint+&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/thingatpt%2b.el&quot;&gt;&lt;code&gt;thingatpt+.el&lt;/code&gt;&lt;/a&gt;) then you can grab additional kinds of thing, and you can grab them &lt;em&gt;near&lt;/em&gt; point as well as at point.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that none of this has to do with &lt;em&gt;Isearch&lt;/em&gt;, which does &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; in fact use the minibuffer (except when you use &lt;code&gt;M-e&lt;/code&gt;, to edit the search string).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to grab (yank) a thing at point and append it to your Isearch search string, you can use library &lt;a href=&quot;http://www.emacswiki.org/IsearchPlus&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/isearch%2b.el&quot;&gt;&lt;code&gt;isearch+.el&lt;/code&gt;&lt;/a&gt;) to yank these kinds of thing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y C-_&lt;/code&gt;   &lt;code&gt;isearchp-yank-symbol-or-char&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y C-(&lt;/code&gt;   &lt;code&gt;isearchp-yank-sexp-symbol-or-char&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y C-c&lt;/code&gt;   &lt;code&gt;isearchp-yank-char&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y C-e&lt;/code&gt;   &lt;code&gt;isearchp-yank-line&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y C-w&lt;/code&gt;   &lt;code&gt;isearchp-yank-word-or-char&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And you can define your own yank command that yanks whatever you want from the buffer. For example, you can have it move point around temporarily and grab, for example, the full word (or sexp or whatever) that point is in.  See the definitions of other Isearch yank commands for how this is done. It is quite simple, but since you do not specify what behavior you are after there is little sense in showing code here that tries to guess what that is.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-12-14T07:53:19.107" LastActivityDate="2014-12-14T07:53:19.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5368" PostTypeId="2" ParentId="5366" CreationDate="2014-12-14T08:02:25.170" Score="13" Body="&lt;p&gt;Without remapping, you can already get by pretty well without arrow keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-x C-h&lt;/code&gt; in an Org buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-x D       org-shiftmetadown&#xA;C-c C-x L       org-shiftmetaleft&#xA;C-c C-x R       org-shiftmetaright&#xA;C-c C-x U       org-shiftmetaup&#xA;C-c C-x d       org-metadown&#xA;C-c C-x l       org-metaleft&#xA;C-c C-x m       org-meta-return&#xA;C-c C-x r       org-metaright&#xA;C-c C-x u       org-metaup&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the comments, whether or not these keys are set depends on your environment  (for example, if you are using Emacs in the terminal or as a daemon). To make sure these always show up, you can enable &lt;code&gt;org-use-extra-keys&lt;/code&gt;. (This needs to be done before Org is loaded.)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-12-14T16:42:34.473" LastActivityDate="2014-12-14T16:42:34.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5369" PostTypeId="2" ParentId="5363" CreationDate="2014-12-14T08:36:14.217" Score="12" Body="&lt;p&gt;You can add advice to &lt;code&gt;org-latex--inline-image&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-latex--inline-image :around&#xA;            (lambda (orig link info)&#xA;              (concat&#xA;               &quot;\\begin{center}&quot;&#xA;               (funcall orig link info)&#xA;               &quot;\\end{center}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this puts &lt;em&gt;every&lt;/em&gt; inline image in &lt;code&gt;\begin{center} ... \end{center}&lt;/code&gt;, even ones that are centered already by setting &lt;code&gt;:float&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-16T03:47:15.393" LastActivityDate="2014-12-16T03:47:15.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5370" PostTypeId="2" ParentId="5298" CreationDate="2014-12-14T11:20:42.497" Score="1" Body="&lt;p&gt;stsquad's answer is good.  But there is another useful way, too.  A while back I wanted to read the &lt;a href=&quot;https://bugs.debian.org/727708&quot; rel=&quot;nofollow&quot;&gt;Debian bug&lt;/a&gt; about the systemd decision by the TC in Emacs.  The GMANE interface to the bugs mailing list works, but it was easier to just download the mbox file from the bug report and open that file in gnus; that way it was all stored locally, which avoids the latency of requesting each article individually from the NNTP server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if there's a way to download an mbox file archive of the list you want to read, that might work for you.&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2014-12-14T11:20:42.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5371" PostTypeId="1" AcceptedAnswerId="5372" CreationDate="2014-12-14T11:58:24.207" Score="47" ViewCount="16084" Body="&lt;pre&gt;&lt;code&gt;Window A&#xA;++++++++&#xA;Window B&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to switch to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Window A : Window B&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to switch view without closing windows?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2020-12-19T02:57:22.483" Title="How to change Emacs windows from vertical split to horizontal split?" Tags="|window|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5372" PostTypeId="2" ParentId="5371" CreationDate="2014-12-14T12:17:56.287" Score="18" Body="&lt;p&gt;Here's a simple function that will toggle between a horizontal and vertical split.  It assumes you've only got two windows, and doesn't do any resizing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun window-split-toggle ()&#xA;  &quot;Toggle between horizontal and vertical split with two windows.&quot;&#xA;  (interactive)&#xA;  (if (&amp;gt; (length (window-list)) 2)&#xA;      (error &quot;Can't toggle with more than 2 windows!&quot;)&#xA;    (let ((func (if (window-full-height-p)&#xA;                    #'split-window-vertically&#xA;                  #'split-window-horizontally)))&#xA;      (delete-other-windows)&#xA;      (funcall func)&#xA;      (save-selected-window&#xA;        (other-window 1)&#xA;        (switch-to-buffer (other-buffer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2014-12-14T12:37:27.897" LastActivityDate="2014-12-14T12:37:27.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5373" PostTypeId="2" ParentId="5298" CreationDate="2014-12-14T12:54:11.110" Score="3" Body="&lt;p&gt;And if you specifically want to read a thread for a certain Emacs bug, press &lt;code&gt;M-x gnus-read-ephemeral-emacs-bug-group RET 12345&lt;/code&gt;, where &lt;code&gt;12345&lt;/code&gt; is the bug number.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2014-12-14T12:54:11.110" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5374" PostTypeId="2" ParentId="5371" CreationDate="2014-12-14T12:59:12.667" Score="25" Body="&lt;p&gt;Alternatively, there's a &lt;a href=&quot;http://www.emacswiki.org/emacs/TransposeFrame&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;tranpose-frame&lt;/code&gt; package on EmacsWiki&lt;/a&gt; that will allow you to transpose the whole frame, as well as do other transformations (rotate by by 180 degrees; rotate by 90 degrees clockwise or counterclockwise; flip horizontally or vertically).&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorDisplayName="user12563" LastEditDate="2018-12-30T15:13:05.663" LastActivityDate="2018-12-30T15:13:05.663" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5375" PostTypeId="2" ParentId="5366" CreationDate="2014-12-14T15:11:20.053" Score="3" Body="&lt;p&gt;Yay, finally a moment to shamelessly advertise &lt;a href=&quot;http://abo-abo.github.io/worf/README.html&quot; rel=&quot;nofollow&quot;&gt;http://abo-abo.github.io/worf/README.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;h&lt;/kbd&gt;, &lt;kbd&gt;j&lt;/kbd&gt;, &lt;kbd&gt;k&lt;/kbd&gt; and &lt;kbd&gt;l&lt;/kbd&gt; are arrows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;c&lt;/kbd&gt; toggles change mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(worf-defverb&#xA; &quot;change&quot;&#xA; '((&quot;j&quot; org-metadown)&#xA;   (&quot;k&quot; org-metaup)&#xA;   (&quot;h&quot; org-metaleft)&#xA;   (&quot;l&quot; org-metaright)&#xA;   (&quot;t&quot; org-set-tags :disable)&#xA;   (&quot;n&quot; worf-change-name :disable :break)&#xA;   (&quot;a&quot; org-meta-return :disable :break)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;cf&lt;/kbd&gt; enters change tree mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(worf-defverb&#xA; &quot;change-tree&quot;&#xA; '((&quot;j&quot; org-shiftmetadown)&#xA;   (&quot;k&quot; org-shiftmetaup)&#xA;   (&quot;h&quot; org-shiftmetaleft)&#xA;   (&quot;l&quot; org-shiftmetaright)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;cs&lt;/kbd&gt; enters change shift mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(worf-defverb&#xA; &quot;change-shift&quot;&#xA; '((&quot;j&quot; org-shiftdown)&#xA;   (&quot;k&quot; org-shiftup)&#xA;   (&quot;h&quot; org-shiftleft)&#xA;   (&quot;l&quot; org-shiftright)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;cr&lt;/kbd&gt; enters change shift-control mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(worf-defverb&#xA; &quot;change-shiftcontrol&quot;&#xA; '((&quot;j&quot; org-shiftcontroldown)&#xA;   (&quot;k&quot; org-shiftcontrolup)&#xA;   (&quot;h&quot; org-shiftcontrolleft)&#xA;   (&quot;l&quot; org-shiftcontrolright)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;q&lt;/kbd&gt; will quit any mode and make &lt;kbd&gt;hjkl&lt;/kbd&gt; arrows again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still experimenting with the package, so these bindings might&#xA;change in the future. If you want to try it, it's in MELPA.  And as&#xA;long as you're trying, check out &lt;kbd&gt;g&lt;/kbd&gt; - it's the best feature&#xA;of the package.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-14T15:11:20.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5376" PostTypeId="1" AcceptedAnswerId="5382" CreationDate="2014-12-14T16:31:54.577" Score="7" ViewCount="364" Body="&lt;p&gt;If you set an input method (for example via &lt;code&gt;M-x set-input-method&lt;/code&gt; RET &lt;code&gt;cyrillic-translit&lt;/code&gt; RET) you can type Cyrillic characters using a US keyboard: Emacs will use transliteration rules to convert Roman characters into Cyrillic ones. If you look in &lt;code&gt;cyrillic.el&lt;/code&gt;, you see for example &lt;code&gt;(&quot;f&quot; ?ф)&lt;/code&gt;, i.e., typing &lt;code&gt;f&lt;/code&gt; gives &lt;code&gt;ф&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now imagine you are editing a LaTeX file and &lt;code&gt;LaTeX-mode&lt;/code&gt; (&lt;a href=&quot;http://www.gnu.org/software/auctex/&quot; rel=&quot;nofollow noreferrer&quot;&gt;AUCTeX&lt;/a&gt;) in enabled. You use Cyrillic characters in the body of the text and Roman characters in formulae. In this context you would like  &lt;code&gt;f&lt;/code&gt; to produce &lt;code&gt;f&lt;/code&gt; and &lt;strong&gt;not&lt;/strong&gt; &lt;code&gt;ф&lt;/code&gt; in math mode, (i.e. in &lt;code&gt;$...$&lt;/code&gt;, &lt;code&gt;\[...\]&lt;/code&gt;, &lt;code&gt;\(...\)&lt;/code&gt;, and in math environments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand the question &lt;a href=&quot;https://emacs.stackexchange.com/q/547/2609&quot;&gt;how to detect if inside a LaTeX math environment?&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/a/548/2609&quot;&gt;this answer&lt;/a&gt; correctly, the function &lt;code&gt;texmathp&lt;/code&gt; can detect if we are in a math environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is about the possibility of the following conditional transliteration using &lt;code&gt;quail&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;typing &lt;code&gt;f&lt;/code&gt; gives &lt;code&gt;f&lt;/code&gt; inside a LaTeX math environments and &lt;code&gt;ф&lt;/code&gt; elsewhere. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-12-16T01:37:36.020" Title="How can I disable quail input methods in LaTeX formulas?" Tags="|keymap|auctex|input-method|quail|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5377" PostTypeId="1" AcceptedAnswerId="5381" CreationDate="2014-12-14T16:40:07.950" Score="13" ViewCount="3051" Body="&lt;p&gt;I have an org-mode file that's running around 6,000 lines with a hundred or so top-level headlines. It's started to take around a minute to load or save, and occasionally it sends emacs into the weeds and I have to force-quit it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do any of you think this is too big a file to handle practically in org-mode?  Do you have experience with bigger files? Do you experience the same kinds of delays?  Or should I be looking elsewhere for the causes of the slowness, like all the other emacs packages I have installed? Maybe I'm just asking too much of emacs in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is with homebrew emacs 24.4 on Mac OS X Mavericks. &lt;/p&gt;&#xA;" OwnerUserId="596" LastActivityDate="2014-12-14T19:18:27.927" Title="practical limits on org-mode file size?" Tags="|org-mode|performance|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5378" PostTypeId="2" ParentId="5377" CreationDate="2014-12-14T17:22:11.263" Score="3" Body="&lt;p&gt;I stripped every package out of my emacs environment, and now org-mode runs fine on my 6,000-line file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other thing I had loaded was causing the problem. I will have to bisect my package installations to figure out what it is, but org-mode seems fine now.&lt;/p&gt;&#xA;" OwnerUserId="596" LastActivityDate="2014-12-14T17:22:11.263" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5379" PostTypeId="2" ParentId="3853" CreationDate="2014-12-14T18:10:08.447" Score="0" Body="&lt;p&gt;I've eventually written one function per hook as suggested in the comments. Thanks to @lunaryorn for the suggestion.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-14T18:10:08.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5380" PostTypeId="2" ParentId="5348" CreationDate="2014-12-14T18:38:22.163" Score="3" Body="&lt;p&gt;You might try Gas Mode. It should help you with your issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/GasMode&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/GasMode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2743" LastActivityDate="2014-12-14T18:38:22.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5381" PostTypeId="2" ParentId="5377" CreationDate="2014-12-14T19:18:27.927" Score="19" Body="&lt;p&gt;One of the less known features of Emacs is that it has a profiler! Let's assume your file is called &lt;code&gt;foo.org&lt;/code&gt;, then you could do this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;profiler-start&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x f&lt;/kbd&gt;&lt;code&gt;foo.org&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;profiler-report&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you've done all that Emacs will pop up a buffer with statistics on CPU usage (you can also choose to profile memory or both CPU and memory, when you start the profiler). This should give you some clues as to what functions take most time to execute.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-12-14T19:18:27.927" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5382" PostTypeId="2" ParentId="5376" CreationDate="2014-12-14T19:42:57.887" Score="6" Body="&lt;p&gt;It's been almost 10 years since the last time I needed to edit a LaTeX document in Russian, but I can relate. :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Invoking-the-Input-Method.html#Invoking-the-Input-Method&quot; rel=&quot;nofollow&quot;&gt;Emacs Lisp Manual&lt;/a&gt; every input method should disable key translation and conversion if &lt;code&gt;overriding-local-map&lt;/code&gt; is set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We should be able to rely on this to disable &lt;code&gt;quail&lt;/code&gt; conditionally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs 24.4 and later (using the new advising mechanism), add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'quail-input-method :around&#xA;            (lambda (orig key)&#xA;              &quot;Disable quail-input-method in TeX and LaTeX formulas. Uses AUCTeX.&quot;&#xA;              (if (and (eq major-mode 'latex-mode)&#xA;                       (fboundp 'texmathp)&#xA;                       (texmathp))&#xA;                  (let ((overriding-local-map t))&#xA;                    (funcall orig key))&#xA;                (funcall orig key))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I check if the current major mode is &lt;code&gt;latex-mode&lt;/code&gt;; you may need to adjust that. (We have to check the major mode because once AUCTeX is loaded &lt;code&gt;texmathp&lt;/code&gt; is bound in all buffers, and we don't want to mess with input methods just because there are dollar signs in the current buffer.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In older Emacs versions (tested under Emacs 23.4.1) we have to use &lt;code&gt;defadvice&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice quail-input-method (around disable-quail-in-formulas activate)&#xA;  &quot;Disable quail-input-method in TeX and LaTeX formulas. Uses AUCTeX.&quot;&#xA;  (if (and (eq major-mode 'latex-mode)&#xA;           (fboundp 'texmathp)&#xA;           (texmathp))&#xA;      (let ((overriding-local-map t))&#xA;        ad-do-it)&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-15T22:41:49.080" LastActivityDate="2014-12-15T22:41:49.080" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5383" PostTypeId="1" AcceptedAnswerId="5385" CreationDate="2014-12-14T20:10:01.963" Score="3" ViewCount="2514" Body="&lt;p&gt;I am beginner using Emacs 23.4, and I wanted to try a web browser package. From &lt;a href=&quot;http://www.emacswiki.org/emacs/CategoryWebBrowser&quot; rel=&quot;nofollow&quot;&gt;Emacs wiki&lt;/a&gt;, I found &lt;a href=&quot;http://www.emacswiki.org/emacs/eww&quot; rel=&quot;nofollow&quot;&gt;eww&lt;/a&gt;. But when Emacs starts I get from *Warnings*:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Cannot open load file, shr&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the same thing when I do &lt;code&gt;M-x load-library RET shr&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I did for installing eww was saving the &lt;code&gt;eww.el&lt;/code&gt; file in my &lt;code&gt;~/.emacs.d/&lt;/code&gt; directory and added this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/&quot;)&#xA;(require 'eww)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;~/.emacs&lt;/code&gt; file as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't find the &lt;code&gt;shr&lt;/code&gt; package to download on internet, and that is why I am lost. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="3876" LastEditorUserId="50" LastEditDate="2014-12-15T16:37:05.787" LastActivityDate="2014-12-15T16:37:05.787" Title="How can I install eww or shr in Emacs 23?" Tags="|eww|libraries|shr|emacs23|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5384" PostTypeId="2" ParentId="5358" CreationDate="2014-12-14T20:15:55.707" Score="8" Body="&lt;p&gt;Here's one more way to do it that has some advantages,&#xA;assuming that you're editing your own config, not a package that&#xA;you distribute.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'foo-mode-hook&#xA;          #'custom-foo-hook)&#xA;&#xA;(defun custom-foo-hook ()&#xA;  (bar-minor-mode 1)&#xA;  (baz-minor-mode 1)&#xA;  ;; ...&#xA;  (define-key foo-mode-map &quot;C-c C-b&quot; #'foobar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advantage is that everything is stored in one hook, so to disable&#xA;some stuff, you don't have to do &lt;code&gt;remove-hook&lt;/code&gt;, but instead comment&#xA;some stuff in &lt;code&gt;custom-foo-hook&lt;/code&gt; and &lt;kbd&gt;C-M-x&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can even write a command that jumps from any mode to it's custom&#xA;hook. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-14T20:15:55.707" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5385" PostTypeId="2" ParentId="5383" CreationDate="2014-12-14T20:56:49.597" Score="6" Body="&lt;p&gt;&lt;code&gt;shr&lt;/code&gt; and &lt;code&gt;eww&lt;/code&gt; can't work in Emacs 23. Regardless of other incompatibilities, they require Emacs to have been compiled with libxml2 support, and that ability came in 24.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to try eww, you should install Emacs 24.4 or later (&quot;later&quot; currently meaning compiling from the source repository).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that eww is built into these versions (24.4+) of Emacs, so in general you shouldn't use downloaded versions of eww with them. Delete any such files from your config, otherwise you might be overriding the in-built version with an incompatible version.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-12-15T05:11:56.320" LastActivityDate="2014-12-15T05:11:56.320" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5386" PostTypeId="2" ParentId="251" CreationDate="2014-12-14T21:50:40.810" Score="7" Body="&lt;p&gt;I use agda-mode with a lot of mathematical symbols and have had the same problem. Used to be the only real solution was as @shosti suggests: customizing the font mappings. In my case, I had to disable a number of fonts because even though I had fonts installed with particular glyphs defined, emacs would often choose the wrong one (displaying boxes). Seemed to be worse on OSX but I've seen it on Linux too. So just having the right fonts installed wasn't enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do now is use Roland Walker's excellent &lt;a href=&quot;https://github.com/rolandwalker/unicode-fonts&quot;&gt;unicode-fonts&lt;/a&gt; package. (I would recommend installing it through MELPA.) This has pretty much eliminated the issue entirely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put this in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unicode-fonts-setup)&#xA;(set-frame-font &quot;PragmataPro 12&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use PragmataPro by default but any other font with good coverage will work too and you can customize things further with the package if needed.&lt;/p&gt;&#xA;" OwnerUserId="3879" LastActivityDate="2014-12-14T21:50:40.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5387" PostTypeId="1" AcceptedAnswerId="5390" CreationDate="2014-12-14T23:03:10.847" Score="46" ViewCount="12624" Body="&lt;p&gt;Although it is convenient how org-mode shows hyperlinks, there are times when I want to see the underlying plain text, e.g. &lt;code&gt;[[./file.org][Title]]&lt;/code&gt;. How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;code&gt;org-insert-link&lt;/code&gt;, but it is not what I want:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-c C-l runs the command org-insert-link, which is an interactive compiled Lisp&#xA;  function in `org.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If there is already a link at point, this command will allow you to edit link&#xA;  and description parts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2021-09-09T11:48:58.527" Title="Show org-mode hyperlink as plain text" Tags="|org-mode|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5388" PostTypeId="2" ParentId="5387" CreationDate="2014-12-14T23:06:13.523" Score="3" Body="&lt;p&gt;I've been using this function. It will toggle between&#xA;&lt;code&gt;fundamental-mode&lt;/code&gt; and the original mode (&lt;code&gt;org-mode&lt;/code&gt; in this case).&#xA;It's a bit weird, but I like it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun illiterate ()&#xA;  (interactive)&#xA;  (let ((coding-system-for-read 'utf-8))&#xA;    (if (eq major-mode 'fundamental-mode)&#xA;        (revert-buffer nil t)&#xA;      (let ((pt (1+ (length&#xA;                     (encode-coding-string&#xA;                      (buffer-substring-no-properties (point-min) (point))&#xA;                      'utf-8))))&#xA;            (file-name (buffer-file-name)))&#xA;        (kill-buffer (current-buffer))&#xA;        (find-file-literally file-name)&#xA;        (goto-char pt)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-14T23:06:13.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5389" PostTypeId="1" AcceptedAnswerId="5431" CreationDate="2014-12-14T23:08:20.333" Score="18" ViewCount="1835" Body="&lt;p&gt;This is a two part question having to do with &lt;a href=&quot;https://en.wikipedia.org/wiki/Link_rot&quot;&gt;link rot&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does org-mode provide any functionality for validating hyperlinks, especially local ones? This could be used to combat link rot after the fact.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Even better, does org provide functionality so that if I rename a file in dired, it will update affected files? This could prevent some kinds of link rot before it happens, at least for local files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2023-06-14T22:53:25.697" Title="Correcting and maintaining org-mode hyperlinks" Tags="|org-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5390" PostTypeId="2" ParentId="5387" CreationDate="2014-12-14T23:10:08.170" Score="46" Body="&lt;p&gt;I just found a nice function in the org source code: &lt;code&gt;M-x org-toggle-link-display&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the source code, just for fun:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-toggle-link-display ()&#xA;  &quot;Toggle the literal or descriptive display of links.&quot;&#xA;  (interactive)&#xA;  (if org-descriptive-links&#xA;      (progn (org-remove-from-invisibility-spec '(org-link))&#xA;         (org-restart-font-lock)&#xA;         (setq org-descriptive-links nil))&#xA;    (progn (add-to-invisibility-spec '(org-link))&#xA;       (org-restart-font-lock)&#xA;       (setq org-descriptive-links t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2014-12-14T23:10:08.170" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5391" PostTypeId="2" ParentId="2410" CreationDate="2014-12-15T00:07:32.160" Score="36" Body="&lt;p&gt;See the &lt;a href=&quot;https://github.com/vermiculus/sx.el/&quot; rel=&quot;noreferrer&quot;&gt;Stack Exchange for Emacs&lt;/a&gt; project. From their page:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;SX will be a full featured Stack Exchange mode for GNU Emacs 24+.&#xA;  Using the official API, we aim to create a more versatile experience&#xA;  for the Stack Exchange network within Emacs itself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/JvYW7.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="163" LastEditorUserId="2264" LastEditDate="2015-01-03T01:19:16.327" LastActivityDate="2015-01-03T01:19:16.327" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="5392" PostTypeId="2" ParentId="5387" CreationDate="2014-12-15T01:07:33.743" Score="2" Body="&lt;p&gt;A low-tech way is to move point to the beginning of the link text and type C-d (i.e., invoke &lt;code&gt;org-delete-char&lt;/code&gt;).  That removes the first &quot;[&quot; character, so that you no longer have a properly formatted hyperlink, and you can see the remainder of it as raw text.  Then when you're done, just invoke &lt;code&gt;undo&lt;/code&gt; to restore it to what you had previously.&lt;/p&gt;&#xA;" OwnerUserId="3890" LastActivityDate="2014-12-15T01:07:33.743" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5393" PostTypeId="2" ParentId="5348" CreationDate="2014-12-15T03:14:05.723" Score="11" Body="&lt;p&gt;Just use the built-in &lt;code&gt;asm-mode&lt;/code&gt;. It gives you syntax highlighting for any assembly languages. &lt;code&gt;gas-mode&lt;/code&gt; does not do that and is not usable with AT&amp;amp;T syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to set indentation for &lt;code&gt;asm-mode&lt;/code&gt;, note that you cannot use &lt;code&gt;tab-width&lt;/code&gt; but &lt;code&gt;tab-stop-list&lt;/code&gt; that specifies spaces that 1 tab, 2 tabs, 3 tabs... can display:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60&#xA;                      64 68 72 76 80 84 88 92 96 100 104 108 112&#xA;                      116 120))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above example means that the fist tab has 4 spaces, 2nd tab (next to the first tab) has 8 spaces, 3rd tab (next to the second tab) has 12 spaces... and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also generate the list like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tab-stop-list (number-sequence 2 60 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;number-sequence&lt;/code&gt; generates a list of number, with starting number &lt;code&gt;2&lt;/code&gt; (the first argument) upto &lt;code&gt;60&lt;/code&gt; (the second argument), each number differs by &lt;code&gt;2&lt;/code&gt; to the number next to it. And remember to bind &lt;code&gt;newline-and-indent&lt;/code&gt; to RET, so Emacs automatically indents for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to jump around, use Ctags like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ctags -e -R&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;-e&lt;/code&gt; means generate tag database to be used by Emacs.&#xA;&lt;code&gt;-R&lt;/code&gt; means recursively generate tags for files in sub-directories from project root.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, you can use &lt;code&gt;helm-etags-select&lt;/code&gt; to jump around or another &lt;code&gt;etags&lt;/code&gt; client in Emacs if you don't use Helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Here is a sample setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'asm-mode)&#xA;(add-hook 'asm-mode-hook (lambda ()&#xA;                           (setq indent-tabs-mode nil) ; use spaces to indent&#xA;                           (electric-indent-mode -1) ; indentation in asm-mode is annoying&#xA;                           (setq tab-stop-list (number-sequence 2 60 2))))&#xA;&#xA;(define-key asm-mode-map (kbd &quot;&amp;lt;ret&amp;gt;&quot;) 'newline-and-indent)&#xA;(define-key asm-mode-map (kbd &quot;M-.&quot;) 'helm-etags-select)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also have basic completion with &lt;code&gt;company-complete&lt;/code&gt; when pressing &lt;code&gt;S-TAB&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key asm-mode-map (kbd &quot;&amp;lt;backtab&amp;gt;&quot;) 'company-complete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; to trigger completion because both &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; and &lt;code&gt;M-i&lt;/code&gt; run the same command &lt;code&gt;tab-to-tab-stop&lt;/code&gt; that inserts spaces or tabs depends on your setting of &lt;code&gt;indent-tabs-mode&lt;/code&gt;. The nice thing with &lt;code&gt;company-mode&lt;/code&gt; is that you get a brief description of currently highlighted candidate in the minibuffer, if available. For example, if you have a definition like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;KeyStrokes  word    0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you move the cursor to &lt;code&gt;KeyStrokes&lt;/code&gt; candidate, it prints &lt;code&gt;word    0&lt;/code&gt; in the minibuffer.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-09-04T04:55:11.677" LastActivityDate="2015-09-04T04:55:11.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5394" PostTypeId="1" AcceptedAnswerId="7319" CreationDate="2014-12-15T05:28:56.950" Score="0" ViewCount="728" Body="&lt;p&gt;I am behind a web proxy trying to connect to &lt;a href=&quot;http://marmalade-repo.org/packages/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;marmalade&lt;/strong&gt;&lt;/a&gt;. Strangely, &lt;a href=&quot;https://elpa.gnu.org/packages/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;elpa&lt;/strong&gt;&lt;/a&gt; works just fine, but marmalade fails. This is the traceback:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Error during download request: handshakefailed&quot;)&#xA;  signal(error (&quot;Error during download request: handshakefailed&quot;))&#xA;  error(&quot;Error during download request:%s&quot; &quot; handshakefailed&quot;)&#xA;  package-handle-response()&#xA;  package--download-one-archive((&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;) &quot;archive-contents&quot;)&#xA;  #[nil &quot;\301\302\&quot;\207&quot; [archive package--download-one-archive &quot;archive-contents&quot;] 3]()&#xA;  package-refresh-contents()&#xA;  call-interactively(package-refresh-contents record nil)&#xA;  command-execute(package-refresh-contents record)&#xA;  execute-extended-command(nil &quot;package-refresh-contents&quot;)&#xA;  call-interactively(execute-extended-command nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've no idea how to debug this. I tried emacs &lt;strong&gt;24.4&lt;/strong&gt; and &lt;strong&gt;24.3&lt;/strong&gt;, and both &lt;strong&gt;http&lt;/strong&gt; and &lt;strong&gt;https&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3895" LastActivityDate="2015-01-13T00:29:07.623" Title="marmalade refused my handshake" Tags="|package|package-repositories|proxy|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5395" PostTypeId="1" CreationDate="2014-12-15T05:48:24.797" Score="13" ViewCount="2255" Body="&lt;p&gt;I would like to make it easy to find where are the free blocks of time in my org-mode agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if I have two appointments one 9:30am-10:30am and another 11:15am-12:30pm, I would like to see at a glance that the 10:30am-11:15am block is free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I want to be able to distinguish free time as easily as it is done in a graphical agenda such as Google calendar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make the empty blocks of time easy to see?  Perhaps to colorize the empty blocks that are longer than a given number of minutes?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2017-12-10T00:54:01.770" Title="Show free blocks of time in org-mode's agenda" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5396" PostTypeId="1" AcceptedAnswerId="5399" CreationDate="2014-12-15T09:54:06.983" Score="15" ViewCount="1878" Body="&lt;p&gt;I'm trying to make myself use Ido mode. Some times it's nice, but other times it is extremely stupid. Here's my greatest disappointment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read some log with full file names, then I copy one name, try open that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way to do this without Ido: &lt;kbd&gt;C-a&lt;/kbd&gt;&lt;kbd&gt;C-y&lt;/kbd&gt;&lt;kbd&gt;C-k&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Ido there are two major problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I have the entire file name, there's no way to input that (I must remove the first slash, else even pressing &lt;kbd&gt;//&lt;/kbd&gt; will not help.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I can't edit intermediate parts of the file name leaving the rest unmodified.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Or can I?&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-10-03T01:07:21.203" Title="How to tell Ido to get out of the way when I can already just paste the file name?" Tags="|files|ido|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5397" PostTypeId="2" ParentId="5396" CreationDate="2014-12-15T10:04:18.270" Score="4" Body="&lt;p&gt;Maybe like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ido-file-dir-completion-map (kbd &quot;C-y&quot;) 'ido-yank)&#xA;(defun ido-yank ()&#xA;  (interactive)&#xA;  (if (file-exists-p (current-kill 0))&#xA;      (ido-fallback-command)&#xA;    (yank)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the current kill is a file that exists, doing &lt;kbd&gt;C-y C-y&lt;/kbd&gt;&#xA;should probably give you what you want.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-15T10:04:18.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5399" PostTypeId="2" ParentId="5396" CreationDate="2014-12-15T11:01:05.783" Score="18" Body="&lt;p&gt;While an &lt;code&gt;ido&lt;/code&gt; command is active (&lt;code&gt;ido-find-file&lt;/code&gt; in this case), you can drop back to the &lt;em&gt;non-ido&lt;/em&gt; version of the same command (&lt;code&gt;find-file&lt;/code&gt; in this case) using the ido-default binding &lt;code&gt;C-x C-f&lt;/code&gt; for &lt;code&gt;ido-fallback-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer you question,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The first &lt;code&gt;C-x C-f&lt;/code&gt; will call &lt;code&gt;ido-find-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The second &lt;code&gt;C-x C-f&lt;/code&gt; will fall back to &lt;code&gt;find-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Then you can do &lt;code&gt;C-a C-y C-k&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; as you usually do to yank a copied file path into the minibuffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: In &lt;code&gt;ido&lt;/code&gt;, &lt;code&gt;C-x C-f C-x C-f&lt;/code&gt; will do the same thing as &lt;code&gt;C-x C-f C-f&lt;/code&gt;, i.e. fall back to &lt;code&gt;find-file&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;About &lt;code&gt;C-f&lt;/code&gt; in &lt;code&gt;ido&lt;/code&gt;&lt;/strong&gt;&#xA;In &lt;code&gt;ido-mode&lt;/code&gt;, &lt;code&gt;C-f&lt;/code&gt; is bound to &lt;code&gt;ido-magic-forward-char&lt;/code&gt;. From &lt;code&gt;ido.el&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun ido-magic-forward-char (arg)&#xA;  &quot;Move forward in user input or perform magic action.&#xA;If no user input is present, or at end of input, perform magic actions:&#xA;C-x C-b ... C-f  switch to `ido-find-file'.&#xA;C-x C-f ... C-f  fallback to non-Ido `find-file'.&#xA;C-x C-d ... C-f  fallback to non-Ido brief `dired'.&#xA;C-x d ... C-f    fallback to non-Ido `dired'.&quot;&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastEditorUserId="115" LastEditDate="2014-12-15T16:17:15.837" LastActivityDate="2014-12-15T16:17:15.837" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5400" PostTypeId="1" AcceptedAnswerId="5408" CreationDate="2014-12-15T12:07:17.323" Score="14" ViewCount="1458" Body="&lt;p&gt;I have a buffer that shows documentation for Ansible modules.  This buffer has its own major mode which provides all the standard stuff.  Notably, it fontifies the buffer to highlight inline markup, options, sections, etc.  All in all, it is pretty similar to &lt;code&gt;M-x man&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the bottom of the documentation there are usually some code examples in YAML.  I'd like to fontify these as well.  I could add my own font lock keywords for YAML, of course, but I'd rather prefer to re-use the fontification of YAML Mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that?  Specifically, how can I use a different major mode to fontify a particular region of a buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that YAML Mode doesn't need to be &lt;strong&gt;active&lt;/strong&gt; in this region.  The whole buffer is only a passive display buffer, and not intended to be edited.  I really only need the fontification produced as if YAML Mode were active in that region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I presume I could copy the region of the buffer to a temporary buffer, enable YAML Mode, fontify the buffer, and the copy all text properties over.  Would that work?  If so, how do I copy text properties, and what are the relevant properties to copy?  Or is there a better approach?&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2018-06-30T16:45:18.027" Title="Fontify a region of a buffer with another major mode" Tags="|font-lock|region|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5401" PostTypeId="1" AcceptedAnswerId="5405" CreationDate="2014-12-15T12:09:37.737" Score="9" ViewCount="752" Body="&lt;p&gt;I have this in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'λ 'lambda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works fine for simple things like &lt;code&gt;(funcall (λ (x) x) 1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I do something like &lt;code&gt;(org-add-link-type &quot;foo&quot; (λ (s) (message s)))&lt;/code&gt; or &lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;foo&quot; . (λ () (message &quot;bar&quot;))))&lt;/code&gt;, it doesn't work and I get&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-open-at-point: Invalid function: (λ (s) (message s))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;File mode specification error: (invalid-function (λ nil (message &quot;bar&quot;)))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know what's wrong here?&lt;/p&gt;&#xA;" OwnerUserId="3905" LastActivityDate="2014-12-15T13:29:05.177" Title="How to defalias lambda?" Tags="|elisp|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5402" PostTypeId="2" ParentId="5400" CreationDate="2014-12-15T12:51:05.797" Score="3" Body="&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/NarrowIndirect&quot; rel=&quot;nofollow noreferrer&quot;&gt;Narrow Indirect&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/narrow-indirect.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;narrow-indirect&lt;/code&gt;&lt;/a&gt;) can help here -- have a look at the header commentary.  It relies on:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;narrowing, which limit editing to a portion on a buffer, and &lt;/li&gt;&#xA;&lt;li&gt;indirect buffers, which copy a buffer in another one for which you can change the major mode.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that narrowing is disabled by default because it is considered beginner-unfriendly (the default binding is &lt;code&gt;C-x n n&lt;/code&gt;).  You can enable it by putting the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'narrow-to-region 'disabled nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also look at for my handmade &lt;code&gt;myfn-narrow-indirect&lt;/code&gt; in my &lt;a href=&quot;https://gist.github.com/freakhill/247865538d7c4f3d500e&quot; rel=&quot;nofollow noreferrer&quot;&gt;conf&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2756" LastEditorUserId="105" LastEditDate="2018-06-30T16:45:18.027" LastActivityDate="2018-06-30T16:45:18.027" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="5403" PostTypeId="2" ParentId="5401" CreationDate="2014-12-15T12:51:43.583" Score="3" Body="&lt;p&gt;It looks like the problem is not with the &lt;code&gt;defalias&lt;/code&gt;, but rather where and how you're calling &lt;code&gt;λ&lt;/code&gt;.  &lt;code&gt;funcall&lt;/code&gt; takes, as its arguments, a function and that function's arguments, so your &lt;code&gt;funcall&lt;/code&gt; example works just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both &lt;a href=&quot;http://orgmode.org/manual/Adding-hyperlink-types.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-add-link-type&lt;/code&gt;&lt;/a&gt; and the &lt;a href=&quot;http://www.emacswiki.org/emacs/AutoModeAlist&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-mode-alist&lt;/code&gt;&lt;/a&gt;, however, expect symbols that contain the relevant functions.  Hence, building off of your examples, the following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun a-silly-fnx (s)&#xA;  (message s))&#xA;(defalias #'my-link-alias #'a-silly-fnx)&#xA;(org-add-link-type &quot;foo&quot; #'my-link-alias)&#xA;&#xA;(defun a-tester-fnx ()&#xA;  (message &quot;Testing!&quot;)&#xA;  (sit-for 2))&#xA;(defalias #'my-alist-alias #'a-tester-fnx)&#xA;(add-to-list 'auto-mode-alist '(&quot;foo&quot; . my-alist-alias))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're mostly looking to have &lt;code&gt;λ&lt;/code&gt; show up in your buffer, consider trying out &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_pretty_lambda.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;prettify-symbols-mode&lt;/code&gt;&lt;/a&gt;, which will display &lt;code&gt;lambda&lt;/code&gt; as &lt;code&gt;λ&lt;/code&gt; without changing th buffer's text.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-15T12:51:43.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5404" PostTypeId="1" AcceptedAnswerId="5409" CreationDate="2014-12-15T13:10:25.860" Score="13" ViewCount="375" Body="&lt;p&gt;I have a macro that needs to be expanded at every single instance of&#xA;its use compile-time.  Is there a way I can specify this to be so&#xA;without going through the codebase and carefully wrapping each call&#xA;with &lt;code&gt;eval-when-compile&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-12-15T23:52:17.163" Title="Are macros expanded when the file is compiled?" Tags="|byte-compilation|elisp-macros|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5405" PostTypeId="2" ParentId="5401" CreationDate="2014-12-15T13:21:25.713" Score="12" Body="&lt;p&gt;With some help from &lt;a href=&quot;https://emacs.stackexchange.com/users/227/lunaryorn&quot;&gt;lunaryorn&lt;/a&gt; on &lt;a href=&quot;http://www.reddit.com/r/emacs/comments/2pavya/how_to_properly_defalias_lambda/cmvg73r&quot; rel=&quot;nofollow noreferrer&quot;&gt;reddit&lt;/a&gt;, I guess I have been able to understand why you are observing the &quot;wierd&quot; behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that you are quoting the expression&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(&quot;foo&quot; . (λ () (message &quot;bar&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is equivalent to the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cons &quot;foo&quot; '(λ () (message &quot;bar&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when emacs opens a file with extension &quot;foo&quot;, it does something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall '(λ () (message &quot;bar&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice the extra quote, before &lt;code&gt;(λ&lt;/code&gt;, this obviously is not valid function and you get the error &lt;code&gt;Invalid function: ...&lt;/code&gt;&#xA;But then why does &lt;code&gt;(&quot;foo&quot; . (lambda () (message &quot;bar&quot;)))&lt;/code&gt; work, this is explained by lunaryorn's observation&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A “lambda list”, i.e. a list whose car is lambda, is a valid function, too&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;'(lambda () (message &quot;bar&quot;))&lt;/code&gt; is a valid function, this can be verified by the following code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(functionp (lambda () &quot;hello&quot;))  =&amp;gt; t&#xA;(functionp (λ () &quot;hello&quot;))       =&amp;gt; t&#xA;(functionp '(lambda () &quot;hello&quot;)) =&amp;gt; t&#xA;(functionp '(λ () &quot;hello&quot;))      =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the solution would be to simply not quote the expression use the following instead&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist (cons &quot;foo&quot; (λ () (bar))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-15T13:29:05.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5406" PostTypeId="2" ParentId="5400" CreationDate="2014-12-15T13:21:44.243" Score="0" Body="&lt;p&gt;I would suggest looking at org-src-font-lock-fontify-block which provides this functionality for org-mode source blocks. It seems to just copy the relevant parts to another buffer, enable the major mode there, and then copy the fontified text back. Hackish, but it seems to work.&lt;/p&gt;&#xA;" OwnerUserId="3858" LastActivityDate="2014-12-15T13:21:44.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5407" PostTypeId="1" AcceptedAnswerId="7807" CreationDate="2014-12-15T13:28:32.047" Score="1" ViewCount="684" Body="&lt;p&gt;When using company in shell-mode, a space is added after a match is made. This makes path completions behave badly, since I simply can't continue with the next directory but have to go back. I guess this behaviour is due to that when completing a command, you want the extra space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume someone has already solved this, in order to get the usual path completion behaviour, but still use company in shell-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If my description was unclear, say I want to list &lt;code&gt;/some_directory/another_direcory/file.txt&lt;/code&gt;. I type &lt;code&gt;ls /some&lt;/code&gt;. I can now select &lt;code&gt;/some_directory/&lt;/code&gt; as completion. Now I have &lt;code&gt;ls /some_directory/ &lt;/code&gt; (node trailing space). I have to press backspace in order continue with &lt;code&gt;another_directory&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried with emacs -Q and then enabled global-company-mode. The shell I get from M-x shell gives the same behaviour.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="2688" LastEditDate="2014-12-15T14:05:57.560" LastActivityDate="2015-01-30T10:03:52.500" Title="Company and shell-mode path completion" Tags="|company-mode|" AnswerCount="1" CommentCount="6" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5408" PostTypeId="2" ParentId="5400" CreationDate="2014-12-15T13:46:49.450" Score="10" Body="&lt;p&gt;I recently came across similar problem, I basically wanted to fontify code snippets in the documentation which I got some other source. I followed the approach mentioned towards the end of your answer and it worked fine for me. The function I ended up with some thing like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-fontify-yaml (text)&#xA;  (with-temp-buffer&#xA;    (erase-buffer)&#xA;    (insert text)&#xA;    (delay-mode-hooks (yaml-mode))&#xA;    (font-lock-default-function 'yaml-mode)&#xA;    (font-lock-default-fontify-region (point-min)&#xA;                                      (point-max)&#xA;                                      nil)&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @Malabarba pointed out in comments the simple approach above does not work if destination buffer uses font-lock-mode. However we can trick font-lock-mode into believing that the string is already font locked by setting the text property &lt;code&gt;font-lock-face&lt;/code&gt; to the &lt;code&gt;face&lt;/code&gt;, (we get the &lt;code&gt;face&lt;/code&gt; property set, when we use the function above) and setting text-property &lt;code&gt;fontified&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. The following function takes a string returned by the function above and does the required processing so that the string is inserted fontified (this is taken from org-mode's &lt;code&gt;org-src-font-lock-fontify-block&lt;/code&gt; function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-fontify-using-faces (text)&#xA;  (let ((pos 0))&#xA;    (while (setq next (next-single-property-change pos 'face text))&#xA;      (put-text-property pos next 'font-lock-face (get-text-property pos 'face text) text)&#xA;      (setq pos next))&#xA;    (add-text-properties 0  (length text) '(fontified t) text)&#xA;    text))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can use it as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert (my-fontify-using-faces (my-fontify-yaml &quot;application: test\nversion: 1&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2014-12-15T16:12:50.707" LastActivityDate="2014-12-15T16:12:50.707" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5409" PostTypeId="2" ParentId="5404" CreationDate="2014-12-15T13:56:25.033" Score="13" Body="&lt;p&gt;All macros reachable by the byte-compiler are expanded during compilation.&#xA;&quot;Reachable&quot; essentially means not being quoted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The body of &lt;code&gt;defun&lt;/code&gt;s, &lt;code&gt;defmacro&lt;/code&gt;s, &lt;code&gt;lambda&lt;/code&gt;s, are all byte-compiled&#xA;when the source file that contains them is byte-compiled. So yes, any&#xA;macro inside them will be expanded, as long as they're not inside a&#xA;quote (&lt;code&gt;'&lt;/code&gt;). A very common mistake is to wrap &lt;code&gt;lambda&lt;/code&gt;s in a quote&#xA;and, in fact, that's why you should &lt;strong&gt;never quote your &lt;code&gt;lambda&lt;/code&gt;s&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is one of the big advantages of macros, as long as they're well&#xA;written, they have no impact on runtime performance. The other&#xA;advantage is their power and versatility, of course. The disadvantage&#xA;is that you're manipulating the syntax, not objects, so there's a lot&#xA;of room for problems, some unexpected, others unavoidable.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-12-15T23:52:17.163" LastActivityDate="2014-12-15T23:52:17.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5410" PostTypeId="1" CreationDate="2014-12-15T14:49:32.970" Score="14" ViewCount="2636" Body="&lt;p&gt;I use Emacs Dired to manage files. Accidentally, I hit Enter on an image file, Emacs tries to open the image and stop response. Is there a way to kill this process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Since I am running other processes at the same time, I don't want to restart Emacs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: &#xA;Is there a way to list all the processes within Emacs and kill a certain one like in shell: &lt;code&gt;kill -9 process-id&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;: &#xA;Although very slow, I managed to press &lt;code&gt;C-x C-b&lt;/code&gt; to list all the buffers, and &lt;code&gt;d&lt;/code&gt; mark the buffer caused Emacs no-response, &lt;code&gt;x&lt;/code&gt; to execute delete. It succeed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only works as long as Emacs could response to my key. I really don't know what to do if I can't list all the buffers. &lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="25" LastEditDate="2017-02-22T13:39:12.577" LastActivityDate="2017-02-22T13:39:12.577" Title="How to kill a buffer when it causes Emacs to stop responding?" Tags="|buffers|debugging|frozen-emacs|" AnswerCount="2" CommentCount="4" ClosedDate="2017-02-22T13:39:16.643" ContentLicense="CC BY-SA 3.0" />
  <row Id="5411" PostTypeId="2" ParentId="5396" CreationDate="2014-12-15T15:59:38.723" Score="5" Body="&lt;p&gt;Since there's always more than one way to do it, here's a variation on @abo-abo's idea that keeps ido completion active rather than falling back to the normal find command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ido-yank ()&#xA;  (interactive)&#xA;  (let ((path (current-kill 0)))&#xA;    (if (file-exists-p path)&#xA;        (progn&#xA;          (let ((dir (file-name-directory path)))&#xA;            (if dir (ido-set-current-directory dir)))&#xA;          (setq ido-exit 'refresh)&#xA;          (setq ido-text-init (if (file-directory-p path) nil (file-name-nondirectory path)))&#xA;          (setq ido-rotate-temp t)&#xA;          (exit-minibuffer))&#xA;      (yank))))&#xA;&#xA;(define-key ido-file-dir-completion-map (kbd &quot;C-y&quot;) 'ido-yank)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this binding:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If the current kill is a valid directory path, you can start &lt;code&gt;ido-find-file&lt;/code&gt;, hit &lt;code&gt;C-y&lt;/code&gt; to jump to the yanked directory, and then continue to use ido completion to choose a file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the current kill is a valid file path, you can start &lt;code&gt;ido-find-file&lt;/code&gt;, hit &lt;code&gt;C-y&lt;/code&gt; to jump to the yanked directory and offer the yanked file name as the completion, and hit RET to open that file. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the current kill is anything else it gets yanked normally.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2015-10-03T01:07:21.203" LastActivityDate="2015-10-03T01:07:21.203" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5412" PostTypeId="2" ParentId="5396" CreationDate="2014-12-15T16:02:41.457" Score="6" Body="&lt;p&gt;Given you're dealing with full path names, other methods may work:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use &lt;code&gt;M-x ffap&lt;/code&gt; (&lt;code&gt;find-file-at-point&lt;/code&gt;): it will automatically read the path name and open the file&lt;/li&gt;&#xA;&lt;li&gt;activate &lt;code&gt;M-x compilation-shell-minor-mode&lt;/code&gt; which will change the font of paths and make them &quot;clickable&quot; (with mouth or &lt;code&gt;RET&lt;/code&gt;). Clicking on it brings you to that file and the specific line, and you can use &lt;code&gt;next-error&lt;/code&gt; and &lt;code&gt;previous-error&lt;/code&gt; to navigate. I often use it, &lt;a href=&quot;http://wikemacs.org/index.php/Shell#Make_file_paths_clickable&quot;&gt;like in shell-mode&lt;/a&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="739" LastActivityDate="2014-12-15T16:02:41.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5413" PostTypeId="1" AcceptedAnswerId="7505" CreationDate="2014-12-15T17:37:14.260" Score="1" ViewCount="229" Body="&lt;p&gt;I am using the color-theme package to manage the colors in Emacs 24.3.1.  I used the command &lt;code&gt;color-theme-select&lt;/code&gt; to try different color themes until I found one that I liked.  In this case I found the Hober theme.  Then I put the following code into my &lt;code&gt;.emacs&lt;/code&gt; file to automatically load the color theme when I start up emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'color-theme)&#xA;(setq color-theme-is-global t)&#xA;(color-theme-initialize)&#xA;(color-theme-hober)&#xA;(set-frame-font &quot;lucidatypewriter-9&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I reload emacs, the color theme is significantly darker than what I saw before.  Why are the two approaches to selecting the color theme yielding different results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following are pictures of the two cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I select via &lt;code&gt;color-theme-select&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YLVMJ.png&quot; alt=&quot;If I select via &amp;lt;code&amp;gt;color-theme-select&amp;lt;/code&amp;gt;:&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I select via &lt;code&gt;color-theme-hober&lt;/code&gt; and the other code mentioned above:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5c2z9.png&quot; alt=&quot;If I select via &amp;lt;code&amp;gt;color-theme-hober&amp;lt;/code&amp;gt; and the other code mentioned above:&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3910" LastActivityDate="2015-01-18T13:06:30.730" Title="Different results using color-theme-select versus color-theme-&lt;theme-name&gt;" Tags="|themes|faces|colors|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5415" PostTypeId="1" AcceptedAnswerId="5435" CreationDate="2014-12-15T18:59:20.087" Score="17" ViewCount="898" Body="&lt;p&gt;When I use &lt;code&gt;flyspell-mode&lt;/code&gt;, it reports spelling errors whenever I type a URL. Is there a way I can tell Flyspell to stop checking URLs?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2014-12-15T19:16:26.943" LastActivityDate="2017-07-06T16:13:55.613" Title="How can I make flyspell ignore urls?" Tags="|spell-checking|flyspell|ispell|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5416" PostTypeId="1" AcceptedAnswerId="5440" CreationDate="2014-12-15T19:47:11.723" Score="11" ViewCount="224" Body="&lt;p&gt;Take the following example macro, defined in &lt;code&gt;macro.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro some-macro (&amp;amp;rest body)&#xA;  `(let ((some-variable 1))&#xA;     ,@body))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And take the following function, &lt;strong&gt;defined in a different file&lt;/strong&gt;, &lt;code&gt;function.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-function ()&#xA;  (some-macro (do-something)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;function.el&lt;/code&gt; is byte-compiled, will &lt;code&gt;some-variable&lt;/code&gt; be bound under lexical or dynamic binding? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand this depends on whether the file uses &lt;code&gt;-*- lexical-binding: t; -*-&lt;/code&gt;, so my question specifically regards the following situations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If &lt;code&gt;function.el&lt;/code&gt; uses lexical binding, but &lt;code&gt;macro.el&lt;/code&gt; doesn't.&lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;macro.el&lt;/code&gt; uses lexical binding, but &lt;code&gt;function.el&lt;/code&gt; doesn't.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Does it make a difference if &lt;code&gt;some-var&lt;/code&gt; has been declared global (with a defvar) inside &lt;code&gt;function.el&lt;/code&gt;? If it does, I'm specifically interested in the case where it &lt;em&gt;hasn't&lt;/em&gt;. &lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="25" LastEditDate="2015-02-22T14:48:03.277" LastActivityDate="2015-02-22T14:48:03.277" Title="How is the variable scoping for macros determined?" Tags="|elisp|elisp-macros|lexical-scoping|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5417" PostTypeId="2" ParentId="5387" CreationDate="2014-12-15T19:48:58.020" Score="21" Body="&lt;p&gt;A useful way to do this is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x font-lock-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which toggles font locking.  When font locking is off, the hyperlink is visible in its undecorated form &lt;code&gt;[[./file.org][Title]]&lt;/code&gt;.  This can be a useful approach for seeing other pieces of mark-up in the buffer.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2014-12-15T19:48:58.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5418" PostTypeId="1" AcceptedAnswerId="5422" CreationDate="2014-12-15T19:51:32.980" Score="19" ViewCount="4578" Body="&lt;p&gt;Is there an Emacs mode for GitHub Flavored Markdown? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;GitHub Flavored Markdown &lt;a href=&quot;https://help.github.com/articles/github-flavored-markdown/&quot;&gt;adds a number of features&lt;/a&gt; to traditional Markdown: underscore handling, url autolinking, strikethrough, and tables. It would be nice to have an Emacs mode that supports these additions (particularly tables).&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2016-12-07T04:39:34.503" Title="GitHub Markdown Mode" Tags="|markdown|github|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5419" PostTypeId="5" CreationDate="2014-12-15T20:44:41.180" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-12-15T20:44:41.180" LastActivityDate="2014-12-15T20:44:41.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5420" PostTypeId="4" CreationDate="2014-12-15T20:44:41.180" Score="0" Body="Grand Unified Debugger" OwnerUserId="870" LastEditorUserId="870" LastEditDate="2014-12-15T21:23:03.267" LastActivityDate="2014-12-15T21:23:03.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5422" PostTypeId="2" ParentId="5418" CreationDate="2014-12-15T21:07:02.520" Score="23" Body="&lt;p&gt;There's &lt;code&gt;gfm-mode&lt;/code&gt; (which is part of &lt;a href=&quot;http://melpa.org/#/markdown-mode&quot;&gt;markdown-mode.el&lt;/a&gt;). From the commentary in the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; GitHub Flavored Markdown:&#xA;&#xA;;; A [GitHub Flavored Markdown][GFM] (GFM) mode, `gfm-mode', is also&#xA;;; available.  The GitHub implementation of differs slightly from&#xA;;; standard Markdown.  The most important differences are that&#xA;;; newlines are significant, triggering hard line breaks, and that&#xA;;; underscores inside of words (e.g., variable names) need not be&#xA;;; escaped.  As such, `gfm-mode' turns off `auto-fill-mode' and turns&#xA;;; on `visual-line-mode' (or `longlines-mode' if `visual-line-mode' is&#xA;;; not available).  Underscores inside of words (such as&#xA;;; test_variable) will not trigger emphasis.&#xA;;;&#xA;;; Wiki links in this mode will be treated as on GitHub, with hyphens&#xA;;; replacing spaces in filenames and where the first letter of the&#xA;;; filename capitalized.  For example, `[[wiki link]]' will map to a&#xA;;; file named `Wiki-link` with the same extension as the current file.&#xA;;;&#xA;;; GFM code blocks, with optional programming language keywords, will&#xA;;; be highlighted.  They can be inserted with `C-c C-s P`.  If there&#xA;;; is an active region, the text in the region will be placed inside&#xA;;; the code block.  You will be prompted for the name of the language,&#xA;;; but may press enter to continue without naming a language.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2014-12-15T21:13:34.580" LastActivityDate="2014-12-15T21:13:34.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5423" PostTypeId="2" ParentId="5404" CreationDate="2014-12-15T21:33:43.487" Score="7" Body="&lt;p&gt;As Malabarba has already explained, macros are expanded during byte compilation.  If a file is not compiled, macros are expanded when the file is loaded (eager macro expansion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't rely on this, though.  It's very bad style.  You generally can't expect that code which uses your macro is actually compiled, and you should generally run &lt;strong&gt;as little code as possible&lt;/strong&gt; during compilation.  Specifically, use macros &lt;strong&gt;scarcely&lt;/strong&gt; and only if there is no other way.  As a rule of thumb, use macros only for &lt;strong&gt;syntax&lt;/strong&gt;, and &lt;strong&gt;never for semantics&lt;/strong&gt; (or functionality).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Macros are a leaky abstraction.  Their expansion is hard-coded into the target code at compilation time, and cannot be changed retrospectively.  The target code subsequently &lt;strong&gt;depends&lt;/strong&gt; on the &lt;strong&gt;specific implementation&lt;/strong&gt; of the macro at the expansion time.  Specifically, it depends on &lt;strong&gt;all internal API&lt;/strong&gt; used in the macro body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently you cannot change any of this API, or anything the macro expansion relies upon, without breaking any code that was compiled against your macro.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The liberal use of macros for functionality paves the &lt;strong&gt;road to the dependency hell&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-15T21:33:43.487" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5424" PostTypeId="1" AcceptedAnswerId="5425" CreationDate="2014-12-15T21:46:03.723" Score="5" ViewCount="67" Body="&lt;p&gt;I am looking for a function that returns a function (preferably quoted) for a given key binding. I know about &lt;code&gt;C-h k&lt;/code&gt; (e.g. &lt;code&gt;M-x describe-key&lt;/code&gt;), but I am looking for a lower-level function. (My use case is that I want to save a previous key binding before rebinding it.)&lt;/p&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2014-12-15T21:46:03.723" Title="Function to return a quoted function for a given key binding" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5425" PostTypeId="2" ParentId="5424" CreationDate="2014-12-15T21:46:03.723" Score="6" Body="&lt;p&gt;I found the aptly-named &lt;code&gt;key-binding&lt;/code&gt; after reading the source code for &lt;code&gt;describe-key&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;key-binding is a built-in function in `C source code'.&lt;/p&gt;&#xA;&lt;p&gt;(key-binding KEY &amp;amp;optional ACCEPT-DEFAULT NO-REMAP POSITION)&lt;/p&gt;&#xA;&lt;p&gt;Return the binding for command KEY in current keymaps.&#xA;KEY is a string or vector, a sequence of keystrokes.&#xA;The binding is probably a symbol with a function definition.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2503" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-12-15T21:46:03.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5426" PostTypeId="1" AcceptedAnswerId="5427" CreationDate="2014-12-15T21:49:35.587" Score="2" ViewCount="314" Body="&lt;p&gt;I'd like to enable &lt;code&gt;whitespace-mode&lt;/code&gt; from a .&lt;code&gt;dir-locals.el&lt;/code&gt; file such that when I open a file managed by &lt;code&gt;cc-mode&lt;/code&gt;, I will see trailing spaces highlighted with the whitespace face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I'm close. This is what I have in my &lt;code&gt;.dir-locals.el&lt;/code&gt;, but its not quite enough.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((cc-mode . ((whitespace-style . (face trailing))            &#xA;             (whitespace-active-style . (face trailing))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;whitespace-toggle-options&lt;/code&gt; and choose &lt;kbd&gt;f&lt;/kbd&gt;, then the trailing whitespace is highlighted.&lt;/p&gt;&#xA;" OwnerUserId="48" LastEditorUserId="50" LastEditDate="2014-12-15T22:25:29.840" LastActivityDate="2014-12-15T22:25:29.840" Title="How to activate whitespace-mode for a cc-mode buffer from .dir-locals.el?" Tags="|whitespace|local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5427" PostTypeId="2" ParentId="5426" CreationDate="2014-12-15T22:05:23.507" Score="3" Body="&lt;p&gt;Use the special &quot;variable&quot; &lt;code&gt;eval&lt;/code&gt; as described in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;nofollow&quot;&gt;Specifying File Variables&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;code&gt;.dir-locals.el&lt;/code&gt; code enables &lt;code&gt;whitespace-mode&lt;/code&gt; for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((c++-mode&#xA;  (eval . (whitespace-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I use Emacs 24.4.1.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-15T22:12:21.297" LastActivityDate="2014-12-15T22:12:21.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5428" PostTypeId="1" AcceptedAnswerId="5446" CreationDate="2014-12-16T00:07:33.097" Score="50" ViewCount="18870" Body="&lt;p&gt;I restart my emacs a lot. All I want to do is create a function that kills the current emacs, only to spawn a new one in it's stead. Ideally, this would also work in a TTY.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2023-08-30T14:02:52.083" Title="Restart emacs from within emacs" Tags="|terminal-emacs|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5429" PostTypeId="2" ParentId="5428" CreationDate="2014-12-16T00:30:41.800" Score="32" Body="&lt;p&gt;As far as I know you cannot tell Emacs to re-start after terminating, but you can set the exit code so that the process that started Emacs in the first place can detect that you want to re-start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this shell script re-starts Emacs if it exited with the code 123.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-shell prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/sh&#xA;while emacs -nw &quot;$@&quot;; [ $? = 123 ]; do :; done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, we define &lt;code&gt;kill-emacs-and-restart&lt;/code&gt; that makes Emacs terminate with the exit code equal to the magic number recognized by the script:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kill-emacs-and-restart ()&#xA;  (interactive)&#xA;  (kill-emacs 123))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if you run Emacs via this script you can re-start by &lt;code&gt;M-x kill-emacs-and-restart&lt;/code&gt; (or bind it to a key sequence).&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="5296" LastEditDate="2015-09-17T21:29:28.037" LastActivityDate="2015-09-17T21:29:28.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5430" PostTypeId="1" AcceptedAnswerId="5550" CreationDate="2014-12-16T02:03:36.640" Score="4" ViewCount="2383" Body="&lt;p&gt;Emacs is exporting &lt;code&gt;listings&lt;/code&gt; blocks (i.e. &lt;code&gt;#+BEGIN_SRC &amp;lt;lang&amp;gt;&lt;/code&gt;) in a strange, incorrect way. Here's an example of what I mean with a simple org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+AUTHOR: &#xA;#+BEGIN_SRC js&#xA;var dog = &quot;dog!&quot;&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC R &#xA;dog &amp;lt;- &quot;dog!&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the output LaTeX:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Created 2014-12-15&#xA;\documentclass[11pt]{article}&#xA;\usepackage[utf8]{inputenc}&#xA;\usepackage[T1]{fontenc}&#xA;\usepackage{fixltx2e}&#xA;\usepackage{graphicx}&#xA;\usepackage{longtable}&#xA;\usepackage{float}&#xA;\usepackage{wrapfig}&#xA;\usepackage{rotating}&#xA;\usepackage[normalem]{ulem}&#xA;\usepackage{amsmath}&#xA;\usepackage{textcomp}&#xA;\usepackage{marvosym}&#xA;\usepackage{wasysym}&#xA;\usepackage{amssymb}&#xA;\usepackage{hyperref}&#xA;\usepackage{listings}&#xA;\usepackage{color}&#xA;\tolerance=1000&#xA;\date{\today}&#xA;\title{test}&#xA;\hypersetup{&#xA;  pdfkeywords={},&#xA;  pdfsubject={},&#xA;  pdfcreator={Emacs 24.3.1 (Org mode 8.2.7c)}}&#xA;\begin{document}&#xA;&#xA;\maketitle&#xA;\tableofcontents&#xA;&#xA;\lstset{backgroundcolor=gray,language=js&#xA;var,label= ,caption= ,numbers=none}&#xA;\begin{lstlisting}&#xA;var dog = &quot;dog!&quot;&#xA;\end{lstlisting}&#xA;&#xA;\lstset{backgroundcolor=gray,language=R&#xA;dog,label= ,caption= ,numbers=none}&#xA;\begin{lstlisting}&#xA;dog &amp;lt;- &quot;dog!&quot;&#xA;\end{lstlisting}&#xA;% Emacs 24.3.1 (Org mode 8.2.7c)&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;\lstset&lt;/code&gt; lines are messed up: they have an extra new line, and they repeat the first word given after &lt;code&gt;language&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the relevant lines from the &lt;code&gt;(custom-set-variables&lt;/code&gt; section of my dotfile:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(org-latex-listings t)&#xA; '(org-latex-listings-langs (quote ((emacs-lisp &quot;Lisp&quot;) (lisp &quot;Lisp&quot;) (clojure &quot;Lisp&quot;) (c &quot;C&quot;) (cc &quot;C++&quot;) (fortran &quot;fortran&quot;) (perl &quot;Perl&quot;) (cperl &quot;Perl&quot;) (python &quot;Python&quot;) (ruby &quot;Ruby&quot;) (html &quot;HTML&quot;) (xml &quot;XML&quot;) (tex &quot;TeX&quot;) (latex &quot;[LaTeX]TeX&quot;) (shell-script &quot;bash&quot;) (gnuplot &quot;Gnuplot&quot;) (ocaml &quot;Caml&quot;) (caml &quot;Caml&quot;) (sql &quot;SQL&quot;) (sqlite &quot;sql&quot;) (R-mode &quot;R&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(org-export-latex-listings t)&#xA; '(org-export-latex-listings-langs (quote ((emacs-lisp &quot;Lisp&quot;) (lisp &quot;Lisp&quot;) (clojure &quot;Lisp&quot;) (c &quot;C&quot;) (cc &quot;C++&quot;) (fortran &quot;fortran&quot;) (perl &quot;Perl&quot;) (cperl &quot;Perl&quot;) (python &quot;Python&quot;) (ruby &quot;Ruby&quot;) (html &quot;HTML&quot;) (xml &quot;XML&quot;) (tex &quot;TeX&quot;) (latex &quot;TeX&quot;) (shell-script &quot;bash&quot;) (gnuplot &quot;Gnuplot&quot;) (ocaml &quot;Caml&quot;) (caml &quot;Caml&quot;) (sql &quot;SQL&quot;) (sqlite &quot;sql&quot;) (R-mode &quot;R&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This also seems to occur if the above listings options are removed and &lt;code&gt;org-export-latex-listings&lt;/code&gt; is set to &lt;code&gt;minted&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pdfcreator={Emacs 24.3.1 (Org mode 8.2.10)}}&#xA;\begin{document}&#xA;&#xA;\maketitle&#xA;\tableofcontents&#xA;&#xA;\begin{minted}[]{js&#xA;var}&#xA;var dog = &quot;dog!&quot;&#xA;\end{minted}&#xA;&#xA;\begin{minted}[]{r&#xA;dog}&#xA;dog &amp;lt;- &quot;dog!&quot;&#xA;\end{minted}&#xA;% Emacs 24.3.1 (Org mode 8.2.10)&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2014-12-19T01:35:17.997" LastActivityDate="2014-12-19T02:11:59.930" Title="Org-mode doesn't seem to be exporting listings/minted correctly" Tags="|org-mode|latex|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5431" PostTypeId="2" ParentId="5389" CreationDate="2014-12-16T02:15:57.167" Score="7" Body="&lt;p&gt;For part 1, I didn't find anything built-in. The following function will provide a list of broken links in the minibuffer. I've tested it on some simple examples, but far from exhaustively.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun check-bit-rot ()&#xA;  &amp;quot;Searches current buffer for file: links, and reports the broken ones.&amp;quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (beginning-of-buffer)&#xA;    (let (file-links)&#xA;      (while (re-search-forward org-link-bracket-re nil t)&#xA;        (if (string= &amp;quot;file:&amp;quot; (match-string-no-properties 1))&#xA;            (if (not (file-exists-p (match-string-no-properties 3)))&#xA;                (setq file-links&#xA;                      (cons (match-string-no-properties 0)&#xA;                            file-links)))))&#xA;      (message&#xA;       (concat &amp;quot;Warning: broken links in this file:\n&amp;quot;&#xA;               (mapconcat #'identity file-links &amp;quot;\n&amp;quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="17096" LastEditDate="2023-06-14T22:53:25.697" LastActivityDate="2023-06-14T22:53:25.697" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="5432" PostTypeId="1" AcceptedAnswerId="10221" CreationDate="2014-12-16T03:51:28.653" Score="7" ViewCount="1713" Body="&lt;p&gt;I'm studying for finals and want to use &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-drill.html&quot; rel=&quot;noreferrer&quot;&gt;org-drill&lt;/a&gt; . Org-drill sees my flash cards and places &lt;code&gt;UUID&lt;/code&gt;s in properties drawers (see the code snippet below). However, when I call org-drill-cram, it says it doesn't see anything:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I did not find any pending drill items.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is a screenshot showing what &lt;code&gt;org-drill&lt;/code&gt; reports:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/V8syG.png&quot; alt=&quot;org-drill doesn&amp;#39;t see any cards&quot;&gt;&#xA;Below is an example of one of my cards.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** What is the key syntax for proc freq? :drill:&#xA;:PROPERTIES:&#xA;:ID:       34885705-f0ae-431f-baf6-50f8c5689cb1&#xA;:END:&#xA;&#xA;**** the answer&#xA;&#xA;#+BEGIN_SRC SAS&#xA;  proc freq data=data;&#xA;      tables vars / options;&#xA;      output out=out_data;&#xA;  run;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get &lt;code&gt;org-drill&lt;/code&gt; and &lt;code&gt;org-drill-cram&lt;/code&gt; to actually test me on my flash cards? It looks like they are detected (since properties are added). What am I missing? I'm using &lt;code&gt;Org 8.2.10&lt;/code&gt; from MELPA and Emacs 24.4.&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2014-12-16T04:02:53.340" LastActivityDate="2015-03-22T13:44:57.093" Title="org-drill isn't letting me drill" Tags="|org-mode|org-drill|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5433" PostTypeId="1" CreationDate="2014-12-16T05:00:31.240" Score="1" ViewCount="180" Body="&lt;p&gt;I want to manipulate a frame after it's created. I thought that I could do this with an 'after-make-frame-functions hook as a callback but it seems to return too early.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the sample code that demonstrates the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test-frame nil)&#xA;&#xA;(defun finish-frame-setup( frame )&#xA;  (message &quot;test frame is %s&quot; (frame-live-p test-frame)))&#xA;&#xA;(defun test-frame-callback()&#xA;  (interactive)&#xA;  (add-hook 'after-make-frame-functions 'finish-frame-setup t nil)&#xA;  (setq test-frame (make-frame)))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eval-buffer&#xA;M-x test-frame-callback&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test frame is nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd appreciate any assistance.&#xA;Emacs 24.4 on win32&lt;/p&gt;&#xA;" OwnerUserId="3916" LastEditorUserId="25" LastEditDate="2014-12-21T23:29:35.133" LastActivityDate="2014-12-21T23:29:35.133" Title="How do I modify a frame once it's created?" Tags="|frames|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5434" PostTypeId="2" ParentId="5433" CreationDate="2014-12-16T05:15:50.623" Score="1" Body="&lt;p&gt;The issue is that &lt;code&gt;after-make-frame-functions&lt;/code&gt; is called before the frame is assigned to &lt;code&gt;test-frame&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is to simplify and avoid the callback&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-frame-callback()&#xA;  (interactive)&#xA;  (setq test-frame (make-frame))&#xA;  (message &quot;test frame is %s&quot; (frame-live-p test-frame))))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3916" LastEditorUserId="25" LastEditDate="2014-12-21T23:29:17.843" LastActivityDate="2014-12-21T23:29:17.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5435" PostTypeId="2" ParentId="5415" CreationDate="2014-12-16T05:29:49.007" Score="14" Body="&lt;p&gt;After a bit of digging, I found a hint in [this &lt;a href=&quot;https://superuser.com/a/345461&quot;&gt;Superuser.com answer&lt;/a&gt;: you need to set &lt;code&gt;flyspell-mode-predicate&lt;/code&gt; to a function that will decide whether words should be checked or not.  Here's a way to get Flyspell to ignore anything starting with &quot;http&quot; or &quot;https&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun flyspell-ignore-http-and-https ()&#xA;  &quot;Function used for `flyspell-generic-check-word-predicate' to ignore stuff starting with \&quot;http\&quot; or \&quot;https\&quot;.&quot;&#xA;  (save-excursion&#xA;    (forward-whitespace -1)&#xA;    (when (looking-at &quot; &quot;)&#xA;        (forward-char)&#xA;    (not (looking-at &quot;https?\\b&quot;))))) &#xA;&#xA;(put 'text-mode 'flyspell-mode-predicate 'flyspell-ignore-http-and-https)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are some shortcomings, of course:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm assuming that anything beginning with &quot;http&quot; or &quot;https&quot; should be skipped; that includes &quot;&lt;a href=&quot;http://cnn.com&quot;&gt;http://cnn.com&lt;/a&gt;&quot; and &quot;&lt;a href=&quot;https://google.com&quot;&gt;https://google.com&lt;/a&gt;&quot; (good), but also &quot;httpomatic&quot; and &quot;httpstatisticiansarehip&quot; (presumably bad)&lt;/li&gt;&#xA;&lt;li&gt;I'm not bothering with mailto:, ftp:, file:, etc etc. (But that way &lt;a href=&quot;https://stackoverflow.com/a/1732454&quot;&gt;may lie madness&lt;/a&gt;...)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But as a quick-and-dirty method, it should work.&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="5142" LastEditDate="2015-01-09T14:20:37.697" LastActivityDate="2015-01-09T14:20:37.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5436" PostTypeId="1" CreationDate="2014-12-16T06:11:05.293" Score="12" ViewCount="2738" Body="&lt;p&gt;I have not found a standard Elisp library function to merge two property lists, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq pl nil)&#xA;(setq pl (plist-put pl 'key-1 'value-1))&#xA;(setq pl (plist-put pl 'key-2 'value-2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could build something with &lt;code&gt;dolist&lt;/code&gt;, but before I do, I would like to check that I'm not overlooking an existing function in some library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updates, based on the comments&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In response to the &quot;many-ways&quot; comment:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would imagine that there isn't such a function because there are different (and possibly valid) answers possible to the question: what to do when you have duplicate property names with distinct values?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, there is a question on how to merge duplicates, but there are relatively few ways to address that. I see two general approaches. First, argument order could resolve the duplicates; e.g. rightmost wins, as in &lt;a href=&quot;http://clojuredocs.org/clojure.core/merge&quot;&gt;Clojure's merge&lt;/a&gt;. Second, the merge could delegate to a user-provided callback function, as in &lt;a href=&quot;http://www.ruby-doc.org/core-2.1.5/Hash.html#method-i-merge&quot;&gt;Ruby's merge&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, the fact that there are different ways of doing it does not prevent many other language standard libraries from providing a merge function. The same general argument could be said of sorting, and yet Elisp provides sorting functionality.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&quot;Could you elaborate?&quot; / &quot;Please specify the behavior you are looking for precisely.&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Generally speaking, I'm open to what the Elisp community uses. If you would like a specific example, here would be one example that would work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(a-merge-function '(k1 1) '(k2 2 k3 3) '(k3 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(k1 1 k2 2 k3 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This would be a rightmost-wins style, like Clojure's merge.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;&quot;They're lists, so just append?&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;No, &lt;code&gt;append&lt;/code&gt; does not preserve &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html&quot;&gt;property list&lt;/a&gt; semantics. This:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(append '(k1 1 k2 2) '(k2 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Returns this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(k1 1 k2 2 k2 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;append is a built-in function in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(append &amp;amp;rest SEQUENCES)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Concatenate all the arguments and make the result a list.&#xA;  The result is a list whose elements are the elements of all the arguments.&#xA;  Each argument may be a list, vector or string.&#xA;  The last argument is not copied, just used as the tail of the new list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;&quot;And your example does not show anything like a merge - it does not even show two property lists.&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Yes it does; it does the merge step by step. It shows how doing a merge using the Elisp's documented property list functions is painfully verbose:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq pl nil)&#xA;(setq pl (plist-put pl 'key-1 'value-1))&#xA;(setq pl (plist-put pl 'key-2 'value-2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just display the resulting output value from &lt;code&gt;pl&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-1 value-1 key-2 value-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To reiterate, I am capable of writing a function to solve this problem, but I first wanted to figure out if such a function exists somewhere in common use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you downvoted the question because you found it unclear, I would ask that you reconsider now that I've gone to some effort to clarify. This is not a lack of research. The Elisp documentation on &quot;Lists&quot; does not answer the question.&lt;/p&gt;&#xA;" OwnerUserId="2503" LastEditorUserId="2503" LastEditDate="2014-12-16T17:43:25.523" LastActivityDate="2015-12-25T22:53:34.117" Title="Function to merge two property lists?" Tags="|property-lists|" AnswerCount="3" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="5438" PostTypeId="2" ParentId="5359" CreationDate="2014-12-16T11:51:43.723" Score="89" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What can cause this problem? Is it caused by Emacs or it is due to my pc's performance? Generally what are the variables that affect Emacs' performance?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs has around 50,000 internal variables and a few thousand external packages averaging at a few dozen variables each, you can't expect someone to answer this in a general sense. :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that just by looking at the comments thread under your question. There are half a dozen different suggestions in there, all equally valid.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What can you do to pinpoint the problem?&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;Option 1: Disable modes&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Start disabling those minor-modes you've listed, and see which one solves you performance issue. I would start with &lt;code&gt;smartparens&lt;/code&gt;, &lt;code&gt;auto-complete&lt;/code&gt;, &lt;code&gt;line-number&lt;/code&gt; and &lt;code&gt;font-lock&lt;/code&gt;, and then follow down the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;I didn't have this problem yesterday&quot;&lt;/em&gt; means very little, &lt;strong&gt;don't rely on it&lt;/strong&gt; too heavily. Just start disabling minor-modes until something solves it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If none of the minor-modes fix your issue, then start commenting out portions of your init file until you find out which snippet was causing this. In any case, ask a new question when you have something more specific.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Option 2: The profiler&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;M-x profiler-start RET RET&lt;/code&gt; (the second &lt;code&gt;RET&lt;/code&gt; is to confirm &lt;code&gt;cpu&lt;/code&gt;);&lt;/li&gt;&#xA;&lt;li&gt;Do some typing, preferably an entire paragraph or more;&lt;/li&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;M-x profiler-report&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That will give you a buffer describing the cpu time taken by each function. Hitting &lt;code&gt;TAB&lt;/code&gt; on a line expands it to display the functions inside it. &#xA;Navigate this buffer until you find out which function is taking so much CPU time. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What do I do afterwards?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Once you find the function or package or snippet causing lag you can (in no particular order):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ask a new question here regarding &lt;strong&gt;that specific minor-mode&lt;/strong&gt; (or function or snippet).&lt;/li&gt;&#xA;&lt;li&gt;Report a bug to the package maintainer. &#xA;&lt;ul&gt;&#xA;&lt;li&gt;Check the comments at the top of the package's source file. If it contains a URL (specially on github), there's probably an issue tracker there.&lt;/li&gt;&#xA;&lt;li&gt;Some packages offer a command like &lt;code&gt;M-x PACKAGE-bug-report&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;His or her email should be at the top of the package's source file. &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;If it's a built-in package, you can report it with &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Even for packages that are not built-in, you can ask for help at the &lt;code&gt;help-gnu-emacs&lt;/code&gt; mailing list.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-12-16T22:28:46.203" LastActivityDate="2014-12-16T22:28:46.203" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5439" PostTypeId="1" AcceptedAnswerId="5493" CreationDate="2014-12-16T12:43:32.737" Score="12" ViewCount="326" Body="&lt;p&gt;The current &lt;code&gt;AUCTeX&lt;/code&gt; behaviour for primitive &lt;code&gt;tex&lt;/code&gt; code involving &lt;em&gt;if&lt;/em&gt;-like statements is to indent the conditional statement at the same level as the surrounding condition. I.e. code such as&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\if@sometoggle%&#xA;\dosomething%&#xA;\else%&#xA;\doanotherthing%&#xA;\fi%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;appears as a big block of text. I would like to make &lt;code&gt;AUCTeX&lt;/code&gt; indent the snippet as follows:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\if@sometoggle%&#xA;  \dosomething%&#xA;\else%&#xA;  \doanotherthing%&#xA;\fi%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="105" LastEditDate="2014-12-16T16:47:22.993" LastActivityDate="2014-12-17T19:25:44.070" Title="Auto-Indenting \if statements with AUCTeX" Tags="|latex|auctex|indentation|tex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5440" PostTypeId="2" ParentId="5416" CreationDate="2014-12-16T13:38:19.210" Score="9" Body="&lt;p&gt;The kind of scoping active for the &lt;code&gt;(let ((some-variable ..)) ...)&lt;/code&gt; in your example, is the one active at the site of the macro call (i.e. the one that applies to &lt;code&gt;some-function&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A macro can know which kind of scoping will be used for the code it returns by checking the value of the &lt;code&gt;lexical-binding&lt;/code&gt; variable.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-16T13:38:19.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5441" PostTypeId="1" AcceptedAnswerId="5442" CreationDate="2014-12-16T13:48:39.597" Score="13" ViewCount="2372" Body="&lt;p&gt;I need to be able to remove all comments from a buffer from elisp code. For now, I am using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(goto-char (point-min))&#xA;(comment-kill (count-lines (point-min) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;comment-kill&lt;/code&gt; is an interactive function, and its primary usage is to delete one comment at a time. Additionally, it has annoying visible side-effects, since it adds all the comments it killed to the kill-ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a function allowing to delete (not kill) some or all comments from a buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2014-12-16T15:46:08.190" Title="Function to delete all comments from a buffer, without moving them to kill ring" Tags="|elisp|kill-ring|comment|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5442" PostTypeId="2" ParentId="5441" CreationDate="2014-12-16T14:06:03.057" Score="12" Body="&lt;p&gt;In general, there's nothing wrong with using commands as part of elisp&#xA;code. Those functions which are only meant for interactive use will&#xA;(or should) warn you about that. See&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/next-line&quot;&gt;&lt;code&gt;next-line&lt;/code&gt;&lt;/a&gt; for&#xA;instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to delete, instead of killing, just make sure the &lt;code&gt;kill-ring&lt;/code&gt; isn't changed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(goto-char (point-min))&#xA;(let (kill-ring)&#xA;  (comment-kill (count-lines (point-min) (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-12-16T14:06:03.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5443" PostTypeId="1" AcceptedAnswerId="5640" CreationDate="2014-12-16T15:24:22.960" Score="2" ViewCount="123" Body="&lt;p&gt;For instance, say that I have a two-window vertical split.  If I call&#xA;&lt;code&gt;ediff-buffers&lt;/code&gt; from the right window, it will swap the right and the&#xA;left window for the diff, and even leave it like that afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like &lt;code&gt;ediff&lt;/code&gt; to try to keep the buffers in the same order during&#xA;the diff.  Is there already some setting that does this? &lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2014-12-16T16:43:05.313" LastActivityDate="2014-12-22T08:52:08.777" Title="Could ediff-buffers re-use the current window configuration?" Tags="|window|ediff|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5444" PostTypeId="1" AcceptedAnswerId="5535" CreationDate="2014-12-16T15:26:42.527" Score="4" ViewCount="574" Body="&lt;p&gt;If I start emacs from the terminal, emacs will start up with a warning on the terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning: Cannot convert string &quot;-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*&quot; to type FontStruct&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried starting emacs with &lt;code&gt;emacs -q&lt;/code&gt;. The warning was still there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to solve this problem? Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(My OS is &lt;code&gt;Xubuntu 14.04.1&lt;/code&gt;. Emacs version is &lt;code&gt;24.4.1&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2014-12-18T17:37:24.193" Title="Terminal warning when starting emacs" Tags="|fonts|term|linux|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5445" PostTypeId="2" ParentId="5441" CreationDate="2014-12-16T15:46:08.190" Score="7" Body="&lt;p&gt;@Malabarba's answer looks like the simplest and most elegant&#xA;solution.  However, if you do this enough that it warrants its&#xA;own function, you can also adapt &lt;code&gt;comment-kill&lt;/code&gt; to delete without&#xA;modifying the kill ring.  Here's the source code of&#xA;&lt;code&gt;comment-kill&lt;/code&gt; with the single-line change to define &lt;code&gt;comment-delete&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comment-delete (arg)&#xA;  &quot;Delete the first comment on this line, if any.  Don't touch&#xA;the kill ring.  With prefix ARG, delete comments on that many&#xA;lines starting with this one.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (comment-normalize-vars)&#xA;  (dotimes (_i (prefix-numeric-value arg))&#xA;    (save-excursion&#xA;      (beginning-of-line)&#xA;      (let ((cs (comment-search-forward (line-end-position) t)))&#xA;    (when cs&#xA;      (goto-char cs)&#xA;      (skip-syntax-backward &quot; &quot;)&#xA;      (setq cs (point))&#xA;      (comment-forward)&#xA;      ;; (kill-region cs (if (bolp) (1- (point)) (point))) ; original&#xA;      (delete-region cs (if (bolp) (1- (point)) (point)))  ; replace kill-region with delete-region&#xA;      (indent-according-to-mode))))&#xA;    (if arg (forward-line 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here's a function (NB: minimally tested) that provides some additional functionality, allowing you to delete comments on the current line, in the active region, or in the entire buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comment-delete-dwim (beg end arg)&#xA;  &quot;Delete comments without touching the kill ring.  With active&#xA;region, delete comments in region.  With prefix, delete comments&#xA;in whole buffer.  With neither, delete comments on current line.&quot;&#xA;  (interactive &quot;r\nP&quot;)&#xA;  (let ((lines (cond (arg&#xA;                      (count-lines (point-min) (point-max)))&#xA;                     ((region-active-p)&#xA;                      (count-lines beg end)))))&#xA;    (save-excursion&#xA;      (when lines&#xA;        (goto-char (if arg (point-min) beg)))&#xA;      (comment-delete (or lines 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't checked performance issues, but perhaps there's a tiny&#xA;bump from not touching the kill ring.  Regardless, I doubt you'll&#xA;notice performance problems unless you're working with a truly&#xA;massive buffer.  But since you're unlikely to use this function&#xA;very frequently, it seems like it would not be worth the effort&#xA;to work on optimization.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-16T15:46:08.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5446" PostTypeId="2" ParentId="5428" CreationDate="2014-12-16T17:41:28.217" Score="31" Body="&lt;p&gt;Note: I have wrapped the following in a package &lt;code&gt;restart-emacs&lt;/code&gt; available &lt;a href=&quot;http://github.com/iqbalansari/restart-emacs&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an alternate way to achieve what you want using pure elisp (not really since you rely on a shell). The trick is to spawn off another emacs process just before current emacs is killed.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun launch-separate-emacs-in-terminal ()&#xA;  (suspend-emacs &quot;fg ; emacs -nw&quot;))&#xA;&#xA;(defun launch-separate-emacs-under-x ()&#xA;  (call-process &quot;sh&quot; nil nil nil &quot;-c&quot; &quot;emacs &amp;amp;&quot;))&#xA;&#xA;(defun restart-emacs ()&#xA;  (interactive)&#xA;  ;; We need the new emacs to be spawned after all kill-emacs-hooks&#xA;  ;; have been processed and there is nothing interesting left&#xA;  (let ((kill-emacs-hook (append kill-emacs-hook (list (if (display-graphic-p)&#xA;                                                           #'launch-separate-emacs-under-x&#xA;                                                         #'launch-separate-emacs-in-terminal)))))&#xA;    (save-buffers-kill-emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code to start a GUI version of emacs is straightforward. The code to start emacs in a terminal is a bit tricky. It uses the fact that you can pass a string to &lt;code&gt;suspend-emacs&lt;/code&gt; which would be passed as terminal input to the parent process (the shell). From the documentation&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(suspend-emacs &amp;amp;optional STUFFSTRING)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Stop Emacs and return to superior process.  You can resume later. If&#xA;  `cannot-suspend' is non-nil, or if the system doesn't support job&#xA;  control, run a subshell instead.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If optional arg STUFFSTRING is non-nil, its characters are stuffed to&#xA;  be read as terminal input by Emacs's parent, after suspension.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So we basically suspend emacs just before it is killed tell the parent shell to resume currently suspended emacs (which is going to exit soon) and then launch another emacs process. Note that this does not work on platforms on which terminal emacs can/does not actually suspend but starts a subshell, for example on windows.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-10-27T10:22:17.087" LastActivityDate="2015-10-27T10:22:17.087" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5447" PostTypeId="1" CreationDate="2014-12-16T18:19:47.857" Score="4" ViewCount="739" Body="&lt;p&gt;More specifically:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If it is possible, what are the necessary steps?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If it is not, what are the technical reasons?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Prompted by a recent question: &lt;a href=&quot;https://emacs.stackexchange.com/q/5428/2355&quot;&gt;Restart emacs from within emacs&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Clarification:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The state as I see it consists of all the symbols and their bindings, i.e. the environment described in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Intro-Eval.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intro Eval&lt;/a&gt;. Resetting is returning to a previous state; this could be a manually stored state or the initial state of the interpreter (corresponding to &quot;starting from scratch&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that Emacs is not a closed system, so anything having to do with &lt;em&gt;its&lt;/em&gt; environment is out of our control, but saving and loading an &quot;Elisp core dump&quot; should be possible in theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making sure that changes in &lt;code&gt;.emacs&lt;/code&gt; and such take effect is a possible (although silly) application, but I believe this could be useful for debugging elisp code, too.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-16T19:43:06.600" Title="Is it possible to reset the state of the Emacs Lisp interpreter without re-starting Emacs?" Tags="|elisp|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5448" PostTypeId="2" ParentId="5447" CreationDate="2014-12-16T18:51:06.520" Score="6" Body="&lt;p&gt;No, you can't.   The reason is pretty obvious:  &lt;strong&gt;All&lt;/strong&gt; of Emacs' state &lt;strong&gt;is&lt;/strong&gt; the interpreter state, including all buffers, windows, frames, processes, etc, i.e. your &lt;strong&gt;whole editing session&lt;/strong&gt;.  Even if you could reset the Lisp interpreter from within Emacs, the result would be exactly the same as restarting the Emacs process: The standard blank frame with the welcome screen.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there's really no point in implementing a feature that all operating systems already provide.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-16T18:51:06.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5449" PostTypeId="2" ParentId="5447" CreationDate="2014-12-16T18:51:22.950" Score="5" Body="&lt;p&gt;What do you mean, exactly, by &quot;&lt;em&gt;the state of the Emacs Lisp interpreter&lt;/em&gt;&quot;? And what constitutes &quot;&lt;em&gt;resetting&lt;/em&gt;&quot; that state for you?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, the answer is &lt;strong&gt;no, it is not feasible to reset the interpreter&lt;/strong&gt;. When you start out from scratch, there are already lots of symbols defined in the &lt;code&gt;obarray&lt;/code&gt;, lots of strings, arrays, and lists (cons cells) created, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can delete symbols, strings, arrays, cons cells etc., of course, but there is no reasonable way to restore the initial state at which you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can dump the state of Emacs, and then start a new session from such a dump. So in a sense that &quot;resets&quot; the interpreter. But you might not want to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For information about dumping Emacs see the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Building-Emacs.html#Building-Emacs&quot;&gt;&lt;code&gt;Building Emacs&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-16T18:51:22.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5450" PostTypeId="1" AcceptedAnswerId="5474" CreationDate="2014-12-16T19:48:30.043" Score="3" ViewCount="79" Body="&lt;p&gt;I am trying to match a Perl identifier at the point, like &lt;code&gt;My::Module::dummy_func&lt;/code&gt;. I'd like to start simple and require a valid identifier as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;restricted to a single line&lt;/li&gt;&#xA;&lt;li&gt;starts with a space&lt;/li&gt;&#xA;&lt;li&gt;ends with a (&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So if point is at a colon in this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;my $a = My::Module::dummy_func(3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I should get a match equal to &lt;code&gt;My::Module::dummy_func&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-perl-id-at-point ()&#xA;  (interactive)&#xA;  (let ((beg nil) (end nil))&#xA;    (save-excursion&#xA;      (if (re-search-forward &quot;[A-Za-z0-9:_]*?(&quot; (line-end-position) t)&#xA;          (setq end (- (point) 1))))&#xA;    (save-excursion&#xA;      (if (re-search-backward &quot; [A-Za-z0-9:_]*?&quot; (line-beginning-position) t)&#xA;          (setq beg (+ (point) 1))))&#xA;    (if (and beg end)&#xA;        (message (buffer-substring beg end)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works for example if point is at a &lt;code&gt;:&lt;/code&gt;, but if point is at the &lt;code&gt;$&lt;/code&gt; in &lt;code&gt;$a&lt;/code&gt; I get &lt;code&gt;$a = My::Module::dummy_func&lt;/code&gt; whereas I would like to get a no match..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be done?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="50" LastEditDate="2014-12-17T00:55:58.850" LastActivityDate="2014-12-17T07:40:01.597" Title="Match Perl identifier using re-search" Tags="|search|regular-expressions|perl|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5451" PostTypeId="1" AcceptedAnswerId="5453" CreationDate="2014-12-16T20:34:22.080" Score="8" ViewCount="3842" Body="&lt;p&gt;I often find myself with an incomplete or invalid emacs config, which breaks the normal behavior of &lt;code&gt;kill-emacs&lt;/code&gt; such that it stops at an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, I would like to forcefully kill emacs, without resorting to hunting down the PID and issuing a &lt;code&gt;kill&lt;/code&gt; from the shell. Can I do this in pure Emacs Lisp?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2020-11-10T23:21:45.177" Title="How do I force kill Emacs?" Tags="|emacs-internals|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5452" PostTypeId="1" AcceptedAnswerId="5490" CreationDate="2014-12-16T21:20:40.107" Score="20" ViewCount="8439" Body="&lt;p&gt;I want to customize &lt;code&gt;cc-mode&lt;/code&gt; to execute a function before saving. One solution would be to modify &lt;code&gt;cc-mode&lt;/code&gt; keymap to bind &lt;code&gt;C-x C-s&lt;/code&gt; to a function which performs the work I need and then saves it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is whether there is a hook I could customize for this? The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ccmode/CC-Hooks.html&quot; rel=&quot;noreferrer&quot;&gt;CC Hooks docs&lt;/a&gt; don't mention a &lt;code&gt;before-save-hook&lt;/code&gt; specifically for &lt;code&gt;cc-mode&lt;/code&gt;. How should this be done through a hook?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, how do I do this through &lt;code&gt;defadvice&lt;/code&gt;? From reading the manual, the only way I could see was to enable the advice before saving and then disable after the work is done. This sounds cumbersome. What would be the idiomatic way of using &lt;code&gt;advice&lt;/code&gt;s?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="25" LastEditDate="2014-12-26T23:25:32.667" LastActivityDate="2014-12-27T10:37:45.970" Title="before-save-hook for cc-mode" Tags="|hooks|cc-mode|advice|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5453" PostTypeId="2" ParentId="5451" CreationDate="2014-12-16T21:24:18.430" Score="15" Body="&lt;p&gt;You can try setting &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Killing-Emacs.html&quot;&gt;&lt;code&gt;kill-emacs-hook&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;nil&lt;/code&gt; before calling &lt;code&gt;kill-emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun really-kill-emacs ()&#xA;  &quot;Like `kill-emacs', but ignores `kill-emacs-hook'.&quot;&#xA;  (interactive)&#xA;  (let (kill-emacs-hook)&#xA;    (kill-emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can get Emacs's PID using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html#System-Environment&quot;&gt;&lt;code&gt;emacs-pid&lt;/code&gt;&lt;/a&gt; and make it commit suicide by calling &lt;code&gt;call-process&lt;/code&gt; with &quot;&lt;code&gt;kill -9&lt;/code&gt;&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun brutally-kill-emacs ()&#xA;  &quot;Use `call-process' to send ourselves a KILL signal.&quot;&#xA;  (interactive)&#xA;  (call-process &quot;kill&quot; nil nil nil &quot;-9&quot; (number-to-string (emacs-pid))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-16T21:24:18.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5454" PostTypeId="2" ParentId="3370" CreationDate="2014-12-16T22:21:34.010" Score="1" Body="&lt;p&gt;I have found a reasonable workaround. First, add a script to your &lt;code&gt;PATH&lt;/code&gt; with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;export TTY=$(basename `tty`)&#xA;&#xA;emacs --daemon=&quot;emacs-$TTY&quot;&#xA;emacsclient -n -nw --socket-name=&quot;emacs-$TTY&quot;&#xA;emacsclient -nw --socket-name=&quot;emacs-$TTY&quot; &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;called &lt;code&gt;emacs-server-start&lt;/code&gt;. Then start emacsclient with &lt;code&gt;emacsclient -a 'emacs-server-start' -nw --socket-name=emacs-$TTY&lt;/code&gt; (I have &lt;code&gt;e&lt;/code&gt; aliased to this in my bash configuration). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You basically are creating a custom &quot;start emacs server&quot; alternate editor for &lt;code&gt;emacsclient -a&lt;/code&gt;, since &lt;code&gt;emacsclient -a ''&lt;/code&gt; doesn't work.  Saving this to a file is necessary because the argument to &lt;code&gt;-a&lt;/code&gt; must be a single command (i.e., &lt;code&gt;emacsclient -a 'emacs --daemon'&lt;/code&gt; does not work). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The extra &lt;code&gt;emacsclient -n&lt;/code&gt;, which causes emacsclient to start and immediately close with no file, is there because otherwise emacs will sometimes still freeze at startup. &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="118" LastEditDate="2020-02-19T22:44:55.903" LastActivityDate="2020-02-19T22:44:55.903" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5455" PostTypeId="1" CreationDate="2014-12-16T22:30:41.220" Score="1" ViewCount="31" Body="&lt;p&gt;When I'm using &lt;code&gt;pylint-mode&lt;/code&gt; for a big refactor, I quite frequently want to banish lower-priority errors to the bottom of the buffer. Currently I have to skip the same errors ever time I refresh the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this? &lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-12-16T22:30:41.220" Title="Send pylint warning to bottom of list" Tags="|python|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5456" PostTypeId="2" ParentId="5451" CreationDate="2014-12-16T23:20:15.760" Score="1" Body="&lt;p&gt;Sometimes, I end up with several unreachable emacs processes laying around.  My emacsclient normally automatically starts an emacs and calls &lt;code&gt;server-start&lt;/code&gt;--I guess there is some bug in my configuration somewhere which results in this happening more than once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I kill the extra emacsen with &lt;code&gt;killall emacs&lt;/code&gt; in a shell.  So far, &lt;code&gt;-9&lt;/code&gt; hasn't been needed.  (It works when there's only one emacs running, too, and I don't have to hunt down a pid!)&lt;/p&gt;&#xA;" OwnerUserId="870" LastActivityDate="2014-12-16T23:20:15.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5457" PostTypeId="1" AcceptedAnswerId="5458" CreationDate="2014-12-16T23:51:29.053" Score="3" ViewCount="446" Body="&lt;p&gt;I'm using &lt;strong&gt;&lt;a href=&quot;https://github.com/porterjamesj/virtualenvwrapper.el&quot; rel=&quot;nofollow&quot;&gt;virtualenvwrapper.el&lt;/a&gt;&lt;/strong&gt; to load Python virtualenvs during emacs sessions. I would like emacs to &lt;strong&gt;start&lt;/strong&gt; with a default one, so I don't have to load it manually every time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To load it manually, I use&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;M-x&lt;/strong&gt; venv-workon &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Virtualenv to swich to:&lt;/strong&gt; myvirtualenv &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I do this through &lt;code&gt;init.el&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="3895" LastActivityDate="2014-12-17T00:03:47.930" Title="How can I use an interactive function in a script?" Tags="|init-file|interactive|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5458" PostTypeId="2" ParentId="5457" CreationDate="2014-12-16T23:58:17.060" Score="7" Body="&lt;p&gt;Interactive simply provides a way to call the function via M-x.  You can use &lt;code&gt;venv-workon&lt;/code&gt; normally, like any other emacs-lisp function.  Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (require 'virtualenvwrapper)&#xA; (venv-workon &quot;my-python-project&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more detail on what interactive does, see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html#Using-Interactive&quot;&gt;Using Interactive&lt;/a&gt; from the Elisp docs.  Essentially, &lt;code&gt;interactive&lt;/code&gt; marks a function as a command and defines how arguments passed to a command should be parsed.&lt;/p&gt;&#xA;" OwnerUserId="256" LastEditorUserId="256" LastEditDate="2014-12-17T00:03:47.930" LastActivityDate="2014-12-17T00:03:47.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5459" PostTypeId="1" AcceptedAnswerId="5463" CreationDate="2014-12-17T00:25:18.937" Score="3" ViewCount="366" Body="&lt;p&gt;I wrote a bad bit of elisp when trying to do a &lt;code&gt;query-replace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The text to replace was like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* list item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I wanted it to be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* List item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My query-replace-regexp match was written as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^\* \([a-z]\{1\}\) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the match, where I used the wrong elisp, was:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* \,(upcase-word \1)  ;; should have been * \,(capitalize \1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get this error: &lt;code&gt;Wrong type argument: number-or-marker-p, replace-eval-replacement&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to run &lt;code&gt;query-replace-regexp&lt;/code&gt; again, I get the same error and cannot edit the replacement text. All I can do is exit Emacs and restart it. I assume there must be some way to clear the history, but I can't find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggested on twitter was &lt;code&gt;(setq regexp-history nil)&lt;/code&gt; but no luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is Emacs 25.0.50.&lt;/p&gt;&#xA;" OwnerUserId="523" LastEditorUserId="253" LastEditDate="2014-12-17T01:09:35.840" LastActivityDate="2014-12-17T01:51:55.930" Title="How to clear regexp-replace history?" Tags="|search|regular-expressions|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5460" PostTypeId="1" AcceptedAnswerId="5548" CreationDate="2014-12-17T00:32:14.003" Score="4" ViewCount="5448" Body="&lt;p&gt;I am starting a Python &lt;strong&gt;virtualenv&lt;/strong&gt; through &lt;code&gt;init.el&lt;/code&gt; (or so I would like):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'virtualenvwrapper)&#xA;(venv-workon &quot;my-python-project&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, &lt;strong&gt;flycheck&lt;/strong&gt; does not find &lt;code&gt;flake8&lt;/code&gt; or &lt;code&gt;pylint&lt;/code&gt;, which are installed there. Starting emacs in a terminal with the virtualenv loaded works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure &lt;strong&gt;init.el&lt;/strong&gt; to start a virtualenv for &lt;strong&gt;flycheck&lt;/strong&gt; to use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems that this is related to an open &lt;a href=&quot;https://bugs.launchpad.net/python-mode/+bug/1329217&quot; rel=&quot;nofollow&quot;&gt;bug&lt;/a&gt; in &lt;code&gt;python-mode.el&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="3895" LastEditorUserId="3895" LastEditDate="2014-12-24T13:23:15.440" LastActivityDate="2014-12-24T13:23:15.440" Title="Starting a virtualenv for emacs to use" Tags="|init-file|python|flycheck|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5461" PostTypeId="1" AcceptedAnswerId="5468" CreationDate="2014-12-17T00:41:17.637" Score="7" ViewCount="1689" Body="&lt;p&gt;My config is a literate org-mode file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my Linux machine, the code blocks are highlighted with the relevant syntax highlighting (i.e. Elisp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But on my Mac, I get this error when I load the buffer:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-mode fontification error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I fontify the code blocks, and avoid that error?&lt;/p&gt;&#xA;" OwnerUserId="850" LastActivityDate="2016-02-09T17:56:07.570" Title="Fix org-fontification error" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5463" PostTypeId="2" ParentId="5459" CreationDate="2014-12-17T00:52:54.997" Score="5" Body="&lt;p&gt;If you only want to clear the default values that come up when restarting &lt;code&gt;query-replace-regexp&lt;/code&gt;, you can clobber them with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq query-replace-defaults nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to nuke the entire history as well, you can do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq query-replace-history nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-17T00:52:54.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5464" PostTypeId="2" ParentId="5459" CreationDate="2014-12-17T01:51:55.930" Score="6" Body="&lt;p&gt;@Dan's answer is good, and it clears the bad entry out of your history for good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just FYI, another possibility would have been to do &lt;strong&gt;&lt;code&gt;C-x ESC ESC&lt;/code&gt;&lt;/strong&gt;, and then edit the search pattern. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That brings up the &lt;strong&gt;&lt;em&gt;full&lt;/em&gt;&lt;/strong&gt; last command you executed, as a Lisp sexp, which you can edit. (If you had used other commands in the meantime then you could use &lt;code&gt;M-p&lt;/code&gt; to move backward in &lt;em&gt;this&lt;/em&gt; history (the extended-command history), which is different (and acts differently) from the &lt;code&gt;query-replace-history&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That would have let you use &lt;code&gt;query-replace-regexp&lt;/code&gt; again without clearing its history. Not that there is any reason here not to clear the history, but it can be good to know of more than one way to skin the cat.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-17T01:51:55.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5465" PostTypeId="1" AcceptedAnswerId="5467" CreationDate="2014-12-17T01:52:27.940" Score="64" ViewCount="21524" Body="&lt;p&gt;I've got hundreds of personal notes stored as files in Markdown format, after several years using the &lt;a href=&quot;https://plausible.coop/voodoopad/&quot; rel=&quot;noreferrer&quot;&gt;VoodooPad&lt;/a&gt; personal wiki software for OS X. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's plenty of information available for exporting from org mode to Markdown, but is there an easy way to convert Markdown to org mode format?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/a/5467/3914&quot;&gt;user2619203's answer&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/a/10323583/705157&quot;&gt;this answer to a question on batch processing of files with Pandoc&lt;/a&gt; I was able to convert four hundred Markdown  files into org mode format in just a few minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution was to export the VoodooPad document to a folder as text (&lt;strong&gt;File&lt;/strong&gt; &gt; &lt;strong&gt;Export Document&lt;/strong&gt; &gt; &lt;strong&gt;Export as Text...&lt;/strong&gt;). Then call &lt;code&gt;pandoc&lt;/code&gt; via the &lt;code&gt;find&lt;/code&gt; command to convert them all in one go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ find . -name \*.txt -type f -exec pandoc  -f markdown -t org -o {}.org {} \; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The converted .org files I've looked at are formatted beautifully -- even the codeblocks and format styling. Thank-you, &lt;a href=&quot;https://emacs.stackexchange.com/users/3928/user2619203&quot;&gt;user2619203&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simply convert one file from Markdown to Org the following command can be used: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;pandoc -f markdown -t org -o newfile.org original-file.markdown&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pandoc.org/README.html&quot; rel=&quot;noreferrer&quot;&gt;Here is a link to the Pandoc documentation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3914" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2021-12-04T17:00:24.713" Title="How to migrate Markdown files to Emacs org mode format" Tags="|org-mode|markdown|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5466" PostTypeId="2" ParentId="5460" CreationDate="2014-12-17T01:54:16.957" Score="5" Body="&lt;p&gt;I don't think there's a prebuilt way to do this.  I hacked around it like so.  This depends on having all of your virtualenvs in ~/.virtualenvs, and having projectile installed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my:virtualenv-directory &quot;~/.virtualenvs/&quot;&#xA;  &quot;The directory of virtualenvs.&quot;)&#xA;&#xA;(defun my:configure-python-venv ()&#xA;  &quot;Set `python-shell-virtualenv-path' to the virtualenv directory.&quot;&#xA;  (interactive)&#xA;  (require 'projectile)&#xA;  (let* ((project-name (projectile-project-name))&#xA;         (virtualenv-path&#xA;          (file-truename&#xA;           (concat my:virtualenv-directory project-name))))&#xA;    (when (file-directory-p virtualenv-path)&#xA;      (setq python-shell-virtualenv-path virtualenv-path))))&#xA;&#xA;(defun my:flycheck-python-set-executables ()&#xA;  &quot;Set flycheck python executables for the current virtualenv.&quot;&#xA;  (let ((exec-path (python-shell-calculate-exec-path)))&#xA;    (setq-local flycheck-python-pylint-executable (executable-find &quot;pylint&quot;))&#xA;    (setq-local flycheck-python-flake8-executable (executable-find &quot;flake8&quot;))))&#xA;&#xA;(defun my:flycheck-python-setup ()&#xA;  &quot;Setup flycheck for Python with virtualenvs. &quot;&#xA;  ;; my:flycheck-python-set-executables uses buffer-local variables&#xA;  (add-hook 'hack-local-variables-hook #'my:flycheck-python-set-executables&#xA;            nil 'local))&#xA;&#xA;(add-hook 'python-mode-hook #'my:configure-python-venv)&#xA;(add-hook 'python-mode-hook #'my:flycheck-python-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastEditorDisplayName="user227" LastEditDate="2014-12-17T14:26:21.993" LastActivityDate="2014-12-17T14:26:21.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5467" PostTypeId="2" ParentId="5465" CreationDate="2014-12-17T02:00:49.110" Score="55" Body="&lt;p&gt;&lt;a href=&quot;https://pandoc.org/&quot; rel=&quot;noreferrer&quot;&gt;Pandoc&lt;/a&gt; can convert between multiple document formats. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To convert a bunch of Markdown files to org-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for f in `ls *.md`; do &#xA;  pandoc -f markdown -t org -o ${f}.org ${f}; &#xA;done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3928" LastEditorUserId="2059" LastEditDate="2019-07-24T12:22:39.090" LastActivityDate="2019-07-24T12:22:39.090" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="5468" PostTypeId="2" ParentId="5461" CreationDate="2014-12-17T02:19:39.150" Score="0" Body="&lt;p&gt;I've had this problem when using a version of org, such as the one shipped with the latest version of emacs, that conflicted with the latest version of other packages (ESS, in particular). After updating to the latest version, the problem disappeared. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to clear the pre-installed org from emacs after updating.&lt;/p&gt;&#xA;" OwnerUserId="3928" LastActivityDate="2014-12-17T02:19:39.150" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5469" PostTypeId="1" CreationDate="2014-12-17T02:34:36.517" Score="2" ViewCount="214" Body="&lt;p&gt;I recently downloaded Emacs 24.4 and sometimes I see an &quot;invalid date&quot; error in my buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I am in &lt;code&gt;eww&lt;/code&gt;, often I try to click (&lt;code&gt;RET&lt;/code&gt;) a link and I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error in process sentinel: Invalid date: 01-Jan-2055 00:00:00.00 GMT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought it was an eww error, but today I was in &lt;code&gt;c-mode&lt;/code&gt; and I saw&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error running timer `url-cookie-write-file': (error &quot;Invalid date: 01-Jan-2055 00:00:00.00 GMT&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I fix this? I've not found any useful post with an &quot;invalid date&quot;.&#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="3876" LastActivityDate="2014-12-23T06:18:29.420" Title="Invalid date: 01-Jan-2055" Tags="|time-date|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5470" PostTypeId="2" ParentId="4253" CreationDate="2014-12-17T02:43:42.363" Score="18" Body="&lt;p&gt;You can &lt;strong&gt;symlink&lt;/strong&gt; &lt;code&gt;~/.emacs.d&lt;/code&gt;, this is what I do&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Try to keep my emacs configuration &lt;code&gt;~/.emacs.d&lt;/code&gt; oriented i.e. all emacs related config files should live in that folder&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then I have an &lt;code&gt;~/.emacs_configs&lt;/code&gt; folder where all config folders (basically a folder with a &lt;code&gt;init.el&lt;/code&gt; and rest of the configuration) live, so my personal config folder will be &lt;code&gt;~/emacs_configs/iqbal&lt;/code&gt;, a prelude distribution will be in &lt;code&gt;~/emacs_configs/prelude&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Very early in my personal emacs config I set the &lt;code&gt;user-emacs-directory&lt;/code&gt; to the full path to my config using the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-emacs-directory (file-truename &quot;~/.emacs.d/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then finally I symlink &lt;code&gt;~/.emacs.d&lt;/code&gt; to the configuration I actually want to use, eg. to use my configuration I will do &lt;code&gt;ln -s ~/emacs_configs/iqbal .emacs.d&lt;/code&gt;. If you want to tryout some configuration just copy the configuration folder to &lt;code&gt;~/emacs_configs/whatever_name&lt;/code&gt; and change the symlink&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The advantage of the 3rd step is that emacs started with my personal configuration can run unaffected even if I change the &lt;code&gt;.emacs.d&lt;/code&gt; symlink while emacs it is running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another advantage is since the &lt;code&gt;HOME&lt;/code&gt; is not changed external programs emacs might need to interact with are unaffected&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="5472" LastEditDate="2015-04-26T10:34:19.620" LastActivityDate="2015-04-26T10:34:19.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5472" PostTypeId="1" AcceptedAnswerId="5473" CreationDate="2014-12-17T04:29:56.400" Score="12" ViewCount="1725" Body="&lt;p&gt;I'd like to have &lt;code&gt;org-mode&lt;/code&gt; do what &lt;a href=&quot;https://www.omnigroup.com/omnifocus/&quot; rel=&quot;nofollow&quot;&gt;OmniFocus&lt;/a&gt; does; when the bottom task in a sequential list is completed, the next task in the list becomes visible in an Agenda. Any thoughts on how I might try to tackle this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd essentially like to write a tree with the leaves and only the leaves visible in some Agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be willing to try something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* PENDING buy milk&#xA;** PENDING go to store&#xA;*** PENDING get in car&#xA;**** TODO find car keys&#xA;**** TODO put on pants&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &quot;get in car&quot; automatically goes from &lt;code&gt;PENDING&lt;/code&gt; to &lt;code&gt;TODO&lt;/code&gt; when &quot;find car keys&quot; and &quot;put on pants&quot; are marked &lt;code&gt;DONE&lt;/code&gt; in some Agenda. Ideally, though, I'd just create a special list of items all at the same level and mark the bottom one &lt;code&gt;TODO&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3930" LastEditorUserId="91" LastEditDate="2014-12-25T04:43:10.807" LastActivityDate="2014-12-25T04:43:10.807" Title="Flexible org TODO dependencies?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5473" PostTypeId="2" ParentId="5472" CreationDate="2014-12-17T04:46:40.657" Score="10" Body="&lt;p&gt;See &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-depend.html&quot;&gt;org-depend.el&lt;/a&gt;. It does exactly what you want. Rather than repeating the documentation here you can see docs and examples at &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-depend.html&quot;&gt;http://orgmode.org/worg/org-contrib/org-depend.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2014-12-17T04:46:40.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5474" PostTypeId="2" ParentId="5450" CreationDate="2014-12-17T07:31:17.873" Score="3" Body="&lt;p&gt;Using the recommendations of @Constantine, here is an improved version of the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-perl-id-at-point ()&#xA;  (interactive)&#xA;  (let ((beg nil) (end nil))&#xA;    (if (looking-at &quot;[A-Za-z0-9:_]*?(&quot;)&#xA;        (setq end (- (match-end 0) 1)))&#xA;    (if (looking-back &quot;[-+=*/;[:space:]][A-Za-z0-9:_]*?&quot; (- (line-beginning-position) 1))&#xA;        (setq beg (+ (match-beginning 0) 1)))&#xA;    (if (and beg end)&#xA;        (message (buffer-substring beg end))&#xA;      (message &quot;No match&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work well.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2014-12-17T07:40:01.597" LastActivityDate="2014-12-17T07:40:01.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5475" PostTypeId="1" AcceptedAnswerId="5497" CreationDate="2014-12-17T11:53:42.833" Score="0" ViewCount="6151" Body="&lt;p&gt;Recently, I found &lt;a href=&quot;http://emacsthemes.caisah.info/&quot; rel=&quot;nofollow&quot;&gt;a website&lt;/a&gt; providing many color themes for Emacs, so I decided to install one. However, I was confused by some instructions from web or other forums and I couldn't manage to install anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I come here to ask for help, hope someone could help me install a color theme for Emacs! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My OS is Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I have downloaded one color theme, extract it to a folder called elisp, and wrote the following command in the &lt;code&gt;.emacs&lt;/code&gt; file &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/elisp/black-theme-master&quot;)&#xA;(require 'blackboard-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I open Emacs,  it gives me an error warning.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/shieh/.emacs':&#xA;&#xA;File error: Cannot open load file, blackboard-theme&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the theme I got is here: &lt;a href=&quot;http://emacsthemes.caisah.info/blackboard-theme/&quot; rel=&quot;nofollow&quot;&gt;Blackborad theme&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2497" LastEditorUserId="2497" LastEditDate="2014-12-18T03:32:06.920" LastActivityDate="2017-02-12T17:00:05.850" Title="How to install a color theme for Emacs 24?" Tags="|package|themes|emacs24.4|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5476" PostTypeId="1" AcceptedAnswerId="5477" CreationDate="2014-12-17T11:56:23.157" Score="5" ViewCount="1611" Body="&lt;p&gt;I am using emacs-24.3, which comes with python.el and IPython support out of the box (or so they say).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there documentation for this mode? Where can I find it?&lt;/p&gt;&#xA;" OwnerUserId="3895" LastActivityDate="2014-12-17T12:36:52.743" Title="Where is the python.el documentation?" Tags="|python|documentation|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5477" PostTypeId="2" ParentId="5476" CreationDate="2014-12-17T12:36:52.743" Score="13" Body="&lt;p&gt;You can visit the file &lt;code&gt;python.el.gz&lt;/code&gt; which defines the mode doing &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;find-library&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;python&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. The commentary at the beginning of the file is pretty comprehensive.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-17T12:36:52.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5478" PostTypeId="1" AcceptedAnswerId="5479" CreationDate="2014-12-17T13:18:27.057" Score="0" ViewCount="95" Body="&lt;p&gt;&lt;a href=&quot;http://william.famille-blum.org/software/sumatra/sumatra-forward.el&quot; rel=&quot;nofollow&quot;&gt;sumatra-forward.el&lt;/a&gt; &#xA;allows to do a &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/I_002fO-Correlation.html&quot; rel=&quot;nofollow&quot;&gt;forward-search&lt;/a&gt; from a place in a tex file to the corresponding place in its compiled pdf file viewed by &lt;a href=&quot;http://www.sumatrapdfreader.org&quot; rel=&quot;nofollow&quot;&gt;SumatraPDF&lt;/a&gt;. The command to do the job is &lt;code&gt;M-x sumatra-jump-to-line&lt;/code&gt;. After invoking this command, the corresponding place in pdf file takes the red color for few millisecond. Is it possible to increase this really brief time? &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-09-27T04:17:22.280" LastActivityDate="2016-09-27T04:17:22.280" Title="increasing the time of search-forward using sumatra-forward.el" Tags="|latex|auctex|pdf|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5479" PostTypeId="2" ParentId="5478" CreationDate="2014-12-17T13:48:35.777" Score="1" Body="&lt;p&gt;This question isn't actually about Emacs—hence my close vote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to configure SumatraPDF accordingly.  On a cursory look at the &lt;a href=&quot;http://www.sumatrapdfreader.org/settings.html#InverseSearchCmdLine&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; I didn't find any option to increase the highlighting time, but you can make it permanent until the next mouse click by changing the &lt;code&gt;HighlightPermament&lt;/code&gt; setting in the &lt;code&gt;ForwardSearch&lt;/code&gt; group to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-17T13:48:35.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5480" PostTypeId="2" ParentId="5475" CreationDate="2014-12-17T13:54:19.070" Score="3" Body="&lt;p&gt;If you have the theme file stored at &lt;code&gt;~/elisp/black-theme-maste/blackboard-theme.el&lt;/code&gt; use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'custom-theme-load-path &quot;~/elisp/black-theme-maste/&quot;)&#xA;(load-theme 'blackboard)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: &#xA;You have to omit the &quot;-theme&quot; in &lt;code&gt;load-theme&lt;/code&gt; part; however, it is required in the filename for emacs to recognize it as a theme. &lt;/p&gt;&#xA;" OwnerUserId="330" LastEditorUserId="-1" LastEditDate="2017-02-12T17:00:05.850" LastActivityDate="2017-02-12T17:00:05.850" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5481" PostTypeId="1" AcceptedAnswerId="7903" CreationDate="2014-12-17T14:33:00.877" Score="9" ViewCount="1513" Body="&lt;p&gt;I'm using org-mode to keep track of the time I spend on various projects. I have one main org file and two more for two large projects I'm working on. All three are listed in &lt;code&gt;org-agenda-files&lt;/code&gt;. I created a clock table in the main org file and set &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:scope agenda-with-archives&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the clocktable header to summarise the time spent. This all works fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I also have a few smaller projects that also have time tracked in their own org file (located in the subdirectory that contains everything about those projects), and I'd like to track time in those as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I could add those files to &lt;code&gt;org-agenda-files&lt;/code&gt;, but that would mean updating my &lt;code&gt;.emacs&lt;/code&gt; every time I start a new small project. Not the end of the world of course, but since I already have a link to the small-project-org-files in the main org file (see example below), I'd like to set the &lt;code&gt;:scope&lt;/code&gt; to something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:scope agenda-with-archives linked-org-files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ideally (although I'm not using that yet) including archive files of those smaller projects would be great to (something like &lt;code&gt;:scope linked-org-files-with-archives&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of how my main org file is structured:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Small project 1&#xA;  See file:~/Projects/Project 1/notes_project_1.org for more details.&#xA;* Small project 2&#xA;  See file:~/Projects/Project 2/notes_project_2.org.&#xA;** DONE Some small task I can do quickly&#xA;   CLOCK: [2014-12-05 vr 12:19]--[2014-12-05 vr 12:40] =&amp;gt;  0:21&#xA;   Some info on the small task.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea on how to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2019-04-21T05:01:13.473" Title="Is there a simple way to use all org-files referenced in a main file for the org-mode clock table" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5482" PostTypeId="1" AcceptedAnswerId="9386" CreationDate="2014-12-17T15:28:44.557" Score="1" ViewCount="276" Body="&lt;p&gt;I'm trying to figure out how to approach a bug I've run into. I assume it's actually a bug in Emacs, but I don't know the right way to make headway with it. In short, I'm getting the message &lt;code&gt;&quot;binding stack not balanced (serious byte compiler bug)&quot;&lt;/code&gt; when I try to send an HTTP message. I don't know how to tell if this is caused by something I've done, if it's a bug in Emacs, a bug in some other code, or what, so any help pointing me in the right direction would be great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some more context. I'm sending an HTTP message from Emacs to a Python web service. The payload/content-type is JSON. Emacs starts and manages the Python server, and certain configuration options determine whether that server is running under Python 2 or Python 3. This would normally not be relevant for Emacs, but strangely this defect only manifests itself when the server is running with Python 3. With Python 2 everything works perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if the Python2/3 difference is a complete red herring or not. It could be that some difference in the details of the network traffic between Python 2 and 3 is causing this defect. Or it could be that the values of the elisp variables which control the Python version are to blame. Of those options the first seems more plausible, but both seem pretty far-fetched. In other words, I'm stumped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it will help, I can post the stacktrace showing where the error is generated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ED: The stacktrace can be seen &lt;a href=&quot;https://gist.github.com/abingham/a9698abf2a61c2866393&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="216" LastEditDate="2014-12-22T16:40:06.173" LastActivityDate="2015-02-19T02:55:43.080" Title="Debugging a &quot;binding stack not balanced&quot; bug?" Tags="|python|debugging|http|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5483" PostTypeId="1" CreationDate="2014-12-17T15:39:24.943" Score="2" ViewCount="1146" Body="&lt;p&gt;In org-mode, is there a variable/const/whatever containing a list of all  languages supported in &quot;BEGIN/END_SRC&quot; blocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other methods to list them? (except parsing a list of ob-*.el files)&lt;/p&gt;&#xA;" OwnerUserId="98" LastActivityDate="2014-12-17T17:24:40.353" Title="Is there a variable with a list of languages supported by Org-mode src-blocks?" Tags="|elisp|org-babel|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5484" PostTypeId="2" ParentId="5483" CreationDate="2014-12-17T15:48:20.557" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;org-babel-load-languages&lt;/code&gt; lists all the languages that can currently be evaluated in a org-mode buffer.  The default is just &lt;code&gt;emacs-lisp&lt;/code&gt;.  More may (will) be available but won't be evaluatable by default.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You still get syntax highlighting of other languages as long as the corresponding major mode is installed.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2014-12-17T17:24:40.353" LastActivityDate="2014-12-17T17:24:40.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5485" PostTypeId="2" ParentId="5483" CreationDate="2014-12-17T15:48:49.693" Score="2" Body="&lt;p&gt;There is no limitation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-src-lang-modes is a variable defined in `org-src.el'.&#xA;Its value is shown below.&#xA;&#xA;Documentation:&#xA;Alist mapping languages to their major mode.&#xA;The key is the language name, the value is the string that should&#xA;be inserted as the name of the major mode.  For many languages this is&#xA;simple, but for language where this is not the case, this variable&#xA;provides a way to simplify things on the user side.&#xA;For example, there is no ocaml-mode in Emacs, but the mode to use is&#xA;`tuareg-mode'.&#xA;&#xA;You can customize this variable.&#xA;&#xA;Value: ((&quot;ocaml&quot; . tuareg)&#xA; (&quot;elisp&quot; . emacs-lisp)&#xA; (&quot;ditaa&quot; . artist)&#xA; (&quot;asymptote&quot; . asy)&#xA; (&quot;dot&quot; . fundamental)&#xA; (&quot;sqlite&quot; . sql)&#xA; (&quot;calc&quot; . fundamental)&#xA; (&quot;C&quot; . c)&#xA; (&quot;cpp&quot; . c++)&#xA; (&quot;C++&quot; . c++)&#xA; (&quot;screen&quot; . shell-script))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there is no built in support, &lt;code&gt;org-mode&lt;/code&gt; will try to find a mode named after whatever you named the source block. That is, if you have a source block such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC whatever-language-you-want&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you press &lt;code&gt;C-c '&lt;/code&gt; inside it, you'll see the echo &lt;code&gt;No such language mode: whatever-language-you-want-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Babel evaluation support, see: &lt;a href=&quot;http://orgmode.org/manual/Languages.html#Languages&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Languages.html#Languages&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-12-17T15:48:49.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5486" PostTypeId="1" AcceptedAnswerId="5488" CreationDate="2014-12-17T16:35:24.207" Score="8" ViewCount="1371" Body="&lt;p&gt;I followed &lt;a href=&quot;https://emacs.stackexchange.com/a/358/219&quot;&gt;this&lt;/a&gt; answer and created my minor mode to avoid my keybindings being overridden by any major modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I put this in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-keys-mode-map (kbd &quot;C-h&quot;) 'delete-backward-char)&#xA;(define-key my-keys-mode-map (kbd &quot;M-h&quot;) 'backward-kill-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is working with everything except when I am in &lt;code&gt;helm-find-files&lt;/code&gt;. While &lt;code&gt;M-h&lt;/code&gt; works, &lt;code&gt;C-h&lt;/code&gt; doesn't. If I press it twice, &lt;code&gt;Help&lt;/code&gt; buffer shows up saying:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^L&#xA;Major Mode Bindings Starting With C-h:&#xA;key             binding&#xA;---             -------&#xA;&#xA;C-h C-b     helm-send-bug-report-from-helm&#xA;&#xA;^L&#xA;Global Bindings Starting With C-h:&#xA;key             binding&#xA;---             -------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I disable &lt;code&gt;C-h&lt;/code&gt; in &lt;code&gt;helm-find-files&lt;/code&gt; and keep using my own keybinding?&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2014-12-17T17:44:37.537" Title="Helm: override C-h" Tags="|key-bindings|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5487" PostTypeId="2" ParentId="5452" CreationDate="2014-12-17T16:41:25.623" Score="-1" Body="&lt;p&gt;I once needed something like that for autocompiling my elisp files when saved, I used a approach like this (converted the approach to cc-mode):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c-common-hook #'(lambda ()&#xA;                              (add-hook 'before-save-hook #'(lambda ()&#xA;                                                               (funcall #'YOUR-FUNC-HOOK)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3933" LastActivityDate="2014-12-17T16:41:25.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5488" PostTypeId="2" ParentId="5486" CreationDate="2014-12-17T16:45:55.780" Score="6" Body="&lt;p&gt;&lt;code&gt;C-h&lt;/code&gt; is special: see &lt;a href=&quot;https://emacs.stackexchange.com/a/3814/2355&quot;&gt;my answer&lt;/a&gt; to &lt;a href=&quot;https://emacs.stackexchange.com/q/3787/2355&quot;&gt;html-mode and custom backspace keybinding&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short: whenever you rebind &lt;code&gt;C-h&lt;/code&gt; you should also change the value of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Help-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;help-char&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable its action, do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq help-char nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You can also set it to a different character.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to this, &lt;code&gt;helm-find-files&lt;/code&gt; uses &lt;code&gt;C-h&lt;/code&gt; as a prefix key. The code below replaces the &lt;code&gt;C-h&lt;/code&gt; prefix with &lt;code&gt;M-m&lt;/code&gt;, which should free &lt;code&gt;C-h&lt;/code&gt; up to be used as &quot;backspace&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;helm-files&quot;&#xA;  '(let ((helm-find-files-C-h-map (lookup-key helm-find-files-map (kbd &quot;C-h&quot;))))&#xA;     ;; make sure C-h is no longer a prefix key&#xA;     (define-key helm-find-files-map (kbd &quot;C-h&quot;) nil)&#xA;     ;; rebind &quot;C-h ...&quot; to &quot;M-m ...&quot; to preserve functionality&#xA;     (define-key helm-find-files-map (kbd &quot;M-m&quot;) helm-find-files-C-h-map)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-12-17T17:44:37.537" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5489" PostTypeId="1" CreationDate="2014-12-17T17:31:15.523" Score="5" ViewCount="333" Body="&lt;p&gt;I'm performing a large python refactor, and one component of that is renaming many variables from camelCase to snake_case. I'd like to hook a camel-to-snake conversion function (which I already have) into the default values of &lt;code&gt;rope-refactor&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I inspect &lt;code&gt;rope-refactor&lt;/code&gt;, I get the following information.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rope-rename is an interactive Lisp function.&#xA;&#xA;(rope-rename &amp;amp;rest ARGUMENTS)&#xA;&#xA;It interfaces to a Python function.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Rope interfaces with Emacs through Pymacs. What would be the recommended way of achieving these defaults? Should I make the change in Rope's python modules, or is there an elegant way of setting the default arguments on the elisp side? I'd prefer the latter.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-12-17T17:31:15.523" Title="Ropemacs default refactoring" Tags="|python|refactoring|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5490" PostTypeId="2" ParentId="5452" CreationDate="2014-12-17T18:14:10.803" Score="15" Body="&lt;p&gt;One fairly common way of restricting the action of a hook to a particular major mode is to check the value of &lt;code&gt;major-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this hook prints a message before saving buffers using &lt;code&gt;c++-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-c++-mode-before-save-hook ()&#xA;  (when (eq major-mode 'c++-mode)&#xA;    (message &quot;It's never too early to start saving (C++ code)!&quot;)))&#xA;&#xA;(add-hook 'before-save-hook #'my-c++-mode-before-save-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a side note: sometimes it can be useful to check if a major mode is derived from CC Mode; we can do this by checking if &lt;code&gt;c-buffer-is-cc-mode&lt;/code&gt; is not &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cc-mode-before-save-hook ()&#xA;  (when c-buffer-is-cc-mode&#xA;    (message &quot;Saving a buffer with a major-mode derived from CC Mode.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-17T18:14:10.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5491" PostTypeId="1" CreationDate="2014-12-17T18:50:44.017" Score="2" ViewCount="635" Body="&lt;p&gt;I set value of `ido-ignore-buffers' this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar uki-ido-ignored-buffer-names '(&quot;*grep*&quot; &quot;*Messages*&quot;))&#xA;&#xA;(defun uki-ido-ignore-most-star-buffers (buffer)&#xA;    (member (buffer-name) uki-ido-ignored-buffer-names))&#xA;&#xA;&#xA;(eval-after-load 'ido&#xA;  '(setq ido-ignore-buffers&#xA;         (list &quot;\\` &quot; &quot;^[ *\t]&quot; &quot;^\\*Org Src&quot; &quot;^\\*info&quot; &quot;^\\*magit:&quot;&#xA;               #'uki-ido-ignore-most-star-buffers)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run  (ido-switch-buffer), I see buffers beginning with &quot;*Org Src&quot; (visible in the following screenshot).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dUg0D.png&quot; alt=&quot;What my buffer selection looks like&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does my regexp fail to &quot;catch&quot; it?&lt;/p&gt;&#xA;" OwnerUserId="98" LastEditorUserId="98" LastEditDate="2014-12-17T19:30:09.580" LastActivityDate="2014-12-17T19:38:29.070" Title="Setting `ido-ignore-buffers' doesn't cause buffers to be ignored, where's the error?" Tags="|elisp|init-file|ido|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5493" PostTypeId="2" ParentId="5439" CreationDate="2014-12-17T19:25:44.070" Score="7" Body="&lt;p&gt;It's possible:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq LaTeX-begin-regexp &quot;\\(?:begin\\|if@\\)\\b&quot;)&#xA;(setq LaTeX-end-regexp &quot;\\(?:end\\|else\\|fi\\)\\b&quot;)&#xA;(defun LaTeX-indent-level-count ()&#xA;  &quot;Count indentation change caused by all \\left, \\right, \\begin, and&#xA;\\end commands in the current line.&quot;&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (let ((count 0))&#xA;        (narrow-to-region (point)&#xA;                          (save-excursion&#xA;                            (re-search-forward&#xA;                             (concat &quot;[^&quot; TeX-esc &quot;]&quot;&#xA;                                     &quot;\\(&quot; LaTeX-indent-comment-start-regexp&#xA;                                     &quot;\\)\\|\n\\|\\'&quot;))&#xA;                            (backward-char)&#xA;                            (point)))&#xA;        (while (search-forward TeX-esc nil t)&#xA;          (cond&#xA;            ((looking-at &quot;left\\b&quot;)&#xA;             (setq count (+ count LaTeX-left-right-indent-level)))&#xA;            ((looking-at &quot;right\\b&quot;)&#xA;             (setq count (- count LaTeX-left-right-indent-level)))&#xA;            ((looking-at LaTeX-begin-regexp)&#xA;             (setq count (+ count LaTeX-indent-level)))&#xA;            ((looking-at &quot;else\\b&quot;))&#xA;            ((looking-at LaTeX-end-regexp)&#xA;             (setq count (- count LaTeX-indent-level)))&#xA;            ((looking-at (regexp-quote TeX-esc))&#xA;             (forward-char 1))))&#xA;        count))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I had to re-define &lt;code&gt;LaTeX-indent-level-count&lt;/code&gt;.&#xA;The diff is simply one &lt;code&gt;cond&lt;/code&gt; branch:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((looking-at &quot;else\\b&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-17T19:25:44.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5494" PostTypeId="2" ParentId="5491" CreationDate="2014-12-17T19:32:18.230" Score="4" Body="&lt;p&gt;The way &lt;code&gt;ido-ignore-buffers&lt;/code&gt; works is that each buffer is evaluated against each regexp or function in the list until one of them returns true, in which case the buffer is ignored. In your sample code you ignore everything that starts with a &lt;code&gt;*&lt;/code&gt; using regexp. Buffers that do not start with &lt;code&gt;*&lt;/code&gt; will be evaluated against your function, which ignores everything except &lt;code&gt;*Messages*&lt;/code&gt; and &lt;code&gt;*grep*&lt;/code&gt;. This combination means you are effectively ignoring &lt;strong&gt;every&lt;/strong&gt; buffer name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you are seeing those &lt;code&gt;*Org&lt;/code&gt; buffers is that ido will show ignored buffers if there are no matches against non-ignored buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to filter all buffers with names starting with a space or &lt;code&gt;*&lt;/code&gt;, except for a few specific ones, this works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar ido-dont-ignore-buffer-names '(&quot;*grep*&quot; &quot;*Messages*&quot;))&#xA;&#xA;(defun ido-ignore-most-star-buffers (name)&#xA;  (and&#xA;   (string-match-p &quot;^*&quot; name)&#xA;   (not (member name ido-dont-ignore-buffer-names))))&#xA;&#xA;(setq ido-ignore-buffers (list &quot;\\` &quot; #'ido-ignore-most-star-buffers))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-12-17T19:38:29.070" LastActivityDate="2014-12-17T19:38:29.070" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5495" PostTypeId="1" AcceptedAnswerId="5511" CreationDate="2014-12-17T20:43:00.050" Score="6" ViewCount="2593" Body="&lt;p&gt;Specifically, I'm interested in the width of characters in the default font assuming that the default font is mono-spaced.  From reading the documentation, I got the impression that this should give me the correct value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(aref (font-info (face-font 'default)) 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, these values are consistently too big.  For example, my current default font is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-unknown-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the code above gives me 13.  However, when I make a screenshot and measure the characters their width is only 8 pixels.  &lt;code&gt;frame-char-width&lt;/code&gt;gives me 8 pixels but if I change the default font size (using &lt;code&gt;text-scale-increase&lt;/code&gt;) it continues to say 8, so that isn't useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working with Emacs 25.0.50.2 on Ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2016-01-28T14:50:52.083" Title="How can I determine the width of characters on the screen?" Tags="|faces|fonts|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5497" PostTypeId="2" ParentId="5475" CreationDate="2014-12-17T21:22:02.583" Score="1" Body="&lt;p&gt;It's more efficient to have a directory i.e., ~/.emacs.d/site-lisp or ~/elisp, act as a default directory for your byte-compiled/source files, and have emacs add that directory (and its &lt;strong&gt;sub-directories&lt;/strong&gt;) to its load path as such:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory (expand-file-name &quot;~/.emacs.d/site-lisp/&quot;)))&#xA;  (setq load-path&#xA;        (append&#xA;         (let ((load-path (copy-sequence load-path)))&#xA;           (append &#xA;            (copy-sequence (normal-top-level-add-to-load-path '(&quot;.&quot;)))&#xA;            (normal-top-level-add-subdirs-to-load-path)))&#xA;         load-path)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then adding your theme is as simple as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone https://github.com/don9z/blackboard-theme.git ~/.emacs.d/site-lisp/blackboard-theme&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in your ~/.emacs.d/init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'blackboard-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend using melpa, where applicable, however.&lt;/p&gt;&#xA;" OwnerDisplayName="user3936" LastActivityDate="2014-12-17T21:22:02.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5498" PostTypeId="1" CreationDate="2014-12-17T21:39:39.900" Score="1" ViewCount="772" Body="&lt;p&gt;I'm using both the latest Cygwin and the latest (released) Emacs. I'm trying to remote in from a Linux box to a Windows box running a Cygwin configured sshd.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added this line to the top of my &lt;code&gt;.bashrc&lt;/code&gt; in Cygwin:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PS1='$ ' &amp;amp;&amp;amp; return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing &lt;code&gt;ssh &amp;lt;own ip&amp;gt;&lt;/code&gt; reveals that the prompt is indeed set to a single dollar sign. Unfortunately, TRAMP still hangs on.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Tramp: found remote shell prompt&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I would very much like to get this working. I don't really &lt;em&gt;know&lt;/em&gt; what information is needed to fix this, but the machine is available and I'll do whatever anyone asks me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Here are the last few lines from the TRAMP debug buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;00:20:46.867625 tramp-process-one-action (5) # Looking for regexp &quot;\(^.*\(\(?:adgangskode\|contrase\(?:\(?:ny\|ñ\)a\)\|geslo\|h\(?:\(?:asł\|esl\)o\)\|iphasiwedi\|jelszó\|l\(?:ozinka\|ösenord\)\|m\(?:ot de passe\|ật khẩu\)\|pa\(?:rola\|s\(?:ahitza\|s\(?: phrase\|ord\|phrase\|wor[dt]\)\|vorto\)\)\|s\(?:alasana\|enha\|laptažodis\)\|wachtwoord\|лозинка\|пароль\|ססמה\|كلمة السر\|गुप्तशब्द\|शब्दकूट\|গুপ্তশব্দ\|পাসওয়ার্ড\|ਪਾਸਵਰਡ\|પાસવર્ડ\|ପ୍ରବେଶ ସଙ୍କେତ\|கடவுச்சொல்\|సంకేతపదము\|ಗುಪ್ತಪದ\|അടയാളവാക്ക്\|රහස්පදය\|ពាក្យសម្ងាត់\|パスワード\|密[码碼]\|암호\)\).*:? *\)\'&quot; from remote shell&#xA;00:20:46.867729 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.867806 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.867940 tramp-process-one-action (5) # Looking for regexp &quot;\(^.*\(Connection \(?:\(?:clo\|refu\)sed\)\|Host key verification failed\.\|Login \(?:[Ii]ncorrect\)\|N\(?:ame or service not known\|o supported authentication methods left to try!\)\|Permission denied\|\(?:Sorry, try again\|Timeout, server not responding\)\.\).*\|^.*\(Received signal [0-9]+\).*\)\'&quot; from remote shell&#xA;00:20:46.868026 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.868102 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.868206 tramp-process-one-action (5) # Looking for regexp &quot;\(^[^#$%&amp;gt;&#xA;]*[#$%&amp;gt;] *\)\'&quot; from remote shell&#xA;00:20:46.868287 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.868360 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.868450 tramp-process-one-action (5) # Call `tramp-action-succeed'&#xA;00:20:46.868577 tramp-get-connection-property (7) # process-buffer nil&#xA;00:20:46.868671 tramp-process-actions (6) # &#xA;root@192.168.0.132's password: &#xA;Last login: Wed Dec 17 16:20:31 2014 from hexagon&#xA;$ &#xA;00:20:46.868759 tramp-get-connection-property (7) # process-buffer nil&#xA;00:20:46.869100 tramp-process-actions (3) # Waiting for prompts from remote shell...done&#xA;00:20:46.869438 tramp-maybe-open-connection (3) # Found remote shell prompt on `192.168.0.132'&#xA;00:20:46.869610 tramp-get-connection-property (7) # remote-shell nil&#xA;00:20:46.869742 tramp-open-shell (5) # Opening remote shell `/bin/sh'...&#xA;00:20:46.869956 tramp-get-connection-property (7) # process-name nil&#xA;00:20:46.870141 tramp-get-connection-property (7) # remote-echo nil&#xA;00:20:46.870232 tramp-send-command (6) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;00:20:46.870324 tramp-get-connection-property (7) # process-name nil&#xA;00:20:46.870429 tramp-get-connection-property (7) # chunksize nil&#xA;00:20:46.870531 tramp-set-connection-property (7) # last-cmd-time (21650 7646 870498 395000)&#xA;00:20:46.870630 tramp-send-string (10) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;00:20:46.870719 tramp-get-connection-property (7) # process-buffer nil&#xA;00:20:46.870906 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.870989 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:46.871076 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:47.871626 tramp-accept-process-output (10) # &#xA;00:20:47.871832 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:47.871994 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:47.872251 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:48.873309 tramp-accept-process-output (10) # &#xA;00:20:48.873736 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:48.874024 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:48.874308 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:49.876580 tramp-accept-process-output (10) # &#xA;00:20:49.877040 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:49.877350 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:49.877639 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:50.878858 tramp-accept-process-output (10) # &#xA;00:20:50.880145 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:50.880448 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:50.880786 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:51.881874 tramp-accept-process-output (10) # &#xA;00:20:51.883160 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:51.883507 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:51.883858 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:52.885235 tramp-accept-process-output (10) # &#xA;00:20:52.885571 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:52.886065 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:52.886413 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:53.887413 tramp-accept-process-output (10) # &#xA;00:20:53.887854 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:53.888154 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:53.888438 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:54.890273 tramp-accept-process-output (10) # &#xA;00:20:54.890382 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:54.890455 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:54.890525 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:55.891045 tramp-accept-process-output (10) # &#xA;00:20:55.891197 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:55.891312 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:55.891428 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:56.893634 tramp-accept-process-output (10) # &#xA;00:20:56.894073 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:56.894368 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:56.894654 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:57.896874 tramp-accept-process-output (10) # &#xA;00:20:57.897336 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:57.897650 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:57.897707 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:58.898896 tramp-accept-process-output (10) # &#xA;00:20:58.899075 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:58.899160 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:58.899241 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:20:59.899977 tramp-accept-process-output (10) # &#xA;00:20:59.900087 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:59.900167 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:20:59.900242 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:00.901654 tramp-accept-process-output (10) # &#xA;00:21:00.914983 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:00.915349 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:00.915642 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:01.918396 tramp-accept-process-output (10) # &#xA;00:21:01.918738 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:01.919128 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:01.919459 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:02.922186 tramp-accept-process-output (10) # &#xA;00:21:02.922917 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:02.923275 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:02.923577 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:03.925233 tramp-accept-process-output (10) # &#xA;00:21:03.925568 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:03.926084 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:03.926437 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:04.932720 tramp-accept-process-output (10) # &#xA;00:21:04.933105 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:04.933397 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:04.933749 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:05.934743 tramp-accept-process-output (10) # &#xA;00:21:05.935194 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:05.935509 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:05.935848 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:06.937524 tramp-accept-process-output (10) # &#xA;00:21:06.937963 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:06.938262 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:06.938546 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:07.943139 tramp-accept-process-output (10) # &#xA;00:21:07.943530 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:07.943793 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:07.944043 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:08.944492 tramp-accept-process-output (10) # &#xA;00:21:08.944615 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:08.944697 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:08.944777 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:09.946517 tramp-accept-process-output (10) # &#xA;00:21:09.947009 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:09.947325 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:09.947617 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:10.948612 tramp-accept-process-output (10) # &#xA;00:21:10.948899 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:10.949396 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:10.949712 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:12.064294 tramp-accept-process-output (10) # &#xA;00:21:12.064438 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:12.064543 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:12.064642 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:13.065006 tramp-accept-process-output (10) # &#xA;00:21:13.065150 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:13.065257 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:13.065358 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:14.066901 tramp-accept-process-output (10) # &#xA;00:21:14.067126 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:14.067359 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:14.067523 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:15.068126 tramp-accept-process-output (10) # &#xA;00:21:15.068312 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:15.068465 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:15.068654 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:16.070011 tramp-accept-process-output (10) # &#xA;00:21:16.070121 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:16.070198 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:16.070273 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:17.072215 tramp-accept-process-output (10) # &#xA;00:21:17.072229 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:17.072461 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:17.072629 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:18.075270 tramp-accept-process-output (10) # &#xA;00:21:18.075411 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:18.075514 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:18.075625 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:19.078041 tramp-accept-process-output (10) # &#xA;00:21:19.078186 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:19.078293 tramp-get-connection-property (7) # check-remote-echo nil&#xA;00:21:19.078395 tramp-accept-process-output (10) # *tramp/ssh root@192.168.0.132* run&#xA;00:21:19.388384 tramp-open-shell (5) # Opening remote shell `/bin/sh'...failed&#xA;00:21:19.389169 tramp-maybe-open-connection (3) # Opening connection for root@192.168.0.132 using ssh...failed&#xA;00:21:19.389481 tramp-get-file-property (8) #  file-truename nil&#xA;00:21:19.389695 tramp-flush-directory-property (8) # &#xA;00:21:19.389949 tramp-get-connection-property (7) # process-name nil&#xA;00:21:19.390179 tramp-get-connection-property (7) # process-name nil&#xA;00:21:19.390617 tramp-get-connection-property (7) # vector [ssh root 192.168.0.132 ~ nil]&#xA;00:21:19.390846 tramp-process-sentinel (5) # Sentinel called: `#&amp;lt;process *tramp/ssh root@192.168.0.132*&amp;gt;' `killed&#xA;'&#xA;00:21:19.391118 tramp-flush-connection-property (7) # *tramp/ssh root@192.168.0.132* (vector temp-file last-cmd-time)&#xA;00:21:19.391364 tramp-get-file-property (8) #  file-truename nil&#xA;00:21:19.391723 tramp-flush-directory-property (8) # &#xA;00:21:19.513996 tramp-get-connection-property (7) # process-name nil&#xA;00:21:19.514284 tramp-flush-connection-property (7) # [ssh root 192.168.0.132 nil nil] (first-password-request)&#xA;00:21:19.514578 tramp-get-connection-property (7) # process-buffer nil&#xA;00:21:19.514815 tramp-get-file-property (8) # / file-truename nil&#xA;00:21:19.514933 tramp-flush-file-property (8) # /&#xA;00:21:19.515035 tramp-file-name-handler (1) # Interrupt received in operation (expand-file-name /ssh:root@192.168.0.132:~ nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &quot;interrupt&quot; is me pressing &lt;code&gt;C-g&lt;/code&gt; after a long time waiting.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2014-12-21T02:22:56.977" LastActivityDate="2014-12-21T02:22:56.977" Title="Get TRAMP working with cygwin sshd" Tags="|tramp|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5499" PostTypeId="2" ParentId="5495" CreationDate="2014-12-17T22:22:11.033" Score="8" Body="&lt;p&gt;The second element of the font-info is the font's pixelsize, which is (roughly speaking) its height.  Getting the width of any particular glyph in the font is a little more work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(aref (aref (font-get-glyphs (font-at (point)) 65 66) 0) 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-12-17T22:22:11.033" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5500" PostTypeId="2" ParentId="5498" CreationDate="2014-12-17T22:34:58.100" Score="2" Body="&lt;p&gt;The usual recipe is to apply &lt;code&gt;(setq tramp-verbose 10)&lt;/code&gt; and to rerun the test. There will be a (longish) Tramp debug buffer, which shall tell what's up.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2014-12-17T22:34:58.100" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5501" PostTypeId="1" CreationDate="2014-12-17T22:41:06.000" Score="2" ViewCount="1085" Body="&lt;p&gt;I'm using solarized theme in emacs-24.3. While I'm quite happy with it generally, the IPython shell is blindingly ugly. It is quite clear that the font colors within it are not using solarized values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ExdsD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to fix that?&lt;/p&gt;&#xA;" OwnerUserId="3895" LastActivityDate="2014-12-18T05:05:41.277" Title="IPython shell theme" Tags="|shell|themes|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5502" PostTypeId="2" ParentId="233" CreationDate="2014-12-17T23:35:13.650" Score="17" Body="&lt;p&gt;FWIW - I had this issue with the signature org-20140407.tar.sig.  Like Sigma's &lt;strong&gt;package-check-signature&lt;/strong&gt; is/was &lt;strong&gt;allow-unsigned&lt;/strong&gt;.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I changed the &lt;strong&gt;package-check-signature&lt;/strong&gt; value to &lt;strong&gt;nil&lt;/strong&gt; and the problem was resolved.&lt;/p&gt;&#xA;" OwnerUserId="3937" LastActivityDate="2014-12-17T23:35:13.650" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5503" PostTypeId="1" AcceptedAnswerId="5509" CreationDate="2014-12-18T00:51:23.503" Score="1" ViewCount="278" Body="&lt;p&gt;I have a dozen org-mode links in the standard format.  How can I sort these by the descriptive text?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[alink1][Baz]]&#xA;&#xA;[[alink2][Foo]]&#xA;&#xA;[[alink3][Bar]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These are displayed like this in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Baz&#xA;&#xA;Foo&#xA;&#xA;Bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[alink3][Bar]]&#xA;&#xA;[[alink1][Baz]]&#xA;&#xA;[[alink2][Foo]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will be show as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bar&#xA;&#xA;Baz&#xA;&#xA;Foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[Update]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this: (setq org-descriptive-links t) then try M-x org-sort-list, I get error message: 'Wrong type argument: number-or-marker-p, nil'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/U8O8S.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2014-12-22T04:49:54.647" LastActivityDate="2014-12-22T04:49:54.647" Title="Sort org-mode links by descriptive text?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5504" PostTypeId="1" AcceptedAnswerId="5506" CreationDate="2014-12-18T01:38:35.277" Score="15" ViewCount="3759" Body="&lt;p&gt;&lt;a href=&quot;https://mosh.mit.edu/&quot;&gt;Mosh&lt;/a&gt; is an alternative to ssh that is generally more resilient. In particular, it can deal with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Extreme packet loss&lt;/li&gt;&#xA;&lt;li&gt;Changing client IPs&lt;/li&gt;&#xA;&lt;li&gt;Temporary connection loss&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are few downsides to using it, other than a lack of X11 forwarding, which TRAMP does not use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be great if we could get emacs to work with it, as it could potentially make TRAMP much more stable in unstable environments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://lists.gnu.org/archive/html/tramp-devel/2012-04/msg00011.html&quot;&gt;Some work has already been done&lt;/a&gt; to work towards this, but nothing has worked yet. &lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2014-12-18T05:57:56.100" LastActivityDate="2014-12-18T09:14:03.213" Title="TRAMP over mosh" Tags="|tramp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5506" PostTypeId="2" ParentId="5504" CreationDate="2014-12-18T02:22:42.437" Score="13" Body="&lt;p&gt;This cannot be done without some changes to mosh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike ssh, mosh doesn't transmit every character that is sent by the application — it will happily skip sending data that has already scrolled off-screen, and will omit data that has been overwritten by later screen updates over high-RTT links.  Therefore, it cannot be easily used for automation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been some talk on the mosh mailing list about adding a reliable command channel to the mosh protocol, but I'm not sure if anything has come out of it.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-12-18T02:22:42.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5507" PostTypeId="1" CreationDate="2014-12-18T02:30:53.287" Score="18" ViewCount="2524" Body="&lt;p&gt;Following an attempted git merge on the commandline, my file now has standard conflict markers in it which emacs has helpfully reloaded (reverted?) in the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I start some kind of merging mode to resolve the conflict? Can I get seperate buffers showing left/right/merged versions of the file like when I ediff-files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(emacs-prelude v24.4 on a Mac)&lt;/p&gt;&#xA;" OwnerUserId="3939" LastActivityDate="2021-06-30T15:28:51.703" Title="How to start ediff-ing a file that has git conflict markers in it?" Tags="|git|ediff|prelude|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5508" PostTypeId="1" AcceptedAnswerId="5523" CreationDate="2014-12-18T02:40:22.557" Score="9" ViewCount="277" Body="&lt;p&gt;In a language (julia) that has blocks defined by keywords such as &lt;code&gt;for..end&lt;/code&gt;, &lt;code&gt;begin..end&lt;/code&gt;, as well as parentheses, what is a good way to skip over such a block? Also, &lt;code&gt;end&lt;/code&gt; is not only a block keyword, but also a valid identifier used in other places.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way is to look for block-starting/closing regex, and to skip over all strings, comments, and &lt;code&gt;end&lt;/code&gt;s, etc., but this is somewhat inefficient, and a little ugly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make emacs's own syntax parsing recognize such block keywords, so that &lt;code&gt;forward/backward-sexp&lt;/code&gt; would automatically work, and so that one could quickly tell the beginning of the current block from the output of, e.g., &lt;code&gt;syntax-ppss&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Note: I don't mind parsing the file myself, but in that case I would still like to know how my parser should be plugged into the rest of emacs.]&lt;/p&gt;&#xA;" OwnerUserId="875" LastEditorUserId="875" LastEditDate="2014-12-18T06:57:33.477" LastActivityDate="2014-12-18T10:30:22.333" Title="Make forward-sexp recognize blocks defined by keywords, not just parentheses" Tags="|syntax|parsing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5509" PostTypeId="2" ParentId="5503" CreationDate="2014-12-18T03:08:31.087" Score="2" Body="&lt;p&gt;The easiest way I can think of is to store your links in an Org list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [[alink1][Baz]]&#xA;- [[alink2][Foo]]&#xA;- [[alink3][Bar]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and use &lt;code&gt;M-x&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/worg/doc.html#org-sort-list&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-sort-list&lt;/code&gt;&lt;/a&gt; with the point somewhere in this list. As far as I can tell this works if &lt;a href=&quot;http://orgmode.org/worg/doc.html#org-descriptive-links&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-descriptive-links&lt;/code&gt;&lt;/a&gt; is set to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As pointed out by @Ehvince, one can also use &lt;code&gt;org-sort-list&lt;/code&gt; with a&#xA;custom &lt;code&gt;GETKEY-FUNC&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-get-link-text ()&#xA;  &quot;Get the description of the first link on the current line.&quot;&#xA;  (save-excursion&#xA;    (if (re-search-forward org-bracket-link-analytic-regexp&#xA;                           (line-end-position) t)&#xA;        (match-string 5)&#xA;      (buffer-substring (point) (line-end-position)))))&#xA;&#xA;(defun my-sort-list-of-links (with-case)&#xA;  (interactive &quot;P&quot;)&#xA;  (org-sort-list with-case ?f #'my-get-link-text #'string&amp;lt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have some code for sorting links in a region (one per line) that does not use any Org functions (just &lt;code&gt;org-bracket-link-analytic-regexp&lt;/code&gt;), but I don't think that's useful (given these two solutions).&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-18T16:10:26.217" LastActivityDate="2014-12-18T16:10:26.217" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5510" PostTypeId="2" ParentId="5507" CreationDate="2014-12-18T03:12:21.633" Score="11" Body="&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;vc-resolve-conflicts&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bind it to &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-12-18T03:12:21.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5511" PostTypeId="2" ParentId="5495" CreationDate="2014-12-18T03:40:19.290" Score="7" Body="&lt;p&gt;Here is the complete solution for my original problem.  Thanks to @jch and @Malabarba for contributing the crucial pieces.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun default-font-width () &#xA;  &quot;Return the width in pixels of a character in the current&#xA;window's default font.  More precisely, this returns the&#xA;width of the letter ‘m’.  If the font is mono-spaced, this&#xA;will also be the width of all other printable characters.&quot;&#xA;  (let ((window (selected-window))&#xA;        (remapping face-remapping-alist))&#xA;    (with-temp-buffer&#xA;      (make-local-variable 'face-remapping-alist)&#xA;      (setq face-remapping-alist remapping)&#xA;      (set-window-buffer window (current-buffer))&#xA;      (insert &quot;m&quot;)&#xA;      (aref (aref (font-get-glyphs (font-at 1) 1 2) 0) 4))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Update: This discussion led to the addition of three new functions in Emacs 25: &lt;code&gt;default-font-width&lt;/code&gt;, &lt;code&gt;window-font-width&lt;/code&gt;, and &lt;code&gt;window-font-height&lt;/code&gt; (&lt;code&gt;default-font-height&lt;/code&gt; was already part of emacs). &lt;code&gt;window-font-width&lt;/code&gt; and &lt;code&gt;window-font-height&lt;/code&gt; can be used to calculate the width and height or arbitrary faces.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="-1" LastEditDate="2016-01-28T14:50:52.083" LastActivityDate="2016-01-28T14:50:52.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5512" PostTypeId="1" AcceptedAnswerId="5536" CreationDate="2014-12-18T04:09:07.417" Score="4" ViewCount="998" Body="&lt;p&gt;I have a yasnippet that is conflicting with &lt;code&gt;multiple-cursors&lt;/code&gt; because it is not exiting immediately.  When &lt;code&gt;multiple-cursors&lt;/code&gt; is not active, I would like the snippet to pause and permit me to enter the data.  Can I have an example, please, of a yasnippet that uses some &lt;code&gt;elisp&lt;/code&gt; conditions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if mc-mode&#xA;  \hspace*{$0}&#xA;  \hspace*{$1})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-12-18T04:14:36.217" LastActivityDate="2022-05-31T13:27:29.980" Title="Creating a custom Yasnippet with conditions" Tags="|yasnippet|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5513" PostTypeId="2" ParentId="5512" CreationDate="2014-12-18T04:44:08.370" Score="4" Body="&lt;p&gt;You can use the &lt;a href=&quot;https://joaotavora.github.io/yasnippet/snippet-development.html#org185b594&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;#condition&lt;/code&gt; directive&lt;/a&gt; to provide an &lt;code&gt;elisp&lt;/code&gt; predicate. The snippet will only be expanded when the condition code you provide evaluates to non-nil. So, you could simply add this to your snippet:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# condition: (mc-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="25937" LastEditDate="2022-05-31T13:27:29.980" LastActivityDate="2022-05-31T13:27:29.980" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="5514" PostTypeId="2" ParentId="5507" CreationDate="2014-12-18T05:01:58.067" Score="17" Body="&lt;p&gt;If you use &lt;a href=&quot;https://github.com/magit/magit&quot;&gt;magit&lt;/a&gt;, you can press &lt;kbd&gt;e&lt;/kbd&gt; at the unmerged file in magit status buffer (started by pressing &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;magit-status&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;) to start ediff session for resolving the conflicts&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-18T05:01:58.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5515" PostTypeId="2" ParentId="5501" CreationDate="2014-12-18T05:05:41.277" Score="1" Body="&lt;p&gt;You'll probably do the greatest good for the greatest number if you open an issue on the &lt;a href=&quot;https://github.com/bbatsov/solarized-emacs/issues&quot; rel=&quot;nofollow&quot;&gt;github page&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime, Bozhidar's set up the code to enable customizing your own &quot;child theme&quot; of solarized.  And if you find a customization that works well, you'll do even more good for the community when you update your issue with a pull request!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to assume you have &lt;code&gt;ansi-color-process-output&lt;/code&gt; in your &lt;code&gt;comint-output-filter-functions&lt;/code&gt; and that &lt;code&gt;ansi-color-for-comint-mode&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;, because that's the default setting that ships with Emacs.  If you have a different setup, let me know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The colors you're seeing are coming from IPython's interaction with the terminal.  Emacs is scooping up control sequences and turning them into color overlays.  To change how Emacs turns control sequences into colors, you want to customize the variable &lt;code&gt;ansi-color-names-vector&lt;/code&gt;.  Note that this change will affect everything based on &lt;code&gt;comint-mode&lt;/code&gt;, not just &lt;code&gt;python-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because I don't use solarized, I would customize that variable the naive way with something like the following in my init file (Emacs 24.3 syntax):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Change the color names to suit your taste.  Hex color codes are allowed.&#xA;; Check the theme definition file for ideas.&#xA;(eval-after-load &quot;solarized-dark-theme&quot;&#xA;  '(custom-theme-set-variables&#xA;    'solarized-dark&#xA;    '(ansi-color-names-vector [&quot;black&quot; &quot;red3&quot; &quot;green3&quot; &quot;yellow3&quot; &#xA;                               &quot;blue2&quot; &quot;magenta3&quot; &quot;cyan3&quot; &quot;gray90&quot;])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, because Bozhidar is awesome, it looks like you can customize a &quot;child theme&quot; with something like the following in your init file, then use &lt;code&gt;my-solarized-dark&lt;/code&gt; as your custom theme.  (Note - completely untested code.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(deftheme my-solarized-dark &quot;Like stock solarized-dark, but with a different ANSI color vector.&quot;)&#xA;(create-solarized-theme 'dark 'my-solarized-dark &#xA;                        (lambda ()&#xA;                          '(ansi-color-names-vectors [...])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-12-18T05:05:41.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5516" PostTypeId="1" CreationDate="2014-12-18T06:06:03.887" Score="4" ViewCount="80" Body="&lt;p&gt;I want to make a follow mode where placing the cursor within certain parts of the buffer will cause some action to happen in another window.  For example, using &lt;code&gt;helm-follow-mode&lt;/code&gt; with &lt;code&gt;helm-occur&lt;/code&gt; will cause another window to jump to the context of the selected line.  I want to do something similar, except that I want to use another window to jump to a point in some buffer(s) based on the current paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give a more concrete example, I have a read-only buffer &quot;A&quot; which has three paragraphs, A1, A2, and A3.  And another buffer &quot;B&quot; which has many lines of text.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  +---------------------------+------------------------+&#xA;  |                           |                        |&#xA;  |         BUFFER A          |       BUFFER B         |&#xA;  |                           |                        |&#xA;  |   Paragraph A1            |  Line B1               |&#xA;  |                           |  Line B2               |&#xA;  |   Paragraph A2            |  Line B3               |&#xA;  |                           |  Line B4               |&#xA;  |   Paragraph A3            |  Line B5               |&#xA;  |                           |  Line B6               |&#xA;  |                           |  Line B7               |&#xA;  |                           |  Line B8               |&#xA;  |                           |  Line B9               |&#xA;  |                           |                        |&#xA;  +---------------------------+------------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When my cursor moves from paragraph A1 into paragraph A2, buffer B should jump to some pre-determined position, for example line B8.  This should happen without buffer A losing focus.  Later, when my cursor moves out of paragraph A2 and into paragraph A3, buffer B will again jump to another pre-determined line, say B2.  Now if I move the cursor back into paragraph A2, then buffer B will again jump to line B8, as before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to execute a &quot;follow&quot; action based on the cursor entering a paragraph?  Can I do this with text properties?  I want to maintain the ability to navigate buffer A just like any other read-only buffer (i.e. I want to select text and copy a region, perform an isearch within the buffer, etc.)&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2014-12-18T06:06:03.887" Title="Custom follow mode" Tags="|text-properties|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5517" PostTypeId="2" ParentId="2883" CreationDate="2014-12-18T06:25:45.790" Score="1" Body="&lt;p&gt;Try customizing the variable &lt;code&gt;comint-prompt-read-only&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will affect &lt;code&gt;shell-mode&lt;/code&gt; and others derived from &lt;code&gt;comint-mode&lt;/code&gt;, but not &lt;code&gt;term-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2014-12-18T06:25:45.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5518" PostTypeId="1" CreationDate="2014-12-18T06:41:27.893" Score="6" ViewCount="329" Body="&lt;p&gt;Is it possible to customize follow mode to open the next PDF page in another buffer? Currently &lt;code&gt;follow-mode&lt;/code&gt; has no effect on PDF files.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-04-07T02:33:50.727" Title="Enable follow-mode for PDF in doc-view/pdf-view-mode" Tags="|docview|follow-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5519" PostTypeId="1" AcceptedAnswerId="5525" CreationDate="2014-12-18T07:29:24.503" Score="4" ViewCount="1077" Body="&lt;p&gt;&lt;code&gt;C-x RET \&lt;/code&gt; or &lt;code&gt;M-x set-input-method&lt;/code&gt; to select the text input method; e.g. I use &lt;code&gt;greek&lt;/code&gt; and &lt;code&gt;hebrew&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must say &lt;code&gt;C-\&lt;/code&gt; is genius, because it brings you back to the default input which you use the most.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want Emacs to automatically detect the entered text method and accordingly change the default font (&lt;code&gt;font0&lt;/code&gt; for English) as I enter the text input method to either &lt;code&gt;font1&lt;/code&gt; in case of Greek or &lt;code&gt;font2&lt;/code&gt; in case of Hebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to achieve this in Emacs 24.3.1 by Elisp in .emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;br&gt;&#xA;Platform: Windows 7-32bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my trial:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun font-for-input ()&#xA;  (cond ((equal current-input-method nil)&#xA;         (face-remap-add-relative 'default :family &quot;Consolas&quot; :height 110))&#xA;        ((string-equal current-input-method &quot;greek&quot;)&#xA;         (face-remap-add-relative 'default :family &quot;Romans&quot; :height 120))&#xA;        ((string-equal current-input-method &quot;hebrew&quot;)&#xA;         (face-remap-add-relative 'default :family &quot;DejaVu Sans&quot; :height 120))&#xA;        )&#xA;  )&#xA;(font-for-input)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So there are three states:&lt;br&gt;&#xA;nil: Consolas 11 or by hitting &lt;code&gt;C-\&lt;/code&gt; to deactivate &lt;code&gt;set-input-method&lt;/code&gt; and return to default (English in my case)&lt;br&gt;&#xA;Greek: change to Romans 12&lt;br&gt;&#xA;Hebrew: change to DejaVu Sans 12  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interesting, this is my &lt;em&gt;first&lt;/em&gt; code in Elisp! it works but clumsy. I want Emacs to automagically change these fonts as it detects the &lt;code&gt;current-input-method&lt;/code&gt; if any? Any suggestions to improve the code (more consice) are appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;Ok, I admit this seems totally silly and impractical. I think what I need actually is 3 key bindings -- one for each language or input method (English, Greek, and Hebrew). Hitting either one should set-input-method to that language and change font accordingly and hook that to whatever buffer in current use -- be it text, org mode or TeX, etc. Any help?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="105" LastEditDate="2017-07-20T21:57:24.610" LastActivityDate="2017-07-20T21:57:24.610" Title="How to assign a certain font for each input method/language in Emacs 24?" Tags="|fonts|input-method|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5520" PostTypeId="2" ParentId="5508" CreationDate="2014-12-18T07:39:22.850" Score="2" Body="&lt;p&gt;I made a &lt;a href=&quot;https://launchpad.net/s-x-emacs-werkstatt/+download&quot; rel=&quot;nofollow&quot;&gt;library&lt;/a&gt; for this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once defined, a bunch of commands are available, moving forward, backward, copy etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Defining --in pseudo-code--:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'MY-FORM 'beginning-op-at&#xA;           (lambda () MY-FORWARD-MOVE-CODE))&#xA;&#xA;(put 'MY-FORM 'end-op-at&#xA;     (lambda () MY-BACKWARD-MOVE-CODE))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When done, it's should be available, i.e. copied and returned like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun MY-FORM-atpt (&amp;amp;optional arg)&#xA;  &quot; &quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (ar-th 'MY-FORM arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="184" LastEditDate="2014-12-18T10:30:22.333" LastActivityDate="2014-12-18T10:30:22.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5521" PostTypeId="2" ParentId="5504" CreationDate="2014-12-18T09:14:03.213" Score="8" Body="&lt;p&gt;I've asked on the mosh ML list for support, see &lt;a href=&quot;http://thread.gmane.org/gmane.network.mosh.devel/112&quot; rel=&quot;noreferrer&quot;&gt;http://thread.gmane.org/gmane.network.mosh.devel/112&lt;/a&gt;. The answer was &quot;this is not going to&#xA;happen any time soon&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2014-12-18T09:14:03.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5522" PostTypeId="1" AcceptedAnswerId="5541" CreationDate="2014-12-18T09:26:02.513" Score="6" ViewCount="1700" Body="&lt;p&gt;Post title: &lt;strong&gt;Unwanted escape sequences in shell mode &lt;s&gt;that are NOT due to colorizing-attempts &lt;/s&gt;&lt;/strong&gt; &#xA;(see update below)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what can cause (unwanted) escape sequences to continue showing up in the Emacs &lt;code&gt;shell&lt;/code&gt; prompt (i.e., &lt;code&gt;M-x shell&lt;/code&gt;) despite:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) removing all color-related sequences from prompt definitions in the appropriate config files and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ii) including the following in my &lt;code&gt;init.el&lt;/code&gt; file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'ansi-color-for-comint-mode-on &quot;ansi-color&quot; nil t)&#xA;(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, this is what my shell prompt looks like (in Emacs)...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^[[J% &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but this is how  I've defined the prompt in my &lt;code&gt;.zshrc&lt;/code&gt; file (I could be wrong but I suspect the issue is shell agnostic, i.e., I don't think it's specific to &lt;code&gt;zsh&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PROMPT='%% '&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similarly, this is what my GHCi interpreter prompt (i.e., Haskell REPL) looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^[[?1h^[=λ: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...when this is the definition I've included in the &lt;code&gt;ghci.conf&lt;/code&gt; file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:set prompt &quot;λ: &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running Emacs 24.4 on Lubuntu 14.04 with zsh as default shell.  (All zsh features are working correctly in Emacs; this seems like a cosmetic issue.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE: Solved&lt;/strong&gt; &lt;br&gt;&#xA;Shoddy attention to detail on my part; the following line in my &lt;code&gt;.zshrc&lt;/code&gt; profile was responsible:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export TERM=xterm-256color&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2084" LastEditorUserId="2084" LastEditDate="2014-12-18T17:59:12.807" LastActivityDate="2014-12-18T18:07:16.427" Title="Unwanted escape sequences in shell mode" Tags="|shell|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5523" PostTypeId="2" ParentId="5508" CreationDate="2014-12-18T09:44:17.867" Score="8" Body="&lt;p&gt;You can have a look at the built-in library &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE.html&quot;&gt;SMIE&lt;/a&gt; (stands for Simple-Minded Indentation Engine). Despite the name, indentation is only one of the features it provides. This is the method used by many modes (including &lt;code&gt;ruby-mode&lt;/code&gt;, mentioned in a comment), to provide sexp movement and indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deploying SMIE for a language is roughly a two-steps job:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;define the grammar for your language, together with a lexer identifying tokens;&lt;/li&gt;&#xA;&lt;li&gt;define indentation rules.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For your purpose, only the first step will be needed!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, the parser defined this way plugs nicely into emacs. For example, &lt;code&gt;show-parens&lt;/code&gt; will highlight paren-like expressions defined in the SMIE grammar (at least in recent enough versions of emacs). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you will still not be able to use &lt;code&gt;syntax-ppss&lt;/code&gt; to get information about the enclosing environment, because it will only give you the result of the syntax-table parser. But sexp movement functions (for example &lt;code&gt;up-list&lt;/code&gt; followed by &lt;code&gt;backward-sexp&lt;/code&gt;) can be a replacement.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2014-12-18T09:59:45.680" LastActivityDate="2014-12-18T09:59:45.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5524" PostTypeId="1" AcceptedAnswerId="7164" CreationDate="2014-12-18T11:04:40.503" Score="2" ViewCount="4605" Body="&lt;p&gt;I use the default style linux (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Custom-C-Indent.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;snippet from here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; set indentation style linux for c++&#xA;(setq c-default-style &quot;linux&quot;&#xA;          c-basic-offset 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I can't get it to work with the style setting which sets zero indent for namespaces (&lt;a href=&quot;https://stackoverflow.com/questions/2619853/emacs-override-indentation&quot;&gt;from this question&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst my-cc-style&#xA;  '(&quot;cc-mode&quot;&#xA;    (c-offsets-alist . ((innamespace . [0])))))&#xA;&#xA;(c-add-style &quot;my-cc-mode&quot; my-cc-style)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once I choose my-cc-style with &lt;code&gt;C-c . RET my-cc-mode RET&lt;/code&gt;, I get the strange brace indent back which the first setting removes, i.e. like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;virtual string_type do_falsename() const&#xA;    {&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to keep everything from the default style, and change only the namespace indentation? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: there are a multiple possible solutions to be found here: &lt;a href=&quot;https://stackoverflow.com/questions/2619853/emacs-override-indentation/22711444#22711444&quot;&gt;https://stackoverflow.com/questions/2619853/emacs-override-indentation/22711444#22711444&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-08T15:58:22.117" Title="Customizing a default indentation style for C++" Tags="|indentation|c++|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5525" PostTypeId="2" ParentId="5519" CreationDate="2014-12-18T11:28:39.080" Score="1" Body="&lt;p&gt;Well I came up with this solution but I look forward to getting more suggestions for improvement.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code to be in &lt;code&gt;.emacs&lt;/code&gt;:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun default-input-font () &#xA;&#xA;  &quot;changes the set-input-method to nil and selects a default font &#xA;bound to C-c f&quot;&#xA;  (interactive)&#xA;  (set-input-method nil)&#xA;  (face-remap-add-relative 'default :family &quot;Consolas&quot; :height 110)&#xA;  )&#xA;&#xA;(defun greek-input-font ()&#xA;&#xA;  &quot;changes the set-input-method to Greek and selects another font&#xA;bound to C-c g&quot;&#xA;  (interactive)&#xA;  (set-input-method &quot;greek&quot;)&#xA;  (face-remap-add-relative 'default :family &quot;Romans&quot; :height 120)&#xA;  )&#xA;&#xA;(defun hebrew-input-font () &#xA;&#xA;  &quot;changes the set-input-method to Hebrew  and selects another font&#xA;bound to C-c h&quot;&#xA;  (interactive)&#xA;  (set-input-method &quot;hebrew&quot;) ; you can specify like `hebrew-biblical-tiro`&#xA;  (face-remap-add-relative 'default :family &quot;DejaVu Sans&quot; :height 120)&#xA;  )&#xA;&#xA;(global-set-key (kbd &quot;C-c f&quot;) 'default-input-font)&#xA;(global-set-key (kbd &quot;C-c g&quot;) 'greek-input-font)&#xA;(global-set-key (kbd &quot;C-c h&quot;) 'hebrew-input-font)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;These key bindings are only suggestions you can choose whatever you like based on Key-bindings recommendations according to Emacs-manual.  &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now when I write a document having two or more languages I can type with the font I like that best fits that language and visualization of its letters. For Hebrew I use &lt;code&gt;SBL Hebrew&lt;/code&gt; font which is really helpful to show all diacritics nicely. So this will help you as you type in the language of your like without compromising visualization by the default font of the buffer. Be careful to choose explicitly the type of input method if there are more than one! see &lt;code&gt;M-x list-input-methods&lt;/code&gt; to choose one that you need.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Advantage of this approach is that you still can make use of all the key bindings of Emacs as a professional text editor as long as your keyboard is not switched to another language from the language bar, making the choice for this approach more favorable than the one suggested by a &lt;a href=&quot;https://emacs.stackexchange.com/questions/3533/how-to-use-different-fonts-based-on-the-language-of-the-currently-active-keyboar&quot;&gt;question&lt;/a&gt; posted earlier.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am open to any input or suggestions to improve this approach or may be find a better approach.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-18T17:47:36.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5526" PostTypeId="2" ParentId="5498" CreationDate="2014-12-18T12:23:29.620" Score="1" Body="&lt;p&gt;This doesn't exactly answer your question, but have you tried using tramp with the smb method? I have been using this for years to edit files located on a Windows machine from my Emacs session on Linux, and I am very happy with it. The only drawback might be, that you have to define a share to be able to access the files on Windows.&lt;/p&gt;&#xA;" OwnerUserId="2415" LastActivityDate="2014-12-18T12:23:29.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5527" PostTypeId="1" AcceptedAnswerId="5531" CreationDate="2014-12-18T13:09:50.303" Score="16" ViewCount="841" Body="&lt;p&gt;Suppose I have a directory with these files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/foo/bar/baz/.dir-locals.el&#xA;/foo/bar/.dir-locals.el&#xA;/foo/.dir-locals.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I go to create a file in &lt;code&gt;/foo/bar/baz/&lt;/code&gt;, I'd like to daisy chain them together such that &lt;code&gt;/foo/.dir-locals.el&lt;/code&gt; applies first, and then &lt;code&gt;/foo/bar/.dir-locals.el&lt;/code&gt;, and then &lt;code&gt;/foo/bar/baz/.dir-locals.el&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="48" LastEditorUserId="2355" LastEditDate="2014-12-20T20:06:28.590" LastActivityDate="2014-12-20T20:06:28.590" Title="Is there a way to daisy chain .dir-locals.el files?" Tags="|local-variables|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5528" PostTypeId="1" CreationDate="2014-12-18T13:28:46.970" Score="9" ViewCount="956" Body="&lt;p&gt;When I copy non-ascii text from Windows and paste into Emacs, it shows up as an octal sequence. For example, if I paste ä into Emacs it shows up as \344.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could type C-q 344 to get the ä back in Emacs. That's annoying, but it's tolerable if there's only one character. But if there are many characters turned into octal escape sequences, it would be convenient to run some command on a region to convert everything inside. Is there already such a command? If not, how would you write a function to do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[I set my default coding system to utf-8 in my .emacs file, and I use the same .emacs file on Windows and Linux. But the problem only happens when copying from a Windows application into Emacs. Copying from Emacs to another Windows application works fine.]&lt;/p&gt;&#xA;" OwnerUserId="583" LastEditorUserId="25" LastEditDate="2014-12-22T01:02:02.560" LastActivityDate="2014-12-23T12:46:11.683" Title="How to change octal sequences into utf-8 text" Tags="|microsoft-windows|copy-paste|character-encoding|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5529" PostTypeId="1" CreationDate="2014-12-18T16:33:26.443" Score="11" ViewCount="5720" Body="&lt;p&gt;Given the following modeline configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default mode-line-format&#xA;   (list&#xA;    ;; Current buffer name&#xA;    &quot;%b &quot;&#xA;    ;; Major mode&#xA;    &quot;[%m] &quot;&#xA;    ;; Modified status&#xA;    &quot;[%*] &quot;&#xA;    ;; Cursor position&#xA;    &quot;Line: %l/%i Column: %c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like for the last item to appear right-aligned.&lt;/p&gt;&#xA;" OwnerUserId="3945" LastEditorUserId="2418" LastEditDate="2018-11-06T14:42:32.190" LastActivityDate="2021-03-07T02:59:12.780" Title="How to right align some items in the modeline?" Tags="|mode-line|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="5530" PostTypeId="1" AcceptedAnswerId="5542" CreationDate="2014-12-18T16:42:16.667" Score="7" ViewCount="499" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/vermiculus/sx.el&quot;&gt;StackExchange for Emacs&lt;/a&gt; is exactly what it sounds like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After authenticating and loading &lt;code&gt;sx-tab-topvoted emacs&lt;/code&gt;, I see a buffer of question headings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  46   3 Are there any advantages to using ~/.emacs.d/init.el instead of ~/.emacs?&#xA;         30d ago [init-file] &#xA;  37   6 How can I use Emacs to edit questions, answers, and comments here? &#xA;         4d ago [major-mode] [integration] &#xA;  34   4 What are the practical differences between the various Emacs Package Repositories?&#xA;         32d ago [package] [package-repositories]&#xA;  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That one looks interesting. I move point over the second question and press &lt;code&gt;RET&lt;/code&gt; to &lt;code&gt;View question&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I do that, I can see the question header, but not the question body or any of the answers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full contents of buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;How can I use Emacs to edit questions, answers, and comments here?&#xA;Author:   daveloyall&#xA;Asked on: 12:15 - 21 Oct (edited 14d ago by Malabarba)&#xA;Score:    37&#xA;Tags:     [major-mode] [integration]&#xA;________________________________________________________________________________&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this a known issue or do I have a problem with my configuration? What can I do to see the full contents? &lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="2264" LastEditDate="2014-12-18T17:34:01.560" LastActivityDate="2014-12-18T18:33:42.727" Title="Viewing answers in StackExchange for Emacs" Tags="|sx.el|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5531" PostTypeId="2" ParentId="5527" CreationDate="2014-12-18T17:07:24.143" Score="7" Body="&lt;p&gt;Based on the answer &lt;a href=&quot;https://emacs.stackexchange.com/a/4282/2274&quot;&gt;here&lt;/a&gt;, we do this by advising &lt;code&gt;hack-dir-local-variables&lt;/code&gt; to look one directory up and load check if that &lt;code&gt;.dir-locals.el&lt;/code&gt; file is readable.  It will keep going up until it finds a directory with no readable &lt;code&gt;.dir-locals.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on the value of &lt;code&gt;walk-dir-locals-upward&lt;/code&gt; the files can be read from the current directory upward or from the last &lt;code&gt;.dir-locals.el&lt;/code&gt; found downward.  Downward is the default so that subdirectories can clobber the settings of their parents.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar walk-dir-locals-upward nil&#xA;  &quot;If non-nil, evaluate .dir-locals.el files starting in the&#xA;  current directory and going up. Otherwise they will be&#xA;  evaluated from the top down to the current directory.&quot;)&#xA;&#xA;(defadvice hack-dir-local-variables (around walk-dir-locals-file activate)&#xA;  (let* ((dir-locals-list (list dir-locals-file))&#xA;         (walk-dir-locals-file (first dir-locals-list)))&#xA;    (while (file-readable-p (concat &quot;../&quot; walk-dir-locals-file))&#xA;      (progn&#xA;        (setq walk-dir-locals-file (concat &quot;../&quot; walk-dir-locals-file))&#xA;        (add-to-list 'dir-locals-list walk-dir-locals-file&#xA;                     walk-dir-locals-upward)&#xA;        ))&#xA;    (dolist (file dir-locals-list)&#xA;      (let ((dir-locals-file (expand-file-name file)))&#xA;        (message dir-locals-file)&#xA;        ad-do-it&#xA;        )))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2014-12-20T16:16:09.883" LastActivityDate="2014-12-20T16:16:09.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5532" PostTypeId="2" ParentId="5519" CreationDate="2014-12-18T17:08:27.397" Score="3" Body="&lt;p&gt;Another option is to use the hooks namely &lt;code&gt;input-method-activate-hook&lt;/code&gt; and &lt;code&gt;input-method-deactivate-hook&lt;/code&gt; provided by emacs. Since you are new to elisp programming, you will find this &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html&quot; rel=&quot;nofollow&quot;&gt;section&lt;/a&gt; of the emacs manual helpful. Basically hooks are functions that are run when some event occurs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our case &lt;code&gt;input-method-activate-hook&lt;/code&gt; is run when ever you activate a new input method. We use this hook to set font according to the input method being activated (you can read more about the hook by doing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;input-method-activate-hook&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;). You can use the following function to set the font according to you preferences&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-change-font-according-to-input-method ()&#xA;  (face-remap-add-relative 'default&#xA;                           :family (cond ((string= current-input-method &quot;greek&quot;) &quot;Romans&quot;)&#xA;                                         ((string= current-input-method &quot;hebrew&quot;) &quot;DejaVu Sans&quot;)&#xA;                                         (t &quot;Consolas&quot;))&#xA;                           :height 120))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will need to add it to &lt;code&gt;input-method-activate-hook&lt;/code&gt; by adding this to your .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'input-method-activate-hook #'my-change-font-according-to-input-method)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now whenever you change input method to &lt;code&gt;greek&lt;/code&gt; the font will be set to 'Romans', changing input method to &lt;code&gt;hebrew&lt;/code&gt; will change the font to &quot;DejaVu Sans&quot;, font will be set to &quot;Consolas&quot; if the input method is set to anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one problem with this approach though, reverting back to default input method by doing &lt;kbd&gt;C-\&lt;/kbd&gt; (or running the command&lt;code&gt;toggle-input-method&lt;/code&gt;) does not actually activate any new input method as such the hook we added is not called and the font does not get reset to &quot;Consolas&quot;. We can workaround the problem by using &lt;code&gt;input-method-deactivate-hook&lt;/code&gt;. The hook is run every time an input method is deactivated (you can read more about the hook by doing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;input-method-deactivate-hook&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-switch-to-default-font ()&#xA;  (when (and (eq this-command 'toggle-input-method)&#xA;             current-input-method)&#xA;    (face-remap-add-relative 'default&#xA;                             :family &quot;Ubuntu&quot;&#xA;                             :height 120)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the above function we check if the command being run is &lt;code&gt;toggle-input-method&lt;/code&gt; and the current-input-method is non-nil (it will be nil, if default input method is being used), which means the input method is about to be set to nil. If this condition is true we set the font back to &quot;Consolas&quot;. As with previous function you will need to add this function to &lt;code&gt;input-method-deactivate-hook&lt;/code&gt; by adding the following to your .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'input-method-deactivate-hook #'my-switch-to-default-font)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can change your input method as you normally do using &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;kbd&gt;C-\&lt;/kbd&gt; and &lt;kbd&gt;C-\&lt;/kbd&gt; and emacs will automatically set the font for you.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-18T17:08:27.397" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5533" PostTypeId="5" CreationDate="2014-12-18T17:36:15.243" Score="0" Body="&lt;p&gt;&lt;code&gt;sx.el&lt;/code&gt; is a StackExchange client for Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stackapps.com/q/3950&quot;&gt;StackApps Post&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/vermiculus/sx.el&quot; rel=&quot;nofollow&quot;&gt;GitHub&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-18T17:47:43.377" LastActivityDate="2014-12-18T17:47:43.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5534" PostTypeId="4" CreationDate="2014-12-18T17:36:15.243" Score="0" Body="SX is a StackExchange client for Emacs" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-18T17:47:28.673" LastActivityDate="2014-12-18T17:47:28.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5535" PostTypeId="2" ParentId="5444" CreationDate="2014-12-18T17:37:24.193" Score="4" Body="&lt;p&gt;A possible solution is posted on &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1896584&amp;amp;p=11544410#post11544410&quot; rel=&quot;nofollow&quot;&gt;ubuntuforums&lt;/a&gt;. I am posting the answer. The link suggests adding the following to &lt;code&gt;~/.Xdefaults&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs*font: 7x14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and running the command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xrdb -merge ~/.Xdefaults&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-18T17:37:24.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5536" PostTypeId="2" ParentId="5512" CreationDate="2014-12-18T17:42:06.117" Score="4" Body="&lt;p&gt;Yasnippet will accept &lt;code&gt;elisp&lt;/code&gt; (including, but limited to conditions) provided that it is surrounded by &lt;em&gt;backticks&lt;/em&gt;.  In the following example, &lt;code&gt;$0&lt;/code&gt; will cause the snippet to automatically exit when &lt;code&gt;mc-mode&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;; whereas, &lt;code&gt;$1&lt;/code&gt; will cause a pause at that location for user input when &lt;code&gt;mc-mode&lt;/code&gt; is &lt;em&gt;nil&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(if mc-mode&#xA;    &quot;\\\\hspace*{$0}&quot;&#xA;    &quot;\\\\hspace*{$1}&quot;)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-12-18T17:42:06.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5537" PostTypeId="2" ParentId="5527" CreationDate="2014-12-18T17:43:50.857" Score="7" Body="&lt;p&gt;Here's a different way of doing this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define a function that produces the list of all the directories in the&#xA;current directory hierarchy.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun file-name-directory-nesting-helper (name previous-name accumulator)&#xA;  (if (string= name previous-name)&#xA;      accumulator                       ; stop when names stop changing (at the top)&#xA;      (file-name-directory-nesting-helper&#xA;       (directory-file-name (file-name-directory name))&#xA;       name&#xA;       (cons name accumulator))))&#xA;&#xA;(defun file-name-directory-nesting (name)&#xA;  (file-name-directory-nesting-helper (expand-file-name name) &quot;&quot; ()))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An example is in order:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file-name-directory-nesting &quot;/foo/bar/baz/quux/foo.el&quot;)&#xA;;; =&amp;gt; (&quot;/&quot; &quot;/foo&quot; &quot;/foo/bar&quot; &quot;/foo/bar/baz&quot; &quot;/foo/bar/baz/quux&quot; &quot;/foo/bar/baz/quux/foo.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I can add advice to &lt;code&gt;hack-dir-local-variables&lt;/code&gt; to make it&#xA;&quot;pretend&quot; that we're visiting a file at the very top of the tree,&#xA;apply directory-local settings, then step one level down, apply&#xA;settings again, and so on.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hack-dir-local-variables-chained-advice (orig)&#xA;  &quot;Apply dir-local settings from the whole directory hierarchy,&#xA;from the top down.&quot;&#xA;  (let ((original-buffer-file-name (buffer-file-name))&#xA;        (nesting (file-name-directory-nesting (or (buffer-file-name)&#xA;                                                  default-directory))))&#xA;    (unwind-protect&#xA;        (dolist (name nesting)&#xA;          ;; make it look like we're in a directory higher up in the&#xA;          ;; hierarchy; note that the file we're &quot;visiting&quot; does not&#xA;          ;; have to exist&#xA;          (setq buffer-file-name (expand-file-name &quot;ignored&quot; name))&#xA;          (funcall orig))&#xA;      ;; cleanup&#xA;      (setq buffer-file-name original-buffer-file-name))))&#xA;&#xA;(advice-add 'hack-dir-local-variables :around&#xA;            #'hack-dir-local-variables-chained-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-20T20:05:04.997" LastActivityDate="2014-12-20T20:05:04.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5538" PostTypeId="1" AcceptedAnswerId="5543" CreationDate="2014-12-18T17:50:27.013" Score="13" ViewCount="4090" Body="&lt;p&gt;I know that there is a calendar in Emacs and I want to use it. After a lot of Google searches, and also after reading Emacs' manual, I still have no idea how to use it. The only thing I have succeeded is to view a buffer with 3 months. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to do is use it like the Google Calendar so to be able to write entries in the days I want and some notes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen that there are also some other options available like the diary but the only thing I have find for it is a description so I don't actually know what it is! How can someone use Emacs as a Calendar and what are the options to do so (Calendar, Diary etc)?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2014-12-18T20:07:19.077" Title="How to use the calendar" Tags="|calendar|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5539" PostTypeId="2" ParentId="5538" CreationDate="2014-12-18T17:53:51.300" Score="16" Body="&lt;p&gt;You ask a very general question about using this feature and how to find a detailed description of it, what its possibilities are, and how they work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is to &lt;strong&gt;ask Emacs&lt;/strong&gt;. Use &lt;strong&gt;&lt;code&gt;C-h r&lt;/code&gt;&lt;/strong&gt; to consult the Emacs manual. Then use &lt;strong&gt;&lt;code&gt;i calendar RET&lt;/code&gt;&lt;/strong&gt; to go to node &lt;code&gt;Calendar/Diary&lt;/code&gt;, which is a subsection of the manual that has several subsubsections:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Calendar Motion::     Moving through the calendar; selecting a date.&#xA;* Scroll Calendar::     Bringing earlier or later months onto the screen.&#xA;* Counting Days::       How many days are there between two dates?&#xA;* General Calendar::    Exiting or recomputing the calendar.&#xA;* Writing Calendar Files:: Writing calendars to files of various formats.&#xA;* Holidays::            Displaying dates of holidays.&#xA;* Sunrise/Sunset::      Displaying local times of sunrise and sunset.&#xA;* Lunar Phases::        Displaying phases of the moon.&#xA;* Other Calendars::     Converting dates to other calendar systems.&#xA;* Diary::               Displaying events from your diary.&#xA;* Appointments::        Reminders when it's time to do something.&#xA;* Importing Diary::     Converting diary events to/from other formats.&#xA;* Daylight Saving::     How to specify when daylight saving time is active.&#xA;* Time Intervals::      Keeping track of time intervals.&#xA;* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then start reading about whatever you want to know about using the calendary and diary.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-18T17:53:51.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5540" PostTypeId="2" ParentId="5528" CreationDate="2014-12-18T17:57:03.320" Score="2" Body="&lt;p&gt;Once made this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun umlaute ()&#xA;  &quot;Fix wrongly inserted characters, commonly from pasting. &quot;&#xA;  (interactive &quot;*&quot;)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (concat &quot;\\\344\\|&quot;(list 228)) nil 1)&#xA;      (replace-match &quot;ä&quot;))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (concat &quot;\\\304\\|&quot;(list 196)) nil t 1)&#xA;      (replace-match &quot;Ä&quot;))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (concat &quot;\\\366\\|&quot;(list 246)) nil t 1)&#xA;      (replace-match &quot;ö&quot;))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (concat &quot;\\\326\\|&quot;(list 214)) nil t 1)&#xA;      (replace-match &quot;Ö&quot;))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (concat &quot;\\\374\\|&quot;(list 252)) nil t 1)&#xA;      (replace-match &quot;ü&quot;))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (concat &quot;\\\334\\|&quot;(list 220)) nil t 1)&#xA;      (replace-match &quot;Ü&quot;))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (concat &quot;\\\337\\|&quot;(list 223)) nil t 1)&#xA;      (replace-match &quot;ß&quot;))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward &quot;\\\201&quot; nil t 1)&#xA;      (replace-match &quot;&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from misc-utils.el at &lt;a href=&quot;https://launchpad.net/s-x-emacs-werkstatt&quot; rel=&quot;nofollow&quot;&gt;https://launchpad.net/s-x-emacs-werkstatt&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2014-12-18T17:57:03.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5541" PostTypeId="2" ParentId="5522" CreationDate="2014-12-18T18:07:16.427" Score="1" Body="&lt;p&gt;Actually, it was shoddy attention to detail on my part; the following line in my .zshrc profile was responsible:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export TERM=xterm-256color&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2084" LastActivityDate="2014-12-18T18:07:16.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5542" PostTypeId="2" ParentId="5530" CreationDate="2014-12-18T18:33:42.727" Score="8" Body="&lt;p&gt;This is a bug in your version of &lt;code&gt;sx&lt;/code&gt;. It has since been fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/vermiculus/sx.el/issues/164#issuecomment-67526423&quot;&gt;Issue report on GitHub&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-12-18T18:33:42.727" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5543" PostTypeId="2" ParentId="5538" CreationDate="2014-12-18T20:07:19.077" Score="13" Body="&lt;p&gt;If you're looking for a Google calendar like tool built into Emacs, take a look at &lt;a href=&quot;http://orgmode.org/&quot;&gt;org-mode&lt;/a&gt;.  To set up, just add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;(define-key global-map &quot;\C-ca&quot; 'org-agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;code&gt;.emacs&lt;/code&gt;.  You can then create a file called (for example) &lt;code&gt;calendar.org&lt;/code&gt; containing lines like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* An Event&#xA;  &amp;lt;2014-12-18&amp;gt;&#xA;* TODO A Task&#xA;  SCHEDULED: &amp;lt;2014-12-19&amp;gt;&#xA;* This takes a week&#xA;  &amp;lt;2014-12-14&amp;gt;-&amp;lt;2014-12-20&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then add this file to &lt;code&gt;org-agenda-files&lt;/code&gt; and use &lt;code&gt;org-agenda&lt;/code&gt; to view a weeks worth of events (the most common binding for this is &lt;code&gt;C-c a a&lt;/code&gt;).  There can be as many or as few of these files as you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; can keep an agenda, a todo list, capture notes, events and tasks from other files and export it all into a variety of formats (including icalendar, which can be imported by most other calendaring tools).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's quite complex at first but pretty easy once you get used to it.  The &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/orgtutorial_dto.html&quot;&gt;tutorial&lt;/a&gt; will help you get started.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-12-18T20:07:19.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5544" PostTypeId="1" AcceptedAnswerId="5598" CreationDate="2014-12-18T20:48:02.100" Score="8" ViewCount="2603" Body="&lt;p&gt;Suppose, we have this org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Header1&#xA;** Header1-1&#xA;** Header1-2&#xA;&#xA;* Header2&#xA;&#xA;   1. Item 1&#xA;&#xA;      1. Item 1-1&#xA;      2. Item 1-2&#xA;&#xA;   2. Item 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open it by default it looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Header1...&#xA;* Header2...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unordered items are collapsed. But when I open Header2, all the elements of the ordered list items are visible, so I see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Header2&#xA;&#xA;   1. Item 1&#xA;&#xA;      1. Item 1-1&#xA;      2. Item 1-2&#xA;&#xA;   2. Item 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can cycle visibility by moving the cursor to &lt;code&gt;Item 1&lt;/code&gt; and clicking &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;. Is it possible to make the ordered lists collapsed by default?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastEditorUserId="105" LastEditDate="2015-03-27T19:25:09.800" LastActivityDate="2015-03-27T19:25:09.800" Title="How to make ordered lists collapsed by default in org mode" Tags="|org-mode|cycling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5545" PostTypeId="1" AcceptedAnswerId="5559" CreationDate="2014-12-18T21:29:16.617" Score="15" ViewCount="2097" Body="&lt;p&gt;I use Emacs with Geiser to hack on some Scheme code.  As I'm playing around in the REPL I sometimes evaluate expressions that result in &lt;em&gt;a lot&lt;/em&gt; of output, often all on one line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I just played with SRFI-41 (streams) and created a character stream from a big file; then I forced the stream and Geiser barfed the whole contents of the file as a character stream into my buffer.  Almost immediately, Emacs ground to a halt as more and more characters where appended to the output line, and no matter how long I kept pressing &lt;code&gt;C-g&lt;/code&gt; or &lt;code&gt;C-c C-c&lt;/code&gt; I could not make Emacs (or Geiser) stop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This broke my whole Emacs session as Emacs now completely ignores my input, thinking that it needs to give priority to printing this massive character stream all on one line into an unresponsive Geiser REPL buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something I can do to protect my Emacs session from my destructive curiosity?  (Why does Emacs get so slow when displaying &lt;em&gt;very&lt;/em&gt; long lines anyway?)  Can I set a limit for long lines and tell Emacs that it's okay to simply not attempt to display very long lines?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="25" LastEditDate="2014-12-18T23:23:57.903" LastActivityDate="2014-12-20T09:37:34.517" Title="How to prevent slow-down when an inferior processes generates long lines?" Tags="|performance|line-break|subprocess|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5546" PostTypeId="1" AcceptedAnswerId="5551" CreationDate="2014-12-18T21:33:02.593" Score="5" ViewCount="797" Body="&lt;p&gt;I'm running Emacs on a linux system and the function &lt;code&gt;user-full-name&lt;/code&gt;,&#xA;when called with no arguments, always returns an empty string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I fix this?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume it's something I need to configure on my user account, maybe&#xA;an environment variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(The variable &lt;code&gt;user-login-name&lt;/code&gt; works fine.)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2014-12-22T20:05:47.693" Title="Why is `user-full-name' returning “”?" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5547" PostTypeId="2" ParentId="5546" CreationDate="2014-12-18T21:42:18.697" Score="4" Body="&lt;p&gt;Google is your friend. =/&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ chfn -f &quot;Full Name&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="25" LastEditDate="2014-12-22T01:24:42.120" LastActivityDate="2014-12-22T01:24:42.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5548" PostTypeId="2" ParentId="5460" CreationDate="2014-12-18T23:09:35.897" Score="0" Body="&lt;p&gt;For some unknown reason, today this works (without projectile or elpy):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;; Syntax checking (Flycheck)&#xA;(add-hook 'after-init-hook #'global-flycheck-mode)&#xA;(setq flycheck-check-syntax-automatically '(mode-enabled save new-line idle-change))&#xA;&#xA;;; Default virtualenv (notice I didn't require virtualenvwrapper&#xA;;; python-environment or pyvenv prior to loading it. I have&#xA;;; all of them installed.)&#xA;(if (equal (getenv &quot;VIRTUAL_ENV&quot;) nil)&#xA;    (venv-workon &quot;my-python-project&quot;))&#xA;&#xA;;; Python autocompletion and doc browsing (Jedi, requires jedi and ipc&#xA;;; installed in the Python environment emacs is working in)&#xA;(add-hook 'python-mode-hook 'jedi:setup)&#xA;(setq jedi:setup-keys t)                      ; optional&#xA;(setq jedi:complete-on-dot t)                 ; optional&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I included the &lt;strong&gt;flycheck&lt;/strong&gt; (first) and &lt;strong&gt;jedi&lt;/strong&gt; (last) blocks because that is the closest thing to requiring anything remotely related to Python before I set the default virtual environment. I tested it starting emacs from a shell running no virtualenv (works); running the default virtualenv (works); and running a virtualenv without &lt;em&gt;jedi&lt;/em&gt; installed (does not work). So I'm confident this is actually working as expected.&lt;/p&gt;&#xA;" OwnerUserId="3895" LastEditorUserId="3895" LastEditDate="2014-12-24T01:11:23.867" LastActivityDate="2014-12-24T01:11:23.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5549" PostTypeId="2" ParentId="251" CreationDate="2014-12-18T23:56:39.027" Score="5" Body="&lt;p&gt;I already had this problem in a different unanswered question &lt;a href=&quot;https://superuser.com/questions/775333&quot;&gt;here&lt;/a&gt;. I would expect different fonts at the same size to have the same heights, but this doesn't seem to be the case, so I will show my ad-hoc approach to fixing this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Leaving aside accents, and focusing only on plain characters, different fonts are necessary to display all the different characters simply because some fonts omit entire blocks of characters that are present in other fonts. To make sure that uncommon characters (such as &quot;&quot;) have at least one font for them, install a font such as Symbola, and see the list of fonts in the readme of the &lt;a href=&quot;https://github.com/rolandwalker/unicode-fonts&quot; rel=&quot;nofollow noreferrer&quot;&gt;unicode-fonts&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you install the package &lt;code&gt;unicode-fonts&lt;/code&gt; and a number of good fonts, all characters should be supported, but some will have wrong displayed heights in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that Monaco has incorrect heights, but Symbola appears to have correct heights for mathematical symbols (such as SUBSET OF OR EQUAL TO ⊆; use &lt;kbd&gt;C-x 8 RET&lt;/kbd&gt; or &lt;code&gt;insert-char&lt;/code&gt; to test different characters.). In my case, not using Monaco, Noto Sans Symbols and Apple Symbols was sufficient; one good font for me was DejaVu Sans Mono.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first thing is that you can forbid &lt;code&gt;unicode-fonts&lt;/code&gt; from using Monaco by adding it to &lt;code&gt;unicode-fonts-skip-fonts&lt;/code&gt;; whatever font it selects next might have the right height. Alternatively, you can tell &lt;code&gt;unicode-fonts&lt;/code&gt; to use a specific font for a Unicode block (such as Mathematical Operators; &lt;a href=&quot;http://www.fileformat.info/info/unicode/block/index.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;here is a list of all blocks&lt;/a&gt;) by modifying an entry of &lt;code&gt;unicode-fonts-block-font-mapping&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is that you can easily do this manually for a very precise set of characters by using &lt;code&gt;set-fontset-font&lt;/code&gt;. If Symbola is a good font for mathematical symbols (in this case the range &lt;code&gt;0x2100..0x23ff&lt;/code&gt;), the following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font t '(#x2100 . #x23ff)&#xA;  ;; this should throw an error if there is no such font&#xA;  (font-xlfd-name (find-font (font-spec :family &quot;Symbola&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Other ranges I needed to modify myself were &lt;code&gt;2000..206f&lt;/code&gt;, &lt;code&gt;27c0..27ff&lt;/code&gt;, &lt;code&gt;2900..2bff&lt;/code&gt;, &lt;code&gt;1d400..1d7ff&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, it is not necessary to search for misconfigured characters by hand. Assuming &lt;code&gt;unicode-fonts&lt;/code&gt; is installed, the following function will generate a list of all characters with incorrect heights:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun debug-unicode-heights (&amp;amp;optional block-name)&#xA;  &quot;Find all characters in a given block that have incorrect heights.&#xA;&#xA;BLOCK-NAME can be anything that&#xA;`unicode-fonts-debug-insert-block' accepts, such as `'all-math',&#xA;or a string naming a Unicode block.&quot;&#xA;  (interactive &quot;sBlock name:&quot;)&#xA;  (unless block-name (setq block-name 'all-math))&#xA;  (let ((buffer (generate-new-buffer (format &quot;debug-unicode-heights:%s&quot; block-name)))&#xA;        expected-height&#xA;        bad-characters)&#xA;    (pop-to-buffer buffer)&#xA;    (with-current-buffer buffer&#xA;      (unicode-fonts-debug-insert-block block-name)&#xA;      (goto-char (point-min))&#xA;      (setq expected-height (line-pixel-height))&#xA;      ;; (message &quot;Expected height %d&quot; expected-height)&#xA;      (while (&amp;lt; (point) (point-max))&#xA;        (if (or (= (line-pixel-height) expected-height)&#xA;                ;; Some characters are invalid, they have no name&#xA;                ;; (their name is just their hex code), and their&#xA;                ;; heights do not matter to us.&#xA;                (looking-at-p &quot;^.[^\&quot;]*\&quot;#&quot;))&#xA;            (delete-region (line-beginning-position)&#xA;                           (1+ (line-end-position)))&#xA;          (push (char-after (line-beginning-position)) bad-characters)&#xA;          (forward-line))))&#xA;    ;; (display-message-or-buffer buffer)&#xA;    (apply #'string (reverse bad-characters))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (debug-unicode-heights 'all-math)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (debug-unicode-heights 'all-greek)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would show all bad mathematical symbols. You can then examine which font they are displayed with, and change it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have OS X 10.9.5, so my font settings would likely be different from yours. It is not necessary to install &lt;code&gt;unicode-fonts&lt;/code&gt;; it is possible to manually specify your preferred font choices entirely through &lt;code&gt;set-fontset-font&lt;/code&gt; whenever you find that emacs's default choices don't work well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P.S.&lt;/em&gt; There is an alternative: when a font is consistently too large/small, you can add an entry to &lt;code&gt;face-font-rescale-alist&lt;/code&gt; to tell emacs to always multiply that font's size by a factor of, say, 0.95, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'face-font-rescale-alist (cons (font-spec :family &quot;STIXGeneral&quot;) 0.95) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I tried this, it didn't quite work right (my bug report is &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19408&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;), but this is also a possible approach.&lt;/p&gt;&#xA;" OwnerUserId="875" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2014-12-18T23:56:39.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5550" PostTypeId="2" ParentId="5430" CreationDate="2014-12-19T02:11:59.930" Score="4" Body="&lt;p&gt;I solved by upgrading to 24.4 and building from source. Upgrading Org alone was not enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also noted that the problem went away when downgrading to the built-in Org for 24, which was 7.9.3, but that version is too low to work with now.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2014-12-19T02:11:59.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5551" PostTypeId="2" ParentId="5546" CreationDate="2014-12-19T02:18:46.297" Score="9" Body="&lt;p&gt;The function &lt;code&gt;user-full-name&lt;/code&gt; with no arguments returns the value of the variable &lt;code&gt;user-full-name&lt;/code&gt;.  This variable is initialised:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;to the value of the environment variable &lt;code&gt;NAME&lt;/code&gt; if it is defined; or&lt;/li&gt;&#xA;&lt;li&gt;to the Gecos field of the passwd entry.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Therefore, you can do one of the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;set the Gecos field of your passwd entry using one of the &lt;code&gt;chfn&lt;/code&gt; or &lt;code&gt;usermod&lt;/code&gt; commands;&lt;/li&gt;&#xA;&lt;li&gt;set your user name in the &lt;code&gt;NAME&lt;/code&gt; environment variable in your shell's initialisation file;&lt;/li&gt;&#xA;&lt;li&gt;set the &lt;code&gt;user-full-name&lt;/code&gt; variable in your Emacs' initialisation file.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2014-12-22T20:05:47.693" LastActivityDate="2014-12-22T20:05:47.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5552" PostTypeId="1" AcceptedAnswerId="5565" CreationDate="2014-12-19T02:27:22.123" Score="3" ViewCount="1437" Body="&lt;p&gt;I'm running Emacs in Android under ZShaolin, with whatever the default configuration is.  When I open an org-mode file (or try to enable org-mode), I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(wrong-type-argument stringp (require . t-mouse))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[This seems to be the case whether or not I enable the trackpad (I'm running on a tablet with keyboard)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp (require . t-mouse))&#xA;  string-match(&quot;\\(\\`\\|/\\)org-exp\\(\\.elc\\|\\.el\\)?\\(\\.gz\\)?\\'&quot; (require . t-mouse))&#xA;  load-history-filename-element(&quot;\\(\\`\\|/\\)org-exp\\(\\.elc\\|\\.el\\)?\\(\\.gz\\)?\\'&quot;)&#xA;  eval-after-load(&quot;org-exp&quot; (add-hook (quote org-export-preprocess-before-normalizing-links-hook) (quote org-remove-file-link-modifiers)))&#xA;  org-mode()&#xA;  set-auto-mode-0(org-mode nil)&#xA;  set-auto-mode()&#xA;  normal-mode(t)&#xA;  after-find-file(nil t)&#xA;  find-file-noselect-1(#&amp;lt;buffer Notes.org&amp;gt; &quot;/sdcard/Android/data/com.dropbox.android/files/u139630781/scratch/Org/Notes.org&quot; nil nil &quot;/storage/emulated/legacy/Android/data/com.dropbox.android/files/u139630781/scratch/Org/Notes.org&quot; ((16419 . 51200) 20))&#xA;  find-file-noselect(&quot;/sdcard/Android/data/com.dropbox.android/files/u139630781/scratch/Org/Notes.org&quot; nil nil t)&#xA;  find-file(&quot;/sdcard/Android/data/com.dropbox.android/files/u139630781/scratch/Org/Notes.org&quot; t)&#xA;  call-interactively(find-file nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="891" LastEditorUserId="891" LastEditDate="2014-12-19T18:39:27.673" LastActivityDate="2016-09-06T07:44:36.910" Title="Emacs on Android - org-mode - error - `(wrong-type-argument stringp (require . t-mouse))`" Tags="|org-mode|mouse|android|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5553" PostTypeId="1" AcceptedAnswerId="5554" CreationDate="2014-12-19T04:13:11.930" Score="10" ViewCount="1245" Body="&lt;p&gt;I frequently launch external programs from emacs using &lt;code&gt;M-!&lt;/code&gt;, such as Firefox or Evince, etc. Whenever I do, a buffer pops up full of results for the process, which clobbers whatever else I've got going on in terms of windows arrangement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to bury such buffers by default, so that I don't have to see them unless I decide to go looking for them?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="5187" LastEditDate="2015-09-20T09:38:57.077" LastActivityDate="2017-02-06T07:16:17.517" Title="Async shell process buffer always clobbers window arrangement" Tags="|window|shell|async|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5554" PostTypeId="2" ParentId="5553" CreationDate="2014-12-19T04:54:38.130" Score="13" Body="&lt;p&gt;Since mention that the command is running asynchronously I am assuming you mean the command &lt;code&gt;async-shell-command&lt;/code&gt; bound to &lt;kbd&gt;M-&amp;amp;&lt;/kbd&gt;. You can follow the advice in documentation of &lt;code&gt;async-shell-command&lt;/code&gt; (you can read it by doing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;async-shell-command&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;) customize &lt;code&gt;display-buffer-alist&lt;/code&gt; as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist (cons &quot;\\*Async Shell Command\\*.*&quot; (cons #'display-buffer-no-window nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the buffer used by the command to display output will never be shown.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-19T04:54:38.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5555" PostTypeId="2" ParentId="595" CreationDate="2014-12-19T05:08:53.870" Score="32" Body="&lt;p&gt;Not sure if you want to have UML conversion from/to source code etc., but if you want to create and maintain them by hand, &lt;a href=&quot;https://plantuml.com/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;plantuml&lt;/code&gt;&lt;/a&gt; rocks!&lt;/p&gt;&#xA;&lt;p&gt;Simple plantuml example of a sequence diagram:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Bob -&amp;gt; Alice : hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/58BPr.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/58BPr.png&quot; alt=&quot;Rendered result of simple plantuml example&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I am successfully using &lt;code&gt;org-babel&lt;/code&gt; with &lt;code&gt;plantuml&lt;/code&gt; (and gnuplot and ditaa and ...) diagrams etc.  Works like a charm, once &lt;a href=&quot;http://eschulte.github.io/babel-dev/DONE-integrate-plantuml-support.html&quot; rel=&quot;noreferrer&quot;&gt;set up&lt;/a&gt;, and html output too looks awesome when you use &lt;a href=&quot;https://github.com/fniessen/org-html-themes&quot; rel=&quot;noreferrer&quot;&gt;any one&lt;/a&gt; of the &lt;code&gt;org-mode&lt;/code&gt; style sheets out there.&lt;/p&gt;&#xA;&lt;p&gt;See also Zeekat's &lt;a href=&quot;http://zeekat.nl/articles/making-emacs-work-for-me.html#sec-10-6&quot; rel=&quot;noreferrer&quot;&gt;Making Emacs Work For Me&lt;/a&gt; on how to setup &lt;code&gt;org-babel&lt;/code&gt; and many other Emacs goodies.&lt;/p&gt;&#xA;&lt;p&gt;Then there is graphviz's &lt;strong&gt;dot&lt;/strong&gt;, which I am about to check out, and while not specific to UML, could also be &lt;a href=&quot;http://www.tonyballantyne.com/graphs.html&quot; rel=&quot;noreferrer&quot;&gt;used in Emacs&lt;/a&gt; to do UMLy diagrams.&lt;/p&gt;&#xA;&lt;p&gt;Simple dot example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;graph graphname { &#xA;                a -- b; &#xA;                b -- c;&#xA;                b -- d;&#xA;                d -- a;&#xA;        }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/a6kSY.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/a6kSY.png&quot; alt=&quot;Rendered result of simple dot example&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;And while we are at it, though not related to UML at all, &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html&quot; rel=&quot;noreferrer&quot;&gt;org-babel-gnuplot&lt;/a&gt; shows how to use the &lt;a href=&quot;http://gnuplot.sourceforge.net/demo/&quot; rel=&quot;noreferrer&quot;&gt;extremely versatile &lt;strong&gt;gnuplot&lt;/strong&gt;&lt;/a&gt; in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="3951" LastEditorUserId="3951" LastEditDate="2020-10-01T04:20:14.323" LastActivityDate="2020-10-01T04:20:14.323" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5556" PostTypeId="2" ParentId="5553" CreationDate="2014-12-19T05:45:46.903" Score="4" Body="&lt;p&gt;Emacs has a general-purpose facility to prevent any unintentional (or indeed intentional) window configuration changes from causing problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add &lt;code&gt;(winner-mode 1)&lt;/code&gt; to your init file. Then when something messes up your windows, use &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;left&gt;&lt;/kbd&gt; (&lt;code&gt;winner-undo&lt;/code&gt;) to restore them. You can use it repeatedly to undo multiple window configuration changes. &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;right&gt;&lt;/kbd&gt; (&lt;code&gt;winner-redo&lt;/code&gt;) returns you to the most recent configuration.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-12-19T05:45:46.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5557" PostTypeId="2" ParentId="595" CreationDate="2014-12-19T09:28:17.167" Score="10" Body="&lt;p&gt;I'll just toot my own horn and mention &lt;a href=&quot;https://github.com/josteink/wsd-mode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;wsd-mode&lt;/code&gt;&lt;/a&gt;. It also has partial support for &lt;code&gt;org-babel&lt;/code&gt;, which means you can literally embed your UML in your org-mode docs and export the result to a valid HTML-document or similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compared to &lt;code&gt;plantuml-mode&lt;/code&gt;, its support for syntax-highlighting and indentation is clearly and objectively superior. It also integrates nicely with &lt;code&gt;flycheck&lt;/code&gt; and &lt;code&gt;company-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think all those &quot;small&quot; things matters, &lt;code&gt;wsd-mode&lt;/code&gt; might be a better fit for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike &lt;code&gt;plantuml-mode&lt;/code&gt;, it doesn't depend on Java or other binaries, but instead uses a SaaS webservice to generate the diagrams.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes it more plug-and-play and portable and to someone this might be a better fit, but the catch is that you need to be online for it to work.&lt;/p&gt;&#xA;" OwnerUserId="3952" LastEditorUserId="3952" LastEditDate="2016-03-17T08:42:58.257" LastActivityDate="2016-03-17T08:42:58.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5558" PostTypeId="2" ParentId="5553" CreationDate="2014-12-19T09:32:00.503" Score="4" Body="&lt;p&gt;Here's my configuration. It should work great if you're on Linux.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired-aux)&#xA;&#xA;(defvar dired-filelist-cmd&#xA;  '((&quot;vlc&quot; &quot;-L&quot;)))&#xA;&#xA;(defun dired-start-process (cmd &amp;amp;optional file-list)&#xA;  (interactive&#xA;   (let ((files (dired-get-marked-files t current-prefix-arg)))&#xA;     (list&#xA;      (dired-read-shell-command &quot;&amp;amp; on %s: &quot; current-prefix-arg files)&#xA;      files)))&#xA;  (start-process&#xA;   cmd nil shell-file-name&#xA;   shell-command-switch&#xA;   (format &quot;nohup 1&amp;gt;/dev/null 2&amp;gt;/dev/null %s \&quot;%s\&quot;&quot;&#xA;           (if (&amp;gt; (length file-list) 1)&#xA;               (format &quot;%s %s&quot; cmd&#xA;                       (cadr (assoc cmd dired-filelist-cmd)))&#xA;             cmd)&#xA;           (mapconcat #'expand-file-name file-list &quot;\&quot; \&quot;&quot;))))&#xA;&#xA;(define-key dired-mode-map &quot;r&quot; 'dired-start-process)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not only will it hide those pesky buffers when you e.g. open a pdf file from &lt;code&gt;dired&lt;/code&gt;,&#xA;Evince &lt;em&gt;will persist&lt;/em&gt; even if you close Emacs.&#xA;There's also a small customization for queuing up marked video files for a vlc playlist. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-19T09:32:00.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5559" PostTypeId="2" ParentId="5545" CreationDate="2014-12-19T09:59:51.530" Score="12" Body="&lt;p&gt;As already answered in the comments, Emacs becoming very slow in its&#xA;redisplay for long lines is a &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13675&quot;&gt;well-known&#xA;issue&lt;/a&gt;.  Fixing it&#xA;would be very nice, but needs lots of thought to be pulled off&#xA;correctly.  I have an idea of how it could be accomplished based on&#xA;section 6.3 of &lt;a href=&quot;http://soft-dev.org/pubs/html/diekmann_tratt__eco_a_language_composition_editor/&quot;&gt;this&#xA;document&lt;/a&gt;&#xA;(basically, store visual line information in the current buffer and&#xA;update it on insertion of whitespace, display properties, window&#xA;changes, etc., then use that information in the redisplay code to&#xA;avoid scanning for it all the time), but am not familiar enough with&#xA;the C internals to pull it off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are workarounds though.  The most obvious ones would be tuning&#xA;display-related parameters (like, enabling visual line truncation in&#xA;the graphical Emacs instance, using a non-graphical Emacs to have that&#xA;done automatically, disabling Bidi features, etc.) and preprocessing&#xA;the file contents you're reading in.  A less obvious one is&#xA;automatically post-processing the files, be it by actually truncating&#xA;their lines or adding text properties that make the lines appear&#xA;shorter than they actually are.  To turn this into a more interesting&#xA;answer, I'll present a pretty ugly hack of the former option that will&#xA;only work for &lt;code&gt;comint&lt;/code&gt;-derived modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-comint-shorten-long-lines (text)&#xA;  (let* ((regexp &quot;^\\(.\\{80\\}\\).*?$&quot;)&#xA;         (shortened-text (replace-regexp-in-string regexp &quot;\\1&quot; text)))&#xA;    (if (string= shortened-text text)&#xA;        text&#xA;      (propertize shortened-text 'help-echo text))))&#xA;&#xA;(add-hook 'comint-preoutput-filter-functions 'my-comint-shorten-long-lines)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This defines &lt;code&gt;my-comint-shorten-long-lines&lt;/code&gt;, a function that takes a&#xA;string possibly consisting of many lines and uses the power of regular&#xA;expressions to replace any line in it with a length of 80 characters&#xA;or more with a shortened version that displays the original text when&#xA;hovering over it.  When used as hook in&#xA;&lt;code&gt;comint-preoutput-filter-functions&lt;/code&gt; it will filter all &lt;code&gt;comint&lt;/code&gt; output&#xA;before it's displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this rendition of the hack has a pretty serious weakness.  In&#xA;modes that have basic fontification going on (like, &lt;code&gt;M-x ielm&lt;/code&gt;), it&#xA;will happily cut off lines that are part of a string and will that way&#xA;fontify everything until the next quote as string!  That's not what we&#xA;want and can be fixed with a bit more regex mastery (but will&#xA;presumably break inside a REPL for a language like Python).&#xA;While we're at it, let's highlight shortened output, too:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-comint-shorten-long-lines (text)&#xA;  (let* ((regexp &quot;^\\(.\\{80\\}\\).*?\\(\&quot;?\\)$&quot;)&#xA;         (shortened-text (replace-regexp-in-string regexp &quot;\\1\\2&quot; text)))&#xA;    (if (string= shortened-text text)&#xA;        text&#xA;      (propertize shortened-text 'font-lock-face 'shadow 'help-echo text))))&#xA;&#xA;(add-hook 'comint-preoutput-filter-functions 'my-comint-shorten-long-lines)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's a bit better, but still ugly.  Hovering on the output of&#xA;something like &lt;code&gt;find /&lt;/code&gt; in &lt;code&gt;M-x shell&lt;/code&gt; is not appealing (we'd ideally&#xA;want only to display the unshortened line, not all output), string&#xA;detection is rudimentary at best and truncation could be indicated&#xA;better with ellipses instead of fontifying everything.  On top of&#xA;that, it's not even guaranteed that the text coming in isn't turned&#xA;into batches.  All of this screams for doing the processing step in a&#xA;temporary buffer, but will be left for the reader as exercise (or the&#xA;author as potential blog post).&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-12-19T10:58:23.407" LastActivityDate="2014-12-19T10:58:23.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5560" PostTypeId="1" AcceptedAnswerId="5561" CreationDate="2014-12-19T10:07:11.587" Score="10" ViewCount="3237" Body="&lt;p&gt;I have a project base folder, &lt;code&gt;~/prj&lt;/code&gt;, inside of which I have many individual projects, &lt;code&gt;2014_prj1&lt;/code&gt;, &lt;code&gt;2014_prj2&lt;/code&gt;, ..., inside of which I have, among others, a &lt;code&gt;doc&lt;/code&gt; folder.  The layout looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/prj&#xA;~/prj/2014_prj1&#xA;~/prj/2014_prj1/README.org&#xA;~/prj/2014_prj1/data&#xA;~/prj/2014_prj1/doc&#xA;~/prj/2014_prj2&#xA;~/prj/2014_prj2/README.org&#xA;~/prj/2014_prj2/data&#xA;~/prj/2014_prj2/doc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I'd like to add all project directories (&lt;code&gt;2014_prjX&lt;/code&gt;) to &lt;code&gt;org-agenda-files&lt;/code&gt;, as well as all &lt;code&gt;doc&lt;/code&gt; subdirectories of the project directories.  The &lt;code&gt;data&lt;/code&gt; folders should &lt;em&gt;not&lt;/em&gt; be part of &lt;code&gt;org-agenda-files&lt;/code&gt;, because they can possibly contain 10000s of files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?  I tried a simple&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files (quote (&quot;~/doc/notes&quot;&#xA;                               &quot;~/.emacs.d&quot;&#xA;                               &quot;~/prj/*/doc&quot;&#xA;                               )&#xA;                        )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this gives me the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Non-existing agenda file ~/prj/*/doc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2015-09-24T06:27:05.800" Title="Wildcard in org-agenda-files" Tags="|org-mode|org-agenda|wildcard|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5561" PostTypeId="2" ParentId="5560" CreationDate="2014-12-19T11:12:51.277" Score="20" Body="&lt;p&gt;You can use the function &lt;code&gt;file-expand-wildcards&lt;/code&gt; to get all the files matching the wildcard add them to &lt;code&gt;org-agenda-files&lt;/code&gt; variable. Something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files (append '(&quot;~/doc/notes&quot; &quot;~/.emacs.d&quot;) (file-expand-wildcards &quot;~/prj/*/doc&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-19T11:12:51.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5562" PostTypeId="2" ParentId="2096" CreationDate="2014-12-19T11:41:20.573" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/vic/color-theme-buffer-local&quot; rel=&quot;noreferrer&quot;&gt;color-theme-buffer-local&lt;/a&gt; provides buffer-local theme support for both color-theme and the Emacs 24 theme systems. &lt;a href=&quot;https://github.com/purcell/color-theme-sanityinc-solarized&quot; rel=&quot;noreferrer&quot;&gt;My version of the solarized theme&lt;/a&gt; also supports &lt;em&gt;both&lt;/em&gt; systems, if you decide to go this route.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2014-12-19T11:41:20.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5563" PostTypeId="2" ParentId="5507" CreationDate="2014-12-19T12:17:10.180" Score="12" Body="&lt;p&gt;You can use the minor mode &lt;code&gt;smerge-mode&lt;/code&gt; to move between conflicts and resolve them. You can open ediff to resolve conflicts with &lt;code&gt;C-c ^ E&lt;/code&gt; while in smerge mode.&lt;/p&gt;&#xA;" OwnerUserId="3858" LastEditorUserId="105" LastEditDate="2021-06-30T15:28:51.703" LastActivityDate="2021-06-30T15:28:51.703" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5565" PostTypeId="2" ParentId="5552" CreationDate="2014-12-19T19:01:51.393" Score="2" Body="&lt;p&gt;Seems like your Emacs has a malformed &lt;code&gt;load-history&lt;/code&gt; variable. Its documentation states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Documentation:&lt;/strong&gt;&#xA;  Alist mapping loaded file names to symbols and features.&#xA;  Each alist element should be a list &lt;code&gt;(FILE-NAME ENTRIES...)&lt;/code&gt;, where&#xA;  &lt;code&gt;FILE-NAME&lt;/code&gt; is the name of a file that has been loaded into Emacs.&#xA;  The file name is absolute and true (i.e. it doesn't contain symlinks).&#xA;  As an exception, one of the alist elements may have &lt;code&gt;FILE-NAME&lt;/code&gt; &lt;code&gt;nil&lt;/code&gt;,&#xA;  for symbols and features not associated with any file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In your case &lt;code&gt;load-history&lt;/code&gt; contains an element whose &lt;code&gt;car&lt;/code&gt; is not a string but &lt;code&gt;(require . t-mouse)&lt;/code&gt;. &lt;code&gt;load-history-filename-element&lt;/code&gt; expects a file name (a string) and bails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know what the reason is (and cannot find out because I don't have an Android device) , but we can try to get around this by creating a slightly more robust version of &lt;code&gt;load-history-filename-element&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun load-history-filename-element (file-regexp)&#xA;  &quot;Get the first elt of `load-history' whose car matches FILE-REGEXP.&#xA;        Return nil if there isn't one.&quot;&#xA;  (let* ((loads load-history)&#xA;         (load-elt (and loads (car loads))))&#xA;    (save-match-data&#xA;      (while (and loads&#xA;                  (or (null (car load-elt))&#xA;                      (not (and (stringp (car load-elt)) ; new condition&#xA;                                (string-match file-regexp (car load-elt))))))&#xA;        (setq loads (cdr loads)&#xA;              load-elt (and loads (car loads)))))&#xA;    load-elt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the record, this is the original version (Emacs 24.4.1):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun load-history-filename-element (file-regexp)&#xA;  &quot;Get the first elt of `load-history' whose car matches FILE-REGEXP.&#xA;    Return nil if there isn't one.&quot;&#xA;  (let* ((loads load-history)&#xA;         (load-elt (and loads (car loads))))&#xA;    (save-match-data&#xA;      (while (and loads&#xA;                  (or (null (car load-elt))&#xA;                      (not (string-match file-regexp (car load-elt)))))&#xA;        (setq loads (cdr loads)&#xA;              load-elt (and loads (car loads)))))&#xA;    load-elt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All of this is a bit of a shot in the dark, but I hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2014-12-19T19:07:08.283" LastActivityDate="2014-12-19T19:07:08.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5566" PostTypeId="1" AcceptedAnswerId="7958" CreationDate="2014-12-19T19:28:28.953" Score="5" ViewCount="237" Body="&lt;p&gt;I care about the time it takes to start emacs. I bounce around a lot and edit many files. I cannot use emacsclient due to some limitations in my workflow and machine.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the terminal &lt;code&gt;emacs -nw -Q&lt;/code&gt; &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;emacs-init-time&lt;/kbd&gt; returns &lt;code&gt;0.0 seconds&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;In the GUI &lt;code&gt;emacs -Q&lt;/code&gt; &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;emacs-init-time&lt;/kbd&gt; returns &lt;code&gt;0.8 seconds&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the reason for this discrepancy? Can it be corrected?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs 24.4.1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Arch Linux&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-04T08:07:35.070" Title="Why does GUI emacs take longer to start?" Tags="|emacs-internals|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5568" PostTypeId="1" AcceptedAnswerId="5577" CreationDate="2014-12-19T21:54:26.797" Score="35" ViewCount="6300" Body="&lt;p&gt;So, using the regular expression builder (M-x re-builder), finding lines that end in \ takes &quot;\\$&quot;, while in search and replace by regex, it only takes &quot;\$&quot;.  I would have expected the regex builder to build directly usable expressions, so what accounts for this difference?&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="2823" LastEditDate="2014-12-20T06:08:28.593" LastActivityDate="2018-11-16T02:50:24.937" Title="Why do regular expressions created with the regex builder use syntax different from the interactive regular expressions?" Tags="|elisp|regular-expressions|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5569" PostTypeId="1" CreationDate="2014-12-19T23:03:38.650" Score="2" ViewCount="324" Body="&lt;p&gt;I'm replacing a buggy code that was suppose to show a matching brace in the minibuffer in case it was off-screen with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(paren-activate) ;; activates mic-paren&#xA;(setq paren-match-face 'highlight)&#xA;(setq paren-sexp-mode t)&#xA;(setq paren-highlight-offscreen t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works almost perfectly. The only problem, it highlights the matching braces also in the minibuffer when ido shows its thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I disable mic-paren in the minibuffer?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For reference, here is the old code snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(show-paren-mode t)&#xA;(setq show-paren-style 'expression)&#xA;;; Show in the mini-buffer the matching brace in case it is off screen.&#xA;(defadvice show-paren-function&#xA;  (after show-matching-paren-offscreen activate)&#xA;  &quot;If the matching paren is offscreen, show the matching line in the&#xA;        echo area. Has no effect if the character before point is not of&#xA;        the syntax class ')'.&quot;&#xA;  (interactive)&#xA;  (if (not (minibuffer-prompt))&#xA;      (let ((matching-text nil))&#xA;        ;; Only call `blink-matching-open' if the character before point&#xA;        ;; is a close parentheses type character. Otherwise, there's not&#xA;        ;; really any point, and `blink-matching-open' would just echo&#xA;        ;; &quot;Mismatched parentheses&quot;, which gets really annoying.&#xA;        (if (char-equal (char-syntax (char-before (point))) ?\))&#xA;            (setq matching-text (blink-matching-open)))&#xA;        (if (not (null matching-text))&#xA;            (message matching-text)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="861" LastActivityDate="2014-12-22T02:30:04.607" Title="Disable mic-paren in the minibuffer (or at least in ido)" Tags="|balanced-parentheses|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5571" PostTypeId="1" AcceptedAnswerId="7346" CreationDate="2014-12-19T23:41:05.780" Score="21" ViewCount="431" Body="&lt;p&gt;I'd like to display 3 lists of words on separate lines horizontally along the bottom (although top would work too) of every emacs frame I have open. I've thought of 6 ways to do this, and they all have issues:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;My first thought was to add a line to my mode line, but AFAICT you can't use the newline character in a mode line, it just gets converted to &quot;^J&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;My second thought was to have the line across the top of the screen and use the header line, but it doesn't support the newline character either.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I could display an overlay over the last 3 lines of the window, but making this robust seems hard -- scrolling would need to be triggered when point reached the overlay rather than the real end of the window, and I'd have to constantly reposition the overlay since overlays are in text space not window space.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I could try to make dedicated windows at the bottom of the frame. I have tried coding this up but it's not very robust either, it doesn't seem to work right when a frame already contains split windows and I've had to rebind C-x,1 to a custom version of delete-other-windows that ignores my special windows and I'm sure there are other corner cases. Also when a help window pops open now it pops open vertically because it thinks there's already a horizontal split (which technically there is but it's only to display a one line window).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I could have a dedicated frame for this, but then my config won't work in terminal mode, and I'd have to script my window manager to handle keeping it along the bottom of the screen, making it unselectable, not affecting layout, etc. etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I could insert the text for the 3 lines directly into the minibuffer. I got this partially working, I can grow the minibuffer to accomodate the 3 lines, and I can display them. However, any time any message is echo'd the lines disappear until I issue another command at which point they re-appear. Ideally the 3 lines and the echo area would not overlap so I could see both. This would be less annoying if I could reliably filter which messages go to the echo area -- I found a solution on EmacsWiki but it doesn't appear to work for messages that originate in the emacs C source (specifically I'd like to get rid of the file saving messages because I autosave often on a timer).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For context, my goal is to constantly have a display of the most frequently used words in the current buffer, the words nearest point in the current buffer, and the words most recently used in the current buffer. I intend to be able to insert them into the buffer via voice commands. So I could say &quot;nearest 2&quot; and have it pick the second item from the list of words nearest point and insert it. I only care about the word lists being visible for whatever buffer I'm currently editing. I don't want to use the pop-up windows used by the various code completion modes because I need the lists always visible.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2014-12-20T05:20:16.813" LastActivityDate="2015-12-21T18:58:21.633" Title="Display list of words along bottom of frame?" Tags="|window|frames|mode-line|overlays|header-line|" AnswerCount="2" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="5573" PostTypeId="2" ParentId="5569" CreationDate="2014-12-20T02:46:10.960" Score="1" Body="&lt;p&gt;You can use the following to code to disable &lt;code&gt;mic-paren&lt;/code&gt; in minibuffer whenever ido is used (using &lt;code&gt;ido-minibuffer-setup-hook&lt;/code&gt;). Technically this does not disable &lt;code&gt;mic-paren&lt;/code&gt; but sets its face to &lt;code&gt;nil&lt;/code&gt; so that its highlighting does not have any effect&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-remove-mic-paren-face-in-minibuffer ()&#xA;  (set (make-variable-buffer-local 'paren-match-face) nil))&#xA;&#xA;(add-hook 'ido-minibuffer-setup-hook #'my-remove-mic-paren-face-in-minibuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also emacs already has a mode for highlighting matching parens &lt;code&gt;show-paren&lt;/code&gt;, which is pretty &lt;a href=&quot;http://emacsredux.com/blog/2013/12/31/a-peek-at-emacs-24-dot-4-smarter-show-paren-mode/&quot; rel=&quot;nofollow&quot;&gt;sophisticated&lt;/a&gt;, you might want to try it out&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2014-12-22T02:30:04.607" LastActivityDate="2014-12-22T02:30:04.607" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5574" PostTypeId="1" AcceptedAnswerId="5597" CreationDate="2014-12-20T03:52:42.207" Score="1" ViewCount="190" Body="&lt;p&gt;Running org-capture crashes my Emacs (both 24.3 and 24.4 for Linux).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2014-10/msg00850.html&quot; rel=&quot;nofollow&quot;&gt;thread&lt;/a&gt; reports the problem is due to cdlatex not being installed.  But installing it does not solve the problem on my computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="2728" LastEditDate="2014-12-20T04:03:48.523" LastActivityDate="2014-12-20T17:55:07.693" Title="org-capture crashing Emacs" Tags="|org-mode|crash|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5575" PostTypeId="1" AcceptedAnswerId="5576" CreationDate="2014-12-20T04:19:40.797" Score="11" ViewCount="1620" Body="&lt;p&gt;Often I have many buffers open and, for whatever reason, I no longer wish to use a particular minor mode with them. Is there currently a built-in way to disable a particular minor mode for all open buffers, or does this require writing a custom elisp function?&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2014-12-20T04:31:24.470" LastActivityDate="2014-12-20T04:55:58.243" Title="Disable minor mode in all open buffers" Tags="|buffers|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5576" PostTypeId="2" ParentId="5575" CreationDate="2014-12-20T04:55:58.243" Score="19" Body="&lt;p&gt;This does require a custom elisp function unless the minor mode has a &lt;code&gt;(global-*-mode)&lt;/code&gt; function attached to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, it is a pretty simple function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun global-disable-mode (mode-fn)&#xA;  &quot;Disable `MODE-FN' in ALL buffers.&quot;&#xA;  (interactive &quot;a&quot;)&#xA;  (dolist (buffer (buffer-list))&#xA;    (with-current-buffer buffer&#xA;      (funcall mode-fn -1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use (for example, on &lt;code&gt;projectile-mode&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-disable-mode 'projectile-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or call it interactively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x global-disable-mode RET projectile-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="147" LastActivityDate="2014-12-20T04:55:58.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5577" PostTypeId="2" ParentId="5568" CreationDate="2014-12-20T09:26:46.010" Score="42" Body="&lt;p&gt;There are actually four different &lt;code&gt;re-builder&lt;/code&gt; syntax options, and you can switch between them with &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;TAB&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two are for the sexp-form regexp compilers &lt;code&gt;rx&lt;/code&gt; and &lt;code&gt;sregex&lt;/code&gt; (but as the former is more comprehensive and almost entirely syntax-compatible, you can really ignore sregex unless you happen to be working with old code that used it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other two syntax options are &lt;code&gt;read&lt;/code&gt; (the default) and &lt;code&gt;string&lt;/code&gt; (which is the syntax you use interactively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;&lt;code&gt;read&lt;/code&gt;&lt;/strong&gt; syntax is the 'code' syntax -- i.e. as recognised by the lisp reader -- in which you enter the regexp as per the &lt;em&gt;read syntax for strings&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Syntax for Strings&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;&lt;code&gt;string&lt;/code&gt;&lt;/strong&gt; syntax (which I've always considered an unnecessarily confusing name in this context) is the syntax of a regular expression string &lt;em&gt;which has already been read&lt;/em&gt;, and which therefore does not have any of the character escaping required when &lt;em&gt;writing&lt;/em&gt; the string. Which is to say, this is the &lt;em&gt;actual&lt;/em&gt; regular expression syntax, the same as you use when Emacs prompts you interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would like to use string syntax by default, add the following to your init file, or use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-option&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;reb-re-syntax&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq reb-re-syntax 'string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you can switch back and forth between read and string syntax when editing the regexp, with no loss of data. You can also switch &lt;em&gt;from&lt;/em&gt; the sexp forms to read/string syntax (naturally; compiling sexps to strings is what those libraries are for), but you can't go in the other direction and generate a sexp from a string. re-builder remembers what the sexp was, so you don't &lt;em&gt;lose&lt;/em&gt; that form when you change syntax; but it also doesn't get updated if you modify the regexp in a different syntax and then change back. In short, if you're building the regexp as a sexp, make sure you &lt;em&gt;only edit it&lt;/em&gt; while using that syntax.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;A gotcha with the &lt;code&gt;rx&lt;/code&gt; support is that it's actually using the &lt;code&gt;rx-to-string&lt;/code&gt; function, which isn't quite identical to using the &lt;code&gt;rx&lt;/code&gt; macro in code.  &lt;code&gt;rx&lt;/code&gt; accepts an arbitrary number of form arguments and treats them as an &lt;em&gt;implied sequence&lt;/em&gt;, whereas &lt;code&gt;rx-to-string&lt;/code&gt; accepts only a single form, and any top-level sequence must be made explicit with &lt;code&gt;'(sequence ...)&lt;/code&gt; or equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, when you enter a form &lt;code&gt;'(...)&lt;/code&gt; in re-builder, it is processed as &lt;code&gt;(rx-to-string '(...))&lt;/code&gt; and not &lt;code&gt;(rx ...)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also take note that an invalid form might cause &lt;code&gt;re-builder&lt;/code&gt; to stop dynamically updating the matches in the associated buffer, even after the form is made valid again.  The &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-u&lt;/kbd&gt; binding for &lt;code&gt;reb-force-update&lt;/code&gt; is useful for resolving these situations.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;By default the mode line shows &quot;RE Builder&quot; when using &lt;code&gt;read&lt;/code&gt; or &lt;code&gt;string&lt;/code&gt; syntax, and &quot;RE Builder Lisp&quot; when using &lt;code&gt;rx&lt;/code&gt; or &lt;code&gt;sregex&lt;/code&gt; syntax, but it seems far more useful to identify the &lt;em&gt;specific&lt;/em&gt; syntax in use (especially to differentiate between &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;string&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you install the &lt;code&gt;delight&lt;/code&gt; package from GNU ELPA, you can use the following to add a syntax indicator to the mode line.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((name '(&quot;Regexp[&quot; (:eval (symbol-name reb-re-syntax)) &quot;]&quot;)))&#xA;  (delight `((reb-mode ,name :major)&#xA;             (reb-lisp-mode ,name :major))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This changes the mode name to &quot;Regexp[read]&quot; in &lt;code&gt;read&lt;/code&gt; syntax, and likewise for the others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or to include a hint for the &lt;code&gt;rx&lt;/code&gt; vs &lt;code&gt;rx-to-string&lt;/code&gt; gotcha described above, make the mode line say &quot;Regexp[rx-to-string]&quot; when using the &lt;code&gt;rx&lt;/code&gt; syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((name '(&quot;Regexp[&quot;&#xA;              (:eval (symbol-name (if (eq reb-re-syntax 'rx)&#xA;                                      'rx-to-string&#xA;                                    reb-re-syntax)))&#xA;              &quot;]&quot;)))&#xA;  (delight `((reb-mode ,name :major)&#xA;             (reb-lisp-mode ,name :major))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2018-11-16T02:50:24.937" LastActivityDate="2018-11-16T02:50:24.937" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5578" PostTypeId="2" ParentId="5545" CreationDate="2014-12-20T09:37:34.517" Score="4" Body="&lt;p&gt;As this happened with Python likewise, solution at python-mode.el, &lt;a href=&quot;https://launchpad.net/python-mode&quot; rel=&quot;nofollow&quot;&gt;https://launchpad.net/python-mode&lt;/a&gt;, is to connect to process directly, not via comint-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relies on &lt;code&gt;start-process&lt;/code&gt; and process-send-string&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example see functions &lt;code&gt;py--start-fast-process&lt;/code&gt; and &lt;code&gt;py--fast-send-string-intern&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2014-12-20T09:37:34.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5579" PostTypeId="1" AcceptedAnswerId="5581" CreationDate="2014-12-20T10:02:11.050" Score="4" ViewCount="955" Body="&lt;p&gt;I use strings like &quot;include/lib-one&quot;, &quot;include/lib-two&quot;, &quot;src/lib-three&quot; all the time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to set shortcuts for these strings, e.g. as &lt;code&gt;C-c 1&lt;/code&gt;, &lt;code&gt;C-c 2&lt;/code&gt; and so on?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastActivityDate="2015-01-18T10:21:04.063" Title="Easiest way to set keybindings for strings" Tags="|key-bindings|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5580" PostTypeId="2" ParentId="5579" CreationDate="2014-12-20T10:15:06.970" Score="3" Body="&lt;p&gt;You can use the &lt;code&gt;insert&lt;/code&gt; function to insert strings at point. You can define keybinding to an invocation of this function. For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key your-mode-map (kbd &quot;C-c 1&quot;) (lambda () (insert &quot;include/lib-one&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2015-01-18T10:21:04.063" LastActivityDate="2015-01-18T10:21:04.063" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5581" PostTypeId="2" ParentId="5579" CreationDate="2014-12-20T10:17:21.737" Score="8" Body="&lt;p&gt;You can also use &lt;code&gt;define-key&lt;/code&gt; or &lt;code&gt;global-set-key&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c a&quot;) &quot;include/lib-one&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've used &lt;code&gt;C-c a&lt;/code&gt; instead of &lt;code&gt;C-c 1&lt;/code&gt; because the former is a reserved-for-end-users sequence, whereas the latter is reserved for major modes. See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt;&lt;code&gt;(elisp) Key Binding Conventions&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-12-20T10:22:22.503" LastActivityDate="2014-12-20T10:22:22.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5582" PostTypeId="1" CreationDate="2014-12-20T10:33:57.300" Score="22" ViewCount="6825" Body="&lt;p&gt;I use the excellent &lt;code&gt;rainbow-mode&lt;/code&gt; to highlight colors in CSS files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UEubI.png&quot; alt=&quot;css with rainbow-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this assumes I know what color I want. Are there any color pickers that I can use for CSS editing inside Emacs? Ideally, I'd really like something where I can make colors slightly darker/brighter/redder/greener, like the Firefox color picker:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Btm84.png&quot; alt=&quot;firefox color picker&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, I've noticed &lt;code&gt;customize-face&lt;/code&gt; offers a color picker from a set of 548 colors. Can I use this for CSS?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/k7dLf.png&quot; alt=&quot;customize-face color picker&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="253" LastEditDate="2015-01-03T16:08:25.653" LastActivityDate="2022-08-22T01:20:33.267" Title="Are there color pickers for Emacs?" Tags="|colors|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5583" PostTypeId="2" ParentId="5582" CreationDate="2014-12-20T11:20:12.980" Score="7" Body="&lt;p&gt;How about:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-insert-color-hex (&amp;amp;optional arg)&#xA;  &quot;Select a color and insert its 24-bit hexadecimal RGB format.&#xA;&#xA;With prefix argument \\[universal-argument] insert the 48-bit value.&quot;&#xA;  (interactive &quot;*P&quot;)&#xA;  (let ((buf (current-buffer)))&#xA;    (list-colors-display&#xA;     nil nil `(lambda (name)&#xA;                (interactive)&#xA;                (quit-window)&#xA;                (with-current-buffer ,buf&#xA;                  (insert (apply #'color-rgb-to-hex&#xA;                                 (nconc (color-name-to-rgb name)&#xA;                                        (unless (consp ',arg)&#xA;                                          (list (or ,arg 2)))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2020-04-29T20:26:11.850" LastActivityDate="2020-04-29T20:26:11.850" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5584" PostTypeId="2" ParentId="5582" CreationDate="2014-12-20T11:24:42.637" Score="20" Body="&lt;p&gt;Have a look at &lt;code&gt;helm-colors&lt;/code&gt;.  It presents the colors exactly as in your screenshot and seems to be using a similar or even the same palette.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To insert a color name into the current buffer, press &lt;kbd&gt;C-c n&lt;/kbd&gt; (runs the action &lt;code&gt;Insert Name&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To insert the hex value of a color, press &lt;kbd&gt;C-c r&lt;/kbd&gt; (run the action &lt;code&gt;Insert RGB&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="200" LastEditDate="2014-12-20T16:59:50.667" LastActivityDate="2014-12-20T16:59:50.667" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5585" PostTypeId="1" AcceptedAnswerId="5587" CreationDate="2014-12-20T12:31:15.150" Score="5" ViewCount="925" Body="&lt;p&gt;In &lt;code&gt;ansi-term&lt;/code&gt; mode, is there a way to copy the command output? This is quite easy in &lt;code&gt;eshell&lt;/code&gt;, but sometimes eshell behavors not exactly the same with &lt;code&gt;bash&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;eshell doesn't know how to auto-complete &lt;code&gt;sudo apt-...&lt;/code&gt; command.&lt;/li&gt;&#xA;&lt;li&gt;eshell requires to input password each time I run a sudo command.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I have to use &lt;code&gt;ansi-term&lt;/code&gt; from time to time. &lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-20T12:58:36.480" Title="How to copy command output in ansi-term mode?" Tags="|eshell|ansi-term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5586" PostTypeId="1" AcceptedAnswerId="5590" CreationDate="2014-12-20T12:42:01.903" Score="6" ViewCount="1004" Body="&lt;p&gt;When I learn to use linux, Emacs, and programming, I asked and googled a lot of How-to's. I would like to note them down for furture reference. The tools should be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use plain text file, perhaps with some mark-down.&lt;/li&gt;&#xA;&lt;li&gt;able to generate output, in html/pdf.&lt;/li&gt;&#xA;&lt;li&gt;able to search by text strings.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there such tool-chains works well with Emacs? I've heard about org-mode, can it fulfill my requirement?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2018-04-24T15:48:24.090" Title="What tool shall I use to make a personal note book?" Tags="|org-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5587" PostTypeId="2" ParentId="5585" CreationDate="2014-12-20T12:51:40.260" Score="5" Body="&lt;p&gt;&lt;code&gt;C-c C-j&lt;/code&gt; to activate term-line-mode, then, the terminal buffer act more like a normal text-buffer. Switch back to character mode with &lt;code&gt;C-c C-k&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may be intersted by this function that will help you toggle, between the two modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'term)&#xA;&#xA;(defun jnm/term-toggle-mode ()&#xA;  &quot;Toggles term between line mode and char mode&quot;&#xA;  (interactive)&#xA;  (if (term-in-line-mode)&#xA;      (term-char-mode)&#xA;    (term-line-mode)))&#xA;&#xA;(define-key term-mode-map (kbd &quot;C-c C-j&quot;) 'jnm/term-toggle-mode)&#xA;(define-key term-mode-map (kbd &quot;C-c C-k&quot;) 'jnm/term-toggle-mode)&#xA;&#xA;(define-key term-raw-map (kbd &quot;C-c C-j&quot;) 'jnm/term-toggle-mode)&#xA;(define-key term-raw-map (kbd &quot;C-c C-k&quot;) 'jnm/term-toggle-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;https://joelmccracken.github.io/entries/switching-between-term-mode-and-line-mode-in-emacs-term/&quot; rel=&quot;noreferrer&quot;&gt;Joel's Journal&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-12-20T12:58:36.480" LastActivityDate="2014-12-20T12:58:36.480" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5588" PostTypeId="2" ParentId="3603" CreationDate="2014-12-20T13:24:38.603" Score="3" Body="&lt;p&gt;This thing happens because font that set for &lt;code&gt;variable-pitch&lt;/code&gt; face is not installed on your system. So, for example, I had &lt;code&gt;Sans Serif&lt;/code&gt;. There are also other faces that inherit font from &lt;code&gt;variable-pitch&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to fix the actual problem, we need to change font for this face. You can do it two ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Invoke &lt;kbd&gt;M-x list-faces-display&lt;/kbd&gt;, then navigate to &lt;code&gt;variable-pitch&lt;/code&gt;, edit it changing its font;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can directly change font for this face in your init-file, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'variable-pitch&#xA;                     nil&#xA;                     :family &quot;Inconsolata&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or, alternatively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA;  '(variable-pitch ((t (:family &quot;Inconsolata&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2014-12-20T13:24:38.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5589" PostTypeId="1" AcceptedAnswerId="5592" CreationDate="2014-12-20T14:02:49.667" Score="12" ViewCount="2251" Body="&lt;p&gt;Are there any options or packages which cause &lt;code&gt;default-directory&lt;/code&gt; to be updated if the working directory changes in &lt;code&gt;shell-mode&lt;/code&gt; and &lt;code&gt;term-mode&lt;/code&gt;? I.e. when using &lt;code&gt;cd&lt;/code&gt;, but the solution would have to be more robust than just look for this particular command and maybe a few others - it should actually check the value of &lt;code&gt;$PWD&lt;/code&gt; after every command, I would think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More importantly though it should also work when connecting to a remote machine from inside a &lt;code&gt;shell-mode&lt;/code&gt; or &lt;code&gt;term-mode&lt;/code&gt; buffer which was first created with &lt;code&gt;default-directory&lt;/code&gt; being a local directory. That's actually the feature I really need: being able to tell programmatically whether the commands I type into such terminals are run on a remote machine. I would like to get that information in form of a properly set &lt;code&gt;default-directory&lt;/code&gt; and figure if there is a way to get that, then the tool doing this would also work locally as described above.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-20T16:41:54.080" Title="Automatically update default-directory when PWD changes in shell-mode and term-mode" Tags="|term|ansi-term|shell-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5590" PostTypeId="2" ParentId="5586" CreationDate="2014-12-20T14:40:32.110" Score="9" Body="&lt;p&gt;Yes, certainly &lt;code&gt;Org-mode&lt;/code&gt; can do that. Here is &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/orgtutorial_dto.html&quot;&gt;a nice tutorial&lt;/a&gt; that is simple to quickly learn and use &lt;code&gt;Org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to note them down for future reference.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can store mostly anything in Emacs with &lt;code&gt;org-mode&lt;/code&gt; with &lt;code&gt;org-store-link&lt;/code&gt; inside an &lt;code&gt;org-mode&lt;/code&gt; buffer and later open that link again. You can even store remote ssh link to a file and later open it, the same way as you open your local files! You can also store URL on the web that is clickable.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Use plain text file&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;able to search by text strings.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Org-mode&lt;/code&gt; is completely plain text, so you can use any text search tool to search for content.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;able to generate output, in html/pdf.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Org-mode&lt;/code&gt; can generate many output. &lt;a href=&quot;http://tuhdo.github.io/&quot;&gt;My series of guides&lt;/a&gt; is an example. Or the &lt;a href=&quot;http://orgmode.org/manual/&quot;&gt;Org Manual&lt;/a&gt;. Here is &lt;a href=&quot;http://orgmode.org/manual/Exporting.html&quot;&gt;a list of formats&lt;/a&gt; that you can export with &lt;code&gt;Org-mode&lt;/code&gt;. You can export to mark down later if you want.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-12-20T14:40:32.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5591" PostTypeId="1" AcceptedAnswerId="5595" CreationDate="2014-12-20T16:20:15.930" Score="4" ViewCount="947" Body="&lt;p&gt;I am used to my tables aligning nicely when I hit C-c C-c in Linux. In Emacs for OS X (emacsforosx.com) this does not behave on my system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LaufL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works in Aquamacs.&lt;/p&gt;&#xA;" OwnerUserId="712" LastEditorUserId="712" LastEditDate="2014-12-20T16:33:13.163" LastActivityDate="2015-06-16T18:00:48.493" Title="org-table alignment issues in osx" Tags="|org-mode|osx|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5592" PostTypeId="2" ParentId="5589" CreationDate="2014-12-20T16:41:54.080" Score="12" Body="&lt;p&gt;I think the first part of your question can be done with &lt;code&gt;dirtrack-mode&lt;/code&gt;.  First, you set your shell prompt to include the present working directory.  Next, you set &lt;code&gt;dirtrack-list&lt;/code&gt; to a regex that tells &lt;code&gt;dirtrack-mode&lt;/code&gt; how to extract it.  Example: I set &lt;code&gt;PS1&lt;/code&gt; in Bash to be this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export PS1=&quot;[\h:\w] $ &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and in Emacs I set &lt;code&gt;dirtrack-list&lt;/code&gt; and turn on &lt;code&gt;dirtrack-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-variable 'dirtrack-list '(&quot;^.*[^ ]+:\\(.*\\)]&quot; 1 nil))&#xA;(dirtrack-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Taken from &lt;a href=&quot;https://snarfed.org/why_i_run_shells_inside_emacs&quot;&gt;this great blog post&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, I'm able to change directories at will, and &lt;code&gt;default-directory&lt;/code&gt; changes as I go.  This also works if, in a shell, I SSH to a remote machine where I've set the prompt the same way -- &lt;code&gt;cd /etc/apache2&lt;/code&gt;, on the remote machine, changes &lt;code&gt;default-directory&lt;/code&gt; to &lt;code&gt;/etc/apache2&lt;/code&gt;.  Note, however, that this is &lt;em&gt;local&lt;/em&gt; -- in the case of the remote machine, &lt;code&gt;default-directory&lt;/code&gt; will still be set to &lt;code&gt;/etc/apache2&lt;/code&gt; on the &lt;em&gt;local&lt;/em&gt; machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand the second part of your question, you want &lt;code&gt;default-directory&lt;/code&gt; to be set to something like &lt;code&gt;remote-machine:/etc/apache2&lt;/code&gt; when SSHing to another machine.  When using  &lt;a href=&quot;https://github.com/ieure/ssh-el&quot;&gt;ssh-el&lt;/a&gt;, you can run &lt;code&gt;ssh-directory-tracking-mode&lt;/code&gt; to make this work.  For example, if I run &lt;code&gt;M-x ssh&lt;/code&gt;, cd to  &lt;code&gt;/etc/apache2&lt;/code&gt;, then run &lt;code&gt;C-x C-f&lt;/code&gt;, the prompt I see is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Find Files or Url: /scp:aardvark@remote-machine:/etc/apache2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can run 'M-x ssh-directory-tracking-mode` by hand, but it's more convenient to set it as a hook for ssh-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ssh-mode-hook 'ssh-directory-tracking-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More information:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Tracking.html&quot;&gt;Directory Tracking, Emacs manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://snarfed.org/why_i_run_shells_inside_emacs&quot;&gt;A great blog post&lt;/a&gt; about running shells in Emacs&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;https://github.com/ieure/ssh-el&quot;&gt;ssh-el&lt;/a&gt; Github repo; it's also available on &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_package_system.html&quot;&gt;MELPA&lt;/a&gt;.  (I had no idea it wasn't part of Emacs core...)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/ShellDirtrackByPrompt&quot;&gt;EmacsWiki page on tracking shell directories by prompt&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/15812638/emacs-i-need-and-explanation-on-dirtrack-list-variable&quot;&gt;StackExchange explanation of dirtrack-list&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="291" LastActivityDate="2014-12-20T16:41:54.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5593" PostTypeId="1" CreationDate="2014-12-20T17:00:48.153" Score="2" ViewCount="182" Body="&lt;p&gt;There is a nefarious bug in a project stored locally in &lt;code&gt;~/my/project/path&lt;/code&gt;.  This project is on MELPA, but installing from MELPA fails for some reason for some users. It's unknown why it fails, but I believe I've found a fix which I've committed to a separate branch to create a pull request for discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make sure that it's a fix (I'm the only contributor able to reproduce the bug at the moment), I want to simulate installing the package from the usual means – via &lt;code&gt;M-x package-install sx&lt;/code&gt; – with all the necessary byte-compilation that goes along with it.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-12-20T17:15:45.643" Title="How can I perfectly simulate an automatic package install?" Tags="|package|package-development|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5594" PostTypeId="2" ParentId="5593" CreationDate="2014-12-20T17:15:45.643" Score="5" Body="&lt;p&gt;Make sure that your branch is pushed to upstream.  Then clone the MELPA repository and visit the recipe of your package—&lt;code&gt;recipes/sx&lt;/code&gt; presumably.  Make sure to allow all local variables Emacs asks you for, since that is necessary to load the specific features to edit MELPA recipes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now add a &lt;code&gt;:branch BRANCH&lt;/code&gt; to the recipe, with &lt;code&gt;BRANCH&lt;/code&gt; being the name of the branch that contains your fix.  Ultimately press &lt;code&gt;C-c C-c&lt;/code&gt; to build the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This builds the package exactly like MELPA would build it.  Afterwards you are asked to install the package.  If you answer yes, the package is installed exactly as if you would download it from MELPA, minus the HTTP transfer (it's installed from the local package file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This procedure should allow you to uncover installation bugs in your package.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-20T17:15:45.643" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5595" PostTypeId="2" ParentId="5591" CreationDate="2014-12-20T17:16:02.553" Score="10" Body="&lt;p&gt;While org-mode is a very flexible tool, it has some very hardcoded limitations in its core functionality.  The one you're encountering is the reliance on a monospaced font (such as Andale Mono, Monaco or Menlo to name a few ones your OS X system should come with) to display tables in an aligned fashion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are multiple options how you can solve it.  If you are already relying on monospaced fonts, set Emacs' default font in your init file to a monospaced one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist '((font . &quot;Monaco-12&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, customize the &lt;code&gt;org-table&lt;/code&gt; face with &lt;code&gt;M-x customize-face RET org-table RET&lt;/code&gt; to use a monospaced font to make only org-mode tables display correctly.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-20T17:16:02.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5596" PostTypeId="2" ParentId="5582" CreationDate="2014-12-20T17:33:58.493" Score="16" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/ColorPalette&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Palette&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/palette.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;palette.el&lt;/code&gt;&lt;/a&gt;) gives you a general WYSIWYG color editor/picker, which lets you explore and modify colors using RGB and HSV values, including incrementally. It looks like what you show in your second image.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/DoReMi&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Do Re Mi&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/doremi.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;doremi.el&lt;/code&gt;&lt;/a&gt;,  &lt;a href=&quot;https://www.emacswiki.org/emacs/download/doremi-cmd.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;doremi-cmd.el&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://www.emacswiki.org/emacs/download/doremi-frm.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;doremi-frm.el&lt;/code&gt;&lt;/a&gt;) lets you modify colors used in Emacs incrementally: &quot;direct manipulation&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;strong&gt;Facemenu+&lt;/strong&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/facemenu+.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;facemenu+.el&lt;/code&gt;&lt;/a&gt;) lets you use the color palette (#1) to change colors used in Emacs. It enhances standard library &lt;code&gt;facemenu.el&lt;/code&gt;, things like &lt;code&gt;list-colors-display&lt;/code&gt; and &lt;code&gt;list-faces-display&lt;/code&gt; (which look similar to your 3rd image).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; lets you choose and manipulate colors and faces incrementally, manipulating RGB, HSV, etc. and sorting possible choices in many ways (e.g. combining color-component strengths).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(You can get the libraries mentioned here from &lt;a href=&quot;http://www.melpa.org&quot; rel=&quot;noreferrer&quot;&gt;MELPA&lt;/a&gt;, and the Lisp files contain the full documentation (but without images).)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="2370" LastEditDate="2018-11-17T13:38:33.257" LastActivityDate="2018-11-17T13:38:33.257" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5597" PostTypeId="2" ParentId="5574" CreationDate="2014-12-20T17:55:07.693" Score="0" Body="&lt;p&gt;The problem was a conflict with the auto-capitalize mode.&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2014-12-20T17:55:07.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5598" PostTypeId="2" ParentId="5544" CreationDate="2014-12-20T20:01:40.960" Score="7" Body="&lt;p&gt;That is not specific &lt;em&gt;only&lt;/em&gt; to ordered lists.&#xA;This behaviour is related to &lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html&quot; rel=&quot;noreferrer&quot;&gt;plain lists&lt;/a&gt; (ordered, unordered, description) in general.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For more details, see the variable &lt;em&gt;org-cycle-include-plain-lists&lt;/em&gt;. If this variable is set to &lt;em&gt;integrate&lt;/em&gt;, plain list items will be treated like low-level headlines.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To the point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-cycle-include-plain-lists 'integrate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should fix your problem for all &lt;em&gt;org&lt;/em&gt; files (if I understand your issue correctly).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want more granular control then you can also set this per directory, file, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also FWIW - items belonging to the same plain list &lt;em&gt;must&lt;/em&gt; have the same indentation on the first line.&lt;/p&gt;&#xA;" OwnerUserId="220" LastActivityDate="2014-12-20T20:01:40.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5600" PostTypeId="2" ParentId="5586" CreationDate="2014-12-20T22:08:11.777" Score="1" Body="&lt;p&gt;You can’t go wrong with org-mode.  If you want something lighter-weight, or in particular, based around an external tools (which could be easier to use depending on your preference), then I suggest &lt;a href=&quot;http://maebert.github.io/jrnl/&quot; rel=&quot;nofollow&quot;&gt;jrnl&lt;/a&gt;.  You write entries in plain-text and can convert them to JSON—to be honest I’ve found less use for that—or Markdown.  The latter allows you to convert to a number of formats via &lt;a href=&quot;http://johnmacfarlane.net/pandoc/&quot; rel=&quot;nofollow&quot;&gt;Pandoc&lt;/a&gt; if you choose.  It is not a superior approach to org-mode, simply different.&lt;/p&gt;&#xA;" OwnerUserId="3965" LastActivityDate="2014-12-20T22:08:11.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5601" PostTypeId="2" ParentId="5586" CreationDate="2014-12-20T22:25:29.380" Score="1" Body="&lt;p&gt;If you want to &quot;&lt;em&gt;note down&lt;/em&gt;&quot; &quot;&lt;em&gt;How-to's&lt;/em&gt;&quot; that you have googled, then consider simply bookmarking them, using Emacs bookmarks. You can add plain-text annotations to bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can use &lt;strong&gt;Org mode&lt;/strong&gt; for bookmark annotations.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-04-24T15:48:24.090" LastActivityDate="2018-04-24T15:48:24.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5602" PostTypeId="1" CreationDate="2014-12-20T22:40:41.523" Score="4" ViewCount="458" Body="&lt;p&gt;The version of &lt;code&gt;desktop.el&lt;/code&gt; that comes with Emacs 24.4 allows restoring frames as well as windows and buffers. This works fine for an Emacs server (i.e., daemon) with at least one open frame. However, a newly started started Emacs server that attempts to load a desktop file while starting reports restoring frames, but no frames appear. When I open a new frame via &lt;code&gt;emacsclient&lt;/code&gt;, the buffers have been restored, so the desktop file is being read correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a flag for restoring desktop frames for an Emacs server which is just starting (i.e., has no open frames)?&lt;/p&gt;&#xA;" OwnerUserId="315" LastActivityDate="2014-12-20T22:40:41.523" Title="Restore desktop frames for Emacs server" Tags="|frames|daemon|desktop|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5603" PostTypeId="1" AcceptedAnswerId="5604" CreationDate="2014-12-21T01:12:50.690" Score="69" ViewCount="32856" Body="&lt;p&gt;In &lt;code&gt;Dired&lt;/code&gt; mode, I can &lt;code&gt;m&lt;/code&gt; mark files and &lt;code&gt;R&lt;/code&gt; to move them to a destination. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some times the destination path is too long. With the destination open in a split window, is there a way to move files quicker? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I see the two dired windows on the screen, I missed the drag-and-drop function in a GUI file manager.  &lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2023-12-13T12:23:19.523" Title="How to quickly copy/move file in Emacs Dired?" Tags="|dired|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5604" PostTypeId="2" ParentId="5603" CreationDate="2014-12-21T01:21:56.887" Score="107" Body="&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;dired-dwim-target is a variable defined in `dired.el'. Its value is&#xA;nil&lt;/p&gt;&#xA;&lt;p&gt;Documentation: If non-nil, Dired tries to guess a default target&#xA;directory. This means: if there is a Dired buffer displayed in the&#xA;next window, use its current directory, instead of this Dired buffer's&#xA;current directory.&lt;/p&gt;&#xA;&lt;p&gt;The target is used in the prompt for file copy, rename etc.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Put this in your init file: &lt;code&gt;(setq dired-dwim-target t)&lt;/code&gt;. Then, go to dired, split your window, &lt;code&gt;split-window-vertically&lt;/code&gt; &amp;amp; go to another dired directory. When you will press &lt;kbd&gt;C&lt;/kbd&gt; to copy, the other dir in the split pane will be default destination.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="26301" LastEditDate="2023-12-13T12:23:19.523" LastActivityDate="2023-12-13T12:23:19.523" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5605" PostTypeId="1" AcceptedAnswerId="5620" CreationDate="2014-12-21T03:31:50.930" Score="6" ViewCount="3016" Body="&lt;p&gt;According to the org-mode manual, you can set variables in code blocks&#xA;as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADERS: :var foo=&quot;blah&quot;&#xA;#+BEGIN_SRC elisp&#xA;(message foo)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: blah&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I try to do this with a babel block with SQL, I have no&#xA;good luck:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADERS: :var foo=&quot;blah&quot;&#xA;#+BEGIN_SRC sql&#xA;SELECT foo&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the predictable error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: No such column: foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output I'd like to see is something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;blah&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the &lt;code&gt;*SQL*&lt;/code&gt; buffer. I've spent a lot of time trying to figure it&#xA;out but I haven't made any progress yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is what I'm trying to do possible with SQL?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: based on the comments below, the following does work after I explicitly load ob-sqlite:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADERS: :var foo=&quot;blah&quot;&#xA;#+BEGIN_SRC sqlite :db &quot;:memory:&quot;&#xA;SELECT &quot;$foo&quot;;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: blah&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that I have a connection in the &lt;em&gt;SQL&lt;/em&gt; buffer that I want to reuse rather than hard-code the path to the database via :db since I am executing the same query on multiple databases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Almost there!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2: In the end, I ended up doing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADERS: :var foo=&quot;blah&quot;&#xA;#+HEADERS: :var bar=&quot;boop&quot;&#xA;#+BEGIN_SRC sqlite :header yes :db (some-lisp-call-here)&#xA;SELECT $foo, $bar;&#xA;#END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can live with this but I went further and factored out the common parameters&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- org -*-&#xA;#+PROPERTY: header-args:sqlite :header yes :db (some-lisp-call-here) :var foo=&quot;blah&quot; :var bar=&quot;boop&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3968" LastEditorUserId="3968" LastEditDate="2014-12-22T01:24:48.640" LastActivityDate="2014-12-22T01:24:48.640" Title="Variables in Babel evaluation with SQL blocks" Tags="|org-mode|org-babel|sql-interactive-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5606" PostTypeId="2" ParentId="3971" CreationDate="2014-12-21T04:19:42.837" Score="3" Body="&lt;p&gt;Use &lt;a href=&quot;http://iterm2.com/features.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;iTerm2&lt;/a&gt; instead of the built-in Terminal. iTerm2 lets you swap all the modifier keys on the keyboard however you like, right in the Preferences pane. iTerm is a work of art and it's open source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you make the switch to Linux try the technique I describe in the link below. My answer was not selected as Best Answer, but I think it is.&#xA; &lt;a href=&quot;https://unix.stackexchange.com/questions/60235/mapping-super-keys-to-control-without-xmodmap/156645#156645&quot;&gt;https://unix.stackexchange.com/questions/60235/mapping-super-keys-to-control-without-xmodmap/156645#156645&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3930" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2014-12-21T04:19:42.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5607" PostTypeId="1" AcceptedAnswerId="5612" CreationDate="2014-12-21T04:53:53.463" Score="10" ViewCount="4348" Body="&lt;p&gt;I would like to fill (wrap) a long heading in org mode. I don't see mention of how to do so in the &lt;a href=&quot;http://orgmode.org/manual/index.html&quot;&gt;org manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I manually wrap the line by inserting a newline, org mode does not recognize the wrapped text as a heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: &lt;code&gt;org-fill-paragraph&lt;/code&gt; does not do this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-fill-paragraph (&amp;amp;optional justify)&#xA;  &quot;Fill element at point, when applicable.&#xA;&#xA;This function only applies to comment blocks, comments, example&#xA;blocks and paragraphs.  Also, as a special case, re-align table&#xA;when point is at one.&#xA;&#xA;If JUSTIFY is non-nil (interactively, with prefix argument),&#xA;justify as well.  If `sentence-end-double-space' is non-nil, then&#xA;period followed by one space does not end a sentence, so don't&#xA;break a line there.  The variable `fill-column' controls the&#xA;width for filling.&#xA;&#xA;For convenience, when point is at a plain list, an item or&#xA;a footnote definition, try to fill the first paragraph within.&quot;&#xA;  (interactive)&#xA;  ; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2014-12-21T06:50:37.040" Title="How to fill (wrap) an org mode heading?" Tags="|org-mode|fill-paragraph|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5608" PostTypeId="1" CreationDate="2014-12-21T05:08:32.037" Score="20" ViewCount="2695" Body="&lt;p&gt;In a general term runing &lt;code&gt;bash&lt;/code&gt;, when I run a &lt;code&gt;sudo ...&lt;/code&gt; command, bash will remember my password for a while. This makes package management task easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-get update&#xA;# password ......&#xA;sudo apt-get install turing-brain&#xA;# execute without requiring password again.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to accomplish it in eshall? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know &lt;code&gt;term&lt;/code&gt; or &lt;code&gt;ansi-term&lt;/code&gt; in Emacs can do this. But eshell integrate better with Emacs.)&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2018-07-08T07:13:48.280" Title="How to let eshell remember sudo password for two minutes?" Tags="|eshell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5609" PostTypeId="2" ParentId="5607" CreationDate="2014-12-21T05:10:36.970" Score="4" Body="&lt;p&gt;I don't see how to make filling work. So a work-around is to use &lt;code&gt;M-x toggle-truncate-lines&lt;/code&gt;. This only affects the presentation of the heading. It does not insert newlines.&lt;/p&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2014-12-21T05:10:36.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5610" PostTypeId="1" AcceptedAnswerId="50657" CreationDate="2014-12-21T05:58:46.847" Score="3" ViewCount="256" Body="&lt;p&gt;I like how multiple-cursors is turned off when pressing &lt;kbd&gt;RET&lt;/kbd&gt;, and this is not the case for iedit-mode, how can I emulate that behavior?&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2019-05-22T16:14:25.330" Title="How to turn off iedit-mode quickly after finishing an edit?" Tags="|multiple-cursors|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5611" PostTypeId="2" ParentId="5610" CreationDate="2014-12-21T05:58:46.847" Score="2" Body="&lt;p&gt;Define a key for the iedit-mode keyboard map, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key iedit-mode-map (kbd &quot;RET&quot;) 'iedit-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, when you start editing a piece of text with iedit-mode, you can turn it off by just pressing &lt;kbd&gt;RET&lt;/kbd&gt; or any key you like.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2014-12-21T05:58:46.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5612" PostTypeId="2" ParentId="5607" CreationDate="2014-12-21T06:35:34.547" Score="11" Body="&lt;p&gt;The original poster is using the words &lt;code&gt;fill&lt;/code&gt; and &lt;code&gt;wrap&lt;/code&gt; interchangeably -- they are &lt;em&gt;not&lt;/em&gt; the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the variable &lt;code&gt;org-startup-truncated&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Non-nil means entering Org-mode will set `truncate-lines'.&#xA;This is useful since some lines containing links can be very long and&#xA;uninteresting.  Also tables look terrible when wrapped.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The default is &lt;code&gt;t&lt;/code&gt;.  To change this, the user can put the following code into the &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-startup-truncated nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; needs a line-end to correctly identify a heading.  To see an example of the regexp that &lt;code&gt;org-mode&lt;/code&gt; uses for headings, the user can type (after an &lt;code&gt;org-mode&lt;/code&gt; buffer has been loaded):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-variable RET org-complex-heading-regexp RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As can be seen, the ending is &lt;code&gt;$&lt;/code&gt; -- i.e., to the end of the line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^\\(\\*+\\)\\(?: +\\(TODO\\|DONE\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[     ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[    ]*$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-12-21T06:50:37.040" LastActivityDate="2014-12-21T06:50:37.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5613" PostTypeId="1" AcceptedAnswerId="5618" CreationDate="2014-12-21T07:00:25.517" Score="20" ViewCount="7216" Body="&lt;p&gt;Suppose I have the following list.  I'd like to convert it to a checklist. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lec 1 |         1:20:36&#xA;Lec 2 |         1:10:32&#xA;Lec 3 |         1:08:33&#xA;Lec 4 |         1:20:33&#xA;Lec 5 |         1:16:50&#xA;Lec 6 |         1:08:49&#xA;Lec 7 |         1:17:40&#xA;Lec 8 |         1:19:47&#xA;Lec 9 |         1:21:22&#xA;Lec 10 |        1:23:52&#xA;Lec 11 |        1:23:45&#xA;Lec 12 |        1:25:32&#xA;Lec 13 |        1:19:06&#xA;Lec 14 |        1:14:28&#xA;Lec 15 |        1:11:01&#xA;Lec 16 |        1:24:07&#xA;Lec 17 |        1:24:34&#xA;Lec 18 |        1:17:17&#xA;Lec 19 |        1:14:59&#xA;Lec 22 |        1:15:08&#xA;Lec 23 |        1:16:48&#xA;Lec 24 |        1:24:47&#xA;Lec 25 |        1:25:21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to do it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I did it in using kbd-macro. I wonder is there an &lt;code&gt;org&lt;/code&gt; command to do it?)&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="253" LastEditDate="2014-12-21T15:02:27.063" LastActivityDate="2021-02-26T09:16:56.530" Title="How to convert lines to an org-mode checklist?" Tags="|org-mode|" AnswerCount="7" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5615" PostTypeId="1" CreationDate="2014-12-20T01:10:52.837" Score="2" ViewCount="658" Body="&lt;p&gt;Current with C, Javascript, Ruby, etc. when inserting a block with &lt;code&gt;{&lt;/code&gt; &lt;code&gt;&amp;lt;RETURN&amp;gt;&lt;/code&gt;, Emacs automatically indents the next line, but it does so with spaces. How do I change this behavior to tab characters? The follow is my configuration.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default tab-width 2)&#xA;(setq-default c-basic-offset 2)&#xA;(setq-default indent-tabs-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This sets the indention level to 2 (for C and Ruby, but strangely 4 for Javascript), but it still inserts spaces rather than tabs.&lt;/p&gt;&#xA;" OwnerDisplayName="Vortico" LastEditorUserId="25" LastEditDate="2014-12-22T23:55:58.873" LastActivityDate="2015-06-19T05:38:22.657" Title="Emacs indent with tabs to 2 columns" Tags="|indentation|cc-mode|ruby-mode|tabs|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5616" PostTypeId="1" AcceptedAnswerId="6042" CreationDate="2014-12-21T11:54:55.070" Score="13" ViewCount="890" Body="&lt;p&gt;I'm using ERC (with ZNC) as my IRC client.  I'm joined to quite a few channels and when I run &lt;code&gt;znc-all&lt;/code&gt; all my buffers are restored and the logs are replayed.  This is all great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I find very annoying, however, is that while replaying the logs each channel buffer is popped to the front and I really can't do any other work at that time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's even more annoying when I'm reconnecting automatically after being temporarily disconnected.  All of a sudden my work is interrupted by these channel buffers that pop to the front while the channel logs are replayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell ERC/ZNC to keep the buffers in the background when replaying chat logs?  I don't want Emacs to ever switch buffers unless I explicitly ask it to switch buffers.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-01-05T05:30:36.483" Title="Keep ERC buffers in the background on reconnect" Tags="|buffers|erc|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5617" PostTypeId="2" ParentId="5613" CreationDate="2014-12-21T14:56:40.803" Score="11" Body="&lt;p&gt;First, some semantics for clarity.  In &lt;code&gt;org-mode&lt;/code&gt;, a &lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html#Plain-lists&quot;&gt;&lt;em&gt;plain list&lt;/em&gt;&lt;/a&gt; is either ordered or unordered, starting with either a &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;, or &lt;code&gt;*&lt;/code&gt; (for unordered), or a number followed by either a &lt;code&gt;.&lt;/code&gt; or a &lt;code&gt;)&lt;/code&gt; (for ordered).  So: the &quot;list&quot; you describe in your example is not yet an &lt;code&gt;org-mode&lt;/code&gt; list, because it doesn't start with any of these bullets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, I presume by &quot;checklist&quot; you mean the &lt;a href=&quot;http://orgmode.org/manual/Checkboxes.html&quot;&gt;checkboxes&lt;/a&gt; that &lt;code&gt;org-mode&lt;/code&gt; uses in its plain lists, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [X] A checked list item&#xA;- [ ] An unchecked list item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a very simple function that will convert all lines in the selected region to an unordered list with checkboxes (not extensively tested, but works on your example):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-convert-lines-to-checklist (beg end)&#xA;  &quot;Convert all plain lines in region to a plain list with&#xA;checkboxes.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (dotimes (_ (- (line-number-at-pos end) (line-number-at-pos beg)))&#xA;      (insert &quot;- [ ] &quot;)&#xA;      (indent-according-to-mode)&#xA;      (forward-line 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-21T14:56:40.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5618" PostTypeId="2" ParentId="5613" CreationDate="2014-12-21T17:42:58.300" Score="33" Body="&lt;p&gt;Simplest way I could think of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select the list.&lt;/li&gt;&#xA;&lt;li&gt;Move the point to the first column.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x r t&lt;/kbd&gt;&lt;code&gt;- [ ]&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You are done.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-12-21T17:42:58.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5619" PostTypeId="2" ParentId="5608" CreationDate="2014-12-21T18:22:17.627" Score="18" Body="&lt;p&gt;First of all check which &lt;em&gt;sudo&lt;/em&gt; is executed in your eshell session.&#xA;It can be your system’s sudo:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which sudo&#xA;/path/to/system/wide/sudo&#xA;$ which *sudo&#xA;/path/to/system/wide/sudo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or eshell’s sudo:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which sudo&#xA;sudo is a compiled Lisp function in `em-tramp.el'&#xA;$ which eshell/sudo&#xA;eshell/sudo is a compiled Lisp function in `em-tramp.el'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Eshell’s &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/eshell/Built_002dins.html#Built_002dins&quot; rel=&quot;noreferrer&quot;&gt;sudo&lt;/a&gt; uses TRAMP's su or sudo method. These commands are in the eshell-tramp module, which is disabled by default. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I will cover eshell’s sudo case, because it is internal to Emacs and it does not depend on your OS distro:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Load eshell-tramp module:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'em-tramp) ; to load eshell’s sudo&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Switch to eshell’s sudo&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;by prefering built-in commands&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq eshell-prefer-lisp-functions t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that in Emacs 24.4 we need to set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq eshell-prefer-lisp-variables t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;by creating an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/eshell.html#Aliases&quot; rel=&quot;noreferrer&quot;&gt;alias&lt;/a&gt; (execute snippet in eshell)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias sudo 'eshell/sudo $*'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Aliases defined (or deleted) by the alias command are automatically written to the file named by &lt;em&gt;eshell-aliases-file&lt;/em&gt;, which you can also edit directly (although you will have to manually reload it).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally enable password caching for eshell’s sudo (and TRAMP):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq password-cache t) ; enable password caching&#xA;(setq password-cache-expiry 3600) ; for one hour (time in secs)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;PS If you have changed your prompt with &lt;em&gt;eshell-prompt-function&lt;/em&gt;, then remember to adjust prompt regex &lt;em&gt;eshell-prompt-regexp&lt;/em&gt; accordingly. Wrong prompt regex can break some eshell functionality — including password detection.&lt;/p&gt;&#xA;" OwnerUserId="220" LastEditorUserId="220" LastEditDate="2015-02-10T21:15:30.333" LastActivityDate="2015-02-10T21:15:30.333" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="5620" PostTypeId="2" ParentId="5605" CreationDate="2014-12-21T18:49:46.720" Score="14" Body="&lt;pre&gt;&lt;code&gt;#+begin_src sql :engine postgresql :cmdline &quot;-U wvxvw -W secret -d personal&quot;&#xA;select * from phonebook;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| name |          phone |&#xA;|------+----------------|&#xA;| Dad  | XXX-XX-XXXXXXX |&#xA;| Mom  | YYY-YY-YYYYYYY |&#xA;&#xA;#+header: :var pn=&quot;phone&quot;&#xA;#+begin_src sql :engine postgresql :cmdline &quot;-U wvxvw -W secret -d personal&quot;&#xA;select $pn from phonebook;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;|          phone |&#xA;|----------------|&#xA;| XXX-XX-XXXXXXX |&#xA;| YYY-YY-YYYYYYY |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To confirm what Constantine said. This should work (and it works for me).&#xA;What can possibly fail? - spelling, wrong user (not the one that owns the database), empty table and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make sure the block expanded as you'd expect: &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;org-babel-expand-src-block&lt;/code&gt;. Or you could open &lt;code&gt;ob-sql.el&lt;/code&gt; and instrument some of the functions that you believe should process the data for debugging, so that you could see the intermediate state.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-12-21T18:49:46.720" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5621" PostTypeId="1" CreationDate="2014-12-21T21:41:58.167" Score="3" ViewCount="1182" Body="&lt;p&gt;&lt;a href=&quot;http://texstudio.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;TeXStudio&lt;/a&gt; autocompletes environments.  How can I get AUCTeX to do the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can begin typing an environment name (say &lt;code&gt;myenvironment&lt;/code&gt;) and, after entering a part of it (&lt;code&gt;my&lt;/code&gt;, &lt;code&gt;myenv&lt;/code&gt;, etc.), I hit &lt;kbd&gt;Control-Alt-Space&lt;/kbd&gt;, and TeXStudio autocompletes the environment (asking if there are multiple possibilities), and sets the point between &lt;code&gt;\begin{myenvironment}&lt;/code&gt; and &lt;code&gt;\end{myenvironment}&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;yasnippet&lt;/code&gt; mode, but this works only for predefined snippets. So I have, for example, to define a keyword &lt;code&gt;myenv&lt;/code&gt; and it will only autocomplete the snippet for the environment if &lt;code&gt;myenv + TAB&lt;/code&gt; is entered and not when only &lt;code&gt;my + TAB&lt;/code&gt; is entered (with a list of possible completions) or if I type &lt;code&gt;myenvi + TAB&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried &lt;code&gt;predictive-mode&lt;/code&gt; which seems to complete only words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT:&lt;/em&gt; I know the AUCTeX way to do this via &lt;code&gt;C-c C-e&lt;/code&gt;. The difference to the desired TeXStudio approach is that you have to give a key sequence first and then input a few letters of the environment name, whereas in TeXStudio it is the other way around (which is what I am asking here).&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="253" LastEditDate="2014-12-22T13:15:31.500" LastActivityDate="2014-12-27T19:08:42.933" Title="Autocomplete environments like in TeXStudio" Tags="|latex|auctex|yasnippet|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5622" PostTypeId="2" ParentId="5621" CreationDate="2014-12-21T22:02:30.997" Score="3" Body="&lt;p&gt;Auctex provides environment completion with the function &lt;code&gt;M-x LaTeX-environment&lt;/code&gt; by default bound to &lt;code&gt;C-c C-e&lt;/code&gt;. The details are provided in the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Environments.html&quot; rel=&quot;nofollow&quot;&gt;fine manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2014-12-21T22:02:30.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5623" PostTypeId="1" AcceptedAnswerId="5693" CreationDate="2014-12-21T23:13:45.740" Score="2" ViewCount="380" Body="&lt;p&gt;When I start Emacs 24.4.1 for Windows with the &lt;code&gt;-nw&lt;/code&gt; option, I am unable to start R via &lt;kbd&gt;Meta&lt;/kbd&gt;+&lt;code&gt;R&lt;/code&gt;.  Emacs becomes unrensponsive and I have to kill the process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem seems connected with the call in &lt;code&gt;(R)&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(inferior-ess r-start-args cust-alist gdbp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By debugging I see &lt;code&gt;r-start-args&lt;/code&gt; is set to &quot;--no-readline&quot;, but I am not able to debug &lt;code&gt;inferior-ess&lt;/code&gt;. In fact  Edebug gives: &lt;code&gt;Debugger entered: nil&lt;/code&gt;, without stepping through code.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-12-18T22:23:02.267" Title="Using ESS in console Emacs" Tags="|comint|process|ess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5624" PostTypeId="2" ParentId="5613" CreationDate="2014-12-21T23:23:53.403" Score="7" Body="&lt;p&gt;Using search and replace:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-%&lt;/kbd&gt;Lec&lt;kbd&gt; Enter &lt;/kbd&gt; - [ ] Lec &lt;kbd&gt; Enter &lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there are spaces around the checkbox, although they don't show up well here.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2014-12-21T23:23:53.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5625" PostTypeId="1" AcceptedAnswerId="5626" CreationDate="2014-12-22T00:53:00.507" Score="1" ViewCount="793" Body="&lt;p&gt;No matter what I do, the customizations I apply to js2-mode are not going into effect. The mode is on and working, but with default settings. I've tried changing the default-tab-width to 2 and changing the indent behavior for switch blocks (indented case lines are turned off by default). I'm using Emacs 24.4.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the relevant parts from my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'js-mode-hook 'js2-minor-mode)&#xA;(add-hook 'js2-mode-hook 'ac-js2-mode) ;; add auto-complete suggestions&#xA;&#xA;(custom-set-variables&#xA;  ;; custom-set-variables was added by Custom.&#xA;  ;; If you edit it by hand, you could mess it up, so be careful.&#xA;  ;; Your init file should contain only one such instance.&#xA;  ;; If there is more than one, they won't work right.&#xA;  '(js2-basic-offset 2)&#xA;  '(js2-indent-switch-body t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3976" LastActivityDate="2014-12-22T00:59:51.240" Title="js2-mode customizations not applying" Tags="|customize|javascript|js2-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5626" PostTypeId="2" ParentId="5625" CreationDate="2014-12-22T00:59:51.240" Score="2" Body="&lt;p&gt;It looks like you're expecting &lt;code&gt;js2-minor-mode&lt;/code&gt; to handle your indentation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's not the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;js2-minor-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;js2-minor-mode is an interactive autoloaded Lisp function in&#xA;`js2-mode.el'.&#xA;&#xA;(js2-minor-mode &amp;amp;optional ARG)&#xA;&#xA;Minor mode for running js2 as a background linter.&#xA;This allows you to use a different major mode for JavaScript editing,&#xA;such as `js-mode', while retaining the asynchronous error/warning&#xA;highlighting features of `js2-mode'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Perhaps you actually want to use &lt;code&gt;js2-mode&lt;/code&gt; instead of &lt;code&gt;js-mode&lt;/code&gt; as the major mode for editing javascript?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-library&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;js2-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;;; Installation:&#xA;;;&#xA;;; To install it as your major mode for JavaScript editing:&#xA;&#xA;;;   (add-to-list 'auto-mode-alist '(&quot;\\.js\\'&quot; . js2-mode))&#xA;&#xA;;; Alternatively, to install it as a minor mode just for JavaScript linting,&#xA;;; you must add it to the appropriate major-mode hook.  Normally this would be:&#xA;&#xA;;;   (add-hook 'js-mode-hook 'js2-minor-mode)&#xA;&#xA;;; You may also want to hook it in for shell scripts running via node.js:&#xA;&#xA;;;   (add-to-list 'interpreter-mode-alist '(&quot;node&quot; . js2-mode))&#xA;&#xA;;; To customize how it works:&#xA;;;   M-x customize-group RET js2-mode RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-12-22T00:59:51.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5629" PostTypeId="2" ParentId="3652" CreationDate="2014-12-22T01:45:51.440" Score="1" Body="&lt;p&gt;You can iterate through &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-List.html#index-buffer_002dlist-2189&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(buffer-list)&lt;/code&gt;&lt;/a&gt; to find the buffer that interests you. For example, the following expression returns the list of buffers in Eww mode :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-remove :test-not (lambda (buffer)&#xA;                       (with-current-buffer buffer&#xA;                         (eq major-mode 'eww-mode)))&#xA;  (buffer-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to keep track of a specific buffer after it's created, store &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Current-Buffer.html#index-current_002dbuffer-2143&quot; rel=&quot;nofollow&quot;&gt;it&lt;/a&gt; in a variable.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-12-22T01:45:51.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5630" PostTypeId="2" ParentId="5436" CreationDate="2014-12-22T01:57:31.900" Score="6" Body="&lt;p&gt;Reading the manual and browsing the list from &lt;code&gt;C-u C-h a plist RET&lt;/code&gt; doesn't turn up any function to merge two property lists. The Common Lisp extensions don't provide any function specifically to act on property lists, only place (&lt;code&gt;getf&lt;/code&gt;/&lt;code&gt;setf&lt;/code&gt;/…) support. So you either need to rely on a third-party library or roll your own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rolling your own isn't too difficult. This implementation uses the last value in case of conflict.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun plist-merge (&amp;amp;rest plists)&#xA;  (if plists&#xA;      (let ((result (copy-sequence (car plists))))&#xA;        (while (setq plists (cdr plists))&#xA;          (let ((plist (car plists)))&#xA;            (while plist&#xA;              (setq result (plist-put result (car plist) (car (cdr plist)))&#xA;                    plist (cdr (cdr plist))))))&#xA;        result)&#xA;    nil))&#xA;&#xA;(plist-merge '(:x 2 :y 3)&#xA;             '(     :y 0 :z 7))&#xA;=&amp;gt;            (:x 2 :y 0 :z 7)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="2462" LastEditDate="2015-01-23T12:09:30.720" LastActivityDate="2015-01-23T12:09:30.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5631" PostTypeId="2" ParentId="5621" CreationDate="2014-12-22T02:51:16.993" Score="0" Body="&lt;p&gt;To get such behaviour, you an use &lt;a href=&quot;https://github.com/emacs-helm/helm-c-yasnippet&quot; rel=&quot;nofollow&quot;&gt;helm-c-yasnippet&lt;/a&gt;. Using the command &lt;code&gt;helm-yas-complete&lt;/code&gt; in you case, it will do exactly what you want: gives a list of candidates available in &lt;code&gt;yasnippet&lt;/code&gt; that start with the supplied prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, &lt;code&gt;yasnippet&lt;/code&gt; is bundled with common snippets. You can load more snippets with &lt;a href=&quot;https://github.com/madsdk/yasnippets-latex&quot; rel=&quot;nofollow&quot;&gt;yasnippets-latex&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-12-22T03:01:47.027" LastActivityDate="2014-12-22T03:01:47.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5632" PostTypeId="1" AcceptedAnswerId="5642" CreationDate="2014-12-22T04:41:39.270" Score="9" ViewCount="3729" Body="&lt;p&gt;I want to input 90 number-series starts from 1, here is what I did:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set-mark&#xA;type enter 90 times&#xA;C-u C-x r N Enter %3d Enter&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output is like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 &#xA;2 &#xA;3 &#xA;4 &#xA;5 &#xA;6 &#xA;7 &#xA;....&#xA;90&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to set the amount of output? (I don't want to hit enter / or hold enter for 90 times.)&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2022-11-26T09:33:48.890" Title="How to input number-series (with appointed amount) in Emacs?" Tags="|rectangle|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5633" PostTypeId="2" ParentId="5632" CreationDate="2014-12-22T04:51:53.357" Score="7" Body="&lt;p&gt;You can use a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot;&gt;numeric argument&lt;/a&gt; to avoid typing &lt;code&gt;RET&lt;/code&gt; &lt;code&gt;90&lt;/code&gt; times. Just do &lt;code&gt;M-9 0 RET&lt;/code&gt; to insert &lt;code&gt;90&lt;/code&gt; newlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can write a simple function that creates a range of numbers and loops over them using &lt;code&gt;number-sequence&lt;/code&gt; and &lt;code&gt;dolist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-numbers (start end)&#xA;  (interactive &quot;nStart: \nnEnd: &quot;)&#xA;  (dolist (ind (number-sequence start end))&#xA;    (insert (format &quot;%d\n&quot; ind))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2014-12-22T05:15:04.783" LastActivityDate="2014-12-22T05:15:04.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5634" PostTypeId="2" ParentId="5632" CreationDate="2014-12-22T04:56:09.020" Score="11" Body="&lt;p&gt;As another answer suggests, you can insert 90 new lines using prefix argument &lt;code&gt;90&lt;/code&gt; like this: &lt;code&gt;C-u 90 RET&lt;/code&gt;. Then insert the number list using &lt;code&gt;C-u C-x r N&lt;/code&gt; as you did. However, if you want a more flexible format of numbered list, you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macro-Counter.html&quot;&gt;Keyboard Macro counter&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I included some exercises in &lt;a href=&quot;http://tuhdo.github.io/emacs-tutor.html#sec-7-31-2&quot;&gt;my guide&lt;/a&gt;. Here is one:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Exercise 1&lt;/strong&gt;: Creating incremental header prefix&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Format specification is useful for making formatted output with macro,&#xA;  combine with the counter, it is useful for appending numbered prefix&#xA;  at beginning of line. For example: We usually write code comment that&#xA;  describes sequential steps in a high level point of view like this:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Step 1 of 5: ...&lt;/li&gt;&#xA;  &lt;li&gt;Step 2 of 5: ...&lt;/li&gt;&#xA;  &lt;li&gt;Step 3 of 5: ...&lt;/li&gt;&#xA;  &lt;li&gt;Step 4 of 5: ...&lt;/li&gt;&#xA;  &lt;li&gt;Step 5 of 5: ...&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;Keyboard macro can help us generate such text pattern effortlessly.&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;kbd&gt;C-x C-k C-f&lt;/kbd&gt; and enter this format: &lt;code&gt;- Step %d of 5:&lt;/code&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;kbd&gt;F3&lt;/kbd&gt; to start recording.&lt;/li&gt;&#xA;  &lt;li&gt;&lt;kbd&gt;F3&lt;/kbd&gt; again to insert the first counter value, which is &lt;code&gt;- Step 0 of 5:&lt;/code&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;kbd&gt;RET&lt;/kbd&gt; to move to the next line.&lt;/li&gt;&#xA;  &lt;li&gt;&lt;kbd&gt;F4&lt;/kbd&gt; to stop recording.&lt;/li&gt;&#xA;  &lt;li&gt;Now press &lt;kbd&gt;F4&lt;/kbd&gt; as many time as you want and see header prefix got inserted with incremental values.&#xA;  You can insert the text any value by simply set the counter with &lt;kbd&gt;C-x C-k C-c&lt;/kbd&gt;.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;Remember to use this the next time you write comments for your code&#xA;  that need an ordered list to describe the steps of your algorithm.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Of course, instead of enter &lt;code&gt;- Step %d of 5:&lt;/code&gt;, you can just enter &lt;code&gt;%d&lt;/code&gt;. If you want the macro to repeat 90 times, just supply &lt;code&gt;90&lt;/code&gt; as prefix argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make it easier for you to use macro, remember that all macro commands have &lt;kbd&gt;C-x C-k&lt;/kbd&gt; as prefix.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-12-22T06:09:41.943" LastActivityDate="2014-12-22T06:09:41.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5635" PostTypeId="2" ParentId="5632" CreationDate="2014-12-22T05:50:16.993" Score="8" Body="&lt;p&gt;Tu Do's answer is very good and well worth remembering for custom counter formatting, but potentially (depending on the actual use-case) a little excessive for this particular example, given that &lt;code&gt;%d&lt;/code&gt; is the &lt;em&gt;default&lt;/em&gt; format for the counter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output can therefore be achieved like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-1&lt;/kbd&gt;&lt;kbd&gt;F3&lt;/kbd&gt;&lt;kbd&gt;F3&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;kbd&gt;M-9&lt;/kbd&gt;&lt;kbd&gt;M-0&lt;/kbd&gt;&lt;kbd&gt;F4&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-12-22T11:02:14.223" LastActivityDate="2014-12-22T11:02:14.223" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5636" PostTypeId="1" AcceptedAnswerId="5639" CreationDate="2014-12-22T06:44:01.973" Score="9" ViewCount="927" Body="&lt;p&gt;This buffer annoys me every time I install a new package or update one with package.el:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WWsQx.png&quot; alt=&quot;screen-shot of the buffer&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell to emacs that never ever show that buffer unless I need to know something really important from it? &lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-05-12T20:50:21.557" Title="when installing a package with package.el, How to never show the compile log buffer?" Tags="|package|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5637" PostTypeId="2" ParentId="5632" CreationDate="2014-12-22T06:49:47.210" Score="2" Body="&lt;p&gt;Just for the sake of diversity:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x * c&lt;/kbd&gt; (Starts the calculator).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;1&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;kbd&gt;v b&lt;/kbd&gt;&lt;code&gt;90&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; creates a vector 90 elements long.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;V U +&lt;/kbd&gt; calls to &lt;code&gt;accum&lt;/code&gt; Calc function which acts similar to reduce, putting the intermediate results into positions of the elements which generate those. At this point you have a vector which looks like &lt;code&gt;[1, 2, .... 89, 90]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Copy the vector into the file you are editing.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x f&lt;/kbd&gt;&lt;code&gt;3&lt;/code&gt; this will set &lt;code&gt;fill-column&lt;/code&gt; to be 3 elements wide.&lt;/li&gt;&#xA;&lt;li&gt;Select the contents of the vector and press &lt;kbd&gt;M-q&lt;/kbd&gt; to fill paragraph (this will put every number on a separate line.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is obviously more cumbersome than just using a recorded macro, but it has its perks in that you can create more complicated number sequences :)&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2014-12-22T06:49:47.210" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5638" PostTypeId="2" ParentId="5636" CreationDate="2014-12-22T07:28:12.210" Score="1" Body="&lt;p&gt;From documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;set-window-dedicated-p is a built-in function in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(set-window-dedicated-p WINDOW FLAG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Mark WINDOW as dedicated according to FLAG. WINDOW must be a live&#xA;  window and defaults to the selected one.  FLAG non-nil means mark&#xA;  WINDOW as dedicated to its buffer.  FLAG nil means mark WINDOW as&#xA;  non-dedicated.  Return FLAG.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You may be interested by setting the installation window &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Dedicated-Windows.html&quot; rel=&quot;nofollow&quot;&gt;dedicated&lt;/a&gt;, then the compilation buffer will no more bother you when inside the dedicated window.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-12-22T07:28:12.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5639" PostTypeId="2" ParentId="5636" CreationDate="2014-12-22T08:24:11.553" Score="4" Body="&lt;p&gt;If your &lt;code&gt;package--compile&lt;/code&gt; is calling &lt;code&gt;byte-recompile-directory&lt;/code&gt;(default), you can turn off all warnings by customizing the variable &lt;code&gt;byte-compile-warnings&lt;/code&gt;. You can either set it to &lt;code&gt;nil&lt;/code&gt; yourself, or use &lt;code&gt;M-x customize-group&lt;/code&gt; on the group &lt;code&gt;bytecomp&lt;/code&gt;, set &lt;code&gt;Byte Compile Warnings&lt;/code&gt; to &lt;code&gt;Some&lt;/code&gt; and check none of the boxes. However, if you have &lt;code&gt;package--compile&lt;/code&gt; being &lt;code&gt;defadvice&lt;/code&gt;d to invoke something else(&lt;code&gt;async-byte-recompile-directory&lt;/code&gt; in my case), you should look into the customization of that specific function/library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using &lt;code&gt;async-bytecomp&lt;/code&gt;, I have raised a request &lt;a href=&quot;https://github.com/jwiegley/emacs-async/issues/44&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to inject the &lt;code&gt;bytecomp&lt;/code&gt; customizations into the environment it compiles in. You could make do with a local change until there's a resolution : Add &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(async-inject-variables &quot;\\`byte-compile-warnings\\'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;,(async-inject-variables &quot;\\`load-path\\'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;async-bytecomp.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2014-12-24T04:57:07.700" LastActivityDate="2014-12-24T04:57:07.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5640" PostTypeId="2" ParentId="5443" CreationDate="2014-12-22T08:52:08.777" Score="1" Body="&lt;p&gt;Since there were no replies so far, apparently there's no magical&#xA;solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the solution I went with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply #'ediff-regions-internal&#xA;           `(,@(if (equal (selected-window)&#xA;                          (lispy--vertical-splitp))&#xA;                   (append e1 e2)&#xA;                   (append e2 e1))&#xA;               nil ediff-regions-linewise nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A utility function that might be of use to others:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun lispy--vertical-splitp ()&#xA;  &quot;Return nil if the frame isn't two vertical windows.&#xA;In case it is, return the left window.&quot;&#xA;  (let ((windows (window-list)))&#xA;    (when (= (length windows) 2)&#xA;      (let ((wnd1 (car windows))&#xA;            (wnd2 (cadr windows)))&#xA;        (when (= (window-pixel-top wnd1)&#xA;                 (window-pixel-top wnd2))&#xA;          (if (&amp;lt; (window-pixel-left wnd1)&#xA;                 (window-pixel-left wnd2))&#xA;              wnd1&#xA;            wnd2))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-22T08:52:08.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5642" PostTypeId="2" ParentId="5632" CreationDate="2014-12-22T11:44:11.487" Score="8" Body="&lt;p&gt;It's &lt;a href=&quot;https://github.com/abo-abo/tiny&quot;&gt;tiny&lt;/a&gt;'s time to shine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m\n90&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will expand (with &lt;code&gt;tiny-expand&lt;/code&gt;) to what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also rich formatting and templating that can be applied.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;m5|%02d&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;00 01 02 03 04 05&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;m7|%(expt 2 x)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 2 4 8 16 32 64 128&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;m1\n5|*** TODO http://emacsrocks.com/e%02d.html&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** TODO http://emacsrocks.com/e01.html&#xA;*** TODO http://emacsrocks.com/e02.html&#xA;*** TODO http://emacsrocks.com/e03.html&#xA;*** TODO http://emacsrocks.com/e04.html&#xA;*** TODO http://emacsrocks.com/e05.html&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;m\n3|* TODO Wash dog\nDEADLINE: &amp;lt;%(date &quot;Oct 14&quot; (* x 4))&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Wash dog&#xA;DEADLINE: &amp;lt;2015-10-14 Wed&amp;gt;&#xA;* TODO Wash dog&#xA;DEADLINE: &amp;lt;2015-10-18 Sun&amp;gt;&#xA;* TODO Wash dog&#xA;DEADLINE: &amp;lt;2015-10-22 Thu&amp;gt;&#xA;* TODO Wash dog&#xA;DEADLINE: &amp;lt;2015-10-26 Mon&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tiny&lt;/code&gt; is available in MELPA. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-22T11:44:11.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5644" PostTypeId="2" ParentId="5621" CreationDate="2014-12-22T13:08:31.413" Score="1" Body="&lt;p&gt;@Tyler's answer (&lt;code&gt;C-c C-e&lt;/code&gt;) is the simplest and most straightforward way to get environments insofar as it's the built-in way to use AUCTeX's functionality.  Since it gets you 99% of the way there, it seems like the way to go unless you &lt;em&gt;really&lt;/em&gt; need to do it auto-complete style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really wanted to, you could wrap that command in a snippet so that you could invoke it while typing (here, as &lt;code&gt;,env TAB&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: environment&#xA;# key: ,env&#xA;# type: command&#xA;# --&#xA;(call-interactively #'LaTeX-environment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, that's little more than a change of keybindings. (I use the snippet to minimize use of the &lt;kbd&gt;Control&lt;/kbd&gt; key, but YMMV.)  If, however, you're using &lt;code&gt;ido-mode&lt;/code&gt; (and particularly &lt;code&gt;ido-vertical-mode&lt;/code&gt;), it'll make the completion experience much more pleasant in either the stock (&lt;code&gt;C-c C-e&lt;/code&gt;) or snippet version.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-22T13:08:31.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5645" PostTypeId="1" CreationDate="2014-12-22T14:09:10.373" Score="2" ViewCount="726" Body="&lt;p&gt;By invoking &lt;code&gt;M-x ispell&lt;/code&gt;, ispell says that 'ij' in the following formula is incorrect. How to permanently prevent ispell from this behavior. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$\phi_{ij}$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2014-12-22T17:30:39.467" Title="How to prevent ispell from checking inside mathematical formulae" Tags="|latex|auctex|spell-checking|ispell|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5646" PostTypeId="1" CreationDate="2014-12-22T14:52:40.400" Score="9" ViewCount="1279" Body="&lt;p&gt;&lt;code&gt;display-battery-mode&lt;/code&gt; displays battery information, but I only want to use it when my computer is unplugged and running off battery power.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a way to set the display mode according to the power supply mode?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Can I also get the temperature reported in the modeline?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="253" LastEditDate="2014-12-22T17:16:57.097" LastActivityDate="2014-12-22T17:19:50.847" Title="Display battery information only when unplugged?" Tags="|mode-line|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5647" PostTypeId="1" AcceptedAnswerId="5654" CreationDate="2014-12-22T15:20:06.853" Score="22" ViewCount="13344" Body="&lt;p&gt;I want to input:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Celsius degree symbol&lt;/li&gt;&#xA;&lt;li&gt;Common Greek letter: Alpha, Theta, Omega&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-22T16:58:31.990" Title="How to input special character, such as Celsius symbol, and common greek letters?" Tags="|character-encoding|input-method|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5648" PostTypeId="2" ParentId="5647" CreationDate="2014-12-22T15:21:56.140" Score="2" Body="&lt;p&gt;I'm using this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-insert-char ()&#xA;  (interactive)&#xA;  (helm :sources&#xA;      `((name . &quot;Unicode char name&quot;)&#xA;        (candidates . ,(ucs-names))&#xA;        (action . insert))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-22T15:21:56.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5649" PostTypeId="1" AcceptedAnswerId="5650" CreationDate="2014-12-22T15:23:08.437" Score="12" ViewCount="1031" Body="&lt;p&gt;When Dired sorts files by name, it sorts in alphabetical order. That's fine with letters; however, when the file names start with numbers, it would be better to sort in numerical value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how dired sorts my files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10&#xA;11&#xA;12&#xA;13&#xA;...&#xA;1&#xA;21&#xA;22&#xA;23&#xA;...&#xA;2&#xA;31&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want 1 2 3 4 … 9 10 11 …&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="25" LastEditDate="2014-12-23T00:10:44.707" LastActivityDate="2014-12-23T01:41:28.747" Title="Sort file names (numbered) in dired" Tags="|dired|sorting|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5650" PostTypeId="2" ParentId="5649" CreationDate="2014-12-22T15:26:35.947" Score="15" Body="&lt;p&gt;Here's my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-listing-switches &quot;-laGh1v --group-directories-first&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The relevant part is &lt;code&gt;-1v&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-22T15:26:35.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5651" PostTypeId="2" ParentId="5645" CreationDate="2014-12-22T15:35:33.743" Score="3" Body="&lt;p&gt;After several attempts, I found the following solution. The code uses the ideas from  &lt;a href=&quot;http://tex.aspcode.net/view/635399273629833626130076/aspell-special-characters-and-math-mode&quot; rel=&quot;nofollow&quot;&gt;aspell - special characters and math mode&lt;/a&gt; and &lt;a href=&quot;http://home.thep.lu.se/~karlf/emacs.html&quot; rel=&quot;nofollow&quot;&gt;My .emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA;          '(lambda ()&#xA;             (setq ispell-tex-skip-alists&#xA;                   (list&#xA;                    (append&#xA;                     (car ispell-tex-skip-alists) &#xA;                     '((&quot;[^\\]\\$&quot; . &quot;[^\\]\\$&quot;)))&#xA;                    (cadr ispell-tex-skip-alists))) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2014-12-22T17:30:39.467" LastActivityDate="2014-12-22T17:30:39.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5652" PostTypeId="2" ParentId="5647" CreationDate="2014-12-22T15:39:02.293" Score="26" Body="&lt;p&gt;The standard Emacs way to do this is &lt;code&gt;C-x 8 RET&lt;/code&gt; followed by either the Unicode code point (a natural number) or the Unicode name of the character. Completion is available for the name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can complete the name using parts of it, with multiple patterns matching different parts, if you want. And you can see the characters themselves, next to their candidate names, in buffer &lt;code&gt;*Completions*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;C-x 8 RET cels S-RET&lt;/code&gt; completes to &lt;code&gt;DEGREE CELSIUS 2103 ℃&lt;/code&gt; and inserts that character, &lt;code&gt;℃&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2014-12-22T15:46:05.483" LastActivityDate="2014-12-22T15:46:05.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5653" PostTypeId="2" ParentId="3480" CreationDate="2014-12-22T16:20:47.983" Score="2" Body="&lt;p&gt;I've had the same problem. My solution was to write a simple &lt;em&gt;lint&lt;/em&gt;-type command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This adds the command &lt;code&gt;sh/org-lint&lt;/code&gt; which will iterate over all the buffers loaded from my agenda and check for this kind of problem. It lists the problems in a &lt;em&gt;compilation&lt;/em&gt; buffer, which means that you can just press RETURN to jump to the problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's pretty simplistic, and I keep meaning to improve it, but works well enough for me when I need to track down these kind of things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies in advance for my shocking elisp.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sh/org-lint-buffer ()&#xA;  &quot;Check for balanced BEGIN/END markers in the current Org-mode buffer.&#xA;&#xA; My edits (especially resolution of git merge conflicts) seem to&#xA; sometimes mess up the balancing of the ':BEGIN:' and ':END:'&#xA; markers in the file. Org-mode does report these as errors when&#xA; it's parsing the file (you can see the messages in the&#xA; '*Messages*' buffer), but it unhelpfully does not identify the&#xA; buffer where the problem has occurred. This function searches&#xA; through the current buffer and reports buffer and line positions&#xA; of the errors, which is much more useful.&quot;&#xA;&#xA;  ;; &amp;lt;START&amp;gt; markers are:&#xA;   ;;; LOGBOOK, PROPERTIES&#xA;  ;; Cases:&#xA;   ;;; &amp;lt;START&amp;gt; with no END before end of buffer&#xA;   ;;; &amp;lt;START&amp;gt; with no END before next &amp;lt;START&amp;gt;&#xA;   ;;; END before &amp;lt;START&amp;gt;&#xA;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (widen)&#xA;      (goto-char (point-min))&#xA;      (let ((previous-point (point))&#xA;            (next-max-point)&#xA;            (end-marker-re &quot;^:END:&quot;)&#xA;            (start-marker-re &quot;^:LOGBOOK:\\|:PROPERTIES:&quot;))&#xA;&#xA;        ;; Before we move to the first start block, we're now outside&#xA;        ;; of a BEGIN/END. If we find another END before the next&#xA;        ;; block then that is clearly an orphan.&#xA;        (save-excursion&#xA;          (save-excursion&#xA;            (setq next-max-point&#xA;                  (or (re-search-forward start-marker-re (point-max) t)&#xA;                      (point-max))))&#xA;          (if (re-search-forward end-marker-re next-max-point t)&#xA;              (sh/org-lint-error (buffer-file-name) (line-number-at-pos) &quot;orphaned END marker&quot;)))&#xA;&#xA;        ;; Loop until there are no more start markers.&#xA;        (while (re-search-forward start-marker-re nil t)&#xA;          ;; Try to find the END marker that matches this start&#xA;          ;; position and move to there.&#xA;          (save-excursion&#xA;            (setq next-max-point&#xA;                  (or (re-search-forward start-marker-re (point-max) t)&#xA;                      (point-max))))&#xA;          (unless (re-search-forward end-marker-re next-max-point t)&#xA;            (sh/org-lint-error (buffer-file-name) (line-number-at-pos) &quot;START without END&quot;))&#xA;&#xA;          ;; Move on.&#xA;          (setq previous-point (point))&#xA;&#xA;          ;; We're now outside of a BEGIN/END; if we find another END&#xA;          ;; before the next block then that is clearly an orphan.&#xA;          (save-excursion&#xA;            (save-excursion&#xA;              (setq next-max-point&#xA;                    (or (re-search-forward start-marker-re (point-max) t)&#xA;                        (point-max))))&#xA;            (if (re-search-forward end-marker-re next-max-point t)&#xA;                (sh/org-lint-error (buffer-file-name) (line-number-at-pos) &quot;orphaned END marker&quot;))))))))&#xA;&#xA;(defun sh/org-lint ()&#xA;  &quot;Check for balanced BEGIN/END markers in all Org-mode buffers.&#xA;&#xA; Apply Org-mode file structure and style checks to all Org-mode&#xA; buffers. See `sh/org-lint-buffer' for a description of the checks&#xA; performed.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (with-current-buffer (get-buffer-create &quot;*Org lint*&quot;)&#xA;      (read-only-mode 0)&#xA;      (erase-buffer)))&#xA;  (mapcar (lambda(buffer)&#xA;            (with-current-buffer buffer&#xA;              (if (eq major-mode 'org-mode)&#xA;                  (sh/org-lint-buffer))))&#xA;          (buffer-list))&#xA;  (when (buffer-size&#xA;         (with-current-buffer (get-buffer &quot;*Org lint*&quot;)&#xA;           (compilation-mode)&#xA;           (current-buffer)))&#xA;    (switch-to-buffer-other-window &quot;*Org lint*&quot;)))&#xA;&#xA;(defun sh/org-lint-error (buffer-name line-number error-message)&#xA;  &quot;Report an error when linting an Org-mode buffer.&#xA;&#xA; Reports ERROR-MESSAGE as being the problem reported for line&#xA; LINE-NUMBER in the buffer called BUFFER-NAME.&quot;&#xA;  (save-excursion&#xA;    (with-current-buffer (get-buffer-create &quot;*Org lint*&quot;)&#xA;      (insert&#xA;       (format &quot;%s:%d: %s\n&quot; buffer-name line-number error-message)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="737" LastActivityDate="2014-12-22T16:20:47.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5654" PostTypeId="2" ParentId="5647" CreationDate="2014-12-22T16:31:04.827" Score="21" Body="&lt;p&gt;If you are familiar with TeX, you will find the &lt;code&gt;TeX&lt;/code&gt; input method helpful.  Just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x set-input-method TeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then type something like &lt;code&gt;\alpha&lt;/code&gt; — it will be replaced with the corresponding Unicode character.  You can switch the input method off by typing &lt;code&gt;C-\&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find all the supported TeX commands with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x describe-input-method&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-12-22T16:31:04.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5655" PostTypeId="2" ParentId="5649" CreationDate="2014-12-22T16:38:47.147" Score="5" Body="&lt;p&gt;Besides @abo-abo answer, I just want to quote the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;dired-listing-switches&lt;/code&gt; is a variable defined in `dired.el'. Its value&#xA;  is &quot;-Al --si --time-style long-iso&quot;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Switches passed to &lt;code&gt;ls&lt;/code&gt; for Dired.  MUST contain the&#xA;  &lt;code&gt;l&lt;/code&gt; option. May contain all other options that don't contradict &lt;code&gt;-l&lt;/code&gt;;&#xA;  may contain even &lt;code&gt;F&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, &lt;code&gt;i&lt;/code&gt; and &lt;code&gt;s&lt;/code&gt;.  See also the variable&#xA;  &lt;code&gt;dired-ls-F-marks-symlinks&lt;/code&gt; concerning the &lt;code&gt;F&lt;/code&gt; switch. On systems such&#xA;  as MS-DOS and MS-Windows, which use &lt;code&gt;ls&lt;/code&gt; emulation in Lisp, some of&#xA;  the &lt;code&gt;ls&lt;/code&gt; switches are not supported; see the doc string of&#xA;  &lt;code&gt;insert-directory&lt;/code&gt; in &lt;code&gt;ls-lisp.el&lt;/code&gt; for more details.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Basically, you can customize the switches you want dired to use when calling &lt;code&gt;ls&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-12-22T16:38:47.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5656" PostTypeId="2" ParentId="5647" CreationDate="2014-12-22T16:58:31.990" Score="8" Body="&lt;p&gt;In addition to &lt;code&gt;C-x 8 RET&lt;/code&gt;, mentioned &lt;a href=&quot;https://emacs.stackexchange.com/a/5652/2274&quot;&gt;here&lt;/a&gt; that lets you insert any character by name, &lt;code&gt;C-x 8&lt;/code&gt; also has many shortcuts for inserting common characters. In this case, &lt;code&gt;C-x 8 o&lt;/code&gt; inserts &quot;°&quot;.  See them all with &lt;code&gt;C-x 8 C-h&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;C-x 8&lt;/code&gt; keymap is also a good place to define your own shortcuts to insert the characters you use most often.  The Greek letters aren't bound to keys by default, but we can add them with lines like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x 8 a&quot;) (lambda () (interactive) (insert &quot;α&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will make &lt;code&gt;C-x 8 a&lt;/code&gt; insert a &lt;code&gt;GREEK SMALL LETTER ALPHA&lt;/code&gt;.  I got the initial alpha in the &lt;code&gt;global-set-key&lt;/code&gt; line by using &lt;code&gt;C-x 8 RET&lt;/code&gt; and searching for &quot;alpha&quot;&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-12-22T16:58:31.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5657" PostTypeId="2" ParentId="5646" CreationDate="2014-12-22T17:04:57.253" Score="6" Body="&lt;p&gt;I'm not sure whether you can do that with the built-in &lt;code&gt;display-battery-mode&lt;/code&gt;.  It's not very customizable in this regard, and you may have to resort to heavy advises to change the built-in mode as you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote &lt;a href=&quot;https://github.com/lunaryorn/fancy-battery.el&quot;&gt;fancy-battery.el&lt;/a&gt; some time ago to provide a more customizable indicator for the battery status.  Notably, I wanted to indicate the state of the battery with colours, but the package is flexible enough to allow for your use case as well, by changing &lt;code&gt;fancy-battery-mode-line&lt;/code&gt; accordingly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq fancy-battery-mode-line&#xA;      '(:eval (unless (equal (cdr (assq ?b fancy-battery-last-status)) &quot;+&quot;)&#xA;                (fancy-battery-default-mode-line))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Don't ask, the status comes from battery.el, which has a horrible API.  Just trust me that &lt;code&gt;?b&lt;/code&gt; is the battery state, and &lt;code&gt;&quot;+&quot;&lt;/code&gt; indicates charging, for most backends at least.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This setting will show the battery status, but only if the battery is discharging.  To use another format, write your own function to replace &lt;code&gt;fancy-battery-default-mode-line&lt;/code&gt;.  Feel free to take mine as inspritation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the temperature, you may have luck with a different backend.  Take a look at the existing backends in &lt;code&gt;battery.el&lt;/code&gt;, search for one that includes battery temperature and try to fulfil it's requirements.  However, &lt;code&gt;battery.el&lt;/code&gt; typically succeeds at picking the best backend for your system, so quite likely your hardware simply does not report the battery temperature, or is not properly supported by your OS.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-22T17:04:57.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5658" PostTypeId="2" ParentId="5646" CreationDate="2014-12-22T17:19:50.847" Score="2" Body="&lt;p&gt;You can achieve this by advicing &lt;code&gt;battery-update&lt;/code&gt;, the function which actually updates the modeline to display battery status. The advice checks if the battery is currently charging in which case it calls &lt;code&gt;battery-update&lt;/code&gt; with &lt;code&gt;battery-mode-line-format&lt;/code&gt; bound to &lt;code&gt;nil&lt;/code&gt; (which in effect hides the battery information), otherwise &lt;code&gt;battery-update&lt;/code&gt; is called with unchanged value of &lt;code&gt;battery-mode-line-format&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-skip-battery-display-if-charging (original-func)&#xA;  (let ((battery-mode-line-format (unless (string= (downcase (cdr (assoc ?B (funcall battery-status-function)))) &quot;charging&quot;)&#xA;                                    battery-mode-line-format)))&#xA;          (funcall original-func)))&#xA;&#xA;(advice-add 'battery-update :around #'my-skip-battery-display-if-charging)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advice is a bit clunky since we call &lt;code&gt;battery-status-function&lt;/code&gt; once while the &lt;code&gt;buffer-update&lt;/code&gt; function already calls that function once so we are making one extra function call but this is what I could come up with.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-22T17:19:50.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5659" PostTypeId="1" AcceptedAnswerId="5660" CreationDate="2014-12-22T17:32:18.867" Score="19" ViewCount="11535" Body="&lt;p&gt;I'm unsure how to use checkboxes in Emacs. I'm using Emacs 24.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Checkboxes.html&quot;&gt;documentation&lt;/a&gt; suggests the use of &lt;code&gt;org-toggle-checkbox&lt;/code&gt; as &quot;With a single prefix argument, add an empty checkbox...&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried starting with an existing list (with org-mode as the major mode), as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* shopping list&#xA;** eggs&#xA;** bread&#xA;** Tesla Model S&#xA;** bacon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whether I put point in &quot;shopping list&quot;, or in &quot;eggs&quot;, pressing &lt;code&gt;C-u C-c C-x C-b&lt;/code&gt; (which runs &lt;code&gt;org-toggle-checkbox&lt;/code&gt;) results in the error &quot;No item in subtree&quot; being printed to the minibuffer. This behavior happens without my init file (&lt;code&gt;emacs -Q&lt;/code&gt;), so it's purely an org-mode issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the right way to start using checkboxes? &lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2022-02-16T17:12:22.903" Title="How do I use org-mode's checkboxes?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5660" PostTypeId="2" ParentId="5659" CreationDate="2014-12-22T17:44:06.567" Score="27" Body="&lt;p&gt;As the manual link states, checkboxes only work in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Plain-Lists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;plain lists&lt;/a&gt;.  Your example uses &lt;a href=&quot;http://orgmode.org/manual/Headlines.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;headlines&lt;/a&gt;.  You need to use the checkboxes this way:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* shopping list&#xA;&#xA;  - eggs&#xA;  - bread&#xA;  - Tesla Model S&#xA;  - bacon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now, when you're on &amp;quot;eggs&amp;quot;, you can hit &lt;code&gt;C-u C-c C-c&lt;/code&gt; (&lt;code&gt;C-u C-c C-x C-b&lt;/code&gt; also works) to toggle the checkbox.  &lt;code&gt;C-c C-c&lt;/code&gt; will then toggle whether the checkbox is checked or not.&lt;/p&gt;&#xA;&lt;p&gt;If you are already in a checkbox list, then &lt;code&gt;M-S-RET&lt;/code&gt; will add a new item with a checkbox.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="37285" LastEditDate="2022-02-16T17:12:22.903" LastActivityDate="2022-02-16T17:12:22.903" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="5662" PostTypeId="1" CreationDate="2014-12-22T20:03:58.163" Score="2" ViewCount="1012" Body="&lt;p&gt;When I run &lt;code&gt;GET http://localhost/&lt;/code&gt; with &lt;a href=&quot;https://github.com/pashky/restclient.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;restclient.el&lt;/code&gt;&lt;/a&gt;, I get the following error in the &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GET http://localhost:80/]&#xA;Contacting host: localhost:80&#xA;error in process sentinel: restclient-http-handle-response: peculiar error: &quot;failed with code 111&#xA;&quot;, :host, &quot;localhost&quot;, :service, 80&#xA;error in process sentinel: peculiar error: &quot;failed with code 111&#xA;&quot;, :host, &quot;localhost&quot;, :service, 80&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the repeated error on the single invocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run &lt;code&gt;(setq debug-on-message &quot;failed with code 111&quot;)&lt;/code&gt; I get the following backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: &quot;error in process sentinel: peculiar error: \&quot;failed with code 111&#xA;\&quot;, :host, \&quot;localhost\&quot;, :service, 80&quot;&#xA;  recursive-edit()&#xA;  debug(error &quot;error in process sentinel: peculiar error: \&quot;failed with code 111\n\&quot;, :host, \&quot;localhost\&quot;, :service, 80&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is code 111, and how can I fix the failure?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="2355" LastEditDate="2014-12-22T20:29:11.407" LastActivityDate="2015-02-20T21:32:05.793" Title="restclient errors &quot;failed with code 111&quot;" Tags="|debugging|restclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5663" PostTypeId="2" ParentId="5662" CreationDate="2014-12-22T20:26:43.223" Score="3" Body="&lt;p&gt;Error 111 refers to Linux system error &lt;code&gt;ECONNREFUSED&lt;/code&gt; (connection refused), defined in &lt;code&gt;errno.h&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not a problem with Emacs. Rather, the socket at &lt;code&gt;localhost:80&lt;/code&gt; is refusing the connection, possibly because no web server is running.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-12-22T20:26:43.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5664" PostTypeId="1" CreationDate="2014-12-22T21:13:52.313" Score="4" ViewCount="1295" Body="&lt;p&gt;I am in &lt;code&gt;shell-mode&lt;/code&gt; with &lt;code&gt;bash-completion&lt;/code&gt; enabled. When I attempt tab completion, Emacs creates a new window to display completions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I am in a directory with subdirectories &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;foobar&lt;/code&gt;, and I type &lt;code&gt;cd foo TAB&lt;/code&gt;, Emacs will open a new buffer with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Click on a completion to select it.&#xA;In this buffer, type RET to select the completion near point.&#xA;&#xA;Possible completions are:&#xA;foo/&#xA;foobar/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I &lt;kbd&gt;C-x o&lt;/kbd&gt; into the other window and select a completion, then the window disappears. However, that takes a few keystrokes, so sometimes I end up instinctively completing the path myself. If I do that, the window sticks around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I improve this workflow so that my shell stops generating extra windows? I didn't want to make this an XY problem, but I can think of a few ways. One idea would be to hide the window if I keep typing. Something better would be to hook the completion results into &lt;code&gt;ido&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2015-01-22T20:04:05.313" LastActivityDate="2015-01-22T20:04:05.313" Title="Shell bash completion window" Tags="|completion|shell-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5665" PostTypeId="1" AcceptedAnswerId="5667" CreationDate="2014-12-22T21:23:29.943" Score="14" ViewCount="3141" Body="&lt;p&gt;When using custom &lt;code&gt;company&lt;/code&gt; backends, &lt;code&gt;company-complete&lt;/code&gt; ends up returning no completions due to a misbehaving backend. In such cases, it would be helpful to know out which company backend was used to generate the list of completions. How do I get this information after a &lt;code&gt;company-complete&lt;/code&gt; invocation?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2020-01-01T08:18:58.390" Title="Find out backend used in company completion" Tags="|company-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5666" PostTypeId="1" AcceptedAnswerId="5788" CreationDate="2014-12-22T21:25:49.157" Score="7" ViewCount="567" Body="&lt;p&gt;I am looking for an example, please, to programmatically control the order of functions within a particular hook:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First in time, which is easy -- i.e., don't append using &lt;code&gt;add-hook&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Last in time, which is easy -- i.e., append using &lt;code&gt;add-hook&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Second to last -- not so easy?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the context of this particular question, there are three (3) functions assigned to the &lt;code&gt;post-command-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;An overlay removal function, which must always be &lt;em&gt;first&lt;/em&gt; in time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A &lt;code&gt;flyspell-post-command-hook&lt;/code&gt; function that must always be &lt;em&gt;last&lt;/em&gt; in time -- &lt;strong&gt;if&lt;/strong&gt; &lt;code&gt;flyspell-mode&lt;/code&gt; is active.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A overlay placement function that must be &lt;em&gt;last&lt;/em&gt; in time when &lt;code&gt;flyspell-mode&lt;/code&gt; is not active, or &lt;em&gt;second to last&lt;/em&gt; when &lt;code&gt;flyspell-mode&lt;/code&gt; is active.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Essentially, I would like to control the overlay placement function to programmatically check to see whether &lt;code&gt;flyspell-mode&lt;/code&gt; is active, and if so, then place it &lt;em&gt;second to last&lt;/em&gt;.  If &lt;code&gt;flyspell-mode&lt;/code&gt; is not active, then just append so that the overlay placement function becomes the last in the hook.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-12-28T20:19:50.507" Title="Programmatically controlling the order of functions within a hook" Tags="|hooks|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5667" PostTypeId="2" ParentId="5665" CreationDate="2014-12-22T21:48:45.940" Score="9" Body="&lt;p&gt;&lt;code&gt;company&lt;/code&gt; has a very useful feature that modifies its modeline lighter to display the backend currently in use.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-22T21:48:45.940" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5668" PostTypeId="1" AcceptedAnswerId="5679" CreationDate="2014-12-22T21:55:09.013" Score="3" ViewCount="942" Body="&lt;p&gt;While I'm able to display the cute little snowman ☃ in both GUI and terminal I'm not able to display these unicode characters in the terminal although it works in the GUI : Ⓐ Ⓑ ...&#xA;I've got the usual blank squares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the same font (DejaVu Sans Mono or Source Code Pro) in both GUI and terminal. The terminal is rxvt-unicode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My coding settings are all &lt;code&gt;utf-8&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does little snowman work and circled letters don't ? Is this because we are in winter ? :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;describe-char&lt;/code&gt; for Ⓐ:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            position: 7194 of 78709 (9%), column: 47                                                                                                                              &#xA;            character: Ⓐ (displayed as Ⓐ) (codepoint 9398, #o22266, #x24b6)                                                                                                        &#xA;    preferred charset: unicode (Unicode (ISO10646))                                                                                                                                 &#xA;&#xA;code point in charset: 0x24B6                                                                                                                                                      &#xA;               script: symbol                                                                                                                                                      &#xA;               syntax: w  which means: word                                                                                                                                        &#xA;             category: .:Base, L:Left-to-right (strong), l:Latin                                                                                                                   &#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;                                                                                                          &#xA;          buffer code: #xE2 #x92 #xB6                                                                                                                                              &#xA;            file code: #xE2 #x92 #xB6 (encoded by coding system utf-8-unix)                                                                                                        &#xA;              display: terminal code #xE2 #x92 #xB6                                                                                                                                                                                      &#xA;&#xA;Character code properties: customize what to show                                                                                                                                  &#xA;  name: CIRCLED LATIN CAPITAL LETTER A                                                                                                                                             &#xA;  general-category: So (Symbol, Other)                                                                                                                                             &#xA;  decomposition: (circle 65) (circle 'A')                                                                                                                                                                                                                                                                                                                              &#xA;&#xA;There are text properties here:                                                                                                                                                    &#xA;  face                 font-lock-string-face                                                                                                                                       &#xA;  fontified            t                                                                                                                                                           &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;GUI:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            position: 7194 of 78709 (9%), column: 47&#xA;            character: Ⓐ (displayed as Ⓐ) (codepoint 9398, #o22266, #x24b6)&#xA;    preferred charset: unicode (Unicode (ISO10646))&#xA;&#xA;code point in charset: 0x24B6&#xA;               script: symbol&#xA;               syntax: w    which means: word&#xA;             category: .:Base, L:Left-to-right (strong), l:Latin&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #xE2 #x92 #xB6&#xA;            file code: #xE2 #x92 #xB6 (encoded by coding system utf-8-unix)&#xA;              display: by this font (glyph code)&#xA;    xft:-unknown-Apple SD Gothic Neo-normal-normal-normal-*-13-*-*-*-*-0-iso10646-1 (#x20C4)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: CIRCLED LATIN CAPITAL LETTER A&#xA;  general-category: So (Symbol, Other)&#xA;  decomposition: (circle 65) (circle 'A')&#xA;&#xA;There are text properties here:&#xA;  face                 font-lock-string-face&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Here is my working Xdefaults settings for an Ubuntu box:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;URxvt.font: xft:Source Code Pro:pixelsize=13, \&#xA;            xft:Nanum Pen Script:pixelsize=9:antialias=true&#xA;URxvt.letterSpace: -1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope it will save some time to other people ☃☃☃&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2014-12-23T19:06:58.043" LastActivityDate="2014-12-23T19:06:58.043" Title="Unicode characters with same font produce different results in GUI and terminal" Tags="|character-encoding|term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5669" PostTypeId="1" AcceptedAnswerId="5687" CreationDate="2014-12-22T23:57:15.573" Score="9" ViewCount="2527" Body="&lt;p&gt;I'm using org-mode to generate web pages of my notes.  Can I embed code to generate additional HTML, etc?  org-babel will generate results but it seems to show the results in addition to the code. I would like the code to create html that would replace the code itself.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2022-03-31T14:09:20.283" Title="Can org-babel replace code with code output on html export?" Tags="|org-mode|org-babel|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5670" PostTypeId="2" ParentId="5649" CreationDate="2014-12-23T01:41:28.747" Score="3" Body="&lt;p&gt;The given answers are better for this precise problem because they hook directly into the behavior of Dired. However for generality's sake I want to mention the &lt;code&gt;sort-numeric-fields&lt;/code&gt; command, which is specifically for sorting numbers by magnitude rather than lexicographically.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(sort-numeric-fields FIELD BEG END)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Sort lines in region numerically by the &lt;code&gt;ARG&lt;/code&gt;th field of each line. Fields are separated by whitespace and numbered from 1 up. Specified field must contain a number in each line of the region, which may begin with &quot;0x&quot; or &quot;0&quot; for hexadecimal and octal values. Otherwise, the number is interpreted according to &lt;code&gt;sort-numeric-base&lt;/code&gt;. With a negative arg, sorts by the &lt;code&gt;ARG&lt;/code&gt;th field counted from the right. Called from a program, there are three arguments: &lt;code&gt;FIELD&lt;/code&gt;, &lt;code&gt;BEG&lt;/code&gt; and &lt;code&gt;END&lt;/code&gt;.  &lt;code&gt;BEG&lt;/code&gt; and &lt;code&gt;END&lt;/code&gt; specify region to sort.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="594" LastActivityDate="2014-12-23T01:41:28.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5672" PostTypeId="2" ParentId="5664" CreationDate="2014-12-23T02:41:24.237" Score="5" Body="&lt;p&gt;I would recommend you to try out &lt;a href=&quot;https://github.com/company-mode/company-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-mode&lt;/a&gt;. It has a built-in backend &lt;code&gt;company-capf&lt;/code&gt; which fetches completion candidates from emacs' &lt;code&gt;completion-at-point-functions&lt;/code&gt; (the same mechanism that powers completion in the shell) as such completion offered by company are as accurate as the built-in shell-mode while making the user interface is very convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can activate it as follows &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;shell&quot;&#xA;  '(define-key shell-mode-map (kbd &quot;TAB&quot;) #'company-complete))&#xA;(add-hook 'shell-mode-hook #'company-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that I have rebound &lt;kbd&gt;tab&lt;/kbd&gt; to &lt;code&gt;company-complete&lt;/code&gt; so that hitting tab pops up company completion menu rather than the built-in completions buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/users/739/ehvince&quot;&gt;Ehvince&lt;/a&gt; has put a nice screenshot on &lt;a href=&quot;http://wikemacs.org/wiki/Shell#Shell_completion_with_a_nice_menu_.C3.A0_la_zsh&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikiemacs&lt;/a&gt; about the above in action&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is to use &lt;code&gt;helm&lt;/code&gt;, if you enable helm by doing &lt;code&gt;(helm-mode +1)&lt;/code&gt; it replaces the default completion mechanism with its own more pleasant completion system.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2014-12-28T15:11:00.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5673" PostTypeId="1" AcceptedAnswerId="5678" CreationDate="2014-12-23T04:27:40.577" Score="3" ViewCount="1005" Body="&lt;p&gt;There are several methods to install and manage packages for Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;package.el &lt;/li&gt;&#xA;&lt;li&gt;el-get &lt;/li&gt;&#xA;&lt;li&gt;use-package&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the easiest way to install package? It seems package.el ships with the default Emacs installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried use-package, each time I start Emacs, it will take a few second to contact hosts like melpa...&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-23T06:49:53.260" Title="What is the standard way to install packages for Emacs?" Tags="|package|package-repositories|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5674" PostTypeId="1" AcceptedAnswerId="5675" CreationDate="2014-12-23T04:43:37.373" Score="0" ViewCount="144" Body="&lt;p&gt;Is it possible to &lt;em&gt;interactively&lt;/em&gt; pass an argument that matches &lt;code&gt;listp&lt;/code&gt; to the function &lt;code&gt;yank&lt;/code&gt; so that &lt;code&gt;current-kill&lt;/code&gt; receives an argument of &lt;code&gt;0&lt;/code&gt;?  If so, how please can that be achieved?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;multiple-cursors&lt;/code&gt; ( &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magnars/multiple-cursors.el&lt;/a&gt; ) and frequently find the need to block and copy information from another Emacs buffer while &lt;code&gt;multiple-cursors&lt;/code&gt; remains active.  Then, I switch back to the buffer where &lt;code&gt;multiple-cursors&lt;/code&gt; is active, and I try to paste the same information to every cursor.  Unless &lt;code&gt;current-kill&lt;/code&gt; (within the &lt;code&gt;yank&lt;/code&gt; function) receives an argument of &lt;code&gt;0&lt;/code&gt;, the first cursor receives the paste and then an error message is generated by &lt;code&gt;current-kill&lt;/code&gt; -- i.e., &lt;code&gt;The kill-ring is empty.&lt;/code&gt;  The error message is caused due to the failure of passing a &lt;code&gt;listp arg&lt;/code&gt; to &lt;code&gt;yank&lt;/code&gt; when interactively using same -- i.e., from a kebboard shortcut.  The default argument within &lt;code&gt;yank&lt;/code&gt; (when no argument is given) is &lt;code&gt;(1- arg)&lt;/code&gt; -- and that is what causes the error message.  If &lt;code&gt;yank&lt;/code&gt; had been called with a &lt;code&gt;listp arg&lt;/code&gt;, then &lt;code&gt;current-kill&lt;/code&gt; would have received a &lt;code&gt;0&lt;/code&gt; and everything would have worked as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not understand when the default of &lt;code&gt;(1- arg)&lt;/code&gt; would be helpful, but changing that to &lt;code&gt;0&lt;/code&gt; (i.e., hacking &lt;code&gt;yank&lt;/code&gt;) avoids the error message and achieves the desired effect.  If possible, I would prefer to avoid hacking &lt;code&gt;yank&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although not essential to this question, it sure would be nice to know an example where &lt;code&gt;(1- arg)&lt;/code&gt; could be useful.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;P.S.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is now resolved, but I wanted to add the explanation of &lt;code&gt;(1- arg)&lt;/code&gt; within the function &lt;code&gt;yank&lt;/code&gt;.  &lt;code&gt;(1- arg)&lt;/code&gt; is the nth entry in the kill-ring, which can be accessed when the &lt;code&gt;arg&lt;/code&gt; is not a &lt;code&gt;list&lt;/code&gt; or &lt;code&gt;-&lt;/code&gt;.  There is an apparent bug in the &lt;code&gt;yank&lt;/code&gt; function in the October 1, 2014 build of Emacs Trunk (which may be present in other versions) -- i.e., at the outset of &lt;code&gt;yank&lt;/code&gt;, there should be &lt;code&gt;(unless arg (setq arg 1))&lt;/code&gt; [&lt;em&gt;which is missing&lt;/em&gt;].  I'll make a note on my todo-list to check a current version of Emacs Trunk and then file a bug-report if it is missing in the latest build also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to copying and pasting the same entry at multiple active cursors, additional code is needed when copying from within Emacs versus copying from an external program.  The author of multiple-cursors has already included a revision of &lt;code&gt;current-kill&lt;/code&gt; through an &lt;code&gt;advice&lt;/code&gt; for the external kill-ring -- similar code is needed for copying from within Emacs -- however, that is beyond the scope of this particular question.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="25" LastEditDate="2014-12-25T00:20:49.187" LastActivityDate="2014-12-25T00:20:49.187" Title="How to interactivelly pass a `listp arg` to `yank`" Tags="|interactive|yank|prefix-argument|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5675" PostTypeId="2" ParentId="5674" CreationDate="2014-12-23T05:01:06.183" Score="2" Body="&lt;p&gt;Use &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-y&lt;/kbd&gt; to to interactively pass a &lt;code&gt;listp arg&lt;/code&gt; to &lt;code&gt;yank&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;yank&lt;/code&gt; uses &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt; which means the prefix argument is passed in &lt;strong&gt;raw&lt;/strong&gt; form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a prefix arg is supplied via one or more &lt;kbd&gt;C-u&lt;/kbd&gt; presses (only), the raw form of the argument is a list: &lt;code&gt;(4)&lt;/code&gt; or &lt;code&gt;(16)&lt;/code&gt; or &lt;code&gt;(64)&lt;/code&gt;, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And similarly for the &lt;code&gt;-&lt;/code&gt; argument, which is also tested for explicitly in this function.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Prefix Command Arguments&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the varied behaviour described by the function's docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;With just C-u as argument, put point at beginning, and mark at end.&#xA;With argument N, reinsert the Nth most recent kill.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2014-12-23T05:15:09.993" LastActivityDate="2014-12-23T05:15:09.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5676" PostTypeId="1" AcceptedAnswerId="5680" CreationDate="2014-12-23T06:15:52.853" Score="6" ViewCount="731" Body="&lt;p&gt;I have some work that requires I move around between various sub-directories. Thus, the easiest way I have found to do that is to use &lt;code&gt;dired&lt;/code&gt;. I also have to view some files (plain text or code), so another benefit is I can just hit &lt;code&gt;RET&lt;/code&gt; on the filename to do that. However, I sometimes need to run shell commands on these files. Before I used Emacs, I would just use Bash (navigating with &lt;code&gt;pushd&lt;/code&gt; and &lt;code&gt;popd&lt;/code&gt;, which is less convenient than &lt;code&gt;dired&lt;/code&gt;), so this allowed me to run the commands I needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I easily combine the best of both methods? I see a couple options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Somehow keep a &lt;code&gt;shell&lt;/code&gt; buffer in sync with the &lt;code&gt;dired&lt;/code&gt; buffer. (Maybe somehow trigger &lt;code&gt;pushd&lt;/code&gt;/&lt;code&gt;popd&lt;/code&gt;/&lt;code&gt;cd&lt;/code&gt;?)&lt;/li&gt;&#xA;&lt;li&gt;Set up some keyboard shortcuts for the &lt;code&gt;shell&lt;/code&gt; buffer, to simulate movement and file viewing (the latter especially seems more difficult).&lt;/li&gt;&#xA;&lt;li&gt;Something else?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that I would prefer not to call &lt;code&gt;shell-command&lt;/code&gt; (&lt;code&gt;M-!&lt;/code&gt;) every time, because it is harder to execute multiple commands in quick succession, and interact with the command output, in addition to having a less-than-convenient default keybinding.&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2014-12-23T06:23:24.467" LastActivityDate="2015-04-06T21:49:13.823" Title="How can I keep dired in sync with a shell buffer?" Tags="|dired|shell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5677" PostTypeId="2" ParentId="5469" CreationDate="2014-12-23T06:18:29.420" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/punchagan/org2blog/issues/176&quot; rel=&quot;nofollow&quot;&gt;https://github.com/punchagan/org2blog/issues/176&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;punchagan writes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This bug seems to have been fixed on Emacs master. As a work around you could add the latest code of url-cookie-expired-p to your .emacs&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun url-cookie-expired-p (cookie)&#xA;  &quot;Return non-nil if COOKIE is expired.&quot;&#xA;  (let ((exp (url-cookie-expires cookie)))&#xA;    (and (&amp;gt; (length exp) 0)&#xA;     (condition-case ()&#xA;         (&amp;gt; (float-time) (float-time (date-to-time exp)))&#xA;       (error nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user3984" LastActivityDate="2014-12-23T06:18:29.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5678" PostTypeId="2" ParentId="5673" CreationDate="2014-12-23T06:49:53.260" Score="8" Body="&lt;p&gt;Well you've answered your own question: &lt;code&gt;package.el&lt;/code&gt; is the &lt;strong&gt;standard&lt;/strong&gt; way to install packages, because it's built into Emacs 24.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything else is non-standard (and probably somewhat subjective. I manage most third-party libraries via &lt;code&gt;el-get&lt;/code&gt;, personally).&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2014-12-23T06:49:53.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5679" PostTypeId="2" ParentId="5668" CreationDate="2014-12-23T07:54:13.300" Score="6" Body="&lt;p&gt;There's a very underappreciated feature most libraries that handle fonts provide for us, automatic fallback to different fonts if the font one has specified does not have all glyphs necessary to display the requested text correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;urxvt&lt;/code&gt; however does intentionally not come with automatic font fallback, at least not if you're not using fonts with the &lt;code&gt;xft:&lt;/code&gt; specifier. If you wish to use fallback, you need to specify the fonts for it explicitly in its configuration.  This can be done by interspersing all fonts in the intended fallback order with a comma and using that value as the font name in its configuration.  More details on that can be found in its manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could try using a terminal emulator that makes full use of the OS X font technology that comes with automatic fallback as last resort.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-23T07:54:13.300" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5680" PostTypeId="2" ParentId="5676" CreationDate="2014-12-23T08:16:47.243" Score="6" Body="&lt;p&gt;You can modify &lt;code&gt;dired-after-readin-hook&lt;/code&gt; to send an appropriate command to your &lt;code&gt;shell&lt;/code&gt; buffer. The following code creates a &lt;code&gt;shell&lt;/code&gt; called &lt;code&gt;dired-synced-shell&lt;/code&gt; if one doesn't already exist, and every time you change a directory in &lt;code&gt;dired&lt;/code&gt;, runs a &lt;code&gt;cd&lt;/code&gt; on the shell running in buffer &lt;code&gt;dired-synced-shell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'dired-after-readin-hook (lambda()&#xA;                     (unless (get-buffer &quot;dired-synced-shell&quot;) (shell &quot;dired-synced-shell&quot;))&#xA;                     (process-send-string (get-buffer &quot;dired-synced-shell&quot;) (format &quot;cd %s\n&quot; default-directory))&#xA;                     (message &quot;Switched to new directory&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OP Edit:&lt;/strong&gt; Here are two issues I found, with workarounds:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This doesn't work for switching to a dired buffer that already exists. Workaround: press &lt;code&gt;g&lt;/code&gt; to refresh the buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This causes my shell prompt to get smashed together with the previous, as it might if the output of the previous command didn't contain a newline. (E.g. if my shell prompt is &lt;code&gt;[scott@local]$&lt;/code&gt;, then on switching to a new dired buffer, I would see &lt;code&gt;[scott@local]$ [scott@local]$&lt;/code&gt;. Workaround: add a newline to the beginning of my shell prompt.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="675" LastEditDate="2015-04-06T21:49:13.823" LastActivityDate="2015-04-06T21:49:13.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5681" PostTypeId="2" ParentId="5669" CreationDate="2014-12-23T08:19:29.930" Score="6" Body="&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :exports none&#xA;  (defun org-babel-execute:html (body params) body)&#xA;#+end_src&#xA;&#xA;#+begin_src html :exports results :results html&#xA;  &amp;lt;input type=&quot;button&quot; name=&quot;clickme&quot; value=&quot;Click Me!&quot;&amp;gt;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will generate HTML page (upon export to HTML) with a button.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prevent confusion: the first block will not be evaluated during export.  You would need to evaluate it by moving the point to it and pressing &lt;kbd&gt;C-c C-c&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More so, you would need to call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages 'org-babel-load-languages '((html . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or similar before this code gets executed, so that Babel will recognize &lt;code&gt;html&lt;/code&gt; block as executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But really, the example was mostly intended to show how you can proceed about adding your own &quot;language&quot; which targets a particular backend. You could have easily done it without adding any new languages, and, perhaps, with less complication by doing something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :exports results :results html&#xA;  &quot;&amp;lt;input type=\&quot;button\&quot; name=\&quot;clickme\&quot; value=\&quot;Click Me!\&quot;&amp;gt;&quot;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advantage of my first approach is that once editing with &lt;kbd&gt;C-c '&lt;/kbd&gt;, you'd get the &lt;code&gt;html-mode&lt;/code&gt; turned on.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2014-12-29T06:43:24.737" LastActivityDate="2014-12-29T06:43:24.737" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5682" PostTypeId="1" AcceptedAnswerId="5683" CreationDate="2014-12-23T09:36:00.123" Score="9" ViewCount="591" Body="&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; how can I use Hindi digits (١٢٣...) when writing in Arabic?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Emacs is arguably hailed as the best editor, but when it comes to using numerals in the context of writing there are no satisfactory solutions to this problem for multilingual users compared to that afforded by Microsoft Word, namely the contextual numeral writing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Microsoft Word 2010 go to drop down menu --&gt; More Commands --&gt; Advanced --&gt; under show document content you can select &lt;code&gt;context&lt;/code&gt; for Numeral out of (Arabic or Hindi or Context or System). The context option allows you write numerals according to the context of your writing if it were English numerals would be &lt;strong&gt;Arabic&lt;/strong&gt; &lt;code&gt;1,2,3,4,5,6,7,8,9,0&lt;/code&gt; -- sounds strange! but it is so named (a misnomer maybe), and if you write in Arabic then numerals will be &lt;strong&gt;Hindi&lt;/strong&gt; numerals, written like this:&lt;br&gt;&#xA; &lt;img src=&quot;https://i.stack.imgur.com/dSvkR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Windows, I found that changing the &lt;code&gt;input-method&lt;/code&gt; while writing is the way to go if I am to write a multilingual document in Emacs say English and Arabic or any other language with a totally different alphabet. Changing language or keyboard layout from the language bar in Windows IMHO won't give you the same effect since that will destroy all of your key bindings of your Emacs editor (especially in case of two different languages like English and Arabic). The solution is posted &lt;a href=&quot;https://emacs.stackexchange.com/q/5519/2443&quot;&gt;here&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Microsoft Word, after setting numerals to context you can seamlessly write English with Arabic numerals, and when you shift to write in Arabic by cycling through (&lt;kbd&gt;ALT&lt;/kbd&gt;+&lt;kbd&gt;R SHFT&lt;/kbd&gt;) you will write Arabic text with Hindi numerals in no time as shown in the image below. In Emacs after shifting the &lt;code&gt;input-method&lt;/code&gt; to Arabic language, numerals will still be Arabic (1,2,3,etc) and not the desired Hindi numerals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EUoa7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think solution to this problems is related to Microsoft Windows as changing the language of regional settings will change the numerals of the Windows interface as well and will be system-wide undesired effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do believe that the extension potential of Emacs holds the key to this problem. &lt;em&gt;To be more specific; I suggest Emacs should detect the &lt;code&gt;input-method&lt;/code&gt; and if it is in Arabic it should automatically remap all Arabic digits into Hindi ones.&lt;/em&gt;  &lt;strong&gt;OR&lt;/strong&gt; &lt;em&gt;somehow customizing the Arabic keyboard layout to have Hindi instead of Arabic numerals.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Listed blow are some related posts to this problem but I couldn't translate these bits of info into an actual solution suitable to the specifics of this post:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://tex.stackexchange.com/q/191040/26295&quot;&gt;https://tex.stackexchange.com/q/191040/26295&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is an approach to extend the input-method in Emacs.&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/a/3404/2443&quot;&gt;https://emacs.stackexchange.com/a/3404/2443&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typing Hindi numerals can be a tedious task in Emacs if you want to enter the &lt;strong&gt;Hindi&lt;/strong&gt; digits one at a time &lt;code&gt;C-x 8 RET&lt;/code&gt; these are mapped in Unicode to the following codes: 0661 for number 1, 0662 for number 2, 0663 for number 3, 0664 for number 4, 0665 for number 5 and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;br&gt;&#xA;What is the best customization to Emacs 24 and shortest keystrokes in order to replicate the seamless contextual writing experience provided by Microsoft Word?  &lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-23T11:13:39.250" Title="How to get human language-specific numerals?" Tags="|character-encoding|input-method|quail|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5683" PostTypeId="2" ParentId="5682" CreationDate="2014-12-23T10:21:39.650" Score="10" Body="&lt;p&gt;So the requirement is: When I'm using the &lt;code&gt;arabic&lt;/code&gt; input method, and I type a digit, I want Emacs to insert the Hindi character for that digit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this, we can adapt your linked &lt;a href=&quot;https://emacs.stackexchange.com/a/3404/2443&quot;&gt;approach to extend an input-method&lt;/a&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;quail/arabic&quot;&#xA;  '(let ((quail-current-package (assoc &quot;arabic&quot; quail-package-alist)))&#xA;     (quail-define-rules ((append . t)) ;; don't clobber the existing rules&#xA;                         (&quot;0&quot; &quot;\u0660&quot;)&#xA;                         (&quot;1&quot; &quot;\u0661&quot;)&#xA;                         (&quot;2&quot; &quot;\u0662&quot;)&#xA;                         (&quot;3&quot; &quot;\u0663&quot;)&#xA;                         (&quot;4&quot; &quot;\u0664&quot;)&#xA;                         (&quot;5&quot; &quot;\u0665&quot;)&#xA;                         (&quot;6&quot; &quot;\u0666&quot;)&#xA;                         (&quot;7&quot; &quot;\u0667&quot;)&#xA;                         (&quot;8&quot; &quot;\u0668&quot;)&#xA;                         (&quot;9&quot; &quot;\u0669&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when you use &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-\&lt;/kbd&gt; &lt;code&gt;arabic&lt;/code&gt; (or just &lt;kbd&gt;C-\&lt;/kbd&gt; if it's your default), and type a digit, it inserts the specified translation instead.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-12-23T11:01:22.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5684" PostTypeId="2" ParentId="5664" CreationDate="2014-12-23T10:51:21.427" Score="3" Body="&lt;p&gt;This is a subset of your question, but it should help in that the following code may be extended to serve larger purposes and that I share my investigations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I asked &lt;a href=&quot;https://stackoverflow.com/questions/20952995/emacs-shell-change-directory-with-ido&quot;&gt;a similar question on SO&lt;/a&gt; about &lt;strong&gt;changing directory with ido&lt;/strong&gt;. Someone answered, which maybe @iqbal-ansari will recognize, and I put the resulting code into a repo which I called &lt;a href=&quot;https://gitlab.com/emacs-stuff/fasd-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;fasd-shell&lt;/a&gt;. The goal was to cd as fast as possible, so the process is this (all help in above  link):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;install the fasd command line utility&lt;/li&gt;&#xA;&lt;li&gt;install fasd-shell&lt;/li&gt;&#xA;&lt;li&gt;and to use it: type &lt;code&gt;d foo&lt;/code&gt; (&lt;code&gt;d&lt;/code&gt; followed by a space) to trigger the fasd engine and the ido completion, which will ask you to cd to any directory containing &lt;code&gt;foo&lt;/code&gt; in its full name &lt;em&gt;that you already visited with an explicit cd&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;d&lt;/code&gt; triggers an action that calls ido for the completion. So we're not limited to &lt;code&gt;d&lt;/code&gt; and &lt;code&gt;cd&lt;/code&gt;, we could recognize any pattern and fire any action. (I'm nearly done for &lt;code&gt;makefile&lt;/code&gt;s' targets completion)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to put it on MELPA so I got a review and I've been asked to use either a &lt;code&gt;completion-at-point&lt;/code&gt; function or to hook into &lt;code&gt;pcomplete&lt;/code&gt; (&lt;code&gt;pcmplt-*&lt;/code&gt;), instead of re-defining &lt;code&gt;TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here I am.&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2014-12-24T00:27:03.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5685" PostTypeId="1" CreationDate="2014-12-23T10:55:06.893" Score="1" ViewCount="183" Body="&lt;p&gt;This only happens in python-mode. When I try to use a text object to, for example, change everything inside or around some brackets (eg &lt;code&gt;ci(&lt;/code&gt;) it instead edits the first line of the file. So if I have this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;from somewhere import something&#xA;something(&quot;hello&quot;)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and my cursor is on the hello and I type &lt;code&gt;ci(&lt;/code&gt; then it changes to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;fg&#xA;something(&quot;hello&quot;)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with my cursor between the f and the g. This happens no matter what else is in the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try to edit inside quotes (eg &lt;code&gt;ci&quot;&lt;/code&gt;)also fails but in a different way. It just drops into insert mode and leaves the contents unchanged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas where I should start with tracking down the source of this issue?&lt;/p&gt;&#xA;" OwnerUserId="3986" LastActivityDate="2014-12-23T10:55:06.893" Title="Evil-mode text objects not working in python.el's python-mode" Tags="|python|evil|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5686" PostTypeId="2" ParentId="5528" CreationDate="2014-12-23T12:46:11.683" Score="4" Body="&lt;p&gt;It turns out the offending part of my .emacs file was &lt;code&gt;(set-selection-coding-system 'utf-8)&lt;/code&gt;. Once I removed that line, Emacs behaved as expected.&lt;/p&gt;&#xA;" OwnerUserId="583" LastActivityDate="2014-12-23T12:46:11.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5687" PostTypeId="2" ParentId="5669" CreationDate="2014-12-23T17:29:46.543" Score="6" Body="&lt;p&gt;As I mentioned in a comment, section &lt;a href=&quot;https://orgmode.org/manual/Exporting-Code-Blocks.html#Exporting-Code-Blocks&quot; rel=&quot;nofollow noreferrer&quot;&gt;Exporting code blocks&lt;/a&gt; describes permissible values of the &lt;code&gt;:exports&lt;/code&gt; option: &lt;code&gt;code&lt;/code&gt; (contents of the block), &lt;code&gt;results&lt;/code&gt; (results of its evaluation), &lt;code&gt;both&lt;/code&gt; (code and results) and &lt;code&gt;none&lt;/code&gt; (nothing is exported).&lt;/p&gt;&#xA;&lt;p&gt;By default Org tries to interpret results of evaluating a source code block (and turn it into a table, for example). If such an interpretation fails, evaluation results are formatted as monospace text and look as if wrapped in &lt;code&gt;&amp;lt;pre&amp;gt; ... &amp;lt;/pre&amp;gt;&lt;/code&gt; when exported to HTML.&lt;/p&gt;&#xA;&lt;p&gt;Luckily we can tell Org to put evaluation results in a special kind of a block using &lt;code&gt;:results&lt;/code&gt; (see &lt;a href=&quot;https://orgmode.org/manual/Results-of-Evaluation.html#Results-of-Evaluation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Results of evaluation&lt;/a&gt; and &lt;a href=&quot;https://orgmode.org/manual/Results-of-Evaluation.html#index-results_002c-header-argument&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;:results&lt;/code&gt;&lt;/a&gt;). If you want to be able to use a source code block to generate a part of an HTML page, use &lt;code&gt;:results value html&lt;/code&gt; or &lt;code&gt;:results output html&lt;/code&gt; and Org will wrap results in a &lt;code&gt;#+BEGIN_HTML ... #+END_HTML&lt;/code&gt; block.&lt;/p&gt;&#xA;&lt;p&gt;Here's a minimal example (&lt;code&gt;#+OPTIONS&lt;/code&gt; are irrelevant, I added them to make it easier to inspect exported HTML code using &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-e&lt;/kbd&gt; &lt;kbd&gt;h&lt;/kbd&gt; &lt;kbd&gt;H&lt;/kbd&gt;):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: html-postamble:nil&#xA;#+OPTIONS: html-preamble:nil html-scripts:nil html-style:nil&#xA;#+OPTIONS: html5-fancy:nil tex:t&#xA;&#xA;Some text.&#xA;&#xA;#+BEGIN_SRC python :exports results :results value html&#xA;  return &amp;quot;&amp;lt;hr&amp;gt; Generated HTML code. &amp;lt;hr&amp;gt;&amp;quot;&#xA;#+END_SRC&#xA;&#xA;More text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="17096" LastEditDate="2022-03-31T14:09:20.283" LastActivityDate="2022-03-31T14:09:20.283" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="5689" PostTypeId="1" AcceptedAnswerId="5714" CreationDate="2014-12-23T19:13:44.443" Score="9" ViewCount="2075" Body="&lt;p&gt;I'm using GNU Emacs 24.4.1 in a GUI on OS X.  I want to force every character to be displayed using just a single font rather than allowing Emacs to choose a supposedly most appropriate.  I understand that no font will include every glyph, but I use a limited subset of unicode which many good fonts cover satisfactorily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen a lot of talk about using the unicode-fonts package to set fonts for ranges of characters, but I don't want to have a thousand extra lines in my config to set every block separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I simply stop Emacs from automatically mapping different glyphs to different fonts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="3991" LastActivityDate="2023-07-19T18:13:16.837" Title="Force a single font for all unicode glyphs" Tags="|fonts|unicode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5690" PostTypeId="1" AcceptedAnswerId="5691" CreationDate="2014-12-23T20:43:45.123" Score="14" ViewCount="3152" Body="&lt;p&gt;Upon starting term-mode, Emacs delegates all keypresses to the terminal you're running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's great for compatibility purposes, but leaves Emacs functionality behind. How do I get back to Emacs features (for example, to switch a buffer).&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-12-23T20:43:45.123" Title="in term-mode, how do I run regular emacs commands?" Tags="|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5691" PostTypeId="2" ParentId="5690" CreationDate="2014-12-23T20:43:45.123" Score="16" Body="&lt;p&gt;In term-mode, there are &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html&quot;&gt;two input modes&lt;/a&gt;. In the default input mode -- &lt;code&gt;char-mode&lt;/code&gt; -- all keypresses (except &lt;code&gt;C-c&lt;/code&gt;) are sent to the terminal to do what it wishes with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you change the input mode to &lt;code&gt;line-mode&lt;/code&gt;, then regular Emacs commands work. You can switch to &lt;code&gt;line-mode&lt;/code&gt; with &lt;code&gt;C-c C-j&lt;/code&gt;. You can switch back to &lt;code&gt;char-mode&lt;/code&gt; with &lt;code&gt;C-c C-k&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-12-23T20:43:45.123" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5692" PostTypeId="1" CreationDate="2014-12-23T20:48:44.833" Score="9" ViewCount="919" Body="&lt;p&gt;I am able to compute dates thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: mytbl&#xA;| # | [2014-12-14 Sun] | 30 | &amp;lt;2015-01-13 Tue&amp;gt; |&#xA;#+TBLFM: $4=$2+$3;D&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but what I want to then do is make that date appear as an agenda date, something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEADLINE: $remote(mytbl,@1$4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that doesn't work. I can't find any syntax, even a macro, that will allow anything but a literal date for an agenda entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-01-09T06:54:48.960" Title="Org date from spreadsheet" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5693" PostTypeId="2" ParentId="5623" CreationDate="2014-12-23T23:53:15.510" Score="2" Body="&lt;h2&gt;Source of the problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;So the problem  is in the ESS variable &lt;code&gt;ess-microsoft-p&lt;/code&gt;. Defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar ess-microsoft-p (or (equal window-system 'w32)&#xA;                            (equal window-system 'win32)&#xA;                            (equal window-system 'mswindows))&#xA;  &quot;Value is t if the OS is one of Microsoft's, nil otherwise.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you run Emacs from a Windows console, &lt;code&gt;window-system&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; (because a character terminal is not at all a window system),  therefore such is &lt;code&gt;ess-microsoft-p&lt;/code&gt;. Eventually the predicate says that you are not running on a Microsoft OS!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The unpleasant now follows, in fact, as for  &lt;kbd&gt;Meta&lt;/kbd&gt;-&lt;code&gt;R&lt;/code&gt;, we have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun R (&amp;amp;optional start-args)&#xA;  &quot;Call 'R', the 'GNU S' system from the R Foundation. .....&#xA;If you have certain command line arguments that should always be passed&#xA;to R, put them in the variable `inferior-R-args'.&quot;&#xA;...&#xA;  (let* ((r-always-arg&#xA;          (if (or ess-microsoft-p (eq system-type 'cygwin))&#xA;              &quot;--ess &quot;&#xA;            ;; else: &quot;unix alike&quot;&#xA;            (if (not ess-R-readline) &quot;--no-readline &quot;)))&#xA;         (r-start-args&#xA;          (concat r-always-arg&#xA;                  inferior-R-args &quot; &quot; ; add space just in case&#xA;...&#xA;  (inferior-ess r-start-args cust-alist gdbp)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see if  &lt;code&gt;ess-microsoft-p&lt;/code&gt; is false and the &lt;code&gt;system-type&lt;/code&gt; is not Cygwin, the function &lt;code&gt;(R)&lt;/code&gt; assumes we are running Linux, therefore sets &lt;code&gt;r-always-arg&lt;/code&gt; to &lt;code&gt;--no-readline&lt;/code&gt; instead of  &lt;code&gt;-ess&lt;/code&gt;. This variable is appended to &lt;code&gt;r-always-arg&lt;/code&gt; and passed to the command line invoking R thorough &lt;code&gt;(inferior-ess)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;--no-readline&lt;/code&gt; is a Unix only argument to invoke R,  turning  off command-line editing via readline. R will not start with this switch in Windows and Emacs will hang, infinitely waiting for R. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be noted that if you run a native Windows Emacs in a Cygwin console you incur in the same problem, since  &lt;code&gt;(eq system-type 'cygwin)&lt;/code&gt; is true when Emacs is &lt;em&gt;compiled for&lt;/em&gt; Cygwin, not when &lt;em&gt;running in&lt;/em&gt; Cygwin.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To me the current definition of &lt;code&gt;ess-microsoft-p&lt;/code&gt; seems buggy.&lt;br&gt;&#xA;Anyway you can fix it, adding in your init file, after starting ESS. i.e. &lt;code&gt;(require 'ess-site)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ess-microsoft-p t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;UPDATE&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;ess-microsoft-p&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar ess-microsoft-p (or (eq system-type 'ms-dos)&#xA;                (eq system-type 'windows-nt))&#xA;  &quot;Value is t if the OS is one of Microsoft's, nil otherwise.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;system-type&lt;/code&gt; is independent from the windowing system, therefore  &lt;code&gt;ess-microsoft-p&lt;/code&gt;  correctly reports &lt;code&gt;t&lt;/code&gt; in Windows console too.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-12-18T22:23:02.267" LastActivityDate="2016-12-18T22:23:02.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5694" PostTypeId="1" AcceptedAnswerId="12852" CreationDate="2014-12-24T00:39:04.303" Score="5" ViewCount="9546" Body="&lt;p&gt;When I use restclient with &lt;code&gt;Content-Type: application/x-www-form-urlencoded&lt;/code&gt;, restclient sends newlines with the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;POST :domain/thing&#xA;Content-Type: application/x-www-form-urlencoded&#xA;data=foobar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The endpoint receives a form with the value &lt;code&gt;'data': 'foobar\n'&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could modify &lt;code&gt;require-final-newline&lt;/code&gt; such that the last query in the file would work properly, but since requests are separated by comment lines, I still get the extra newlines for all preceding requests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get restclient to pass the forms correctly?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-06-02T13:37:38.953" Title="Sending application/x-www-form-urlencoded data with restclient" Tags="|http|restclient|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5695" PostTypeId="1" AcceptedAnswerId="5715" CreationDate="2014-12-24T00:56:45.403" Score="6" ViewCount="446" Body="&lt;p&gt;If I use info inside emacs and enable &lt;code&gt;variable-pitch-mode&lt;/code&gt;, all text is displayed in proportional fonts, but the text width is all wrong, because info-mode laid out the text assuming fixed-width characters and a window width of something like 70 characters. The same thing happens in help buffers as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get info-mode to lay out the text neatly when using a variable-width font?&lt;/p&gt;&#xA;" OwnerUserId="875" LastEditorUserId="875" LastEditDate="2014-12-24T18:56:20.783" LastActivityDate="2015-02-10T12:25:19.717" Title="Variable-width font in info- and help-mode with correct text width?" Tags="|fonts|info|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5696" PostTypeId="2" ParentId="147" CreationDate="2014-12-24T01:36:55.093" Score="7" Body="&lt;p&gt;Not exactually what you want, but ruler like @Malabarba♦ will waster space, here is better solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a built-in package in &lt;code&gt;emacs-goodies-el&lt;/code&gt;(recommend to install it in terminal) called &lt;a href=&quot;https://github.com/ncrohn/emacs/blob/master/vendor/emacs-goodies-el/highlight-beyond-fill-column.el&quot; rel=&quot;noreferrer&quot;&gt;highlight-beyond-fill-column.el&lt;/a&gt;, add this to your &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default fill-column 80)&#xA;(add-hook 'prog-mode-hook 'highlight-beyond-fill-column)&#xA;(custom-set-faces '(highlight-beyond-fill-column-face&#xA;                    ((t (:foreground &quot;red&quot; )))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The text beyond &lt;code&gt;fill-column&lt;/code&gt; which is 80 in the snippet will be highlighted with the color of &lt;code&gt;red&lt;/code&gt;. You can set the face as you like.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2014-12-24T01:36:55.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5697" PostTypeId="1" AcceptedAnswerId="5701" CreationDate="2014-12-24T03:09:16.973" Score="1" ViewCount="72" Body="&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; works very well in Eshell. I've used it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias sau sudo aptitude update&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it doesn't work for the search command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ alias aps aptitude search &#xA;$ aps emacs&#xA;search: You must provide at least one search term&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's wrong with this?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-24T07:45:08.900" Title="Alias doesn't work for aptitude search in Eshell" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5698" PostTypeId="1" AcceptedAnswerId="16679" CreationDate="2014-12-24T03:53:45.870" Score="5" ViewCount="1446" Body="&lt;p&gt;Is it possible to display a space with a monospace font, while displaying all other characters with a variable-width font?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-fontset-font t '(#x20 . #x20) (font-spec :family &quot;Source Code Pro&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the result was an error message saying&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Can't set a font for partial ASCII range&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this completely impossible, or am I doing the wrong thing?&lt;/p&gt;&#xA;" OwnerUserId="875" LastEditorUserId="675" LastEditDate="2015-05-18T19:13:27.917" LastActivityDate="2015-09-16T23:02:51.637" Title="Fixed-width space character with a variable-width font?" Tags="|fonts|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5699" PostTypeId="1" AcceptedAnswerId="5706" CreationDate="2014-12-24T06:29:24.200" Score="9" ViewCount="1429" Body="&lt;p&gt;Rather than manually check a tickler file or calendar every morning, how can I create a trigger that will set the status of an item to TODO on a certain date?&lt;/p&gt;&#xA;" OwnerUserId="3930" LastActivityDate="2014-12-24T16:25:42.133" Title="ORG-MODE - Trigger TODO status on a certain date?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5700" PostTypeId="2" ParentId="5699" CreationDate="2014-12-24T07:23:21.223" Score="7" Body="&lt;p&gt;Here is something I use every morning to comb through all of my todo and change the date to today if it is overdue, and change it from next-action to active if it is due today.  It is a custom solution for my own calendar that I've been using for a year, so it will undoubtedly need some customization on your own part.  My recollection is that there was a change in &lt;code&gt;org-deadline&lt;/code&gt; from &lt;code&gt;org-mode&lt;/code&gt; version 7 and 8, and I may be using a previous version in my setup.  The current version may need an additional argument or something -- if you need additional help, let me know and I'll work on it over the next few days as time permits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regex that I use contemplates the headings have two stars and will be at the flush-left of the buffer.  Your own setup will likely require a modification of the regex.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-carry-forward-uncompleted-tasks ()&#xA;&quot;Carry forward uncompleted tasks.&quot;&#xA;(interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-max))&#xA;    (while (re-search-backward &quot;^\\*\\* Active&quot; nil t)&#xA;      (unless (org-at-heading-p)&#xA;        (org-back-to-heading t))&#xA;      (let* (&#xA;          (element (org-element-at-point))&#xA;          (todo-state (org-element-property :todo-keyword element))&#xA;          (deadline (org-element-property :deadline element))&#xA;          (deadline-time-stamp&#xA;            (when deadline&#xA;              (time-to-days&#xA;                (org-time-string-to-time&#xA;                  (org-element-property :raw-value deadline)))))&#xA;          (today (time-to-days (current-time))) )&#xA;        (when&#xA;            (and&#xA;              deadline-time-stamp&#xA;              (&amp;gt; today deadline-time-stamp) ;; deadline is overdue&#xA;              (string= todo-state &quot;Active&quot;) ) ;; todo-state equals &quot;X&quot;&#xA;          (org-deadline nil &quot;.&quot;) )))))&#xA;&#xA;(defun org-make-active-today ()&#xA;&quot;Change task from Next Action to Active if deadline is less than or equal to today.&quot;&#xA;(interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-max))&#xA;    (while (re-search-backward &quot;^\\*\\* Next Action&quot; nil t)&#xA;      (unless (org-at-heading-p)&#xA;        (org-back-to-heading t))&#xA;      (let* (&#xA;          (element (org-element-at-point))&#xA;          (todo-state (org-element-property :todo-keyword element))&#xA;          (deadline (org-element-property :deadline element))&#xA;          (deadline-time-stamp&#xA;            (when deadline&#xA;              (time-to-days&#xA;                (org-time-string-to-time&#xA;                  (org-element-property :raw-value deadline) ))))&#xA;          (today (time-to-days (current-time))) )&#xA;        (when&#xA;            (and&#xA;              deadline-time-stamp&#xA;              (&amp;gt;= today deadline-time-stamp) ;; deadline less than or equal to today&#xA;              (string= todo-state &quot;Next Action&quot;)) ;; todo-state equals &quot;X&quot;&#xA;          (org-deadline nil &quot;.&quot;)&#xA;          (org-todo &quot;Active&quot;) )))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-12-24T08:11:38.490" LastActivityDate="2014-12-24T08:11:38.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5701" PostTypeId="2" ParentId="5697" CreationDate="2014-12-24T07:45:08.900" Score="4" Body="&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; use &lt;code&gt;alias aps 'aptitude search $*'&lt;/code&gt; (quotes seem to be important).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The comment at the top of &lt;code&gt;em-alias.el&lt;/code&gt; says the following.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Creating aliases&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The user interface is simple: type &lt;code&gt;alias&lt;/code&gt; followed by the command name followed by the definition.  Argument references are made using &lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt;, etc., or &lt;code&gt;$*&lt;/code&gt;.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias ll 'ls -l $*'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will cause the command &lt;code&gt;ll NEWS&lt;/code&gt; to be replaced by &lt;code&gt;ls -l NEWS&lt;/code&gt;.  This is then passed back to the command parser for reparsing.{Only the command text specified in the alias definition will be reparsed.  Argument references (such as &lt;code&gt;$*&lt;/code&gt;) are handled using variable values, which means that the expansion will not be reparsed, but used directly.}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To delete an alias, specify its name without a definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias ll&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Aliases are written to disk immediately after being defined or deleted.  The filename in which they are kept is defined by the variable &lt;code&gt;eshell-aliases-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2014-12-24T07:45:08.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5702" PostTypeId="1" AcceptedAnswerId="5746" CreationDate="2014-12-24T09:18:21.833" Score="12" ViewCount="3416" Body="&lt;p&gt;When I open pdf with emacs, it got frozen. And I installed pdf-tools, open pdf, it got frozen again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the underlining process when emacs open a pdf? Is there a lot of converting work? What should I do to speed it up?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs 24.4&lt;/li&gt;&#xA;&lt;li&gt;Ubuntu 14.04 LTS&lt;/li&gt;&#xA;&lt;li&gt;Intel 2.4GHz x 2&lt;/li&gt;&#xA;&lt;li&gt;4G RAM.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just found this page:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;learnt a lesson. Never open a pdf in emacs. Never even do it accidentally.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://twitter.com/ergoemacs/status/456088661059457024&quot; rel=&quot;noreferrer&quot;&gt;https://twitter.com/ergoemacs/status/456088661059457024&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a sad news to me! Isn't it a great idea to view pdf using Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought it was because my pdf file is too large:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;5.7M, 1313 pages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I tried a small pdf file, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;402K, 66 pages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it got frozen again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I open pdf file using &lt;code&gt;C-c C-x&lt;/code&gt; from &lt;code&gt;helm&lt;/code&gt;, and it opens the pdf file in an external viewer: &lt;strong&gt;zathura&lt;/strong&gt;. Since there is no converting process, the file opens lighting fast. (As fast as &lt;code&gt;mupdf&lt;/code&gt;. I guess zathura using mupdf as its back end.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are four points makes zathura outstanding:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Lighting fast. (Both open and search)&lt;/li&gt;&#xA;&lt;li&gt;High quality display. &lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;Tab&lt;/kbd&gt; displays the chapter/section menu just like Adobe Reader.&lt;/li&gt;&#xA;&lt;li&gt;Good keyboard shortcuts support. (Actually, it uses vim-style keybinding, which make sense since there is no need to switch mode in pdf viewer. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 4&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Screen shot for quality comparasion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;a href=&quot;https://i.stack.imgur.com/bKrVy.png&quot; rel=&quot;noreferrer&quot;&gt;Left: Zathura; Right: PDF in Emacs&#xA;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really got confused what Emacs uses for open PDF. &#xA;(I've already removed pdf-tools)&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="3872" LastEditDate="2014-12-26T00:29:41.587" LastActivityDate="2017-07-25T04:15:04.810" Title="Emacs got frozen when open pdf file" Tags="|pdf|" AnswerCount="2" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="5703" PostTypeId="1" CreationDate="2014-12-24T10:32:43.073" Score="6" ViewCount="973" Body="&lt;p&gt;When trying to paste into Emacs from my Linux system GUI, I'm getting&#xA;a 10-15 second Emacs freeze and:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gui-get-selection: (error &quot;Timed out waiting for reply from selection owner&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would post a bug, except I can't pin-point the condition to&#xA;reliably reproduce the bug. Has anyone else encountered this?&#xA;I'm on GNU Emacs 25.0.50.1.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="50" LastEditDate="2014-12-27T17:13:41.680" LastActivityDate="2020-11-28T10:58:44.557" Title="Has anyone else encountered gui-get-selection: (error &quot;Timed out...&quot;) bug?" Tags="|linux|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5704" PostTypeId="2" ParentId="5324" CreationDate="2014-12-24T14:40:18.223" Score="3" Body="&lt;p&gt;Judging by the &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/258&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt;, the author of this question expected to see the documentation for variables from a package that hasn't been loaded yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-variable&lt;/code&gt; won't show it either, so it's not a bug.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2014-12-24T14:40:18.223" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5705" PostTypeId="1" AcceptedAnswerId="5718" CreationDate="2014-12-24T15:12:20.603" Score="15" ViewCount="4027" Body="&lt;p&gt;I have been struggling to find a simple and direct question to the answer and therefore I have decided to ask here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there a way to use Super in Emacs launched in a Terminal in Linux?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;P.S&lt;/strong&gt;: I read a lot of information about &lt;code&gt;xmodmap&lt;/code&gt; but I think the key is that the terminal emulator cannot represent the Super key. However, &lt;code&gt;(kbd &quot;s-SPC&quot;)&lt;/code&gt; returns something and I was thinking of using the translation facility of &lt;code&gt;.Xdefaults/X&lt;/code&gt;. Am I on the right path? Given the result of &lt;code&gt;kbd&lt;/code&gt;, what do I need to put as XTerm.VT100.translations?&lt;/p&gt;&#xA;" OwnerUserId="3979" LastEditorUserId="253" LastEditDate="2014-12-29T12:57:30.603" LastActivityDate="2020-10-18T12:55:39.580" Title="Use Super in emacs -nw in linux" Tags="|key-bindings|linux|term|terminal-emacs|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5706" PostTypeId="2" ParentId="5699" CreationDate="2014-12-24T16:25:42.133" Score="5" Body="&lt;p&gt;Not a direct answer but you could use Org's support for deadlines and scheduling instead. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can create your TODO items and give them a scheduled date, which in Org means the date you plan to do the task -- and when it should start showing up in your agenda. (If you aren't already using org agenda views they are worth some investigation!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on your needs you can also assign a deadline. For example: create a TODO on Friday, schedule it for the following Wed when you actually want to see it; and give it a deadline for the following Friday by which it must completed. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-12-24T16:25:42.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5707" PostTypeId="2" ParentId="5703" CreationDate="2014-12-24T16:37:17.670" Score="3" Body="&lt;p&gt;The short answer: yes (also with 25.0.50.1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might be related to emacs bug 16737. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try running (shell-command-to-string &quot;xclip -o&quot;). When I attempt this (once emacs has started misbehaving with respect to any attempt to yank), emacs hangs until I kill xclip.&lt;/p&gt;&#xA;" OwnerUserId="3995" LastActivityDate="2014-12-24T16:37:17.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5708" PostTypeId="1" AcceptedAnswerId="5734" CreationDate="2014-12-24T17:14:37.307" Score="3" ViewCount="79" Body="&lt;p&gt;I have activated in Alpine email client the following setting in order to use Emacs as an editor when composing emails:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[X]  Enable Alternate Editor Implicitly&#xA;Editor                              = emacs.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I start to compose a message, by putting the cursor below the following area in Alpine&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;----- Message Text -----&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs will be started. But a DOS prompt (with the title C:\Program Files\GNU Emacs 24.4\bin\emacs.exe) is also opened at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to prevent this prompt from being opened.  &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="50" LastEditDate="2014-12-24T19:42:08.293" LastActivityDate="2014-12-25T18:58:34.740" Title="Prevent DOS prompt when using emacs as an 'alternate editor'" Tags="|microsoft-windows|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5709" PostTypeId="1" AcceptedAnswerId="12991" CreationDate="2014-12-24T17:16:35.247" Score="1" ViewCount="357" Body="&lt;p&gt;I need a function to execute before the minibuffer is entered, not after (&lt;code&gt;minibuffer-setup-hook&lt;/code&gt; style). Is there any way I can achieve this effect with advice or other emacs systems?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to defer some minibuffer setup until the minibuffer is actually used, to speed up startup time.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2014-12-27T18:11:48.080" LastActivityDate="2015-06-09T00:20:38.163" Title="Simulating before-minibuffer-hook" Tags="|hooks|minibuffer|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5711" PostTypeId="1" CreationDate="2014-12-24T19:27:46.577" Score="3" ViewCount="179" Body="&lt;p&gt;If I modify a buffer and then save it, the buffer modified flag resets and the subsequent undo commands set the buffer modified flag to true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if I use &lt;code&gt;(set-buffer-modified-p nil)&lt;/code&gt;, the flag resets but then the first undo command doesn't set it to true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get the first undo to set the buffer modified flag to true after &lt;code&gt;(set-buffer-modified-p nil)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="3997" LastEditorUserId="25" LastEditDate="2014-12-25T00:37:55.803" LastActivityDate="2014-12-28T14:56:49.763" Title="After (set-buffer-modified-p nil), the first undo command doesn't set the buffer modified flag to true" Tags="|undo|buffer-modified|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5713" PostTypeId="2" ParentId="5702" CreationDate="2014-12-24T20:23:10.343" Score="4" Body="&lt;p&gt;I’m using Emacs for reading documentation, scientific papers and&#xA;books — all of that &lt;em&gt;without issues&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;em&gt;doc-view-mode&lt;/em&gt; uses &lt;a href=&quot;http://mupdf.com/doc/browse/source/tools/mudraw.c&quot; rel=&quot;nofollow&quot;&gt;mudraw&lt;/a&gt; (from &lt;a href=&quot;http://mupdf.com/&quot; rel=&quot;nofollow&quot;&gt;mupdf&lt;/a&gt;) for&#xA;rendering PDFs as you can see by checking &lt;em&gt;doc-view-pdfdraw-program&lt;/em&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;doc-view-pdfdraw-program is a variable defined in `doc-view.el'.&#xA;  Its value is &quot;mudraw&quot;&#xA;  Documentation:&#xA;  Name of MuPDF's program to convert PDF files to PNG.&#xA;  This variable was introduced, or its default value was changed, in&#xA;  version 24.4 of Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;By default doc-view mode uses ghotscript’s gs for rendering which can be slow in comparison.&#xA;You can &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13164&quot; rel=&quot;nofollow&quot;&gt;read&lt;/a&gt; about switch from ghostscript’s gs to mupdf’s mudraw:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I've since been testing that patch and never looked back since the&#xA;  switch sped up the pdf-&gt;png conversion by a factor of two and brought&#xA;  anti-aliasing with it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In your situation:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;install mupdf and open PDF in an emacs session without&#xA;your configuration e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;env HOME=/tmp emacs -Q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and check if &lt;em&gt;doc-view-pdfdraw-program&lt;/em&gt; is set correctly to &lt;em&gt;mudraw&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;report back if above improved your situation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;PS I have no experience with &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;nofollow&quot;&gt;pdf-tools&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="220" LastEditorUserId="220" LastEditDate="2014-12-25T00:00:24.697" LastActivityDate="2014-12-25T00:00:24.697" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="5714" PostTypeId="2" ParentId="5689" CreationDate="2014-12-24T21:28:55.627" Score="8" Body="&lt;p&gt;Playing with Emacs’ fontsets definitions should be the answer.&lt;/p&gt;&#xA;&lt;p&gt;After reading&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Defining-Fontsets.html#Defining-Fontsets&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fontsets docs&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The startup fontset will use the font that you specify, or a variant&#xA;with a different registry and encoding, for all the characters that&#xA;are supported by that font, and fallback on ‘fontset-default’ for&#xA;other characters.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Fontsets.html#Fontsets&quot; rel=&quot;nofollow noreferrer&quot;&gt;If some characters&lt;/a&gt; appear on the screen as empty boxes or hex codes,&#xA;this means that the fontset in use for them has no font for those&#xA;characters.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;set-fontset-font&lt;/em&gt; description:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TARGET may be a cons; (FROM . TO), where FROM and TO are characters.&#xA;In that case, use FONT-SPEC for all characters in the range FROM and&#xA;TO (inclusive).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TARGET may be a script name symbol.  In that case, use FONT-SPEC for&#xA;all characters that belong to the script.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TARGET may be a charset.  In that case, use FONT-SPEC for all&#xA;characters in the charset.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TARGET may be nil.  In that case, use FONT-SPEC for any characters for&#xA;that no FONT-SPEC is specified.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;docs about checking &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Charsets.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;charsets&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;There are two commands that can be used to obtain information about charsets. The command M-x list-charset-chars prompts for a charset name, and displays all the characters in that character set. The command M-x describe-character-set prompts for a charset name, and displays information about that charset, including its internal representation within Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;To find out which charset a character in the buffer belongs to, put point before it and type C-u C-x =&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In our init file we should be able to set one font for full range of characters:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (let ((my-font &amp;quot;DejaVu Sans Mono-14&amp;quot;))&#xA;  (set-fontset-font &amp;quot;fontset-startup&amp;quot; '(#x000000 . #x3FFFFF) my-font)&#xA;  (set-fontset-font &amp;quot;fontset-default&amp;quot; '(#x000000 . #x3FFFFF) my-font)&#xA;  (set-fontset-font &amp;quot;fontset-standard&amp;quot; '(#x000000 . #x3FFFFF) my-font))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But to set a font for a range of characters and &lt;strong&gt;force it as a fallback font for characters not supported by it&lt;/strong&gt; we also must &lt;strong&gt;add&lt;/strong&gt; &lt;code&gt;nil&lt;/code&gt; as a target:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((my-font &amp;quot;DejaVu Sans Mono-14&amp;quot;)&#xA;      (font-sets '(&amp;quot;fontset-default&amp;quot;&#xA;                   &amp;quot;fontset-standard&amp;quot;&#xA;                   &amp;quot;fontset-startup&amp;quot;)))&#xA;  (mapcar&#xA;   (lambda (font-set)&#xA;     ;; all the characters in that range (which is the full possible range)&#xA;     (set-fontset-font font-set '(#x000000 . #x3FFFFF) my-font)&#xA;&#xA;     ;; for all characters without font specification&#xA;     ;; in another words it is a setting for lack of fallback font&#xA;     ;; if e.g. ℕ called DOUBLE-STRUCK CAPITAL N is not covered by our font&#xA;     ;; it will be displayed as placeholder-box,&#xA;     ;; because fallback for our font is now... our font :)&#xA;     (set-fontset-font font-set nil my-font))&#xA;   font-sets))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now as we can see under point (cursor) with &lt;code&gt;C-u C-x =&lt;/code&gt; or &lt;code&gt;M-x describe-char&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;             position: 1430 of 1954 (73%), column: 16&#xA;            character: ℕ (displayed as ℕ) (codepoint 8469, #o20425, #x2115)&#xA;    preferred charset: unicode (Unicode (ISO10646))&#xA;code point in charset: 0x2115&#xA;               script: symbol&#xA;               syntax: w    which means: word&#xA;             category: .:Base, L:Left-to-right (strong)&#xA;             to input: type &amp;quot;C-x 8 RET HEX-CODEPOINT&amp;quot; or &amp;quot;C-x 8 RET NAME&amp;quot;&#xA;          buffer code: #xE2 #x84 #x95&#xA;            file code: #xE2 #x84 #x95 (encoded by coding system utf-8-unix)&#xA;              display: no font available&#xA;&#xA;Character code properties: customize what to show&#xA;  name: DOUBLE-STRUCK CAPITAL N&#xA;  old-name: DOUBLE-STRUCK N&#xA;  general-category: Lu (Letter, Uppercase)&#xA;  decomposition: (font 78) (font 'N')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Important part: &lt;strong&gt;display: no font available&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It should be possible to set that in our &lt;em&gt;.Xresources&lt;/em&gt; file:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;With the X resource ‘Emacs.Font’, you can specify a fontset name&#xA;just like an actual font name.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I do not know what is a proper syntax for that though.&lt;/p&gt;&#xA;&lt;p&gt;Before that change I was able to see a lot of unicode glyphs not supported by my font of choice.&#xA;After that change — I can only see one font in my Emacs and empty boxes-placeholders for glyphs not supported by it.&lt;/p&gt;&#xA;&lt;p&gt;It works in my system and &lt;strong&gt;should be enough for now before someone&#xA;else give you a detailed, technical and correct answer&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="220" LastEditorUserId="21090" LastEditDate="2023-07-19T18:13:16.837" LastActivityDate="2023-07-19T18:13:16.837" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="5715" PostTypeId="2" ParentId="5695" CreationDate="2014-12-24T21:57:11.800" Score="7" Body="&lt;p&gt;You can't.  A proper text layout for proportional fonts would require dynamic re-filling of paragraphs, which is generally impossible to do correctly with info documents, since they contain no semantic information at all.  Same for docstrings, which you see in Help Mode, except that these don't even start with any markup at all...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence it's impossible to know a given paragraph could be re-filled, if at all.  In other words, the Info viewer has no chance to find out whether a paragraph is free text, or preformatted text like a source code example, which must not be refilled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's a big weakness of Info and one if the reasons why Emacs' documentation infrastructure is in dire need of modernisation.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-02-10T12:25:19.717" LastActivityDate="2015-02-10T12:25:19.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5716" PostTypeId="1" AcceptedAnswerId="5717" CreationDate="2014-12-24T22:57:57.313" Score="3" ViewCount="555" Body="&lt;p&gt;I just installed the pt.el package and now I want to bind projectile-pt to the default projectile search prefix (which is &lt;code&gt;C-c p s&lt;/code&gt;). &#xA;The goal is to have it as &lt;code&gt;C-c p s p&lt;/code&gt; to begin with but also to have this follow the projectile prefix if I later change that to C-p for example (it would then automatically become C-p s p). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? Sorry for the perhaps badly phrased question, will reword it if needed later. &lt;/p&gt;&#xA;" OwnerUserId="450" LastEditorUserId="450" LastEditDate="2014-12-25T20:08:44.273" LastActivityDate="2014-12-25T20:08:44.273" Title="How do I add a keybinding to a keymap that is on a prefix key" Tags="|key-bindings|keymap|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5717" PostTypeId="2" ParentId="5716" CreationDate="2014-12-24T23:59:12.627" Score="5" Body="&lt;p&gt;The bindings for projectile are stored in &lt;code&gt;projectile-command-map&lt;/code&gt;, so we can use &lt;code&gt;define-key&lt;/code&gt; to add more stuff: &lt;code&gt;(define-key projectile-command-map (kbd &quot;s p&quot;) #'projectile-pt)&lt;/code&gt;.  This adds &lt;code&gt;s p&lt;/code&gt; to whatever &lt;code&gt;projectile-keymap-prefix&lt;/code&gt; happens to be.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-12-24T23:59:12.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5718" PostTypeId="2" ParentId="5705" CreationDate="2014-12-25T01:12:59.790" Score="22" Body="&lt;p&gt;You will be more comfortable in an X11 Emacs, which can receive keyboard input and display text without going through &lt;a href=&quot;https://unix.stackexchange.com/questions/116629/how-do-keyboard-input-and-text-output-work&quot;&gt;encoding and decoding for the terminal&lt;/a&gt;. The main reason to use a text mode editor is to run it inside screen or tmux on a remote machine, but thanks to Tramp, it's usually easier to edit the remote file in your local Emacs. That being said, you can do what you want as long as your terminal emulator cooperates, which is the case with Xterm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you press a key or key combination in a terminal, it is transmitted to the application running in the terminal as a sequence of one or more characters. For example, when you press &lt;kbd&gt;a&lt;/kbd&gt;, the application receives &lt;code&gt;a&lt;/code&gt;. When you press &lt;kbd&gt;Enter&lt;/kbd&gt;, the application receives the character &lt;code&gt;CR&lt;/code&gt; (a.k.a. &lt;code&gt;^M&lt;/code&gt; (pronounced “control-emm”), a.k.a. character number 13, a.k.a. &lt;code&gt;\r&lt;/code&gt; or &lt;code&gt;\015&lt;/code&gt;). Key combinations involving &lt;kbd&gt;Alt&lt;/kbd&gt; are typically transmitted as the character &lt;code&gt;ESC&lt;/code&gt; (a.ka. &lt;code&gt;^[&lt;/code&gt; a.k.a. &lt;code&gt;\e&lt;/code&gt; or &lt;code&gt;\033&lt;/code&gt;) followed by the sequence for the key or key combination without &lt;kbd&gt;Alt&lt;/kbd&gt;. Function keys and other key combinations are transmitted as escape sequences beginning with &lt;code&gt;\e[&lt;/code&gt; or &lt;code&gt;\eO&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The escapes sequences are not fully standardized, and terminals typically ignore certain attributes for certain keys. For example, the hyper and super modifiers are usually ignored. You can see what your terminal sends for a key combination by pressing &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;V&lt;/kbd&gt; followed by that key combination in a shell prompt, or &lt;code&gt;C-q&lt;/code&gt; or &lt;code&gt;C-h c&lt;/code&gt; followed by the key combination in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Xterm lets you configure the escape sequences for each key through &lt;a href=&quot;http://www.x.org/archive/X11R7.5/doc/man/man7/X.7.html#sect13&quot; rel=&quot;noreferrer&quot;&gt;X resources&lt;/a&gt;. Most setups read resources from &lt;code&gt;~/.Xresources&lt;/code&gt; when X starts, and you can load the file manually with &lt;code&gt;xrdb -merge ~/.Xresources&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XTerm.VT100.translations:       #override \n\&#xA;    Ctrl ~Shift ~Meta &amp;lt;Key&amp;gt; Return: string(&quot;\033[73;5~&quot;) \n\&#xA;    Ctrl Shift ~Meta &amp;lt;Key&amp;gt; percent: string(&quot;\033[37;6~&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A common convention uses escape sequences of the form &lt;code&gt;ESC [ number1 ; number2 ~&lt;/code&gt; for function keys with modifiers. &lt;code&gt;number1&lt;/code&gt; indicates the function key (&lt;code&gt;15&lt;/code&gt; to &lt;code&gt;24&lt;/code&gt; for &lt;kbd&gt;F5&lt;/kbd&gt; to &lt;kbd&gt;F12&lt;/kbd&gt; — for historical reasons, F1 through &lt;kbd&gt;F4&lt;/kbd&gt; have different escape sequences) and &lt;code&gt;number2&lt;/code&gt; indicates the modifier (&lt;code&gt;2&lt;/code&gt; for &lt;kbd&gt;Shift&lt;/kbd&gt;, &lt;code&gt;5&lt;/code&gt; for &lt;kbd&gt;Ctrl&lt;/kbd&gt;, &lt;code&gt;3&lt;/code&gt; for &lt;kbd&gt;Meta&lt;/kbd&gt;, &lt;code&gt;8&lt;/code&gt; for &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Meta&lt;/kbd&gt;, and add 1 for +&lt;kbd&gt;Shift&lt;/kbd&gt; — no, it isn't very consistent).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll have to specify the Hyper and Super modifiers through their number, as &lt;code&gt;Mod1&lt;/code&gt; through &lt;code&gt;Mod5&lt;/code&gt;. Run &lt;code&gt;xmodmap -pm&lt;/code&gt; to see the mapping of keysyms to modifiers. For example, if &lt;code&gt;Super_L&lt;/code&gt; is bound to Mod5, then the following line (use this exact case) defines a binding for &lt;kbd&gt;Super&lt;/kbd&gt;+&lt;kbd&gt;Space&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ~Ctrl ~Meta Mod5 &amp;lt;Key&amp;gt; space: string(&quot;\033[32;16~&quot;) \n\&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs translates escape sequences into its internal key representation through &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;input-decode-map&lt;/code&gt; or &lt;code&gt;local-function-key-map&lt;/code&gt;&lt;/a&gt; (or &lt;code&gt;function-key-map&lt;/code&gt; before Emacs 23).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key local-function-key-map &quot;\033[32;16~&quot; [(super ?\ )])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt; This post is made of 80% recycled material from &lt;a href=&quot;https://unix.stackexchange.com/questions/79374/are-there-any-linux-terminals-which-can-handle-all-key-combinations/79561#79561&quot;&gt;Are there any linux terminals which can handle all key combinations?&lt;/a&gt; &lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2014-12-27T19:16:45.940" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="5719" PostTypeId="1" AcceptedAnswerId="5933" CreationDate="2014-12-25T02:24:32.530" Score="9" ViewCount="3354" Body="&lt;p&gt;(current as of org 8.2.10)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a thing (&lt;a href=&quot;https://github.com/talexand/gitscroll&quot; rel=&quot;noreferrer&quot;&gt;shameless plug&lt;/a&gt;) that outputs a simple snippet of org-headings in a single file that look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* little boys&#xA;  - snakes&#xA;  - snails&#xA;  - puppy dog tails&#xA;* little girls&#xA;  - sugar&#xA;  - spice&#xA;  - everything nice&#xA;** addendum&#xA;  - etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These are meant to go into another file through &lt;code&gt;org-insert&lt;/code&gt; functions, specifically, a subheading of that other file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to do that I have to demote all of the headings so that they slide nicely into place. How can I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x r t&lt;/code&gt; to prepend asterisks; this adds asterisks to every line&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x h M-S-&amp;lt;right&amp;gt;&lt;/code&gt; to try demoting the whole selection; this only demoted the first line&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Further issue: org-metaright does not demote subtrees&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Commenters were correct that &lt;code&gt;C-x h M-&amp;lt;right&amp;gt;&lt;/code&gt; (&lt;code&gt;org-metaright&lt;/code&gt;) promotes or demotes visible selections. However, this ignores their subtrees, resulting in reordering of their substructure. The same behavior occurs with &lt;code&gt;org-do-demote&lt;/code&gt; called on a selection.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2014-12-31T00:14:11.987" LastActivityDate="2020-10-29T13:59:26.617" Title="How do I demote/promote selected subtrees?" Tags="|org-mode|" AnswerCount="5" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5720" PostTypeId="2" ParentId="5711" CreationDate="2014-12-25T03:19:28.720" Score="2" Body="&lt;p&gt;When running &lt;code&gt;undo&lt;/code&gt;, there are two possibilities. Either you're undoing something, or redoing something. You can tell the difference by what gets echoed to the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my Emacs (24.3.1), after explicitly setting the modified status of the buffer to &lt;code&gt;nil&lt;/code&gt;, any &quot;undo&quot; results in setting the buffer status to edited, but &quot;redo&quot; does not change the buffer status. This appears to be a bug in Emacs, and should be reported.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-12-25T03:19:28.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5722" PostTypeId="1" AcceptedAnswerId="5744" CreationDate="2014-12-25T09:32:57.397" Score="2" ViewCount="1105" Body="&lt;p&gt;Is there a template to create a group of directories and files for a new project?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;List of predefined directories:  &lt;code&gt;(.c .c_b .o .o_b .docs .invoices)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;List of predefined blank files:  &lt;code&gt;(1add.txt .../invoices/costs.txt)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x template-setup&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(read-string &quot;Please select your project root directory:  &quot; default-directory)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If file or directory already exists, then skip and keep on going creating the remainder.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-12-29T22:22:51.717" Title="Is there a template to create a project of directories and files?" Tags="|elisp|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5723" PostTypeId="1" AcceptedAnswerId="5724" CreationDate="2014-12-25T09:36:14.060" Score="2" ViewCount="402" Body="&lt;pre&gt;&lt;code&gt;for pid in $(ps -ef | grep &quot;chrome&quot; | awk '{print $2}'); do kill -9 $pid; done&#xA;&#xA;Invalid read syntax: &quot;)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the right way to run this script in Eshell?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="25" LastEditDate="2015-02-16T18:09:31.077" LastActivityDate="2015-02-16T18:09:31.077" Title="What's eshell's syntax for command substitution?" Tags="|eshell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5724" PostTypeId="2" ParentId="5723" CreationDate="2014-12-25T09:58:24.843" Score="4" Body="&lt;p&gt;Ask Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h i&lt;/code&gt; to open info&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;g(eshell)for loop&lt;/code&gt; to open the node on for loops in eshell&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x info-display-manual RET eshell RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;gfor loop&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/eshell/for-loop.html#for-loop&quot; rel=&quot;nofollow&quot;&gt;There it says&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Because Eshell commands can not (easily) be combined with lisp forms,&#xA;  Eshell provides a command-oriented `for'-loop for convenience.  The&#xA;  syntax is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`for VAR in TOKENS { command invocation(s) }'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;where TOKENS is a space-separated sequence of values of VAR for&#xA;  each iteration.  This can even be the output of a command if TOKENS&#xA;  is replaced with `{ command invocation }'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For your particular problem you have to remember that some commands have been replaced with eshell internals, including &lt;code&gt;kill&lt;/code&gt;.  If you can't kill a process with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for pid in { ps -ef | grep &quot;chrome&quot; | awk '{print $2}' } {kill $pid}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;try this instead&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for pid in { ps -ef | grep &quot;chrome&quot; | awk '{print $2}' } {/usr/bin/kill $pid}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or possibly better:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for pid in { pgrep &quot;chrome&quot; } {/usr/bin/kill $pid}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="25" LastEditDate="2015-02-16T18:07:57.640" LastActivityDate="2015-02-16T18:07:57.640" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5725" PostTypeId="1" AcceptedAnswerId="5728" CreationDate="2014-12-25T12:18:03.497" Score="9" ViewCount="3054" Body="&lt;p&gt;In emacs with helm, I can &lt;code&gt;C-x C-f&lt;/code&gt; find file. After type part of the folder name, helm find the right folder. At this point, I can&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;hit &lt;kbd&gt;Enter&lt;/kbd&gt; to enter Dired mode. and &lt;code&gt;C-s&lt;/code&gt; to search a second level folder...&lt;/li&gt;&#xA;&lt;li&gt;or hit &lt;kbd&gt;tab&lt;/kbd&gt; to complete the folder name, and continue type part of the second foler name.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there a way to find-file quicker like in the sublime text editor? (fuzzy search both the file names and folder names).&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-25T15:15:56.380" Title="Quicker way in Find-file with helm?" Tags="|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5726" PostTypeId="1" AcceptedAnswerId="5727" CreationDate="2014-12-25T13:48:15.553" Score="2" ViewCount="121" Body="&lt;p&gt;I have a bunch of software git-cloned into my &lt;code&gt;site-lisp/&lt;/code&gt; directory. It and all of its sub-directories are in my &lt;code&gt;load-path&lt;/code&gt;. The problem I noticed is that &lt;code&gt;package-install&lt;/code&gt; sometimes insists on pulling dependencies into &lt;code&gt;elpa/&lt;/code&gt; even when such packages already exist in &lt;code&gt;site-lisp/&lt;/code&gt;. To be more specific:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package-install helm-descbinds&lt;/code&gt; insists on installing Helm 1.5 even though not only do I have the latest helm in in my &lt;code&gt;load-path&lt;/code&gt; from &lt;code&gt;site-lisp/helm/&lt;/code&gt; but by the time the install gets called, &lt;code&gt;(require 'helm-config)&lt;/code&gt; will have happened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Who's at fault here? Is it the &lt;code&gt;helm-descbinds&lt;/code&gt; package itself and I should be raising an issue with its maintainers? Or is there some obvious knob I need to turn in packages so the existing functionality gets picked up? Basically I just want to be sure that stuff in &lt;code&gt;site-lisp/&lt;/code&gt; gets precedence. This very well maybe the case already, but then why install stuff that's already available?&lt;/p&gt;&#xA;" OwnerUserId="509" LastEditorUserId="25" LastEditDate="2014-12-25T13:58:45.460" LastActivityDate="2014-12-25T15:18:42.470" Title="package-install doesn't pick up dependencies that are already in site-lisp" Tags="|package|load-path|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5727" PostTypeId="2" ParentId="5726" CreationDate="2014-12-25T13:55:14.053" Score="1" Body="&lt;p&gt;It's alright if &lt;code&gt;package&lt;/code&gt; installs a different &lt;code&gt;helm&lt;/code&gt; version.&#xA;The important part is which version gets &lt;code&gt;require&lt;/code&gt;'d first.&#xA;So if you put your &lt;code&gt;(require 'helm-config)&lt;/code&gt; earlier than &lt;code&gt;package&lt;/code&gt; does,&#xA;you're fine.&#xA;Just to make sure that you have to correct one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;git-helm-path&quot;)&#xA;(require 'helm-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;edit:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It seems from your comments is that your issue is with &lt;code&gt;PATH&lt;/code&gt;&#xA;priorities. &lt;code&gt;load-path&lt;/code&gt; is just like &lt;code&gt;PATH&lt;/code&gt; in Unix: the first file on&#xA;the list that provides &lt;code&gt;helm&lt;/code&gt; will be loaded when you require &lt;code&gt;helm&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's fine to have multiple versions of &lt;code&gt;helm&lt;/code&gt; on the path, as long as&#xA;you know what you're doing. If you want a relaxed approach, just&#xA;delete your git stuff and leave everything to the package manager.&#xA;Otherwise, you'll have to work for it and make sure that your&#xA;&lt;code&gt;load-path&lt;/code&gt; is properly set up. There's no magic pill, otherwise we'd&#xA;have it in Unix.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2014-12-25T15:18:42.470" LastActivityDate="2014-12-25T15:18:42.470" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5728" PostTypeId="2" ParentId="5725" CreationDate="2014-12-25T14:21:04.703" Score="10" Body="&lt;p&gt;You can use Helm Projectile to jump around files in projects easily. There are &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot;&gt;some demos at the top of my guide&lt;/a&gt;. You can even treat any directory as a project and jump to anywhere by making an empty &lt;code&gt;.projectile&lt;/code&gt; file in that directory, if your project is not directly supported by Projectile. Projectile not only provides jumping to files/directories from anywhere at anytime, but you can also jump to any file at cursor, in any file without merely the filename.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For jumping to find, use &lt;code&gt;helm-projectile-find-file&lt;/code&gt;, bound to &lt;kbd&gt;C-c p f&lt;/kbd&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For jumping to directory, use &lt;code&gt;helm-projectile-dir&lt;/code&gt;, bound to &lt;kbd&gt;C-c p d&lt;/kbd&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To switch between recognized projects, use &lt;code&gt;helm-projectile-projects&lt;/code&gt;, bound to C-c p p.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Projectile can possibly be used in a directory with a large number of files (i.e. your home directory with something like 80k-100k files) by enable caching:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-enable-caching t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depend on your hard drive, the first time starting &lt;code&gt;helm-projectile-find-file&lt;/code&gt; may take a while to retrieve the file list and block Emacs. But this only happens &lt;strong&gt;once&lt;/strong&gt;. Subsequent access you get the file list instantly until you invalidate the cache.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can fuzzy match without entering a space between search terms. The difference is that, if you add a space, Helm reverts to its old matching behavior: exact match with regex. Without a space, Helm uses the fuzzy matching similar to the one you see in Sublime Text.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-12-25T15:15:56.380" LastActivityDate="2014-12-25T15:15:56.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5729" PostTypeId="1" AcceptedAnswerId="5764" CreationDate="2014-12-25T16:57:10.167" Score="7" ViewCount="1577" Body="&lt;p&gt;I frequently need to split strings, while keeping the &lt;code&gt;separator&lt;/code&gt;. Researching the elisp manual, I am not finding a way to split a string according to a separator, without consuming the separator itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;split-string&lt;/code&gt; splits a given string into substrings based on the regular expression separators, but the substrings lose the separator:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(split-string &quot;* one * two * three&quot; &quot;\*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;&quot; &quot; one &quot; &quot; two &quot; &quot; three&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could use &lt;code&gt;s-slice-at&lt;/code&gt;, from @magnars &lt;a href=&quot;https://github.com/magnars/s.el#s-slice-at-regexp-s&quot; rel=&quot;noreferrer&quot; title=&quot;s.el&quot;&gt;s.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(s-slice-at &quot;\*&quot; &quot;* one * two * three&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;* one &quot; &quot;* two &quot; &quot;* three&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could also try to rewrite &lt;code&gt;split-string&lt;/code&gt; myself. Still, I was wondering if there is a built-in way to do it as part of Emacs core?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, could somebody please point to a good way to do that properly?&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="249" LastEditDate="2014-12-27T08:39:42.360" LastActivityDate="2014-12-27T08:39:42.360" Title="Split a string without consuming separators?" Tags="|elisp|string|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5730" PostTypeId="2" ParentId="5729" CreationDate="2014-12-25T17:32:12.523" Score="5" Body="&lt;p&gt;Here's some code for you. This is a slightly modified &lt;code&gt;split-string&lt;/code&gt;.&#xA;I've removed &lt;code&gt;trim&lt;/code&gt; option for simplicity and added &lt;code&gt;keep-sep&lt;/code&gt; option.&#xA;The diff is basically 2 lines, so you could say that this code is idiomatic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun split-string (string &amp;amp;optional separators omit-nulls keep-sep)&#xA;  &quot;Split STRING into substrings bounded by matches for SEPARATORS.&quot;&#xA;  (let* ((keep-nulls (not (if separators omit-nulls t)))&#xA;         (rexp (or separators split-string-default-separators))&#xA;         (start 0)&#xA;         this-start this-end&#xA;         notfirst&#xA;         (list nil)&#xA;         (push-one&#xA;          (lambda ()&#xA;            (when (or keep-nulls (&amp;lt; this-start this-end))&#xA;              (let ((this (substring string this-start this-end)))&#xA;                (when (or keep-nulls (&amp;gt; (length this) 0))&#xA;                  (push this list)))))))&#xA;    (while (and (string-match&#xA;                 rexp string&#xA;                 (if (and notfirst&#xA;                          (= start (match-beginning 0))&#xA;                          (&amp;lt; start (length string)))&#xA;                     (1+ start) start))&#xA;                (&amp;lt; start (length string)))&#xA;      (setq notfirst t)&#xA;      (setq this-start start this-end (match-beginning 0)&#xA;            start (match-end 0))&#xA;      (funcall push-one)&#xA;      (when keep-sep&#xA;        (push (match-string 0 string) list)))&#xA;    (setq this-start start this-end (length string))&#xA;    (funcall push-one)&#xA;    (nreverse list)))&#xA;&#xA;(split-string &quot;* one * two * three&quot; &quot;\*&quot; t t)&#xA;;; -&amp;gt; (&quot;*&quot; &quot; one &quot; &quot;*&quot; &quot; two &quot; &quot;*&quot; &quot; three&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-25T17:32:12.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5731" PostTypeId="1" CreationDate="2014-12-25T17:52:41.783" Score="2" ViewCount="714" Body="&lt;p&gt;One of the great features of Emacs is its ability to handle bidirectional support for the right-to-left languages (like Hebrew, Arabic and Persian). Note that even in these languages mathematical formulae are written from left-to-right. So when typing a mathematical formula (usually between $ $) in a right-to-left line, it would be desirable to temporary force the direction left-to-right. For example in the following line I have written $V^*$ but Emacs shows it in reverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hObVn.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the setting &lt;code&gt;(setq bidi-paragraph-direction 'left-to-right)&lt;/code&gt; can be used to change to the correct direction. Also the variable &lt;code&gt;texmathp&lt;/code&gt; can be used to determine if the cursor is in a math environment (see &lt;a href=&quot;https://emacs.stackexchange.com/q/547/2609&quot;&gt;how to detect if inside a LaTeX math environment?&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/a/548/2609&quot;&gt;https://emacs.stackexchange.com/a/548/2609&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't know to put these altogether. So my question is  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to force the direction from right-to-left in a math environment?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2014-12-28T16:10:13.600" Title="How to force the variable 'bidi-paragraph-direction' taking the value 'left-to-right' in a math environment in LaTeX-mode" Tags="|latex|auctex|bidirectional-support|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5732" PostTypeId="1" AcceptedAnswerId="5753" CreationDate="2014-12-25T18:03:45.487" Score="5" ViewCount="4132" Body="&lt;h2&gt;TL;DR:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I have a string with characters that are unencodable in UTF-8, and I&#xA;need to remove these characters before writing the string to a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, the following snippet creates a file that contains an&#xA;invalid UTF-8 byte sequence. I would like this sequence to just not be&#xA;present in the output file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((coding-system-for-write 'utf-8))&#xA;  (write-region &quot;This is invalid: \x19008e&quot; nil &quot;~/outputfile&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By checking this character with &lt;code&gt;describe-char&lt;/code&gt;, I can see Emacs &lt;em&gt;knows&lt;/em&gt; it is not encodable through UTF-8. So there must be a way to detect these characters and remove them.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;The Background&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I have an emacs-lisp script which converts docstrings to html files,&#xA;which must be entirely in UTF-8. The following snippet shows&#xA;essentially what I've been doing so far.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-temp-file output-file&#xA;  (insert symbol-name &quot;\n&quot; symbol-documentation)&#xA;  (set-buffer-file-coding-system 'no-conversion))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;symbol-documentation&lt;/code&gt; is the string returned by&#xA;&lt;code&gt;describe-variable&lt;/code&gt; (the content of the Help buffer). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seemed to work fine at first, but now I've realised this was&#xA;causing some files to contain byte-sequences that are not valid UTF-8.&#xA;Some perpetrators are &lt;code&gt;tibetan-precomposition-rule-alist&lt;/code&gt;,&#xA;&lt;code&gt;language-info-alist&lt;/code&gt;, &lt;code&gt;composition-function-table&lt;/code&gt;. By manually&#xA;checking their documentation, I can see my Emacs indeed fails to&#xA;comprehend part of the content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q: How can I ensure only valid UTF-8 byte sequences are written to the output file?&lt;/strong&gt;&lt;br&gt;&#xA;I'm perfectly fine with skipping these invalid sequences entirely&#xA;(instead of trying to understand them). I just want to make sure the&#xA;output file is valid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried changing &lt;code&gt;no-conversion&lt;/code&gt; to &lt;code&gt;utf-8&lt;/code&gt;, but then my script gets&#xA;interrupted by a &lt;code&gt;Select coding system:&lt;/code&gt; prompt, and the problem&#xA;still happens.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2014-12-25T19:25:30.463" LastActivityDate="2014-12-28T17:23:25.290" Title="How to strip invalid UTF-8 characters from a string?" Tags="|character-encoding|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5733" PostTypeId="2" ParentId="5722" CreationDate="2014-12-25T18:04:08.573" Score="2" Body="&lt;p&gt;&lt;strong&gt;Initial Draft&lt;/strong&gt; (December 25, 2014):  The following is a revised initial draft.  It incorporates a lesson learned from @tarsius as to using a let-bound &lt;code&gt;default-directory&lt;/code&gt; with &lt;code&gt;start-process&lt;/code&gt; ( &lt;a href=&quot;https://emacs.stackexchange.com/a/5739/2287&quot;&gt;https://emacs.stackexchange.com/a/5739/2287&lt;/a&gt; ) [i.e., it &lt;em&gt;must&lt;/em&gt; have a trailing forward slash]; and, a lesson learned from @legoscia regarding using &lt;code&gt;lexical-let&lt;/code&gt; to penetrate the &lt;code&gt;set-process-sentinel&lt;/code&gt; hierarchy with a temporary variable value ( &lt;a href=&quot;https://stackoverflow.com/a/24549625/2112489&quot;&gt;https://stackoverflow.com/a/24549625/2112489&lt;/a&gt; ); and, a prior discovery of mine regarding using &lt;code&gt;recursive-edit&lt;/code&gt; to temporarily hold off going through the remainder of a function until the sub-processes have finished ( &lt;a href=&quot;https://stackoverflow.com/questions/23237869/fine-tuning-set-process-sentinel-set-process-filter-start-process&quot;&gt;https://stackoverflow.com/questions/23237869/fine-tuning-set-process-sentinel-set-process-filter-start-process&lt;/a&gt; ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; (December 29, 2014):  Removed &lt;code&gt;default-directory&lt;/code&gt; from &lt;code&gt;lexical-let&lt;/code&gt; and also from the let-bound wrap around of the &lt;code&gt;start-process&lt;/code&gt; statement -- said code was not needed.  &lt;code&gt;recursive-edit&lt;/code&gt; is now a part of the &lt;code&gt;mapcar&lt;/code&gt; section of code relating to file creation -- exiting occurs each time a new file has been created.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* (&#xA;    (proposed-directories '(&#xA;      &quot;0.pdd_fdd&quot; &quot;0.oah&quot; &quot;0.c&quot; &quot;0.c_b&quot; &quot;0.o&quot; &quot;0.o_b&quot; &quot;0.f&quot; &quot;0.discovery&quot;&#xA;      &quot;0.docs&quot; &quot;0.deeds&quot; &quot;0.pleadings&quot; &quot;0.invoices&quot;))&#xA;    (proposed-filenames '(&quot;1add.txt&quot; &quot;0.invoices/bill.txt&quot;))&#xA;    (default-directory (file-name-as-directory ;; ensure there is a trailing forward slash&#xA;      (read-string &quot;Set the temporary default directory: &quot; default-directory))) )&#xA;  (mapcar&#xA;    (lambda (x) (make-directory x t))&#xA;    proposed-directories)&#xA;  (mapcar&#xA;    (lambda (x)&#xA;      (lexical-let ((x x))&#xA;        (set-process-sentinel&#xA;          (start-process &quot;touch-file&quot; nil &quot;touch&quot; x)&#xA;          (lambda (p e)&#xA;            (when (= 0 (process-exit-status p))&#xA;              (message &quot;Created:  %s&quot; x)&#xA;              (throw 'exit nil)))))&#xA;      (recursive-edit))&#xA;       proposed-filenames)&#xA;  (when (eq major-mode 'dired-mode)&#xA;    (revert-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-12-29T22:22:51.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5734" PostTypeId="2" ParentId="5708" CreationDate="2014-12-25T18:58:34.740" Score="4" Body="&lt;p&gt;&lt;strong&gt;Comment to answer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a program called &lt;code&gt;runemacs.exe&lt;/code&gt; under Windows, that should prevent the DOS prompt from being opened. &lt;/p&gt;&#xA;" OwnerUserId="943" LastActivityDate="2014-12-25T18:58:34.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5735" PostTypeId="1" AcceptedAnswerId="5739" CreationDate="2014-12-25T19:36:29.973" Score="6" ViewCount="647" Body="&lt;p&gt;Is it possible to set the &lt;code&gt;default-directory&lt;/code&gt; temporarily (e.g., let-bound) when using &lt;code&gt;start-process&lt;/code&gt;?  If so, how please.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;/Users/HOME/Desktop/tmp&quot;))&#xA;  (start-process &quot;touch-file&quot; nil &quot;touch&quot; &quot;test.txt&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;start-process&lt;/code&gt; ignores a let-bound &lt;code&gt;default-directory&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-12-25T21:56:00.520" Title="Temporarily set the `default-directory` for `start-process`" Tags="|process|subprocess|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5736" PostTypeId="2" ParentId="5735" CreationDate="2014-12-25T20:14:20.637" Score="4" Body="&lt;p&gt;Just expand the file name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;/Users/HOME/Desktop/tmp&quot;))&#xA;  (start-process &quot;touch-file&quot; nil &quot;touch&quot;&#xA;                 (expand-file-name &quot;test.txt&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-25T20:14:20.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5737" PostTypeId="1" AcceptedAnswerId="5771" CreationDate="2014-12-25T20:59:14.587" Score="2" ViewCount="378" Body="&lt;p&gt;&lt;code&gt;c-electric-lt-gt&lt;/code&gt; in &lt;code&gt;cc-cmds.el.gz&lt;/code&gt; treats &lt;code&gt;&amp;gt;&lt;/code&gt; as a closing paren only if it isn't immediately followed by another &lt;code&gt;&amp;gt;&lt;/code&gt;. This behaviour is incorrect for C++11 and I tried to modify it by changing the order of the checks in that function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I recompile this compressed file? Calling &lt;code&gt;byte-recompile-file&lt;/code&gt; on &lt;code&gt;cc-cmds.el.gz&lt;/code&gt; failed on the first &lt;code&gt;require&lt;/code&gt; statement - &lt;code&gt;(require 'cc-defs)&lt;/code&gt;. However, &lt;code&gt;cc-defs&lt;/code&gt; is provided in the &lt;code&gt;cc-defs.el.gz&lt;/code&gt; file present in the same directory as &lt;code&gt;cc-cmds.el.gz&lt;/code&gt;. Also, simply evaluating &lt;code&gt;(require 'cc-defs)&lt;/code&gt; in &lt;code&gt;ielm&lt;/code&gt; works without any errors.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2014-12-25T21:05:55.803" LastActivityDate="2014-12-27T00:33:03.497" Title="Recompile a .gz file in emacs' progmodes directory" Tags="|elisp|byte-compilation|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5738" PostTypeId="2" ParentId="5737" CreationDate="2014-12-25T21:18:24.650" Score="2" Body="&lt;p&gt;I'm thinking if you're doing something, might as well do it right.&#xA;Messing about probably in your &lt;code&gt;/usr/local/&lt;/code&gt; isn't good.&#xA;Do this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone git://git.savannah.gnu.org/emacs.git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make your changes&lt;/li&gt;&#xA;&lt;li&gt;Track your changes with git&lt;/li&gt;&#xA;&lt;li&gt;Install your changes with &lt;code&gt;sudo make install&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Propagate your changes with &lt;code&gt;git format-patch&lt;/code&gt; and &lt;code&gt;emacs-devel@gnu.org&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-25T21:18:24.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5739" PostTypeId="2" ParentId="5735" CreationDate="2014-12-25T21:56:00.520" Score="8" Body="&lt;p&gt;&lt;code&gt;default-directory&lt;/code&gt; has to be a directory, not the filename of a directory. In other words it has to end with a slash. In some places it does not matter whether a directory path ends with a slash or not, here it does.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;/some/directory/&quot;))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-25T21:56:00.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5740" PostTypeId="1" AcceptedAnswerId="5743" CreationDate="2014-12-26T02:55:18.480" Score="5" ViewCount="847" Body="&lt;p&gt;When input some code in orgmode, I can type:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;s&lt;/code&gt; &lt;kbd&gt;Tab&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and it expands to this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+BEGIN_SRC&lt;/code&gt; &lt;kbd&gt;cursor&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+END_SRC&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is fine for writing something from scratch. But most of the time, I'd copy some paragraph which contains some code. (Code interposed in paragraphs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this scenario, after Tab, I have to select the code snippet, cut and paste them between BEGIN and END. Or cut the END_SRC, paste it at the end of the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ideal process would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select some code&lt;/li&gt;&#xA;&lt;li&gt;run a command, the code is well formatted by the BEGIN, END markdowns.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="3872" LastEditDate="2014-12-26T03:05:46.760" LastActivityDate="2017-03-09T03:28:59.853" Title="How to quickly format selected code in org-mode?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5741" PostTypeId="1" AcceptedAnswerId="20438" CreationDate="2014-12-26T03:00:48.687" Score="17" ViewCount="3090" Body="&lt;p&gt;Generating today's agenda in Org-Mode (&lt;code&gt;C-c a a&lt;/code&gt;) opens the files in &lt;code&gt;org-agenda-files&lt;/code&gt;.  I don't want Emacs to open these extra buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to tell Emacs not to open these buffers? (or what is the same, to automatically close them if they weren't open before calling the agenda?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a more compact version of the solution provided by @lawlist:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(defun my-org-keep-quiet (orig-fun &amp;amp;rest args)&#xA;  (let ((buffers-pre (-filter #'get-file-buffer (org-agenda-files))))&#xA;    (apply orig-fun args)&#xA;    (let* ((buffers-post (-filter #'get-file-buffer (org-agenda-files)))&#xA;           (buffers-new  (-difference buffers-post buffers-pre)))&#xA;      (mapcar (lambda (file) (kill-buffer (get-file-buffer file))) buffers-new))))&#xA;&#xA;(advice-add 'org-agenda-list :around #'my-org-keep-quiet)&#xA;(advice-add 'org-search-view :around #'my-org-keep-quiet)&#xA;(advice-add 'org-tags-view   :around #'my-org-keep-quiet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Regrettably, this still is not perfect, as now clicking on an event in the agenda does not open the corresponding org file.&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="2728" LastEditDate="2014-12-26T21:21:28.600" LastActivityDate="2016-08-09T19:08:51.747" Title="do not keep org-agenda-files open after generating agenda" Tags="|org-mode|org-agenda|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5742" PostTypeId="2" ParentId="5741" CreationDate="2014-12-26T04:20:16.753" Score="4" Body="&lt;p&gt;The &lt;code&gt;org-agenda-files&lt;/code&gt; buffer(s) should &lt;em&gt;not&lt;/em&gt; be killed until after the search functions have finished.  The three (3) most common search functions used to generate an &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer are:  &lt;code&gt;org-agenda-list&lt;/code&gt;; &lt;code&gt;org-search-view&lt;/code&gt;; and &lt;code&gt;org-tags-view&lt;/code&gt;.  &lt;code&gt;org-agenda-files&lt;/code&gt; is both a variable and a function -- two different, but related, animals.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar opened-org-agenda-files nil)&#xA;&#xA;(defun opened-org-agenda-files ()&#xA;  (let ((files (org-agenda-files)))&#xA;    (setq opened-org-agenda-files nil)&#xA;    (mapcar&#xA;      (lambda (x)&#xA;        (when (get-file-buffer x)&#xA;          (push x opened-org-agenda-files)))&#xA;      files)))&#xA;&#xA;(defun kill-org-agenda-files ()&#xA;  (let ((files (org-agenda-files)))&#xA;    (mapcar&#xA;      (lambda (x)&#xA;        (when&#xA;            (and&#xA;              (get-file-buffer x)&#xA;              (not (member x opened-org-agenda-files)))&#xA;          (kill-buffer (get-file-buffer x))))&#xA;      files)))&#xA;&#xA;(defadvice org-agenda-list (around opened-org-agenda-list-around activate)&#xA;  (opened-org-agenda-files)&#xA;  ad-do-it&#xA;  (kill-org-agenda-files))&#xA;&#xA;(defadvice org-search-view (around org-search-view-around activate)&#xA;  (opened-org-agenda-files)&#xA;  ad-do-it&#xA;  (kill-org-agenda-files))&#xA;&#xA;(defadvice org-tags-view (around org-tags-view-around activate)&#xA;  (opened-org-agenda-files)&#xA;  ad-do-it&#xA;  (kill-org-agenda-files))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-12-26T05:36:06.663" LastActivityDate="2014-12-26T05:36:06.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5743" PostTypeId="2" ParentId="5740" CreationDate="2014-12-26T06:39:30.240" Score="3" Body="&lt;p&gt;Here's a function that should do what you want. To use it, select a region, and run the command. It will handle putting in the &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; and &lt;code&gt;#+END_SRC&lt;/code&gt; parts on new lines. It happens to leave you at the beginning of the source code block, but that could be changed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-wrap-source ()&#xA;  (interactive)&#xA;  (let ((start (min (point) (mark)))&#xA;        (end (max (point) (mark))))&#xA;    (goto-char end)&#xA;    (unless (bolp)&#xA;      (newline))&#xA;    (insert &quot;#+END_SRC\n&quot;)&#xA;    (goto-char start)&#xA;    (unless (bolp)&#xA;      (newline))&#xA;    (insert &quot;#+BEGIN_SRC\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind this function to an appropriate key if you like.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2014-12-26T06:39:30.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5744" PostTypeId="2" ParentId="5722" CreationDate="2014-12-26T07:13:14.863" Score="4" Body="&lt;p&gt;The package &lt;a href=&quot;https://github.com/chrisbarrett/skeletor.el&quot; rel=&quot;nofollow&quot;&gt;skeletor&lt;/a&gt; allows one to create projects based on predefined templates. It also allows you to define custom project templates. You might want to try it out.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-26T07:13:14.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5745" PostTypeId="1" AcceptedAnswerId="5754" CreationDate="2014-12-26T08:11:19.133" Score="4" ViewCount="1647" Body="&lt;p&gt;Do frames in emacs have a handle the way buffers do? In particular, can I specify that a particular file should be opened in a specified frame? I would like to have two frames where I use one for development and use the other to read documentation and browse tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Tagging the question with emacsclient and linux because I am ok with an answer which requires them.)&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2014-12-26T17:19:29.343" LastActivityDate="2014-12-26T17:19:29.343" Title="Open buffer in a specified frame" Tags="|frames|emacsclient|linux|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5746" PostTypeId="2" ParentId="5702" CreationDate="2014-12-26T08:12:23.407" Score="15" Body="&lt;p&gt;You should disable &lt;code&gt;linum-mode&lt;/code&gt; when opening a PDF file. Otherwise it will hang your Emacs. i.e. only add it to &lt;code&gt;prog-mode&lt;/code&gt; for editing text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook 'linum-on)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To install &lt;code&gt;pdf-tools&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You have to clone the &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;repository&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;git clone &lt;a href=&quot;https://github.com/politza/pdf-tools.git&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/politza/pdf-tools.git&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;cd pdf-tools&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run &lt;code&gt;make&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then, it will produce a &lt;code&gt;pdf-tools-${VERSION}.tar&lt;/code&gt; in the &lt;code&gt;pdf-tools&lt;/code&gt; directory you cloned; in Emacs, &lt;kbd&gt;M-x package-install-file RET pdf-tools-${VERSION}.tar RET&lt;/kbd&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then, put &lt;code&gt;(pdf-tools-install)&lt;/code&gt; somewhere in your init file. From now on, Emacs will use &lt;code&gt;pdf-view-mode&lt;/code&gt; which gives better quality and better rendering speed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is a &lt;a href=&quot;https://i.imgur.com/wu8pMoN.gif&quot; rel=&quot;noreferrer&quot;&gt;demo using pdf-tools&lt;/a&gt;. The PDF file is 28MB and it took a few seconds to open. Note that the quality of the images in the gif are a bit lower quality compared with the actual source, but as you can see the text is crystal clear. I did not record the whole screen to reduce the size of the gif, because it's already 13MB. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use plain Isearch using &lt;kbd&gt;C-s&lt;/kbd&gt; as in other buffers for searching. Don't press too fast, leave about 1 second delay between searches. You should use Isearch to search current page or nearby pages, basically something small. To search the whole document, use &lt;code&gt;pdf-occur&lt;/code&gt;; the command is quite fast. You may want to keep the search results for later use (in the same session) by renaming the occur default &lt;code&gt;*PDF-Occur*&lt;/code&gt; buffer to some other name to avoid it is overridden by future searches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want the table of contents, in the PDF buffer press &lt;kbd&gt;o&lt;/kbd&gt; to open it in &lt;code&gt;outline-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="-1" LastEditDate="2015-06-04T20:58:59.140" LastActivityDate="2015-06-04T20:58:59.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5747" PostTypeId="2" ParentId="3895" CreationDate="2014-12-26T10:02:56.777" Score="7" Body="&lt;p&gt;You can simply make a Dired buffer of the directory where you want to invoke compile command, to serve as an anchor. When you want to compile, switch to the Dired buffer and run compile command. &lt;code&gt;compile&lt;/code&gt; will run its command at this directory of the Dired buffer. The advantage of this is that you don't have to &lt;kbd&gt;M-x cd&lt;/kbd&gt; or traverse directories when you want to compile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;projectile&lt;/code&gt;, it has a command named &lt;code&gt;projectile-compile&lt;/code&gt; that automatically runs compile command at project root recognized by &lt;code&gt;projectile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-12-26T10:09:49.600" LastActivityDate="2014-12-26T10:09:49.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5748" PostTypeId="2" ParentId="5745" CreationDate="2014-12-26T10:05:47.377" Score="-1" Body="&lt;p&gt;I think it's a bit of wasted effort of trying to make this&#xA;arrangement, i.e. docs in one frame and code in the other.  This is&#xA;because all Emacs frames share the buffers anyway, so all your&#xA;arranging comes to naught with a single &lt;code&gt;ido-switch-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when that happens,&#xA;&lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;nofollow&quot;&gt;ace-window&lt;/a&gt; can help you&#xA;restore the balance.  Either &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;code&gt;ace-window&lt;/code&gt;, or a plain&#xA;&lt;code&gt;ace-swap-window&lt;/code&gt; can swap the windows on separate frames.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-26T10:05:47.377" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5749" PostTypeId="1" AcceptedAnswerId="5750" CreationDate="2014-12-24T11:20:03.727" Score="1" ViewCount="195" Body="&lt;p&gt;I am using &lt;em&gt;shell&lt;/em&gt; in Emacs (&lt;code&gt;M-x shell&lt;/code&gt;). Often, when I try to copy-paste a particular snippet of text from the output (say the output of a &lt;code&gt;ls&lt;/code&gt;), I want to use ace-jump-mode to jump to a particular point on my screen but C-c+SPC seems to result to a new line and not prompt me for the head char. By using &lt;code&gt;describe-key&lt;/code&gt; I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c SPC runs the command comint-accumulate, which is an interactive compiled Lisp function. [...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is the binding changed in the &lt;em&gt;shell&lt;/em&gt; mode? In any other buffer describe-key shows the correct, anticipated binding for C-c SPC:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c SPC runs the command ace-jump-mode, which is an interactive Lisp function in `ace-jump-mode.el'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I ensure that my ace jump bindings are not hijacked in &lt;em&gt;shell&lt;/em&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="4003" OwnerDisplayName="Marcus Junius Brutus" LastEditorUserId="50" LastEditDate="2014-12-26T14:49:28.833" LastActivityDate="2014-12-26T14:49:28.833" Title="using ace-jump-mode inside shell in Emacs" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5750" PostTypeId="2" ParentId="5749" CreationDate="2014-12-26T10:50:29.150" Score="3" Body="&lt;p&gt;Here's my standard way to resolve this behavior.&#xA;You can use it as a template for any mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-shell-hook ()&#xA;  (define-key shell-mode-map (kbd &quot;C-c SPC&quot;) 'ace-jump-mode))&#xA;&#xA;(add-hook 'shell-mode-hook 'my-shell-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although &lt;code&gt;ace-jump-mode&lt;/code&gt; seems to misbehave when in &lt;code&gt;shell&lt;/code&gt;, but&#xA;that's a different problem. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-26T10:50:29.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5751" PostTypeId="2" ParentId="5745" CreationDate="2014-12-26T11:39:12.387" Score="2" Body="&lt;p&gt;I think you may want your opened frame in control. If you make certain files automatically opened in another frames, then when you open more than one it will create many frames that becomes unmanageable and defeats your purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you use Helm and if you use any Helm Projectile command or &lt;code&gt;helm-find-files&lt;/code&gt; or &lt;code&gt;helm-mini&lt;/code&gt;... (Helm commands that are related to files), &lt;kbd&gt;C-c C-o&lt;/kbd&gt; opens the selected files/buffers in another frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For vanilla Emacs solution, anything prefixed with &lt;kbd&gt;C-x 5&lt;/kbd&gt; opens file/buffer in another frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can use another method to achieve your purpose. You can use package like &lt;a href=&quot;https://github.com/tlh/workgroups.el&quot; rel=&quot;nofollow&quot;&gt;workgroup&lt;/a&gt; to manage your window configurations. What &lt;code&gt;workgroup&lt;/code&gt; does is allows you to create workspaces, each workspace holds a window configuration with its buffers and you can switch between window configurations easily and persist the workspaces across Emacs sessions. Of course, you can use it along with frame as well, i.e. each frame holds a workspace. Here is my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq wg-prefix-key (kbd &quot;C-c v&quot;))&#xA;(setq wg-morph-on nil    ; disable switching animation&#xA;      wg-no-confirm t    ; don't ask for confirmation&#xA;      wg-file (concat user-emacs-directory &quot;workgroups&quot;) ; save your workspaces in ~/.emacs.d/wokgroups for future sessions&#xA;      wg-switch-on-load nil ; don't switch to first workgroup when it is loaded&#xA;)&#xA;&#xA;(global-set-key (kbd &quot;C-c c&quot;) 'wg-create-workgroup)&#xA;(global-set-key (kbd &quot;C-c b&quot;) 'wg-switch-to-workgroup)&#xA;&#xA;(require 'workgroups)&#xA;(workgroups-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why did I choose such key bindings? Because the three keys are close together. &lt;kbd&gt;C-c c&lt;/kbd&gt; and &lt;kbd&gt;C-c b&lt;/kbd&gt; should be frequently used commands when you use &lt;code&gt;workgroups&lt;/code&gt;, and &lt;kbd&gt;C-c v&lt;/kbd&gt; is for everything else. And the three are close with each other on the keyboard, which makes it easy to remember and fast to work with &lt;code&gt;workgroups&lt;/code&gt;: &lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;v&lt;/kbd&gt; &lt;kbd&gt;b&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's try create a workgroup with &lt;kbd&gt;C-c c&lt;/kbd&gt;. Create 3 or 4 windows t hat hold something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, create another workgroup with &lt;kbd&gt;C-c c&lt;/kbd&gt;. Also create 3 or 4 windows t hat hold something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can switch back and forth with &lt;kbd&gt;C-c v a&lt;/kbd&gt; between current and previous workgroups. If you want to go next/previous workgroup, use &lt;kbd&gt;C-c v n&lt;/kbd&gt; and &lt;kbd&gt;C-c v p&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, &lt;code&gt;workgroups&lt;/code&gt; is the same as how Emacs handles frames in terminal, which I think is the missing feature in GUI Emacs that I was always wishing for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have more than 2 workgroups and want to select one deterministically, press &lt;kbd&gt;C-c b&lt;/kbd&gt;. Since you use Helm, you get a nice and visible list of workgroups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To persist your workgroups between session, you can use &lt;kbd&gt;C-c v S&lt;/kbd&gt; to save all your workgroups into the &lt;code&gt;wg-file&lt;/code&gt; you defined earlier. You can restore it later with &lt;kbd&gt;C-c v C-l&lt;/kbd&gt;, or automatically when your Emacs starts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wg-load-default ()&#xA;  &quot;Run `wg-load' on `wg-file'.&quot;&#xA;  (interactive)&#xA;  (when (file-exists-p wg-file)&#xA;    (wg-load wg-file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, to navigate frame easier, you can select frame by name with &lt;code&gt;select-frame-by-name&lt;/code&gt; command. I bound it to &lt;kbd&gt;C-x 5 s&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x 5 s&quot;) 'select-frame-by-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again, it gives you a nice visible list with Helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can cycle between frames with &lt;kbd&gt;C-x 5 o&lt;/kbd&gt;, similar to how you cycle windows.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-12-26T11:39:12.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5752" PostTypeId="1" CreationDate="2014-12-26T11:51:02.377" Score="0" ViewCount="181" Body="&lt;p&gt;My emacs configuration seems to be causing a strange issue where the frame font is changed to a non-monospaced font whenever I disable the first theme that was loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because I run emacs from the command line as a daemon and connect using emacsclient, I have to use an after-make-frame hook to set the font/theme (setting these during daemon start has no effect).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I have isolated the code that is causing the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;(defun set-my-font-for-frame (frame)&#xA;  (interactive (list nil))&#xA;  (set-frame-font &quot;Monaco for Powerline-12&quot; nil t))&#xA;&#xA;;; This is needed because you can't set the font at daemon start-up.&#xA;(add-hook 'after-make-frame-functions 'set-my-font-for-frame)&#xA;(add-hook 'after-make-frame-functions (lambda (frame) (load-theme 'solarized-dark t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run emacs with the above code and then disabled the solarized-dark theme, the frame font is changed.&lt;/p&gt;&#xA;" OwnerUserId="2564" LastEditorUserId="2055" LastEditDate="2016-02-09T17:18:58.813" LastActivityDate="2016-02-09T17:18:58.813" Title="emacs font/theme issues in osx (cocoa client)" Tags="|osx|themes|fonts|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5753" PostTypeId="2" ParentId="5732" CreationDate="2014-12-26T12:18:30.543" Score="5" Body="&lt;p&gt;Why not use the same mechanism that &lt;code&gt;describe-char&lt;/code&gt; &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/descr-text.el?id=f4a6345114b02fb725192aa548f2e84096fbaae6#n630&quot; rel=&quot;nofollow&quot;&gt;uses&lt;/a&gt; to identify whether a character is encodable using &lt;code&gt;utf-8&lt;/code&gt; i.e. use &lt;code&gt;encode-coding-char&lt;/code&gt;. From the documentation &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Encode CHAR by CODING-SYSTEM and return the resulting string. If&#xA;  CODING-SYSTEM can't safely encode CHAR, return nil. The 3rd optional&#xA;  argument CHARSET, if non-nil, is a charset preferred on encoding.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-remove-unencodeable-chars (string)&#xA;  (string-join&#xA;   (delq nil (mapcar (lambda (ch) (encode-coding-char ch 'utf-8 'unicode))&#xA;               string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="50" LastEditDate="2014-12-26T20:27:41.000" LastActivityDate="2014-12-26T20:27:41.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5754" PostTypeId="2" ParentId="5745" CreationDate="2014-12-26T13:02:20.213" Score="4" Body="&lt;p&gt;You can customize &lt;code&gt;display-buffer-alist&lt;/code&gt; to achieve what you want, you can read more about the variable by doing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;display-buffer-alist&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. Basically this variable allows you to register custom functions to display certain buffers. Below if a non-generic solution to your question. I have assumed certain things, you might want to adopt it your workflow, the assumptions are the buffer containing your documentation match the regexp &lt;code&gt;Help&lt;/code&gt;, and you want to display them in a dedicated frame &lt;code&gt;Help&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-show-doc-in-frame (buffer options)&#xA;  ;; Get the frame named 'Help' or create one if such a frame does not exist&#xA;  (let ((help-frame (select-frame (or (cdr (assoc-string &quot;Help&quot; (make-frame-names-alist)))&#xA;                                      (make-frame '((name . &quot;Help&quot;)))))))&#xA;    ;; This assumes you want to display just one window in the dedicated frame&#xA;    (set-window-buffer (car (window-list help-frame))  buffer nil)))&#xA;&#xA;(add-to-list 'display-buffer-alist (cons &quot;Help&quot; (cons #'my-show-doc-in-frame nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if you do &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;display-buffer-alist&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;, the documentation will appear in a frame called 'Help' &lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-26T13:02:20.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5755" PostTypeId="1" CreationDate="2014-12-26T14:23:10.450" Score="2" ViewCount="686" Body="&lt;p&gt;I've got a keyboard, where pressing &lt;kbd&gt;M-C-S&lt;/kbd&gt; is uncomfortable (Meta and control are under the thumbs and Shift is on the far end of the keyboard).  However, PageUp, PageDown, Home and End are in a very comfortable place.  I never use any of those keys though, so I was thinking, if it was possible to remap, say, Home to act like &lt;kbd&gt;M-C-S&lt;/kbd&gt;, that would make my life a lot easier.  I would be even happier, if the solution wasn't Emacs-only, but on the system level (it is okay if it is Linux-only).&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="50" LastEditDate="2014-12-26T14:42:36.727" LastActivityDate="2017-08-13T20:37:20.603" Title="Map a key to act like a combination of modifiers" Tags="|key-bindings|linux|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5756" PostTypeId="1" AcceptedAnswerId="5759" CreationDate="2014-12-26T14:56:50.930" Score="2" ViewCount="402" Body="&lt;p&gt;I am having problems running &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files&quot; rel=&quot;nofollow&quot;&gt;ezwinports Hunspell 1.3.2-3&lt;/a&gt; in Emacs 24.4.1 for  Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When calling &lt;code&gt;ispell-buffer&lt;/code&gt; with debug, I see the following functions are called. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ispell-buffer&lt;/code&gt; -&gt; &lt;code&gt;ispell-region&lt;/code&gt; -&gt; &lt;code&gt;ispell-set-spellchecker-params&lt;/code&gt; -&gt; &lt;code&gt;ispell-find-aspell-dictionaries&lt;/code&gt; -&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ispell-call-process ispell-program-name null-device t nil &quot;-D&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which in turn will become:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process &quot;c:/path/to/bin/hunspell.exe&quot; &quot;NUL&quot; t nil &quot;-D&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function returns this error, which eventually prevents the spell checking (actual &lt;code&gt;c:\path\to\&lt;/code&gt; is longer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SEARCH PATH:&#xA;.;;C:\Hunspell\;C:\Users\admin\.openoffice.org\3\user\wordbook;c:\path\to\bin\..\share\hunspell;C:\Program files\OpenOffice.org 2.4\share\dict\ooo\;C:\Program files\OpenOffice.org 2.3\share\dict\ooo\;C:\Program files\OpenOffice.org 2.2\share\dict\ooo\;C:\Program files\OpenOffice.org 2.1\share\dict\ooo\;C:\Program files\OpenOffice.org 2.0\share\dict\ooo\&#xA;AVAILABLE DICTIONARIES (path is not mandatory for -d option):&#xA;c:\path\to\bin\..\share\hunspell\default&#xA;c:\path\to\bin\..\share\hunspell\en_GB&#xA;c:\path\to\bin\..\share\hunspell\en_US&#xA;Can't open affix or dictionary files for dictionary named &quot;ENG&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The strange is that running from Windows prompt (terminal):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\path\to\bin\hunspell.exe -D &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;one gets (without errors):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SEARCH PATH:&#xA;.;;C:\Hunspell\;C:\Users\admin\.openoffice.org\3\user\wordbook;c:\path\to\bin\..\share\hunspell;C:\Program files\OpenOffice.org 2.4\share\dict\ooo\;C:\Program files\OpenOffice.org 2.3\share\dict\ooo\;C:\Program files\OpenOffice.org 2.2\share\dict\ooo\;C:\Program files\OpenOffice.org 2.1\share\dict\ooo\;C:\Program files\OpenOffice.org 2.0\share\dict\ooo\&#xA;AVAILABLE DICTIONARIES (path is not mandatory for -d option):&#xA;c:\path\to\bin\..\share\hunspell\default&#xA;c:\path\to\bin\..\share\hunspell\en_GB&#xA;c:\path\to\bin\..\share\hunspell\en_US&#xA;LOADED DICTIONARY:&#xA;c:\path\to\bin\..\share\hunspell\default.aff&#xA;c:\path\to\bin\..\share\hunspell\default.dic&#xA;Hunspell 1.3.2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Testing separately:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process &quot;c:/path/to/bin/hunspell.exe&quot; &quot;NUL&quot; t nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Can't open affix or dictionary files for dictionary named &quot;ENG&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While from the prompt: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\path\to\bin\hunspell.exe &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;starts the spelling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs errors can be replicated using &lt;code&gt;eshell&lt;/code&gt; mode, which is perhaps based on &lt;code&gt;call-process&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noted that this works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process &quot;c:/path/to/bin/hunspell.exe&quot; &quot;NUL&quot; t nil &quot;-vv&quot;)&#xA;@(#) International Ispell Version 3.2.06 (but really Hunspell 1.3.2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried with other commands to replicate the call-process error. But, whenever I run   &lt;code&gt;(call-process &quot;c:/path/to/foo.exe&quot; &quot;NUL&quot; t nil &quot;some args&quot;)&lt;/code&gt;, the result is always the same as &#xA;&lt;code&gt;c:/path/to/foo.exe some args&lt;/code&gt; from the terminal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be noted that the code in &lt;code&gt;ispell-set-spellchecker-params&lt;/code&gt;&#xA;is run only at the first ispell invocation, so on a second spell-checking request the action can be completed. &lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2014-12-26T16:07:48.003" Title="call-process and Hunspell (in Emacs 24.4)" Tags="|eshell|microsoft-windows|shell-command|ispell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5757" PostTypeId="2" ParentId="5740" CreationDate="2014-12-26T15:09:17.490" Score="0" Body="&lt;p&gt;My preference:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Add a template for the source block eg &lt;a href=&quot;https://github.com/grettke/home/blob/master/ALEC.txt#L4334&quot; rel=&quot;nofollow&quot;&gt;https://github.com/grettke/home/blob/master/ALEC.txt#L4334&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select the code that you want to wrap&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;kmacro-start-macro-or-insert-counter&lt;/code&gt; to record and automate your task&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Reasons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I like the structure templates; they are easy to remember and I use them all of the time&lt;/li&gt;&#xA;&lt;li&gt;You can't automate something until you know what you want to do and the macro recorder makes that really easy&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="341" LastActivityDate="2014-12-26T15:09:17.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5758" PostTypeId="1" CreationDate="2014-12-26T15:30:13.117" Score="4" ViewCount="1369" Body="&lt;p&gt;I just installed &lt;code&gt;evil-mode&lt;/code&gt; from melpa and when the installation finishes I get the message &lt;code&gt;ad-handle-definition: 'evil-mode' got redefined&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZTPJH.png&quot; alt=&quot;ad-handle-definition: 'evil-mode' got redefined&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can then enable &lt;code&gt;evil-mode&lt;/code&gt; but get the same warning. But the next time I open emacs and try to enable &lt;code&gt;evil-mode&lt;/code&gt; I get this error: &lt;code&gt;Autoloading failed to define function evil-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Wy0EX.png&quot; alt=&quot;Autoloading failed to define function evil-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching around leads me to understand basically that somewhere along the line evil-mode gets redefined or lost, but I don't know where to start in debugging this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tested:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Removing &lt;code&gt;evil&lt;/code&gt; through the package manager and reinstalling&lt;/li&gt;&#xA;&lt;li&gt;Removing the &lt;code&gt;evil-&amp;lt;date&amp;gt;&lt;/code&gt; folder from the elpa packages and reinstalling&lt;/li&gt;&#xA;&lt;li&gt;Installing the package from marmalade. I don't get the &lt;code&gt;ad-handle-definition&lt;/code&gt; error then, but I still get &lt;code&gt;Autoloading failed to define function evil-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs version 24.4.1 on OSX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It kinda feels as if emacs is trying to tell me something behaving like this. ^^&lt;/p&gt;&#xA;" OwnerUserId="3901" LastActivityDate="2017-01-09T05:58:13.043" Title="Installing evil-mode: ad-handle-definition 'evil-mode' got redefined" Tags="|evil|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5759" PostTypeId="2" ParentId="5756" CreationDate="2014-12-26T16:07:48.003" Score="4" Body="&lt;p&gt;I remember having this problem. It seems that hunspell picks up the language to use for spell-checking from the &lt;code&gt;LANG&lt;/code&gt; environmental variable. It appears that the variable is set to 'ENG' in your emacs. What hunspell is saying is that it cannot find dictionaries associated with that language. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have two options either download the dictionaries that language or set the &lt;code&gt;LANG&lt;/code&gt; environment variable to something for which hunspell already has the dictionaries for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went with the second option and explicitly set the variable to &lt;code&gt;en_US&lt;/code&gt; on windows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (equal system-type 'windows-nt)&#xA;  (setenv &quot;LANG&quot; &quot;en_US&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-26T16:07:48.003" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5760" PostTypeId="1" AcceptedAnswerId="5780" CreationDate="2014-12-26T17:29:15.733" Score="10" ViewCount="1222" Body="&lt;p&gt;I have org-mode file with more than 10k lines of notes and traversing through the tree (just basic up/down movements) is very slow (to the point that it's unusable). What can i do to make it work faster?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know i can split the big files into many smaller ones, but i want to have it encrypted (into *.org.gpg) and don't want to enter the password every time i open different file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for help.&lt;/p&gt;&#xA;" OwnerUserId="4005" LastActivityDate="2022-02-16T16:00:20.527" Title="What to do to make orgmode faster?" Tags="|org-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5762" PostTypeId="2" ParentId="5760" CreationDate="2014-12-26T18:13:52.253" Score="7" Body="&lt;p&gt;Collapse &lt;strong&gt;nothing&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+STARTUP: showeverything&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your file &quot;will be fast&quot; again.&lt;/p&gt;&#xA;" OwnerUserId="341" LastActivityDate="2014-12-26T18:13:52.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5763" PostTypeId="1" AcceptedAnswerId="5774" CreationDate="2014-12-26T19:44:55.407" Score="5" ViewCount="174" Body="&lt;p&gt;After my initial config, &lt;code&gt;ido-read-internal&lt;/code&gt; becomes advised by &lt;code&gt;flx&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ido-mode)&#xA;(require 'flx-ido)&#xA;(setq ido-enable-flex-matching t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So now I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(help-function-arglist 'ido-read-internal t)&#xA;;; =&amp;gt; (&amp;amp;rest rest)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(help-function-arglist 'ido-read-internal t)&#xA;;; =&amp;gt; (item prompt hist &amp;amp;optional default require-match initial)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've found a small work around for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ad-deactivate 'ido-read-internal)&#xA;(help-function-arglist 'ido-read-internal t)&#xA;(ad-activate 'ido-read-internal)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to do this? Are there any side-effects of&#xA;calling &lt;code&gt;ad-deactivate&lt;/code&gt; and &lt;code&gt;ad-activate&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-07-11T04:57:21.727" LastActivityDate="2015-07-11T04:57:21.727" Title="How to get the arguments of an advised function?" Tags="|elisp|advice|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5764" PostTypeId="2" ParentId="5729" CreationDate="2014-12-26T20:02:03.157" Score="4" Body="&lt;p&gt;Perhaps a shorter example, using &lt;code&gt;cl&lt;/code&gt; library:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun chop (string separator)&#xA;  (cl-loop with seplen = (length separator)&#xA;           with len = (length string)&#xA;           with start = 0&#xA;           with next = seplen&#xA;           for end = (or (cl-search separator string :start2 next) len)&#xA;           for chunk = (substring string start end)&#xA;           collect chunk&#xA;           while (&amp;lt; end len)&#xA;           do (setf start end next (+ seplen end))))&#xA;&#xA;(chop &quot;* one * two * three&quot; &quot;*&quot;)&#xA;(&quot;* one &quot; &quot;* two &quot; &quot;* three&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But delimiters are strings, not regular expressions.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2014-12-26T20:33:28.787" LastActivityDate="2014-12-26T20:33:28.787" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5765" PostTypeId="1" CreationDate="2014-12-26T20:51:55.023" Score="6" ViewCount="1622" Body="&lt;p&gt;Instead of viewing dired buffers with files sorted by name, I want to view it with directories at the top followed by files grouped by extension (and then filename). Is there any package to install to do that? How do I set up my config?&lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2014-12-27T21:41:07.813" Title="How to view files ordered by extension in dired?" Tags="|dired|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5766" PostTypeId="2" ParentId="5765" CreationDate="2014-12-26T21:08:27.483" Score="5" Body="&lt;p&gt;You can use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-listing-switches&#xA;      &quot;-lX --group-directories-first&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;X&lt;/code&gt; option makes it sorted by extension. Basically you can just&#xA;google whatever &lt;code&gt;ls&lt;/code&gt; option you want, and then set&#xA;&lt;code&gt;dired-listing-switches&lt;/code&gt; accordingly. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-26T21:08:27.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5767" PostTypeId="2" ParentId="5765" CreationDate="2014-12-26T21:09:21.877" Score="2" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired-sort-menu.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dired-sort-menu.el&lt;/code&gt;&lt;/a&gt; lets you do this (and more): just choose &lt;code&gt;Extension&lt;/code&gt; in the &lt;code&gt;Sort By&lt;/code&gt; submenu of menu &lt;code&gt;Subdir&lt;/code&gt;. (&lt;code&gt;Subdir&lt;/code&gt; is &lt;code&gt;Dir&lt;/code&gt; in &lt;a href=&quot;http://www.emacswiki.org/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also library &lt;a href=&quot;http://www.emacswiki.org/emacs-en/download/dired-sort-menu%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dired-sort-menu+.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-26T21:09:21.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5768" PostTypeId="1" AcceptedAnswerId="5784" CreationDate="2014-12-26T23:09:13.907" Score="1" ViewCount="44" Body="&lt;p&gt;I'm looking for a way to programmatically retrieve documentation for&#xA;mode-line-format %-constructs; this is part of a little project I'm&#xA;working on to help with mode-line customization.  So for example, if&#xA;the mode line contains &quot;%e&quot;, I want something ike:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(display-mode-line-format-percent-help &quot;%e&quot;)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to return:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;print error message about full memory.&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now the only way I can think of is to parse the help string for&#xA;mode-line-format, but that seems like it would put me in a state of&#xA;sin.  :-)  Is there a better way?&lt;/p&gt;&#xA;" OwnerUserId="291" LastActivityDate="2014-12-27T12:39:48.667" Title="How to programatically retrieve help strings for mode-line % constructs?" Tags="|mode-line|help|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5769" PostTypeId="1" AcceptedAnswerId="8165" CreationDate="2014-12-27T00:18:34.080" Score="2" ViewCount="294" Body="&lt;p&gt;Normally two-panes file managers display only three fields per file: the file name, the file size (possibly in human format) and the file modification time. See for example Midnight Commander:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6myOC.png&quot; alt=&quot;Midnight_Commander&quot;&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for Emacs Sunrise Commander, we have a lot of info (user, owner, permissions), which  make it inconvenient on a laptop screen and perhaps distracting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/q9uVu.png&quot; alt=&quot;Sunrise Commander&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is is possible to get the standard 3-field layout with Sunrise Commander? &lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-09-05T22:20:21.083" LastActivityDate="2016-09-05T22:20:21.083" Title="Emacs Sunrise Commander only with name-size-time display" Tags="|dired|sunrise-commander|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5770" PostTypeId="2" ParentId="5755" CreationDate="2014-12-27T00:29:26.740" Score="5" Body="&lt;p&gt;A pure Emacs solution that doesn't do exactly what you're asking, but close, would be to make e.g. &lt;kbd&gt;Home&lt;/kbd&gt; be a key that adds the &lt;kbd&gt;Ctrl&lt;/kbd&gt;, &lt;kbd&gt;Shift&lt;/kbd&gt; and &lt;kbd&gt;Alt&lt;/kbd&gt; modifiers to the next key that you press. That is, rather than press &lt;kbd&gt;Home&lt;/kbd&gt;+&lt;kbd&gt;&lt;em&gt;key&lt;/em&gt;&lt;/kbd&gt;, you would press &lt;kbd&gt;Home&lt;/kbd&gt;then &lt;kbd&gt;&lt;em&gt;key&lt;/em&gt;&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has a built-in feature to add a modifier to the next key, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html#Modifier-Keys&quot; rel=&quot;nofollow noreferrer&quot;&gt;bound to the unwieldy &lt;code&gt;C-x @ &lt;em&gt;letter&lt;/em&gt;&lt;/code&gt;&lt;/a&gt; by default, e.g. if you type &lt;code&gt;C-x @ m a&lt;/code&gt; it's interpreted as &lt;code&gt;M-a&lt;/code&gt;. This is implemented via &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-local_002dfunction_002dkey_002dmap-1627&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;function-key-map&lt;/code&gt;&lt;/a&gt;. Bindings in &lt;code&gt;function-key-map&lt;/code&gt; are overridden by key bindings in most maps, including the global keymap; if you want your binding to take precedence, define it in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-input_002ddecode_002dmap-1802&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;input-decode-map&lt;/code&gt;&lt;/a&gt; instead. I've written a bit about it &lt;a href=&quot;https://emacs.stackexchange.com/questions/3992/how-to-extend-the-esc-m-translation-to-non-character-keys/3993#3993&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can adapt this mechanism to bind &lt;code&gt;home&lt;/code&gt; to &lt;code&gt;event-apply-control-meta-shift-modifiers&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun event-symbol-add-modifiers (symbol prefixes)&#xA;  (let* ((name (symbol-name symbol))&#xA;         (parts (split-string name &quot;-&quot;))&#xA;         (old-modifiers nil))&#xA;    (while parts&#xA;      (if (= (length (car parts)) 1)&#xA;          (setq old-modifiers (cons (aref (car parts) 0) old-modifiers)))&#xA;      (setq parts (cdr parts)))&#xA;    (while prefixes&#xA;      (if (not (memq (car prefixes) old-modifiers))&#xA;          (setq name (concat (list (car prefixes) ?-) name)))&#xA;        (setq prefixes (cdr prefixes)))&#xA;    (intern name)))&#xA;(defun event-apply-modifiers (event mask prefixes)&#xA;  (cond&#xA;   ((numberp event)&#xA;    (logior mask event))&#xA;   ((symbolp event)&#xA;    (event-symbol-add-modifiers event prefixes))&#xA;   ((consp event)&#xA;    (cons (event-symbol-add-modifiers (car event) prefixes) (cdr event)))&#xA;   (t event)))&#xA;(defun event-apply-control-meta-shift-modifiers (ignore-prompt)&#xA;  &quot;\\&amp;lt;function-key-map&amp;gt;Add the Ctrl, Meta and Shift modifier to the following event.&#xA;For example, type \\[event-apply-control-meta-shift-modifiers] &amp;amp; to enter Ctrl-Meta-Shift-&amp;amp;.&quot;&#xA;  (vector (event-apply-modifiers (read-event) #xe000000 '(?C ?M ?S))))&#xA;(define-key input-decode-map [home] 'event-apply-control-meta-shift-modifiers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;event-apply-modifiers&lt;/code&gt; is a highly simplified version of Emacs's &lt;code&gt;event-apply-modifier&lt;/code&gt; and may be inferior in some circumstances. Minimally tested.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2017-08-13T20:37:20.603" LastActivityDate="2017-08-13T20:37:20.603" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="5771" PostTypeId="2" ParentId="5737" CreationDate="2014-12-27T00:33:03.497" Score="3" Body="&lt;p&gt;Don't modify files in Emacs's directory. They'll be overwritten if you upgrade Emacs and they won't be available on other machines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, provide your own definition for the function in your init file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pradhan:after-load:cc-cmds ()&#xA;  (if t ; replace this by a test that checks whether the bug is present in this version of Emacs&#xA;      (defun c-electric-lt-gt …)))&#xA;(eval-after-load &quot;cc-cmds&quot; 'pradhan:after-load:cc-cmds)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-12-27T00:33:03.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5772" PostTypeId="1" AcceptedAnswerId="5773" CreationDate="2014-12-27T01:39:40.450" Score="9" ViewCount="3873" Body="&lt;p&gt;I'm using &lt;code&gt;Monokai&lt;/code&gt; theme. When I start &lt;code&gt;helm&lt;/code&gt;, the current selected line are highlighted in gray. It's not easy to spot,especially with the title information in blue. &lt;img src=&quot;https://i.stack.imgur.com/pVSo7.png&quot; alt=&quot;Helm in Monokai theme&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change this gray highlight, say, in purple?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="3872" LastEditDate="2014-12-27T09:28:13.320" LastActivityDate="2014-12-27T09:28:13.320" Title="How to change helm's highlight color" Tags="|helm|colors|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5773" PostTypeId="2" ParentId="5772" CreationDate="2014-12-27T02:55:30.417" Score="10" Body="&lt;p&gt;The name of the face helm uses to highlight the selected item is &lt;code&gt;helm-selection&lt;/code&gt;.  You can change just the background color of any face with &lt;code&gt;set-background-color&lt;/code&gt;: &lt;code&gt;(set-background-color 'helm-selection &quot;purple&quot;)&lt;/code&gt;.  You can also use&lt;code&gt;set-face-attribute&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'helm-selection nil &#xA;                    :background &quot;purple&quot;&#xA;                    :foreground &quot;black&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if you also want to set other attributes at the same time.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2014-12-27T04:47:22.570" LastActivityDate="2014-12-27T04:47:22.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5774" PostTypeId="2" ParentId="5763" CreationDate="2014-12-27T03:27:30.840" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;ad-get-orig-definition&lt;/code&gt; to get the original definition and then use &lt;code&gt;help-function-arglist&lt;/code&gt; as usual to get the argument list, for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(help-function-arglist (ad-get-orig-definition 'ido-read-internal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-27T03:27:30.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5775" PostTypeId="2" ParentId="5769" CreationDate="2014-12-27T05:29:29.717" Score="3" Body="&lt;p&gt;You can use the &lt;code&gt;sr-attributes-display-mask&lt;/code&gt; variable to control this. I think the following will do what you want: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq sr-attributes-display-mask '(nil nil nil nil t t t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4008" LastEditorUserId="25" LastEditDate="2014-12-27T16:20:24.593" LastActivityDate="2014-12-27T16:20:24.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5776" PostTypeId="1" CreationDate="2014-12-27T10:36:53.487" Score="1" ViewCount="62" Body="&lt;p&gt;&lt;code&gt;el-get&lt;/code&gt; manage my other packages properly and easily, so I tried to install &lt;code&gt;haskell-mode&lt;/code&gt; by &lt;code&gt;el-get-install&lt;/code&gt;; however, it failed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sed -e 's/@@GIT_VERSION@@/13.10-301-g6e48791/g;s/@GIT_VERSION@/13.10-301-g6e48791/g;s/@@VERSION@@/13.10/g;s/@VERSION@/13.10/g' &amp;lt; haskell-mode.el &amp;gt; haskell-mode.tmp.el&#xA;&#xA;In toplevel form:&#xA;haskell-mode.tmp.el:316:8:Error: Wrong type argument: sequencep, end&#xA;make: *** [haskell-mode.elc] Error 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's wrong with this?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2015-04-22T10:03:52.607" Title="Install haskell-mode failed via el-get-install" Tags="|haskell-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5777" PostTypeId="2" ParentId="5452" CreationDate="2014-12-27T10:37:45.970" Score="29" Body="&lt;p&gt;Alternatively, use a local hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c++-mode-hook&#xA;          (lambda () (add-hook 'before-save-hook MY-HOOK-FUNC nil 'local)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This adds &lt;code&gt;MY-HOOK-FUNC&lt;/code&gt; to the &lt;strong&gt;buffer-local&lt;/strong&gt; &lt;code&gt;before-save-hook&lt;/code&gt; of each C++&#xA;Mode buffer, or any buffer in a mode derived of C++ Mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find this more elegant that explicitly checking &lt;code&gt;major-mode&lt;/code&gt;, and it has the&#xA;advantage that you can disable the &lt;code&gt;before-save-hook&lt;/code&gt; &lt;strong&gt;locally&lt;/strong&gt; for each&#xA;buffer with &lt;code&gt;M-: (remove-hook 'before-save-hook MY-HOOK-FUNC 'local)&lt;/code&gt; without&#xA;affecting any other buffers.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2014-12-27T10:37:45.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5778" PostTypeId="1" AcceptedAnswerId="5782" CreationDate="2014-12-27T11:38:19.450" Score="6" ViewCount="829" Body="&lt;p&gt;Emacs is a powerful editor (or operating system disguised in a text editor), and some packages are extremely powerful - they improve efficiency diagrammatically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be useful to spend limited time on learning and getting efficient with the most useful packages. Is there a such place to look for statistics or votes on most useful packages?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2018-08-20T22:17:05.140" Title="Is there a place to look for statistics on most useful packages?" Tags="|package|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5779" PostTypeId="1" AcceptedAnswerId="5800" CreationDate="2014-12-27T11:49:59.197" Score="73" ViewCount="33856" Body="&lt;p&gt;Is there a way to tell GNU Emacs to convert DOS/Windows newline characters in a file to Unix format?&lt;/p&gt;&#xA;" OwnerUserId="1971" LastActivityDate="2018-05-02T16:36:04.100" Title="How to convert DOS/Windows newline characters to Unix format within GNU Emacs?" Tags="|newlines|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5780" PostTypeId="2" ParentId="5760" CreationDate="2014-12-27T12:18:56.400" Score="11" Body="&lt;p&gt;&lt;code&gt;linum-mode&lt;/code&gt; is also having a big impact on the speed of browsing orgmode files, so it's better not to use it.&lt;/p&gt;&#xA;" OwnerDisplayName="user3984" LastActivityDate="2014-12-27T12:18:56.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5781" PostTypeId="2" ParentId="5779" CreationDate="2014-12-27T12:28:32.453" Score="6" Body="&lt;p&gt;Save the file, and Emacs will automatically use the correct newline char when writing the buffer to file, according to the value of &lt;code&gt;buffer-file-coding-system&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To know what is the value of buffer-file-coding-system, call &lt;code&gt;describe-variable&lt;/code&gt; then &lt;code&gt;buffer-file-coding-system&lt;/code&gt;, or run the &lt;code&gt;describe-coding-system&lt;/code&gt; command which you can do by clicking the second character of the mode line or pressing &lt;code&gt;C-h C&lt;/code&gt;. To set its value, call &lt;code&gt;set-buffer-file-coding-system&lt;/code&gt; (&lt;code&gt;C-x RET f&lt;/code&gt;) and tab to choose the one you want.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="25" LastEditDate="2014-12-27T16:24:48.327" LastActivityDate="2014-12-27T16:24:48.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5782" PostTypeId="2" ParentId="5778" CreationDate="2014-12-27T12:29:15.447" Score="10" Body="&lt;p&gt;&quot;Useful&quot; is quite subjective, but the popular packages are probably useful to a lot of people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most popular elisp projects on github can be found here &lt;a href=&quot;https://github.com/search?l=emacs-lisp&amp;amp;o=desc&amp;amp;q=stars%3A%3E1&amp;amp;s=stars&amp;amp;type=Repositories&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/search?l=emacs-lisp&amp;amp;o=desc&amp;amp;q=stars%3A%3E1&amp;amp;s=stars&amp;amp;type=Repositories&lt;/a&gt;. But there are three entries right in the top ten which don't belong there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then there is &lt;a href=&quot;http://www.melpa.org/#/?sort=downloads&amp;amp;asc=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.melpa.org/#/?sort=downloads&amp;amp;asc=false&lt;/a&gt;. Here packages that are still under development tend to accumulate more downloads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despite these deficits these two resources should give you fairly accurate representation.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2018-08-20T22:17:05.140" LastActivityDate="2018-08-20T22:17:05.140" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5783" PostTypeId="2" ParentId="5778" CreationDate="2014-12-27T12:34:04.107" Score="7" Body="&lt;p&gt;I am just using &lt;a href=&quot;https://github.com/Bruce-Connor/paradox&quot; rel=&quot;nofollow&quot;&gt;Paradox&lt;/a&gt; as a replacement for &lt;code&gt;list-packages&lt;/code&gt;. It displays the number of GitHub stars and has the ability to sort by stars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://camo.githubusercontent.com/4f27eb87d31f47da122d590ca42543fd2eba9504/68747470733a2f2f7261772e6769746875622e636f6d2f42727563652d436f6e6e6f722f70617261646f782f6d61737465722f61667465722e706e67&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just try it.&lt;/p&gt;&#xA;" OwnerUserId="2296" LastEditorUserId="50" LastEditDate="2015-01-11T19:06:54.317" LastActivityDate="2015-01-11T19:06:54.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5784" PostTypeId="2" ParentId="5768" CreationDate="2014-12-27T12:39:48.667" Score="2" Body="&lt;p&gt;I'm afraid you'll have to sin. The information you are after is only in &lt;code&gt;mode-line-format&lt;/code&gt;, so that's what you have to inspect.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T12:39:48.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5785" PostTypeId="2" ParentId="709" CreationDate="2014-12-27T12:49:10.943" Score="2" Body="&lt;p&gt;I suspect that some code kicks in, due to a hook or advise, which should be using &lt;code&gt;remote-file-p&lt;/code&gt; instead of &lt;code&gt;tramp-tramp-file-p&lt;/code&gt;. Read the documentation of both and then grep the installed packages for the latter symbol, replacing it were appropriate. If that fixes the issue, start opening pull requests.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T12:49:10.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5786" PostTypeId="1" AcceptedAnswerId="5790" CreationDate="2014-12-27T12:53:22.037" Score="4" ViewCount="896" Body="&lt;p&gt;Here is a snapshot of my list-package result related to &lt;code&gt;magit&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fsw5H.png&quot; alt=&quot;magit&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There's nothing in my &lt;code&gt;init.el&lt;/code&gt; on marmalade, why the package from marmalade are also listed?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I run &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;package-install&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;magit&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;, which version am I installing?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="247" LastEditDate="2014-12-28T03:28:44.740" LastActivityDate="2014-12-28T03:28:44.740" Title="Which version of magit am I installing?" Tags="|package|magit|" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5787" PostTypeId="2" ParentId="4029" CreationDate="2014-12-27T12:56:06.403" Score="6" Body="&lt;p&gt;I am not sure if that's the problem you are having but this reminded my of a problem I've had for like ten years. Emacs did not accept the size asigned to its frames (e.g. X11 windows) by the windowing system (e.g. X11) and reduced the size based on the proportions of the font used for the &lt;code&gt;default&lt;/code&gt; face. When using a tiling window manager that then results in extra pixels to the right or below the Emacs frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not anymore. Install version 24.4 of Emacs and set &lt;code&gt;frame-resize-pixelwise&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-12-31T00:59:48.690" LastActivityDate="2014-12-31T00:59:48.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5788" PostTypeId="2" ParentId="5666" CreationDate="2014-12-27T13:09:53.087" Score="3" Body="&lt;p&gt;As others have pointed out a hook variable is just a list of hook functions that can be manipulated in anyway you see fit. There are two complications however; the &lt;code&gt;t&lt;/code&gt; element that has already been mentioned, and instead of a list the variable value may also be a single symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Magit I have a &quot;add-hook&quot; variant, &lt;a href=&quot;https://github.com/magit/magit/blob/5a548c818e8448a0f0200e7cb6f8b6443325f39c/magit-section.el#L786&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;magit-add-section-hook&lt;/code&gt;&lt;/a&gt;, which is able to inserted after or before any existing member of the list, but which ignores the two mentioned complications because I though they are not relevant for the intended usecase (but I might fix that at some point, and then make this available separately).&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T13:09:53.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5789" PostTypeId="2" ParentId="2457" CreationDate="2014-12-27T13:20:04.050" Score="1" Body="&lt;p&gt;One approach could be to &quot;read&quot; the mail before it enters Gnus. Personally I use Mu4e and am interested in sorting mail, not marking it as read, but you could easily adapt the following to your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to use a separate tool to make modifications on the server using the imap protocol. I am using &lt;a href=&quot;https://github.com/lefcha/imapfilter&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;imapfilter&lt;/code&gt;&lt;/a&gt; and have added the following to my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'mu4e-update-pre-hook 'local/mu4e-run-imapfilter)&#xA;(defun local/mu4e-run-imapfilter ()&#xA;  (message &quot;Running imapfilter...&quot;)&#xA;  (with-current-buffer (get-buffer-create &quot; *imapfilter*&quot;)&#xA;    (goto-char (point-max))&#xA;    (insert &quot;---\n&quot;)&#xA;    (call-process &quot;imapfilter&quot; nil (current-buffer) nil &quot;-v&quot;))&#xA;  (message &quot;Running imapfilter...done&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll have to add something similar to the appropriate Gnus hook and learn enough about imapfilter to hack an appropriate &lt;code&gt;~/.imapfilter/config.lua&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T13:20:04.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5790" PostTypeId="2" ParentId="5786" CreationDate="2014-12-27T13:21:37.793" Score="3" Body="&lt;p&gt;I have no idea why marmalade packages might be appearing in the list (assuming you are correct that your &lt;code&gt;init.el&lt;/code&gt; does not have anything related to marmalade). As for which package gets installed, &lt;code&gt;package&lt;/code&gt; will by default install the package with highest version number. In this case the &lt;code&gt;magit&lt;/code&gt; package on &lt;code&gt;melpa-stable&lt;/code&gt; (90141214) will be installed since it has the highest version. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do understand about version comparison read the documentation of the function &lt;code&gt;version=&lt;/code&gt; (&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;version=&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;) which explains the algorithm used to compare versions.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-27T13:21:37.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5791" PostTypeId="2" ParentId="2416" CreationDate="2014-12-27T13:31:56.980" Score="0" Body="&lt;p&gt;You could construct the widget type like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(repeat (choice ,(mapcar (lambda (elt) (list 'const elt)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course you then also have to arrange for that to be used, but it sounds like you have already figured that part out.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T13:31:56.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5792" PostTypeId="2" ParentId="5778" CreationDate="2014-12-27T13:32:49.850" Score="2" Body="&lt;p&gt;Just to refine a bit the answer by @tarsius, here's a&#xA;&lt;a href=&quot;https://github.com/search?q=language%3A%22Emacs+Lisp%22+stars%3A%3E50+pushed%3A%3E2014-12-20&amp;amp;ref=searchresults&amp;amp;type=Repositories&quot; rel=&quot;nofollow&quot;&gt;query&lt;/a&gt;&#xA;for repositories with &gt;50 stars, that were updated after a week ago.&#xA;It only gives 58 results. If you want more, you can lower the amount&#xA;of stars, or take an earlier date.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-27T13:32:49.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5793" PostTypeId="2" ParentId="3485" CreationDate="2014-12-27T13:47:40.500" Score="2" Body="&lt;p&gt;&lt;code&gt;ido-read-file-name&lt;/code&gt; already does save previously selected values in &lt;code&gt;ido-file-history&lt;/code&gt;.  However it does not allow saving in another variable which would allow keeping different histories for different uses of that function. You could work around this like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun YOUR-ido-read-file-name (prompt)&#xA;  (cl-letf (((symbol-function 'orig-ido-read-internal)&#xA;             (symbol-function 'ido-read-internal))&#xA;            ((symbol-function 'ido-read-internal)&#xA;             (lambda (item prompt hist &amp;amp;optional default require-match initial)&#xA;               (orig-ido-read-internal item prompt 'YOUR-ido-file-history&#xA;                                       default require-match initial))))&#xA;    (ido-read-file-name prompt)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T13:47:40.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5794" PostTypeId="2" ParentId="5571" CreationDate="2014-12-27T13:58:45.130" Score="1" Body="&lt;p&gt;Neither the mode-line nor the header-line can be multiple lines, unfortunately. I have asked about this before and there is (at least wasn't) any hidden option to make this work. So 1 and 2 are out. I also feel like 3 and 6 are hacks that won't make you happy in the long run. 3 and 4 seem like fine approaches, but to get them to work reliably will be quite an investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would recommend that you first bring this up on &lt;a href=&quot;https://lists.gnu.org/mailman/listinfo/emacs-devel&quot; rel=&quot;nofollow&quot;&gt;emacs-devel&lt;/a&gt;. In my experience things do get implemented eventually if you bother to carefully explain what you want and why that is a good thing. It might take some time, at least until the next release, but if you are fine waiting a bit or using the development version, then you could possibly get exactly what you want, with much less effort.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T13:58:45.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5795" PostTypeId="1" CreationDate="2014-12-27T14:48:32.257" Score="1" ViewCount="723" Body="&lt;p&gt;I make some edits and press &lt;code&gt;C-x C-s&lt;/code&gt; to save. Sometimes, out of blue emacs prompts this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;file has changed since visited or saved.  Save anyway? (yes or no)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even though I don't have  the file open anywhere else, and I am sure nothing else has changed the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens rarely, only possible explanation would be that I press some combination as I bash buttons, and press save, that causes something weird. What could be the problem?&lt;/p&gt;&#xA;" OwnerUserId="2464" LastEditorUserId="50" LastEditDate="2014-12-27T17:13:10.137" LastActivityDate="2015-01-03T14:20:09.300" Title="Weird Prompt: file has changed since visited or saved. Save anyway? (yes or no)" Tags="|files|saving|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5796" PostTypeId="1" AcceptedAnswerId="17922" CreationDate="2014-12-27T15:17:59.247" Score="2" ViewCount="415" Body="&lt;p&gt;I'm using &lt;code&gt;req-package&lt;/code&gt; to manage per-package configuration in my &lt;code&gt;init.el&lt;/code&gt;. All works fine when in stable state. Let's say I need to modify it. For example, I might want to add a new key mapping. I find the &lt;code&gt;req-package&lt;/code&gt; sexp for a particular mode, I add the necessary change to the &lt;code&gt;:config&lt;/code&gt; element, restart Emacs and all is good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, is there a way to do this without restarting Emacs? Basically, I'd like to re-run a particular &lt;code&gt;req-package&lt;/code&gt; sexp or in other words reload / reinitialize a particular package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can run the commands separately, but running the whole &lt;code&gt;req-package&lt;/code&gt; does not seem to have any effect, which I presume is because &lt;code&gt;req-package&lt;/code&gt; already knows the package was loaded / initialized.&lt;/p&gt;&#xA;" OwnerUserId="4010" LastEditorUserId="25" LastEditDate="2014-12-27T16:19:32.370" LastActivityDate="2015-11-07T23:15:24.603" Title="Reload configuration for a package when using req-package" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5797" PostTypeId="2" ParentId="5795" CreationDate="2014-12-27T16:03:38.930" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Even though I don't have the file open anywhere else, and I am sure nothing else has changed the file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You are probably mistaken about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if you sometimes create snapshot stashes with Magit then that would touch the affected files. Would you have expected that? After all it doesn't seem creating a snapshot should touch files in the working directory. Well it does because of limitations of &lt;code&gt;git stash&lt;/code&gt; (by the way that's why the next release of Magit won't use &lt;code&gt;git stash&lt;/code&gt; when creating stashes and instead re-implements some of its functionality in elisp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's not that, then there are many other things that could touch the file behind your back.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-03T14:20:09.300" LastActivityDate="2015-01-03T14:20:09.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5798" PostTypeId="2" ParentId="5786" CreationDate="2014-12-27T16:18:58.337" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;May I ask why the melpa-stable version starts with 90, is there special meaning?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;9014****&lt;/code&gt; is bigger than &lt;code&gt;2014****&lt;/code&gt;. I have chosen that as a temporary solution so that users of Melpa-Stable get the stable version without having to pin Magit to Melpa-Stable. Temporary because eventually the version will go &quot;down&quot; to &lt;code&gt;2.1.0&lt;/code&gt;. The &lt;code&gt;9014****&lt;/code&gt; tags are specifically for Melpa-Stable, without that the Melpa-Stable version would be &lt;code&gt;1.2.2&lt;/code&gt; and that release isn't really &quot;stable&quot; - it is very old (only some bug fixes since &lt;code&gt;1.2.0&lt;/code&gt;) and contains &lt;em&gt;many&lt;/em&gt; known issues which have been fixed on Magit's &lt;code&gt;master&lt;/code&gt; branch a long time ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way &lt;code&gt;9014****&lt;/code&gt; and &lt;code&gt;2014****&lt;/code&gt; are usually build from the same commit at the tip of &lt;code&gt;master&lt;/code&gt;. Sometimes I don't create a &lt;code&gt;9014****&lt;/code&gt; tag after applying some insignificant change like a doc-string fix, then Melpa-Stable lags behind a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No new development happens on &lt;code&gt;master&lt;/code&gt; now - so it is &quot;stable&quot;. The next release will be based on the &lt;code&gt;next&lt;/code&gt; branch and that branch has also already been feature frozen, see &lt;a href=&quot;https://github.com/magit/magit/issues/1645&quot;&gt;Roadmap toward 2.1.0&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;0.8.1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The presence of &lt;code&gt;0.8.1&lt;/code&gt; in that list indicates that there is something wrong with your &lt;code&gt;package.el&lt;/code&gt; installation. No Elpa repository contains that version anymore. Things to check are whether you have an ancient version of &lt;code&gt;package.el&lt;/code&gt; laying around on your &lt;code&gt;load-path&lt;/code&gt; and whether there are old files in &lt;code&gt;~/.emacs.d/elpa/archives/&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T16:18:58.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5799" PostTypeId="1" AcceptedAnswerId="5812" CreationDate="2014-12-27T16:23:41.270" Score="2" ViewCount="365" Body="&lt;p&gt;This may be user error, but if I open a file with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c file.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then if I try to reload the file using &lt;code&gt;C-x C-v&lt;/code&gt;, then I get the usual&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Find alternate file:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but if I press enter on that, I get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Buffer: `file.tex` still has clients: kill it? (yes or no)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I say &lt;code&gt;yes&lt;/code&gt; to that, the frame exits. If I say 'no', then nothing happens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to happen when the same file is open in multiple frames, using emacsclient everywhere. So presumably the same process is being used for these multiple frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain what is going on here? What is the meaning of the message, and why does the frame exit instead of updating the file buffer in that frame?&lt;/p&gt;&#xA;" OwnerUserId="100" LastEditorUserId="25" LastEditDate="2015-02-16T18:23:46.270" LastActivityDate="2015-02-16T18:23:46.270" Title="Reloading files from disk in frame with emacsclient" Tags="|buffers|frames|emacsclient|find-file|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5800" PostTypeId="2" ParentId="5779" CreationDate="2014-12-27T16:34:43.647" Score="90" Body="&lt;p&gt;If the mode line shows a &lt;code&gt;(DOS)&lt;/code&gt; indicator, click on it twice to cycle to &lt;code&gt;:&lt;/code&gt; meaning Unix newlines and then save the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can't click on the mode line or prefer a keyboard-based solution, run the command &lt;code&gt;C-x RET f&lt;/code&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Coding.html#index-C_002dx-RET-f-1722&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;set-buffer-file-coding-system&lt;/code&gt;&lt;/a&gt;) and type &lt;code&gt;unix&lt;/code&gt;. This will change the encoding of newlines without changing the encoding of other characters. (You can also change the encoding of other characters by typing something like &lt;code&gt;utf-8-unix&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="19048" LastEditDate="2018-05-02T16:36:04.100" LastActivityDate="2018-05-02T16:36:04.100" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="5801" PostTypeId="2" ParentId="3658" CreationDate="2014-12-27T17:05:44.860" Score="2" Body="&lt;p&gt;The problem is that by changing the value of &lt;code&gt;ensime-mode-key-prefix&lt;/code&gt; you are doing just that and nothing else. Somewhere after the definition of this option there is code which uses the value. If you haven't changed it then the default value is used, else the value you picked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you change the value &lt;em&gt;after&lt;/em&gt; the library has already been loaded, then that code won't be run again and just changing the variable value won't trigger a change in &lt;code&gt;ensime-mode-map&lt;/code&gt; (or whatever keymap is relevant here). Such a trigger has to be implemented explicitly using &lt;code&gt;defcustom&lt;/code&gt;'s &lt;code&gt;:set&lt;/code&gt; property. And even then this would only have an effect when changing the value through the Custom interface. The &lt;code&gt;:set&lt;/code&gt; function won't be run if you use &lt;code&gt;setq&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T17:05:44.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5802" PostTypeId="2" ParentId="3901" CreationDate="2014-12-27T17:19:55.270" Score="5" Body="&lt;p&gt;It seems that Emacs starts killing buffers before it has asked the user all the questions it might have to ask to avoid losing data. So it kills a buffer which happens to be the buffer which some process outputs to. (I think it shouldn't do that until after having terminated the respective process, and maybe it normally does and there are unusual circumstances causing Emacs to do it to early here). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it kills the process because &lt;code&gt;process-query-on-exit-flag&lt;/code&gt; returns nil. Because that changes the state of the process its sentinel is run. And finally we are at the bug: the sentinel should use &lt;code&gt;(when (buffer-live-p (process-buffer process) ...)&lt;/code&gt; but doesn't. Please file that as a bug.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2014-12-27T18:08:24.657" LastActivityDate="2014-12-27T18:08:24.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5803" PostTypeId="2" ParentId="3401" CreationDate="2014-12-27T17:33:05.333" Score="3" Body="&lt;p&gt;Yes and no.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;No.&lt;/em&gt; &lt;code&gt;AltGr&lt;/code&gt; isn't a modifier known to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Yes.&lt;/em&gt; Emacs knows more modifiers than &lt;code&gt;Control&lt;/code&gt;, &lt;code&gt;Meta&lt;/code&gt; and &lt;code&gt;Shift&lt;/code&gt;: &lt;code&gt;Hyper&lt;/code&gt; and &lt;code&gt;Super&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you have to do is tell our OS or window system that the key/scan code generated by pressing the key labelled &lt;code&gt;[AltGr]&lt;/code&gt; is &quot;Super&quot;. I haven't done that in a while, but inspecting my own xkb (for X11) configuration this would probably look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;key &amp;lt;RALT&amp;gt; { [ Super_L ] };&#xA;key &amp;lt;SUPR&amp;gt; { [ NoSymbol, Super_L ] };&#xA;modifier_map Mod4 { &amp;lt;SUPR&amp;gt; };&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately you cannot just drop that into a file and toggle a switch somewhere and it just works. Xkb is a monstrosity and you will have to learn how to tame it. Unfortunately no decent user documentation exists.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-17T17:26:16.620" LastActivityDate="2015-01-17T17:26:16.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5804" PostTypeId="2" ParentId="5410" CreationDate="2014-12-27T17:37:57.873" Score="12" Body="&lt;p&gt;Press &lt;kbd&gt;C-g&lt;/kbd&gt; repeatably. The first time might be ignored, the second time it should do the trick. If that fails also try pressing &lt;kbd&gt;ESC&lt;/kbd&gt; three times.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-02-02T19:11:44.883" LastActivityDate="2015-02-02T19:11:44.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5805" PostTypeId="2" ParentId="4212" CreationDate="2014-12-27T17:50:19.470" Score="3" Body="&lt;p&gt;For a socket the permissions should be &lt;code&gt;srwx------&lt;/code&gt; - the &lt;code&gt;s&lt;/code&gt;, meaning &quot;socket&quot; is the important part. (I also tried removing the executable bit, it didn't make a difference).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the permissions are &lt;code&gt;-rw-------&lt;/code&gt; you are not using a socket. There are two ways to fix that, (1) make sure you are using a socket (2) tell emacsclient that it's not a socket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Make sure the value of &lt;code&gt;server-use-tcp&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; (which happens to be the default). It has to be &lt;code&gt;nil&lt;/code&gt; at the time you start the daemon, changing it later only serves to confuse you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Tell emacsclient to connect to a tcp file using &lt;code&gt;emacsclient --server-file=SERVER&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend the former.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-27T17:50:19.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5806" PostTypeId="2" ParentId="5621" CreationDate="2014-12-27T19:08:42.933" Score="1" Body="&lt;p&gt;The command &lt;code&gt;LaTeX-insert-environment-at-point&lt;/code&gt; defined below tries to complete an environment name at point. If the prefix is ambiguous, it pulls up the same list of completions as &lt;code&gt;C-x C-e&lt;/code&gt; does. If AUCTeX knows about the environment, you may be prompted for parameters (same as with &lt;code&gt;C-x C-e&lt;/code&gt;). As a bonus, if the name is preceded by a backslash, insert a command instead. Bind it to the key of your choice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar LaTeX-environment-name-characters&#xA;  &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789*&quot;)&#xA;(defun LaTeX-insert-environment-at-point ()&#xA;  &quot;Insert \begin{ENVIRONMENT}...\end{ENVIRONMENT}, completing the word at point.&#xA;If the word at point is preceded by a backslash, complete a macro name instead,&#xA;like \\[TeX-insert-macro].&#xA;The customization possibilities are the same as \\[LaTeX-environment].&quot;&#xA;  (interactive &quot;@*&quot;)&#xA;  (save-match-data&#xA;    (let* ((prefix-start (save-excursion&#xA;                           (skip-chars-backward LaTeX-environment-name-characters)&#xA;                           (point)))&#xA;           (backslash (and (&amp;gt; prefix-start (point-min))&#xA;                           (= (char-after (1- prefix-start)) ?\\)))&#xA;           (completions (if backslash&#xA;                            (TeX-symbol-list)&#xA;                          (LaTeX-environment-list)))&#xA;           (prefix (buffer-substring-no-properties prefix-start (point)))&#xA;           (matches (remove-if-not (lambda (entry)&#xA;                                     (string-prefix-p prefix entry))&#xA;                                   (mapcar #'car completions)))&#xA;           (name (case (length matches)&#xA;                   ((0)&#xA;                    (error &quot;No environment name begins with %s&quot; prefix))&#xA;                   ((1)&#xA;                    (car matches))&#xA;                   (t&#xA;                    ;; Gross hack: arrange to show the list of completions,&#xA;                    ;; by pushing a `minibuffer-complete' event (assuming&#xA;                    ;; default key bindings).&#xA;                    (setq unread-command-events (cons 'tab unread-command-events))&#xA;                    (completing-read (if backslash &quot;Macro: &quot;&#xA;                                       &quot;Environment type: &quot;)&#xA;                                     completions&#xA;                                     nil&#xA;                                     nil&#xA;                                     prefix&#xA;                                     (if backslash&#xA;                                         'TeX-macro-history&#xA;                                       'LaTeX-environment-history))))))&#xA;      (delete-region prefix-start (point))&#xA;      (funcall (if backslash #'TeX-insert-macro #'LaTeX-environment-menu) name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-12-27T19:08:42.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5807" PostTypeId="1" AcceptedAnswerId="17766" CreationDate="2014-12-27T19:15:31.397" Score="4" ViewCount="515" Body="&lt;p&gt;I wrote a minor mode with the purpose of modifying written text on the fly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is currently creating a &lt;code&gt;post-self-insert-command-hook&lt;/code&gt;, and triggers only on specific keypresses (e.g. the space bar, a semicolon, an open parens).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, the user would type &lt;code&gt;select&lt;/code&gt; and when they press the space key, the buffer would now contain &lt;code&gt;SELECT&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having a hard time writing a test for this with ert. I've tried writing it thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest upcase-select ()&#xA;  (with-temp-buffer&#xA;    (sqlup-mode)&#xA;    (insert &quot;select&quot;)&#xA;    (execute-kbd-macro (kbd &quot;SPC&quot;))&#xA;    (should (equal (buffer-string) &quot;SELECT &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This test should verify that when I press the space key, the word &lt;code&gt;&quot;select&quot;&lt;/code&gt; becomes the word &lt;code&gt;SELECT&lt;/code&gt; But the test ends up comparing &lt;code&gt;&quot; &quot;&lt;/code&gt; and &lt;code&gt;&quot;SELECT &quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I write a test that triggers the behavior I desire?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(and further: is this a terrible idea? what's a better idea?)&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2015-11-01T12:24:43.770" Title="writing tests for a post-self-insert-command hook" Tags="|ert|self-insert-command|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5808" PostTypeId="2" ParentId="5807" CreationDate="2014-12-27T19:40:53.747" Score="3" Body="&lt;p&gt;You can see how I solved a similar problem with &lt;a href=&quot;https://github.com/abo-abo/lispy/blob/master/lispy-test.el&quot; rel=&quot;nofollow&quot;&gt;lispy-test.el&lt;/a&gt;.&#xA;Here's an example test:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest lispy-braces ()&#xA;  (should (string= (lispy-with &quot;\&quot;a regex \\\\|\&quot;&quot; &quot;{&quot;)&#xA;                   &quot;\&quot;a regex \\\\{|\\\\}\&quot;&quot;))&#xA;  (should (string= (lispy-with &quot;\&quot;a string |&quot; &quot;{&quot;)&#xA;                   &quot;\&quot;a string {|}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;lispy-with&lt;/code&gt; is a macro that creates a temporary file with&#xA;&lt;code&gt;emacs-lisp-mode&lt;/code&gt;, inserts the first string, calls the command&#xA;sequence decoded from the second string and returns the final buffer&#xA;contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro lispy-with (in &amp;amp;rest body)&#xA;  `(with-temp-buffer&#xA;     (emacs-lisp-mode)&#xA;     (lispy-mode)&#xA;     (insert ,in)&#xA;     (when (search-backward &quot;~&quot; nil t)&#xA;       (delete-char 1)&#xA;       (set-mark (point))&#xA;       (goto-char (point-max)))&#xA;     (search-backward &quot;|&quot;)&#xA;     (delete-char 1)&#xA;     ,@(mapcar (lambda (x) (if (stringp x) `(lispy-unalias ,x) x)) body)&#xA;     (insert &quot;|&quot;)&#xA;     (when (region-active-p)&#xA;       (exchange-point-and-mark)&#xA;       (insert &quot;~&quot;))&#xA;     (buffer-substring-no-properties&#xA;      (point-min)&#xA;      (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-27T19:40:53.747" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5809" PostTypeId="1" AcceptedAnswerId="5810" CreationDate="2014-12-27T19:51:08.680" Score="0" ViewCount="52" Body="&lt;p&gt;Emacs is freezing when running the following custom find-function and I'm looking for some assistance, please, to debug it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like the prefix argument &lt;code&gt;C-u&lt;/code&gt; to make the difference between &lt;code&gt;switch-to-buffer-other-window&lt;/code&gt; or &lt;code&gt;switch-to-buffer&lt;/code&gt;.  By removing &lt;code&gt;find-function-read&lt;/code&gt; from the interactive statement, that function no longer returns a symbol -- so that is why I am using &lt;code&gt;make-symbol&lt;/code&gt;.  I did not see an example by Googling that shows how to use an interactive command of &lt;code&gt;&quot;P&quot;&lt;/code&gt; and another function such as &lt;code&gt;find-function-read&lt;/code&gt; all in the same interactive statement. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-find-function (arg)&#xA;  &quot;Find, in another window, the definition of FUNCTION near point.&#xA;See `find-function' for more details.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((function (make-symbol (format &quot;%s&quot; (car (find-function-read))))))&#xA;    (if (eq arg '(4))&#xA;      (find-function-do-it function nil 'switch-to-buffer-other-window)&#xA;      (find-function-do-it function nil 'switch-to-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2014-12-27T19:56:28.997" Title="Debugging a custom find-function" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5810" PostTypeId="2" ParentId="5809" CreationDate="2014-12-27T19:56:28.997" Score="1" Body="&lt;p&gt;Fixed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-find-function (arg)&#xA;  &quot;Find, in another window, the definition of FUNCTION near point.&#xA;See `find-function' for more details.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let* ((thing (thing-at-point 'symbol))&#xA;         (function&#xA;          (when thing (intern thing))))&#xA;    (if (eq arg 4)&#xA;      (find-function-do-it function nil 'switch-to-buffer-other-window)&#xA;      (find-function-do-it function nil 'switch-to-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;eq&lt;/code&gt; is for numbers and symbols only, not for lists.&#xA;You can't do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x '(1))&#xA;(eq x '(1))&#xA;;=&amp;gt; nil &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-27T19:56:28.997" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5811" PostTypeId="1" CreationDate="2014-12-27T20:10:42.307" Score="6" ViewCount="3548" Body="&lt;p&gt;Is it possible to obtain a package which supports Intellisense PHP in emacs?&#xA;As I've set up cedet now and I would like to add autocomplete for PHP code in emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know you can do it in vim. &lt;/p&gt;&#xA;" OwnerUserId="4012" LastEditorUserId="5143" LastEditDate="2015-01-10T01:22:56.050" LastActivityDate="2018-02-06T17:16:40.880" Title="PHP intellisense in emacs" Tags="|php-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5812" PostTypeId="2" ParentId="5799" CreationDate="2014-12-27T21:25:36.970" Score="6" Body="&lt;p&gt;Essentially, &lt;code&gt;find-alternate-file&lt;/code&gt; kills the current buffer and immediately opens another file (creating a new buffer in its stead). Normally, this is fine. When the buffer is killed, Emacs switches to the last most recent buffer, and then immediately switches to the new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;emacsclient&lt;/code&gt;, things work differently. If you kill all buffers created &lt;em&gt;by that editing session&lt;/em&gt; (e.g. by answering &lt;code&gt;yes&lt;/code&gt; in your example) then &lt;code&gt;emacsclient&lt;/code&gt; deems that you are done with whatever editing you were doing and kills the frame. If you say &lt;code&gt;no&lt;/code&gt; than &lt;code&gt;find-alternate-file&lt;/code&gt; cannot continue (it failed to kill the buffer it's trying to replace) and halts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure this is a bug, and should be fixed.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However&lt;/em&gt; you still really should be using &lt;code&gt;revert-buffer&lt;/code&gt; if you possibly can.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2014-12-27T21:39:22.550" LastActivityDate="2014-12-27T21:39:22.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5813" PostTypeId="2" ParentId="5765" CreationDate="2014-12-27T21:41:07.813" Score="0" Body="&lt;p&gt;You can set &lt;code&gt;dired-listing-switches&lt;/code&gt; to &lt;code&gt;&quot;-l --group-directories-first&quot;&lt;/code&gt;, and then toggle sorting by extension (and other keys) with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc (lambda (elt)&#xA;        (define-key dired-mode-map (car elt)&#xA;          `(lambda ()&#xA;            (interactive)&#xA;            (dired-sort-other (concat dired-listing-switches ,(cadr elt))))))&#xA;      '(([(control f3)]       &quot;&quot;     &quot;by name&quot;)&#xA;        ([(control f4)]       &quot; -X&quot;  &quot;by extension&quot;)&#xA;        ([(control f5)]       &quot; -t&quot;  &quot;by date&quot;)&#xA;        ([(control f6)]       &quot; -S&quot;  &quot;by size&quot;)&#xA;        ([(control shift f3)] &quot; -r&quot;  &quot;by reverse name&quot;)&#xA;        ([(control shift f4)] &quot; -rX&quot; &quot;by reverse extension&quot;)&#xA;        ([(control shift f5)] &quot; -rt&quot; &quot;by reverse date&quot;)&#xA;        ([(control shift f6)] &quot; -rS&quot; &quot;by reverse size&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="478" LastActivityDate="2014-12-27T21:41:07.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5814" PostTypeId="1" AcceptedAnswerId="5818" CreationDate="2014-12-27T23:04:55.140" Score="14" ViewCount="3677" Body="&lt;p&gt;I would like to be able to save a copy (or a snapshot) of a buffer into a file. The behavior would be similar to &lt;code&gt;write-file&lt;/code&gt;, except that it would &lt;em&gt;not&lt;/em&gt; set the buffer to visit this file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a usecase, imagine that you have a shell session, and you want to quickly save it all into a log file. The buffer should not be renamed (so that functions relying on the buffer name still work), and it should not be visiting a file (so that the file is not accidentally overwritten, and there is no warning when exitting emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can imagine a few dirty ways of doing this, I will post one as a self-answer, but reading from the manual, the whole &quot;visited file&quot; system is more complicated than it looks, and I guess it is easy to draft a wrong solution. Is there a hidden, built-in, way of achieving this?&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2014-12-27T23:45:37.497" Title="How to save a copy of a buffer to a file?" Tags="|buffers|saving|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5815" PostTypeId="2" ParentId="5814" CreationDate="2014-12-27T23:04:55.140" Score="0" Body="&lt;p&gt;Dirty &lt;code&gt;elisp&lt;/code&gt; doing what I want to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tv/copy-buffer-to-file (filename)&#xA;  (interactive &quot;sFile to write? &quot;)&#xA;  (let ((bufname (buffer-name)))&#xA;    (set-visited-file-name filename)&#xA;    (save-buffer)&#xA;    (set-visited-file-name nil)&#xA;    (rename-buffer bufname)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This looks like a lot more hassle than should be needed, since we have to take care of both the visited file and the buffer name, and we cannot be sure that we did not forget anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other solutions involving copying the buffer text in a new buffer, then saving and killing that buffer would probably work better, but I'd then be worried over performance issues with large buffers.&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2014-12-27T23:04:55.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5816" PostTypeId="2" ParentId="3283" CreationDate="2014-12-27T23:13:52.917" Score="1" Body="&lt;p&gt;If you want this behavior to be systematic, here's a way to modify the behavior of &lt;code&gt;server-visit-files&lt;/code&gt; to take over the window configuration and split the window evenly into the files that are being visited.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar server-visit-files-custom-find:buffer-count)&#xA;(defadvice server-visit-files&#xA;  (around server-visit-files-custom-find&#xA;      activate compile)&#xA;  &quot;Maintain a counter of visited files from a single client call.&quot;&#xA;  (let ((server-visit-files-custom-find:buffer-count 0))&#xA;    ad-do-it))&#xA;(defun server-visit-hook-custom-find ()&#xA;  &quot;Arrange to visit the files from a client call in separate windows.&quot;&#xA;  (if (zerop server-visit-files-custom-find:buffer-count)&#xA;      (progn&#xA;    (delete-other-windows)&#xA;    (switch-to-buffer (current-buffer)))&#xA;    (let ((buffer (current-buffer))&#xA;      (window (split-window-sensibly)))&#xA;      (switch-to-buffer buffer)&#xA;      (balance-windows)))&#xA;  (setq server-visit-files-custom-find:buffer-count&#xA;    (1+ server-visit-files-custom-find:buffer-count)))&#xA;(add-hook 'server-visit-hook 'server-visit-hook-custom-find)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An improvement would be to make &lt;code&gt;C-x #&lt;/code&gt; kill the window. I think this would require patching both &lt;code&gt;server-edit&lt;/code&gt; to set a flag and &lt;code&gt;server-switch-buffer&lt;/code&gt; to kill the window if this flag is raised.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="118" LastEditDate="2018-04-05T06:36:16.633" LastActivityDate="2018-04-05T06:36:16.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5817" PostTypeId="2" ParentId="2568" CreationDate="2014-12-27T23:26:02.507" Score="0" Body="&lt;p&gt;If your operating system or Emacs's interface to it somehow passes dead keys as such instead of processing them, you can translate the dead key combinations in Emacs itself. Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-input_002ddecode_002dmap-1626&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;input-decode-map&lt;/code&gt;&lt;/a&gt; for that: this way, the key sequence is actually translated into a single key press, and the command loop sees a &lt;code&gt;self-insert-command&lt;/code&gt;. This is preferable to binding the key to a macro in the global map because this breaks mechanisms that rely on text input being self-inserted, such as undo groups.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map [dead-acute ?ο] ?ό)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can write a loop like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc (lambda (string)&#xA;        (define-key input-decode-map (vector dead-acute (aref string 0)) (aref string 1)))&#xA;      '(&quot;οό&quot; &quot;υύ&quot; &quot;ιί&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-12-27T23:26:02.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5818" PostTypeId="2" ParentId="5814" CreationDate="2014-12-27T23:45:37.497" Score="22" Body="&lt;p&gt;Just select the entire buffer (&lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;h&lt;/kbd&gt;) and use &lt;code&gt;write-region&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2014-12-27T23:45:37.497" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5819" PostTypeId="1" CreationDate="2014-12-27T23:55:35.950" Score="5" ViewCount="1007" Body="&lt;p&gt;I want to do a completing read with the &lt;code&gt;*Completions*&lt;/code&gt; buffer already shown (because I'm providing initial input that I already know is an ambiguous prefix). How can I do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see an option for this in &lt;code&gt;completing-read&lt;/code&gt;. I want a method that works in both Emacs 23 (where &lt;code&gt;completing-read&lt;/code&gt; is defined in C) and in Emacs 24 (where &lt;code&gt;completing-read&lt;/code&gt; relays to the function indicated by the variable &lt;code&gt;completing-read-function&lt;/code&gt;, so I suppose I could just change that) — of course a solution based on &lt;code&gt;(if (boundp 'completing-read-function))&lt;/code&gt; is fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although my immediate use case is with a known ambiguous initial input, something that works regardless of that would be nice. Also, if the user has overridden the default read mechanism (e.g. by redefining &lt;code&gt;completing-read&lt;/code&gt; to invoke &lt;code&gt;ido-completing-read&lt;/code&gt; or &lt;code&gt;anything-completing-read&lt;/code&gt; or by turning on Icicles or Helm), I'd like my code to achieve the same effect, i.e. start the completion mechanism with the list of completions already shown.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="105" LastEditDate="2017-04-20T14:32:20.580" LastActivityDate="2017-04-20T14:32:20.580" Title="Show the *Completions* buffer automatically when starting completing-read" Tags="|completion|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5820" PostTypeId="2" ParentId="5819" CreationDate="2014-12-27T23:55:35.950" Score="1" Body="&lt;p&gt;My quick-and-dirty solution (tested with Emacs 23 but it should work with any version) was to pretend that the user had pressed &lt;kbd&gt;Tab&lt;/kbd&gt; — since I already know that the input is ambiguous, this displays the &lt;code&gt;*Completions*&lt;/code&gt; buffer. It works well enough in practice, but it's a very dirty hack since it assumes that the &lt;kbd&gt;Tab&lt;/kbd&gt; key is bound to performing completion, and it only works if the initial input is an ambiguous prefix.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq unread-command-events (cons 'tab unread-command-events))&#xA;(completing-read message completions nil nil known-ambiguous-prefix history-variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2014-12-27T23:55:35.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5821" PostTypeId="2" ParentId="3844" CreationDate="2014-12-28T02:22:14.267" Score="20" Body="&lt;p&gt;I am quite happy with the system I use, which does (I think) exactly what you want.  It has two parts: an Emacs part that uses appt.el to schedule the reminders and a small shell program (I'm using Linux) that creates the popup + sound notification.  Here I share the code for both parts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A) Code in ~/.emacs.d/init.el&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'appt)&#xA;(appt-activate t)&#xA;&#xA;(setq appt-message-warning-time 5) ; Show notification 5 minutes before event&#xA;(setq appt-display-interval appt-message-warning-time) ; Disable multiple reminders&#xA;(setq appt-display-mode-line nil)&#xA;&#xA;; Use appointment data from org-mode&#xA;(defun my-org-agenda-to-appt ()&#xA;  (interactive)&#xA;  (setq appt-time-msg-list nil)&#xA;  (org-agenda-to-appt))&#xA;&#xA;; Update alarms when...&#xA;; (1) ... Starting Emacs&#xA;(my-org-agenda-to-appt)&#xA;&#xA;; (2) ... Everyday at 12:05am (useful in case you keep Emacs always on)&#xA;(run-at-time &quot;12:05am&quot; (* 24 3600) 'my-org-agenda-to-appt)&#xA;&#xA;; (3) ... When TODO.txt is saved&#xA;(add-hook 'after-save-hook&#xA;          '(lambda ()&#xA;             (if (string= (buffer-file-name) (concat (getenv &quot;HOME&quot;) &quot;/ideas/TODO.txt&quot;))&#xA;                 (my-org-agenda-to-appt))))&#xA;&#xA;; Display appointments as a window manager notification&#xA;(setq appt-disp-window-function 'my-appt-display)&#xA;(setq appt-delete-window-function (lambda () t))&#xA;&#xA;(setq my-appt-notification-app (concat (getenv &quot;HOME&quot;) &quot;/bin/appt-notification&quot;))&#xA;&#xA;(defun my-appt-display (min-to-app new-time msg)&#xA;  (if (atom min-to-app)&#xA;    (start-process &quot;my-appt-notification-app&quot; nil my-appt-notification-app min-to-app msg)&#xA;  (dolist (i (number-sequence 0 (1- (length min-to-app))))&#xA;    (start-process &quot;my-appt-notification-app&quot; nil my-appt-notification-app (nth i min-to-app) (nth i msg)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B) Code in ~/bin/appt-notification&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/sh&#xA;&#xA;TIME=&quot;$1&quot;&#xA;MSG=&quot;$2&quot;&#xA;&#xA;notify-send -t 0 &quot;&amp;lt;br&amp;gt;Appointment in $TIME minutes:&amp;lt;br&amp;gt;$MSG&amp;lt;br&amp;gt;&quot;&#xA;play &quot;~/bin/alarm.wav&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get voice notifications you could replace the last line (play) with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;espeak &quot;Appointment in $TIME minutes: $MSG&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="315" LastEditDate="2016-10-19T08:58:55.040" LastActivityDate="2016-10-19T08:58:55.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5822" PostTypeId="2" ParentId="5819" CreationDate="2014-12-28T03:12:21.927" Score="1" Body="&lt;p&gt;If &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; counts for you as part of &quot;etc.&quot; in your &quot;Solutions that work with... etc.&quot;, then you need only set or bind variable &lt;strong&gt;&lt;code&gt;icicle-show-Completions-initially-flag&lt;/code&gt;&lt;/strong&gt; to non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it does not, try calling &lt;code&gt;display-completion-list&lt;/code&gt; (from buffer &lt;code&gt;*Completions*&lt;/code&gt;) when you want &lt;code&gt;*Completions*&lt;/code&gt; to be displayed. If you want all completions for your &lt;code&gt;known-ambiguous&lt;/code&gt; input to be displayed, then use &lt;code&gt;all-completions&lt;/code&gt; to calculate the list of completions, and pass that list to &lt;code&gt;display-completion-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on your comments, Stefan's answer works with or without &lt;strong&gt;Icicles&lt;/strong&gt; (e.g., with &lt;em&gt;Icicle&lt;/em&gt; mode on or off):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (let ((comps  (all-completions known-ambiguous-prefix completions)))&#xA;    (minibuffer-with-setup-hook&#xA;      #'minibuffer-completion-help&#xA;      (completing-read &quot;Choose: &quot; comps))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But with &lt;strong&gt;Icicles&lt;/strong&gt; you can get the same behavior more simply:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (let ((comps  (all-completions known-ambiguous-prefix completions))&#xA;        (icicle-show-Completions-initially-flag  t))&#xA;    (completing-read &quot;Choose: &quot; comps)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:33:05.883" LastActivityDate="2015-05-09T20:33:05.883" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5823" PostTypeId="2" ParentId="5819" CreationDate="2014-12-28T03:20:28.707" Score="0" Body="&lt;p&gt;If you activave helm-mode: &lt;code&gt;(helm-mode 1)&lt;/code&gt;and whenever &lt;code&gt;completing-read&lt;/code&gt; happens, it shows all candidates in a Helm buffer for interactive selecting. With &lt;code&gt;helm-mode&lt;/code&gt; on, no &lt;code&gt;*Completions*&lt;/code&gt; buffer will show up because it is replaced by Helm buffer. It works with prefix too. For example, you can try this with &lt;code&gt;helm-mode&lt;/code&gt; activated: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(completing-read &quot;test: &quot; '(&quot;aaa&quot; &quot;bbb&quot; &quot;abc&quot; &quot;abbbb&quot;) nil t &quot;ab&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A Helm buffer appears and with only two candidates with &quot;ab&quot; prefix: &quot;aabc&quot; and &quot;abbbb&quot;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-12-28T03:20:28.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5825" PostTypeId="2" ParentId="5692" CreationDate="2014-12-28T07:45:13.493" Score="4" Body="&lt;p&gt;&lt;strong&gt;Try this:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute the deadline in a &lt;a href=&quot;http://orgmode.org/manual/The-spreadsheet.html#The-spreadsheet&quot; rel=&quot;nofollow&quot; title=&quot;org-mode spreadsheets resource&quot;&gt;spreadsheet&lt;/a&gt; a.k.a &lt;a href=&quot;http://orgmode.org/manual/Built_002din-table-editor.html#Built_002din-table-editor&quot; rel=&quot;nofollow&quot; title=&quot;org-mode built-in table editor resource&quot;&gt;table&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: mytbl&#xA;| # | [2014-12-14 Sun] | 30 | &amp;lt;2015-01-13 Tue&amp;gt; |&#xA;| # | [2014-12-15 Mon] | 10 | &amp;lt;2014-12-25 Thu&amp;gt; |&#xA;#+TBLFM: $4=$2+$3;D&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Create a new 1x1 table that &lt;a href=&quot;http://orgmode.org/manual/References.html#References&quot; rel=&quot;nofollow&quot; title=&quot;org-mode spreadsheet reference resource&quot;&gt;references&lt;/a&gt; computed deadline from first table using &lt;code&gt;remote(NAME-OR-ID,REF)&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: mydeadline&#xA;| &amp;lt;2015-01-13 Tue&amp;gt; |&#xA;#+TBLFM: $1=remote(mytbl,@1$4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pass 1x1 deadline table as variable via &lt;a href=&quot;http://orgmode.org/manual/Specific-header-arguments.html#Specific-header-arguments&quot; rel=&quot;nofollow&quot; title=&quot;org-mode specific header arguments&quot;&gt;header&lt;/a&gt; &lt;code&gt;:var name=value&lt;/code&gt; to named &lt;code&gt;SRC&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/manual/Structure-of-code-blocks.html#Structure-of-code-blocks&quot; rel=&quot;nofollow&quot; title=&quot;org-mode src code resource&quot;&gt;block&lt;/a&gt;, e.g. set_deadline &lt;a href=&quot;http://orgmode.org/manual/Languages.html#Languages&quot; rel=&quot;nofollow&quot; title=&quot;org-mode code block languages resource&quot;&gt;elisp&lt;/a&gt; code block below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: set_deadline&#xA;#+HEADER: :var the_date=mydeadline&#xA;#+HEADER: :results  raw replace output &#xA;#+begin_src elisp&#xA;   (princ (format &quot;DEADLINE: %s&quot; ( car (car the_date))))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluate the SRC block using &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt; and the deadline will be added to the org-mode file under a &lt;code&gt;#+RESULTS:&lt;/code&gt; block.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding the &lt;code&gt;:results raw&lt;/code&gt;&#xA;header to code block &lt;a href=&quot;http://orgmode.org/manual/results.html#results&quot; rel=&quot;nofollow&quot; title=&quot;org-mode :results header resource&quot;&gt;forces&lt;/a&gt; the output into format org-mode will recognize as regular org statement.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS: set_deadline&#xA;DEADLINE: &amp;lt;2015-01-13 Tue&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As an added bonus, using a named src blocks also encourages code reuse via inline function calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As before, &lt;a href=&quot;http://orgmode.org/manual/Evaluating-code-blocks.html#Evaluating-code-blocks&quot; rel=&quot;nofollow&quot; title=&quot;org-mode evaluating code blocks resource&quot;&gt;evaluate&lt;/a&gt; each inline function using &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt; and a new deadline will be added to the org-mode file. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: first-deadline&#xA;call_set_deadline(the_date=mydeadline)[ :results raw ]&#xA;&#xA;#+RESULTS: first-deadline&#xA;DEADLINE: &amp;lt;2015-01-13 Tue&amp;gt;&#xA;&#xA;#+NAME: my-other-deadline&#xA;| &amp;lt;2014-12-25 Thu&amp;gt; |&#xA;#+TBLFM: $1=remote(mytbl,@2$4)&#xA;&#xA;#+NAME: second-deadline&#xA;call_set_deadline(the_date=my-other-deadline)[ :results raw ]&#xA;&#xA;#+RESULTS: second-deadline&#xA;DEADLINE: &amp;lt;2014-12-25 Thu&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This code was tested using the following versions of emacs and org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&#xA;Org-mode version 8.2.10 (8.2.10-29-g89a0ac-elpa)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2014-12-28T18:01:20.723" LastActivityDate="2014-12-28T18:01:20.723" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5826" PostTypeId="1" AcceptedAnswerId="5827" CreationDate="2014-12-28T08:10:27.363" Score="1" ViewCount="212" Body="&lt;p&gt;I'm trying to use &lt;code&gt;git&lt;/code&gt; to manage my &lt;code&gt;.emacs.d&lt;/code&gt; directory. I occur this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some package files are already managed by package-tools such as &lt;code&gt;el-get&lt;/code&gt;,&lt;code&gt;package.el&lt;/code&gt; via &lt;code&gt;git&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If I add them into my git repository, I met &lt;em&gt;the submodule problem&lt;/em&gt;, which makes things complex. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I exclude these package files, when I sync back to another computer, I have to manually install all the packages.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How to solve this dilemma? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;modified:   el-get/ace-jump-mode (untracked content)&#xA;modified:   el-get/ace-window (untracked content)&#xA;modified:   el-get/dash (untracked content)&#xA;modified:   el-get/f (untracked content)&#xA;modified:   el-get/flycheck (untracked content)&#xA;modified:   el-get/fuzzy (untracked content)&#xA;modified:   el-get/s (untracked content)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-28T10:34:43.147" Title="How to deal with packages when manage .emacs.d file with version control system?" Tags="|git|" AnswerCount="1" CommentCount="4" ClosedDate="2014-12-28T14:34:46.597" ContentLicense="CC BY-SA 3.0" />
  <row Id="5827" PostTypeId="2" ParentId="5826" CreationDate="2014-12-28T10:34:43.147" Score="1" Body="&lt;p&gt;For packages installed via &lt;code&gt;package.el&lt;/code&gt; the approach described &lt;a href=&quot;https://emacs.stackexchange.com/questions/408/synchronize-packages-between-different-machines&quot;&gt;here&lt;/a&gt; would work. For packages installed via &lt;code&gt;el-get&lt;/code&gt; you can use do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(el-get 'sync '(packages))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above line is equivalent to &lt;code&gt;package-install&lt;/code&gt; described in the above link. It ensures that the packages are downloaded and installed, it simply initializes the packages if they are already installed&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2014-12-28T10:34:43.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5828" PostTypeId="1" AcceptedAnswerId="5888" CreationDate="2014-12-28T10:44:25.270" Score="19" ViewCount="8476" Body="&lt;p&gt;Each time I install a package from the Package Menu, if I try to &lt;code&gt;require&lt;/code&gt; it in my init file I get an error unless I manually add it to the load-path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/home/nick/.emacs.d/elpa/use-package-20141220.1645&quot;)&#xA;&#xA;(require 'use-package-autoloads)&#xA;(require 'use-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's tedious. And usually the package path contains version-numbers. If a package was updated, I have to manually edit the load-path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to automate this?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="50" LastEditDate="2015-03-25T13:18:57.620" LastActivityDate="2015-03-25T13:29:08.003" Title="Why do I have to add each package to load-path? (or Problem with require 'package in my init file)" Tags="|init-file|package|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5829" PostTypeId="1" AcceptedAnswerId="5832" CreationDate="2014-12-28T12:07:49.390" Score="24" ViewCount="4561" Body="&lt;p&gt;According to Emacs documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;progn is a special form in `C source code'.&#xA;&#xA;(progn BODY...)&#xA;&#xA;Eval BODY forms sequentially and return value of last one.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What does &lt;code&gt;progn&lt;/code&gt; stands for (or its origin)?&lt;/li&gt;&#xA;&lt;li&gt;Useage: Is it equivalent to &lt;code&gt;Clojure&lt;/code&gt;'s &lt;code&gt;-&amp;gt;&lt;/code&gt; macro?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="10" LastEditDate="2014-12-28T12:26:13.803" LastActivityDate="2021-08-21T17:15:28.770" Title="Curiosity: What does progn stands for?" Tags="|functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5830" PostTypeId="1" AcceptedAnswerId="5834" CreationDate="2014-12-28T12:11:05.393" Score="4" ViewCount="182" Body="&lt;pre&gt;&lt;code&gt;(global-set-key [?\S- ] 'set-mark-command) &#xA;&#xA;(define-key global-map (kbd &quot;C-c SPC&quot;) 'ace-jump-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the differences and when to use what?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-28T13:20:16.573" Title="What's the differences of binding key?" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5831" PostTypeId="2" ParentId="3673" CreationDate="2014-12-28T12:18:22.897" Score="6" Body="&lt;p&gt;It's really quite simple; don't do that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I use &lt;code&gt;(setq vc-follow-symlinks nil)&lt;/code&gt; to not prompt to ask yes/no and not follow to the real file&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It doesn't make much sense to set this variable to &lt;code&gt;nil&lt;/code&gt; and &lt;code&gt;find-file-visit-truename&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. Both variables control whether Emacs should follow symlinks when visiting files. But the latter is much more aggressive. &lt;code&gt;vc-follow-symlinks&lt;/code&gt; only has an effect if the file itself is a symlink, while &lt;code&gt;find-file-visit-truename&lt;/code&gt; follows any symlink leading up to the file, i.e. if a ancestor directory is a symlink it follows that too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter is more expensive and likely not what you want. &lt;code&gt;find-file-visit-truename&lt;/code&gt; overrides whatever you have set &lt;code&gt;vc-follow-symlinks&lt;/code&gt; to, and then it may also go on following other symlinks. If setting the latter to &lt;code&gt;t&lt;/code&gt; gets the job done, then it's preferable to do just that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you mentioned that you have set &lt;code&gt;vc-follow-symlinks&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; I assume that you don't want to follow symlinks. But there's just no way around it. Like a shell an Emacs buffer has a &quot;working directory&quot;, stored in &lt;code&gt;default-directory&lt;/code&gt;. That variable is, among other things, used when running child processes (&lt;code&gt;git&lt;/code&gt; in the case of VC and Magit). Without following the symlink, the process would be run with a working directory which is not inside a repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or in other words:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How to make vc-* and magit treat a soft link to a real file in git repo just like the original file?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can't because &lt;code&gt;default-directory&lt;/code&gt; is set based on the filename. Instead follow the symlink and thereby move into the repository.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-11-30T18:12:06.343" LastActivityDate="2016-11-30T18:12:06.343" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5832" PostTypeId="2" ParentId="5829" CreationDate="2014-12-28T12:25:43.070" Score="34" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;progn&lt;/code&gt; is a special form borrowed from CL-like Lisp dialects. In their implementations it's composed from multiple &lt;code&gt;prog&lt;/code&gt;s, expressions that are evaluated and a number that specifies which expression value is returned. &lt;code&gt;prog1&lt;/code&gt; for instance evaluates all expressions and returns the value of the first, &lt;code&gt;prog2&lt;/code&gt; evaluates all expressions and returns the value of the second, &lt;code&gt;progn&lt;/code&gt; evaluates all expressions and returns the n'th, or rather, the last expression's value.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;progn&lt;/code&gt; in Emacs Lisp is the equivalent of Clojure's &lt;code&gt;do&lt;/code&gt; which is used as means to bundle multiple expressions into a single one.  You'll need to use it for Clojure's &lt;code&gt;if&lt;/code&gt; conditional for instance.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2014-12-28T21:07:31.027" LastActivityDate="2014-12-28T21:07:31.027" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5833" PostTypeId="2" ParentId="5830" CreationDate="2014-12-28T13:03:21.457" Score="4" Body="&lt;p&gt;It's more or less the same.&#xA;The first thing expands to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn (or (vectorp [?\S-]) (stringp [?\S-])&#xA;           (signal 'wrong-type-argument (list 'arrayp [?\S-])))&#xA;       (define-key (current-global-map) [?\S-] 'set-mark-command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And since:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eq (current-global-map) global-map)&#xA;; -&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it's mostly equivalent to the second thing. I do prefer the&#xA;&lt;code&gt;global-set-key&lt;/code&gt; though, since they're nicer semantic-wise.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;update: they aren't the same&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foobar (copy-keymap global-map))&#xA;(define-key foobar (kbd &quot;C-.&quot;) 'forward-char)&#xA;(use-global-map foobar)&#xA;(eq (current-global-map) foobar)&#xA;;; -&amp;gt; t&#xA;(eq (current-global-map) global-map)&#xA;;; -&amp;gt; nil &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2014-12-28T13:20:16.573" LastActivityDate="2014-12-28T13:20:16.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5834" PostTypeId="2" ParentId="5830" CreationDate="2014-12-28T13:14:08.143" Score="4" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Commands.html&quot; rel=&quot;nofollow&quot;&gt;manual node on Commands for Key Bindings&lt;/a&gt;, which I got from the first hit of a &lt;a href=&quot;https://www.google.com/?gws_rd=ssl#q=emacs+global-set-key&quot; rel=&quot;nofollow&quot;&gt;google search for &quot;emacs global-set-key&quot;&lt;/a&gt;, says they're the same:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Command: global-set-key key binding&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This function sets the binding of key in the current global map to binding.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         (global-set-key key binding)&#xA;         ==&#xA;         (define-key (current-global-map) key binding)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you look at the function definition for &lt;code&gt;global-set-key&lt;/code&gt; (&lt;code&gt;C-h f global-set-key&lt;/code&gt;, then follow the link to the source code), the function only does the following (ignoring the error checking code):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key (current-global-map) key command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the docstring for &lt;code&gt;current-global-map&lt;/code&gt; (again, &lt;code&gt;C-h f current-global-map&lt;/code&gt;) says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return the current global keymap.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-28T13:14:08.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5835" PostTypeId="1" AcceptedAnswerId="5836" CreationDate="2014-12-28T14:43:20.437" Score="1" ViewCount="2165" Body="&lt;p&gt;I would like to match a word (that can contain any printable characters except space) separated on the left side by whitespace and on the right side by a newline or whitespace.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the difference between these two regex's:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;[[:space:]]*\\([^[:space:]]+?\\)\\(?:[[:space:]]|$\\)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[[:space:]]*\\([[:graph:]]*\\)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And why does the first one not work?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2014-12-28T14:49:59.617" Title="Matching any printable character but whitespace" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5836" PostTypeId="2" ParentId="5835" CreationDate="2014-12-28T14:49:59.617" Score="2" Body="&lt;p&gt;In the first one, the &lt;code&gt;or&lt;/code&gt; isn't escaped.&#xA;I prefer a less fancy regex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\s-\\([^\n\t ]+\\)[ \n\t]&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's a matter of taste, I guess. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-28T14:49:59.617" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5837" PostTypeId="2" ParentId="5711" CreationDate="2014-12-28T14:56:49.763" Score="1" Body="&lt;p&gt;My crystal ball tells me that when you call &lt;code&gt;(set-buffer-modified-p nil)&lt;/code&gt; you've only made &quot;one&quot; modification to the buffer since it was unmodified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you hadn't called &lt;code&gt;(set-buffer-modified-p nil)&lt;/code&gt;, the &quot;undo&quot; would have marked the buffer as unmodified.  And as it turns out, calling &lt;code&gt;set-buffer-unmodified&lt;/code&gt; has no effect on that part of the behavior: when undoing, Emacs resets the &quot;modified&quot; flag based on entries in the undo-log which say &quot;last time we were here, the buffer was marked unmodified and the associated file had state FOO&quot;.  So you can have several different states that are all considered as &quot;unmodified&quot; and undo/redo will set the modified flag accordingly when getting to those states.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-28T14:56:49.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5839" PostTypeId="2" ParentId="408" CreationDate="2014-12-28T15:52:48.980" Score="5" Body="&lt;p&gt;While &lt;code&gt;package.el&lt;/code&gt; is the standard way to install packages, you might also want to try &lt;code&gt;el-get&lt;/code&gt; which is very useful for installing packages which are not (or cannot be) on elpa. This answer deals with synchronizing such packages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way you ensure that given packages are installed when using el-get is to add something like the following to you init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(el-get 'sync '(packages))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where packages are the list of packages you want to be installed. This function is similar to &lt;code&gt;package-install&lt;/code&gt; it installs the packages only if they are not already installed, otherwise it simply initializes the packages.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2014-12-28T15:52:48.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5840" PostTypeId="2" ParentId="5731" CreationDate="2014-12-28T16:10:13.600" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;bidi-paragraph-direction&lt;/code&gt; is not the answer to your problem, since it affects the whole buffer.  Instead if you want to change the directionality of a particular piece of text, you'll need to insert special control characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. you could insert an LRM (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Left-to-right_mark&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Left-to-right_mark&lt;/a&gt;) character just before the opening &lt;code&gt;$&lt;/code&gt; and another just after the closing &lt;code&gt;$&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know what TeX will do with such characters, tho.  AFAIK there is currently no way in Emacs to insert such characters only for the display via something like a &lt;code&gt;display&lt;/code&gt; property or an &lt;code&gt;after-string&lt;/code&gt; overlay (i.e. not as part of the buffer's content).  You might like to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; requesting a new feature for that.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-28T16:10:13.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5841" PostTypeId="2" ParentId="5732" CreationDate="2014-12-28T17:23:25.290" Score="1" Body="&lt;p&gt;You want to let-bind &lt;code&gt;coding-system-for-write&lt;/code&gt; to &lt;code&gt;utf-8&lt;/code&gt; around the call to &lt;code&gt;write-region&lt;/code&gt;.  This won't prompt you, even if there are characters that can't be encoded.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-28T17:23:25.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5843" PostTypeId="1" AcceptedAnswerId="5869" CreationDate="2014-12-28T19:05:18.707" Score="5" ViewCount="798" Body="&lt;p&gt;I want to export an Org file into PDF, with any depth titles showed in TOC; however, cannot works. Even though adding &lt;code&gt;\setcounter{tocdepth}{5}&lt;/code&gt;, TOC still only contains the title of 3rd depth (&lt;code&gt;\subsubsection&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I check the TeX file it exported: org-export seemed to ignore my setting for &lt;code&gt;org-latex-classes&lt;/code&gt;, and just convert &lt;code&gt;****&lt;/code&gt; into &lt;code&gt;'\item&lt;/code&gt; instead of &lt;code&gt;\paragraph&lt;/code&gt;. But I cannot find some worked solution for this...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following is my &lt;code&gt;org-latex-classes&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-classes&#xA;  '((&quot;article&quot;         &quot;&#xA;\\documentclass[10pt,a4paper]{article}&#xA;\\usepackage[margin=2cm]{geometry}&#xA;\\usepackage{fontspec}&#xA;&#xA;\\XeTeXlinebreakskip = 0pt plus 1pt&#xA;\\linespread{1.36}&#xA;&#xA;\\setcounter{tocdepth}{5}&#xA;&#xA;\\usepackage{multicol}&#xA;&#xA;\\usepackage{hyperref}&#xA;\\hypersetup{&#xA;  colorlinks=true,&#xA;  linkcolor=[rgb]{0,0.37,0.53},&#xA;  citecolor=[rgb]{0,0.47,0.68},&#xA;  filecolor=[rgb]{0,0.37,0.53},&#xA;  urlcolor=[rgb]{0,0.37,0.53},&#xA;  pagebackref=true,&#xA;  linktoc=all,}&#xA;&quot;&#xA; (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA; (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA; (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;)&#xA; (&quot;\\paragraph{%s}&quot; . &quot;\\paragraph*{%s}&quot;)&#xA; (&quot;\\subparagraph{%s}&quot; . &quot;\\subparagraph*{%s}&quot;))&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="515" LastEditorUserId="50" LastEditDate="2014-12-28T23:00:32.767" LastActivityDate="2020-10-21T14:37:12.357" Title="Org headlines are never exported to \paragraph in LaTeX" Tags="|org-mode|latex|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5844" PostTypeId="2" ParentId="408" CreationDate="2014-12-28T19:48:45.327" Score="2" Body="&lt;p&gt;&lt;strong&gt;RSYNC&lt;/strong&gt;:  Synchronize select folders/files using &lt;code&gt;rsync&lt;/code&gt;, either over a home network or via &lt;code&gt;ssh&lt;/code&gt; to a remote server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;rsync&lt;/code&gt; is a one-way synchronization utility that is able to &lt;strong&gt;delete&lt;/strong&gt; files on the target, so please be sure to &lt;strong&gt;back-up&lt;/strong&gt; your data on both the source and target locations, &lt;em&gt;and&lt;/em&gt; thoroughly test using the &lt;code&gt;--dry-run&lt;/code&gt; option, &lt;strong&gt;before&lt;/strong&gt; doing the real thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To read about how to properly configure the &lt;code&gt;.authinfo&lt;/code&gt; file, see  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/auth.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/auth.html&lt;/a&gt;  An example &lt;code&gt;.authinfo&lt;/code&gt; file contents (which may contain multiple different entries) is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine mymachine login myloginname password mypassword port myport&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;  &lt;p&gt;Configure and use the function &lt;code&gt;rsync-remote&lt;/code&gt; to synchronize over &lt;code&gt;ssh&lt;/code&gt; to a remote server.  Or, use the function &lt;code&gt;rsync-local&lt;/code&gt; to synchronize on the same computer or over a trusted home network.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auth-source)&#xA;&#xA;;;; EXAMPLE:&#xA;;;;   (get-auth-info &quot;12.34.567.89&quot; &quot;username&quot;)&#xA;;;;   (get-auth-info &quot;localhost&quot; &quot;root&quot;)&#xA;(defun get-auth-info (host user &amp;amp;optional port)&#xA;  (let ((info (nth 0 (auth-source-search&#xA;                      :host host&#xA;                      :user user&#xA;                      :port port&#xA;                      :require '(:user :secret)&#xA;                      :create t))))&#xA;    (if info&#xA;      (let* ((port (plist-get info :port))&#xA;             (secret-maybe (plist-get info :secret))&#xA;             (secret&#xA;               (if (functionp secret-maybe)&#xA;                 (funcall secret-maybe)&#xA;                 secret-maybe)))&#xA;          (list port secret))&#xA;    nil)))&#xA;&#xA;(defun rsync-filter (proc string)&#xA;  (cond&#xA;    ((string-match&#xA;       &quot;^\\([a-zA-Z0-9_\\-\\.]+\\)@\\([a-zA-Z0-9_\\-\\.]+\\)'s password: &quot;&#xA;       string)&#xA;      (let* ((user (substring string (match-beginning 1) (match-end 1)))&#xA;             (host (substring string (match-beginning 2) (match-end 2)))&#xA;             (password (car (cdr (get-auth-info host user)))))&#xA;        (process-send-string proc (concat password &quot;\n&quot;))))&#xA;    ((not (or (string-match &quot;files\\.\\.\\.\r&quot; string)&#xA;              (string-match &quot;files to consider\n&quot; string)))&#xA;      (with-current-buffer (messages-buffer)&#xA;        (let ((inhibit-read-only t))&#xA;          (goto-char (point-max))&#xA;          (when (not (bolp))&#xA;            (insert &quot;\n&quot;))&#xA;          (insert string)&#xA;          (when (not (bolp))&#xA;            (insert &quot;\n&quot;)))))))&#xA;&#xA;(defun rsync-remote ()&#xA;&quot;Use rsync to a remote server via ssh.  Back-up your data first!!!&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (host &quot;localhost&quot;)&#xA;      (username &quot;root&quot;)&#xA;      (port (or (car (get-auth-info host username))&#xA;                (number-to-string (read-number &quot;Port:  &quot;))))&#xA;      (source&#xA;        (let ((dir (expand-file-name (locate-user-emacs-file &quot;elpa/&quot;))))&#xA;          (if (file-directory-p dir)&#xA;            dir&#xA;            (let ((debug-on-quit nil)&#xA;                  (msg (format &quot;`%s` is not a valid directory.&quot; dir)))&#xA;              (signal 'quit `(,msg))))))&#xA;      (target &quot;/private/var/mobile/elpa/&quot;)&#xA;      (ssh &quot;/usr/bin/ssh&quot;)&#xA;      (rsync &quot;/usr/bin/rsync&quot;)&#xA;      (rsync-include-file &quot;/path/to/include-file.txt&quot;)&#xA;      (rsync-exclude-file &quot;/path/to/exclude-file.txt&quot;)&#xA;      (rsh (concat &quot;--rsh=ssh -p &quot; port &quot; -l &quot; username))&#xA;      (host+target (concat host &quot;:&quot; target)))&#xA;    (start-process&#xA;        &quot;rsync-process&quot;&#xA;        nil&#xA;        rsync&#xA;        &quot;-avr&quot; ;; must specify the `-r` argument when using `--files-from`&#xA;        &quot;--delete&quot;&#xA;        ;; The paths inside the exclusion file must be relative, NOT absolute.&#xA;        ;;; (concat &quot;--files-from=&quot; rsync-include-file)&#xA;        ;;; (concat &quot;--exclude-from=&quot; rsync-exclude-file)&#xA;        rsh&#xA;        source&#xA;        host+target)&#xA;    (set-process-filter (get-process &quot;rsync-process&quot;) 'rsync-filter)&#xA;    (set-process-sentinel&#xA;      (get-process &quot;rsync-process&quot;)&#xA;      (lambda (p e) (when (= 0 (process-exit-status p))&#xA;        (message &quot;rsync-remote:  synchronizing ... done.&quot;))))))&#xA;&#xA;(defun rsync-local ()&#xA;&quot;Use rsync locally -- e.g., over a trusted home network.&#xA; Back-up your data first!!!&quot;&#xA;  (interactive)&#xA;  (let (&#xA;      (rsync-program &quot;/usr/bin/rsync&quot;)&#xA;      (source&#xA;        (let ((dir (expand-file-name&#xA;                     (file-name-as-directory&#xA;                       (read-directory-name &quot;Source Directory: &quot; nil nil nil nil)))))&#xA;          (if (file-directory-p dir)&#xA;            dir&#xA;            (let ((debug-on-quit nil)&#xA;                  (msg (format &quot;`%s` is not a valid directory.&quot; dir)))&#xA;              (signal 'quit `(,msg))))))&#xA;      (target (expand-file-name&#xA;                (file-name-as-directory&#xA;                  (read-directory-name &quot;Target Directory: &quot; nil nil nil nil)))))&#xA;    (unless (y-or-n-p (format &quot;SOURCE:  %s | TARGET:  %s&quot; source target))&#xA;      (let ((debug-on-quit nil))&#xA;        (signal 'quit `(&quot;You have exited the function.&quot;))))&#xA;    (start-process &quot;rsync-process&quot;&#xA;      nil&#xA;      rsync-program&#xA;      &quot;--delete&quot;&#xA;      &quot;-arzhv&quot;&#xA;      source&#xA;      target)&#xA;    (set-process-filter (get-process &quot;rsync-process&quot;) #'rsync-process-filter)&#xA;    (set-process-sentinel&#xA;      (get-process &quot;rsync-process&quot;)&#xA;      (lambda (p e)&#xA;        (when (= 0 (process-exit-status p))&#xA;        (message &quot;Done!&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-08-11T15:05:42.437" LastActivityDate="2017-08-11T15:05:42.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5845" PostTypeId="2" ParentId="5819" CreationDate="2014-12-28T20:14:12.650" Score="7" Body="&lt;p&gt;Last time I needed this, I used something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(minibuffer-with-setup-hook&#xA;    #'minibuffer-completion-help&#xA;  (completing-read ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-28T20:14:12.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5846" PostTypeId="2" ParentId="5666" CreationDate="2014-12-28T20:19:50.507" Score="3" Body="&lt;p&gt;There is &quot;right&quot; answer for that, sadly.  Typically, what packages do when they need to care about the ordering, is that they try to detect the wrong ordering and manually set it back the way it should be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In electric.el we tried to do it &quot;more or less cleanly&quot; with a somewhat generic approach, where each hook function can have a &lt;code&gt;priority&lt;/code&gt; property, and we call &lt;code&gt;electric--sort-post-self-insertion-hook&lt;/code&gt; every time we think we may have gotten the order wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;add-function&lt;/code&gt; (and &lt;code&gt;advice-add&lt;/code&gt;) I provided a similar solution but with direct support, so it should work reliably.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We could extend the &lt;code&gt;electric--sort-post-self-insertion-hook&lt;/code&gt; and move it into &lt;code&gt;add-hook&lt;/code&gt; so it works for all hooks.  Patch welcome.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2014-12-28T20:19:50.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5847" PostTypeId="1" AcceptedAnswerId="5885" CreationDate="2014-12-28T20:43:27.913" Score="4" ViewCount="860" Body="&lt;p&gt;I learned about &lt;code&gt;with-editor&lt;/code&gt; in &lt;a href=&quot;https://emacs.stackexchange.com/questions/27/how-can-i-use-my-local-emacs-client-as-the-editor-for-remote-machines-i-access&quot;&gt;this thread&lt;/a&gt;. This is something that I have been looking for a &lt;em&gt;long&lt;/em&gt; time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use it to modify &lt;code&gt;EDITOR&lt;/code&gt; and &lt;code&gt;VISUAL&lt;/code&gt;follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I installed it from MELPA, then I open an &lt;code&gt;ansi-term&lt;/code&gt; terminal and ssh to a remote host&lt;/li&gt;&#xA;&lt;li&gt;If I do &lt;code&gt;echo $VISUAL&lt;/code&gt;, I get: &lt;code&gt;emacs -nw&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;I then run &lt;code&gt;M-x with-editor-export-editor&lt;/code&gt;, and choose &lt;code&gt;VISUAL&lt;/code&gt; (the only env variable to which &lt;code&gt;crontab&lt;/code&gt; seems to be responsive)&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I now do &lt;code&gt;echo $VISUAL&lt;/code&gt;, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sh -c 'echo &quot;WITH-EDITOR: $$ OPEN $0&quot;; sleep 604800 &amp;amp; sleep=$!; trap &quot;kill $sleep; exit 0&quot; USR1; trap &quot;kill $sleep; exit 1&quot; USR2; wait $sleep'&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;so the &lt;code&gt;with-editor&lt;/code&gt; seems to have worked in affecting &lt;code&gt;VISUAL&lt;/code&gt;, so far so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when I try &lt;code&gt;crontab -e&lt;/code&gt; right after the above, from this same open terminal, I see that it opens a crontab temp file &lt;code&gt;crontab.XXXXzLgfmw&lt;/code&gt; on my local Emacs, but it shows me an empty file, even though it shouldn't be empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I see that it says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Type &lt;code&gt;C-c C-c&lt;/code&gt; to finish, or &lt;code&gt;C-c C-k&lt;/code&gt; to cancel&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but running any of those commands hangs up the original terminal on which I issued the &lt;code&gt;crontab -e&lt;/code&gt; command (the only way to exit it is to kill the full &lt;code&gt;ansi-term&lt;/code&gt; session with &lt;code&gt;kill-buffer&lt;/code&gt;). Why doesn't it work? How can I debug the problem?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-06-24T13:34:25.247" Title="Using with-editor" Tags="|tramp|ssh|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5849" PostTypeId="1" CreationDate="2014-12-28T21:58:11.420" Score="2" ViewCount="5375" Body="&lt;p&gt;I have a text like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;''Lorem ipsum'' dolor ''sit amet, '' consectetur adipiscing elit.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want is to get the &lt;em&gt;sit amet&lt;/em&gt; correctly wrapped around with &lt;code&gt;''&lt;/code&gt;, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;''Lorem ipsum'' dolor ''sit amet'', consectetur adipiscing elit.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that my regular expression selects this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;''Lorem ipsum'' dolor ''sit amet, ''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of just this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;''sit amet, ''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and, if that is the case, the text selected is not the text I want to correct. Any help?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;EDIT&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Sorry, yes, indeed I didn't provided any regexp. The thing is I'm using &lt;a href=&quot;https://github.com/benma/visual-regexp.el&quot; rel=&quot;nofollow&quot;&gt;visual-regexp&lt;/a&gt; and &lt;a href=&quot;https://github.com/benma/visual-regexp-steroids.el/&quot; rel=&quot;nofollow&quot;&gt;visual-regexp-steroids&lt;/a&gt;, in other words I'm using the regular expression engine(?) that comes with Python. That's why I didn't provided any.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regexp &lt;code&gt;''([^']+), ''&lt;/code&gt; works ok (I still have to check the entire 11MB of text) as suggested by mbork.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="690" LastEditDate="2014-12-29T02:56:09.410" LastActivityDate="2015-11-01T06:46:52.850" Title="Regular expression to match text within quotes" Tags="|regular-expressions|" AnswerCount="3" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="5850" PostTypeId="1" AcceptedAnswerId="5853" CreationDate="2014-12-28T22:57:29.410" Score="14" ViewCount="6599" Body="&lt;p&gt;When I'm using org-mode to take notes about a book, sometimes I'll copy/paste some code snippets into the note file. After pasting it, I'll&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. `C-c '` to call `org-edit-special`&#xA;2. `C-x h` to mark all the source code&#xA;3. `TAB` to format it&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a solution in org-mode for me that, after pasting code in &lt;code&gt;#+BEGIN_SRC...#+END_SRC&lt;/code&gt;, it will automatically format the code block or I can use just one key such as &lt;code&gt;TAB&lt;/code&gt; to format(indent) the whole source code block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default &lt;code&gt;TAB&lt;/code&gt;(typed in block, not using &lt;code&gt;C-c '&lt;/code&gt;) is just align all lines 2 columns after &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; header, if there are spaces at the beginning of the second line, it will just add more spaces, it will not indent all lines like the 3 steps.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2022-09-12T19:13:01.890" Title="How to auto-format the source code block in org-mode" Tags="|org-mode|indentation|formatting|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5851" PostTypeId="2" ParentId="3844" CreationDate="2014-12-29T00:36:25.020" Score="4" Body="&lt;p&gt;This is what I ended up coming up with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; org-to-appt&#xA;&#xA;;; based on http://emacs-fu.blogspot.nl/2009/11/showing-pop-ups.html&#xA;(defun talky-popup (title msg &amp;amp;optional icon sound)  &#xA;  &quot;Show a popup if we're on X, or echo it otherwise; TITLE is the title&#xA;of the message, MSG is the context. Optionally, you can provide an ICON and&#xA;a sound to be played&quot;&#xA;&#xA;  (interactive)&#xA;  ;;verbal warning&#xA;&#xA;&#xA;&#xA;  (shell-command&#xA;   ;;  (concat &quot;espeak -v mb-en1 -k5 -s125 &quot; &quot;'&quot; title &quot; &quot; msg &quot;'&quot; &quot; --stdout | paplay&quot;) ;; use local espeak&#xA;   (concat &quot;echo &quot; &quot;'&quot; title &quot;'&quot; &quot; &quot; &quot;'&quot; msg &quot;'&quot; &quot; |text-to-speech en-gb&quot;)  ;; use remote Google voices&#xA;    ;; text-to-speech is from https://github.com/taylorchu/speech-to-text-text-to-speech&#xA;   )&#xA;  (if (eq window-system 'x)&#xA;    (shell-command (concat &quot;notify-send -u critical -t 1800000  &quot; &#xA;&#xA;                     (if icon (concat &quot;-i &quot; icon) &quot;&quot;)&#xA;                     &quot; '&quot; title &quot;' '&quot; msg &quot;'&quot;))&#xA;    ;; text only version&#xA;&#xA;    (message (concat title &quot;: &quot; msg))))&#xA;&#xA;;; the appointment notification facility&#xA;(setq&#xA;  appt-message-warning-time 15 ;; warn 15 min in advance&#xA;&#xA;  appt-display-mode-line t     ;; show in the modeline&#xA;  appt-display-format 'window) ;; use our func&#xA;(appt-activate 1)              ;; active appt (appointment notification)&#xA;(display-time)                 ;; time display is required for this...&#xA;&#xA; ;; update appt each time agenda opened&#xA;&#xA;(add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt)&#xA;&#xA;;; our little façade-function for talky-popup&#xA; (defun talky-appt-display (min-to-app new-time msg)&#xA;    (talky-popup (format &quot;In %s minute(s):&quot; min-to-app) msg &#xA;  ;;    &quot;/usr/share/icons/gnome/32x32/status/appointment-soon.png&quot;   ;; optional icon&#xA;&#xA;  ;;    &quot;/usr/share/sounds/ubuntu/stereo/phone-incoming-call.ogg&quot;    ;; optional sound&#xA;&#xA;        ))&#xA;  (setq appt-disp-window-function (function talky-appt-display))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not dissimilar to scaramouche's setup.&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="675" LastEditDate="2015-05-12T21:26:03.470" LastActivityDate="2015-05-12T21:26:03.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5852" PostTypeId="2" ParentId="5850" CreationDate="2014-12-29T01:12:58.470" Score="0" Body="&lt;p&gt;Start with &lt;a href=&quot;https://github.com/Bruce-Connor/aggressive-indent-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Bruce-Connor/aggressive-indent-mode&lt;/a&gt; to get the paste behavior that you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You know how to do the rest.&lt;/p&gt;&#xA;" OwnerUserId="341" LastActivityDate="2014-12-29T01:12:58.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5853" PostTypeId="2" ParentId="5850" CreationDate="2014-12-29T01:56:53.283" Score="10" Body="&lt;p&gt;Below is a hard solution, but it works perfect. Actually it is just a function which simulations your operations, and use a &lt;code&gt;run-at-time&lt;/code&gt; to make it be called every 10 seconds.&#xA;Cheers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun indent-org-block-automatically ()&#xA;  (when (org-in-src-block-p)&#xA;   (org-edit-special)&#xA;    (indent-region (point-min) (point-max))&#xA;    (org-edit-src-exit)))&#xA;&#xA;(run-at-time 1 10 'indent-org-block-automatically)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, you can make it called every 1 second, just change 10 to 1.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastActivityDate="2014-12-29T01:56:53.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5854" PostTypeId="1" CreationDate="2014-12-29T02:54:23.067" Score="1" ViewCount="391" Body="&lt;p&gt;In &lt;code&gt;helm&lt;/code&gt;, when finding a file, &lt;code&gt;C-c C-x&lt;/code&gt; would prompt for open with external program option. Is there a way to set a default program, say, &lt;code&gt;smplayer&lt;/code&gt; for &lt;code&gt;.mov&lt;/code&gt; file. Then I can just press &lt;code&gt;Enter&lt;/code&gt; to open it.&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2015-02-27T08:42:12.153" Title="How to set default program to open a file in helm?" Tags="|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5855" PostTypeId="1" AcceptedAnswerId="5856" CreationDate="2014-12-29T03:29:58.363" Score="4" ViewCount="715" Body="&lt;p&gt;Here is my openwith settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'openwith)&#xA;(setq openwith-associations '((&quot;\\.mov\\'&quot; &quot;smplayer&quot; (file))))&#xA;(openwith-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press enter in dired mode on a .mov file, it still open it in a text buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any more settings required here?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-29T04:48:10.163" Title="Openwith doesn't work in dired" Tags="|dired|openwith|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5856" PostTypeId="2" ParentId="5855" CreationDate="2014-12-29T04:48:10.163" Score="8" Body="&lt;p&gt;This is the way I've set openwith&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Openwith&#xA;(openwith-mode t)&#xA;(setq openwith-associations&#xA;      (list (list (openwith-make-extension-regexp '(&quot;pdf&quot;))&#xA;                  &quot;evince&quot; '(file))&#xA;            (list (openwith-make-extension-regexp '(&quot;flac&quot; &quot;mp3&quot; &quot;wav&quot;))&#xA;                  &quot;vlc&quot; '(file))&#xA;            (list (openwith-make-extension-regexp '(&quot;avi&quot; &quot;flv&quot; &quot;mov&quot; &quot;mp4&quot;&#xA;                                                    &quot;mpeg&quot; &quot;mpg&quot; &quot;ogg&quot; &quot;wmv&quot;))&#xA;                  &quot;vlc&quot; '(file))&#xA;            (list (openwith-make-extension-regexp '(&quot;bmp&quot; &quot;jpeg&quot; &quot;jpg&quot; &quot;png&quot;))&#xA;                  &quot;ristretto&quot; '(file))&#xA;            (list (openwith-make-extension-regexp '(&quot;doc&quot; &quot;docx&quot; &quot;odt&quot;))&#xA;                  &quot;libreoffice&quot; '(&quot;--writer&quot; file))&#xA;            (list (openwith-make-extension-regexp '(&quot;ods&quot; &quot;xls&quot; &quot;xlsx&quot;))&#xA;                  &quot;libreoffice&quot; '(&quot;--calc&quot; file))&#xA;            (list (openwith-make-extension-regexp '(&quot;odp&quot; &quot;pps&quot; &quot;ppt&quot; &quot;pptx&quot;))&#xA;                  &quot;libreoffice&quot; '(&quot;--impress&quot; file))&#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastActivityDate="2014-12-29T04:48:10.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5857" PostTypeId="1" CreationDate="2014-12-29T07:21:52.167" Score="7" ViewCount="1350" Body="&lt;p&gt;I want to try a new workflow where split windows only happen if I request them, otherwise Emacs simply changes windows.  I tried putting this command in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq pop-up-windows nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it seems to work mostly: if I use a help command, launch a compilation, use &lt;code&gt;M-x occur&lt;/code&gt;, etc. Emacs correctly changes windows.  However, in the &lt;code&gt;*compilation*&lt;/code&gt; buffer, if I press &lt;code&gt;RET&lt;/code&gt; on a line, Emacs splits the frame into two windows.  Does anyone know what other configuration I need to make sure that Emacs properly switches?&lt;/p&gt;&#xA;" OwnerUserId="4026" LastActivityDate="2017-12-04T21:55:12.743" Title="How to set up Emacs to never split windows?" Tags="|window|frames|display|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5858" PostTypeId="1" AcceptedAnswerId="5859" CreationDate="2014-12-29T07:26:35.077" Score="8" ViewCount="2852" Body="&lt;p&gt;The common use of Vim's quickfix is to hand off compilation of code to a command specified by the suggestively named &lt;code&gt;makeprg&lt;/code&gt; variable and then interpret the errors printed by that command so you can quickly jump to the file, row, and column location of each error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vim's quickfix can be subverted and used in other ways but my question only concerns how to reproduce the above described behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What Emacs feature is nearest to Vim's quickfix?&lt;/p&gt;&#xA;" OwnerUserId="2139" LastEditorUserId="25" LastEditDate="2015-02-16T19:02:39.933" LastActivityDate="2015-02-16T19:09:49.370" Title="What Emacs feature is nearest to Vim's quickfix?" Tags="|compilation|vim-emulation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5859" PostTypeId="2" ParentId="5858" CreationDate="2014-12-29T07:40:54.637" Score="16" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation-Mode.html&quot; rel=&quot;nofollow&quot;&gt;Compilation Mode&lt;/a&gt; does the same thing and is built-in. Here is &lt;a href=&quot;http://tuhdo.github.io/static/c-ide/compilation-mode.gif&quot; rel=&quot;nofollow&quot;&gt;a demo&lt;/a&gt;. Basic usage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation.html#index-compile-2624&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;M-x compile&lt;/code&gt;&lt;/a&gt; to run the compilation command (like &lt;code&gt;:make&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;The command is taken from the variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation.html#index-compile_002dcommand-2625&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;compile-command&lt;/code&gt;&lt;/a&gt; (like the &lt;code&gt;makeprg&lt;/code&gt; option)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-g p&lt;/code&gt; and &lt;code&gt;M-g n&lt;/code&gt; to go to the location of the previous/next error (like &lt;code&gt;:cp&lt;/code&gt; and &lt;code&gt;:cn&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-{&lt;/code&gt; and &lt;code&gt;M-}&lt;/code&gt; to go to the previous/next file with an error (like &lt;code&gt;:cnf&lt;/code&gt; and &lt;code&gt;:cpf&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You also have &lt;a href=&quot;http://www.flycheck.org/en/latest/guide/introduction.html&quot; rel=&quot;nofollow&quot;&gt;flycheck&lt;/a&gt; for on-the-fly syntax checking, support &lt;a href=&quot;http://www.flycheck.org/en/latest/guide/languages.html#supported-languages&quot; rel=&quot;nofollow&quot;&gt;43 languages with 73 syntax checkers&lt;/a&gt;. Here is &lt;a href=&quot;https://raw.githubusercontent.com/flycheck/flycheck/master/doc/images/screencast.gif&quot; rel=&quot;nofollow&quot;&gt;a flycheck demo&lt;/a&gt; (from the &lt;a href=&quot;https://github.com/flycheck/flycheck&quot; rel=&quot;nofollow&quot;&gt;Github page&lt;/a&gt;). As you see, when the erroneous code is fixed, the error list refreshes automatically. And of course, you can click or press &lt;kbd&gt;RET&lt;/kbd&gt; on the errors in the list to jump to the erroneous location.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="25" LastEditDate="2015-02-16T19:09:49.370" LastActivityDate="2015-02-16T19:09:49.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5860" PostTypeId="2" ParentId="5854" CreationDate="2014-12-29T07:45:23.397" Score="1" Body="&lt;p&gt;I found the answer by pressing &lt;kbd&gt;C-u C-c C-x&lt;/kbd&gt; when running &lt;kbd&gt;C-x C-f&lt;/kbd&gt;, which was rebind to &lt;code&gt;helm-find-files&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-external-programs-associations (quote ((&quot;rmvb&quot; . &quot;smplayer&quot;) (&quot;mp4&quot; . &quot;smplayer&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This set helm to open files using designated programs. In this case, open .rmvb and .mp4 file using smplayer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq large-file-warning-threshold 500000000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Set the warning threshold to 500 MB, which will get ride of &lt;code&gt;File abc.mp4 is large (330.2M), really open? (y or n) y&lt;/code&gt; annoying message. (Courtesy of @Nsukami _)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this might be helpful to other new helm user.&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2014-12-29T07:45:23.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5862" PostTypeId="1" AcceptedAnswerId="5865" CreationDate="2014-12-29T08:50:14.347" Score="6" ViewCount="1085" Body="&lt;p&gt;I really cannot bear to memorize so many options' name for Org-mode just like learning English vocabulary. For example: &lt;code&gt;#+ATTR_LATEX:&lt;/code&gt;, &lt;code&gt;#+tblname:&lt;/code&gt;, &lt;code&gt;#+CAPTION&lt;/code&gt; for tables, &lt;code&gt;#+ATTR_HTML:&lt;/code&gt; for HTML exporting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Org-mode, what I've known to do something similar to this are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Block complete: enter &lt;code&gt;&amp;lt;s&lt;/code&gt; press &lt;code&gt;TAB&lt;/code&gt; to expand to a &lt;code&gt;#+BEGIN_SRC ... #+END_SRC&lt;/code&gt; block. (or &lt;code&gt;&amp;lt;e&lt;/code&gt;, &lt;code&gt;&amp;lt;q&lt;/code&gt;....etc.)&lt;/li&gt;&#xA;&lt;li&gt;Property name complete: &lt;code&gt;C-c C-x p&lt;/code&gt; to insert property.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But, is there any built-in function to aid user to input/complete &lt;strong&gt;options&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2014-12-29T08:59:32.243" LastActivityDate="2014-12-29T16:04:35.260" Title="Easy way to insert Org options?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5863" PostTypeId="1" CreationDate="2014-12-29T08:57:32.097" Score="9" ViewCount="393" Body="&lt;p&gt;If I can find out which keys I used most, I may create a macro for it; if I can find out which function I used most yet not binded, I can bind it to a key. This may improve efficiency. Is there a way to get these statistics knowledge?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="253" LastEditDate="2014-12-29T12:55:37.470" LastActivityDate="2014-12-29T17:39:06.030" Title="Is there a way to know which keys or functions I used most?" Tags="|key-bindings|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5864" PostTypeId="2" ParentId="5863" CreationDate="2014-12-29T09:00:10.527" Score="5" Body="&lt;p&gt;I used to use &lt;a href=&quot;https://github.com/dacap/keyfreq&quot;&gt;keyfreq&lt;/a&gt;.&#xA;It was good, but eventually I switched it off and went back&#xA;to using my intuition.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-29T09:00:10.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5865" PostTypeId="2" ParentId="5862" CreationDate="2014-12-29T09:04:37.580" Score="5" Body="&lt;p&gt;For such in-buffer options, type &lt;code&gt;#+&lt;/code&gt; and then &lt;code&gt;M-TAB&lt;/code&gt; gives you a list of completions.  This should be bound to &lt;code&gt;pcomplete&lt;/code&gt; by default in &lt;code&gt;org-mode&lt;/code&gt;.  Another standard keybinding provided is &lt;code&gt;C-M-i&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can set options for a particular export route by using &lt;code&gt;C-c C-e #&lt;/code&gt; and tab completing to get the export backend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The section &quot;Export settings&quot; in the Org Manual describes this reasonably well.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2014-12-29T16:04:35.260" LastActivityDate="2014-12-29T16:04:35.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5866" PostTypeId="2" ParentId="5863" CreationDate="2014-12-29T13:40:18.457" Score="4" Body="&lt;p&gt;You can view the last 300 keystrokes with &lt;code&gt;C-h l&lt;/code&gt; calling the &lt;code&gt;view-lossage&lt;/code&gt; function. Inspect the displayed buffer to see what 300 keys you last hit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you call &lt;code&gt;describe-function&lt;/code&gt; then &lt;code&gt;view-lossage&lt;/code&gt; you will see that you can also use the &lt;code&gt;open-dribble-file&lt;/code&gt; function to start writing (record) all characters you type to a file.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2014-12-29T17:39:06.030" LastActivityDate="2014-12-29T17:39:06.030" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5867" PostTypeId="2" ParentId="5863" CreationDate="2014-12-29T15:26:45.650" Score="6" Body="&lt;h3&gt;&lt;code&gt;smex&lt;/code&gt; users&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://github.com/nonsequitur/smex/blob/master/README.markdown&quot;&gt;&lt;code&gt;smex&lt;/code&gt;&lt;/a&gt;, the &lt;code&gt;smex-show-unbound-commands&lt;/code&gt; command does exactly that; show the commands that you use frequently using &lt;code&gt;M-x&lt;/code&gt; (the suggested &lt;code&gt;smex&lt;/code&gt; binding) but have yet to be bound to a key binding. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2014-12-29T15:26:45.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5869" PostTypeId="2" ParentId="5843" CreationDate="2014-12-29T15:34:29.000" Score="3" Body="&lt;p&gt;Try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This buffer is for notes you don't want to save, and for Lisp evaluation.&#xA;;; If you want to create a file, visit that file with C-x C-f,&#xA;;; then enter the text in that file's own buffer.&#xA;&#xA;(let ((org-latex-classes&#xA;   '((&quot;my-article&quot; &quot;&#xA;\\documentclass[10pt,a4paper]{article}&#xA;\\usepackage[margin=2cm]{geometry}&#xA;\\usepackage{fontspec}&#xA;&#xA;\\XeTeXlinebreakskip = 0pt plus 1pt&#xA;\\linespread{1.36}&#xA;&#xA;\\setcounter{tocdepth}{5}&#xA;&#xA;\\usepackage{multicol}&#xA;&#xA;\\usepackage{hyperref}&#xA;\\hypersetup{&#xA;  colorlinks=true,&#xA;  linkcolor=[rgb]{0,0.37,0.53},&#xA;  citecolor=[rgb]{0,0.47,0.68},&#xA;  filecolor=[rgb]{0,0.37,0.53},&#xA;  urlcolor=[rgb]{0,0.37,0.53},&#xA;  pagebackref=true,&#xA;  linktoc=all,}&quot;&#xA;      (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;      (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;      (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;)&#xA;      (&quot;\\paragraph{%s}&quot; . &quot;\\paragraph*{%s}&quot;)&#xA;      (&quot;\\subparagraph{%s}&quot; . &quot;\\subparagraph*{%s}&quot;)))))&#xA;  (with-temp-buffer&#xA;(insert&#xA; (mapconcat 'identity&#xA;        '(&quot;#+LATEX_CLASS: my-article&quot;&#xA;          &quot;#+OPTIONS: h:5 num:3&quot;&#xA;          &quot;* section&quot;&#xA;          &quot;** subsection&quot;&#xA;          &quot;*** subsubsection&quot;&#xA;          &quot;**** paragraph&quot;&#xA;          &quot;***** subparagraph&quot;)&#xA;        &quot;\n&quot;))&#xA;(org-latex-export-as-latex nil nil nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;=&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{section}&#xA;\label{sec-1}&#xA;\subsection{subsection}&#xA;\label{sec-1-1}&#xA;\subsubsection{subsubsection}&#xA;\label{sec-1-1-1}&#xA;\paragraph*{paragraph}&#xA;\label{unnumbered-1}&#xA;\subparagraph*{subparagraph}&#xA;\label{unnumbered-2}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more info see &lt;a href=&quot;http://orgmode.org/org.html#Export-settings&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/org.html#Export-settings&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2014-12-29T15:34:29.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5870" PostTypeId="1" CreationDate="2014-12-29T15:38:35.720" Score="2" ViewCount="304" Body="&lt;p&gt;When using AUCTeX with pdflatex, one can run &lt;code&gt;C-c C-c&lt;/code&gt; (&lt;code&gt;TeX-command-master&lt;/code&gt;) or &lt;code&gt;C-c C-v&lt;/code&gt; (&lt;code&gt;TeX-view&lt;/code&gt;) to spawn a PDF viewer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Evince on Debian Wheezy, in case it's relevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might sound a little absurd, but I find it easy to lose track of where the Evince viewer attached to that particular buffer is. Sometimes it can be buried under other windows or mostly off the screen. I run other instances of Evince too. If it makes any difference, I've got Synctex at least partly working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is there some way of telling emacs/AUCTeX to &quot;find&quot; my Evince viewer, or failing that, is there some convenient way to tell emacs/AUCTeX to kill the viewer and start a new one?&lt;/p&gt;&#xA;" OwnerUserId="100" LastEditorUserId="253" LastEditDate="2014-12-29T15:46:45.317" LastActivityDate="2014-12-29T17:21:21.873" Title="Keeping track of a pdf viewer spawned via AUCTeX?" Tags="|latex|auctex|pdf|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5871" PostTypeId="2" ParentId="5870" CreationDate="2014-12-29T16:16:38.767" Score="2" Body="&lt;h3&gt;Linux/UNIX users&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I'm guessing that you're going to need control over the window manager in order to find/raise the external PDF window.  Here's a function that depends on the UNIX/Linux command line tool &lt;a href=&quot;http://tomas.styblo.name/wmctrl/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;wmctrl&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function (minimally tested) will locate the PDF window and raise it, or spawn a new window if it doesn't exist yet.  The initial part of the code cribs directly from &lt;code&gt;TeX-view&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun TeX-view-dwim ()&#xA;  &quot;Locate PDF file if open and raise it.  Requires wmctrl.&quot;&#xA;  (interactive)&#xA;  (let ((output-file (TeX-active-master (TeX-output-extension))))&#xA;    (when (file-exists-p output-file)&#xA;      (let ((code (call-process-shell-command (format &quot;wmctrl -a %s&quot;&#xA;                                                      output-file))))&#xA;        (cond ((= code 0)               ; pdf has a window, so switch to it&#xA;               (message &quot;Switched to pdf file&quot;))&#xA;              ((= code 1)               ; pdf not open, so open it&#xA;               (message &quot;Opening previously unopened pdf file&quot;)&#xA;               (TeX-view))&#xA;              ((= code 127)             ; wmctrl not installed&#xA;               (error &quot;Please install wmctrl to enable this functionality!&quot;))&#xA;              (t                        ; Something weird just happened&#xA;               (error &quot;Unexpected problem with wmctrl!&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-29T16:16:38.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5872" PostTypeId="1" CreationDate="2014-12-29T16:20:48.600" Score="4" ViewCount="1401" Body="&lt;p&gt;How can I add a custom action to &lt;code&gt;helm-for-files&lt;/code&gt;? The &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki&quot; rel=&quot;nofollow&quot;&gt;helm wiki&lt;/a&gt; mentions that executing &lt;code&gt;eshell&lt;/code&gt; commands is an available action for &lt;code&gt;helm-find-files&lt;/code&gt;. So, if you are using &lt;code&gt;helm-find-files&lt;/code&gt;, one way of creating custom actions is to create an &lt;code&gt;eshell&lt;/code&gt; command. However, &lt;code&gt;helm-for-files&lt;/code&gt; doesn't have it in the list of supported actions.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2020-05-04T17:24:26.850" Title="Adding an action to helm-for-files" Tags="|helm|helm-for-files|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5873" PostTypeId="1" AcceptedAnswerId="5879" CreationDate="2014-12-29T16:48:08.643" Score="3" ViewCount="1236" Body="&lt;p&gt;Trying to find in Project with Projectile.. In the Projectile menu i have &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Find in project (grep) &lt;/li&gt;&#xA;&lt;li&gt;Find in project (ack)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Grep works but if i try ack i get..&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: ack-and-a-half; default-directory: &quot;~/Desktop/proj/&quot; -*- Ack started at Mon Dec 29&#xA;16:39:24&#xA; --ignore-dir=.idea --ignore-dir=.eunit --ignore-dir=.git --ignore-dir=.hg --ignore-dir=.fslckout --ignore-dir=.bzr --ignore-dir=_darcs --ignore-dir=.tox --ignore-dir=.svn --ignore-dir=build --ignore-file=is:TAGS --nocolor --nogroup --column --smart-case --env -- audio zsh:1: command not found: --ignore-dir=.idea&#xA;Ack exited abnormally with code 127 at Mon Dec 29 16:39:24&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't done much to get it to work except install &lt;code&gt;ack-and-a-half&lt;/code&gt; and &lt;code&gt;ag.el&lt;/code&gt; from MELPA (I'm confused about which I want / how to replace one with the other) but don't know how to proceed or debug - I can't find any documentation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ack and ag both work from the terminal and my homebrew dir has been added to the emacs path&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any help for an emacs begginer is much appreciated &lt;/p&gt;&#xA;" OwnerUserId="740" LastEditorUserId="2264" LastEditDate="2014-12-29T19:25:39.923" LastActivityDate="2015-01-04T08:05:04.203" Title="Find in Project with Ack" Tags="|projectile|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5874" PostTypeId="1" AcceptedAnswerId="5875" CreationDate="2014-12-29T16:49:18.410" Score="9" ViewCount="8458" Body="&lt;p&gt;Whenever I try to open an existing file with GNU Emacs, the window always split horizontally so as to show two buffers: one buffer containing the file and the &lt;em&gt;GNU Emacs&lt;/em&gt; buffer. How can I set up Emacs to not do that and show only the buffer that holds the file's text?&lt;/p&gt;&#xA;" OwnerUserId="1971" LastActivityDate="2014-12-29T16:57:55.530" Title="How can I prevent GNU Emacs from splitting windows on startup?" Tags="|window|customize|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5875" PostTypeId="2" ParentId="5874" CreationDate="2014-12-29T16:57:55.530" Score="11" Body="&lt;p&gt;You want the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inhibit-startup-screen t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or, equivalently, say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-variable RET inhibit-startup-screen RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2014-12-29T16:57:55.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5876" PostTypeId="1" AcceptedAnswerId="5880" CreationDate="2014-12-29T17:00:19.887" Score="5" ViewCount="1064" Body="&lt;p&gt;This seems like such a basic feature to have in a diff mode, but I can't find anything in the documentation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have two 1000 line files, and only one line is different, I want to be able to hide the other 999 lines. Something like &lt;code&gt;diff -y --suppress-common-lines&lt;/code&gt; or &lt;code&gt;diff -C 0&lt;/code&gt; (zero lines of context).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I'd really like to be able to toggle such a feature.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2014-12-29T23:46:55.723" Title="How can I only show different lines in ediff?" Tags="|ediff|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5877" PostTypeId="2" ParentId="5857" CreationDate="2014-12-29T17:02:56.920" Score="3" Body="&lt;p&gt;It's not super clear what behavior you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want Emacs to either (1) replace the current buffer in the selected window or (2) show the new buffer in a new frame instead of a new window in the same frame, then consider using non-&lt;code&gt;nil&lt;/code&gt; &lt;strong&gt;&lt;code&gt;pop-up-frames&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, you will likely want to make some additional changes, because Emacs development is quite biased toward windows instead of frames (e.g. some developments do not provide good support for using frames; some developments are not well tested with using frames instead of windows).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs Wiki pages about &lt;a href=&quot;https://www.emacswiki.org/emacs/OneOnOneEmacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;One-On-One Emacs&lt;/a&gt; provide information and code for this approach of favoring the use of frames over Emacs windows.  Favoring means that you can always explicitly split a frame when you like, but Emacs doesn't do that, by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And library &lt;a href=&quot;https://www.emacswiki.org/emacs/oneonone.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;oneonone.el&lt;/code&gt;&lt;/a&gt; might prove useful for this approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Know too that you can make any window &lt;strong&gt;dedicated&lt;/strong&gt;, which means that Emacs will never show a different buffer in it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="15748" LastEditDate="2017-12-04T21:55:12.743" LastActivityDate="2017-12-04T21:55:12.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5878" PostTypeId="2" ParentId="5870" CreationDate="2014-12-29T17:10:37.720" Score="2" Body="&lt;p&gt;The simplest way is to maybe enable SyncTeX using &lt;code&gt;TeX-source-correlate-mode&lt;/code&gt;. Then the default &lt;code&gt;C-c C-v&lt;/code&gt; binding will either spawn or raise the Evince window and additionally jump to the current source location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not want to jump, this function, which is mostly copied from &lt;code&gt;TeX-evince-sync-view&lt;/code&gt;, will only raise the window (should work on Evince 3.14).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun TeX-evince-view-dwim ()&#xA;  (interactive)&#xA;  (require 'url-util)&#xA;  (let* ((uri (concat &quot;file://&quot; (let ((url-unreserved-chars (cons ?/ url-unreserved-chars)))&#xA;                                  (url-hexify-string&#xA;                                   (expand-file-name&#xA;                                    (TeX-active-master (TeX-output-extension)))))))&#xA;         (owner (dbus-call-method&#xA;                 :session &quot;org.gnome.evince.Daemon&quot;&#xA;                 &quot;/org/gnome/evince/Daemon&quot;&#xA;                 &quot;org.gnome.evince.Daemon&quot;&#xA;                 &quot;FindDocument&quot;&#xA;                 uri&#xA;                 t)))&#xA;    (if owner&#xA;        (dbus-call-method&#xA;         :session owner&#xA;         &quot;/org/gtk/Application/anonymous&quot;&#xA;         &quot;org.gtk.Application&quot;&#xA;         &quot;Activate&quot;&#xA;         (list :array :signature &quot;{sv}&quot;))&#xA;      (error &quot;Couldn't find the Evince instance for %s&quot; uri))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This causes Evince to send a raise request to your window manager; if the WM does not support this, it won't work.&lt;/p&gt;&#xA;" OwnerUserId="735" LastEditorUserId="735" LastEditDate="2014-12-29T17:21:21.873" LastActivityDate="2014-12-29T17:21:21.873" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="5879" PostTypeId="2" ParentId="5873" CreationDate="2014-12-29T17:22:16.323" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/projectile/issues/584&quot; rel=&quot;nofollow&quot;&gt;ack-and-a-half is now abandonware&lt;/a&gt;.&#xA;I don't think plain &lt;code&gt;projectile-ack&lt;/code&gt; is still functional in current Projectile -- maybe you should try &lt;code&gt;ag&lt;/code&gt;.&#xA;If you really want &lt;code&gt;ack&lt;/code&gt;, you could give &lt;code&gt;helm-projectile-ack&lt;/code&gt; a try.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="2264" LastEditDate="2014-12-29T21:19:56.710" LastActivityDate="2014-12-29T21:19:56.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5880" PostTypeId="2" ParentId="5876" CreationDate="2014-12-29T18:59:04.520" Score="4" Body="&lt;p&gt;You can tweak the options used by Ediff by customizing &lt;code&gt;ediff-diff-options&lt;/code&gt;, but options controlling the display (like context) are not supported. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can however call &lt;code&gt;ediff-show-diff-output&lt;/code&gt; from an ediff session (bound to &lt;code&gt;D&lt;/code&gt;). This command will create a new buffer containing the 'raw' diff output. This command can have its own set of options, e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ediff-custom-diff-options &quot;--suppress-common-lines&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is not an ideal solution as the resulting buffer is not interactive in any way -- it just shows the diff command output. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2014-12-29T20:58:00.443" LastActivityDate="2014-12-29T20:58:00.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5881" PostTypeId="2" ParentId="5873" CreationDate="2014-12-29T19:35:48.133" Score="5" Body="&lt;p&gt;According to &lt;a href=&quot;https://github.com/rferraz/ack-and-a-half/blob/master/ack-and-a-half.el#L338&quot; rel=&quot;nofollow noreferrer&quot;&gt;the source&lt;/a&gt;, I would reckon &lt;code&gt;ack-and-a-half-executable&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.  This would explain the output you get.  Again from &lt;a href=&quot;https://github.com/rferraz/ack-and-a-half/blob/master/ack-and-a-half.el#L72&quot; rel=&quot;nofollow noreferrer&quot;&gt;the source&lt;/a&gt;, it would appear that &lt;code&gt;ack&lt;/code&gt; is not visible to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the TODO:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;; TODO Determine how to fall back to using ack-grep if ack is not found.&#xA;(defcustom ack-and-a-half-executable (executable-find &quot;ack&quot;)&#xA;  &quot;*The location of the ack executable&quot;&#xA;  :group 'ack-and-a-half&#xA;  :type 'file)&#xA;&#xA;;...&#xA;&#xA;(compilation-start&#xA;  (mapconcat 'identity&#xA;             (nconc (list ack-and-a-half-executable)&#xA;                    arguments)&#xA;             &quot; &quot;)&#xA;  'ack-and-a-half-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/q/550/2264&quot;&gt;exec-path and $PATH&lt;/a&gt; for information on how to show Emacs where &lt;code&gt;ack&lt;/code&gt; is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that @TuDo's answer stands as good advice -- drop &lt;code&gt;ack-and-a-half&lt;/code&gt; in favor of another solution (such as &lt;code&gt;helm-ag&lt;/code&gt; or simply &lt;code&gt;ag.el&lt;/code&gt;) -- but I hope this answer actually diagnosis the problem for you or anyone else who has become dependent on &lt;code&gt;ack-and-a-half&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2014-12-29T19:42:19.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5882" PostTypeId="1" AcceptedAnswerId="5979" CreationDate="2014-12-29T21:21:57.847" Score="4" ViewCount="1157" Body="&lt;p&gt;I want to unset the backspace key and I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;&amp;lt;backspace&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluating this in the buffer gives me &lt;code&gt;nil&lt;/code&gt; but still the backspace key works as expected. How to unbind this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After unbinding when I do &lt;code&gt;C-h k&lt;/code&gt; on backspace it still shows me this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;DEL (translated from &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt;) runs the command autopair-backspace,&#xA;  which is an interactive compiled Lisp function in `autopair.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to DEL.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(autopair-backspace)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Possibly delete a pair of paired delimiters.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="904" LastActivityDate="2015-01-03T00:09:44.667" Title="Global Unset Key: Backspace" Tags="|key-bindings|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5883" PostTypeId="2" ParentId="5882" CreationDate="2014-12-29T21:36:56.937" Score="0" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(define-key (cdar autopair--emulation-alist) (kbd &amp;quot;DEL&amp;quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This looks very non-standard, by the way.&lt;/p&gt;&#xA;&lt;h2&gt;update:&lt;/h2&gt;&#xA;&lt;p&gt;Alright, here's a weird fix:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setcdr (car autopair--emulation-alist)&#xA;        '(keymap (93 . autopair-skip-close-maybe)&#xA;          (91 . autopair-insert-opening)&#xA;          (41 . autopair-skip-close-maybe)&#xA;          (40 . autopair-insert-opening)&#xA;          (34 . autopair-insert-or-skip-quote)&#xA;          (13 . autopair-newline))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-12-29T21:53:00.263" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5884" PostTypeId="2" ParentId="5882" CreationDate="2014-12-29T22:27:39.290" Score="0" Body="&lt;p&gt;This is not exactly an answer to your question since it doesn't &lt;em&gt;unset&lt;/em&gt; the &lt;kbd&gt;DEL&lt;/kbd&gt; binding, but the following piece of code should shadow any existing binding (whether defined by &lt;code&gt;autopair&lt;/code&gt; or any other minor/major mode or the global map):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun do-nothing ()&#xA;  &quot;Don't do anything&quot;&#xA;  (interactive))&#xA;&#xA;(define-minor-mode no-backspace-mode&#xA;  &quot;Disable the backspace key&quot;&#xA;  :global t&#xA;  :lighter &quot; noBackspace&quot;)&#xA;&#xA;(defvar no-backspace--emulation-alist&#xA;  `((no-backspace-mode&#xA;     . ,(let ((map (make-sparse-keymap)))&#xA;          (define-key map (kbd &quot;DEL&quot;) #'do-nothing)&#xA;          map)))) &#xA;&#xA;(add-to-list 'emulation-mode-map-alists 'no-backspace--emulation-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;no-backspace-mode&lt;/code&gt; is active, the &lt;kbd&gt;DEL&lt;/kbd&gt; key should not do anything. It should work as usual when &lt;code&gt;no-backspace-mode&lt;/code&gt; is inactive.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2014-12-29T22:27:39.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5885" PostTypeId="2" ParentId="5847" CreationDate="2014-12-29T23:23:13.503" Score="7" Body="&lt;p&gt;As pointed out by @Nsukami and briefly summarized in my comment he linked to, this is not supported out-of-the-box yet. But by following &lt;a href=&quot;https://emacs.stackexchange.com/questions/5589/automatically-update-default-directory-when-pwd-changes-in-shell-mode-and-term-m&quot;&gt;these suggestions&lt;/a&gt; you should be able to get it to work.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What I don't understand is, if this doesn't work with when ssh'ing into a remote host, when would setting &lt;code&gt;$EDITOR&lt;/code&gt; [to anything but &lt;code&gt;emacsclient&lt;/code&gt;] by handy?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;ssh&lt;/code&gt; inside of &lt;code&gt;term&lt;/code&gt;/&lt;code&gt;shell&lt;/code&gt; isn't the only way to connect to a remote and then run a command there. E.g. you could open a remote directory using Tramp and then use &lt;code&gt;async-shell-command&lt;/code&gt;. This does work because this does set the &lt;code&gt;default-directory&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This library was written so that Magit could commit using &lt;code&gt;git commit&lt;/code&gt; instead of &lt;code&gt;git commit -m message&lt;/code&gt; and so that rebasing would work over Tramp - and nothing else. Why one would want that is explained &lt;a href=&quot;https://github.com/magit/magit/wiki/Emacsclient&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. That requires the use of the &lt;code&gt;emacsclient&lt;/code&gt; but unfortunately that doesn't work over Tramp. So we needed something like &lt;code&gt;emacsclient&lt;/code&gt; but which talks back over stdout instead of a socket. The library's header describes how that is done.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Now, when I try &lt;code&gt;crontab -e&lt;/code&gt; right after the above, from this same open terminal, I see that it opens a crontab temp file &lt;code&gt;crontab.XXXXzLgfmw&lt;/code&gt; on my local Emacs, but it shows me an empty file, even though it shouldn't be empty.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's because it &lt;em&gt;is&lt;/em&gt; a local file, which does not actually exist yet, when Emacs &lt;em&gt;should&lt;/em&gt; open a remote file instead. Neither the remote process which needs to use an editor nor the &quot;sleeping editor&quot; process do know that they &quot;are remote&quot; (all processes are local to the machine they run on). Only the elisp part of &lt;code&gt;with-editor&lt;/code&gt; (which consumes the sleeping editor's stdout) can know about that and it does so by consulting &lt;code&gt;default-directory&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tramp does set that variable, so here it just works. &lt;code&gt;term&lt;/code&gt; and &lt;code&gt;shell&lt;/code&gt; do not do so, but by using the packages mentioned in the emacs.se answer I linked to above, they presumably can be taught to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will eventually try out these packages myself and if they do their job I will update &lt;code&gt;with-editor&lt;/code&gt;'s documentation accordingly and make code adjustments if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But again &lt;code&gt;with-editor&lt;/code&gt; was written for Magit, and that doesn't need these features. I was well aware that this library could be useful outside of Magit, that's why I have implemented it as a separate library which does not depend on anything else in Magit. But some of the features it now contains I originally intended for somebody else to implement &lt;em&gt;outside&lt;/em&gt; of &lt;code&gt;with-editor.el&lt;/code&gt;. @Silex got all exited about the core functionality and so we ended up implementing these things directly in &lt;code&gt;with-editor&lt;/code&gt;, but for the time being I don't intend to implement any features not actually required by Magit itself.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;running any of those commands hangs up the original terminal&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It doesn't actually hang, it just waits for the &quot;sleeping editor&quot; to return, which it does after a week (sic) or when receiving an appropriate signal. Because the elisp part of &lt;code&gt;with-editor&lt;/code&gt;, which is responsible for sending that signal, is unaware that it should send it to a remote process, it instead sends it to the local process with the same pid (which hopefully doesn't exist or at least isn't an important one).&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-06-24T13:34:25.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5886" PostTypeId="1" AcceptedAnswerId="5896" CreationDate="2014-12-29T23:44:07.250" Score="1" ViewCount="69" Body="&lt;p&gt;According to the Semantic &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/semantic.html&quot; rel=&quot;nofollow&quot;&gt;docs&lt;/a&gt;, &lt;code&gt;semantic-edit.el&lt;/code&gt; is the file which handles all incremental parsing. I see frequent incremental parse errors(not information messages, since I have &lt;code&gt;semantic-edits-verbose-flag&lt;/code&gt; &lt;code&gt;nil&lt;/code&gt;) and would like to set a minimum time interval between consecutive reparses of my cpp files. Other than &lt;code&gt;semantic-edits-verbose-flag&lt;/code&gt;, I don't see any &lt;code&gt;defcustom&lt;/code&gt;'s in &lt;code&gt;semantic-edit.el&lt;/code&gt;. Is there a way of customizing this behaviour?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2014-12-29T23:49:31.357" LastActivityDate="2014-12-30T12:51:24.110" Title="Setting minimum time between consecutive reparses by semantic" Tags="|semantic-mode|parse-time|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5887" PostTypeId="2" ParentId="5876" CreationDate="2014-12-29T23:46:55.723" Score="2" Body="&lt;p&gt;I don't think Ediff is the right tool here. As I understand it, it's purpose is exactly to show you the difference &lt;em&gt;with&lt;/em&gt; all the context (all while make it easy to move between different parts that have changed). You might want to use regular &lt;code&gt;diff-mode&lt;/code&gt; instead (e.g. using the &lt;code&gt;diff&lt;/code&gt; Emacs command).&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2014-12-29T23:46:55.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5888" PostTypeId="2" ParentId="5828" CreationDate="2014-12-30T00:56:02.200" Score="25" Body="&lt;h2&gt;TL;DR:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add the following line to the top of your init file (&lt;code&gt;.emacs.d/init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;The explanation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Creating more of the files which Emacs might use as the &lt;code&gt;user-init-file&lt;/code&gt; is definitely not the right approach. Because the manual doesn't say which is preferred in case there is a conflict, at least not in the part you quoted, all this does is to &lt;em&gt;add&lt;/em&gt; confusion - now we don't know which actually is the &lt;code&gt;user-init-file&lt;/code&gt; (whose value you might want to inspect to find out).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So start by removing all candidates except &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; which is generally preferred (by users) because it doesn't contribute to the unholy mess that is &lt;code&gt;$HOME&lt;/code&gt; and it allows keeping all Emacs configuration files, including the most important one, under version control using a repository just for Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default Emacs calls &lt;code&gt;package-initialize&lt;/code&gt; &lt;em&gt;after&lt;/em&gt; the user's init file has been loaded. It does so &lt;em&gt;at all&lt;/em&gt;, because nowadays &lt;em&gt;most&lt;/em&gt; users install their packages using &lt;code&gt;package.el&lt;/code&gt; - so they should not have to do anything for these packages to be made available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand not &lt;em&gt;everybody&lt;/em&gt; does, so it should be possible to &lt;em&gt;not&lt;/em&gt; call &lt;code&gt;package-initialize&lt;/code&gt;. Preventing that function from being called is done by adding &lt;code&gt;(setq package-enable-at-startup nil)&lt;/code&gt; to the user's init file (where else could you put it?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package-initialize&lt;/code&gt; cannot be called before the user had a change to tell Emacs not to do it, and so it has to be done &lt;em&gt;after&lt;/em&gt; loading the init file. As long as the user only installs packages and then uses them as-is or customizes them using the Custom interface that works just fine. But if you want to do customize your packages using elisp then you do have to make sure they are actually on the &lt;code&gt;load-path&lt;/code&gt; before using functions they define.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's quite easy to do and properly documented (if I had looked that up first, I wouldn't have had to write most of the above :-/&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The reason automatic package loading occurs after loading the init&#xA;  file is that user options only receive their customized values after&#xA;  loading the init file, including user options which affect the&#xA;  packaging system.  In some circumstances, you may want to load packages&#xA;  explicitly in your init file (usually because some other code in your&#xA;  init file depends on a package).  In that case, your init file should&#xA;  call the function &lt;code&gt;package-initialize&lt;/code&gt;.  It is up to you to ensure that&#xA;  relevant user options, such as &lt;code&gt;package-load-list&lt;/code&gt; (see below), are set&#xA;  up prior to the &lt;code&gt;package-initialize&lt;/code&gt; call.  You should also set&#xA;  &lt;code&gt;package-enable-at-startup&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, to avoid loading the packages&#xA;  again after processing the init file.  Alternatively, you may choose to&#xA;  completely inhibit package loading at startup, and invoke the command&#xA;  `M-x package-initialize' to load your packages manually.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; .emacs.d/init.el -- the `user-init-file'&#xA;&#xA;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;&#xA;(require 'use-package)&#xA;&#xA;(use-package some-package&#xA;  :init (setq some-package-variable &quot;foobar&quot;)&#xA;&#xA;    ...&#xA;&#xA;;;; .emacs.d/init.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Of course the problem (or an additional problem) could also be that the typo in &lt;code&gt;Symbol's function definition is void: use-packge&lt;/code&gt; is in your init file and did not not happen until you typed it into emacs.se.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="50" LastEditDate="2015-03-25T13:25:13.443" LastActivityDate="2015-03-25T13:25:13.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5889" PostTypeId="1" AcceptedAnswerId="5892" CreationDate="2014-12-30T02:35:53.337" Score="29" ViewCount="17098" Body="&lt;p&gt;I know I can use &lt;code&gt;*bold*, /italic/, _underlined_, =verbatim= and ~code~, and, if you must, ‘+strike-through+’&lt;/code&gt; to do some &lt;code&gt;markup&lt;/code&gt; to text according to &lt;a href=&quot;http://orgmode.org/manual/Emphasis-and-monospace.html#Emphasis-and-monospace&quot; rel=&quot;noreferrer&quot;&gt;org-mode documentation&lt;/a&gt;, but they are not enough for me(&lt;code&gt;bold&lt;/code&gt; is not obvious when viewing the org file), I know I can customize &lt;code&gt;org-emphasis-alist&lt;/code&gt;, but the documentation doesn't tell much. What I want is to highlight the text selected like &lt;code&gt;enriched-mode&lt;/code&gt; like the image in &lt;a href=&quot;https://stackoverflow.com/a/20016713/1528712&quot;&gt;this page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TRz1m.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TRz1m.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;enriched-mode&lt;/code&gt; will save the file as &lt;code&gt;text/enriched&lt;/code&gt; format, and I have to use &lt;code&gt;enriched-mode&lt;/code&gt; not &lt;code&gt;org-mode&lt;/code&gt; itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how can I re-define or define a new markup(maybe customize &lt;code&gt;org-emphasis-alist&lt;/code&gt;) to highlight text like &lt;code&gt;enriched-mode&lt;/code&gt;, so &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the highlight is permanent in this file(I can see the highlight in Emacs) &lt;/li&gt;&#xA;&lt;li&gt;at the same time it can be exported into pdf or html file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2018-08-29T10:07:36.550" LastActivityDate="2018-08-29T10:07:36.550" Title="How to highlight text permanently in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5890" PostTypeId="1" AcceptedAnswerId="5891" CreationDate="2014-12-30T03:44:17.700" Score="1" ViewCount="312" Body="&lt;p&gt;I've just started learning Org-Mode and have comes across the issue of unending lines while journalling. All the different minor modes for line breaking and word wrapping have me confused. I want lines to end where the screen does, and not be dependent upon me hitting return. I also want to be able to move up and down a single line, defined by the size of the window and not where a line's newline character is, because I'm constantly resizing my window. I'm using Aquamacs right now, though also use iTerm.  &lt;/p&gt;&#xA;" OwnerUserId="4038" LastActivityDate="2014-12-30T04:40:51.227" Title="Line break/word wrap setup for writing a book/journal" Tags="|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5891" PostTypeId="2" ParentId="5890" CreationDate="2014-12-30T04:40:51.227" Score="5" Body="&lt;p&gt;You are looking for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html&quot;&gt;visual-line-mode&lt;/a&gt;. To enable, do &lt;code&gt;M-x visual-line-mode&lt;/code&gt;. To enable it globally, do &lt;code&gt;M-x global-visual-line-mode&lt;/code&gt; (or in your init file, place: &lt;code&gt;(global-visual-line-mode 1)&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;When Visual Line mode is enabled, `word-wrap' is turned on in&#xA;this buffer, and simple editing commands are redefined to act on&#xA;visual lines, not logical lines.  See Info node `Visual Line&#xA;Mode' for details.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="675" LastActivityDate="2014-12-30T04:40:51.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5892" PostTypeId="2" ParentId="5889" CreationDate="2014-12-30T04:53:04.367" Score="37" Body="&lt;p&gt;You can change what face is used to display bold (or any other) markup by adding a new entry to &lt;code&gt;org-emphasis-alist&lt;/code&gt;.  For example, to make &lt;code&gt;*bold*&lt;/code&gt; display in red, use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-emphasis-alist&#xA;             '(&quot;*&quot; (:foreground &quot;red&quot;)&#xA;               ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will have to restart org-mode (with &lt;code&gt;org-mode-restart&lt;/code&gt;) for this to take effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to add new markup characters like this doesn't seem to work, it only changes how the existing markup is displayed in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't affect exports at all.  &lt;code&gt;*bold*&lt;/code&gt; still exports to whatever bold means in that format (e.g. &lt;code&gt;&amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt;&lt;/code&gt; in html or &lt;code&gt;\textbf{bold}&lt;/code&gt; in Latex).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-12-30T04:53:04.367" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5893" PostTypeId="1" AcceptedAnswerId="7508" CreationDate="2014-12-30T06:47:11.483" Score="5" ViewCount="1059" Body="&lt;p&gt;I've got a couple dozen org files that I'd like to have loaded at once.  They're in a directory structure something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org/dev&#xA;org/dev/python.org&#xA;org/dev/emacs.org&#xA;...&#xA;org/dev/ios&#xA;org/dev/ios/swift.org&#xA;...&#xA;org/dev/android&#xA;org/dev/android/android.org&#xA;org/ergo&#xA;org/ergo/programming_by_voice.org&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the best way to load all these files at once so that I can have the buffers in memory when I'm working on my notes?  It's nice to be able to type C-x b and have my buffers listed for autocomplete with ido, rather than navigating the directory tree.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="25" LastEditDate="2015-02-16T19:39:40.550" LastActivityDate="2015-03-17T14:42:09.840" Title="Load all org files into buffers?" Tags="|org-mode|files|find-file|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5894" PostTypeId="1" CreationDate="2014-12-30T07:23:51.743" Score="1" ViewCount="545" Body="&lt;p&gt;I used to be able to use alt+enter to create new entries in org mode. EMACS suddenly stopped responding to the combination and started to return &quot;M-kp-enter is undefined&quot;. How can I get it to work again?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS I'm using EMACS on Windows 8.&lt;/p&gt;&#xA;" OwnerUserId="4042" LastActivityDate="2021-05-18T11:01:20.140" Title="Why does the alt+enter combination only work sometimes in org mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5895" PostTypeId="2" ParentId="5872" CreationDate="2014-12-30T10:52:28.487" Score="3" Body="&lt;p&gt;&lt;code&gt;helm-for-files&lt;/code&gt; are only composed of these &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/c156260c1e8421b79cf723304ee555316687db9c/helm-for-files.el#L29&quot; rel=&quot;nofollow noreferrer&quot;&gt;sources&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   '(helm-source-buffers-list&#xA;     helm-source-recentf&#xA;     helm-source-bookmarks&#xA;     helm-source-file-cache&#xA;     helm-source-files-in-current-dir&#xA;     helm-source-locate) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-find-files&lt;/code&gt; is created from this source: &lt;code&gt;helm-source-ffiles&lt;/code&gt;. So, it means you cannot share actions between two commands. Those are different.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="1979" LastEditDate="2020-05-04T17:24:26.850" LastActivityDate="2020-05-04T17:24:26.850" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="5896" PostTypeId="2" ParentId="5886" CreationDate="2014-12-30T12:51:24.110" Score="2" Body="&lt;p&gt;Semantic should parse only when Emacs is idle. The variable &lt;code&gt;semantic-idle-scheduler-idle-time&lt;/code&gt; is the amount of idle time, in seconds, before the Semantic idle scheduler activates.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2014-12-30T12:51:24.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5898" PostTypeId="1" AcceptedAnswerId="5988" CreationDate="2014-12-30T16:29:57.947" Score="0" ViewCount="252" Body="&lt;p&gt;After a while running emacs (typically days) all comint buffers start to behave strangely (shell, python, SQL).  The ones I have already opened and the new ones that I open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I am after prompt, C-a moves tho the beginning of the line, as opposed to right after the prompt.  More irritating is the fact that in this state C-up (&lt;code&gt;comint-previous-input&lt;/code&gt;) moves to the beggining of the line before inserting the previous input, leaving the line broken (the text is before the prompt).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A workaround for the second problem is to do &lt;code&gt;(setq comint-use-prompt-regexp t)&lt;/code&gt;, but the first problem remains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That was happening with emacs 24.3 in GNU Linux (cassou ppa for Ubuntu 12.04) and happens also now with emacs 24.4 (compiled by myself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I debugged the shipped comint.el and tracked the issue to the built-in function &lt;code&gt;line-beginning-position&lt;/code&gt;; in freshly started emacs sessions that function works fine in comint mode.  After a while this function just returns the point at the beggining of line (just like comint-mode were not enabled).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect it has something to do with my setup, since google did not came up with any help.  However, binary search is not an option since I would need to spend days with a half functional emacs while waiting for the problem to happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas about how to narrow the suspects or further debug the problem?&lt;/p&gt;&#xA;" OwnerUserId="4048" LastEditorUserId="4048" LastEditDate="2015-01-01T17:03:09.350" LastActivityDate="2015-01-03T09:14:23.910" Title="move-beginning-of-line broken in comint mode" Tags="|debugging|comint|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5899" PostTypeId="2" ParentId="5898" CreationDate="2014-12-30T16:52:03.937" Score="0" Body="&lt;p&gt;Try to reproduce the problem without using your init file: &lt;code&gt;emacs -Q&lt;/code&gt;, loading anything you need explicitly, and keeping track of all that you do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can repro the problem that way, then report this as a bug: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you cannot, then recursively bisect your init file, to find out what the culprit code is. You can do that by commenting out blocks of code there, using command &lt;code&gt;comment-region&lt;/code&gt; (you can uncomment a selection by giving that command a plain prefix arg, &lt;code&gt;C-u&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2014-12-30T16:52:03.937" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5900" PostTypeId="1" AcceptedAnswerId="5903" CreationDate="2014-12-30T17:02:18.563" Score="17" ViewCount="3861" Body="&lt;p&gt;I have a variety of (facile) tasks in some kind of hierarchy.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Make a pizza&#xA;** TODO Get cheese&#xA;*** TODO Buy a cow&#xA;** TODO Get tomatoes&#xA;*** TODO Grow tomatoes&#xA;**** TODO Buy tomatoes&#xA;** TODO Buy oven&#xA;*** TODO Win Lottery&#xA;**** TODO Buy Lottery ticket&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I view these in with the org agenda, they're displayed in a flat fashion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  .TODO:    TODO Make a pizza&#xA;  .TODO:    TODO Get cheese&#xA;  .TODO:    TODO Buy a cow&#xA;  .TODO:    TODO Get tomatoes&#xA;  .TODO:    TODO Grow tomatoes&#xA;  .TODO:    TODO Buy tomatoes&#xA;  .TODO:    TODO Buy oven&#xA;  .TODO:    TODO Win Lottery&#xA;  .TODO:    TODO Buy Lottery ticket&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to view these tasks in an indented fashion, so they reflect the dependencies between the tasks. Is this possible / a good idea or am I just using the agenda incorrectly?&lt;/p&gt;&#xA;" OwnerUserId="503" LastEditorUserId="2287" LastEditDate="2014-12-30T17:34:04.673" LastActivityDate="2014-12-30T17:34:10.697" Title="How can I view the hierarchy of TODO keywords in org agenda mode?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5901" PostTypeId="1" AcceptedAnswerId="5910" CreationDate="2014-12-30T17:13:08.820" Score="4" ViewCount="117" Body="&lt;p&gt;My (simplified) setup: one frame for twittering-mode and another for w3m, among others, all inside tmux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While in the twittering-mode frame, &lt;code&gt;C-m&lt;/code&gt; on a link does one of two things.  Sometimes, the link loads in the w3m frame.  Other times, the twittering-mode frame switches to a w3m buffer, so I have to type &lt;code&gt;C-x b C-m&lt;/code&gt; to return to twittering-mode after each link I open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to guarantee that the first behavior occurs?  It makes browsing Twitter for articles to read very convenient.  (Load several, read one, type &lt;code&gt;B&lt;/code&gt; to read another.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried playing with &lt;code&gt;display-buffer-alist&lt;/code&gt;, as suggested &lt;a href=&quot;http://www.emacswiki.org/emacs/Special_Frames&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;https://stackoverflow.com/questions/16650937/reuse-compilation-window-in-another-frame&quot;&gt;here&lt;/a&gt;, and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window.html#Choosing-Window&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, all to no avail.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;.w3m.*&quot;&#xA;  (display-buffer-reuse-window)&#xA;  (reusable-frames . &quot;visible&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this not possible?&lt;/p&gt;&#xA;" OwnerUserId="4049" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-12-30T21:52:25.733" Title="Force twittering-mode links to always open in a specific frame?" Tags="|buffers|frames|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5903" PostTypeId="2" ParentId="5900" CreationDate="2014-12-30T17:15:42.720" Score="12" Body="&lt;p&gt;Try customizing &lt;code&gt;org-agenda-prefix-format&lt;/code&gt;. This can be used to tweak how various kinds of items (including TODOs) are displayed in agenda views.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, you can use &lt;code&gt;%l&lt;/code&gt; in the &lt;code&gt;todo&lt;/code&gt; format to prefix the item with a number of spaces corresponding to its level in the hierarchy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to use &lt;code&gt;%b&lt;/code&gt; to include a 'breadcrumb' trail for each line item showing the hierarchy, e.g. &lt;code&gt;Level1 -&amp;gt; Level2:  TODO  Do the thing&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-12-30T17:15:42.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5904" PostTypeId="1" AcceptedAnswerId="5905" CreationDate="2014-12-30T17:25:52.053" Score="7" ViewCount="633" Body="&lt;p&gt;I often find myself debugging some stuff in the installed Emacs&#xA;sources, which are in &lt;code&gt;*.el.gz&lt;/code&gt; form.  And the ability to &lt;code&gt;rgrep&lt;/code&gt;&#xA;would be quite handy. Is this readily possible?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-30T17:30:47.953" Title="Is it possible to rgrep *.el.gz files?" Tags="|rgrep|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5905" PostTypeId="2" ParentId="5904" CreationDate="2014-12-30T17:30:47.953" Score="13" Body="&lt;p&gt;You can use the command &lt;code&gt;zrgrep&lt;/code&gt;, which was introduced in Emacs 23.2.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2014-12-30T17:30:47.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5906" PostTypeId="2" ParentId="5900" CreationDate="2014-12-30T17:34:10.697" Score="4" Body="&lt;p&gt;The variable &lt;code&gt;org-tags-match-list-sublevels&lt;/code&gt; can do this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Non-nil means list also sublevels of headlines matching a search.&#xA;  This variable applies to tags/property searches, and also to stuck&#xA;  projects because this search is based on a tags match as well.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When set to the symbol `indented', sublevels are indented with&#xA;  leading dots.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;(setq org-tags-match-list-sublevels 'indented)&lt;/code&gt;, a number of dots equal to the level will be prepended to each agenda line to indicate its level.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-12-30T17:34:10.697" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5908" PostTypeId="1" CreationDate="2014-12-30T19:21:11.457" Score="10" ViewCount="751" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I stop underlining through the left &quot;margin&quot; in links that extend over more than one line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The face &lt;code&gt;org-link&lt;/code&gt; inherits from the face &lt;code&gt;link&lt;/code&gt;, which has the underline attribute set to &lt;code&gt;t&lt;/code&gt; (or at least it does by default).  Ordinarily, that's all well and good.  It gets ugly, however, if the description of the link is sufficiently long that it wraps onto more than one line, as in the following screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/N0ZJD.jpg&quot; alt=&quot;org-mode links&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The screenshot shows the underlining extending from the left margin all the way to indentation.  That's a pretty ugly visual tick.  Is there any way to keep underlining for links, and yet &lt;em&gt;not&lt;/em&gt; have the underlining extend from the margin in this way?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2014-12-30T22:33:34.607" Title="Underlining in org-mode links with multiline descriptions?" Tags="|org-mode|faces|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5909" PostTypeId="2" ParentId="2999" CreationDate="2014-12-30T21:09:40.227" Score="17" Body="&lt;p&gt;To startup Emacs maximised, add to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Start maximised (cross-platf)&#xA;(add-hook 'window-setup-hook 'toggle-frame-maximized t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In case you want to go full screen or, as they say now, &lt;em&gt;distraction free&lt;/em&gt; mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Start fullscreen (cross-platf)&#xA;(add-hook 'window-setup-hook 'toggle-frame-fullscreen t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: &lt;em&gt;This works in Windows too.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="306" LastEditDate="2014-12-31T11:45:17.833" LastActivityDate="2014-12-31T11:45:17.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5910" PostTypeId="2" ParentId="5901" CreationDate="2014-12-30T21:28:50.277" Score="0" Body="&lt;p&gt;The hacky solution is two parts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, add this somewhere that'll be evaluated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list display-buffer-alist&#xA;    (&quot;.w3m.*&quot; (display-buffer-in-previous-window)&#xA;              (inhibit-same-window . t)&#xA;              (reusable-windows . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Second, make sure that no &lt;code&gt;*w3m&amp;lt;#&amp;gt;*&lt;/code&gt; buffers have been seen in your current frame.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(frame-parameters (selected-frame))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...if you see a w3m buffer in &lt;code&gt;buffer-list&lt;/code&gt;, you will need to open a new frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as you never use your twittering-mode frame to visit a w3m buffer, &lt;code&gt;C-m&lt;/code&gt; on a link will always load in a separate frame.&lt;/p&gt;&#xA;" OwnerUserId="4049" LastActivityDate="2014-12-30T21:28:50.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5912" PostTypeId="1" AcceptedAnswerId="5916" CreationDate="2014-12-30T21:55:46.140" Score="0" ViewCount="1292" Body="&lt;p&gt;I have a non-interactive function &lt;code&gt;F&lt;/code&gt; to do post processing after each command. &lt;code&gt;F&lt;/code&gt; is buffer locally hooked to &lt;code&gt;post-command-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever &lt;code&gt;F&lt;/code&gt; is hooked the prefix argument is eaten and the next command does not get it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I preserve the prefix argument when hooking a function to &lt;code&gt;post-command-hook&lt;/code&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: There is no issue with the prefix argument and the function &lt;code&gt;F&lt;/code&gt; being hooked as the selected answer shows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My issue was that the function (let's call it &lt;code&gt;A&lt;/code&gt;) that did not worked properly could be either called directly (which had a working behavior) &lt;em&gt;or&lt;/em&gt; called from a &lt;code&gt;push-button&lt;/code&gt; (in this case the prefix argument was not passed to &lt;code&gt;A&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2014-12-31T03:08:02.750" LastActivityDate="2014-12-31T03:08:02.750" Title="post-command-hook and prefix argument" Tags="|hooks|prefix-argument|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="5913" PostTypeId="2" ParentId="5908" CreationDate="2014-12-30T22:33:34.607" Score="3" Body="&lt;p&gt;I've messed around a bit with &lt;code&gt;org-activate-bracket-links&lt;/code&gt;.  I'm not&#xA;really an expert in font-locking, so I only managed to make the &lt;code&gt;&quot;^ +&quot;&lt;/code&gt;&#xA;part of the link invisible:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-activate-bracket-links (limit)&#xA;  &quot;Add text properties for bracketed links.&quot;&#xA;  (if (and (re-search-forward org-bracket-link-regexp limit t)&#xA;           (not (org-in-src-block-p)))&#xA;      (let* ((hl (org-match-string-no-properties 1))&#xA;             (help (concat &quot;LINK: &quot; (save-match-data (org-link-unescape hl))))&#xA;             (ip (org-maybe-intangible&#xA;                  (list 'invisible 'org-link&#xA;                        'keymap org-mouse-map 'mouse-face 'highlight&#xA;                        'font-lock-multiline t 'help-echo help&#xA;                        'htmlize-link `(:uri ,hl))))&#xA;             (vp (list 'keymap org-mouse-map 'mouse-face 'highlight&#xA;                       'font-lock-multiline t 'help-echo help&#xA;                       'htmlize-link `(:uri ,hl))))&#xA;        ;; We need to remove the invisible property here.  Table narrowing&#xA;        ;; may have made some of this invisible.&#xA;        (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0))&#xA;        (remove-text-properties (match-beginning 0) (match-end 0)&#xA;                                '(invisible nil))&#xA;        (if (match-end 3)&#xA;            (progn&#xA;              (add-text-properties (match-beginning 0) (match-beginning 3) ip)&#xA;              (org-rear-nonsticky-at (match-beginning 3))&#xA;              (add-text-properties (match-beginning 3) (match-end 3) vp)&#xA;              (org-rear-nonsticky-at (match-end 3))&#xA;              (add-text-properties (match-end 3) (match-end 0) ip)&#xA;              (org-rear-nonsticky-at (match-end 0))&#xA;              (let ((b3 (match-beginning 3))&#xA;                    (e3 (match-end 3)))&#xA;                (save-excursion&#xA;                  (save-match-data&#xA;                    (goto-char b3)&#xA;                    (while (re-search-forward &quot;\\(?:^ +\\| +$\\)&quot; e3 t)&#xA;                      (org-rear-nonsticky-at (match-beginning 0))&#xA;                      (add-text-properties (match-beginning 0)&#xA;                                           (match-end 0) ip)&#xA;                      (org-rear-nonsticky-at (match-end 0)))))))&#xA;          (add-text-properties (match-beginning 0) (match-beginning 1) ip)&#xA;          (org-rear-nonsticky-at (match-beginning 1))&#xA;          (add-text-properties (match-beginning 1) (match-end 1) vp)&#xA;          (org-rear-nonsticky-at (match-end 1))&#xA;          (add-text-properties (match-end 1) (match-end 0) ip)&#xA;          (org-rear-nonsticky-at (match-end 0)))&#xA;        t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2014-12-30T22:33:34.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5914" PostTypeId="1" CreationDate="2014-12-30T22:59:37.617" Score="37" ViewCount="8189" Body="&lt;p&gt;One feature that Xcode has which I think is pretty neat is a &quot;Comparison&quot; mode, which continually shows differences between the current buffer and the most recent commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/81GUa.png&quot; alt=&quot;Comparison mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything like this for Emacs?  I don't really care about the simultaneous side-by-side views.  Just highlighting the background of any lines that were changed would be a great help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can always do &lt;code&gt;C-x v =&lt;/code&gt;, but it's a static view of one point in time, and only shows the diffs.  I want to see my entire file, editable, with the diffs highlighted.&lt;/p&gt;&#xA;" OwnerUserId="4051" LastActivityDate="2015-09-30T01:36:39.150" Title="Is there an Emacs mode which highlights differences from the committed version?" Tags="|minor-mode|version-control|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5915" PostTypeId="1" AcceptedAnswerId="5927" CreationDate="2014-12-30T23:31:32.937" Score="2" ViewCount="93" Body="&lt;p&gt;&lt;sup&gt;This requires the &lt;code&gt;let-alist&lt;/code&gt; package available on the GNU ELPA (built-in in 25.1).&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following macro:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro sx-assoc-let (alist &amp;amp;rest body)&#xA;  (declare (indent 1) (debug t))&#xA;  (require 'let-alist)&#xA;  `(progn&#xA;     (sx--ensure-site ,alist)&#xA;     ,(macroexpand&#xA;       `(let-alist ,alist ,@body))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason, the two forms don't evaluate as &lt;code&gt;equal&lt;/code&gt;, but when I evaluate them separately they do indeed 'show' the same thing.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(equal `(progn (sx--ensure-site data)&#xA;         ,(macroexpand&#xA;           '(let-alist data .test)))&#xA;        (macroexpand&#xA;         '(sx-assoc-let data .test)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is going on here?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2014-12-31T00:02:02.970" LastActivityDate="2014-12-31T13:03:33.200" Title="Why aren't these two otherwise identical forms `equal`?" Tags="|elisp-macros|data-structures|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5916" PostTypeId="2" ParentId="5912" CreationDate="2014-12-31T00:10:44.893" Score="0" Body="&lt;p&gt;&lt;code&gt;test-fn&lt;/code&gt; is run first, at which time the variable &lt;code&gt;my-universal-arg&lt;/code&gt; is set (if there was a universal argument called before pressing the &lt;code&gt;f5&lt;/code&gt; key).  Then, the &lt;code&gt;post-command-hook&lt;/code&gt; gets triggered and it picks up the variable &lt;code&gt;my-universal-arg&lt;/code&gt; (if that variable was set by calling a universal argument before pressing the &lt;code&gt;f5&lt;/code&gt;key), and then the message plays displaying the argument and the variable &lt;code&gt;my-universal-arg&lt;/code&gt; is then set back to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;:  If the variable &lt;code&gt;my-universal-arg&lt;/code&gt; is made to be buffer-local, then the appropriate functions will need to either be occurring in the target buffer or something like &lt;code&gt;with-current-buffer . . .&lt;/code&gt; would need to be used to pick up the variable bound to the corresponding buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-universal-arg nil)&#xA;&#xA;(defun test-fn (arg)&#xA;(interactive &quot;P&quot;)&#xA;  (if arg&#xA;    (setq my-universal-arg arg)&#xA;    (message &quot;No `arg` was specified.&quot;)))&#xA;&#xA;(define-key global-map [f5] 'test-fn)&#xA;&#xA;(defun post-command-hook-fn ()&#xA;  (when my-universal-arg&#xA;    (message &quot;This is `my-universal-arg`:  %s&quot; my-universal-arg)&#xA;    (setq my-universal-arg nil)))&#xA;&#xA;(add-hook 'post-command-hook 'post-command-hook-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2014-12-31T00:16:01.003" LastActivityDate="2014-12-31T00:16:01.003" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5917" PostTypeId="2" ParentId="5914" CreationDate="2014-12-31T01:20:16.230" Score="11" Body="&lt;p&gt;You don't specify what version control system you're using, but if it's git, ou can use &lt;a href=&quot;https://github.com/syohex/emacs-git-gutter&quot;&gt;git-gutter&lt;/a&gt; to put an indicator in the margins when a line has been added, deleted or modified.  It's available in MELPA via &lt;code&gt;M-x package-install git-gutter&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2014-12-31T01:20:16.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5918" PostTypeId="1" CreationDate="2014-12-31T01:31:32.757" Score="3" ViewCount="1501" Body="&lt;p&gt;I would like to create a template called &quot;my-article&quot;, with specified packages and settings to be exported to latex from org-mode. How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: the instructions for org-mode&amp;lt;8.0 does not work as in here &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-export.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/org-latex-export.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="4052" LastActivityDate="2014-12-31T01:31:32.757" Title="Template for latex export in org-mode?" Tags="|org-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5919" PostTypeId="2" ParentId="5914" CreationDate="2014-12-31T02:30:20.353" Score="33" Body="&lt;p&gt;Dmitry Gutov's &lt;a href=&quot;https://github.com/dgutov/diff-hl&quot;&gt;diff-hl&lt;/a&gt; library provides &lt;code&gt;diff-hl-mode&lt;/code&gt;, which gives you the fringe highlighting shown in the top window in the following screenshot (with the actual diff displayed in the bottom window for comparison):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2CAtl.png&quot; alt=&quot;diff-hl screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It uses the generic &lt;code&gt;vc&lt;/code&gt; functionality in Emacs in order to be VCS-agnostic. The readme says &quot;Tested with Git, Mercurial, Bazaar and SVN. May work with other VC backends, too.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;diff-hl-margin-mode&lt;/code&gt; can be employed if you're using terminal Emacs rather than GUI Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;diff-hl&lt;/code&gt; only highlights the differences between the &lt;em&gt;saved&lt;/em&gt; file and the repository; but &lt;code&gt;diff-hl-flydiff-mode&lt;/code&gt; enables un-saved differences to be highlighted as well, so that you can see the changes while you edit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note the built-in (to standard Emacs) &lt;code&gt;highlight-changes-mode&lt;/code&gt;. That doesn't really tackle your problem out-of-the-box, but the &lt;code&gt;highlight-compare-*&lt;/code&gt; functions might facilitate a solution.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-30T01:36:39.150" LastActivityDate="2015-09-30T01:36:39.150" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5920" PostTypeId="2" ParentId="5914" CreationDate="2014-12-31T03:49:00.680" Score="10" Body="&lt;p&gt;You should check out &lt;a href=&quot;http://www.emacswiki.org/emacs/EdiffMode&quot; rel=&quot;noreferrer&quot;&gt;Ediff&lt;/a&gt;.  It can both display diffs and act as a (3-way) merge tool.  It lets you easily revert changes, and also highlights refined differences to show you only the parts of each hunk that actually changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bV203.png&quot; alt=&quot;screenshot of ediff&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ediff-revision&lt;/code&gt; will let you easily compare against the most recent commit, or any previous commits.&lt;/p&gt;&#xA;" OwnerUserId="49" LastEditorUserId="-1" LastEditDate="2015-05-23T15:06:53.743" LastActivityDate="2015-05-23T15:06:53.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5921" PostTypeId="1" CreationDate="2014-12-31T04:14:47.527" Score="7" ViewCount="235" Body="&lt;p&gt;When I open &lt;code&gt;.iso&lt;/code&gt; file in &lt;code&gt;dired&lt;/code&gt;, I have to mount it a temp folder&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mount -t iso9660 foo.iso temp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then navigate to that folder, read the files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to open &lt;code&gt;.iso&lt;/code&gt; file in dired directly? (possibly dired create a temp folder?)&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2015-01-04T16:44:33.363" Title="Is it possible to open .iso file in emacs dired?" Tags="|dired|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5922" PostTypeId="2" ParentId="3746" CreationDate="2014-12-31T04:47:47.723" Score="1" Body="&lt;p&gt;If you like how refill-mode behaves (I don't :p) but not &lt;em&gt;when&lt;/em&gt; it behaves, it should be relatively easy to fix by inhibiting it whenever you're not in the right conditions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar plop/refill-enabler-function nil)&#xA;&#xA;(defun plop/region-in-comment (beg end)&#xA;  ;; should really be comment-only-p, but that seems really broken for me&#xA;  (not&#xA;   (loop for c from beg to end&#xA;      if (not (eq 'font-lock-comment-face (get-char-property c 'face)))&#xA;      return t)))&#xA;&#xA;(defun plop/refill-after-change-function (beg end len)&#xA;  (unless undo-in-progress&#xA;    (when (and plop/refill-enabler-function&#xA;               (funcall plop/refill-enabler-function beg end))&#xA;      (setq refill-doit end))))&#xA;&#xA;(defun plop/install-refill-hack ()&#xA;  (if refill-mode&#xA;      (progn&#xA;        (add-hook 'after-change-functions 'plop/refill-after-change-function nil t)&#xA;        (remove-hook 'after-change-functions 'refill-after-change-function t))&#xA;    (progn&#xA;      (remove-hook 'after-change-functions 'plop/refill-after-change-function t))))&#xA;&#xA;(defun plop/refill-hook ()&#xA;  (set (make-local-variable 'plop/refill-enabler-function)&#xA;       #'plop/region-in-comment)&#xA;  (add-hook 'refill-mode-hook 'plop/install-refill-hack t t)&#xA;  (refill-mode))&#xA;&#xA;(add-hook 'some-hook 'plop/refill-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically it removes the function that triggers the refill from &lt;code&gt;after-change-functions&lt;/code&gt; and replaces it with one that will in addition check that we're in a comment before doing exactly the same thing.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2014-12-31T04:47:47.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5923" PostTypeId="1" CreationDate="2014-12-31T09:45:13.563" Score="5" ViewCount="4778" Body="&lt;p&gt;I use org-capture a lot, it's a terrific feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, sometimes i'd like to choose the target of the note during or at the end of the process, not at the beginning from the template.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process I imagine (below I use the exact terms of the variable org-capture-template, in &lt;em&gt;italic&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;C-c c&lt;/li&gt;&#xA;&lt;li&gt;choosing the &lt;em&gt;entry&lt;/em&gt; for it's &lt;em&gt;template&lt;/em&gt;, not caring for it's &lt;em&gt;target&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;typing my note&lt;/li&gt;&#xA;&lt;li&gt;C-c C-c refiles my note at the place I want&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So far, my &lt;em&gt;org-capture-template&lt;/em&gt; is :&#xA;&lt;code&gt;((&quot;t&quot; &quot;Test&quot; entry (file+headline &quot;my/path/to/notes.org&quot; &quot;Entries to be refiled&quot;) (file &quot;my/path/to/my-org-capture-template.org&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with org-capture-template.org :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* %?&#xA;:PROPERTIES:&#xA;:TARGET-FILE:&#xA;:TARGET-HEADLINE:&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want is C-c C-c running a function inferring the target, file and headline, from the value of TARGET-FILE and TARGET-HEADLINE, and refiling my note accordingly.&lt;/p&gt;&#xA;" OwnerUserId="863" LastEditorUserId="253" LastEditDate="2014-12-31T17:28:23.703" LastActivityDate="2022-12-06T19:39:57.627" Title="org-capture : how to choose the target file at the end of the process?" Tags="|org-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5925" PostTypeId="2" ParentId="2285" CreationDate="2014-12-31T10:51:48.840" Score="3" Body="&lt;h1&gt;New answer (implemented in Org 8.3)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can do this with the &lt;code&gt;local&lt;/code&gt; paramater to the &lt;code&gt;#+TOC&lt;/code&gt; keyword.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TOC: headlines 1 local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(example from the manual)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the details in  Nicolas Goaziou's commit &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=b07e2f6ff1feddde83506b7fdb370bfe8e0a5337&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Old answer:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Following the tips you got the &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.orgmode/91819&quot; rel=&quot;nofollow noreferrer&quot;&gt;last time you asked&lt;/a&gt; this question, the following code emerges that &lt;strong&gt;only works with LaTeX&lt;/strong&gt;.  For other backends you probably better off waiting for Nicolas' patch.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The code&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rasmus/get-org-headline-string-element  (headline backend info)&#xA;  &quot;Return the org element representation of an element.&quot;&#xA;  (let ((prop-point (next-property-change 0 headline)))&#xA;(if prop-point (plist-get (text-properties-at prop-point headline) :parent))))&#xA;&#xA;(defcustom rasmus/org-latex-subtoc-command&#xA;  (cons&#xA;   &quot;\\startcontents[level-%s]\n\\printcontents[level-%s]{}{0}{\\setcounter{tocdepth}{%s}}&quot;&#xA;   &quot;\\stopcontents[level-%s]&quot;)&#xA;  &quot;Command to wrap HEADLINE in when generating a subtoc&quot;)&#xA;&#xA;(defun rasmus/org-latex-subtoc (headline backend info)&#xA;  &quot;Insert a subtoc on headings which have non-nil property subtoc.&quot;&#xA;  (when (org-export-derived-backend-p backend 'latex)&#xA;(let ((elm (rasmus/get-org-headline-string-element headline backend info)))&#xA;  (when (and elm (org-element-property :SUBTOC elm))&#xA;    (let ((level (1+ (org-element-property :level elm)))&#xA;      (id (org-export-get-headline-id elm info)))&#xA;      (with-temp-buffer&#xA;    (insert headline)&#xA;    (goto-char (point-min))&#xA;    (forward-line (if (&amp;gt;= level (plist-get info :headline-levels)) 1 2))&#xA;    (insert (format (car rasmus/org-latex-subtoc-command) id id level) &quot;\n&quot;)&#xA;    (goto-char (point-max))&#xA;    (insert (format (cdr rasmus/org-latex-subtoc-command) id) &quot;\n&quot;)&#xA;    (buffer-string)))))))&#xA;&#xA;(add-to-list 'org-export-filter-headline-functions 'rasmus/org-latex-subtoc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can optimize the code as you see fit.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Example&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((cont &quot;# In reality you must load titletoc before hyperref.\n# use another filter for that or add it to `org-latex-packages-alist'\n#+LATEX_HEADER_EXTRA: \\usepackage{titletoc}\n\n#+OPTIONS: toc:nil\n\n#+TOC: headlines 1\n* Business operations\n  :PROPERTIES:\n  :subtoc:   t\n  :END:\n\n** Services \n   :PROPERTIES:\n   :subtoc:   t\n   :END:\n\n*** Statements of work\n*** Changes to statements of work\n*** No obligation to agree to statement of work\n\n** Sales of goods\n* Another sec\n&quot;))&#xA;  (with-temp-buffer (insert cont) (require 'ox-latex) (org-latex-export-as-latex nil nil nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Output of example&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\setcounter{tocdepth}{1}&#xA;\tableofcontents&#xA;\section{Business operations}&#xA;\label{sec-1}&#xA;\startcontents[level-sec-1]&#xA;\printcontents[level-sec-1]{}{0}{\setcounter{tocdepth}{2}}&#xA;&#xA;\subsection{Services}&#xA;\startcontents[level-sec-1-1]&#xA;\printcontents[level-sec-1-1]{}{0}{\setcounter{tocdepth}{3}}&#xA;\label{sec-1-1}&#xA;&#xA;\subsubsection{Statements of work}&#xA;\label{sec-1-1-1}&#xA;\subsubsection{Changes to statements of work}&#xA;\label{sec-1-1-2}&#xA;\subsubsection{No obligation to agree to statement of work}&#xA;\label{sec-1-1-3}&#xA;&#xA;\stopcontents[level-sec-1-1]&#xA;\subsection{Sales of goods}&#xA;\label{sec-1-2}&#xA;\stopcontents[level-sec-1]&#xA;\section{Another sec}&#xA;\label{sec-2}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Notes&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Do be aware of the note in the example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;In reality you must load titletoc before hyperref.  use another filter for that or add it to `org-latex-packages-alist'&lt;/code&gt;&#xA;For more info see &lt;a href=&quot;https://tex.stackexchange.com/questions/79547/weird-behavior-of-partial-toc-with-titletoc&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;rasmus/get-org-headline-string-element&lt;/code&gt; only works with headings that contains not only (E.g. it won't work on &lt;code&gt;* ~verb~&lt;/code&gt; or &lt;code&gt;* =code=&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-11-28T09:14:22.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5926" PostTypeId="1" AcceptedAnswerId="5928" CreationDate="2014-12-31T12:46:25.110" Score="12" ViewCount="422" Body="&lt;p&gt;The problem: I found it's tiredsome to move my eyeballs up and down from where my cursor is to the bottom echo area. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question: is it possible to make the echo area dynamically allocated close to my cursor, like tooltips? I searched for packages but not able to find one. I don't believe it's a new idea and someone must've done it.&lt;/p&gt;&#xA;" OwnerUserId="4058" LastActivityDate="2015-05-16T01:27:39.617" Title="Is it possible to make the echo area next to cursor?" Tags="|echo-area|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5927" PostTypeId="2" ParentId="5915" CreationDate="2014-12-31T13:03:33.200" Score="3" Body="&lt;p&gt;&lt;em&gt;It's not a bug, it's a feature.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h2&gt;Why it happens&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;let-alist&lt;/code&gt; takes its first argument (the alist) and stores it in an uninterned symbol (generated by &lt;code&gt;make-symbol&lt;/code&gt;). This is just a standard practice of macros to avoid evaluating arguments multiple times, because they need to be referenced multiple times.&lt;/p&gt;&#xA;&lt;p&gt;The side-effect of this is that no two expansions of &lt;code&gt;let-alist&lt;/code&gt; will ever be &lt;code&gt;equal&lt;/code&gt; (because each one contains a unique symbol), so your test fails.&lt;/p&gt;&#xA;&lt;h2&gt;How to avoid this&lt;/h2&gt;&#xA;&lt;p&gt;The way to fix this (which I use when testing &lt;code&gt;let-alist&lt;/code&gt; specifically) is to override &lt;code&gt;make-symbol&lt;/code&gt; in the tests:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(cl-letf (((symbol-function 'make-symbol) (lambda (x) 'alist-symbol)))&#xA;  (should ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This should ensure &lt;code&gt;make-symbol&lt;/code&gt; always returns the same thing.&lt;/p&gt;&#xA;&lt;h2&gt;However:&lt;/h2&gt;&#xA;&lt;p&gt;This is really a testament that you should test behavior, not implementation.&#xA;It doesn't matter what &lt;code&gt;sx-assoc-let&lt;/code&gt; expands to, as long as it returns the right values. You may want to get rid of that test entirely, in place of tests that just verify the return value of &lt;code&gt;.variables&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2014-12-31T13:03:33.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5928" PostTypeId="2" ParentId="5926" CreationDate="2014-12-31T14:08:38.920" Score="3" Body="&lt;p&gt;The echo area explicitly uses the minibuffer window, so unless that changes the answer is &quot;no, it's not possible&quot; (or at minimum not very practical).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to &lt;a href=&quot;https://stackoverflow.com/questions/10063410/is-it-possible-to-separate-minibuffer-and-echo-area-in-emacs&quot;&gt;https://stackoverflow.com/questions/10063410/is-it-possible-to-separate-minibuffer-and-echo-area-in-emacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2014-12-31T14:08:38.920" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5929" PostTypeId="1" CreationDate="2014-12-31T14:30:55.533" Score="11" ViewCount="1605" Body="&lt;p&gt;When I use &lt;code&gt;helm-find-files&lt;/code&gt; to search for a directory. I would like it to display exact matches and directories first in the list of candidates, followed by files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, searching for &quot;src&quot; gives the following results:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/lKtBU.png&quot; alt=&quot;helm-example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make &quot;src&quot; show up first, since it's an exact match and also a directory? Or, baring that, making hidden &quot;.&quot; files go to the end of the list (since it seems to be in alphabetical order?)&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2015-05-27T19:57:08.257" Title="How to sort file list in helm-find-files" Tags="|helm|helm-for-files|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="5930" PostTypeId="2" ParentId="5926" CreationDate="2014-12-31T15:35:46.510" Score="5" Body="&lt;p&gt;As @TuDo's comment indicates (and he can change it to an answer if he likes, in which case I'll remove this answer), you can at least use a standalone minibuffer frame, and you can position it where you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One advantage over the default setup is that you have only a single place to look, always, for output messages (echo area) and for input editing (minibuffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could even cause its position to change dynamically - for example, to be close to where the current input focus is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/OneOnOneEmacs&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;One On One Emacs&lt;/strong&gt;&lt;/a&gt; can help. Out of the box, it lets you decide where to put the minibuffer frame, but to reposition it dynamically you will need to do a little extra.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(EmacsWiki is currently down, but you can download &lt;code&gt;oneonone.el&lt;/code&gt; from MELPA also.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-16T01:27:39.617" LastActivityDate="2015-05-16T01:27:39.617" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5931" PostTypeId="2" ParentId="5923" CreationDate="2014-12-31T16:17:44.457" Score="7" Body="&lt;p&gt;There are several ways to choose where a captured entry will go.&lt;/p&gt;&#xA;&lt;p&gt;You can always use &lt;code&gt;org-refile&lt;/code&gt; (&lt;code&gt;C-c C-w&lt;/code&gt;) in the capture buffer to move the capture.  This will also finalize the capture.&lt;/p&gt;&#xA;&lt;p&gt;If you want to encode the target headline in the capture template, use &lt;code&gt;file+headline&lt;/code&gt; as the target, thusly:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(&amp;quot;t&amp;quot; &amp;quot;Todo&amp;quot; entry&#xA;  (file+headline &amp;quot;/path/to/file.org&amp;quot; &amp;quot;Target Headline&amp;quot;)&#xA;  &amp;quot;* TODO %?&amp;quot;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Another solution is to use &lt;code&gt;file+function&lt;/code&gt; as the target for your capture template.  First define a function that prompts for a headline and jumps to it.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-get-target-headline (&amp;amp;optional prompt)&#xA;  &amp;quot;Prompt for a location in an org file and jump to it.&#xA;&#xA;This is for promping for refile targets when doing captures.&amp;quot;&#xA;    (let* ((target (save-excursion&#xA;                     (org-refile-get-location prompt nil nil t)))&#xA;           (file (nth 1 target))&#xA;           (pos (nth 3 target))&#xA;           )&#xA;    (with-current-buffer (find-file-noselect file)&#xA;        (goto-char pos)&#xA;        (org-end-of-subtree)&#xA;        (org-return)&#xA;    )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then add a capture template using this function to get the target:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;            '(&amp;quot;t&amp;quot; &amp;quot;Todo&amp;quot; entry&#xA;              (file+function &amp;quot;/path/to/file.org&amp;quot; org-get-target-headline)&#xA;             &amp;quot;* TODO %?&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You will be prompted for the target before being dropped into the capture buffer.  This is most useful when the template has &lt;code&gt;:immediate-finish t&lt;/code&gt; and you never get a capture buffer to refile from.&lt;/p&gt;&#xA;&lt;p&gt;And that's not all! There are a number of other ways for a template to select it's target, see the manual for &lt;a href=&quot;http://orgmode.org/manual/Template-elements.html#Template-elements&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-capture-templates&lt;/a&gt; for a list of them.&#xA;The most general version is to use &lt;code&gt;function&lt;/code&gt; as the target, which lets you give an arbitrary function for both the target file and headline.&lt;/p&gt;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&lt;p&gt;As of &lt;code&gt;org-mode&lt;/code&gt; 9 the above function no longer works.  Instead use&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-get-target-headline (&amp;amp;optional targets prompt)&#xA;  &amp;quot;Prompt for a location in an org file and jump to it.&#xA;&#xA;This is for promping for refile targets when doing captures.&#xA;Targets are selected from `org-refile-targets'. If TARGETS is&#xA;given it temporarily overrides `org-refile-targets'. PROMPT will&#xA;replace the default prompt message.&#xA;&#xA;If CAPTURE-LOC is is given, capture to that location instead of&#xA;prompting.&amp;quot;&#xA;  (let ((org-refile-targets (or targets org-refile-targets))&#xA;        (prompt (or prompt &amp;quot;Capture Location&amp;quot;)))&#xA;      (org-refile t nil nil prompt)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;which does the same thing, but also allows you to restrict the set of possible targets.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="18986" LastEditDate="2022-12-06T19:39:57.627" LastActivityDate="2022-12-06T19:39:57.627" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="5932" PostTypeId="1" CreationDate="2014-12-31T17:37:58.723" Score="5" ViewCount="2043" Body="&lt;p&gt;I currently use emacs to write and compile LaTeX files using the key combo: &lt;code&gt;C-c C-f&lt;/code&gt;.  Now this is all well and good, but now I'm working on a much bigger project that is divided into many chapters.  My main file includes these chapters using &lt;code&gt;\include{chp1}&lt;/code&gt; for example, and so I have to go back to the main file to use &lt;code&gt;C-c C-f&lt;/code&gt; to compile everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's my question: When I am editing chp1.tex, is there any way to turn OFF the automatic recognition of LaTeX mode so that if I mistakenly hit &lt;code&gt;C-c C-f&lt;/code&gt;, it doesn't freak out and spam me with pages and pages of LaTeX error messages?  I'd like it to just tell me when I type &lt;code&gt;C-c C-f&lt;/code&gt; in chp1.tex, &quot;you stupid idiot, this is not the main file,&quot; rather than try to compile chp1 by itself.&lt;/p&gt;&#xA;" OwnerUserId="4063" LastEditorUserId="253" LastEditDate="2014-12-31T17:46:23.327" LastActivityDate="2022-01-06T20:20:37.637" Title="multiple files in LaTeX?" Tags="|latex|auctex|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5933" PostTypeId="2" ParentId="5719" CreationDate="2014-12-31T17:40:05.627" Score="2" Body="&lt;p&gt;Org headlines are simply lines starting with a &lt;code&gt;*&lt;/code&gt;. So you can cycle&#xA;through all of them and manually insert an &lt;code&gt;*&lt;/code&gt; on each one to get the&#xA;effect you want.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun endless/demote-everything (number beg end)&#xA;  &amp;quot;Add a NUMBER of * to all headlines between BEG and END.&#xA;Interactively, NUMBER is the prefix argument and BEG and END are&#xA;the region boundaries.&amp;quot;&#xA;  (interactive &amp;quot;p\nr&amp;quot;)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (save-match-data&#xA;        (widen)&#xA;        (narrow-to-region beg end)&#xA;        (goto-char (point-min))&#xA;        (let ((string (make-string number ?*)))&#xA;          (while (search-forward-regexp &amp;quot;^\\*&amp;quot; nil t)&#xA;            (insert string)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;At first you might be worried this would catch undesired edge cases, such as a &lt;code&gt;#+SRC_BLOCK&lt;/code&gt; where one of the lines starts with a &lt;code&gt;*&lt;/code&gt;. But &lt;code&gt;org-mode&lt;/code&gt; itself uses this method to identify headlines, so no org buffer should ever contain a &lt;code&gt;*&lt;/code&gt; as the first char of a line unless it's a headline.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="14825" LastEditDate="2020-07-16T20:50:50.340" LastActivityDate="2020-07-16T20:50:50.340" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="5934" PostTypeId="2" ParentId="5923" CreationDate="2014-12-31T17:44:38.423" Score="1" Body="&lt;p&gt;I'm not aware of any simple way to do what want here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To run something after your note has been captured, you could try using the &lt;code&gt;org-capture-after-finalize-hook&lt;/code&gt;. At that point you may be able to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;jump to the last captured note (&lt;code&gt;org-capture-goto-last-stored&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;parse the org element for your custom target information&lt;/li&gt;&#xA;&lt;li&gt;call &lt;code&gt;org-refile&lt;/code&gt; and pass a custom refile location (&lt;code&gt;RFLOC&lt;/code&gt;) based on what you've read from the note&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastActivityDate="2014-12-31T17:44:38.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5935" PostTypeId="1" AcceptedAnswerId="5936" CreationDate="2014-12-31T18:14:27.170" Score="6" ViewCount="2314" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Calling-Functions.html&quot;&gt;&lt;code&gt;apply-partially&lt;/code&gt;&lt;/a&gt; lets you create a new function by fixing the first &lt;code&gt;n&lt;/code&gt; arguments of an existing function. Is there any way to achieve unrestricted partial function application, i.e., the ability to fix any &lt;code&gt;n&lt;/code&gt; arguments of a function without the constraint that they be the first &lt;code&gt;n&lt;/code&gt;? An example from another language is Python's &lt;a href=&quot;https://docs.python.org/2/library/functools.html#&quot;&gt;&lt;code&gt;functools.partial&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-01-01T10:57:34.017" Title="Partial function application" Tags="|elisp|functions|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5936" PostTypeId="2" ParentId="5935" CreationDate="2014-12-31T19:38:26.550" Score="12" Body="&lt;p&gt;The idea of transforming functions into different functions with specialized arguments has been elaborated upon in &lt;a href=&quot;http://srfi.schemers.org/srfi-26/srfi-26.html&quot;&gt;SRFI 26&lt;/a&gt;.  There's an Emacs Lisp implementation of it in the very useful &lt;a href=&quot;https://github.com/magnars/dash.el&quot;&gt;dash.el&lt;/a&gt; library where it's available as &lt;a href=&quot;https://github.com/magnars/dash.el#-cut-rest-params&quot;&gt;-cut&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2014-12-31T19:38:26.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5937" PostTypeId="2" ParentId="5935" CreationDate="2014-12-31T20:01:08.930" Score="2" Body="&lt;p&gt;Here's something that I just wrote down:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foobar (a b c)&#xA;  (list a &quot;foo&quot; b &quot;bar&quot; c))&#xA;&#xA;(defun lame-partial (fun &amp;amp;rest plist)&#xA;  (let ((args (copy-seq&#xA;               (help-function-arglist fun t))))&#xA;    (dolist (k (cl-remove-if-not #'keywordp plist))&#xA;      (setq args (delq (intern (substring (symbol-name k) 1)) args)))&#xA;    `(lambda (,@args)&#xA;       (funcall&#xA;        ',fun&#xA;        ,@(mapcar&#xA;           (lambda (x)&#xA;             (or (plist-get plist (intern (format &quot;:%S&quot; x)))&#xA;                 x)) (help-function-arglist fun t))))))&#xA;&#xA;(fset 'foobar-partial-1 (lame-partial #'foobar :b 7 :c (+ 2 2)))&#xA;(fset 'foobar-partial-2 (lame-partial #'foobar :c &quot;derp&quot; :b 0))&#xA;&#xA;(mapcar #'foobar-partial-1 '(0 1 2))&#xA;;; =&amp;gt; ((0 &quot;foo&quot; 7 &quot;bar&quot; 4) (1 &quot;foo&quot; 7 &quot;bar&quot; 4) (2 &quot;foo&quot; 7 &quot;bar&quot; 4))&#xA;&#xA;(mapcar #'foobar-partial-2 '(0 1 2))&#xA;;; =&amp;gt;&#xA;;; ((0 &quot;foo&quot; 0 &quot;bar&quot; &quot;derp&quot;)&#xA;;;  (1 &quot;foo&quot; 0 &quot;bar&quot; &quot;derp&quot;)&#xA;;;  (2 &quot;foo&quot; 0 &quot;bar&quot; &quot;derp&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's probably lame, but the approach is different from &lt;code&gt;-cut&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-01-01T10:57:34.017" LastActivityDate="2015-01-01T10:57:34.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5938" PostTypeId="1" AcceptedAnswerId="5963" CreationDate="2014-12-31T20:16:02.020" Score="12" ViewCount="9361" Body="&lt;p&gt;I want &lt;code&gt;auto-complete&lt;/code&gt; (ac) to work when I am inside &lt;code&gt;AucTeX&lt;/code&gt; mode.&#xA;I get all packages from MELPA by package installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my relevant code in &lt;code&gt;init.el&lt;/code&gt; file:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(package-initialize)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)   &#xA;(global-auto-complete-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as you can see, although I am setting &lt;code&gt;ac&lt;/code&gt; globally it does not appear in &lt;code&gt;AucTeX&lt;/code&gt;. However, by following instructions in this &lt;a href=&quot;http://emacswiki.org/emacs/AutoCompleteSources&quot;&gt;emacswiki&lt;/a&gt;, &lt;code&gt;ac&lt;/code&gt; mode was displayed in status bar in &lt;code&gt;AucTeX&lt;/code&gt; but non-functioning, no auto-completion by typing characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;br&gt;&#xA;Emacs 24.4 under Windows 7 32bit and packages were updated.&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-01-01T14:58:27.033" LastActivityDate="2018-08-21T18:14:04.810" Title="How to make auto-complete work in AucTeX mode?" Tags="|latex|auctex|auto-complete-mode|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5939" PostTypeId="1" AcceptedAnswerId="5941" CreationDate="2014-12-31T22:18:58.797" Score="48" ViewCount="30204" Body="&lt;p&gt;I've recently upgraded emacs to version 24.4.1 and something has changed in the indentation of new lines. When I hit &lt;kbd&gt;enter&lt;/kbd&gt; I expect just &quot;bare&quot; new line character at point where cursor was present, in particular if I'm in the middle of the line, that line should be splitted and none character be deleted including spaces. Unfortunately this is not the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I put the cursor just after &lt;code&gt;a&lt;/code&gt; and hit &lt;kbd&gt;enter&lt;/kbd&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a&#xA;b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while it should be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a&#xA; b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I googled a bit and probably this is due to auto-indentation, how can I disable this? I'm talking about text or fundamental mode if that matters.&lt;/p&gt;&#xA;" OwnerUserId="871" LastActivityDate="2023-03-08T01:14:09.967" Title="How to disable auto-indentation of new lines?" Tags="|indentation|newlines|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5940" PostTypeId="1" AcceptedAnswerId="5947" CreationDate="2014-12-31T22:20:15.910" Score="4" ViewCount="635" Body="&lt;p&gt;&lt;strong&gt;Is it possible to customize Emacs so that whenever I save a file, Emacs also copies it to a specific folder?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This directory could be, for instance, &lt;code&gt;D:\my_backups&lt;/code&gt; or &lt;code&gt;C:\Users\username\Dropbox\my_backups&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The copy should have the same name as the original file (no appended &lt;code&gt;~&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;If the backup already exists, overwrite without asking.&lt;/li&gt;&#xA;&lt;li&gt;I want to backup the same version that is being saved, not a previous version.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="50" LastEditDate="2015-01-01T19:08:49.493" LastActivityDate="2015-01-05T18:15:52.983" Title="Backup saved buffers to Dropbox (or other specific directory)" Tags="|files|saving|backup|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5941" PostTypeId="2" ParentId="5939" CreationDate="2014-12-31T22:54:15.013" Score="60" Body="&lt;p&gt;Disable &lt;code&gt;electric-indent-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That works with any Emacs version. This annoyance or shiny-new-feature, depending on your point of view, was introduced as the default in Emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://stackoverflow.com/q/27718310/729907&quot;&gt;this&lt;/a&gt; similar post on StackOverflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(However, it sounds like you are saying the &lt;em&gt;reverse&lt;/em&gt;, and that you &lt;em&gt;want&lt;/em&gt; &lt;code&gt;RET&lt;/code&gt; to indent but are not getting that indentation. What has changed is that &lt;code&gt;RET&lt;/code&gt; (&quot;Enter&quot;) now indents automatically, and you need to hit &lt;code&gt;C-j&lt;/code&gt; to get just a newline with no indentation. They swapped &lt;code&gt;RET&lt;/code&gt; and &lt;code&gt;C-j&lt;/code&gt;, in effect. If you want &lt;code&gt;RET&lt;/code&gt; to indent, then the new default behavior should give you what you want. In any case, the mode is &lt;code&gt;electric-indent-mode&lt;/code&gt;: turn it on or off, as you like.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-08-24T20:26:35.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5942" PostTypeId="2" ParentId="5940" CreationDate="2014-12-31T23:11:20.277" Score="5" Body="&lt;p&gt;Emacs has a built-in backup mechanism, which is what makes all the &quot;~&quot; files Emacs likes to leave around anywhere.  You can tell Emacs to put all the backup files in a single directory with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist (list '(&quot;.&quot; . &quot;/path/to/backups&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;backup-directory-alist&lt;/code&gt; is a list of pairs &lt;code&gt;(PATTERN . PATH)&lt;/code&gt; where &lt;code&gt;PATTERN&lt;/code&gt; is a regexp matching the file name and &lt;code&gt;PATH&lt;/code&gt; is where the matching files will be backed up.  The &quot;.&quot; pattern matches everything, but you might want to use something for specific (like &quot;\.txt\'&quot; to for &quot;.txt&quot; files) unless you really want &lt;em&gt;every&lt;/em&gt; file you edit going into Dropbox&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default behavior is to preserve the original name and path of the file.  So &lt;code&gt;/path/to/file.txt&lt;/code&gt; is copied to &lt;code&gt;/path/to/backups/!path!to!file.txt~&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also might want to set &lt;code&gt;vc-make-backup-files&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; so that files under version control also get backed up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs 24.4 or later, the names of the backup file come from the function stored in &lt;code&gt;make-backup-file-name-function&lt;/code&gt;, which we can change to remove the &quot;~&quot;.  This function (which hasn't been tested) just returns whatever the default function does the a &quot;~&quot; stripped off of the end.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-backup-file--no-tilde (filename)&#xA;  (replace-regexp-in-string&#xA;   &quot;~$&quot; &quot;&quot;&#xA;   (make-backup-file-name--default-function filename)&#xA;   )&#xA;  )&#xA;&#xA;(setq make-backup-file-name-function #'make-backup-file--no-tilde)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In earlier Emacs, we can advise &lt;code&gt;make-backup-file-name&lt;/code&gt; to strip the &quot;~&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice make-backup-file-name (around make-file-name-no-tilde activate)&#xA;  (setq ad-return-value (replace-regexp-in-string &quot;~$&quot; &quot;&quot; ad-do-it))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This could be modified to remove the path as well, but then &lt;code&gt;/a/b/file.txt&lt;/code&gt; and &lt;code&gt;/c/d/file.txt&lt;/code&gt; would backup to the same file.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-01-01T01:26:06.667" LastActivityDate="2015-01-01T01:26:06.667" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5943" PostTypeId="1" AcceptedAnswerId="5958" CreationDate="2015-01-01T07:28:26.990" Score="1" ViewCount="996" Body="&lt;p&gt;I run &lt;code&gt;magit&lt;/code&gt; on Linux and it works very well. On Windows, it works almost the same except the push process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Git Bash would ask me to enter &lt;code&gt;passphrase&lt;/code&gt; to continue, while magit just hangs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set &lt;code&gt;ssh-agent&lt;/code&gt; to remember passphrase on git bash. But it has no effect on magit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to let magit remember passphrase?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;SSH&lt;/code&gt;, not &lt;code&gt;HTTPS&lt;/code&gt;. So the github credential helper won't work.&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="3872" LastEditDate="2015-01-02T00:20:18.193" LastActivityDate="2015-02-01T04:30:20.587" Title="How to set magit remember git passphrase on Windows?" Tags="|magit|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="5944" PostTypeId="1" AcceptedAnswerId="5946" CreationDate="2015-01-01T07:43:05.943" Score="12" ViewCount="11754" Body="&lt;p&gt;I've been looking for themes which are transparent, but I didn't find any.&#xA;Is there someone who uses a transparent theme?&lt;/p&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="50" LastEditDate="2015-01-01T18:54:48.050" LastActivityDate="2024-03-06T23:43:09.047" Title="Is there a transparent theme?" Tags="|frames|themes|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5945" PostTypeId="1" AcceptedAnswerId="7480" CreationDate="2015-01-01T08:33:29.413" Score="1" ViewCount="502" Body="&lt;p&gt;When I export a org file in latex and generate the pdf (recompiling after a modification in the org file), the pdf file loose the references to section and citation. Here is the line in my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-pdf-process &#xA;  '(&quot;latexmk -pdflatex='pdflatex -interaction nonstopmode' -bibtex -f -pdf %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have to manually delete the bbl file and compile again so that the pdf shows the right references. How to I do that automatically?&lt;/p&gt;&#xA;" OwnerUserId="4052" LastActivityDate="2015-01-17T20:14:33.037" Title="Export latex-pdf and loose references: how to fix?" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5946" PostTypeId="2" ParentId="5944" CreationDate="2015-01-01T09:07:54.237" Score="17" Body="&lt;p&gt;I found a solution, and no longer I need transparent theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; set transparency&#xA;(set-frame-parameter (selected-frame) 'alpha '(85 85))&#xA;(add-to-list 'default-frame-alist '(alpha 85 85))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="2305" LastEditDate="2015-01-01T13:46:06.187" LastActivityDate="2015-01-01T13:46:06.187" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5947" PostTypeId="2" ParentId="5940" CreationDate="2015-01-01T09:17:31.473" Score="4" Body="&lt;p&gt;Here is a very rudimentary example (tested on OSX, and may work on other Unix flavor systems).  It is possible to write an entire library surrounding this concept, and this example is certainly not meant to be an all inclusive solution -- it is just an idea put on paper so to speak:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar backup-repo (directory-file-name &quot;/private/tmp&quot;)&#xA;&quot;NOTE:  `directory-file-name` makes it so that the user may either omit, or&#xA;include the forward trailing slash at the end of the `backkup-repo` path.&quot;)&#xA;&#xA;(defun after-save-hook-fn ()&#xA;  (let* (&#xA;      (backup-repo-filename&#xA;        (when buffer-file-name (concat backup-repo buffer-file-name)))&#xA;      (dir (when backup-repo-filename (file-name-directory backup-repo-filename))) )&#xA;    (when buffer-file-name&#xA;      (when (not (file-exists-p dir))&#xA;         (make-directory dir t))&#xA;      (write-region (point-min) (point-max) backup-repo-filename))))&#xA;&#xA;(add-hook 'after-save-hook 'after-save-hook-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an example using Emacs on Windows XP:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; (January 5, 2015):  Added feature to optionally preserve the drive letter as a folder sandwiched between the &lt;code&gt;backup-repo&lt;/code&gt; and the basename of the file being saved -- the variable that controls that optional behavior is called &lt;code&gt;drive-letter-as-folder&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar backup-repo&#xA;  (file-name-as-directory &quot;c:/Documents and Settings/Administrator/Desktop/tmp&quot;)&#xA;  &quot;NOTE:  `file-name-as-directory` makes it so that the user may either omit, or&#xA;  include the forward trailing slash at the end of the `backup-repo` path.&quot;)&#xA;&#xA;(defvar drive-letter-as-folder t&#xA;&quot;Setting this variable to `t` will cause the function `after-save-hook-fn` to&#xA;create a folder with the driver letter immediately following the `backup-repo`&#xA;directory -- e.g., c:/Documents and Settings/Administrator/Desktop/tmp and drive&#xA;`e:` will become c:/Documents and Settings/Administrator/Desktop/tmp/e/.&quot;)&#xA;&#xA;(defun after-save-hook-fn ()&#xA;  (let* (&#xA;      (basename&#xA;        (when buffer-file-name (split-string buffer-file-name &quot;:/&quot;)))&#xA;      (base-filename&#xA;        (when buffer-file-name&#xA;          (cond&#xA;            ((null drive-letter-as-folder)&#xA;              (car (cdr basename)))&#xA;            (drive-letter-as-folder&#xA;              (concat (car basename) &quot;/&quot; (car (cdr basename)))))))&#xA;      (backup-repo-filename&#xA;        (when buffer-file-name (concat backup-repo base-filename))) &#xA;      (dir (when backup-repo-filename (file-name-directory backup-repo-filename))) )&#xA;    (when buffer-file-name&#xA;      (when (not (file-exists-p dir))&#xA;         (make-directory dir t))&#xA;      (copy-file buffer-file-name backup-repo-filename t))))&#xA;&#xA;(add-hook 'after-save-hook 'after-save-hook-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;write-region&lt;/code&gt; has additional arguments that can be used -- here is a copy / paste of the doc-string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;write-region is an interactive built-in function in `C source code'.&#xA;&#xA;(write-region START END FILENAME &amp;amp;optional APPEND VISIT LOCKNAME MUSTBENEW)&#xA;&#xA;Write current region into specified file.&#xA;When called from a program, requires three arguments:&#xA;START, END and FILENAME.  START and END are normally buffer positions&#xA;specifying the part of the buffer to write.&#xA;If START is nil, that means to use the entire buffer contents.&#xA;If START is a string, then output that string to the file&#xA;instead of any buffer contents; END is ignored.&#xA;&#xA;Optional fourth argument APPEND if non-nil means&#xA;  append to existing file contents (if any).  If it is a number,&#xA;  seek to that offset in the file before writing.&#xA;Optional fifth argument VISIT, if t or a string, means&#xA;  set the last-save-file-modtime of buffer to this file's modtime&#xA;  and mark buffer not modified.&#xA;If VISIT is a string, it is a second file name;&#xA;  the output goes to FILENAME, but the buffer is marked as visiting VISIT.&#xA;  VISIT is also the file name to lock and unlock for clash detection.&#xA;If VISIT is neither t nor nil nor a string,&#xA;  that means do not display the &quot;Wrote file&quot; message.&#xA;The optional sixth arg LOCKNAME, if non-nil, specifies the name to&#xA;  use for locking and unlocking, overriding FILENAME and VISIT.&#xA;The optional seventh arg MUSTBENEW, if non-nil, insists on a check&#xA;  for an existing file with the same name.  If MUSTBENEW is `excl',&#xA;  that means to get an error if the file already exists; never overwrite.&#xA;  If MUSTBENEW is neither nil nor `excl', that means ask for&#xA;  confirmation before overwriting, but do go ahead and overwrite the file&#xA;  if the user confirms.&#xA;&#xA;This does code conversion according to the value of&#xA;`coding-system-for-write', `buffer-file-coding-system', or&#xA;`file-coding-system-alist', and sets the variable&#xA;`last-coding-system-used' to the coding system actually used.&#xA;&#xA;This calls `write-region-annotate-functions' at the start, and&#xA;`write-region-post-annotation-function' at the end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;copy-file&lt;/code&gt; could also be used and there is an argument for overwriting without confirmation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;copy-file is an interactive built-in function in `C source code'.&#xA;&#xA;(copy-file FILE NEWNAME &amp;amp;optional OK-IF-ALREADY-EXISTS KEEP-TIME&#xA;PRESERVE-UID-GID PRESERVE-PERMISSIONS)&#xA;&#xA;Copy FILE to NEWNAME.  Both args must be strings.&#xA;If NEWNAME names a directory, copy FILE there.&#xA;&#xA;This function always sets the file modes of the output file to match&#xA;the input file.&#xA;&#xA;The optional third argument OK-IF-ALREADY-EXISTS specifies what to do&#xA;if file NEWNAME already exists.  If OK-IF-ALREADY-EXISTS is nil, we&#xA;signal a `file-already-exists' error without overwriting.  If&#xA;OK-IF-ALREADY-EXISTS is a number, we request confirmation from the user&#xA;about overwriting; this is what happens in interactive use with M-x.&#xA;Any other value for OK-IF-ALREADY-EXISTS means to overwrite the&#xA;existing file.&#xA;&#xA;Fourth arg KEEP-TIME non-nil means give the output file the same&#xA;last-modified time as the old one.  (This works on only some systems.)&#xA;&#xA;A prefix arg makes KEEP-TIME non-nil.&#xA;&#xA;If PRESERVE-UID-GID is non-nil, we try to transfer the&#xA;uid and gid of FILE to NEWNAME.&#xA;&#xA;If PRESERVE-PERMISSIONS is non-nil, copy permissions of FILE to NEWNAME;&#xA;this includes the file modes, along with ACL entries and SELinux&#xA;context if present.  Otherwise, if NEWNAME is created its file&#xA;permission bits are those of FILE, masked by the default file&#xA;permissions.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-01-05T18:15:52.983" LastActivityDate="2015-01-05T18:15:52.983" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5948" PostTypeId="1" AcceptedAnswerId="5949" CreationDate="2015-01-01T12:50:52.743" Score="0" ViewCount="257" Body="&lt;p&gt;I can't set fill-column in reStructuredText mode hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'rst-mode-hook&#xA;    (lambda()&#xA;      (setq auto-fill-mode 1)  &#xA;      (set-fill-column 60)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While the auto-fill-mode works, the default fill-column is not changed, is there anything wrong with the code?&lt;/p&gt;&#xA;" OwnerUserId="4067" LastActivityDate="2015-01-01T13:01:53.773" Title="Setting fill-column for reStructuredText mode" Tags="|hooks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5949" PostTypeId="2" ParentId="5948" CreationDate="2015-01-01T12:56:48.207" Score="1" Body="&lt;p&gt;Two things.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;auto-fill-mode&lt;/code&gt; is a function rather than a variable, so do &lt;em&gt;not&lt;/em&gt; try to &lt;code&gt;setq&lt;/code&gt; it.&lt;/li&gt;&#xA;&lt;li&gt;It's not immediately obvious why &lt;code&gt;set-fill-column&lt;/code&gt; isn't working, but instead, try &lt;code&gt;setq&lt;/code&gt;ing &lt;code&gt;fill-column&lt;/code&gt; rather than using &lt;code&gt;set-fill-column&lt;/code&gt;, which works for me.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-rst-hook ()&#xA;  (auto-fill-mode 1)&#xA;  (setq fill-column 60))&#xA;&#xA;(add-hook 'rst-mode-hook #'my-rst-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-01-01T13:01:53.773" LastActivityDate="2015-01-01T13:01:53.773" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5951" PostTypeId="1" CreationDate="2015-01-01T19:31:40.387" Score="2" ViewCount="269" Body="&lt;p&gt;Say I have two tests:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun func-one () nil)&#xA;(defun func-two () (and (func-one) t))&#xA;&#xA;(ert-deftest test-one ()&#xA;  &quot;Test basic functionality&quot;&#xA;  (should (func-one)))&#xA;&#xA;(ert-deftest test-two ()&#xA;  &quot;Test advanced functionality&quot;&#xA;  (should (func-two)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I run &lt;code&gt;test-two&lt;/code&gt; only if &lt;code&gt;test-one&lt;/code&gt; succeeds?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Or, perhaps,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun func-one () nil)&#xA;(defun func-two () (and (func-one) t))&#xA;&#xA;(ert-deftest test-all ()&#xA;  &quot;Test basic functionality&quot;&#xA;  (should (func-one))&#xA;  (should (func-two)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Testing &lt;code&gt;func-two&lt;/code&gt; only if &lt;code&gt;func-one&lt;/code&gt; passes, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or even&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun func-one () nil)&#xA;(defun func-two () (and (func-one) t))&#xA;(defun func-thr () (or  (func-one) t))&#xA;&#xA;(ert-deftest test-one ()&#xA;  &quot;Test basic functionality&quot;&#xA;  (should (func-one)))&#xA;&#xA;(ert-deftest test-two ()&#xA;  &quot;Test advanced functionality&quot;&#xA;  (should (func-two)))&#xA;&#xA;(ert-deftest test-thr ()&#xA;  &quot;Test advanced functionality&quot;&#xA;  (should (func-thr)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Testing&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;func-two&lt;/code&gt; only if &lt;code&gt;func-one&lt;/code&gt; passes&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;func-thr&lt;/code&gt; only if &lt;code&gt;func-one&lt;/code&gt; passes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but &lt;code&gt;func-two&lt;/code&gt; failing should not impede &lt;code&gt;func-thr&lt;/code&gt; from running.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-01-01T19:37:12.303" LastActivityDate="2015-01-01T22:53:29.150" Title="How can I skip a test if another test failed?" Tags="|testing|ert|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5953" PostTypeId="2" ParentId="5951" CreationDate="2015-01-01T20:17:50.823" Score="1" Body="&lt;p&gt;Maybe something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun func-one ()&#xA;  (message &quot;running: func-one&quot;)&#xA;  nil)&#xA;(defun func-two ()&#xA;  (message &quot;running: func-two&quot;)&#xA;  (and (func-one) t))&#xA;(defun func-thr ()&#xA;  (message &quot;running: func three&quot;)&#xA;  (or  (func-one) t))&#xA;&#xA;(require 'ert)&#xA;(ert-delete-all-tests)&#xA;(setq func-tests nil)&#xA;(ert-deftest test-one ()&#xA;  &quot;Test basic functionality&quot;&#xA;  (when (should (func-one))&#xA;    (push 'test-one func-tests)))&#xA;&#xA;(ert-deftest test-two ()&#xA;  &quot;Test advanced functionality&quot;&#xA;  (should&#xA;   (and (memq 'test-one func-tests)&#xA;        (func-two))))&#xA;&#xA;(ert-deftest test-thr ()&#xA;  &quot;Test advanced functionality&quot;&#xA;  (should&#xA;   (func-thr)))&#xA;&#xA;(ert t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just put everything into one buffer and call &lt;code&gt;eval-buffer&lt;/code&gt; to test&#xA;this.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-01T20:17:50.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5954" PostTypeId="1" CreationDate="2015-01-01T21:50:27.027" Score="4" ViewCount="124" Body="&lt;p&gt;I'm currently working on using the crouton &lt;a href=&quot;https://github.com/dnschneid/crouton/blob/master/targets/xiwi&quot; rel=&quot;nofollow&quot;&gt;xiwi&lt;/a&gt; X windows target to run an Emacs session on a Chromebook. I've done this by starting Emacs as the last entry in &lt;strong&gt;.xinitrc&lt;/strong&gt; making it effectively the window manager for the session. Despite having the frame configured to be fullsize it's not using the full width of the display (which can be resized dynamically).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there native support in Emacs for querying the host X session display size or do I need to resort to shell script calls to extract the data?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2015-03-04T16:56:11.177" LastActivityDate="2015-03-04T20:59:49.937" Title="What's the best API to use to interrogate the size of the underlying window system?" Tags="|frames|display|x11|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5955" PostTypeId="2" ParentId="5951" CreationDate="2015-01-01T22:53:29.150" Score="2" Body="&lt;p&gt;I have used something like this in vc-tests.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest vc-test-git00-create-repo ()&#xA;  &quot;Check `vc-create-repo' for the git backend.&quot;&#xA;  ...)&#xA;&#xA;(ert-deftest vc-test-git01-register ()&#xA;  &quot;Check `vc-register' and `vc-registered' for the git backend.&quot;&#xA;  (skip-unless&#xA;   (ert-test-passed-p&#xA;    (ert-test-most-recent-result&#xA;     (ert-get-test 'vc-test-git00-create-repo))))&#xA;&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-01-01T22:53:29.150" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="5956" PostTypeId="2" ParentId="5944" CreationDate="2015-01-01T23:14:24.743" Score="8" Body="&lt;p&gt;You can set &lt;a href=&quot;http://www.emacswiki.org/emacs/TransparentEmacs&quot; rel=&quot;noreferrer&quot;&gt;transparency&lt;/a&gt; within Emacs by setting &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Font-and-Color-Parameters.html&quot; rel=&quot;noreferrer&quot;&gt;'alpha&lt;/a&gt; frame parameter,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This parameter specifies the opacity of the frame, on graphical displays that support variable opacity. It should be an integer between 0 and 100, where 0 means completely transparent and 100 means completely opaque. It can also have a nil value, which tells Emacs not to set the frame opacity (leaving it to the window manager).&lt;/p&gt;&#xA;&lt;p&gt;To prevent the frame from disappearing completely from view, the variable frame-alpha-lower-limit defines a lower opacity limit. If the value of the frame parameter is less than the value of this variable, Emacs uses the latter. By default, frame-alpha-lower-limit is 20.&lt;/p&gt;&#xA;&lt;p&gt;The alpha frame parameter can also be a cons cell (‘active’ . ‘inactive’), where ‘active’ is the opacity of the frame when it is selected, and ‘inactive’ is the opacity when it is not selected.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;but &lt;strong&gt;more general&lt;/strong&gt; solution is to use &lt;em&gt;your&lt;/em&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Compositing_window_manager#List_of_compositing_window_managers&quot; rel=&quot;noreferrer&quot;&gt;compositor manager&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example with &lt;a href=&quot;https://github.com/chjj/compton&quot; rel=&quot;noreferrer&quot;&gt;Compton&lt;/a&gt; you can change Emacs’ (or any window) opacity with following change in Compton’s config (i.e. &lt;em&gt;~/.config/compton.conf&lt;/em&gt; file):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;opacity-rule = [ &amp;quot;90:class_g = 'Emacs'&amp;quot;, # 10% of transparency&#xA;                 &amp;quot;90:!focused &amp;amp;&amp;amp; class_g = 'Conkeror'&amp;quot;] # as a bonus&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Solution will vary between operating systems and windowing systems ergo I’m providing this answer only FWIW.&lt;/p&gt;&#xA;" OwnerUserId="220" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-01T23:14:24.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5957" PostTypeId="1" AcceptedAnswerId="29394" CreationDate="2015-01-01T23:52:44.833" Score="3" ViewCount="677" Body="&lt;p&gt;I tend to use often non-file buffers kinda like post-it-notes and it is way too easy to kill them inadvertently, as there is no confirmation to kill. Even if you enforce the habit of writing only  in file buffers (subject to confirmation), you might still inadvertently write in a non-file buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore,  I created a kill-hook to ask kill confirmation, but only for buffers that I created (setting global &lt;code&gt;buffer-offer-save&lt;/code&gt; would make Emacs unusable).  To identify &lt;em&gt;user buffers&lt;/em&gt;, I exploit the fact that the name of buffers created automatically starts with a star.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, given its prominence, I would like to use the &lt;code&gt;*scratch*&lt;/code&gt; buffer as a note taking buffer too.&#xA;In this case, to fit the Emacs naming convention, I need to rename it &lt;code&gt;scratch&lt;/code&gt; (or anyway something without the star).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see two possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I prevent its creation: in the kill hook I check if I am going to kill the last buffer and create my &lt;code&gt;scratch&lt;/code&gt;, to prevent the creation of Emacs' &lt;code&gt;*scratch*&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I look for a create create-scratch-buffer hook and rename the scratch here. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As for point 1, &lt;code&gt;(length (list-buffers))&lt;/code&gt; includes also so called non-interesting (hidden) buffers and  I would happily avoid to parse names with regexp on every hook call (to detect interesting buffers). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for point 2, how can I detect the scratch buffer creation? Perhaps with a mode hook, e.g. something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-change-major-mode-hook 'rename-scratch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My actual kill hook follows. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'kill-buffer-query-functions   'ask-before-killing-user-buffer)&#xA;(defun ask-before-killing-user-buffer ()&#xA;  &quot;If the current buffer is a user buffer, ask for saving before killing.&#xA;Here a user buffer is one not: associated to a file, belonging to a process or auto-created by Emacs. &#xA;The latter are considered such when starting with the usual `*'.&#xA;The proposed filename will not be accepted if any buffer is already visiting the file&quot;&#xA;  (interactive)&#xA;  (let* (save-name visited-by exit-while-p&#xA;           (ask &quot;Save file as: &quot;)&#xA;           (buffer (current-buffer))    &#xA;           (buffer-name (buffer-name))&#xA;           (user-buff-p (if (or (string-match  &quot;^ \\|\\*&quot; buffer-name)&#xA;                    (get-buffer-process buffer)&#xA;                    (buffer-file-name)) nil t)))&#xA;&#xA;    ;; Ask to save modified buffer&#xA;    (if (and user-buff-p (buffer-modified-p))&#xA;    (if (y-or-n-p (format &quot;`%s' was modified; save it? &quot; buffer-name))&#xA;        (progn&#xA;          ;; accept only non visited file names&#xA;          (setq default-directory DEFAULT-SAVE-DIR)&#xA;          (while (not exit-while-p)&#xA;        (setq save-name (file-truename (read-file-name ask nil nil nil buffer-name)))&#xA;        (setq visited-by (find-buffer-visiting save-name))&#xA;        (if visited-by&#xA;            (setq ask (format &quot;`%s' is being visited by buffer `%s'.\nPlease choose another name: &quot;&#xA;                      save-name (buffer-name visited-by)))                 &#xA;          (setq exit-while-p t)))&#xA;          (write-file save-name t))))&#xA;&#xA;    t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;UPDATE&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Try to answer to your comments, clarifiying  what I am willing to achieve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a shortcut creating buffers named &lt;code&gt;scratch1&lt;/code&gt;, &lt;code&gt;scratch2&lt;/code&gt;, etc to readily  copy snippets from web pages or from ebooks, to type a nearby task, the draft of an email, etc. Normally these are &lt;em&gt;ephemeral buffers&lt;/em&gt; never translating into files, &lt;em&gt;they  live  until the text snippets  are  copied in actual documents&lt;/em&gt; (but occasionally the buffer is edited and saved).   Important original material gets immediately the status of file-buffer (with  the related backup facilities); it is anyway unpleasant to accidentally kill my scratches, despite I can recover them going on the source web page, ebook etc. Just like it is not crucial to lose your remember-the-milk notes, but ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently using a mode hook seems to me a solution without to much overhead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rename-scratch-buffer ()&#xA;  (if (and (get-buffer &quot;*scratch*&quot;) (not (get-buffer &quot;scratch&quot;)))      &#xA;      (with-current-buffer &quot;*scratch*&quot;  (rename-buffer &quot;scratch&quot;))))&#xA;(add-hook 'after-change-major-mode-hook 'rename-scratch-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-12-18T21:00:47.803" LastActivityDate="2016-12-18T21:06:58.077" Title="Rename scratch buffer and ask confirmation to kill non-file buffers created by user" Tags="|hooks|kill-buffer|scratch-buffer|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="5958" PostTypeId="2" ParentId="5943" CreationDate="2015-01-02T03:42:00.413" Score="0" Body="&lt;p&gt;Problem solved by:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Remove Git-Bash.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Install '&lt;a href=&quot;https://windows.github.com/&quot; rel=&quot;nofollow&quot;&gt;GitHub&lt;/a&gt;'. GitHub will add two shortcuts on desktop:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;strong&gt;GitHub&lt;/strong&gt;: for GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;strong&gt;Git Shell&lt;/strong&gt;: An integretated PowerShell with git and other commands.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Check 'Git Shell' destination. On my system, it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C:\Users\Nick\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add this dir to &lt;code&gt;$Path&lt;/code&gt;. Voila, &lt;code&gt;Magit&lt;/code&gt; in Emacs could push without any problem.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Other resources&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://help.github.com/articles/generating-ssh-keys/&quot; rel=&quot;nofollow&quot;&gt;Generating SSH&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://help.github.com/articles/working-with-ssh-key-passphrases/&quot; rel=&quot;nofollow&quot;&gt;Working with SSH key passphrases&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2015-01-02T03:42:00.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5959" PostTypeId="1" AcceptedAnswerId="6003" CreationDate="2015-01-02T06:28:23.293" Score="10" ViewCount="2456" Body="&lt;p&gt;Is it possible to send the output from a process-filter to the &lt;code&gt;*Messages*&lt;/code&gt; buffer and suppress that message output from appearing in the echo area, such that I am able to simultaneously use interactive commands without having the &lt;code&gt;minibuffer-prompt&lt;/code&gt; being erased by the ongoing subpress filter output?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rsync-process-filter (proc string)&#xA;  (when (not (or&#xA;      (string-match &quot;files...\r&quot; string)&#xA;      (string-match &quot;files to consider\n&quot; string)))&#xA;    (message &quot;%s&quot; string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; (January 3, 2015):  The following is a link to a similar question, however, I have not yet been able to make it work with a process string where the exact string is unkown -- the title of the thread is: &lt;em&gt;Emacs - Disable Some Minibuffer Messages&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages&quot;&gt;https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-20T10:04:44.717" LastActivityDate="2015-01-05T06:55:30.423" Title="Send process output to *Messages* buffer, but bypass the echo area" Tags="|minibuffer|process|echo-area|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="5961" PostTypeId="2" ParentId="5957" CreationDate="2015-01-02T09:44:32.037" Score="2" Body="&lt;p&gt;I guess much of this is a matter of taste and usage patterns. I tend to use something inbetween your solution and @Drew's usage (according to the comments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the gist of it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I want &quot;throwaway&quot; buffers to be quickly available, without having to think ahead of time where to save them;&lt;/li&gt;&#xA;&lt;li&gt;I want them to be file buffers in order for Emacs to warn me if I accidentally kill them;&lt;/li&gt;&#xA;&lt;li&gt;I don't want to accidentally save them due to my &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; OCD.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And here is the way I implement it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;find-scratch-buffer&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; visits a new scratch buffer, associated to a file in &lt;code&gt;/tmp/scratch-buffer/&lt;/code&gt; and named &lt;code&gt;scratch&amp;lt;N&amp;gt;&lt;/code&gt; (or you can provide an explicit name using the universal prefix argument)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the newly created buffer is put in &lt;code&gt;scratch-mode&lt;/code&gt;, which remaps &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; to &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-w&lt;/kbd&gt;, meaning that if you accidentally want to save the file, you will be prompted for a location.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar scratch-mode-directory &quot;/tmp/scratch-buffer/&quot;&#xA;  &quot;Prefix path for scratch buffers&quot;)&#xA;&#xA;(defvar scratch-mode--index 0&#xA;  &quot;Index of the newest anonymous scratch buffer.&quot;)&#xA;&#xA;(defun scratch-mode-write-file ()&#xA;  &quot;Run whatever is bound to \&quot;C-x C-w\&quot;.&#xA;This should be something like `write-file'.&quot;&#xA;  (interactive)&#xA;  (call-interactively (key-binding (kbd &quot;C-x C-w&quot;))))&#xA;&#xA;(define-minor-mode scratch-mode&#xA;  &quot;Minor mode for temporary buffers&quot;&#xA;  :global nil&#xA;  :init-value nil&#xA;  :lighter &quot; scratch&quot;&#xA;  :keymap (let ((map (make-sparse-keymap)))&#xA;            (define-key map (kbd &quot;C-x C-s&quot;) #'scratch-mode-write-file)&#xA;            map))&#xA;&#xA;(defun scratch-mode--enable-maybe ()&#xA;  (when (string= scratch-mode-directory&#xA;                 (file-name-directory&#xA;                  (or (buffer-file-name) &quot;&quot;)))&#xA;    (scratch-mode 1)))&#xA;&#xA;(add-hook 'after-change-major-mode-hook #'scratch-mode--enable-maybe)&#xA;&#xA;(defun find-scratch-buffer (&amp;amp;optional name)&#xA;  &quot;Visit a scratch buffer.&#xA;When NAME is not provided, it defaults to \&quot;scratch&amp;lt;N&amp;gt;\&quot;.  The&#xA;newly created buffer inherits the current value of&#xA;`default-directory', and is put in `scratch-mode'.&quot;&#xA;  (interactive `(,(if current-prefix-arg&#xA;                      (read-from-minibuffer &quot;Scratch name: &quot;)&#xA;                    nil)))&#xA;  (unless (file-exists-p scratch-mode-directory)&#xA;    (make-directory scratch-mode-directory t))&#xA;  (let ((dd default-directory))&#xA;    (find-file (format &quot;%s%s&quot;&#xA;                       scratch-mode-directory&#xA;                       (or name&#xA;                           (format &quot;scratch&amp;lt;%d&amp;gt;&quot; (incf scratch-mode--index)))))&#xA;    (setq default-directory dd)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-01-02T09:44:32.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5962" PostTypeId="2" ParentId="5938" CreationDate="2015-01-02T12:27:59.120" Score="4" Body="&lt;p&gt;The following is my &lt;code&gt;auto-complete&lt;/code&gt; related configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(package-initialize)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;&#xA;;; Activate auto-complete for latex modes (AUCTeX or Emacs' builtin one).&#xA;(add-to-list 'ac-modes 'latex-mode)&#xA;&#xA;;; Activate ac-math.&#xA;(eval-after-load &quot;latex&quot;&#xA;  '(when (featurep 'auto-complete)&#xA;     ;; See https://github.com/vspinu/ac-math&#xA;     (require 'ac-math)&#xA;     (defun ac-latex-mode-setup ()       ; add ac-sources to default ac-sources&#xA;       (setq ac-sources&#xA;         (append '(ac-source-math-unicode ac-source-math-latex ac-source-latex-commands)&#xA;             ac-sources)))&#xA;     (add-hook 'LaTeX-mode-hook 'ac-latex-mode-setup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, there is nothing special for AUCTeX, it's the standard configuration of &lt;code&gt;auto-complete&lt;/code&gt;.  The configuration for &lt;code&gt;ac-math&lt;/code&gt; is described on its web site.  If you don't use &lt;code&gt;ac-math&lt;/code&gt;, the only sensible difference with your configuration is &lt;code&gt;(add-to-list 'ac-modes 'latex-mode)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-01-02T12:49:58.650" LastActivityDate="2015-01-02T12:49:58.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5963" PostTypeId="2" ParentId="5938" CreationDate="2015-01-02T12:58:44.590" Score="12" Body="&lt;p&gt;After doing a long research in the web and careful examination of &lt;code&gt;ac&lt;/code&gt; documentation with a lot of trials on my machine to examine code line by line, I came up with this solution that can have &lt;code&gt;yasnippet&lt;/code&gt; working as well (optioinal) without any confict.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;put this in your &lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt; taking care of sequence:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(package-initialize)&#xA;&#xA;;; yasnippet code 'optional', before auto-complete&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;&#xA;;; auto-complete setup, sequence is important&#xA;(require 'auto-complete)&#xA;(add-to-list 'ac-modes 'latex-mode) ; beware of using 'LaTeX-mode instead&#xA;(require 'ac-math) ; package should be installed first &#xA;(defun my-ac-latex-mode () ; add ac-sources for latex&#xA;   (setq ac-sources&#xA;         (append '(ac-source-math-unicode&#xA;           ac-source-math-latex&#xA;           ac-source-latex-commands)&#xA;                 ac-sources)))&#xA;(add-hook 'LaTeX-mode-hook 'my-ac-latex-mode)&#xA;(setq ac-math-unicode-in-math-p t)&#xA;(ac-flyspell-workaround) ; fixes a known bug of delay due to flyspell (if it is there)&#xA;(add-to-list 'ac-modes 'org-mode) ; auto-complete for org-mode (optional)&#xA;(require 'auto-complete-config) ; should be after add-to-list 'ac-modes and hooks&#xA;(ac-config-default)&#xA;(setq ac-auto-start nil)            ; if t starts ac at startup automatically&#xA;(setq ac-auto-show-menu t)&#xA;(global-auto-complete-mode t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;br&gt;&#xA;as mentioned in the &lt;a href=&quot;http://cx4a.org/software/auto-complete/manual.html#Introduction&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; of &lt;code&gt;ac&lt;/code&gt;, the adding to &lt;code&gt;ac-modes&lt;/code&gt; and hooks should be done before loading &lt;code&gt;(ac-config-default)&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some suggested to put some code to play with &lt;code&gt;TAB&lt;/code&gt; key which I didn't need and do not recommend as it will somehow destroy something else later. However, I saw people put something like this at the end just before &lt;code&gt;global-auto-complete&lt;/code&gt;:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ac-set-trigger-key &quot;TAB&quot;)&#xA;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Until I added &lt;code&gt;(ac-flyspell-workaround)&lt;/code&gt; auto-completion was too slow to think of using it in Auctex since I use flyspell. This bug was also mentioned in the documentation. Thanks!  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;&lt;br&gt;&#xA;I was glad to know from the documentation, though not very clear how, that one can add a user-defined dictionary(ies)! I tried this and worked well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;add these two lines just after &lt;code&gt;require-auto-complete&lt;/code&gt; line above:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/.dict&quot;) ; make sure this folder exists&#xA;(add-to-list 'ac-user-dictionary-files &quot;~/.emacs.d/.dict/custom-dict.txt&quot;) ; put any name to your `.txt` file  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now in your &lt;code&gt;.txt&lt;/code&gt; file add your favorite candidates for completion. Save yourself from candidates fewer than 4-letter long, they don't worth it! Simply put words of your like separated by a line feed or &lt;code&gt;RET&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of the contents in the &lt;code&gt;.txt&lt;/code&gt; file:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;inconsistencies&#xA;foobaremaild@foobar.com&#xA;do-not-put-your-password-here&#xA;long-line-in-any-programming-language-of-your-like&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Enjoy auto-completion in LaTeX/AUCTeX with Emacs!&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-02-17T13:25:25.673" LastActivityDate="2015-02-17T13:25:25.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5965" PostTypeId="2" ParentId="5938" CreationDate="2015-01-02T14:38:23.420" Score="6" Body="&lt;p&gt;As I told in my above comment, the package &lt;a href=&quot;https://github.com/monsanto/auto-complete-auctex&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;auto-complete-auctex&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; can also solve the problem. I tested both, and they both work nicely. It would be nice to compare the solution of &lt;strong&gt;@doctorate&lt;/strong&gt; and the above package by giving screen-shots. If I write &lt;code&gt;$\sig$&lt;/code&gt;, the code of doctorate give something like this &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VxBV4.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and that of the package &lt;code&gt;auto-complete-auctex&lt;/code&gt; gives something like this &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/nz0OO.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Added: I should mention that the solution of &lt;strong&gt;@giordano&lt;/strong&gt; works as well, here a screen-shot: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TPre6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="19785" LastEditDate="2018-08-21T18:14:04.810" LastActivityDate="2018-08-21T18:14:04.810" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="5966" PostTypeId="1" AcceptedAnswerId="5969" CreationDate="2015-01-02T14:56:33.793" Score="2" ViewCount="499" Body="&lt;p&gt;Here's my Semantic config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(semantic-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my config probably isn't the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I try to use Semantic commands in an elisp file, I get the message &lt;code&gt;Buffer was not parsed by Semantic.&lt;/code&gt;. So I tried doing &lt;code&gt;semantic-force-refresh&lt;/code&gt; and it says, &lt;code&gt;Buffer reparsed.&lt;/code&gt; (no errors). But it still throws the &quot;not parsed&quot; error when I try to use a semantic command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;$ emacs -Q --eval &quot;(semantic-mode 1)&quot;&lt;/code&gt; has the same issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything works as intended in &lt;code&gt;c-mode&lt;/code&gt; and &lt;code&gt;c++-mode&lt;/code&gt;. What gives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Version info:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CEDET Version:  2.0&#xA;            Requested   File        Loaded&#xA;  Package       Version     Version     Version&#xA;  ----------------------------------------------------------&#xA;  cedet:        2.0     nil     ok&#xA;  eieio:        1.4     nil     ok&#xA;  semantic:     2.2     nil     ok&#xA;  srecode:      1.2     nil     Not Loaded&#xA;  ede:          1.2     nil     ok&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I usually use Emacs in Cygwin:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (i686-pc-cygwin) of 2014-10-21 on desktop-new&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I have the same problem on my Arch VPS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.3) of 2014-10-21 on bitzer.hoetzel.info&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I discovered that &lt;code&gt;(semantic-active-p)&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; in elisp buffers. I'm not sure why.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-01-02T15:30:29.343" LastActivityDate="2015-01-02T16:10:47.970" Title="Semantic not parsing Elisp files" Tags="|elisp|semantic-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5967" PostTypeId="1" AcceptedAnswerId="5968" CreationDate="2015-01-02T14:58:11.590" Score="21" ViewCount="2572" Body="&lt;p&gt;Emacs 24 introduced the ability to disable the creation of the infamous &lt;code&gt;.#file-name&lt;/code&gt; lock  files.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluating the following lisp form will completely disable Emacs ability to lock files to prevent concurrent changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to set Emacs to save lock files in a dedicated directory&lt;/strong&gt;, similarly to what happens with auto-save and backup files?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq create-lockfiles nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user66" LastEditorUserId="105" LastEditDate="2022-04-04T15:43:44.163" LastActivityDate="2023-11-06T08:22:25.340" Title="Save lock-files to a directory instead of disabling them" Tags="|lock-files|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5968" PostTypeId="2" ParentId="5967" CreationDate="2015-01-02T15:11:27.167" Score="16" Body="&lt;p&gt;I'm afraid this is not straightforward to do considering &lt;code&gt;F1 v create-lockfiles&lt;/code&gt; takes you to &lt;code&gt;filelock.c&lt;/code&gt; which only exposes this variable and &lt;code&gt;temporary-file-directory&lt;/code&gt;. So, to have this behaviour you'd either need to replace nearly all functions exposed in that file with your own Emacs Lisp functions or hand in a bug via &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; and hope for the best.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-02T15:11:27.167" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5969" PostTypeId="2" ParentId="5966" CreationDate="2015-01-02T16:10:47.970" Score="1" Body="&lt;p&gt;I solved this problem by downloading and installing a recent snapshot of CEDET from here: &lt;a href=&quot;http://www.randomsample.de/cedet-snapshots/&quot; rel=&quot;nofollow&quot;&gt;http://www.randomsample.de/cedet-snapshots/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used this snapshot: &lt;code&gt;cedet_snapshot-rev_8698.tar.gz  29-Dec-2014 21:00   1.5M&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess the version shipped with this version of Emacs is broken.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-02T16:10:47.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5970" PostTypeId="1" CreationDate="2015-01-02T16:37:25.203" Score="8" ViewCount="970" Body="&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I tweak &lt;code&gt;smartparens&lt;/code&gt;'s decision rules for when to&#xA;  insert a paired or single character?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;smartparens&lt;/code&gt; seems to be &lt;em&gt;mostly&lt;/em&gt; smart when inserting single&#xA;quotes (e.g., in &lt;code&gt;text-mode&lt;/code&gt; or &lt;code&gt;org-mode&lt;/code&gt;).  Hence, it default to&#xA;inserting a pair of &lt;code&gt;'&lt;/code&gt;s and placing the cursor in between them,&#xA;but, when invoked at the end of a word, only inserts a single &lt;code&gt;'&lt;/code&gt;&#xA;in anticipation of contractions.  So, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;'&lt;/code&gt; =&gt; &lt;code&gt;'*'&lt;/code&gt; (where &lt;code&gt;*&lt;/code&gt; is point)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;can + '&lt;/code&gt; =&gt; &lt;code&gt;can'*&lt;/code&gt; (so I can continue to write &quot;can't&quot;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, there's a hiccup I'm looking to fix.  I often use&#xA;abbreviations that end in a period, but would like to make them&#xA;possessive.  For example, I might write &quot;s.o.&quot; as an abbreviation&#xA;for &quot;someone,&quot; and therefore &quot;s.o.'s&quot; would be &quot;someone's.&quot;  The&#xA;problem is that &lt;code&gt;smartparens&lt;/code&gt; inserts a paired-&lt;code&gt;'&lt;/code&gt; after a period:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;what I want: &lt;code&gt;s.o. + '&lt;/code&gt; =&gt; &lt;code&gt;s.o.'*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;what I get: &lt;code&gt;s.o. + '&lt;/code&gt; =&gt; &lt;code&gt;s.o.'*'&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My specific quibble is with &lt;code&gt;smartparens&lt;/code&gt;'s behavior on &lt;code&gt;'&lt;/code&gt;, but I&#xA;can imagine this being a more general issue with other characters&#xA;as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;em&gt;how can I tweak &lt;code&gt;smartparens&lt;/code&gt;'s decision rule to expand the&#xA;set of characters after which it only inserts a single &lt;code&gt;'&lt;/code&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;PS: amusingly, trying to type &quot;`smartparens`'s&quot; in emacs gives the same irritating behavior.&lt;/em&gt; &lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-05T17:18:01.330" Title="smartparens insert single versus paired character?" Tags="|smartparens|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5971" PostTypeId="1" AcceptedAnswerId="5972" CreationDate="2015-01-02T17:34:34.583" Score="3" ViewCount="474" Body="&lt;p&gt;I set &lt;code&gt;(global-set-key (kbd &quot;H-g&quot;) 'keyboard-quit)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the minibuffer is open and waiting for input, and I want to quit out of it, when I hit &lt;code&gt;H-g&lt;/code&gt;, the bell rings and I see the Quit message, but the minibuffer remains open and accepting input. &lt;code&gt;C-g&lt;/code&gt; works as expected: closes the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make &lt;code&gt;H-g&lt;/code&gt; quit the minibuffer?&lt;/p&gt;&#xA;" OwnerUserId="2163" LastActivityDate="2015-01-02T19:33:12.657" Title="Additional binding for keyboard-quit doesn't work with minibuffer" Tags="|key-bindings|minibuffer|" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5972" PostTypeId="2" ParentId="5971" CreationDate="2015-01-02T19:33:12.657" Score="5" Body="&lt;p&gt;Thanks to #emacs, I learned that &lt;code&gt;(global-set-key (kbd &quot;H-g&quot;) (kbd &quot;C-g&quot;))&lt;/code&gt; will work for this. C-g runs whatever command it is bound to, and now H-g will run a keyboard macro that consists of C-g, so it does exactly whatever C-g would. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A slight oddity is that because H-g is now bound to a keyboard macro, after hitting it, I see the keyboard macro message &quot;After 0 kbd macro iterations: Quit&quot;, because that's exactly what it's doing -- quitting.&lt;/p&gt;&#xA;" OwnerUserId="2163" LastActivityDate="2015-01-02T19:33:12.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5973" PostTypeId="1" AcceptedAnswerId="5974" CreationDate="2015-01-02T19:36:24.383" Score="13" ViewCount="1729" Body="&lt;p&gt;I have a command called &lt;code&gt;test&lt;/code&gt; which simply takes an input from the user and echoes it back:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test (input)&#xA;  (interactive &quot;MInput: &quot;)&#xA;  (message &quot;%s&quot; input))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to write another function which would call it. The following fails:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-forward ()&#xA;  (interactive)&#xA;  (test))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with this error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test-forward: Wrong number of arguments: (lambda (input) (interactive &quot;MInput: &quot;) (message &quot;%s&quot; input)), 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This makes sense, since &lt;code&gt;test&lt;/code&gt; takes one input. Making &lt;code&gt;test&lt;/code&gt;'s &lt;code&gt;input&lt;/code&gt; &lt;code&gt;&amp;amp;optional&lt;/code&gt; simply makes &lt;code&gt;test-forward&lt;/code&gt; return &lt;code&gt;nil&lt;/code&gt; without doing anything. What is the right way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="105" LastEditDate="2021-01-24T18:28:45.470" LastActivityDate="2021-01-24T18:28:45.470" Title="How to use 'interactive' arguments when calling the command from code" Tags="|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5974" PostTypeId="2" ParentId="5973" CreationDate="2015-01-02T19:37:17.023" Score="15" Body="&lt;p&gt;Simply:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-interactively 'test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-02T19:37:17.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5975" PostTypeId="2" ParentId="5296" CreationDate="2015-01-02T20:25:02.723" Score="3" Body="&lt;p&gt;A solution seems to be to use a login shell instead of interactive shell, according to the following answer on stackoverflow: &#xA;&lt;a href=&quot;https://stackoverflow.com/questions/27581085/running-system-command-under-interactive-bash-shell&quot;&gt;running-system-command-under-interactive-bash-shell&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First make sure &lt;code&gt;~/.bash_profile&lt;/code&gt; contains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [ -f ~/.bashrc ]; then&#xA;    shopt -s expand_aliases&#xA;    . ~/.bashrc&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can now use &lt;code&gt;bash -lc&lt;/code&gt; instead of &lt;code&gt;bash -ic&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(print (shell-command-to-string &quot;bash -lc 'my_cmd'&quot;) (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-01-02T20:25:02.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5976" PostTypeId="2" ParentId="5959" CreationDate="2015-01-02T20:29:40.717" Score="3" Body="&lt;p&gt;You can suppress display in the minibuffer by setting &lt;code&gt;minibuffer-message-timeout&lt;/code&gt; to 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I use something like this in a few places where I want to toggle a minor mode while in a minibuffer prompt (like ido find-file) without being interrupted by a 'mode enabled' message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((minibuffer-message-timeout 0))&#xA;    (toggle-some-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-02T20:29:40.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5977" PostTypeId="1" AcceptedAnswerId="5978" CreationDate="2015-01-02T20:40:39.180" Score="3" ViewCount="82" Body="&lt;p&gt;I sometimes need to do replacements which would involve using matched parts for the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I would like to replace &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;varName-&amp;gt;doWork()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;::doWork(varName, 42)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;whatever varName actually is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a straightforward way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-01-02T20:54:29.213" LastActivityDate="2015-01-02T23:06:58.807" Title="Emacs regex replace while re-using part of the expression in the replacement" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5978" PostTypeId="2" ParentId="5977" CreationDate="2015-01-02T20:58:37.723" Score="3" Body="&lt;p&gt;It's doable. &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;query-replace-regexp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;from: &lt;code&gt;^\(\w+\)-&amp;gt;\([^(]+\)()&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;to: &lt;code&gt;::\2(\1, 42)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But if it's a recurring pattern, it's best to solidify it in a&#xA;function, instead of entering the regex each time.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-01-02T23:06:58.807" LastActivityDate="2015-01-02T23:06:58.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5979" PostTypeId="2" ParentId="5882" CreationDate="2015-01-03T00:09:44.667" Score="2" Body="&lt;p&gt;Finally figured this out, this will re-map &lt;code&gt;Backspace&lt;/code&gt; key to &lt;code&gt;C-h&lt;/code&gt; everywhere:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map [?\C-h] [?\C-?])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://github.com/magnars/.emacs.d/blob/b3ceff0633c8887442d88d5000440d2bdc07e1c5/settings/key-bindings.el#L73&quot; rel=&quot;nofollow&quot;&gt;Magnar Sveen's Emacs configuration&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2015-01-03T00:09:44.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5980" PostTypeId="1" AcceptedAnswerId="5982" CreationDate="2015-01-03T02:24:41.950" Score="9" ViewCount="2950" Body="&lt;p&gt;I would like to set the class for a table in html export, e.g.:&#xA;&lt;code&gt;&amp;lt;table class=&quot;table table-striped&quot;&amp;gt;&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it seems that setting some attributes for export of tables to HTML are possible:&#xA;&lt;code&gt;#+ATTR_HTML: :border 2 :rules all :frame border&lt;/code&gt; I could not find any documentation on setting the class. Is  this possible?&lt;/p&gt;&#xA;" OwnerUserId="3867" LastActivityDate="2015-01-03T03:05:05.577" Title="Setting class attribute for html table in orgmode export" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5981" PostTypeId="1" AcceptedAnswerId="5990" CreationDate="2015-01-03T02:45:08.133" Score="8" ViewCount="1924" Body="&lt;p&gt;I would like electric-pair-mode to be enabled only in the buffers where I am editing, say, Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it seems that electric-pair-mode is a &quot;global minor mode&quot;: if it is activated in one buffer, it automatically becomes active in all buffers.  Thus, including &lt;code&gt;(electric-pair-mode)&lt;/code&gt; in the &lt;code&gt;emacs-lisp-mode-hook&lt;/code&gt; does not behave in a useful way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to configure Emacs to only use electric pairs in some buffers?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2018-12-14T19:40:51.717" Title="How to make electric-pair-mode buffer local?" Tags="|key-bindings|minor-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5982" PostTypeId="2" ParentId="5980" CreationDate="2015-01-03T03:05:05.577" Score="9" Body="&lt;p&gt;You can treat the class attribute the same as other attributes and just set it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :border 2 :rules all :frame border :class striped table-striped&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which yielded (adding a newline for clarity):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;table border=&quot;2&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot; rules=&quot;all&quot; &#xA; frame=&quot;border&quot; class=&quot;striped table-striped&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3994" LastActivityDate="2015-01-03T03:05:05.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5983" PostTypeId="2" ParentId="5970" CreationDate="2015-01-03T05:15:17.407" Score="2" Body="&lt;p&gt;Yes, with pairing conditionals:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; a sample from my .emacs.d&#xA;(defun my-sp-pair-function (id action context)&#xA;  (if (eq action 'insert)&#xA;    ;; t to pair, nil to not pair&#xA;    (or (looking-at &quot;[[:space:][:punct:]]&quot;)&#xA;      (sp-point-before-eol-p id action context))&#xA;    t))&#xA;&#xA;(with-eval-after-load 'smartparens&#xA;    (sp-pair &quot;(&quot; &quot;)&quot; :when '(my-sp-pair-function) :wrap &quot;C-)&quot;)&#xA;    (sp-pair &quot;{&quot; &quot;}&quot; :when '(my-sp-pair-function) :wrap &quot;C-}&quot;)&#xA;    (sp-pair &quot;[&quot; &quot;]&quot; :when '(my-sp-pair-function) :wrap &quot;C-]&quot;)&#xA;    (sp-pair &quot;\&quot;&quot; &quot;\&quot;&quot; :when '(my-sp-pair-function) :wrap &quot;C-\&quot;&quot;)&#xA;    (sp-pair &quot;'&quot; &quot;'&quot; :when '(my-sp-pair-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-01-04T04:00:39.653" LastActivityDate="2015-01-04T04:00:39.653" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5984" PostTypeId="1" AcceptedAnswerId="5993" CreationDate="2015-01-03T06:02:37.993" Score="0" ViewCount="45" Body="&lt;p&gt;I've been trying to set &lt;code&gt;org-babel-load-languages&lt;/code&gt; using Customize in Cocoa Emacs 24.4 (and using Emacs in a text console). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I click &lt;code&gt;INS&lt;/code&gt; then &lt;code&gt;Choice: Value Menu&lt;/code&gt;, I get a &lt;code&gt;widget-choose&lt;/code&gt; buffer with a list of choices that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0 = Awk&#xA;1 = C &#xA;2 = R&#xA;3 = Asymptote&#xA;4 = Calc&#xA;5 = Clojure &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;etc. etc. all the way to the bottom of that buffer, and beyond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't see either of the languages I'd like to choose (Python and Ruby), so I can't figure out the corresponding letter to press to pick one of them. When I try to click in that buffer to scroll, it closes and pops me back into the Customize buffer. Same with attempts to switch into it with &lt;code&gt;C-o&lt;/code&gt; and scroll that way.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've worked around it by setting a choice, saving, then editing my Customize-set variables to suit, but that's annoying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to compel better behavior from that &lt;code&gt;widget-choose&lt;/code&gt; buffer?  &lt;/p&gt;&#xA;" OwnerUserId="3994" LastActivityDate="2015-01-03T13:03:25.000" Title="How can I keep Customize value menus from running too long to select?" Tags="|customize|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5985" PostTypeId="1" AcceptedAnswerId="6005" CreationDate="2015-01-03T08:27:11.780" Score="10" ViewCount="800" Body="&lt;p&gt;I am working with a lot of *cpp and *h files which contain &lt;a href=&quot;http://www.gnu.org/licenses/gpl-howto.html&quot;&gt;a lengthy copyright notice&lt;/a&gt; at the beginning. I would like emacs to show these files as if this was not there, without actually removing the text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thas is, this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/*&#xA; * Copyright (C) 2006-2008 Author A&#xA; * Copyright (C) 2006-2008 Author B&#xA; * Copyright (C) 2006-2008 Author C&#xA; * Copyright (C) 2006-2008 Author D&#xA; * &#xA; * This library is free software; you can redistribute it and/or&#xA; * modify it under the terms of the GNU Lesser General Public&#xA; * License as published by the Free Software Foundation; either&#xA; * version 2.1 of the License, or (at your option) any later version.&#xA; * &#xA; * As a special exception, you may use this file as part of a free&#xA; * software library without restriction. Specifically, if other files&#xA; * instantiate templates or use macros or inline functions from this&#xA; * file, or you compile this file and link it with other files to&#xA; * produce an executable, this file does not by itself cause the&#xA; * resulting executable to be covered by the GNU General Public&#xA; * License. This exception does not however invalidate any other&#xA; * reasons why the executable file might be covered by the GNU Library&#xA; * General Public License.&#xA; * &#xA; * This library is distributed in the hope that it will be useful,&#xA; * but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU&#xA; * Lesser General Public License for more details.&#xA; * &#xA; * You should have received a copy of the GNU Lesser General Public&#xA; * License along with this library; if not, write to the Free Software&#xA; * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA&#xA; */&#xA;&#xA; #ifndef FILENAME&#xA; #define FILENAME&#xA; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should simply look like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#ifndef FILENAME&#xA;#define FILENAME&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2076" LastActivityDate="2015-01-03T18:05:05.753" Title="Hide long GPL copyright notice at top of file" Tags="|display|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5986" PostTypeId="1" AcceptedAnswerId="5987" CreationDate="2015-01-03T08:37:49.750" Score="0" ViewCount="1048" Body="&lt;p&gt;I am trying to develop a regex to check if points is within a GitHub markdown link to a wiki page, and then extract that page name. For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some text [link_name](https://github.com/user/wiki/Tool-info) more text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If point is between the &lt;code&gt;[&lt;/code&gt; and the &lt;code&gt;)&lt;/code&gt; and the user clicks a keyboard shortcut, I would like to extract the name of the wiki page, namely &lt;code&gt;Tool-info&lt;/code&gt;..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun test-wiki ()&#xA;  (interactive)&#xA;  (let ((name nil) (m-beginning nil))&#xA;    (save-excursion&#xA;      (if (char-equal (char-after) ?\[)&#xA;          (setq m-beginning t)&#xA;        (when (looking-back &quot;\\[[^)]*?&quot; (line-beginning-position))&#xA;          (setq m-beginning t)&#xA;          (goto-char (match-beginning 0))))&#xA;      (when m-beginning&#xA;        (when (looking-at &quot;\\[[\\w]+?\\](\\([:/.\\w]+?\\))&quot;)&#xA;          (setq name (match-string 1)))))&#xA;    (if name&#xA;        (message name)&#xA;      (message &quot;No match&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently, this gives message &lt;code&gt;&quot;No match&quot;&lt;/code&gt; in all cases..&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-01-03T09:52:12.493" LastActivityDate="2015-01-03T09:52:47.777" Title="Regex to check for a markdown link at point" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5987" PostTypeId="2" ParentId="5986" CreationDate="2015-01-03T09:02:45.937" Score="0" Body="&lt;p&gt;You cannot use &lt;code&gt;\w&lt;/code&gt; inside a character class in Emacs, instead you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (looking-at &quot;\\[\\w+?\\](\\([-:/.[:alnum:]]+?\\))&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-01-03T09:52:47.777" LastActivityDate="2015-01-03T09:52:47.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5988" PostTypeId="2" ParentId="5898" CreationDate="2015-01-03T09:14:23.910" Score="0" Body="&lt;p&gt;After a couple of days without incident, I am not 100% sure but I am pretty confident that the problem was related to fixmee-mode (or the library that mode uses underneath: button-lock-mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I removed them from my setup and no more issues. IIRC those libraries made other emacs packages (like &lt;code&gt;wdired&lt;/code&gt;, &lt;code&gt;dired-efap&lt;/code&gt;) that worked with text properties in the buffer to have &quot;glitches&quot;.&lt;/p&gt;&#xA;" OwnerUserId="4048" LastActivityDate="2015-01-03T09:14:23.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5989" PostTypeId="2" ParentId="5985" CreationDate="2015-01-03T09:32:46.387" Score="13" Body="&lt;p&gt;Here's one way to do that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hide-banner ()&#xA;  (save-excursion&#xA;    (let* ((start (progn (beginning-of-buffer) (point)))&#xA;           (end (progn (forward-comment (buffer-size)) (point)))&#xA;           (over (make-overlay start end)))&#xA;      (overlay-put over 'invisible t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the buffer where you want to hide the initial comment add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// -*- eval: (hide-banner) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or add the same code to the buffer hook.  Or you could certainly change the way the comment you want to hide is identified (if you wanted it to pick up the &lt;code&gt;#ifndef / #define&lt;/code&gt; pair, then you'd need to modify the &lt;code&gt;hide-banner&lt;/code&gt; function to search for that rather than the end of the first comment.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-03T09:32:46.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5990" PostTypeId="2" ParentId="5981" CreationDate="2015-01-03T10:47:22.883" Score="4" Body="&lt;p&gt;This is not a complete answer since it does not disable &lt;code&gt;electric-pair-mode&lt;/code&gt;, however it does disable automatic insertion of the matching parens. You can customize &lt;code&gt;electric-pair-inhibit-predicate&lt;/code&gt;. From the documentation &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;electric-pair-inhibit-predicate&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Predicate to prevent insertion of a matching pair.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can set it to a function which returns &lt;code&gt;t&lt;/code&gt; only if the current major-mode is &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-electic-pair-modes '(emacs-lisp-mode))&#xA;&#xA;(defun my-inhibit-electric-pair-mode (char)&#xA;  (not (member major-mode my-electic-pair-modes)))&#xA;&#xA;(setq electric-pair-inhibit-predicate #'my-inhibit-electric-pair-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can add any additional major-modes where you want automatic insertion to work to &lt;code&gt;my-electric-pair-modes&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-01-03T10:47:22.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5991" PostTypeId="2" ParentId="5959" CreationDate="2015-01-03T11:47:45.707" Score="2" Body="&lt;p&gt;Going through the docstring of &lt;code&gt;message&lt;/code&gt; it seems it should be possible to achieve what you want by calling message with a &lt;code&gt;nil&lt;/code&gt; argument immediately after calling &lt;code&gt;message&lt;/code&gt; with your desired content. From the docstring of &lt;code&gt;message&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the first argument is nil or the empty string, the function clears&#xA;  any existing message; this lets the minibuffer contents show.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So modifying your function to something like the following should work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rsync-process-filter (proc string)&#xA;  (when (not (or&#xA;      (string-match &quot;files...\r&quot; string)&#xA;      (string-match &quot;files to consider\n&quot; string)))&#xA;    (message &quot;%s&quot; string)&#xA;    (message nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tested it by doing the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  (message &quot;%s&quot; &quot;Test&quot;)&#xA;  (message nil))&#xA;&#xA;(run-at-time 5 5 #'test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it seems to work&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-01-03T11:47:45.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5992" PostTypeId="2" ParentId="5970" CreationDate="2015-01-03T12:27:18.583" Score="2" Body="&lt;p&gt;You can modify smartparen's behavior by using the functions &lt;code&gt;sp-pair&lt;/code&gt; and &lt;code&gt;sp-local-pair&lt;/code&gt;. The smartparens &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Pair-management&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt; explains these functions in detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically you can something like following to customize the behavior globally&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;\&quot;&quot; nil :unless '(my-custom-predicate))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OR to customize the behavior just for some modes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair desired-modes &quot;\&quot;&quot; nil :unless '(my-custom-predicate))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;desired-mode&lt;/code&gt; is the mode for which you want to customize the behavior and &lt;code&gt;my-custom-predicate&lt;/code&gt; is function that smartparens should use to determine whether it should insert the pair automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;sp-pair&lt;/code&gt;'s docstring the custom predicate should accept&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;opening delimiter (which uniquely determines the pair), action and&#xA;  context.  The context argument can have values:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;string  - if point is inside string.&lt;/li&gt;&#xA;  &lt;li&gt;comment - if point is inside comment.&lt;/li&gt;&#xA;  &lt;li&gt;code    - if point is inside code.  This context is only   recognized in programming modes that define string semantics.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So a custom function that can be used as a &lt;code&gt;:unless&lt;/code&gt; predicate in your specific case would be something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun predp (id action context)&#xA;  (sp--looking-back-p &quot;[[:punct:]]'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that I am checking for the regex &lt;code&gt;&amp;lt;punctuation&amp;gt;'&lt;/code&gt; since the point would be at &lt;code&gt;.'|&lt;/code&gt; when the predicate is executing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you can hook it into smartparens by doing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair  &quot;'&quot; nil :unless'(predp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-01-05T17:18:01.330" LastActivityDate="2015-01-05T17:18:01.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5993" PostTypeId="2" ParentId="5984" CreationDate="2015-01-03T13:03:25.000" Score="1" Body="&lt;p&gt;You can use the command &lt;code&gt;scroll-other-window&lt;/code&gt; to scroll the window up. By the default the command is bound to &lt;kbd&gt;C-M-v&lt;/kbd&gt;. However it seems customize UI does not recognize the complementary command &lt;code&gt;scroll-other-window-down&lt;/code&gt; to scroll window down. You can work around this by using a negative prefix argument with the command &lt;code&gt;scroll-other-window&lt;/code&gt; i.e. &lt;kbd&gt;M--&lt;/kbd&gt;&lt;kbd&gt;C-M-v&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-01-03T13:03:25.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5994" PostTypeId="1" CreationDate="2015-01-03T13:09:48.180" Score="3" ViewCount="856" Body="&lt;p&gt;&lt;code&gt;PNG&lt;/code&gt; images displays well on my computer, but the &lt;code&gt;JPEG&lt;/code&gt; images are displayed incorrectly as small boxes as shown in the following image:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sAPIM.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running &lt;code&gt;Emacs 24.4&lt;/code&gt; under &lt;code&gt;Windows 7&lt;/code&gt;. And I compiled &lt;code&gt;libpng16.dll&lt;/code&gt; and &lt;code&gt;libjpeg-9.dll&lt;/code&gt; myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got the &lt;code&gt;PNG&lt;/code&gt; library from &lt;a href=&quot;http://libpng.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and compiled it using &lt;code&gt;Visual Studio 13&lt;/code&gt;. And I got the &lt;code&gt;JPEG&lt;/code&gt; library from &lt;a href=&quot;http://www.ijg.org/files/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and compiled it using &lt;code&gt;MinGW&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2015-01-03T13:38:55.903" Title="Emacs doesn't display JPEG files correctly" Tags="|microsoft-windows|emacs24.4|display|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5995" PostTypeId="2" ParentId="5994" CreationDate="2015-01-03T13:38:55.903" Score="4" Body="&lt;p&gt;The problem lies in the self compiled &lt;code&gt;libjpeg-9.dll&lt;/code&gt;. It is solved by downloading &lt;code&gt;dll&lt;/code&gt; files from &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;nofollow&quot;&gt;ezwinports&lt;/a&gt; as &lt;a href=&quot;https://ftp.gnu.org/gnu/emacs/windows/&quot; rel=&quot;nofollow&quot;&gt;recommended&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs can also support some other image formats with appropriate&#xA;libraries.  These libraries are all available on the following sites:&#xA;&#xA;1. http://sourceforge.net/projects/ezwinports/files/&#xA;   -- leaner, more up-to-date builds, only for 32-bit Emacs&#xA;2. http://www.gtk.org/download/win32.php&#xA;   http://www.gtk.org/download/win64.php&#xA;   -- the GTK project site; offers much fatter builds, but includes&#xA;      64-bit DLLs (from the 2nd URL)&#xA;3. GnuWin32 project -- very old builds, not recommended&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="774" LastActivityDate="2015-01-03T13:38:55.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5997" PostTypeId="1" CreationDate="2015-01-03T14:43:57.957" Score="1" ViewCount="878" Body="&lt;p&gt;How can I set up &lt;code&gt;css-mode&lt;/code&gt; for syntax highlighting and autocompletion?  I installed &lt;code&gt;web-mode&lt;/code&gt;, but it doesn't seem to be giving me any of those features.&lt;/p&gt;&#xA;" OwnerUserId="4012" LastEditorUserId="50" LastEditDate="2015-01-04T00:49:15.427" LastActivityDate="2015-01-04T00:49:15.427" Title="syntax highlighting and auto-completion for CSS?" Tags="|completion|syntax-highlighting|web-mode|css|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5999" PostTypeId="1" CreationDate="2015-01-03T15:43:49.143" Score="3" ViewCount="8049" Body="&lt;p&gt;By default Emacs load the file &lt;code&gt;.emacs&lt;/code&gt; on my system. I know if I want to start Emacs with the init file &lt;code&gt;.emacs2&lt;/code&gt;, I should run the Emacs with the argument like &lt;code&gt;emacs -q -l ~/.emacs2&lt;/code&gt;. Is it possible to load the init file &lt;code&gt;.emacs2&lt;/code&gt; in the current Emacs which is previously loaded with &lt;code&gt;.emacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-01-03T17:02:24.187" Title="loading a new init file within Emacs" Tags="|init-file|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6000" PostTypeId="2" ParentId="5999" CreationDate="2015-01-03T15:55:11.143" Score="7" Body="&lt;p&gt;It's possible. Just &lt;kbd&gt;M-:&lt;/kbd&gt; (&lt;code&gt;eval-expression&lt;/code&gt;) with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;~/.emacs2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or yank the above into &lt;code&gt;*scratch*&lt;/code&gt;, position the cursor after it and press &lt;kbd&gt;C-j&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-03T15:55:11.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6001" PostTypeId="2" ParentId="3964" CreationDate="2015-01-03T16:15:18.350" Score="11" Body="&lt;p&gt;The &quot;--1d&quot; style delay (which only delays the first occurrence of a repeating event) is useful when you will be unable to complete a repeating task on the scheduled day (because you're out of town, for example) but don't want to reschedule the other occurrences.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Do This&#xA;  SCHEDULED: &amp;lt;2015-01-01 +1m&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to do something on the first of each month but are going to be out that day you could reschedule it to one day later (the 2nd), but then the repeat will schedule it for the 2nd of the next month.  You have to reschedule a second time to get it back to the first.  Instead you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Do This&#xA;  SCHEDULED: &amp;lt;2015-01-01 +1m --1d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will hide it in your agenda for a day and then when you do it schedule the next occurrence for the first of the next month, removing the delay.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-01-03T16:15:18.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6002" PostTypeId="2" ParentId="5999" CreationDate="2015-01-03T17:02:24.187" Score="4" Body="&lt;p&gt;From the Emacs info page on Initialization, the &lt;em&gt;-q&lt;/em&gt; option prevents the load of the &lt;em&gt;~/.emacs&lt;/em&gt; or &lt;em&gt;~/.emacs.d/init.el&lt;/em&gt; in later versions of Emacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The filename is compiled in. There is no way to modify the expected init file without recompiling the application that I am aware of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can suppress the initialization file with the &lt;em&gt;-q&lt;/em&gt; , but then load a file with the &lt;em&gt;-l&lt;/em&gt; option. So something like you described gets you everything you would expect loaded from the site files: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -q -l ~/.emacs2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you are looking for some kind of dependent load from the &lt;em&gt;~/.emacs.d/init.el&lt;/em&gt; or &lt;em&gt;~/.emacs&lt;/em&gt;, then you might find some way to load a file based upon the environment. The init file then becomes your decision tree. I do this for identifying where my customization is held to use the same emacs init file for multiple workstations. Here is the code for that as an example: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond ((&amp;lt; emacs-major-version 24)&#xA;   (setq custom-file &quot;~/.emacs.d/.emacs-23-custom.el&quot;))&#xA;  (t (setq custom-file &quot;~/.emacs.d/.emacs-24-custom.el&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="143" LastActivityDate="2015-01-03T17:02:24.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6003" PostTypeId="2" ParentId="5959" CreationDate="2015-01-03T17:07:49.350" Score="4" Body="&lt;p&gt;&lt;strong&gt;First Rough Draft&lt;/strong&gt; (January 3, 2015):  Revised initial draft based on the helpful comment of @phils regarding using the function &lt;code&gt;messages-buffer&lt;/code&gt; to locate or create the appropriate buffer (and put it into &lt;code&gt;messages-buffer-mode&lt;/code&gt;); and, added a check for whether &lt;code&gt;point-max&lt;/code&gt; is at the beginning of the line (if not, then inset a new line before inserting the message string).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; (January 4, 2015):  There are situations where the inserted string may not necessarily end in a new line, and the function &lt;code&gt;message&lt;/code&gt; does not have a check to ensure it is at the beginning of a new line, so we take care of that in this function.  Thus, at any point when &lt;code&gt;message&lt;/code&gt; inserts a new line, said line will begin at flush-left of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rsync-process-filter (proc string)&#xA;  (let ((inhibit-read-only t))&#xA;    (when (not (or&#xA;        (string-match &quot;files...\r&quot; string)&#xA;        (string-match &quot;files to consider\n&quot; string)))&#xA;      (with-current-buffer (messages-buffer)&#xA;        (goto-char (point-max))&#xA;        (when (not (bolp))&#xA;          (insert &quot;\n&quot;))&#xA;        (insert string)&#xA;        (when (not (bolp))&#xA;          (insert &quot;\n&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-01-05T06:55:30.423" LastActivityDate="2015-01-05T06:55:30.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6004" PostTypeId="1" AcceptedAnswerId="6007" CreationDate="2015-01-03T17:52:53.103" Score="8" ViewCount="870" Body="&lt;p&gt;I am about to adopt Emacs to be the only editor I use in all what I am writing including LaTeX documents. I came from WYSIWYG editor which served that purpose fairly nice, namely TexStudio or TXS for short. For the transition from TXS to Emacs I am still missing the way TXS deals with executing massive regexp query search &amp;amp; replace with highlighting the matches and restriction of the search to only those project-related &lt;code&gt;.tex&lt;/code&gt; files. I deeply miss that in Emacs now. See a screenshot of TXS below:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TeXStudio Query in a Multifile LaTeX Project&lt;/strong&gt; &#xA;&lt;img src=&quot;https://i.stack.imgur.com/PouSX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to emphasize the points in the workflow to be achieved in Emacs:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;RegExp Query Search and Replacement only in the project-related &lt;code&gt;.tex&lt;/code&gt; files. &lt;/li&gt;&#xA;&lt;li&gt;Highlighting the matches&lt;/li&gt;&#xA;&lt;li&gt;An overview of the highlighted results all together in a manageable layout (similar to the log view of &lt;code&gt;Magit&lt;/code&gt; in Emacs when you press &lt;code&gt;l&lt;/code&gt; followed by another &lt;code&gt;l&lt;/code&gt; or simply like &lt;code&gt;C-x d&lt;/code&gt; in Dired mode      &lt;/li&gt;&#xA;&lt;li&gt;How to know how much replacement or inspection matches done with or remaining and a way to &lt;em&gt;resume&lt;/em&gt; query in case it is broken by a clumsy keystroke that stops the query&lt;/li&gt;&#xA;&lt;li&gt;A clean way out of this messy query by closing and saving all related files and back to the state before invoking this query  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I read this &lt;a href=&quot;https://stackoverflow.com/q/270930/1288722&quot;&gt;post&lt;/a&gt; but my intention is to be more like &lt;code&gt;CW&lt;/code&gt; that anyone can share his best workflow to get this common job done. My current approach(es) as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First Workflow&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Dired mode &lt;code&gt;% g&lt;/code&gt; will mark all files containing that regexp. Cons: this will include even file unrelated to the project including non .tex files. &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x 3&lt;/code&gt; opens a new buffer while keeping an eye on the first buffer as my orientation overview of what marked files I have to query in the new buffer individually  &lt;/li&gt;&#xA;&lt;li&gt;Running the query by &lt;code&gt;C-c q&lt;/code&gt;. It has very nice switches like &lt;code&gt;!&lt;/code&gt; replace all without asking plus highlighting matches within the opened file. But this means I have to run the same query each time and for every marked file.  &lt;/li&gt;&#xA;&lt;li&gt;After doing all marked files I hit &lt;code&gt;C-x s !&lt;/code&gt; to save all in one keystroke. Phew!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;&lt;img src=&quot;https://i.stack.imgur.com/44Hkq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second Workflow -- preferred&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Marking all &lt;code&gt;.tex&lt;/code&gt; files using &lt;code&gt;% m&lt;/code&gt; within Dired-mode by regexp in order to mark only &lt;code&gt;.tex&lt;/code&gt; files so basically running &lt;code&gt;\.tex&lt;/code&gt; will get me there.  &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x 3&lt;/code&gt; same as above to keep one buffer for overview and the other for query&lt;/li&gt;&#xA;&lt;li&gt;Executing &lt;code&gt;Q&lt;/code&gt; within Dired which is query replace regexp in &lt;em&gt;marked&lt;/em&gt; files only. Alternatively &lt;code&gt;A&lt;/code&gt; is only regexp search query. A full-fledged query will be executed and a help menu by &lt;code&gt;?&lt;/code&gt; is generously provided    &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x s !&lt;/code&gt; save and close all the mess. Otherwise I had to close the opened files one by one which is tedious. I hope there is a way to close only those we bothered.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WIWCi.png&quot; alt=&quot;enter image description here&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How do I approximate TXS's regexp search/replace query in multifiles?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs 24.4 on Windows 7&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-03T19:52:39.057" Title="Search and replace through a multifile project in AUCTeX?" Tags="|auctex|dired|search|regular-expressions|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6005" PostTypeId="2" ParentId="5985" CreationDate="2015-01-03T17:59:54.873" Score="13" Body="&lt;p&gt;Emacs comes with &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/elide-head.el?id=emacs-24.4&quot;&gt;&lt;code&gt;elide-head.el&lt;/code&gt;&lt;/a&gt; which does exactly what you're asking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use it, add &lt;code&gt;elide-head&lt;/code&gt; to a major mode hook or &lt;code&gt;find-file-hook&lt;/code&gt; (in your case &lt;code&gt;c-mode-common-hook&lt;/code&gt; should work). It can hide GPL license comments out of the box; to hide other lengthy headers, customize &lt;code&gt;elide-head-headers-to-hide&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it does not hide just any comment at the top of the buffer but uses regular expressions to match the beginning and the end of a license.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2015-01-03T18:05:05.753" LastActivityDate="2015-01-03T18:05:05.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6006" PostTypeId="2" ParentId="6004" CreationDate="2015-01-03T18:04:14.147" Score="5" Body="&lt;p&gt;If I understood what you want, RefTeX' &lt;a href=&quot;https://gnu.org/software/auctex/manual/reftex.html#IDX246&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;reftex-isearch-minor-mode&lt;/code&gt;&lt;/a&gt; should be what you are after.  From its description in the manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Toggle a minor mode which enables incremental search to work globally on the entire multifile document. Files will be searched in the sequence they appear in the document. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As &lt;a href=&quot;https://emacs.stackexchange.com/questions/6004/what-is-your-best-workflow-to-do-a-massive-query-in-a-multifile-project-in-aucte/6006#comment9146_6006&quot;&gt;reported&lt;/a&gt; by T. Verron, this works with regexps as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable this minor mode in all *TeX buffer, add one of the following lines to your init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'TeX-mode-hook (lambda () (reftex-isearch-minor-mode))) ; for AUCTeX&#xA;(add-hook 'tex-mode-hook (lambda () (reftex-isearch-minor-mode))) ; for the Emacs' bultin TeX mode.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-01-03T19:08:07.840" LastActivityDate="2015-01-03T19:08:07.840" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="6007" PostTypeId="2" ParentId="6004" CreationDate="2015-01-03T18:26:36.337" Score="3" Body="&lt;p&gt;If I understood correctly, you want to search for text patterns in your project, then you may want to use Projectile along with Helm.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x helm-projectile-grep&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Type text pattern or regex pattern.&lt;/li&gt;&#xA;&lt;li&gt;See updated results for every character entered.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is a demo of &lt;code&gt;helm-projectile-grep&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/j1Won.gif&quot; alt=&quot;helm-projectile-grep&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can save into a separate buffer to refer later using &lt;code&gt;Save results in grep buffer&lt;/code&gt; action` (you switch to action buffer using &lt;kbd&gt;TAB&lt;/kbd&gt;, by default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you haven't heard of Helm, you can read &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;my Helm tutorial&lt;/a&gt;. Visit my &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Helm Projectile tutorial&lt;/a&gt; for more demos and guidance on Helm Projectile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternative, you can also use &lt;code&gt;rgrep&lt;/code&gt;, which is built-in:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x rgrep&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Enter text/regex pattern into &lt;code&gt;Search for:&lt;/code&gt; prompt, i.e. &quot;test&quot;&lt;/li&gt;&#xA;&lt;li&gt;Enter file type to search for into &lt;code&gt;Search for &quot;test&quot; in file:&lt;/code&gt;, i.e. &lt;code&gt;*.tex&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Enter directory to recursively search (hence the name &lt;code&gt;rgrep&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;RET&lt;/kbd&gt; and see results.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A &lt;code&gt;rgrep&lt;/code&gt; demo:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/CqBs2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In regard to your criteria:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;RegExp Query Search and Replacement only in the project-related &lt;code&gt;.tex&lt;/code&gt; files. &lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Both Helm and &lt;code&gt;rgrep&lt;/code&gt; support this feature.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;2&quot;&gt;&#xA;  &lt;li&gt;Highlighting the matches&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Same as above.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;3&quot;&gt;&#xA;  &lt;li&gt;An overview of the highlighted results all together in a manageable layout&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Same as above.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;4&quot;&gt;&#xA;  &lt;li&gt;How to know how much replacement or inspection matches done with or remaining and a way to &lt;em&gt;resume&lt;/em&gt; query in case it is broken by a clumsy keystroke that stops the query&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want to replace matches, you can use &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-wgrep&quot; rel=&quot;nofollow noreferrer&quot;&gt;wgrep&lt;/a&gt; to perform replacement to a &lt;code&gt;*Grep*&lt;/code&gt; buffer. Once you finish and sync back the &lt;code&gt;*Grep*&lt;/code&gt; buffer, everything will be replaced according to the text you replaced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You &quot;resume&quot; by running the query again if you accidentally stop it. But using Helm, you have a &lt;code&gt;helm-resume&lt;/code&gt; command that resume you back to previous on going operation if you accidentally cancel it. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;5&quot;&gt;&#xA;  &lt;li&gt;A clean way out of this messy query by closing and saving all related files and back to the state before invoking this query  &lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Actually, you don't have to kill any buffer if you use tools like &lt;a href=&quot;http://tuhdo.github.io/static/part3/helm-mini.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm-mini&lt;/a&gt;. Managing thousands of open buffers is a breeze: you can narrow to your desire buffers with a short text pattern. You can kill all at once if you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a demo of &lt;code&gt;helm-mini&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qMLCB.gif&quot; alt=&quot;helm-mini&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the detail explanation in &lt;a href=&quot;https://github.com/emacs-helm/helm#advanced-usage&quot; rel=&quot;nofollow noreferrer&quot;&gt;Helm Github page, in &quot;Advanced Usage&quot; section&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-01-03T18:55:52.953" LastActivityDate="2015-01-03T18:55:52.953" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="6008" PostTypeId="2" ParentId="6004" CreationDate="2015-01-03T18:50:19.553" Score="3" Body="&lt;p&gt;In case you are not aware, you can open &lt;strong&gt;Dired&lt;/strong&gt; on only a particular set of files (located in any directories, anywhere). IOW, you can use Dired as your entry point for all of the files of a project.  The usual Dired features work in this context: operating on marked files, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can have Dired bookmarks that you use to give you different &quot;views&quot; of differents sets of files, their markings, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Emacs Wiki is down for maintenance currently, and for a few more days, so that link is temporarily inaccessible.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-03T18:50:19.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6009" PostTypeId="1" CreationDate="2015-01-03T21:46:17.163" Score="7" ViewCount="523" Body="&lt;p&gt;I've found a mode for editing protocol buffer definitions but I'm looking for a library to serialise and de-serialise the wire protocol itself.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-01-03T21:46:17.163" Title="Are there any Emacs libraries for encoding protocol buffers?" Tags="|libraries|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6010" PostTypeId="1" AcceptedAnswerId="6013" CreationDate="2015-01-03T23:08:37.907" Score="9" ViewCount="1085" Body="&lt;p&gt;Suppose that I have two identical emacs (of the same version) on my system. One is placed at &lt;code&gt;C:\Program Files\Gnu Emacs&lt;/code&gt; and the other one at different place, say &lt;code&gt;C:\Program Files\New Gnu Emacs&lt;/code&gt;. Can a running Emacs detect which one is? For example, can it give the path of its executable (i.e., the path where emacs.exe or emacs.bin can be found)?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-01-04T00:31:40.317" Title="Can Emacs detect the path of its executable?" Tags="|elisp|system-environment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6012" PostTypeId="1" AcceptedAnswerId="6014" CreationDate="2015-01-04T00:21:16.110" Score="3" ViewCount="352" Body="&lt;p&gt;bpython detects what libraries are installed and has autocompletion for codes that weren't previously written in the text, if you ever used bpython you know what I mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes i use bpython because i can't remember all the functions that a certain library has by default and bpython autocompletes it. Is that possible in emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A plugin that detects what python libraries you have installed, either on the PC or in a virtualenv and predicts the name of the function you're calling based on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Originally I asked this question on askubuntu, it was about emacs and sublime text, and they told me that the emacs part can be answered here, so here I am!&lt;/p&gt;&#xA;" OwnerUserId="4079" LastActivityDate="2015-01-04T00:44:04.687" Title="Is it possible to transform emacs to something like bpython?" Tags="|package|python|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="6013" PostTypeId="2" ParentId="6010" CreationDate="2015-01-04T00:25:26.437" Score="14" Body="&lt;p&gt;Assuming Emacs knows how it was started, you can access the full path&#xA;of the executable file by doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(expand-file-name invocation-name invocation-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my system, for instance, this returns &lt;code&gt;&quot;/usr/local/bin/emacs&quot;&lt;/code&gt; on&#xA;my regular session and returns &lt;code&gt;&quot;~/.evm/bin/emacs&quot;&lt;/code&gt; on my evm test&#xA;session. If you want to get fancy, you can also wrap that in a&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/file-truename&quot;&gt;&lt;code&gt;file-truename&lt;/code&gt;&lt;/a&gt;&#xA;to resolve any symlinks.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The two variables used above, as described by their doc strings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/invocation-name&quot;&gt;&lt;code&gt;invocation-name&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The program name that was used to run Emacs.&lt;br&gt;&#xA;  Any directory names are omitted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/invocation-directory&quot;&gt;&lt;code&gt;invocation-directory&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The directory in which the Emacs executable was found, to run it.&lt;br&gt;&#xA;  The value is nil if that directory's name is not known.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-01-04T00:31:40.317" LastActivityDate="2015-01-04T00:31:40.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6014" PostTypeId="2" ParentId="6012" CreationDate="2015-01-04T00:35:47.890" Score="3" Body="&lt;p&gt;Python autocompletion provided by Jedi (see &lt;a href=&quot;https://github.com/tkf/emacs-jedi&quot; rel=&quot;nofollow&quot;&gt;https://github.com/tkf/emacs-jedi&lt;/a&gt; for emacs integration) will provide something close to bpython autocompletion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jedi autocompletion is pretty great, but it's not quite bpython autocompletion; in bpython, there's less guessing because the environment in a bpython REPL session already exists, unlike the environment for a line of code in a file. It's generally a harder problem to know what attributes will exist on an object if you also have to predict what the object will be - but Jedi performs pretty admirably and I find it useful enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also be interested in bpython-curtsies along with the new &quot;send session to editor&quot; functionality (triggered by F7) which throws your entire session in emacs for modification, then re-executes it when you close the file. I like this workflow for combining the power of a text editor with the interactive features of bpython. You might also like &quot;reimport,&quot; (F6) which reruns the entire bpython session including reimporting imported modules - another way to combine text editor and the REPL.&lt;/p&gt;&#xA;" OwnerUserId="4080" LastEditorUserId="4080" LastEditDate="2015-01-04T00:44:04.687" LastActivityDate="2015-01-04T00:44:04.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6015" PostTypeId="2" ParentId="5293" CreationDate="2015-01-04T00:58:03.690" Score="5" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Force an org-babel session to &lt;em&gt;reset or initialize&lt;/em&gt; by using an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Conditionals.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;elisp manual - elisp conditional statements&quot;&gt;elisp conditional statement&lt;/a&gt; to dynamically set the value of the &lt;a href=&quot;http://orgmode.org/manual/session.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;org-mode : session header&quot;&gt;:session&lt;/a&gt; header on the first code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. &lt;code&gt;:session  (if (get-buffer &quot;one&quot;) (if (kill-buffer &quot;one&quot;) (print &quot;one&quot;) (print &quot;one&quot;)) (print &quot;one&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above code, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Names.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;get-buffer&lt;/a&gt; function checks if buffer named &lt;em&gt;one&lt;/em&gt; exists. If true, the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Killing-Buffers.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;elisp manual : kill-buffer&quot;&gt;kill-buffer&lt;/a&gt; function &lt;strong&gt;kills&lt;/strong&gt; the &lt;em&gt;one&lt;/em&gt; buffer then returns a value of &lt;code&gt;t&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt; which is passed to the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Conditionals.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;elisp manual - elisp conditional statements&quot;&gt;&lt;code&gt;if&lt;/code&gt;&lt;/a&gt; statement. In this specific example, the nested &lt;code&gt;if&lt;/code&gt; statement will &lt;em&gt;always return a value of one&lt;/em&gt;. Please note, I'm still learning elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is the updated example code:    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :session (if (get-buffer &quot;one&quot;) (if (kill-buffer &quot;one&quot;) (print &quot;one&quot;) (print &quot;one&quot;)) (print &quot;one&quot;)) :results output&#xA;  ssh staging&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC sh :session one :results output&#xA;  hostname&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each time the first code block is executed, emacs will ask to kill the &lt;em&gt;one buffer&lt;/em&gt;, so you can reset the session when you desire.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Oops&lt;/strong&gt; missed part that you &lt;em&gt;always&lt;/em&gt; wanted buffer killed, i.e. &lt;a href=&quot;http://www.masteringemacs.org/article/disabling-prompts-emacs&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Mastering Emacs : Disabling Prompts&quot;&gt;no prompting&lt;/a&gt;. Execute this block first to temporarily turn off prompting to kill buffer. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp&#xA;  (setq kill-buffer-query-functions&#xA;    (remq 'process-kill-buffer-query-function&#xA;           kill-buffer-query-functions))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This code was tested using the following versions of emacs and org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&#xA;Org-mode version 8.2.10 (8.2.10-29-g89a0ac-elpa)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In conclusion, I found &lt;strong&gt;technical inspiration&lt;/strong&gt; for this answer on the &lt;a href=&quot;https://eschulte.github.io/org-scraps/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;overflowing with org-mode goodness - click me already!&quot;&gt;org-scraps&lt;/a&gt; website and this &lt;a href=&quot;https://stackoverflow.com/a/23365118/951721&quot; title=&quot;kill-buffer example code&quot;&gt;kill-buffer example code&lt;/a&gt; on stackoverflow.&lt;/p&gt;&#xA;" OwnerUserId="388" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-13T04:33:29.140" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6016" PostTypeId="2" ParentId="5873" CreationDate="2015-01-04T05:31:34.777" Score="0" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;ack&lt;/code&gt; utility is better than the &lt;code&gt;grep&lt;/code&gt; utility – but &lt;code&gt;apt-get install ack&lt;/code&gt; installs a japanese kanji package! &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do this instead: Use &lt;code&gt;pkg-divert&lt;/code&gt; to force the package name to &lt;code&gt;ack&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep&#xA;apt-get install ; apt-get install ack-grep -f -y --force-yes&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For more see: &lt;a href=&quot;http://betterthangrep.com&quot; rel=&quot;nofollow&quot;&gt;http://betterthangrep.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Suggest installing the Perl App::Ack package too.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4081" LastEditorUserId="2264" LastEditDate="2015-01-04T08:05:04.203" LastActivityDate="2015-01-04T08:05:04.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6017" PostTypeId="1" AcceptedAnswerId="6018" CreationDate="2015-01-04T09:27:55.947" Score="6" ViewCount="673" Body="&lt;p&gt;In org-mode, is there a markup like LaTeX's description?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{description}&#xA;  \item[First] The first item&#xA;  \item[Second] The second item&#xA;  \item[Third] The third etc \ldots&#xA;\end{description}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sEgw9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that the items are in bold face. and if the description is longer than one line, the second line (and the following line) would be indented right. &lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2015-01-04T09:59:01.537" Title="org-mode: Is there a description markup like in LaTeX?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6018" PostTypeId="2" ParentId="6017" CreationDate="2015-01-04T09:59:01.537" Score="8" Body="&lt;p&gt;Description lists are of the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  - Keyword :: description of keyword, which may be as long as you like and &#xA;      spread over several lines&#xA;  - Header :: description of header&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These are rendered as &lt;code&gt;description&lt;/code&gt; in LaTeX export.  &lt;code&gt;org-mode&lt;/code&gt;s filling commands will correctly fill such items.  You can separate the list from other text by a blank line.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2015-01-04T09:59:01.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6019" PostTypeId="2" ParentId="5921" CreationDate="2015-01-04T16:44:33.363" Score="4" Body="&lt;p&gt;My Linux machine has the command &lt;a href=&quot;http://www.manpager.com/linux/man1/iso-info.1.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;iso-info&lt;/code&gt;&lt;/a&gt; available, which is a part of package &lt;code&gt;libcdio&lt;/code&gt;. It supports the option &lt;code&gt;-l&lt;/code&gt; which gives &lt;em&gt;output similar to 'ls -lR' for an ISO 9660 fs&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;iso-info -l some.iso&lt;/code&gt; via &lt;kbd&gt;M-!&lt;/kbd&gt; and then switch the output buffer into &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/dired-x/Virtual-Dired.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dired-virtual-mode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4083" LastActivityDate="2015-01-04T16:44:33.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6020" PostTypeId="1" AcceptedAnswerId="6044" CreationDate="2015-01-04T17:22:09.303" Score="2" ViewCount="838" Body="&lt;p&gt;How can I use the &lt;code&gt;highlight-chars.el&lt;/code&gt; package &lt;a href=&quot;http://www.emacswiki.org/emacs/ShowWhiteSpace#toc2&quot; rel=&quot;nofollow&quot;&gt;mentioned here&lt;/a&gt; (and &lt;a href=&quot;http://www.emacswiki.org/emacs/highlight-chars.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;'s its code) to highlight custom characters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I'd like to highlight the unicode &lt;a href=&quot;http://www.unicode.org/reports/tr9/#Directional_Formatting_Characters&quot; rel=&quot;nofollow&quot;&gt;directional formatting characters&lt;/a&gt; for embedding right-to-left languages in a predominantly left-to-right text and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before you say &quot;But what do you need the directional formatting characters for? The newer versions of Emacs handle bidirectional text natively.&quot;, I'd like to remind you that &lt;a href=&quot;http://www.w3.org/International/articles/inline-bidi-markup/uba-basics#embeddedbd&quot; rel=&quot;nofollow&quot;&gt;there is a reason&lt;/a&gt; why the unicode algorithm allows for explicit bidirectional markers.&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="50" LastEditDate="2015-01-06T03:13:41.480" LastActivityDate="2015-01-06T03:13:41.480" Title="How to use the highlight-chars.el package?" Tags="|faces|text-properties|highlight-chars|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6021" PostTypeId="1" AcceptedAnswerId="6023" CreationDate="2015-01-04T17:27:22.347" Score="58" ViewCount="16202" Body="&lt;p&gt;When you push a branch with Magit (with &lt;code&gt;P P&lt;/code&gt;) and the branch has no&#xA;upstream, Magit asks you the name of the branch you want to push to.&#xA;That's great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you set the upstream for a branch, however, Magit no longer asks&#xA;you where you want to push it. This is usually convenient (you don't&#xA;want to be asked every time), but it makes it difficult to push a&#xA;branch to a different remote branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to have Magit ask me again about the destination&#xA;  branch, even if the current branch already has an upstream?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Use-case&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It's quite common that I have a branch like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Local:    issue-30 ~/Git-Projects/repo/&#xA;Remote:   issue-30 @ origin (git@github.com:.../repo.git)&#xA;Head:     ebe4054 Some commit message&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to change both Local and Remote branches to &lt;code&gt;issue-30-and-34&lt;/code&gt;. If I just rename the Local branch, I'm left with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Local:    issue-30-and-34 ~/Git-Projects/repo/&#xA;Remote:   issue-30 @ origin (git@github.com:.../repo.git)&#xA;Head:     ebe4054 Some commit message&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Even if I delete &lt;code&gt;origin/issue-30&lt;/code&gt;, doing &lt;code&gt;P P&lt;/code&gt; on &lt;code&gt;issue-30-and-34&lt;/code&gt;&#xA;will simply recreate the &lt;code&gt;origin/issue-30&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I end up doing is the following, but it feels rather roundabout for something that can be done in a single &lt;code&gt;git&lt;/code&gt; command:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a new branch called &lt;code&gt;issue-30-and-34&lt;/code&gt;&#xA;(instead of renaming the old one), &lt;/li&gt;&#xA;&lt;li&gt;delete both Local and Remote versions of &lt;code&gt;issue-30&lt;/code&gt;, &lt;/li&gt;&#xA;&lt;li&gt;push &lt;code&gt;issue-30-and-34&lt;/code&gt; (since it has no upstream yet, Magit will ask me where to push).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastActivityDate="2022-12-26T21:37:49.003" Title="Change a branch's upstream with Magit" Tags="|magit|git|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6022" PostTypeId="2" ParentId="5981" CreationDate="2015-01-04T17:53:55.820" Score="2" Body="&lt;p&gt;here's a simple alternative (you can add it to your config file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-local-electric-pair-mode ()&#xA;  (make-variable-buffer-local 'electric-pair-mode)&#xA;  (electric-pair-mode +1))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook 'my-local-electric-pair-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming &lt;code&gt;electric-pair-mode&lt;/code&gt; is globally disabled (you can disable it evaluating &lt;code&gt;(electric-pair-mode -1)&lt;/code&gt;), the mode will be activated only on &lt;code&gt;emacs-lisp-mode&lt;/code&gt; buffers and nowhere else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can create similar functions for other global minor modes, such as &lt;code&gt;show-paren-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Remember to avoid enabling &lt;code&gt;electric-pair-mode&lt;/code&gt; at startup or the above code won't work!&lt;/p&gt;&#xA;" OwnerUserId="920" LastActivityDate="2015-01-04T17:53:55.820" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6023" PostTypeId="2" ParentId="6021" CreationDate="2015-01-04T18:06:38.583" Score="82" Body="&lt;p&gt;Starting with &lt;code&gt;v2.1&lt;/code&gt; you can change the upstream of the current branch to a remote or local branch using &lt;kbd&gt;b&lt;/kbd&gt;&lt;kbd&gt;u&lt;/kbd&gt;&lt;code&gt;[REMOTE/]BRANCH&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. Starting with &lt;code&gt;v2.4&lt;/code&gt;, if an upstream is already set, then &lt;kbd&gt;b&lt;/kbd&gt;&lt;kbd&gt;u&lt;/kbd&gt; will just unset it. Press &lt;kbd&gt;u&lt;/kbd&gt; again to set a new value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with &lt;code&gt;v2.4&lt;/code&gt; and if the upstream is unset, you can also set upstream while pushing by using &lt;kbd&gt;p&lt;/kbd&gt;&lt;kbd&gt;u&lt;/kbd&gt;&lt;code&gt;[REMOTE/]BRANCH&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. You'll automatically be asked what branch to use as the upstream. Once an upstream has been set &lt;kbd&gt;p&lt;/kbd&gt;&lt;kbd&gt;u&lt;/kbd&gt; will push to that without letting you change the upstream. So to &lt;em&gt;change&lt;/em&gt; the upstream, you have to use the approach described in the previous paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before &lt;code&gt;v2.4&lt;/code&gt; it was also possible to set the remote branch that you are pushing to as the upstream branch using &lt;kbd&gt;p&lt;/kbd&gt;&lt;kbd&gt;-&lt;/kbd&gt;&lt;kbd&gt;u&lt;/kbd&gt;&lt;kbd&gt;e&lt;/kbd&gt;&lt;code&gt;REMOTE/BRANCH&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. But now the &lt;code&gt;--set-upstream&lt;/code&gt; switch is no longer available in the push popup &lt;em&gt;by default&lt;/em&gt;. You can get it back by setting &lt;code&gt;magit-push-current-set-remote-if-missing&lt;/code&gt; to nil. That has two effects: the &lt;code&gt;--set-upstream&lt;/code&gt; switch will be available again after the next restart and the approach described in the previous paragraph will no longer work.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want both features described in the second and third paragraph to be available at the same time, then leave &lt;code&gt;magit-push-current-set-remote-if-missing&lt;/code&gt; untouched and add this to you init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-switch 'magit-push-popup&#xA;  ?u &quot;Set upstream&quot; &quot;--set-upstream&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2018-05-21T22:27:37.663" LastActivityDate="2018-05-21T22:27:37.663" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="6024" PostTypeId="2" ParentId="6021" CreationDate="2015-01-04T18:18:00.030" Score="11" Body="&lt;p&gt;Press &quot;&lt;code&gt;P C-u C-u P&lt;/code&gt;&quot; to make Magit ask you what remote and remote branch to use before pushing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(With a single prefix argument (&quot;&lt;code&gt;P C-u P&lt;/code&gt;&quot;) Magit asks what remote to use.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this by pressing &lt;code&gt;P C-h k P&lt;/code&gt; in a Magit status buffer, reading the docs of &lt;code&gt;magit-push&lt;/code&gt; and &lt;code&gt;magit-push-dwim&lt;/code&gt; (these docs seem to be out of date, BTW), and experimenting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I use Magit &lt;code&gt;magit-1.2.0-2049-ge6839e8&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2015-01-04T18:18:00.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6025" PostTypeId="1" AcceptedAnswerId="6026" CreationDate="2015-01-04T18:43:38.503" Score="1" ViewCount="257" Body="&lt;p&gt;By default, if I invoke emacs from terminal by typing &lt;code&gt;$ emacs C:\users&lt;/code&gt; a directory-like environment opens. Then if I do &lt;code&gt;M-x eshell&lt;/code&gt;, an eshell environment opens at this path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to directly go to this eshell from the initial terminal. I tried &lt;code&gt;$ emacs C:\users eshell&lt;/code&gt; and &lt;code&gt;$ emacs C:\users M-x eshell&lt;/code&gt; but they don't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Added: As an application of the below solution of abo-abo, on Microsoft OS, if at the path bar of your window directory, you type &lt;code&gt;emacs -f eshell&lt;/code&gt;, an &lt;code&gt;eshell&lt;/code&gt; will be opened at that directory:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gl106.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-04T19:15:19.867" LastActivityDate="2015-01-04T19:15:19.867" Title="How to use Emacs to open an eshell from Terminal at a specific path" Tags="|eshell|term|shell-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6026" PostTypeId="2" ParentId="6025" CreationDate="2015-01-04T18:45:21.977" Score="3" Body="&lt;p&gt;Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs C:\users -f eshell &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-04T18:45:21.977" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6027" PostTypeId="2" ParentId="5849" CreationDate="2015-01-04T20:55:03.503" Score="-1" Body="&lt;p&gt;The solution given by &lt;a href=&quot;https://emacs.stackexchange.com/questions/5849/regular-expression-to-match-text-within-quotes#comment8827_5849&quot;&gt;mbork&lt;/a&gt; worked fine. I had other case like &lt;code&gt;''sit amet ''&lt;/code&gt; where using &lt;code&gt;\([^']+\)&lt;/code&gt; wasn't a good idea. I decided then to build this regexp &lt;code&gt;'+(\w+) '+&lt;/code&gt; (using the Python re module through &lt;em&gt;visual-regexp-steroids&lt;/em&gt;, an Emacs extension) and my text is almost done!&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-01-04T22:19:47.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6028" PostTypeId="1" AcceptedAnswerId="6033" CreationDate="2015-01-04T22:07:29.613" Score="16" ViewCount="1763" Body="&lt;p&gt;With Magit you can open the magit status buffer, press &lt;code&gt;TAB&lt;/code&gt; to expand the diff (or &lt;code&gt;RET&lt;/code&gt; to bring up a separate diff buffer), mark parts of a hunk and press &lt;code&gt;s&lt;/code&gt; or &lt;code&gt;u&lt;/code&gt; to stage/unstage the region. Really nice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know if it's possible to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;edit a file&lt;/li&gt;&#xA;&lt;li&gt;select a region, hunk or several hunks right inside the file buffer&lt;/li&gt;&#xA;&lt;li&gt;stage/unstage the selected region or the hunk around point&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="101" LastEditorUserId="306" LastEditDate="2015-01-04T23:48:48.193" LastActivityDate="2016-12-12T12:09:23.850" Title="Git: is it possible to stage a selected region directly from the file buffer?" Tags="|magit|git|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6029" PostTypeId="1" AcceptedAnswerId="6031" CreationDate="2015-01-04T22:18:43.337" Score="9" ViewCount="3666" Body="&lt;p&gt;Is it possible to execute a function or command at a specific time? As an  explicit example, is it possible to kill emacs at a specific time (time determined by the OS).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-07-11T04:49:01.577" LastActivityDate="2015-07-11T04:49:01.577" Title="Is it possible to execute a function or command at a specific time?" Tags="|elisp|timers|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6030" PostTypeId="1" CreationDate="2015-01-04T22:42:23.573" Score="1" ViewCount="77" Body="&lt;p&gt;I have a text file, whose content is from a pdf file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to replace two letter combos, such as &quot;ﬂ&quot; and more, with the two letters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do that in Emacs just once, without repeating for each specific combo?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="306" LastEditDate="2015-01-04T23:17:23.580" LastActivityDate="2015-01-04T23:17:23.580" Title="Replace &quot;ﬂ&quot;like two-letter combo with two letters" Tags="|replace|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6031" PostTypeId="2" ParentId="6029" CreationDate="2015-01-04T23:00:51.457" Score="18" Body="&lt;p&gt;You want to use the function &lt;code&gt;run-at-time&lt;/code&gt;, described in Chapter 38.10 of the Emacs Lisp manual.  In your case, something like this should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-at-time &quot;20:30&quot; nil #'kill-emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the function you want to call takes parameters, you can specify them as additional parameters to &lt;code&gt;run-at-time&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-at-time &quot;5 sec&quot; nil #'message &quot;Tempus volat, hora fugit.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that absolute times are taken to be today, even if they are in the past, so the first example above will exit immediately if it is after 20:30.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2015-01-04T23:23:51.620" LastActivityDate="2015-01-04T23:23:51.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6032" PostTypeId="2" ParentId="6030" CreationDate="2015-01-04T23:16:07.387" Score="2" Body="&lt;p&gt;I don't think there's a built-in function to do that.  The obvious candidate would be &lt;code&gt;translate-region&lt;/code&gt;, but it uses an extremely unwieldy data structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, this is easily solved with just a little bit of ELisp hacking:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar funky-chars-alist '((?ﬂ . &quot;fl&quot;) (?ﬁ . &quot;fi&quot;)))&#xA;&#xA;(defun replace-all-funky-chars ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (while (not (eobp))&#xA;      (let ((string (cdr (assoc (char-after) funky-chars-alist))))&#xA;        (cond&#xA;          (string (delete-char 1) (insert string))&#xA;          (t (forward-char)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-01-04T23:16:07.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6033" PostTypeId="2" ParentId="6028" CreationDate="2015-01-04T23:41:11.860" Score="11" Body="&lt;p&gt;No, Magit does not support that. Future versions might though. &lt;a href=&quot;https://github.com/syohex/emacs-git-gutter&quot;&gt;Git-Gutter&lt;/a&gt; does support it now. The command is named &lt;code&gt;git-gutter:stage-hunk&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-05T00:20:17.733" LastActivityDate="2015-01-05T00:20:17.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6036" PostTypeId="1" AcceptedAnswerId="12101" CreationDate="2015-01-05T00:20:53.300" Score="1" ViewCount="561" Body="&lt;p&gt;Installing Emacs 24.4 broke my &lt;a href=&quot;https://bitbucket.org/jpsecher/haxe-mode&quot; rel=&quot;nofollow&quot; title=&quot;haxe mode&quot;&gt;haxe mode&lt;/a&gt;. The mode for the &lt;a href=&quot;http://haxe.org/&quot; rel=&quot;nofollow&quot;&gt;HaXe&lt;/a&gt; language doesn't seem to be maintained any more so I'm trying to fix it myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, I had a &lt;code&gt;cl-macroexpand-all&lt;/code&gt; problem which forced me to add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before loading the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, and that's where things get tricky, the indenting of typeful function declarations is broken (or at least that's where I think the problem is originated):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Test {&#xA;&#xA;    public function notFailingAfterThis() {&#xA;&#xA;    }&#xA;&#xA;    public function butFailingAfterThis(): Int {&#xA;&#xA;    }&#xA;&#xA;                                           public function failingHere(): Void {&#xA;&#xA;                                           }&#xA;&#xA;                                                                          public function hereEvenMore() {&#xA;&#xA;                                                                          }&#xA;        public function endOfTheFailure() {&#xA;&#xA;    }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My knowledge of Emacs lisp is too limited to find the error (if you want to test this yourself, you can download &lt;a href=&quot;https://bitbucket.org/jpsecher/haxe-mode/src&quot; rel=&quot;nofollow&quot;&gt;haxe mode's source&lt;/a&gt; and create this &lt;code&gt;Test.hx&lt;/code&gt; file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HaXe allows typeless and typeful declarations, with a syntax similar to ActionScript.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var myVar: MyVarType;&#xA;function myFunction(): MyFunctionReturnType {}&#xA;var myUntypedVar;&#xA;function myUntypedFunction() {}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to fix this, before I'm forced to make the whole plugin myself?&#xA;It seems to be a feature that put the carret at the right indenting after a carriage return, which it didn't do before I updated emacs.&lt;/p&gt;&#xA;" OwnerUserId="4088" LastEditorUserId="4088" LastEditDate="2015-01-05T08:56:56.443" LastActivityDate="2015-05-03T14:41:17.510" Title="Haxe-mode broken in Emacs 24.4" Tags="|indentation|emacs24.4|syntax-highlighting|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="6037" PostTypeId="1" AcceptedAnswerId="6043" CreationDate="2015-01-05T01:51:01.667" Score="10" ViewCount="5102" Body="&lt;p&gt;suppose I want to bind a key to a partial key sequence (i.e. a key sequence that is a prefix of some other bound keybindings).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the obvious&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-emacs prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-x&quot;) (kbd &quot;C-c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that doesn't work for some reason.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-06-25T13:32:39.890" Title="Emacs bind key to prefix" Tags="|key-bindings|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6038" PostTypeId="1" AcceptedAnswerId="7166" CreationDate="2015-01-05T02:34:15.703" Score="5" ViewCount="147" Body="&lt;p&gt;I have an Emacs mode. It has a &lt;code&gt;defgroup&lt;/code&gt; and a number of &lt;code&gt;defcustom&lt;/code&gt;s. Let's say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defgroup some-group nil&#xA;  &quot;Some group&quot;&#xA;  :prefix &quot;prefix-&quot;&#xA;  :group 'languages)&#xA;&#xA;(defcustom some-option-1 t&#xA;  &quot;Option 1&quot;&#xA;  :tag &quot;Option 1?&quot;&#xA;  :type 'boolean&#xA;  :group 'some-group)&#xA;&#xA;(defcustom some-option-2 t&#xA;  &quot;Option 2&quot;&#xA;  :tag &quot;Option 2?&quot;&#xA;  :type 'boolean&#xA;  :group 'some-group)&#xA;&#xA;(defcustom some-option-3 t&#xA;  &quot;Option 3&quot;&#xA;  :tag &quot;Option 3?&quot;&#xA;  :type 'boolean&#xA;  :group 'some-group)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All works fine, except the order in which these appear in the Customize buffer shown by &lt;code&gt;M-x customize&lt;/code&gt; is not the order the &lt;code&gt;defcustom&lt;/code&gt;s appear in the source, or alphabetically by their identifier, or alphabetically by their &lt;code&gt;:tag&lt;/code&gt; -- or any other pattern I've been able to figure out so far. For example the options above might end up in the UI as 3, 1, 2. But I'd like them to appear as 1, 2, 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same seems true for the order of sub-groups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can make them appear in an order that I specify, and if so, how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This with Emacs 24.3, in case that's relevant.)&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="105" LastEditDate="2015-01-05T06:36:44.263" LastActivityDate="2015-01-08T13:39:24.917" Title="Specify the order in which `defcustom`s are presented in the Customize UI?" Tags="|customize|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="6039" PostTypeId="1" AcceptedAnswerId="6040" CreationDate="2015-01-05T03:42:20.010" Score="0" ViewCount="126" Body="&lt;p&gt;The &lt;code&gt;allout&lt;/code&gt; mode document says,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We recommend customizing &lt;code&gt;allout-command-prefix&lt;/code&gt; to use just &lt;code&gt;\C-c&lt;/code&gt; as&#xA;  the command prefix, if the allout bindings don't conflict with any&#xA;  personal bindings you have on &lt;code&gt;\C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't like to &lt;code&gt;customize&lt;/code&gt; the variable, but like to configure it instead (I think &lt;code&gt;\C-c\C-c&lt;/code&gt; is a better option). How can I do that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the suggested solution like the following in my init, and it works great.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-allout-mode-hook ()&#xA;      (setq allout-command-prefix (kbd &quot;C-c C-c&quot;))&#xA;      )&#xA;&#xA;    (add-hook 'allout-mode-hook 'my-allout-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another question, how to enable the &lt;code&gt;allout&lt;/code&gt; minor mode on Emacs starts for all modes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="4089" LastEditDate="2015-01-06T01:43:25.967" LastActivityDate="2015-01-06T01:43:25.967" Title="How to redefine the allout prefix keybinding" Tags="|key-bindings|customize|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6040" PostTypeId="2" ParentId="6039" CreationDate="2015-01-05T05:21:04.850" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq allout-command-prefix (kbd &quot;C-c C-c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know nothing about &lt;code&gt;use-package&lt;/code&gt;, so I'll leave that part to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-c&lt;/code&gt; is almost certainly going to conflict with other things. It's a &lt;em&gt;very&lt;/em&gt; common binding for taking some kind of action in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can safely use &lt;code&gt;C-c &amp;lt;letter&amp;gt;&lt;/code&gt; for any upper- or lower-case letter. Those sequences are reserved for end-users.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Another question, how to enable the allout minor mode on Emacs starts for all modes?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can create a global version of the minor mode like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-turn-on-allout-mode-maybe ()&#xA;  &quot;Enable `allout-mode', where applicable.&quot;&#xA;  ;; Unconditional here, but edit as desired if it turns out&#xA;  ;; that you don't actually want this for ALL modes.&#xA;  ;; (This function is called in every buffer, when the&#xA;  ;; global mode is enabled.)&#xA;  (allout-mode 1))&#xA;&#xA;(define-globalized-minor-mode my-global-allout-mode allout-mode&#xA;  my-turn-on-allout-mode-maybe&#xA;  :group 'allout)&#xA;&#xA;(my-global-allout-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(but you should really post separate questions &lt;strong&gt;as&lt;/strong&gt; separate questions.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-01-05T05:47:47.103" LastActivityDate="2015-01-05T05:47:47.103" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="6041" PostTypeId="2" ParentId="6037" CreationDate="2015-01-05T05:23:21.170" Score="2" Body="&lt;p&gt;&lt;strong&gt;OPTION # 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key &quot;\C-x\C-x&quot;)&#xA;&#xA;(global-set-key (kbd &quot;C-x C-x C-c&quot;) 'help-for-help)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OPTION # 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example is taken from:  &lt;code&gt;.../lisp/textmodes/page-ext.el&lt;/code&gt; and modified slightly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key &quot;\C-x\C-x&quot;)&#xA;&#xA;(defvar ctl-x-ctl-x-map (make-sparse-keymap)&#xA;  &quot;Keymap for subcommands of C-x C-x, which are for PythonNut.&quot;)&#xA;&#xA;(define-key ctl-x-map &quot;\C-x&quot; 'ctl-x-ctl-x-prefix)&#xA;(fset 'ctl-x-ctl-x-prefix ctl-x-ctl-x-map)&#xA;&#xA;(define-key ctl-x-ctl-x-map &quot;\C-c&quot; 'help-for-help)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example creating &lt;code&gt;C-z&lt;/code&gt; as a new global prefix key&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key &quot;\C-z&quot;)&#xA;&#xA;(defalias 'ctl-z-keymap (make-sparse-keymap))&#xA;(defvar ctl-z-map (symbol-function 'ctl-z-keymap)&#xA;  &quot;Global keymap for characters following C-z.&quot;)&#xA;(define-key global-map &quot;\C-z&quot; 'ctl-z-keymap)&#xA;&#xA;(define-key ctl-z-map &quot;\C-c&quot; 'help-for-help)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-01-05T05:57:28.613" LastActivityDate="2015-01-05T05:57:28.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6042" PostTypeId="2" ParentId="5616" CreationDate="2015-01-05T05:30:36.483" Score="9" Body="&lt;pre&gt;&lt;code&gt;(setq erc-join-buffer 'bury)&#xA;&#xA;erc-join-buffer is a variable defined in `erc.el'.&#xA;Its value is bury&#xA;PDocumentation:&#xA;Determines how to display a newly created IRC buffer.&#xA;&#xA;The available choices are:&#xA;&#xA;  'window          - in another window,&#xA;  'window-noselect - in another window, but don't select that one,&#xA;  'frame           - in another frame,&#xA;  'bury            - bury it in a new buffer,&#xA;  'buffer          - in place of the current buffer,&#xA;  any other value  - in place of the current buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="279" LastActivityDate="2015-01-05T05:30:36.483" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6043" PostTypeId="2" ParentId="6037" CreationDate="2015-01-05T06:49:36.727" Score="8" Body="&lt;p&gt;If you want to no longer have the prefix key be a prefix key, and you want to instead bind it to a single command, you can do that - no problem: just bind it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to have the prefix key act as both a single command and as a prefix key then that is of course impossible - a key is bound to either a command or a keymap (or to a command that is a keymap).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you want to bind a different prefix key to the same keymap that is bound to some other prefix key, that is not a problem. What you tried to do suggests that this is maybe what you really want: to &lt;em&gt;make the key sequence &lt;code&gt;C-x C-x&lt;/code&gt; act as a prefix key the same way that &lt;code&gt;C-c&lt;/code&gt; does&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do that, you bind &lt;code&gt;C-x C-x&lt;/code&gt; not to &lt;code&gt;C-c&lt;/code&gt; but to the binding of &lt;code&gt;C-c&lt;/code&gt;. &lt;code&gt;(lookup-key global-map (kbd &quot;C-c&quot;))&lt;/code&gt; tells you that &lt;code&gt;C-c&lt;/code&gt; is bound to command &lt;code&gt;mode-specific-command-prefix&lt;/code&gt; (which is in fact a keymap). So if you bind &lt;code&gt;C-x C-x&lt;/code&gt; to that then it will behave like &lt;code&gt;C-c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-x&quot;) (lookup-key global-map (kbd &quot;C-c&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or just:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-x&quot;) 'mode-specific-command-prefix)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:32:12.867" LastActivityDate="2015-05-09T20:32:12.867" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="6044" PostTypeId="2" ParentId="6020" CreationDate="2015-01-05T06:59:16.737" Score="3" Body="&lt;p&gt;@Malabarba's comment provides the answer. Try it interactively: &lt;code&gt;M-x hc-highlight-chars&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works for me. I use &lt;code&gt;C-x 8 RET LEFT-TO-RIGHT EMBEDDING RET&lt;/code&gt; to insert character LRE (U+202A) in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I use &lt;code&gt;M-x hc-highlight-chars&lt;/code&gt;, and at the prompt I enter the same character (the same way: &lt;code&gt;C-x 8 RET LEFT-TO-RIGHT EMBEDDING RET&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I hit &lt;code&gt;RET&lt;/code&gt; again to tell it that there are no more chars to highlight. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I enter the face to use for the highlighting (e.g. &lt;code&gt;highlight&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I see a tiny vertical bar of highlighting, where the LRE char is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use it from Lisp code instead of interactively, of course.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="253" LastEditDate="2015-01-05T15:35:05.863" LastActivityDate="2015-01-05T15:35:05.863" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6045" PostTypeId="1" AcceptedAnswerId="6057" CreationDate="2015-01-05T12:48:35.397" Score="12" ViewCount="1244" Body="&lt;p&gt;In TeXStudio by hitting &lt;kbd&gt;ALT&lt;/kbd&gt;+&lt;kbd&gt;DEL&lt;/kbd&gt; in a LaTeX macro like this &lt;code&gt;\macroname{content}&lt;/code&gt; while the cursor stands just before the first &lt;code&gt;{&lt;/code&gt; will result in deleting all that except its &lt;code&gt;content&lt;/code&gt; (as shown below).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7oC1o.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;&#xA;Put the cursor (point) just before the first curly bracket:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/E8RWN.png&quot; alt=&quot;enter image description here&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;kbd&gt;ALT&lt;/kbd&gt;+&lt;kbd&gt;DEL&lt;/kbd&gt; and you get:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FXWIE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to achieve this in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;According to T.Verron's clarification there is a problem with &lt;code&gt;C-c C-f C-d&lt;/code&gt; as it complains from error of unbalanced parenthesis when executed within some macros in LaTeX. Consider the below example:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/RaDkK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;throws this error: &#xA; &lt;code&gt;up-list: Scan error: &quot;Unbalanced parentheses&quot;, 8074, 1&lt;/code&gt;. \textenglish{} belongs to polyglossia package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to get rid of this caveat?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-01-05T17:56:16.753" LastActivityDate="2016-02-02T17:51:27.980" Title="How to delete a LaTeX macro while preserving its text content?" Tags="|latex|auctex|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6046" PostTypeId="2" ParentId="6045" CreationDate="2015-01-05T12:53:49.040" Score="9" Body="&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/auctex_19.html&quot;&gt;AUCTeX manual node on Changing the&#xA;font&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-c C-f C-d&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Delete the innermost font specification containing point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-05T12:53:49.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6048" PostTypeId="1" AcceptedAnswerId="6050" CreationDate="2015-01-05T13:09:34.537" Score="0" ViewCount="245" Body="&lt;p&gt;The unix &lt;code&gt;tree&lt;/code&gt; command gives a very good overview of the project/dir structure. Even Windows has its own version of &lt;code&gt;tree&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run &lt;code&gt;tree&lt;/code&gt; command in &lt;code&gt;eshll&lt;/code&gt; on Windows, I got this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ tree&#xA;Spawning child process: exec format error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that &lt;code&gt;eshell&lt;/code&gt; doesn't support the system (Windows) command. What should I do? Or is there any implementations for &lt;code&gt;eshell&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2015-01-05T13:44:50.907" Title="tree command in eshell on Windows" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6049" PostTypeId="1" AcceptedAnswerId="6072" CreationDate="2015-01-05T13:12:51.567" Score="3" ViewCount="1396" Body="&lt;p&gt;Have you ever used conky? More precisely Crunchbang Linux? Crunchbang comes with conky installed by default on desktop and inside conky you'll see  useful shortcuts that you can use, and it's visible all the time. See shortcut keys section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/n6ZIi.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm an emacs newbie, not new to emacs, I use it all the time when doing lisp but I  don't do lisp that much, I spend most of the time using sublime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So still emacs newbie and would be helpful if I can have such menu displayed all the time in a little corner inside the text editor. It should take no more than 10% of the screen or so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there such  plugin or option allowing me to display the shortcuts?&lt;/p&gt;&#xA;" OwnerUserId="4079" LastActivityDate="2023-11-28T18:50:21.460" Title="Display emacs shortcuts inside emacs, like conky" Tags="|key-bindings|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="6050" PostTypeId="2" ParentId="6048" CreationDate="2015-01-05T13:44:50.907" Score="3" Body="&lt;p&gt;&lt;code&gt;tree&lt;/code&gt; is not a command built into &lt;code&gt;eshell&lt;/code&gt;. If you run the command &lt;code&gt;which tree&lt;/code&gt; you'll find that it's running the Windows version of &lt;code&gt;tree&lt;/code&gt;, which it seems gives &lt;code&gt;eshell&lt;/code&gt; some problems in its output format. Try downloading GNU &lt;code&gt;tree&lt;/code&gt; for Windows from the project GnuWin32 &lt;a href=&quot;http://gnuwin32.sourceforge.net/packages/tree.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-05T13:44:50.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6051" PostTypeId="1" AcceptedAnswerId="7136" CreationDate="2015-01-05T15:15:06.107" Score="4" ViewCount="1926" Body="&lt;p&gt;How do you configure the indentation to work correctly for tcsh shell scripts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am unable to make the indentation work correctly when I use the shell-script-mode as it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem: An indentation of 4 spaces is inserted when I hit enter (when there shouldn't be any indentation!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to reproduce this problem?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Open &lt;code&gt;\emacs -q&amp;amp;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;#!/bin/tcsh -f&lt;/code&gt; in an empty buffer and save it as something like &lt;code&gt;a.csh&lt;/code&gt; so that the &lt;code&gt;shell-script-mode&lt;/code&gt; is auto-loaded.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you hit enter at the end of this first and only line, the buffer converts from&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/tcsh -f (no indentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    #!/bin/tcsh -f (with indentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am on the stable 24.4 version of emacs.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-05T15:40:22.447" LastActivityDate="2016-11-04T18:40:56.267" Title="Fixing forced indentation in shell-script-mode for tcsh" Tags="|indentation|shell-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6052" PostTypeId="1" AcceptedAnswerId="6061" CreationDate="2015-01-05T15:52:24.380" Score="6" ViewCount="644" Body="&lt;p&gt;I would like to set the glyph of a certain unicode character. Specifically, I would like the glyph § (&lt;a href=&quot;http://www.fileformat.info/info/unicode/char/00a7/index.htm&quot; rel=&quot;nofollow&quot;&gt;SECTION SIGN&lt;/a&gt;) to represent the unicode character U+202A (&lt;a href=&quot;http://www.unicode.org/reports/tr9/#Explicit_Directional_Embeddings&quot; rel=&quot;nofollow&quot;&gt;LEFT-TO-RIGHT EMBEDDING&lt;/a&gt;), a normally non-visible character, in the main buffer. However, this glyph assignment must be confined to the main buffer; in particular, it must not be used when printing the document as a PDF file.&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="50" LastEditDate="2015-01-06T02:31:51.517" LastActivityDate="2015-05-09T20:31:51.357" Title="How to set the glyph of a unicode character?" Tags="|fonts|text-properties|display|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6053" PostTypeId="1" AcceptedAnswerId="6054" CreationDate="2015-01-05T16:58:28.640" Score="3" ViewCount="151" Body="&lt;p&gt;For a while, I was building prerelease versions of 24.4. One of the features that I liked was that when I used &lt;code&gt;string-rectangle&lt;/code&gt; (via &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;r&lt;/kbd&gt; &lt;kbd&gt;t&lt;/kbd&gt;), the string that I was typing showed up live in the buffer. This let me see what I was changing in context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I upgraded to the release version of 24.4, that functionality disappeared. I gave a quick look at &lt;code&gt;rect.el&lt;/code&gt;, but I didn't see any appropriate variables that might help. Is there a way of enabling this feature again?&lt;/p&gt;&#xA;" OwnerUserId="4099" LastEditorUserId="105" LastEditDate="2015-08-12T14:39:22.133" LastActivityDate="2015-08-12T14:39:22.133" Title="How can I make `string-rectangle` show the changes I'm about to make to the buffer?" Tags="|emacs24.4|rectangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6054" PostTypeId="2" ParentId="6053" CreationDate="2015-01-05T17:22:58.353" Score="5" Body="&lt;p&gt;Perhaps the prerelease versions you were building had the version number 24.4.50?  That means that they're actually prerelease versions of 24.5, which was later renamed to 25.1 (but still not released at the time of this writing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, you actually &lt;em&gt;downgraded&lt;/em&gt; to the release version of 24.4, and thus lost this feature.  I'm currently running 25.0.50, and this feature is available to me and mentioned in the NEWS file as a new feature in 25.1.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-05T17:22:58.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6055" PostTypeId="1" CreationDate="2015-01-05T18:20:23.513" Score="0" ViewCount="157" Body="&lt;p&gt;I've been running into a problem with Helm recently with &lt;code&gt;ispell&lt;/code&gt;. If I run &lt;code&gt;ispell-change-dictionary&lt;/code&gt; first to set the dictionary, I can't figure out how to run &lt;code&gt;ispell&lt;/code&gt; afterward through &lt;code&gt;helm-M-x&lt;/code&gt;. The problem is that &lt;code&gt;ispell-change-dictionary&lt;/code&gt; shows up in the &lt;code&gt;Emacs Commands History&lt;/code&gt; section, and I can't figure out how to get down to the &lt;code&gt;Emacs Commands&lt;/code&gt; list below that. &lt;code&gt;C-n&lt;/code&gt; just moves within the commands history and never moves down.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-01-05T18:20:23.513" Title="Switch sections in Helm" Tags="|helm|" AnswerCount="0" CommentCount="3" ClosedDate="2015-01-05T21:39:17.760" ContentLicense="CC BY-SA 3.0" />
  <row Id="6056" PostTypeId="2" ParentId="6049" CreationDate="2015-01-05T19:24:21.213" Score="3" Body="&lt;p&gt;Sounds like you're looking for &lt;a href=&quot;https://github.com/kai2nenobu/guide-key&quot; rel=&quot;nofollow&quot;&gt;Guide Key&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also worth noting that there is also `describe-prefix-bindings' command accessible throughout emacs if you follow the prefix with &lt;kbd&gt;F1&lt;/kbd&gt; or &lt;kbd&gt;C-h&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="279" LastEditorUserId="2710" LastEditDate="2015-01-05T20:21:14.380" LastActivityDate="2015-01-05T20:21:14.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6057" PostTypeId="2" ParentId="6045" CreationDate="2015-01-05T19:30:57.547" Score="11" Body="&lt;p&gt;Try this function:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mg-TeX-delete-current-macro (&amp;amp;optional arg)&#xA;  &quot;Remove the current macro.&#xA;With an optional argument ARG, delete just the ARG-th macro&#xA;starting from the innermost.&quot;&#xA;  (interactive &quot;*p&quot;)&#xA;  (let (macro end)&#xA;    (when &#xA;    (dotimes (i arg macro)&#xA;      (goto-char (TeX-find-macro-start))&#xA;      (setq macro (TeX-current-macro)&#xA;        end (TeX-find-macro-end))&#xA;      ;; If we need to look for an outer macro we have to &quot;exit&quot; from the&#xA;      ;; current one.&#xA;      (backward-char))&#xA;      ;; Return to the beginning of the macro to be deleted.&#xA;      (forward-char)&#xA;      (re-search-forward&#xA;       (concat (regexp-quote TeX-esc) macro &quot;\\(?:\\[[^]]*\\]\\)?&quot;&#xA;           TeX-grop &quot;\\(\\(.\\|\n\\)*\\)&quot;)&#xA;       end t)&#xA;      (replace-match &quot;\\1&quot;)&#xA;      ;; Delete the closing brace.&#xA;      (delete-backward-char 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Limitation: doesn't work with verbatim-like macros.  This function will throw an error (&lt;code&gt;Wrong type argument: integer-or-marker-p, nil&lt;/code&gt;) if the universal argument is greater than the number of macros enclosing point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bind the function to your favorite shortcut.  For example&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;tex&quot;&#xA;  '(local-set-key (kbd &quot;M-DEL&quot;) 'mg-TeX-delete-current-macro))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to bind it it &lt;kbd&gt;M-DEL&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your buffer has (&lt;code&gt;!&lt;/code&gt; is point)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\onemacro{\anothermacro{!argument}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then &lt;kbd&gt;C-2 M-DEL&lt;/kbd&gt; will give you&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\anothermacro{argument}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2016-02-02T17:51:27.980" LastActivityDate="2016-02-02T17:51:27.980" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="6058" PostTypeId="5" CreationDate="2015-01-05T21:00:30.253" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://emacswiki.org/emacs/ERC&quot; rel=&quot;nofollow&quot;&gt;ERC&lt;/a&gt; is an IRC client for Emacs. &lt;/p&gt;&#xA;" OwnerUserId="149" LastEditorUserId="253" LastEditDate="2015-01-05T21:40:56.750" LastActivityDate="2015-01-05T21:40:56.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6059" PostTypeId="4" CreationDate="2015-01-05T21:00:30.253" Score="0" Body="ERC is an Emacs IRC client." OwnerUserId="149" LastEditorUserId="149" LastEditDate="2015-01-05T21:39:34.347" LastActivityDate="2015-01-05T21:39:34.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6060" PostTypeId="1" AcceptedAnswerId="6064" CreationDate="2015-01-05T21:06:04.227" Score="2" ViewCount="1472" Body="&lt;p&gt;Because the &lt;code&gt;allout.el&lt;/code&gt; is standard a library, rather than an optional ELPA package, to enable the it (allout minor mode) on Emacs starts for all modes can be as simple as creating a global version of the minor mode like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-turn-on-allout-mode-maybe ()&#xA;  &quot;Enable `allout-mode', where applicable.&quot;&#xA;  ;; Unconditional here, but edit as desired if it turns out&#xA;  ;; that you don't actually want this for ALL modes.&#xA;  ;; (This function is called in every buffer, when the&#xA;  ;; global mode is enabled.)&#xA;  (allout-mode 1))&#xA;&#xA;(define-globalized-minor-mode my-global-allout-mode allout-mode&#xA;  my-turn-on-allout-mode-maybe&#xA;  :group 'allout)&#xA;&#xA;(my-global-allout-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;thanks to phils' answer from &lt;a href=&quot;https://emacs.stackexchange.com/questions/6039/how-to-redefine-the-allout-prefix-keybinding/&quot;&gt;How to redefine the allout prefix keybinding&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I have two questions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question #1&lt;/strong&gt;, suppose, just suppose, because I don't know emacs well to give another good example, that allout-mode is a minor mode from ELPA that I installed myself. How to enable it in this case? Would the above still be good? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main confusing is about timing. From &lt;a href=&quot;http://www.emacswiki.org/emacs/ELPA#toc6&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/ELPA#toc6&lt;/a&gt;, it says,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Whenever Emacs starts up, it automatically calls the function ‘package-initialize’ to load installed packages. This is done &lt;strong&gt;after&lt;/strong&gt; loading the init file... So packages are initialized &lt;em&gt;AFTER&lt;/em&gt; the init.el is loaded. This means you should NOT put package specific initialization into your init.el except...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So if the installed packages are loaded &lt;strong&gt;after&lt;/strong&gt; loading the init file, then how can I enable them in the init file, when the package is not loaded yet? Would the above still be good? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I meant, once the ELPA packages are installed locally, they would behave exactly like any other locally available library (either from system or from person libs), right? They normally would be &lt;em&gt;require&lt;/em&gt;d, which means loading a package if it has not already been loaded. The system library are normally &lt;em&gt;autoload&lt;/em&gt;ed, which means loading a file only when a function is called. I don't think the ELPA packages cannot be autoloaded, correct? So my anwser would be, the above will still be good, is that correct? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question #2&lt;/strong&gt;, now that with above code I've turn the minor mode into a global  mode, how to disable it for a specific mode, say markdown-mode? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tired this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package markdown-mode&#xA;  :mode (&quot;\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.\\)&quot; . gfm-mode)&#xA;  :init&#xA;  (progn&#xA;    (flyspell-mode 1)&#xA;    (allout-mode -1)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the allout-mode is still on when I open a markdown file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;UPDATE&lt;/em&gt;, for the record, for all my questions, I gather all the answers to &lt;a href=&quot;https://github.com/suntong001/emacs.d&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-01-11T14:51:45.073" Title="How do I enable allout minor mode on Emacs starts up" Tags="|init-file|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6061" PostTypeId="2" ParentId="6052" CreationDate="2015-01-05T21:10:46.353" Score="6" Body="&lt;p&gt;What you want to do is to set the display-table entry for character &lt;code&gt;LEFT-TO-RIGHT EMBEDDING&lt;/code&gt; to the glyph that is used for character &lt;code&gt;SECTION SIGN&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(aset (or (window-display-table)  standard-display-table)&#xA;      8234 ; 0x202A, which is the char LEFT-TO-RIGHT EMBEDDING&#xA;      (vector (make-glyph-code ?§)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the selected window has its own display table, then update that. If not, update the standard display table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also put a face on that section-symbol glyph, if you like. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(aset (or (window-display-table)  standard-display-table)&#xA;      8234&#xA;      (vector (make-glyph-code ?§ 'escape-glyph)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:31:51.357" LastActivityDate="2015-05-09T20:31:51.357" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6062" PostTypeId="2" ParentId="6049" CreationDate="2015-01-05T21:25:39.150" Score="3" Body="&lt;p&gt;FWIW, A similar feature to guide-key is that provided by &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Key_Completion&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;key completion&lt;/em&gt;&lt;/a&gt;. You can see all of the keys currently available to you.&lt;/p&gt;&#xA;&lt;p&gt;After you type a prefix key, you see, for example, only the possible keys that continue from there.&lt;/p&gt;&#xA;&lt;p&gt;You can use completion against the key names or the associated command names, to finish entering a key and so invoke a command.&lt;/p&gt;&#xA;&lt;p&gt;By default, key completion is on-demand (via &lt;code&gt;S-TAB&lt;/code&gt;), but you could make it always visible if you wanted (e.g., after a short delay, as for guide-key).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="14424" LastEditDate="2023-11-28T18:50:21.460" LastActivityDate="2023-11-28T18:50:21.460" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="6063" PostTypeId="1" CreationDate="2015-01-05T21:25:40.030" Score="4" ViewCount="655" Body="&lt;p&gt;I'm open to suggestions relating to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;org-mode&lt;/li&gt;&#xA;&lt;li&gt;calendar&lt;/li&gt;&#xA;&lt;li&gt;calc&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I recently learned that the calculator seems to have a basic way of doing it with a list of excluded days (by default Saturday and Sunday), but I don't know how to connect the pieces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The holiday list I'd be using is the generic US holiday list.&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="61" LastEditDate="2015-01-06T23:25:35.837" LastActivityDate="2015-01-07T06:32:47.083" Title="How can I find the date ten business days into the past from today?" Tags="|calendar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6064" PostTypeId="2" ParentId="6060" CreationDate="2015-01-05T22:00:36.613" Score="3" Body="&lt;p&gt;&quot;Package&quot; refers explicitly to ELPA packages, which are installed via the package manager (e.g. &lt;code&gt;M-x package-list-packages&lt;/code&gt;, &lt;code&gt;M-x package-install&lt;/code&gt;, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;allout.el&lt;/code&gt; library appears to be standard issue, rather than an optional ELPA package, and &lt;code&gt;allout-mode&lt;/code&gt; itself is autoloaded on-demand, so you should be able to use that code anywhere in your init file. Packages are not involved here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding additional Q1, please refer to the Q&amp;amp;A that Dan already pointed you to in the comments: &lt;a href=&quot;https://stackoverflow.com/questions/11127109/emacs-24-package-system-initialization-problems&quot;&gt;https://stackoverflow.com/questions/11127109/emacs-24-package-system-initialization-problems&lt;/a&gt;. The accepted answer to that question will forcibly initialise the package system if you place it in your init file (prior to any code which uses a package). Then you can stop worrying about the timing of package initialisation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The autoload declarations for ELPA packages aren't known to Emacs until package initialisation has taken place, so regardless of whether a package provides autoloaded functions or not, you can't call those functions before package initialisation. Autoloading simply means that you don't also need to &lt;code&gt;require&lt;/code&gt; (or otherwise explicitly load) a library if there are known autoload declarations for the functions you are calling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your additional Q2 was, of course, why I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-turn-on-allout-mode-maybe ()&#xA;  &quot;Enable `allout-mode', where applicable.&quot;&#xA;  ;; Unconditional here, but edit as desired if it turns out&#xA;  ;; that you don't actually want this for ALL modes.&#xA;  ;; (This function is called in every buffer, when the&#xA;  ;; global mode is enabled.)&#xA;  (allout-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which you can change to something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-turn-on-allout-mode-maybe ()&#xA;  &quot;Enable `allout-mode', where applicable.&quot;&#xA;  ;; (This function is called in every buffer, when the&#xA;  ;; global mode is enabled.)&#xA;  (unless (memq major-mode '(markdown-mode some-other-mode a-third-mode))&#xA;    (allout-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-01-11T09:06:51.163" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="6065" PostTypeId="1" CreationDate="2015-01-05T22:25:02.823" Score="4" ViewCount="5586" Body="&lt;p&gt;By default &lt;code&gt;display-time-mode&lt;/code&gt; shows the time only in minutes. How I can display time in seconds? Something like &lt;code&gt;18:34:45&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="50" LastEditDate="2015-01-06T02:26:41.380" LastActivityDate="2021-12-23T12:33:04.120" Title="How to display time in seconds in the mode line?" Tags="|mode-line|time-date|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6067" PostTypeId="1" CreationDate="2015-01-05T23:07:10.450" Score="9" ViewCount="3396" Body="&lt;p&gt;I'm trying to use &lt;code&gt;org-checklist&lt;/code&gt;. The &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-checklist.html&quot;&gt;documentation&lt;/a&gt; says that I should 'Ensure the org contrib directory is in load-path'. Where is the contrib directory?&lt;/p&gt;&#xA;" OwnerUserId="4104" LastEditorUserId="253" LastEditDate="2015-01-05T23:38:12.563" LastActivityDate="2015-01-06T18:32:53.843" Title="Where is the org contrib directory?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6068" PostTypeId="2" ParentId="6067" CreationDate="2015-01-05T23:33:37.020" Score="9" Body="&lt;p&gt;Checking out the git version of Org, it's in &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/contrib&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;./contrib&lt;/code&gt;&lt;/a&gt;.  To install contrib, you could use &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;noreferrer&quot;&gt;Org ELPA&lt;/a&gt;.  As pointed out by Erik, you should get the &lt;code&gt;org-plus-contrib&lt;/code&gt; package from Org ELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also use a git-checkout, see &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;Keeping Current&lt;/em&gt;&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/worg/dev/org-build-system.html&quot; rel=&quot;noreferrer&quot;&gt;more on installing Org&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2015-01-06T18:32:53.843" LastActivityDate="2015-01-06T18:32:53.843" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6069" PostTypeId="2" ParentId="6067" CreationDate="2015-01-05T23:36:48.123" Score="3" Body="&lt;p&gt;The location of the &lt;code&gt;contrib&lt;/code&gt; directory depends on where you have &lt;code&gt;org-mode&lt;/code&gt; installed.  A simple way to tell is to &lt;code&gt;M-x find-library RET org-contribdir&lt;/code&gt;.  The commentary from the latter:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The sole purpose of this file is to be located in the same place&#xA;  as where the contributed Org files are located, typically in the&#xA;  contrib/lisp directory of the Org-mode distribution.  This is to&#xA;  make sure that the command `org-reload' can reliably locate&#xA;  contributed org files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-05T23:36:48.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6070" PostTypeId="1" AcceptedAnswerId="27619" CreationDate="2015-01-05T23:47:01.170" Score="1" ViewCount="552" Body="&lt;p&gt;Let us assume to run the following commands creating links in the Windows prompt (terminal):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; mkdir fooDir&#xA;&amp;gt; echo hello&amp;gt; fooDir\foo&#xA;&amp;gt; mklink /d fooDirSym fooDir&#xA;&amp;gt; mklink /j fooDirJunc fooDir&#xA;&amp;gt; mklink /h fooDir\fooHard fooDir\foo&#xA;&amp;gt; cd fooDir&#xA;&amp;gt; mklink fooSym foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Moving to Emacs, this works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file-truename &quot;path/to/fooDir/fooSym&quot;)&#xA;    =&amp;gt; &quot;path/to/fooDir/foo&quot;&#xA;(file-nlinks &quot;path/to/fooDir/foo&quot;)&#xA;    =&amp;gt; 2 (#o2, #x2, ?\C-b)&#xA; ;; The second name should be fooDir/fooHard&#xA;(file-truename &quot;c:/p/fooDirSym&quot;)&#xA;    =&amp;gt; &quot;path/to/fooDir&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file-truename &quot;path/to/fooDirJunc&quot;)&#xA;    =&amp;gt; &quot;path/to/fooDirJunc&quot;&#xA;(file-nlinks &quot;path/to/fooDir/&quot;)&#xA;    =&amp;gt; 1 (#o1, #x1, ?\C-a)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A Windows junction is not counted as a hard link (and in fact it is a soft link) and it is not a symlink.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The questions now are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we identify the pathnames (not only the number) of hard links to foo?&lt;br&gt;&#xA;How do we identify the presence and the path of  junctions? &lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="253" LastEditDate="2015-01-06T00:06:19.073" LastActivityDate="2016-11-05T22:29:17.523" Title="Hard and soft links (junctions) under Windows" Tags="|files|microsoft-windows|symbolic-links|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6071" PostTypeId="2" ParentId="6065" CreationDate="2015-01-06T00:03:34.910" Score="7" Body="&lt;p&gt;The top of the &lt;a href=&quot;http://www.emacswiki.org/emacs/DisplayTime&quot; rel=&quot;noreferrer&quot;&gt;EmacsWiki page on Display Time&lt;/a&gt; tells you how to control the format of the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of the three variables, it looks like &lt;code&gt;display-time-format&lt;/code&gt; is the most relevant after inspecting the docstrings of the variables with &lt;code&gt;C-h v display-time-format&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;String specifying format for displaying the time in the mode line.&#xA;  See the function &lt;code&gt;format-time-string&lt;/code&gt; for an explanation of&#xA;  how to write this string.  If this is &lt;code&gt;nil&lt;/code&gt;, the defaults&#xA;  depend on &lt;code&gt;display-time-day-and-date&lt;/code&gt; and &lt;code&gt;display-time-24hr-format&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, as @lawlist suggested, you can figure out how to set up the string by looking at the docstring for the function &lt;code&gt;format-time-string&lt;/code&gt;, although there are too many options to list here.  However, you're probably interested in &lt;code&gt;%I&lt;/code&gt;, &lt;code&gt;%M&lt;/code&gt;, and &lt;code&gt;%S&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;%H is the hour on a 24-hour clock, %I is on a 12-hour clock, %k is like %H&#xA;   only blank-padded, %l is like %I blank-padded.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;%p is the locale's equivalent of either AM or PM.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;%M is the minute.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;%S is the second.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you can either use the customize interface to set &lt;code&gt;display-time-format&lt;/code&gt;, or you can do so directly with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-time-format &quot;%I:%M:%S&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I doubt you're going to be happy with this functionality.  From the Emacs manual on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Basics.html&quot; rel=&quot;noreferrer&quot;&gt;mode line basics&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;For efficiency, Emacs does not continuously recompute each window's mode line and header line.&lt;/strong&gt; It does so when circumstances appear to call for it—for instance, if you change the window configuration, switch buffers, narrow or widen the buffer, scroll, or modify the buffer.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, you're not going to get a seconds counter in your mode line.  When, after open Emacs with no init file (&lt;code&gt;emacs -Q&lt;/code&gt;), I enable &lt;code&gt;display-time-mode&lt;/code&gt; and set up the &lt;code&gt;display-time-format&lt;/code&gt; as above, the mode-line updates as the seconds turn over to &lt;code&gt;00&lt;/code&gt; and not every second.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-01-06T13:27:35.407" LastActivityDate="2015-01-06T13:27:35.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6072" PostTypeId="2" ParentId="6049" CreationDate="2015-01-06T01:50:23.077" Score="8" Body="&lt;p&gt;&lt;em&gt;As @Dan asked me to write up my comment to an aswer:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I've done once to achieve what you want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use an already existing &lt;a href=&quot;https://i.stack.imgur.com/UBCYP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs cheatsheet&lt;/a&gt; or a customized one, as your desktop wallpaper. And whenever you need to use Emacs, launch it inside a terminal with a transparent background (using Crunchbang, it should be easy). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, what about edit the Conky configuration and add the Emacs shortcuts besides the already displayed ones?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, and already stated by the others, you may be interested by &lt;a href=&quot;https://github.com/kai2nenobu/guide-key&quot; rel=&quot;nofollow noreferrer&quot;&gt;guide-key&lt;/a&gt;. This package will automatically pops up the keys following your favorite prefixes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7q66R.png&quot; alt=&quot;guide-key demo&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-01-06T01:50:23.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6073" PostTypeId="1" CreationDate="2015-01-06T02:34:08.037" Score="3" ViewCount="692" Body="&lt;p&gt;I'm following the instruction at &#xA;&lt;a href=&quot;http://www.emacswiki.org/emacs/AllOut#toc3&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/AllOut#toc3&lt;/a&gt;&#xA;to have the &lt;code&gt;allout&lt;/code&gt; mode fontify its headers (enclosed below). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works but the existing major mode's fontifying effort would be gone. Is it possible to have them both? &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar rf-allout-font-lock-keywords&#xA;  '(;;&#xA;    ;; Highlight headings according to the level.&#xA;    (eval . (list (concat &quot;^\\(&quot; outline-regexp &quot;\\).+&quot;)&#xA;        0 '(or (cdr (assq (outline-depth)&#xA;                  '((1 . font-lock-function-name-face)&#xA;                    (2 . font-lock-variable-name-face)&#xA;                    (3 . font-lock-keyword-face)&#xA;                    (4 . font-lock-builtin-face)&#xA;                    (5 . font-lock-comment-face)&#xA;                    (6 . font-lock-constant-face)&#xA;                    (7 . font-lock-type-face)&#xA;                    (8 . font-lock-string-face))))&#xA;               font-lock-warning-face)&#xA;        nil t)))&#xA;  &quot;Additional expressions to highlight in Outline mode.&quot;)&#xA;&#xA;;; add font-lock to allout mode&#xA;(defun rf-allout-font-lock-hook ()&#xA;  (set (make-local-variable 'font-lock-defaults)&#xA;       '(rf-allout-font-lock-keywords t nil nil outline-back-to-current-heading)))&#xA;&#xA;(add-hook 'outline-mode-hook 'rf-allout-font-lock-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="675" LastEditDate="2016-07-15T02:06:10.177" LastActivityDate="2016-07-15T02:06:10.177" Title="How to add more fontify rules" Tags="|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6074" PostTypeId="2" ParentId="6051" CreationDate="2015-01-06T03:33:07.480" Score="2" Body="&lt;p&gt;By default, emacs 24.4 turns on &lt;code&gt;electric-indent-mode&lt;/code&gt; which makes it indent automatically. Disable it and you won't have that problem anymore:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-change-major-mode-hook (lambda() (electric-indent-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I set &lt;code&gt;newline-and-indent&lt;/code&gt; to &lt;kbd&gt;RET&lt;/kbd&gt; globally and have no problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-01-06T03:38:41.207" LastActivityDate="2015-01-06T03:38:41.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6075" PostTypeId="1" AcceptedAnswerId="6076" CreationDate="2015-01-06T04:30:04.060" Score="3" ViewCount="437" Body="&lt;p&gt;How do you tell &lt;code&gt;display-buffer-alist&lt;/code&gt; to not display a buffer whose name has a particular string in it? The &quot;Display Action Functions&quot; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html#Display-Action-Functions&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; mentions &lt;code&gt;display-buffer-no-window&lt;/code&gt;. However, I don't see this in the list of available functions when trying to customize &lt;code&gt;display-buffer-alist&lt;/code&gt; through &lt;code&gt;M-x customize-variable&lt;/code&gt;. The options I see are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0 = --&#xA;1 = display-buffer-reuse-window&#xA;2 = display-buffer-pop-up-window&#xA;3 = display-buffer-same-window&#xA;4 = display-buffer-pop-up-frame&#xA;5 = display-buffer-use-some-window&#xA;6 = Other function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Choosing &quot;Other function&quot; and manually specifying &lt;code&gt;display-buffer-no-window&lt;/code&gt; doesn't work either - that function does not exist. I am using emacs 24.3.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="50" LastEditDate="2015-01-10T01:36:09.117" LastActivityDate="2015-01-10T01:36:09.117" Title="Prevent buffer from being displayed" Tags="|buffers|window|display-buffer-alist|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6076" PostTypeId="2" ParentId="6075" CreationDate="2015-01-06T04:43:56.170" Score="7" Body="&lt;p&gt;It was added in Emacs 24.4:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun display-buffer-no-window (_buffer alist)&#xA;  &quot;Display BUFFER in no window.&#xA;If ALIST has a non-nil `allow-no-window' entry, then don't display&#xA;a window at all.  This makes possible to override the default action&#xA;and avoid displaying the buffer.  It is assumed that when the caller&#xA;specifies a non-nil `allow-no-window' then it can handle a nil value&#xA;returned from `display-buffer' in this case.&quot;&#xA;  (when (cdr (assq 'allow-no-window alist))&#xA;    'fail))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should always use the documentation built into Emacs if you want to know about the version you're actually using (and personally I recommend using it regardless). The online documentation is always for the latest release.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-01-06T04:43:56.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6077" PostTypeId="1" AcceptedAnswerId="7510" CreationDate="2015-01-06T08:35:11.170" Score="2" ViewCount="994" Body="&lt;p&gt;I want to set PAGER to &lt;code&gt;cat&lt;/code&gt; in shell-mode. For eshell I just add a hook with &lt;code&gt;setenv&lt;/code&gt;. Unfortunately it doesn't seem to work for shell-mode, setenv doesn't set env variable. Is there other way to redefine shell-defined variables (which may be set in ~/.zshrc, so it needs to be redefined after shell is launched and rc file is sourced).&#xA;I'm using following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my--shell-mode-hook ()&#xA;  (setenv &quot;PAGER&quot; &quot;cat&quot;)&#xA;  (setenv &quot;EDITOR&quot; &quot;emacsclient&quot;)&#xA;  (setenv &quot;BAR&quot; &quot;bar&quot;)&#xA;  (message &quot;%s&quot; (getenv &quot;BAR&quot;))&#xA;  )&#xA;&#xA;(add-hook 'shell-mode-hook 'my--shell-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run &lt;code&gt;M-x shell&lt;/code&gt; string &quot;bar&quot; is displayed in the messages buffer, so var is being set in emacs. But in shell itself it is not set, neither existing variables are reset:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ineu@rei ~ $ env | grep -i -e pager -e editor -e bar&#xA;env | grep -i -e pager -e editor -e bar&#xA;EDITOR=subl3 -w&#xA;PAGER=less&#xA;GIT_EDITOR=emacsclient&#xA;ineu@rei ~ $&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4096" LastEditorUserId="4096" LastEditDate="2015-01-06T13:42:06.553" LastActivityDate="2015-01-18T20:52:34.063" Title="setenv in shell-mode" Tags="|shell-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6078" PostTypeId="1" CreationDate="2015-01-06T09:44:30.233" Score="3" ViewCount="902" Body="&lt;p&gt;I used to run Emacs on Linux using Emacsclient, it is really easy and great experience:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon&#xA;emacsclient&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I work on a Windows machine, Emacs starts very slow. It seems there's no default support for emacsclient. So I decide to use the &lt;code&gt;use-package&lt;/code&gt; package to reduce Emacs startup time. Since there're several packages, I'd like to know which cost the most startup time, and load it with &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am not in the right direction, please correct me.&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="4106" LastEditDate="2015-01-06T11:43:14.100" LastActivityDate="2015-01-06T16:56:56.990" Title="Is it possible to figure out which package/script takes most of the startup time?" Tags="|emacsclient|microsoft-windows|server|use-package|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6079" PostTypeId="2" ParentId="6052" CreationDate="2015-01-06T10:13:47.027" Score="0" Body="&lt;p&gt;Thanks to Drew's answer and to jch's comment, I've added the following lines to the beginning of my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless standard-display-table&#xA;    (setq standard-display-table (make-display-table))&#xA;)&#xA;(unless (aref standard-display-table #x202a)    (aset standard-display-table #x202a (vector (make-glyph-code #x22c9 'escape-glyph)))&#xA;)&#xA;(unless (aref standard-display-table #x202b)&#xA;    (aset standard-display-table #x202b (vector (make-glyph-code #x22ca 'escape-glyph)))&#xA;)&#xA;(unless (aref standard-display-table #x202c)&#xA;    (aset standard-display-table #x202c (vector (make-glyph-code #x22c8 'escape-glyph)))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4084" LastActivityDate="2015-01-06T10:13:47.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6080" PostTypeId="1" CreationDate="2015-01-06T10:46:31.297" Score="2" ViewCount="122" Body="&lt;p&gt;I set the coding as &lt;code&gt;utf-8&lt;/code&gt;, and I got many &lt;code&gt;^M&lt;/code&gt; from &lt;code&gt;eshell&lt;/code&gt; on Windows. There's &lt;code&gt;utf-8-dos&lt;/code&gt; and &lt;code&gt;utf-8-unix&lt;/code&gt;. I would like to use the same configuration file on both unix and Windows. I guess there are many people work on the two system from time to time. How do you handle this?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="780" LastEditDate="2015-01-06T15:39:47.227" LastActivityDate="2015-01-06T15:39:47.227" Title="What coding system should I use for one Emacs configurations for both unix and Windows?" Tags="|microsoft-windows|character-encoding|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="6081" PostTypeId="2" ParentId="6078" CreationDate="2015-01-06T11:09:16.637" Score="1" Body="&lt;p&gt;This is based on Emacs 24.4.1 (KAEL) on Windows 7 from the &lt;a href=&quot;http://sourceforge.net/projects/emacsbinw64&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-w64 project&lt;/a&gt;, but should work on other releases of the same major version.&#xA;Add this to your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;server&quot;)&#xA;(unless (server-running-p) (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will run the server if it's not running; taken from &lt;a href=&quot;https://stackoverflow.com/a/7131683/183120&quot;&gt;here&lt;/a&gt;. If you're using cygwin/msys/msys2 then you could add this to your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;edit_file() {&#xA;        emacsclient -nqa &quot;runemacs.exe&quot; $1 &amp;amp;&#xA;}&#xA;&#xA;alias edit=edit_file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or do the equivalent in a batch script for &lt;code&gt;cmd&lt;/code&gt;. Now all you've to do is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;edit 1.txt   # will start the server, if it's not running&#xA;edit 2.txt   # will send a request to the server to open this file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The explanation part is that &lt;code&gt;emacsclient&lt;/code&gt; would run &lt;code&gt;runemacs.exe&lt;/code&gt; if a server is not running; &lt;code&gt;-q&lt;/code&gt; would be to silence it's success message. &lt;code&gt;-n&lt;/code&gt; is to not wait for server to return; if not for &lt;code&gt;-n&lt;/code&gt;, &lt;a href=&quot;http://wikemacs.org/index.php/Emacs_server#Finishing_Up&quot; rel=&quot;nofollow noreferrer&quot;&gt;you should clean up&lt;/a&gt; the buffer using &lt;code&gt;server-edit&lt;/code&gt; and not the usual &lt;code&gt;kill-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One additional point is that, if you want to use &lt;code&gt;emacsclient.exe&lt;/code&gt; from GUI instead of CLI/TUI then use &lt;code&gt;emacsclientw.exe&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4106" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-06T11:15:27.997" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="6082" PostTypeId="1" AcceptedAnswerId="6085" CreationDate="2015-01-06T11:40:08.547" Score="4" ViewCount="947" Body="&lt;p&gt;I use &lt;code&gt;visual-regexp&lt;/code&gt; to make query regexp search. Consider this text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5xpbc.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;code&gt;\enquote{\Large{text1}} \enquote{\Large{text2}} \enquote{\Large{text3}} \enquote{\Large{text4}}&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want regexp to match every and single macro group (the 4 groups). I invoke a query regexp by &lt;code&gt;C-c q&lt;/code&gt; and entered this regexp:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\(\\Large{\)\(.?+\)\(}\)\(}\)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem is that it returned one match instead of 4 matches:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/UoGEu.png&quot; alt=&quot;enter image description here&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the &lt;code&gt;\(.?+\)&lt;/code&gt; was very greedy to match all 4 macro groups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, when I get each of the 4 groups in its own line I get the desired effect:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/f6qZG.png&quot; alt=&quot;enter image description here&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I could do replace with: &lt;code&gt;\2\4&lt;/code&gt; to get the desired result:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/tC0Da.png&quot; alt=&quot;enter image description here&quot;&gt;   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what I was missing when all were on the same line?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plus, can you please recommend any good documentation on using regexp/grep in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-01-06T12:34:23.600" LastActivityDate="2015-01-06T12:52:18.513" Title="How to make this RegExp less greedy?" Tags="|regular-expressions|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6083" PostTypeId="1" AcceptedAnswerId="7503" CreationDate="2015-01-06T11:45:26.900" Score="52" ViewCount="9144" Body="&lt;p&gt;There's a question on SO about splitting hunks using magit, and the two solutions given are to either stage the region (mark a region, hit stage), or to shrink/grow all hunks using &lt;code&gt;+&lt;/code&gt; &amp;amp; &lt;code&gt;-&lt;/code&gt;. That's not what I'm after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In magit's status buffer, I want to split a hunk into two hunks, at the point, or at least at the lines around the point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turning this (excuse my bad diff formatting)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@@ blah blah blah&#xA;- foo&#xA;+ bar&#xA;+ baz&#xA;+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@@ blah blah&#xA;- foo&#xA;+ bar&#xA;&#xA;@ blah blah&#xA;+ baz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the point is on bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Motivations:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;baz&lt;/code&gt; being a debug statement, so I'd like to drop it from the commit of &lt;code&gt;foo&lt;/code&gt; &amp;amp; &lt;code&gt;bar&lt;/code&gt; without getting rid of it. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;bar&lt;/code&gt; and &lt;code&gt;baz&lt;/code&gt; being only partially related, meaning that their changes should not be in the same commit.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;bar&lt;/code&gt; is large and &lt;code&gt;baz&lt;/code&gt; is small, making it a lot easier to split the hunk rather than select &lt;code&gt;bar&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Similar to the last point, say a 20 line commit contains a single line the middle that should not be staged. It'd be easier to split &amp;amp; stage the top and bottom two hunks ignoring the middle one than use the region.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The above can arise sometimes when the diff presentation will separate the before and after of something that's been modified, and have something unhelpful in the middle. e.g.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@@ line&#xA;- old_foo&#xA;+ random stuff&#xA;+ new foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="503" LastEditorUserId="25" LastEditDate="2016-06-09T11:24:13.513" LastActivityDate="2020-07-15T22:08:16.277" Title="Magit split hunk into two hunks" Tags="|magit|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6084" PostTypeId="2" ParentId="6082" CreationDate="2015-01-06T11:51:01.047" Score="4" Body="&lt;p&gt;You want to match &quot;Large, opening brace, anything but a closing brace, the closing brace&quot;.  This is the corresponding regexp&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\\\Large{[^}]*}&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the regexp would be more complicated if the argument of &lt;code&gt;\Large&lt;/code&gt; has groups (i.e. braces) itself.  TeXnical note: &lt;code&gt;\Large&lt;/code&gt; is a declaration, must not be used as a command with arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;re-builder&lt;/code&gt; is very handy to practice regexp searches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the documentation, the starting point is the Elisp manual: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html#Regular-Expressions&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html#Regular-Expressions&lt;/a&gt; (or &lt;code&gt;(info &quot;(elisp)Regular expressions&quot;)&lt;/code&gt; in Emacs)&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-01-06T11:51:01.047" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6085" PostTypeId="2" ParentId="6082" CreationDate="2015-01-06T12:52:18.513" Score="6" Body="&lt;p&gt;you could use non greedy &lt;code&gt;+&lt;/code&gt; like &lt;code&gt;\(\\Large{\)\(.+?\)\(}\)\(}\)&lt;/code&gt; (note the inversion of the &lt;code&gt;?&lt;/code&gt; and the &lt;code&gt;+&lt;/code&gt;) if you add a &lt;code&gt;?&lt;/code&gt; after a &lt;code&gt;+&lt;/code&gt; the &lt;code&gt;+&lt;/code&gt; will match the smaller match possible. Note also that &lt;code&gt;.?+&lt;/code&gt; is the same as &lt;code&gt;.*&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2237" LastActivityDate="2015-01-06T12:52:18.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6086" PostTypeId="1" AcceptedAnswerId="6088" CreationDate="2015-01-06T12:54:57.627" Score="4" ViewCount="406" Body="&lt;p&gt;Assume that in the current buffer there is some text like &lt;code&gt;http://emacs.stackexchange.com/&lt;/code&gt;. Is it possible to customize Emacs so that double clicking on this text, results in visiting the link by the deafult browser? (i.e., like hyperref in LaTeX).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-06T13:01:06.683" LastActivityDate="2015-01-06T17:02:12.063" Title="Double click on a web link results in visiting the link in the default browser" Tags="|url|web-browser|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6087" PostTypeId="1" AcceptedAnswerId="6090" CreationDate="2015-01-06T13:03:01.443" Score="6" ViewCount="6171" Body="&lt;p&gt;I work on a Mac 10.9.5 and use Emacs 24.4 (installed with macports). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is related to &lt;a href=&quot;https://stackoverflow.com/questions/27778836/customizing-emacs-open-new-files-tabs-and-properly-storing-back-up-files?noredirect=1#comment43984459_27778836&quot;&gt;https://stackoverflow.com/questions/27778836/customizing-emacs-open-new-files-tabs-and-properly-storing-back-up-files?noredirect=1#comment43984459_27778836&lt;/a&gt; .There I was advised to split the &quot;whole-question&quot; into different questions, and also post it here, so here is the 1st of 3 emacs related questions, , hopefully in a better format and in a more adequate stack exchange. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;open an empty, brand new file in a new Emacs window, from terminal.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;at the moment, when I type in my terminal (or XQuartz), for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;emacs new.py &amp;amp;&#xA;The file ~/new.py does not exist.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which, effectively, does not exist, but I would like Emacs to open an empty file called new.py. Of course, I can always get around by typing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;emacs &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then start coding and save it as new.py. I simply would like to be able to do that from terminal. Also, once emacs is open, if I type &lt;code&gt;&amp;gt;emacs&amp;amp;&lt;/code&gt; on terminal, I &quot;land&quot; in the file already open and I have to do : &lt;code&gt;Cmd-N + C-x C-f&lt;/code&gt; to open a brand new file. So my first question is: Is there something to be added to my .emacs file so I open a brand new file from terminal?&lt;/p&gt;&#xA;" OwnerUserId="4103" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2018-03-30T23:44:47.650" Title="Open an empty, brand new file in a new Emacs window, from terminal" Tags="|init-file|buffers|osx|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="6088" PostTypeId="2" ParentId="6086" CreationDate="2015-01-06T14:04:18.007" Score="3" Body="&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;ffap&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; does what you want (will be requested a confirmation though).  You can bind it to double mouse click with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [double-mouse-1] 'ffap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As the name suggests, &lt;code&gt;ffap&lt;/code&gt; finds files at point, not just URLs.  If you want a function tailored to URLs look at the builtin &lt;code&gt;browse-url&lt;/code&gt; package (as &lt;a href=&quot;https://emacs.stackexchange.com/questions/6086/double-click-on-a-web-link-results-in-visiting-the-link-in-the-default-browser/6088?noredirect=1#comment9316_6086&quot;&gt;suggested&lt;/a&gt; by Dan), which also lets you choose the browser to use.  If you prefer &lt;code&gt;browse-url&lt;/code&gt;, replace &lt;code&gt;ffap&lt;/code&gt; with &lt;code&gt;browse-url&lt;/code&gt; (or &lt;code&gt;browse-url-at-point&lt;/code&gt; if you don't want to be prompted for confirmation, &lt;a href=&quot;https://emacs.stackexchange.com/questions/6086/double-click-on-a-web-link-results-in-visiting-the-link-in-the-default-browser/6088?noredirect=1#comment9348_6088&quot;&gt;thanks glucas&lt;/a&gt;!)  in the previous code to bind it to double click event.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-01-06T17:02:12.063" LastActivityDate="2015-01-06T17:02:12.063" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6089" PostTypeId="1" AcceptedAnswerId="46448" CreationDate="2015-01-06T14:40:13.077" Score="2" ViewCount="114" Body="&lt;p&gt;I generally like &lt;code&gt;show-trailing-whitespace&lt;/code&gt;. But it's distracting in shell/REPL modes, where for instance completion may leave a trailing space (e.g. &lt;code&gt;ls foo&lt;/code&gt; &lt;kbd&gt;TAB&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; in &lt;code&gt;shell-mode&lt;/code&gt;). Plus I'm not git- or diff-ing the contents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I came up with for my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Show trailing whitespace in most modes...&#xA;(setq-default show-trailing-whitespace t)&#xA;;; ...except I don't like that in comint-modes (shells/REPLs), because&#xA;;; completion sometimes leaving a trailing space that's distracting to&#xA;;; have highlighted, and anyway I'm not git- or diff-ing the contents.&#xA;(add-hook 'comint-mode-hook&#xA;          (lambda () (setq show-trailing-whitespace nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell this is working fine. But I wonder if someone more-experienced might say, &quot;The problem with doing it that way is X&quot;, or, &quot;The idiomatic way to do that instead is Y&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I realize this might border on being an opinion or &quot;best way&quot; type of question. So I apologize in advance if it's not appropriate. But knowing the answer would help me, and maybe some other folks.)&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="1979" LastEditDate="2018-12-08T23:53:20.527" LastActivityDate="2018-12-08T23:53:20.527" Title="Idiom to default a setting for most modes, except specific others?" Tags="|init-file|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="6090" PostTypeId="2" ParentId="6087" CreationDate="2015-01-06T14:50:02.390" Score="2" Body="&lt;p&gt;I suspect this has to do with the way Emacs is being packaged as an OS X GUI app (MacPorts) and called via an alias. I'm not on an OS X machine at the moment but it looks like the arguments you are passing from the shell are being processed by the OS X &lt;code&gt;open&lt;/code&gt;command rather than Emacs itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wiki page here &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsForMacOS#toc20&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/EmacsForMacOS#toc20&lt;/a&gt; suggests that what you want to do is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;open -a /Applications/MacPorts?Emacs.app &amp;lt;file-name&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A potentially nicer option would be to start the Emacs GUI app and call &lt;code&gt;(server-start)&lt;/code&gt; (say, in your init file) to start a server. Then you can use &lt;code&gt;emacsclient&lt;/code&gt; from the shell when you want to open something. Take a look at the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server&quot; rel=&quot;nofollow&quot;&gt;Emacs Server&lt;/a&gt; manual page for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For future readers who don't skim the comments below, @Javier solved the problem by defining his own &lt;code&gt;emacs&lt;/code&gt; alias to call the app directly, e.g. in .tcshr&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias emacs  /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-01-06T15:28:37.510" LastActivityDate="2015-01-06T15:28:37.510" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6091" PostTypeId="1" CreationDate="2015-01-06T14:52:43.617" Score="2" ViewCount="830" Body="&lt;p&gt;When I switch buffers using helm, the first option is prefixed with &lt;code&gt;[?]&lt;/code&gt; and tries to create a buffer named exactly what I typed. I find that this is the right behavior for creating files, but it is annoying for switching buffers. I'd prefer the first choice be one of the existing buffers. Can I make the &lt;code&gt;[?]&lt;/code&gt; appear as the last option in the list instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZPtL6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/quFks.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-02-06T19:41:33.553" Title="how to tell helm switch-to-buffer to make new buffer option last?" Tags="|helm|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6092" PostTypeId="1" AcceptedAnswerId="6093" CreationDate="2015-01-06T15:20:08.390" Score="11" ViewCount="1444" Body="&lt;p&gt;How can I find out what my AUCTeX version is? I have Googled this question to no avail.&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="253" LastEditDate="2015-01-06T15:38:25.997" LastActivityDate="2015-01-06T15:56:57.260" Title="How to find out what my AUCTeX version is?" Tags="|auctex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6093" PostTypeId="2" ParentId="6092" CreationDate="2015-01-06T15:30:14.100" Score="14" Body="&lt;p&gt;It is contained in the &lt;code&gt;AUCTeX-version&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h v AUCTeX-version RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-01-06T15:30:14.100" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6097" PostTypeId="1" AcceptedAnswerId="6098" CreationDate="2015-01-06T15:46:35.947" Score="1" ViewCount="62" Body="&lt;p&gt;Inspired by the question &lt;a href=&quot;https://emacs.stackexchange.com/q/3618/2609&quot;&gt;Launch emacs with ediff-files (of ediff-directories) from command line&lt;/a&gt; and the answer &lt;a href=&quot;https://emacs.stackexchange.com/a/3623/2609&quot;&gt;https://emacs.stackexchange.com/a/3623/2609&lt;/a&gt;, I tried &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacs --eval '(set-background-color &quot;green&quot;)'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from an MS DOS prompt without sucess. What is wrong with this? I also tried with the argument &lt;code&gt;-Q&lt;/code&gt; but it doesn't change.&#xA;I should mention that it works well if I execute it from an eshell inside emacs.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-01-06T15:51:53.380" Title="How to invoke Emacs from MS DOS prompt with a function with argument?" Tags="|microsoft-windows|invocation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6098" PostTypeId="2" ParentId="6097" CreationDate="2015-01-06T15:51:53.380" Score="2" Body="&lt;p&gt;DOS does not recognize &lt;code&gt;' '&lt;/code&gt; as quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have to use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &quot;(set-background-color \&quot;green\&quot;)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Powershell works a little closer to what you expect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(set-background-color \&quot;green\&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it too requires &lt;code&gt;\&lt;/code&gt; before the &lt;code&gt;&quot;&lt;/code&gt; to properly escape them.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-01-06T15:51:53.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6099" PostTypeId="2" ParentId="2284" CreationDate="2015-01-06T15:53:45.757" Score="0" Body="&lt;p&gt;Perhaps the easiest way is to convert table to org-mode's table, and then convert it back. Here's the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;&#xA;(setq save-y-or-n-p nil)&#xA;&#xA;(defadvice table-re-indent (around always-yes)&#xA;  (fset 'save-y-or-n-p (symbol-function 'y-or-n-p))&#xA;  (fset 'y-or-n-p (lambda (s) t))&#xA;  ad-do-it&#xA;  (fset 'y-or-n-p (symbol-function 'save-y-or-n-p)))&#xA;&#xA;(defun table-re-indent ()&#xA;  &quot;Put the point in the table and call this function&quot;&#xA;  (interactive)&#xA;  (org-table-create-with-table.el)&#xA;  (org-table-create-with-table.el))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use it put the point in the table and call &lt;code&gt;M-x table-re-indent&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="115" LastEditDate="2015-08-04T21:16:04.127" LastActivityDate="2015-08-04T21:16:04.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6100" PostTypeId="2" ParentId="6092" CreationDate="2015-01-06T15:56:57.260" Score="3" Body="&lt;p&gt;If you installed AUCTeX from ELPA (which I generally recommend), then &lt;code&gt;M-x list-packages&lt;/code&gt; will give you that information (the good thing about this method, is that it works for all packages installed from ELPA).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-01-06T15:56:57.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6101" PostTypeId="1" CreationDate="2015-01-06T16:06:28.673" Score="1" ViewCount="163" Body="&lt;p&gt;I am using a Mac 10.9.5 and Emacs 24.4, installed with macports and aliased as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias emacs  /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At the moment, when I have an emacs file open and I hit &lt;code&gt;Cmd-N&lt;/code&gt;, emacs opens a replicate of the file already open. I am wondering if there is a way to modify the .emacs file so I can open new, Untitled empty files by using &lt;code&gt;Cmd-N&lt;/code&gt;, like when using Aquamacs or MacVim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, when using aquamacs or MacVim, &lt;code&gt;Cmd-T&lt;/code&gt; opens a new, Untitled tab next to the already existing (see screen capture attached&lt;img src=&quot;https://i.stack.imgur.com/bpQey.png&quot; alt=&quot;enter image description here&quot;&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my emacs window, &lt;code&gt;cmd-T&lt;/code&gt; opens the font menu. Is there a way to get &lt;code&gt;cmd-T&lt;/code&gt; to behave in Emacs as in MacVim or aquamacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your time!&lt;/p&gt;&#xA;" OwnerUserId="4103" LastEditorUserId="2055" LastEditDate="2016-02-09T16:30:09.967" LastActivityDate="2016-02-09T16:30:09.967" Title="Using cmd-N and cmd-T with emacs" Tags="|init-file|buffers|osx|tabs|" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="6102" PostTypeId="2" ParentId="5932" CreationDate="2015-01-06T16:16:50.313" Score="7" Body="&lt;p&gt;If you break latex doc into several files you can still work with the whole project just fine in emacs, all you need is to set the master file in &lt;em&gt;each&lt;/em&gt; file you &lt;code&gt;include&lt;/code&gt;. For this put the following at the top line of each file you include:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% -*- TeX-master: &quot;dissertation.tex&quot; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(assuming your master file is called &lt;code&gt;dissertation.tex&lt;/code&gt;). This way you get, for example, a working table of contents with &lt;code&gt;C-c =&lt;/code&gt; and, I think, build with &lt;code&gt;C-c C-f&lt;/code&gt; will work too. (personally I prefer including a &lt;code&gt;build.bash&lt;/code&gt; or &lt;code&gt;build.py&lt;/code&gt; file in every large project, so I don't use auctex-mode's build scripts)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more nice binding for this work flow is &lt;code&gt;C-c ^&lt;/code&gt; which switches you to master file buffer.&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-01-06T17:29:18.503" LastActivityDate="2015-01-06T17:29:18.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="6103" PostTypeId="2" ParentId="6078" CreationDate="2015-01-06T16:56:56.990" Score="6" Body="&lt;p&gt;Since you said you are already using &lt;code&gt;use-package&lt;/code&gt;, you can turn on its own verbose option that reports how long each package takes to load.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;customize-option use-package-verbose&lt;/code&gt; or put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq use-package-verbose t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then restart Emacs and check your &lt;code&gt;*Messages*&lt;/code&gt; buffer. The output will look something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading package dash...done (0.015s)&#xA;Loading package ido...done (0.109s)&#xA;Loading package company...done (0.125s)&#xA;Loading package elisp-slime-nav...done (0.047s)&#xA;Loading package smart-mode-line...done (0.046s)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default times are reported that are longer than 0.01 seconds. You can change this threshold too, see &lt;code&gt;use-package-minimum-reported-time&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-06T16:56:56.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6104" PostTypeId="1" AcceptedAnswerId="6107" CreationDate="2015-01-06T17:30:41.217" Score="13" ViewCount="6289" Body="&lt;p&gt;This question has been asked at superuser &lt;a href=&quot;https://superuser.com/questions/462492/is-there-a-way-to-reload-environment-variables-in-emacs&quot;&gt;is-there-a-way-to-reload-environment-variables-in-emacs&lt;/a&gt;, but no good solution was given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using EmacsClient with often more than 30 buffers open, if I change an environment variable in the shell, I need to exit EmacsClient ( and reopen all the buffers) or I have to manually set the environment variable also in Emacs. I find it annoying that I cannot update the environment variables easily in Emacs. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="-1" LastEditDate="2017-03-20T10:04:44.717" LastActivityDate="2015-06-17T17:55:25.060" Title="Reload environment variables" Tags="|emacsclient|environment|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6105" PostTypeId="1" CreationDate="2015-01-06T18:02:08.153" Score="5" ViewCount="2979" Body="&lt;p&gt;I tried the following settings in order to work &lt;code&gt;M-x diary-mail-entries&lt;/code&gt; but it fails. My question is how to put the correct settings in order to be able to work with  &lt;code&gt;M-x diary-mail-entries&lt;/code&gt; in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-full-name &quot;My name&quot;)&#xA;(setq user-mail-address &quot;my_user_name@gmail.com&quot;)&#xA;&#xA;(setq send-mail-function 'smtpmail-send-it&#xA;message-send-mail-function 'smtpmail-send-it&#xA;smtpmail-starttls-credentials&#xA;'((&quot;smtp.gmail.com&quot; 587 nil nil))&#xA;smtpmail-auth-credentials&#xA;(expand-file-name &quot;~/.authinfo&quot;)&#xA;smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA;smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA;smtpmail-smtp-service 587&#xA;smtpmail-debug-info t)&#xA;(require 'smtpmail)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sending via mail...&#xA;gnutls.c: [1] (Emacs) GnuTLS library not found&#xA;530 5.7.0 Must issue a STARTTLS command first. u9sm80344949wjy.37 - gsmtp&#xA;221 2.0.0 closing connection u9sm80344949wjy.37 - gsmtp&#xA;smtpmail-send-it: Sending failed: 530 5.7.0 Must issue a STARTTLS command first. u9sm80344949wjy.37 - gsmtp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-06T18:14:11.517" LastActivityDate="2015-01-06T18:55:31.417" Title="How to set proper smtp Gmail settings in Emacs in order to be able to work with `M-x diary-mail-entries`" Tags="|email|diary|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6106" PostTypeId="2" ParentId="6104" CreationDate="2015-01-06T18:14:48.973" Score="9" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt; provides the &lt;code&gt;exec-path-from-shell-copy-env&lt;/code&gt; command, which lets you copy the value of environment variables to Emacs sessions.  For instance, &lt;code&gt;M-x exec-path-from-shell-copy-env RET FOO&lt;/code&gt; sets the value of &lt;code&gt;$FOO&lt;/code&gt; in Emacs as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;exec-path-from-shell-copy-env&lt;/code&gt; spawns a &lt;strong&gt;new&lt;/strong&gt; shell to extract the value of the environment variable.  Hence it will only work for variables that you set in your shell configuration files (e.g. &lt;code&gt;.bashrc&lt;/code&gt;), but not for variables only set in a running shell session with &lt;code&gt;export&lt;/code&gt;.  Extracting these variables is generally impossible without convoluted hacks that inspect &lt;code&gt;/proc/&lt;/code&gt; or similar API for running processes.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-01-06T18:14:48.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6107" PostTypeId="2" ParentId="6104" CreationDate="2015-01-06T18:26:59.383" Score="6" Body="&lt;p&gt;As a workaround, the following can be used (Linux, Bash):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First run &lt;code&gt;printenv -0 &amp;gt; env.txt&lt;/code&gt; from the Bash terminal window,&lt;/li&gt;&#xA;&lt;li&gt;Then from within Emacs, run&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-update-env ()&#xA;  (interactive)&#xA;  (let ((str &#xA;         (with-temp-buffer&#xA;           (insert-file-contents &quot;env.txt&quot;)&#xA;           (buffer-string))) lst)&#xA;    (setq lst (split-string str &quot;\000&quot;))&#xA;    (while lst&#xA;      (setq cur (car lst))&#xA;      (when (string-match &quot;^\\(.*?\\)=\\(.*\\)&quot; cur)&#xA;        (setq var (match-string 1 cur))&#xA;        (setq value (match-string 2 cur))&#xA;        (setenv var value))&#xA;      (setq lst (cdr lst)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I turns out that this can be done more elegantly using the &lt;code&gt;--eval&lt;/code&gt; option of the &lt;code&gt;emacsclient&lt;/code&gt; command: Define a Bash script &lt;code&gt;update_emacs_env&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#! /bin/bash&#xA;&#xA;fn=tempfile&#xA;printenv -0 &amp;gt; &quot;$fn&quot; &#xA;emacsclient -s server_name -e '(my-update-env &quot;'&quot;$fn&quot;'&quot;)' &amp;gt;/dev/null&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;server_name&lt;/code&gt; is your Emacs server name, and &lt;code&gt;my-update-env&lt;/code&gt; is a function defined by your &lt;code&gt;~/.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-update-env (fn)&#xA;  (let ((str &#xA;         (with-temp-buffer&#xA;           (insert-file-contents fn)&#xA;           (buffer-string))) lst)&#xA;    (setq lst (split-string str &quot;\000&quot;))&#xA;    (while lst&#xA;      (setq cur (car lst))&#xA;      (when (string-match &quot;^\\(.*?\\)=\\(.*\\)&quot; cur)&#xA;        (setq var (match-string 1 cur))&#xA;        (setq value (match-string 2 cur))&#xA;        (setenv var value))&#xA;      (setq lst (cdr lst)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can simply type &lt;code&gt;update_emacs_env&lt;/code&gt; from the shell command line to update the Emacs environment variables..&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-01-06T20:23:46.993" LastActivityDate="2015-01-06T20:23:46.993" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6108" PostTypeId="2" ParentId="6105" CreationDate="2015-01-06T18:55:31.417" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;smtpmail-send-it: Sending failed: 530 5.7.0 Must issue a STARTTLS&#xA;  command first. u9sm80344949wjy.37 - gsmtp&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You did not start tls, you need it to open a TLS connection to your gmail account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not a direct answer to your request, but this is an Emacs configuration for sending mails with gmail. The gnutls package should be installed system wide ex: apt install gnutls-bin:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; send mail&#xA;(setq&#xA;send-mail-function 'smtpmail-send-it&#xA;message-send-mail-function 'smtpmail-send-it&#xA;user-mail-address &quot;youremail@gmail.com&quot;&#xA;smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; &quot;587&quot; nil nil))&#xA;smtpmail-auth-credentials (expand-file-name &quot;~/.authinfo&quot;)&#xA;smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA;smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA;smtpmail-smtp-service 587&#xA;smtpmail-debug-info t&#xA;starttls-extra-arguments nil&#xA;starttls-gnutls-program &quot;/usr/bin/gnutls-cli&quot;&#xA;starttls-extra-arguments nil&#xA;starttls-use-gnutls t&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make sure to insert the correct email address and the correct path to gnutls-cli.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-01-06T18:55:31.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6109" PostTypeId="2" ParentId="4049" CreationDate="2015-01-06T19:34:21.747" Score="2" Body="&lt;p&gt;The macro &lt;code&gt;with-silent-modifications&lt;/code&gt; (in &lt;code&gt;subr.el&lt;/code&gt;) seems to exist for exactly this use case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Execute BODY, pretending it does not modify the buffer.&#xA;...&#xA;Typically used around modifications of text-properties which do&#xA;not really affect the buffer's content.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-06T19:34:21.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6110" PostTypeId="1" CreationDate="2015-01-06T19:38:35.240" Score="1" ViewCount="317" Body="&lt;p&gt;I'm on ubuntu 14.04 64 bit, I had emacs 23 working great, I removed it to install emacs 24 and I get this error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs&#xA;X protocol error: BadMatch (invalid parameter attributes) on protocol request 139&#xA;When compiled with GTK, Emacs cannot recover from X disconnects.&#xA;This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715&#xA;For details, see etc/PROBLEMS.&#xA;&#xA;(emacs:776): GLib-WARNING **: g_main_context_prepare() called recursively from within a source's check() or prepare() member.&#xA;&#xA;(emacs:776): GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member.&#xA;Fatal error 6: Aborted&#xA;Backtrace:&#xA;emacs[0x4f74cb]&#xA;emacs[0x4dcf3e]&#xA;emacs[0x4f7513]&#xA;emacs[0x4b219b]&#xA;emacs[0x4b420c]&#xA;emacs[0x4b426d]&#xA;/usr/lib/x86_64-linux-gnu/libX11.so.6(_XError+0x12b)[0x7f2ade76854b]&#xA;/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3b5e7)[0x7f2ade7655e7]&#xA;/usr/lib/x86_64-linux-gnu/libX11.so.6(+0x3b695)[0x7f2ade765695]&#xA;/usr/lib/x86_64-linux-gnu/libX11.so.6(_XEventsQueued+0x55)[0x7f2ade765fc5]&#xA;/usr/lib/x86_64-linux-gnu/libX11.so.6(XPending+0x4d)[0x7f2ade75812d]&#xA;...&#xA;[1]    776 abort (core dumped)  emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it crashes every time I try to start it&lt;/p&gt;&#xA;" OwnerUserId="4079" LastActivityDate="2015-01-06T19:38:35.240" Title="Error installing emacs24" Tags="|emacs24.4|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6111" PostTypeId="1" AcceptedAnswerId="6112" CreationDate="2015-01-06T19:48:15.233" Score="12" ViewCount="4847" Body="&lt;p&gt;I'm very new to Emacs and I'm trying the built-in tutorial. After I went through the basics, I found it really hard to reach the &lt;kbd&gt;Ctrl&lt;/kbd&gt; and &lt;kbd&gt;Alt&lt;/kbd&gt; or &lt;kbd&gt;Esc&lt;/kbd&gt; keys. I'm trying to type faster but since all the commands require these keys, I'm not able to be fast at all. I have searched,  but it seems that nobody is complaining about these keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already know that you can swap the &lt;kbd&gt;Ctrl&lt;/kbd&gt; and &lt;kbd&gt;Caps Lock&lt;/kbd&gt; keys, but I prefer not to do that because I heard that it is not recommended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make it easier to type commands?&lt;/p&gt;&#xA;" OwnerUserId="4111" LastEditorUserId="25" LastEditDate="2015-01-06T22:04:34.230" LastActivityDate="2019-02-19T10:09:48.507" Title="Typing quickly when Control, Alt and Esc are hard to reach" Tags="|key-bindings|keystrokes|accessibility|" AnswerCount="9" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="6112" PostTypeId="2" ParentId="6111" CreationDate="2015-01-06T20:26:32.127" Score="22" Body="&lt;p&gt;This is a hard question to &quot;answer&quot;, but a few thoughts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try working with the default key bindings for a while, because Emacs will definitely feel strange at first. I would not suggest making major configuration changes until you have a better sense of what works and doesn't work for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll find Emacs users on both sides of the caps-lock vs. ctrl argument. Personally I've used caps-lock as a ctrl key for a long time and find it very convenient. I use my left hand for all modifier keys: generally my pinky for &lt;kbd&gt;Caps Lock&lt;/kbd&gt; (&lt;code&gt;C-&lt;/code&gt;)and &lt;kbd&gt;Shift&lt;/kbd&gt;, and my thumb for &lt;kbd&gt;Alt&lt;/kbd&gt; (&lt;code&gt;M-&lt;/code&gt;). I've done this for years and am happy with it. I do see the sense of being able to hit modifier keys with either hand but that just isn't how I learned. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are modes that do not depend on modifier keys as much. If you like the Vim style of modal editing you could try &lt;a href=&quot;http://www.emacswiki.org/emacs/Evil&quot;&gt;Evil&lt;/a&gt; or the more Emacs-like &lt;a href=&quot;https://github.com/chrisdone/god-mode&quot;&gt;god-mode&lt;/a&gt;. But I'd still suggest spending some time with the defaults. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you get more familiar with Emacs and learn what commands and modes you find most useful, then you can start tinkering with key bindings. Function keys can be used as a prefix to save yourself some use of modifiers, though you have to reach for them. There are packages like &lt;a href=&quot;http://emacswiki.org/emacs/KeyChord&quot;&gt;key-chord&lt;/a&gt; that let you bind repeated keys (like &lt;kbd&gt;j&lt;/kbd&gt;&lt;kbd&gt;j&lt;/kbd&gt;) or key chords (like &lt;kbd&gt;j&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt;) to commands. There are also things like &lt;a href=&quot;https://github.com/myuhe/smartrep.el&quot;&gt;smartrep&lt;/a&gt; that allow you to use single keys to continue performing commands after some initial command, which can be used to avoid having to hold down some modifier combo. But setting up those kinds of packages requires knowing what commands you want to rebind, which requires some experience first. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-01-06T20:57:31.060" LastActivityDate="2015-01-06T20:57:31.060" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6113" PostTypeId="2" ParentId="6111" CreationDate="2015-01-06T20:35:38.177" Score="2" Body="&lt;p&gt;I use the Dvorak layout and I found that it works very well with Emacs default key bindings.  &lt;code&gt;C-n&lt;/code&gt; is on the home row and &lt;code&gt;C-p&lt;/code&gt; can be pressed with the index finger instead of the pinky.  &lt;code&gt;C-u&lt;/code&gt; (the prefix key) is on the home row as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I swapped Caps Lock and Ctrl on all keyboards because I find it easier to type certain key combinations.  I also bound &lt;code&gt;M-x&lt;/code&gt; to the menu key (right of the space bar), because that's easier for me to hit than left &lt;code&gt;Alt&lt;/code&gt; and &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than that I do use &lt;code&gt;god-mode&lt;/code&gt; to make longer editing sessions a little more comfortable.  I do not find Emacs keys to be an obstacle and I use the defaults mostly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like @glucas I use the left pinky for Ctrl and my left thumb for the left Alt key.   On the Truly Ergonomic Keyboard I bound the left space key to Alt which makes this much less awkward than on a regular keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are worried about stressing your left hand too much by swapping Ctrl and Caps Lock, you can even bind Ctrl to the Return key.  See this article for more information: &lt;a href=&quot;http://emacsredux.com/blog/2013/11/12/a-crazy-productivity-boost-remap-return-to-control/&quot; rel=&quot;nofollow&quot;&gt;http://emacsredux.com/blog/2013/11/12/a-crazy-productivity-boost-remap-return-to-control/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-01-06T20:35:38.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6114" PostTypeId="1" CreationDate="2015-01-06T20:57:39.960" Score="5" ViewCount="1063" Body="&lt;p&gt;So, sometimes when I go into a buffer that has a &lt;code&gt;[&lt;/code&gt; as the first character (such as &lt;code&gt;.ini&lt;/code&gt; files) emacs suddenly starts typing everything backwards. In other words, if I press the keys &lt;code&gt;y&lt;/code&gt; &lt;code&gt;e&lt;/code&gt; &lt;code&gt;s&lt;/code&gt; I get out &lt;code&gt;s&lt;/code&gt; &lt;code&gt;e&lt;/code&gt; &lt;code&gt;y&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a little time investigating the behavior it seems that what is actually happening is that after typing any character the cursor immediately jumps to the beginning of the line. This means that if I press &lt;code&gt;Ctrl+e&lt;/code&gt; after every character I can type forwards. This behavior persists across all buffers once it happens and the only way for me to type normally again is to completely exit out of emacs and restart it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone out there have any idea why or how this is happening? For reference, here are my config files &lt;a href=&quot;https://github.com/blarghmatey/dotfiles/tree/master/home/.emacs.d&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/blarghmatey/dotfiles/tree/master/home/.emacs.d&lt;/a&gt; and the list of packages that are referenced are as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;ac-capf&#xA;ac-inf-ruby&#xA;ac-js2&#xA;ag&#xA;ahg&#xA;anaconda-mode&#xA;anaphora&#xA;ansible&#xA;assemblage-theme&#xA;async&#xA;auto-complete&#xA;auto-complete-exuberant-ctags&#xA;auto-complete-rst&#xA;bundler&#xA;chruby&#xA;coffee-mode&#xA;color-theme&#xA;color-theme-approximate&#xA;color-theme-monokai&#xA;color-theme-sanityinc-solarized&#xA;color-theme-solarized&#xA;color-theme-twilight&#xA;column-marker&#xA;command-t&#xA;company&#xA;company-anaconda&#xA;company-inf-python&#xA;company-inf-ruby&#xA;company-tern&#xA;company-ycm&#xA;concurrent&#xA;css-eldoc&#xA;csv-mode&#xA;ctable&#xA;ctags&#xA;ctags-update&#xA;cython-mode&#xA;dakrone-theme&#xA;dark-souls&#xA;dart-mode&#xA;dash&#xA;dash-at-point&#xA;dash-functional&#xA;deferred&#xA;direx&#xA;discover&#xA;discover-js2-refactor&#xA;discover-my-major&#xA;distinguished-theme&#xA;docean&#xA;dpaste&#xA;ein&#xA;elpy&#xA;elscreen&#xA;epc&#xA;epl&#xA;eproject&#xA;ess&#xA;evil&#xA;evil-leader&#xA;evil-surround&#xA;f&#xA;fill-column-indicator&#xA;find-file-in-project&#xA;findr&#xA;flx&#xA;flx-isearch&#xA;flycheck&#xA;flycheck-color-mode-line&#xA;fold-this&#xA;fringe-helper&#xA;fuzzy&#xA;gerrit-download&#xA;gh&#xA;git-commit-mode&#xA;git-gutter+&#xA;git-gutter-fringe+&#xA;git-rebase-mode&#xA;goto-chg&#xA;haml-mode&#xA;helm&#xA;helm-ag&#xA;helm-aws&#xA;helm-cmd-t&#xA;helm-company&#xA;helm-dash&#xA;helm-flycheck&#xA;helm-git&#xA;helm-proc&#xA;helm-projectile&#xA;helm-pydoc&#xA;helm-spotify&#xA;heroku&#xA;highlight-indentation&#xA;history&#xA;idomenu&#xA;iedit&#xA;inf-ruby&#xA;inflections&#xA;jedi&#xA;jedi-direx&#xA;jinja2-mode&#xA;js2-mode&#xA;js2-refactor&#xA;js3-mode&#xA;json-mode&#xA;json-reformat&#xA;json-rpc&#xA;json-snatcher&#xA;jsx-mode&#xA;jump&#xA;kivy-mode&#xA;late-night-theme&#xA;lentic&#xA;let-alist&#xA;lice&#xA;logito&#xA;logstash-conf&#xA;lush-theme&#xA;m-buffer&#xA;magit&#xA;magit-filenotify&#xA;magit-gerrit&#xA;magit-gh-pulls&#xA;makey&#xA;markdown-mode&#xA;mkdown&#xA;mmm-mode&#xA;multi&#xA;multi-term&#xA;multi-web-mode&#xA;multiple-cursors&#xA;neotree&#xA;nginx-mode&#xA;nodejs-repl&#xA;nose&#xA;org&#xA;org-jira&#xA;paradox&#xA;pcache&#xA;pep8&#xA;php-mode&#xA;pip-requirements&#xA;pkg-info&#xA;polymode&#xA;popup&#xA;popwin&#xA;powerline&#xA;projectile&#xA;projectile-rails&#xA;puppet-mode&#xA;puppetfile-mode&#xA;py-autopep8&#xA;py-import-check&#xA;py-isort&#xA;pymacs&#xA;python-django&#xA;python-environment&#xA;pyvenv&#xA;rainbow-delimiters&#xA;rainbow-mode&#xA;rake&#xA;request&#xA;rinari&#xA;ruby-compilation&#xA;rvm&#xA;s&#xA;sass-mode&#xA;scss-mode&#xA;simple-httpd&#xA;skewer-mode&#xA;smartparens&#xA;smeargle&#xA;smex&#xA;soothe-theme&#xA;sphinx-doc&#xA;sr-speedbar&#xA;stekene-theme&#xA;sx&#xA;tern&#xA;tern-auto-complete&#xA;tree-mode&#xA;undo-tree&#xA;vagrant&#xA;virtualenvwrapper&#xA;wakatime-mode&#xA;web-mode&#xA;websocket&#xA;wgrep&#xA;wgrep-ag&#xA;windata&#xA;workgroups2&#xA;xlicense&#xA;yaml-mode&#xA;yasnippet&#xA;ycm&#xA;zeal-at-point&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="4114" LastActivityDate="2019-03-18T13:43:02.403" Title="Emacs typing backwards" Tags="|debugging|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="6115" PostTypeId="2" ParentId="6111" CreationDate="2015-01-06T22:10:04.910" Score="10" Body="&lt;p&gt;I've got myself for Christmas a Kinesis keyboard. I will not post links so that not to make this an advertisement. Keyboards with similar qualities will do too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before that I had a Steelseries keyboard with additional &lt;kbd&gt;Ctrl&lt;/kbd&gt; mapped to &lt;kbd&gt;Caps Lock&lt;/kbd&gt;. The important things I needed to learn (with my old keyboard) were these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;M-x&lt;/kbd&gt; with &lt;em&gt;both&lt;/em&gt; hands. I can reach right &lt;kbd&gt;Ctrl&lt;/kbd&gt; key on my laptop keyboard, but not on my old desktop one. If reaching it is doable, you should learn to press &lt;kbd&gt;C-x&lt;/kbd&gt;, &lt;kbd&gt;C-r&lt;/kbd&gt;, &lt;kbd&gt;C-s&lt;/kbd&gt;, &lt;kbd&gt;C-a&lt;/kbd&gt;, &lt;kbd&gt;C-e&lt;/kbd&gt; and &lt;kbd&gt;C-c&lt;/kbd&gt; etc. with &lt;em&gt;both&lt;/em&gt; hands too.&lt;/li&gt;&#xA;&lt;li&gt;Use right &lt;kbd&gt;Shift&lt;/kbd&gt; whenever possible.&lt;/li&gt;&#xA;&lt;li&gt;If you stick with the straight keyboard, well, you have to train your pinky! Same way as piano players play five-fingers exercise.&lt;/li&gt;&#xA;&lt;li&gt;Don't use &lt;kbd&gt;Home&lt;/kbd&gt;, &lt;kbd&gt;Pagup&lt;/kbd&gt;, &lt;kbd&gt;Pagedown&lt;/kbd&gt; and &lt;kbd&gt;End&lt;/kbd&gt; as well as arrow kyes.&lt;/li&gt;&#xA;&lt;li&gt;Some commands may have alternative key bindings, which might be longer, but easier to press (require less keys pressed simultaneously).&lt;/li&gt;&#xA;&lt;li&gt;If you decide to try an ergonomic keyboard, you'd have to do some remapping and, instead of training the pinky, you'd have to train your thumbs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-06T22:10:04.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6116" PostTypeId="1" AcceptedAnswerId="7127" CreationDate="2015-01-06T23:05:31.233" Score="13" ViewCount="693" Body="&lt;p&gt;The&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/format-time-string&quot;&gt;&lt;code&gt;format-time-string&lt;/code&gt;&lt;/a&gt;&#xA;function takes a string, and replaces a set of special constructs in&#xA;that string (characters preceeded by &lt;code&gt;%&lt;/code&gt;) with some specific text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to implement a functionality like that in a function of my own:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have an alist between chars and symbols like: &lt;code&gt;'((?n . name) (?r . reputation))&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The function should take a string like &lt;code&gt;&quot;My name is %n, and my rep is %r&quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;It should replace &lt;code&gt;%n&lt;/code&gt; and &lt;code&gt;%r&lt;/code&gt; with the value of the variables &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;reputation&lt;/code&gt;, and return the result.&lt;/li&gt;&#xA;&lt;li&gt;It should handle &lt;code&gt;%%&lt;/code&gt; just like &lt;code&gt;format-time-string&lt;/code&gt; (replace it with &lt;code&gt;%&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What's the easiest way to implement this function?&lt;/strong&gt;&lt;br&gt;&#xA;Is there a library or function that will facilitate this? Handling &lt;code&gt;%%&lt;/code&gt; correctly is important.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="10" LastEditDate="2015-01-07T11:27:24.973" LastActivityDate="2015-01-07T11:48:39.497" Title="What's the easiest way to implement a function like format-time-string" Tags="|elisp|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6118" PostTypeId="1" AcceptedAnswerId="7124" CreationDate="2015-01-07T00:43:03.760" Score="3" ViewCount="226" Body="&lt;p&gt;I'm trying to add additional colors to json-mode for when I edit json-schema.  I can get it working fine without searching for double quotes, but I need to for some highlighting.  I've tried quite a few things to highlight &lt;em&gt;properties&lt;/em&gt; inside of &quot;properties&quot; including:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'json-mode '((&quot;&quot;&quot;\\(properties\\)&quot;&quot;&quot; 1 '(:foreground &quot;chartreuse4&quot;) t))&#xA;(font-lock-add-keywords 'json-mode '((&quot;\\&quot;&quot;\\(properties\\)&quot;\\&quot;&quot; 1 '(:foreground &quot;chartreuse4&quot;) t))&#xA;(font-lock-add-keywords 'json-mode '((&quot;\\s&quot;&quot;\\(properties\\)\\s&quot;&quot;&quot; 1 '(:foreground &quot;chartreuse4&quot;) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expect once I understand the solution, I can easily highlight &lt;em&gt;object&lt;/em&gt; in &quot;type&quot;: &quot;object&quot; which was my original goal.&lt;/p&gt;&#xA;" OwnerUserId="4116" LastActivityDate="2015-05-09T20:31:17.440" Title="How do I highlight certain words between double quotes with font-lock?" Tags="|font-lock|regular-expressions|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6120" PostTypeId="2" ParentId="6116" CreationDate="2015-01-07T00:48:12.017" Score="7" Body="&lt;p&gt;Since elisp has rather primitive facilities for dealing with strings, it is better to put your format string into a buffer and iterate over that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar malabarba-alist '((?n . &quot;Malabarba&quot;) (?r . 7488) (?% . &quot;%&quot;)))&#xA;&#xA;(defun malabarba-format (string)&#xA;  (with-temp-buffer&#xA;    (insert string)&#xA;    (goto-char 1)&#xA;    (while (search-forward &quot;%&quot; nil t)&#xA;      (let ((s (cdr (assoc (char-after) malabarba-alist))))&#xA;        (cond&#xA;          (s (delete-char -1) (delete-char 1) (insert (format &quot;%s&quot; (eval s))))&#xA;          (t (unless (eobp) (forward-char))))))&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A minor subtlety — this doesn't break when there's a lone &lt;code&gt;%&lt;/code&gt; at the end of the string because &lt;code&gt;char-after&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; at the end of the buffer.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2015-01-07T08:43:46.687" LastActivityDate="2015-01-07T08:43:46.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6121" PostTypeId="1" CreationDate="2015-01-07T02:56:16.023" Score="3" ViewCount="2074" Body="&lt;p&gt;I'm trying to set &lt;code&gt;helm&lt;/code&gt; using &lt;code&gt;use-package&lt;/code&gt;. The &lt;code&gt;set-face-atttribute&lt;/code&gt; doesn't work within &lt;code&gt;use-package&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package helm-config&#xA;      :config&#xA;      (progn&#xA;        (helm-mode 1)&#xA;        ;; other config ...&#xA;        (set-face-attribute 'helm-selection nil &#xA;                    :background &quot;purple&quot;&#xA;                    :foreground &quot;black&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it works well outside the use-package. It is quite neat to put all the config of a specific package together. So how to set face in &lt;code&gt;use-package&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="3872" LastEditDate="2015-01-07T11:25:14.957" LastActivityDate="2015-01-07T13:02:11.233" Title="use-package syntax: how to set-face-attribute?" Tags="|helm|use-package|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6122" PostTypeId="2" ParentId="6116" CreationDate="2015-01-07T03:14:51.097" Score="3" Body="&lt;p&gt;Here is code that I use for a format-time-string for a fake calendar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mystcal-format-time (format-string time)&#xA;  &quot;Format time&#xA;%Y is the year.&#xA;%m is the numeric month.&#xA;%B is the full name of the month.&#xA;%d is the day of the month, zero-padded, %e is blank-padded.&#xA;%u is the numeric day of week from 1 (Monday) to 7, %w from 0 (Sunday) to 6.&#xA;%A is the locale's full name of the day of week.&#xA;%H is the hour on a 24-hour clock, %I is on a 12-hour clock, %k is like %H&#xA; only blank-padded, %l is like %I blank-padded.&#xA;%p is the locale's equivalent of either AM or PM.&#xA;%M is the minute.&#xA;%S is the second.&quot;&#xA;  (let* (output&#xA;         (start 0)&#xA;         (decoded-time (if (listp time)&#xA;                           time&#xA;                         (mystcal-decode-time time)))&#xA;         (turn (nth 0 decoded-time))&#xA;         (minute (nth 1 decoded-time))&#xA;         (hour (nth 2 decoded-time))&#xA;         (day (nth 3 decoded-time))&#xA;         (month (mystcal-month decoded-time))&#xA;         (year (nth 5 decoded-time))&#xA;         (weekday (mystcal-weekday-of-day day))&#xA;         (hour12 (mod hour 12)))&#xA;    (save-match-data&#xA;      (while (string-match &quot;%&quot; format-string start)&#xA;        (let ((index (match-beginning 0)))&#xA;          ;; First copy non-format text&#xA;          (setq output (concat output (substring format-string start &#xA;                                                 index)))&#xA;          ;; Process format codes here&#xA;          (let (fmted)&#xA;            (setq output (concat output &#xA;                                 (case (aref format-string (1+ index))&#xA;                                   (?Y (number-to-string year))&#xA;                                   (?m (number-to-string month))&#xA;                                   (?B (mystcal-month-name month))&#xA;                                   (?d (format &quot;%02d&quot; day))&#xA;                                   (?e (format &quot;%2d&quot; day))&#xA;                                   (?u (number-to-string (if (zerop weekday)&#xA;                                                             7&#xA;                                                           weekday)))&#xA;                                   (?w (number-to-string weekday))&#xA;                                   (?A (mystcal-weekday-name &#xA;                                        (mystcal-weekday-of-day day)))&#xA;                                   (?H (format &quot;%02d&quot; hour))&#xA;                                   (?k (format &quot;%2d&quot; hour))&#xA;                                   (?I (format &quot;%02d&quot; (if (zerop hour12) 12 hour12)))&#xA;                                   (?l (format &quot;%2d&quot; (if (zerop hour12) 12 hour12)))&#xA;                                   (?p (if (&amp;lt; hour 12)&#xA;                                           &quot;AM&quot; &quot;PM&quot;))&#xA;                                   (?M (format &quot;%02d&quot; minute))&#xA;                                   (?S &quot;00&quot;)))))&#xA;          (setq start (+ 2 index)))))&#xA;    (setq output (concat output (substring format-string start)))&#xA;    output))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2467" LastActivityDate="2015-01-07T03:14:51.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6123" PostTypeId="1" AcceptedAnswerId="6124" CreationDate="2015-01-07T03:19:03.540" Score="6" ViewCount="1189" Body="&lt;p&gt;I edit markdown text in Emacs fullscreen. Naturally in fullscreen the text flows &lt;em&gt;wider&lt;/em&gt;, from left edge of the display to the right, thereby necessitating more eye movements. I want to narrow down the entire text display to, say, 80 characters and position it in centre of the fullscreen Emacs. The emacs buffer should look as if there is unused empty space to the left and right of this centered narrow column of text that is being edited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the simplest way to achieve this? (I could split into 3 buffers, but that's not simpler).&lt;/p&gt;&#xA;" OwnerUserId="2059" LastActivityDate="2015-01-07T15:50:05.670" Title="Fullscreen emacs and narrow column of text" Tags="|writing|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6124" PostTypeId="2" ParentId="6123" CreationDate="2015-01-07T03:20:19.913" Score="7" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/joostkremers/writeroom-mode&quot;&gt;writeroom-mode&lt;/a&gt; for that. It's available in MELPA.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-07T03:20:19.913" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7115" PostTypeId="1" AcceptedAnswerId="7122" CreationDate="2015-01-07T03:44:53.270" Score="17" ViewCount="9258" Body="&lt;p&gt;I use &lt;code&gt;markdown-mode&lt;/code&gt; (in conjunction with &lt;code&gt;writeroom-mode&lt;/code&gt;) for writing in Emacs. My markdown files generally gets quite large, and I would like to be able to focus on a particular section for extended periods of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this? Specifically I'm looking to hide or collapse other sections (heading and their text) while working on the current one. &lt;a href=&quot;http://www.foldingtext.com&quot; rel=&quot;noreferrer&quot;&gt;http://www.foldingtext.com&lt;/a&gt; behaves in this manner.&lt;/p&gt;&#xA;" OwnerUserId="2059" LastEditorUserId="2059" LastEditDate="2015-01-08T00:28:13.083" LastActivityDate="2015-01-08T00:28:13.083" Title="Collapse sections in markdown" Tags="|writing|markdown|markdown-mode|outline|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7116" PostTypeId="1" AcceptedAnswerId="7120" CreationDate="2015-01-07T04:19:28.360" Score="14" ViewCount="1349" Body="&lt;p&gt;&#xA;Often, I my windows get automatically split until I arbitrarily decide that the current frame does not have enough real-estate for them all. When this occurs, I manually delete a window, create a frame, and switch to that deleted window. How can I write an elisp function that does this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun pop-window-into-frame ()&#xA;  (interactive)&#xA;  (delete-window)&#xA;  (make-frame-command)&#xA;  (switch-to-prev-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But for some reason this doesn't do what I think it should.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-01-10T04:02:47.827" LastActivityDate="2016-02-04T15:24:06.560" Title="&quot;Pop&quot; a window into a frame" Tags="|window|frames|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7117" PostTypeId="2" ParentId="7115" CreationDate="2015-01-07T04:22:14.460" Score="3" Body="&lt;p&gt;I've found two ways that can be useful:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;enable hideshow mode (hs-minor-mode) and use the provided functions&lt;/li&gt;&#xA;&lt;li&gt;Apparently markdown-mode inherits from outline mode (or at least the functions are available here!) so you can use functions like hide-subtree and show-subtree.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="61" LastActivityDate="2015-01-07T04:22:14.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7118" PostTypeId="2" ParentId="6063" CreationDate="2015-01-07T04:55:45.927" Score="3" Body="&lt;p&gt;&lt;strong&gt;SHORTCUT&lt;/strong&gt;:  Copy and paste code into the &lt;code&gt;*scratch*&lt;/code&gt; buffer; type &lt;code&gt;M-x eval-buffer RET&lt;/code&gt;; and, then type &lt;code&gt;M-x count-business-days RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;DOCUMENTATION&lt;/strong&gt;:  As mentioned in the comment underneath the question, this answer is dependent upon the holiday calendar defined by the particular user -- e.g., federal holidays in U.S.; state court holidays (e.g., California, U.S.); or national holidays in another country.  The variable &lt;code&gt;custom-holidays&lt;/code&gt; defined below has common U.S. federal holidays, and the user is free to custom tailor that variable to suit his / her individual needs.  The variables &lt;code&gt;mark-target-date&lt;/code&gt; and &lt;code&gt;move-cursor-to-target-date&lt;/code&gt; are both set to &lt;code&gt;t&lt;/code&gt; and should be self-explanitory based on the doc-string.  The date format for the initial date uses &lt;code&gt;read-string&lt;/code&gt; because &lt;code&gt;org-read-date&lt;/code&gt; is set up to use overlays instead of the type of default value that I prefer to see squarely placed inside the minibuffer; thereafter, &lt;code&gt;org-read-date&lt;/code&gt; interprets that.  In addition, &lt;code&gt;org-read-date&lt;/code&gt; is set up to bury the &lt;code&gt;*Calendar*&lt;/code&gt; buffer after a date is selected, and we don't want that behavior here.  We use &lt;code&gt;org-read-date&lt;/code&gt;; however, we only feed it a date already selected by the user.  &lt;code&gt;org-read-date&lt;/code&gt; can be picky about the format, so I have included an initial default based upon the location of the cursor position in the &lt;code&gt;*Calendar*&lt;/code&gt; buffer as a starting point.  Any format recognized by &lt;code&gt;org-read-date&lt;/code&gt; is acceptable -- see the doc-string of &lt;code&gt;org-read-date&lt;/code&gt; for generally recognized date formats.  The mathematics generated correct results in my initial testing using the three types of possibilities -- i.e., beginning date as a holiday, or as a weekend, or as a weekday.  If there is a special case I have not considered, or something seems not right, please let me know.  The holidays list only goes back two (2) months in time -- for example, if the user is selecting an initial date of January 6, 2015, then the holiday list will include the months of November 2014, December 2014 and January 2015.  On the todo-list is a check and error message in the event a user tries to select a number of business days beyond the outer limits of the available holiday schedule.  [It is possible to have a year calendar; however, that is beyond the scope of this example.]&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;HISTORY&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First Rough Draft&lt;/strong&gt; (January 6, 2015):  First rough draft.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar mark-target-date t&#xA;&quot;When `t`, highlight the target date.&#xA;When `nil`, do not highlight the target date.&quot;)&#xA;&#xA;(defvar move-cursor-to-target-date t&#xA;&quot;When `t`, move the calendar cursor to the target date.&#xA;When `nil`, do not move the cursor to the target date.&quot;)&#xA;&#xA;(defcustom custom-holidays&#xA;  (mapcar 'purecopy&#xA;  '((holiday-fixed 1 1 &quot;New Year's Day&quot;)&#xA;    (holiday-float 1 1 3 &quot;Martin Luther King Day&quot;)&#xA;    (holiday-float 2 1 3 &quot;President's Day&quot;)&#xA;    (holiday-float 5 1 -1 &quot;Memorial Day&quot;)&#xA;    (holiday-fixed 7 4 &quot;Independence Day&quot;)&#xA;    (holiday-float 9 1 1 &quot;Labor Day&quot;)&#xA;    (holiday-float 10 1 2 &quot;Columbus Day&quot;)&#xA;    (holiday-fixed 11 11 &quot;Veteran's Day&quot;)&#xA;    (holiday-float 11 4 4 &quot;Thanksgiving&quot;)&#xA;    (holiday-fixed 12 25 &quot;Christmas&quot;)) )&#xA;  &quot;Custom holidays defined by the user.&quot;&#xA;  :type 'sexp&#xA;  :group 'holidays)&#xA;&#xA;(defun count-business-days ()&#xA;&quot;Count x number of business days backwards -- excluding holidays defined by the&#xA;user in the variable `custom-holidays`; and, excluding Saturdays and Sundays.&quot;&#xA;(interactive)&#xA;  (require 'holidays)&#xA;  (require 'org)&#xA;  (require 'calendar)&#xA;  (unless (get-buffer-window calendar-buffer (selected-frame))&#xA;    (calendar))&#xA;  (let* (&#xA;      holidays&#xA;      (counter 1)&#xA;      (cursor-date (when (get-buffer calendar-buffer) ;; format is:  '(month day year)&#xA;        (with-current-buffer calendar-buffer (calendar-cursor-to-nearest-date))))&#xA;      (proposed-month (when cursor-date&#xA;        (if (&amp;lt; (nth 0 cursor-date) 10)&#xA;          (format &quot;%02d&quot; (nth 0 cursor-date))&#xA;          (number-to-string (nth 0 cursor-date)))))&#xA;      (proposed-day (when cursor-date&#xA;        (if (&amp;lt; (nth 1 cursor-date) 10)&#xA;          (format &quot;%02d&quot; (nth 1 cursor-date))&#xA;          (number-to-string (nth 1 cursor-date)))))&#xA;      (proposed-year (when cursor-date (number-to-string (nth 2 cursor-date))))&#xA;      ;; `org-read-date` likes the format of:  year-month-day&#xA;      (proposed-date&#xA;        (when cursor-date (concat proposed-year &quot;-&quot; proposed-month &quot;-&quot; proposed-day)))&#xA;      (initial-date (read-string&#xA;        &quot;year-month-day of initial date:  &quot;&#xA;          proposed-date nil proposed-date nil))&#xA;      (days (read-number &quot;Number of Days (before):  &quot;))&#xA;      (day-variable (org-read-date nil t initial-date nil)) )&#xA;    (let* (&#xA;        (displayed-month (nth 4 (decode-time day-variable)))&#xA;        (displayed-year (nth 5 (decode-time day-variable))) )&#xA;      (calendar-increment-month displayed-month displayed-year -1)&#xA;      (dolist (holiday&#xA;          (let (res h)&#xA;            (dolist (p custom-holidays res)&#xA;              (when (setq h (eval p))&#xA;                (setq res (append h res))))))&#xA;        (setq holidays (append holidays (list holiday)))) )&#xA;    (catch 'done&#xA;      (while t&#xA;        (setq day-variable (time-subtract day-variable (days-to-time 1)))&#xA;        (let* (&#xA;            (day (nth 3 (decode-time day-variable)))&#xA;            (month (nth 4 (decode-time day-variable)))&#xA;            (year (nth 5 (decode-time day-variable)))&#xA;            (day-of-week (nth 6 (decode-time day-variable)))&#xA;            (gregorian (list month day year))&#xA;            holiday-p)&#xA;          (mapcar (lambda (x)&#xA;            (if (equal gregorian (car x))&#xA;              (setq holiday-p t))) holidays)&#xA;          ;; DEBUGGING&#xA;          ;; (message &quot;holidays:  %s&quot; holidays)&#xA;          ;; (message &quot;greg: %s | count:  %s | day:  %s | day-variable: %s&quot;&#xA;          ;;   gregorian counter day-of-week (decode-time day-variable))&#xA;          (if&#xA;              (and&#xA;                (= counter days)&#xA;                (memq day-of-week '(1 2 3 4 5))&#xA;                (not holiday-p))&#xA;            (throw 'done nil)&#xA;            (when&#xA;                (and&#xA;                  (memq day-of-week '(1 2 3 4 5))&#xA;                  (not holiday-p))&#xA;              (setq counter (1+ counter)))))))&#xA;    (when (get-buffer calendar-buffer)&#xA;      (let* (&#xA;          (decoded-target (decode-time day-variable))&#xA;          (month-target (nth 4 decoded-target))&#xA;          (day-target (nth 3 decoded-target))&#xA;          (year-target (nth 5 decoded-target))&#xA;          (target (list month-target day-target year-target)) )&#xA;        (unless&#xA;            (with-current-buffer calendar-buffer (calendar-date-is-visible-p target))&#xA;          (with-current-buffer calendar-buffer&#xA;            (calendar-generate month-target year-target)))&#xA;        (when mark-target-date&#xA;          (calendar-mark-visible-date target 'holiday)) ;; `'holiday` is the face.&#xA;        (when move-cursor-to-target-date&#xA;          (calendar-cursor-to-visible-date target))))&#xA;    (message &quot;Initial Date: %s | Target Date: %s | Business Days: %s&quot;&#xA;      initial-date (format-time-string &quot;%Y-%m-%d&quot; day-variable) days)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-01-07T06:32:47.083" LastActivityDate="2015-01-07T06:32:47.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7120" PostTypeId="2" ParentId="7116" CreationDate="2015-01-07T07:11:20.753" Score="16" Body="&lt;p&gt;Try this instead:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-turn-current-window-into-frame ()&#xA;  (interactive)&#xA;  (let ((buffer (current-buffer)))&#xA;    (unless (one-window-p)&#xA;      (delete-window))&#xA;    (display-buffer-pop-up-frame buffer nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="2642" LastEditDate="2015-01-10T08:54:45.470" LastActivityDate="2015-01-10T08:54:45.470" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7121" PostTypeId="1" CreationDate="2015-01-07T07:17:38.840" Score="1" ViewCount="292" Body="&lt;p&gt;When I'm editing a file, if the completion list shows up, the text in the current window will always jump (sometime it will jump a few lines but mostly it will jump to the top of the window), after finishing typing or selecting the right candidate, it will jump back the original place, I got a gif to show what I mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Vfgg6.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: this problem cannot be replicated very easily, even by myself, even in the same file. But when I'm editing a source code file or org file, this happens a lot, it's really annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if it is caused by company itself or not but it only happens in company completion list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my company configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'company &quot;company&quot; t)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;(setq company-global-modes t)&#xA;(setq company-tooltip-limit 30)&#xA;(setq company-minimum-prefix-length 3)&#xA;(setq company-show-numbers t)&#xA;(setq company-dabbrev-other-buffers t)&#xA;(setq company-transformers '(company-sort-by-occurrence))&#xA;(global-set-key (kbd &quot;C-c &amp;lt;tab&amp;gt;&quot;) 'company-files)&#xA;(defalias 'ci 'company-ispell)&#xA;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (company-mode)&#xA;            (set (make-local-variable 'company-backends)&#xA;                 '((&#xA;                    company-dabbrev&#xA;                    company-dabbrev-code&#xA;                    company-ispell&#xA;                    company-files&#xA;                    company-yasnippet)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since the gif is about org-mode, so the last part(&lt;code&gt;company-backends&lt;/code&gt;) of my configuration snippet here is about &lt;code&gt;org-mode-hook&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After analyzing my whole &lt;code&gt;init.el&lt;/code&gt;, this problem is caused by &lt;a href=&quot;https://github.com/zk-phi/sublimity&quot; rel=&quot;nofollow noreferrer&quot;&gt;sublimity&lt;/a&gt;, already posted &lt;a href=&quot;https://github.com/zk-phi/sublimity/issues/21&quot; rel=&quot;nofollow noreferrer&quot;&gt;an issue&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="105" LastEditDate="2015-03-27T19:12:14.903" LastActivityDate="2015-03-27T19:12:14.903" Title="How to avoid window scrolling after completion list shows up in company-mode?" Tags="|window|company-mode|tooltip|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7122" PostTypeId="2" ParentId="7115" CreationDate="2015-01-07T07:21:57.153" Score="18" Body="&lt;p&gt;With &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot;&gt;markdown-mode by Jason Blevins&lt;/a&gt; you can toggle folding of the heading with &lt;kbd&gt;Tab&lt;/kbd&gt; (same as in org-mode).&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-01-07T07:21:57.153" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7123" PostTypeId="2" ParentId="7116" CreationDate="2015-01-07T07:31:47.100" Score="5" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Inspired from `mouse-tear-off-window'.&#xA;(defun tear-off-window ()&#xA;  &quot;Create a new frame displaying buffer of selected window.&#xA;    If window is not the only one in frame, then delete it.&#xA;    Otherwise, this command effectively clones the frame and window.&quot;&#xA;  (interactive)&#xA;  (let ((owin  (selected-window))&#xA;        (buf   (window-buffer))&#xA;        (fr    (make-frame)))&#xA;    (select-frame fr)&#xA;    (switch-to-buffer buf)&#xA;    (save-window-excursion &#xA;      (select-window owin)&#xA;      (unless (one-window-p) (delete-window owin)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This command, as well as the following, which does nothing if the selected window is alone in its frame, are available in library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/frame-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;frame-cmds.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun tear-off-window-if-not-alone ()&#xA;  &quot;Move selected window to a new frame, unless it is alone in its frame.&#xA;If it is alone, do nothing.  Otherwise, delete it and create a new&#xA;frame showing the same buffer.&quot;&#xA;  (interactive)&#xA;  (if (one-window-p 'NOMINI)&#xA;      (message &quot;Sole window in frame&quot;)&#xA;    (tear-off-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-04T15:24:06.560" LastActivityDate="2016-02-04T15:24:06.560" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7124" PostTypeId="2" ParentId="6118" CreationDate="2015-01-07T07:52:43.873" Score="3" Body="&lt;p&gt;To put a &lt;code&gt;&quot;&lt;/code&gt; char inside a string in Lisp, just put one backslash in front of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to highlight anything (not just &lt;code&gt;properties&lt;/code&gt;) between double-quotes, try this as your regexp:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;&quot;\&quot;\\(?:[^\&quot;]\\|\\\\\\(?:.\\|[\n]\\)\\)*\&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That assumes that a backslash escapes any char - in particular the char &lt;code&gt;&quot;&lt;/code&gt;, so that &lt;code&gt;\&quot;&lt;/code&gt; is highlighted inside the string. Similarly for backslash preceding any other char. Dunno whether you want that, but you get the idea.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:31:17.440" LastActivityDate="2015-05-09T20:31:17.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7126" PostTypeId="1" AcceptedAnswerId="8011" CreationDate="2015-01-07T11:26:22.617" Score="4" ViewCount="1652" Body="&lt;p&gt;I'm managing workspaces by creating new frames, but running &lt;code&gt;C-x 5 C-h&lt;/code&gt; couldn't find anything like &quot;run command in new frame&quot;, basically what I'd like to do is to run some REPL or shell in new frame. Is it possible?&lt;/p&gt;&#xA;" OwnerUserId="2361" LastEditorUserId="5143" LastEditDate="2015-02-17T07:33:01.233" LastActivityDate="2015-02-17T07:33:01.233" Title="Run command in new frame" Tags="|frames|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7127" PostTypeId="2" ParentId="6116" CreationDate="2015-01-07T11:48:39.497" Score="19" Body="&lt;p&gt;The default functions to be used are &lt;code&gt;format-spec&lt;/code&gt; and &lt;code&gt;format-spec-make&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((name &quot;Malabarba&quot;)&#xA;       (reputation &quot;good&quot;)&#xA;       (fs (format-spec-make ?n name ?r reputation)))&#xA;  (format-spec &quot;My name is %n, with a %r reputation.  %% is kept.&quot; fs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-01-07T11:48:39.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7128" PostTypeId="1" AcceptedAnswerId="7131" CreationDate="2015-01-07T11:49:28.550" Score="4" ViewCount="965" Body="&lt;p&gt;How can I find out which TeX engine my AUCTeX uses? How can I change the TeX engine my AUCTeX uses (specifically, (a) to LuaTeX, (b) to XeTeX)? Following &lt;a href=&quot;https://tex.stackexchange.com/a/21212/21685&quot;&gt;this&lt;/a&gt; post, I tried to inspect the value of the variable &lt;code&gt;TeX-engine&lt;/code&gt;, however this variable isn't defined in my environment, even though AUCTeX works fine.&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2015-01-07T15:06:14.610" Title="How to determine the AUCTex TeX engine?" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7129" PostTypeId="2" ParentId="6121" CreationDate="2015-01-07T13:02:11.233" Score="2" Body="&lt;p&gt;Worked for me like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package helm&#xA;  :ensure t&#xA;  :init&#xA;  (progn&#xA;    (require 'helm-config)&#xA;    (helm-mode 1)&#xA;    (set-face-attribute 'helm-selection nil&#xA;            :background &quot;purple&quot;&#xA;            :foreground &quot;black&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="970" LastActivityDate="2015-01-07T13:02:11.233" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7131" PostTypeId="2" ParentId="7128" CreationDate="2015-01-07T15:06:14.610" Score="7" Body="&lt;p&gt;This variable is not defined (or set) until AUCTeX is loaded. On your system, it seems to be deferred until it is first needed (&quot;autoloaded&quot; in emacs slang). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you start emacs, some initialization happens during which emacs notes that &lt;code&gt;LaTeX-mode&lt;/code&gt; is defined in some &lt;code&gt;.el&lt;/code&gt; file in the AUCTeX package;&lt;/li&gt;&#xA;&lt;li&gt;if you try to inspect &lt;code&gt;TeX-engine&lt;/code&gt; at this point, the variable has never been defined;&lt;/li&gt;&#xA;&lt;li&gt;if you now open a &lt;code&gt;.tex&lt;/code&gt; file, emacs turns on &lt;code&gt;LaTeX-mode&lt;/code&gt;, which is not loaded yet. So emacs loads the AUCTeX package, and now &lt;code&gt;TeX-engine&lt;/code&gt; is defined;&lt;/li&gt;&#xA;&lt;li&gt;at this point, you can inspect &lt;code&gt;TeX-engine&lt;/code&gt; from any buffer of the emacs session (it will have a default value in all buffers, and a buffer-local value in AUCTeX buffers).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For your second question, you can use the command &lt;code&gt;TeX-engine-set&lt;/code&gt;, which will apply the setting to the current buffer. To apply the setting to the default value (for all buffers), set the variable through the customize interface.&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2015-01-07T15:06:14.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7132" PostTypeId="2" ParentId="6091" CreationDate="2015-01-07T15:48:13.850" Score="2" Body="&lt;p&gt;As pointed out by &lt;strong&gt;Tu Do&lt;/strong&gt;, &lt;code&gt;helm-buffers-list&lt;/code&gt; places the option to create a new buffer as the last choice. So it's just a matter of using it instead of &lt;code&gt;switch-to-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="50" LastEditDate="2015-01-07T18:59:42.133" LastActivityDate="2015-01-07T18:59:42.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7133" PostTypeId="2" ParentId="6123" CreationDate="2015-01-07T15:50:05.670" Score="4" Body="&lt;p&gt;Bastein (one of the org-mode developers/maintainers) had written a &lt;a href=&quot;http://bzg.fr/emacs-strip-tease.html&quot; rel=&quot;nofollow&quot;&gt;nice blog&lt;/a&gt; on how to give minimalistic look to emacs (no mode line, big fringes on the sides) a while ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the full code from &lt;a href=&quot;https://gist.github.com/bzg/8578998&quot; rel=&quot;nofollow&quot;&gt;his gist&lt;/a&gt;. You can pick and choose from that based on what you want to implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a snippet from his gist that will give you 'narrow column text' or simply a buffer with big fringes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;;; A small minor mode to use a big fringe&#xA;(defvar bzg-big-fringe-mode nil)&#xA;(define-minor-mode bzg-big-fringe-mode&#xA;  &quot;Minor mode to hide the mode-line in the current buffer.&quot;&#xA;  :init-value nil&#xA;  :global t&#xA;  :variable bzg-big-fringe-mode&#xA;  :group 'editing-basics&#xA;  (if (not bzg-big-fringe-mode)&#xA;      (set-fringe-style nil)&#xA;    (set-fringe-mode&#xA;     (/ (- (frame-pixel-width)&#xA;           (* 100 (frame-char-width)))&#xA;        2))))&#xA;&#xA;;; Now activate this global minor mode&#xA;(bzg-big-fringe-mode 1)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting the fringe color to suit your default theme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(custom-set-faces&#xA; '(fringe ((t (:background &quot;white&quot;)))))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt; &#xA;(custom-set-faces&#xA;  '(default ((t (:background &quot;black&quot; :foreground &quot;grey&quot;))))&#xA;  '(fringe ((t (:background &quot;black&quot;)))))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-07T15:50:05.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7134" PostTypeId="1" AcceptedAnswerId="7142" CreationDate="2015-01-07T17:21:14.637" Score="0" ViewCount="154" Body="&lt;p&gt;Consider the following LaTeX document.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\usepackage{libertine}&#xA;\usepackage{fontspec}&#xA;\usepackage{polyglossia}&#xA;&#xA;\iffalse&#xA;\setdefaultlanguage{hebrew}&#xA;\fi&#xA;&#xA;\begin{document}&#xA;&#xA;Hello, world!&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;After finishing writing the document, I hit &lt;code&gt;C-c RET&lt;/code&gt; twice.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Scenario 1 - with the &lt;code&gt;\iffalse ... \fi&lt;/code&gt; as shown&lt;/p&gt;&#xA;&lt;p&gt;After the first time the message &lt;code&gt;LaTeX: successfully formatted {1} page&lt;/code&gt; appears in the echo line. After the second time the message &lt;code&gt;View command: TeX-evince-sync-view&lt;/code&gt; appears in the echo line. If I now hit &lt;code&gt;RET&lt;/code&gt;, a pdf viewer opens with the processed document.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Scenario 2 - without the &lt;code&gt;\iffalse&lt;/code&gt; and without the &lt;code&gt;\fi&lt;/code&gt; tags&lt;/p&gt;&#xA;&lt;p&gt;After both the first and the second time the message &lt;code&gt;You should run LaTeX again to get references right, {1} page&lt;/code&gt; appears in the echo line. The pdf file is created and, when opened manually, looks fine, but the pdf viewer does not open from within Emacs as in scenario 1.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;How can I get the same behavior of scenario 1, specifically the automatic opening of the synched pdf file, under the setup of scenario 2?&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-07T20:07:56.120" Title="AUCTeX's pdf viewer doesn't open when Hebrew is the default polyglossia language" Tags="|auctex|latex|bidirectional-support|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7135" PostTypeId="1" AcceptedAnswerId="7137" CreationDate="2015-01-07T17:25:55.443" Score="17" ViewCount="1340" Body="&lt;p&gt;Suppose I want to type '222222' in emacs, how do I use the numeric prefix idiom to achieve this?  A naive guess would be 'C-u 6 2' but emacs interprets this as a numeric prefix of 62 and waits for the next command.  &lt;/p&gt;&#xA;" OwnerUserId="5118" LastEditorUserId="26163" LastEditDate="2023-04-27T15:32:11.657" LastActivityDate="2023-04-27T15:32:11.657" Title="How to use a numeric prefix to repeat insertion of a digit?" Tags="|prefix-argument|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="7136" PostTypeId="2" ParentId="6051" CreationDate="2015-01-07T17:32:38.123" Score="4" Body="&lt;p&gt;Finally found a fix with a bit of a hack with the help of &lt;code&gt;edebug-defun&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The keyword highlighting of shell-script-mode is good. But the problem was that it set the &lt;code&gt;indent-line-function&lt;/code&gt; to &lt;code&gt;sh-basic-indent-line&lt;/code&gt; when &lt;code&gt;sh-shell&lt;/code&gt; was set to &lt;code&gt;tcsh&lt;/code&gt;. That function caused the extra indentation by 4 spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an outdated &lt;a href=&quot;https://github.com/Tux/tcsh/blob/master/csh-mode.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;csh-mode.el&lt;/code&gt;&lt;/a&gt; (last updated in 1999) which does the indentation well but has outdated keyword highlighting info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I simply borrowed the useful stuff (&lt;code&gt;csh-indent-line&lt;/code&gt; and &lt;code&gt;csh-indent-region&lt;/code&gt; functions) from &lt;code&gt;csh-mode.el&lt;/code&gt; when I am editing a &lt;code&gt;.alias&lt;/code&gt; or any file whose extension ends in &lt;code&gt;*csh&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/tcsh-set-indent-functions ()&#xA;  (when (or (string-match &quot;.*\\.alias&quot; (buffer-file-name))&#xA;            (string-match &quot;.*csh$&quot; (file-name-extension (buffer-file-name))))&#xA;    (require 'csh-mode) ; https://github.com/Tux/tcsh/blob/master/csh-mode.el&#xA;    (setq-local indent-line-function 'csh-indent-line)&#xA;    (setq-local indent-region-function 'csh-indent-region)))&#xA;(add-hook 'sh-set-shell-hook #'my/tcsh-set-indent-functions)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-13T14:10:42.807" LastActivityDate="2015-07-13T14:10:42.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7137" PostTypeId="2" ParentId="7135" CreationDate="2015-01-07T17:35:37.530" Score="25" Body="&lt;p&gt;&lt;code&gt;C-u 6 C-u 2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation for &lt;code&gt;universal-argument&lt;/code&gt; (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Begin a numeric argument for the following command.&lt;br&gt;&#xA;  Digits or minus sign following C-u make up the numeric argument.&lt;br&gt;&#xA;  &lt;strong&gt;C-u following the digits or minus sign ends the argument.&lt;/strong&gt;&lt;br&gt;&#xA;  C-u without digits or minus sign provides 4 as argument.&lt;br&gt;&#xA;  Repeating C-u without digits or minus sign&lt;br&gt;&#xA;  multiplies the argument by 4 each time.&lt;br&gt;&#xA;  For some commands, just C-u by itself serves as a flag&lt;br&gt;&#xA;  which is different in effect from any particular numeric argument.&lt;br&gt;&#xA;  These commands include C-SPC and M-x start-kbd-macro.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can find this documentation by typing &lt;code&gt;C-h k C-u&lt;/code&gt; or &lt;code&gt;M-x describe-function RET universal-argument RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-07T17:35:37.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7139" PostTypeId="2" ParentId="7135" CreationDate="2015-01-07T19:15:06.417" Score="4" Body="&lt;p&gt;Your question title doesn't match the body text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to &quot;repeat a number&quot; (singular), nanny's answer has you covered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If (as per the title) you want to &quot;repeat a list of numbers&quot;, I would use a keyboard macro. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;&amp;lt;f3&gt;&lt;/kbd&gt; &lt;code&gt;12345&lt;/code&gt; &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;6&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;f4&gt;&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-01-07T19:15:06.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7140" PostTypeId="1" AcceptedAnswerId="7141" CreationDate="2015-01-07T19:33:58.000" Score="8" ViewCount="1333" Body="&lt;p&gt;I have a function &lt;code&gt;foo-function&lt;/code&gt; that takes the variable &lt;code&gt;x&lt;/code&gt; and performs a specific action.  The variable &lt;code&gt;x&lt;/code&gt; comes before the definition of &lt;code&gt;foo-function&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar x &quot;value1&quot;)&#xA;&#xA;(defun foo-function ()&#xA;  (blabalabla x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to define a new function &lt;code&gt;foo-function2&lt;/code&gt; which takes several variables &lt;code&gt;value1, value2, value3, ....&lt;/code&gt; of &lt;code&gt;x&lt;/code&gt; (the number of variables is indeterminate) and runs the function &lt;code&gt;foo-function&lt;/code&gt; for these variables, i.e., the following action:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo-function2 &quot;value1&quot; &quot;value2&quot; &quot;value3&quot;, ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It should result in the execution of &lt;code&gt;foo-function&lt;/code&gt; for the values &lt;code&gt;value1, value2, value3, ....&lt;/code&gt; of &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I define this function?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="253" LastEditDate="2015-01-07T19:42:29.490" LastActivityDate="2015-01-07T19:43:46.593" Title="How to map a function over several values?" Tags="|elisp|functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7141" PostTypeId="2" ParentId="7140" CreationDate="2015-01-07T19:36:46.453" Score="13" Body="&lt;p&gt;Looks like you want &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mapping-Functions.html&quot;&gt;&lt;code&gt;mapcar&lt;/code&gt;&lt;/a&gt;.  From the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(mapcar FUNCTION SEQUENCE)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Apply FUNCTION to each element of SEQUENCE, and make a list of the results.&#xA;  The result is a list just as long as SEQUENCE.&#xA;  SEQUENCE may be a list, a vector, a bool-vector, or a string.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun identity-fnx (x)&#xA;  x)&#xA;&#xA;(mapcar #'identity-fnx '(1 2 3)) ; =&amp;gt; (1 2 3)&#xA;&#xA;(defvar x '(a b c d))&#xA;(mapcar #'identity-fnx x)        ; =&amp;gt; (a b c d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-01-07T19:43:46.593" LastActivityDate="2015-01-07T19:43:46.593" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7142" PostTypeId="2" ParentId="7134" CreationDate="2015-01-07T19:58:31.160" Score="2" Body="&lt;p&gt;(Converting running comments to an answer.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a partial solution.  It's unclear why AUCTeX perpetually tells you &quot;You should run LaTeX again...&quot; after compiling (but I can confirm that it happened for me as well).  Best guess is that it's something about the fact that &lt;code&gt;polyglossia&lt;/code&gt; requires either &lt;code&gt;xetex&lt;/code&gt; or &lt;code&gt;luatex&lt;/code&gt;, and perhaps the latter don't play as well with AUCTeX as does &lt;code&gt;latex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However: after you compile and create a PDF (to keep it automatic, make sure to set &lt;code&gt;TeX-PDF-mode&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;), you can force AUCTeX to display the PDF in one of two ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-v&lt;/code&gt; (&lt;code&gt;TeX-view&lt;/code&gt;) will open your viewer;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-c&lt;/code&gt; (&lt;code&gt;TeX-command-master&lt;/code&gt;) allows you to type &lt;code&gt;View&lt;/code&gt; and then opens your viewer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-07T19:58:31.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7143" PostTypeId="1" AcceptedAnswerId="7146" CreationDate="2015-01-07T20:11:22.730" Score="5" ViewCount="1635" Body="&lt;p&gt;I would like to &lt;a href=&quot;https://en.wikipedia.org/wiki/Transpose&quot; rel=&quot;nofollow noreferrer&quot;&gt;transpose&lt;/a&gt; this table example from &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org as a spreadsheet system: a short introduction&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Student  | Maths | Physics | Mean |&#xA;|----------+-------+---------+------|&#xA;| Bertrand |    13 |      09 |   11 |&#xA;| Henri    |    15 |      14 | 14.5 |&#xA;| Arnold   |    17 |      13 |   15 |&#xA;#+TBLFM: $4=vmean($2..$3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This part is easy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Student | Bertrand | Henri | Arnold |&#xA;| Maths   |       13 |    15 |     17 |&#xA;| Physics |       09 |    14 |     13 |&#xA;| Total   |          |       |        |&#xA;#+TBLFM: @4=vmean(@2..@3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But after a full recalculation (&lt;code&gt;C-u C-c C-c&lt;/code&gt;), the text &lt;code&gt;(Maths + Physics) / 2&lt;/code&gt; is inserted:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Student               | Bertrand | Henri | Arnold |&#xA;| Maths                 |       13 |    15 |     17 |&#xA;| Physics               |       09 |    14 |     13 |&#xA;| (Maths + Physics) / 2 |       11 |  14.5 |     15 |&#xA;#+TBLFM: @4=vmean(@2..@3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I treat the first column as a header column? I think this would solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update 2014-01-07 6:26 PM EST: The two answers (by &lt;a href=&quot;https://emacs.stackexchange.com/a/7146&quot;&gt;Juanco&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/a/7145&quot;&gt;wvxvw&lt;/a&gt;) work, but is there a way to solve this without changing the formula line at all? Is there a way to tell Org mode that the leftmost column is a header column?&lt;/p&gt;&#xA;" OwnerUserId="2503" LastEditorUserId="14825" LastEditDate="2022-11-05T19:11:38.140" LastActivityDate="2022-11-05T19:11:38.140" Title="Org table: aggregate each column (but not the header column)" Tags="|org-mode|org-table|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7144" PostTypeId="2" ParentId="2367" CreationDate="2015-01-07T20:12:38.010" Score="1" Body="&lt;p&gt;You can use the &lt;a href=&quot;http://www.emacswiki.org/emacs/AnsiColor&quot; rel=&quot;nofollow noreferrer&quot;&gt;ansi-color package&lt;/a&gt; (bundled with Emacs) to handle the output properly without having to turn off colors.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x load-library RET ansi-color RET&#xA;M-: (ansi-color-apply-on-region (point-min) (point-max)) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To automatically apply the function, use the following in your .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; load package&#xA;(require 'ansi-color)&#xA;&#xA;;; function for colorizing&#xA;(defun colorize-buffer ()&#xA;  (interactive)&#xA;  (toggle-read-only)&#xA;  (ansi-color-apply-on-region (point-min) (point-max))&#xA;  (toggle-read-only))&#xA;&#xA;;; add hook to apply the function when magit mode is enabled&#xA;(add-hook 'magit-mode-hook 'colorize-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://stackoverflow.com/questions/3072648/cucumbers-ansi-colors-messing-up-emacs-compilation-buffer&quot;&gt;Cucumber's ANSI colors messing up emacs compilation buffer&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5117" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-01-10T18:13:40.770" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7145" PostTypeId="2" ParentId="7143" CreationDate="2015-01-07T20:43:46.917" Score="3" Body="&lt;p&gt;You also need to specify the range on the left hand side:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Student | Bertrand | Henri | Arnold |&#xA;|---------+----------+-------+--------|&#xA;| Maths   |       13 |    15 |     17 |&#xA;| Physics |       09 |    14 |     13 |&#xA;|---------+----------+-------+--------|&#xA;| Total   |       11 |  14.5 |     15 |&#xA;#+TBLFM: @4$2..@$4=vmean(@2..@3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I understood you correctly.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="2503" LastEditDate="2015-01-08T02:24:04.570" LastActivityDate="2015-01-08T02:24:04.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7146" PostTypeId="2" ParentId="7143" CreationDate="2015-01-07T20:44:00.120" Score="9" Body="&lt;p&gt;You can specify the target cells for the formula to avoid overwriting the first column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @4$&amp;lt;&amp;lt;..@4$&amp;gt;=vmean(@2..@3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;$&amp;lt;&amp;lt;&lt;/code&gt; refers to the second column, and &lt;code&gt;$&amp;gt;&lt;/code&gt; to the last.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-01-07T20:44:00.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7147" PostTypeId="1" AcceptedAnswerId="7149" CreationDate="2015-01-07T20:54:13.387" Score="1" ViewCount="148" Body="&lt;p&gt;I want to temporarily insert an image and a newline in the buffer, all using &lt;code&gt;put-image&lt;/code&gt;.  That is, I want the buffer to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[IMAGE]&#xA;\newline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the newline to be part of the overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the third parameter (&lt;code&gt;STRING&lt;/code&gt;) in &lt;code&gt;put-image&lt;/code&gt; can be used to achieve that effect.  But I am not sure about how to set that parameter.  The code I have unsuccessfully tried is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-image (create-image &quot;image.gif&quot;) (point) #(&quot; \n&quot; 0 1 (display)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For which I get the error &quot;Odd length text property list&quot;. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-01-07T21:55:26.010" Title="how to use the STRING parameter in put-image?" Tags="|images|overlays|image-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7148" PostTypeId="1" AcceptedAnswerId="7150" CreationDate="2015-01-07T21:30:42.477" Score="24" ViewCount="10081" Body="&lt;p&gt;On the Code Golf Stack Exchange site today, I found &lt;a href=&quot;https://codegolf.stackexchange.com/a/44298/33016&quot;&gt;this answer&lt;/a&gt; in Clojure to the question &quot;Get all links on a webpage&quot;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(-&amp;gt;&amp;gt; (slurp &quot;http://www.stroustrup.com&quot;)&#xA;     (re-seq #&quot;(?:http://)?www(?:[./#\+-]\w*)+&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Without the fancy macro, it's just this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(re-seq #&quot;(?:http://)?www(?:[./#\+-]\w*)+&quot; (slurp &quot;http://www.stroustrup.com&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;http://www.morganstanley.com/&quot; &quot;http://www.cs.columbia.edu/&quot; &quot;http://www.cse.tamu.edu&quot; ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I do something similar in Emacs Lisp? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps a function like &lt;code&gt;(re-seq regexp (buffer-string))&lt;/code&gt; that returns &lt;code&gt;'(firstmatch secondmatch thirdmatch ...)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2017-04-13T12:39:29.757" LastActivityDate="2017-02-18T23:03:41.903" Title="Get all regexp matches in buffer as a list" Tags="|elisp|regular-expressions|" AnswerCount="6" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7149" PostTypeId="2" ParentId="7147" CreationDate="2015-01-07T21:55:26.010" Score="2" Body="&lt;p&gt;You're misinterpreting the &lt;code&gt;STRING&lt;/code&gt; parameter here.  The docs state it's a string used as the &lt;code&gt;before-string&lt;/code&gt; property with an image on top of it. Therefore, if you do &lt;code&gt;(put-image (create-image &quot;image.gif&quot;) (point) &quot;Some image&quot;)&lt;/code&gt;, &quot;Some image&quot; would be displayed before point weren't it for the image layered on top of it which visually replaces that text.  You can check this for yourself by trying out that snippet in a graphical and textual Emacs instance and will notice the textual one will indeed display your string (but obviously not your image), sort of like alt-tags in HTML do.  In fact, I assume this is the intended usecase for that parameter in &lt;code&gt;put-image&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, &lt;code&gt;put-image&lt;/code&gt; is the wrong function for that level of control over overlays.  Here's an example that should achieve what you're asking for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((ov (make-overlay (point) (point))))&#xA;  (overlay-put ov 'before-string (propertize &quot; &quot; 'display (create-image &quot;image.gif&quot;)))&#xA;  (overlay-put ov 'after-string &quot;\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-07T21:55:26.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7150" PostTypeId="2" ParentId="7148" CreationDate="2015-01-07T21:58:45.900" Score="21" Body="&lt;p&gt;Here is how you can do it based on strings, as requested.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun re-seq (regexp string)&#xA;  &quot;Get a list of all regexp matches in a string&quot;&#xA;  (save-match-data&#xA;    (let ((pos 0)&#xA;          matches)&#xA;      (while (string-match regexp string pos)&#xA;        (push (match-string 0 string) matches)&#xA;        (setq pos (match-end 0)))&#xA;      matches)))&#xA;&#xA;; Sample URL&#xA;(setq urlreg &quot;\\(?:http://\\)?www\\(?:[./#\+-]\\w*\\)+&quot;)&#xA;; Sample invocation&#xA;(re-seq urlreg (buffer-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2467" LastEditorUserId="2467" LastEditDate="2015-01-07T22:10:46.370" LastActivityDate="2015-01-07T22:10:46.370" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7151" PostTypeId="1" AcceptedAnswerId="7152" CreationDate="2015-01-07T22:07:06.007" Score="11" ViewCount="3907" Body="&lt;p&gt;When I run emacs in a terminal (using the &lt;code&gt;-nw&lt;/code&gt; option) my theme is broken and some key-bindings don't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I need to disable the theme and some keybindings when running in a tty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do that? &lt;/p&gt;&#xA;" OwnerUserId="4110" LastEditorUserId="2355" LastEditDate="2015-01-07T22:31:07.357" LastActivityDate="2018-05-01T10:13:54.647" Title="Is there a way to detect that emacs is running in a terminal?" Tags="|terminal-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7152" PostTypeId="2" ParentId="7151" CreationDate="2015-01-07T22:22:30.880" Score="22" Body="&lt;p&gt;You can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Feature-Testing.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;display-graphic-p&lt;/code&gt;&lt;/a&gt; to determine if you are running in a terminal or a windowing system.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you could do your setup so that you only add those keybindings and theme if you know you're on a window system.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (display-graphic-p) &#xA;    ;; Do any keybindings and theme setup here&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also do the reverse, and turn off your keybindings and theme.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(unless (display-graphic-p) &#xA;    ;; Remove any keybindings and theme setup here&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2467" LastEditorUserId="14324" LastEditDate="2018-05-01T10:13:54.647" LastActivityDate="2018-05-01T10:13:54.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7153" PostTypeId="2" ParentId="7148" CreationDate="2015-01-07T22:44:25.033" Score="4" Body="&lt;p&gt;Using &lt;code&gt;s.el&lt;/code&gt; this would've been shorter, but, unfortunately, it gives too many matches:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun all-urls-in-buffer ()&#xA;  (s-match-strings-all&#xA;   &quot;\\(?:http://\\)?www\\(?:[./#+-]\\w*\\)+&quot;&#xA;   (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If this is ok (the regex for URLs isn't perfect anyway), this just might be shorter, and if not, then I don't think I could make it shorter than Alan Shutko's answer.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-07T22:44:25.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7154" PostTypeId="1" AcceptedAnswerId="7155" CreationDate="2015-01-08T00:50:40.727" Score="5" ViewCount="1612" Body="&lt;p&gt;When I open a file from the context menu by choosing &quot;Open with Emacs&quot;, Emacs starts with a horizontal splitscreen. The first window shows the desired file and the other one the home screen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to change the behaviour of emacs so that only the file is opened without the home screen?&lt;/p&gt;&#xA;" OwnerUserId="5122" LastEditorUserId="50" LastEditDate="2015-01-08T01:57:14.857" LastActivityDate="2015-01-08T01:57:14.857" Title="Open a file from the desktop in a single window (without home screen splitscreen)" Tags="|window|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7155" PostTypeId="2" ParentId="7154" CreationDate="2015-01-08T01:26:07.733" Score="8" Body="&lt;p&gt;If by home screen you mean this screen&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[&lt;img src=&quot;https://i.stack.imgur.com/TZKcy.jpg&quot; alt=&quot;&quot;&gt;]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;just check the &quot;Never show it again.&quot; checkbox and click on the &quot;Dismiss this startup screen&quot; button.  Or you can set the &lt;code&gt;inhibit-startup-screen&lt;/code&gt; variable to t by customizing it (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-variable&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;inhibit-startup-screen&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;) or adding&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inhibit-startup-screen t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init file.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-01-08T01:26:07.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7156" PostTypeId="2" ParentId="7148" CreationDate="2015-01-08T03:00:57.293" Score="10" Body="&lt;p&gt;I have an emacs lisp answer to that question posted: &lt;a href=&quot;https://codegolf.stackexchange.com/a/44319/18848&quot;&gt;https://codegolf.stackexchange.com/a/44319/18848&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the same (while (search) (print)) structure you could modify it into a function to push matches in a buffer to a list and return it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun matches-in-buffer (regexp &amp;amp;optional buffer)&#xA;  &quot;return a list of matches of REGEXP in BUFFER or the current buffer if not given.&quot;&#xA;  (let ((matches))&#xA;    (save-match-data&#xA;      (save-excursion&#xA;        (with-current-buffer (or buffer (current-buffer))&#xA;          (save-restriction&#xA;            (widen)&#xA;            (goto-char 1)&#xA;            (while (search-forward-regexp regexp nil t 1)&#xA;              (push (match-string 0) matches)))))&#xA;      matches)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-04-13T12:39:29.757" LastActivityDate="2015-01-08T03:00:57.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7157" PostTypeId="1" AcceptedAnswerId="7161" CreationDate="2015-01-08T03:06:26.800" Score="5" ViewCount="1444" Body="&lt;p&gt;When using org-mode to create Beamer slides, sometimes the error shown is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;Pdf file ... wasn't produced&quot;  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or the previous PDF file generated is opened (without the changes made) when the command &lt;code&gt;C-c C-e l o&lt;/code&gt; is issued to open the PDF directly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the .tex file generated from export to Beamer when compiled separately does give the PDF. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there is no debug message given, I am not sure how to detect why the export to Beamer to open the slides directly is not working. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we detect the source of error in exporting org files ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2517" LastEditorUserId="504" LastEditDate="2015-02-20T13:04:01.867" LastActivityDate="2015-02-20T13:04:01.867" Title="How to debug org-mode export to Beamer?" Tags="|org-mode|beamer|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7158" PostTypeId="2" ParentId="5428" CreationDate="2015-01-08T03:30:41.200" Score="2" Body="&lt;p&gt;Blatantly stolen from &lt;a href=&quot;https://unix.stackexchange.com/questions/114238/is-it-possibe-to-change-parent-shells-working-directory-programmatically&quot;&gt;https://unix.stackexchange.com/questions/114238/is-it-possibe-to-change-parent-shells-working-directory-programmatically&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming I've got the syntax right for embedding &quot; in a string, this should do it.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun restart-emacs ()&#xA;  (call-process &quot;sh&quot; nil nil nil &quot;-c&quot; &quot;gdb -p $(ps h -o ppid -p $$) -ex 'call execl(\&quot;/bin/sh\&quot;, \&quot;/bin/sh\&quot;, \&quot;-c\&quot;, \&quot;exec emacs\&quot;)'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5124" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2015-01-08T07:53:32.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7159" PostTypeId="1" AcceptedAnswerId="7395" CreationDate="2015-01-08T06:42:30.283" Score="4" ViewCount="722" Body="&lt;p&gt;I'm not entirely sure what the problem is. I'm using the same version of Emacs on three different computers ( laptop, work, home ), and the problem only shows up on one machine ( the home machine ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, when I'm using Emacs ( 24.4, compiled from downloaded tar.gz ) Emacs seems to take quite a while to do any sort of vertical rendering. Scrolling, finding a file ( using a custom ido vertical mode ), helm... anything that requires Emacs to render vertically seems to slow down Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't seem to have to do anything with how many lines are in the current buffer, the slow-down happens even in the scratch buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried starting with &lt;code&gt;emacs -Q&lt;/code&gt;, and it still happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oddly, it's CPU/memory usage stays pretty low while this rendering is happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took &lt;a href=&quot;https://www.youtube.com/watch?v=KcFtV2tyMOw&amp;amp;feature=youtu.be&quot; rel=&quot;nofollow&quot;&gt;a video&lt;/a&gt; of the weirdness, just in case my description wasn't super clear.&lt;/p&gt;&#xA;" OwnerUserId="5127" LastActivityDate="2016-06-25T22:18:05.327" Title="Emacs very slow on one machine" Tags="|emacs24.4|" AnswerCount="2" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="7160" PostTypeId="2" ParentId="7143" CreationDate="2015-01-08T07:09:39.423" Score="2" Body="&lt;p&gt;If I understand your questions &amp;amp; concerns correctly, you want to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Transpose an org-mode table&lt;/li&gt;&#xA;&lt;li&gt;Use the &lt;code&gt;#+TBLFM: @4=vmean(@2..@3)&lt;/code&gt; formula but this&lt;br&gt;&#xA;overwrites the word &lt;strong&gt;Total&lt;/strong&gt; with &lt;strong&gt;(Maths + Physics) / 2&lt;/strong&gt; which is unacceptable.&lt;/li&gt;&#xA;&lt;li&gt;Leave the &lt;code&gt;#+TBLFM: @4=vmean(@2..@3)&lt;/code&gt; line &lt;strong&gt;as-is&lt;/strong&gt; but have org-mode ignore first column in the table when applying the formula.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There is feature that will instructs org-mode to ignore the first column, &lt;code&gt;:rownames&lt;/code&gt;, or first row, &lt;code&gt;:colnames&lt;/code&gt;, of a table when performing calculations.&#xA;Unfortunately, you will need to pass the table into code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple example demonstrating &lt;code&gt;:rownames&lt;/code&gt; and &lt;code&gt;:colnames&lt;/code&gt; headers on a code block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: ex-rownames-colnames&#xA;|   | C |  D |&#xA;|---+---+----|&#xA;| A | 2 |  9 |&#xA;| B | 4 | 16 |&#xA;&#xA;#+name: add-ten-to-table&#xA;#+header: :colnames yes &#xA;#+header: :rownames yes&#xA;#+header: :var tab=ex-rownames-colnames&#xA;#+Begin_src python&#xA;   return [[val + 10 for val in row] for row in tab]&#xA;#+end_src&#xA;&#xA;#+RESULTS: add-ten-to-table&#xA;|   |  C |  D |&#xA;|---+----+----|&#xA;| A | 12 | 19 |&#xA;| B | 14 | 26 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using this method to solve your &lt;strong&gt;total&lt;/strong&gt; display issue is probably &lt;em&gt;overkill&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest solution is to modify &lt;code&gt;#+TBLFM: @4=vmean(@2..@3)&lt;/code&gt; as &lt;a href=&quot;https://emacs.stackexchange.com/a/7146/388&quot;&gt;Juanco&lt;/a&gt; or &lt;a href=&quot;https://emacs.stackexchange.com/a/7145/388&quot;&gt;wvxvw&lt;/a&gt; suggested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helped.&lt;/p&gt;&#xA;" OwnerUserId="388" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-01-08T07:09:39.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7161" PostTypeId="2" ParentId="7157" CreationDate="2015-01-08T09:31:12.753" Score="6" Body="&lt;p&gt;As you mention, &lt;code&gt;org-mode&lt;/code&gt; does not make use of the echo area to show export errors. Instead, it dumps all output that is produced during LaTeX export to a buffer called &lt;code&gt;*Org PDF LaTeX Output*&lt;/code&gt;. If you want to get information about why the export process failed, you can switch to this buffer and search for &lt;code&gt;error&lt;/code&gt; (or even &lt;code&gt;warning&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Contents of &lt;code&gt;.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;  \begin{algorithm}&#xA;  ...&#xA;  \end{algorithm}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Contents of &lt;code&gt;*Org PDF LaTeX Output*&lt;/code&gt; buffer (abbreviated to show relevant parts only):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is pdfTeX, Version 3.14159265-2.6-1.40.15 ... (preloaded format=pdflatex) ...&#xA;LaTeX2e &amp;lt;2014/05/01&amp;gt;&#xA;...&#xA;&#xA;LaTeX Warning: No \author given.&#xA;&#xA;(.//beamer.toc)&#xA;&#xA;! LaTeX Error: Environment algorithm undefined.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.32 \begin{algorithm}&#xA;&#xA;! LaTeX Error: \begin{document} ended by \end{algorithm}.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.33 \end{algorithm}&#xA;&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, the output tells us that the error was caused by the &lt;code&gt;\begin{algorithm}&lt;/code&gt; declaration in line 32. Note that specifications of line numbers (&lt;code&gt;l.32&lt;/code&gt;, &lt;code&gt;l.33&lt;/code&gt;, etc.) refer to the &lt;code&gt;.tex&lt;/code&gt; file, not to the original &lt;code&gt;.org&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-08T09:41:16.977" LastActivityDate="2015-01-08T09:41:16.977" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7162" PostTypeId="1" CreationDate="2015-01-08T11:17:46.173" Score="7" ViewCount="1629" Body="&lt;p&gt;Sometimes to speed up of opening an emacs' eshell directly from terminal (in my case from MS DOS prompt), I do &lt;code&gt;emacs -Q -f eshell&lt;/code&gt;. But when I try to exit emacs doesn't let it, unless I give some input to the below message in the mini-buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;select coding system (default utf-8):&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is really undesirable. I just like to exit and I don't care about the encoding. Is there a way to bypass this message?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Added 2:&#xA;In the * Warning * buffer I get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;These default coding systems were tried to encode text&#xA;in the buffer ` *temp*':&#xA;  (iso-latin-1-dos (718 . 1575) (719 . 1606) (721 . 1583) (722 . 1604)&#xA;  (723 . 1582) (724 . 1608) (725 . 1575) (726 . 1607) (728 . 1575)&#xA;  (729 . 1585) (730 . 1575))&#xA;However, each of them encountered characters it couldn't encode:&#xA;  iso-latin-1-dos cannot encode these: ا ن د ل خ و ا ه ا ر ...&#xA;&#xA;Click on a character (or switch to this window by `C-x o'&#xA;and select the characters by RET) to jump to the place it appears,&#xA;where `C-u C-x =' will give information about it.&#xA;&#xA;Select one of the safe coding systems listed below,&#xA;or cancel the writing with C-g and edit the buffer&#xA;   to remove or modify the problematic characters,&#xA;or specify any other coding system (and risk losing&#xA;   the problematic characters).&#xA;&#xA;  utf-8 gb18030 utf-7 utf-16 utf-16be-with-signature&#xA;  utf-16le-with-signature utf-16be utf-16le iso-2022-7bit utf-8-auto&#xA;  utf-8-with-signature utf-7-imap utf-8-emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It appear the buffer * temp * is the last entries of my previous eshells. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a search, I found a post &lt;a href=&quot;http://sourceforge.net/p/cedet/mailman/message/23702016/&quot; rel=&quot;noreferrer&quot;&gt;http://sourceforge.net/p/cedet/mailman/message/23702016/&lt;/a&gt;, by David Engster in which it is suggested that a bug is responsible for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Added 2: I should mention that if I go to eshell without the argument &lt;code&gt;-Q&lt;/code&gt; this problem doesn't arise.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="306" LastEditDate="2015-01-08T17:25:09.953" LastActivityDate="2018-08-02T18:39:49.747" Title="Emacs doesn't let me exit without selecting a coding system" Tags="|character-encoding|auto-save|quitting|" AnswerCount="2" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="7163" PostTypeId="1" CreationDate="2015-01-08T13:17:31.600" Score="0" ViewCount="500" Body="&lt;p&gt;I'm using &lt;code&gt;TeXLive 2014&lt;/code&gt; on &lt;code&gt;MacOS X 10.6&lt;/code&gt; and I'm currently working with &lt;code&gt;Aquamacs 2.5&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently using two different shell scripts for compiling my &lt;code&gt;LaTeX&lt;/code&gt; document (thesis), which are located in &lt;code&gt;~/bin/script1.sh&lt;/code&gt; and &lt;code&gt;~/bin/script2.sh&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;At the moment I always switch to the terminal application for compiling and launch one of those commands there. &lt;/li&gt;&#xA;&lt;li&gt;I'd &lt;strong&gt;like to define a custom keybinding&lt;/strong&gt; in &lt;code&gt;Emacs&lt;/code&gt; which lets me run those scripts directly without leaving Emacs. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="2377" LastActivityDate="2015-01-08T20:43:47.947" Title="How to define custom compile commands in auctex?" Tags="|auctex|shell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7164" PostTypeId="2" ParentId="5524" CreationDate="2015-01-08T13:22:29.987" Score="2" Body="&lt;p&gt;Defining your style based on linux instead of cc-mode should help. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst my-cc-style&#xA; '(&quot;linux&quot; ; this is inheritance from the linux style&#xA;   (c-offsets-alist . ((innamespace . [0])))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2173" LastActivityDate="2015-01-08T13:22:29.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7166" PostTypeId="2" ParentId="6038" CreationDate="2015-01-08T13:39:24.917" Score="0" Body="&lt;p&gt;In short, when &lt;code&gt;defcustom&lt;/code&gt;s are sorted alphabetically[^1], it is by their identifier name -- never by their &lt;code&gt;:tag&lt;/code&gt; (if any).&lt;/p&gt;&#xA;&lt;p&gt;You might use &lt;code&gt;:tag&lt;/code&gt; because your identifier name is ideal for code, but less so in the customization UI. A related motivation is that &lt;code&gt;:prefix&lt;/code&gt; no longer has any effect[^2]. But if the tag sorts differently than the identifier name, you might get confused, as I did.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;[^1]: As @angus pointed out, the customization order is ultimately under control of the user, in a customization for custom buffers: &lt;code&gt;Help / Customize / Custom Buffer / Custom Buffer Sort Automatically: &amp;quot;Whether to sort customization groups alphabetically in Custom buffer.&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;[^2]: Commentary not in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Group-Definitions.html#Group-Definitions&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU docs&lt;/a&gt; I originally read, but that I found &lt;a href=&quot;http://sunsite.ualberta.ca/Documentation/Gnu/emacs-lisp-ref-20.5/html_chapter/elisp_14.html#SEC182&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The prefix-discarding feature is currently turned off, which means that :prefix currently has no effect. We did this because we found that discarding the specified prefixes often led to confusing names for options. This happened because the people who wrote the defgroup definitions for various groups added :prefix keywords whenever they make logical sense--that is, whenever the variables in the library have a common prefix.&lt;/p&gt;&#xA;&lt;p&gt;In order to obtain good results with :prefix, it would be necessary to check the specific effects of discarding a particular prefix, given the specific items in a group and their names and documentation. If the resulting text is not clear, then :prefix should not be used in that case.&lt;/p&gt;&#xA;&lt;p&gt;It should be possible to recheck all the customization groups, delete the :prefix specifications which give unclear results, and then turn this feature back on, if someone would like to do the work.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="849" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-08T13:39:24.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7167" PostTypeId="2" ParentId="7148" CreationDate="2015-01-08T14:06:19.297" Score="3" Body="&lt;p&gt;Let me just mention why I think this is not implemented in the core.&#xA;Simply for efficiency reasons: there's no need to copy, create lists,&#xA;pass them around and garbage collect them. Instead, store the whole&#xA;string as the buffer, and operate with integer match bounds. That's how&#xA;&lt;code&gt;occur&lt;/code&gt; works, for instance: it matches one string at a time and&#xA;inserts the match into &lt;code&gt;*occur*&lt;/code&gt;.  It doesn't match all the strings at&#xA;once, make them into the list, loop on the list to insert into&#xA;&lt;code&gt;*occur*&lt;/code&gt; and garbage collect the list and its strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just like you wouldn't write &lt;code&gt;(do (def x 1) (def x (+ 2 x)))&lt;/code&gt; in&#xA;Clojure, you shouldn't by default try to have Elisp behave like a&#xA;functional language.  I'd love it if it was, but we have to make due&#xA;with what we've got at the moment.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-08T14:06:19.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7169" PostTypeId="1" AcceptedAnswerId="7209" CreationDate="2015-01-08T15:01:54.043" Score="0" ViewCount="1363" Body="&lt;p&gt;I have some code from &quot;Writing GNU emacs extensions&quot;. It is merely a script that allows you to get back to the previous position, kinda like an undo for the buffer position:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'scroll-up 'unscrollable t)&#xA;(put 'scroll-down 'unscrollable t)&#xA;(put 'scroll-left 'unscrollable t)&#xA;(put 'scroll-right 'unscrollable t)&#xA;&#xA;&#xA;(defvar unscroll-point (make-marker)&#xA;  &quot;Text position for next call to 'unscroll'.&quot;)&#xA;&#xA;(defvar unscroll-window-start nil&#xA;  &quot;Window start for next call to unscroll.&quot;)&#xA;&#xA;(defvar unscroll-hscroll nil&#xA;  &quot;Hscroll for next call to 'unscroll'.&quot;)&#xA;&#xA;(defadvice scroll-up (before remember-for-unscroll&#xA;                             activate compile)&#xA;  &quot;Remember where we started from, for unscroll.&quot;&#xA;  (unscroll-maybe-remember))&#xA;&#xA;(defadvice scroll-down (before remember-for-unscroll&#xA;                             activate compile)&#xA;  &quot;Remember where we started from, for unscroll.&quot;&#xA;  (unscroll-maybe-remember))&#xA;&#xA;(defun unscroll-maybe-remember ()&#xA;  (if (not (get last-command 'unscrollable))&#xA;      (progn&#xA;        (set-marker unscroll-point (point))&#xA;        (setq unscroll-window-start (window-start))&#xA;        (setq unscroll-hscroll (window-hscroll)))))&#xA;&#xA;(defun unscroll ()&#xA;  (interactive)&#xA;  (goto-char unscroll-point)&#xA;  (set-window-start nil unscroll-window-start)&#xA;  (set-window-hscroll nil unscroll-hscroll))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Problem is, it does not work. When I try to use &lt;code&gt;Ctrl-f&lt;/code&gt; and &lt;code&gt;Ctrl-b&lt;/code&gt;* I get following error below the mode-line: &lt;code&gt;wrong type argument markerp&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I change the lines using markers to use points it works. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar unscroll-point nil&#xA;  &quot;Text position for next call to 'unscroll'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun unscroll-maybe-remember ()&#xA;  (if (not (get last-command 'unscrollable))&#xA;      (progn&#xA;        (setq unscroll-point (point))&#xA;        (setq unscroll-window-start (window-start))&#xA;        (setq unscroll-hscroll (window-hscroll))))) ;; I know setq can take multiple arguments&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to use markers since these are robust and are unaffected by buffer edits. How do I fix this code? The book is almost 20 years old, but all the code has worked so far. Dunno if this used to be correct, but isn't anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*are these evil-commands or not? Can't remember...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the debug-info:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument markerp 8245)&#xA;  set-marker(8245 176)&#xA;  (progn (set-marker unscroll-point (point)) (setq unscroll-window-start (window-start)) (setq unscroll-hscroll (window-hscroll)))&#xA;  (if (not (get last-command (quote unscrollable))) (progn (set-marker unscroll-point (point)) (setq unscroll-window-start (window-start)) (setq unscroll-hscroll (window-hscroll))))&#xA;  unscroll-maybe-remember()&#xA;  ad-Advice-scroll-up(#&amp;lt;subr scroll-up&amp;gt; nil)&#xA;  apply(ad-Advice-scroll-up #&amp;lt;subr scroll-up&amp;gt; nil)&#xA;  scroll-up(nil)&#xA;  evil-scroll-page-down(1)&#xA;  funcall-interactively(evil-scroll-page-down 1)&#xA;  call-interactively(evil-scroll-page-down nil nil)&#xA;  command-execute(evil-scroll-page-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2015-01-09T12:33:36.613" LastActivityDate="2015-01-09T13:34:41.877" Title="Wrong type argument: markerp" Tags="|elisp|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7170" PostTypeId="2" ParentId="3746" CreationDate="2015-01-08T15:11:54.303" Score="4" Body="&lt;p&gt;I came up with a minimal way of implementing this functionality: just bind space bar to also call &lt;code&gt;(fill-paragraph)&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fill-then-insert-space ()&#xA;  (interactive)&#xA;  (fill-paragraph)&#xA;  (insert &quot; &quot;))&#xA;(global-set-key (kbd &quot;SPC&quot;) #'fill-then-insert-space)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are a couple of caveat's that I've stumbled across so far:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;elisp-mode&lt;/code&gt; (possibly others) does some fancy code filling when you call &lt;code&gt;fill-paragraph&lt;/code&gt;, this may or may not be what you want. Can probably be fixed with by testing if point is in a comment or docstring but I'm not sure how to do that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You sometimes can't easily enter multiple spaces (because the &lt;code&gt;fill-paragraph&lt;/code&gt; kills any trailing spaces). Since the space-bar now acts like &lt;code&gt;just-one-space&lt;/code&gt; it's probably ok to replace that binding with &lt;code&gt;(insert &quot; &quot;)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I made a minor-mode containing this functionality, it's available on &lt;a href=&quot;https://github.com/davidshepherd7/aggressive-fill-paragraph-mode&quot; rel=&quot;nofollow&quot;&gt;github&lt;/a&gt; or in the melpa package &lt;code&gt;aggressive-fill-paragraph&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="237" LastEditorUserId="237" LastEditDate="2015-01-21T14:43:26.613" LastActivityDate="2015-01-21T14:43:26.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7171" PostTypeId="1" AcceptedAnswerId="8191" CreationDate="2015-01-08T15:35:26.343" Score="19" ViewCount="4333" Body="&lt;p&gt;Is there any easy way to copy/paste text from a browser window into an org file, automatically converting  links into [[][]] org-mode links? thanks!&lt;/p&gt;&#xA;" OwnerUserId="5131" LastEditorUserId="1985" LastEditDate="2015-01-12T11:35:08.300" LastActivityDate="2021-10-03T11:53:42.193" Title="paste html into org mode" Tags="|org-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7172" PostTypeId="1" AcceptedAnswerId="7194" CreationDate="2015-01-08T15:39:25.293" Score="4" ViewCount="1978" Body="&lt;p&gt;I ssh'd into a remote server from &lt;em&gt;shell&lt;/em&gt; and tried to open a file on a directory path that also exists on my local system. The list of files I was able to open using &lt;code&gt;helm-find-files&lt;/code&gt; was the list on my local machine, and not on the ssh'd system. How can I configure Emacs to be smart enough to provide me the list of files on the path for the remote server?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-01-09T03:04:01.500" Title="transparently find file over ssh in *shell* directory" Tags="|helm|shell|tramp|find-file|ssh|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7175" PostTypeId="1" CreationDate="2015-01-08T16:15:52.167" Score="0" ViewCount="50" Body="&lt;p&gt;Is there any configuration or package, which can make Org-mode checks the modified time of all &lt;code&gt;#+RESULTS&lt;/code&gt;' files before &lt;code&gt;export&lt;/code&gt; (maybe auto add a &lt;code&gt;#+MODTIME&lt;/code&gt; for comparing I guess), then decide if a code block needed to be re-evaluate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An Org file with a lot of &lt;code&gt;gnuplot&lt;/code&gt; code blocks makes exporting very, very time-consuming...&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2015-01-08T16:29:09.037" LastActivityDate="2015-01-08T19:18:47.513" Title="Check the modified time of #+RESULTS file before exporting, then evaluate the code blocks selectively to save time?" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7176" PostTypeId="1" CreationDate="2015-01-08T16:41:11.830" Score="3" ViewCount="201" Body="&lt;p&gt;In one of my packages, I use a loop with &lt;code&gt;completing-read&lt;/code&gt; to query the user for a list of words. Inside the prompt, I'd like to bind &lt;code&gt;DEL&lt;/code&gt; to a different command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I achieve that?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution also needs to work with &lt;code&gt;ido-completing-read&lt;/code&gt; (possibly with small modifications of course). &lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-08T17:34:58.573" Title="How to bind a key inside the completing-read prompt?" Tags="|key-bindings|ido|minibuffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7177" PostTypeId="2" ParentId="7176" CreationDate="2015-01-08T16:54:53.350" Score="1" Body="&lt;p&gt;There are of course keymaps you can bind stuff to. For example you could temporarily merge &lt;em&gt;minibuffer-local-filename-completion-map&lt;/em&gt; with your extra keys. From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Local keymap for minibuffer input with completion for filenames.&#xA;Gets combined either with `minibuffer-local-completion-map' or&#xA;with `minibuffer-local-must-match-map'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-01-08T16:54:53.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7178" PostTypeId="1" AcceptedAnswerId="7205" CreationDate="2015-01-08T17:14:22.493" Score="1" ViewCount="1353" Body="&lt;p&gt;I got thankfully introduced to use helm and helm-projectile for all the goodies it has and especially the &lt;code&gt;helm-projectile-grep-search&lt;/code&gt;. I must say, this supercharged Emacs by a long shot. I learned that from this great tutorial : &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tuhdo.github.io/helm-projectile.html&lt;/a&gt;.  Unfortunately, everyhting else was fine except grep search-related commands, they throwed this error by invoking them on my machine:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Error during redisplay: (eval (helm-show-candidate-number (car-safe helm-mode-line-string))) signaled (wrong-type-argument integer-or-marker-p nil) [6 times]&#xA;Error running timer helm-projectile-grep-or-ack: (wrong-type-argument stringp nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same error was issued when I used &lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;C-u C-s&lt;/code&gt; recursive grep search while in &lt;code&gt;helm-find-files&lt;/code&gt; bound to &lt;code&gt;C-x C-f&lt;/code&gt;. I run this on marked files with &lt;code&gt;C-SPC&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;rgrep&lt;/code&gt; works well which is built in Emacs (see image below). So I don't know what am I missing to get grep search work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ikTYX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;br&gt;&#xA;Machine: Windows 7 32bit.&lt;br&gt;&#xA;Emacs 24.4&lt;br&gt;&#xA;Helm/Projectile/Helm-projectile all updated from MELPA.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have installed Cygwin and added to Path:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PKDo6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-01-09T11:56:58.947" LastActivityDate="2015-01-09T13:52:03.570" Title="Can't get grep search in helm-projectile working?" Tags="|helm|microsoft-windows|projectile|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="7179" PostTypeId="2" ParentId="7176" CreationDate="2015-01-08T17:34:58.573" Score="1" Body="&lt;p&gt;Just have your &lt;em&gt;command&lt;/em&gt; bind the key you want in the appropriate minibuffer keymap, and then unbind it there when the command is done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[You do not need to merge keymaps. You just need to bind the key in a map that is already being used (whether it was merged or not).]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minibuffer keymaps that involve completion (depending on your Emacs version):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;minibuffer-local-completion-map  &#xA;minibuffer-local-filename-completion-map&#xA;minibuffer-local-filename-must-match-map        &#xA;minibuffer-local-must-match-filename-map&#xA;minibuffer-local-must-match-map &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-08T17:34:58.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7180" PostTypeId="1" CreationDate="2015-01-08T17:49:09.807" Score="0" ViewCount="1477" Body="&lt;p&gt;Been trying to follow this guide to setting up SQLi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://truongtx.me/2014/08/23/setup-emacs-as-an-sql-database-client/&quot; rel=&quot;nofollow&quot;&gt;http://truongtx.me/2014/08/23/setup-emacs-as-an-sql-database-client/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Customize Group SQL to set the parameters (host, username, etc.,) and that seems to go fine. I choose the MySQL product, also fine. Then I attempt to start the SQLi session and I get a new buffer with &lt;em&gt;SQL&lt;/em&gt; as the name and SQLi[MySQL]:no process in the modeline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buffer says: 'emacs': I need something more specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I doing something wrong?&lt;/p&gt;&#xA;" OwnerUserId="5132" LastActivityDate="2019-04-14T15:02:45.623" Title="Trying to connect to a MySQL database using SQLi with no luck" Tags="|sql-interactive-mode|" AnswerCount="1" CommentCount="6" ClosedDate="2019-04-15T16:26:29.350" ContentLicense="CC BY-SA 3.0" />
  <row Id="7183" PostTypeId="1" AcceptedAnswerId="7202" CreationDate="2015-01-08T19:23:27.817" Score="2" ViewCount="633" Body="&lt;p&gt;I'm aware of &lt;code&gt;#+OPTIONS: tags:nil&lt;/code&gt; to have tags not be exported. I'd like them exported to LaTeX exports, but not ASCII exports. Is there a way to have options only apply to certain exports? Is there some other method to have ASCII export drop tags?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-01-10T00:51:36.900" Title="Remove Org-mode tags from ASCII but not LaTeX export" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7184" PostTypeId="1" AcceptedAnswerId="7185" CreationDate="2015-01-08T19:32:10.347" Score="7" ViewCount="2245" Body="&lt;p&gt;I'm trying to add line numbers to emacs, following this guide: &lt;a href=&quot;http://www.emacswiki.org/emacs/LineNumbers#toc1&quot;&gt;Linum: Separating line numbers from text&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to edit &quot;linum.el&quot; to add some code, however I can't find that file.&#xA;I'm using ubuntu, I have tried using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find */* linum.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I'm getting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find: `linum.el': No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5133" LastEditorUserId="253" LastEditDate="2015-01-08T20:11:24.183" LastActivityDate="2015-01-11T07:13:39.787" Title="where are emacs lisp files?" Tags="|elisp|linum-mode|libraries|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7185" PostTypeId="2" ParentId="7184" CreationDate="2015-01-08T19:34:11.163" Score="14" Body="&lt;p&gt;&lt;code&gt;M-x find-library&lt;/code&gt; will let you select a library and take you to the source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you may not have the elisp files installed on your machine.  For Ubuntu, try installing &lt;a href=&quot;http://packages.ubuntu.com/trusty/emacs24-el&quot;&gt;&lt;code&gt;emacs24-el&lt;/code&gt;&lt;/a&gt; (or whatever version you're on; look for the &lt;code&gt;...-el&lt;/code&gt; to get the elisp source). &lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-01-08T20:31:38.007" LastActivityDate="2015-01-08T20:31:38.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7186" PostTypeId="2" ParentId="7184" CreationDate="2015-01-08T19:36:42.450" Score="5" Body="&lt;p&gt;If you are looking for source of a function &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt;, you can find a link to the source in the description of the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h f &amp;lt;name&amp;gt; RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your case it will be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h f linum-mode RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Starting from Emacs 24.3 &lt;code&gt;C-h f&lt;/code&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/news/NEWS.24.3&quot; rel=&quot;nofollow&quot;&gt;can perform autoloading&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When this command is called for an autoloaded function whose docstring&#xA;  contains a key substitution construct, that function's library is&#xA;  automatically loaded, so that the documentation can be shown&#xA;  correctly.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-01-08T20:10:24.357" LastActivityDate="2015-01-08T20:10:24.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7187" PostTypeId="2" ParentId="2173" CreationDate="2015-01-08T19:48:33.127" Score="9" Body="&lt;p&gt;When Emacs 25 will be released you'll find its NEWS file here: &lt;a href=&quot;http://www.gnu.org/software/emacs/news&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/news&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="105" LastEditDate="2015-08-12T14:38:21.277" LastActivityDate="2015-08-12T14:38:21.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7188" PostTypeId="2" ParentId="7163" CreationDate="2015-01-08T20:33:30.663" Score="1" Body="&lt;p&gt;I assume you call your compile scripts like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/bin/script1.bash master.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and that you only has to call it once. In this case here's a defun which does it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tex-custom-compile (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  &quot;Calls `~/bin/script1.sh' on file associated with current buffer.&#xA;With C-u calls `~/bin/script2.sh' instead&quot;&#xA;  (let (script texFile)&#xA;&#xA;    (cond&#xA;     ((equal arg '(4))&#xA;      (setq script &quot;~/bin/script2.sh &quot;)&#xA;     )&#xA;     (t&#xA;      (setq script &quot;~/bin/script1.sh &quot;)&#xA;     )&#xA;    )&#xA;&#xA;    (async-shell-command &#xA;     (concat&#xA;      script&#xA;      (buffer-file-name)&#xA;     )&#xA;    )&#xA;  )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This defun should be easy to tweak to adjust it to your particular need. When you are satisfied with this defun bind it to a key:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key TeX-mode-map (kbd &quot;C-c C-t C-p&quot;) 'tex-custom-compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-01-08T20:43:47.947" LastActivityDate="2015-01-08T20:43:47.947" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7189" PostTypeId="1" AcceptedAnswerId="7192" CreationDate="2015-01-08T20:49:22.357" Score="3" ViewCount="214" Body="&lt;p&gt;I'm working with files which are stored on a server. The structure on the server is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;//SBS/share/path/to/somewhere/2007/&#xA;//SBS/share/path/to/somewhere/2008/&#xA;//SBS/share/path/to/somewhere/2009/&#xA;...&#xA;//SBS/share/path/to/somewhere/2015/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In every years folder are the folders of the year, sometimes up to 1000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.4 is running on a Win 7 machine. I used to map the folders of the years with letters (&lt;code&gt;X:&lt;/code&gt;), but I'm running out of letters now, 2015 is mapped to &lt;code&gt;Z:&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I wish to open a file of the year 2015, I do: &lt;code&gt;C-x C-f&lt;/code&gt;, delete whatever appears in the minibuffer, type &lt;code&gt;Z:&lt;/code&gt;, followed by the first letters of the folder. Without mapping the share to Z:, I'd have to type much more:&#xA;    //SBS/share/path/to/somewhere/2015/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs can't handle the Windows shortcuts &lt;code&gt;*.lnk&lt;/code&gt;. Windows can't map more shares than 26.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My general idea is that I could customise the command &quot;find file&quot; (C-x C-f) somehow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'd like to have that I just type something like C-x C-f 2015 and get &#xA;in the minibuffer the line: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Find file: //SBS/share/path/to/somewhere/2015/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the cursor on the point after the last &quot;/&quot; and the usual auto-complition working, so that typing &lt;code&gt;foo&lt;/code&gt; will be completed to &lt;code&gt;foo.tex&lt;/code&gt;, if this exists (or a folder called foo). &lt;/p&gt;&#xA;" OwnerUserId="2334" LastEditorUserId="2334" LastEditDate="2015-01-08T21:46:45.780" LastActivityDate="2015-05-09T20:29:57.057" Title="Running out of L:/ etters: shortcut for path needed" Tags="|customize|find-file|" AnswerCount="3" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7191" PostTypeId="1" CreationDate="2015-01-08T23:24:58.580" Score="7" ViewCount="5560" Body="&lt;p&gt;I have the following code in my &lt;code&gt;init.el&lt;/code&gt;&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(xclip-mode +1)&#xA;(setq&#xA;  x-select-enable-clipboard t&#xA;  x-select-enable-primary t&#xA;  x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)&#xA;  x-stretch-cursor t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In a regular terminal, copy and paste works seamlessly. However in &lt;code&gt;tmux&lt;/code&gt; the &lt;code&gt;kill-ring&lt;/code&gt; is not synchronized with my regular clipboard, and yank does not yank from the clipboard. How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-01-10T04:02:24.790" LastActivityDate="2015-01-11T14:39:15.003" Title="Copy and paste to system clipboard in tmux" Tags="|copy-paste|yank|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7192" PostTypeId="2" ParentId="7189" CreationDate="2015-01-09T00:06:34.120" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I'd echo the suggestion of using bookmarks.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use environment variables (define your own, to correspond to whatever directory prefixes you want).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can define directory abbreviations, using option &lt;code&gt;directory-abbrev-alist&lt;/code&gt;. That's what it is for. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Aliases.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;File Aliases&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc focuses on the use of &lt;code&gt;directory-abbrev-alist&lt;/code&gt; with symbolic links, but you can use it for any directory abbreviations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vanilla Emacs does not &lt;em&gt;complete&lt;/em&gt; your directory abbreviations, but &lt;a href=&quot;http://www.emacswiki.org/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; does. (RMS gave as the reason that vanilla Emacs should not do this: &quot;&lt;em&gt;I don’t think Emacs should alter the names that the user enters.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the doc string for option &lt;code&gt;directory-abbrev-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;directory-abbrev-alist is a variable defined in `files.el'.&#xA;Its value is nil&#xA;&#xA;Documentation:&#xA;Alist of abbreviations for file directories.&#xA;A list of elements of the form (FROM . TO), each meaning to replace&#xA;FROM with TO when it appears in a directory name.  This replacement is&#xA;done when setting up the default directory of a newly visited file.&#xA;&#xA;FROM is matched against directory names anchored at the first&#xA;character, so it should start with a &quot;\\`&quot;, or, if directory&#xA;names cannot have embedded newlines, with a &quot;^&quot;.&#xA;&#xA;FROM and TO should be equivalent names, which refer to the&#xA;same directory.  Do not use `~' in the TO strings;&#xA;they should be ordinary absolute directory names.&#xA;&#xA;Use this feature when you have directories which you normally refer to&#xA;via absolute symbolic links.  Make TO the name of the link, and FROM&#xA;the name it is linked to.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So as an example, you might have an entry like this in &lt;code&gt;directory-abbrev-alist&lt;/code&gt;:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (\`2015 . //SBS/share/path/to/somewhere/2015)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then if you use &lt;code&gt;C-x C-f 2015 TAB&lt;/code&gt; (in &lt;strong&gt;Icicles&lt;/strong&gt;) your input of &lt;code&gt;2015&lt;/code&gt; is completed to &lt;code&gt;//SBS/share/path/to/somewhere/2015&lt;/code&gt;, and you can type more to complete to something in that directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you had an entry like this (same thing, but with a trailing &lt;code&gt;/&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (\`2015 . //SBS/share/path/to/somewhere/2015/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;C-x C-f 2015 TAB&lt;/code&gt; shows you all of the files in that directory as completion candidates.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:29:57.057" LastActivityDate="2015-05-09T20:29:57.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7193" PostTypeId="1" AcceptedAnswerId="7203" CreationDate="2015-01-09T01:31:19.417" Score="7" ViewCount="226" Body="&lt;p&gt;When calling &lt;code&gt;ido-find-file&lt;/code&gt; it's possible to type &lt;code&gt;~/&lt;/code&gt; to replace the current working directory with your home directory automatically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Find file: /etc/{...} # after typing ~/ becomes:&#xA;Find file: ~/{...}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I replicate this but for a custom directory such as &lt;code&gt;user-emacs-directory&lt;/code&gt; and when pressing a key instead of inserting text in the minibuffer? For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Find file: /var/log/{...} # after pressing F6 becomes:&#xA;Find file: ~/.emacs.d/{...}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="920" LastActivityDate="2015-01-09T09:28:33.413" Title="How to replicate the &quot;~/&quot;-to-home &amp; &quot;//&quot;-to-root behaviour in ido-find-file but for a custom directory?" Tags="|ido|ido-find-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7194" PostTypeId="2" ParentId="7172" CreationDate="2015-01-09T03:04:01.500" Score="2" Body="&lt;p&gt;For that, you use &lt;a href=&quot;http://www.gnu.org/software/tramp/&quot; rel=&quot;nofollow&quot;&gt;Tramp&lt;/a&gt;. Don't ssh directly through you shell. Otherwise Emacs won't see it. To use Tramp in both stock Emacs and &lt;code&gt;helm-find-files&lt;/code&gt;, use this syntax in the find file prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/&amp;lt;connect method&amp;gt;:username@host#port:&amp;lt;path&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, if you want to ssh to wdkrnls at 10.0.2.2 port 2222 to your home directory, then write it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/ssh:wdkrnls@10.0.2.2#2222:/home/wdkrnls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may omit the connect method if you set &lt;code&gt;tramp-default-method&lt;/code&gt; to &lt;code&gt;ssh&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tramp-default-method &quot;ssh&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you can simply write this to ssh to your remote host:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/wdkrnls@10.0.2.2#2222:/home/wdkrnls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Absolute path is required in &lt;code&gt;helm-find-files&lt;/code&gt; for it to offer completion candidates, so you should open a Dired buffer at your home directory to make it an anchor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add your host to &lt;code&gt;~/.ssh/config&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host host1&#xA;     HostName 10.0.2.2&#xA;     User wdkrnls&#xA;     Port 2222&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you no more need to specify the username and port. When you type &lt;code&gt;/ssh:&lt;/code&gt; in your &lt;code&gt;helm-find-files&lt;/code&gt; prompt, a list of hosts in your &lt;code&gt;~/.ssh/config&lt;/code&gt; are given to you to select. You only simply write &lt;code&gt;/ssh:host1:&lt;/code&gt; and wait for Tramp to connect. Successfully connected, you will start browsing remote file system like your local one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you also set &lt;code&gt;tramp-default-method&lt;/code&gt; to &lt;code&gt;ssh&lt;/code&gt;, you can simply write like this to connect to remote host:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/host1:/home/wdkrnls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-01-09T03:04:01.500" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7195" PostTypeId="1" CreationDate="2015-01-09T04:16:22.003" Score="4" ViewCount="166" Body="&lt;p&gt;Say I have the following text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A. U. Thor writes:&#xA;&#xA;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam est&#xA;elit, pulvinar sit amet erat nec, finibus sagittis ex. Mauris&#xA;dictum elementum est in fringilla? Duis vel dui elit! Praesent&#xA;tincidunt velit vel ipsum facilisis fringilla! Donec tincidunt&#xA;pulvinar nulla eu convallis. Sed venenatis non risus nec&#xA;tincidunt: nam volutpat mauris elementum tortor posuere&#xA;tempus. Nam varius aliquam rhoncus. Praesent commodo odio sed&#xA;tristique volutpat. Fusce eu mauris consequat, porta nulla ut,&#xA;vestibulum neque? Mauris tincidunt elit quis convallis imperdiet.&#xA;&#xA;Nulla ac porta lectus. Nullam faucibus eu orci in porttitor? Sed&#xA;imperdiet cursus venenatis. Nullam eu est nisi: cras accumsan&#xA;rutrum sapien, sed maximus nisl pulvinar id. Nulla sollicitudin&#xA;sollicitudin neque, in rutrum tortor malesuada quis. In interdum&#xA;nec lacus id cursus. Pellentesque condimentum tortor at nisi&#xA;fermentum, ac aliquam nunc laoreet. Aenean faucibus orci nec&#xA;vehicula facilisis. Donec at metus enim? Nam vel sapien&#xA;tortor? Aenean non nibh congue, lacinia tortor posuere,&#xA;consectetur mi: integer quis eleifend lectus. Suspendisse vitae&#xA;ligula vel ante rhoncus ullamcorper non at urna. Praesent&#xA;sollicitudin ut purus non pellentesque.&#xA;&#xA;Sed convallis metus ut ipsum ultricies bibendum? Phasellus vitae&#xA;mattis magna. Ut vel ex purus. Phasellus pellentesque diam vel&#xA;erat dapibus hendrerit. Ut pretium erat sed sapien tempus, eu&#xA;auctor lorem facilisis. Sed eu malesuada turpis. Quisque ac leo&#xA;mollis, molestie purus convallis, convallis sem? Sed tortor diam,&#xA;efficitur sit amet magna nec, volutpat mattis tortor? Suspendisse&#xA;varius neque non mattis pretium? Vivamus ac rhoncus ipsum? Nunc&#xA;pellentesque lobortis purus. Proin interdum venenatis augue at&#xA;venenatis. Integer in hendrerit urna, vitae commodo&#xA;massa. Phasellus nec feugiat ex, sit amet posuere elit.&#xA;&#xA;In hac habitasse platea dictumst. Morbi id velit neque. Nulla&#xA;facilisi: sed et enim ut velit accumsan facilisis. Praesent&#xA;rhoncus vel sem vitae ullamcorper? Sed tincidunt tincidunt&#xA;nunc. Cras egestas urna turpis, at malesuada risus elementum eu.&#xA;&#xA;Curabitur ultricies, erat ut consectetur malesuada, massa ante&#xA;iaculis lectus, vitae convallis nibh elit eget dui: sed malesuada&#xA;dui eu ipsum luctus tincidunt at ac sapien. Donec lorem ligula,&#xA;porttitor non sem vitae, auctor suscipit elit. Sed iaculis ex id&#xA;fringilla auctor? Aliquam quis dignissim leo. Sed tincidunt massa&#xA;vel justo vehicula vehicula gravida nec metus. Integer euismod est&#xA;vitae hendrerit vestibulum? Vivamus condimentum ornare&#xA;felis. Aliquam fermentum a diam non pulvinar?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to double all the sentence-ending spaces?  I can't think of a way to detect the &lt;em&gt;length&lt;/em&gt; of the 'sentence' it terminates before doubling the space, let alone ignore common prefixes like &lt;code&gt;Mr&lt;/code&gt;, &lt;code&gt;Ms&lt;/code&gt;, and &lt;code&gt;Mrs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-26T14:32:14.287" Title="How can I normalize sentence-endings?" Tags="|text-editing|sentences|" AnswerCount="3" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7196" PostTypeId="1" AcceptedAnswerId="7200" CreationDate="2015-01-09T05:07:50.880" Score="7" ViewCount="1461" Body="&lt;p&gt;Largely following the approach described by Bozhidar Batsov on the page: &lt;a href=&quot;http://batsov.com/articles/2012/02/19/package-management-in-emacs-the-good-the-bad-and-the-ugly/&quot; rel=&quot;noreferrer&quot;&gt;http://batsov.com/articles/2012/02/19/package-management-in-emacs-the-good-the-bad-and-the-ugly/&lt;/a&gt;, I tried to build my emacs file to check if any package in a given list was not installed and install it using package.el if so. Things seem to have been working, but either I made a change to my emacs file that I do remember, or something else is going on. Now when I added 'outpair' to my list of packages I get an error. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(require 'package)&#xA;(add-to-list 'package-archives&#xA;         '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;(package-initialize)&#xA;&#xA;(defvar my-packages&#xA;  '(auctex auto-complete autopair magit yasnippet)&#xA;  &quot;A list of packages to ensure are installed at launch.&quot;)&#xA;&#xA;(defun my-packages-installed-p ()&#xA;   (loop for p in my-packages&#xA;          when (not (package-installed-p p)) do (return -1)&#xA;                  finally (return 1)))&#xA;&#xA;(unless (my-packages-installed-p)&#xA;  ;; check for new packages (package versions)&#xA;  (package-refresh-contents)&#xA;  ;; install the missing packages&#xA;  (dolist (p my-packages)&#xA;    (when (not (package-installed-p p))&#xA;      (package-install p))))&#xA;&#xA;(let ((default-directory &quot;~/.emacs.d/elpa/&quot;))&#xA;     (normal-top-level-add-to-load-path '(&quot;.&quot;))&#xA;     (normal-top-level-add-subdirs-to-load-path))&#xA;&#xA;(require 'exec-path-from-shell)&#xA;(when (memq window-system '(mac ns))&#xA;      (exec-path-from-shell-initialize))&#xA;&#xA;&#xA;(setq inhibit-splash-screen 1           ;;turn off splash screen&#xA;      initial-scratch-message nil       ;;remove initial message&#xA;      initial-major-mode 'org-mode)     ;;turn on org-mode&#xA;&#xA;(scroll-bar-mode -1)  ;;turn off scroll bar&#xA;(tool-bar-mode -1)    ;;turn off tool bar&#xA;(menu-bar-mode -1)    ;;turn off menu bar&#xA;&#xA;(delete-selection-mode 1)&#xA;(transient-mark-mode 1)&#xA;(setq x-select-enable-clipboard 1)&#xA;&#xA;;;this is only used when running cocoa app.&#xA;(when window-system&#xA;  (setq frame-title-format '(buffer-file-name &quot;%f&quot; (&quot;%b&quot;)))&#xA;    (set-face-attribute 'default nil&#xA;                          :family &quot;Inconsolata&quot;&#xA;                          :height 140&#xA;                          :weight 'normal&#xA;                          :width 'normal)&#xA;&#xA;  (when (functionp 'set-fontset-font)&#xA;      (set-fontset-font &quot;fontset-default&quot;&#xA;                        'unicode&#xA;                        (font-spec :family &quot;DejaVu Sans Mono&quot;&#xA;                        :width 'normal&#xA;                        :size 12.4&#xA;                        :weight 'normal))))&#xA;&#xA;(setq-default indicate-empty-lines t)&#xA;(when (not indicate-empty-lines)&#xA; (toggle-indicate-empty-lines))&#xA;&#xA;&#xA;;set custom window width and height&#xA;(defun custom-set-frame-size ()&#xA;  (add-to-list 'default-frame-alist '(height . 65))&#xA;  (add-to-list 'default-frame-alist '(width . 99)))&#xA;(custom-set-frame-size)&#xA;(add-hook 'before-make-frame-hook 'custom-set-frame-size)&#xA;&#xA;(setq tab-width 2)&#xA;(setq indent-tabs-mode nil)&#xA;&#xA;(setq make-backup-files -1) ;;turn off backup files&#xA;&#xA;(global-set-key (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;;(global-set-key (kbd &quot;C-;&quot;) 'comment-or-uncomment-region) ;already bound to &quot;M-;&quot;&#xA;(global-set-key (kbd &quot;M-/&quot;) 'hippie-expand)&#xA;(global-set-key (kbd &quot;C-+&quot;) 'text-scale-increase)&#xA;(global-set-key (kbd &quot;C--&quot;) 'text-scale-decrease)&#xA;(global-set-key (kbd &quot;C-c C-k&quot;) 'compile)&#xA;(global-set-key (kbd &quot;C-x g&quot;) 'magit-status)&#xA;&#xA;(defalias 'yes-or-no-p 'y-or-n-p)&#xA;(setq echo-keystrokes 0.1&#xA;      use-dialog-box -1&#xA;      visible-bell 1)&#xA;(show-paren-mode 1)&#xA;(require 'autopair)&#xA;&#xA;(setq TeX-auto-save t)&#xA;(setq TeX-parse-self t)&#xA;(setq-default TeX-master nil)  ;Query for master file&#xA;&#xA;(add-hook 'LaTex-mode-hook 'visual-line-mode)&#xA;(add-hook 'LaTex-mode-hook 'flyspell-mode)&#xA;(add-hook 'LaTex-mode-hook 'LaTex-math-mode)&#xA;&#xA;(add-hook 'LaTex-mode-hook 'turn-on-reftex)&#xA;(setq reftex-plug-into-AUCTeX t)&#xA;(setq TeX-PDF-mode t)&#xA;&#xA;(add-hook 'LaTeX-mode-hook (lambda()&#xA;(push&#xA;    '(&quot;latexmk&quot; &quot;latexmk -synctex=1 -pdf %s&quot; TeX-run-TeX nil t&#xA;      :help &quot;Run latexmk on file&quot;)&#xA;    TeX-command-list)))&#xA;&#xA;(add-hook 'TeX-mode-hook '(lambda() (setq TeX-command-default &quot;latexmk&quot;)))&#xA;&#xA;(setq TeX-view-program-selection '((output-pdf &quot;PDF Viewer&quot;)))&#xA;(setq TeX-view-program-list&#xA;  '((&quot;PDF Viewer&quot; &quot;/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b&quot;)))&#xA;&#xA;&#xA;&#xA;(ido-mode 1)&#xA;(setq ido-enable-flex-matching 1&#xA;      ido-use-virtual-buffers 1)&#xA;&#xA;;;column number mode&#xA;(setq column-number-mode 1)&#xA;&#xA;(require 'yasnippet)&#xA;(setq yas-snippet-dirs 'yas-installed-snippets-dir)&#xA;(yas-global-mode 1)&#xA;&#xA;(require 'auto-complete-config)&#xA;&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;)&#xA;(ac-config-default)&#xA;(ac-set-trigger-key &quot;TAB&quot;)&#xA;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;&#xA;&#xA;(require 'tex-site)&#xA;(require 'font-latex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error message I get is: &#xA;&quot;Warning (initialization): An error occurred while loading `/Users/jeimer/.emacs':&lt;/p&gt;&#xA;&#xA;&lt;p&gt;File error: Cannot open load file, no such file or directory, autopair&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what is going on here and how to fix it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5138" LastActivityDate="2015-01-09T09:36:49.527" Title="how to programmatically load packages in .emacs file" Tags="|package|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7197" PostTypeId="1" AcceptedAnswerId="7201" CreationDate="2015-01-09T05:26:19.603" Score="0" ViewCount="53" Body="&lt;p&gt;I want to scroll the buffer so that the the current line is, say, 300&#xA;pixels from the beginning of the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;. \ &#xA;. | (300 pixels)&#xA;. /&#xA;| &amp;lt;-- (current line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the buffer may contain figures and different font sizes, so scrolling a fixed number of text lines won't do the trick.&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-01-09T08:50:03.903" Title="How to set the y-coordinate (in pixels) of the current line" Tags="|buffers|window|fonts|images|scrolling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7198" PostTypeId="1" AcceptedAnswerId="7231" CreationDate="2015-01-09T06:17:21.293" Score="6" ViewCount="183" Body="&lt;p&gt;Can I edit an &lt;code&gt;svg&lt;/code&gt; file in a text mode (say, &lt;code&gt;nxml-mode&lt;/code&gt;) while seeing live updates to the image in another window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can see SVG as images, or as text by using &lt;code&gt;image-toggle-display&lt;/code&gt;, but it always toggles both buffers, even if I do &lt;code&gt;clone-indirect-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using a strange build of emacs for Windows... I've lost track of where I even got it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-w64-mingw32) of 2014-10-20 on KAEL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3896" LastActivityDate="2015-01-10T04:29:08.007" Title="Indirect buffer in image mode (main buffer in text)?" Tags="|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7199" PostTypeId="2" ParentId="5692" CreationDate="2015-01-09T06:54:48.960" Score="1" Body="&lt;p&gt;Thank you so much Melioratus, what an outstanding answer! It's amazing how you used the various mechanisms of Org mode to do this.  The most significant part of this for me was &lt;code&gt;:results raw&lt;/code&gt; which outputted text to be rescanned by the agenda creation. That was the key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I looked at how I could expand this to handle many dates I wondered if I couldn't just do the date calculations in elisp. I'm still very new to elisp but I hacked around a bit and came up with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My task is calculating the date my meds run out by adding 30 days to the day I start the bottle.  What I did was this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my .emacs I wrote some functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun date-high-low (secs)&#xA;  &quot;Split int into high-low words&quot;&#xA;  (list (/ secs 65536) (% secs 65536)))&#xA;&#xA;(defun date-plus-days (datestr days)&#xA;  &quot;Generate org-style date string from date + days offset&quot;&#xA;  (format-time-string &quot;&amp;lt;%Y-%m-%d %a&amp;gt;&quot; (date-high-low (truncate (+ (org-time-string-to-seconds datestr) (* days 86400))))))&#xA;&#xA;(defun org-header-date-plus-days (fmt datestr days)&#xA;  &quot;Use above to build final org header entry from format string&quot;&#xA;  (princ (format fmt (date-plus-days datestr days))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to keep these functions generic and not focused on the meds for reusability. There might be better ways to do this, like I said I'm a newbie.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then in my .org file I do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADER: :results raw output replace&#xA;#+begin_src elisp&#xA;    (org-header-date-plus-days &quot;** MED LAST DAY Med-1\nDEADLINE: %s\n&quot; &quot;[2014-12-14 Sun]&quot; 30)&#xA;    (org-header-date-plus-days &quot;** MED LAST DAY Med-2\nDEADLINE: %s\n&quot; &quot;[2014-12-22 Mon]&quot; 54)&#xA;    (org-header-date-plus-days &quot;** MED LAST DAY Med-3\nDEADLINE: %s\n&quot; &quot;[2015-01-02 Fri]&quot; 60)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nice and neat, one line per instance. Doing C-c C-c on the block generates the headline and DEADLINE with date and it shows up perfectly in the agenda.  It works well and I'm happy with the reults. Thanks again for the tip to you and lawlist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. The only thing that doesn't work is the &lt;code&gt;replace&lt;/code&gt;. It always appends to the #+RESULTS block so I have to delete it before generating it. It's minor but I don't understand why.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-01-09T06:54:48.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7200" PostTypeId="2" ParentId="7196" CreationDate="2015-01-09T07:09:19.003" Score="3" Body="&lt;p&gt;Your &lt;code&gt;my-packages-installed-p&lt;/code&gt; is returning &lt;code&gt;-1&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt;. In the following &lt;code&gt;unless&lt;/code&gt; block, you are using &lt;code&gt;my-packages-installed-p&lt;/code&gt; as if it were a predicate function, which, the name notwithstanding, it isn't. Make these changes to &lt;code&gt;my-packages-installed-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-packages-installed-p ()&#xA;   (loop for p in my-packages&#xA;          when (not (package-installed-p p)) do (return nil)&#xA;                  finally (return t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-01-09T07:09:19.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7201" PostTypeId="2" ParentId="7197" CreationDate="2015-01-09T08:50:03.903" Score="2" Body="&lt;p&gt;You can set the vertical scroll parameter of your current &lt;em&gt;window&lt;/em&gt; (and other windows, too) with pixel precision:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-window-vscroll nil 300 t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will however not work with any value greater than the frame height though.  &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19464&quot; rel=&quot;nofollow&quot;&gt;I've had to hand in a bug where Emacs hangs up for certain display engine configurations upon doing this even&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-09T08:50:03.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7202" PostTypeId="2" ParentId="7183" CreationDate="2015-01-09T08:52:13.817" Score="2" Body="&lt;p&gt;You can achieve what you want by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;advising&lt;/a&gt; the commands that serve as entry points for the different export back-ends offered by &lt;code&gt;org-mode&lt;/code&gt;. For example, to tell &lt;code&gt;org-mode&lt;/code&gt; to skip tags when exporting to ASCII, you can advise the command for exporting to ASCII (&lt;code&gt;org-ascii-export-to-ascii&lt;/code&gt;) as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice org-ascii-export-to-ascii&#xA;    (around turn-off-tags (&amp;amp;optional async subtreep visible-only&#xA;                                     body-only ext-plist) activate compile)&#xA;  (let ((org-export-with-tags nil))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that Emacs 24.4 introduces a &lt;a href=&quot;https://emacs.stackexchange.com/q/3079/504&quot;&gt;new advice system&lt;/a&gt; which might replace the old system at some point in the future. Here is a modified version of the code above that makes use of the new advice system (use this version if you are already on Emacs 24.4 and want to future-proof your configuration):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun turn-off-tags&#xA;    (orig &amp;amp;optional async subtreep visible-only body-only ext-plist)&#xA;  (let ((org-export-with-tags nil))&#xA;    (funcall orig async subtreep visible-only body-only ext-plist)))&#xA;&#xA;(advice-add 'org-ascii-export-to-ascii :around #'turn-off-tags)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Generalizing the solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The general naming scheme for export commands that produce files is &lt;code&gt;org-&amp;lt;backend&amp;gt;-export-to-&amp;lt;backend&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-ascii-export-to-ascii&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-html-export-to-html&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-latex-export-to-latex&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is a skeleton that you can use to set as many &lt;code&gt;&amp;lt;backend&amp;gt;&lt;/code&gt;-specific options as you like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice org-&amp;lt;backend&amp;gt;-export-to-&amp;lt;backend&amp;gt;&#xA;    (around org-&amp;lt;backend&amp;gt;-set-export-options&#xA;            (&amp;amp;optional async subtreep visible-only body-only ext-plist)&#xA;            activate compile)&#xA;  (let ((&amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;)&#xA;        (&amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;)&#xA;        (&amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ported to the new advice system:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-&amp;lt;backend&amp;gt;-set-export-options&#xA;    (orig &amp;amp;optional async subtreep visible-only body-only ext-plist)&#xA;  (let ((&amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;)&#xA;        (&amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;)&#xA;        (&amp;lt;variable&amp;gt; &amp;lt;value&amp;gt;))&#xA;    (funcall orig async subtreep visible-only body-only ext-plist)))&#xA;&#xA;(advice-add 'org-&amp;lt;backend&amp;gt;-export-to-&amp;lt;backend&amp;gt;&#xA;            :around #'org-&amp;lt;backend&amp;gt;-set-export-options)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-01-09T09:20:59.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7203" PostTypeId="2" ParentId="7193" CreationDate="2015-01-09T09:28:33.413" Score="7" Body="&lt;p&gt;I was just about to make a blog post about this (I'll do it later anyway):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun oleh-ido-setup-hook ()&#xA;  (define-key ido-file-dir-completion-map &quot;~&quot;&#xA;    (lambda ()&#xA;      (interactive)&#xA;      (ido-set-current-directory &quot;~/&quot;)&#xA;      (setq ido-exit 'refresh)&#xA;      (exit-minibuffer))))&#xA;&#xA;(add-hook 'ido-setup-hook 'oleh-ido-setup-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-09T09:28:33.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7204" PostTypeId="2" ParentId="7196" CreationDate="2015-01-09T09:36:49.527" Score="2" Body="&lt;p&gt;&lt;code&gt;unless&lt;/code&gt; evaluates the body if and only if the condition returns nil.  From its docstring (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If COND yields &lt;strong&gt;nil&lt;/strong&gt;, do BODY, else return nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Obviously, neither &lt;code&gt;1&lt;/code&gt; nor &lt;code&gt;-1&lt;/code&gt; are &lt;code&gt;nil&lt;/code&gt;, obviously, so your &lt;code&gt;my-packages-installed-p&lt;/code&gt; never returns &lt;code&gt;nil&lt;/code&gt; regardless of whether your packages are installed or not.  Consequently the body of your &lt;code&gt;unless&lt;/code&gt; clause is always skipped, and &lt;code&gt;autopair&lt;/code&gt; is never actually installed by your code!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole predicate is redundant anyway, since the &lt;code&gt;dolist&lt;/code&gt; loop also checks whether a package is installed.  All your predicate adds is another redundant iteration over the list of desired packages.  You can remove it entirely, and instead call &lt;code&gt;package-refresh-contents&lt;/code&gt; implicitly if you install the first package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (package my-packages)&#xA;  (unless (package-installed-p package)&#xA;    (unless package-archive-contents&#xA;      (package-refresh-contents))&#xA;    (package-install package)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also remove your &lt;code&gt;load-path&lt;/code&gt;-related code.  It's entirely redundant as well:  &lt;code&gt;package.el&lt;/code&gt; manages the &lt;code&gt;load-path&lt;/code&gt; for you, automatically adding newly installed packages as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also want to take a look at &lt;a href=&quot;https://github.com/jwiegley/use-package/&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt;, which—among other features for package initialisation and configuration—handles package installation for you.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-01-09T09:36:49.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7205" PostTypeId="2" ParentId="7178" CreationDate="2015-01-09T10:53:49.273" Score="1" Body="&lt;p&gt;So now it worked when I installed 'Gow'; a lightweight version with a small file size about 18 MB compared to the heavy Cygwin over 100 MB as described by this source: &lt;a href=&quot;https://github.com/bmatzelle/gow/wiki&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/bmatzelle/gow/wiki&lt;/a&gt;. Very easy to install. Just make sure that the binary path to environmental variables is right there (it was automatically added after installation didn't need to add it manually). Restart Emacs. No need to restart machine. Cygwin installation was not user-friendly at all.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select files to run grep on by &lt;code&gt;C-SPC&lt;/code&gt; or all &lt;code&gt;M-a&lt;/code&gt;:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/P1UYd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;C-s&lt;/code&gt; for grep search and you get online matching. Just great!&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/CMKZ4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;After installing Gow it worked well, but after restarting my machine and for some reason Emacs could not pick up &lt;code&gt;Gow&lt;/code&gt; right. But adding these two lines of code to my &lt;code&gt;init.el&lt;/code&gt; solved that:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (add-to-list 'exec-path &quot;C:/Program Files/Gow/bin&quot;))&#xA;(setenv &quot;PATH&quot; (concat &quot;C:\\Program Files\\Gow\\bin;&quot; (getenv &quot;PATH&quot;)))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I run &lt;code&gt;getenv PATH&lt;/code&gt; from eshell, the binary path to Gow shows first. This might be important to get things set.&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-01-09T13:52:03.570" LastActivityDate="2015-01-09T13:52:03.570" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="7206" PostTypeId="2" ParentId="7162" CreationDate="2015-01-09T11:18:12.620" Score="2" Body="&lt;p&gt;I temporarily solved the problem by deleting the file &lt;code&gt;history&lt;/code&gt; located in &lt;code&gt;~\.eshell\&lt;/code&gt;. It appears that the entries of the last sessions of eshell are saved in this file. This solution is not satisfying as the problem can again arise.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-01-09T11:18:12.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7207" PostTypeId="1" AcceptedAnswerId="7208" CreationDate="2015-01-09T12:33:05.087" Score="1" ViewCount="684" Body="&lt;p&gt;When I write text in the emacs editor and the text reaches the right border of the program, emacs continues on the next line and puts an arrow on both sides of its borders. I want to know if its possible to remove these ugly arrows and modify emacs in a way, that the last word is put on the next line instead of the last letters. So it would quite more readable because no words are cut due to a linebreak.&lt;/p&gt;&#xA;" OwnerUserId="5122" LastActivityDate="2018-10-11T09:18:37.800" Title="Remove linebreak arrow and move last word to next line" Tags="|text-editing|customize|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7208" PostTypeId="2" ParentId="7207" CreationDate="2015-01-09T12:34:13.343" Score="2" Body="&lt;p&gt;It sounds like Visual Line mode is what you want: &lt;code&gt;M-x visual-line-mode&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-09T12:34:13.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7209" PostTypeId="2" ParentId="7169" CreationDate="2015-01-09T12:49:43.050" Score="2" Body="&lt;h1&gt;What's happening&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;It looks like your &lt;code&gt;unscroll-point&lt;/code&gt;'s value is a number. That's why &lt;code&gt;set-marker&lt;/code&gt; fails on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there's nothing in your first code block that could be&#xA;responsible for that, I'm guessing this is some left over state. This&#xA;left over state can be caused because &lt;code&gt;defvar&lt;/code&gt; does not change the&#xA;value of a variable that's already set, it only sets the variable's&#xA;value the &lt;em&gt;first&lt;/em&gt; time.&#xA;&lt;a href=&quot;http://endlessparentheses.com/what-s-a-defconst-and-why-you-should-use-it.html&quot; rel=&quot;nofollow&quot;&gt;See here&lt;/a&gt;&#xA;for why it's like that.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;How to avoid it&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;To prevent this from happening again as you develop packages, whenever&#xA;you change the value of a &lt;code&gt;defvar&lt;/code&gt; (or &lt;code&gt;defcustom&lt;/code&gt;), you need to&#xA;reevaluate it with&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/eval-defun&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;eval-defun&lt;/code&gt;&lt;/a&gt;&#xA;(bound to &lt;code&gt;C-M-x&lt;/code&gt;), instead of using &lt;code&gt;C-x C-e&lt;/code&gt;, or &lt;code&gt;load&lt;/code&gt;ing the file,&#xA;or &lt;code&gt;eval-buffer&lt;/code&gt;. &lt;code&gt;eval-defun&lt;/code&gt; is designed for developing and forces&#xA;the value to be reset even on &lt;code&gt;defvar&lt;/code&gt;s.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-01-09T13:34:41.877" LastActivityDate="2015-01-09T13:34:41.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7210" PostTypeId="2" ParentId="7189" CreationDate="2015-01-09T14:00:27.513" Score="1" Body="&lt;p&gt;You open these files frequently so the paths will be in history. Use &lt;kbd&gt;C-x C-f C-r 2015&lt;/kbd&gt; to bring the last file you opened with 2015 in it's path into the mini-buffer and use normal completion from there. Pressing &lt;kbd&gt;C-r&lt;/kbd&gt; again will get the next to last used path with &lt;code&gt;2015&lt;/code&gt;, and so on.&lt;/p&gt;&#xA;" OwnerUserId="5144" LastActivityDate="2015-01-09T14:00:27.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7211" PostTypeId="1" AcceptedAnswerId="7366" CreationDate="2015-01-09T14:28:15.847" Score="15" ViewCount="4113" Body="&lt;p&gt;When I open an &lt;code&gt;org&lt;/code&gt; file, I want all the &lt;code&gt;src&lt;/code&gt; blocks to start collapsed and stay that way until I explicitly &lt;code&gt;org-cycle&lt;/code&gt; them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't find any variable to control this behavior. Perhaps I'm overlooking something? Or maybe someone has an elisp solution?&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-14T15:03:48.827" Title="Collapse src blocks in org-mode by default" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7212" PostTypeId="2" ParentId="7189" CreationDate="2015-01-09T14:53:18.810" Score="1" Body="&lt;p&gt;As an alternate method you could use symbolic links in Windows 7 to map your network shares to folders (and thus spare your Drive Letters).  (Source: &lt;a href=&quot;https://superuser.com/questions/244562/how-to-mount-a-network-drive-to-a-folder&quot;&gt;SuperUser: How to mount a network drive to a folder&lt;/a&gt; )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have folder &lt;code&gt;c:\yearly\&lt;/code&gt; to store the various year folders&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mklink /D c:\yearly\2015 \\SBS\share\path\to\somewhere\2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can directly use: &lt;code&gt;C:\yearly\2015\...&lt;/code&gt; as your path to access the files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tested this on a desktop with a fixed access to the destination server.  A laptop may run into connection issues (due to lack of availability of the folder).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note:  This will not work on WindowsXP without a third party tool.  &lt;code&gt;mklink&lt;/code&gt; was only introduced in Vista.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2015-01-09T15:01:41.957" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7213" PostTypeId="1" AcceptedAnswerId="7214" CreationDate="2015-01-09T14:59:24.987" Score="2" ViewCount="205" Body="&lt;p&gt;How do I bind a key to do one thing at the beginning of the line, and another thing everywhere else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to ask about the possibility that pressing the &lt;code&gt;&amp;lt;home&amp;gt;&lt;/code&gt; key when the cursor is at the beginning of the current line, results in the execution of a certain function or command (say &lt;code&gt;myfunction1&lt;/code&gt;) and otherwise results in the execution of other function or command (say &lt;code&gt;myfunction2&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="253" LastEditDate="2015-01-09T15:16:11.070" LastActivityDate="2018-12-11T15:45:24.913" Title="Keybinding conditional on cursor location?" Tags="|key-bindings|cursor|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7214" PostTypeId="2" ParentId="7213" CreationDate="2015-01-09T15:03:38.887" Score="6" Body="&lt;p&gt;You can write a command that will do one thing when at the beginning of the line, and do another when not there.  You can then bind it to your key of choice.  Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun message-me ()&#xA;  (interactive)&#xA;  (if (bolp)&#xA;      (message &quot;At beginning of line&quot;)&#xA;    (message &quot;Not at beginning of line&quot;)))&#xA;&#xA;(global-set-key [home] #'message-me)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-09T15:03:38.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7215" PostTypeId="1" AcceptedAnswerId="7217" CreationDate="2015-01-09T15:32:14.697" Score="0" ViewCount="79" Body="&lt;p&gt;&#xA;I've just come across &lt;a href=&quot;https://github.com/davidmiller/dizzee&quot; rel=&quot;nofollow&quot;&gt;dizzee&lt;/a&gt;,&#xA;an Emacs package for managing subprocesses; it lets you create&#xA;functions that stop, start or restart shell commands.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(dz-defservice foo &quot;script.sh&quot; :cd (&quot;/path/to/foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This macro, &lt;code&gt;dz-defservice&lt;/code&gt;, will create the functions &lt;code&gt;foo-start&lt;/code&gt;, &lt;code&gt;foo-stop&lt;/code&gt;&#xA;and &lt;code&gt;foo-restart&lt;/code&gt; that will run/kill &quot;somecommand.sh&quot; in the directory&#xA;&quot;/path/to/foo&quot;, and collect its output in a buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is perfect for a project I'm working on, where I want to run a&#xA;bunch of commands in separate directories all at once.  The commands&#xA;all have the same name, but do different things depending on the&#xA;directory they're in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way of doing this would be to write separate entries for each&#xA;service like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(dz-defservice foo &quot;script.sh&quot; :cd (&quot;/path/to/foo&quot;))&#xA;(dz-defservice bar &quot;script.sh&quot; :cd (&quot;/path/to/bar&quot;))&#xA;(dz-defservice baz &quot;script.sh&quot; :cd (&quot;/path/to/baz&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But of course, this seems perfect for a list (particularly as I'll be&#xA;adding more components in the future).  So what I want to do is have a&#xA;list be input to &lt;code&gt;dz-defservice&lt;/code&gt;, which in turn seems like it's perfect for &lt;code&gt;dolist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq my--project-components '(foo bar baz))&#xA;&#xA;(dolist (i my--project-components)&#xA;  (dz-defservice i &quot;shell.sh&quot; :cd (format &quot;/path/to/%s&quot; i)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That was my first attempt; it only ended up redefining the functions&#xA;&lt;code&gt;i-start&lt;/code&gt;, &lt;code&gt;i-stop&lt;/code&gt; and &lt;code&gt;i-restart&lt;/code&gt; over and over again.  Next I tried using&#xA;quotes in &lt;code&gt;dolist&lt;/code&gt;, since it's a macro too:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(dolist (i my--project-components)&#xA;  `(dz-defservice ,i &quot;shell.sh&quot; :cd (format &quot;/root/%s/&quot; element)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that gives me this error:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;Compiler-macro error for cl--block-wrapper: (wrong-type-argument symbolp (\, i))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm obviously misunderstanding something here, so can anyone tell me how&#xA;to use a list to create these different service entries?&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="2642" LastEditDate="2015-01-10T05:38:47.870" LastActivityDate="2015-01-10T10:22:47.497" Title="How can I create dizzee services programatically?" Tags="|elisp-macros|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7216" PostTypeId="2" ParentId="7213" CreationDate="2015-01-09T15:51:22.573" Score="5" Body="&lt;p&gt;@Dan's suggestion of using a dispatch command is probably the best approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is another, that can be useful in some contexts. But it is probably not what you want for the general case you cite, of doing something special at the beginning of any line, anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can put a &lt;code&gt;keymap&lt;/code&gt; text property on a character in a buffer. Its value is a keymap. Any keys you bind in that keymap take precedence. So when the cursor is just before that character, hitting a key bound in that map invokes its command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in your use case (but again, this is probably not what you want to do, unless you want the behavior only in particular contexts, e.g. particular buffers or zones of text), you would add a key binding using a &lt;code&gt;keymap&lt;/code&gt; text property on the first char of each line where you wanted it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html&quot;&gt;&lt;code&gt;Special Properties&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-09T15:51:22.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7217" PostTypeId="2" ParentId="7215" CreationDate="2015-01-09T16:45:35.460" Score="1" Body="&lt;p&gt;&#xA;I don't have &lt;code&gt;dz-defservice&lt;/code&gt; and am too lazy to install it, but this should answer your other question wrt creating multiple forms that have distinct symbols in them:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro dz-defservices (names scripts directories)&#xA;  `(progn&#xA;     ,@(cl-loop for name in names&#xA;                for script in scripts&#xA;                for directory in directories&#xA;                collect `(dz-defservice ,name ,script :cd ,directory))))&#xA;&#xA;(macroexpand&#xA; '(dz-defservices (foo bar baz)&#xA;                  (&quot;foo.sh&quot; &quot;bar.sh&quot; &quot;baz.sh&quot;)&#xA;                  (&quot;some/dir/foo&quot; &quot;some/dir/bar&quot; &quot;some/dir/baz&quot;)))&#xA;(progn (dz-defservice foo &quot;foo.sh&quot; :cd &quot;some/dir/foo&quot;)&#xA;       (dz-defservice bar &quot;bar.sh&quot; :cd &quot;some/dir/bar&quot;)&#xA;       (dz-defservice baz &quot;baz.sh&quot; :cd &quot;some/dir/baz&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="2642" LastEditDate="2015-01-10T10:22:47.497" LastActivityDate="2015-01-10T10:22:47.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7218" PostTypeId="2" ParentId="2600" CreationDate="2015-01-09T16:57:04.760" Score="1" Body="&lt;p&gt;Would setting &lt;a href=&quot;https://stackoverflow.com/questions/7130073/how-do-i-tell-a-shell-that-it-is-running-from-within-emacs&quot;&gt;TERM=emacs&lt;/a&gt; as part of the actual shell startup help? I have had &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  [ &quot;${INSIDE_EMACS}&quot; != &quot;&quot; ] &amp;amp;&amp;amp; export TERM=emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my ~/.bashrc for longer than I can remember and &lt;code&gt;(shell)&lt;/code&gt; has been part of my startup sequence for decades.&lt;/p&gt;&#xA;" OwnerUserId="5146" LastActivityDate="2015-01-09T16:57:04.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7219" PostTypeId="2" ParentId="3443" CreationDate="2015-01-09T18:45:58.067" Score="1" Body="&lt;p&gt;You might want to look at &lt;a href=&quot;https://emacs.stackexchange.com/questions/2600/advice-on-setting-shells-character-set/&quot;&gt;this question&lt;/a&gt;. Basically you need to avoid creating aliases for commands or prompts that assume that every shell is running where there is a window title to be set. Or create functions that do things differently depending on what kind of terminal they find themselves in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As part of my bash initialization I do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;case &quot;$TERM&quot; in&#xA;    (emacs)&#xA;        # Emacs shell differences ...&#xA;        ;;&#xA;    (xterm*|dtterm*|linux|screen)&#xA;        # Embed working directory in window title&#xA;        PROMPT_COMMAND='echo -ne &quot;\033]0;${SSH_TTY:+${HOSTNAME%%.*}:}${PWD##*/}\007&quot;'&#xA;        ;;&#xA;    *)&#xA;        # Unrecognized terminal types get nothing&#xA;        ;;&#xA;esac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You need tcsh's precmd to do something equivalent.&lt;/p&gt;&#xA;" OwnerUserId="5146" LastActivityDate="2015-01-09T18:45:58.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7220" PostTypeId="1" AcceptedAnswerId="7222" CreationDate="2015-01-09T20:02:24.800" Score="2" ViewCount="679" Body="&lt;p&gt;Sometimes it may happen that we would like to open the current buffer in another text editor (notepad, gedit, texmaker, ....). What are the best ways to do it?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="253" LastEditDate="2015-01-09T21:38:26.567" LastActivityDate="2015-05-12T22:04:56.597" Title="How can I open the current buffer in an alternative editor?" Tags="|buffers|files|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7221" PostTypeId="2" ParentId="7220" CreationDate="2015-01-09T20:14:39.973" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;M-! (shell-command)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could for example define your own command for edit that takes the current buffer name as input&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ppop-open-in-gedit ()&#xA;  (interactive &quot;&quot;)&#xA;  (shell-command (format  &quot;gedit %s&quot; (buffer-file-name))))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f10&amp;gt;&quot;) 'ppop-open-in-gedit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would check if the buffer has a corresponding file, but you get the idea.&lt;/p&gt;&#xA;" OwnerUserId="2395" LastEditorUserId="675" LastEditDate="2015-05-12T22:04:50.293" LastActivityDate="2015-05-12T22:04:50.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7222" PostTypeId="2" ParentId="7220" CreationDate="2015-01-09T20:23:33.970" Score="6" Body="&lt;p&gt;You could use something such as the following&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun open-external (&amp;amp;optional editor)&#xA;  (interactive &quot;sEditor to use: &quot;)&#xA;  (let ((file (buffer-file-name (current-buffer))))&#xA;    (if (executable-find editor)&#xA;        (if file&#xA;            (shell-command (format &quot;%s %s&quot;&#xA;                                   (executable-find editor)&#xA;                                   file))&#xA;          (user-error &quot;Current buffer has no associated file.&quot;))&#xA;      (user-error &quot;Editor (%s) not found on path&quot; editor))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This uses &lt;code&gt;buffer-file-name&lt;/code&gt; rather than &lt;code&gt;buffer-name&lt;/code&gt; to ensure you get the associated file from the filesystem.  It also validates that both the file and the editor selected are found on path (or explicitly pointed to).&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="675" LastEditDate="2015-05-12T22:04:56.597" LastActivityDate="2015-05-12T22:04:56.597" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7223" PostTypeId="1" AcceptedAnswerId="7499" CreationDate="2015-01-09T21:04:44.747" Score="4" ViewCount="1569" Body="&lt;p&gt;I have a file (my &lt;code&gt;org-mode&lt;/code&gt; todo list) that I keep in sync across my machines, and I often leave it open in Emacs. Thus, I placed the following in my &lt;code&gt;.dir-locals.el&lt;/code&gt; in the same folder as this file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((org-mode . ((auto-revert-mode . 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know it has taken effect, because my modeline shows &lt;code&gt;ARev&lt;/code&gt;, among others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the file never auto-reverts. Even if I have been away from my machine all day, making changes on another machine and syncing them, I don't see the changes. The sync was successful though, because as soon as I try to type in that buffer, I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;me&amp;gt;.org changed on disk; really edit the buffer? (y, n, r or C-h) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can hit &lt;code&gt;r&lt;/code&gt; at that point to revert the buffer, but I would rather just have that happen automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is my file not being auto-reverted? What can I do to determine the cause of this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running Emacs 24.4, and I have seen this behavior both on Windows 8 and on Debian Jessie.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;s&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Forgot to check this originally, but the problem doesn't happen when I run &lt;code&gt;emacs -Q&lt;/code&gt;. This means that it is caused by something in &lt;a href=&quot;https://github.com/501st-alpha1/emacs-init&quot; rel=&quot;nofollow&quot;&gt;my init file&lt;/a&gt;.&lt;/s&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; The problem only occurs when using the &lt;code&gt;.dirs-locals&lt;/code&gt; file. If I open a file, do &lt;code&gt;M-x auto-revert-mode&lt;/code&gt;, and edit it elsewhere, it reverts automatically, even using my full init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 3:&lt;/strong&gt; I was mistaken: The problem &lt;strong&gt;does&lt;/strong&gt; occur when running &lt;code&gt;emacs -Q&lt;/code&gt; if I use the &lt;code&gt;.dirs-locals.el&lt;/code&gt; posted above. So it is not a problem with my init file.&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2015-01-18T00:03:14.510" LastActivityDate="2015-01-18T11:06:10.973" Title="Why is auto-revert-mode not working?" Tags="|auto-revert-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7224" PostTypeId="1" CreationDate="2015-01-09T21:05:22.150" Score="4" ViewCount="2138" Body="&lt;p&gt;&lt;em&gt;Is there a good way to manage multiple windows in a large frame?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually have one large frame, split into many windows, and I find that when I (or some command) visits a buffer, the choice of window that will display the buffer is somewhat random. Sometimes it chooses a window that I'd like to keep its current buffer, sometimes it makes a new window, etc. All reasonable behaviours, but a bit annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only resources I've found are &lt;code&gt;display-buffer-alist&lt;/code&gt; and &lt;code&gt;set-window-dedicated-p&lt;/code&gt;, but they are not very convenient. For example, if I make a window dedicated, then I can't make it show a different buffer without undedicating it by hand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, I can use &lt;code&gt;display-buffer-alist&lt;/code&gt; to decide whether a buffer should make a new window/frame, or reuse or split some window, but it's difficult to control which window it uses. It mostly seems the use the least recently used window, but that's not a meaningful heuristic for my setup because I can easily have multiple important windows that I look at, but don't interact with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="875" LastEditorUserId="50" LastEditDate="2015-01-10T01:35:30.540" LastActivityDate="2015-02-18T16:50:10.030" Title="Managing multiple windows and buffers?" Tags="|buffers|window|frames|display-buffer-alist|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="7225" PostTypeId="1" CreationDate="2015-01-09T21:06:50.343" Score="3" ViewCount="1387" Body="&lt;p&gt;In Emacs color-theme libraries, which items control the visual selection foreground and background?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm in the process of giving Emacs a try after many years of Vim use.  The vim emulator, Evil, is working imporessively well for me but I'm having trouble with visual selection highlighting.  The problem seems to be with my chosen color theme rather than with Evil. I say this because if I comment out the the theme I can see the selected text properly highlighted, but not with my chosen theme which is a port of the ir-black them I use in Vim. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got the theme from &lt;a href=&quot;https://github.com/jmdeldin/ir-black-theme.el/blob/master/ir-black-theme.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jmdeldin/ir-black-theme.el/blob/master/ir-black-theme.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the section in my .emacs file that loads Evil and the theme.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;Enable &quot;Evil&quot;, the Vim emulation package&#xA;(add-to-list 'load-path &quot;~/.emacs.d/evil&quot;)&#xA;(require 'evil)&#xA;(evil-mode 1)&#xA;(line-number-mode t)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/color-theme-6.6.0&quot;)&#xA;(require 'color-theme)&#xA;(color-theme-initialize)&#xA;(color-theme-ir-black)    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've searched color-theme-ir-black.el for &quot;visual&quot; and find only the following lines that seem possibly relevant.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;visual selection: #1D1E2C&#xA; (region ((t (:background &quot;#1D1E2C&quot;))))&#xA; (speedbar-file-face ((t (:foreground &quot;#1D1E2C&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;FWIW, I'm running GNU Emacs 24.4.1 on OS X 10.9.5&lt;/p&gt;&#xA;" OwnerUserId="5147" LastActivityDate="2015-12-30T16:20:51.173" Title="Visual selection highlighting invisible (with Evil and color-theme)" Tags="|themes|evil|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7226" PostTypeId="2" ParentId="7220" CreationDate="2015-01-09T21:22:18.063" Score="3" Body="&lt;p&gt;This version opens the buffer in an external program (use a prefix to change the default).  If the buffer is not visiting a file, open it up in a temporary file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar alternate-editor &quot;gedit&quot;&#xA;  &quot;Editor to use when visiting a buffer outside of emacs.&quot;)&#xA;&#xA;(defun open-in-alternate-editor (&amp;amp;optional arg)&#xA;  &quot;Open buffer in alternative editor.  If buffer is unsaved,&#xA;bring it up in a temporary file.  With prefix argument, ask for&#xA;the editor to use.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((edit (executable-find (if arg&#xA;                                   (read-from-minibuffer&#xA;                                    &quot;Enter editor to use: &quot;&#xA;                                    alternate-editor)&#xA;                                 alternate-editor)))&#xA;        (file (or (buffer-file-name)&#xA;                  (make-temp-file &quot;unsaved-emacs-buffer-&quot;)))&#xA;        (buff (unless (buffer-file-name)&#xA;                (save-restriction (widen) (buffer-string)))))&#xA;    (when (null edit)&#xA;      (error &quot;Can't find alternate editor&quot;))&#xA;    (unless (buffer-file-name)&#xA;      (with-temp-file file&#xA;        (insert buff)))&#xA;    (start-process &quot;Alternate Editor&quot; nil edit file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;defvar&lt;/code&gt; might be overkill -- you could just replace it with whatever string you like within the &lt;code&gt;defun&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="675" LastEditDate="2015-05-12T22:04:38.400" LastActivityDate="2015-05-12T22:04:38.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7227" PostTypeId="1" AcceptedAnswerId="7271" CreationDate="2015-01-09T22:39:21.747" Score="0" ViewCount="236" Body="&lt;p&gt;I'm fairly new to aquamacs/emacs and while editing I noticed that it indents however it wants.&#xA;In order to indent the way I want I end up using M-i, but that is pretty cumbersome.&#xA;So, how do I make the TAB key behave like M-i (that is, inserting 4 spaces whenever I press it, regardless of the type of file I am editing)?&lt;/p&gt;&#xA;" OwnerUserId="5155" LastEditorUserId="262" LastEditDate="2019-09-09T17:40:18.520" LastActivityDate="2019-09-09T17:40:18.520" Title="can TAB behave like M-i?" Tags="|key-bindings|tab-key|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7228" PostTypeId="1" AcceptedAnswerId="7234" CreationDate="2015-01-10T00:39:35.953" Score="1" ViewCount="724" Body="&lt;p&gt;I've seen snippets like this:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?┃))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That claim to make emacs use a prettier window divider character. However, &lt;code&gt;standard-display-table&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; in a &lt;code&gt;emacs24.4 -Q&lt;/code&gt;. How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="105" LastEditDate="2015-01-10T21:49:30.120" LastActivityDate="2015-01-10T21:55:05.657" Title="Nice TTY window borders in 24.4" Tags="|window|faces|display|buffer-display-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7229" PostTypeId="2" ParentId="7183" CreationDate="2015-01-10T00:51:36.900" Score="1" Body="&lt;p&gt;Recall macros are expanded before the document is parsed.  This might get you started. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: tags-on-latex (eval (format &quot;#+OPTIONS: tags:%s&quot; (if (org-export-derived-backend-p org-export-current-backend 'latex) &quot;t&quot; &quot;nil&quot;)))&#xA;{{{tags-on-latex}}}&#xA;* h                                                                     :tag:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more fine-grained control (say html) just add more backend to the &lt;code&gt;&amp;amp;rest&lt;/code&gt; part of  &lt;code&gt;org-export-derived-backend-p&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2015-01-10T00:51:36.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7230" PostTypeId="1" AcceptedAnswerId="7239" CreationDate="2015-01-10T01:59:01.840" Score="12" ViewCount="3232" Body="&lt;p&gt;I have a git repository where some org-mode files live. Some of them have a private nature and the server where the git repository lives can be accessed by some untrusted third party. Thatswhy I want to encrypt the private org files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'd like to achieve is the following: In the beginning the file is encrypted. This can be either a symmetric key with a password or it can also be my GnuPG key. When I open the file, Emacs asks for the passphrase and opens the file (if pw entered correct). I can now work with the org file like with any other org file. When I save or close the file, it should be encrypted again. Also the git commit should be encrypted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do something like that with GNU/Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2015-01-10T16:03:17.027" Title="How to automatically encrypt orgmode files?" Tags="|org-mode|git|encryption|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7231" PostTypeId="2" ParentId="7198" CreationDate="2015-01-10T04:29:08.007" Score="0" Body="&lt;p&gt;After various experiments, here's what I came up with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works so far.  But I am no elisp master, so I welcome any improvements.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun gpc/mirror-buffer (buffer-name &amp;amp;optional more-after-change)&#xA;  &quot;Create a buffer whose contents will follow the current one's&#xA;and returns the new buffer.  Runs `more-after-change' after each&#xA;change if provided.&#xA;&#xA;This differs from `clone-indirect-buffer' in that the new buffer&#xA;is not visiting a file.  It's really just a kludge to support&#xA;`gpc/mirror-image', which see.&quot;&#xA;  (interactive (list &#xA;                (let ((default (concat (buffer-name) &quot;&amp;lt;mirror&amp;gt;&quot;)))&#xA;                  (read-string &quot;Buffer name: &quot; default&#xA;                               nil nil default))))&#xA;  (make-local-variable 'after-change-functions)&#xA;  (make-local-variable 'kill-buffer-hook)&#xA;  (lexical-let*&#xA;      ((target-buffer (generate-new-buffer buffer-name))&#xA;       ;; Give lexical scope to arg&#xA;       (after-change more-after-change)&#xA;       (copy-change&#xA;        #'(lambda(start end old-len)&#xA;            (let ((inhibit-read-only t))&#xA;              ;; Quick and dirty: may not be suitable for large buffers.&#xA;              (copy-to-buffer target-buffer (point-min) (point-max))&#xA;              (when (functionp after-change)&#xA;                (funcall after-change target-buffer))))))&#xA;&#xA;    ;; Initialize the target buffer with the source text.&#xA;    (copy-to-buffer target-buffer (point-min) (point-max))&#xA;&#xA;    (add-hook 'after-change-functions copy-change t t)&#xA;&#xA;    ;; Cleanup hooks.&#xA;&#xA;    ;; Kill the other buffer if the source buffer is closed.&#xA;    (add-hook 'kill-buffer-hook&#xA;              #'(lambda () (kill-buffer target-buffer)) t t)&#xA;&#xA;    ;; Destroy the change hook if the other buffer is killed.&#xA;    (with-current-buffer target-buffer&#xA;      (make-local-variable 'kill-buffer-hook)&#xA;      (add-hook 'kill-buffer-hook&#xA;                #'(lambda ()&#xA;                    (remove-hook 'after-change-functions copy-change t))&#xA;                t t))))&#xA;&#xA;(defun gpc/mirror-image ()&#xA;  &quot;Open an `image-mode' buffer that tracks the content of the&#xA;current buffer.  Intended for use with svg files.&quot;&#xA;  (interactive)&#xA;  (image-mode-as-text)&#xA;  (let* ((buffer-name (concat (buffer-name) &quot;&amp;lt;image&amp;gt;&quot;))&#xA;         ;; An `image-mode' buffer will switch back to text when its contents&#xA;         ;; are replaced.  Besides, the image is not updated in-place when the&#xA;         ;; content changes, so you'd have to toggle back to image-mode anyway.&#xA;         (after-change '(lambda (buffer)&#xA;                          (with-current-buffer buffer (image-mode))))&#xA;         (mirror (gpc/mirror-buffer buffer-name after-change)))&#xA;    (split-window)&#xA;    (other-window 1)&#xA;    (switch-to-buffer buffer-name)&#xA;    (image-mode)&#xA;    (other-window 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3896" LastActivityDate="2015-01-10T04:29:08.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7232" PostTypeId="2" ParentId="5394" CreationDate="2015-01-10T07:20:33.833" Score="0" Body="&lt;p&gt;Recently a similar &lt;a href=&quot;https://github.com/nicferrier/elmarmalade/issues/55&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Fatal error: The TLS connection was non-properly terminated&quot;&gt;issue&lt;/a&gt; was submitted to &lt;a href=&quot;https://github.com/nicferrier/elmarmalade&quot; rel=&quot;nofollow noreferrer&quot;&gt;marmalade-repo&lt;/a&gt; on github.&#xA;I'm not certain if your issue is related but &lt;a href=&quot;https://stackoverflow.com/users/130125/nic-ferrier&quot;&gt;Nic Ferrier&lt;/a&gt; provided an alternate url as temporary fix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try setting your repository url to &lt;a href=&quot;http://marmalade.ferrier.me.uk/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://marmalade.ferrier.me.uk/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that Helped!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Melioratus&lt;/p&gt;&#xA;" OwnerUserId="388" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-01-10T07:20:33.833" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7233" PostTypeId="1" CreationDate="2015-01-10T08:05:47.683" Score="6" ViewCount="1372" Body="&lt;p&gt;I am unable to set up yasnippet the way I want to set it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only want to use yasnippet for a particular set of modes, so I don't want to use &lt;code&gt;yas-global-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only want to use my own snippets, not the ones that come pre-packaged with the MELPA installation. I don't want it to ever load the MELPA snippets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the package is being insufferable; the only way I can figure out how to add my snippets and get them to actually work is to do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'yasnippet)&#xA;&#xA;;; Use custom snippets.&#xA;(add-to-list 'yas-snippet-dirs &quot;~/Dropbox/configs/emacs/snippets/&quot;)&#xA;(yas-reload-all)&#xA;&#xA;(dolist (hook jrh-programming-modes)&#xA;  (add-hook hook 'yas-minor-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have to call &lt;code&gt;yas-reload-all&lt;/code&gt;, or else my snippets aren't available. I have to use &lt;code&gt;add-to-list&lt;/code&gt;, because for &lt;em&gt;some reason&lt;/em&gt;, when I replace that line with &lt;code&gt;(setq yas-snippet-dirs '(&quot;~/Dropbox/configs/emacs/snippets/&quot;))&lt;/code&gt;, my snippets are not loaded. So I have to suffer through the loading of all the other snippets, which I never use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to do is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Use custom snippets.&#xA;(setq yas-snippet-dirs '(&quot;~/Dropbox/configs/emacs/snippets/&quot;))&#xA;&#xA;(require 'yasnippet)&#xA;&#xA;(dolist (hook jrh-programming-modes)&#xA;  (add-hook hook 'yas-minor-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and never need to use the other snippets or reload at all. Of course, the above code does not work, even though in my head it seems like it should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help on how to accomplish this would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2015-01-13T00:52:03.890" Title="(setq yas-snippet-dirs ...) not working" Tags="|minor-mode|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7234" PostTypeId="2" ParentId="7228" CreationDate="2015-01-10T09:17:20.383" Score="4" Body="&lt;p&gt;The docs of &lt;code&gt;standard-display-table&lt;/code&gt; refer to &lt;code&gt;buffer-display-table&lt;/code&gt; which mentions that you can create display tables with &lt;code&gt;make-display-table&lt;/code&gt; if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means the following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((display-table (or standard-display-table (make-display-table))))&#xA;  (set-display-table-slot display-table 'vertical-border (make-glyph-code ?┃))&#xA;  (setq standard-display-table display-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-10T09:17:20.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7235" PostTypeId="1" AcceptedAnswerId="7236" CreationDate="2015-01-10T09:53:26.227" Score="2" ViewCount="65" Body="&lt;p&gt;Is it possible to specify that a defcustom can only take the value of a mode? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I've got a variable that's a map from major modes to lists of strings, and I wants users to be able to configure this map. So conceptually I want something like this:&#xA;&lt;code&gt;&#xA;(defcustom my-type-map&#xA; :type '(alist :key-type 'mode :value-type '(repeat string)))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible, or do I just need to use documentation?&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2015-01-10T10:38:36.960" Title="Specify the type &quot;mode&quot; for defcustom?" Tags="|customization|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7236" PostTypeId="2" ParentId="7235" CreationDate="2015-01-10T10:38:36.960" Score="3" Body="&lt;p&gt;Since major modes happen to be functions, you can use the &lt;code&gt;function&lt;/code&gt; type to allow completion of functions.  There is the composite type &lt;code&gt;restricted-sexp&lt;/code&gt; which allows you to use a predicate to allow even more specific types, however it wouldn't make much sense to use it since there is no predicate or way to determine whether a function is a major mode (despite the convention of them ending in &quot;-mode&quot; it could very well be a minor mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I'd recommend going for functions and adding a descriptive docstring instead.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-10T10:38:36.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7237" PostTypeId="1" AcceptedAnswerId="7334" CreationDate="2015-01-10T11:06:55.150" Score="3" ViewCount="548" Body="&lt;p&gt;&lt;code&gt;:cache yes&lt;/code&gt; makes the settings on &lt;code&gt;#+RESULTS&lt;/code&gt; be erased whenever execute the block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want an image file be resized into width 12cm for LaTeX -&gt; PDF exporting. However, &lt;code&gt;#+ATTR_LATEX: :width 12cm :float c&lt;/code&gt; on top of &lt;code&gt;#+RESULTS[fce2...]:&lt;/code&gt; will be erased (if the image is need to be updated after compared the SHA1) when evaluate the block...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+tblname: standard&#xA;| Standard Conc(ppm) | Value |&#xA;|--------------------+----------------|&#xA;|                  0 |              0 |&#xA;|                 10 |          0.264 |&#xA;|                 20 |           0.52 |&#xA;|                 30 |          0.739 |&#xA;&#xA;#+begin_src gnuplot :cache yes :var standard=standard :file plots/standard.png&#xA;reset&#xA;set terminal pngcairo size 800,800 enhanced font 'WenQuanYiZenHei,14'&#xA;set xlabel &quot;Standard Conc.（ppm）&quot;&#xA;set ylabel &quot;Value&quot; &#xA;&#xA;set style up points&#xA;set grid&#xA;set pointsize 5&#xA;&#xA;stats standard using 1:2 name &quot;STD&quot;&#xA;&#xA;# f(x)=a*(x)+b&#xA;line(x)=STD_slope*(x)+STD_intercept&#xA;&#xA;set xrange [0:40]&#xA;set yrange [0:]&#xA;set xtics 0, 10, 40&#xA;set ytics 0, 0.1, 1&#xA;&#xA;unset key&#xA;set label 1 sprintf(&quot;r = %4.4f\nR^2 = %4.4f\ny = %4.4f x + %.4f&quot;,STD_correlation, STD_correlation**2, STD_slope, STD_intercept) at graph 0.1, graph 0.9&#xA;plot standard u 1:2 notitle,\&#xA;     line(x) title 'Linear Fit' &#xA;#+end_src&#xA;&#xA;#+ATTR_LATEX: :width 12cm :float c&#xA;#+RESULTS[fce2bedf80238d089cc3e5d79570ccf6520eddaf]:&#xA;[[file:plots/standard.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2015-01-10T12:20:11.200" LastActivityDate="2015-01-25T16:41:20.227" Title="`:cache yes` makes the settings on `#+RESULTS` erased whenever executing the block" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7238" PostTypeId="1" AcceptedAnswerId="7240" CreationDate="2015-01-10T11:10:52.707" Score="7" ViewCount="5453" Body="&lt;p&gt;When I type &lt;kbd&gt;C-h r&lt;/kbd&gt; I get error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Debugger entered--Lisp error: (error &quot;Info file emacs does not exist&quot;)&#xA;  signal(error (&quot;Info file emacs does not exist&quot;))   error(&quot;Info file %s&#xA;  does not exist&quot; &quot;emacs&quot;)   Info-find-file(&quot;emacs&quot;)&lt;br&gt;&#xA;  Info-find-node(&quot;emacs&quot; &quot;Top&quot;)   Info-goto-node(&quot;(emacs)&quot;)&lt;br&gt;&#xA;  info-setup(&quot;emacs&quot; #)   info(&quot;emacs&quot;)&lt;br&gt;&#xA;  info-emacs-manual()   call-interactively(info-emacs-manual nil nil)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.3 on Ubuntu 14.04. (I have installed package &lt;code&gt;emacs24-common-non-dfsg&lt;/code&gt;.. )&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2020-11-10T09:33:59.417" Title="Info file emacs does not exist" Tags="|documentation|help|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7239" PostTypeId="2" ParentId="7230" CreationDate="2015-01-10T11:35:46.507" Score="14" Body="&lt;p&gt;You just need to add &quot;.gpg&quot; at the end of the file name (for example, you could use &quot;private.org.gpg&quot; for an org file), and put at the end&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# epa-file-encrypt-to: &quot;someone@somwhere.org&quot;&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where someone@somwhere.org identify a gpg key you use for encrypting this file.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="2237" LastEditDate="2015-01-10T16:03:17.027" LastActivityDate="2015-01-10T16:03:17.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7240" PostTypeId="2" ParentId="7238" CreationDate="2015-01-10T14:15:02.907" Score="3" Body="&lt;p&gt;You have to set the correct path to the Emacs info files in the &lt;code&gt;INFOPATH&lt;/code&gt; environment variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export INFOPATH=$INFOPATH:/usr/share/info/emacs-24&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-10T14:15:02.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7242" PostTypeId="1" AcceptedAnswerId="7252" CreationDate="2015-01-10T14:33:28.667" Score="4" ViewCount="1480" Body="&lt;p&gt;First of all, from &lt;a href=&quot;http://www.emacswiki.org/emacs/AllOut&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/AllOut&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Allout outline mode is part of GnuEmacs. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Allout outline mode provides extensive outline formatting and&#xA;  manipulation beyond standard emacs outline mode. It provides for&#xA;  structured editing of outlines, as well as navigation and exposure. It&#xA;  also provides for syntax-sensitive text like programming languages.&#xA;  (For an example, see the allout code itself, which is organized in an&#xA;  allout outline framework.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you view the “allout.el” itself, and trigger &lt;code&gt;M-x allout-hide-bodies&lt;/code&gt;, you’ll get an indented outline view of the source code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure &lt;code&gt;allout-mode&lt;/code&gt; to understand markdown syntax so that I can use it to navigate and show/hide sections in a markdown file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="4089" LastEditDate="2015-01-10T21:47:09.783" LastActivityDate="2015-01-10T21:47:09.783" Title="Enable any outline mode for markdown" Tags="|customize|markdown-mode|outline|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7243" PostTypeId="1" AcceptedAnswerId="7248" CreationDate="2015-01-10T14:57:47.507" Score="1" ViewCount="86" Body="&lt;p&gt;I want to enable mode association with backup files as well. E.g., if I backup my &lt;code&gt;my-markdown.md&lt;/code&gt; file as &lt;code&gt;my-markdown.md.orig&lt;/code&gt; or &lt;code&gt;my-markdown.md.lastweek&lt;/code&gt; etc, I want them still be associated with the markdown mode. This is how I'm trying to fix it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (use-package markdown-mode&#xA;-  :mode (&quot;\\.\\(txt\\|markdown\\|md\\)\\'&quot; . markdown-mode))&#xA;+  :mode (&quot;\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.)&quot; . markdown-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It was working fine before my hack, but now neither the &lt;code&gt;.md&lt;/code&gt; files nor the &lt;code&gt;.md.lastweek&lt;/code&gt; are associated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;UPDATE&lt;/em&gt;, for the record, for all my questions, I gather all the answers to &lt;a href=&quot;https://github.com/suntong001/emacs.d&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="4089" LastEditDate="2015-01-11T04:03:30.100" LastActivityDate="2015-01-11T04:03:30.100" Title="Enable mode association with backup files as well" Tags="|major-mode|association-lists|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7244" PostTypeId="1" AcceptedAnswerId="7261" CreationDate="2015-01-10T16:34:24.687" Score="7" ViewCount="1817" Body="&lt;p&gt;How to use mouse to select column in Emacs? How to enable it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.emacswiki.org/emacs/RectangleMark&quot; rel=&quot;noreferrer&quot;&gt;emacs wiki RectangleMark&lt;/a&gt; says, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;there is mouse support for rectangle highlighting by dragging the&#xA;  mouse while holding down the shift key. The idea is that this behaves&#xA;  exactly like normal mouse dragging except that the region is treated&#xA;  as a rectangle.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, when I tried it, it doesn't work. No rectangle column is highlighted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if I need to use the next Lisp:rect-mark.el file or not, because when I look at it, it says, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If you use both transient-mark-mode and picture-mode, you will&#xA;;; probably realize how convenient it would be to be able to highlight&#xA;;; the region between point and mark as a rectangle.  Have you ever&#xA;;; wished you could see where exactly those other two corners fell&#xA;;; before you operated on a rectangle?  If so, then this program is&#xA;;; for you.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To &lt;em&gt;&quot;see where exactly those other two corners fell&quot;&lt;/em&gt;? Isn't that feature already provided out of box (ref &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html&lt;/a&gt;)? &#xA;I'm confused. UTSL tells me that it is &lt;strong&gt;duplicating&lt;/strong&gt; what is already provided out of box by Emacs. Do I need the whole &lt;code&gt;rect-mark.el&lt;/code&gt; file, or merely the mouse key-binding part only? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;UPDATE&lt;/em&gt;, for the record, for all my questions, I gather all the answers to &lt;a href=&quot;https://github.com/suntong001/emacs.d&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="4089" LastEditDate="2015-01-11T04:02:01.553" LastActivityDate="2018-09-12T15:35:52.270" Title="Enable Emacs column selection using mouse" Tags="|mouse|rectangle|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7246" PostTypeId="2" ParentId="7233" CreationDate="2015-01-10T17:56:02.667" Score="4" Body="&lt;p&gt;From &lt;a href=&quot;https://github.com/capitaomorte/yasnippet/issues/544&quot; rel=&quot;nofollow&quot;&gt;yas-minor-mode does not load snippets&lt;/a&gt; (GitHub):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I think when not using &lt;code&gt;yas-global-mode&lt;/code&gt; you have to at least add a&#xA;  &lt;code&gt;(yas-reload-all)&lt;/code&gt; call somewhere to your &lt;code&gt;.emacs&lt;/code&gt;. This will setup the&#xA;  jit-loading tables (and not load actual snippets until &lt;code&gt;yas-minor-mode&lt;/code&gt;&#xA;  is activated in some buffer for which one of those tables has been&#xA;  setup.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It might be desirable to have this performed automatically, but I&#xA;  think I've analysed this in the past and found it to not be suitable&#xA;  (for some reason that I can't quite remember right now, sorry).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Anyway, you have a workaround: add &lt;code&gt;(yas-reload-all)&lt;/code&gt; somewhere in your&#xA;  init file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is a bug; the solution I have discovered is the maintainer's recommended workaround in the interim.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastEditorUserId="504" LastEditDate="2015-01-13T00:52:03.890" LastActivityDate="2015-01-13T00:52:03.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7247" PostTypeId="2" ParentId="7243" CreationDate="2015-01-10T18:13:44.533" Score="1" Body="&lt;p&gt;I suspect the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;emacs manual : regular expressions&quot;&gt;regex&lt;/a&gt;, &lt;code&gt;&quot;\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.)&quot;&lt;/code&gt; is the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This regular expression should match &lt;code&gt;.txt&lt;/code&gt;, &lt;code&gt;.markdown&lt;/code&gt;, &lt;code&gt;.md&lt;/code&gt;, &lt;code&gt;.md.lastweek&lt;/code&gt;, and &lt;code&gt;.md.orig&lt;/code&gt; file extensions. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\.\\(txt\\|markdown\\|md\\([.]\\(lastweek\\|orig\\)\\)?\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;an alternative method&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Explicitly &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;define the major mode inside the files&lt;/a&gt; by placing the following &lt;a href=&quot;https://stackoverflow.com/a/20885980/951721&quot;&gt;markdown comment&lt;/a&gt; at the top of each file. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[//]: # ( -*- mode: markdown; -*- )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The comment should be hidden when you post it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a test, I explicitly inserted the &lt;a href=&quot;https://emacs.stackexchange.com/posts/7247/edit&quot;&gt;example comment&lt;/a&gt; to the top of this answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend using the alternative method because it provides the flexibility and convenience to assign the correct major mode as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, what if you &lt;em&gt;try&lt;/em&gt; another extension pattern in the future:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;e.g.&lt;br&gt;&#xA;         .md.2015011000.your_username&lt;br&gt;&#xA;         .md.2015011001.my_username  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you like the new pattern, then you can always update the regex later and you won't risk break your current mapping during testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also provides a safe method to test out new major modes, e.g. &lt;em&gt;super-special-markdown-mode&lt;/em&gt;, before remapping the extensions in emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;" OwnerUserId="388" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-10T21:19:13.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7248" PostTypeId="2" ParentId="7243" CreationDate="2015-01-10T18:22:34.070" Score="2" Body="&lt;p&gt;I think you were on the right track but your regular expression does not escape the final &lt;code&gt;)&lt;/code&gt; character, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a general tip, you can test out Emacs regular expressions using &lt;code&gt;regexp-builder&lt;/code&gt;. Put some example text in a scratch buffer, say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo.md&#xA;foo.md.lastweek&#xA;foo.md.orig&#xA;foo.mdnomatch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then do &lt;code&gt;M-x regexp-builder&lt;/code&gt;. This opens a RE-Builder buffer where you can put in the regular expression and see what matches. (One note if you use this approach to test your expressions: &lt;code&gt;\\'&lt;/code&gt; only matches the end of the content being tested, not the end of a line. Using &lt;code&gt;$&lt;/code&gt; would be easier to test in this way.)&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-01-10T21:08:43.547" LastActivityDate="2015-01-10T21:08:43.547" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7249" PostTypeId="1" AcceptedAnswerId="7262" CreationDate="2015-01-10T18:47:41.573" Score="5" ViewCount="467" Body="&lt;p&gt;I &lt;code&gt;diminish&lt;/code&gt; my minor modes into single Unicode characters to save space. However, this obviously breaks down in a Linux TTY for instance. How can I detect if the current display method supports Unicode (or better yet, can display a specific character)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: Simply detecting a graphical frame is not enough, as many graphical terminal emulators support Unicode, but emacs does not run in a graphical frame.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-01-10T19:47:49.753" LastActivityDate="2015-01-11T05:52:16.230" Title="Emacs detect terminal Unicode coverage" Tags="|unicode|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7250" PostTypeId="1" AcceptedAnswerId="7251" CreationDate="2015-01-10T20:05:44.917" Score="9" ViewCount="5974" Body="&lt;p&gt;In a Lisp function, how do I instruct org to automatically insert a timestamp with today's date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the function &lt;code&gt;org-insert-time-stamp&lt;/code&gt;, but I don't know how to provide an argument for it that will return today's date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation for the function says:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-insert-time-stamp TIME &amp;amp;optional WITH-HM INACTIVE PRE POST EXTRA)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but I don't see where to find documentation about what &lt;code&gt;TIME &amp;amp;optional WITH-HM INACTIVE PRE POST EXTRA&lt;/code&gt; means or how to specify these in a function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here's the function I'm trying to write:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-today-heading-and-clock-in ()&#xA;  &quot;Insert a new heading with today's date, and then clock in.&quot;&#xA;  (interactive)&#xA;  (org-insert-subheading)&#xA;  (org-insert-time-stamp (today))&#xA;  (org-clock-in))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="504" LastEditDate="2015-01-12T08:25:23.947" LastActivityDate="2018-12-27T03:48:05.717" Title="in org-mode, how to insert timestamp with today's date?" Tags="|org-mode|time-date|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7251" PostTypeId="2" ParentId="7250" CreationDate="2015-01-10T20:09:06.070" Score="6" Body="&lt;p&gt;With a bit of guesswork:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-insert-time-stamp (current-time))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-10T20:09:06.070" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7252" PostTypeId="2" ParentId="7242" CreationDate="2015-01-10T21:38:21.553" Score="7" Body="&lt;p&gt;If I understand the question, you are looking for a way to edit markdown files where you can show or hide sections, navigate by headings and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've never used &lt;code&gt;allout-mode&lt;/code&gt; but it does look like you could configure it to recognize markdown syntax. However, another option is to take a look at &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot; rel=&quot;noreferrer&quot;&gt;markdown-mode&lt;/a&gt; which supports navigation and folding, e.g.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;markdown-mode supports outline-minor-mode as well as org-mode-style visibility cycling for atx- or hash-style headings. There are two types of visibility cycling: Pressing S-TAB cycles globally between the table of contents view (headings only), outline view (top-level headings only), and the full document view. Pressing TAB while the point is at a heading will cycle through levels of visibility for the subtree: completely folded, visible children, and fully visible. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-10T21:38:21.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7253" PostTypeId="2" ParentId="7228" CreationDate="2015-01-10T21:48:31.503" Score="0" Body="&lt;p&gt;You do not need to fiddle with a display table. Just customize face &lt;code&gt;window-divider&lt;/code&gt;: &lt;code&gt;M-x customize-face window-divider&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use a &lt;code&gt;Blue&lt;/code&gt; foreground attribute, for example. Here is a screenshot, with scroll bars turned off:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ibR5p.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oops. I see now that you are interested in TTY, not graphics. In that case, you can try customizing face &lt;code&gt;vertical-border&lt;/code&gt;, giving it, for example, a &lt;code&gt;width&lt;/code&gt; attribute value of &lt;code&gt;narrow&lt;/code&gt;.  Here is a screenshot of that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/S6rXm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-01-10T21:55:05.657" LastActivityDate="2015-01-10T21:55:05.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7254" PostTypeId="1" AcceptedAnswerId="7294" CreationDate="2015-01-10T22:24:22.110" Score="7" ViewCount="970" Body="&lt;p&gt;I often find myself needing to insert Unicode characters that have no default binding in &lt;code&gt;iso-transl-ctl-x-8-map&lt;/code&gt;, i.e., characters that can't be inserted using &lt;kbd&gt;C-x 8&lt;/kbd&gt; followed by one or more letters/punctuation characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add bindings to the &lt;kbd&gt;C-x 8&lt;/kbd&gt; keymap, I usually&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;define a custom command for inserting a given Unicode character, such as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ucs-rightwards-arrow ()&#xA;  &quot;Insert unicode symbol: →&quot;&#xA;  (interactive)&#xA;  (insert-char #x2192))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;add a binding for this command to the map via&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key iso-transl-ctl-x-8-map (kbd &quot;a&quot;) 'ucs-rightwards-arrow)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Since the &lt;kbd&gt;C-x 8&lt;/kbd&gt; keymap really only pairs key bindings with single characters I'm wondering:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there a more light-weight/idiomatic way of extending the &lt;kbd&gt;C-x 8&lt;/kbd&gt; keymap?&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="105" LastEditDate="2022-11-11T18:03:06.390" LastActivityDate="2022-11-11T18:03:06.390" Title="Idiomatic way of extending keymap for inserting unicode symbols?" Tags="|key-bindings|keymap|unicode|characters|insert-char|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7255" PostTypeId="2" ParentId="7254" CreationDate="2015-01-10T22:42:49.583" Score="4" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/ucs-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ucs-cmds.el&lt;/code&gt;&lt;/a&gt; can help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It provides a macro, &lt;code&gt;ucsc-make-commands&lt;/code&gt;, for quickly &lt;em&gt;creating a set of commands&lt;/em&gt; that insert Unicode characters. You provide a regexp to it, which is matched against all Unicode character names (in &lt;code&gt;ucs-names&lt;/code&gt;). An insertion&#xA;command is created for each of the characters whose name matches. (The command names are essentially the same as the char names - see below.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample command creations:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (ucsc-make-commands &quot;^math&quot;) ; Math symbols&#xA; (ucsc-make-commands &quot;latin&quot;) ; Latin alphabet characters&#xA; (ucsc-make-commands &quot;arabic&quot;)&#xA; (ucsc-make-commands &quot;^cjk&quot;)  ; Chinese, Japanese, Korean characters&#xA; (ucsc-make-commands &quot;^box drawings &quot;)&#xA; (ucsc-make-commands &quot;^greek [a-z]+ letter&quot;) ; Greek characters&#xA; (ucsc-make-commands &quot;\\(^hangul\\|^circled hangul\\|^parenthesized hangul\\)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the doc string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ucsc-make-commands is a Lisp macro in `ucs-cmds.el'.&#xA;&#xA;(ucsc-make-commands REGEXP)&#xA;&#xA;Create commands to insert Unicode characters whose names match REGEXP.&#xA;Letter case is ignored for matching.&#xA;&#xA;The set of char names used is taken from `ucs-names'.  There are&#xA;*many* such chars, so consider using a tighter regexp to limit the&#xA;number of commands created.&#xA;&#xA;The commands created have the same names as the chars they insert,&#xA;except that `SPC' chars in the character names are replaced by&#xA;hyphens (`-'), and the command names are lowercase.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you wanted to bind the commands you create to keys in a systematic way, then you could easily create a macro based on the code of &lt;code&gt;ucsc-make-commands&lt;/code&gt; that both creates the commands you want and binds them. Macro &lt;code&gt;ucsc-make-commands&lt;/code&gt; just iterates over all of the Unicode cars and creates commands for those whose names match the &lt;code&gt;REGEXP&lt;/code&gt; argument. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;During an iteration you have access to the character name and its code point. Figure out a convenient regular mapping of either code points or char names to keys, and your macro can add the appropriate &lt;code&gt;define-key&lt;/code&gt;s in addition to the command &lt;code&gt;defun&lt;/code&gt;s.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The library also provides a command, &lt;code&gt;ucsc-insert&lt;/code&gt;, that can replace vanilla command&#xA;&lt;code&gt;insert-char&lt;/code&gt;. The behavior and code of &lt;code&gt;ucsc-insert&lt;/code&gt; are identical to those of&#xA;&lt;code&gt;insert-char&lt;/code&gt; except for what happens when you use a negative prefix argument:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It acts as if the prefix-arg value was positive.  So a value of&#xA;-3 inserts three copies of the character, just as 3 does.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In addition to inserting the character, it defines a command&#xA;that you can use thereafter to insert that character.  You can&#xA;use a prefix argument with that command to insert multiple&#xA;copies of the given character.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This gives you a command that is tailor-made to insert a given&#xA;Unicode character.  You can then bind the command to a key&#xA;sequence, effectively adding Unicode characters to your keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever &lt;code&gt;insert-char&lt;/code&gt; does anything (it does nothing for a&#xA;negative prefix arg), &lt;code&gt;ucsc-insert&lt;/code&gt; does the same thing.  Because&#xA;of this, you can bind &lt;code&gt;ucsc-insert&lt;/code&gt; to &lt;code&gt;C-x 8 RET&lt;/code&gt; as&#xA;a replacement for &lt;code&gt;insert-char&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key global-map [remap insert-char] 'ucsc-insert)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you need only a few such commands for inserting particular&#xA;Unicode characters, then using &lt;code&gt;ucsc-insert&lt;/code&gt; to define them is&#xA;sufficiently convenient. If you need a lot of such commands then macro &lt;code&gt;ucsc-make-commands&lt;/code&gt; is your friend.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:30:41.907" LastActivityDate="2015-05-09T20:30:41.907" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7256" PostTypeId="2" ParentId="3711" CreationDate="2015-01-11T00:45:47.517" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;However, realgud is lacking documentation, &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Although I largely agree, there is a wiki &lt;a href=&quot;https://github.com/realgud/realgud/wiki/How-to-Use&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;wiki&quot;&gt;How-to-Use&lt;/a&gt; which anyone can contribute to. And I suppose you can open an &lt;a href=&quot;https://github.com/realgud/realgud/issues&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;new issue&quot;&gt;issue&lt;/a&gt; to get help.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By the way, why gud with pdb does not have the function gud-until?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;pdb does have an &lt;em&gt;until&lt;/em&gt; command. Although when I tried it outside of a function it seemed to not work, I suppose there's no reason not it couldn't be included in gud. A guess is that it's not there because &lt;em&gt;until&lt;/em&gt; was a more recent addition to gdb and thus gud. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;a href=&quot;https://gist.github.com/rocky/7d773de32be146eb7292&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/rocky/7d773de32be146eb7292&lt;/a&gt; has a simple patch that you might be able to apply to gud.el . If you haven't already reported the emacs bug, you can attach this as a suggested remedy. (And if you have reported it I suppose you can still attach it if this hasn't been already addressed.)&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2018-09-24T02:12:25.987" LastActivityDate="2018-09-24T02:12:25.987" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="7257" PostTypeId="5" CreationDate="2015-01-11T02:02:58.270" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-01-11T02:02:58.270" LastActivityDate="2015-01-11T02:02:58.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7258" PostTypeId="4" CreationDate="2015-01-11T02:02:58.270" Score="0" Body="Cider is a mode for interacting with Clojure. As Slime does for Common Lisp, Cider does for Clojure." OwnerUserId="245" LastEditorUserId="245" LastEditDate="2015-01-11T09:26:41.757" LastActivityDate="2015-01-11T09:26:41.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7259" PostTypeId="2" ParentId="7249" CreationDate="2015-01-11T02:15:13.770" Score="-1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I detect if the current display method supports Unicode (or better yet, can display a specific character)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can detect if emacs can display a specific character with the &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/char-displayable-p&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;char-displayable-p&lt;/code&gt;&lt;/a&gt; function. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(char-displayable-p ?☺) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can insert such unicode chars with &lt;code&gt;C-x 8&lt;/code&gt;, or use their hex code preceded by a &lt;code&gt;\x&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-11T02:15:13.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7260" PostTypeId="2" ParentId="5613" CreationDate="2015-01-11T02:38:34.457" Score="9" Body="&lt;p&gt;Below is another &lt;strong&gt;fun&lt;/strong&gt; way to transform text into an &lt;code&gt;org-mode&lt;/code&gt; checklist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use Org-mode Code Blocks to Convert Text into List of Checkboxes&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note: To generate the results use &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt; while the cursor is within a code block.&lt;br&gt;&#xA;  Then answer &lt;code&gt;yes&lt;/code&gt; when prompted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Wrap your list inside a named dynamic block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: my-list-block  &#xA;#+BEGIN:  &#xA;Lec 1 |         1:20:36'  &#xA;Lec 2 |         1:10:32  &#xA;Lec 3 |         1:08:33  &#xA;Lec 4 |         1:20:33  &#xA;     ... More ...  &#xA;Lec 24 |        1:24:47  &#xA;Lec 25 |        1:25:21  &#xA;#+END:  &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Write an &lt;code&gt;org-mode&lt;/code&gt; code block in your favorite programming language.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 1&lt;/strong&gt; - Using an &lt;code&gt;elisp&lt;/code&gt; Code Block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: list-into-checklist-elisp&#xA;#+header: :results list raw replace output &#xA;#+header: :var data=my-list-block()&#xA;#+begin_src elisp&#xA;  (dolist (x (split-string data &quot;\n&quot;))&#xA;        (princ (format &quot;[ ] %s\n&quot; x)))&#xA;#+end_src&#xA;&#xA;#+RESULTS: list-into-checklist-elisp&#xA;- [ ] Lec 1 |         1:20:36&#xA;- [ ] Lec 2 |         1:10:32&#xA;- [ ] Lec 3 |         1:08:33&#xA;- [ ] Lec 4 |         1:20:33&#xA;- [ ]       ... More ...&#xA;- [ ] Lec 24 |        1:24:47&#xA;- [ ] Lec 25 |        1:25:21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 2&lt;/strong&gt; - Using a &lt;code&gt;perl&lt;/code&gt; Code Block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: list-into-checklist-perl&#xA;#+header: :results list raw replace output&#xA;#+header: :var data=my-list-block()&#xA;#+begin_src perl&#xA;  map { printf qq([ ] %s\n), $_ } split(/\n/, $data); &#xA;#+end_src&#xA;&#xA;#+RESULTS: list-into-checklist-perl&#xA;- [ ] Lec 1 |         1:20:36&#xA;- [ ] Lec 2 |         1:10:32&#xA;- [ ] Lec 3 |         1:08:33&#xA;- [ ] Lec 4 |         1:20:33&#xA;- [ ]       ... More ...&#xA;- [ ] Lec 24 |        1:24:47&#xA;- [ ] Lec 25 |        1:25:21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 3&lt;/strong&gt; - Using a &lt;code&gt;bash&lt;/code&gt; Code Block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: list-into-checklist-bash&#xA;#+header: :results list raw replace output&#xA;#+header: :shebang #!/usr/bin/env bash&#xA;#+header: :var data=my-list-block()&#xA;#+begin_src sh&#xA;  while IFS=&quot;\n&quot; read -ra ADDR; do&#xA;        for i in &quot;${ADDR[@]}&quot;; do&#xA;            echo &quot;[X] $i&quot;&#xA;        done&#xA;   done &amp;lt;&amp;lt;&amp;lt; &quot;$data&quot;&#xA;#+end_src&#xA;&#xA;#+RESULTS: list-into-checklist-bash&#xA;- [X] Lec 1 |         1:20:36&#xA;- [X] Lec 2 |         1:10:32&#xA;- [X] Lec 3 |         1:08:33&#xA;- [X] Lec 4 |         1:20:33&#xA;- [X]       ... More ...&#xA;- [X] Lec 24 |        1:24:47&#xA;- [X] Lec 25 |        1:25:21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 4&lt;/strong&gt; - Using a &lt;code&gt;python&lt;/code&gt; Code Block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: list-into-checklist-python&#xA;#+header: :results list raw replace output&#xA;#+header: :var data=my-list-block()&#xA;#+Begin_src python&#xA;  l = [&quot;[ ] {x}&quot;.format(x=row) for row in data.splitlines()]&#xA;  for i in l: print i&#xA;#+end_src &#xA;&#xA;#+RESULTS: list-into-checklist-python&#xA;- [ ] Lec 1 |         1:20:36&#xA;- [ ] Lec 2 |         1:10:32&#xA;- [ ] Lec 3 |         1:08:33&#xA;- [ ] Lec 4 |         1:20:33&#xA;- [ ]       ... More ...&#xA;- [ ] Lec 24 |        1:24:47&#xA;- [ ] Lec 25 |        1:25:21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 5&lt;/strong&gt; - Using a &lt;code&gt;ruby&lt;/code&gt; Code Block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: list-into-checklist-ruby&#xA;#+header: :results list raw replace output&#xA;#+header: :var data=my-list-block()&#xA;#+Begin_src ruby&#xA;  for l in  data.split(&quot;\n&quot;)&#xA;    puts &quot;[ ] #{l}&quot;&#xA;  end&#xA;#+end_src &#xA;&#xA;#+RESULTS: list-into-checklist-ruby&#xA;- [ ] Lec 1 |         1:20:36&#xA;- [ ] Lec 2 |         1:10:32&#xA;- [ ] Lec 3 |         1:08:33&#xA;- [ ] Lec 4 |         1:20:33&#xA;- [ ]       ... More ...&#xA;- [ ] Lec 24 |        1:24:47&#xA;- [ ] Lec 25 |        1:25:21&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks for asking your question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This code was tested using the following versions of emacs and org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&#xA;Org-mode version 8.2.10 (8.2.10-29-g89a0ac-elpa)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2015-01-11T05:36:42.300" LastActivityDate="2015-01-11T05:36:42.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7261" PostTypeId="2" ParentId="7244" CreationDate="2015-01-11T03:12:52.140" Score="10" Body="&lt;p&gt;Here is a solution:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mouse-start-rectangle (start-event)&#xA;  (interactive &quot;e&quot;)&#xA;  (deactivate-mark)&#xA;  (mouse-set-point start-event)&#xA;  (rectangle-mark-mode +1)&#xA;  (let ((drag-event))&#xA;    (track-mouse&#xA;      (while (progn&#xA;               (setq drag-event (read-event))&#xA;               (mouse-movement-p drag-event))&#xA;        (mouse-set-point drag-event)))))&#xA;&#xA;(global-set-key (kbd &quot;S-&amp;lt;down-mouse-1&amp;gt;&quot;) #'mouse-start-rectangle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works in Emacs 24.4 and later, when &lt;code&gt;rectangle-mark-mode&lt;/code&gt; was introduced.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2018-09-12T15:35:52.270" LastActivityDate="2018-09-12T15:35:52.270" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="7262" PostTypeId="2" ParentId="7249" CreationDate="2015-01-11T05:52:16.230" Score="2" Body="&lt;p&gt;You cannot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Emacs is speaking to a terminal, it only knows which coding system is spoken by the terminal.  If the coding system is a locale-specific one (say, ISO 8859-1 or Shift-JIS), then it is a good bet that the terminal supports most or all of the characters in the coding system.  If the coding system is Unicode-based, then there is no way to know which particular subset of Unicode the terminal is able to display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a Unicode terminal, &lt;code&gt;char-displayable-p&lt;/code&gt; answers &lt;code&gt;unicode&lt;/code&gt; for all Unicode characters.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-01-11T05:52:16.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7263" PostTypeId="2" ParentId="6060" CreationDate="2015-01-11T06:56:37.893" Score="2" Body="&lt;p&gt;The &lt;code&gt;use-package&lt;/code&gt; example you give has a number of issues. First of all, the &lt;code&gt;:init&lt;/code&gt; section is run unconditionally at startup time, so what you're really doing is enabling flyspell mode and disabling allout mode in all buffers always with the code as given (and then assuming your &lt;code&gt;(my-global-allout-mode 1)&lt;/code&gt; comes after that part, then it would be re-enabled and indeed it would seem like it's &quot;not working&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing you need to learn about in order to configure anything on a per-mode basis is called &lt;code&gt;hooks&lt;/code&gt;. A hook is a variable that contains a list of functions to run at a particular time. In particular, &lt;code&gt;markdown-mode-hook&lt;/code&gt; is a hook that will run when entering markdown mode. That is the place that you're going to want to put code that should only run in markdown mode. Here's an example (untested, but it should work):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package markdown-mode&#xA;  :mode (&quot;\\.\\(txt\\|markdown\\|md\\)\\(\\'\\|\\.\\)&quot; . gfm-mode)&#xA;  :config  ; runs after the mode is loaded&#xA;  (progn (add-hook 'markdown-mode-hook 'flyspell-mode)&#xA;         (add-hook 'markdown-mode-hook 'allout-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(this assumes that &lt;code&gt;flyspell-mode&lt;/code&gt; and &lt;code&gt;allout-mode&lt;/code&gt; are both buffer-local toggles, which you should probably confirm for yourself. If they turn out to be global toggles then you'll find this has really strange behavior, like flyspell mode will be disabled for all buffers until you open a markdown file, then it's enabled for all buffers).&lt;/p&gt;&#xA;" OwnerUserId="4065" LastActivityDate="2015-01-11T06:56:37.893" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7264" PostTypeId="2" ParentId="7184" CreationDate="2015-01-11T07:13:39.787" Score="2" Body="&lt;p&gt;I would highly recommend against editing &lt;code&gt;linum.el&lt;/code&gt;. The huge disadvantage of doing that is that your changes will be lost every time the package gets updated. Also, that page you linked said you can achieve the same effect without editing linum.el by doing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq linum-format “%d “)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4065" LastActivityDate="2015-01-11T07:13:39.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7265" PostTypeId="2" ParentId="7195" CreationDate="2015-01-11T08:07:50.207" Score="3" Body="&lt;p&gt;You didn't specify exactly what you want to do.  My understanding is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;search for one of &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;!&lt;/code&gt; or &lt;code&gt;?&lt;/code&gt; that is followed by a space;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if it is followed by at least two spaces, do nothing;&lt;/li&gt;&#xA;&lt;li&gt;if it is preceded with &quot;mrs&quot;, &quot;mr&quot;, etc. or a word of length 1, do nothing;&lt;/li&gt;&#xA;&lt;li&gt;otherwise, add a single space.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following should do what you need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun normalise-sentence-endings ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (while (search-forward-regexp &quot;[.!?] &quot; nil t)&#xA;      (when (not (looking-at &quot; &quot;))&#xA;        (let* ((previous-word-beginning&#xA;                (save-excursion (backward-word) (point)))&#xA;               (previous-word&#xA;                (downcase (buffer-substring&#xA;                           previous-word-beginning&#xA;                           (- (point) 2)))))&#xA;          (unless (or (= (length previous-word) 1)&#xA;                      (member previous-word '(&quot;m&quot; &quot;mr&quot; &quot;mrs&quot; &quot;dr&quot; &quot;etc&quot;)))&#xA;            (insert &quot; &quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-01-11T08:07:50.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7266" PostTypeId="2" ParentId="7195" CreationDate="2015-01-11T09:17:44.283" Score="2" Body="&lt;p&gt;There is a function for repunctuating sentences, and it's called &lt;code&gt;repunctuate-sentences&lt;/code&gt;.  It allows you to step through each occurrence of a punctuation character or to change all at once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't like to use this function for some reason, you could temporarily disable &lt;code&gt;sentence-end-double-space&lt;/code&gt; and then use &lt;code&gt;forward-sentence&lt;/code&gt; to move by sentences and insert a space.  This may be better than relying on your own regular expressions, but it won't help you with common abbreviations or prefixes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the general idea:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/fix-sentence (arg)&#xA;  &quot;Add a space at the end of a sentence.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((sentence-end-double-space nil))&#xA;    (loop for i from 1 to arg do&#xA;          (forward-sentence 1)    &#xA;          ;; TODO: check if this is some special case and not really a&#xA;          ;; true sentence ending.  Otherwise just add a space.        &#xA;          (insert &quot; &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can run this with a prefix argument to repeat this as often as you want.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-01-26T10:42:48.083" LastActivityDate="2015-01-26T10:42:48.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7268" PostTypeId="1" AcceptedAnswerId="7269" CreationDate="2015-01-11T10:01:01.913" Score="5" ViewCount="179" Body="&lt;p&gt;When I run &lt;code&gt;M-x package-install&lt;/code&gt; to install a package, I get asked whether I want to save files, that have been modified since the last save (&lt;code&gt;Save file /a/b/c.txt? (y, n, !, ., q, C-r, d or C-h)&lt;/code&gt; in the minibuffer). I get this prompt for each modified file, and, if installing multiple packages from the &lt;code&gt;*Packages*&lt;/code&gt; buffer, I get asked multiple times! This is incredibly frustrating, especially as the files that I am asked about have nothing to do with compilation, and could, in fact, be any files at all, including ordinary text files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a bit of sleuthing, and found that, at the end of the day, package.el runs &lt;code&gt;package-unpack&lt;/code&gt; to install a package, which runs &lt;code&gt;package--compile&lt;/code&gt;, which runs &lt;code&gt;byte-recompile-directory&lt;/code&gt;. I have therefore set the following in my init.el (even though I don't think I should have to do that(!)):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq compilation-ask-about-save nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No improvement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frankly, I thought this must be a side-effect of some customization of mine, since in no way would I consider this to be desirable behavior...until I ran &lt;code&gt;emacs -Q&lt;/code&gt; to reproduce this without my config, and, to my surprise, ran into the very same thing. While this seems baffling, it also offers me some hope that perhaps someone has figured out a way to disable this super-annoying prompt?&lt;/p&gt;&#xA;" OwnerUserId="5167" LastEditorUserId="5167" LastEditDate="2015-01-11T10:14:35.397" LastActivityDate="2021-08-27T16:56:55.533" Title="package.el asks whether I want to save modified files before package installation. How to disable this?" Tags="|package|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7269" PostTypeId="2" ParentId="7268" CreationDate="2015-01-11T10:14:49.350" Score="3" Body="&lt;p&gt;As the help text tells you when you type &lt;kbd&gt;C-h&lt;/kbd&gt; (as prompted by &lt;code&gt;save-some-buffers&lt;/code&gt;, which is the function responsible for the query), you can skip all remaining queries with a simple &lt;kbd&gt;RET&lt;/kbd&gt; or &lt;kbd&gt;q&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I certainly don't find myself in this situation so frequently that doing that is an onerous task, so this might be sufficient for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. &lt;code&gt;compilation-ask-about-save&lt;/code&gt; is related to running external compiler processes, and not to elisp byte-compilation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One option would be binding &lt;code&gt;noninteractive&lt;/code&gt; (&quot;Non-nil means Emacs is running without interactive terminal.&quot;) around &lt;code&gt;package--compile&lt;/code&gt; with advice, as &lt;code&gt;byte-recompile-directory&lt;/code&gt; won't trigger &lt;code&gt;save-some-buffers&lt;/code&gt; in that case; but I think that's going to have some undesirable consequences further down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Redefining &lt;code&gt;save-some-buffers&lt;/code&gt; for the duration seems like a safer option:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice package--compile (around no-byte-recompile-saves)&#xA;  &quot;Inhibit `save-some-buffers' when byte-compiling packages.&quot;&#xA;  (require 'cl-lib)&#xA;  (cl-letf (((symbol-function 'save-some-buffers) 'ignore))&#xA;    ad-do-it))&#xA;(ad-activate 'package--compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-01-12T20:45:14.330" LastActivityDate="2015-01-12T20:45:14.330" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7270" PostTypeId="1" AcceptedAnswerId="7277" CreationDate="2015-01-11T10:39:53.827" Score="2" ViewCount="95" Body="&lt;p&gt;As an example, let's say I want to search for the word &lt;code&gt;test&lt;/code&gt;.&#xA;When I type &lt;code&gt;M-x occur RET test RET&lt;/code&gt;, the current frame is split into two windows, with the current buffer on top and the &lt;code&gt;*Occur*&lt;/code&gt; buffer on bottom. If I click a line in the &lt;code&gt;*Occur*&lt;/code&gt; buffer point is moved to the matching line in the top buffer. All this is fine..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I want to return to the original position in the top buffer, it is more difficult. First, there is no shortcut in the &lt;code&gt;*Occur*&lt;/code&gt; buffer to return to that original position in the searched buffer. I could of course as a workaround type &lt;kbd&gt;C-x r b&lt;/kbd&gt; before I clicked the line in the &lt;code&gt;*Occur*&lt;/code&gt; buffer such that I got a bookmark. But I think this is not an ideal solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is: Is it possible to add the original buffer position in the searched buffer as a single line in the &lt;code&gt;*Occur*&lt;/code&gt; buffer (for example, the topmost line) such that I can easily return to my starting point after visiting (that is: moving to) some matches from the &lt;code&gt;*Occur*&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="105" LastEditDate="2015-01-11T18:05:51.270" LastActivityDate="2015-01-12T12:54:59.960" Title="Include original position from searched buffer in occur buffer" Tags="|occur|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7271" PostTypeId="2" ParentId="7227" CreationDate="2015-01-11T11:44:46.390" Score="2" Body="&lt;p&gt;You can find out the command that is executed by &lt;code&gt;M-i&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h k M-i&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bind it to &lt;code&gt;TAB&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;TAB&quot;) #'tab-to-tab-stop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this will set the global binding, while you are most likely concerned with the binding of one or more global modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook c-mode-common-hook #'(lambda () (local-set-key (kbd &quot;TAB&quot; #'tab-to-tab-stop))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But perhaps it would be better if you could describe what are your issues with Emacs' indentation (in a different question), so we can help you solve that.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-01-11T11:44:46.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7272" PostTypeId="1" CreationDate="2015-01-11T12:43:00.967" Score="7" ViewCount="1155" Body="&lt;p&gt;In my &lt;code&gt;.vimrc&lt;/code&gt; I have &lt;code&gt;set virtualedit=all&lt;/code&gt; and &lt;code&gt;set nostartofline&lt;/code&gt;. I'd like to have these features in Emacs. Can it be done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;virtualedit&lt;/code&gt; allows the cursor to be positioned where there are no characters, not even whitespace. It allows you to scroll horizontally beyond any text. If you scroll vertically one row at a time then the cursor always goes up one row and does not change the column it is in, regardless of the contents of the row. If the cursor is beyond the characters in a row and you insert a character, spaces are filled in to the left of the inserted character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;nostartofline&lt;/code&gt; also set, the cursor does not go to the start of the line if I use movements that jump by multiple rows, for example, jumping to the start or end of a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With both options set, I can place the cursor, possibly beyond any text in the file, and jump vertically without the column of the cursor changing. A command to move the cursor to the &quot;end of the line&quot; will jump to the last character. So if the cursor is way off in the middle of nowhere, &lt;code&gt;$&lt;/code&gt; will actually move the cursor left instead of right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is &lt;a href=&quot;https://emacs.stackexchange.com/questions/3659/how-to-act-on-rectangles-beyond-the-end-of-line&quot;&gt;another question&lt;/a&gt; that mentions Vim's &lt;code&gt;virtualedit&lt;/code&gt; but it is concerned with making rectangular selections. This question is concerned with the movement of the cursor and the behavior of inserting spaces to catch up to inserted characters.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-07-03T22:45:18.883" Title="Simulate Vim's virtualedit and nostartofline" Tags="|vim-emulation|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7273" PostTypeId="1" AcceptedAnswerId="7314" CreationDate="2015-01-11T13:26:33.880" Score="2" ViewCount="95" Body="&lt;p&gt;I can activate the input method &lt;code&gt;french-azerty&lt;/code&gt; by &lt;code&gt;M-x set-input-method RET french-azerty&lt;/code&gt;. Then by a &lt;code&gt;qwerty&lt;/code&gt; keyboard I can type like an &lt;code&gt;azerty&lt;/code&gt; one. Thus typying &lt;code&gt;q&lt;/code&gt; in the buffer gives &lt;code&gt;a&lt;/code&gt;. But when I do &lt;code&gt;M-: (insert &quot;q&quot;)&lt;/code&gt; it gives &lt;code&gt;q&lt;/code&gt; instead of &lt;code&gt;a&lt;/code&gt;. Is there a way that the evaluations takes into account the chosen input-method? i.e. &lt;code&gt;M-: (insert &quot;qwerty&quot;)&lt;/code&gt; gives &lt;code&gt;azerty&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-11T19:03:05.350" LastActivityDate="2015-01-12T20:26:11.857" Title="Input-methods in the insert eval expressions" Tags="|input-method|eval-expression|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7274" PostTypeId="1" AcceptedAnswerId="7280" CreationDate="2015-01-11T14:07:42.260" Score="4" ViewCount="965" Body="&lt;p&gt;Is it possible to change the behavior of &lt;code&gt;backward-kill-word&lt;/code&gt; (bound to &lt;code&gt;M-DEL&lt;/code&gt; by default) to stop at special characters? Quite often it deletes parentheses and line breaks against my will.&lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2015-06-10T23:57:50.547" Title="How can I make backward-kill-word stop at special character such as paratheses and line breaks?" Tags="|text-editing|editing|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7275" PostTypeId="1" AcceptedAnswerId="7287" CreationDate="2015-01-11T14:24:34.720" Score="9" ViewCount="1591" Body="&lt;p&gt;I want to add a front cover for my Org document which will export as a PDF (&lt;code&gt;#+LaTeX_CLASS: article&lt;/code&gt;). I don't want to modify my &lt;code&gt;org-latex-classes&lt;/code&gt; and apply globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to add the following block before first outline of the Org document, but it will insert the cover under the contents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to insert a LaTeX block to generate front cover for an individual Org article?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LaTeX latex&#xA;\newcommand*{\titleGP}{\begingroup % Create the command for including the title page in the document&#xA;\centering % Center all text&#xA;\vspace*{\baselineskip} % White space at the top of the page&#xA;&#xA;\rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt} % Thick horizontal line&#xA;\rule{\textwidth}{0.4pt}\\[\baselineskip] % Thin horizontal line&#xA;&#xA;{\LARGE THE BIG BOOK\\ OF \\[0.3\baselineskip] \LaTeX ~TEMPLATES}\\[0.2\baselineskip] % Title&#xA;&#xA;\rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt} % Thin horizontal line&#xA;\rule{\textwidth}{1.6pt}\\[\baselineskip] % Thick horizontal line&#xA;&#xA;\scshape % Small caps&#xA;A number of fascinating and life-changing templates \\ % Tagline(s) or further description&#xA;presented  in a clear and useable way \\[\baselineskip] % Tagline(s) or further description&#xA;New Zealand,  2011--2012\par % Location and year&#xA;&#xA;\vspace*{2\baselineskip} % Whitespace between location/year and editors&#xA;&#xA;Edited by \\[\baselineskip]&#xA;{\Large JOHN SMITH \\ JANE SMITH \\ JAMES SMITH\par} % Editor list&#xA;{\itshape The University of California \\ Berkeley\par} % Editor affiliation&#xA;&#xA;\vfill % Whitespace between editor names and publisher logo&#xA;&#xA;{\scshape 2012} \\[0.3\baselineskip] % Year published&#xA;{\large THE PUBLISHER}\par % Publisher&#xA;&#xA;\endgroup}&#xA;\titleGP % This command includes the title page&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="515" LastActivityDate="2023-02-25T11:47:38.730" Title="Org: Add front cover for LaTeX/PDF export?" Tags="|latex|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7276" PostTypeId="2" ParentId="7191" CreationDate="2015-01-11T14:39:15.003" Score="4" Body="&lt;p&gt;You need to customize the &lt;code&gt;.tmux.conf&lt;/code&gt; too in addition to the below customization in emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the below setup here are few scenarios of how copy-pasting can work between emacs and tmux:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Copy/cut from emacs and paste in shell command line in tmux: Do &lt;code&gt;M-w&lt;/code&gt; or &lt;code&gt;C-w&lt;/code&gt; in emacs and &lt;code&gt;TMUX_PREFIX C-y&lt;/code&gt; in tmux.&lt;/li&gt;&#xA;&lt;li&gt;Copy from tmux and paste in emacs: Do &lt;code&gt;TMUX_PREFIX C-w&lt;/code&gt; in tmux and &lt;code&gt;C-y&lt;/code&gt; in emacs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;emacs setup&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(setq x-select-enable-clipboard t &#xA;      x-select-enable-primary t)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;tmux setup&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# COPY &amp;amp; PASTE&#xA;&#xA;# Copy tmux buffer to X clipboard&#xA;# run -b runs a shell command in background&#xA;# bind C-w run -b &quot;tmux show-buffer | xclip -selection clipboard -i&quot;&#xA;bind C-w run -b &quot;tmux show-buffer | xclip -i&quot;&#xA;&#xA;# Paste from X clipboard into tmux; also replace newline characters with&#xA;# space characters when pasting&#xA;bind C-y run -b &quot;exec &amp;lt;/dev/null; xclip -o | awk 1 ORS=' ' | tmux load-buffer - ; tmux paste-buffer&quot;&#xA;# Same as `C-y' binding except that the newline chars are not replaced with space&#xA;bind Y run -b &quot;exec &amp;lt;/dev/null; xclip -o | tmux load-buffer - ; tmux paste-buffer&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-11T14:39:15.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7277" PostTypeId="2" ParentId="7270" CreationDate="2015-01-11T18:02:14.300" Score="1" Body="&lt;p&gt;This code advises the occur function to prefix the result buffer&#xA;with a link to the place of the point before running occur.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'button)&#xA;&#xA;(defun my-goto-start-marker (b)&#xA;  &quot;Get the marker from the button B and go to it.&quot;&#xA;  (let ((marker (button-get b 'my-start-marker)))&#xA;    (pop-to-buffer (marker-buffer marker))&#xA;    (goto-char (marker-position marker))))&#xA;&#xA;&#xA;(defun my-occur-advice (orig &amp;amp;rest args)&#xA;  ;; keep starting pos&#xA;  (let ((start-marker (point-marker)))&#xA;    ;; call old regular `occur'&#xA;    (apply orig args)&#xA;&#xA;    ;; prefix the occur buffer with a button/link if its not already there&#xA;    (with-current-buffer (get-buffer &quot;*Occur*&quot;)&#xA;      (when (save-excursion&#xA;              (goto-char (point-min))&#xA;              (looking-at (rx bol (+ digit) &quot; match&quot;)))&#xA;&#xA;        (let ((buffer-read-only nil))&#xA;          (save-excursion&#xA;            (goto-char (point-min))&#xA;            (insert-button &quot;&amp;gt;START POS&amp;lt;&quot;&#xA;                           'action 'my-goto-start-marker ;; function to call on click/RET&#xA;                           'my-start-marker start-marker ;; store the marker as text property of the button&#xA;                           'face '(:underline t)&#xA;                           'follow-link t)&#xA;            (insert &quot;\n&quot;)))))))&#xA;&#xA;(advice-add 'occur :around 'my-occur-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="158" LastEditorUserId="158" LastEditDate="2015-01-12T12:54:59.960" LastActivityDate="2015-01-12T12:54:59.960" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7278" PostTypeId="1" AcceptedAnswerId="7279" CreationDate="2015-01-11T20:04:40.173" Score="4" ViewCount="1938" Body="&lt;p&gt;One of the keys Emacs refers to is the key &lt;code&gt;LFD&lt;/code&gt;. For example, calc binds that key to &lt;code&gt;calc-over&lt;/code&gt;. What key is this?&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="5170" LastEditDate="2015-01-12T01:20:16.867" LastActivityDate="2015-01-12T01:20:16.867" Title="What is the key LFD?" Tags="|keystrokes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7279" PostTypeId="2" ParentId="7278" CreationDate="2015-01-11T20:04:40.173" Score="6" Body="&lt;p&gt;&lt;code&gt;LFD&lt;/code&gt; refers to &quot;linefeed&quot;. This key is similar to return -- in ways not worth discussing here -- but can be input with &lt;code&gt;C-j&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-01-11T20:04:40.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7280" PostTypeId="2" ParentId="7274" CreationDate="2015-01-11T20:18:10.637" Score="1" Body="&lt;p&gt;That command uses forward/backward word internally, i.e. it finds the next word in buffer if not within - and deletes region between. From there it's rather difficult to tweak.Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-backward-kill-word ()&#xA;  (interactive &quot;*&quot;)&#xA;  (let ((orig (point)))&#xA;    (skip-syntax-backward &quot;\sw&quot;)&#xA;    (delete-region (point) orig)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-01-11T20:18:10.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7281" PostTypeId="1" AcceptedAnswerId="7283" CreationDate="2015-01-11T20:41:12.213" Score="9" ViewCount="3778" Body="&lt;p&gt;I work with a lot of tabular data files and use &lt;a href=&quot;https://github.com/sabof/stripe-buffer&quot; rel=&quot;noreferrer&quot;&gt;stripe-buffer.el&lt;/a&gt; make them easier to read. But I also work with more than one, so I'd like to make it easier to distinguish among them as well and want to change the stripe colors per buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can change the face globally using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-face 'stripe-highlight &quot;black&quot; &quot;#cce7ff&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this locally to a single buffer?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2018-05-31T02:28:32.730" Title="How to modify-face for a specific buffer?" Tags="|buffers|faces|buffer-local|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7282" PostTypeId="2" ParentId="7281" CreationDate="2015-01-11T20:50:47.807" Score="1" Body="&lt;p&gt;(&lt;strong&gt;edit: lawlist has a much better answer, but I'll leave this answer in case the information is useful to anyone.&lt;/strong&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Face specs are properties in the face symbol's plist -- e.g. &lt;code&gt;(get 'stripe-highlight 'face-defface-spec)&lt;/code&gt; -- and I don't believe the notion of buffer-local symbol properties exists. That's a special feature of the value slot (i.e. values of variables).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What some libraries do is assign their faces to variables, and then use the variable everywhere that the face is needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then create buffer-local values for those variables, which has the same effect that you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This requires the code using the face to have been written that way, however.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-01-11T22:47:27.900" LastActivityDate="2015-01-11T22:47:27.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7283" PostTypeId="2" ParentId="7281" CreationDate="2015-01-11T21:21:39.967" Score="17" Body="&lt;p&gt;As noted by @phils in the comment below, the Emacs manual suggests not modifying the &lt;code&gt;face-remapping-alist&lt;/code&gt; directly due to possible unintended side effects: &lt;em&gt;. . .to avoid trampling on remappings applied elsewhere.&lt;/em&gt;  Thus, &lt;code&gt;(setq-local face-remapping-alist '((stripe-highlight (:background &quot;white&quot; :foreground &quot;black&quot;))))&lt;/code&gt; is not considered to be the preferred method.  Instead, the Emacs manual suggests using a function such as &lt;code&gt;face-remap-add-relative&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(face-remap-add-relative 'stripe-highlight '(:foreground &quot;black&quot; :background &quot;yellow&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a link to additional Emacs documentation on this issue:  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2018-05-31T02:28:32.730" LastActivityDate="2018-05-31T02:28:32.730" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="7284" PostTypeId="1" AcceptedAnswerId="7589" CreationDate="2015-01-11T21:36:22.180" Score="7" ViewCount="1485" Body="&lt;p&gt;When I'm writing a new package, it's great that I can test its&#xA;installation by just issuing &lt;code&gt;M-x package-install-from-buffer&lt;/code&gt;. This&#xA;will install the package with &lt;code&gt;package.el&lt;/code&gt;, so that it goes under&#xA;&lt;code&gt;&quot;~/.emacs.d/elpa&quot;&lt;/code&gt;. However, this doesn't work on multifile packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is the procedure for installing all &lt;code&gt;.el&lt;/code&gt; files in the current&#xA;  directory as a single multifile package?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2017-08-15T19:18:24.407" Title="Manually installing a multifile package to “elpa/”" Tags="|package|package-development|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7285" PostTypeId="2" ParentId="7284" CreationDate="2015-01-11T23:14:08.933" Score="1" Body="&lt;p&gt;&lt;code&gt;package-install-from-buffer&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The current buffer is assumed to be a single .el &lt;strong&gt;or .tar file&lt;/strong&gt; that follows the packaging guidelines&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So one presumes you can archive the directory (assuming it meets the criteria), load the tar file into Emacs, and use &lt;code&gt;package-install-from-buffer&lt;/code&gt; as before?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Or, as lunaryorn points out, &lt;em&gt;don't&lt;/em&gt; visit the archive in Emacs, and use &lt;code&gt;package-install-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-01-12T11:29:14.190" LastActivityDate="2015-01-12T11:29:14.190" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7286" PostTypeId="1" AcceptedAnswerId="7288" CreationDate="2015-01-11T23:14:39.830" Score="6" ViewCount="2576" Body="&lt;p&gt;I get the following message when starting Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (emacs): Unable to activate package `elpy'.&#xA;Required package `highlight-indentation-0.5.0' is unavailable&#xA;Warning (emacs): Unable to activate package `elpy'.&#xA;Required package `highlight-indentation-0.5.0' is unavailable&#xA;Warning (emacs): Unable to activate package `elpy'.&#xA;Required package `highlight-indentation-0.5.0' is unavailable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then found this Q&amp;amp;A: &#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/5302/find-elisp-origin-of-warning&quot;&gt;Find elisp origin of warning&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I followed the accepted answer and added the following to the top of my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq debug-on-message &quot;Unable to activate package `elpy'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then restarted Emacs, but nothing happened. Was I supposed to fall into the debugger? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find what specific line in my &lt;code&gt;.emacs&lt;/code&gt; file trigger the warning?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-05-20T17:54:09.030" Title="&quot;Unable to activate package&quot; when starting Emacs" Tags="|package|start-up|warning|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7287" PostTypeId="2" ParentId="7275" CreationDate="2015-01-12T02:02:52.463" Score="8" Body="&lt;p&gt;As @ramus suggested, you can set &lt;code&gt;org-latex-title-command&lt;/code&gt; to a custom macro and have it used in place of &lt;code&gt;\maketitle&lt;/code&gt;.  If you set &lt;code&gt;org-export-allow-bind-keywords&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; you can do this per file using &lt;code&gt;#+BIND org-latex-title-command &quot;\\titleGP&quot;&lt;/code&gt;, but Emacs will start bugging you about&quot; unsafe variables&quot;. This will insert &lt;code&gt;\titleGP&lt;/code&gt; immediately after &lt;code&gt;\begin{document}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you just have to make sure the &lt;code&gt;\titleGP&lt;/code&gt; macro is defined in the preamble, which we do with &lt;code&gt;#+LATEX_HEADER&lt;/code&gt;.  A complete example is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BIND: org-latex-title-command &quot;\\titleGP&quot;&#xA;&#xA;#+LATEX_HEADER: \newcommand*{\titleGP}{\begingroup % Create the command for including the title page in the document&#xA;#+LATEX_HEADER: \centering % Center all text&#xA;#+LATEX_HEADER: \vspace*{\baselineskip} % White space at the top of the page&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: \rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt} % Thick horizontal line&#xA;#+LATEX_HEADER: \rule{\textwidth}{0.4pt}\\[\baselineskip] % Thin horizontal line&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: {\LARGE THE BIG BOOK\\ OF \\[0.3\baselineskip] \LaTeX ~TEMPLATES}\\[0.2\baselineskip] % Title&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: \rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt} % Thin horizontal line&#xA;#+LATEX_HEADER: \rule{\textwidth}{1.6pt}\\[\baselineskip] % Thick horizontal line&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: \scshape % Small caps&#xA;#+LATEX_HEADER: A number of fascinating and life-changing templates \\ % Tagline(s) or further description&#xA;#+LATEX_HEADER: presented  in a clear and useable way \\[\baselineskip] % Tagline(s) or further description&#xA;#+LATEX_HEADER: New Zealand,  2011--2012\par % Location and year&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: \vspace*{2\baselineskip} % Whitespace between location/year and editors&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: Edited by \\[\baselineskip]&#xA;#+LATEX_HEADER: {\Large JOHN SMITH \\ JANE SMITH \\ JAMES SMITH\par} % Editor list&#xA;#+LATEX_HEADER: {\itshape The University of California \\ Berkeley\par} % Editor affiliation&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: \vfill % Whitespace between editor names and publisher logo&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: {\scshape 2012} \\[0.3\baselineskip] % Year published&#xA;#+LATEX_HEADER: {\large THE PUBLISHER}\par % Publisher&#xA;#+LATEX_HEADER:  &#xA;#+LATEX_HEADER: \endgroup}&#xA;&#xA;* first section&#xA;some content&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want to mess with setting &lt;code&gt;org-export-allow-bind-keywords&lt;/code&gt; you could always just call your macro &lt;code&gt;\maketitle&lt;/code&gt; instead of &lt;code&gt;\titleGP&lt;/code&gt;, clobbering the old definition.  You'll need to use &lt;code&gt;\renewcommand&lt;/code&gt; instead of &lt;code&gt;\newcommand&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-01-12T02:21:05.567" LastActivityDate="2015-01-12T02:21:05.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7288" PostTypeId="2" ParentId="7286" CreationDate="2015-01-12T02:53:04.417" Score="4" Body="&lt;p&gt;This is happening during package activation, so it's not your init file's fault. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What's happening&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The warning is telling you everything you need to know. &lt;code&gt;elpy&lt;/code&gt; needs to load &lt;code&gt;highlight-indentation&lt;/code&gt;, but the package's not installed. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What to do&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Either &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;install the missing package&lt;/li&gt;&#xA;&lt;li&gt;or delete &lt;code&gt;elpy&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-12T02:53:04.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7289" PostTypeId="2" ParentId="5811" CreationDate="2015-01-12T03:43:10.470" Score="6" Body="&lt;p&gt;Edit: In the past few months I've started using the &lt;a href=&quot;https://github.com/felixfbecker/php-language-server&quot; rel=&quot;nofollow noreferrer&quot;&gt;php-language-server&lt;/a&gt; with &lt;a href=&quot;https://github.com/emacs-lsp/lsp-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;lsp-mode&lt;/a&gt; (which are both components built on Microsoft's &lt;a href=&quot;https://langserver.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Language Server Protocol&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not a perfect answer yet, but I have jump-to-definition that's working pretty solidly in a large, old PHP codebase, and that alone is worth quite a bit. Other components like docstring/function signature display and &lt;code&gt;completion-at-point&lt;/code&gt; work too (though neither of those are perfect yet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This direction looks more promising to me than any of the options in my original answer, because when an LSP backend improves, all editors benefit from it, so the core backend intelligence should get gains from a wider community. Similarly, improvements and extensions to lsp-mode should benefit integration with other language backends, not just the one it was originally built for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: I have contributed some to this solution. I &lt;a href=&quot;https://github.com/emacs-lsp/lsp-mode/pull/127&quot; rel=&quot;nofollow noreferrer&quot;&gt;submitted a PR&lt;/a&gt; to make emacs-lsp compatible with php-language-server and hacked up &lt;a href=&quot;https://github.com/NateEag/.emacs.d/commit/2cf716fa62e8476b600686b5f3989bced4522eb1#diff-1986f225edad98d16065f5aa9d64011a&quot; rel=&quot;nofollow noreferrer&quot;&gt;my own simple PHP backend&lt;/a&gt;, which I replaced with the &lt;a href=&quot;https://melpa.org/#/lsp-php&quot; rel=&quot;nofollow noreferrer&quot;&gt;lsp-php package&lt;/a&gt; when it popped up one day in my list-packages buffer.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Original answer below&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I have yet to find a fully satisfactory solution for PHP intelligence in Emacs, but here's what I have found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow noreferrer&quot;&gt;auto-complete&lt;/a&gt; is similar to &lt;code&gt;company-mode&lt;/code&gt; in that it provides a UI for autocompletion. I prefer its UI to &lt;code&gt;company-mode&lt;/code&gt;'s - try both and see what you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/ejmr/php-auto-yasnippets&quot; rel=&quot;nofollow noreferrer&quot;&gt;php-auto-yasnippets&lt;/a&gt; is useful for auto-completion of built-in PHP functions, complete with argument order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/facebook/pfff&quot; rel=&quot;nofollow noreferrer&quot;&gt;pfff&lt;/a&gt; is a static analysis tool with good PHP support. Its stags command will generate Emacs tags files, which can then be used for jumping to definitions. You should be able to use this to get some sort of auto-completion too, but I don't know how useful it would really be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, &lt;a href=&quot;https://github.com/senny/emacs-eclim&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-eclim&lt;/a&gt; uses Eclipse as a code-intelligence daemon. It works very well for Java, and in principle it's possible to install Eclipse's &lt;a href=&quot;https://eclipse.org/pdt/&quot; rel=&quot;nofollow noreferrer&quot;&gt;PDT&lt;/a&gt; plugin and use eclim for PHP completion and jump-to-definition. The last time I tried it, the PHP support in the Emacs plugin was pretty limited. Some elisp hacking would probably get you there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were going back to this personally, I'd probably work on emacs-eclim PHP support. I think it's the solution that's most likely to work well, and PDT seems to make steady progress forward.&lt;/p&gt;&#xA;" OwnerUserId="351" LastEditorUserId="351" LastEditDate="2018-02-06T17:16:40.880" LastActivityDate="2018-02-06T17:16:40.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7291" PostTypeId="1" AcceptedAnswerId="7317" CreationDate="2015-01-12T09:10:55.773" Score="4" ViewCount="1153" Body="&lt;p&gt;When I execute a code block in org mode, the output will be tabularized. I want to use this functionality to build a set of commands which I can then execute in a new code block, so I have to remove all pipe characters first. Is there a way to avoid this?&lt;/p&gt;&#xA;" OwnerUserId="2725" LastActivityDate="2015-01-12T22:44:52.003" Title="disable tabular output for code block in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7292" PostTypeId="2" ParentId="3465" CreationDate="2015-01-12T09:24:25.090" Score="3" Body="&lt;p&gt;Got the same problem. For me it was the reftex that I added as a hook to my org-mode, and the error appeared as soon as I upgraded one of the repositories. You need to use the option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (setq TeX-master t).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't know where to put it, have a look at the next link. &lt;a href=&quot;http://draketo.de/english/emacs/writing-papers-in-org-mode-acpd#sec-2-1&quot; rel=&quot;nofollow&quot;&gt;http://draketo.de/english/emacs/writing-papers-in-org-mode-acpd#sec-2-1&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5171" LastActivityDate="2015-01-12T09:24:25.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7293" PostTypeId="1" AcceptedAnswerId="7297" CreationDate="2015-01-12T09:57:03.303" Score="6" ViewCount="1380" Body="&lt;p&gt;when I view &lt;code&gt;png&lt;/code&gt; images in Dired-mode there is no problem but when I try to view the thumbnail of it (&lt;code&gt;C-t d&lt;/code&gt;), it fails and throws this error: &lt;code&gt;could not create thumb of &amp;lt;filename&amp;gt;&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-:&lt;/code&gt; of &lt;code&gt;dynamic-library-alist&lt;/code&gt; returns these lists:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((xpm &quot;libxpm.dll&quot; &quot;xpm4.dll&quot; &quot;libXpm-nox4.dll&quot;) (png &quot;libpng16.dll&quot; &quot;libpng16-16.dll&quot;) (tiff &quot;libtiff-5.dll&quot; &quot;libtiff3.dll&quot; &quot;libtiff.dll&quot;) (jpeg &quot;libjpeg-9.dll&quot;) (gif &quot;libgif-7.dll&quot;) (svg &quot;librsvg-2-2.dll&quot;) (gdk-pixbuf &quot;libgdk_pixbuf-2.0-0.dll&quot;) (glib &quot;libglib-2.0-0.dll&quot;) (gobject &quot;libgobject-2.0-0.dll&quot;) (gnutls &quot;libgnutls-28.dll&quot; &quot;libgnutls-26.dll&quot;) (libxml2 &quot;libxml2-2.dll&quot; &quot;libxml2.dll&quot;) (zlib &quot;zlib1.dll&quot; &quot;libz-1.dll&quot;))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What fundamental point am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Windows 7 32 bit&lt;/li&gt;&#xA;&lt;li&gt;Emacs 24.4&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-01-12T11:09:01.603" LastActivityDate="2015-01-12T11:09:01.603" Title="Why cannot thumbnails be created by image-dired?" Tags="|dired|microsoft-windows|images|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7294" PostTypeId="2" ParentId="7254" CreationDate="2015-01-12T10:11:43.360" Score="7" Body="&lt;p&gt;There's no need to define a command to bind a unicode char:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key 'iso-transl-ctl-x-8-map &quot;a&quot; [?α])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;binds α to &lt;kbd&gt;C-x 8 a&lt;/kbd&gt;. While&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key 'iso-transl-ctl-x-8-map (kbd &quot;M-s&quot;) [?ς])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;binds ς to &lt;kbd&gt;C-x 8 M-s&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-01-12T10:11:43.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7295" PostTypeId="1" AcceptedAnswerId="7345" CreationDate="2015-01-12T10:15:33.770" Score="1" ViewCount="315" Body="&lt;p&gt;I just installed Emacs 24.4 from source (on Ubuntu 14.04). I now get the following error when running Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  string-match(&quot;/[._]emacs\\.d/?\\'&quot; nil nil)&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For debugging, I reduced my &lt;code&gt;~/.emacs&lt;/code&gt; init file to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq debug-on-error t)&#xA;(add-to-list 'load-path nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the error occurs only when starting Emacs with two arguments, where the first argument is an option, for example &lt;code&gt;--no-splash&lt;/code&gt;, and the second argument is a file name with a suffix, for example &lt;code&gt;a.txt&lt;/code&gt;. Some other observations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If I remove the option (&lt;code&gt;--no-splash&lt;/code&gt;) it works fine,&lt;/li&gt;&#xA;&lt;li&gt;if I remove the line &lt;code&gt;(add-to-list 'load-path nil)&lt;/code&gt; it works fine,&lt;/li&gt;&#xA;&lt;li&gt;if I run with Emacs v. 24.3 it works fine,&lt;/li&gt;&#xA;&lt;li&gt;if I change &lt;code&gt;nil&lt;/code&gt; to &lt;code&gt;&quot;.&quot;&lt;/code&gt;, in &lt;code&gt;~/.emacs&lt;/code&gt; it works fine,&lt;/li&gt;&#xA;&lt;li&gt;if I remove the suffix from the file name, that is: changing &lt;code&gt;a.txt&lt;/code&gt; to &lt;code&gt;a&lt;/code&gt;, I get another error: &lt;code&gt;Args out of range: 0&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; After adding &lt;code&gt;nil&lt;/code&gt; to &lt;code&gt;load-path&lt;/code&gt;, the variable looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(nil &quot;/opt/emacs24.4/share/emacs/24.4/site-lisp&quot; &quot;/opt/emacs24.4/share/emacs/site-lisp&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/vc&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/url&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/textmodes&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/progmodes&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/play&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/org&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/nxml&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/net&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/mh-e&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/mail&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/leim&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/language&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/international&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/gnus&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/eshell&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/erc&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/emulation&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/emacs-lisp&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/cedet&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/calendar&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/calc&quot; &quot;/opt/emacs24.4/share/emacs/24.4/lisp/obsolete&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to the Emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variable: &lt;strong&gt;load-path&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The value of this variable is a list of directories to search when&#xA;  loading files with load. Each element is a string (which must be a&#xA;  directory name) or nil (which stands for the current working&#xA;  directory).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="260" LastEditorUserId="10" LastEditDate="2015-01-12T10:55:11.340" LastActivityDate="2015-01-13T19:31:56.353" Title="Problem with nil element in load-path in Emacs 24.4" Tags="|init-file|emacs24.4|load-path|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7297" PostTypeId="2" ParentId="7293" CreationDate="2015-01-12T10:49:34.247" Score="5" Body="&lt;p&gt;While most issues with images in Emacs on Microsoft Windows are caused by missing shared libraries, this one is the fault of missing executables.  &lt;code&gt;image-dired&lt;/code&gt; requires the &lt;a href=&quot;http://imagemagick.org/&quot; rel=&quot;noreferrer&quot;&gt;image-magick&lt;/a&gt; software which provides (among others) the &lt;code&gt;convert&lt;/code&gt; and &lt;code&gt;mogrify&lt;/code&gt; executables.  Installing it and modifying &lt;code&gt;PATH&lt;/code&gt; to allow you to launch these in a terminal should do the trick, any subsequent Emacs session will then be able to display thumbnails in &lt;code&gt;dired&lt;/code&gt; for you.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-12T10:49:34.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7298" PostTypeId="1" AcceptedAnswerId="7300" CreationDate="2015-01-12T11:09:37.300" Score="2" ViewCount="534" Body="&lt;p&gt;I have several agenda files which have the same filename (but are from different directories).  This is because I'm using a uniform template for all my projects, which include, e.g., a &lt;code&gt;$PRJHOME/README.org&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, when I do &lt;code&gt;C-c a a&lt;/code&gt;, this leads to all entries from any of the projects' &lt;code&gt;README.org&lt;/code&gt; files to have the &quot;label&quot; &lt;code&gt;README&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set the individual &lt;code&gt;README.org&lt;/code&gt;'s &quot;label&quot; inside the &lt;code&gt;README.org&lt;/code&gt; file?  There must be some property to do this, but I couldn't find anything ...&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2015-01-12T13:07:59.257" Title="How to set the 'name' of an agenda file" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7299" PostTypeId="1" AcceptedAnswerId="7313" CreationDate="2015-01-12T11:45:10.600" Score="43" ViewCount="22416" Body="&lt;p&gt;Is it possible to merge two or more cells in an org-mode table like when using &lt;code&gt;\multicolumn{}{}{}&lt;/code&gt; or &lt;code&gt;\multirow{}{}{}&lt;/code&gt; in LaTeX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|------------+-----------+----------+----------+-------------|&#xA;|            |             Singular            | Plural      |&#xA;|            +-----------+----------+----------+-------------|&#xA;|            | Masculine | Neuter   | Feminine | All genders |&#xA;|------------+-----------+----------+----------+-------------|&#xA;| Nominative | *der*     | *das*    | *die*    | *die*       |&#xA;| Accusative | *den*     | *das*    | *die*    | *die*       |&#xA;| Dative     | *dem*     | *dem*    | *der*    | *denen*     |&#xA;| Genetive   | *dessen*  | *dessen* | *deren*  | *deren*     |&#xA;|------------+-----------+----------+----------+-------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to construct such a table in org-mode?&lt;/p&gt;&#xA;" OwnerUserId="969" LastEditorUserId="14825" LastEditDate="2022-11-05T01:02:51.297" LastActivityDate="2022-11-05T01:02:51.297" Title="Multicolumn cells in org-mode tables" Tags="|org-mode|org-table|table|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7300" PostTypeId="2" ParentId="7298" CreationDate="2015-01-12T12:40:22.590" Score="3" Body="&lt;p&gt;The &quot;label&quot; that appears in the agenda is actually the &lt;a href=&quot;http://orgmode.org/manual/Categories.html&quot; rel=&quot;nofollow&quot;&gt;category&lt;/a&gt;, which is set by &lt;code&gt;CATEGORY&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/manual/Properties-and-Columns.html&quot; rel=&quot;nofollow&quot;&gt;property&lt;/a&gt;. It defaults to the file name if &lt;code&gt;CATEGORY&lt;/code&gt; isn't set.  You can set this for the entire file by adding a line &lt;code&gt;#+CATEGORY: MyCategory&lt;/code&gt; to the file.  Do &lt;code&gt;C-c C-c&lt;/code&gt; on that line or close/reopen the file to make it take effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This property can also be set on individual entries using &lt;code&gt;org-set-property&lt;/code&gt; (&lt;code&gt;C-c C-x p&lt;/code&gt;).  Unlike most properties, &lt;code&gt;CATEGORY&lt;/code&gt; is inherited so setting on one item will also set the category of all that items children.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-01-12T13:07:59.257" LastActivityDate="2015-01-12T13:07:59.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7301" PostTypeId="1" CreationDate="2015-01-12T16:31:45.047" Score="0" ViewCount="147" Body="&lt;p&gt;Inside of eshell I get the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;LSOpenURLsWithRole() failed with error - 10810 for the file ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if I try to use the &lt;code&gt;open&lt;/code&gt; command on OS X. What's going on here and is there a workaround?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; The error code was 10810 (not 100810). I also get the same error in emacs in &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;term&lt;/code&gt;, and &lt;code&gt;ansi-term&lt;/code&gt;. &lt;code&gt;open&lt;/code&gt; does work for me in iTerm2 and terminal. I've tried this on pdf and png files.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastEditorUserId="2139" LastEditDate="2015-01-12T18:53:34.280" LastActivityDate="2015-06-13T23:02:15.593" Title="Use 'open' command on OS X from eshell" Tags="|eshell|osx|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7302" PostTypeId="2" ParentId="185" CreationDate="2015-01-12T16:38:15.193" Score="3" Body="&lt;p&gt;I met this on the Internet long time ago:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If you're saving an elisp file, likely the .elc is no longer valid:&#xA;(add-hook 'emacs-lisp-mode-hook 'esk-remove-elc-on-save)&#xA;(defun esk-remove-elc-on-save ()&#xA;  &quot;If you're saving an elisp file, likely the .elc is no longer valid.&quot;&#xA;  (make-local-variable 'after-save-hook)&#xA;  (add-hook 'after-save-hook&#xA;            (lambda ()&#xA;              (if (file-exists-p (concat buffer-file-name &quot;c&quot;))&#xA;                  (delete-file (concat buffer-file-name &quot;c&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if you work with &lt;code&gt;FILE&lt;/code&gt; in emacs-lisp-mode and you save it -- the code above removes &lt;code&gt;FILEc&lt;/code&gt; if it exists.&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-01-12T16:38:15.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7303" PostTypeId="2" ParentId="3143" CreationDate="2015-01-12T16:55:35.367" Score="9" Body="&lt;p&gt;One more vote for outline-mode. For example for organaizing &lt;code&gt;.emacs&lt;/code&gt; I use the following syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; HEADING:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the important parts are &lt;code&gt;;;;&lt;/code&gt; and &lt;code&gt;:\n&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook &#xA;          (lambda ()&#xA;            (make-local-variable 'outline-regexp)&#xA;            (setq outline-regexp &quot;^;;; &quot;)&#xA;            (make-local-variable 'outline-heading-end-regexp)&#xA;            (setq outline-heading-end-regexp &quot;:\n&quot;)&#xA;            (outline-minor-mode 1)&#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a sample &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; preliminaries:&#xA;;; load-path:&#xA;;; This little monster adds all non-dot dirs to Your load path recursively&#xA;(let* ((my-lisp-dir &quot;~/.emacs.d/site-lisp/&quot;)&#xA;       (default-directory my-lisp-dir)&#xA;       (orig-load-path load-path))&#xA;  (setq load-path (cons my-lisp-dir nil))&#xA;  (normal-top-level-add-subdirs-to-load-path)&#xA;  (nconc load-path orig-load-path))&#xA;&#xA;;; ...&#xA;&#xA;;;; modes:&#xA;&#xA;;; python-mode:&#xA;(setq py-install-directory &quot;~/.emacs.d/site-lisp/python-mode&quot;)&#xA;(add-to-list 'load-path py-install-directory)&#xA;(require 'python-mode)&#xA;&#xA;;; ...&#xA;&#xA;;;; customizations:&#xA;(custom-set-variables&#xA; '(blink-cursor-mode nil)&#xA;)&#xA;&#xA;;; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One should enable &lt;code&gt;outline-minor-mode&lt;/code&gt; and then the two required key strokes are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;C-c @ C-t&lt;/kbd&gt; — show top level structure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the above becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; preliminaries:&#xA;;;; modes:&#xA;;;; customizations:&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;C-c @ C-a&lt;/kbd&gt; — show all again&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A typical usage is to show top level structure, move to the heading of interest, and showing all again.&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-01-12T16:55:35.367" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7305" PostTypeId="1" AcceptedAnswerId="7306" CreationDate="2015-01-12T17:47:52.753" Score="4" ViewCount="514" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I disable the &quot;now&quot; line in an &lt;code&gt;org-mode&lt;/code&gt; agenda view?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When displaying a time grid in the agenda, &lt;code&gt;org-mode&lt;/code&gt; displays, by default (or so I assume), a line with the current time listed as &quot;now&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Day-agenda (W03):&#xA;Monday     12 January 2015 W03&#xA;               8:00am........ ----------------&#xA;              10:00am........ ----------------&#xA;              12:00pm........ ----------------&#xA;(THIS LINE)   12:34pm........ now - - - - - - - - - - - - - - - - - - - - - - - -&#xA;               2:00pm........ ----------------&#xA;               4:00pm........ ----------------&#xA;               6:00pm........ ----------------&#xA;               8:00pm........ ----------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to remove the &quot;now&quot; line.  How does one turn it off?  Unless I missed something, there's no obvious setting in &lt;code&gt;org-agenda-time-grid&lt;/code&gt; (or related variables) to disable &quot;now.&quot;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-12T18:09:57.507" Title="Disable &quot;now&quot; line in org agenda view?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7306" PostTypeId="2" ParentId="7305" CreationDate="2015-01-12T18:09:57.507" Score="7" Body="&lt;p&gt;Try customizing &lt;code&gt;org-agenda-show-current-time-in-grid&lt;/code&gt;, which defaults to &lt;code&gt;t&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-12T18:09:57.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7307" PostTypeId="1" CreationDate="2015-01-12T18:22:32.040" Score="4" ViewCount="2037" Body="&lt;p&gt;I am using &lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;web-mode.el&lt;/code&gt;&lt;/a&gt; to edit my CSS and HTML files. I am 90% sure that I haven't touched it but, just in case I modified it in the past, you can find the actual &lt;code&gt;web-mode.el&lt;/code&gt; file I'm using &lt;a href=&quot;http://pastebin.com/d7Vk2M3v&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have mapped the shortcut &lt;code&gt;C-cc&lt;/code&gt; to &lt;code&gt;comment-region&lt;/code&gt; in my &lt;code&gt;~/.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;\C-cc&quot; 'comment-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine in all other modes but if I try to use it in web-mode I get &lt;code&gt;No comment syntax is defined.  Use:&lt;/code&gt;. So, presumably, I need to tell web-mode to use &lt;code&gt;&amp;lt;!--&lt;/code&gt; and &lt;code&gt;--&amp;gt;&lt;/code&gt; for HTML and &lt;code&gt;/*&lt;/code&gt; and &lt;code&gt;*/&lt;/code&gt; for CSS. I checked some other mode files and I'm guessing I need something like this for CSS:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((deactivate-mark nil) (comment-start &quot;/*&quot;) (comment-end &quot;*/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How should I go about editing my &lt;code&gt;web-mode.el&lt;/code&gt; to get my comments to work? Is the above line correct and, if so, where should I add it? Presumably, I would need to add the above (or something like it) to a CSS section of the file and the equivalent to an HTML one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime, I would also appreciate a pointer explaining how I can give &lt;code&gt;/*&lt;/code&gt; and &lt;code&gt;*/&lt;/code&gt; or &lt;code&gt;&amp;lt;!--&lt;/code&gt; and &lt;code&gt;--&amp;gt;&lt;/code&gt; as answers to the &lt;code&gt;No comment syntax is defined. Use:&lt;/code&gt; prompt. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of the &lt;code&gt;M-;&lt;/code&gt; shortcut from Web mode but I would rather have the same shortcut since I am very used to it from the various other modes I use where it works. In any case, I want the &lt;code&gt;comment-region&lt;/code&gt; function to work as it does in other modes.&lt;/p&gt;&#xA;" OwnerUserId="241" LastEditorUserId="241" LastEditDate="2015-06-05T17:37:29.803" LastActivityDate="2019-01-01T11:24:16.913" Title="How can I comment a block of CSS or HTML in web mode?" Tags="|comment|web-mode|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7308" PostTypeId="1" AcceptedAnswerId="7311" CreationDate="2015-01-12T18:30:06.637" Score="3" ViewCount="489" Body="&lt;p&gt;I have been trying to set up a shortcut for jumping between a JavaScript implementation and test. I have particular requirements that are making examples I see harder to apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently work with &lt;em&gt;many&lt;/em&gt; very small javascript projects. The structure of the project normally has its tests in a mirrored directory structure (like so: )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;lib/foo.js&#xA;lib/someDir/bar.js&#xA;test/fooSpec.js&#xA;test/someDir/barSpec.js&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the spec files are not in the same directory, as the implementation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first was looking at examples for &lt;code&gt;ff-find-other-file&lt;/code&gt;, but they were for situations when the files were located in the same directories. I'm looking to configure it a little more dynamically (walking up the directory tree until lib, then adding a similar path with test replacing lib)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also know projectile has a function for doing just this. I use projectile in my setup, but when attempting to use its built in method (C-c p t) I get the message &quot;Project type not supported!&quot;. Interestingly enough, projectile is able to list all my test files via (C-c p T). &#xA;Is there way of configuring projectile for javascript, so that it knows how to find a corresponding spec file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also saw the project &lt;a href=&quot;https://github.com/rags/toggle-test&quot; rel=&quot;nofollow&quot;&gt;toggle test&lt;/a&gt;, but am looking for a more automatic solution. It requires a configuration for each project to enable toggling between tests. This is rather inconvenient to me because when working with Node/JS I bounce between many projects (it's very common to divide an application into many very small projects with their own tests). I also often look at external dependencies, and then their specs. More often then not they have this structure. Having to configure toggle test each time I need to use this feature makes it not very useful.&lt;/p&gt;&#xA;" OwnerUserId="4090" LastActivityDate="2015-01-12T21:57:18.373" Title="Define key to toggle between javascript implementation and test file" Tags="|files|projectile|javascript|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7309" PostTypeId="1" AcceptedAnswerId="7312" CreationDate="2015-01-12T18:50:37.683" Score="3" ViewCount="679" Body="&lt;p&gt;Let's say I have this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;* Title&#xA;** Subtitle 1&#xA;   some text&#xA;** Subtitle 2&#xA;*** Sub-Subtitle 1&#xA;    some text&#xA;*** Sub-Subtitle 2&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I automatically generate an index with links to all those headings?&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2015-01-12T20:51:46.113" LastActivityDate="2015-01-12T20:51:46.113" Title="How can I automatically generate an index from headings in org-mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7310" PostTypeId="2" ParentId="7307" CreationDate="2015-01-12T19:17:57.723" Score="11" Body="&lt;p&gt;The &lt;code&gt;web-mode&lt;/code&gt; shortcut &lt;code&gt;M-;&lt;/code&gt; (which calls &lt;code&gt;web-mode-comment-or-uncomment&lt;/code&gt;) works for me in HTML, CSS, and PHP files. For the first, this command puts &lt;code&gt;&amp;lt;!-- --&amp;gt;&lt;/code&gt; around the region, for the second, &lt;code&gt;/* */&lt;/code&gt;, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried testing both &lt;code&gt;comment-region&lt;/code&gt; and &lt;code&gt;comment-dwim&lt;/code&gt; with &lt;code&gt;web-mode&lt;/code&gt; enabled. Both functions had the same result: &lt;code&gt;&amp;lt;!-- --&amp;gt;&lt;/code&gt; was placed around the region, no matter what kind of file was open. Thus, I suggest using the &lt;code&gt;web-mode&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the shortcut more consistent, you could do e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-web-mode-hook ()&#xA;    (local-set-key (kbd &quot;C-c c&quot;) 'web-mode-comment-or-uncomment))&#xA;&#xA;(add-hook 'web-mode-hook 'my-web-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My testing was done with various versions of Emacs and &lt;code&gt;web-mode&lt;/code&gt;. (This includes testing with &lt;code&gt;emacs -Q&lt;/code&gt; + loading &lt;code&gt;web-mode&lt;/code&gt;.) I would also recommend updating to ensure you have a recent version of &lt;code&gt;web-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you do have changes you want to apply on top of &lt;code&gt;web-mode&lt;/code&gt; for your personal use, I would recommend doing so directly from a copy of &lt;a href=&quot;https://github.com/fxbois/web-mode&quot; rel=&quot;noreferrer&quot;&gt;the Git repo&lt;/a&gt;. You can even &lt;a href=&quot;https://help.github.com/articles/fork-a-repo/&quot; rel=&quot;noreferrer&quot;&gt;fork the repo&lt;/a&gt; if you want to share your changes with others, and you can use that to open a &lt;a href=&quot;https://help.github.com/articles/creating-a-pull-request/&quot; rel=&quot;noreferrer&quot;&gt;pull request&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I have noticed a problem recently with the commenting in &lt;code&gt;web-mode&lt;/code&gt;, which causes an empty comment to be added after the region if the point is after the mark. I've &lt;a href=&quot;https://github.com/fxbois/web-mode/issues/524&quot; rel=&quot;noreferrer&quot;&gt;reported the issue here&lt;/a&gt;, and it has now been fixed in the latest version of &lt;code&gt;web-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2015-06-08T16:28:52.113" LastActivityDate="2015-06-08T16:28:52.113" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7311" PostTypeId="2" ParentId="7308" CreationDate="2015-01-12T19:23:15.650" Score="4" Body="&lt;p&gt;I know nothing about projectile, but if I needed something like what you described, I'd possibly go with something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jump-to-test ()&#xA;  (interactive)&#xA;  (find-file-other-window&#xA;   (cl-loop with parts = (reverse (split-string (buffer-file-name) &quot;/&quot;))&#xA;            with fname = (file-name-sans-extension (cl-first parts))&#xA;            for (name . rest) on (cl-rest parts)&#xA;            until (string-equal name &quot;lib&quot;)&#xA;            collect name into names&#xA;            finally (cl-return&#xA;                     (mapconcat 'identity&#xA;                                (nconc (reverse rest)&#xA;                                       (list &quot;test&quot;)&#xA;                                       (reverse names)&#xA;                                       (list (format &quot;%sSpec.js&quot; fname))) &quot;/&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-12T19:23:15.650" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7312" PostTypeId="2" ParentId="7309" CreationDate="2015-01-12T19:24:32.377" Score="3" Body="&lt;p&gt;3rd party org-contrib package &lt;code&gt;org-toc&lt;/code&gt; implements this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Binging it shows several implementations. Here are two:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;http://orgmode.org/worg/org-contrib/&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-contrib/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2] &lt;a href=&quot;https://github.com/snosov1/org-toc&quot; rel=&quot;nofollow&quot;&gt;https://github.com/snosov1/org-toc&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-01-12T19:24:32.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7313" PostTypeId="2" ParentId="7299" CreationDate="2015-01-12T19:24:44.007" Score="34" Body="&lt;p&gt;As @wvxvw points out, you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html#Text-Based-Tables&quot;&gt;&lt;code&gt;table.el&lt;/code&gt;&lt;/a&gt; by Takaaki Ota.  There is some built-in support for this in org-mode (see &lt;a href=&quot;http://orgmode.org/manual/Cooperation.html#Cooperation&quot;&gt;manual&lt;/a&gt;). Your example can be easily translated to &lt;code&gt;table.el&lt;/code&gt; syntax by replacing some &lt;code&gt;|&lt;/code&gt; with &lt;code&gt;+&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+------------+-----------+----------+----------+-------------+&#xA;|            |             Singular            | Plural      |&#xA;|            +-----------+----------+----------+-------------+&#xA;|            | Masculine | Neuter   | Feminine | All genders |&#xA;+------------+-----------+----------+----------+-------------+&#xA;| Nominative | *der*     | *das*    | *die*    | *die*       |&#xA;| Accusative | *den*     | *das*    | *die*    | *die*       |&#xA;| Dative     | *dem*     | *dem*    | *der*    | *denen*     |&#xA;| Genitive   | *dessen*  | *dessen* | *deren*  | *deren*     |&#xA;+------------+-----------+----------+----------+-------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The table can be edited using &lt;code&gt;C-c '&lt;/code&gt; and it exports fine with the HTML and LaTeX backends, &lt;em&gt;except&lt;/em&gt; that org-mode syntax (such as using asterisks for bold) inside the cells is not recognised. Here is an example of rendered LaTeX export:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/V4eZQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="9995" LastEditDate="2016-02-02T20:37:20.543" LastActivityDate="2016-02-02T20:37:20.543" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7314" PostTypeId="2" ParentId="7273" CreationDate="2015-01-12T20:26:11.857" Score="2" Body="&lt;p&gt;When you evaluate &lt;code&gt;(insert &quot;qwerty&quot;)&lt;/code&gt; the &lt;em&gt;lisp reader&lt;/em&gt; creates a string object with the literal value &quot;qwerty&quot;. No input method functionality is able to intervene there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The input method has already done its work by the time a character is inserted into a buffer, such that (using your example) typing &lt;kbd&gt;q&lt;/kbd&gt; would result in &lt;code&gt;(insert &quot;a&quot;)&lt;/code&gt;, not &lt;code&gt;(insert &quot;q&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;insert&lt;/code&gt; itself is a very low-level function. The only manipulation that happens to its argument is to ensure that unibyte data is not inserted into a multibyte buffer, or vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you're talking about &lt;em&gt;writing a function&lt;/em&gt; to insert text into a buffer, there's absolutely no reason why you would need that sort of magic, because you'll be in a position to process the text however you wish &lt;em&gt;before&lt;/em&gt; calling &lt;code&gt;insert&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-01-12T20:26:11.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7316" PostTypeId="2" ParentId="7308" CreationDate="2015-01-12T21:57:18.373" Score="2" Body="&lt;p&gt;Tweaked wvxvw's answer to provide it as a toggle between files. It also doesn't open it in a new window.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun js-jump-to (current from to format-name)&#xA;  (find-file&#xA;   (cl-loop with parts = (reverse current)&#xA;            with fname = (file-name-sans-extension (cl-first parts))&#xA;            for (name . rest) on (cl-rest parts)&#xA;            until (string-equal name from)&#xA;            collect name into names&#xA;            finally (cl-return&#xA;                     (mapconcat 'identity&#xA;                                (nconc (reverse rest)&#xA;                                       (list to)&#xA;                                       (reverse names)&#xA;                                       (list (funcall format-name fname) )) &quot;/&quot; )))))&#xA;&#xA;(defun js-format-impl-name (fname)&#xA;  (format &quot;%s.js&quot; (replace-regexp-in-string &quot;Spec&quot; &quot;&quot; fname)))&#xA;&#xA;(defun js-format-test-name (fname)&#xA;  (format &quot;%sSpec.js&quot; fname))&#xA;&#xA;(defun js-jump-to-implementation-or-test ()&#xA;  (interactive)&#xA;  (let ((current (split-string (buffer-file-name) &quot;/&quot;)))&#xA;    (cond&#xA;     ((member &quot;test&quot; current) (js-jump-to current &quot;test&quot; &quot;lib&quot; 'js-format-impl-name))&#xA;     ((member &quot;lib&quot; current)  (js-jump-to current &quot;lib&quot; &quot;test&quot; 'js-format-test-name))&#xA;     (t (error &quot;not within a test or lib directory&quot;))&#xA;  )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4090" LastActivityDate="2015-01-12T21:57:18.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7317" PostTypeId="2" ParentId="7291" CreationDate="2015-01-12T22:44:52.003" Score="5" Body="&lt;p&gt;We should set an output handling options in header arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need output &lt;em&gt;type&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;scalar, &lt;strong&gt;verbatim&lt;/strong&gt; The results should be interpreted literally—they will not be converted into a table. The results will be inserted into the Org mode buffer as quoted text. E.g., :results value verbatim. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and output &lt;em&gt;format&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;raw&lt;/strong&gt; The results are interpreted as raw Org mode code and are inserted directly into the buffer. If the results look like a table they will be aligned as such by Org mode. E.g., :results value raw. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Tabular interpretation is enabled by default (with implicit header args):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(number-sequence 1 5)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| 1 | 2 | 3 | 4 | 5 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get raw output we need to change &lt;em&gt;:results&lt;/em&gt; header argument to &lt;em&gt;verbatim raw&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results verbatim raw&#xA;(number-sequence 1 5)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;(1 2 3 4 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or define that for whole header (&lt;a href=&quot;http://orgmode.org/manual/Using-header-arguments.html#Using-header-arguments&quot; rel=&quot;noreferrer&quot;&gt;or any level&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Raw output&#xA;:PROPERTIES:&#xA;:header-args:    :results  verbatim raw&#xA;:END:&#xA;&#xA;#+begin_src sh&#xA;cat &amp;lt;&amp;lt;EOF&#xA;| 1 | 2&#xA;|--&#xA;| a | b&#xA;EOF&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| 1 | 2 |&#xA;|---+---|&#xA;| a | b |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/&quot; rel=&quot;noreferrer&quot;&gt;Org-babel&lt;/a&gt; provides more ouptut options. You can read about them at &lt;a href=&quot;http://orgmode.org/manual/results.html#results&quot; rel=&quot;noreferrer&quot;&gt;Specific Header Arguments&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/header-args.html&quot; rel=&quot;noreferrer&quot;&gt;Header arguments and result types in Org Babel&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="220" LastActivityDate="2015-01-12T22:44:52.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7319" PostTypeId="2" ParentId="5394" CreationDate="2015-01-13T00:29:07.623" Score="3" Body="&lt;p&gt;&lt;strong&gt;Short answer: switch to &lt;a href=&quot;http://melpa.org&quot; rel=&quot;nofollow&quot;&gt;melpa.org&lt;/a&gt; or &lt;a href=&quot;http://stable.melpa.org&quot; rel=&quot;nofollow&quot;&gt;stable.melpa.org&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long answer: marmalade goes down a lot, and the maintainers don't acknowledge it in the news section of the site. So it might simply have been the case that the site was down. I advise you not to use it.&lt;/p&gt;&#xA;" OwnerUserId="3895" LastActivityDate="2015-01-13T00:29:07.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7320" PostTypeId="2" ParentId="7237" CreationDate="2015-01-13T02:59:22.153" Score="2" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I adapted the answer from the &lt;code&gt;:post&lt;/code&gt; header &lt;a href=&quot;http://orgmode.org/manual/post.html#post&quot; rel=&quot;nofollow&quot;&gt;example code&lt;/a&gt; in the org-mode manual.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Add a new code block that will add the &lt;code&gt;#+ATTR_LATEX :width 12cm :float c&lt;/code&gt; during a post processing step.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: add_attr_latex&#xA;#+BEGIN_SRC sh :var data=&quot;&quot; :var width=&quot;textwidth&quot; :var float=&quot;c&quot; :results output&#xA;  echo &quot;#+ATTR_LATEX :width $width :float $float&quot;&#xA;  echo &quot;$data&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This new code block takes three (3) parameters: &lt;code&gt;width&lt;/code&gt;, &lt;code&gt;float&lt;/code&gt; and &lt;code&gt;data&lt;/code&gt;.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add new &lt;code&gt;:post&lt;/code&gt; and &lt;code&gt;:results&lt;/code&gt; headers to your original code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. &lt;code&gt;:post add_attr_latex(width=&quot;12cm&quot;, float=&quot;c&quot;, data=*this*) :results drawer&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When a post argument is given, the results of the code block will temporarily be bound to the &lt;strong&gt;*this*&lt;/strong&gt; variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src gnuplot :post add_attr_latex(width=&quot;12cm&quot;, float=&quot;c&quot;, data=*this*) :results drawer :cache yes :var standard=standard :file plots/standard.png&#xA;reset&#xA;set terminal pngcairo size 800,800 enhanced font 'WenQuanYiZenHei,14'&#xA;set xlabel &quot;Standard Conc.（ppm)&quot;&#xA;set ylabel &quot;Value&quot; &#xA;&#xA;set style up points&#xA;set grid&#xA;set pointsize 5&#xA;&#xA;stats standard using 1:2 name &quot;STD&quot;&#xA;&#xA;# f(x)=a*(x)+b&#xA;line(x)=STD_slope*(x)+STD_intercept&#xA;&#xA;set xrange [0:40]&#xA;set yrange [0:]&#xA;set xtics 0, 10, 40&#xA;set ytics 0, 0.1, 1&#xA;&#xA;unset key&#xA;set label 1 sprintf(&quot;r = %4.4f\nR^2 = %4.4f\ny = %4.4f x + %.4f&quot;,STD_correlation, STD_correlation**2, STD_slope, STD_intercept) at graph 0.1, graph 0.9&#xA;plot standard u 1:2 notitle,\&#xA;     line(x) title 'Linear Fit' &#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Invoke the updated code block with &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt; and new &lt;code&gt;#+RESULTS:&lt;/code&gt; block should display similar to the one below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS[d91af022c181a9a4988311940517f53801282437]:&#xA;:RESULTS:&#xA;#+ATTR_LATEX :width 12cm :float c&#xA;[[file:plots/standard.png]]&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks for asking your question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This code was tested using the following versions of emacs and org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&#xA;Org-mode version 8.2.10 (8.2.10-29-g89a0ac-elpa)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2015-01-25T16:41:20.227" LastActivityDate="2015-01-25T16:41:20.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7321" PostTypeId="1" AcceptedAnswerId="7322" CreationDate="2015-01-13T04:10:05.197" Score="6" ViewCount="763" Body="&lt;p&gt;erlang-mode is not a derived prog-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to make it part of the prog-mode-hook ? &lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="897" LastEditDate="2017-05-23T09:29:29.957" LastActivityDate="2017-05-23T09:29:29.957" Title="Turn a non prog-mode derived major-mode into a prog-mode derived major-mode" Tags="|hooks|major-mode|prog-mode|erlang-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7322" PostTypeId="2" ParentId="7321" CreationDate="2015-01-13T04:30:06.707" Score="7" Body="&lt;p&gt;All you have to do is add &lt;code&gt;(run-hooks 'prog-mode-hook)&lt;/code&gt; to &lt;code&gt;erlang-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'erlang-mode-hook&#xA;          (lambda () (run-hooks 'prog-mode-hook)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should place this after anything else you add to &lt;code&gt;erlang-mode-hook&lt;/code&gt; to make sure &lt;code&gt;prog-mode-hook&lt;/code&gt; gets called &lt;em&gt;before&lt;/em&gt; anything else.  That way &lt;code&gt;erlang-mode&lt;/code&gt; can clobber any settings in &lt;code&gt;prog-mode&lt;/code&gt; that it doesn't like.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2223" LastEditDate="2015-01-13T15:56:21.000" LastActivityDate="2015-01-13T15:56:21.000" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7323" PostTypeId="1" AcceptedAnswerId="7330" CreationDate="2015-01-13T08:08:27.793" Score="8" ViewCount="1155" Body="&lt;p&gt;I would like to add a markup to org-mode, to simplify adding &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; HTML tags. Like other inline markup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In Thai, /sabai dee mai/ is pronounced as [audio:assets/sabai.mp3]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which would export as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;In Thai, &amp;lt;i&amp;gt;sabai dee mai&amp;lt;/i&amp;gt; is pronounced as &amp;lt;audio src=&quot;assets/sabai.mp3&quot;&amp;gt;&amp;lt;/audio&amp;gt;&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I looked at &lt;code&gt;org.el&lt;/code&gt; and &lt;code&gt;ox-html.el&lt;/code&gt; to perhaps just copy how bold and such inline markup works, but I don't see how the pieces fit together.&lt;/p&gt;&#xA;" OwnerUserId="2182" LastActivityDate="2015-01-13T14:27:11.050" Title="How to add new markup to org-mode HTML export?" Tags="|org-mode|html|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7324" PostTypeId="1" AcceptedAnswerId="7326" CreationDate="2015-01-13T11:25:56.547" Score="6" ViewCount="796" Body="&lt;p&gt;I noticed something strange when calling &lt;kbd&gt;C-h v&lt;/kbd&gt; (&lt;code&gt;describe-variable&lt;/code&gt;) on &lt;code&gt;exec-path&lt;/code&gt; today:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;exec-path&lt;/code&gt; is a variable defined in `C source code'.&lt;/p&gt;&#xA;&lt;p&gt;Its value is&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(&amp;quot;/usr/bin&amp;quot; ...)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Original value was&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(&amp;quot;/home/juergen/.opam/4.02.0/bin&amp;quot; &amp;quot;/home/juergen/.cabal/bin&amp;quot; &amp;quot;/usr/local/sbin&amp;quot; &amp;quot;/usr/local/bin&amp;quot; &amp;quot;/usr/bin&amp;quot; &amp;quot;/opt/google-appengine-java/bin&amp;quot; &amp;quot;/usr/lib/jvm/default/bin&amp;quot; &amp;quot;/usr/bin/site_perl&amp;quot; &amp;quot;/usr/bin/vendor_perl&amp;quot; &amp;quot;/usr/bin/core_perl&amp;quot; &amp;quot;/home/juergen/Android/ndk/&amp;quot; &amp;quot;/home/juergen/.gem/ruby/2.0.0/bin/&amp;quot; &amp;quot;/home/juergen/bin/&amp;quot; &amp;quot;/home/juergen/bin/gnome-terminal-colors-solarized&amp;quot; &amp;quot;/home/juergen/tmp/emacs/trunk/src/emacs-24.4/lib-src&amp;quot; &amp;quot;/usr/lib/emacs/24.4/x86_64-unknown-linux-gnu&amp;quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The thing is, &lt;strong&gt;there is no user called&lt;/strong&gt; &lt;code&gt;juergen&lt;/code&gt; &lt;strong&gt;on my system&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is this the &lt;code&gt;exec-path&lt;/code&gt; of the user who originally compiled the Emacs binary I am using? If so, why does its value get carried over into a binary that is distributed to end users? Shouldn't &lt;code&gt;exec-path&lt;/code&gt; have a more generic default value (i.e., a value that doesn't include any &lt;code&gt;/home/juergen&lt;/code&gt; entries)?&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-13T12:23:24.270" Title="Who is &quot;juergen&quot; and why can I see the value of his exec-path?" Tags="|emacs-internals|path|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7325" PostTypeId="2" ParentId="7323" CreationDate="2015-01-13T11:44:04.540" Score="5" Body="&lt;p&gt;You can use the &lt;a href=&quot;http://orgmode.org/manual/Macro-replacement.html&quot; rel=&quot;noreferrer&quot;&gt;org-mode macro replacement&lt;/a&gt; to achieve this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A macro called &lt;code&gt;AUDIO&lt;/code&gt; can be defined as below &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO AUDIO @@html:&amp;lt;audio src=&quot;$1&quot;&amp;gt;&amp;lt;/audio&amp;gt;@@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using your example, here is what its usage will look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In Thai, /sabai dee mai/ is pronounced as {{{AUDIO(assets/sabai.mp3)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which would export to html as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;In Thai, &amp;lt;i&amp;gt;sabai dee mai&amp;lt;/i&amp;gt; is pronounced as &amp;lt;audio src=&quot;assets/sabai.mp3&quot;&amp;gt;&amp;lt;/audio&amp;gt;&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-13T13:56:49.750" LastActivityDate="2015-01-13T13:56:49.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7326" PostTypeId="2" ParentId="7324" CreationDate="2015-01-13T12:23:24.270" Score="6" Body="&lt;p&gt;It does sound like this was caused by the user who originally built the binary for you. If they didn't do so in some sort of stripped down environment then this would happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to report it to the maintainers of your binary package so that they can fix the problem with their build process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you provide information about what platform you are running Emacs on it would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="245" LastActivityDate="2015-01-13T12:23:24.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7327" PostTypeId="1" CreationDate="2015-01-13T13:27:39.950" Score="3" ViewCount="109" Body="&lt;p&gt;When interacting with postgresql via Emacs &lt;code&gt;sql-postgres&lt;/code&gt;, is it possible to write aliases or functions, to be able to type for example, &lt;code&gt;databases&lt;/code&gt; instead of &lt;code&gt;\l&lt;/code&gt;, when I want to list all databases? &lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-01-13T13:27:39.950" Title="Send custom commands via psql interface" Tags="|sql-interactive-mode|sql-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7328" PostTypeId="1" AcceptedAnswerId="7332" CreationDate="2015-01-13T14:03:55.190" Score="11" ViewCount="6509" Body="&lt;p&gt;When I click on links in my org-mode buffer it opens up my external browser. How can I make Emacs default to eww (and let me open up an external browser from there if I wish)?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-07-21T14:39:27.790" Title="How to make eww default browser in Emacs?" Tags="|org-mode|eww|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7329" PostTypeId="2" ParentId="7323" CreationDate="2015-01-13T14:04:29.307" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://endlessparentheses.com/inserting-the-kbd-tag-in-org-mode.html&quot; rel=&quot;nofollow&quot;&gt;This post&lt;/a&gt; describes you can alter existing markup to produce any kind of tag you want. I'm not aware of any way of defining &lt;em&gt;new&lt;/em&gt; markup with this, but, since &lt;code&gt;~&lt;/code&gt; and &lt;code&gt;=&lt;/code&gt; are redundant when exporting to html, you can change one of the two while still using the other as &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following snippet should turn &lt;code&gt;~sabai.mp3~&lt;/code&gt; into &lt;code&gt;&amp;lt;audio src=&quot;sabai.mp3&quot;&amp;gt;&amp;lt;/audio&amp;gt;&lt;/code&gt; when exporting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'ox-html&#xA;  '(push '(code . &quot;&amp;lt;audio src=&quot;%s&quot;&amp;gt;&amp;lt;/audio&amp;gt;&quot;) org-html-text-markup-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the following will do the same with &lt;code&gt;=sabai.mp3=&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'ox-html&#xA;  '(push '(verbatim . &quot;&amp;lt;audio src=&quot;%s&quot;&amp;gt;&amp;lt;/audio&amp;gt;&quot;) org-html-text-markup-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-13T14:04:29.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7330" PostTypeId="2" ParentId="7323" CreationDate="2015-01-13T14:27:11.050" Score="9" Body="&lt;p&gt;Org is extremely versatile when it comes to defining links, so they're probably your best bet. For that you need the &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/org-add-link-type&quot;&gt;&lt;code&gt;org-add-link-type&lt;/code&gt;&lt;/a&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-add-link-type &quot;audio&quot; #'ignore #'endless/export-audio-link)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second argument is telling org you don't care about opening &lt;code&gt;audio&lt;/code&gt; links for now, and the third argument says how to export them to html. Use the following example function, or improve it to your needs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/export-audio-link (path desc format)&#xA;  &quot;Export org audio links to hmtl.&quot;&#xA;  (cl-case format&#xA;    (html (format &quot;&amp;lt;audio src=\&quot;%s\&quot;&amp;gt;%s&amp;lt;/audio&amp;gt;&quot; path (or desc &quot;&quot;)))&#xA;    (latex (format &quot;(HOW DO I EXPORT AUDIO TO LATEX? \&quot;%s\&quot;)&quot; path))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;With the above configuration, the links&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[audio:file.mp3][description]]&#xA;[[audio:file-2.mp3]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would export to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;audio src=&quot;file.mp3&quot;&amp;gt;description&amp;lt;/audio&amp;gt;&#xA;&amp;lt;audio src=&quot;file-2.mp3&quot;&amp;gt;&amp;lt;/audio&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://endlessparentheses.com/use-org-mode-links-for-absolutely-anything.html&quot;&gt;This post&lt;/a&gt; also explains how you can define a way to actually open these audio links inside &lt;code&gt;org-mode&lt;/code&gt; (by using the second argument).&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-13T14:27:11.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7331" PostTypeId="1" CreationDate="2015-01-13T14:28:58.293" Score="1" ViewCount="1334" Body="&lt;p&gt;I'm trying to customize my agenda. My tasks have the following states: &lt;code&gt;NEXT&lt;/code&gt;, &lt;code&gt;WAITING&lt;/code&gt;, &lt;code&gt;TODO&lt;/code&gt; and &lt;code&gt;DONE&lt;/code&gt;. I want to customize my agenda view so that no header is shown. So far, I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;b&quot; &quot;Test&quot;&#xA;     ;; commands&#xA;     ((agenda &quot;&quot; ((org-agenda-span 7)&#xA;              (org-deadline-warning-days 30)))&#xA;      (todo &quot;NEXT&quot; ((org-agenda-overriding-header &quot;&quot;)))&#xA;      (todo &quot;WAITING&quot; ((org-agenda-overriding-header &quot;&quot;)))&#xA;      (todo &quot;TODO&quot; ((org-agenda-overriding-header &quot;&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but in this way, an empty line is shown before each section.&#xA;Is there any way to get rid of the header at all?&lt;/p&gt;&#xA;" OwnerUserId="201" LastEditorUserId="2274" LastEditDate="2015-08-25T17:48:14.543" LastActivityDate="2015-10-25T10:34:45.917" Title="Customize agenda view with no headers" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7332" PostTypeId="2" ParentId="7328" CreationDate="2015-01-13T14:32:04.460" Score="16" Body="&lt;p&gt;As noted in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/EWW.html&quot; rel=&quot;noreferrer&quot;&gt;EWW info manual node&lt;/a&gt; you can use EWW as a target for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Browse_002dURL.html#Browse_002dURL&quot; rel=&quot;noreferrer&quot;&gt;browse-url&lt;/a&gt;, which is what Org uses if a URI starts with &quot;http&quot;, &quot;https&quot;, etc. You can of course customize browse-url behaviour with &lt;code&gt;M-x customize-group browse-url&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, add the following to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;: &lt;code&gt;(setq browse-url-browser-function 'eww-browse-url)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're visiting a webpage in EWW you can hit &lt;code&gt;&amp;amp;&lt;/code&gt; &lt;code&gt;(eww-browse-with-external-browser)&lt;/code&gt; to open the page in an external browser.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastEditorUserId="2251" LastEditDate="2015-07-21T14:39:27.790" LastActivityDate="2015-07-21T14:39:27.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7333" PostTypeId="1" CreationDate="2015-01-13T15:06:52.687" Score="1" ViewCount="270" Body="&lt;p&gt;I can't figure out the correct syntax for a link to a password-protected FTP site.  I want to insert a link in org-mode, which opens a remote FTP server at a given directory in dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/user:pass@host:/dir&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the error &lt;em&gt;unknown method user&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/ftp:user:pass@host:/dir&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get prompted for a &lt;em&gt;Password for myusername@user&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, when I do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ftp://user:pass@host:/dir&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the link gets opened externally (in Firefox)&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2015-01-13T18:02:19.010" Title="Link to password-protected FTP server in org-mode" Tags="|org-mode|dired|ftp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7334" PostTypeId="2" ParentId="7237" CreationDate="2015-01-13T15:36:49.200" Score="5" Body="&lt;p&gt;All you have to do is add &lt;code&gt;#+NAME: my-name&lt;/code&gt; before your source block.  Then, evaluate the source block again and a new &lt;code&gt;#+RESULTS[...] my-name:&lt;/code&gt;  section is produced with the same name that you gave to the source block.  You can now safely add stuff like &lt;code&gt;#+ATTR_LATEX&lt;/code&gt; lines before the results line and they will be preserved through subsequent re-evaluations of the source block.  In fact, you can move the results line to anywhere you want in the same file (even before the source block) and it will still receive the evaluation results so long as it has the correct name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: standard-plot&#xA;#+begin_src gnuplot :cache yes :var standard=standard :file plots/standard.png&#xA;... CODE GOES HERE ...&#xA;#+end_src&#xA;&#xA;#+ATTR_LATEX: :width 12cm :float c&#xA;#+RESULTS[6299f1b9325738f88305182a7295c5a45689db4a]: standard-plot&#xA;[[file:plots/standard.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; I still cannot find this behaviour documented in Org's Info pages, but it is mentioned in Fabrice Niessen's &lt;a href=&quot;https://github.com/fniessen/refcard-org-babel&quot; rel=&quot;noreferrer&quot;&gt;Org Babel reference card&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Named source code blocks will refresh the corresponding named results blocks anywhere in the file. [...] It doesn’t matter whether the code block and the results block are “disconnected”, such as here, as the results is a named data which Babel can locate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="1980" LastEditDate="2015-01-13T16:12:52.840" LastActivityDate="2015-01-13T16:12:52.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7335" PostTypeId="1" AcceptedAnswerId="12857" CreationDate="2015-01-13T15:49:28.180" Score="4" ViewCount="1165" Body="&lt;p&gt;I have this sample org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+COLUMNS: %25ITEM %TODO %5owner %3PRIORITY %TAGS&#xA;* test1&#xA;  :PROPERTIES:&#xA;  :owner:    own1&#xA;  :END:&#xA;** test2&#xA;** test3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have in my .emacs file:&#xA;&lt;code&gt;(setq org-use-property-inheritance (quote (&quot;owner&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why the &quot;owner&quot; property is not inherited to headings &quot;test2&quot; and &quot;test3&quot;?&#xA;In column view the column &quot;owner&quot; is empty for above headings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7MMXa.png&quot; alt=&quot;https://i.imgur.com/b2D6bhC.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried (without success):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;.emacs file: &lt;code&gt;(setq org-use-property-inheritance t)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;changing &lt;code&gt;:owner:&lt;/code&gt; in the &quot;test1&quot; drawer to &lt;code&gt;:owner_ALL:&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;using file property: &lt;code&gt;#+PROPERTY: owner_ALL own1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4005" LastActivityDate="2015-06-02T22:51:02.983" Title="Properties inheriting in org doesn't work" Tags="|org-mode|text-properties|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7336" PostTypeId="1" CreationDate="2015-01-13T16:31:10.580" Score="1" ViewCount="91" Body="&lt;p&gt;I used to use windows emacs, and store my configuration in the &lt;code&gt;C:/User/admin//Emacs/.emacs.d/init.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because I would like to use gnus which is not lucky to access in windows emacs, I plan to change to cygwin emacs to use linux commands to use gnus. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I downloaded emacs-w32 in cygwin. Add script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/cygdrive/C:/User/admin//Emacs/.emacs.d/&quot;)&#xA;(require 'init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But why does init.el file not existed, which is surely under the folder of .emacs.d.&#xA;I think there must be some other necessities to be configured, but I have no idea.&#xA;So anyone can give me a answer how I can connect emacs configuration properly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="11" LastEditDate="2015-01-13T16:56:57.513" LastActivityDate="2015-01-13T16:56:57.513" Title="How can I connect the configuration of emacs-x32 of cygwin and windows emacs" Tags="|microsoft-windows|emacs24.4|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7337" PostTypeId="1" AcceptedAnswerId="7350" CreationDate="2015-01-13T17:29:05.693" Score="3" ViewCount="595" Body="&lt;p&gt;I've seen a lot of references to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs 25&lt;/li&gt;&#xA;&lt;li&gt;Emacs 24.5&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tend to think that the next emacs will be Emacs 25, because that's what the git version of emacs calls itself, but I keep &lt;em&gt;hearing&lt;/em&gt; about 24.5, even recently from knowledgeable developers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been looking for a source to resolve this, but I haven't found anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is it? (Would like a source with reliable references.)&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-01-13T17:36:43.777" LastActivityDate="2015-01-13T21:50:46.333" Title="The version number of the Emacs after 24.4" Tags="|emacs24.4|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7338" PostTypeId="2" ParentId="7337" CreationDate="2015-01-13T17:45:26.543" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00872.html&quot;&gt;According to Stefan Monnier it's going to be 25.1&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-13T17:45:26.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7339" PostTypeId="2" ParentId="7333" CreationDate="2015-01-13T18:02:19.010" Score="2" Body="&lt;p&gt;As @legoscia mentions, one solution is to store the username and password in an external file.  This is necessary because TRAMP's file syntax does not support specifying the password inline.  If you really are using the ftp protocol, then you can use the &lt;code&gt;~/.netrc&lt;/code&gt; file, with basic syntax: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine HOST login USER password PASS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;described in more detail &lt;a href=&quot;http://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-File.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.  One detail is that it is important to set the permissions on the &lt;code&gt;~/.netrc&lt;/code&gt; file to not be world readable (e.g., &lt;code&gt;chmod o-r ~/.netrc&lt;/code&gt;), otherwise emacs will refuse to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, with the following line in your &lt;code&gt;~/.netrc&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine ftp.gnu.org login anonymous password my.email@whatever.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can use a link such as &lt;code&gt;[[file:/ftp:ftp.gnu.org:/gnu/emacs/]]&lt;/code&gt;, which would take you to a dired buffer of the emacs source tarballs. &lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2015-01-13T18:02:19.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7340" PostTypeId="1" AcceptedAnswerId="7343" CreationDate="2015-01-13T18:15:09.820" Score="3" ViewCount="1307" Body="&lt;p&gt;I am looking for an easy way to turn a list such as this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;one,&#xA;two,&#xA;three,&#xA;four,&#xA;five,&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into something more like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;one,      two,      three,   four,&#xA;five,     six,      seven,   eight,&#xA;nine,     ten,      eleven,  twelve,&#xA;thirteen, fourteen, fifteen, sixteen,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems relatively straight-forward to do &quot;column-major&quot; reshaping by using rectangles, but more often than not it is the &quot;row-major&quot; reshaping that I want, since many programming languages accept a list in this format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a big fan of the &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;multiple-cursors&lt;/a&gt; package, so I would gladly accept an answer which presents a clever usage of mc features. That is not a requirement though.  I find that multiple-cursors can get a bit laggy after &gt;100 cursors, so there may be better ways to reshape a list when the list is long anyway.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2015-01-14T19:39:29.743" Title="Reshape a list into rows" Tags="|text-editing|multiple-cursors|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7341" PostTypeId="1" AcceptedAnswerId="7383" CreationDate="2015-01-13T18:18:54.683" Score="4" ViewCount="1067" Body="&lt;p&gt;The title says it all, and I've included the relevant sections of my file below.  I'm  trying to create a src block that uses some functionality of the boost libraries, the first src block sets up the compiler, including the libraries to link to.  The second src block is just a test function, but it quits with a linker error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src elisp :exports results&#xA;   (setq org-babel-C++-compiler&#xA;       (concat &quot;g++ -std=c++0x&quot;&#xA;               &quot; -lboost_system -lboost_filesystem&quot;&#xA;               &quot; -I&quot;&#xA;               (expand-file-name &quot;.&quot;)&#xA;       )&#xA;   )&#xA;#+end_src&#xA;&#xA;&#xA;#+begin_src C++ :exports both :includes (list &quot;\&quot;boost/filesystem.hpp\&quot;&quot; &quot;&amp;lt;stdio.h&amp;gt;&quot;)&#xA; printf(&quot;testing\n&quot;);&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;/tmp/ccvz9bRM.o: In function &lt;code&gt;__static_initialization_and_destruction_0(int, int)':&#xA;  C-src-2374gem.cpp:(.text+0x51): undefined reference to&lt;/code&gt;boost::system::generic_category()'&#xA;  C-src-2374gem.cpp:(.text+0x5d): undefined reference to &lt;code&gt;boost::system::generic_category()'&#xA;  C-src-2374gem.cpp:(.text+0x69): undefined reference to&lt;/code&gt;boost::system::system_category()'&#xA;  collect2: error: ld returned 1 exit status&#xA;  /bin/bash: /tmp/babel-2374l5F/C-bin-2374tos: No such file or directory&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2019-01-01T12:24:59.100" Title="Linking to c++ libraries in babel code block" Tags="|org-babel|c++|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7342" PostTypeId="2" ParentId="7340" CreationDate="2015-01-13T18:29:57.927" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;set-fill-column&lt;/code&gt; as desired.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-q&lt;/kbd&gt;: &lt;code&gt;fill-paragraph&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;align-cols&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The code for &lt;code&gt;align-cols&lt;/code&gt; is &lt;a href=&quot;http://www.emacswiki.org/emacs/align.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-01-13T18:57:20.927" LastActivityDate="2015-01-13T18:57:20.927" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7343" PostTypeId="2" ParentId="7340" CreationDate="2015-01-13T18:55:26.523" Score="1" Body="&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This solution is derived from the below discussion. The only difference is to not manually insert spaces and use an alternative regex for alignment with does not need spaces and also works with text that has spaces in it.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Re-ordering: &lt;code&gt;M-&amp;lt;&lt;/code&gt; &lt;code&gt;F3&lt;/code&gt; &lt;code&gt;C-u M-^&lt;/code&gt; &lt;code&gt;C-x z z&lt;/code&gt; &lt;code&gt;C-n&lt;/code&gt; &lt;code&gt;F4&lt;/code&gt; &lt;code&gt;M-0 F4&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select whole buffer: &lt;code&gt;C-x h&lt;/code&gt;   &lt;/li&gt;&#xA;&lt;li&gt;Align&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u M-x align-regexp&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Replace&lt;/strong&gt; the content in the minibuffer with &lt;code&gt;,\(\)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;y&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Result&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&#xA;one,       two,       three,    four,    &#xA;five,      six,       seven,    eight,   &#xA;nine,      ten,       eleven,   twelve,  &#xA;thirteen,  fourteen,  fifteen,  sixteen,  &#xA;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Discussion&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x beginning-of-buffer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x start-kbd-macro&lt;/code&gt; -- Start recording macro&lt;/li&gt;&#xA;&lt;li&gt;Do below 3 times&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u M-x join-line&lt;/code&gt; (&lt;em&gt;I have this bound to &lt;code&gt;C-j&lt;/code&gt; for my convenience&lt;/em&gt;) &lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;kbd&gt;SPACE&lt;/kbd&gt; -- Enter a space character which will later help with alignment. &lt;em&gt;This is required only in &lt;code&gt;emacs-elisp-mode&lt;/code&gt;. But even if this space is added regardless, this solution will still work.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x next-line&lt;/code&gt; (&lt;code&gt;C-n&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x kmacro-end-or-call-macro&lt;/code&gt; -- Stop recording macro&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-0 C-x e&lt;/code&gt; -- Run the macro till the end of buffer is reached. (&lt;a href=&quot;https://stackoverflow.com/a/7541112/1219634&quot;&gt;ref&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x mark-whole-buffer&lt;/code&gt; (&lt;code&gt;C-x h&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u M-x align-regexp&lt;/code&gt; -&gt; &lt;kbd&gt;SPACE&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, &lt;kbd&gt;RET&lt;/kbd&gt;, &lt;kbd&gt;RET&lt;/kbd&gt;, &lt;kbd&gt;y&lt;/kbd&gt; -- Do the regex align by Space character for all columns. &lt;em&gt;Note that if you use &lt;code&gt;,&lt;/code&gt; instead of &lt;kbd&gt;SPACE&lt;/kbd&gt;, you can align content having the space characters too.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Explanation about when it is required to add that extra space in Step 3 above&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;fixup-whitespace&lt;/code&gt; called in &lt;code&gt;delete-indentation&lt;/code&gt; function (which &lt;code&gt;join-line&lt;/code&gt; aliases to) is responsible for adding that space automatically for major-modes not equal to &lt;code&gt;emacs-lisp-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is the following line in &lt;code&gt;fixup-whitespace&lt;/code&gt; function (in &lt;code&gt;simple.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(looking-at &quot;$\\|\\s(\\|\\s'&quot;))`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If this expression is true, space is NOT inserted after finishing the join operation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That  expression is true when any one of these is true:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if the point is at the end of line &lt;/li&gt;&#xA;&lt;li&gt;if the current character is an open parenthesis char as defined in the major-mode's &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;syntax table&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;if the current character is an &lt;strong&gt;expression prefix&lt;/strong&gt; as defined in the major-mode's &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;syntax table&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And ... &lt;code&gt;'&lt;/code&gt;, &lt;code&gt;,&lt;/code&gt; and &lt;code&gt;#&lt;/code&gt; are counted as expression prefixes in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;. At the end of joining operation, the point is on the &lt;code&gt;,&lt;/code&gt; character at the end of the line (e.g.  &lt;code&gt;one,&lt;/code&gt; or &lt;code&gt;two,&lt;/code&gt; or &lt;code&gt;three,&lt;/code&gt;) and so the above &lt;code&gt;looking-at&lt;/code&gt; expression becomes true when the major mode is &lt;code&gt;emacs-lisp-mode&lt;/code&gt;; and thus the need to add that extra space manually in Step 3 for this mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Of course you don't have to worry about the space not being auto inserted if alignment is done at comma instead of space character in Step 8.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-14T19:39:29.743" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7344" PostTypeId="1" CreationDate="2015-01-13T18:56:02.743" Score="6" ViewCount="322" Body="&lt;p&gt;I am debugging a very deep call stack. Unfortunately profiler reports (produced with &lt;code&gt;M-x profiler-report&lt;/code&gt;) have a fixed width that obscures critical information when the stack gets deep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RZpPY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can give myself some extra room?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2019-06-15T14:03:35.400" Title="Make profiler report columns wider" Tags="|profiler|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7345" PostTypeId="2" ParentId="7295" CreationDate="2015-01-13T19:31:56.353" Score="1" Body="&lt;p&gt;This is a bug in Emacs source &lt;code&gt;startup.el&lt;/code&gt; and has already been fixed for the next release of Emacs.. See &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19584&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19584&lt;/a&gt; for more details..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-13T19:31:56.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7346" PostTypeId="2" ParentId="5571" CreationDate="2015-01-13T19:56:58.320" Score="8" Body="&lt;p&gt;With a lot of hacky experimentation I was able to get #6 (using minibuffer text) to a 'good enough' working state. Here's a screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QQTl4.png&quot; alt=&quot;Screenshot of belt in action&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several key parts to make this work:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Inserting text into the minibuffer surprisingly almost does the right thing out of the box. Text inserted there will actually show up.&lt;/li&gt;&#xA;&lt;li&gt;By making the text be the 'after-string of an overlay instead of regular text you make it unselectable and don't have to worry about the cursor accidentally getting in it.&lt;/li&gt;&#xA;&lt;li&gt;To make minibuffer prompting commands work correctly, you have to inhibit inserting the text/overlay when the minibuffer window is active.&lt;/li&gt;&#xA;&lt;li&gt;If you try to resize the minibuffer with normal window resize functions you will get errors about windows being too small, if you use the undocumented md-resize-minibuf function then you can resize to the exact number of lines you want, as long as you have set resize-mini-windows to nil first.&lt;/li&gt;&#xA;&lt;li&gt;To solve the lists disappearing whenever there is a message you have to advise the message function to intercept messages. Then you insert them into the minibuffer yourself. You also have to look at the current-message variable, which stores whatever last showed up in the echo area (surprisingly the echo area and the minibuffer are technically distinct and some C source code functions print directly to the echo area without going through the message function). The code I provide below for this is imperfect, messages persist longer than they normally would which I still need to investigate (checking the last entry in *Messages* may be simpler and more robust) but this is 'good enough' for now.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's a link to my implementation with an example belt displaying the kill ring. Eventually this will be part of a proper project: &lt;a href=&quot;https://gist.github.com/jgarvin/ce37d08654978fd7e4c9&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/jgarvin/ce37d08654978fd7e4c9&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my first time writing any significant quantity of elisp so quality is probably subpar, but it works.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2015-12-21T18:58:21.633" LastActivityDate="2015-12-21T18:58:21.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7347" PostTypeId="1" AcceptedAnswerId="7351" CreationDate="2015-01-13T20:10:21.510" Score="6" ViewCount="1032" Body="&lt;p&gt;When I have Emacs (24.4, Mac OS, NS build) in the foreground, I often have many windows open in one frame. I sometimes want to switch windows by clicking in an inactive window. By default, this calls &lt;code&gt;mouse-set-point&lt;/code&gt; which (1) activates the window I clicked in, and (2) repositions the point to wherever I clicked. I want to change this behavior so clicking in an inactive window would only activate it, but not move the cursor. If I'm in an active window, I want it to reposition the cursor to wherever I clicked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any reasonable way built into Emacs to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1:&lt;/strong&gt; I just tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice mouse-set-point (around cv/mouse-set-point (event) activate)&#xA;  (let ((event-target-window (caadr event)))&#xA;    (if (eql event-target-window (frame-selected-window))&#xA;        ad-do-it&#xA;      (set-frame-selected-window nil event-target-window))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That doesn't work because &lt;code&gt;mouse-set-point&lt;/code&gt; seems to fire in the new window to position itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; Updated attempt:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice mouse-set-point (around cv/mouse-set-point (event) activate)&#xA;  (let ((event-name (car event))&#xA;        (event-target-window (caadr event)))&#xA;    (if (and (eql 'down-mouse-1 event-name)&#xA;             (eql event-target-window (frame-selected-window)))&#xA;        ad-do-it&#xA;      (set-frame-selected-window nil event-target-window))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not work in a weird way. When I click above the cursor position in the inactive window, it does what I want. When I click below the cursor position the inactive window, it moves the cursor. Two events fire consistently: &lt;code&gt;down-mouse-1&lt;/code&gt; and then &lt;code&gt;mouse-1&lt;/code&gt;. Both call &lt;code&gt;mouse-set-point&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 3:&lt;/strong&gt; Replacing &lt;code&gt;mouse-set-point&lt;/code&gt; does work, provided I also unset &lt;code&gt;[down-mouse-1]&lt;/code&gt; (normally bound to &lt;code&gt;mouse-drag-region&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mouse-set-point-2 (event)&#xA;  (interactive &quot;e&quot;)&#xA;  (mouse-minibuffer-check event)&#xA;  (let ((event-target-window (caadr event)))&#xA;    (if (eql event-target-window (frame-selected-window))&#xA;        (posn-set-point (event-end event))&#xA;      (set-frame-selected-window nil event-target-window))))&#xA;&#xA;(global-set-key [mouse-1] 'mouse-set-point-2)&#xA;&#xA;(global-unset-key [down-mouse-1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not good enough, I don't want to lose drag-selection with the mouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 4:&lt;/strong&gt; Adding advice to both &lt;code&gt;mouse-set-point&lt;/code&gt; and &lt;code&gt;mouse-drag-region&lt;/code&gt; seems to work.&lt;/p&gt;&#xA;" OwnerUserId="5185" LastEditorUserId="675" LastEditDate="2015-06-02T00:22:02.120" LastActivityDate="2018-04-12T12:41:36.460" Title="Preventing mouse clicks in inactive windows from repositioning the cursor" Tags="|window|mouse|navigation|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7349" PostTypeId="2" ParentId="7340" CreationDate="2015-01-13T21:45:47.737" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;Mark the region&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;M-|&lt;/kbd&gt; &lt;code&gt;column -x&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;or &lt;code&gt;column -x -c N&lt;/code&gt; for lines of (up to) N characters in length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;column&lt;/code&gt; is a BSD-derived shell command, which you quite likely have if you're on a Unix-like OS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;-x&lt;/code&gt; argument gives the &quot;row-major&quot; output that you wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;column -x -c 70&lt;/code&gt; gives you the exact number of rows and columns that you showed in the question:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;one,        two,        three,      four,&#xA;five,       six,        seven,      eight,&#xA;nine,       ten,        eleven,     twelve,&#xA;thirteen,   fourteen,   fifteen,    sixteen,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't see a way to specify the minimum spacing between columns, but the main problem with this is that the tab width used by &lt;code&gt;column&lt;/code&gt; might not match your &lt;code&gt;tab-width&lt;/code&gt; in Emacs, which might give you some wonky-looking output (even though it's formatted nicely for some other value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, once you have the basic arrangement of rows and columns, you can use &lt;code&gt;align-regexp&lt;/code&gt; to tidy up if necessary:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;align-regexp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pattern would be: &lt;code&gt;,\(\s-*\)&lt;/code&gt; (i.e. prefix a comma to the default pattern). The next two options are default, and then say &quot;Yes&quot; to &quot;Repeat throughout the line&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. I believe you're going to run into trouble with some of the other answers as soon as your data contains spaces, which is why I think using a tool (&lt;code&gt;column&lt;/code&gt;) already designed for this task is sensible, and why I recommend using the commas for alignment if you use &lt;code&gt;align-regexp&lt;/code&gt;, rather than spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that when &lt;code&gt;indent-tabs-mode&lt;/code&gt; is non-nil, &lt;code&gt;align-regexp&lt;/code&gt; will insert tabs for alignment. You can either &lt;code&gt;untabify&lt;/code&gt; to convert them to spaces, or use &lt;a href=&quot;https://stackoverflow.com/a/8129994/324105&quot;&gt;https://stackoverflow.com/a/8129994/324105&lt;/a&gt; to prevent it from happening.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-14T01:27:23.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7350" PostTypeId="2" ParentId="7337" CreationDate="2015-01-13T21:50:46.333" Score="8" Body="&lt;p&gt;The &lt;code&gt;trunk&lt;/code&gt; of Emacs' git repository will be released as Emacs 25.1, whenever it is ready. But there is also a branch in git called &lt;code&gt;emacs-24&lt;/code&gt;, which gets bug solutions. This might (or might not, who knows) end up in Emacs 24.5. Commits to &lt;code&gt;emacs-24&lt;/code&gt; are merged to &lt;code&gt;trunk&lt;/code&gt; from time to time.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-01-13T21:50:46.333" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7351" PostTypeId="2" ParentId="7347" CreationDate="2015-01-13T22:04:31.147" Score="5" Body="&lt;p&gt;The following advice achieves the behavior I want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice mouse-set-point (around cv/mouse-set-point (event) activate)&#xA;  (let ((event-name (car event))&#xA;        (event-target-window (posn-window (event-start event))))&#xA;    (if (and (eql 'down-mouse-1 event-name)&#xA;             (eql event-target-window (selected-window)))&#xA;        ad-do-it&#xA;      (select-window event-target-window))))&#xA;&#xA;(defadvice mouse-drag-region (around cv/mouse-drag-region (event) activate)&#xA;  (let ((event-target-window (posn-window (event-start event))))&#xA;    (if (eql event-target-window (selected-window))&#xA;        ad-do-it&#xA;      (select-window event-target-window))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5185" LastEditorUserId="1979" LastEditDate="2018-04-12T12:41:36.460" LastActivityDate="2018-04-12T12:41:36.460" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7352" PostTypeId="2" ParentId="7340" CreationDate="2015-01-13T22:35:03.457" Score="3" Body="&lt;p&gt;I too love multiple cursors, but for this one I'd use keyboard macros.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;F3 C-3 C-n M-^ M-^ M-^ C-n C-0 F4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which means:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start kbd macro.&lt;/li&gt;&#xA;&lt;li&gt;Move down 3 lines.&lt;/li&gt;&#xA;&lt;li&gt;Join 3 lines up.&lt;/li&gt;&#xA;&lt;li&gt;Move to next line.&lt;/li&gt;&#xA;&lt;li&gt;Finish and repeat kbd macro indefinitely.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can then proceed to use &lt;code&gt;align-regexp&lt;/code&gt; like the other answers explain.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-13T22:35:03.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7353" PostTypeId="2" ParentId="7321" CreationDate="2015-01-13T23:52:28.257" Score="4" Body="&lt;p&gt;&lt;code&gt;erlang-mode&lt;/code&gt; probably doesn't inherit &lt;code&gt;prog-mode-abbrev-table&lt;/code&gt; correctly, so any abbrevs you create for prog-mode won't work. Fix like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load erlang-mode&#xA;  (abbrev-table-put erlang-abbrev-table&#xA;                    :parents (list prog-mode-abbrev-table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This bug is shared by &lt;code&gt;python-mode&lt;/code&gt; and &lt;code&gt;lisp-mode&lt;/code&gt;, and they ship with Emacs!&lt;/p&gt;&#xA;" OwnerUserId="5186" LastActivityDate="2015-01-13T23:52:28.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7354" PostTypeId="1" AcceptedAnswerId="7376" CreationDate="2015-01-14T00:25:23.173" Score="12" ViewCount="606" Body="&lt;p&gt;I'm writing an emacs extension for use with speech recognition, and I'm looking for help with a particular feature. Some words the speech recognizer (Dragon) recognizes consistently poorly -- it doesn't matter how many times you train it, it will just suck at recognizing certain words. At the same time usually when you're writing on a topic or when coding you'll be using a lot of the same words over and over again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I've written a mode that uses overlays to change how words are rendered in the buffer. It takes a random letter in the word, underlines it in a random color, and puts a random diacritical mark (accent, umlaut, etc.) over the top of it. Here's a screenshot (you will probably need to zoom to see marks/underlines):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dXtdz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can say, &quot;purple p hair&quot; and it will look for the word with a purple underline under its 'a' with a diacritical mark that looks like hair and type that word for you. So in the above screenshot saying that would cause emacs to type &quot;regexp-quote&quot; for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is this lets you refer to any word you've already used that's onscreen using a finite set of words the recognizer is consistently good at recognizing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works pretty well, except occasionally there is a collision. To make it so I can learn to consistently refer to words the same way I'm using bytes from the md5 hash of the word instead of &lt;code&gt;(random)&lt;/code&gt; or having an algorithm assign the changes such that collisions are avoided. I've only found 6 easily distinguishable colors (it's hard when the underline is only one character wide and a single pixel thick) and 3 easily distinguishable diacritical marks (easy to tell apart from one another and also not confusable with an underline on the above line or overlapping with the underline), seen at the top of the source above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need more ways to alter rendering in order to reduce the collision frequency. Ideally a rendering modification would:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Not be jarring from the rest of the text. This has lead me to dismiss for example the inverse-video property.&lt;/li&gt;&#xA;&lt;li&gt;Not be easily confusable with other changes. Overlines are easily mistaken for underlines on the previous line. Lots of diacritical marks look similar unless your font size is impractically huge.&lt;/li&gt;&#xA;&lt;li&gt;Be spatially near where the other changes are. Right now once my eye finds the targeting character all the information is there, the marker, the underline, and the letter.&lt;/li&gt;&#xA;&lt;li&gt;Work nicely with a fixed width font (needed for coding) that correctly renders diacritical marks (I had to switch to DejaVu Sans Mono from Consolas in order to have the marks render correctly)&lt;/li&gt;&#xA;&lt;li&gt;Work on latin alphabet letters. There are arabic combining marks for example, but they don't combine on latin alphabet characters.&lt;/li&gt;&#xA;&lt;li&gt;Not change letter color, since that's already being used for syntax highlighting.&lt;/li&gt;&#xA;&lt;li&gt;Actually be doable in emacs with emacs lisp ;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Maybe there are special unicode characters controlling rendering that could be abused to open up new possibilities? Or a way to thicken underlines so I might be able to easily distinguish more colors? Or some other obscure emacs feature letting you render marks on top of characters besides unicode?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-02-26T18:46:46.063" Title="Ways to unobtrusively vary text rendering?" Tags="|elisp|text-properties|colors|unicode|overlays|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7355" PostTypeId="2" ParentId="7354" CreationDate="2015-01-14T04:16:15.737" Score="1" Body="&lt;p&gt;Interesting question.  I'm betting you'll get some interesting suggestions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One minor suggestion that occurs to me is to use different colors and styles for underlining.  See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Face Attributes&lt;/code&gt;&lt;/a&gt; about attribute &lt;code&gt;:underline&lt;/code&gt; and its &lt;code&gt;:color&lt;/code&gt; and &lt;code&gt;:style&lt;/code&gt; components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also experiment with attribute &lt;code&gt;:box&lt;/code&gt; and different line widths and styles for it, but that's perhaps too jarring.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-14T04:16:15.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7356" PostTypeId="2" ParentId="7328" CreationDate="2015-01-14T06:49:04.270" Score="-1" Body="&lt;p&gt;I set firefox as my default browser with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq browse-url-browser-function 'browse-url-generic&#xA;      browse-url-generic-program &quot;firefox&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't test it with &lt;code&gt;eww&lt;/code&gt; because I'm on Emacs 24.3.1 -- but this might work (perhaps with a modification -- since &lt;code&gt;eww&lt;/code&gt; seems to be an emacs package, instead of an external program).&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-01-14T06:49:04.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7357" PostTypeId="2" ParentId="7321" CreationDate="2015-01-14T07:24:29.237" Score="5" Body="&lt;p&gt;In addition to answers given by @erikstokes and @Abbrev, you might want to add the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'erlang-mode 'derived-mode-parent 'prog-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It ensures that &lt;code&gt;(derived-mode-p 'prog-mode)&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt; for Erlang mode. This is useful since there are a number of utilities that are enabled for all modes that inherit from Prog mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a more permanent solution would be to lobby to the Erlang team to replace the old definition of &lt;code&gt;erlang-mode&lt;/code&gt; with the following, more modern version (and drop some of the stuff this provides for free):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (fboundp 'prog-mode)&#xA;    (defmacro erlang-define-derived-mode (mode &amp;amp;rest args)&#xA;      `(define-derived-mode ,mode prog-mode ,@args))&#xA;  (defmacro erlang-define-derived-mode (mode &amp;amp;rest args)&#xA;    `(define-derived-mode ,mode nil ,@args)))&#xA;&#xA;(erlang-define-derived-mode erlang-mode &quot;Erlang&quot;&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Should someone decide to lobby for this, you can say &quot;Anders Lindgren, the author of Erlang mode, suggested this.&quot;)&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2017-01-09T08:52:18.390" LastActivityDate="2017-01-09T08:52:18.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7358" PostTypeId="1" CreationDate="2015-01-14T08:20:12.173" Score="0" ViewCount="69" Body="&lt;p&gt;I am using Emacs 23 under Mac OS X. When I open certain files I get the following error when I try to save them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning: ns-convert-utf8-nfd-to-nfc unsupported under GNUstep.&#xA;&#xA;insert-file-contents: Wrong type argument: char-or-string-p, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sometimes the opening of new files fails with the same message. When I retry opening them, it works. I have no idea how to fix this. In general unicode works fine.&lt;/p&gt;&#xA;" OwnerUserId="2440" LastEditorUserId="11" LastEditDate="2015-02-17T13:22:20.520" LastActivityDate="2015-02-17T13:22:20.520" Title="Strange error probably UTF related" Tags="|osx|unicode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7359" PostTypeId="1" AcceptedAnswerId="7360" CreationDate="2015-01-14T09:20:28.240" Score="17" ViewCount="1889" Body="&lt;p&gt;Most &lt;code&gt;magit&lt;/code&gt; commands are invoked with a single key, which pops up a menu of&#xA;subcommands and switches.  For example, &lt;kbd&gt;P&lt;/kbd&gt; shows &lt;code&gt;P&lt;/code&gt; and &lt;code&gt;t&lt;/code&gt; as subcommands and &lt;code&gt;-f&lt;/code&gt; and &lt;code&gt;-u&lt;/code&gt; as &quot;switches.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hitting the letters for the subcommands invokes them, but how does one invoke&#xA;the switches?  I have a repository with two remotes, and I wanted to push to&#xA;the other remote.  The &lt;code&gt;-u&lt;/code&gt; switch looks like just the thing, but if I type &lt;kbd&gt;P&lt;/kbd&gt; &lt;kbd&gt;-u&lt;/kbd&gt;, the &lt;code&gt;-u&lt;/code&gt; turns red, but Magit does not prompt for the remote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual says nothing about these switches for any of the commands as far as&#xA;I can tell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone explain how these switches are used in general.  I'm not just&#xA;concerned with this particular switch, but with the facility in general.&lt;/p&gt;&#xA;" OwnerUserId="3961" LastEditorUserId="504" LastEditDate="2015-01-14T10:04:28.150" LastActivityDate="2015-01-14T10:23:42.690" Title="How to access command switches in Magit" Tags="|magit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7360" PostTypeId="2" ParentId="7359" CreationDate="2015-01-14T09:40:34.013" Score="13" Body="&lt;p&gt;The way you are enabling the switches is correct, as evidenced by the fact that they &quot;turn red&quot; when you hit &lt;kbd&gt;-&lt;/kbd&gt; followed by a letter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, &lt;code&gt;-u&lt;/code&gt; simply isn't the switch you want. From &lt;code&gt;man git-push&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;-u&lt;/code&gt;, &lt;code&gt;--set-upstream&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For every branch that is up to date or successfully pushed, add &#xA;    upstream (tracking) reference, used by argument-less &lt;code&gt;git-pull&lt;/code&gt;(1)&#xA;    and other commands. For more information, see &lt;code&gt;branch.&amp;lt;name&amp;gt;.merge&lt;/code&gt;&#xA;    in &lt;code&gt;git-config&lt;/code&gt;(1).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So when you push with the &lt;code&gt;-u&lt;/code&gt; switch enabled, you'll see something like this in the &lt;code&gt;*magit-process*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;0 git --no-pager -c core.preloadindex=true push -v origin foo:refs/heads/foo -u&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Pushing to &lt;code&gt;https://example.com/project.git&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Counting objects: 15, done. [...].&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Branch&lt;/strong&gt; &lt;code&gt;foo&lt;/code&gt; &lt;strong&gt;set up to track remote branch&lt;/strong&gt; &lt;code&gt;foo&lt;/code&gt; &lt;strong&gt;from origin.&lt;/strong&gt; [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This tells you that Magit did in fact consider the &lt;code&gt;-u&lt;/code&gt; switch.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As @TuDo points out, to get Magit to prompt you for a remote to push to, you need to hit &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;P P&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Switches and Args&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In general, when dealing with the menus that Magit provides for different commands it is helpful to remember that switches are just that: &lt;em&gt;switches&lt;/em&gt;. You can turn them on and off, and that's it. They don't require you to supply any additional information, so Magit won't prompt you for anything when you turn them on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Args, on the other hand, do require additional information, so when you tell Magit that you want to run a command with a specific arg it will prompt you accordingly. Args also differ from switches in that they are enabled by hitting &lt;kbd&gt;=&lt;/kbd&gt; followed by a letter.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-14T10:23:42.690" LastActivityDate="2015-01-14T10:23:42.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7361" PostTypeId="1" CreationDate="2015-01-14T10:07:32.053" Score="20" ViewCount="6335" Body="&lt;p&gt;I am dealing with JSON files with multiple repeated blocks with just one field value (integer) changed - in fact, every changed value is just the previous corresponding value incremented. To make such files easy to read, I would like to be able to fold this entire set of repeated blocks into just one block with some indication of what the ranges of the changing value across these blocks is. Searching for code folding methods in Emacs, I found &lt;code&gt;hs-minor-mode&lt;/code&gt; and &lt;code&gt;outline-mode&lt;/code&gt;. However, I don't see how to go from the functionality they provide to the one I desire. Could someone provide a rough overview of how I could achieve this?&lt;/p&gt;&#xA;&lt;p&gt;An example of what I am trying to do:&lt;/p&gt;&#xA;&lt;p&gt;Given a JSON file that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;    &amp;quot;SomeArray&amp;quot;: [&#xA;        {&#xA;        &amp;quot;ChangingField&amp;quot;: 1,&#xA;        &amp;quot;ConstantField&amp;quot; : &amp;quot;X&amp;quot;&#xA;        },&#xA;        {&#xA;        &amp;quot;ChangingField&amp;quot;: 2,&#xA;        &amp;quot;ConstantField&amp;quot; : &amp;quot;X&amp;quot;&#xA;        },&#xA;        {&#xA;        &amp;quot;ChangingField&amp;quot;: 3,&#xA;        &amp;quot;ConstantField&amp;quot; : &amp;quot;X&amp;quot;&#xA;        },&#xA;        {&#xA;        &amp;quot;ChangingField&amp;quot;: 4,&#xA;        &amp;quot;ConstantField&amp;quot; : &amp;quot;X&amp;quot;&#xA;        },&#xA;        {&#xA;        &amp;quot;ChangingField&amp;quot;: 5,&#xA;        &amp;quot;ConstantField&amp;quot; : &amp;quot;X&amp;quot;&#xA;        }&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I would like to have it displayed like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;    &amp;quot;SomeArray&amp;quot;: [&#xA;        {&#xA;        &amp;quot;ChangingField&amp;quot;: 1...5,&#xA;        &amp;quot;ConstantField&amp;quot; : &amp;quot;X&amp;quot;&#xA;        }&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Apologies for the very open-ended question.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2057" LastEditDate="2023-08-22T16:20:02.473" LastActivityDate="2023-08-22T16:20:02.473" Title="Code-folding extensions for JSON" Tags="|code-folding|json|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="7362" PostTypeId="1" AcceptedAnswerId="9411" CreationDate="2015-01-14T11:18:00.300" Score="28" ViewCount="18111" Body="&lt;p&gt;When two buffers are compared for differences, &lt;code&gt;M-x ediff-buffers&lt;/code&gt; does not indicate the specific characters that have changed within a word (ie &quot;character-level&quot; diffs). Most modern diff tools will show the diffs within a word. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs seems to be missing this important (or obviously useful?) feature by default. How can I make Emacs display the diffs by character? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&#xA;Here's &lt;code&gt;M-x ediff-buffers diff1 diff2&lt;/code&gt;, using &lt;code&gt;emacs -Q&lt;/code&gt; to ensure that my theme is not interferring:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/AEsiy.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the same text pasted into Meld:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/xVykV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-01-14T13:27:44.317" LastActivityDate="2015-02-19T18:22:19.197" Title="How to show a diff between two buffers with &quot;character-level&quot; diffs" Tags="|ediff|diff-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7363" PostTypeId="2" ParentId="7362" CreationDate="2015-01-14T11:46:28.147" Score="6" Body="&lt;p&gt;This feature is called &quot;refining&quot; in Ediff.  You can hit &lt;code&gt;*&lt;/code&gt; to refine the current hunk, or &lt;code&gt;@&lt;/code&gt; to turn on automatic refining whenever you move to a different hunk.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-14T11:46:28.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7364" PostTypeId="2" ParentId="7361" CreationDate="2015-01-14T13:03:21.003" Score="9" Body="&lt;p&gt;There are more folding options for Emacs: &lt;a href=&quot;http://wikemacs.org/wiki/Folding#Yafolding&quot; rel=&quot;noreferrer&quot;&gt;http://wikemacs.org/wiki/Folding#Yafolding&lt;/a&gt;&#xA;and Yafolding looks like the best for your case since it is based on indentation. It also includes a nice interface à-la Magit to discover the commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, that doesn't fully answer your question since it won't show the range of the fields out of the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yafolding is in MELPA:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install yafolding&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="739" LastActivityDate="2015-01-14T13:03:21.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7365" PostTypeId="1" AcceptedAnswerId="7367" CreationDate="2015-01-14T13:31:50.390" Score="1" ViewCount="1038" Body="&lt;p&gt;The following setting display the date in Gregorian calendar in the mode line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-time-day-and-date t)&#xA;(display-time)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is how to change the above settings for date to be shown in the Julian calendar?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-01-14T21:45:43.660" Title="How to display date in Julian in the mode line?" Tags="|mode-line|time-date|calendar|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7366" PostTypeId="2" ParentId="7211" CreationDate="2015-01-14T15:03:48.827" Score="16" Body="&lt;p&gt;You can achieve what you want by adding the &lt;code&gt;org-hide-block-all&lt;/code&gt; command to &lt;code&gt;org-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook 'org-hide-block-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For my personal configuration, I've extended this solution a bit:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar org-blocks-hidden nil)&#xA;&#xA;(defun org-toggle-blocks ()&#xA;  (interactive)&#xA;  (if org-blocks-hidden&#xA;      (org-show-block-all)&#xA;    (org-hide-block-all))&#xA;  (setq-local org-blocks-hidden (not org-blocks-hidden)))&#xA;&#xA;(add-hook 'org-mode-hook 'org-toggle-blocks)&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-c t&quot;) 'org-toggle-blocks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place, &lt;code&gt;org-mode&lt;/code&gt; collapses &lt;code&gt;SRC&lt;/code&gt; blocks by default &lt;strong&gt;and&lt;/strong&gt; lets me toggle visibility of all &lt;code&gt;SRC&lt;/code&gt; blocks by hitting &lt;kbd&gt;C-c t&lt;/kbd&gt;. (If you decide to use this code you can of course adapt the key binding to your liking.)&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-01-14T15:03:48.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7367" PostTypeId="2" ParentId="7365" CreationDate="2015-01-14T15:07:35.727" Score="2" Body="&lt;p&gt;You can compute arbitrary date strings by overriding &lt;code&gt;display-time-string-forms&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation says this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List of expressions governing display of the time in the mode line.&#xA;  For most purposes, you can control the time format using&#xA;  `display-time-format' which is a more standard interface.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This expression is a list of expressions that can involve the keywords&#xA;  &lt;code&gt;load&lt;/code&gt;, &lt;code&gt;day&lt;/code&gt;, &lt;code&gt;month&lt;/code&gt;, and &lt;code&gt;year&lt;/code&gt;, &lt;code&gt;12-hours&lt;/code&gt;, &lt;code&gt;24-hours&lt;/code&gt;, &lt;code&gt;minutes&lt;/code&gt;,&#xA;  &lt;code&gt;seconds&lt;/code&gt;, all numbers in string form, and &lt;code&gt;monthname&lt;/code&gt;, &lt;code&gt;dayname&lt;/code&gt;,&#xA;  &lt;code&gt;am-pm&lt;/code&gt;, and &lt;code&gt;time-zone&lt;/code&gt; all alphabetic strings, and &lt;code&gt;mail&lt;/code&gt; a true/nil&#xA;  value.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example, the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((substring year -2) &quot;/&quot; month &quot;/&quot; day&#xA;  &quot; &quot; 24-hours &quot;:&quot; minutes &quot;:&quot; seconds&#xA;  (if time-zone &quot; (&quot;) time-zone (if time-zone &quot;)&quot;)&#xA;  (if mail &quot; Mail&quot; &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;would give mode line times like `94/12/30 21:07:48 (UTC)'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To display the Julian date as provided by &lt;code&gt;calendar&lt;/code&gt; try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'calendar)&#xA;(setq display-time-string-forms&#xA;      '((calendar-julian-date-string)))&#xA;(display-time)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-01-14T21:45:43.660" LastActivityDate="2015-01-14T21:45:43.660" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7368" PostTypeId="1" AcceptedAnswerId="7369" CreationDate="2015-01-14T15:13:50.860" Score="3" ViewCount="944" Body="&lt;p&gt;After a recent update, my Perl files are rendered like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GQL7Y.png&quot; alt=&quot;example of an emacs window showing highlighted whitespace&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that trailing spaces are shown in red and empty lines in yellow. This is happening despite my having the following in my &lt;code&gt;~/.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq cperl-invalid-face nil)&#xA;(setq sp-highlight-pair-overlay nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not seem to be related to anything in my &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; files since renaming them and launching emacs still shows the same behavior. However, the problem is not there if I launch with &lt;code&gt;emacs -Q&lt;/code&gt;. In case they are relevant, here are my &lt;a href=&quot;http://pastebin.com/zp3TAEuC&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;.emacs&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://pastebin.com/XYcRku7J&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;.init.el&lt;/code&gt;&lt;/a&gt; files. Finally, I also tried launching emacs as a different user and had the same issue so it seems to be a site-wide problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the same behavior in Elisp, C and Perl/CPerl modes but not in Fundamental or shell modes. How can I remove this highlighting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running emacs 24.4.1 on Debian.&lt;/p&gt;&#xA;" OwnerUserId="241" LastEditorUserId="241" LastEditDate="2015-01-14T16:36:54.680" LastActivityDate="2018-02-06T16:44:46.150" Title="How can I stop emacs from highlighting whitespace?" Tags="|syntax-highlighting|whitespace|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7369" PostTypeId="2" ParentId="7368" CreationDate="2015-01-14T15:22:51.420" Score="4" Body="&lt;p&gt;You should generally start Emacs with &lt;code&gt;emacs -q&lt;/code&gt; to make sure it's not your configuration.  If that doesn't get rid of it, but &lt;code&gt;emacs -Q&lt;/code&gt; does, chances are it's the way your Emacs was packaged or a site file that's used for every user on your system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally to that you can inspect the faces involved by placing point at the highlighted area and doing &lt;code&gt;M-x describe-char&lt;/code&gt;.  This will tell you what functionality is responsible for the highlighting.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-01-14T16:20:26.330" LastActivityDate="2015-01-14T16:20:26.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7370" PostTypeId="1" AcceptedAnswerId="7427" CreationDate="2015-01-14T15:24:49.060" Score="2" ViewCount="472" Body="&lt;p&gt;I'm trying to get my two-lined eshell prompt working with eshell. It gets displayed alright, and it's also non-readable. But when I call something external, the cursor doesn't jump &quot;down&quot; to the new prompt line, only on internal things. And then hitting return again, it copies the line down - but it copies the full line, not just the actual command.&#xA;My prompt is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun shk-eshell-prompt ()&#xA;(let ()&#xA;  (concat&#xA;   (with-face user-login-name :foreground &quot;blue&quot;)&#xA;   &quot;@&quot;&#xA;   (with-face &quot;localhost&quot; :foreground &quot;green&quot;)&#xA;   (with-face &quot;:&quot; :foreground &quot;green&quot;)&#xA;   (with-face (concat (eshell/pwd) &quot; &quot;) :foreground &quot;green&quot;)&#xA;   (with-face (format-time-string &quot;(%Y-%m-%d %H:%M) &quot; (current-time)) :foreground &quot;#888&quot;)&#xA;   (with-face&#xA;    (or (ignore-errors (format &quot;(%s)&quot; (vc-responsible-backend default-directory))) &quot;&quot;))&#xA;   (with-face &quot;\n&quot;)&#xA;   (if (= (user-uid) 0)&#xA;       (with-face &quot;#&quot; :foreground &quot;red&quot;)&#xA;     &quot;$&quot;)&#xA;   &quot; &quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The regexp is the following, made with &lt;code&gt;regexp-builder&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;[a-zA-Z]+@[a-zA-Z0-9-_]+:[a-zA-Z0-9-_~/]+ [())(0-9a-zA-Z: -]+&#xA;. &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Quotes for clarification that a whitespace is at the end). Now what's wrong with this regexp? Does the eshell have some sort of a special regex syntax?&lt;/p&gt;&#xA;" OwnerUserId="5191" LastActivityDate="2015-01-16T00:29:18.750" Title="Eshell prompt regex" Tags="|eshell|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7371" PostTypeId="1" AcceptedAnswerId="7374" CreationDate="2015-01-14T15:25:34.800" Score="1" ViewCount="1668" Body="&lt;p&gt;This is more or less a question of putting the answer from &lt;a href=&quot;https://emacs.stackexchange.com/questions/2355/make-web-mode-always-indent-with-spaces&quot;&gt;Make web-mode always indent with spaces&lt;/a&gt; into the &lt;code&gt;use-package&lt;/code&gt; declaration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to set tab indent to 2 spaces, and use the spaces throughout the lines, even when reaching 8 spaces etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my effort so far, I've tried both &lt;code&gt;setq&lt;/code&gt; and &lt;code&gt;setq-default&lt;/code&gt;, and I've tried to put the init code in either &lt;code&gt;:config&lt;/code&gt; or &lt;code&gt;:init&lt;/code&gt;, but it's not working. When I &quot;describe variable&quot;, tab-width is always 8 in the &lt;code&gt;.go&lt;/code&gt; file that I'm opening. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package go-mode&#xA;  :mode &quot;\\.go\\'&quot;&#xA;  :config&#xA;  (progn&#xA;    (setq-default tab-width 2)&#xA;    (setq-default indent-tabs-mode nil)&#xA;    ;; tab-width &amp;amp; indent-tabs-mode are both buffer-local so need setq-default&#xA;    )&#xA;&#xA;  :init&#xA;  (progn&#xA;    (setq-default tab-width 2)&#xA;    (setq-default indent-tabs-mode nil)&#xA;    )&#xA;&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-01-14T17:45:51.233" Title="Use spaces instead of tabs with use-package" Tags="|customize|tabs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7372" PostTypeId="1" AcceptedAnswerId="7402" CreationDate="2015-01-14T16:04:53.983" Score="10" ViewCount="1496" Body="&lt;p&gt;I recently read &lt;a href=&quot;http://www.masteringemacs.org/article/running-shells-in-emacs-overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;Running Shells in Emacs&lt;/a&gt;, and spend some time to adapt my elaborate Zsh prompt to work with the limited capabilities of &lt;code&gt;M-x shell&lt;/code&gt; and &lt;code&gt;M-x ansi-term&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following this effort I'm now finally able to use Zsh from within Emacs, however there is an—albeit minor—nuisance with &lt;code&gt;M-x ansi-term&lt;/code&gt;.  I always see the stray text &lt;code&gt;4m&lt;/code&gt; before the prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LcW3A.png&quot; alt=&quot;Stray text before prompt&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, this phenomenon seems to be independent of the actual prompt theme.  It also appears with any of the built-in prompts, even the simple ones that don't use any fancy control characters.  As a matter of fact, it even happens with the default prompt, i.e. if I start Zsh without my &lt;code&gt;.zshrc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, it's really just a minor nuisance, and I wouldn't not really mind if I weren't able to get rid of it—I mostly prefer &lt;code&gt;M-x shell&lt;/code&gt; anyway, where this issue does not occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it really annoys me that I haven't been able to find the cause of this issue, even though I really tried to debug it.  I must say, though, that my understanding of terminals is rather limited, so I might have missed the very obvious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on OS X 10.10.  My Emacs is 25.0.50, build straight from trunk with Homebrew, and no special flags.  Zsh is 5.0.5, as included with Yosemite, but the issue also occurs with 5.0.7 installed via Homebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone shed a light on this issue?&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2017-01-13T09:44:48.340" LastActivityDate="2017-01-13T09:44:48.340" Title="Stray trailing 4m before prompt with Zsh in M-x ansi-term" Tags="|ansi-term|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7373" PostTypeId="2" ParentId="7368" CreationDate="2015-01-14T16:33:32.170" Score="3" Body="&lt;p&gt;The accepted answer is absolutely right. I am posting this to specify which file was the issue for me. After noticing that the problem persisted with &lt;code&gt;emacs -q&lt;/code&gt; but gone with &lt;code&gt;emacs --no-site-file&lt;/code&gt;, I checked the files in &lt;code&gt;/etc/emacs/site-start.d&lt;/code&gt;. After sequentially deleting each of them and launching &lt;code&gt;emacs&lt;/code&gt;, I found that the culprit on my Debian system, running 24.4.1, was &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/etc/emacs/site-start.d/50develock-el.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This file in turn loads &lt;code&gt;/usr/share/emacs24/site-lisp/develock-el/develock.el&lt;/code&gt; and that's where the whitespace highlighting was being set.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I solved it by simply commenting out all lines from &lt;code&gt;/etc/emacs/site-start.d/50develock-el.el&lt;/code&gt;. This is not very elegant and a better way would be to disable the specific features that annoy me in &lt;code&gt;/usr/share/emacs24/site-lisp/develock-el/develock.el&lt;/code&gt; but that is beyond my ken. So far, this brute force approach seems to be working.&lt;/p&gt;&#xA;" OwnerUserId="241" LastActivityDate="2015-01-14T16:33:32.170" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7374" PostTypeId="2" ParentId="7371" CreationDate="2015-01-14T17:45:51.233" Score="2" Body="&lt;p&gt;The most go specific way to do it is using a go-mode-hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your :config add something like &lt;code&gt;(add-hook 'go-mode-hook (lambda () (setq tab-width 2)))&lt;/code&gt; That way you set it for every go buffer you open.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-01-14T17:45:51.233" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7375" PostTypeId="1" AcceptedAnswerId="46372" CreationDate="2015-01-14T17:55:34.260" Score="23" ViewCount="6701" Body="&lt;p&gt;I have a column in an org-mode table with numbers in each cell. I'd like to change the background color of the cell to red if the number is below 1 or above 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="61" LastEditDate="2015-01-24T19:23:30.673" LastActivityDate="2021-07-12T10:01:29.130" Title="Can I format cells in an org-mode table differently depending on a formula?" Tags="|org-table|formatting|formula|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7376" PostTypeId="2" ParentId="7354" CreationDate="2015-01-14T18:25:13.630" Score="4" Body="&lt;p&gt;Another possibility would be to display line numbers and say the line number before the word, or, since looking over to get the exact line number would be bothersome, you could have the algorithm search within + or - 5 or 10 lines of the number you say. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or perhaps declare a region or function that you are working in and have all searches only look there. I would guess that would limit collisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also render unicode symbols after or before a word in a given color to help them stand out. And also box or underline the word in another color. This way you could have 6 word colors * 6 symbol colors * N symbol possibilities. You could probably find 10 good symbols and have 360 combinations. &#xA;For example you could say &quot;blue yellow star&quot; to refer to the word cat here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/DCUX8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the star is too jarring, you could couple :box, and two different :underlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you could refer to the word tree here using &quot;blue yellow red&quot; which would give you 216 combinations to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jFEOk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-01-14T18:25:13.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7377" PostTypeId="1" AcceptedAnswerId="7381" CreationDate="2015-01-14T19:30:38.877" Score="15" ViewCount="1649" Body="&lt;p&gt;I often have to make several substitution of the same string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;%s %s %s&quot; &quot;a&quot; &quot;a&quot; &quot;a&quot;) ;; gives: &quot;a a a&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(it's just a dummy example, in this case it's better to glue &quot;a&quot; with a whitespace, but in general I deal with more complicated situations)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make a named substitution? For example in python one would write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;{0} {0} {0}&quot;.format(&quot;a&quot;) # or:&#xA;&quot;{name} {name} {name}&quot;.format(name=&quot;a&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="105" LastEditDate="2020-11-02T16:30:06.990" LastActivityDate="2021-01-01T12:26:10.473" Title="Named string substitution?" Tags="|format|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7378" PostTypeId="2" ParentId="7377" CreationDate="2015-01-14T20:08:00.017" Score="16" Body="&lt;p&gt;Magnar Sveen's string manipulation library &lt;a href=&quot;https://github.com/magnars/s.el&quot; rel=&quot;noreferrer&quot;&gt;s.el&lt;/a&gt; provides a variety of ways to do this. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 's)&#xA;(s-format &quot;${name} ${name} ${name}&quot; 'aget '((&quot;name&quot; . &quot;test&quot;)))&#xA;;; ==&amp;gt; &quot;test test test&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;s-format&lt;/code&gt; can take any replacer function, but provides special handling for &lt;code&gt;aget&lt;/code&gt;, &lt;code&gt;elt&lt;/code&gt;, and &lt;code&gt;gethash&lt;/code&gt;. So you could use a list of tokens and reference them by index, like so: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(s-format &quot;$0 $0 $0 $1 $1 $1&quot; 'elt '(&quot;a&quot; &quot;b&quot;))&#xA;;; ==&amp;gt; &quot;a a a b b b&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also replace using in-scope variables, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((name &quot;test&quot;))&#xA;  (s-lex-format &quot;${name} ${name} ${name}&quot;))&#xA;;; ==&amp;gt; &quot;test test test&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="115" LastEditDate="2015-05-21T13:34:23.360" LastActivityDate="2015-05-21T13:34:23.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7379" PostTypeId="1" AcceptedAnswerId="7388" CreationDate="2015-01-14T20:27:44.343" Score="1" ViewCount="278" Body="&lt;p&gt;I have set in my ~/.emacs.d/init_bash.sh:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export PS1='\h:\w$ '&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;without it, my prompt is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash-3.2$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but now it is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash-3.2$ computername:~/path/to/directory$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I make it just be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;computername:~/path/to/directory$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastEditorUserId="2421" LastEditDate="2015-01-14T20:39:05.837" LastActivityDate="2015-01-15T00:49:43.180" Title="shell-mode prompt?" Tags="|shell|shell-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7380" PostTypeId="1" CreationDate="2015-01-14T20:52:05.067" Score="2" ViewCount="175" Body="&lt;p&gt;I want to change the reminder/announcement times that &lt;code&gt;appt&lt;/code&gt; uses.  I know I can do things like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq appt-message-warning-time 15)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to start the reminders 15 minutes ahead, but how do I change the interval inbetween?  How to have reminders at 15, 10, 5, and 1 minute(s), for example?&lt;/p&gt;&#xA;" OwnerUserId="891" LastActivityDate="2015-01-14T20:52:05.067" Title="How to change the reminder/announcement times for `appt`?" Tags="|appt|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7381" PostTypeId="2" ParentId="7377" CreationDate="2015-01-14T21:02:17.387" Score="18" Body="&lt;p&gt;Re-writing &lt;a href=&quot;https://emacs.stackexchange.com/a/7127/719&quot;&gt;this answer&lt;/a&gt; gives another solution:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(format-spec &amp;quot;%a %a %a %b %b %b&amp;quot; (format-spec-make ?a &amp;quot;a&amp;quot; ?b &amp;quot;b&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: Another &lt;code&gt;format-spec&lt;/code&gt; solution:&lt;/p&gt;&#xA;&lt;p&gt;As Malabarba gives another solution in comments:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(format-spec &amp;quot;%a %a %a %b %b %b&amp;quot; '((?a . &amp;quot;a&amp;quot;) (?b . &amp;quot;b&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;: Evaluation before substitution:&lt;/p&gt;&#xA;&lt;p&gt;Here are examples with evaluation before substitution:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((a 1)&#xA;      (b 2))&#xA;  (format-spec &amp;quot;a = %a; b = %b&amp;quot; (format-spec-make ?a a ?b b)))&#xA;;; ⇒ &amp;quot;a = 1; b = 2&amp;quot;&#xA;&#xA;(let ((a 1)&#xA;      (b 2))&#xA;  (format-spec &amp;quot;a = %a; b = %b&amp;quot; `((?a . ,a) (?b . ,b))))&#xA;;; ⇒ &amp;quot;a = 1; b = 2&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="15748" LastEditDate="2021-01-01T12:26:10.473" LastActivityDate="2021-01-01T12:26:10.473" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="7382" PostTypeId="2" ParentId="7377" CreationDate="2015-01-14T21:13:19.580" Score="4" Body="&lt;p&gt;Not a general-purpose, but will solve your case:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(apply 'format &quot;%s %s %s&quot; (make-list 3 'a))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using provided example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(apply 'format (concat &quot; * - :raw-html:`&amp;lt;img width=\&quot;100%%\&quot; &quot;&#xA;                       &quot;src=\&quot;http://xxx.xxx/images/languages/&quot;&#xA;                       &quot;staff/%s.jpg\&quot; alt=\&quot;%s.jpg\&quot;/&amp;gt;` - .. _%s:&quot;)&#xA;       (make-list 3 'some-image))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot; * - :raw-html:`&amp;lt;img width=\&quot;100%\&quot; src=\&quot;http://xxx.xxx/images/languages/staff/some-image.jpg\&quot; alt=\&quot;some-image.jpg\&quot;/&amp;gt;` - .. _some-image:&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="115" LastEditDate="2015-05-21T13:36:12.587" LastActivityDate="2015-05-21T13:36:12.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7383" PostTypeId="2" ParentId="7341" CreationDate="2015-01-14T22:18:07.590" Score="0" Body="&lt;p&gt;First off, it's not necessary to use the elisp code included.  The flags property lets compiler flags be passed,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;:flags &quot;-lboost_system -std=c++0x&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, due to the order the flags are passed in it's necessary to do some lisp hacking in order to allow linking.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open the file with the definition of org-babel-C-execute: &lt;kbd&gt; C-h f  &lt;/kbd&gt; org-babel-C-execute, then click on the source file to open it.&lt;/li&gt;&#xA;&lt;li&gt;Switch the last two arguments to format. It should be &lt;code&gt;&#xA;(format &quot;%s -o %s %s %s&quot;&#xA;         (cond&#xA;          ((equal org-babel-c-variant 'c) org-babel-C-compiler)&#xA;          ((equal org-babel-c-variant 'cpp) org-babel-C++-compiler))&#xA;         (org-babel-process-file-name tmp-bin-file)&#xA;         (org-babel-process-file-name tmp-src-file)&#xA;         (mapconcat 'identity&#xA;            (if (listp flags) flags (list flags)) &quot; &quot;)&#xA;         ) &quot;&quot;))))&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Load the new function with &lt;kbd&gt; M-x &lt;/kbd&gt; compile-defun&lt;/li&gt;&#xA;&lt;li&gt;If you had the file byte compiled, recompile the file with byte-compile-file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-01-14T22:18:07.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7384" PostTypeId="1" AcceptedAnswerId="7385" CreationDate="2015-01-14T22:24:24.790" Score="2" ViewCount="254" Body="&lt;p&gt;I'm often obliged to read the documentation before using &lt;code&gt;cdr&lt;/code&gt; and &lt;code&gt;car&lt;/code&gt; functions. Is there pitfalls I should be aware of before aliasing those functions in my init file? Like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'head 'car)&#xA;(defalias 'tail 'cdr)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastEditorUserId="105" LastEditDate="2015-07-11T04:39:38.313" LastActivityDate="2015-07-11T04:39:38.313" Title="Is there some pitfalls if I define aliases for `cdr` and `car` functions?" Tags="|elisp|aliases|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7385" PostTypeId="2" ParentId="7384" CreationDate="2015-01-14T22:34:53.820" Score="13" Body="&lt;p&gt;I'd suggest that you &lt;code&gt;(require 'cl)&lt;/code&gt; and then use &lt;code&gt;first&lt;/code&gt; and &lt;code&gt;rest&lt;/code&gt; instead. They already exist, and are the standard alternative names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also get expanded to the actual &lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt; byte-code at compilation, whereas your custom aliases would not. (Not that you can't &lt;em&gt;make&lt;/em&gt; them -- see the definition of &lt;code&gt;cl--defalias&lt;/code&gt; -- but I think sticking to the standard aliases is a better idea.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-01-14T22:42:46.950" LastActivityDate="2015-01-14T22:42:46.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7386" PostTypeId="2" ParentId="7354" CreationDate="2015-01-14T23:50:08.170" Score="2" Body="&lt;p&gt;Have you heard of &lt;a href=&quot;https://www.youtube.com/watch?feature=player_embedded&amp;amp;v=UZkpmegySnc#!&quot; rel=&quot;nofollow&quot;&gt;ace-jump-mode&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't meet any of the requirements you specify, but it looks like it fits perfectly what you're trying to achieve. It would allow the user to specify any word by saying only 2 or 3 words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define the set of characters it offers you, so you can avoid consonants that are hard to distinguish. Then the use could just say &lt;em&gt;&quot;fix A nine&quot;&lt;/em&gt;, and correct the 9th word that starts with &lt;code&gt;a&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-14T23:50:08.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7387" PostTypeId="2" ParentId="7354" CreationDate="2015-01-14T23:59:07.373" Score="1" Body="&lt;p&gt;I'll answer by proposing an alternative way to select the target word.  Highlight half of the words (randomly chosen).  The user says &quot;yes&quot; if the target word is highlighted and &quot;no&quot; otherwise.  If the user said &quot;yes&quot;, take all words that were highlighted and randomly highlight half of them.  If the user said &quot;no&quot;, randomly highlight the half of the words that were not highlighted.  Again the user indicates whether the target word is highlighted by saying &quot;yes&quot; or &quot;no&quot;.  Repeat that until only the target word is highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some benefits of this approach:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This works, no matter how many words you have on the screen.  &lt;/li&gt;&#xA;&lt;li&gt;You don't need fancy colors, fonts, or symbols.  A monochrome display is enough.&lt;/li&gt;&#xA;&lt;li&gt;Very low cognitive load because it is easy to tell whether a word is highlighted or not.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Drawback: You have to say &quot;yes&quot; and &quot;no&quot; too often.  However, this is fixed by the following variation of the idea: do not highlight the words but use colors for them.  You say you have 6 easily distinguishable colors.  This means that if you have 100 words on the screen, selecting the target word requires naming 2.6 colors on average.  If there are 1000 words, you have to name 3.9 colors on average.&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2015-01-14T23:59:07.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7388" PostTypeId="2" ParentId="7379" CreationDate="2015-01-15T00:49:43.180" Score="1" Body="&lt;p&gt;You're simply seeing the initial prompt, followed by a new one after your script has run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The new prompt should be all you see from that point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try pressing &lt;kbd&gt;RET&lt;/kbd&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-01-15T00:49:43.180" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7389" PostTypeId="1" AcceptedAnswerId="7392" CreationDate="2015-01-15T01:30:22.053" Score="39" ViewCount="21309" Body="&lt;p&gt;I've found that different packages in their installation instructions use either push or add-to-list (For example adding a directory to load-path) and I was wondering what the difference is and what the use case for each would be.&lt;/p&gt;&#xA;" OwnerUserId="4037" LastEditorUserId="105" LastEditDate="2021-11-12T17:27:07.957" LastActivityDate="2021-11-12T17:27:07.957" Title="What's the difference between push and add-to-list?" Tags="|elisp|list|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7390" PostTypeId="2" ParentId="7389" CreationDate="2015-01-15T01:39:18.880" Score="18" Body="&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/List-Variables.html#List-Variables&quot;&gt;Emacs documentation&lt;/a&gt;, or &lt;code&gt;C-h f push&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Macro: push element listname&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This macro creates a new list whose car is element and whose cdr is the list specified by listname, and saves that list in listname.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From the same page, or &lt;code&gt;C-h f add-to-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Function: add-to-list symbol element &amp;amp;optional append compare-fn&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This function sets the variable symbol by consing element onto the old value, if element is not already a member of that value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;add-to-list&lt;/code&gt; only pushes if the element isn't already there.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-01-15T01:39:18.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7391" PostTypeId="1" AcceptedAnswerId="7406" CreationDate="2015-01-15T01:45:08.060" Score="5" ViewCount="1388" Body="&lt;p&gt;I have the following code in the file1.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (get-buffer-create &quot;TestBuffer&quot;)&#xA;  (read-only-mode -1)&#xA;  (erase-buffer)&#xA;  (make-local-variable 'source)&#xA;  (setq source (get-source-language))&#xA;  (my-package-insert text))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the file2.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;TestBuffer&quot;&#xA;  (message &quot;Source: %s&quot; (buffer-local-value 'source (get-buffer &quot;TestBuffer&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First executes the code from file1.el and then from file2.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect that the &lt;code&gt;source&lt;/code&gt; will be retrieved from the buffer &quot;TestBuffer&quot; but I get the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Symbol's value as variable is void: source&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why that happens so? How could I retrieve the variable from the buffer? I can declare that variable by means of &lt;code&gt;defvar&lt;/code&gt; but I don't want to hold temporal variable just for such a little need. Is it possible to avoid additional variable declaration?&lt;/p&gt;&#xA;" OwnerUserId="336" LastActivityDate="2015-01-15T14:19:52.923" Title="How to get an value from a buffer local variable" Tags="|local-variables|buffer-local|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7392" PostTypeId="2" ParentId="7389" CreationDate="2015-01-15T02:31:42.630" Score="29" Body="&lt;p&gt;What #zck mentions is one difference. But if that were the only difference then you could ask about &lt;code&gt;cl-pushnew&lt;/code&gt; and &lt;code&gt;add-to-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another important difference: &lt;code&gt;add-to-list&lt;/code&gt; is a function, which means that it evaluates all of its arguments, in particular, the first one. &lt;code&gt;push&lt;/code&gt; is a macro (as is &lt;code&gt;cl-pushnew&lt;/code&gt;) - it does not evaluate its second argument; instead, it interprets it as a generalized place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the second argument is a symbol then it is regarded as a variable, and the value of the first argument is consed onto the value of that symbol as a variable, and the variable is set to that new cons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the doc string of &lt;code&gt;add-to-list&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is handy to add some elements to configuration variables,&#xA;but please do not abuse it in Elisp code, where you are usually&#xA;better off using `push' or `cl-pushnew'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2019-05-20T02:44:35.043" LastActivityDate="2019-05-20T02:44:35.043" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="7394" PostTypeId="1" AcceptedAnswerId="7401" CreationDate="2015-01-15T05:15:27.027" Score="15" ViewCount="1297" Body="&lt;p&gt;I just wanted to know if Magit has this functionality. The reference &lt;a href=&quot;https://magit.github.io/magit.html&quot;&gt;manual&lt;/a&gt; does not have this explicitly so that's why I am asking.&lt;/p&gt;&#xA;" OwnerUserId="5193" LastActivityDate="2015-07-03T13:21:22.667" Title="Can Magit do git format-patch?" Tags="|magit|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7395" PostTypeId="2" ParentId="7159" CreationDate="2015-01-15T05:18:23.880" Score="2" Body="&lt;p&gt;So I finally restarted my computer, and tried running Emacs with the Unity WM. It ran fine, so I logged out and tried it again in ratpoison. Ran fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No idea what the problem was, or what the solution was. Just commenting to &lt;a href=&quot;http://xkcd.com/979/&quot; rel=&quot;nofollow&quot;&gt;prevent people from wondering what happened&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5127" LastActivityDate="2015-01-15T05:18:23.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7396" PostTypeId="1" AcceptedAnswerId="7397" CreationDate="2015-01-15T05:41:02.310" Score="4" ViewCount="1122" Body="&lt;p&gt;Say I have two functions&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun tmp:a ()&#xA;  (interactive)&#xA;  (tmp:b))&#xA;&#xA;(defun tmp:b ()&#xA;  (message &quot;called from %S&quot; &quot;?&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I call &lt;code&gt;M-x tmp:a&lt;/code&gt;, how can I determine this from &lt;code&gt;tmp:b&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-05-04T17:54:52.227" Title="How can I determine which function was called interactively in the stack?" Tags="|interactive|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7397" PostTypeId="2" ParentId="7396" CreationDate="2015-01-15T06:10:00.310" Score="4" Body="&lt;p&gt;The current interactive command is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;this-command&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That doesn't use the stack (I don't have a good answer for that), but it's the normal mechanism for doing this kind of thing.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-01-15T06:10:00.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7398" PostTypeId="1" AcceptedAnswerId="7400" CreationDate="2015-01-15T07:15:16.573" Score="0" ViewCount="355" Body="&lt;p&gt;I provide &lt;code&gt;web-mode-column-show&lt;/code&gt; in &lt;a href=&quot;http://web-mode.org&quot; rel=&quot;nofollow&quot;&gt;web-mode.el&lt;/a&gt; to display a column that &quot;connects&quot; the start tag and the end tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This column may cross empty lines. In that case I use &lt;code&gt;(move-to-column COL t)&lt;/code&gt; (see the &lt;code&gt;t&lt;/code&gt; arg) to put the overlay at the right column. The problem is that, doing so, I modify the buffer content (I add spaces). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to display an overlay at a specific line/column where no &quot;content&quot; exists ?&lt;/p&gt;&#xA;" OwnerUserId="197" LastActivityDate="2015-01-15T07:43:01.853" Title="overlay and buffer content" Tags="|overlays|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7399" PostTypeId="2" ParentId="7396" CreationDate="2015-01-15T07:33:10.930" Score="1" Body="&lt;p&gt;Here an implementation of phils answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;defun tmp:a ()&#xA;  (interactive)&#xA;  (tmp:b this-command))&#xA;&#xA;&#xA;(defun tmp:b (&amp;amp;optional from-a)&#xA;  (interactive)&#xA;  (if from-a&#xA;      (message &quot;called from %S&quot; from-a)&#xA;    (message &quot;called from %S&quot; this-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-01-15T07:33:10.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7400" PostTypeId="2" ParentId="7398" CreationDate="2015-01-15T07:43:01.853" Score="2" Body="&lt;p&gt;Here is a reprint of the example referred to in the comment above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion&#xA;  (end-of-line)&#xA;  (let ((eol-floating-column (+ (current-column) 10)))&#xA;    (overlay-put (make-overlay (point) (point))&#xA;                 'after-string&#xA;                 (concat&#xA;                  (propertize (char-to-string ?\uE001)&#xA;                              'display&#xA;                              `((space :align-to ,eol-floating-column)&#xA;                                (space :width 0)))&#xA;                  (propertize (char-to-string ?\u00B6)&#xA;                              'face '(:background &quot;gray50&quot; :foreground &quot;black&quot;)&#xA;                              'cursor t) ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-01-15T07:43:01.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7401" PostTypeId="2" ParentId="7394" CreationDate="2015-01-15T08:44:50.500" Score="16" Body="&lt;p&gt;You're right, it doesn't seem to be built in. But note that you can run &lt;em&gt;any&lt;/em&gt; &lt;code&gt;git&lt;/code&gt; subcommand you like from a Magit buffer by pressing &lt;kbd&gt;:&lt;/kbd&gt;, which is bound to &lt;code&gt;magit-git-command&lt;/code&gt; by default:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;magit-git-command&lt;/code&gt; is an interactive autoloaded compiled Lisp function&#xA;  in &lt;code&gt;magit.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(magit-git-command ARGS DIRECTORY)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Execute a Git subcommand asynchronously, displaying the output.&#xA;  With a prefix argument run Git in the root of the current&#xA;  repository.  Non-interactively run Git in &lt;code&gt;DIRECTORY&lt;/code&gt; with &lt;code&gt;ARGS&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So in order to get a patch for, e.g., the latest commit using &lt;code&gt;git format-patch&lt;/code&gt; you can do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;:&lt;/kbd&gt; &lt;code&gt;format-patch -1&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output (displayed in the &lt;code&gt;*magit-process*&lt;/code&gt; buffer) will look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  0 git --no-pager -c core.preloadindex=true format-patch -1&#xA;0001-Commit-message-associated-with-latest-commit.patch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-01-15T08:44:50.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7402" PostTypeId="2" ParentId="7372" CreationDate="2015-01-15T09:51:44.587" Score="10" Body="&lt;p&gt;Apparently this issue is caused by &lt;a href=&quot;https://stackoverflow.com/a/8920373/355252&quot;&gt;missing terminfo for &lt;code&gt;eterm-color&lt;/code&gt;&lt;/a&gt;.  I managed to fix the issue by following the instructions in that answer to install an appropriate entry into the terminfo database.  Specifically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ tic -o ~/.terminfo /usr/local/share/emacs/25.0.50/etc/e/eterm-color.ti&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm still not sure why that is needed at all.  &lt;code&gt;term.el&lt;/code&gt; actually exports the &lt;code&gt;$TERMINFO&lt;/code&gt; variable pointing to that directory, so the shell should be able to find the terminfo.  Zsh seems to ignore the directory, though…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does look at &lt;code&gt;~/.terminfo&lt;/code&gt;, though, so the above command makes the terminfo entry available to Zsh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be glad if anyone could provide a better explanation or a solution that does not require manual intervention.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-01-15T09:51:44.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7403" PostTypeId="1" AcceptedAnswerId="7404" CreationDate="2015-01-15T12:37:15.283" Score="15" ViewCount="6503" Body="&lt;p&gt;Until today, when I was in the normal state in &lt;code&gt;evil&lt;/code&gt;, the cursor was a block, and it would switch to an I-beam when in insert state.  Something changed, however, and the cursor is now always the I-beam.  How can I get the old behavior back?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, how do I change the cursor appearance according to &lt;code&gt;evil&lt;/code&gt;'s different states?&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="253" LastEditDate="2015-01-15T12:56:12.170" LastActivityDate="2015-01-15T12:56:12.170" Title="Evil cursor change by state" Tags="|evil|cursor|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7404" PostTypeId="2" ParentId="7403" CreationDate="2015-01-15T12:53:17.350" Score="17" Body="&lt;p&gt;The variable &lt;code&gt;cursor-type&lt;/code&gt; controls how the appearance of the cursor, defaulting to &lt;code&gt;t&lt;/code&gt;, which uses the cursor specified for the frame (see the docstring for options).  If you'd like the cursor to default to a block, you can &lt;code&gt;(setq cursor-type 'box)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;evil&lt;/code&gt; provides a number of different cursors for the different states, which you can adjust to give you a visual reminder of what state you're in when you're typing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-normal-state-cursor&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-insert-state-cursor&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-visual-state-cursor&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-motion-state-cursor&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-replace-state-cursor&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-operator-state-cursor&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The docstring states that each of these:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;May be a cursor type as per &lt;code&gt;cursor-type&lt;/code&gt;, a color string as passed&#xA;  to &lt;code&gt;set-cursor-color&lt;/code&gt;, a zero-argument function for changing the&#xA;  cursor, or a list of the above.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, for example, if you wanted a yellow bar 5 pixels wide in insert state and a purple-filled box in normal state, you could do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-insert-state-cursor '((bar . 5) &quot;yellow&quot;)&#xA;      evil-normal-state-cursor '(box &quot;purple&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the docstring for &lt;code&gt;cursor-type&lt;/code&gt; for your options in adjusting the cursor.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-15T12:53:17.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7405" PostTypeId="2" ParentId="7396" CreationDate="2015-01-15T14:17:20.593" Score="7" Body="&lt;p&gt;You can look up the stack using the backtrace frames, here is an implementation getting the name of the current function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/2310/can-functions-access-their-name/2312#2312&quot;&gt;Can functions access their name?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code in that question looks up the stack until it finds the frame representing a function call which is the current function, simply continue to move up the backtrace frames until you find the second function call and you'll have your answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the modified code to do just that.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun get-caller-func-name ()&#xA;  &quot;Get the current function' caller function name&quot;&#xA;  (let* ((index 5)&#xA;         (frame (backtrace-frame index))&#xA;         (found 0))&#xA;    (while (not (equal found 2))&#xA;      (setq frame (backtrace-frame (incf index)))&#xA;      (when (equal t (first frame)) (incf found)))&#xA;    (second frame)))&#xA;&#xA;&#xA;;; demo&#xA;(defun function-A ()&#xA;  (print (format &quot;A called from %s&quot; (get-caller-func-name)))&#xA;  (function-B))&#xA;&#xA;(defun function-B ()&#xA;  (print (format &quot;B called from %s&quot; (get-caller-func-name)))&#xA;  (function-C))&#xA;&#xA;(defun function-C ()&#xA;  (print (format &quot;C called from %s&quot; (get-caller-func-name))))&#xA;&#xA;(function-A) &#xA;;; output&#xA;&#xA;&quot;A called from eval&quot;&#xA;&#xA;&quot;B called from function-A&quot;&#xA;&#xA;&quot;C called from function-B&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally you can use &lt;code&gt;backtrace-frame&lt;/code&gt; to get a full list of the current frames. Here is another implementation of that where we can see the call stack in function-C. We can see that it was called from function-B and that was called from function-A all the way up to the interactive command the started the evaluation.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun call-stack ()&#xA;  &quot;Return the current call stack frames.&quot;&#xA;  (let ((frames)&#xA;        (frame)&#xA;        (index 5))&#xA;    (while (setq frame (backtrace-frame index))&#xA;      (push frame frames)&#xA;      (incf index))&#xA;    (remove-if-not 'car frames)))&#xA;&#xA;(defun function-stack ()&#xA;  &quot;Like call-stack but is a list of only the function names&quot;&#xA;  (butlast (mapcar 'cl-second (call-stack))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Demonstration&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun function-A ()&#xA;  (function-B))&#xA;&#xA;(defun function-B ()&#xA;  (function-C))&#xA;&#xA;(defun function-C ()&#xA;  (print (call-stack))&#xA;  (print (function-stack)))&#xA;&#xA;&#xA;;; now we call function A&#xA;(function-A)&#xA;&#xA;;; printed output running with `eval-print-last-sexp` in scratch buffer&#xA;&#xA;((t command-execute eval-print-last-sexp) (t call-interactively eval-print-last-sexp nil nil) (t funcall-interactively eval-print-last-sexp nil) (t eval-print-last-sexp nil) (t eval-last-sexp t) (t eval-last-sexp-1 t) (t eval (function-A) nil) (t function-A) (t function-B) (t function-C))&#xA;&#xA;(command-execute call-interactively funcall-interactively eval-print-last-sexp eval-last-sexp eval-last-sexp-1 eval function-A function-B function-C)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-01-15T14:41:18.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7406" PostTypeId="2" ParentId="7391" CreationDate="2015-01-15T14:19:52.923" Score="3" Body="&lt;p&gt;Sounds like &lt;code&gt;my-package-insert&lt;/code&gt; turns on a major mode. Doing that calls &lt;code&gt;kill-all-local-variables&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can give the variable a non-&lt;code&gt;nil&lt;/code&gt; &lt;code&gt;permanent-local&lt;/code&gt; property to protect it. But we would need more info to be able to suggest whether that is a good idea in your context. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't need the variable to be bound before &lt;code&gt;my-package-insert&lt;/code&gt; then consider binding it afterward.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-15T14:19:52.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7407" PostTypeId="1" CreationDate="2015-01-15T15:35:27.683" Score="3" ViewCount="482" Body="&lt;p&gt;As a devoted Emacs user and a Japanese beginner learner, I've been using the Emacs' Japanese input method quite a lot during recent months. However, I've been looking for a way to leverage Emacs' multilingual capabilities to augment the process of learning kanji signs with their rigid order of strokes.&lt;/p&gt;&#xA;" OwnerUserId="5198" OwnerDisplayName="Wojciech Gac" LastEditorUserId="5198" LastEditDate="2015-01-15T15:44:10.790" LastActivityDate="2015-02-16T09:17:48.053" Title="How to learn the stroke order of a kanji (or kana) character using Emacs" Tags="|minor-mode|learning|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7408" PostTypeId="2" ParentId="7407" CreationDate="2015-01-15T15:42:54.820" Score="5" Body="&lt;p&gt;I spent some time writing an Emacs mode to help discover the stroke order of a kanji sign under the cursor ('at point' in the Emacs jargon). I'd like to share a link to my project with all Emacs users and Emacs user wannabes. It's available &lt;a href=&quot;https://github.com/wsgac/kanji-mode&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; on Github. It makes strong use of the &lt;a href=&quot;http://kanjivg.tagaini.net/&quot; rel=&quot;nofollow&quot;&gt;KanjiVG&lt;/a&gt; project, whose authors have catalogued various (all?) characters and provided SVG diagrams for their respective stroke orders. I hope someone will find this mode useful on their adventure with the Japanese language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;To make its use more convenient I submitted the package to &lt;a href=&quot;http://melpa.org/&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;. It is now officially available via &lt;code&gt;package&lt;/code&gt;. The package's MELPA site can be viewed &lt;a href=&quot;http://melpa.org/#/kanji-mode&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&#xA;Hope this will help people try out this mode.&lt;/p&gt;&#xA;" OwnerUserId="5198" LastEditorUserId="5198" LastEditDate="2015-02-16T09:17:48.053" LastActivityDate="2015-02-16T09:17:48.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7409" PostTypeId="1" AcceptedAnswerId="7411" CreationDate="2015-01-15T15:48:16.810" Score="6" ViewCount="611" Body="&lt;p&gt;Some major modes have code and key-bindings to toggle focus back and forth between their inferior processes and the major-mode buffer. Is there an Emacs function which lets me do this between the current and previous window such that calling the function repeatedly would only switch back between the last two used windows?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2015-01-15T17:03:23.043" LastActivityDate="2020-06-12T05:45:44.083" Title="Is there a generic toggle-previous-window function?" Tags="|window|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7410" PostTypeId="2" ParentId="7409" CreationDate="2015-01-15T16:23:13.253" Score="0" Body="&lt;p&gt;From documentation: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-x o runs the command other-window, which is an interactive compiled&#xA;  Lisp function in `window.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to C-x o.&#xA;                                                                                                                             (other-window COUNT &amp;amp;optional ALL-FRAMES)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Select another window in cyclic ordering of windows. COUNT specifies&#xA;  the number of windows to skip, starting with the selected window,&#xA;  before making the selection.  If COUNT is positive, skip COUNT windows&#xA;  forwards.  If COUNT is negative, skip -COUNT windows backwards.  COUNT&#xA;  zero means do not skip any window, so select the selected window.  In&#xA;  an interactive call, COUNT is the numeric prefix argument.  Return&#xA;  nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, you can call &lt;code&gt;other-window&lt;/code&gt; function with &lt;code&gt;-1&lt;/code&gt; as argument to go to the previous window: &lt;code&gt;C-u - 1&lt;/code&gt; &lt;code&gt;C-x o&lt;/code&gt;. You will probably want a custom shortcut.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-01-15T16:23:13.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7411" PostTypeId="2" ParentId="7409" CreationDate="2015-01-15T17:04:16.097" Score="7" Body="&lt;p&gt;Here's a quick implementation using &lt;code&gt;other-window&lt;/code&gt; and a variable to track the direction.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar last-window-direction 1)&#xA;&#xA;(defun last-window ()&#xA;  (interactive)&#xA;  (other-window last-window-direction)&#xA;  (setq last-window-direction (- 0 last-window-direction)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;REVISED&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a few iterations using hooks to keep track of the last window, I found that Emacs already has the &lt;code&gt;get-mru-window&lt;/code&gt; function for this (of course) . I'm replacing the previous example with this function that works across multiple frames. I have not tested extensively but it seems pretty handy so far. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun switch-to-last-window ()&#xA;  (interactive)&#xA;  (let ((win (get-mru-window t t t)))&#xA;    (unless win (error &quot;Last window not found&quot;))&#xA;    (let ((frame (window-frame win)))&#xA;      (select-frame-set-input-focus frame)&#xA;      (select-window win))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="28604" LastEditDate="2020-06-12T05:45:44.083" LastActivityDate="2020-06-12T05:45:44.083" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="7413" PostTypeId="1" AcceptedAnswerId="7417" CreationDate="2015-01-15T17:56:34.133" Score="16" ViewCount="715" Body="&lt;p&gt;Given the following is intended to generate C++ code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :exports both :results output code&#xA;print &quot;struct Whatever{};&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result is inserted as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_SRC python&#xA;struct Whatever{};&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is clearly not formatted as C++. How could I get it so that org generates the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_SRC c++&#xA;struct Whatever{};&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="3968" LastActivityDate="2015-01-15T18:32:05.920" Title="Generating output in a different language with org mode" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7414" PostTypeId="2" ParentId="5705" CreationDate="2015-01-15T18:09:41.023" Score="0" Body="&lt;p&gt;Short answer: use &lt;code&gt;Konsole&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Explanation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs' &lt;code&gt;local-function-key-map&lt;/code&gt; has an entry mapping &lt;code&gt;C-x @ s&lt;/code&gt; to &lt;code&gt;event-apply-super-modifier&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Konsole&lt;/code&gt; maps &lt;code&gt;Super&lt;/code&gt; (the Windows logo key) to the escape sequence &lt;code&gt;^X@s&lt;/code&gt; (which doesn't seem to be documented anywhere, I discovered it by chance). You can try this by opening &lt;code&gt;Konsole&lt;/code&gt; and pressing e.g. &lt;kbd&gt;Ctrl-v&lt;/kbd&gt; &lt;kbd&gt;Win-o&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="452" LastActivityDate="2015-01-15T18:09:41.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7415" PostTypeId="2" ParentId="7389" CreationDate="2015-01-15T18:22:51.053" Score="21" Body="&lt;p&gt;Another difference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;push&lt;/code&gt; adds &lt;em&gt;element&lt;/em&gt; to the beginning of &lt;em&gt;list&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;add-to-list&lt;/code&gt; allows you to add &lt;em&gt;element&lt;/em&gt; to either the beginning or end of &lt;em&gt;list&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq testasdf nil)&#xA;&#xA;(push 'a testasdf)&#xA;&#xA;testasdf&#xA;(a)&#xA;&#xA;(add-to-list 'testasdf 'b)&#xA;&#xA;testasdf&#xA;(b a)&#xA;&#xA;;; add element to the end&#xA;(add-to-list 'testasdf &quot;hello&quot; t)&#xA;&#xA;testasdf&#xA;(b a &quot;hello&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="920" LastActivityDate="2015-01-15T18:22:51.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7416" PostTypeId="2" ParentId="7377" CreationDate="2015-01-15T18:27:46.153" Score="3" Body="&lt;p&gt;s.el's s-lex-format is really what you want, but if you want to actually be able to put code inside the substitution blocks and not just variable names, I wrote this as a proof of concept.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro fmt (str)&#xA;  &quot;Elisp string interpolation for any expression.&quot;&#xA;  (let ((exprs nil))&#xA;    (with-temp-buffer&#xA;      (insert str)&#xA;      (goto-char 1)&#xA;      (while (re-search-forward &quot;#{&quot; nil t 1)&#xA;        (let ((here (point))&#xA;              (emptyp (eql (char-after) ?})))&#xA;          (unless  emptyp (push (read (buffer-substring (point) (progn (forward-sexp 1) (point)))) exprs))&#xA;          (delete-region (- here 2) (progn (search-forward &quot;}&quot;) (point)))&#xA;          (unless emptyp (insert &quot;%s&quot;))&#xA;          (ignore-errors (forward-char 1))))&#xA;      (append (list 'format (buffer-string)) (reverse exprs)))))&#xA;&#xA;;; demo with variable and code substitution &#xA;(fmt &quot;My name is #{user-full-name}, I am running Emacs #{(if (display-graphic-p) \&quot;with a GUI\&quot; \&quot;in a terminal\&quot;)}.&quot;)&#xA;;; results in&#xA;&quot;My name is Jordon Biondo, I am running Emacs with a GUI.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can even embed an &lt;code&gt;fmt&lt;/code&gt; call inside another &lt;code&gt;fmt&lt;/code&gt; if you're crazy&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(fmt &quot;#{(fmt\&quot;#{(fmt\\\&quot;#{user-full-name}\\\&quot;)}\&quot;)}&quot;)&#xA;;; =&amp;gt;&#xA;&quot;Jordon Biondo&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code just expands to a &lt;code&gt;format&lt;/code&gt; call so all the substitutions are done in order and evaluated at run time.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(cl-prettyexpand '(fmt &quot;Hello, I'm running Emacs #{emacs-version} on a #{system-type} machine with #{(length (window-list))} open windows.&quot;))&#xA;&#xA;;; expands to&#xA;&#xA;(format &quot;Hello, I'm running Emacs %s on a %s machine with %s open windows.&quot;&#xA;        emacs-version&#xA;        system-type&#xA;        (length (window-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Improvements could be made with what format type is used instead of always using %s, but that would have to be done at runtime and would add overhead but could be done by surrounding all the format args in a function call that nicely formats things nicely based on type but really the only scenario where you would want that is probably floats and you could even do a (format &quot;%f&quot; float) in the substitution is you were desperate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I work on it more, I'm more likely to update this gist instead of this answer. &lt;a href=&quot;https://gist.github.com/jordonbiondo/c4e22b4289be130bc59b&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/jordonbiondo/c4e22b4289be130bc59b&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-05-21T13:01:35.573" LastActivityDate="2015-05-21T13:01:35.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7417" PostTypeId="2" ParentId="7413" CreationDate="2015-01-15T18:32:05.920" Score="18" Body="&lt;p&gt;Figured it out:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#BEGIN_SRC python :exports both :results output code :wrap &quot;SRC c++&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3968" LastActivityDate="2015-01-15T18:32:05.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7418" PostTypeId="1" AcceptedAnswerId="7419" CreationDate="2015-01-15T19:06:29.660" Score="5" ViewCount="526" Body="&lt;p&gt;With the way I work, I often just want one window (what's showing my code). Now several things (like opening help) open another window. That's fine, but when I'm finished I just want all windows closed and to return to the original.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often Q will get me out of something, But not every time. I want a consistent shortcut to 'close all but the main window'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;delete-other-windows&lt;/code&gt; is close to what I'm looking for, but I've obnoxiously been focusing the wrong window when utilizing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tag a window (say on startup of a frame, tag the first window), and then close all other windows besides that one? I don't want to think about where I'm currently focused.&lt;/p&gt;&#xA;" OwnerUserId="4090" LastActivityDate="2015-01-16T00:10:32.793" Title="Define a main window and then close all others" Tags="|window|" AnswerCount="4" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7419" PostTypeId="2" ParentId="7418" CreationDate="2015-01-15T20:13:11.267" Score="2" Body="&lt;p&gt;First &lt;strong&gt;rough&lt;/strong&gt; &lt;em&gt;draft&lt;/em&gt;.  &lt;code&gt;set-my-main-buffer&lt;/code&gt; sets the current buffer.  &lt;code&gt;just-my-main-buffer&lt;/code&gt; deletes other windows and switches back to the main buffer if not already selected.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-main-buffer (current-buffer))&#xA;&#xA;(defun set-my-main-buffer ()&#xA;(interactive)&#xA;  (setq my-main-buffer (current-buffer)))&#xA;&#xA;(defun just-my-main-buffer ()&#xA;(interactive)&#xA;  (delete-other-windows)&#xA;  (when (and&#xA;          (buffer-live-p my-main-buffer)&#xA;          (not (eq (current-buffer) my-main-buffer)))&#xA;    (switch-to-buffer my-main-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-01-15T20:18:12.517" LastActivityDate="2015-01-15T20:18:12.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7420" PostTypeId="2" ParentId="7418" CreationDate="2015-01-15T20:35:57.070" Score="2" Body="&lt;p&gt;Here's the code from &lt;a href=&quot;http://oremacs.com/2014/12/20/poyekhali!/&quot; rel=&quot;nofollow&quot;&gt;a post&lt;/a&gt; of mine&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ace-window)&#xA;&#xA;(defun ace-maximize-window ()&#xA;  &quot;Ace maximize window.&quot;&#xA;  (interactive)&#xA;  (setq aw--current-op&#xA;        (lambda (aj)&#xA;          (let ((wnd (aj-position-window aj)))&#xA;            (select-window wnd)&#xA;            (delete-other-windows))))&#xA;  (aw--doit &quot; Ace - Maximize Window&quot;))&#xA;&#xA;(global-set-key (kbd &quot;C-M-o&quot;) 'ace-maximize-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lets you maximize a window that you select with&#xA;&lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;nofollow&quot;&gt;ace-window&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way, the &quot;main window&quot; isn't set in stone and you can select it&#xA;dynamically and then delete all the other ones. This code lets you&#xA;select the &quot;main window&quot; across all frames. You can extend it to&#xA;delete all other frames as well, or just the windows on the selected&#xA;frame.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-15T20:35:57.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7421" PostTypeId="2" ParentId="2720" CreationDate="2015-01-15T20:51:15.667" Score="4" Body="&lt;p&gt;I would insist that Emacs is a tool for &lt;em&gt;professionals&lt;/em&gt; in text editing. And here is why (and what I mean by &lt;em&gt;professional&lt;/em&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, the analogy: Windows Movie Maker and Adobe Premiere are both tools for video editing, but the former is not used by industry professionals to make movies. This argument also avoids superlatives and absolutes, which would often render the admirers of certain technology biased.  Movie Maker isn't worse than Premier in an absolute sense.  It is more suitable for simple video editing of family videos, but Premiere comes with both higher requirements and more features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several definitions of the word &lt;em&gt;professional&lt;/em&gt; one is that of sport (where the opposite is the &lt;em&gt;amateur&lt;/em&gt;) or in craftsmanship, where the opposite is the &lt;em&gt;apprentice&lt;/em&gt;.  So, I don't mean it as in sports, where this definition relates only to whether the sportsmen are paid for their performance, and not to the master-apprentice kind, but to the:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Professional &lt;code&gt;\Pro*fes&quot;sion*al\&lt;/code&gt;, a.&lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;&lt;p&gt;Of or pertaining to a profession, or calling; conforming&#xA;    to the rules or standards of a profession; following a&#xA;    profession; as, professional knowledge; professional&#xA;    conduct. &lt;em&gt;&quot;Pride, not personal, but professional.&quot;&lt;/em&gt;&#xA;    --Macaulay. &lt;em&gt;&quot;A professional sneerer.&quot;&lt;/em&gt; --De Quincey.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[1913 Webster]&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I.e. any person who is required by their trade to be skillful at editing text (which, as has been noticed already, could be a writer, a programmer, a scientist or an engineer) would have chosen this tool as being adequate for their needs.  This, would, for example, also explain &lt;em&gt;why&lt;/em&gt; Emacs is extensible (because any tool for professional text editing would have to be extensible). This also has a potential to answer questions of a shape: &quot;Why if it is so good, not everyone uses it?&quot; - trivial problems don't require expert level tools to solve them.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'd also put a side-note saying that there are only as many as two of the kind :)&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-15T20:51:15.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7422" PostTypeId="2" ParentId="7418" CreationDate="2015-01-15T20:58:20.247" Score="0" Body="&lt;p&gt;You can save the initial window configuration for every newly created frame, then have a function that reverts the frames window configuration the initial one on command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code for your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; this will run for each new frame&#xA;(defun set-frame-initial-layout (&amp;amp;optional frame)&#xA;  &quot;Set the frames 'my-initial-layout parameter to the current window config.&quot;&#xA;  (let ((frame (or frame (selected-frame))))&#xA;    (set-frame-parameter frame 'my-initial-layout (current-window-configuration frame))))&#xA;&#xA;;; add it to the hooks so it runs for each new frame&#xA;(add-hook 'after-make-frame-functions 'set-frame-initial-layout)&#xA;;; run it once at start up for the first frame&#xA;(set-frame-initial-layout)&#xA;&#xA;;; use M-x initial-configuration when to revert the current frames window&#xA;;; configuration to the initial layout it had upon creation&#xA;;; you could also bind this to a key&#xA;(defun initial-configuration ()&#xA;  &quot;Change back the current frames window configuration to it's initial one.&quot;&#xA;  (interactive)&#xA;  (set-window-configuration (frame-parameter nil 'my-initial-layout)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The common use case would be that you create a new frame that shows buffer A, then after a while when you have a bunch of windows open and just want to see buffer A in that frame, you just do M-x initial-configuration and you're back where you were. I think I'll actually add this to my own configuration.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-01-15T20:58:20.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7423" PostTypeId="2" ParentId="2310" CreationDate="2015-01-15T21:07:18.500" Score="8" Body="&lt;p&gt;For interactive functions, i.e., commands, you can use the variable &lt;code&gt;this-command&lt;/code&gt;, or safer, &lt;code&gt;real-this-command&lt;/code&gt;. The difference being that when you write your own functions, you can explicitly change the value of &lt;code&gt;this-command&lt;/code&gt;. Mostly this is done to play tricks with &lt;code&gt;last-command&lt;/code&gt; related to repeating commands. You shouldn't (can't?) do this with &lt;code&gt;real-this-command&lt;/code&gt;. It will always be the name of the current command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not aware of an equivalent for non-interactive functions.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="9198" LastEditDate="2016-06-12T13:51:48.693" LastActivityDate="2016-06-12T13:51:48.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7424" PostTypeId="2" ParentId="7418" CreationDate="2015-01-15T22:03:46.377" Score="0" Body="&lt;p&gt;Ok, the answer from lawlist worked mostly for me, but with multiple frames I had trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Invoking &lt;code&gt;just-my-main-window&lt;/code&gt; deletes all windows besides your main window within your current frame. You can manually mark your main window or add hooks to do so when entering modes (shown below).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mark-this-window-as-main ()&#xA;  &quot;Mark the current window as the main window.&quot;&#xA;  (interactive)&#xA;  (mapc (lambda (win) (set-window-parameter win 'main nil))&#xA;    (window-list))&#xA;  (set-window-parameter nil 'main t))&#xA;&#xA;(defun get-main-window()&#xA;  &quot;Find and return the main window or nil if non exists.&quot;&#xA;  (cl-find-if (lambda (win) (window-parameter win 'main)) (window-list)))&#xA;&#xA;(defun just-my-main-window ()&#xA;  &quot;Show only the main window&quot;&#xA;  (interactive)&#xA;  (delete-other-windows (get-main-window)))&#xA;&#xA;(add-hook 'prog-mode-hook 'mark-this-window-as-main)&#xA;(add-hook 'text-mode-hook 'mark-this-window-as-main)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4090" LastEditorUserId="4090" LastEditDate="2015-01-16T00:10:32.793" LastActivityDate="2015-01-16T00:10:32.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7425" PostTypeId="2" ParentId="2720" CreationDate="2015-01-15T23:26:06.773" Score="2" Body="&lt;p&gt;I would like to give my two cents' worth. First I am not a professional programmer (I am an MD), so I am just an hobbyist or better &lt;em&gt;amateur&lt;/em&gt; in this field, but I am using *nix systems from the time of my University studies (back in the end of 90's). I can tell you the first impression when I had using the Emacs was like some of the worst (esthetically speaking) piece of software I had ever seen. Especially after when Apple started make more appealing OS with a lot of fancy software inside. But after I was telling to myself: look at the kitchen in restaurants, actually they are ugly places. The same we can tell about most of the factory working places. So that's the point: Emacs is giving you &lt;strong&gt;all&lt;/strong&gt; you need for your particular job. As someone else pointed Emacs is a professional tool for this reason. It is not necessarily a program for coding. A lot of people are using (myself included) it for writing papers, books, article... and the list could grow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what I really understand after using it (but we can tell the same about the CLI land in general) is that in Emacs you are &lt;strong&gt;constantly focused on the content&lt;/strong&gt; of what you are writing/reading/coding. &lt;/p&gt;&#xA;" OwnerUserId="5202" LastEditorUserId="2264" LastEditDate="2015-01-15T23:42:23.337" LastActivityDate="2015-01-15T23:42:23.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7426" PostTypeId="2" ParentId="3427" CreationDate="2015-01-16T00:00:00.790" Score="1" Body="&lt;p&gt;Unfortunately there is not a way to do this currently in cider.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One would have to write a custom command to evaluate &lt;code&gt;clojure.tests/run-all-tests&lt;/code&gt; (or &lt;code&gt;clojure.tests/run-tests&lt;/code&gt; with a list of namespaces as arguments).&lt;/p&gt;&#xA;" OwnerUserId="245" LastActivityDate="2015-01-16T00:00:00.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7427" PostTypeId="2" ParentId="7370" CreationDate="2015-01-16T00:29:18.750" Score="2" Body="&lt;p&gt;Ah, it seems like I only have to provide a regexp for the second line! This makes my solution&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;. &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5191" LastActivityDate="2015-01-16T00:29:18.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7428" PostTypeId="1" CreationDate="2015-01-16T03:42:42.017" Score="0" ViewCount="234" Body="&lt;p&gt;Starting dired with &lt;code&gt;M-x dired&lt;/code&gt; and hitting &lt;code&gt;M-x dired-create-directory&lt;/code&gt; I am now in a mini-buffer. Which mode-hook do I use to set a keybinding for the mini-buffer?&lt;/p&gt;&#xA;" OwnerUserId="2808" LastEditorUserId="2808" LastEditDate="2015-01-16T06:23:00.907" LastActivityDate="2015-01-16T06:23:00.907" Title="What's the mode hook for dired's minibuffer?" Tags="|dired|minibuffer|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7429" PostTypeId="1" AcceptedAnswerId="7431" CreationDate="2015-01-16T03:47:16.727" Score="14" ViewCount="5987" Body="&lt;p&gt;this question actually arises because I like to use non-monospaced fonts, (Sabon, Minion, Garamond, etc.) This cause a problem when use org-indent-mode, since the text under the headlines are now not aligned with the headlines. Example:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/OW7nc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The font is Georgia. Now,if I change to consolas:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WwTT3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the problem is that in non-monospaced fonts, the &quot;space&quot; and the * does not take up the same space. Though I do not know how to solve this.&#xA;I've searched the internet and couldn't find a tutorial to fine tune the indentation myself. I've tried to read org-indent.el but it's a long shot for me to understand.&#xA;Help is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="5204" LastActivityDate="2022-07-20T18:59:04.410" Title="How to customize org-mode indentation?" Tags="|indentation|fonts|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7430" PostTypeId="1" AcceptedAnswerId="7485" CreationDate="2015-01-16T04:46:21.693" Score="1" ViewCount="141" Body="&lt;p&gt;Open a scratch buffer, paste the following an evaluate it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert (propertize &quot;hello&quot; 'insert-in-front-hooks&#xA;                    (list (lambda (&amp;amp;rest unused) (message &quot;test&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Typing characters on either side of the resulting &quot;hello&quot; text won't cause the test message to display. &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html&quot; rel=&quot;nofollow&quot;&gt;According to the documentation&lt;/a&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&quot; rel=&quot;nofollow&quot;&gt;it should&lt;/a&gt;, so I assume I'm doing something wrong. What gives? I've also tried &lt;code&gt;'insert-behind-hook&lt;/code&gt; and it doesn't appear to fire either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version 24.4.1. Tested with -Q as well.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-01-21T20:50:41.390" Title="Why don't insert-in-front-hooks run?" Tags="|hooks|text-properties|text|" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7431" PostTypeId="2" ParentId="7429" CreationDate="2015-01-16T05:34:59.373" Score="10" Body="&lt;p&gt;One solution is to modify &lt;code&gt;org-indent-strings&lt;/code&gt; to use stars instead of spaces as the indentation character.  This means that the width of the indentation will always be correct, even when using a proportional font.  The trick then is to set the foreground color of the indentation to be the same as the background color, so that the stars become invisible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can achieve this with the following code, which advises the function &lt;code&gt;org-indent-initialize&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;(defun org-indent-use-stars-for-strings ()&#xA;  &quot;Initialize the indentation strings with stars instead of spaces.&quot;&#xA;  (setq org-indent-strings (make-vector (1+ org-indent-max) nil))&#xA;  (aset org-indent-strings 0 nil)&#xA;  (loop for i from 1 to org-indent-max do&#xA;    (aset org-indent-strings i&#xA;          (org-add-props&#xA;          (concat (make-string (1- i) ?*) ; &amp;lt;- THIS IS THE ONLY CHANGE&#xA;              (char-to-string org-indent-boundary-char))&#xA;          nil 'face 'org-indent))))&#xA;&#xA;(advice-add 'org-indent-initialize :after #'org-indent-use-stars-for-strings)&#xA;(set-face-foreground 'org-indent &quot;white&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result looks like this for me on Mac OS X using &lt;code&gt;emacs -Q&lt;/code&gt; and &lt;code&gt;(set-face-font 'default :family &quot;Gill Sans&quot;)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/nWdm5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2015-01-16T05:34:59.373" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7432" PostTypeId="1" AcceptedAnswerId="62523" CreationDate="2015-01-16T07:02:28.830" Score="38" ViewCount="5409" Body="&lt;p&gt;&lt;code&gt;visual-line-mode&lt;/code&gt; is very useful to wrap lines with the window size changing without inserting any newlines. But in &lt;code&gt;org-mode&lt;/code&gt;, it also wraps the headline and source blocks which is a little bit annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here comes my question:&#xA;&lt;strong&gt;How can I turn off visual-line-mode for org-heading and source blocks permanently in org-mode?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2710" LastEditDate="2015-05-15T12:01:42.733" LastActivityDate="2020-12-30T03:34:03.763" Title="Make visual-line-mode more compatible with org-mode" Tags="|org-mode|line-break|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7433" PostTypeId="1" CreationDate="2015-01-16T07:54:48.467" Score="1" ViewCount="263" Body="&lt;p&gt;I have installed paredit &amp;amp; need to turnoff smartparens. I checked &lt;a href=&quot;https://emacs.stackexchange.com/questions/3779/how-do-i-turn-off-smartparens-when-using-prelude&quot;&gt;this answer&lt;/a&gt; and  I have added &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add #'smartparens-mode :before-until (lambda (&amp;amp;rest args) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my prelude starter kit. Now when I restart emacs I get this error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: advice-add&#xA;&#xA;To ensure normal operation, you should investigate and remove the cause of the error in your initialization file.  Start Emacs with the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When i run emacs with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I dont get any errors or backtrace. It starts normally &amp;amp; everything is working fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when i start emacs directly same error occurs. Can someone tell me how to debug this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: &lt;a href=&quot;http://github.com/chillaranand/.emacs.d/&quot; rel=&quot;nofollow noreferrer&quot;&gt;my emacs config&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-07-28T12:08:27.367" Title="Unable to get backtrace for error" Tags="|debugging|emacs24.4|smartparens|prelude|paredit|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7434" PostTypeId="1" AcceptedAnswerId="7437" CreationDate="2015-01-16T08:22:27.693" Score="4" ViewCount="243" Body="&lt;p&gt;I have to work on multiple different machines and it would be nice to keep my .emacs file consistent everywhere. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: is there a package which allows to update the file at startup from a remote  location such as github or via ssh?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastActivityDate="2015-01-16T16:52:05.093" Title="Fetch configuration from remote (e.g. Github) at startup" Tags="|ssh|remote|github|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7435" PostTypeId="1" AcceptedAnswerId="7449" CreationDate="2015-01-16T09:01:11.640" Score="4" ViewCount="727" Body="&lt;p&gt;Is it possible to automatically capitalise &lt;code&gt;i&lt;/code&gt; when writing in org-mode?  I have to manually search all &lt;code&gt;i&lt;/code&gt; and replaced it with &lt;code&gt;I&lt;/code&gt;, before exporting to PDF. I want to do this only for the English word &lt;code&gt;I&lt;/code&gt;, not occurrences of the letter &lt;code&gt;i&lt;/code&gt; that may appear within words.&lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="675" LastEditDate="2016-07-13T02:29:00.147" LastActivityDate="2016-07-13T02:29:35.447" Title="Automatically Capitalise i to I" Tags="|org-mode|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7436" PostTypeId="2" ParentId="7435" CreationDate="2015-01-16T10:00:08.630" Score="3" Body="&lt;p&gt;Assuming that you want to capitalize &lt;code&gt;i&lt;/code&gt; if it represents the English word &quot;I&quot; (personal pronoun), the following code will do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun capitalize-i ()&#xA;  (when (and (eq major-mode 'org-mode) (looking-back &quot; i &quot;))&#xA;    (capitalize-word -1)))&#xA;&#xA;(add-hook 'post-self-insert-hook 'capitalize-i)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to replace &lt;em&gt;all&lt;/em&gt; occurrences of &lt;code&gt;i&lt;/code&gt; with &lt;code&gt;I&lt;/code&gt;, change &lt;code&gt;(looking-back &quot; i &quot;)&lt;/code&gt; to &lt;code&gt;(looking-back &quot;i&quot;)&lt;/code&gt; in the code above.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If the solution above turns out to noticeably affect performance, you can instead tell Emacs to replace &lt;code&gt;i&lt;/code&gt; with &lt;code&gt;I&lt;/code&gt; every time you save your &lt;code&gt;.org&lt;/code&gt; file (as suggested by @kaushalmodi in the comments):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun capitalize-i ()&#xA;  (when (eq major-mode 'org-mode)&#xA;    (replace-regexp &quot;i&quot; &quot;I&quot; t (point-min) (point-max))))&#xA;&#xA;(add-hook 'before-save-hook 'capitalize-i)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the third argument to &lt;code&gt;replace-regexp&lt;/code&gt; (set to &lt;code&gt;t&lt;/code&gt;) specifies that Emacs should&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;replace only matches surrounded by word boundaries.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So we don't have to specify a more complex regexp (such as &lt;code&gt;\s-i\s-&lt;/code&gt;) here.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-16T14:07:54.527" LastActivityDate="2015-01-16T14:07:54.527" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7437" PostTypeId="2" ParentId="7434" CreationDate="2015-01-16T10:30:06.653" Score="7" Body="&lt;p&gt;I would do this outside of Emacs, with a wrapper script that pulls the updated config first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#! /bin/sh&#xA;cd ~/.emacs.d &amp;amp;&amp;amp; git pull --rebase&#xA;exec /usr/bin/emacs &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then make this executable, name it emacs, and put it on your PATH before the real one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to have &lt;code&gt;init.el&lt;/code&gt; do pretty much the same thing: &lt;code&gt;(call-process-shell-command &quot;cd ~/.emacs.d/ &amp;amp;&amp;amp; git pull --rebase&quot;)&lt;/code&gt;, and then proceed to load the other files from under &lt;code&gt;~/.emacs.d/&lt;/code&gt;. The downside of this is that &lt;code&gt;init.el&lt;/code&gt; itself will not be reloaded. But if this is all that your &lt;code&gt;init.el&lt;/code&gt; does, and you delegate everything else to files loaded from it, that should be fine.&lt;/p&gt;&#xA;" OwnerUserId="749" LastEditorUserId="50" LastEditDate="2015-01-16T16:52:05.093" LastActivityDate="2015-01-16T16:52:05.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7438" PostTypeId="1" AcceptedAnswerId="7445" CreationDate="2015-01-16T12:58:25.050" Score="11" ViewCount="3612" Body="&lt;p&gt;Including other .org files is quite easy. For example, for configuration,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+setupfile: /path/to/config.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#INCLUDE: /path/to/config.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Those lines need to be in the .org file in order to be processed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could one have a given &lt;code&gt;#+setupfile&lt;/code&gt; and &lt;code&gt;#+include&lt;/code&gt; file available &lt;em&gt;programmatically&lt;/em&gt; at export time, without having to insert them in the file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practical use case: we need to batch process several hundreds org-mode files from a read-only repository. Those files do not have any &lt;code&gt;#+setupfile&lt;/code&gt; and &lt;code&gt;#+include&lt;/code&gt; file. For example, we need to make available a few &lt;code&gt;#+MACRO&lt;/code&gt; lines (see below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each org-mode file, I could read it in a buffer, inject the needed &lt;code&gt;#+setupfile&lt;/code&gt; and &lt;code&gt;#+include&lt;/code&gt;, export the file, and go to the next.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simpler way, like for example setting &lt;code&gt;#+setupfile&lt;/code&gt; or &lt;code&gt;#+include&lt;/code&gt; as variables, so that they are automatically available at export time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps there is a way to add something to &lt;code&gt;.dir-locals.el&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We even though of using some elisp within &lt;code&gt;org-load-hook&lt;/code&gt; or &lt;code&gt;org-mode-hook&lt;/code&gt;, but I could not find a way to pass content that needs to be evaluated as active Org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to give an idea, this is a much simplified &lt;code&gt;#+SETUPFILE&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: H:1 num:nil author:nil creator:nil timestamp:nil email:nil toc:t \n:nil @:t     ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:nil skip:nil d:t tags:not-in-toc&#xA;&#xA;&#xA;#+MACRO: fleuron @@latex:\fleuron@@ @@html:&amp;lt;center&amp;gt;* * *&amp;lt;/center&amp;gt;@@&#xA;#+MACRO: newline @@latex:\\@@ @@html:&amp;lt;br&amp;gt;@@ @@ascii:|@@&#xA;&#xA;#+LATEX_CLASS: book&#xA;#+LATEX_CLASS_OPTIONS: [a4paper,twoside,onecolumn]&#xA;#+LATEX_HEADER: \bibliographystyle{plain}&#xA;#+LATEX_HEADER: \bibliography{bibliography}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="249" LastEditorUserId="249" LastEditDate="2015-01-16T14:15:08.440" LastActivityDate="2016-07-21T12:41:16.633" Title="How to include other .org files programmatically (ie not from main .org file)?" Tags="|org-mode|org-export|variables|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7439" PostTypeId="2" ParentId="7435" CreationDate="2015-01-16T13:08:27.637" Score="2" Body="&lt;p&gt;Why not use auto-capitalize package (&lt;a href=&quot;https://github.com/yuutayamada/auto-capitalize-el&quot; rel=&quot;nofollow&quot;&gt;github page&lt;/a&gt;), which can do everything for you, not just i to I. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'auto-capitalize)&#xA;(auto-capitalize-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And give you a bonus: You can turn off auto-capitalize when cursor is at source block, and turn on it at other place using snippet below, which is from &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2014/12/03/Selective-auto-capitalization-in-org-buffers/&quot; rel=&quot;nofollow&quot;&gt;John Kitchin's blog&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Added: if want to escape /+something/, just need to add a another condition, like &lt;code&gt;(looking-back &quot;\\/[A-Za-z]+&quot;)&lt;/code&gt;.&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun exempt-auto-capitalize ()&#xA;  (if (or (looking-back &quot;\\/[A-Za-z]+&quot;) (org-in-block-p '(&quot;src&quot;)))&#xA;      (when auto-capitalize&#xA;        (auto-capitalize-mode -1))&#xA;    (unless auto-capitalize&#xA;      (auto-capitalize-mode 1))))&#xA;&#xA;(add-hook 'post-command-hook 'exempt-auto-capitalize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Cheers! Please give your thanks to these two kind people. &lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-01-16T15:26:36.717" LastActivityDate="2015-01-16T15:26:36.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7440" PostTypeId="2" ParentId="7434" CreationDate="2015-01-16T14:03:55.660" Score="2" Body="&lt;p&gt;Since I presume you are going to be &lt;code&gt;ssh&lt;/code&gt;ing to these machines, I suggest you can take a look at &lt;a href=&quot;https://github.com/Russell91/sshrc&quot; rel=&quot;nofollow&quot;&gt;sshrc&lt;/a&gt; which lets you take your local dotfiles along when you ssh into any server.&lt;/p&gt;&#xA;" OwnerUserId="5206" LastActivityDate="2015-01-16T14:03:55.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7442" PostTypeId="1" CreationDate="2015-01-16T14:42:52.010" Score="4" ViewCount="296" Body="&lt;p&gt;I have a document in which I have named R source code blocks. These blocks are set to export the results only in the text narrative. However, I would like to include the code for these blocks in an appendix. Is there a way of subsequently re-using that code block, but with an alternate :exports flag that includes just source code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, my source block might look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: src:tablemaker&#xA;#+BEGIN_SRC R :exports results :colnames yes&#xA;   # Do some stuff that barfs up a dataframe / table&#xA;   ...&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My results block then looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: tab:mytable&#xA;#+CAPTION: A pretty cool table&#xA;#+RESULTS[9d127a66c2787f0520a8c5140b24328357ee2ff8]: src:tablemaker&#xA;&#xA;...org-table representation of my table&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, way down in my document, I'd like to include the source of my code block, but not the results. Thank you, org-mode Jedi!&lt;/p&gt;&#xA;" OwnerUserId="2457" LastActivityDate="2015-01-17T19:03:02.353" Title="Export results of codeblock, then later export the source block (e.g. as for a code-listing in a document appendix)" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7443" PostTypeId="1" CreationDate="2015-01-16T14:43:50.093" Score="3" ViewCount="320" Body="&lt;p&gt;When in &lt;code&gt;org-mode&lt;/code&gt;, running the &lt;code&gt;export&lt;/code&gt; command will open a windows with all the export options. However, my mouse scroll behaves erratically and I am not able to scroll down or move at all, not even by clicking on the scroll bars. (The problem is recurrent in both Linux and OS X, using &lt;code&gt;org-mode&lt;/code&gt; version 8.2.10-30-gca21b7-elp, and GNU Emacs 24.4.1.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See screen capture here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/MuJRW.gif&quot; alt=&quot;animated screencast&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this problem?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2015-01-20T16:19:26.587" LastActivityDate="2015-01-22T09:58:11.653" Title="Mouse problem in org-mode export window" Tags="|org-mode|mouse|" AnswerCount="2" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="7444" PostTypeId="1" AcceptedAnswerId="7448" CreationDate="2015-01-16T15:36:52.833" Score="4" ViewCount="295" Body="&lt;p&gt;Here are two cases i am interested in:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Case 1: lines of identical length&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Given some lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int name1&#xA;const int name2&#xA;const int name3&#xA;const int name4  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and some other lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;= 1&#xA;= 2&#xA;= 3&#xA;= 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to move the other lines to the end of the first lines.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int name1 = 1&#xA;const int name2 = 2&#xA;const int name3 = 3&#xA;const int name4 = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do this?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Case 2: lines of different lengths&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In this cae the lines of the first region do not have the same length:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int someName&#xA;const int anotherName&#xA;const int yetAnotherName&#xA;const int name  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would still like to move the other lines to the end of the first lines, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int someName = 1&#xA;const int anotherName = 2&#xA;const int yetAnotherName = 3&#xA;const int name = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-01-16T17:19:52.100" LastActivityDate="2015-01-16T19:22:26.077" Title="Append region to the end of the lines of another region of same length" Tags="|text-editing|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7445" PostTypeId="2" ParentId="7438" CreationDate="2015-01-16T15:37:21.567" Score="5" Body="&lt;p&gt;Here's some code to work from.  The key is use &lt;code&gt;org-export-before-processing-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom rasmus/setup-file '(&quot;/tmp/setup.org&quot;)&#xA;  &quot;list of string with setup file or functions.&#xA;&#xA;Functions must take care of keyword themselves and must return&#xA;strings.&quot;)&#xA;&#xA;(defcustom rasmus/setup-file-keyword &quot;#+INCLUDE: &quot;&#xA;  &quot;Keyword used by `rasmus/org-export-setup-files'&quot;)&#xA;&#xA;(defun rasmus/org-export-setup-files (backend)&#xA;  &quot;Include setup-files automatically.  &#xA;&#xA;See also `rasmus/setup-file' and `rasmus/setup-file-keyword'&quot;&#xA;  ;; TODO: Resolve local files.&#xA;  ;; TODO: Better control over where contents is inserted.&#xA;  (save-excursion&#xA;(goto-char (point-max))&#xA;(insert &quot;\n&quot;&#xA; (mapconcat&#xA;  (lambda (elm)&#xA;    (cond ((stringp elm)&#xA;       (concat rasmus/setup-file-keyword elm))&#xA;      (functionp elm) (funcall elm)&#xA;      (t (error &quot;`rasmus/setup-file' should contain only strings and functions!&quot;))))&#xA;  rasmus/setup-file&#xA;  &quot;\n&quot;))))&#xA;&#xA;(add-hook 'org-export-before-processing-hook&#xA;      'rasmus/org-export-setup-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And a test:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (require 'ox-org)&#xA;  (find-file &quot;/tmp/setup&quot;)&#xA;  (insert &quot;this is setup!&quot;)&#xA;  (save-buffer)&#xA;  (kill-buffer)&#xA;  (with-temp-buffer&#xA;(insert &quot;* test\n&quot;)&#xA;(org-org-export-as-org))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Created 2015-01-16 Fri 16:37&#xA;#+TITLE: &#xA;* test&#xA;&#xA;This is the setup file&#xA;&#xA;# Emacs 24.4.1 (Org mode 8.3beta)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="115" LastEditDate="2016-07-21T12:40:55.193" LastActivityDate="2016-07-21T12:40:55.193" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7446" PostTypeId="2" ParentId="7444" CreationDate="2015-01-16T15:47:23.357" Score="6" Body="&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There is an easy solution to your updated question too, but you will need to install the &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;Multiple Cursors&lt;/a&gt; package, also available through Melpa.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 1. Kill/cut the rectangle &lt;em&gt;(same as before)&lt;/em&gt;&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮= 1&#xA; = 2&#xA; = 3&#xA; = 4▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select the region shown above between the two points.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x r k&lt;/code&gt; - Kill/cut that rectangular region between the two points.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Step 2. Yank the just killed rectangle to the location of your choice&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int someName       ▮&#xA;const int anotherName&#xA;const int yetAnotherName&#xA;const int name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bring the point at the above shown location&lt;/li&gt;&#xA;&lt;li&gt;Note that this location needs to be at &lt;em&gt;any point&lt;/em&gt; in the column that's not occupied by any of the below lines. If you can imagine a vertical line closest to the left which does not cut any of those 4 lines, bring the point to the right of that line.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x r y&lt;/code&gt;- Yank/paste the killed rectangle&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That will result in the below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int someName       = 1▮&#xA;const int anotherName    = 2&#xA;const int yetAnotherName = 3&#xA;const int name           = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Now we need to remove that extra spaces between the variable names the &lt;code&gt;=&lt;/code&gt; signs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Step 3. Removing extra space&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For this step, first bring the point &lt;strong&gt;over&lt;/strong&gt; the first &lt;code&gt;=&lt;/code&gt; sign as shown below (the point is hiding the &lt;code&gt;=&lt;/code&gt; sign beneath it).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int someName       ▮ 1&#xA;const int anotherName    = 2&#xA;const int yetAnotherName = 3&#xA;const int name           = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create Multiple Cursors at all &lt;code&gt;=&lt;/code&gt; signs: &lt;code&gt;M-3 C-&amp;gt;&lt;/code&gt;. &lt;code&gt;C-&amp;gt;&lt;/code&gt; is bound to &lt;code&gt;mc/mark-next-like-this&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That will give you this; the &lt;code&gt;=&lt;/code&gt; signs are still hidden beneath the cursors.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int someName       ▮ 1&#xA;const int anotherName    ▮ 2&#xA;const int yetAnotherName ▮ 3&#xA;const int name           ▮ 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-SPC M-b M-f BKSPACE SPC RET&lt;/code&gt; - Delete any space between the multiple cursors and the words before them and instead insert a single space.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Result&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int someName = 1&#xA;const int anotherName = 2&#xA;const int yetAnotherName = 3&#xA;const int name = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Older answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;rectangle&lt;/code&gt; is the first thing that comes to my mind.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 1. Kill/cut the rectangle&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮= 1&#xA; = 2&#xA; = 3&#xA; = 4▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select the region shown above between the two points.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x r k&lt;/code&gt; - Kill/cut that rectangular region between the two points.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Step 2. Yank the just killed rectangle to the location of your choice&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int name1 ▮&#xA;const int name2&#xA;const int name3&#xA;const int name4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bring the point at the above shown location &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x r y&lt;/code&gt;- Yank/paste the killed rectangle&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Result&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const int name1 = 1&#xA;const int name2 = 2&#xA;const int name3 = 3&#xA;const int name4 = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Learning&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html&quot; rel=&quot;nofollow&quot;&gt;Rectangle Commands&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacsrocks.com/e13.html&quot; rel=&quot;nofollow&quot;&gt;Multiple Cursors demo by the package author Magnar&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-16T16:20:54.893" LastActivityDate="2015-01-16T16:20:54.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7447" PostTypeId="2" ParentId="7444" CreationDate="2015-01-16T16:09:43.613" Score="5" Body="&lt;p&gt;Third-party package answer:&lt;/p&gt;&#xA;&lt;h1&gt;Multiple Cursors&lt;/h1&gt;&#xA;&lt;p&gt;In additional to rectangle commands mentioned above, you can also do this using &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;noreferrer&quot;&gt;multiple cursors&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Put a cursor on the beginnings of the bottom four lines. I used &lt;code&gt;mc/mark-next-like-this&lt;/code&gt; three times (I map it to &lt;code&gt;C-&amp;gt;&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-k&lt;/code&gt; to kill the lines.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Without exiting multiple-cursors, move your cursors to the end of the first four lines (&lt;code&gt;C-p&lt;/code&gt; and &lt;code&gt;C-e&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;SPC&lt;/code&gt; to add a space, &lt;code&gt;C-y&lt;/code&gt; to yank in the killed lines.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-16T16:09:43.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7448" PostTypeId="2" ParentId="7444" CreationDate="2015-01-16T16:44:01.923" Score="3" Body="&lt;p&gt;This function will take the thing you've most recently killed, appends the first line from that text at the end of the current line, then the second line at the end of the next line, etc.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yank-at-end-of-lines ()&#xA;  &quot;Yank the most recent kill to point.&#xA;&#xA;If there are newlines in the most recent kill, append the first line&#xA;in the kill to the end of the current line, the second line in the kill&#xA;to the end of the next line, and so forth.&quot;&#xA;  (interactive)&#xA;  (dolist (cur-line-to-insert (split-string (current-kill 0)&#xA;                                            &quot;\n&quot;))&#xA;    (if (eobp)&#xA;        (newline)&#xA;      (move-end-of-line nil))&#xA;    (insert cur-line-to-insert)&#xA;    (forward-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does not use rectangles; you should kill the text (e.g., &lt;code&gt;C-w&lt;/code&gt;), not kill the rectangle (e.g., &lt;code&gt;C-x r k&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also does not allow you to do anything but yank the most recent kill.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-01-16T16:44:01.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7449" PostTypeId="2" ParentId="7435" CreationDate="2015-01-16T16:45:20.647" Score="8" Body="&lt;p&gt;Replacing the word &lt;code&gt;i&lt;/code&gt; with the word &lt;code&gt;I&lt;/code&gt; is a job for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html&quot; rel=&quot;nofollow&quot;&gt;abbrevs&lt;/a&gt;. It activates after you press the space bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However...&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes you do &lt;strong&gt;not&lt;/strong&gt; want &lt;code&gt;i&lt;/code&gt; replaced with &lt;code&gt;I&lt;/code&gt;, such as when typing &lt;code&gt;i = i + 1&lt;/code&gt; in some programming language, but you do want it to expand when typing comments and strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of &lt;code&gt;org-mode&lt;/code&gt; you want to expand &lt;code&gt;i&lt;/code&gt; in normal text, suppress the expansion in &lt;code&gt;src&lt;/code&gt; blocks, &lt;em&gt;except&lt;/em&gt; when in a comment or string within a &lt;code&gt;src&lt;/code&gt; block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some code to do that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-text-abbrev-expand-p ()&#xA;  &quot;Return t if the abbrev is in a text context, which is: in&#xA; comments and strings only when in a prog-mode derived-mode or&#xA; src block in org-mode, and anywhere else.&quot;&#xA;  (if (or (derived-mode-p 'prog-mode)&#xA;          (and (eq major-mode 'org-mode)&#xA;               (org-in-src-block-p 'inside)))&#xA;      (nth 8 (syntax-ppss))&#xA;    t))&#xA;&#xA;(define-abbrev-table 'my-text-abbrev-table ()&#xA;  &quot;Abbrev table for text-only abbrevs. Expands only in comments and strings.&quot;&#xA;  :enable-function #'my-text-abbrev-expand-p)&#xA;&#xA;(dolist (table (list text-mode-abbrev-table&#xA;                     prog-mode-abbrev-table))&#xA;  (abbrev-table-put table&#xA;                    :parents (list my-text-abbrev-table)))&#xA;&#xA;;; Bug fix for python and lisp modes who's abbrev tables aren't set up correctly:&#xA;&#xA;(eval-after-load &quot;python&quot;&#xA;  (abbrev-table-put python-mode-abbrev-table&#xA;                    :parents (list my-text-abbrev-table&#xA;                                   python-mode-skeleton-abbrev-table)))&#xA;&#xA;(eval-after-load &quot;lisp-mode&quot;&#xA;  (abbrev-table-put lisp-mode-abbrev-table&#xA;                    :parents (list my-text-abbrev-table)))&#xA;&#xA;;; Our only expansion, so far...&#xA;&#xA;(define-abbrev my-text-abbrev-table &quot;i&quot; &quot;I&quot; nil :system t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you happen to manage your &lt;code&gt;init.el&lt;/code&gt; &lt;a href=&quot;https://emacs.stackexchange.com/questions/3143/can-i-use-org-mode-to-structure-my-emacs-or-other-el-configuration-file/3146&quot;&gt;as an org file&lt;/a&gt; you may be interested in the following snippet of additional code to manage your text expansions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: my-text-abbrevs&#xA;- i: I&#xA;- teh: the&#xA;&#xA;&#xA;#+begin_src emacs-lisp :var my-text-abbrevs=my-text-abbrevs&#xA;&#xA;;; ...code from above goes here goes here...&#xA;&#xA;(defun my-text-abbrev-table-init (abbrevs-org-list)&#xA;  &quot;Parse 'name: expansion' pairs from an org list and insert into abbrev table.&quot;&#xA;  (message &quot;Creating text-abbrev table...&quot;)&#xA;  (dolist (abbrev abbrevs-org-list)&#xA;    (let* ((pair (split-string abbrev &quot;: +&quot; :omit-nuls &quot; &quot;))&#xA;           (name (nth 0 pair))&#xA;           (expansion (nth 1 pair)))&#xA;      (define-abbrev my-text-abbrev-table name expansion nil :system t))))&#xA;&#xA;(my-text-abbrev-table-init my-text-abbrevs)&#xA;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use your normal text editing and org skills to manage a list of expansion words. If it gets too long you can use &lt;kbd&gt;TAB&lt;/kbd&gt; to collapse or hide it in a sub-heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI: If you wanted to do the &lt;em&gt;opposite&lt;/em&gt; and expand text only in a program context and not in a text context then Emacs already has you covered with the &lt;code&gt;expand&lt;/code&gt; package. For example, you could have &lt;code&gt;if&lt;/code&gt; expand to &lt;code&gt;if (...) {...}&lt;/code&gt; with a template which would otherwise be annoying when writing comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;expand&lt;/code&gt; package is not mentioned in the Emacs manual.&lt;/p&gt;&#xA;" OwnerUserId="5207" LastEditorUserId="675" LastEditDate="2016-07-13T02:29:35.447" LastActivityDate="2016-07-13T02:29:35.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7450" PostTypeId="1" AcceptedAnswerId="7454" CreationDate="2015-01-16T19:04:56.780" Score="5" ViewCount="621" Body="&lt;p&gt;I'd like to pass some extra information to my &lt;code&gt;init.el&lt;/code&gt; via command line arguments. However, the variable &lt;code&gt;command-line-args-left&lt;/code&gt; is always &lt;code&gt;nil&lt;/code&gt; when Emacs is run interactively. (Though it is correctly populated when run with the &lt;code&gt;--script&lt;/code&gt; option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get a list of command line arguments when Emacs is run normally?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="25" LastEditDate="2015-05-10T15:38:02.880" LastActivityDate="2015-05-10T15:38:02.880" Title="Parse command line arguments in interactive session" Tags="|elisp|command-line-arguments|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7451" PostTypeId="2" ParentId="7438" CreationDate="2015-01-16T19:04:59.173" Score="2" Body="&lt;p&gt;Here's the basic idea:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun export-files-with-template (template sources)&#xA;  (cl-loop for file in (file-expand-wildcards sources)&#xA;           do (with-temp-buffer&#xA;                (insert-file template)&#xA;                (insert (format &quot;#+include: %s\n&quot; file))&#xA;                (org-mode)&#xA;                (let ((exported (org-export-as 'html))&#xA;                      (save-silently-p t))&#xA;                  (with-temp-file&#xA;                      (format &quot;%s.html&quot; (file-name-sans-extension file))&#xA;                    (insert exported))))))&#xA;&#xA;(export-files-with-template &quot;~/org/setupfile.org&quot; &quot;~/org/example/*.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;~/org/setupfile.org&lt;/code&gt; is the file that contains macro and export setting definitions, &lt;code&gt;~/org/example/*.org&lt;/code&gt; are the files that need to be exported. You could, of course add more export backends / extend this to projects / specify output directory etc.; this is just the basic idea.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="115" LastEditDate="2016-07-21T12:41:16.633" LastActivityDate="2016-07-21T12:41:16.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7452" PostTypeId="2" ParentId="7444" CreationDate="2015-01-16T19:22:26.077" Score="1" Body="&lt;p&gt;I use this function for inserting cut text on multiple lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yank-as-rectangle ()&#xA;  &quot;Reinsert (\&quot;paste\&quot;) the last stretch of killed text like a rectangle.&#xA;This splits the text into lines, then inserts each one like&#xA;`yank-rectangle' does.  Note that the lines may not be the same length.&quot;&#xA;  (interactive)&#xA;  (insert-rectangle (split-string (current-kill 0) &quot;\r?\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is like a combination of &lt;code&gt;yank&lt;/code&gt; and &lt;code&gt;yank-rectangle&lt;/code&gt;.  It inserts the text that &lt;code&gt;yank&lt;/code&gt; would, but it does it like &lt;code&gt;yank-rectangle&lt;/code&gt; would.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it doesn't handle your case where the lines you're yanking onto are not all the same length.  I'd probably just yank at the position of the longest line, and then replace multiple spaces if necessary.  (Normally, I'd just leave things aligned.)&lt;/p&gt;&#xA;" OwnerUserId="859" LastActivityDate="2015-01-16T19:22:26.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7453" PostTypeId="2" ParentId="7450" CreationDate="2015-01-16T19:58:23.010" Score="5" Body="&lt;p&gt;The command line options are processed in &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el&quot;&gt;&lt;code&gt;startup.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to add your handlers to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Command_002dLine-Arguments.html&quot;&gt;&lt;code&gt;command-line-functions&lt;/code&gt;&lt;/a&gt; to handle the additional options.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-01-16T19:58:23.010" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7454" PostTypeId="2" ParentId="7450" CreationDate="2015-01-16T21:00:04.140" Score="3" Body="&lt;p&gt;Arguments are deleted after being processed at startup, you can either handle them like sds specified or if you'd like the list of args given after start up, save the contents of command-line-args at the start of your init.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-save-args command-line-args)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Though if you're planning on passing custom args, you'll need to handle them during startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can probably also get them from the ps command. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string (format &quot;ps -o args -p %s&quot; (emacs-pid)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should return the full command emacs was run with if you have ps.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-01-17T18:58:53.950" LastActivityDate="2015-01-17T18:58:53.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7455" PostTypeId="1" AcceptedAnswerId="7456" CreationDate="2015-01-16T22:13:18.330" Score="1" ViewCount="365" Body="&lt;p&gt;In &lt;code&gt;calc&lt;/code&gt;, I can switch to the engineering notation by pressing &lt;code&gt;d e&lt;/code&gt;. But how do I make that a default?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can store the &lt;code&gt;calc&lt;/code&gt; defaults in the file specified in the &lt;code&gt;calc-settings-file&lt;/code&gt; variable but I can't find the elisp required to change the default notation to engineering.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-16T22:24:04.750" Title="How to set the engineering notation as default in calc?" Tags="|calc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7456" PostTypeId="2" ParentId="7455" CreationDate="2015-01-16T22:24:04.750" Score="3" Body="&lt;p&gt;Found the solution as soon as I posted the question ..&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(require 'calc)&#xA;(setq calc-settings-file (concat user-emacs-directory &quot;/setup-calc-defaults.el&quot;))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;setup-calc-defaults.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(setq calc-float-format '(eng 0))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The defaults don't become effective right-away. Without worrying about what all packages I might need to &lt;code&gt;require&lt;/code&gt; once again, I simply restarted emacs.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;lisp/calc/calc.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcalcmodevar calc-float-format '(float 0)&#xA;  &quot;Format to use for display of floating-point numbers in calc-mode.&#xA;Must be a list of one of the following forms:&#xA; (float 0)      Floating point format, display full precision.&#xA; (float N)      N &amp;gt; 0: Floating point format, at most N significant figures.&#xA; (float -N)     -N &amp;lt; 0: Floating point format, calc-internal-prec - N figs.&#xA; (fix N)        N &amp;gt;= 0: Fixed point format, N places after decimal point.&#xA; (sci 0)        Scientific notation, full precision.&#xA; (sci N)        N &amp;gt; 0: Scientific notation, N significant figures.&#xA; (sci -N)       -N &amp;lt; 0: Scientific notation, calc-internal-prec - N figs.&#xA; (eng 0)        Engineering notation, full precision.&#xA; (eng N)        N &amp;gt; 0: Engineering notation, N significant figures.&#xA; (eng -N)       -N &amp;lt; 0: Engineering notation, calc-internal-prec - N figs.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-16T22:24:04.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7457" PostTypeId="1" AcceptedAnswerId="21850" CreationDate="2015-01-16T23:19:04.613" Score="1" ViewCount="194" Body="&lt;p&gt;I'd like to take a window (or part of it) as a bitmap and save it as an image. This is basically a screenshot functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to do it with emacs lisp so that screenshot taking can be scripted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Aquamacs, but I'm not bound to be using exactly this version of Emacs.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="50" LastEditDate="2015-01-16T23:50:57.003" LastActivityDate="2016-04-25T19:23:13.653" Title="Take a bitmap screenshot of a window" Tags="|images|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7458" PostTypeId="1" AcceptedAnswerId="7459" CreationDate="2015-01-16T23:58:04.470" Score="36" ViewCount="8305" Body="&lt;p&gt;Given a modified buffer, how can I diff it with the file backing it on disk to see what I've changed?&lt;/p&gt;&#xA;" OwnerUserId="2707" LastActivityDate="2023-12-12T20:40:54.097" Title="How can I see the changes made to a modified buffer since the last save?" Tags="|buffers|buffer-modified|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7459" PostTypeId="2" ParentId="7458" CreationDate="2015-01-17T00:25:48.887" Score="43" Body="&lt;p&gt;You want the command &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;diff-buffer-with-file&lt;/kbd&gt;. See the manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;diff-buffer-with-file is an interactive autoloaded compiled Lisp function in `diff.el'.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(diff-buffer-with-file &amp;amp;optional BUFFER)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;View the differences between BUFFER and its associated file.&#xA;  This requires the external program &lt;code&gt;diff&lt;/code&gt; to be in your &lt;code&gt;exec-path&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You may also be interested in &lt;code&gt;highlight-changes-mode&lt;/code&gt; which automatically and interactively highlights changes made to the buffer after it was enabled.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-01-17T00:25:48.887" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7460" PostTypeId="2" ParentId="7457" CreationDate="2015-01-17T00:34:15.633" Score="3" Body="&lt;p&gt;Emacs itself cannot, however there's nothing that says it can't call out to a program that can. Some solutions include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://melpa.org/#/screenshot&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;screenshot&lt;/code&gt;&lt;/a&gt;, which uses an ImageMagick backend&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://melpa.org/#/capture&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;capture&lt;/code&gt;&lt;/a&gt;, which uses &lt;code&gt;FFmpeg&lt;/code&gt; or &lt;code&gt;aconv&lt;/code&gt; as a backend&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://melpa.org/#/camcorder&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;camcorder&lt;/code&gt;&lt;/a&gt;, which can do &lt;em&gt;screencasts&lt;/em&gt; with FFmpeg as a backend&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All of these are designed for interactive use, so your mileage may vary when automating it with Emacs Lisp.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-01-17T00:34:15.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7461" PostTypeId="1" CreationDate="2015-01-16T23:58:05.970" Score="3" ViewCount="987" Body="&lt;p&gt;I'm using gnus and trying to send email through it. This works for my gmail account (which receives outgoing emails on smpt port 587 using tls). My university uses smpt on port 465 and no tls, but ssl. Receiving email via IMAP port 993 works perfectly, but I have found no setup which allows email to be sent via port 465 ssl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short of looking at the source and debugging this myself, which would likely involve looking at how gnus is doing authentication and learning about the authentication methods and the smpt protocol, I don't think I will get any further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I notice that everywhere that this question exists, it never gets answered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://comments.gmane.org/gmane.emacs.gnus.general/83505&quot; rel=&quot;nofollow&quot;&gt;http://comments.gmane.org/gmane.emacs.gnus.general/83505&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://groups.google.com/forum/#!topic/gnu.emacs.gnus/1_8s2pCWy4I&quot; rel=&quot;nofollow&quot;&gt;https://groups.google.com/forum/#!topic/gnu.emacs.gnus/1_8s2pCWy4I&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://groups.google.com/d/topic/gnu.emacs.gnus/ikGoITEYIf4&quot; rel=&quot;nofollow&quot;&gt;https://groups.google.com/d/topic/gnu.emacs.gnus/ikGoITEYIf4&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.linuxquestions.org/questions/linux-software-2/sending-email-with-gnu-emacs-process-smtp-not-running-error-4175415954/&quot; rel=&quot;nofollow&quot;&gt;http://www.linuxquestions.org/questions/linux-software-2/sending-email-with-gnu-emacs-process-smtp-not-running-error-4175415954/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this has apparently been going on since 2010, so I thought it'd post it here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a working setup for sending email from gnus via port 465 ssl?&lt;/p&gt;&#xA;" OwnerUserId="2846" OwnerDisplayName="user84207" LastEditorUserId="2846" LastEditDate="2015-01-17T01:02:55.313" LastActivityDate="2015-12-13T15:29:19.810" Title="Send email with gnus via ssl port 465" Tags="|gnus|gnutls|ssl|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7462" PostTypeId="2" ParentId="265" CreationDate="2015-01-17T01:06:35.940" Score="1" Body="&lt;p&gt;For wanderers who stumble on this, I use this form:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'cl-lib))&#xA;;; [...]&#xA;(add-hook 'focus-out-hook&#xA;  (lambda ()&#xA;    (cl-letf (((symbol-function 'message) #'format))&#xA;      (save-some-buffers t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The use of &lt;code&gt;cl-letf&lt;/code&gt; keeps the annoying &lt;code&gt;(No files need saving)&lt;/code&gt; messages from clogging your echo area.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-01-17T01:06:35.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7463" PostTypeId="2" ParentId="7458" CreationDate="2015-01-17T02:02:23.200" Score="24" Body="&lt;p&gt;Command &lt;code&gt;ediff-current-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ediff-current-file is an interactive autoloaded Lisp function in&#xA;`ediff.el'.&#xA;&#xA;(ediff-current-file)&#xA;&#xA;Start ediff between current buffer and its file on disk.&#xA;This command can be used instead of `revert-buffer'.  If there is&#xA;nothing to revert then this command fails.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-17T02:02:23.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7464" PostTypeId="1" AcceptedAnswerId="7467" CreationDate="2015-01-17T02:26:48.817" Score="9" ViewCount="1131" Body="&lt;p&gt;I sometimes use &lt;code&gt;M-/&lt;/code&gt; to complete words but it is not case sensitive. For example : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the word is : &lt;code&gt;showPublic&lt;/code&gt; and when I write &lt;code&gt;show&lt;/code&gt; and then put &lt;code&gt;M-/&lt;/code&gt;, It completes as &lt;code&gt;showpublic&lt;/code&gt;. How can I fix this ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or at least, how can I see the possible completion ?&lt;/p&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="105" LastEditDate="2015-01-17T09:09:03.140" LastActivityDate="2015-01-17T09:09:03.140" Title="case-sensitivity of word completion using dabbrev" Tags="|completion|dabbrev|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7465" PostTypeId="2" ParentId="7464" CreationDate="2015-01-17T02:57:54.823" Score="4" Body="&lt;p&gt;-- this is meant to be a comment but I don't have enough reputation for it --&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a quick test with emacs -Q&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I typed &quot;showPublic&quot; then &quot;show M-/&quot; and it completed as &quot;showPublic&quot; (emacs 24.4) so I think it might be a configuration problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you retry editing your document in context while launching emacs with the -Q option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the completion is correct then it would be a configuration problem. Sorry to not be able to help more...&lt;/p&gt;&#xA;" OwnerUserId="2756" LastActivityDate="2015-01-17T02:57:54.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7466" PostTypeId="1" AcceptedAnswerId="7476" CreationDate="2015-01-17T07:28:34.807" Score="1" ViewCount="1130" Body="&lt;p&gt;Very new to emacs.  (I only started day before yesterday.)  I'm writing some Java and was wondering if there's an option or something I can set up so it will indent Javadoc comments correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean by that is, if I type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public class NiftyClass {&#xA;&#xA;    /*&#xA;     * Here's what this method does.&#xA;     *&#xA;     * @return the answer&#xA;     */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;every time I hit enter to start a new line in the Javadoc comments the pointer is at the left margin.  Inside the body of a method when I hit enter it takes me to the next line at the correct indentation.  I'd prefer that it do something similar with these comments, such that the pointer aligns itself underneath the previous *.  Or, better yet, that it add the next *space for me and start me right after that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything that can do this?&lt;/p&gt;&#xA;" OwnerUserId="5218" LastActivityDate="2015-01-17T17:51:44.173" Title="How to have emacs format/indent javadoc comments correctly?" Tags="|indentation|formatting|java|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7467" PostTypeId="2" ParentId="7464" CreationDate="2015-01-17T09:04:09.160" Score="5" Body="&lt;p&gt;See options &lt;code&gt;dabbrev-case-fold-search&lt;/code&gt; and &lt;code&gt;dabbrev-upcase-means-case-search&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dabbrev-case-fold-search is a variable defined in `dabbrev.el'.&#xA;Its value is case-fold-search&#xA;&#xA;  This variable can be risky when used as a file-local variable.&#xA;&#xA;Documentation:&#xA;Control whether dabbrev searches should ignore case.&#xA;A value of nil means case is significant.&#xA;A value of `case-fold-search' means case is significant&#xA; if `case-fold-search' is nil.&#xA;Any other non-nil version means case is not significant.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dabbrev-upcase-means-case-search is a variable defined in `dabbrev.el'.&#xA;Its value is nil&#xA;&#xA;Documentation:&#xA;The significance of an uppercase character in an abbreviation.&#xA;A nil value means case fold search when searching for possible expansions;&#xA;non-nil means case sensitive search.&#xA;&#xA;This variable has an effect only when the value of&#xA;`dabbrev-case-fold-search' says to ignore case.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-17T09:04:09.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7468" PostTypeId="1" AcceptedAnswerId="7469" CreationDate="2015-01-17T10:04:59.277" Score="5" ViewCount="2267" Body="&lt;p&gt;When I did some clean up of my Emacs init file, I discovered that I had used both &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'latex-mode-hook ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the difference between &lt;code&gt;LaTeX-mode-hook&lt;/code&gt; and &lt;code&gt;latex-mode-hook&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-17T10:18:18.830" Title="latex-mode-hook or LaTeX-mode-hook?" Tags="|latex|hooks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7469" PostTypeId="2" ParentId="7468" CreationDate="2015-01-17T10:18:18.830" Score="11" Body="&lt;p&gt;&lt;code&gt;LaTeX-mode-hook&lt;/code&gt; is used by AUCTeX's LaTeX mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;latex-mode-hook&lt;/code&gt; is used by Emacs' built-in latex mode.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2015-01-17T10:18:18.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7471" PostTypeId="1" AcceptedAnswerId="7472" CreationDate="2015-01-17T11:58:06.000" Score="8" ViewCount="1539" Body="&lt;p&gt;When I type &lt;kbd&gt;C-h m&lt;/kbd&gt; for &lt;code&gt;describe-mode&lt;/code&gt; the frame splits into two windows with the current buffer on top and the &lt;code&gt;*Help*&lt;/code&gt; buffer below. But the focus stays in the current buffer, so I usually have to type &lt;kbd&gt;C-x o&lt;/kbd&gt; to move focus to the &lt;code&gt;*Help*&lt;/code&gt; buffer, and then scroll down with the page-down key to find what I am looking for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to improve this work flow by automatically give focus to the &lt;code&gt;*Help*&lt;/code&gt; buffer:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'describe-mode :after 'other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now I get error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I type &lt;kbd&gt;C-h m&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-17T16:34:21.490" Title="Change focus to *Help* buffer after running describe-mode" Tags="|help|advice|focus|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7472" PostTypeId="2" ParentId="7471" CreationDate="2015-01-17T12:20:34.000" Score="1" Body="&lt;p&gt;Forgot to use &lt;code&gt;call-interactively&lt;/code&gt; on &lt;code&gt;other-window&lt;/code&gt;. This seems to work better:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'describe-mode :after '(lambda (&amp;amp;rest args) (call-interactively 'other-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-17T12:20:34.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7474" PostTypeId="2" ParentId="7471" CreationDate="2015-01-17T16:34:21.490" Score="14" Body="&lt;p&gt;Customize the variable &lt;code&gt;help-window-select&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &quot;Non-nil means select help window for viewing.&#xA;Choices are:&#xA; never (nil) Select help window only if there is no other window&#xA;             on its frame.&#xA; other       Select help window unless the selected window is the&#xA;             only other window on the help window's frame.&#xA; always (t)  Always select the help window.&#xA;&#xA;This option has effect if and only if the help window was created&#xA;by `with-help-window'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-01-17T16:34:21.490" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7475" PostTypeId="1" AcceptedAnswerId="7479" CreationDate="2015-01-17T16:59:10.953" Score="13" ViewCount="2763" Body="&lt;p&gt;The problem with &lt;code&gt;M-x compile&lt;/code&gt; is that if the &lt;code&gt;Makefile&lt;/code&gt; isn't in the current directory, it fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to have a function that recursively goes up to find a &lt;code&gt;Makefile&lt;/code&gt; and run &lt;code&gt;make&lt;/code&gt; from this directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen &lt;a href=&quot;https://stackoverflow.com/questions/1668928/invoking-makefile-in-the-project-root-directory-from-subdirectory-from-emacs&quot;&gt;this question&lt;/a&gt;, but it's path-specific, and it's something I have to think about running.&lt;/p&gt;&#xA;" OwnerUserId="88" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2022-12-05T16:15:17.637" Title="Recursively go up to find Makefile and compile" Tags="|compilation|directories|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7476" PostTypeId="2" ParentId="7466" CreationDate="2015-01-17T17:51:44.173" Score="2" Body="&lt;p&gt;You could try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(electric-indent-mode +1)&#xA;&#xA;(defun my-newline-and-indent-mode-hook ()&#xA;  (local-set-key (kbd &quot;RET&quot;) (key-binding (kbd &quot;M-j&quot;)))&#xA;  (local-set-key (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) #'electric-indent-just-newline))&#xA;&#xA;(add-hook 'prog-mode-hook #'my-newline-and-indent-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;kbd&gt;return&lt;/kbd&gt; will continue comment or newline-and-indent -- press &lt;kbd&gt;C-return&lt;/kbd&gt; to end the comment with a plain newline.&lt;/p&gt;&#xA;" OwnerUserId="5226" LastActivityDate="2015-01-17T17:51:44.173" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7477" PostTypeId="2" ParentId="7475" CreationDate="2015-01-17T18:07:54.040" Score="6" Body="&lt;p&gt;Recursive compile, no dependencies attached:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun desperately-compile ()&#xA;  &quot;Traveling up the path, find a Makefile and `compile'.&quot;&#xA;  (interactive)&#xA;  (with-temp-buffer&#xA;    (while (and (not (file-exists-p &quot;Makefile&quot;))&#xA;                (not (equal &quot;/&quot; default-directory)))&#xA;      (cd &quot;..&quot;))&#xA;    (when (file-exists-p &quot;Makefile&quot;)&#xA;      (compile &quot;make -k&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-17T18:07:54.040" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7478" PostTypeId="2" ParentId="7442" CreationDate="2015-01-17T19:03:02.353" Score="4" Body="&lt;p&gt;The answer to this turned out to be simpler than expected. This didn't work for me initially, but whatever the ephemeral problem was seems to have solved itself after an unintentional emacs reboot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer was to simply put my results block above my code block, and have my code block &lt;code&gt;:export both&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Results&#xA;#+NAME: tab:mytable&#xA;#+RESULTS: src:foo&#xA;&#xA;&#xA;* Code&#xA;#+NAME: src:foo&#xA;#+BEGIN_SRC R :exports both&#xA;data.frame(1:10, rnorm(10))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2457" LastActivityDate="2015-01-17T19:03:02.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7479" PostTypeId="2" ParentId="7475" CreationDate="2015-01-17T19:24:39.760" Score="21" Body="&lt;p&gt;You are looking for the function &lt;code&gt;locate-dominating-file&lt;/code&gt;. Here is the emacs documentation for this function:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(locate-dominating-file FILE NAME)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Look up the directory hierarchy from &lt;code&gt;FILE&lt;/code&gt; for a directory containing&#xA;  &lt;code&gt;NAME&lt;/code&gt;. Stop at the first parent directory containing a file &lt;code&gt;NAME&lt;/code&gt;, and&#xA;  return the directory.  Return &lt;code&gt;nil&lt;/code&gt; if not found. Instead of a string,&#xA;  &lt;code&gt;NAME&lt;/code&gt; can also be a predicate taking one argument (a directory) and&#xA;  returning a non-nil value if that directory is the one for which we're&#xA;  looking.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Using this, abo-abo's answer can be shortened to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun desperately-compile ()&#xA;  &quot;Traveling up the path, find a Makefile and `compile'.&quot;&#xA;  (interactive)&#xA;  (when (locate-dominating-file default-directory &quot;Makefile&quot;)&#xA;  (with-temp-buffer&#xA;    (cd (locate-dominating-file default-directory &quot;Makefile&quot;))&#xA;    (compile &quot;make -k&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-01-17T19:24:39.760" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7480" PostTypeId="2" ParentId="5945" CreationDate="2015-01-17T20:14:33.037" Score="0" Body="&lt;p&gt;Here is what I did (setq org-latex-pdf-process (quote (&quot;texi2dvi -p -b -V %f&quot;))). It works perfectly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there are some other possibilities that may work better for some situations. Here they are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq org-latex-pdf-process &#xA;        '(&quot;pdflatex -pdflatex='pdflatex -interaction nonstopmode'  -bibtex -f -pdf %f&quot;))&#xA;;;        '(&quot;latexmk -pdf %f&quot;))                             &#xA;;;       '(&quot;xelatex %f &amp;amp;&amp;amp; bibtex %f &amp;amp;&amp;amp; xelatex %f &amp;amp;&amp;amp; xelatex %f&quot;)&#xA;;;       '(&quot;pdflatex -interaction nonstopmode %b&quot;           &#xA;;;        &quot;bibtex %b&quot;&#xA;;;        &quot;pdflatex -interaction nonstopmode %b&quot;&#xA;;;        &quot;pdflatex -interaction nonstopmode %b&quot;))&#xA;;;       '(&quot;rubber -d --into %o %f&quot;))&#xA;;;        (quote (&quot;texi2dvi -p -b -V %f&quot;))                  &#xA;;;       '(&quot;texi2dvi --pdf --clean --verbose --batch %f&quot;    &#xA;;;         &quot;bibtex %b&quot; &quot;texi2dvi --pdf --clean --verbose --batch %f&quot;&#xA;;;         &quot;texi2dvi --pdf --clean --verbose --batch %f&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4052" LastActivityDate="2015-01-17T20:14:33.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7481" PostTypeId="1" AcceptedAnswerId="7487" CreationDate="2015-01-17T21:03:48.937" Score="42" ViewCount="7590" Body="&lt;p&gt;The below obviously doesn't work and hence this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I correct the below code so that the value of &lt;code&gt;somelist&lt;/code&gt; becomes &lt;code&gt;'((&quot;abc&quot; . 123))&lt;/code&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x &quot;abc&quot;)&#xA;(setq y 123)&#xA;(setq somelist nil)&#xA;(add-to-list 'somelist '(x . y))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2020-07-15T19:29:07.617" LastActivityDate="2020-07-15T19:29:07.617" Title="How to evaluate the variables before adding them to a list?" Tags="|variables|quote|backquote|" AnswerCount="2" CommentCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="7482" PostTypeId="1" AcceptedAnswerId="17089" CreationDate="2015-01-17T21:07:02.797" Score="9" ViewCount="1409" Body="&lt;p&gt;Looking for a solution on how to restore my window layout after an Ediff session, I found  &lt;a href=&quot;http://oremacs.com/2015/01/17/setting-up-ediff/&quot; rel=&quot;noreferrer&quot;&gt;a blog post&lt;/a&gt;, where the author suggests:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(winner-mode)&#xA;(add-hook 'ediff-after-quit-hook-internal 'winner-undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This seems to &lt;strong&gt;almost&lt;/strong&gt; work well for me. I say almost because I invoke &lt;code&gt;M-x ediff-buffers&lt;/code&gt; &lt;strong&gt;from&lt;/strong&gt; &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;Helm&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;, and quiting the Ediff session brings me back to the original layout with the &lt;strong&gt;dead&lt;/strong&gt; Helm menu from where I chose &lt;code&gt;M-x ediff-buffers&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let me explain:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;At any point I have several windows open with a window layout L1.&lt;/li&gt;&#xA;&lt;li&gt;I want to ediff some buffers, so I press &lt;code&gt;M-x&lt;/code&gt;: This re-uses one of the windows in L1 to open up a Helm autocompletion menu. So far so good.&lt;/li&gt;&#xA;&lt;li&gt;I choose &lt;code&gt;ediff-buffers&lt;/code&gt;, and then the two buffers to compare, one after the other&lt;/li&gt;&#xA;&lt;li&gt;This takes me to an &lt;code&gt;ediff&lt;/code&gt; session where I can check differences etc.&lt;/li&gt;&#xA;&lt;li&gt;Once I am done. I quit my ediff-session.&lt;/li&gt;&#xA;&lt;li&gt;I would like to go back to my layout L1 in step #1. However, Emacs &lt;code&gt;(winner-mode)&lt;/code&gt; takes me back to step #2, where one of the Emacs windows in L1 was used to show the options in Helm. This is pointless since I am done with my ediff session.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;How can I restore windows to my original layout L1?&lt;/p&gt;&#xA;&lt;h3&gt;Setup:&lt;/h3&gt;&#xA;&lt;p&gt;This is all in &lt;code&gt;Emacs 25.0.50.1&lt;/code&gt; on OS X. More specifically, &lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.0.0, NS appkit-1343.16 Version 10.10.1 (Build 14B25))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2024-04-05T23:01:24.390" Title="Restoring windows and layout after an Ediff session" Tags="|helm|ediff|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7483" PostTypeId="2" ParentId="7481" CreationDate="2015-01-17T21:41:17.953" Score="21" Body="&lt;p&gt;Do not quote the cons cell, because quoted expressions are not evaluated. That's exactly why one quotes - to prevent evaluation. But that's not what you want, so don't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead use the form that creates a cons cell from two evaluated values, its arguments.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cons x y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course you can also quasiquote but that doesn't really make sense here, and looks worse. Only use &lt;code&gt;`&lt;/code&gt; and &lt;code&gt;,&lt;/code&gt; when that improves readability, i.e. when doing something more complex than constructing a cons cell or adding an atom or list at the beginning of some existing list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using quasiquoting it would look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(,x . ,y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is worse because it uses additional syntax which isn't required at all in this case and obfuscates that &lt;code&gt;cons&lt;/code&gt; is being used.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-06-24T13:25:55.500" LastActivityDate="2015-06-24T13:25:55.500" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7484" PostTypeId="2" ParentId="5352" CreationDate="2015-01-17T21:49:19.823" Score="1" Body="&lt;p&gt;The reason that Emacs behaves differently when it is launched from the GUI than it is when launched from a shell, very likely is that these are actually different versions of Emacs. Apple ships an ancient version of Emacs with OS X and correctly places it on &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately most of the third-party Emacs packages for OS X &lt;em&gt;don't&lt;/em&gt; place the executable on &lt;code&gt;$PATH&lt;/code&gt; so you have to do that yourself, e.g. in &lt;code&gt;~/.bashrc&lt;/code&gt; if you use bash.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-01-17T21:49:19.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7485" PostTypeId="2" ParentId="7430" CreationDate="2015-01-17T21:57:31.690" Score="1" Body="&lt;p&gt;When I yank your code into &lt;code&gt;*scratch*&lt;/code&gt;, switch to &lt;code&gt;fundamental-mode&lt;/code&gt; (which turns of the minor mode &lt;code&gt;font-lock-mode&lt;/code&gt;), and only then evaluate the expression; then it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually it shouldn't make a difference whether &lt;code&gt;font-lock-mode&lt;/code&gt; is enabled or not for properties that are not a member of &lt;code&gt;font-lock-extra-managed-props&lt;/code&gt;. So you might be right that there is a bug, as it does appear to matter in this particular case whether that minor-mode is enabled or not.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-21T20:50:41.390" LastActivityDate="2015-01-21T20:50:41.390" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7486" PostTypeId="2" ParentId="7482" CreationDate="2015-01-17T22:19:21.623" Score="5" Body="&lt;p&gt;Look at what you made me do, I was so happy with my ugly hack, and now&#xA;it's fixed:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar ediff-last-windows nil&#xA;  &quot;Last ediff window configuration.&quot;)&#xA;&#xA;(defun ediff-restore-windows ()&#xA;  &quot;Restore window configuration to `ediff-last-windows'.&quot;&#xA;  (set-window-configuration ediff-last-windows)&#xA;  (remove-hook 'ediff-after-quit-hook-internal&#xA;               'ediff-restore-windows))&#xA;&#xA;(defadvice ediff-buffers (around ediff-restore-windows activate)&#xA;  (setq ediff-last-windows (current-window-configuration))&#xA;  (add-hook 'ediff-after-quit-hook-internal 'ediff-restore-windows)&#xA;  ad-do-it)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-17T22:19:21.623" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7487" PostTypeId="2" ParentId="7481" CreationDate="2015-01-17T22:59:10.310" Score="43" Body="&lt;p&gt;The general issue is that you need &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; to be evaluated before they get inserted in &lt;code&gt;somelist&lt;/code&gt;.  The issue with the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html&quot;&gt;quoted list (with &lt;code&gt;'&lt;/code&gt; as reader syntax)&lt;/a&gt; is that &lt;code&gt;quote&lt;/code&gt; is a special form that does not evaluate its argument.  According to the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(quote ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return the argument, without evaluating it.  &lt;code&gt;(quote x)&lt;/code&gt; yields &lt;code&gt;x&lt;/code&gt;.&#xA;  Warning: &lt;code&gt;quote&lt;/code&gt; does not construct its return value, but just returns&#xA;  the value that was pre-constructed by the Lisp reader...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hence, you either need to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot;&gt;backquote&lt;/a&gt; or use a function that evaluates the arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Backquoting allows you to evaluate elements of a backquoted list selectively with the &lt;code&gt;,&lt;/code&gt; syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x &quot;x-val&quot; y &quot;y-val&quot; z &quot;z-val&quot; somelist nil)&#xA;'(x  y z)                            ; =&amp;gt; (x y z)&#xA;`(x ,y z)                            ; =&amp;gt; (x &quot;y-val&quot; z)&#xA;(add-to-list 'somelist `(x y ,z))    ; =&amp;gt; ((x y &quot;z-val&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternately, you can use &lt;code&gt;cons&lt;/code&gt; (as @tarsius suggests in his answer) or, for an arbitrary number of elements, &lt;code&gt;list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'somelist (cons x y))   ; =&amp;gt; ((&quot;x-val&quot; . &quot;y-val&quot;))&#xA;(setq somelist nil)                  ; reset&#xA;(add-to-list 'somelist (list x y z)) ; =&amp;gt; ((&quot;x-val&quot; &quot;y-val&quot; &quot;z-val&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which to use depends on what you need to do with the elements.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-17T22:59:10.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7488" PostTypeId="2" ParentId="2871" CreationDate="2015-01-18T00:37:34.197" Score="5" Body="&lt;p&gt;I use Git to synchronize my org-mode files. I have a &lt;a href=&quot;https://github.com/501st-alpha1/scott-script/blob/master/gitsync&quot; rel=&quot;noreferrer&quot;&gt;Bash script&lt;/a&gt; that I leave running in the background, which automatically commits the file every minute (by default), and then pushes or pulls as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pseudo-code version:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Commit local changes and update remotes.&lt;/li&gt;&#xA;&lt;li&gt;Find local commit with &lt;code&gt;git rev-parse @&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Find remote commit with &lt;code&gt;git rev-parse @{u}&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Find base with &lt;code&gt;git merge-base @ @{u}&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;If local commit equals remote commit, then we are done; everything is up-to-date.&lt;/li&gt;&#xA;&lt;li&gt;If local commit equals base, then remote has extra commits, so do &lt;code&gt;git pull&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If remote commit equals base, then local has extra commits, so do &lt;code&gt;git push&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Otherwise, both local and remote has extra commits. My script tries to resolve this automatically (with &lt;code&gt;git pull&lt;/code&gt;), but if it can't, will send a bell and exit for the user to fix manually.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Those 8 steps run in a loop, not stopping until I exit manually with &lt;code&gt;C-c&lt;/code&gt;, or there is an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this script on Windows using &lt;a href=&quot;http://cygwin.com/&quot; rel=&quot;noreferrer&quot;&gt;Cygwin&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="675" LastActivityDate="2015-01-18T00:37:34.197" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7489" PostTypeId="1" CreationDate="2015-01-18T02:48:23.733" Score="1" ViewCount="904" Body="&lt;p&gt;Having trouble configuring emacs 24 on Mac OS X to work with cocosAspell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Installed MacTex dist. with success;&#xA;Installed AUCTex through emacs package manager;&#xA;Downloaded and installed the brazilian portuguese dic. for Aspell: aspell6-pt_BR-20090702-0;&#xA;tried to config my .emacs files reading a lot of sources but none worked.&#xA;Does anyone uses multi languages configurations like this? How do you set up your .emacs file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My objective is to use both english and brazilian portuguese dicts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please! need help with this.&lt;/p&gt;&#xA;" OwnerUserId="5231" LastActivityDate="2015-01-19T15:21:45.590" Title="cocoAspell + Emacs 24 + Mac OS X Yosemite" Tags="|ispell|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7490" PostTypeId="2" ParentId="2871" CreationDate="2015-01-18T04:36:01.660" Score="1" Body="&lt;p&gt;I'm currently using &lt;code&gt;btsync&lt;/code&gt;, but there are several open (and more cumbersome) alternatives around. It basically watches the directory and syncs it to all other running devices as soon as they get online. A dropbox without the cloud so to speak. Since it uses distributed hash tables and the torrent protocol firewalls aren't an issue either, and there are mobile clients, too. And it transfers everything encrypted.&lt;/p&gt;&#xA;" OwnerUserId="5191" LastActivityDate="2015-01-18T04:36:01.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7491" PostTypeId="1" CreationDate="2015-01-18T06:38:27.973" Score="7" ViewCount="2419" Body="&lt;p&gt;When you start Emacs with &lt;code&gt;emacs -Q&lt;/code&gt;, there appears to be some sort of default color scheme. Where are these colors defined? The default theme does not show up with &lt;code&gt;M-x customize&lt;/code&gt;, nor can I find it in &lt;code&gt;etc/themes&lt;/code&gt;. I have even tried taking a screenshot of the theme, figuring out the hex codes and doing &lt;code&gt;grep -r 'a020f0' .&lt;/code&gt; and &lt;code&gt;grep -r 'b22222' .&lt;/code&gt; inside the source tree, but I can't find anything.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2015-05-18T10:22:02.127" Title="Where is the default color / custom theme defined?" Tags="|customize|themes|custom|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7492" PostTypeId="1" AcceptedAnswerId="7495" CreationDate="2015-01-18T07:52:00.123" Score="6" ViewCount="1158" Body="&lt;p&gt;Say, the &lt;code&gt;C-M-j&lt;/code&gt; is bound to &lt;code&gt;c-indent-new-comment-line&lt;/code&gt; for c-mode (and c++-mode) and &lt;code&gt;indent-new-comment-line&lt;/code&gt; for other modes, but I want to define a function that will execute &lt;code&gt;C-M-j&lt;/code&gt; to &lt;code&gt;c-indent-new-comment-line&lt;/code&gt; in c-mode (and c++-mode) and &lt;code&gt;indent-new-comment-line&lt;/code&gt; in other modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any simple way that I can just embed the shortcut but not check the current major mode and then execute the different functions in &lt;code&gt;defun...&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun example-fn ()&#xA;  (interactive)&#xA;  (beginning-of-line)&#xA;  (execute-C-M-j)&#xA;  (next-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;(execute-C-M-j)&lt;/code&gt; is what I want, execute the key not the command it is bound to, but I don't know how to implement this?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2015-01-18T08:51:40.007" LastActivityDate="2015-01-18T08:51:40.007" Title="Is possible to execute a key binding in a function?" Tags="|key-bindings|keymap|major-mode|keyboard-macros|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7493" PostTypeId="2" ParentId="7491" CreationDate="2015-01-18T08:04:27.973" Score="3" Body="&lt;p&gt;Thanks lawlist for pointing me in the right direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize I was not being clear in my question. I was primarily concerned with finding the default &lt;em&gt;&lt;code&gt;font-lock&lt;/code&gt;&lt;/em&gt; faces. Found them in &lt;code&gt;font-lock.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Color etc. support.&#xA;&#xA;;; Note that `defface' will not overwrite any faces declared above via&#xA;;; `custom-declare-face'.&#xA;(defface font-lock-comment-face&#xA;  '((((class grayscale) (background light))&#xA;     :foreground &quot;DimGray&quot; :weight bold :slant italic)&#xA;    (((class grayscale) (background dark))&#xA;     :foreground &quot;LightGray&quot; :weight bold :slant italic)&#xA;    (((class color) (min-colors 88) (background light))&#xA;     :foreground &quot;Firebrick&quot;)&#xA;    (((class color) (min-colors 88) (background dark))&#xA;     :foreground &quot;chocolate1&quot;)&#xA;    (((class color) (min-colors 16) (background light))&#xA;     :foreground &quot;red&quot;)&#xA;    (((class color) (min-colors 16) (background dark))&#xA;     :foreground &quot;red1&quot;)&#xA;    (((class color) (min-colors 8) (background light))&#xA;     :foreground &quot;red&quot;)&#xA;    (((class color) (min-colors 8) (background dark))&#xA;     :foreground &quot;yellow&quot;)&#xA;    (t :weight bold :slant italic))&#xA;  &quot;Font Lock mode face used to highlight comments.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-comment-delimiter-face&#xA;  '((default :inherit font-lock-comment-face))&#xA;  &quot;Font Lock mode face used to highlight comment delimiters.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-string-face&#xA;  '((((class grayscale) (background light)) :foreground &quot;DimGray&quot; :slant italic)&#xA;    (((class grayscale) (background dark))  :foreground &quot;LightGray&quot; :slant italic)&#xA;    (((class color) (min-colors 88) (background light)) :foreground &quot;VioletRed4&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;LightSalmon&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;RosyBrown&quot;)&#xA;    (((class color) (min-colors 16) (background dark))  :foreground &quot;LightSalmon&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;green&quot;)&#xA;    (t :slant italic))&#xA;  &quot;Font Lock mode face used to highlight strings.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-doc-face&#xA;  '((t :inherit font-lock-string-face))&#xA;  &quot;Font Lock mode face used to highlight documentation.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-keyword-face&#xA;  '((((class grayscale) (background light)) :foreground &quot;LightGray&quot; :weight bold)&#xA;    (((class grayscale) (background dark))  :foreground &quot;DimGray&quot; :weight bold)&#xA;    (((class color) (min-colors 88) (background light)) :foreground &quot;Purple&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;Cyan1&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;Purple&quot;)&#xA;    (((class color) (min-colors 16) (background dark))  :foreground &quot;Cyan&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;cyan&quot; :weight bold)&#xA;    (t :weight bold))&#xA;  &quot;Font Lock mode face used to highlight keywords.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-builtin-face&#xA;  '((((class grayscale) (background light)) :foreground &quot;LightGray&quot; :weight bold)&#xA;    (((class grayscale) (background dark))  :foreground &quot;DimGray&quot; :weight bold)&#xA;    (((class color) (min-colors 88) (background light)) :foreground &quot;dark slate blue&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;LightSteelBlue&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;Orchid&quot;)&#xA;    (((class color) (min-colors 16) (background dark)) :foreground &quot;LightSteelBlue&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;blue&quot; :weight bold)&#xA;    (t :weight bold))&#xA;  &quot;Font Lock mode face used to highlight builtins.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-function-name-face&#xA;  '((((class color) (min-colors 88) (background light)) :foreground &quot;Blue1&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;LightSkyBlue&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;Blue&quot;)&#xA;    (((class color) (min-colors 16) (background dark))  :foreground &quot;LightSkyBlue&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;blue&quot; :weight bold)&#xA;    (t :inverse-video t :weight bold))&#xA;  &quot;Font Lock mode face used to highlight function names.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-variable-name-face&#xA;  '((((class grayscale) (background light))&#xA;     :foreground &quot;Gray90&quot; :weight bold :slant italic)&#xA;    (((class grayscale) (background dark))&#xA;     :foreground &quot;DimGray&quot; :weight bold :slant italic)&#xA;    (((class color) (min-colors 88) (background light)) :foreground &quot;sienna&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;LightGoldenrod&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;DarkGoldenrod&quot;)&#xA;    (((class color) (min-colors 16) (background dark))  :foreground &quot;LightGoldenrod&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;yellow&quot; :weight light)&#xA;    (t :weight bold :slant italic))&#xA;  &quot;Font Lock mode face used to highlight variable names.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-type-face&#xA;  '((((class grayscale) (background light)) :foreground &quot;Gray90&quot; :weight bold)&#xA;    (((class grayscale) (background dark))  :foreground &quot;DimGray&quot; :weight bold)&#xA;    (((class color) (min-colors 88) (background light)) :foreground &quot;ForestGreen&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;PaleGreen&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;ForestGreen&quot;)&#xA;    (((class color) (min-colors 16) (background dark))  :foreground &quot;PaleGreen&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;green&quot;)&#xA;    (t :weight bold :underline t))&#xA;  &quot;Font Lock mode face used to highlight type and classes.&quot;&#xA;  :group 'font-lock-faces)&#xA;&#xA;(defface font-lock-constant-face&#xA;  '((((class grayscale) (background light))&#xA;     :foreground &quot;LightGray&quot; :weight bold :underline t)&#xA;    (((class grayscale) (background dark))&#xA;     :foreground &quot;Gray50&quot; :weight bold :underline t)&#xA;    (((class color) (min-colors 88) (background light)) :foreground &quot;dark cyan&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;Aquamarine&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;CadetBlue&quot;)&#xA;    (((class color) (min-colors 16) (background dark))  :foreground &quot;Aquamarine&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;magenta&quot;)&#xA;    (t :weight bold :underline t))&#xA;  &quot;Font Lock mode face used to highlight constants and labels.&quot;&#xA;  :group 'font-lock-faces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a light background (also, another point I was vague on; I only really cared about the case of a light background), they are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Comment: Firebrick&lt;/li&gt;&#xA;&lt;li&gt;String: VioletRed4&lt;/li&gt;&#xA;&lt;li&gt;Keyword: Purple&lt;/li&gt;&#xA;&lt;li&gt;Builtin: dark slate blue&lt;/li&gt;&#xA;&lt;li&gt;Function name: Blue1&lt;/li&gt;&#xA;&lt;li&gt;Variable name: sienna&lt;/li&gt;&#xA;&lt;li&gt;Type: ForestGreen&lt;/li&gt;&#xA;&lt;li&gt;Constant: dark cyan&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2015-01-18T08:04:27.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7494" PostTypeId="1" AcceptedAnswerId="7498" CreationDate="2015-01-18T08:15:18.880" Score="7" ViewCount="1072" Body="&lt;p&gt;I'm writing a &lt;a href=&quot;http://github.com/rocky/emacs-dbgr&quot; rel=&quot;nofollow&quot;&gt;debugger front end&lt;/a&gt;, and in that over the course of program execution a number of marks get added inside the source code. In other buffers such as a buffer showing execution history, or a buffer containing backtrace or callstack, I'd like to have in those buffers text information that click through to the source text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Clickable-Text.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Clickable-Text.html&lt;/a&gt; , the process to add clickable text seems a bit cumbersome. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example just to set a region of text to be clickable I need something like: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq link-start (point))&#xA;(insert (format &quot;%s&quot; (realgud-loc-marker loc)))&#xA;(setq link-end (point))&#xA;(add-text-properties&#xA; link-start link-end&#xA; '(mouse-face highlight&#xA;      help-echo &quot;mouse-2: go to this location&quot;))&#xA;(setq map (make-sparse-keymap))&#xA;(define-key map [mouse-2] 'realgud:follow-link)&#xA;(define-key map [mouse-1] 'realgud:follow-link)&#xA;(define-key map [follow-link] 'mouse-face)&#xA;(put-text-property link-start link-end 'keymap map)&#xA;(put-text-property link-start link-end 'loc loc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I also need a definition to realgud:follow-link: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun realgud:follow-link(event)&#xA;  (interactive &quot;e&quot;)&#xA;  (let* ((pos (posn-point (event-end event)))&#xA;     (loc (get-text-property pos 'loc)))&#xA;    (if (realgud-loc-p loc)&#xA;      (realgud-loc-goto loc))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All of this seems a bit boilerplate and there's a lot of it. I could write my own routines, for this, but since this seems like a pretty basic think to do: link some text in a buffer to a mark somewhere else, I figure there must already be a package that simplifies the above. Is there? &lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="105" LastEditDate="2016-08-22T00:56:42.650" LastActivityDate="2016-08-22T00:56:42.650" Title="Is there a package to simplify clickable text?" Tags="|mark|realgud|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7495" PostTypeId="2" ParentId="7492" CreationDate="2015-01-18T08:19:58.570" Score="9" Body="&lt;p&gt;You can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Calling-Functions.html&quot;&gt;&lt;code&gt;funcall&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;key-binding&lt;/code&gt; to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall (key-binding (kbd &quot;C-M-j&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will execute the function currently bound to &lt;code&gt;C-M-j&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;funcall&lt;/code&gt; lets you pass in arguments as well, if needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Call.html&quot;&gt;&lt;code&gt;call-interactively&lt;/code&gt;&lt;/a&gt; to call a command bound to a key like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-interactively (key-binding (kbd &quot;C-M-j&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-01-18T08:19:58.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7496" PostTypeId="1" AcceptedAnswerId="7497" CreationDate="2015-01-18T08:38:24.860" Score="2" ViewCount="289" Body="&lt;p&gt;If I do &lt;code&gt;M-x insert TAB&lt;/code&gt;  Emacs shows a list of possible completions like below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Possible completions are:&#xA;insert-abbrevs              insert-anniversary-diary-entry&#xA;insert-block-diary-entry    insert-buffer&#xA;insert-char                 insert-cyclic-diary-entry&#xA;insert-diary-entry          insert-file&#xA;insert-file-literally       insert-kbd-macro&#xA;insert-monthly-diary-entry  insert-pair&#xA;insert-parentheses          insert-register&#xA;insert-weekly-diary-entry   insert-yearly-diary-entry&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What if one likes to have a list of all completions in which the string &lt;code&gt;insert&lt;/code&gt; exists, for example &lt;code&gt;auto-insert&lt;/code&gt; which is not given in the above list.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-01-18T17:23:31.823" LastActivityDate="2015-01-18T20:28:49.673" Title="M-x command completions to all occurrences of a substring" Tags="|completion|commands|m-x|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7497" PostTypeId="2" ParentId="7496" CreationDate="2015-01-18T08:43:54.590" Score="3" Body="&lt;p&gt;&lt;code&gt;*insert&lt;/code&gt; &lt;kbd&gt;TAB&lt;/kbd&gt; will work for &lt;code&gt;execute-extended-command&lt;/code&gt;,&#xA;but &lt;a href=&quot;https://github.com/nonsequitur/smex&quot; rel=&quot;nofollow&quot;&gt;smex&lt;/a&gt; is just much better.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-18T08:43:54.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7498" PostTypeId="2" ParentId="7494" CreationDate="2015-01-18T08:54:53.930" Score="8" Body="&lt;p&gt;Emacs provides &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Buttons&quot;&gt;buttons&lt;/a&gt; to abstract away these steps, I'd suggest looking at the Emacs sources for instances of &lt;code&gt;make-button&lt;/code&gt; and &lt;code&gt;insert-button&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-18T08:54:53.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7499" PostTypeId="2" ParentId="7223" CreationDate="2015-01-18T11:06:10.973" Score="2" Body="&lt;p&gt;To enable a minor-mode you have to use the &lt;code&gt;eval&lt;/code&gt; keyword as explained in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;nofollow&quot;&gt;Specifying File Variables&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To enable or disable a minor mode in a local variables list, use the &lt;code&gt;eval&lt;/code&gt; keyword with a Lisp expression that runs the mode command.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;While that isn't explicitly mentioned in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables&quot; rel=&quot;nofollow&quot;&gt;Per-Directory Local Variables&lt;/a&gt; it does apply here to - after all directory variables are just a convenient way of specifying file-local variables.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((org-mode . ((eval . (auto-revert-mode 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-01-18T11:06:10.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7500" PostTypeId="2" ParentId="5529" CreationDate="2015-01-18T11:12:25.683" Score="0" Body="&lt;p&gt;This isn't supported out-of-the-box but the &lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smart-mode-line&lt;/code&gt;&lt;/a&gt; package does support this. You could either use that package, or if it does more than what you want, extract just the bits that implement the feature you are asking for.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-01-18T11:12:25.683" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7501" PostTypeId="1" CreationDate="2015-01-18T11:36:48.900" Score="1" ViewCount="90" Body="&lt;p&gt;I can't seem to get abbrevs working in ess-mode when editing .R files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have ess-mode hook to activate abbrev-mode, but I get no expansion for my global abbrevs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;code&gt;add-mode-abbrev&lt;/code&gt; I can add an abbrev, but it is not written to my abbrev file and of course doesn't get ever expanded (after &lt;code&gt;read-abbrev-file&lt;/code&gt; or restart).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I by hand add something like this into my abbrev file and reload:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'ess-mode-abbrev-table&#xA;'(&#xA;    (&quot;-=&quot; &quot;&amp;lt;-&quot; nil 0)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it doesn't work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make ess-mode aware of my abbrevs?&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2016-09-22T19:31:10.950" Title="Adding abbrevs in ess-mode" Tags="|abbrev|ess|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7502" PostTypeId="1" AcceptedAnswerId="7634" CreationDate="2015-01-18T11:51:11.570" Score="1" ViewCount="115" Body="&lt;p&gt;This question is related to &lt;a href=&quot;https://emacs.stackexchange.com/q/547/2609&quot;&gt;how to detect if inside a LaTeX math environment?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to do the correct settings in &lt;code&gt;.emacs&lt;/code&gt; in such a way that the variable &lt;code&gt;texmathp&lt;/code&gt; takes the value &lt;code&gt;t&lt;/code&gt; (like in math formulae) when the cursor is at the following commands?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\newpage ;command for creating a new page&#xA;\label{blabla}&#xA;\cite{blabla}&#xA;\ref{blabla}&#xA;\footnote{blabla}&#xA;\section{blabla}&#xA;\chapter{blabla}&#xA;\\ ;command for creating a new line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the &lt;a href=&quot;https://emacs.stackexchange.com/a/548/2609&quot;&gt;answer&lt;/a&gt; it was mentioned that one can use &lt;code&gt;texmathp-tex-commands&lt;/code&gt; to achieve such things. Let me ask how to do it for the above formulae.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-01-22T14:53:05.647" Title="Detection inside general LaTeX (not necessarily Math) commands" Tags="|latex|auctex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7503" PostTypeId="2" ParentId="6083" CreationDate="2015-01-18T12:46:30.560" Score="44" Body="&lt;p&gt;Update: What Magit does not support is to &lt;em&gt;display&lt;/em&gt; the sort of tiny hunks that are used as examples in the question. This is how I understood that question: &amp;quot;how do I make Magit &lt;em&gt;display&lt;/em&gt; such smaller hunks instead of the hunks it is actually displaying?&amp;quot; The correct answer to that is still &amp;quot;that's not possible&amp;quot; and below I give that answer using more words.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;However, Magit does support &amp;quot;applying&amp;quot; only parts of a displayed hunk.&lt;/strong&gt; To do that one has to use the region to mark the part that one wants to apply before invoking the apply command.&lt;/p&gt;&#xA;&lt;p&gt;Here &amp;quot;apply&amp;quot; stands for a family of actions that include staging, unstaging, &amp;quot;actual apply&amp;quot; and a few others. See &lt;a href=&quot;https://magit.vc/manual/magit/Applying.html&quot; rel=&quot;noreferrer&quot;&gt;Applying&lt;/a&gt; as well as &lt;a href=&quot;https://magit.vc/manual/magit/Staging-and-Unstaging.html&quot; rel=&quot;noreferrer&quot;&gt;Staging and Unstaging&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;As mentioned in the comments above, Magit does not support splitting a hunk into multiple hunks beyond what is possible by using &lt;code&gt;git diff -U&amp;lt;n&amp;gt;&lt;/code&gt;. That's because Magit relies on that Git command to create the diffs. That isn't going to change, Magit will always use the diffs it gets from Git as-is.&lt;/p&gt;&#xA;&lt;p&gt;(Actually Magit does strip some headers which are not really relevant to humans, but does restore them when applying changes. But splitting a hunk further than what &lt;code&gt;-U&amp;lt;n&amp;gt;&lt;/code&gt; supports is a whole different story, it would lead down a rabbit hole - there's a reason why Git doesn't allow &amp;quot;smaller hunks&amp;quot;, it wouldn't be able to apply them).&lt;/p&gt;&#xA;&lt;p&gt;While Magit does not support displaying smaller hunks as asked for here, it does support applying just parts of a hunk. When the region is active while staging, then only that part of the hunk is applied.&lt;/p&gt;&#xA;&lt;p&gt;That doesn't help much when the part which should not be staged is right in the middle of the text which should be staged. As others have suggested, what you should do in this case is to stage the whole hunk, and then unstage the line which you don't want to commit in a second step.&lt;/p&gt;&#xA;&lt;p&gt;That could of course be automated. The only way I can see in which this could be automated is to &amp;quot;stage the current hunk &lt;em&gt;except&lt;/em&gt; for the region. But I do have some doubts about how often that would actually be useful and fear that it would not be easy to implement that robustly. And so I do not currently intend to implement this.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2020-07-15T22:08:16.277" LastActivityDate="2020-07-15T22:08:16.277" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="7504" PostTypeId="2" ParentId="5698" CreationDate="2015-01-18T12:53:24.873" Score="0" Body="&lt;p&gt;Well, that error message indicates that it isn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that you want this because in your opinion variable-width fonts look better, but you also want to use a monospace font for spaces because that would help reducing the effect on indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That seems reasonable - and it might be a good idea to request this feature on &lt;a href=&quot;https://lists.gnu.org/mailman/listinfo/emacs-devel&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;emacs-devel&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-01-18T12:53:24.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7505" PostTypeId="2" ParentId="5413" CreationDate="2015-01-18T13:06:30.730" Score="1" Body="&lt;p&gt;&lt;code&gt;color-theme&lt;/code&gt; is an old third-party package which is no longer required since Emacs version 24.1, which comes with built-in support for color themes. In fact loading &lt;code&gt;color-theme&lt;/code&gt; is going to mess up the built-in support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So don't load &lt;code&gt;color-theme&lt;/code&gt; and only use themes which are compatible with the built-in theme functionality. The new themes are named &lt;code&gt;NAME-theme&lt;/code&gt; while the old ones which can no longer be used usually are named &lt;code&gt;color-theme-NAME&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-01-18T13:06:30.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7506" PostTypeId="2" ParentId="2594" CreationDate="2015-01-18T13:09:20.383" Score="6" Body="&lt;p&gt;To avoid having to track down the packages that are required to build Emacs, use apt-get to install them for you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apt-get build-dep emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually this may not be enough, as this just installs the libraries the Debian maintainer has chosen to link Emacs against. I think you need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apt-get install libm17n-dev libmagickcore-dev&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However after this I still got &lt;code&gt;use -lm17n-flt? no&lt;/code&gt; even when I explicitly used &lt;code&gt;--with-m17n-flt&lt;/code&gt;. And I did not actually install libmagickcore-dev` because it resulted in a conflict.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-20T20:09:43.220" LastActivityDate="2015-01-20T20:09:43.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7507" PostTypeId="1" AcceptedAnswerId="7511" CreationDate="2015-01-18T13:10:08.853" Score="0" ViewCount="50" Body="&lt;p&gt;When I run &lt;code&gt;compile&lt;/code&gt;, I'm seeing a strange behavior where the shell command is being executed in the parent of &lt;code&gt;default-directory&lt;/code&gt; rather than &lt;code&gt;default-directory&lt;/code&gt; itself. Here's an example of what I'm doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(let ((default-directory &quot;~/projects&quot;))&#xA;  (compile &quot;pwd&quot;))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here's what shows up in the &lt;code&gt;*compilation*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;-*-mode: compilation; default-directory: &quot;~/projects/&quot; -*-&#xA;Compilation started at Sun Jan 18 14:03:45&#xA;pwd&#xA;/Users/sixtynorth&#xA;Compilation finished at Sun Jan 18 14:03:45&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, on the first line of &lt;code&gt;*compilation*&lt;/code&gt; the &lt;code&gt;default-directory&lt;/code&gt; is correct. But when &lt;code&gt;pwd&lt;/code&gt; actually executes I've been changed to the parent directory. This behavior seems consistent across different directories, commands, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any idea what might be going on? I've poked through the &lt;code&gt;compile&lt;/code&gt; code, but nothing looks suspicious. I've also looked in my shell configuration for anything that might be causing problems, but again nothing jumped out at me. Any thoughts or ideas would be great.&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2015-01-18T13:47:36.367" Title="Why are my compilations executed in the parent of `default-directory`?" Tags="|compilation|directories|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7508" PostTypeId="2" ParentId="5893" CreationDate="2015-01-18T13:17:25.310" Score="7" Body="&lt;p&gt;You can use wildcards with &lt;code&gt;find-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f ~/path/to/*.org RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will open all org files in &lt;code&gt;/path/to/&lt;/code&gt;. You could also use &lt;code&gt;find-file-other-frame&lt;/code&gt; to instantly display all the buffers that were created.  Otherwise the buffers are created but only one is displayed initially.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does not open org files in subdirectories. To do that &lt;em&gt;additionally&lt;/em&gt; use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f ~/path/to/*/*.org RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use additional instances of &lt;code&gt;*/&lt;/code&gt; to open files nested even deeper. I don't think there's a magical wildcard that stands for &quot;this directory and all its subdirectories&quot;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-18T13:50:01.617" LastActivityDate="2015-01-18T13:50:01.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7509" PostTypeId="2" ParentId="5954" CreationDate="2015-01-18T13:29:38.287" Score="4" Body="&lt;p&gt;Use &lt;code&gt;display-pixel-width&lt;/code&gt; and &lt;code&gt;display-pixel-height&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-01-18T13:29:38.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7510" PostTypeId="2" ParentId="6077" CreationDate="2015-01-18T13:46:12.777" Score="5" Body="&lt;p&gt;Do it like you would do it in &lt;code&gt;xterm&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export VARIABLE=VALUE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you always want to set the same variables in &lt;code&gt;shell-mode&lt;/code&gt; but not &lt;code&gt;xterm&lt;/code&gt; then add this to your shells init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if test -n &quot;$INSIDE_EMACS&quot;&#xA;then&#xA;    export VARIABLE=VALUE&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or in Emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'shell-mode-hook 'my-shell-mode-hook)&#xA;(defun my-shell-mode-hook ()&#xA;  (process-send-string (get-buffer-process (current-buffer))&#xA;                       &quot;export VARIABLE=VALUE\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that when using Zsh then I am having problems with this, with Dash or Bash it works without any problems.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-01-18T20:52:34.063" LastActivityDate="2015-01-18T20:52:34.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7511" PostTypeId="2" ParentId="7507" CreationDate="2015-01-18T13:47:36.367" Score="3" Body="&lt;p&gt;The value of &lt;code&gt;default-directory&lt;/code&gt; has to end with a slash.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-01-18T13:47:36.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7512" PostTypeId="2" ParentId="7494" CreationDate="2015-01-18T15:57:01.110" Score="4" Body="&lt;p&gt;If your clickable text can be defined by a regular expression, the &lt;a href=&quot;https://github.com/rolandwalker/button-lock#button-lock&quot; rel=&quot;nofollow&quot;&gt;button-lock&lt;/a&gt; library combines buttons with font-lock, and can define clickable patterns in one step.  Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(button-lock-set-button &quot;http://google.com&quot; 'browse-url-at-mouse)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5239" LastActivityDate="2015-01-18T15:57:01.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7513" PostTypeId="1" AcceptedAnswerId="7520" CreationDate="2015-01-18T16:32:13.663" Score="2" ViewCount="823" Body="&lt;p&gt;I'm attempting to change the mapping of evil mode, and I have placed the code below in my &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start emacs some of the keys have been remapped, while others have not&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These keys got remapped correctly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;e down&#xA;n back&#xA;s insert&#xA;t append&#xA;z undo&#xA;Z redo&#xA;c copy line&#xA;v paste&#xA;l previous word&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These keys did not:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;u up&#xA;i forward&#xA;y next word&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have changed more than what's listed here, but these are what I tested.&lt;br&gt;&#xA;The relevant additions to &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map &quot;e&quot; 'evil-next-line)&#xA;(define-key evil-motion-state-map &quot;n&quot; 'evil-backward-char)&#xA;(define-key evil-normal-state-map &quot;z&quot; 'undo)&#xA;(define-key evil-normal-state-map &quot;Z&quot; 'redo)&#xA;(define-key evil-normal-state-map &quot;c&quot; 'evil-yank)&#xA;(define-key evil-normal-state-map &quot;v&quot; 'evil-paste-after)&#xA;(define-key evil-motion-state-map &quot;l&quot; 'evil-backward-word-begin)&#xA;&#xA;(define-key evil-motion-state-map &quot;u&quot; 'evil-previous-line)&#xA;(define-key evil-motion-state-map &quot;i&quot; 'evil-forward-char)&#xA;(define-key evil-motion-state-map &quot;y&quot; 'evil-forward-word-end)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5241" LastEditorUserId="5241" LastEditDate="2015-01-18T16:50:58.317" LastActivityDate="2015-01-18T18:26:58.847" Title="Attempt at remapping evil only remaps some of the keys" Tags="|keymap|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7514" PostTypeId="2" ParentId="5893" CreationDate="2015-01-18T16:36:07.760" Score="4" Body="&lt;p&gt;As @grettke mentioned in the comments, this question is not specific to org mode. From what I understand you need a solution to quickly open any file from a &quot;project&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case, you can try using the &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;projectile&lt;/code&gt;&lt;/a&gt; package, also available through Melpa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For projectile to work on your set of files, you need to define that set as being a part of a &quot;project&quot;. The easiest way to do so is by doing &lt;code&gt;git init&lt;/code&gt; in the base directory of your &quot;project&quot; i.e. &lt;code&gt;org&lt;/code&gt; directory. You can do this even if you don't plan to later git manage your files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have &lt;code&gt;projectile&lt;/code&gt; set up as per its documentation, here are some usage scenarios:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let's say you have one of your org files open and you want to open some other file from the same &quot;project&quot;. You can do that by doing &lt;code&gt;C-c p f&lt;/code&gt; or &lt;code&gt;M-x projectile-find-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Let's say you are working on a file NOT in that &quot;project&quot; and you want to quickly go to one of your org files. You can do &lt;code&gt;C-c p p&lt;/code&gt; or &lt;code&gt;M-x projectile-switch-project&lt;/code&gt;, select the project you want to switch to ( &lt;code&gt;org&lt;/code&gt; ) and then pick one of the files from that project.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This setup compliments very well with the emacs built-in &lt;code&gt;desktop&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest way to get the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html&quot; rel=&quot;nofollow&quot;&gt;desktop save and restore&lt;/a&gt; working is by adding these to your emacs init. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'desktop)&#xA;(desktop-save-mode 1) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-18T16:36:07.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7515" PostTypeId="1" AcceptedAnswerId="7528" CreationDate="2015-01-18T17:00:31.767" Score="1" ViewCount="359" Body="&lt;p&gt;The line below is in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'semantic/db-javap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it is causing the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;semantic/db-javap&quot;)&#xA;  require(semantic/db-javap)&#xA;  eval((require (quote semantic/db-javap)) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are other semantic lines in my init file too, but this is the only one throwing an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that CEDET comes installed by default, so why is this the only file missing? And what can I do to fix it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other relevant lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-ede-mode 1) ; Enable the Project management system&#xA;(require 'semantic/sb)&#xA;(require 'semantic/bovine/gcc)&#xA;(require 'semantic/db-javap)&#xA;(require 'semantic/ia)&#xA;(add-to-list 'semantic-default-submodes &#xA;         '(global-semantic-idle-local-symbol-highlight-mode &#xA;          global-semantic-idle-scheduler-mode&#xA;          global-semantic-idle-completions-mode))&#xA;(semantic-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs version 24.3.1&lt;/p&gt;&#xA;" OwnerUserId="5240" LastEditorUserId="105" LastEditDate="2015-01-18T17:12:49.117" LastActivityDate="2015-01-19T00:14:55.217" Title="Issues setting up Java code completion in CEDET. Cannot find semantic/db-javap" Tags="|init-file|completion|semantic-mode|java|cedet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7516" PostTypeId="2" ParentId="7496" CreationDate="2015-01-18T17:21:44.443" Score="1" Body="&lt;p&gt;In &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; you get such completion using &lt;strong&gt;&lt;code&gt;S-TAB&lt;/code&gt;&lt;/strong&gt; (by default - you can change the key, of course). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;TAB&lt;/code&gt;&lt;/strong&gt; gives you prefix completion. (Or vanilla Emacs completion - e.g., &lt;code&gt;*insert TAB&lt;/code&gt; will do as @abo-abo indicated.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;S-TAB&lt;/code&gt;&lt;/strong&gt; gives you &quot;&lt;em&gt;apropos&lt;/em&gt;&quot;-style (i.e., regexp) completion, which of course includes substring completion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Just use a different completion key, &lt;code&gt;TAB&lt;/code&gt; or &lt;code&gt;S-TAB&lt;/code&gt;, to get a different kind of completion. And for each of these keys you can use different completion &lt;em&gt;methods&lt;/em&gt;, including various fuzzy completion methods. You can cycle among the methods using &lt;strong&gt;&lt;code&gt;C-(&lt;/code&gt;&lt;/strong&gt; (for &lt;code&gt;TAB&lt;/code&gt;) and &lt;strong&gt;&lt;code&gt;M-(&lt;/code&gt;&lt;/strong&gt; (for &lt;code&gt;S-TAB&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this is true not only for &lt;code&gt;M-x&lt;/code&gt; but for &lt;em&gt;everything&lt;/em&gt; - any minibuffer input completion.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And BTW, Icicles does &lt;em&gt;not&lt;/em&gt; &quot;steal&quot; your &lt;code&gt;M-x&lt;/code&gt; key. Whether you keep &lt;code&gt;M-x&lt;/code&gt; bound to standard command &lt;code&gt;execute-extended-command&lt;/code&gt; or you bind it to Icicles multi-command &lt;code&gt;icicle-execute-extended-command&lt;/code&gt; is up to you. And in either case you can take advantage of Icicles completion when &lt;code&gt;icicle-mode&lt;/code&gt; is turned on. (If you turn off &lt;code&gt;icicle-mode&lt;/code&gt; then you are back to vanilla Emacs behavior, for &lt;code&gt;M-x&lt;/code&gt; and for everything else.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, you do get special &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi_M-x&quot; rel=&quot;nofollow&quot;&gt;multi-command behavior for &lt;code&gt;M-x&lt;/code&gt;&lt;/a&gt;, but it is trivial to customize option &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Key_Bindings#IcicleModeBindings&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-top-level-key-bindings&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to choose which keys you want to have take advantage of any special Icicles commands.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-01-18T20:28:49.673" LastActivityDate="2015-01-18T20:28:49.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7517" PostTypeId="2" ParentId="7494" CreationDate="2015-01-18T17:27:45.727" Score="0" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/linkd.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;linkd.el&lt;/code&gt;&lt;/a&gt; provides a very simple way to add clickable text to your files.  From the source file Commentary:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Linkd-mode is a major mode that automatically recognizes and&#xA;processes certain S-expressions, called &quot;links&quot;, embedded in plain&#xA;text files.  Links may be followed by invoking certain interactive&#xA;functions when point is on the link text.  Links may also be&#xA;interpreted as marking up the surrounding text.  Different types&#xA;of links have different behaviors when followed, and they may have&#xA;different interpretations as markup.&#xA;&#xA;With Linkd mode, you can do the following:&#xA;* Embed hyperlinks to files, webpages, or documentation into&#xA;  any type of text file in any major mode.&#xA;* Delimit and name regions of text (&quot;blocks&quot;) in these text files.&#xA;* Extract and send blocks to other programs for processing.&#xA;* Identify and mark locations and concepts in source code.&#xA;* Embed active data objects (&quot;datablocks&quot;) into text files.&#xA;* Convert Lisp source-code listings to LaTeX for publication.&#xA;* Define new link behaviors.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-18T17:27:45.727" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7518" PostTypeId="2" ParentId="7496" CreationDate="2015-01-18T18:18:44.613" Score="3" Body="&lt;p&gt;Others have mentioned &lt;code&gt;smex&lt;/code&gt; and &lt;code&gt;icicles&lt;/code&gt; which give such completions. I'll add &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;Helm&lt;/a&gt;. Install from MELPA with &lt;code&gt;M-x package-install helm&lt;/code&gt;.  &lt;code&gt;(helm-mode t)&lt;/code&gt; will turn it on globally.  It doesn't steal your &lt;code&gt;M-x&lt;/code&gt; key for itself, so also add &lt;code&gt;(global-set-key (kbd &quot;M-x&quot;) 'helm-M-x)&lt;/code&gt; to give it the key.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-01-18T18:18:44.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7519" PostTypeId="1" AcceptedAnswerId="7521" CreationDate="2015-01-18T18:21:25.727" Score="12" ViewCount="1203" Body="&lt;p&gt;I am working on this little function that pulls up the next line to the current line. I want to add a functionality so that if the current line is a line comment and the next line is also a line comment, then the comment characters are removed after the &quot;pull-up&quot; action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Before&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; comment 1▮&#xA;;; comment 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Calling &lt;code&gt;M-x modi/pull-up-line&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;After&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; comment 1▮comment 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;;;&lt;/code&gt; characters are removed that were before &lt;code&gt;comment 2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/pull-up-line ()&#xA;  &quot;Join the following line onto the current one (analogous to `C-e', `C-d') or&#xA;`C-u M-^' or `C-u M-x join-line'.&#xA;&#xA;If the current line is a comment and the pulled-up line is also a comment,&#xA;remove the comment characters from that line.&quot;&#xA;  (interactive)&#xA;  (join-line -1)&#xA;  ;; If the current line is a comment&#xA;  (when (nth 4 (syntax-ppss))&#xA;    ;; Remove the comment prefix chars from the pulled-up line if present&#xA;    (save-excursion&#xA;      (forward-char)&#xA;      (while (looking-at &quot;/\\|;\\|#&quot;)&#xA;        (delete-forward-char 1))&#xA;      (when (looking-at &quot;\\s-&quot;)&#xA;        (delete-forward-char 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above function works but for now, regardless of the major-mode, it will consider &lt;code&gt;/&lt;/code&gt; or &lt;code&gt;;&lt;/code&gt; or &lt;code&gt;#&lt;/code&gt; as a comment character: &lt;code&gt;(looking-at &quot;/\\|;\\|#&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to make this line more intelligent; major-mode specific.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Thanks to @ericstokes' solution, I believe that the below now covers all my use cases :)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/pull-up-line ()&#xA;  &quot;Join the following line onto the current one (analogous to `C-e', `C-d') or&#xA;`C-u M-^' or `C-u M-x join-line'.&#xA;&#xA;If the current line is a comment and the pulled-up line is also a comment,&#xA;remove the comment characters from that line.&quot;&#xA;  (interactive)&#xA;  (join-line -1)&#xA;  ;; If the current line is a comment&#xA;  (when (nth 4 (syntax-ppss))&#xA;    ;; Remove the comment prefix chars from the pulled-up line if present&#xA;    (save-excursion&#xA;      (forward-char)&#xA;      ;; Delete all comment-start or space characters&#xA;      (while (looking-at (concat &quot;\\s&amp;lt;&quot; ; comment-start char as per syntax table&#xA;                                 &quot;\\|&quot; (substring comment-start 0 1) ; first char of `comment-start'&#xA;                                 &quot;\\|&quot; &quot;\\s-&quot;)) ; extra spaces&#xA;        (delete-forward-char 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-22T13:50:55.630" LastActivityDate="2015-04-22T14:40:25.807" Title="How can I detect if the current character is a comment character for that major mode?" Tags="|elisp|comment|syntax-table|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7520" PostTypeId="2" ParentId="7513" CreationDate="2015-01-18T18:26:58.847" Score="2" Body="&lt;p&gt;The &lt;code&gt;evil-normal-state-map&lt;/code&gt; has higher precedence than &lt;code&gt;evil-motion-state-map&lt;/code&gt;, so since &lt;code&gt;u&lt;/code&gt; already has a definition from evil (undo) which is located in &lt;code&gt;evil-normal-state-map&lt;/code&gt;, the definition added in &lt;code&gt;evil-motion-state-map&lt;/code&gt; dosen't take effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix this either remove the keymap of the key in &lt;code&gt;evil-normal-state-map&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;u&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or clear all bindings in &lt;code&gt;evil-normal-state-map&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-normal-state-map (make-sparse-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2015-01-18T18:26:58.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7521" PostTypeId="2" ParentId="7519" CreationDate="2015-01-18T18:30:16.013" Score="11" Body="&lt;p&gt;You can check if the current character is a comment character by using the syntax table: &lt;code&gt;(looking-at &quot;\\s&amp;lt;&quot;)&lt;/code&gt;.  The regexp &lt;code&gt;\\s&amp;lt;&lt;/code&gt; will match any character with the &quot;comment start&quot; syntax; &lt;code&gt;\\s&amp;gt;&lt;/code&gt; will match those with &quot;comment end&quot; syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is the variable &lt;code&gt;comment-start&lt;/code&gt;, which is the string inserted by &lt;code&gt;comment-dwim&lt;/code&gt; and friends.  It typically is set to the comment start character plus some space.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-01-20T23:24:39.057" LastActivityDate="2015-01-20T23:24:39.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7522" PostTypeId="1" CreationDate="2015-01-18T19:09:26.677" Score="1" ViewCount="3137" Body="&lt;p&gt;This is a simple question: how to set the antialias attributes in emacs? I am using GNU emacs 24.4 in windows 7. If I put this line in init.el:&lt;br&gt;&#xA;&lt;code&gt;(set-face-attribute 'default nil :font &quot;Georgia 15&quot; :bold nil :antialias nil)&lt;/code&gt;&lt;br&gt;&#xA;Emacs will complain &lt;code&gt;set-face-attribute: Invalid face attribute name: :antialias&lt;/code&gt;.&lt;br&gt;&#xA;Neither can I find this option in customize interface.&lt;br&gt;&#xA;Any help is appreciated!&lt;/p&gt;&#xA;" OwnerUserId="5204" LastActivityDate="2015-01-18T19:59:46.967" Title="Antialias in windows? (emacs 24.4)" Tags="|microsoft-windows|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7523" PostTypeId="2" ParentId="7522" CreationDate="2015-01-18T19:59:46.967" Score="4" Body="&lt;p&gt;There is no &lt;em&gt;face attribute&lt;/em&gt; &lt;code&gt;:antialias&lt;/code&gt;.  That's a &lt;em&gt;font option&lt;/em&gt;, and must be set directly in the font name, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-font &quot;Georgia-15:antialias=none&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, though, that this option is only supported by the GDI font backend, which is not the default on modern GNU Emacs (read Emacs 23) and “modern” Windows versions (read Windows 2000).  With the standard &lt;code&gt;uniscribe&lt;/code&gt; backend, you cannot turn off anti-aliasing for Emacs—I wonder why you want to do that anyway.  On modern screens fonts—particularly high-quality fonts— usually look very poor without antialiasing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can force Emacs to use the GDI backend by adding &lt;code&gt;Emacs.fontBackend&lt;/code&gt; with a value &lt;code&gt;gdi&lt;/code&gt; as string value to &lt;code&gt;HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs&lt;/code&gt; in the registry, but I'd recommend against it.  GDI is outdated technology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Fonts.html#Windows-Fonts&quot; rel=&quot;nofollow&quot;&gt;Windows Fonts&lt;/a&gt;, for more details about font selection and configuration on Windows.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-01-18T19:59:46.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7525" PostTypeId="2" ParentId="7443" CreationDate="2015-01-18T20:53:00.040" Score="0" Body="&lt;p&gt;&lt;strong&gt;Simple solution&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you notice the top of the export-key-hint window, you'll get the line of  &lt;strong&gt;&quot;Use SPC, DEL, C-n, or C-p to navigate.&quot;&lt;/strong&gt;, so you can just use them to scroll up/down the window for hidden content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Simple solution about splitting window&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq split-height-threshold nil)&#xA;(setq split-width-threshold 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When this happens, maximize the window(using Alt-F10 or other shortcut), and &lt;code&gt;C-c C-e&lt;/code&gt;, it will open the key-options window side-by-side(horizontally), you'll see all the content of the window.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Or if you want to split the window side-by-side or up-down according to your screen&lt;/strong&gt;, put this snippet into your &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Automatically split window horizontally(side-by-side) if current window is wide enough&#xA;(defun display-new-buffer (buffer force-other-window)&#xA;  &quot;If BUFFER is visible, select it.&#xA;&#xA;If it's not visible and there's only one window, split the current window&#xA;and select BUFFER in the new window.&#xA;&#xA;If the current window (before the split) is more than 100 columns wide,&#xA;split horizontally(left/right), else split vertically(up/down).&#xA;&#xA;If the current buffer contains more than one window, select BUFFER in the&#xA;least recently used window.&#xA;&#xA;This function returns the window which holds BUFFER. FORCE-OTHER-WINDOW is ignored.&quot;&#xA;  (or (get-buffer-window buffer)&#xA;      (if (one-window-p)&#xA;          (let ((new-win&#xA;                 (if (&amp;gt; (window-width) 100)&#xA;                     (split-window-horizontally)&#xA;                   (split-window-vertically))))&#xA;            (set-window-buffer new-win buffer)&#xA;            new-win)&#xA;        (let ((new-win (get-lru-window)))&#xA;          (set-window-buffer new-win buffer)&#xA;          new-win))))&#xA;;; use display-buffer-alist instead of display-buffer-function if the following fails&#xA;(setq display-buffer-function 'display-new-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When this happens, maximize the window(using Alt-F10 or other shortcut), and &lt;code&gt;C-c C-e&lt;/code&gt;, it will open the key-options window side-by-side(horizontally), you'll see all the content of the window. Adjust the &lt;code&gt;100&lt;/code&gt; value in the snippet for your screen.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2015-01-22T09:58:11.653" LastActivityDate="2015-01-22T09:58:11.653" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7526" PostTypeId="1" AcceptedAnswerId="7527" CreationDate="2015-01-18T22:40:13.303" Score="1" ViewCount="1549" Body="&lt;p&gt;I am running the command &lt;code&gt;helm-do-grep&lt;/code&gt; and I notice that the search is not recursive, i.e. it searches only in the directory I specify and not in subdirectories. How do I direct &lt;code&gt;helm-grep&lt;/code&gt; to automatically search recursively?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-01-18T22:48:39.747" Title="how to use helm-do-grep to search within subdirectories?" Tags="|helm|rgrep|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7527" PostTypeId="2" ParentId="7526" CreationDate="2015-01-18T22:48:39.747" Score="1" Body="&lt;p&gt;&lt;code&gt;helm&lt;/code&gt; does offer a non-recursive and a recursive command, by default it's using the non-recursive one when invoking &lt;code&gt;M-x helm-do-grep&lt;/code&gt; unless it has been called with a prefix argument.  The values for the non-recursive and recursive command are stored in the &lt;code&gt;helm-grep-default-command&lt;/code&gt; and &lt;code&gt;helm-grep-default-recurse-command&lt;/code&gt; variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way of achieving recursion by default would be setting the former variable to the value of the latter.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'helm-grep&#xA;  '(setq helm-grep-default-command helm-grep-default-recurse-command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Caution: The solution above might have unintended consequences, such as using &lt;code&gt;grep&lt;/code&gt; on the buffers list to recurse on every listed file.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-18T22:48:39.747" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7528" PostTypeId="2" ParentId="7515" CreationDate="2015-01-19T00:14:55.217" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;so why is this the only file missing?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Because the CEDET guys feel that the Java support hasn't received enough attention (development, testing, adoption) to be ready for inclusion into Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use it, you'll have to install the upstream CEDET, or maybe Alex Ott's branch (see &lt;a href=&quot;https://emacs.stackexchange.com/questions/3850/which-version-of-cedet-should-be-used-with-emacs-24-4-1-for-java-development&quot;&gt;this question and answer&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And what can I do to fix it?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Show some activity on the CEDET mailing lists, report which version works better for you and any bugs you encounter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully, that would inspire the guys to iron out any outstanding issues, and to have more confidence in that code, to include in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-01-19T00:14:55.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7530" PostTypeId="1" CreationDate="2015-01-19T07:17:42.803" Score="1" ViewCount="469" Body="&lt;p&gt;I am writing some extension features for various major modes. The features are (as usual in Emacs) some functions that should be bound to some keys to simplify the workflow of the user. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started out by assigning these functions to function-keys &lt;kbd&gt;F1&lt;/kbd&gt;, &lt;kbd&gt;F2&lt;/kbd&gt;, &lt;kbd&gt;F3&lt;/kbd&gt;, and so on.. But realized later that if these extensions should be used by others than myself, it would not be a very good idea. According to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html&quot; rel=&quot;nofollow&quot;&gt;Appendix D.2 Key Binding Conventions&lt;/a&gt; in the Emacs Lisp manual, the function-keys should not be touched; they should be free for the user to customize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So which keybindings should be assigned for extension features for a major mode?&#xA;Are there any guidelines for this? Consider for example &lt;code&gt;cperl-mode&lt;/code&gt; or &lt;code&gt;LaTeX-mode&lt;/code&gt;, they define most keys on the &lt;code&gt;mode-specific-map&lt;/code&gt; i.e. the &lt;kbd&gt;C-c&lt;/kbd&gt; prefix key. Is it a good idea to use the same keymap, or is this also going to breakdown sometimes in the future when the author of the major mode changes the bindings or adds new bindings to this map? I guess there could also very well be a chance that this keymap (&lt;code&gt;mode-specific-map&lt;/code&gt;) would at some point get exhausted for reasonable/sensible key combinations.. Should I instead use another prefix key? And then,  which is safe/good to use? What is common practice?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-10-25T12:53:09.590" Title="How to define key bindings for major mode extensions?" Tags="|key-bindings|major-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7532" PostTypeId="2" ParentId="7530" CreationDate="2015-01-19T09:08:42.043" Score="2" Body="&lt;p&gt;I'm by no means an authoritative source, just listing my opinion.  If&#xA;your code relates to a major-mode, you should either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;submit a patch to that mode, so that it gets integrated naturally&lt;/li&gt;&#xA;&lt;li&gt;put your bindings in a minor-mode that can get activated/deactivated at will by the user&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Otherwise, you'll be breaking an important rule:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A simple (require 'foo) should not change the behavior of the editor&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The actual change should come not just from a &lt;code&gt;require&lt;/code&gt; but from&#xA;enabling a major or minor mode.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-19T09:08:42.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7533" PostTypeId="2" ParentId="7519" CreationDate="2015-01-19T09:21:47.353" Score="0" Body="&lt;p&gt;If you are looking this feature for lisp code(Elisp, Clojure, Scheme and Common Lisp) , then you should try &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt;, a function called &lt;code&gt;lispy-fill&lt;/code&gt; does this kind of thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking this feature for other language, then you should &lt;a href=&quot;https://github.com/lewang/rebox2&quot; rel=&quot;nofollow&quot;&gt;rebox2&lt;/a&gt;(verified for &lt;code&gt;C&lt;/code&gt; and &lt;code&gt;Python&lt;/code&gt;), a function called &lt;code&gt;rebox-fill&lt;/code&gt; or another function called &lt;code&gt;rebox-dwim&lt;/code&gt; do this kind of thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are both great packages, and they are not conflict with each other since they are used for different major-modes, and they are both(&lt;code&gt;lispy-fill&lt;/code&gt; and &lt;code&gt;rebox-dwim&lt;/code&gt;) bound to &lt;code&gt;M-q&lt;/code&gt;, pretty neat.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2015-01-19T09:21:47.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7534" PostTypeId="1" AcceptedAnswerId="7536" CreationDate="2015-01-19T13:53:22.783" Score="4" ViewCount="787" Body="&lt;p&gt;I am trying to create a simple timer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I am doing is &lt;code&gt;C-x-e&lt;/code&gt;-ing this expression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(run-with-timer (* 60 25) nil (insert &quot;Success!&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem is I get an error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Debugger entered--Lisp error: (error &quot;Invalid or uninitialized timer&quot;)&#xA;  signal(error (&quot;Invalid or uninitialized timer&quot;))&#xA;  error(&quot;Invalid or uninitialized timer&quot;)&#xA;  timer--activate([t 21693 2834 932492 nil nil nil nil 0] nil nil nil)&#xA;  timer-activate([t 21693 2834 932492 nil nil nil nil 0])&#xA;  run-at-time(10 nil nil)&#xA;  apply(run-at-time 10 nil nil nil)&#xA;  run-with-timer(10 nil nil)&#xA;  eval((run-with-timer 10 nil (insert &quot;Success!&quot;)) nil)&#xA;  elisp--eval-last-sexp(nil)&#xA;  eval-last-sexp(nil)&#xA;  funcall-interactively(eval-last-sexp nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error message stems from &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/timer.el#L191&quot; rel=&quot;noreferrer&quot;&gt;this line&lt;/a&gt; in the Emacs source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this and create a simple timer for myself? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps. here is the &lt;code&gt;apropos&lt;/code&gt; for &lt;code&gt;run-with-timer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;run-with-timer is an interactive compiled Lisp function in `timer.el'.&#xA;&#xA;(run-with-timer SECS REPEAT FUNCTION &amp;amp;rest ARGS)&#xA;&#xA;Perform an action after a delay of SECS seconds.&#xA;Repeat the action every REPEAT seconds, if REPEAT is non-nil.&#xA;SECS and REPEAT may be integers or floating point numbers.&#xA;The action is to call FUNCTION with arguments ARGS.&#xA;&#xA;This function returns a timer object which you can use in `cancel-timer'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This worked for some reason:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-timer 0 10 'oo) &#xA;&#xA;(defun oo ()&#xA;  (message &quot;message 10 secs&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain why? I guess a function and a function name aren't interchangeable everywhere.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2015-01-19T14:06:33.390" LastActivityDate="2015-01-19T14:16:22.303" Title="run-with-timer error: &quot;Invalid or unitialized timer&quot;" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7535" PostTypeId="2" ParentId="2871" CreationDate="2015-01-19T13:55:28.457" Score="3" Body="&lt;p&gt;I use Dropbox to synchronize my main &lt;code&gt;.org&lt;/code&gt; files instead of &lt;code&gt;rsync&lt;/code&gt;, &lt;code&gt;git&lt;/code&gt; or the like because using Dropbox you can also use &lt;a href=&quot;http://mobileorg.github.io/&quot; rel=&quot;nofollow&quot;&gt;MobileOrg&lt;/a&gt; to see your &lt;code&gt;.org&lt;/code&gt; files from your smartphone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me this is very easy and it does an awesome job.&lt;/p&gt;&#xA;" OwnerUserId="5247" LastEditorUserId="504" LastEditDate="2015-01-19T15:07:49.327" LastActivityDate="2015-01-19T15:07:49.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7536" PostTypeId="2" ParentId="7534" CreationDate="2015-01-19T14:16:22.303" Score="6" Body="&lt;p&gt;The documentation has the answer. The third arg must be a function, &lt;code&gt;(insert &quot;success&quot;)&lt;/code&gt; is not a function, it is an expression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;code&gt;(lambda () (insert &quot;success&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-01-19T14:16:22.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7537" PostTypeId="1" AcceptedAnswerId="7579" CreationDate="2015-01-19T15:03:44.523" Score="2" ViewCount="259" Body="&lt;p&gt;With &lt;code&gt;org-export-define-backend&lt;/code&gt;, I want to make &lt;code&gt;quote-block&lt;/code&gt; get current headline's properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, define a function &lt;code&gt;org-my-headline(headline contents info)&lt;/code&gt; for exporting &lt;code&gt;headline&lt;/code&gt; , I can get the values within &lt;code&gt;:PROPERTIES:  ...  :END:&lt;/code&gt; in &lt;code&gt;org-my-headline&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-my-headline (headline contents info)&#xA;    ...&#xA;    (org-element-property :PROPERTY_NAME headline)&#xA;    ...&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want to define a function &lt;code&gt;org-my-quote-block(quote-block contents info)&lt;/code&gt; for exporting &lt;code&gt;quote-block&lt;/code&gt;, &lt;strong&gt;and its behavior can be changed by current headline's property (e.g. &lt;code&gt;:QUOTE_BLOCK: hide&lt;/code&gt;)&lt;/strong&gt;, can this task be done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or another way: is &lt;code&gt;#+BEGIN_QUOTE&lt;/code&gt; able to get the options in title like &lt;code&gt;#+BEGIN_SRC python&lt;/code&gt; can get the value &lt;code&gt;python&lt;/code&gt; via &lt;code&gt;(org-element-property :language src-block)&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(update: the second way should be impossible...just tried &lt;code&gt;org-element-parse-buffer&lt;/code&gt;, and found it will ignore all options strings in &lt;code&gt;#+BEGIN_QUOTE&lt;/code&gt;)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2015-01-20T11:20:12.183" LastActivityDate="2015-01-23T21:23:01.027" Title="Exporter for Org: can quote-block get headline's property?" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7538" PostTypeId="1" CreationDate="2015-01-19T15:14:13.390" Score="10" ViewCount="953" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; is there a way to set different scroll margins at the top and bottom of a window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;scroll-margin&lt;/code&gt; (defined in the C source code) sets how many lines of text that Emacs displays, at a minimum, at the top and bottom of a window:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Number of lines of margin at the top and bottom of a window.&#xA;  Recenter the window whenever point gets within this many lines&#xA;  of the top or bottom of the window.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'd like to use &lt;code&gt;scroll-margin&lt;/code&gt; for the bottom of the window, but don't want it at the top (e.g., a positive value at the bottom, but 0 at the top).  Is there a way to do so?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2023-02-20T05:15:26.303" Title="Different scroll margins at top and bottom of window?" Tags="|scrolling|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7539" PostTypeId="2" ParentId="7489" CreationDate="2015-01-19T15:21:45.590" Score="1" Body="&lt;p&gt;Resolved by removing cocoAspell and installing aspell with homebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;brew install aspell --with-lang-en --with-lang-pt_BR&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;check your installed dicts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;aspell dump dicts&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;remembering that i had to manually remove cocoAspell installation — but brew install reminds you the files conflicting with the new install.&lt;/p&gt;&#xA;" OwnerUserId="5231" LastActivityDate="2015-01-19T15:21:45.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7540" PostTypeId="1" AcceptedAnswerId="7553" CreationDate="2015-01-19T15:38:02.673" Score="3" ViewCount="974" Body="&lt;p&gt;Whenever I open a pdf in emacs, I'd like to increase the font size. I thought I would just place (doc-view-enlarge) in a 'doc-view-mode-hook. However, I can't find such a hook. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet this source claims the hook exists:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.r-bloggers.com/using-doc-view-with-auto-revert-to-view-latex-pdf-output-in-emacs/&quot; rel=&quot;nofollow&quot;&gt;http://www.r-bloggers.com/using-doc-view-with-auto-revert-to-view-latex-pdf-output-in-emacs/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the hook I am looking for in this case?&lt;/p&gt;&#xA;" OwnerUserId="2846" LastActivityDate="2015-01-19T20:35:30.050" Title="doc-view-mode-hook?" Tags="|hooks|docview|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7541" PostTypeId="1" AcceptedAnswerId="7543" CreationDate="2015-01-19T15:44:31.583" Score="14" ViewCount="10384" Body="&lt;p&gt;I'm taking notes in a largish org-mode file that has the following structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Toto, A&#xA;Notes about Toto.&#xA;* Titi, C&#xA;Notes about Titi.&#xA;* Tutu, A&#xA;Notes about Tutu.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to sort the file so that all the headings with &lt;code&gt;A&lt;/code&gt; precede the headings with &lt;code&gt;B&lt;/code&gt;, which in turn precede the headings with &lt;code&gt;C&lt;/code&gt;, and so on.  Is there an automated way to do that with org-mode?&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-01-22T12:41:55.970" Title="Sorting headings in an ORG file" Tags="|org-mode|sorting|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7542" PostTypeId="2" ParentId="5529" CreationDate="2015-01-19T15:56:25.100" Score="13" Body="&lt;p&gt;Like the answer in the comments, you can do this yourself by writing code to return a nicely spaced string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simple way that supports only left and right aligned text applied to your specifications.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; write a function to do the spacing&#xA;(defun simple-mode-line-render (left right)&#xA;  &quot;Return a string of `window-width' length containing LEFT, and RIGHT&#xA; aligned respectively.&quot;&#xA;  (let* ((available-width (- (window-width) (length left) 2)))&#xA;    (format (format &quot; %%s %%%ds &quot; available-width) left right)))&#xA;&#xA;&#xA;;; use the function in conjunction with :eval and format-mode-line in your mode-line-format&#xA;(setq mode-line-format&#xA;      '((:eval (simple-mode-line-render&#xA;                ;; left&#xA;                (format-mode-line &quot;%b [%m] [%*]&quot;)&#xA;                ;; right&#xA;                (format-mode-line &quot;Line: %l/%i Column: %c&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it ends up looking like this: &#xA;&lt;img src=&quot;https://i.stack.imgur.com/tcRR2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note, I used your mode-line-format args as you specified, but I believe your are using %i incorrectly, which prints the byte size of the buffer, not the number of lines. You can use something like &lt;code&gt;(line-number-at-pos (point-max))&lt;/code&gt; to get the number of lines in your buffer.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-01-19T15:56:25.100" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7543" PostTypeId="2" ParentId="7541" CreationDate="2015-01-19T16:23:02.400" Score="19" Body="&lt;p&gt;There is an &lt;code&gt;org-sort&lt;/code&gt; command but you may need to tweak your file structure to get the results you want (if I am understanding the question properly). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;org-sort&lt;/code&gt; (&lt;code&gt;C-c ^&lt;/code&gt;) to sort entries in the outline, rows in a table, or items in a list. For example from a heading you can call &lt;code&gt;org-sort&lt;/code&gt; to sort all the child entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example you want to sort the top-level entries in your outline, so select all the entries first. When you call &lt;code&gt;org-sort&lt;/code&gt; you'll be prompted for how to sort: alphabetically, by priority, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm guessing from your example that the end result you expect is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Toto, A&#xA;Notes about Toto.&#xA;* Tutu, A&#xA;Notes about Tutu.&#xA;* Titi, C&#xA;Notes about Titi.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, you are looking to sort alphabetically but have that trailing letter take precedence? There is no built-in sort for that. If you changed the entries to put that sort letter first (e.g. &lt;code&gt;A, Toto&lt;/code&gt;) then a normal alphabetic sort would work. Another option would be to move that information to a property on each item, then you can sort by property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @nanny has suggested in the comments, &lt;code&gt;org-sort&lt;/code&gt; can also call a custom sort function. That way you can use your existing file without having to change all the entries. Here's a sort function that finds the current headline text and appends the last character to the beginning so that it takes precedence. You'll need something more robust if your headlines don't all follow that exact pattern.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-sort-last-letter ()&#xA;  (let ((text&#xA;         (plist-get&#xA;          (cadr (org-element-headline-parser (line-end-position)))&#xA;          :raw-value)))&#xA;    (concat (string (aref text (- (string-width text) 1))) text)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-01-19T17:05:52.677" LastActivityDate="2015-01-19T17:05:52.677" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7544" PostTypeId="1" AcceptedAnswerId="7636" CreationDate="2015-01-19T16:25:45.677" Score="2" ViewCount="768" Body="&lt;p&gt;Whenever I save my &lt;code&gt;main.el&lt;/code&gt; file, I get the following error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Args out of range: #(&quot;Git@&quot; 0 4 (help-echo &quot;Locally added file under the Git version control system&quot; face vc-locally-added-state)), 0, 7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The debug stack looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range #(&quot;Git@&quot; 0 4 (help-echo &quot;Locally added file under the Git version control system&quot; face vc-locally-added-state)) 0 7)&#xA;  vc-git-mode-line-string(&quot;~/emacs_environment/elisp/main.el&quot;)&#xA;  apply(vc-git-mode-line-string &quot;~/emacs_environment/elisp/main.el&quot;)&#xA;  vc-call-backend(Git mode-line-string &quot;~/emacs_environment/elisp/main.el&quot;)&#xA;  vc-mode-line(&quot;~/emacs_environment/elisp/main.el&quot; Git)&#xA;  vc-find-file-hook()&#xA;  run-hooks(find-file-hook)&#xA;  after-find-file(nil t)&#xA;  find-file-noselect-1(#&amp;lt;buffer main.el&amp;gt; &quot;~/emacs_environment/elisp/main.el&quot; nil nil &quot;~/emacs_environment/elisp/main.el&quot; (4325419 2050))&#xA;  find-file-noselect(&quot;~/emacs_environment/elisp/main.el&quot; nil nil)&#xA;  ido-file-internal(raise-frame)&#xA;  ido-find-file()&#xA;  funcall-interactively(ido-find-file)&#xA;  #&amp;lt;subr call-interactively&amp;gt;(ido-find-file nil nil)&#xA;  ad-Advice-call-interactively(#&amp;lt;subr call-interactively&amp;gt; ido-find-file nil nil)&#xA;  apply(ad-Advice-call-interactively #&amp;lt;subr call-interactively&amp;gt; (ido-find-file nil nil))&#xA;  call-interactively(ido-find-file nil nil)&#xA;  command-execute(ido-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the same error whenever I open the buffer. The message displays and the buffer loads, but it doesn't open in the current window. I have to do that explicitly with &lt;kbd&gt;C-x C-b&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.emacs&lt;/code&gt; looks like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/emacs_environment/elisp&quot;)&#xA;(require 'main)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This loads the &lt;code&gt;main.el&lt;/code&gt; library for me, which itself loads more specific &lt;code&gt;.el&lt;/code&gt; libraries. I do it this way so that I can sync the &lt;code&gt;emacs_environment&lt;/code&gt; directory across computers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the same error even if I comment out everything in the &lt;code&gt;main.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;emacs_environment&lt;/code&gt; directory is a Git repository, and I have magit installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs version is &lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2015-01-09 on lgw01-05&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I eliminate the error and have my &lt;code&gt;main.el&lt;/code&gt; file open normally?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2015-01-22T20:04:43.737" LastActivityDate="2015-05-24T01:25:04.157" Title="Locally added file under the Git version control system" Tags="|init-file|git|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7545" PostTypeId="1" AcceptedAnswerId="7627" CreationDate="2015-01-19T16:45:14.527" Score="3" ViewCount="422" Body="&lt;p&gt;This is for &lt;a href=&quot;https://stackapps.com/q/3950/11299&quot;&gt;&lt;code&gt;sx.el&lt;/code&gt;&lt;/a&gt;, a StackExchange client for Emacs.&#xA;I'm trying to determine whether this issue is a bug in &lt;code&gt;url&lt;/code&gt; or a bug in StackExchange's API.&#xA;If you need the API &lt;code&gt;key&lt;/code&gt;, please get in touch with either myself or @Malabarba – we're on the &lt;a href=&quot;https://gitter.im/vermiculus/sx.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;Gitter chatroom for the project&lt;/a&gt; pretty regularly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following form evaluates to two different responses depending on whether &lt;code&gt;curl&lt;/code&gt; is used or whether the &lt;code&gt;url&lt;/code&gt; package is used.&#xA;Since API requests are time-sensitive (and to cut down on your time investment), I've included the responses I get for the two (as parsed by &lt;code&gt;json-read-from-string&lt;/code&gt; for readability's sake).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defconst tmp:access-token&#xA;  &quot;YOUR ACCESS TOKEN&quot;)&#xA;&#xA;(defconst tmp:key&#xA;  &quot;YOUR API KEY&quot;)&#xA;&#xA;(defun tmp:api-bug (use-curl access-token key)&#xA;  &quot;Post a test answer to the formatting sandbox.&quot;&#xA;  (let ((random-body-1 (md5 (current-time-string)))&#xA;        (random-body-2 (md5 (md5 (current-time-string))))&#xA;        (method &quot;https://api.stackexchange.com/2.2/questions/3122/answers/add&quot;)&#xA;        (args&#xA;         (mapconcat&#xA;          #'identity&#xA;          `(,(format &quot;access_token=%s&quot;&#xA;                     (replace-regexp-in-string&#xA;                      &quot;%&quot; &quot;%%&quot; (url-hexify-string access-token)))&#xA;            ,(format &quot;key=%s&quot;&#xA;                     (replace-regexp-in-string&#xA;                      &quot;%&quot; &quot;%%&quot; (url-hexify-string key)))&#xA;            &quot;site=meta&quot;&#xA;            &quot;pagesize=100&quot;&#xA;            &quot;filter=%%21GoYr1we0U5inG5G7wBg4JBGpbgX%%29C7LDqpy-%%2AbfwPOujOr4SR4W%%29bLNSyYUpQDdTwTj.XChTFB0gfLaAJq0hv&quot;&#xA;            &quot;body=this-is-an-answer-test-for-sx.el--%s&quot;)&#xA;          &quot;&amp;amp;&quot;)))&#xA;&#xA;    (if use-curl&#xA;        (shell-command-to-string&#xA;         (format&#xA;          &quot;curl --silent -X POST --data %S %s | gunzip&quot;&#xA;          (format args random-body-2)&#xA;          method))&#xA;      (let ((url-automatic-caching t)&#xA;              (url-inhibit-uncompression t)&#xA;              (url-request-data (format args random-body-1))&#xA;              (url-request-method &quot;post&quot;)&#xA;              (url-request-extra-headers&#xA;               '((&quot;Content-Type&quot; . &quot;application/x-www-form-urlencoded&quot;))))&#xA;          (with-current-buffer&#xA;              (url-retrieve-synchronously method)&#xA;            (goto-char (point-min))&#xA;            (search-forward &quot;\n\n&quot;)&#xA;            (delete-region (point-min) (point))&#xA;            (buffer-string))))))&#xA;&#xA;(require 'json)&#xA;&#xA;(json-read-from-string (tmp:api-bug t tmp:access-token tmp:key))&#xA;((total . 1)&#xA; (page_size . 100)&#xA; (page . 1)&#xA; (quota_remaining . 9979)&#xA; (quota_max . 10000)&#xA; (has_more . :json-false)&#xA; (items .&#xA;        [((link . &quot;http://meta.stackexchange.com/questions/3122//247295#247295&quot;)&#xA;          (body_markdown . &quot;this-is-an-answer-test-for-sx.el--e3eeb6228ed9c2c58e5385b73493f0f0&quot;)&#xA;          (share_link . &quot;http://meta.stackexchange.com/a/247295/188148&quot;)&#xA;          (answer_id . 247295)&#xA;          (creation_date . 1421684370)&#xA;          (last_activity_date . 1421684370)&#xA;          (score . 0)&#xA;          (upvoted . :json-false)&#xA;          (downvoted . :json-false)&#xA;          (owner&#xA;           (display_name . &quot;Sean Allred&quot;)&#xA;           (reputation . 160)))]))&#xA;&#xA;(json-read-from-string (tmp:api-bug nil tmp:access-token tmp:key))&#xA;((total . 1)&#xA; (page_size . 100)&#xA; (page . 1)&#xA; (quota_remaining . 9977)&#xA; (quota_max . 10000)&#xA; (has_more . :json-false)&#xA; (items .&#xA;        [((link . &quot;http://meta.stackexchange.com/questions/3122//247297#247297&quot;)&#xA;          (share_link . &quot;http://meta.stackexchange.com/a/247297/188148&quot;)&#xA;          (answer_id . 247297)&#xA;          (creation_date . 1421684555)&#xA;          (last_activity_date . 1421684555)&#xA;          (score . 0)&#xA;          (owner&#xA;           (display_name . &quot;Sean Allred&quot;)&#xA;           (reputation . 160)))]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Cross-reference: &lt;a href=&quot;https://stackapps.com/q/6083/11299&quot;&gt;https://stackapps.com/q/6083/11299&lt;/a&gt;&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:46.877" LastActivityDate="2015-01-22T00:14:56.693" Title="Why does this url package request receive a different response than the 'equivalent' curl request?" Tags="|url|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7546" PostTypeId="1" AcceptedAnswerId="7547" CreationDate="2015-01-19T17:03:56.913" Score="7" ViewCount="1531" Body="&lt;p&gt;Is there a simple way (e.g. customization option) to disable some of &lt;code&gt;org-mode&lt;/code&gt;'s keyboard shortcuts? I normally use shift-right_arrow or shift-left_arrow to select text (expand region), but in &lt;code&gt;org-mode&lt;/code&gt; this combination serves to promote/demote heading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Yes, I know there's an emacsen way of marking and expanding the region, but I was wondering if there's and out-of-the-box way of disabling this feature in &lt;code&gt;org-mode&lt;/code&gt;...)&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="780" LastEditDate="2015-01-19T18:45:39.087" LastActivityDate="2015-01-19T18:45:39.087" Title="Disable org-mode keyboard shortcuts" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7547" PostTypeId="2" ParentId="7546" CreationDate="2015-01-19T17:11:26.980" Score="7" Body="&lt;p&gt;Are you looking to disable those keys permanently for org-mode? You can do that by unsetting the keys in &lt;code&gt;org-mode-map&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, add the following to your emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'org&#xA;  (progn&#xA;    (define-key org-mode-map (kbd &quot;&amp;lt;S-right&amp;gt;&quot;) nil)&#xA;    (define-key org-mode-map (kbd &quot;&amp;lt;S-left&amp;gt;&quot;) nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When org mode is loaded this removes the org-local bindings for shift-right and left. That way the global bindings will work in org files.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-19T17:11:26.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7548" PostTypeId="1" CreationDate="2015-01-19T19:36:26.383" Score="3" ViewCount="554" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/SortWords&quot; rel=&quot;nofollow&quot;&gt;SortWords in the EmacsWiki&lt;/a&gt; suggests this function as a way to sort words:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun sort-words (reverse beg end)&#xA;  &quot;Sort words in region alphabetically, in REVERSE if negative.&#xA;  When prefixed with negative \\[universal-argument], sorts in&#xA;  reverse.&#xA;&#xA;  The variable `sort-fold-case' determines whether alphabetic&#xA;  case affects the sort order.&#xA;&#xA;  See also `sort-regexp-fields'.&quot;&#xA;  (interactive &quot;*P\nr&quot;)&#xA;  (sort-regexp-fields reverse &quot;\\w+&quot; &quot;\\&amp;amp;&quot; beg end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it does not behave sensibly on words with hyphens. Here is an example. Before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a-magician pulled the-rabbit out-of the-hat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After using &lt;code&gt;sort-words&lt;/code&gt; (above):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a-hat magician of-out pulled-rabbit the-the&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is certainly interesting (in the Chinese proverb kind of way). I suspect it has to do with &lt;a href=&quot;http://www.emacswiki.org/emacs/DestructiveOperations#toc1&quot; rel=&quot;nofollow&quot;&gt;Destructive Sorting&lt;/a&gt;. (I get a lot of mileage from pointing out how strange that is!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a reasonable way to improve &lt;code&gt;sort-words&lt;/code&gt; above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Would someone care to explain (perhaps in a comment or an answer) why the implementation above behaves strangely (at least to my eye) with the hyphens?&lt;/p&gt;&#xA;" OwnerUserId="2503" LastEditorUserId="105" LastEditDate="2015-01-19T20:18:58.240" LastActivityDate="2015-01-19T20:51:33.453" Title="Sorting words with hyphens (e.g. in a Lisp mode)" Tags="|regular-expressions|sorting|syntax-table|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7549" PostTypeId="2" ParentId="7548" CreationDate="2015-01-19T19:44:48.640" Score="1" Body="&lt;p&gt;Your thing comes from the &lt;code&gt;-&lt;/code&gt; not being defined a part of &lt;code&gt;&quot;\\w+&quot;&lt;/code&gt; syntax,&#xA;i.e. it thinks that &lt;code&gt;a&lt;/code&gt; is a separate word, and &lt;code&gt;the&lt;/code&gt; is a separate word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sort-words (reverse beg end)&#xA;  &quot;Sort words in region alphabetically, in REVERSE if negative.&#xA;  When prefixed with negative \\[universal-argument], sorts in&#xA;  reverse.&#xA;&#xA;  The variable `sort-fold-case' determines whether alphabetic&#xA;  case affects the sort order.&#xA;&#xA;  See also `sort-regexp-fields'.&quot;&#xA;  (interactive &quot;*P\nr&quot;)&#xA;&#xA;  (sort-regexp-fields reverse &quot;[a-zA-Z0-9-]+&quot; &quot;\\&amp;amp;&quot; beg end)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-19T19:44:48.640" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7550" PostTypeId="2" ParentId="7548" CreationDate="2015-01-19T19:46:47.073" Score="4" Body="&lt;h1&gt;Solution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can temporarily make &lt;code&gt;-&lt;/code&gt; and &lt;code&gt;_&lt;/code&gt; be considered as part of the word in the &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsSyntaxTable&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;syntax-table&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sort-words (reverse beg end)&#xA;  &quot;Sort words in region alphabetically, in REVERSE if negative.&#xA;Prefixed with negative \\[universal-argument], sorts in reverse.&#xA;&#xA;The variable `sort-fold-case' determines whether alphabetic case&#xA;affects the sort order. See `sort-regexp-fields'.&#xA;&#xA;Temporarily consider - and _ characters as part of the word when sorting.&quot;&#xA;  (interactive &quot;*P\nr&quot;)&#xA;  (let ((temp-table (copy-syntax-table text-mode-syntax-table)))&#xA;    (with-syntax-table temp-table&#xA;      (modify-syntax-entry ?- &quot;w&quot; temp-table)&#xA;      (modify-syntax-entry ?_ &quot;w&quot; temp-table)&#xA;      (sort-regexp-fields reverse &quot;\\w+&quot; &quot;\\&amp;amp;&quot; beg end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Result&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Before&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a-magician pulled the-rabbit out-of the-hat even when Peter shouted don't&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;After&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Peter a-magician don't even out-of pulled shouted the-hat the-rabbit when&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Thanks @Jordon for the suggestion to use the &lt;code&gt;text-mode-syntax-table&lt;/code&gt; as the base table.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-19T20:36:57.353" LastActivityDate="2015-01-19T20:36:57.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7551" PostTypeId="2" ParentId="7548" CreationDate="2015-01-19T19:48:59.100" Score="1" Body="&lt;p&gt;It seemed simple and sensible to just add &lt;code&gt;-&lt;/code&gt; (and &lt;code&gt;_&lt;/code&gt; for good measure) to the &lt;code&gt;[:word:]&lt;/code&gt; character class:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sort-words (reverse beg end)&#xA;  (interactive &quot;*P\nr&quot;)&#xA;  (sort-regexp-fields reverse &quot;[-_[:word:]]+&quot; &quot;\\&amp;amp;&quot; beg end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a-magician pulled the-rabbit out-of the-hat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a-magician out-of pulled the-hat the-rabbit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Commentary (related but independent of the answer above): The more I think about this, the more it comes down to defining a word. I'm beginning to think that the notion of a 'word' is not universal, even for a specific mode. Here are my thoughts. In a Lisp mode, I can think of two different ways to define a word, based on three possible use cases:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For display, there are certain conventions in play. In Lisp mode, symbols can contain hyphens.&lt;/li&gt;&#xA;&lt;li&gt;For navigation (e.g. moving the cursor around), it may be reasonable to split words by &quot;-&quot;.&lt;/li&gt;&#xA;&lt;li&gt;For syntax manipulation (e.g. paredit mode), words should &lt;em&gt;not&lt;/em&gt; be split by &quot;-&quot;. (If paredit did it this way, it would give some unhappy results.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My tentative conclusion: Defining a word using one syntax table per mode is a flawed design. Instead, the definition of a word should be able to vary based on the use-case. In the example above, two word definitions would suffice, but I would not expect 2 to be enough in the general case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Thanks to the other answers, I see that Emacs also has syntax awareness of symbols. In the Lisp case (and maybe in general as well) having words and symbols is a sufficient syntax distinction to handle the use cases I mention above.&lt;/p&gt;&#xA;" OwnerUserId="2503" LastEditorUserId="2503" LastEditDate="2015-01-19T20:51:33.453" LastActivityDate="2015-01-19T20:51:33.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7552" PostTypeId="2" ParentId="7548" CreationDate="2015-01-19T20:24:58.467" Score="3" Body="&lt;h1&gt;Sort using symbol boundaries&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Here's a solution that came to me after reading OP's answer about what defines a &quot;word&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sort-symbols (reverse beg end)&#xA;  (interactive &quot;*P\nr&quot;)&#xA;  (sort-regexp-fields reverse &quot;\\_&amp;lt;.*?\\_&amp;gt;&quot; &quot;\\&amp;amp;&quot; beg end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This version uses the symbol-boundary atoms (&lt;code&gt;\_&amp;lt;&lt;/code&gt; and &lt;code&gt;\_&amp;gt;&lt;/code&gt;). I think this solution makes the most sense, since you don't really want to sort words, you want to sort Lisp symbols. Note I changed the name of the function.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-19T20:24:58.467" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7553" PostTypeId="2" ParentId="7540" CreationDate="2015-01-19T20:35:30.050" Score="7" Body="&lt;p&gt;Mode hooks exist, whether or not they are predefined variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;doc-view-mode&lt;/code&gt; is a major mode then &lt;code&gt;doc-view-mode-hook&lt;/code&gt; is alive and well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say that the coding conventions call for a major mode to run its mode hook when the mode is turned on. But typically &lt;strong&gt;&lt;em&gt;no hook variable is predefined&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc for &lt;code&gt;define-derived-mode&lt;/code&gt; tells you that the newly defined mode will run a hook that is constructed by &lt;code&gt;derived-mode-hook-name&lt;/code&gt;, which interns the hook name.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, no such variable is defined ahead of time, but when you enter the mode its symbol is interned and bound to a local variable, which is run as a hook (the functions in its value are invoked).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there happens to be a global variable of the same name then that variable is bound (dynamically). But there need not be such a global variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Elisp, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Major-Mode-Conventions.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Major Mode Conventions&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Each major mode should have a normal &quot;mode hook&quot; named&#xA; `MODENAME-mode-hook'.  The very last thing the major mode command&#xA; should do is to call `run-mode-hooks'.  This runs the normal hook&#xA; `change-major-mode-after-body-hook', the mode hook, and then the&#xA; normal hook `after-change-major-mode-hook'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-19T20:35:30.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7554" PostTypeId="1" AcceptedAnswerId="7555" CreationDate="2015-01-19T20:44:02.697" Score="9" ViewCount="377" Body="&lt;p&gt;Starting with the point or active region, how do I quickly (in one keystroke / command) 'expand' to include the next set of enclosing parentheses?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start with: (&lt;code&gt;|&lt;/code&gt; means point)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (+ x |42))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if I start with: (&lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; bracket the selected region)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (+ x &amp;lt;42&amp;gt;|))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to end up with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] &amp;lt;(+ x 42)&amp;gt;|)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2015-01-20T08:55:31.463" Title="Set region to include enclosing parentheses" Tags="|balanced-parentheses|region|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7555" PostTypeId="2" ParentId="7554" CreationDate="2015-01-19T20:44:02.697" Score="10" Body="&lt;p&gt;Use &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot;&gt;expand-region.el&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Expand region increases the selected region by semantic units. Just keep pressing the key until it selects what you want.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;An example:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq alphabet-start &quot;abc def&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With the cursor at the c, it starts by marking the entire word abc, then expand to the contents of the quotes abc def, then to the entire quote &quot;abc def&quot;, then to the contents of the sexp setq alphabet-start &quot;abc def&quot; and finally to the entire sexp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can set it up like this:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'expand-region)&#xA;(global-set-key (kbd &quot;C-=&quot;) 'er/expand-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can contract the region again with a negative prefix, if you expand too far.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2503" LastActivityDate="2015-01-19T20:44:02.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7556" PostTypeId="2" ParentId="7554" CreationDate="2015-01-19T21:10:29.040" Score="3" Body="&lt;p&gt;In the case of active region, &lt;kbd&gt;h&lt;/kbd&gt; in &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt; will&#xA;do what you want. See my recent &lt;a href=&quot;http://oremacs.com/2015/01/19/lispy.0.21.0-is-out/&quot; rel=&quot;nofollow&quot;&gt;intro post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first case, you need to &lt;kbd&gt;M-m&lt;/kbd&gt; &lt;kbd&gt;h&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;update: all options that you have with &lt;code&gt;lispy&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Starting with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (+ x ~42|))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, &lt;code&gt;~&lt;/code&gt; denotes the mark (the start of the region), and &lt;code&gt;|&lt;/code&gt; denotes the point (the end of the region).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;h&lt;/kbd&gt; you get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] |(+ x 42)~)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;l&lt;/kbd&gt; you get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] ~(+ x 42)|)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;k&lt;/kbd&gt; you get (undoable with &lt;kbd&gt;j&lt;/kbd&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (+ ~x| 42))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;2k&lt;/kbd&gt; or &lt;kbd&gt;kk&lt;/kbd&gt; you get :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (~+| x 42))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;d&lt;/kbd&gt; you get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (+ x |42~))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;d&amp;gt;&lt;/kbd&gt; you get (undoable with &lt;kbd&gt;&amp;lt;&lt;/kbd&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (+ |x 42~))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;d2&amp;gt;&lt;/kbd&gt; or &lt;kbd&gt;d&amp;gt;&amp;gt;&lt;/kbd&gt; you get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (|+ x 42~))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;kbd&gt;m&lt;/kbd&gt; you get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defn foo [x] (+ x 42|))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Just to summarize, when region is active, &lt;kbd&gt;h&lt;/kbd&gt;, &lt;kbd&gt;j&lt;/kbd&gt;, &lt;kbd&gt;k&lt;/kbd&gt;, &lt;kbd&gt;l&lt;/kbd&gt;&#xA;are the arrows that move the region. &lt;kbd&gt;&amp;gt;&lt;/kbd&gt; grows the region by one semantic unit in&#xA;the direction of the point. &lt;kbd&gt;&amp;lt;&lt;/kbd&gt; shrinks the region by one semantic unit in the direction&#xA;of the point. &lt;kbd&gt;m&lt;/kbd&gt; deactivates the mark. &lt;kbd&gt;i&lt;/kbd&gt; selects the first element of the region,&#xA;and &lt;kbd&gt;d&lt;/kbd&gt; exchanges point and mark.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-01-20T08:55:31.463" LastActivityDate="2015-01-20T08:55:31.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7557" PostTypeId="2" ParentId="7554" CreationDate="2015-01-19T22:26:30.223" Score="4" Body="&lt;p&gt;I agree you should try &lt;code&gt;expand-region&lt;/code&gt; as suggested in another answer (that I'm voting for). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But just in case you aren't familiar with the relevant built-in commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-M-u, backward-up-list&#xA;C-M-SPC, mark-sexp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your first example where there is no region you could use&lt;code&gt;C-M-u  C-M-SPC&lt;/code&gt; to mark the enclosing list. If there is already a selected region these commands extend it. So if &lt;code&gt;42&lt;/code&gt; is selected and you hit &lt;code&gt;C-M-u&lt;/code&gt; it will extend the selection backward to the beginning of the list but would not include the closing paren. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in the absence of something like &lt;code&gt;expand-region&lt;/code&gt; I would hit &lt;code&gt;C-g&lt;/code&gt; to cancel any current selection, then &lt;code&gt;C-M-u&lt;/code&gt; to go back as many parens as you want, then &lt;code&gt;C-M-SPC&lt;/code&gt; to mark &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-19T22:26:30.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7558" PostTypeId="1" AcceptedAnswerId="54412" CreationDate="2015-01-19T22:38:21.023" Score="19" ViewCount="1073" Body="&lt;p&gt;I'm working on an Emacs mode that lets you control Emacs with speech recognition. One of the problems I've ran into is that the way Emacs handles undo doesn't match how you would expect it to work when controlling by voice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the user speaks several words and then pauses, that's called an 'utterance.' An utterance may consist of multiple commands for Emacs to execute. It's often the case that the recognizer recognizes one or more commands within an utterance incorrectly. At that point I want to be able to say &quot;undo&quot; and have Emacs undo &lt;em&gt;all actions&lt;/em&gt; done by the utterance, not just the last action within the utterance. In other words, I want Emacs to treat an utterance as a single command as far as undo is concerned, even when an utterance consists of multiple commands. I'd also like point to go back to exactly where it was before the utterance, I've noticed normal Emacs undo doesn't do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have setup Emacs to get callbacks at the beginning and end of each utterance, so I can detect the situation, I just need to figure out what to have Emacs do. Ideally I'd call something like &lt;code&gt;(undo-start-collapsing)&lt;/code&gt; and then &lt;code&gt;(undo-stop-collapsing)&lt;/code&gt; and anything done inbetween would be magically collapsed into one record.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did some trawling through the documentation and found &lt;code&gt;undo-boundary&lt;/code&gt;, but it's the opposite of what I want -- I need to collapse all the actions within an utterance into one undo record, not split them up. I can use &lt;code&gt;undo-boundary&lt;/code&gt; between utterances to make sure insertions are considered separate (Emacs by default considers consecutive insert actions to be one action up to some limit), but that's it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other complications:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;My speech recognition daemon sends some commands to Emacs by simulating X11 keypresses and sends some via &lt;code&gt;emacsclient -e&lt;/code&gt; so, if there were say an &lt;code&gt;(undo-collapse &amp;amp;rest ACTIONS)&lt;/code&gt; there's no central place I can wrap.&lt;/li&gt;&#xA;&lt;li&gt;I use &lt;code&gt;undo-tree&lt;/code&gt;, not sure if this makes things more complicated. Ideally a solution would work with &lt;code&gt;undo-tree&lt;/code&gt; and Emacs' normal undo behavior.&lt;/li&gt;&#xA;&lt;li&gt;What if one of the commands within an utterance is &quot;undo&quot; or &quot;redo&quot;? I'm thinking I could change the callback logic to always send these to Emacs as distinct utterances to keep things simpler, then it should be handled just like it would if I were using the keyboard.&lt;/li&gt;&#xA;&lt;li&gt;Stretch goal: An utterance may contain a command that switches the currently active window or buffer. In this case it's fine to have to say &quot;undo&quot; once separately in each buffer, I don't need it to be that fancy. But all the commands in a single buffer should still be grouped, so if I say &quot;do-x do-y do-z switch-buffer do-a do-b do-c&quot; then x,y,z should be one undo record in the original buffer and a,b,c should be one record in the switched to buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do this? AFAICT there is nothing built-in but Emacs is vast and deep...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: I ended up using jhc's solution below with a little extra code. In the global &lt;code&gt;before-change-hook&lt;/code&gt; I check if the buffer being changed is in a global list of buffers modified this utterance, if not it goes into the list and &lt;code&gt;undo-collapse-begin&lt;/code&gt; is called. Then at the end of the utterance I iterate all the buffers in the list and call &lt;code&gt;undo-collapse-end&lt;/code&gt;. Code below (md- added before function names for namespacing purposes):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar md-utterance-changed-buffers nil)&#xA;(defvar-local md-collapse-undo-marker nil)&#xA;&#xA;(defun md-undo-collapse-begin (marker)&#xA;  &quot;Mark the beginning of a collapsible undo block.&#xA;This must be followed with a call to undo-collapse-end with a marker&#xA;eq to this one.&#xA;&#xA;Taken from jch's stackoverflow answer here:&#xA;http://emacs.stackexchange.com/a/7560/2301&#xA;&quot;&#xA;  (push marker buffer-undo-list))&#xA;&#xA;(defun md-undo-collapse-end (marker)&#xA;  &quot;Collapse undo history until a matching marker.&#xA;&#xA;Taken from jch's stackoverflow answer here:&#xA;http://emacs.stackexchange.com/a/7560/2301&quot;&#xA;  (cond&#xA;    ((eq (car buffer-undo-list) marker)&#xA;     (setq buffer-undo-list (cdr buffer-undo-list)))&#xA;    (t&#xA;     (let ((l buffer-undo-list))&#xA;       (while (not (eq (cadr l) marker))&#xA;         (cond&#xA;           ((null (cdr l))&#xA;            (error &quot;md-undo-collapse-end with no matching marker&quot;))&#xA;           ((eq (cadr l) nil)&#xA;            (setf (cdr l) (cddr l)))&#xA;           (t (setq l (cdr l)))))&#xA;       ;; remove the marker&#xA;       (setf (cdr l) (cddr l))))))&#xA;&#xA;(defmacro md-with-undo-collapse (&amp;amp;rest body)&#xA;  &quot;Execute body, then collapse any resulting undo boundaries.&#xA;&#xA;Taken from jch's stackoverflow answer here:&#xA;http://emacs.stackexchange.com/a/7560/2301&quot;&#xA;  (declare (indent 0))&#xA;  (let ((marker (list 'apply 'identity nil)) ; build a fresh list&#xA;        (buffer-var (make-symbol &quot;buffer&quot;)))&#xA;    `(let ((,buffer-var (current-buffer)))&#xA;       (unwind-protect&#xA;           (progn&#xA;             (md-undo-collapse-begin ',marker)&#xA;             ,@body)&#xA;         (with-current-buffer ,buffer-var&#xA;           (md-undo-collapse-end ',marker))))))&#xA;&#xA;(defun md-check-undo-before-change (beg end)&#xA;  &quot;When a modification is detected, we push the current buffer&#xA;onto a list of buffers modified this utterance.&quot;&#xA;  (unless (or&#xA;           ;; undo itself causes buffer modifications, we&#xA;           ;; don't want to trigger on those&#xA;           undo-in-progress&#xA;           ;; we only collapse utterances, not general actions&#xA;           (not md-in-utterance)&#xA;           ;; ignore undo disabled buffers&#xA;           (eq buffer-undo-list t)&#xA;           ;; ignore read only buffers&#xA;           buffer-read-only&#xA;           ;; ignore buffers we already marked&#xA;           (memq (current-buffer) md-utterance-changed-buffers)&#xA;           ;; ignore buffers that have been killed&#xA;           (not (buffer-name)))&#xA;    (push (current-buffer) md-utterance-changed-buffers)&#xA;    (setq md-collapse-undo-marker (list 'apply 'identity nil))&#xA;    (undo-boundary)&#xA;    (md-undo-collapse-begin md-collapse-undo-marker)))&#xA;&#xA;(defun md-pre-utterance-undo-setup ()&#xA;  (setq md-utterance-changed-buffers nil)&#xA;  (setq md-collapse-undo-marker nil))&#xA;&#xA;(defun md-post-utterance-collapse-undo ()&#xA;  (unwind-protect&#xA;      (dolist (i md-utterance-changed-buffers)&#xA;        ;; killed buffers have a name of nil, no point&#xA;        ;; in undoing those&#xA;        (when (buffer-name i)&#xA;          (with-current-buffer i&#xA;            (condition-case nil&#xA;                (md-undo-collapse-end md-collapse-undo-marker)&#xA;              (error (message &quot;Couldn't undo in buffer %S&quot; i))))))&#xA;    (setq md-utterance-changed-buffers nil)&#xA;    (setq md-collapse-undo-marker nil)))&#xA;&#xA;(defun md-force-collapse-undo ()&#xA;  &quot;Forces undo history to collapse, we invoke when the user is&#xA;trying to do an undo command so the undo itself is not collapsed.&quot;&#xA;  (when (memq (current-buffer) md-utterance-changed-buffers)&#xA;    (md-undo-collapse-end md-collapse-undo-marker)&#xA;    (setq md-utterance-changed-buffers (delq (current-buffer) md-utterance-changed-buffers))))&#xA;&#xA;(defun md-resume-collapse-after-undo ()&#xA;  &quot;After the 'undo' part of the utterance has passed, we still want to&#xA;collapse anything that comes after.&quot;&#xA;  (when md-in-utterance&#xA;    (md-check-undo-before-change nil nil)))&#xA;&#xA;(defun md-enable-utterance-undo ()&#xA;  (setq md-utterance-changed-buffers nil)&#xA;  (when (featurep 'undo-tree)&#xA;    (advice-add #'md-force-collapse-undo :before #'undo-tree-undo)&#xA;    (advice-add #'md-resume-collapse-after-undo :after #'undo-tree-undo)&#xA;    (advice-add #'md-force-collapse-undo :before #'undo-tree-redo)&#xA;    (advice-add #'md-resume-collapse-after-undo :after #'undo-tree-redo))&#xA;  (advice-add #'md-force-collapse-undo :before #'undo)&#xA;  (advice-add #'md-resume-collapse-after-undo :after #'undo)&#xA;  (add-hook 'before-change-functions #'md-check-undo-before-change)&#xA;  (add-hook 'md-start-utterance-hooks #'md-pre-utterance-undo-setup)&#xA;  (add-hook 'md-end-utterance-hooks #'md-post-utterance-collapse-undo))&#xA;&#xA;(defun md-disable-utterance-undo ()&#xA;  ;;(md-force-collapse-undo)&#xA;  (when (featurep 'undo-tree)&#xA;    (advice-remove #'md-force-collapse-undo :before #'undo-tree-undo)&#xA;    (advice-remove #'md-resume-collapse-after-undo :after #'undo-tree-undo)&#xA;    (advice-remove #'md-force-collapse-undo :before #'undo-tree-redo)&#xA;    (advice-remove #'md-resume-collapse-after-undo :after #'undo-tree-redo))&#xA;  (advice-remove #'md-force-collapse-undo :before #'undo)&#xA;  (advice-remove #'md-resume-collapse-after-undo :after #'undo)&#xA;  (remove-hook 'before-change-functions #'md-check-undo-before-change)&#xA;  (remove-hook 'md-start-utterance-hooks #'md-pre-utterance-undo-setup)&#xA;  (remove-hook 'md-end-utterance-hooks #'md-post-utterance-collapse-undo))&#xA;&#xA;(md-enable-utterance-undo)&#xA;;; (md-disable-utterance-undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2418" LastEditDate="2019-12-17T04:53:30.593" LastActivityDate="2021-11-09T01:37:21.207" Title="How to collapse undo history?" Tags="|emacsclient|undo|undo-tree-mode|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="7559" PostTypeId="2" ParentId="7538" CreationDate="2015-01-20T00:53:34.043" Score="1" Body="&lt;p&gt;The following works for me:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-define-scroll-margins (&amp;amp;rest _args)&#xA;  (interactive)&#xA;  (with-demoted-errors&#xA;    (let ((computed-margin&#xA;            (if (&amp;gt; (cdr (nth 6 (posn-at-point)))&#xA;                  (/ (window-body-height) 2)) 5 0)))&#xA;      (setq&#xA;        scroll-margin computed-margin&#xA;        smooth-scroll-margin computed-margin))))&#xA;&#xA;(add-hook 'post-command-hook #'my-define-scroll-margins)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this is theoretically inefficient, but performance on my lame computer seems unaffected.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-01-20T00:53:34.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7560" PostTypeId="2" ParentId="7558" CreationDate="2015-01-20T01:11:51.587" Score="15" Body="&lt;p&gt;Interestingly enough, there appears to be no built-in function to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code works by inserting a unique marker on the &lt;code&gt;buffer-undo-list&lt;/code&gt; at the beginning of a collapsible block, and removing all boundaries (&lt;code&gt;nil&lt;/code&gt; elements) at the end of a block, then removing the marker.  In case something goes wrong, the marker is of the form &lt;code&gt;(apply identity nil)&lt;/code&gt; to ensure that it does nothing if it remains on the undo list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, you should use the &lt;code&gt;with-undo-collapse&lt;/code&gt; macro, not the underlying functions.  Since you mentioned that you cannot do the wrapping, make sure that you pass to the low-level functions markers that are &lt;code&gt;eq&lt;/code&gt;, not just &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the invoked code switches buffers, you must ensure that &lt;code&gt;undo-collapse-end&lt;/code&gt; is called in the same buffer as &lt;code&gt;undo-collapse-begin&lt;/code&gt;.  In that case, only the undo entries in the initial buffer will be collapsed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun undo-collapse-begin (marker)&#xA;  &quot;Mark the beginning of a collapsible undo block.&#xA;This must be followed with a call to undo-collapse-end with a marker&#xA;eq to this one.&quot;&#xA;  (push marker buffer-undo-list))&#xA;&#xA;(defun undo-collapse-end (marker)&#xA;  &quot;Collapse undo history until a matching marker.&quot;&#xA;  (cond&#xA;    ((eq (car buffer-undo-list) marker)&#xA;     (setq buffer-undo-list (cdr buffer-undo-list)))&#xA;    (t&#xA;     (let ((l buffer-undo-list))&#xA;       (while (not (eq (cadr l) marker))&#xA;         (cond&#xA;           ((null (cdr l))&#xA;            (error &quot;undo-collapse-end with no matching marker&quot;))&#xA;           ((null (cadr l))&#xA;            (setf (cdr l) (cddr l)))&#xA;           (t (setq l (cdr l)))))&#xA;       ;; remove the marker&#xA;       (setf (cdr l) (cddr l))))))&#xA;&#xA; (defmacro with-undo-collapse (&amp;amp;rest body)&#xA;  &quot;Execute body, then collapse any resulting undo boundaries.&quot;&#xA;  (declare (indent 0))&#xA;  (let ((marker (list 'apply 'identity nil)) ; build a fresh list&#xA;        (buffer-var (make-symbol &quot;buffer&quot;)))&#xA;    `(let ((,buffer-var (current-buffer)))&#xA;       (unwind-protect&#xA;            (progn&#xA;              (undo-collapse-begin ',marker)&#xA;              ,@body)&#xA;         (with-current-buffer ,buffer-var&#xA;           (undo-collapse-end ',marker))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's an example of usage:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-no-collapse ()&#xA;  (interactive)&#xA;  (insert &quot;toto&quot;)&#xA;  (undo-boundary)&#xA;  (insert &quot;titi&quot;))&#xA;&#xA;(defun test-collapse ()&#xA;  (interactive)&#xA;  (with-undo-collapse&#xA;    (insert &quot;toto&quot;)&#xA;    (undo-boundary)&#xA;    (insert &quot;titi&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2019-12-05T22:17:32.803" LastActivityDate="2019-12-05T22:17:32.803" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="7562" PostTypeId="1" AcceptedAnswerId="7573" CreationDate="2015-01-20T03:09:09.510" Score="3" ViewCount="194" Body="&lt;p&gt;Is there any way of disabling &lt;code&gt;AUCTeX&lt;/code&gt; from auto-promping for optional overlay options in a &lt;code&gt;Beamer&lt;/code&gt; document? I use global overlay options, and the prompting for local ones can be annoying when writing long documents.&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2015-01-20T03:14:41.667" LastActivityDate="2015-01-20T16:54:29.850" Title="Disable auto overlay prompt in AUCTeX?" Tags="|auctex|beamer|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7563" PostTypeId="1" AcceptedAnswerId="9603" CreationDate="2015-01-20T09:25:26.080" Score="12" ViewCount="680" Body="&lt;p&gt;The echo area is empty most of the time, which makes me think that I could use it to display some information. For example, &lt;code&gt;org-clock&lt;/code&gt; displays the current task, the remaining time and the total elapsed time on the modeline. This information is not really readable there (the modeline can be rather short), is repeated on each modeline (because it applies to the whole emacs session), and is not &lt;em&gt;that&lt;/em&gt; useful that I'm willing to sacrifice some precious modeline space for it. On the other hand, it could appear in the echo area when there is nothing else to display here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a canonical way of achieving this? I have thought of hacking an insert function in &lt;code&gt;minibuffer-inactive-mode-hook&lt;/code&gt; (but it doesn't work reliably, for example the message disappears as soon as the echo area is used again), or spamming &lt;a href=&quot;https://emacs.stackexchange.com/q/3116/184&quot;&gt;non-logged messages&lt;/a&gt; (but this will be mess with other uses of the echo area and the minibuffer). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A poor-man version of this would use idle timers, but the echo area can be empty without emacs being idle (for example when inputting some text).&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2024-01-24T12:26:50.013" Title="Make use of an empty echo area to display information" Tags="|echo-area|idle-timer|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7564" PostTypeId="1" AcceptedAnswerId="7578" CreationDate="2015-01-20T10:28:38.347" Score="12" ViewCount="3881" Body="&lt;p&gt;Org-mode's default during HTML export is to put the author in the postamble at the bottom of the page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like to export a paper like document with the author between the title and the abstract. Is it possible somehow to place the author after the title?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And is it possible to label the abstract as an abstract? I have used the delimiters&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_abstract&#xA;...&#xA;#+END_abstract&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to mark the text as the abstact but it is rendered just as a normal paragraph (no blockquote like indent). Is it possible to get the right indent for the abstract and a localized label?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="50" LastEditDate="2015-01-20T20:49:18.777" LastActivityDate="2015-05-13T09:15:13.900" Title="Format a HTML paper with Org-mode" Tags="|org-mode|org-export|html|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7565" PostTypeId="1" AcceptedAnswerId="7567" CreationDate="2015-01-20T10:30:41.963" Score="6" ViewCount="425" Body="&lt;p&gt;Sometimes Lisp hangs due to an infinite loop, making the whole of Emacs unresponsive, so it can't process any input, &lt;kbd&gt;C-g&lt;/kbd&gt; included.  So, I was hoping for there to be a way to maybe send it an emergency call from the outside, which would interrupt the Lisp interpreter, but would not kill Emacs altogether.  I've experimented with sending some signals by means of &lt;code&gt;kill -s &amp;lt;signal&amp;gt;&lt;/code&gt;, but Emacs seems to quit no matter what signal it is.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="25" LastEditDate="2017-02-22T13:39:56.953" LastActivityDate="2017-02-22T13:39:56.953" Title="Interrupt ELisp interpreter from outside Emacs?" Tags="|elisp|quitting|frozen-emacs|" AnswerCount="1" CommentCount="0" ClosedDate="2016-04-21T09:55:31.087" ContentLicense="CC BY-SA 3.0" />
  <row Id="7566" PostTypeId="2" ParentId="7564" CreationDate="2015-01-20T11:11:32.380" Score="2" Body="&lt;p&gt;Take a look of the source code, it seems that no option to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't sure what you really want, just provide possible two ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Just add a &lt;code&gt;#+BEGIN_HTML ... #+END_HTML&lt;/code&gt; block to write what you want. (The content written in it will be treated as totally HTML.) But you may need to add &lt;code&gt;#+OPTIONS: toc: nil&lt;/code&gt; to disable TOC or author will be placed under TOC.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Re-define the export function and do what you want (Notice line 50~52), just place following code after &lt;code&gt;(require 'ox-html)&lt;/code&gt; in your config file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun org-html-template (contents info)&#xA;    &quot;Return complete document string after HTML conversion.&#xA;  CONTENTS is the transcoded contents string.  INFO is a plist&#xA;  holding export options.&quot;&#xA;    (concat&#xA;     (when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))&#xA;       (let ((decl (or (and (stringp org-html-xml-declaration)&#xA;              org-html-xml-declaration)&#xA;             (cdr (assoc (plist-get info :html-extension)&#xA;                 org-html-xml-declaration))&#xA;             (cdr (assoc &quot;html&quot; org-html-xml-declaration))&#xA;&#xA;             &quot;&quot;)))&#xA;         (when (not (or (eq nil decl) (string= &quot;&quot; decl)))&#xA;     (format &quot;%s\n&quot;&#xA;         (format decl&#xA;             (or (and org-html-coding-system&#xA;                  (fboundp 'coding-system-get)&#xA;                  (coding-system-get org-html-coding-system 'mime-charset))&#xA;                 &quot;iso-8859-1&quot;))))))&#xA;     (org-html-doctype info)&#xA;     &quot;\n&quot;&#xA;     (concat &quot;&amp;lt;html&quot;&#xA;       (when (org-html-xhtml-p info)&#xA;         (format&#xA;          &quot; xmlns=\&quot;http://www.w3.org/1999/xhtml\&quot; lang=\&quot;%s\&quot; xml:lang=\&quot;%s\&quot;&quot;&#xA;          (plist-get info :language) (plist-get info :language)))&#xA;       &quot;&amp;gt;\n&quot;)&#xA;     &quot;&amp;lt;head&amp;gt;\n&quot;&#xA;     (org-html--build-meta-info info)&#xA;     (org-html--build-head info)&#xA;     (org-html--build-mathjax-config info)&#xA;     &quot;&amp;lt;/head&amp;gt;\n&quot;&#xA;     &quot;&amp;lt;body&amp;gt;\n&quot;&#xA;     (let ((link-up (org-trim (plist-get info :html-link-up)))&#xA;     (link-home (org-trim (plist-get info :html-link-home))))&#xA;       (unless (and (string= link-up &quot;&quot;) (string= link-home &quot;&quot;))&#xA;         (format org-html-home/up-format&#xA;           (or link-up link-home)&#xA;           (or link-home link-up))))&#xA;     ;; Preamble.&#xA;     (org-html--build-pre/postamble 'preamble info)&#xA;     ;; Document contents.&#xA;     (format &quot;&amp;lt;%s id=\&quot;%s\&quot;&amp;gt;\n&quot;&#xA;       (nth 1 (assq 'content org-html-divs))&#xA;       (nth 2 (assq 'content org-html-divs)))&#xA;     ;; Document title.&#xA;     (let ((title (plist-get info :title)))&#xA;       (format &quot;&amp;lt;h1 class=\&quot;title\&quot;&amp;gt;%s&amp;lt;/h1&amp;gt;\n&quot; (org-export-data (or title &quot;&quot;) info)))&#xA;     ;; Author&#xA;     (let ((author (plist-get info :author)))&#xA;       (format &quot;&amp;lt;h2 class=\&quot;author\&quot;&amp;gt;%s&amp;lt;/h2&amp;gt;\n&quot; (org-export-data (or author &quot;&quot;) info)))&#xA;     contents&#xA;     (format &quot;&amp;lt;/%s&amp;gt;\n&quot;&#xA;       (nth 1 (assq 'content org-html-divs)))&#xA;     ;; Postamble.&#xA;     (org-html--build-pre/postamble 'postamble info)&#xA;     ;; Closing document.&#xA;     &quot;&amp;lt;/body&amp;gt;\n&amp;lt;/html&amp;gt;&quot;))        &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2015-01-20T11:32:21.627" LastActivityDate="2015-01-20T11:32:21.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7567" PostTypeId="2" ParentId="7565" CreationDate="2015-01-20T13:44:40.163" Score="4" Body="&lt;p&gt;It's possible to unconditionally enter the debugger by sending the value of &lt;code&gt;debug-on-event&lt;/code&gt; (should be &lt;code&gt;USR2&lt;/code&gt; by default) as signal as documented in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html#Error-Debugging&quot; rel=&quot;nofollow&quot;&gt;Error Debugging section&lt;/a&gt; in the Emacs Lisp manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this rather useless to be honest since it just gave me a way to inspect a backtrace, not to unfreeze Emacs. YMMV obviously.  As noted in the comments the other issue with this is that it won't work on Windows systems since those use neither &lt;code&gt;kill&lt;/code&gt; nor signals for process communication.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-01-20T15:42:39.847" LastActivityDate="2015-01-20T15:42:39.847" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7568" PostTypeId="1" AcceptedAnswerId="7569" CreationDate="2015-01-20T14:11:46.990" Score="7" ViewCount="423" Body="&lt;p&gt;I am trying to add a comment feature to Pod documentation for Perl scripts, and I would like to highligh Pod comments with a special face. A simple prototype Perl script could be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-perl prettyprint-override&quot;&gt;&lt;code&gt;#! /usr/bin/env perl&#xA;&#xA;use strict;&#xA;use warnings;&#xA;&#xA;print &quot;Hello\n&quot;; # a Perl comment /* hello */&#xA;&#xA;__END__&#xA;&#xA;=head1 SYNOPSIS&#xA;&#xA;my_program &amp;lt;arg1&amp;gt; [OPTIONS]&#xA;&#xA;/* this is a Pod comment */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As we see, a Pod comment is surronded by &lt;code&gt;/* */&lt;/code&gt; as in C programming language. However, only the part below the line &lt;code&gt;__END__&lt;/code&gt; is Pod documentation. The part above that line is regular Perl code. Now, if I try to add syntax highlighting to the Pod comment using for example (called from &lt;code&gt;cperl-mode-hook&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(font-lock-add-keywords nil '((&quot;\\(/\\*.*?\\*/\\)&quot; 1 'font-lock-warning-face t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following using &lt;code&gt;cperl-mode&lt;/code&gt; as major mode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PH7G9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Pod comments are highlighted also in a regular Perl comment (a Perl comment starts with a &lt;code&gt;#&lt;/code&gt; character), which is not desired (Pod comments should only be highlighted in Pod sections, not in regular Perl code).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, for this question, we can assume that the Pod documentation is confined to the end of the document, starting with the lines after the &lt;code&gt;__END__&lt;/code&gt; tag. Is it possible to check the position of the current comment and relate that to the position of the &lt;code&gt;__END__&lt;/code&gt; line, and from that information determine if we are inside a Pod block or not (and then add syntax highlighting only if we are inside a Pod block) when running the font lock code?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-21T17:34:39.593" Title="Use font-lock mode on only part of buffer" Tags="|font-lock|perl|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7569" PostTypeId="2" ParentId="7568" CreationDate="2015-01-20T14:40:33.683" Score="8" Body="&lt;h2&gt;Updated Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There is a built in way to do this with font-lock (thank you sanityinc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer has all the details about how this style of font-lock-keywords work: &lt;a href=&quot;https://stackoverflow.com/a/14675550&quot;&gt;https://stackoverflow.com/a/14675550&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun pod-comment-highlighter (limit)&#xA;  &quot;If looking after __END__ or __END__ is before LIMIT, set match-data to a the location of the pod comment.&quot;&#xA;  (when (or (save-excursion (search-backward &quot;__END__&quot; (point-min) t 1))&#xA;            (search-forward &quot;__END__&quot; limit t 1))&#xA;    (re-search-forward &quot;\\(/\\*.*?\\*/\\)&quot; limit t 1)))&#xA;&#xA;(font-lock-add-keywords&#xA; 'perl-mode&#xA; '((pod-comment-highlighter 0 font-lock-warning-face t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result is the same as the original solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it is in action: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/F6AMW.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Original solution using jit-lock-functions (not ideal)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I believe you'll need to do the fontification manually in a function added to the  &lt;code&gt;jit-lock-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;jit-lock-functions&lt;/code&gt; are the functions that actually do the fontification and area called with BEG and END parameters to denote the region they are supposed to apply text properties to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this scenario your function will first see if the region to color is after the &lt;code&gt;__END__&lt;/code&gt; in your buffer, and if so, manually search for /* comments */ and apply text properties to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun pod-comment-highlighter (beg end)&#xA;  &quot;Highlight /* this style */ of comments but only if they appear after __END__ in the buffer.&quot;&#xA;  (save-excursion&#xA;    (save-match-data&#xA;      (goto-char beg)&#xA;      ;; only fontify if __END__ appears before the given region, or, if&#xA;      ;; __END__ is inside the region, then start fontifiying after __END__&#xA;      (when (or (save-excursion (search-backward &quot;__END__&quot; (point-min) t 1))&#xA;                (search-forward &quot;__END__&quot; end t 1))&#xA;        (while (re-search-forward &quot;\\(/\\*.*?\\*/\\)&quot; end t 1)&#xA;          (add-text-properties (match-beginning 0) (match-end 0) '(face font-lock-warning-face)))))))&#xA;&#xA;&#xA;;; `jit-lock-register' is normally used to add a jit-lock-function, &#xA;;; but I want to make sure this function is the last function to run and&#xA;;; color the buffer so font-lock doesn't undo my applied properties.&#xA;;; So add-hook works nicely by passing t in the APPEND parameter&#xA;(add-hook 'jit-lock-functions 'pod-comment-highlighter t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For your scenario you may want to add the jit lock function inside a perl-mode-hook&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that this function isn't &quot;smart&quot; it just looks for &lt;strong&gt;END&lt;/strong&gt; anywhere int he buffer, so if it occurs in a string or a perl comment where it shouldn't have effect, it actually will. You can extend the function to look at the context of where &lt;strong&gt;END&lt;/strong&gt; occurs if you need to.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-01-21T17:34:39.593" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7570" PostTypeId="2" ParentId="7563" CreationDate="2015-01-20T15:55:17.910" Score="1" Body="&lt;p&gt;The answer, IMO, is &lt;em&gt;no&lt;/em&gt;. The echo area is for &lt;em&gt;ephemeral messages&lt;/em&gt;. And lots of things explicitly &lt;em&gt;erase&lt;/em&gt; anything that might have been echoed there.  So realizing what you request in any reasonable way is problematic, IMO.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, use an alternative. Here are some:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use some other buffer (e.g. a small frame or window that you keep open for this purpose). Simple to do, you can move it around, edit it, erase it, or do whatever else you like with it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use part or all of the mode line (which you have already considered, apparently).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use a header line.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use a frame title.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If it were I, I would probably opt for #1. (But I don't really want/need such a full-time display of status info. I would more likely define a command that shows me the info (even a history/log) on demand.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Updated after your comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You already said, in your question, &quot;&lt;strong&gt;&lt;em&gt;the message disappears as soon as the echo area is used again&lt;/em&gt;&lt;/strong&gt;&quot;. So it sounded like using such an ephemeral space as the echo area would not fit your needs. Your comment replies seem to contradict this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to use the echo area, then use &lt;code&gt;minibuffer-inactive-mode-hook&lt;/code&gt;, as you mentioned, or use a timer to call &lt;code&gt;message&lt;/code&gt; or to insert the time message in the echo area in some other way. However, you have already noted the problems with that. Those problems (overwriting, erasure) follow from the (&lt;strong&gt;intended&lt;/strong&gt;) &lt;em&gt;ephemeral nature of the echo area&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, you want to use an area intended for ephemeral messages, but you don't want your messages to disappear as soon as that area is used again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(BTW - wrt your mention that the mode-line info is repeated in every mode line: That need not be the case. You can make the mode line be specific for a particular buffer etc. IOW, you can choose one mode line to always (or periodically) show your clock or whatever.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-01-20T17:05:27.450" LastActivityDate="2015-01-20T17:05:27.450" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7571" PostTypeId="1" AcceptedAnswerId="7572" CreationDate="2015-01-20T15:56:22.000" Score="9" ViewCount="1522" Body="&lt;p&gt;Suppose that I do &lt;code&gt;M-x blabla&lt;/code&gt; without pressing &lt;code&gt;return&lt;/code&gt; and then I switch to the main buffer. If the curser is at minibuffer I can cancel the mini-buffer by the shortcut &lt;code&gt;C-g&lt;/code&gt;. But if the cursor is at the main buffer, this shortcut doesn't cancel the minibuffer. If I press &lt;code&gt;M-x&lt;/code&gt; the error &lt;code&gt;Command attempted to use minibuffer while in minibuffer&lt;/code&gt; appears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a build-in shorcut that completely cancels the previously non-completed contents of the minibuffer since the main buffer.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-01-20T15:58:33.053" Title="How to cancel the minibuffer from the main buffer" Tags="|minibuffer|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7572" PostTypeId="2" ParentId="7571" CreationDate="2015-01-20T15:58:33.053" Score="13" Body="&lt;p&gt;&lt;code&gt;C-]&lt;/code&gt; (command &lt;code&gt;abort-recursive-edit&lt;/code&gt;) does what you want.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-20T15:58:33.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7573" PostTypeId="2" ParentId="7562" CreationDate="2015-01-20T16:54:29.850" Score="3" Body="&lt;p&gt;In order not to be prompted anymore for overlay specification in &lt;code&gt;\item&lt;/code&gt; like macros, set the variable &lt;code&gt;LaTeX-beamer-item-overlay-flag&lt;/code&gt; to nil.  You can do it locally or globally, for the latter case customize that variable or add this code to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq LaTeX-beamer-item-overlay-flag nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As most style-specific options, this variable is not documented in the official manual of AUCTeX, but you can find them browsing &lt;code&gt;customize-group&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;LaTeX-style&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-01-20T16:54:29.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7574" PostTypeId="1" AcceptedAnswerId="7577" CreationDate="2015-01-20T17:22:11.397" Score="4" ViewCount="1849" Body="&lt;p&gt;I have the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-save-excursion ()&#xA;  (interactive)&#xA;  (let ((buffer &quot;*test*&quot;)&#xA;        (text &quot;Lorem Ipsum is simply dummy text&#xA;Lorem Ipsum has |been the industry's standard dummy text&#xA;It was popularised in the 1960s&quot;))&#xA;    (with-current-buffer buffer&#xA;      (erase-buffer)&#xA;      (insert text)&#xA;      (goto-char 50)&#xA;      (save-excursion&#xA;        (beginning-of-line)&#xA;        (kill-line)&#xA;        (kill-line)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see that point moves to the 50th char (second line of &lt;code&gt;text&lt;/code&gt;, where &lt;code&gt;|&lt;/code&gt; is located), then I want to save point position while I'm killing the line of text. But point always moves to the beginning of line. Why that happens so? Is it possible to save point position in such case? How?&lt;/p&gt;&#xA;" OwnerUserId="336" LastActivityDate="2015-01-20T18:06:00.580" Title="Why save-excursion doesn't save point position?" Tags="|point|save-excursion|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7575" PostTypeId="2" ParentId="7574" CreationDate="2015-01-20T17:33:17.543" Score="0" Body="&lt;p&gt;The behavior you describe is the standard one. Just replay your&#xA;functions interactively to see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this thing will do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-save-excursion ()&#xA;  (interactive)&#xA;  (let ((text &quot;Lorem Ipsum is simply dummy text&#xA;Lorem Ipsum has |been the industry's standard dummy text&#xA;It was popularised in the 1960s&quot;))&#xA;    (with-current-buffer &quot;*test*&quot;&#xA;      (erase-buffer)&#xA;      (insert text)&#xA;      (goto-char 50)&#xA;      (save-excursion&#xA;        (forward-line)&#xA;        (delete-region (point) (point-max)))))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-20T17:33:17.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7576" PostTypeId="2" ParentId="3429" CreationDate="2015-01-20T17:57:16.717" Score="0" Body="&lt;p&gt;Pretty big bump, but it really can be just a simple regexp as you (@ws6079) suggested in a comment. The following works for &lt;code&gt;.org&lt;/code&gt; and &lt;code&gt;.txt&lt;/code&gt; files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq deft-extension &quot;\\(\\.org\\'\\|\\.txt\\'\\)&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if support for this had been added since you first asked.&lt;/p&gt;&#xA;" OwnerUserId="5256" LastActivityDate="2015-01-20T17:57:16.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7577" PostTypeId="2" ParentId="7574" CreationDate="2015-01-20T18:06:00.580" Score="4" Body="&lt;p&gt;Thanks to @nanny!&lt;/p&gt;&#xA;&lt;p&gt;I found the answer in the mailing list which he mentioned in the comment!&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;save-excursion stores a marker, not the 'byte' number. When you kill&#xA;the line where point is, this marker gets replaced to the beginning of&#xA;the line.&lt;/p&gt;&#xA;&lt;p&gt;(From: Andreas Politz)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;From Elisp Manual [ (info &amp;quot;(elisp)Excursions&amp;quot;) ]:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Warning: Ordinary insertion of text adjacent to the saved point value&#xA;relocates the saved value, just as it relocates all markers. More&#xA;precisely, the saved value is a marker with insertion type nil. See&#xA;Marker Insertion Types. Therefore, when the saved point value is&#xA;restored, it normally comes before the inserted text.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Then another one explanation which makes the answer clearer.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Here's a simple example that may help.  Suppose you have a buffer&#xA;containing:&lt;/p&gt;&#xA;&lt;p&gt;1 abcdef&lt;/p&gt;&#xA;&lt;p&gt;2 123456&lt;/p&gt;&#xA;&lt;p&gt;3 wxyz&lt;/p&gt;&#xA;&lt;p&gt;and point is on line 2 between 3 and 4.  You write a function that&#xA;uses  save-excursion while it deletes line 1.  When the save-excursion&#xA;ends,  point will still be between 3 and 4, although this will now be&#xA;line 1.&lt;/p&gt;&#xA;&lt;p&gt;The intent is to continue pointing to the same text that it originally&#xA;pointed to.  But if that text itself is deleted, this is obviously not&#xA;possible.  Any markers that were within the deleted text will end up&#xA;pointing to the place where the text used to be.&lt;/p&gt;&#xA;&lt;p&gt;(From: Barry Margolin)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Now I see, if I want to put point on the same position as it was before editing I need to save that position and then just execute &lt;code&gt;(goto-char saved-position)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Thank you all!&lt;/p&gt;&#xA;" OwnerUserId="336" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-20T18:06:00.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7578" PostTypeId="2" ParentId="7564" CreationDate="2015-01-20T18:11:26.053" Score="11" Body="&lt;p&gt;Maybe something like this (tested with LaTeX and HTML)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: An Orged Paper&#xA;#+AUTHOR: Rasmus&#xA;#+DATE: A Dark Day for Science &#xA;&#xA;#+RESULTS: html-header&#xA;&#xA;#+begin_abstract&#xA;#+begin_center&#xA;{{{html-only(*Abstract*)}}}&#xA;#+end_center&#xA;my long abstract that is longer than one line. my long abstract that is longer than one line.&#xA;#+end_abstract&#xA;#+toc: headlines&#xA;* Introduction&#xA;Please read my paper!&#xA;* Data&#xA;~{0,1}~&#xA;* Conclusion&#xA;Something deep and profound&#xA;&#xA;{{{html-only(------------)}}}&#xA;* styles                                                           :noexport:&#xA;#+HTML_HEAD_EXTRA: &amp;lt;style type=&quot;text/css&quot;&amp;gt;&#xA;#+HTML_HEAD_EXTRA: &amp;lt;!--&#xA;#+HTML_HEAD_EXTRA:   .header_title {font-size: 2em; font-weight: bold;}&#xA;#+HTML_HEAD_EXTRA:   .header_author {font-size: 1.5em; font-weight: bold;text-align:center;}&#xA;#+HTML_HEAD_EXTRA:   .header_date {text-align:center;}&#xA;#+HTML_HEAD_EXTRA:   .header_date .timestamp {font-size:1em; color:#000000;}&#xA;#+HTML_HEAD_EXTRA:   .abstract {max-width: 30em; margin-left: auto; margin-right: auto;}&#xA;#+HTML_HEAD_EXTRA: --&amp;gt;&#xA;#+HTML_HEAD_EXTRA: &amp;lt;/style&amp;gt;&#xA;&#xA;#+OPTIONS: toc:nil&#xA;&#xA;#+MACRO: html-only (eval (if (org-export-derived-backend-p org-export-current-backend 'html) &quot;$1&quot; &quot;&quot;))&#xA;&#xA;#+NAME: html-header&#xA;#+BEGIN_SRC emacs-lisp :results raw :exports (if (org-export-derived-backend-p org-export-current-backend 'html) &quot;results&quot; &quot;none&quot;)&#xA;  &quot;#+begin_header&#xA;  ,#+begin_header_author&#xA;  {{{AUTHOR}}}&#xA;  ,#+end_header_author&#xA;  ,#+begin_header_date&#xA;  {{{DATE}}}&#xA;  ,#+end_header_date&#xA;  ,#+end_header&#xA;&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the &lt;code&gt;html-header&lt;/code&gt; could also be generated via &lt;code&gt;org-html-preamble&lt;/code&gt;.&#xA;Note also that from &lt;code&gt;org 8.3&lt;/code&gt; &lt;code&gt;org-latex-title-command&lt;/code&gt; can be used to customize the title as a format-string.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2015-05-13T09:15:13.900" LastActivityDate="2015-05-13T09:15:13.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7579" PostTypeId="2" ParentId="7537" CreationDate="2015-01-20T19:14:59.177" Score="3" Body="&lt;h1&gt;Babel solution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Note that the value of Babel parameters can be lisp code.  Thus you can have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :exports (if t &quot;results&quot;) :results raw&#xA;  &quot;\#+begin_quote &#xA;  my quote&#xA;  \#+end_quote&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Filter solution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can easily adapt this for a derived backend.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rasmus/get-org-string-element  (headline backend info)&#xA;&quot;Return the org element representation of an element.&quot;&#xA;(let ((prop-point (next-property-change 0 headline)))&#xA;  (if prop-point (plist-get (text-properties-at prop-point headline) :parent))))&#xA;&#xA;(defun rasmus/org-export-quotes-inherit-from-headlne (quote backend info)&#xA;  &quot;Discard some quotes based on headline properties.&quot;&#xA;  (let* ((elm (rasmus/get-org-string-element quote backend info))&#xA;     (parent (and elm (org-export-get-parent-headline elm))))&#xA;(when (equal (org-element-property :QUOTE_BLOCK parent)&#xA;         &quot;hide&quot;)&#xA;  &quot;&quot;)))&#xA;&#xA;(add-to-list 'org-export-filter-quote-block-functions&#xA;     'rasmus/org-export-quotes-inherit-from-headlne)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Example&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (require 'ox-org)&#xA;  (insert &quot;&#xA;* foo&#xA; :PROPERTIES:&#xA; :quote_block: hide&#xA; :END:&#xA; bar&#xA; \#+BEGIN_QUOTE&#xA; bar&#xA; \#+END_QUOTE&#xA;* foo2&#xA; \#+BEGIN_QUOTE&#xA; bar2&#xA; \#+END_QUOTE&quot;)&#xA;  (org-org-export-as-org nil nil nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which outputs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;bar&#xA;* foo2&#xA;#+BEGIN_QUOTE&#xA;bar2&#xA;#+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Derived backend solution w/example&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox-org)&#xA;&#xA;(org-export-define-derived-backend 'my-backend 'org&#xA;  :translate-alist '((quote-block . rasmus/org-export-quotes-inherit-from-headline)))&#xA;&#xA;(defun rasmus/org-export-quotes-inherit-from-headline (quote backend info)&#xA;  &quot;Discard some quotes based on headline properties.&quot;&#xA;  (let ((parent (org-export-get-parent-headline quote)))&#xA;(if (equal (org-element-property :QUOTE_BLOCK parent)&#xA;       &quot;hide&quot;)&#xA;    &quot;&quot;&#xA;  (org-org-identity quote backend info))))&#xA;&#xA;(with-temp-buffer&#xA;  (require 'ox-org)&#xA;  (insert &quot;&#xA;* foo&#xA; :PROPERTIES:&#xA; :quote_block: hide&#xA; :END:&#xA; bar&#xA; \#+BEGIN_QUOTE&#xA; UNDESIRED QUOTE&#xA; \#+END_QUOTE&#xA;* foo2&#xA; \#+BEGIN_QUOTE&#xA; DESIRED QUOTE&#xA; \#+END_QUOTE&quot;)&#xA;  (org-export-to-buffer 'my-backend &quot;*my backend export*&quot; nil nil nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="2710" LastEditDate="2015-01-23T21:23:01.027" LastActivityDate="2015-01-23T21:23:01.027" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7580" PostTypeId="1" CreationDate="2015-01-20T21:27:08.057" Score="4" ViewCount="155" Body="&lt;p&gt;How can I make Emacs toggle between the previous buffer within a single window (e.g. ignoring buffer changes in other windows)?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2019-04-19T09:30:40.857" Title="How to toggle between previous buffer in a given window (e.g toggle-previous-buffer-in-window)?" Tags="|buffers|window|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7581" PostTypeId="1" AcceptedAnswerId="7586" CreationDate="2015-01-20T21:40:31.637" Score="3" ViewCount="621" Body="&lt;p&gt;I know I can use ibuffer to filter available buffers by mode, but I can I do something analogous directly in helm? The mode is listed by helm, so maybe there is a way?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-01-20T22:24:05.640" Title="Can helm filter files by mode" Tags="|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7582" PostTypeId="2" ParentId="7580" CreationDate="2015-01-20T21:50:56.387" Score="5" Body="&lt;p&gt;I believe you are looking for &lt;a href=&quot;http://www.emacswiki.org/emacs/WinnerMode&quot; rel=&quot;noreferrer&quot;&gt;winner-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Winner mode, when activated, allows you to navigate windows, together with the buffer contents that was there at the time, by &lt;code&gt;C-c left&lt;/code&gt; and &lt;code&gt;C-c right&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5257" LastActivityDate="2015-01-20T21:50:56.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7583" PostTypeId="1" AcceptedAnswerId="7587" CreationDate="2015-01-20T21:57:10.013" Score="10" ViewCount="1830" Body="&lt;p&gt;When working with others around a shared monitor or via screen-sharing (e.g. Google Hangout), I often use &lt;code&gt;text-scale-adjust&lt;/code&gt; (&lt;code&gt;C-x C-+&lt;/code&gt;) to let others more easily read my screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to be able to also transiently increase the text size of the mode line and minibuffer in the selected frame.  Does such capability already exist?  If not, I might puzzle out how to write it myself...eventually.&lt;/p&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2015-05-09T20:28:49.953" Title="Transiently adjust text size in mode line and minibuffer?" Tags="|mode-line|minibuffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7584" PostTypeId="2" ParentId="7583" CreationDate="2015-01-20T22:04:03.337" Score="5" Body="&lt;p&gt;The default &lt;code&gt;C-x C-0/-/=&lt;/code&gt; bindings do an excellent job of font resizing. But they apply only to the buffer where they are used. They do not change the font sizes for the text outside the buffer, for example in the mode-line, mini-buffer or other buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below function changes the font size in those areas too, globally. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the &lt;code&gt;default-font-size-pt&lt;/code&gt; variable to set the default font size for each emacs session. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq default-font-size-pt 12)&#xA;&#xA;(defun modi/font-size-adj (&amp;amp;optional arg)&#xA;  &quot;The default C-x C-0/-/= bindings do an excellent job of font resizing.&#xA;They, though, do not change the font sizes for the text outside the buffer,&#xA;example in mode-line. Below function changes the font size in those areas too.&#xA;&#xA;M-&amp;lt;NUM&amp;gt; M-x modi/font-size-adj increases font size by NUM points if NUM is +ve,&#xA;                               decreases font size by NUM points if NUM is -ve&#xA;                               resets    font size if NUM is 0.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (if (= arg 0)&#xA;      (setq font-size-pt default-font-size-pt)&#xA;    (setq font-size-pt (+ font-size-pt arg)))&#xA;  ;; The internal font size value is 10x the font size in points unit.&#xA;  ;; So a 10pt font size is equal to 100 in internal font size value.&#xA;  (set-face-attribute 'default nil :height (* font-size-pt 10)))&#xA;&#xA;(defun modi/font-size-incr ()  (interactive) (modi/font-size-adj +1))&#xA;(defun modi/font-size-decr ()  (interactive) (modi/font-size-adj -1))&#xA;(defun modi/font-size-reset () (interactive) (modi/font-size-adj 0))&#xA;&#xA;(modi/font-size-reset) ; Initialize font-size-pt var to the default value&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Font adjusting can be made a breeze with the help of &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;hydra&lt;/code&gt;&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'hydra)&#xA;(defhydra hydra-font-resize&#xA;    (global-map &quot;C-M-=&quot;)&#xA;  &quot;font-resize&quot;&#xA;  (&quot;-&quot;   modi/font-size-decr  &quot;Decrease&quot;)&#xA;  (&quot;=&quot;   modi/font-size-incr  &quot;Increase&quot;)&#xA;  (&quot;0&quot;   modi/font-size-reset &quot;Reset to default size&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Increase font by 4 points &lt;code&gt;C-M-= = = = =&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Decrease font by 6 points &lt;code&gt;C-M-= - - - - - -&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Reset font to the set default point size &lt;code&gt;C-M-= 0&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;You are not exactly sure how big or small you want the fonts to be :) &lt;code&gt;C-M-= = = = - - = = - - 0 - - = =&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Feel free to change the &lt;code&gt;C-M-=&lt;/code&gt; prefix to anything else of your liking.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-01T03:37:11.023" LastActivityDate="2015-04-01T03:37:11.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7585" PostTypeId="1" CreationDate="2015-01-20T22:12:40.093" Score="5" ViewCount="581" Body="&lt;p&gt;I would like to repeat replacing a string with another string in a text file, until it is not possible. Is it possible to do that in Emacs?&#xA;I only know to replace just once with &lt;code&gt;M-%&lt;/code&gt; and &lt;code&gt;!&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, replace &lt;code&gt;&quot;  &quot;&lt;/code&gt; (two spaces) with &lt;code&gt;&quot; &quot;&lt;/code&gt; (one space) repeatedly until not possible.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="25" LastEditDate="2015-01-21T00:22:16.610" LastActivityDate="2017-05-19T15:52:51.787" Title="Repeat replacement until not possible?" Tags="|replace|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7586" PostTypeId="2" ParentId="7581" CreationDate="2015-01-20T22:24:05.640" Score="8" Body="&lt;p&gt;&lt;code&gt;helm-mini&lt;/code&gt; states in its help (which can be accessed with &lt;code&gt;C-c ?&lt;/code&gt; while it's running) that a token prefixed with &lt;code&gt;*&lt;/code&gt; is interpreted as substring match of a major mode.  Therefore, entering &lt;code&gt;*org&lt;/code&gt; gives you &lt;code&gt;org-mode&lt;/code&gt; buffers, entering further space-separated tokens can be used to narrow those down even more.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-20T22:24:05.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7587" PostTypeId="2" ParentId="7583" CreationDate="2015-01-20T23:00:36.313" Score="10" Body="&lt;p&gt;Text scaling zooms the text of a particular buffer, everywhere that the buffer is displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want to do is zoom a particular &lt;strong&gt;frame&lt;/strong&gt; and not just scale the text of a particular buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commands &lt;code&gt;zoom-in&lt;/code&gt;, &lt;code&gt;zoom-out&lt;/code&gt;, and &lt;code&gt;zoom-in/out&lt;/code&gt;  of library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/zoom-frm.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;zoom-frm.el&lt;/code&gt;&lt;/a&gt; let you do both of these things easily and incrementally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the keyboard, command &lt;strong&gt;&lt;code&gt;zoom-in/out&lt;/code&gt;&lt;/strong&gt; is all you need - use it as a replacement for &lt;code&gt;text-scale-adjust&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key ctl-x-map [(control ?+)] 'zoom-in/out)&#xA;(define-key ctl-x-map [(control ?-)] 'zoom-in/out)&#xA;(define-key ctl-x-map [(control ?=)] 'zoom-in/out)&#xA;(define-key ctl-x-map [(control ?0)] 'zoom-in/out)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind &lt;strong&gt;&lt;code&gt;zoom-in&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;zoom-out&lt;/code&gt;&lt;/strong&gt; to &lt;em&gt;mouse-wheel rotations&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (vector (list 'control mouse-wheel-down-event)) 'zoom-in)&#xA;(global-set-key (vector (list 'control mouse-wheel-up-event))   'zoom-out)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I bind these as well, for zooming by &lt;em&gt;mouse clicking&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [S-mouse-1]    'zoom-in)&#xA;(global-set-key [C-S-mouse-1]  'zoom-out)&#xA;;; Get rid of `mouse-set-font' or `mouse-appearance-menu':&#xA;(global-set-key [S-down-mouse-1] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.emacswiki.org/emacs/download/zoom-frm.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;zoom-frm.el&lt;/code&gt;&lt;/a&gt; commands can behave like &lt;code&gt;text-scale-adjust&lt;/code&gt;,&#xA;zooming a buffer wherever it is displayed, or they can zoom an&#xA;entire single frame (all of its windows, including minibuffers; its mode line; its scroll bars; etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;C-u&lt;/code&gt; at any time while using these commands to &lt;em&gt;toggle between buffer zooming and frame&#xA;zooming&lt;/em&gt;.  The kind of zooming (buffer or frame) you get by default is defined by option &lt;code&gt;zoom-frame/buffer&lt;/code&gt;. &lt;code&gt;C-u&lt;/code&gt; with a zoom command toggles the option.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:28:49.953" LastActivityDate="2015-05-09T20:28:49.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7588" PostTypeId="2" ParentId="7585" CreationDate="2015-01-20T23:53:52.017" Score="5" Body="&lt;p&gt;The question is not very clear.  &lt;code&gt;M-%&lt;/code&gt; followed by &lt;code&gt;!&lt;/code&gt; replaces all occurrences (after the cursor). Just put the cursor at the beginning (&lt;code&gt;M-&amp;lt;&lt;/code&gt;) and then use &lt;code&gt;M-%&lt;/code&gt; followed by &lt;code&gt;!&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now maybe what you mean is that you want to repeat the replacement (e.g. from the buffer beginning again) until no more such replacements are possible.  That can of course lead to an infinite loop, depending on your replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, here is a quick-and-dirty command to do that.  The &lt;code&gt;interactive&lt;/code&gt; spec is essentially from &lt;code&gt;query-replace&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (from-string to-string &amp;amp;optional delimited start end backward)&#xA;  (interactive&#xA;   (let ((common  (query-replace-read-args&#xA;                   (concat &quot;Query replace&quot;&#xA;                           (if current-prefix-arg&#xA;                               (if (eq current-prefix-arg '-) &quot; backward&quot; &quot; word&quot;)&#xA;                             &quot;&quot;)&#xA;                           (if (and transient-mark-mode  mark-active) &quot; in region&quot; &quot;&quot;))&#xA;                   nil)))&#xA;     (list (nth 0 common) (nth 1 common) (nth 2 common)&#xA;       (and transient-mark-mode  mark-active  (region-beginning))&#xA;       (and transient-mark-mode  mark-active  (region-end))&#xA;       (nth 3 common))))&#xA;  (goto-char (point-min))&#xA;  (while (save-excursion (re-search-forward from-string nil t))&#xA;    (while (re-search-forward from-string nil t)) (replace-match to-string nil nil)&#xA;    (goto-char (point-min))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to hit &lt;code&gt;!&lt;/code&gt; for each iteration, to obviate the problem of infinite looping, you can do something like this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (from-string to-string &amp;amp;optional delimited start end backward)&#xA;  (interactive&#xA;   (let ((common  (query-replace-read-args&#xA;                   (concat &quot;Query replace&quot;&#xA;                           (if current-prefix-arg&#xA;                               (if (eq current-prefix-arg '-) &quot; backward&quot; &quot; word&quot;)&#xA;                             &quot;&quot;)&#xA;                           (if (and transient-mark-mode  mark-active) &quot; in region&quot; &quot;&quot;))&#xA;                   nil)))&#xA;     (list (nth 0 common) (nth 1 common) (nth 2 common)&#xA;       (and transient-mark-mode  mark-active  (region-beginning))&#xA;       (and transient-mark-mode  mark-active  (region-end))&#xA;       (nth 3 common))))&#xA;  (goto-char (point-min))&#xA;  (while (perform-replace from-string to-string t nil delimited nil nil start end backward)&#xA;    (goto-char (point-min))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That just uses &lt;code&gt;perform-replace&lt;/code&gt; repeatedly, which gives you a chance (and the obligation) to act on each iteration.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:28:13.253" LastActivityDate="2015-05-09T20:28:13.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7589" PostTypeId="2" ParentId="7284" CreationDate="2015-01-21T00:34:06.557" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://endlessparentheses.com/new-in-emacs-25-1-easily-install-multifile-package-from-a-directory.html&quot;&gt;Emacs 25.1 now has this feature&lt;/a&gt;. From the &lt;code&gt;NEWS&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;** &lt;code&gt;package-install-from-buffer&lt;/code&gt; and &lt;code&gt;package-install-file&lt;/code&gt; work on directories. This follows the same rules as installing from a &lt;code&gt;.tar&lt;/code&gt; file, except the &lt;code&gt;-pkg.el&lt;/code&gt; file is optional.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There are no new commands to remember. Just issue &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/package-install-from-buffer&quot;&gt;&lt;code&gt;package-install-from-buffer&lt;/code&gt;&lt;/a&gt; from a dired buffer, or invoke &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/package-install-file&quot;&gt;&lt;code&gt;package-install-file&lt;/code&gt;&lt;/a&gt; and give a directory. Whichever package is contained in that directory will be read and installed, be it single or multifile, no taring or &lt;code&gt;-pkg.el&lt;/code&gt; file necessary.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-21T00:34:06.557" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7590" PostTypeId="1" AcceptedAnswerId="7594" CreationDate="2015-01-21T07:01:51.987" Score="4" ViewCount="1660" Body="&lt;p&gt;I'm trying to use my Orgmode calendar via MobileOrg on my Android devices, to push events to the Google calendar, and neither sexp-formatted events nor recurring events (set up with +) seem to appear in Google calendar (for + recurring events the first one appears, but none of the subsequent ones).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution would seem to be to create individual entries for every occurrence of the recurring event, which will be tedious and inefficient.  I assume there must be a way of harnessing the power of elisp in such a way to create a function which, when given a start date and a stop date and a time-span for recurrence [e.g. every day, every week etc.] (and, ideally, note any skipped dates, e.g. for holidays) and have that function output individual org-mode events.  Has anyone done this sort of thing?&lt;/p&gt;&#xA;" OwnerUserId="891" LastActivityDate="2015-01-21T10:39:05.243" Title="Orgmode - scheduling recurring events without using sexp or +-syntax" Tags="|org-mode|calendar|mobileorg|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7591" PostTypeId="1" AcceptedAnswerId="7593" CreationDate="2015-01-21T08:48:34.500" Score="27" ViewCount="5648" Body="&lt;p&gt;I would like to list the available tags in Magit in order to diff a specific revision, is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically what I am after is to list the revision history at a certain tag and then view the diff for one of the patches in its history.  I have just completed a rebase and noticed some inconsistencies, I know which patch introduced the change and I would like to see its diff from the version prior to the rebase.&lt;/p&gt;&#xA;" OwnerUserId="457" LastActivityDate="2021-11-01T16:45:02.317" Title="How can I list available tags in Magit?" Tags="|magit|git|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7592" PostTypeId="1" AcceptedAnswerId="7606" CreationDate="2015-01-21T09:09:52.970" Score="2" ViewCount="1227" Body="&lt;p&gt;I am working on a Linux driver, and I would like to use emacs. My problem is that indenting does not work, no matter what. by this, I mean that when I press &lt;kbd&gt;enter&lt;/kbd&gt; from a line, it goes at the beginning of the new line, and pressing TAB even a million times does not change this behavior.&#xA;I've spent the last hour trying to fix this by changing my .emacs, but absolutely no results.&#xA;Here's a copy of my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'misterioso)&#xA;&#xA;;; Disable toolbar and menubar&#xA;(tool-bar-mode -1)&#xA;(scroll-bar-mode -1)&#xA;(menu-bar-mode -1)&#xA;&#xA;;; Remember position in opened files&#xA;(require 'saveplace)&#xA;(setq-default save-place t)&#xA;&#xA;;; Close all buffers&#xA;(defun close-all-buffers ()&#xA;  (interactive)&#xA;  (mapc 'kill-buffer (buffer-list)))&#xA;&#xA;;; Remove trailing whitespaces before saving&#xA;(add-hook 'before-save-hook 'delete-trailing-whitespace)&#xA;&#xA;;; Display line and column number in toolbar&#xA;(setq line-number-mode t)&#xA;(setq column-number-mode t)&#xA;&#xA;;; Show matching parentheses&#xA;(show-paren-mode t)&#xA;&#xA;;; Goto-line command&#xA;(global-set-key &quot;\C-cg&quot; 'goto-line)&#xA;&#xA;;; Kill rectangular regions&#xA;(global-set-key &quot;\C-cr&quot; 'kill-rectangle)&#xA;&#xA;;; Comment region command&#xA;(global-set-key &quot;\C-cc&quot; 'comment-region)&#xA;(global-set-key &quot;\C-cv&quot; 'uncomment-region)&#xA;&#xA;;; Display question in 'y/n' instead of 'yes/no'&#xA;(fset 'yes-or-no-p 'y-or-n-p)&#xA;&#xA;(setq load-path (cons (expand-file-name &quot;~/.emacs.d/&quot;) load-path))&#xA;&#xA;;; Color the code&#xA;(require 'font-lock)&#xA;(global-font-lock-mode t)&#xA;&#xA;;; Max decoration&#xA;(setq font-lock-maximum-decoration t)&#xA;&#xA;;; Delete selected text when typing&#xA;(delete-selection-mode 1)&#xA;&#xA;;; Highlight current line&#xA;(hl-line-mode t)&#xA;&#xA;;; Put a final newline in saved files&#xA;(setq require-final-newline t)&#xA;&#xA;;; LATEX!&#xA;(setq ispell-program-name &quot;aspell&quot;)&#xA;; could be ispell as well, depending on your preferences&#xA;(setq ispell-dictionary &quot;english&quot;)&#xA;; this can obviously be set to any language your spell-checking program     supports&#xA;(add-hook 'LaTeX-mode-hook 'flyspell-mode)&#xA;(add-hook 'LaTeX-mode-hook 'flyspell-buffer)&#xA;(require 'flymake)&#xA;&#xA;;; Set backup directory&#xA;(setq&#xA; backup-by-copying t&#xA; backup-directory-alist&#xA; '((&quot;.&quot; . &quot;~/.emacs-backups&quot;))&#xA; delete-old-versions t&#xA; kept-new-versions 6&#xA; kept-old-versions 2&#xA; version-control t)&#xA;&#xA;(defun count-words-region (start end)&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (let ((n 0))&#xA;      (goto-char start)&#xA;      (while (&amp;lt; (point) end)&#xA;        (if (forward-word 1)&#xA;            (setq n (1+ n))))&#xA;      (message &quot;Region has %d words&quot; n)&#xA;      n)))&#xA;&#xA;(setq-default indent-tabs-mode t)&#xA;&#xA;;; Tab width&#xA;(setq default-tab-width 8)&#xA;(custom-set-variables&#xA; '(inhibit-startup-screen t))&#xA;&#xA;(require 'whitespace)&#xA;(setq whitespace-line-column 80) ;; limit line length&#xA;(setq whitespace-style '(face lines-tail))&#xA;&#xA;(add-hook 'prog-mode-hook 'whitespace-mode)&#xA;&#xA;(defun c-lineup-arglist-tabs-only (ignored)&#xA;   &quot;Line up argument lists by tabs, not spaces&quot;&#xA;   (let* ((anchor (c-langelem-pos c-syntactic-element))&#xA;     (column (c-langelem-2nd-pos c-syntactic-element))&#xA;     (offset (- (1+ column) anchor))&#xA;     (steps (floor offset c-basic-offset)))&#xA;     (* (max steps 1)&#xA;        c-basic-offset)))&#xA;&#xA; (add-hook 'c-mode-common-hook&#xA;           (lambda ()&#xA;             ;; Add kernel style&#xA;             (c-add-style&#xA;              &quot;linux-tabs-only&quot;&#xA;              '(&quot;linux&quot; (c-offsets-alist&#xA;                         (arglist-cont-nonempty&#xA;                          c-lineup-gcc-asm-reg&#xA;                          c-lineup-arglist-tabs-only))))))&#xA;&#xA;(setq-default major-mode 'text-mode)&#xA;     (add-hook 'text-mode-hook 'turn-on-auto-fill)&#xA;&#xA;(electric-indent-mode 1)&#xA;(dolist (command '(yank yank-pop))&#xA;   (eval `(defadvice ,command (after indent-region activate)&#xA;            (and (not current-prefix-arg)&#xA;                 (member major-mode '(emacs-lisp-mode lisp-mode&#xA;                                                      clojure-mode scheme-mode&#xA;                                                      haskell-mode    ruby-mode&#xA;                                                      rspec-mode          python-mode&#xA;                                                      c-mode          c++-mode&#xA;                                                      objc-mode       latex-mode&#xA;                                                      plain-tex-mode))&#xA;                 (let ((mark-even-if-inactive transient-mark-mode))&#xA;                   (indent-region (region-beginning) (region-end) nil))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me please? I am starting to get desperate.... :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance!!&lt;/p&gt;&#xA;" OwnerUserId="5261" LastEditorUserId="11" LastEditDate="2015-01-21T09:18:29.793" LastActivityDate="2015-01-21T14:57:15.880" Title="Tab indentation for kernel editing" Tags="|indentation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7593" PostTypeId="2" ParentId="7591" CreationDate="2015-01-21T09:40:18.583" Score="11" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Specifically what I am after is to list the revision history at a certain tag&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It sounds like you already know the tag you need, in which case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit 1.x:&lt;br&gt;&#xA;&lt;kbd&gt;l&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;l&lt;/kbd&gt; &lt;em&gt;type tag name (with TAB completion)&lt;/em&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit 2.x:&lt;br&gt;&#xA;&lt;kbd&gt;l&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; &lt;em&gt;type tag name (with TAB completion)&lt;/em&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I have just completed a rebase and noticed some inconsistencies&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Or use the reflog to find the pre-rebase hash:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit 1.x:&lt;br&gt;&#xA;&lt;kbd&gt;l&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;h&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit 2.x:&lt;br&gt;&#xA;&lt;kbd&gt;l&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-07-07T21:28:14.603" LastActivityDate="2015-07-07T21:28:14.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7594" PostTypeId="2" ParentId="7590" CreationDate="2015-01-21T10:39:05.243" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The solution would seem to be to create individual entries for every occurrence of the recurring event, which will be tedious and inefficient. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why?  It would be the way to gain maximum control and AFAIK this is required for repeated events that you want to transfer via e.g. &lt;code&gt;org-caldav.el&lt;/code&gt;.  The reason is that you need an UID (&lt;em&gt;U&lt;/em&gt;nique) for each event to be able to consistently track them (though &lt;code&gt;ox-ical.el&lt;/code&gt; does provide such an UID for repeated events set up with e.g. &lt;code&gt;org-class&lt;/code&gt; they are ignored by at least &lt;code&gt;org-caldav.el&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, &lt;code&gt;org-clone-subtree-with-time-shift&lt;/code&gt; has been part of Emacs for a good many years.  It will set up &lt;em&gt;n&lt;/em&gt; headings for you with a timeshift, like &lt;code&gt;+1w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (save-excursion (insert &quot;* foo\n&amp;lt;2015-01-21 mié&amp;gt;&quot;))&#xA;  (org-clone-subtree-with-time-shift 2 &quot;+1w&quot;)&#xA;  (buffer-substring-no-properties (point-min) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; * foo &#xA; &amp;lt;2015-01-21 mié&amp;gt;&#xA; * foo&#xA; &amp;lt;2015-01-28 mié&amp;gt;&#xA; * foo&#xA; &amp;lt;2015-02-04 mié&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2015-01-21T10:39:05.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7595" PostTypeId="1" AcceptedAnswerId="13719" CreationDate="2015-01-21T10:46:44.777" Score="25" ViewCount="9283" Body="&lt;p&gt;I want to rewrite parts of an opensource project. This includes renaming methods. How can I do that efficiently in emacs across the whole project?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would rather not use hacks such as search and replace in every buffer.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2022-04-25T15:55:51.310" Title="How do I refactor across a project in emacs (change method name everywhere)?" Tags="|refactoring|" AnswerCount="7" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7596" PostTypeId="2" ParentId="7595" CreationDate="2015-01-21T11:07:29.790" Score="4" Body="&lt;p&gt;For some generic approaches, look under the &quot;&lt;strong&gt;Replace Across Files&lt;/strong&gt;&quot; heading on the Emacs Wiki search &amp;amp; replace page: &lt;a href=&quot;http://www.emacswiki.org/emacs/CategorySearchAndReplace&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/CategorySearchAndReplace&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see the answers to: &lt;a href=&quot;https://stackoverflow.com/questions/270930/using-emacs-to-recursively-find-and-replace-in-text-files-not-already-open&quot;&gt;Using Emacs to recursively find and replace in text files not already open&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-01-21T11:07:29.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7597" PostTypeId="1" AcceptedAnswerId="7599" CreationDate="2015-01-21T13:16:12.140" Score="6" ViewCount="1813" Body="&lt;p&gt;I want to insert a comment line between two top-level headings like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# first comment&#xA;&#xA;* Top level headline&#xA;  * Second level&#xA;    * 3rd level&#xA;      some text&#xA;    * 3rd level&#xA;      more text&#xA;&#xA;# second comment&#xA;&#xA;* Another top level headline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the second comment shows up intended as part of the last 3rd level heading and it's impossible to unindent it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# first comment&#xA;&#xA;* Top level headline&#xA;  * Second level&#xA;    * 3rd level&#xA;      some text&#xA;    * 3rd level&#xA;      more text&#xA;&#xA;      # second comment&#xA;&#xA;* Another top level headline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to override this behaviour?&lt;/p&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2015-01-26T16:36:25.257" Title="Comment lines in org-mode with clean view" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7598" PostTypeId="2" ParentId="7595" CreationDate="2015-01-21T13:26:46.090" Score="9" Body="&lt;p&gt;Since you didn't specify the language, it's hard to give better answers than “Search and Replace”.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Using wgrep&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you just want to (interactively) replace all instances of a symbol&#xA;with another, wgrep is your best bet. It let's you interactively edit&#xA;the grep results buffer.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x package-install RET wgrep&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x rgrep&lt;/code&gt;. It will ask you a few easy questions and then do a recursive search for the search-term inside the directory you speficied.&lt;/li&gt;&#xA;&lt;li&gt;Switch to the results buffer and do &lt;code&gt;M-x wgrep-change-to-wgrep-mode&lt;/code&gt;. This buffer is now editable. Any changes you make here will be reflected in the files themselves.&lt;/li&gt;&#xA;&lt;li&gt;Run a &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/replace-regexp&quot;&gt;&lt;code&gt;replace-regexp&lt;/code&gt;&lt;/a&gt; or a &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/query-replace-regexp&quot;&gt;&lt;code&gt;query-replace-regexp&lt;/code&gt;&lt;/a&gt; in this buffer, to do the refactoring.&lt;/li&gt;&#xA;&lt;li&gt;Finish your edits with &lt;code&gt;M-x wgrep-save-all-buffers&lt;/code&gt; and &lt;code&gt;M-x wgrep-finish-edit&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-21T13:26:46.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7599" PostTypeId="2" ParentId="7597" CreationDate="2015-01-21T13:27:19.503" Score="5" Body="&lt;p&gt;This is a design feature of Org-Mode.  There is no way to end a headline without starting a new one, so there is no way to return to top level between two headlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest method to display that sort of information between two top level headlines would be to use a non-exported headline as the comment.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Second Comment                             :noexport:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will not be folded into either of the other headlines (all the same level) and when exported nothing will appear at that level.  You can include any body to the comment (additional notes) as body to the headline, they will only appear if you expand the headline.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-01-21T13:27:19.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7600" PostTypeId="1" CreationDate="2015-01-21T13:29:03.473" Score="2" ViewCount="851" Body="&lt;p&gt;Disclaimer: newbie to emacs, vaguely competent on MacOS and git.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm building emacs on OSX Yosemite from the git master repo.  I've done this several times, primarily by using&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;./configure --with-ns --with-imagemagick --with-rsvg --with gnutls&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with greater or lesser degrees of success, depending on current state of master. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I derived this config from lunaryorn's &lt;a href=&quot;https://emacs.stackexchange.com/questions/271/what-is-the-difference-between-aquamacs-and-other-mac-versions-of-emacs&quot;&gt;excellent discussion of emacs on MacOS&lt;/a&gt; without really understanding what I'm doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decide to take a look today at the &lt;code&gt;configure.ac&lt;/code&gt; file to find out what compile options are actually available.  The relevant bits seem to be these:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;OPTION_DEFAULT_ON([xpm],[don't compile with XPM image support])&#xA;   OPTION_DEFAULT_ON([jpeg],[don't compile with JPEG image support])&#xA;   OPTION_DEFAULT_ON([tiff],[don't compile with TIFF image support])&#xA;   OPTION_DEFAULT_ON([gif],[don't compile with GIF image support])&#xA;   OPTION_DEFAULT_ON([png],[don't compile with PNG image support])&#xA;   OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support])&#xA;   OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support])&#xA;   OPTION_DEFAULT_ON([imagemagick],[don't compile with ImageMagick image support])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts])&#xA;   OPTION_DEFAULT_ON([libotf],[don't use libotf for OpenType font support])&#xA;   OPTION_DEFAULT_ON([m17n-flt],[don't use m17n-flt for text shaping])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])&#xA;   OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])&#xA;   OPTION_DEFAULT_ON([xim],[don't use X11 XIM])&#xA;   OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system])&#xA;   OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI in a Cygwin build])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])&#xA;   OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])&#xA;   OPTION_DEFAULT_ON([gconf],[don't compile with GConf support])&#xA;   OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support])&#xA;   OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support])&#xA;   OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support])&#xA;   OPTION_DEFAULT_ON([zlib],[don't compile with zlib decompression support])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I can tell, it seems that imagemagick et al are already being built by default, so I only really need to use the &lt;code&gt;--with-ns&lt;/code&gt; flag.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is that correct?  &lt;/li&gt;&#xA;&lt;li&gt;If so, are there any of these default_ON settings that I can turn off as not relevant (such as the X-related ones?)?&lt;/li&gt;&#xA;&lt;li&gt;In regards to lunaryorn's config mentioned above, would I need to use those options for a &lt;code&gt;brew install&lt;/code&gt; version of emacs?  &lt;/li&gt;&#xA;&lt;li&gt;Finally, any other tips on building from source?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="496" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-01-21T13:29:03.473" Title="Configure.ac options when building from source" Tags="|osx|compilation|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7601" PostTypeId="1" AcceptedAnswerId="7605" CreationDate="2015-01-21T13:55:03.343" Score="6" ViewCount="3683" Body="&lt;p&gt;Usually there are many &lt;code&gt;.el&lt;/code&gt; files in the folders with the name &lt;code&gt;lisp&lt;/code&gt; in the installation directory of Emacs. &#xA;At start-up, Emacs doesn't load all these files, in consequence a command like &lt;code&gt;M-x calendar-print-day-of-year&lt;/code&gt; in only accessible after loading &lt;code&gt;calendar.el&lt;/code&gt; or doing &lt;code&gt;M-x calendar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to load all &lt;code&gt;.el&lt;/code&gt; files (found at &lt;code&gt;lisp&lt;/code&gt; subdirectories) at Emacs' start-up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The motivation is that there are situations where it would be desirable that that all commands to be at disposal. &lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-01-21T15:38:13.340" Title="How to load all .el files at start-up" Tags="|start-up|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7602" PostTypeId="1" AcceptedAnswerId="7603" CreationDate="2015-01-21T14:03:38.680" Score="26" ViewCount="6312" Body="&lt;p&gt;&lt;code&gt;(quote x)&lt;/code&gt; makes x not be evaluated, but adding a &lt;code&gt;,&lt;/code&gt; in front of &lt;code&gt;x&lt;/code&gt; within &lt;code&gt;quote&lt;/code&gt; makes it evaluated. What is then the point of using quote with a single argument with a comma in front of it, like so: &lt;code&gt;(quote ,x)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Motivated by &lt;a href=&quot;https://github.com/magnars/annoying-arrows-mode.el/blob/master/annoying-arrows-mode.el#L59&quot;&gt;line 59 from annoying arrows&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(put (quote ,cmd) 'aa--alts ,alternatives)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why isn't &lt;code&gt;(put cmd 'aa-alts ,alternatives)&lt;/code&gt; equally good?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2015-07-11T04:48:16.403" LastActivityDate="2015-07-11T04:48:16.403" Title="What is the point of quote with single argument and comma? (quote ,arg)" Tags="|elisp|backquote|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7603" PostTypeId="2" ParentId="7602" CreationDate="2015-01-21T14:16:55.120" Score="35" Body="&lt;p&gt;The comma is used in the context of a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot; rel=&quot;noreferrer&quot;&gt;backquoted&lt;/a&gt; (a.k.a. quasiquoted) list, which allows you to evaluate some portions of the list selectively.  See also &lt;a href=&quot;https://emacs.stackexchange.com/questions/7481/how-to-evaluate-the-variables-before-adding-them-to-a-list&quot;&gt;this thread&lt;/a&gt; for an example of a use for backquoting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple of simple examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq a &quot;a's value&quot; b &quot;b's value&quot; c &quot;c's value&quot;)&#xA;'(a  b  c)                              ; =&amp;gt; (a b c)&#xA;`(,a b ,c)                              ; =&amp;gt; (&quot;a's value&quot; b &quot;c's value&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/magnars/annoying-arrows-mode.el/blob/master/annoying-arrows-mode.el#L59&quot; rel=&quot;noreferrer&quot;&gt;The commas to which you're referring&lt;/a&gt; are in a macro definition that, in turn, uses a backquoted &lt;code&gt;progn&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro add-annoying-arrows-advice (cmd alternatives)&#xA;  `(progn&#xA;     (add-to-list 'annoying-commands (quote ,cmd))&#xA;     (put (quote ,cmd) 'aa--alts ,alternatives)&#xA;     (defadvice ,cmd (before annoying-arrows activate)&#xA;       (when annoying-arrows-mode&#xA;         (aa--maybe-complain (quote ,cmd))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;,cmd&lt;/code&gt; within the backquote allows you to put the value of &lt;code&gt;cmd&lt;/code&gt; in place rather than the symbol &lt;code&gt;cmd&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-01-21T14:16:55.120" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7604" PostTypeId="2" ParentId="7602" CreationDate="2015-01-21T14:20:05.107" Score="12" Body="&lt;p&gt;That's because it's inside a macro.  A macro needs to return a Lisp form, which then in turn gets evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, looking at the first invocation of this macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-annoying-arrows-advice previous-line '(ace-jump-mode backward-paragraph isearch-backward ido-imenu smart-up))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We need the expansion to contain:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'previous-line 'aa-alts '(ace-jump-mode backward-paragraph isearch-backward ido-imenu smart-up))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is what &lt;code&gt;(quote ,cmd)&lt;/code&gt; achieves.  If the macro would use plain &lt;code&gt;cmd&lt;/code&gt; instead, it would be kept literally and the expansion would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put cmd 'aa-alts '(ace-jump-mode backward-paragraph isearch-backward ido-imenu smart-up))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is an error, because &lt;code&gt;cmd&lt;/code&gt; is not defined in the environment where the macro is invoked.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-21T14:20:05.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7605" PostTypeId="2" ParentId="7601" CreationDate="2015-01-21T14:52:11.917" Score="12" Body="&lt;p&gt;The answer is rather trivial:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc 'load (file-expand-wildcards &quot;~/some-lisp-files/*.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But as suggested above, it's always better to load just the code you are certain of, not even because it's more secure to do so, but because it could be too annoying to debug it if you introduce an accidental change etc.  Worse yet, if some of those files contain code which deletes some files you might not want to delete, or does some other things, which you generally don't want to happen automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anything, I'd go with something like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open Dired buffer in the directory you want to load files from.&lt;/li&gt;&#xA;&lt;li&gt;Maybe open recursively other directories with other Lisp files, or search Dired to get a list of files you want to load, using &lt;kbd&gt;i&lt;/kbd&gt; for insert or &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;find-dired&lt;/code&gt; to search.&lt;/li&gt;&#xA;&lt;li&gt;Mark the files you actually want to load with commands like &lt;kbd&gt;t&lt;/kbd&gt; or &lt;kbd&gt;m&lt;/kbd&gt; or using masks &lt;kbd&gt;* %&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;l&lt;/kbd&gt; to load all marked files.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also, note that this will actually &lt;strong&gt;load&lt;/strong&gt; the files (as per the title of your question), but you are more likely to be interested in &lt;strong&gt;require&lt;/strong&gt;. This will also automatically load the proper version (either the source or the byte-compiled one). Also, it will take care of the proper loading order.  But, you will have to spell out what exactly you want to require.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-21T14:52:11.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7606" PostTypeId="2" ParentId="7592" CreationDate="2015-01-21T14:57:15.880" Score="1" Body="&lt;p&gt;You're missing the variable &lt;code&gt;c-basic-offset&lt;/code&gt;. You need to set this to 8 if you want your indentation levels to be tabs. Add &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq c-basic-offset 8)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;somewhere to your init file. Perhaps next to &lt;code&gt;indent-tabs-mode&lt;/code&gt;, or as the first expression in the lambda of your &lt;code&gt;c-mode-common-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you still can't get indents, I would try removing this line from your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-path (cons (expand-file-name &quot;~/.emacs.d/&quot;) load-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then restart Emacs.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-21T14:57:15.880" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7607" PostTypeId="1" AcceptedAnswerId="17382" CreationDate="2015-01-21T15:15:17.270" Score="17" ViewCount="4851" Body="&lt;p&gt;The &lt;code&gt;org-mode&lt;/code&gt; manual says that it's possible to &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot; rel=&quot;noreferrer&quot;&gt;export property drawers&lt;/a&gt;, but trying with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+OPTIONS: d:t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does not export any &lt;code&gt;:PROPERTIES:&lt;/code&gt; blocks like it used to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the &lt;a href=&quot;http://orgmode.org/manual/Drawers.html&quot; rel=&quot;noreferrer&quot;&gt;Drawers chapter&lt;/a&gt; it seems it is indeed not possible anymore, at least with the latest &lt;code&gt;org-mode&lt;/code&gt; version:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can select the name of the drawers which should be exported with org-export-with-drawers. In that case, drawer contents will appear in export output. &lt;strong&gt;Property drawers are &lt;em&gt;not&lt;/em&gt; affected by this variable and are &lt;em&gt;never&lt;/em&gt; exported.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there any tweak to regain that functionality, i.e. having &lt;code&gt;#+OPTIONS: d:t&lt;/code&gt; export the whole &lt;code&gt;:PROPERTIES:&lt;/code&gt; block, short of manually changing the &lt;code&gt;.org&lt;/code&gt; file before export time?&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="504" LastEditDate="2015-01-22T21:31:37.437" LastActivityDate="2015-10-14T19:27:03.027" Title="Export :PROPERTIES: blocks with org-mode?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7608" PostTypeId="2" ParentId="7601" CreationDate="2015-01-21T15:38:13.340" Score="2" Body="&lt;p&gt;Loading all the files in Emacs's &lt;code&gt;lisp&lt;/code&gt; directory is currently unsafe: some of those files (like the &lt;code&gt;w32-*.el&lt;/code&gt;) are only meant to be used for a particular platform and will break your session in various ways when used on another platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel to try it, tho, because I consider such breakage to be bugs, and indeed, I've bumped into several of them, and have fixed some of those I encountered: in principle it &lt;em&gt;should&lt;/em&gt; be safe to do it.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-01-21T15:38:13.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7609" PostTypeId="2" ParentId="7564" CreationDate="2015-01-21T15:59:02.140" Score="0" Body="&lt;p&gt;The most difficult problem I ran into with this is the conditional styling of different sections and the conditional numbering of different sections. This is a solution for both of these problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my paper:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Complex Tracking of Awesome Things&#xA;#+AUTHOR: Bastibe&#xA;#+INCLUDE: style.org&#xA;&#xA;* Abstract&#xA;:PROPERTIES:&#xA;:NUMBERS: no&#xA;:HTML_CONTAINER_CLASS: abstract&#xA;:END:&#xA;&#xA;Lorem ipsum dolor sit amet...&#xA;&#xA;* Introduction&#xA;:PROPERTIES:&#xA;:NUMBERS: no&#xA;:END:&#xA;&#xA;* Methodology&#xA;&#xA;* Results&#xA;&#xA;* Conclusion&#xA;&#xA;* Acknowledgements&#xA;:PROPERTIES:&#xA;:NUMBERS:  no&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First up, this includes an org file with some additional options. This file, called &lt;code&gt;style.org&lt;/code&gt; above sets the HTML export to load a custom style sheet, and sets a few LaTeX options. If you are not exporting to LaTeX, you won't need those.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: en&#xA;#+OPTIONS: tags:nil html-postamble:nil # toc:nil&#xA;#+STARTUP: nofold hideblocks&#xA;#+BIND: org-latex-title-command &quot;&quot;&#xA;&#xA;#+HTML_MATHJAX: path:&quot;MathJax/MathJax.js&quot;&#xA;#+HTML_HEAD: &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; /&amp;gt;&#xA;&#xA;#+LATEX_CLASS: article&#xA;#+LATEX_CLASS_OPTIONS: [a4paper, 12pt]&#xA;#+LATEX_HEADER: \usepackage{setspace}&#xA;#+LATEX_HEADER: \onehalfspacing&#xA;#+LATEX_HEADER: \usepackage{fontspec}&#xA;#+LATEX_HEADER: \setmainfont{Cambria}&#xA;#+LATEX_HEADER: \setmonofont{PragmataPro}&#xA;#+LATEX_HEADER: \usepackage{polyglossia}&#xA;#+LATEX_HEADER: \setdefaultlanguage{english}&#xA;#+LATEX_HEADER: \usepackage[a4paper, scale=0.8]{geometry}&#xA;#+LATEX_HEADER: \usepackage{amsmath}&#xA;#+LATEX_HEADER: \usepackage{units}&#xA;#+LATEX_HEADER: \usepackage{titling}&#xA;#+LATEX_HEADER: \usepackage{listings}&#xA;#+LATEX_HEADER: \lstset{basicstyle=\ttfamily\footnotesize,showstringspaces=false}&#xA;#+LATEX_HEADER: \usepackage[hang]{caption}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to render this as paper-like HTML, a little CSS is enough (saved in &lt;code&gt;style.css&lt;/code&gt;:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#content {&#xA;    max-width: 80ex;&#xA;    position: relative;&#xA;    margin: 5px auto;&#xA;    font-family: Cambria;&#xA;    text-align: justify;&#xA;    -moz-hyphens: auto;&#xA;}&#xA;&#xA;.abstract {&#xA;    max-width: 65ex;&#xA;    margin: 5px auto;&#xA;    margin-top: 4em;&#xA;    margin-bottom: 4em;&#xA;    content: none;&#xA;}&#xA;&#xA;p {&#xA;    text-indent: 5ex;&#xA;    margin-bottom: 0;&#xA;    margin-top: 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the section numbers will be wrong. Org mode can either number all sections, or none. Papers typically need numbers on the body sections, but not the Abstract and the Summary. The following piece of code will make Org put numbers in front of regular sections, but suppress the numbers if the property &lt;code&gt;:NUMBERS: no&lt;/code&gt; is set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun headline-numbering-filter (data backend info)&#xA;  &quot;No numbering in headlines that have a property :numbers: no&quot;&#xA;  (let* ((beg (next-property-change 0 data))&#xA;         (headline (if beg (get-text-property beg :parent data))))&#xA;    (if (string= (org-element-property :NUMBERS headline) &quot;no&quot;)&#xA;        (cond ((eq backend 'latex)&#xA;               (replace-regexp-in-string&#xA;                &quot;\\(part\\|chapter\\|\\(?:sub\\)*section\\|\\(?:sub\\)?paragraph\\)&quot;&#xA;                &quot;\\1*&quot; data nil nil 1))&#xA;              ((eq backend 'html)&#xA;               (replace-regexp-in-string&#xA;                &quot;\\(&amp;lt;h[1-6]\\)\\([^&amp;gt;]*&amp;gt;\\)&quot;&#xA;                &quot;\\1 class=\&quot;nonumber\&quot;\\2&quot; data nil nil)))&#xA;      data)))&#xA;&#xA;(setq org-export-filter-headline-functions '(headline-numbering-filter))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works well for the LaTeX export, but not in the HTML export. With modern CSS, browsers can do the numbering for you though (appended to &lt;code&gt;style.css&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* do not show section numbers */&#xA;span.section-number-2 { display: none; }&#xA;span.section-number-3 { display: none; }&#xA;span.section-number-4 { display: none; }&#xA;span.section-number-5 { display: none; }&#xA;span.section-number-6 { display: none; }&#xA;&#xA;/* use LaTeX-style names for the counters */&#xA;h1 { counter-reset: section; }&#xA;h2 { counter-reset: subsection; }&#xA;h3 { counter-reset: subsubsection; }&#xA;h4 { counter-reset: paragraph; }&#xA;h5 { counter-reset: subparagraph; }&#xA;&#xA;.nonumber::before { content: none; }&#xA;&#xA;h2::before {&#xA;    content: counter(section) &quot; &quot;;&#xA;    counter-increment: section;&#xA;}&#xA;&#xA;h3::before {&#xA;    content: counter(section) &quot;.&quot; counter(subsection) &quot; &quot;;&#xA;    counter-increment: subsection;&#xA;}&#xA;&#xA;h4::before {&#xA;    content: counter(section) &quot;.&quot; counter(subsection) &quot;.&quot; counter(subsubsection) &quot; &quot;;&#xA;    counter-increment: subsubsection;&#xA;}&#xA;&#xA;h5::before {&#xA;    content: counter(section) &quot;.&quot; counter(subsection) &quot;.&quot; counter(subsubsection) &quot;.&quot; counter(paragraph) &quot; &quot;;&#xA;    counter-increment: paragraph;&#xA;}&#xA;&#xA;h6::before {&#xA;    content: counter(section) &quot;.&quot; counter(subsection) &quot;.&quot; counter(subsubsection) &quot;.&quot; counter(paragraph) &quot;.&quot; counter(subparagraph) &quot; &quot;;&#xA;    counter-increment: subparagraph;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that, you can export your paper to both LaTeX and HTML.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2015-01-21T15:59:02.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7610" PostTypeId="1" AcceptedAnswerId="7611" CreationDate="2015-01-21T16:52:07.770" Score="3" ViewCount="472" Body="&lt;p&gt;Thanks to &lt;code&gt;helm-swoop&lt;/code&gt;, I know how to display occurrences of a &lt;em&gt;single&lt;/em&gt; word. Now, I'd like to display &lt;em&gt;at the same time&lt;/em&gt; occurrences of &lt;em&gt;many&lt;/em&gt; different words (of a given, single buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me be specific: say, I have a buffer containing multiple occurrences of the two words 'Hello' and 'Bye', and I'd like to check each 'Hello' is followed by a 'Bye' before any further 'Hello'. For this, I'd like to filter &lt;em&gt;at the same time&lt;/em&gt; the occurrences of these two words. How could I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="5267" LastEditorUserId="105" LastEditDate="2015-01-22T15:58:27.070" LastActivityDate="2015-01-22T15:58:27.070" Title="How to display at the same time occurrences of two different words?" Tags="|helm|search|occur|icicles|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7611" PostTypeId="2" ParentId="7610" CreationDate="2015-01-21T16:54:28.817" Score="6" Body="&lt;h1&gt;Using &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-swoop&lt;/code&gt;&lt;/a&gt;&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;Solution&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;helm-swoop&lt;/code&gt; to find occurrences of words &lt;code&gt;WORD1&lt;/code&gt; and &lt;code&gt;WORD2&lt;/code&gt; in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x helm-swoop RET WORD1\|WORD2 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Old answer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;helm-swoop&lt;/code&gt; to find occurrences of pairs of words &lt;code&gt;WORD1&lt;/code&gt; and &lt;code&gt;WORD2&lt;/code&gt; in the buffer, &lt;strong&gt;in the same line&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x helm-swoop RET WORD1 WORD2 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KcAux.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-21T20:51:31.930" LastActivityDate="2015-01-21T20:51:31.930" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7612" PostTypeId="1" CreationDate="2015-01-21T17:32:50.887" Score="5" ViewCount="663" Body="&lt;p&gt;Suppose I have a file containing the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ATOM     10  H5  LIG     1      -0.684   2.034   0.000  1.00  0.00&#xA;ATOM     11  C1  LIG     1       0.974   0.686   0.000  1.00  0.00&#xA;ATOM     12  H1  LIG     1       1.734   1.451   0.000  1.00  0.00&#xA;ATOM     13  C2  LIG     1       0.977  -0.683   0.000  1.00  0.00&#xA;ATOM     14  H2  LIG     1       1.743  -1.443   0.001  1.00  0.00&#xA;ATOM     15  N1  LIG     1      -0.347  -1.074   0.000  1.00  0.00&#xA;ATOM     16  H3  LIG     1      -0.675  -2.037   0.000  1.00  0.00&#xA;ATOM     17  C3  LIG     1      -1.145  -0.003   0.000  1.00  0.00&#xA;ATOM     18  H4  LIG     1      -2.226  -0.005   0.000  1.00  0.00&#xA;ATOM     19  N2  LIG     1      -0.352   1.073   0.000  1.00  0.00&#xA;ATOM     20  H5  LIG     1      -0.684   2.034   0.000  1.00  0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I add a constant decimal value to the sixth column, say &lt;code&gt;5.487&lt;/code&gt;, replacing the existing values?&#xA;I am aware of rectangle select and &lt;code&gt;calc&lt;/code&gt;, but neither seem to provide the ability to cleanly perform this operation in place on a column.&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2015-01-21T17:43:27.723" LastActivityDate="2015-01-22T00:26:40.020" Title="Add a constant decimal value to a column of numbers" Tags="|text-editing|rectangle|calc|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7613" PostTypeId="2" ParentId="7610" CreationDate="2015-01-21T17:34:59.807" Score="2" Body="&lt;p&gt;If the question is not limited to Helm, you can do this in &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; using command &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-occur&lt;/code&gt; (bound to &lt;strong&gt;&lt;code&gt;C-c '&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;) in either of these ways, depending on what you want:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Type the regexp &lt;code&gt;Hello.*Bye&lt;/code&gt;, if you want to look for &lt;code&gt;Hello&lt;/code&gt; followed by &lt;code&gt;Bye&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Type &lt;code&gt;Hello&lt;/code&gt; then &lt;code&gt;S-SPC&lt;/code&gt; then &lt;code&gt;Bye&lt;/code&gt;, if you want to look for both words in either order.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c '&lt;/code&gt; uses lines as search contexts. Whatever you type as the dynamic text to look for in lines is matched. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two examples above assume that you want to match both &lt;code&gt;Hello&lt;/code&gt; and &lt;code&gt;Bye&lt;/code&gt; in the same line. If you want to match &lt;em&gt;either&lt;/em&gt; instead of both within a line, then use a pattern that matches either: &lt;code&gt;Hello\|Bye&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-01-21T19:03:08.323" LastActivityDate="2015-01-21T19:03:08.323" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7614" PostTypeId="5" CreationDate="2015-01-21T17:49:16.390" Score="0" Body="&lt;p&gt;Icicles is a library that enhances completion, in particular minibuffer completion.&#xA;A full description is at &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/Icicles&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One user's summary: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Icicles is to &lt;code&gt;TAB&lt;/code&gt; completion what &lt;code&gt;TAB&lt;/code&gt; completion is to typing things manually every time&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Use this tag to ask Icicles questions about&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;installation and configuration&lt;/li&gt;&#xA;&lt;li&gt;customizing behavior&lt;/li&gt;&#xA;&lt;li&gt;debugging problems &lt;/li&gt;&#xA;&lt;li&gt;extending features &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="105" LastEditDate="2015-01-21T17:55:17.233" LastActivityDate="2015-01-21T17:55:17.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7615" PostTypeId="4" CreationDate="2015-01-21T17:49:16.390" Score="0" Body="Icicles is a package providing many forms of enhanced completion, including sophisticated pattern matching." OwnerUserId="2710" LastEditorUserId="105" LastEditDate="2015-01-21T17:56:20.187" LastActivityDate="2015-01-21T17:56:20.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7616" PostTypeId="2" ParentId="7610" CreationDate="2015-01-21T18:42:51.267" Score="1" Body="&lt;h1&gt;Using Occur&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;Solution&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Use &lt;strong&gt;Occur&lt;/strong&gt; to find occurrences of words &lt;code&gt;WORD1&lt;/code&gt; and &lt;code&gt;WORD2&lt;/code&gt; in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x occur RET WORD1\|WORD2 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;a href=&quot;http://www.masteringemacs.org/article/searching-buffers-occur-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;use &lt;code&gt;M-g M-n&lt;/code&gt; and &lt;code&gt;M-g M-p&lt;/code&gt; to navigate the results from the buffer containing text&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Old answer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Use &lt;strong&gt;Occur&lt;/strong&gt; to find occurrences of &lt;strong&gt;pairs of words&lt;/strong&gt; &lt;code&gt;WORD1&lt;/code&gt; and &lt;code&gt;WORD2&lt;/code&gt; in the buffer, which could be across multiple lines.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x occur RET WORD1[[:ascii:][:nonascii:]]*?WORD2 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/f7ugr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: Word highlighting is done using &lt;a href=&quot;https://github.com/boyw165/hl-anything&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;hl-anything&lt;/code&gt;&lt;/a&gt; package, available through Melpa.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-21T20:53:26.803" LastActivityDate="2015-01-21T20:53:26.803" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7617" PostTypeId="1" AcceptedAnswerId="7625" CreationDate="2015-01-21T18:47:59.473" Score="10" ViewCount="4494" Body="&lt;p&gt;I want to execute simple commands in &lt;code&gt;eshell&lt;/code&gt; without explicitly typing them into the prompt, using something like &lt;code&gt;with-current-buffer&lt;/code&gt; How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2015-01-22T05:14:20.090" LastActivityDate="2020-11-02T23:26:40.610" Title="How to programmatically execute a command in eshell?" Tags="|elisp|eshell|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7618" PostTypeId="2" ParentId="7443" CreationDate="2015-01-21T18:56:22.800" Score="2" Body="&lt;p&gt;When reading a export command org enters a modal state, where it&#xA;basically takes over Emacs reading of input. It does this by&#xA;continuesly reading an event and branching into it's corresponding&#xA;sub-menu until a full export-command is determined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function it uses for this purpose is &lt;code&gt;read-char-exclusive&lt;/code&gt;, which,&#xA;as the name suggests, only reads characters and ignores any other&#xA;events (like e.g. mouse events).  These events are simply dropped,&#xA;though they are still echoed in the mini-buffer (for some reason).&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-01-21T18:56:22.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7619" PostTypeId="2" ParentId="7612" CreationDate="2015-01-21T19:05:21.487" Score="3" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;multiple cursors&lt;/code&gt;&lt;/a&gt; to get this done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before you get started with the below steps, add this to your &lt;code&gt;init.el&lt;/code&gt;, evaluate it and bind it to a key binding of your linking.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; http://stackoverflow.com/questions/3035337/in-emacs-can-you-evaluate-an-emacs-lisp-expression-and-replace-it-with-the-resul&#xA;(defun eval-and-replace-last-math-sexp ()&#xA;  &quot;Replace an emacs lisp expression (s-expression aka sexp) with its result&quot;&#xA;  (interactive)&#xA;  (let ((value (eval (preceding-sexp))))&#xA;    (kill-sexp -1)&#xA;    (insert (format &quot;%.3f&quot; value)))) ; Change this resolution as you need&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's bind it to &lt;code&gt;C-M-=&lt;/code&gt; for this explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; Get the cursor to column that you want to modify first.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ATOM     10  H5  LIG     1     ▮-0.684   2.034   0.000  1.00  0.00&#xA;ATOM     11  C1  LIG     1       0.974   0.686   0.000  1.00  0.00&#xA;ATOM     12  H1  LIG     1       1.734   1.451   0.000  1.00  0.00&#xA;ATOM     13  C2  LIG     1       0.977  -0.683   0.000  1.00  0.00&#xA;ATOM     14  H2  LIG     1       1.743  -1.443   0.001  1.00  0.00&#xA;ATOM     15  N1  LIG     1      -0.347  -1.074   0.000  1.00  0.00&#xA;ATOM     16  H3  LIG     1      -0.675  -2.037   0.000  1.00  0.00&#xA;ATOM     17  C3  LIG     1      -1.145  -0.003   0.000  1.00  0.00&#xA;ATOM     18  H4  LIG     1      -2.226  -0.005   0.000  1.00  0.00&#xA;ATOM     19  N2  LIG     1      -0.352   1.073   0.000  1.00  0.00&#xA;ATOM     20  H5  LIG     1      -0.684   2.034   0.000  1.00  0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt; Create multiple cursors - Press &lt;code&gt;C-&amp;gt;&lt;/code&gt; as many times required&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ATOM     10  H5  LIG     1     ▮-0.684   2.034   0.000  1.00  0.00&#xA;ATOM     11  C1  LIG     1     ▯ 0.974   0.686   0.000  1.00  0.00&#xA;ATOM     12  H1  LIG     1     ▯ 1.734   1.451   0.000  1.00  0.00&#xA;ATOM     13  C2  LIG     1     ▯ 0.977  -0.683   0.000  1.00  0.00&#xA;ATOM     14  H2  LIG     1     ▯ 1.743  -1.443   0.001  1.00  0.00&#xA;ATOM     15  N1  LIG     1     ▯-0.347  -1.074   0.000  1.00  0.00&#xA;ATOM     16  H3  LIG     1     ▯-0.675  -2.037   0.000  1.00  0.00&#xA;ATOM     17  C3  LIG     1     ▯-1.145  -0.003   0.000  1.00  0.00&#xA;ATOM     18  H4  LIG     1     ▯-2.226  -0.005   0.000  1.00  0.00&#xA;ATOM     19  N2  LIG     1     ▯-0.352   1.073   0.000  1.00  0.00&#xA;ATOM     20  H5  LIG     1     ▯-0.684   2.034   0.000  1.00  0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt; Type the math equation in elisp: &lt;code&gt;(+ 5.487 M-f)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ATOM     10  H5  LIG     1     (+ 5.487 -0.684)▮   2.034   0.000  1.00  0.00&#xA;ATOM     11  C1  LIG     1     (+ 5.487  0.974)▯   0.686   0.000  1.00  0.00&#xA;ATOM     12  H1  LIG     1     (+ 5.487  1.734)▯   1.451   0.000  1.00  0.00&#xA;ATOM     13  C2  LIG     1     (+ 5.487  0.977)▯  -0.683   0.000  1.00  0.00&#xA;ATOM     14  H2  LIG     1     (+ 5.487  1.743)▯  -1.443   0.001  1.00  0.00&#xA;ATOM     15  N1  LIG     1     (+ 5.487 -0.347)▯  -1.074   0.000  1.00  0.00&#xA;ATOM     16  H3  LIG     1     (+ 5.487 -0.675)▯  -2.037   0.000  1.00  0.00&#xA;ATOM     17  C3  LIG     1     (+ 5.487 -1.145)▯  -0.003   0.000  1.00  0.00&#xA;ATOM     18  H4  LIG     1     (+ 5.487 -2.226)▯  -0.005   0.000  1.00  0.00&#xA;ATOM     19  N2  LIG     1     (+ 5.487 -0.352)▯   1.073   0.000  1.00  0.00&#xA;ATOM     20  H5  LIG     1     (+ 5.487 -0.684)▯   2.034   0.000  1.00  0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt; Do &lt;code&gt;C-M-=&lt;/code&gt; and hit &lt;code&gt;RET&lt;/code&gt; to exit the multiple cursors mode. &lt;em&gt;Voila!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ATOM     10  H5  LIG     1     4.803▮   2.034   0.000  1.00  0.00&#xA;ATOM     11  C1  LIG     1     6.461    0.686   0.000  1.00  0.00&#xA;ATOM     12  H1  LIG     1     7.221    1.451   0.000  1.00  0.00&#xA;ATOM     13  C2  LIG     1     6.464   -0.683   0.000  1.00  0.00&#xA;ATOM     14  H2  LIG     1     7.230   -1.443   0.001  1.00  0.00&#xA;ATOM     15  N1  LIG     1     5.140   -1.074   0.000  1.00  0.00&#xA;ATOM     16  H3  LIG     1     4.812   -2.037   0.000  1.00  0.00&#xA;ATOM     17  C3  LIG     1     4.342   -0.003   0.000  1.00  0.00&#xA;ATOM     18  H4  LIG     1     3.261   -0.005   0.000  1.00  0.00&#xA;ATOM     19  N2  LIG     1     5.135    1.073   0.000  1.00  0.00&#xA;ATOM     20  H5  LIG     1     4.803    2.034   0.000  1.00  0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-21T19:05:21.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7621" PostTypeId="2" ParentId="7612" CreationDate="2015-01-21T19:15:12.227" Score="0" Body="&lt;p&gt;You can use the &lt;a href=&quot;https://github.com/chrisdone/number&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;number&lt;/code&gt;&lt;/a&gt; package, also available from Melpa.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bring the cursor to that number in row 1, col 6: &lt;code&gt;-0.684▮&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Record macro and run it as many times as possible - &lt;code&gt;F3 M-x number/add RET 5.487 RET C-n M-0 F4&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Voila!&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-21T19:23:37.083" LastActivityDate="2015-01-21T19:23:37.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7622" PostTypeId="2" ParentId="7612" CreationDate="2015-01-21T19:18:13.050" Score="4" Body="&lt;h1&gt;Using Org-mode&lt;/h1&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select the text of the table.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c |&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Add at the bottom: &lt;code&gt;#+TBLFM: $6=$6+5.487&lt;/code&gt; and press &lt;kbd&gt;C-c C-c&lt;/kbd&gt; while the point is either on the formula or on the table.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;This gives:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;| ATOM | 10 | H5 | LIG | 1 | 4.803 |  2.034 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 11 | C1 | LIG | 1 | 6.461 |  0.686 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 12 | H1 | LIG | 1 | 7.221 |  1.451 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 13 | C2 | LIG | 1 | 6.464 | -0.683 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 14 | H2 | LIG | 1 |  7.23 | -1.443 | 0.001 | 1.00 | 0.00 |&#xA;| ATOM | 15 | N1 | LIG | 1 |  5.14 | -1.074 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 16 | H3 | LIG | 1 | 4.812 | -2.037 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 17 | C3 | LIG | 1 | 4.342 | -0.003 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 18 | H4 | LIG | 1 | 3.261 | -0.005 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 19 | N2 | LIG | 1 | 5.135 |  1.073 | 0.000 | 1.00 | 0.00 |&#xA;| ATOM | 20 | H5 | LIG | 1 | 4.803 |  2.034 | 0.000 | 1.00 | 0.00 |&#xA;#+TBLFM: $6=$6+5.487&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you don't like the &lt;code&gt;|&lt;/code&gt; / don't want to use Org-mode, just copy the result elsewhere and &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;replace-string&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;|&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt; &lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;Way to do this with Calc&lt;/h1&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select the column you want.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x * r&lt;/kbd&gt; inserts the column into Calc.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v t&lt;/kbd&gt; transposes the vector.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v u&lt;/kbd&gt; unpacks (because it was copied as a matrix with a single column).&lt;/li&gt;&#xA;&lt;li&gt;5.487&lt;kbd&gt;+&lt;/kbd&gt; adds 5.487.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v u&lt;/kbd&gt; unpack again.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x r r&lt;/kbd&gt;&lt;code&gt;1&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; copies unpacked numbers to register &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Place the point in front of the original column and &lt;kbd&gt;C-x r i&lt;/kbd&gt;&lt;code&gt;1&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; this will insert the results you copied from Calc buffer. Then, select the original column and &lt;kbd&gt;C-x r k&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;But I agree this would be a bit too cumbersome (I actually had to look up how to insert registers since I don't usually do it).  Sharing this just for the sake of diversity.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-21T22:14:45.123" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7623" PostTypeId="2" ParentId="7610" CreationDate="2015-01-21T20:11:12.547" Score="2" Body="&lt;p&gt;Thanks to @Drew answer, I could manage to make &lt;code&gt;helm-swoop&lt;/code&gt; filter at the same time the occurrences of two words (say 'Hello' and 'Bye'): &lt;code&gt;M-x helm-swoop RET Hello\|Bye&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5267" LastActivityDate="2015-01-21T20:11:12.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7625" PostTypeId="2" ParentId="7617" CreationDate="2015-01-21T21:03:32.040" Score="16" Body="&lt;p&gt;My initial hunch was looking for an official command that does this already, so I've found &lt;code&gt;eshell-command&lt;/code&gt;.  However that outputs to a separate buffer, so it's not an option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example with &lt;code&gt;ls&lt;/code&gt; and an &lt;code&gt;*eshell*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;*eshell*&quot;&#xA;  (eshell-return-to-prompt)&#xA;  (insert &quot;ls&quot;)&#xA;  (eshell-send-input))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-01-21T21:03:32.040" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7626" PostTypeId="2" ParentId="7612" CreationDate="2015-01-21T23:07:05.557" Score="3" Body="&lt;p&gt;You can always use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;query-replace-regexp&lt;/code&gt;, if you're comfortable with regexps and elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^\(\(?:[^ ]+ +\)\{5\}\)\([ -][0-9.]+\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\1\,(format &quot;% .3f&quot; (+ 5.487 \#2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will replace the second captured group (being the 6th column) with the formatted result of the calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will break the alignment slightly if the numbers get too large, but you could tweak the pattern and formatting as necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also use rectangle editing to copy the column in order to edit it on its own (thus simplifying the regexp by avoiding the need to match any other columns), and then replace the original rectangle with the modified one. That way the search pattern would simply be &lt;code&gt;.+&lt;/code&gt; (and in the replacement you would omit the &lt;code&gt;\1&lt;/code&gt; prefix, and use &lt;code&gt;\#&amp;amp;&lt;/code&gt; instead of &lt;code&gt;\#2&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-01-22T00:26:40.020" LastActivityDate="2015-01-22T00:26:40.020" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7627" PostTypeId="2" ParentId="7545" CreationDate="2015-01-22T00:14:56.693" Score="4" Body="&lt;p&gt;Annoyingly, the problem was here: &lt;code&gt;(url-request-method &quot;post&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing that to &lt;code&gt;(url-request-method &quot;POST&quot;)&lt;/code&gt; fixes everything.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-22T00:14:56.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7629" PostTypeId="1" CreationDate="2015-01-22T09:37:15.607" Score="11" ViewCount="7139" Body="&lt;p&gt;When I insert C code block inside an org-mode file, the syntax highlight and indentation of the source code are customized as I wanted. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When I export it into a html file, the syntax highlight in the html file is exactly the same as in Emacs. But the syntax highlight works better with the color-theme of my Emacs. For instance, the &lt;code&gt;{&lt;/code&gt; symbol is white in my C code block, but my color-theme is dark, if I export it into html, the background of the html file is white too, it means, you cannot see &lt;code&gt;{&lt;/code&gt; in the source code block of exported html even thought it is there. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The indentation of the source code is normal in my Emacs (as I customized it), but the indentation of the source code in exported html file will be different, it adds &lt;strong&gt;more spaces&lt;/strong&gt; for indentation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I export the same org file in &lt;code&gt;emacs -q&lt;/code&gt;, they are normal in the exported html file, but the syntax highlight and indentation of the source code will be the &lt;code&gt;default&lt;/code&gt; configuration of Emacs. So it means font-faces configurations in &lt;code&gt;init.el&lt;/code&gt; will affect &lt;code&gt;org-export&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So my question is: when I export an org-mode file which contains source code block into html file (or maybe other formats such as PDF as well), is it possible to get rid of all my own configuration of font-faces about the source code and do it as in &lt;code&gt;emacs -q&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second problem is solved by setting &lt;code&gt;(setq org-src-preserve-indentation t)&lt;/code&gt; either in init file or by running it through &lt;code&gt;M-:&lt;/code&gt; (&lt;code&gt;eval-expression&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update2&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first problem is solved by &lt;a href=&quot;https://emacs.stackexchange.com/questions/3374/set-the-background-of-org-exported-code-blocks-according-to-theme&quot;&gt;Set the background of org-exported &amp;lt;code&amp;gt; blocks according to theme&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third problem is not important if 1st and 2nd problems are solved.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="11" LastEditDate="2017-12-19T17:38:15.217" LastActivityDate="2017-12-19T17:38:15.217" Title="The syntax highlight and indentation of source code block in exported html file for org-mode" Tags="|org-mode|org-export|syntax-highlighting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7630" PostTypeId="1" AcceptedAnswerId="7637" CreationDate="2015-01-22T10:53:25.760" Score="2" ViewCount="397" Body="&lt;p&gt;I have managed to setup Tramp to connect to a remote Solaris machine from a Windows machine using plink, which is very nice. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq tramp-default-user &quot;Beginner&quot;&#xA;       tramp-default-host &quot;the_host&quot;&#xA;       tramp-default-method &quot;plink&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now I have a host of new problems, which I would assume to be related to the file encoding from the tramp upload:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I have edited the .profile and now I get strange error messages like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$&amp;gt;. .profile&#xA;bash: $'\r': command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I configure tramp to format files in a Solaris-friendly way?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: Having unix-encoding the default solves the issue for me&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (prefer-coding-system 'utf-8-unix)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-01-22T16:54:46.317" LastActivityDate="2015-01-22T16:54:46.317" Title="Tramp file encoding for Unix" Tags="|tramp|newlines|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7631" PostTypeId="1" CreationDate="2015-01-22T12:41:35.810" Score="7" ViewCount="1333" Body="&lt;p&gt;I have two projects opened in my Emacs. Both are git repos and have &lt;code&gt;.projectile&lt;/code&gt; files in their directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relevant lines in my init.el  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(projectile-global-mode 1)&#xA;(helm-mode)&#xA;(setq projectile-completion-system 'helm)&#xA;(helm-projectile-on)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Problem:&lt;br&gt;&#xA;&lt;code&gt;projectile-switch-project&lt;/code&gt; (&lt;code&gt;C-c p p&lt;/code&gt;) only shows a list containing the project related to current buffer. If I switch buffer to a file from the second project, the list contains just the second project. If I switch to a buffer not related to any project the list is empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I disable Helm, then running &lt;code&gt;C-c p p&lt;/code&gt; results in &quot;There are no known projects&quot; info in the minibuffer. Which is strange, because I see &lt;code&gt;Projectile[projectdirname]&lt;/code&gt; in the modeline and for example &lt;code&gt;C-c p f&lt;/code&gt; runs &lt;code&gt;projectile-find-project-file&lt;/code&gt; as expected and lists the files from the current project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;code&gt;projectile-invalidate-cache&lt;/code&gt; and &lt;code&gt;projectile-cleanup-known-projects&lt;/code&gt; without success. Is there a trick (or an obvious step I have overlooked) to make projectile aware of opened projects?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;platform: Windows7, Emacs version: GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) and GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601), Projectile 20150108.957 from Elpa.&lt;/p&gt;&#xA;" OwnerUserId="426" LastEditorUserId="426" LastEditDate="2015-01-22T12:57:52.357" LastActivityDate="2015-01-22T12:57:52.357" Title="Projectile only sees project related to current buffer, if the buffer belongs to a project" Tags="|helm|projectile|project|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7632" PostTypeId="2" ParentId="7541" CreationDate="2015-01-22T12:41:55.970" Score="0" Body="&lt;p&gt;I'm putting headlines with different priorities anywhere in a file, I'm not concerned about the order. Later I'm viewing them sorted with &lt;a href=&quot;http://orgmode.org/manual/Agenda-Views.html#Agenda-Views&quot; rel=&quot;nofollow&quot;&gt;agenda views&lt;/a&gt;. By using &lt;a href=&quot;http://orgmode.org/manual/Tags.html&quot; rel=&quot;nofollow&quot;&gt;tags&lt;/a&gt;, sorted headlines from concrete categories are viewed with &lt;a href=&quot;http://orgmode.org/manual/Custom-agenda-views.html#Custom-agenda-views&quot; rel=&quot;nofollow&quot;&gt;custom agenda views&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that's not the answer for &lt;strong&gt;how to sort headlines in a file&lt;/strong&gt;, but viewing headlines with agenda views is always a best way. You can insert prioritized headlines quickly, without worrying about the order.&lt;/p&gt;&#xA;" OwnerDisplayName="user3984" LastActivityDate="2015-01-22T12:41:55.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7633" PostTypeId="2" ParentId="7629" CreationDate="2015-01-22T14:21:54.450" Score="11" Body="&lt;p&gt;The solution for this spans elisp, org-mode and css customization.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;elisp&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;By default, the fontification information is embedded in the exported html file. We need to disable that and tell org-mode that we are planning to specify the font formatting information using an external css file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have chosen to prefix the html class names with &lt;code&gt;org-&lt;/code&gt; string.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; (setq org-html-htmlize-output-type 'inline-css) ;; default&#xA;(setq org-html-htmlize-output-type 'css)&#xA;;; (setq org-html-htmlize-font-prefix &quot;&quot;) ;; default&#xA;(setq org-html-htmlize-font-prefix &quot;org-&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;org-mode&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In the org-file, you then specify which css file to use. This file will contain information on how you want to format each &lt;code&gt;org-&lt;/code&gt; class.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;# My custom fontification theme&#xA;#+HTML_HEAD: &amp;lt;link href=&quot;path/to/your/custom/theme.css&quot; rel=&quot;stylesheet&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;css&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is my custom theme css file in which I have copied the color codes from the &lt;a href=&quot;https://github.com/fniessen/emacs-leuven-theme&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;leuven-theme&lt;/code&gt;&lt;/a&gt;. You can find &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/master/misc/css/leuven_theme.css&quot; rel=&quot;noreferrer&quot;&gt;the latest version of the below css from my git&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-css prettyprint-override&quot;&gt;&lt;code&gt;/* Set the colors in &amp;lt;pre&amp;gt; blocks from the Leuven theme */&#xA;pre                                      {background-color:#FFFFFF;}&#xA;pre span.org-builtin                     {color:#006FE0;font-weight:bold;}&#xA;pre span.org-string                      {color:#008000;}&#xA;pre span.org-keyword                     {color:#0000FF;}&#xA;pre span.org-variable-name               {color:#BA36A5;}&#xA;pre span.org-function-name               {color:#006699;}&#xA;pre span.org-type                        {color:#6434A3;}&#xA;pre span.org-preprocessor                {color:#808080;font-weight:bold;}&#xA;pre span.org-constant                    {color:#D0372D;}&#xA;pre span.org-comment-delimiter           {color:#8D8D84;}&#xA;pre span.org-comment                     {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-1            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-2            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-3            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-4            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-5            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-6            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-7            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-8            {color:#8D8D84;font-style:italic}&#xA;pre span.org-outshine-level-9            {color:#8D8D84;font-style:italic}&#xA;pre span.org-rainbow-delimiters-depth-1  {color:#707183;}&#xA;pre span.org-rainbow-delimiters-depth-2  {color:#7388d6;}&#xA;pre span.org-rainbow-delimiters-depth-3  {color:#909183;}&#xA;pre span.org-rainbow-delimiters-depth-4  {color:#709870;}&#xA;pre span.org-rainbow-delimiters-depth-5  {color:#907373;}&#xA;pre span.org-rainbow-delimiters-depth-6  {color:#6276ba;}&#xA;pre span.org-rainbow-delimiters-depth-7  {color:#858580;}&#xA;pre span.org-rainbow-delimiters-depth-8  {color:#80a880;}&#xA;pre span.org-rainbow-delimiters-depth-9  {color:#887070;}&#xA;pre span.org-sh-quoted-exec              {color:#FF1493;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-17T13:37:33.930" LastActivityDate="2015-07-17T13:37:33.930" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7634" PostTypeId="2" ParentId="7502" CreationDate="2015-01-22T14:53:05.647" Score="2" Body="&lt;p&gt;The function you are looking for is &lt;code&gt;TeX-current-macro&lt;/code&gt;.  Here is an example of how you can use it to print a message depending on whether point is inside or outside a TeX macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mg-TeX-current-macro-p ()&#xA;  (interactive)&#xA;  (if (TeX-current-macro)&#xA;      (message &quot;Inside a LaTeX macro&quot;)&#xA;    (message &quot;Outside a LaTeX macro&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-01-22T14:53:05.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7635" PostTypeId="1" AcceptedAnswerId="7639" CreationDate="2015-01-22T16:16:10.127" Score="1" ViewCount="123" Body="&lt;p&gt;I am trying to update &lt;a href=&quot;https://github.com/magnars/annoying-arrows-mode.el&quot; rel=&quot;nofollow&quot;&gt;annoying-arrows&lt;/a&gt; to work with evil-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annoying arrows is this minor-mode that complains when you use the same simple movement-command too many times in a row. (I have also updated it to open a buffer when it is triggered to make it super annoying.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/endrebak/0e31a2c23fb5aac40e8f&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is my attempt at getting &lt;code&gt;annoying-arrows&lt;/code&gt; to work with evil-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One problem I have is that when the advice is triggered for the functions &lt;code&gt;evil-forward-char&lt;/code&gt; and &lt;code&gt;evil-previous-char&lt;/code&gt;, the message is written twice in the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead of this: &#xA;&lt;code&gt;Annoying! How about using left-word (&amp;lt;C-left&amp;gt;) instead of this-command: evil-backward-char??&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Annoying! How about using left-word (&amp;lt;C-left&amp;gt;) instead of this-command: evil-backward-chaAnnoying! How about using left-word (&amp;lt;C-left&amp;gt;) instead of this-command: evil-backward-char?r?&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anybody have a clue why that might happen and if there is a workaround? Any debugging tips would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is probably nothing wrong with &lt;a href=&quot;https://gist.github.com/endrebak/0e31a2c23fb5aac40e8f&quot; rel=&quot;nofollow&quot;&gt;my code&lt;/a&gt; as it works for the regular emacs functions &lt;code&gt;next-line&lt;/code&gt; and &lt;code&gt;previous-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps. This issue might be related, but is above my current level of emacs understanding:&#xA;&lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/165/problem-with-defining-advice-for-evil&quot; rel=&quot;nofollow&quot;&gt;Problem with defining advice for evil-delete&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2015-01-22T17:12:00.727" Title="Advising evil-forward-char seems to trigger advice twice" Tags="|elisp|evil|advice|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7636" PostTypeId="2" ParentId="7544" CreationDate="2015-01-22T16:29:12.447" Score="0" Body="&lt;p&gt;I added the following to my &lt;code&gt;main.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; disable vc-git&#xA;(setq vc-handled-backends ())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works for me since I use &lt;code&gt;magit&lt;/code&gt; instead of &lt;code&gt;vc-git&lt;/code&gt;, but I admit that it's a bit of a nuclear option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the problem was due to a bug in snapshot, since the problem disappeared when I installed a stable Emacs 24.4.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2015-02-23T00:15:58.643" LastActivityDate="2015-02-23T00:15:58.643" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7637" PostTypeId="2" ParentId="7630" CreationDate="2015-01-22T16:37:25.797" Score="3" Body="&lt;p&gt;Usually, Tramp shall respect encoding of existing files. For new files, you could set the encoding via &lt;code&gt;C-x RET f utf-8-unix RET&lt;/code&gt;. You can choose also another coding system, the important point is to append the &lt;code&gt;-unix&lt;/code&gt;suffix. Read also the Emacs manual about coding systems.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-01-22T16:37:25.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7638" PostTypeId="1" AcceptedAnswerId="7665" CreationDate="2015-01-22T16:46:13.483" Score="1" ViewCount="199" Body="&lt;p&gt;I was looking through the code and found &lt;code&gt;wg-current-workgroup-p&lt;/code&gt; (&quot;Return &lt;code&gt;t&lt;/code&gt; when &lt;code&gt;WORKGROUP&lt;/code&gt; is the current workgroup, &lt;code&gt;nil&lt;/code&gt; otherwise.&quot;) which seemed to be what I want, but if the current workgroup is called &quot;main&quot; and I do&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(wg-current-workgroup-p &quot;main&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get &lt;code&gt;nil&lt;/code&gt;. I'm not sure if I'm doing something wrong or misunderstanding the function. I couldn't find a way to get the current workgroup name either. I'd also like to be able to do this with the workgroup index as well.&lt;/p&gt;&#xA;" OwnerUserId="5278" LastEditorUserId="504" LastEditDate="2015-01-22T21:22:10.830" LastActivityDate="2015-01-23T14:36:59.303" Title="How to Detect Current Workgroup in Workgroups2?" Tags="|elisp|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7639" PostTypeId="2" ParentId="7635" CreationDate="2015-01-22T17:12:00.727" Score="1" Body="&lt;p&gt;For efficiency reason, &lt;code&gt;evil-forward-char&lt;/code&gt; is called again after narrowing the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not an ideal answer but I suggest to modify the logic to advice stock &lt;code&gt;forward-char&lt;/code&gt; and check with &lt;code&gt;this-command-keys&lt;/code&gt; if the user pressed the expected keys (in this case &lt;code&gt;l&lt;/code&gt; key). This way your advice is agnostic of the layer on top of the raw emacs commands.&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-01-22T17:12:00.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7640" PostTypeId="1" AcceptedAnswerId="7641" CreationDate="2015-01-22T18:02:21.710" Score="1" ViewCount="197" Body="&lt;p&gt;&lt;code&gt;semantic&lt;/code&gt; allows specification of C-preprocessor keywords using the variable &lt;code&gt;semantic-lex-c-preprocessor-symbol-file&lt;/code&gt;, which is a list of C/C++ files that contain preprocessor macros. How do I get &lt;code&gt;semantic&lt;/code&gt; to reload these files after changing one of them?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-01-22T18:04:59.183" Title="Semantic does not reload c-preprocessor symbols from file" Tags="|semantic-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7641" PostTypeId="2" ParentId="7640" CreationDate="2015-01-22T18:04:59.183" Score="1" Body="&lt;p&gt;&lt;code&gt;semantic&lt;/code&gt; uses the variable &lt;code&gt;semantic-lex-c-preprocessor-symbol-map&lt;/code&gt; to store the C preprocessor keywords used by its C lexer. The function &lt;code&gt;semantic-c-reset-preprocessor-symbol-map&lt;/code&gt; reconstructs this table using all the various input methods. So, on changing a file listed in &lt;code&gt;semantic-lex-c-preprocessor-symbol-file&lt;/code&gt;, run &lt;code&gt;(semantic-c-reset-preprocessor-symbol-map)&lt;/code&gt; to load these changes into &lt;code&gt;semantic&lt;/code&gt;s environment.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-01-22T18:04:59.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7642" PostTypeId="1" AcceptedAnswerId="7656" CreationDate="2015-01-22T19:18:19.857" Score="0" ViewCount="97" Body="&lt;p&gt;I'd like to use ERT with Emacs23. ERT is bundled with Emacs24. Latest version of ERT does not work with Emacs23 because of lack of &lt;code&gt;define-error&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an offical way of using ERT with Emacs23?&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="5213" LastEditDate="2015-01-22T19:29:22.580" LastActivityDate="2015-01-23T09:47:20.767" Title="ERT with Emacs23" Tags="|ert|emacs23|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7643" PostTypeId="1" AcceptedAnswerId="7670" CreationDate="2015-01-22T20:32:08.320" Score="8" ViewCount="712" Body="&lt;p&gt;Here is a minimum working example to demonstrate the problem, you will need to have the &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; package installed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ido&#xA;  :config&#xA;  (progn&#xA;    (defun dummy/function ()&#xA;      (interactive)&#xA;      (message &quot;I am in the dummy function.&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to add edebug instrumentation to the &lt;code&gt;dummy/function&lt;/code&gt; using &lt;code&gt;M-x edebug-defun&lt;/code&gt;, it starts the edebug rightaway as if I already did &lt;code&gt;M-x dummy/function&lt;/code&gt;. I have to quit that by hitting &lt;code&gt;q&lt;/code&gt;. But then when I actually do &lt;code&gt;M-x dummy/function&lt;/code&gt;, I don't see the edebug activating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something about the &lt;code&gt;use-package&lt;/code&gt; wrapper that messes with the edebug instrumentation? How can it be fixed?&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-03-17T13:23:33.463" Title="How do I edebug a function defined in a use-package block?" Tags="|use-package|edebug|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7644" PostTypeId="2" ParentId="7642" CreationDate="2015-01-22T21:33:17.080" Score="1" Body="&lt;p&gt;You can obtain legacy ERT versions for use with Emacs 23 from the &lt;a href=&quot;https://github.com/ohler/ert&quot; rel=&quot;nofollow&quot;&gt;old repository of ERT&lt;/a&gt;, at commit &lt;a href=&quot;https://github.com/ohler/ert/commit/fb3c278d3c8ddc6a558779d2c5262acc7cea4204&quot; rel=&quot;nofollow&quot;&gt;fb3c278d&lt;/a&gt;.  Note that this version significantly differs from recent ERT versions.  Notably, it lacks test skipping, and many bug fixes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would not copy ERT from Emacs 24, though.  In recent Emacs releases, ERT uses &lt;code&gt;lexical-binding: t&lt;/code&gt;, so the code may easily depend on lexical binding to work correctly, which is simply not available on Emacs 23.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And generally, I'd not write new test suites for Emacs 23 anymore.  It's just not worth the effort, imho.  The last release of Emacs 23 was three years ago, and we are—albeit slowly—heading towards Emacs 25.  &lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-01-22T21:33:17.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7646" PostTypeId="2" ParentId="7585" CreationDate="2015-01-22T21:43:22.777" Score="8" Body="&lt;p&gt;It's worth learning how to use regular expressions to do things like this. Use &lt;code&gt;M-x replace-regexp&lt;/code&gt; and replace &lt;code&gt;&quot; +&quot;&lt;/code&gt; with &lt;code&gt;&quot; &quot;&lt;/code&gt; (without the quotes). &lt;code&gt;&quot; +&quot;&lt;/code&gt; means &quot;one or more space&quot;. You are telling emacs to replace all instances of one or more space with a single space. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you do end up learning to use regular expressions, I recommend using &lt;a href=&quot;https://github.com/joddie/pcre2el&quot;&gt;https://github.com/joddie/pcre2el&lt;/a&gt; with &lt;code&gt;pcre-mode&lt;/code&gt;, which will let you use so-called PCRE (Perl Compatible Regular Expressions), for which there are a lot more resources online, and which are much easier to use interactively. &lt;/p&gt;&#xA;" OwnerUserId="118" LastActivityDate="2015-01-22T21:43:22.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7647" PostTypeId="2" ParentId="7643" CreationDate="2015-01-22T22:40:19.537" Score="9" Body="&lt;p&gt;When you call &lt;code&gt;edebug-defun&lt;/code&gt; it debugs the top-level form, which in this case is &lt;code&gt;(use-package ...)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;debug-on-entry&lt;/code&gt; to debug a named function. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-01-22T22:40:19.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7648" PostTypeId="1" CreationDate="2015-01-23T00:28:57.983" Score="3" ViewCount="563" Body="&lt;p&gt;I am loving my elpy setup in emacs, but I have one question.  When I put in a ipdb.set_trace() for the ipython shell I want to send code snippets to the iPython shell.  Right now my workaround is using the isend minor mode to highlight my code and send it to the iPython shell.  The problem is that I kept getting IndentationError.  Now, I can just put a %cpaste and -- before and after my highlighted code and hit control-enter to send it to the ipython shell and run it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, is there a way to write a wrapper around the isend command so that it automatically adds the %cpaste in front of the highlighted code,  and a -- after it when sending it to the iPython shell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it might even be a cool feature to add to the elpy package.&lt;/p&gt;&#xA;" OwnerUserId="5285" LastActivityDate="2015-03-24T04:22:04.697" Title="Wrapping Python code with %cpaste and -- to send to iPython in elpy" Tags="|python|ipython|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7649" PostTypeId="2" ParentId="7648" CreationDate="2015-01-23T02:11:09.800" Score="0" Body="&lt;p&gt;This isn't a complete solution but I think it is related and might help... This comes from &lt;a href=&quot;https://github.com/jorgenschaefer/elpy/issues/191#issuecomment-42474850&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jorgenschaefer/elpy/issues/191#issuecomment-42474850&lt;/a&gt; and is a work-around to make IPython work with Org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defadvice org-babel-python-evaluate&#xA;    (around org-python-use-cpaste&#xA;            (session body &amp;amp;optional result-type result-params preamble) activate)&#xA;    &quot;Add a %cpaste and '--' to the body, so that ipython does the right thing.&quot;&#xA;    (setq body (concat &quot;%cpaste -q\n&quot; body &quot;\n--&quot;))&#xA;    ad-do-it&#xA;    (if (stringp ad-return-value)&#xA;        (setq ad-return-value (replace-regexp-in-string &quot;\\(^Pasting code; enter '--' alone on the line to stop or use Ctrl-D\.[\r\n]:*\\)&quot; &quot;&quot;&#xA;                                                        ad-return-value))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-01-23T02:11:09.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7650" PostTypeId="1" AcceptedAnswerId="7652" CreationDate="2015-01-23T05:19:04.190" Score="8" ViewCount="6682" Body="&lt;p&gt;Brand new emacs user here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to have the ability of opening a terminal with current file path from emacs, like what the &lt;code&gt;open terminal here&lt;/code&gt; package does in sublime text 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By terminal, I mean a separate external terminal emulator running bash or zsh, like gnome-terminal, not the emulated shells inside emacs, like &lt;code&gt;M-x shell&lt;/code&gt; &lt;code&gt;M-x eshell&lt;/code&gt;, which I can't appreciate for now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I googled but had nothing found... It seems that emacs guys really enjoy living in emacs.&lt;/p&gt;&#xA;" OwnerUserId="5289" LastEditorUserId="129" LastEditDate="2015-01-23T13:19:11.483" LastActivityDate="2021-02-13T04:40:11.353" Title="How to open a external terminal from emacs" Tags="|term|" AnswerCount="7" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7651" PostTypeId="2" ParentId="7650" CreationDate="2015-01-23T05:44:10.070" Score="2" Body="&lt;p&gt;What terminal emulator are you using? Take KDE's &lt;code&gt;Konsole&lt;/code&gt; as example, just write a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun open-konsole ()&#xA;  (interactive)&#xA;  (call-process &quot;konsole&quot; nil 0 nil &quot;--workdir&quot; default-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The args from 5st place are konsole's argument. See your prefered terminal simulator's man page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x open-konsole&lt;/code&gt; will open a new konsole process and use current &lt;code&gt;default-directory&lt;/code&gt; (&lt;code&gt;pwd&lt;/code&gt; in ELisp) as working directory.&lt;/p&gt;&#xA;" OwnerUserId="515" LastActivityDate="2015-01-23T05:44:10.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7652" PostTypeId="2" ParentId="7650" CreationDate="2015-01-23T05:47:44.540" Score="7" Body="&lt;p&gt;Another try that disowns the process so your terminal will survive even after emacs is killed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-gnome-terminal-here ()&#xA;  (interactive &quot;@&quot;)&#xA;  (shell-command (concat &quot;konsole --workdir&quot;&#xA;            (file-name-directory (or load-file-name buffer-file-name)) &#xA;              &quot; &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp; disown&quot;) nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="25" LastEditDate="2017-09-18T22:25:36.763" LastActivityDate="2017-09-18T22:25:36.763" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7653" PostTypeId="1" AcceptedAnswerId="7654" CreationDate="2015-01-23T07:34:43.660" Score="14" ViewCount="2594" Body="&lt;p&gt;When I open Emacs, it evaluates my init file, which includes refreshing my package archives via internet connection. This is problematic when I don't have an internet connection, thus I need to prevent execution of that code when starting Emacs without an internet connection. To solve this issue, I wonder if there is there a way to have Emacs ignore the package refresh code when I don't have an internet connection?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the first few lines of my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Requisites: Emacs &amp;gt;= 24&#xA;(require 'package)&#xA;(package-initialize)&#xA;&#xA;;; PACKAGE MANAGEMENT&#xA;(add-to-list 'package-archives &#xA;  '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;&#xA;(package-refresh-contents)       &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I imagine that I can add code to load my Emacs file as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Requisites: Emacs &amp;gt;= 24&#xA;(when (connected-to-internet-p)   ; I need this predicate function&#xA;  (require 'package)&#xA;  (package-initialize)&#xA;  (add-to-list 'package-archives &#xA;               '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;  (package-refresh-contents))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a &lt;code&gt;(connected-to-internet)&lt;/code&gt; function, or similar approach, to resolve this issue?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="50" LastEditDate="2015-01-23T20:51:17.507" LastActivityDate="2019-06-27T14:27:55.283" Title="Elisp code to check for internet connection" Tags="|elisp|networking|" AnswerCount="7" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7654" PostTypeId="2" ParentId="7653" CreationDate="2015-01-23T08:26:28.537" Score="7" Body="&lt;p&gt;Well, if you still wanted to refresh contents automatically, whenever possible, you could do something like the code below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun can-retreive-packages ()&#xA;  (cl-loop for url in '(&quot;http://marmalade-repo.org/packages/&quot;&#xA;                        &quot;http://melpa.milkbox.net/packages/&quot;&#xA;                        &quot;http://elpa.gnu.org/packages/&quot;)&#xA;           do (condition-case e&#xA;                  (kill-buffer (url-retrieve-synchronously url))&#xA;                (error (cl-return)))&#xA;           finally (cl-return t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Few notes are due:&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;This is slow, and it will be slow when starting up normally, so I rather do it manually.&lt;/li&gt;&#xA;&lt;li&gt;There is no way to test for internet connection in general.  You can only discover that you aren't able to connect to a particular service after some amount of time that you've tried.  This is also one of the reasons why it is so slow.&lt;/li&gt;&#xA;&lt;li&gt;The code is more of an illustration of how to approach the problem.  You could've easily done &lt;code&gt;(ignore-errors (package-refresh-contents))&lt;/code&gt; if you didn't care whether it succeeded or not.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-01-30T17:04:12.633" LastActivityDate="2015-01-30T17:04:12.633" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7655" PostTypeId="1" AcceptedAnswerId="7683" CreationDate="2015-01-23T09:25:11.297" Score="70" ViewCount="13783" Body="&lt;p&gt;Is it possible to open a specific revision of a file in Emacs with Magit without changing the current branch?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have rebased some local changes to a revision where the modified functions were replaced by functionality in a different file.  I would like to open the old revision of my changes in a separate buffer so I can compare the changes side by side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current &lt;em&gt;hacky&lt;/em&gt; solution has been to run &lt;code&gt;git show &amp;lt;branch pre-rebase&amp;gt;:file &amp;gt; old_file&lt;/code&gt; and then open &lt;code&gt;old_file&lt;/code&gt; in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="457" LastActivityDate="2016-06-09T10:15:18.363" Title="How can I open a specific revision of a file with Magit?" Tags="|magit|git|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7656" PostTypeId="2" ParentId="7642" CreationDate="2015-01-23T09:47:20.767" Score="0" Body="&lt;p&gt;Answer for other lost souls:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mkdir compat&#xA;git clone git://git.savannah.gnu.org/emacs.git&#xA;cd emacs&#xA;git show bc715d67b3997988e2a48286410d45404e49342c:lisp/emacs-lisp/ert.el &amp;gt; ../compat/ert.el&#xA;cd ../compat&#xA;curl -L http://elpa.gnu.org/packages/cl-lib-0.5.el -o cl-lib.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now add &lt;code&gt;compat&lt;/code&gt; to &lt;code&gt;load-path&lt;/code&gt; either by using &lt;code&gt;-L&lt;/code&gt; command line switch or by using &lt;code&gt;(add-to-list 'load-path (expand-file-name &quot;compat&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastActivityDate="2015-01-23T09:47:20.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7657" PostTypeId="2" ParentId="7655" CreationDate="2015-01-23T10:47:25.803" Score="41" Body="&lt;p&gt;It's possible to do with plain VC (built-in to Emacs), without Magit.  Type &lt;code&gt;C-x v ~&lt;/code&gt; and type the version you want. It understands tags and SHA1 hashes, as well as the usual &lt;code&gt;~1&lt;/code&gt; etc suffixes.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-23T10:47:25.803" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7658" PostTypeId="2" ParentId="7643" CreationDate="2015-01-23T10:56:17.033" Score="6" Body="&lt;ol&gt;&#xA;&lt;li&gt;Mark the appropriate defun and call &lt;kbd&gt;C-x nn&lt;/kbd&gt; (&lt;code&gt;narrow-to-region&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u C-M-x&lt;/kbd&gt; (&lt;code&gt;edebug-defun&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x nw&lt;/kbd&gt; (&lt;code&gt;widen&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you like doing things quickly, &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt; shortcut for this is &lt;kbd&gt;N&lt;/kbd&gt; &lt;kbd&gt;xe&lt;/kbd&gt; &lt;kbd&gt;W&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-01-23T15:22:22.113" LastActivityDate="2015-01-23T15:22:22.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7659" PostTypeId="2" ParentId="5436" CreationDate="2015-01-23T11:37:36.943" Score="9" Body="&lt;p&gt;Org-mode, which is included with Emacs, has a plist merge function: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-combine-plists (&amp;amp;rest plists)&#xA;  &quot;Create a single property list from all plists in PLISTS.&#xA;The process starts by copying the first list, and then setting properties&#xA;from the other lists.  Settings in the last list are the most significant&#xA;ones and overrule settings in the other lists.&quot;&#xA;  (let ((rtn (copy-sequence (pop plists)))&#xA;        p v ls)&#xA;    (while plists&#xA;      (setq ls (pop plists))&#xA;      (while ls&#xA;        (setq p (pop ls) v (pop ls))&#xA;        (setq rtn (plist-put rtn p v))))&#xA;    rtn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use it you'd need to &lt;code&gt;(require 'org)&lt;/code&gt; first to load the file. Unfortunately, it's a very large file, 900+KB, so it's not really usuable as a utility library. Something like a standard plist package would be nice to have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started a very small one recently and realized that alists and plists are not treated the same, argument-wise - eg (plist-get LIST KEY) vs (assoc KEY LIST), which must be some unfortunate relic of optimization (or ?). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, yes, Emacs does need a nice plist library - I didn't come across across one in my search, but it's still possible there's one out there somewhere, or else we'll have to start one and put it on Elpa/Melpa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alist library with the same interface would be nice to have also. &lt;/p&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2015-01-23T22:13:45.960" LastActivityDate="2015-01-23T22:13:45.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7660" PostTypeId="2" ParentId="7653" CreationDate="2015-01-23T12:05:34.560" Score="4" Body="&lt;p&gt;One thing you could try is the function &lt;code&gt;network-interface-list&lt;/code&gt;.  It returns an alist of network interfaces and their IP addresses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, this is what it returns when I'm connected to both Ethernet and wifi:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;en5&quot; .&#xA;  [10 151 0 63 0])&#xA; (&quot;en0&quot; .&#xA;  [10 151 2 76 0])&#xA; (&quot;lo0&quot; .&#xA;  [127 0 0 1 0]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when I turn off wifi, &lt;code&gt;en0&lt;/code&gt; disappears:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;en5&quot; .&#xA;  [10 151 0 63 0])&#xA; (&quot;lo0&quot; .&#xA;  [127 0 0 1 0]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Experiment with that and see what you get when you don't have an Internet connection.  For example, to only refresh packages when &lt;code&gt;en0&lt;/code&gt; is up, do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (assoc &quot;en0&quot; (network-interface-list))&#xA;  (package-refresh-contents))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-23T12:05:34.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7662" PostTypeId="2" ParentId="7653" CreationDate="2015-01-23T13:55:41.757" Score="3" Body="&lt;p&gt;To expand on Legoscia's answer:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-internet ()&#xA;  (remove-if (lambda (el)&#xA;                   (string-match-p &quot;lo.*&quot; (car el)))&#xA;                 (network-interface-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will return a list of active network connections (&lt;code&gt;lo.*&lt;/code&gt; is the loopback interface, in some cases &lt;code&gt;lo&lt;/code&gt; in others &lt;code&gt;lo#&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the test returns &lt;code&gt;non-nil&lt;/code&gt;, then there is a network connection (wifi/ethernet, no guarantee it actually reaches the outside internet however.  Would have to ping somewhere as a test for that), if it returns &lt;code&gt;nil&lt;/code&gt; then there is no way to retrieve the package list.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-01-23T13:55:41.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7663" PostTypeId="1" AcceptedAnswerId="7668" CreationDate="2015-01-23T14:32:00.933" Score="4" ViewCount="718" Body="&lt;p&gt;I read the following article: &lt;a href=&quot;http://qerub.se/hiding-hidden-files-in-emacs-dired&quot; rel=&quot;nofollow&quot;&gt;http://qerub.se/hiding-hidden-files-in-emacs-dired&lt;/a&gt; about hiding certain files in dired mode. I decided to hide more files and added a shortcut Alt-q, that will toggle the visibility of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;All the hidden files, starting with dot.&lt;/li&gt;&#xA;&lt;li&gt;All Emacs backup files, ending with '~'.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I wrote the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-omit-files &quot;^\\.$|~$&quot;)&#xA;(add-hook 'dired-mode-hook&#xA;          (lambda ()&#xA;                (define-key dired-mode-map (kbd &quot;M-q&quot;) 'dired-omit-mode)&#xA;      ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But only ~ files are hidded, not those, starting with dot. What is wrong?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2015-01-23T15:08:57.190" Title="Dired: can't create a regexp to hide all the necessary files" Tags="|dired|regular-expressions|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7664" PostTypeId="2" ParentId="7663" CreationDate="2015-01-23T14:36:03.770" Score="2" Body="&lt;p&gt;I think this should work for you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-omit-files &quot;^\\(?:\\..*\\|.*~\\)$&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-23T14:36:03.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7665" PostTypeId="2" ParentId="7638" CreationDate="2015-01-23T14:36:59.303" Score="2" Body="&lt;p&gt;&lt;code&gt;wg-current-workgroup-p&lt;/code&gt; doesn't take a string as the workgroup name, it needs to be passed an actual workgroup object. For example, try doing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(wg-current-workgroup-p (wg-current-workgroup))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(wg-current-workgroup)&lt;/code&gt; returns the current workgroup as a workgroup object. Obviously, this will return true, because you're checking if the current workgroup is the current workgroup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get a list of all workgroup objects with &lt;code&gt;(wg-workgroup-list)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To check if the current workgroup is the last one in the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(wg-current-workgroup-p (car (last (wg-workgroup-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get the name (as a string) of the first workgroup, you can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(wg-workgroup-name (car (wg-workgroup-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can get all the workgroups names as strings with &lt;code&gt;(wg-workgroup-names)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-apropos&lt;/code&gt; is useful for finding all these functions.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-23T14:36:59.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7666" PostTypeId="2" ParentId="7663" CreationDate="2015-01-23T14:56:28.230" Score="1" Body="&lt;p&gt;This regexp works successfully: &lt;code&gt;(setq dired-omit-files &quot;^\\..*~?$&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2015-01-23T14:56:28.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7667" PostTypeId="1" AcceptedAnswerId="7669" CreationDate="2015-01-23T15:07:45.633" Score="0" ViewCount="82" Body="&lt;p&gt;I am trying to setup my init files, and want a special set of dimensions for my main Emacs window. If I place my window wherever I want it, is there a way of querying Emacs as to the main window dimensions? I.e., is there a way of querying the value of the &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt;, &lt;code&gt;width&lt;/code&gt;, and &lt;code&gt;height&lt;/code&gt; values of the main window as it is currently placed?&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2015-01-23T15:31:00.580" Title="Query dimensions of main window" Tags="|window|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7668" PostTypeId="2" ParentId="7663" CreationDate="2015-01-23T15:08:57.190" Score="6" Body="&lt;p&gt;Testing with &lt;code&gt;emacs -q&lt;/code&gt; to ensure no customizations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired-x) ;; provides dired-omit-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x dired&lt;/code&gt; &lt;code&gt;~&lt;/code&gt; -&gt; Backup files and dot files are both present (had to manually add backups since I store them in a dedicated folder by default.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x dired-omit-mode&lt;/code&gt; -&gt; Backup files are hidden&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x dired-omit-mode&lt;/code&gt; -&gt; All files visible again&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq dired-omit-files &quot;^\\..*$&quot;)&lt;/code&gt; -&gt; Omit dotfiles&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x dired-omit-mode&lt;/code&gt; -&gt; Backup and dotfiles are hidden.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Docstring for &lt;code&gt;dired-omit-mode&lt;/code&gt; makes reference to &lt;code&gt;dired-omit-extensions&lt;/code&gt;.  Looking in there, the 2nd extension listed is &lt;code&gt;~&lt;/code&gt; (emacs backup files).  This comes from &lt;code&gt;completion-ignored-extensions&lt;/code&gt; (following dock string).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means by default &lt;code&gt;dired-omit-mode&lt;/code&gt; will already remove backups from the view, reducing the complexity of the regexp needed.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-01-23T15:08:57.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7669" PostTypeId="2" ParentId="7667" CreationDate="2015-01-23T15:31:00.580" Score="1" Body="&lt;p&gt;There's &lt;code&gt;(window-width)&lt;/code&gt; and &lt;code&gt;(window-pixel-width)&lt;/code&gt; (and the equivalent height functions) for getting the width in characters and pixels respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also &lt;code&gt;(window-pixel-top)&lt;/code&gt; and &lt;code&gt;(window-pixel-left)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure if these are what you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used &lt;code&gt;helm-apropos&lt;/code&gt; to find these functions. There's also a built-in command to search functions: &lt;code&gt;M-x apropos RET window left RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-23T15:31:00.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7670" PostTypeId="2" ParentId="7643" CreationDate="2015-01-23T16:34:05.163" Score="3" Body="&lt;h2&gt;&lt;code&gt;edebug-defun&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Thanks to @abo-abo for the tip to mark the defun first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a quick way to enable/disable &lt;code&gt;edebug-defun&lt;/code&gt;. This uses &lt;code&gt;search-backward-regexp&lt;/code&gt; to edebug-instrument or eval the defun or defmacro name correctly, whether it is defined in &lt;code&gt;use-package&lt;/code&gt; wrapper or not.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Edebug a defun or defmacro&#xA;(defvar modi/fns-in-edebug nil&#xA;  &quot;List of functions for which `edebug' is instrumented.&quot;)&#xA;&#xA;(defconst modi/fns-regexp (concat &quot;(\\s-*&quot;&#xA;                                  &quot;\\(defun\\|defmacro\\)\\s-+&quot;&#xA;                                  &quot;\\(?1:\\(\\w\\|\\s_\\)+\\)\\_&amp;gt;&quot;) ; word or symbol char&#xA;  &quot;Regexp to find defun or defmacro definition.&quot;)&#xA;&#xA;(defun modi/toggle-edebug-defun ()&#xA;  (interactive)&#xA;  (let (fn)&#xA;    (save-excursion&#xA;      (search-backward-regexp modi/fns-regexp)&#xA;      (setq fn (match-string 1))&#xA;      (mark-sexp)&#xA;      (narrow-to-region (point) (mark))&#xA;      (if (member fn modi/fns-in-edebug)&#xA;          ;; If the function is already being edebugged, uninstrument it&#xA;          (progn&#xA;            (setq modi/fns-in-edebug (delete fn modi/fns-in-edebug))&#xA;            (eval-region (point) (mark))&#xA;            (setq-default eval-expression-print-length 12)&#xA;            (setq-default eval-expression-print-level  4)&#xA;            (message &quot;Edebug disabled: %s&quot; fn))&#xA;        ;; If the function is not being edebugged, instrument it&#xA;        (progn&#xA;          (add-to-list 'modi/fns-in-edebug fn)&#xA;          (setq-default eval-expression-print-length nil)&#xA;          (setq-default eval-expression-print-level  nil)&#xA;          (edebug-defun)&#xA;          (message &quot;Edebug: %s&quot; fn)))&#xA;      (widen))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt; - With the point anywhere in the function/macro body, calling &lt;code&gt;modi/toggle-edebug-defun&lt;/code&gt; will enable or disable &lt;code&gt;edebug&lt;/code&gt; for that entity.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;code&gt;debug-on-entry&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Thanks to @glucas and @Drew, I have cooked up a convenient way to toggle &lt;code&gt;debug-on-entry&lt;/code&gt;. This also uses the same approach as above to parse the defun/defmacro name.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Debug on entry&#xA;(defvar modi/fns-in-debug nil&#xA;  &quot;List of functions for which `debug-on-entry' is instrumented.&quot;)&#xA;&#xA;(defun modi/toggle-debug-defun ()&#xA;  (interactive)&#xA;  (let (fn)&#xA;    (save-excursion&#xA;      (search-backward-regexp modi/fns-regexp)&#xA;      (setq fn (match-string 1)))&#xA;    (if (member fn modi/fns-in-debug)&#xA;        ;; If the function is already being debugged, cancel its debug on entry&#xA;        (progn&#xA;          (setq modi/fns-in-debug (delete fn modi/fns-in-debug))&#xA;          (cancel-debug-on-entry (intern fn))&#xA;          (message &quot;Debug-on-entry disabled: %s&quot; fn))&#xA;      ;; If the function is not being debugged, debug it on entry&#xA;      (progn&#xA;        (add-to-list 'modi/fns-in-debug fn)&#xA;        (debug-on-entry (intern fn))&#xA;        (message &quot;Debug-on-entry: %s&quot; fn)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt; - With the point anywhere in the function body, calling &lt;code&gt;modi/toggle-debug-defun&lt;/code&gt; will enable or cancel the &lt;code&gt;debug-on-error&lt;/code&gt; for that function.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-03-17T13:23:33.463" LastActivityDate="2015-03-17T13:23:33.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7671" PostTypeId="2" ParentId="2999" CreationDate="2015-01-23T18:23:34.540" Score="1" Body="&lt;p&gt;I'm using the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (eq system-type 'gnu/linux)&#xA;  (defun x11-maximize-frame ()&#xA;    &quot;Maximize the current frame (to full screen)&quot;&#xA;    (interactive)&#xA;    (x-send-client-message nil 0 nil &quot;_NET_WM_STATE&quot; 32 '(2 &quot;_NET_WM_STATE_MAXIMIZED_HORZ&quot; 0))&#xA;    (x-send-client-message nil 0 nil &quot;_NET_WM_STATE&quot; 32 '(2 &quot;_NET_WM_STATE_MAXIMIZED_VERT&quot; 0)))&#xA;  (run-with-idle-timer 0.01 nil 'x11-maximize-frame)&#xA;  )&#xA;&#xA;(when (eq system-type 'windows-nt)&#xA;  (w32-send-sys-command 61488)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-01-23T18:23:34.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7673" PostTypeId="1" CreationDate="2015-01-23T18:44:23.350" Score="12" ViewCount="3664" Body="&lt;p&gt;I have set up custom $PATH in my ~/.bash_profile on a remote machine (for programs installed user-locally by &lt;code&gt;nix&lt;/code&gt; and &lt;code&gt;cabal&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use eshell and tramp to issue commands on the remote machine (&lt;code&gt;cd /remotehost:somedir&lt;/code&gt;; then commands). (I chose this method instead of the common SSH-sessions in a terminal primarily because I'm using a bad connection and SSH-sessions get interrupted very often, so I can't count on being able to login, cd, and issue a command before the connection is interrupted.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, my custom PATH is not honored in this situation, and some of the programs are not found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be the nicest way to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="5165" LastActivityDate="2018-03-03T14:24:03.213" Title="How do I make tramp+eshell use my environment customized in the remote ~/.bash_profile" Tags="|eshell|tramp|path|environment|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7674" PostTypeId="1" CreationDate="2015-01-23T18:48:41.453" Score="4" ViewCount="878" Body="&lt;p&gt;How to write the analogue of a bash-command like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cd ../repo &amp;amp;&amp;amp; git fast-export master) | darcs convert import repo_master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in eshell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here a subshell is employed to restrict the effect of &lt;code&gt;cd&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5165" LastActivityDate="2015-01-24T10:19:48.310" Title="What is the syntax for a subshell in eshell?" Tags="|eshell|shell|subprocess|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7675" PostTypeId="1" CreationDate="2015-01-23T21:13:38.460" Score="2" ViewCount="1638" Body="&lt;p&gt;I'm running into the error &quot;Marker does not point anywhere&quot; when I try to print a message both in after-change-functions and buffer-list-update-hook. Curiously if only one hook or the other is active the error does not occur, you have to have both! Precise code and steps to reproduce are below. Any advice on how to fix while keeping the message?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tested on emacs 24.4.1 with -Q flag, on Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; To reproduce:&#xA;;; 1. emacs -Q&#xA;;; 2. Have your frame display the scratch buffer, eval the code below in it&#xA;;; 3. Create a second frame (C-x,5,2)&#xA;;; 4. Have the second frame display the *Messages* buffer.&#xA;;; 5. Rapidly switch focus between the two frames&#xA;;; You should get the error: (error &quot;Marker does not point anywhere&quot;)&#xA;;; Why? How do I prevent?&#xA;&#xA;(setq-default debug-on-error t) ;; so you notice the error&#xA;&#xA;(defun common-test (&amp;amp;optional a b c)&#xA;  (message &quot;test&quot;))&#xA;&#xA;(add-hook 'after-change-functions #'common-test)&#xA;(add-hook 'buffer-list-update-hook #'common-test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also here is an example backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Marker does not point anywhere&quot;)&#xA;  message(&quot;test&quot;)&#xA;  common-test()&#xA;  run-hooks(buffer-list-update-hook)&#xA;  handle-switch-frame((switch-frame #&amp;lt;frame *Backtrace* 0x1218168&amp;gt;))&#xA;  call-interactively(handle-switch-frame nil nil)&#xA;  command-execute(handle-switch-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2015-01-23T21:20:55.690" LastActivityDate="2021-09-06T13:41:08.487" Title="&quot;Marker does not point anywhere&quot; error when using (message)" Tags="|hooks|mark|message|buffer-list|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7676" PostTypeId="1" CreationDate="2015-01-23T21:43:42.740" Score="1" ViewCount="1026" Body="&lt;p&gt;I recently installed Emacs 24 on my Ubuntu machine. I access this machine via SSH from a Mac. I am trying to search for some text and I am pasting the text in the search command's buffer. I.e I do &lt;code&gt;C-s&lt;/code&gt;, then paste by doing &lt;code&gt;⌘+v&lt;/code&gt; on my mac keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The text gets pasted into the document instead of the search command's buffer.This wasn't the case with Emacs23 where the pasted text was in the search command and not in the document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get &lt;code&gt;⌘+v&lt;/code&gt; to paste text into the search buffer?&lt;/p&gt;&#xA;" OwnerUserId="5298" LastActivityDate="2015-01-24T00:11:24.850" Title="Pasting text into Emacs 24 search command buffer" Tags="|search|emacs24.4|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7677" PostTypeId="2" ParentId="7676" CreationDate="2015-01-23T21:55:29.620" Score="1" Body="&lt;p&gt;In &lt;code&gt;emacs&lt;/code&gt;, the keybindings for cut-and-paste are very different. This is an unfortunate fact, and it is very difficult to change. Anyway, it goes like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y&lt;/code&gt; to &quot;paste&quot; (called &lt;code&gt;yank&lt;/code&gt; in Emacs)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-w&lt;/code&gt; to &quot;copy&quot; (called &lt;code&gt;kill-ring-save&lt;/code&gt; in Emacs)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-w&lt;/code&gt; to &quot;cut&quot; (called &lt;code&gt;kill-region&lt;/code&gt; in Emacs)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Emacs has these commands because it existed long before &lt;code&gt;C-v&lt;/code&gt; paste, &lt;code&gt;C-c&lt;/code&gt; copy, and &lt;code&gt;C-x&lt;/code&gt; cut became the norm. Emacs also has its own &quot;clipboard&quot; (called the &lt;code&gt;kill-ring&lt;/code&gt;) which stores the things you cut. &lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-01-23T21:55:29.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7679" PostTypeId="2" ParentId="7676" CreationDate="2015-01-23T22:24:29.617" Score="1" Body="&lt;p&gt;It is most likely that for you &lt;kbd&gt;⌘+v&lt;/kbd&gt; is interpretted as  which runs the function &lt;code&gt;xterm-paste&lt;/code&gt;. this function gets the text from your clipboard and then runs &lt;code&gt;yank&lt;/code&gt; to insert it, however, in &lt;code&gt;isearch-mode&lt;/code&gt; the normal yank keybinding actually runs a special command to yank into the isearch minibuffer instead of the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that in the past, the minibuffer was actually active when isearching, and now it is not. I advised &lt;code&gt;xterm-paste&lt;/code&gt; so them when run in &lt;code&gt;isearch-mode&lt;/code&gt; it will act in a special way that works with &lt;code&gt;isearch&lt;/code&gt; instead of just &lt;code&gt;yank&lt;/code&gt;ing. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defadvice xterm-paste (around support-isearch-mode activate)&#xA;  (if isearch-mode&#xA;      ;; when isearch-mode, act special.&#xA;      (let* ((end-marker-length (length xterm-paste-ending-sequence))&#xA;             (pasted-text (with-temp-buffer&#xA;                            (set-buffer-multibyte nil)&#xA;                            (while (not (search-backward&#xA;                                         xterm-paste-ending-sequence&#xA;                                         (- (point) end-marker-length) t))&#xA;                              (let ((event (read-event&#xA;                                            nil nil&#xA;                                            ;; Use finite timeout to avoid                                                                                                                                                                                                                                                     &#xA;                                            ;; glomming the event onto                                                                                                                                                                                                                                                         &#xA;                                            ;; this-command-keys.                                                                                                                                                                                                                                                              &#xA;                                            most-positive-fixnum)))&#xA;                                (when (eql event ?\r)&#xA;                                  (setf event ?\n))&#xA;                                (insert event)))&#xA;                            (let ((last-coding-system-used))&#xA;                              (decode-coding-region&#xA;                               (point-min) (point)&#xA;                               (keyboard-coding-system) t)))))&#xA;        ;; then only real change&#xA;        (isearch-yank-string pasted-text))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Look at the code from &lt;code&gt;xterm-paste&lt;/code&gt; and you'll see that the special case in this adivce is just the copy and pasted code, expect &lt;code&gt;yank&lt;/code&gt; has been changed to &lt;code&gt;(isearch-yank-string pasted-text))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="780" LastEditDate="2015-01-24T00:11:24.850" LastActivityDate="2015-01-24T00:11:24.850" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7680" PostTypeId="2" ParentId="7675" CreationDate="2015-01-23T23:59:47.467" Score="2" Body="&lt;p&gt;Sounds like a bug to me.  Consider reporting it: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-23T23:59:47.467" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7681" PostTypeId="2" ParentId="7674" CreationDate="2015-01-24T00:27:37.840" Score="3" Body="&lt;p&gt;In &lt;code&gt;eshell&lt;/code&gt;, process subshells are generally done with &lt;code&gt;${...}&lt;/code&gt; syntax. However, the output is produced in the form of an intermediate Emacs Lisp expression.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ echo ${cd ~/.emacs.d; ls} | cat&#xA;(&quot;README.md&quot; &quot;ac-comphist.dat&quot;&#xA;  #(&quot;auto-save-list&quot; 0 14&#xA;     (font-lock-face eshell-ls-directory))&#xA;  #(&quot;bin&quot; 0 3&#xA;     (font-lock-face eshell-ls-directory))&#xA;  &quot;custom.el&quot;&#xA;[more text omitted]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While this is useful if you want to chain Elisp expression, it is not if you want to pass a raw string. Instead, you might want to use the command &lt;code&gt;eshell-command-result&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ echo (substring-no-properties (eshell-command-result &quot;cd ~/.emacs.d; ls&quot;)) | cat&#xA;README.md&#xA;ac-comphist.dat&#xA;auto-save-list&#xA;bin&#xA;custom.el&#xA;[more text omitted]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Various modifications may help you get what you want. Just play with it and see how it goes.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-01-24T00:27:37.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7682" PostTypeId="1" AcceptedAnswerId="7684" CreationDate="2015-01-24T03:44:21.783" Score="2" ViewCount="794" Body="&lt;p&gt;&lt;strong&gt;How can I determine the width of an image of the &lt;code&gt;imagemagick&lt;/code&gt; type?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am inserting an image into a buffer, whose size is (initally)&#xA;completely unknown to me. I do it more or less like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-image (create-image image-data 'imagemagick t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, sometimes the image is huge, so I need to limit its size like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-image (create-image image-data 'imagemagick t :width 200))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is, sometimes the image is &lt;em&gt;small&lt;/em&gt;, and forcing it to have&#xA;width 200 is very undesirable. So I would like to check the width of&#xA;the image, and do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((image (create-image image-data 'imagemagick t)))&#xA;  (if (&amp;gt; (image-width image) 200)&#xA;      (append image '(:width 200))&#xA;    image))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I don't know how to get the width of an image in order to make&#xA;this check. Is there anything similar to a &lt;code&gt;image-width&lt;/code&gt; function?&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-01-24T06:11:28.347" LastActivityDate="2015-01-24T19:36:48.793" Title="Get width of an image" Tags="|text-properties|images|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7683" PostTypeId="2" ParentId="7655" CreationDate="2015-01-24T03:47:16.713" Score="92" Body="&lt;p&gt;You can view a file for a specific revision using &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;magit-find-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;&amp;lt;filename&amp;gt;&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can first view the diff for commit by pressing &lt;kbd&gt;RET&lt;/kbd&gt; on it, navigating to the file inside the diff, and then pressing &lt;kbd&gt;RET&lt;/kbd&gt; again.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="306" LastEditDate="2016-06-09T10:15:18.363" LastActivityDate="2016-06-09T10:15:18.363" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7684" PostTypeId="2" ParentId="7682" CreationDate="2015-01-24T04:07:33.220" Score="3" Body="&lt;p&gt;See the documentation on the function &lt;code&gt;image-size&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;image-size is a built-in function in `C source code'.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(image-size SPEC &amp;amp;optional PIXELS FRAME)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Return the size of image SPEC as pair (WIDTH . HEIGHT). PIXELS non-nil means return the size in pixels, otherwise return the size in canonical character units. FRAME is the frame on which the image will be displayed.  FRAME nil or omitted means use the selected frame.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In general, you can find the documentation of a function by doing &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;function-name-here&lt;/code&gt;. You can try guessing the name of the function if you don't know if it exists. The names are pretty sane, and once you narrow down a prefix, you can always press &lt;kbd&gt;&amp;lt;tab&amp;gt;&lt;/kbd&gt; to show a list.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-24T04:07:33.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7685" PostTypeId="2" ParentId="7673" CreationDate="2015-01-24T07:51:42.867" Score="8" Body="&lt;p&gt;This question &lt;a href=&quot;https://emacs.stackexchange.com/a/2106/5165&quot;&gt;has been already answered by rekado (thanks!)&lt;/a&gt; (as a reply to another more general question about eshell):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can configure TRAMP to respect the PATH variable on the remote&#xA;  machine (for remote eshell sessions) by adding&#xA;  &lt;code&gt;'tramp-own-remote-path&lt;/code&gt; to the list &lt;code&gt;'tramp-remote-path&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-remote-path 'tramp-own-remote-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;By default, eshell will not adopt the remote PATH settings.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As for other environment variables, there is no special approach as for &lt;code&gt;PATH&lt;/code&gt;: one can set them through &lt;code&gt;tramp-remote-process-environment&lt;/code&gt; (as documented in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-processes.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-processes.html&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-remote-process-environment&#xA;              (format &quot;DISPLAY=%s&quot; (getenv &quot;DISPLAY&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I don't know of a way that would read the ones set in the remote &lt;code&gt;~/.bash_profile&lt;/code&gt;. So you need to repeat them in this variable on the local side in Emacs as a workaround, which is not totally convenient because different remote hosts might need different values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;EDITOR&lt;/code&gt; specifically, of course, doing it &lt;a href=&quot;https://emacs.stackexchange.com/a/893/5165&quot;&gt;with &lt;code&gt;with-editor&lt;/code&gt;&lt;/a&gt; would be more convenient and appropriate.&lt;/p&gt;&#xA;" OwnerUserId="5165" LastEditorUserId="5165" LastEditDate="2018-03-03T14:24:03.213" LastActivityDate="2018-03-03T14:24:03.213" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7686" PostTypeId="1" CreationDate="2015-01-24T09:41:28.420" Score="1" ViewCount="1815" Body="&lt;p&gt;I use Emacs. However, I am not familiar with Lisp although I do know some functional programming, and hence I never really understood how to customize the &lt;code&gt;init.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically, I want to be able to enable the toolbar mode and menubar mode only if I am in &lt;code&gt;R-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that to enable these mode simply requires:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(tool-bar-mode 1)&lt;/code&gt; and &lt;code&gt;(menu-bar-mode 1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but what if I want to do this locally, i.e. enable them only if I am in &lt;code&gt;R-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I put in the &lt;code&gt;init.el&lt;/code&gt; ? &lt;/p&gt;&#xA;" OwnerUserId="5301" LastEditorUserId="253" LastEditDate="2015-01-24T15:05:22.243" LastActivityDate="2015-01-24T15:05:22.243" Title="Emacs: How to enable toolbar mode and menubar mode only under a certain mode?" Tags="|init-file|menu-bar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7687" PostTypeId="2" ParentId="7686" CreationDate="2015-01-24T10:15:06.627" Score="5" Body="&lt;p&gt;tool-bar-mode and menu-bar-mode being a global modes, you can enable them using a mode hook, but all buffers in all frames will be affected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never used it, but you may be interested by &lt;a href=&quot;http://www.emacswiki.org/emacs/download/tool-bar+.el&quot; rel=&quot;noreferrer&quot;&gt;toolbar-here-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In addition to defining minor mode &lt;code&gt;tool-bar-pop-up-mode&lt;/code&gt;, this&lt;br&gt;&#xA;  library defines minor mode &lt;code&gt;tool-bar-here-mode&lt;/code&gt;, which is the&lt;br&gt;&#xA;  same as the global &lt;code&gt;tool-bar-mode&lt;/code&gt; except that it affects only&lt;br&gt;&#xA;  the current frame.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For menu-bar-mode, you have the &lt;code&gt;toggle-menu-bar-mode-from-frame&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(toggle-menu-bar-mode-from-frame &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Toggle menu bar on or off, based on the status of the current frame.&#xA;  See `menu-bar-mode' for more information&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And use it with a key, for example in your init file: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key [f2] 'toggle-menu-bar-mode-from-frame)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-01-24T10:15:06.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7688" PostTypeId="2" ParentId="7674" CreationDate="2015-01-24T10:19:48.310" Score="2" Body="&lt;p&gt;&lt;code&gt;{ ... }&lt;/code&gt; has very varying behavior (at least, from the point of view of bash):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ {echo a b c} | tr [[:lower:]] [[:upper:]]&#xA;(&quot;A&quot; &quot;B&quot; &quot;C&quot;)~ $ &#xA;~ $ {echo hi} | tr [[:lower:]] [[:upper:]]&#xA;HI~ $ {/bin/echo a b c} | tr [[:lower:]] [[:upper:]]&#xA;~ $ A B C&#xA;&#xA;~ $ echo {echo a b c}&#xA;(&quot;a&quot; &quot;b&quot; &quot;c&quot;)&#xA;~ $ echo {/bin/echo a b c}&#xA;~ $ echo {/bin/echo hi}&#xA;~ $ echo {echo hi}&#xA;hi&#xA;~ $ echo ${/bin/echo hi}&#xA;~ $ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;a builtin&lt;/strong&gt; inside &lt;code&gt;{ }&lt;/code&gt; feeds its output to a pipe AND provides it as the substitution when used as an argument of a command. Another peculiarity is that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if the output consists of &lt;strong&gt;one &quot;element&quot;&lt;/strong&gt;, it is output in its bare form,&lt;/li&gt;&#xA;&lt;li&gt;but &lt;strong&gt;a list&lt;/strong&gt; is output as an elsip list.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A &lt;strong&gt;Unix program&lt;/strong&gt; inside &lt;code&gt;{ }&lt;/code&gt; feeds its output to a pipe AND NEVER makes it a substitution in an argument position. There is also no special treatment of lists, no elisp expressions appear as the output.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm not sure whether &lt;strong&gt;&lt;code&gt;${ }&lt;/code&gt;&lt;/strong&gt; does exactly the same as &lt;code&gt;{ }&lt;/code&gt; or there are some differences...&lt;/p&gt;&#xA;" OwnerUserId="5165" LastActivityDate="2015-01-24T10:19:48.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7689" PostTypeId="1" CreationDate="2015-01-24T11:42:32.833" Score="1" ViewCount="307" Body="&lt;p&gt;Is it possible to force Emacs to only take into account the last (resp. the first) appearance of a customization? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if there are the following lines in the init file, is there a way that Emacs only takes into account the second (resp. the first) one? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-height (selected-frame) 36)&#xA;(set-frame-height (selected-frame) 46)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-05-20T05:12:56.817" LastActivityDate="2015-05-20T05:12:56.817" Title="order of settings in init file" Tags="|elisp|init-file|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7690" PostTypeId="2" ParentId="7689" CreationDate="2015-01-24T13:30:06.093" Score="7" Body="&lt;p&gt;The init file is just a series of commands, that are run in turn.  So the first command will be executed setting the height to &lt;code&gt;36&lt;/code&gt;, then the second will be run setting it to &lt;code&gt;46&lt;/code&gt;.  The final effect is that you get a frame with the last mentioned size (provide there are no commands in between that change the frame selection).  You may or may not notice the intermediate setting taking effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware that standard customisations as written out by the custom interface are saved in alphabetical order and evaluated in that order.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2015-01-24T13:30:06.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7691" PostTypeId="1" CreationDate="2015-01-24T14:38:42.700" Score="1" ViewCount="131" Body="&lt;p&gt;I am trying to understand how &lt;code&gt;forward-list&lt;/code&gt; matches template delimiters &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; in &lt;code&gt;c++-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;forward-list&lt;/code&gt; in &lt;code&gt;lisp.el&lt;/code&gt; calls &lt;code&gt;scan-lists&lt;/code&gt; with the appropriate arguments. The documentation for &lt;code&gt;scan-lists&lt;/code&gt; says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(scan-lists FROM COUNT DEPTH)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Scan from character number &lt;code&gt;FROM&lt;/code&gt; by &lt;code&gt;COUNT&lt;/code&gt; lists. Scan forward if &lt;code&gt;COUNT&lt;/code&gt;&#xA;  is positive, backward if &lt;code&gt;COUNT&lt;/code&gt; is negative. Return the character&#xA;  number of the position thus found.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A &quot;list&quot;, in this context, refers to a balanced parenthetical&#xA;  grouping, as determined by the syntax table.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Looking at the syntax table in a &lt;code&gt;c++-mode&lt;/code&gt; buffer, I don't find an entry of which indicates that &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; match each other. Is my reading of the syntax table incorrect? I am assuming that matching entries look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(       ()  which means: open, matches )&#xA;)       )(  which means: close, matches (&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To summarize, how does &lt;code&gt;forward-list&lt;/code&gt; match the template delimiters &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; in &lt;code&gt;c++-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-01-24T14:38:42.700" Title="How does forward-list work for &quot;&lt;&gt;&quot; in c++-mode?" Tags="|balanced-parentheses|cc-mode|syntax-table|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7692" PostTypeId="2" ParentId="7689" CreationDate="2015-01-24T16:20:19.350" Score="2" Body="&lt;p&gt;In addition to what @AndrewSwann said -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a difference between customizations in the sense of &lt;code&gt;custom-set-variables&lt;/code&gt; and &lt;code&gt;custom-set-faces&lt;/code&gt;, on the one hand, and using isolated sexps such as &lt;code&gt;(set-frame-height (selected-frame) 36)&lt;/code&gt; in your init file, on the other hand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former are designed to work with the Customize interface, and they are pretty solid. The latter depend on the state that is current when they are evaluated, and you are on your own wrt managing and keeping track of such state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, if you use something like &lt;code&gt;(set-frame-height (selected-frame) 36)&lt;/code&gt; at top level in your init file then it is up to you to ensure that the frame you want to modify is the one that is selected when that sexp is evaluated.  Typically you would instead customize an option such as &lt;code&gt;default-frame-alist&lt;/code&gt;, or you would at least make sure of the frame you are operating on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sexp order always matters, including in your init file (and including the position of &lt;code&gt;custom-set-variables&lt;/code&gt; etc.), but the more you depend on the order the more you need to take it into account and manage it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, you are better off following the conventional practices.  If you want to do something beyond what Customize offers, then define mode or other functions that do exactly what you want, and invoke those from your init file. IOW, encapsulate your fiddling a bit, to ensure that the context is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In addition to recommending that you do as much as you can using Customize, I would also recommend that you separate what it does from your init file, by taking advantage of variable &lt;code&gt;custom-file&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-24T16:20:19.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7693" PostTypeId="2" ParentId="7682" CreationDate="2015-01-24T19:36:48.793" Score="3" Body="&lt;p&gt;@PythonNut is correct that &lt;code&gt;(image-size)&lt;/code&gt; is the function you are looking for. With it, you can extract the height and width from an image in &lt;code&gt;image-mode&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((image-dimensions (image-size (image-get-display-property) :pixels))&#xA;         (width (car image-dimensions))&#xA;         (height (cdr image-dimensions))&#xA;  ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example and maybe on a related/useful note, I use this approach to put the image dimensions in the mode line when viewing an image:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun show-image-dimensions-in-mode-line ()&#xA;  (let* ((image-dimensions (image-size (image-get-display-property) :pixels))&#xA;         (width (car image-dimensions))&#xA;         (height (cdr image-dimensions)))&#xA;    (setq mode-line-buffer-identification&#xA;          (format &quot;%s %dx%d&quot; (propertized-buffer-identification &quot;%12b&quot;) width height))))&#xA;&#xA;(add-hook 'image-mode-hook #'show-image-dimensions-in-mode-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="264" LastActivityDate="2015-01-24T19:36:48.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7694" PostTypeId="1" CreationDate="2015-01-24T19:47:38.000" Score="11" ViewCount="1916" Body="&lt;p&gt;Suppose I'm writing a C program in a file foo.c:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int add_numbers(int x, int y, int z) {&#xA;    // Very complex implementation here.&#xA;    return x + y + z;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want a command that will insert a corresponding function prototype in foo.h:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int add_numbers(int x, int y, int z);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are there any existing Emacs solutions for this?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-02-27T17:12:36.110" Title="How can I automatically insert a prototype in foo.h from foo.c?" Tags="|c|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7695" PostTypeId="2" ParentId="7694" CreationDate="2015-01-24T22:35:16.533" Score="2" Body="&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; the following should work (it works for me):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun c-copy-function-signature-to-header ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (let ((last-point -1))&#xA;      (while (/= (point) last-point)&#xA;        (setq last-point (point))&#xA;        (sp-backward-up-sexp))&#xA;      (kill-ring-save (point) (line-beginning-position))&#xA;      (ff-find-other-file)&#xA;      (yank)&#xA;      ;; clean whitespace between closing paren and opening curly &#xA;      (delete-trailing-whitespace&#xA;        (line-beginning-position)&#xA;        (line-end-position))&#xA;      (insert &quot;;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This requires &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt;, although you might be able to hack up your own copy of &lt;code&gt;sp-backward-up-sexp&lt;/code&gt; if that is unacceptable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that this will put the header wherever you left the &lt;code&gt;(point)&lt;/code&gt; last in the header. As you didn't specify where you wanted it, I thought this was probably best. Of course, if you want it to append at the end, you can put an &lt;code&gt;(end-of-buffer)&lt;/code&gt; before the &lt;code&gt;(yank)&lt;/code&gt;. Of of course you can add fancier stuff like creating a new line near the point and yanking there, but that's up to your taste.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-01-24T22:54:35.937" LastActivityDate="2015-01-24T22:54:35.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7696" PostTypeId="2" ParentId="7694" CreationDate="2015-01-25T00:52:46.370" Score="3" Body="&lt;p&gt;The following command should do it. It passed my tests, and has no external dependencies.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/copy-proto-to-header-file ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    ;; c-mode's `beginning-of-defun' should be robust enough.&#xA;    (beginning-of-defun)&#xA;    (let ((l (point)))&#xA;      (search-forward-regexp &quot; *{&quot;)&#xA;      (let ((proto (buffer-substring l (match-beginning 0))))&#xA;        (ff-find-other-file)&#xA;        ;; If other file is already open, we don't want to move point.&#xA;        (save-excursion&#xA;          (goto-char (point-max))&#xA;          ;; Do some more movement here if you want.&#xA;          (insert &quot;\n&quot; proto &quot;;&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-25T00:52:46.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7697" PostTypeId="1" AcceptedAnswerId="7899" CreationDate="2015-01-25T02:07:22.340" Score="14" ViewCount="1144" Body="&lt;p&gt;I want to create a new frame that contains nothing but the mode-line. Especially not a file buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do I need this? I use &lt;a href=&quot;http://orgmode.org/manual/Clocking-work-time.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-mode's clocking&lt;/a&gt; to time my work. Org-mode displays the timer for the current task I'm working on in the mode-line, and updates the timer in real-time. I use apps other than Emacs, so when I switch to them (e.g.. when using the browser or terminal) I still want to be able to look at the running timer. I thought I could create a new frame, but when I now click on the timer in the mode-line the .org file is getting opened in the new frame (which is already resized to show only mode-line) instead of jumping back to it in the first frame. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how my mode-line looks (the blue bar) -- that is all I want on the new frame:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Dfhml.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Eventually I will have to figure out how to make the new frame appear always-on-top, but that is outside the scope of this question)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use OS X if that is relevant.&lt;/p&gt;&#xA;" OwnerUserId="2059" LastEditorUserId="2059" LastEditDate="2015-02-04T00:41:44.340" LastActivityDate="2015-02-11T18:22:03.747" Title="Make a new frame with only mode-line" Tags="|mode-line|osx|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7698" PostTypeId="1" CreationDate="2015-01-25T06:40:25.710" Score="2" ViewCount="796" Body="&lt;p&gt;When I tried to &lt;code&gt;org-export&lt;/code&gt; to html file, this message showed up in &lt;strong&gt;Messages&lt;/strong&gt; or &lt;code&gt;minibuffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;htmlize-color-to-rgb: Wrong type argument: stringp, 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;nothing more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually another message showed up before this one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-html-table-cell: Args out of range: [left right right], 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I remember an abnormal place about my table in this file, so I can just search string for the position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this org file contains more than 1000 lines and I don't have clue where and what(even though it mentioned &lt;code&gt;rgb&lt;/code&gt;) is going wrong so it is really hard to check page by page manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-export&lt;/code&gt;-to-html function works successfully for my another org file, failed for this one, but I think it should give more than just one sentence without even mentioning which line causes an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there any variable to turn on for more verbose messages if &lt;code&gt;org-export&lt;/code&gt; fails?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2015-01-25T07:03:35.973" LastActivityDate="2015-01-25T07:03:35.973" Title="How to make org-export give more messages when it fails" Tags="|org-export|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7699" PostTypeId="2" ParentId="7694" CreationDate="2015-01-25T08:19:29.933" Score="10" Body="&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: I created &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor&quot; rel=&quot;noreferrer&quot;&gt;Semantic Refactor&lt;/a&gt; package that completely solves this problem and more. You can look at &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor/blob/master/srefactor-demos/demos.org&quot; rel=&quot;noreferrer&quot;&gt;the demos&lt;/a&gt; to see how it works. The remaining text of this answer, after this sentence, is old and put it there just for historical reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OLD ANSWER&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;senator-copy-tag&lt;/code&gt; for accurately copy function signature, then paste back in your source file. &lt;code&gt;senator-copy-tag&lt;/code&gt; and Senator commands are available when you enable &lt;code&gt;semantic-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(semantic-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Semantic is an Emacs built-in package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can combine Semantic Senator with Projectile into a command to insert function prototype into other file (file with the same name but different extension) from anywhere in your project. If there's only one other file, the command inserts immediately into that file; if more than one, you are prompted to select a file; if there's none, you are prompted for the entire files in your project. After you select a file, a prompt offers a list of Semantic tags in the current buffer that you can choose to insert after. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I submitted &lt;a href=&quot;https://github.com/chrisbarrett/emacs-refactor/pull/5&quot; rel=&quot;noreferrer&quot;&gt;a PR&lt;/a&gt; to &lt;a href=&quot;https://github.com/chrisbarrett/emacs-refactor&quot; rel=&quot;noreferrer&quot;&gt;Emacs Refactor&lt;/a&gt;. Full code if you want to try without waiting for the PR: &lt;a href=&quot;http://pastebin.com/6T9L5kQ1&quot; rel=&quot;noreferrer&quot;&gt;click here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a demo (it starts when you see &lt;code&gt;START DEMO&lt;/code&gt; at the bottom):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iJiCd.gif&quot; alt=&quot;projectile-semantic-insert-function-prototype&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use only Senator to copy and function prototype. As long as point is anywhere inside the function signature or function body, run &lt;code&gt;senator-copy-tag&lt;/code&gt;, which is bound to &lt;code&gt;C-c , M-w&lt;/code&gt; by default, it copies the whole function: both the signature and body. However, you can paste only the signature if you want by running the command &lt;code&gt;senator-yank-tag&lt;/code&gt;, which is bound to &lt;code&gt;C-c , C-y&lt;/code&gt; by default. Pressing &lt;code&gt;C-y&lt;/code&gt; paste the whole function signature along with its body. &lt;code&gt;senator-copy-tag&lt;/code&gt; even works with function signature expanded on multiple lines like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void &#xA;func(int a,&#xA;     int b, &#xA;     int c)&#xA;{&#xA;    .....&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although this approach does not insert directly into buffer with the same name, it is more applicable in other cases. Your use case only works if you have two file in the same directory and with the same name but different extensions. What if the function declaration and function definition must stay in different files with different names?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT2&lt;/strong&gt;: Here is an example for smart insertion of function prototype using Semantic tags. Currently, you can only insert based on the relative positions (&quot;before&quot; and &quot;after&quot;) of top level Semantic tags. I will update to make user to be able to insert in any place where Semantic tags are available, with more positions (i.e. when a tag is a &lt;code&gt;Class&lt;/code&gt;, it should offer additional positions: &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;projected&lt;/code&gt; and &lt;code&gt;private&lt;/code&gt;). The demo starts when you see &lt;code&gt;START DEMO&lt;/code&gt; at the bottom:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/n2sjX.gif&quot; alt=&quot;projectile-semantic-insert-function-prototype2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;: If you want to generate a list of empty function definitions in a &lt;code&gt;.cpp&lt;/code&gt; file from a header file, use &lt;a href=&quot;http://www.emacswiki.org/emacs/ExpandMemberFunctions&quot; rel=&quot;noreferrer&quot;&gt;member-functions.el&lt;/a&gt;. But soon, I will replace it with Semantic + Projectile.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="304" LastEditDate="2016-02-27T17:12:36.110" LastActivityDate="2016-02-27T17:12:36.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7700" PostTypeId="1" CreationDate="2015-01-25T11:17:10.747" Score="2" ViewCount="108" Body="&lt;p&gt;I've just discovered that this file (written by Gnus) is almost 50 MB big.  I don't need my mail archived locally.  How can I tell Gnus not to save it there? (Or, maybe, if possible, for only a very short time, like a week or so).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked here: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Mail-Source-Customization.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/gnus/Mail-Source-Customization.html&lt;/a&gt; but this doesn't answer the question.  From this I can't understand what exactly is stored in this file, and whether it's ok to delete it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. I also don't want to store outgoing mail there, in case it's stored there.  I.e. I don't want Gnus to ever store any mail on my computer for longer than a few days (but would chose not to store it at all if I had to).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's an update: I tried, at first, to truncate the file (i.e. &lt;code&gt;echo '' &amp;gt; ./.emacs-mail-crash-box&lt;/code&gt;), which caused some bizarre problems, and Gnus wouldn't connect. But completely removing this file let Gnus connect to my GMail account. I didn't investigate the problem though. The symptoms were these: after starting Gnus it would hang for a while, and when interrupted it would give a message related to missing &lt;code&gt;'*nnir-something*&lt;/code&gt; but grepping the source code I couldn't find where the message was coming from.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-03-06T20:09:04.653" LastActivityDate="2015-03-06T20:09:04.653" Title="Can I safely clean up the .emacs-mail-crash-box and how not to store mail localy?" Tags="|gnus|email|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7701" PostTypeId="2" ParentId="7697" CreationDate="2015-01-25T13:24:23.013" Score="5" Body="&lt;p&gt;This is the best I could come up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (generate-new-buffer &quot;*empty*&quot;)&#xA;  (make-frame '((minibuffer . nil)&#xA;                (unsplittable . t)&#xA;                (buffer-predicate . (lambda (x) nil))&#xA;                (height . 2)&#xA;                (left-fringe . 0)&#xA;                (right-fringe . 0)&#xA;                (tool-bar-lines . 0)&#xA;                (menu-bar-lines . 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not see a way to disable at least one window with one buffer there, but the one displayed using this snippet is not associated with any file. The &lt;code&gt;buffer-predicate&lt;/code&gt; there prevents the frame from being chosen to display any (other) buffers, so if you can deal with one extra empty line, this should do it.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2015-01-25T13:24:23.013" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7702" PostTypeId="1" AcceptedAnswerId="7703" CreationDate="2015-01-25T14:35:20.197" Score="1" ViewCount="336" Body="&lt;p&gt;Is there a build-in variable which saves the current character at which the cursor is positioned on?  &lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-01-25T14:57:38.657" Title="Which variable gives the value of the current character?" Tags="|cursor|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7703" PostTypeId="2" ParentId="7702" CreationDate="2015-01-25T14:57:38.657" Score="4" Body="&lt;p&gt;You can use the &lt;code&gt;char-after&lt;/code&gt; or &lt;code&gt;following-char&lt;/code&gt; function to know what's the character under the cursor (or after the point). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Near-Point.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Examing Text Under Point&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Remember that point is always between characters, and the cursor normally appears over the character following point. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-25T14:57:38.657" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7705" PostTypeId="1" AcceptedAnswerId="7707" CreationDate="2015-01-25T16:32:40.613" Score="1" ViewCount="542" Body="&lt;p&gt;Assume that I have mistakenly written &lt;code&gt;$\signa$&lt;/code&gt; instead of &lt;code&gt;$\sigma$&lt;/code&gt; in a &lt;code&gt;TeX&lt;/code&gt; file.&#xA;Considering the fact that all correct math commands are stored in the file &lt;code&gt;latex.el&lt;/code&gt; under &lt;code&gt;LaTeX-math-default&lt;/code&gt; constants, is it possible that Emacs detect this error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely is it possible that Emacs detects that &lt;code&gt;\signa&lt;/code&gt; does not belong to the list of commands in &lt;code&gt;latex.el&lt;/code&gt; under &lt;code&gt;LaTeX-math-default&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously after compiling the &lt;code&gt;tex&lt;/code&gt; file, one can discover this error. But my question is about the detection of this error at Emacs level. Also assume that &lt;code&gt;ispell&lt;/code&gt; is not at disposal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edited: After the comment of Giordano let me make it precise that I am interested in checking the correctness of a single math command not the entire document. Defining a function which detects that &lt;code&gt;\signa&lt;/code&gt; does not belong to the list of commands provided by &lt;code&gt;Latex-math-default&lt;/code&gt; when the cursor is at &lt;code&gt;\signa&lt;/code&gt; would be perfect.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-26T10:18:54.397" LastActivityDate="2015-01-26T10:18:54.397" Title="Detection of a LaTeX math syntax error at Emacs level" Tags="|latex|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7706" PostTypeId="1" AcceptedAnswerId="7708" CreationDate="2015-01-25T18:45:38.807" Score="1" ViewCount="434" Body="&lt;p&gt;I'm trying to switch to &lt;a href=&quot;https://github.com/donderom/jazz-theme&quot; rel=&quot;nofollow noreferrer&quot;&gt;another Emacs theme&lt;/a&gt;, and I noticed I had several hard coded color strings which I used with my previous theme. I'm looking for a way to use &lt;code&gt;:inherit&lt;/code&gt; and thus have those hard coded strings in one place.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(make-face 'me/header-face)&#xA;(set-face-attribute 'me/header-face nil&#xA;                    :background 'unspecified :foreground solarized/blue&#xA;                    :italic nil :underline nil :weight 'bold)&#xA;&#xA;(set-face-attribute 'helm-source-header nil :inherit 'me/header-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But some additonnal style is being applied to &lt;code&gt;'helm-source-header&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2FhAs.png&quot; alt=&quot;emacs.header-face&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that the Solarized theme applies his own attributes. How do I tell I only want my own definitions ?&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2642" LastEditDate="2015-01-25T23:20:53.797" LastActivityDate="2015-02-07T09:33:58.117" Title="Trying to refactor the code where I customize faces" Tags="|themes|faces|" AnswerCount="2" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="7707" PostTypeId="2" ParentId="7705" CreationDate="2015-01-25T20:07:59.203" Score="2" Body="&lt;p&gt;You can get the symbol the point is on using &lt;code&gt;symbol-at-point&lt;/code&gt;.  Then just check if it is &lt;code&gt;LaTeX-math-default&lt;/code&gt;.  There are various ways to do the test, but you have to deal with the fact that &lt;code&gt;LaTeX-math-default&lt;/code&gt; is list of 4-tuples and you only care about the second element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's one way to do it.  It returns &lt;code&gt;nil&lt;/code&gt; if the symbol is not in the the list and the element otherwise.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-latex-symbol-at-point ()&#xA;  (interactive)&#xA;  (let ((sym (symbol-at-point)))&#xA;    (TeX-member sym LaTeX-math-default&#xA;            (lambda (a b)&#xA;              (string= a (nth 1 b))))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course this will fail on any custom commands you've defined or that are in packages you've loaded. You're likely to see a lot of spurious errors in a complex document.  Like other commenters mentioned, this is what &lt;code&gt;flycheck&lt;/code&gt; is for.  Install it with &lt;code&gt;M-x package-install flycheck&lt;/code&gt; and turn it on with &lt;code&gt;M-x flycheck-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-01-25T20:07:59.203" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7708" PostTypeId="2" ParentId="7706" CreationDate="2015-01-26T03:41:27.630" Score="0" Body="&lt;p&gt;In the same buffer as the screenshot you provide, toggle off each of the attributes you don't want and save it. In your case, you should toggle off everything but the &lt;code&gt;inherit&lt;/code&gt; item. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;customize&lt;/code&gt; interface always gives priority to user customizations. So, the theme's definition will be overriden by yours for that specific face. In fact, even if you later change to another theme which applies different attributes to that face, your saved customization will still take precedence. &lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-01-26T04:29:56.453" LastActivityDate="2015-01-26T04:29:56.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7709" PostTypeId="1" AcceptedAnswerId="7714" CreationDate="2015-01-26T04:04:34.227" Score="8" ViewCount="2349" Body="&lt;p&gt;I'd like to tag or else mark a subtree as on the &quot;backburner&quot; and exclude the subtree (and its children) from all agenda views, e.g. agenda, to do, match list, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically this would replicate the functionality of the &lt;code&gt;:ARCHIVE:&lt;/code&gt; tag, except I already use that tag for archiving, and it appears that &lt;code&gt;org-archive-tag&lt;/code&gt; does not accept multiple strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TODO: TODO | DONE&#xA;#+TODO: WAIT BURN | CANC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows me to exclude a single subtree, but not its children, so it's not particularly useful for sending a whole project to the backburner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas or alternate workflows I might try for putting projects on the backburner?&lt;/p&gt;&#xA;" OwnerUserId="2697" LastActivityDate="2015-01-26T12:25:05.123" Title="Org Mode exclude subtree from agenda views" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7710" PostTypeId="1" AcceptedAnswerId="7711" CreationDate="2015-01-26T09:39:39.643" Score="6" ViewCount="295" Body="&lt;p&gt;I have a number of variables that store useful state that would be nice to persist across restarts of Emacs. Are there any libraries that allow this to be done simply so I can avoid a bunch of boilerplate for each variable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've considered the customise framework but that implies putting everything in one file and it would be nice to specify a specific state file for a given set of variables so they can easily be blown away when required.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-05-09T20:27:41.180" Title="Are there any libraries in Emacs or the wider package system for automatically persisting variables" Tags="|variables|history-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7711" PostTypeId="2" ParentId="7710" CreationDate="2015-01-26T10:33:10.407" Score="4" Body="&lt;p&gt;The &lt;code&gt;savehist&lt;/code&gt; library provides one option for persisting variable values across sessions. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;savehist&quot;&#xA;  '(add-to-list 'savehist-additional-variables 'foo))&#xA;&#xA;(savehist-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As with &lt;code&gt;customize&lt;/code&gt;, that's writing everything to a single specific file. But there's no reason why you couldn't leverage this library's functionality by let-binding the relevant vars to save and load specific sets of values.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-01-26T10:33:10.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7712" PostTypeId="1" AcceptedAnswerId="7713" CreationDate="2015-01-26T10:35:50.737" Score="13" ViewCount="3554" Body="&lt;p&gt;Is it possible to assign multiple return values directly to variables without going through a temporary variable in Emacs Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say I have a function that returns a list of two lists:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun test-func ()&#xA;  (setq a '(a b))&#xA;  (setq b '(c d))&#xA;  `(,a ,b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I want to assign the first return value to &lt;code&gt;list-a&lt;/code&gt; and the second return value to &lt;code&gt;list-b&lt;/code&gt;, I can do this by using a temporary variable &lt;code&gt;temp&lt;/code&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((temp (test-func)) (list-a (car temp)) (list-b (cadr temp)))&#xA;  (message-box (prin1-to-string list-a))&#xA;  (message-box (prin1-to-string list-b)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do this more simply? (I am used to Perl and Python where you do not have to specify a temporary variable)&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="105" LastEditDate="2018-07-07T03:23:56.373" LastActivityDate="2018-07-09T16:03:01.317" Title="Bind multiple values directly from list without binding the list itself" Tags="|let-binding|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7713" PostTypeId="2" ParentId="7712" CreationDate="2015-01-26T11:37:34.767" Score="8" Body="&lt;p&gt;Common Lisp has a special facility - &lt;a href=&quot;https://stackoverflow.com/a/22796346/850781&quot;&gt;multiple values&lt;/a&gt;, and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/Overview.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Lisp compatibility library&lt;/a&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/cl/Multiple-Values.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;emulates them using lists&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus you can do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-fun ()&#xA;  (let ((a 1) (b 2))&#xA;    (cl-values a b)))&#xA;&#xA;(cl-multiple-value-bind (a b) (test-fun)&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(load &lt;code&gt;cl-lib&lt;/code&gt; and use the &lt;code&gt;cl-&lt;/code&gt; prefix for all CL functionality in EL).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB&lt;/strong&gt;: if you look at the SO answer linked above, you will see that emulating MV with lists is, to put it mildly, suboptimal (see also @Stefan's comment below).&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2018-07-09T16:03:01.317" LastActivityDate="2018-07-09T16:03:01.317" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="7714" PostTypeId="2" ParentId="7709" CreationDate="2015-01-26T12:14:18.553" Score="11" Body="&lt;p&gt;You can achieve what you want by adding the &lt;a href=&quot;http://orgmode.org/manual/Comment-lines.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;COMMENT&lt;/code&gt; keyword&lt;/a&gt; to any subtree you don't want to see in the agenda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO I will show up in the agenda    &#xA;* COMMENT TODO I won't show up in the agenda&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;C-c ;&lt;/kbd&gt; (&lt;code&gt;org-toggle-comment&lt;/code&gt;) from anywhere inside a subtree to add (or remove) the &lt;code&gt;COMMENT&lt;/code&gt; keyword.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this works for more complex outlines as well, i.e., if a subtree has the &lt;code&gt;COMMENT&lt;/code&gt; keyword set, its children will also be excluded from the agenda. There is no need to comment out subtrees whose parents carry the &lt;code&gt;COMMENT&lt;/code&gt; keyword.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-26T12:25:05.123" LastActivityDate="2015-01-26T12:25:05.123" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7715" PostTypeId="1" AcceptedAnswerId="7726" CreationDate="2015-01-26T13:10:50.583" Score="1" ViewCount="23132" Body="&lt;p&gt;The regular expression &lt;code&gt;\ws\|l\|d&lt;/code&gt; matches all words containing at least one of the letters &lt;code&gt;s&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt; and &lt;code&gt;d&lt;/code&gt;. What is the correct syntax to match all words containing all these letters? (like solid, dollars, etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the following cheat sheet on &lt;a href=&quot;http://www.emacswiki.org/emacs/RegularExpression&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/RegularExpression&lt;/a&gt; but I cannot find the &lt;code&gt;AND&lt;/code&gt; operation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  .        any character (but newline)&#xA;  *        previous character or group, repeated 0 or more time&#xA;  +        previous character or group, repeated 1 or more time&#xA;  ?        previous character or group, repeated 0 or 1 time  &#xA;  ^        start of line&#xA;  $        end of line&#xA;  [...]    any character between brackets&#xA;  [^..]    any character not in the brackets&#xA;  [a-z]    any character between a and z&#xA;  \        prevents interpretation of following special char&#xA;  \|       or&#xA;  \w       word constituent&#xA;  \b       word boundary&#xA;  \sc      character with c syntax (e.g. \s- for whitespace char)&#xA;  \( \)    start\end of group&#xA;  \&amp;lt; \&amp;gt;    start\end of word&#xA;  \_&amp;lt; \_&amp;gt;  start\end of symbol&#xA;  \` \'    start\end of buffer\string&#xA;  \1       string matched by the first group&#xA;  \n       string matched by the nth group&#xA;  \{3\}    previous character or group, repeated 3 times&#xA;  \{3,\}   previous character or group, repeated 3 or more times&#xA;  \{3,6\}  previous character or group, repeated 3 to 6 times&#xA;  \=       match succeeds if it is located at point&#xA;&#xA;  \ca      ascii character&#xA;  \Ca      non-ascii character (newline included)&#xA;  \cl      latin character&#xA;  \cg      greek character&#xA;&#xA;  [:digit:]  a digit, same as [0-9]&#xA;  [:alpha:]  a letter (an alphabetic character)&#xA;  [:alnum:]  a letter or adigit (an alphanumeric character ()&#xA;  [:upper:]  a letter in uppercase&#xA;  [:space:]  a whitespace character, as defined by the syntax table&#xA;  [:xdigit:] an hexadecimal digit&#xA;  [:cntrl:]  a control character&#xA;  [:ascii:]  an ascii character&#xA;&#xA;  \s-   whitespace character        \s/   character quote character&#xA;  \sw   word constituent            \s$   paired delimiter         &#xA;  \s_   symbol constituent          \s'   expression prefix        &#xA;  \s.   punctuation character       \s&amp;lt;   comment starter          &#xA;  \s(   open delimiter character    \s&amp;gt;   comment ender            &#xA;  \s)   close delimiter character   \s!   generic comment delimiter&#xA;  \s&quot;   string quote character      \s|   generic string delimiter &#xA;  \s\   escape character            &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-26T13:34:50.610" LastActivityDate="2015-01-27T10:04:29.880" Title="regular expressions: matching all words containing a specific list of letters" Tags="|regular-expressions|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7716" PostTypeId="2" ParentId="7715" CreationDate="2015-01-26T13:21:52.357" Score="1" Body="&lt;p&gt;There is no &quot;and&quot; operation in regexps.  You'd have to write a regexp with six alternatives for the possible orders:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;words containing S, L and D&lt;/li&gt;&#xA;&lt;li&gt;words containing S, D and L&lt;/li&gt;&#xA;&lt;li&gt;words containing L, S and D&lt;/li&gt;&#xA;&lt;li&gt;words containing L, D and S&lt;/li&gt;&#xA;&lt;li&gt;words containing D, L and S&lt;/li&gt;&#xA;&lt;li&gt;words containing D, S and L&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-01-26T13:21:52.357" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7717" PostTypeId="2" ParentId="7195" CreationDate="2015-01-26T14:32:14.287" Score="0" Body="&lt;p&gt;Below is the code I use.  It is simple and covers 99% of the cases.  It is only missing dealing abbreviations, such as &quot;A. U. Thor&quot; or &quot;Mrs.&quot;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-two-spaces-per-sentence ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;  (replace-regexp &quot;\\([\\.\\|\\?\\|!]\\) \\([A-Z][a-z]*\\)&quot; &quot;\\1  \\2&quot;&#xA;                  nil&#xA;                  (if (region-active-p) (region-beginning) (point-min))&#xA;                  (if (region-active-p) (region-end) (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-01-26T14:32:14.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7718" PostTypeId="2" ParentId="7710" CreationDate="2015-01-26T14:44:48.650" Score="5" Body="&lt;p&gt;Load library &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; and use a &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#FunctionSequenceVarlistBookmarks&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;em&gt;variable-list&lt;/em&gt;&lt;/strong&gt; bookmark&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A variable-list bookmark saves and restores the values of a set of variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;bmkp-set-variable-list-bookmark&lt;/code&gt; &#xA;prompts you for the variables to include in the list and then sets the bookmark. Non-interactively, you can use function &lt;code&gt;bmkp-create-variable-list-bookmark&lt;/code&gt; to create or update a variable-list bookmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;bmkp-jump-variable-list&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;C-x j v&lt;/code&gt;&lt;/strong&gt;) restores the recorded variable values for the bookmark's buffer. You can call also this function non-interactively, of course, including from your init file.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bmkp-jump-variable-list BOOKMARK) ; BOOKMARK is a bookmark name or a bookmark&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:27:41.180" LastActivityDate="2015-05-09T20:27:41.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7719" PostTypeId="2" ParentId="7715" CreationDate="2015-01-26T15:22:34.310" Score="2" Body="&lt;p&gt;Here's one way to implement some equivalent to the &quot;AND&quot;ing of regexp needed for this specific application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The word at point is first character sorted so that &lt;code&gt;dollars&lt;/code&gt; becomes &lt;code&gt;adllors&lt;/code&gt; in a temporary buffer. That temporary sorted string is then matched with &lt;em&gt;occurrence of any optional alphabet followed by &lt;code&gt;d&lt;/code&gt;, followed by any optional alphabet followed by &lt;code&gt;l&lt;/code&gt;, followed by any optional alphabet followed by &lt;code&gt;s&lt;/code&gt;, followed by any optional alphabet.&lt;/em&gt; If that match is true, the word is highlighted, else a message is displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this over the whole buffer, do &lt;code&gt;M-x my/match-word-whole-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/match-word ()&#xA;  &quot;Matches words containing all chars d, l, s in any order: dollars solid &#xA;Match will fail if a word is missing any of those characters. e.g. dollar&quot;&#xA;  (interactive)&#xA;  (let ((this-word (thing-at-point 'word)); get the word at point&#xA;        (match))&#xA;    (with-temp-buffer&#xA;      (insert this-word)&#xA;      (sort-regexp-fields nil &quot;\\w&quot; &quot;\\&amp;amp;&quot; (point-min) (point-max)) ; sort chars in word&#xA;      (beginning-of-buffer)&#xA;      ;; Now that the chars are sorted alphabetically, you can search for&#xA;      ;; the letters in alphabetical order: d, l, s&#xA;      (if (looking-at &quot;\\w*[d]+\\w*[l]+\\w*[s]+\\w*&quot;)&#xA;          (setq match t)&#xA;        (setq match nil)))&#xA;    (when match&#xA;      (highlight-symbol-at-point))))&#xA;&#xA;(defun my/match-word-whole-buffer ()&#xA;  (interactive)&#xA;  (beginning-of-buffer)&#xA;  (forward-word)&#xA;  (while (not (eobp))&#xA;    (when (string-match &quot;\\w\\{3,\\}&quot; (thing-at-point 'word))&#xA;      (my/match-word))&#xA;    (forward-word)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-01-26T16:39:29.173" LastActivityDate="2015-01-26T16:39:29.173" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7720" PostTypeId="2" ParentId="7715" CreationDate="2015-01-26T15:28:47.567" Score="1" Body="&lt;p&gt;If you are OK with calling &lt;code&gt;grep&lt;/code&gt; from Emacs for what you need then the expression could look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in dollars dollar solid; &#xA;do&#xA;  echo &quot;$i&quot; | grep -P '\b\w*(?=\w*l)(?=\w*d)(?=\w*s)\w*\b'&#xA;done;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dollars&#xA;solid&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could, in Emacs, select the interesting region and then &lt;kbd&gt;M-|&lt;/kbd&gt; - this will prompt you for the command to run on the region, and then you could enter the regexp above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the regexp looks puzzling, the idea is that when lookahead (the &lt;code&gt;?=&lt;/code&gt; part) matches it doesn't advance the parser, so it can match multiple times when looking ahead from the same place without consuming any input.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-01-26T16:11:08.990" LastActivityDate="2015-01-26T16:11:08.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7721" PostTypeId="1" AcceptedAnswerId="7725" CreationDate="2015-01-26T16:19:58.247" Score="12" ViewCount="905" Body="&lt;p&gt;How can I make Emacs always display the first line of a file which contains header information (such as a CSV) as I scroll down past where it would usually no longer be visible? &lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2018-08-19T11:16:50.147" Title="Make emacs lock display of the first line of a file" Tags="|csv|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7722" PostTypeId="2" ParentId="7715" CreationDate="2015-01-26T16:29:36.640" Score="1" Body="&lt;p&gt;You say that you &quot;&lt;em&gt;have a file containing a list of all words of a language&lt;/em&gt;&quot; and you &quot;&lt;em&gt;would like to find all words containing some letters (in any order).&lt;/em&gt;&quot; &#xA;Do you want to search the file interactively or by program? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If interactive, consider using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; search, &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;progressively&lt;/em&gt; matching&lt;/a&gt; each letter - the order does not matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;code&gt;C-c ` \w+ RET&lt;/code&gt;&#xA;tells &lt;code&gt;icicle-search&lt;/code&gt; (bond to &lt;code&gt;C-c `&lt;/code&gt;) to use &lt;strong&gt;&lt;em&gt;words&lt;/em&gt;&lt;/strong&gt; as the &lt;em&gt;search contexts&lt;/em&gt;, meaning search only within words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then type the letters to match within each word, separating them by &lt;code&gt;S-SPC&lt;/code&gt;.  For example, to match letters &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;t&lt;/code&gt;, and &lt;code&gt;e&lt;/code&gt; in the same word, you can type &lt;code&gt;h S-SPC t S-SPC e&lt;/code&gt; (or the same letters in any order).  The use of &lt;code&gt;S-SPC&lt;/code&gt; says to match each pattern that it separates (in this case, single letters), progressively narrowing the matches from the previous match.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c ` \w+ RET h S-TAB S-SPC t S-SPC e&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Matches are shown after you use &lt;code&gt;S-TAB&lt;/code&gt; or &lt;code&gt;TAB&lt;/code&gt; (or automatically, if option &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-show-Completions-initially-flag&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-show-Completions-initially-flag&lt;/code&gt;&lt;/a&gt; is non-&lt;code&gt;nil&lt;/code&gt;). If you use &lt;code&gt;S-TAB&lt;/code&gt; before typing any input to match then the matches for empty input are shown immediately, and they include all of the text in each search context - in this case, all of the words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;S-TAB&lt;/code&gt; tells Icicles to use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Apropos_Completions&quot; rel=&quot;nofollow&quot;&gt;apropos matching&lt;/a&gt;, not prefix matching.  In the example above, it is used after typing &lt;code&gt;h&lt;/code&gt;, which means that you want to match &lt;code&gt;h&lt;/code&gt; anywhere within the context (word), not just at its beginning (as a prefix).  (&lt;code&gt;S-SPC&lt;/code&gt; always uses apropos matching for the following input.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default matching mode (apropos or prefix) is controlled by option &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-default-cycling-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-default-cycling-mode&lt;/code&gt;&lt;/a&gt;. The default value of the option is &lt;code&gt;prefix&lt;/code&gt; matching. If you customize it to &lt;code&gt;apropos&lt;/code&gt; instead, then the explicit &lt;code&gt;S-TAB&lt;/code&gt; mentioned above is not needed: you get apropos matching by default.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-01-26T17:11:34.947" LastActivityDate="2015-01-26T17:11:34.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7723" PostTypeId="2" ParentId="7597" CreationDate="2015-01-26T16:36:25.257" Score="5" Body="&lt;p&gt;Using the word &lt;code&gt;COMMENT&lt;/code&gt; at the beginning of a heading prevents the entire subtree from being exported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keyboard shortcut: &lt;code&gt;C-c ;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* COMMENT Second Comment&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;http://orgmode.org/manual/Comment-lines.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Comment-lines.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5321" LastActivityDate="2015-01-26T16:36:25.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7724" PostTypeId="1" AcceptedAnswerId="7727" CreationDate="2015-01-26T17:13:45.250" Score="4" ViewCount="857" Body="&lt;p&gt;Is it possible to open a &lt;a href=&quot;https://en.wikipedia.org/wiki/Comic_book_archive&quot; rel=&quot;nofollow&quot;&gt;CBR&lt;/a&gt; file with Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not asking for a package similar to &lt;a href=&quot;http://sourceforge.net/p/mcomix/wiki/&quot; rel=&quot;nofollow&quot;&gt;MComix&lt;/a&gt;, just a quick way to read the content of a .cbr file.&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2015-01-26T18:44:17.880" Title="Open .cbr files" Tags="|files|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7725" PostTypeId="2" ParentId="7721" CreationDate="2015-01-26T17:15:57.967" Score="14" Body="&lt;p&gt;Make it a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Header-Lines.html&quot;&gt;&lt;strong&gt;header line&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A window can have a header line at the top. It does not scroll out of the window, but remains displayed at the top. I guess that's what you are asking for.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-26T17:15:57.967" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7726" PostTypeId="2" ParentId="7715" CreationDate="2015-01-26T18:11:40.460" Score="2" Body="&lt;p&gt;You're looking for something that can be found by a regexp (a word),&#xA;but which should additionally obey some constraint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case the constraint is a form of subset-relation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun string-subset-p (s1 s2)&#xA;  &quot;Return t, if S1 is a subset of S2, when viewed as char-sets.&quot;&#xA;  (let ((s2-chars (append s2 nil)))&#xA;    (cl-every (lambda (ch)&#xA;                (memq ch s2-chars))&#xA;              (append s1 nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When put together (in the most trivial way):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun search-word-containg-chars-forward (chars)&#xA;  (interactive &quot;sChars: &quot;)&#xA;  (while (and (re-search-forward &quot;\\w+&quot;)&#xA;              (not (string-subset-p chars (match-string 0))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More efficient implementations for the &lt;code&gt;string-subset-p&lt;/code&gt; function are&#xA;left as an exercise to the reader.  Though, chances are, that it won't&#xA;really matter.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-01-27T10:04:29.880" LastActivityDate="2015-01-27T10:04:29.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7727" PostTypeId="2" ParentId="7724" CreationDate="2015-01-26T18:44:17.880" Score="2" Body="&lt;p&gt;Installing &lt;code&gt;unrar-free&lt;/code&gt; (I am on Debian sid) and adding &lt;code&gt;.cbr&lt;/code&gt; to &lt;code&gt;archive-mode&lt;/code&gt; as suggested by lawlist &lt;a href=&quot;https://emacs.stackexchange.com/questions/7724/open-cbr-files#comment11562_7724&quot;&gt;here&lt;/a&gt;, did the trick.&lt;/p&gt;&#xA;" OwnerUserId="219" LastActivityDate="2015-01-26T18:44:17.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7729" PostTypeId="1" AcceptedAnswerId="7730" CreationDate="2015-01-26T19:05:00.883" Score="5" ViewCount="1914" Body="&lt;p&gt;When typing &lt;code&gt;ls&lt;/code&gt; in my home directory, I amm greeted by a lot of this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#%2Ascratch%2A#1399_po# #%2Ascratch%2A#14484YsZ# [...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have the following in my &lt;code&gt;init.el&lt;/code&gt;&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar autosave-location (concat user-emacs-directory &quot;data/autosave&quot;))&#xA;&#xA;(setq auto-save-file-name-transforms&#xA;  `((&quot;.*&quot; ,autosave-location t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why, then are the scratch autosaves not being sent to &lt;code&gt;~/.emacs.d/data/autosave&lt;/code&gt; and instead are being blasted around my file system? Ideally, I just want it to save to that folder, however if that can't be done, disabling autosave for &lt;code&gt;*scratch*&lt;/code&gt; buffers entirely would suffice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this started with Emacs 24.4.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-01-26T19:27:29.403" Title="Autosave *scratch* to a directory" Tags="|emacs24.4|auto-save|scratch-buffer|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7730" PostTypeId="2" ParentId="7729" CreationDate="2015-01-26T19:27:29.403" Score="5" Body="&lt;p&gt;You'll notice that you're using a variable called &lt;code&gt;auto-save-file-name-transforms&lt;/code&gt;. Since &lt;code&gt;*scratch*&lt;/code&gt; has no filename, it falls back to autosaving in &lt;code&gt;default-directory&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &lt;code&gt;*scratch*&lt;/code&gt; buffer, or any other buffers like this with no filename,  you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local default-directory &quot;~/.emacs.d/data/autosave&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: I see that you don't really care about autosaving scratch buffers. Can I ask how you enable &lt;code&gt;auto-save-mode&lt;/code&gt; in your init? You should use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq-default auto-save-default t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And not something like a hook with &lt;code&gt;(auto-save-mode 1)&lt;/code&gt;, because the variable only enables it for file-visiting buffers, while a hook could potentially enable it for buffers where you don't want it. &lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-01-26T19:27:29.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7731" PostTypeId="1" AcceptedAnswerId="7739" CreationDate="2015-01-26T22:21:21.617" Score="8" ViewCount="1510" Body="&lt;p&gt;I'm working with large, extra wide data files I probably should just be viewing in Excel... but I'd rather stay in Emacs. Is there an elisp function to search (and fontify) just on the current line?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2015-01-27T02:48:52.800" LastActivityDate="2015-01-27T10:54:33.543" Title="How to search *just* the current line" Tags="|search|csv|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7732" PostTypeId="1" AcceptedAnswerId="7737" CreationDate="2015-01-26T23:47:49.813" Score="3" ViewCount="490" Body="&lt;p&gt;&lt;code&gt;auto-complete&lt;/code&gt; automatically adds a number of sources to &lt;code&gt;ac-sources&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(ac-source-features ac-source-functions ac-source-variables ac-source-symbols)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I set up &lt;code&gt;auto-complete&lt;/code&gt; default &lt;code&gt;ac-sources&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(ac-source-yasnippet ac-source-abbrev ac-source-filename ac-source-files-in-current-dir &#xA; ac-source-capf ac-source-gtags ac-source-words-in-same-mode-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I found that some sources listed in &lt;code&gt;ac-sources&lt;/code&gt; complete the same thing. For example, I get the following completions for &lt;code&gt;(setq)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;ac-source-functions&lt;/code&gt; shows: &lt;code&gt;setq f&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ac-source-symbols&lt;/code&gt; shows: &lt;code&gt;setq s&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ac-source-capf&lt;/code&gt; shows: &lt;code&gt;setq s&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ac-source-words-in-same-mode-buffers&lt;/code&gt; shows: &lt;code&gt;setq&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to disable the following sources only in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;: &#xA;&lt;code&gt;ac-source-symbols&lt;/code&gt;, &lt;code&gt;ac-source-capf&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If you know of any other way to solve my problem, please leave a comment. Thanks.)&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="504" LastEditDate="2015-01-27T07:56:54.243" LastActivityDate="2015-02-25T11:21:31.273" Title="How to remove individual sources from auto-complete's ac-sources in a specific major-mode" Tags="|hooks|auto-complete-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7733" PostTypeId="2" ParentId="7731" CreationDate="2015-01-27T02:37:40.293" Score="10" Body="&lt;ul&gt;&#xA;&lt;li&gt;Select the current line ( &lt;code&gt;C-a C-SPC C-e&lt;/code&gt; ) &lt;/li&gt;&#xA;&lt;li&gt;Narrow region ( &lt;code&gt;C-x n n&lt;/code&gt; ) &lt;/li&gt;&#xA;&lt;li&gt;Perform search using any method &lt;/li&gt;&#xA;&lt;li&gt;Go back to the original buffer by widening ( &lt;code&gt;C-x n w&lt;/code&gt; ) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-01-27T02:37:40.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7734" PostTypeId="1" AcceptedAnswerId="7738" CreationDate="2015-01-27T03:20:40.117" Score="7" ViewCount="735" Body="&lt;p&gt;In &lt;code&gt;Makefile&lt;/code&gt; mode, leading spaces are fontified in &lt;code&gt;makefile-space&lt;/code&gt; face (bright pink without customization), when there is no other text on the line. It seems to indicate incomplete lines, and makes sense for that. The color gets back to white when you add proper rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sGhWr.png&quot; alt=&quot;One picture is worth 1k words..&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are leading spaces before comments colored ? Their lines seem to be okay.&lt;/p&gt;&#xA;" OwnerUserId="2047" LastActivityDate="2015-02-06T08:06:31.433" Title="Why are leading spaces colored before comments in makefile-mode?" Tags="|faces|makefile-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7736" PostTypeId="2" ParentId="7732" CreationDate="2015-01-27T08:18:08.387" Score="1" Body="&lt;p&gt;Here is a function that deletes &lt;code&gt;ac-source-symbols&lt;/code&gt; and &lt;code&gt;ac-source-capf&lt;/code&gt; from &lt;code&gt;ac-sources&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ac-remove-sources ()&#xA;  (setq ac-sources (delete 'ac-source-capf ac-sources))&#xA;  (setq ac-sources (delete 'ac-source-symbols ac-sources)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can tell Emacs to run this function for &lt;code&gt;emacs-lisp-mode&lt;/code&gt; buffers by adding it to &lt;code&gt;emacs-lisp-mode-hook&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook 'ac-remove-sources t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that in order to make sure that it overrides the default behavior, you'll need to put this code &lt;em&gt;after&lt;/em&gt; the code that loads the default customizations for &lt;code&gt;auto-complete&lt;/code&gt; in your init-file.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-01-27T08:18:08.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7737" PostTypeId="2" ParentId="7732" CreationDate="2015-01-27T08:25:45.927" Score="0" Body="&lt;p&gt;I found a similar solution:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ac-source-remove (source-removed-list)&#xA;  &quot;Remove some ac-source from ac-sources.&#xA;&#xA;Example:&#xA;(add-hook 'emacs-lisp-mode-hook&#xA;          (lambda ()&#xA;            (ac-source-remove '(ac-source-capf ac-source-symbols))))&quot;&#xA;  (interactive)&#xA;  ;; Use `remq' instead of `delq' which will remove element in global `ac-sources' too.&#xA;  (mapc (lambda (x) (setq-local ac-sources (remq x ac-sources)))&#xA;        source-removed-list))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook&#xA;          (lambda () (ac-source-remove '(ac-source-capf ac-source-symbols))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="504" LastEditDate="2015-02-25T11:21:31.273" LastActivityDate="2015-02-25T11:21:31.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7738" PostTypeId="2" ParentId="7734" CreationDate="2015-01-27T08:48:59.500" Score="9" Body="&lt;p&gt;From make-mode.el, line 395 and forwards (Emacs 24.4.1):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;,@(if space&#xA;  '(;; Highlight lines that contain just whitespace.&#xA;    ;; They can cause trouble, especially if they start with a tab.&#xA;    (&quot;^[ \t]+$&quot; . makefile-space)&#xA;&#xA;    ;; Highlight shell comments that Make treats as commands,&#xA;    ;; since these can fool people.&#xA;    (&quot;^\t+#&quot; 0 makefile-space t)&#xA;&#xA;    ;; Highlight spaces that precede tabs.&#xA;    ;; They can make a tab fail to be effective.&#xA;    (&quot;^\\( +\\)\t&quot; 1 makefconfig.cas.serialile-space)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's a snippet from the function that takes care of syntax highlighting. The middle comment is the reason for the highlighting in the question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is based on the fact that &lt;code&gt;Make&lt;/code&gt; does not treat such lines as comments, but passes them to the shell as commands, and it is up to the shell to treat it as a comment or not, which might be misleading in some cases.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="2047" LastEditDate="2015-02-06T08:06:31.433" LastActivityDate="2015-02-06T08:06:31.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7739" PostTypeId="2" ParentId="7731" CreationDate="2015-01-27T10:54:33.543" Score="8" Body="&lt;p&gt;Isearch is quite flexible and if you become tired of constantly&#xA;narrowing the buffer (as was suggested), you may want to have a&#xA;dedicated command for this, e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-line-forward (&amp;amp;optional regexp-p)&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((beg (line-beginning-position))&#xA;         (end (line-end-position))&#xA;         (isearch-message-prefix-add &quot;[Line]&quot;)&#xA;         (isearch-search-fun-function&#xA;          `(lambda ()&#xA;             (lambda (string &amp;amp;optional bound noerror)&#xA;               (save-restriction&#xA;                 (narrow-to-region ,beg ,end)&#xA;                 (funcall (isearch-search-fun-default)&#xA;                          string bound noerror))))))&#xA;    (isearch-forward regexp-p)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-01-27T10:54:33.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7740" PostTypeId="1" CreationDate="2015-01-27T11:36:25.767" Score="2" ViewCount="195" Body="&lt;p&gt;For personal notes, I create &lt;code&gt;ChangeLog&lt;/code&gt; files of the following format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2015-01-27+0000  Felix E. Klee  &amp;lt;felix.klee@inka.de&amp;gt;&#xA;&#xA;    * Today, I asked my first question on emacs.stackexchange.com:&#xA;&#xA;      - My question is about issues with ChangeLog files.&#xA;&#xA;Local Variables:&#xA;fill-column: 79&#xA;fill-indent-according-to-mode: nil&#xA;coding: utf-8&#xA;add-log-time-format: (lambda () (format-time-string &quot;%Y-%m-%d%z&quot;))&#xA;End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem: After upgrading to version 24.4.1, when I press return at the end&#xA;of &lt;code&gt;files.&lt;/code&gt;, then the line changes identation depth:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    * Today, I asked my first question on emacs.stackexchange.com:&#xA;&#xA;    - My question is about issues with ChangeLog files.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How do I prevent identation from changing in that case?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Already I tried specifying buffer local variables, to no avail:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;adaptive-fill-regexp: &quot;\\s *\\|\\s -&quot;&#xA;paragraph-start: &quot;\\s *$\\|\f\\|^\\&amp;lt;\\|\\s -$&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;FYI after upgrading to Emacs 23, I had another ChangeLog indentation&#xA;&lt;a href=&quot;https://lists.gnu.org/archive/html/help-gnu-emacs/2009-09/msg00738.html&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt;, which IIRC I may have solved by editing &lt;code&gt;changelog-mode&lt;/code&gt; source&#xA;code. I would like to avoid that this time.&lt;/p&gt;&#xA;" OwnerUserId="5327" LastActivityDate="2015-01-27T11:36:25.767" Title="ChangeLog mode indentation breaks when pressing return" Tags="|indentation|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7741" PostTypeId="1" AcceptedAnswerId="10472" CreationDate="2015-01-27T15:27:25.713" Score="2" ViewCount="1658" Body="&lt;p&gt;It seems like cc-mode indentation is working rather well, however I seem to have run into a minor issue when creating a few enums in C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs seems to handle almost all kinds of enums rather well now, even the &quot;enum class&quot; types, however, for some reason the following one seems broken: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Test&#xA;{&#xA;public:&#xA;    enum t1&#xA;    {&#xA;        T0 = 1,&#xA;            T1,   &amp;lt;----- ?&#xA;            T2 = 3&#xA;            };&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Removing the &quot;t1&quot; identifier fixes the &quot;incorrect&quot; indentation, but the identifier is still desirable in some cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the the &quot;correct&quot; indentation would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Test&#xA;{&#xA;public:&#xA;    enum t1&#xA;    {&#xA;        T0 = 1,&#xA;        T1,&#xA;        T2 = 3&#xA;    };&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way of fixing this, and do anyone know if this is the intended behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This occurs with GNU Emacs 25.0.50.4, with accompanying cc-mode. Running with &lt;code&gt;--no-init-file&lt;/code&gt; produces the same results, although with gnu-style indentation.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="50" LastEditDate="2015-04-02T15:34:11.380" LastActivityDate="2015-04-02T16:35:08.293" Title="C++ Incorrect Enum Indentation" Tags="|indentation|c++|cc-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7742" PostTypeId="1" AcceptedAnswerId="7745" CreationDate="2015-01-27T15:45:42.633" Score="14" ViewCount="8526" Body="&lt;p&gt;What is the easiest way to open the folder containing the current file by the default explorer of the OS (e.g. explorer.exe in the case of Windows OS)?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-27T15:50:08.817" LastActivityDate="2022-04-22T14:42:00.620" Title="What is the easiest way to open the folder containing the current file by the default explorer of the OS?" Tags="|files|directories|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7743" PostTypeId="1" AcceptedAnswerId="7755" CreationDate="2015-01-27T15:49:05.310" Score="3" ViewCount="634" Body="&lt;p&gt;In &lt;code&gt;~/.emacs&lt;/code&gt; I've globally enabled &lt;code&gt;whitespace-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'whitespace)&#xA;(setq whitespace-style '(face empty tabs lines-tail trailing))&#xA;(global-whitespace-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example buffer content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- fill-column: 100; whitespace-line-column: nil -*-&#xA;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut&#xA;labore et dolore magna aliquyam erat, sed diam voluptua.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to documentation for &lt;code&gt;whitespace-line-column&lt;/code&gt;: &lt;em&gt;If nil, the `fill-column' variable value is used.&lt;/em&gt; However, that doesn't happen. In the buffer with the above sample content, highlight starts at column 80 (default value):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/befrn.png&quot; alt=&quot;Screenshot with highlight starting at column 80&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I already tried, to no avail:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Enabled &lt;code&gt;whitespace-mode&lt;/code&gt; for that buffer explicitly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Buffer local: &lt;code&gt;whitespace-line-column: 100&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In &lt;code&gt;~/.emacs&lt;/code&gt;: &lt;code&gt;whitespace-line-column: nil&lt;/code&gt;, &lt;code&gt;whitespace-line-column: 100&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Version: &lt;code&gt;GNU Emacs 24.4.1 (i686-pc-mingw32) of 2014-10-24 on LEG570&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I specify line length for &lt;code&gt;whitespace-mode&lt;/code&gt; for an individual buffer?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="5327" LastEditorUserId="5327" LastEditDate="2015-01-28T08:52:29.390" LastActivityDate="2015-01-28T09:38:34.900" Title="whitespace-mode ignores whitespace-line-column" Tags="|whitespace|buffer-local|whitespace-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7744" PostTypeId="2" ParentId="7742" CreationDate="2015-01-27T15:53:14.753" Score="7" Body="&lt;p&gt;For MS Windows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Load library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/w32-browser.el&quot;&gt;&lt;code&gt;w32-browser.el&lt;/code&gt;&lt;/a&gt; and use command &lt;code&gt;w32explore&lt;/code&gt;. It does exactly what you are requesting.  See &lt;a href=&quot;http://www.emacswiki.org/emacs/MsShellExecute&quot;&gt;MS Shell Execute&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you also use &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then &lt;code&gt;M-RET&lt;/code&gt; on a file or dir name in Dired &lt;a href=&quot;http://www.emacswiki.org/emacs/OperatingOnFilesInDired#w32-browser&quot;&gt;opens Windows Explorer&lt;/a&gt; for it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-01-27T15:53:14.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7745" PostTypeId="2" ParentId="7742" CreationDate="2015-01-27T16:13:53.930" Score="16" Body="&lt;p&gt;Using &lt;code&gt;browse-url-of-file&lt;/code&gt; should work when given a directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could implement a command that opens the directory of the current file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun browse-file-directory ()&#xA;  &quot;Open the current file's directory however the OS would.&quot;&#xA;  (interactive)&#xA;  (if default-directory&#xA;      (browse-url-of-file (expand-file-name default-directory))&#xA;    (error &quot;No `default-directory' to open&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;browse-file-directory&lt;/kbd&gt; should open up the directory in your OS's file browser.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-01-27T16:13:53.930" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7746" PostTypeId="1" CreationDate="2015-01-27T17:20:35.540" Score="2" ViewCount="465" Body="&lt;p&gt;I have problems with correct alignment of the closing parenthesis in &lt;code&gt;cperl-mode&lt;/code&gt;. For example consider the following Perl code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-perl prettyprint-override&quot;&gt;&lt;code&gt;my $a = func1(&#xA;    Module::test()&#xA;  );&#xA;&#xA;my $b = func2(&#xA;    test()&#xA;);&#xA;&#xA;my $c = func3(&#xA;    Module::test(),&#xA;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We see that the closing parenthesis is not correctly indented for &lt;code&gt;func1&lt;/code&gt;, but for &lt;code&gt;func2&lt;/code&gt; and &lt;code&gt;func3&lt;/code&gt; it is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;cperl-mode-hook&lt;/code&gt; I have&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq cperl-indent-level 4)&#xA;(setq cperl-indent-parens-as-block t)&#xA;(setq cperl-close-paren-offset -4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the reason for this behavior, and how can I get correct indentation for the closing parenthesis also for &lt;code&gt;func1&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-28T09:36:36.663" Title="How to get correct indentation for the closing parenthesis in cperl-mode?" Tags="|indentation|perl|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7747" PostTypeId="1" AcceptedAnswerId="7751" CreationDate="2015-01-27T21:39:42.770" Score="4" ViewCount="73" Body="&lt;p&gt;Let's assume there is a package &lt;code&gt;P&lt;/code&gt; containing two files,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  P/base.el&#xA;  P/utils.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, where the &lt;code&gt;base.el&lt;/code&gt; file requires &lt;code&gt;utils.el&lt;/code&gt; at runtime and &lt;code&gt;utils.el&lt;/code&gt; contains a macro &lt;code&gt;M&lt;/code&gt;. Upon first installation of &lt;code&gt;P&lt;/code&gt;, package.el downloads, extracts and compiles it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume the package maintainer updated &lt;code&gt;P&lt;/code&gt; to &lt;code&gt;P'&lt;/code&gt; and in the process modified &lt;code&gt;M&lt;/code&gt; to &lt;code&gt;M'&lt;/code&gt;.  The package user now attempts to update his package via package-list. Since &lt;code&gt;P&lt;/code&gt; is a useful package, it is also loaded.  Again package.el downloads and extracts &lt;code&gt;P'&lt;/code&gt;.  But I don't see how the code from the updated macro &lt;code&gt;M'&lt;/code&gt; gets into the compiled file &lt;code&gt;P'/base.el&lt;/code&gt;, since the feature &lt;code&gt;utils.el&lt;/code&gt; is already provided, so, I assume, and the compiler is happy to use the old definition &lt;code&gt;M&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I have about this is simply whether this is a correct analysis ?&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-01-28T05:02:05.960" LastActivityDate="2015-01-28T11:30:20.997" Title="How does package.el handle changes in macros when updating?" Tags="|elisp|package|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7748" PostTypeId="1" AcceptedAnswerId="7749" CreationDate="2015-01-27T23:45:52.367" Score="1" ViewCount="168" Body="&lt;p&gt;I have defined 2 variables as such:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(defconst zenburn/bg-1 &quot;#2B2B2B&quot; &quot;Zenburn palette: bg-1.&quot;)&#xA;(defconst me/helm-header-color zenburn/bg-1 &quot;Custom palette: helm headers.&quot;)&#xA;&#xA;(set-face-attribute 'helm-source-header nil&#xA;                    :background me/helm-header-color&#xA;                    :box '(:line-width 4 :color me/helm-header-color))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The background color is correctly applied but the box's color isn't. It seems I have to specify the raw hex string. Why ?&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2015-01-27T23:52:42.713" Title="Why can't I use a variable when defining the color to draw a box with" Tags="|themes|faces|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7749" PostTypeId="2" ParentId="7748" CreationDate="2015-01-27T23:52:42.713" Score="1" Body="&lt;p&gt;This happens because the quoted list, &lt;code&gt;'(:line-width 4 :color me/helm-header-color)&lt;/code&gt; evaluates to &lt;code&gt;(:line-width 4 :color me/helm-header-color)&lt;/code&gt; not &lt;code&gt;(:line-width 4 :color &quot;2B2B2B&quot;)&lt;/code&gt;. The quote stops &lt;code&gt;me/helm-header-color&lt;/code&gt; from being evaluated.  You can use the a backtick (`) instead to pick which parts get evaluated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'helm-source-header nil&#xA;                    :background me/helm-header-color&#xA;                    :box `(:line-width 4 :color ,me/helm-header-color))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anything inside the back-quoted list that is preceded by a comma will be evaluated.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-01-27T23:52:42.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7750" PostTypeId="1" AcceptedAnswerId="7753" CreationDate="2015-01-28T00:16:02.713" Score="8" ViewCount="697" Body="&lt;p&gt;Let's say I have the following table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name   | Age              | Date of Birth    | Income |&#xA;|--------+------------------+------------------+--------|&#xA;| Joe    |                  | &amp;lt;1984-02-20 Mon&amp;gt; |  84000 |&#xA;| Mark   |                  | &amp;lt;1974-04-15 Mon&amp;gt; | 120000 |&#xA;| Sophie |                  | &amp;lt;1970-08-28 Fri&amp;gt; | 150000 |&#xA;| Anna   |                  | &amp;lt;1988-02-29 Mon&amp;gt; | 160000 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the second column to be the amount of years elapsed since the date in the third column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't figure out how to do this with the TBLFM settings.&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2015-01-28T06:09:14.270" Title="org-mode : in a table, calculate a person's age based on their birthday" Tags="|org-mode|org-table|formula|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7751" PostTypeId="2" ParentId="7747" CreationDate="2015-01-28T01:22:32.953" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;But I don't see how the code from the updated macro M' gets into the compiled file P'/base.el, since the feature utils.el is already provided, [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It doesn't. Or, actually, it &lt;strong&gt;didn't&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The bug&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Your analysis is correct. &#xA;It was &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00567.html&quot; rel=&quot;nofollow&quot;&gt;a bug&lt;/a&gt; in &lt;code&gt;package.el&lt;/code&gt;, and it's &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-diffs/2014-12/msg00254.html&quot; rel=&quot;nofollow&quot;&gt;been fixed&lt;/a&gt; on &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c13baa10d55ec863d3ceaea48c6b2959ece98198&quot; rel=&quot;nofollow&quot;&gt;this commit&lt;/a&gt; for the next Emacs release. As of&#xA;the next version, when &lt;code&gt;package.el&lt;/code&gt; upgrades a package that has been&#xA;loaded in this session, it will reload a package after installing it.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The workaround&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;One workaround is to &lt;code&gt;load&lt;/code&gt; a package instead of &lt;code&gt;require&lt;/code&gt;ing it.&#xA;Though this is bad style, I would consider it an acceptable&#xA;compromise, if you &lt;em&gt;know&lt;/em&gt; you'll be affected by this.&lt;br&gt;&#xA;You know you'll be affected by this if your package is about to make&#xA;use of a newly released feature of a pre-existing macro that's on another file (or another package).&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-01-28T11:30:20.997" LastActivityDate="2015-01-28T11:30:20.997" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7752" PostTypeId="1" AcceptedAnswerId="7777" CreationDate="2015-01-28T01:48:32.677" Score="1" ViewCount="296" Body="&lt;p&gt;I want to modify the region's foreground regardless of syntax highlighting.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'region nil :foreground &quot;#656555&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this is what I get (see sample):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VvxYW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;=&lt;/kbd&gt; gives:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;             position: 483 of 1807 (27%), column: 0&#xA;            character: ( (displayed as () (codepoint 40, #o50, #x28)&#xA;    preferred charset: ascii (ASCII (ISO646 IRV))&#xA;code point in charset: 0x28&#xA;               script: latin&#xA;               syntax: ()   which means: open, matches )&#xA;             category: .:Base, a:ASCII, l:Latin, r:Roman&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #x28&#xA;            file code: #x28 (encoded by coding system prefer-utf-8-unix)&#xA;              display: by this font (glyph code)&#xA;    mac-ct:-*-Monaco-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1 (#x0B)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: LEFT PARENTHESIS&#xA;  old-name: OPENING PARENTHESIS&#xA;  general-category: Ps (Punctuation, Open)&#xA;  decomposition: (40) ('(')&#xA;&#xA;There is an overlay here:&#xA; From 483 to 623&#xA;  face                 region&#xA;  priority             (nil . 100)&#xA;  window               #&amp;lt;window 3 on init-theme.el&amp;gt;&#xA;&#xA;&#xA;There are text properties here:&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2015-01-28T03:15:38.837" LastActivityDate="2015-01-29T03:29:20.337" Title="Face color attribute incorrectly applied" Tags="|themes|faces|" AnswerCount="1" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="7753" PostTypeId="2" ParentId="7750" CreationDate="2015-01-28T06:09:14.270" Score="9" Body="&lt;p&gt;Is it something like the example below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name   | Age          | Date of Birth    | Income |&#xA;|--------+--------------+------------------+--------|&#xA;| Joe    | 30 years old | &amp;lt;1984-02-20 Mon&amp;gt; |  84000 |&#xA;| Mark   | 40 years old | &amp;lt;1974-04-15 Mon&amp;gt; | 120000 |&#xA;| Sophie | 44 years old | &amp;lt;1970-08-28 Fri&amp;gt; | 150000 |&#xA;| Anna   | 26 years old | &amp;lt;1988-02-29 Mon&amp;gt; | 160000 |&#xA;#+TBLFM: $2=(now()-$3)/365;%d years old&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-28T06:09:14.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7754" PostTypeId="2" ParentId="7746" CreationDate="2015-01-28T07:22:39.193" Score="1" Body="&lt;p&gt;It seems like this behavior is related to the newest version of &lt;code&gt;cperl-mode&lt;/code&gt;. I am using Emacs 24.4 on Ubuntu 14.04, and the &lt;code&gt;cperl-mode&lt;/code&gt; that came with the installation (&lt;code&gt;/opt/emacs24.4/share/emacs/24.4/lisp/progmodes/cperl-mode.el.gz&lt;/code&gt;) is version 6.1 of &lt;code&gt;cperl-mode&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then tried to install &lt;code&gt;cperl-mode&lt;/code&gt; from ELPA using Emacs 24.4 package manager (&lt;code&gt;list-packages&lt;/code&gt;), and it turned out that it gave me version 5.23 of &lt;code&gt;cperl-mode&lt;/code&gt; which also indented the closing parenthesis correctly.. &lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-28T07:22:39.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7755" PostTypeId="2" ParentId="7743" CreationDate="2015-01-28T08:21:13.023" Score="7" Body="&lt;p&gt;First off, since you didn't mention it: Using the same version of Emacs (24.4.1), the behavior you describe can be reproduced in &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, what you are doing &lt;em&gt;should&lt;/em&gt; work (AFAICT). It seems that turning on &lt;code&gt;whitespace-mode&lt;/code&gt; globally (or even in a mode hook) &lt;em&gt;before&lt;/em&gt; visiting a file with a custom &lt;code&gt;whitespace-line-column&lt;/code&gt; is what's causing the problem. You might want to consider reporting the issue to the Emacs devs via &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you can get the behavior you want by doing the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Change your config to&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'whitespace)&#xA;(setq whitespace-style '(face empty tabs lines-tail trailing))&#xA;(add-hook 'hack-local-variables-hook 'whitespace-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Change headers of any files that should use a custom &lt;code&gt;whitespace-line-column&lt;/code&gt; to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- whitespace-line-column: 100; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-01-28T09:38:34.900" LastActivityDate="2015-01-28T09:38:34.900" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7756" PostTypeId="1" CreationDate="2015-01-28T09:31:48.213" Score="2" ViewCount="1543" Body="&lt;p&gt;Suppose I have a section in a file which is in csv form, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     a1, bbb1,  cc1, ddd1,  ee1&#xA;    aa2,   b2, ccc2,  dd2,   e2&#xA;   aaa3,  bb3,   c3,   d3,  ee3&#xA;    aa4,   b4,  cc4, ddd4, eee4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, suppose I want to replace an entire column, say one of the a's, b's, c's, d's, e's with the same value. To make this a little more general, assume I want to do this for any delimiter, not just comma. So, it might be a space or some other character as delimiter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I want to do this interactively, treating that section of the file as a region using emacs point and mark. I'd also prefer to do this without the assistance of a package. Are there any good approaches using just the standard tools in Emacs? I'm using Emacs 24.3, but I don't want a method that is very version-sensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OPTIONAL EXTRA: To make this even more general, if one could use the same method to replace an entire row with the same value, that would be even better.&lt;/p&gt;&#xA;" OwnerUserId="100" LastEditorUserId="100" LastEditDate="2015-01-28T13:36:47.243" LastActivityDate="2015-01-28T21:36:05.790" Title="Replacing columns in a delimited region of a file" Tags="|text-editing|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7758" PostTypeId="2" ParentId="7742" CreationDate="2015-01-28T09:42:45.153" Score="0" Body="&lt;p&gt;copy the full path to the clipboard at first:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; you need install xsel under Linux&#xA;;; xclip has some problem when copying under Linux&#xA;(defun copy-yank-str (msg &amp;amp;optional clipboard-only)&#xA;  (unless clipboard-only (kill-new msg))&#xA;  (cond&#xA;   ;; display-graphic-p need windows 23.3.1&#xA;   ((and (display-graphic-p) x-select-enable-clipboard)&#xA;    (x-set-selection 'CLIPBOARD msg))&#xA;   (t (with-temp-buffer&#xA;        (insert msg)&#xA;        (shell-command-on-region (point-min) (point-max)&#xA;                                 (cond&#xA;                                  ((eq system-type 'cygwin) &quot;putclip&quot;)&#xA;                                  ((eq system-type 'darwin) &quot;pbcopy&quot;)&#xA;                                  (t &quot;xsel -ib&quot;)))))))&#xA;&#xA;(defun cp-fullpath-of-current-buffer ()&#xA;  &quot;copy full path into the yank ring and OS clipboard&quot;&#xA;  (interactive)&#xA;  (when buffer-file-name&#xA;    (copy-yank-str (file-truename buffer-file-name))&#xA;    (message &quot;file full path =&amp;gt; clipboard &amp;amp; yank ring&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="160" LastEditDate="2017-02-20T14:21:51.903" LastActivityDate="2017-02-20T14:21:51.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7759" PostTypeId="2" ParentId="7741" CreationDate="2015-01-28T09:48:53.380" Score="0" Body="&lt;p&gt;check &lt;a href=&quot;http://blog.binchen.org/posts/ccjava-code-indentation-in-emacs.html&quot; rel=&quot;nofollow&quot;&gt;http://blog.binchen.org/posts/ccjava-code-indentation-in-emacs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply put, Emacs will assign indention according to the &lt;strong&gt;c-syntax-context&lt;/strong&gt; which is the key to query global tree &lt;strong&gt;c-offsets-alist&lt;/strong&gt;, the query result is the indention offset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you need hack the function c-indent-line which is defined in /usr/share/emacs/24.3/lisp/progmodes/cc-cmds.el to print out the actual value of c-syntax-context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I mentioned in the article, &quot;M-x c-set-offset&quot; will also print the context. The reason I don't use it because it's &lt;strong&gt;NOT&lt;/strong&gt; reliable. There is nothing more reliable than hacking the actual code.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-02-01T05:21:14.310" LastActivityDate="2015-02-01T05:21:14.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7760" PostTypeId="2" ParentId="7756" CreationDate="2015-01-28T12:23:19.877" Score="1" Body="&lt;p&gt;If you were using Emacs 24.4, I might recommend doing this with &lt;code&gt;rectangle-mark-mode&lt;/code&gt; (&lt;code&gt;C-x SPC&lt;/code&gt;), &lt;code&gt;kill-ring-save&lt;/code&gt; (&lt;code&gt;M-w&lt;/code&gt;) and &lt;code&gt;kill-region&lt;/code&gt; (&lt;code&gt;C-w&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With earlier versions, you could take largely the same approach by using CUA mode's rectangular selection and replacement tools. However, this is also pretty easy to do with a keyboard macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also switch modes to org mode, and convert the region to a table, make your manipulations and  export it back to CSV. Just select the whole table and execute &lt;code&gt;org-table-convert-region&lt;/code&gt;. This should work no matter the alignment. You can use &lt;code&gt;M-&amp;lt;arrow keys&amp;gt;&lt;/code&gt; to move columns around, and &lt;code&gt;M-S-left&lt;/code&gt; to delete a column completely. See &lt;a href=&quot;http://orgmode.org/manual/Built_002din-table-editor.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for working with org tables.&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2015-01-28T14:58:08.680" LastActivityDate="2015-01-28T14:58:08.680" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7761" PostTypeId="1" CreationDate="2015-01-28T14:09:12.150" Score="7" ViewCount="3781" Body="&lt;p&gt;Is there a way to use the Apple command key in Emacs in the terminal? It would be nice to expand the set of easy to get at key bindings I can use.&lt;/p&gt;&#xA;" OwnerUserId="961" LastEditorUserId="25" LastEditDate="2015-01-28T20:57:12.860" LastActivityDate="2020-02-22T18:49:10.683" Title="Use the command key in Terminal on OSX?" Tags="|key-bindings|osx|terminal-emacs|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7762" PostTypeId="1" AcceptedAnswerId="7763" CreationDate="2015-01-28T14:37:49.940" Score="1" ViewCount="118" Body="&lt;p&gt;In the following code I have a reproducible example of strange behavior (the macro body is probably not important):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq annoying-commands ())&#xA;&#xA;(defmacro add-annoying-arrows-advice (cmd alternatives &amp;amp;optional evil-cmd evil-alternatives)&#xA;  `(progn&#xA;     (add-to-list 'annoying-commands (quote ,cmd))&#xA;     (put (quote ,cmd) 'aa--alts ,alternatives)&#xA;     (put (quote ,cmd) 'aa--evil-alts ,evil-alternatives)&#xA;     (put (quote ,cmd) 'aa--evil-cmd ,evil-cmd)&#xA;     (defadvice ,cmd (before annoying-arrows activate)&#xA;       (when annoying-arrows-mode&#xA;         (aa--maybe-complain (quote ,cmd))))))&#xA;&#xA;(add-annoying-arrows-advice next-line &#xA;'(ace-jump-mode) evil-next-visual-line '(evil-search-backward))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaulating this buffer gives the error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Symbol's value as variable is void: evil-next-visual-line&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a shame because I'd like to leave the third argument to the defmacro, namely &lt;code&gt;evil-next-visual-line&lt;/code&gt; unquoted, just like &lt;code&gt;next-line&lt;/code&gt; (the first argument) is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some really flaky behavior shows if I do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-annoying-arrows-advice evil-next-visual-line '(smart-up) 'evil-next-visual-line '(evil-find-char-backward))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now all of a sudden having &lt;code&gt;evil-next-visual-line&lt;/code&gt; as an unquoted argument is okay!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could this possibly be?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2019-11-11T14:13:51.820" LastActivityDate="2019-11-11T14:13:51.820" Title="Why does one argument need to be quoted but not the other?" Tags="|elisp-macros|quote|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7763" PostTypeId="2" ParentId="7762" CreationDate="2015-01-28T14:45:20.973" Score="4" Body="&lt;p&gt;I don't see an issue. Just macroexpand your stuff and you'll see the obvious errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-annoying-arrows-advice&#xA; next-line&#xA; '(ace-jump-mode)&#xA; evil-next-visual-line&#xA; '(evil-search-backward))&#xA;;; =&amp;gt;&#xA;(progn (add-to-list (quote annoying-commands)&#xA;                    (quote next-line))&#xA;       (put (quote next-line)&#xA;            (quote aa--alts)&#xA;            (quote (ace-jump-mode)))&#xA;       (put (quote next-line)&#xA;            (quote aa--evil-alts)&#xA;            (quote (evil-search-backward)))&#xA;       (put (quote next-line)&#xA;            (quote aa--evil-cmd)&#xA;            evil-next-visual-line)&#xA;       (defadvice next-line (before annoying-arrows activate)&#xA;         (when annoying-arrows-mode (aa--maybe-complain (quote next-line)))))&#xA;&#xA;(add-annoying-arrows-advice&#xA; evil-next-visual-line&#xA; '(smart-up)&#xA; 'evil-next-visual-line&#xA; '(evil-find-char-backward))&#xA;;; =&amp;gt;&#xA;(progn (add-to-list (quote annoying-commands)&#xA;                    (quote evil-next-visual-line))&#xA;       (put (quote evil-next-visual-line)&#xA;            (quote aa--alts)&#xA;            (quote (smart-up)))&#xA;       (put (quote evil-next-visual-line)&#xA;            (quote aa--evil-alts)&#xA;            (quote (evil-find-char-backward)))&#xA;       (put (quote evil-next-visual-line)&#xA;            (quote aa--evil-cmd)&#xA;            (quote evil-next-visual-line))&#xA;       (defadvice evil-next-visual-line (before annoying-arrows activate)&#xA;         (when annoying-arrows-mode (aa--maybe-complain (quote evil-next-visual-line))))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-28T14:45:20.973" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7764" PostTypeId="1" CreationDate="2015-01-28T14:47:34.113" Score="1" ViewCount="325" Body="&lt;p&gt;Assume that I am visiting a folder (directory) on my system by &lt;code&gt;M-x dired&lt;/code&gt; in Emacs. Also assume that I am visiting a webpage like &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/pdf/&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/pdf/&lt;/a&gt; by the default web browser of my system (say Mozilla Firefox). If I drag the link &lt;code&gt;elisp.pdf&lt;/code&gt; from this webpage and drop it on that dired buffer, the most natural things that one wishes to happen is to save the file &lt;code&gt;elisp.pdf&lt;/code&gt; in that folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the most natural way to achieve this in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-01-29T13:05:34.197" LastActivityDate="2015-01-29T13:05:34.197" Title="Drag the weblink of a file to a dired folder to save in that folder" Tags="|dired|microsoft-windows|directories|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7765" PostTypeId="2" ParentId="7764" CreationDate="2015-01-28T15:16:04.937" Score="1" Body="&lt;p&gt;I just added this feature to &lt;a href=&quot;https://github.com/abo-abo/org-download&quot; rel=&quot;nofollow&quot;&gt;org-download&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-download-dired (uri)&#xA;  &quot;Download URI to current directory.&quot;&#xA;  (raise-frame)&#xA;  (let ((filename (file-name-nondirectory&#xA;                   (car (url-path-and-query&#xA;                         (url-generic-parse-url uri))))))&#xA;    (message &quot;Downloading %s to %s ...&quot;&#xA;             filename&#xA;             (expand-file-name filename))&#xA;    (url-retrieve&#xA;     uri&#xA;     (lambda (status filename)&#xA;       (let ((err (plist-get status :error)))&#xA;         (if err (error&#xA;                  &quot;\&quot;%s\&quot; %s&quot; uri&#xA;                  (downcase (nth 2 (assq (nth 2 err) url-http-codes))))))&#xA;       (let ((coding-system-for-write 'no-conversion))&#xA;         (write-region nil nil filename nil nil nil 'confirm)))&#xA;     (list&#xA;      (expand-file-name filename))&#xA;     t t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You just need to appropriately tie in the above function with &lt;code&gt;dnd-protocol-alist&lt;/code&gt;.&#xA;But a plain &lt;code&gt;(require 'org-download)&lt;/code&gt; should suffice. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-28T15:16:04.937" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="7766" PostTypeId="1" AcceptedAnswerId="7769" CreationDate="2015-01-28T15:47:42.547" Score="3" ViewCount="1271" Body="&lt;p&gt;I would like an emacsclient frame with a specific name to open when I log into my computer. I tried adding &lt;code&gt;emacsclient -e '(select-frame (make-frame (quote ((name . &quot;scratchemacsframe&quot;)))))'&lt;/code&gt; to my startup applications, but the frame never opens. If I try running this command from the CLI before opening any other frames, I get this error: &lt;code&gt;*ERROR*: Unknown terminal type&lt;/code&gt;. Poking around on Google suggests that this is because the emacs daemon doesn't yet know where to draw the frame. If I change the command to add a &lt;code&gt;-d $DISPLAY&lt;/code&gt;, my frame opens, but I also get a second undesired frame that opens to &lt;code&gt;*scratch*&lt;/code&gt; for some reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make emacsclient open a single frame with a specified name before any other frames are opened?&lt;/p&gt;&#xA;" OwnerUserId="466" LastEditorUserId="466" LastEditDate="2015-01-29T15:43:30.653" LastActivityDate="2015-01-29T15:43:30.653" Title="Specify name on emacsclient first frame" Tags="|frames|emacsclient|daemon|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7767" PostTypeId="1" CreationDate="2015-01-28T16:02:36.697" Score="1" ViewCount="160" Body="&lt;p&gt;Saveplace is a nice tool to remember where I have left of in a file. But for Org files it causes me problems when I quit emacs in the middle of a heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current try to deactivate it in org-files is to use a hook and set 'save-place&#xA; to nil.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (require 'saveplace)&#xA;  (setq save-place-file (concat user-emacs-directory &quot;saveplace.el&quot;) )&#xA;  (setq-default save-place t)&#xA;&#xA;  (defun max/org-mode-hook ()&#xA;    (setq save-place nil)&#xA;    (flyspell-mode))&#xA;  (add-hook 'org-mode-hook 'max/org-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works most of the time but for a strange reason it is sometimes still activated in org-mode and I start at the last position instead of line 1 when I open an org file. I'm not sure how to produce this reliable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any tips how I can make the deactivation of saveplace reliable in org-mode?&lt;/p&gt;&#xA;" OwnerUserId="536" LastActivityDate="2015-01-28T16:02:36.697" Title="deactivate saveplace.el for filetype" Tags="|org-mode|files|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7768" PostTypeId="1" CreationDate="2015-01-28T18:10:30.767" Score="0" ViewCount="114" Body="&lt;p&gt;&lt;strong&gt;Main question:&lt;/strong&gt;&#xA;In order spell checkers can apply, &lt;code&gt;M-x iso-tex2iso&lt;/code&gt; is nice for converting &lt;code&gt;TeX&lt;/code&gt;-encoded files to e.g. &lt;code&gt;UTF-8&lt;/code&gt; encoded ones. But, in case a numerous files to convert, running this command in a batch mode would be helpful. How to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Subsidiary question:&lt;/strong&gt; (not for me, for a friend of mine owning a Mac) On OSX, how to make this batch thing a script with an associated icon that could &quot;receive&quot; (by &quot;drag and drop&quot;) a file to be converted?&lt;/p&gt;&#xA;" OwnerUserId="5267" LastActivityDate="2015-01-29T18:30:52.577" Title="How to run iso-tex2iso in batch mode?" Tags="|latex|osx|character-encoding|tex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7769" PostTypeId="2" ParentId="7766" CreationDate="2015-01-28T18:22:44.293" Score="5" Body="&lt;p&gt;Did you read &lt;code&gt;man emacsclient&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This worked fine for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --alternate-editor='' --no-wait --create-frame --frame-parameters='(quote (name . &quot;scratchemacs-frame&quot;))' --display $DISPLAY&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;--alternate-editor&lt;/code&gt; parameter is there so &lt;code&gt;emacsclient&lt;/code&gt; will start a new emacs daemon if one isn't already running, and &lt;code&gt;--no-wait&lt;/code&gt; makes &lt;code&gt;emacsclient&lt;/code&gt; return immediately after creating the new frame instead of waiting for you to kill or finish with the new frame before exiting.&lt;/p&gt;&#xA;" OwnerUserId="681" LastActivityDate="2015-01-28T18:22:44.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7770" PostTypeId="2" ParentId="7756" CreationDate="2015-01-28T18:30:00.090" Score="0" Body="&lt;p&gt;To answer the question you added in the comments, here's something I could think about:&lt;/p&gt;&#xA;&lt;h1&gt;The idea&lt;/h1&gt;&#xA;&lt;p&gt;If this is something you are going to do on a regular basis, sifting the data through Org table with some additional functions may automate the process. For example, you could create an org file and paste the CSV data into it, then wrap the CSV with &lt;code&gt;#+begin_example ... #+end_example&lt;/code&gt; macro. Then give it some id.  (Look at the &lt;code&gt;birthdays_csv&lt;/code&gt; for a concrete example).&lt;/p&gt;&#xA;&lt;p&gt;Then, you could have added a function to process the CSV, an example of such function is &lt;code&gt;csv-to-org&lt;/code&gt;. This function takes the CSV data and produces an Org table from it.&lt;/p&gt;&#xA;&lt;p&gt;There are lots of manipulations possible on Org tables, so that you could apply any of them that you like to the produced table.  Then, you have a function which complements the &lt;code&gt;csv-to-org&lt;/code&gt;--&lt;code&gt;org-to-csv&lt;/code&gt; to generate the CSV from the Org table once again.  The advantage of doing something like this over doing this in some statistical language is that you always have the tables in front of you and can more accurately control what happens to the data when it travels back and froth from CSV to Org table.&lt;/p&gt;&#xA;&lt;h1&gt;The code&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: birthdays&#xA;| Name   | Age          | Date of Birth    | Income |&#xA;|--------+--------------+------------------+--------|&#xA;| Joe    | 30 years old | &amp;lt;1984-02-20 Mon&amp;gt; |  84000 |&#xA;| Mark   | 40 years old | &amp;lt;1974-04-15 Mon&amp;gt; | 120000 |&#xA;| Sophie | 44 years old | &amp;lt;1970-08-28 Fri&amp;gt; | 150000 |&#xA;| Anna   | 26 years old | &amp;lt;1988-02-29 Mon&amp;gt; | 160000 |&#xA;#+TBLFM: $2=(now()-$3)/365;%d years old&#xA;&#xA;#+NAME: org-to-csv&#xA;#+BEGIN_SRC emacs-lisp :var birthdays=birthdays :results raw output :wrap example&#xA;   (cl-loop for row in birthdays do&#xA;            (pp (car row))&#xA;            (cl-loop for cell in (cdr row)&#xA;                     for i from 0 do&#xA;                     (princ &amp;quot;,&amp;quot;)&#xA;                     (if (= i 2)&#xA;                         (princ (format &amp;quot;$%.2f&amp;quot; (/ cell 1000)))&#xA;                       (pp cell)))&#xA;            (terpri))&#xA;#+END_SRC&#xA;&#xA;#+NAME: birhdays_csv&#xA;#+RESULTS:&#xA;#+BEGIN_example&#xA;&amp;quot;Joe&amp;quot;,&amp;quot;30 years old&amp;quot;,&amp;quot;&amp;lt;1984-02-20 Mon&amp;gt;&amp;quot;,$84.00&#xA;&amp;quot;Mark&amp;quot;,&amp;quot;40 years old&amp;quot;,&amp;quot;&amp;lt;1974-04-15 Mon&amp;gt;&amp;quot;,$120.00&#xA;&amp;quot;Sophie&amp;quot;,&amp;quot;44 years old&amp;quot;,&amp;quot;&amp;lt;1970-08-28 Fri&amp;gt;&amp;quot;,$150.00&#xA;&amp;quot;Anna&amp;quot;,&amp;quot;26 years old&amp;quot;,&amp;quot;&amp;lt;1988-02-29 Mon&amp;gt;&amp;quot;,$160.00&#xA;#+END_example&#xA;&#xA;#+NAME: csv-to-org&#xA;#+BEGIN_SRC emacs-lisp :var birthdays=birhdays_csv :results raw output&#xA;  (with-temp-buffer&#xA;    (insert birthdays)&#xA;    (org-table-convert-region (point-min) (point-max))&#xA;    (princ (buffer-substring-no-properties (point-min) (point-max))))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| Joe    | 30 years old | &amp;lt;1984-02-20 Mon&amp;gt; | $84.00  |&#xA;| Mark   | 40 years old | &amp;lt;1974-04-15 Mon&amp;gt; | $120.00 |&#xA;| Sophie | 44 years old | &amp;lt;1970-08-28 Fri&amp;gt; | $150.00 |&#xA;| Anna   | 26 years old | &amp;lt;1988-02-29 Mon&amp;gt; | $160.00 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-28T21:36:05.790" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7771" PostTypeId="2" ParentId="7756" CreationDate="2015-01-28T19:28:29.870" Score="2" Body="&lt;h1&gt;Solution&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;Quick summary&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Align the text based on delimiters (&lt;code&gt;,&lt;/code&gt; in this case), mark the column and type the identical text of your choice in that column using &lt;code&gt;C-x r t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Walkthrough&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's start with a non-aligned version of your example table, assuming that you start from a csv file snippet.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a1,bbb1,cc1,ddd1,ee1&#xA;aa2,b2,ccc2,dd2,e2&#xA;aaa3,bb3,c3,d3,ee3&#xA;aa4,b4,cc4,ddd4,eee4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Select that block and align based on the delimiter using &lt;code&gt;align-regexp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u M-x align-regexp , RET RET RET y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If you'd like to understand that, there is a good explanation in &lt;a href=&quot;https://emacs.stackexchange.com/a/2692/115&quot;&gt;this Emacs SE answer&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will give you&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a1   ,bbb1 ,cc1  ,ddd1 ,ee1&#xA;aa2  ,b2   ,ccc2 ,dd2  ,e2&#xA;aaa3 ,bb3  ,c3   ,d3   ,ee3&#xA;aa4  ,b4   ,cc4  ,ddd4 ,eee4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say you want to replace the 2nd column with &lt;code&gt;xyz&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First mark the second column. Place the &lt;em&gt;point&lt;/em&gt; and &lt;em&gt;mark&lt;/em&gt; as shown below by the black and white rectangles. &lt;em&gt;The black rectangle is hiding the &lt;code&gt;b&lt;/code&gt; character underneath.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a1   ,▮bb1 ,cc1  ,ddd1 ,ee1&#xA;aa2  ,b2   ,ccc2 ,dd2  ,e2&#xA;aaa3 ,bb3  ,c3   ,d3   ,ee3&#xA;aa4  ,b4  ▯,cc4  ,ddd4 ,eee4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do &lt;code&gt;C-x r t x y z RET&lt;/code&gt; ( &lt;code&gt;string-rectangle&lt;/code&gt; command )&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Result&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a1   ,xyz ,cc1  ,ddd1 ,ee1&#xA;aa2  ,xyz ,ccc2 ,dd2  ,e2&#xA;aaa3 ,xyz ,c3   ,d3   ,ee3&#xA;aa4  ,xyz ,cc4  ,ddd4 ,eee4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Replacing values in the same row&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There can't be a general approach for replacing the values in rows and columns. For replacing the values in a row, we can use the &lt;code&gt;query-replace-regexp&lt;/code&gt; command or &lt;code&gt;C-M-%&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Continuing from the previous result ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a1   ,xyz ,cc1  ,ddd1 ,ee1&#xA;aa2  ,xyz ,ccc2 ,dd2  ,e2&#xA;aaa3 ,xyz ,c3   ,d3   ,ee3&#xA;aa4  ,xyz ,cc4  ,ddd4 ,eee4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say you want to replace the values in the first row. So &lt;strong&gt;select&lt;/strong&gt; that row and do &lt;code&gt;C-M-% \b\w+\b RET uvw RET&lt;/code&gt;. The &lt;code&gt;\b\w+\b&lt;/code&gt; selects a string with word boundaries and containing alpha-numeric characters.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Result&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;uvw   ,uvw ,uvw  ,uvw ,uvw&#xA;aa2  ,xyz ,ccc2 ,dd2  ,e2&#xA;aaa3 ,xyz ,c3   ,d3   ,ee3&#xA;aa4  ,xyz ,cc4  ,ddd4 ,eee4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-01-28T19:44:07.393" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7774" PostTypeId="2" ParentId="608" CreationDate="2015-01-28T23:33:17.137" Score="2" Body="&lt;p&gt;The accepted solution by @severin almost works for me, but, when the tag is not found, the buffer does not return to normal mode. This alternative works for me in all cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-jump-to-tag ()&#xA;    (interactive)&#xA;    (evil-execute-in-emacs-state)&#xA;    (call-interactively (key-binding (kbd &quot;M-.&quot;))))&#xA;(define-key evil-normal-state-map (kbd &quot;C-]&quot;) 'my-jump-to-tag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5343" LastActivityDate="2015-01-28T23:33:17.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7776" PostTypeId="1" AcceptedAnswerId="7778" CreationDate="2015-01-29T01:01:54.203" Score="7" ViewCount="298" Body="&lt;p&gt;Is there a way to define a macro in an emacs-lisp file in such a way that the macro would not be visible anywhere else once the file is read and evaluated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind of like a temporary macro that goes out of scope at the end of a file?&lt;/p&gt;&#xA;" OwnerUserId="875" LastActivityDate="2015-01-29T20:15:11.163" Title="Defining a macro that exists only in one .el file" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7777" PostTypeId="2" ParentId="7752" CreationDate="2015-01-29T01:03:24.443" Score="1" Body="&lt;p&gt;All 16777215 Hex colours should work on a properly configured build.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;M-x list-colors-display&lt;/code&gt; is to help when selecting colours on a &amp;lt; 24bit display. (and to list &lt;em&gt;named&lt;/em&gt; colours.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem &lt;em&gt;appears to be&lt;/em&gt; that the colour space that your EmacsForOSX Emacs.app bundle was built with is broken. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#656555&lt;/code&gt; just so happens to fall out of the space on this build.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On OSX I would recommend building with Homebrew and &lt;code&gt;--srgb&lt;/code&gt;, ie.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install --cocoa --srgb emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Better yet use the Mac specific patch from Yamamoto Mitsuharu at Chiba University.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Xin Xu (@railwaycat) hosts a homebrew tap on github, so it's easier to install than applying the patch manually / and compiling. Just do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew tap railwaycat/emacsmacport&#xA;brew install emacs-mac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;A Quick note on Homebrew .app installs&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The standard way that Homebrew installs &lt;code&gt;.app&lt;/code&gt; bundles is to symlink them.  (using &lt;code&gt;brew linkapps&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is done because the Homebrew team (currently) wish to avoid touching the filesystem outside of &lt;code&gt;/usr/local&lt;/code&gt; as much as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this is problematic for users who rely on Spotlight to launch apps.  I'd hazard a guess that Emacs users would prefer this method as it's more keyboard centric.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to use an OSX &quot;alias&quot; instead of a symlink, these are indexed by Spotlight, although the ranking in results places &quot;aliases&quot; very low.  Yosemite's new Spotlight interface seems also to not show them under some conditions I haven't fully determined (I don't use Yosemite on any day-to-day machines, and it's being removed until at least Q4 2015 from some other machines I use, so I can't commit to testing this exhaustively.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, there is no reason at all that the &lt;code&gt;.app&lt;/code&gt; bundles should be located outside of &lt;code&gt;/Applications/&lt;/code&gt; or &lt;code&gt;~/Applications/&lt;/code&gt; so I strongly recommend simply moving the &lt;code&gt;Emacs.app&lt;/code&gt; bundle there, just as you would if you were installing it from a &lt;code&gt;.dmg&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the Homebrew build will place other resources in the &lt;code&gt;/usr/local/Cellar/emacs&lt;/code&gt; (or &lt;code&gt;emacs-mac&lt;/code&gt;) folder.  This will not cause problems however.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See it working in these screenshots...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Td5cY.png&quot; alt=&quot;eval in scratch&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/t6AhX.png&quot; alt=&quot;updated value shown in customize&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Tj3e2.png&quot; alt=&quot;selected region coloured as expected&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="2485" LastEditDate="2015-01-29T03:29:20.337" LastActivityDate="2015-01-29T03:29:20.337" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7778" PostTypeId="2" ParentId="7776" CreationDate="2015-01-29T01:21:31.030" Score="11" Body="&lt;p&gt;You can always unbind the macro when the file ends. As far as I know, Emacs Lisp doesn't have to worry about asynchronous complexities; the flow of execution is purely linear. Therefore, you can do this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my-test-macro (secret sauce recipe)&#xA;   ;; super secret stuff here&#xA;   ;; wouldn't want it to LEAK out&#xA;   ;; and get stolen by some other files&#xA;   )&#xA;&#xA;;; [...] blabitty blah blah [...]&#xA;&#xA;(fmakunbound 'my-test-macro)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The other solution you should look at (which is less hacky) uses &lt;code&gt;cl-macrolet&lt;/code&gt;, which is basically a &lt;code&gt;let&lt;/code&gt; for macros.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'cl-lib))&#xA;(cl-macrolet ((my-test-macro (secret sauce recipie)&#xA;                 ;; super secret stuff here&#xA;                 ;; wouldn't want it to LEAK out&#xA;                 ;; and get stolen by some other files&#xA;                 ))&#xA;&#xA;  ;; [...] blabitty blah blah [...]&#xA;&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No doubt, this solution is cleaner, although you pay for it by adding another level of indentation. Also, the macro is dynamically bound and could in theory be run asynchronously (although Emacs is a long way from multi-threading).&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-01-29T20:15:11.163" LastActivityDate="2015-01-29T20:15:11.163" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7779" PostTypeId="1" AcceptedAnswerId="14513" CreationDate="2015-01-29T05:37:45.483" Score="0" ViewCount="242" Body="&lt;p&gt;when I export a full path figure , like: &#xA;&lt;code&gt;[[file:c:/Users/admin/Desktop/1.png]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to LaTeX in org-mode, a result of&#xA;&lt;code&gt;{//c:/Users/admin/Desktop/1.png}&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;was generated. One more &lt;code&gt;//&lt;/code&gt; was generated in front of &lt;code&gt;c:&lt;/code&gt;, &#xA;which is an error in LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have posted this problem to org-mode mail list, but nobody replied me, so I continued to ask here. Thanks for any help. &lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-01-29T06:59:10.623" LastActivityDate="2018-09-06T15:42:50.700" Title="Full path figure export to LaTeX error in org-mode in Windows 7" Tags="|org-mode|org-export|emacs24.4|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7781" PostTypeId="1" CreationDate="2015-01-29T08:43:14.613" Score="1" ViewCount="54" Body="&lt;p&gt;I got a super useful snippet from org-hacks: &lt;a href=&quot;http://orgmode.org/worg/org-hacks.html#unnumbered-66&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-hacks.html#unnumbered-66&lt;/a&gt;, which can automatically adjust the position of tags to right of the headline and make org-mode looks cleaner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since these days, I start to use visual-line-mode, an uncomfortable looks problems appeared. On the folded headline, the tags are wrapped strangely to below the headline, like wrapped to a new line. However, when I unfold the headline, the tags go to the right position, of course, the rightest of the headline. So what is the problem? Since the tags can move according to the windows size, why it can not go well when headline is folded?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastActivityDate="2015-01-29T16:15:29.677" Title="Tags show conflict when I use visual-line mode and fold the headline" Tags="|org-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7782" PostTypeId="2" ParentId="7768" CreationDate="2015-01-29T10:29:48.897" Score="3" Body="&lt;p&gt;Thanks to wvxvw's comment, I can answer my own (main) question: in order to convert a &lt;code&gt;TeX&lt;/code&gt;-encoded file, say &lt;code&gt;foo.tex&lt;/code&gt;, into an UTF-8 encoded one, it is enough to run (no need to open the file in &lt;code&gt;emacs&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -batch foo.tex -f mark-whole-buffer -f iso-tex2iso -f save-buffer -kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5267" LastEditorUserId="5267" LastEditDate="2015-01-29T18:30:52.577" LastActivityDate="2015-01-29T18:30:52.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7783" PostTypeId="1" CreationDate="2015-01-29T14:47:33.660" Score="3" ViewCount="127" Body="&lt;p&gt;I've successfully managed adjusting the displayed size of spaces and raising/lowering propertized text by making use of the &lt;code&gt;display&lt;/code&gt; property, however I cannot find anything that would allow me to fake kerning adjustments.  In other words, I have two letters and would like to make the second one intrude into the first one's bounding box, in typography this would be done with negative kerning.  Is there a way to achieve this effect with the Emacs display engine?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: I'll give a demonstration of what I want to achieve:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-insert-tex ()&#xA;  (insert&#xA;   (propertize (concat &quot;T&quot; (propertize &quot;e&quot; 'display '(raise -0.24)) &quot;X&quot;)&#xA;               'font-lock-face '(:family &quot;Serif&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The preceding function inserts the string &quot;TeX&quot; with the &quot;e&quot; lowered by 0.5ex which are roughly 24% of the font height.  This approximates the typesetting of the &lt;a href=&quot;https://en.wikipedia.org/wiki/TeX&quot; rel=&quot;nofollow&quot;&gt;TeX&lt;/a&gt; logo, however to make it perfect I'd need something like a negative margin around the &quot;e&quot; to move it closer to the &quot;T&quot;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-02-25T13:35:18.577" LastActivityDate="2015-02-25T13:35:18.577" Title="How would one fake kerning adjustments in propertized text?" Tags="|text-properties|display|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7785" PostTypeId="1" CreationDate="2015-01-29T16:18:15.333" Score="0" ViewCount="634" Body="&lt;p&gt;Suppose I have the following &lt;a href=&quot;http://www.flycheck.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Flycheck&lt;/a&gt; checker:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(flycheck-def-config-file-var flycheck-jscs&#xA;                              javascript-jscs&#xA;                              &amp;quot;.jscs&amp;quot;&#xA;                              :safe #'stringp)&#xA;&#xA;(flycheck-define-checker javascript-jscs&#xA;                         &amp;quot;A jscs code style checker.&amp;quot;&#xA;                         :command (&amp;quot;jscs&amp;quot; &amp;quot;--reporter&amp;quot; &amp;quot;checkstyle&amp;quot;&#xA;                                   (config-file &amp;quot;--config&amp;quot; flycheck-jscs) source)&#xA;                         :error-parser flycheck-parse-checkstyle&#xA;                         :modes (js-mode js2-mode js3-mode)&#xA;                         :next-checkers (javascript-jshint))&#xA;&#xA;(provide 'flycheck-jscs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;How do I add a &lt;code&gt;:predicate&lt;/code&gt; that tells flycheck to disable the checker if &lt;code&gt;flycheck-jscs&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;p&gt;I only manage to get this message regardless what code I try with:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Error while checking syntax automatically:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(invalid-function (quote (not (not (quote flycheck-jscs)))))&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="450" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-01-30T20:58:21.030" Title="How do I write a Flycheck predicate that checks for the checkers config file" Tags="|flycheck|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7786" PostTypeId="1" AcceptedAnswerId="7787" CreationDate="2015-01-29T18:18:40.303" Score="2" ViewCount="136" Body="&lt;p&gt;I've got a file that looks roughly like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;prefix.thing,11,12&#xA;prefix.something,10,20&#xA;prefix.something,30,40&#xA;prefix.somethingElse,10,20&#xA;prefix.anotherThing,1,2&#xA;prefix.anotherThing,3,4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;assuming my point is at the beginning of the file, how can I find the first pair of lines that match up to the first comma on each line.&lt;/p&gt;&#xA;" OwnerUserId="28" LastActivityDate="2015-01-30T12:08:58.200" Title="Find the next occurence of lines with matching prefix" Tags="|search|regular-expressions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7787" PostTypeId="2" ParentId="7786" CreationDate="2015-01-29T18:27:36.637" Score="2" Body="&lt;p&gt;Press &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; to begin a regexp search&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Search for &lt;code&gt;^\(.*?,\).*^J\1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that to insert the &lt;code&gt;^J&lt;/code&gt; you wont actually type &lt;kbd&gt;^&lt;/kbd&gt;&lt;kbd&gt;J&lt;/kbd&gt;. ^J is the representation of a newline character, you insert this hard new line by typing &lt;kbd&gt;C-q&lt;/kbd&gt;&lt;kbd&gt;C-j&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you are searching for: &#xA;anything not a comma, &#xA;followed by a comma, &#xA;followed by anything to the end of the line, &#xA;followed by a new line, &#xA;followed by the first matched thing.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You could turn it into a command like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun find-next-matching-prefix-lines ()&#xA;  &quot;Move forward to the next pair of lines that match up to the first comma on each line.&quot;&#xA;  (interactive)&#xA;  (if (re-search-forward &quot;^\\(.*?,\\).*\n\\1&quot; (point-max) t 1)&#xA;      (goto-char (line-beginning-position))&#xA;    (message &quot;no more matches found!&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-01-29T18:49:09.003" LastActivityDate="2015-01-29T18:49:09.003" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7788" PostTypeId="2" ParentId="7786" CreationDate="2015-01-29T18:33:07.097" Score="1" Body="&lt;p&gt;You can type:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;isearch-forward-regexp&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;^\\(.\*\\),.\*&lt;/code&gt; &lt;kbd&gt;C-q C-j&lt;/kbd&gt; &lt;code&gt;\1,&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cryptic characters in the middle form a &lt;strong&gt;regular expression&lt;/strong&gt; (or regexp), it is a pattern language that you use to describe what you would like to match. The &lt;kbd&gt;C-q C-j&lt;/kbd&gt; part inserts a newline character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effectively, the regexp specifies:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;^&lt;/code&gt; It should start at the beginning of a line.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\\(.*\\)&lt;/code&gt; It should match anything, and capture the matched string in a &lt;em&gt;group&lt;/em&gt; (group 1)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;,&lt;/code&gt; Match an explicit comma&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-q C-j&lt;/kbd&gt; This inserts a newline character in the regexp that matches the end of a line&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\1&lt;/code&gt; This should match the same as group 1 matched.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;,&lt;/code&gt; Another explicit comma.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="897" LastEditorUserId="504" LastEditDate="2015-01-30T12:08:58.200" LastActivityDate="2015-01-30T12:08:58.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7790" PostTypeId="1" AcceptedAnswerId="7791" CreationDate="2015-01-29T19:31:13.720" Score="2" ViewCount="499" Body="&lt;p&gt;I have an existing dired buffer created of arbitrary files (basically as described &lt;a href=&quot;https://emacs.stackexchange.com/questions/2567/programmatically-insert-files-into-dired-buffer&quot;&gt;here&lt;/a&gt;). How could I add additional files to this existing buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The files may, or may not, be in the same directory as any files in the existing dired buffer.&lt;/p&gt;&#xA;" OwnerUserId="5348" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-02-03T09:39:33.190" Title="Programmatically add files to existing Dired buffer" Tags="|elisp|buffers|dired|files|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7791" PostTypeId="2" ParentId="7790" CreationDate="2015-01-29T19:43:03.510" Score="3" Body="&lt;p&gt;See command &lt;code&gt;diredp-dired-union&lt;/code&gt; (bound to &lt;strong&gt;&lt;code&gt;C-x D&lt;/code&gt;&lt;/strong&gt;, aka &lt;code&gt;C-x S-d&lt;/code&gt;) from &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;.  The doc string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diredp-dired-union is an interactive compiled Lisp function in `dired+.el'.&#xA;&#xA;(diredp-dired-union DIRBUFS &amp;amp;optional SWITCHES)&#xA;&#xA;Create a Dired buffer that is the union of some existing Dired buffers.&#xA;With a prefix arg, read `ls' switches.&#xA;You are prompted for the Dired buffers.  Use `C-g' when done choosing&#xA;them.  Then you are prompted for the name of the new Dired buffer.&#xA;Its `default-directory' is the same as the `default-directory' before&#xA;invoking the command.&#xA;&#xA;The selected Dired listings are included in the order that you choose&#xA;them, and each entry is listed only once in the new Dired buffer.  The&#xA;new Dired listing respects the markings, subdirectory insertions, and&#xA;hidden subdirectories of the selected Dired listings.&#xA;&#xA;However, in case of conflict between marked or unmarked status for the&#xA;same entry, the entry is marked.  Similarly, in case of conflict over&#xA;an included subdirectory between it being hidden or shown, it is&#xA;hidden, but its contained files are also listed.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update, in reply to your comment question -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, for now you need to first open a new Dired buffer with only the file(s) to add. You can do that by providing a non-positive prefix arg (e.g. &lt;code&gt;C--&lt;/code&gt;) to &lt;code&gt;dired&lt;/code&gt; (e.g. &lt;code&gt;C-- C-x 4 d&lt;/code&gt;).  (You are prompted for the files to list.)  Then use &lt;code&gt;diredp-dired-union&lt;/code&gt; to combine that Dired listing with any other Dired listings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been intending to add a command that does just what you request, directly, but haven't gotten around to it yet. (Maybe this will incite me to do so, when I get a moment.) I have this in my TODO list:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Add command to &lt;em&gt;add&lt;/em&gt; files/dirs to the current Dired buffer.  Use code&#xA;  similar to &lt;code&gt;diredp-dired-union-1&lt;/code&gt;. It just needs to call &lt;code&gt;dired&lt;/code&gt;, passing a cons of:&lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;The current buffer name (might need to kill it first).&lt;/li&gt;&#xA;  &lt;li&gt;The current default-directory plus the newly read files/dirs.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;  &#xA;  &lt;p&gt;Or if the current listing was already from a cons (how to know:&#xA;  &lt;code&gt;dired-directory&lt;/code&gt; is a cons or not) then just append the newly read&#xA;  files/dirs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This should be simple to do; I just haven't gotten around to it. For now, just add files to a new Dired buffer and then union that with your other Dired buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE #2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added such commands now.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Commands &lt;code&gt;diredp-add-to-dired-buffer&lt;/code&gt; and &lt;code&gt;diredp-add-to-dired-buffer-other-window&lt;/code&gt;, bound globally to &lt;strong&gt;&lt;code&gt;C-x E&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;C-x 4 E&lt;/code&gt;&lt;/strong&gt;, let you add arbitrary file and directory names to an existing Dired buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Commands &lt;code&gt;diredp-dired-union&lt;/code&gt; and &lt;code&gt;diredp-dired-union-other-window&lt;/code&gt;, bound globally to &lt;strong&gt;&lt;code&gt;C-x D&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;C-x 4 D&lt;/code&gt;&lt;/strong&gt; (mentioned above), now also let you add arbitrary file and dir names (in addition to unioning Dired buffers), if you use a non-positive prefix argument (e.g. &lt;code&gt;C--&lt;/code&gt;). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-02-03T05:18:27.997" LastActivityDate="2015-02-03T05:18:27.997" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7792" PostTypeId="1" CreationDate="2015-01-29T19:45:50.100" Score="16" ViewCount="2675" Body="&lt;p&gt;Is there someway to escape brackets (&lt;code&gt;[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt;) so that they can be included in the &lt;em&gt;description&lt;/em&gt; of an Org mode link? The following link doesn't work, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[http://mathoverflow.net/questions/195203/automorphisms-of-ideals-of-mathbbct][Automorphisms of ideals of C[t]]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hoped using a backslash (&lt;code&gt;\[&lt;/code&gt;) would work or that there would be an org-entity, but that doesn't seem to be the case.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2020-08-12T08:17:19.167" Title="Can I make links in Org Mode that contain brackets, [ or ]?" Tags="|org-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7793" PostTypeId="2" ParentId="7792" CreationDate="2015-01-29T20:25:30.430" Score="5" Body="&lt;p&gt;A working solution, not so pretty though, is to use the &lt;a href=&quot;http://orgmode.org/manual/Macro-replacement.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org mode Macros&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below macros are replaced by the ASCII codes of the &lt;code&gt;[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt; when exporting to html or latex.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Square Bracket Open [&#xA;#+MACRO: BO @@latex:\char91@@ @@html:&amp;amp;#91;@@&#xA;# Square Bracket Close ]&#xA;#+MACRO: BC @@latex:\char93@@ @@html:&amp;amp;#93;@@&#xA;&#xA;[[http://emacs.stackexchange.com][{{{BO}}}Emacs SE{{{BC}}}]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/261/115&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-01-29T20:55:04.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7794" PostTypeId="2" ParentId="7761" CreationDate="2015-01-29T20:39:43.007" Score="0" Body="&lt;p&gt;First stem, get &lt;a href=&quot;http://iterm.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;iTerm&lt;/a&gt;!  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, (this has been answered &lt;a href=&quot;https://apple.stackexchange.com/questions/89981/remapping-keys-in-iterm2&quot;&gt;here&lt;/a&gt;, so I can't take credit for it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go to Bookmarks &gt; Manage Profiles. Then select Keyboard Profiles &gt; Global and choose Option Key as Meta.  &lt;/p&gt;&#xA;" OwnerUserId="412" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:30.630" LastActivityDate="2015-01-29T20:39:43.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7795" PostTypeId="2" ParentId="7792" CreationDate="2015-01-29T22:17:07.257" Score="3" Body="&lt;p&gt;Below is the modified version of &lt;code&gt;org-make-link-regexp&lt;/code&gt; which will allow one nesting level of square brackets inside description:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-make-link-regexps ()&#xA;  &quot;Update the link regular expressions.&#xA;This should be called after the variable `org-link-types' has changed.&quot;&#xA;  (setq org-link-types-re&#xA;    (concat&#xA;     &quot;\\`\\(&quot; (mapconcat 'regexp-quote org-link-types &quot;\\|&quot;) &quot;\\):&quot;)&#xA;    org-link-re-with-space&#xA;    (concat&#xA;     &quot;&amp;lt;?\\(&quot; (mapconcat 'regexp-quote org-link-types &quot;\\|&quot;) &quot;\\):&quot;&#xA;     &quot;\\([^&quot; org-non-link-chars &quot; ]&quot;&#xA;     &quot;[^&quot; org-non-link-chars &quot;]*&quot;&#xA;     &quot;[^&quot; org-non-link-chars &quot; ]\\)&amp;gt;?&quot;)&#xA;    org-link-re-with-space2&#xA;    (concat&#xA;     &quot;&amp;lt;?\\(&quot; (mapconcat 'regexp-quote org-link-types &quot;\\|&quot;) &quot;\\):&quot;&#xA;     &quot;\\([^&quot; org-non-link-chars &quot; ]&quot;&#xA;     &quot;[^\t\n\r]*&quot;&#xA;     &quot;[^&quot; org-non-link-chars &quot; ]\\)&amp;gt;?&quot;)&#xA;    org-link-re-with-space3&#xA;    (concat&#xA;     &quot;&amp;lt;?\\(&quot; (mapconcat 'regexp-quote org-link-types &quot;\\|&quot;) &quot;\\):&quot;&#xA;     &quot;\\([^&quot; org-non-link-chars &quot; ]&quot;&#xA;     &quot;[^\t\n\r]*\\)&quot;)&#xA;    org-angle-link-re&#xA;    (concat&#xA;     &quot;&amp;lt;\\(&quot; (mapconcat 'regexp-quote org-link-types &quot;\\|&quot;) &quot;\\):&quot;&#xA;     &quot;\\([^&quot; org-non-link-chars &quot; ]&quot;&#xA;     &quot;[^&quot; org-non-link-chars &quot;]*&quot;&#xA;     &quot;\\)&amp;gt;&quot;)&#xA;    org-plain-link-re&#xA;    (concat&#xA;     &quot;\\&amp;lt;\\(&quot; (mapconcat 'regexp-quote org-link-types &quot;\\|&quot;) &quot;\\):&quot;&#xA;     (org-re &quot;\\([^ \t\n()&amp;lt;&amp;gt;]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)&quot;))&#xA;    ;;   &quot;\\([^]\t\n\r&amp;lt;&amp;gt;() ]+[^]\t\n\r&amp;lt;&amp;gt;,.;() ]\\)&quot;)&#xA;    org-bracket-link-regexp&#xA;    ;; &quot;\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]&quot;&#xA;    &quot;\\[\\[\\([^][]+\\)\\]\\(\\[\\([^[]*?\\[[^]]*?\\][^]]*?\\|[^][]+\\)\\]\\)?\\]&quot;&#xA;    org-bracket-link-analytic-regexp&#xA;    (concat&#xA;     &quot;\\[\\[&quot;&#xA;     &quot;\\(\\(&quot; (mapconcat 'regexp-quote org-link-types &quot;\\|&quot;) &quot;\\):\\)?&quot;&#xA;     &quot;\\([^]]+\\)&quot;&#xA;     &quot;\\]&quot;&#xA;     &quot;\\(\\[&quot; &quot;\\([^[]*?\\[[^]]*?\\][^]]*?\\|[^]]+\\)&quot; &quot;\\]\\)?&quot;&#xA;     ;; &quot;\\(\\[&quot; &quot;\\([^]]+\\)&quot; &quot;\\]\\)?&quot;&#xA;     &quot;\\]&quot;)&#xA;    org-bracket-link-analytic-regexp++&#xA;    (concat&#xA;     &quot;\\[\\[&quot;&#xA;     &quot;\\(\\(&quot; (mapconcat 'regexp-quote (cons &quot;coderef&quot; org-link-types) &quot;\\|&quot;) &quot;\\):\\)?&quot;&#xA;     &quot;\\([^]]+\\)&quot;&#xA;     &quot;\\]&quot;&#xA;     &quot;\\(\\[&quot; &quot;\\([^]]+\\)&quot; &quot;\\]\\)?&quot;&#xA;     &quot;\\]&quot;)&#xA;    org-any-link-re&#xA;    (concat &quot;\\(&quot; org-bracket-link-regexp &quot;\\)\\|\\(&quot;&#xA;        org-angle-link-re &quot;\\)\\|\\(&quot;&#xA;        org-plain-link-re &quot;\\)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But as noted above, this doesn't solve the problem of editing links (Org will still want to replace brackets with braces.) This also can only handle one nesting level of one bracketed group.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-01-29T22:17:07.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7796" PostTypeId="1" AcceptedAnswerId="7797" CreationDate="2015-01-29T23:35:27.453" Score="3" ViewCount="340" Body="&lt;p&gt;After reading the documentation, here's what I've tried:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(condition-case err&#xA;    (signal 'my-error 'my-data)&#xA;  (my-error (message &quot;data: %S&quot; err)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluating this form still throws the signal, though – how can I truly catch it?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-29T23:54:22.800" Title="How do I catch signals?" Tags="|error-handling|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7797" PostTypeId="2" ParentId="7796" CreationDate="2015-01-29T23:54:22.800" Score="3" Body="&lt;p&gt;You must define the symbol as an error first:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-error 'my-error &quot;Custom error&quot;)&#xA;&#xA;(condition-case err&#xA;    (signal 'my-error 'my-data)&#xA;  (my-error (message &quot;data: %S&quot; err)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluating this form yields &lt;code&gt;&quot;data: (tmp:error . my-data)&quot;&lt;/code&gt; as expected.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-29T23:54:22.800" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7798" PostTypeId="1" AcceptedAnswerId="7801" CreationDate="2015-01-30T00:33:26.767" Score="4" ViewCount="389" Body="&lt;p&gt;Say I have a function that is called on an idle timer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tmp:create () (mkdir &quot;test&quot;))&#xA;(run-with-idle-time 3 nil #'tmp:create)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I test that this function works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest async () &quot;&quot;&#xA;  (should-not (file-exists-p &quot;test&quot;))&#xA;  (sleep-for 4)&#xA;  (should (file-exists-p &quot;test&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-30T01:45:48.080" Title="How can I test an idle timer with ERT?" Tags="|ert|testing|idle-timer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7799" PostTypeId="1" AcceptedAnswerId="7800" CreationDate="2015-01-30T01:01:51.490" Score="2" ViewCount="839" Body="&lt;p&gt;I want to capitalize letters that follow colons.  Here is the code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;: \w&quot; 'upcase &quot;: really&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result I expected is &lt;code&gt;: Really&lt;/code&gt;.  Instead I get &lt;code&gt;: really&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, this also doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;: [:alpha:]&quot; 'upcase &quot;: really&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;: r&quot; 'upcase &quot;: really&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this, too:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;: [:alpha:]&quot; 'upcase &quot;: alright&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;LANG&lt;/code&gt; environment variable is set to &lt;code&gt;en_US.UTF-8&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="504" LastEditDate="2015-01-30T12:23:25.733" LastActivityDate="2015-05-09T20:27:11.357" Title="Capitalizing letters that follow colons using 'replace-regexp-in-string'" Tags="|regular-expressions|replace|string|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7800" PostTypeId="2" ParentId="7799" CreationDate="2015-01-30T01:16:24.453" Score="5" Body="&lt;p&gt;You need to double the backslash in a Lisp string:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;: \\w&quot; #'upcase &quot;: really&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-for-Strings.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Syntax for Strings&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And a char class has chars inside &lt;code&gt;[]&lt;/code&gt;, so put &lt;code&gt;[:alpha:]&lt;/code&gt; inside &lt;code&gt;[]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;: [[:alpha:]]&quot; #'upcase &quot;: really&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Special.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Regexp Special&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:27:11.357" LastActivityDate="2015-05-09T20:27:11.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7801" PostTypeId="2" ParentId="7798" CreationDate="2015-01-30T01:37:12.407" Score="6" Body="&lt;p&gt;Idle timers won't be touched until the call stack has been cleared, so sitting won't actually help, it is only once all execution has stopped with the timer be run, so in your case, the idle timer won't run until 3 seconds of idle time after your whole test has run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To combat this, you can call &lt;code&gt;ert-run-idle-timers&lt;/code&gt; from &lt;code&gt;ert-x.el&lt;/code&gt; in your test.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-01-30T01:45:48.080" LastActivityDate="2015-01-30T01:45:48.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7802" PostTypeId="1" CreationDate="2015-01-30T01:55:58.840" Score="7" ViewCount="268" Body="&lt;p&gt;Let's say I need to associate symbols with directories, and this will only need to be done for a small number of &lt;code&gt;boundp&lt;/code&gt; symbols. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I see it, there are two easy ways to do that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Store this association in a separate variable (alist or a hash map). This way the directory of each symbol would be accessible with &lt;code&gt;(cdr (assq SYMBOL my-alist))&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Store this in a symbol property. This way, it would be accessible with &lt;code&gt;(get SYMBOL 'my-directory)&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Which of these would be the idiomatic way of keeping track of this information? &lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-01-30T14:34:52.127" Title="When to use symbol properties?" Tags="|elisp|symbols|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7803" PostTypeId="2" ParentId="7802" CreationDate="2015-01-30T02:41:26.203" Score="7" Body="&lt;p&gt;It really depends on the use cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally speaking, symbol properties are &quot;low-level&quot; / &quot;internal&quot; features and one should not use them for &quot;user-level&quot; stuff. However, there is a place for everything :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few points you might want to consider are: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Speed: symbol properties are the fastest, closely followed by hash tables; alists are &lt;em&gt;slow&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;It is easier to reset your system (i.e., remove all the vestiges of your package) with alist/hash table (reset the variable to &lt;code&gt;nil&lt;/code&gt;) than with symbol properties (iterate over the &lt;code&gt;obarray&lt;/code&gt; and eliminate all the relevant properties from the all symbols).&lt;/li&gt;&#xA;&lt;li&gt;It is easy to dynamically shadow the setting using alist; much harder with hash tables and symbol properties.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Another option you might want to consider is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot;&gt;&lt;code&gt;.dir-locals.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2015-01-30T04:09:39.770" LastActivityDate="2015-01-30T04:09:39.770" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7804" PostTypeId="1" AcceptedAnswerId="7805" CreationDate="2015-01-30T08:40:32.153" Score="1" ViewCount="2432" Body="&lt;p&gt;I am trying to extract the function name from a function call. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((str &quot;(test-func&quot;))&#xA;  (if (string-match &quot;^(\\s_+&quot; str)&#xA;      (message &quot;ok&quot;)&#xA;    (message &quot;no match&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this gives &lt;code&gt;&quot;no match&quot;&lt;/code&gt;.. (For simplicity I reduced &lt;code&gt;str&lt;/code&gt; to the start of the real string. A real string could be for example &lt;code&gt;&quot;(test-func a b)&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the problem is the &lt;code&gt;\s_&lt;/code&gt;   symbol constituent regex.. &lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-01-30T09:15:01.233" Title="How to match the function name in a function call?" Tags="|regular-expressions|symbols|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7805" PostTypeId="2" ParentId="7804" CreationDate="2015-01-30T09:15:01.233" Score="1" Body="&lt;p&gt;You want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((str &quot;(test-func&quot;))&#xA;  (if (string-match &quot;^(\\(?:\\s_\\|\\sw\\)+&quot; str)&#xA;      (message &quot;ok&quot;)&#xA;    (message &quot;no match&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\\s_&lt;/code&gt; will match stuff like &lt;code&gt;-&lt;/code&gt;, while &lt;code&gt;\\sw&lt;/code&gt; will actually match the alnum stuff.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There's also a trick using two C functions (probably efficient), if you're operating on a buffer.&#xA;With point &lt;em&gt;right after&lt;/em&gt; &lt;code&gt;(&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read (point-marker))&#xA;=&amp;gt; test-func&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The return result is a Lisp symbol, which might readily be useful.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-30T09:15:01.233" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7806" PostTypeId="1" CreationDate="2015-01-30T10:01:13.973" Score="2" ViewCount="738" Body="&lt;p&gt;I have not found a good way to use &lt;code&gt;ediff&lt;/code&gt; with Mercurial changsets. What I want is basically the functionality of &lt;code&gt;vc-dir&lt;/code&gt;, but for committed changesets. The input should be a changeset identifier, and I want an overview of the changed files, and an easy way to invoke ediff on each file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have experimented with using a wrapper around &lt;code&gt;ediff-directories&lt;/code&gt; as argument to &lt;code&gt;hg extdiff&lt;/code&gt; but I don't get the overview for the changed files to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use mq, but I don't think that should be an issue, as applied patches as far as I can tell are treated as other changesets.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="2688" LastEditDate="2015-03-03T17:38:17.350" LastActivityDate="2017-05-08T09:26:28.427" Title="How to use ediff with (hg) changesets?" Tags="|ediff|version-control|mercurial|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7807" PostTypeId="2" ParentId="5407" CreationDate="2015-01-30T10:03:52.500" Score="1" Body="&lt;p&gt;As pointed out by @Dmitry, it was a bug. With version 0.8.8 from Elpa it works as expected.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastActivityDate="2015-01-30T10:03:52.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7808" PostTypeId="2" ParentId="7785" CreationDate="2015-01-30T11:59:39.523" Score="1" Body="&lt;p&gt;It looks like you tried to pass a sexp rather than a function.  The argument to &lt;code&gt;:predicate&lt;/code&gt; needs to be a proper function, that is, a &lt;code&gt;lambda&lt;/code&gt; in your case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:predicate (lambda () flycheck-jscs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure that I documented this, so I wonder why you tried it in a different way.  Did you find the documentation lacking or unclear?  I'd love to fix it, if possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's little use in the double negation, by the way.  Flycheck only tests for truthy-ness, but never for &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-01-30T11:59:39.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7809" PostTypeId="1" CreationDate="2015-01-30T13:21:12.200" Score="4" ViewCount="449" Body="&lt;p&gt;I'm a fairly extensive user of YAsnippet but there is an annoying niggle when I'm working on shell scripts. The default prog-mode snippets includes &quot;fi&quot; which expands to FIXME. This would be fie but it fires every time I close a if&amp;lt;-&gt;fi statement in BASH. How can I disable this one snippet when I'm in shell-script-mode?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-01-30T13:22:42.943" Title="How can I disable an individual snippet when in shell-script-mode?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7810" PostTypeId="2" ParentId="7809" CreationDate="2015-01-30T13:22:42.943" Score="4" Body="&lt;p&gt;Add something like this below snippet name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# condition: (not (bound-and-true-p shell-script-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-30T13:22:42.943" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7811" PostTypeId="2" ParentId="7653" CreationDate="2015-01-30T14:26:27.977" Score="2" Body="&lt;p&gt;I use the following to exclude &lt;code&gt;loopback&lt;/code&gt; interfaces and also VirtualBox and Docker interfaces.  I hope it's helpful.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tzz-has-network ()&#xA;  (remove-if (lambda (i)&#xA;               (or (string-match-p &quot;\\(vboxnet\\|docker\\).*&quot; i)&#xA;                   (member 'loopback (nth 4 (network-interface-info i)))))&#xA;             (mapcar 'car (network-interface-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-01-30T14:26:27.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7812" PostTypeId="2" ParentId="7802" CreationDate="2015-01-30T14:34:52.127" Score="0" Body="&lt;p&gt;As long as you use the canonical name for the directory, either a hashtable or an alist is functional.  If you expect the user to modify or inspect the data, use an alist.  Otherwise, a hashtable works best and will scale much better.&lt;/p&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-01-30T14:34:52.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7814" PostTypeId="1" AcceptedAnswerId="9719" CreationDate="2015-01-30T15:17:02.493" Score="3" ViewCount="352" Body="&lt;p&gt;&#xA;I'm new to Emacs (after 10+ years of Vim) and want to use it primarily for clojure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coming from Lighttable, one thing I absolute liked was the way it evaluated just the right sections of code no matter where I am. This is basically: Evaluating a paragraph surrounding the cursor position. Some examples (&lt;code&gt;||&lt;/code&gt; represents the cursor, &lt;code&gt;$FROM ... TO$&lt;/code&gt; represents what I'd like to have evaluated):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(comment&#xA;&#xA;$FROM&#xA;(my-func ||[:test :one])&#xA;(xy)TO$&#xA;&#xA;$FROM&#xA;(defn [y]&#xA;  (let [x y]&#xA;    (println|| &quot;xy&quot;)))&#xA;)TO$&#xA;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So basically I want to evaluate the paragraph (Note: Not necessarily a top level form since I surround them in &lt;code&gt;(comment)&lt;/code&gt;). I have no knowledge of Elisp. I tried this as an effort.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cider-eval-paragraph ()&#xA;  (interactive )&#xA;  (safe-excursion&#xA;     (mark-paragraph)&#xA;     (command-execute 'cider-eval-region)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;But I'm clearly making many mistakes.&lt;/strike&gt; Edit: Actually, my example works if I just change &lt;code&gt;safe-excursion&lt;/code&gt; to &lt;code&gt;save-excursion&lt;/code&gt;. Funny, I actually think both spellings makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for reading.&lt;/p&gt;&#xA;" OwnerUserId="5352" LastEditorUserId="5352" LastEditDate="2015-01-30T20:14:58.617" LastActivityDate="2015-03-01T23:26:47.493" Title="Evaluate paragraph in cider" Tags="|elisp|clojure|cider|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7815" PostTypeId="2" ParentId="7814" CreationDate="2015-01-30T17:05:18.157" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt; provides a vi-like experience for LISP dialects, including Clojure.&#xA;It integrates with CIDER.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can eval the current Clojure expression with &lt;kbd&gt;e&lt;/kbd&gt;.&#xA;For instance, starting with this code, with point represented by &lt;code&gt;|&lt;/code&gt;, and CIDER already running:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|(defn sqr [x]&#xA;  (* x x))&#xA;&#xA;(filter odd? (map sqr [1 2 3 4 5]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;e&lt;/kbd&gt;: &lt;code&gt;#'user/sqr&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;je&lt;/kbd&gt;: &lt;code&gt;(1 9 25)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;fe&lt;/kbd&gt;: &lt;code&gt;(1 4 9 16 25)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;fe&lt;/kbd&gt;: &lt;code&gt;[1 2 3 4 5]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;he&lt;/kbd&gt;: &lt;code&gt;(1 4 9 16 25)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;he&lt;/kbd&gt;: &lt;code&gt;(1 9 25)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;ke&lt;/kbd&gt;: &lt;code&gt;#'user/sqr&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to implement something on your own instead, look at &lt;code&gt;lispy&lt;/code&gt;'s &lt;a href=&quot;https://github.com/abo-abo/lispy/blob/master/le-clojure.el&quot; rel=&quot;nofollow&quot;&gt;le-clojure&lt;/a&gt;.&#xA;It's around 100 lines of CIDER integration, but the important stuff for you is something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((str (buffer-substring-no-properties&#xA;             (region-beginning)&#xA;             (region-end)))&#xA;       (res (nrepl-sync-request:eval str))&#xA;       (val (nrepl-dict-get res &quot;value&quot;)))&#xA;  (message &quot;result: %s&quot; val))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-01-30T17:05:18.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7816" PostTypeId="1" CreationDate="2015-01-30T18:11:24.230" Score="9" ViewCount="1429" Body="&lt;p&gt;Is there a simple way to have default text pre-populate in the comment buffer when commiting code with magit?&lt;/p&gt;&#xA;" OwnerUserId="5360" LastEditorUserId="306" LastEditDate="2015-03-03T12:39:34.957" LastActivityDate="2015-03-03T12:41:25.523" Title="Default commit comment for magit" Tags="|magit|git|" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7817" PostTypeId="2" ParentId="7816" CreationDate="2015-01-30T18:18:07.067" Score="5" Body="&lt;p&gt;You want &lt;code&gt;magit-commit-add-log&lt;/code&gt;, probably.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;navigate to a staged hunk&lt;/li&gt;&#xA;&lt;li&gt;call &lt;code&gt;magit-commit-add-log&lt;/code&gt;. It used to be bound to &lt;kbd&gt;C&lt;/kbd&gt;. You'll get&#xA;a Changelog-style entry related to the current hunk's function in the commit message. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-01-30T19:30:47.550" LastActivityDate="2015-01-30T19:30:47.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7818" PostTypeId="2" ParentId="7816" CreationDate="2015-01-30T20:25:58.697" Score="7" Body="&lt;p&gt;If what you're looking for, is a default template message for a commit, you can put this in your &lt;code&gt;.gitconfig&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[commit]&#xA;    template = /path/to/a/.gitcommitmessagetemplate.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And inside .gitcommitmessagetemplate.txt, put whatever you want, example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;type scope: subject&#xA;&#xA;Body&#xA;&#xA;Breaking changes with description of the change, justification&#xA;and migration notes.&#xA;Closes|Refs #&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastEditorUserId="306" LastEditDate="2015-03-03T12:41:25.523" LastActivityDate="2015-03-03T12:41:25.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7819" PostTypeId="2" ParentId="3650" CreationDate="2015-01-30T22:10:19.093" Score="1" Body="&lt;p&gt;This is a bug. It's fixed in Emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can update by building it from source; it's pretty straightforward:&lt;br&gt;&#xA;&lt;a href=&quot;http://ftpmirror.gnu.org/emacs/emacs-24.4.tar.gz&quot; rel=&quot;nofollow&quot;&gt;http://ftpmirror.gnu.org/emacs/emacs-24.4.tar.gz&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-01-30T22:10:19.093" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7820" PostTypeId="1" AcceptedAnswerId="7834" CreationDate="2015-01-30T22:51:59.117" Score="0" ViewCount="274" Body="&lt;p&gt;I'm on Windows. I updated my emacs to 24.4. Now, when trying to open a file that has its extension mapped to the Visual Basic mode at &lt;a href=&quot;http://www.emacswiki.org/emacs/visual-basic-mode.el&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/visual-basic-mode.el&lt;/a&gt;, I get these errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file mode specification error (void-variable \\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Debug stack trace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable \\)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el&quot; nil t)  ; Reading at buffer position 69251&#xA;  load-with-code-conversion(&quot;d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el&quot; &quot;d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el&quot; nil t)&#xA;  visual-basic-mode()&#xA;  set-auto-mode-0(visual-basic-mode nil)&#xA;  set-auto-mode()&#xA;  normal-mode(t)&#xA;  after-find-file(t t)&#xA;  find-file-noselect-1(#&amp;lt;buffer file.vbs&amp;gt; &quot;d:/file.vbs&quot; nil nil &quot;d:/file.vbs&quot; nil)&#xA;  find-file-noselect(&quot;d:/file.vbs&quot; nil nil t)&#xA;  find-file(&quot;d:/file.vbs&quot; t)&#xA;  call-interactively(find-file nil nil)&#xA;  command-execute(find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5363" LastEditorUserId="105" LastEditDate="2015-01-31T00:07:50.287" LastActivityDate="2015-01-31T12:31:42.783" Title="Visual Basic mode doesn't work after update" Tags="|major-mode|microsoft-windows|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7821" PostTypeId="1" CreationDate="2015-01-31T02:35:48.783" Score="6" ViewCount="635" Body="&lt;p&gt;Is there a way to force Emacs to automatically save the current file (if it is not already saved) after typing n characters (n is a number determined by the user).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: After the comment of @Dan and the suggestion of @lawlist it seems that the solution below is less risky: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (setq auto-save-interval 10) ;;; n=10&#xA;&#xA;    (defun force-backup-of-buffer ()&#xA;      (setq buffer-backed-up nil))&#xA;&#xA;    (add-hook 'before-save-hook  'force-backup-of-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I should mention that the above solution is based on &lt;a href=&quot;http://www.emacswiki.org/emacs/ForceBackups&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/ForceBackups&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-02-01T09:33:05.350" LastActivityDate="2015-02-01T09:33:05.350" Title="Automatically saving the current file after typing a certain number of characters" Tags="|buffers|saving|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7822" PostTypeId="1" AcceptedAnswerId="7842" CreationDate="2015-01-31T02:36:35.050" Score="17" ViewCount="3054" Body="&lt;p&gt;In common-lisp we have the library &lt;a href=&quot;http://quickdocs.org/cl-heredoc/api&quot;&gt;cl-heredoc&lt;/a&gt;, is there an equivalent in EmacsLisp?&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2015-01-31T23:35:57.090" Title="Heredoc or equivalent multiline string syntax in Elisp?" Tags="|elisp|string|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7823" PostTypeId="1" AcceptedAnswerId="7839" CreationDate="2015-01-31T02:53:38.547" Score="21" ViewCount="8874" Body="&lt;p&gt;How do you return early from a function before it's ended? For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-func () &#xA; &quot;for example.&quot;&#xA; (unless something (return nil))&#xA; ; continue as usual...&#xA; (+ 42 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="2485" LastEditDate="2015-02-01T01:03:46.673" LastActivityDate="2022-06-19T13:35:47.327" Title="How do you return from a function at an arbitrary point?" Tags="|elisp|functions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7824" PostTypeId="2" ParentId="7823" CreationDate="2015-01-31T03:07:26.953" Score="27" Body="&lt;p&gt;We have a number of options available.  In general, what you are looking for is a &amp;quot;nonlocal exit&amp;quot;; see &lt;a href=&quot;https://gnu.org/s/emacs/manual/html_node/elisp/Nonlocal-Exits.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(info &amp;quot;(elisp) Nonlocal Exits&amp;quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2&gt;Throw&lt;/h2&gt;&#xA;&lt;p&gt;You can &lt;code&gt;catch&lt;/code&gt; / &lt;code&gt;throw&lt;/code&gt; to exit the function with a value.  See &lt;a href=&quot;https://gnu.org/s/emacs/manual/html_node/elisp/Catch-and-Throw.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(info &amp;quot;(elisp) Catch and Throw&amp;quot;)&lt;/code&gt;&lt;/a&gt; for details.&lt;/p&gt;&#xA;&lt;p&gt;example:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-func ()&#xA;  &amp;quot;Simplistic `catch'/`throw' example.&amp;quot;&#xA;  (catch 'my-early-return&#xA;    (when t&#xA;      (throw 'my-early-return &amp;quot;this is the short-circuit result of catch&amp;quot;))&#xA;    &amp;quot;this is the fallback result of catch&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;Block&lt;/h2&gt;&#xA;&lt;p&gt;You can also use &lt;code&gt;cl-block&lt;/code&gt; and &lt;code&gt;cl-return-from&lt;/code&gt; (although you will need to require &lt;code&gt;cl-lib&lt;/code&gt;).  See &lt;a href=&quot;https://gnu.org/s/emacs/manual/html_node/cl/Blocks-and-Exits.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(info &amp;quot;(cl) Blocks and Exits&amp;quot;)&lt;/code&gt;&lt;/a&gt; for details.&lt;/p&gt;&#xA;&lt;p&gt;example:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'cl-lib))&#xA;&#xA;(defun my-func ()&#xA;  &amp;quot;Simplistic `cl-block'/`cl-return-from' example.&amp;quot;&#xA;  (cl-block my-func&#xA;    (when t&#xA;      (cl-return-from my-func))&#xA;    (1+ 42)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;cl-defun&lt;/h2&gt;&#xA;&lt;p&gt;We also have &lt;code&gt;cl-defun&lt;/code&gt; which has an implicit &lt;code&gt;cl-block&lt;/code&gt; with the same name as the function, so we can use the &lt;code&gt;cl-block&lt;/code&gt; style with less typing.&lt;/p&gt;&#xA;&lt;p&gt;example:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'cl-lib))&#xA;&#xA;(cl-defun my-func ()&#xA;  &amp;quot;Simplistic `cl-defun' implicit block example.&amp;quot;&#xA;  (when t&#xA;    (cl-return-from my-func)) ; `my-func' is an implicit block.&#xA;  (+ 42 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2&gt;defun*&lt;/h2&gt;&#xA;&lt;p&gt;In old Emacsen, specifically Emacs 24.2 and earlier, &lt;code&gt;cl-defun&lt;/code&gt; was provided as &lt;code&gt;defun*&lt;/code&gt; by the now-obsolete library &lt;code&gt;cl.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;example:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'cl))&#xA;&#xA;(defun* my-func ()&#xA;  &amp;quot;Simplistic `defun*' implicit block example.&amp;quot;&#xA;  (when t&#xA;    (return-from my-func)) ; `my-func' is an implicit block.&#xA;  (+ 42 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note, however, that in Emacsen that old you can instead install &lt;code&gt;cl-lib&lt;/code&gt; as a compatibility layer from GNU[-devel] ELPA:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://elpa.gnu.org/packages/cl-lib.html&quot; rel=&quot;noreferrer&quot;&gt;https://elpa.gnu.org/packages/cl-lib.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://elpa.gnu.org/devel/cl-lib.html&quot; rel=&quot;noreferrer&quot;&gt;https://elpa.gnu.org/devel/cl-lib.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="15748" LastEditDate="2022-06-19T13:35:47.327" LastActivityDate="2022-06-19T13:35:47.327" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="7825" PostTypeId="2" ParentId="7821" CreationDate="2015-01-31T03:08:32.573" Score="8" Body="&lt;p&gt;Emacs has an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save.html&quot;&gt;&lt;code&gt;auto-save&lt;/code&gt;&lt;/a&gt; feature that can be adapted to suit your needs.  You can customize &lt;code&gt;auto-save-interval&lt;/code&gt; to determine how many characters:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;auto-save-interval&lt;/code&gt; is a variable defined in `C source code'.&#xA;  Its value is 300&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Number of input events between auto-saves.&#xA;  Zero means disable autosaving due to number of characters typed.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-31T03:08:32.573" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7826" PostTypeId="1" AcceptedAnswerId="7827" CreationDate="2015-01-31T05:52:48.837" Score="28" ViewCount="3146" Body="&lt;p&gt;I an academic and I love to do as much of my writing as possible in Emacs. A key thing that is missing for me is the ability to easily review the changes I have made to a text file over time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tracking features on Wikipedia articles or Google Documents are both along the lines of what I am looking for. I have played with version control systems like git because they seem to be well supported by Emacs, but I found them difficult to use and far more complex then what I need. Registering repositories, checking in and out, all that was just troublesome. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't suppose there are any packages out there that provide the functionality I am looking for in a relatively user-friendly way?&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2015-05-19T03:10:29.347" LastActivityDate="2015-10-23T10:24:44.013" Title="Is there a simplified version control system appropriate for non-coders writing in Emacs?" Tags="|version-control|writing|" AnswerCount="7" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7827" PostTypeId="2" ParentId="7826" CreationDate="2015-01-31T09:52:16.520" Score="43" Body="&lt;p&gt;The problem with existing version control systems is not so much their complexity; it's the fact that there is such a wealth of information out there that it can be very difficult for beginners to see the forest for the trees (i.e., to figure out what they do and don't need to learn when they are just getting started).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This post is going to focus on &lt;code&gt;git&lt;/code&gt;, and describe how to control it from Emacs using an add-on package called &lt;code&gt;magit&lt;/code&gt;. &lt;em&gt;Yes&lt;/em&gt;, &lt;code&gt;git&lt;/code&gt; is complex, but you don't need to learn a lot to use it productively for the purpose you describe. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to assume that you have &lt;code&gt;git&lt;/code&gt; installed (if you don't, get it &lt;a href=&quot;http://git-scm.com/downloads&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;), and that you don't want to leave Emacs at all.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Installing &lt;code&gt;magit&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/magit/magit&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;magit&lt;/code&gt;&lt;/a&gt; is a &lt;code&gt;git&lt;/code&gt; front-end for Emacs. It is available from &lt;a href=&quot;http://melpa.org/&quot; rel=&quot;noreferrer&quot;&gt;MELPA&lt;/a&gt; and you can install it via:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;package-install&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;magit&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;On the off chance that you haven't enabled MELPA in your configuration, you can find instructions on how to do that &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Setting up a repository&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's say you have a folder called &lt;code&gt;~/writing&lt;/code&gt; in your home directory that contains one or more documents that you'd like to put under version control.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open the folder in Dired: &lt;kbd&gt;C-x d&lt;/kbd&gt; &lt;code&gt;~/writing&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Open a shell: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;shell&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;git init&lt;/code&gt; and hit &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That's it. You now have a &lt;code&gt;git&lt;/code&gt; repository. There is no need to &quot;register&quot; it anywhere. &lt;code&gt;git&lt;/code&gt; is a &lt;em&gt;distributed&lt;/em&gt; version control system; it does not require a remote server to track changes.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Checking the status of your repository&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Switch back to the Dired buffer that lists the files in your repository.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;magit-status&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can think of the buffer that comes up as your &quot;control panel&quot; for working with your repository. For a new repository, it looks something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Lvv5T.png&quot; alt=&quot;Magit status buffer for newly created repository&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can navigate between different sections of this buffer using &lt;kbd&gt;n&lt;/kbd&gt; (&lt;code&gt;magit-goto-next-section&lt;/code&gt;) and &lt;kbd&gt;p&lt;/kbd&gt; (&lt;code&gt;magit-goto-previous-section&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can refresh the buffer by pressing &lt;kbd&gt;g&lt;/kbd&gt; (&lt;code&gt;magit-refresh&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that you can bring up the status buffer from any file or directory that belongs to the repository you set up earlier.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Adding files&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As you can see in the screenshot, there are three files in the repository that &lt;code&gt;git&lt;/code&gt; is not currently tracking. To tell &lt;code&gt;git&lt;/code&gt; to start tracking a file, you need to &lt;em&gt;stage&lt;/em&gt; it: With point on the file you want to add, press &lt;kbd&gt;s&lt;/kbd&gt;. The status buffer will then look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KqTQj.png&quot; alt=&quot;Magit status buffer after adding file-1.txt&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Committing&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;After staging one or more files, you can &lt;em&gt;commit&lt;/em&gt; them by pressing &lt;kbd&gt;c c&lt;/kbd&gt;. This will bring up a buffer that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qMRaD.png&quot; alt=&quot;Magit buffer for entering commit message&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter your commit message at the top and then press &lt;kbd&gt;C-c C-c&lt;/kbd&gt; to finalize the commit. (To abort, press &lt;kbd&gt;C-c C-k&lt;/kbd&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The status buffer will then look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/co06Y.png&quot; alt=&quot;Magit status buffer after first commit&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Staging changes&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you make changes to a tracked file, they will be listed in a separate section (&quot;Unstaged changes&quot;) in the status buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PTZQp.png&quot; alt=&quot;Unstaged changes (collapsed)&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To review the changes that you made to the file, navigate to the line that that says &lt;code&gt;Modified file-1.txt&lt;/code&gt; and press &lt;kbd&gt;TAB&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jeGx0.png&quot; alt=&quot;Unstaged changes (expanded)&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To stage these changes, press &lt;kbd&gt;s&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bCwAZ.png&quot; alt=&quot;Magit status buffer after staging changes to tracked file&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Viewing past commits&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Finally, if you want to review past commits, you can press &lt;kbd&gt;l l&lt;/kbd&gt; (that's two lower-case L's):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/eRLVj.png&quot; alt=&quot;Magit log buffer&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As usual, you can navigate the buffer that comes up with &lt;kbd&gt;n&lt;/kbd&gt; and &lt;kbd&gt;p&lt;/kbd&gt;. Magit will show the changes associated with individual commits listed in this buffer in a separate window.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Summary&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From the shell:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;git init&lt;/code&gt;: Initialize &lt;code&gt;git&lt;/code&gt; repository in current directory&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From any file or directory associated with a &lt;code&gt;git&lt;/code&gt; repository:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;magit-status&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From the status buffer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;s&lt;/kbd&gt; to add new files or stage changes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;c c&lt;/kbd&gt; to commit staged changes&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c C-c&lt;/kbd&gt; to finalize commit&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c C-k&lt;/kbd&gt; to abort commit&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;l l&lt;/kbd&gt; to view commit logs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;That's it.&lt;/strong&gt; :)&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-05-18T14:49:36.647" LastActivityDate="2015-05-18T14:49:36.647" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7828" PostTypeId="1" AcceptedAnswerId="7829" CreationDate="2015-01-31T11:10:29.087" Score="1" ViewCount="62" Body="&lt;p&gt;What is the correct eval expression which shows the current character in the message area?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following but they don't work.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message (char-after))&#xA;(message '(char-after))&#xA;(message 'char-after)&#xA;(message char-after)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="50" LastEditDate="2015-01-31T13:10:01.710" LastActivityDate="2015-01-31T13:10:01.710" Title="eval-expression that shows the current character" Tags="|elisp|message|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7829" PostTypeId="2" ParentId="7828" CreationDate="2015-01-31T11:21:58.547" Score="3" Body="&lt;p&gt;Just convert the result of &lt;code&gt;(char-after)&lt;/code&gt; to &lt;code&gt;string&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message (string (char-after)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2526" LastActivityDate="2015-01-31T11:21:58.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7830" PostTypeId="2" ParentId="7826" CreationDate="2015-01-31T11:30:57.627" Score="1" Body="&lt;p&gt;While it's absolutelly unrelated to &lt;code&gt;emacs&lt;/code&gt;, you can still save your text files to Dropbox and if you're a pro user you can use the &lt;a href=&quot;https://www.dropbox.com/help/113/&quot; rel=&quot;nofollow noreferrer&quot;&gt;extended version history&lt;/a&gt;. (If you want encrytion, you might want to look at &lt;a href=&quot;http://sparkleshare.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SparkleShare&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there is &lt;a href=&quot;https://github.com/commandline/flashbake&quot; rel=&quot;nofollow noreferrer&quot;&gt;flashbake&lt;/a&gt; which is a bit automated (&lt;a href=&quot;http://lifehacker.com/5232049/flashbake-automates-version-control-for-nerdy-writers&quot; rel=&quot;nofollow noreferrer&quot;&gt;here is a tutorial&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also it was &lt;a href=&quot;https://writers.stackexchange.com/questions/7249/whats-the-best-version-control-system-for-a-book-writer&quot;&gt;asked&lt;/a&gt; &lt;a href=&quot;https://superuser.com/questions/368231/automatic-versioning-upon-file-change-modify-create-delete&quot;&gt;elsewhere&lt;/a&gt; &lt;a href=&quot;https://writers.stackexchange.com/questions/289/do-you-use-any-version-controlling-software-methods-as-writers&quot;&gt;too&lt;/a&gt;, for which the answers you might find useful.&lt;/p&gt;&#xA;" OwnerUserId="473" LastEditorUserId="-1" LastEditDate="2017-04-13T12:40:23.880" LastActivityDate="2015-01-31T11:30:57.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7831" PostTypeId="2" ParentId="7826" CreationDate="2015-01-31T12:02:23.887" Score="7" Body="&lt;p&gt;As was mentioned, a simple way to have different versions of a file is Emacs backup system.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/emacs-backups&quot;))&#xA;      version-control 'numbered&#xA;      make-backup-files t&#xA;      delete-old-versions 'never)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will use a dedicated directory for numbered backups, which will never automatically deleted.  Then you can use &lt;kbd&gt;C-u C-x C-s&lt;/kbd&gt; to make another version at any time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though, I think, there is no easy, ready to use interface for e.g. diffing these versions.  So you'd have to manually open one or two of those backups and use &lt;code&gt;ediff-buffers&lt;/code&gt; on them and/or the original buffer.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="675" LastEditDate="2015-05-18T22:54:15.767" LastActivityDate="2015-05-18T22:54:15.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7832" PostTypeId="1" AcceptedAnswerId="7836" CreationDate="2015-01-31T12:17:31.180" Score="15" ViewCount="2153" Body="&lt;p&gt;&lt;kbd&gt;C-[&lt;/kbd&gt; is equivalent to the escape key on US English keyboards, thus, any attempt at binding it will mess up &lt;kbd&gt;M-&lt;/kbd&gt; behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs seems to have no trouble telling &lt;kbd&gt;&amp;lt;escape&amp;gt;&lt;/kbd&gt; and &lt;kbd&gt;C-[&lt;/kbd&gt; apart in GUI frames. The following works fine and bindings starting with &lt;kbd&gt;M-&lt;/kbd&gt; remain to be working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;escape&amp;gt;&quot;) (lambda () (interactive) (message &quot;&amp;lt;escape&amp;gt;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I bind&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-[&quot;) (lambda () (interactive) (message &quot;C-[&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;suddenly emacs goes crazy and binding like &lt;kbd&gt;M-x&lt;/kbd&gt; break. Moreover, pressing &lt;kbd&gt;C-[&lt;/kbd&gt; refuses to trigger the bound lambda. Interestingly enough, &lt;kbd&gt;C-x @ c [&lt;/kbd&gt; (apply modifier control to open bracket) still says &lt;code&gt;C-[ is undefined&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way of binding something to &lt;kbd&gt;C-[&lt;/kbd&gt; without breaking emacs?&lt;/p&gt;&#xA;" OwnerUserId="5368" LastEditorUserId="50" LastEditDate="2015-01-31T13:19:10.727" LastActivityDate="2019-08-27T15:29:00.533" Title="How to bind C-[ for real?" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7833" PostTypeId="2" ParentId="7826" CreationDate="2015-01-31T12:26:18.580" Score="12" Body="&lt;p&gt;In addition to &lt;code&gt;magit&lt;/code&gt; (as @itsjeyd's answer ably demonstrates), you can also try &lt;a href=&quot;https://github.com/pidu/git-timemachine&quot;&gt;&lt;code&gt;git-timemachine&lt;/code&gt;&lt;/a&gt;, which provides facilities for quick cycling through older versions of a file under &lt;code&gt;git&lt;/code&gt; version control.  According to its github page, the following default keybindings give you a sense of what you can do:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;p&lt;/code&gt; Visit previous historic version&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;n&lt;/code&gt; Visit next historic version&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;w&lt;/code&gt; Copy the abbreviated hash of the current historic version&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;W&lt;/code&gt; Copy the full hash of the current historic version&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;q&lt;/code&gt; Exit the time machine.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-31T12:26:18.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7834" PostTypeId="2" ParentId="7820" CreationDate="2015-01-31T12:31:42.783" Score="1" Body="&lt;p&gt;The debug message says that there's a problem at position 69251, so you can visit &lt;code&gt;visual-basic-mode.el&lt;/code&gt; and &lt;code&gt;(goto-char 69251)&lt;/code&gt; to inspect the text and see what the problem is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out that, if you're using the file from the &lt;a href=&quot;http://www.emacswiki.org/emacs/visual-basic-mode.el&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki&lt;/a&gt;, position 69251 corresponds to the first non-comment line after &lt;code&gt;(provide 'visual-basic-mode)&lt;/code&gt;.  There's a lot of junk from here to the bottom of the file, so it looks like someone accidentally pasted some scratch work here and forgot to remove it.  Either comment it out or delete it, and you should be fine.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-01-31T12:31:42.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7835" PostTypeId="2" ParentId="7826" CreationDate="2015-01-31T13:10:17.333" Score="8" Body="&lt;p&gt;I suspect you'll find &lt;a href=&quot;https://github.com/chadbraunduin/backups-mode&quot;&gt;Backups Mode&lt;/a&gt; and/or &lt;a href=&quot;https://github.com/lewang/backup-walker&quot;&gt;Backup Walker&lt;/a&gt; very interesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both aim to leverage the existing backup mechanisms in Emacs, and provide better access to and visibility of your file history, without requiring an additional VCS.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-01-31T13:10:17.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7836" PostTypeId="2" ParentId="7832" CreationDate="2015-01-31T13:20:37.213" Score="0" Body="&lt;p&gt;The following solution is a bit kludky, but seems to work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &lt;code&gt;~/.xbindkeysrc&lt;/code&gt; contain the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;xvkbd -xsendevent -text '\[Control_L]\[F13]'&quot;&#xA;  m:0x14 + c:34&#xA;&#xA;&quot;xvkbd -xsendevent -text '\[Control_L]\[F14]'&quot;&#xA;  m:0x14 + c:35&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;xbindkeys&lt;/code&gt; will translate &lt;kbd&gt;C-[&lt;/kbd&gt; to &lt;kbd&gt;C-&amp;lt;f13&amp;gt;&lt;/kbd&gt; and &lt;kbd&gt;C-]&lt;/kbd&gt; to &lt;kbd&gt;C-&amp;lt;f14&amp;gt;&lt;/kbd&gt;, so they can be bound in emacs freely. You will probably want to bind &lt;code&gt;abort-recursive-edit&lt;/code&gt; to something other than &lt;kbd&gt;C-]&lt;/kbd&gt;, for example, &lt;kbd&gt;C-S-g&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside is that now &lt;kbd&gt;C-[&lt;/kbd&gt; is broken in every application except Emacs, which could be fixed by adding some logic to test whether the key combination is being sent to emacs...&lt;/p&gt;&#xA;" OwnerUserId="5368" LastActivityDate="2015-01-31T13:20:37.213" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7837" PostTypeId="1" AcceptedAnswerId="7841" CreationDate="2015-01-31T16:04:13.050" Score="1" ViewCount="37" Body="&lt;p&gt;I am aware that this is a bit of training wheels, and that I should just trust Emacs and my keystrokes. But I think part of it is just that there's a context switch involved and I have too long of habits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two visible windows: &lt;code&gt;test.py&lt;/code&gt; in one, the inferior process &lt;code&gt;*Python[/.../test.py]&lt;/code&gt; in the other. The active is buffer for &lt;code&gt;test.py&lt;/code&gt;. I evaluate buffer with &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like visual feedback (in either buffer) that the code was evaluated. A blink in &lt;code&gt;test.py&lt;/code&gt; would probably be better than something in &lt;code&gt;*Python...]&lt;/code&gt; since I'd like a cross language solution, not just something specific for Python.&lt;/p&gt;&#xA;" OwnerUserId="4034" LastActivityDate="2015-01-31T23:32:54.343" Title="Signal a buffer was evaluated in an inferior process?" Tags="|hooks|repl|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7838" PostTypeId="2" ParentId="7822" CreationDate="2015-01-31T16:37:39.990" Score="2" Body="&lt;p&gt;If you are configuring emacs via an init.el file you might want to consider using an &lt;a href=&quot;https://emacs.stackexchange.com/questions/3143/can-i-use-org-mode-to-structure-my-emacs-or-other-el-configuration-file/&quot;&gt;init.org&lt;/a&gt; instead. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can use constructs like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: arbitrary-text&#xA;#+begin_src xml&#xA;&amp;lt;some&amp;gt;&#xA;  &amp;lt;random src=&quot;xml&quot;&amp;gt;or whatever... includes syntax highlighting!&amp;lt;/random&amp;gt;&#xA;&amp;lt;/some&amp;gt;&#xA;#+end_src&#xA;&#xA;&#xA;#+begin_src emacs-lisp :var arb-text=arbitrary-text&#xA;(eval `(defun a-test ()&#xA;         (format &quot;whoop there it is: %S&quot; ,arb-text)))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you look in the generated &lt;code&gt;.el&lt;/code&gt; file you will see something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((arb-text &quot;escaped text here...&quot;))&#xA;  (eval `(defun a-test ()&#xA;           (format &quot;whoop there it is: %S&quot; ,arb-text))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can put the text and the code in any order. You can add names to Org lists, tables etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is for a library where you may not want to force collaborators to also use 'literate programming' then you could put the bulk of the code into an &lt;code&gt;.el&lt;/code&gt; file and generate an auxiliary &lt;code&gt;.el&lt;/code&gt; file using Org -- check the generated code into revision control.&lt;/p&gt;&#xA;" OwnerUserId="5373" LastActivityDate="2015-01-31T16:37:39.990" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7839" PostTypeId="2" ParentId="7823" CreationDate="2015-01-31T18:48:15.277" Score="8" Body="&lt;p&gt;In addition to what @EmacsFodder covered, just raise an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will not help if the code is called within (dynamically, not lexically) the extent of error-handling constructs such as &lt;code&gt;ignore-errors&lt;/code&gt; or &lt;code&gt;condition-case&lt;/code&gt;, but otherwise it is a fine way to exit a function. It is in fact what is done most of the time.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-func () &#xA; &quot;...&quot;&#xA; (unless something (error &quot;Whoops!&quot;))&#xA; ; continue as usual...&#xA; (+ 42 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to handle the error yourself then you can put the calling code (e.g. the call to something that ulimately calls &lt;code&gt;my-func&lt;/code&gt;) inside a &lt;code&gt;condition-case&lt;/code&gt;.&#xA;Again, this is what is done most of the time, at least as often as using &lt;code&gt;catch&lt;/code&gt; + &lt;code&gt;throw&lt;/code&gt;. It all depends on what behavior you want.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:26:54.537" LastActivityDate="2015-05-09T20:26:54.537" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7840" PostTypeId="2" ParentId="477" CreationDate="2015-01-31T20:52:41.420" Score="8" Body="&lt;p&gt;You can save all org buffers whenever a particular agenda function is called. For instance, to save all org buffers after you quit the agenda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-agenda-quit :before 'org-save-all-org-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could save all org-buffers after each edit, say after a deadline is added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-deadline :after 'org-save-all-org-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will work both in org-agenda and org buffers. Use &lt;code&gt;org-agenda-deadline&lt;/code&gt; instead if you want to restrict auto-saves to the agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do the same for any org function, so this method allows you to choose exactly when to save org buffers. This approach covers some corner cases that the method by @Sigma misses: you can have your agenda changes saved even if you leave the agenda before &lt;code&gt;auto-save&lt;/code&gt; has a chance to trigger, or make changes outside the agenda and forget to save them. &lt;strike&gt;I personally use both methods to cover all my bases.&lt;/strike&gt; [Edit: See comment on @Sigma solution for why I no longer use his solution.]&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2017-04-11T22:31:35.603" LastActivityDate="2017-04-11T22:31:35.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7841" PostTypeId="2" ParentId="7837" CreationDate="2015-01-31T23:32:54.343" Score="1" Body="&lt;p&gt;Looking at the code, I didn't see an obvious hook that is run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the problem can still be solved using advice.  I would suggest using &quot;after&quot; advice on &lt;code&gt;python-shell-send-string&lt;/code&gt;.  You could have it flash the current window (see whatever &lt;code&gt;visible-bell&lt;/code&gt; does), or play a whooshing sound, or whatever you like.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-01-31T23:32:54.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7842" PostTypeId="2" ParentId="7822" CreationDate="2015-01-31T23:35:57.090" Score="7" Body="&lt;p&gt;Ordinary Emacs Lisp strings are multi-line-capable.  You can simply put newlines in them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Glancing at &lt;code&gt;cl-heredoc&lt;/code&gt;, it sounds like what you are looking for is &quot;raw&quot; strings.  There was a proposal to add these to elisp a while back, but unfortunately it was rejected.  (I hope rather than expect it could be resurrected.)  Nor does elisp have the reader extensibility features needed to implement this oneself.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-01-31T23:35:57.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7843" PostTypeId="2" ParentId="5330" CreationDate="2015-01-31T23:46:45.327" Score="0" Body="&lt;p&gt;If I understand the problem correctly, it is that you would like to preserve all the newlines in the buffer as they are; but you would like to display some of them as spaces.  Then, you'd like word-wrapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For word-wrapping I think you can use &lt;code&gt;visual-line-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For dealing with the newlines, I think you could perhaps put a &lt;code&gt;display&lt;/code&gt; property with &lt;code&gt;&quot; &quot;&lt;/code&gt; (a string consisting of a single space) as a value on the newlines you want to display differently.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-01-31T23:46:45.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7844" PostTypeId="1" AcceptedAnswerId="8168" CreationDate="2015-02-01T00:33:12.137" Score="4" ViewCount="596" Body="&lt;h2&gt;Desired behaviour&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;While editing code blocks with &lt;code&gt;org-mode&lt;/code&gt; by pressing &lt;kbd&gt;C-c '&lt;/kbd&gt; I'd like &lt;a href=&quot;http://www.flycheck.org/&quot; rel=&quot;nofollow&quot;&gt;Flycheck&lt;/a&gt; to resolve relevant configuration&#xA;the same way it does for normal files. I'm using JavaScript, and these are &lt;code&gt;.jshintrc&lt;/code&gt; files within the same ancestry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more specific, I'd like the &lt;code&gt;.jshintrc&lt;/code&gt; settings to be picked up while editing code if I had my project arranged like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/project/file.org&#xA;~/project/.jshintrc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work, but is my ideal behavior.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Lame solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The following setup works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/project/file.org&#xA;~/.jshintrc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's not desirable because it sets defaults across all my projects.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Possible solutions&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if the following solutions are good ideas, and I'm unsure how implement them:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Set &lt;code&gt;buffer-file-name&lt;/code&gt; of local buffer when editing source code blocks in &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add another function to &lt;code&gt;flycheck-locate-config-file-functions&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Rationale&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Looking at the Flycheck source, my &quot;lame solution&quot; works because Flycheck looks at the home directory in case other attempts to look up the configuration fail. This behavior is defined by &lt;code&gt;flycheck-locate-config-file-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;flycheck-locate-config-file-ancestor-directories&lt;/code&gt; looks like the function I'd like to succeed in finding the configuration file. It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun flycheck-locate-config-file-ancestor-directories (filename _checker)&#xA;  &quot;Locate a configuration FILENAME in ancestor directories.&#xA;&#xA;If the current buffer has a file name, search FILENAME in the&#xA;directory of the current buffer and all ancestors thereof (see&#xA;`locate-dominating-file').  If the file is found, return its&#xA;absolute path.  Otherwise return nil.&#xA;&#xA;_CHECKER is ignored.&quot;&#xA;  (-when-let* ((basefile (buffer-file-name))&#xA;               (directory (locate-dominating-file basefile filename)))&#xA;    (expand-file-name filename directory)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, if &lt;code&gt;buffer-file-name&lt;/code&gt; is set to an appropriate value we should be good. So what is its value for my code buffer? &lt;code&gt;nil&lt;/code&gt;. OK, so what are the effects of setting this variable locally for Org code buffers (and how do I do this whenever I enter from &lt;code&gt;org-mode&lt;/code&gt; with &lt;kbd&gt;C-c '&lt;/kbd&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if I add my own look-up function to &lt;code&gt;flycheck-locate-config-file-functions&lt;/code&gt;, that may solve the problem. But how would I resolve the directory of the current &lt;code&gt;.org&lt;/code&gt; file from the buffer that lets me edit the JavaScript source?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simpler solution is welcome as well.&lt;/p&gt;&#xA;" OwnerUserId="4090" LastEditorUserId="504" LastEditDate="2015-02-03T08:32:10.273" LastActivityDate="2015-02-13T08:34:09.070" Title="org-mode: have flycheck resolve relative config while editing code blocks" Tags="|org-mode|org-babel|buffer-local|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7845" PostTypeId="1" AcceptedAnswerId="7865" CreationDate="2015-02-01T04:04:34.937" Score="26" ViewCount="7398" Body="&lt;p&gt;I want to know how can I set a repetitive task for only a range of days of the week, for instance from Monday to Friday only.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2022-03-01T08:45:15.227" Title="org-habit - do a repetitive task certain days of the week only?" Tags="|org-mode|org-habit|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7846" PostTypeId="5" CreationDate="2015-02-01T04:05:33.737" Score="0" Body="&lt;p&gt;Org habits are a special category of TODO entries for repeating tasks. An Org habit is a TODO item whose STYLE property is set to &lt;code&gt;habit&lt;/code&gt;. It has a scheduled date with a repeat interval.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/tracking-habits.html&quot; rel=&quot;nofollow&quot;&gt;Org tutorial&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Tracking-your-habits.html&quot; rel=&quot;nofollow&quot;&gt;Org manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-02-01T18:45:57.887" LastActivityDate="2015-02-01T18:45:57.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7847" PostTypeId="4" CreationDate="2015-02-01T04:05:33.737" Score="0" Body="Org habits are a special category of TODO entries for repeating tasks" OwnerUserId="690" LastEditorUserId="25" LastEditDate="2015-02-01T18:45:54.217" LastActivityDate="2015-02-01T18:45:54.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7848" PostTypeId="1" AcceptedAnswerId="7850" CreationDate="2015-02-01T04:39:27.423" Score="1" ViewCount="163" Body="&lt;p&gt;I messed up my latex code; I need to replace &lt;code&gt;\cite[42]{source}.&lt;/code&gt; with &lt;code&gt;.\cite[42]{source}&lt;/code&gt; and &lt;code&gt;\cite{source}.&lt;/code&gt; with &lt;code&gt;.\cite{source}&lt;/code&gt;. I tried &lt;code&gt;\\cite\(.*\)\}\. -&amp;gt; .\\cite\1\}&lt;/code&gt; but I got an error: &lt;code&gt;Invalid use of '\' in replacement text&lt;/code&gt;. How do I fix this?&lt;/p&gt;&#xA;" OwnerUserId="5376" LastActivityDate="2015-02-01T05:01:40.867" Title="Regexp not working" Tags="|latex|auctex|text-editing|replace|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7850" PostTypeId="2" ParentId="7848" CreationDate="2015-02-01T05:01:40.867" Score="2" Body="&lt;p&gt;You don't backslash the curly brace &lt;code&gt;}&lt;/code&gt; in the replacement text.  This works, when entered at the &lt;code&gt;query-replace-regexp&lt;/code&gt; prompt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FROM: &lt;code&gt;\\cite\(.+\)}\.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TO: &lt;code&gt;.\\cite\1}&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-02-01T05:01:40.867" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7852" PostTypeId="1" AcceptedAnswerId="7854" CreationDate="2015-02-01T05:43:01.677" Score="21" ViewCount="6027" Body="&lt;p&gt;Say that emacs throws some error that I don't understand. Or maybe the error says &quot;Symbol's value as variable is void: modes&quot;, but there are many occurrences of the symbol &lt;code&gt;modes&lt;/code&gt; in my code, so I need some context. Can Emacs be configured to mention the line number of the lisp code so I can know what code is causing the error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried doing &lt;code&gt;(setq stack-trace-on-error '(buffer-read-only))&lt;/code&gt; and ran the perpetrating code in an effort to get a stack trace. No stack trace either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried calling &lt;code&gt;edebug-defun&lt;/code&gt; on my function and stepping through it. It is not until I step out of the function that the error is thrown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am really not as interested in the cause of the particular error I am facing currently as I am in developing general debugging skills for elisp. Please advise on how I can gleam a line number, or a sexp, or a stack trace from an error.)&lt;/p&gt;&#xA;" OwnerUserId="2631" LastEditorUserId="2631" LastEditDate="2015-02-08T19:06:14.703" LastActivityDate="2018-09-11T04:37:07.743" Title="Show line number on error" Tags="|debugging|error-handling|line-numbers|edebug|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7853" PostTypeId="1" AcceptedAnswerId="8008" CreationDate="2015-02-01T07:21:02.953" Score="11" ViewCount="283" Body="&lt;p&gt;If I do &lt;code&gt;M-x forward-char&lt;/code&gt;, Emacs gives a very useful message &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You can run the command &quot;forward-char&quot; with C-f.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Considering the fact that Emacs can find all LaTeX keybindings in the file &lt;code&gt;latex.el&lt;/code&gt; under &lt;code&gt;LaTeX-math-default&lt;/code&gt; provided by AUCTeX, &#xA;is it possible that in LaTeX mode (AUCTeX) Emacs recalls me the Keybindings?&#xA;For example after typing &lt;code&gt;\sigma&lt;/code&gt; Emacs shows a message that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You can insert &quot;\sigma&quot; by `s .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This would be very useful as it permits to gradually learn the keybindings in LaTeX mode.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-02-06T21:11:39.863" Title="Gradually learning the keybindings provided by AUCTeX" Tags="|latex|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7854" PostTypeId="2" ParentId="7852" CreationDate="2015-02-01T08:03:12.500" Score="20" Body="&lt;p&gt;Emacs provides a good amount of debugging facilities including &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt;, &lt;code&gt;M-x toggle-debug-on-quit&lt;/code&gt;, debug on signal (which can be used by sending &lt;code&gt;USR2&lt;/code&gt; to Emacs from outside), &lt;code&gt;debug-on-entry&lt;/code&gt; (of a function), &lt;code&gt;debug-on-message&lt;/code&gt; (when seeing a specific regexp match of a message) and finally, &lt;code&gt;debug&lt;/code&gt; itself as alternative to instrumenting a function with &lt;code&gt;C-u C-M-x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both &lt;code&gt;debug&lt;/code&gt; and &lt;code&gt;edebug&lt;/code&gt; offer enough functionality to inspect the &lt;em&gt;state&lt;/em&gt; of Emacs when evaluating the code that you're interested in, hit &lt;code&gt;e&lt;/code&gt; and enter an expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, while &lt;code&gt;edebug&lt;/code&gt; jumps to the place in the instrumented function and therefore gives you a clue where to look (which is kind of silly since you already know what exactly you've instrumented), &lt;code&gt;debug&lt;/code&gt; doesn't do this at all.  I've pulled off a smaller hack after discovering that whenever &lt;code&gt;debug&lt;/code&gt; evaluates a buffer, it emits the value of point associated with the error; in other words using this information on the buffer can give you a line number in the backtrace!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'debug&#xA;  (defun debugger-setup-buffer (debugger-args)&#xA;    &quot;Initialize the `*Backtrace*' buffer for entry to the debugger.&#xA;That buffer should be current already.&quot;&#xA;    (setq buffer-read-only nil)&#xA;    (erase-buffer)&#xA;    (set-buffer-multibyte t)        ;Why was it nil ?  -stef&#xA;    (setq buffer-undo-list t)&#xA;    (let ((standard-output (current-buffer))&#xA;          (print-escape-newlines t)&#xA;          (print-level 8)&#xA;          (print-length 50))&#xA;      (backtrace))&#xA;    (goto-char (point-min))&#xA;    (delete-region (point)&#xA;                   (progn&#xA;                     (search-forward &quot;\n  debug(&quot;)&#xA;                     (forward-line (if (eq (car debugger-args) 'debug)&#xA;                                       2    ; Remove implement-debug-on-entry frame.&#xA;                                     1))&#xA;                     (point)))&#xA;    (insert &quot;Debugger entered&quot;)&#xA;    ;; lambda is for debug-on-call when a function call is next.&#xA;    ;; debug is for debug-on-entry function called.&#xA;    (pcase (car debugger-args)&#xA;      ((or `lambda `debug)&#xA;       (insert &quot;--entering a function:\n&quot;))&#xA;      ;; Exiting a function.&#xA;      (`exit&#xA;       (insert &quot;--returning value: &quot;)&#xA;       (setq debugger-value (nth 1 debugger-args))&#xA;       (prin1 debugger-value (current-buffer))&#xA;       (insert ?\n)&#xA;       (delete-char 1)&#xA;       (insert ? )&#xA;       (beginning-of-line))&#xA;      ;; Debugger entered for an error.&#xA;      (`error&#xA;       (insert &quot;--Lisp error: &quot;)&#xA;       (prin1 (nth 1 debugger-args) (current-buffer))&#xA;       (insert ?\n))&#xA;      ;; debug-on-call, when the next thing is an eval.&#xA;      (`t&#xA;       (insert &quot;--beginning evaluation of function call form:\n&quot;))&#xA;      ;; User calls debug directly.&#xA;      (_&#xA;       (insert &quot;: &quot;)&#xA;       (prin1 (if (eq (car debugger-args) 'nil)&#xA;                  (cdr debugger-args) debugger-args)&#xA;              (current-buffer))&#xA;       (insert ?\n)))&#xA;    ;; After any frame that uses eval-buffer,&#xA;    ;; insert a line that states the buffer position it's reading at.&#xA;    (save-excursion&#xA;      (let ((tem eval-buffer-list))&#xA;        (while (and tem&#xA;                    (re-search-forward &quot;^  eval-\\(buffer\\|region\\)(&quot; nil t))&#xA;          (beginning-of-line)&#xA;          (insert (format &quot;Error at line %d in %s: &quot;&#xA;                          (with-current-buffer (car tem)&#xA;                            (line-number-at-pos (point)))&#xA;                          (with-current-buffer (car tem)&#xA;                            (buffer-name))))&#xA;          (pop tem))))&#xA;    (debugger-make-xrefs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this the original question in the title should be answered.  As for your problem with getting a backtrace in the first place, I'm out of useful ideas.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-02-08T11:10:08.210" LastActivityDate="2015-02-08T11:10:08.210" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7855" PostTypeId="2" ParentId="7845" CreationDate="2015-02-01T09:04:51.623" Score="0" Body="&lt;p&gt;Make a repeating entry for Monday and then use Org's timeshift to create additional entries for Tuesday to Friday.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastActivityDate="2015-02-01T09:04:51.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7856" PostTypeId="1" AcceptedAnswerId="7857" CreationDate="2015-02-01T13:12:37.673" Score="21" ViewCount="5682" Body="&lt;p&gt;When working on the structure of a document, often I find myself wanting to turn a list of items into a set of headings, or a set of headings into a list.  I haven't found a way to do this easily other than by hand-editing or recording a macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you do it? Is there a function to do this kind of operations, e.g. demote a heading to a list item?&lt;/p&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2022-09-16T07:19:51.720" Title="How to turn a heading into a list item in org mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7857" PostTypeId="2" ParentId="7856" CreationDate="2015-02-01T13:54:25.370" Score="45" Body="&lt;p&gt;In org-mode, it is easy enough to turn a heading into an item. There is a command called &lt;code&gt;org-toggle-item&lt;/code&gt; which can do that, and it is bound with &lt;code&gt;C-c -&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Also, you can also use &lt;code&gt;org-toggle-heading&lt;/code&gt; to turn an item to a heading, which is bound with &lt;code&gt;C-c *&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2022-09-16T07:19:51.720" LastActivityDate="2022-09-16T07:19:51.720" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="7858" PostTypeId="1" AcceptedAnswerId="7876" CreationDate="2015-02-01T14:18:22.357" Score="0" ViewCount="204" Body="&lt;p&gt;I am trying to bind a keyboard key for a new emacsclient frame running a specific helm command &lt;code&gt;helm-locate&lt;/code&gt; like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacsclient -c --eval '(helm-locate)'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not seem to work (no new frame pops-up). When I change the command (e.g. &lt;code&gt;emacsclient -c --eval '(mu4e)'&lt;/code&gt;) it does work, so it must be something with the way &lt;code&gt;helm-locate&lt;/code&gt; works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to fix this?&lt;/p&gt;&#xA;" OwnerUserId="1995" LastEditorUserId="1995" LastEditDate="2015-02-01T21:50:33.370" LastActivityDate="2015-02-02T07:04:25.753" Title="Helm command in `emacsclient -c` does nothing" Tags="|emacsclient|server|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7859" PostTypeId="1" AcceptedAnswerId="7860" CreationDate="2015-02-01T16:12:06.310" Score="1" ViewCount="162" Body="&lt;p&gt;Assume that I open a file and start editing it (at least one character is inserted).&#xA;Assume that the cursor is at Place &lt;strong&gt;A&lt;/strong&gt; when the last change to the file is done (i.e. the last character is inserted).&#xA;Then I take the cursor to another place in the same buffer (say place &lt;strong&gt;B&lt;/strong&gt;).&#xA;During this, I don't insert anything, but perhaps I execute some commands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to return from the place &lt;strong&gt;B&lt;/strong&gt; to the original place &lt;strong&gt;A&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-02-02T11:51:08.687" Title="How to return to the place of the last inserted character?" Tags="|buffers|cursor|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7860" PostTypeId="2" ParentId="7859" CreationDate="2015-02-01T16:30:16.610" Score="3" Body="&lt;p&gt;If you are okay with returning to the last &lt;em&gt;edit&lt;/em&gt; (as opposed to last &lt;em&gt;insertion&lt;/em&gt;), you might want to look at the package &lt;a href=&quot;http://melpa.org/#/goto-chg&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;goto-chg&lt;/code&gt;&lt;/a&gt;. You can enable it like this:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'goto-chg)&#xA;&#xA;(global-set-key (kbd &quot;C-.&quot;) #'goto-last-change)&#xA;(global-set-key (kbd &quot;C-,&quot;) #'goto-last-change-reverse)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-01T16:30:16.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7861" PostTypeId="1" CreationDate="2015-02-01T16:39:08.450" Score="2" ViewCount="172" Body="&lt;p&gt;I am using Emacs + ESS + Sweave to write a document.  When I do multiline copy of noweb commands using M-w, switch to R buffer and execute them (C-y, RET), Emacs will sometimes freeze, forcing me to kill Emacs and start over.  This also happens with &lt;code&gt;C-c C-c&lt;/code&gt;'ing of a text block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I am using Emacs 24.3.1, ESS 14.09, R 3.1.2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: After some testing, the following file will reproduce this problem.  Specifically, the first chunk will cause Emacs to hang.  The only resolution is to first &lt;code&gt;C-g&lt;/code&gt; then switch to the R buffer and &lt;code&gt;C-q C-c&lt;/code&gt; to return full control.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass[10pt]{article}&#xA;\usepackage{graphicx, verbatim, geometry,amsmath,amssymb, natbib, float, enumerate, courier, underscore}&#xA;\usepackage[utf8x]{inputenc}&#xA;\geometry{margin=1in}&#xA;\setlength{\textwidth}{6.5in} &#xA;\setlength{\textheight}{9in}&#xA;&#xA;\begin{document}&#xA;&#xA;&amp;lt;&amp;lt;&amp;gt;&amp;gt;=&#xA;library(ggplot2)&#xA;dat &amp;lt;- matrix(runif(100), nrow=10)&#xA;    cc &amp;lt;- apply(dat, 1, function(xx){&#xA;    sum(cos(xx))&#xA;})&#xA;@ &#xA;&#xA;The quick brown fox jumps over the lazy dog.&#xA;&#xA;&amp;lt;&amp;lt;&amp;gt;&amp;gt;=&#xA;bcc &amp;lt;- sapply(cc, function(xx){&#xA;    fft(xx)&#xA;})&#xA;@ &#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5384" LastEditorUserId="262" LastEditDate="2018-12-06T15:07:02.440" LastActivityDate="2018-12-06T15:07:02.440" Title="Emacs freezes using Sweave and ESS" Tags="|ess|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="7862" PostTypeId="1" AcceptedAnswerId="7868" CreationDate="2015-02-01T17:02:07.923" Score="2" ViewCount="305" Body="&lt;p&gt;This is a question a friend of mine had; figured posting here might give quick responses. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Old version in new language, après &lt;code&gt;Name&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;How do I define the mapping &lt;code&gt;^&lt;/code&gt; |--&gt; &lt;code&gt;^&lt;/code&gt; while &lt;code&gt;^^&lt;/code&gt; |--&gt; &lt;code&gt;^{}&lt;/code&gt;. Similarly, for &lt;code&gt;_&lt;/code&gt;.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Old Version&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Is there a way to modify the electric braces for superscript and subscript to behave as follows: &lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;Insert no empty pair of braces when a carat &lt;code&gt;^&lt;/code&gt; or underscore &lt;code&gt;_&lt;/code&gt; is entered.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Insert a empty pair of braces when a carat &lt;code&gt;^&lt;/code&gt; (resp. underscore &lt;code&gt;_&lt;/code&gt;) is entered following a &lt;code&gt;^&lt;/code&gt; carat (resp. &lt;code&gt;_&lt;/code&gt; underscore) sign. &lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Any answer would be helpful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;/p/s/ The motivation is to minimise having to jump out of braces when the subscript or superscript is just really a character long. &lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2015-02-01T19:28:03.950" LastActivityDate="2015-02-02T15:46:11.287" Title="Inserting electric braces in AUCTeX" Tags="|latex|auctex|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7863" PostTypeId="1" AcceptedAnswerId="7870" CreationDate="2015-02-01T17:03:01.070" Score="3" ViewCount="822" Body="&lt;p&gt;Can't get colors to show up in the mode-line. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;projectile&quot;&#xA;  '(setq projectile-mode-line&#xA;         '(:eval (concat &quot; Pj[&quot;&#xA;                         (propertize (projectile-project-name)&#xA;                                     'foreground &quot;#81a2be&quot;)&#xA;                         &quot;]&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The value gets evaluated correctly, because I see it change in the mode-line when I change pojectile projects, unfortunately it seems that string properties are stripped somewhere down the line. Any ideas how to fix this? Thx&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; projectile is unlikely to be at fault here cause I tried this with no effect: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;lisp-mode&quot;&#xA;  '(defadvice emacs-lisp-mode&#xA;       (after rename-modeline activate)&#xA;     (setq mode-name&#xA;           (propertize &quot;El&quot; 'foreground &quot;#81a2be&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SOLUTION&lt;/strong&gt; appears that I have been using the wrong property. Thanks to @politza this now works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;projectile&quot;&#xA;  '(setq projectile-mode-line&#xA;         '(:eval (list &quot; [Pj:&quot;&#xA;                       (propertize (projectile-project-name)&#xA;                                   'face '(:foreground &quot;#81a2be&quot;))&#xA;                       &quot;]&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One caveat is that replacing &lt;code&gt;(list ...)&lt;/code&gt; with &lt;code&gt;(concat ...)&lt;/code&gt; to actually concatenate strings breaks things. If anyone knows why, I'd be glad to learn.&lt;/p&gt;&#xA;" OwnerUserId="509" LastEditorUserId="253" LastEditDate="2015-02-25T19:30:51.173" LastActivityDate="2015-02-25T19:30:51.173" Title="Show colors in mode-line for minor modes" Tags="|mode-line|projectile|colors|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7864" PostTypeId="2" ParentId="909" CreationDate="2015-02-01T17:06:20.207" Score="1" Body="&lt;p&gt;It isn't quite identical to the timeline, but you can make a custom agenda view showing some time span in &quot;log mode&quot;.  By binding &lt;code&gt;org-agenda-files&lt;/code&gt; locally in the the agenda command we can load whatever files we want without messing up the normal behavior.  This does a week, change &lt;code&gt;org-agenda-span&lt;/code&gt; to the number of days you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar org-timeline-files nil&#xA;  &quot;The files to be included in `org-timeline-all-files'. Follows&#xA;  the same rules as `org-agenda-files'&quot;)&#xA;&#xA;(setq org-timeline-files '(&quot;/path/to/org/files/&quot;))&#xA;&#xA;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;R&quot; &quot;Week in review&quot;&#xA;                agenda &quot;&quot;&#xA;                ;; agenda settings&#xA;                ((org-agenda-span 'week)&#xA;                  (org-agenda-start-on-weekday 0) ;; start on Sunday&#xA;                  (org-agenda-overriding-header &quot;Week in Review&quot;)&#xA;                  (org-agenda-files &#xA;                    (let ((org-agenda-files org-timeline-files))&#xA;                          (org-agenda-files nil 'ifmode)))&#xA;                  (org-agenda-start-with-log-mode t)&#xA;                  (org-agenda-log-mode-items '(clock state))&#xA;                  (org-agenda-archives-mode t) ; include archive files&#xA;                )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-02-01T17:06:20.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7865" PostTypeId="2" ParentId="7845" CreationDate="2015-02-01T18:33:52.933" Score="16" Body="&lt;p&gt;This special sexp diary entry will repeat the TODO on weekdays:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO On Weekdays&#xA;&amp;lt;%%(let ((dayname (calendar-day-of-week date)))(memq dayname '(1 2 3 4 5)))&amp;gt; [2015-02-01 So]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorDisplayName="user3871" LastEditDate="2015-08-23T19:00:04.217" LastActivityDate="2015-08-23T19:00:04.217" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7867" PostTypeId="2" ParentId="4165" CreationDate="2015-02-01T19:07:08.780" Score="0" Body="&lt;p&gt;I had installed the &lt;code&gt;smooth-scrolling&lt;/code&gt; package from &lt;code&gt;MELPA&lt;/code&gt;. Removing it eliminated this particular scrolling behavior.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-02-01T19:07:08.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7868" PostTypeId="2" ParentId="7862" CreationDate="2015-02-01T19:37:19.017" Score="3" Body="&lt;p&gt;This does what you asked for. It also put the cursor between the braces.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'my-latex-hook)&#xA;&#xA;(defun my-latex-hook ()&#xA;  (require 'tex-site)&#xA;  (define-key LaTeX-mode-map &quot;^&quot; &#xA;    (lambda () &#xA;      (interactive) &#xA;      (if (equal (preceding-char) ?^) &#xA;          (progn (insert &quot;{}&quot;)(backward-char)) &#xA;        (insert &quot;^&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The credit is due to @abo-abo for his/her answer &lt;a href=&quot;https://emacs.stackexchange.com/a/3882/2609&quot;&gt;https://emacs.stackexchange.com/a/3882/2609&lt;/a&gt; from which I got this idea.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-02-02T15:46:11.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7869" PostTypeId="1" AcceptedAnswerId="7877" CreationDate="2015-02-01T19:38:50.110" Score="15" ViewCount="2436" Body="&lt;p&gt;When you have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-include-diary t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;set, then an entry in the &lt;code&gt;~/diary&lt;/code&gt; file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%(org-anniversary 1950 02 14) Bob's %d%s birthday&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;displays as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Diary:    Bob's 65th birthday&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the Org agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get the same effect - reporting the number of repetitions whether it be measured in years or days or whatever - using normal Org syntax in an &lt;code&gt;.org&lt;/code&gt; file so that I can also take advantage of other Org features such as TODOs etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;None of the following expand the &lt;code&gt;%d&lt;/code&gt; or &lt;code&gt;%s&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Bob's %d%s birthday&#xA;  &amp;lt;1950-02-14 Tue +1y&amp;gt;&#xA;&#xA;* Bob's %d%s birthday&#xA;  &amp;lt;%%(org-anniversary 1950 02 14) Bob's %d%s birthday&amp;gt;&#xA;&#xA;* Bob's %d%s birthday&#xA;  &amp;lt;%%(org-anniversary 1950 02 14)&amp;gt; Bob's %d%s birthday&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5386" LastActivityDate="2015-02-03T22:11:16.737" Title="Make Org report: &quot;Bob's 21st birthday&quot; like imported diary entries do" Tags="|org-mode|org-agenda|diary|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7870" PostTypeId="2" ParentId="7863" CreationDate="2015-02-01T19:44:30.050" Score="4" Body="&lt;p&gt;You are using the wrong property.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;,----[ (info &quot;(elisp) Special Properties&quot;) ]&#xA;|     `face'&#xA;|          This property controls the appearance of the text (*note Faces::).&#xA;`----&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(propertize &quot;Foo&quot; 'face '(:foreground &quot;orange&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-02-02T05:54:28.600" LastActivityDate="2015-02-02T05:54:28.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7872" PostTypeId="1" AcceptedAnswerId="7873" CreationDate="2015-02-02T04:28:18.730" Score="1" ViewCount="173" Body="&lt;p&gt;I have simple timer which makes sure a function is executed for every 10 seconds.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq interval 10)&#xA;&#xA;(defun run-every-ten-seconds ()&#xA;    (do-something))&#xA;&#xA;(defun start-timer ()&#xA;  (setq timer&#xA;    (run-at-time (current-time)  interval&#xA;                 'run-every-ten-seconds))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now instead of saving it for every 10 seconds, i want to increment 1 second every time it saves. So i need to save it after 10 seconds, then 11 seconds, 12 seconds and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try to cancel &amp;amp; start a new timer with the function, it is getting into infinite loop.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-every-ten-seconds ()&#xA;    (do-something)&#xA;    (cancel-timer timer) &#xA;    (setq interval (1+ interval))&#xA;    (setq timer&#xA;      (run-at-time (current-time)  interval&#xA;                   'run-every-ten-seconds)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas to solve this?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="253" LastEditDate="2015-02-02T14:55:51.507" LastActivityDate="2015-02-02T14:55:51.507" Title="unable to restart or update a timer" Tags="|elisp|time-date|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7873" PostTypeId="2" ParentId="7872" CreationDate="2015-02-02T05:36:44.373" Score="1" Body="&lt;p&gt;Your function is saying &lt;code&gt;run-at-time NOW&lt;/code&gt;, and passing &lt;em&gt;itself&lt;/em&gt; as the callback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you want &lt;code&gt;(run-at-time interval nil ...)&lt;/code&gt;, and you doubtless won't need to cancel a non-repeating timer which has already triggered.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-02-02T05:36:44.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7874" PostTypeId="1" AcceptedAnswerId="7875" CreationDate="2015-02-02T05:51:48.567" Score="0" ViewCount="304" Body="&lt;p&gt;My goal is to delete all duplicate overlay values from a list, and then remove every overlay in the buffer with values equal to each remaining element in the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having trouble understanding why &lt;code&gt;remove-overlays&lt;/code&gt; does not remove every overlay in the buffer containing a specific value.  What appears to be happening is that &lt;code&gt;remove-overlays&lt;/code&gt; removes &lt;strong&gt;just the first&lt;/strong&gt; overlay it finds matching that specific value, and then it moves on to the next task without deleting the remainder of overlays with that same value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to delete duplicate values from the list using &lt;code&gt;(delq nil (delete-dups ov-list))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A test buffer contains the following text on the first line in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;############################&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code I am using is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* (ov-value ov-list overlay limit char-at-point)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (setq limit (point-at-eol))&#xA;    (while (re-search-forward &quot;#&quot; limit t)&#xA;      (setq character (char-after (point)))&#xA;      (setq overlay (make-overlay (point) (1+ (point))))&#xA;      (setq ov-value (concat&#xA;          (propertize (char-to-string ?\uFEFF) 'face '(:background &quot;yellow&quot;))&#xA;          (propertize (char-to-string character) 'face '(:foreground &quot;green&quot;))))&#xA;      (push ov-value ov-list)&#xA;      (overlay-put overlay 'display ov-value)))&#xA;  (sit-for 2)&#xA;  (delq nil (delete-dups ov-list))&#xA;  (dolist (ov ov-list)&#xA;    (remove-overlays nil nil 'display ov)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-03-05T19:06:55.863" Title="Removing all overlays with duplicate values" Tags="|overlays|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7875" PostTypeId="2" ParentId="7874" CreationDate="2015-02-02T06:12:16.307" Score="1" Body="&lt;p&gt;That is because &lt;code&gt;remove-overlays&lt;/code&gt; uses &lt;code&gt;eq&lt;/code&gt; when testing an overlay-property's value.  But two strings are only &lt;code&gt;eq&lt;/code&gt;ual, if they are the same object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually one adds a symbol property with a constant value, usually &lt;code&gt;t&lt;/code&gt;, in order to keep track of one's overlays.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="105" LastEditDate="2015-02-02T14:32:37.720" LastActivityDate="2015-02-02T14:32:37.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7876" PostTypeId="2" ParentId="7858" CreationDate="2015-02-02T07:04:25.753" Score="2" Body="&lt;p&gt;If you had started the erroneous example from a terminal, you would have noticed output similiar to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -c --eval '(helm-locate)'&#xA;[…]&#xA;*ERROR*: Wrong number of arguments: (1 . 1), 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Comparing the arguments both &lt;code&gt;mu4e&lt;/code&gt; and &lt;code&gt;helm-locate&lt;/code&gt; require (which can be easily found out with &lt;code&gt;M-x find-function&lt;/code&gt;) reveals that while both commands are interactive, &lt;code&gt;mu4e&lt;/code&gt; doesn't require any argument at all, &lt;code&gt;helm-locate&lt;/code&gt; however does and is using &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt; to tell Emacs what to fill in when used interactively.  The &lt;code&gt;P&lt;/code&gt; specification supplies a raw prefix argument, so without any prefix argument it's going to be &lt;code&gt;nil&lt;/code&gt;.  That's why &lt;code&gt;emacsclient -c --eval '(helm-locate nil)'&lt;/code&gt; should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the &lt;code&gt;interactive&lt;/code&gt; spec you're encountering is a lot more complex to figure out (there's an escape hatch to just use an s-expression that evaluates to a list of all arguments, it's used heavily inside Emacs itself and external packages as well), you can cheat by using &lt;code&gt;call-interactively&lt;/code&gt;, then the command to execute would be &lt;code&gt;emacsclient -c --eval &quot;(call-interactively 'helm-locate)&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-02T07:04:25.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7877" PostTypeId="2" ParentId="7869" CreationDate="2015-02-02T07:29:13.877" Score="16" Body="&lt;p&gt;There is a chapter on &lt;a href=&quot;http://orgmode.org/manual/Weekly_002fdaily-agenda.html&quot; rel=&quot;noreferrer&quot;&gt;the weekly/daily agenda&lt;/a&gt; in the &lt;code&gt;org-mode&lt;/code&gt; manual that tells you how to do this (modified for brevity; emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you are using the diary only for sexp entries and holidays, it is&#xA;  faster to not use &lt;code&gt;(setq org-agenda-include-diary t)&lt;/code&gt;, but instead to copy or even move the entries into an Org file.  Org mode evaluates diary-style sexp&#xA;  entries, and does it faster because there is no overhead for first&#xA;  creating the diary display.  &lt;strong&gt;Note that the sexp entries must start at&#xA;  the left margin&lt;/strong&gt;, no whitespace is allowed before them. For example,&#xA;  the following segment of an Org file will be processed and entries will&#xA;  be made in the agenda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Birthdays&#xA;%%(org-anniversary 1956  5 14) Arthur Dent is %d years old&#xA;%%(org-anniversary 1869 10  2) Mahatma Gandhi would be %d years old&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For your specific example, you need to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Bob's birthday&#xA;%%(org-anniversary 1950 02 14) Bob's %d%s birthday&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This entry will show up in the agenda as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Week-agenda (W07):&#xA;Monday      9 February 2015 W07&#xA;...&#xA;Saturday   14 February 2015&#xA;  birthdays:  Bob's 65th birthday&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Additional info&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I found this information by&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Accessing the &lt;code&gt;org-mode&lt;/code&gt; manual via&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h i&lt;/kbd&gt; &lt;kbd&gt;m&lt;/kbd&gt; &lt;code&gt;org mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Searching the manual for occurrences of &lt;code&gt;org-anniversary&lt;/code&gt; via&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; &lt;code&gt;org-anniversary&lt;/code&gt; &lt;kbd&gt;C-s&lt;/kbd&gt; &lt;kbd&gt;C-s&lt;/kbd&gt; &lt;kbd&gt;C-s&lt;/kbd&gt; ...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-03T22:11:16.737" LastActivityDate="2015-02-03T22:11:16.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7878" PostTypeId="1" AcceptedAnswerId="7882" CreationDate="2015-02-02T08:48:03.640" Score="5" ViewCount="2719" Body="&lt;p&gt;The cache expiry &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq password-cache-expiry nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works only for the livetime of the emacs client. But I found in the &lt;a href=&quot;http://www.gnu.org/software/tramp/#Using-an-authentication-file-1&quot; rel=&quot;noreferrer&quot;&gt;Tramp user manual&lt;/a&gt; the possibility to store passwords permanently&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;5.12.1 Using an authentication file   &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The package auth-source.el, originally developed in No Gnus, offers the possibility to read&#xA;  passwords from a file, like FTP does it from &lt;code&gt;~/.netrc&lt;/code&gt;. The default&#xA;  authentication file is &lt;code&gt;~/.authinfo.gpg&lt;/code&gt;, this can be changed via the&#xA;  variable &lt;code&gt;auth-sources&lt;/code&gt;.   A typical entry in the authentication file&#xA;  would be &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine melancholia port scp login daniel password geheim&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How do I setup this permanent password storage?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="11" LastEditDate="2015-02-02T12:14:02.640" LastActivityDate="2015-02-02T12:14:02.640" Title="How to store Tramp passwords permanently" Tags="|tramp|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7879" PostTypeId="1" AcceptedAnswerId="7880" CreationDate="2015-02-02T10:10:16.283" Score="4" ViewCount="969" Body="&lt;p&gt;For example suppose that I would like to show the message &quot;yes&quot; if the current character is &quot;a&quot; or &quot;d&quot; or &quot;x&quot;, ....&#xA;Of course I can write as below. But it is very long.&#xA;I am wondering if there is a more simple way to do it.&#xA;In this example the variable is &lt;code&gt;char-after&lt;/code&gt; and the set is &lt;code&gt;{a,d,x}&lt;/code&gt;. The problem can arise in other situation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun foo () (interactive)&#xA;    (if (or (eq (char-after) ?a ) (eq (char-after) ?d ) (eq (char-after) ?x )) &#xA;    (message &quot;yes&quot;) (message &quot;no&quot;)))       &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-02-02T20:43:47.610" LastActivityDate="2015-02-02T20:43:47.610" Title="What is the easiest way to check if a character belongs to a particular set of characters?" Tags="|elisp|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7880" PostTypeId="2" ParentId="7879" CreationDate="2015-02-02T10:21:17.177" Score="8" Body="&lt;p&gt;Here you go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (if (memq (char-after) '(?a ?d ?x))&#xA;      (message &quot;yes&quot;)&#xA;    (message &quot;no&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;memq&lt;/code&gt; is possible because characters are numbers that can be compared with &lt;code&gt;eq&lt;/code&gt;.&#xA;If you want strings or lists, use &lt;code&gt;member&lt;/code&gt;, which uses &lt;code&gt;equal&lt;/code&gt; for comparison. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-02T10:21:17.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7881" PostTypeId="2" ParentId="7872" CreationDate="2015-02-02T10:25:04.697" Score="0" Body="&lt;p&gt;i ended up using &lt;code&gt;time-add&lt;/code&gt;, &lt;code&gt;seconds-to-time&lt;/code&gt; to modify the time interval &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-at-time&#xA; (time-add (current-time) (seconds-to-time interval))&#xA;   interval 'run-every-ten-seconds)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-02-02T10:25:04.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7882" PostTypeId="2" ParentId="7878" CreationDate="2015-02-02T10:38:29.463" Score="6" Body="&lt;p&gt;Do as recommended in the Tramp manual. Write your settings into &lt;code&gt;~/.authinfo.gpg&lt;/code&gt;. This requires a more recent Emacs which supports &lt;code&gt;auth-source.el&lt;/code&gt;, I guess any Emacs 24.* should do.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-02-02T10:38:29.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7883" PostTypeId="2" ParentId="7879" CreationDate="2015-02-02T11:44:23.400" Score="4" Body="&lt;p&gt;I like &lt;code&gt;pcase&lt;/code&gt; a lot, though it &lt;strong&gt;may&lt;/strong&gt; be slower in some cases.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (message&#xA;   (pcase (char-after)&#xA;      ((or ?a ?d ?x) &quot;yes&quot;)&#xA;      (t &quot;no&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2699" LastEditorUserId="2710" LastEditDate="2015-02-02T18:02:39.557" LastActivityDate="2015-02-02T18:02:39.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7884" PostTypeId="2" ParentId="7878" CreationDate="2015-02-02T11:48:16.860" Score="5" Body="&lt;p&gt;In addition to the Tramp manual, there's a full manual for &lt;code&gt;auth-source.el&lt;/code&gt;: &lt;code&gt;(info &quot;auth&quot;)&lt;/code&gt; that I wrote, which may help you.  In the case of SSH logins, you may find it better to avoid passwords altogether--look at SSH keys instead.&lt;/p&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-02-02T11:48:16.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7885" PostTypeId="2" ParentId="7859" CreationDate="2015-02-02T11:51:08.687" Score="1" Body="&lt;p&gt;I know it's dumb compared to &lt;code&gt;goto-chg&lt;/code&gt;, and also jumps to any kind of edit, not the last insertion, but I often undo, insert a space, and undo again (that space insert)... which places me back at the point of the last change.&lt;/p&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-02-02T11:51:08.687" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7886" PostTypeId="1" AcceptedAnswerId="7887" CreationDate="2015-02-02T13:24:57.947" Score="4" ViewCount="725" Body="&lt;p&gt;I have a set of directories. For each directory I have a set of relative file names. I would like to select any of these relative filenames using completion, and then later reconstruct the absolute path of the filename. (The relative filenames can be assumed to be unique). The following code works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((lst '((&quot;a/b&quot; . &quot;dir1&quot;) (&quot;a/c&quot; . &quot;dir2&quot;)))&#xA;      (select nil))&#xA;  (setq select (completing-read &quot;Enter file name: &quot; lst  nil t &quot;&quot;))&#xA;  (cdr (assoc select lst)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, the &lt;code&gt;cdr&lt;/code&gt; of the cons cells represents (absolute) directory names (simplified to &lt;code&gt;&quot;dir1&quot;&lt;/code&gt; and &lt;code&gt;&quot;dir2&quot;&lt;/code&gt; for this question) for the given relative path. But it feels like I have missed something. It should be possible to avoid using &lt;code&gt;assoc&lt;/code&gt; if &lt;code&gt;completing-read&lt;/code&gt; just could return the whole &lt;code&gt;cons&lt;/code&gt; cell instead of just the &lt;code&gt;car&lt;/code&gt; of the cons cell, but I could not find information about how to achieve that in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to tell &lt;code&gt;completing-read&lt;/code&gt; to return more information (i.e. the cons cell)? &lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-02T14:30:24.227" Title="How to return the selected cons cell using completing-read?" Tags="|completion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7887" PostTypeId="2" ParentId="7886" CreationDate="2015-02-02T14:30:24.227" Score="5" Body="&lt;p&gt;Nope.  &lt;code&gt;(cdr (assoc select list))&lt;/code&gt; is the way to do it. &lt;code&gt;completing-read&lt;/code&gt; returns a &lt;em&gt;string&lt;/em&gt;, regardless of whether the &lt;code&gt;COLLECTION&lt;/code&gt; arg was an alist, obarray, hash-list, or function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can get the whole cons cell. (In particular, this is used to be able to have multiple completion candidates with the same name but different associated information.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-02T14:30:24.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7888" PostTypeId="1" AcceptedAnswerId="7889" CreationDate="2015-02-02T15:44:23.163" Score="3" ViewCount="601" Body="&lt;p&gt;Can Emacs determine the time of the last change (or the last edit) done to the current buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buffer may has been saved or not.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-02-02T20:40:30.783" LastActivityDate="2015-02-02T21:04:47.077" Title="The time of the last change of the current buffer" Tags="|buffers|time-date|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7889" PostTypeId="2" ParentId="7888" CreationDate="2015-02-02T16:53:03.437" Score="5" Body="&lt;p&gt;Use the standard change hooks to record that information: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Change-Hooks.html#Change-Hooks&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Change-Hooks.html#Change-Hooks&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you record it, make sure it's in a buffer-local variable, so each buffer can have its own value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a sample implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar buffer-last-change-time nil &quot;The last change time&quot;)&#xA;(make-variable-buffer-local 'buffer-last-change-time)&#xA;&#xA;(defun buffer-record-last-change-time (beg end len)&#xA;  (setq buffer-last-change-time (current-time))&#xA;  (message (format-time-string &quot;Recorded last change time as %F %T&quot;&#xA;                               buffer-last-change-time)))&#xA;&#xA;(add-to-list 'after-change-functions 'buffer-record-last-change-time)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluate this in any buffer.  Sample output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Recorded last change time as 2015-02-02 16:00:59&#xA;Recorded last change time as 2015-02-02 16:01:00&#xA;Recorded last change time as 2015-02-02 16:01:01 [4 times]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can probably be turned into a more general facility, if you're up to the challenge :)&lt;/p&gt;&#xA;" OwnerUserId="2699" LastEditorUserId="2699" LastEditDate="2015-02-02T21:04:47.077" LastActivityDate="2015-02-02T21:04:47.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7890" PostTypeId="1" AcceptedAnswerId="7891" CreationDate="2015-02-02T17:17:28.683" Score="11" ViewCount="5173" Body="&lt;p&gt;How can I ensure I'm downloading and using &lt;code&gt;org-plus-contrib&lt;/code&gt; from the org-mode repository using &lt;code&gt;require&lt;/code&gt; or &lt;code&gt;use-package&lt;/code&gt;? &lt;code&gt;Package.el&lt;/code&gt; downloads the package, compiles everything and then says it can't load &lt;code&gt;org-plus-contrib&lt;/code&gt;. This &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-12/msg00326.html&quot;&gt;thread&lt;/a&gt; on the mailing list discusses a similar, but inverted problem. However, if I place &lt;code&gt;(use-package org ...&lt;/code&gt;, &lt;code&gt;use-package&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt;, but does so whether &lt;code&gt;org-plus-contrib&lt;/code&gt; is installed or not.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-10-21T05:22:12.230" Title="org-plus-contrib and org with `require` or `use-package`" Tags="|org-mode|package|use-package|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7891" PostTypeId="2" ParentId="7890" CreationDate="2015-02-02T18:01:16.307" Score="4" Body="&lt;p&gt;I'm not 100% sure you can really reliably check with only &lt;code&gt;require&lt;/code&gt; or &lt;code&gt;use-package&lt;/code&gt;... But if you are using package.el for org-mode functionality, your org-mode configuration may need to be deferred until after your packages have been initialized. You can do this with a hook the runs after Emacs has initialized called &quot;&lt;code&gt;after-init-hook&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means in your &lt;code&gt;.emacs&lt;/code&gt;, you'll need a hook like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook 'package-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And somewhere else:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun package-config ()&#xA;;;Your org-mode config goes here.&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that, you have access to package.el's checking and downloading functionality...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, since you also want to check for the package's existence, you can use &quot;&lt;code&gt;(package-installed-p 'org-plus-contrib)&lt;/code&gt;&quot; and install it with &quot;&lt;code&gt;(package-install package)&lt;/code&gt;&quot; if it is not there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Altogether, the code would probably look something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun package-config ()&#xA;  (unless (package-installed-p 'org-plus-contrib)&#xA;    (package-refresh-contents)&#xA;    (package-install 'org-plus-contrib)))&#xA;&#xA;(add-hook 'after-init-hook 'package-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the rest of your config being after the &lt;code&gt;(unless ...)&lt;/code&gt; body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That way, you get your configuration, you get your package install checking, and you get it automatically downloaded so you can safely assume that anything past that line in the function can use the loaded contribs. (Assuming you have a network connection if it doesn't exist.)&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2015-02-02T18:06:20.223" LastActivityDate="2015-02-02T18:06:20.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7892" PostTypeId="1" AcceptedAnswerId="11064" CreationDate="2015-02-02T18:08:49.013" Score="2" ViewCount="282" Body="&lt;p&gt;Why does &lt;code&gt;(keyboard-quit)&lt;/code&gt; (bound to &lt;code&gt;C-g&lt;/code&gt;) unmark the selected region? And is there a way to stop Emacs from doing so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sceneraio I have in mind is the following: suppose I select a region and begin a &lt;code&gt;C-c C-&lt;/code&gt; command, but I change my mind and want to cancel. If I call &lt;code&gt;(keyboard-quit)&lt;/code&gt;, I also lose the selection.&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2015-02-02T21:52:26.557" LastActivityDate="2015-05-01T14:50:30.020" Title="Highlighting and keyboard-quit" Tags="|mark|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7893" PostTypeId="2" ParentId="5410" CreationDate="2015-02-02T18:11:36.343" Score="12" Body="&lt;p&gt;I've personally experienced hangs that cannot be broken by any number of &lt;kbd&gt;C-g&lt;/kbd&gt; presses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more forceful method on UNIX OSs is to send Emacs a USR2 signal. Signal processing is a lot lower-level than keyboard input, and has a very good chance of unhanging Emacs. (I've never seen it fail)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ killall -USR2 emacs &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Should do the trick. In addition USR2 creates a backtrace. If you don't want that, you might have some luck with the following (I haven't tested this, though):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun quit-on-usr2 ()&#xA;  (interactive)&#xA;  (keyboard-quit))&#xA;(global-set-key [signal usr2] #'quit-on-usr2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-02T18:11:36.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7894" PostTypeId="2" ParentId="7892" CreationDate="2015-02-02T18:13:32.307" Score="4" Body="&lt;p&gt;As you can see from the code, it's specifically designed to do that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun keyboard-quit ()&#xA;  &quot;Signal a `quit' condition.&#xA;During execution of Lisp code, this character causes a quit directly.&#xA;At top-level, as an editor command, this simply beeps.&quot;&#xA;  (interactive)&#xA;  ;; Avoid adding the region to the window selection.&#xA;  (setq saved-region-selection nil)&#xA;  (let (select-active-regions)&#xA;    (deactivate-mark)) ;;&amp;lt;------------- umark selected region&#xA;  (if (fboundp 'kmacro-keyboard-quit)&#xA;      (kmacro-keyboard-quit))&#xA;  (when completion-in-region-mode&#xA;    (completion-in-region-mode -1))&#xA;  ;; Force the next redisplay cycle to remove the &quot;Def&quot; indicator from&#xA;  ;; all the mode lines.&#xA;  (if defining-kbd-macro&#xA;      (force-mode-line-update t))&#xA;  (setq defining-kbd-macro nil)&#xA;  (let ((debug-on-quit nil))&#xA;    (signal 'quit nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-02T18:13:32.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7895" PostTypeId="2" ParentId="7879" CreationDate="2015-02-02T19:13:22.377" Score="2" Body="&lt;p&gt;For the sake of alternatives, first of all, since you are looking to test against a number of different characters, it looks like a regular expression would do the job more succinctly and, perhaps even faster (really depends on how many characters there will be to test from etc.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another way is to use &lt;code&gt;char-table&lt;/code&gt; - a built-in Emacs data-structure for working with characters.  Below is an example followed by explanation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun char-handler () (message &quot;I am char-handler&quot;))&#xA;(defun special-handler () (message &quot;I am special-handler&quot;))&#xA;&#xA;(defvar test-char-table (make-char-table 'testing 'char-handler))&#xA;&#xA;(set-char-table-range test-char-table ?a 'special-handler)&#xA;(funcall (char-table-range test-char-table '?a))&#xA;&quot;I am special-handler&quot;&#xA;(funcall (char-table-range test-char-table '?b))&#xA;&quot;I am char-handler&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;make-char-table&lt;/code&gt; creates a sparse array-like structure where keys are characters and the values are whatever you want, but usually symbols pointing to some function.  This data-structure is specifically designed to handle text processing so it should be reasonably fast, but, most importantly, it scales better with more handlers.  It's dynamic (which means that adding or removing handlers is possible while without changing the rest of the code which uses relies on the function using it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you call &lt;code&gt;set-char-table-range&lt;/code&gt; you can also provide things other than single character: ranges of characters given by cons cell with &lt;code&gt;car&lt;/code&gt; being the first character of the range and &lt;code&gt;cdr&lt;/code&gt; being the last character.  This helps when you have many characters which have to invoke the same handler.  It also accepts &lt;code&gt;nil&lt;/code&gt; meaning &quot;all characters in the table&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more info, such as functions which inspect the table and iterate over its contents see: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Char_002dTables.html#Char_002dTables&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Char_002dTables.html#Char_002dTables&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-02T19:13:22.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7896" PostTypeId="2" ParentId="3798" CreationDate="2015-02-02T20:21:31.443" Score="20" Body="&lt;p&gt;I've also used &lt;code&gt;ido-mode&lt;/code&gt; a &lt;em&gt;lot&lt;/em&gt; and trained my muscle memory :) I think the &lt;code&gt;ido&lt;/code&gt; style is more intuitive than the &lt;code&gt;helm&lt;/code&gt; approach. I search for stuff (typing in some characters) and commit to the find (hit &lt;code&gt;RET&lt;/code&gt;), just like the search/address bar of my web browser. If the selection is a directory, I enter this directory and start searching again in this directory. This seems natural for me, so I've written a small advice around &lt;code&gt;helm-execute-persistent-action&lt;/code&gt; to force this mechanic.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm)&#xA;(defun fu/helm-find-files-navigate-forward (orig-fun &amp;amp;rest args)&#xA;  (if (and (equal &quot;Find Files&quot; (assoc-default 'name (helm-get-current-source)))&#xA;           (equal args nil)&#xA;           (stringp (helm-get-selection))&#xA;           (not (file-directory-p (helm-get-selection))))&#xA;      (helm-maybe-exit-minibuffer)&#xA;    (apply orig-fun args)))&#xA;(advice-add 'helm-execute-persistent-action :around #'fu/helm-find-files-navigate-forward)&#xA;(define-key helm-find-files-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) 'helm-execute-persistent-action)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've also optimize the &lt;code&gt;backspace&lt;/code&gt; key slightly. If I type something and want to do a correction, I hit backspace. This will delete one character. If I am on the beginning of the directory and hit backspace again, I navigate one level up. This speeds up the navigation dramatically!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fu/helm-find-files-navigate-back (orig-fun &amp;amp;rest args)&#xA;  (if (= (length helm-pattern) (length (helm-find-files-initial-input)))&#xA;      (helm-find-files-up-one-level 1)&#xA;    (apply orig-fun args)))&#xA;(advice-add 'helm-ff-delete-char-backward :around #'fu/helm-find-files-navigate-back)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To remove the useless &lt;code&gt;.&lt;/code&gt; and &lt;code&gt;..&lt;/code&gt; at the very beginning, you can add it to the &lt;code&gt;helm-boring-file-regexp-list&lt;/code&gt; configuration variable.&lt;/p&gt;&#xA;" OwnerUserId="2693" LastEditorUserId="2693" LastEditDate="2017-01-28T20:51:54.697" LastActivityDate="2017-01-28T20:51:54.697" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7897" PostTypeId="2" ParentId="7888" CreationDate="2015-02-02T20:41:32.943" Score="2" Body="&lt;p&gt;As far as I know, Emacs does not record this information (automatically). As @TedZlatanov suggested, you can record it yourself, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What Emacs does record is the number of changes since the buffer was last saved. See functions &lt;code&gt;buffer-modified-tick&lt;/code&gt; and &lt;code&gt;buffer-chars-modified-tick&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm not sure how functions &lt;code&gt;set-buffer-modified-p&lt;/code&gt; and &lt;code&gt;not-modified&lt;/code&gt; affect the tick count, but my guess is that they reset it to 0.  This is not specified in the Elisp manual - you would need to consult the C-code implementation to find out.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a buffer visiting a file, you can get the info of the last buffer save, and the last file modification, but not the last buffer modification, using function &lt;code&gt;file-attributes&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-02T20:41:32.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7898" PostTypeId="1" CreationDate="2015-02-02T21:09:12.863" Score="10" ViewCount="180" Body="&lt;p&gt;To be clear, I'm not talking about anything that should require emacs to be multithreaded (though that would probably also solve this). To reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;emacs -Q # I'm running 24.4.1&lt;/li&gt;&#xA;&lt;li&gt;Make a second frame&lt;/li&gt;&#xA;&lt;li&gt;Switch back to first frame&lt;/li&gt;&#xA;&lt;li&gt;M-x shell&lt;/li&gt;&#xA;&lt;li&gt;M-x rename-uniquely (we're going to make a second shell later)&lt;/li&gt;&#xA;&lt;li&gt;Start running: &lt;code&gt;while true; do echo &quot;hello world&quot;; done&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;In the second frame, M-x shell&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The second shell will &lt;em&gt;almost&lt;/em&gt; never display (rarely it works after repeated attempts). Apparently emacs will never take a break from reading the output of the first shell to listen to the output coming in from any other process. It would be much better behavior for it to round robin when there are multiple processes with pending output. Is there any way to get better behavior? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only trick I know would be to make the shell buffer its own process, but unfortunately that won't work for me. Even if I do that, I have to run a subprocess to listen to a socket for my speech recognition software to work so that I can actually control the shell in the first place, that's how I discovered this; running an infinite loop like the above prevents any data from being taken off the socket.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-11-10T13:38:38.310" Title="How do I prevent one subprocess from starving others?" Tags="|shell|comint|subprocess|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7899" PostTypeId="2" ParentId="7697" CreationDate="2015-02-02T21:40:59.357" Score="7" Body="&lt;p&gt;Extending &lt;a href=&quot;https://emacs.stackexchange.com/a/7701/2642&quot;&gt;&lt;em&gt;Jorgen Schäfer's&lt;/em&gt; answer&lt;/a&gt; with &#xA;&lt;a href=&quot;https://emacs.stackexchange.com/users/594/matthew-piziak&quot;&gt;&lt;em&gt;Matthew Piziak's&lt;/em&gt;&lt;/a&gt; suggestion produces the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer (generate-new-buffer &quot;*empty*&quot;)&#xA;  (make-frame '((minibuffer . nil)&#xA;                 (unsplittable . t)&#xA;                 (buffer-predicate . (lambda (x) nil))&#xA;                 (height . 2)&#xA;                 (left-fringe . 0)&#xA;                 (right-fringe . 0)&#xA;                 (tool-bar-lines . 0)&#xA;                 (menu-bar-lines . 0)))&#xA;  (set-window-dedicated-p&#xA;    (get-buffer-window (current-buffer) t) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell, this correctly locks the window to an empty buffer. Attempting to switch to a different buffer will open the buffer in an existing window in the parent frame. &lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-02-11T18:22:03.747" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7900" PostTypeId="1" CreationDate="2015-02-02T21:53:42.247" Score="1" ViewCount="1025" Body="&lt;p&gt;I am trying to use company-completion within a Yasnippet header. I bound company-complete to C-SPC and use that for my auto-completion. When I hit control enter, I get a screen like this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/tqRww.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I hit enter to get this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/z2K3d.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I start typing iost- and wait to get the company-complete (It breaks immediately when I hit C-SPC, see below):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/V7GIT.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then I hit enter to complete, and this happens: (or immediately if I hit C-SPC):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/4QBgk.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried googling around but no solution worked. I only want to be able to yasnippet snippets from the company-complete dropdown if that's possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5396" LastActivityDate="2015-02-02T21:53:42.247" Title="Company Completion Within Yasnippet Snippet" Tags="|completion|company-mode|yasnippet|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7901" PostTypeId="1" AcceptedAnswerId="7941" CreationDate="2015-02-03T00:20:03.453" Score="3" ViewCount="303" Body="&lt;p&gt;Frequently, I find myself having to send code snippets to teammates, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, I decided to write the following elisp to simplify the process. I am using mutt as the email client, but the only issue with this is the fact that the code is not properly formatted in the email.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun email_mark (addr subj)&#xA;   (interactive &quot;sEnter email address: \nsEnter email subject: &quot;)&#xA;   (let ((fname &quot;~/.emacs.d/files/email.txt&quot;))&#xA;     (write-region (region-beginning) (region-end) fname)&#xA;     (shell-command (format &quot;mutt -e 'set content_type=text/html' -s '%s' -- '%s' &amp;lt; %s&quot; subj addr fname))))&#xA;&#xA;(global-set-key &quot;\C-x\m&quot; 'email_mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Screenshot of email sent using this function:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Dh00F.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="5398" LastEditorUserId="5398" LastEditDate="2015-02-03T01:00:56.677" LastActivityDate="2015-02-03T21:02:05.530" Title="Email Code Snippets through Emacs (with Mutt)" Tags="|elisp|email|formatting|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7902" PostTypeId="1" CreationDate="2015-02-03T00:54:51.090" Score="1" ViewCount="263" Body="&lt;p&gt;I use &lt;code&gt;gnus&lt;/code&gt; for email, including its built-in &lt;code&gt;message-mode&lt;/code&gt; for composing/replying to email.  Just before sending mail, I'd like to query my IMAP server to see if there have been any new messages on this thread since I started composing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like I can do my check in a &lt;code&gt;message-send-hook&lt;/code&gt; function, but what API can I use to check for new mail on a thread?  Does &lt;code&gt;gnus&lt;/code&gt; provide any interface for this?  I'd like to avoid dropping to IMAP directly since I might not always be using IMAP...&lt;/p&gt;&#xA;" OwnerUserId="573" LastActivityDate="2015-04-04T13:32:05.287" Title="How to check for new messages on thread before sending with gnus' message-mode?" Tags="|gnus|imap|message-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7903" PostTypeId="2" ParentId="5481" CreationDate="2015-02-03T04:14:01.020" Score="6" Body="&lt;p&gt;You can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:scope some-function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where function &lt;code&gt;some-function&lt;/code&gt; returns required list of files. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-function () org-agenda-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-function ()&#xA;  (append org-agenda-files&#xA;          (file-expand-wildcards &quot;your-path/*.org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2064" LastEditorUserId="14825" LastEditDate="2019-04-21T05:01:13.473" LastActivityDate="2019-04-21T05:01:13.473" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="7904" PostTypeId="1" CreationDate="2015-02-03T07:04:54.177" Score="4" ViewCount="462" Body="&lt;p&gt;I have used emacsclient without any problem on OSX. Usually I just start Emacs server by &lt;code&gt;emacs --daemon&lt;/code&gt; in Console, and then &lt;code&gt;emacsclient&lt;/code&gt; works. I use &lt;code&gt;emacsclient -nc&lt;/code&gt; to create a new frame. However, after upgrading to Emacs 24.4, emacsclient just hangs on without printing any info when invoking the command. I tried both &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;http://emacsformacosx.com/&lt;/a&gt; and &lt;code&gt;brew install&lt;/code&gt;, and I had the same problem. Can anyone help to look at this issue? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5400" LastEditorUserId="25" LastEditDate="2015-02-17T06:54:43.227" LastActivityDate="2016-02-02T15:54:17.570" Title="emacsclient of 24.4 does not work on Yosemite" Tags="|emacsclient|osx|emacs24.4|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7905" PostTypeId="1" AcceptedAnswerId="7932" CreationDate="2015-02-03T08:30:19.407" Score="2" ViewCount="557" Body="&lt;p&gt;I would like to define a customized function to open the complied &lt;code&gt;pdf&lt;/code&gt; file of the current &lt;code&gt;tex&lt;/code&gt; file in the default pdf viewer of the system (say &lt;code&gt;SumatraPDF.exe&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am primarily interested to a solution without &lt;code&gt;AUCTeX/LateX mode&lt;/code&gt; facilities, though such a solution would be also useful. &lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-02-04T03:25:17.133" Title="Ways to open the compiled pdf file of the current tex file" Tags="|latex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7906" PostTypeId="2" ParentId="7225" CreationDate="2015-02-03T08:57:09.610" Score="1" Body="&lt;p&gt;You could try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-theme-set-faces 'ir-black&#xA;  `(region ((t :background &quot;magenta&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your emacs config somewhere after initializing the theme.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2015-02-03T08:57:09.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7907" PostTypeId="2" ParentId="7790" CreationDate="2015-02-03T09:39:33.190" Score="0" Body="&lt;p&gt;The variable &lt;code&gt;dired-directory&lt;/code&gt; basically holds the value of the &lt;code&gt;DIRNAME&lt;/code&gt; argument in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dired DIRNAME &amp;amp;optional SWITCHES)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, which you can manipulate at will.  Don't forget to revert the buffer afterwards.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-02-03T09:39:33.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7908" PostTypeId="1" AcceptedAnswerId="7925" CreationDate="2015-02-03T09:56:08.790" Score="27" ViewCount="10595" Body="&lt;p&gt;In my emacs,&#xA;let's say, I use a &lt;code&gt;&quot;elisp&quot;&lt;/code&gt; yasnippet to extend a lisp block in&#xA;org-mode. But before I extend it, company is triggered first, which gives&#xA;me a menu like &lt;code&gt;&quot;1. elisp1, 2. elisp2&quot;&lt;/code&gt; without an option &lt;code&gt;&quot;elisp&quot;&lt;/code&gt;. Now if I use &lt;code&gt;tab&lt;/code&gt; to extend yasnippet, it is always annoying that &lt;code&gt;&quot;elisp1&quot;&lt;/code&gt; always first goes on the screen. So I need to delete &lt;code&gt;&quot;1&quot;&lt;/code&gt;firstly, and do the extension of yasnippet snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as a solution, I always use left arrow key to turn company completion menu off first, but the cursor now will go to &lt;code&gt;&quot;elis|p&quot;&lt;/code&gt;, so again I use right arrow key to move the cursor to end of &lt;code&gt;&quot;elisp|&quot;&lt;/code&gt;, and extend the snippet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here comes my question: how can I bind &lt;code&gt;tab&lt;/code&gt; key firstly trigger yasnippet but not company to save me life?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2016-05-26T02:10:28.607" LastActivityDate="2016-05-26T02:10:28.607" Title="How to make yasnippet and company work nicer?" Tags="|company-mode|yasnippet|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7909" PostTypeId="2" ParentId="7908" CreationDate="2015-02-03T10:22:56.437" Score="13" Body="&lt;p&gt;Here's the code that I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-o&quot; 'aya-open-line)&#xA;&#xA;(defun aya-open-line ()&#xA;  &quot;Call `open-line', unless there are abbrevs or snippets at point.&#xA;In that case expand them.  If there's a snippet expansion in progress,&#xA;move to the next field. Call `open-line' if nothing else applies.&quot;&#xA;  (interactive)&#xA;  (cond ((expand-abbrev))&#xA;&#xA;        ((yas--snippets-at-point)&#xA;         (yas-next-field-or-maybe-expand))&#xA;&#xA;        ((ignore-errors&#xA;           (yas-expand)))&#xA;&#xA;        (t&#xA;         (open-line 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;aya-open-line&lt;/code&gt; from &lt;a href=&quot;https://github.com/abo-abo/auto-yasnippet&quot;&gt;auto-yasnippet&lt;/a&gt; does more&#xA;than a plain &lt;code&gt;open-line&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it tries to expand abbrevs&lt;/li&gt;&#xA;&lt;li&gt;it tries to move to the next field of yasnippet&lt;/li&gt;&#xA;&lt;li&gt;it tries to expand yasnippet&lt;/li&gt;&#xA;&lt;li&gt;finally, it calls &lt;code&gt;open-line&lt;/code&gt; if all else fails&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-03T10:22:56.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7911" PostTypeId="2" ParentId="7902" CreationDate="2015-02-03T12:02:37.923" Score="1" Body="&lt;p&gt;You can do a generic scan for any Gnus backend.  Look at &lt;code&gt;gnus-group-get-new-news-this-group&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnus-group-get-new-news-this-group is an interactive compiled Lisp&#xA;function in `gnus-group.el'.&#xA;&#xA;(gnus-group-get-new-news-this-group &amp;amp;optional N DONT-SCAN)&#xA;&#xA;Check for newly arrived news in the current group (and the N-1 next groups).&#xA;The difference between N and the number of newsgroup checked is returned.&#xA;If N is negative, this group and the N-1 previous groups will be checked.&#xA;If DONT-SCAN is non-nil, scan non-activated groups as well.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It won't tell you about &lt;strong&gt;just&lt;/strong&gt; the current thread, though.  Gnus threading is pretty flexible and happens late in the game, so you don't know what thread the article will go into.  For that, you should just do a full refresh like in &lt;code&gt;M-g&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-g (translated from &amp;lt;escape&amp;gt; g) runs the command&#xA;gnus-summary-rescan-group (found in gnus-summary-mode-map), which is&#xA;an interactive compiled Lisp function in&#xA;`gnus-sum.el'.&#xA;&#xA;It is bound to M-g, Z G, &amp;lt;menu-bar&amp;gt; &amp;lt;Gnus&amp;gt; &amp;lt;Exit&amp;gt; &amp;lt;Rescan group&amp;gt;.&#xA;&#xA;(gnus-summary-rescan-group &amp;amp;optional ALL)&#xA;&#xA;Exit the newsgroup, ask for new articles, and select the newsgroup.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but that complicates things much more, so I would just use &lt;code&gt;gnus-group-get-new-news-this-group&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-02-03T12:02:37.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7913" PostTypeId="1" CreationDate="2015-02-03T13:07:43.447" Score="11" ViewCount="2276" Body="&lt;p&gt;I'd like to restrict find/grep to (say) only javascript files (mainly because that's what i do in &quot;another editor&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Javascript files in my legacy Ruby-on-Rails project have one of these file extensions:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;.js, .js.erb, .coffee, .js.coffee, .js.coffee.erb, .jsx, .js.jsx, .js.jsx.erb&lt;/em&gt; (and maybe more)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If i could, i would restrict find to files with these file extensions, and pre-define this list so i don't have to type it each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think i need to write a custom function, if there is a way to specify filetype, but I'm struggling to discover how to do this.. and maybe I've just picked up a weird workflow from my old editor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: sorry the question wasn't clear.. i don't want to fix it so that emacs always searches in Javascript files.. when i want to search in Javascript files, i want to search only files with those extensions.. when i want to search in html files i want to only search in files with extensions .html, .html.erb, .html.haml, .haml, etc.&lt;/p&gt;&#xA;" OwnerUserId="740" LastEditorUserId="740" LastEditDate="2015-02-04T10:24:10.763" LastActivityDate="2015-02-04T15:18:05.087" Title="helm-ag (or similar) find in javascript files only" Tags="|helm|search|helm-for-files|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7914" PostTypeId="2" ParentId="7913" CreationDate="2015-02-03T13:33:35.710" Score="1" Body="&lt;h1&gt;If using &lt;code&gt;ag&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you are using &lt;code&gt;ag&lt;/code&gt;, you can place an &lt;code&gt;.agignore&lt;/code&gt; file in the project root with the files you would want to ignore. Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Extension ignores&#xA;*.log&#xA;*~&#xA;*#*#&#xA;*.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="2264" LastEditDate="2015-02-04T14:27:04.347" LastActivityDate="2015-02-04T14:27:04.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7915" PostTypeId="2" ParentId="7913" CreationDate="2015-02-03T14:49:16.073" Score="1" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/syohex/emacs-helm-ag#helm-ag-use-grep-ignore-listdefault-nil&quot; rel=&quot;nofollow&quot;&gt;helm-ag-use-grep-ignore-list&lt;/a&gt; and specify ignore patterns in &lt;code&gt;grep-find-ignored-files&lt;/code&gt; and &lt;code&gt;grep-find-ignored-director&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-02-03T14:49:16.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7916" PostTypeId="2" ParentId="7898" CreationDate="2015-02-03T14:50:16.840" Score="2" Body="&lt;p&gt;So this isn't a proper solution but I ran your test the other way around (e.g. the while [1] on the second shell) and it works fine. As a work around you could ensure that any shell buffers that are likely to be generating heavy output are created later than the ones where you want interactivity. That way the interactive shells are the first to be handled by Emacs' inferior poll before finally handling the one that generates lots of output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice if you are running a selection of interactive shell you will likely not be in a situation where one hogs the I/O for so long. If you regularly need such a thing maybe redirecting the output into a file and using view mode is a better solution?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-02-03T14:50:16.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7917" PostTypeId="1" AcceptedAnswerId="7918" CreationDate="2015-02-03T15:05:33.903" Score="1" ViewCount="170" Body="&lt;p&gt;When I run &lt;code&gt;M-x ibuffer&lt;/code&gt;, a table of my buffers is displayed. The first column header is &lt;code&gt;MR&lt;/code&gt;, and I assume the &lt;code&gt;R&lt;/code&gt; stands for read only, however, I don't know what the &lt;code&gt;M&lt;/code&gt; stands for. What does it stand for?&lt;/p&gt;&#xA;" OwnerUserId="5406" LastActivityDate="2015-02-03T15:24:31.547" Title="What does the M in MR stand for in the first column header of *IBuffer*?" Tags="|ibuffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7918" PostTypeId="2" ParentId="7917" CreationDate="2015-02-03T15:15:26.297" Score="2" Body="&lt;p&gt;I would assume it stands for Modified. A buffer with unsaved changes will have an asterisk in this column.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastActivityDate="2015-02-03T15:15:26.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7919" PostTypeId="2" ParentId="7917" CreationDate="2015-02-03T15:24:31.547" Score="2" Body="&lt;p&gt;&lt;code&gt;M&lt;/code&gt; stands for &quot;modified&quot;. Emacs will display a star in this column for every buffer that is visiting a modified file.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-02-03T15:24:31.547" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7920" PostTypeId="1" CreationDate="2015-02-03T15:33:01.857" Score="4" ViewCount="154" Body="&lt;p&gt;I want to create a style file for the &lt;code&gt;tcolorbox&lt;/code&gt; environment. I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA;      (lambda ()&#xA;        (LaTeX-add-environments&#xA;         '(&quot;tcolorbox&quot;)&#xA;         ))&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I want Emacs to query for the optional &lt;code&gt;[title=]&lt;/code&gt; parameter. How can I do that? &lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="50" LastEditDate="2015-02-03T23:09:50.200" LastActivityDate="2015-02-04T01:35:14.133" Title="Optional argument in AuCTeX definition of environment" Tags="|latex|auctex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7921" PostTypeId="2" ParentId="7697" CreationDate="2015-02-03T15:44:43.877" Score="3" Body="&lt;h2&gt;Solution for displaying the org-clock information in the OSX menu bar&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is an alternative solution to the problem you specified:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I use apps other than Emacs, so when I switch to them (e.g.. when&#xA;  using the browser or terminal) I still want to be able to look at the&#xA;  running timer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can use this to display the information from org-clock in the osx menubar which you should almost always be able to see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jordonbiondo/osx-org-clock-menubar&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jordonbiondo/osx-org-clock-menubar&lt;/a&gt; Available on MELPA&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this requires macruby.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it looks like while clocked in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ygJld.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-02-05T19:26:28.057" LastActivityDate="2015-02-05T19:26:28.057" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7922" PostTypeId="1" AcceptedAnswerId="7923" CreationDate="2015-02-03T16:10:03.583" Score="2" ViewCount="890" Body="&lt;p&gt;I'm using helm with projectile. When i hit &lt;code&gt;C-c p f&lt;/code&gt; - &lt;code&gt;helm-projectile-find-file&lt;/code&gt; it shows no more then 100 files, turning off the caching doesn't help. I like to combine this with &lt;code&gt;helm-occur&lt;/code&gt;, when i filter a bunch of files, hit &lt;code&gt;M-a&lt;/code&gt; to select them all, then 'C-s` to search occurrence in these files, so i wonder if it shows only 100 does it find occurrences in all files. &lt;/p&gt;&#xA;" OwnerUserId="2361" LastEditorUserId="105" LastEditDate="2017-05-16T22:38:39.817" LastActivityDate="2017-05-16T22:38:39.817" Title="Helm Projectile file limit" Tags="|helm|projectile|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7923" PostTypeId="2" ParentId="7922" CreationDate="2015-02-03T16:12:50.427" Score="2" Body="&lt;p&gt;I think the variable &lt;code&gt;helm-candidate-number-limit&lt;/code&gt; is what you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Limit candidate number globally.&#xA;  Do not show more candidates than this limit from individual sources.&#xA;  It is usually pointless to show hundreds of matches&#xA;  when the pattern is empty, because it is much simpler to type a&#xA;  few characters to narrow down the list of potential candidates.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The default is 100...&lt;/p&gt;&#xA;" OwnerUserId="2688" LastActivityDate="2015-02-03T16:12:50.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7924" PostTypeId="2" ParentId="7922" CreationDate="2015-02-03T16:16:45.410" Score="2" Body="&lt;p&gt;&lt;code&gt;C-s&lt;/code&gt; runs &lt;code&gt;helm-grep&lt;/code&gt; on selected files, not &lt;code&gt;helm-occur&lt;/code&gt;. You can already perform grep/ack/ag with &lt;code&gt;helm-projectile-grep/ack/ag&lt;/code&gt;. Just run one of those command, and it will search across project directory. See demos and more info in &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html#sec-9&quot; rel=&quot;nofollow&quot;&gt;my Helm Projectile guide&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you shouldn't change the default &lt;code&gt;100&lt;/code&gt; or smaller, otherwise you should disable fuzzy-matching by adding &lt;code&gt;(setq helm-projectile-fuzzy-match nil)&lt;/code&gt; before &lt;code&gt;(require 'helm-projectile)&lt;/code&gt; because the more candidates are displayed, the slower fuzzy matching. This number is suggested by Helm maintainer.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-02-03T16:16:45.410" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7925" PostTypeId="2" ParentId="7908" CreationDate="2015-02-03T16:32:20.970" Score="25" Body="&lt;p&gt;This is what I created for myself, facing the same issue. It is from &lt;a href=&quot;http://www.emacswiki.org/emacs/CompanyMode#toc10&quot;&gt;company-mode's Emacs Wiki page&lt;/a&gt;, but heavily extended:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun check-expansion ()&#xA;  (save-excursion&#xA;    (if (looking-at &quot;\\_&amp;gt;&quot;) t&#xA;      (backward-char 1)&#xA;      (if (looking-at &quot;\\.&quot;) t&#xA;    (backward-char 1)&#xA;    (if (looking-at &quot;-&amp;gt;&quot;) t nil)))))&#xA;&#xA;(defun do-yas-expand ()&#xA;  (let ((yas/fallback-behavior 'return-nil))&#xA;    (yas/expand)))&#xA;&#xA;(defun tab-indent-or-complete ()&#xA;  (interactive)&#xA;  (cond&#xA;   ((minibufferp)&#xA;    (minibuffer-complete))&#xA;   (t&#xA;    (indent-for-tab-command)&#xA;    (if (or (not yas/minor-mode)&#xA;        (null (do-yas-expand)))&#xA;    (if (check-expansion)&#xA;        (progn&#xA;          (company-manual-begin)&#xA;          (if (null company-candidates)&#xA;          (progn&#xA;            (company-abort)&#xA;            (indent-for-tab-command)))))))))&#xA;&#xA;(defun tab-complete-or-next-field ()&#xA;  (interactive)&#xA;  (if (or (not yas/minor-mode)&#xA;      (null (do-yas-expand)))&#xA;      (if company-candidates&#xA;      (company-complete-selection)&#xA;    (if (check-expansion)&#xA;      (progn&#xA;        (company-manual-begin)&#xA;        (if (null company-candidates)&#xA;        (progn&#xA;          (company-abort)&#xA;          (yas-next-field))))&#xA;      (yas-next-field)))))&#xA;&#xA;(defun expand-snippet-or-complete-selection ()&#xA;  (interactive)&#xA;  (if (or (not yas/minor-mode)&#xA;      (null (do-yas-expand))&#xA;      (company-abort))&#xA;      (company-complete-selection)))&#xA;&#xA;(defun abort-company-or-yas ()&#xA;  (interactive)&#xA;  (if (null company-candidates)&#xA;      (yas-abort-snippet)&#xA;    (company-abort)))&#xA;&#xA;(global-set-key [tab] 'tab-indent-or-complete)&#xA;(global-set-key (kbd &quot;TAB&quot;) 'tab-indent-or-complete)&#xA;(global-set-key [(control return)] 'company-complete-common)&#xA;&#xA;(define-key company-active-map [tab] 'expand-snippet-or-complete-selection)&#xA;(define-key company-active-map (kbd &quot;TAB&quot;) 'expand-snippet-or-complete-selection)&#xA;&#xA;(define-key yas-minor-mode-map [tab] nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;&#xA;(define-key yas-keymap [tab] 'tab-complete-or-next-field)&#xA;(define-key yas-keymap (kbd &quot;TAB&quot;) 'tab-complete-or-next-field)&#xA;(define-key yas-keymap [(control tab)] 'yas-next-field)&#xA;(define-key yas-keymap (kbd &quot;C-g&quot;) 'abort-company-or-yas)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically, this makes &lt;kbd&gt;&amp;lt;tab&amp;gt;&lt;/kbd&gt; do the right thing &lt;em&gt;most&lt;/em&gt; of the time. Pressing tab will&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Indent the current line,&lt;/li&gt;&#xA;&lt;li&gt;If there is a yasnippet to expand, expand it, even if this means aborting a company completion (I don't use abbreviations much, so no abbreviation support yet),&lt;/li&gt;&#xA;&lt;li&gt;If a company completion is ongoing, complete with the selected item,&lt;/li&gt;&#xA;&lt;li&gt;Otherwise try to use company to start autocomplete,&lt;/li&gt;&#xA;&lt;li&gt;If there is nothing to autocomplete and we're in a yasnippet placeholder, skip to the next placeholder.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that if there is an opportunity to autocomplete and you are currently editing in a snippet placeholder, the situation is ambigous. As a compromise, I bound &lt;kbd&gt;C-&amp;lt;tab&amp;gt;&lt;/kbd&gt; to skip to the next placeholder directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that the snippet's name does not appear in the company menu and the existence of a snippet silently modifies the behaviour of the tab key is not particularly nice, unfortunately... Although at least it is possible to type &lt;kbd&gt;&amp;lt;return&amp;gt;&lt;/kbd&gt; instead to get the completion instead of the snippet.&lt;/p&gt;&#xA;" OwnerUserId="5368" LastActivityDate="2015-02-03T16:32:20.970" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7926" PostTypeId="1" CreationDate="2015-02-03T17:05:17.383" Score="3" ViewCount="92" Body="&lt;p&gt;As far as I can tell, emacs can only use fonts installed on the operating system.  Is it possible to define a font directly in emacs lisp?  This would allow one to directly embed a font definition in an emacs theme, making the theme more portable.&lt;/p&gt;&#xA;" OwnerUserId="3853" LastActivityDate="2015-02-03T17:05:17.383" Title="Embed a font definition in an emacs theme?" Tags="|themes|fonts|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7927" PostTypeId="1" AcceptedAnswerId="7930" CreationDate="2015-02-03T17:37:57.517" Score="3" ViewCount="2699" Body="&lt;p&gt;I am using Emacs 24.4 with Ubuntu 14.04. I just discovered that the &lt;kbd&gt;C-M&lt;/kbd&gt; keyboard sequences are not working in Emacs. For example in &lt;code&gt;elisp-mode&lt;/code&gt; the key &lt;kbd&gt;C-M-left&lt;/kbd&gt; is bound to &lt;code&gt;backward-sexp&lt;/code&gt;, but when I press &lt;code&gt;Ctrl+Alt+&quot;Arrow Left&quot;&lt;/code&gt; nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try &lt;code&gt;describe-key&lt;/code&gt; and type some key combination with &lt;code&gt;Ctrl+Alt&lt;/code&gt; nothing happens, but pressing &lt;code&gt;Ctrl+Left&lt;/code&gt;, or &lt;code&gt;Alt+Left&lt;/code&gt; works fine. Also pressing &lt;code&gt;Ctrl+Alt+L&lt;/code&gt; locks the computer, which indicates that the desktop intercepts the &lt;code&gt;Ctrl+Alt&lt;/code&gt; keystrokes before Emacs gets them..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can confirm that the key &lt;kbd&gt;C-M-r&lt;/kbd&gt; is in fact working, so I think this is an indication that there is a conflict with the Ubuntu desktop keyboard shortcuts somewhere. &lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-02-03T17:48:03.470" LastActivityDate="2015-02-03T17:55:18.853" Title="Control+Meta key is not working" Tags="|key-bindings|keystrokes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7928" PostTypeId="1" AcceptedAnswerId="7938" CreationDate="2015-02-03T17:39:12.157" Score="2" ViewCount="872" Body="&lt;p&gt;How do I open a frame at start-up when using &lt;code&gt;emacs --daemon&lt;/code&gt;? I don't run &lt;code&gt;emacs --daemon&lt;/code&gt; directly. Instead, I use &lt;code&gt;emacsclient -c -a ''&lt;/code&gt; which starts an &lt;code&gt;emacs-server&lt;/code&gt; if there isn't one running already. However, if I simply add something like &lt;code&gt;(make-frame '((name . &quot;SomeName&quot;))&lt;/code&gt; to &lt;code&gt;.emacs&lt;/code&gt;, I get an error saying &lt;code&gt;Unknown terminal type&lt;/code&gt;. How do I fix this?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-02-03T20:23:34.440" Title="Opening frames from emacs-daemon" Tags="|emacsclient|emacs-daemon|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7929" PostTypeId="1" AcceptedAnswerId="7931" CreationDate="2015-02-03T17:41:34.817" Score="2" ViewCount="67" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I get the bounds of a LaTeX footnote?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to detect, programmatically, if point is inside a LaTeX footnote environment.  Ideally, I'd like to be able to extract the beginning and end points of the footnote.  How would one do so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of the &lt;code&gt;TeX-current-macro&lt;/code&gt; function, but it's not quite what I need.  If, for example, point is inside a citation inside a footnote, it will stop at detecting the citation.  It also does not provide the bounds.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-03T18:07:03.163" Title="detect if inside a LaTeX footnote and get its bounds?" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7930" PostTypeId="2" ParentId="7927" CreationDate="2015-02-03T17:55:18.853" Score="4" Body="&lt;p&gt;Checking the Ubuntu system-settings :&lt;code&gt;System-settings-&amp;gt;keyboard-&amp;gt;shortcuts-&amp;gt;navigation&lt;/code&gt;, shows that&#xA;&lt;code&gt;Ctrl+Alt+Left&lt;/code&gt; was bound to &lt;code&gt;&quot;Switch to workspace left&quot;&lt;/code&gt; and &#xA;&lt;code&gt;Ctrl+Alt+Right&lt;/code&gt; was bound to &lt;code&gt;&quot;Switch to workspace right&quot;&lt;/code&gt;. Disabling these two shortcuts solved the problem.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-03T17:55:18.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7931" PostTypeId="2" ParentId="7929" CreationDate="2015-02-03T18:07:03.163" Score="3" Body="&lt;p&gt;I couldn't find anything ready-made, but it turns out not to be too hard to write up with a combination of &lt;code&gt;TeX-current-macro&lt;/code&gt;, &lt;code&gt;TeX-find-macro-start&lt;/code&gt;, and &lt;code&gt;TeX-find-macro-boundaries&lt;/code&gt;.  This function will also serve as a predicate, and could be adapted to other kinds of macros pretty easily:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun LaTeX-footnote-bounds ()&#xA;  &quot;Return bounds of a LaTeX footnote as a cons cell, or nil if&#xA;not in a footnote.&quot;&#xA;  (let ((macro (TeX-current-macro)))&#xA;    (when macro&#xA;      (save-excursion&#xA;        (while (not (equal &quot;footnote&quot; macro))&#xA;          (goto-char (- (TeX-find-macro-start)&#xA;                        (if (equal &quot;footnote&quot; (setq macro (TeX-current-macro)))&#xA;                            0&#xA;                          1))))&#xA;        (TeX-find-macro-boundaries)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-03T18:07:03.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7932" PostTypeId="2" ParentId="7905" CreationDate="2015-02-03T18:17:57.603" Score="1" Body="&lt;p&gt;Finding the default pdf viewer for your system will depend on your operating system I think. On some Linux systems &lt;code&gt;xdg-open&lt;/code&gt; would work for this. It might be easier to hard-code the viewer into the code: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-view-pdf ()&#xA;  (interactive)&#xA;  (async-shell-command&#xA;    (concat &quot;SumatraPDF &quot; (file-name-base (buffer-file-name)) &quot;.pdf&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, if you're using AucTex you can just call &lt;code&gt;C-c C-v&lt;/code&gt; and you're done. Why not use AucTeX?&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2015-02-04T03:25:17.133" LastActivityDate="2015-02-04T03:25:17.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7933" PostTypeId="1" CreationDate="2015-02-03T18:21:57.783" Score="8" ViewCount="1755" Body="&lt;p&gt;Long time &lt;code&gt;mutt&lt;/code&gt; user, I am currently trying to learn how to deal with my mail from within emacs with the help of &lt;code&gt;mu4e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it comes to signing mail, I use the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'message-send-hook 'mml-secure-message-sign-pgpmime)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which automatically gets the job done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I have to manage several different keys / accounts, I am looking for the way to select the key I'll use for signing the message (&lt;code&gt;epa-list-keys&lt;/code&gt; gives me three answers).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you select under emacs the key you sign/encrypt with when using &lt;code&gt;mml&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2020-03-19T04:38:47.350" Title="How do you select under emacs the key you sign/encrypt with when using mml?" Tags="|mu4e|security|encryption|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7935" PostTypeId="1" AcceptedAnswerId="7937" CreationDate="2015-02-03T19:12:42.163" Score="2" ViewCount="33" Body="&lt;p&gt;Consider the variable &lt;code&gt;TeX-current-macro&lt;/code&gt; raised in the recent question &lt;a href=&quot;https://emacs.stackexchange.com/q/7929/2609&quot;&gt;detect if inside a LaTeX footnote and get its bounds?&lt;/a&gt; also in &lt;a href=&quot;https://emacs.stackexchange.com/a/7634/2690&quot;&gt;https://emacs.stackexchange.com/a/7634/2690&lt;/a&gt;. &#xA;I would like to determine if I am inside the macros &lt;code&gt;chapter&lt;/code&gt; or &lt;code&gt;section&lt;/code&gt; in a latex file, I can write define a function which shows &lt;code&gt;yes&lt;/code&gt; if it is the case, otherwise &lt;code&gt;no&lt;/code&gt;.&#xA;Of course I can use the following which does the job.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun foo-test () (interactive)&#xA;    (if (or (equal (TeX-current-macro) &quot;chapter&quot;) &#xA;(equal (TeX-current-macro) &quot;section&quot;)) &#xA;(message &quot;yes&quot;) (message &quot;no&quot;))&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it is long. Like in my previous question &lt;a href=&quot;https://emacs.stackexchange.com/q/7879/2609&quot;&gt;What is the easiest way to check if a character belongs to a particular set of characters?&lt;/a&gt;, I am wondering if there is a better way to do it.&#xA;Inspired by the answer &lt;a href=&quot;https://emacs.stackexchange.com/a/7880/2609&quot;&gt;https://emacs.stackexchange.com/a/7880/2609&lt;/a&gt;, I tried the below code, but unfortunately it doesn't work. &#xA;I also tried with &lt;code&gt;memq&lt;/code&gt; instead of &lt;code&gt;member&lt;/code&gt; but it doesn't work either.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun foo-test () (interactive)&#xA;    (if (member (TeX-current-macro) '(chapter section)) &#xA;(message &quot;yes&quot;) (message &quot;no&quot;))&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any solution about checking if the value of a  variable belong to a list of elements is welcomed. &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-02-03T20:31:21.187" Title="Why isn't (TeX-current-macro) a member of '(chapter section)?" Tags="|elisp|auctex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7936" PostTypeId="1" AcceptedAnswerId="7994" CreationDate="2015-02-03T19:19:44.330" Score="5" ViewCount="2135" Body="&lt;p&gt;I normally use OS X, and have recently decided to start using Emacs, and specifically AUCTeX based on myriad recommendations. I downloaded the current version for OS X and tried to preview a very simple document: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article} &#xA;\begin{document} &#xA;$e^x=10$ &#xA;\end{document} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I tried to use preview-buffer and preview-at point, I initially got the usual PATH-based errors that one seems to get on OS X, but on correcting those I got an error that didn't seem to be caused by the PATH: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;PDF2DSC sentinel: Wrong type argument: arrayp, nil &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The process then seems to hang, producing no further output, although DSC files &lt;em&gt;do&lt;/em&gt; appear to have been created in &lt;code&gt;_region_.prv/tmpXXXXXX/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I switched over to the Linux side of my laptop (Arch Linux), installed Emacs 24.4.1 and the current version of AUCTeX (11.88.2), only to discover that the issue had followed me across partitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit: Added debug info&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I enable debugging on error I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument arrayp nil)&#xA;  signal(wrong-type-argument (arrayp nil))&#xA;  preview-reraise-error(#&amp;lt;process Preview-PDF2DSC&amp;gt;)&#xA;  preview-pdf2dsc-sentinel(#&amp;lt;process Preview-PDF2DSC&amp;gt; &quot;Preview-PDF2DSC&quot; t)&#xA;  (lambda (process command) (preview-pdf2dsc-sentinel process command t))(#&amp;lt;process Preview-PDF2DSC&amp;gt; &quot;Preview-PDF2DSC&quot;)&#xA;  TeX-command-sentinel(#&amp;lt;process Preview-PDF2DSC&amp;gt; &quot;finished\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not an emacs lisp expert (learning is slow), so I'm not sure what this means, but it looks like the error comes from this section of &lt;code&gt;preview.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun preview-pdf2dsc-sentinel (process _command &amp;amp;optional gsstart)&#xA;  &quot;Sentinel function for indirect rendering PDF process.&#xA;The usual PROCESS and COMMAND arguments for&#xA;`TeX-sentinel-function' apply.  Starts gs if GSSTART is set.&quot;&#xA;  (condition-case err&#xA;      (let ((status (process-status process)))&#xA;    (cond ((eq status 'exit)&#xA;           (delete-process process)&#xA;           (setq TeX-sentinel-function nil)&#xA;           (setq preview-gs-init-string&#xA;             (concat preview-gs-init-string&#xA;                 (preview-pdf-color-string preview-colors)))&#xA;           (preview-prepare-fast-conversion)&#xA;           (when gsstart&#xA;         (if preview-gs-queue&#xA;             (preview-gs-restart)&#xA;           (when preview-ps-file&#xA;             (condition-case nil&#xA;             (preview-delete-file preview-ps-file)&#xA;               (file-error nil))))))&#xA;          ((eq status 'signal)&#xA;           (delete-process process)&#xA;           (preview-dvips-abort))))&#xA;    (error (preview-log-error err &quot;PDF2DSC sentinel&quot; process)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have TeXlive 2014.34872-1 installed, and Emacs seems to have the right PATH set in both OS X and Linux (as determined by &lt;code&gt;getenv PATH&lt;/code&gt;. I only found one other mention of this problem online (&lt;a href=&quot;http://lists.gnu.org/archive/html/auctex/2014-12/msg00020.html&quot; rel=&quot;noreferrer&quot;&gt;http://lists.gnu.org/archive/html/auctex/2014-12/msg00020.html&lt;/a&gt;), and there's no resolution to the issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I doing something wrong, or is this a bug?&lt;/p&gt;&#xA;" OwnerUserId="5411" LastEditorUserId="5411" LastEditDate="2015-02-03T23:27:01.967" LastActivityDate="2015-02-05T15:50:12.703" Title="AUCTeX/Preview PDF2DSC sentinel error" Tags="|latex|auctex|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7937" PostTypeId="2" ParentId="7935" CreationDate="2015-02-03T19:28:58.077" Score="1" Body="&lt;p&gt;&lt;code&gt;member&lt;/code&gt;'s comparison is done with &lt;code&gt;equal&lt;/code&gt;, so you can't mix types.  Your example uses &lt;em&gt;symbols&lt;/em&gt; for &lt;code&gt;chapter&lt;/code&gt; and &lt;code&gt;section&lt;/code&gt;, but &lt;code&gt;TeX-current-macro&lt;/code&gt; returns a string.  Hence, you want your list to have strings as well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo-test () (interactive)&#xA;  (if (member (TeX-current-macro) '(&quot;chapter&quot; &quot;section&quot;)) &#xA;      (message &quot;yes&quot;)&#xA;    (message &quot;no&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq macro-names '(&quot;chapter&quot; &quot;section&quot;))&#xA;(member &quot;chapter&quot; macro-names)          ; =&amp;gt; (&quot;chapter&quot; &quot;section&quot;)&#xA;(member &quot;puppies&quot; macro-names)          ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-03T19:28:58.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7938" PostTypeId="2" ParentId="7928" CreationDate="2015-02-03T20:16:08.273" Score="3" Body="&lt;p&gt;This happens because your &lt;code&gt;.emacs&lt;/code&gt; runs when the daemon is started. Usually, you start the daemon without any display system at all, and Emacs doesn't know how to make frames. After &lt;code&gt;emacsclient&lt;/code&gt; forces Emacs to create a frame in the current session, Emacs then knows how to create frames.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can fix this by using the &lt;code&gt;--eval&lt;/code&gt; flag of &lt;code&gt;emacsclient&lt;/code&gt;, which evaluates the lisp &lt;em&gt;after&lt;/em&gt; Emacs is made aware of your windowing system. In order to create another frame, as you specify, execute this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -c -a '' --eval &quot;(make-frame '((name . \&quot;SomeName\&quot;)))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which should spawn two frames: the default one, and a new one named &quot;SomeName&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-02-03T20:23:34.440" LastActivityDate="2015-02-03T20:23:34.440" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7939" PostTypeId="1" AcceptedAnswerId="7940" CreationDate="2015-02-03T20:22:09.117" Score="1" ViewCount="162" Body="&lt;p&gt;I like to have my &lt;code&gt;auto-mode-alist&lt;/code&gt; for &lt;code&gt;*.el&lt;/code&gt; files set up to open them in a custom major-mode that is &lt;code&gt;buffer-read-only&lt;/code&gt;.  When installing certain packages through the choices available when typing &lt;code&gt;M-x list-packages&lt;/code&gt;, the package process creates an &lt;code&gt;...autoloads.el&lt;/code&gt; file.  Adding information to that &lt;code&gt;...autoloads.el&lt;/code&gt; file during the package building process fails because the buffer is read only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, I'd like the &lt;code&gt;auto-mode-alist&lt;/code&gt; to temporarily be set to &lt;code&gt;nil&lt;/code&gt; so that the process of creating the &lt;code&gt;...autoloads.el&lt;/code&gt; file is working in a &lt;code&gt;fundamental-mode&lt;/code&gt; buffer instead of my custom major-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some suggestions on how to handle this issue would be greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-02-03T20:34:04.287" Title="How to set the `auto-mode-alist` for `*.el` files when installing packages" Tags="|package|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7940" PostTypeId="2" ParentId="7939" CreationDate="2015-02-03T20:34:04.287" Score="1" Body="&lt;p&gt;Try this:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'package&#xA;  (defadvice package-generate-autoloads&#xA;    (around disable-custom-major-mode activate preactivate compile)&#xA;    (let ((auto-mode-alist nil))&#xA;      ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't tested if it works, but I'm pretty sure it does what you ask.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-03T20:34:04.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7941" PostTypeId="2" ParentId="7901" CreationDate="2015-02-03T20:50:37.590" Score="1" Body="&lt;p&gt;After doing more research into what my options are, I decided to instead use markdown and gimli to create a pdf which I could then attach to the resulting email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gimli: &lt;a href=&quot;https://github.com/walle/gimli&quot; rel=&quot;nofollow&quot;&gt;https://github.com/walle/gimli&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also added an &quot;Email body: &quot; prompt so that the user could incorporate a message instead of just the pdf attachment. Nevertheless, I am open to any more suggestions (possibly instead of having the code attached as a pdf, include it in the body of the email? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt; actually was able to use html to do this, but without syntax highlighting [for those who are interested, I used google-code-prettify: &lt;a href=&quot;http://code.google.com/p/google-code-prettify/&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/google-code-prettify/&lt;/a&gt; ]).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun email_mark (addr subj body)&#xA;   (interactive &quot;sEnter email address: \nsEnter email subject: \nsEnter email body: &quot;)&#xA;   (let* ((default-directory &quot;/files/&quot;)&#xA;          (fname &quot;email.md&quot;)&#xA;          (fname-no-ext (substring fname 0 -3))&#xA;          (pdf-file (concat fname-no-ext &quot;.pdf&quot;))&#xA;          (snip (buffer-substring (region-beginning) (region-end)))&#xA;          (lang (if (equal &quot;emacs-lisp&quot; (substring (format &quot;%s&quot; major-mode) 0 -5)) &quot;lisp&quot;)))&#xA;     (write-region (format &quot;```%s\n%s\n```&quot; lang snip) (region-end) fname)&#xA;     (shell-command (format &quot;gimli -f %s -outputdir %s&quot; (concat default-directory fname) default-directory))&#xA;     (shell-command (format &quot;echo '%s' | mutt -s '%s' -a '%s' -- '%s'&quot; body subj (concat default-directory pdf-file) addr))))&#xA;&#xA;(global-set-key &quot;\C-x\m&quot; 'email_mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5398" LastEditorUserId="5398" LastEditDate="2015-02-03T20:56:55.287" LastActivityDate="2015-02-03T20:56:55.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7942" PostTypeId="1" CreationDate="2015-02-03T20:52:26.157" Score="0" ViewCount="281" Body="&lt;p&gt;I had a hard time typing with Rt-to-Lt language and using quotes in LaTeX while keeping the font-locking of quotes. I use &lt;code&gt;csquotes&lt;/code&gt; package latest version (Version 5.1d -- 2011) for many advantages like toggling between different variants in a style. To make a long story short (see: &lt;a href=&quot;https://tex.stackexchange.com/q/226097/26295&quot;&gt;https://tex.stackexchange.com/q/226097/26295&lt;/a&gt;) I want to have font-locking of text between two &lt;code&gt;&quot;&lt;/code&gt;s. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to do achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UN6iX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to have font-lock for the first line, i.e. between the two &lt;code&gt;&quot;&lt;/code&gt; marks, using the same color of default quotes seen in the second line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[twoside=semi]{scrbook}&#xA;\usepackage{polyglossia}&#xA;\setmainlanguage[numerals=mashriq,abjadjimnotail=true]{arabic} &#xA;\newfontfamily\arabicfont[Script=Arabic,Ligatures=TeX]{Simplified Arabic} &#xA;&#xA;\usepackage[style=arabic,arabic=quotes]{csquotes} % this is a custom style -- but it is not important for this font-lock question I think.&#xA;\MakeOuterQuote{&quot;}&#xA;\begin{document}&#xA;&#xA;هذا نص باللغة العربية  &quot;داخل علامتي الافتباس&quot;.&#xA;&#xA;هذا نص باللغة العربية  ``داخل علامتي الافتباس''.&#xA;&#xA;هذا نص باللغة العربية \enquote{داخل علامتي الاقتباس}.&#xA;&#xA;&#xA;\end{document}&#xA;&#xA;%%% Local Variables:&#xA;%%% mode: latex&#xA;%%% TeX-master: t&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;font-latex-quote&lt;/code&gt; variable was set to &lt;code&gt;auto&lt;/code&gt;  &lt;/li&gt;&#xA;&lt;li&gt;face: &lt;code&gt;font-latex-string face&lt;/code&gt;: foreground LightSalmon&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Trial Code&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The comments of &lt;code&gt;lawlist&lt;/code&gt; has put me on the right track but there is still the problem of that single &lt;code&gt;&quot;&lt;/code&gt; in the preamble of &lt;code&gt;\MakeOuterQuote{&quot;}&lt;/code&gt; as it interferes with the regexp code. The below code in the &lt;code&gt;.init&lt;/code&gt; gives the desired effect if that single unmatched &lt;code&gt;&quot;&lt;/code&gt; in the preamble were not there:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'latex-mode (list (list &quot;\\(\&quot;\\)\\(\\(.\\|\n\\)+?\\)\\(\&quot;\\)&quot; '(1 'font-latex-string-face t) '(2 'font-latex-string-face t) '(3 'font-latex-string-face t) '(4 'font-latex-string-face t))))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dTmmC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Trial to avoid it&lt;/strong&gt;&lt;br&gt;&#xA;I used this regexp to avoid that single &lt;code&gt;&quot;&lt;/code&gt; and that increased number of potential groups from 4 to 5.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\\(:?[^{]\\) in front of the previous regexp  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I put in in &lt;code&gt;.init&lt;/code&gt;:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'latex-mode (list (list &quot;\\(:?[^{]\\)\\(\&quot;\\)\\(\\(.\\|\n\\)+?\\)\\(\&quot;\\)&quot; '(2 'font-latex-string-face t) '(3 'font-latex-string-face t) '(4 'font-latex-string-face t) '(5 'font-latex-string-face t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;M-x re-builder&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LmrU3.png&quot; alt=&quot;enter image description here&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;re-builder&lt;/code&gt; for regexp confirms that the regexp is avoiding that single unmatched &lt;code&gt;&quot;&lt;/code&gt; (not shown) and shows that there are now 5 regexp groups (1 blue, 2 green, 3 red, 4 blue, 5 green), but I want to font-lock all except group 1 which is the avoid group. However, the current problem is that font-lock won't take effect unless I hit enter of the quote line; as I write quoted text there is no font-lock until I hit enter then and only then it will take the effect. So am I missing something? is it because of the avoid group it doesn't font-lock immediately? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Suggestion as a workaround&lt;/strong&gt;&lt;br&gt;&#xA;Is it possible to enter that single &lt;code&gt;&quot;&lt;/code&gt; as a unicode in the preamble to avoid being detected by the regexp?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2015-02-04T12:56:12.127" Title="How to do font-lock of double quotes in AUCTeX?" Tags="|auctex|font-lock|right-to-left|" AnswerCount="0" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="7943" PostTypeId="2" ParentId="7901" CreationDate="2015-02-03T21:02:05.530" Score="2" Body="&lt;p&gt;You might want to use HTML for that. I advise you to use Org-mode's syntax to write your email and then use the org-mode's HTML exporter. Because you are a lucky guy, you can use &lt;code&gt;org-mime&lt;/code&gt; to do just that! From the description&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-mime can be used to send HTML email using Org-mode HTML export. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-mime.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-contrib/org-mime.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vxlabs.com/2015/01/28/sending-emails-with-math-and-source-code/&quot; rel=&quot;nofollow&quot;&gt;http://vxlabs.com/2015/01/28/sending-emails-with-math-and-source-code/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2222" LastActivityDate="2015-02-03T21:02:05.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7944" PostTypeId="2" ParentId="5566" CreationDate="2015-02-03T21:06:56.890" Score="0" Body="&lt;p&gt;I'm not sure you can optimize &lt;code&gt;emacs -Q&lt;/code&gt; that much. But if you want to know which packages take time to launch and optimize at this level instead, I strongly advise you to have a look at &lt;code&gt;use-package&lt;/code&gt;: &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jwiegley/use-package&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2222" LastActivityDate="2015-02-03T21:06:56.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7945" PostTypeId="2" ParentId="7920" CreationDate="2015-02-03T21:12:50.507" Score="3" Body="&lt;p&gt;You should use the &lt;code&gt;LaTeX-env-args&lt;/code&gt; function (see the &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#index-LaTeX_002denv_002dargs&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; for more information).  In your case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(LaTeX-add-environments&#xA;   '(&quot;tcolorbox&quot; LaTeX-env-args [TeX-arg-key-val ((&quot;title&quot;))]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are some style files using this feature, you should check them out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're writing a style file for the &lt;code&gt;tcolorbox&lt;/code&gt; package, I strongly suggest you to submit it to the AUCTeX mailing list so it can be added upstream.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-02-03T21:12:50.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7946" PostTypeId="1" CreationDate="2015-02-03T21:16:22.773" Score="10" ViewCount="1853" Body="&lt;p&gt;When I want to send an email I composed in Emacs, I press &lt;code&gt;C-c C-c&lt;/code&gt; and am always presented with such an error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;These default coding systems were tried to encode text&#xA;in the buffer `2015-02-03_19:08:30_1':&#xA;  (utf-8-unix (302 . 4194243) (303 . 4194208) (305 . 4194243) (306 .&#xA;  4194217) (308 . 4194243) (309 . 4194221) (311 . 4194243) (312 .&#xA;  4194227))&#xA;However, each of them encountered characters it couldn't encode:&#xA;  utf-8-unix cannot encode these:        &#xA;&#xA;Click on a character (or switch to this window by `M-o'&#xA;and select the characters by RET) to jump to the place it appears,&#xA;where `C-u M-x what-cursor-position' will give information about it.&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At this point I can manually select an encoding and my email is sent. What I don't understand is that I always select &lt;code&gt;utf-8&lt;/code&gt; as the encoding when I receive this message and it just works! But the message said that &lt;code&gt;utf-8-unix&lt;/code&gt; can't encode some characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody tell me why Emacs can't select &lt;code&gt;utf-8&lt;/code&gt; by default and what this error message mean in this context?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2015/02/05&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;mu4e&lt;/code&gt; and I tried &lt;code&gt;(setq-default buffer-file-coding-system 'utf-8)&lt;/code&gt; without success (after evaluating this expression, if I start writing a new email, the variable's value is not &lt;code&gt;'utf-8&lt;/code&gt; but &lt;code&gt;'utf-8-unix&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2015/02/06&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried &lt;code&gt;M-x set-keyboard-coding-system utf-8&lt;/code&gt; and &lt;code&gt;(setq mm-coding-system-priorities '(utf-8))&lt;/code&gt; but this had no visible effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2015/02/21&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've just noticed this problem only happens if &lt;code&gt;smtpmail-queue-mail&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;. So I guess the problem is in the email queueing feature.&lt;/p&gt;&#xA;" OwnerUserId="2222" LastEditorUserId="2222" LastEditDate="2015-02-21T16:20:54.790" LastActivityDate="2019-08-09T23:58:58.347" Title="Using UTF8 encoding as default when writing emails" Tags="|character-encoding|email|mu4e|" AnswerCount="3" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="7947" PostTypeId="1" AcceptedAnswerId="7949" CreationDate="2015-02-03T21:43:26.563" Score="18" ViewCount="11264" Body="&lt;p&gt;Is there any way to view / edit Excel spreadsheets (e.g. &lt;code&gt;xls&lt;/code&gt; and &lt;code&gt;xlsx&lt;/code&gt; files) in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about &lt;code&gt;csv&lt;/code&gt; files? (e.g. column-aligning content). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, this is what I see when I try to open an &lt;code&gt;.xlsx&lt;/code&gt; files in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M Filemode      Length  Date         Time      File&#xA;- ----------  --------  -----------  --------  --------------------------&#xA;  -rw-------    842825   7-Jan-2015  09:28:42  xl/worksheets/sheet1.xml&#xA;  -rw-------       550   7-Jan-2015  09:28:42  xl/workbook.xml&#xA;  -rw-------    313346   7-Jan-2015  09:28:42  xl/sharedStrings.xml&#xA;  -rw-------       784   7-Jan-2015  09:28:42  docProps/app.xml&#xA;  -rw-------       592   7-Jan-2015  09:28:42  docProps/core.xml&#xA;  -rw-------      1167   7-Jan-2015  09:28:42  [Content_Types].xml&#xA;  -rw-------      1403   7-Jan-2015  09:28:42  xl/styles.xml&#xA;  -rw-------      6994   7-Jan-2015  09:28:42  xl/theme/theme1.xml&#xA;  -rw-------       587   7-Jan-2015  09:28:42  _rels/.rels&#xA;  -rw-------       697   7-Jan-2015  09:28:42  xl/_rels/workbook.xml.rels&#xA;- ----------  --------  -----------  --------  --------------------------&#xA;               1168945                         10 files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6" LastEditorUserId="14920" LastEditDate="2018-09-04T08:19:56.077" LastActivityDate="2018-09-04T08:19:56.077" Title="Viewing &amp; editing Excel spreadsheets and csv files in Emacs" Tags="|csv|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7949" PostTypeId="2" ParentId="7947" CreationDate="2015-02-03T22:17:33.557" Score="8" Body="&lt;p&gt;You may want to look at the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/SpreadSheet&quot; rel=&quot;noreferrer&quot;&gt;http://www.emacswiki.org/emacs/SpreadSheet&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It provides many ways to view spreadsheets. I personally like OrgMode: &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To view MS xls files specifically, it suggests &lt;a href=&quot;http://www.emacswiki.org/emacs/UnXls&quot; rel=&quot;noreferrer&quot; title=&quot;UN Xls&quot;&gt;UN Xls&lt;/a&gt;, which is a &quot;small piece of ugly code&quot; that will &quot;convert the Microsoft Excel crud to HTML, and convert the HTML to plain text.&quot; So you should be able to view the files, but you won't be able to edit them.&lt;/p&gt;&#xA;" OwnerUserId="5398" LastEditorUserId="874" LastEditDate="2015-02-04T13:51:59.403" LastActivityDate="2015-02-04T13:51:59.403" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7951" PostTypeId="2" ParentId="7920" CreationDate="2015-02-04T01:35:14.133" Score="1" Body="&lt;p&gt;Using @giordano's suggestion, and examining other styles, I managed to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun LaTeX-tcolorbox-env-item-opt-label (environment)&#xA;  &quot;Insert a `tcolorbox` environment with an optional title.&quot;&#xA;  (LaTeX-insert-environment&#xA;   environment&#xA;   (let ((label (TeX-read-string &quot;(Optional) Title: &quot;)))&#xA;     (concat (unless (zerop (length label))&#xA;               (format &quot;[title={%s}]&quot; label))))))&#xA;&#xA;(add-hook 'LaTeX-mode-hook&#xA;          (lambda ()&#xA;            (LaTeX-add-environments&#xA;             '(&quot;tcolorbox&quot; LaTeX-tcolorbox-env-item-opt-label))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="516" LastActivityDate="2015-02-04T01:35:14.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7952" PostTypeId="1" CreationDate="2015-02-04T03:11:08.727" Score="2" ViewCount="450" Body="&lt;p&gt;I use zsh with the EXTENDED_HISTORY option, which makes it so that in the shell history timestamps are stored which is useful for going back and diagnosing how you screwed up production. I'm trying to transition to using emacs for my terminal with shell-mode, but when I try to browse my previous commands they come up like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;: 1423012245:0;ls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first number is the timestamp, and the second number is the number of seconds the command took. This is exactly how the command looks in the history file too, but zsh is smart enough to filter it out when you press up to browse your previous commands in the real shell. So it appears that comint mode tries to read the history file separately, and doesn't know about the timestamp format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get shell-mode to ignore the timestamps while keeping the option on? &lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2016-05-16T15:46:37.470" Title="zsh EXTENDED_HISTORY corrupts shell-mode history" Tags="|comint|shell-mode|history-variables|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7954" PostTypeId="1" CreationDate="2015-02-04T06:29:38.487" Score="0" ViewCount="308" Body="&lt;p&gt;I made a function in Windows Emacs like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(defun explorer (&amp;amp;optional tex)&#xA;  (interactive)&#xA;  (let* ((current-path (file-name-directory (buffer-file-name)))&#xA;         (file-path-at-point&#xA;           (file-name-directory&#xA;             (concat current-path (if (or (ffap-file-at-point) (ffap-url-at-point))&#xA;                                (substring (ffap-url-at-point) 5))))))&#xA;  (if (equal tex t)&#xA;     (shell-command (format &quot;\&quot;C:/Program Files/TeXnicCenter/TeXnicCenter.exe\&quot; %s&quot; (concat (file-name-sans-extension (buffer-file-name)) &quot;\.tex&quot;))))&#xA;  (shell-command&#xA;     (format &quot;explorer.exe %s&quot;&#xA;        (convert-standard-filename (or file-path-at-point current-path))) t nil)))&#xA;&#xA; (bind-key &quot;&amp;lt;f11&amp;gt;&quot; 'explorer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my opinion, when I press &lt;code&gt;f11&lt;/code&gt;, this function should open window explorer for me, and if I press &lt;code&gt;C-u f11&lt;/code&gt;, it should open a LaTeX file of current directory with Texniccenter.exe, but why doesn't it work, it just open the directory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: if there is some other problems of this function, can anyone give me some advice?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="105" LastEditDate="2022-04-24T01:52:06.653" LastActivityDate="2022-04-24T01:52:06.653" Title="universal argument can not work in this function?" Tags="|prefix-argument|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7955" PostTypeId="2" ParentId="7954" CreationDate="2015-02-04T06:42:47.593" Score="3" Body="&lt;p&gt;Optional arguments don't magically get a value when you use &lt;kbd&gt;C-u&lt;/kbd&gt; unless you &lt;em&gt;tell&lt;/em&gt; Emacs to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a read of &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;interactive&lt;/code&gt; (see options &lt;code&gt;&quot;p&quot;&lt;/code&gt; and &lt;code&gt;&quot;P&quot;&lt;/code&gt; in particular), and then see &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Prefix Command Arguments&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-02-04T06:48:28.103" LastActivityDate="2015-02-04T06:48:28.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7956" PostTypeId="1" CreationDate="2015-02-04T07:07:13.150" Score="4" ViewCount="66" Body="&lt;p&gt;How to do searches in &lt;a href=&quot;http://www.emacswiki.org/emacs/MediaWikiMode&quot; rel=&quot;nofollow&quot;&gt;MediaWiki mode&lt;/a&gt;?  If I instead do searches in Web browser, and then copy the URI of the page into Emacs, it sort of defeats the purpose of using Emacs as and MediaWiki power editor or IDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use case description:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I open Emacs with Mediawiki mode, and connect and login to wikipedia.org.  I want to search for an existing article whose title is roughly Mao Zedong.  I know there must be an article about the person, but the title may have a small difference.  In Web browser, searching &quot;Ma Zedong&quot; will go to this page if it's the exact title, or a list of found results that has titles close to my search term.  What's the equivalent process in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="936" LastEditorUserId="936" LastEditDate="2015-02-04T16:08:44.970" LastActivityDate="2015-02-04T16:08:44.970" Title="How to do searches in MediaWiki mode?" Tags="|search|minor-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7957" PostTypeId="1" AcceptedAnswerId="7976" CreationDate="2015-02-04T07:43:46.940" Score="1" ViewCount="401" Body="&lt;p&gt;&lt;strong&gt;ISSUE&lt;/strong&gt;:  An overlay after-string at the end of a wrapped line is preventing the function &lt;code&gt;previous-line&lt;/code&gt; from moving the cursor directly upwards in a vertical line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION&lt;/strong&gt;:  How to modify the following code snippet so that it essentially excludes the overlay after-string, when point is at the end of the line?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cons (/ (float (car (posn-x-y (posn-at-point)))) (frame-char-width)) (window-hscroll))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;DETAILS&lt;/strong&gt;:  I have a custom minor-mode that places an overlay &lt;code&gt;after-string&lt;/code&gt; at the end of the line, which generates a horizontal overlay stretching from the end of the line to the right edge of the window.  That overlay &lt;code&gt;after-string&lt;/code&gt; is causing a conflict with &lt;code&gt;line-move-visual&lt;/code&gt;, which is used by &lt;code&gt;previous-line&lt;/code&gt;.  When the cursor / point is at the end of the line, the function &lt;code&gt;previous-line&lt;/code&gt; should move the cursor directly upwards in a vertical motion when multiple wrapped lines exist.  When the cursor is at the end of the line, it &lt;strong&gt;looks like&lt;/strong&gt; it is a substantial horizontal distance from the right window edge -- however, the overlay &lt;code&gt;after-string&lt;/code&gt; causes the above-mentioned code to return a value for the cursor position &lt;strong&gt;at the far right window edge&lt;/strong&gt;.  Consequently, the cursor moves to the visual-end of the preceding wrapped line -- instead of moving directly upwards in a vertical motion aligned with the end of the line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP ONE&lt;/strong&gt; -- Beginning Position at End of Line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/example_step_one.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP TWO&lt;/strong&gt; -- UN-desired Effect:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/example_step_two.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Desire Effect -- After Step One&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/example_step_three.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In the event that anyone would like to duplicate the overlay &lt;code&gt;after-string&lt;/code&gt; at the end of the line, here is a scaled down example of what is depicted in the screen-shots above.  The code works just by pasting it into the &lt;code&gt;*scratch*&lt;/code&gt; buffer and typing &lt;code&gt;M-x eval-buffer RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-eol-ruler nil&#xA;&quot;A horizontal ruler stretching from eol (end of line) to the window edge.&quot;)&#xA;(make-variable-buffer-local 'my-eol-ruler)&#xA;&#xA;(defvar my-eol-pilcrow nil&#xA;&quot;A pilcrow symbol placed at the end of every line except the current line.&quot;)&#xA;(make-variable-buffer-local 'my-eol-pilcrow)&#xA;&#xA;(defsubst col-at-eovl ()&#xA;  (save-excursion&#xA;    (let ((movement-indicator (vertical-motion 1)))&#xA;      (when (= movement-indicator 1)&#xA;        (backward-char 1)))&#xA;    (- (current-column) (progn (vertical-motion 0) (current-column)))))&#xA;&#xA;(defun my-eol-ruler-function ()&#xA;  (let* (&#xA;    (opoint (point))&#xA;    (window-width (window-width))&#xA;    (window-start (window-start))&#xA;    (window-end (window-end nil t))&#xA;    (col-eovl (col-at-eovl))&#xA;    (my-current-line-length (- (- window-width col-eovl) 3))&#xA;    (pilcrow&#xA;      (propertize (char-to-string ?\u00B6)&#xA;        'face '(:foreground &quot;red&quot;)&#xA;        'cursor t))&#xA;    (pilcrow-underlined&#xA;      (propertize (char-to-string ?\u00B6)&#xA;        'face '(:foreground &quot;white&quot; :underline &quot;blue&quot;)&#xA;        'cursor t))&#xA;    (underline (propertize (char-to-string ?\u2009)&#xA;          'display `(space :width ,my-current-line-length)&#xA;          'face '(:underline &quot;blue&quot;)&#xA;          'cursor t)))&#xA;  (when (or my-eol-ruler my-eol-pilcrow)&#xA;    (dolist (description `(&#xA;        ,my-eol-ruler&#xA;        ,my-eol-pilcrow ))&#xA;      (remove-overlays (point-min) (point-max) 'after-string description)) )&#xA;  (setq my-eol-ruler (concat pilcrow-underlined underline))&#xA;  (setq my-eol-pilcrow pilcrow)&#xA;  (save-excursion&#xA;    (end-of-line)&#xA;    (overlay-put (make-overlay (point) (point)) 'after-string my-eol-ruler ))&#xA;  (save-excursion&#xA;    (goto-char window-end)&#xA;    (while (re-search-backward &quot;\n&quot; window-start t)&#xA;      (let* (&#xA;          (pbol (point-at-bol))&#xA;          (peol (point))&#xA;          (col-eovl (col-at-eovl)) )&#xA;        (when&#xA;          (or&#xA;            (&amp;lt; opoint pbol)&#xA;            (&amp;gt; opoint peol))&#xA;        (overlay-put (make-overlay peol peol) 'after-string my-eol-pilcrow))))) ))&#xA;&#xA;(add-hook 'post-command-hook 'my-eol-ruler-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.467" LastActivityDate="2015-04-26T19:36:28.847" Title="Calculating cursor position excluding the overlay after-string" Tags="|overlays|motion|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7958" PostTypeId="2" ParentId="5566" CreationDate="2015-02-04T08:07:35.070" Score="4" Body="&lt;p&gt;This delay is likely caused by font initialization, simply because fonts are a major difference between TTY frames and GUI frames:  TTY frames don't do any font management—TTYs don't support font selection anyway—whereas GUI frames have a pretty advanced font management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try to run your GUI Emacs through &lt;code&gt;strace&lt;/code&gt;:  You probably see a lot of IO calls on font files.  If you do, you can try to reduce the delay by removing fonts, or by trying the &lt;a href=&quot;https://github.com/rolandwalker/unicode-fonts&quot; rel=&quot;nofollow&quot;&gt;unicode-fonts&lt;/a&gt; package, which tries to cache a lot of Emacs' font configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that doesn't work, or if &lt;code&gt;strace&lt;/code&gt; shows you no font IO, its output should still provide valueable information.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-02-04T08:07:35.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7959" PostTypeId="1" AcceptedAnswerId="7967" CreationDate="2015-02-04T08:19:19.440" Score="6" ViewCount="2372" Body="&lt;p&gt;When writing Emacs Lisp code, I use &lt;code&gt;forward-sexp&lt;/code&gt; (&lt;kbd&gt;C-M-right&lt;/kbd&gt;) and &lt;code&gt;backward-sexp&lt;/code&gt; (&lt;kbd&gt;C-M-left&lt;/kbd&gt;) to navigate the buffer. However, in some cases these functions stops with error like:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;forward-sexp: Scan error: &quot;Containing expression ends prematurely&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-test1()&#xA;  (message &quot;ok1&quot;))&#xA;&#xA;(defun my-test2()&#xA;  (message &quot;ok2&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If cursor is on the first &lt;code&gt;(&lt;/code&gt;, pressing &lt;kbd&gt;C-M-right&lt;/kbd&gt; twice works fine. However, if cursor is on the first &lt;code&gt;d&lt;/code&gt; (in &lt;code&gt;defun&lt;/code&gt;), pressing &lt;kbd&gt;C-M-right&lt;/kbd&gt; five times results in the error. Instead of the error, I would like to move further down the buffer to the next &lt;code&gt;defun&lt;/code&gt; that is to the start of the line &lt;code&gt;(defun my-test2()&lt;/code&gt;..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-04T16:59:13.590" Title="Emacs lisp forward-sexp: Scan error: &quot;Containing expression ends prematurely&quot;" Tags="|navigation|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7960" PostTypeId="1" AcceptedAnswerId="7961" CreationDate="2015-02-04T09:05:26.027" Score="0" ViewCount="97" Body="&lt;p&gt;Is there a built-in variable which gives the last inserted character of a buffer (inserted by self-insert-command)?&#xA;Note that the cursor is not necessarily at the place of the last insertion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is not such a variable, any other solution for defining a variable which determines this character would be helpful. &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-02-06T15:39:36.320" LastActivityDate="2015-02-06T15:39:36.320" Title="How to define a variable which gives the last inserted character of the current buffer?" Tags="|buffers|insert|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7961" PostTypeId="2" ParentId="7960" CreationDate="2015-02-04T10:14:56.180" Score="2" Body="&lt;p&gt;Here's a solution implementing what I've suggested in my earlier comment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-last-inserted-character nil&#xA;  &quot;Last character inserted, buffer-local.&quot;)&#xA;(make-variable-buffer-local 'my-last-inserted-character)&#xA;&#xA;(defun my-update-last-inserted-character ()&#xA;  (setq my-last-inserted-character (concat (this-command-keys))))&#xA;&#xA;(add-hook 'post-self-insert-hook 'my-update-last-inserted-character)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would be better to wrap it up in a minor mode before anyone gets the idea to package this.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-04T10:14:56.180" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7962" PostTypeId="1" AcceptedAnswerId="7966" CreationDate="2015-02-04T11:03:04.097" Score="1" ViewCount="135" Body="&lt;p&gt;By default, my Emacs opens &lt;code&gt;config.php&lt;/code&gt; in &lt;code&gt;conf-mode&lt;/code&gt;. It looks like &lt;code&gt;conf-mode&lt;/code&gt; uses a set of regular expressions to match the filename, but I can't figure out how to make it open in &lt;code&gt;php-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea?&lt;/p&gt;&#xA;" OwnerUserId="165" LastEditorUserId="14920" LastEditDate="2018-09-08T21:55:43.533" LastActivityDate="2018-09-08T21:55:43.533" Title="How do I stop emacs open certain files in conf-mode?" Tags="|php-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="7963" PostTypeId="2" ParentId="7913" CreationDate="2015-02-04T11:05:41.437" Score="1" Body="&lt;p&gt;Although you have in mind a list of file types you want to search notice that the usual argument to &lt;code&gt;find&lt;/code&gt; which selects files is &lt;code&gt;-name&lt;/code&gt; which takes a globbing pattern. So something like &lt;code&gt;-name *.ns.*&lt;/code&gt; should match all the Javascript files in your project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Helm&lt;/em&gt; and it's &lt;em&gt;ag&lt;/em&gt; integration probably have something similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These commands record history. Use &lt;kbd&gt;C-p&lt;/kbd&gt; or the up arrow to bring back previous &lt;code&gt;grep-find&lt;/code&gt; searches. You can use &lt;kbd&gt;C-r .ns.&lt;/kbd&gt; to recall the last search you did across Javascript files, then simply edit the search pattern.&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-02-04T11:05:41.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7964" PostTypeId="1" CreationDate="2015-02-04T11:52:59.000" Score="5" ViewCount="1160" Body="&lt;p&gt;I have a newb question regarding the use of &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;Helm&lt;/a&gt; in the context of &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;helm-projectile-ag&lt;/code&gt; to grep for strings in a large code base. The performance is excellent, but I'm needing to refine search results further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, I'd get something along these lines, where I'm interested in the &lt;code&gt;Core&lt;/code&gt; bits, but want to ignore hits in unrelated files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unrelated1/some_file.cpp: void getHash();&#xA;Core/include/hash.h: void getHash()&#xA;Core/src/bla.cpp: return getHash();&#xA;Core/src/again.cpp: a = getHash(b) + getHash(c);&#xA;Unrelated2/some_file.cpp: void getHash();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I would like to do is to refine the results further by file path, so only strings under &lt;code&gt;Core&lt;/code&gt; are shown. Is there a way to pass the buffer from &lt;code&gt;helm-projectile-ag&lt;/code&gt; to another Helm refining buffer somehow, or to refine the results in the buffer &lt;code&gt;helm-projectile-ag&lt;/code&gt; uses?&lt;/p&gt;&#xA;" OwnerUserId="3959" LastEditorUserId="504" LastEditDate="2015-02-04T20:26:16.830" LastActivityDate="2015-02-04T20:26:16.830" Title="helm-projectile-ag : How can I refine the grep results further?" Tags="|helm|projectile|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7965" PostTypeId="1" AcceptedAnswerId="7986" CreationDate="2015-02-04T13:17:46.800" Score="2" ViewCount="555" Body="&lt;p&gt;At work we have a limited storage quota on the email server so I have set up Dovecot on my laptop as an email archive that I also access using IMAP.  Besides archiving I also store all email from mailing lists on the local server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently I have been trying to rid myself of Thunderbird and use Emacs for all emailing and as part of that I have migrated my filter rules to &lt;code&gt;nnmail-split-fancy&lt;/code&gt; rules.  However, so far I have not been able to get &lt;code&gt;nnmail&lt;/code&gt; to successfully move email from my inbox (company IMAP) to my archive (local Dovecot IMAP), is this at all possible to do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My configuration looks something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list&#xA; 'gnus-secondary-select-methods&#xA; '(nnimap &quot;me@company.com&quot;&#xA;          ...))&#xA;(add-to-list&#xA; 'gnus-secondary-select-methods&#xA; '(nnimap &quot;me@company.com-archive&quot;&#xA;          ...))&#xA;&#xA;(setq&#xA; nnimap-split-methods 'nnmail-split-fancy&#xA; nnimap-split-download-body-default t&#xA; nnmail-split-fancy&#xA; '(|&#xA;   (: nnmail-split-fancy-with-parent)&#xA;   (list &quot;.*linux-users.*&quot;&#xA;         &quot;me@company.com-archive:Mailing Lists.Linux Users&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried appending &quot;nnimap+&quot; to the destination and various other combinations but every time an email matches the rule Gnus will simply create a folder called &lt;code&gt;me@company.com-archive:Mailing Lists.Linux Users&lt;/code&gt; on the company IMAP server and move the email there instead of going to my local server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My complete Gnus configuration, except for machine local settings, is available &lt;a href=&quot;https://raw.githubusercontent.com/dholm/dotemacs/master/.emacs.d/lisp/apps/gnus.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="457" LastActivityDate="2018-01-10T03:28:22.917" Title="Can Gnus nnimap split articles to other imap server?" Tags="|gnus|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7966" PostTypeId="2" ParentId="7962" CreationDate="2015-02-04T13:18:58.980" Score="2" Body="&lt;p&gt;You can add an entry specifically for &lt;code&gt;config.php&lt;/code&gt; into &lt;code&gt;auto-mode-alist&lt;/code&gt;, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist (cons (rx bos &quot;config.php&quot; eos) 'php-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Where &lt;code&gt;bos&lt;/code&gt; and &lt;code&gt;eos&lt;/code&gt; are shortcuts for &lt;code&gt;string-start&lt;/code&gt; and &lt;code&gt;string-end&lt;/code&gt;, abbreviated from Beginning/End Of String.)&lt;/p&gt;&#xA;" OwnerUserId="2612" LastActivityDate="2015-02-04T13:18:58.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7967" PostTypeId="2" ParentId="7959" CreationDate="2015-02-04T13:26:24.627" Score="4" Body="&lt;p&gt;You can hit &lt;code&gt;C-M-e&lt;/code&gt; twice then &lt;code&gt;C-M-a&lt;/code&gt; once to move to the beginning of the next &lt;code&gt;defun&lt;/code&gt;, from &lt;em&gt;anywhere&lt;/em&gt; in the current &lt;code&gt;defun&lt;/code&gt; (those key bindings navigate across whole &lt;code&gt;defun&lt;/code&gt;s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than that, you probably want to get into Paredit (or SmartParens), for editing s-expressions. (The &lt;code&gt;C-M-f&lt;/code&gt; of Paredit does not behave exactly the way you describe, but will skip the closing paren.) Read a short into and try to get the hang of Paredit; it will be immensely beneficial in the long run.&lt;/p&gt;&#xA;" OwnerUserId="2612" LastActivityDate="2015-02-04T13:26:24.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7968" PostTypeId="2" ParentId="7913" CreationDate="2015-02-04T15:18:05.087" Score="11" Body="&lt;p&gt;If you use &lt;code&gt;helm-ag&lt;/code&gt; command, you can specify option like &lt;code&gt;-G\.js$ search_pattern&lt;/code&gt;, or if you use &lt;code&gt;helm-do-ag&lt;/code&gt;, you can use &lt;code&gt;C-u&lt;/code&gt; prefix for specifying extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is screencast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/A9wsg.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for using &lt;code&gt;helm-ag&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5415" LastActivityDate="2015-02-04T15:18:05.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7969" PostTypeId="1" CreationDate="2015-02-04T15:42:18.913" Score="4" ViewCount="289" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get &lt;code&gt;yasnippet&lt;/code&gt; snippets to expand when placed immediately after punctuation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the snippet &lt;code&gt;SNIP&lt;/code&gt;.  It will expand if preceded by whitespace (eg, &lt;code&gt;here's a SNIP&lt;/code&gt; expands), but not when preceded immediately by an alphanumeric character (eg, &lt;code&gt;here's a superSNIP&lt;/code&gt; does not expand).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Snippets also expand after parentheses and braces, so these all expand:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;here's a (SNIP&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;here's a [SNIP&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;here's a {SNIP&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, snippets do not seem to expand after punctuation, so, eg, neither &lt;code&gt;here's a ;SNIP&lt;/code&gt; nor &lt;code&gt;here's a .SNIP&lt;/code&gt; will expand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine there's a good reason for this, but I'd like to know how to get snippets to fire after punctuation characters (or, more generally, non-alphanumeric characters).  Ideally, this could be mode-specific or buffer-local.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-04T15:42:18.913" Title="how to expand a yasnippet snippet after punctuation?" Tags="|yasnippet|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7970" PostTypeId="1" AcceptedAnswerId="7971" CreationDate="2015-02-04T16:13:16.300" Score="4" ViewCount="1308" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get &lt;code&gt;TeX-command-master&lt;/code&gt; (&lt;code&gt;C-c C-c&lt;/code&gt;) to default to &lt;code&gt;LaTeX&lt;/code&gt; rather than &lt;code&gt;View&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;TeX-command-master&lt;/code&gt; dispatches to various commands, such as &lt;code&gt;LaTeX&lt;/code&gt;, &lt;code&gt;BibTeX&lt;/code&gt;, &lt;code&gt;View&lt;/code&gt;, etc., almost none of which I use besides &lt;code&gt;LaTeX&lt;/code&gt; and &lt;code&gt;BibTeX&lt;/code&gt;.  In particular, I almost &lt;em&gt;never&lt;/em&gt; use &lt;code&gt;View&lt;/code&gt; via &lt;code&gt;TeX-command-master&lt;/code&gt; (using &lt;code&gt;TeX-view&lt;/code&gt; via &lt;code&gt;C-c C-v&lt;/code&gt; instead), and it's annoying that &lt;code&gt;TeX-command-master&lt;/code&gt; defaults to &lt;code&gt;View&lt;/code&gt; after running &lt;code&gt;LaTeX&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I'd like &lt;code&gt;TeX-command-master&lt;/code&gt; never to default to &lt;code&gt;View&lt;/code&gt;, but rather to &lt;code&gt;LaTeX&lt;/code&gt; so that I can recompile without breaking my flow.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one change the default?  It seems rather extreme to edit out the &lt;code&gt;View&lt;/code&gt; option from &lt;code&gt;TeX-command-list&lt;/code&gt;, and I'm not sure where else to look.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-04T16:34:13.273" Title="how to modify default command for TeX-command-master (ie, C-c C-c)?" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7971" PostTypeId="2" ParentId="7970" CreationDate="2015-02-04T16:34:13.273" Score="5" Body="&lt;p&gt;The variable controlling the default operation to do when AUCTeX assumes the output file is ready is &lt;code&gt;TeX-command-Show&lt;/code&gt;.  The default value is of course &lt;code&gt;&quot;View&quot;&lt;/code&gt;, but in your case you want to set it to &lt;code&gt;&quot;LaTeX&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-02-04T16:34:13.273" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7972" PostTypeId="2" ParentId="7959" CreationDate="2015-02-04T16:59:13.590" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;C-M-u&lt;/code&gt; (&lt;code&gt;backward-up-list&lt;/code&gt;) to move up a level of parentheses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, with point on the first &lt;code&gt;d&lt;/code&gt;, you could use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-M-u C-M-f C-M-f&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, if your instincts have you always hitting &lt;code&gt;C-M-f&lt;/code&gt; first, you can go forward until you get the scan error; then go up, then go forward again. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-02-04T16:59:13.590" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7973" PostTypeId="2" ParentId="7933" CreationDate="2015-02-04T17:16:13.230" Score="4" Body="&lt;p&gt;We can set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mm-sign-option 'guided)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and now we will be prompted with key selection menu before sending a message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Security.html&quot; rel=&quot;nofollow&quot;&gt;described&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;mm-sign-option -&#xA;      Option of creating signed parts. nil, use default signing keys; &lt;strong&gt;guided&lt;/strong&gt;, ask user to select signing keys from the menu.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We should be able to automate key selection based on e.g. &lt;em&gt;From:&lt;/em&gt; field with help of&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/DefaultEncrypt&quot; rel=&quot;nofollow&quot;&gt;Default Encryption&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;DefaultEncrypt aims for automatic insertion of an MML secure encryption tags into messages if public keys (either GnuPG public keys or S/MIME certificates) for all recipients are available. In addition, before a message is sent, the user is asked whether plaintext should really be sent unencryptedly when public keys for all recipients are available.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.gnus.org/manual/emacs-mime_11.html&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Keyfile&lt;/em&gt; field&lt;/a&gt; text auto-insertion&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;‘keyfile’ - File containing key and certificate for signer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but I have never been annoyed enough to do so.&lt;/p&gt;&#xA;" OwnerUserId="220" LastActivityDate="2015-02-04T17:16:13.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7974" PostTypeId="1" AcceptedAnswerId="9377" CreationDate="2015-02-04T18:39:14.710" Score="7" ViewCount="335" Body="&lt;p&gt;Is there a reason so few packages seem to use transaction queues (&lt;code&gt;tq-enqueue&lt;/code&gt; etc.) for communication with external processes? Most of the packages I have looked at seem to prefer the regular filter mechanism.&lt;/p&gt;&#xA;" OwnerUserId="5417" LastActivityDate="2015-02-19T00:16:34.023" Title="When to use transaction queues?" Tags="|elisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7975" PostTypeId="1" AcceptedAnswerId="8189" CreationDate="2015-02-04T19:06:23.643" Score="5" ViewCount="357" Body="&lt;p&gt;Is there a way to setup org-mode so that the expansion state of everything within a file is automatically saved when closing the file or quitting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/worg/org-faq.html&quot; rel=&quot;noreferrer&quot;&gt;Org-Mode FAQ&lt;/a&gt; says this is not possible, but maybe someone has a hand-rolled solution.&lt;/p&gt;&#xA;" OwnerUserId="5417" LastActivityDate="2023-11-30T19:36:13.897" Title="How to save expansion state of org-file?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7976" PostTypeId="2" ParentId="7957" CreationDate="2015-02-04T19:39:22.737" Score="0" Body="&lt;p&gt;The function &lt;code&gt;posn-at-point&lt;/code&gt; is incompatible when certain types of overlays are present.  Even removing the overlays prior to redisplay is insufficient to work around this issue, because Emacs uses what was on screen before entering the command loop.  As suggested by @Malabarba in a comment above, it would be appropriate to submit a bug report and/or feature request to the Emacs team in relation to this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following solution uses &lt;code&gt;vertical-motion&lt;/code&gt;, which is not dependent upon &lt;code&gt;point&lt;/code&gt; being visible.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defsubst vcol ()&#xA;  (- (current-column) (save-excursion (vertical-motion 0) (current-column))))&#xA;&#xA;(setq temporary-goal-column (cons (vcol) (window-hscroll)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-04-26T19:36:28.847" LastActivityDate="2015-04-26T19:36:28.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7977" PostTypeId="1" AcceptedAnswerId="7979" CreationDate="2015-02-04T19:50:12.013" Score="2" ViewCount="762" Body="&lt;p&gt;I am trying to write a global minor mode.  The following illustrates my problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode global-foo-mode :global t :lighter &quot; FOO&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x global-foo-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The message displayed is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Global-Foo mode disabled&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The current buffer does &lt;em&gt;not&lt;/em&gt; display the FOO lighter in its mode line, but every other buffer does.  Subsequent invocations of &lt;code&gt;M-x global-foo-mode&lt;/code&gt; in various buffers seem to enable and disable the mode on the current buffer, but not globally as I would expect.  Can anyone help me understand what I'm doing wrong here?&lt;/p&gt;&#xA;" OwnerUserId="3853" LastActivityDate="2015-02-04T20:00:38.303" Title="Global minor mode not global?" Tags="|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7978" PostTypeId="1" AcceptedAnswerId="7984" CreationDate="2015-02-04T19:55:50.917" Score="7" ViewCount="642" Body="&lt;p&gt;When I do &lt;code&gt;C-h v package-alist&lt;/code&gt;, I see something like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((PACKAGE-NAME1 [cl-struct-package-desc&#xA;                PACKAGE-NAME1&#xA;                (VERSION1)&#xA;                &quot;DESCRIPTION1&quot;&#xA;                (DEPENDENCIES-ALIST1)&#xA;                nil&#xA;                nil&#xA;                &quot;LOCAL-INST-PATH1&quot;&#xA;                (URL-ALIST1)&#xA;                nil])&#xA;&#xA; (PACKAGE-NAME2 [cl-struct-package-desc&#xA;                PACKAGE-NAME2&#xA;                (VERSION2)&#xA;                &quot;DESCRIPTION2&quot;&#xA;                (DEPENDENCIES-ALIST2)&#xA;                nil&#xA;                nil&#xA;                &quot;LOCAL-INST-PATH2&quot;&#xA;                (URL-ALIST2)&#xA;                nil])&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I see the &lt;strong&gt;full&lt;/strong&gt; alist instead of its truncated form with the ellipsis characters &lt;code&gt;...&lt;/code&gt; at the end?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2022-06-26T22:38:54.497" LastActivityDate="2022-06-26T22:38:54.497" Title="How can I view the full `package-alist` value (without the truncation characters &quot;...&quot;)?" Tags="|scratch-buffer|sexp|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7979" PostTypeId="2" ParentId="7977" CreationDate="2015-02-04T20:00:38.303" Score="8" Body="&lt;p&gt;The problem is that you are leaving out the required argument DOC when you call &lt;code&gt;define-minor-mode&lt;/code&gt;. (Or more accurately, you are passing &lt;code&gt;:global&lt;/code&gt; as the DOC parameter)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either provide a doc string or nil as the second argument: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode global-foo-mode nil :global t :lighter &quot; FOO&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;define-minor-mode&lt;/code&gt; is a macro. You can see how it is expanded. Put point just after the closing paren and call &lt;code&gt;M-x pp-macroexpand-last-sexp&lt;/code&gt;. Try this with and without the &lt;code&gt;nil&lt;/code&gt; in there, and you'll see that in your case &lt;code&gt;:global&lt;/code&gt; is being used where the docstring should be. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-02-04T20:00:38.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7980" PostTypeId="1" AcceptedAnswerId="7995" CreationDate="2015-02-04T20:14:42.143" Score="1" ViewCount="1277" Body="&lt;p&gt;I very much dislike the font faces I get for some modes.  I know that I can customize them, but in some cases (e.g. &lt;code&gt;org-mode&lt;/code&gt;) this would require customizing dozens of faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, what I really want to determine is, for a given character, &lt;em&gt;where&lt;/em&gt; is its face, &lt;strong&gt;&lt;em&gt;as it appears on the screen&lt;/em&gt;&lt;/strong&gt;, defined?  I'm hoping that this would lead me to a more efficient and maintainable way to fix the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of an approach that does &lt;em&gt;not&lt;/em&gt; get me what I'm after: determine the name of a character's face (e.g. through &lt;code&gt;M-x describe-char&lt;/code&gt;), and then invoke &lt;code&gt;describe-face&lt;/code&gt; to see where the face is defined (supposedly).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this I often arrive at definitions that are entirely at odds with what I see on the screen.  This is why the question title emphasizes &lt;em&gt;as it appears on the screen&lt;/em&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I invoke &lt;code&gt;M-x describe-char&lt;/code&gt; when point is at an oversized &lt;a href=&quot;http://www.colorhexa.com/cb4b16.png&quot; rel=&quot;nofollow&quot;&gt;orange&lt;/a&gt; character in my current buffer, the output I get tells me that its face is &lt;code&gt;org-level-1&lt;/code&gt;.  (FWIW, I get exactly the same result if I use &lt;code&gt;M-: (get-char-property (point) 'face)&lt;/code&gt; or &lt;code&gt;C-u C-x =&lt;/code&gt; instead.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the output of &lt;code&gt;M-x describe-face&lt;/code&gt; for this face (&lt;code&gt;org-level-1&lt;/code&gt;) includes the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Defined in `org-faces.el'.&#xA;&#xA;           Family: Monaco&#xA;          Foundry: unspecified&#xA;            Width: unspecified&#xA;           Height: 1.3&#xA;           Weight: unspecified&#xA;            Slant: unspecified&#xA;       Foreground: #cb4b16&#xA;DistantForeground: unspecified&#xA;       Background: unspecified&#xA;        Underline: unspecified&#xA;         Overline: unspecified&#xA;   Strike-through: unspecified&#xA;              Box: unspecified&#xA;          Inverse: unspecified&#xA;          Stipple: unspecified&#xA;             Font: unspecified&#xA;          Fontset: unspecified&#xA;          Inherit: variable-pitch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This face specification, as far as it goes, pretty much matches what I see on the screen (though I don't know what &lt;code&gt;variable-pitch&lt;/code&gt; means when applied to a fixed-width font like Monaco).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I follow the reference to &lt;code&gt;org-faces.el&lt;/code&gt;, I find this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface org-level-1 ;; originally copied from font-lock-function-name-face&#xA;  (org-compatible-face 'outline-1&#xA;    '((((class color) (min-colors 88) (background light)) (:foreground &quot;Blue1&quot;))&#xA;      (((class color) (min-colors 88) (background dark)) (:foreground &quot;LightSkyBlue&quot;))&#xA;      (((class color) (min-colors 16) (background light)) (:foreground &quot;Blue&quot;))&#xA;      (((class color) (min-colors 16) (background dark)) (:foreground &quot;LightSkyBlue&quot;))&#xA;      (((class color) (min-colors 8)) (:foreground &quot;blue&quot; :bold t))&#xA;      (t (:bold t))))&#xA;  &quot;Face used for level 1 headlines.&quot;&#xA;  :group 'org-faces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this definition bears little relation to the specification listed by &lt;code&gt;describe-face&lt;/code&gt;.  In particular, all the colors it mentions are shades of blue, nothing remotely like the color &lt;a href=&quot;http://www.colorhexa.com/cb4b16.png&quot; rel=&quot;nofollow&quot;&gt;#cb4b16&lt;/a&gt; reported by &lt;code&gt;describe-face&lt;/code&gt;.  In addition, it says nothing about any of the other spec items (Family, Height, Inherit) given explicit values in the output of &lt;code&gt;describe-face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why I emphasize that I'm not looking for the location of some &quot;theoretical&quot;/&quot;nominal&quot; definition of a named face, but the actual definition of the face that I'm seeing on the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Digging deeper into the results described above, if I evaluate the following sub-expression in the definition of &lt;code&gt;org-level-1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-compatible-face 'outline-1&#xA;    '((((class color) (min-colors 88) (background light)) (:foreground &quot;Blue1&quot;))&#xA;      (((class color) (min-colors 88) (background dark)) (:foreground &quot;LightSkyBlue&quot;))&#xA;      (((class color) (min-colors 16) (background light)) (:foreground &quot;Blue&quot;))&#xA;      (((class color) (min-colors 16) (background dark)) (:foreground &quot;LightSkyBlue&quot;))&#xA;      (((class color) (min-colors 8)) (:foreground &quot;blue&quot; :bold t))&#xA;      (t (:bold t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((t :inherit outline-1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I repeat the same wild-goose-chase with &lt;code&gt;outline-1&lt;/code&gt; in place of &lt;code&gt;org-level-1&lt;/code&gt;.  I find that it is defined in &lt;code&gt;outline.el&lt;/code&gt;, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface outline-1&#xA;  '((t :inherit font-lock-function-name-face))&#xA;  &quot;Level 1.&quot;&#xA;  :group 'outlines)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, one more time, now with &lt;code&gt;font-lock-function-name-face&lt;/code&gt;, defined in &lt;code&gt;font-lock.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface font-lock-function-name-face&#xA;  '((((class color) (min-colors 88) (background light)) :foreground &quot;Blue1&quot;)&#xA;    (((class color) (min-colors 88) (background dark))  :foreground &quot;LightSkyBlue&quot;)&#xA;    (((class color) (min-colors 16) (background light)) :foreground &quot;Blue&quot;)&#xA;    (((class color) (min-colors 16) (background dark))  :foreground &quot;LightSkyBlue&quot;)&#xA;    (((class color) (min-colors 8)) :foreground &quot;blue&quot; :weight bold)&#xA;    (t :inverse-video t :weight bold))&#xA;  &quot;Font Lock mode face used to highlight function names.&quot;&#xA;  :group 'font-lock-faces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to be the end of this tedious line, but the final definition is no closer to what I see on the screen.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2015-02-05T15:18:03.170" LastActivityDate="2015-02-05T15:56:21.300" Title="How to determine where a face (as it appears on the screen) is defined?" Tags="|faces|fonts|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7981" PostTypeId="2" ParentId="7980" CreationDate="2015-02-04T20:21:05.763" Score="2" Body="&lt;p&gt;I think, it can be done.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun find-face-at-point (face)&#xA;  &quot;Find the definition of FACE.&#xA;&#xA;FACE defaults to the face used on the character at point.&quot;&#xA;  (interactive (list (get-char-property (point) 'face)))&#xA;  (find-function-do-it face 'defface 'switch-to-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In real life some argument checking should be added to this function.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-02-04T20:21:05.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7982" PostTypeId="1" AcceptedAnswerId="61643" CreationDate="2015-02-04T20:22:33.780" Score="5" ViewCount="995" Body="&lt;p&gt;Emacs's faces let you set &lt;code&gt;:distant-foreground&lt;/code&gt;, which according to the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html&quot; rel=&quot;nofollow&quot;&gt;docs&lt;/a&gt;, &quot;is like &lt;code&gt;:foreground&lt;/code&gt; but the color is only used as a foreground when the background color is near to the foreground that would have been used.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure how &quot;near&quot; is computed, but it doesn't seem to be good enough. I would like to use it with my &lt;code&gt;region&lt;/code&gt; face, so that the text is in the same face it's normally in, except when it's unreadable. My &lt;code&gt;region&lt;/code&gt; is currently set to &lt;code&gt;:background &quot;lightgoldenrod2&quot;&lt;/code&gt;. Selecting some white text with this makes it unreadable. When I set &lt;code&gt;:distant-foreground &quot;black&quot;&lt;/code&gt;, it doesn't change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is &quot;near&quot; calculated here? How can I adjust this calculation to be a more reasonable contrast calculation?&lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="105" LastEditDate="2015-02-05T04:12:25.577" LastActivityDate="2020-11-09T01:07:49.660" Title="Getting `:distant-foreground` face attribute to work" Tags="|faces|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7983" PostTypeId="2" ParentId="7978" CreationDate="2015-02-04T20:40:53.897" Score="6" Body="&lt;p&gt;Set &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html&quot;&gt;&lt;code&gt;eval-expression-print-length&lt;/code&gt; and &lt;code&gt;eval-expression-print-level&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-02-04T20:40:53.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7984" PostTypeId="2" ParentId="7978" CreationDate="2015-02-04T20:40:57.537" Score="11" Body="&lt;p&gt;As mentioned in the comments you can tweak &lt;em&gt;eval-expression-print-*&lt;/em&gt; or expand by hitting &lt;em&gt;RET&lt;/em&gt; or &lt;em&gt;mouse-2&lt;/em&gt; on the ellipses (which calls &lt;em&gt;last-sexp-toggle-display&lt;/em&gt;). However probably the most useful for general messing around in the &lt;em&gt;*scratch*&lt;/em&gt; buffer is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(pp package-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will format the output in a more readable way.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-02-04T20:40:57.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7985" PostTypeId="1" CreationDate="2015-02-04T22:05:59.503" Score="1" ViewCount="125" Body="&lt;p&gt;I'm asking here as I can't find it anywhere on the net: I was about to learn how Emacs is actually packaged for Fedora 21 (btw, thanks a lot to the maintainers) to do the same with the latest release, but if that's already done there's not much purpose on reinventing the wheel.&lt;/p&gt;&#xA;" OwnerUserId="5419" LastEditorUserId="105" LastEditDate="2015-08-12T14:34:36.907" LastActivityDate="2015-08-12T14:34:36.907" Title="Looking for a Fedora 21 repository for current GNU Emacs development code" Tags="|emacs-development|" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7986" PostTypeId="2" ParentId="7965" CreationDate="2015-02-04T23:06:21.873" Score="2" Body="&lt;p&gt;Gnus splitting does not work across servers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend instead to treat your company IMAP server as a mail source, as described in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Mail-Source-Specifiers.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/gnus/Mail-Source-Specifiers.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can still keep using it in your &lt;code&gt;gnus-secondary-select-methods&lt;/code&gt; as far as I know.&lt;/p&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-02-04T23:06:21.873" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7987" PostTypeId="2" ParentId="7980" CreationDate="2015-02-05T01:59:44.750" Score="3" Body="&lt;p&gt;Do you really care &lt;em&gt;where&lt;/em&gt; the face was (last) defined? (Why?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm guessing that what you really want to know is &lt;em&gt;what&lt;/em&gt; the current face definition is - each of the attributes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that, use &lt;code&gt;C-u C-x =&lt;/code&gt; in front of a character that has the face you want to know about. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or just use &lt;code&gt;list-faces-display&lt;/code&gt; and compare appearances (if the appearance is not too common).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also the case often that once you know the name of the face you can find out where it is defined, if you really are interested in that. You can use &lt;code&gt;M-x describe-face&lt;/code&gt; to find out where it was defined originally, at least.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-05T01:59:44.750" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7988" PostTypeId="2" ParentId="7982" CreationDate="2015-02-05T03:54:49.523" Score="1" Body="&lt;p&gt;It works for me, but yes, you need to pick a color that is &quot;nearer&quot; than that for it to take effect. From &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set face &lt;code&gt;default&lt;/code&gt; to have a &lt;code&gt;white&lt;/code&gt; foreground and a background of &lt;code&gt;#000000004&lt;/code&gt;. And I set face &lt;code&gt;region&lt;/code&gt; to have a distant foreground of &lt;code&gt;black&lt;/code&gt; and a background of &lt;code&gt;#ffffffff3&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Selecting white text shows the region with black text (foreground). Selecting another color of text (e.g. green foreground) shows the region with that same color (green) as foreground.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try closer colors to see if it at least works in your Emacs version. I'm on MS Windows and using a dev version of Emacs 25 from last October (2014).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And while you're at it, you might consider filing an Emacs bug (&lt;code&gt;M-x report-emacs-bug&lt;/code&gt;) for (at least) insufficient doc. If there isn't already (and I couldn't find any in the doc or in &lt;code&gt;NEWS&lt;/code&gt;), there should perhaps be a &lt;strong&gt;user option&lt;/strong&gt;, to let you control how close &quot;&lt;em&gt;near&lt;/em&gt;&quot; needs to be for &lt;code&gt;:distant-foreground&lt;/code&gt; to kick in.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-05T03:54:49.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7989" PostTypeId="2" ParentId="3985" CreationDate="2015-02-05T05:02:02.837" Score="7" Body="&lt;p&gt;I came up with this recently to solve the problem of export cluttering the current directory, although it is not the solution asked for, I think it belongs here, plus it fixes it for any files org-export generates.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar org-export-output-directory-prefix &quot;export_&quot; &quot;prefix of directory used for org-mode export&quot;)&#xA;&#xA;(defadvice org-export-output-file-name (before org-add-export-dir activate)&#xA;  &quot;Modifies org-export to place exported files in a different directory&quot;&#xA;  (when (not pub-dir)&#xA;      (setq pub-dir (concat org-export-output-directory-prefix (substring extension 1)))&#xA;      (when (not (file-directory-p pub-dir))&#xA;       (make-directory pub-dir))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;change org-export-output-directory-prefix to something of your liking.  Let me know if it works with beamer.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-02-05T05:02:02.837" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7991" PostTypeId="1" CreationDate="2015-02-05T07:57:59.053" Score="2" ViewCount="854" Body="&lt;p&gt;I use &lt;code&gt;(setq gdb-many-windows t)&lt;/code&gt; and &lt;code&gt;(setq gdb-show-main t)&lt;/code&gt; configurations in my &lt;code&gt;init.el&lt;/code&gt;, so after executing &lt;code&gt;M-x gdb&lt;/code&gt;, there will be six windows in the frame, after typing &lt;code&gt;q&lt;/code&gt; in the main gdb cli window to finish debugging, how can I quit/delete all the gdb related windows/buffers (including the current gdb CLI, locals, breakpoints, stack frames...) and just leave the source code buffer open at the same time.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2015-04-03T09:47:52.657" LastActivityDate="2015-08-01T11:48:52.003" Title="How can I delete all the gdb related windows/buffers after `q` in gdb CLI window" Tags="|buffers|debugging|gud|kill-buffer|gdb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7992" PostTypeId="1" CreationDate="2015-02-05T11:50:53.203" Score="10" ViewCount="2639" Body="&lt;p&gt;In Arabic as with some other languages there is what is called diacritics to enhance pronunciation. There is no convention on how many diacritics should be written for a single word. Some use the minimum (which I prefer) just enough to disambiguate pronunciation, whereas some use them superfluously or just for aesthetic calligraphic purposes. Thus, there is a wide variation on what and how many diacritics are associated with one word. When I do &lt;code&gt;isearch-forward/backward&lt;/code&gt; by pressing &lt;code&gt;C-s/r&lt;/code&gt;, problem arises when I type it in the search mini-buffer without diacritics it will not match the same word in the text if it had diacritics, making the task of looking for this word with its potential diacritics ever unsatisfactory.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make search/regexp search unaware of diacritics? I hope there would be an answer that can be extended to include &lt;code&gt;regexp C-M-s/r&lt;/code&gt; and &lt;code&gt;grep&lt;/code&gt; search that I use quite often in helm-projectile to look for a word in a multi-file latex projects.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;It would be nice to see that Emacs in all of its search functions doing the stripping off step on the text (from accents/diacritics/you name it) before matching step as a default behavior that might be turned off by a prefix on demand no matter what language is at hand. Typically, when I search for something I don't expect from the best editor (Emacs) to fail in this errand just because of some diacritics or accents that are rarely if ever needed to accomplish mundane text chores.    &lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-02-09T10:11:01.187" LastActivityDate="2015-02-09T10:11:01.187" Title="How to search an Arabic word in text without its diacritics/accents?" Tags="|search|regular-expressions|isearch|rgrep|right-to-left|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7993" PostTypeId="2" ParentId="7697" CreationDate="2015-02-05T14:26:15.340" Score="3" Body="&lt;h1&gt;Yet another solution for org-clock in osx&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;A small box in status bar. It turns red when you didn't clock in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://github.com/koddo/org-clock-statusbar-app/blob/master/img/intro.png?raw=true&quot; alt=&quot;illustration for red box, see github page&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/koddo/org-clock-statusbar-app&quot; rel=&quot;nofollow&quot;&gt;https://github.com/koddo/org-clock-statusbar-app&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5422" LastActivityDate="2015-02-05T14:26:15.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7994" PostTypeId="2" ParentId="7936" CreationDate="2015-02-05T15:50:12.703" Score="4" Body="&lt;p&gt;So, after asking this question in &lt;a href=&quot;https://groups.google.com/forum/#!topic/gnu.emacs.help/GoW5Du53xrU&quot; rel=&quot;nofollow&quot;&gt;gnu.emacs.help&lt;/a&gt;, Tassilo Horn pointed out that the &lt;code&gt;preview-gs-command&lt;/code&gt; variable was nil. gs was in my PATH (and my PATH is loaded correctly), but that variable wasn't populated for some reason. When I add &lt;code&gt;(setq preview-gs-command &quot;/usr/local/bin/gs&quot;)&lt;/code&gt; to my init.el, everything works fine.&lt;/p&gt;&#xA;" OwnerUserId="5411" LastActivityDate="2015-02-05T15:50:12.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7995" PostTypeId="2" ParentId="7980" CreationDate="2015-02-05T15:56:21.300" Score="3" Body="&lt;p&gt;Technically, the actual properties of a face is determined by a function called &lt;code&gt;face-spec-recalc&lt;/code&gt;. It is based in the values of the symbol properties &lt;code&gt;theme-face&lt;/code&gt; and &lt;code&gt;face-override-spec&lt;/code&gt;. The former contains a list of all themes that you have applied that contribute to the face. (I'm not 100% what the latter does, but I think it contains user overrides.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function updates the actual face information of a frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my project &lt;a href=&quot;https://github.com/Lindydancer/e2ansi&quot; rel=&quot;nofollow&quot;&gt;e2ansi&lt;/a&gt; (a package that renders font-lock buffers using ANSI sequences that provide syntax highlighting support for &lt;code&gt;less&lt;/code&gt;), I reversed-engineered this so I can play the &quot;what if&quot; game (e.g. assuming that I have 16 colors and a dark background, what attributes would a face be given).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that you could modify it so that it also would record the theme that provided each attributes.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-02-05T15:56:21.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7996" PostTypeId="1" AcceptedAnswerId="8000" CreationDate="2015-02-05T16:29:33.803" Score="34" ViewCount="13561" Body="&lt;p&gt;I want to export my &lt;code&gt;org&lt;/code&gt; document as a PDF, but its margins are way too big. I would like to re-size them as I wish. I am using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_CLASS: report&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not know if there is a way. Any help?&lt;/p&gt;&#xA;" OwnerUserId="3941" LastEditorUserId="5398" LastEditDate="2015-02-05T16:33:21.030" LastActivityDate="2018-08-04T12:44:45.933" Title="Is there a way to resize margins when exporting PDF in org-mode?" Tags="|org-mode|latex|org-export|pdf|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7997" PostTypeId="2" ParentId="6045" CreationDate="2015-02-05T16:31:38.437" Score="4" Body="&lt;p&gt;Here's a simple function to remove the containing macro at point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun TeX-remove-macro ()&#xA;  &quot;Remove current macro and return `t'.  If no macro at point,&#xA;return `nil'.&quot;&#xA;  (interactive)&#xA;  (when (TeX-current-macro)&#xA;    (let ((bounds (TeX-find-macro-boundaries))&#xA;          (brace  (save-excursion&#xA;                    (goto-char (1- (TeX-find-macro-end)))&#xA;                    (TeX-find-opening-brace))))&#xA;      (delete-region (1- (cdr bounds)) (cdr bounds))&#xA;      (delete-region (car bounds) (1+ brace)))&#xA;    t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence, with &lt;code&gt;*&lt;/code&gt; as point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\footnote{Here's a * footnote} &#xA;  =&amp;gt; Here's a footnote&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Given the above function, it's a one-liner to remove all the macros at point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun TeX-remove-all-macros ()&#xA;  &quot;Remove all containing macros for text at point.&quot;&#xA;  (interactive)&#xA;  (while (TeX-remove-macro)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence, again with &lt;code&gt;*&lt;/code&gt; as point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\footnote{Here's a \textbf{footnote with \emph{emphasized * text}}} &#xA;  =&amp;gt; Here's a footnote with emphasized text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-02-05T16:41:14.083" LastActivityDate="2015-02-05T16:41:14.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7998" PostTypeId="1" CreationDate="2015-02-05T17:23:31.197" Score="13" ViewCount="993" Body="&lt;p&gt;Emacs generally comments regions well, but sometimes I wish I could change the string it prepends to lines.  For example, in LaTeX, I would like to have a commented region only use a single &lt;code&gt;%&lt;/code&gt; per line instead of two, i.e.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% First line of commented region&#xA;% Second line of commented region&#xA;% Third line of commented region&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% First line of commented region&#xA;%% Second line of commented region&#xA;%% Third line of commented region&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume one could just set some variable for &lt;code&gt;latex-mode&lt;/code&gt; in &lt;code&gt;.emacs.el&lt;/code&gt;, but I could not find the variable name.  Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="5423" LastEditorUserId="105" LastEditDate="2015-04-06T04:04:28.220" LastActivityDate="2015-04-06T04:04:28.220" Title="How to change comment string used by comment-region?" Tags="|latex|comment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7999" PostTypeId="2" ParentId="7998" CreationDate="2015-02-05T17:27:54.690" Score="12" Body="&lt;p&gt;&lt;code&gt;comment-add&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;comment-add is a variable defined in &lt;code&gt;newcomment.el&lt;/code&gt;. Its value is 1&#xA;  Local in buffer .emacs; global value is 0&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: How many more comment chars should be inserted by&#xA;  &lt;code&gt;comment-region&lt;/code&gt;. This determines the default value of the numeric&#xA;  argument of &lt;code&gt;comment-region&lt;/code&gt;. The &lt;code&gt;plain&lt;/code&gt; comment style doubles this&#xA;  value.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This should generally stay 0, except for a few modes like Lisp where&#xA;  it is 1 so that regions are commented with two or three semi-colons.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'latex-mode-hook (lambda () (setq-local comment-add 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to get the behavior you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this variable with &lt;code&gt;helm-apropos&lt;/code&gt;. You can also search with the built-in command &lt;code&gt;M-x apropos-variable&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-05T17:27:54.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8000" PostTypeId="2" ParentId="7996" CreationDate="2015-02-05T17:34:24.273" Score="56" Body="&lt;p&gt;The simplest way to tweak the formatting of a LaTeX export is by using the &lt;code&gt;geometry&lt;/code&gt; package. Try something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage[margin=0.5in]{geometry}&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2018-08-04T12:44:45.933" LastActivityDate="2018-08-04T12:44:45.933" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8001" PostTypeId="2" ParentId="7992" CreationDate="2015-02-05T17:52:55.097" Score="5" Body="&lt;p&gt;Here's a rough start, based on the list of combining characters in &lt;a href=&quot;https://stackoverflow.com/a/25563250/113848&quot;&gt;this answer&lt;/a&gt; (and then extended).  (Marking this as community wiki — please edit and improve this!)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst arabic-diacritics '(#x064b #x064c #x064d #x064e #x064f #x0650 #x0651 #x0652 #x0653 #x0654 #x0655 #x0670)&#xA;  &quot;Unicode codepoints for Arabic combining characters.&quot;)&#xA;(defconst arabic-diacritics-regexp (regexp-opt (mapcar #'string arabic-diacritics)))&#xA;&#xA;(defconst arabic-equivalents&#xA;  '(&#xA;    ;; &quot;alef&quot; is equivalent to &quot;alef with hamza above&quot; etc&#xA;    (#x0627 #x0623 #x0625 #x0622)))&#xA;&#xA;;; (require 'cl-lib)    &#xA;;; (defun arabic-strip-diacritics (string)&#xA;;;   (cl-reduce (lambda (s c) (remove c s)) arabic-diacritics :initial-value string))&#xA;&#xA;(defun arabic-search-without-diacritics (string)&#xA;  (interactive (list (read-string &quot;Search for: &quot; nil nil nil t)))&#xA;  (let ((regexp&#xA;         (apply #'concat&#xA;                (mapcar (lambda (c)&#xA;                          (let ((equivalents (assq c arabic-equivalents)))&#xA;                            (concat&#xA;                             (if equivalents&#xA;                                 (regexp-opt (mapcar #'string equivalents))&#xA;                               (regexp-quote (string c)))&#xA;                             arabic-diacritics-regexp &quot;*&quot;)))&#xA;                        string))))&#xA;    (search-forward-regexp regexp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if a buffer contains &quot;الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ&quot;, and I evaluate &lt;code&gt;(arabic-search-without-diacritics &quot;الحمد لله رب العالمين&quot;)&lt;/code&gt;, it finds the text.  It also works interactively, as &lt;code&gt;M-x arabic-search-without-diacritics&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternative approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a full code example that demonstrates how diacritical and other nonspacing marks (&lt;code&gt;Mn&lt;/code&gt; property) can be removed from normalized strings in regexp matches.  It works with the examples given and IMO is the right approach.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-marks (string)&#xA;  (concat (loop for c across string&#xA;                when (not (eq 'Mn (get-char-code-property c 'general-category)))&#xA;                collect c)))&#xA;&#xA;(let* ((original1 &quot;your Arabic string here&quot;)&#xA;      (normalized1 (ucs-normalize-NFKD-string original1))&#xA;      (original2 &quot;your other Arabic string here&quot;)&#xA;      (normalized2 (ucs-normalize-NFKD-string original2)))&#xA;  (equal&#xA;   (replace-regexp-in-string &quot;.&quot; 'kill-marks normalized1)&#xA;   (replace-regexp-in-string &quot;.&quot; 'kill-marks normalized2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-06T14:19:06.670" CommentCount="16" CommunityOwnedDate="2015-02-05T17:52:55.097" ContentLicense="CC BY-SA 3.0" />
  <row Id="8002" PostTypeId="2" ParentId="7946" CreationDate="2015-02-05T17:59:09.147" Score="0" Body="&lt;p&gt;I use Emacs built-in &lt;code&gt;compose-mail&lt;/code&gt; (C-x m) to send email and encountered similar issue on encoding. I don't sure if this would help you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mm-coding-system-priorities '(utf-8))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="515" LastActivityDate="2015-02-05T17:59:09.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8003" PostTypeId="1" CreationDate="2015-02-05T18:02:30.793" Score="7" ViewCount="489" Body="&lt;p&gt;I am using «sort-lines» to sort &lt;em&gt;include&lt;/em&gt;s in C/C++ files before saving. The problem that arises is that a headers with &lt;code&gt;&quot;&lt;/code&gt; symbols sorted higher than ones with &lt;code&gt;&amp;lt;&lt;/code&gt; symbols. But I want the reverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I change the order so, that the &lt;code&gt;&amp;lt;&lt;/code&gt; character would have higher precedence than the &lt;code&gt;&quot;&lt;/code&gt; symbol?&lt;/p&gt;&#xA;" OwnerUserId="2671" LastActivityDate="2019-05-15T07:18:00.120" Title="Change order of symbols for «sort-lines»" Tags="|sorting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8004" PostTypeId="2" ParentId="8003" CreationDate="2015-02-05T18:32:15.127" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;sort-regexp-fields&lt;/code&gt;. Mark the region and do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x sort-regexp-fields&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;#include .\(.*\)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;\1&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regular expression group will capture everything after &lt;code&gt;#include &quot;&lt;/code&gt; or &lt;code&gt;#include &amp;lt;&lt;/code&gt; and sort on that instead of the whole line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, I believe the reason for the sorting you're seeing is because &lt;code&gt;&quot;&lt;/code&gt; is higher than &lt;code&gt;&amp;lt;&lt;/code&gt; in ASCII.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-05T18:32:15.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8005" PostTypeId="2" ParentId="7982" CreationDate="2015-02-05T19:37:54.930" Score="4" Body="&lt;p&gt;I found part of the answer by reading the source code. In &lt;code&gt;xfaces.c&lt;/code&gt;, there is (in &lt;code&gt;load_face_colors&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  dfg = attrs[LFACE_DISTANT_FOREGROUND_INDEX];&#xA;  if (!NILP (dfg) &amp;amp;&amp;amp; !UNSPECIFIEDP (dfg)&#xA;      &amp;amp;&amp;amp; color_distance (&amp;amp;xbg, &amp;amp;xfg) &amp;lt; NEAR_SAME_COLOR_THRESHOLD)&#xA;    {&#xA;      if (EQ (attrs[LFACE_INVERSE_INDEX], Qt))&#xA;        face-&amp;gt;background = load_color (f, face, dfg, LFACE_BACKGROUND_INDEX);&#xA;      else&#xA;        face-&amp;gt;foreground = load_color (f, face, dfg, LFACE_FOREGROUND_INDEX);&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* Returns the `distance' between the colors X and Y.  */&#xA;&#xA;static int&#xA;color_distance (XColor *x, XColor *y)&#xA;{&#xA;  /* This formula is from a paper titled `Colour metric' by Thiadmer Riemersma.&#xA;     Quoting from that paper:&#xA;&#xA;     This formula has results that are very close to L*u*v* (with the&#xA;     modified lightness curve) and, more importantly, it is a more even&#xA;     algorithm: it does not have a range of colors where it suddenly&#xA;     gives far from optimal results.&#xA;&#xA;     See &amp;lt;http://www.compuphase.com/cmetric.htm&amp;gt; for more info.  */&#xA;&#xA;  long r = (x-&amp;gt;red   - y-&amp;gt;red)   &amp;gt;&amp;gt; 8;&#xA;  long g = (x-&amp;gt;green - y-&amp;gt;green) &amp;gt;&amp;gt; 8;&#xA;  long b = (x-&amp;gt;blue  - y-&amp;gt;blue)  &amp;gt;&amp;gt; 8;&#xA;  long r_mean = (x-&amp;gt;red + y-&amp;gt;red) &amp;gt;&amp;gt; 9;&#xA;&#xA;  return&#xA;    (((512 + r_mean) * r * r) &amp;gt;&amp;gt; 8)&#xA;    + 4 * g * g&#xA;    + (((767 - r_mean) * b * b) &amp;gt;&amp;gt; 8);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#define NEAR_SAME_COLOR_THRESHOLD 30000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since this is in C, I think this means that this is not really customizable (maybe by rewriting the C function in lisp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing some research, it would be nice to get an algorithm that uses &lt;a href=&quot;http://web.mst.edu/~rhall/web_design/color_readability.html&quot; rel=&quot;nofollow&quot;&gt;http://web.mst.edu/~rhall/web_design/color_readability.html&lt;/a&gt; (the &quot;Algorithm&quot; section), which gives a formula and a good recommended contrast ratio from W3C.&lt;/p&gt;&#xA;" OwnerUserId="118" LastActivityDate="2015-02-05T19:37:54.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8006" PostTypeId="1" CreationDate="2015-02-05T20:55:16.043" Score="12" ViewCount="3324" Body="&lt;p&gt;For the following C++ function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bool importantStuff(double a, double b);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It should output the following snippet, perhaps without the tags:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA; * &amp;lt;Insert description of importantStuff&amp;gt;&#xA; *&#xA; * @param a &amp;lt;Insert description of a&amp;gt;&#xA; * @param b &amp;lt;Insert description of b&amp;gt;&#xA; * @return &amp;lt;Insert description of the return value&amp;gt;&#xA; */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've looked around the net, but the closest I've gotten to an answer is &lt;a href=&quot;https://stackoverflow.com/questions/11324752/emacs-c-c-doxygen-alternative-to-doxymacs-with-yasnippet&quot;&gt;this&lt;/a&gt; old SO question where the answer depends on the no longer maintained doxymacs mode.&lt;/p&gt;&#xA;" OwnerUserId="2325" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-09T10:31:43.310" Title="Is there a yasnippet producing a prepopulated doxygen comment?" Tags="|yasnippet|c++|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8007" PostTypeId="1" AcceptedAnswerId="8012" CreationDate="2015-02-05T23:28:29.480" Score="2" ViewCount="263" Body="&lt;p&gt;Is it possible to make a few different commands share a window for their output? For example, let's say I do &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;compile&lt;/code&gt; and get a &lt;code&gt;*compilation*&lt;/code&gt; buffer in bottom half of my frame. If I then do &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;ack&lt;/code&gt; (or &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;grep&lt;/code&gt;, etc.), I would like the results of these commands to be displayed in the same window which &lt;code&gt;*compilation*&lt;/code&gt; occupies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some background: In reply to &lt;a href=&quot;https://stackoverflow.com/questions/9725015/how-do-i-make-the-compilation-window-in-emacs-to-always-be-a-certain-size/9728357?noredirect=1#comment44981053_9728357&quot;&gt;this question&lt;/a&gt; @Francesco provided a &lt;a href=&quot;https://gist.github.com/ffevotte/d7e69cf147c014381003&quot; rel=&quot;nofollow noreferrer&quot;&gt;nice snippet&lt;/a&gt; which displays the compilation window at the bottom of the current frame. This works nicely to manage &lt;code&gt;*compilation*&lt;/code&gt;, but it would be even nicer if &lt;code&gt;compile&lt;/code&gt;, &lt;code&gt;ack&lt;/code&gt;, &lt;code&gt;ag&lt;/code&gt;, &lt;code&gt;igrep&lt;/code&gt; and a few similar commands shared this window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(So what I am really looking for is how to extend Francesco's snippet to manage the output of multiple commands together.)&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-06T10:43:22.190" Title="Sharing *compilation* window with other compilation-like commands" Tags="|window|compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8008" PostTypeId="2" ParentId="7853" CreationDate="2015-02-06T00:15:27.787" Score="9" Body="&#xA;&#xA;&lt;p&gt;Modifying my answer from &lt;a href=&quot;https://emacs.stackexchange.com/questions/7705/detection-of-a-latex-math-syntax-error-at-emacs-level/7707?noredirect=1#comment12153_7707&quot;&gt;here&lt;/a&gt; we can just pull this data out of &lt;code&gt;LaTeX-math-default&lt;/code&gt;, which is a list of 4-tuples&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(CHARACTER MACRO MENU UNICODE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;CHARACTER&lt;/code&gt; is the character used to bind it (I know it looks like an integer, but it's a character, use &lt;code&gt;(string CHARACTER)&lt;/code&gt; to see), &lt;code&gt;MACRO&lt;/code&gt; is the Latex macro without the slash, &lt;code&gt;MENU&lt;/code&gt; is the name for the menus and &lt;code&gt;UNICODE&lt;/code&gt; is a unicode character used for display in the menu.  We want to check the first and second elements:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun show-latex-symbol-at-point ()&#xA;  (interactive)&#xA;  (let* ((sym (symbol-at-point))&#xA;         (latex-symbol (TeX-member sym LaTeX-math-default&#xA;                                   (lambda (a b)&#xA;                                     (string= a (nth 1 b)))))&#xA;         (shortcut (nth 0 latex-symbol))&#xA;         )&#xA;    (if (and latex-symbol shortcut)&#xA;        (message &quot;You can insert \\%s with `%s&quot;&#xA;                 (nth 1 latex-symbol)&#xA;                 (key-description (string shortcut))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are probably better ways to continually show the output, but one way to use &lt;code&gt;post-command-hook&lt;/code&gt; to run the above function after every command.  We'll use an if to make sure this only runs in &lt;code&gt;latex-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook&#xA;          (lambda ()&#xA;            (if (bound-and-true-p LaTeX-math-mode)&#xA;                (show-latex-symbol-at-point)&#xA;              )&#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-02-06T21:11:39.863" LastActivityDate="2015-02-06T21:11:39.863" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8009" PostTypeId="1" CreationDate="2015-02-06T02:27:47.033" Score="1" ViewCount="266" Body="&lt;p&gt;I am having a weird problem with emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When pasting non-ascii text, e.g. &lt;code&gt;€&lt;/code&gt; from X-clipboard with the middle mouse button into x-enabled emacs I get Unicode character escape sequences, e.g. &lt;code&gt;\u20ac&lt;/code&gt; instead of &lt;code&gt;€&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, I first do a &quot;Copy&quot; in the other window and then do &lt;code&gt;C-y&lt;/code&gt; in emacs window, the text is inserted verbatim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be fixed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: this behavior is not observed when pasting with the middle mouse button into emacs running inside xterm, that is in xterm pasting is fine both ways, with mouse and with &lt;code&gt;C-y&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2015-02-06T02:27:47.033" Title="Unicode character escape sequences instead of text upon mouse-2 paste from other windows" Tags="|copy-paste|mouse|unicode|x11|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8010" PostTypeId="1" AcceptedAnswerId="8014" CreationDate="2015-02-06T03:35:35.880" Score="0" ViewCount="148" Body="&lt;p&gt;I essentially want to bring up the helm buffers list and hit &lt;code&gt;RET&lt;/code&gt;. This goes to the previous buffer in an alt-tab-like manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thought this would do the trick but stops short of actually exiting the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-alt-tab ()&#xA;  &quot;Acts as a buffer alt-tab using helm.&quot;&#xA;  (interactive)&#xA;  (helm-buffers-list)&#xA;  (helm-maybe-exit-minibuffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2808" LastActivityDate="2015-02-06T12:50:02.573" Title="Helm alt-tab-like function" Tags="|buffers|helm|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8011" PostTypeId="2" ParentId="7126" CreationDate="2015-02-06T03:59:32.437" Score="6" Body="&lt;p&gt;If you simply want a programmatic way to run a command in a new frame, just create the frame and run the command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun simple-run-command-in-new-frame (command)&#xA;  (select-frame (make-frame))&#xA;  (funcall #'command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want an interactive command that queries for the command being run, similar to &lt;code&gt;M-x&lt;/code&gt;, then you'll need to take care of details such as handling the prefix argument and querying the user.  The following should work in most circumstances:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-command-in-new-frame (prefixarg command-name)&#xA;  (interactive (list current-prefix-arg (read-extended-command)))&#xA;  (let ((command (intern-soft command-name)))&#xA;    (unless command&#xA;      (error &quot;%s is not a valid command name&quot; command-name))&#xA;    (select-frame (make-frame))&#xA;    (let ((prefix-arg prefixarg))&#xA;      (command-execute command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-02-06T03:59:32.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8012" PostTypeId="2" ParentId="8007" CreationDate="2015-02-06T08:16:49.363" Score="2" Body="&lt;p&gt;I think something like this should work (independently of the snippet you mention to always create compilation windows at the bottom of the current frame).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever you try to display a compilation buffer (or any buffer in a derived mode), &lt;code&gt;display-buffer-reuse-compilation-window&lt;/code&gt; will try to find another currently displayed compilation buffer, and reuse the window. If there is no compilation buffer currently displayed, the standard action will be taken.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(defun display-buffer-reuse-compilation-window (buffer param)&#xA;  (message &quot;toto&quot;)&#xA;  (let ((candidate&#xA;         (-find (lambda (b)&#xA;                  (and&#xA;                   (get-buffer-window b)&#xA;                   (with-current-buffer b&#xA;                     (derived-mode-p 'compilation-mode))))&#xA;                (buffer-list))))&#xA;    (when candidate&#xA;      (with-selected-window (get-buffer-window candidate)&#xA;        (switch-to-buffer buffer)))))&#xA;&#xA;(add-to-list 'display-buffer-alist&#xA;             (cons &#xA;              ;; Condition&#xA;              (lambda (buffer action)&#xA;                (with-current-buffer buffer&#xA;                  (derived-mode-p 'compilation-mode)))&#xA;              ;; Action&#xA;              (cons&#xA;               #'display-buffer-reuse-compilation-window&#xA;               nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A bit of warning, though: I'm not sure my snippet complies with all &lt;code&gt;display-buffer&lt;/code&gt; options regarding e.g. the possibility to reuse windows in other frames.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-02-06T08:16:49.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8013" PostTypeId="1" CreationDate="2015-02-06T09:09:47.400" Score="0" ViewCount="534" Body="&lt;p&gt;I'm trying to follow &lt;a href=&quot;http://paralambda.org/2012/07/02/using-gnu-emacs-as-a-terminal-emulator/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; and configure my multi-term to work with remote files seamlessly. &lt;strong&gt;Edit:&lt;/strong&gt; That article seems to be down currently. Try the cached version &lt;a href=&quot;http://webcache.googleusercontent.com/search?q=cache:gd47VuB8P3MJ:paralambda.org/2012/07/02/using-gnu-emacs-as-a-terminal-emulator/%20&amp;amp;cd=1&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;gl=us&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it's not working as expected.&#xA;I'm running OS X 10.9.5 and GNU Emacs 24.4.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As explained in the above article, I have placed the following code in my &lt;code&gt;.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (require 'term nil t)&#xA;  (defun term-handle-ansi-terminal-messages (message)&#xA;    (while (string-match &quot;\eAnSiT.+\n&quot; message)&#xA;      ;; Extract the command code and the argument.&#xA;      (let* ((start (match-beginning 0))&#xA;             (command-code (aref message (+ start 6)))&#xA;             (argument&#xA;              (save-match-data&#xA;                (substring message&#xA;                           (+ start 8)&#xA;                           (string-match &quot;\r?\n&quot; message&#xA;                                         (+ start 8))))))&#xA;        ;; Delete this command from MESSAGE.&#xA;        (setq message (replace-match &quot;&quot; t t message))&#xA;&#xA;        (cond ((= command-code ?c)&#xA;               (setq term-ansi-at-dir argument))&#xA;              ((= command-code ?h)&#xA;               (setq term-ansi-at-host argument))&#xA;              ((= command-code ?u)&#xA;               (setq term-ansi-at-user argument))&#xA;              ((= command-code ?e)&#xA;               (save-excursion&#xA;                 (find-file-other-window argument)))&#xA;              ((= command-code ?x)&#xA;               (save-excursion&#xA;                 (find-file argument))))))&#xA;&#xA;    (when (and term-ansi-at-host term-ansi-at-dir term-ansi-at-user)&#xA;      (setq buffer-file-name&#xA;            (format &quot;%s@%s:%s&quot; term-ansi-at-user term-ansi-at-host term-ansi-at-dir))&#xA;      (set-buffer-modified-p nil)&#xA;      (setq default-directory (if (string= term-ansi-at-host (system-name))&#xA;                                  (concatenate 'string term-ansi-at-dir &quot;/&quot;)&#xA;                                (format &quot;/%s@%s:%s/&quot; term-ansi-at-user term-ansi-at-host term-ansi-at-dir))))&#xA;    message))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I have placed the following code in my &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;# are we an interactive shell?&#xA;if [ &quot;$PS1&quot; ]; then&#xA;  case $TERM in&#xA;    eterm-color*)&#xA;      if [ -n &quot;$SSH_CONNECTION&quot; ]&#xA;      then&#xA;        echo &quot;if&quot;&#xA;        _HOST=$(echo -n $SSH_CONNECTION | cut -d\  -f3)&#xA;      else&#xA;        _HOST=$HOSTNAME&#xA;      fi&#xA;&#xA;      echo -ne &quot;${PWD/#$HOME/~}\n&quot;&#xA;      PROMPT_COMMAND='echo -ne &quot;\033AnSiTh ${_HOST}\n\033AnSiTu ${USER}\n\033AnSiTc ${PWD/#$HOME/~}\n&quot;'&#xA;      ;;&#xA;    xterm*)&#xA;      PROMPT_COMMAND='echo -ne &quot;\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}&quot;; echo -ne &quot;\007&quot;'&#xA;      ;;&#xA;    screen)&#xA;      PROMPT_COMMAND='echo -ne &quot;\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}&quot;; echo -ne &quot;\033\\&quot;'&#xA;      ;;&#xA;    *)&#xA;      [ -e /etc/sysconfig/bash-prompt-default ] &amp;amp;&amp;amp; PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default&#xA;      ;;&#xA;  esac&#xA;fi&#xA;&#xA;if [ &quot;${TERM}x&quot; = &quot;eterm-colorx&quot; ]&#xA;then&#xA;  alias e='echo -ne &quot;\033AnSiTe&quot;'&#xA;  alias x='echo -ne &quot;\033AnSiTx&quot;'&#xA;  echo &quot;eterm-colorx&quot;&#xA;else&#xA;  alias e='emacsclient -n -t -a nano'&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After adding these, I see 2 issues.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When I open a multi-term buffer, I see the current working directory being printed before each prompt. I also see a box (some unprintable character) and / preceding the path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/K216w.png&quot; alt=&quot;prompt with the PWD printed each time&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know where this string is coming from.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also when I try to open with command &lt;code&gt;x samp.txt&lt;/code&gt; it opens a file with some terminal messages attached at the end of filename. The file name it tries to open is &lt;code&gt;samp.txt^[AnSiTh xyz&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;xyz&lt;/code&gt; (renamed here) is the hostname of the system. It looks like the terminal message for setting the hostname somehow got appended to the filename. I couldn't figure out who/which code is appending this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5337" LastEditorUserId="5337" LastEditDate="2015-02-06T11:45:19.727" LastActivityDate="2023-12-11T20:06:05.850" Title="multi-term terminal messages configurations not working as expected" Tags="|term|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8014" PostTypeId="2" ParentId="8010" CreationDate="2015-02-06T09:40:18.150" Score="1" Body="&lt;pre&gt;&lt;code&gt;(defun my-switch-to-last-buffer ()&#xA;  (interactive)&#xA;  (switch-to-buffer nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No need to involve helm to have a command for switching to the last buffer interactively at all.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-06T09:40:18.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8015" PostTypeId="1" AcceptedAnswerId="8016" CreationDate="2015-02-06T09:47:30.680" Score="6" ViewCount="607" Body="&lt;p&gt;I tried to determine if Emacs returned object by reference or value, but could not find a clear answer (searching google and Emacs Lisp manual). I guess it must be &quot;by reference&quot;, and I just overlooked it somewhere.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-get-hash ()&#xA;  (let ((h (make-hash-table :test 'equal)))&#xA;    (puthash &quot;a&quot; 1 h)&#xA;    h))&#xA;&#xA;(let ((h2 (my-get-hash)))&#xA;  (message (prin1-to-string h2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here the hash &lt;code&gt;h&lt;/code&gt; is created with a &lt;code&gt;let&lt;/code&gt; binding, and then return to the caller. Does the caller receive a reference or a copy of &lt;code&gt;h&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2024-03-20T11:52:52.087" Title="Does Emacs Lisp functions return objects by reference or by value?" Tags="|functions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8016" PostTypeId="2" ParentId="8015" CreationDate="2015-02-06T10:38:17.673" Score="7" Body="&lt;p&gt;It's by reference when it comes to complex types like vectors and lists (or, more correct, cons pairs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple types like symbols and numbers are not mutable, so they can be seen as &quot;by value&quot;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-02-06T10:38:17.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8017" PostTypeId="1" CreationDate="2015-02-06T10:40:08.717" Score="2" ViewCount="150" Body="&lt;p&gt;Second day using Emacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've forked the &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow&quot;&gt;Prelude&lt;/a&gt; GitHub project and I'm storing my settings in the &lt;code&gt;personal&lt;/code&gt; folder as instructed in the documentation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to use my &lt;code&gt;eshell&lt;/code&gt; aliases across machines with a &lt;code&gt;git pull&lt;/code&gt;, but by default it looks like &lt;code&gt;eshell&lt;/code&gt; settings are saved under the &lt;code&gt;savefile&lt;/code&gt; directory which is by default ignored by &lt;code&gt;git&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I put my &lt;code&gt;eshell&lt;/code&gt; alias settings in my personal directory?  &lt;/p&gt;&#xA;" OwnerUserId="5429" LastEditorUserId="504" LastEditDate="2015-02-06T11:10:35.027" LastActivityDate="2015-02-06T20:00:23.390" Title="How can I save eshell alias settings when using prelude?" Tags="|eshell|prelude|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8018" PostTypeId="1" CreationDate="2015-02-06T11:31:52.330" Score="2" ViewCount="242" Body="&lt;p&gt;Performance used to be OK, but a couple of weeks ago the performance got much worse. Some experimentation showed that it's &lt;code&gt;auto-complete-mode&lt;/code&gt; in XML files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type, it now takes a second or two for each character to appear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a profiler report that covers me typing three or four words:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+ timer-event-handler                                            1636  90%&#xA;+ ...                                                             115   6%&#xA;+ command-execute                                                  34   1%&#xA;+ ac-handle-post-command                                           25   1%&#xA;+ redisplay_internal (C function)                                   2   0%&#xA;+ key-chord-input-method                                            1   0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no idea what to do with it though. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I turn off &lt;code&gt;auto-complete-mode&lt;/code&gt; the problem instantly goes away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas, anybody?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5430" LastEditorUserId="504" LastEditDate="2015-02-06T12:40:20.497" LastActivityDate="2015-04-13T08:32:56.197" Title="auto-complete mode performance is awful in nxml-mode" Tags="|auto-complete-mode|performance|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8019" PostTypeId="2" ParentId="8006" CreationDate="2015-02-06T12:26:57.970" Score="3" Body="&lt;p&gt;Just added this feature to &lt;a href=&quot;https://github.com/abo-abo/function-args&quot; rel=&quot;nofollow&quot;&gt;function-args&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code, if you're interested. It's using CEDET:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun moo-doxygen ()&#xA;  &quot;Generate a doxygen yasnippet and expand it with `aya-expand'.&#xA;The point should be on the top-level function name.&quot;&#xA;  (interactive)&#xA;  (move-beginning-of-line nil)&#xA;  (let ((tag (semantic-current-tag)))&#xA;    (unless (semantic-tag-of-class-p tag 'function)&#xA;      (error &quot;Expected function, got %S&quot; tag))&#xA;    (let* ((name (semantic-tag-name tag))&#xA;           (attrs (semantic-tag-attributes tag))&#xA;           (args (plist-get attrs :arguments))&#xA;           (ord 1))&#xA;      (setq aya-current&#xA;            (format&#xA;             &quot;/**&#xA;* $1&#xA;*&#xA;%s&#xA;* @return $%d&#xA;*/&#xA;&quot;&#xA;             (mapconcat&#xA;              (lambda (x)&#xA;                (format &quot;* @param %s $%d&quot;&#xA;                        (car x) (incf ord)))&#xA;              args&#xA;              &quot;\n&quot;)&#xA;             (incf ord)))&#xA;      (aya-expand))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You also need &lt;a href=&quot;https://github.com/abo-abo/auto-yasnippet&quot; rel=&quot;nofollow&quot;&gt;auto-yasnippet&lt;/a&gt;. Both packages are available&#xA;in MELPA. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-06T12:26:57.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8020" PostTypeId="2" ParentId="8010" CreationDate="2015-02-06T12:50:02.573" Score="0" Body="&lt;p&gt;I use helm like so, to do what you describe.  Source unknown, but I didn't write it originally :)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-buffers-list ()&#xA;  &quot;Preconfigured `helm' to list buffers.&quot;&#xA;  (interactive)&#xA;  (helm :sources '(helm-source-buffers-list&#xA;                   helm-source-ido-virtual-buffers&#xA;                   helm-source-buffer-not-found)&#xA;        :buffer &quot;*helm buffers*&quot;&#xA;        :keymap helm-buffer-map&#xA;        :truncate-lines t&#xA;        :preselect (buffer-name (other-buffer (current-buffer) 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2699" LastActivityDate="2015-02-06T12:50:02.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8022" PostTypeId="2" ParentId="7960" CreationDate="2015-02-06T13:43:50.603" Score="1" Body="&lt;p&gt;Would &lt;code&gt;last-command-event&lt;/code&gt; in &lt;code&gt;post-self-insert-hook&lt;/code&gt; do what you want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'post-self-insert-hook (lambda () (print last-command-event)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5434" LastEditorUserId="504" LastEditDate="2015-02-06T14:59:29.637" LastActivityDate="2015-02-06T14:59:29.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8023" PostTypeId="1" AcceptedAnswerId="8024" CreationDate="2015-02-06T14:04:40.587" Score="7" ViewCount="1857" Body="&lt;p&gt;I am trying to figure out how to add autoload features to a private library. Let's say I have developed a private Lisp library &lt;code&gt;&quot;my-lib.el&quot;&lt;/code&gt;. It consist of a set of functions, some can be used from any mode, others are only used for a particular mode. According to the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; I could put a autoload cookie above each function definition, and then call &lt;code&gt;update-file-autoloads&lt;/code&gt;. Is this correct? But when do I call &lt;code&gt;update-file-autoloads&lt;/code&gt;? In the beginning of the Emacs init file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in my &lt;code&gt;~/.emacs&lt;/code&gt; init file, I could write:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(update-file-autoloads &quot;my-lib.el&quot;)&#xA;(require 'my-lib)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where in &lt;code&gt;&quot;my-lib.el&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;###autoload&#xA;(defun my-func()&#xA;  (interactive)&#xA;  (message &quot;Hello&quot;)) &#xA;&#xA;;;; more functions, omitted here...&#xA;&#xA;(provide 'my-lib) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this gives error from &lt;code&gt;update-file-autoloads&lt;/code&gt; if the file is not in the current directory. Or if &lt;code&gt;&quot;my-lib.el&quot;&lt;/code&gt; is in the current directory, I get the error: &lt;code&gt;Wrong type argument: stringp, nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My aim is to be able to type &lt;code&gt;M-x my-func&lt;/code&gt; (as an example), and &lt;code&gt;my-func&lt;/code&gt; should autoload at that point if this was the first time I called it.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-06T16:08:36.657" Title="How to use autoload?" Tags="|libraries|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8024" PostTypeId="2" ParentId="8023" CreationDate="2015-02-06T14:14:44.977" Score="5" Body="&lt;p&gt;That's not how I would do it. I would:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;update-file-autoloads&lt;/code&gt; for &lt;code&gt;&quot;my-lib.el&quot;&lt;/code&gt; to &lt;code&gt;&quot;my-lib-autoloads.el&quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(require 'my-lib-autoloads)&lt;/code&gt; in &lt;code&gt;&quot;init.el&quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That's it. Now, each time you add or remove an autoload cookie, you should update &lt;code&gt;&quot;my-lib-autoloads.el&quot;&lt;/code&gt;.&#xA;Don't parse &lt;code&gt;&quot;my-lib.el&quot;&lt;/code&gt; at startup: it's probably slower than just loading it.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-06T14:14:44.977" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8025" PostTypeId="1" AcceptedAnswerId="8029" CreationDate="2015-02-06T14:24:17.440" Score="19" ViewCount="3075" Body="&lt;p&gt;I have a custom agenda view which shows the Items I did last week and the items I have to do in this week. This view is based on a filter of TODO items. However, it would be good to see scheduled items and deadlines in another buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I could open another emacs instance and open there a different agenda, but is there another way so that I can examine two different agenda views within the same frame, but in different buffers?&lt;/p&gt;&#xA;" OwnerUserId="5392" LastActivityDate="2019-09-06T10:20:51.020" Title="Is there a possibility to have multiple agenda views open at once?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8026" PostTypeId="2" ParentId="8025" CreationDate="2015-02-06T15:17:30.760" Score="6" Body="&lt;p&gt;I believe this could give you what you're looking for:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Open an agenda view&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run &lt;code&gt;M-x rename-uniquely&lt;/code&gt; or &lt;code&gt;M-x rename-buffer&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Open another agenda view&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-06T15:17:30.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8027" PostTypeId="2" ParentId="8023" CreationDate="2015-02-06T16:08:36.657" Score="3" Body="&lt;p&gt;If you are using &lt;code&gt;package.el&lt;/code&gt;, after changing &lt;code&gt;my-lib.el&lt;/code&gt; every time, use &lt;code&gt;package-install-from-buffer&lt;/code&gt; to install your private library as a package. You don't need to issue &lt;code&gt;(require 'my-lib)&lt;/code&gt; in your init file for invoking autoload commands because &lt;code&gt;package.el&lt;/code&gt; has already generated &lt;code&gt;&quot;my-lib-autoloads.el&quot;&lt;/code&gt; and loaded it for you.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-02-06T16:08:36.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8028" PostTypeId="2" ParentId="8017" CreationDate="2015-02-06T16:30:32.507" Score="2" Body="&lt;p&gt;eshell saves your aliases to the file specified in the &lt;code&gt;eshell-aliases-file&lt;/code&gt;variable, This variable should by default be inside the value of &lt;code&gt;eshell-directory-name&lt;/code&gt; which prelude seems to override. You should be able to override it back to something you can put under VC like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'prelude-editor&#xA;  (lambda ()&#xA;    (setq eshell-directory-name &quot;/my/eshell/stuff/&quot;)&#xA;    (setq eshell-aliases-file (concat eshell-directory &quot;my-eshell-aliases&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-02-06T20:00:23.390" LastActivityDate="2015-02-06T20:00:23.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8029" PostTypeId="2" ParentId="8025" CreationDate="2015-02-06T16:35:29.143" Score="19" Body="&lt;p&gt;This can be accomplished using &lt;code&gt;org-agenda-sticky&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://orgmode.org/manual/Agenda-dispatcher.html&quot;&gt;Org-Manual - Agenda Dispatcher&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;*&lt;/code&gt; ::&#xA;  Toggle sticky agenda views. By default, Org maintains only a single agenda buffer&#xA;  and rebuilds it each time you change the view, to&#xA;  make sure everything is always up to date. If you switch between views&#xA;  often and the build time bothers you, you can turn on sticky agenda&#xA;  buffers (make this the default by customizing the variable&#xA;  &lt;code&gt;org-agenda-sticky&lt;/code&gt;). With sticky agendas, the dispatcher only switches&#xA;  to the selected view, you need to update it by hand with &lt;code&gt;r&lt;/code&gt; or &lt;code&gt;g&lt;/code&gt;. You&#xA;  can toggle sticky agenda view any time with &lt;code&gt;org-toggle-sticky-agenda&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-02-06T16:35:29.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8030" PostTypeId="1" AcceptedAnswerId="8031" CreationDate="2015-02-06T17:20:57.027" Score="5" ViewCount="1988" Body="&lt;p&gt;I think this is mostly just a question of how to word the question...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prior to emacs 23.1, when pressing down-arrow or up-arrow the cursor would move up a whole line at a time &lt;em&gt;even&lt;/em&gt; when that line was wrapped. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of emacs 23.1, when pressing up or down-arrow at the head of a wrapped line, the cursor moves to the position within the same &quot;line&quot; which happens to fall beneath it's previous position. So instead of moving to the beginning of the next line, the cursor actually moves to character 81 (depending on the width of your buffer) within the same line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like, very much, to restore the older behavior of always moving a whole line at a time.&lt;/p&gt;&#xA;" OwnerUserId="2350" LastEditorUserId="2350" LastEditDate="2015-02-06T17:45:44.110" LastActivityDate="2015-02-06T17:45:44.110" Title="How to move by whole line rather than within a wrapped line (emacs 23.1+)" Tags="|cursor|motion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8031" PostTypeId="2" ParentId="8030" CreationDate="2015-02-06T17:30:48.080" Score="12" Body="&lt;p&gt;You need to modify the &lt;a href=&quot;http://doc.endlessparentheses.com/Var/line-move-visual&quot;&gt;&lt;code&gt;line-move-visual&lt;/code&gt;&lt;/a&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to set its value to &lt;code&gt;nil&lt;/code&gt; if you want the up/down line navigation happen logically (not visually).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;When &lt;code&gt;line-move-visual&lt;/code&gt; is set to &lt;code&gt;nil&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮his is a very very very very very long line&#xA;and it wrapped around here.&#xA;This is the next line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After hitting &lt;code&gt;C-n&lt;/code&gt; (moving the cursor to the next line) ..&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is a very very very very very long line&#xA;and it wrapped around here.&#xA;▮his is the next line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;When &lt;code&gt;line-move-visual&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮his is a very very very very very long line&#xA;and it wrapped around here.&#xA;This is the next line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After hitting &lt;code&gt;C-n&lt;/code&gt; (moving the cursor to the next line) ..&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is a very very very very very long line&#xA;▮nd it wrapped around here.&#xA;This is the next line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-06T17:38:45.473" LastActivityDate="2015-02-06T17:38:45.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8032" PostTypeId="1" AcceptedAnswerId="8033" CreationDate="2015-02-06T19:33:24.617" Score="4" ViewCount="713" Body="&lt;p&gt;I am using &lt;a href=&quot;https://github.com/tj64/outshine&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;outshine&lt;/code&gt;&lt;/a&gt; to organize my code (verilog/systemverilog language).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-verilog prettyprint-override&quot;&gt;&lt;code&gt;// * Class definition&#xA;class my_class extends my_base_class;&#xA;   // code ..&#xA;&#xA;   // ** Task 1 definition&#xA;   virtual task my_task1;&#xA;         // code ..&#xA;   endtask &#xA;&#xA;   // ** Task 2 definition&#xA;   virtual task my_task2;&#xA;         // code ..&#xA;   endtask &#xA;endclass &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently, the &lt;code&gt;// ** Task 1 definition&lt;/code&gt; and &lt;code&gt;// ** Task 2 definition&lt;/code&gt; headers will not be detected as &lt;em&gt;headers&lt;/em&gt; by the &lt;code&gt;outshine&lt;/code&gt;/&lt;code&gt;outline-mode&lt;/code&gt; code as they are auto-indented by my language major-mode: &lt;a href=&quot;http://www.veripool.org/ftp/verilog-mode.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;verilog-mode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Question&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Is it possible to tame the indentation logic to &lt;strong&gt;NOT&lt;/strong&gt; certain lines; in this case, they would be the lines beginning with &lt;code&gt;// *&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have mentioned &lt;code&gt;verilog-mode&lt;/code&gt; in this question but this can be a generic problem too, on how to make the indentation ignore certain lines irrespective of the major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I have posted this question with correct contexts on the &lt;a href=&quot;http://www.veripool.org/boards/16/topics/1588-Verilog-mode-Ignore-lines-starting-with-certain-characters-from-indenting-automatically-Feature-request-&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;verilog-mode&lt;/code&gt; Forum&lt;/a&gt; as well as the &lt;a href=&quot;https://github.com/tj64/outshine/issues/44&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;outshine&lt;/code&gt; github IM&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;strong&gt;@glucas&lt;/strong&gt;'s answer, I now have &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/6d481664841ac5daedfe8b5bd51c4f82dc1d1e5a/setup-files/setup-verilog.el#L70-91&quot; rel=&quot;nofollow&quot;&gt;the complete solution (my verilog setup on github)&lt;/a&gt; to this long-time problem! &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-30T03:42:29.397" LastActivityDate="2015-05-30T03:42:29.397" Title="Configure indentation logic to ignore certain lines?" Tags="|indentation|outline-mode|verilog|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8033" PostTypeId="2" ParentId="8032" CreationDate="2015-02-06T21:03:59.577" Score="5" Body="&lt;p&gt;I believe the relevant Emacs function is &lt;code&gt;indent-according-to-mode&lt;/code&gt;, which delegates to a mode-specific function registered with the variable &lt;code&gt;indent-line-function&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the source for verilog mode, I see that it sets &lt;code&gt;indent-line-function&lt;/code&gt; to &lt;code&gt;verilog-indent-line-relative&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One option is to advise &lt;code&gt;verilog-indent-line-relative&lt;/code&gt; to check for your special comment syntax and only call the actual function for lines that don't match. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/verilog-selective-indent (&amp;amp;rest args)&#xA;  &quot;Return t if the current line starts with '// *'.&quot;&#xA;  (interactive)&#xA;  (looking-at &quot;^[[:blank:]]*// \\*&quot;))&#xA;&#xA;(advice-add 'verilog-indent-line-relative :before-until #'my/verilog-selective-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this uses the Emacs 24.4+ advice mechanism. The &lt;code&gt;:before-until&lt;/code&gt; advice means that the advised function will not be called if the advice returns &lt;code&gt;t&lt;/code&gt;, so in this case if the the current line starts with &lt;code&gt;// *&lt;/code&gt; it will be skipped. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can delete the leading whitespace on your special matching lines with a slight variation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/verilog-selective-indent (&amp;amp;rest args)&#xA;  &quot;Return t if the current line starts with '// *'.&quot;&#xA;  (interactive)&#xA;  (let ((match (looking-at &quot;^[[:blank:]]*// \\*&quot;)))&#xA;    (when match (delete-horizontal-space))&#xA;    match))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="115" LastEditDate="2015-05-30T03:40:20.860" LastActivityDate="2015-05-30T03:40:20.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8034" PostTypeId="2" ParentId="3779" CreationDate="2015-02-06T22:55:58.673" Score="1" Body="&lt;p&gt;This worked for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-group RET smartparens RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html&quot; rel=&quot;nofollow&quot;&gt;Easy Customization interface&lt;/a&gt; to toggle &lt;code&gt;Smartparens Global Mode&lt;/code&gt; to &quot;off&quot; (nil), then choose to apply and save your changes. (The setting started in the &quot;off&quot; state for me, but smartparens was active anyway. I had to toggle it &quot;on&quot; and back &quot;off&quot; to disable it successfully.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT&lt;/em&gt;: I take it back; it worked &lt;em&gt;temporarily&lt;/em&gt;. Smartparens is activated again upon starting a new session. Maybe this is an issue with Prelude?&lt;/p&gt;&#xA;" OwnerUserId="5439" LastEditorUserId="5439" LastEditDate="2015-02-09T22:16:15.177" LastActivityDate="2015-02-09T22:16:15.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8035" PostTypeId="2" ParentId="8032" CreationDate="2015-02-07T00:16:56.650" Score="1" Body="&lt;p&gt;Not a direct answer to your &lt;em&gt;indentation&lt;/em&gt; question - @glucas has provided that. But some info that might also help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lines in question are apparently comment lines. You can use Lisp macro &lt;strong&gt;&lt;code&gt;with-comments-hidden&lt;/code&gt;&lt;/strong&gt; to &lt;a href=&quot;http://www.emacswiki.org/HideOrIgnoreComments&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;ignore comments&lt;/em&gt;&lt;/a&gt;.  The comments are temporarily hidden for the duration of the macro body (though you do not see any visible change).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you could, for example, wrap the problematic indentation code in &lt;code&gt;with-comments-hidden&lt;/code&gt;, to effectively have it ignore the existence of any comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just another tool for your tool belt, which might help in contexts like the one you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Macro &lt;code&gt;with-comments-hidden&lt;/code&gt; is in library &lt;a href=&quot;http://www.emacswiki.org/hide-comnt.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;hide-comnt.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-07T00:16:56.650" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8036" PostTypeId="1" CreationDate="2015-02-07T01:05:55.730" Score="4" ViewCount="471" Body="&lt;p&gt;I have in my startup init file a setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tags-table-list (list &quot;~/linux/TAGS&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After using emacs and &lt;code&gt;TAGS&lt;/code&gt; tables, I now want to change that to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tags-table-list (list &quot;~/trunk/TAGS&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the old linux &lt;code&gt;TAGS&lt;/code&gt; are still being used in addition to the new trunk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I expunge the old &lt;code&gt;TAGS&lt;/code&gt; table?  I tried also deleting the buffer, but it just gets reloaded.&lt;/p&gt;&#xA;" OwnerUserId="2414" LastActivityDate="2015-11-06T17:04:18.173" Title="Why is TAGS table setting persistent?" Tags="|init-file|variables|ctags|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8037" PostTypeId="1" CreationDate="2015-02-07T02:12:49.307" Score="1" ViewCount="403" Body="&lt;p&gt;I'm very new to Emacs and I like it so far, but there is one thing that has been bugging me. Its auto-indenting has been acting pretty random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I am on a new line and type something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for (&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it indents one deeper than the deepest indent level (syntax error). This is happening in &lt;code&gt;python-mode&lt;/code&gt; and &lt;code&gt;c-mode&lt;/code&gt;, but not in &lt;code&gt;text-mode&lt;/code&gt;. Why is this happening and how do I fix it?&lt;/p&gt;&#xA;" OwnerUserId="5440" LastEditorUserId="504" LastEditDate="2015-02-07T09:32:10.777" LastActivityDate="2015-06-19T06:38:23.550" Title="why is emacs indenting when I type an open paren" Tags="|indentation|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8038" PostTypeId="1" CreationDate="2015-02-07T03:27:39.210" Score="5" ViewCount="486" Body="&lt;p&gt;I've defined one keyboard macro, bound to keystroke &lt;code&gt;1&lt;/code&gt;, say, and I want to define a second keyboard macro that executes the first one indefinitely and then returns to the beginning of the buffer. I assume that the first one always terminates if iterated indefinitely. E.g., it could be a keyboard macro that operates on a line and then moves to the next line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To define the new keyboard macro, I naively want to type:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x (&lt;/code&gt; &lt;code&gt;C-u 0&lt;/code&gt; &lt;code&gt;C-x C-k 1&lt;/code&gt; &lt;code&gt;C-u C-u C-x (&lt;/code&gt; &lt;code&gt;M-&amp;lt;&lt;/code&gt; &lt;code&gt;C-x )&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, &lt;code&gt;C-x (&lt;/code&gt; to begin recording, &lt;code&gt;C-u 0&lt;/code&gt; to specify indefinite execution, &lt;code&gt;C-x C-k 1&lt;/code&gt; to specify that the indefinite execution refers to keyboard macro 1, &lt;code&gt;C-u C-u C-x (&lt;/code&gt; to resume recording the new keyboard macro (since recording automatically terminates after the last iteration of keyboard macro 1), &lt;code&gt;M-&amp;lt;&lt;/code&gt; to return to the beginning of the buffer, and finally &lt;code&gt;C-x )&lt;/code&gt; to end recording.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I bind all of that to a new key sequence and then invoke it, I find that this new keyboard macro goes as far as to execute keyboard macro 1 (as many times as it can) but fails to finish with the &lt;code&gt;M-&amp;lt;&lt;/code&gt;. Am I doing something wrong? Is there another way to achieve what I want?&lt;/p&gt;&#xA;" OwnerUserId="5441" LastEditorUserId="105" LastEditDate="2015-02-07T17:17:05.987" LastActivityDate="2015-02-07T17:17:05.987" Title="Define a keyboard macro to indefinitely execute another keyboard macro and then do something else" Tags="|keyboard-macros|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8039" PostTypeId="2" ParentId="7706" CreationDate="2015-02-07T05:22:14.807" Score="1" Body="&lt;p&gt;It's possible to enable more than one theme at a time. If you create a theme (using &lt;code&gt;deftheme&lt;/code&gt;) that contains the your face definitions you can enable it at the same time as any package theme you want to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in my &lt;code&gt;.emacs.d&lt;/code&gt; I have defined a theme called &lt;code&gt;pd-basic&lt;/code&gt; that contains the faces I want to override. To use it with &lt;code&gt;zenburn&lt;/code&gt; I call the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(load-theme 'zenburn t t)&#xA;(load-theme 'pd-basic t t)&#xA;(custom-set-variables '(custom-enabled-themes '(pd-basic zenburn)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="640" LastEditorUserId="504" LastEditDate="2015-02-07T09:33:58.117" LastActivityDate="2015-02-07T09:33:58.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8041" PostTypeId="1" AcceptedAnswerId="8055" CreationDate="2015-02-07T08:46:16.897" Score="9" ViewCount="2024" Body="&lt;p&gt;Recently, &lt;code&gt;R&lt;/code&gt; witnessed the smart introduction of the piping operator &lt;code&gt;%&amp;gt;%&lt;/code&gt; or &lt;code&gt;then&lt;/code&gt; operator in code which I use quite frequently nowadays. I wonder if this has already been implemented in the newest version of &lt;a href=&quot;http://ess.r-project.org/index.php?Section=download&quot; rel=&quot;noreferrer&quot;&gt;ESS&lt;/a&gt;. If not, it shouldn't be a problem to come up with &lt;code&gt;elisp&lt;/code&gt; code to write a function for it. I need to implement this so that it will print that operator &lt;code&gt;%&amp;gt;%&lt;/code&gt; and then jumps to a new indented line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MWE&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(ggplot2)&#xA;library(dplyr)    &#xA;diamonds %&amp;gt;%&#xA;      filter(cut==&quot;Ideal&quot;) %&amp;gt;%&#xA;      ggplot(aes(price)) +&#xA;      geom_histogram() +&#xA;      facet_wrap (~ color)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My elisp trial - in &lt;code&gt;.init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt; file:   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun then_R_operator ()&#xA;  &quot;%&amp;gt;% operator or 'then' pipe operator&quot;&#xA;  (interactive)&#xA;  (insert &quot; %&amp;gt;%&quot;) ; note the space before the first %&#xA;  (reindent-then-newline-and-indent))&#xA;(global-set-key (kbd &quot;C-%&quot;) 'then_R_operator)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, but I want to check if there is something wrong with it or are there any suggestions to improve it (being a newbie in elisp). How to restrict this only to &lt;code&gt;ESS&lt;/code&gt; mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;br&gt;&#xA;I realized that font-locking of &lt;code&gt;%&amp;gt;%&lt;/code&gt; can be done by enabling &lt;code&gt;ess-fl-keyword:operators&lt;/code&gt;from the ESS menu.  &lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="105" LastEditDate="2017-07-20T21:57:53.560" LastActivityDate="2021-06-03T16:12:49.067" Title="How to implement the piping operator %&gt;% in ESS mode?" Tags="|font-lock|ess|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8042" PostTypeId="2" ParentId="8038" CreationDate="2015-02-07T08:48:34.427" Score="5" Body="&lt;p&gt;What you are currently doing doesn't work because execution of keyboard macros terminates whenever there is an error. This is what makes it possible to execute keyboard macros &quot;indefinitely&quot; (but without entering an infinite loop) in the first place: If macro execution did not stop on error, you would enter an infinite loop even if you naturally reached the end of the current buffer after &lt;code&gt;n&lt;/code&gt; executions. As a result, if you call a macro that executes another macro indefinitely, an error will be thrown once the end of the buffer is reached, and this error will also terminate the &quot;parent&quot; macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get around this, you can define a custom command that ignores errors during macro execution and returns to the beginning of the current buffer after execution stops:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kmacro-repeat-indefinitely-then-back-to-top ()&#xA;  &quot;Repeat last keyboard macro indefinitely, ignoring errors, then&#xA;go back to beginning of buffer.&quot;&#xA;  (interactive)&#xA;  (ignore-errors (kmacro-call-macro 0))&#xA;  (goto-char (point-min)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-02-07T08:48:34.427" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8043" PostTypeId="1" CreationDate="2015-02-07T09:02:34.857" Score="2" ViewCount="802" Body="&lt;p&gt;Let's say I have Emacs Lisp library &lt;code&gt;~/emacs/my-lib.el&lt;/code&gt; with contents:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;###autoload&#xA;(defun my-func()&#xA;  &quot;hello&quot;&#xA;  (interactive)&#xA;  (message &quot;Hello&quot;)) &#xA;&#xA;(provide 'my-lib)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would now like to produce a file &lt;code&gt;~/emacs/my-lib-autoload.el&lt;/code&gt; with autoload statements for &lt;code&gt;~/emacs/my-lib.el&lt;/code&gt;. &#xA;The documentation for &lt;code&gt;update-file-autoloads&lt;/code&gt; says ( &lt;code&gt;&quot;C-h f update-file-autoloads&quot;&lt;/code&gt; )&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(update-file-autoloads FILE &amp;amp;optional SAVE-AFTER OUTFILE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Update the autoloads for FILE. If prefix arg SAVE-AFTER is non-nil,&#xA;  save the buffer too.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If FILE binds &lt;code&gt;generated-autoload-file' as a file-local variable,&#xA;  autoloads are written into that file.  Otherwise, the autoloads file&#xA;  is determined by OUTFILE.  If called interactively, prompt for&#xA;  OUTFILE; if called from Lisp with OUTFILE nil, use the existing value&#xA;  of&lt;/code&gt;generated-autoload-file'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So from this information I figured I should be able to supply a non-nil OUTFILE argument. However, trying to run (from &lt;em&gt;scratch&lt;/em&gt; buffer) :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(update-file-autoloads &quot;~/emacs/my-lib.el&quot; t &quot;~/emacs/my-lib-autoload.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Gives error &lt;code&gt;wrong-type-argument stringp nil&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following two approaches work though:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Setting &lt;code&gt;generated-autoload-file&lt;/code&gt; as a global variable, for example adding  &lt;code&gt;(setq generated-autoload-file &quot;~/emacs/my-lib-autoload.el&quot;)&lt;/code&gt; to my Emacs init file (&lt;code&gt;~/.emacs&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Adding &lt;code&gt;generated-autoload-file&lt;/code&gt; as a local file variable at the end of file &lt;code&gt;~/emacs/my-lib.el&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables: &#xA;;; generated-autoload-file: &quot;~/emacs/my-lib-autoload.el&quot; &#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does not &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(update-file-autoloads &quot;~/emacs/my-lib.el&quot; t &quot;~/emacs/my-lib-autoload.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;work when the variable &lt;code&gt;generated-autoload-file&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-05-13T01:28:09.547" Title="How to use function update-file-autoloads and and variable generated-autoload-file?" Tags="|libraries|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8044" PostTypeId="2" ParentId="8043" CreationDate="2015-02-07T09:38:11.027" Score="3" Body="&lt;p&gt;I'll just show you the function that I've been using for ages in my&#xA;&lt;code&gt;.emacs.d&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun update-all-autoloads ()&#xA;  (interactive)&#xA;  (let ((generated-autoload-file (concat emacs.d &quot;loaddefs.el&quot;)))&#xA;    (when (not (file-exists-p generated-autoload-file))&#xA;      (with-current-buffer (find-file-noselect generated-autoload-file)&#xA;        (insert &quot;;;&quot;) ;; create the file with non-zero size to appease autoload&#xA;        (save-buffer)))&#xA;    (mapc #'update-directory-autoloads&#xA;          '(&quot;&quot; &quot;dir1&quot; &quot;dir2&quot; &quot;dir3&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since this works so good, I've never had to deal with&#xA;&lt;code&gt;update-file-autoloads&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-07T09:38:11.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8045" PostTypeId="1" AcceptedAnswerId="8049" CreationDate="2015-02-07T10:06:31.703" Score="13" ViewCount="2577" Body="&lt;p&gt;I'm trying to write a function that will take a heading and refile it to one specific location. The doc for &lt;code&gt;org-refile&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-refile &amp;amp;optional GOTO DEFAULT-BUFFER RFLOC MSG)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;RFLOC&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RFLOC can be a refile location obtained in a different way.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I have no clue what &quot;a different way&quot; would be and I've been googling for half a day and not seen any examples.  I know the file and I know the headline for the target but I don't know the syntax to form it into what it wants. The closest I've gotten is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-refile nil #(&quot;~/Org/bookmarks.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will then prompt me for the headline, but of course I don't want it to prompt me, I want to provide it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm new to elisp and I've guessed at every syntax I can think of. Does anyone know how to phrase this?&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-02-08T00:45:04.880" Title="org-refile to a known fixed location" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8046" PostTypeId="1" AcceptedAnswerId="8047" CreationDate="2015-02-07T13:53:40.673" Score="4" ViewCount="1353" Body="&lt;p&gt;I have developed some private extensions to some major modes, and I would like to load those extensions only when the given major mode is actually used by the user. The extensions consists of a set of functions confined to a single file. For example, for &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, I have developed a file &lt;code&gt;&quot;~/emacs/my-emacs-lisp-mode-hook.el&lt;/code&gt;, here is a minimal example for illustration purposes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-emacs-lisp-mode-hook ()&#xA;  (my-hook-func))&#xA;&#xA;(defun my-hook-func ()&#xA;  (message-box &quot;This is my hook function&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then, in my Emacs init file &lt;code&gt;~/.emacs&lt;/code&gt; I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(autoload 'my-emacs-lisp-mode-hook &quot;~/emacs/my-emacs-lisp-mode-hook.el&quot; &quot;My Emacs Lisp mode hook&quot; nil nil)&#xA;(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I do not have an &lt;code&gt;autoload&lt;/code&gt; call for the function &lt;code&gt;my-hook-func&lt;/code&gt;.&#xA;The question is: If it is sufficient to call &lt;code&gt;autoload&lt;/code&gt; only for the function &lt;code&gt;my-emacs-lisp-mode-hook&lt;/code&gt;, or if I have to call &lt;code&gt;autoload&lt;/code&gt; for each function in the file &lt;code&gt;&quot;~/emacs/my-emacs-lisp-mode-hook.el&lt;/code&gt;? The idea is that, the other functions in the file will never be used unless a buffer switches to major mode &lt;code&gt;emacs-lisp-mode&lt;/code&gt; and the hook function &lt;code&gt;my-emacs-lisp-mode-hook&lt;/code&gt; has run. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, this strategy seems to work (I get the message box created in &lt;code&gt;my-hook-func&lt;/code&gt; even if I have no explicit &lt;code&gt;autoload&lt;/code&gt; statement for that function). But I could not find a clear statement of this behavior in the manual. So is this a viable strategy? (It would certainly allow me to simplify my code, that is: not having to add autoload cookies for each function, and not call &lt;code&gt;update-file-autoloads&lt;/code&gt; and so on..)&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-07T17:58:06.720" Title="Does autoload load all functions in the file or just the one specified?" Tags="|hooks|libraries|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8047" PostTypeId="2" ParentId="8046" CreationDate="2015-02-07T14:02:35.023" Score="5" Body="&lt;p&gt;Once a single autoloaded call is triggered, the whole file will be required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The common strategy is to put &lt;code&gt;;;;###autoload&lt;/code&gt; on the user interface entry points: the most&#xA;used interactive functions. For instance, for a minor mode, usually only the minor mode definition&#xA;needs to be autoloaded.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Finding the following info&lt;/h2&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The &quot;autoload&quot; facility lets you register the existence of a function&#xA;  or macro, but put off loading the file that defines it.  The first call&#xA;  to the function automatically loads the proper library, in order to&#xA;  install the real definition and other associated code, then runs the&#xA;  real definition as if it had been loaded all along.  Autoloading can&#xA;  also be triggered by looking up the documentation of the function or&#xA;  macro&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;F1 i&lt;/kbd&gt; to launch &lt;code&gt;info&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp)&lt;/code&gt; to go to Elisp node&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;i&lt;/kbd&gt; &lt;code&gt;autoload&lt;/code&gt; to search the index for the word autoload&lt;/li&gt;&#xA;&lt;li&gt;that's it, the topic is the first one (out of thirteen) in the index&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-02-07T14:12:25.927" LastActivityDate="2015-02-07T14:12:25.927" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8048" PostTypeId="2" ParentId="8003" CreationDate="2015-02-07T14:35:43.767" Score="2" Body="&lt;p&gt;Meanwhile I wrote a code to implement the hack that @glucas mentioned. It perhaps only suits the purpose of sorting headers in C, but I hope someone find it useful.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun replace-char-after (character-number replacement)&#xA;  &quot;Replaces char in the buffer after the `character-number' with `replacement'&quot;&#xA;  (save-excursion&#xA;    (goto-char character-number)&#xA;    (delete-char 1)&#xA;    (insert-char replacement)))&#xA;&#xA;(defun replace-delimiters (old-closing-char new-opening-char new-closing-char opening-point end-point)&#xA;  &quot;Replaces delimiters between `opening-point' and the&#xA;`end-point'. Note, that the `opening-point' should point to the&#xA;opening symbol, thus the function seeks only the closing&quot;&#xA;  (block replace-delimiters&#xA;    (let ((closing-point opening-point))&#xA;      (setq closing-point (+ 1 opening-point))&#xA;      (while (&amp;lt; closing-point end-point)&#xA;        (if (eq (char-after closing-point) ?\n) ;;no closing delimiter&#xA;            (progn&#xA;              (print &quot;Err: no closing delimiter&quot;)&#xA;              (return-from replace-delimiters nil))&#xA;          (when (eq (char-after closing-point) old-closing-char)&#xA;            (progn&#xA;              (replace-char-after opening-point new-opening-char);;opening delimiter&#xA;              (replace-char-after closing-point new-closing-char);;closing delimiter&#xA;              (return-from replace-delimiters (+ 1 closing-point)))))&#xA;        (setq closing-point (+ closing-point 1))))))&#xA;&#xA;(defun swap-&amp;lt;-and-quote-includes (beg end)&#xA;    &quot;Swaps in the text between `beg' and `end' the matching «&amp;lt;» and&#xA;  «&amp;gt;» character to the \&quot; quote, and vice versa. Mainly used&#xA;  before sorting to swap the order of these characters, next&#xA;  after the sort to restore the text.&quot;&#xA;  (block swap-&amp;lt;-and-quote-includes&#xA;    (let ((curr-point beg))&#xA;      (while (&amp;lt; curr-point end)&#xA;        (setq curr-point (+ curr-point 1))&#xA;        ;;first check «&quot;»&#xA;        (if (eq (char-after curr-point) ?\&quot;)&#xA;            (progn&#xA;              (setq curr-point (replace-delimiters ?\&quot; ?&amp;lt; ?&amp;gt; curr-point end))&#xA;              (if (eq curr-point nil)&#xA;                  (return-from swap-&amp;lt;-and-quote-includes t)))&#xA;          ;;else if «&amp;lt;»&#xA;          (if (eq (char-after curr-point) ?&amp;lt;)&#xA;              (progn&#xA;                (setq curr-point (replace-delimiters ?\&amp;gt; ?\&quot; ?\&quot; curr-point end))&#xA;                (if (eq curr-point nil)&#xA;                    (return-from swap-&amp;lt;-and-quote-includes t)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;swap-&amp;lt;-and-quote-includes&lt;/code&gt; transforms every text like &lt;code&gt;&amp;lt;foo&amp;gt;&lt;/code&gt; to &lt;code&gt;&quot;foo&quot;&lt;/code&gt;, and every &lt;code&gt;&quot;foo&quot;&lt;/code&gt; to &lt;code&gt;&amp;lt;foo&amp;gt;&lt;/code&gt; within the given range &lt;em&gt;beg&lt;/em&gt;, &lt;em&gt;end&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here's the code to find and sort headers:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun sort-lines-nocase (reverse beg end)&#xA;  (let ((sort-fold-case t))&#xA;    (sort-lines reverse beg end)))&#xA;&#xA;(defun c-sort-includes ()&#xA;  &quot;Sorts #include statements&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (let (beg end orig-content sorted-content)&#xA;      (goto-char (point-min))&#xA;      (while (and (not (looking-at &quot;#include &quot;));;look for includes, if no then&#xA;                  (eq (forward-line 1) 0) ;;go one line down (if not EOF).&#xA;                  ))&#xA;      (setq beg (point))&#xA;      (while (and (looking-at &quot;#include &quot;)&#xA;                  (eq (forward-line 1) 0)));;to not hang cuz of EOF&#xA;      (setq end (point))&#xA;      (setq orig-content (buffer-substring-no-properties beg end))&#xA;      (setq sorted-content (with-temp-buffer&#xA;                             (insert orig-content)&#xA;                             (swap-&amp;lt;-and-quote-includes (point-min) (point-max)) ;;swap characters &amp;lt; and &amp;gt; in includes&#xA;                             (sort-lines-nocase (point-min) (point-max)) ;;sort&#xA;                             (swap-&amp;lt;-and-quote-includes (point-min) (point-max)) ;;swap the characters  back&#xA;                             (buffer-string)))&#xA;      (when (not (string= orig-content sorted-content))&#xA;        (kill-region beg end)&#xA;        (insert sorted-content))&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;c-sort-includes&lt;/code&gt; seeks for the first paragraph of «#include »s, and sorts it. I have it added to &lt;code&gt;before-save-hook&lt;/code&gt; with a code to only run it for C and C++ modes. Known cons: α) only the first paragraph with includes will be sorted. It's because search till the end of a file can be expensive — e.g. at my job I recently found a &lt;code&gt;.c&lt;/code&gt; file with — can you even imagine?! — ≈16000 lines! Correct solution would rather be a minor mode, which would track where header blocks in the file reside. β) In older Emacs, from ≈2015 year, function could hang — it was a bug that later was fixed.&lt;/p&gt;&#xA;" OwnerUserId="2671" LastEditorUserId="2671" LastEditDate="2019-05-15T07:18:00.120" LastActivityDate="2019-05-15T07:18:00.120" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8049" PostTypeId="2" ParentId="8045" CreationDate="2015-02-07T15:03:42.850" Score="11" Body="&lt;p&gt;I've wondered what RFLOC should look like before, but never&#xA;investigated. Looking at the org source code, it should be a list consisting of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;heading&lt;/li&gt;&#xA;&lt;li&gt;file&lt;/li&gt;&#xA;&lt;li&gt;re (regular expression)&lt;/li&gt;&#xA;&lt;li&gt;pos (position of target heading)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I haven't experimented with the &lt;code&gt;re&lt;/code&gt; element, but here is a simple function that will invoke &lt;code&gt;org-refile&lt;/code&gt; with a RFLOC built from a given FILE and HEADING:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/refile (file headline)&#xA;  (let ((pos (save-excursion&#xA;               (find-file file)&#xA;               (org-find-exact-headline-in-buffer headline))))&#xA;    (org-refile nil nil (list headline file nil pos))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This opens the target file and uses an org function to find the position of the target headline, then builds the RFLOC list to pass to &lt;code&gt;org-refile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-07T15:26:20.273" LastActivityDate="2015-02-07T15:26:20.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8050" PostTypeId="2" ParentId="8018" CreationDate="2015-02-07T17:56:04.063" Score="1" Body="&lt;p&gt;When I expand the entries that are using the most CPU I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- timer-event-handler                                            3805  89%&#xA; - byte-code                                                     3805  89%&#xA;  - apply                                                        3805  89%&#xA;   - ac-update-greedy                                            2717  64%&#xA;    - ac-update                                                  2713  64%&#xA;     - ac-menu-create                                            2711  64%&#xA;      - popup-create                                             2710  63%&#xA;         end-of-visual-line                                       245   5%&#xA;         beginning-of-visual-line                                 243   5%&#xA;         popup-vertical-motion                                    148   3%&#xA;       + posn-at-point                                             75   1%&#xA;         posn-col-row                                               2   0%&#xA;     + ac-remove-quick-help                                         1   0%&#xA;     + ac-update-candidates                                         1   0%&#xA;    + ac-start                                                      4   0%&#xA;   - ac-show-menu                                                1051  24%&#xA;    - ac-update                                                  1051  24%&#xA;     - ac-menu-create                                            1051  24%&#xA;      - popup-create                                             1051  24%&#xA;         end-of-visual-line                                        93   2%&#xA;         beginning-of-visual-line                                  92   2%&#xA;         popup-vertical-motion                                     53   1%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The value of &lt;code&gt;ac-sources&lt;/code&gt; is: &lt;code&gt;(ac-source-nxml-tag ac-source-nxml-attr ac-source-nxml-attr-value ac-source-nxml-css ac-source-nxml-css-property ac-source-nxml-tag-value-by-nxml ac-source-nxml-tag-value-by-myself)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried changing it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ac-sources '(ac-source-symbols ac-source-words-in-same-mode-buffers))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... and that has improved the performance a lot! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also removed the &lt;code&gt;auto-complete-nxml&lt;/code&gt; package and everything is working fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll try to find out more about &lt;code&gt;auto-complete-nxml&lt;/code&gt;, because that has been working fine for months; I don't know what's gone wrong there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, my problem is fixed. Many thanks everybody.&lt;/p&gt;&#xA;" OwnerUserId="5431" LastEditorUserId="504" LastEditDate="2015-02-12T07:59:43.687" LastActivityDate="2015-02-12T07:59:43.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8051" PostTypeId="1" CreationDate="2015-02-07T17:56:26.630" Score="1" ViewCount="2459" Body="&lt;p&gt;&lt;code&gt;M-x check-parens&lt;/code&gt; finds unmatched parentheses in a buffer.&#xA;I am wondering if there is a similar command which finds unmatched &lt;code&gt;{&lt;/code&gt; or &lt;code&gt;[&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="14920" LastEditDate="2018-09-11T11:04:40.177" LastActivityDate="2018-09-11T11:04:40.177" Title="Is there an equivalent of `M-x check-parens` for finding unmatches braces or ['s in any buffer (not a particular mode)" Tags="|buffers|commands|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8052" PostTypeId="2" ParentId="8046" CreationDate="2015-02-07T17:58:06.720" Score="4" Body="&lt;p&gt;Consider &lt;strong&gt;&lt;em&gt;asking Emacs&lt;/em&gt;&lt;/strong&gt; first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h r&lt;/code&gt; &lt;code&gt;i autoload&lt;/code&gt; takes you to node &lt;code&gt;Lisp Libraries&lt;/code&gt; in the Emacs manual, where you see, among other things:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Some commands are &quot;autoloaded&quot;; when you run them, Emacs&#xA;  automatically &lt;strong&gt;&lt;em&gt;loads the associated library&lt;/em&gt;&lt;/strong&gt; first.  For instance, the&#xA;  &lt;code&gt;M-x compile&lt;/code&gt; command (*note Compilation::) is autoloaded; if you call&#xA;  it, Emacs automatically loads the &lt;code&gt;compile&lt;/code&gt; library first.  In&#xA;  contrast, the command &lt;code&gt;M-x recompile&lt;/code&gt; is not autoloaded, so it is&#xA;  unavailable until you load the &lt;code&gt;compile&lt;/code&gt; library.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Not that it says clearly that it loads the &lt;strong&gt;library&lt;/strong&gt; where the command is defined, not just the command definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use &lt;code&gt;i autoload&lt;/code&gt; a message tells you: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Found &lt;code&gt;autoload&lt;/code&gt; in Concept Index.  (2 total; use &lt;code&gt;,&lt;/code&gt; for next)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That is, this is not the only node indexed for &lt;strong&gt;&quot;autoload&quot;&lt;/strong&gt;; there is one more. And if you hit &lt;code&gt;,&lt;/code&gt; then Emacs takes you to node &lt;code&gt;Init Examples&lt;/code&gt;, where you see this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;Tell Emacs to find the definition for the function &lt;code&gt;myfunction&lt;/code&gt; by&#xA;   loading a Lisp library named &lt;code&gt;mypackage&lt;/code&gt; (i.e., a file&#xA;   &lt;code&gt;mypackage.elc&lt;/code&gt; or &lt;code&gt;mypackage.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (autoload 'myfunction &quot;mypackage&quot; &quot;Do what I say.&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again, note that it tells you that autoloading loads a library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will of course find much more detail about autoloading in the Elisp manual, but even this cursory glance at the Emacs manual provides the answer to your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Ask Emacs.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-07T17:58:06.720" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8053" PostTypeId="2" ParentId="8051" CreationDate="2015-02-07T18:00:10.587" Score="4" Body="&lt;p&gt;Have you tried &lt;code&gt;check-parens&lt;/code&gt; itself for this?  The doc string (&lt;code&gt;C-h f check-parens&lt;/code&gt;) tells you that it should work:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;check-parens is an interactive compiled Lisp function in `lisp.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(check-parens)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Check for unbalanced parentheses in the current buffer.&#xA;  More accurately, check the narrowed part of the buffer for &lt;strong&gt;unbalanced&#xA;  expressions (&quot;sexps&quot;) in general&lt;/strong&gt;.  This is done according to the&#xA;  &lt;strong&gt;current syntax table&lt;/strong&gt; and will find &lt;strong&gt;unbalanced brackets or quotes&lt;/strong&gt; as&#xA;  appropriate.  (See Info node `(emacs)Parentheses'.)  If imbalance is&#xA;  found, an error is signaled and point is left at the first unbalanced&#xA;  character.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That tells you that it checks for unbalances sexps. If the syntax table for your current mode defines brackets and braces as sexp-balancing characters, then it should work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also the cross-reference in the doc string to the relevant part of the Emacs manual. Just click that cross-reference to read that manual section for more information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question title says &quot;&lt;em&gt;in an arbitrary mode&lt;/em&gt;&quot;. The behavior of &lt;code&gt;check-parens&lt;/code&gt; is mode-specific. As its doc says, it checks for sexps that are unbalanced, as determined by the characters that, for that mode, balance sexps.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now you've edited your question to make it clear that you want something that is not mode-specific. The answer to that is &lt;strong&gt;&lt;em&gt;no&lt;/em&gt;&lt;/strong&gt;. There can be no mode non-specific checking for balance because &lt;em&gt;the notion of &quot;&lt;strong&gt;balanced&lt;/strong&gt;&quot; is by definition mode-specific&lt;/em&gt;, i.e., specific to the particular syntax.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-02-07T18:10:24.473" LastActivityDate="2015-02-07T18:10:24.473" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8054" PostTypeId="1" CreationDate="2015-02-07T18:04:53.890" Score="2" ViewCount="246" Body="&lt;p&gt;I know how to set coloring for an interactive R session in ESS + Emacs for all numbers.  Is there a way to drill down further and set different colors for negative numbers?&lt;/p&gt;&#xA;" OwnerUserId="5384" LastEditorUserId="105" LastEditDate="2015-02-07T18:15:08.227" LastActivityDate="2019-03-13T13:30:22.483" Title="ESS Syntax Highlighting for Negative Numbers?" Tags="|syntax-highlighting|ess|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8055" PostTypeId="2" ParentId="8041" CreationDate="2015-02-07T18:13:08.127" Score="13" Body="&lt;p&gt;thanks to mutbuerger for the helpful comments. Currently, I use this for this operator to work with ESS only. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun then_R_operator ()&#xA;  &quot;R - %&amp;gt;% operator or 'then' pipe operator&quot;&#xA;  (interactive)&#xA;  (just-one-space 1)&#xA;  (insert &quot;%&amp;gt;%&quot;)&#xA;  (reindent-then-newline-and-indent))&#xA;(define-key ess-mode-map (kbd &quot;C-%&quot;) 'then_R_operator)&#xA;(define-key inferior-ess-mode-map (kbd &quot;C-%&quot;) 'then_R_operator)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2017-05-16T15:36:39.803" LastActivityDate="2017-05-16T15:36:39.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8056" PostTypeId="1" AcceptedAnswerId="8065" CreationDate="2015-02-07T21:17:05.087" Score="7" ViewCount="717" Body="&lt;p&gt;Shifting from Rstudio to ESS took some time with me because of the steep learning curve of a versatile Emacs editor, but is was a worthwhile experience. What I am still missing in ESS is that outline or overview of the R script file based on comments (called sections in Rstudio) by pressing &lt;code&gt;Ctrl+Shift+R&lt;/code&gt; to give &lt;code&gt;# some comments or title here&lt;/code&gt; (see the screenshot).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qczYi.png&quot; alt=&quot;enter image description here&quot;&gt;    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After having a lot of sections and the file size becomes very large, it becomes increasingly difficult to navigate throughout a giant multi-section file. In Rstudio I press that orange button &lt;code&gt;#&lt;/code&gt; to pop up a small window of all sections or &lt;code&gt;#&lt;/code&gt; comments and by &lt;strong&gt;clicking&lt;/strong&gt; any one of them will put me on that heading in the file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar thing I found in AUCTeX is the &lt;code&gt;C-c =&lt;/code&gt; which will show an outline clickable table to navigate that &lt;code&gt;.tex&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to obtain this handy overview in ESS?  &lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="105" LastEditDate="2017-07-20T21:57:40.540" LastActivityDate="2017-07-20T21:57:40.540" Title="How to implement comments outline in ESS similar to that of Rstudio?" Tags="|ess|comment|r|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8057" PostTypeId="1" AcceptedAnswerId="8060" CreationDate="2015-02-07T21:31:19.323" Score="2" ViewCount="446" Body="&lt;p&gt;I'm just getting started with &lt;code&gt;outshine&lt;/code&gt;, and I'm trying to enable outshine's keybindings, but I am stumped by the directive in &lt;a href=&quot;https://github.com/tj64/outshine&quot; rel=&quot;nofollow&quot;&gt;the readme&lt;/a&gt; to&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...set the outshine prefix (M-#) in your init file before (!) outline-mode is loaded to enable the outshine keybindings&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't know how to know when outline-mode is loaded. It's a built-in mode, so I don't mention it in my dotemacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'outshine)&#xA;(setq outline-minor-mode-prefix &quot;\M-#&quot;)&#xA;(setq outshine-use-speed-commands t)&#xA;(add-hook 'outline-minor-mode-hook 'outshine-hook-function)&#xA;(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)&#xA;(add-hook 'LaTeX-mode-hook 'outline-minor-mode)&#xA;(add-hook 'text-mode-hook 'outline-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm also not sure if fixing this issue will create the situation I'm hoping for. The outshine &lt;em&gt;readme&lt;/em&gt; says that outshine uses functionality from &lt;a href=&quot;https://github.com/jwiegley/nxhtml/blob/master/nxhtml/outline-magic.el&quot; rel=&quot;nofollow&quot;&gt;outline-magic.el&lt;/a&gt;, where subtrees can be moved with &lt;code&gt;M-up&lt;/code&gt; and &lt;code&gt;M-down&lt;/code&gt; (as in org-mode). That's what I'm hoping for.&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2096" LastEditDate="2015-04-28T19:13:31.603" LastActivityDate="2015-04-28T19:13:31.603" Title="Trying to enable keybindings for 'outshine': &quot;set before outline-mode is loaded&quot;" Tags="|outline-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8058" PostTypeId="1" AcceptedAnswerId="8059" CreationDate="2015-02-07T22:07:37.133" Score="2" ViewCount="1020" Body="&lt;p&gt;Looking at the documentation for shell-command (M-!) I see there are two optional arguments, OUTPUT-BUFFER, and ERROR-BUFFER. But when I type M-! it only asks me for the shell command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I supply a value for OUTPUT-BUFFER and ERROR-BUFFER?&lt;/p&gt;&#xA;" OwnerUserId="5440" LastActivityDate="2015-02-07T22:24:39.500" Title="how to give optional arguments to commands" Tags="|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8059" PostTypeId="2" ParentId="8058" CreationDate="2015-02-07T22:09:51.100" Score="6" Body="&lt;p&gt;Remember that &quot;commands&quot; are just functions, and can be called as such. You can do this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(shell-command &quot;ls&quot; &amp;lt;arg1here&amp;gt; &amp;lt;arg2here&amp;gt;)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to create new buffers, you'll need a bit more lisp.&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(shell-command &quot;ls&quot; &#xA;  (generate-new-buffer &quot;ls-stdout&quot;) &#xA;  (generate-new-buffer &quot;ls-stderr&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if you do this often, you might even make a keybinding:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun shell-command-with-buffers (command output-buffer-name error-buffer-name)&#xA;  (interactive &quot;Mshell command: \nBoutput buffer name: \nBerror buffer name: &quot;)&#xA;  (shell-command command &#xA;    (generate-new-buffer output-buffer-name) &#xA;    (generate-new-buffer error-buffer-name)))&#xA;&#xA;(global-set-key (kbd &quot;C-M-!&quot;) #'shell-command-with-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also of note, &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;M-!&lt;/kbd&gt; inserts the output and error at the current point.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-02-07T22:24:39.500" LastActivityDate="2015-02-07T22:24:39.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8060" PostTypeId="2" ParentId="8057" CreationDate="2015-02-07T22:34:42.873" Score="2" Body="&lt;p&gt;You can use the &lt;code&gt;M-x customize&lt;/code&gt; interface and set the value of &lt;code&gt;outline-minor-mode-prefix&lt;/code&gt; to &lt;code&gt;&quot;\M-#&quot;&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-08T03:28:07.333" LastActivityDate="2015-02-08T03:28:07.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8061" PostTypeId="1" AcceptedAnswerId="12794" CreationDate="2015-02-07T22:46:16.533" Score="16" ViewCount="3321" Body="&lt;p&gt;So I'm looking to have &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot;&gt;&lt;code&gt;helm-swoop&lt;/code&gt;&lt;/a&gt; look at &lt;em&gt;all&lt;/em&gt; files in a project,&#xA;not just the current set of open buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is so I can use swoop to find all occurrences in a project, mark relevant ones, then edit them (in helm swoops edit mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that there's probably a clean way to do this with Helm/Helm swoop&#xA;but here's my attempt to think through a solution:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;gather filenames from projectile&lt;/li&gt;&#xA;&lt;li&gt;create a list of buffers from the filename list&lt;/li&gt;&#xA;&lt;li&gt;do the same routine as helm-multi-swoop-all besides using this new buffer list&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(projectile-current-project-files)&lt;/code&gt;, looks like it gives me the file list I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;helm-multi-swoop-all&lt;/code&gt;, looks like it'd be fairly easy to copy and then tweak.&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-multi-swoop-all (&amp;amp;optional $query)&#xA;  (interactive)&#xA;  &quot;Apply all buffers to helm-multi-swoop&quot;&#xA;  (cond ($query&#xA;         (setq helm-multi-swoop-query $query))&#xA;        (mark-active&#xA;         (let (($st (buffer-substring-no-properties&#xA;                     (region-beginning) (region-end))))&#xA;           (if (string-match &quot;\n&quot; $st)&#xA;               (message &quot;Multi line region is not allowed&quot;)&#xA;             (setq helm-multi-swoop-query&#xA;                   (helm-swoop-pre-input-optimize $st)))))&#xA;        ((setq helm-multi-swoop-query&#xA;               (helm-swoop-pre-input-optimize&#xA;                (funcall helm-swoop-pre-input-function))))&#xA;        (t (setq helm-multi-swoop-query &quot;&quot;)))&#xA;  (helm-multi-swoop--exec nil&#xA;                          :$query helm-multi-swoop-query&#xA;                          :$buflist (helm-multi-swoop--get-buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just replace the call to &lt;code&gt;helm-multi-swoop--get-buffer-list&lt;/code&gt;,&#xA;to one that provided a list of buffers using projectiles list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I'm a little stuck.&#xA;I'm not sure how to create a list of buffers to feed into helm-swoop from a set of file names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also can't help but think there's a simpler way to achieve this, maybe without custom functions. &lt;/p&gt;&#xA;" OwnerUserId="4090" LastEditorUserId="8406" LastEditDate="2015-05-29T20:34:25.807" LastActivityDate="2015-06-24T10:09:14.070" Title="Helm swoop on all project files (not just current buffers)" Tags="|buffers|helm|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="8063" PostTypeId="2" ParentId="8045" CreationDate="2015-02-08T00:45:04.880" Score="6" Body="&lt;p&gt;Thanks much @glucas, I've worked your solution into my final one. The key information was knowing the format of the RFLOC. I did experiment with&#xA;providing a list of filename and headline text, but I was missing those other elements, and the extra nil. This is what I ended up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jay/refile-to (file headline)&#xA;    &quot;Move current headline to specified location&quot;&#xA;    (let ((pos (save-excursion&#xA;                 (find-file file)&#xA;                 (org-find-exact-headline-in-buffer headline))))&#xA;      (org-refile nil nil (list headline file nil pos))))&#xA;&#xA;(defun jay/refile-to-bookmarks ()&#xA;    &quot;Move current headline to bookmarks&quot;&#xA;    (interactive)&#xA;    (org-mark-ring-push)&#xA;    (jay/refile-to &quot;~/Org/bookmarks.org&quot; &quot;New&quot;)&#xA;    (org-mark-ring-goto))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The doc for &lt;code&gt;save-excursion&lt;/code&gt; states that we will be returned to the location that we started from, but it does not seem to work that way. It leaves me in the target destination, which might be proper for the general &lt;code&gt;refile-to&lt;/code&gt;, but I wanted to just have it move the line and remain where I was so I save and restore within &lt;code&gt;refile-to-bookmark&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The workflow that this is meant for is that I start with a list of HTML links that come from my script for reading RSS feeds. I originally had the script produce maildir files for mu4e, but found myself just following the links to a browser anyway and then bookmarking the ones of interest, so now I just generate a list of &lt;code&gt;** [[uri][title]]&lt;/code&gt; lines. After I follow the link from emacs to the uzbl browser, instead of bookmarking (which generates the same form of lines) I use this command to move the link to my bookmarks.org after setting tags. Just a bit faster since I also use the org speed-commands, &lt;code&gt;t&lt;/code&gt; to tag and &lt;code&gt;b&lt;/code&gt; for this command. I'm happy now and love to learn more elisp!&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-02-08T00:45:04.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8064" PostTypeId="2" ParentId="7852" CreationDate="2015-02-08T00:53:30.697" Score="1" Body="&lt;p&gt;I've extended wasamasa's answer to include additional information:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion&#xA;  (let ((tem eval-buffer-list))&#xA;    (while (and tem&#xA;                (re-search-forward &quot;^  eval-\\(buffer\\|region\\)(&quot; nil t))&#xA;      (beginning-of-line)&#xA;      (insert (apply 'format &quot;Error at line %d, column %d (point %d) in %s\n&quot;&#xA;                     (with-current-buffer (car tem)&#xA;                       (list (line-number-at-pos (point))&#xA;                             (current-column)&#xA;                             (point)&#xA;                             (buffer-name)))))&#xA;      (pop tem))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2631" LastEditorUserId="2631" LastEditDate="2015-02-08T03:05:33.493" LastActivityDate="2015-02-08T03:05:33.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8065" PostTypeId="2" ParentId="8056" CreationDate="2015-02-08T02:01:34.303" Score="6" Body="&lt;p&gt;I like &lt;code&gt;orgstruct-mode&lt;/code&gt;.  In the following file you can collapse headings with &lt;code&gt;Tab&lt;/code&gt; or &lt;code&gt;S-Tab&lt;/code&gt;, much like in &lt;code&gt;org-mode&lt;/code&gt;.  Note that the &lt;code&gt;eval&lt;/code&gt; part below collapsed the file to out-most level when opening the file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;##* sec1&#xA;x &amp;lt;- rnorm(10)&#xA;##** sec11&#xA;y &amp;lt;- x&amp;lt;0&#xA;##* sec 2&#xA;z &amp;lt;- x + y&#xA;&#xA;## Local Variables:&#xA;## outline-regexp: &quot;##*\\*+\\|\\`&quot;&#xA;## orgstruct-heading-prefix-regexp: &quot;##*\\*+\\|\\`&quot;&#xA;## eval: (progn (orgstruct-mode) (org-global-cycle 3))&#xA;## End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2015-02-09T11:00:25.033" LastActivityDate="2015-02-09T11:00:25.033" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8066" PostTypeId="1" AcceptedAnswerId="8154" CreationDate="2015-02-08T06:52:37.143" Score="2" ViewCount="1959" Body="&lt;p&gt;By default, &lt;a href=&quot;http://www.emacswiki.org/emacs/SrSpeedbar&quot; rel=&quot;nofollow&quot;&gt;sr-speedbar&lt;/a&gt; seems to always want to take 50% of available window space.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to change it's default size to something smaller (like 40 px), but I can't seem to figure out how as the option &lt;code&gt;sr-speedbar-width-x&lt;/code&gt; doesn't seem to do anything.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a snippet from my init.el.  All the other options are working just fine&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq &#xA;    sr-speedbar-width-x 40&#xA;    speedbar-use-images nil&#xA;    speedbar-show-unknown-files t&#xA;    sr-speedbar-right-side nil&#xA;    )&#xA;&#xA;(when window-system&#xA;    (sr-speedbar-open))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5429" LastActivityDate="2015-02-11T15:44:42.760" Title="sr-speedbar width size options on start not working" Tags="|init-file|window|speedbar|start-up|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8067" PostTypeId="1" AcceptedAnswerId="8071" CreationDate="2015-02-08T09:28:11.627" Score="5" ViewCount="476" Body="&lt;p&gt;Are there some Emacs' packages which can be used for analysing the frequency of the characters and the words used in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a particular example it would be interesting to have a mechanism for sorting the frequency of the characters of a given buffer.&#xA;For example if the content of a buffer is &lt;code&gt;This is a test.&lt;/code&gt; the sorted frequency will be as below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t 3&#xA;s 3&#xA;i 2&#xA;a 1&#xA;e 1&#xA;h 1&#xA;. 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="50" LastEditDate="2015-02-08T10:12:54.813" LastActivityDate="2015-02-14T06:13:26.580" Title="How to obtain the statistics of the frequency of characters in a buffer" Tags="|elisp|text|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8068" PostTypeId="1" AcceptedAnswerId="10205" CreationDate="2015-02-08T10:52:14.117" Score="22" ViewCount="29400" Body="&lt;p&gt;I am on a mac and I am running emacs 24.4.1, but I have the same problem also with 22.1.1. When I open mac on a terminal on the remote host, it does not recognise option key (alt) like the meta key. I have modified the &lt;code&gt;.emacs&lt;/code&gt; in the following way&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mac-option-key-is-meta nil&#xA;      mac-command-key-is-meta t&#xA;      mac-command-modifier 'meta&#xA;      mac-option-modifier 'none)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so I have tried to change the meta key to command, but also in this case the meta key doest work .  This only work on the X version of emacs (when I open emacs in a new window), both with the option as meta key that as command as meta key. This is a problem I have with emacs in the terminal-only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I don't know how to run commands in emacs! is there any keybinding I can use? &lt;/p&gt;&#xA;" OwnerUserId="5445" LastEditorUserId="25" LastEditDate="2015-04-19T14:07:20.160" LastActivityDate="2021-08-04T03:44:04.800" Title="emacs on terminal does not recognise option as alt-key on mac" Tags="|osx|terminal-emacs|input-method|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8069" PostTypeId="1" CreationDate="2015-02-08T14:00:22.647" Score="12" ViewCount="1377" Body="&lt;p&gt;I want to define a log in function in my init script, but I don't want to hardcode my login credentials. I think a good workaround is to have my init script read in my login credentials from a local file and save these values as variables. That way, I can exclude the file from my git index, which keeps my login credentials secure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any suggestions on this approach, or ways to set an argument to a value that is defined in a file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I would like to use the following in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Set up our login variables here:&#xA;(setq file-location &quot;~/.emacs.d/.login&quot;)&#xA;(setq erc-username &quot;default-name&quot;)&#xA;(setq erc-password &quot;default-password&quot;)&#xA;(setq erc-url &quot;default-url&quot;)&#xA;(setq erc-port &quot;default-port&quot;)&#xA;(defun read-lines (filePath)&#xA;  &quot;Return a list of lines of a file at filePath.&quot;&#xA;  (with-temp-buffer&#xA;    (insert-file-contents filePath)&#xA;    (split-string (buffer-string) &quot;\n&quot; t)))&#xA;(if (file-exists-p file-location)&#xA;    (progn (setq login-credentials (read-lines file-location))&#xA;           (setq erc-username (nth 0 login-credentials))&#xA;           (setq erc-password (nth 1 login-credentials))&#xA;           (setq erc-url (nth 2 login-credentials))&#xA;           (setq erc-port (nth 3 login-credentials)))&#xA;    (message &quot;No ERC login credentials provided. Please add login credentials as '&amp;lt;username&amp;gt;\n&amp;lt;password&amp;gt;\n&amp;lt;url&amp;gt;\n&amp;lt;port&amp;gt;' in ~/.emacs.d/.login to activate ERC mode.&quot;))&#xA;&#xA;;; These message the values from my file correctly.&#xA;;; Everything up to this point works as expected&#xA;(message erc-username) &#xA;(message erc-password)&#xA;(message erc-url)&#xA;(message erc-port)&#xA;&#xA;;; Use our login variables here &#xA;;; This doesn't work because the 'quote' function prevents evaluation of my variables, and a 'backquote' did not resolve it either&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(markdown-command &quot;/usr/bin/pandoc&quot;)&#xA; '(tls-program (quote (&quot;openssl s_client -connect %h:%p -no_ssl2 -ign_eof -CAfile ~/.ssl/spi_ca.pem -cert ~/.ssl/znc.pem&quot;)))&#xA; '(znc-servers (quote ((,erc-url ,erc-port t ((irc\.freenode\.net ,erc-username ,erc-password)))))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that my example uses the &lt;code&gt;znc.el&lt;/code&gt; module &lt;a href=&quot;http://www.emacswiki.org/emacs/ErcZNC&quot;&gt;here&lt;/a&gt;. I am modifying the autogenerated code resulting from the Emacs configs in &lt;code&gt;M-x customize-group RET znc RET&lt;/code&gt; and &lt;code&gt;M-x customize-variable RET tls-program RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My issue with the above code is that the variables are not loading inside my &lt;code&gt;custom-set-variables&lt;/code&gt; function above. Loading the proper values from a file seems to work fine, but I can't seem to use them as an argument. I believe this is related to the &lt;code&gt;quote&lt;/code&gt; function, which prevents evaluation of its contents. I attempted a 'backquote' (&lt;code&gt;,&lt;/code&gt;) to force evaluation, but it is not working either. Any suggestions to fix this bug or offering another approach would be very helpful.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-02-08T14:50:07.763" LastActivityDate="2018-04-11T22:44:16.727" Title="Elisp: How to exclude sensitive information from an init file? (ie login credentials)" Tags="|init-file|files|variables|erc|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8070" PostTypeId="2" ParentId="8069" CreationDate="2015-02-08T14:59:59.080" Score="6" Body="&lt;p&gt;&lt;code&gt;custom-set-variables&lt;/code&gt; is weird – I'm not 100% sure it can handle cases like this.  You may try &lt;code&gt;(eval `(custom-set-variables … (erc-password … ,(special-value) …) …)&lt;/code&gt;, but that strikes me as a dirty hack-around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just put the extra information in a file with the &lt;code&gt;gpg&lt;/code&gt; extension, save it, give a password, and then load the file.  You'll have to put the password for the file in when you load it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, create a file &lt;code&gt;sensitive.el.gpg&lt;/code&gt; with the contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;Hello, there!&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Save the file, press (or tab over to) &lt;code&gt;[OK]&lt;/code&gt;, and give your password.  Don't worry – it will ask for confirmation before saving it.  Then, in your init file, give&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;sensitive.el.gpg&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will load the file on startup, requiring you to enter your password so Emacs can decrypt the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to enter your password on startup, I'd give the function a name to run manually:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:keys () (interactive) (load &quot;sensitive.el.gpg&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-02-08T15:07:49.580" LastActivityDate="2015-02-08T15:07:49.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8071" PostTypeId="2" ParentId="8067" CreationDate="2015-02-08T16:31:07.577" Score="8" Body="&lt;p&gt;I don't know of such built-in function, but here's something I could put together while waiting for compilation to finish:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun char-stats (&amp;amp;optional case-sensitive)&#xA;  (interactive &quot;P&quot;)&#xA;  (message &quot;case-sensitive: %s&quot; case-sensitive)&#xA;  (let ((chars (make-char-table 'counting 0)) &#xA;        current)&#xA;    (cl-labels ((%collect-statistics&#xA;                 ()&#xA;                 (goto-char (point-min))&#xA;                 (while (not (eobp))&#xA;                   (goto-char (1+ (point)))&#xA;                   (setf current (preceding-char))&#xA;                   (set-char-table-range&#xA;                    chars current&#xA;                    (1+ (char-table-range chars current))))))&#xA;      (if case-sensitive&#xA;          (save-excursion (%collect-statistics))&#xA;        (let ((contents (buffer-substring-no-properties&#xA;                         (point-min) (point-max))))&#xA;          (with-temp-buffer&#xA;            (insert contents)&#xA;            (upcase-region (point-min) (point-max))&#xA;            (%collect-statistics)))))&#xA;    (with-current-buffer (get-buffer-create &quot;*character-statistics*&quot;)&#xA;      (erase-buffer)&#xA;      (insert &quot;| character | occurences |&#xA;               |-----------+------------|\n&quot;)&#xA;      (map-char-table&#xA;       (lambda (key value)&#xA;         (when (and (numberp key) (not (zerop value)))&#xA;           (cl-case key&#xA;             (?\n)&#xA;             (?\| (insert (format &quot;| \\vert | %d |\n&quot; value)))&#xA;             (otherwise (insert (format &quot;| '%c' | %d |\n&quot; key value))))))&#xA;       chars)&#xA;      (org-mode)&#xA;      (indent-region (point-min) (point-max))&#xA;      (goto-char 100)&#xA;      (org-cycle)&#xA;      (goto-char 79)&#xA;      (org-table-sort-lines nil ?N))&#xA;    (pop-to-buffer &quot;*character-statistics*&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-02-08T18:14:01.863" LastActivityDate="2015-02-08T18:14:01.863" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8072" PostTypeId="2" ParentId="8069" CreationDate="2015-02-08T19:18:57.850" Score="12" Body="&lt;p&gt;Emacs comes with &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/auth.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;auth-source.el&lt;/code&gt;&lt;/a&gt;.  I would not try to roll my own version of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;auth-source&lt;/code&gt; makes it easy to read from &lt;code&gt;~/.authinfo.gpg&lt;/code&gt;.  Good programs will already support &lt;code&gt;authinfo&lt;/code&gt;.  A quick search suggests that ERC &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/erc/Connecting.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;can use &lt;code&gt;authinfo&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your random off &lt;strike&gt;the shelf&lt;/strike&gt; MELPA programs you can easily use authinfo to retrieve your password from &lt;code&gt;~/.authinfo.gpg&lt;/code&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'random-mode&#xA;  (require 'auth-source)&#xA;  (let ((auth (nth 0 (auth-source-search :host &quot;secrets.com&quot;&#xA;                                         :requires '(user secret)))))&#xA;    (setq random-psk (funcall (plist-get auth :secret))&#xA;          random-user (plist-get auth :user))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;~/.authinfo.gpg&lt;/code&gt; holds the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## Used by random-mode.el&#xA;machine secrets.com login rasmus password my-secret-password&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course the sense of security is a lie.  Your password is now stored in plaintext in a variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;random-psk =&amp;gt; &quot;my-secret-password&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But at least it isn't in some git-repo or dropbox somewhere!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have got a keyring of some sort you might be able to get credentials from there using the Secret Service API (see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/auth.html#Secret-Service-API&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;(info &quot;(auth) Secret Service API&quot;)&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2018-04-11T22:44:16.727" LastActivityDate="2018-04-11T22:44:16.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8073" PostTypeId="1" AcceptedAnswerId="8075" CreationDate="2015-02-08T21:14:38.283" Score="15" ViewCount="652" Body="&lt;p&gt;The sheer number of backslashes my regexps require is pretty crazy. Does elisp have regexp literals, so I can write something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rx&quot;some\(regexp\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;some\\(regexp\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2707" LastActivityDate="2015-02-09T16:55:50.463" Title="Does elisp have regexp literals?" Tags="|elisp|regular-expressions|syntax|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8074" PostTypeId="1" CreationDate="2015-02-08T22:40:54.780" Score="12" ViewCount="2975" Body="&lt;p&gt;I use projectile for my project browsing. I have seen that it's really slow, so I turned on caching. Now it's fast (not blazingly fast, sadly).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I create a new file outside emacs itself, projectile doesn't find it. I can run cache invalidation but that takes a few minutes. How to fix this?&lt;/p&gt;&#xA;" OwnerUserId="367" LastEditorUserId="14920" LastEditDate="2019-05-30T18:34:57.880" LastActivityDate="2019-05-30T18:34:57.880" Title="Projectile with caching doesn't like new files" Tags="|projectile|project|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="8075" PostTypeId="2" ParentId="8073" CreationDate="2015-02-08T22:40:57.740" Score="13" Body="&lt;p&gt;One option is to use the &lt;code&gt;rx&lt;/code&gt; macro to construct your expressions using sexps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your example becomes &lt;code&gt;(rx &quot;some&quot; (group &quot;regexp&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a couple more examples from the commentary section in rx.el, to get an idea of how &lt;code&gt;rx&lt;/code&gt; works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;code&gt;^;;\\s-*\n\\|^\n&lt;/code&gt;&#xA;becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rx (or (and line-start &quot;;;&quot; (0+ space) ?\n)&#xA;        (and line-start ?\n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This &lt;code&gt;[ \t\n]*:\\([^:]+\\|$\\)&lt;/code&gt;&#xA;becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rx (and (zero-or-more (in &quot; \t\n&quot;)) &quot;:&quot;&#xA;         (submatch (or line-end (one-or-more (not (any ?:)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-09T13:14:05.583" LastActivityDate="2015-02-09T13:14:05.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8077" PostTypeId="1" CreationDate="2015-02-08T22:48:51.113" Score="3" ViewCount="533" Body="&lt;p&gt;My Emacs started to crash a lot without modifying &lt;code&gt;.emacs&lt;/code&gt; or installing anything new.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can replicate the steps (using Helm, Projectile) by this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;helm-projectile&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;then I enter a query quickly and hit backspace&lt;/li&gt;&#xA;&lt;li&gt;I have a crash.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Crashing.html&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs Crash page&lt;/a&gt; I should find a crash log but I am unable to find it in OSX. The OSX crash dump itself is useless for me. I would like to know what in my &lt;code&gt;.emacs&lt;/code&gt; is wrong or which plug-in is failing?&lt;/p&gt;&#xA;" OwnerUserId="367" LastEditorUserId="5143" LastEditDate="2015-02-17T06:55:01.577" LastActivityDate="2015-02-17T06:55:01.577" Title="Emacs crashing on OSX, no crash log file" Tags="|helm|projectile|crash|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8078" PostTypeId="1" AcceptedAnswerId="8089" CreationDate="2015-02-09T00:37:01.587" Score="7" ViewCount="4749" Body="&lt;h1&gt;my usecase&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I'm currently running GNU Emacs version=24.3.1 graphically (i.e., under GNOME/X though started from a script invoked from a &lt;code&gt;gnome-terminal&lt;/code&gt; running bash) on a Debian Linux. Just now I was using commandline &lt;a href=&quot;http://abcde.einval.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;abcde&lt;/code&gt;&lt;/a&gt; to rip audio CDs when its terminal suddenly opened an instance of &lt;a href=&quot;https://en.wikipedia.org/wiki/Vi&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Editor Which Must Not Be Named&lt;/a&gt; (to resolve an MP3 tagging question). I realized that, when I setup the box I'm currently using, I failed to set either of the bash environment variables &lt;code&gt;EDITOR&lt;/code&gt; or &lt;code&gt;VISUAL&lt;/code&gt; in my &lt;code&gt;.bashrc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;what I want&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I nearly always have an graphical/X instance of Emacs running. If I'm &lt;strong&gt;not&lt;/strong&gt; running Emacs, I probably have a good reason not to (e.g., a problem with my config files, or that I'm running in a tty). So I'm wondering, how to set &lt;code&gt;EDITOR&lt;/code&gt; or &lt;code&gt;VISUAL&lt;/code&gt; so that an application that wants to open an editor does one of the following, in descending order of preference:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If I already have an instance of Emacs running (i.e., &lt;code&gt;pgrep -l emacs | wc -l&lt;/code&gt; -&gt; &lt;code&gt;1&lt;/code&gt;): open the thing to be edited in a new buffer in the running Emacs.&lt;/li&gt;&#xA;&lt;li&gt;If I do not have an instance of Emacs running (i.e., &lt;code&gt;pgrep -l emacs | wc -l&lt;/code&gt; -&gt; &lt;code&gt;0&lt;/code&gt;): start a new instance of &lt;code&gt;emacs -nw -q&lt;/code&gt; in the terminal.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If I can't get both those preferences, or if there's a reason why I should deprecate one or both, feel free to recommend Something Completely Different.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;solution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacsclient&lt;/code&gt; is finicky about its arguments (&lt;strong&gt;TODO:&lt;/strong&gt; put a bug on it!), but that can be worked-around:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Per &lt;a href=&quot;https://emacs.stackexchange.com/a/8089/5444&quot;&gt;Francesco's suggestion&lt;/a&gt; I made &lt;code&gt;~/bin/emacs-nw-q.sh&lt;/code&gt; (and of course set mode=executable)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;### Purely for use with `emacsclient`: see https://emacs.stackexchange.com/a/8089/5444&#xA;emacs -nw -q $@&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Added a stanza to the end of my &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export ALTERNATE_EDITOR=&quot;${HOME}/bin/emacs-nw-q.sh&quot;&#xA;  export EDITOR='emacsclient'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;With this, and&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a running &quot;emacs+server&quot; (i.e., a previously-running graphical Emacs, in which I have done &lt;code&gt;M-x server-start&lt;/code&gt;): an edit-seeking application successfully opens a buffer in the running emacs on the desired file, and killing that buffer unpauses the edit-seeking application.&lt;/li&gt;&#xA;&lt;li&gt;no running emacs+server: an edit-seeking application opens a &quot;bare-bones&quot; Emacs in its same terminal, as desired, with a buffer open to the desired file, and killing that buffer returns control to the edit-seeking application.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;how I failed&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I'm putting a stanza at the end of my &lt;code&gt;.bashrc&lt;/code&gt;: each of the stanzas I've tried is listed below, with the resulting error. To test each stanza, after I [edit, save] &lt;code&gt;.bashrc&lt;/code&gt; (via &lt;code&gt;emacs -nw -q ~/.bashrc&lt;/code&gt; in a separate &lt;code&gt;gnome-terminal&lt;/code&gt; tab), I open a fresh &lt;code&gt;gnome-terminal&lt;/code&gt; tab to exercise it.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With a running emacs (and after &lt;code&gt;M-x server-start&lt;/code&gt;), following fails with &lt;code&gt;emacsclient: unrecognized option '-''&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR=&quot;emacsclient --alternate-editor='emacs -nw -q'&quot;&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With a running emacs+server, following fails with &lt;code&gt;emacsclient: unrecognized option '-&quot;'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR='emacsclient --alternate-editor=&quot;emacs -nw -q&quot;'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With no running emacs, following fails with &lt;code&gt;emacsclient: error executing alternate editor &quot;&quot;emacs&quot;&quot;&lt;/code&gt;. So I guess &lt;code&gt;--alternate-editor&lt;/code&gt; just won't take a quoted argument?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR='emacsclient --alternate-editor=&quot;emacs&quot;'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With no running emacs, following starts a brand-new graphical emacs with everything (including full &lt;code&gt;desktop&lt;/code&gt;, which I don't want for this usecase) ... but it gets worse: after I save and kill the buffer opened by the caller app, that caller app just sits there!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR='emacsclient --alternate-editor=emacs'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With no running emacs, following fails with &lt;code&gt;emacsclient: error executing alternate editor &quot;&quot;&quot;&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR='emacsclient --alternate-editor=&quot;&quot;' # sorta suggested by erikstokes at above link&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With no running emacs, following fails with &lt;code&gt;emacsclient: error executing alternate editor &quot;&quot;&quot;&quot;&lt;/code&gt; (i.e., same as previous)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR='emacsclient -a&quot;&quot;'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With no running emacs, following fails with &lt;code&gt;emacsclient: error executing alternate editor &quot;''&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR=&quot;emacsclient -a''&quot;&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With no running emacs, following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export EDITOR='emacsclient'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fails with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient: No socket or alternate editor.  Please use:&#xA;--socket-name&#xA;--server-file      (or environment variable EMACS_SERVER_FILE)&#xA;--alternate-editor (or environment variable ALTERNATE_EDITOR)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With no running emacs, following fails with &lt;code&gt;emacsclient: error executing alternate editor &quot;emacs -nw -q&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export ALTERNATE_EDITOR='emacs -nw -q'&#xA;  export EDITOR='emacsclient'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Per &lt;a href=&quot;https://emacs.stackexchange.com/a/8089/5444&quot;&gt;Francesco's suggestion&lt;/a&gt; I made &lt;code&gt;~/bin/emacs-nw-q.sh&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;### Purely for use with `emacsclient`: see https://emacs.stackexchange.com/a/8089/5444&#xA;emacs -nw -q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and changed my &lt;code&gt;.bashrc&lt;/code&gt; stanza to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z &quot;${EDITOR}&quot; ]] ; then&#xA;  export ALTERNATE_EDITOR=&quot;${HOME}/bin/emacs-nw-q.sh&quot;&#xA;  export EDITOR='emacsclient'&#xA;fi&#xA;if [[ -n &quot;${EDITOR}&quot; &amp;amp;&amp;amp; -z &quot;${VISUAL}&quot; ]] ; then&#xA;  export VISUAL=&quot;${EDITOR}&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Good news: with running emacs (and after &lt;code&gt;M-x server-start&lt;/code&gt;), an edit-seeking application successfully opens a buffer in the running emacs on the desired file, and killing that buffer returns control to the edit-seeking application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More good news: with no running emacs+server, the edit-seeking application opens a &quot;bare-bones&quot; Emacs in its same terminal, as desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bad news: with no running emacs+server, the &quot;bare-bones&quot; Emacs does &lt;strong&gt;not&lt;/strong&gt; open the needed file in a buffer. It &lt;em&gt;does&lt;/em&gt; create the following buffers: &lt;code&gt;*GNU Emacs*&lt;/code&gt;, &lt;code&gt;*Messages*&lt;/code&gt;, &lt;code&gt;*scratch*&lt;/code&gt; ... but not the needed buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-02-09T20:15:46.867" Title="how to set environment variables={EDITOR, VISUAL} to prefer running emacs?" Tags="|linux|process|bash|system-environment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8079" PostTypeId="2" ParentId="8078" CreationDate="2015-02-09T01:02:37.817" Score="3" Body="&lt;p&gt;&lt;code&gt;emacsclient&lt;/code&gt; has a &lt;code&gt;-a&lt;/code&gt; option which lets you specify an alternate editor to use if there is not an emacs process with a running server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;emacsclient -a emacs&lt;/code&gt; may do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The alternate editor can also be specified to emacsclient via the &lt;code&gt;ALTERNATE_EDITOR&lt;/code&gt; environment variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for which of &lt;code&gt;EDITOR&lt;/code&gt; or &lt;code&gt;VISUAL&lt;/code&gt; to set: &lt;code&gt;EDITOR&lt;/code&gt; was traditionally used for line oriented editors such as &lt;code&gt;ed&lt;/code&gt; or &lt;code&gt;ex&lt;/code&gt; while &lt;code&gt;VISUAL&lt;/code&gt; was for screen oriented editors such as &lt;code&gt;emacs&lt;/code&gt; or &lt;code&gt;vi&lt;/code&gt;. Thus you probably do not have to set &lt;code&gt;EDITOR&lt;/code&gt;. I would however suggest setting both as a &quot;belt-and-suspenders&quot; measure as which variable is used is up to the program that is launching your editor, check with its documentation to find out which it would use.&lt;/p&gt;&#xA;" OwnerUserId="245" LastEditorUserId="245" LastEditDate="2015-02-09T12:09:05.090" LastActivityDate="2015-02-09T12:09:05.090" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8080" PostTypeId="1" AcceptedAnswerId="8084" CreationDate="2015-02-09T01:08:34.123" Score="5" ViewCount="6483" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'custom-theme-load-path &quot;~/.emacs.d&quot;)&#xA;(load-theme 'sanityinc-solarized-dark-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have these two lines in my .emacs file, and those theme files in the listed directory, yet emacs still does not detect the theme file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen other threads with similar issues, but none have worked for me so far, particularly with using package.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help?&lt;/p&gt;&#xA;" OwnerUserId="5451" LastEditorUserId="115" LastEditDate="2015-02-09T03:59:06.797" LastActivityDate="2015-02-12T14:27:53.987" Title="Emacs Can't Find Theme File" Tags="|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8081" PostTypeId="2" ParentId="8073" CreationDate="2015-02-09T01:15:19.280" Score="8" Body="&lt;p&gt;No it does not have regexp literals, but many find &lt;a href=&quot;https://github.com/joddie/pcre2el&quot; rel=&quot;noreferrer&quot;&gt;pcre2el&lt;/a&gt; to be a helpful alternative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically using it from elisp like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(rxt-pcre-to-elisp &quot;(abc|def)\\w+\\d+&quot;)&#xA;   ;; =&amp;gt; &quot;\\(\\(?:abc\\|def\\)\\)[_[:alnum:]]+[[:digit:]]+&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-02-09T16:55:50.463" LastActivityDate="2015-02-09T16:55:50.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8082" PostTypeId="1" AcceptedAnswerId="8083" CreationDate="2015-02-09T02:37:52.117" Score="4" ViewCount="2183" Body="&lt;p&gt;I'm trying to swap the contents of a region with the text of the same width region below it. I think I should be able to atleast correctly capture the region on the next line using the code below, assuming I can get the positions for them. Any suggestions on how I should implement &lt;code&gt;pos-at-line-col&lt;/code&gt; or is there already a function to do this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun region-selected ()&#xA;  &quot;Return a list of the currently selected region if active.&quot;&#xA;  (if (use-region-p)&#xA;      (list (region-beginning) (region-end))&#xA;    (list nil nil)))&#xA;&#xA;(defun column-number-at-pos (pos)&#xA;  &quot;Analog to line-number-at-pos.&quot;&#xA;  (save-excursion (goto-char pos) (current-column)))&#xA;&#xA;(defun tabular-swap-region-down (beg end)&#xA;  &quot;Swap the highlighted text with the same region on the next row.&quot;&#xA;  (interactive (region-selected))&#xA;  (let* ((selection (buffer-substring-no-properties beg end))&#xA;         (line      (line-number-at-pos beg))&#xA;         (bcol      (column-number-at-pos beg))&#xA;         (ecol      (column-number-at-pos end))&#xA;         (next-line (1+ line))&#xA;         (next-beg  (pos-at-line-col next-line bcol))&#xA;         (next-end  (pos-at-line-col next-line ecol))&#xA;         (next-sel  (buffer-substring-no-properties next-beg next-end)))&#xA;    (message &quot;Region: %s Beginning column: %s Ending column: %s&quot;&#xA;             next-sel (int-to-string bcol) (int-to-string ecol))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="55" LastEditorUserId="105" LastEditDate="2015-07-11T04:34:38.347" LastActivityDate="2015-07-11T04:34:38.347" Title="How to get buffer position given line number and column number?" Tags="|elisp|point|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8083" PostTypeId="2" ParentId="8082" CreationDate="2015-02-09T03:56:42.900" Score="8" Body="&lt;p&gt;Here is a version using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Lines.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;forward-line&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Columns.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;move-to-column&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pos-at-line-col (l c)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (forward-line l)&#xA;    (move-to-column c)&#xA;    (point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;next-error&lt;/code&gt;&lt;/a&gt; has to be able to do that, so you might want to start with functions parsing compilation output...&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-02-09T03:56:42.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8084" PostTypeId="2" ParentId="8080" CreationDate="2015-02-09T04:05:23.237" Score="3" Body="&lt;p&gt;If you are installing the theme using the &lt;code&gt;package.el&lt;/code&gt;, you should not set the &lt;code&gt;custom-theme-load-path&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All you need to do is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install the theme from the emacs package manager as explained in the &lt;a href=&quot;https://github.com/purcell/color-theme-sanityinc-solarized#via-elpa&quot; rel=&quot;nofollow noreferrer&quot;&gt;theme's instructions&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Put &lt;code&gt;(load-theme 'sanityinc-solarized-dark)&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The first time you load the theme (and the first time after each update of that theme), emacs will ask if you consider that theme to be safe and you hit &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;yes&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;How to install this theme step-by-step from an &lt;code&gt;emacs -Q&lt;/code&gt; session&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Eval below in the *scratch* buffer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'package)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-to-list 'package-archives&#xA;         '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x package-list-archives&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Find the theme package you want to install, &lt;code&gt;color-theme-sanityinc-solarized&lt;/code&gt; in this case.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Important Step!&lt;/strong&gt; &lt;code&gt;M-x package-initialize&lt;/code&gt; or eval &lt;code&gt;(package-initialize)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-themes&lt;/code&gt; and select the check box in front of &lt;code&gt;sanityinc-solarized-dark&lt;/code&gt; or &lt;code&gt;sanityinc-solarized-light&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Done.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;How to load this theme automatically when you restart emacs&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is a minimum-working &lt;code&gt;test-load-theme.el&lt;/code&gt; file to load this theme automatically. You need to have the theme installed using the package manager first!&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(package-initialize)&#xA;(load-theme 'sanityinc-solarized-dark t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Save above in &lt;code&gt;~/.emacs.d/test-load-theme.el&lt;/code&gt;. It is a good convention to put emacs related stuff in &lt;code&gt;~/.emacs.d&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start a fresh emacs session while loading just the above file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\emacs -Q -l ~/.emacs.d/test-load-theme.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/2112/115&quot;&gt;Related emacs.SE question&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-02-12T14:27:53.987" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="8085" PostTypeId="1" AcceptedAnswerId="8086" CreationDate="2015-02-09T06:01:19.097" Score="2" ViewCount="94" Body="&lt;p&gt;For example, I inserted many &lt;code&gt;link&lt;/code&gt; widgets like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(widget-create `(link :tag &quot;Test link&quot;&#xA;                      :button-prefix &quot;&quot;&#xA;                      :button-suffix &quot;&quot;&#xA;                      :button-face nil&#xA;                      :format &quot;%[%t\n%]&quot;&#xA;                      :help-echo &quot;&quot;&#xA;                      :action nil&#xA;                      'test))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Later I want to retrieve a specific link widget at point to modify some of its values, is it possible?&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-03-11T07:56:05.587" Title="Get widget at point" Tags="|widget|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8086" PostTypeId="2" ParentId="8085" CreationDate="2015-02-09T07:39:05.517" Score="2" Body="&lt;p&gt;I found the answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-char-property (point) 'button)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I will get the widget of type &lt;code&gt;'button&lt;/code&gt; at point. &lt;code&gt;link&lt;/code&gt; is also a widget of &lt;code&gt;'button&lt;/code&gt; type.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-02-09T07:39:05.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8087" PostTypeId="1" AcceptedAnswerId="8094" CreationDate="2015-02-09T09:08:16.253" Score="4" ViewCount="1987" Body="&lt;p&gt;I would like to use a standard desktop save file when using Emacs as a server (with Emacsclient) and use no desktop save file (or optionally, another desktop save file) when running a regular Emacs instance (no &lt;code&gt;server-start&lt;/code&gt; command).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use a fixed desktop save directory name with &lt;code&gt;desktop-save-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no direct control over where the desktop is saved (though, I think it is saved in &lt;code&gt;~/.emacs.d/.emacs.desktop&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to add the following to my Emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'desktop)&#xA;(defvar my-desktop-dir &quot;~/emacs-server&quot;)&#xA;(when (file-exists-p (desktop-full-file-name my-desktop-dir))&#xA;  (desktop-read my-desktop-dir))&#xA;(add-hook 'kill-emacs-hook (lambda () (desktop-save my-desktop-dir))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while this seems to work, I am not sure if desktop auto save will be enabled.. From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html#Saving-Emacs-Sessions&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; : &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When desktop-save-mode is &lt;strong&gt;active&lt;/strong&gt; and the desktop file exists, Emacs&#xA;  auto-saves it every desktop-auto-save-timeout seconds, if that is&#xA;  non-nil and non-zero.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so in order to make &lt;code&gt;desktop-save-mode&lt;/code&gt; active, I have to run &lt;code&gt;(desktop-save-mode 1)&lt;/code&gt; in my init file. The problem is that this command then will revert to the desktop stored in &lt;code&gt;~/.emacs.d&lt;/code&gt;, which is not desired.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-09T13:26:26.150" Title="How to use a fixed desktop save directory name with desktop-save-mode?" Tags="|init-file|desktop|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8088" PostTypeId="2" ParentId="8087" CreationDate="2015-02-09T10:16:41.147" Score="1" Body="&lt;p&gt;You should use &lt;code&gt;desktop-change-dir&lt;/code&gt; to instruct emacs to load the desktop file at a given location, and remember it for auto-save later.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-change-dir &quot;~/emacs-server&quot;)&#xA;(desktop-save-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-02-09T10:16:41.147" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8089" PostTypeId="2" ParentId="8078" CreationDate="2015-02-09T10:29:44.810" Score="6" Body="&lt;p&gt;Although it is not clearly documented in its man page, &lt;code&gt;emacsclient&lt;/code&gt; doesn't seem to accept a full command (i.e. program + arguments) as the alternate editor, only a program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could write a small shell script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;exec emacs -q -nw &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and use it as the alternate editor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export EDITOR='emacsclient -a PATH_TO_YOUR_SCRIPT'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-02-09T20:04:15.583" LastActivityDate="2015-02-09T20:04:15.583" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8090" PostTypeId="2" ParentId="8006" CreationDate="2015-02-09T10:31:43.310" Score="5" Body="&lt;p&gt;I use the following which is a mashup of the standard doxymacs based one and abo-abo's semantic based one mentioned as an answer already - this only requires semantic and yasnippet. This pre-populates some more of the yasnippet placeholders with relevant info as well compared to abo-abo 's version too.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;&lt;code&gt;&#xA;# -*- mode: snippet -*-&#xA;# name: dox&#xA;# key: dox&#xA;# type: command&#xA;# --&#xA;(unless (and (fboundp 'semantic-current-tag)&#xA;             semantic-mode)&#xA;  (error &quot;Semantic required to use dox snippet&quot;))&#xA;(let ((tag (senator-next-tag)))&#xA;  (while (or (null tag)&#xA;             (not (semantic-tag-of-class-p tag 'function)))&#xA;    (setq tag (senator-next-tag)))&#xA;  (let* ((name (semantic-tag-name tag))&#xA;         (attrs (semantic-tag-attributes tag))&#xA;         (args (plist-get attrs :arguments))&#xA;         (return-name (plist-get attrs :type))&#xA;         (idx 1))&#xA;    (if (listp return-name)&#xA;      (setq return-name (car return-name)))&#xA;    (yas/expand-snippet&#xA;     (format&#xA;      &quot;/**&#xA;* @brief ${1:%s}&#xA;*&#xA;%s&#xA;%s*/&#xA;&quot;&#xA;      name&#xA;      (mapconcat&#xA;       (lambda (x)&#xA;         (format &quot;* @param %s ${%d:Description of %s}&quot;&#xA;                 (car x) (incf idx) (car x)))&#xA;       args&#xA;       &quot;\n&quot;)&#xA;      (if (and return-name (not (string-equal &quot;void&quot; return-name)))&#xA;          (format &quot; * @return ${%d:%s}\n&quot; (incf idx) return-name)&#xA;        &quot;&quot;)))))&#xA;&lt;/code&gt;&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="144" LastActivityDate="2015-02-09T10:31:43.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8091" PostTypeId="2" ParentId="8074" CreationDate="2015-02-09T10:34:01.770" Score="5" Body="&lt;p&gt;Use the prefix argument, ie &lt;kbd&gt;C-u C-c p f&lt;/kbd&gt; to quickly invalidate and find files in project. The suggestion in the comment about using &lt;code&gt;projectile-cache-current-file&lt;/code&gt; is technically correct, but there is a hook on &lt;code&gt;find-file&lt;/code&gt; that automatically calls this on every new file that is opened. That will be the fastest solution without invalidating the existing cache.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it sounds like the real issue is it takes too long to rebuild the cache by traversing the tree. For this it would help if there was a little more information about your environment. By default &lt;code&gt;projectile-indexing-method&lt;/code&gt; is set to &lt;code&gt;'native&lt;/code&gt; on windows, which prefers an elisp implementation of &lt;code&gt;find&lt;/code&gt; as it is more portable. Otherwise it uses an &lt;code&gt;'alien&lt;/code&gt; method, ie &lt;code&gt;git ls&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, etc. If you are on linux the alien method is enabled by default though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise you might want to chase down the rabbit hole of &lt;code&gt;projectile-get-repo-files&lt;/code&gt; and &lt;code&gt;projectile-get-ext-command&lt;/code&gt;. They specify where projectile looks for the list of files. It's possible you could override this with dir-locals or the like to force a faster lookup method.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2015-02-09T10:34:01.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8092" PostTypeId="1" AcceptedAnswerId="8111" CreationDate="2015-02-09T10:46:13.100" Score="2" ViewCount="937" Body="&lt;p&gt;In a terminal window, I'm finding that company-mode completion doesn't work, whereas it does work in a graphical window. For example a down arrow inserts the text &lt;code&gt;OB&lt;/code&gt; and M-n simply inserts &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround, I've followed &lt;a href=&quot;https://emacs.stackexchange.com/a/2990/5426&quot;&gt;this answer&lt;/a&gt; to use C-n and C-p like so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'company&#xA;  (define-key company-active-map (kbd &quot;C-n&quot;) #'company-select-next)&#xA;  (define-key company-active-map (kbd &quot;C-p&quot;) #'company-select-previous))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I'd prefer to use the same keys whether I'm running graphically or via ssh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This used to work, and I've upgraded my configuration files and installed a lot more packages recently, but even reducing my initialization file down to just the company mode code didn't fix the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I've isolated the problem down to this line of code that I copied from the &lt;a href=&quot;https://github.com/rdallasgray/graphene/blob/master/graphene-editing.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;graphene&lt;/a&gt; package that redefines ESC to abort the completion.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define-key company-active-map (kbd &quot;ESC&quot;) 'company-abort)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can see how this might stop M-n and M-p working because &lt;code&gt;ESC&lt;/code&gt; has got something to do with the Alt key in emacs. I can workaround the problem in a terminal using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (display-graphic-p)&#xA;    (with-eval-after-load 'company&#xA;      (define-key company-active-map (kbd &quot;ESC&quot;) 'company-abort)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which means that single ESC aborts completion in a graphical frame, and triple ESC aborts in a terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However is it still be possible for the arrow keys to work with single ESC? My preference is to use arrow keys and single escape if possible.&lt;/p&gt;&#xA;" OwnerUserId="5426" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-02-09T21:46:13.897" Title="Arrow and M-n M-p don't work with company mode in terminal when ESC aborts completion" Tags="|key-bindings|keymap|company-mode|terminal-emacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8093" PostTypeId="1" AcceptedAnswerId="9505" CreationDate="2015-02-09T12:52:33.473" Score="1" ViewCount="1115" Body="&lt;p&gt;I'd like to understand how to retrieve the tags for a headline that is being processed by a clock mode report formula. Suppose I have a clock report table defined like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 2 :scope nil :formula &quot;$3='(headline-get-tags $1)::@2$3=string(\&quot;Tags\&quot;)&quot;                                                                       &#xA;#+END:  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can define a simple formula that returns the length of the headline, but I have yet to find an easy way to find the tags associated with the headline.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun headline-get-tags (headline)&#xA;  &quot;Return the tags for a headline&quot;&#xA;  (length headline)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to get the tags with a headline?&lt;/p&gt;&#xA;" OwnerUserId="48" LastActivityDate="2015-02-23T19:58:31.753" Title="How can I get the tags for a headline in a clock report formula?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8094" PostTypeId="2" ParentId="8087" CreationDate="2015-02-09T12:54:11.177" Score="4" Body="&lt;p&gt;Using &lt;code&gt;(setq desktop-path (list my-desktop-dir))&lt;/code&gt; before calling &lt;code&gt;(desktop-save-mode 1)&lt;/code&gt; seems to solve the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'desktop)&#xA;(setq desktop-path (list &quot;~/emacs-server&quot;))&#xA;(desktop-save-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: You will now get a question &lt;code&gt;Save desktop? (y or n)&lt;/code&gt; when killing Emacs server and this is the first time you save the desktop..&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-02-09T13:26:26.150" LastActivityDate="2015-02-09T13:26:26.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8095" PostTypeId="1" CreationDate="2015-02-09T13:05:23.980" Score="1" ViewCount="305" Body="&lt;p&gt;When I'm writing a .tex file on emacs, I like to compile with pdflatex and then see the result on an external pdf viewer. The emacs manual says that I can use &lt;code&gt;C-c C-c&lt;/code&gt; to launch any compilation method other than plain TeX, but the problem is that the default for &lt;code&gt;C-c C-c&lt;/code&gt; is doc-view. This is a minor annoyance, because typing &lt;code&gt;pdflatex [Enter]&lt;/code&gt; takes only a second, but still, I often wish that &lt;code&gt;C-c C-c&lt;/code&gt; autocompleted to pdflatex. Is there a way this can be done?&lt;/p&gt;&#xA;" OwnerUserId="5454" LastEditorUserId="253" LastEditDate="2015-02-09T14:32:56.140" LastActivityDate="2015-02-09T14:32:56.140" Title="How to disable DocView as default command in AUCTeX?" Tags="|latex|auctex|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8096" PostTypeId="2" ParentId="8013" CreationDate="2015-02-09T14:36:18.643" Score="0" Body="&lt;p&gt;multi-term already support this feature so I don't think you need to add anything to your init.el file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And according to emacswiki (&lt;a href=&quot;http://www.emacswiki.org/emacs/AnsiTermHints#toc5&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/AnsiTermHints#toc5&lt;/a&gt;), you just need to add this to your .bash_profile:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-bash prettyprint-override&quot;&gt;&lt;code&gt;function set-eterm-dir {&#xA;    echo -e &quot;\033AnSiTu&quot; &quot;$LOGNAME&quot; # $LOGNAME is more portable than using whoami.&#xA;    echo -e &quot;\033AnSiTc&quot; &quot;$(pwd)&quot;&#xA;    if [ $(uname) = &quot;SunOS&quot; ]; then&#xA;    # The -f option does something else on SunOS and is not needed anyway.&#xA;        hostname_options=&quot;&quot;;&#xA;    else&#xA;        hostname_options=&quot;-f&quot;;&#xA;    fi&#xA;    echo -e &quot;\033AnSiTh&quot; &quot;$(hostname $hostname_options)&quot; # Using the -f option can&#xA;                                                         # cause problems on some OSes.&#xA;    history -a # Write history to disk.&#xA;}&#xA;&#xA;# Track directory, username, and cwd for remote logons.&#xA;if [ &quot;$TERM&quot; = &quot;eterm-color&quot; ]; then&#xA;    PROMPT_COMMAND=set-eterm-dir&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2344" LastEditorUserId="2642" LastEditDate="2015-08-04T22:31:50.750" LastActivityDate="2015-08-04T22:31:50.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8097" PostTypeId="1" AcceptedAnswerId="8103" CreationDate="2015-02-09T14:46:33.223" Score="9" ViewCount="398" Body="&lt;p&gt;Is it possible to prevent &lt;code&gt;kill-ring&lt;/code&gt; from storing whitespaces/empty lines? Right now after I do a couple of changes and then go to &lt;code&gt;browse-kill-ring&lt;/code&gt; I often see something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-------&#xA;&#xA;&#xA;&#xA;-------&#xA;   merchant_uuid: &quot;some_uuid&quot;&#xA;-------&#xA;   it &quot;creates a webhook&quot; do&#xA;-------&#xA;&#xA;-------&#xA;&#xA;-------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way of forcing kill-ring to only append meaningful content?&lt;/p&gt;&#xA;" OwnerUserId="213" LastActivityDate="2016-06-17T20:13:54.360" Title="How do I filter kill-ring contents?" Tags="|kill-ring|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8098" PostTypeId="1" CreationDate="2015-02-09T14:52:06.947" Score="2" ViewCount="212" Body="&lt;p&gt;When I use Emacs on a Linux OS, I search through files with &lt;code&gt;rgrep&lt;/code&gt;. On Windows machine this takes some additional setup. Is there an Emacs-powered solution for searching through multiple files that does not depend on external utilities?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-02-10T19:07:34.200" Title="Emacs-native solution to searching files" Tags="|search|microsoft-windows|rgrep|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8099" PostTypeId="1" AcceptedAnswerId="12832" CreationDate="2015-02-09T15:12:37.937" Score="2" ViewCount="354" Body="&lt;p&gt;I start with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq test (propertize &quot;foobar&quot; 'face 'font-lock-keyword-face))&#xA;;;=&amp;gt; #(&quot;foobar&quot; 0 6 (face font-lock-keyword-face))&#xA;(add-face-text-property 0 3 'font-lock-type-face nil test)&#xA;test&#xA;;;=&amp;gt; &#xA;;; #(&quot;foobar&quot;&#xA;;;   0 3 (face (font-lock-type-face font-lock-keyword-face))&#xA;;;   3 6 (face font-lock-keyword-face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I'd like to remove &lt;code&gt;font-lock-type-face&lt;/code&gt; in the whole string,&#xA;while preserving &lt;code&gt;font-lock-keyword-face&lt;/code&gt; and all other possible&#xA;faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's an easy way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-07-11T04:32:27.413" LastActivityDate="2015-07-11T04:32:27.413" Title="Elisp revert add-face-text-property" Tags="|elisp|faces|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8100" PostTypeId="1" CreationDate="2015-02-09T15:46:22.953" Score="2" ViewCount="1075" Body="&lt;p&gt;I'm working on a project that is kept on a shared server (server runs Ubuntu 14.04 LTS; my machine runs OS X 10.10.2). I access the server files via Tramp using a password-secured SSH connection. Whenever I try to use Helm to navigate between files in the project I'm working on, Emacs freezes with the following message in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for [username]@[server] using scp...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs is unresponsive after this. A few minutes later, it says the connection was failed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for [username]@[host] using scp...failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It remains unresponsive at this point indefinitely. I need to kill the process or force quit the application so I can reopen it. Backtrace under &lt;code&gt;lldb&lt;/code&gt; doesn't give any useful information, probably because the program isn't really crashing - it's being terminated after becoming unresponsive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what might be going on / how to diagnose the issue / what to do to fix it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Backtrace available at &lt;a href=&quot;https://gist.github.com/JDRomano2/eb95345b7cd3c1c71911&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/JDRomano2/eb95345b7cd3c1c71911&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5455" LastEditorUserId="5455" LastEditDate="2015-02-09T16:16:37.737" LastActivityDate="2015-06-03T12:01:18.870" Title="Helm not working on remote project (Tramp over SSH)" Tags="|helm|emacs24.4|projectile|tramp|ssh|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8101" PostTypeId="2" ParentId="8097" CreationDate="2015-02-09T16:22:37.013" Score="0" Body="&lt;p&gt;One problem is that any command may modify the &lt;code&gt;kill-ring&lt;/code&gt; so the only hook powerful enough to do this is the &lt;code&gt;post-command-hook&lt;/code&gt;. This is inefficient, but AFAIK the only way to do this with rigor. If that sounds fine to you, you can do this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kill-ring-clean-whitespace-only ()&#xA;  (when (string-match &quot;^[[:space:]]*$&quot; (car kill-ring))&#xA;    (setq kill-ring (cdr kill-ring))))&#xA;&#xA;(add-hook 'post-command-hook #'kill-ring-clean-whitespace-only)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For efficiency's sake, I assume that all commands append to the &lt;code&gt;kill-ring&lt;/code&gt;, this is probably safe, but note that a function may insert text anywhere they wish into the &lt;code&gt;kill-ring&lt;/code&gt;. This is rare, though, and I'm sure you don't want to iterate over the entire kill ring on every command.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-09T16:22:37.013" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8102" PostTypeId="1" CreationDate="2015-02-09T16:56:42.000" Score="1" ViewCount="1294" Body="&lt;p&gt;Consider the following php function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;public function test(array $a, SomeObject $b)&#xA;{&#xA;  return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to automatically generate the following code block:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;/**&#xA; * @param  array       $a&#xA; * @param  SomeObject  $b&#xA; * @return int&#xA; */&#xA;public function test(array $a, SomeObject $b)&#xA;{&#xA;  return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, after modifying the code block, I would like to reformat the code block so that all the types, names and documentation are aligned as columns e.g. if the type of SomeObject changes to SomeOtherObject, the line with the variable $a is also updated with the required spaces:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;/**&#xA; * @param  array       _____$a  // 5 spaces added to align $a with $b&#xA; * @param  SomeOtherObject  $b&#xA; * @return int&#xA; */&#xA;public function test(array $a, SomeOtherObject $b)&#xA;{&#xA;  return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a minor mode available that does this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked at: &lt;a href=&quot;https://emacs.stackexchange.com/questions/8006/is-there-a-yasnippet-producing-a-prepopulated-doxygen-comment&quot;&gt;Is there a yasnippet producing a prepopulated doxygen comment?&lt;/a&gt;, but it relies on doxymacs which I believe is not maintained anymore.&lt;/p&gt;&#xA;" OwnerUserId="5117" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-03-12T08:07:17.420" Title="Is there a mode to indent doxygen type comment block with function parameters?" Tags="|indentation|documentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8103" PostTypeId="2" ParentId="8097" CreationDate="2015-02-09T17:11:11.627" Score="3" Body="&lt;p&gt;Here's one approach for dealing with blank (i.e. only whitespace) kills. Rather than filtering them out altogether, this will allow at most one blank entry in the kill ring. Each new kill will check the head of the kill-ring and replace it if it is blank.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/replace-blank-kill (args)&#xA;  (let ((string (car args))&#xA;        (replace (cdr args))&#xA;        (last (car-safe kill-ring)))&#xA;    (when (and last (string-blank-p last))&#xA;      (setq replace t))&#xA;    (list string replace)))&#xA;&#xA;(advice-add 'kill-new :filter-args #'my/replace-blank-kill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I'm using the Emacs 24.4+ advice mechanism here to filter the arguments that eventually get passed to &lt;code&gt;kill-new&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The effect is that you can still kill and yank a bunch of whitespace, but if you kill some whitespace and then kill something else, the whitespace entry will be discarded.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="675" LastEditDate="2016-06-17T20:13:54.360" LastActivityDate="2016-06-17T20:13:54.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8104" PostTypeId="1" CreationDate="2015-02-09T17:17:34.297" Score="22" ViewCount="1110" Body="&lt;p&gt;Usually around this time of year people start to realize that their copyright year is out of date in their files. This is particularly annoying if you like to put the copyright in every source file. I was wondering if emacs could help here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a mode that would automatically update the copyright year in a file? Ideally, I would setup the mode with my name and affiliations, so that it only updates the copyright for those. It would also only update the copyright automatically when a change is made (although it would be nice to also have an easy way to do a bulk change to a project). &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="253" LastEditDate="2015-02-09T20:05:19.797" LastActivityDate="2017-06-23T17:06:29.783" Title="Is there a mode to automatically update copyright years in files?" Tags="|time-date|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8105" PostTypeId="2" ParentId="8104" CreationDate="2015-02-09T17:26:32.793" Score="25" Body="&lt;p&gt;You can use the &lt;code&gt;copyright-update&lt;/code&gt; function. I would read the docs for the function. and others inside &lt;code&gt;copyright.el&lt;/code&gt; for more info, but as a simple example, If I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Copyright (C) 2014, Jordon Biondo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in a file and run &lt;code&gt;copyright-update&lt;/code&gt; from the minibuffer, it updates the line to say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Copyright (C) 2014, 2015, Jordon Biondo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can have the function remove the old year if you'd like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To handle automatic updates, you could add the function to the &lt;code&gt;before-save-hook&lt;/code&gt; list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do a batch update, use the command &lt;code&gt;copyright-update-directory&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The copyright library has a lot of features and ways to customize it, I would suggest opening up the library to begin seeing how you can adapt it to your needs.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="306" LastEditDate="2017-06-23T17:06:29.783" LastActivityDate="2017-06-23T17:06:29.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8106" PostTypeId="1" CreationDate="2015-02-09T20:18:49.367" Score="5" ViewCount="480" Body="&lt;p&gt;I really like &lt;code&gt;rx&lt;/code&gt; but I can't use it interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has someone already tried to extend isearch to support &lt;code&gt;rx&lt;/code&gt; syntax?&lt;/p&gt;&#xA;" OwnerUserId="158" LastEditorUserId="50" LastEditDate="2015-02-09T20:31:46.203" LastActivityDate="2015-02-23T23:43:39.853" Title="Is there a way to search/replace with regexps interactively using rx syntax?" Tags="|regular-expressions|rx|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8107" PostTypeId="1" AcceptedAnswerId="8108" CreationDate="2015-02-09T20:24:03.517" Score="4" ViewCount="633" Body="&lt;p&gt;When I &lt;code&gt;M-x find-file RET file.el RET&lt;/code&gt; and then run &lt;code&gt;M-x auto-insert&lt;/code&gt;, I am eventually presented with a list of keywords that Helm will complete for me.  Trouble is, I have no idea how to &lt;em&gt;finish&lt;/em&gt; the Helm completion without with &lt;em&gt;quitting&lt;/em&gt; the entire function (with &lt;code&gt;C-g&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I finish Helm completion and allow &lt;code&gt;auto-insert&lt;/code&gt; to continue its work?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-02-09T21:01:03.053" Title="How can I quit entering keywords when I auto-insert with Helm?" Tags="|helm|completion|auto-insert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8108" PostTypeId="2" ParentId="8107" CreationDate="2015-02-09T21:01:03.053" Score="6" Body="&lt;p&gt;I initially thought this was a Helm bug, but it tells you on the bottom of the Helm prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C/M-RET:Empty&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, just hit &lt;code&gt;C-RET&lt;/code&gt; or &lt;code&gt;M-RET&lt;/code&gt; to finish &lt;code&gt;auto-insert&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-09T21:01:03.053" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8109" PostTypeId="1" CreationDate="2015-02-09T21:14:35.873" Score="8" ViewCount="1955" Body="&lt;p&gt;I have a bunch of keywords:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;set&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;write&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;quit&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;which each can be shortened down to one letter:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;s&lt;/code&gt; &lt;code&gt;se&lt;/code&gt; &lt;code&gt;set&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;w&lt;/code&gt; &lt;code&gt;wr&lt;/code&gt; &lt;code&gt;wri&lt;/code&gt; &lt;code&gt;writ&lt;/code&gt; &lt;code&gt;write&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;q&lt;/code&gt; &lt;code&gt;qu&lt;/code&gt; &lt;code&gt;qui&lt;/code&gt; &lt;code&gt;quit&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Further, these keywords are case-insensitive, so the following are added to the mix:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;s&lt;/code&gt; &lt;code&gt;S&lt;/code&gt; &lt;code&gt;se&lt;/code&gt; &lt;code&gt;sE&lt;/code&gt; &lt;code&gt;Se&lt;/code&gt; &lt;code&gt;SE&lt;/code&gt; ...&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;w&lt;/code&gt; &lt;code&gt;W&lt;/code&gt; &lt;code&gt;wr&lt;/code&gt; &lt;code&gt;wR&lt;/code&gt; &lt;code&gt;Wr&lt;/code&gt; &lt;code&gt;WR&lt;/code&gt; ...&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;q&lt;/code&gt; &lt;code&gt;Q&lt;/code&gt; &lt;code&gt;qu&lt;/code&gt; &lt;code&gt;qU&lt;/code&gt; &lt;code&gt;Qu&lt;/code&gt; &lt;code&gt;QU&lt;/code&gt; ...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Given a list of the basic keywords &lt;code&gt;(&quot;set&quot; &quot;write&quot; &quot;quit&quot;)&lt;/code&gt;, how can I create a regular expression that will match them as I describe?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've approached it by providing a list to &lt;code&gt;regexp-opt&lt;/code&gt;, but the case-insensitivity list is proving hard to write.  Here is what I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mumps--command-variants (command &amp;amp;optional stack)&#xA;  &quot;Returns the possible abbreviations of COMMAND.&#xA;For example, input of \&quot;set\&quot; would yield the list&#xA;  \(\&quot;s\&quot; \&quot;se\&quot; \&quot;set\&quot;)&quot;&#xA;  (let ((case-insensitive-command-list&#xA;         (mumps--case-insensitize command))))&#xA;  (if (= 1 (length command))&#xA;      (cons command stack)&#xA;    (mumps--command-variants&#xA;     (substring command 0 (1- (length command)))&#xA;     (cons command stack))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Note on use-case&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This is going to be used to create font-lock keywords for a major mode for editing MUMPS code.  MUMPS is an... interesting language: command names are case-insensitive (and can be abbreviated like this), but &lt;em&gt;everything&lt;/em&gt; else in the language is case-sensitive (and cannot be abbreviated).  Furthermore, there is no syntactical difference between a expression which uses a command and that which uses a function (a subroutine of commands), but one is case-insensitive/abbreviated and the other is not.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-02-09T22:19:26.200" LastActivityDate="2021-01-12T15:44:18.400" Title="How can I build a regexp insensitive to case?" Tags="|regular-expressions|programming|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8110" PostTypeId="2" ParentId="8109" CreationDate="2015-02-09T21:16:50.627" Score="4" Body="&lt;p&gt;The docstring for &lt;code&gt;re-search-forward&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Search case-sensitivity is determined by the value of the variable&#xA;  &lt;code&gt;case-fold-search&lt;/code&gt;, which see.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hence, you can set &lt;code&gt;case-fold-search&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Non-&lt;code&gt;nil&lt;/code&gt; if searches and matches should ignore case.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT&lt;/em&gt; For font locking, you can set &lt;code&gt;font-lock-keywords-case-fold-search&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Non-nil means the patterns in &lt;code&gt;font-lock-keywords&lt;/code&gt; are case-insensitive.&#xA;  This is set via the function &lt;code&gt;font-lock-set-defaults&lt;/code&gt;, based on&#xA;  the CASE-FOLD argument of &lt;code&gt;font-lock-defaults&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-09T21:16:50.627" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8111" PostTypeId="2" ParentId="8092" CreationDate="2015-02-09T21:46:13.897" Score="2" Body="&lt;p&gt;You have fallen victim to the limitations of terminal control sequences.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;&amp;lt;escape&amp;gt;&lt;/kbd&gt; actually sends &lt;kbd&gt;&lt;strong&gt;C-[&lt;/strong&gt;&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-f&lt;/kbd&gt; actually sends &lt;kbd&gt;&lt;strong&gt;C-[&lt;/strong&gt;&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;&amp;lt;up&amp;gt;&lt;/kbd&gt; actually sends &lt;kbd&gt;&lt;strong&gt;C-[&lt;/strong&gt;&lt;/kbd&gt; &lt;kbd&gt;[&lt;/kbd&gt; &lt;kbd&gt;A&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Becuase &lt;kbd&gt;&amp;lt;escape&amp;gt;&lt;/kbd&gt; is a prefix of &lt;kbd&gt;M-f&lt;/kbd&gt;, you can't really bind it. This is not entirely true. You can still bind it using timers that determine whether &lt;kbd&gt;&amp;lt;escape&amp;gt;&lt;/kbd&gt; is a command or a prefix, but I don't recommend using it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long term, &lt;kbd&gt;C-g&lt;/kbd&gt; is the better solution. It's standardized and should work everywhere in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-09T21:46:13.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8112" PostTypeId="2" ParentId="8102" CreationDate="2015-02-09T21:51:43.957" Score="1" Body="&lt;p&gt;You could try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun align-doxi ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (let ((begin (re-search-backward &quot;/\\*&quot;))&#xA;          (end (re-search-forward &quot;\\*/&quot;))&#xA;          (re &quot;@param\\s-+\\w+&quot;)&#xA;          indents max-indent)&#xA;      (goto-char begin)&#xA;      (while (and (&amp;lt; (point) end)&#xA;                  (re-search-forward re end t))&#xA;        (push (1+ (current-column)) indents))&#xA;      (setf max-indent (apply 'max indents))&#xA;      (goto-char begin)&#xA;      (while (and (&amp;lt; (point) end)&#xA;                  (re-search-forward re end t))&#xA;        (delete-horizontal-space)&#xA;        (insert (make-string (- max-indent (current-column)) ?\ ))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It worked with the examples I could think of. Let me know if I missed anything.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-09T21:51:43.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8113" PostTypeId="2" ParentId="8106" CreationDate="2015-02-09T22:00:43.367" Score="4" Body="&lt;p&gt;OK, here goes.  This might sound convoluted, but it just puts together a few ordinary Emacs things that you probably use everyday.  (If you don't use them everyday, perhaps you should. ;-))&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Set option &lt;code&gt;enable-recursive-minibuffers&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt; (at least temporarily). E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x set-variable RET enable-recursive-minibuffers RET t RET&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Start regexp search: &lt;code&gt;C-M-s&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Edit the (as yet empty) search string: &lt;code&gt;M-e&lt;/code&gt;. This puts you in a normal editing mode, in the minibuffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Evaluate an rx sexp in a recursive minibuffer for &lt;code&gt;eval-expression&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u M-: (rx (and line-start (1+ (in &quot;a-z&quot;))) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You now have the regexp you want, &lt;code&gt;&quot;^[a-z]+&quot;&lt;/code&gt;, in the minibuffer, but it is surrounded by double-quote chars.  So remove those chars. You now see this in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Regexp I-search: ^[a-z]+&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;End editing and resume searching, by hitting &lt;code&gt;C-s&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The bottom line is really that it is not true that you cannot use something interactively when in Isearch. You just need to (a) use &lt;code&gt;M-e&lt;/code&gt; to get into editing mode, and then (b) use &lt;code&gt;M-:&lt;/code&gt; to interactively evaluate a Lisp sexp.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-09T22:00:43.367" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8114" PostTypeId="1" CreationDate="2015-02-10T04:48:36.970" Score="5" ViewCount="3259" Body="&lt;p&gt;To smooth my embedded workflow I have succombed to buying a Microsoft Surface. Like the early days of MacOS retina screens Emacs is all blurry. Does anyone know if there is any support for scaled displays in Windows? Google turns up few results, but it could be I'm not searching for the right feature names, Windows noob and all...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Sorry for the tag - SE thinks I should use the existing tag &lt;code&gt;window&lt;/code&gt; instead of &lt;code&gt;windows&lt;/code&gt; :)&lt;/p&gt;&#xA;" OwnerUserId="215" LastActivityDate="2015-02-10T04:48:36.970" Title="Emacs is blurry on scaled Windows displays (eg. Surface)" Tags="|window|scaling|rendering|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8115" PostTypeId="1" AcceptedAnswerId="8177" CreationDate="2015-02-10T07:17:16.150" Score="12" ViewCount="1734" Body="&lt;p&gt;Either:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(completing-read &quot;test: &quot; '(&quot;a&quot; &quot;b&quot; &quot;c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(completing-read &quot;test: &quot; '(&quot;c&quot; &quot;b&quot; &quot;a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;produces the same result in completion buffer when pressing &lt;kbd&gt;TAB&lt;/kbd&gt;. How do I make it respect the sorting order?&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="14825" LastEditDate="2023-03-11T03:33:41.257" LastActivityDate="2023-03-11T03:33:41.257" Title="Make completing-read respect sorting order of a collection" Tags="|completion|sorting|completing-read|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8116" PostTypeId="2" ParentId="8109" CreationDate="2015-02-10T07:19:05.100" Score="6" Body="&lt;p&gt;After reading the comments in a previous answer, it appears that you would like to write a font-lock rule which would match one regexp without case, whereas the others would still be matched with a case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to do this is to break out the matcher of the font-lock rule to a function, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ...&#xA; (MY-REGEXP&#xA;  (0 font-lock-variable-name-face)&#xA;  (1 another-face)&#xA;  ...)&#xA; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun my-match-the-regexp (limit)&#xA;   (let ((case-fold-search t))&#xA;     (re-search-forward MY-REGEXP limit t)))&#xA;&#xA; (my-match-the-regexp&#xA;  (0 font-lock-variable-name-face)&#xA;  (1 another-face)&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-02-10T07:19:05.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8117" PostTypeId="2" ParentId="8102" CreationDate="2015-02-10T07:45:40.447" Score="1" Body="&lt;p&gt;There is  &lt;a href=&quot;http://doxymacs.sourceforge.net&quot; rel=&quot;nofollow&quot;&gt;doxymacs&lt;/a&gt;. I set it up and it works fine. Has bunch of comment types defined. &lt;/p&gt;&#xA;" OwnerUserId="434" LastActivityDate="2015-02-10T07:45:40.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8118" PostTypeId="1" CreationDate="2015-02-10T09:27:27.190" Score="0" ViewCount="246" Body="&lt;p&gt;I have two copies of the same project, one local, one on a remote server, and I am editing a project's file locally, while running an inferior ESS process on the remote server. The remote files get synchronized outside Emacs, and I would like to avoid editing files remotely if I can help it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to load the file (ess-load-file), it obviously sends the command &quot;source()&quot; as expected. The problem is that I would like it to use the file name with the local directories stripped from it because they don't exist on the remote server, just the bare filename.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that&lt;code&gt;ess-load-file&lt;/code&gt; uses &lt;code&gt;(buffer-file-name)&lt;/code&gt; to find out the file name, but I think I just can't replace a buffer's file name with whatever I want. I've been using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ess-load-file (file-name-nondirectory (buffer-file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and rebinding the keybinding for &lt;code&gt;ess-load-file&lt;/code&gt; to run this instead, but is there some nicer way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="875" LastActivityDate="2019-07-22T12:49:03.027" Title="Mapping equivalent local files to remote files when using tramp" Tags="|tramp|ssh|remote|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8119" PostTypeId="1" CreationDate="2015-02-10T10:41:46.500" Score="0" ViewCount="625" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file I have the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(normal-erase-is-backspace-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to change &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; to backwards delete and &lt;code&gt;^H&lt;/code&gt; to help over the terminal. Unfortunately when I use emacs with &lt;code&gt;-nw&lt;/code&gt; over ssh, this mode is not applied. When I run &lt;code&gt;M-x normal-erase-is-backspace-mode RET&lt;/code&gt; after emacs is loaded, the mode is applied. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make &lt;code&gt;normal-erase-is-backspace-mode&lt;/code&gt; work as expected (e.g. by executing &lt;code&gt;(normal-erase-is-backspace-mode)&lt;/code&gt; after loading emacs)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs version 23.1.1&lt;/p&gt;&#xA;" OwnerUserId="2428" LastActivityDate="2015-02-10T10:41:46.500" Title="normal-erase-is-backspace-mode does not work over ssh when included in .emacs" Tags="|minor-mode|terminal-emacs|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8121" PostTypeId="1" AcceptedAnswerId="8124" CreationDate="2015-02-10T12:05:22.330" Score="8" ViewCount="922" Body="&lt;p&gt;Usually after inserting punctuation marks like &lt;code&gt;.&lt;/code&gt; &lt;code&gt;,&lt;/code&gt; &lt;code&gt;:&lt;/code&gt; I make an space before inserting the next character.&#xA;Is it possible that Emacs automatically do this behavior? For example inserting something like &lt;code&gt;.x&lt;/code&gt; results in typing &lt;code&gt;. x&lt;/code&gt; where &lt;code&gt;x&lt;/code&gt; is an arbitrary character (except for some particular cases excluded by the user for example the case where &lt;code&gt;x&lt;/code&gt; is an &lt;code&gt;space&lt;/code&gt; itself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes this can help to speed up typing.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-07-17T09:28:57.477" Title="Automatically inserting an space when inserting a character depending on the previous character" Tags="|self-insert-command|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8122" PostTypeId="2" ParentId="8115" CreationDate="2015-02-10T13:19:24.990" Score="2" Body="&lt;p&gt;Give &lt;code&gt;completing-read&lt;/code&gt; a list of lists, and it will respect the order:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(completing-read &quot;test: &quot; '((&quot;a&quot;) (&quot;b&quot;) (&quot;c&quot;)))&#xA;(completing-read &quot;test: &quot; '((&quot;c&quot;) (&quot;b&quot;) (&quot;a&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The docstring says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(completing-read PROMPT COLLECTION &amp;amp;optional PREDICATE&lt;/code&gt;&#xA;  &lt;code&gt;REQUIRE-MATCH INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Read a string in the minibuffer, with completion.&#xA;  PROMPT is a string to prompt with; normally it ends in a colon and a space.&#xA;  COLLECTION can be a list of strings, an alist, an obarray or a hash table.&#xA;  ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It can therefore take an alist as a collection.  In effect, you're creating an alist with keys but without values.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-10T13:19:24.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8123" PostTypeId="2" ParentId="8115" CreationDate="2015-02-10T13:21:39.903" Score="2" Body="&lt;p&gt;I'd suggest not using this ancient spell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The built-in &lt;code&gt;ido-completing-read&lt;/code&gt; doesn't have this deficiency:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ido-completing-read &quot;test: &quot; '(&quot;a&quot; &quot;b&quot; &quot;c&quot;))&#xA;(ido-completing-read &quot;test: &quot; '(&quot;c&quot; &quot;b&quot; &quot;a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Neither does &lt;code&gt;helm&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(helm :sources&#xA;      `((name . &quot;test: &quot;)&#xA;        (candidates . (&quot;a&quot; &quot;b&quot; &quot;c&quot;))))&#xA;(helm :sources&#xA;      `((name . &quot;test: &quot;)&#xA;        (candidates . (&quot;c&quot; &quot;b&quot; &quot;a&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-10T13:21:39.903" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8124" PostTypeId="2" ParentId="8121" CreationDate="2015-02-10T14:17:45.037" Score="8" Body="&lt;p&gt;Smart operator looks promising, but I have not tried it so I can't speak for it.&#xA;A prebuilt solution would be ideal, but if none are sufficient, it would be very easy to wrap write this functionality and wrap it in a minor mode though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my go:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar auto-punc-punctuation-members&#xA;  (string-to-list &quot;.,:;?!&quot;)&#xA;  &quot;List of charactesr to insert spaces after&quot;)&#xA;&#xA;(defvar auto-punc-ignore-members&#xA;  (string-to-list &quot; \t&quot;)&#xA;  &quot;List of characters to not auto insert spaces before&quot;)&#xA;&#xA;(defun auto-punc-maybe-do ()&#xA;  &quot;If the last entered character is not in `auto-punc-punctuation-members' or `auto-punc-ignore-members',&#xA;and the prior character is in `auto-punc-punctuation-members',&#xA;insert a space between the two characters. &quot;&#xA;  (when (and auto-space-punctuation-mode&#xA;             (not (member (char-before) (append auto-punc-punctuation-members auto-punc-ignore-members)))&#xA;             (member (char-before (1- (point))) auto-punc-punctuation-members))&#xA;    (backward-char 1)&#xA;    (insert &quot; &quot;)&#xA;    (forward-char 1)))&#xA;&#xA;(define-minor-mode auto-space-punctuation-mode&#xA;  &quot;Automatically inserts spaces between some punctuation and other characters.&quot;&#xA;  :init-value nil&#xA;  :lighter &quot;._a&quot;&#xA;  :keymap nil&#xA;  (make-variable-buffer-local 'post-self-insert-hook)&#xA;  (if auto-space-punctuation-mode&#xA;      (add-hook 'post-self-insert-hook 'auto-punc-maybe-do)&#xA;    (remove-hook 'post-self-insert-hook 'auto-punc-maybe-do)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could simply add it to your init and auto enable it when you want like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook 'auto-space-punctuation-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everytime you insert a character the function &lt;code&gt;auto-punc-maybe-do&lt;/code&gt; runs, read the docstring to ensure this is the behavior you want. Basically if you type punctuation, then anything that is not punctuation or whitespace, a space will be inserted automatically. &lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-02-10T15:51:37.627" LastActivityDate="2015-02-10T15:51:37.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8125" PostTypeId="2" ParentId="8115" CreationDate="2015-02-10T14:21:53.360" Score="1" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then the order is respected by &lt;code&gt;completing-read&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And you can sort using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Sorting_Candidates&quot; rel=&quot;nofollow&quot;&gt;different sort orders&lt;/a&gt;, either interactively or via Lisp. And unlike vanilla Emacs, sorting affects both &lt;code&gt;*Completions*&lt;/code&gt; display and cycling order.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-10T14:21:53.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8126" PostTypeId="1" AcceptedAnswerId="8136" CreationDate="2015-02-10T15:40:36.877" Score="4" ViewCount="697" Body="&lt;p&gt;I use evil-mode, but it doesn't support &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/scroll.html#zs&quot; rel=&quot;nofollow&quot;&gt;zs and ze shortcuts&lt;/a&gt; from Vim (scrolling horizontally to cursor position).&lt;br&gt;&#xA;How can i map these keys to achieve the same behavior in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some explanation of what &lt;code&gt;zs&lt;/code&gt;/&lt;code&gt;ze&lt;/code&gt; do:&lt;br&gt;&#xA;Let's assume i have a file with lines containing 500 chars and the line wrapping is turned off. My text editor window is 81 columns long, so i don't see all the chars in the lines, but i want to see them only from 100'th char (column) as far to the right as i can (the chars before 100'th do not interest me).&lt;br&gt;&#xA;I move my cursor to 100'th char, which now is around center of the screen. When i press &lt;code&gt;zs&lt;/code&gt; now, the 100'th column becomes the first visible column on the screen so i can see characters from 100 to 180 in my text editor window.&lt;br&gt;&#xA;When i press &lt;code&gt;ze&lt;/code&gt; now the current column (100'th) becomes the last visible column, so i can see the characters from 20 to 100'th.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quote from Vim manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;*zs*  Scroll the text horizontally to position the cursor&#xA;      at the start (left side) of the screen.  This only&#xA;      works when 'wrap' is off.  {not in Vi}&#xA;&#xA;&#xA;*ze*  Scroll the text horizontally to position the cursor&#xA;      at the end (right side) of the screen.  This only&#xA;      works when 'wrap' is off.  {not in Vi}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h1&gt;Solution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;What worked for me, thanks to &lt;a href=&quot;https://emacs.stackexchange.com/users/25/gilles&quot;&gt;/u/gilles&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hscroll-cursor-left ()&#xA;  (interactive &quot;@&quot;)&#xA;  (set-window-hscroll (selected-window) (current-column)))&#xA;&#xA;(defun hscroll-cursor-right ()&#xA;  (interactive &quot;@&quot;)&#xA;  (set-window-hscroll (selected-window) (- (current-column) (window-width) -1)))&#xA;&#xA;(define-key evil-normal-state-map &quot;zs&quot; 'hscroll-cursor-left)&#xA;(define-key evil-normal-state-map &quot;ze&quot; 'hscroll-cursor-right)&#xA;(setq auto-hscroll-mode 't)&#xA;(setq hscroll-margin 0&#xA;      hscroll-step 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4005" LastEditorUserId="4005" LastEditDate="2015-02-12T09:23:46.627" LastActivityDate="2015-02-12T09:23:46.627" Title="zs and ze from Vim?" Tags="|evil|scrolling|emacs-internals|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8127" PostTypeId="2" ParentId="8098" CreationDate="2015-02-10T16:16:12.043" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.serice.net/ernie/&quot; rel=&quot;nofollow&quot;&gt;ernie&lt;/a&gt; is a 100% Emacs Lisp script that can be used as a drop-in replacement for grep making it easy to grep using the native version of Emacs on Windows&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have not tried it, but there you go.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-02-10T16:16:12.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8128" PostTypeId="2" ParentId="8106" CreationDate="2015-02-10T16:49:07.647" Score="4" Body="&lt;p&gt;You talk about extending &lt;code&gt;isearch&lt;/code&gt;, which suggests you also want to search &lt;em&gt;incrementally&lt;/em&gt;, not just &lt;em&gt;interactively&lt;/em&gt; (interactive only meaning that you call the function from a key binding or from &lt;code&gt;M-x&lt;/code&gt;). I'm not sure that incremental is such a good fit for &lt;code&gt;rx&lt;/code&gt;: unless you enter closing parenthesis at the same time as opening ones, the vast majority of the time a partially entered &lt;code&gt;rx&lt;/code&gt; expression will be ill-formed (unlike normal regex syntax, which is often syntactically valid at several intermediate points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, to answer the question for merely interactive searching: just make a wrapper for &lt;code&gt;re-search-forward&lt;/code&gt; that prompts for an expression, evaluates it and searches for the resulting regexp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eval-re-search-forward (re)&#xA;  (interactive &quot;Xrx: &quot;)&#xA;  (re-search-forward re))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(The first &quot;X&quot; in the argument to interactive specifies that when used interactively the function should prompt for a Lisp expression, and evaluate it before binding it to the argument &lt;code&gt;re&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The prompt says &quot;rx: &quot;, because that's the intended usage, but you can enter any Lisp expression that evaluates to a string.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also, @Drew gave you a reasonable suggestion, but I want to offer a very minor variation: instead of recursive minibuffers, write a function that replaces an s-expression by its value (without the quotes if said value is a string). I use this function &lt;em&gt;all the time&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eval-replace-last-sexp ()&#xA;  (interactive)&#xA;  (let ((sexp (preceding-sexp)))&#xA;    (backward-kill-sexp)&#xA;    (let ((result (eval sexp)))&#xA;      (when result&#xA;        (insert (format &quot;%s&quot; result))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(By choosing &lt;code&gt;&quot;%s&quot;&lt;/code&gt; as the format, if result is a string it gets inserted without the quotes. I find this useful because I typically use this function to generate little parts of my files. Also, I test the result so if it's nil I don't wind up inserting the word &quot;nil&quot; in the buffer, as that's almost never what I want.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this function bound to a key of your choosing, you can run &lt;code&gt;M-x re-search-forward&lt;/code&gt;, type the &lt;code&gt;rx&lt;/code&gt; expression and hit the key you choose for &lt;code&gt;eval-replace-last-sexp&lt;/code&gt;. If you want to further edit the &lt;code&gt;rx&lt;/code&gt; form, you can undo the &lt;code&gt;eval-replace-last-sexp&lt;/code&gt;. If you really want to use this incrementally, i.e., with &lt;code&gt;isearch&lt;/code&gt;, just use &lt;code&gt;M-e&lt;/code&gt; first, as @Drew said.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2015-02-10T17:31:30.847" LastActivityDate="2015-02-10T17:31:30.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8129" PostTypeId="1" CreationDate="2015-02-10T17:10:25.037" Score="11" ViewCount="848" Body="&lt;p&gt;The question &lt;a href=&quot;https://emacs.stackexchange.com/q/2167/2609&quot;&gt;What options are there for doing spell-checking in emacs&lt;/a&gt; discuss various spell checking solutions for Emacs.&#xA;Emacs ispell interface uses external tools such as &lt;code&gt;Aspell&lt;/code&gt; or &lt;code&gt;Hunspell&lt;/code&gt; for spell checking.&#xA;Considering the fact that many free dictionary files are available (for example by &lt;a href=&quot;http://archive.services.openoffice.org/pub/mirror/OpenOffice.org/contrib/dictionaries/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Openoffice&lt;/a&gt; see for example the dictionary file &lt;a href=&quot;http://archive.services.openoffice.org/pub/mirror/OpenOffice.org/contrib/dictionaries/en_US.zip&quot; rel=&quot;nofollow noreferrer&quot;&gt;en_US.zip&lt;/a&gt;)&#xA;I am wondering if it would be possible to write a native spell checking function in Emacs using such free dictionary files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added&lt;/strong&gt;: More precisely I am wondering if there are existing packages which can be used for spell-checking (without using external tools such as &lt;code&gt;Aspell&lt;/code&gt; or &lt;code&gt;Hunspell&lt;/code&gt;) within Emacs. A tool which checks if a word is correct and if not suggests some corrections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case the answer is negative, any hint to do this would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2021-05-18T09:16:35.410" Title="Pure elisp spell checking in Emacs" Tags="|ispell|spell-checking|" AnswerCount="2" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="8130" PostTypeId="1" CreationDate="2015-02-10T18:19:52.323" Score="1" ViewCount="179" Body="&lt;p&gt;I am connecting from a Windows machine to a Linux server via Putty (&lt;a href=&quot;http://blog.harang.org/?tag=putty&quot; rel=&quot;nofollow&quot;&gt;http://blog.harang.org/?tag=putty&lt;/a&gt;). There I start Emacs and open a script written in the statistical language R. When I open the file, the appropriate major mode ESS is loaded and shown to be active in the tool bar. Also when I type &lt;code&gt;C-h m&lt;/code&gt; I get the information of the major mode and also all its keybinding. The variable &lt;code&gt;major-mode&lt;/code&gt; has the value &lt;code&gt;ess-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, so good. The problem is: None of the keybindings associated with this major mode do work. I type one of them, nothing happens except that I get the message that this keybinding is undefined. In &lt;code&gt;describe-bindings&lt;/code&gt;, the keybindings of the major mode are not shown. (This is also the information I get when I type &lt;code&gt;C-h k&lt;/code&gt; with the key sequence.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do? What is going on? Is it because of the putty emulation I am using?&lt;/p&gt;&#xA;" OwnerDisplayName="user5467" LastEditorUserId="25" LastEditDate="2015-02-11T18:37:34.540" LastActivityDate="2015-02-11T18:37:34.540" Title="ESS major modes keybindings do not work" Tags="|key-bindings|linux|ess|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8131" PostTypeId="1" AcceptedAnswerId="8160" CreationDate="2015-02-10T18:27:28.867" Score="0" ViewCount="1487" Body="&lt;p&gt;I'm using the Python REPL in a comint window via the &lt;code&gt;run-python&lt;/code&gt; command, and I'm seeing bad behavior when I use the TAB key to do my indentation. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; for i in range(3):&#xA;...     print(i)&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 2&#xA;    print(i)&#xA;        ^&#xA;IndentationError: expected an indented block&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, the indentation before &lt;code&gt;print&lt;/code&gt; was created using TAB. I use TAB when editing normal Python buffers, and it inserts 4 spaces in those cases. Here it seems to be inserting an actual TAB &lt;em&gt;and&lt;/em&gt; it results in an &lt;code&gt;IndentationError&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like it if TAB would just insert 4 spaces. I'm sure this is something really simple, but it's eluding me. Anyone know what I'm doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2015-02-11T18:18:10.830" Title="Using TAB key for indentation in Python REPL produces strange indentation problems" Tags="|indentation|python|repl|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8132" PostTypeId="2" ParentId="8098" CreationDate="2015-02-10T19:07:34.200" Score="3" Body="&lt;p&gt;Eshell contains a &lt;code&gt;grep&lt;/code&gt; implementation in &lt;code&gt;em-unix.el&lt;/code&gt; known as &lt;code&gt;eshell-poor-mans-grep&lt;/code&gt;.  As the name indicates, you shouldn't be using this since it's slow and eats lots of memory to get the job done. But considering you don't want to use anything external, why not give this internal tool a try...&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-10T19:07:34.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8133" PostTypeId="2" ParentId="8126" CreationDate="2015-02-10T19:26:53.510" Score="0" Body="&lt;p&gt;I've tried figuring out what those do by opening a file with long lines in Vim, disabling word wrap with &lt;code&gt;:set nowrap&lt;/code&gt; and trying both commands.  Apparently &lt;code&gt;zs&lt;/code&gt; positions the column point is on so that point is on the left side of the viewport, &lt;code&gt;ze&lt;/code&gt; does the same, but positions it to make point appear on the right side of the viewport.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Emacs handling of the viewport is... peculiar.  The Emacs Lisp manual elaborates upon the commands &lt;code&gt;window-hscroll&lt;/code&gt; and &lt;code&gt;set-window-hscroll&lt;/code&gt;, but the latter only adjusts the viewport if point is far away from the window boundary and goes as far as readjusting it if you move point towards it again.  Maybe someone else has more luck with figuring out the reasons for this pretty weird behaviour and can continue my research.  I assume the authors of &lt;code&gt;evil&lt;/code&gt; ran into the same hitch and decided it wasn't worth it.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-10T19:26:53.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8134" PostTypeId="2" ParentId="8118" CreationDate="2015-02-10T19:54:18.190" Score="1" Body="&lt;p&gt;I don't know. That looks pretty nice to me. You might unify this under one binding if you please. I'm not too sure what your setup is like, so this might not work. Please correct me if I'm wrong.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ess-load-remote-or-local ()&#xA;  (interactive)&#xA;  (ess-load-file&#xA;    (if (file-readable-p (buffer-file-name))&#xA;      (buffer-file-name)&#xA;      (file-name-nondirectory (buffer-file-name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't think the solution is going to get any &lt;em&gt;simpler&lt;/em&gt;. It may get smarter and more automated, but that choice is up to you.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-10T19:54:18.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8135" PostTypeId="1" CreationDate="2015-02-10T20:28:10.480" Score="13" ViewCount="3447" Body="&lt;p&gt;I'm using the &lt;code&gt;*compilation*&lt;/code&gt; buffer to build a C++ application on Centos 5 and Centos 6.  The buffer shows the build and includes references to files that are part of the build.  However, I'm getting control characters like &lt;code&gt;^[&lt;/code&gt; appear in the output and it is hard to read and emacs is getting corrupted filenames when you click one in the output. I think these characters are some kind of coloring or other annotation on the compiler output but I don't know where they are coming from.  Here is sample output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cc -c -g -I../machind -I. -DRELEASE_VERSION -g -O2 -m64 -D__BITS64 -pipe -DARCH_64 -DARCH_INTEL -DARCH_X86 -DARCH_X86_64 -DOS_LINUX -pthread -DLM_INTERNAL -DFLEXLM_KITBUILD -DFLEX_STATIC -DRELEASE_VERSION -DGPLATFORM=\\&quot;x64_lsb\\&quot; -DLINUX -DLSB3_0 -D__FD_SETSIZE=65535 -DGLIBC -DLINUX64 -DAMD64 -DREDHAT -DREL -DRHLINUX64 -DPLATFORM_AMD64_RHLINUX   -DNO_ACTIVATION_SUPPORT ../machind/lmcrypt.c&#xA;^[[01m^[[K../machind/lmcrypt.c:^[[m^[[K In function  ^[[01m^[[Kmain^[[m^[[K :&#xA;^[[01m^[[K../machind/lmcrypt.c:156:47:^[[m^[[K ^[[01;35m^[[Kwarning: ^[[m^[[Kcast to pointer from integer of different size [-Wint-to-pointer-cast]&#xA;     lc_set_attr(lm_job, LM_A_MAX_LICENSE_LEN, (LM_A_VAL_TYPE)max);&#xA;^[[01;32m^[[K                                               ^^[[m^[[K&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get rid of the non-text output in my compilation buffer?&lt;/p&gt;&#xA;" OwnerUserId="2414" LastActivityDate="2015-02-10T21:51:22.173" Title="Why does *compilation* buffer show control characters?" Tags="|major-mode|formatting|coloring|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8136" PostTypeId="2" ParentId="8126" CreationDate="2015-02-10T20:57:55.477" Score="3" Body="&lt;p&gt;It's easy enough to set the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Horizontal-Scrolling.html&quot; rel=&quot;nofollow&quot;&gt;horizontal position&lt;/a&gt; of the current window.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hscroll-cursor-left ()&#xA;  &quot;Scroll horizontally to bring the cursor to the leftmost visible column.&#xA;Similar to Vim's `zs'.&quot;&#xA;  (interactive &quot;@&quot;)&#xA;  (set-window-hscroll (selected-window) (current-column)))&#xA;&#xA;(defun hscroll-cursor-right ()&#xA;  &quot;Scroll horizontally to bring the cursor to the rightmost visible column.&#xA;Similar to Vim's `ze'.&quot;&#xA;  (interactive &quot;@&quot;)&#xA;  (set-window-hscroll (selected-window) (- (current-column) (window-width) -1)))&#xA;&#xA;(define-key evil-mode-map &quot;zs&quot; 'hscroll-cursor-left)&#xA;(define-key evil-mode-map &quot;ze&quot; 'hscroll-cursor-right)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this will not help you under the default Emacs settings, because Emacs tends to arrange to scroll the window horizontally automatically to bring the cursor near the center. You can completely turn off automatic horizontal scrolling by setting &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Horizontal-Scrolling.html#index-auto_002dhscroll_002dmode-2462&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-hscroll-mode&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;t&lt;/code&gt;, but this allows the cursor to get lost beyond the left or right edge of the visible part of the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get a behavior that's closer to Vim by keeping automatic horizontal scrolling but dropping the margin to a minimum.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq hscroll-margin 0&#xA;      hscroll-step 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't checked what happens in “nontrivial” cases like variable-width characters, automatically wrapped lines, etc.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="10" LastEditDate="2015-02-10T21:14:58.287" LastActivityDate="2015-02-10T21:14:58.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8137" PostTypeId="2" ParentId="8135" CreationDate="2015-02-10T21:44:01.807" Score="23" Body="&lt;p&gt;These are indeed escape sequences which the terminal should interpret as orders to change the text color. Normally they shouldn't be used when the compiler is invoked from Emacs (the terminal type should be set to &lt;code&gt;dumb&lt;/code&gt;, which should cause the compiler to refrain from using any escape sequence). There may be something wrong in your configuration that causes colors to be used when they shouldn't. But you can make Emacs recognize the escape sequences with the &lt;a href=&quot;http://www.emacswiki.org/emacs/AnsiColor&quot; rel=&quot;noreferrer&quot;&gt;ansi-color&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this should make compilation buffers handle ANSI escape sequences instead of displaying them as raw strings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ansi-color)&#xA;(defun my/ansi-colorize-buffer ()&#xA;  (let ((buffer-read-only nil))&#xA;    (ansi-color-apply-on-region (point-min) (point-max))))&#xA;(add-hook 'compilation-filter-hook 'my/ansi-colorize-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="25" LastEditDate="2015-02-10T21:51:22.173" LastActivityDate="2015-02-10T21:51:22.173" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8138" PostTypeId="2" ParentId="8106" CreationDate="2015-02-10T21:56:12.057" Score="5" Body="&lt;p&gt;With &lt;code&gt;isearch&lt;/code&gt; you can search almost everything.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-rx-forward ()&#xA;  &quot;Do incremental search forward for rx expression.&quot;&#xA;  (interactive)&#xA;  (let ((isearch-message-prefix-add &quot;[RX]&quot;)&#xA;        (isearch-search-fun-function&#xA;         (lambda ()&#xA;           (lambda (form &amp;amp;optional bound noerror)&#xA;             (funcall (isearch-search-fun-default)&#xA;                      (condition-case nil&#xA;                          (rx-to-string (read form))&#xA;                        (error&#xA;                         (signal 'invalid-regexp (list &quot;Invalid &quot;))))&#xA;                      bound noerror)))))&#xA;    (isearch-forward t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-02-10T21:56:12.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8139" PostTypeId="1" AcceptedAnswerId="8145" CreationDate="2015-02-10T22:00:04.300" Score="2" ViewCount="653" Body="&lt;p&gt;On Mac OSX, I'm editing a file in an Emacs buffer.  I need to conveniently open the directory containing this file in the MAC OSX Finder.  What's the best way to do this?&lt;/p&gt;&#xA;" OwnerUserId="936" LastEditorUserId="105" LastEditDate="2017-05-16T22:38:28.137" LastActivityDate="2017-05-16T22:38:28.137" Title="What's the fast way to navigate to MAC OSX &quot;Finder&quot;?" Tags="|osx|files|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8140" PostTypeId="2" ParentId="8074" CreationDate="2015-02-10T22:28:34.687" Score="3" Body="&lt;p&gt;This does not speed up the file caching but it saves the manual step of having to invalidate the stale cache (which does not contain the new file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Projectile automatically invalidates the cache if the &lt;code&gt;/your/projectile/project/root/.projectile&lt;/code&gt; file is &lt;strong&gt;newer&lt;/strong&gt; than the project cache file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This check is done whenever you try to find any file in the project using projectile; &lt;code&gt;projectile-find-file&lt;/code&gt; or &lt;code&gt;C-c p f&lt;/code&gt; if one of the commands that does this check first.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun projectile-maybe-invalidate-cache (force)&#xA;  &quot;Invalidate if FORCE or project's dirconfig newer than cache.&quot;&#xA;  (when (or force (file-newer-than-file-p (projectile-dirconfig-file)&#xA;                                           projectile-cache-file))&#xA;    (projectile-invalidate-cache nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;- From &lt;a href=&quot;https://github.com/bbatsov/projectile/blob/83357919916f8c1cc982dfa80015b82a99d40265/projectile.el#L575-579&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;projectile.el&lt;/code&gt; source&lt;/a&gt; - lines 575-579&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the &lt;strong&gt;solution&lt;/strong&gt; is to &lt;code&gt;touch&lt;/code&gt; the &lt;code&gt;.projectile&lt;/code&gt; file when you update the project. For example, you can &lt;code&gt;alias&lt;/code&gt; the &lt;code&gt;git commit&lt;/code&gt;, &lt;code&gt;git pull&lt;/code&gt;, etc to do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;touch /your/projectile/project/root/.projectile` &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after doing whatever you were doing with the &lt;code&gt;git&lt;/code&gt; commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if someone in your team adds a new file to the project and (assuming you are using git to version control) you use your special aliased git pull, the cache will be invalidated automatically when you do &lt;code&gt;projectile-find-file&lt;/code&gt; the next time.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-10T22:28:34.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8141" PostTypeId="1" AcceptedAnswerId="8143" CreationDate="2015-02-10T23:09:55.580" Score="2" ViewCount="52" Body="&lt;p&gt;Hitting &lt;code&gt;RET&lt;/code&gt; with point on a package name in the &lt;code&gt;*Packages*&lt;/code&gt; buffer opens a help buffer, named &quot;Help&quot;, describing the package. &lt;code&gt;RET&lt;/code&gt; here invokes &lt;code&gt;package-menu-describe-package&lt;/code&gt; which in turn calls &lt;code&gt;describe-package&lt;/code&gt; which uses &lt;code&gt;with-help-buffer&lt;/code&gt; to create this window. How can I customize the name of this buffer?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2024-02-22T20:07:35.157" Title="Customizing name of &quot;Help&quot; buffer opening by package-menu-describe-package" Tags="|buffers|package-repositories|help-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8143" PostTypeId="2" ParentId="8141" CreationDate="2015-02-11T00:53:48.313" Score="1" Body="&lt;p&gt;No, &lt;code&gt;describe-package&lt;/code&gt; uses &lt;code&gt;with-help-window&lt;/code&gt; (function/macro &lt;code&gt;with-help-buffer&lt;/code&gt; does not exist). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;describe-package&lt;/code&gt; explicitly intends to show buffer &lt;code&gt;*Help*&lt;/code&gt; in the help window, not another buffer. It purposely wants to replaces any current contents of buffer &lt;code&gt;*Help*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should not try to make it use another buffer.  If you really want to do that, then define your own command (e.g., based on the code of &lt;code&gt;describe-package&lt;/code&gt;), and use that instead.  You can, for example, remap the keys that are bound to &lt;code&gt;describe-package&lt;/code&gt; to your command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if all you want to do is change the name of the help buffer after it is created and shown, then just do that.  Use command (function) &lt;code&gt;rename-buffer&lt;/code&gt; - interactively or in Lisp code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bind &lt;code&gt;rename-buffer&lt;/code&gt; to &lt;code&gt;C-M-S-f1&lt;/code&gt;, and I use it quite often - in particular, to keep a &lt;code&gt;*Help*&lt;/code&gt; buffer so that some help command does not overwrite its contents.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-11T00:53:48.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8144" PostTypeId="1" AcceptedAnswerId="8146" CreationDate="2015-02-11T01:52:21.443" Score="6" ViewCount="578" Body="&lt;p&gt;Most functions in emacs keep a default option, with the last arguments used. Is it possible to reuse some of the default arguments while changing others?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when using search and replace, a string such as &lt;code&gt;Query replace (default thing1 -&amp;gt; thing2)&lt;/code&gt; lets you reuse the last command, instead of typing it all over.  Is there a way to keep &quot;thing1&quot; as the first argument, but enter a new string in place of &quot;thing2&quot;?&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="105" LastEditDate="2015-02-11T03:14:47.730" LastActivityDate="2015-02-11T03:14:47.730" Title="Reusing previous inputs (old or new) for query-replace" Tags="|query-replace|default|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8145" PostTypeId="2" ParentId="8139" CreationDate="2015-02-11T03:08:44.970" Score="10" Body="&lt;p&gt;My way wasn't shown in the other thread: &lt;code&gt;M-! open . RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;open&lt;/code&gt; is a general OS X command which will cause the system to open a file or directory in the default application.  &lt;code&gt;.&lt;/code&gt; is the current directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't do this very often, so I find it faster to type the above incantation than to write a function and map it somewhere.  &lt;code&gt;M-x open-in-finder&lt;/code&gt; would take more characters than above.&lt;/p&gt;&#xA;" OwnerUserId="2467" LastActivityDate="2015-02-11T03:08:44.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8146" PostTypeId="2" ParentId="8144" CreationDate="2015-02-11T03:11:38.927" Score="5" Body="&lt;p&gt;Let's say you already did a &lt;code&gt;query-replace&lt;/code&gt; of &lt;code&gt;thing1&lt;/code&gt; with &lt;code&gt;thing2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how it goes if you want to use &lt;code&gt;thing1&lt;/code&gt; as the first argument again. It is not automatic but you don't have to type in the whole &lt;code&gt;thing1&lt;/code&gt; either. The benefit of this approach is more more when doing &lt;code&gt;query-replace-regexp&lt;/code&gt; and you need to repeat a very complex regexp.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call &lt;code&gt;query-replace&lt;/code&gt; or &lt;code&gt;query-replace-regexp&lt;/code&gt; again.&lt;/li&gt;&#xA;&lt;li&gt;Entering search expression: &lt;code&gt;M-p&lt;/code&gt; &lt;code&gt;M-p&lt;/code&gt; (yes, twice) - The first &lt;code&gt;M-p&lt;/code&gt; will bring up &lt;code&gt;thing2&lt;/code&gt; and the second will bring up &lt;code&gt;thing1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Entering replace expression: Proceed with your use case where you want to enter a new string instead of &lt;code&gt;thing2&lt;/code&gt;. Or if you change your mind and want to continue with &lt;code&gt;thing2&lt;/code&gt;, do &lt;code&gt;M-p&lt;/code&gt; &lt;code&gt;M-p&lt;/code&gt; again!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-11T03:11:38.927" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8147" PostTypeId="1" CreationDate="2015-02-11T08:08:23.103" Score="11" ViewCount="1972" Body="&lt;p&gt;I am using emacs 24.3 (ubuntu 14.10) and would like the daemon to participate in the graphical desktop session lifecycle while using &lt;code&gt;desktop-mode&lt;/code&gt;. I went through &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsAsDaemon&quot;&gt;http://www.emacswiki.org/emacs/EmacsAsDaemon&lt;/a&gt; but it still does not play nice for me. One problem is that the daemon SIGTERM termination does not clean up &lt;code&gt;.emacs.desktop.lock&lt;/code&gt; so the next start will refuse to pick up the saved state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a recipe to make emacs daemon + desktop mode play nice with the graphical desktop session?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a sidenote: Sending SIGHUP frequently crashes emacs for me.&lt;/p&gt;&#xA;" OwnerUserId="5473" LastActivityDate="2020-11-12T15:27:39.033" Title="Using desktop-mode with Emacs Daemon" Tags="|daemon|desktop|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8149" PostTypeId="2" ParentId="8147" CreationDate="2015-02-11T09:55:59.930" Score="6" Body="&lt;p&gt;Don't kill the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;kill-emacs&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to terminate the server.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-02-11T09:55:59.930" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8150" PostTypeId="1" AcceptedAnswerId="8163" CreationDate="2015-02-11T13:24:05.760" Score="3" ViewCount="2343" Body="&lt;p&gt;For my weekly report at work I use the org-mode (what else?). The custom agenda I am using is specified in my &lt;code&gt;.emacs&lt;/code&gt; file as follows: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; '(org-agenda-custom-commands (quote ((&quot;W&quot; &quot;Weekly Meeting&quot; &#xA;   ((tags &quot;TIMESTAMP_IA&amp;gt;=\&quot;&amp;lt;-1w&amp;gt;\&quot;/DONE&quot; &#xA;     ((org-agenda-sorting-strategy (quote (tag-up))))) &#xA;    (tags &quot;TIMESTAMP_IA&amp;gt;=\&quot;&amp;lt;-1w&amp;gt;\&quot;/ABANDONED&quot; &#xA;     ((org-agenda-sorting-strategy (quote (tag-up))))) &#xA;    (tags &quot;TIMESTAMP_IA&amp;gt;=\&quot;&amp;lt;-1w&amp;gt;\&quot;/FAILED&quot; &#xA;     ((org-agenda-sorting-strategy (quote (tag-up))))) &#xA;    (todo &quot;URGENT&quot; ((org-agenda-sorting-strategy (quote (tag-up))))) &#xA;    (todo &quot;IN PROGRESS&quot; ((org-agenda-sorting-strategy (quote (tag-up))))) &#xA;    (todo &quot;PENDING&quot; ((org-agenda-sorting-strategy (quote (tag-up)))))) nil&#xA;    (&quot;test.html&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus, I can see which tasks are urgent, which I am currently working upon and which tasks have been delegated to other people and are pending to be done. Furthermore, I can see what tasks have been done within the last week, which were abandoned and where I failed to deliver the desired result in the last week. (the default export is for different purposes)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to my question: As far as I experience it I can only see what I have done/abandoned/where I failed within the last 7 days. A more suitable view would be to see what I have done in the current calendar week. Does anybody know how to achieve this? &lt;/p&gt;&#xA;" OwnerUserId="5392" LastEditorUserId="675" LastEditDate="2016-05-27T00:28:04.873" LastActivityDate="2016-05-27T00:28:04.873" Title="Show done items in current calendar week" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8152" PostTypeId="2" ParentId="598" CreationDate="2015-02-11T14:42:24.003" Score="13" Body="&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; &lt;a href=&quot;http://git.savannah.nongnu.org/cgit/so-long.git/tree/so-long.el&quot; rel=&quot;noreferrer&quot;&gt;http://git.savannah.nongnu.org/cgit/so-long.git/tree/so-long.el&lt;/a&gt; is a part of Emacs 27.1!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OLD&lt;/strong&gt; I usually unroll long lines and indent by tags (like HTML, XML, JSON).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to make such operation possible I add:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq line-number-display-limit large-file-warning-threshold)&#xA;(setq line-number-display-limit-width 200)&#xA;&#xA;(defun my--is-file-large ()&#xA;  &quot;If buffer too large and my cause performance issue.&quot;&#xA;  (&amp;lt; large-file-warning-threshold (buffer-size)))&#xA;&#xA;(define-derived-mode my-large-file-mode fundamental-mode &quot;LargeFile&quot;&#xA;  &quot;Fixes performance issues in Emacs for large files.&quot;&#xA;  ;; (setq buffer-read-only t)&#xA;  (setq bidi-display-reordering nil)&#xA;  (jit-lock-mode nil)&#xA;  (buffer-disable-undo)&#xA;  (set (make-variable-buffer-local 'global-hl-line-mode) nil)&#xA;  (set (make-variable-buffer-local 'line-number-mode) nil)&#xA;  (set (make-variable-buffer-local 'column-number-mode) nil) )&#xA;&#xA;(add-to-list 'magic-mode-alist (cons #'my--is-file-large #'my-large-file-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I split line by regex, for XML it: &lt;code&gt;C-M-% &amp;gt;&amp;lt; RET &amp;gt;NL&amp;lt; RET !&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After Emacs split long lines - it is possible to enable many &lt;code&gt;*-modes&lt;/code&gt; and re-indent code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the note: &lt;a href=&quot;https://emacs.stackexchange.com/questions/5545/how-to-prevent-slow-down-when-an-inferior-processes-generates-long-lines&quot;&gt;How to prevent slow-down when an inferior processes generates long lines?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2020-02-17T11:42:53.767" LastActivityDate="2020-02-17T11:42:53.767" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8153" PostTypeId="2" ParentId="5591" CreationDate="2015-02-11T15:33:41.823" Score="1" Body="&lt;p&gt;I was having the same issue in the OS X Emacs 24 window-system. My default font is variable width, so naturally my Org-tables were not aligning properly. To continue with @wasamasa's solution for customizing the font for just the &lt;code&gt;org-table&lt;/code&gt; mode and keeping a default variable width font for everything else, I found this solution helpful: &lt;a href=&quot;https://stackoverflow.com/a/3761399/2623701&quot; title=&quot;https://stackoverflow.com/a/3761399/2623701&quot;&gt;`variable-pitch` for org-mode, fixed-pitch for tables?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-06-16T18:00:48.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8154" PostTypeId="2" ParentId="8066" CreationDate="2015-02-11T15:44:42.760" Score="2" Body="&lt;p&gt;Either you have a typo in your width setup or that variable existed in an older version of &lt;code&gt;sr-speedbar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable to configure width in the current version is &lt;code&gt;sr-speedbar-width&lt;/code&gt; (without the '-x').&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how to configure the width:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;First&lt;/strong&gt; and foremost, close the speedbar if open. This is a crucial step because &lt;code&gt;sr-speedbar&lt;/code&gt; &quot;remembers&quot; the speedbar width when closing. So if you change the value of &lt;code&gt;sr-speedbar-width&lt;/code&gt; and then close the speedbar ( &lt;code&gt;sr-speedbar-close&lt;/code&gt; ), that variable will be overwritten with the current width of speedbar.&lt;/li&gt;&#xA;&lt;li&gt;Then, do &lt;code&gt;(setq sr-speedbar-width 40)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have tested this to work with version &lt;em&gt;20140914.2339&lt;/em&gt; of &lt;a href=&quot;http://www.emacswiki.org/emacs/sr-speedbar.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;sr-speedbar&lt;/code&gt;&lt;/a&gt; on emacs 24.4.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-11T15:44:42.760" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8155" PostTypeId="2" ParentId="5893" CreationDate="2015-02-11T16:48:02.287" Score="5" Body="&lt;p&gt;@Lawlist gave a nice snippet of code in his comment. You can assign a function to load all org files via:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/open-all-org-agenda-files () &#xA;  (interactive) &#xA;  (let ((files (org-agenda-files))) (mapcar (lambda (x) (find-file x)) files))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(this is his code, if you like this, please up-vote his comment)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can add files to your agenda file list very quickly via: &lt;kbd&gt; C - c [ &lt;/kbd&gt;. You can view/edit your current file list via var: org-agenda-files. &lt;kbd&gt; C - c h &lt;/kbd&gt;  then type: org-agenda-files to view/customize it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add a line of code to the end of your .emacs to load these file on start-up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(my/open-all-org-agenda-files)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt; in hind sight, the above doesn't work that well as all those files are added to agenda clock reports, making reports very long with many files showing 0 time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit2]&lt;/strong&gt;&lt;br&gt;&#xA;In hind-hind sight, this does actually work. I simply add the    :fileskip0  parameter and it skips files where time is zero.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-03-17T14:42:09.840" LastActivityDate="2015-03-17T14:42:09.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8156" PostTypeId="1" AcceptedAnswerId="8162" CreationDate="2015-02-11T17:36:12.247" Score="4" ViewCount="292" Body="&lt;p&gt;Is there a way to use a variable to hold the set of let bindings for passing to a later call?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq a '((org-export-with-toc nil)&#xA;          (blah 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let-wrapper a&#xA;  ;; Perform the export here)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is for the goal of allowing &lt;a href=&quot;https://github.com/jleechpe/outorg-export&quot; rel=&quot;nofollow&quot;&gt;outorg-export&lt;/a&gt; to add an &lt;code&gt;options&lt;/code&gt; alist specifying how to export the indicated element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Editing to provide clarity (&lt;code&gt;@sds&lt;/code&gt;'s answer of using &lt;code&gt;cl-progv&lt;/code&gt; is what I needed):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to be able to pass a variable/alist of values as part of an 'export definition' to the org-export engine.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;If NIL, nothing will be exported.  Otherwise it must be a list of&#xA;entries for sections to be exported and exporter to use.  Each entry&#xA;is a list like this:&#xA;&#xA;    (headline &amp;amp;optional exporter file level options)&#xA;&#xA;headline     Outshine commented headline to export from.  If t,&#xA;             defaults to entire file.&#xA;exporter     Org exporter format to use when exporting.  If not&#xA;             specified (blank, t or nil), defaults to an Org&#xA;             file.  This is a symbol for the exporter to use.  If&#xA;             exporting to PDF, specify `PDF' rather than `LATEX'&#xA;             otherwise it will be exported as a `.tex' file.&#xA;file         If set, specifies the export file name.  If `T', defaults&#xA;             to the name of the exported buffer.  If `NIL', defaults&#xA;             to the name of the headline being exported if specified,&#xA;             or buffer file name if entire buffer is exported.&#xA;level        By default `SECTION' will search for top level headlines&#xA;             `* '.  Level allows for exporting specific sublevels&#xA;             instead.  This integer indicates how many stars to match.&#xA;options      List of export variables to be set prior to export.&#xA;             These values are provided as a let binding around the&#xA;             export process.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;An example command would be &lt;code&gt;(&quot;Documentation&quot; ascii t 1 ((org-export-with-toc nil)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the export command itself each value is let bound to the appropriate field, and then in the end &lt;code&gt;org-ascii-export-to-ascii&lt;/code&gt; performs the export (replace ascii as specified).  I'd tried using &lt;code&gt;:EXPORT_OPTIONS:&lt;/code&gt; properties but they were not being recognized when converting to outorg and exporting, and &lt;code&gt;#+OPTIONS:&lt;/code&gt; were not either.  Instead (also allowing different options based on export format, or even multiple exports to the same format with different options) I want to use the &lt;code&gt;options&lt;/code&gt; value as a set of let-bindings around the export process to allow it to be modified.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2015-02-11T20:01:12.007" LastActivityDate="2015-02-11T20:01:12.007" Title="Use a variable to determine let bindings" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8157" PostTypeId="1" AcceptedAnswerId="8175" CreationDate="2015-02-11T17:54:34.793" Score="1" ViewCount="475" Body="&lt;p&gt;I'm running Emacs 24.4.1 on Windows 8, and am unable to get powerline to display the fancy separators (arrows, etc). There are a handful for packages and forks that implement powerline for Emacs, of which I've tried a couple (such as &lt;a href=&quot;https://github.com/jonathanchu/emacs-powerline&quot; rel=&quot;nofollow&quot;&gt;emacs-powerline&lt;/a&gt; and &lt;a href=&quot;https://github.com/milkypostman/powerline&quot; rel=&quot;nofollow&quot;&gt;powerline&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The root of the problem seems to be with the use of &lt;code&gt;create-image&lt;/code&gt; to create XPM images. I haven't debugged in depth but it seems like in my case the &lt;code&gt;create-image&lt;/code&gt; calls are always returning &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From searching online it seems like there are people running Emacs+Windows for which powerline renders properly, possibly with older versions of Emacs. It seems like xpm support is included so no additional libraries should be required, but I've never dealt with &lt;code&gt;create-image&lt;/code&gt; before so perhaps I'm overlooking something. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, I've confirmed that on my system XPM support is not working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(image-type-available-p 'xpm)&#xA;==&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I suppose the question is: how do I get XPM support?&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-11T21:34:36.593" LastActivityDate="2015-02-12T13:43:01.437" Title="Powerline separators on Windows -- create XPM image?" Tags="|microsoft-windows|images|powerline|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8158" PostTypeId="1" CreationDate="2015-02-11T18:04:41.533" Score="4" ViewCount="2481" Body="&lt;p&gt;I'm in emacs 24.something on a Windows platform.&#xA;I have an agenda generated by org that I would like to keep on continuous display.&#xA;I use multiple frames, and multiple windows per frame, for my other work.&#xA;What I would like is a single frame with a dedicated window displaying my agenda buffer that is NOT split&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-window-dedicated (selected-window) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;seems to help, but doesn't quite do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="5480" LastEditorUserId="115" LastEditDate="2015-02-11T18:06:35.573" LastActivityDate="2015-05-09T20:25:40.610" Title="How to prevent window split in a single frame" Tags="|frames|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8159" PostTypeId="1" AcceptedAnswerId="8190" CreationDate="2015-02-06T19:08:53.670" Score="6" ViewCount="1168" Body="&lt;p&gt;In Org-Mode, I have a few mundane re-occuring tasks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a task is set to re-occur, it shows up on every day it reccours. E.g a daily task:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Bugzilla Triage &#xA; SCHEDULED &amp;lt;[today] ++1d&amp;gt;&#xA;&#xA;Week-agenda (W09):&#xA;Monday     23 February 2015 W09&#xA;  leo:        Scheduled:  TODO Bugzilla Triage                      :RECURRING::&#xA;  leo:        Deadline:   TODO Weekly report                        :RECURRING::&#xA;Tuesday    24 February 2015&#xA;  leo:        Scheduled:  TODO Bugzilla Triage                      :RECURRING::&#xA;Wednesday  25 February 2015&#xA;  leo:        Scheduled:  TODO Bugzilla Triage                      :RECURRING::&#xA;Thursday   26 February 2015&#xA;  leo:        Scheduled:  TODO Bugzilla Triage                      :RECURRING::&#xA;Friday     27 February 2015&#xA;  leo:        Scheduled:  TODO Bugzilla Triage                      :RECURRING::&#xA;Saturday   28 February 2015&#xA;Sunday      1 March 2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't really want them to take up all the Agenda space, I just want to see the first occurrence, (i.e only monday's occurance, but not all the other occurrences). Is it possible to configure emacs to show only the first occurance? (i.e monday in this case)&lt;/p&gt;&#xA;" OwnerUserId="5350" OwnerDisplayName="Leo Ufimtsev" LastEditorUserId="5495" LastEditDate="2018-10-30T20:49:53.570" LastActivityDate="2018-11-21T17:41:04.953" Title="Make org-agenda show only first occurrence of recurring task?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="8160" PostTypeId="2" ParentId="8131" CreationDate="2015-02-11T18:18:10.830" Score="1" Body="&lt;p&gt;Hm... Let me make this an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;TAB&lt;/kbd&gt; in a Python REPL triggers &lt;code&gt;yas-expand&lt;/code&gt; in your case. This in turn calls &lt;code&gt;python-shell-completion-complete-or-indent&lt;/code&gt;, which calls &lt;code&gt;indent-for-tab-command&lt;/code&gt;. This is controlled by the regular Emacs indentation variables, which are buffer local. To fix this, you can do the following:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'inferior-python-mode-hook&#xA;  (lambda ()&#xA;    (setq&#xA;      indent-tabs-mode nil ;; i.e. indent with spaces&#xA;      tab-width 4          ;; i.e. tabs consts of 4 spaces&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-11T18:18:10.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8161" PostTypeId="2" ParentId="8158" CreationDate="2015-02-11T18:25:46.997" Score="2" Body="&lt;p&gt;&#xA;A similar question was asked &lt;a href=&quot;https://emacs.stackexchange.com/questions/7697/make-a-new-frame-with-only-mode-line&quot;&gt;here&lt;/a&gt;. Try this solution:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer&#xA;  ;; initialize org-agenda here&#xA;  ;; this sexp MUST return a buffer,&#xA;  ;; to be used by with-current-buffer&#xA;  (blah blah initialize org-agenda blah blah)&#xA;  (make-frame '((unsplittable . t)))&#xA;  (set-window-dedicated-p&#xA;    (get-buffer-window (current-buffer) t) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Disclaimer&lt;/em&gt;:&#xA;I, personally, don't use &lt;code&gt;org-agenda&lt;/code&gt;, so I can't guarantee that this will work. It should if &lt;code&gt;org-agenda&lt;/code&gt; behaves nicely.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-02-13T02:22:10.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8162" PostTypeId="2" ParentId="8156" CreationDate="2015-02-11T18:49:28.083" Score="4" Body="&lt;p&gt;If I understood you correctly and what you want is run-time evaluation&#xA;of the variables to be bound, then you need&#xA;&lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Body/s_progv.htm&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;progv&lt;/code&gt;&lt;/a&gt;&#xA;implemented in Emacs as&#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/cl/Dynamic-Bindings.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;cl-progv&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progv (mapcar #first a) (mapcar #'second a)&#xA;  ....)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-02-11T18:49:28.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8163" PostTypeId="2" ParentId="8150" CreationDate="2015-02-11T22:59:32.527" Score="5" Body="&lt;p&gt;You can do this by using an agenda view instead of a todo view.  Setting &lt;code&gt;org-agenda-span&lt;/code&gt; to &lt;code&gt;week&lt;/code&gt; and &lt;code&gt;org-agenda-start-on-weekday&lt;/code&gt; to 0 will show the current week starting on Sunday.  We can use &lt;code&gt;org-agenda-skip-function&lt;/code&gt; to filter out any item not in a done state.  By default this will hide everything unless we also set &lt;code&gt;org-agenda-start-with-log-mode&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting it all together gives:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;W&quot; &quot;Weekly review&quot;&#xA;               agenda &quot;&quot;&#xA;               ((org-agenda-span 'week)&#xA;                (org-agenda-start-on-weekday 0)&#xA;                (org-agenda-start-with-log-mode t)&#xA;                (org-agenda-skip-function&#xA;                 '(org-agenda-skip-entry-if 'nottodo 'done))&#xA;                 )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="675" LastEditDate="2016-05-27T00:27:59.013" LastActivityDate="2016-05-27T00:27:59.013" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8164" PostTypeId="2" ParentId="8158" CreationDate="2015-02-11T23:41:43.183" Score="2" Body="&lt;p&gt;There was only one thing wrong with the code you tried, in terms of making the window dedicated:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(set-window-dedicated (selected-window) t)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The function is &lt;strong&gt;&lt;code&gt;set-window-dedicated-p&lt;/code&gt;&lt;/strong&gt;, not &lt;code&gt;set-window-dedicated&lt;/code&gt;.  Try again, without the typo:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (set-window-dedicated-p (selected-window) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That will prevent both you and Emacs from using the window for another buffer. For example, &lt;code&gt;C-x b&lt;/code&gt; will raise an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prevent automatic splitting of the window, you can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (set-frame-parameter nil 'unsplittable t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That will &lt;em&gt;not&lt;/em&gt; prevent you from splitting the window, e.g. using &lt;code&gt;C-x 2&lt;/code&gt;, but it will prevent Emacs from splitting it automatically.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:25:40.610" LastActivityDate="2015-05-09T20:25:40.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8165" PostTypeId="2" ParentId="5769" CreationDate="2015-02-12T01:54:03.267" Score="1" Body="&lt;p&gt;The sequence to show only name, size and modification time is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq sr-attributes-display-mask '(nil nil nil nil t t t))&#xA;(sr-toggle-attributes)&#xA;(sunrise)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The order is not the best one as the name is displayed last.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2015-02-12T01:54:03.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8166" PostTypeId="1" AcceptedAnswerId="8167" CreationDate="2015-02-12T02:03:18.530" Score="2" ViewCount="851" Body="&lt;p&gt;I must be overlooking something obvious, but I can't find a way to encode a string/region into HTML, for example &quot;Hölle&quot; to &quot;H&amp;amp;ouml;lle&quot;. Is there anything in emacs or web-mode or any other plugin that can do that?&lt;/p&gt;&#xA;" OwnerUserId="2263" LastEditorUserId="2223" LastEditDate="2015-02-12T02:48:14.100" LastActivityDate="2016-02-03T16:48:41.237" Title="Encode non-html characters to html equivalent?" Tags="|html|web|web-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8167" PostTypeId="2" ParentId="8166" CreationDate="2015-02-12T04:54:20.767" Score="1" Body="&lt;p&gt;This solution is amazingly ugly, but as far as I can tell, it works. Call it on the active region.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-replace-symbols-with-entity-names (start end)&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((count (count-matches &quot;&amp;amp;&quot;)))&#xA;    (replace-string &quot;&amp;amp;&quot; &quot;&amp;amp;amp;&quot; nil start end)&#xA;    (setq end (+ end (* count 4))))&#xA;  (dolist (pair web-mode-html-entities)&#xA;    (unless (= (cdr pair) 38)&#xA;      (let* ((str (char-to-string (cdr pair)))&#xA;              (count (count-matches str start end)))&#xA;        (setq end (+ end (* count (1+ (length (car pair))))))&#xA;        (replace-string str&#xA;          (concat &quot;&amp;amp;&quot; (car pair) &quot;;&quot;)&#xA;          nil start end)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this is limited to &lt;code&gt;web-mode&lt;/code&gt;'s list of entities (&lt;code&gt;web-mode-html-entities&lt;/code&gt;), which only contains 41 entities! (And does not seem to include accented characters).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily add to this list yourself. Here is a list of all printable HTML entities that are named:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq web-mode-html-entities&#xA;  '((&quot;quot&quot; . 34)&#xA;     (&quot;amp&quot; . 38)&#xA;     (&quot;apos&quot; . 39)&#xA;     (&quot;lt&quot; . 60)&#xA;     (&quot;gt&quot; . 62)&#xA;     (&quot;nbsp&quot; . 160)&#xA;     (&quot;iexcl&quot; . 161)&#xA;     (&quot;cent&quot; . 162)&#xA;     (&quot;pound&quot; . 163)&#xA;     (&quot;curren&quot; . 164)&#xA;     (&quot;yen&quot; . 165)&#xA;     (&quot;brvbar&quot; . 166)&#xA;     (&quot;sect&quot; . 167)&#xA;     (&quot;uml&quot; . 168)&#xA;     (&quot;copy&quot; . 169)&#xA;     (&quot;ordf&quot; . 170)&#xA;     (&quot;laquo&quot; . 171)&#xA;     (&quot;not&quot; . 172)&#xA;     (&quot;shy&quot; . 173)&#xA;     (&quot;reg&quot; . 174)&#xA;     (&quot;macr&quot; . 175)&#xA;     (&quot;deg&quot; . 176)&#xA;     (&quot;plusmn&quot; . 177)&#xA;     (&quot;sup2&quot; . 178)&#xA;     (&quot;sup3&quot; . 179)&#xA;     (&quot;acute&quot; . 180)&#xA;     (&quot;micro&quot; . 181)&#xA;     (&quot;para&quot; . 182)&#xA;     (&quot;middot&quot; . 183)&#xA;     (&quot;cedil&quot; . 184)&#xA;     (&quot;sup1&quot; . 185)&#xA;     (&quot;ordm&quot; . 186)&#xA;     (&quot;raquo&quot; . 187)&#xA;     (&quot;frac14&quot; . 188)&#xA;     (&quot;frac12&quot; . 189)&#xA;     (&quot;frac34&quot; . 190)&#xA;     (&quot;iquest&quot; . 191)&#xA;     (&quot;Agrave&quot; . 192)&#xA;     (&quot;Aacute&quot; . 193)&#xA;     (&quot;Acirc&quot; . 194)&#xA;     (&quot;Atilde&quot; . 195)&#xA;     (&quot;Auml&quot; . 196)&#xA;     (&quot;Aring&quot; . 197)&#xA;     (&quot;AElig&quot; . 198)&#xA;     (&quot;Ccedil&quot; . 199)&#xA;     (&quot;Egrave&quot; . 200)&#xA;     (&quot;Eacute&quot; . 201)&#xA;     (&quot;Ecirc&quot; . 202)&#xA;     (&quot;Euml&quot; . 203)&#xA;     (&quot;Igrave&quot; . 204)&#xA;     (&quot;Iacute&quot; . 205)&#xA;     (&quot;Icirc&quot; . 206)&#xA;     (&quot;Iuml&quot; . 207)&#xA;     (&quot;ETH&quot; . 208)&#xA;     (&quot;Ntilde&quot; . 209)&#xA;     (&quot;Ograve&quot; . 210)&#xA;     (&quot;Oacute&quot; . 211)&#xA;     (&quot;Ocirc&quot; . 212)&#xA;     (&quot;Otilde&quot; . 213)&#xA;     (&quot;Ouml&quot; . 214)&#xA;     (&quot;times&quot; . 215)&#xA;     (&quot;Oslash&quot; . 216)&#xA;     (&quot;Ugrave&quot; . 217)&#xA;     (&quot;Uacute&quot; . 218)&#xA;     (&quot;Ucirc&quot; . 219)&#xA;     (&quot;Uuml&quot; . 220)&#xA;     (&quot;Yacute&quot; . 221)&#xA;     (&quot;THORN&quot; . 222)&#xA;     (&quot;szlig&quot; . 223)&#xA;     (&quot;agrave&quot; . 224)&#xA;     (&quot;aacute&quot; . 225)&#xA;     (&quot;acirc&quot; . 226)&#xA;     (&quot;atilde&quot; . 227)&#xA;     (&quot;auml&quot; . 228)&#xA;     (&quot;aring&quot; . 229)&#xA;     (&quot;aelig&quot; . 230)&#xA;     (&quot;ccedil&quot; . 231)&#xA;     (&quot;egrave&quot; . 232)&#xA;     (&quot;eacute&quot; . 233)&#xA;     (&quot;ecirc&quot; . 234)&#xA;     (&quot;euml&quot; . 235)&#xA;     (&quot;igrave&quot; . 236)&#xA;     (&quot;iacute&quot; . 237)&#xA;     (&quot;icirc&quot; . 238)&#xA;     (&quot;iuml&quot; . 239)&#xA;     (&quot;eth&quot; . 240)&#xA;     (&quot;ntilde&quot; . 241)&#xA;     (&quot;ograve&quot; . 242)&#xA;     (&quot;oacute&quot; . 243)&#xA;     (&quot;ocirc&quot; . 244)&#xA;     (&quot;otilde&quot; . 245)&#xA;     (&quot;ouml&quot; . 246)&#xA;     (&quot;divide&quot; . 247)&#xA;     (&quot;oslash&quot; . 248)&#xA;     (&quot;Ugrave&quot; . 249)&#xA;     (&quot;Uacute&quot; . 250)&#xA;     (&quot;Ucirc&quot; . 251)&#xA;     (&quot;Uuml&quot; . 252)&#xA;     (&quot;yacute&quot; . 253)&#xA;     (&quot;thorn&quot; . 254)&#xA;     (&quot;yuml&quot; . 255)&#xA;     (&quot;OElig&quot; . 338)&#xA;     (&quot;oelig&quot; . 339)&#xA;     (&quot;Scaron&quot; . 352)&#xA;     (&quot;scaron&quot; . 353)&#xA;     (&quot;Yuml&quot; . 376)&#xA;     (&quot;fnof&quot; . 402)&#xA;     (&quot;circ&quot; . 710)&#xA;     (&quot;tilde&quot; . 732)&#xA;     (&quot;Alpha&quot; . 913)&#xA;     (&quot;Beta&quot; . 914)&#xA;     (&quot;Gamma&quot; . 915)&#xA;     (&quot;Delta&quot; . 916)&#xA;     (&quot;Epsilon&quot; . 917)&#xA;     (&quot;Zeta&quot; . 918)&#xA;     (&quot;Eta&quot; . 919)&#xA;     (&quot;Theta&quot; . 920)&#xA;     (&quot;Iota&quot; . 921)&#xA;     (&quot;Kappa&quot; . 922)&#xA;     (&quot;Lambda&quot; . 923)&#xA;     (&quot;Mu&quot; . 924)&#xA;     (&quot;Nu&quot; . 925)&#xA;     (&quot;Xi&quot; . 926)&#xA;     (&quot;Omicron&quot; . 927)&#xA;     (&quot;Pi&quot; . 928)&#xA;     (&quot;Rho&quot; . 929)&#xA;     (&quot;Sigma&quot; . 931)&#xA;     (&quot;Tau&quot; . 932)&#xA;     (&quot;Upsilon&quot; . 933)&#xA;     (&quot;Phi&quot; . 934)&#xA;     (&quot;Chi&quot; . 935)&#xA;     (&quot;Psi&quot; . 936)&#xA;     (&quot;Omega&quot; . 937)&#xA;     (&quot;alpha&quot; . 945)&#xA;     (&quot;beta&quot; . 946)&#xA;     (&quot;gamma&quot; . 947)&#xA;     (&quot;delta&quot; . 948)&#xA;     (&quot;epsilon&quot; . 949)&#xA;     (&quot;zeta&quot; . 950)&#xA;     (&quot;eta&quot; . 951)&#xA;     (&quot;theta&quot; . 952)&#xA;     (&quot;iota&quot; . 953)&#xA;     (&quot;kappa&quot; . 954)&#xA;     (&quot;lambda&quot; . 955)&#xA;     (&quot;mu&quot; . 956)&#xA;     (&quot;nu&quot; . 957)&#xA;     (&quot;xi&quot; . 958)&#xA;     (&quot;omicron&quot; . 959)&#xA;     (&quot;pi&quot; . 960)&#xA;     (&quot;rho&quot; . 961)&#xA;     (&quot;sigmaf&quot; . 962)&#xA;     (&quot;sigma&quot; . 963)&#xA;     (&quot;tau&quot; . 964)&#xA;     (&quot;upsilon&quot; . 965)&#xA;     (&quot;phi&quot; . 966)&#xA;     (&quot;chi&quot; . 967)&#xA;     (&quot;psi&quot; . 968)&#xA;     (&quot;omega&quot; . 969)&#xA;     (&quot;thetasym&quot; . 977)&#xA;     (&quot;Upsih&quot; . 978)&#xA;     (&quot;piv&quot; . 982)&#xA;     (&quot;ensp&quot; . 8194)&#xA;     (&quot;emsp&quot; . 8195)&#xA;     (&quot;thinsp&quot; . 8201)&#xA;     (&quot;zwnj&quot; . 8204)&#xA;     (&quot;zwj&quot; . 8205)&#xA;     (&quot;lrm&quot; . 8206)&#xA;     (&quot;rlm&quot; . 8207)&#xA;     (&quot;ndash&quot; . 8211)&#xA;     (&quot;mdash&quot; . 8212)&#xA;     (&quot;lsquo&quot; . 8216)&#xA;     (&quot;rsquo&quot; . 8217)&#xA;     (&quot;sbquo&quot; . 8218)&#xA;     (&quot;ldquo&quot; . 8220)&#xA;     (&quot;rdquo&quot; . 8221)&#xA;     (&quot;bdquo&quot; . 8222)&#xA;     (&quot;dagger&quot; . 8224)&#xA;     (&quot;Dagger&quot; . 8225)&#xA;     (&quot;bull&quot; . 8226)&#xA;     (&quot;hellip&quot; . 8230)&#xA;     (&quot;permil&quot; . 8240)&#xA;     (&quot;prime&quot; . 8242)&#xA;     (&quot;Prime&quot; . 8243)&#xA;     (&quot;lsaquo&quot; . 8249)&#xA;     (&quot;rsaquo&quot; . 8250)&#xA;     (&quot;oline&quot; . 8254)&#xA;     (&quot;frasl&quot; . 8260)&#xA;     (&quot;euro&quot; . 8364)&#xA;     (&quot;image&quot; . 8465)&#xA;     (&quot;weierp&quot; . 8472)&#xA;     (&quot;real&quot; . 8476)&#xA;     (&quot;trade&quot; . 8482)&#xA;     (&quot;alefsym&quot; . 8501)&#xA;     (&quot;larr&quot; . 8592)&#xA;     (&quot;uarr&quot; . 8593)&#xA;     (&quot;rarr&quot; . 8594)&#xA;     (&quot;darr&quot; . 8595)&#xA;     (&quot;harr&quot; . 8596)&#xA;     (&quot;crarr&quot; . 8629)&#xA;     (&quot;lArr&quot; . 8656)&#xA;     (&quot;UArr&quot; . 8657)&#xA;     (&quot;rArr&quot; . 8658)&#xA;     (&quot;dArr&quot; . 8659)&#xA;     (&quot;hArr&quot; . 8660)&#xA;     (&quot;forall&quot; . 8704)&#xA;     (&quot;part&quot; . 8706)&#xA;     (&quot;exist&quot; . 8707)&#xA;     (&quot;empty&quot; . 8709)&#xA;     (&quot;nabla&quot; . 8711)&#xA;     (&quot;isin&quot; . 8712)&#xA;     (&quot;notin&quot; . 8713)&#xA;     (&quot;ni&quot; . 8715)&#xA;     (&quot;prod&quot; . 8719)&#xA;     (&quot;sum&quot; . 8721)&#xA;     (&quot;minus&quot; . 8722)&#xA;     (&quot;lowast&quot; . 8727)&#xA;     (&quot;radic&quot; . 8730)&#xA;     (&quot;prop&quot; . 8733)&#xA;     (&quot;infin&quot; . 8734)&#xA;     (&quot;ang&quot; . 8736)&#xA;     (&quot;and&quot; . 8743)&#xA;     (&quot;or&quot; . 8744)&#xA;     (&quot;cap&quot; . 8745)&#xA;     (&quot;cup&quot; . 8746)&#xA;     (&quot;int&quot; . 8747)&#xA;     (&quot;there4&quot; . 8756)&#xA;     (&quot;sim&quot; . 8764)&#xA;     (&quot;cong&quot; . 8773)&#xA;     (&quot;asymp&quot; . 8776)&#xA;     (&quot;ne&quot; . 8800)&#xA;     (&quot;equiv&quot; . 8801)&#xA;     (&quot;le&quot; . 8804)&#xA;     (&quot;ge&quot; . 8805)&#xA;     (&quot;sub&quot; . 8834)&#xA;     (&quot;sup&quot; . 8835)&#xA;     (&quot;nsub&quot; . 8836)&#xA;     (&quot;sube&quot; . 8838)&#xA;     (&quot;supe&quot; . 8839)&#xA;     (&quot;oplus&quot; . 8853)&#xA;     (&quot;otimes&quot; . 8855)&#xA;     (&quot;perp&quot; . 8869)&#xA;     (&quot;sdot&quot; . 8901)&#xA;     (&quot;lceil&quot; . 8968)&#xA;     (&quot;rceil&quot; . 8969)&#xA;     (&quot;lfloor&quot; . 8970)&#xA;     (&quot;rfloor&quot; . 8971)&#xA;     (&quot;lang&quot; . 9001)&#xA;     (&quot;rang&quot; . 9002)&#xA;     (&quot;loz&quot; . 9674)&#xA;     (&quot;spades&quot; . 9824)&#xA;     (&quot;clubs&quot; . 9827)&#xA;     (&quot;hearts&quot; . 9829)&#xA;     (&quot;diams&quot; . 9830)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sorry about non-printable entities, I couldn't get my macros to format them correctly.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-02-12T05:27:28.383" LastActivityDate="2015-02-12T05:27:28.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8168" PostTypeId="2" ParentId="7844" CreationDate="2015-02-12T09:08:22.633" Score="8" Body="&lt;p&gt;Here's how you can tell &lt;code&gt;org-mode&lt;/code&gt; to set &lt;code&gt;buffer-file-name&lt;/code&gt; to an appropriate value for code buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice org-edit-src-code (around set-buffer-file-name activate compile)&#xA;  (let ((file-name (buffer-file-name))) ;; (1)&#xA;    ad-do-it                            ;; (2)&#xA;    (setq buffer-file-name file-name))) ;; (3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Explanation&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-c '&lt;/kbd&gt; is bound to &lt;code&gt;org-edit-special&lt;/code&gt;. According to the documentation (&lt;kbd&gt;C-h f&lt;/kbd&gt; &lt;code&gt;org-edit-special&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;), this command calls &lt;code&gt;org-edit-src-code&lt;/code&gt; when point is in a code block. So in order to achieve what you want, you need to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot;&gt;advise&lt;/a&gt; &lt;code&gt;org-edit-src-code&lt;/code&gt; to make it set &lt;code&gt;buffer-file-name&lt;/code&gt; to the name of the &lt;code&gt;.org&lt;/code&gt; file that contains the source block you will be editing. &lt;strong&gt;Steps&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Cache name of &lt;code&gt;.org&lt;/code&gt; file containing source block to edit.&lt;/li&gt;&#xA;&lt;li&gt;Call original function (&lt;code&gt;org-edit-src-code&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Set &lt;code&gt;buffer-file-name&lt;/code&gt; to cached file name for code buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Based on the research you posted as part of your question, I don't think you need to do anything else to enable Flycheck for code buffers.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-13T08:34:09.070" LastActivityDate="2015-02-13T08:34:09.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8169" PostTypeId="1" AcceptedAnswerId="8173" CreationDate="2015-02-12T09:28:08.223" Score="7" ViewCount="6806" Body="&lt;p&gt;I want to run the Emacs.app in daemon mode on Mac OS X. I can run emacs in daemon mode via the terminal, but instructions for running the app in a client-server pattern do not work (e.g.: &lt;a href=&quot;http://overtone.github.io/emacs-live/doc-starting.html&quot; rel=&quot;noreferrer&quot;&gt;http://overtone.github.io/emacs-live/doc-starting.html&lt;/a&gt;, yet &lt;code&gt;/Applications/Emacs.app/Contents/MacOS/bin/emacsclient&lt;/code&gt; does not exist) with the latest versions of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I run Emacs 24.x app on Mac OS X in daemon mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goals are to start the server on start up (which I know how to do), and, when I launch a client, to launch a new frame in the app version of Emacs which is already running.&lt;/p&gt;&#xA;" OwnerUserId="5485" LastActivityDate="2019-04-15T20:14:53.917" Title="How can I run Emacs 24.x app on Mac OS X in daemon mode" Tags="|osx|emacs-daemon|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8170" PostTypeId="1" AcceptedAnswerId="8232" CreationDate="2015-02-12T11:29:45.617" Score="8" ViewCount="1997" Body="&lt;p&gt;One of my main reasons for using Emacs is to get a powerful environment after &lt;code&gt;ssh&lt;/code&gt;ing into a remote machine. The first thing I do after starting Emacs is to run &lt;code&gt;M-x shell&lt;/code&gt; to get a command line. As it takes a little while for Emacs to start it would be very convenient to have an option to ask Emacs to start a shell when I run it, after parsing my initialization file (I have some shell hooks set up to do one thing and another). Ideally I'd like to be able to run it with an additional option so I wouldn't have to add anything specific to my initialization file on the remote machines (I could set up a &lt;code&gt;bash&lt;/code&gt; alias if I wanted to). Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs afile1 afile2 -startShell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In fact, given that establishing the secure connection takes about 30 seconds, what I'd really like to do is build the &quot;start a shell&quot; into the &lt;code&gt;ssh&lt;/code&gt; command itself, &lt;a href=&quot;https://stackoverflow.com/questions/18522647/run-ssh-and-immediately-execute-command&quot;&gt;using &lt;code&gt;ssh&lt;/code&gt; with &lt;code&gt;-t&lt;/code&gt; to start a screen-based program&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh -t me@remote emacs afile1 afile2 -startShell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I took a look at the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Command_002dLine-Arguments.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;command line arguments documentation&lt;/a&gt; for Emacs but I'm still starting out on Emacs and Lisp and customization and it wasn't immediately obvious how to proceed to deal with command line arguments. How would I go about doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;a href=&quot;https://emacs.stackexchange.com/questions/6025/how-to-use-emacs-to-open-an-eshell-from-terminal-at-a-specific-path/6026#6026&quot;&gt;Related question on &lt;code&gt;eshell&lt;/code&gt;&lt;/a&gt; mentioned by user @Name.)&lt;/p&gt;&#xA;" OwnerUserId="5426" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-02-14T08:12:22.347" Title="How do I start a shell automatically after starting emacs" Tags="|shell|start-up|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8171" PostTypeId="2" ParentId="281" CreationDate="2015-02-12T11:42:10.153" Score="13" Body="&lt;p&gt;As other people have mentioned, powerline is the package that formats the modeline that way. Most emacs themes however, don't define colours for powerline (which is not great). One theme that does is the colourful (and comprehensive) &lt;a href=&quot;https://github.com/kuanyui/moe-theme.el&quot; rel=&quot;noreferrer&quot;&gt;moe-theme&lt;/a&gt;. It even has a mode that changes colour in the evening to be easier on the eyes. It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/17NKo.png&quot; alt=&quot;moe-theme in glorious magenta mode, theming the powerline modeline&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My arrows in the powerline look strange because I'm using an unpatched version of Luxi Mono font.&lt;/p&gt;&#xA;" OwnerUserId="1984" LastActivityDate="2015-02-12T11:42:10.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8172" PostTypeId="1" AcceptedAnswerId="8180" CreationDate="2015-02-12T11:52:54.680" Score="2" ViewCount="182" Body="&lt;p&gt;I'm unable to get any notifications when getting pinged by people, or sending private messages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running on osx and running &lt;code&gt;terminal-notifier&lt;/code&gt; works fine. I've also tried to execute &lt;code&gt;rcirc-notify-page-test&lt;/code&gt; function and it works as expected. However, when people actually send me messages, nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.4.1 (installed via &lt;code&gt;brew&lt;/code&gt;) and I installed &lt;code&gt;rcirc-notify&lt;/code&gt; manually from the current gist master with hash id &lt;code&gt;1198200cd2914fb5116d33cedbc774a1cbc1e1d1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've copied it to &lt;code&gt;~/.emacs.d/lisp&lt;/code&gt; folder, where &lt;code&gt;.emacs.d/&lt;/code&gt; is a symbolic link, and I've configured it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/lisp/&quot;)&#xA;&#xA;(eval-after-load 'rcirc '(require 'rcirc-notify))&#xA;&#xA;;; rcirc settings&#xA;(eval-after-load &quot;rcirc&quot;&#xA;  '(progn&#xA;     ;; List of rooms to join&#xA;     (setq rcirc-server-alist&#xA;       '((&quot;irc.freenode.net&quot; :channels (&quot;#emacs&quot; &quot;#infinispan&quot;))))&#xA;&#xA;     ;; Identification for IRC server connections&#xA;     (setq rcirc-default-user-name &quot;galderz&quot;&#xA;           rcirc-default-nick      &quot;galderz&quot;&#xA;           rcirc-default-full-name &quot;Galder&quot;)&#xA;&#xA;     (message &quot;rcirc has been configured.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to debug this further, or even better, solve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried both terminal and windowed emacs and same thing applies to both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. I've not tried ERC yet...&lt;/p&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="160" LastEditDate="2015-02-12T15:25:20.483" LastActivityDate="2015-02-12T17:30:20.963" Title="Not getting notifications with rcirc-notify in OSX" Tags="|osx|terminal-emacs|irc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8173" PostTypeId="2" ParentId="8169" CreationDate="2015-02-12T11:59:43.097" Score="1" Body="&lt;p&gt;I used &lt;a href=&quot;https://korewanetadesu.com/emacs-on-os-x.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://korewanetadesu.com/emacs-on-os-x.html&lt;/a&gt; and it worked fine, but recently I've installed Emacs via 'brew' and it works much better (less hassle and better daemon experience) for the daemon part: &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsForMacOS#toc16&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/EmacsForMacOS#toc16&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you install it, it says that get emacs to load on startup, execute:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ln -sfv /usr/local/opt/emacs/*.plist ~/Library/LaunchAgents&#xA;$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.emacs.plist&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="5486" LastEditDate="2017-05-05T15:56:24.817" LastActivityDate="2017-05-05T15:56:24.817" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8174" PostTypeId="1" AcceptedAnswerId="8179" CreationDate="2015-02-12T12:44:12.883" Score="7" ViewCount="1499" Body="&lt;p&gt;I'm getting the message &quot;zlib library not found&quot; when I start emacs and I found that &lt;a href=&quot;https://github.com/vermiculus/sx.el/issues/157&quot; rel=&quot;noreferrer&quot;&gt;I need to download zlib&lt;/a&gt;, which is fine. Then I need to put the DLL somewhere, but I can't find where that should be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do the DLLs that emacs depends on need to go?&lt;/p&gt;&#xA;" OwnerUserId="296" LastEditorUserId="253" LastEditDate="2015-02-12T14:49:30.113" LastActivityDate="2015-02-12T14:49:30.113" Title="Where do DLLs go for Emacs 24.4.1 on Windows 7?" Tags="|emacs24.4|microsoft-windows|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8175" PostTypeId="2" ParentId="8157" CreationDate="2015-02-12T13:43:01.437" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://bitbucket.org/Haroogan/emacs-for-windows/&quot; rel=&quot;nofollow&quot;&gt;Haroongan&lt;/a&gt; produces some nice Emacs builds for Windows, both 32 and 64-bit. His builds tend to have as many features available as possible (XPM being one of them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, his Vim builds for Windows include support for all the most recent versions of Lua, Python 2/3, and Ruby, something that's not easy to find.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-12T13:43:01.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8176" PostTypeId="2" ParentId="8104" CreationDate="2015-02-12T13:49:35.047" Score="6" Body="&lt;p&gt;Here's what I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (fboundp 'copyright-update)&#xA;  (setq copyright-names-regexp &quot;Monnier\\|Free Software&quot;)&#xA;  (add-hook 'before-save-hook #'copyright-update))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-06-23T17:04:07.470" LastActivityDate="2017-06-23T17:04:07.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8177" PostTypeId="2" ParentId="8115" CreationDate="2015-02-12T13:57:45.203" Score="14" Body="&lt;p&gt;The sorting order in the *Completions* list is determined by the &lt;code&gt;display-sort-function&lt;/code&gt; property of your completion table (as returned by &lt;code&gt;completion-metadata&lt;/code&gt;).  In your case, your completion table has no such property, so it falls back to the default, which is to sort alphabetically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-presorted-completion-table (completions)&#xA;  (lambda (string pred action)&#xA;    (if (eq action 'metadata)&#xA;        `(metadata (display-sort-function . ,#'identity))&#xA;      (complete-with-action action completions string pred))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(completing-read &quot;test: &quot; (my-presorted-completion-table '(&quot;a&quot; &quot;b&quot; &quot;c&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[ This assumes you're using &lt;code&gt;lexical-binding&lt;/code&gt;.  ]&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-05-29T23:17:56.913" LastActivityDate="2015-05-29T23:17:56.913" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8178" PostTypeId="1" AcceptedAnswerId="8181" CreationDate="2015-02-12T14:28:42.890" Score="1" ViewCount="521" Body="&lt;p&gt;I am using &lt;code&gt;org-confluence-export-as-confluence&lt;/code&gt;.  Confluence (when importing markup) seems to treat every newline as a &quot;hard break&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I'd like to have the output of &lt;code&gt;org-confluence-export-as-confluence&lt;/code&gt; output paragraphs without newlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; setting &lt;code&gt;fill-column&lt;/code&gt; to a large value would make that happen, but I can't figure out how to make &lt;code&gt;org-export-as&lt;/code&gt; use that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((old-fill (default-value 'fill-column))&#xA;    (setq-default fill-column 100000)&#xA;    (org-export-to-buffer 'confluence &quot;*org CONFLUENCE Export*&quot;&#xA;  async subtreep visible-only body-only ext-plist (lambda () (text-mode)))&#xA;  (setq-default fill-column old-fill))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but had no luck.&lt;/p&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2015-02-12T15:38:51.607" Title="Set fill-column in org-export" Tags="|org-export|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8179" PostTypeId="2" ParentId="8174" CreationDate="2015-02-12T14:44:04.287" Score="6" Body="&lt;p&gt;You have two choices:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Place all the associated libraries within the &lt;code&gt;emacs\bin&lt;/code&gt; folder.  This will allow them to be linked as needed&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Place all associated libraries in a folder found on you &lt;code&gt;%PATH%&lt;/code&gt;.  I prefer doing it this way because it ensures that I keep the libraries in place following upgrades.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\bin\&#xA;     +- emacs\ (directory softlink to desired emacs version&#xA;     +- emacs-libs\&#xA;     `- emacs-&amp;lt;version&amp;gt;\&#xA;                     `- bin&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;c:\bin\emacs\bin\&lt;/code&gt; and &lt;code&gt;c:\bin\emacs-libs\&lt;/code&gt; are both stored on my &lt;code&gt;%PATH%&lt;/code&gt;, like this I can keep older versions if necessary (change the softlink when needed) and &lt;code&gt;emacs-libs&lt;/code&gt; will contain the valid &lt;code&gt;.dll&lt;/code&gt;s so that I do not need to copy them over when updating.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-02-12T14:44:04.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8180" PostTypeId="2" ParentId="8172" CreationDate="2015-02-12T15:09:28.113" Score="1" Body="&lt;p&gt;First, make sure you're running &lt;code&gt;(rcirc-notify-add-hooks)&lt;/code&gt; in your config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that rcirc-notify simply does not allow itself to work when &lt;code&gt;window-system&lt;/code&gt; is nil. So if you are running emacs in a terminal, it will never notify you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get around this with some advice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice rcirc-notify (around spoof-window-system activate)&#xA;  (let ((window-system 'spoof))&#xA;    ad-do-it))&#xA;&#xA;(defadvice rcirc-notify-keyword (around spoof-window-system activate)&#xA;  (let ((window-system 'spoof))&#xA;    ad-do-it))&#xA;&#xA;(defadvice rcirc-notify-private (around spoof-window-system activate)&#xA;  (let ((window-system 'spoof))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The internals of these functions do a &lt;code&gt;(when window-system ... )&lt;/code&gt; which is the problem, so you can simply fake a &lt;code&gt;window-system&lt;/code&gt; when calling those functions, and they should work for you.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-02-12T17:30:20.963" LastActivityDate="2015-02-12T17:30:20.963" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8181" PostTypeId="2" ParentId="8178" CreationDate="2015-02-12T15:38:51.607" Score="2" Body="&lt;p&gt;My comment was mistaken, &lt;code&gt;fill-column 0&lt;/code&gt; is not infinite. To make it &quot;infinite&quot; you need to set it to &lt;code&gt;(point-max)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in &lt;code&gt;ox-confluence.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;org-export-define-derived-backend&lt;/code&gt;, add the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(paragraph . org-confluence-paragraph)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;ox-confluence&lt;/code&gt; inherits from &lt;code&gt;ox-ascii&lt;/code&gt;, I took the paragraph function from &lt;code&gt;ox-ascii&lt;/code&gt; and changed it to fill strings with a text-width of &lt;code&gt;(point-max)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-confluence-paragraph (paragraph contents info)&#xA;  (org-ascii--fill-string&#xA;   (if (not (wholenump org-ascii-indented-line-width)) contents&#xA;     (concat&#xA;      ;; Do not indent first paragraph in a section.&#xA;      (unless (and (not (org-export-get-previous-element paragraph info))&#xA;                   (eq (org-element-type (org-export-get-parent paragraph))&#xA;                       'section))&#xA;        (make-string org-ascii-indented-line-width ?\s))&#xA;      (replace-regexp-in-string &quot;\\`[ \t]+&quot; &quot;&quot; contents)))&#xA;   (point-max) info))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add the above function to &lt;code&gt;ox-confluence.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should fix the problem, but I can't find any way to test out Confluence markup, so you'll have to try it yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason &lt;code&gt;fill-column&lt;/code&gt; does nothing here is because &lt;code&gt;ox-ascii&lt;/code&gt; gets the text widths of paragraphs programmatically, and fills using that value.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-12T15:38:51.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8182" PostTypeId="1" AcceptedAnswerId="8231" CreationDate="2015-02-12T15:43:44.950" Score="18" ViewCount="11794" Body="&lt;p&gt;I would like to use org-mode's contributed packages:&#xA;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/&quot;&gt;http://orgmode.org/worg/org-contrib/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT] SOLUTION:&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per answer below:&#xA;1) First one should have the elpa packages added.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;...&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;...&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is described [here] in detail.&lt;a href=&quot;http://orgmode.org/elpa.html&quot;&gt;1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Afterwards, below the lines above, one can add the desired modules like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-checklist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;&lt;br&gt;&#xA;Some packages may be available in the git-hub repository but not yet in the official repository. (e.g org-eww at the time of writing). &#xA;As such, requiring these will cause errors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before adding a requirement, it is reccomended to browse the folder:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d/elpa/org-plus-contrib-&amp;lt;DATE&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-02-17T23:40:38.403" LastActivityDate="2016-12-05T11:39:14.320" Title="how to use org-plus-contrib?" Tags="|org-mode|package|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8183" PostTypeId="1" CreationDate="2015-02-12T16:23:49.320" Score="5" ViewCount="107" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I test if point is inside LaTeX ``quotes,'' and how can I get the bounds of that quote?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LaTeX quotation marks are kooky, typesetting ``text inside a double-quote'' and `text inside a single-quote' for the standard &quot;text inside a double-quote&quot; and 'text inside a single-quote'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to detect if point is inside such a quote (either single or double) and, ideally, return the bounds of the quoted passage.   However, &lt;code&gt;syntax-ppss&lt;/code&gt; does not appear to recognize such passages as strings (re: elements 3 and 8 in the returned list; see &lt;code&gt;parse-partial-sexp&lt;/code&gt; for details).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a predicate function baked-in to AUCTeX to do so?  Many of their functions also have   curious naming conventions, so I may have missed it.  If no such function already exists, what alternatives would work?                                                                 &lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-12T16:37:11.953" Title="detect if inside a LaTeX ``quote'' and return its bounds?" Tags="|latex|auctex|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8184" PostTypeId="2" ParentId="8183" CreationDate="2015-02-12T16:37:11.953" Score="3" Body="&lt;p&gt;You need this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun latex-quote-bnd ()&#xA;  (save-excursion&#xA;    (beginning-of-line)&#xA;    (when (font-latex-match-quotation&#xA;           (line-end-position))&#xA;      (cons&#xA;       (match-beginning 0)&#xA;       (match-end 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found &lt;code&gt;font-latex-match-quotation&lt;/code&gt; simply by following &lt;code&gt;describe-face&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-12T16:37:11.953" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8185" PostTypeId="1" CreationDate="2015-02-12T17:37:25.580" Score="4" ViewCount="137" Body="&lt;p&gt;I frequently forget to start my X server before I fire up emacs. Obviously emacs will attempt to open an X window and fail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In older versions of emacs (I forget when this changed) the behavior was an error message and emacs would exit. In current versions of emacs there is an error message and then emacs starts up in no-window-system mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I restore the older behavior?&lt;/p&gt;&#xA;" OwnerUserId="2350" LastEditorUserId="25" LastEditDate="2015-03-04T15:11:52.387" LastActivityDate="2015-03-04T17:30:15.090" Title="Prevent TTY fallback when X fails" Tags="|display|x11|start-up|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8186" PostTypeId="1" CreationDate="2015-02-12T17:55:40.017" Score="0" ViewCount="201" Body="&lt;p&gt;I am using GNU Emacs 24.3.1 on Mac Mavericks (Darwin Kernel Version 13.4.0). When I run &lt;code&gt;ispell&lt;/code&gt; command I get the error as in the title. I cannot do spell check. Anybody has a hint?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is the part of my .emacs that regards ispell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ispell-program-name &quot;/usr/local/bin/aspell&quot;)&#xA;(setq ispell-program-name &quot;aspell&quot;&#xA;      ispell-dictionary &quot;english&quot;&#xA;      ispell-dictionary-alist&#xA;      (let ((default '(&quot;[A-Za-z]&quot; &quot;[^A-Za-z]&quot; &quot;[']&quot; nil&#xA;                       (&quot;-B&quot; &quot;-d&quot; &quot;english&quot; &quot;--dict-dir&quot;&#xA;                        &quot;/Library/Application Support/cocoAspell/aspell6-en-6.0-0&quot;)&#xA;                       nil iso-8859-1)))&#xA;        `((nil ,@default)&#xA;          (&quot;english&quot; ,@default))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5445" LastEditorUserId="25" LastEditDate="2015-04-19T14:07:09.803" LastActivityDate="2015-04-19T14:07:09.803" Title="aspell exited with signal Trace/BPT trap: 5" Tags="|osx|ispell|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8187" PostTypeId="2" ParentId="8185" CreationDate="2015-02-12T18:38:47.347" Score="0" Body="&lt;p&gt;I don't know actual answer but a workaround would be placing the following snippet on top of your init file to make emacs to exit if X isn't already started.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (eq window-system nil)&#xA;  (kill-emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="224" LastActivityDate="2015-02-12T18:38:47.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8188" PostTypeId="1" AcceptedAnswerId="8192" CreationDate="2015-02-12T20:16:33.760" Score="1" ViewCount="863" Body="&lt;p&gt;I use org-mode with org-pomodoro. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Status bar at the bottom get's pretty long. Like:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-:**- leo.org   Top L50 (org Ind Helm drag Abbrev) [6:08 (bug 459487 - [Gtk] Replace deprecated ......)] [Pomodoro-19:42] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it's only fully visable if there is only a single window(/frame). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to display the status bar in the title bar of emacs instead? (I am using the GUI version of emacs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or alt. Can I shorten it somehow myself via hacks? E.g only show the first xyz chars, and only show the last xyz chars and trim out the middle if it doesn't all fit?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-02-12T20:48:26.483" LastActivityDate="2015-02-12T22:20:46.983" Title="mode-line in title bar?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8189" PostTypeId="2" ParentId="7975" CreationDate="2015-02-12T20:27:07.980" Score="1" Body="&lt;p&gt;I was wondering the same when I started using emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is the &lt;a href=&quot;http://orgmode.org/manual/Initial-visibility.html#Initial-visibility&quot; rel=&quot;nofollow&quot;&gt;initial visibility business&lt;/a&gt;, but I presume that you already know about this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I spent some time looking, but could not find a way to implement this directly. One way to implement this might be to write a custom property and change it when expanding/hiding subtrees, but this would take a lot of effort to write.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, after a while I found that it wasn't really much of a deal for me. I use helm/helm-swoop/worp-goto to quickly find things in my file. (Highly reccomended btw), can be downloaded from &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_package_system.html&quot; rel=&quot;nofollow&quot;&gt;melpa&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also use this function to hide everything except the current header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun org-show-current-heading-tidily ()&#xA;      (interactive)&#xA;      &quot;Show next entry, keeping other entries closed.&quot;&#xA;      (if (save-excursion (end-of-line) (outline-invisible-p))&#xA;          (progn (org-show-entry) (show-children))&#xA;        (outline-back-to-heading)&#xA;        (unless (and (bolp) (org-on-heading-p))&#xA;          (org-up-heading-safe)&#xA;          (hide-subtree)&#xA;          (error &quot;Boundary reached&quot;))&#xA;        (org-overview)&#xA;        (org-reveal t)&#xA;        (org-show-entry)&#xA;        (show-children)))&#xA;&#xA;  (local-set-key (kbd &quot;C-=&quot;) 'org-show-current-heading-tidily)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If curious, this is my full .emacs file:&#xA;&lt;a href=&quot;http://paste.fedoraproject.org/184916/14237726/raw/&quot; rel=&quot;nofollow&quot;&gt;http://paste.fedoraproject.org/184916/14237726/raw/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-02-12T20:27:07.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8190" PostTypeId="2" ParentId="8159" CreationDate="2015-02-12T20:29:09.097" Score="1" Body="&lt;p&gt;@mankoff's solution of using Habits worked.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I enabled habits in org mode via the org-modules variable.&#xA;I enabled state logging (see below for details)&#xA;I then created a task with style set to habits.&#xA;Now when I complete the task, it is not seen until the day it is scheduled again.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;example of a task:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO [#C] Mail / BZ Triage                                        :RECURRING:&#xA;SCHEDULED: &amp;lt;2015-02-13 Fri .+1d&amp;gt;&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2015-02-12 Thu 11:13]&#xA;:PROPERTIES:&#xA;:LAST_REPEAT: [2015-02-12 Thu 11:13]&#xA;:STYLE:    habit&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Details: &lt;a href=&quot;http://orgmode.org/manual/Tracking-your-habits.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/Tracking-your-habits.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5495" LastEditDate="2018-10-30T20:49:57.220" LastActivityDate="2018-10-30T20:49:57.220" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="8191" PostTypeId="2" ParentId="7171" CreationDate="2015-02-12T20:38:26.443" Score="10" Body="&lt;h1&gt;Copying html in org format from &lt;code&gt;eww&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This requires emacs 24.4 or later.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Configure the &lt;code&gt;org-eww&lt;/code&gt; module. It's not part of org, you'll have to pull the repo into some folder (&lt;code&gt;git clone https://orgmode.org/org-mode.git&lt;/code&gt;) or manually copy the &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/lisp/org-eww.el;hb=HEAD&quot;&gt;file&lt;/a&gt; into some package folder, although git is recommended as it helps you keep things up to date.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then add the contribute folder into your path and say that org-eww is required. If you cloned from git, the &lt;code&gt;org-eww.el&lt;/code&gt; file will be in &lt;code&gt;/path/where/you/cloned/org-mode/contrib/lisp/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-to-list 'load-path &quot;/dir/path/containing/org-eww.el/&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'org-eww)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Open a web-page in &lt;code&gt;eww&lt;/code&gt; (eww is a browser in emacs, &lt;code&gt;M-x eww&lt;/code&gt;). You can get emacs to open links in eww via: &lt;code&gt;(setq browse-url-browser-function 'eww-browse-url)&lt;/code&gt;. This is useful in combination with helm-google + eww).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Select the region you want to copy from the html page and do &lt;code&gt;M-x org-eww-copy-for-org-mode&lt;/code&gt;. If no region is selected, the whole webpage is copied (including links to images). As of now the &lt;code&gt;o&lt;/code&gt; key is not bound to the &lt;code&gt;eww-mode-map&lt;/code&gt;. For convenience, this command can be bound to that key in that mode map:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key eww-mode-map (kbd &quot;o&quot;) #'org-eww-copy-for-org-mode)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then use &lt;code&gt;C-y&lt;/code&gt; to paste into your org mode file/buffer. With &lt;code&gt;iimage-mode&lt;/code&gt; you can even see the images from the website and links are converted to the org-mode format.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="115" LastEditDate="2015-02-12T21:29:58.357" LastActivityDate="2015-02-12T21:29:58.357" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8192" PostTypeId="2" ParentId="8188" CreationDate="2015-02-12T20:54:23.907" Score="3" Body="&lt;p&gt;It's certainly possible to get the mode line into the frame's title.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter&#xA;        nil 'title (format-mode-line mode-line-format))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll have to figure out when and how to update it.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-02-12T20:54:23.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8193" PostTypeId="1" AcceptedAnswerId="8194" CreationDate="2015-02-12T21:02:58.063" Score="5" ViewCount="724" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; where do untracked &lt;code&gt;.#files&lt;/code&gt; come from when working in a git repository?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When working on file &lt;code&gt;example.txt&lt;/code&gt; in a &lt;code&gt;git&lt;/code&gt; repository, I occasionally get an untracked file showing up in status titled &lt;code&gt;.#example.txt&lt;/code&gt; (that is, dot-hash-filename).  (This happens both in &lt;code&gt;magit's&lt;/code&gt; status buffer and when running &lt;code&gt;git status&lt;/code&gt; from the command line, so it seems to be Emacs-related but not &lt;code&gt;magit&lt;/code&gt;-related.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is causing the appearance of untracked files of this sort?  It does not appear to be a standard auto-save file (or at least I've never seen the &lt;code&gt;.#&lt;/code&gt; prefix before.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-13T15:46:33.607" Title="untracked &quot;.#file&quot; in a git repository?" Tags="|git|auto-save|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8194" PostTypeId="2" ParentId="8193" CreationDate="2015-02-12T21:14:25.433" Score="8" Body="&lt;p&gt;Those are &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Locks.html&quot;&gt;lock files&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When two users edit the same file at the same time, they are likely to&#xA;  interfere with each other. Emacs tries to prevent this situation from&#xA;  arising by recording a file lock when a file is being modified. Emacs&#xA;  can then detect the first attempt to modify a buffer visiting a file&#xA;  that is locked by another Emacs job, and ask the user what to do. The&#xA;  file lock is really a file, a symbolic link with a special name,&#xA;  stored in the same directory as the file you are editing. (On file&#xA;  systems that do not support symbolic links, a regular file is used.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To disable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq create-lockfiles nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How I knew this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen these before, but I couldn't remember what they were or how I disabled them. A simple search in the Emacs source code found the file &lt;code&gt;src/filelock.c&lt;/code&gt;, which reminded me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ag --cc '\.#'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-12T21:14:25.433" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8195" PostTypeId="1" AcceptedAnswerId="8217" CreationDate="2015-02-12T21:24:17.800" Score="1" ViewCount="850" Body="&lt;p&gt;I want to set the title of emacs to be the mode-line when ever it changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt; solution:&lt;br&gt;&#xA;As pointed to by the answer below, &#xA;&lt;code&gt;(setq frame-title-format mode-line-format)&lt;/code&gt; solved things elegantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Original question bits:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can set the emacs title via:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter nil 'title (concat &quot;*GNU EMACS* &quot; (format-mode-line mode-line-format)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For this, I would like to hook into the mode-line. But does it have a hook? How could I find out if it has a change-hook?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At present, I use a timer that updates it every 5 seconds, but this is not so elegant.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;-- Timer to update title of emacs during a pomodoro.&#xA;(defun my/pomodoro-start-title-update-timer ()&#xA;  (interactive)&#xA;  (setq pomodoro-title-update-timer    (run-at-time (current-time) 5&#xA;                 'my/set-title-to-mode-line)))&#xA;&#xA;;-- I don't use the below, but useful:&#xA;(defun my/kill-pomodoro-timer ()&#xA;  (interactive)&#xA;  (cancel-timer pomodoro-title-update-timer )&#xA;)&#xA;&#xA;(defun my/set-title-to-mode-line ()&#xA;  &quot;Sets the title of the emacs window to the mode line. Used by pomodoro timer.&quot;&#xA;  (interactive)&#xA;  (set-frame-parameter nil 'title (concat &quot;*GNU EMACS* &quot; (format-mode-line mode-line-format)))&#xA;)&#xA;&#xA;;-- Start the timer. TODO: change this to be a hook for when the mode-line changes.&#xA;(my/pomodoro-start-title-update-timer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt;&lt;br&gt;&#xA;I have tried adding a hook to &lt;code&gt;post-command-hook&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook &#xA;  (lambda ()&#xA;  'my/set-title-to-mode-line&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this only updates the the title if I change between buffers. The ticking of the pomodoro [Pomodoro~22:56] -&gt; [Pomodoro~22:55] etc.. doesn't actually trigger this hook. &#xA;So I can use the above for general purpose, and a timer for when pomodoro is active at present.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-02-13T15:58:47.677" LastActivityDate="2015-02-13T15:58:47.677" Title="Hook for mode-line changes?" Tags="|mode-line|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8196" PostTypeId="2" ParentId="8188" CreationDate="2015-02-12T21:35:00.017" Score="7" Body="&lt;p&gt;You can set &lt;code&gt;frame-title-format&lt;/code&gt; to control the template used for frame titles. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want the frame title to match the mode-line, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-title-format mode-line-format)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This approach differs from using &lt;code&gt;set-frame-parameter&lt;/code&gt; in a couple ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The title format is used to set the title on all frames, rather than on a single frame.&lt;/li&gt;&#xA;&lt;li&gt;The title format gets re-evaluated automatically. If you set the title parameter directly you will need some way to update it manually when something changes. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since your specific example is about &lt;code&gt;org-pomodoro&lt;/code&gt;, you could consider adding the current pomodoro timer to the frame title rather than copying the whole mode line up there. &#xA;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-title-format '(&quot;&quot; invocation-name &quot;@&quot; system-name &quot; &quot; org-pomodoro-mode-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this approach you should not need any timers or anything else. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-12T22:20:46.983" LastActivityDate="2015-02-12T22:20:46.983" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8197" PostTypeId="1" AcceptedAnswerId="8198" CreationDate="2015-02-12T22:01:59.930" Score="4" ViewCount="1459" Body="&lt;p&gt;Is there a good way (e.g. examining the value of some variable or the existence of some function) for Elisp code to determine whether the current Emacs instance is running as an X11 application?&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2015-02-12T22:43:20.963" Title="How can init file tell if running under X11?" Tags="|elisp|x11|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8198" PostTypeId="2" ParentId="8197" CreationDate="2015-02-12T22:14:55.390" Score="5" Body="&lt;p&gt;To quote the documentation:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;window-system is a variable defined in `C source code'.&#xA;Its value is x&#xA;It is a terminal-local variable; global value is the same.&lt;/p&gt;&#xA;&lt;p&gt;Documentation:&#xA;Name of window system through which the selected frame is displayed.&#xA;The value is a symbol:&#xA;nil for a termcap frame (a character-only terminal),&#xA;'x' for an Emacs frame that is really an X window,&#xA;'w32' for an Emacs frame that is a window on MS-Windows display,&#xA;'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,&#xA;'pc' for a direct-write MS-DOS frame.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So you can test like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (eq window-system 'x)&#xA;   ;; do this in X11&#xA;   (blah blah blah)&#xA;   ;; otherwise, do this&#xA;   (blah blah blah)&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-12T22:22:04.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8200" PostTypeId="2" ParentId="8197" CreationDate="2015-02-12T22:43:20.963" Score="3" Body="&lt;p&gt;You can use the function &lt;code&gt;display-graphics-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(display-graphic-p &amp;amp;optional DISPLAY)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return non-nil if DISPLAY is a graphic display. Graphical displays are&#xA;  those which are capable of displaying several frames and several&#xA;  different fonts at once.  This is true for displays that use a window&#xA;  system such as X, and false for text-only terminals. DISPLAY can be a&#xA;  display name, a frame, or nil (meaning the selected frame's display).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that use of the variable &lt;code&gt;window-system&lt;/code&gt; is not recommended, from the elisp manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Do &lt;em&gt;not&lt;/em&gt; use &lt;code&gt;window-system&lt;/code&gt; and &lt;code&gt;initial-window-system&lt;/code&gt; as&#xA;  predicates or boolean flag variables, if you want to write code that&#xA;  works differently on text terminals and graphic displays.  That is&#xA;  because &lt;code&gt;window-system&lt;/code&gt; is not a good indicator of Emacs capabilities&#xA;  on a given display type.  Instead, use &lt;code&gt;display-graphic-p&lt;/code&gt; or any of&#xA;  the other &lt;code&gt;display-*-p&lt;/code&gt; predicates described in *note Display Feature&#xA;  Testing::.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-02-12T22:43:20.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8202" PostTypeId="1" AcceptedAnswerId="8210" CreationDate="2015-02-12T23:58:18.263" Score="5" ViewCount="2211" Body="&lt;p&gt;Suppose I have some headlines that look like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Parent&#xA;** TODO Sub Head1&#xA;   CLOCK: [2015-02-09 Mon 07:00]--[2015-02-09 Mon 07:08] =&amp;gt;  0:08&#xA;*** TODO Sub Sub Head&#xA;    CLOCK: [2015-02-09 Mon 19:20]--[2015-02-09 Mon 19:24] =&amp;gt;  0:04&#xA;** TODO Sub Head2&#xA;   CLOCK: [2015-02-09 Mon 07:08]--[2015-02-09 Mon 07:11] =&amp;gt;  0:03&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if I have a clock table report defined like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 2 :scope file :formula &quot;$4='(random)::@2$4='(vsum @3$4)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a custom formula that computes a value. To illustrate my problem, I've used (random) as a way to populate a column. How do I then sum up the results?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Headline           | Time   |      |                     |&#xA;|--------------------+--------+------+---------------------|&#xA;| *Total time*       | *0:15* |      |              #ERROR |&#xA;|--------------------+--------+------+---------------------|&#xA;| TODO Parent        | 0:15   |      |  796400794509121126 |&#xA;| \__ TODO Sub Head1 |        | 0:12 | 2086072072269781784 |&#xA;| \__ TODO Sub Head2 |        | 0:03 | 1733653844633948893 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've used the formula debugger &lt;kbd&gt;C-f&lt;/kbd&gt; &lt;kbd&gt;{&lt;/kbd&gt; and I can see that my vsum invocation is receiving the cell values as propertized strings. Is there a way to compute that sum and lay it down in that cell where the #ERROR resides?&lt;/p&gt;&#xA;" OwnerUserId="48" LastActivityDate="2015-02-13T11:29:43.203" Title="In an orgmode clock report table, how do I sum a column that was computed with another formula?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8203" PostTypeId="1" CreationDate="2015-02-13T01:36:33.610" Score="2" ViewCount="141" Body="&lt;p&gt;I'm running&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat /etc/debian_version&#xA;jessie/sid&#xA;$ uname -rv&#xA;3.11-2-amd64 #1 SMP Debian 3.11.8-1 (2013-11-13)&#xA;$ gcc --version | head -n 1&#xA;gcc (Debian 4.8.2-1) 4.8.2&#xA;$ emacs --version | head -n 1&#xA;GNU Emacs 24.3.1&#xA;$ gpg --version | head -n 1&#xA;gpg (GnuPG) 1.4.15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The current (minimal) extent of my crypto use is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;My local workstation's hard drives, and its backups, are encrypted.&lt;/li&gt;&#xA;&lt;li&gt;I regularly use SSH with key authentication and &lt;code&gt;keychain&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I send unencrypted email from Emacs using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/smtpmail.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smtpmail&lt;/code&gt;&lt;/a&gt;, but I connect to my email service with &lt;a href=&quot;https://en.wikipedia.org/wiki/Transport_Layer_Security&quot; rel=&quot;nofollow&quot;&gt;TLS&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, someone I know recently had their &lt;a href=&quot;https://en.wikipedia.org/wiki/Email_spoofing&quot; rel=&quot;nofollow&quot;&gt;email spoofed&lt;/a&gt; with non-trivial consequences, so I'm thinking I should start securely signing my outgoing email with a public key. So I've got some clueless/lazy/newbie questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What's the easiest way to sign my outgoing email? Particularly, can I do this (easily) with &lt;code&gt;smtpmail&lt;/code&gt; or must I convert to one of the many more-capable &lt;a href=&quot;http://www.emacswiki.org/emacs/CategoryMail&quot; rel=&quot;nofollow&quot;&gt;Emacs email clients&lt;/a&gt;? Which I've been putting off for, oh, about 20 years now :-)&lt;/li&gt;&#xA;&lt;li&gt;What must I {do, get, have} in order to generate keys with which to sign outgoing email?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note again that I'm not yet ready to encrypt my outgoing mail (though I should probably be preparing to do that): for now I just want to securely sign it to {deter, reduce harm from} spoofing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pointers to docs are appreciated: I RTFM when I know what to read, but have been unable to find suitable-fine-looking doc with either &lt;a href=&quot;https://duckduckgo.com/privacy&quot; rel=&quot;nofollow&quot;&gt;DDG&lt;/a&gt; nor &lt;a href=&quot;https://www.google.com/&quot; rel=&quot;nofollow&quot;&gt;their main competitor&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="5444" LastEditDate="2015-02-13T01:45:58.240" LastActivityDate="2015-03-16T08:04:13.347" Title="crypto-newbie: how to securely sign outgoing email with `smtpmail` (or simplest alternative)?" Tags="|email|linux|security|gnutls|debian|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8204" PostTypeId="2" ParentId="7361" CreationDate="2015-02-13T05:21:03.027" Score="5" Body="&lt;p&gt;Use emacs' &lt;code&gt;hideshow&lt;/code&gt;. You can keep your cursor anywhere &amp;amp; to hide blocks 'n' level below it, use the command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c @ C-l&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, n is a numeric prefix argument that gets set by pressing &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u 1 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Read more about hsmode here,&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html&quot; rel=&quot;noreferrer&quot;&gt;hs-mode&lt;/a&gt;.&#xA;More about prefix arguments here,&#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html&quot; rel=&quot;noreferrer&quot;&gt;prefix args&lt;/a&gt;&#xA;hs mode doesn't work on Default mode. You need to have js2-mode (or) js-mode in place for this to work.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-02-13T05:28:15.157" LastActivityDate="2015-02-13T05:28:15.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8205" PostTypeId="1" AcceptedAnswerId="8207" CreationDate="2015-02-13T06:24:16.007" Score="2" ViewCount="638" Body="&lt;p&gt;Normally when I run &lt;code&gt;helm-find-files&lt;/code&gt; I'm immediately shown a list of files in the current directory. Sometimes, however, helm just gives me an empty window. I can start navigating my filesystem in that window like normal, but I have to start navigation from the root of my filesystem. It's as if helm didn't/couldn't figure out the directory of the file I'm editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I see this problem if my cursor is at the very beginning of a typical HTLM file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;&#xA;^ point is here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or at the end of a line with a meta tag:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;&#xA;                          ^ point is here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the point is anywhere else in those lines, &lt;code&gt;helm-find-files&lt;/code&gt; works as expected. In those positions, though, it seems like helm gets confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question: Is this expected behavior? I know that helm is complex (heck, it's probably self-aware), and it may well be that this is the &quot;correct&quot; behavior somehow. If this is expected, can someone explain why? I just need a better mental model of what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is not expected behavior, I'll likely file an issue with helm. I just wanted to do some due diligence before that, though.&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2016-04-27T14:47:22.967" Title="Why does `helm-find-files` change behavior depending on my current location?" Tags="|helm|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8206" PostTypeId="2" ParentId="8202" CreationDate="2015-02-13T06:30:34.900" Score="2" Body="&lt;p&gt;The problem is that you have an error in your sum formula. You declared it as a lisp form using &lt;code&gt;='(vsum @3$4)&lt;/code&gt;, but since vsum is a calc command the correct syntax in table formulas is just &lt;code&gt;=vsum(@3$4)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2015-02-13T06:30:34.900" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8207" PostTypeId="2" ParentId="8205" CreationDate="2015-02-13T07:15:28.973" Score="2" Body="&lt;p&gt;helm-find-files tries to interpret the text at point as a file path or an URL. This sometimes is really helpful, since in a free flowing text with filenames you can just position the cursor and jump to the correct path. But it gets confused in some cases. A particularly nagging one for me is its failure to interpret a standard file URL like &lt;code&gt;file:/some/path&lt;/code&gt; correctly - but it deals fine with &lt;code&gt;/some/path&lt;/code&gt;. The leading &lt;code&gt;file:&lt;/code&gt; seems to confuse it, while it again works fine with URLs like &lt;code&gt;http://some/url&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2015-02-13T07:15:28.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8208" PostTypeId="1" AcceptedAnswerId="8209" CreationDate="2015-02-13T08:02:03.037" Score="1" ViewCount="247" Body="&lt;p&gt;How to print, all file extensions &amp;amp; the mapped major modes (and possibly minor modes...) in emacs?&#xA;like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*.js     js-mode&#xA;*.json   js-mode&#xA;*.c      c-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which global map variable contains this information?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-02-13T08:28:29.127" Title="Major mode map in emacs" Tags="|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8209" PostTypeId="2" ParentId="8208" CreationDate="2015-02-13T08:28:29.127" Score="4" Body="&lt;p&gt;That information is a &lt;code&gt;F1 v auto-mode-alist&lt;/code&gt; away which displays the variable &lt;code&gt;auto-mode-alist&lt;/code&gt; that holds the associations between file names and major modes.  As its docstring points out similiar lists playing a role would be &lt;code&gt;interpreter-mode-alist&lt;/code&gt; (which uses shebangs) and the more generic &lt;code&gt;magic-mode-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-13T08:28:29.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8210" PostTypeId="2" ParentId="8202" CreationDate="2015-02-13T11:29:43.203" Score="7" Body="&lt;p&gt;Hoping to provide a little more value to this answer, here's some explanation (to the best of my knowledge) of how Org processes the table formulae.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Org splits formulae on &lt;code&gt;::&lt;/code&gt; into simpler expressions.&lt;/li&gt;&#xA;&lt;li&gt;Org replaces the range expressions with the actual values extracted from the table columns.&lt;/li&gt;&#xA;&lt;li&gt;If the formula is a Calc expression, it calls &lt;code&gt;calc-eval&lt;/code&gt; on it and then parses the result of &lt;code&gt;calc-eval&lt;/code&gt; to give the final result.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now, to figure out what Calc does with your formula you can do the following (the example should explain it better):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Assume Org substituted the range expression with actual values&#xA;;; and the destination with some variable it knows to get back&#xA;(calc-eval &quot;x=vsum(1, 2, 3)&quot;)&#xA;&quot;x = 6&quot;&#xA;;; And here's how you can see what Calc will do to the formula,&#xA;;; the so-called AST (abstract syntax tree), which also tells you&#xA;;; what function you would need to call from ELisp to get the&#xA;;; same result as you would have by specifying the corresponding&#xA;;; formula.&#xA;(math-read-exprs &quot;x=vsum(1, 2, 3)&quot;)&#xA;((calcFunc-eq (var x var-x) (calcFunc-vsum 1 2 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, in the end, you could have used a formula like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @3$4..@&amp;gt;$4='(random)::@2$4='(apply 'calcFunc-vsum (mapcar 'string-to-number '(@3$4..@&amp;gt;$4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you could test it in the &lt;code&gt;*scratch*&lt;/code&gt; buffer to see that, if you are running on a 32-bit system, you'd get an integer result, but on 64-bit system, the result might look something like: &lt;code&gt;(bigpos 815607762 964955910 2)&lt;/code&gt; because Calc uses 32-bit arithmetic. And this would be invalid as the table value.  So, you could either do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @3$4..@&amp;gt;$4='(random)::@2$4='(math-format-value (apply 'calcFunc-vsum (mapcar 'string-to-number '(@3$4..@&amp;gt;$4))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which would take care of all kinds of data-structures that Calc understands (such as dates, errors, complex numbers). Or, in a simpler case, you could use Emacs-lisp mathematics:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @3$4..@&amp;gt;$4='(random)::@2$4='(reduce '+ (mapcar 'string-to-number (list @3$4..@&amp;gt;$4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-13T11:29:43.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8211" PostTypeId="1" AcceptedAnswerId="8215" CreationDate="2015-02-13T13:36:59.063" Score="5" ViewCount="812" Body="&lt;p&gt;I'm new to Emacs and Org-mode, this is a very basic question. Unfortunately the keywords are too common for me to find the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to create a custom pattern to colour my writing input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;_theorem:&lt;/strong&gt; (it would detect _ and a non-whitespace character for the start, and would trace it until the end, or colon)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;_theorem 2:&lt;/strong&gt; (it would be great if this could also include whitespaces)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;_theorem on topic 1:&lt;/strong&gt; (such as this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The script would thus automatically color all of the above writing that is now in bold. References that would help me do this would also be helpful. Many thanks for helping a beginner!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added a follow-up question in the comments on adding multiple such rules that ran into problems. Here's the full code for it. While the first answer to the first question is working perfectly now, the other two new rules seem to be mistakenly formulated or in conflict somehow. On the instances where either of them is found, it breaks the regular  coloring of org-mode and does no coloring itself.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;                (font-lock-add-keywords nil&#xA;                                    '((&#xA;                                    &quot;\\(^\\|\\s-+\\)\\(_\\([a-zA-Z0-9]+\\s-?\\)\\{0,4\\}:\\)&quot; 2&#xA;                                    font-lock-type-face t)))&#xA;                (font-lock-add-keywords nil&#xA;                                    '((&#xA;                                    &quot;\\(\\w+\\(\\s-&amp;amp;\\s-\\w+\\)?,\\s-[0-9]\\{4\\})&quot; 2&#xA;                                    font-lock-type-face t)))&#xA;                (font-lock-add-keywords nil&#xA;                                    '((&#xA;                                    &quot;^\\w+:&quot; 2&#xA;                                       font-lock-type-face t)))&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5492" LastEditorUserId="253" LastEditDate="2015-02-13T19:31:49.140" LastActivityDate="2016-10-16T04:59:01.820" Title="Color-code a new generic character combination" Tags="|org-mode|font-lock|syntax-highlighting|colors|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8212" PostTypeId="1" AcceptedAnswerId="8216" CreationDate="2015-02-13T14:10:20.387" Score="5" ViewCount="565" Body="&lt;p&gt;Currently Emacs calculator (&lt;code&gt;calculator&lt;/code&gt; not &lt;code&gt;calc&lt;/code&gt;) only shows, up to three digit decimal values. &#xA;For example calculating &lt;code&gt;22/7&lt;/code&gt; gives &lt;code&gt;3.143&lt;/code&gt;. &#xA;Is it possible to increase the number of displayed digit decimal in Emacs calculator?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="14920" LastEditDate="2018-09-04T13:52:46.660" LastActivityDate="2018-09-04T13:52:46.660" Title="How to increase the number of displayed digit decimals in Emacs calculator" Tags="|numbers|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8213" PostTypeId="2" ParentId="8212" CreationDate="2015-02-13T14:20:12.047" Score="1" Body="&lt;p&gt;This is an easy one: &lt;kbd&gt;p&lt;/kbd&gt; the number entered afterwards controls the precision of floating-point calculations.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-13T14:20:12.047" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8214" PostTypeId="2" ParentId="8212" CreationDate="2015-02-13T14:22:17.830" Score="2" Body="&lt;p&gt;&lt;code&gt;p&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the manual, available in emacs here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(info &quot;(calc)Precision&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;7.2 Precision&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The ‘p’ (‘calc-precision’) command controls the precision to which&#xA;floating-point calculations are carried.  The precision must be at least&#xA;3 digits and may be arbitrarily high, within the limits of memory and&#xA;time.  This affects only floats: Integer and rational calculations are&#xA;always carried out with as many digits as necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ‘p’ key prompts for the current precision.  If you wish you can&#xA;instead give the precision as a numeric prefix argument.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-02-13T14:22:17.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8215" PostTypeId="2" ParentId="8211" CreationDate="2015-02-13T14:40:39.420" Score="10" Body="&lt;p&gt;You can use &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/font-lock-add-keywords&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;font-lock-add-keywords&lt;/code&gt;&lt;/a&gt; to add custom highlights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the below example, I am highlighting any string &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;that begins with &lt;code&gt;_&lt;/code&gt; preceded by a white-space character or beginning of the line&lt;/li&gt;&#xA;&lt;li&gt;followed by a single alpha-numeric character&lt;/li&gt;&#xA;&lt;li&gt;followed by anything else&lt;/li&gt;&#xA;&lt;li&gt;ending with &lt;code&gt;:&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The highlight color chosen is &lt;a href=&quot;http://doc.endlessparentheses.com/Var/font-lock-warning-face&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;font-lock-warning-face&lt;/code&gt;&lt;/a&gt;; you can choose any other face of your liking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This highlighting will happen only in &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (font-lock-add-keywords nil&#xA;                                    '((&quot;\\(^\\|\\s-+\\)\\(_[a-zA-Z0-9].*?:\\)&quot; 2&#xA;                                       font-lock-warning-face t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To match at most 4 words before the colon,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (font-lock-add-keywords nil&#xA;                                    '((&quot;\\(^\\|\\s-+\\)\\(_\\w+\\(?:\\s-+\\w+\\)\\{0,3\\}\\s-*:\\)&quot; 2&#xA;                                       font-lock-warning-face t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preview of the &quot;max 4 words&quot; regexp in &lt;code&gt;re-builder&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sl4ub.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alright, I can't keep on updating this as your question changes. I would suggest that you spend adequate time understanding the elisp regular expression syntax and how the &lt;code&gt;font-lock-add-keywords&lt;/code&gt; function works.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Elisp Regular Expression&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;font-lock-add-keywords&lt;/code&gt; - Do &lt;code&gt;C-h f font-lock-add-keywords RET&lt;/code&gt; in emacs and then click on the &lt;code&gt;font-lock.el&lt;/code&gt; hyperlink in the buffer that opens. That will take you to the function definition. Read the doc-string for that function. &lt;/li&gt;&#xA;&lt;li&gt;In a similar fashion, you can learn more about any variable by doing &lt;code&gt;C-h v VARIABLE-NAME RET&lt;/code&gt; and jumping through the hyperlinks.&lt;/li&gt;&#xA;&lt;li&gt;Keep on experimenting with &lt;code&gt;re-builder&lt;/code&gt; till you get a hang of the regexp syntax.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Below is the solution to your last modified request.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (font-lock-add-keywords&#xA;             nil&#xA;             '(&#xA;               ;; Highlight upto 4 words (including ,) between ( and )&#xA;               (&quot;\\(([a-zA-Z0-9,]+\\(?:\\s-+[a-zA-Z0-9,]+\\)\\{0,3\\})\\)&quot; 1 font-lock-type-face)&#xA;               ;; Highlight ^word:&#xA;               (&quot;^\\([a-zA-Z0-9]+:\\)&quot; 1 font-lock-type-face)&#xA;               ;; Highlight upto 4 words between _ and :&#xA;               (&quot;\\(^\\|\\s-+\\)\\(_[a-zA-Z0-9]+\\(?:\\s-+[a-zA-Z0-9]+\\)\\{0,3\\}\\s-*:\\)&quot; 2 font-lock-type-face)&#xA;               ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Alternative Solution, does the same thing as in Update 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach updates &lt;code&gt;font-lock-keywords-alist&lt;/code&gt; instead of polluting &lt;code&gt;font-lock-keywords&lt;/code&gt;. There is no easy way to fix incorrect regexp added to &lt;code&gt;font-lock-keywords&lt;/code&gt; other than restarting emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But usually &lt;code&gt;font-lock-keywords-alist&lt;/code&gt; is much smaller in size and can be tweaked manually or can be reset completely by doing &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq font-lock-keywords-alist nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while you are testing out the regexp.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(font-lock-add-keywords&#xA; 'org-mode&#xA; '(&#xA;   ;; Highlight upto 4 words (including ,) between ( and )&#xA;   (&quot;\\(([a-zA-Z0-9,]+\\(?:\\s-+[a-zA-Z0-9,]+\\)\\{0,3\\})\\)&quot; 1 font-lock-type-face)&#xA;   ;; Highlight ^word:&#xA;   (&quot;^\\([a-zA-Z0-9]+:\\)&quot; 1 font-lock-type-face)&#xA;   ;; Highlight upto 4 words between _ and :&#xA;   (&quot;\\(^\\|\\s-+\\)\\(_[a-zA-Z0-9]+\\(?:\\s-+[a-zA-Z0-9]+\\)\\{0,3\\}\\s-*:\\)&quot; 2 font-lock-type-face)&#xA;   )&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-13T19:37:30.033" LastActivityDate="2015-02-13T19:37:30.033" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="8216" PostTypeId="2" ParentId="8212" CreationDate="2015-02-13T14:58:52.473" Score="7" Body="&lt;p&gt;In &lt;code&gt;calculator&lt;/code&gt; mode, &lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt; control how many digits are displayed.&lt;/p&gt;&#xA;" OwnerUserId="321" LastActivityDate="2015-02-13T14:58:52.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8217" PostTypeId="2" ParentId="8195" CreationDate="2015-02-13T15:15:54.257" Score="3" Body="&lt;p&gt;The mode line and frame title are automatically refreshed by evaluating their respective format variables. In general the best approach is to use the appropriate format variables and allow Emacs to decide when to update them. See &lt;code&gt;mode-line-format&lt;/code&gt; and &lt;code&gt;frame-title-format&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are cases where you have something in your mode line (or frame title) that should be updated immediately based on some event. The &lt;code&gt;force-mode-line-update&lt;/code&gt; function supports this: you can include a function in your mode-line format and whenever the relevant state changes you can force an update to have your format function called. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There doesn't appear to be an equivalent for the frame title, but from &lt;a href=&quot;https://stackoverflow.com/a/13667796/1387859&quot;&gt;this SO answer&lt;/a&gt; is appears you can call &lt;code&gt;(sit-for 0)&lt;/code&gt; to force a frame redisplay, which will cause the frame title format to be reevaluated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to do something every time the mode line might change, the closest thing is probably the &lt;code&gt;post-command-hook&lt;/code&gt; as others have noted in the comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your goal here is to have the frame title match the mode line, this simplest approach is use the same format for both as noted &lt;a href=&quot;https://emacs.stackexchange.com/a/8196/780&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-02-13T15:15:54.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8218" PostTypeId="1" CreationDate="2015-02-13T15:28:05.253" Score="0" ViewCount="259" Body="&lt;p&gt;~Emacs 2.4.1 under Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to use the {est+} feature of column views as documented &lt;a href=&quot;http://orgmode.org/manual/Column-attributes.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I customized &#xA;&lt;code&gt;org-columns-default-Format&lt;/code&gt; to be like this: (see last field)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%50ITEM %TODO %3PRIORITY %TAGS %CLOCKSUM_T(tod) %CLOCKSUM(sum) %5EST{est+}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And a property&#xA;:EST: 1-2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try to activate column view in agenda, I get an error:&#xA;wrong type: sequencep, 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried different format for est: (I'm not sure about syntax of the {est+} property btw?)&#xA;:EST: 1-2&#xA;:EST: 1:00-2:00&#xA;:EST: 1.0-1.1 &#xA;:EST: 1d/2d&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I gather in &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-12/msg00435.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; thread, the correct syntax is 2-4, but that hasn't worked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-12/msg00426.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; thread it appears someone has the same issue as me (Dec 2014) but it's not clear if the issue was solved or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I replace &lt;code&gt;%5EST{est+}&lt;/code&gt; with   &lt;code&gt;%5EST{:}&lt;/code&gt; and only use single digits or time (20:20), then column view works. But it's not quite what I want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thoughts?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="253" LastEditDate="2015-02-13T15:44:16.947" LastActivityDate="2015-04-03T08:16:10.303" Title="How to use {est+} field?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8219" PostTypeId="2" ParentId="8193" CreationDate="2015-02-13T15:46:33.607" Score="5" Body="&lt;p&gt;Nanny's answer is correct, but I'd like to add that disabling lockfiles is not recommended. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They've been added to Emacs for a reason, the same reason that lockfiles were implemented for vim, LibreOffice, Microsoft Office and a host of other programs. Multiple programs editing the same file can be a real pain, leading to mass confusion and possibly nuclear war (okay, maybe not). Rather than disabling the feature, I would suggest working around the files instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you can easily add the line &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.#*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;code&gt;.gitignore&lt;/code&gt; if they annoy you.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-13T15:46:33.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8220" PostTypeId="1" AcceptedAnswerId="8221" CreationDate="2015-02-13T16:20:47.037" Score="2" ViewCount="258" Body="&lt;p&gt;I.e&#xA;In elisp, from inside an .el file, you can make functions global like this:&#xA;&lt;code&gt;(provide 'org-pomodoro)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in my personal .emacs, I would like to access (pull in?) a function that's internal to a library (org-pomodoro) but without actually changing org-pomodoro (as I'm not the maintainer of the package). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g I want to access &lt;code&gt;org-pomodoro-finish&lt;/code&gt; myself to implement the functionality of switching between a task and continuing the pomodoro in another task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this I also need to be able to access a count-variable.  (e.g like ~~org-pomodoro-time)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;&lt;br&gt;&#xA;The solution below works quite well. I can just evaluate (org-pomodoro-finished) and a pomodoro is finished ahead of time. I can then write my own function that will be listed in M-x for convienience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you so much, this opens many doors for me.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-02-13T17:14:33.033" LastActivityDate="2015-02-13T17:14:33.033" Title="Elisp, can I pull-in (provide) a function &amp; variable from a library without changing library?" Tags="|org-mode|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8221" PostTypeId="2" ParentId="8220" CreationDate="2015-02-13T16:25:43.450" Score="4" Body="&lt;p&gt;Emacs Lisp doesn't have a module system, and all symbols are global.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What &lt;code&gt;provide&lt;/code&gt; does is simply putting its parameter onto the list of loaded modules.  &lt;code&gt;require&lt;/code&gt; checks the list, and ensures that the given module has been loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in order to access the &lt;code&gt;org-pomodoro-finish&lt;/code&gt; function, you just need to ensure that the &lt;code&gt;org-pomodoro&lt;/code&gt; module has been loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-pomodoro)&#xA;(org-pomodoro-finish ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-02-13T16:25:43.450" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8222" PostTypeId="1" CreationDate="2015-02-13T17:55:24.873" Score="3" ViewCount="1240" Body="&lt;p&gt;Following my previous question on making custom highlight rules here: &lt;a href=&quot;https://emacs.stackexchange.com/questions/8211/color-code-a-new-generic-character-combination&quot;&gt;Color-code a new generic character combination&lt;/a&gt; &#xA;, I have stumbled on a new issue, that possibly merits another question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a group of three rules that I would like to apply (code below). The first one works, the other two (also when alone) seem to break down something in coloring. Under each Org-mode heading, where these particular instances are found, the headline and its subheadings lose coloring. The instances themselves are not highlighted in any way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regular expressions are tested with the inbuilt regexp-builder. Example instances would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;_Theorem 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Author &amp;amp; Author, 2012)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While for the first rule, the system seems to work, for the other two rules, it instead breaks down the heading coloring.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;                (font-lock-add-keywords nil&#xA;                                    '((&#xA;                                    &quot;\\(^\\|\\s-+\\)\\(_\\([a-zA-Z0-9]+\\s-?\\)\\{0,4\\}:\\)&quot; 2&#xA;                                    font-lock-type-face t)))&#xA;                (font-lock-add-keywords nil&#xA;                                    '((&#xA;                                    &quot;(\\w+\\(\\s-&amp;amp;\\s-\\w+\\)?,\\s-[0-9]\\{4\\})&quot; 2&#xA;                                    font-lock-string-face t)))&#xA;                (font-lock-add-keywords nil&#xA;                                    '((&#xA;                                    &quot;^\\w+:&quot; 2&#xA;                                       font-lock-constant-face t)))&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I am new enough to Emacs that I don't know where exactly the problem should lie. Many thanks if you can point it out, or provide some advice.&lt;/p&gt;&#xA;" OwnerUserId="5492" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-02-15T14:47:30.693" Title="How to make the custom font lock keywords not override the default major mode font lock?" Tags="|org-mode|syntax-highlighting|colors|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8223" PostTypeId="1" CreationDate="2015-02-13T19:14:18.253" Score="3" ViewCount="617" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/vspinu/polymode#basic-usage&quot; rel=&quot;nofollow&quot;&gt;Polymode&lt;/a&gt; is very promising to handle the integration of R chunks using different modes.&lt;br&gt;&#xA;I went through the documentation and it works well when I am inside &lt;code&gt;.Rmd&lt;/code&gt; file but not inside &lt;code&gt;.Rnw&lt;/code&gt;. In the &lt;code&gt;.Rnw&lt;/code&gt; I found the &lt;code&gt;Noweb&lt;/code&gt; mode activated without polymode &lt;code&gt;PM-rmd&lt;/code&gt;. So there must be something wrong with my installation on Windows machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;installation&lt;/strong&gt;&lt;br&gt;&#xA;I installed &lt;code&gt;rmarkdown-mode&lt;/code&gt; from MELPA, BTW this was not shown clearly in the documentation of polymode, I wish there was a requirement section in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was confused about that part of installation:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-path&#xA;      (append '(&quot;path/to/polymode/&quot;  &quot;path/to/polymode/modes&quot;)&#xA;              load-path))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because in Windows, &lt;code&gt;polymode&lt;/code&gt; resides in &lt;code&gt;c:/emacs/.emacs.d/elpa/polymode-20150105.931/&lt;/code&gt; but I don't see the &lt;code&gt;\modes&lt;/code&gt; folder in there! So is the above code needed if I had used &lt;code&gt;install-packages&lt;/code&gt; from MELPA?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed the &lt;code&gt;polymode&lt;/code&gt; package from MELPA. &lt;code&gt;M-x list packages&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;pandoc&lt;/code&gt; installed and checked in the PATH variables by &lt;code&gt;M-x getenv RET PATH RET&lt;/code&gt;; pandoc was there.     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;relevant &lt;code&gt;.init.el&lt;/code&gt; code&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'poly-R)&#xA;(require 'poly-markdown)&#xA;;; Markdown&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.md&quot; . poly-markdown-mode))&#xA;&#xA;;;; R related modes&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rmd&quot; . poly-markdown+r-mode))&#xA;(setq ess-swv-processing-command &quot;%s(%s)&quot;) % this to get rid of .ess_weave() function not found error  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MWE of .Rnw file&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[a4]{scrartcl}&#xA;\begin{document}&#xA;  Here is a code chunk.&#xA;&amp;lt;&amp;lt;demo, fig.height=4,message=FALSE,warning=FALSE&amp;gt;&amp;gt;=&#xA;library(ggplot2)&#xA;summary(cars)&#xA;qplot(speed,dist,data=cars) +&#xA;  geom_smooth()&#xA;@&#xA;You can also write inline expressioins, e.g. $\pi=\Sexpr{pi}$.&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Windows 7 32 bit  &lt;/li&gt;&#xA;&lt;li&gt;Polymode updated from MELPA&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;I used this code right after ESS code in the &lt;code&gt;init.el&lt;/code&gt; and it worked well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'poly-R)&#xA;(require 'poly-markdown)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I realized that for MELPA installation these lines of code in the documentation are irrelevant:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-path&#xA;      (append '(&quot;path/to/polymode/&quot;  &quot;path/to/polymode/modes&quot;)&#xA;              load-path)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-02-14T16:50:27.600" LastActivityDate="2015-02-14T16:50:27.600" Title="Polymode installation on Windows machine" Tags="|ess|polymode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8225" PostTypeId="1" AcceptedAnswerId="8226" CreationDate="2015-02-13T20:19:39.693" Score="11" ViewCount="1210" Body="&lt;p&gt;Occasionally, without meaning to I somehow mash keys or mouse so that I get a secondary selection.  I never use the secondary selection so I would always like to get rid of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I clear the secondary selection without using the mouse?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default bindings for setting the secondary selection are intercepted by my window manager, so do not work in emacs.  I don't really want to rebind these commands to other mouse events either: I use my mouse just for a few things, they work fine and I don't want to change them.  I can't simply run commands like mouse-start-secondary: when I try that, emacs lets me know they have to be bound to an event.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-05-09T20:25:21.463" Title="Clear secondary selection without using mouse" Tags="|key-bindings|mouse|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8226" PostTypeId="2" ParentId="8225" CreationDate="2015-02-13T20:47:40.473" Score="12" Body="&lt;p&gt;You should be able to clear the secondary selection by evaluating:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(delete-overlay mouse-secondary-overlay)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you never want to get the secondary selection I believe you can just unbind the default mouse events:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key [M-mouse-1])&#xA;(global-unset-key [M-drag-mouse-1])&#xA;(global-unset-key [M-down-mouse-1])&#xA;(global-unset-key [M-mouse-3])&#xA;(global-unset-key [M-mouse-2])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-15T23:07:07.913" LastActivityDate="2015-02-15T23:07:07.913" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8227" PostTypeId="2" ParentId="8223" CreationDate="2015-02-13T20:51:11.073" Score="3" Body="&lt;p&gt;You need to add &lt;code&gt;poly-noweb+r-mode&lt;/code&gt; to &lt;code&gt;auto-mode-alist&lt;/code&gt; for &lt;code&gt;Rnw&lt;/code&gt; files. You also need to watch for conflicts with ESS. ESS adds its own mode to &lt;code&gt;auto-mode-alist&lt;/code&gt; for Rnw files, so you have to wait until &lt;em&gt;after&lt;/em&gt; this happens to make sure you over-ride the ESS settings. This is what I have in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'polymode)&#xA;(require 'poly-R)&#xA;(eval-after-load 'ess-site &#xA;  '(progn &#xA;     (add-to-list 'auto-mode-alist '(&quot;\\.[rR]md&quot; . poly-markdown+r-mode))&#xA;     (add-to-list 'auto-mode-alist '(&quot;\\.[rR]nw&quot; . poly-noweb+r-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2015-02-13T21:55:32.960" LastActivityDate="2015-02-13T21:55:32.960" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8228" PostTypeId="1" AcceptedAnswerId="9508" CreationDate="2015-02-13T21:42:46.713" Score="6" ViewCount="1088" Body="&lt;p&gt;Org-mode's Clocktable reports show the task state &quot;TODO/OPEN/DONE&quot; at the beggining of the headline:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|          | TODO  Bug 459487 - [GTK] Replace...     | 7:38    |      |&#xA;|          | OPEN Black Pomodoro App                 | 1:15    |      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to remove these keywords as I don't want them in my weekly reports that I publish to our group. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at the &lt;a href=&quot;http://orgmode.org/manual/The-clock-table.html&quot; rel=&quot;noreferrer&quot;&gt;clock table reference&lt;/a&gt; but could not find a way to filter them out. Perhaps there is some way to write a filter-function.&#xA;Would anyone be able to point me in the direction of how I could write this feature?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-02-23T21:54:49.470" Title="Remove Task state keywords (TODO/DONE) from clocktable reports?" Tags="|org-mode|org-agenda|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8229" PostTypeId="2" ParentId="8225" CreationDate="2015-02-13T21:47:21.627" Score="4" Body="&lt;p&gt;You say that you never want to use the secondary selection. In that case, just bind the keys that are bound to secondary-selection commands by default to commands that you find more useful. Or unbind them, by binding them to &lt;code&gt;nil&lt;/code&gt;.  These are those keys:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;M-mouse-1&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;mouse-start-secondary&lt;/code&gt;, by default)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;M-drag-mouse-1&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;mouse-set-secondary&lt;/code&gt;, by default)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;M-down-mouse-1&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;mouse-drag-secondary&lt;/code&gt;, by default)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;M-mouse-2&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;mouse-yank-secondary&lt;/code&gt;, by default)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;M-mouse-3&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;mouse-secondary-save-then-kill&lt;/code&gt;, by default)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [M-mouse-1] 'a-handy-mouse-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if the problem is that your window manager steals those keys, then consider binding different keys to those commands. For instance, add modifier &lt;code&gt;Control&lt;/code&gt; to each of the default keys: &lt;code&gt;C-M-mouse-1&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [C-M-mouse-1] 'mouse-start-secondary)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if the problem is that you don't want to use the &lt;em&gt;mouse&lt;/em&gt; for manipulating the secondary selection, then you can use the &lt;em&gt;keyboard&lt;/em&gt; instead. Library &lt;a href=&quot;http://www.emacswiki.org/emacs/SecondarySelection#secondary-sel.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;second-sel.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; can help with this and other ways to use the secondary selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you can get rid of the secondary selection interactively anytime this way, if you bind &lt;code&gt;secondary-dwim&lt;/code&gt; to &lt;code&gt;C-M-y&lt;/code&gt; (for example):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-SPC&lt;/code&gt; - to create an empty active region.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-1 C-M-y&lt;/code&gt; - to move the secondary selection to the region (which is empty).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is the doc string of command &lt;code&gt;secondary-dwim&lt;/code&gt;, which &lt;code&gt;second-sel.el&lt;/code&gt; binds by default to &lt;code&gt;C-M-y&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-M-y runs the command secondary-dwim, which is an interactive&#xA;compiled Lisp function in `second-sel.el'.&#xA;&#xA;It is bound to C-M-y, menu-bar edit secondary-dwim.&#xA;&#xA;(secondary-dwim ARG)&#xA;&#xA;Do-What-I-Mean with the secondary selection.&#xA;Prefix arg:&#xA;&#xA; None: Yank secondary.&#xA; Zero: Select secondary as region.&#xA; &amp;gt; 0:  Move secondary to region.&#xA; &amp;lt; 0:  Swap region and secondary.&#xA;&#xA;Details:&#xA;&#xA;No prefix arg: Yank the secondary selection at point.  Move point to&#xA;the end of the inserted text.  Leave mark where it was.&#xA;&#xA;Zero arg: Select the secondary selection and pop to its buffer.&#xA;&#xA;Non-zero arg: Move the secondary selection to this buffer's region.&#xA;&#xA;Negative arg: Also go to where the secondary selection was and select&#xA;it as the region.  That is, swap the region and the secondary&#xA;selection.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:25:21.463" LastActivityDate="2015-05-09T20:25:21.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8230" PostTypeId="2" ParentId="8203" CreationDate="2015-02-14T07:15:47.263" Score="0" Body="&lt;p&gt;With this sort of functionality, you really need to use one of the emacs MTAs. You could do it using smtpmail, but you will have to write quite a bit of elisp glue code to get it working. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other alternative is to setup your emacs to use whatever your preferred email client is rather than smtpmail. Some mail clients have emacs key bindings, so this can be less painful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of the emacs mail clients support using PGP to both sign and encrypt mail as well as verifying mail received from others. I know that gnus, vm and mew do and I think wonderlust possibly does. &lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2015-02-14T07:15:47.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8231" PostTypeId="2" ParentId="8182" CreationDate="2015-02-14T07:53:49.680" Score="9" Body="&lt;p&gt;You shouldn't need to do anything special. I'm running the org-plus-contrib package from the org elpa repository and can just require any of the packages that are included. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did look and org-eww is not in the org-plus-contrib I have.(my version is  20150209)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a (require 'org-checklist) and evaluated it in my scratch buffer and it loaded fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps your org mode isn't loading properly? It is really important that the org-plus-cntrib package is loaded before any org related functions are called. If you have something which references org before you load the org-plus-contrib package, you end up with a mix of the bundled org mode and then the org-plus-contrib package, which can cause some odd behaviour.&lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2015-02-14T07:53:49.680" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8232" PostTypeId="2" ParentId="8170" CreationDate="2015-02-14T08:12:22.347" Score="4" Body="&lt;p&gt;You can use the -f switch to call an emacs function from the command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The comment shows how to do this over ssh using -t and that is one way. However, it does have some disadvantages. The main one is that your running emacs remotely, which means you will need to have all your emacs config stuff on the remote system as well as maintain some locally for your local version. You also lose some flexibility if you want to do stuff locally and remotely and perhaps move in-between.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative would be to run your emacs locally and start a shell from the command line and then ssh from that shell. You can use tramp over ssh to edit files etc and then use the shell to run an interactive ssh session. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -f shell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once your comfortable with that, you could look at some of the ssh related packages out there for emacs. It should then be possible to call a function from one of those packages from the command line to automate the creation of an ssh session. You may need to write a simple wrapper function to make this easier. Then you will have only 1 emacs config setup to manage and you get the additional flexibility.  &lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2015-02-14T08:12:22.347" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8233" PostTypeId="1" AcceptedAnswerId="8236" CreationDate="2015-02-14T08:38:01.923" Score="3" ViewCount="215" Body="&lt;p&gt;I have these settings for dired&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default dired-omit-files-p t)&#xA;(setq dired-omit-files (concat dired-omit-files &quot;\\|^\\..+$&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was wondering if it is possible to hide/disable the message &lt;code&gt;Omitted N lines.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I have a Dired buffer opened, the message appears repeatedly. For example: it appears when I am trying to switch to another&#xA;buffer and when I use &lt;code&gt;smex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is just annoying having the minibuffer cluttered with that message when I am&#xA;trying to do something not strictly related to Dired.&lt;/p&gt;&#xA;" OwnerUserId="219" LastEditorUserId="219" LastEditDate="2015-02-14T08:44:28.017" LastActivityDate="2015-02-14T15:05:20.350" Title="Dired: hide &quot;Omitted N lines&quot; message" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8234" PostTypeId="1" CreationDate="2015-02-14T10:51:05.497" Score="5" ViewCount="357" Body="&lt;p&gt;Say, I got a simple Python code snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def demo(i):&#xA;    if(i):&#xA;        print &quot;True&quot;&#xA;    else:&#xA;        print &quot;False&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I make indent-region for the whole buffer after save using &lt;code&gt;before-save-hook&lt;/code&gt; in my &lt;code&gt;init.el&lt;/code&gt;, so after &lt;code&gt;C-x C-s&lt;/code&gt; in this buffer, it whole buffer will be automatically indented, this works for C and elisp source code perfectly, but in Python code, that code snippet will become:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def demo(i):&#xA;    if(i):&#xA;        print &quot;True&quot;&#xA;else:&#xA;    print &quot;False&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If I put point in &lt;code&gt;else&lt;/code&gt; line, and type &lt;code&gt;TAB&lt;/code&gt;, this line will be indented as it should be as the first code example. &lt;/li&gt;&#xA;&lt;li&gt;If I mark the region of demo function or the whole buffer then type &lt;code&gt;TAB&lt;/code&gt; or C-M-\ which is &lt;code&gt;indent-region&lt;/code&gt;, the &lt;code&gt;else&lt;/code&gt; line  will become the incorrect indention style.&lt;/li&gt;&#xA;&lt;li&gt;If I &lt;code&gt;C-x C-s&lt;/code&gt; to save this buffer which will also execute the &lt;code&gt;indent-region&lt;/code&gt; for the whole buffer as I said early, the &lt;code&gt;else&lt;/code&gt; line will become the incorrect indention style as the later code example.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;https://stackoverflow.com/questions/19611681/emacs-python-indentation-for-single-line-if-else&quot;&gt;https://stackoverflow.com/questions/19611681/emacs-python-indentation-for-single-line-if-else&lt;/a&gt; which was posted a year ago, the problem is not solved yet, so I post it here again to hope someone see it and give some solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BTW&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Emacs 24.4.1&lt;/li&gt;&#xA;&lt;li&gt;built-in python.el&lt;/li&gt;&#xA;&lt;li&gt;Fedora 21 32-bit&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="794" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-03-21T07:38:06.137" Title="Emacs wrongly indent else expression in Python code" Tags="|indentation|python|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8235" PostTypeId="1" AcceptedAnswerId="8239" CreationDate="2015-02-14T12:04:44.547" Score="0" ViewCount="154" Body="&lt;p&gt;For example, I am using M-x occur, and want to edit the default regexp (which is shown in the prompt), and then enter your edited regexp. &#xA;can we edit the default value &lt;code&gt;^ *[[:digit:]]\.[[:digit:]]\.[[:digit:]] +&lt;/code&gt; to create a new input e.g. deleting &lt;code&gt;+&lt;/code&gt; at the end to get &lt;code&gt;^ *[[:digit:]]\.[[:digit:]]\.[[:digit:]]&lt;/code&gt; ?&lt;br&gt;&#xA;The problem is how to move the default value into the editable region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&#xA; &lt;img src=&quot;https://i.stack.imgur.com/fpaEe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2015-02-14T14:50:02.867" LastActivityDate="2015-02-14T14:50:02.867" Title="How to get the default input value in minibuffer and edit it?" Tags="|commands|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8236" PostTypeId="2" ParentId="8233" CreationDate="2015-02-14T13:14:19.267" Score="4" Body="&lt;p&gt;You can disable the omit messages by setting &lt;code&gt;dired-omit-verbose&lt;/code&gt; variable to &lt;code&gt;nil&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom dired-omit-verbose t&#xA;  &quot;When non-nil, show messages when omitting files.&#xA;When nil, don't show messages.&quot;&#xA;  :version &quot;24.1&quot;&#xA;  :type 'boolean&#xA;  :group 'dired-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;- From &lt;code&gt;dired-x.el&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-14T13:14:19.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8237" PostTypeId="1" AcceptedAnswerId="8240" CreationDate="2015-02-14T13:32:30.883" Score="0" ViewCount="280" Body="&lt;p&gt;Tab press in js2-mode goes to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;indent-for-tab-command&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in indent.el. &#xA;This command takes a prefix argument as &lt;code&gt;arg&lt;/code&gt;. Since no prefix arguments are set by &lt;code&gt;C-u&lt;/code&gt;, what gets passed here?&#xA;And internally, &lt;code&gt;indent-for-tab-command&lt;/code&gt; calls &lt;code&gt;insert-tab&lt;/code&gt;, this calculates the variable &lt;code&gt;count&lt;/code&gt; as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefix-numeric-value arg)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then does,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-char ?\t count)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, where is the js2-mode group variable, &lt;code&gt;js2-indent-level&lt;/code&gt; taken into consideration for calculating the number of space chars?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-02-15T02:15:44.493" Title="Debugging Tab command in emacs, js2-mode" Tags="|indentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8238" PostTypeId="2" ParentId="7375" CreationDate="2015-02-14T13:53:05.850" Score="5" Body="&lt;p&gt;This is not yet an answer but I want to keep track of the things I discover here, as they may give someone else an idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to &lt;strong&gt;conditionally modify the value of the cell itself&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can create a formatting function in elisp and then call it from the formula line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results silent&#xA;(defun danger (cell)&#xA;  (if (or (&amp;lt; (string-to-number cell) 1)&#xA;          (&amp;gt; (string-to-number cell) 2))&#xA;        (concat (int-to-string (string-to-number cell)) &quot;!&quot;)&#xA;        cell))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it can be used like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| String | Num | &#xA;|--------+-----| &#xA;| Foo    |   2 | &#xA;| Bar    |   1 | &#xA;| Baz    |  3! | &#xA;|--------+-----|&#xA;#+TBLFM: $2='(danger @0$0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think what I want may require the creation of an overlay.&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2015-02-14T13:53:05.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8239" PostTypeId="2" ParentId="8235" CreationDate="2015-02-14T14:46:31.757" Score="1" Body="&lt;p&gt;Judging from the (hard-to-read) prompt, it looks like you are using something like &lt;code&gt;M-x occur&lt;/code&gt;. And I'm guessing that you want to edit the default regexp (which is shown in the prompt), and then enter your edited regexp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, i.e., if the question is how to get the default value for minibuffer input into the minibuffer, then the answer is to use &lt;strong&gt;&lt;code&gt;M-n&lt;/code&gt;&lt;/strong&gt;. If more than one default value is available, you can repeat &lt;code&gt;M-n&lt;/code&gt; to cycle through them.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-14T14:46:31.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8240" PostTypeId="2" ParentId="8237" CreationDate="2015-02-14T14:52:31.057" Score="2" Body="&lt;p&gt;If you check the source code for &lt;code&gt;indent-for-tab-command&lt;/code&gt;, you see this &lt;code&gt;interactive&lt;/code&gt; spec: &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt;. If you check the Elisp manual for &lt;code&gt;interactive&lt;/code&gt; (e.g. &lt;code&gt;C-h i&lt;/code&gt;, choose Elisp manual, &lt;code&gt;i interactive&lt;/code&gt;) you will find the &lt;code&gt;&quot;P&quot;&lt;/code&gt; means the raw prefix argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that is what is passed to the function body: the raw prefix argument, which is the value of variable &lt;code&gt;current-prefix-arg&lt;/code&gt;. See the Elisp manual for that, as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual tells you that if the user provides no prefix arg then &lt;code&gt;current-prefix-arg&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;. So that is what is passed to the function body if no prefix arg is provided by the user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also ask about function &lt;code&gt;prefix-numeric-value&lt;/code&gt;.  That too you will find explained clearly in the Elisp manual. It tells you, among other things, that &lt;code&gt;(prefix-numeric-value nil)&lt;/code&gt; returns &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And since &lt;code&gt;count&lt;/code&gt; here is the numeric value of the prefix arg, &lt;code&gt;(insert-char ?\t count)&lt;/code&gt; is just &lt;code&gt;(insert-char ?\t 1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;So the&lt;/em&gt; &lt;strong&gt;&lt;em&gt;real&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;answer to your question is&lt;/em&gt; &lt;strong&gt;&lt;em&gt;how to ask Emacs about Elisp.&lt;/em&gt;&lt;/strong&gt; The answer is &lt;code&gt;C-h i&lt;/code&gt;, then choose the Elisp manual, then use &lt;code&gt;i&lt;/code&gt; to look things up in the index (with completion). You can also search through the entire manual incrementally using &lt;code&gt;C-s&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-02-15T02:15:44.493" LastActivityDate="2015-02-15T02:15:44.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8241" PostTypeId="2" ParentId="8233" CreationDate="2015-02-14T15:05:20.350" Score="0" Body="&lt;p&gt;In addition to what @kaushalmodi has said, you should not need to work around this annoyance at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;You should not see that message displayed more than once.&lt;/strong&gt; And certainly not when you are &quot;&lt;em&gt;trying to do something not strictly related to Dired.&lt;/em&gt;&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that happen also when you start Emacs without your init file (i.e., &lt;code&gt;emacs -Q&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, then recursively bisect your init file to find the culprit code. You can comment out a region of your init file using &lt;code&gt;M-x comment-region&lt;/code&gt; (with &lt;code&gt;C-u&lt;/code&gt; it uncomments). Do that to 1/2 of the file, then 3/4, 7/8, 15/16, etc. until you've narrowed it down to the culprit. This is quicker than it sounds to do - it's a binary search.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-14T15:05:20.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8242" PostTypeId="1" AcceptedAnswerId="9449" CreationDate="2015-02-14T16:26:59.963" Score="12" ViewCount="725" Body="&lt;p&gt;Let's say I have the following buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hitting &lt;code&gt;M-q&lt;/code&gt; here while in &lt;code&gt;text-mode&lt;/code&gt; leads to the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem&#xA;ipsum lorem ipsum lorem ipsum lorem ipsum&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if I activate &lt;code&gt;markdown-mode&lt;/code&gt;, I get the following&#xA;(Markdown is just an example, you see similar behavior in various modes).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem&#xA;   ipsum lorem ipsum lorem ipsum lorem ipsum&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I configure text-mode to do that?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine this can be achieved by writting a special &lt;a href=&quot;http://doc.endlessparentheses.com/Var/fill-paragraph-function&quot;&gt;&lt;code&gt;fill-paragraph-function&lt;/code&gt;&lt;/a&gt;, but this variable is just set to &lt;code&gt;nil&lt;/code&gt; in &lt;code&gt;markdown-mode&lt;/code&gt;, so there's probably an easier way.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-10-01T01:28:09.947" Title="How to make fill-region/paragraph identify a paragraph prefix?" Tags="|fill-paragraph|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8243" PostTypeId="2" ParentId="8242" CreationDate="2015-02-14T16:56:24.647" Score="3" Body="&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(fill-paragraph &amp;amp;optional JUSTIFY REGION)&#xA;&#xA;[...]&#xA;&#xA;If `fill-paragraph-function' is non-nil, we call it (passing our&#xA;argument to it), and if it returns non-nil, we simply return its value.&#xA;&#xA;If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling.&#xA;&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;markdown-mode&lt;/code&gt; presumably sets &lt;code&gt;fill-paragraph-function&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; so that the function uses &lt;code&gt;fill-prefix&lt;/code&gt; to do the filling.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((fill-prefix (make-string (length &quot;1. &quot;) ? ))&#xA;  (fill-paragraph))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Full example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let* ((num 15)&#xA;       (numstr (format &quot;%d. &quot; num))&#xA;       (fill-prefix (make-string (length numstr) ? )))&#xA;  (with-temp-buffer&#xA;    (loop for i from 1 to 15 do&#xA;          (insert (format &quot;lorem ipsum (%d) doler sit amet &quot; i)))&#xA;    (beginning-of-line)&#xA;    (insert numstr)&#xA;    (fill-paragraph)&#xA;    (buffer-string)))&#xA;&#xA;;; =&amp;gt;&#xA;&#xA;&quot;\&#xA;15. lorem ipsum (1) doler sit amet lorem ipsum (2) doler sit amet&#xA;    lorem ipsum (3) doler sit amet lorem ipsum (4) doler sit amet&#xA;    lorem ipsum (5) doler sit amet lorem ipsum (6) doler sit amet&#xA;    lorem ipsum (7) doler sit amet lorem ipsum (8) doler sit amet&#xA;    lorem ipsum (9) doler sit amet lorem ipsum (10) doler sit amet&#xA;    lorem ipsum (11) doler sit amet lorem ipsum (12) doler sit amet&#xA;    lorem ipsum (13) doler sit amet lorem ipsum (14) doler sit amet&#xA;    lorem ipsum (15) doler sit amet &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-02-14T17:08:12.660" LastActivityDate="2015-02-14T17:08:12.660" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8244" PostTypeId="1" CreationDate="2015-02-14T18:14:23.547" Score="3" ViewCount="605" Body="&lt;p&gt;This is a follow-up post to &lt;a href=&quot;https://emacs.stackexchange.com/q/8223/2443&quot;&gt;Polymode installation on Windows machine&lt;/a&gt;. Accordingly I installed polymode using this code in the &lt;code&gt;init.el&lt;/code&gt; file after ESS code:   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'poly-R)&#xA;(require 'poly-markdown)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work as &lt;code&gt;polymode&lt;/code&gt; (PM-Rnw) does appear in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/S0niC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to weave this file using &lt;code&gt;M-n w&lt;/code&gt; and &lt;code&gt;knitr&lt;/code&gt; option, it prompts me then whether this is the master file:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/87qUN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I hit &lt;code&gt;RET&lt;/code&gt; to accept the default (same file is master file), I get this message:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/OnPQw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This indicates that a &lt;code&gt;mwe_demo[weaved].tex&lt;/code&gt; buffer has already been created and transferred to a project cache in projectile. But this buffer is empty and no such file was ever found in that path. So what am I missing here?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;the following message appears in the &lt;code&gt;*polymode weave*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;weaving latex with command:&#xA;     Rscript -e &quot;library(knitr); knit('mwe_demo.Rnw', output='mwe_demo[weaved].tex')&quot;&#xA;'Rscript' is not recognized as an internal or external command,&#xA;operable program or batch file.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems that &lt;code&gt;knitr&lt;/code&gt; could not be loaded because of no recognized &lt;code&gt;Rscript.exe&lt;/code&gt; shell command. This means that it won't use the &lt;code&gt;Rterm.exe&lt;/code&gt; that I have this line of ESS installation in &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default inferior-R-program-name &quot;C:/Program Files/R/R-3.1.2/bin/i386/Rterm.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but how to make &lt;code&gt;Rscript&lt;/code&gt; recognized which I have it on this path &lt;code&gt;C:/Program Files/R/R-3.1.2/bin/Rscript.exe&lt;/code&gt;? I hope that was more explained in the documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ended up adding the above path to PATH variables &lt;code&gt;Win + break&lt;/code&gt;. It worked now and weaved into &lt;code&gt;.tex&lt;/code&gt; file. Now when I press &lt;code&gt;M-x e/E&lt;/code&gt; I get two candidates &lt;code&gt;pdflatex|latexmk&lt;/code&gt; how to extend that to include &lt;code&gt;xelatex&lt;/code&gt;, which is more useful in my case? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated Question&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make polymode opt for &lt;code&gt;xelatex&lt;/code&gt;?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar case with &lt;code&gt;Noweb&lt;/code&gt; mode could be solved by &lt;code&gt;M-x customize-group&lt;/code&gt; as in this post: &lt;a href=&quot;https://stackoverflow.com/a/28515366/1288722&quot;&gt;https://stackoverflow.com/a/28515366/1288722&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The same file could be weaved successfully using the &lt;code&gt;Noweb&lt;/code&gt; mode in ESS using &lt;code&gt;knitr&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pandoc is already installed and in the PATH variable &lt;code&gt;M-x getenv RET PATH RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Windows 7 32 bit&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-02-16T11:40:08.327" Title="Polymode appears in minibuffer but does not weave into a file on Windows, why?" Tags="|latex|ess|polymode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8245" PostTypeId="1" AcceptedAnswerId="8247" CreationDate="2015-02-14T18:33:39.243" Score="2" ViewCount="3436" Body="&lt;p&gt;I want to configure my Emacs install to work with Gmail and I need to find my install location to configure it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed Emacs on my Mac using Homebrew. Where would the install be located it? How can I find it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any other way to configure Emacs?&lt;/p&gt;&#xA;" OwnerDisplayName="user5503" LastEditorUserId="50" LastEditDate="2015-02-14T19:26:14.660" LastActivityDate="2015-02-14T19:26:14.660" Title="Where is my Emacs install?" Tags="|init-file|osx|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8246" PostTypeId="2" ParentId="8245" CreationDate="2015-02-14T18:58:08.480" Score="1" Body="&lt;p&gt;You do not need the install location to configure Emacs. You do so though a init file in your home directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual can tell you all you need to know about customizing emacs using the init file (or directory)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-02-14T18:58:08.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8247" PostTypeId="2" ParentId="8245" CreationDate="2015-02-14T19:01:36.240" Score="4" Body="&lt;p&gt;First, some references:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Official manual: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some discussion with examples: &lt;a href=&quot;https://superuser.com/questions/73458/where-is-emacs-file&quot;&gt;https://superuser.com/questions/73458/where-is-emacs-file&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brief answer: &lt;kbd&gt;M-:&lt;/kbd&gt;&lt;code&gt;user-init-file&lt;/code&gt; will print in the minibuffer the location of the configuration file which was used when this Emacs version started. Typically, this will be &lt;code&gt;~/.emacs&lt;/code&gt;, &lt;code&gt;~/.emacs.el&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several mail user agents (programs to manage emails) available in Emacs. Gnus is the one that comes with Emacs built-in. You can put Gnus-specific configuration in the Emacs init file, or you can put it separately in &lt;code&gt;~/.gnus&lt;/code&gt; file.  I recommend reading this walk-through, if you will choose to use Gnus as your MUA: &lt;a href=&quot;https://eschulte.github.io/emacs24-starter-kit/starter-kit-gnus.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://eschulte.github.io/emacs24-starter-kit/starter-kit-gnus.html&lt;/a&gt; . (This is the one I use too). A popular alternative is &lt;a href=&quot;http://emacswiki.org/emacs/WanderLust&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emacswiki.org/emacs/WanderLust&lt;/a&gt; but I wouldn't know how to set it up with GMail.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2015-02-14T19:01:36.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8249" PostTypeId="1" AcceptedAnswerId="8255" CreationDate="2015-02-14T23:29:05.010" Score="1" ViewCount="1518" Body="&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Mac-_002f-GNUstep-Customization.html&quot; rel=&quot;nofollow&quot;&gt;docs state&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In Mac OS X 10.5 and later, Emacs uses a Core Text based font backend by default. If you prefer the older font style, enter the following at the command-line before starting Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;defaults write org.gnu.Emacs FontBackend ns&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've seen this works when the Emacs executable lives under &lt;code&gt;/Applications&lt;/code&gt; (like a typical Mac application) and runs under the native OS X window system, but not if it is installed &lt;code&gt;/usr/local/bin&lt;/code&gt; and runs under some &lt;code&gt;X11&lt;/code&gt; port.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result, X11-capable instances of &lt;code&gt;/usr/local/bin/emacs&lt;/code&gt; fail to recognize any of the 30-odd variables whose names start with &lt;code&gt;ns-&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some other way of customizing Emacs' font backend that would work for X11-capable instances of &lt;code&gt;/usr/local/bin/emacs&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Strangely enough, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Font-and-Color-Parameters.html&quot; rel=&quot;nofollow&quot;&gt;elsewhere in the docs&lt;/a&gt; one finds this description of &lt;code&gt;font-backend&lt;/code&gt; (my emphasis):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;font-backend&lt;/strong&gt;&#xA;  &lt;br/&gt;&#xA;  A list of symbols, specifying the font backends to use for drawing fonts in the frame, in order of priority. On X, there are currently two available font backends: &lt;code&gt;x&lt;/code&gt; (the X core font driver) and &lt;code&gt;xft&lt;/code&gt; (the Xft font driver). On MS-Windows, there are currently two available font backends: &lt;code&gt;gdi&lt;/code&gt; and &lt;code&gt;uniscribe&lt;/code&gt; (see Windows Fonts). &lt;em&gt;On other systems, there is only one available font backend, so it does not make sense to modify this frame parameter.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The emphasized sentence seems to contradict the excerpt cited at the beginning of this post.  Be that as it may, I have not been able to find the setting for anything called &lt;code&gt;font-backend&lt;/code&gt; in any instance of Emacs I've checked.  Therefore, it is not too surprising that putting the following line at the beginning of my &lt;code&gt;~/.emacs&lt;/code&gt; file fails to have any substantive effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq font-backend 'ns)  ;; useless&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="882" LastActivityDate="2015-02-15T10:37:08.643" Title="How to customize font-backend for /usr/local/bin/emacs in OS X?" Tags="|osx|fonts|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8250" PostTypeId="1" CreationDate="2015-02-14T23:57:26.263" Score="1" ViewCount="1114" Body="&lt;p&gt;I'm using the taskjuggler export backend for org-mode. All works well except I cannot work out how to set some project global values. I want to set the follow for all my exported *.tjp files&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;timezone \&quot;Australia/Sydney\&quot;&#xA;dailyworkinghours 7&#xA;workinghours mon - fri 9:00 - 13:00, 14:00 - 17:00&#xA;workinghours sat, sun off&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These settings need to go into the project header section i.e&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;project nil &quot;Work&quot; &quot;1.0&quot; 2015-02-01 +3y {&#xA;  timezone &quot;Australia/Sydney&quot;&#xA;  dailyworkinghours 7&#xA;  workinghours mon - fri 9:00 - 13:00, 14:00 - 17:00&#xA;  workinghours sat, sun off&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I can't seem to find a way to do this. There are various custom settings, such as org-taskjuggler-default-global-header, but this inserts its value before the project header. There is also org-taskjuggler-default-global-properties, but it inserts the contents after the project block. Neither will suit as the parser for taskjuggler will not recognise the values correctly unless they are in the project header (well, they will recognise them if they are in each task, but I don't want to have to set these values for every task)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've had a bit of a look at the ox-taskjuggler elisp code, but cannot find an easy way to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure others have wanted to set/change the defaults, but I cannot see how to do this easily. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2015-06-16T01:25:53.577" Title="org-mode and taskjuggler export" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8251" PostTypeId="2" ParentId="7162" CreationDate="2015-02-15T00:30:50.610" Score="2" Body="&lt;p&gt;When you use the -Q switch, you are telling emacs to not process both your init file AND the site init file. I suspect this prevents emacs from detecting and setting a default coding system. When emacs then tries to save a file, such as the eshell history file, it doesn't know what coding system to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can think of two ways to solve this. The most obvious is not to use -Q. If startup speed is an issue, the common solution is to start emacs in daemon mode at boot and then use emacsclient whenever you want to do some editing. As -Q stops the site wide init files from being loaded, there are other defaults and potentially useful values not being set which could have impact on other functionality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second possible solution would be to somehow set the coding system. However, this is hard to do if your running with -Q. You &lt;em&gt;might&lt;/em&gt; be able to set an environment variable which emacs will pick up, but that might not work with -Q either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could try just using -q rather than -Q. This will prevent reading your local init files, but allow reading the site files. Will speed up startup a little, but may fix the error you are getting. The -q and -Q switches are really mainly used for debugging problems and not great for standard day-to-day use.&lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2015-02-15T00:30:50.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8252" PostTypeId="1" AcceptedAnswerId="8253" CreationDate="2015-02-15T04:38:18.067" Score="1" ViewCount="287" Body="&lt;p&gt;This is my first time here. I asked my question over at /r/emacs on reddit, however so far I am left with some unanswered questions. I'll copy paste my question along with the link to my post which has more information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.reddit.com/r/emacs/comments/2ve9j6/newbie_trying_to_understand_emacs_filing_system/&quot; rel=&quot;nofollow&quot;&gt;Original Post&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Hi,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before emacs I thought I knew my computer, now after learning, or trying to learn emacs I am not so sure and feel like an 80 year old with dementia. Anyways, I am not sure if this happens to everyone or I am just not doing it right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to my question. I am learning emacs to write screenplays and notes and also use it as a planner/organizer/manager. I plan to make it my one stop from writing to having my film list to small notes and books and what have you. I am mighty impressed with all the packages available which will make writing much fun.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While previously I worked with Files and Folders and it got a bit too messy. I understand there is an extension called helm which makes file management a breeze. I've been playing with packages and Dired. I understand how emacs works and how it goes about doing its business. I think about files and folders and emacs talks about directory and sub-directory (sub-folders).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me run you through what I did and how I messed up or I think I messed up, again :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I unzipped emacs to &gt; C:\Users\MyName\OneDrive\emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My .emacs folder lands up in C:\Users\MyName\AppData\Roaming.emacs.d&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Along with 3 emacs files / #.emacs# / .emacs and .emacs~ in &#xA;C:\Users\MyName\AppData\Roaming&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type C-x C-f it takes me to C:\Users\MyName\OneDrive\emacs\bin/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look up other tutorials I notice that their emacs files are in their home directory and not else where. Also when I customize it does make changes to one of the files in C:\Users\My\AppData\Roaming however the package gets installed in C:\Users\MyName\AppData\Roaming.emacs.d\elpa&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then the customization never shows up even after package-initialize and package-require. So I am guessing my Emacs isn't picking up on the right file or I messed up.&#xA;Can I not have .emacs.d and those 3 files in my home directory &#xA;C:\Users\MyName\OneDrive\emacs\bin/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How have you set up your emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to go about file management and not have things cluttered and mixed up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some sort of an optimal setup?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;http://www.reddit.com/r/emacs/comments/2ve9j6/newbie_trying_to_understand_emacs_filing_system/coh0tbc&quot; rel=&quot;nofollow&quot;&gt;thread&lt;/a&gt; is the solution I am trying to implement.&lt;/p&gt;&#xA;" OwnerUserId="5505" LastActivityDate="2015-02-15T06:32:16.953" Title="Newbie trying to understand emacs filing system" Tags="|init-file|files|" AnswerCount="1" CommentCount="15" ClosedDate="2015-02-20T14:47:34.490" ContentLicense="CC BY-SA 3.0" />
  <row Id="8253" PostTypeId="2" ParentId="8252" CreationDate="2015-02-15T06:24:01.350" Score="2" Body="&lt;p&gt;It seems like you have a few things to solve:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How do you set up an emacs config file?&lt;/li&gt;&#xA;&lt;li&gt;Where do you store files?&lt;/li&gt;&#xA;&lt;li&gt;How do you access files? Is Helm helpful?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Let's deal with those separately.&lt;/p&gt;&#xA;&lt;h2&gt;How do you set up an emacs config file?&lt;/h2&gt;&#xA;&lt;p&gt;As mentioned elsewhere, Emacs looks in the directory indicated by the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html#Find-Init&quot; rel=&quot;nofollow noreferrer&quot;&gt;HOME&lt;/a&gt; environment variable. You should make sure this is set. What should you set it to? That's up to you, but probably something like &lt;code&gt;C:\Users\MyName\&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can also find where Emacs is currently looking by inspecting the variable &lt;code&gt;user-emacs-directory&lt;/code&gt;. To do this, press &lt;code&gt;C-h v&lt;/code&gt;, then type &lt;code&gt;user-emacs-directory&lt;/code&gt; and press Enter. A buffer will open telling you, among other things, what Emacs currently thinks is the user directory.&lt;/p&gt;&#xA;&lt;h2&gt;Where do you store files?&lt;/h2&gt;&#xA;&lt;p&gt;Emacs can access files stored anywhere on your machine; it doesn't matter where they are. That is to say, you can access files in &lt;code&gt;C:\Users\MyName\OneDrive\emacs\bin/&lt;/code&gt;, but also, for example, files in &lt;code&gt;C:\Users\MyName\Documents&lt;/code&gt; or &lt;code&gt;C:\Users\MyName\Pictures&lt;/code&gt;. Or even just in &lt;code&gt;C:\otherFolder\&lt;/code&gt;. You probably want to have some sort of organization scheme, but that doesn't really make a difference for Emacs accessing them.&lt;/p&gt;&#xA;&lt;h2&gt;How do you access files? Is Helm helpful?&lt;/h2&gt;&#xA;&lt;p&gt;You can navigate to any directory by pressing &lt;code&gt;C-x C-f&lt;/code&gt;, then typing the path to the file. Helm is useful for finding files; you may want to &lt;a href=&quot;http://emacs-helm.github.io/helm/&quot; rel=&quot;nofollow noreferrer&quot;&gt;check it out&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If you have follow-up questions, you should post a separate question for each one. Stack Overflow works best when each question is narrow in scope.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-15T06:32:16.953" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8254" PostTypeId="1" AcceptedAnswerId="8257" CreationDate="2015-02-15T07:21:48.800" Score="5" ViewCount="2348" Body="&lt;p&gt;I enabled &lt;code&gt;js2-mode&lt;/code&gt; in emacs by adding this snippet in .emacs,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.js$'&quot; . js2-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But still for .js files, emacs tries to load javascript-mode alias js-mode as &#xA;the major mode. And god knows, how did &lt;code&gt;javascript-mode&lt;/code&gt; function go missing in my emacs. It crashes like this, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Autoloading failed to define function javascript-mode&quot;)&#xA;  javascript-mode()&#xA;  set-auto-mode-0(javascript-mode nil)&#xA;  set-auto-mode()&#xA;  normal-mode(t)&#xA;  after-find-file(nil t)&#xA;  find-file-noselect-1(#&amp;lt;buffer a.js&amp;gt; &quot;~/a.js&quot; nil nil &quot;~/a.js&quot; (1840059 2049))&#xA;  find-file-noselect(&quot;/home/sk/a.js&quot; nil nil)&#xA;  ido-file-internal(raise-frame)&#xA;  ido-find-file()&#xA;  call-interactively(ido-find-file nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This leads to another question, does emacs consider the last (or) first regex entry in &lt;code&gt;auto-mode-alist&lt;/code&gt; for loading the major mode?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-02-15T09:49:33.087" LastActivityDate="2015-02-15T11:32:00.630" Title="js2-mode on, still emacs hunts for javascript-mode" Tags="|major-mode|js2-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8255" PostTypeId="2" ParentId="8249" CreationDate="2015-02-15T10:37:08.643" Score="4" Body="&lt;p&gt;Customization settings for OS X have no effect if you do not run Emacs as a native OS X application, for obvious reasons.  In other words, if you run an X11 Emacs on OS X, the &lt;code&gt;FontBackend&lt;/code&gt; setting and the &lt;code&gt;ns-*&lt;/code&gt; options have no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change the font backend of an X11 Emacs, too, by setting the &lt;em&gt;frame parameter&lt;/em&gt; &lt;code&gt;font-backend&lt;/code&gt;, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(font-backend . xft))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to use the Xft backend, which—unlike the X backend—supports anti-aliasing.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you &lt;em&gt;cannot&lt;/em&gt; use native OS X font backends with the X11 application.  &lt;code&gt;(font-backend . ns)&lt;/code&gt; will &lt;strong&gt;not&lt;/strong&gt; work.  It's simply impossible to use native OS X font rendering on X11 frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, you have to build &lt;em&gt;and&lt;/em&gt; run Emacs as native OS X application in order to use OS X font rendering.  An X11 Emacs will always use X11 to render fonts, which looks rather poor, particularly on modern HiDPI screens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, don't use X11 Emacs, if you want to use OS X font rendering.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-02-15T10:37:08.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8256" PostTypeId="1" CreationDate="2015-02-15T11:05:21.747" Score="7" ViewCount="494" Body="&lt;p&gt;Beginner question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In OSX 10.6.8, Aquamacs has many buffer modes. My .tex files open in TeX mode, but I would like to open them in LaTeX mode. I can change the Mode with &quot;Change Buffer Mode&quot;, but even after a &quot;save&quot; or a &quot;save as&quot;, the old mode remains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the mode once for all? (The question also pertains to standard emacs, I guess).&lt;/p&gt;&#xA;" OwnerUserId="5507" LastEditorUserId="50" LastEditDate="2015-02-15T14:27:56.703" LastActivityDate="2015-02-15T22:36:51.207" Title="permanently change buffer mode of a file?" Tags="|major-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8257" PostTypeId="2" ParentId="8254" CreationDate="2015-02-15T11:32:00.630" Score="13" Body="&lt;p&gt;There is a trailing quotation mark in your regular expression, so it will never match files with the &lt;code&gt;.js&lt;/code&gt; extension.  Use the following regular expression instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.js\\'&quot; . js2-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the absence of the dollar—which matches the end of a line rather than of the string—and the backslash before the quotation mark:  &lt;code&gt;\\'&lt;/code&gt; properly matches the end of a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd recommend you to use the &lt;code&gt;rx&lt;/code&gt; macro for regular expressions, which makes them more readable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist `(,(rx &quot;.js&quot; string-end) . js2-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I'd recommend you to reinstall Emacs completely.  If a built-in package like &lt;code&gt;javascript-mode&lt;/code&gt; is gone, there might be something fundamentally broken in your installation. &lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-02-15T11:32:00.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8258" PostTypeId="2" ParentId="8256" CreationDate="2015-02-15T12:14:15.170" Score="6" Body="&lt;p&gt;You can customize the variable &lt;code&gt;tex-default-mode&lt;/code&gt; to e.g. &lt;code&gt;latex-mode&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is actually the default value in &lt;code&gt;tex-mode.el&lt;/code&gt;, so either you have a variable setting/customization overriding that, perhaps set by &lt;code&gt;aquamacs&lt;/code&gt; or you have an old installation of &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2015-02-15T12:14:15.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8259" PostTypeId="1" AcceptedAnswerId="8265" CreationDate="2015-02-15T12:37:07.693" Score="2" ViewCount="738" Body="&lt;p&gt;I use &lt;code&gt;C-M-s&lt;/code&gt; to search for a regexp. Then I use &lt;code&gt;M-x replace-regexp&lt;/code&gt; to replace the same regexp with some string. Can I save typing the regexp for the second time? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, when typing an argument for a command, and then the same argument for a different command, can I save typing the argument for the second time?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="50" LastEditDate="2015-02-16T11:36:53.900" LastActivityDate="2015-02-20T19:28:30.877" Title="Repeat regexp from isearc-forward-regexp on a subsequent replace-regexp?" Tags="|regular-expressions|commands|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8260" PostTypeId="2" ParentId="8256" CreationDate="2015-02-15T14:11:09.837" Score="7" Body="&lt;p&gt;In addition to Andrew Swann's specific answer for TeX files, the more general way to set the mode by file extension is to put a new entry (or adapt the existing one) in the &lt;code&gt;auto-mode-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Auto-Major-Mode.html&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This variable contains an association list of file name patterns (regular expressions) and corresponding major mode commands. Usually, the file name patterns test for suffixes, such as ‘.el’ and ‘.c’, but this need not be the case. An ordinary element of the alist looks like (regexp . mode-function).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      ((&quot;\\`/tmp/fol/&quot; . text-mode)&#xA;       (&quot;\\.texinfo\\'&quot; . texinfo-mode)&#xA;       (&quot;\\.texi\\'&quot; . texinfo-mode)&#xA;       (&quot;\\.el\\'&quot; . emacs-lisp-mode)&#xA;       (&quot;\\.c\\'&quot; . c-mode)&#xA;       (&quot;\\.h\\'&quot; . c-mode)&#xA;       ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So one would ordinarily make a permanent change to the list with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.tex\\'&quot; . latex-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the backslashes, which escape special characters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The alist works because the first matching value in the list will be used. You can therefore add to the front of the list regardless of the original contents for that file type, and your new value will be used. &lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-02-15T15:32:07.300" LastActivityDate="2015-02-15T15:32:07.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8261" PostTypeId="1" AcceptedAnswerId="8282" CreationDate="2015-02-15T14:32:34.093" Score="12" ViewCount="3068" Body="&lt;p&gt;How I can determine if the current character is a letter (an alphabetic character) (i.e., belongs to the syntax class &lt;code&gt;[:alpha:]&lt;/code&gt; in regexp notions).&#xA;I would like to write a simple function like below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-letter () (interactive)&#xA;(if char-after-is-a-letter&#xA;    (message &quot;This is a letter&quot;)&#xA;    (message &quot;This is not a letter&quot;)&#xA;    )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&#xA;Unfortunately my assumption about the equivalence of the class of the letters and the syntax class &lt;code&gt;[:alpha:]&lt;/code&gt; seems to be false.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-07-11T04:44:54.517" LastActivityDate="2015-07-11T04:44:54.517" Title="How to determine if the current character is a letter" Tags="|elisp|characters|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8262" PostTypeId="2" ParentId="8261" CreationDate="2015-02-15T14:35:40.637" Score="5" Body="&lt;p&gt;I think you can get away with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-letter ()&#xA;  (interactive)&#xA;  (let ((char (char-after)))&#xA;    (if (and (eq (char-syntax char) ?w)&#xA;             (or (&amp;gt; char ?9)&#xA;                 (&amp;lt; char ?1)))&#xA;        (message &quot;This is a letter&quot;)&#xA;      (message &quot;This is not a letter&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is a less efficient, but closer to what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-letter ()&#xA;  (interactive)&#xA;  (if (looking-at &quot;[a-z-A-Z]&quot;)&#xA;      (message &quot;This is a letter&quot;)&#xA;    (message &quot;This is not a letter&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-02-15T15:24:56.133" LastActivityDate="2015-02-15T15:24:56.133" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="8263" PostTypeId="2" ParentId="8261" CreationDate="2015-02-15T15:36:16.893" Score="9" Body="&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; This answer should be perfectly valid in 25.5 (where &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19878&quot; rel=&quot;nofollow noreferrer&quot;&gt;the bug&lt;/a&gt; had been fixed). For older versions, use the &lt;a href=&quot;https://emacs.stackexchange.com/a/8282/50&quot;&gt;other option&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This should tell you if current char is a letter, and should work in any language.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (looking-at-p &quot;[[:alpha:]]&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-02-28T14:18:57.507" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8264" PostTypeId="1" CreationDate="2015-02-15T19:55:43.853" Score="6" ViewCount="655" Body="&lt;p&gt;When searching for how to set an Emacs window size programmatically, all I can find are recipes that include statements like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist&#xA;     (cons 'height (/ (- (x-display-pixel-height) 100)&#xA;                         (frame-char-height))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this operation, the target height (in number of lines) is computed, &lt;em&gt;roughly speaking&lt;/em&gt;, by dividing the total height (in pixels) by the height of a single line (in pixels).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, it's not the &lt;em&gt;total&lt;/em&gt; height that gets divided, but rather the total height &lt;em&gt;minus some &quot;fudge factor&quot;&lt;/em&gt; (in this case 100 pixels).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This subtraction of a &quot;fudge factor&quot; is a sad little ploy to get some information (namely, the &lt;em&gt;available&lt;/em&gt; display height in pixels) that Emacs surely must already have.  Doesn't it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, isn't there a &lt;em&gt;programmatic&lt;/em&gt; way to achieve this effect that does not require guessing such &quot;fudge factors&quot;?&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2015-02-15T19:55:43.853" Title="How to set window size programmatically (and without guesswork)?" Tags="|window|frames|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8265" PostTypeId="2" ParentId="8259" CreationDate="2015-02-15T20:57:47.403" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I use &lt;code&gt;C-M-s&lt;/code&gt; to search for a regexp. Then I use &lt;code&gt;M-x replace-regexp&lt;/code&gt;. Can I save typing the regexp for the second time?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, instead of exiting the incremental search, just hit &lt;code&gt;M-%&lt;/code&gt; (which,&#xA;by the way, is the global binding for &lt;code&gt;query-replace&lt;/code&gt;). This will use&#xA;the search string you've just typed and only prompt you for a&#xA;replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will work both on &lt;code&gt;isearch-forward-regexp&lt;/code&gt; (&lt;code&gt;C-M-s&lt;/code&gt;) and on&#xA;regular &lt;code&gt;isearch&lt;/code&gt; (&lt;code&gt;C-s&lt;/code&gt;), and it will inherit the type of search you&#xA;were using (regexp and non-regexp respectively). You can also use&#xA;&lt;code&gt;C-M-%&lt;/code&gt;, which does the same thing except it uses regexps regardless&#xA;of the type of isearch you were in.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-02-20T19:28:30.877" LastActivityDate="2015-02-20T19:28:30.877" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8266" PostTypeId="2" ParentId="8256" CreationDate="2015-02-15T22:36:51.207" Score="3" Body="&lt;p&gt;You can also use file local variables: put &lt;code&gt;%-*- mode: latex -*-&lt;/code&gt; as the first line into your file.&lt;/p&gt;&#xA;" OwnerUserId="3953" LastActivityDate="2015-02-15T22:36:51.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8267" PostTypeId="1" AcceptedAnswerId="8285" CreationDate="2015-02-15T22:49:50.287" Score="5" ViewCount="126" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; can I mix abbrev expansions such that some expand automatically, and some only with an explicit call?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;abbrev-mode&lt;/code&gt; is enabled, an abbrev expands whenever typing a self-inserting whitespace or punctuation character.  However, &lt;code&gt;expand-abbrev&lt;/code&gt; will expand the abbrev at point &lt;em&gt;even when &lt;code&gt;abbrev-mode&lt;/code&gt; is disabled&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to enable &lt;code&gt;abbrev-mode&lt;/code&gt; and have some expansions happen automatically (ie, after whitespace and punctuation), but others expand &lt;em&gt;only&lt;/em&gt; when I explicitly call &lt;code&gt;expand-abbrev&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rationale: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'd like to use abbrevs automatically to correct common mistyped words (eg, &lt;code&gt;teh&lt;/code&gt; =&gt; &lt;code&gt;the&lt;/code&gt;)...&lt;/li&gt;&#xA;&lt;li&gt;... but would like to have explicit control of others that I use for shorthand (eg, sometimes I want to leave &lt;code&gt;dem&lt;/code&gt; as &lt;code&gt;dem&lt;/code&gt;, and other times I'd like it to expand to &lt;code&gt;democracy&lt;/code&gt;).&lt;br&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(I know I could type &lt;code&gt;dem C-q &amp;lt;space&amp;gt;&lt;/code&gt;, but it's awkward to do so and I usually want to use the shorthand rather than the expansion.)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To forestall well-intentioned &quot;why not use &lt;code&gt;yasnippet&lt;/code&gt;?&quot; inquiries:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm experimenting with a combination of &lt;code&gt;abbrev-mode&lt;/code&gt; and &lt;code&gt;yasnippet&lt;/code&gt;, and would prefer to use the latter for complicated expansions and the former for simple ones.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-16T12:51:18.120" Title="mixing automatic abbrev expansions with explicit-only expansions?" Tags="|abbrev|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8268" PostTypeId="2" ParentId="8250" CreationDate="2015-02-15T23:19:45.147" Score="1" Body="&lt;p&gt;Without any knowledge of taskjuggler, I'd imagine there are several relatively easy options of producing that (or any text in any export back-end) using some general-purpose mechanism.&lt;/p&gt;&#xA;&lt;h1&gt;Dynamic blocks&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Dynamic-blocks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/Dynamic-blocks.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'll start with example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: gen-tjp-project :kind &amp;quot;Work&amp;quot; :version &amp;quot;0.1&amp;quot;&#xA;project nil &amp;quot;Work&amp;quot; &amp;quot;0.1&amp;quot; 15-02-16 +0200 {&#xA;  timezone &amp;quot;Australia/Sydney&amp;quot;&#xA;  dailyworkinghours 7&#xA;  workinghours mon - fri 9:00 - 13:00, 14:00 - 17:00&#xA;  workinghours sat, sun off&#xA;&#xA;}&#xA;#+END:&#xA;&#xA;(defun org-dblock-write:gen-tjp-project (params)&#xA;  (let ((template&#xA;         &amp;quot;project %s %S %S %s {&#xA;  timezone %S&#xA;  dailyworkinghours 7&#xA;  workinghours mon - fri 9:00 - 13:00, 14:00 - 17:00&#xA;  workinghours sat, sun off&#xA;&#xA;}&amp;quot;)&#xA;        (kind (plist-get params :kind))&#xA;        (version (plist-get params :version))&#xA;        (today (format-time-string &amp;quot;%y-%m-%d %z&amp;quot; (current-time)))&#xA;        (tz (or (plist-get params :tz) &amp;quot;Australia/Sydney&amp;quot;)))&#xA;    (insert (format template nil kind version today tz))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can extend this template in a way that you see fit, this is just an example.&lt;/p&gt;&#xA;&lt;h1&gt;Babel with special template&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun simple-template (key value fmt str)&#xA;  (replace-regexp-in-string&#xA;   (symbol-name key)&#xA;   (cl-case key&#xA;     (:now (format-time-string (or fmt &amp;quot;%y-%m-%d %z&amp;quot;) (current-time)))&#xA;     (otherwise (format (or fmt &amp;quot;%s&amp;quot;) value)))&#xA;   str))&#xA;&#xA;(defun org-babel-execute:text (body params)&#xA;  (cl-loop for (key value fmt) in (cdr (assoc :extra params))&#xA;           for result = (simple-template key value fmt body)&#xA;           then (simple-template key value fmt result)&#xA;           finally (cl-return result)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC text :results raw :extra '((:kind &amp;quot;%S&amp;quot; &amp;quot;Work&amp;quot;) (:version &amp;quot;%S&amp;quot; &amp;quot;0.1&amp;quot;) (:now))&#xA;project nil :kind :version :now {&#xA;  timezone &amp;quot;Australia/Sydney&amp;quot;&#xA;  dailyworkinghours 7&#xA;  workinghours mon - fri 9:00 - 13:00, 14:00 - 17:00&#xA;  workinghours sat, sun off&#xA;}&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;project nil Work 0.1 15-02-16 +0200 {&#xA;  timezone &amp;quot;Australia/Sydney&amp;quot;&#xA;  dailyworkinghours 7&#xA;  workinghours mon - fri 9:00 - 13:00, 14:00 - 17:00&#xA;  workinghours sat, sun off&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Where you could, of course, make &lt;code&gt;simple-template&lt;/code&gt; smarter in a sense it would know more special keywords and how to replace them.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-15T23:19:45.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8269" PostTypeId="1" AcceptedAnswerId="8271" CreationDate="2015-02-16T04:20:45.993" Score="4" ViewCount="15622" Body="&lt;p&gt;I am using the latest version of Emacs on Windows&amp;nbsp;7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I unzipped Emacs to: &lt;code&gt;C:\Users\MyName\OneDrive\emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;.emacs.d&lt;/code&gt; is in: &lt;code&gt;C:\Users\MyName\AppData\Roaming&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have to set up .emacs.d in &lt;code&gt;C:\Users\MyName&lt;/code&gt; along with an &lt;code&gt;init.el&lt;/code&gt; instead of &lt;code&gt;~.emacs&lt;/code&gt;. Do I transfer &lt;code&gt;.emacs.d&lt;/code&gt; to the new location or create a new &lt;code&gt;.emacs.d&lt;/code&gt; folder?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume changing the &lt;code&gt;.emacs.d&lt;/code&gt; location will also require me to change %HOME%. If so, how do I change the home variable?&lt;/p&gt;&#xA;" OwnerUserId="5505" LastEditorUserId="1979" LastEditDate="2017-04-17T03:06:46.460" LastActivityDate="2017-04-17T11:06:23.637" Title="How do I set up my .emacs.d folder on Windows?" Tags="|init-file|microsoft-windows|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8270" PostTypeId="2" ParentId="501" CreationDate="2015-02-16T05:02:47.797" Score="-2" Body="&lt;p&gt;Maybe you can try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lisp-dialects-mode-hook '(lisp-mode-hook&#xA;                            lisp-interaction-mode-hook&#xA;                            emacs-lisp-mode-hook&#xA;                            ;; common-lisp-mode-hook&#xA;                            scheme-mode-hook&#xA;                            clojure-mode-hook&#xA;                            cider-repl-mode-hook&#xA;                            ))&#xA;&#xA;(add-hook 'lisp-dialects-mode-hook 'func)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2015-02-16T05:02:47.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8271" PostTypeId="2" ParentId="8269" CreationDate="2015-02-16T05:41:23.120" Score="7" Body="&lt;p&gt;Well, based on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt; and my memory of how I set up my emacs configuration, you're correct, you'll need to set up the &lt;code&gt;HOME&lt;/code&gt; environment variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set up the &lt;code&gt;HOME&lt;/code&gt; variable on Windows 7 by going to the Control Panel &gt; System &gt; Advanced System Settings &gt; Advanced &gt; Environment Variables… and checking the User Variables for &amp;lt; User Name &gt; list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there isn't already a user variable called HOME in that list, just press “New” and put one in pointing to the directory you want. Not exactly sure if there are any other programs that use &lt;code&gt;HOME&lt;/code&gt; as an environment variable, but so far I've not encountered any other program in Windows that uses it.&lt;/p&gt;&#xA;" OwnerUserId="5509" LastActivityDate="2015-02-16T05:41:23.120" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8272" PostTypeId="2" ParentId="7272" CreationDate="2015-02-16T07:29:48.007" Score="-1" Body="&lt;p&gt;Try using picture-mode. The solution here does what you want I think: &lt;a href=&quot;https://stackoverflow.com/questions/13036465/emacs-mode-for-free-cursor-positioning&quot;&gt;https://stackoverflow.com/questions/13036465/emacs-mode-for-free-cursor-positioning&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5510" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-16T07:29:48.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8273" PostTypeId="1" AcceptedAnswerId="8301" CreationDate="2015-02-16T08:28:36.540" Score="2" ViewCount="773" Body="&lt;p&gt;Is there an Emacs package that can help organize buffers into projects? I commonly work on many projects, but I only have one Emacs instance open (with hundreds of buffers). It would be nice if I could easily organize the buffers into projects (using for example a tag associated with each buffer; the tag name could for example be the name of the project that the buffer belongs to). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could think of some tasks that could be performed by this package:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Search through buffers of a given project&lt;/li&gt;&#xA;&lt;li&gt;List buffers of a given project&lt;/li&gt;&#xA;&lt;li&gt;Delete buffers of a given project, &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and so on..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-16T21:59:39.067" Title="Tag buffers according to project" Tags="|buffers|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8274" PostTypeId="2" ParentId="8267" CreationDate="2015-02-16T08:57:50.383" Score="1" Body="&lt;p&gt;It's possible, see &lt;a href=&quot;https://github.com/abo-abo/abel&quot; rel=&quot;nofollow&quot;&gt;abel&lt;/a&gt;.&#xA;Here's the predicate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun abel-p ()&#xA;  &quot;Don't expand in strings, comments and function arguments.&quot;&#xA;  (let ((ppss (syntax-ppss)))&#xA;    (unless (or (elt ppss 3) (elt ppss 4))&#xA;      (or (memq this-command '(expand-abbrev aya-open-line))&#xA;          (save-match-data&#xA;            (and (looking-back &quot;([[:alnum:]]*&quot;)&#xA;                 (save-excursion&#xA;                   (goto-char (match-beginning 0))&#xA;                   (and (not (looking-back &quot;(lambda *&quot;))&#xA;                        (condition-case nil&#xA;                            (progn&#xA;                              (up-list)&#xA;                              (backward-sexp)&#xA;                              (not&#xA;                               (or&#xA;                                (looking-at &quot;(defun *&quot;)&#xA;                                (looking-back &quot;(let\\*? *&quot;))))&#xA;                          (error t))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-16T08:57:50.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8275" PostTypeId="2" ParentId="8261" CreationDate="2015-02-16T09:19:32.780" Score="3" Body="&lt;p&gt;In case you were very concerned about national characters and precise treatment of Unicode character classes, then the only solution I was able to find so far is the Python &lt;a href=&quot;https://pypi.python.org/pypi/regex&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;regex&lt;/code&gt; library&lt;/a&gt;. Both &lt;code&gt;grep&lt;/code&gt; and &lt;code&gt;Perl&lt;/code&gt; (to my utter surprise!) didn't do the job properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the regular expression you are after is this one: &lt;code&gt;\p{L}&lt;/code&gt;.  This is known as Unicode property shorthand version, the full version is &lt;code&gt;\p{Letter}&lt;/code&gt; or even &lt;code&gt;p\{General_Category=Letter}&lt;/code&gt;.  &lt;code&gt;Letter&lt;/code&gt; is itself a composite class, but I won't go into details, the best reference I could find on the subject is &lt;a href=&quot;http://www.regular-expressions.info/unicode.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python library isn't built-into the language (it is an alternative to the built-in &lt;code&gt;re&lt;/code&gt; library).  So, you would need to install it, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# pip install regex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you could use it like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import regex&#xA;&amp;gt;&amp;gt;&amp;gt; regex.match(ur'\p{L}+', u'۱۲۳۴۵۶۷۸۹۰')&#xA;&amp;gt;&amp;gt;&amp;gt; regex.match(ur'\p{L}+', u'абвгд')&#xA;&amp;lt;regex.Match object; span=(0, 5), match=u'\u0430\u0431\u0432\u0433\u0434'&amp;gt;&#xA;&amp;gt;&amp;gt;&amp;gt; regex.match(ur'\p{L}+', u'123')&#xA;&amp;gt;&amp;gt;&amp;gt; regex.match(ur'\p{L}+', u'abcd')&#xA;&amp;lt;regex.Match object; span=(0, 4), match=u'abcd'&amp;gt;&#xA;&amp;gt;&amp;gt;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also put this script somewhere where you can access it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python&#xA;import regex&#xA;import sys&#xA;&#xA;if __name__ == &quot;__main__&quot;:&#xA;    for match in regex.finditer(ur'\p{L}+', sys.argv[1].decode('utf-8')):&#xA;        print match.string&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And call it from Emacs like so (suppose you saved this script in &lt;code&gt;~/bin&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun unicode-character-p ()&#xA;  (interactive)&#xA;  (let* ((current (char-after (point)))&#xA;         (result (shell-command-to-string&#xA;                  (format &quot;~/bin/is-character.py '%c'&quot; current))))&#xA;    (message&#xA;     (if (string= result &quot;&quot;) &quot;Character %c isn't a letter&quot;&#xA;        &quot;Character %c is a letter&quot;)&#xA;     current)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-16T09:19:32.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8276" PostTypeId="1" CreationDate="2015-02-16T09:24:01.103" Score="2" ViewCount="1219" Body="&lt;p&gt;How do I run &lt;code&gt;(async-)shell-command&lt;/code&gt; (but no other &lt;code&gt;shell-mode&lt;/code&gt; buffers) in &lt;code&gt;view-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="450" LastActivityDate="2018-05-10T14:52:38.747" Title="Run (async-)shell-command in view-mode" Tags="|shell-command|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8277" PostTypeId="1" AcceptedAnswerId="8286" CreationDate="2015-02-16T10:11:52.433" Score="1" ViewCount="1625" Body="&lt;p&gt;I'm a recent Vim &quot;convert&quot; (and yet love most of it), still I have an issue with installing packages using cygwin/emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The related configurations are (I have &lt;code&gt;$http(s)_proxy&lt;/code&gt; set up as environment variables in my &lt;code&gt;.bashrc&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; init.el&#xA;;; This sets up the load path so that we can override it&#xA;(package-initialize nil)&#xA;(package-initialize t)&#xA;(setq package-enable-at-startup nil)&#xA;(org-babel-load-file &quot;~/Repos/orgfiles/emacs-setup.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;emacs-setup.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;  (setq package-list '(&#xA;  ;;; list of packages&#xA;  ))&#xA; (add-to-list 'package-archives&#xA;    '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;  (add-to-list 'package-archives&#xA;    '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;  (add-to-list 'package-archives&#xA;    '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;) t)&#xA;  (package-initialize)&#xA;  ; fetch the list of packages available&#xA;  (unless package-archive-contents&#xA;    (package-refresh-contents))&#xA;  ; install the missing packages&#xA;  (dolist (package package-list)&#xA;    (unless (package-installed-p package)&#xA;      (package-install package)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(This was copy pasted from several places from the interwebs...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problems are the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I quiet often (but not always) get the following errors in &lt;code&gt;*Messages*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Contacting host: elpa.gnu.org:80&#xA; Failed to download `gnu' archive.&#xA; Contacting host: melpa.milkbox.net:80&#xA; Failed to download `melpa' archive.&#xA; Contacting host: orgmode.org:80&#xA; Failed to download `org' archive.&#xA; Contacting host: marmalade-repo.org:80&#xA; Failed to download `marmalade' archive.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;when I'm able to download the (e.g.) melpa archive and mark a package for installation, quiet often the installed package contains 0 sized package file(s) after which seemed to be a succesful installation. E.g.: most recently: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; $ ls -l auto-complete-chunk-20140225.146/&#xA; total 2.0K&#xA; -rw-r--r-- 1 zsbotykai None   0 Feb 16 10:54 auto-complete-chunk.el&#xA; -rw-r--r-- 1 zsbotykai None 410 Feb 16 10:54 auto-complete-chunk-autoloads.el&#xA; -rw-r--r-- 1 zsbotykai None 172 Feb 16 10:54 auto-complete-chunk-pkg.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So above: &lt;code&gt;auto-complete-chunk.el&lt;/code&gt; is empty after the &lt;code&gt;*Messages*&lt;/code&gt; install log shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Install package `auto-complete-chunk-20140225.146'? y&#xA; Contacting host: melpa.milkbox.net:80&#xA; Generating autoloads for auto-complete-chunk.el...done&#xA; Saving file /home/zsbotykai/.emacs.d/elpa/auto-complete-chunk-20140225.146/auto-complete-chunk-autoloads.el...&#xA; Wrote /home/zsbotykai/.emacs.d/elpa/auto-complete-chunk-20140225.146/auto-complete-chunk-autoloads.el&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Could you please point me out and/or show the direction where/what/how should I investigate the root cause of this?&lt;/p&gt;&#xA;" OwnerUserId="473" LastEditorUserId="473" LastEditDate="2015-02-16T10:19:45.437" LastActivityDate="2015-03-18T13:03:31.697" Title="cygwin/emacs (v24.4.1) behind firewall proxy package install 0 sized files" Tags="|init-file|microsoft-windows|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8278" PostTypeId="1" AcceptedAnswerId="8281" CreationDate="2015-02-16T10:40:03.733" Score="4" ViewCount="1852" Body="&lt;p&gt;My emacs installation has over time grown so that the startup has started taking multiple seconds. The only feasible way to run emacs then is in daemon mode and then connecting with emacsclient. In my init.el I have the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda ()&#xA; (when (display-graphic-p)&#xA; (set-scroll-bar-mode 'right)&#xA; (menu-bar-mode -1)&#xA; (tool-bar-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This runs once on startup and and removes the toolbars atop graphical emacs, along with putting the scroll bar on the right hand side of the window. But in terminal emacs set-scroll-bar-mode is undefined, hence the surrounding if-statement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem then is that this code runs on emacs startup, not when a client connects to the emacs daemon. Where do I hook up this function so that it's run for every new emacsclient that connects.&lt;/p&gt;&#xA;" OwnerUserId="2325" LastActivityDate="2015-02-16T12:06:56.860" Title="Running code on emacsclient connect" Tags="|emacsclient|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8279" PostTypeId="1" AcceptedAnswerId="8287" CreationDate="2015-02-16T10:49:48.363" Score="2" ViewCount="389" Body="&lt;p&gt;Often i have a need to open a file from the other projectile-based project in another window. I'm using &lt;code&gt;helm&lt;/code&gt; with projectile, so there's a function &lt;code&gt;helm-projectile-switch-project&lt;/code&gt; (which i guess by default is bound to &lt;code&gt;C-c p p&lt;/code&gt;). I'd like to join it with std &lt;code&gt;C-x 4&lt;/code&gt; command, i.e to have a function which opens a file from a different project in another window, similar to &lt;code&gt;C-c p 4 f&lt;/code&gt;. I couldn't find anything like this in the helm codebase and current implementation for &lt;code&gt;projectile-find-file-other-window&lt;/code&gt; didn't shed the light how i can do this myself. &lt;/p&gt;&#xA;" OwnerUserId="2361" LastActivityDate="2015-02-16T14:11:06.060" Title="helm-project-switch-project in other window" Tags="|window|helm|projectile|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8280" PostTypeId="2" ParentId="8244" CreationDate="2015-02-16T11:13:17.223" Score="3" Body="&lt;p&gt;After some trials on Windows machine, I found this workflow works very well:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Installation for Windows users&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 1&lt;/em&gt;&lt;br&gt;&#xA;Put this in your &lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;.emacs.el&lt;/code&gt; file - after ESS code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'poly-R)&#xA;(require 'poly-markdown)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))&#xA;;;; MARKDOWN&#xA;; (add-to-list 'auto-mode-alist '(&quot;\\.md&quot; . poly-markdown-mode))&#xA;&#xA;;;; R modes&#xA;; (add-to-list 'auto-mode-alist '(&quot;\\.Snw&quot; . poly-noweb+r-mode))&#xA;; (add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))&#xA;; (add-to-list 'auto-mode-alist '(&quot;\\.Rmd&quot; . poly-markdown+r-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 2&lt;/em&gt;&lt;br&gt;&#xA;Put &lt;code&gt;C:/Program Files/R/R-3.1.2/bin&lt;/code&gt; into PATH variable of your Windows; &lt;code&gt;Win + break&lt;/code&gt; shortcut is useful. This step to make sure that &lt;code&gt;Rscript.exe&lt;/code&gt; will be accessible by shell command of polymode to load &lt;code&gt;knitr&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 3&lt;/em&gt;&lt;br&gt;&#xA;Once you have polymode file say &lt;code&gt;.Rnw&lt;/code&gt; or alike ready and you have already fired up your ESS R session, you can issue &lt;code&gt;M-x w&lt;/code&gt; to weave it (I use Knitr).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 4&lt;/em&gt;&lt;br&gt;&#xA;Instead of issuing &lt;code&gt;M-x e&lt;/code&gt; or &lt;code&gt;M-x E&lt;/code&gt; directly from &lt;code&gt;.Rnw&lt;/code&gt; file (which has only latexmk | pdfaltex options), I tend to open the newly generated weaved &lt;code&gt;.tex&lt;/code&gt; file (if not already opened for you in other window) and hit the usual &lt;code&gt;C-c C-c&lt;/code&gt; command to compile it using my favorite default engine &lt;code&gt;xetex&lt;/code&gt;, if you don't have it as default, this line in your &lt;code&gt;init.el&lt;/code&gt; will let you do so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default TeX-engine 'xetex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-02-16T11:40:08.327" LastActivityDate="2015-02-16T11:40:08.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8281" PostTypeId="2" ParentId="8278" CreationDate="2015-02-16T11:14:13.407" Score="7" Body="&lt;p&gt;It looks like you can run functions each time a new frame is created with &lt;code&gt;after-make-frame-functions&lt;/code&gt; (see &lt;a href=&quot;https://stackoverflow.com/questions/5064390/run-command-on-new-frame-with-daemon-client-in-emacs&quot;&gt;this question&lt;/a&gt; for a bit more information).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code would look something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-my-scrollbars (_)&#xA;  (set-scroll-bar-mode 'right))&#xA;(add-to-list 'after-make-frame-functions #'set-my-scrollbars)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I only briefly tested it). The dummy argument is needed because functions in &lt;code&gt;after-make-frame-functions&lt;/code&gt; are given the frame as an argument.&lt;/p&gt;&#xA;" OwnerUserId="237" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-02-16T12:06:56.860" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8282" PostTypeId="2" ParentId="8261" CreationDate="2015-02-16T12:02:55.403" Score="12" Body="&lt;h3&gt;Use Unicode char properties&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This should definitely work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(memq (get-char-code-property (char-after) 'general-category)&#xA;      '(Ll Lu Lo Lt Lm Mn Mc Me Nl))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a bonus it should also be faster than &lt;code&gt;looking-at&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Character-Properties.html&quot; rel=&quot;noreferrer&quot;&gt;Emacs stores&lt;/a&gt; all character properties specified by the Unicode standard. They are accessible with &lt;code&gt;get-char-code-property&lt;/code&gt;. Specifically, the &lt;code&gt;general-category&lt;/code&gt; property specifies which characters are letters (&lt;code&gt;Ll&lt;/code&gt; are lowercase, &lt;code&gt;Lu&lt;/code&gt; are uppercase, and don't ask me what the others are).&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-02-28T14:15:41.703" LastActivityDate="2015-02-28T14:15:41.703" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8283" PostTypeId="1" AcceptedAnswerId="8313" CreationDate="2015-02-16T12:19:27.453" Score="1" ViewCount="143" Body="&lt;p&gt;I'm working with very large tables (14 columns for example) and it's really difficult to find the right cell to edit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discovered the &lt;code&gt;align-current&lt;/code&gt; command and tried to use it on my table, but the result is still not very helpful: In Aquamacs, it looks like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/OmUmH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the red signs are the &quot;&amp;amp;&quot; characters, which separate the table columns. Ideally they should be placed on straight vertical lines, but you can see that they don't in my case&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, if I copy the text into another text editor, it looks properly aligned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2cJD0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if it is a problem with the font used in emacs, &lt;code&gt;describe-font&lt;/code&gt; in my .tex buffer gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;name (opened by): -apple-Monaco-medium-normal-normal-&lt;em&gt;-12-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-m-0-iso10646-1&#xA;       full name: Monaco&#xA;            size: 12&#xA;          height: 17&#xA; baseline-offset:  0&#xA;relative-compose:  0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that Monaco is a monospaced font, so that should not be the problem, or could it?&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2377" LastEditDate="2015-02-17T16:09:32.867" LastActivityDate="2015-02-17T16:09:32.867" Title="Auctex align-current does not properly align table in Aquamacs - what's wrong?" Tags="|auctex|fonts|align|aquamacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8284" PostTypeId="2" ParentId="8267" CreationDate="2015-02-16T12:27:33.650" Score="0" Body="&lt;p&gt;Would introduce an own mode for that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my-special-mode, once called, whould create an&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my-special-mode-abbrev-table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Than create a command which combines toggling resp. switching-on with expand-abbrev.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-02-16T12:27:33.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8285" PostTypeId="2" ParentId="8267" CreationDate="2015-02-16T12:51:18.120" Score="3" Body="&lt;p&gt;&lt;code&gt;define-abbrev&lt;/code&gt; accepts a predicate, just use it to specify the abbrev should only expand when requested explicitly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev text-mode-abbrev-table &quot;dem&quot; &quot;democracy&quot; nil&#xA;  :enable-function (lambda () (eq this-command 'expand-abbrev)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above abbrev will not expand when you hit &lt;code&gt;SPC&lt;/code&gt; (or any other self-inserting character), but it will expand when you invoke &lt;code&gt;expand-abbrev&lt;/code&gt; directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll probably want to bind it to a key then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-M-i&quot;) #'expand-abbrev)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-02-16T12:51:18.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8286" PostTypeId="2" ParentId="8277" CreationDate="2015-02-16T13:00:40.800" Score="3" Body="&lt;p&gt;Looks like although setting &lt;code&gt;$http_proxy&lt;/code&gt; outside of emacs (as mentioned, in &lt;code&gt;.bashrc&lt;/code&gt;) is not enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After setting the proxy in the init file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq url-proxy-services '((&quot;no_proxy&quot; . &quot;work\\.com&quot;)&#xA;                           (&quot;http&quot; . &quot;proxy.work.com:911&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the problem had gone.&lt;/p&gt;&#xA;" OwnerUserId="473" LastActivityDate="2015-02-16T13:00:40.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8287" PostTypeId="2" ParentId="8279" CreationDate="2015-02-16T14:11:06.060" Score="3" Body="&lt;p&gt;You don't need another command to open files in other window. Just use the usual command, move cursor to a file and press &lt;kbd&gt;C-c o&lt;/kbd&gt; to open in other wimdow.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-02-16T14:11:06.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8288" PostTypeId="1" AcceptedAnswerId="8290" CreationDate="2015-02-16T17:48:30.757" Score="11" ViewCount="607" Body="&lt;p&gt;Is &lt;code&gt;require&lt;/code&gt; idempotent? i.e. do&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'helm)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'helm)&#xA;(require 'helm)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;end with the same result?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2688" LastEditDate="2015-04-06T12:50:18.003" LastActivityDate="2015-04-06T12:50:18.003" Title="Is using require multiple times on the same symbol idempotent?" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8289" PostTypeId="1" AcceptedAnswerId="8292" CreationDate="2015-02-16T17:49:03.883" Score="2" ViewCount="734" Body="&lt;p&gt;For creating Zim wiki pages, I need to generate a timestamp that ends with a time zone in &lt;code&gt;±hh:mm&lt;/code&gt; format. &lt;code&gt;format-time-string&lt;/code&gt; has a &lt;code&gt;%z&lt;/code&gt; format string that can insert it without the colon. Right now I use &lt;code&gt;with-temp-buffer&lt;/code&gt; to generate the timestamp using &lt;code&gt;%z&lt;/code&gt;, moving point back two characters and inserting a colon. My question is, is there a more sophisticated way to do this?&lt;/p&gt;&#xA;" OwnerUserId="507" LastActivityDate="2015-02-16T18:54:58.870" Title="Insert one character 2 chars before end of string" Tags="|elisp|string|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8290" PostTypeId="2" ParentId="8288" CreationDate="2015-02-16T17:57:17.577" Score="14" Body="&lt;p&gt;Yes.  From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html#Named-Features&quot; rel=&quot;noreferrer&quot;&gt;Named Features&lt;/a&gt; (emphasis mine):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A feature name is a symbol that stands for a collection of functions, variables, etc. The file that defines them should provide the feature. Another program that uses them may ensure they are defined by requiring the feature. &lt;strong&gt;This loads the file of definitions if it hasn't been loaded already.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;To require the presence of a feature, call &lt;code&gt;require&lt;/code&gt; with the feature name as argument. &lt;code&gt;require&lt;/code&gt; looks in the global variable &lt;code&gt;features&lt;/code&gt; to see whether the desired feature has been provided already. &lt;strong&gt;If not, it loads the feature from the appropriate file&lt;/strong&gt;. This file &lt;strong&gt;should call &lt;code&gt;provide&lt;/code&gt;&lt;/strong&gt; at the top level to &lt;strong&gt;add the feature to &lt;code&gt;features&lt;/code&gt;&lt;/strong&gt;; if it &lt;strong&gt;fails to do so, &lt;code&gt;require&lt;/code&gt; signals an error&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-16T17:57:17.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8291" PostTypeId="2" ParentId="8288" CreationDate="2015-02-16T17:58:24.030" Score="13" Body="&lt;p&gt;Yes, provided that the code in &lt;code&gt;helm.el&lt;/code&gt; or &lt;code&gt;helm.elc&lt;/code&gt; respects the rule that it must call &lt;code&gt;(provide 'helm)&lt;/code&gt;. The call &lt;code&gt;(provide 'helm)&lt;/code&gt; marks the symbol &lt;code&gt;helm&lt;/code&gt; as a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html#Named-Features&quot;&gt;loaded feature&lt;/a&gt;, and this causes the second call to &lt;code&gt;(require 'helm)&lt;/code&gt; to do nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the loaded package does not call &lt;code&gt;provide&lt;/code&gt; then &lt;code&gt;require&lt;/code&gt; signals an error, and the feature is not marked as loaded, so a second call to &lt;code&gt;(require 'helm)&lt;/code&gt; would attempt the loading again (and typically fail again for the same reason).&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-02-16T17:58:24.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8292" PostTypeId="2" ParentId="8289" CreationDate="2015-02-16T18:02:57.620" Score="4" Body="&lt;p&gt;I'm afraid Emacs is rubbish at string manipulation, which is pretty amazing since Emacs is a text editor. It may not be awesome, but personally feel this reads better than using &lt;code&gt;with-temp-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((time (format-time-string &quot;%z&quot;)))&#xA;  (concat&#xA;    (substring time 0 3)&#xA;    &quot;:&quot;&#xA;    (substring time 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-02-16T18:02:57.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8293" PostTypeId="2" ParentId="8289" CreationDate="2015-02-16T18:08:22.027" Score="4" Body="&lt;p&gt;If you like to use elisp regexp, you can do the below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, it returns &lt;code&gt;&quot;-05:00&quot;&lt;/code&gt; if &lt;code&gt;(format-time-string &quot;%z&quot;)&lt;/code&gt; returns &lt;code&gt;&quot;-0500&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;\\([-+][0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)&quot;&#xA;                          &quot;\\1:\\2&quot;&#xA;                          (format-time-string &quot;%z&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-16T18:08:22.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8294" PostTypeId="5" CreationDate="2015-02-16T18:17:00.580" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://emacswiki.org/emacs/Sunrise_Commander&quot; rel=&quot;nofollow&quot;&gt;Sunrise Commander&lt;/a&gt; is a file manager in Emacs. It is based on Dired, with many extra features inspired by Norton Commander and Midnight Commander.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful links&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacswiki.org/emacs/Sunrise_Commander&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://joseito.republika.pl/sunrise-commander/&quot; rel=&quot;nofollow&quot;&gt;ELPA repository&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/escherdragon/sunrise-commander&quot; rel=&quot;nofollow&quot;&gt;Full source code on Github&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-02-16T18:40:40.150" LastActivityDate="2015-02-16T18:40:40.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8295" PostTypeId="4" CreationDate="2015-02-16T18:17:00.580" Score="0" Body="Sunrise Commander is a file manager in Emacs" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-02-16T18:40:24.210" LastActivityDate="2015-02-16T18:40:24.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8296" PostTypeId="2" ParentId="8289" CreationDate="2015-02-16T18:54:58.870" Score="4" Body="&lt;p&gt;A slightly less verbose version of the one suggested by kaushalmodi:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string &quot;..$&quot; &quot;:\\&amp;amp;&quot; (format-time-string &quot;%z&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-16T18:54:58.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8297" PostTypeId="2" ParentId="5828" CreationDate="2015-02-16T19:08:47.860" Score="0" Body="&lt;p&gt;The following adds all dirs under &lt;code&gt;~/.emacs.d/site-lisp&lt;/code&gt; to load path, so you can just &lt;code&gt;require&lt;/code&gt; the package and you are done:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((my-lisp-dir &quot;~/.emacs.d/site-lisp/&quot;)&#xA;       (default-directory my-lisp-dir)&#xA;       (orig-load-path load-path))&#xA;  (setq load-path (cons my-lisp-dir nil))&#xA;  (normal-top-level-add-subdirs-to-load-path)&#xA;  (nconc load-path orig-load-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-02-16T19:08:47.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8298" PostTypeId="2" ParentId="8276" CreationDate="2015-02-16T20:53:24.167" Score="1" Body="&lt;p&gt;Do can define your another wrapper function that calls &lt;code&gt;async-shell-command&lt;/code&gt; which enables the &lt;code&gt;view-mode&lt;/code&gt; after calling that function.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/async-shell-command (command &amp;amp;optional output-buffer error-buffer)&#xA;  (interactive&#xA;   (list&#xA;    (read-shell-command &quot;Async shell command: &quot; nil nil&#xA;            (let ((filename&#xA;                   (cond&#xA;                (buffer-file-name)&#xA;                ((eq major-mode 'dired-mode)&#xA;                 (dired-get-filename nil t)))))&#xA;              (and filename (file-relative-name filename))))&#xA;    current-prefix-arg&#xA;    shell-command-default-error-buffer))&#xA;  ;; call the original function&#xA;  (async-shell-command command output-buffer error-buffer)&#xA;  ;; switch to the shell command output buffer&#xA;  (switch-to-buffer &quot;*Async Shell Command*&quot;)&#xA;  ;; enable `view-mode'&#xA;  (view-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bind that to the default &lt;code&gt;async-shell-command&lt;/code&gt; binding &lt;code&gt;M-&amp;amp;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that the &lt;code&gt;(interactive (list ..))&lt;/code&gt; portion of the wrapper funciton is copied directly from the source code for &lt;code&gt;async-shell-command&lt;/code&gt;. It's useful to retain the input arguments of the original function when writing a wrapper around it.  The same applies if you were to use &lt;code&gt;advice-add&lt;/code&gt; (emacs 24.4+) instead.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar thing can be done for &lt;code&gt;shell-command&lt;/code&gt; too.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-16T20:53:24.167" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8299" PostTypeId="1" AcceptedAnswerId="8302" CreationDate="2015-02-16T21:08:33.943" Score="2" ViewCount="150" Body="&lt;p&gt;&lt;code&gt;(require 'shell)&lt;/code&gt; enables &lt;code&gt;shell-dirtrack-mode&lt;/code&gt; globally in every buffer.  Is there a way to disable that behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only workaround that I have found is to call &lt;code&gt;(shell-dirtrack-mode -1)&lt;/code&gt; for each major mode that loads (e.g., via a major-mode hook); and, for &lt;code&gt;fundamental-mode&lt;/code&gt;, I created a new function that calls the same thing immediately after calling &lt;code&gt;kill-all-local-variables&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-02-17T01:12:45.563" Title="How to globally disable `shell-dirtrack-mode` after `(require 'shell)`" Tags="|shell-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8300" PostTypeId="1" CreationDate="2015-02-16T21:09:43.617" Score="1" ViewCount="329" Body="&lt;p&gt;Suppose I have a report like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 2 :link nil :scope file :formula &quot;$3='(random)::@1$3=string(\&quot;fubar\&quot;)&quot;                                                                                &#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And for completeness, I have an org buffer like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Item&#xA;  CLOCK: [2015-02-15 Sun 06:20]--[2015-02-15 Sun 08:38] =&amp;gt;  2:18                                                                                                                     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I invoke &lt;code&gt;C-c C-x C-r&lt;/code&gt;, my table comes out like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Headline     | Time   |&#xA;|--------------+--------|&#xA;| *Total time* | *2:18* |826342076441804571|&#xA;|--------------+--------|&#xA;| TODO Item    | 2:18   |121432529327701366|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, I think it should look like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Headline     | Time   | fubar            |&#xA;|--------------+--------|------------------|&#xA;| *Total time* | *2:18* |826342076441804571|&#xA;|--------------+--------|------------------|&#xA;| TODO Item    | 2:18   |121432529327701366|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Perhaps this is a bug in org-mode, but it looks like I can't set the top most cell in the column of a custom formula.&lt;/p&gt;&#xA;" OwnerUserId="48" LastActivityDate="2015-02-18T18:29:03.470" Title="How do I set the header cell for a custom formula column in a clock report?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8301" PostTypeId="2" ParentId="8273" CreationDate="2015-02-16T21:15:44.557" Score="6" Body="&lt;p&gt;First thing is to make sure projectile is installed, you can install projectile using the MELPA repository. Then, you should ensure that projectile-mode is activated: &lt;code&gt;M-x projectile-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Projectile identify the root project using the &lt;code&gt;.git&lt;/code&gt; directory or if you're not using git, you can put a &lt;code&gt;.projectile&lt;/code&gt; file in the project root.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Search through buffers of a given project&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c p s s&lt;/code&gt;, to runs ag on the project. Requires the presence of ag.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c p o&lt;/code&gt;, to run &lt;code&gt;multi-occur&lt;/code&gt; on all project buffers currently open&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List buffers of a given project&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c p b&lt;/code&gt;, to display a list of all project buffers currently open.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Delete buffers of a given project&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c p k&lt;/code&gt;, to kill all project buffers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;https://github.com/bbatsov/projectile#interactive-commands&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt; github page ;)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As stated by Dan in the comments, you can also use &lt;a href=&quot;http://www.emacswiki.org/emacs/IbufferMode&quot; rel=&quot;nofollow&quot;&gt;ibuffer mode&lt;/a&gt; and &lt;a href=&quot;https://github.com/purcell/ibuffer-projectile&quot; rel=&quot;nofollow&quot;&gt;ibuffer-projectile&lt;/a&gt;, to group buffers by projectile project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this will help.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-02-16T21:59:39.067" LastActivityDate="2015-02-16T21:59:39.067" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8302" PostTypeId="2" ParentId="8299" CreationDate="2015-02-16T21:40:12.373" Score="2" Body="&lt;p&gt;The &lt;code&gt;shell-dirtrack-mode&lt;/code&gt; is an alias to &lt;code&gt;shell-dirtrackp&lt;/code&gt;. The &lt;code&gt;shell-dirtrackp&lt;/code&gt; is initialized with the value of &lt;code&gt;t&lt;/code&gt; in &lt;code&gt;shell.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this variable and thus the minor mode &lt;code&gt;shell-dirtrack-mode&lt;/code&gt; gets a global value of &lt;code&gt;t&lt;/code&gt;. So this mode state is always on in a fresh buffer unless you actively disable it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is to change the default value of the &lt;code&gt;shell-dirtrackp&lt;/code&gt; variable after it is initialized in &lt;code&gt;shell.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'shell)&#xA;(setq-default shell-dirtrackp nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Default-Value.html&quot; rel=&quot;nofollow&quot;&gt;Default Value&lt;/a&gt; - &lt;code&gt;setq-default&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-17T01:12:45.563" LastActivityDate="2015-02-17T01:12:45.563" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8303" PostTypeId="2" ParentId="8273" CreationDate="2015-02-16T21:43:49.860" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;tag bookmarks&lt;/em&gt;&lt;/a&gt;. And you can bookmark non-file buffers as well as file and directory (Dired) buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, you can use this feature to tag projects and project components of various sorts.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tags are arbitrary &lt;em&gt;strings&lt;/em&gt;, by default (including spaces, newline chars, etc). But a tag can also be an association of such a name with a Lisp value. In other words, a tag can act just like an object attribute or property: it can be a &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#TagsAsAttributes&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;name/value pair&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different projects or project states (e.g. workflow, releases) can have different tags for the same sets of files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other project-related &lt;strong&gt;Bookmark+&lt;/strong&gt; features, besides tags, and which complement the use of tags. Predefined bookmark types that are particularly useful for project management include Dired, Dired tree, bookmark-list, bookmark-file, and desktop bookmarks. Use these, for example, to switch among projects. And you can easily define your own type-specific bookmark &quot;jump&quot; command for any set of bookmarks (e.g., the files that make up a project).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-16T21:43:49.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8305" PostTypeId="1" AcceptedAnswerId="9350" CreationDate="2015-02-17T00:32:42.487" Score="0" ViewCount="2494" Body="&lt;pre&gt;&lt;code&gt;(require 'flycheck)&#xA;(add-hook 'js2-mode-hook&#xA;          (lambda () (flycheck-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Used this, to setup flycheck for javascript development. However, i noticed config changes in .jshintrc is not considered at all for error highlighting (setting &lt;code&gt;asi&lt;/code&gt; as true to suppress missing semicolons is one such case.)&#xA;Later, i saw that &lt;code&gt;js2-mode&lt;/code&gt; has inbuilt support for error highlighting. So, what set of rules &lt;code&gt;js2-mode&lt;/code&gt; and is it as customizable as &lt;code&gt;flycheck-jshint&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="193" LastEditDate="2015-02-17T14:04:18.263" LastActivityDate="2015-02-18T13:26:12.423" Title="js2-mode with flycheck and jshint" Tags="|flycheck|js2-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8306" PostTypeId="1" AcceptedAnswerId="8307" CreationDate="2015-02-17T01:35:07.530" Score="1" ViewCount="442" Body="&lt;p&gt;I am an okay Java programmer and have very little knowledge of Emacs lisp, but I would still like to be able to write some packages for Emacs.&#xA;Is there a way or package that would allow me to write a package in Java?&lt;/p&gt;&#xA;" OwnerDisplayName="user5503" LastEditorUserId="105" LastEditDate="2015-02-17T01:55:53.337" LastActivityDate="2015-02-17T12:20:52.000" Title="Writing Emacs Packages in Java" Tags="|package|java|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8307" PostTypeId="2" ParentId="8306" CreationDate="2015-02-17T03:12:33.390" Score="11" Body="&lt;p&gt;You can't directly write an Emacs package in Java.  There is currently no way to extend Emacs in Java, nor is there a Java to Elisp transpiler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's common, though, to have Emacs run other programs to do work for it.  You could write a helper program like this in Java.  Whether this makes sense depends on what exactly you intend to do.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-17T03:12:33.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8308" PostTypeId="1" AcceptedAnswerId="8311" CreationDate="2015-02-17T05:04:10.483" Score="4" ViewCount="666" Body="&lt;p&gt;I wonder if it is possible to change the following functions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;dired-do-rename&lt;/li&gt;&#xA;&lt;li&gt;dired-do-copy&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;such that when I operate on a single file, it prompts the selected file's name as the default target name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of my files have long names, when I copy/rename a file, I usually copy/rename it to a similar name. It's painful to type the entire name or copy it from the original file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot for any suggestions!&lt;/p&gt;&#xA;" OwnerUserId="5518" LastEditorUserId="5143" LastEditDate="2015-02-20T07:47:22.257" LastActivityDate="2015-02-20T07:47:22.257" Title="Default name for dired copy and rename" Tags="|dired|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8309" PostTypeId="1" CreationDate="2015-02-17T05:09:41.677" Score="3" ViewCount="1485" Body="&lt;p&gt;Org-mode's agenda view can display local holidays after enabling it in &lt;code&gt;org-agenda-include-diary&lt;/code&gt;. This however displays US holidays (such as President's Day). What is the simplest way to configure it to show Canadian holidays?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Per &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Holiday-Customizing.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The general holidays are, by default, holidays common throughout the United States. In contrast, holiday-local-holidays and holiday-other-holidays are both empty by default.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, how would I use use either of those variables to replace the US holidays with Canadian holidays?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual further gives an example of adding a &lt;em&gt;single&lt;/em&gt;  holiday:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(setq holiday-other-holidays '((holiday-fixed 7 14 &quot;Bastille Day&quot;)))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How would I go about adding all of the Canadian holidays? Are there no predefined lists I can use? &lt;/p&gt;&#xA;" OwnerUserId="2059" LastActivityDate="2019-09-19T15:39:16.613" Title="Change local holiday calendar" Tags="|diary|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8311" PostTypeId="2" ParentId="8308" CreationDate="2015-02-17T05:17:42.543" Score="9" Body="&lt;p&gt;The ability to set the &quot;copy to&quot; or &quot;rename/move to&quot; name same as the original name is already built in.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Initiate the copy or move (rename) in dired &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;(only for &lt;code&gt;ido&lt;/code&gt; users)&lt;/strong&gt; &lt;code&gt;C-f&lt;/code&gt; or &lt;code&gt;C-x C-f&lt;/code&gt; - kick out of ido mode&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-n&lt;/code&gt; - That will give you the current file/dir name  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;General tip that applies everywhere in emacs: Whenever you are hunting for a default that you think should be present, try out &lt;code&gt;M-n&lt;/code&gt; or &lt;code&gt;M-p&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-17T05:17:42.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8312" PostTypeId="2" ParentId="8309" CreationDate="2015-02-17T09:04:28.983" Score="1" Body="&lt;p&gt;You can use e.g. &lt;a href=&quot;https://github.com/abo-abo/netherlands-holidays/blob/master/netherlands-holidays.el&quot; rel=&quot;nofollow&quot;&gt;netherlands-holidays&lt;/a&gt; as a template.&#xA;Afterwards, this is what I do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq calendar-holidays (append calendar-holidays holiday-netherlands-holidays))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-17T09:04:28.983" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8313" PostTypeId="2" ParentId="8283" CreationDate="2015-02-17T10:23:55.863" Score="2" Body="&lt;p&gt;Thanks, @Dan and @Matthew Piziak for your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, Aquamacs seems to have its own font definitions:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Switching to a mono-spaced (fixed pitch) font throughout&lt;/strong&gt;&#xA;  Aquamacs uses a mono-spaced font (Monaco) as a default, but uses the system’s&#xA;  variable-width font (Lucida Grande) for all text modes, including&#xA;  those derived from ‘text-mode’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To use a monospaced font throughout (or the same font everywhere),&#xA;  just disable ‘aquamacs-autoface-mode’ by selecting Options →&#xA;  Appearance → Auto Faces → Auto Faces. Save your options. You may then&#xA;  choose another font via Options → Appearance → Font if you so desire.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Alternatively, if you would just like to customize specific fonts, see&#xA;  the next frequently asked question.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;source: &lt;a href=&quot;http://www.emacswiki.org/emacs/AquamacsFAQ#toc10&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/AquamacsFAQ#toc10&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did as described and disabled the &lt;code&gt;autoface-mode&lt;/code&gt; and after a restart of Aquamacs, the table looks really aligned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Cc1Aw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2377" LastActivityDate="2015-02-17T10:23:55.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8314" PostTypeId="1" AcceptedAnswerId="9316" CreationDate="2015-02-17T10:37:45.290" Score="19" ViewCount="1481" Body="&lt;p&gt;Is there a way to define a default language for org-mode code blocks in the docuement header?  Usually, within one org document, I only use one programming language, so it's getting tiresome to always write&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python&#xA;[...]&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would be nice to be able to do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :session *mysession* :tangle yes :results silent :language python&#xA;&#xA;[...]&#xA;&#xA;#+BEGIN_SRC&#xA;[...]&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2015-02-27T16:08:29.263" Title="Set default language for code-blocks in orgmode" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8315" PostTypeId="2" ParentId="8305" CreationDate="2015-02-17T10:51:32.407" Score="1" Body="&lt;p&gt;The default checker for &lt;code&gt;js2-mode&lt;/code&gt; is jshint. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't have to use a lambda function to enable &lt;code&gt;flycheck-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'js2-mode-hook 'flycheck-mode)&#xA;(setq flycheck-jshintrc &quot;~/.emacs.d/.jshintrc&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or add your own path to the .jshintrc file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Later edit:&lt;/strong&gt;&#xA;To verify your &lt;code&gt;flycheck&lt;/code&gt; setup for a specific buffer, &lt;kbd&gt;C-c ! v&lt;/kbd&gt; or &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;flycheck-verify-setup&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2015-02-17T10:59:31.097" LastActivityDate="2015-02-17T10:59:31.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8316" PostTypeId="1" CreationDate="2015-02-17T11:10:42.600" Score="9" ViewCount="911" Body="&lt;p&gt;I'm working with large LaTeX tables in AucTEX and it would be helpful to display them in truncated lines, like here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Cc1Aw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The red marks are the &quot;&amp;amp;&quot; characters which separate the columns of the table. In case of tables with many columns the latex source code for one table row is longer than the &lt;code&gt;emacs&lt;/code&gt; frame width and therefore will be by default wrapped into more than one line.&#xA;Even with &lt;code&gt;align-current&lt;/code&gt;, this will make the table source code very hard to read and edit, so &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for tables I'd prefer the source code lines to be truncated (forcing me to scroll horizontally)&lt;/li&gt;&#xA;&lt;li&gt;while for all other &lt;code&gt;latex&lt;/code&gt; source, I'd prefer &lt;code&gt;word wrap&lt;/code&gt; to make it fit to the frame width&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However for the real text in my LaTeX document I'd prefer to have the normal &lt;code&gt;word-wrap&lt;/code&gt; settings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use &lt;code&gt;word-wrap&lt;/code&gt; as standard in &lt;code&gt;Emacs&lt;/code&gt; and still have some latex environments in the same buffer like &lt;code&gt;table&lt;/code&gt;, &lt;code&gt;longtable&lt;/code&gt; and &lt;code&gt;sidewaystable&lt;/code&gt; shown &lt;code&gt;truncate&lt;/code&gt;d at the same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also for some other environments like &lt;code&gt;equation&lt;/code&gt;, &lt;code&gt;pycode&lt;/code&gt; or &lt;code&gt;tikzpicture&lt;/code&gt; truncation seems to be more appropriate. So it might be a good idea to be able to define a list of environments which don't get wraped but truncated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wrapping should be soft wrapping (That is, the text is wrapped to fill-column in the buffer, but that does not reflect in the file) and wrapping an indented line should follow the line’s indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solutions should also work for emacs but also for Aquamacs 2.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a blog post which suggests to have a (partial) solution, but I didn't find the implementation: &lt;a href=&quot;http://endlessparentheses.com/longlines-mode-in-latex.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://endlessparentheses.com/longlines-mode-in-latex.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2323" LastEditDate="2018-11-09T17:21:38.750" LastActivityDate="2023-12-14T07:02:45.353" Title="Is it possible to have word-wrap as standard but truncate some lines in a buffer at the same time?" Tags="|auctex|line-break|visual-line-mode|line-truncation|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="8317" PostTypeId="1" CreationDate="2015-02-17T11:53:19.813" Score="3" ViewCount="140" Body="&lt;p&gt;Can &lt;code&gt;align-current&lt;/code&gt; also handle &lt;code&gt;multicolumn&lt;/code&gt; cells properly?&#xA;IT does not in my case, you can see in the following example, that the 2 columns called &quot;Col&quot; are placed above cell &quot;c&quot; in the editor after &lt;code&gt;align-current&lt;/code&gt;, but they would have to be placed above &quot;e&quot; and &quot;f&quot; :&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;source-code:&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{tabularx}&#xA;\begin{document}&#xA;&#xA;  \begin{tabularx}{12cm}{|p{3cm}|X|X|X|X|X|}&#xA;  \hline&#xA;  Long text &amp;amp; \multicolumn{3}{X|}{Very-verylong text} &amp;amp; Col &amp;amp; Col       \\&#xA;\hline&#xA;       a    &amp;amp; b                                       &amp;amp; c   &amp;amp; d &amp;amp; e &amp;amp; f \\ &#xA;    \hline&#xA;        a   &amp;amp; b                                       &amp;amp; c   &amp;amp; d &amp;amp; e &amp;amp; f \\&#xA;        \hline&#xA;\end{tabularx}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;aligned source text in the editor (Aquamacs):&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/H2tUf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;pdflatex output&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/AXhRt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I solve that? I have large tables with many columns and many multicolumns in the headings and it is absolutely confusing if those headings are not in the right place!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Remark&lt;/em&gt;: I'm currently using &lt;code&gt;Aquamacs 2.5&lt;/code&gt;, but I assume that this problem is not bound to &lt;code&gt;Aquamacs&lt;/code&gt; as it also happens if I use &lt;code&gt;emacs&lt;/code&gt;in the terminal and try the same thing.&lt;/p&gt;&#xA;" OwnerUserId="2377" LastActivityDate="2015-02-17T11:53:19.813" Title="How can I tell align-current to align multicolumn cells properly?" Tags="|align|aquamacs|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8318" PostTypeId="2" ParentId="8306" CreationDate="2015-02-17T12:20:52.000" Score="7" Body="&lt;p&gt;Here's a little snippet that allows to run a single Java file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun java-eval-nofocus ()&#xA;  &quot;Run current Java file.&quot;&#xA;  (interactive)&#xA;  (save-buffer)&#xA;  (let* ((source (file-name-nondirectory buffer-file-name))&#xA;         (out (file-name-sans-extension source))&#xA;         (class (concat out &quot;.class&quot;)))&#xA;    (setenv &quot;CLASSPATH&quot; default-directory)&#xA;    (shell-command (format &quot;rm -f %s &amp;amp;&amp;amp; javac %s&quot; class source))&#xA;    (if (file-exists-p class)&#xA;        (message (shell-command-to-string (format &quot;java %s&quot; out)))&#xA;      (progn&#xA;        (set (make-local-variable 'compile-command)&#xA;             (format &quot;javac %s&quot; source))&#xA;        (command-execute 'compile)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can simplify it for your purposes, for instance, assume you have&#xA;&lt;code&gt;Utility.class&lt;/code&gt; on your CLASSPATH, that prints some useful info like&#xA;today's weather. Then to insert this info into a buffer you need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-weather ()&#xA;  (interactive)&#xA;  (insert&#xA;   (shell-command-to-string &quot;java Utility&quot;)))&#xA;(global-set-key (kbd &quot;C-c C-w&quot;) 'insert-weather)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still, you won't be able to do anything more useful than inserting&#xA;static text unless you learn some Elisp.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-17T12:20:52.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8319" PostTypeId="1" CreationDate="2015-02-17T12:24:34.423" Score="3" ViewCount="146" Body="&lt;p&gt;In ansi-term when using mongo console (or 'repl') control codes do not seem to behave properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I move cursor it doesn't get redrawn at a expected location. Instead all entered text get appended to the input. The same goes for backspace. My input does get interpreted, however, it is not displayed correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YSzaZ.png&quot; alt=&quot;example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's result of typing 'testtest', then pressing backspace.&#xA;$TERMINFO value is set to 'eterm-color'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any suggestions!&lt;/p&gt;&#xA;" OwnerUserId="5521" LastEditorUserId="104" LastEditDate="2015-02-18T01:18:33.830" LastActivityDate="2016-08-14T21:07:33.000" Title="Mongo console doesn't behave properly in ansi-term" Tags="|interactive|ansi-term|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8320" PostTypeId="1" CreationDate="2015-02-17T13:04:24.263" Score="6" ViewCount="44" Body="&lt;p&gt;Very occasionally, hit &lt;code&gt;SPC&lt;/code&gt; during regular typing and get an unexpected abbrev expansion. What I usually do in this case is &lt;code&gt;undo&lt;/code&gt; (which reverts the expansion and the inserted space) and then manually &lt;code&gt;C-q SPC&lt;/code&gt; to add the space again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be really useful if, when I hit &lt;code&gt;undo&lt;/code&gt;, only the expansion would get reverted, but the space would stay. Then, hitting &lt;code&gt;undo&lt;/code&gt; a second time could revert the space insertion too. This is what you usually see in editors with auto-correction features (the first undo affects the correction, the second affects the space you typed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-02-17T18:30:44.767" LastActivityDate="2015-02-17T18:30:44.767" Title="In undo history, how to separate abbrev expansion from self-insert?" Tags="|undo|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9316" PostTypeId="2" ParentId="8314" CreationDate="2015-02-17T13:45:37.890" Score="12" Body="&lt;p&gt;This answer provides a workable workaround. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to do this would be using &lt;a href=&quot;http://orgmode.org/manual/Easy-Templates.html&quot; rel=&quot;noreferrer&quot;&gt;easy templates&lt;/a&gt;. Add your templates to the &lt;code&gt;org-structure-template-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-structure-template-alist&#xA;         '(&quot;py&quot; &quot;#+BEGIN_SRC python :results output\n?\n#+END_SRC&quot; &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The question mark indicates the cursor position. Insert the code block with &lt;code&gt;&amp;lt;py&lt;/code&gt; TAB in this case.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2015-02-27T16:08:29.263" LastActivityDate="2015-02-27T16:08:29.263" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9317" PostTypeId="1" AcceptedAnswerId="9318" CreationDate="2015-02-17T14:02:10.043" Score="35" ViewCount="11841" Body="&lt;p&gt;I have a tracked file in a git repository. How do I untrack this file without deleting it using magit?&lt;/p&gt;&#xA;" OwnerUserId="2808" LastActivityDate="2016-02-16T21:53:17.313" Title="Untrack file without deleting it?" Tags="|magit|git|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9318" PostTypeId="2" ParentId="9317" CreationDate="2015-02-17T14:21:48.670" Score="25" Body="&lt;p&gt;Hitting &lt;code&gt;i&lt;/code&gt; will gitignore the file and untrack it from the git repository. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Behind the scenes, it does &lt;code&gt;git rm --cached&lt;/code&gt; - &lt;a href=&quot;https://stackoverflow.com/q/936249/1219634&quot;&gt;More info about this git command from a StackOverflow question&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-02-17T14:21:48.670" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9319" PostTypeId="1" CreationDate="2015-02-17T15:05:03.110" Score="2" ViewCount="211" Body="&lt;p&gt;How can I retrieve the date/time of the creation of the current file (&lt;code&gt;file-date-time-of-creation&lt;/code&gt;) on my system?&#xA;The same question can arise for the size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A related question was asked &lt;a href=&quot;https://emacs.stackexchange.com/q/7888/2609&quot;&gt;here&lt;/a&gt;.  This is a Windows related question, but the question also arises for other OS's.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-03-19T17:24:07.577" Title="meta-data related to the current buffer" Tags="|buffers|files|microsoft-windows|time-date|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9320" PostTypeId="2" ParentId="9319" CreationDate="2015-02-17T15:30:30.810" Score="1" Body="&lt;p&gt;For the file last-modified date/time, the file last-accessed date/time, and the file last-status-change date/time, use function &lt;code&gt;file-attributes&lt;/code&gt;. See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Attributes.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;File Attibutes&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It's not very clear what you are asking. You mention the date of the &lt;strong&gt;buffer&lt;/strong&gt; creation, but @kaushalmodi mentions the &quot;file-date-time-of-creation&quot; in a comment and you seem to go along with that comment. Just what date/time are you asking about? If this is about the file, as I'm guessing, then please edit the question title and body to reflect that.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-17T15:30:30.810" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9321" PostTypeId="2" ParentId="8320" CreationDate="2015-02-17T17:36:35.097" Score="2" Body="&lt;p&gt;You need &lt;code&gt;undo-boundary&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;a href=&quot;https://github.com/abo-abo/abel&quot; rel=&quot;nofollow&quot;&gt;example&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun abel-expand ()&#xA;  &quot;Expand the abbrev before point.&quot;&#xA;  (when (= (length (this-command-keys-vector)) 1)&#xA;    (insert-char (aref (this-command-keys-vector) 0))&#xA;    (undo-boundary)&#xA;    (backward-delete-char 1))&#xA;  (unless (memq (aref (this-command-keys-vector) 0) '(?- ?+ ?/ ?_))&#xA;    (when (looking-at &quot;[])} ]&quot;)&#xA;      (let ((pt (point)))&#xA;        (skip-chars-backward &quot;[[:alnum:]]&quot;)&#xA;        (let* ((name (buffer-substring-no-properties (point) pt))&#xA;               (body (gethash name abel--table)))&#xA;          (delete-region (point) pt)&#xA;          (insert body))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-17T17:36:35.097" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9322" PostTypeId="1" AcceptedAnswerId="24602" CreationDate="2015-02-17T20:47:15.820" Score="14" ViewCount="3619" Body="&lt;p&gt;When I quit ediff with &lt;kbd&gt;q&lt;/kbd&gt; I get asked if I really want to quit. I'd rather it quit immediately. There is nothing obvious under &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/ediff.html#Customization&quot;&gt;customization&lt;/a&gt;. There is a solution &lt;a href=&quot;https://github.com/scfrazer/.emacs.d/blob/master/lisp/src/my-ediff.el&quot;&gt;here&lt;/a&gt; which seems to work by redefining the &lt;kbd&gt;q&lt;/kbd&gt; key, but I'm not sure of the details of how the function works. What's the simplest way to get quit to really mean quit?&lt;/p&gt;&#xA;" OwnerUserId="5426" LastActivityDate="2016-07-14T13:05:59.387" Title="How can I quit ediff immediately without having to type 'y'" Tags="|ediff|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9323" PostTypeId="1" AcceptedAnswerId="9326" CreationDate="2015-02-17T21:05:51.193" Score="9" ViewCount="2989" Body="&lt;p&gt;How can I get the root directory of the current git repo? I could run &lt;code&gt;shell-command-to-string&lt;/code&gt; on something like &lt;code&gt;git rev-parse --show-toplevel&lt;/code&gt;. Is there a better way? Does &lt;code&gt;magit&lt;/code&gt; or any other git front-end expose this info?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="2536" LastEditDate="2015-02-17T21:51:40.233" LastActivityDate="2019-10-05T21:36:47.583" Title="Get git repo root directory, preferably with magit" Tags="|magit|git|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9324" PostTypeId="2" ParentId="9323" CreationDate="2015-02-17T21:18:12.350" Score="9" Body="&lt;p&gt;You need &lt;code&gt;vc-root-dir&lt;/code&gt;. Works for more than git.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-17T21:18:12.350" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9326" PostTypeId="2" ParentId="9323" CreationDate="2015-02-17T21:48:54.403" Score="15" Body="&lt;p&gt;In Magit this is available as &lt;code&gt;magit-toplevel&lt;/code&gt; (but I agree with&#xA;@abo-abo that it makes sense to use &lt;code&gt;vc-root-dir&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="306" LastEditDate="2015-07-03T13:03:31.813" LastActivityDate="2015-07-03T13:03:31.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9327" PostTypeId="2" ParentId="9323" CreationDate="2015-02-17T22:08:59.433" Score="2" Body="&lt;p&gt;As mentioned by abo-abo, in Emacs 25, there is a function called &lt;code&gt;vc-root-dir&lt;/code&gt; that does what you need in a backend-agnostic manner.  For earlier versions of Emacs, the following is a suitable replacement:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vc-root-dir ()&#xA;  (let ((backend (vc-deduce-backend)))&#xA;    (and backend&#xA;         (ignore-errors&#xA;           (vc-call-backend backend 'root default-directory)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As mentioned by Kyle, Magit provides the function &lt;code&gt;magit-get-top-dir&lt;/code&gt;, which simply calls &lt;code&gt;git rev-parse --show-cdup&lt;/code&gt; and interprets the result.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2019-10-05T21:36:47.583" LastActivityDate="2019-10-05T21:36:47.583" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="9328" PostTypeId="1" CreationDate="2015-02-17T22:21:51.173" Score="10" ViewCount="2405" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file I have code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist&#xA;      (assq-delete-all 'width default-frame-alist))&#xA;&#xA;(add-to-list 'default-frame-alist&#xA;             (cons 'width new-width))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first expression ensures that the second one does not introduce a &quot;degenerate key&quot; in the alist (IOW, multiple elements having the same &lt;code&gt;car&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's a &lt;em&gt;javaesque&lt;/em&gt; amount of machinery for what other languages achieve with something that looks very similar to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;default_frame_list[&quot;width&quot;] = new_width&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a simpler way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Of course, one could reply with &quot;just get rid of the first expression&quot; (IOW, &quot;don't worry about degenerate keys&quot;), but this does not answer my question.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2017-07-01T16:00:00.287" LastActivityDate="2017-07-01T16:00:00.287" Title="Looking for a simple way to update an alist without introducing degeneracies" Tags="|association-lists|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9330" PostTypeId="2" ParentId="9328" CreationDate="2015-02-17T23:09:36.667" Score="5" Body="&lt;p&gt;First off, if you think that your alist has duplicate keys (which you call 'degenerate') and you want to remove them then you will have to call &lt;code&gt;assq-delete-all&lt;/code&gt; or something like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to how to set the value without creating duplicate keys (since the simplest way to deal with an alist is to just cons on a new cons pair to the front) you will need to use something like &lt;code&gt;setf&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few functions you can use, they are all similar and effectively do the same thing. They set the &lt;em&gt;value&lt;/em&gt; of a &lt;em&gt;place&lt;/em&gt;. A place is something like a &lt;code&gt;car&lt;/code&gt; or a &lt;code&gt;cdr&lt;/code&gt; of a list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;setcdr&lt;/code&gt; (or its alias &lt;code&gt;rplacd&lt;/code&gt;) to set the value of the cdr of the cons cell returned by &lt;code&gt;assq&lt;/code&gt; to the new value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rplacd (assq 'width default-frame-alist) new-width)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you can use &lt;code&gt;setf&lt;/code&gt; to do the same thing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf (cdr (assq 'width default-frame-alist) new-width)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;setf&lt;/code&gt; is more general and works by looking up &lt;code&gt;setf methods&lt;/code&gt; defined for the &lt;em&gt;place&lt;/em&gt; (i.e. &lt;code&gt;car&lt;/code&gt; or &lt;code&gt;cdr&lt;/code&gt; or &lt;code&gt;first&lt;/code&gt;) and then calling that function with the other parameters. There are even ways for one to define one's own &lt;code&gt;setf methods&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference look up &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Generalized-Variables.html#Generalized-Variables&quot; rel=&quot;nofollow&quot;&gt;Generalized Variables&lt;/a&gt; in the Elisp manual.&lt;/p&gt;&#xA;" OwnerUserId="245" LastEditorUserId="245" LastEditDate="2015-02-18T01:50:34.360" LastActivityDate="2015-02-18T01:50:34.360" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9331" PostTypeId="1" AcceptedAnswerId="9342" CreationDate="2015-02-18T00:15:05.303" Score="5" ViewCount="278" Body="&lt;p&gt;&lt;code&gt;list-packages&lt;/code&gt; prompts you to upgrade packages when newer versions are available. How do you tell &lt;code&gt;package.el&lt;/code&gt; to never consider a particular package for auto-upgrades? There are some packages which I have minor customizations for and don't care about newer versions of them.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-02-23T15:01:22.930" Title="Mark package to never be considered for upgrade" Tags="|package|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9332" PostTypeId="2" ParentId="9322" CreationDate="2015-02-18T01:08:31.950" Score="5" Body="&lt;p&gt;Unfortunately I think you do have to either rebind q or adjust the source of &lt;code&gt;ediff-quit&lt;/code&gt;. As is apparent in the source of &lt;code&gt;ediff-quit&lt;/code&gt; the prompt always happens. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ediff-quit (reverse-default-keep-variants)&#xA;  &quot;Finish an Ediff session and exit Ediff.&#xA;Unselects the selected difference, if any, restores the read-only and modified&#xA;flags of the compared file buffers, kills Ediff buffers for this session&#xA;\(but not buffers A, B, C\).&#xA;&#xA;If `ediff-keep-variants' is nil, the user will be asked whether the buffers&#xA;containing the variants should be removed \(if they haven't been modified\).&#xA;If it is t, they will be preserved unconditionally.  A prefix argument,&#xA;temporarily reverses the meaning of this variable.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (ediff-barf-if-not-control-buffer)&#xA;  (let ((ctl-buf (current-buffer))&#xA;    (ctl-frm (selected-frame))&#xA;    (minibuffer-auto-raise t))&#xA;    (if (y-or-n-p (format &quot;Quit this Ediff session%s? &quot;&#xA;              (if (ediff-buffer-live-p ediff-meta-buffer)&#xA;                  &quot; &amp;amp; show containing session group&quot; &quot;&quot;)))&#xA;    (progn&#xA;      (message &quot;&quot;)&#xA;      (set-buffer ctl-buf)&#xA;      (ediff-really-quit reverse-default-keep-variants))&#xA;      (select-frame ctl-frm)&#xA;      (raise-frame ctl-frm)&#xA;      (message &quot;&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would suggest redefining &lt;code&gt;ediff-quit&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt; and submitting a patch to the source adding a customization variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember that the implementation source in emacs is always a few keystrokes away. Presuming the elisp sources are installed, type &lt;kbd&gt;C-h f&lt;/kbd&gt;, enter the function name and follow the link to where it is defined.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2015-02-18T01:13:39.517" LastActivityDate="2015-02-18T01:13:39.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9333" PostTypeId="1" AcceptedAnswerId="9347" CreationDate="2015-02-18T02:37:39.987" Score="23" ViewCount="3552" Body="&lt;p&gt;Imagine an org buffer in Emacs like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Title&#xA;&#xA;Some text describing the title and the codew (sic) and whatnot.&#xA;&#xA;#+BEGIN_SRC emacs_lisp&#xA;(setq backup-by-copying t)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want flyspell to check the org buffer (and catch the spelling error in it) but ignore the content between the #+BEGIN_SRC and #+END_SRC marks. How does one go about that?&lt;/p&gt;&#xA;" OwnerUserId="2794" LastEditorUserId="50" LastEditDate="2015-02-18T14:30:28.550" LastActivityDate="2020-01-16T10:38:50.947" Title="How does one use flyspell in org buffers without flyspell triggering on tangled code blocks?" Tags="|org-mode|flyspell|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9334" PostTypeId="2" ParentId="9328" CreationDate="2015-02-18T03:11:02.877" Score="12" Body="&lt;p&gt;In Emacs-25, there's &lt;code&gt;alist-get&lt;/code&gt; which you can use to get &lt;em&gt;and&lt;/em&gt; set a key.  E.g. you can do what you want with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf (alist-get 'width default-frame-alist) new-width)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-02-18T03:11:02.877" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9336" PostTypeId="1" AcceptedAnswerId="9346" CreationDate="2015-02-18T05:23:42.983" Score="1" ViewCount="857" Body="&lt;p&gt;I have these settings for evaluating emacs lisp code in babel:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; org-babel-default-header-args:emacs-lisp&#xA;((:eval . &quot;never-export&quot;)&#xA; (:exports . &quot;both&quot;)&#xA; (:hlines . &quot;yes&quot;)&#xA; (:colnames . &quot;no&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is an example document.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Title&#xA;&#xA;Here is some advanced math.&#xA;&#xA;#+BEGIN_SRC elisp&#xA; (+ 1 1)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 2&#xA;&#xA;And here is some more.&#xA;&#xA;#+BEGIN_SRC elisp&#xA; (+ 2 2)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export this document to pdf, the results are not exported. Why not? &lt;code&gt;org-version&lt;/code&gt; holds 8.2.10.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-02-18T17:19:39.590" Title="Exporting the results of code evaluation in org-babel by default" Tags="|org-export|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9337" PostTypeId="1" AcceptedAnswerId="9339" CreationDate="2015-02-18T08:28:16.257" Score="2" ViewCount="1096" Body="&lt;p&gt;Our project has a folder structure which makes navigating files a bit of a hassle.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;basefolder&#xA;--&amp;gt; libs&#xA;    --&amp;gt; libA&#xA;    --&amp;gt; libB&#xA;    ...&#xA;--&amp;gt; utils&#xA;    --&amp;gt; utilA&#xA;    ...&#xA;--&amp;gt; apps&#xA;    --&amp;gt; appTypeA&#xA;         ---&amp;gt; appA&#xA;         ---&amp;gt; appB&#xA;         ...&#xA;    --&amp;gt; appTypeB&#xA;    ...&#xA;--&amp;gt; external&#xA;    --&amp;gt; &#xA;    ...&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My colleague uses SublimeText and he has this search bar, which just treats all files as if they were in the current folder in combination with a fuzzy name matching which works great for our project.&#xA;Can I achive something similar with my emacs?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: using projectile solves the question. One simple way to get this to work is by installing &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow&quot;&gt;prelude&lt;/a&gt;, which also includes helm and helm-projectile.&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-04-07T06:40:06.470" LastActivityDate="2015-04-07T06:40:06.470" Title="Open file by name matching recursively from current folder" Tags="|files|fuzzy-search|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9338" PostTypeId="1" AcceptedAnswerId="9343" CreationDate="2015-02-18T09:12:35.577" Score="6" ViewCount="2036" Body="&lt;p&gt;I am viewing remote log files using tramp mode in emacs. Is there a way to get tramp to auto-refresh  these buffers when they change remotely? If this is not possible, is there a way to reload a buffer every time it is opened?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to set &lt;code&gt;(global-auto-revert-mode t)&lt;/code&gt;, but this does not work.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: Just found out that &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html&quot; rel=&quot;noreferrer&quot;&gt;this is intended behaviour&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can also tell Emacs to revert buffers periodically. To do this for&#xA;  a specific buffer, enable the minor mode Auto-Revert mode by typing&#xA;  M-x auto-revert-mode. This automatically reverts the current buffer&#xA;  every five seconds; you can change the interval through the variable&#xA;  auto-revert-interval. To do the same for all file buffers, type M-x&#xA;  global-auto-revert-mode to enable Global Auto-Revert mode. These minor&#xA;  modes do not check or revert remote files, because that is usually too&#xA;  slow.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-02-18T12:00:48.370" LastActivityDate="2015-02-18T12:00:48.370" Title="Auto-refresh files when using tramp" Tags="|files|tramp|auto-revert-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9339" PostTypeId="2" ParentId="9337" CreationDate="2015-02-18T09:19:06.163" Score="4" Body="&lt;p&gt;You need &lt;code&gt;projectile&lt;/code&gt;, probably the most popular Emacs package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'projectile)&#xA;(setq projectile-indexing-method 'alien)&#xA;(setq projectile-enable-caching t)&#xA;(projectile-global-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-18T09:19:06.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9341" PostTypeId="1" AcceptedAnswerId="9345" CreationDate="2015-02-18T10:21:11.823" Score="2" ViewCount="846" Body="&lt;p&gt;I am developing an Emacs package that applies when Emacs is used as a server. It should set the frame title when activated, and also when receiving certain commands from Emacsclient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package adds the current project name and the buffer file name to the frame title. The problem is that using &lt;code&gt;set-frame-parameter&lt;/code&gt; does not allow the frame title to vary with the current buffer name. So I decided to try setting &lt;code&gt;frame-title-format&lt;/code&gt; instead, but then the title is not updated before a new frame is opened, or I change to another buffer in the current frame. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-project-name &quot;project A&quot;)&#xA;&#xA;(defun my-set-title ()&#xA;  (let ((name&#xA;         (if buffer-file-name&#xA;             (buffer-file-name)&#xA;           (buffer-name))))&#xA;    (concat my-project-name &quot; : &quot; name))) &#xA;&#xA;(setq frame-title-format '(:eval (my-set-title)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, in order to update the frame title to reflect a new project name, I used:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq my-project-name &quot;project B&quot;)&#xA;(set-frame-parameter nil 'title &quot;dummy&quot;)&#xA;(set-frame-parameter nil 'title nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason for first setting the title to a dummy value and then resetting it to &lt;code&gt;nil&lt;/code&gt; is to also update the title for the current buffer in the current frame immediately. But I could not find this trick in the documentation, so is this going to  work in general?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-18T15:53:39.990" Title="How to update frame-title-format and also the current frame title?" Tags="|buffers|frames|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9342" PostTypeId="2" ParentId="9331" CreationDate="2015-02-18T10:28:20.543" Score="10" Body="&lt;p&gt;Add the following code to your init-file (replace &lt;code&gt;package-1&lt;/code&gt;, &lt;code&gt;package-2&lt;/code&gt;, etc. with names of packages you would like to freeze at the current version):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar package-menu-exclude-packages '(&quot;package-1&quot; &quot;package-2&quot; &quot;package-n&quot;))&#xA;&#xA;(defun package-menu--remove-excluded-packages (orig)&#xA;  (let ((included (-filter&#xA;                   (lambda (entry)&#xA;                     (let ((name (symbol-name (package-desc-name (car entry)))))&#xA;                       (not (member name package-menu-exclude-packages))))&#xA;                   tabulated-list-entries)))&#xA;    (setq-local tabulated-list-entries included)&#xA;    (funcall orig)))&#xA;&#xA;(advice-add 'package-menu--find-upgrades :around #'package-menu--remove-excluded-packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Explanation&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package-menu--find-upgrades&lt;/code&gt; is responsible for building the list of packages to upgrade. To do this, it looks at each entry in &lt;code&gt;tabulated-list-entries&lt;/code&gt;. So in order to ignore certain packages, we need to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Introduce a variable that holds a list of packages to ignore (called &lt;code&gt;package-menu-exclude-packages&lt;/code&gt; above).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot;&gt;Advise&lt;/a&gt; &lt;code&gt;package-menu--find-upgrades&lt;/code&gt; to run with a modified version of &lt;code&gt;tabulated-list-entries&lt;/code&gt; that excludes the packages we'd like to ignore.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-23T15:01:22.930" LastActivityDate="2015-02-23T15:01:22.930" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9343" PostTypeId="2" ParentId="9338" CreationDate="2015-02-18T10:39:06.540" Score="6" Body="&lt;p&gt;There is a customizable variable named auto-revert-remote-files, which does what you want.&lt;/p&gt;&#xA;" OwnerUserId="2415" LastActivityDate="2015-02-18T10:39:06.540" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9344" PostTypeId="1" AcceptedAnswerId="24501" CreationDate="2015-02-18T11:10:40.383" Score="3" ViewCount="1286" Body="&lt;p&gt;Currently when I select a bit of text replacing another bit of text (eg &quot;viwp&quot; to paste over the current word) it copies the thing I just replaced into kill ring. So if I try to paste over another bit it has lost the original thing I copied and instead pastes the thing I previously replaced. Obviously I can cycle through the kill ring but that's fiddly and a total pain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what variables to look at? I think this happened when I upgraded evil-mode.&lt;/p&gt;&#xA;" OwnerUserId="3986" LastActivityDate="2021-07-12T21:54:56.420" Title="Pasting in evil-mode when there's an active selection copies the selection" Tags="|evil|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9345" PostTypeId="2" ParentId="9341" CreationDate="2015-02-18T11:45:36.433" Score="3" Body="&lt;p&gt;In general way, &lt;code&gt;force-mode-line-update&lt;/code&gt; is used for frame title updating.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-project-name &quot;project B&quot;)&#xA;(force-mode-line-update)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2838" LastActivityDate="2015-02-18T11:45:36.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9346" PostTypeId="2" ParentId="9336" CreationDate="2015-02-18T11:59:26.757" Score="1" Body="&lt;p&gt;Because &lt;code&gt;:eval . &quot;never-export&quot;&lt;/code&gt; means &quot; The code block will not be evaluated during export but may still be called interactively&quot;. You can either change this to &quot;yes&quot;, or leave it the way it is and do &lt;code&gt;M-x org-bable-execute-buffer&lt;/code&gt; before exporting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;It looks like the issue was not unevaluated code blocks as I assumed in the original answer. Rather, you should use the official identifier &lt;code&gt;emacs-lisp&lt;/code&gt; rather than &lt;code&gt;elisp&lt;/code&gt;, i.e.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Title&#xA;&#xA;Here is some advanced math.&#xA;&#xA;#+BEGIN_SRC emacs-lisp&#xA; (+ 1 1)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 2&#xA;&#xA;And here is some more.&#xA;&#xA;#+BEGIN_SRC emacs-lisp&#xA; (+ 2 2)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5308" LastEditorUserId="5308" LastEditDate="2015-02-18T17:19:39.590" LastActivityDate="2015-02-18T17:19:39.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9347" PostTypeId="2" ParentId="9333" CreationDate="2015-02-18T12:29:37.027" Score="14" Body="&lt;pre&gt;&lt;code&gt;;; NO spell check for embedded snippets&#xA;(defadvice org-mode-flyspell-verify (after org-mode-flyspell-verify-hack activate)&#xA;  (let* ((rlt ad-return-value)&#xA;         (begin-regexp &quot;^[ \t]*#\\+begin_\\(src\\|html\\|latex\\|example\\|quote\\)&quot;)&#xA;         (end-regexp &quot;^[ \t]*#\\+end_\\(src\\|html\\|latex\\|example\\|quote\\)&quot;)&#xA;         (case-fold-search t)&#xA;         b e)&#xA;    (when ad-return-value&#xA;      (save-excursion&#xA;        (setq b (re-search-backward begin-regexp nil t))&#xA;        (if b (setq e (re-search-forward end-regexp nil t))))&#xA;      (if (and b e (&amp;lt; (point) e)) (setq rlt nil)))&#xA;    (setq ad-return-value rlt)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note ispell-skip-region-alist is NOT used by flyspell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test on Emacs24.3, 24.4, 24.5, 25.1 with builtin org-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most users turn on flyspell by default. So above code is enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't enable flyspell-mode in org file. I prefer manually &lt;code&gt;M-x flyspell-buffer&lt;/code&gt; again and again. So I need &lt;code&gt;(flyspell-mode 1) (flyspell-mode -1)&lt;/code&gt; in org-mode-hook. Yes, turn on then turn off flyspell-mode. The purpose is to make sure the org-mode's default predicate is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note &lt;code&gt;flyspell-incorrect-hook&lt;/code&gt; is not the good place for per major mode configuration because it's shared by all major modes. So the heavy weight configuration code in one major mode could impact other major modes if the per major mode code is placed in &lt;code&gt;flyspell-incorrect-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;flyspell&lt;/code&gt; has already provided &lt;code&gt;flyspell-generic-check-word-predicate&lt;/code&gt;  which is &quot;Function providing per-mode customization over which words are flyspelled&quot;. It's buffer local variable so it safe to use out of box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Screenshot of its definition from &lt;code&gt;flyspell.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/g3euq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/g3euq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, the predicate is more flexible than the hook because &lt;strong&gt;the predicate is tested at first&lt;/strong&gt;. So if the predicate claims a word is not a typo, the hook will not be executed. Here is the screenshot of &lt;code&gt;flyspell-word&lt;/code&gt; definition,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3SelW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3SelW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, the default value of &lt;code&gt;flyspell-generic-check-word-predicate&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; is &lt;code&gt;org-mode-flyspell-verify&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I advice &lt;code&gt;org-mode-flyspell-verify&lt;/code&gt; is I'm lazy. I could change the value of the predicate to my own function which calls &lt;code&gt;org-mode-flyspell-verify&lt;/code&gt; instead,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-mode-hook-setup ()&#xA;  (setq flyspell-generic-check-word-predicate&#xA;        (lambda ()&#xA;          (let* ((rlt (org-mode-flyspell-verify)))&#xA;            ;; do whatever on rlt below this line&#xA;            (message &quot;rlt=%s&quot; rlt)&#xA;            rlt))))&#xA;(add-hook 'org-mode-hook 'org-mode-hook-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2020-01-16T10:38:50.947" LastActivityDate="2020-01-16T10:38:50.947" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="9348" PostTypeId="2" ParentId="450" CreationDate="2015-02-18T13:08:31.983" Score="9" Body="&lt;p&gt;If you use &lt;code&gt;flyspell&lt;/code&gt; instead, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/9333/how-does-one-use-flyspell-in-org-buffers-without-flyspell-triggering-on-tangled/9347&quot;&gt;How does one use flyspell in org buffers without flyspell triggering on tangled code blocks?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Please note:&lt;/em&gt; &lt;code&gt;ispell-skip-region-alist&lt;/code&gt; is &lt;strong&gt;NOT&lt;/strong&gt; used by &lt;code&gt;flyspell&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-05-08T07:40:39.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9349" PostTypeId="1" CreationDate="2015-02-18T13:11:09.053" Score="1" ViewCount="427" Body="&lt;p&gt;When I paste a text inside quotation marks into Emacs+AUCTeX, AUCTeX formats it with a soft red color (see the screenshot below at the first line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like this color. However, I'm using &lt;code&gt;csquotes&lt;/code&gt; package to handle (multilingual) quotations marks. The &lt;code&gt;\enquote&lt;/code&gt; commands (provided by &lt;code&gt;csquote&lt;/code&gt; package) use another color. I don't like this last color (see screenshot at the second line). With this ugly soft green color, I cannot find quickly quotation inside a big document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change &lt;code&gt;csquotes&lt;/code&gt; default color to use AUCTeX default one?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The screenshot:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/opg1j.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This screenshot uses French quotation marks but it hasn't any influence on my question.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a bunch of settings about fontification in the csquotes.el file but I didn't see any reference to colors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; Fontification&#xA;   (when (and (featurep 'font-latex)&#xA;          (eq TeX-install-font-lock 'font-latex-setup))&#xA;     (font-latex-add-keywords '((&quot;DisableQuotes&quot; &quot;&quot;)&#xA;                (&quot;RestoreQuotes&quot; &quot;&quot;))&#xA;                  'function)&#xA;     (font-latex-add-keywords '((&quot;enquote&quot; &quot;*{&quot;)&#xA;                (&quot;foreignquote&quot; &quot;*{{&quot;)&#xA;                (&quot;hyphenquote&quot; &quot;*{{&quot;)&#xA;                (&quot;textcquote&quot; &quot;*[[{[{&quot;)&#xA;                (&quot;foreigntextcquote&quot; &quot;*{[[{[{&quot;)&#xA;                (&quot;hyphentextcquote&quot; &quot;*{[[{[{&quot;)&#xA;                (&quot;textquote&quot; &quot;*[[{&quot;)&#xA;                (&quot;foreigntextquote&quot; &quot;*{[[{&quot;)&#xA;                (&quot;hyphentextquote&quot; &quot;*{[[{&quot;)&#xA;                (&quot;blockquote&quot; &quot;[[{&quot;)&#xA;                (&quot;foreignblockquote&quot; &quot;{[[{&quot;)&#xA;                (&quot;hyphenblockquote&quot; &quot;{[[{&quot;)&#xA;                (&quot;blockcquote&quot; &quot;[[{[{&quot;)&#xA;                (&quot;foreignblockcquote&quot; &quot;{[[{[{&quot;)&#xA;                (&quot;hyphenblockcquote&quot; &quot;{[[{[{&quot;))&#xA;                  'textual)&#xA;     (font-latex-add-keywords '((&quot;setquotestyle&quot; &quot;[{&quot;)&#xA;                (&quot;MakeOuterQuote&quot; &quot;{&quot;)&#xA;                (&quot;MakeInnerQuote&quot; &quot;{&quot;)&#xA;                (&quot;MakeAutoQuote&quot; &quot;*{{&quot;)&#xA;                (&quot;MakeForeignQuote&quot; &quot;*{{{&quot;)&#xA;                (&quot;MakeHyphenQuote&quot; &quot;*{{{&quot;)&#xA;                (&quot;MakeBlockQuote&quot; &quot;{{{&quot;)&#xA;                (&quot;MakeForeignBlockQuote&quot; &quot;{{{{&quot;)&#xA;                (&quot;MakeHyphenBlockQuote&quot; &quot;{{{{&quot;)&#xA;                (&quot;DeclareQuoteStyle&quot; &quot;[{[[{[{[{[{&quot;)&#xA;                (&quot;DeclareQuoteAlias&quot; &quot;[{{&quot;)&#xA;                (&quot;DeclareQuoteOption&quot; &quot;{&quot;)&#xA;                (&quot;DeclarePlainStyle&quot; &quot;{{{{&quot;)&#xA;                (&quot;SetBlockThreshold&quot; &quot;{&quot;)&#xA;                (&quot;SetBlockEnvironment&quot; &quot;{&quot;)&#xA;                (&quot;SetCiteCommand&quot; &quot;{&quot;))&#xA;                  'variable)))))&#xA;&#xA;;;; csquotes.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5511" LastActivityDate="2015-03-20T22:08:30.790" Title="How can I change the color of a \enquote quotation inside Emacs?" Tags="|latex|auctex|syntax-highlighting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9350" PostTypeId="2" ParentId="8305" CreationDate="2015-02-18T13:26:12.423" Score="2" Body="&lt;p&gt;js2-mode does not use jshint, it will do the syntax check in elisp.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-02-18T13:26:12.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9351" PostTypeId="1" AcceptedAnswerId="9352" CreationDate="2015-02-18T14:04:03.307" Score="9" ViewCount="5399" Body="&lt;p&gt;I would like to install the projectile package manually since the repository is blocked by a firewall. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have downloaded the file projectile.el from the [package homepage][1]  put it together with helm-projectile and helm-projectile into the folder `~/.emacs.d/projectile/'.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/projectile&quot;)&#xA;(require 'projectile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first line alone works, but with the second one emacs reports an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Cannot open load file: no such file or directory, dash&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My current host system is windows.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: package-install-file works wonders :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I had to do to get projectile installed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install-file RET path/to/dash.el&#xA;&#xA;M-x package-install-file RET path/to/projectile.el&#xA;--&amp;gt; pkg-info-0.4 is unavailable&#xA;&#xA;M-x package-install-file RET path/to/pkg-info.el&#xA;--&amp;gt; pkg-epl-0.4 is unavailable&#xA;&#xA;M-x package-install-file RET path/to/epl.el&#xA;&#xA;M-x package-install-file RET path/to/pkg-info.el&#xA;    In pkg-info-package-version:&#xA;    pkg-info.el:222:55:Warning: `epl-find-installed-package' is an obsolete&#xA;        function (as of 0.7); use `epl-find-installed-packages' instead.&#xA;&#xA;M-x package-install-file RET path/to/projectile.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Links&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://github.com/bbatsov/projectile&#xA;https://github.com/lunaryorn/pkg-info.el&#xA;https://github.com/cask/epl&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="8543" LastEditDate="2015-06-26T23:36:25.173" LastActivityDate="2015-06-26T23:36:25.173" Title="How to install a package manually" Tags="|package|microsoft-windows|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9352" PostTypeId="2" ParentId="9351" CreationDate="2015-02-18T14:06:45.917" Score="9" Body="&lt;p&gt;Since you're not using a package manager, you need to also manually install each package's dependencies. The error message tells you exactly which dependency you're missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see at the top of projectile.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'thingatpt)&#xA;(require 'dash)&#xA;(require 'grep)           ; For `rgrep'&#xA;(require 'ibuffer)&#xA;(require 'ibuf-ext)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some are included with Emacs. Some aren't. Here's &lt;a href=&quot;https://github.com/magnars/dash.el&quot;&gt;&lt;code&gt;dash.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see if you already have the libraries installed, you can do: &lt;code&gt;M-x find-library RET dash RET&lt;/code&gt; &lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-18T14:06:45.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9353" PostTypeId="2" ParentId="9349" CreationDate="2015-02-18T15:37:47.237" Score="1" Body="&lt;p&gt;This is a general approach, so you can use it to customize any other faces:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Place your cursor under the word whose color you want to change and &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;describe-char&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You will be prompted with some information. Check &lt;em&gt;There are text properties here:&lt;/em&gt; section, and copy the face link text. (something like &lt;code&gt;font-lock-keyword-face&lt;/code&gt; for example)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-face&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; and paste the previously copied text (for instance &lt;code&gt;font-lock-keyword-face&lt;/code&gt; in this case) &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Modify the color and click/enter &lt;em&gt;Apply and Save&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="193" LastActivityDate="2015-02-18T15:37:47.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9354" PostTypeId="2" ParentId="9341" CreationDate="2015-02-18T15:53:39.990" Score="1" Body="&lt;p&gt;This might not do what you want in all circumstances, but perhaps it will help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tell Emacs to rename the frame whenever it gets iconified (or &lt;a href=&quot;http://www.emacswiki.org/emacs/FisheyeWithThumbs&quot; rel=&quot;nofollow&quot;&gt;thumbified&lt;/a&gt;).  I use the frame name - frame parameter &lt;strong&gt;&lt;code&gt;name&lt;/code&gt;&lt;/strong&gt; instead of frame parameter &lt;code&gt;title&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bind keys for iconifying (or thumbifying) frames to commands that rename the frame before iconifying it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my purposes, this is enough.  For your purposes, it might not be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if a frame has more than one window, selecting a different window does not automatically change the frame name, with this setup. That's the behavior I prefer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If/when I do want the frame name to reflect a different window (the one currently selected) then I  hit &lt;code&gt;C-z&lt;/code&gt; twice to iconify/restore the frame so it gets renamed. You could of course just bind &lt;code&gt;rename-frame&lt;/code&gt; to a key or whatever, to do the same thing directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The functions (commands) for doing this, and for renaming frames (e.g. &lt;code&gt;rename-frame&lt;/code&gt;), are in library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/frame-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;frame-cmds.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-18T15:53:39.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9355" PostTypeId="2" ParentId="9337" CreationDate="2015-02-18T16:06:58.270" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then a prefix arg with &lt;code&gt;C-x C-f&lt;/code&gt; etc. lets you match your input against absolute file names, which means that you can match directory components etc.  (You can also bind command &lt;code&gt;icicle-find-file-absolute&lt;/code&gt; directly to a key, to avoid having to use a prefix arg.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input pattern matching can be fuzzy, using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion&quot; rel=&quot;nofollow&quot;&gt;various fuzzy-matching algorithms&lt;/a&gt;. You can switch matching mode on the fly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More importantly, regardless of the kind of matching you use, you can match against multiple patterns, to narrow the choices progressively (&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow&quot;&gt;progressive completion&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Completion can match file names (as usual) or &lt;a href=&quot;http://www.emacswiki.org/emacs?action=edit;id=Icicles_-_File-Name_Input#icicle-find-file-of-content&quot; rel=&quot;nofollow&quot;&gt;file contents&lt;/a&gt;, or both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_File-Name_Input&quot; rel=&quot;nofollow&quot;&gt;More info.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-18T16:06:58.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9356" PostTypeId="1" AcceptedAnswerId="9681" CreationDate="2015-02-18T16:07:58.687" Score="0" ViewCount="40" Body="&lt;p&gt;I'm behind a firewall. What domains should I whitelist to be able to download packages from melpa? The JavaScript really obfuscates it.&lt;/p&gt;&#xA;" OwnerUserId="3895" LastActivityDate="2015-02-28T18:38:37.843" Title="domains read by melpa's JavaScript" Tags="|package-repositories|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9357" PostTypeId="1" AcceptedAnswerId="9358" CreationDate="2015-02-18T16:35:56.573" Score="61" ViewCount="8000" Body="&lt;p&gt;I'm exploring a git repository history using magit's log view using &lt;kbd&gt;l l&lt;/kbd&gt;. Can I checkout a given commit from there without going to terminal? &lt;/p&gt;&#xA;" OwnerUserId="5247" LastEditorUserId="306" LastEditDate="2016-06-09T10:13:09.033" LastActivityDate="2016-06-09T10:13:22.347" Title="Can I checkout a given commit from magit's log view?" Tags="|magit|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9358" PostTypeId="2" ParentId="9357" CreationDate="2015-02-18T16:41:03.113" Score="80" Body="&lt;p&gt;With point over the desired commit, hit &lt;kbd&gt;b b&lt;/kbd&gt; for checkout, and accept the default reference, which will look something like &lt;code&gt;master~3&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="306" LastEditDate="2016-06-09T10:13:22.347" LastActivityDate="2016-06-09T10:13:22.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9359" PostTypeId="2" ParentId="7224" CreationDate="2015-02-18T16:50:10.030" Score="5" Body="&lt;p&gt;I also had difficulties with managing windows in a large frame, so I wrote this package named &lt;a href=&quot;https://github.com/bmag/emacs-purpose&quot; rel=&quot;noreferrer&quot;&gt;Purpose&lt;/a&gt;, which uses &lt;code&gt;display-buffer-overriding-action&lt;/code&gt; to manage windows instead of &lt;code&gt;display-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, it adds a &quot;purpose&quot; to buffers and windows, so you can have windows that are used for editing (e.g. for source files), windows for comint-based buffers (e.g. terminal, REPL), etc.&lt;br&gt;&#xA;So if you have 3 python files and a bash terminal open (a total of 4 windows), and you open an interpreter from python (C-c C-z), the interpreter will be displayed instead of the terminal for sure.&lt;br&gt;&#xA;You can also configure which purposes exist, if the default configuration is not good enough for you (e.g. if you don't consider python and elisp buffers to have the same purpose).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package is quite new, so it may have a few issues, but I think it could work for you. Hope this helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Sorry for promoting my own package, but I don't see any other answers here at the moment...&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-02-18T16:50:10.030" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9360" PostTypeId="2" ParentId="628" CreationDate="2015-02-18T17:35:00.330" Score="2" Body="&lt;p&gt;Actually, such a command does exist: &lt;strong&gt;&lt;code&gt;next-multiframe-window&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;&#xA;Bind it to some key, maybe &lt;code&gt;C-x o&lt;/code&gt;, and that's all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, &lt;code&gt;previous-multiframe-window&lt;/code&gt; does the same thing, but cycles in the reverse order.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-02-18T17:35:00.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9361" PostTypeId="1" CreationDate="2015-02-18T17:57:16.237" Score="5" ViewCount="900" Body="&lt;p&gt;As described &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Repeating.html&quot;&gt;here&lt;/a&gt;, &#xA;by &lt;code&gt;C-x z&lt;/code&gt;, I can repeat my last keystroke. How can I repeat my last n keystrokes? &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-02-18T18:05:08.960" LastActivityDate="2015-02-18T21:33:12.127" Title="How to repeat the last n keystrokes?" Tags="|keystrokes|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9363" PostTypeId="1" CreationDate="2015-02-18T18:05:47.457" Score="16" ViewCount="6166" Body="&lt;p&gt;The Emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Printing.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; says:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;print-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Print hardcopy of current buffer with page headings containing the file name and page number.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;lpr-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Print hardcopy of current buffer without page headings.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;print-region&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Like &lt;code&gt;print-buffer&lt;/code&gt; but print only the current region.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;lpr-region&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Like &lt;code&gt;lpr-buffer&lt;/code&gt; but print only the current region.&lt;/p&gt;&#xA;&lt;p&gt;[...]&lt;/p&gt;&#xA;&lt;p&gt;To specify the printer to use, set the variable &lt;code&gt;printer-name&lt;/code&gt;. The default, &lt;code&gt;nil&lt;/code&gt;, specifies the default printer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;How do we specify the printer to use?&lt;/p&gt;&#xA;&lt;p&gt;For example, a PDF printer, which is not shown in the output of&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;lpstat -p -d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-19T08:22:58.733" Title="How to specify a printer?" Tags="|print|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9364" PostTypeId="1" CreationDate="2015-02-18T18:13:43.660" Score="20" ViewCount="13187" Body="&lt;p&gt;How can we convert the current text buffer to a pdf file, preferably turning those headings started with * into bookmarks of the pdf file. &#xA;For example, turning the Emacs integrated tutorial (shown by C-h t) into a bookmarked pdf file. Thanks. &lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2018-07-12T14:53:03.957" Title="convert a text buffer to a pdf file?" Tags="|pdf|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9365" PostTypeId="2" ParentId="8300" CreationDate="2015-02-18T18:29:03.470" Score="2" Body="&lt;p&gt;Looks like some kind of bug. You can make it work by doing the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;eval the &lt;code&gt;BEGIN&lt;/code&gt; line&lt;/li&gt;&#xA;&lt;li&gt;remove the formula from the heading, leaving just &lt;code&gt;:formula&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;leave the &lt;code&gt;TBLFM&lt;/code&gt; where the formula has been copied to&lt;/li&gt;&#xA;&lt;li&gt;run &lt;kbd&gt;C-c C-c&lt;/kbd&gt; while the point is in the table to align the columns&lt;/li&gt;&#xA;&lt;li&gt;run &lt;kbd&gt;C-c C-c&lt;/kbd&gt; with point on the &lt;code&gt;CAPTION&lt;/code&gt; line and the column header appears&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Easy!  :-)&lt;/p&gt;&#xA;" OwnerUserId="6534" LastActivityDate="2015-02-18T18:29:03.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9366" PostTypeId="1" AcceptedAnswerId="33112" CreationDate="2015-02-18T18:51:33.797" Score="1" ViewCount="1609" Body="&lt;p&gt;I am not entirely sure where to post this question (here, stackoverflow....), but I am sure some &lt;code&gt;emacs&lt;/code&gt; experts will be able to help me here. This question is also posted here &lt;a href=&quot;https://github.com/tkf/emacs-ipython-notebook/issues/158&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tkf/emacs-ipython-notebook/issues/158&lt;/a&gt; , so the reader can go there for some more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently I managed to set &lt;code&gt;IPython&lt;/code&gt; in &lt;code&gt;emacs&lt;/code&gt; and I have been so far happily coding using the &quot;interplay&quot; of the two. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now need to share some code and the &lt;code&gt;IPython Notebook&lt;/code&gt; seems like the best tool to do so. Therefore, I have been using &lt;code&gt;IPython&lt;/code&gt; the &quot;normal&quot; way until I recently learned that IPython can also be set up on emacs &lt;a href=&quot;https://github.com/tkf/emacs-ipython-notebook&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tkf/emacs-ipython-notebook&lt;/a&gt; . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided to give it a go and install all the requirements: &lt;code&gt;websocket&lt;/code&gt;, &lt;code&gt;request&lt;/code&gt; etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, now, every time I try to run &lt;code&gt;Emacs IPython Notebook&lt;/code&gt; via &lt;code&gt;M-x ein:notebooklist-open&lt;/code&gt; I find the following error messages: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Contacting host: 127.0.0.1:8961&#xA;ein: [error] QUERY-AJAX--PARSE-DATA: error from parser ein:json-read&#xA;error in process filter: eq: JSON readtable error&#xA;error in process filter: JSON readtable error&#xA;ein: [error] QUERY-AJAX--PARSE-DATA: error from parser ein:json-read&#xA;Error running timerein:query-ajax-timeout-callback': (json-readtable-error)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relevant section of my &lt;code&gt;.emacs&lt;/code&gt; file looks like this (I am sure that most of it is not needed, but I have gone through a lot of iterations): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;;;Ipython Notebook&#xA;(add-to-list 'load-path &quot;/Users/javier/.emacs.d/elpa/request-0.2.0/&quot;)&#xA;(require 'request)&#xA;(add-to-list 'load-path &quot;/Users/javier/.emacs.d/elpa/helm-1.6.7/&quot;)&#xA;(require 'helm)&#xA;(add-to-list 'load-path &quot;/Users/javier/.emacs.d/elpa/company-0.8.9/&quot;)&#xA;(autoload 'company-mode &quot;company&quot; nil t)&#xA;(add-to-list 'load-path &quot;/Users/javier/.emacs.d/elpa/popup-0.5.2/&quot;)&#xA;(require 'popup)&#xA;(add-to-list 'load-path &quot;/Users/javier/.emacs.d/elpa/websocket-1.3/&quot;)&#xA;(require 'websocket)&#xA;(add-to-list 'load-path &quot;/Users/javier/.emacs.d/elpa/ein-0.2.0/&quot;)&#xA;(require 'ein)&#xA;(require 'cc-mode)&#xA;;;(setq ein:use-auto-complete t)&#xA;;; Or, to enable &quot;superpack&quot; (a little bit hacky improvements):&#xA;(setq ein:use-auto-complete-superpack t)&#xA;(setq ein:use-smartrep t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;more details about my &lt;code&gt;System Info&lt;/code&gt; can be found here &lt;a href=&quot;https://github.com/tkf/emacs-ipython-notebook/issues/158&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tkf/emacs-ipython-notebook/issues/158&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my understanding the problem seems to be related to request and the fact that despite the &lt;code&gt;(require 'request)&lt;/code&gt; the &lt;code&gt;request.el&lt;/code&gt; seems to either not having been loaded or not being visible to &lt;code&gt;ein&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this stage I do not know what to edit/install to make it work so I can use the notebook in emacs like is shown here &lt;a href=&quot;https://github.com/tkf/emacs-ipython-notebook/wiki/Screenshots&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tkf/emacs-ipython-notebook/wiki/Screenshots&lt;/a&gt; . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found this &lt;a href=&quot;https://emacs.stackexchange.com/questions/428/emacs-ein-vs-ipython-shell&quot;&gt;Emacs EIN vs IPython shell&lt;/a&gt; but seems not to solve my problem. &lt;/p&gt;&#xA;" OwnerUserId="4103" LastEditorUserId="8431" LastEditDate="2017-05-28T19:18:56.910" LastActivityDate="2017-05-28T19:18:56.910" Title="Error when opening IPython notebook list using EIN" Tags="|ipython|ein|json|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9367" PostTypeId="1" AcceptedAnswerId="9369" CreationDate="2015-02-18T18:54:16.743" Score="6" ViewCount="1223" Body="&lt;p&gt;When I make a plain list like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Pizza making &#xA;  This is an elaborate process that &#xA;  involves many years of training.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usually I have to manually press &lt;kbd&gt;TAB&lt;/kbd&gt; on every new line. &#xA;Can this be automated so that org automatically inserts a tab for me if I press return once, and doesn't insert a tab if I press return twice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT] Solution:&lt;/strong&gt;&lt;br&gt;&#xA;Pressing &lt;kbd&gt;C-j&lt;/kbd&gt; gets the job done.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-02-20T09:40:07.100" Title="Auto indent plain list content?" Tags="|org-mode|indentation|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9369" PostTypeId="2" ParentId="9367" CreationDate="2015-02-18T19:22:59.937" Score="8" Body="&lt;p&gt;You can use &lt;kbd&gt;C-j&lt;/kbd&gt; that calls &lt;code&gt;newline-and-indent&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you didn't know about that one, you might be also interested in&#xA;&lt;kbd&gt;M-j&lt;/kbd&gt; that calls &lt;code&gt;indent-new-comment-line&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-18T19:22:59.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9370" PostTypeId="1" AcceptedAnswerId="9395" CreationDate="2015-02-18T20:00:39.917" Score="4" ViewCount="195" Body="&lt;p&gt;I have several R instances running and want to pick which one gets the evaluations in my buffer. Is there a built-in way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-02-19T11:26:27.670" Title="How to control which iESS process gets a code evaluation?" Tags="|ess|r|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9371" PostTypeId="2" ParentId="9361" CreationDate="2015-02-18T21:33:12.127" Score="6" Body="&lt;p&gt;Emacs records the last 300 input events (mainly keystrokes, but also mouse clicks and such). In Elisp, you can access them by calling &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Recording-Input.html#index-recent_002dkeys-4317&quot;&gt;&lt;code&gt;recent-keys&lt;/code&gt;&lt;/a&gt;. As a user, you can view the list of keystrokes by invoking the command &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Help.html#index-view_002dlossage-319&quot;&gt;&lt;code&gt;view-lossage&lt;/code&gt;&lt;/a&gt; by pressing &lt;code&gt;C-h l&lt;/code&gt; or &lt;code&gt;f1 l&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Glancing through the uses of the &lt;code&gt;recent-keys&lt;/code&gt; function, the only thing I can find in Emacs itself that would help you repeat N keystrokes is the macro editor facility. (I haven't looked at third-party packages.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Edit-Keyboard-Macro.html#index-kmacro_002dedit_002dlossage-1017&quot;&gt;&lt;code&gt;kmacro-edit-lossage&lt;/code&gt;&lt;/a&gt; (&lt;code&gt;C-x C-k l&lt;/code&gt;) brings up those last 300 keystrokes in the macro editor. You can edit the buffer to remove the lines you don't want to repeat (press &lt;code&gt;C-k&lt;/code&gt; to remove a line; press &lt;code&gt;ESC 42 C-k&lt;/code&gt; to remove the next 42 lines; press &lt;code&gt;C-SPC&lt;/code&gt;, move and press &lt;code&gt;C-w&lt;/code&gt; to delete a region of the buffer). Then press &lt;code&gt;C-c C-c&lt;/code&gt; to finish editing and &lt;code&gt;C-x e&lt;/code&gt; to execute the macro.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-02-18T21:33:12.127" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9372" PostTypeId="1" CreationDate="2015-02-18T21:33:19.740" Score="4" ViewCount="452" Body="&lt;p&gt;I'm working through the Real World OCaml book. Based on the &lt;a href=&quot;https://github.com/realworldocaml/book/wiki/Installation-Instructions&quot; rel=&quot;nofollow&quot;&gt;installation instructions&lt;/a&gt;, I installed &lt;code&gt;tuareg-mode&lt;/code&gt; for editing OCaml code.&#xA;It is version 2.0.9, which appears to be the latest version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The corresponding code in my init.el looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)&#xA;  (setq auto-mode-alist&#xA;        (append '((&quot;\\.ml[ily]?$&quot; . tuareg-mode)&#xA;                  (&quot;\\.topml$&quot; . tuareg-mode))&#xA;                auto-mode-alist)) &#xA;  (autoload 'utop-setup-ocaml-buffer &quot;utop&quot; &quot;Toplevel for OCaml&quot; t)&#xA;  (add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer)&#xA;  (add-hook 'tuareg-mode-hook 'merlin-mode)&#xA;  (setq merlin-use-auto-complete-mode t)&#xA;  (setq merlin-error-after-save nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to type code into a .ml file, it indents things weirdly. For example,&#xA;if I type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;open Core.Std&#xA;       (* it indents like this *)&#xA;       (* for every line in the rest of the file *)&#xA;(* But I would expect it to indent like this *)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I type a &lt;code&gt;let&lt;/code&gt; statement, it does move to the left, but only after I press return to move on to the next line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside a function definition, indentation works as expected, but the top level of the file indents like the example above. How can I make the top-level indentation behave?&lt;/p&gt;&#xA;" OwnerUserId="6538" LastEditorUserId="5143" LastEditDate="2015-03-03T13:49:46.203" LastActivityDate="2015-03-03T13:49:46.203" Title="Tuareg mode indentation after the first open clause" Tags="|indentation|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9373" PostTypeId="2" ParentId="9364" CreationDate="2015-02-18T22:09:55.847" Score="18" Body="&lt;p&gt;You can put the below in your &lt;code&gt;init.el&lt;/code&gt; and bind the function to a binding of your choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function prints the file in current buffer as a PDF in the same folder by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the function requires the binary &lt;code&gt;ps2pdf&lt;/code&gt; for converting &lt;code&gt;.ps&lt;/code&gt; to &lt;code&gt;.pdf&lt;/code&gt;. But you can replace that with any available pdf generator on your system.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ps-print)&#xA;(when (executable-find &quot;ps2pdf&quot;)&#xA;  (defun modi/pdf-print-buffer-with-faces (&amp;amp;optional filename)&#xA;    &quot;Print file in the current buffer as pdf, including font, color, and&#xA;underline information.  This command works only if you are using a window system,&#xA;so it has a way to determine color values.&#xA;&#xA;C-u COMMAND prompts user where to save the Postscript file (which is then&#xA;converted to PDF at the same location.&quot;&#xA;    (interactive (list (if current-prefix-arg&#xA;                           (ps-print-preprint 4)&#xA;                         (concat (file-name-sans-extension (buffer-file-name))&#xA;                                 &quot;.ps&quot;))))&#xA;    (ps-print-with-faces (point-min) (point-max) filename)&#xA;    (shell-command (concat &quot;ps2pdf &quot; filename))&#xA;    (delete-file filename)&#xA;    (message &quot;Deleted %s&quot; filename)&#xA;    (message &quot;Wrote %s&quot; (concat (file-name-sans-extension filename) &quot;.pdf&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-18T22:09:55.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9374" PostTypeId="1" AcceptedAnswerId="41383" CreationDate="2015-02-18T22:10:43.353" Score="12" ViewCount="1607" Body="&lt;p&gt;I want to be able to save my buffer local evil markers (m to mark a location and then ' or ` to jump to it) across emacs sessions/instances. I'm not really sure how to do this. I tried installing/using session and adding them like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'session-locals-include 'evil-markers-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work though, and I'm not sure what else to try. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5278" LastEditorUserId="2642" LastEditDate="2015-07-14T02:55:07.733" LastActivityDate="2018-05-08T08:51:04.153" Title="How to Persist Evil Markers?" Tags="|evil|buffer-local|session|persistence|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9375" PostTypeId="2" ParentId="9363" CreationDate="2015-02-18T22:15:35.143" Score="3" Body="&lt;p&gt;The printing happens to the printer name set in the environment variable &lt;code&gt;PRINTER&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I would first set the env var &lt;code&gt;PRINTER&lt;/code&gt; to &lt;code&gt;my-printer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then launch emacs in that terminal &lt;/li&gt;&#xA;&lt;li&gt;Then do &lt;code&gt;M-x ps-print-buffer-with-faces&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-18T22:15:35.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9376" PostTypeId="1" CreationDate="2015-02-18T23:46:02.930" Score="3" ViewCount="165" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; is there a way to rotate between multiple expansions bound to the same abbrev?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm experimenting with &lt;code&gt;abbrev-mode&lt;/code&gt;, and I have some abbreviations that I'd like to use for different expansions of the same abbrev.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I often use the abbreviation &quot;st&quot; for &quot;sometimes&quot;, but occasionally use it to mean &quot;such that&quot;.  I'd like to know if there's a way to bind the &quot;st&quot; abbrev to produce &quot;sometimes&quot; as its default expansion, but allow me to select &quot;such that&quot; as a secondary expansion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sound goofy?  Here's how it's working in my mind.  Let's say I've got a hypothetical command &lt;code&gt;expand-abbrev-and-rotate&lt;/code&gt; bound to the &lt;code&gt;tab&lt;/code&gt; key and &lt;code&gt;*&lt;/code&gt; representing point:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;some text st*&lt;code&gt;tab&lt;/code&gt; =&gt; some text sometimes*&lt;/li&gt;&#xA;&lt;li&gt;some text sometimes*&lt;code&gt;tab&lt;/code&gt; =&gt; some text such that*&lt;/li&gt;&#xA;&lt;li&gt;some text such that*&lt;code&gt;tab&lt;/code&gt; =&gt; some text sometimes*&lt;/li&gt;&#xA;&lt;li&gt;... and so forth, rotating among a short list of possible expansions (2 in this case)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Does &lt;code&gt;abbrev-mode&lt;/code&gt; have anything that could approximate this behavior?  I've been peeking at the internals and can imagine a way to implement it, but wouldn't want to reinvent the wheel.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-27T19:51:16.453" Title="rotate between abbrev expansions?" Tags="|abbrev|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9377" PostTypeId="2" ParentId="7974" CreationDate="2015-02-19T00:16:34.023" Score="3" Body="&lt;p&gt;One thing to know about Emacs is that there are a lot of obscure libraries that come with it.  And, far from being a historical oddity, more go into the tree all the time.  Many times these were written for a single use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no single reason such things aren't reused.  Maybe it didn't fit some uses, maybe some authors didn't know of it, etc.  In your case for &lt;code&gt;tq.el&lt;/code&gt; the answer is the same -- use it if it is a good fit for your problem.  To me it seems a bit under-general; e.g., there's no way to queue a regexp without also sending a string.  Also it's a bit old-fashioned with the &quot;closure&quot; arguments; these are unnecessary now that Emacs has lexical binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also some library duplication in Emacs.  So for example there are both &lt;code&gt;ewoc.el&lt;/code&gt; and &lt;code&gt;tabulated-list.el&lt;/code&gt;, two different ways to accomplish a sort of MVC-ish task.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-19T00:16:34.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9378" PostTypeId="2" ParentId="8316" CreationDate="2015-02-19T00:28:40.693" Score="0" Body="&lt;p&gt;It depends on exactly what you want to do.&lt;/p&gt;&#xA;&lt;p&gt;In the comments, Malabarba links to a blog post that may show the way.  However, I think this approach relies on (programmatically) modifying the buffer text.  If that works for you -- great!&lt;/p&gt;&#xA;&lt;p&gt;If you want to leave the text unmodified, then I think you are out of luck.&lt;/p&gt;&#xA;&lt;p&gt;For problems like this I usually start by reading the section of the elisp manual on the &amp;quot;display&amp;quot; property.  This describes properties that can be applied to characters in the buffer to affect their display.&lt;/p&gt;&#xA;&lt;p&gt;Reading through this, I didn't see anything that controls whether or not a line is wrapped -- just how to display indentation and such when wrapping does happen.&lt;/p&gt;&#xA;&lt;p&gt;So for the time being I believe the answer is &amp;quot;no&amp;quot;.  There's been some talk on the &lt;a href=&quot;https://lists.gnu.org/mailman/listinfo/emacs-devel&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-devel&lt;/a&gt; mailing list recently, about adding wrapping features to redisplay, so maybe there's some hope for the future.&lt;/p&gt;&#xA;" OwnerUserId="822" LastEditorUserId="14825" LastEditDate="2022-03-24T01:09:32.180" LastActivityDate="2022-03-24T01:09:32.180" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="9380" PostTypeId="5" CreationDate="2015-02-19T00:58:50.127" Score="0" Body="&lt;p&gt;Scheme is a functional programming language. It is designed to provide a mathematically well-founded language based on lambda calculus (with eager evaluation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows a minimalist design philosophy specifying a small standard core with powerful tools for language extension. Its compactness and elegance have made it popular with educators, language designers, programmers, implementors, and hobbyists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Scheme language belongs to the &lt;a href=&quot;http://stackoverflow.com/edit-tag-wiki/991&quot;&gt;Lisp&lt;/a&gt; Family. Since Scheme uses a single namespace for naming functions and other values, it is called a lisp-1.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Free Scheme Programming Books&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://mitpress.mit.edu/sicp/full-text/book/book.html&quot; rel=&quot;nofollow&quot;&gt;Structure and Interpretation of Computer Programs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://gustavus.edu/+max/concrete-abstractions.html&quot; rel=&quot;nofollow&quot;&gt;Concrete Abstractions: An Introduction to Computer Science Using Scheme&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The Scheme Programming Language &lt;a href=&quot;http://www.scheme.com/tspl3/&quot; rel=&quot;nofollow&quot;&gt;Edition 3&lt;/a&gt;, &lt;a href=&quot;http://www.scheme.com/tspl4/&quot; rel=&quot;nofollow&quot;&gt;Edition 4&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cs.berkeley.edu/~bh/ss-toc2.html&quot; rel=&quot;nofollow&quot;&gt;Simply Scheme: Introducing Computer Science&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Implementations&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.call-cc.org/&quot; rel=&quot;nofollow&quot;&gt;Chicken Scheme&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/guile/&quot; rel=&quot;nofollow&quot;&gt;GNU Guile&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://code.google.com/p/chibi-scheme/&quot; rel=&quot;nofollow&quot;&gt;Chibi Scheme&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://community.schemewiki.org/?scheme-faq-standards#implementations&quot; rel=&quot;nofollow&quot;&gt;more...&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Community Websites&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://schemers.org&quot; rel=&quot;nofollow&quot;&gt;Schemers.org&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://scheme.dk/planet&quot; rel=&quot;nofollow&quot;&gt;Planet Scheme (Blogs about Scheme)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://plus.google.com/communities/110102162840189720428&quot; rel=&quot;nofollow&quot;&gt;Google+ Community&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5388" LastEditorUserId="5388" LastEditDate="2015-02-19T01:43:07.483" LastActivityDate="2015-02-19T01:43:07.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9381" PostTypeId="4" CreationDate="2015-02-19T00:58:50.127" Score="0" Body="Scheme is a functional programming language in the Lisp family, closely modelled on lambda calculus with eager (applicative-order) evaluation. " OwnerUserId="5388" LastEditorUserId="5388" LastEditDate="2015-02-19T01:43:19.597" LastActivityDate="2015-02-19T01:43:19.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9382" PostTypeId="1" AcceptedAnswerId="9392" CreationDate="2015-02-19T01:08:46.780" Score="1" ViewCount="749" Body="&lt;p&gt;I asked this question originally on &lt;a href=&quot;https://stackoverflow.com/questions/15776339/change-default-compiler-within-emacs&quot;&gt;StackOverflow&lt;/a&gt;. I use &lt;code&gt;M-x compile&lt;/code&gt; within Emacs to compile my C code which then initiates &lt;code&gt;make -k&lt;/code&gt; and allows me to compile the code. I wish to use Clang (or conceivably GCC 4.8 after I install it) as the default compiler. I have &lt;code&gt;cc&lt;/code&gt; aliased to &lt;code&gt;clang -Wall -Werror -std=c99 -ggdb -O0&lt;/code&gt; and while this invokes &lt;code&gt;Clang&lt;/code&gt; from the command line outside of Emacs, invoking &lt;code&gt;M-x compile&lt;/code&gt; from within Emacs still seems to alias &lt;code&gt;cc&lt;/code&gt; to GCC version 4.7 which is what I have installed. I wish to tap into the richer and more understandable error and warning messages provided by Clang (and GCC 4.8) but do not wish to create a separate makefile for every short student-level program I am writing, since I am currently going through K&amp;amp;R including solving the exercises.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I convince Emacs that &lt;code&gt;M-x compile&lt;/code&gt; and &lt;code&gt;make -k&lt;/code&gt; should invoke Clang (or GCC 4.8) instead of the older version of GCC?&lt;/p&gt;&#xA;" OwnerUserId="5388" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-02-19T11:26:39.163" Title="Change Default Compiler Within Emacs?" Tags="|compilation|" AnswerCount="3" CommentCount="3" ClosedDate="2015-02-19T12:58:06.030" ContentLicense="CC BY-SA 3.0" />
  <row Id="9383" PostTypeId="2" ParentId="9363" CreationDate="2015-02-19T02:01:13.347" Score="10" Body="&lt;p&gt;If you are on Linux you can install &lt;a href=&quot;http://sourceforge.net/projects/gtklp/&quot; rel=&quot;noreferrer&quot;&gt;gtklp&lt;/a&gt; and set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lpr-command &quot;gtklp&quot;)&#xA;(setq ps-lpr-command &quot;gtklp&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to give you a graphical print wizard. This doesn't actually give you print-to-file (unless you have a virtual pdf printer set up in CUPS), but it generally allows for easy printing from emacs.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2015-02-19T02:01:13.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9384" PostTypeId="2" ParentId="8037" CreationDate="2015-02-19T02:31:55.547" Score="2" Body="&lt;p&gt;Without more information it is hard to say why the indentation level is incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason some keys indent in some modes is that those modes rebind them.  For example, the open paren in C (and C-derived) modes is bound to &lt;code&gt;c-electric-paren&lt;/code&gt;.  This command inserts the paren but also reindents and maybe does some other things, depending on various settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can usually discover this sort of thing using &lt;code&gt;C-h k&lt;/code&gt; followed by the key, in a buffer of the mode in question, and then reading the docs.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-19T02:31:55.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9385" PostTypeId="2" ParentId="5615" CreationDate="2015-02-19T02:49:03.023" Score="2" Body="&lt;p&gt;The Ruby editing mode defines &lt;code&gt;ruby-indent-tabs-mode&lt;/code&gt; and sets &lt;code&gt;indent-tabs-mode&lt;/code&gt; to that value when the mode is invoked.  The default for this is &lt;code&gt;nil&lt;/code&gt;.  To fix your problem, set this variable instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems like a bug to me.  There's no reason Ruby needs its own special setting for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that &lt;code&gt;c-basic-offset&lt;/code&gt; doesn't affect Ruby.  Ruby has &lt;code&gt;ruby-indent-level&lt;/code&gt;.  It's a bit of an Emacs oddity that modes must provide their own variables for basic indentation.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-19T02:49:03.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9386" PostTypeId="2" ParentId="5482" CreationDate="2015-02-19T02:55:43.080" Score="1" Body="&lt;p&gt;Here is how I would debug this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, find the failing bytecode.  This ought to be the function on the stack just before the call to &lt;code&gt;error&lt;/code&gt;.  In this case it seems to be &lt;code&gt;open-network-stream&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disassemble this method using &lt;code&gt;disassemble&lt;/code&gt;.  In order to understand this you may need to read through &lt;code&gt;bytecode.c&lt;/code&gt; a bit, or maybe the bytecode compiler, depending on whether you like to read hairy C or hairy Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to find the unbalanced bindings by inspection -- by tracing through the code by hand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After this you have to start debugging the bytecode compiler to find out where it has gone wrong.  One approach might be to try to correlate the bad bytecode to forms in the failing function, and then try to reduce this to a more tractable test case (&lt;code&gt;open-network-stream&lt;/code&gt; seems large-ish).  This would make it simpler to track through the compiler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to work around the bug, remove the &lt;code&gt;.elc&lt;/code&gt; in question and reload it.  Or, if it is dumped, just re-evaluate the function in question.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-19T02:55:43.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9387" PostTypeId="2" ParentId="9382" CreationDate="2015-02-19T02:59:49.670" Score="1" Body="&lt;p&gt;I think this is more of a shell question than an Emacs one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to do this is to put a shell script named &quot;cc&quot; early in your &lt;code&gt;$PATH&lt;/code&gt; and have it invoke your preferred compiler.  Make sure Emacs has this same value of &lt;code&gt;$PATH&lt;/code&gt; (not normally a problem).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying problem is that an alias generally won't be invoked by &lt;code&gt;make&lt;/code&gt;, whereas a program on &lt;code&gt;$PATH&lt;/code&gt; will be.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-19T02:59:49.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9388" PostTypeId="2" ParentId="8234" CreationDate="2015-02-19T03:03:14.160" Score="6" Body="&lt;p&gt;This is just a bug.  It's fixed in Emacs trunk.  Maybe you can grab a newer version of the mode from there, or dig the bug fix out of the git history.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-19T03:03:14.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9389" PostTypeId="1" AcceptedAnswerId="9394" CreationDate="2015-02-19T06:08:08.837" Score="3" ViewCount="326" Body="&lt;p&gt;For example, in in lisp-mode, I want to be able to use d as normal but also remap something like &quot;dh&quot; to something like &quot;sp-splice-sexp-killing-backward&quot;. In vim you can remap keys like this without a problem, but with evil this would get rid of d's functionality altogether. Would there be some way to wrap this so that if a mapping exists for a d sequence, that action is taken and otherwise &quot;evil-delete&quot; is called with the key(s) instead?&lt;/p&gt;&#xA;" OwnerUserId="5278" LastActivityDate="2015-02-19T10:11:12.160" Title="Map a Key to an Evil Operator and to Other Things?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9390" PostTypeId="1" AcceptedAnswerId="9445" CreationDate="2015-02-19T07:06:16.367" Score="4" ViewCount="4643" Body="&lt;p&gt;&lt;em&gt;My problem is very similar to &lt;a href=&quot;https://unix.stackexchange.com/questions/15495/emacs-cant-open-display&quot;&gt;this one&lt;/a&gt; from Unix &amp;amp; Linux Exchange.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use systemd to start &lt;code&gt;emacs --daemon&lt;/code&gt; as my user account. Recently I have had the following problem when trying to open a new frame of my emacs process.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -c&#xA;Waiting for Emacs...&#xA;*ERROR*: Display :0 can't be opened&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the question linked above, the user had old emacs daemons still running, but I only have one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ps ux | grep  [e]macs&#xA;anthony    675  0.0  1.2 432560 103680 ?       Ssl  20:41   0:03 /usr/bin/emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I imagine my problem is related to &lt;code&gt;$XAUTHORITY&lt;/code&gt; as suggested in the second answer of the question linked above, but I have been unable to solve the issue on my own and was hoping someone here could help. Possibly relevant information to follow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo $XAUTHORITY&#xA;/var/run/gdm/auth-for-anthony-ATsjnA/database&#xA;&#xA;$ ls -l /var/run/gdm/auth-for-anthony-ATsjnA/database&#xA;-rw------- 1 anthony anthony 106 Feb 18 20:41 /var/run/gdm/auth-for-anthony-ATsjnA/database&#xA;&#xA;$ ps -C emacs wwe&#xA; PID TTY      STAT   TIME COMMAND&#xA; 675 ?        Ssl    0:02 /usr/bin/emacs --daemon DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus &#xA;DISPLAY=:0 HOME=/home/anthony LANG=en_US.UTF-8 LOGNAME=anthony MAIL=/var/spool/mail/anthony &#xA;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin SHELL=/bin/bash USER=anthony &#xA;XDG_RUNTIME_DIR=/run/user/1000 MANAGERPID=667&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I log in with gdm into gnome-shell, and the emacs process is started with &lt;code&gt;systemctl --user start emacs.service&lt;/code&gt;. Here's the contents of the &lt;code&gt;emacs.service&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Unit]&#xA;Description=Emacs: the extensible, self-documenting text editor&#xA;&#xA;[Service]&#xA;Type=forking&#xA;ExecStart=/usr/bin/emacs --daemon&#xA;ExecStop=/usr/bin/emacsclient --eval &quot;(kill-emacs)&quot;&#xA;Restart=always&#xA;&#xA;[Install]&#xA;WantedBy=default.target&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Edit&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;At politza's suggestion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ DISPLAY=:0.0 emacsclient -c&#xA;Waiting for Emacs...&#xA;*ERROR*: Display :0.0 can't be opened&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I connect to the server fine in gnome-terminal with &lt;code&gt;emacsclient -nw&lt;/code&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Second Edit&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;At Stefan's suggestion, I edited my &lt;code&gt;~/.xsessions&lt;/code&gt; to the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gdmauth=$XAUTHORITY&#xA;unset XAUTHORITY&#xA;export XAUTHORITY&#xA;xauth merge &quot;$gdmauth&quot;&#xA;&#xA;/bin/bash --login -i ~/.xinitrc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I still have the same issue. I'm not sure if it matters, but it seems the value of XAUTHORITY changes with every log-in. I don't know when that value is assigned so that the script above will work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Manually running &lt;code&gt;xauth merge /var/run/gdm/auth-for-anthony-&amp;lt;random&amp;gt;/database&lt;/code&gt; finishes silently, but I still run emacsclient.&lt;/p&gt;&#xA;" OwnerUserId="6540" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2015-02-20T18:42:59.143" Title="emacsclient can't open display :0" Tags="|emacsclient|x11|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9391" PostTypeId="1" AcceptedAnswerId="9393" CreationDate="2015-02-19T07:58:32.593" Score="3" ViewCount="390" Body="&lt;p&gt;I would like to have output from Emacsclient without quotes, but&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -s my-server -e '(princ &quot;hello&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;hello&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Expected output would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-02-19T08:09:30.517" LastActivityDate="2016-06-23T12:59:39.440" Title="Why is Emacsclient inserting quotes around output strings?" Tags="|emacsclient|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9392" PostTypeId="2" ParentId="9382" CreationDate="2015-02-19T07:58:42.887" Score="2" Body="&lt;p&gt;The question is about how to change the compiler that Make uses, and has nothing to do with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not have a Makefile, if your Makefile uses automatic rules, or if it sticks to the standard variable names, you can use &lt;code&gt;make CC=clang CFLAGS='-Wall -Werror -std=c99 -ggdb -O0' MYTARGET&lt;/code&gt; as compilation command, where &lt;code&gt;MYTARGET&lt;/code&gt; is the name of the target to build (or the program name, if you don't have a Makefile).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the Makefile uses custom rules, though, you need to take a look at the Makefile itself to find how if and how you can override the compiler.  There is no general setting to change compilers and commands used by Make.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-02-19T07:58:42.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9393" PostTypeId="2" ParentId="9391" CreationDate="2015-02-19T09:45:53.593" Score="3" Body="&lt;p&gt;The effect of the &lt;code&gt;princ&lt;/code&gt; function happens in the server Emacs, in this case, &lt;code&gt;hello&lt;/code&gt; is echoed in the echo area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacsclient&lt;/code&gt; in the other hand, prints the return value of the expression, which is the string &lt;code&gt;&quot;hello&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s my-server -e '(progn (princ &quot;hello&quot;) 1)'&#xA;1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, &lt;code&gt;hello&lt;/code&gt; is still being echoed in the server Emacs, however, &lt;code&gt;emacsclient&lt;/code&gt; prints &lt;code&gt;1&lt;/code&gt;, as this is the value of the expression.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-02-19T09:45:53.593" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9394" PostTypeId="2" ParentId="9389" CreationDate="2015-02-19T10:11:12.160" Score="2" Body="&lt;p&gt;As you've recognized correctly, &lt;code&gt;evil&lt;/code&gt; isn't designed to support arbitrary mappings.  The crux lies within the way Emacs keymaps work; to put it simply, if you press a key, it either resolves to a command or a prefix/keymap and waits for the next one.  You cannot have both.  &lt;code&gt;evil&lt;/code&gt; chose to go for the first option and reads in a key by itself to determine the operand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is possible though is replacing the command with a custom that dispatches to either executing your custom command or the regular &lt;code&gt;evil&lt;/code&gt; operator.  Possible ways of doing so are elaborated upon in &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.vim-emulation/2000&quot; rel=&quot;nofollow&quot;&gt;http://permalink.gmane.org/gmane.emacs.vim-emulation/2000&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-19T10:11:12.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9395" PostTypeId="2" ParentId="9370" CreationDate="2015-02-19T11:26:27.670" Score="5" Body="&lt;p&gt;&lt;kbd&gt;C-c C-s&lt;/kbd&gt; is bound to &lt;code&gt;ess-switch-process&lt;/code&gt;. You can also start a new process this way.&lt;/p&gt;&#xA;" OwnerUserId="5497" LastActivityDate="2015-02-19T11:26:27.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9396" PostTypeId="2" ParentId="9382" CreationDate="2015-02-19T11:26:39.163" Score="2" Body="&lt;p&gt;You can set a variable in &lt;code&gt;make&lt;/code&gt; from the command line, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make CC=clang&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you &lt;kbd&gt;M-x compile&lt;/kbd&gt; you will notice it presents you with the shell command it is going to run &lt;code&gt;make -k&lt;/code&gt; -- you can edit this, and if you do it will be presented to you next time you run &lt;code&gt;compile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you only need to edit this once per session, which sounds ideal for small student projects.&lt;/p&gt;&#xA;" OwnerUserId="6544" LastActivityDate="2015-02-19T11:26:39.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9398" PostTypeId="1" AcceptedAnswerId="9399" CreationDate="2015-02-19T13:48:44.930" Score="3" ViewCount="862" Body="&lt;p&gt;Currently I have a short cut to call the function 'helm-ag' (Using evil-leader)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (evil-leader/set-leader &quot;.&quot;)&#xA; (evil-leader/set-key &quot;g&quot; 'helm-ag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When 'helm-ag' is called with the Universal-argument (Ctrl - U) it allows me to choose in which directory I'd like to run the command. I use this all the time so I'd like to create a permanent short to specifically run the 'helm-ag' with the universal argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-leader/set-key &quot;g&quot; '(lambda () (interactive)(universal-argument)(helm-ag))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work. Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6546" LastActivityDate="2022-09-07T22:21:06.840" Title="Create a keybinding to call a function using the universal-argument" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9399" PostTypeId="2" ParentId="9398" CreationDate="2015-02-19T13:50:41.720" Score="2" Body="&lt;p&gt;You need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-leader/set-key&#xA; &quot;g&quot;&#xA; (lambda ()&#xA;   (interactive)&#xA;   (setq current-prefix-arg '(4))&#xA;   (helm-ag)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-02-19T14:01:55.207" LastActivityDate="2015-02-19T14:01:55.207" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9400" PostTypeId="2" ParentId="9390" CreationDate="2015-02-19T14:28:10.343" Score="4" Body="&lt;p&gt;Before running &lt;code&gt;emacsclient&lt;/code&gt; you need to run &lt;code&gt;xauth merge /var/run/gdm/auth-for-anthony-ATsjnA/database&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is due to gdm3's braindead use of XAUTHORITY.  One way to work around that is to use something like a &lt;code&gt;~/.xsession&lt;/code&gt; file where you do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gdmauth=$XAUTHORITY&#xA;unset XAUTHORITY&#xA;export XAUTHORITY&#xA;xauth merge &quot;$gdmauth&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-02-19T14:28:10.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9401" PostTypeId="1" AcceptedAnswerId="9403" CreationDate="2015-02-19T14:30:19.673" Score="1" ViewCount="402" Body="&lt;p&gt;I want to use Ctrl-space at the start of a function, and at the end of a function to select the area of the function and then change the name of a variable &lt;code&gt;var1&lt;/code&gt; to &lt;code&gt;var2&lt;/code&gt;. How to do this?&lt;/p&gt;&#xA;" OwnerUserId="2340" LastActivityDate="2015-02-19T14:54:23.240" Title="How to change the name of a variable in a function within a selection?" Tags="|replace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9402" PostTypeId="2" ParentId="9401" CreationDate="2015-02-19T14:47:08.070" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;C-M-SPC&lt;/code&gt; at the start of a function to mark the entire thing. &lt;code&gt;C-M-a&lt;/code&gt; moves to the beginning of a function quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, &lt;code&gt;M-%&lt;/code&gt; to run &lt;code&gt;query-replace&lt;/code&gt; on the region. Type &lt;code&gt;var1 RET var2 RET&lt;/code&gt; then &lt;code&gt;y&lt;/code&gt;/&lt;code&gt;n&lt;/code&gt; to choose whether to replace each occurrence or &lt;code&gt;!&lt;/code&gt; to replace them all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also want to use &lt;code&gt;C-h r&lt;/code&gt; to read the Emacs manual.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-19T14:47:08.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9403" PostTypeId="2" ParentId="9401" CreationDate="2015-02-19T14:54:23.240" Score="1" Body="&lt;p&gt;After you have marked the region, you can run &lt;code&gt;M-%&lt;/code&gt; which is &lt;code&gt;query-replace&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your mode line (the status bar at the bottom) it will ask you to type in the name of the variable you want to change. Afterwards press enter and it will ask you what you want to change it to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point it has highlighted the instances of your original variable and the cursor will be at the first one. You can press &lt;code&gt;space&lt;/code&gt; and it will replace that instance, or press &lt;code&gt;del&lt;/code&gt; to skip to the next one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to replace them all without checking individually you can press &lt;code&gt;!&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do something more complex, you can use &lt;code&gt;C-M-%&lt;/code&gt; which will let you use &lt;code&gt;query-replace&lt;/code&gt; with regular expressions.&lt;/p&gt;&#xA;" OwnerUserId="915" LastActivityDate="2015-02-19T14:54:23.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9404" PostTypeId="5" CreationDate="2015-02-19T15:18:46.177" Score="0" Body="&lt;p&gt;Emacs already has out-of-the-box Python support via &lt;code&gt;python-mode&lt;/code&gt; and there are a number of Python major modes for Emacs. Emacs provides basic editing and IDE-like features by using a combination of native Emacs features and external Emacs/Python packages: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;python.el&lt;/code&gt; comes with Emacs versions 24.2 and later&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;python-mode.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;loveshack python.el&lt;/code&gt; for Emacs versions 24.1 and before&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When tagging questions with &lt;a href=&quot;/questions/tagged/python&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;python&amp;#39;&quot; rel=&quot;tag&quot;&gt;python&lt;/a&gt;, mention Emacs and Python package versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For IDE-related &lt;a href=&quot;/questions/tagged/python&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;python&amp;#39;&quot; rel=&quot;tag&quot;&gt;python&lt;/a&gt; questions, mention which of these packages as well:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Elpy&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;anaconda-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Spacemacs&lt;/code&gt; Python layer, which is based on &lt;code&gt;anaconda-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;python-mode.el&lt;/code&gt;, which replaced &lt;code&gt;python-mode&lt;/code&gt; in &lt;code&gt;python.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Questions about Python interactive shells and REPLs should tag them with &lt;a href=&quot;/questions/tagged/ipython&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ipython&amp;#39;&quot; rel=&quot;tag&quot;&gt;ipython&lt;/a&gt; as well. &lt;/p&gt;&#xA;" OwnerUserId="5388" LastEditorUserId="7045" LastEditDate="2017-02-15T15:30:21.470" LastActivityDate="2017-02-15T15:30:21.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9405" PostTypeId="4" CreationDate="2015-02-19T15:18:46.177" Score="0" Body="use for Python programming language in Emacs. Emacs supports several versions of the language implementation, versions, and coding styles. Python questions should augment with additional tags as appropriate as described in the description below." OwnerUserId="5388" LastEditorUserId="7045" LastEditDate="2017-02-15T15:29:28.697" LastActivityDate="2017-02-15T15:29:28.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9406" PostTypeId="1" AcceptedAnswerId="9425" CreationDate="2015-02-19T17:06:03.653" Score="2" ViewCount="285" Body="&lt;p&gt;I'm setting up something similar to org-depend, but more plain-text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a sub item with an id:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO my sub task&#xA;  :PROPERTIES:&#xA;  :ID:       b988fcc3-5f73-4f4c-8b90-38c63d3ee72c&#xA;  :END:&#xA;  task notes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And another task that points to it via a link with id:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO master task&#xA; - [ ] bake cake &#xA; - [ ] [[id:b988fcc3-5f73-4f4c-8b90-38c63d3ee72c][my sub task]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now for the  sub task, in the title like I want to insert an elisp link that jumps to what ever links to it. Like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO my sub task [[elisp:(org-occur-link-in-agenda-files)][parent]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I run &lt;code&gt;org-occur-link-in-agenda-files&lt;/code&gt; in &lt;kbd&gt;M - x &lt;/kbd&gt;, I get a list of links. But the above command inside an elisp link in the title doesn't do anything, it just prints 't' in the output line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to implement this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;&lt;br&gt;&#xA;This works only if the parent is below the child and only in the same file. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[elisp:(search-forward-regexp (concat &quot;id:&quot; (org-id-get-create)))]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now it would be good to be able to go to the first matching regex item somehow?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-02-19T17:19:44.210" LastActivityDate="2015-07-20T01:27:33.623" Title="Go to item that links to id of current item?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9407" PostTypeId="1" AcceptedAnswerId="9448" CreationDate="2015-02-19T17:12:45.833" Score="4" ViewCount="266" Body="&lt;p&gt;Given a simple org-mode outline (i.e. consisting only of heading lines) in its &lt;code&gt;OVERVIEW&lt;/code&gt; global state (IOW, only the top-level nodes are visible), I want to make &lt;em&gt;simultaneously&lt;/em&gt; visible all the nodes that mention a given substring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the point of view of this aim, Emacs' standard &lt;code&gt;isearch-forward&lt;/code&gt; (&lt;code&gt;C-s&lt;/code&gt;) command has two shortcomings:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;in a given search, only the &quot;current&quot; match is visible; I can reveal subsequent matches by repeatedly hitting &lt;code&gt;C-s&lt;/code&gt;, but only one&lt;sup&gt;1&lt;/sup&gt; matching node is visible at a time.&lt;/li&gt;&#xA;&lt;li&gt;revealing all matches requires hitting &lt;code&gt;C-s&lt;/code&gt; for each match, which is tedious or impractical when the number of matches is large.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Therefore, I'm looking for a way to reveal &lt;em&gt;all&lt;/em&gt; the matching nodes &lt;em&gt;at once&lt;/em&gt;, and to do so in a way that minimizes the number of &quot;open&quot; nodes.  (IOW, any node that does not contain additional matching nodes among its &lt;em&gt;strict&lt;/em&gt; descendants should remain closed.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider this artificial example in which the &quot;leaf-level&quot; headings are all 27 length-3 combinations of the characters &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, and &lt;code&gt;c&lt;/code&gt;, and the headings of intermediate nodes represent prefixes of their descendant headings.  (Thus, the leaf node with heading &lt;code&gt;abc&lt;/code&gt; is a child of the node with heading &lt;code&gt;ab&lt;/code&gt;, which in turn is a child of the node with heading &lt;code&gt;a&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the initial (i.e. &lt;code&gt;OVERVIEW&lt;/code&gt;) state, this outline would look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a...&#xA;* b...&#xA;* c...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if I perform the desired operation (as described above) on this outline, using the substring &lt;code&gt;ab&lt;/code&gt; as my search term, the outline should look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA; * aa&#xA;  * aaa&#xA;  * aab&#xA;  * aac&#xA; * ab&#xA;  * aba&#xA;  * abb&#xA;  * abc&#xA; * ac...&#xA;* b&#xA; * ba&#xA;  * baa&#xA;  * bab&#xA;  * bac&#xA; * bb...&#xA; * bc...&#xA;* c&#xA; * ca&#xA;  * caa&#xA;  * cab&#xA;  * cac&#xA; * cb...&#xA; * cc...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the only &quot;open&quot; nodes are those that must be open in order to reveal nodes containing the substring &lt;code&gt;ab&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: Following up a suggestion in the comments, below is the result of running &lt;code&gt;C-c / / ab&lt;/code&gt; on the example's outline:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA; * aa...&#xA;  * aab...&#xA; * ab&#xA;  * aba&#xA;  * abb&#xA;  * abc...&#xA;* b&#xA; * ba...&#xA;  * bab...&#xA;* c&#xA; * ca...&#xA;  * cab...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not really match the description of the desired result, as given in the example, but it is not a bad alternative.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;1&lt;/sup&gt; Well, not precisely: in addition to the current matching node, any other matching node that happens to be an ancestor of the current one will be visible as well, but only as a &quot;byproduct&quot; of the current matching node's visibility.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2015-02-20T17:02:10.820" LastActivityDate="2015-02-20T19:18:08.370" Title="How to reveal all nodes containing a given substring?" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9408" PostTypeId="1" AcceptedAnswerId="9409" CreationDate="2015-02-19T17:29:41.063" Score="4" ViewCount="356" Body="&lt;p&gt;I would like to run a command and go to the first matching regex pattern that matches in any open buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind of like search-forward-regex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The requirements are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;not be limited to forward/backward. It should go to any direction.  &lt;/li&gt;&#xA;&lt;li&gt;be global and search through all buffers.  &lt;/li&gt;&#xA;&lt;li&gt;it should not be a list of matching options like (helm-swoop-all), but it should actually jump to what ever matches first   &lt;/li&gt;&#xA;&lt;li&gt;it should be a regex search, not a word search  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT] SOLVED&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a few tweaks of the answer below, it now works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for this was actually part of &lt;a href=&quot;https://emacs.stackexchange.com/questions/9406/go-to-item-that-links-to-id-of-current-item&quot;&gt;go-to-item-that-links-to-id-of-current-item&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the below, I can add an elisp link like &lt;code&gt;[[elisp:(my/goto-parent)][parent]]&lt;/code&gt; to the heading of a task (via abbrevations), and then I can navigate to the parent if something links to it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;(defcustom search-all-buffers-ignored-files (list (rx-to-string '(and bos (or &quot;.bash_history&quot; &quot;TAGS&quot;) eos)))&#xA;  &quot;Files to ignore when searching buffers via \\[search-all-buffers].&quot;&#xA;  :type 'editable-list)&#xA;&#xA;(require 'grep)&#xA;(defun search-all-buffers (regexp prefix)&#xA;  &quot;Searches file-visiting buffers for occurence of REGEXP.  With&#xA;prefix &amp;gt; 1 (i.e., if you type C-u \\[search-all-buffers]),&#xA;searches all buffers.&quot;&#xA;  (interactive (list (grep-read-regexp)&#xA;                     current-prefix-arg))&#xA;  (message &quot;Regexp is %s; prefix is %s&quot; regexp prefix)&#xA;  (multi-occur&#xA;   (if (member prefix '(4 (4)))&#xA;       (buffer-list)&#xA;     (remove-if&#xA;      (lambda (b) (some (lambda (rx) (string-match rx  (file-name-nondirectory (buffer-file-name b)))) search-all-buffers-ignored-files))&#xA;      (remove-if-not 'buffer-file-name (buffer-list))))&#xA;&#xA;   regexp))&#xA;&#xA;(defun my/search-all-buffers-first-result (regexp prefix)&#xA;  &quot;Searches file-visiting buffers for occurence of REGEXP.  With&#xA;prefix &amp;gt; 1 (i.e., if you type C-u \\[search-all-buffers]),&#xA;searches all buffers.&quot;&#xA;&#xA;  ;Cache how many windows are open atm.&#xA;  (setq my-var/multi-window (one-window-p)) ;true if single frame.&#xA;  (interactive (list (grep-read-regexp)&#xA;                     current-prefix-arg))&#xA;  (search-all-buffers regexp prefix)&#xA;  (next-error)&#xA;  (kill-buffer &quot;*Occur*&quot;)&#xA;&#xA;  ;if there were more than one window open, kill the other once.&#xA;  (when my-var/multi-window (delete-other-windows))&#xA;) &#xA;&#xA;(defun my/goto-parent () &#xA;  &quot;Find the parent of this task by looking for what links to this task&quot;&#xA;  (interactive)&#xA;  (my/search-all-buffers-first-result (concat &quot;id:&quot; (org-id-get)) nil)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-02-19T21:51:09.793" Title="Global goto regex?" Tags="|search|regular-expressions|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9409" PostTypeId="2" ParentId="9408" CreationDate="2015-02-19T18:14:57.793" Score="2" Body="&lt;p&gt;The &lt;code&gt;search-all-buffers&lt;/code&gt; function defined in &lt;a href=&quot;https://stackoverflow.com/a/2642655/1219634&quot;&gt;this StackOverflow solution&lt;/a&gt; by &lt;a href=&quot;https://stackoverflow.com/users/20146/offby1&quot;&gt;&lt;strong&gt;@offby1&lt;/strong&gt;&lt;/a&gt; fits this bill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am pasting the same here for convenience.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; I know that string is in my Emacs somewhere!&#xA;(require 'cl)&#xA;(defcustom search-all-buffers-ignored-files (list (rx-to-string '(and bos (or &quot;.bash_history&quot; &quot;TAGS&quot;) eos)))&#xA;  &quot;Files to ignore when searching buffers via \\[search-all-buffers].&quot;&#xA;  :type 'editable-list)&#xA;&#xA;(require 'grep)&#xA;(defun search-all-buffers (regexp prefix)&#xA;  &quot;Searches file-visiting buffers for occurence of REGEXP.  With&#xA;prefix &amp;gt; 1 (i.e., if you type C-u \\[search-all-buffers]),&#xA;searches all buffers.&quot;&#xA;  (interactive (list (grep-read-regexp)&#xA;                     current-prefix-arg))&#xA;  (message &quot;Regexp is %s; prefix is %s&quot; regexp prefix)&#xA;  (multi-occur&#xA;   (if (member prefix '(4 (4)))&#xA;       (buffer-list)&#xA;     (remove-if&#xA;      (lambda (b) (some (lambda (rx) (string-match rx  (file-name-nondirectory (buffer-file-name b)))) search-all-buffers-ignored-files))&#xA;      (remove-if-not 'buffer-file-name (buffer-list))))&#xA;&#xA;   regexp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is how to use it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Copy that &lt;code&gt;search-all-buffers&lt;/code&gt; solution to your &lt;code&gt;init.el&lt;/code&gt; and evaluate.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x search-all-buffers&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;M-g M-n&lt;/code&gt; (&lt;code&gt;next-error&lt;/code&gt;) to go to the first search result.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a wrapper function to always take you to the first result.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When creating a wrapper function &lt;code&gt;wrapper-fn&lt;/code&gt; around a function &lt;code&gt;fn&lt;/code&gt;, you need to insure that the &lt;code&gt;fn&lt;/code&gt; function somehow gets all its needed arguments from &lt;code&gt;wrapper-fn&lt;/code&gt;. The easiest way is to copy the &lt;code&gt;interactive&lt;/code&gt; call from &lt;code&gt;fn&lt;/code&gt; to &lt;code&gt;wrapper-fn&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/search-all-buffers-first-result (regexp prefix)&#xA;  &quot;Searches file-visiting buffers for occurence of REGEXP.  With&#xA;prefix &amp;gt; 1 (i.e., if you type C-u \\[search-all-buffers]),&#xA;searches all buffers.&quot;&#xA;  (interactive (list (grep-read-regexp)&#xA;                     current-prefix-arg))&#xA;  (search-all-buffers regexp prefix)&#xA;  (next-error)&#xA;  (kill-buffer &quot;*Occur*&quot;)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-19T21:03:00.810" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9410" PostTypeId="1" CreationDate="2015-02-19T18:21:26.473" Score="2" ViewCount="161" Body="&lt;p&gt;I have a bunch of add-to-list calls that I'd like to shorten in my &lt;code&gt;.emacs&lt;/code&gt; file. They all look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-to-list 'align-rules-list&#xA;              '(haskell-comment&#xA;                (regexp . &quot;\\(\\s-+\\)--\\s-+&quot;)&#xA;                (mode   . '(haskell-mode))&#xA;                (repeat . nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know lisp but I tried to define a local function that I can call repeatedly. I'm not getting very far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((f (lambda (name re)&#xA;          (add-to-list&#xA;           'align-rules-list&#xA;           (list name&#xA;                 ('regexp . re)&#xA;                 '(mode . (haskell-mode))&#xA;                 '(repeat . nil))))))&#xA; (funcall f 'haskell-comment &quot;\\(\\s-+\\)--\\s-+&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone point out my problem with the code above?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;After much googling, I've arrived at something that seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((f (lambda (name re)&#xA;          (add-to-list&#xA;           'align-rules-list&#xA;           (list name&#xA;                 (cons 'regexp re)&#xA;                 '(mode . '(haskell-mode))&#xA;                 '(repeat . nil))))))&#xA; (funcall f 'haskell-comment &quot;\\(\\s-+\\)--\\s-+&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it seems messy. Quotes everywhere, &lt;code&gt;cons&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;. Is there a cleaner way?&lt;/p&gt;&#xA;" OwnerUserId="6549" LastEditorUserId="6549" LastEditDate="2015-02-19T18:42:35.913" LastActivityDate="2015-05-09T20:23:47.190" Title="How to convert this add-to-list call into a function" Tags="|elisp|functions|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9411" PostTypeId="2" ParentId="7362" CreationDate="2015-02-19T18:22:19.197" Score="19" Body="&lt;pre&gt;&lt;code&gt;(setq-default ediff-forward-word-function 'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3858" LastActivityDate="2015-02-19T18:22:19.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9412" PostTypeId="1" AcceptedAnswerId="9620" CreationDate="2015-02-19T18:27:19.223" Score="0" ViewCount="161" Body="&lt;p&gt;I am searching for the best strategy to define custom behaviour for &lt;code&gt;file:&lt;/code&gt; org-links locally to a buffer. Is there a way to modify or redefine this type of org-link ?&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2015-02-26T21:36:40.350" Title="Is there a way to modify or redefine a type of org-link locally?" Tags="|org-mode|customize|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9413" PostTypeId="1" AcceptedAnswerId="21802" CreationDate="2015-02-19T18:32:54.257" Score="4" ViewCount="255" Body="&lt;p&gt;If I have an &lt;code&gt;[[Org Mode Link]]&lt;/code&gt; and then make that line a &lt;code&gt;# Comment [[Org Mode Link]]&lt;/code&gt; the fontification changes and I can no longer tell that it is a link. Can this behavior be changed?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-04-23T20:05:49.187" Title="See Org Mode links in Org Mode comments" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9414" PostTypeId="1" AcceptedAnswerId="9419" CreationDate="2015-02-19T18:42:04.967" Score="2" ViewCount="708" Body="&lt;p&gt;I have a very bad formatted code like below.&#xA;Is there a way to make this code more legible?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook           '(lambda ()&#xA;             (setq ispell-tex-skip-alists&#xA;(list                     (append&#xA;                     (car ispell-tex-skip-alists) ;tell ispell to ignore content of this:&#xA;                     '((&quot;[^\\]\\$&quot; . &quot;[^\\]\\$&quot;)))                    (cadr ispell-tex-skip-alists))) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-02-25T10:44:56.010" Title="How to make a code more legible" Tags="|indentation|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9415" PostTypeId="2" ParentId="9414" CreationDate="2015-02-19T18:43:53.273" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt; can do this with &lt;code&gt;lispy-tab&lt;/code&gt; command bound to &lt;kbd&gt;i&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result (I added on extra return):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA;          '(lambda ()&#xA;            (setq ispell-tex-skip-alists&#xA;             (list (append&#xA;                    (car ispell-tex-skip-alists) ;tell ispell to ignore content of this:&#xA;                    '((&quot;[^\\]\\$&quot; . &quot;[^\\]\\$&quot;))) (cadr ispell-tex-skip-alists)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-19T18:43:53.273" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9416" PostTypeId="2" ParentId="9410" CreationDate="2015-02-19T18:46:55.797" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Macros.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;defmacro&lt;/code&gt;&lt;/a&gt; is perfect for such use cases.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my/add-to-align-rules-list-haskell (name re)&#xA;  `(add-to-list 'align-rules-list&#xA;                '(,name&#xA;                  (regexp . ,re)&#xA;                  (mode   . '(haskell-mode))&#xA;                  (repeat . nil))))&#xA;(my/add-to-align-rules-list-haskell haskell-comment &quot;\\(\\s-+\\)--\\s-+&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-19T18:46:55.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9417" PostTypeId="2" ParentId="9414" CreationDate="2015-02-19T19:01:47.093" Score="2" Body="&lt;p&gt;It looks like a problem of extra white space and bad indentation.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select the region&lt;/li&gt;&#xA;&lt;li&gt;Fix white space (replace multiple spaces with single space): &lt;code&gt;C-M-% \s-+ RET SPACE RET !&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Fix indentation (&lt;code&gt;indent-region&lt;/code&gt;): &lt;code&gt;C-M-\&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can even checkout the &lt;a href=&quot;https://github.com/Bruce-Connor/aggressive-indent-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;aggressive-indent-mode&lt;/code&gt;&lt;/a&gt; package (also available on Melpa) and &lt;a href=&quot;https://github.com/Bruce-Connor/aggressive-indent-mode#instructions&quot; rel=&quot;nofollow&quot;&gt;activate it only for the &lt;code&gt;emacs-lisp-mode&lt;/code&gt;&lt;/a&gt;. That will automatically resolve Step 3 above.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-19T19:01:47.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9418" PostTypeId="2" ParentId="9410" CreationDate="2015-02-19T19:37:58.000" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;But it seems messy. Quotes everywhere, cons, list. Is there a cleaner way?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This should be what you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(,name &#xA;  (regexp . ,re)&#xA;  (mode . (haskell-mode)) &#xA;  (repeat . nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is usually called the backquote, quasi-quote, or backtick.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, instead of let-binding &lt;code&gt;f&lt;/code&gt; as a variable, you can use &lt;code&gt;cl-flet&lt;/code&gt; which will let you use &lt;code&gt;f&lt;/code&gt; as an actual function name. (Or you can just define a global function/macro, it's just a config file after all.) ;-)&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-02-19T19:43:01.993" LastActivityDate="2015-02-19T19:43:01.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9419" PostTypeId="2" ParentId="9414" CreationDate="2015-02-19T20:07:48.020" Score="5" Body="&lt;p&gt;&lt;code&gt;indent-pp-sexp&lt;/code&gt; with a prefix argument (&lt;code&gt;C-u C-M-q&lt;/code&gt;) will format the code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA;      '(lambda&#xA;         ()&#xA;         (setq ispell-tex-skip-alists&#xA;               (list&#xA;                (append&#xA;                 (car ispell-tex-skip-alists)&#xA;                                    ;tell ispell to ignore content of this:&#xA;                 '((&quot;[^\\]\\$&quot; . &quot;[^\\]\\$&quot;)))&#xA;                (cadr ispell-tex-skip-alists)))&#xA;         ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorDisplayName="user2005" LastEditDate="2015-02-25T10:44:56.010" LastActivityDate="2015-02-25T10:44:56.010" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9420" PostTypeId="2" ParentId="9408" CreationDate="2015-02-19T20:15:29.323" Score="2" Body="&lt;p&gt;Take a look at &lt;code&gt;misearch.el&lt;/code&gt; (yes, the &lt;code&gt;m&lt;/code&gt; stands for multi).  Basic example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-all-buffer-regexp ()&#xA;  (interactive)&#xA;  (multi-isearch-buffers-regexp (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-02-19T20:15:29.323" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9421" PostTypeId="2" ParentId="62" CreationDate="2015-02-19T20:16:27.130" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/11043004/emacs-compile-buffer-auto-close&quot;&gt;This thread&lt;/a&gt; talks about how to autohide the compilation buffer when compilation succeeds and keep showing the buffer when there are errors or warnings. The use case may be relevant to many users.&lt;/p&gt;&#xA;&lt;p&gt;The credit goes to the original author, &lt;a href=&quot;https://stackoverflow.com/users/245173/jpkotta&quot;&gt;jpkotta&lt;/a&gt;. Here is his answer:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I use the following for compilation. It keeps the compilation buffer if there are warnings or errors, and buries it otherwise (after 1 second).&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun bury-compile-buffer-if-successful (buffer string)&#xA;  &amp;quot;Bury a compilation buffer if succeeded without warnings &amp;quot;&#xA;  (if (and&#xA;       (string-match &amp;quot;compilation&amp;quot; (buffer-name buffer))&#xA;       (string-match &amp;quot;finished&amp;quot; string)&#xA;       (not&#xA;        (with-current-buffer buffer&#xA;          (search-forward &amp;quot;warning&amp;quot; nil t))))&#xA;      (run-with-timer 1 nil&#xA;                      (lambda (buf)&#xA;                        (bury-buffer buf)&#xA;                        (switch-to-prev-buffer (get-buffer-window buf) 'kill))&#xA;                      buffer)))&#xA;(add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2292" LastEditorUserId="2292" LastEditDate="2023-07-08T08:51:59.610" LastActivityDate="2023-07-08T08:51:59.610" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="9422" PostTypeId="2" ParentId="62" CreationDate="2015-02-19T20:21:38.977" Score="3" Body="&lt;p&gt;I have this snippet in my &lt;code&gt;.emacs.d&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defcustom compilation-auto-quit-window-delay 1&#xA;      &quot;Time in seconds before auto closing the window.&quot;&#xA;      :group 'compilation&#xA;      :type 'number)  &#xA;&#xA;    (defun compilation-auto-quit-window-finish-function (buffer status)&#xA;      &quot;Quit the *compilation* window if it went well.&quot;&#xA;      (let ((window (get-buffer-window buffer)))&#xA;        (when (and (equal status &quot;finished\n&quot;)&#xA;                   (compilation-went-super-p))&#xA;          (run-with-timer&#xA;              (or compilation-auto-quit-window-delay 0) nil&#xA;            (lambda nil&#xA;              (when (and (window-live-p window)&#xA;                         (eq (window-buffer window)&#xA;                             buffer)&#xA;                         (not (eq (selected-window)&#xA;                                  window)))&#xA;                (save-selected-window&#xA;                  (quit-window nil window))))))))&#xA;&#xA;    (define-minor-mode compilation-auto-quit-window&#xA;      &quot;Automatically close the *compilation* window if it went well.&quot;&#xA;      :global t&#xA;      (cond (compilation-auto-quit-window&#xA;             (add-hook 'compilation-finish-functions&#xA;                       'compilation-auto-quit-window-finish-function))&#xA;            (t&#xA;             (remove-hook 'compilation-finish-functions&#xA;                          'compilation-auto-quit-window-finish-function))))&#xA;&#xA;    (defun compilation-went-super-p (&amp;amp;optional buffer)&#xA;      &quot;Return t, if no gotoable output appeared.&quot;&#xA;      (with-current-buffer (or buffer (current-buffer))&#xA;        (save-excursion&#xA;          (goto-char (point-min))&#xA;          (let (;; (compilation-skip-threshold 1)&#xA;                )&#xA;            (not (ignore-errors&#xA;                   (compilation-next-error 1)&#xA;                   t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-02-19T20:21:38.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9423" PostTypeId="2" ParentId="9412" CreationDate="2015-02-19T20:28:21.880" Score="0" Body="&lt;p&gt;I think you need to tweak &lt;code&gt;org-open-at-point&lt;/code&gt; of &lt;code&gt;org.el&lt;/code&gt;. It contains the following lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((string= type &quot;file&quot;)&#xA; (if (string-match &quot;::\\([0-9]+\\)\\'&quot; path)&#xA;     (setq line (string-to-number (match-string 1 path))&#xA;           path (substring path 0 (match-beginning 0)))&#xA;   (if (string-match &quot;::\\(.+\\)\\'&quot; path)&#xA;       (setq search (match-string 1 path)&#xA;             path (substring path 0 (match-beginning 0)))))&#xA; (when (string-match &quot;[*?{]&quot; (file-name-nondirectory path))&#xA;   (dired path)&#xA;   (org-open-file path arg line search)&#xA;   )&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if you'd manage to enclose the behavior you want in a variable, then you can adjust its value for a given buffer (for example it can contain a regexp, a binary name, or just some elisp code), and you are done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What exactly you are trying to achieve?&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-02-19T20:28:21.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9424" PostTypeId="2" ParentId="8013" CreationDate="2015-02-19T21:03:40.030" Score="0" Body="&lt;p&gt;I ran into the same problem and this seems to be something to do with bash. Switching the configuration around to zsh has solved the problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran into the issue on an ubuntu install with bash 4.3. Compiling a local version of bash 4.1 didn't help either. On a RHEL install with bash 4.1.2 the shell/emacs interaction work well. &lt;/p&gt;&#xA;" OwnerUserId="6526" LastActivityDate="2015-02-19T21:03:40.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9425" PostTypeId="2" ParentId="9406" CreationDate="2015-02-19T21:54:08.993" Score="0" Body="&lt;p&gt;I managed to solve this in: &lt;a href=&quot;https://emacs.stackexchange.com/questions/9408/global-goto-regex&quot;&gt;global-goto-regex&lt;/a&gt;&lt;br&gt;&#xA;With the code available therein, I can add this to the child task: &lt;code&gt;[[elisp:(my/goto-parent)][parent]]&lt;/code&gt; and it jumps to what ever has linked to it.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-02-19T21:54:08.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9426" PostTypeId="1" CreationDate="2015-02-19T22:26:39.550" Score="3" ViewCount="1786" Body="&lt;p&gt;I am testing &lt;code&gt;quelpa&lt;/code&gt; with my &lt;code&gt;use-package&lt;/code&gt; configuration. My question is: Is &lt;code&gt;quelpa&lt;/code&gt; meant to complement &lt;code&gt;use-package&lt;/code&gt;, or rather to replace it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following code in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(package-initialize)&#xA;(setq&#xA; package-enable-at-startup nil&#xA; package-user-dir (concat user-emacs-directory &quot;elpa&quot;)&#xA; package-archives&#xA; '((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;   (&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;   (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)&#xA;   (&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;   )&#xA; package-archive-exclude-alist&#xA; '((&quot;melpa&quot; elnode)&#xA;   (&quot;melpa&quot; org-trello)&#xA;   (&quot;melpa&quot; org)&#xA;   (&quot;marmalade&quot; org)&#xA;   (&quot;gnu&quot; org)&#xA;   (&quot;org&quot; org))&#xA; )&#xA;&#xA;&#xA;(if (require 'quelpa nil t)&#xA;    (quelpa-self-upgrade)&#xA;  (with-temp-buffer&#xA;    (url-insert-file-contents &quot;https://raw.github.com/quelpa/quelpa/master/bootstrap.el&quot;)&#xA;    (eval-buffer)))&#xA;(setq quelpa-upgrade-p t)&#xA;&#xA;&#xA;(quelpa 'use-package)&#xA;(require 'use-package)&#xA;&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="516" LastActivityDate="2016-04-25T13:40:34.107" Title="Interaction between package, use-package, and quelpa" Tags="|package|use-package|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9427" PostTypeId="2" ParentId="9328" CreationDate="2015-02-20T00:51:24.907" Score="1" Body="&lt;p&gt;There is an old alist.el library from the Emacs vs XEmacs days - someone added it to their .emacs folder so you can browse it - &lt;a href=&quot;https://github.com/baron/emacs/blob/master/.emacs.d/el-get/apel/alist.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/baron/emacs/blob/master/.emacs.d/el-get/apel/alist.el&lt;/a&gt;. It would let you say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-alist 'default-frame-alist 'width 80)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not namespaced to 'alist-' though, and not orthogonal - eg it has (put-alist KEY VALUE ALIST) vs (set-alist SYMBOL KEY VALUE), so it could use a little updating.  &lt;/p&gt;&#xA;" OwnerUserId="2462" LastActivityDate="2015-02-20T00:51:24.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9428" PostTypeId="2" ParentId="7354" CreationDate="2015-02-20T02:05:14.483" Score="1" Body="&lt;p&gt;The following is an example using an overlay with an xpm image for graphical Emacs versions that support xpm image format.  It is 11 pixels wide; 20 pixels high; and has a user specified number of 4 possible colors.  I am on a Mac running Snow Leopard 10.6.8 and the font I prefer when using Emacs is &lt;code&gt;-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1&lt;/code&gt; -- the &lt;code&gt;frame-char-width&lt;/code&gt; is 11 and the &lt;code&gt;frame-char-height&lt;/code&gt; is 20.  I have added a thin vertical yellow line to the left of the capital letter &quot;A&quot; as an example of how to draw custom images.  Substitution of the character at point can be made programmatically using &lt;code&gt;(char-after (point))&lt;/code&gt; and taking that number -- which in this case is 65 for the capital letter &quot;A&quot; -- and substituting the appropriate variable -- e.g., &lt;code&gt;(cond ((eq (char-after (point)) 65) cap-ltr-a-xpm) . . .&lt;/code&gt; -- and using that variable in the the overlay placement -- e.g., &lt;code&gt;(overlay-put (make-overlay (point) (1+ (point))) 'display cap-ltr-a-xpm)&lt;/code&gt;.  This works very nicely for both truncated buffers and also with word-wrap because the &lt;code&gt;display&lt;/code&gt; overlay property on a character in the middle of a word does not cause word-wrap to think that the first part of the word belongs at the end of the previous line.  Of course, it will take time to create a custom library of favorite xpm images.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ImageMagick is capable of producing a semi-accurate xpm of a particular character based on a specific font family and size, but it was not as precise as I had hoped -- here is a link to instructions for using that external utility:  &lt;a href=&quot;https://stackoverflow.com/a/14168154/2112489&quot;&gt;https://stackoverflow.com/a/14168154/2112489&lt;/a&gt;  In a nutshell, the user should be prepared to spend time customizing the xpm images to his / her liking.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xpm-example ()&#xA;(interactive)&#xA;&quot;Doc-string&quot;&#xA;  (let* (&#xA;      (cap-ltr-a-xpm `(image :type xpm :mask nil :ascent center :data&#xA;        &quot;/* XPM */&#xA;        static char * letters_xpm[] = {&#xA;        /* columns rows colors chars-per-pixel */&#xA;        /* columns = 1 pixel in width -- see also (frame-char-width) */&#xA;        /* rows = 1 pixel in height -- see also (frame-char-height) */&#xA;        \&quot;11 20 4 1\&quot;,&#xA;        \&quot;. c #000000\&quot;,&#xA;        \&quot;+ c #FF0000\&quot;,&#xA;        \&quot;@ c #7F0000\&quot;,&#xA;        \&quot;% c yellow\&quot;,&#xA;        \&quot;%..........\&quot;,&#xA;        \&quot;%....++....\&quot;,&#xA;        \&quot;%....++....\&quot;,&#xA;        \&quot;%..++..++..\&quot;,&#xA;        \&quot;%..++..++..\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++++++++++\&quot;,&#xA;        \&quot;%++++++++++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%++......++\&quot;,&#xA;        \&quot;%..........\&quot;};&quot;))  )&#xA;    (overlay-put (make-overlay (point) (1+ (point))) 'display cap-ltr-a-xpm)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-26T18:46:46.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9429" PostTypeId="2" ParentId="911" CreationDate="2015-02-20T06:05:06.407" Score="7" Body="&lt;p&gt;I've been wanting the same thing so I wrote one. You can get poetry.el here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bobnewell.net/filez/poetry.zip&quot; rel=&quot;noreferrer&quot;&gt;http://www.bobnewell.net/filez/poetry.zip&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's somewhat modelled after 'Verse Perfect' except, of course, it's for Emacs. It works with Linux. I don't have other systems to test on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does these things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Provides foot counts by line in the left margin.&lt;/li&gt;&#xA;&lt;li&gt;Interfaces with offline and online rhyming dictionaries.&lt;/li&gt;&#xA;&lt;li&gt;Provides rhyming templates (on the left) for various verse forms.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Feedback is welcome if you decide to try this out. My email address is in the code comments.&lt;/p&gt;&#xA;" OwnerUserId="6556" LastActivityDate="2015-02-20T06:05:06.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9430" PostTypeId="2" ParentId="9410" CreationDate="2015-02-20T07:25:04.260" Score="2" Body="&lt;p&gt;How are you given the set of rule names and corresponding regexps?&#xA;Assuming you have them in a list, just iterate over the list.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar rule+regexp-alist '((haskell-comment . &quot;\\(\\s-+\\)--\\s-+&quot;) (foo . &quot;re1&quot;) (bar . &quot;re2&quot;))&#xA;  &quot;(RULE . REGEXP) pairs, where RULE is a symbol and REGEXP is a string.&quot;)&#xA;&#xA;(dolist (rl+re  rule+regexp-alist) &#xA;  (add-to-list 'align-rules-list `(,(car rl+re)&#xA;                                   (regexp . ,(cdr rl+re))&#xA;                                   (mode 'haskell-mode)&#xA;                                   (repeat))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(But are you sure it is &lt;code&gt;'haskell-mode&lt;/code&gt; you want in the result, instead of just &lt;code&gt;haskell-mode&lt;/code&gt;?  IOW, you want &lt;code&gt;(mode 'haskell-mode)&lt;/code&gt; in the result, not just &lt;code&gt;(mode haskell-mode)&lt;/code&gt;?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Yes, I ignored your request to &quot;convert to a function&quot;, as I don't see the point of that, from your description.  Sounds like you just want to make several similar calls to &lt;code&gt;add-to-list&lt;/code&gt;.  If so, then just do that - factor out the &quot;similar&quot; parts and iterate over the list of dissimilar parts.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:23:47.190" LastActivityDate="2015-05-09T20:23:47.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9431" PostTypeId="2" ParentId="9426" CreationDate="2015-02-20T09:18:34.843" Score="0" Body="&lt;p&gt;&lt;code&gt;quelpa&lt;/code&gt; is just a tool to build and install packages, &lt;code&gt;use-package&lt;/code&gt; is another tool for configuring packages in a declarative manner.  They don't have anything to do with each other at all, therefore your question doesn't make much sense and can be answered with &quot;No&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: I have commit access to &lt;code&gt;quelpa&lt;/code&gt; and did contribute code to it.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-02-20T09:18:34.843" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9432" PostTypeId="2" ParentId="9367" CreationDate="2015-02-20T09:40:07.100" Score="0" Body="&lt;p&gt;I'd say you could have a look at org-mode... it is way cooler than text lists and is nowhere complicated either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry... I couldn't put it in comment since it wanted a higher reputation there.&lt;/p&gt;&#xA;" OwnerUserId="3849" LastActivityDate="2015-02-20T09:40:07.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9433" PostTypeId="1" AcceptedAnswerId="9451" CreationDate="2015-02-20T10:34:29.277" Score="10" ViewCount="1551" Body="&lt;p&gt;I have so many tasks I do far away from my computer with emacs. Now, when I change state of a TODO, it just logs the current time into the drawer. But the difference with actual time of the event may be many hours, if not days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make it prompt for a timestamp I'd like it to log?&lt;/p&gt;&#xA;" OwnerUserId="5422" LastEditorUserId="5422" LastEditDate="2015-02-20T10:42:16.407" LastActivityDate="2021-03-09T12:56:02.060" Title="How to make org prompt for a timestamp, when changing state of a TODO?" Tags="|org-mode|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9434" PostTypeId="1" AcceptedAnswerId="9438" CreationDate="2015-02-20T11:50:35.510" Score="5" ViewCount="762" Body="&lt;p&gt;I just decided that I should try the &lt;code&gt;outline-minor-mode&lt;/code&gt; for showing and hiding Emacs lisp &lt;code&gt;defun&lt;/code&gt; definitions in an Emacs Lisp file. So I typed &lt;code&gt;M-x outline-minor-mode&lt;/code&gt; and then I would like to get an overview over the available keyboard shortcuts, so I typed &lt;code&gt;C-h m&lt;/code&gt; and scrolled down until I found:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Outline minor mode (indicator Outl): Toggle Outline minor mode. With a&#xA;  prefix argument ARG, enable Outline minor mode if ARG is positive, and&#xA;  disable it otherwise.  If called from Lisp, enable the mode if ARG is&#xA;  omitted or nil.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See the command `outline-mode' for more information on this mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Ok, this seems nice, but still not what I was looking for.. so I clicked the link for &lt;code&gt;outline-mode&lt;/code&gt; and found this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-c C-t   make all text invisible (not headings).&lt;br&gt;&#xA;  C-c C-a   make everything in buffer visible.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, these keyboard sequences does not work. But after some googling, the Emacs Wiki page ( &lt;a href=&quot;http://www.emacswiki.org/emacs/OutlineMode&quot; rel=&quot;noreferrer&quot;&gt;http://www.emacswiki.org/emacs/OutlineMode&lt;/a&gt; ) came to my rescue and informs that the actual keybindings are &lt;code&gt;C-c @ C-t&lt;/code&gt; and &lt;code&gt;C-c @ C-a&lt;/code&gt; (and not &lt;code&gt;C-c C-t&lt;/code&gt; and &lt;code&gt;C-c C-a&lt;/code&gt;) ..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope there is an easier way to find this information from within Emacs. Any suggestions? &lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-20T22:22:20.677" Title="How to look up documentation for a minor mode?" Tags="|minor-mode|documentation|help|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9435" PostTypeId="2" ParentId="9407" CreationDate="2015-02-20T12:53:47.770" Score="4" Body="&lt;p&gt;&lt;strong&gt;Function below will:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Prompt user for regexp&lt;/li&gt;&#xA;&lt;li&gt;Collapse all headings&lt;/li&gt;&#xA;&lt;li&gt;Start searching for regexp from the beginning of the buffer&lt;/li&gt;&#xA;&lt;li&gt;Display context around found matches&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Differences from the original request:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Content is searched as well, not only headings&lt;/li&gt;&#xA;&lt;li&gt;Siblings are not displayed&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Function definition:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-show-search-term-context ()&#xA;  &quot;Show context for the search term&quot;&#xA;  (interactive)&#xA;  (let ((search-term (read-from-minibuffer &quot;Regexp search: &quot;)))&#xA;    (goto-char (point-min))&#xA;    (org-overview)&#xA;    (while (re-search-forward search-term nil t)&#xA;      (org-show-context))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mapping to &lt;code&gt;C-c s&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'org&#xA;  '(define-key org-mode-map (kbd &quot;C-c s&quot;) 'org-show-search-term-context))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I'm new to Emacs Lisp so if I something can be improved, let me know.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2775" LastEditorUserId="2775" LastEditDate="2015-02-20T15:49:50.853" LastActivityDate="2015-02-20T15:49:50.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9436" PostTypeId="1" AcceptedAnswerId="9439" CreationDate="2015-02-20T13:35:17.367" Score="2" ViewCount="161" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-8.0.html&quot; rel=&quot;nofollow&quot;&gt;On the orgmode site&lt;/a&gt; it says that if you upgrade from org-mode v.7.9.4f to v.8+:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You must search your configuration for the existence of varaibles starting with org-export- and change their names (e.g. &lt;code&gt;org-export-html-validation-link&lt;/code&gt; is now &lt;code&gt;org-html-validation-link&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question is, how do I do that? If I do a &lt;kbd&gt;C-h v&lt;/kbd&gt; and look for &lt;code&gt;org-export-&lt;/code&gt;, I do see a long list of variables with names that apparently need changing. What do I do next?&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-02-21T09:35:01.550" Title="How to configure org-mode properly after upgrading from 7.9.3" Tags="|org-mode|variables|upgrade|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9438" PostTypeId="2" ParentId="9434" CreationDate="2015-02-20T14:16:47.690" Score="9" Body="&lt;p&gt;You've seen the basics, really. Your main problem was that this documentation was &lt;em&gt;wrong&lt;/em&gt;, not that you weren't looking in the right place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The slightly more direct way to read that documentation for a mode is by calling &lt;code&gt;describe-function&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;outline-minor-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the bit you missed is that, should the mode in question be indexed in the manual, you can jump directly to that with &lt;code&gt;Info-goto-emacs-command-node&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt; &lt;code&gt;outline-minor-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Failing that, you can still open the manual with &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt; and check the index (&lt;kbd&gt;I&lt;/kbd&gt;) or just isearch (&lt;kbd&gt;C-s&lt;/kbd&gt;) for what you're interested in. n.b. After an isearch failure, just type &lt;kbd&gt;C-s&lt;/kbd&gt; again to continue the search in the subsequent nodes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt; And of course (as Meaningful Username pointed out in the comments) while most mode help displays the actual current keymap, if you're still unsure of any bindings then &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;b&lt;/kbd&gt; should sort you out.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-02-20T22:22:20.677" LastActivityDate="2015-02-20T22:22:20.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9439" PostTypeId="2" ParentId="9436" CreationDate="2015-02-20T14:28:39.000" Score="2" Body="&lt;p&gt;You can fix your emacs config by using the &lt;code&gt;wgrep&lt;/code&gt; mode (package available through Melpa). If you don't know where you might have used the old variables, this approach will help if you at least know which folder holds your emacs configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out the solutions to this emacs.SE question on &lt;a href=&quot;https://emacs.stackexchange.com/q/212/115&quot;&gt;Is there a way to use query-replace from grep/ack/ag output modes?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the summary of steps needed fix your emacs config with old &lt;code&gt;org-mode&lt;/code&gt; variables:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Figure out the folder containing all your emacs config&lt;/li&gt;&#xA;&lt;li&gt;Do recursive search of the old variables in that folder using a tool of your choice: &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;ag&lt;/code&gt;, etc; you can do that from within emacs as demonstrated in the above link.&lt;/li&gt;&#xA;&lt;li&gt;Replace the old variables in the result with the new variables and save the edits by making use of &lt;code&gt;wgrep&lt;/code&gt; (or &lt;code&gt;wgrep-ag&lt;/code&gt;, etc) as demonstrated in the above link.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-02-20T14:28:39.000" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9440" PostTypeId="1" AcceptedAnswerId="9599" CreationDate="2015-02-20T14:32:54.140" Score="3" ViewCount="151" Body="&lt;p&gt;While in Helm Help mode -- the help buffer that pops up when you hit &lt;code&gt;C-c ?&lt;/code&gt; in a helm buffer -- I am unable to do anything but scroll up and down. I can not select text (neither with mouse nor with keys), or &lt;code&gt;C-s&lt;/code&gt; search or anything!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a feature or a bug? Can I change this behavior, and have, say, a regular read-only buffer, where at the minimum text selection works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6562" LastActivityDate="2015-02-26T14:01:56.913" Title="helm help mode can not search or select" Tags="|helm|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9441" PostTypeId="1" AcceptedAnswerId="9442" CreationDate="2015-02-20T14:40:27.460" Score="6" ViewCount="2676" Body="&lt;p&gt;IDO had this disable the special mode and fall back to vanilla &lt;code&gt;find-files&lt;/code&gt;. It was useful to be able to use environment variables and their expansion in path names for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something similar for &lt;code&gt;helm-find-files&lt;/code&gt; (a key to hit during &lt;code&gt;helm-mode-find-file&lt;/code&gt; which falls back to &lt;code&gt;find-files&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, my &lt;code&gt;C-x C-f&lt;/code&gt; is not bound to &lt;code&gt;helm-find-files&lt;/code&gt;, yet I still get &lt;code&gt;helm-mode-find-file&lt;/code&gt; when I hit &lt;code&gt;C-x C-f&lt;/code&gt; (or when &lt;code&gt;M-x find-file&lt;/code&gt; for that matter). Also puzzled by this. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="6562" LastActivityDate="2015-02-20T19:12:33.897" Title="disable helm mode for find files" Tags="|helm|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9442" PostTypeId="2" ParentId="9441" CreationDate="2015-02-20T15:29:16.210" Score="5" Body="&lt;h1&gt;Disabling helm mode for find-file&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;Adding an action&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There doesn't appear to be a built-in way to switch from helm-filnd-files back to the default Emacs' &lt;code&gt;find-files&lt;/code&gt;. However, you can add an &lt;code&gt;action&lt;/code&gt; to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun old-ff (&amp;amp;optional no-op) (interactive)&#xA;       (call-interactively 'find-file))&#xA;(helm-add-action-to-source &quot;Fallback find-file&quot;&#xA;                       'old-ff&#xA;                       helm-source-find-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Binding a key to the action&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;With this code, you will get a new option in the &quot;Action Menu&quot; called &quot;Fallback find-file&quot;. However, getting there is a bit awkward - you need to invoke the &quot;Action Menu&quot; first (TAB by default), then scroll to the entry. To add a keybinding to access this directly from the mini-buffer, use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;C-q&quot;)&#xA;  (lambda () (interactive)&#xA;    (helm-quit-and-execute-action 'old-ff))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm a little confused by this system, and the documentation is not clear. From my experiments you must use a named function in &lt;code&gt;helm-add-function-to-source&lt;/code&gt; if you want to later call that function from &lt;code&gt;helm-quit-and-execute-action&lt;/code&gt;. However, &lt;code&gt;helm-add-function-to-source&lt;/code&gt; requires a function that takes one argument, and &lt;code&gt;helm-quit-and-execute&lt;/code&gt; will only call the function without passing an argument. I've worked around this incompatibility by defining &lt;code&gt;old-ff&lt;/code&gt; to take an optional argument that doesn't actually get used.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Config&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To get this code invoked at the appropriate time, I use &lt;code&gt;use-package&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package helm&#xA;  :ensure helm&#xA;  :config&#xA;  (progn&#xA;    (defun old-ff (&amp;amp;optional no-op) (interactive)&#xA;           (call-interactively 'find-file))&#xA;    (helm-add-action-to-source &quot;Fallback find-file&quot;&#xA;                           'old-ff&#xA;                           helm-source-find-files)&#xA;    (define-key helm-map (kbd &quot;C-q&quot;)&#xA;      (lambda () (interactive)&#xA;        (helm-quit-and-execute-action 'old-ff)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Getting rid of helm mode for &lt;code&gt;C-x C-f&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Regarding your second question, you probably have set &lt;code&gt;(helm-mode 1)&lt;/code&gt; in your init. This will over-ride the normal &lt;code&gt;C-x C-f&lt;/code&gt; keybinding to provide the helm interface instead.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2015-02-20T17:15:16.387" LastActivityDate="2015-02-20T17:15:16.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9443" PostTypeId="1" AcceptedAnswerId="9444" CreationDate="2015-02-20T18:13:30.360" Score="1" ViewCount="64" Body="&lt;p&gt;I define a footnote via : &lt;kbd&gt; C-c  C-x f &lt;/kbd&gt; as described in the &lt;a href=&quot;http://orgmode.org/manual/Footnotes.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;.&lt;br&gt;&#xA;Then I have something like:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Leo once said [fn:1]  (reference)&#xA;..&#xA;..&#xA;..&#xA;* Footnotes &#xA;  [fn:1] To make the world a better place, one should use Emacs. (definition)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now clicking on the definition &lt;code&gt;[fn:1] To make ..&lt;/code&gt; jumps back to the reference.&lt;br&gt;&#xA;But clicking on the reference doesn't jump me to the definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jumping from reference to the definition still works via &lt;kbd&gt;C-c  C-c&lt;/kbd&gt;, but id'd be nice to have Mouse-1 support. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this just me or is this the case for everyone out there? If so, is there a way to make it jump to definition when clicking the reference?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 24.4.1 btw. If it makes a difference, I use org-mouse also.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="675" LastEditDate="2016-07-12T22:24:42.973" LastActivityDate="2016-07-12T22:24:42.973" Title="Mouse 1 doesn't follow footnote in org-mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9444" PostTypeId="2" ParentId="9443" CreationDate="2015-02-20T18:30:22.600" Score="0" Body="&lt;p&gt;Never mind. It turns out org-mouse is the culprit. I've sent an email to the org mailing list about it.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-02-20T18:30:22.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9445" PostTypeId="2" ParentId="9390" CreationDate="2015-02-20T18:42:59.143" Score="1" Body="&lt;p&gt;Since I don't have enough reputation to comment, I'll just say that I have this problem too, after updating to systemd 219. Apparently the changelog mentions automatically putting $DISPLAY and $XAUTHORITY into the environment of the systemd user daemons automatically, which is what's causing this problem. So we can isolate this as a new problem introduced with systemd, rather than gdm.&#xA;From systemd 219 changelog:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;Blockquote&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;An X11 session scriptlet is now shipped that uploads&#xA;      $DISPLAY and $XAUTHORITY into the environment of the systemd&#xA;      --user daemon if a session begins. This should improve&#xA;      compatibility with X11 enabled applications run as systemd&#xA;      user services.&#xA;&lt;/Blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As a temporary workaround you can just disable the unit and run emacs --daemon manually.&lt;/p&gt;&#xA;" OwnerUserId="6564" LastActivityDate="2015-02-20T18:42:59.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9446" PostTypeId="2" ParentId="9441" CreationDate="2015-02-20T18:56:12.157" Score="6" Body="&lt;p&gt;There is a built-in way to disable &lt;code&gt;helm&lt;/code&gt; taking over a &lt;code&gt;completing-read&lt;/code&gt; handler:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'helm-completing-read-handlers-alist '(find-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Execute this after enabling &lt;code&gt;helm-mode&lt;/code&gt;.  Alternatively, wrap it with &lt;code&gt;eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'helm-mode&#xA;  '(add-to-list 'helm-completing-read-handlers-alist '(find-file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for the other question, there is nothing built-in to switch back to vanilla file finding.  The best you can do is deactivating automatic expansion by hitting &lt;code&gt;C-&amp;lt;Backspace&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-02-20T19:12:33.897" LastActivityDate="2015-02-20T19:12:33.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9447" PostTypeId="1" AcceptedAnswerId="9450" CreationDate="2015-02-20T19:14:24.267" Score="7" ViewCount="488" Body="&lt;p&gt;Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/questions/991/defining-the-window-pointed-by-other-window/1013#1013&quot;&gt;@itsjeyd&lt;/a&gt;, I've come to love &lt;code&gt;ace-window&lt;/code&gt;, but now I want more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;C-x 4 f&lt;/code&gt; and &lt;code&gt;C-x 4 b&lt;/code&gt; to invoke the commands &lt;code&gt;ido-find-file-other-window&lt;/code&gt; and &lt;code&gt;ido-switch-buffer-other-window&lt;/code&gt;, but I want to &lt;em&gt;pick&lt;/em&gt; the window to be used.  That is, I want to use &lt;code&gt;ido&lt;/code&gt; to pick the file or buffer name and (probably) something like &lt;code&gt;ace-window&lt;/code&gt; to select the window to be used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today, I have to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;ace-window&lt;/code&gt; to select the window I want to change.&lt;/li&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;ido-find-file&lt;/code&gt; or &lt;code&gt;ido-switch-to-buffer&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;ace-window&lt;/code&gt; to go back to the original window.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there a better way?  If not, I will likely try to write something to do what I want and put it on github.&lt;/p&gt;&#xA;" OwnerUserId="4085" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-02-26T17:42:02.683" Title="Pick a window for ido-find-file-other-window and ido-switch-buffer-other-window" Tags="|window|ido-find-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9448" PostTypeId="2" ParentId="9407" CreationDate="2015-02-20T19:18:08.370" Score="5" Body="&lt;p&gt;The command you're looking for might be&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/org-sparse-tree&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-sparse-tree&lt;/code&gt;&lt;/a&gt;, bound to &lt;code&gt;C-c /&lt;/code&gt;.&#xA;While it doesn't do &lt;em&gt;exactly&lt;/em&gt; what you asked, it gets pretty close and&#xA;is a lot more versatile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you hit &lt;code&gt;C-c /&lt;/code&gt; you'll be prompted with this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sparse tree: [/]regexp [t]odo [T]odo-kwd [m]atch [p]roperty&#xA;             [d]eadlines [b]efore-date [a]fter-date [D]ates range&#xA;             [c]ycle through date types: scheduled/deadline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To do a substring search, hit &lt;code&gt;/&lt;/code&gt; again and type the string. Unlike a&#xA;regular search, this will immediately create a sparse tree of the&#xA;matches, resulting in something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA; * aa...&#xA;  * aab...&#xA; * ab&#xA;  * aba&#xA;  * abb&#xA;  * abc...&#xA;* b&#xA; * ba...&#xA;  * bab...&#xA;* c&#xA; * ca...&#xA;  * cab...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, it &lt;em&gt;only&lt;/em&gt; shows matches and their parents. This is&#xA;different from you what you asked, because it doesn't completely&#xA;expand a tree when one of its childs matches (it only shows the&#xA;matching child). It may or may not be enough for you.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-02-20T19:18:08.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9449" PostTypeId="2" ParentId="8242" CreationDate="2015-02-20T19:41:13.757" Score="3" Body="&lt;p&gt;Sean's gist pointed me in the right direction, and here's the snippet that solved it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-adaptive-fill-function ()&#xA;  &quot;Return prefix for filling paragraph or nil if not determined.&quot;&#xA;  (cond&#xA;   ;; List item inside blockquote&#xA;   ((looking-at &quot;^[ \t]*&amp;gt;[ \t]*\\([0-9]+\\.\\|[*+-]\\)[ \t]+&quot;)&#xA;    (replace-regexp-in-string&#xA;     &quot;[0-9\\.*+-]&quot; &quot; &quot; (match-string-no-properties 0)))&#xA;   ;; Blockquote&#xA;   ((looking-at &quot;^[ \t]*&amp;gt;[ \t]*&quot;)&#xA;    (match-string-no-properties 0))&#xA;   ;; List items&#xA;   ((looking-at &quot;^\\([ \t]*\\)\\([0-9]+\\.\\|[\\*\\+-]\\)\\([ \t]+\\)&quot;)&#xA;    (match-string-no-properties 0))&#xA;   ;; No match&#xA;   (t nil)))&#xA;&#xA;;; Paragraph filling in text-mode.&#xA;(add-hook 'text-mode-hook&#xA;  (lambda ()&#xA;    (set (make-local-variable 'paragraph-start)&#xA;         &quot;\f\\|[ \t]*$\\|[ \t]*[*+-] \\|[ \t]*[0-9]+\\.[ \t]\\|[ \t]*: &quot;)&#xA;    (set (make-local-variable 'paragraph-separate)&#xA;         &quot;\\(?:[ \t\f]*\\|.*  \\)$&quot;)&#xA;    (set (make-local-variable 'adaptive-fill-first-line-regexp)&#xA;         &quot;\\`[ \t]*&amp;gt;[ \t]*?\\'&quot;)&#xA;    (set (make-local-variable 'adaptive-fill-function)&#xA;         'my-adaptive-fill-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-02-20T19:41:13.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9450" PostTypeId="2" ParentId="9447" CreationDate="2015-02-20T19:56:11.150" Score="5" Body="&lt;p&gt;How about this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ace-command-other-window (cmd &amp;amp;optional one-win-cmd)&#xA;  &quot;Execute CMD in another window.&#xA;If provided, call ONE-WIN-CMD instead when there is only one window.&quot;&#xA;  (interactive &quot;CM-x (other window) &quot;)&#xA;  (catch 'done&#xA;    (when (and one-win-cmd&#xA;               (not (window-parent)))&#xA;      (call-interactively one-win-cmd)&#xA;      (throw 'done t))&#xA;    (let ((start-window (selected-window)))&#xA;      (unwind-protect&#xA;           (progn&#xA;             (aw-switch-to-window&#xA;              (aw-select  &quot; Ace - Command &quot;))&#xA;             (call-interactively cmd))&#xA;        (aw-switch-to-window start-window)))))&#xA;&#xA;(defun ace-find-file ()&#xA;  &quot;Find a file in another window.&quot;&#xA;  (interactive)&#xA;  (ace-command-other-window #'ido-find-file&#xA;                            #'ido-find-file-other-window))&#xA;&#xA;(defun ace-switch-buffer ()&#xA;  &quot;Switch buffers in another window.&quot;&#xA;  (interactive)&#xA;  (ace-command-other-window #'ido-switch-buffer&#xA;                            #'ido-switch-buffer-other-window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you have only one window, these call the normal ido commands to split the window and switch to the specified file or buffer. If you have two windows, they will switch file/buffer in the other window but keep the current window active. With three or more windows, you'll be prompted to choose a target window using ace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggested bindings: &lt;code&gt;C-x 4 M-x&lt;/code&gt; for &lt;code&gt;ace-command-other-window&lt;/code&gt;, and then rebind &lt;code&gt;C-x 4 f&lt;/code&gt; and &lt;code&gt;C-x 4 b&lt;/code&gt; for the other two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My original approach was to use ace to switch to an arbitrary window and then call the desired command. This doesn't behave as you might expect. For example, if you call ace-find-file you end up starting in the default directory of the target window rather than the currently active one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an alternative implementation that flips things around to choose the target file/buffer first, then displays it in an ace-selected window.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ace-switch-buffer ()&#xA;  &quot;Switch to another buffer in another window.&quot;&#xA;  (interactive)&#xA;  (if (not (window-parent))&#xA;      (ido-switch-buffer-other-window)&#xA;      (let ((start-win (selected-window))&#xA;            (buf (ido-read-buffer &quot;Buffer: &quot;))&#xA;            (win (aw-select &quot; Ace Buffer: &quot;)))&#xA;        (unwind-protect&#xA;             (progn&#xA;               (aw-switch-to-window win)&#xA;               (switch-to-buffer buf))&#xA;          (aw-switch-to-window start-win)))))&#xA;&#xA;&#xA;&#xA;(defun ace-find-file ()&#xA;  &quot;Find a file and display it in another window.&quot;&#xA;  (interactive)&#xA;  (if (not (window-parent))&#xA;      (ido-find-file-other-window)&#xA;      (let ((start-win (selected-window))&#xA;            (buf (find-file-noselect (ido-read-file-name &quot;File: &quot;)))&#xA;            (win (aw-select &quot; Ace File: &quot;)))&#xA;        (unwind-protect&#xA;             (progn&#xA;               (aw-switch-to-window win)&#xA;               (switch-to-buffer buf))&#xA;          (aw-switch-to-window start-win)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-26T17:42:02.683" LastActivityDate="2015-02-26T17:42:02.683" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9451" PostTypeId="2" ParentId="9433" CreationDate="2015-02-20T21:53:05.967" Score="7" Body="&lt;p&gt;I've wanted the exact same &quot;I did this yesterday&quot; behavior for a while and never got around to trying to implement it. But now if I can get points for it ....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior seems to be hard-coded into &lt;code&gt;org-todo&lt;/code&gt;.  The line in &lt;code&gt;org.el&lt;/code&gt; that sets the CLOSED timestamp is &lt;code&gt;(org-add-planning-info 'closed (org-current-effective-time))&lt;/code&gt; and the LOGBOOK notes are added by &lt;code&gt;org-add-log-setup&lt;/code&gt;, which in turn calls &lt;code&gt;org-effective-current-time&lt;/code&gt;. &lt;code&gt;org-effective-current-time&lt;/code&gt; does what it sounds like and returns the effective time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious solution is to temporarily change &lt;code&gt;org-effective-current-time&lt;/code&gt; to something that prompts for a date.  But then we get prompted for the date multiple times with every call, which is annoying.  I don't know a good way to avoid it, but you can just save off the user inputed value and keep that around until the end of the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code seems to work and only prompts once when a state change would be logged.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-todo-with-date (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (cl-letf* ((org-read-date-prefer-future nil)&#xA;             (my-current-time (org-read-date t t nil &quot;when:&quot; nil nil nil))&#xA;            ((symbol-function #'org-current-effective-time)&#xA;             #'(lambda () my-current-time)))&#xA;    (org-todo arg)&#xA;    )) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-02-28T21:15:10.757" LastActivityDate="2015-02-28T21:15:10.757" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9452" PostTypeId="1" CreationDate="2015-02-20T22:15:14.653" Score="2" ViewCount="185" Body="&lt;p&gt;I like working in column view, as it shows me properties in columns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set clock-logging to go into the log drawer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I've discovered that I can't clock in tasks unless a log-drawer already exists. It just says 'e' buffer is read only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I go out of column view, clock in once, the log-drawer is created and then go back into column view, then clocking in works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this fix-able? If not, is there a way to always create a log-drawer whenever I mark a task as a 'TODO' task?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2016-08-13T22:16:34.463" Title="org-mode clock-in in column view doesn't work on first clock-in?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9453" PostTypeId="1" CreationDate="2015-02-20T22:45:54.390" Score="1" ViewCount="155" Body="&lt;p&gt;I'm not even sure I'm asking the right question, but here goes: I followed &lt;a href=&quot;https://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/&quot; rel=&quot;nofollow&quot;&gt;this guide&lt;/a&gt; which introduces a function to search an org-mode file for a reftex/bibtex key and jump to that position in the file. The function is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-mode-reftex-search ()&#xA;  ;;jump to the notes for the paper pointed to at from reftex search&#xA;  (interactive)&#xA;  (org-open-link-from-string (format &quot;[[notes:%s]]&quot; (first (reftex-citation t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use the function and search reftex for a file that is in the buffer, everything works beautifully. When I search for a file that is not in the buffer, however, I get asked &lt;code&gt;No match - create this as a new heading? (y or n)&lt;/code&gt;. If I say &lt;code&gt;y&lt;/code&gt;, a new top level entry is put into the buffer with the format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* #BibtexKey&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that I've taken the time to set up a better format for new entries in my org-mode notes file. What I would like is to use that format when the entry doesn't already exist. The format I'm using, again from that tutorial, is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** %t&#xA;  :PROPERTIES:&#xA;  :Custom_ID: %l&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where %t is the title of the paper and %l is the Bibtex key. How do I replace the default format of a reftex search?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-04-22T05:40:57.983" Title="Replace org-open-link-from-string failure format" Tags="|org-mode|auctex|reftex-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9454" PostTypeId="2" ParentId="9453" CreationDate="2015-02-21T01:08:27.960" Score="1" Body="&lt;p&gt;Inserting a new heading is actually done by &lt;code&gt;org-link-search&lt;/code&gt;.  The&#xA;relevant part of the function (currently) looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((and (not org-link-search-inhibit-query)&#xA;      (eq org-link-search-must-match-exact-headline 'query-to-create)&#xA;      (y-or-n-p &quot;No match - create this as a new heading? &quot;))&#xA;    (goto-char (point-max))&#xA;    (unless (bolp) (newline))&#xA;    (org-insert-heading nil t t)&#xA;    (insert s &quot;\n&quot;)&#xA;    (beginning-of-line 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So there is no easy way to hook into it and produce the format you&#xA;want.  You can set &lt;code&gt;org-link-search-must-match-exact-headline&lt;/code&gt; to t,&#xA;but then you'll have to make the heading manually, so that doesn't get&#xA;you to where you want.  One option is to catch the error after calling&#xA;&lt;code&gt;org-open-link-from-string&lt;/code&gt; (with&#xA;&lt;code&gt;org-link-search-must-match-exact-headline&lt;/code&gt; set to t).  Here's one&#xA;(maybe not-so-elegant) way to do that.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-mode-reftex-search ()&#xA;  (interactive)&#xA;  (let ((reftex-default-bibliography&#xA;         (mapcar #'expand-file-name reftex-default-bibliography))&#xA;        tree key)&#xA;    (setq tree&#xA;          (with-temp-buffer&#xA;            (let ((reftex-cite-format &quot;** %t\n  :PROPERTIES:\n  :CUSTOM_ID: %l\n  :END:\n[[papers:%l][%l-paper]]&quot;))&#xA;              (setq key (car (reftex-citation)))&#xA;              (buffer-string))))&#xA;    (condition-case nil&#xA;        (let ((org-link-search-must-match-exact-headline t))&#xA;          (org-open-link-from-string (format &quot;file:/tmp/notes.org::#%s&quot; key)))&#xA;      (error&#xA;       (with-current-buffer (get-file-buffer &quot;/tmp/notes.org&quot;)&#xA;         (goto-char (point-max))&#xA;         (unless (bolp) (newline))&#xA;         (insert tree)&#xA;         (org-back-to-heading))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think the only thing you should have to modify in the code above is the path to your notes.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-02-21T04:01:30.027" LastActivityDate="2015-02-21T04:01:30.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9455" PostTypeId="1" AcceptedAnswerId="10470" CreationDate="2015-02-21T02:01:14.057" Score="7" ViewCount="170" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get abbrev tables to inherit properties?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Motivation&lt;/em&gt;: I'd like to mix and match abbrevs such that some expand automatically when typing, while others expand only when I explicitly tell them to via &lt;code&gt;expand-abbrev&lt;/code&gt;.  (See &lt;a href=&quot;https://emacs.stackexchange.com/questions/8267/mixing-automatic-abbrev-expansions-with-explicit-only-expansions&quot;&gt;a previous question on this issue&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Solution in a simple case&lt;/em&gt;: cribbing from the accepted answer on the above question, one can define a single abbrev to expand explicitly with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev text-mode-abbrev-table &quot;abbrev&quot; &quot;expansion value&quot; nil&#xA;  :enable-function (lambda () (eq this-command 'expand-abbrev)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Problem&lt;/em&gt;: I've got a whole bunch of abbrevs I'd like to use, so doing the above for each one would be tedious.  It &lt;em&gt;should&lt;/em&gt; be possible to use &lt;code&gt;define-abbrev-table&lt;/code&gt; to automate everything, and then have the actual abbrev tables inherit from them.  So, consider the following two tables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'automatic-table&#xA;  '((&quot;test1&quot; &quot;This should expand automatically&quot;)&#xA;    ;; ... more abbrevs here&#xA;    (&quot;test2&quot; &quot;This should also expand automatically&quot;)))&#xA;&#xA;(define-abbrev-table 'explicit-table&#xA;  '((&quot;test3&quot; &quot;This should expand only after expand-abbrev&quot;)&#xA;    ;; ... more abbrevs here&#xA;    (&quot;test4&quot; &quot;This should also expand only after expand-abbrev&quot;))&#xA;  :enable-function (lambda () (eq this-command 'expand-abbrev)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems like it should then be possible to do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'text-mode-abbrev-table nil&#xA;  &quot;Table's docstring&quot;&#xA;  :parents (list explicit-table automatic-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does not quite work out, however.  &lt;code&gt;text-mode-abbrev-table&lt;/code&gt; correctly inherits the abbrevs defined in &lt;code&gt;automatic-table&lt;/code&gt; and &lt;code&gt;explicit-table&lt;/code&gt;, but they always fire automatically when typing.  In other words, the &lt;code&gt;:enable-function&lt;/code&gt; property on &lt;code&gt;explicit-table&lt;/code&gt; gets ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I ensure that the &lt;code&gt;:enable-function&lt;/code&gt; property gets inherited for the abbrevs in the relevant table without being applied to abbrevs in a different table?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-05-02T14:04:46.557" Title="abbrev table inherit properties from other tables?" Tags="|abbrev|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9456" PostTypeId="1" CreationDate="2015-02-21T08:47:59.467" Score="1" ViewCount="437" Body="&lt;p&gt;Is there a way to detect when a minor mode is turned on. For &lt;code&gt;web-mode&lt;/code&gt;, I would like to know when &lt;code&gt;indent-tabs-mode&lt;/code&gt; is turned on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that what I need is to detect this when the user has begun to edit the buffer with &lt;code&gt;indent-tabs-mode&lt;/code&gt; turned off and then decides to turn it on. &lt;/p&gt;&#xA;" OwnerUserId="197" LastEditorUserId="2710" LastEditDate="2015-02-21T14:42:03.403" LastActivityDate="2015-02-24T01:34:40.423" Title="detect minor mode activation" Tags="|minor-mode|" AnswerCount="3" CommentCount="6" ClosedDate="2015-10-18T14:06:34.333" ContentLicense="CC BY-SA 3.0" />
  <row Id="9458" PostTypeId="2" ParentId="9436" CreationDate="2015-02-21T09:35:01.550" Score="1" Body="&lt;p&gt;When I followed kaushalmodi's suggestion, I found that the unwanted variables were being set in my &lt;em&gt;new&lt;/em&gt; org-mode installation. This lead me to realize that the installation must have gone horribly wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I deleted the &lt;code&gt;org&lt;/code&gt; package in &lt;code&gt;package-list-packages&lt;/code&gt;, backed up my &lt;code&gt;.emacs&lt;/code&gt; file, wiped out any lines in it that were in any way even potentially related to org-mode, and redid the installation. Now everything looks right, as far as I can tell. &lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-02-21T09:35:01.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9460" PostTypeId="2" ParentId="9456" CreationDate="2015-02-21T11:24:27.843" Score="1" Body="&lt;p&gt;You can test the truth value of the variable &lt;code&gt;indent-tabs-mode&lt;/code&gt;, which will be &lt;code&gt;nil&lt;/code&gt; if it's off and non-&lt;code&gt;nil&lt;/code&gt; if it's on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your specific use case, making sure it's turned on as of the first edit, you can add a little function to &lt;code&gt;first-change-hook&lt;/code&gt;.  From the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  A list of functions to call before changing a buffer which is unmodified.&#xA;  The functions are run using the &lt;code&gt;run-hooks&lt;/code&gt; function.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, you could test for a &lt;code&gt;nil&lt;/code&gt; value, but since you always want it turned on, you could skip the test:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun force-tabs-in-web-mode ()&#xA;  (when (eq major-mode 'web-mode)  ; I'm assuming it's web-mode&#xA;    (setq indent-tabs-mode t)))&#xA;&#xA;(add-hook 'first-change-hook #'force-tabs-in-web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-21T11:24:27.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9461" PostTypeId="2" ParentId="9456" CreationDate="2015-02-21T14:38:07.933" Score="0" Body="&lt;p&gt;From the emacs manual's section on minor modes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Most minor modes also have a &quot;mode variable&quot;, with the same name as&#xA;  the mode command.  Its value is non-&lt;code&gt;nil&lt;/code&gt; if the mode is enabled, and&#xA;  &lt;code&gt;nil&lt;/code&gt; if it is disabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example, associated to &lt;code&gt;abbrev-mode&lt;/code&gt;, the function and minor mode, there is the variable &lt;code&gt;abbrev-mode&lt;/code&gt; whose documentation is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;abbrev-mode is a variable defined in `C source code'. Its value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Automatically becomes buffer-local when set.   This variable is safe&#xA;  as a file local variable if its value   satisfies the predicate&#xA;  &lt;code&gt;booleanp&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Non-nil if Abbrev mode is enabled. Use the command&#xA;  &lt;code&gt;abbrev-mode&lt;/code&gt; to change this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As this indicates, in general the variable should be changed via the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the comments the case of &lt;code&gt;indent-tab-mode&lt;/code&gt; is unusual, there is no corresponding function, just the variable.  Anyway you can test for whether it is set or not via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if indent-tab-mode&#xA;    (do-true-action)&#xA;    (do-false-action))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="10" LastEditDate="2015-02-21T14:43:33.200" LastActivityDate="2015-02-21T14:43:33.200" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9462" PostTypeId="1" AcceptedAnswerId="9463" CreationDate="2015-02-21T15:21:39.730" Score="1" ViewCount="192" Body="&lt;p&gt;I wanted to test &lt;code&gt;yasnippet&lt;/code&gt; for editing Emacs Lisp files. After installing it from the package manager, the problem is that it works fine from the &lt;code&gt;*scratch*&lt;/code&gt; buffer but not when editing a Lisp file using &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To debug, I reduced my Emacs init file to one line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq debug-on-error t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I started Emacs from command line with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs test.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and run &lt;code&gt;M-x yas-minor-mode&lt;/code&gt; and then &lt;code&gt;M-x yas-reload-all&lt;/code&gt;, then I typed&#xA;&lt;code&gt;defun&lt;/code&gt; and pressed the &lt;code&gt;TAB&lt;/code&gt; key, but nothing happend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I first switch to the &lt;code&gt;*scratch*&lt;/code&gt; buffer and run the same commands it works fine and inserts the &lt;code&gt;defun&lt;/code&gt; template when I press &lt;code&gt;TAB&lt;/code&gt;..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-21T15:29:44.367" Title="Yasnippet minor mode working in lisp-interaction-mode but not in emacs-lisp-mode" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9463" PostTypeId="2" ParentId="9462" CreationDate="2015-02-21T15:29:44.367" Score="2" Body="&lt;p&gt;The problem is that &lt;code&gt;yasnippet&lt;/code&gt; doesn't define a &quot;defun&quot; snippet for &lt;code&gt;emacs-lisp-mode&lt;/code&gt;. Instead, use the &quot;def&quot; snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you could use the &quot;defun&quot; snippet in the &lt;code&gt;*scratch*&lt;/code&gt; buffer is because &lt;code&gt;lisp-interaction-mode&lt;/code&gt; does have a &quot;defun&quot; snippet.&lt;br&gt;&#xA;Look in the menu bar, under &quot;YASnippet&quot;, you can find which snippets you can use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize: type &lt;code&gt;def&lt;/code&gt; and press &lt;code&gt;TAB&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-02-21T15:29:44.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9464" PostTypeId="1" CreationDate="2015-02-21T17:34:10.127" Score="6" ViewCount="938" Body="&lt;p&gt;I imagine most developers, like myself, starting out with &lt;a href=&quot;http://jdee.sourceforge.net&quot; rel=&quot;noreferrer&quot;&gt;JDEE&lt;/a&gt; are beginning with source code that is already written as opposed to a new empty project. What I'm asking for is a simple explanation of how to get JDEE set up for an existing Java project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://jdee.sourceforge.net/jdedoc/html/jde-ug/jde-ug.html&quot; rel=&quot;noreferrer&quot;&gt;user's guide&lt;/a&gt; on the JDEE website explains this to some degree, but is organized more as a highly detailed tutorial and isn't always clear on which settings are required and which are optional. Also, the user's guide uses custom variables as opposed to settings that can easily be pasted into and modified in a .emacs file. I'm looking for something that can easily be copied and pasted into a .emacs file (and any other files, such as project files) and modified to suit the file paths a developer already has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The setup should allow the use of all of the features available in JDEE that one typically expects in an IDE such as Eclipse. Please assume that the developer reading your answer has JDEE installed in Emacs, but has not gone any further than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been struggling to get this set up at home and look forward to the answers I receive so I can learn more about Java and Emacs.&lt;/p&gt;&#xA;" OwnerUserId="6571" LastEditorUserId="6571" LastEditDate="2015-02-21T17:39:30.963" LastActivityDate="2017-08-29T19:06:05.913" Title="Simple JDEE Setup for Existing Java Project" Tags="|java|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9465" PostTypeId="1" AcceptedAnswerId="9467" CreationDate="2015-02-21T18:32:03.757" Score="43" ViewCount="24631" Body="&lt;p&gt;I am writing python code so shifting/moving blocks of lines is important to avoid going through each line individually. How can I do this without an add-on? Is there a type of operation keystroke command to do this?&lt;/p&gt;&#xA;" OwnerUserId="2340" LastActivityDate="2015-03-26T14:18:20.157" Title="How to shift a selected area of text in Emacs by a certain number of spaces?" Tags="|whitespace|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9466" PostTypeId="2" ParentId="9465" CreationDate="2015-02-21T18:42:03.153" Score="6" Body="&lt;p&gt;There is &lt;code&gt;C-x TAB&lt;/code&gt; (bound to &lt;code&gt;indent-rigidly&lt;/code&gt;). Give it a prefix argument to indicate how many spaces you wish to indent by, negative removes that many spaces.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2015-02-21T18:42:03.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9467" PostTypeId="2" ParentId="9465" CreationDate="2015-02-21T18:43:20.020" Score="72" Body="&lt;p&gt;Use command &lt;code&gt;indent-rigidly&lt;/code&gt;, which is bound to &lt;code&gt;C-x TAB&lt;/code&gt; by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can specify the number of spaces to indent by using a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot;&gt;prefix argument&lt;/a&gt;, such as &lt;code&gt;C-5 C-x TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can invoke the command and then use the left/right arrows to interactively adjust the indent level.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-21T19:06:00.030" LastActivityDate="2015-02-21T19:06:00.030" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9468" PostTypeId="2" ParentId="9465" CreationDate="2015-02-21T18:46:14.813" Score="15" Body="&lt;p&gt;If you are used python-mode.el &lt;code&gt;C-c &amp;gt;&lt;/code&gt; or &lt;code&gt;C-c &amp;lt;&lt;/code&gt; to shift blocks left or right&lt;/p&gt;&#xA;" OwnerUserId="499" LastActivityDate="2015-02-21T18:46:14.813" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9469" PostTypeId="2" ParentId="9465" CreationDate="2015-02-22T00:39:29.370" Score="9" Body="&lt;p&gt;The &lt;code&gt;string-rectangle&lt;/code&gt; command ( &lt;code&gt;C-x r t&lt;/code&gt;) can be used to insert any arbitrary text (spaces included) in a selected region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have this block of text and you want to insert 5 spaces in front of all lines.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abc&#xA;  def&#xA;    ghi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First select a &quot;0 column&quot; region as shown below (the point is on the character 'a' and the mark is in the same column in the row containing 'ghi':&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮bc&#xA;  def&#xA;▯   ghi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now using &lt;code&gt;string-rectangle&lt;/code&gt;, insert the text you want to insert in the selected region. In this example, we will be inserting 5 spaces on all the rows including and inbetween the point and the mark.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x r t M-5 SPC RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That will give the below force indented text.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     abc&#xA;       def&#xA;         ghi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-22T00:39:29.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9470" PostTypeId="2" ParentId="7648" CreationDate="2015-02-22T03:23:44.567" Score="1" Body="&lt;p&gt;Since you seem to already use &lt;a href=&quot;https://github.com/ffevotte/isend-mode.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;isend&lt;/code&gt;&lt;/a&gt;, you might be interested to know that it supports &lt;code&gt;ipython&lt;/code&gt;'s &lt;code&gt;%cpaste&lt;/code&gt;...&lt;code&gt;--&lt;/code&gt; construct out of the box:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'isend-mode-hook 'isend-default-ipython-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setup, every region that you send will automatically be wrapped in a &lt;code&gt;%cpaste&lt;/code&gt;/&lt;code&gt;--&lt;/code&gt; block. Sending single lines (i.e. when no region is active) will not be affected.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-02-22T03:23:44.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9471" PostTypeId="1" AcceptedAnswerId="9473" CreationDate="2015-02-22T03:48:02.597" Score="13" ViewCount="182" Body="&lt;p&gt;I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; mangle-whitespace: t&#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in many Elisp source files by various experienced Emacs programmers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I &lt;code&gt;describe-variable&lt;/code&gt;, Emacs 24.3 says no variable &lt;code&gt;mangle-whitespace&lt;/code&gt; is defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is &lt;code&gt;mangle-whitespace&lt;/code&gt; provided by Emacs 24.4? Or by some popular package? (I don't see any on MELPA named &quot;mangle&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does &lt;code&gt;mangle-whitespace&lt;/code&gt; do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I searched for this both here and on SO under the emacs tag. I also tried both DuckDuckGo and Google, and the search results are just more examples of &lt;code&gt;.el&lt;/code&gt; files using this. Ergo asking here.&lt;/p&gt;&#xA;" OwnerUserId="849" LastActivityDate="2015-02-23T15:56:14.883" Title="What is the file local variable mangle-whitespace?" Tags="|file-local-variables|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9472" PostTypeId="1" AcceptedAnswerId="9483" CreationDate="2015-02-22T04:06:35.197" Score="8" ViewCount="3422" Body="&lt;p&gt;When I edit a source block it comes out in the &lt;code&gt;org-mode&lt;/code&gt; buffer like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Item 1&#xA;  Text indented two spaces here under list entry&#xA;&#xA;  #+BEGIN_SRC ruby&#xA;class Name&#xA;end&#xA;  #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it should be indented like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Item 1&#xA;  Text indented two spaces here under list entry&#xA;&#xA;  #+BEGIN_SRC ruby&#xA;  class Name&#xA;  end&#xA;  #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I need to configure &lt;code&gt;org-mode&lt;/code&gt; to solve this issue?&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="504" LastEditDate="2015-02-25T11:11:31.770" LastActivityDate="2015-02-25T11:11:31.770" Title="Org-mode: Source block doesn't respect parent buffer indentation" Tags="|org-mode|indentation|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9473" PostTypeId="2" ParentId="9471" CreationDate="2015-02-22T09:36:15.920" Score="9" Body="&lt;p&gt;I've grepped my &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; for &lt;code&gt;mangle-whitespace&lt;/code&gt; and noticed it's used in a few packages which are all written by &lt;a href=&quot;https://github.com/rolandwalker/&quot;&gt;Roland Walker&lt;/a&gt;.  Then I proceeded downloading the tarballs for Emacs 22.1 to Emacs 24.4 (because these are the Emacs version Roland Walker supports with his packages) and grepped them for this variable, but without any luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's why I've opened an &lt;a href=&quot;https://github.com/rolandwalker/nav-flash/issues/2&quot;&gt;issue&lt;/a&gt; to find out the reasons for it. I'll update this answer as soon as there is a response.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: The author of these packages confirmed that it's a variable respected by his own Emacs config which instructs it to unconditionally require a final newline.  He also expressed interest in turning it into a directory-local variable to avoid pushing it to Github.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-02-23T15:56:14.883" LastActivityDate="2015-02-23T15:56:14.883" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9474" PostTypeId="1" AcceptedAnswerId="9476" CreationDate="2015-02-22T11:44:03.957" Score="6" ViewCount="3577" Body="&lt;pre&gt;&lt;code&gt;(let (lineStr (thing-at-point 'line t))&#xA;   (body-form......))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;throws the error, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call-interactively: `let' bindings can have only one value-form: thing-at-point, (quote line), t [2 times]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can't a let variable take a elisp form, and &lt;code&gt;eval&lt;/code&gt; the form, get its value assigned?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-02-22T12:04:56.003" Title="Let statement throws error on assigning a form to a variable" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9476" PostTypeId="2" ParentId="9474" CreationDate="2015-02-22T11:51:24.430" Score="14" Body="&lt;p&gt;Read the documentation: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;let&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;let is a special form in `C source code'.&#xA;&#xA;(let VARLIST BODY...)&#xA;&#xA;Bind variables according to VARLIST then eval BODY.&#xA;The value of the last form in BODY is returned.&#xA;Each element of VARLIST is a symbol (which is bound to nil)&#xA;or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM).&#xA;All the VALUEFORMs are evalled before any symbols are bound.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;VARLIST&lt;/code&gt; is a list:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let (...)&#xA;  BODY)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And &lt;em&gt;elements which bind values&lt;/em&gt; are also lists:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((SYMBOL VALUEFORM)&#xA;      (SYMBOL VALUEFORM))&#xA;  BODY)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-02-22T11:51:24.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9477" PostTypeId="2" ParentId="9474" CreationDate="2015-02-22T12:04:56.003" Score="9" Body="&lt;p&gt;You're missing a necessary set of parentheses around the VARLIST.  Your code should look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(let ((lineStr (thing-at-point 'line t)))&#xA;   (body-form......))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See the documentation for 'let' at 'C-h f let'.)  The purpose of the VARLIST being a list is to allow multiple variables to be bound within a single 'let'.  The extra parentheses separate the VARLIST from the BODY. &lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2015-02-22T12:04:56.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9478" PostTypeId="1" AcceptedAnswerId="9479" CreationDate="2015-02-22T14:23:53.993" Score="1" ViewCount="368" Body="&lt;pre&gt;&lt;code&gt;(defmacro condition-case-unless-debug (var bodyform &amp;amp;rest handlers)&#xA;  (let ((bodysym (make-symbol &quot;body&quot;)))&#xA;    `(let ((,bodysym (lambda () ,bodyform)))&#xA;       (if debug-on-error&#xA;           (funcall ,bodysym)&#xA;         (condition-case ,var&#xA;             (funcall ,bodysym)&#xA;           ,@handlers)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am trying to deep-dive into this macro definition and I have many questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This macro uses nested let blocks instead of a single let block? And doesnt the inner let block's &lt;code&gt;bodysym&lt;/code&gt; variable always override the outer &lt;code&gt;bodysym&lt;/code&gt; variable?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How is &lt;code&gt;condition-case-unless-debug&lt;/code&gt; different from &lt;code&gt;condition-case&lt;/code&gt;? Sorry folks, the elisp doc is not clear enough.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;@handlers&lt;/code&gt; ---&gt; what does &lt;code&gt;@&lt;/code&gt; symbol before a variable name stand for?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="25" LastEditDate="2015-02-22T14:47:52.423" LastActivityDate="2015-02-22T14:47:52.423" Title="condition-case-unless-debug code study" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9479" PostTypeId="2" ParentId="9478" CreationDate="2015-02-22T14:47:06.333" Score="2" Body="&lt;p&gt;The outer &lt;code&gt;let&lt;/code&gt; is evaluated during the expansion of the macro; it binds the symbol &lt;code&gt;bodysym&lt;/code&gt;. The inner let is evaluated when the resulting code is executed; it binds a symbol whose name is &lt;code&gt;body&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simpler, mostly equivalent macro, which simply uses the symbol &lt;code&gt;body&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro condition-case-unless-debug (var bodyform &amp;amp;rest handlers)&#xA;  `(let ((body (lambda () ,bodyform)))&#xA;     (if debug-on-error&#xA;         (funcall body)&#xA;       (condition-case ,var&#xA;           (funcall body)&#xA;         ,@handlers))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with this simpler macro is that the code it expands to uses the symbol &lt;code&gt;body&lt;/code&gt;. This interferes with the use of &lt;code&gt;body&lt;/code&gt; as a variable name in the place where it is used. Instead of &lt;code&gt;body&lt;/code&gt;, the macro could use a symbol like &lt;code&gt;condition-case-unless-debug/body&lt;/code&gt; which isn't used anywhere else, but even that would fail if the macro is used multiple times, one nested in the other. Hence the macro uses &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html#index-make_002dsymbol-497&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;make-symbol&lt;/code&gt;&lt;/a&gt; to create a different symbol each time it is expanded. Creating fresh symbols is a common concern when writing macros that expand to code that uses temporary variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between this macro and a plain &lt;code&gt;condition-case&lt;/code&gt; should be easy to see from the simplified version above: the resulting code checks the variable &lt;code&gt;debug-on-error&lt;/code&gt;, and if an error occurs, instead of applying the error handlers, the code lets the debugger catch the error. This can be useful while debugging error handling, but you wouldn't use it in production code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;,@&lt;/code&gt; in front of a variable name is a way to expand a variable under &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html#Backquote&quot; rel=&quot;nofollow&quot;&gt;backquotes&lt;/a&gt;, like &lt;code&gt;,&lt;/code&gt; except that it treats the value of the variable as a list and &lt;em&gt;splices&lt;/em&gt; it. Thus in &lt;code&gt;(condition-case ,var (funcall body) ,@handlers)&lt;/code&gt; the variable &lt;code&gt;handlers&lt;/code&gt; should contain a list of handlers; this is equivalent to &lt;code&gt;(append (list 'condition-case var '(funcall body) ) handlers)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-02-22T14:47:06.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9480" PostTypeId="2" ParentId="9472" CreationDate="2015-02-22T15:32:54.077" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;C-c'&lt;/code&gt; to edit the block using the ruby-mode (or any other mode you specified for babel). Now you can indent the whole buffer according to the ruby-mode. Leave using &lt;code&gt;C-c'&lt;/code&gt; again and your block should be indented now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also create a function or a macro to run those steps for you, to automatize the process, if you wish.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-02-22T15:32:54.077" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9481" PostTypeId="1" CreationDate="2015-02-22T10:27:06.890" Score="2" ViewCount="305" Body="&lt;p&gt;I´ve just installed emacs 24.4 and tried to process my files, in this case, an org-File. When it comes to export (as pdf for example), the new emacs behaves completely different, it is not able to process my org-mode files anymore. The error-messages are unclear, like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;replace-regexp-in-string: Invalid use of `\' in replacement text&quot;. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since emacs and org-mode is my main editing tool, if i can´t process my &quot;old&quot; files, i have to go back to the old emacs (24.3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example Code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE:     Atmel atmega328p Register&#xA;#+EXPORT_SELECT_TAGS: export&#xA;#+EXPORT_EXCLUDE_TAGS: noexport &#xA;#+LaTeX_CLASS_OPTIONS: [captions=tableheading]&#xA;#+LaTeX_CLASS_OPTIONS: [article,letterpaper,times,12pt,listings-bw,microtype]&#xA;#+LaTeX_CLASS_OPTIONS: [captions=tableheading]&#xA;#+LaTeX_CLASS_OPTIONS: \usepackage{hyperref}&#xA;#+LaTeX_HEADER:  \headheight=0pt&#xA;#+LaTeX_HEADER:  \oddsidemargin=-1cm&#xA;#+LaTeX_HEADER:  \topmargin=-1cm&#xA;#+LaTeX_HEADER: \usepackage{placeins}&#xA;#+STARTUP: showall&#xA;&#xA;* ATMega328P Register&#xA;&#xA;** TCCR0A – Timer/Counter Control Register A&#xA;&#xA;#+CAPTION: TCCR0A – Timer/Counter Control Register A&#xA;#+NAME:   tab: TCCR0A &#xA;#+attr_latex: align=|l|c|c|c|c|c|c|c|c|&#xA;|--------------+--------+--------+--------+--------+----+----+-------+-------|&#xA;| Bit          |      7 |      6 |      5 |      4 |  3 |  2 |     1 |     0 |&#xA;|--------------+--------+--------+--------+--------+----+----+-------+-------|&#xA;| 0x24 (0x44)  | COM0A1 | COM0A0 | COM0B1 | COM0B0 | -- | -- | WGM01 | WGM00 |&#xA;| Read/Write   |    R/W |    R/W |    R/W |    R/W |  R |  R |   R/W |   R/W |&#xA;| InitialValue |      0 |      0 |      0 |      0 |  0 |  0 |     0 |     0 |&#xA;|--------------+--------+--------+--------+--------+----+----+-------+-------|&#xA;&#xA;*** Prescaler at 16 MHz &#xA;#+CAPTION: Prescaler 16 MHz&#xA;#+NAME:   tab: Prescaler 16 MHz&#xA;#+attr_latex: align=|c|c|c|l|c|&#xA;#+tblname: delsee&#xA;|------+------+--------+---------------------------------+-----|&#xA;| CS02 | CS01 |   CS00 |                              16 | MHz |&#xA;|------+------+--------+---------------------------------+-----|&#xA;|      |      | Clock: |                        16000000 | Hz  |&#xA;|------+------+--------+---------------------------------+-----|&#xA;|    0 |    0 |      0 |           Timer/Counter stopped |     |&#xA;|    0 |    0 |      1 |                   No prescaling |     |&#xA;|    0 |    1 |      0 |                         2000000 | Hz  |&#xA;|    0 |    1 |      1 |                          250000 | Hz  |&#xA;|    1 |    0 |      0 |                           62500 | Hz  |&#xA;|    1 |    0 |      1 |                           15625 | Hz  |&#xA;|    1 |    1 |      0 | External clock source on T0 pin |     |&#xA;|      |      |        |          Clock on falling edge. |     |&#xA;|    1 |    1 |      1 | External clock source on T0 pin |     |&#xA;|      |      |        |           Clock on rising edge. |     |&#xA;|------+------+--------+---------------------------------+-----|&#xA;#+TBLFM: @5$4=@2$4/8::@6$4=@2$4/64::@7$4=@2$4/256::@8$4=@2$4/1024&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;regards&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I´ve installed the &quot;old&quot; version, 24.3 and now i face the same problem, so it seems to be a configuration problem, but i can´t remember that i have done something special to process an org-file in emacs.&lt;/p&gt;&#xA;" OwnerUserId="11770" OwnerDisplayName="Coliban" LastEditorUserId="253" LastEditDate="2015-02-22T19:54:10.883" LastActivityDate="2015-04-23T20:58:55.423" Title="New Emacs 24.4 problems in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9482" PostTypeId="2" ParentId="9481" CreationDate="2015-02-22T13:03:29.930" Score="1" Body="&lt;p&gt;Found the solution, the behavior of the new emacs versions seems to be slightly different from the old one, this code will compile (Latex directives seems no longer be defined as &quot;Latex Options&quot;, rather it should be declared as &quot;Latex&quot; commands):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE:     Atmel atmega328p Register&#xA;#+AUTHOR:    Coliban&#xA;#+EMAIL:     coliban&#xA;#+EXPORT_SELECT_TAGS: export&#xA;#+EXPORT_EXCLUDE_TAGS: noexport&#xA;#+LaTeX_CLASS_OPTIONS: [captions=tableheading]&#xA;#+LaTeX_CLASS_OPTIONS: [article,letterpaper,times,12pt,listings-bw,microtype]&#xA;#+LaTeX_CLASS_OPTIONS: [captions=tableheading]&#xA;&#xA;&#xA;#+STARTUP: showall&#xA;#+LaTeX: \usepackage{hyperref}&#xA;&#xA;&#xA;* ATMega328P Register&#xA;&#xA;** TCCR0A – Timer/Counter Control Register A&#xA;&#xA;#+CAPTION: TCCR0A – Timer/Counter Control Register A&#xA;#+NAME:   tab: TCCR0A &#xA;#+attr_latex: align=|l|c|c|c|c|c|c|c|c|&#xA;|--------------+--------+--------+--------+--------+----+----+-------+-------|&#xA;| Bit          |      7 |      6 |      5 |      4 |  3 |  2 |     1 |     0 |&#xA;|--------------+--------+--------+--------+--------+----+----+-------+-------|&#xA;| 0x24 (0x44)  | COM0A1 | COM0A0 | COM0B1 | COM0B0 | -- | -- | WGM01 | WGM00 |&#xA;| Read/Write   |    R/W |    R/W |    R/W |    R/W |  R |  R |   R/W |   R/W |&#xA;| InitialValue |      0 |      0 |      0 |      0 |  0 |  0 |     0 |     0 |&#xA;|--------------+--------+--------+--------+--------+----+----+-------+-------|&#xA;&#xA;*** Prescaler at 16 MHz &#xA;#+CAPTION: Prescaler 16 MHz&#xA;#+NAME:   tab: Prescaler 16 MHz&#xA;#+attr_latex: align=|c|c|c|l|c|&#xA;#+tblname: delsee&#xA;|------+------+--------+---------------------------------+-----|&#xA;| CS02 | CS01 |   CS00 |                              16 | MHz |&#xA;|------+------+--------+---------------------------------+-----|&#xA;|      |      | Clock: |                        16000000 | Hz  |&#xA;|------+------+--------+---------------------------------+-----|&#xA;|    0 |    0 |      0 |           Timer/Counter stopped |     |&#xA;|    0 |    0 |      1 |                   No prescaling |     |&#xA;|    0 |    1 |      0 |                         2000000 | Hz  |&#xA;|    0 |    1 |      1 |                          250000 | Hz  |&#xA;|    1 |    0 |      0 |                           62500 | Hz  |&#xA;|    1 |    0 |      1 |                           15625 | Hz  |&#xA;|    1 |    1 |      0 | External clock source on T0 pin |     |&#xA;|      |      |        |          Clock on falling edge. |     |&#xA;|    1 |    1 |      1 | External clock source on T0 pin |     |&#xA;|      |      |        |           Clock on rising edge. |     |&#xA;|------+------+--------+---------------------------------+-----|&#xA;#+TBLFM: @5$4=@2$4/8::@6$4=@2$4/64::@7$4=@2$4/256::@8$4=@2$4/1024&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11770" OwnerDisplayName="Coliban" LastActivityDate="2015-02-22T13:03:29.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9483" PostTypeId="2" ParentId="9472" CreationDate="2015-02-22T16:22:56.150" Score="9" Body="&lt;p&gt;This solved my problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-preserve-indentation nil &#xA;      org-edit-src-content-indentation 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="104" LastEditDate="2015-02-25T09:25:51.380" LastActivityDate="2015-02-25T09:25:51.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9484" PostTypeId="1" CreationDate="2015-02-22T18:08:34.707" Score="2" ViewCount="80" Body="&lt;p&gt;Is there any way to create a custom image (e.g., using an xpm format) and use it in the &lt;code&gt;display-table&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that XEmacs had a function called &lt;code&gt;make-glyph&lt;/code&gt; -- e.g., &lt;code&gt;(make-glyph '([xpm :file &quot;~/something.xpm&quot;] [string :data &quot;[END]&quot;]))&lt;/code&gt;.  However, regular Emacs doesn't have that function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;make-glyph-code&lt;/code&gt; requires a &lt;em&gt;character&lt;/em&gt; (e.g., &lt;code&gt;?\U0001D4D5&lt;/code&gt;) -- and there is an optional &lt;code&gt;face&lt;/code&gt; argument (e.g., &lt;code&gt;'font-lock-warning-face&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to do something similar to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (not buffer-display-table)&#xA;  (setq buffer-display-table (make-display-table)))&#xA;&#xA;(aset buffer-display-table ?\014 form-feed)&#xA;&#xA;(defvar form-feed `(image :type xpm :mask nil :ascent center :data&#xA;  &quot;/* XPM */&#xA;  static char * form_feed_xpm[] = {&#xA;  \&quot;11 20 5 1\&quot;,&#xA;  \&quot; c None\&quot;,&#xA;  \&quot;. c purple\&quot;,&#xA;  \&quot;+ c yellow\&quot;,&#xA;  \&quot;@ c #7F0000\&quot;,&#xA;  \&quot;% c yellow\&quot;,&#xA;  \&quot;%%%%%%%%%%%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%...++++++%\&quot;,&#xA;  \&quot;%.++.++...%\&quot;,&#xA;  \&quot;%+...+....%\&quot;,&#xA;  \&quot;%+...+....%\&quot;,&#xA;  \&quot;%+...+....%\&quot;,&#xA;  \&quot;%+...++++.%\&quot;,&#xA;  \&quot;%....+....%\&quot;,&#xA;  \&quot;%...++....%\&quot;,&#xA;  \&quot;%...+.....%\&quot;,&#xA;  \&quot;%.++++....%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%.........%\&quot;,&#xA;  \&quot;%%%%%%%%%%%\&quot;};&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  As a first impression, it seemed that the library &lt;code&gt;gamegrid.el&lt;/code&gt; might have been using the concept outlined above.  However, it turned out that &lt;code&gt;gamegrid.el&lt;/code&gt; uses the &lt;code&gt;buffer-display-table&lt;/code&gt; as a buffer-local storage facility for the &lt;code&gt;xpm&lt;/code&gt; images, which are later used by the function &lt;code&gt;gamegrid-set-face&lt;/code&gt; to &lt;code&gt;add-text-properties&lt;/code&gt; using the &lt;code&gt;'display&lt;/code&gt; property.  While it was a good excuse to play &lt;em&gt;pong&lt;/em&gt; and &lt;em&gt;tetris&lt;/em&gt;, it did not resolve this particular question.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-02-23T03:19:01.947" LastActivityDate="2015-02-23T03:19:01.947" Title="How to define an image as a display-table entry" Tags="|buffer-display-table|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9485" PostTypeId="1" AcceptedAnswerId="9493" CreationDate="2015-02-22T21:34:27.433" Score="9" ViewCount="1353" Body="&lt;p&gt;I have a buffer with content like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src/file4.rs:9&#xA;src/file4.rs:33&#xA;src/file4.rs:64&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to put my cursor on a line and jump to the appropriate file / line in the other window, just like compilation-mode would. However, this buffer contains files/lines that I've generated via other means, it is not the output of a script.&lt;/p&gt;&#xA;" OwnerUserId="4099" LastActivityDate="2015-02-23T09:18:12.640" Title="How can I jump to a file and line number from a list in a buffer?" Tags="|files|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9486" PostTypeId="2" ParentId="9485" CreationDate="2015-02-22T21:57:14.877" Score="4" Body="&lt;p&gt;Here's a command I whipped up (note that the regexp is not particularly sophisticated).  I can't really test it, unfortunately, so you may have to tinker with it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jump-to-file-and-line ()&#xA;  &quot;Reads a line in the form FILENAME:LINE and, assuming a&#xA;relative path, opens that file in another window and jumps to the&#xA;line.&quot;&#xA;  (interactive)&#xA;  (let ((line (buffer-substring-no-properties (point-at-bol) (point-at-eol))))&#xA;    (string-match &quot;\\(.*\\):\\([0-9]+\\)&quot; line)&#xA;    (let ((file (match-string 1 line))&#xA;          (lnum (match-string 2 line)))&#xA;      (when (and file (file-exists-p (concat default-directory file)))&#xA;        (find-file-other-window (concat default-directory file))&#xA;        (and lnum (goto-line (string-to-number lnum)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-02-22T22:06:49.557" LastActivityDate="2015-02-22T22:06:49.557" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9487" PostTypeId="1" CreationDate="2015-02-22T21:59:56.427" Score="2" ViewCount="918" Body="&lt;p&gt;I'm trying to create my own major mode. So far I've been able to set all the syntax highlighting that I need, but I'm struggling with this one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I need to color any word before an equal sign. Like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;lt; action &lt;strong&gt;name=&lt;/strong&gt;&quot;set_button&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like the face nxml-attribute-local-name in nxml-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this I'm using a regular expression to find that word and then set font-lock-variable-name-face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the following regular expressions, but they didn't work. I don't know if it's because I'm not escaping them correctly or because emacs doesn't support them.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (&quot;\\(\w+\\)\\(?=\s*=\\)&quot; . font-lock-variable-name-face)&#xA; (&quot;\b\\(\w+\\)\b=&quot; . font-lock-variable-name-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is nothing wrong with the elisp code. When I try a more simple regex it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6546" LastActivityDate="2015-02-23T16:43:59.083" Title="Custom Major Mode - Regex to find word before equal sign and set font-lock-variable-name-face" Tags="|faces|regular-expressions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9488" PostTypeId="1" AcceptedAnswerId="9650" CreationDate="2015-02-22T23:53:09.560" Score="10" ViewCount="2084" Body="&lt;p&gt;Upon running &lt;code&gt;package-list-packages&lt;/code&gt;, I get the following error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;These default coding systems were tried to encode text&#xA;in the buffer ` *temp*':&#xA;  (iso-latin-1-dos (3242 . 37326) (3243 . 40165))&#xA;However, each of them encountered characters it couldn't encode:&#xA;  iso-latin-1-dos cannot encode these: 野 鳥&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I set the default package manager encoding to be &lt;code&gt;utf-8&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2016-10-20T20:32:18.517" Title="Package manager encoding error" Tags="|package|character-encoding|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9491" PostTypeId="1" AcceptedAnswerId="9524" CreationDate="2015-02-23T06:56:16.240" Score="5" ViewCount="602" Body="&lt;p&gt;I have a buffer (not a file) containing data. I would like a function that lets the user select 1 or more lines of this buffer, e.g., by typing a regexp, and that returns the result as a list of selected lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result would be equivalent to a &lt;code&gt;grep&lt;/code&gt; run within &lt;code&gt;helm&lt;/code&gt; except that, as a result of validating the selection, I don't want to visit the matching lines but get them in a list.&lt;/p&gt;&#xA;" OwnerUserId="2222" LastActivityDate="2015-04-07T19:48:58.717" Title="How to use helm to complete sources which are lines in a buffer?" Tags="|helm|completion|search|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9492" PostTypeId="1" AcceptedAnswerId="17677" CreationDate="2015-02-23T07:16:22.733" Score="33" ViewCount="6942" Body="&lt;p&gt;I draft documents in org-mode and export them to LaTeX, HTML, etc. as needed. I frequently use the tag &lt;code&gt;:no_export:&lt;/code&gt; whenever I don't want a certain subtree to show up in the output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I also want is want is for the export to completely ignore certain subtree &lt;em&gt;headings&lt;/em&gt;, but &lt;em&gt;not&lt;/em&gt; to ignore then &lt;em&gt;content&lt;/em&gt; of the subtree under that heading. In other words, certain subtrees should be exported as if their content were just a continuation of the parent, instead of having its own subtree. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm ideally imagining a tag like &lt;code&gt;:no_title:&lt;/code&gt;. I want my org-mode outline to look more or less the way I am used to. But I would consider other approaches with similar results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate, here is a MWE of a document drafted in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Chapter 1&#xA;** Section 1&#xA;*** Paragraph 1      :no_title:&#xA;First paragraph of text in the section.&#xA;*** Paragraph 2      :no_title:&#xA;Second paragraph of text in the section.&#xA;* Chapter 2&#xA;** Section 1&#xA;*** Subsection 1&#xA;**** Paragraph 1      :no_title:&#xA;First paragraph of text in the subsection.&#xA;**** Paragraph 2      :no_title:&#xA;Second paragraph of text in the subsection&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export that currently, I get something like this: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1 Chapter 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1.1 Section 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1.1.1 Paragraph 1 :no_title:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;First paragraph of text in the section.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1.1.2 Paragraph 2 :no_title:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Second paragraph of text in the section.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2 Chapter 2&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2.1 Section 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2.1.1 Subsection 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;◊ 2.1.1.1 Paragraph 1 :no_title:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;First paragraph of text in the subsection.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But what I want is more like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1 Chapter 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1.1 Section 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;First paragraph of text in the section.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Second paragraph of text in the section.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2 Chapter 2&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2.1 Section 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2.1.1 Subsection 1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;First paragraph of text in the subsection.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2015-02-23T09:35:21.667" LastActivityDate="2024-03-02T19:57:27.020" Title="Is it possible to export content of subtrees without their headings?" Tags="|org-mode|org-export|writing|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9493" PostTypeId="2" ParentId="9485" CreationDate="2015-02-23T07:35:03.557" Score="9" Body="&lt;p&gt;You can actually re-use compilation mode without doing much work.  Say, for example, you are saving the file you generate into &lt;code&gt;foo.errors&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Add &lt;code&gt;-*- mode: compilation -*-&lt;/code&gt; in the first line.&lt;/li&gt;&#xA;&lt;li&gt;Format your errors, for example, like this: &lt;code&gt;&amp;lt;path to file&amp;gt;: line &amp;lt;line number&amp;gt;:&lt;/code&gt; (this is covered by this entry &lt;code&gt;(bash &quot;^\\([^: \n\t]+\\): line \\([0-9]+\\):&quot; 1 2)&lt;/code&gt; in the &lt;code&gt;compilation-error-regexp-alist-alist&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;When you load up the buffer, the compilation mode will be set automatically, and the lines in the format above will be highlighted. When you press &lt;kbd&gt;RET&lt;/kbd&gt; on them, the file under point will be opened on the line specified.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can also set the directory in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;local variables&lt;/a&gt; but its unnecessary, if the path to the file is absolute or you will always use paths relative to the &lt;code&gt;foo.errors&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-02-23T09:18:12.640" LastActivityDate="2015-02-23T09:18:12.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9494" PostTypeId="2" ParentId="9492" CreationDate="2015-02-23T10:04:19.167" Score="20" Body="&lt;p&gt;&lt;strong&gt;Yes&lt;/strong&gt;, this is entirely possible. Add the following code to your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-remove-headlines (backend)&#xA;  &quot;Remove headlines with :no_title: tag.&quot;&#xA;  (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol)))&#xA;                   &quot;no_title&quot;))&#xA;&#xA;(add-hook 'org-export-before-processing-hook #'org-remove-headlines)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Acknowledgments&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This question has been &lt;a href=&quot;https://stackoverflow.com/q/10295177/1199226&quot;&gt;asked&lt;/a&gt; on StackOverflow before (with a different focus and wording, which is probably why you weren't able to locate it when you searched the internet before posting here). The code above is a simplified version of the code in the &lt;a href=&quot;https://stackoverflow.com/a/10305270/1199226&quot;&gt;accepted answer&lt;/a&gt;; it works for the &lt;a href=&quot;http://orgmode.org/worg/exporters/ox-overview.html&quot; rel=&quot;noreferrer&quot;&gt;new exporter&lt;/a&gt; introduced in &lt;code&gt;org-mode&lt;/code&gt; 8.0 and is &lt;strong&gt;backend-agnostic&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Update&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;As discussed in the comments, the code above causes contents of entries tagged with &lt;code&gt;:no_title:&lt;/code&gt; to disappear &lt;strong&gt;if&lt;/strong&gt; they are preceded by an entry that is tagged to be excluded from the exported document. For example, exporting the following document will produce a document with a title and TOC, but no content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+EXCLUDE_TAGS: no_export&#xA;&#xA;* No export                          :no_export:&#xA;  This is not meant for you to see.&#xA;* No title                           :no_title:&#xA;  You should see this.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason for this is that &lt;code&gt;org-mode&lt;/code&gt; removes the &lt;em&gt;headline&lt;/em&gt; tagged with &lt;code&gt;:no_title:&lt;/code&gt; before it removes the &lt;em&gt;entry&lt;/em&gt; whose headline is tagged with &lt;code&gt;:no_export:&lt;/code&gt;. As a result, when it gets around to removing the &lt;code&gt;no_export&lt;/code&gt; entry, it treats contents of the &lt;code&gt;no_title&lt;/code&gt; entry as belonging to the preceding &lt;code&gt;no_export&lt;/code&gt; entry. This makes perfect sense because there is no structural element (heading) that separates the contents of the original entries anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this problem, we can transfer responsibility for removing &lt;code&gt;no_export&lt;/code&gt; entries to &lt;code&gt;org-remove-headlines&lt;/code&gt;. This way, we make sure all &lt;code&gt;no_export&lt;/code&gt; entries are gone before headlines are removed from &lt;code&gt;no_title&lt;/code&gt; entries:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-remove-headlines (backend)&#xA;  &quot;Remove headlines with :no_title: tag.&quot;&#xA;  (org-map-entries (lambda () (let ((beg (point)))&#xA;                                (outline-next-visible-heading 1)&#xA;                                (backward-char)&#xA;                                (delete-region beg (point))))&#xA;                   &quot;no_export&quot; tree)&#xA;  (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol)))&#xA;                   &quot;no_title&quot;))&#xA;&#xA;(add-hook 'org-export-before-processing-hook #'org-remove-headlines)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-04-12T05:44:13.280" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="9495" PostTypeId="1" CreationDate="2015-02-23T12:08:52.623" Score="14" ViewCount="4385" Body="&lt;p&gt;I'd like to define a set of files within which I can search and replace text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to search, e.g., in all files xk*.tex in a given directory (and excluding backup files). I would also like to be able to change the expression, e.g., &quot;uncertainty&quot;, to &quot;indeterminacy&quot; in all files dd*.sh and ee*.cls .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the standard way to do this?&lt;/p&gt;&#xA;" OwnerUserId="6577" LastEditorUserId="253" LastEditDate="2015-02-23T15:48:50.577" LastActivityDate="2022-01-15T17:25:33.770" Title="How do I search and replace over a set of files?" Tags="|files|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9496" PostTypeId="2" ParentId="9495" CreationDate="2015-02-23T13:06:49.343" Score="5" Body="&lt;p&gt;You can use &lt;code&gt;M-x find-name-dired&lt;/code&gt; to get a dired buffer containing links to all files matching a given name pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;M-x find-grep-dired&lt;/code&gt; to get a dired buffer containing those files whose contents match the provided grep pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many more such commands; which is most appropriate depends on your requirements, so please consider updating your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can traverse the list of files using macros.  Take a look at Brian's answer for an example: &lt;a href=&quot;https://emacs.stackexchange.com/a/9497/2005&quot;&gt;https://emacs.stackexchange.com/a/9497/2005&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-02-23T17:08:45.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9497" PostTypeId="2" ParentId="9495" CreationDate="2015-02-23T13:26:34.290" Score="5" Body="&lt;p&gt;If all of the files are in the same directory, you could follow these steps. I'll base this on the second example given in the comments:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;dired&lt;/code&gt; to open the relevant directory in &lt;code&gt;dired&lt;/code&gt; mode.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;%&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt; to run &lt;code&gt;dired-mark-files-regexp&lt;/code&gt; in that directory.&lt;/li&gt;&#xA;&lt;li&gt;Enter &lt;code&gt;^dd.*\.sh$&lt;/code&gt;, which is the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html#Regular-Expressions&quot; rel=&quot;nofollow&quot;&gt;regexp&lt;/a&gt; equivalent to &lt;code&gt;dd*.sh&lt;/code&gt;. Those files will now be marked with a &lt;code&gt;*&lt;/code&gt;, and may also appear highlighted in a different color depending on your color scheme.&lt;/li&gt;&#xA;&lt;li&gt;Repeat step #3 as many times as needed, with whatever regexp you want (e.g. &lt;code&gt;^ee.*\.cls$&lt;/code&gt;) until all the files you want to edit are marked.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;Q&lt;/kbd&gt; to run &lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt; on the files you marked.&lt;/li&gt;&#xA;&lt;li&gt;Enter &lt;code&gt;uncertainty&lt;/code&gt; and &lt;code&gt;indeterminacy&lt;/code&gt; as the query strings. (I think this will be case-sensitive. If you need it to be case insensitive, that may require a regexp, but I'm not sure.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And that's the idea. If you need to repeat this a few times in different folders, you can record steps 2-6 as a macro (press &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;(&lt;/kbd&gt; after step #1, and &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;)&lt;/kbd&gt; after step #6). And even if you're not very comfortable with elisp, you could translate that macro into elisp using &lt;code&gt;insert-kbd-macro&lt;/code&gt; and try to hack it into a useful function.&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="654" LastEditDate="2015-02-23T17:11:22.663" LastActivityDate="2015-02-23T17:11:22.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9498" PostTypeId="2" ParentId="9495" CreationDate="2015-02-23T15:53:43.080" Score="5" Body="&lt;p&gt;If you're working on a well-defined project, you can use &lt;a href=&quot;http://emacswiki.org/emacs/OccurMode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;occur&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Grep-Searching.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;grep&lt;/code&gt;&lt;/a&gt; facilities within that project via &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;projectile&lt;/code&gt;&lt;/a&gt;.  Cribbing from its github description, among the various bits of functionality offered by &lt;code&gt;projectile&lt;/code&gt;, it can do:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;replace in project&lt;/li&gt;&#xA;&lt;li&gt;multi-occur in project buffers&lt;/li&gt;&#xA;&lt;li&gt;grep in project&lt;/li&gt;&#xA;&lt;li&gt;visit project in dired&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-23T15:53:43.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9499" PostTypeId="1" CreationDate="2015-02-23T15:58:32.820" Score="5" ViewCount="5908" Body="&lt;p&gt;I am a long term eclipse CDT user migrating to emacs (ver. 23.3.1), because I have to work on a large C codebase accessible only through a telnet/ssh shell. After going through several online guides, I have managed to get emacs work with cscope on the code. I have some minor issues with it (see below), I am asking it as a single question as I think they are very basic questions which any expert might know. If you feel they need to be split into multiple questions, please let me know&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For navigating the cscope buffer, there are commands available to jump to next and previous symbol (C-c s n, C-c s p). I am not able to find a command to open the file where the cursor is currently set. What I do currently is move the cursor to the previous symbol and do a C-c s n to open the file. This feels very unnatural, there should be a command to jump to current symbol&lt;/li&gt;&#xA;&lt;li&gt;Similar to cscope-find-global-definition, is there any command to jump to local definition. Sometimes while reading huge functions, it is helpful to quickly jump back to the definition of the variable. I understand this can be achieved by backward I-search, but it would be helpful to have a quick way to jump to definition.&lt;/li&gt;&#xA;&lt;li&gt;I created a cscope database using the command cscope -b -R -q, but emacs was returning 0 results for every lookup. Then I added (setq cscope-do-not-update-database t) to my .emacs and it started working. I looked into the description of the variable and it says that if the variable is non-nil it will never check/update the cscope database. How did setting it to True made my cscope to work. From the description I would have expected the opposite. What is that variable doing?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6581" LastEditorUserId="253" LastEditDate="2015-02-23T16:00:11.290" LastActivityDate="2017-07-20T16:54:11.037" Title="emacs cscope integration basics" Tags="|c|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9500" PostTypeId="2" ParentId="9487" CreationDate="2015-02-23T16:43:59.083" Score="2" Body="&lt;p&gt;After lots of trial and error I discovered what was wrong.&#xA;I just needed to escape twice the 'w' letter&#xA;Here is the final line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (&quot;\\b\\(\\w+\\)\\b=&quot; . font-lock-variable-name-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looks easy now :-) &lt;/p&gt;&#xA;" OwnerUserId="6546" LastActivityDate="2015-02-23T16:43:59.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9501" PostTypeId="2" ParentId="9495" CreationDate="2015-02-23T17:04:46.343" Score="5" Body="&lt;p&gt;Use rgrep and wgrep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With rgrep you can search all for a regexp in files which filename match a regexp and inside a directory (and its subdirs)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with wgrep you can edit the buffer containing the results of your rgrep search.&lt;/p&gt;&#xA;" OwnerUserId="2395" LastActivityDate="2015-02-23T17:04:46.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9502" PostTypeId="1" CreationDate="2015-02-23T17:32:43.120" Score="6" ViewCount="688" Body="&lt;p&gt;I would like to make a orgmode Clock report that groups tasks based on their &lt;strong&gt;category&lt;/strong&gt; rather than file name alone. This would allow me to have fewer todo files to navigate around in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could not find anything in the clocktable report reference about this. Is it possible to have such reports? (or even make the agenda clock report group things by category?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I got so far is to set the &lt;code&gt;:properties (&quot;Effort&quot; &quot;CATEGORY&quot;)&lt;/code&gt; . This shows the category column, but doesn't group by it.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2020-03-19T05:01:55.277" Title="Category based clock report?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9503" PostTypeId="1" AcceptedAnswerId="9552" CreationDate="2015-02-23T19:39:44.997" Score="9" ViewCount="1967" Body="&lt;p&gt;I'm particularly concerned with &lt;code&gt;git&lt;/code&gt;, but I imagine this is a good place to use &lt;code&gt;vc&lt;/code&gt;.  I want to emulate Atom's git integration with its file explorer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blog.atom.io/2014/03/13/git-integration.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/D5XSz.png&quot; alt=&quot;atom-git-integration&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get something like this in &lt;code&gt;dired&lt;/code&gt;?  I understand there are other tools for simulating a proper tree structure, but the normal &lt;code&gt;i/RET&lt;/code&gt; workflow should work just fine.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2024-03-02T05:04:38.843" Title="How can I visualize VCS status in dired?" Tags="|dired|git|" AnswerCount="4" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="9504" PostTypeId="1" AcceptedAnswerId="18713" CreationDate="2015-02-23T19:56:20.617" Score="1" ViewCount="277" Body="&lt;p&gt;Both &lt;code&gt;iy-go-to-char&lt;/code&gt; and &lt;code&gt;zap-up-to-char&lt;/code&gt; take a prefix argument and a character argument prompted for in the minibuffer. Both functions seems to implement this by using &lt;code&gt;(interactive &quot;p\ncPrompt string: &quot;)&lt;/code&gt;. But they behave very differently in &lt;code&gt;multiple-cursors-mode&lt;/code&gt;: &lt;code&gt;iy-go-to-char&lt;/code&gt; only prompts once for the character and uses that same one for every cursor; &lt;code&gt;zap-up-to-char&lt;/code&gt; prompts for a character for each cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know why multiple-cursors treats them differently, but above all I'd like to have them both behave as &lt;code&gt;iy-go-to-char&lt;/code&gt; does: single prompt, reuse that character for all cursors.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2015-12-08T22:40:10.227" LastActivityDate="2015-12-08T22:40:10.227" Title="Why does multiple-cursors use the same char for all cursors with iy-go-to-char, but not with zap-up-to-char?" Tags="|multiple-cursors|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9505" PostTypeId="2" ParentId="8093" CreationDate="2015-02-23T19:58:31.753" Score="5" Body="&lt;p&gt;Clock tables support a &lt;code&gt;:properties&lt;/code&gt; option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :properties (&quot;ALLTAGS&quot;)&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it turns out that tags are available by the &lt;em&gt;special&lt;/em&gt; property name &lt;code&gt;ALLTAGS&lt;/code&gt;. Here are the others:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Special-properties.html#Special-properties&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Special-properties.html#Special-properties&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6583" LastActivityDate="2015-02-23T19:58:31.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9506" PostTypeId="1" CreationDate="2015-02-23T20:08:30.900" Score="4" ViewCount="160" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I define sentence endings to be LaTeX macro-aware?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like &lt;code&gt;backward-sentence&lt;/code&gt; and &lt;code&gt;forward-sentence&lt;/code&gt; to be smarter about LaTeX macros -- particularly &lt;code&gt;\footnote&lt;/code&gt; -- when working in LaTeX buffers.  Consider the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here's some text in a LaTeX buffer.\footnote{And here's a footnote example.  It's got a couple of sentences.}  I wonder how I can get Emacs to recognize where the sentence endings occur?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If point is anywhere in what we would consider the first sentence (ie, before the &lt;code&gt;footnote&lt;/code&gt;), calling &lt;code&gt;forward-sentence&lt;/code&gt; takes point not to the period immediately before the &lt;code&gt;\footnote&lt;/code&gt; macro, but rather to the period after &quot;example&quot; within the footnote.  Likewise, if point is at the beginning of the second sentence in the footnote, &lt;code&gt;backward-sentence&lt;/code&gt; takes point not to the &quot;A&quot; in &quot;And&quot; at the beginning of the first sentence in the footnote, but rather to the &quot;H&quot; in &quot;Here's&quot; in the sentence that precedes the footnote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I fix the definition of a sentence to make Emacs aware of these macro-boundaries?&lt;/em&gt;  It looks like I would want to write a specific regexp for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/sentence_002dend.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;sentence-end&lt;/code&gt;&lt;/a&gt;, but before I start messing around with regexps, I was wondering if someone has already solved this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This &lt;a href=&quot;https://stackoverflow.com/questions/4754547/redefining-sentence-in-emacs-single-space-between-sentences-but-ignoring-ab&quot;&gt;S.O. thread&lt;/a&gt; asks a related question, but the accepted answer appears to involve writing custom &lt;code&gt;backward-sentence&lt;/code&gt; and &lt;code&gt;forward-sentence&lt;/code&gt; commands rather than redefining sentence boundaries per se.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-23T20:08:30.900" Title="LaTeX-aware sentence endings?" Tags="|latex|auctex|regular-expressions|sentences|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9507" PostTypeId="2" ParentId="9491" CreationDate="2015-02-23T21:34:34.387" Score="3" Body="&lt;p&gt;If I understood correctly, in comes the regex, out comes the list of&#xA;matched lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a starter for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(helm-occur-init-source)&#xA;(defvar helm-source-lines (copy-alist helm-source-occur))&#xA;(setcdr (assoc 'action helm-source-lines) 'helm-lines-action)&#xA;&#xA;(defun helm-lines-action (x)&#xA;  (with-current-buffer &quot;*helm lines*&quot;&#xA;    (cdr&#xA;     (split-string&#xA;      (buffer-substring-no-properties&#xA;       (point-min)&#xA;       (point-max))&#xA;      &quot;\n&quot;&#xA;      t))))&#xA;&#xA;(defun helm-lines ()&#xA;  &quot;Preconfigured helm for Occur.&quot;&#xA;  (interactive)&#xA;  (let ((bufs (list (buffer-name (current-buffer)))))&#xA;    (helm-attrset 'moccur-buffers bufs helm-source-lines)&#xA;    (helm-set-local-variable 'helm-multi-occur-buffer-list bufs)&#xA;    (helm-set-local-variable&#xA;     'helm-multi-occur-buffer-tick&#xA;     (cl-loop for b in bufs&#xA;        collect (buffer-chars-modified-tick (get-buffer b)))))&#xA;  (helm :sources 'helm-source-lines&#xA;        :buffer &quot;*helm lines*&quot;&#xA;        :truncate-lines t))&#xA;&#xA;(setq test (helm-lines))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want line numbers, you can change a few keys:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-source-lines&#xA;      (assq-delete-all 'filter-one-by-one helm-source-lines))&#xA;(setcdr (assoc 'get-line helm-source-lines)&#xA;        'buffer-substring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-23T21:34:34.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9508" PostTypeId="2" ParentId="8228" CreationDate="2015-02-23T21:54:49.470" Score="10" Body="&lt;p&gt;Clock tables support &lt;a href=&quot;http://orgmode.org/manual/The-clock-table.html&quot;&gt;formatting options&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :formatter my-org-clocktable-notodo&#xA;&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a function which removes &lt;code&gt;TODO&lt;/code&gt; and &lt;code&gt;DONE&lt;/code&gt; keywords from headlines before handing the data off to the default formatting function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-clocktable-notodo (ipos tables params)&#xA;  (cl-loop for tbl in tables&#xA;           for entries = (nth 2 tbl)&#xA;           do (cl-loop for entry in entries&#xA;                       for headline = (nth 1 entry)&#xA;                       do (setq headline (replace-regexp-in-string &quot;TODO \\|DONE &quot; &quot;&quot; headline))&#xA;                       do (setcar (nthcdr 1 entry) headline)))&#xA;  (org-clocktable-write-default ipos tables params))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another option would be to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advice-combinators.html#Advice-combinators&quot;&gt;advise&lt;/a&gt; `org-clocktable-write-default to have the keywords stripped from all clock tables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function would be smarter if it constructed the regexp of todo keywords dynamically according to those defined in the document. (maybe someone can add that)&lt;/p&gt;&#xA;" OwnerUserId="6586" LastActivityDate="2015-02-23T21:54:49.470" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9509" PostTypeId="2" ParentId="8106" CreationDate="2015-02-23T23:43:39.853" Score="1" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; then you can just use &lt;strong&gt;&lt;code&gt;M-:&lt;/code&gt;&lt;/strong&gt; to do what you request. It prompts you for a Lisp sexp, evaluates it, and appends the value to the search string.  You can use an &lt;code&gt;rx&lt;/code&gt; expression as the sexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-M-s M-: (rx (and line-start (1+ (in &quot;(&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;searches using the result of that ‘rx’ sexp, which is &lt;code&gt;^(+&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;strong&gt;Isearch+&lt;/strong&gt; you can also use &lt;code&gt;C-u M-:&lt;/code&gt; after &lt;code&gt;M-e&lt;/code&gt;, to insert the sexp value into the &lt;em&gt;minibuffer&lt;/em&gt;, where you are editing the search string. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;M-e&lt;/code&gt; lets you edit the search string, and with &lt;strong&gt;Isearch+&lt;/strong&gt; it lets you use a recursive minibuffer, so you can use &lt;code&gt;M-:&lt;/code&gt;, which itself reads from a minibuffer. In the minibuffer, &lt;code&gt;M-:&lt;/code&gt; is bound to its usual command, and for that, &lt;code&gt;C-u&lt;/code&gt; inserts the value returned at point - which in this case is at point in the parent minibuffer, from &lt;code&gt;M-e&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So use &lt;code&gt;M-e&lt;/code&gt; followed by &lt;code&gt;C-u M-:&lt;/code&gt; when you do not want to simply append the sexp value to the search string, but instead you want to do some editing of it or the rest of the search string.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-23T23:43:39.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9510" PostTypeId="1" AcceptedAnswerId="9521" CreationDate="2015-02-24T00:14:51.090" Score="6" ViewCount="354" Body="&lt;p&gt;Is there something like brace expansion in bash or zsh for eshell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For those unfamiliar with brace expansion: it is a part of shell expansion in some shells, such as bash or zsh that works as follows: if a word contains a list of words in braces, you get a list of copies of the word with the part in braces replaced by each of the words in the list in turn. This is clearer with an example: the command &lt;code&gt;blah x{a,b,c}y&lt;/code&gt; is transformed to &lt;code&gt;blah xay xby xcy&lt;/code&gt; by shell expansion, before running &lt;code&gt;blah&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that @rekado is right and there is no builtin, I wrote this short function that does brace-like expansion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun be (&amp;amp;rest args)&#xA;  (cond&#xA;   ((null args) '(&quot;&quot;))&#xA;   ((null (cdr args))&#xA;    (let ((hd (car args)))&#xA;      (cond&#xA;       ((vectorp hd) (cl-mapcan #'be hd))&#xA;       ((listp hd) (apply #'be hd))&#xA;       ((atom hd) (list (format &quot;%s&quot; hd))))))&#xA;   (t (let ((be-tl (be (cdr args)))&#xA;            (r '()))&#xA;        (dolist (x (be (car args)))&#xA;          (dolist (y be-tl)&#xA;            (push (concat x y) r)))&#xA;        (reverse r)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It uses lists (or simply passing multiple arguments) for sequencing and vectors to indicate choice. The atoms can be given as strings, symbols or numbers. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash$ echo a{b,c{d,e}f}{g,h}i&#xA;abgi abhi acdfgi acdfhi acefgi acefhi&#xA;&#xA;(be '(a [b (c [d e] f)] [g h] i))&#xA;(&quot;abgi&quot; &quot;abhi&quot; &quot;acdfgi&quot; &quot;acdfhi&quot; &quot;acefgi&quot; &quot;acefhi&quot;)&#xA;&#xA;(be 'a [b (c [d e] f)] [g h] 'i)&#xA;(&quot;abgi&quot; &quot;abhi&quot; &quot;acdfgi&quot; &quot;acdfhi&quot; &quot;acefgi&quot; &quot;acefhi&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2015-02-24T16:43:16.937" LastActivityDate="2015-02-24T16:43:16.937" Title="Is there something like brace expansion in eshell?" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9512" PostTypeId="1" CreationDate="2015-02-24T01:02:26.350" Score="4" ViewCount="1996" Body="&lt;p&gt;Not sure what's going on here, but if I open a file in emacs (no window mode), and just do a search (ctrl-s), the buffer gets garbled. It fixes itself when I ctrl-l, but that's annoying to have to do so frequently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using OS X's Terminal declaring terminal as xterm-256color. Text encoding Unicode (UTF-8).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm ssh-ing to a VM and launching emacs in that VM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qboBr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6588" LastEditorUserId="6588" LastEditDate="2015-02-24T04:36:02.160" LastActivityDate="2015-03-21T05:59:13.667" Title="Why does the buffer get garbled?" Tags="|terminal-emacs|ssh|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9513" PostTypeId="2" ParentId="9456" CreationDate="2015-02-24T01:34:40.423" Score="1" Body="&lt;p&gt;If you want to respect the user's indentation choice (as you should), the right way is to just do the right thing when indenting, you don't need to keep track if the variable was changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your two options are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead of manually removing/inserting whitespace at beginning-of-line, just use either &lt;code&gt;indent-to&lt;/code&gt; or &lt;code&gt;indent-line-to&lt;/code&gt;. These functions automatically respect the &lt;code&gt;indent-tabs-mode&lt;/code&gt; variable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you need to do it manually for some reason, just check the value of &lt;code&gt;indent-tabs-mode&lt;/code&gt; inside your indentation function and act accordingly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-02-24T01:34:40.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9514" PostTypeId="1" AcceptedAnswerId="9525" CreationDate="2015-02-24T03:21:48.647" Score="2" ViewCount="214" Body="&lt;p&gt;I usually ssh into a machine at my university and run emacs on screen.&#xA;I want to figure out what unicode strings code for a particular command ?&#xA;For example when I changed the preferences in my OSX terminal app and associated the following actions to keyboard buttons then Emacs interpreted them as useful command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Button  Action  Keystroke&#xA;end     \005    CTRL+e&#xA;home    \001    CTRL+a&#xA;pgdown  \026    CTRL+v&#xA;pgup    \033v   ESC v&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to make more such bindings. For example if I could find out the right action for &quot;Ctrl+_&quot;(Undo) then I could associate that to one of the useless function keys. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically how can I find out what &quot;Action&quot; triggers a Keystroke ?&lt;/p&gt;&#xA;" OwnerUserId="6589" LastActivityDate="2015-02-24T13:44:19.000" Title="How to find the unicode control string received by emacs for a command?" Tags="|key-bindings|terminal-emacs|ssh|keystrokes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9515" PostTypeId="1" AcceptedAnswerId="9516" CreationDate="2015-02-24T04:22:54.470" Score="1" ViewCount="176" Body="&lt;p&gt;&lt;strong&gt;QUESTION&lt;/strong&gt;:  Can Emacs help a user to pick colors in the form of a 3-element vector, and what does each element of that vector represent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:  I borrowed certain sections of code from &lt;code&gt;pong.el&lt;/code&gt; and &lt;code&gt;gamegrid.el&lt;/code&gt;, which use a color format of a 3-element vector.  At the time this question was initially written, I had never seen colors specified in that format before -- I wanted to use the same system, but had no idea how a particular color could be selected.  The following example places four (4) overlays at the beginning of the buffer, but requires a version of Emacs that supports displaying XPM images:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* (&#xA;    (counter 0)&#xA;    xpm-list&#xA;    (color-list '(&#xA;      [0 0 0]&#xA;      [1 1 0]&#xA;      [1 0 0]&#xA;      [0.5 0.5 0.5]))&#xA;    (form-feed-xpm&#xA;      &quot;/* XPM */&#xA;       static char * form_feed_xpm[] = {&#xA;       \&quot;11 20 5 1\&quot;,&#xA;       \&quot; s None\&quot;,&#xA;       \&quot;+ s col1\&quot;,&#xA;       \&quot;. s col2\&quot;,&#xA;       \&quot;% s col3\&quot;,&#xA;       \&quot;@ s purple\&quot;,&#xA;       \&quot;%%%%%%%%%%%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%...++++++%\&quot;,&#xA;       \&quot;%.++.++...%\&quot;,&#xA;       \&quot;%+...+....%\&quot;,&#xA;       \&quot;%+...+....%\&quot;,&#xA;       \&quot;%+...+....%\&quot;,&#xA;       \&quot;%+...++++.%\&quot;,&#xA;       \&quot;%....+....%\&quot;,&#xA;       \&quot;%...++....%\&quot;,&#xA;       \&quot;%...+.....%\&quot;,&#xA;       \&quot;%.++++....%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%.........%\&quot;,&#xA;       \&quot;%%%%%%%%%%%\&quot;};&quot;)&#xA;    (set-color (lambda (color shade)&#xA;      (let* ((v (floor (* shade 255)))&#xA;       (r (* v (aref color 0)))&#xA;       (g (* v (aref color 1)))&#xA;       (b (* v (aref color 2))))&#xA;        (format &quot;#%02x%02x%02x&quot; r g b))))&#xA;    (make-image&#xA;      (lambda (color)&#xA;        (let* (&#xA;            (col1 (funcall set-color color 0.6))&#xA;            (col2 (funcall set-color color 0.8))&#xA;            (col3 (funcall set-color color 1.0))&#xA;            (data `((:type xpm :data ,form-feed-xpm :ascent center&#xA;               :color-symbols&#xA;                ((&quot;col1&quot; . ,col1)(&quot;col2&quot; . ,col2) (&quot;col3&quot; . ,col3)))))&#xA;            (image (find-image data)) )&#xA;          (push image xpm-list)))) )&#xA;    (mapcar&#xA;      (lambda (x)&#xA;        (funcall make-image x))&#xA;      color-list)&#xA;    (mapcar&#xA;      (lambda (x)&#xA;        (overlay-put&#xA;          (make-overlay&#xA;            (+ (point-min) counter) (+ (point-min) (1+ counter)))&#xA;          'display x)&#xA;        (setq counter (1+ counter)))&#xA;      (reverse xpm-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-02-24T17:54:11.103" LastActivityDate="2015-02-24T18:01:49.313" Title="How to pick colors using Emacs to generate a 3-element vector" Tags="|colors|overlays|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9516" PostTypeId="2" ParentId="9515" CreationDate="2015-02-24T05:45:57.593" Score="1" Body="&lt;p&gt;As stated by @Drew in the comment below this answer, there are a number of libraries that Emacs can use to help a user pick colors -- e.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/download/hexrgb.el&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/download/hexrgb.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/download/palette.el&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/download/palette.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;colors.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x list-colors-display&lt;/code&gt; and then converting the hex shown to a decimal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the issue of what each of the three elements of the color vector represent, the following is a general summary:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;first&lt;/strong&gt; element of the vector is &lt;code&gt;red&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;second&lt;/strong&gt; element of the vector is &lt;code&gt;green&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;third&lt;/strong&gt; element of the vector is &lt;code&gt;blue&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The elements are equal to percentages, with 0 being 0% of that particular color, and 1 being 100% percent of that particular color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:  vector color = [1  .5  0] = 100% red, 50% green, 0% blue = orange&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-02-24T18:01:49.313" LastActivityDate="2015-02-24T18:01:49.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9517" PostTypeId="1" AcceptedAnswerId="10408" CreationDate="2015-02-24T08:54:03.283" Score="10" ViewCount="2776" Body="&lt;p&gt;I'm using emacs inside a mintty (configured to say it's xterm-256color) terminal on cygwin. &lt;code&gt;list-colors-display&lt;/code&gt; works fine. and colors are displayed in dired listings etc. Now I set the color for &lt;code&gt;git branch&lt;/code&gt; current branch to be &lt;code&gt;yellow reverse&lt;/code&gt;. However, neither shell nor eshell windows display the correct color; instead, the current branch is shown in default color. In an &lt;code&gt;ansi-term&lt;/code&gt; window, or Outside of emacs, inside the same terminal, it displays as it should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this in my &lt;code&gt;.emacs&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'eshell-preoutput-filter-functions  'ansi-color-apply)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any way to get these colors to display inside the shell or eshell windows?&lt;/p&gt;&#xA;" OwnerDisplayName="user6590" LastActivityDate="2015-03-30T15:07:03.057" Title="Colored git output in eshell" Tags="|eshell|colors|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9518" PostTypeId="2" ParentId="9499" CreationDate="2015-02-24T09:55:06.890" Score="3" Body="&lt;p&gt;You can check my &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;C/C++ guide&lt;/a&gt; for all the needs above:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You can use &lt;a href=&quot;http://www.gnu.org/software/global/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Global&lt;/a&gt; with &lt;a href=&quot;https://github.com/leoliu/ggtags&quot; rel=&quot;nofollow noreferrer&quot;&gt;ggtags&lt;/a&gt; or &lt;a href=&quot;https://github.com/syohex/emacs-helm-gtags&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm-gtags&lt;/a&gt;, which can be installed through &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt;. GNU Global can use cscope backend, but you should use its native backend for generating tag datdabase for C/C++ code. You can jump to definitions or references instantly, even for project as large as Linux kernel. Here is a demo of how you can select all available tags in your project:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fwUkj.gif&quot; alt=&quot;helm-gtags-select&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following my &lt;code&gt;ggtags&lt;/code&gt; or &lt;code&gt;helm-gtags&lt;/code&gt; in my guide, you can jump to any definition with &lt;code&gt;ggtags-find-tag-dwim&lt;/code&gt; or &lt;code&gt;helm-gtags-dwim&lt;/code&gt; which is bound to &lt;kbd&gt;M-.&lt;/kbd&gt; and jump back where you were with &lt;kbd&gt;M-,&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;You don't need to jump back to local definition to see the details. Simply using &lt;code&gt;semantic-idle-summary-mode&lt;/code&gt;, it will show definition of any variable/function/class/struct at point like this, automatically: &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Demo 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/D391D.jpg&quot; alt=&quot;semantic-idle-summary-mode1&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Demo 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZawL0.gif&quot; alt=&quot;semantic-idle-summary-mode2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Demo 3:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/B95Eu.gif&quot; alt=&quot;semantic-idle-summary-mode3&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in the screenshot, the function signature of &lt;code&gt;find_if&lt;/code&gt; is shown in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also keep the definition of current function always visible at the top like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0UQrE.gif&quot; alt=&quot;semantic-sticky-func-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable those features, add this configuration to your init file (either &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(semantic-mode 1)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;https://github.com/nschum/highlight-symbol.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight-symbol&lt;/a&gt; (you can install from &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt; to highlight and jump back and forth occurrences of the same symbol in buffer with the following configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'highlight-symbol)&#xA;&#xA;(highlight-symbol-nav-mode)&#xA;&#xA;(add-hook 'prog-mode-hook (lambda () (highlight-symbol-mode)))&#xA;(add-hook 'org-mode-hook (lambda () (highlight-symbol-mode)))&#xA;&#xA;(setq highlight-symbol-idle-delay 0.2&#xA;      highlight-symbol-on-navigation-p t)&#xA;&#xA;(global-set-key (kbd &quot;M-n&quot;) 'highlight-symbol-next)&#xA;(global-set-key (kbd &quot;M-p&quot;) 'highlight-symbol-prev)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that, you can jump back and forth with &lt;kbd&gt;M-p&lt;/kbd&gt; and &lt;kbd&gt;M-n&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Use GNU Global to look thins up. It just works.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You may want to check &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor&quot; rel=&quot;nofollow noreferrer&quot;&gt;Semantic Refactor&lt;/a&gt;, a package for common refactoring tasks (i.e. rename local variables easy and precisely, extract a piece of code into a separate function...). Here are &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor/blob/master/srefactor-demos/demos.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;the demos&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to try before going through all installation and configuration, use my &lt;a href=&quot;https://github.com/tuhdo/emacs-c-ide-demo&quot; rel=&quot;nofollow noreferrer&quot;&gt;demo Emacs kit&lt;/a&gt; made for the guide:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone https://github.com/tuhdo/emacs-c-ide-demo.git ~/.emacs.d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Semantic Refactor requires at least Emacs 24.4 or latest CEDET to work properly.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-02-25T06:27:56.103" LastActivityDate="2015-02-25T06:27:56.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9519" PostTypeId="1" AcceptedAnswerId="9520" CreationDate="2015-02-24T11:02:21.783" Score="3" ViewCount="799" Body="&lt;p&gt;Converting a subversion repo to git, and setting up an authors file. I'm running &lt;code&gt;query-replace-regexp&lt;/code&gt; on this text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;E001234&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;using this regexp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^\(.*\)$ -&amp;gt; \1 = Some Lowercase Text Here &amp;lt;email@example.com&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I execute the replacement, the replacement text is being capitalized like this, due to the case sensitive nature of replacements: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;E001234 = SOME LOWERCASE TEXT HERE &amp;lt;EMAIL@EXAMPLE.COM&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand what's happening, but is there a way to turn this off w/o writing a custom function (trivial, but still...)?&lt;/p&gt;&#xA;" OwnerUserId="523" LastEditorUserId="5143" LastEditDate="2015-03-08T02:11:38.633" LastActivityDate="2015-03-08T02:11:38.633" Title="Turn case sensitivity off in regular expression replacement" Tags="|regular-expressions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9520" PostTypeId="2" ParentId="9519" CreationDate="2015-02-24T11:18:03.723" Score="3" Body="&lt;p&gt;You can set the variable &lt;code&gt;case-replace&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; before executing the command.  Then you will get the following replacement &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;E001234 = Some Lowercase Text Here &amp;lt;email@example.com&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as expected.  When &lt;code&gt;case-replace&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt; it preserves case in replacements, i.e. the case of the replacement matches that of the matched text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, there is also the variable &lt;code&gt;case-fold-search&lt;/code&gt; which also affects case in the match and as well as the replacement.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-02-24T11:25:05.507" LastActivityDate="2015-02-24T11:25:05.507" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9521" PostTypeId="2" ParentId="9510" CreationDate="2015-02-24T11:25:47.043" Score="6" Body="&lt;p&gt;As far as I know there is no built-in support for brace expansion.  You can, however, use plain elisp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls -la (mapcar (lambda (x) (concat &quot;prefix-&quot; x &quot;.suffix&quot;)) '(&quot;A&quot; &quot;B&quot; &quot;C&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will run &lt;code&gt;ls -la&lt;/code&gt; on the list &lt;code&gt;(&quot;prefix-A.suffix&quot; &quot;prefix-B.suffix&quot; &quot;prefix-C.suffix&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's another solution.  Define this function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eshell-brace-expansion (str)&#xA;  (let* ((parts (split-string str &quot;[{}]&quot;))&#xA;         (prefix (car parts))&#xA;         (body   (nth 1 parts))&#xA;         (suffix (nth 2 parts)))&#xA;    (mapcar (lambda (x) (concat prefix x suffix))&#xA;            (split-string body &quot;,&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use this on the eshell prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls (eshell-brace-expansion &quot;prefix-{A,B,C}.suffix&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or this if you prefer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls &quot;prefix-{A,B,C}.suffix&quot;(|eshell-brace-expansion)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe automatic handling of braces should be added to eshell upstream.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-02-24T12:18:54.320" LastActivityDate="2015-02-24T12:18:54.320" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9522" PostTypeId="1" AcceptedAnswerId="9523" CreationDate="2015-02-24T11:37:27.760" Score="1" ViewCount="119" Body="&lt;p&gt;More then once when I have been reviewing changes to be committed in magit, the pending changes have unexpectedly disappeared from the status buffer. I'm pretty sure it's because I am accidentally hitting some key, but I have no idea which key. It is as if I told magit to ignore all uncommitted changes. If I close out of emacs completely, open the appropriate file, and run &lt;code&gt;magit-status&lt;/code&gt;, then the uncommitted changes will have returned as expected and I can go ahead an commit them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What key or function might be causing saved, uncommitted changes to be temporarily hidden or ignored like that? If I do it again, what else can I try next time, instead of closing emacs, that might make them visible again? &lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="306" LastEditDate="2015-12-30T00:08:03.397" LastActivityDate="2015-12-30T00:10:22.073" Title="What is happening when my uncommitted changes temporarily disappear from magit?" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9523" PostTypeId="2" ParentId="9522" CreationDate="2015-02-24T12:31:55.190" Score="5" Body="&lt;p&gt;Hitting &lt;kbd&gt;TAB&lt;/kbd&gt; while on a section header (e.g. &lt;em&gt;Unstaged Changes&lt;/em&gt; or &lt;em&gt;Untracked Files&lt;/em&gt;) collapses that section. Hitting &lt;kbd&gt;TAB&lt;/kbd&gt; again expands the section again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done this several times since some part of my brain thinks tabbing between the sections is a thing one can do (but my brain is wrong in this case).&lt;/p&gt;&#xA;" OwnerUserId="245" LastEditorUserId="306" LastEditDate="2015-12-30T00:10:22.073" LastActivityDate="2015-12-30T00:10:22.073" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9524" PostTypeId="2" ParentId="9491" CreationDate="2015-02-24T12:42:55.790" Score="0" Body="&lt;p&gt;Here is what I came up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my--helm-source-init ()&#xA;  (helm-candidate-buffer &amp;lt;buffer containing data&amp;gt;))&#xA;&#xA;(defun my--helm-source-select-action (candidate)&#xA;  (loop for candidate in (helm-marked-candidates)&#xA;        ... I can do whatever I want with the selected lines here...&#xA;&#xA;(defclass my--helm-source (helm-source-in-buffer)&#xA;  ((init :initform #'my--helm-source-init)&#xA;   (nohighlight :initform t)&#xA;   (action :initform (helm-make-actions&#xA;                      &quot;Select&quot; #'my--helm-source-select-action))&#xA;   (requires-pattern :initform 0)))&#xA;&#xA;(defun my-search-with-helm ()&#xA;  (interactive)&#xA;  (helm&#xA;   :prompt &quot;entry: &quot;&#xA;   :sources (helm-make-source &quot;Entries&quot; 'my--helm-source)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2222" LastActivityDate="2015-02-24T12:42:55.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9525" PostTypeId="2" ParentId="9514" CreationDate="2015-02-24T13:44:19.000" Score="1" Body="&lt;p&gt;Two steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In any buffer, do a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Inserting-Text.html&quot; rel=&quot;nofollow&quot;&gt;quoted insert&lt;/a&gt; of the key sequence. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-q&lt;/kbd&gt; &lt;kbd&gt;C-e&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of calling &lt;code&gt;move-end-of-line&lt;/code&gt; (the command that &lt;code&gt;C-e&lt;/code&gt; is bound to by default), Emacs will insert &lt;code&gt;^E&lt;/code&gt; at point.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hit &lt;kbd&gt;C-b&lt;/kbd&gt; to put point on the character you just inserted, then do &lt;kbd&gt;C-x =&lt;/kbd&gt; (bound to &lt;code&gt;what-cursor-position&lt;/code&gt;). Emacs will print relevant information about the character at point in the minibuffer. For &lt;code&gt;^E&lt;/code&gt;, you'll see this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Char: C-e (5, #o5, #x5) point=1 of 1 (0%) column=0&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This tells you that the character code for &lt;code&gt;C-e&lt;/code&gt; is &lt;code&gt;5&lt;/code&gt; in octal, &lt;code&gt;#o5&lt;/code&gt; in decimal, and &lt;code&gt;#x5&lt;/code&gt; in hex.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Following these steps for the other key sequences you listed, it looks like &quot;Actions&quot; are derived from the decimal notation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Key Sequence | Output of C-x =               | Action |&#xA;|--------------+-------------------------------+--------|&#xA;| ^E           | Char: C-e (5, #o5, #x5)       | \005   |&#xA;| ^A           | Char: C-a (1, #o1, #x1)       | \001   |&#xA;| ^V           | Char: C-v (22, #o26, #x16)    | \026   |&#xA;| ^[           | Char: ESC (27, #o33, #x1b)    | \033   |&#xA;|--------------+-------------------------------+--------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In short:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Char code | Action |&#xA;|-----------+--------|&#xA;| #o5       | \005   |&#xA;| #o1       | \001   |&#xA;| #o26      | \026   |&#xA;| #o33      | \033   |&#xA;|-----------+--------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you'll need to follow this pattern when determining the correct &quot;Action&quot; for a given char code.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-02-24T13:44:19.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9526" PostTypeId="1" AcceptedAnswerId="9531" CreationDate="2015-02-24T13:53:05.433" Score="1" ViewCount="944" Body="&lt;p&gt;&lt;code&gt;Autocomplete&lt;/code&gt; for Go code (fantastically) suggests functions and helpfully shows the documentation for the function, e.g. arguments and return types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HtzNj.png&quot; alt=&quot;Example completion&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I hit &lt;code&gt;tab&lt;/code&gt;, the &lt;code&gt;DialHTTP&lt;/code&gt; function is inserted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: is it possible to insert a &quot;template&quot; of the argument call?  Since &lt;code&gt;autocomplete&lt;/code&gt; shows the arguments, I would like to have this line inserted when I press &lt;code&gt;tab&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;client, err := rpc.DialHTTP(network, address)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I can replace the arguments with my arguments.&lt;/p&gt;&#xA;" OwnerUserId="6593" LastEditorUserId="594" LastEditDate="2015-02-24T16:10:30.460" LastActivityDate="2016-06-05T14:43:39.833" Title="Extending autocomplete for Go to insert function arguments" Tags="|auto-complete-mode|programming|golang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9527" PostTypeId="1" CreationDate="2015-02-24T14:34:06.080" Score="3" ViewCount="321" Body="&lt;p&gt;By default reftex-mode recognizes LaTeX-like citations, which have a format like &lt;code&gt;\cite{Smith15}&lt;/code&gt;.  (Locating the cursor above a reference shows a description of it in the mini-buffer and pressing &lt;code&gt;C-&amp;amp;&lt;/code&gt; opens the bibliography file in the right spot). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like reftex-mode to also recognize my Pandoc-like citations, which have a format like &lt;code&gt;@Smith15&lt;/code&gt; (regexp:&lt;code&gt;&quot;@[A-Z][A-Za-z0-9]+&quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reftex-mode has some functions that allow extending it (e.g., &lt;code&gt;reftex-cite-format&lt;/code&gt;, &lt;code&gt;reftex-view-crossref-extra&lt;/code&gt;), but it is not clear how to use them to detect this type of citation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="2274" LastEditDate="2015-02-26T01:55:01.093" LastActivityDate="2015-11-23T14:48:35.933" Title="Make reftex-mode work with a different citation format" Tags="|latex|markdown|reftex-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9528" PostTypeId="1" AcceptedAnswerId="9544" CreationDate="2015-02-24T14:40:24.963" Score="20" ViewCount="2134" Body="&lt;p&gt;Is it possible to replace '\emsp' with just plain spaces?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e,&#xA;In Clock reports, there are a lot of these '\emsp's. (See example below.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm able to get rid of them by setting ':indent nil'. But this removes all indent altogether, which is undersirable. I can also get rid of them if I export things. But in the Agenda view I don't export reports and the \emsp's are just a visual distraction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I was able to remove 'TODO' keywords via formatter &lt;a href=&quot;https://emacs.stackexchange.com/questions/8228/remove-task-state-keywords-todo-done-from-clocktable-reports&quot;&gt;as described here&lt;/a&gt;. But the formatter doesn't seem to see the '\emsp' and can't remove them. It kinda seems like they are added after.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|-----------+-------------------------------------------------------------------+---------+------|&#xA;| dev.org   | *File time*                                                       | *9:54*  |      |&#xA;|           | Dev                                                               | 9:54    |      |&#xA;|           | \emsp Configure VMs for testing [[elisp:(my/goto-parent)][parent]]                            |         | 5:03 |&#xA;|           | \emsp test if DND works in outline view in Mars (4.5) Build id: I20150217-0800 has outline view fixed (RHBZ#1012336). |         | 0:16 |&#xA;|           | \emsp GtkMenuItem directly instead of GtkImageMenuItem            |         | 1:28 |&#xA;|           | \emsp Bug 459487 - [GTK] Replace deprecated gtk_arrow_* with gtk_image |         | 1:31 |&#xA;|           | \emsp General                                                     |         | 1:36 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-01-23T03:16:38.390" Title="Is it possible to remove '\emsp' from clock report but preserve indentation?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9529" PostTypeId="1" AcceptedAnswerId="9977" CreationDate="2015-02-24T15:01:50.487" Score="0" ViewCount="495" Body="&lt;p&gt;I like being able to filter by tag and I like to use helm-org-in-buffer-heading &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;helm&lt;/a&gt;/ worf-goto &lt;a href=&quot;https://github.com/abo-abo/worf&quot; rel=&quot;nofollow&quot;&gt;worf&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to combine them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e, with Worf-goto I can search headings and their tags, but it doesn't list headings that should inherit the tag. e.g&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Emacs tasks :emacs:&#xA;** Figure out ultimate macro that will do my work for me&#xA;** Make emacs make my coffee in the morning&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I search for ':emacs ultimate', ideally it should match the 1st sub-item, but worf-goto/helm-heading search doesn't. It can either find the line with :emacs: or the line with 'ultimate', it can't match them both. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The agenda view C-c s kinda works. I can first do a search and then narrow down via tags. But this is a 2 step process and it only works on agenda files. I have a lot of non-agenda org files that I'd like to parse with heading/tag combo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thoughts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt;&lt;br&gt;&#xA;At the moment I'm tagging every headings with all the tags (e.g below) and I'm looking forward to the day where I can make use of the inheritance instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Emacs tasks :emacs:&#xA;** Figure out ultimate macro that will do my work for me  :emacs:&#xA;** Make emacs make my coffee in the morning  :emacs:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-02-24T16:05:10.930" LastActivityDate="2019-03-23T12:54:11.777" Title="Is it possible to do helm-org-in-buffer-heading with matching of inherited tags?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9530" PostTypeId="1" AcceptedAnswerId="9532" CreationDate="2015-02-24T15:45:53.200" Score="26" ViewCount="8951" Body="&lt;p&gt;When I edit large documents, I would like to see where I'm at by seeing the outline (with no-content) in a separate buffer. Like when you read a PDF file there is a TOC on the left. (see below)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In org-mode it's possible to expand/collapse outline. But is it possible to have a static outline in the left(or right) in a separate buffer so that when you click on the headings, the other buffer moves to that position?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kinda like this but for org-mode?&#xA;&lt;img src=&quot;https://i.stack.imgur.com/fu71f.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;br&gt;&#xA;The &lt;code&gt;clone-indirect-buffer&lt;/code&gt; is very close to what I want. The missing piece of the puzzle is to jump to the same location when clicking a heading/(or any point really).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this I have tried to write some code: &lt;a href=&quot;https://emacs.stackexchange.com/questions/9536/move-to-other-cloned-buffer-to-same-point-sync-position-of-indirect-buffers&quot;&gt;Move to other cloned buffer to same point? (sync position of indirect buffers) (org-mode)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it doesn't function if content is collapsed. If that can be made to work, then the clone-inderect-buffer is a complete solution to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit2 Solution]&lt;/strong&gt;&lt;br&gt;&#xA;The code in the link above and in the answer below combine niceley to solve the jumping back and forth. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;first call 'clone-indirect-buffer'. Then...&#xA;&#xA;;This function works between buffer and it's clone.&#xA;(defun my/goto-same-spot-in-other-buffer () &#xA;  &quot;Go to the same location in the other buffer. Useful for when you have cloned indirect buffers&quot;&#xA;  (interactive)&#xA;  (let ((my/goto-current-point (point)))&#xA;       (other-window 1)&#xA;       (goto-char my/goto-current-point)&#xA;       (when (invisible-p (point))&#xA;        (org-reveal)))&#xA;)&#xA;&#xA;;This function is a clone-to-buffer jump only:&#xA;; It does find the other buffer first thou instead of just jumping to the other &#xA;; window as does the function above.&#xA;(defun my/jump-to-point-and-show ()&#xA;  &quot;Switch to a cloned buffer's base buffer and move point to the&#xA;cursor position in the clone.&quot;&#xA;  (interactive)&#xA;  (let ((buf (buffer-base-buffer)))&#xA;    (unless buf&#xA;      (error &quot;You need to be in a cloned buffer!&quot;))&#xA;    (let ((pos (point))&#xA;          (win (car (get-buffer-window-list buf))))&#xA;      (if win&#xA;          (select-window win)&#xA;        (other-window 1)&#xA;        (switch-to-buffer buf))&#xA;      (goto-char pos)&#xA;      (when (invisible-p (point))&#xA;        (show-branches)))))&#xA;&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;s-mouse-1&amp;gt;&quot;) 'my/goto-same-spot-in-other-buffer)&#xA;(global-set-key (kbd &quot;s-m&quot;) 'my/goto-same-spot-in-other-buffer)&#xA;(global-set-key (kbd &quot;&amp;lt;C-s-mouse-1&amp;gt;&quot;) 'my/jump-to-point-and-show)&#xA;(global-set-key (kbd &quot;C-s-m&quot;) 'my/jump-to-point-and-show)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2019-10-01T12:59:05.190" Title="How can I get an org-mode outline in a 2nd buffer as a dynamic table of contents?" Tags="|org-mode|elisp|indirect-buffers|" AnswerCount="6" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9531" PostTypeId="2" ParentId="9526" CreationDate="2015-02-24T15:50:53.667" Score="2" Body="&lt;p&gt;If you install &lt;code&gt;yasnippet&lt;/code&gt; and &lt;code&gt;ac-go-expand-arguments-into-snippets&lt;/code&gt; is non-nil(Default is &lt;code&gt;t&lt;/code&gt;) then argument snippet is expanded like following animation gif.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Bd8Om.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/company-mode/company-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-mode&lt;/a&gt; provides such feature by itself, so you can use it without &lt;code&gt;yasnippet&lt;/code&gt; by &lt;code&gt;company-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5415" LastActivityDate="2015-02-24T15:50:53.667" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9532" PostTypeId="2" ParentId="9530" CreationDate="2015-02-24T16:08:56.337" Score="10" Body="&lt;p&gt;A few options come to mind.  The first two are &lt;a href=&quot;http://emacswiki.org/emacs/SpeedBar&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;speedbar&lt;/code&gt;&lt;/a&gt;, which allegedly plays well with &lt;code&gt;org-mode&lt;/code&gt;, and &lt;a href=&quot;http://www.emacswiki.org/emacs/MiniMap&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;minimap&lt;/code&gt;&lt;/a&gt;, although I've not used them so can't vouch for them personally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What might be the simplest option (and also the most flexible), would be to use an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html&quot; rel=&quot;noreferrer&quot;&gt;indirect buffer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, you would go to the &lt;code&gt;org&lt;/code&gt; buffer for which you'd like an outline, hit &lt;code&gt;M-x clone-indirect-buffer&lt;/code&gt; (use &lt;code&gt;C-u M-x clone-indirect-buffer&lt;/code&gt; if you'd like to control what the clone is called), and then boom, there's another copy of the buffer for you to use.  Put that clone in a window or frame side-by-side with the original buffer and, in the clone, adjust the outline to your tastes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't get you the &quot;click on heading in outline&quot; functionality you mentioned, but gets you the spirit of the sidebar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; in response to your comment, here's a simple command that, when invoked from the &lt;em&gt;buffer clone&lt;/em&gt;, will switch to the &lt;em&gt;base buffer&lt;/em&gt; and move point to wherever the cursor was in the buffer clone:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jump-to-point-and-show ()&#xA;  &quot;Switch to a cloned buffer's base buffer and move point to the&#xA;cursor position in the clone.&quot;&#xA;  (interactive)&#xA;  (let ((buf (buffer-base-buffer)))&#xA;    (unless buf&#xA;      (error &quot;You need to be in a cloned buffer!&quot;))&#xA;    (let ((pos (point))&#xA;          (win (car (get-buffer-window-list buf))))&#xA;      (if win&#xA;          (select-window win)&#xA;        (other-window 1)&#xA;        (switch-to-buffer buf))&#xA;      (goto-char pos)&#xA;      (when (invisible-p (point))&#xA;        (show-branches)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-08-23T17:48:40.007" LastActivityDate="2015-08-23T17:48:40.007" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9533" PostTypeId="1" AcceptedAnswerId="9551" CreationDate="2015-02-24T17:12:58.750" Score="3" ViewCount="757" Body="&lt;p&gt;I'm toying around with Org-mode and Speedbar/Sr-speedbar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like that it shows Task and subtasks. But it doesn't show anything lower, e.g:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Task (shown)&#xA;** subtask (shown)&#xA;*** Sub-sub task (not shown)&#xA;**** sub sub sub task (not shown)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible for it to actually show full depth?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-02-25T02:14:49.217" Title="Speedbar and org-mode only shows subheadings, but not 3rd level+ subheadings?" Tags="|org-mode|speedbar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9534" PostTypeId="1" AcceptedAnswerId="9539" CreationDate="2015-02-24T17:26:14.403" Score="3" ViewCount="1244" Body="&lt;p&gt;Suppose I store the current mark into a variable using &lt;code&gt;mark&lt;/code&gt; or &lt;code&gt;(mark-marker)&lt;/code&gt;. Then I move point elsewhere and insert some text. Which function should I use to jump to the saved mark?&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="105" LastEditDate="2016-08-22T00:56:13.263" LastActivityDate="2016-08-22T00:56:13.263" Title="How to jump to a mark using Elisp" Tags="|mark|mark-ring|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9535" PostTypeId="2" ParentId="9534" CreationDate="2015-02-24T17:31:52.540" Score="2" Body="&lt;p&gt;The &lt;code&gt;goto-char&lt;/code&gt; function works. It will teleport you to the mark in the same buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(goto-char (mark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-24T17:31:52.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9536" PostTypeId="1" AcceptedAnswerId="9538" CreationDate="2015-02-24T17:36:08.907" Score="5" ViewCount="469" Body="&lt;p&gt;I like to &lt;code&gt;clone-indirect-buffer&lt;/code&gt; . But then once in a while, I want to move to the other buffer and go to the same position as in the previous marker. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is usually the case when I use the indirect buffer as an 'outline' and want to &lt;code&gt;s-mouse-1&lt;/code&gt; to move the other buffer to the same spot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to hack together the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/goto-same-spot-in-other-buffer () &#xA;  &quot;Go to the same location in the other buffer. Useful for when you have cloned indirect buffers&quot;&#xA;  (interactive)&#xA;  (let ((my/goto-current-point (point)))&#xA;       (other-window 1)&#xA;       (goto-char my/goto-current-point)&#xA;       (org-reveal))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work properly if the other buffer's content isn't fully expanded. I.e it doesn't jump into content that is collapsed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;&lt;br&gt;&#xA;&lt;code&gt;org-reveal&lt;/code&gt; did the job. (added to the code above).&#xA;Can the above be modified so that it expands sections properly if they are not expanded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit2]&lt;/strong&gt;&lt;br&gt;&#xA;This may be of interest to future readers. In &lt;a href=&quot;https://emacs.stackexchange.com/questions/9530/org-mode-is-it-possible-to-see-only-outline-in-2nd-buffer-like-dynamic-table&quot;&gt;this&lt;/a&gt; post it dissucsses a dynamic TOC where I use the function above as well as another function that first finds the other buffer. You might want to check it out. &lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="105" LastEditDate="2023-02-14T17:09:14.470" LastActivityDate="2023-02-14T17:09:14.470" Title="Move to other cloned buffer to same point? (sync position of indirect buffers) (org-mode)" Tags="|org-mode|indirect-buffers|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9537" PostTypeId="1" CreationDate="2015-02-24T17:48:00.680" Score="11" ViewCount="2996" Body="&lt;p&gt;Is it possible to have only one mode line (sometimes referred as &quot;statusbar&quot;) for all windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to make this single mode line show information about the currently selected buffer.&lt;/p&gt;&#xA;" OwnerUserId="6596" LastEditorUserId="6596" LastEditDate="2015-02-25T13:21:59.977" LastActivityDate="2018-04-26T12:28:04.520" Title="Single mode line for all windows" Tags="|buffers|window|frames|mode-line|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9538" PostTypeId="2" ParentId="9536" CreationDate="2015-02-24T18:11:18.647" Score="4" Body="&lt;p&gt;From the &lt;a href=&quot;http://orgmode.org/manual/Global-and-local-cycling.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-mode&lt;/code&gt; global/local cycling documentation&lt;/a&gt;, the &lt;code&gt;org-reveal&lt;/code&gt; command should do the trick. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Reveal context around point, showing the current entry, the following heading and the hierarchy above. Useful for working near a location that has been exposed by a sparse tree command (see Sparse trees) or an agenda command (see Agenda commands). With a prefix argument show, on each level, all sibling headings. With a double prefix argument, also show the entire subtree of the parent. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So call &lt;code&gt;(org-reveal)&lt;/code&gt; in the elisp.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-24T18:11:18.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9539" PostTypeId="2" ParentId="9534" CreationDate="2015-02-24T18:24:29.557" Score="4" Body="&lt;p&gt;Save the mark as a marker:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq my-var (mark-marker))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(goto-char my-var)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works regardless of the buffer where you set the variable to the marker:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((buf  (marker-buffer foo)))&#xA;  (switch-to-buffer buf)(goto-char foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you want to go to that place temporarily, in Lisp code (i.e., without switching to that buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer (marker-buffer foo)&#xA;  (goto-char foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:23:19.147" LastActivityDate="2015-05-09T20:23:19.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9540" PostTypeId="1" AcceptedAnswerId="9541" CreationDate="2015-02-24T19:02:24.463" Score="2" ViewCount="168" Body="&lt;p&gt;Given that I have a file such as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem&#xA;&#xA;&#xA;Ipsum&#xA;&#xA;Dolor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to insert strings (here, the % character) to those empty lines to obtain&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem&#xA;%&#xA;%&#xA;Ipsum&#xA;%&#xA;Dolor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I do this? I tried to follow a way similar to the methods defined &lt;a href=&quot;http://www.masteringemacs.org/article/removing-blank-lines-buffer&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; without success.&lt;/p&gt;&#xA;" OwnerUserId="47" LastActivityDate="2015-02-25T04:37:12.517" Title="Replacing every empty line with a string, i.e. inserting strings to empty lines" Tags="|replace|regular-expressions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9541" PostTypeId="2" ParentId="9540" CreationDate="2015-02-24T19:05:52.513" Score="3" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun filibuster (str)&#xA;  (interactive &quot;sString: &quot;)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward &quot;^$&quot; nil t)&#xA;      (replace-match str))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-24T19:05:52.513" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9542" PostTypeId="1" CreationDate="2015-02-24T19:18:37.847" Score="3" ViewCount="2306" Body="&lt;p&gt;I want to manage simple personal databases, like mp3 collections.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not aware of any updated lisp object database project working in Emacs (correct me if I am wrong). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would turn to Sqlite, because it seems the only viable serverless database (right?). Have you experience with some library to create or query tables? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not particularly interested to Emacs SQL modes, but to libraries sending commands to DBs. &lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2015-03-26T19:41:53.097" Title="Interface with Sqlite" Tags="|files|data-structures|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9543" PostTypeId="2" ParentId="9542" CreationDate="2015-02-24T19:28:09.717" Score="3" Body="&lt;p&gt;The most popular package on &lt;a href=&quot;http://melpa.org&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt; is &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-esqlite&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;esqlite&lt;/code&gt;&lt;/a&gt;. Here's a simple example of its usage:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'esqlite)&#xA;(esqlite-read &quot;database.sqlite&quot; &quot;SELECT * FROM hoge&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Your other option is the &lt;a href=&quot;https://github.com/cnngimenez/sqlite.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;sqlite&lt;/code&gt;&lt;/a&gt; package, also from MELPA. An example snippet with that packages API is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'sqlite)&#xA;&#xA;(let ((descriptor (sqlite-init &quot;~/mydb.sqlite&quot;)))&#xA;    (setq res (sqlite-query descriptor &quot;SELECT * FROM persona&quot;))&#xA;    (sqlite-bye descriptor)&#xA;    res)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;abo-abo&lt;/strong&gt; also pointed out the more powerful &lt;a href=&quot;https://github.com/skeeto/emacsql&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;emacsql&lt;/code&gt;&lt;/a&gt; package which is more can interface with other RDBMS (including MySQL, and SQLite). Of the packages described here, &lt;code&gt;emacsql&lt;/code&gt; has the most abstract API (where queries are represented as objects instead of raw strings). Here's an example of its usage:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'emacsql)&#xA;(defvar db (emacsql-connect &quot;~/company.db&quot;))&#xA;&#xA;;; Query the database for results:&#xA;(emacsql db [:select [name id]&#xA;             :from people&#xA;             :where (&amp;gt; salary 62000)])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There are probably even more solutions. The question, then, comes down to which package supports the methods you need, and which API you like the most.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-02-24T19:38:57.043" LastActivityDate="2015-02-24T19:38:57.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9544" PostTypeId="2" ParentId="9528" CreationDate="2015-02-24T20:08:49.113" Score="27" Body="&lt;p&gt;This is a bug, IMO. Someone complained that the old indentation markers upset table layout in latex output so &lt;a href=&quot;http://orgmode.org/w/org-mode.git?p=org-mode.git;a=commitdiff;h=bacfe5b4f7244eaf151f4e26a1d94dd8f66c1d19&quot;&gt;someone replaced them&lt;/a&gt; with these latex instruction. Now of course it is a mess on screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought the new &lt;code&gt;prettify-symbols-mode&lt;/code&gt; might be a handy way to switch out the &lt;code&gt;\emsp&lt;/code&gt; for something else, but that can only replace with a single character and it upsets the layout of the table due to the changing width.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there's nothing for it but to redefine the indentation code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-clocktable-indent-string (level)&#xA;  (if (= level 1)&#xA;      &quot;&quot;&#xA;    (let ((str &quot;^&quot;))&#xA;      (while (&amp;gt; level 2)&#xA;        (setq level (1- level)&#xA;              str (concat str &quot;--&quot;)))&#xA;      (concat str &quot;-&amp;gt; &quot;))))&#xA;&#xA;(advice-add 'org-clocktable-indent-string :override #'my-org-clocktable-indent-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Change the indent markers to taste.&lt;/p&gt;&#xA;" OwnerUserId="6598" LastActivityDate="2015-02-24T20:08:49.113" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9545" PostTypeId="1" CreationDate="2015-02-24T20:15:19.407" Score="6" ViewCount="523" Body="&lt;p&gt;I am using &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-mac-port&lt;/a&gt; 24.4 on OSX 10.10. My company-mode drop-down menu is ugly. The unicode symbols in it are not the same width, which results in a ragged menu. The left image is with Monaco, the right one is with DejaVu Sans Mono.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uGJKq.png&quot; height=&quot;400&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/snORY.png&quot; height=&quot;400&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a font better than DejaVu Sans Mono in this regard?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it possible to use the system dropdown menu like yasnippet?&lt;/p&gt;&#xA;" OwnerUserId="524" LastEditorUserId="524" LastEditDate="2015-03-03T16:06:30.393" LastActivityDate="2015-03-03T16:06:30.393" Title="Ragged menu in company-mode" Tags="|osx|fonts|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9546" PostTypeId="2" ParentId="9503" CreationDate="2015-02-24T20:33:27.357" Score="2" Body="&lt;p&gt;This is an 'incomplete' set of elisp that will provide the feature set.  Implementing a full list is left as an exercise (and/or as a full package to develop &lt;code&gt;dired-vc&lt;/code&gt; (time-permitting)) for the reader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Steps to complete the below with missing information:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Obtain a list of all symbols returned by &lt;code&gt;vc-state&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Define faces (&lt;code&gt;defface&lt;/code&gt;) for each missing symbol&lt;/li&gt;&#xA;&lt;li&gt;Adjust the &lt;code&gt;cond&lt;/code&gt; block to include all those symbols&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-fontify-vc ()&#xA;  (while (not (eobp))&#xA;    (let* ((inhibit-read-only t)&#xA;           (file (ignore-errors (file-name-nondirectory&#xA;                                 (dired-get-filename))))&#xA;           (state (ignore-errors (vc-state file))))&#xA;      (when (and file&#xA;                 state)&#xA;        ; (message &quot;%s&amp;gt;%s&quot; file state)&#xA;        (let ((beg (dired-move-to-filename))&#xA;              (end (dired-move-to-end-of-filename)))&#xA;          (cond&#xA;           ((eq state 'edited)&#xA;            (add-text-properties beg end '(font-lock-face edited-face)))&#xA;           ((eq state 'up-to-date)&#xA;            (add-text-properties beg end '(font-lock-face update-face)))))&#xA;        ))&#xA;    (dired-next-line 1)))&#xA;&#xA;(add-hook 'dired-after-readin-hook 'dired-fontify-vc)&#xA;&#xA;(defface edited-face&#xA;  '((t :foreground &quot;orange&quot;))&#xA;  &quot;Foreground color for edited files&quot;)&#xA;(defface update-face&#xA;  '((t :foreground &quot;white&quot;))&#xA;  &quot;Foreground color for up-to-date files.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2015-02-24T20:45:12.653" LastActivityDate="2015-02-24T20:45:12.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9547" PostTypeId="2" ParentId="9545" CreationDate="2015-02-24T20:46:50.390" Score="4" Body="&lt;p&gt;Edit 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, it looks like this answer might be wrong. Now I think that the enclosed alphanumeric characters and friends might be fullwidth forms, similar to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms&quot; rel=&quot;nofollow noreferrer&quot;&gt;CJK unicode characters&lt;/a&gt;. This would explain why Ⓢ takes up exactly two spaces when using GNU Unifont. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In which case, this might best be filed as a &lt;code&gt;company-mode&lt;/code&gt; bug. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you notice, each company entry is the full word, followed by some variable padding, followed by the character, followed by exactly one padding space, followed by the space for the scroll bar. Perhaps company can leave out one padding space for each fullwidth character in the entry.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;DejaVu does not include the circled S character (&lt;code&gt;U+24C8&lt;/code&gt;), or any other circled characters other than numbers&lt;sup&gt;1&lt;/sup&gt;. Emacs is falling back to another font to display the character. You can determine exactly which font by calling &lt;code&gt;describe-char&lt;/code&gt; with the point on the character. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This fallback font is wider than DejaVu or Monaco at the same height, which gives you the behavior you're seeing. You can change fallback fonts with fontsets. &lt;a href=&quot;https://stackoverflow.com/questions/6083496/how-do-you-specify-a-fallback-font-in-emacs&quot;&gt;Here's a relevant SO question on this topic&lt;/a&gt;. Perhaps you can configure the fallback font to use a narrower width (if that is supported by the font). Alternatively, you can install and specify a new font that includes more characters to fallback on (maybe with the same height to width ratio as DejaVu?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_unicode_fonts.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Xah Lee&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;DejaVu has significantly more Unicode symbols than other popular fixed-width fonts &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you may be out of luck finding one unicode-complete monospaced font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://unifoundry.com/unifont.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Unifont&lt;/a&gt; includes all characters in the Unicode BMP, but I think it's pretty ugly.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;These are called &lt;a href=&quot;http://en.wikipedia.org/wiki/Enclosed_Alphanumerics&quot; rel=&quot;nofollow noreferrer&quot;&gt;Enclosed Alphanumerics&lt;/a&gt;. You can find DejaVu's coverage in &lt;a href=&quot;http://sourceforge.net/p/dejavu/code/HEAD/tree/trunk/dejavu-fonts/unicover.txt#l85&quot; rel=&quot;nofollow noreferrer&quot;&gt;their SVN&lt;/a&gt;, including &lt;a href=&quot;http://sourceforge.net/p/dejavu/code/HEAD/tree/trunk/dejavu-fonts/status.txt#l3605&quot; rel=&quot;nofollow noreferrer&quot;&gt;specifics&lt;/a&gt; of which characters are covered.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-02-24T21:14:50.757" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9548" PostTypeId="1" CreationDate="2015-02-24T23:54:32.407" Score="42" ViewCount="459325" Body="&lt;p&gt;In Emacs regex, &lt;code&gt;\n&lt;/code&gt; doesn't match a new line character &lt;code&gt;\n&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Am I correct that &lt;code&gt;$&lt;/code&gt; matches the position between a new line&#xA;character and the character right before the new line character.&#xA;e.g. for a string &lt;code&gt;abc\n&lt;/code&gt;, &lt;code&gt;$&lt;/code&gt; matches the position between &lt;code&gt;c&lt;/code&gt; and&#xA;&lt;code&gt;\n&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;What is the regex that matches &lt;code&gt;\n&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="120" LastEditorUserId="18005" LastEditDate="2019-07-11T14:17:52.350" LastActivityDate="2019-07-11T14:17:52.350" Title="What is the regex to match a newline character?" Tags="|regular-expressions|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="9549" PostTypeId="2" ParentId="9548" CreationDate="2015-02-25T00:00:09.327" Score="35" Body="&lt;ol&gt;&#xA;&lt;li&gt;Yes. &lt;code&gt;$&lt;/code&gt; matches the &lt;em&gt;end of the line&lt;/em&gt;, not the &lt;em&gt;newline character&lt;/em&gt; which comes after the end of the line.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;C-M-s C-q C-j&lt;/code&gt;. &lt;code&gt;C-q&lt;/code&gt; is the default binding for &lt;code&gt;quoted-insert&lt;/code&gt; and works in the minibuffer too. This expression literally searches for a newline: &lt;code&gt;C-j&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-02-25T00:00:09.327" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9550" PostTypeId="2" ParentId="9548" CreationDate="2015-02-25T00:56:11.663" Score="20" Body="&lt;p&gt;As Dan comments, the regex that matches a newline &lt;em&gt;is&lt;/em&gt; a newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can represent a newline in a quoted string in elisp as &lt;code&gt;&quot;\n&quot;&lt;/code&gt;. There is no special additional &lt;em&gt;regexp-specific&lt;/em&gt; syntax for this -- you just use a newline, exactly like any other literal character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are entering a regexp &lt;em&gt;interactively&lt;/em&gt; then you can insert the newline with &lt;kbd&gt;C-q&lt;/kbd&gt;&lt;kbd&gt;C-j&lt;/kbd&gt;, as kaushalmodi's answer points out.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-02-25T00:56:11.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9551" PostTypeId="2" ParentId="9533" CreationDate="2015-02-25T02:14:49.217" Score="5" Body="&lt;p&gt;This can be controlled using &lt;code&gt;org-imenu-depth&lt;/code&gt;.  Speedbar uses IMenu to determine the nodes for expansion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;imenu&lt;/code&gt; only captures two levels deep.  (See &lt;a href=&quot;http://orgmode.org/manual/Cooperation.html&quot;&gt;Org Manual - Cooperation&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting the depth to greater than 2 levels and then initiating a rescan.  This can be done automatically for you by setting &lt;code&gt;imenu-auto-rescan&lt;/code&gt; to a non-nil value (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html&quot;&gt;GNU Emacs - Imenu&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-02-25T02:14:49.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9552" PostTypeId="2" ParentId="9503" CreationDate="2015-02-25T02:48:23.397" Score="9" Body="&lt;p&gt;You can install &lt;a href=&quot;https://github.com/dgutov/diff-hl&quot; rel=&quot;noreferrer&quot;&gt;diff-hl&lt;/a&gt; from GNU ELPA and add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'dired-mode-hook 'diff-hl-dired-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't color the lines. Instead, it shows statuses in the fringe (or the margin, if &lt;code&gt;diff-hl-margin-mode&lt;/code&gt; is on). Looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vqgyn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2015-02-25T02:48:23.397" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9553" PostTypeId="2" ParentId="9530" CreationDate="2015-02-25T02:58:34.377" Score="19" Body="&lt;p&gt;How about: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;occur&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;^*+&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; (note that there's a space at the end of the regexp).&lt;/p&gt;&#xA;" OwnerUserId="6600" LastEditorUserId="504" LastEditDate="2015-02-25T11:00:14.853" LastActivityDate="2015-02-25T11:00:14.853" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9554" PostTypeId="1" AcceptedAnswerId="9555" CreationDate="2015-02-25T03:51:55.663" Score="16" ViewCount="4415" Body="&lt;pre&gt;&lt;code&gt;    (parent-dir &quot;/home/sk/parent/ab.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &quot;/home/sk/parent&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(parent-dir &quot;/home/sk/parent&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;/home/sk&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any elisp function as &lt;code&gt;parent-dir&lt;/code&gt; that gives basepath for both file path &amp;amp; dir path?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2016-10-24T14:39:16.623" LastActivityDate="2019-08-31T03:48:25.340" Title="Function that returns parent directory absolute path" Tags="|directories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9555" PostTypeId="2" ParentId="9554" CreationDate="2015-02-25T04:23:43.943" Score="22" Body="&lt;p&gt;&lt;code&gt;file-name-directory&lt;/code&gt; does what you request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;(file-name-directory &quot;/home/sk/parent/&quot;)&lt;/code&gt; (with a trailing slash) returns that same directory, not its parent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does what I'm guessing you &lt;em&gt;really&lt;/em&gt; want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(file-name-directory (directory-file-name &quot;/home/sk/parent/ab.el&quot;)) ; =&amp;gt; &quot;/home/sk/parent/&quot;&#xA;(file-name-directory (directory-file-name &quot;/home/sk/parent/&quot;)) ; =&amp;gt; &quot;/home/sk/&quot;&#xA;(file-name-directory (directory-file-name &quot;/home/sk/parent&quot;)) ; =&amp;gt; &quot;/home/sk/&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;noreferrer&quot;&gt;Dired+&lt;/a&gt; uses this function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun diredp-parent-dir (file &amp;amp;optional relativep)&#xA;  &quot;Return the parent directory of FILE, or nil if none.&#xA;Optional arg RELATIVEP non-nil means return a relative name, that is,&#xA;just the parent component.&quot;&#xA;  (let ((parent  (file-name-directory (directory-file-name (expand-file-name file))))&#xA;        relparent)&#xA;    (when relativep&#xA;      (setq relparent  (file-name-nondirectory (directory-file-name parent))))&#xA;    (and (not (equal parent file))  (or relparent  parent))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2019-08-31T03:48:25.340" LastActivityDate="2019-08-31T03:48:25.340" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="9556" PostTypeId="2" ParentId="9540" CreationDate="2015-02-25T04:37:12.517" Score="2" Body="&lt;p&gt;@abo-abo gave the Lisp answer. You don't specify whether you want to do this from Lisp or interactively. Interactively, you can do what you ask in either of these ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x replace-regexp RET ^$ RET % RET&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-M-% RET ^$ RET % RET !&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-25T04:37:12.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9557" PostTypeId="1" CreationDate="2015-02-25T04:57:44.773" Score="7" ViewCount="1133" Body="&lt;p&gt;In &lt;a href=&quot;https://emacs.stackexchange.com/questions/5893/load-all-org-files-into-buffers&quot;&gt;this&lt;/a&gt; post it talks about opening org files via find-file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to do this non-interactivley. I try calling:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(find-file &quot;~/git/LeoUfimtsev.github.io/org/&quot; &quot;*.org&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But instead of opening all org files, it pops up with a list of possible choices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I force it to load all files instead of showing a menu?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2023-11-14T00:28:13.193" Title="How to use find-file with wild-cards non-interactivley?" Tags="|find-file|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9558" PostTypeId="2" ParentId="9557" CreationDate="2015-02-25T05:14:41.930" Score="0" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapc #'find-file-noselect&#xA;   (directory-files &amp;quot;~/git/LeoUfimtsev.github.io/org/&amp;quot; nil &amp;quot;\\.org$&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that that third argument is not a glob, but an Emacs regex.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Relevant documentation&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;find-file-noselect is a compiled Lisp function.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(find-file-noselect FILENAME &amp;amp;optional NOWARN RAWFILE WILDCARDS)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Read file FILENAME into a buffer and return the buffer. If a buffer exists visiting FILENAME, return that one, butverify that the file has not changed since visited or saved. The buffer is not selected, just returned to the caller. Optional second arg NOWARN non-nil means suppress any warning messages. Optional third arg RAWFILE non-nil means the file is read literally. Optional fourth arg WILDCARDS non-nil means do wildcard processing and visit all the matching files.  When wildcards are actually used and expanded, return a list of buffers that are visiting the various files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr /&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;directory-files is a built-in function in `C source code'.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(directory-files DIRECTORY &amp;amp;optional FULL MATCH NOSORT)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Return a list of names of files in DIRECTORY. There are three optional arguments: If FULL is non-nil, return absolute file names. Otherwise return names that are relative to the specified directory. If MATCH is non-nil, mention only file names that match the regexp MATCH. If NOSORT is non-nil, the list is not sorted--its order is unpredictable. Otherwise, the list returned is sorted with `string-lessp'. NOSORT is useful if you plan to sort the result yourself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-25T05:14:41.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9559" PostTypeId="2" ParentId="9557" CreationDate="2015-02-25T05:22:05.673" Score="4" Body="&lt;p&gt;&lt;code&gt;(find-file &quot;*.org&quot; t)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And do that in directory &lt;code&gt;&quot;~/git/LeoUfimtsev.github.io/org/&quot;&lt;/code&gt;, if you want the Org files from that directory only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (let ((default-directory  &quot;~/git/LeoUfimtsev.github.io/org/&quot;))&#xA;   (find-file &quot;*.org&quot; t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result of this is the same as if you had used &lt;code&gt;C-x C-f *.org&lt;/code&gt; in that directory: All of the Org files in the default directory will be opened (visited in a buffer).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I think maybe you were misreading the doc of &lt;code&gt;find-file&lt;/code&gt;, in this sense: I think you were misreading the description of parameter &lt;code&gt;WILDCARDS&lt;/code&gt; to be a string of wildcards.  Instead, it is a Boolean value that says whether to interpret parameter &lt;code&gt;FILENAME&lt;/code&gt; as a glob pattern (i.e., as containing wildcards).  Here is that part of the doc string:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Interactively, or if WILDCARDS is non-nil in a call from Lisp,&#xA;      expand wildcards (if any) and visit multiple files.  You can&#xA;      suppress wildcard expansion by setting `find-file-wildcards' to nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;WILDCARDS&lt;/code&gt; is only tested to see whether it is non-nil. Expansion of wildcards occurs for &lt;code&gt;FILENAME&lt;/code&gt;. So if you pass a &lt;code&gt;FILENAME&lt;/code&gt; of &lt;code&gt;*.org&lt;/code&gt; &lt;strong&gt;&lt;em&gt;and&lt;/em&gt;&lt;/strong&gt; you pass a non-nil value as the second argument (&lt;code&gt;WILDCARDS&lt;/code&gt;) then the glob pattern &lt;code&gt;*.org&lt;/code&gt; is expanded.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:22:38.690" LastActivityDate="2015-05-09T20:22:38.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9560" PostTypeId="1" AcceptedAnswerId="9580" CreationDate="2015-02-25T07:34:05.240" Score="2" ViewCount="751" Body="&lt;p&gt;I am exporting my org-mode file via &lt;code&gt;org-export-as-html&lt;/code&gt;, but when I check the file type via &lt;code&gt;file my/file.html&lt;/code&gt;, it is XML. I notice the first three lines in my HTML exported file is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&amp;gt;&#xA;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;&#xA;               &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;&#xA;&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;en&quot; xml:lang=&quot;en&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is a reasonable explanation. If I manually re-order these lines to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;&#xA;               &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;&#xA;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?&amp;gt;&#xA;&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;en&quot; xml:lang=&quot;en&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the file is correctly identified as HTML. How do I correct this issue in my export function? I checked the org-mode docs here but they seem out of date:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/HTML-Export-commands.html#HTML-Export-commands&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/HTML-Export-commands.html#HTML-Export-commands&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because I do not have their listed commands, but &lt;code&gt;org-export-to-html&lt;/code&gt; and &lt;code&gt;org-export-as-html-to-buffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions would be very helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW I am on Emacs 24.3 with Ubuntu 14.04. Here are the first few lines of my org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Flatsheet Project Mgmt -*- mode: org -*-&#xA;#+TODO: TODO IN-PROGRESS WAITING DONE&#xA;#+INFOJS_OPT: view:overview toc:true&#xA;&#xA;* project stuff...&#xA;* more project stuff...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this link potentially helpful, but their suggestion is not working:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot; rel=&quot;nofollow&quot;&gt;http://doc.norang.ca/org-mode.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a section called &lt;code&gt;16.8.2 Export HTML without XML header&lt;/code&gt;, but their solution below does not work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-html-xml-declaration (quote ((&quot;html&quot; . &quot;&quot;)&#xA;                                       (&quot;was-html&quot; . &quot;&amp;lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;%s\&quot;?&amp;gt;&quot;)&#xA;                                       (&quot;php&quot; . &quot;&amp;lt;?php echo \&quot;&amp;lt;?xml version=\\\&quot;1.0\\\&quot; encoding=\\\&quot;%s\\\&quot; ?&amp;gt;\&quot;; ?&amp;gt;&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-02-25T07:48:28.213" LastActivityDate="2021-08-22T00:30:51.877" Title="Org-mode: org-export-as-html is detected as XML, not HTML" Tags="|org-mode|org-export|html|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9561" PostTypeId="1" AcceptedAnswerId="9574" CreationDate="2015-02-25T08:05:44.280" Score="2" ViewCount="204" Body="&lt;p&gt;Many emacs macros are prefixed with 'with' keyword in elisp. In an imperative language like python, &lt;code&gt;with&lt;/code&gt; statement is used to create a temporary variable like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;with controlled_execution() as tempVar:&#xA;     some code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, in macros like &lt;code&gt;with-current-buffer, with-temp-buffer, with-temp-message&lt;/code&gt;, i see &lt;code&gt;with&lt;/code&gt; is not used for similar purpose. Can someone explain, in elisp macro, when to prefix a macro name with prefix &lt;code&gt;'with'&lt;/code&gt;? And because these macros are expected to clear their temp variables, do they have any side effect on the main program?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2015-07-11T04:50:00.693" LastActivityDate="2015-07-11T04:50:00.693" Title="Macros prefixed with 'with'" Tags="|elisp|coding-conventions|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9562" PostTypeId="2" ParentId="9561" CreationDate="2015-02-25T08:51:43.717" Score="6" Body="&lt;p&gt;Well just to be clear, &lt;code&gt;with-&lt;/code&gt; as a prefix doesn't &lt;em&gt;do&lt;/em&gt; anything. It is just a name, so &lt;em&gt;any&lt;/em&gt; function or macro could be given a name starting with &lt;code&gt;with-&lt;/code&gt; if you so wished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The convention is that such a macro accepts a &lt;code&gt;&amp;amp;rest BODY&lt;/code&gt; argument (i.e. some arbitrary number of forms), which will be evaluated in whatever context the prior arguments have established.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As there is nothing special about these macros, they may or may not have side-effects. Nothing is enforced. The documentation ought to make it fairly clear what each one does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The naming scheme is intended to make for intuitive code. e.g. &lt;code&gt;(with-current-buffer BUFFER &amp;amp;rest BODY)&lt;/code&gt; evaluates &lt;code&gt;BODY&lt;/code&gt; with &lt;code&gt;BUFFER&lt;/code&gt; set as the current buffer -- which is probably what you'd &lt;em&gt;expect&lt;/em&gt; it to do if you saw the code and didn't already know.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-02-25T08:51:43.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9563" PostTypeId="1" AcceptedAnswerId="9569" CreationDate="2015-02-25T09:10:43.573" Score="3" ViewCount="1092" Body="&lt;p&gt;If I'm editing certain filetypes then sometimes when I hit return at the end of a line the cursor will move to the next line and the previous line will suddenly be heavily indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior seems to happen in a few different filetypes under various conditions but I can reliably reproduce this in an .el file on a comment line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with the cursor indicated by &lt;code&gt;_&lt;/code&gt;, if I'm on a line that reads&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; word_&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I press return I get the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                            ; word&#xA;_&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's going on? I commented out all tabbing related settings from my configuration files and I still get this behavior.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastActivityDate="2015-02-25T12:08:08.320" Title="Return heavily indents previous line" Tags="|indentation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9564" PostTypeId="1" CreationDate="2015-02-25T09:41:39.003" Score="2" ViewCount="982" Body="&lt;p&gt;For some reason &lt;code&gt;electric-pair-mode&lt;/code&gt; doesn't work well with AUCTeX: It works for &lt;code&gt;(&lt;/code&gt; and &lt;code&gt;[&lt;/code&gt; but not &lt;code&gt;{&lt;/code&gt;. But it used to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I disable &lt;code&gt;electric-pair-mode&lt;/code&gt; and use &lt;code&gt;tex-electric-left-right-brace&lt;/code&gt; instead. The annoying thing is that when I want to delete &lt;code&gt;()&lt;/code&gt;, with &lt;code&gt;electric-pair-mode&lt;/code&gt; turned on I can just press backspace once, but with &lt;code&gt;electric-pair-mode&lt;/code&gt; turned off I need to press it twice to delete the whole pair. What do I need to do to be able to delete matching parens with a single key stroke?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, I need auto-closing for &lt;code&gt;(&lt;/code&gt;, &lt;code&gt;[&lt;/code&gt;, and &lt;code&gt;{&lt;/code&gt; in AUCTeX, as well as the ability to easily delete pairs of matching parens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6602" LastEditorUserId="253" LastEditDate="2015-02-25T12:25:45.147" LastActivityDate="2018-02-08T12:17:01.677" Title="AUCTeX: Inserting and deleting matching pairs of parentheses" Tags="|auctex|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="9565" PostTypeId="1" AcceptedAnswerId="9566" CreationDate="2015-02-25T11:06:03.993" Score="3" ViewCount="829" Body="&lt;p&gt;I want to set variables, in particular, &lt;code&gt;compile-command&lt;/code&gt; and tabbing related variables based on the path of the file I'm editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.vimrc&lt;/code&gt; I use the following to do this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;autocmd BufRead,BufNewFile */path/*.ext set tabbing-setting&#xA;autocmd BufRead,BufNewFile */path/*.ext set makeprg=build.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These cause vim to run the &lt;code&gt;set ...&lt;/code&gt; commands whenever I create or read a file that matches the pattern &lt;code&gt;*/path/*.ext&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to use directory-local variables because I want this to live with the rest of my emacs configuration.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastActivityDate="2015-02-25T11:19:46.643" Title="Set variables based on path without using directory-local variables" Tags="|hooks|local-variables|path|compilation-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9566" PostTypeId="2" ParentId="9565" CreationDate="2015-02-25T11:19:46.643" Score="6" Body="&lt;p&gt;Directory-local variables were actually designed for this use case as well.  Read &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;the docs&lt;/a&gt;, especially at the end, where it discusses &lt;code&gt;dir-locals-set-directory-class&lt;/code&gt;.  The idea here is that you can keep the directory-local settings somewhere other than in the &lt;code&gt;.dir-locals.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to accomplish this same thing is to make settings directory-dependent in the relevant mode hooks.  For example, something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-set-c-style ()&#xA;  (if (buffer-file-name)&#xA;      (cond&#xA;       ((string-match &quot;/some/random/path&quot; (buffer-file-name))&#xA;        (c-set-style &quot;BSD&quot;)&#xA;        (make-local-variable 'c-basic-offset)&#xA;        (setq c-basic-offset 4)))&#xA;... you get the idea&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function would be attached to &lt;code&gt;c-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of the directory-local approach is that you can keep all the settings related to a project in one spot.  The advantage of the second approach is that it can also be used for things that you can't do via directory-locals, for example binding a key.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-02-25T11:19:46.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9567" PostTypeId="1" CreationDate="2015-02-25T11:26:24.257" Score="0" ViewCount="218" Body="&lt;p&gt;when to use &lt;code&gt;cl-block&lt;/code&gt; over the most common &lt;code&gt;let&lt;/code&gt; scoping? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a form is expected to return multiple possible values, is &lt;code&gt;cl-block&lt;/code&gt; the choice over &lt;code&gt;let?&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-02-25T15:07:29.783" Title="cl-block Vs let form in elisp" Tags="|elisp|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9568" PostTypeId="2" ParentId="9567" CreationDate="2015-02-25T11:34:10.137" Score="3" Body="&lt;p&gt;I believe that it's best to avoid &lt;code&gt;cl-block&lt;/code&gt;. There are only 23 uses&#xA;of &lt;code&gt;cl-block&lt;/code&gt; in the whole Emacs core.  I've been writing Emacs&#xA;packages for some time and I couldn't tell at the spot what &lt;code&gt;cl-block&lt;/code&gt;&#xA;does. A list of values is usually better, or eieio if you want complex&#xA;things.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-25T11:34:10.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9569" PostTypeId="2" ParentId="9563" CreationDate="2015-02-25T11:39:25.520" Score="1" Body="&lt;p&gt;This is caused by &lt;code&gt;electric-indent-mode&lt;/code&gt;. If you disable it, the behavior you describe will go away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar question has been asked on here &lt;a href=&quot;https://emacs.stackexchange.com/q/3322/504&quot;&gt;before&lt;/a&gt;. The &lt;a href=&quot;https://emacs.stackexchange.com/a/3338/504&quot;&gt;accepted answer&lt;/a&gt; describes how to disable electric indentation for specific characters. Adapting the code to your specific situation, we get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun electric-indent-mode-configure ()&#xA;  &quot;Delete newline (?\n) from `electric-indent-chars'.&quot;&#xA;  (setq electric-indent-chars (delq 10 electric-indent-chars)))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook #'electric-indent-mode-configure)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place, you can have &lt;code&gt;electric-indent-mode&lt;/code&gt; turned on &lt;em&gt;without&lt;/em&gt; getting the behavior you describe.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-02-25T12:08:08.320" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9570" PostTypeId="2" ParentId="9561" CreationDate="2015-02-25T13:08:25.867" Score="7" Body="&lt;p&gt;The thing the &lt;code&gt;with-&lt;/code&gt; function have in common is that they create a code block where something, temporarily, has been changed. Once you have left the code block, things are back to normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &quot;code block&quot; I mean a group of lisp statement grouped together with something that work like &lt;code&gt;progn&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Do something in a buffer&#xA;(with-current-buffer another-buffer&#xA;  ;; do something in &quot;another-buffer&quot;&#xA;  ...&#xA;  ...)&#xA;;; Here, we're back to the original buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-output-to-temp-buffer &quot;*MyOutput*&quot;&#xA;  ;; A &quot;princ&quot; prints to the newly created temporary buffer.&#xA;  (princ &quot;Hello World!\n&quot;)&#xA;  (display-buffer (current-buffer)))&#xA;;; A &quot;princ&quot; here will print to whatever &quot;standard-output&quot; points to,&#xA;;; typically the echo-area.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-02-25T13:38:05.670" LastActivityDate="2015-02-25T13:38:05.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9571" PostTypeId="1" CreationDate="2015-02-25T13:27:48.100" Score="2" ViewCount="843" Body="&lt;p&gt;With a vanilla install of Prelude and with C++-mode as my major mode, &lt;code&gt;M-x whitespace-mode&lt;/code&gt; no longer shows whitespace characters. I get a message indicating that I am toggling whitespace-mode on and off but no whitespace is shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Has:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HwKX2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x whitespace-mode&lt;/code&gt;   &lt;img src=&quot;https://i.stack.imgur.com/lV5q7.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HwKX2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Want:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LsMSy.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x whitespace-mode&lt;/code&gt;   &lt;img src=&quot;https://i.stack.imgur.com/lV5q7.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PvMmN.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The prelude documentation actually says that it &lt;em&gt;enables&lt;/em&gt; whitespace-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/prelude#disabling-whitespace-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/bbatsov/prelude#disabling-whitespace-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this or how can I debug this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prelude sets a bunch of minor modes. I turned off the ones that I could guess the &quot;...-mode&quot; function for but that didn't help. I don't know how to toggle most of these or even how to figure out how to toggle them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Q8HDt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2139" LastActivityDate="2016-01-30T12:40:10.800" Title="Enable whitespace-mode with Prelude in C++-mode" Tags="|whitespace|whitespace-mode|prelude|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9572" PostTypeId="1" CreationDate="2015-02-25T14:17:51.813" Score="2" ViewCount="60" Body="&lt;p&gt;Since the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/The-Echo-Area.html&quot; rel=&quot;nofollow&quot;&gt;echo area&lt;/a&gt; at the bottom of a frame is blank when the minibuffer is not active, I'd like to use it for something I don't always need but is informative (like showing &lt;code&gt;org&lt;/code&gt;'s clocking, battery level etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="6596" LastEditorUserId="253" LastEditDate="2015-02-25T14:41:01.570" LastActivityDate="2015-02-25T14:41:01.570" Title="How to use the echo area to display useful information?" Tags="|echo-area|" AnswerCount="0" CommentCount="6" ClosedDate="2015-02-25T15:34:09.693" ContentLicense="CC BY-SA 3.0" />
  <row Id="9574" PostTypeId="2" ParentId="9561" CreationDate="2015-02-25T15:02:21.063" Score="5" Body="&lt;p&gt;To add a bit to what &lt;strong&gt;phils&lt;/strong&gt; wrote. &lt;code&gt;with-&lt;/code&gt; is usually an indication of resource management, so your initial guess was close (btw. Emacs Lisp is no less imperative language than Python). So, for example, &lt;code&gt;with-current-buffer&lt;/code&gt; will enter and exit the specified buffer, i.e. &lt;em&gt;create&lt;/em&gt; at start and &lt;em&gt;clean&lt;/em&gt; afterwards. &lt;code&gt;with-output-to-string&lt;/code&gt; will allocate a buffer where it will collect all output of the forms inside the macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rationale behind these kinds of macros is that sometimes you don't want the user of your macro to deal with resource allocation and deallocation. So, such macros tend to have two distinct features:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;They provide a variable bound during macro execution (the one which designates the resource being worked with).&lt;/li&gt;&#xA;&lt;li&gt;They release acquired resources after the user code finishes.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A typical implementation would do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-something (var &amp;amp;body body)&#xA;  `(let ((var (allocate-var)))&#xA;     (unwind-protect ,@body&#xA;       (when var (deallocate-var)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;body&lt;/code&gt; forms use &lt;code&gt;var&lt;/code&gt; resource very similar to how in your Python code you could use the variable declared in &lt;code&gt;as var&lt;/code&gt; part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-current-buffer&lt;/code&gt; is somewhat different since it doesn't expose the buffer variable, but calling buffer-related functions will be equivalent, so there's no real need.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-25T15:02:21.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9575" PostTypeId="2" ParentId="9567" CreationDate="2015-02-25T15:07:29.783" Score="3" Body="&lt;p&gt;&lt;code&gt;cl-block&lt;/code&gt; isn't designed for the same purpose as &lt;code&gt;let&lt;/code&gt;. Its purpose is to be used in macros to work with control flow in the way which resembles Common Lisp. One would use &lt;code&gt;cl-block&lt;/code&gt; to implement functionality of &lt;code&gt;return-from&lt;/code&gt; or a pattern-matching device with guards etc. It's not expected that non-library code would use this macro.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-25T15:07:29.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9577" PostTypeId="2" ParentId="9537" CreationDate="2015-02-25T15:35:30.223" Score="8" Body="&lt;p&gt;I don't have a solution for a single modeline, but here are two possible alternative solutions:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;1. Only render the mode line in the active window:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you use powerline, you could wrap your mode-line-format in: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;((:eval (when (powerline-selected-window-active) ...)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then change the &lt;code&gt;mode-line-inactive&lt;/code&gt; face so blends with your background but still separates buffers with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'mode-line-inactive nil&#xA;                    :underline t&#xA;                    :background (face-background 'default))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PN2kW.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;2. Use the &lt;code&gt;frame-title-format&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Your &lt;code&gt;frame-title-format&lt;/code&gt; determines what is show on the top of your frame when running in a gui.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set the &lt;code&gt;frame-title-format' like you would your&lt;/code&gt;mode-line-format` and them set your mode-line-format to something blank-ish.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-02-25T15:35:30.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9579" PostTypeId="1" CreationDate="2015-02-25T17:13:16.243" Score="0" ViewCount="504" Body="&lt;p&gt;My Agenda clock-report is kinda wide and columns are all over the place. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My agenda clock report plist is as following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(org-agenda-clockreport-parameter-plist&#xA;   (quote&#xA;    (:tcolumns 2 :level\  t :link t :maxlevel 5 :narrow 60 :formatter my-org-clocktable-notodo :properties&#xA;           (&quot;Effort&quot; &quot;CLOCKSUM&quot; &quot;CLOCKSUM_T&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The Effort/clock columns are placed before headings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| File      | Effort | CLOCKSUM | CLOCKSUM_T | ITEM | Headline  ..| Time |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to put the effort/clock columns at the end, after the heading instead like so: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| File      | ITEM | Headline  ..| Time | Effort | CLOCKSUM | CLOCKSUM_T |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-02-26T17:51:26.293" Title="Re-arrange columns in agenda clockreport?" Tags="|org-mode|org-agenda|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9580" PostTypeId="2" ParentId="9560" CreationDate="2015-02-25T19:09:17.100" Score="1" Body="&lt;p&gt;This was resolved by upgrading to the latest version of org-mode, &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#updating-org&quot; rel=&quot;nofollow&quot;&gt;detailed here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did it through the ELPA package manager, with marmalade packages, to upgrade org-mode from 7.9 to 8.2. Org-mode seems to be under heavy development, and it has a new export engine, which was probably the cause of my error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When re-installing a package, just be sure to delete any existing org package directory under &lt;code&gt;.emacs/elpa/org...&lt;/code&gt; and restart emacs with &lt;code&gt;emacs -q&lt;/code&gt; and THEN install the latest package to avoid conflicts! YMMV but it worked for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, it exported fine, with a DOCTYPE html declaration at the top of the file. Now the file is recognized as HTML instead of XML.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-02-25T19:09:17.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9581" PostTypeId="1" CreationDate="2015-02-25T19:28:51.757" Score="7" ViewCount="406" Body="&lt;p&gt;&lt;code&gt;(tool-bar-mode 0)&lt;/code&gt; takes up 11% of my initialization time (about a third of  a second). It's not that big of a deal; it's just &lt;em&gt;strange&lt;/em&gt;. I've tried it on multiple computers. I've also tried disabling everything but that line in my &lt;code&gt;.emacs&lt;/code&gt;. It always takes a while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this normal? Is there a better way to do it?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="105" LastEditDate="2016-08-15T01:07:07.060" LastActivityDate="2018-04-03T20:03:04.623" Title="Removing tool bar oddly slow" Tags="|init-file|start-up|tool-bar|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="9582" PostTypeId="1" AcceptedAnswerId="9597" CreationDate="2015-02-25T20:28:16.530" Score="6" ViewCount="2345" Body="&lt;p&gt;I have read that using &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;use-package&lt;/a&gt;, one can manage installation of the packages from the init.el file. Is there any specific command for that ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background: I'm planning to port my existing init.el to use &lt;code&gt;use-package&lt;/code&gt;. But I'm not able to find any documentation of how to install all the dependencies of my init.el file. I can see in the documentation that they have the &lt;code&gt;:ensure&lt;/code&gt; keyword which will install the software if it isn't present already, but it raises few other questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) How to make &lt;code&gt;use-package&lt;/code&gt; understand that you have to install this package from &lt;code&gt;MELPA&lt;/code&gt; and that from &lt;code&gt;marmalade&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Is there a single command for installing all the packages from &lt;code&gt;init.el&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="253" LastEditDate="2015-02-25T20:32:49.117" LastActivityDate="2015-02-26T12:12:55.880" Title="Managing packages using use-package" Tags="|package|use-package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9583" PostTypeId="1" AcceptedAnswerId="9584" CreationDate="2015-02-25T20:51:05.210" Score="52" ViewCount="13631" Body="&lt;p&gt;I use Emacs + &lt;code&gt;evil&lt;/code&gt; mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I position the cursor on &lt;code&gt;e&lt;/code&gt; (in normal state) in a chunk of text such as &lt;code&gt;abc_def_ghi&lt;/code&gt;, &lt;code&gt;ciw&lt;/code&gt; (change inner word) changes only the &lt;code&gt;def&lt;/code&gt; part of the string, while Vim would change the entire &lt;code&gt;abc_def_ghi&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I force &lt;code&gt;evil&lt;/code&gt; to treat the underscore as Vim does (ie, as part of the word)? &lt;/p&gt;&#xA;" OwnerUserId="4005" LastEditorUserId="253" LastEditDate="2015-02-26T00:50:29.377" LastActivityDate="2024-01-01T17:09:48.453" Title="How to treat underscore as part of the word?" Tags="|evil|syntax|syntax-table|" AnswerCount="8" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9584" PostTypeId="2" ParentId="9583" CreationDate="2015-02-25T21:47:08.633" Score="43" Body="&lt;p&gt;The simplest workaround: use &lt;code&gt;cio&lt;/code&gt; (see &lt;a href=&quot;https://evil.readthedocs.io/en/latest/faq.html#underscore-is-not-a-word-character&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;), or use &lt;code&gt;ciW&lt;/code&gt; to select a whitespace-delimited word.&lt;/p&gt;&#xA;&lt;p&gt;The bigger issue has to do with the value of the &lt;code&gt;_&lt;/code&gt; character in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;syntax table&lt;/a&gt;.  The issue is that &lt;code&gt;_&lt;/code&gt; is, by default, a symbol constituent in the syntax table, and you want to treat it as a word constituent.&lt;/p&gt;&#xA;&lt;p&gt;If you're using emacs 24.4, you could try enabling &lt;a href=&quot;http://emacsredux.com/blog/2014/08/27/a-peek-at-emacs-24-dot-4-superword-mode/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;superword-mode&lt;/code&gt;&lt;/a&gt;.  I haven't tried it myself, so your mileage may vary.&lt;/p&gt;&#xA;&lt;p&gt;An alternative is simply to modify the syntax table yourself and tell Emacs you want it to treat the &lt;code&gt;_&lt;/code&gt; character as a word constituent, like so:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(modify-syntax-entry ?_ &amp;quot;w&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;After you do that, &lt;code&gt;ciw&lt;/code&gt; works as you want it to, such that it will select all of &lt;code&gt;abc_def_ghi&lt;/code&gt; rather than just &lt;code&gt;def&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Doing it this way, however, may be overkill, especially if you only want the &lt;code&gt;_&lt;/code&gt; to count as part of the word for the text object.  Instead, you can advise &lt;code&gt;evil-inner-word&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defadvice evil-inner-word (around underscore-as-word activate)&#xA;  (let ((table (copy-syntax-table (syntax-table))))&#xA;    (modify-syntax-entry ?_ &amp;quot;w&amp;quot; table)&#xA;    (with-syntax-table table&#xA;      ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now, &lt;code&gt;_&lt;/code&gt; is still a symbol constituent for everything &lt;em&gt;except&lt;/em&gt; for the inner-word text object, so &lt;code&gt;ciw&lt;/code&gt; will do precisely what you want without touching the functionality of anything else.&lt;/p&gt;&#xA;&lt;p&gt;You can read more about modifying syntax tables on the &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsSyntaxTable&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsWiki node&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="26163" LastEditDate="2024-01-01T17:09:48.453" LastActivityDate="2024-01-01T17:09:48.453" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="9585" PostTypeId="1" AcceptedAnswerId="9588" CreationDate="2015-02-25T22:10:57.167" Score="30" ViewCount="11241" Body="&lt;p&gt;I often have a list like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Main heading&#xA;** TODO [#A] Make world better&#xA;** TODO [#B] Make Emacs better &#xA;** TODO [#B] Customize emacs &#xA;** DONE [#C] some task&#xA;** TODO [#A] Launch rocket to mars&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to sort it according to the 'TODO' taskword first. Then the items inside the sorted TODO I would like to sort by priority.   (it would then be nice to further sort by &quot;Effort&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I mean currently I can click on the main heading and sort the children already by either priority or by todo keyword, but not both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is sorting by both possible like sort-strategy?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Currently I have two headings &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Tasks&#xA;** TODO [#A] meh&#xA;** TODO [#B] meh2&#xA;* Completed.&#xA;** DONE [#B] meh3.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the problem with this approach is that I have to constantly shuffle tasks around when I complete them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt;&lt;br&gt;&#xA;This is kinda similar to &lt;a href=&quot;https://stackoverflow.com/questions/22231431/sort-a-mixed-list-of-headings-in-org-mode&quot;&gt;this&lt;/a&gt; except that I couldn't make sense of his answer to transfer it to my needs? &lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2022-09-13T01:46:09.117" Title="org: How to sort headings by TODO and then by priority?" Tags="|org-mode|sorting|" AnswerCount="4" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="9586" PostTypeId="1" CreationDate="2015-02-25T22:30:07.543" Score="53" ViewCount="9707" Body="&lt;p&gt;&lt;a href=&quot;http://www.fsd.it/fonts/pragmatapro.htm&quot;&gt;PragmataPro&lt;/a&gt; is a typeface that comes with a number of &lt;a href=&quot;http://www.fsd.it/fonts/pragmatapro/PragmataPro_Haskell_liga.png&quot;&gt;programming ligatures&lt;/a&gt;. My understanding is that these are OpenType face (OTF) ligatures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that Emacs supports programmatic replacement of character combinations (for example &lt;code&gt;-&amp;gt;&lt;/code&gt; to &lt;code&gt;⟶&lt;/code&gt; or &lt;code&gt;lambda&lt;/code&gt; to &lt;code&gt;λ&lt;/code&gt;). However, these are unicode faux ligatures, since they have their own code points, which real ligatures do not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I correct that Emacs (as of 25) does not support OTF ligatures automatically? On a lower level, are there options available to manually specify glyph mappings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If ligatures are unsupported, then what needs to be done for Emacs to support ligatures?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2016-08-03T16:34:56.480" LastActivityDate="2019-03-25T06:25:08.027" Title="OTF ligature support in Emacs" Tags="|fonts|display|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9587" PostTypeId="2" ParentId="9582" CreationDate="2015-02-25T22:41:48.663" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;1) How to make use-package understand that you have to install this package from MELPA and that from marmalade&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thats determined by your setting for &lt;code&gt;package-archives&lt;/code&gt;. This defaults to the GNU repository only. I add MELPA to it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; .  &quot;http://melpa.org/packages/&quot;) 'APPEND)&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;2) Is there a single command for installing all the packages from init.el.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Just restart Emacs. It will install all packages requested by &lt;code&gt;use-package&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="146" LastActivityDate="2015-02-25T22:41:48.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9588" PostTypeId="2" ParentId="9585" CreationDate="2015-02-26T01:47:33.000" Score="24" Body="&lt;p&gt;It would be great if there was something like &lt;code&gt;org-agenda-sorting-stratagy&lt;/code&gt; that worked with &lt;code&gt;org-sort-entries&lt;/code&gt;, but there doesn't seem to be.  We can fake it since &lt;code&gt;org-sort-entries&lt;/code&gt; can take an argument specifying a function assigning a (string or number) key to each heading, which will be used to sort the entries when the &lt;code&gt;?f&lt;/code&gt; sorting type is given.  All we have to do is get a string for the TODO and PRIORITY properties.  The trick is that we want to sort the TODO property by its position in &lt;code&gt;org-todo-keywords&lt;/code&gt;, not alphabetically.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(defun todo-to-int (todo)&#xA;    (cl-first (-non-nil&#xA;            (mapcar (lambda (keywords)&#xA;                      (let ((todo-seq&#xA;                             (-map (lambda (x) (cl-first (split-string  x &amp;quot;(&amp;quot;)))&#xA;                                   (cl-rest keywords)))) &#xA;                        (cl-position-if (lambda (x) (string= x todo)) todo-seq)))&#xA;                    org-todo-keywords))))&#xA;&#xA;(defun my/org-sort-key ()&#xA;  (let* ((todo-max (apply #'max (mapcar #'length org-todo-keywords)))&#xA;         (todo (org-entry-get (point) &amp;quot;TODO&amp;quot;))&#xA;         (todo-int (if todo (todo-to-int todo) todo-max))&#xA;         (priority (org-entry-get (point) &amp;quot;PRIORITY&amp;quot;))&#xA;         (priority-int (if priority (string-to-char priority) org-default-priority)))&#xA;    (format &amp;quot;%03d %03d&amp;quot; todo-int priority-int)&#xA;    ))&#xA;&#xA;(defun my/org-sort-entries ()&#xA;  (interactive)&#xA;  (org-sort-entries nil ?f #'my/org-sort-key))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x my/org-sort-entries&lt;/code&gt; will sort by the TODO keyword and break ties with PRIORITY (using &lt;code&gt;org-default-priority&lt;/code&gt; when no priority is given).  This will break if you have more than 1000 TODO keywords, which is a good reason not to do that.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="7059" LastEditDate="2022-09-13T01:46:09.117" LastActivityDate="2022-09-13T01:46:09.117" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="9589" PostTypeId="1" AcceptedAnswerId="9590" CreationDate="2015-02-26T04:37:20.283" Score="2" ViewCount="829" Body="&lt;p&gt;I have a &lt;code&gt;use-package&lt;/code&gt; idle hook that loads my org files into buffers for future use. I want this to be unobtrusive. However, I cannot find any &lt;code&gt;find-file&lt;/code&gt; function which loads a file without changing the display.&lt;/p&gt;&#xA;&lt;p&gt;There are a number of &lt;code&gt;find-file&lt;/code&gt; functions in the Emacs manual, but none of these do what I want.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;find-file&lt;/code&gt; Visit a file.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;find-file-read-only&lt;/code&gt; Visit a file for viewing, without allowing changes to it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;find-alternate-file&lt;/code&gt; Visit a different file instead of the one visited last.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;find-file-other-window&lt;/code&gt; Visit a file, in another window.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;find-file-other-frame&lt;/code&gt; Visit a file, in a new frame.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;find-file-literally&lt;/code&gt; Visit a file with no conversion of the contents.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I thought &lt;code&gt;find-file-literally&lt;/code&gt; might be a winner, but it does in fact load the file into the current window.&lt;/p&gt;&#xA;&lt;p&gt;Is there a function I can use to load files into buffers without any display changes?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-26T04:51:07.093" Title="Load a file into a buffer without changing the display" Tags="|find-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9590" PostTypeId="2" ParentId="9589" CreationDate="2015-02-26T04:51:07.093" Score="3" Body="&lt;p&gt;The function you want is &lt;code&gt;find-file-noselect&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function is the guts of all the file-visiting functions. It returns a buffer visiting the file filename. You may make the buffer current or display it in a window if you wish, but this function does not do so.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2015-02-26T04:51:07.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9591" PostTypeId="1" AcceptedAnswerId="9593" CreationDate="2015-02-26T05:02:15.817" Score="1" ViewCount="858" Body="&lt;p&gt;A friend of mine who uses vim had this useful feature enabled, that allowed him to see type/completion information in a dropdown window even in terminal mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently in emacs I have to actually jump to a separate point in code (using M-.) which can be quite distracting, is there a way to enable this ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at other C IDE related questions but none of them seem to have answer to this question.&lt;/p&gt;&#xA;" OwnerUserId="6589" LastActivityDate="2015-02-27T10:31:07.100" Title="How to display type of C variable in a curses type menu?" Tags="|helm|completion|projectile|cedet|c|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9592" PostTypeId="2" ParentId="9591" CreationDate="2015-02-26T05:25:23.100" Score="1" Body="&lt;p&gt;Look into &lt;code&gt;semantic&lt;/code&gt; modes. In particular, &lt;code&gt;global-semantic-idle-summary-mode&lt;/code&gt;, which shows a summary of the symbol under point (including type information) in the echo area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mOqst.png&quot; alt=&quot;semantic-idle-summary-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;semantic&lt;/code&gt; is very powerful, but it still has limitations. Complex template code, for example, can confuse it. I don't do too much complex C++, so I've never seen it fail. The LLVM is probably more powerful, but &lt;code&gt;semantic&lt;/code&gt; is built into Emacs, which adds a level of convenience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While you specifically call for a &quot;curses style menu&quot;, I personally think the echo area is the better place for such information. It is consistent with the rest of Emacs, and does not obscure the code. Note that character graphics are very tricky in Emacs ATM. If you really want, we can work on displaying this information with &lt;code&gt;popup.el&lt;/code&gt; or the like.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-02-26T05:48:10.793" LastActivityDate="2015-02-26T05:48:10.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9593" PostTypeId="2" ParentId="9591" CreationDate="2015-02-26T07:44:59.217" Score="3" Body="&lt;p&gt;You can install &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;irony-mode&lt;/a&gt; and see full information of each completion candidates; it looks like &lt;a href=&quot;https://github.com/Sarcasm/company-irony/blob/master/screenshots/company-irony.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;. Alternatively, you can also use company-clang that comes with &lt;a href=&quot;https://github.com/company-mode/company-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;company&lt;/a&gt; that gives you something like previous screenshot. Note that to have something similar to the screenshot and using Irony, you have to install Company to install &lt;a href=&quot;https://github.com/Sarcasm/company-irony&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-irony&lt;/a&gt;. If you want to display function signature information in the minibuffer, use &lt;a href=&quot;https://github.com/ikirill/irony-eldoc&quot; rel=&quot;nofollow noreferrer&quot;&gt;irony-eldoc&lt;/a&gt;. In summary, you have to install 4 packages from MELPA: Company + Irony + Company Irony + Irony Eldoc, and Clang by manually building it yourself following &lt;a href=&quot;http://clang.llvm.org/get_started.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the official guide&lt;/a&gt;, or simply install it from the package manager of your OS (i.e. apt-get, yum...). All of this procedure is still much easier from setting YCM server and making it work with Vim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that to build Irony, you have to install &lt;code&gt;Cmake&lt;/code&gt; and run &lt;code&gt;M-x irony-install-server&lt;/code&gt;, press &lt;kbd&gt;RET&lt;/kbd&gt; and wait it build the server. After the build is finished, you can start using the auto-completion. Clang supports a few &lt;a href=&quot;https://github.com/Sarcasm/irony-mode#compilation-database&quot; rel=&quot;nofollow noreferrer&quot;&gt;compilation systems&lt;/a&gt;. If you use Make, simply create an empty &lt;code&gt;.clang_complete&lt;/code&gt;, add include paths where Irony should searches for completion symbols in your project using &lt;code&gt;-Ipath/relative/to/.clang_complete&lt;/code&gt;. You can read about &lt;code&gt;.clang_complete&lt;/code&gt; fully &lt;a href=&quot;https://github.com/Rip-Rip/clang_complete/blob/c8673142759b87316265eb0edd1f620196ec1fba/doc/clang_complete.txt#L55&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. You don't need &lt;code&gt;.clang_complete&lt;/code&gt; file or any of the build system, Irony will still work. But then it only looks for files in current directory. To look further, you have to tell it as suggested above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A picture is worth a thousand words. Here is a gif demo:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/4gKHP.gif&quot; alt=&quot;company-irony&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you see, a completion popup with type information. If you notice, when I move the cursor to each completion candidate, a short message is displayed in the minibuffer briefly describes the candidate. After pressing &lt;kbd&gt;RET&lt;/kbd&gt; to insert a desired candidate and change the parameters to actual arguments, I moved point to the candidate I inserted and its type information and a short summary message is displayed in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, one of those solutions should solve your completion problem. Since you put Helm tag there, I assume you use Helm. If so, you can use &lt;a href=&quot;https://github.com/syohex/emacs-helm-gtags&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm-gtags&lt;/a&gt; and use &lt;code&gt;helm-gtags-dwim&lt;/code&gt; at a symbol at point. It will list all function signature in a Helm buffer without jumping to it. You can look at all the function signatures, then press &lt;code&gt;C-g&lt;/code&gt; to go back to your current buffer. The advantage compare with the minibuffer approach is that you can look up more than one definition, while minibuffer can only show you one closest match it could find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: If you use Emacs 24.4. you may also want to try &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor&quot; rel=&quot;nofollow noreferrer&quot;&gt;Semantic Refactor&lt;/a&gt;. Here are &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor/blob/master/srefactor-demos/demos.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;the demos&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-02-27T10:31:07.100" LastActivityDate="2015-02-27T10:31:07.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9594" PostTypeId="1" AcceptedAnswerId="9619" CreationDate="2015-02-26T09:26:34.323" Score="3" ViewCount="70" Body="&lt;p&gt;I defined a macro in an emacs client, which was attached to my emacs server.&#xA;I closed the client, and opened the client on a new file, and attempted to run the macro on the new file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both the new emacs client, and the server, I was told &lt;code&gt;No keyboard macro defined.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Why might someone want this behaviour?&lt;br&gt;&#xA;b) How can I work around it?&lt;/p&gt;&#xA;" OwnerUserId="503" LastActivityDate="2015-02-26T20:34:01.613" Title="KBD macros defined in emacsclient disappear when client is closed" Tags="|emacsclient|keyboard-macros|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9597" PostTypeId="2" ParentId="9582" CreationDate="2015-02-26T10:15:20.923" Score="12" Body="&lt;p&gt;Emacs' built-in package manager, and thus &lt;code&gt;use-package&lt;/code&gt; as well, automatically installs the latest version a package, across all repositories.  Normally, that means packages are installed from MELPA, because MELPA serves the highest version numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, from Emacs 24.4 onwards you can pin individual packages to specific archives with the &lt;code&gt;:pin&lt;/code&gt; keyword:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package projectile&#xA;  :ensure t&#xA;  :pin marmalade)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This tells &lt;code&gt;use-package&lt;/code&gt; to install Projectile from Marmalade, provided that you have &lt;code&gt;marmalade&lt;/code&gt; in your &lt;code&gt;package-archives&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, though, that if you have Projectile installed prior to these settings, use-package will not automatically reinstall Projectile from Marmalade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install all packages declared in your init file by simply re-evaluating your init file, either by restarting Emacs, or with &lt;code&gt;M-x eval-buffer&lt;/code&gt; in a buffer with your init file, or with &lt;code&gt;M-: (load user-init-file)&lt;/code&gt;.  use-package will then automatically install all missing packages.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-02-26T12:12:55.880" LastActivityDate="2015-02-26T12:12:55.880" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9598" PostTypeId="2" ParentId="3386" CreationDate="2015-02-26T11:04:52.443" Score="1" Body="&lt;p&gt;Currently there is no support for displaying several images in the same window, so there are two workarounds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;split the right window to display two slides at the same time.  As there is no way to send commands to two windows at the same time this is rather pointless, though, as one of the windows will stay fixed when you press &lt;code&gt;n&lt;/code&gt; or &lt;code&gt;p&lt;/code&gt; in the other window.  You might be able to overwrite this, but it seems messy.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;you could try to affect the pdf-to-image conversion.  While ghostscript itself does not seem to allow rendering multiple pages to the same image file you may be able to replace the ghostscript executable (by setting &lt;code&gt;doc-view-ghostscript-program&lt;/code&gt;) with a wrapper that calls ghostscript and then zips up the images in pairs, e.g. with ImageMagick's &lt;code&gt;montage&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Neither of these two methods is particularly appealing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, &lt;code&gt;mudraw&lt;/code&gt; (which can be used as an alternative renderer) also does not support rendering multiple pages to the same image file.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-02-26T11:04:52.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9599" PostTypeId="2" ParentId="9440" CreationDate="2015-02-26T14:01:56.913" Score="1" Body="&lt;p&gt;Thanks for the comments. Here is the feature request: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/887&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/issues/887&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6562" LastActivityDate="2015-02-26T14:01:56.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9600" PostTypeId="1" AcceptedAnswerId="9604" CreationDate="2015-02-26T14:09:52.677" Score="12" ViewCount="2142" Body="&lt;p&gt;I would like to use &lt;code&gt;set-face-attribute&lt;/code&gt; to pick one of two colors for the foreground depending on whether the background of the current theme is light or dark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected behavior is that the foreground changes automatically if I switch from a light background theme to a dark background theme or vice-versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a use case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I customize the face of &lt;code&gt;stripe-hl-line&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (set-face-attribute 'stripe-hl-line nil&#xA;                        :overline   &quot;gray&quot;&#xA;                        :underline  &quot;gray&quot;&#xA;                        :foreground &quot;dodger blue&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like to change the foreground based on just if the theme is light or dark. That way I don't have to worry about customizing that face in each theme.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-26T16:54:36.953" LastActivityDate="2015-02-26T16:54:36.953" Title="How can I override a pre-defined face for light and dark backgrounds?" Tags="|faces|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9601" PostTypeId="2" ParentId="4112" CreationDate="2015-02-26T14:29:08.763" Score="2" Body="&lt;p&gt;You might want to try &lt;code&gt;centered-window-mode&lt;/code&gt;: &lt;a href=&quot;https://github.com/anler/centered-window-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/anler/centered-window-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It centers the text of the window when there’s only one window in the frame. To enable it in all my LaTeX buffers I added the following hook&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(add-hook 'LaTeX-mode-hook 'centered-window-mode)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6611" LastActivityDate="2015-02-26T14:29:08.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9603" PostTypeId="2" ParentId="7563" CreationDate="2015-02-26T14:43:55.943" Score="5" Body="&lt;p&gt;A comment on &lt;a href=&quot;https://emacs.stackexchange.com/q/9572/184&quot;&gt;this question&lt;/a&gt; mentions that a package named &lt;a href=&quot;https://github.com/zk-phi/symon&quot; rel=&quot;nofollow noreferrer&quot;&gt;symon&lt;/a&gt; makes use of such a feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is achieved by spamming non-logged messages when the minibuffer is inactive, and by stopping the redisplay everytime a command is issued. The boilerplate for that is rather short, and after a few minutes of usage, I couldn't notice any problems with that: messages and minibuffer usage still take priority over the messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key components are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a display function, run on an idle timer (calls message with &lt;code&gt;message-log-max&lt;/code&gt; set to &lt;code&gt;nil&lt;/code&gt;, so that the displayed string does not get in the &lt;code&gt;*Messages*&lt;/code&gt; buffer)&lt;/li&gt;&#xA;&lt;li&gt;a redisplay function, run on a timer&lt;/li&gt;&#xA;&lt;li&gt;a function to stop the display, run in &lt;code&gt;pre-command-hook&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The only issue is that the display is stopped whenever a command is being run, which includes when typing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For those interested, I have extracted the relevant code into a boilerplate package available on &lt;a href=&quot;https://github.com/ThibautVerron/echo-sth.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-02-26T14:43:55.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9604" PostTypeId="2" ParentId="9600" CreationDate="2015-02-26T15:37:26.700" Score="11" Body="&lt;p&gt;Thanks to @MadhavanKumar, I focused on deriving a solution based on &lt;code&gt;defface&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realized that I can't override an existing &lt;code&gt;defface&lt;/code&gt; but I can always create my own background color sensitive &lt;code&gt;defface&lt;/code&gt;. Then the only question was how to use my custom defface instead of the original.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll use the same example of overriding the &lt;code&gt;stripe-hl-line&lt;/code&gt; face to walk through the solution. This face is defined in the package &lt;a href=&quot;https://github.com/sabof/stripe-buffer&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;stripe-buffer&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the steps:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 1. Define your own &lt;code&gt;defface&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defface my/stripe-hl-line&#xA;  '((((background dark))  (:overline &quot;gray&quot; :underline &quot;gray&quot; :foreground &quot;dodger blue&quot;))&#xA;    (t                    (:overline &quot;gray&quot; :underline &quot;gray&quot; :foreground &quot;red&quot;)))&#xA;  &quot;Bold face for highlighting the current line in Hl-Line mode.&quot;&#xA;  :group 'stripe-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will result in the foreground color of &lt;code&gt;my/stripe-hl-line&lt;/code&gt; face being &lt;em&gt;dodger blue&lt;/em&gt; for dark backgrounds and &lt;em&gt;red&lt;/em&gt; for light backgrounds.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 2. Create a function to remap the face&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;face-remap-add-relative&lt;/code&gt;&lt;/a&gt; function is used to remap an existing face to a new face. In this case, I am remapping the &lt;code&gt;stripe-hl-line&lt;/code&gt; face to &lt;code&gt;my/stripe-hl-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/stripe-hl-line-face-remap ()&#xA;  (face-remap-add-relative 'stripe-hl-line 'my/stripe-hl-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Step 3. Do the remapping at appropriate location&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;From the &lt;code&gt;stripe-buffer&lt;/code&gt; source, I see that the &lt;code&gt;hl-line&lt;/code&gt; face is remapped to &lt;code&gt;stripe-hl-line&lt;/code&gt; face. So we need to do our remapping after that remapping happens (which is in the &lt;a href=&quot;https://github.com/sabof/stripe-buffer/blob/c252080f55cb78c951b19ebab9687f6d00237baf/stripe-buffer.el#L322-323&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;stripe-listify-buffer&lt;/code&gt;&lt;/a&gt; function definition).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we do our remapping by advising &lt;code&gt;stripe-listify-buffer&lt;/code&gt; using the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advice-combinators.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;:after&lt;/code&gt;&lt;/a&gt; &lt;code&gt;advice&lt;/code&gt; combinator.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add 'stripe-listify-buffer :after #'my/stripe-hl-line-face-remap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Done!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, it would have been awesome to directly use something like &lt;code&gt;set-face-attribute&lt;/code&gt; to set faces based on the background darkness. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-26T16:53:13.870" LastActivityDate="2015-02-26T16:53:13.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9605" PostTypeId="1" AcceptedAnswerId="9606" CreationDate="2015-02-26T16:06:34.663" Score="6" ViewCount="1293" Body="&lt;pre&gt;&lt;code&gt;(setq callback (lambda ()&#xA;         (message &quot;hai i am a lambda&quot;)))&#xA;(funcall callback)&#xA;&#xA;(setq const-val &quot;hai, i am a const&quot;)&#xA;(message const-val)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;prints as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hai i am a lambda&#xA;hai, i am a const&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both of them are working perfect. that raises question about &lt;code&gt;setq&lt;/code&gt; behavior. Does it put the argument value in the symbol's function cell (or) variable cell?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-02-27T03:25:23.190" LastActivityDate="2015-02-27T03:25:23.190" Title="setq with lambda argument sets symbol's variable cell (or) function cell?" Tags="|elisp|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9606" PostTypeId="2" ParentId="9605" CreationDate="2015-02-26T16:12:37.677" Score="8" Body="&lt;p&gt;It places it in the variable cell.  The following example shows the distinction:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;*** Welcome to IELM ***  Type (describe-mode) for help.&#xA;ELISP&amp;gt; (setq callback (lambda () (message &quot;I am a lambda in a variable cell&quot;)))&#xA;(lambda nil&#xA;  (message &quot;I am a lambda in a variable cell&quot;))&#xA;&#xA;ELISP&amp;gt; (defun callback () (message &quot;I am a function in a function cell&quot;))&#xA;callback&#xA;ELISP&amp;gt; (funcall callback) ;; Call the function in the variable (expand the symbol)&#xA;&quot;I am a lambda in a variable cell&quot;&#xA;ELISP&amp;gt; (funcall 'callback) ;; Call the function defined by the symbol&#xA;&quot;I am a function in a function cell&quot;&#xA;ELISP&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-02-26T16:12:37.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9607" PostTypeId="2" ParentId="9605" CreationDate="2015-02-26T16:12:45.030" Score="7" Body="&lt;p&gt;It always uses the variable cell. You can tell because you are passing &lt;code&gt;callback&lt;/code&gt;s variable value into &lt;code&gt;funcall&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try running &lt;code&gt;(funcall 'callback)&lt;/code&gt;, you will get an error, because &lt;code&gt;callback&lt;/code&gt; has no value as a function, only a variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here you can see the value of your symbols as variables and functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq callback (lambda () (message &quot;hai i am a lambda&quot;)))&#xA;(setq const-val &quot;hai, i am a const&quot;)&#xA;&#xA;(symbol-value 'callback) ;; =&amp;gt; (lambda nil (message &quot;hai i am a lambda&quot;))&#xA;(symbol-function 'callback) ;; =&amp;gt; nil&#xA;&#xA;(symbol-value 'const-val) ;; =&amp;gt; &quot;hai, i am a const&quot;&#xA;(symbol-function 'const-val) ;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-02-26T18:37:40.660" LastActivityDate="2015-02-26T18:37:40.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9608" PostTypeId="1" AcceptedAnswerId="9611" CreationDate="2015-02-26T17:14:17.430" Score="6" ViewCount="1643" Body="&lt;p&gt;Is it possible to make projectile only switch projects when calling projectile-switch-project, and not follow the buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I switch buffers in emacs, projectile will switch project to the project that the current buffer belong to (if any).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually work on a project but have files open from other projects as well. I have an org file with my workitems and notes open (which belongs to my org project) and some test scripts (from my scripts project) and then the source of the project I am working on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes opening files using (helm)-projectile-find-file almost meaningless since I usually have to switch to a buffer from that project first, or do (helm)-projectile-switch-project. And then I can (almost) just as well use helm-find-files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still want projectile global mode active though so I can always do C-c p f to open a project file.&lt;/p&gt;&#xA;" OwnerUserId="6614" LastActivityDate="2015-02-26T20:08:31.853" Title="Can I make the projectile chosen project sticky and not follow the current buffer" Tags="|projectile|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9609" PostTypeId="2" ParentId="9579" CreationDate="2015-02-26T17:51:26.293" Score="1" Body="&lt;p&gt;A roundabout way of doing this is to simulate a clock report with column view:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: columnview :id local :format &quot;%70ITEM(Task) %Effort{:} %CLOCKSUM{:} %CLOCKSUM_T{:}&quot;&#xA;&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It avoids problems that clock reports have such as indentation and TODO keywords in headlines, but you don't get the fancy time break out or headline linking, if you are using those features. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Column view and clock reports seem to be equally lacking when it comes to sorting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be able to use something like &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-collector.html&quot; rel=&quot;nofollow&quot;&gt;org-collector&lt;/a&gt; to build something custom. &lt;a href=&quot;http://orgmode.org/worg/code/elisp/org-collector.el&quot; rel=&quot;nofollow&quot;&gt;The code&lt;/a&gt; is quite short.&lt;/p&gt;&#xA;" OwnerUserId="6616" LastActivityDate="2015-02-26T17:51:26.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9610" PostTypeId="2" ParentId="9376" CreationDate="2015-02-26T17:52:50.000" Score="2" Body="&lt;p&gt;Yasnippet can do what you want. Either a shortcut key-binding or a prefix substring can expand to a particular snippet. And each snippet can present a list of options via yas-choose-value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example snippet based on your example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;-&lt;em&gt;- mode: snippet; require-final-newline: nil -&lt;/em&gt;-&lt;/h1&gt;&#xA;&#xA;&lt;h1&gt;name: st&lt;/h1&gt;&#xA;&#xA;&lt;h1&gt;key: st&lt;/h1&gt;&#xA;&#xA;&lt;h1&gt;binding: direct-keybinding&lt;/h1&gt;&#xA;&#xA;&lt;h1&gt;--&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;${1:$$(yas-choose-value '(&quot;sometimes&quot; &quot;such that&quot;))}&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can type &quot;st&quot; and hit the yas-trigger-key (defaults to TAB but I have set mine to SHIFT-TAB), and I am prompted for a selection between the 2 possibilities.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my .init.el file I have the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(setq yas-prompt-functions '(&#xA;                             yas-ido-prompt&#xA;                             yas-x-prompt&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which by default uses ido as the selection method.  If you are on x-windows, you can use the x-prompt for a nice graphical popup.  There are other selection methods as well.&lt;/p&gt;&#xA;" OwnerUserId="6615" LastEditorUserId="6615" LastEditDate="2015-02-26T19:07:06.027" LastActivityDate="2015-02-26T19:07:06.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9611" PostTypeId="2" ParentId="9608" CreationDate="2015-02-26T17:57:46.833" Score="4" Body="&lt;p&gt;In general, projectile commands call &lt;code&gt;projectile-project-root&lt;/code&gt; to find the current project, and that works by looking at the current &lt;code&gt;default-directory&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can advise the project root function and have it return a fixed value instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar projectile-main-project &quot;~/projects/foo&quot;)&#xA;&#xA;(defun use-main-project (&amp;amp;rest args)&#xA;  &quot;Skip calling `projectile-project-root' when there is a main project defined.&quot;&#xA;  (when projectile-main-project&#xA;    projectile-main-project))&#xA;&#xA;(advice-add #'projectile-project-root :before-until #'use-main-project)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This implementation will check to see if &lt;code&gt;projectile-main-project&lt;/code&gt; is set and return that. If you set the main project to nil then you'll get the default projectile behavior instead. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a command to change the main project. Note that because we've advised &lt;code&gt;projectile-project-root&lt;/code&gt; above, this temporarily unsets the main project to allow projectile to figure out the project for the current buffer, then uses that result.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-main-project (&amp;amp;optional dir)&#xA;  &quot;Set the projectile main project based on the current buffer.&#xA;When called with argument DIR, make that main project instead.&quot;&#xA;  (interactive)&#xA;  (if dir&#xA;      (setq projectile-main-project dir)&#xA;      (let ((current-project))&#xA;        (let ((projectile-main-project nil))&#xA;          (setq current-project (projectile-project-root)))&#xA;        (setq projectile-main-project current-project))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using a version of Emacs that doesn't have &lt;code&gt;advice-add&lt;/code&gt; (older than Emacs 24.4) you can achieve the same result using &lt;code&gt;defadvice&lt;/code&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice projectile-project-root ( around use-main-project activate)&#xA;  &quot;Use the current main project, if any.&quot;&#xA;  (if projectile-main-project&#xA;      (setq ad-return-value projectile-main-project)&#xA;      ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-02-26T20:08:31.853" LastActivityDate="2015-02-26T20:08:31.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9612" PostTypeId="1" AcceptedAnswerId="9614" CreationDate="2015-02-26T18:06:00.930" Score="3" ViewCount="1570" Body="&lt;p&gt;here is my question, does org-mode has a assembly highlight?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer AT&amp;amp;T syntax, but Intel syntax is also fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For exmaple:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know org-mode has a code highlighting like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(+ 1 2 3 4)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what I am asking is that how can I highlighting assembly code ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC Assembly&#xA;mov 1, %eax&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it cannot work...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="2805" LastEditorUserId="2805" LastEditDate="2015-02-26T18:19:35.567" LastActivityDate="2021-10-11T07:54:33.263" Title="Does org-mode has a assembly highlight?" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9613" PostTypeId="1" AcceptedAnswerId="9617" CreationDate="2015-02-26T18:17:47.217" Score="12" ViewCount="4647" Body="&lt;p&gt;Here is my question, I have multiple lines of text, line this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;line1&#xA;line2&#xA;line3&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I want to create a org-mode table like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| C1    |&#xA;|-------|&#xA;| line1 |&#xA;| line2 |&#xA;| line3 | &#xA;| ....  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible ?&lt;/p&gt;&#xA;" OwnerUserId="2805" LastEditorUserId="504" LastEditDate="2016-05-23T07:48:40.143" LastActivityDate="2016-05-23T07:48:40.143" Title="Is it possible to copy /paste multiple lines of text into cells of org-mode table?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9614" PostTypeId="2" ParentId="9612" CreationDate="2015-02-26T18:29:25.013" Score="12" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src asm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The assembly mode in Emacs is called &lt;code&gt;asm-mode&lt;/code&gt;.  You can find that name by opening an assembly file and typing &lt;code&gt;M-: major-mode&lt;/code&gt; (assuming that Emacs automatically switches to the correct mode for your files).  For &lt;code&gt;#+begin_src&lt;/code&gt;, org-mode appends &lt;code&gt;-mode&lt;/code&gt; to the language name given, which is why &lt;code&gt;#+begin_src asm&lt;/code&gt; leads to &lt;code&gt;asm-mode&lt;/code&gt; being used.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="11" LastEditDate="2021-10-11T07:54:33.263" LastActivityDate="2021-10-11T07:54:33.263" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="9616" PostTypeId="2" ParentId="9613" CreationDate="2015-02-26T19:27:57.463" Score="11" Body="&lt;p&gt;Let's say you have an empty table as shown below and you want to paste few lines in column &lt;em&gt;C1&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|----+----|&#xA;| C0 | C1 |&#xA;|----+----|&#xA;|    |    |&#xA;|----+----|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Step 1: Copy the lines as a rectangle&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Copy the lines using &lt;code&gt;copy-rectangle-as-kill&lt;/code&gt; (&lt;code&gt;C-x r M-w&lt;/code&gt;) or cut them using &lt;code&gt;kill-rectangle&lt;/code&gt; (&lt;code&gt;C-x r k&lt;/code&gt;). Below shows the point and mark locations I used when copying/cutting the rectangle.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▯ine1&#xA;line2&#xA;line3▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Step 2: Make space for the lines to be inserted in the table&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|----+----|&#xA;| C0 | C1 |&#xA;|----+----|&#xA;|    |▮   |&#xA;|----+----|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the cursor in the desired column as shown above, call &lt;code&gt;org-open-line&lt;/code&gt; for the required number of times. For this example, we'll call it twice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|----+----|&#xA;| C0 | C1 |&#xA;|----+----|&#xA;|    |▮   |&#xA;|    |    |&#xA;|    |    |&#xA;|----+----|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Step 3: Paste the rectangle&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Paste the rectangle using &lt;code&gt;M-x yank-rectangle&lt;/code&gt; or &lt;code&gt;C-x r y&lt;/code&gt;. That will give you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|----+----|&#xA;| C0 | C1 |&#xA;|----+----|&#xA;|    |line1    |&#xA;|    |line2    |&#xA;|    |line3    |&#xA;|----+----|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;C-c C-c&lt;/code&gt; to auto align the table.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|----+-------|&#xA;| C0 | C1    |&#xA;|----+-------|&#xA;|    | line1 |&#xA;|    | line2 |&#xA;|    | line3 |&#xA;|----+-------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-26T19:56:40.350" LastActivityDate="2015-02-26T19:56:40.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9617" PostTypeId="2" ParentId="9613" CreationDate="2015-02-26T19:29:27.660" Score="16" Body="&lt;p&gt;Yes, that's possible:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Select lines you want to add to the table.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;C-c |&lt;/kbd&gt; (&lt;code&gt;org-table-create-or-convert-from-region&lt;/code&gt;). This will give you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| line1 |&#xA;| line2 |&#xA;| line3 |&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now all you need to do is add the header line. Here's one way of doing that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With point (the cursor) on &lt;code&gt;line1&lt;/code&gt;, press &lt;kbd&gt;C-o&lt;/kbd&gt; (&lt;code&gt;org-open-line&lt;/code&gt;), then enter &lt;code&gt;C1&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;C-c -&lt;/kbd&gt; (&lt;code&gt;org-ctrl-c-minus&lt;/code&gt;) to insert the separator.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-02-26T19:29:27.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9618" PostTypeId="1" CreationDate="2015-02-26T20:01:14.110" Score="1" ViewCount="36" Body="&lt;p&gt;Out of nowhere in the past couple days, running &lt;code&gt;M-x list-packages&lt;/code&gt; has started requiring me to select a coding system because of Chinese(?) characters in the buffer. Selecting the default, utf-8, works just fine. How can I avoid needed to select a coding system when trying to update my packages?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-02-26T20:01:14.110" Title="List-packages requiring me to select coding system" Tags="|package|" AnswerCount="0" CommentCount="3" ClosedDate="2015-02-26T22:38:50.267" ContentLicense="CC BY-SA 3.0" />
  <row Id="9619" PostTypeId="2" ParentId="9594" CreationDate="2015-02-26T20:34:01.613" Score="6" Body="&lt;p&gt;This is because &lt;code&gt;last-kbd-macro&lt;/code&gt; is a &lt;em&gt;terminal-local&lt;/em&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Multiple Terminals&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There aren't a large number of such variables in Emacs, so it's easy to get caught out by the fact that they exist at all, but also very helpful to be aware of the concept, as it helps you to jump to the correct conclusion in such situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;last-kbd-macro&lt;/code&gt; helpfully points out that it is terminal-local. (Obviously you would need to know where to look for that in the first place, but it gives you confirmation if you do.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you would want to do in this situation is either &lt;em&gt;name&lt;/em&gt; the keyboard macro and call it by name, or &lt;em&gt;assign it to a key&lt;/em&gt; and then use that key binding. You can read about those abilities in the manual:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Save Keyboard Macro&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-02-26T20:34:01.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9620" PostTypeId="2" ParentId="9412" CreationDate="2015-02-26T21:36:40.350" Score="0" Body="&lt;p&gt;I guess the more elegant approach consist on setting locally &lt;code&gt;org-link-abbrev-alist&lt;/code&gt; in some buffers, following its name, so that &lt;code&gt;file:&lt;/code&gt; links get overloaded.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local org-link-abbrev-alist&#xA;        '((&quot;file&quot; . &quot;%(custom logic)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="546" LastActivityDate="2015-02-26T21:36:40.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9621" PostTypeId="1" CreationDate="2015-02-26T22:31:26.807" Score="10" ViewCount="1347" Body="&lt;p&gt;When working with an iESS session of R and an R file open side-by-side, I noticed extremely slow performance when typing indetifiers. Typing braces and operators is fine, however, when an identifier is typed, there is very significant input lag (typed letters are appearing several second late). During this period, the the status of the iESS buffer flashes between &lt;code&gt;run&lt;/code&gt; and &lt;code&gt;no process&lt;/code&gt;. This happens most often when I am typing inside a function argument list and with a subordinate R process that consumes a sizeable chunk of memory (around 3G, a couple of big data frames and sparse matrices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have disabled &lt;code&gt;eldoc-mode&lt;/code&gt; and &lt;code&gt;company-mode&lt;/code&gt;, but ESS still seems to do something to the background R process synchronously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;What causes this? How can I profile ESS to find out how it spends time communicating with R?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;profiler-start&lt;/code&gt; and its friends, which show that Emacs spends 45% of its time in &lt;code&gt;term-emulate-terminal&lt;/code&gt; (I ran &lt;code&gt;htop&lt;/code&gt; in an ansi-term buffer to see the CPU usage of emacs and R) and 16% in the Automatic GC. That's hardly suspicious. I guess the time spent waiting for the subordinate process is considered idle time by the profiler.&lt;/p&gt;&#xA;" OwnerUserId="5368" LastActivityDate="2020-12-08T19:53:59.200" Title="How to find what causes ESS to run very slow?" Tags="|performance|ess|r|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9622" PostTypeId="1" AcceptedAnswerId="9629" CreationDate="2015-02-26T22:36:44.697" Score="3" ViewCount="166" Body="&lt;p&gt;With clock reports, one can set &lt;code&gt;:step day&lt;/code&gt;, and then I have a list of totals by day.&#xA;Like: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :tstart &quot;&amp;lt;-1w&amp;gt;&quot; :tend &quot;&amp;lt;+1d&amp;gt;&quot; :step day :scope (&quot;dev.org&quot; &quot;tst.org&quot;) :maxlevel 1 :narrow 65&#xA;| File      | Headline                                                          | Time   |&#xA;|-----------+-------------------------------------------------------------------+--------|&#xA;|           | ALL *Total time*                                                  | *6:38* |&#xA;|-----------+-------------------------------------------------------------------+--------|&#xA;| dev.org   | *File time*                                                       | *3:04* |&#xA;| tst.org   | *File time*                                                       | *3:34* |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's quite verbose, lots of info. I'd like a summary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to post-process that list so that I have the total productivity by day, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[2015-02-19 Thu] 6:38  (Dev.org 3:00, testing.org 3:20)  &#xA;[2015-02-20 Fri] 5:03  (Dev.org 3:00, testing.org 2:03)  &#xA;[2015-02-21 Sat] 4:30  (Dev.org 2:00, testing.org 2:30)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm willing to write some code to maybe grep out the relevant bits and glue it all together. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm kinda wondering, how do I go about starting something like this? I.e, what would be the building blocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use like the :formatter property with some function? or can I use bable to post-process this with some bash/grep/awk/sed/cut, or with python?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;  A bash solution.. &#xA;So far I've hacked myself something together with bash. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I generate a report as above. Then export it into ascii into report.txt. Then I use a bash script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat ~/git/LeoUfimtsev.github.io/org/reports.txt | egrep 'Daily|Total' | tr -d '[[:space:]]' | sed 's/Daily/\nDaily/g' | sed 's/\*Totaltime\*\*/ /g' | sed 's/Dailyreport://g' | sed 's/ALL/ /g' | sed -E -e 's/Thu|Fri|Sat|Sun|Mon|Tue|Wed|\*//g'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I get something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  37:47&#xA;2015-02-19  6:42&#xA;2015-02-20  4:02&#xA;2015-02-21  0:00&#xA;2015-02-22  2:55&#xA;2015-02-23  4:09&#xA;2015-02-24  4:37&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I just have to automate things.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open report.org buffer &lt;/li&gt;&#xA;&lt;li&gt;export to ascii &lt;/li&gt;&#xA;&lt;li&gt;run bash script &lt;/li&gt;&#xA;&lt;li&gt;show output somewhere &lt;/li&gt;&#xA;&lt;li&gt;Plot onto chart :-D&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think these are probably straight-forward enough for me to tacke on my own thou. That said, if anyone has any better advice, I'm open to suggestions.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-02-26T23:10:40.503" LastActivityDate="2015-02-27T02:55:17.907" Title="clockreport, total productivity by day?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9623" PostTypeId="1" CreationDate="2015-02-27T00:47:40.357" Score="17" ViewCount="9200" Body="&lt;p&gt;A dash (-), an en-dash (–) and an emdash (—) are different but difficult to tell apart. This causes problems e.g. when writing programs. Is there some way to tell  them apart easier  in emacs? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="2642" LastEditDate="2015-02-27T01:05:13.293" LastActivityDate="2018-06-20T00:13:06.800" Title="Tell a dash (-), an en-dash (–) and an emdash (—) apart" Tags="|unicode|typography|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9624" PostTypeId="2" ParentId="9623" CreationDate="2015-02-27T00:51:16.193" Score="9" Body="&#xA;&#xA;&lt;p&gt;To quote the docs:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;=&lt;/kbd&gt; runs the command &lt;code&gt;what-cursor-position&lt;/code&gt;, which is an interactive&#xA;  compiled Lisp function in &lt;code&gt;simple.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;=&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(what-cursor-position &amp;amp;optional DETAIL)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Print info on cursor position (on screen and within buffer). &lt;strong&gt;Also describe the character after point, and give its character code in octal, decimal and hex.&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For a non-ASCII multibyte character, also give its encoding in the buffer's selected coding system if the coding system encodes the character safely.  If the character is encoded into one byte, that code is shown in hex.  If the character is encoded into more than one byte, just &quot;...&quot; is shown.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;In addition, with prefix argument, show details about that character in *Help* buffer.&lt;/strong&gt;  See also the command `describe-char'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emphasis and formatting mine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try to remember these codes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;HYPHEN-MINUS&lt;/code&gt; 45&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;EN DASH&lt;/code&gt; 8211&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;EM DASH&lt;/code&gt; 8212&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But if you forget them, you can easily do &lt;kbd&gt;&lt;strong&gt;C-u&lt;/strong&gt;&lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;=&lt;/kbd&gt;, which pops up a buffer with extra info, including a &lt;code&gt;name:&lt;/code&gt; field.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-02-27T01:02:16.410" LastActivityDate="2015-02-27T01:02:16.410" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9625" PostTypeId="1" CreationDate="2015-02-27T01:00:39.013" Score="6" ViewCount="3683" Body="&lt;p&gt;I'm running GNU Emacs on Windows 7 and was just wondering how to set up emacs so the &quot;find-name-dired&quot; command works. When I try using find-name-dired to recursively search for files I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find . &quot;(&quot; -iname &quot;*.tex&quot; &quot;)&quot; -exec ls -ld {} &quot;;&quot;&#xA;File not found - &quot;*.tex&quot;  &#xA;find exited abnormally with code 2 at Thu Feb 26 16:58:31&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6584" LastActivityDate="2019-03-08T07:08:03.300" Title="Using find command on windows" Tags="|microsoft-windows|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9626" PostTypeId="2" ParentId="9625" CreationDate="2015-02-27T01:22:00.407" Score="3" Body="&lt;p&gt;Emacs relies on various Unix tools, including &lt;code&gt;find&lt;/code&gt;. On Windows you can install a Unix-style shell such as Cygwin, or just install ports of the specific tools you need. There are several options - I'm currently using tools from &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/&quot; rel=&quot;nofollow&quot;&gt;ezwinports&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whatever you choose, you'll need to make sure that the Unix &lt;code&gt;find&lt;/code&gt; command is on the path ahead of Windows one. You can do that with environment variables before starting emacs, or add to the emacs &lt;code&gt;exec-path&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-02-27T01:22:00.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9627" PostTypeId="2" ParentId="9623" CreationDate="2015-02-27T01:23:53.943" Score="10" Body="&lt;p&gt;&#xA;Here is a little fun with Unicode smiley faces.  The en-dash visually becomes a black smiley face.  The em-dash visually becomes a white smiley face.  Note, some Emacs versions may not support the smiley face Unicode characters -- it is only meant to be a demonstration -- other Unicode characters can of course be chosen.  Other faces can be used, and the user is free to compose his / her own faces.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((glyph-en-dash (make-glyph-code ?\u263A 'font-lock-keyword-face))&#xA;      (glyph-em-dash (make-glyph-code ?\u263B 'font-lock-function-name-face)) )&#xA;  (when (not buffer-display-table)&#xA;    (setq buffer-display-table (make-display-table)))&#xA;  (aset buffer-display-table 8211 `[,glyph-en-dash])&#xA;  (aset buffer-display-table 8212 `[,glyph-em-dash]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an updated example that effectively concatenates the hyphen-minus and adds color -- i.e., the &lt;code&gt;8211&lt;/code&gt; &lt;em&gt;visually&lt;/em&gt; becomes &lt;code&gt;--&lt;/code&gt; with the &lt;code&gt;font-lock-keyword-face&lt;/code&gt; as coloration; and, the &lt;code&gt;8212&lt;/code&gt; &lt;em&gt;visually&lt;/em&gt; becomes &lt;code&gt;---&lt;/code&gt; with the &lt;code&gt;font-lock-function-name-face&lt;/code&gt; as coloration.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((glyph-en-dash (make-glyph-code ?\u002D 'font-lock-keyword-face))&#xA;      (glyph-em-dash (make-glyph-code ?\u002D 'font-lock-function-name-face)) )&#xA;  (when (not buffer-display-table)&#xA;    (setq buffer-display-table (make-display-table)))&#xA;  (aset buffer-display-table 8211 `[,glyph-en-dash ,glyph-en-dash])&#xA;  (aset buffer-display-table 8212 `[,glyph-em-dash ,glyph-em-dash ,glyph-em-dash]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2018-06-20T00:13:06.800" LastActivityDate="2018-06-20T00:13:06.800" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="9628" PostTypeId="2" ParentId="9623" CreationDate="2015-02-27T02:05:23.187" Score="6" Body="&lt;p&gt;Use library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/highlight-chars.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/a&gt; to highlight any Unicode chars anyway you want. See &lt;a href=&quot;http://www.emacswiki.org/emacs/ShowWhiteSpace#HighlightChars&quot; rel=&quot;noreferrer&quot;&gt;Highlight Characters&lt;/a&gt; on Emacs Wiki.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use command &lt;code&gt;hc-highlight-chars&lt;/code&gt; to do highlight characters in four ways: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;individually &lt;/li&gt;&#xA;&lt;li&gt;using ranges&lt;/li&gt;&#xA;&lt;li&gt;using character classes (e.g. &lt;code&gt;[:digit:]&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;using character sets (e.g. &lt;code&gt;iso-8859-1&lt;/code&gt; or &lt;code&gt;lao&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;hc-highlight-chars&lt;/code&gt; prompts you for the character(s) to highlight in a particular face and the face to use for them.  (With a prefix arg it unhighlights.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you are prompted for the character(s) to highlight, you can use &lt;code&gt;C-x 8 RET&lt;/code&gt; to choose Unicode characters using completion.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-02-27T02:17:24.467" LastActivityDate="2015-02-27T02:17:24.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9629" PostTypeId="2" ParentId="9622" CreationDate="2015-02-27T02:55:17.907" Score="3" Body="&lt;p&gt;Regarding the sub-question: &lt;em&gt;Can I use like the :formatter property with some function? or can I use bable to post-process this with some bash/grep/awk/sed/cut, or with python?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can post-process a &lt;code&gt;clocktable&lt;/code&gt; by naming it and then referencing it using babel:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :properties (&quot;CLOCK&quot;) :header &quot;#+NAME: clocked\n&quot;&#xA;#+NAME: clocked&#xA;&#xA;#+END:&#xA;&#xA;#+begin_src emacs-lisp :var clocked=clocked :results table&#xA;(cl-loop for row in (subseq clocked 4) ; skip headers&#xA;         collect (list (org-parse-time-string (nth 0 row))&#xA;                       (org-duration-string-to-minutes (nth 2 row))))&#xA;#+end_src&#xA;&#xA;#+NAME: clocked-b&#xA;#+RESULTS:&#xA;| (0 48 23 26 2 2015 nil nil nil) | 19 |&#xA;| (0 42 23 26 2 2015 nil nil nil) |  6 |&#xA;| (0 9 22 26 2 2015 nil nil nil)  |  3 |&#xA;| (0 6 22 26 2 2015 nil nil nil)  |  2 |&#xA;| (0 2 22 26 2 2015 nil nil nil)  |  4 |&#xA;| (0 55 21 26 2 2015 nil nil nil) |  7 |&#xA;| (0 41 21 26 2 2015 nil nil nil) | 13 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll need to figure out the aggregating...&lt;/p&gt;&#xA;" OwnerUserId="6620" LastActivityDate="2015-02-27T02:55:17.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9630" PostTypeId="1" CreationDate="2015-02-27T05:22:03.583" Score="3" ViewCount="268" Body="&lt;p&gt;I like to use highlighting when working with emacs.  But I don't like some of the default settings.  I recently installed emacs 24.4 on my iMac.  I really don't like all the highlighting of math expressions such as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$5$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I used to do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'tex-font-lock-syntactice-face-function 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'tex-math-face 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that no longer works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I disable highlight for math expressions but keep most everything else?&lt;/p&gt;&#xA;" OwnerUserId="2364" LastActivityDate="2015-06-24T21:20:08.530" Title="How do I turn off highlighting for $...$ in tex-mode" Tags="|syntax-highlighting|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9631" PostTypeId="1" AcceptedAnswerId="9634" CreationDate="2015-02-27T08:27:21.870" Score="20" ViewCount="6318" Body="&lt;p&gt;I was reading the the &lt;a href=&quot;http://capitaomorte.github.io/yasnippet/snippet-expansion.html&quot;&gt;documentation&lt;/a&gt; for Yasnippet mode, when I came to the section where the trigger key is defined:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like Yasnippet minor mode defines the &lt;kbd&gt;TAB&lt;/kbd&gt; key to run &lt;code&gt;yas-expand&lt;/code&gt; using:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'yas-expand)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) 'yas-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the difference between &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; and &lt;code&gt;TAB&lt;/code&gt;?&#xA;(I tried to google this but I could not find a clear description)&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-02-27T09:39:27.000" Title="What is the difference between TAB and &lt;tab&gt;?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9632" PostTypeId="1" AcceptedAnswerId="9643" CreationDate="2015-02-27T09:35:43.097" Score="4" ViewCount="789" Body="&lt;p&gt;I have recently installed &lt;code&gt;helm&lt;/code&gt; but haven't gotten very far with using it so far. I noticed that I can run the command &lt;code&gt;helm-pdfgrep-help&lt;/code&gt; and it shows me a list of keybindings. But I don't have a &lt;code&gt;helm-pdfgrep&lt;/code&gt; (or &lt;code&gt;pdfgrep-help&lt;/code&gt; for that matter). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the deal? The idea of using helm to search text in my pdf library sounds extremely useful. But a quick search on the web does not lead me to think &lt;code&gt;helm-pdfgrep&lt;/code&gt; even exists.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2018-08-28T08:49:13.563" Title="Where is `helm-pdfgrep`?" Tags="|helm|pdf|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9633" PostTypeId="1" AcceptedAnswerId="9658" CreationDate="2015-02-27T09:38:25.863" Score="6" ViewCount="540" Body="&lt;p&gt;Is it possible to configure emacs so it uses different theme for tramp buffers than for defaults? Say, I use twilight by default, but while editing sth via ssh I'd like to switch to pastels-on-dark...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Changing colors are great at providing a feeling that ”something is different”…&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question in fact covers a few problems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) whether there is any &lt;em&gt;natural&lt;/em&gt; way to use per-buffer theme (I failed to find one)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) if not, what is the best way to hook emacs so it switches theme depending on the current buffer (so far I have preliminary solution I am not happy with, see below)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) and, specifically, how to adapt that to &lt;em&gt;tramp&lt;/em&gt; case&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I found load-theme-buffer-local. For some reason it does not work for me (once I call it on some buffer, the same theme remains active for every other buffer too).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a partial solution for b) case I found some-time ago. I am not happy  with it (it fires only when I open new file and does not react to buffer switch, it fails to revert to default in some cases, and it works only for per-dir-tree case), but maybe it could be improved:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; in .emacs&#xA;&#xA;(defvar my-local-theme nil &#xA;   &quot;Name of current theme (intended to be overriden where necessary)&quot;)&#xA;&#xA;(defun my-set-local-theme ()&#xA;   &quot;If variable mkylocal-theme is set, loads this theme.&quot;&#xA;   (interactive)&#xA;   (when (bound-and-true-p my-local-theme)&#xA;       (unless(member my-local-theme custom-enabled-themes)&#xA;       (message &quot;Setting local theme to %s on %s&quot; my-local-theme (current-buffer))&#xA;       (load-theme my-local-theme t))))&#xA;&#xA;(add-hook 'hack-local-variables-hook 'my-set-local-theme)&#xA;&#xA;;; In .dir-locals.el on top of some source tree&#xA;&#xA;(&#xA;  (nil&#xA;    (my-local-theme . twilight-anti-bright)&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For completeness: I also use the following trick to load themes cleanly, so the code above does not unload themes.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-init-hook&#xA;      (lambda nil&#xA;        (defadvice load-theme &#xA;          (before theme-dont-propagate activate)&#xA;          (mapcar #'disable-theme custom-enabled-themes))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-03-02T22:55:36.953" Title="Using different theme on tramp buffers (and buffer-related themes in general)?" Tags="|hooks|themes|tramp|local-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9634" PostTypeId="2" ParentId="9631" CreationDate="2015-02-27T09:39:27.000" Score="17" Body="&lt;p&gt;Although Emacs usually translates &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; (the single key) to&#xA;&lt;kbd&gt;TAB&lt;/kbd&gt; (&lt;kbd&gt;C-i&lt;/kbd&gt;), you can bind &lt;kbd&gt;&amp;lt;tab&amp;gt;&lt;/kbd&gt;&#xA;and &lt;kbd&gt;TAB&lt;/kbd&gt; to different things:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;tab&amp;gt;&quot;) #'proced)&#xA;(global-set-key (kbd &quot;TAB&quot;) #'indent-for-tab-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-02-27T09:39:27.000" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9635" PostTypeId="1" AcceptedAnswerId="9639" CreationDate="2015-02-27T09:51:22.487" Score="0" ViewCount="411" Body="&lt;p&gt;My &lt;code&gt;org-mode&lt;/code&gt; TODO list looks like this in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*Angular&#xA;**Two way binding&#xA;***{{modelName}}&#xA;**Controller&#xA;***Do crud operations&#xA;***Different scopes across the application&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wanted to present it using &lt;a href=&quot;https://github.com/rlister/org-present&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-present&lt;/code&gt;&lt;/a&gt;, which I enabled by doing &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;org-present&lt;/code&gt;. This removed all hierarchy-related asterisks and turned the visible text into a plain list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Angular&#xA;Two way binding&#xA;{{modelName}}&#xA;Controller&#xA;Do crud operations&#xA;Different scopes across the application&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am interested in preserving the hierarchy levels for display. How can I do that in &lt;code&gt;org-present-mode&lt;/code&gt; (or any other presentation mode for Emacs)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, I noticed that &lt;code&gt;org-present-mode&lt;/code&gt; doesn't get toggled when I do &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;org-present&lt;/code&gt; twice.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="504" LastEditDate="2015-02-27T14:32:15.440" LastActivityDate="2015-02-27T14:32:15.440" Title="org-present mode makes asterisk characters invisible" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9636" PostTypeId="1" AcceptedAnswerId="9638" CreationDate="2015-02-27T10:41:34.473" Score="1" ViewCount="158" Body="&lt;p&gt;Firefox 36.0 doesn't have &lt;code&gt;-remote&lt;/code&gt; option, which is used in the function &lt;code&gt;browse-url-firefox&lt;/code&gt; for &lt;code&gt;system-type&lt;/code&gt; gnu/linux by default. How to conveniently bypass this issue?&lt;/p&gt;&#xA;" OwnerUserId="2064" LastActivityDate="2015-02-27T11:58:51.363" Title="How to fix browse-url-firefox for firefox 36.0 in linux?" Tags="|linux|web-browser|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9637" PostTypeId="1" AcceptedAnswerId="9642" CreationDate="2015-02-27T11:54:21.220" Score="2" ViewCount="1227" Body="&lt;p&gt;Emacs 24.3 had a nice way of inserting text into rectangles:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Select rectangle.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-x r t&lt;/code&gt; &lt;code&gt;&amp;lt;string-to-be-inserted&amp;gt;&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem to work in Emacs 24.4. I tried &lt;code&gt;rectangle-mark-mode&lt;/code&gt; using &lt;code&gt;C-x SPC&lt;/code&gt;. I could managed to insert a yanked rectangle, but how does one insert fresh text into the rectangle?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="3849" LastEditorUserId="504" LastEditDate="2015-02-27T15:02:47.033" LastActivityDate="2015-02-27T15:02:47.033" Title="rectangle-insert in Emacs 24.4" Tags="|emacs24.4|rectangle|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="9638" PostTypeId="2" ParentId="9636" CreationDate="2015-02-27T11:58:51.363" Score="2" Body="&lt;p&gt;The current &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/log/?h=emacs-24&quot; rel=&quot;nofollow&quot;&gt;emacs-24&lt;/a&gt; development branch of Emacs was just updated with the &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-24&amp;amp;id=1b0ebbdb566a8dfa5f45ce121b2c835e9760091f&quot; rel=&quot;nofollow&quot;&gt;corresponding change&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can clone and build from it, try applying the same change to your local installation, or wait for Emacs 24.5 to come out, which shouldn't take long now.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2015-02-27T11:58:51.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9639" PostTypeId="2" ParentId="9635" CreationDate="2015-02-27T12:04:37.473" Score="1" Body="&lt;p&gt;You're raising two separate issues.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Keeping asterisks visible&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-present&lt;/code&gt; calls &lt;code&gt;org-present-add-overlays&lt;/code&gt;, which is responsible for making the leading asterisks invisible. Here is a modified version of &lt;code&gt;org-present-add-overlays&lt;/code&gt; that you can add to your init-file to make sure asterisks stay visible:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-present-add-overlays ()&#xA;  &quot;Add overlays for this mode.&quot;&#xA;  (add-to-invisibility-spec '(org-present))&#xA;  (save-excursion&#xA;    ;; hide org-mode options starting with #+&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward &quot;^[[:space:]]*\\(#\\+\\)\\([^[:space:]]+\\).*&quot; nil t)&#xA;      (let ((end (if (org-present-show-option (match-string 2)) 2 0)))&#xA;        (org-present-add-overlay (match-beginning 1) (match-end end))))&#xA;    ;; hide emphasis markers&#xA;    (let ((org-emph-re &quot;\\([ \t('\&quot;{]\\|^\\)\\(\\([/_=~+]\\)\\([^ \t\r\n,\&quot;']\\|[^ \t\r\n,\&quot;'].*?\\(?:\n.*?\\)\\{0,1\\}[^ \t\r\n,\&quot;']\\)\\3\\)\\([- \t.,:!?;'\&quot;)}\\]\\|$\\)&quot;))&#xA;      (while (re-search-forward org-emph-re nil t)&#xA;        (org-present-add-overlay (match-beginning 2) (1+ (match-beginning 2)))&#xA;        (org-present-add-overlay (1- (match-end 2)) (match-end 2))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;org-present&lt;/code&gt; won't toggle &lt;code&gt;org-present-mode&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;As described &lt;a href=&quot;https://github.com/rlister/org-present#configuration&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, there is a separate command for ending a presentation and going back to &quot;vanilla&quot; &lt;code&gt;org-mode&lt;/code&gt;. It is called &lt;code&gt;org-present-quit&lt;/code&gt;; the default binding for it is &lt;code&gt;C-c C-q&lt;/code&gt;, so just hit that if you want to get out of &lt;code&gt;org-present-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you want to be able to use the &lt;code&gt;org-present&lt;/code&gt; command as a toggle, you can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;advise&lt;/a&gt; it as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-present-toggle (orig)&#xA;  (if (not org-present-mode)&#xA;      (funcall orig)&#xA;    (org-present-quit)))&#xA;&#xA;(advice-add 'org-present :around #'org-present-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-02-27T14:22:38.503" LastActivityDate="2015-02-27T14:22:38.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9640" PostTypeId="1" AcceptedAnswerId="9641" CreationDate="2015-02-27T13:20:22.977" Score="3" ViewCount="1254" Body="&lt;p&gt;I have configured flyspell mode with use-package like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package flyspell-mode&#xA;  :init&#xA;  (progn&#xA;    (flyspell-mode 1))&#xA;  :config&#xA;  (progn &#xA;    (setq ispell-program-name &quot;aspell&quot;)&#xA;    (setq ispell-list-command &quot;--list&quot;) ;; run flyspell with aspell, not ispell&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this gives me the following message while starting up Emacs in &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could not load package flyspell-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although if I manually give this command &lt;code&gt;flyspell-mode&lt;/code&gt;, it works.&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2015-02-27T13:35:59.550" Title="Could not load package flyspell with use-package" Tags="|use-package|flyspell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9641" PostTypeId="2" ParentId="9640" CreationDate="2015-02-27T13:35:59.550" Score="5" Body="&lt;p&gt;The package name is &lt;code&gt;flyspell&lt;/code&gt; instead of &lt;code&gt;flyspell-mode&lt;/code&gt;, so the 1st argument of &lt;code&gt;use-package&lt;/code&gt; is &lt;code&gt;flyspell&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-02-27T13:35:59.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9642" PostTypeId="2" ParentId="9637" CreationDate="2015-02-27T13:36:55.477" Score="6" Body="&lt;p&gt;&lt;code&gt;C-x r t&lt;/code&gt; should still work in 24.4 just as in 24.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get the same functionality from &lt;code&gt;C-x SPC&lt;/code&gt; by hitting &lt;code&gt;C-t&lt;/code&gt; after you've selected the rectangle of interest.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-02-27T13:36:55.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9643" PostTypeId="2" ParentId="9632" CreationDate="2015-02-27T14:00:39.173" Score="5" Body="&lt;p&gt;Running &lt;code&gt;ag 'define.*pdf.*grep'&lt;/code&gt; (use &lt;code&gt;grep&lt;/code&gt; instead of &lt;code&gt;ag&lt;/code&gt; if you prefer) in the &lt;code&gt;elpa/&lt;/code&gt; directory returns this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;helm-20150226.818/helm-locate.el&#xA;99:    (define-key map (kbd &quot;M-g p&quot;)   'helm-ff-run-pdfgrep)&#xA;&#xA;helm-20150226.818/helm-files.el&#xA;297:    (define-key map (kbd &quot;M-g p&quot;)         'helm-ff-run-pdfgrep)&#xA;&#xA;helm-20150226.818/helm-grep.el&#xA;229:    (define-key map (kbd &quot;C-c ?&quot;)    'helm-pdfgrep-help)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the command to run &lt;code&gt;pdfgrep&lt;/code&gt; using &lt;code&gt;helm&lt;/code&gt; would be &lt;code&gt;helm-ff-run-pdfgrep&lt;/code&gt;. Note that you need to have &lt;a href=&quot;http://pdfgrep.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;pdfgrep&lt;/code&gt;&lt;/a&gt; installed on your system for this to work.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You should be able to find out the same using &lt;code&gt;apropos-command&lt;/code&gt; or &lt;code&gt;C-h a pdfgrep RET&lt;/code&gt;. Another command you can called interactively is &lt;code&gt;helm-do-pdfgrep&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I was unable to do so because I don't use &lt;code&gt;helm&lt;/code&gt; and didn't &lt;code&gt;require&lt;/code&gt; it but I had it installed.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-02-27T14:21:45.937" LastActivityDate="2015-02-27T14:21:45.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9644" PostTypeId="1" AcceptedAnswerId="9646" CreationDate="2015-02-27T14:28:46.593" Score="19" ViewCount="2623" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How does one create and use &lt;code&gt;:keywords&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a (naive, apparently) attempt to access the following toy alist:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf alist '((:key-1 &quot;Key no. 1&quot;)&#xA;              (:key-2 &quot;Key no. 2&quot;)))&#xA;&#xA;(assq :key-1 alist)                 ; =&amp;gt; (:key-1 &quot;Key no. 1&quot;)&#xA;(assq (make-symbol &quot;:key-1&quot;) alist) ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first key works as expected, but the second key does not.  Insofar as there is no obvious &lt;code&gt;make-keyword&lt;/code&gt; function, how does one create and use a keyword?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Original motivation: I need to transform a string into a lookup key that is a symbol onto which I can &lt;code&gt;put&lt;/code&gt; properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In the process of formulating this question, I've gotten to at least part of the answer, which I'm posting separately.  I'm hoping brighter minds than mine can improve upon it.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-27T15:35:41.763" Title="How to create :keywords?" Tags="|elisp|symbols|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9645" PostTypeId="2" ParentId="9644" CreationDate="2015-02-27T14:29:10.963" Score="3" Body="&lt;p&gt;Here's a partial answer to this question.  The short and not entirely satisfying version seems to be: use &lt;code&gt;intern&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:key-1&lt;/code&gt; satisfies both:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbolp :key-1)                    ; =&amp;gt; t&#xA;(keywordp :key-1)                   ; =&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While &lt;code&gt;(make-symbol &quot;:key-1&quot;)&lt;/code&gt; satisfies the first but not the second:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbolp (make-symbol &quot;:key-1&quot;))    ; =&amp;gt; t&#xA;(keywordp (make-symbol &quot;:key-1&quot;))   ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, the docstring for &lt;code&gt;make-symbol&lt;/code&gt; says that it will:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return a newly allocated uninterned symbol whose name is NAME.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Mmmkay, and the docstring for &lt;code&gt;keywordp&lt;/code&gt; says that it will:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return &lt;code&gt;t&lt;/code&gt; if OBJECT is a keyword.&#xA;  This means that it is a symbol with a print name beginning with &lt;code&gt;:&lt;/code&gt;&#xA;  interned in the initial obarray.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it appears that &lt;code&gt;intern&lt;/code&gt; will work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assq (intern &quot;:key-1&quot;) alist)      ; =&amp;gt; (:key-1 &quot;Key no. 1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because &lt;code&gt;intern&lt;/code&gt; will:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return the canonical symbol whose name is STRING.&#xA;  If there is none, one is created by this function and returned.&#xA;  A second optional argument specifies the obarray to use;&#xA;  it defaults to the value of &lt;code&gt;obarray&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But this doesn't seem to be &lt;code&gt;:keyword&lt;/code&gt; specific, as it applies to all symbols.  By default, it also appears to pollute the global &lt;code&gt;obarray&lt;/code&gt;, which may or may not be A Big Deal.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-27T14:29:10.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9646" PostTypeId="2" ParentId="9644" CreationDate="2015-02-27T14:42:35.450" Score="11" Body="&lt;p&gt;You are right that &lt;code&gt;make-symbol&lt;/code&gt; will create a keyword that is not &lt;code&gt;eq&lt;/code&gt; to any existing keyword, and &lt;code&gt;intern&lt;/code&gt; might pollute the global obarray with the new symbol. In between those, you have &lt;code&gt;intern-soft&lt;/code&gt;, which returns the symbol if it has already been created, or &lt;code&gt;nil&lt;/code&gt; if it hasn't:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (intern-soft &quot;:key-1&quot;)&#xA;nil&#xA;ELISP&amp;gt; :key-1&#xA;:key-1&#xA;ELISP&amp;gt; (intern-soft &quot;:key-1&quot;)&#xA;:key-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should be suitable for your purpose: if the keyword doesn't exist, it cannot be present in the alist, so there is no need to create it just to check whether it's there.  Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((maybe-keyword (intern-soft &quot;:key-1&quot;)))&#xA;  (and maybe-keyword (assq maybe-keyword alist)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-02-27T14:42:35.450" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9647" PostTypeId="1" AcceptedAnswerId="9648" CreationDate="2015-02-27T14:44:32.473" Score="5" ViewCount="540" Body="&lt;p&gt;I have this notification system in emacs that opens a new buffer with a reminder and relevant info at specified times. However, if I am using my browser I can't see it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I am wondering whether it is possible to open a new emacs frame that steals the focus from other apps?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2015-02-27T16:56:01.387" LastActivityDate="2015-02-28T17:13:49.617" Title="Open new emacs frame that steals focus from other apps?" Tags="|frames|focus|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9648" PostTypeId="2" ParentId="9647" CreationDate="2015-02-27T15:04:52.233" Score="1" Body="&lt;p&gt;This should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-timer&#xA; 3 nil&#xA; (lambda ()&#xA;   (select-frame-set-input-focus (new-frame)))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="3863" LastEditDate="2015-02-28T17:13:49.617" LastActivityDate="2015-02-28T17:13:49.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9649" PostTypeId="2" ParentId="9647" CreationDate="2015-02-27T15:19:32.040" Score="1" Body="&lt;p&gt;What @abo-abo says is almost enough to do what you want (since you explicitly ask not only that the frame be shown on top but also that it be focused).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it leaves out is that &lt;em&gt;raising a frame does not necessarily focus it&lt;/em&gt; (select it for input focus).  The behavior can depend on your window manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On MS Windows, you can set or bind variable &lt;em&gt;&lt;code&gt;w32-grab-focus-on-raise&lt;/code&gt;&lt;/em&gt; to cause raising to always also focus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can add a call to &lt;strong&gt;&lt;code&gt;select-frame-set-input-focus&lt;/code&gt;&lt;/strong&gt; to your code. That explicitly focuses the frame.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-02-27T16:56:25.520" LastActivityDate="2015-02-27T16:56:25.520" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9650" PostTypeId="2" ParentId="9488" CreationDate="2015-02-27T15:29:38.643" Score="9" Body="&lt;p&gt;Depending on your preference, you can use the following line in your &lt;code&gt;.emacs&lt;/code&gt; to set your default coding system to utf-8. That resolved the problem for me, and I haven't noticed any other negative side effects yet.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-02-27T15:29:38.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9651" PostTypeId="2" ParentId="9644" CreationDate="2015-02-27T15:35:41.763" Score="8" Body="&lt;p&gt;Perhaps I'm not understanding the question correctly.  But if you &lt;em&gt;want a keyword&lt;/em&gt; (i.e., you want to satisfy &lt;code&gt;keywordp&lt;/code&gt;) then you &lt;em&gt;want the symbol to be interned in the global obarray&lt;/em&gt;, &lt;code&gt;obarray&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It &lt;strong&gt;must&lt;/strong&gt; be interned there to satisfy &lt;code&gt;keywordp&lt;/code&gt;, AFAICT, and &lt;code&gt;C-h f keywordp&lt;/code&gt; says so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer to your question, AFAICT, is just to &lt;strong&gt;use &lt;code&gt;intern&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like you are perhaps not asking your real question - seems like an XY question. What are you really trying to do? (Maybe pose that as a separate question.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[In answer to your comment that interning &quot;&lt;em&gt;is not &lt;code&gt;:keyword&lt;/code&gt; specific, as it applies to all symbols&lt;/em&gt;&quot;: Correct, interning is not specific to keywords. But interning (in &lt;code&gt;obarray&lt;/code&gt;) and using a &lt;code&gt;symbol-name&lt;/code&gt; that starts with &lt;code&gt;:&lt;/code&gt; is specific to keywords.]&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-02-27T15:35:41.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9652" PostTypeId="2" ParentId="5355" CreationDate="2015-02-27T16:12:44.227" Score="3" Body="&lt;p&gt;As Constantine wrote you can run an Org Babel snippet to fetch the image from the remote server with &lt;code&gt;wget&lt;/code&gt; and display link the local copy of the image.  This leaves you with the problem that the snippet would only be run once unless you force re-evaluation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An out-of-emacs solution is to set up a cron job or similar to repeatedly fetch the image from the remote and overwrite a well-known file which would be linked in your org file.  That too seems ugly to me, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A cleaner solution would be to write a function that fetches the image and then redisplays inline images in one go.  You could then simply run the function to update the status image on demand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something along these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun update-my-pic (url filename)&#xA;  (shell-command (concat &quot;wget -O &quot; filename &quot; &quot; url))&#xA;  (org-redisplay-inline-images))&#xA;&#xA;(update-my-pic &quot;https://www.gravatar.com/avatar/d593a36fb27c41445fade43a1fdd632c&quot; &quot;~/tmp/pic.png&quot;)&#xA;(update-my-pic &quot;https://www.gravatar.com/avatar/917480313534cf1fd09009e861a2c52d&quot; &quot;~/tmp/pic.png&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This would update a picture link to a file &quot;~/tmp/pic.png&quot;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-02-27T17:09:06.293" LastActivityDate="2015-02-27T17:09:06.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9653" PostTypeId="1" AcceptedAnswerId="9688" CreationDate="2015-02-27T16:43:40.193" Score="2" ViewCount="316" Body="&lt;p&gt;I'm looking for a way to redefine the row of numeric keys so that by default it will act as if I'm holding &lt;code&gt;&amp;lt;shift&amp;gt;&lt;/code&gt; giving me the punctuation and symbol characters, and holding &lt;code&gt;&amp;lt;shift&amp;gt;&lt;/code&gt; will give me the numbers. Basically reversing the behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My issue is, I don't want the keypad keys to change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;pressing '4' up top would give &lt;code&gt;$&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;pressing '4' on the keypad would give &lt;code&gt;4&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I see how I could do the reverse: redefine the keypad keys, but the default behavior of the keypad numeric keys is to translate to the number, so redefining the number keys will affect both, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know a way I could do this? Or maybe this has already been done somewhere?&lt;/p&gt;&#xA;" OwnerUserId="6624" LastActivityDate="2017-01-25T17:51:44.530" Title="Change default behavior of numeric key row?" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9654" PostTypeId="1" AcceptedAnswerId="9745" CreationDate="2015-02-27T17:01:02.183" Score="0" ViewCount="477" Body="&lt;p&gt;I'm using iTerm2, and I would like to remap some of the meta keys. In my .emacs I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-g&quot;) 'goto-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in my iTerm2 settings I have both &quot;option&quot; keys set to send +Esc. I can use any of the default key bindings like normal, but M-g, (or others I've remapped) still send the default command. I've tried changing iTerm2 to send meta, but it instead injects non-printable ascii characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best workaround to get these key bindings to work under iTerm2? Is there a clearer solution than to have my .emacs check if I'm using a Mac, and if so then use &lt;code&gt;(kdb &quot;Esc-g&quot;)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2804" LastEditorUserId="253" LastEditDate="2015-02-28T17:37:40.700" LastActivityDate="2015-03-02T17:27:30.443" Title="Unable to remap key bindings involving meta under iTerm2" Tags="|key-bindings|osx|terminal-emacs|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9655" PostTypeId="1" CreationDate="2015-02-27T17:27:43.190" Score="2" ViewCount="377" Body="&lt;p&gt;My buffer has one line as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;i am sitting on an overlay&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when i do, &lt;code&gt;M-x some-function-to-hide&lt;/code&gt;, i like to hide the text from display, and show three dots as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am looking forward to have a &quot;hello world&quot; program to understand overlays. &lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-02-28T01:35:35.953" Title="A simple overlay program" Tags="|overlays|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9656" PostTypeId="1" AcceptedAnswerId="9672" CreationDate="2015-02-27T19:02:36.463" Score="5" ViewCount="1434" Body="&lt;p&gt;In org mode, a file can be included for export using &lt;code&gt;#+Include: filename&lt;/code&gt;.  Is there an easy way to open a file in an include statement?&#xA;I've tried &lt;kbd&gt;C-c C-o&lt;/kbd&gt;, but emacs states &quot;no link found&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-03-01T12:09:22.383" Title="Opening include files from org-mode" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9657" PostTypeId="2" ParentId="9656" CreationDate="2015-02-27T19:16:55.553" Score="8" Body="&lt;p&gt;There exists a generic solution not limited to &lt;code&gt;org-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x ffap&lt;/code&gt; (alias of &lt;code&gt;find-file-at-point&lt;/code&gt;) does exactly what it sounds like it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-find-files&lt;/code&gt; also automatically populates the minibuffer with the filename at the point if one exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use one of these commands and then hit return to visit the file under the point.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-02-27T19:16:55.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9658" PostTypeId="2" ParentId="9633" CreationDate="2015-02-27T20:13:30.537" Score="4" Body="&lt;p&gt;I don't know how to enable/disable custom-themes for a buffer only. The following works for changing the global custom-theme when you enter a Tramp buffer, or when you leave it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook&#xA;  'buffer-list-update-hook&#xA;  (lambda ()&#xA;    (if (and (not (window-minibuffer-p))&#xA;        (file-remote-p default-directory))&#xA;       (enable-theme 'pastels-on-dark)&#xA;     (disable-theme 'pastels-on-dark))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-02-27T20:13:30.537" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9659" PostTypeId="1" AcceptedAnswerId="9660" CreationDate="2015-02-27T21:45:23.640" Score="2" ViewCount="173" Body="&lt;p&gt;In org-mode if I am typing the lines will wrap to the next line at around 70 characters.  However if I yank text from the OS clipboard into the org-mode buffer, then the text will not wrap but be on one long line.  How can I get the text to wrap upon being yanked?&lt;/p&gt;&#xA;" OwnerUserId="6626" LastActivityDate="2015-03-02T14:04:46.157" Title="How to wrap yanked text" Tags="|org-mode|text-editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9660" PostTypeId="2" ParentId="9659" CreationDate="2015-02-27T21:48:29.760" Score="0" Body="&lt;p&gt;&lt;code&gt;M-q&lt;/code&gt; which is the command &lt;code&gt;fill-paragraph&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also &lt;code&gt;fill-region&lt;/code&gt;. This command is more accurate because the region is automatically defined as whatever you just yanked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;&#xA;Here's some elisp I whipped up to do this automatically after yanks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (command '(yank yank-pop))&#xA;   (eval `(defadvice ,command (after indent-region activate)&#xA;            (fill-region (region-beginning) (region-end)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;/strike&gt;&#xA;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@kaushalmodi mentioned that using advices like this could result in unwanted behavior. His suggestion of a wrapper function could be implemented like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-yank-and-fill (&amp;amp;optional arg)&#xA;  &quot;Fills the region immediately after yanking.&quot;&#xA;  (interactive)&#xA;  (yank arg)&#xA;  (fill-region (region-beginning) (region-end)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing the same for &lt;code&gt;yank-pop&lt;/code&gt; doesn't work though. It says &quot;last command was not a yank&quot;, enough though a normal &lt;code&gt;yank-pop&lt;/code&gt; works. But, you can just call &lt;code&gt;fill-region&lt;/code&gt; separately after all your &lt;code&gt;yank-pop&lt;/code&gt;ing to fill the final result.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-03-02T14:04:46.157" LastActivityDate="2015-03-02T14:04:46.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9661" PostTypeId="2" ParentId="9653" CreationDate="2015-02-27T22:08:59.363" Score="0" Body="&lt;p&gt;If you are under X you can use xmodmap to redefine your keys. i don't have numeric keyboard at hand, but quick web search says numerics send different codes. &#xA;Here is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;keycode 10 = exclam 1&#xA;keycode 11 = at 2&#xA;keycode 12 = numbersign 3&#xA;keycode 13 = dollar 4&#xA;keycode 14 = percent 5&#xA;keycode 15 = asciicircum 6&#xA;keycode 16 = ampersand 7&#xA;keycode 17 = asterisk 8&#xA;keycode 18 = parenleft 9&#xA;keycode 19 = parenright 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I don't have pure-emacs solution for that...&lt;/p&gt;&#xA;" OwnerUserId="714" LastActivityDate="2015-02-27T22:08:59.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9662" PostTypeId="1" CreationDate="2015-02-27T23:19:52.730" Score="2" ViewCount="189" Body="&lt;p&gt;Sometimes I open &lt;code&gt;ido-find-file&lt;/code&gt; or &lt;code&gt;ido-switch-buffer&lt;/code&gt; but when I find the file I want to open, I realize I want to open it in &lt;code&gt;other-window&lt;/code&gt;. I have key bindings for &lt;code&gt;ido-find-file-other-window&lt;/code&gt; and others, but I would like the option to open the selected ido candidate in &lt;code&gt;other-window&lt;/code&gt; as a persistent option in &lt;code&gt;ido-completion-map&lt;/code&gt; (bound to &lt;code&gt;s-&amp;lt;return&amp;gt;&lt;/code&gt;). Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2015-09-04T06:26:12.677" Title="Override ido-completion-map to change window target" Tags="|completion|ido|ido-find-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9665" PostTypeId="2" ParentId="9655" CreationDate="2015-02-28T01:35:35.953" Score="2" Body="&lt;p&gt;Reproducing lawlist's comments here,&#xA;     To make an overlay and minify the code block as &quot;...&quot;, you can do,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(overlay-put (make-overlay (point-at-bol) (point-at-eol)) 'display &quot;...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, to expand the contents and bring the buffer to its original form,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(remove-overlays (point-min) (point-max) 'display &quot;...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-02-28T01:35:35.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9666" PostTypeId="2" ParentId="9632" CreationDate="2015-02-28T02:20:45.060" Score="0" Body="&lt;p&gt;Based on the results from kaushalmodi's answer, I'm thinking that there is unfortunately no standalone helm command for directly searching the content of multiple PDFs. But I did find that if I select a PDF using &lt;code&gt;helm-locate&lt;/code&gt; and pressing &lt;kbd&gt;Tab&lt;/kbd&gt;, there is an option on the list to use &lt;code&gt;pdfgrep&lt;/code&gt; on that individual file using &lt;kbd&gt;F9&lt;/kbd&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Once I figured that out, I then tried to see if the shortcuts I saw listed from &lt;code&gt;helm-pdfgrep-help&lt;/code&gt; would be useful. But now, &lt;code&gt;helm-pdfgrep-help&lt;/code&gt; is just giving me an error: &lt;code&gt;No buffer named *helm*&lt;/code&gt;.) &lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-02-28T02:20:45.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9667" PostTypeId="1" CreationDate="2015-02-28T06:26:26.773" Score="1" ViewCount="157" Body="&lt;p&gt;I am using Emacs to edit. all the &lt;code&gt;(&lt;/code&gt; in the picture are all at the same point on each line. But they are not aligned. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Major Mode: verilog-mode&#xA;Theme     : manoj-dark&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/W2rjv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="253" LastEditDate="2015-02-28T14:06:59.063" LastActivityDate="2015-03-01T01:52:34.940" Title="the '(' is not aligned properly when using Mono font in Emacs" Tags="|fonts|align|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9668" PostTypeId="2" ParentId="9667" CreationDate="2015-02-28T11:27:22.730" Score="1" Body="&lt;p&gt;Just found the problem which is the &lt;code&gt;manoj-dark&lt;/code&gt; theme sets the &lt;code&gt;Height&lt;/code&gt; of &lt;code&gt;font-lock-function-name-face&lt;/code&gt; to &lt;code&gt;1.1&lt;/code&gt;. Which causes the function name's characters are 10% bigger than the &lt;code&gt;space&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="4102" LastEditDate="2015-03-01T01:52:34.940" LastActivityDate="2015-03-01T01:52:34.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9669" PostTypeId="1" CreationDate="2015-02-28T11:41:11.863" Score="0" ViewCount="594" Body="&lt;p&gt;I want to install the &lt;a href=&quot;https://github.com/ejmr/php-mode&quot; rel=&quot;nofollow&quot;&gt;php-mode&lt;/a&gt; on my windows 7 machine. I went through documentation of the cited website and there is no mention of what should be extra required to run this mode. Obviously, the PHP interpreter and some server, I would like to use MySQL as well. So what is the best setup to have them all (please cite the download websites where necessary). I know there are all-in-one installers for Windows like &lt;code&gt;XAMPP&lt;/code&gt;, but what other workflows and alternatives are there other than that? What is recommended with regards to an effective Emacs ecosystem? I am just unaware of the possibilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is special about installation of this mode in Windows apart from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require ('php-mode)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the dot emacs file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want also to indent an HTML content inside a PHP construct. I mean indentation of something similar to the MWE below: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MWE -- page.php inside templates folder&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php&#xA;return &quot;&amp;lt;!DOCTYPE html&amp;gt;&#xA;&amp;lt;html&amp;gt;&#xA;&amp;lt;head&amp;gt;&#xA;    &amp;lt;title&amp;gt;$pageData-&amp;gt;title&amp;lt;/title&amp;gt;&#xA;&amp;lt;meta http-equiv='Content-Type' content='text/html;charset=utf-8'/&amp;gt;&#xA;  &amp;lt;/head&amp;gt;&#xA;  &amp;lt;body&amp;gt;&#xA;    $pageData-&amp;gt;content&#xA;  &amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&quot;;&#xA;?&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It might be helpful to share part of the dot emacs file code related only to &lt;code&gt;php-mode&lt;/code&gt;. Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I added the &lt;code&gt;c:\xampp\php\php.exe&lt;/code&gt; to PATH variables but when I press &lt;code&gt;C-c C-r&lt;/code&gt; of php code it throws this error: &lt;code&gt;php-send-region: Searching for program: no such file or directory, php&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &#xA;There was a bug and thankfully fixed by the developer: &lt;a href=&quot;https://github.com/ejmr/php-mode/issues/228#issuecomment-77057035&quot; rel=&quot;nofollow&quot;&gt;https://github.com/ejmr/php-mode/issues/228#issuecomment-77057035&lt;/a&gt;. Now, after applying the fix in the source and setting the PATH variable correctly in Windows to &lt;code&gt;c:\xampp\php&lt;/code&gt; instead of &lt;code&gt;c:\xampp\php\php.exe&lt;/code&gt;, &lt;code&gt;C-c C-r&lt;/code&gt; is generating the &lt;code&gt;*PHP*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;br&gt;&#xA;How to show the output of PHP code from the &lt;code&gt;*PHP*&lt;/code&gt; buffer? What is the workflow to show the output in whatever browser available?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-03-05T12:28:24.817" LastActivityDate="2015-03-05T12:28:24.817" Title="Installation of php-mode on Windows?" Tags="|indentation|microsoft-windows|php-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9670" PostTypeId="1" AcceptedAnswerId="9695" CreationDate="2015-02-28T12:01:32.033" Score="9" ViewCount="5142" Body="&lt;p&gt;I am just starting to experiment with Yasnippet, and it worked very well until I tried to combine it with &lt;code&gt;auto-complete-mode&lt;/code&gt;. The problem is that Auto-Complete is taking over completely. For example, in &lt;code&gt;c-mode&lt;/code&gt; I can type &lt;code&gt;pr&lt;/code&gt; and then press &lt;kbd&gt;TAB&lt;/kbd&gt; to expand a &lt;code&gt;printf&lt;/code&gt; snippet, but after activating &lt;code&gt;auto-complete-mode&lt;/code&gt; this does not work, but &lt;code&gt;auto-complete-mode&lt;/code&gt; itself works just fine. Instead, I would like to have Yasnippet to have priority over Auto-Complete when I press the &lt;kbd&gt;TAB&lt;/kbd&gt; key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.4 on Ubuntu 14.04, Yasnippet version: 0.8.1, and Auto-Complete version 1.5.0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is minimal example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q -l init.el t.c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;init.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;(yas-global-mode 1)&#xA;(require 'auto-complete-config)&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;)&#xA;(ac-config-default)&#xA;(add-to-list 'ac-sources 'ac-source-yasnippet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I now type &lt;code&gt;pr&lt;/code&gt; and then press &lt;kbd&gt;TAB&lt;/kbd&gt;, I get the Auto-Complete popup menu, (whereas I would like to expand the &lt;code&gt;printf&lt;/code&gt; snippet instead). If I type &lt;code&gt;M-x auto-complete-mode&lt;/code&gt; to turn off &lt;code&gt;auto-complete-mode&lt;/code&gt; and then type &lt;code&gt;pr&lt;/code&gt; and &lt;kbd&gt;TAB&lt;/kbd&gt;, the &lt;code&gt;printf&lt;/code&gt; snippet expands as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other information:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v RET ac-source-yasnippet&lt;/code&gt; gives:  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((depends yasnippet)&#xA; (candidates . ac-yasnippet-candidates)&#xA; (action . yas/expand)&#xA; (candidate-face . ac-yasnippet-candidate-face)&#xA; (selection-face . ac-yasnippet-selection-face)&#xA; (symbol . &quot;a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v RET ac-sources&lt;/code&gt; gives:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ac-source-yasnippet ac-source-gtags ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Clearing &lt;code&gt;ac-source-yasnippet&lt;/code&gt; variable (&lt;code&gt;(setq ac-source-yasnippet nil)&lt;/code&gt;) does not help. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/9869178/about-auto-complete-and-yasnippet-in-emacs&quot;&gt;About auto complete and yasnippet in emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/15774807/emacs-24-autocomplete-yasnippet&quot;&gt;emacs 24 autocomplete yasnippet&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="260" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-03-01T07:31:28.590" Title="Yasnippet not working with auto-complete-mode" Tags="|yasnippet|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9671" PostTypeId="1" AcceptedAnswerId="9673" CreationDate="2015-02-28T12:55:19.793" Score="2" ViewCount="488" Body="&lt;p&gt;I use hideshow (&lt;code&gt;hs-mode&lt;/code&gt;) in almost all languages. Most of the time, i keep function header lines visible but the body hidden like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function func(arg1, arg2){...}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, every time I open the file, I do &lt;code&gt;C-c @ C-l&lt;/code&gt; to hide the function body.  But, when I close emacs, these buffer states are gone and emacs open buffers without hiding the states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does any other lib support persisting show/hide info and reusing it?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="253" LastEditDate="2015-02-28T14:25:32.177" LastActivityDate="2017-10-12T13:28:02.130" Title="Persist hideshow folds between sessions?" Tags="|elisp|hooks|code-folding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9672" PostTypeId="2" ParentId="9656" CreationDate="2015-02-28T13:07:01.780" Score="5" Body="&lt;p&gt;There is a command called &lt;code&gt;org-edit-src-exit&lt;/code&gt; in org-mode, which can open source block in a new buffer of itself major mode, and open &lt;strong&gt;Include file&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This command is binded with &lt;code&gt;C-c '&lt;/code&gt; in default.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-03-01T12:09:22.383" LastActivityDate="2015-03-01T12:09:22.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9673" PostTypeId="2" ParentId="9671" CreationDate="2015-02-28T14:21:36.730" Score="3" Body="&lt;p&gt;You, sir, are looking for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html&quot; rel=&quot;nofollow&quot;&gt;mode hooks&lt;/a&gt;: a set of functions that run every time you enter a buffer in a given mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that mode hooks will not &lt;em&gt;persist&lt;/em&gt; state between sessions, but your question really appears to be about running the same command every time you enter a buffer in a given mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now: for hideshow, the default binding &lt;code&gt;C-c @ C-l&lt;/code&gt; is for &lt;code&gt;hs-hide-level&lt;/code&gt;, whose docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(hs-hide-level ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hide all blocks ARG levels below this block...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Rather than pick an &lt;code&gt;ARG&lt;/code&gt; level (you'd probably want 1, I'd guess), you might consider &lt;code&gt;hs-hide-all&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(hs-hide-all)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hide all top level blocks, displaying only first and last lines...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let's say you want to hide everything every time you open an &lt;code&gt;elisp&lt;/code&gt; buffer.  Because the latter function does not require arguments, you could add it directly to a hook like so: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook #'hs-hide-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you wanted to use the former, you would need to write a specific function (the preferred method), or else wrap it in an anonymous &lt;code&gt;lambda&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook (lambda () (hs-hide-level 1))) ; not preferred&#xA;&#xA;(defun my-hs-hide-stuff ()&#xA;  (hs-hide-level 1))&#xA;(add-hook 'emacs-lisp-mode-hook #'my-hs-hide-stuff)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-02-28T14:27:47.907" LastActivityDate="2015-02-28T14:27:47.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9674" PostTypeId="1" AcceptedAnswerId="9722" CreationDate="2015-02-28T15:06:37.787" Score="3" ViewCount="5250" Body="&lt;p&gt;I want to add a string to the startup screen. I found &lt;a href=&quot;https://stackoverflow.com/questions/12495435/how-do-i-customize-the-welcome-screen-in-emacs&quot;&gt;this question&lt;/a&gt; and customized the &lt;code&gt;fancy-startup-text&lt;/code&gt; variable, like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (add-to-list 'fancy-startup-text '(&quot;\nYou are running a customized Emacs configuration. See &quot;  :link&#xA;    (&quot;here&quot;&#xA;     #[257 &quot;\300\301!\207&quot;&#xA;           [browse-url-default-browser &quot;http://github.com/izahn/dotemacs/&quot;]&#xA;           3 &quot;\n\n(fn BUTTON)&quot;]&#xA;     &quot;Open the README file&quot;)&#xA;    &quot;\nfor information about these customizations.\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That worked on my desktop computer, but when I tried on my laptop (with a small screen) I find a different startup screen, without the Emacs logo at the top, and without my additional string. I found a discussion on the emacs mailing list discussing how different startup screens are shown depending on the size of the initial frame (unfortunately I cannot locate this now), so I think this is expected. But what I cannot figure out is how to customize the text for the simple startup screen (without the logo) that is shown when the initial frame is small. I tried customizing &lt;code&gt;fancy-about-text&lt;/code&gt;, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-to-list 'fancy-about-text '(&quot;\nYou are running a customized Emacs configuration. See &quot;  :link&#xA;    (&quot;here&quot;&#xA;     #[257 &quot;\300\301!\207&quot;&#xA;           [browse-url-default-browser &quot;http://github.com/izahn/dotemacs/&quot;]&#xA;           3 &quot;\n\n(fn BUTTON)&quot;]&#xA;     &quot;Open the README file&quot;)&#xA;    &quot;\nfor information about these customizations.\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that did not work. &lt;/p&gt;&#xA;" OwnerUserId="5308" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2024-03-04T02:35:57.583" Title="Customize startup screen text" Tags="|start-up|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9675" PostTypeId="1" AcceptedAnswerId="9682" CreationDate="2015-02-28T17:03:23.867" Score="4" ViewCount="443" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Can hash-table entries have property lists and, if no, what are the idiomatic alternatives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Properties.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; explains, symbols can record miscellaneous information via symbol properties.  I'd like to know if this applies to hash tables with symbols as keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a toy example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf hash-1 (make-hash-table)&#xA;      hash-2 (make-hash-table))&#xA;&#xA;(puthash :key-1 &quot;val-1&quot; hash-1)&#xA;(puthash :key-2 &quot;val-2&quot; hash-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I attach symbol properties to &lt;code&gt;:key-1&lt;/code&gt; -- and, particularly, &lt;em&gt;different&lt;/em&gt; properties for the two hash tables -- for later inspection?  I'm guessing no, as neither &lt;code&gt;gethash&lt;/code&gt; nor &lt;code&gt;puthash&lt;/code&gt; seem to offer facilities for manipulating the key -- only the value.  (See also &lt;a href=&quot;https://emacs.stackexchange.com/questions/3341/how-to-extract-key-from-hash-table&quot;&gt;this thread&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's correct, &lt;em&gt;what is the idiomatic alternative to symbol properties for hash-table entries?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could, for example, assign an alist as the value of a hash entry:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(puthash :key-2 '((:val &quot;val-3&quot;) (:prop prop-1)) hash-1)&#xA;(puthash :key-2 '((:val &quot;val-4&quot;) (:prop prop-2)) hash-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then each entry has a value list and a &quot;property&quot; list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assq :val  (gethash :key-2 hash-1))    ; =&amp;gt; (:val &quot;val-3&quot;)&#xA;(assq :prop (gethash :key-2 hash-1))    ; =&amp;gt; (:prop prop-1)&#xA;(assq :val  (gethash :key-2 hash-2))    ; =&amp;gt; (:val &quot;val-4&quot;)&#xA;(assq :prop (gethash :key-2 hash-2))    ; =&amp;gt; (:prop prop-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That seems a little convoluted, however.  Is there a cleaner way to do this?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-02-28T19:10:35.333" Title="Can hash-table entries have property lists?" Tags="|elisp|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9676" PostTypeId="1" AcceptedAnswerId="9677" CreationDate="2015-02-28T17:12:14.700" Score="2" ViewCount="117" Body="&lt;p&gt;I changed the &lt;kbd&gt;i&lt;/kbd&gt; key binding in &lt;code&gt;evil-normal-state-map&lt;/code&gt; to go up and &lt;kbd&gt;k&lt;/kbd&gt; to go down (these are just two examples). But &lt;code&gt;evil-operator-state-map&lt;/code&gt; and &lt;code&gt;evil-visual-state-map&lt;/code&gt; do not change accordingly, but keep the old key bindings (i.e. &lt;code&gt;hijk&lt;/code&gt;). Even making new keymap and assign key bindings, it still uses the old one.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="253" LastEditDate="2015-02-28T17:38:55.253" LastActivityDate="2015-02-28T17:38:55.253" Title="How to make evil keymaps inherit from other evil keymaps?" Tags="|key-bindings|keymap|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9677" PostTypeId="2" ParentId="9676" CreationDate="2015-02-28T17:27:06.223" Score="1" Body="&lt;p&gt;These maps inherit from motion state: if keys are not bound in the other states, they will take their bindings from above.  So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map &quot;i&quot; #'evil-previous-line)&#xA;(define-key evil-motion-state-map &quot;k&quot; #'evil-next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, provided that the other maps do not already have bindings for &lt;code&gt;i&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt;, they will use the ones you defined in &lt;code&gt;evil-motion-state-map&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-28T17:27:06.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9678" PostTypeId="1" AcceptedAnswerId="9679" CreationDate="2015-02-28T17:54:32.033" Score="25" ViewCount="15480" Body="&lt;p&gt;I am using &lt;code&gt;emacs&lt;/code&gt; on the remote server, and I have no idea how to click on options in the menu bar across the top in this context. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a screen capture:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xyLye.png&quot; alt=&quot;Screenshof emacs showing the menu bar with entries like &amp;quot;File&amp;quot;, &amp;quot;Edit&amp;quot;, &amp;quot;Options&amp;quot;, &amp;quot;Buffers&amp;quot; etc.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want to click some options under &quot;File&quot; in the menu bar (on the top), how can I do that? &lt;/p&gt;&#xA;" OwnerUserId="2805" LastEditorUserId="391" LastEditDate="2015-03-01T03:48:12.937" LastActivityDate="2015-03-01T03:48:12.937" Title="How to use the menu bar in terminal emacs?" Tags="|terminal-emacs|menu-bar|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9679" PostTypeId="2" ParentId="9678" CreationDate="2015-02-28T18:16:22.527" Score="25" Body="&lt;p&gt;I don't think the mouse really works when running in the terminal, so you cannot actually click. But to open the menus press &lt;code&gt;F10&lt;/code&gt; (or &lt;code&gt;fn-F10&lt;/code&gt; depending on your keyboard settings).&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2015-02-28T18:16:22.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9680" PostTypeId="2" ParentId="9678" CreationDate="2015-02-28T18:23:27.573" Score="9" Body="&lt;p&gt;If you're intent on using the mouse, you can use a subset of mouse click functionality if your terminal is compatible with &lt;code&gt;xterm&lt;/code&gt;.  To do so, enable &lt;code&gt;xterm-mouse-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text_002dOnly-Mouse.html&quot; rel=&quot;noreferrer&quot;&gt;manual page on &quot;Using a Mouse in Text Terminals&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as @Ista's answer and @lawlist's comment suggest, you can use the keyboard to access the menu bar.  That's probably a better option long-term, as you'll speed up when going keyboard-only.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-02-28T18:23:27.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9681" PostTypeId="2" ParentId="9356" CreationDate="2015-02-28T18:38:37.843" Score="1" Body="&lt;p&gt;No domains other than &lt;code&gt;melpa.org&lt;/code&gt; are necessary in order to browse and install packages via Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To browse and download packages via the web front-end, though, you'll also need to allow access to &lt;code&gt;cdnjs.cloudflare.com&lt;/code&gt;, from which we load third-party javascript. This dependency may change in time.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2015-02-28T18:38:37.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9682" PostTypeId="2" ParentId="9675" CreationDate="2015-02-28T19:02:32.810" Score="7" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;As the manual explains, symbols can record miscellaneous information via symbol properties. I'd like to know if this applies to hash tables with symbols as keys.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, it applies to any usage of symbols.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can I attach symbol properties to &lt;code&gt;:key-1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put :key-1 'hi &quot;yes&quot;)&#xA;(get :key-1 'hi) ;; =&amp;gt; &quot;yes&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-- and, particularly, &lt;em&gt;different&lt;/em&gt; properties for the two hash tables&#xA;  -- for later inspection?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You mean if the &lt;em&gt;same&lt;/em&gt; key can have different symbols properties on different tables?&lt;br&gt;&#xA;&lt;strong&gt;No.&lt;/strong&gt; Because the symbol properties are part of the symbol, not of the table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, and &lt;strong&gt;this might be the key point to understand&lt;/strong&gt;,&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html#Symbol-Type&quot;&gt;interned symbols are unique&lt;/a&gt;&#xA;in elisp. This means every appearance of &lt;code&gt;:key-1&lt;/code&gt; will always be the&#xA;exact same lisp object (not just different objects with same structure).&#xA;This, in turn, means that &lt;code&gt;':key-1&lt;/code&gt; is &lt;code&gt;eq&lt;/code&gt; to &lt;code&gt;(intern &quot;:key-1&quot;)&lt;/code&gt;,&#xA;and all the following lines will return the same thing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get (intern &quot;:key-1&quot;) 'hi)&#xA;(get ':key-1 'hi)&#xA;(get :key-1 'hi)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a bonus, elisp binds keywords to themselves, so &lt;code&gt;(eval :key-1)&lt;/code&gt; or&#xA;&lt;code&gt;(symbol-value :key-1)&lt;/code&gt; or even &lt;code&gt;:key-1&lt;/code&gt; all return &lt;code&gt;:key-1&lt;/code&gt;. That's&#xA;why you can use keywords without quoting them, why the third line&#xA;above works, and why &lt;code&gt;(eq :key ':key)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If that's correct, &lt;em&gt;what is the idiomatic alternative to symbol properties for hash-table entries?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Symbol properties are for symbols. If you want to store data in a hash&#xA;table that's associated to a key, why not use the hash table?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I could, for example, assign an alist as the value of a hash entry:&lt;br&gt;&#xA;  And then each entry has a value list and a &quot;property&quot; list:&lt;br&gt;&#xA;  That seems a little convoluted, however. Is there a cleaner way to do this?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why convoluted?&lt;br&gt;&#xA;IIUC, these property lists you're trying to store are really just&#xA;extra values for your key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you go from &lt;em&gt;“storing a value at a given key”&lt;/em&gt; to &lt;em&gt;“storing&#xA;multiple values at a given key”&lt;/em&gt; you need to add at least one level of&#xA;specification to your &lt;code&gt;get&lt;/code&gt; function. Which is to say, you need to&#xA;increase the complexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just think the actual &lt;code&gt;assq&lt;/code&gt; combo feels cumbersome, you could&#xA;use a &lt;code&gt;cl-struct&lt;/code&gt; as the value and retrieve fields with accessors. You&#xA;can also use a property-list as the value (instead of the alist you&#xA;have there) and access fields with &lt;code&gt;plist-get&lt;/code&gt;. Finally, you can just&#xA;use a separate key for the properties, something like&#xA;&lt;code&gt;:key-1--properties&lt;/code&gt; (though the viability of this will vary).&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-02-28T19:09:53.237" LastActivityDate="2015-02-28T19:09:53.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9683" PostTypeId="2" ParentId="9675" CreationDate="2015-02-28T19:10:35.333" Score="3" Body="&lt;p&gt;These are just two unrelated mechanisms.  A hash-table is, in principle, a two-compartments structure.  A tree-ish compartment for storing keys and an array-ish structure for storing values.  Keys are stored in &quot;buckets&quot; where which key goes into what bucket and whether to add a new bucket for the new key is decided by a hash function applied to the key.  The position in the bucket is later used to map the key to the value in the array-ish structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbol's properties are a kind of global hash-table, where there's a list reserved for each symbol.  This list stores the values, which are that symbol's properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you put a property in the symbol's property list that has no effect on that symbol being a key in any hash-table, conversely, whether you add a property to a symbol has no effect on that symbol being in a hash-table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps it will help if I also mentioned that hash-table keys need not be symbols?  Anything that can be hashed can be a hash-table key.  So, lists, for example, can be keys too. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *test-table* (make-hash-table :test 'equal))&#xA;;; *test-table*&#xA;(setf (gethash (list 1 2 3) *test-table*) (list 4 5 6))&#xA;;; (4 5 6)&#xA;(gethash (list 1 2 3) *test-table*)&#xA;;; (4 5 6)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;note that the list is fresh, meaning that, in principle, you can make two different symbols point to the same value in the same hash-table&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that you could also design your own hashing and equality functions in order to control the behavior of the keys in the hash-table, but I would advise against doing that: it requires a good deal of understanding of the implementation of this data-structure.  Probably, what you want, can be accomplished with more common techniques.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-02-28T19:10:35.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9684" PostTypeId="1" AcceptedAnswerId="9685" CreationDate="2015-02-28T19:10:46.877" Score="3" ViewCount="58" Body="&lt;p&gt;I want to create a library of useful info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to be able to have each info-snippet classified by several keywords&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(&quot;Jumping Flame Spiders go for your face. Get your pet cat to eat them.&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;could be classified with the keywords &lt;code&gt;spiders&lt;/code&gt;, &lt;code&gt;everyday-tips-and-tricks&lt;/code&gt; and &lt;code&gt;cats&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later, all searches for any of the combinations of the keywords above should return the line above and all other relevant ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible to do in emacs lisp? Which libraries should I look into? If I have to &quot;shell out&quot;, what would be the most multiple-platform friendly way of doing it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: my main use case will be to provide one piece of info (a paragraph of two) in the mode line or displayed in a buffer. If many info pieces match, I'll select one randomly.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2015-02-28T20:08:14.157" LastActivityDate="2015-02-28T20:08:14.157" Title="Classification system for data (have data accessible by several keywords)" Tags="|elisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9685" PostTypeId="2" ParentId="9684" CreationDate="2015-02-28T19:27:39.350" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Put your wisdom in a file or files.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bookmark those locations.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Load library &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Tag&lt;/strong&gt;&lt;/a&gt; your bookmarks with whatever keywords you like.&lt;/p&gt;&#xA;&lt;p&gt;Tags are &lt;em&gt;arbitrary strings&lt;/em&gt; - not limited to words or symbols.  You can also tag a bookmark when you create it (i.e., be prompted automatically to add tags).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use any combination of tags when you jump to a bookmark.&lt;/p&gt;&#xA;&lt;p&gt;The bookmark candidates are filtered by the tags you specify.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-02-28T19:27:39.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9686" PostTypeId="1" CreationDate="2015-02-28T19:45:18.500" Score="2" ViewCount="634" Body="&lt;p&gt;Trying to use Emacs in MS Windows (operating system), which I acknowledge is not ideal. However, whenever I attempt to use the Meta key the tiled start menu appears serves as a disruption and makes Emacs unusable. Is there a way of either disabling this feature or re-assigning the key?&lt;/p&gt;&#xA;" OwnerUserId="6634" LastEditorUserId="105" LastEditDate="2015-05-14T00:31:35.837" LastActivityDate="2015-05-14T00:31:35.837" Title="How do you prevent Meta (alt) in MS Windows 8 from opening the Windows start menu" Tags="|key-bindings|microsoft-windows|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9688" PostTypeId="2" ParentId="9653" CreationDate="2015-02-28T20:25:19.240" Score="4" Body="&lt;p&gt;After a bit of trial and error, I've come up with the following, somewhat crude implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro ins-val (val)&#xA;  `(lambda () (interactive) (insert ,val)))&#xA;&#xA;(define-minor-mode special-char-mode&#xA;  &quot;Toggle Special Character mode&quot;&#xA;  nil&#xA;  &quot; SpecialChar&quot;&#xA;  `(&#xA;    (,(kbd &quot;1&quot;) . ,(ins-val &quot;!&quot;)) (,(kbd &quot;!&quot;) . ,(ins-val &quot;1&quot;)) (,[kp-1] . ,(ins-val &quot;1&quot;))&#xA;    (,(kbd &quot;2&quot;) . ,(ins-val &quot;@&quot;)) (,(kbd &quot;@&quot;) . ,(ins-val &quot;2&quot;)) (,[kp-2] . ,(ins-val &quot;2&quot;))&#xA;    (,(kbd &quot;3&quot;) . ,(ins-val &quot;#&quot;)) (,(kbd &quot;#&quot;) . ,(ins-val &quot;3&quot;)) (,[kp-3] . ,(ins-val &quot;3&quot;))&#xA;    (,(kbd &quot;4&quot;) . ,(ins-val &quot;$&quot;)) (,(kbd &quot;$&quot;) . ,(ins-val &quot;4&quot;)) (,[kp-4] . ,(ins-val &quot;4&quot;))&#xA;    (,(kbd &quot;5&quot;) . ,(ins-val &quot;%&quot;)) (,(kbd &quot;%&quot;) . ,(ins-val &quot;5&quot;)) (,[kp-5] . ,(ins-val &quot;5&quot;))&#xA;    (,(kbd &quot;6&quot;) . ,(ins-val &quot;^&quot;)) (,(kbd &quot;^&quot;) . ,(ins-val &quot;6&quot;)) (,[kp-6] . ,(ins-val &quot;6&quot;))&#xA;    (,(kbd &quot;7&quot;) . ,(ins-val &quot;&amp;amp;&quot;)) (,(kbd &quot;&amp;amp;&quot;) . ,(ins-val &quot;7&quot;)) (,[kp-7] . ,(ins-val &quot;7&quot;))&#xA;    (,(kbd &quot;8&quot;) . ,(ins-val &quot;*&quot;)) (,(kbd &quot;*&quot;) . ,(ins-val &quot;8&quot;)) (,[kp-8] . ,(ins-val &quot;8&quot;))&#xA;    (,(kbd &quot;9&quot;) . ,(ins-val &quot;(&quot;)) (,(kbd &quot;(&quot;) . ,(ins-val &quot;9&quot;)) (,[kp-9] . ,(ins-val &quot;9&quot;))&#xA;    (,(kbd &quot;0&quot;) . ,(ins-val &quot;)&quot;)) (,(kbd &quot;)&quot;) . ,(ins-val &quot;0&quot;)) (,[kp-0] . ,(ins-val &quot;0&quot;))&#xA;    (,[kp-multiply] . ,(ins-val &quot;*&quot;))&#xA;    )&#xA;  :global 'true)&#xA;&#xA;(global-set-key (kbd &quot;C-!&quot;) 'special-char-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Crude but it works. I'd welcome any improvements someone might suggest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This global-set-key allows the user to toggle this mode on/off by pressing &quot;C-!&quot;. I'm sure this particular set-key is bad practice but it makes nice intuitive sense to me.&lt;/p&gt;&#xA;" OwnerUserId="6624" LastEditorUserId="6624" LastEditDate="2017-01-25T17:51:44.530" LastActivityDate="2017-01-25T17:51:44.530" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9690" PostTypeId="2" ParentId="9686" CreationDate="2015-02-28T21:05:18.983" Score="0" Body="&lt;p&gt;This is unusual behavior. Normally the Windows key brings up the start menu, and Alt on its own does nothing. Nevertheless, if you find you need to rebind your keys, you can do so using the free program &lt;a href=&quot;https://sharpkeys.codeplex.com/&quot; rel=&quot;nofollow&quot;&gt;SharpKeys&lt;/a&gt;. Using registry keys it can rebind any key on your keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may just want to figure out what program is causing the Alt key to behave this way.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-02-28T21:05:18.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9691" PostTypeId="2" ParentId="9686" CreationDate="2015-02-28T21:06:20.463" Score="3" Body="&lt;p&gt;With &lt;code&gt;emacs -Q&lt;/code&gt; (no init file), the Meta key should work normally on MS Windows - no problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I think what you are referring to is the fact that Windows grabs certain &lt;code&gt;Alt&lt;/code&gt; (hence Meta) keys for its own use, so that Emacs never sees them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an Emacs function, &lt;strong&gt;&lt;code&gt;w32-register-hot-key&lt;/code&gt;&lt;/strong&gt;, that you can use, to take care of this - you just &quot;register&quot; whatever key bindings you like as being for Emacs, not Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this makes Windows pass &lt;code&gt;M-tab&lt;/code&gt; and &lt;code&gt;M-S-tab&lt;/code&gt; to Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (fboundp 'w32-register-hot-key)&#xA;  (w32-register-hot-key [M-tab])&#xA;  (w32-register-hot-key [M-S-tab]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, for 64-bit Windows 7 at least, this option no longer has any effect. &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:22:08.790" LastActivityDate="2015-05-09T20:22:08.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9692" PostTypeId="1" AcceptedAnswerId="12851" CreationDate="2015-02-28T21:33:21.000" Score="17" ViewCount="9827" Body="&lt;p&gt;When running &lt;code&gt;package-list-packages&lt;/code&gt; I get the following errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Failed to download `gnu' archive.&#xA;gnutls.c: [0] (Emacs) fatal error: The TLS connection was non-properly terminated.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am running Emacs 24.4 on Windows. Until this week package downloads were happening normally. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;a href=&quot;http://xn--9dbdkw.se/diary/how_to_enable_GnuTLS_for_Emacs_24_on_Windows/index.en.html&quot;&gt;this guide&lt;/a&gt; on setting up Emacs-GnuTLS-Windows. I tried running this code from the &lt;strong&gt;See if it works&lt;/strong&gt; section:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case e&#xA;    (delete-process&#xA;     (gnutls-negotiate&#xA;      :process (open-network-stream &quot;test&quot; nil &quot;www.google.com&quot; 443)&#xA;      :hostname &quot;www.google.com&quot;&#xA;      :verify-error t))&#xA;  (error e))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do get &lt;code&gt;nil&lt;/code&gt; inserted into the buffer, with no validation error, which according to the article is a sign of success. However, if I set &lt;code&gt;(setq gnutls-log-level 2)&lt;/code&gt; and run the code again, I get the following output.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnutls.c: [1] (Emacs) allocating credentials&#xA;gnutls.c: [2] (Emacs) allocating x509 credentials&#xA;gnutls.c: [2] (Emacs) using default verification flags&#xA;gnutls.c: [1] (Emacs) setting the trustfile:  c:/gnutls/cacert.pem&#xA;gnutls.c: [1] (Emacs) gnutls callbacks&#xA;gnutls.c: [1] (Emacs) gnutls_init&#xA;gnutls.c: [1] (Emacs) got non-default priority string: NORMAL&#xA;gnutls.c: [1] (Emacs) setting the priority string&#xA;gnutls.c: [audit] Note that the security level of the Diffie-Hellman key exchange has been lowered to 256 bits and this may allow decryption of the session data&#xA;&#xA;gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable, try again. [1428 times]&#xA;gnutls.c: [2] (Emacs) Deallocating x509 credentials&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So that seems a bit odd. According to &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2013-11/msg00120.html&quot;&gt;this mailing list&lt;/a&gt;, the error isn't usually harmful. Nevertheless, I still cannot download &lt;code&gt;gnu&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I restore normal package fetching?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;June update&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Although there are some suggestions on GitHub that the error message is spurious, &lt;code&gt;gnu&lt;/code&gt; still fails to fetch. I confirmed this by checking local package versions with recently updates to the &lt;a href=&quot;https://elpa.gnu.org/packages/&quot;&gt;online repository&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;24.5 update&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I can no longer reproduce the issue after upgrading to Emacs 24.5.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2015-06-02T13:12:35.077" LastActivityDate="2015-06-02T13:15:56.447" Title="The TLS connection was non-properly terminated" Tags="|package-repositories|gnutls|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9693" PostTypeId="1" AcceptedAnswerId="9757" CreationDate="2015-03-01T04:34:11.997" Score="3" ViewCount="343" Body="&lt;p&gt;I would like to use the &quot;normal&quot; behaviour for &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; in &lt;code&gt;markdown-mode&lt;/code&gt;. That is, instead of calling &lt;code&gt;markdown-exdent-or-delete&lt;/code&gt;, I would like to call &lt;code&gt;cua-delete-region&lt;/code&gt;. So I tried this rebinding (using &lt;code&gt;bind-key&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package markdown-mode&#xA;    :ensure t&#xA;  :mode (&quot;\\.\\(m\\(ark\\)?down\\|md\\)$&quot; . markdown-mode)&#xA;  :config (bind-key &quot;&amp;lt;backspace&amp;gt;&quot; 'cua-delete-region)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get no changes. (Or rather I do: but for some strange reason only in the minibuffer!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="50" LastEditDate="2015-03-01T19:09:55.287" LastActivityDate="2015-03-03T01:21:38.150" Title="Use normal delete-region with backspace in markdown-mode" Tags="|key-bindings|use-package|markdown-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9694" PostTypeId="1" CreationDate="2015-03-01T05:15:21.267" Score="3" ViewCount="989" Body="&lt;p&gt;I installed the &lt;code&gt;oh-my-emacs&lt;/code&gt; configuration and try to use emacs in the terminal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;oh-my-emacs&lt;/code&gt; configuration enables &lt;code&gt;evil-mode&lt;/code&gt; in default, and my problem is that, I found &lt;code&gt;esc&lt;/code&gt; is mapped to &lt;code&gt;meta&lt;/code&gt;, while the original &lt;code&gt;command&lt;/code&gt; in my Mac is somehow disabled.. These kinds of remapping do not happen when I use emacs with &lt;code&gt;oh-my-emacs&lt;/code&gt; configuration in GUI. So I basically have no idea why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really cannot get used to the map from &lt;code&gt;esc&lt;/code&gt; to &lt;code&gt;meta&lt;/code&gt;, even though &lt;code&gt;esc&lt;/code&gt; can still be used to switch from input mode to command mode in &lt;code&gt;evil&lt;/code&gt;. I just want to disable this mapping. Does anyone know how to do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I found I can use &lt;code&gt;space+j&lt;/code&gt; to achieve the &lt;code&gt;M-x&lt;/code&gt;, so I am not worried that I can not use &lt;code&gt;command&lt;/code&gt; in Mac to invoke &lt;code&gt;M-x&lt;/code&gt; command. But basically why the &lt;code&gt;command&lt;/code&gt; does not work in terminal environment? &lt;/p&gt;&#xA;" OwnerUserId="2805" LastActivityDate="2015-04-05T01:40:05.743" Title="How to disable the map from esc to meta?" Tags="|key-bindings|keymap|evil|terminal-emacs|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9695" PostTypeId="2" ParentId="9670" CreationDate="2015-03-01T07:31:28.590" Score="12" Body="&lt;p&gt;As a workaround, you can redefine the Yasnippet expansion key instead, as explained in the &lt;a href=&quot;http://capitaomorte.github.io/yasnippet/faq.html&quot; rel=&quot;noreferrer&quot;&gt;FAQ&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;C-tab&amp;gt;&quot;) 'yas-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this way, you use &lt;code&gt;&amp;lt;C-tab&amp;gt;&lt;/code&gt; to expand Yasnippets and the &lt;kbd&gt;TAB&lt;/kbd&gt; key for &lt;code&gt;auto-complete-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also discovered that using &lt;code&gt;&amp;lt;C-tab&amp;gt;&lt;/code&gt; to expand Yasnippets, instead of &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;, had the advantage to make snippet expansion not interfer with &lt;code&gt;indent-according-to-mode&lt;/code&gt;. For example: If I have a Lisp line: &lt;code&gt;(ac-config-default)&lt;/code&gt; but it is not correctly indented, I usually press &lt;kbd&gt;TAB&lt;/kbd&gt; to indent it correctly (using &lt;code&gt;indent-according-to-mode&lt;/code&gt;). But if the cursor were between the &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;c&lt;/code&gt; in &lt;code&gt;(ac-config-default)&lt;/code&gt; it would instead have expanded the Lisp &lt;code&gt;and&lt;/code&gt;-snippet (which is not desired here), to get the line &lt;code&gt;((and )c-config-default))&lt;/code&gt;..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-03-01T07:31:28.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9696" PostTypeId="1" CreationDate="2015-03-01T07:52:51.100" Score="70" ViewCount="47586" Body="&lt;p&gt;Emacs is an excellent editor - however it is said &quot;&lt;em&gt;to program you first need an IDE&lt;/em&gt;&quot; - so how would you build an IDE in the extensively customizable  Emacs for PYTHON with all the features of modern IDE. I want to be able to effectively debug, run and compile, and manage code. Thus far I have read up on the subject I have installed the Elpy package but am unsure of what else need to know and do to in order make this possible. &lt;/p&gt;&#xA;" OwnerUserId="6634" LastEditorUserId="6634" LastEditDate="2015-03-01T08:03:05.323" LastActivityDate="2019-09-25T09:59:34.553" Title="How do you create a robust Python IDE with Emacs (as the Text editor)" Tags="|python|" AnswerCount="5" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="9698" PostTypeId="1" AcceptedAnswerId="9699" CreationDate="2015-03-01T08:36:27.207" Score="9" ViewCount="1188" Body="&lt;p&gt;I understand that this is trivial with an if, but is there an option, like &lt;code&gt;%S&lt;/code&gt; or &lt;code&gt;%s&lt;/code&gt; that interpolates nil as no string at all?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;%?.el&quot; nil) ; &quot;.el&quot;&#xA;(format &quot;%?.el&quot; &quot;beginner&quot;) ; &quot;beginner.el&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2015-03-01T15:11:53.067" LastActivityDate="2015-03-02T09:31:53.203" Title="Interpolate nil argument to `format` as the empty string?" Tags="|elisp|string|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="9699" PostTypeId="2" ParentId="9698" CreationDate="2015-03-01T08:59:17.863" Score="9" Body="&lt;p&gt;Depending on your application, &lt;code&gt;concat&lt;/code&gt; might be of use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(concat &quot;live long &quot; nil &quot;and prosper&quot;)&#xA;;; =&amp;gt; &quot;live long and prosper&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works because concat acts on sequences, and nil is an empty list.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-01T08:59:17.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9700" PostTypeId="2" ParentId="9696" CreationDate="2015-03-01T09:52:45.067" Score="68" Body="&lt;p&gt;The default Python mode in Emacs has a number of features, including code completion based on the inferior Python shell, so that can be used as a basic IDE without any added packages. You can use other core Emacs functions with Python, too. For example, &lt;code&gt;M-x compile&lt;/code&gt;/&lt;code&gt;M-x recompile&lt;/code&gt; can be used to run tests. &lt;code&gt;M-x pdb&lt;/code&gt; can run the Python debugger, and it integrates with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Debuggers.html#Debuggers&quot;&gt;Emacs' gud environment&lt;/a&gt; so you actually get inline breakpoints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To expand on that, there are three major packages for Emacs that try to implement a more featureful Python IDE (in alphabetical order):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/proofit404/anaconda-mode&quot;&gt;anaconda-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot;&gt;elpy&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/tkf/emacs-jedi&quot;&gt;emacs-jedi&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They all provide roughly the same features:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Code completion using either auto-complete or company-mode&lt;/li&gt;&#xA;&lt;li&gt;Code navigation, that is go to definition/usages&lt;/li&gt;&#xA;&lt;li&gt;Function signature display using ElDoc&lt;/li&gt;&#xA;&lt;li&gt;Documentation introspection on the symbol at point&lt;/li&gt;&#xA;&lt;li&gt;Syntax checks using flymake or flycheck&lt;/li&gt;&#xA;&lt;li&gt;And some of them (at least Elpy) have basic refactoring support&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Beyond these, Emacs can also help you with a lot of workflows, but it does not prescribe any single one. So the next steps depend a lot on how you are using Python. The best approach here would be to figure out a good Python workflow and then try to find Emacs packages that help you specifically with the steps on your workflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, there are multiple packages to work with virtualenvs (Elpy, which you mention, comes with pyvenv) which you should likely use. Emacs-Jedi has an accompanying &lt;a href=&quot;https://github.com/tkf/emacs-jedi-direx&quot;&gt;mode for code browsing&lt;/a&gt; which can be useful. If you are using IPython a lot, there's an &lt;a href=&quot;https://github.com/millejoh/emacs-ipython-notebook&quot;&gt;IPython Notebook&lt;/a&gt; for Emacs. There are special support modes for Django development etc. – you can go to &lt;a href=&quot;http://melpa.org/&quot;&gt;http://melpa.org/&lt;/a&gt; and search for Python to get some ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Outside of Python, you might benefit from some extra Emacs packages that help with development in general. &lt;a href=&quot;https://github.com/bbatsov/projectile&quot;&gt;Projectile&lt;/a&gt; is a generic package for project management which gives you a number of interesting features, like searching in a project or moving between tests and implementations. If it hasn't been installed as a dependency from the IDE package of your choice yet, you can also use &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot;&gt;YASnippet&lt;/a&gt; which provides intelligent snippets for code generation. The default snippet collection has a large number of snippets for Python, too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But again, the main IDE packages above will get you a sane environment – the next steps greatly depend on your specific workflows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Full disclosure: I am the author of Elpy, so take that into account when reading the above.)&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2015-03-01T10:07:02.997" LastActivityDate="2015-03-01T10:07:02.997" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9701" PostTypeId="1" CreationDate="2015-03-01T11:36:31.017" Score="1" ViewCount="143" Body="&lt;p&gt;I'm trying to run the bash script, ~/bin/xlda, ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;# ~/bin/xlda&#xA;&#xA;old_filename=&quot;$1&quot;&#xA;new_filename=`echo $old_filename | sed 's/\(.*\.\)flac/\1m4a/'`&#xA;&#xA;~/bin/xld -f alac -o &quot;$new_filename&quot; &quot;$old_filename&quot;&#xA;&#xA;new_md5=`~/bin/xld --stdout &quot;$new_filename&quot; | md5`&#xA;old_md5=`~/bin/xld --stdout &quot;$old_filename&quot; | md5`&#xA;&#xA;if [ &quot;$new_md5&quot; == &quot;$old_md5&quot; ]&#xA;then&#xA;    echo &quot;new file md5 $new_md5&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...on files in a &lt;code&gt;find-name-dired&lt;/code&gt; buffer using &lt;code&gt;dired-do-async-shell-command&lt;/code&gt; in this function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-dired-files-to-alac ()&#xA;  (interactive)&#xA;    (dired-do-async-shell-command &quot;~/bin/xlda&quot; current-prefix-arg&#xA;     (dired-get-marked-files t current-prefix-arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;xld&lt;/code&gt; processes all finish but the md5 is only echo'd for the first shell script to get there. If I run the shell command that emacs runs in a terminal, i.e. &lt;code&gt;~/bin/xlda folder/file.flac&amp;amp;~/bin/xlda folder/file2.flac&lt;/code&gt; then all the md5s are echo'd as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, I will &lt;code&gt;rm&lt;/code&gt; the old file if the md5s match. Even if the script is simply...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;# ~/bin/xlda&#xA;&#xA;old_filename=&quot;$1&quot;&#xA;new_filename=`echo $old_filename | sed 's/\(.*\.\)flac/\1m4a/'`&#xA;&#xA;~/bin/xld -f alac -o &quot;$new_filename&quot; &quot;$old_filename&quot; &amp;amp;&amp;amp; rm &quot;$old_filename&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...it still fails to delete all but one of the *.flac files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that emacs seems to exit all shell sub processes when the first shell sub process to finish finishes.&lt;/p&gt;&#xA;" OwnerUserId="410" LastEditorUserId="410" LastEditDate="2015-03-02T12:47:29.493" LastActivityDate="2015-03-02T12:47:29.493" Title="How to make dired-do-async-shell-command wait for all sub processes to finish" Tags="|dired|shell|async|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9702" PostTypeId="1" AcceptedAnswerId="9705" CreationDate="2015-03-01T12:09:17.040" Score="1" ViewCount="107" Body="&lt;p&gt;Does Emacs allow it to implement POSIX signal handling in Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I would like to handle SIGTERM to finish desktop-mode related things.&lt;/p&gt;&#xA;" OwnerUserId="5473" LastActivityDate="2015-03-01T17:44:20.410" Title="POSIX signal handler in Emacs Lisp" Tags="|desktop|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9703" PostTypeId="1" AcceptedAnswerId="9796" CreationDate="2015-03-01T12:29:10.667" Score="3" ViewCount="629" Body="&lt;p&gt;I am using the display inline images code from this &lt;a href=&quot;https://stackoverflow.com/questions/17621495/emacs-org-display-inline-images&quot;&gt;org-display-inline-images&lt;/a&gt; link.`&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when i run &lt;code&gt;epresent-run&lt;/code&gt; to present it, the images are placed in top left corner. How can i place them in the page's center (i mean, centering image both horizontally &amp;amp; vertically)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Css code might be like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.centered {&#xA; position: absolute&#xA;  top: 50%;&#xA;  left: 50%;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-08-01T13:49:42.613" Title="Place images in page center in epresent-mode" Tags="|org-mode|images|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9704" PostTypeId="2" ParentId="9696" CreationDate="2015-03-01T13:01:01.140" Score="17" Body="&lt;p&gt;I would encourage evil-emacs users to try &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot;&gt;spacemacs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has a brilliant python-layer, see the details here: &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/python&quot;&gt;https://github.com/syl20bnr/spacemacs/tree/master/layers/!lang/python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of now, it includes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Auto-completion using anaconda-mode&lt;/li&gt;&#xA;&lt;li&gt;Code Navigation using anaconda-mode&lt;/li&gt;&#xA;&lt;li&gt;Documentation Lookup using anaconda-mode and pylookup&lt;/li&gt;&#xA;&lt;li&gt;Test Runner using nose.el or pytest&lt;/li&gt;&#xA;&lt;li&gt;Virtual Environment using pyvenv&lt;/li&gt;&#xA;&lt;li&gt;Semantic mode is enabled&lt;/li&gt;&#xA;&lt;li&gt;Django support via pony-mode&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Installation is ridiculously easy, just add the following line to your &lt;code&gt;~/.spacemacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default dotspacemacs-configuration-layers '(python))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="2030" LastEditDate="2016-02-06T15:48:39.703" LastActivityDate="2016-02-06T15:48:39.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9705" PostTypeId="2" ParentId="9702" CreationDate="2015-03-01T13:19:41.850" Score="2" Body="&lt;p&gt;There's &lt;code&gt;special-event-map&lt;/code&gt; which can be used to handle signals among other things, you can bind a key like &lt;code&gt;[sigusr2]&lt;/code&gt; there to a function you'd like to be executed on the respective signal.  I'm not so sure whether it works on anything else than &lt;code&gt;SIGUSR1&lt;/code&gt; and &lt;code&gt;SIGUSR2&lt;/code&gt; though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Here's an useful example of how one could use it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-quit-emacs-unconditionally ()&#xA;  (interactive)&#xA;  (save-some-buffers t t)&#xA;  (kill-emacs))&#xA;&#xA;(define-key special-event-map (kbd &quot;&amp;lt;sigusr1&amp;gt;&quot;) 'my-quit-emacs-unconditionally)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-03-01T17:44:20.410" LastActivityDate="2015-03-01T17:44:20.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9706" PostTypeId="1" CreationDate="2015-03-01T13:59:21.327" Score="1" ViewCount="1866" Body="&lt;p&gt;I have some lines of code in a python script opened under &lt;code&gt;Py Outl&lt;/code&gt; mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;last=-1&#xA;for i in range(len(page_nos)-1, -1, -1):&#xA;    if page_nos[i] != 'NULL':&#xA;        last = i&#xA;        break&#xA;&#xA;if last == -1:                                                                                &#xA;    page_nos[0] = 1&#xA;    last = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to put them into a function, so I add a line of function definition in front of them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def fillnull(page_nos):&#xA;&#xA;last=-1&#xA;for i in range(len(page_nos)-1, -1, -1):&#xA;    if page_nos[i] != 'NULL':&#xA;        last = i&#xA;        break&#xA;&#xA;if last == -1:                                                                              &#xA;    page_nos[0] = 1&#xA;    last = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then want to indent the original lines so that they can become the body of the function. By selecting the region and &lt;code&gt;M-x indent-region&lt;/code&gt;, the region becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def fillnull(page_nos):&#xA;&#xA;    last=-1&#xA;    for i in range(len(page_nos)-1, -1, -1):&#xA;        if page_nos[i] != 'NULL':&#xA;            last = i&#xA;            break&#xA;&#xA;        if last == -1: &#xA;            page_nos[0] = 1&#xA;            last = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why does it put extra indents in front of the second if block? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I indent the original lines correctly? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2015-03-01T19:55:25.907" Title="Indent region in python script" Tags="|indentation|python|" AnswerCount="1" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="9707" PostTypeId="2" ParentId="9706" CreationDate="2015-03-01T15:31:23.753" Score="3" Body="&lt;p&gt;Caused as &lt;code&gt;py-indent-region&lt;/code&gt; calculated indent of every single line. Which results in outmost indent of each line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As this may destroy program-logic, fixed in trunk following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bugs.launchpad.net/python-mode/+bug/1426903&quot; rel=&quot;nofollow&quot;&gt;https://bugs.launchpad.net/python-mode/+bug/1426903&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;New behavior:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If first line of regions indent is changed, remaining lines' indent is kept by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If first lines' indent is unchanged, the remaining are calculated line-by-line, also With C-u option.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-03-01T19:55:25.907" LastActivityDate="2015-03-01T19:55:25.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9708" PostTypeId="1" CreationDate="2015-03-01T16:01:50.113" Score="3" ViewCount="109" Body="&lt;p&gt;There's recently been a commit to AUCTeX that I would like to start using right away, but I would like to use the built-in package system to manage the updates.  Is there a way to use &lt;code&gt;package.el&lt;/code&gt; to pull in AUCTeX's &lt;code&gt;HEAD&lt;/code&gt; rather than tags?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This might be a misunderstanding of how the package system actually works. If so, forgive me &lt;code&gt;:)&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-03-03T10:13:32.007" Title="Is there a way to use AUCTeX'S HEAD from package.el?" Tags="|auctex|package|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9709" PostTypeId="1" AcceptedAnswerId="9710" CreationDate="2015-03-01T17:44:26.563" Score="17" ViewCount="5067" Body="&lt;p&gt;I have started using Org-Mode and every time I close my file every headline is collapsed when I reopen it. Is there any way to stop that? I want every headline fully expanded.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2015-03-01T18:02:10.770" LastActivityDate="2015-03-01T18:20:47.867" Title="Keep the headlines expanded in Org-Mode" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9710" PostTypeId="2" ParentId="9709" CreationDate="2015-03-01T17:53:32.880" Score="21" Body="&lt;p&gt;It is possible to set the &lt;a href=&quot;http://orgmode.org/manual/Initial-visibility.html#Initial-visibility&quot; rel=&quot;noreferrer&quot;&gt;Initial Visibility&lt;/a&gt; per org file. You can make the org file show all the headings expanded at start-up by using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: showeverything &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @lawlist mentioned in the comments, you can also set this option to be effective globally by putting the below in your emacs init: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-startup-folded nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-03-01T18:20:47.867" LastActivityDate="2015-03-01T18:20:47.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9711" PostTypeId="1" AcceptedAnswerId="9712" CreationDate="2015-03-01T17:56:44.687" Score="0" ViewCount="136" Body="&lt;pre&gt;&lt;code&gt; (string-match-p &quot;^\(./\|../\)&quot; &quot;../lib/tern&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns false. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the correct regex pattern to check if the string begins with &lt;code&gt;./&lt;/code&gt; or &lt;code&gt;../&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="50" LastEditDate="2015-03-01T19:11:10.860" LastActivityDate="2015-03-01T23:20:09.923" Title="Error escaping elisp regex" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9712" PostTypeId="2" ParentId="9711" CreationDate="2015-03-01T18:19:43.900" Score="3" Body="&lt;p&gt;This is because of not enough escaping. You do need to escape dots (unescaped it means &quot;any character just not the end of line&quot;). When you escape anything in a string literal you need double slash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A regular expression you want could be this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match-p &quot;^\\.\\.?/&quot; &quot;../lib/tern&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your original version could be rewritten like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match-p &quot;^\\(:?\\.\\|\\.\\.\\)/&quot; &quot;../lib/tern&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="50" LastEditDate="2015-03-01T23:20:09.923" LastActivityDate="2015-03-01T23:20:09.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9713" PostTypeId="2" ParentId="9708" CreationDate="2015-03-01T18:51:41.633" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to usepackage.el to pull in AUCTeX's HEAD rather than tags?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package.el&lt;/code&gt; doesn't pull in tags, it pulls in whichever single version the server makes available. So no, &lt;strong&gt;package.el has no control over what is offered to it by the server&lt;/strong&gt;. It just so happens that some servers offer the latest tag. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What you can do is clone the repo yourself, keep it updated, and use package.el to install this clone you have. If you're using emacs 25 already, you can visit the directory and use &lt;code&gt;package-install-from-buffer&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-01T18:51:41.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9714" PostTypeId="2" ParentId="9708" CreationDate="2015-03-01T18:58:59.330" Score="1" Body="&lt;p&gt;You could also use &lt;a href=&quot;https://github.com/cask/cask&quot; rel=&quot;nofollow&quot;&gt;Cask&lt;/a&gt; to manage dependencies in order to achieve that, but you're likely already aware of such an alternative that introduces another program.&lt;/p&gt;&#xA;" OwnerUserId="943" LastActivityDate="2015-03-01T18:58:59.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9715" PostTypeId="1" AcceptedAnswerId="9718" CreationDate="2015-03-01T19:30:55.667" Score="11" ViewCount="647" Body="&lt;p&gt;Is there a way to integrate &lt;a href=&quot;https://github.com/cereda/arara&quot; rel=&quot;noreferrer&quot;&gt;Arara&lt;/a&gt; as a way to automate the building process of a LaTeX document in Emacs/AUCTex?&lt;/p&gt;&#xA;" OwnerUserId="6639" LastEditorUserId="25" LastEditDate="2015-03-01T21:38:06.210" LastActivityDate="2019-01-21T18:24:16.843" Title="Arara integration in Emacs?" Tags="|auctex|latex|arara|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9716" PostTypeId="5" CreationDate="2015-03-01T21:39:05.190" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/cereda/arara&quot; rel=&quot;nofollow&quot;&gt;Arara&lt;/a&gt; is a build automation tool for TeX documents.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-03-02T00:23:22.897" LastActivityDate="2015-03-02T00:23:22.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9717" PostTypeId="4" CreationDate="2015-03-01T21:39:05.190" Score="0" Body="Arara is a TeX build automation tool" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-03-02T00:22:57.573" LastActivityDate="2015-03-02T00:22:57.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9718" PostTypeId="2" ParentId="9715" CreationDate="2015-03-01T22:01:05.200" Score="9" Body="&lt;p&gt;Add the appropriate entry to &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#index-TeX_002dcommand_002dlist&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;TeX-command-list&lt;/code&gt;&lt;/a&gt;.  Insert the following code in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;tex&quot;&#xA;  '(add-to-list 'TeX-command-list&#xA;        '(&quot;Arara&quot; &quot;arara --verbose %s&quot; TeX-run-TeX nil t :help &quot;Run Arara.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;--verbose&lt;/code&gt; flag &lt;a href=&quot;https://emacs.stackexchange.com/q/9715/620?noredirect=1#comment72768_9718&quot;&gt;has been suggested&lt;/a&gt; by Paul Stanley.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2019-01-21T18:24:16.843" LastActivityDate="2019-01-21T18:24:16.843" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="9719" PostTypeId="2" ParentId="7814" CreationDate="2015-03-01T23:26:47.493" Score="2" Body="&lt;p&gt;Although this is not pristine elisp, the following should work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cider-eval-paragraph ()&#xA;  (interactive) &#xA;  (save-excursion&#xA;    (mark-paragraph) &#xA;    (command-execute 'cider-eval-region)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note this is exactly what you wrote, except the macro is called saVe-excursion.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-01T23:26:47.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9720" PostTypeId="1" CreationDate="2015-03-01T23:40:35.157" Score="5" ViewCount="850" Body="&lt;p&gt;I've got helm installed to work with comint mode either in eshell or when running python in an inferior comint process. I'd like to preserve the command line history, especially in the python mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq savehist-additional-variables '(comint-input-ring))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that seems to result in the savehist file always containing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comint-input-ring 'nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Other fields like search-ring, kill-ring, minibuffer-history save fine. Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this &lt;a href=&quot;https://emacs.stackexchange.com/questions/4221/remembering-history-between-sessions-in-inferior-emacs-lisp-mode&quot;&gt;link&lt;/a&gt; answers it for a 'real' shell but it doesn't work in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;As requested, what I've tried is the following, and it describes my use-case&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(helm-mode 1)&#xA;(define-key comint-mode-map (kbd &quot;C-S-l&quot; 'helm-comint-input-ring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;elsewhere in .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'python-mode) ;; Goes to ipython.exe (on windows)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Coding some python, using C-c C-c to send to ipython process.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; somefunc()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This now appears if I use C-S-l as a helm-comint-input-ring and I can search on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to preserve these commands as I tend to repeat them across sessions (but with enough variability to not script it away completely).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree there could be both eshell, python , other comint buffers running, I suppose you are saying that ipython should preserve the history buffer and I should somehow get savehist to load that? Not sure how.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2023-03-16T23:22:45.127" Title="savehist the comint input ring" Tags="|helm|comint|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9721" PostTypeId="2" ParentId="9720" CreationDate="2015-03-02T00:05:06.383" Score="1" Body="&lt;p&gt;AFAIK the global binding for &lt;code&gt;comint-input-ring&lt;/code&gt; will almost certainly be &lt;code&gt;nil&lt;/code&gt;, as it is given a buffer-local value in comint buffers (for the obvious reasons of not blending all the histories of all your comint buffers together).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, it won't work with &lt;code&gt;savehist&lt;/code&gt; in that way (and perhaps nor would you want it to).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should work out exactly how you want this to work, bearing in mind that there may be multiple coincidental comint buffers (including multiple buffers using the exact same mode), so that you can work out what you should restore from any given history in a subsequent Emacs instance.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-03-02T00:05:06.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9722" PostTypeId="2" ParentId="9674" CreationDate="2015-03-02T02:29:44.570" Score="1" Body="&lt;p&gt;It doesn't look like there is any variable you can set to insert text into the text-only startup screen that is displayed when Emacs starts with a small initial frame. It looks like &lt;code&gt;fancy-startup-screen&lt;/code&gt; gets called if the display is big enough, otherwise &lt;code&gt;normal-splash-screen&lt;/code&gt; is called. Unlike &lt;code&gt;fancy-startup-screen&lt;/code&gt; the contents that get inserted into the buffer by &lt;code&gt;normal-splash-screen&lt;/code&gt; are all hard coded into the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now I've set Emacs to startup in full screen, so the fancy startup screen is used. An alternative would be to set &lt;code&gt;inhibit-startup-screen&lt;/code&gt; and the add &lt;code&gt;fancy-startup-screen&lt;/code&gt; to the &lt;code&gt;emacs-startup-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I'm now using the following hack to always use &lt;code&gt;fancy-startup-screen&lt;/code&gt;, even on small displays:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun always-use-fancy-splash-screens-p () 1)&#xA;  (defalias 'use-fancy-splash-screens-p 'always-use-fancy-splash-screens-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5308" LastEditorUserId="5308" LastEditDate="2015-03-27T02:30:36.617" LastActivityDate="2015-03-27T02:30:36.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9724" PostTypeId="1" AcceptedAnswerId="9726" CreationDate="2015-03-02T02:51:42.257" Score="1" ViewCount="353" Body="&lt;p&gt;At present I use a &lt;code&gt;screen&lt;/code&gt; session in the terminal (outside of emacs), with window 0 devoted to running my web server, window 1 to running tests, and window 2 for general hacking. I like this flow and want to keep something similar. I was wondering a way to emulate this on emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should always have one frame devoted to exactly one of these three windows (on the bottom) and there should be some way to cycle through them. I don't really want these windows getting mixed up in the rest of my windows. Arguably this is a good use case for another frame, but that sends me back to using &lt;code&gt;screen&lt;/code&gt; or something to manage and I was experimenting with getting away from this utility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next option is (somehow - still learning) setting up perennial buffers and being able to access them via the buffer list. Still scatters them around; not great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My other reasonable solution is to run a &lt;code&gt;screen&lt;/code&gt; inside a shell and anchor the window. Not crazy, but still have the problem of nested control characters and stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any good solution here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular this creates a window reserved for basically a full emacs session inside a window, and in fact I &lt;em&gt;could&lt;/em&gt; just nest it inside a shell, but obviously the key bindings basically go to oblivion and back.&lt;/p&gt;&#xA;" OwnerUserId="6641" LastEditorUserId="105" LastEditDate="2015-03-27T19:26:08.157" LastActivityDate="2015-03-27T19:26:08.157" Title="What's a good workflow for having a few dedicated shell sessions?" Tags="|window|shell|shell-mode|cycling|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9725" PostTypeId="2" ParentId="2350" CreationDate="2015-03-02T02:58:10.223" Score="4" Body="&lt;p&gt;The &lt;a href=&quot;http://emacswiki.org/emacs/FullScreen&quot; rel=&quot;nofollow&quot;&gt;instructions on emacswiki&lt;/a&gt; worked for me (Emacs 24.3.1).&#xA;I've only tried this on Unity, so I'm not 100% sure it will work on KDE. Here's the relevant portion from my ~/.emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-fullscreen ()&#xA;  (interactive)&#xA;  (set-frame-parameter nil 'fullscreen 'fullboth) ;this makes the frame go fullscreen&#xA;  (tool-bar-mode -1) ;these 3 lines turn off GUI junk&#xA;  (scroll-bar-mode -1)&#xA;  (menu-bar-mode -1))&#xA;&#xA;(defun my-non-fullscreen ()&#xA;  (interactive)&#xA;  (set-frame-parameter nil 'width 82)&#xA;  (set-frame-parameter nil 'fullscreen 'fullheight)&#xA;  (menu-bar-mode t)) ;I don't turn tool-bar and scroll-bar back on b/c I never want them&#xA;&#xA;(defun toggle-fullscreen ()&#xA;  (interactive)&#xA;  (if (eq (frame-parameter nil 'fullscreen) 'fullboth)  ;tests if already fullscreened&#xA;      (my-non-fullscreen)&#xA;    (my-fullscreen)))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f11&amp;gt;&quot;) 'toggle-fullscreen) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6642" LastActivityDate="2015-03-02T02:58:10.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9726" PostTypeId="2" ParentId="9724" CreationDate="2015-03-02T07:48:10.797" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I should always have one frame devoted to exactly one of these three windows (on the bottom) and there should be some way to cycle through them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I recommend using &lt;a href=&quot;https://github.com/DamienCassou/shell-switcher&quot;&gt;&lt;code&gt;shell-switcher&lt;/code&gt;&lt;/a&gt;, which keeps a register of shell buffers and allows you to easily switch between them with &lt;code&gt;C-'&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use eshell as my primary shell and have it configured to work with &lt;code&gt;shell-switcher&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'eshell)&#xA;(require 'shell-switcher)&#xA;(setq shell-switcher-mode t)&#xA;(add-hook 'eshell-mode-hook 'shell-switcher-manually-register-shell)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I don't really want these windows getting mixed up in the rest of my windows. Arguably this is a good use case for another frame, but that sends me back to using screen or something to manage and I was experimenting with getting away from this utility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The shell buffers do appear in the list of all buffers, but with shell-switcher you don't have to go through the regular buffer list to switch shells.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-03-02T07:48:10.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9727" PostTypeId="2" ParentId="9698" CreationDate="2015-03-02T08:21:10.607" Score="6" Body="&lt;p&gt;The special form &lt;code&gt;or&lt;/code&gt; is useful here. This macro returns the value of the first argument, unless it's nil in which case it returns the second. So, assuming the variable you want to check is &lt;code&gt;foo&lt;/code&gt;, the following will do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;%s.el&quot; (or foo &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In some ways it's better than a magic tag since it makes it clear what value should be returned if the argument is nil.&lt;/p&gt;&#xA;" OwnerUserId="161" LastEditorUserId="161" LastEditDate="2015-03-02T09:31:53.203" LastActivityDate="2015-03-02T09:31:53.203" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9729" PostTypeId="1" AcceptedAnswerId="9736" CreationDate="2015-03-02T11:15:50.637" Score="4" ViewCount="695" Body="&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pretty straightforward: How to highlight &lt;code&gt;constexpr&lt;/code&gt; in cc-mode (editing C++ code)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;code&gt;const&lt;/code&gt; as in the following example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const double = 3.14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;const&lt;/code&gt; gets highlighted as a &lt;strong&gt;keyword&lt;/strong&gt;&lt;sup&gt;(1)&lt;/sup&gt; (i.e., in pink), while if I write&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;constexpr double = 3.14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;constexpr&lt;/code&gt; gets highlighted as &lt;code&gt;all-faces&lt;/code&gt; (i.e., no highlighting at all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, a simple solution like writing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-keywords &quot;constexpr&quot;) ;; pseudo-code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;.emacs&lt;/code&gt; without tinkering with the code of cc-mode would be the best for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Addendum&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question might be related: &lt;a href=&quot;https://emacs.stackexchange.com/questions/3923/change-the-way-cc-mode-font-lock-the-c11-auto-syntax&quot;&gt;Change the way CC-mode font-lock the C++11 &lt;code&gt;auto&lt;/code&gt; syntax&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt; (1) I &lt;em&gt;think&lt;/em&gt; that it is a keyword because placing the pointer on the word and doing &lt;kbd&gt;M&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; &lt;code&gt;customize-face&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; I get: &lt;code&gt;Customize face (default ``font-lock-keyword-face'):&lt;/code&gt; and pressing &lt;kbd&gt;RET&lt;/kbd&gt; I get redirected to the “Easy Customization” wizard.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="2360" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-03-02T15:03:49.207" Title="How to highlight “constexpr” in cc-mode?" Tags="|syntax-highlighting|cc-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9731" PostTypeId="1" AcceptedAnswerId="9732" CreationDate="2015-03-02T12:50:06.110" Score="0" ViewCount="296" Body="&lt;p&gt;I use Emacs 24.4 on Ubuntu and Windows with virtually identical init files. The following snippet is not loading correctly on Windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired+)&#xA;(diredp-toggle-find-file-reuse-dir 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The intent is to use the same buffer while navigating folders in &lt;code&gt;dired+&lt;/code&gt;. It is working as expected on my home machine running Ubuntu, but it gives the following error on the work computer running Windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Cannot open load file, no such file or directory, dired+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do have &lt;code&gt;dired+&lt;/code&gt; installed, and it runs when evaluating the same section in Emacs after it has opened. However, it's not being recognized during startup. Has anyone faced this problem with &lt;code&gt;dired+&lt;/code&gt;, and is there a way to load it properly on Windows?&lt;/p&gt;&#xA;" OwnerUserId="969" LastActivityDate="2015-03-02T13:36:21.107" Title="Dired+ not loading from the init file on Windows" Tags="|init-file|dired|" AnswerCount="1" CommentCount="2" ClosedDate="2015-03-25T13:27:17.600" ContentLicense="CC BY-SA 3.0" />
  <row Id="9732" PostTypeId="2" ParentId="9731" CreationDate="2015-03-02T13:36:21.107" Score="2" Body="&lt;p&gt;Here are few things to check when debugging why an installed package is not found by emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install the package using the in-built package manager.&lt;/li&gt;&#xA;&lt;li&gt;Ensure that the parent folder of the package's installed folder is set to the &lt;code&gt;package-user-dir&lt;/code&gt; variable (this is set to &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; by default). &lt;/li&gt;&#xA;&lt;li&gt;You then need to do &lt;code&gt;(package-initialize)&lt;/code&gt; to load the packages in that path and activate them.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;package-initialize is an interactive autoloaded compiled Lisp function&#xA;  in `package.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(package-initialize &amp;amp;optional NO-ACTIVATE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For more information check the manuals.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Load Emacs Lisp packages, and activate them.&#xA;  The variable `package-load-list' controls which packages to load.&#xA;  If optional arg NO-ACTIVATE is non-nil, don't activate packages.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-03-02T13:36:21.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9733" PostTypeId="1" AcceptedAnswerId="9741" CreationDate="2015-03-02T13:39:14.067" Score="0" ViewCount="151" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ecli-metadata-single (ecli meta)&#xA;  &quot;meta needs to be quotes \n example: (case-metadata ECLI:NL:HR:2013:BY6108 'identifier)&quot;&#xA;  (interactive &quot;sEnter ecli: \nxEnter identifier: &quot;)&#xA;  (insert (car (cddr (assoc  meta (ecli-metadata-full ecli)))))&#xA; )&#xA;&#xA;(ecli-metadata-single &quot;ECLI:NL:HR:2007:BA2511&quot; 'date)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What this code does is getting some metadata from a remote xml-file. The code seems to work fine when I use just type the expression, however, the interactive version does not insert the data, instead throwing an error saying &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;wrong type argument: char-or-string-p, nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have looked up (interactive) in &lt;code&gt;C-h f&lt;/code&gt;, and tried many of the alternative characters for input. However, I still get the same (non-)result. After browsing stack-overflow and not finding a suitable answer, I 'gave up' and decided to ask this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To recap:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to make the above function interactively insert data. The first argument is an identifier-code, and the second argument is the data I want from the retrieved xml (other code not shown due to length). The first argument is a string &lt;code&gt;&quot;ECLI:NL:HR:2013:BY6108&quot;&lt;/code&gt;, and the second argument is a quoted item &lt;code&gt;'date&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A second question would be how I can remove the required quote from the input-arguments. I have tried something like &lt;code&gt;(quote meta)&lt;/code&gt;, but that did not work.&lt;/p&gt;&#xA;" OwnerUserId="6645" LastEditorUserId="115" LastEditDate="2015-03-02T15:47:23.137" LastActivityDate="2015-03-02T16:03:46.090" Title="Interactive input, strings and quoted items" Tags="|interactive|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9734" PostTypeId="2" ParentId="9317" CreationDate="2015-03-02T13:53:28.753" Score="10" Body="&lt;p&gt;Use &lt;code&gt;M-x magit-file-untrack&lt;/code&gt; from a buffer visiting a tracked file or from a Magit buffer. When the buffer visits a file then that file is offered as default choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When point is on a file in a Magit buffer, then that is also offered as default. You might also want to add the new &lt;code&gt;magit-insert-tracked-files&lt;/code&gt; to &lt;code&gt;magit-status-sections-hook&lt;/code&gt;, then a tree of all tracked files is inserted into the status buffer (but doing so might not be good for performance in big repositories).&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T13:04:33.150" LastActivityDate="2015-07-03T13:04:33.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9735" PostTypeId="1" AcceptedAnswerId="9792" CreationDate="2015-03-02T14:52:34.010" Score="0" ViewCount="1313" Body="&lt;p&gt;There's an interesting question about &lt;a href=&quot;https://emacs.stackexchange.com/questions/5900/how-can-i-view-the-hierarchy-of-todo-keywords-in-org-agenda-mode&quot;&gt;how to view the hierarchy of TODO keywords in org-agenda&lt;/a&gt; which shows two different approaches:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;use the &lt;code&gt;&quot;%l&quot;&lt;/code&gt; specifier in &lt;code&gt;org-agenda-prefix-format&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;set &lt;code&gt;org-tags-match-list-sublevels&lt;/code&gt; to &lt;code&gt;'indentation&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But I can't seem to get either to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the first method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;My TODOs&quot;&#xA;         ((tags-todo &quot;mytag&quot;&#xA;                     ((org-agenda-prefix-format &quot; %e %l &quot;)&#xA;                      (org-tags-match-list-sublevels t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get a backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument buffer-or-string-p 3)&#xA;  get-text-property(0 extra-space 3)&#xA;  (concat level &quot;&quot; (get-text-property 0 (quote extra-space) level))&#xA;  (if (equal level &quot;&quot;) &quot;&quot; (concat level &quot;&quot; (get-text-property 0 (quote extra-space) level)))&#xA;  (format &quot;%s&quot; (if (equal level &quot;&quot;) &quot;&quot; (concat level &quot;&quot; (get-text-property 0 (quote extra-space) level))))&#xA;  (format &quot; %s %s %s &quot; (format &quot;%38s&quot; (if (equal breadcrumbs &quot;&quot;) &quot;&quot; (concat breadcrumbs &quot;&quot; (get-text-property 0 (quote extra-space) breadcrumbs)))) (format &quot;%6s&quot; (if (equal effort &quot;&quot;) &quot;&quot; (concat effort &quot;&quot; (get-text-property 0 (quote extra-space) effort)))) (format &quot;%s&quot; (if (equal level &quot;&quot;) &quot;&quot; (concat level &quot;&quot; (get-text-property 0 (quote extra-space) level)))))&#xA;  eval((format &quot; %s %s %s &quot; (format &quot;%38s&quot; (if (equal breadcrumbs &quot;&quot;) &quot;&quot; (concat breadcrumbs &quot;&quot; (get-text-property 0 (quote extra-space) breadcrumbs)))) (format &quot;%6s&quot; (if (equal effort &quot;&quot;) &quot;&quot; (concat effort &quot;&quot; (get-text-property 0 (quote extra-space) effort)))) (format &quot;%s&quot; (if (equal level &quot;&quot;) &quot;&quot; (concat level &quot;&quot; (get-text-property 0 (quote extra-space) level))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The breadcrumb representation works, but...:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;My TODOs&quot;&#xA;         ((tags-todo &quot;mytag&quot;&#xA;                     ((org-agenda-prefix-format &quot; %e %b &quot;)&#xA;                      (org-tags-match-list-sublevels t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...my headlines are too long and/or nested to neatly fit on the screen using breadcrumbs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second method successfully indents the headlines using dots, but it also obliterates the &lt;em&gt;effort&lt;/em&gt; times with spaces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;My TODOs&quot;&#xA;         ((tags-todo &quot;mytag&quot;&#xA;                     ((org-agenda-prefix-format &quot; %e &quot;)&#xA;                      (org-tags-match-list-sublevels 'indented)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried swapping out the &lt;em&gt;effort&lt;/em&gt; for &lt;em&gt;breadcrumbs&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;My TODOs&quot;&#xA;         ((tags-todo &quot;mytag&quot;&#xA;                     ((org-agenda-prefix-format &quot; %b &quot;)&#xA;                      (org-tags-match-list-sublevels 'indented)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and that is &lt;em&gt;not&lt;/em&gt; obliterated - it shows the breadcrumbs, then indentation dots, then TODO keyword and headline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have I just unluckily run into two different bugs or have I done something stupid? I want &lt;em&gt;mytag&lt;/em&gt; TODOs with effort and indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;GNU Emacs 24.4.1&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;org 8.2.10&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6647" LastActivityDate="2015-03-03T21:09:36.967" Title="org-agenda tags-todo hierarchy weirdness" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9736" PostTypeId="2" ParentId="9729" CreationDate="2015-03-02T15:03:49.207" Score="3" Body="&lt;p&gt;The incantation you want is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'c++-mode&#xA;                        '((&quot;constexpr&quot; . 'font-lock-keyword-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-03-02T15:03:49.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9737" PostTypeId="2" ParentId="3432" CreationDate="2015-03-02T15:05:18.317" Score="3" Body="&lt;p&gt;Based on itsjeyd's answer I advised &lt;code&gt;eshell/cat&lt;/code&gt; to display images when an argument is the filename of an image file supported by &lt;code&gt;iimage-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/iimage-mode-refresh--eshell/cat (orig-fun &amp;amp;rest args)&#xA;  &quot;Display image when using cat on it.&quot;&#xA;  (let ((image-path (cons default-directory iimage-mode-image-search-path)))&#xA;    (dolist (arg args)&#xA;      (let ((imagep nil)&#xA;            file)&#xA;        (with-silent-modifications&#xA;          (save-excursion&#xA;            (dolist (pair iimage-mode-image-regex-alist)&#xA;              (when (and (not imagep)&#xA;                         (string-match (car pair) arg)&#xA;                         (setq file (match-string (cdr pair) arg))&#xA;                         (setq file (locate-file file image-path)))&#xA;                (setq imagep t)&#xA;                (add-text-properties 0 (length arg)&#xA;                                     `(display ,(create-image file)&#xA;                                               modification-hooks&#xA;                                               (iimage-modification-hook))&#xA;                                     arg)&#xA;                (eshell-buffered-print arg)&#xA;                (eshell-flush)))))&#xA;        (when (not imagep)&#xA;          (apply orig-fun (list arg)))))&#xA;    (eshell-flush)))&#xA;&#xA;(advice-add 'eshell/cat :around #'my/iimage-mode-refresh--eshell/cat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows me to display images right in the eshell buffer and to concatenate images and text alike.  There's probably a more elegant way to do this (and a safer way in case &lt;code&gt;iimage-mode&lt;/code&gt; is not enabled), but I'll just leave it like this for now until it bites me.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-03-02T15:05:18.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9738" PostTypeId="1" AcceptedAnswerId="9793" CreationDate="2015-03-02T15:06:05.600" Score="7" ViewCount="1373" Body="&lt;p&gt;You can use &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; to have the &lt;em&gt;effort&lt;/em&gt; shown for each TODO headline:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;My TODOs&quot;&#xA;         ((tags-todo &quot;mytag&quot;&#xA;                     ((org-agenda-prefix-format &quot; %6e &quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which shows something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       TODO Some patent task&#xA;[0:30] ..TODO Some sub-task&#xA;[0:30] ..TODO Some other sub-task&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unlike a clocktable the effort of the sub-tasks is not summed up for the parent task. I would like it to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[1:00] TODO Some patent task&#xA;[0:30] ..TODO Some sub-task&#xA;[0:30] ..TODO Some other sub-task&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looking at the documentation for &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; shows nothing similar to &lt;code&gt;%e&lt;/code&gt; that also does summing, but there is a generic &lt;code&gt;%(expression)&lt;/code&gt;, with no explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What &lt;code&gt;%(expression)&lt;/code&gt; would give me output like the above?&lt;/p&gt;&#xA;" OwnerUserId="6647" LastActivityDate="2015-03-04T16:46:13.070" Title="org-agenda todo effort rollup" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9739" PostTypeId="2" ParentId="7394" CreationDate="2015-03-02T15:39:51.503" Score="18" Body="&lt;p&gt;Starting with &lt;code&gt;v2.1.0&lt;/code&gt; Magit provides basic support for &lt;code&gt;git format-patch&lt;/code&gt; as well as &lt;code&gt;git request-pull&lt;/code&gt;. They share a popup, &lt;code&gt;magit-patch-popup&lt;/code&gt;, which &lt;kbd&gt;W&lt;/kbd&gt; is bound to.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T13:21:22.667" LastActivityDate="2015-07-03T13:21:22.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9740" PostTypeId="1" AcceptedAnswerId="9742" CreationDate="2015-03-02T16:01:36.523" Score="10" ViewCount="2896" Body="&lt;p&gt;I would like to use &lt;code&gt;global-hl-line-mode&lt;/code&gt;, but some of my themes lack a good highlight face. Is there a general way to define one (that's not inverse-color)? I would like to maintain syntax highlighting, which has broken in my attempts.&lt;/p&gt;&#xA;" OwnerUserId="6648" LastEditorUserId="160" LastEditDate="2015-03-02T16:51:27.347" LastActivityDate="2015-03-02T17:10:55.670" Title="How to define a good highlight face" Tags="|colors|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9741" PostTypeId="2" ParentId="9733" CreationDate="2015-03-02T16:03:46.090" Score="0" Body="&lt;p&gt;When you invoke the command interactively, are you typing &lt;code&gt;'date&lt;/code&gt; at the prompt, or just &lt;code&gt;date&lt;/code&gt;?  You should be typing &lt;code&gt;date&lt;/code&gt;, because the lisp object that &lt;code&gt;interactive&lt;/code&gt; reads is not an eval form; that is, the symbol you type does not need to be quoted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you do have the result of a quote-expression and you want to retrieve the symbol, just treat it like an ordinary list.  If &lt;code&gt;a&lt;/code&gt; is &lt;code&gt;(quote foo)&lt;/code&gt;, then &lt;code&gt;(car (cdr a))&lt;/code&gt; is the symbol &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="321" LastActivityDate="2015-03-02T16:03:46.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9742" PostTypeId="2" ParentId="9740" CreationDate="2015-03-02T16:48:49.127" Score="18" Body="&lt;p&gt;This is really a matter of opinion, but I have always found that that making the &lt;code&gt;hl-line&lt;/code&gt; have a slightly darker background than the default is best.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to maintain syntax highlighting, which has broken in my attempts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want to maintain syntax highlighting, make sure that &lt;code&gt;hl-line&lt;/code&gt; face's &lt;code&gt;:foreground&lt;/code&gt; attribute is nil, then set the &lt;code&gt;:background&lt;/code&gt; attribute to what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what it looks like for me with these settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil :background &quot;gray15&quot;)&#xA;(set-face-attribute 'hl-line nil :foreground nil :background &quot;gray5&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Np7x1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the sound of it, you don't want hard coded colors because you will be changing themes. You can have emacs automatically set the &lt;code&gt;:background&lt;/code&gt; of the &lt;code&gt;hl-line&lt;/code&gt; face to a color slightly darker than the current default &lt;code&gt;:background&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'color)&#xA;&#xA;(defun set-hl-line-color-based-on-theme ()&#xA;  &quot;Sets the hl-line face to have no foregorund and a background&#xA;    that is 10% darker than the default face's background.&quot;&#xA;  (set-face-attribute 'hl-line nil&#xA;                      :foreground nil&#xA;                      :background (color-darken-name (face-background 'default) 10)))&#xA;&#xA;(add-hook 'global-hl-line-mode-hook 'set-hl-line-color-based-on-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set the face's background to a color 10% darker than the default background anytime you enable &lt;code&gt;global-hl-line-mode&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-03-02T17:10:55.670" LastActivityDate="2015-03-02T17:10:55.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9743" PostTypeId="1" CreationDate="2015-03-02T17:03:23.733" Score="2" ViewCount="346" Body="&lt;p&gt;In org-mode..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I store lots of state-change messages and timing info in the &lt;code&gt;LOGBOOK&lt;/code&gt; drawer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time, I don't look into the &lt;code&gt;LOGBOOK&lt;/code&gt; drawer, but once in a while when following up on a pending task, I peek into the &lt;code&gt;LOGBOOK&lt;/code&gt; drawer to see my note.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a quick-way to expand the drawer using TAB on the head-line. &#xA;Currently, 1st tab expands the entry, 2nd tab expands entry + subentry but not the &lt;code&gt;LOGBOOK&lt;/code&gt; drawer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd like to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First tab expands the entry,   &lt;/li&gt;&#xA;&lt;li&gt;Second tab expands sub-headings &lt;strong&gt;including &lt;code&gt;LOGBOOK&lt;/code&gt;&lt;/strong&gt; drawer (but not &lt;code&gt;PROPERTIES&lt;/code&gt; or other drawers).  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I'm trying to tie in a function into the &lt;code&gt;org-cycle-hook&lt;/code&gt;, but I have an issue:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/expand-logbook-drawer ()&#xA; &quot;Expand the closest logbook drawer&quot;&#xA; (interactive)&#xA; (search-forward &quot;:LOGBOOK:&quot;)&#xA; (org-cycle)&#xA;)&#xA;&#xA;(add-hook 'org-cycle-hook&#xA;  (lambda (my/var/curr-state)&#xA;    (interactive)&#xA;    (message &quot;State changed&quot;)&#xA;    (when (= my/var/curr-state &quot;all&quot;)   ;This comparison doesn't work, error: wrong argument, number-or-marker-p&#xA;      (my/expand-logbook-drawer)&#xA;    )&#xA;  )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems my comparison function doesn't work. Thoughts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, the org-mode-cycle docu is &lt;a href=&quot;http://orgmode.org/worg/doc.html#outline-container-orgtbl-mode-off-hook&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="675" LastEditDate="2015-05-12T21:27:22.730" LastActivityDate="2015-05-12T21:27:22.730" Title="Expand LOGBOOK on 2nd Tab press? (hook for 2nd org-cycle?)" Tags="|org-mode|hooks|cycling|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9744" PostTypeId="1" AcceptedAnswerId="9746" CreationDate="2015-03-02T17:23:34.013" Score="3" ViewCount="146" Body="&lt;p&gt;when i run,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (dolist (elt ctl-x-map)&#xA;             (print elt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it prints,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#^[nil nil keymap &#xA;#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly nil kmacro-keymap downcase-region (keymap (108 . set-language-environment) (99 . universal-coding-system-argument) (28 . set-input-method) (88 . set-next-selection-coding-system) (120 . set-selection-coding-system) (112 . set-buffer-process-coding-system) (107 . set-keyboard-coding-system) (116 . set-terminal-coding-system)&#xA;#^^[3 0 pop-global-mark nil list-buffers save-buffers-kill-terminal list-directory eval-last-sexp find-file nil nil indent-rigidly nil kmacro-keymap downcase-region (keymap (108 . set-language-environment) (99 . universal-coding-system-argument) (28 . set-input-method) (88 . set-next-selection-coding-system) (120 . set-selection-coding-system) (112 . set-buffer-process-coding-system) (107 . set-keyboard-coding-system) (116 . set-terminal-coding-system) (70 . set-file-name-coding-system) (114 . revert-buffer-with-coding-system) (102 . set-buffer-file-coding-system)) set-goal-column delete-blank-lines mark-page read-onl&#xA;(67108896 . pop-global-mark)&#xA;&#xA;(C-left . previous-buffer)&#xA;&#xA;(left . previous-buffer)&#xA;&#xA;(C-right . next-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expected Ctl-x-map to be a plain map with key sequence as key and function name as value &lt;code&gt;(ex - (C-left . previous-buffer))&lt;/code&gt;. But the second &amp;amp; third entry that begins with &lt;code&gt;#^^[&lt;/code&gt; proves it to be wrong. Is ctl-x-map variable, some sort of map within a map ?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2015-05-20T05:20:00.363" LastActivityDate="2015-05-20T05:20:00.363" Title="ctl-x-map key map has entries of different kind" Tags="|elisp|key-bindings|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9745" PostTypeId="2" ParentId="9654" CreationDate="2015-03-02T17:27:30.443" Score="0" Body="&lt;p&gt;Forgot to check &lt;code&gt;*Warnings*&lt;/code&gt;. A totally unrelated change in my &lt;code&gt;.emacs&lt;/code&gt; was causing it to not load correctly, meaning the bindings were never set.&lt;/p&gt;&#xA;" OwnerUserId="2804" LastActivityDate="2015-03-02T17:27:30.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9746" PostTypeId="2" ParentId="9744" CreationDate="2015-03-02T17:36:53.630" Score="3" Body="&lt;p&gt;It is a full keymap, not a sparse keymap.  That is, it has an entry that is a char-table. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Format-of-Keymaps.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Format of Keymaps&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says this about a char-table entry (emphasis added):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;char-table&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If an element of a keymap is a char-table, it counts as holding bindings for all character events with no modifier bits (see modifier bits): &lt;strong&gt;&lt;em&gt;element n is the binding for the character with code n&lt;/em&gt;&lt;/strong&gt;. This is a compact way to record lots of bindings. A keymap with such a char-table is called a full keymap. Other keymaps are called sparse keymaps.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-02T18:09:04.070" LastActivityDate="2015-03-02T18:09:04.070" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9747" PostTypeId="1" AcceptedAnswerId="9748" CreationDate="2015-03-02T19:01:52.023" Score="12" ViewCount="1759" Body="&lt;p&gt;I have &lt;code&gt;global-hl-line-mode&lt;/code&gt; setup in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package hl-line&#xA;  :init (global-hl-line-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to disable it when I am in &lt;code&gt;eshell&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt;?&#xA;I tried adding a hook like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'eshell-mode-hook (hl-line-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it didn't work.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="105" LastEditDate="2016-12-22T17:28:40.633" LastActivityDate="2016-12-22T17:28:40.633" Title="Disable hl-line-mode only for eshell and ansi-term" Tags="|hooks|minor-mode|hl-line-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9748" PostTypeId="2" ParentId="9747" CreationDate="2015-03-02T19:16:28.500" Score="12" Body="&lt;p&gt;&lt;code&gt;global-hl-line-mode&lt;/code&gt; sets variable &lt;code&gt;global-hl-line-mode&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.  The global mode is separate from the non-global (&lt;code&gt;hl-line-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following will disable it in the selected mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'eshell-mode-hook (lambda ()&#xA;                                    (setq-local global-hl-line-mode&#xA;                                                nil)))&#xA;(add-hook 'term-mode-hook (lambda ()&#xA;                                    (setq-local global-hl-line-mode&#xA;                                                nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation indicates that setting it directly does not take effect, however when testing it it does remove the highlighting while in the &lt;code&gt;*Eshell*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2015-03-02T19:43:48.897" LastActivityDate="2015-03-02T19:43:48.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9749" PostTypeId="2" ParentId="9747" CreationDate="2015-03-02T19:33:53.390" Score="3" Body="&lt;p&gt;This works for &lt;code&gt;ansi-term&lt;/code&gt; if you're using emacs 24.3+:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'term-mode-hook (lambda ()&#xA;                            (setq-local global-hl-line-mode&#xA;                                        nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to Jonathan and glucas.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="2274" LastEditDate="2015-04-03T20:37:58.497" LastActivityDate="2015-04-03T20:37:58.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9750" PostTypeId="2" ParentId="9488" CreationDate="2015-03-02T20:39:49.250" Score="0" Body="&lt;p&gt;Do you have a line like this in your init file?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-language-environment &quot;Latin-1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If so, try removing it.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-02T20:39:49.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9751" PostTypeId="1" AcceptedAnswerId="9755" CreationDate="2015-03-02T22:08:37.417" Score="2" ViewCount="1373" Body="&lt;p&gt;To insert a new TODO in org-mode, I currently move my cursor to the end of the current line and use the &lt;code&gt;M-S-&amp;lt;RET&amp;gt;&lt;/code&gt; shortcut. If I am within a subtree, I also have to go to the end of the last tree item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if it is possible to create a shortcut which appends a new top-level TODO (i.e., a single *) below whatever subtree the cursor is in. Eliminating the cursor movements would be very helpful to me while brainstorming and quickly capturing thoughts.&lt;/p&gt;&#xA;" OwnerUserId="6650" LastActivityDate="2015-03-03T15:30:47.837" Title="How can I insert a new top level TODO below the current subtree in org-mode without moving the cursor?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9752" PostTypeId="2" ParentId="9751" CreationDate="2015-03-02T22:29:49.417" Score="-1" Body="&lt;p&gt;Here's a simple function to do something similar.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  (point-to-register 'p)&#xA;  (search-forward-regexp &quot;^\\* &quot;)&#xA;  (org-beginning-of-line)&#xA;  (insert &quot;*&#xA;&quot;)&#xA;  (register-to-point 'p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="2823" LastEditDate="2015-03-03T15:30:47.837" LastActivityDate="2015-03-03T15:30:47.837" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9753" PostTypeId="1" CreationDate="2015-03-02T22:36:39.193" Score="3" ViewCount="169" Body="&lt;p&gt;Extending &lt;a href=&quot;https://emacs.stackexchange.com/questions/3216/customizing-c-mode-indentation-behavior-in-emacs-24-4&quot;&gt;Customizing c-mode indentation behavior in emacs-24.4&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can electric indentation be disabled for other specific keys without disabling the entire mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, how can electric indentation be turned off for &lt;code&gt;/* */&lt;/code&gt; comments? Apparently disabling it for &lt;code&gt;*&lt;/code&gt; does not do the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following works only under some conditions. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c-mode-hook&#xA;          (lambda ()&#xA;            (set-key (kbd &quot;*&quot;) 'self-insert-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similarly, the following works only under some conditions&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c-mode-hook&#xA;         (lambda ()&#xA;           (setq electric-indent-chars&#xA;                       (remq &quot;*&quot; electric-indent-chars))))&#xA;&#xA;(add-hook 'c-mode-hook&#xA;         (lambda ()&#xA;           (setq electric-indent-chars&#xA;                       (remq &quot;*&quot; electric-indent-chars))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;?*&lt;/code&gt; and &lt;code&gt;?/&lt;/code&gt; also do not work)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;some conditions&quot;: comment lines following another commented line keep their non-electric indentation after typing &lt;code&gt;*&lt;/code&gt;, but a comment line immediately following a closing brace has its indentation reset upon typing the &lt;code&gt;*&lt;/code&gt; in &lt;code&gt;/*&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6652" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-03-25T20:41:30.497" Title="Turn C Electric Indentation off only for specific characters" Tags="|indentation|c|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9754" PostTypeId="2" ParentId="9633" CreationDate="2015-03-02T22:55:36.953" Score="2" Body="&lt;p&gt;I tried to develop Michael's suggestion, the result turned out to be a few pages of code, so I versioned it:   &lt;a href=&quot;https://bitbucket.org/Mekk/emacs_libs-theme-switcher/&quot; rel=&quot;nofollow&quot;&gt;https://bitbucket.org/Mekk/emacs_libs-theme-switcher/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions how to improve this code are welcome.&lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-03-02T22:55:36.953" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9755" PostTypeId="2" ParentId="9751" CreationDate="2015-03-02T23:58:36.833" Score="2" Body="&lt;p&gt;This function adds a new headline after the parent of the headline the cursor is on.  With a prefix argument, it adds the heading &lt;code&gt;arg&lt;/code&gt; levels up.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-insert-heading-after-parent (arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (save-excursion&#xA;    (outline-up-heading arg)&#xA;    (org-insert-heading-after-current)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-03-02T23:58:36.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9756" PostTypeId="2" ParentId="9692" CreationDate="2015-03-03T00:58:00.447" Score="4" Body="&lt;p&gt;This appears to be a bug with the interaction of some versions of emacs with some versions of gnutls:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/nicferrier/elmarmalade/issues/55#issuecomment-75377455&quot; rel=&quot;nofollow&quot;&gt;https://github.com/nicferrier/elmarmalade/issues/55#issuecomment-75377455&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6647" LastActivityDate="2015-03-03T00:58:00.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9757" PostTypeId="2" ParentId="9693" CreationDate="2015-03-03T01:21:38.150" Score="1" Body="&lt;p&gt;You need to specify the mode-map for which you want to modify the &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; binding:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-key &quot;&amp;lt;backspace&amp;gt;&quot; #'cua-delete-region markdown-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;What you were doing was overriding the binding in the global map. So you would see your custom binding effective only in the places where any other minor or major mode is NOT mapping the &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; key.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-03-03T01:21:38.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9758" PostTypeId="1" CreationDate="2015-03-03T04:05:16.770" Score="1" ViewCount="162" Body="&lt;p&gt;For the speech recognition mode for emacs I'm working on I'd like to have support for working with the shell. I have shell-mode working fine but I'd really like to get ansi-term working since some apps are only usable in it, and completion and history work so much better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is that all of my custom speech commands for editing text expect they can operate on the buffer directly, while ansi-term only listens to keyboard events. If I use a speech command (which sends commands with &lt;code&gt;emacsclient -e&lt;/code&gt;) to run &lt;code&gt;(insert &quot;echo hello&quot;)&lt;/code&gt; the text gets inserted into the ansi-term buffer, but then when I press enter &quot;hello&quot; is &lt;em&gt;not&lt;/em&gt; echo'd because the underlying shell didn't get any keyboard events. Likewise if I use some voice navigation commands and then press a key, the text &lt;em&gt;looks&lt;/em&gt; like it's inserted in the right place but when I hit enter I can see from the errors that the shell thinks the keypress inserted text wherever the cursor was before -- the emacs point and the shell cursor are out of sync.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only solution I see is to track where the shell thinks the cursor is, and whenever I do an editing action to emulate a series of keypresses to move the cursor there, and likewise simulate keypresses for inserting text. This approach could also work for tab completion. I see this as being pretty laborious and error prone though. Is there a better way? Or a package that already tackles this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I forgot that I'd tried line mode before and run into other problems. In line mode completion doesn't work and nothing is read only so you can wreck the prompt and previous output. If there were solutions for each of those it could work.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2015-03-03T04:26:31.777" LastActivityDate="2015-05-02T05:56:08.760" Title="Translating editing actions to keypresses for ansi-term?" Tags="|emacsclient|shell|ansi-term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9759" PostTypeId="2" ParentId="9758" CreationDate="2015-03-03T04:13:51.247" Score="1" Body="&lt;pre&gt;&lt;code&gt;(insert &quot;echo hello&quot;)&#xA;(term-send-input)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;suspect&lt;/em&gt; you'll want to use &lt;code&gt;term-line-mode&lt;/code&gt; rather than the default &lt;code&gt;term-char-mode&lt;/code&gt; to avoid issues with your other editing commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;YMMV. I mostly use char mode so that things behave like they would in a normal terminal, and only switch to line mode to do Emacsy things; but in your use-case you might find it easier the other way around?&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-03-03T04:20:00.730" LastActivityDate="2015-03-03T04:20:00.730" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9760" PostTypeId="1" AcceptedAnswerId="9830" CreationDate="2015-03-03T08:09:12.840" Score="1" ViewCount="735" Body="&lt;p&gt;I've read several answers on here and on Google and have tried several solutions but nothing is fixing this for me.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, if I try to write C code Emacs indents it like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;&#xA;    int main()&#xA;    {&#xA;    printf(&quot;Hello&quot;);&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would think main() should really be on the same indentation level as #include.  Also, I would think the printf() line should be indented further in than the curly braces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The suggestions I've found here and elsewhere say to put this in my .emacs file, which I did:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;C configuration&#xA;(require 'cc-mode)&#xA;(setq-default c-basic-offset 4)&#xA;(setq c-default-style (cons '(c-mode . &quot;java&quot;) c-default-style))&#xA;(setq-default tab-width 4 indent-tabs-mode t)&#xA;(define-key c-mode-base-map (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;(add-hook 'c-mode-hook&#xA;       (lambda ()&#xA;         (setq-local electric-indent-chars&#xA;                     (remq ?\n electric-indent-chars))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sorry for being such a newb.  Can you help point me in the right direction as to why this is going wrong?&lt;/p&gt;&#xA;" OwnerUserId="5218" LastEditorUserId="5218" LastEditDate="2015-03-05T01:21:11.377" LastActivityDate="2015-03-05T01:23:30.453" Title="How to indent C correctly" Tags="|indentation|c|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9761" PostTypeId="1" AcceptedAnswerId="9779" CreationDate="2015-03-03T09:05:49.530" Score="3" ViewCount="429" Body="&lt;p&gt;Many times, i use commands like &lt;code&gt;M-x what-face&lt;/code&gt; to get the font face for character under cursor, (or) &lt;code&gt;M-x find-function-on-key&lt;/code&gt; to get the key bindings for a key sequence. These functions work on the main frame/buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, how to get the properties for minibuffer's face font (or) may be, key bindings for key inputs (or) &lt;code&gt;copy-region&lt;/code&gt; on minibuffer itself?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2015-05-14T00:30:21.507" LastActivityDate="2015-05-14T00:30:21.507" Title="Minibuffer function bindings" Tags="|key-bindings|minibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9762" PostTypeId="1" CreationDate="2015-03-03T09:29:34.940" Score="5" ViewCount="218" Body="&lt;p&gt;Is it possible to have separate theme for every emacs frame (for new, emacs 24, themes)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For old themes, there was color-theme-is-global, but I can't find anything similar for new themes...&lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-06-01T17:30:37.173" Title="Limiting theme to frame (for emacs 24 themes)?" Tags="|frames|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9764" PostTypeId="1" AcceptedAnswerId="9765" CreationDate="2015-03-03T10:31:17.380" Score="7" ViewCount="242" Body="&lt;p&gt;&lt;em&gt;That's meta-ish question but google isn't helpful in this case.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any standardized habits of where/how/whether one should look for feedback on his (or her) new emacs package? Especially - before publishing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My particular case is that I started extracting and packaging longer and possibly reusable parts of my .emacs (first item is &lt;a href=&quot;https://bitbucket.org/Mekk/emacs_libs-theme-switcher&quot;&gt;theme-switcher&lt;/a&gt;, but I have a few further ideas). As it is possible that someone else would benefit from this code (and maybe offer improvements), I consider publishing it to melpa. Still, my elisp knowledge is, well, very basic, so I hesitate offering my package without any screening – and unfortunately I have no colleagues who know elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a place where one could post &lt;em&gt;here is my package, could you review it&lt;/em&gt; question?  Is this stackexchange right place? Or mayhaps some newsgroup or email list?&lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-03-04T16:41:06.070" Title="Looking for feedback/review of emacs package?" Tags="|elisp|package-development|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9765" PostTypeId="2" ParentId="9764" CreationDate="2015-03-03T11:08:54.573" Score="6" Body="&lt;p&gt;I believe this is a great question considering elisp seems to be a language that's geared to be easy to learn, yet not a language many people manage to master (as in, learning how to do anything in it the best/most appropriate way possible).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can ask for feedback on specific issues on the &lt;code&gt;#emacs&lt;/code&gt; IRC channel on the &lt;a href=&quot;http://freenode.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Freenode&lt;/a&gt; network.  Perhaps the chats on this Stackexchange might work out as well, I've seen a bunch of specific ones where people interact on topics like starter kits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no such thing as an official place where you can get proper reviews.  &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00808.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;A question&lt;/a&gt; on the &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-devel&lt;/a&gt; mailing list was about ways to make it a nicer place for newcomers which also involved reviews of packages that might be desirable in the GNU ELPA package repository.  There's also other reviews happening on it, such as for basic patches.  Here's &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2015-02/msg00094.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;a different example&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side note, if you've found someone willing to review your code, &lt;a href=&quot;https://stackoverflow.com/questions/84556/whats-your-favorite-programmer-cartoon/84609#84609&quot;&gt;WTFs per minute&lt;/a&gt; should be a good indicator of its quality :)&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-03-03T11:08:54.573" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9766" PostTypeId="1" CreationDate="2015-03-03T11:17:17.647" Score="1" ViewCount="741" Body="&lt;p&gt;Are there any packages to extract text from html in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to try is to extract relevant text from &lt;code&gt;browse web&lt;/code&gt; so that I can read papers and articles without the visual clutter of links and similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command line scripts I can use through emacs would also be accepted even though I would prefer an emacs package.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2015-03-03T11:17:17.647" Title="Extracting text from html in emacs?" Tags="|html|web-browser|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9767" PostTypeId="1" AcceptedAnswerId="20692" CreationDate="2015-03-03T11:23:11.333" Score="5" ViewCount="415" Body="&lt;p&gt;RefTeX doesn't support Org &lt;code&gt;#+LABEL:&lt;/code&gt; syntax by default, but can it be customized to do so? For example, if I have &lt;code&gt;#+LABEL: foo&lt;/code&gt;, I'd like to be able to insert a reference to that label using RefTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been browsing the customize options, and it appears like it may be possible to set some preferences and gain better Org support. I've played around with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq reftex-try-all-extensions)&#xA;(setq reftex-file-extensions&#xA;       '((&quot;org&quot; &quot;nw&quot; &quot;tex&quot; &quot;.tex&quot; &quot;.ltx&quot;) (&quot;bib&quot; &quot;.bib&quot;)))&#xA;(setq TeX-file-extensions&#xA;       '( &quot;org&quot; &quot;nw&quot; &quot;tex&quot; &quot;sty&quot; &quot;cls&quot; &quot;ltx&quot; &quot;texi&quot; &quot;texinfo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then found &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq reftex-label-regexps &#xA;           '(&quot;\\\\label{\\(?1:[^}]*\\)}&quot;&#xA;             &quot;\\[[^]]*\\&amp;lt;label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To which I tried adding the regexp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\\#\\\+LABEL:\\(?1:*\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But have had no success. It seems like &lt;code&gt;reftex-label-alist&lt;/code&gt; may also be needed.&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="91" LastEditDate="2015-05-30T15:49:25.547" LastActivityDate="2016-05-31T16:48:17.470" Title="Can RefTeX be used with Org #+LABEL:?" Tags="|org-mode|reftex-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9768" PostTypeId="1" AcceptedAnswerId="9772" CreationDate="2015-03-03T11:36:25.040" Score="6" ViewCount="1309" Body="&lt;p&gt;What failed for me?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/others&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;what worked for me?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc 'load (file-expand-wildcards &quot;~/.emacs.d/others/*.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Functions defined in elisp files lying @&lt;code&gt;~/.emacs.d/others&lt;/code&gt; were not loaded in the first case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is it wrong to assume that adding folder paths to &lt;code&gt;load-path&lt;/code&gt; will load the *.el files lying underneath?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-03-03T16:26:34.970" LastActivityDate="2015-03-03T16:26:34.970" Title="Elisp files in load-path are not loaded on emacs start" Tags="|load-path|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9769" PostTypeId="2" ParentId="9764" CreationDate="2015-03-03T11:52:14.947" Score="2" Body="&lt;p&gt;This is just an idea (I've never seen it done), but you can push it to a Github repo, open an issue requesting feedback, and then &lt;a href=&quot;https://www.bountysource.com&quot; rel=&quot;nofollow&quot;&gt;post a bounty&lt;/a&gt; on the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do that, you'll want to be very descriptive of what you're looking for in your bounty and probably announce it somewhere like &lt;a href=&quot;https://www.reddit.com/r/emacs/&quot; rel=&quot;nofollow&quot;&gt;r/emacs&lt;/a&gt;, our chat room, and/or &lt;code&gt;#emacs&lt;/code&gt; IRC channel.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-03T11:52:14.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9770" PostTypeId="2" ParentId="7591" CreationDate="2015-03-03T12:37:17.920" Score="32" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;I would like to list the available tags in Magit ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Type &lt;kbd&gt;y&lt;/kbd&gt; to show a buffer which lists branches, remote branches, and, at the bottom, tags.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;...in order to diff a specific revision [reachable from that tag]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Move to the tag and press &lt;kbd&gt;l&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. That shows the log for that tag. Move to the commit and press &lt;kbd&gt;RET&lt;/kbd&gt;. That shows information about that commit, including the diff.&lt;/p&gt;&#xA;&lt;p&gt;You don't necessarily have to move to the tag first to show the log for it. You can also type &lt;kbd&gt;l&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;code&gt;&amp;lt;TAGNAME&amp;gt;&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="2506" LastEditDate="2021-11-01T16:45:02.317" LastActivityDate="2021-11-01T16:45:02.317" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="9771" PostTypeId="1" AcceptedAnswerId="9775" CreationDate="2015-03-03T13:20:51.720" Score="1" ViewCount="271" Body="&lt;p&gt;I want to write some functionality that fires whenever I shift-click a point in an emacs buffer.  Problem is that when shift is pressed, the point is not changing when clicking.  To make things more clear :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mouse-test()  (interactive)  (message (thing-at-point 'word)))&#xA;&#xA;(global-set-key [mouse-1] 'mouse-test)&#xA;(global-set-key [S-mouse-1] 'mouse-test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When clicking on a word, the word is displayed, when shift-clicking it's not.. &lt;/p&gt;&#xA;" OwnerUserId="6656" LastActivityDate="2015-03-03T14:51:45.853" Title="How to move point with mousepointer on shift-click in emacs" Tags="|mouse|point|events|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9772" PostTypeId="2" ParentId="9768" CreationDate="2015-03-03T13:33:15.060" Score="6" Body="&lt;p&gt;Adding to the &lt;a href=&quot;http://emacswiki.org/emacs/LoadPath&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;load-path&lt;/code&gt;&lt;/a&gt; does not actually load any files.  Instead, it only tells Emacs where to look for files when you ask it to load them.  As the docstring indicates:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;List of directories to search for files to load.&lt;/strong&gt;&#xA;  Each element is a string (directory name) or &lt;code&gt;nil&lt;/code&gt; (try default directory).&#xA;  Initialized based on EMACSLOADPATH environment variable, if any,&#xA;  otherwise to default specified by file &lt;code&gt;epaths.h&lt;/code&gt; when Emacs was built.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As the other comments indicate, there are various ways to load elisp libraries and packages once they're on the &lt;code&gt;load-path&lt;/code&gt;.  You can, for example, use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/Loading-Files.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;load&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/Autoload.html#Autoload&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;autoload&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;require&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-03-03T13:33:15.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9773" PostTypeId="1" AcceptedAnswerId="9774" CreationDate="2015-03-03T13:51:09.070" Score="11" ViewCount="719" Body="&lt;p&gt;For example in the definition of &lt;code&gt;-first&lt;/code&gt; we have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(--first (funcall pred it) list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Naturally the meaning of &quot;it&quot; is very hard to google or search in the manual.&lt;/p&gt;&#xA;" OwnerUserId="6657" LastEditorUserId="50" LastEditDate="2015-03-03T14:16:48.837" LastActivityDate="2015-03-03T15:00:59.187" Title="What's &quot;it&quot; for?" Tags="|elisp|dash.el|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9774" PostTypeId="2" ParentId="9773" CreationDate="2015-03-03T13:53:36.990" Score="10" Body="&lt;p&gt;Actually it's right there in the manual: &lt;a href=&quot;https://github.com/magnars/dash.el#anaphoric-functions&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magnars/dash.el#anaphoric-functions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update: inspecting and flattening macros&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you're using &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt;, starting with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; anaphoric version&#xA;(--map (* it it) '(1 2 3 4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the point before &lt;code&gt;(--map&lt;/code&gt;, you can press &lt;kbd&gt;xf&lt;/kbd&gt; to call &lt;code&gt;lispy-flatten&lt;/code&gt; and obtain:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; anaphoric version&#xA;(mapcar (lambda (it) (* it it)) (quote (1 2 3 4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's a bit more complex with this code, since dash is too eager to delegate and postpone:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(--reduce (max it acc) '(1 2 3 4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;kbd&gt;xfM&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((list-value (quote (1 2 3 4))))&#xA;  (if list-value (--reduce-from (max it acc)&#xA;                                (car list-value)&#xA;                                (cdr list-value))&#xA;    (let (acc it)&#xA;      (max it acc))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;kbd&gt;fjfxfM&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((list-value (quote (1 2 3 4))))&#xA;  (if list-value (let ((acc (car list-value)))&#xA;                   (--each (cdr list-value)&#xA;                     (setq acc (max it acc)))&#xA;                   acc)&#xA;    (let (acc it)&#xA;      (max it acc))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;kbd&gt;fjxfM&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((list-value (quote (1 2 3 4))))&#xA;  (if list-value (let ((acc (car list-value)))&#xA;                   (let ((list (cdr list-value))&#xA;                         (it-index 0))&#xA;                     (while list (let ((it (car list)))&#xA;                                   (setq acc (max it acc)))&#xA;                            (setq it-index (1+ it-index))&#xA;                            (!cdr list)))&#xA;                   acc)&#xA;    (let (acc it)&#xA;      (max it acc))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suffice to say, that &lt;code&gt;it&lt;/code&gt; is the implicit iterable var and &lt;code&gt;acc&lt;/code&gt; is&#xA;the implicit accumulator var.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At one point, I tried to add a short lambda patch to Emacs that would enable this notation,&#xA;which I think is simpler than anaphoric macros:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(map #(* % %) '(1 2 3 4))&#xA;(cl-reduce #(max %1 %2) '(1 2 3 4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it kind of went nowhere.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-03-03T15:00:59.187" LastActivityDate="2015-03-03T15:00:59.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9775" PostTypeId="2" ParentId="9771" CreationDate="2015-03-03T14:44:57.573" Score="1" Body="&lt;p&gt;You need to manually move the point in your function like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mouse-test (event)&#xA;  &quot;Move the point to the clicked position and message the thing at point.&quot;&#xA;  (interactive &quot;e&quot;)&#xA;  (let ((es (event-start event)))&#xA;    (select-window (posn-window es))&#xA;    (goto-char (posn-point es))&#xA;    (message (thing-at-point 'word))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;interactive&lt;/kbd&gt; to understand how the argument &lt;code&gt;event&lt;/code&gt; is given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also look at the function &lt;code&gt;event-start&lt;/code&gt; for documentation about what info you can retrieve from the event parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A function bound to mouse events will not move the point automatically, the function needs to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason your function works with &lt;code&gt;[mouse-1]&lt;/code&gt; is that you are actually running two functions but don't realize it. When you do a normal mouse click both the functions bound to &lt;code&gt;[down-mouse-1]&lt;/code&gt; and &lt;code&gt;[mouse-1]&lt;/code&gt; are run in that order. The default function bound to &lt;code&gt;[down-mouse-1]&lt;/code&gt; is &lt;code&gt;mouse-drag-region&lt;/code&gt; which sets the point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However doing a shift click (&lt;code&gt;[S-mouse-1]&lt;/code&gt;) does not run &lt;code&gt;[down-mouse-1]&lt;/code&gt; so it does not set the point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt; then click the mouse and you will see the docs that describe the behavior of &lt;code&gt;[down-mouse-1]&lt;/code&gt; and &lt;code&gt;[mouse-1]&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-03-03T14:51:45.853" LastActivityDate="2015-03-03T14:51:45.853" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9776" PostTypeId="2" ParentId="9762" CreationDate="2015-03-03T15:08:23.993" Score="1" Body="&lt;p&gt;There is a package called &lt;a href=&quot;https://github.com/vic/color-theme-buffer-local&quot; rel=&quot;nofollow&quot;&gt;Color Theme Buffer Local&lt;/a&gt;, but I've never used it and I'm not sure how stable it is. Maybe you can make it work for frames too.&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2015-03-03T15:08:23.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9777" PostTypeId="2" ParentId="7806" CreationDate="2015-03-03T15:16:52.640" Score="1" Body="&lt;p&gt;I am not sure whether this is exactly what you ask for, but...&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x monky-log&lt;/code&gt;, find appropriate changeset, click Enter &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(monky is a magit clone, fairly nice, give it a try if you haven't tried it)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x xhg-log&lt;/code&gt;, move to appropriate changeset, and press =&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(xhg is another sensible mercurial mode for emacs)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-x ahg-diff&lt;/code&gt; (will prompt for revisions and display diff in diff mode)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ahg is yet another mercurial module)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All those modules may have more functionality of a kind, I haven't really explored (while I heavily commit from emacs and frequently review recent logs, for deeper complicated history analysis I prefer hgview or TortoiseHg).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update (after reading comment)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will require some work to polish, but the effect need not be that far:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) In this &lt;em&gt;fancier log&lt;/em&gt; of monky, try tapping Tab, n, Tab, n, ... a few times. This should hide diffs and leave only file changes info. I suppose this is the summary buffer you want. So you only need to trick monky to open log in compacted view by default (advising sth. to set monky-hide-diffs variable to 't before this buffer is populated will likely help)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) xhg has xhg-ediff-file-at-rev, unfortunately not bound to anything. So harder part of the exercise is to extract current file name and revision from monky-commit buffer and call xhg-ediff-file-at-rev with those data (my first instinct would be to advise monky-refresh-commit-buffer to set some variable to current commit, but maybe extracting info from actual buffer would be simpler).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not a true solution, but ....&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="2404" LastEditDate="2015-03-03T17:38:57.270" LastActivityDate="2015-03-03T17:38:57.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9778" PostTypeId="2" ParentId="9764" CreationDate="2015-03-03T15:34:23.867" Score="3" Body="&lt;p&gt;Here's another suggestion: Post (a URL to) your library on mailing list &lt;code&gt;gnu-emacs-sources@gnu.org&lt;/code&gt;.  And you can even ask for feedback in your message.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-03T15:34:23.867" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9779" PostTypeId="2" ParentId="9761" CreationDate="2015-03-03T15:39:57.083" Score="1" Body="&lt;p&gt;For key bindings in minibuffer keymaps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Load library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/help-fns%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/a&gt; and use &lt;strong&gt;&lt;code&gt;C-h M-k&lt;/code&gt;&lt;/strong&gt; (command &lt;code&gt;describe-keymap&lt;/code&gt;). See &lt;a href=&quot;http://www.emacswiki.org/emacs/HelpPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Help Plus&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For faces and other information, you might need to consult the code that implements/uses them. But for faces you might make progress by using &lt;code&gt;M-x list-faces-display&lt;/code&gt; (or even &lt;code&gt;M-x customize-face&lt;/code&gt; followed by the input &lt;code&gt;minibuf TAB&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-03T15:39:57.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9780" PostTypeId="1" AcceptedAnswerId="9786" CreationDate="2015-03-03T15:40:46.820" Score="5" ViewCount="500" Body="&lt;p&gt;When I'm writing the docstring for a &lt;code&gt;defun&lt;/code&gt; or a &lt;code&gt;defvar&lt;/code&gt;, if hit&#xA;&lt;code&gt;M-q&lt;/code&gt; the paragraph always gets filled to 65 characters, regardless of&#xA;the value of&#xA;&lt;a href=&quot;http://doc.endlessparentheses.com/Var/fill-column&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;fill-column&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q.&lt;/strong&gt; How can I get &lt;code&gt;fill-paragraph&lt;/code&gt; to always respect the configured&#xA;  &lt;a href=&quot;http://doc.endlessparentheses.com/Var/fill-column&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;fill-column&lt;/code&gt;&lt;/a&gt;&#xA;  inside &lt;code&gt;emacs-lisp-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-03T17:12:18.423" Title="Changing fill-column of elisp docstrings" Tags="|fill-paragraph|emacs-lisp-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9781" PostTypeId="1" AcceptedAnswerId="9782" CreationDate="2015-03-03T15:41:10.203" Score="2" ViewCount="44" Body="&lt;p&gt;I am using smart-operator for Python programming, and I like to use it. However I have also found it annoying for inputting:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;regular expressions like &lt;code&gt;.*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;equals (&lt;code&gt;=&lt;/code&gt;) in an function.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would like to disable it by a prefix shortcut, is there any way to do this?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="5143" LastEditDate="2015-03-03T19:02:23.693" LastActivityDate="2015-03-03T19:02:23.693" Title="How to temporarily disable smart-operator?" Tags="|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9782" PostTypeId="2" ParentId="9781" CreationDate="2015-03-03T15:46:07.953" Score="3" Body="&lt;p&gt;You can always type characters literally by hitting &lt;code&gt;C-q&lt;/code&gt; first.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-q .&lt;/code&gt; will type a dot, wherever you are.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-q =&lt;/code&gt; will always insert a &lt;code&gt;=&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-03T15:46:07.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9783" PostTypeId="1" AcceptedAnswerId="9784" CreationDate="2015-03-03T15:52:44.377" Score="0" ViewCount="233" Body="&lt;p&gt;How can I get emacs to save the buffer automatically every time I switch to another buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This is similar to this question, where the buffer is &lt;a href=&quot;https://emacs.stackexchange.com/questions/265/how-to-auto-save-buffers-when-emacs-loses-focus&quot;&gt;saved automatically when Emacs loses focus&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-03-03T15:59:09.140" Title="Save file when switching buffers" Tags="|auto-save|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9784" PostTypeId="2" ParentId="9783" CreationDate="2015-03-03T15:59:09.140" Score="2" Body="&lt;p&gt;Here's what I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ora-save-and-switch-buffer ()&#xA;  (interactive)&#xA;  (when (and (buffer-file-name)&#xA;             (not (bound-and-true-p archive-subfile-mode)))&#xA;    (save-buffer))&#xA;  (ido-switch-buffer)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-03T15:59:09.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9785" PostTypeId="2" ParentId="9780" CreationDate="2015-03-03T16:27:14.607" Score="3" Body="&lt;p&gt;In emacs-lisp-mode the &lt;code&gt;fill-paragraph-function&lt;/code&gt; is set to &lt;code&gt;lisp-fill-paragraph&lt;/code&gt;. There is a separate fill column used specifically for docstrings, see&lt;code&gt;emacs-lisp-docstring-fill-column&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the variable documentation, you can set &lt;code&gt;emacs-lisp-docstring-fill-column&lt;/code&gt; to any non-integer value to make it use the current &lt;code&gt;fill-column&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-03-03T16:27:14.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9786" PostTypeId="2" ParentId="9780" CreationDate="2015-03-03T17:12:18.423" Score="7" Body="&lt;p&gt;Change &lt;code&gt;emacs-lisp-docstring-fill-column&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.  From the docstring (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Value of &lt;code&gt;fill-column&lt;/code&gt; to use when filling a docstring.&#xA;  &lt;strong&gt;Any non-integer value means do not use a different value of&#xA;  `fill-column' when filling docstrings.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Please don't do this, though.  There is a reason for this setting:  Emacs shows  docstrings &lt;em&gt;exactly&lt;/em&gt; like the appear in your code.  If you fill your docstrings at 80 characters, you force your readers to &lt;em&gt;read&lt;/em&gt; them filled at 80 characters.  Even those readers, who view docstrings on their 11 inch laptops in horizontally split buffers. And they have &lt;strong&gt;no&lt;/strong&gt; chance to change the filling in any way.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-03-03T17:12:18.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9787" PostTypeId="1" AcceptedAnswerId="9788" CreationDate="2015-03-03T17:27:47.610" Score="0" ViewCount="67" Body="&lt;p&gt;I am doing code study of org-mode. And in most places, &lt;code&gt;org-mode&lt;/code&gt; uses regexps defined in org.el. Like, &lt;code&gt;org-todo-line-regexp&lt;/code&gt;, &lt;code&gt;org-not-done-regexp&lt;/code&gt;,&lt;code&gt;org-deadline-regexp&lt;/code&gt;,&lt;code&gt;org-scheduled-regexp&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt; has lot more regexp variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What surprises me is that, most of these regexps are &lt;code&gt;defvar&lt;/code&gt;-ed with their start time values as &lt;code&gt;nil&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where to find the regex literals for these variables?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-03-03T17:42:08.887" Title="org-mode regexp variables, literals missing" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9788" PostTypeId="2" ParentId="9787" CreationDate="2015-03-03T17:42:08.887" Score="2" Body="&lt;p&gt;You should learn to use &lt;code&gt;rgrep&lt;/code&gt;.&#xA;It looks like regexps are set in &lt;code&gt;org-set-regexps-and-options&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-03T17:42:08.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9789" PostTypeId="1" AcceptedAnswerId="9790" CreationDate="2015-03-03T19:56:50.863" Score="1" ViewCount="164" Body="&lt;p&gt;I'm writing a screen-shot making function, something like org-screenshot.el &lt;a href=&quot;https://github.com/dfeich/org-screenshot/blob/master/org-screenshot.el&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; but with my own percs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a way to hide emacs while the screenshot is taking place and show it up again after. It is done in org-sceenshot.el in the link, but I can't figure out which command does it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="50" LastEditDate="2015-03-03T23:21:57.103" LastActivityDate="2015-03-03T23:21:57.103" Title="How to hide/show graphical emacs?" Tags="|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9790" PostTypeId="2" ParentId="9789" CreationDate="2015-03-03T19:59:39.803" Score="3" Body="&lt;p&gt;Never mind, I figured it out by reading the code more attentivley:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (make-frame-invisible)&#xA;  (call-process &quot;import&quot; nil nil nil myvar/img-Abs-Path)&#xA;  (make-frame-visible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-03-03T19:59:39.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9791" PostTypeId="2" ParentId="4138" CreationDate="2015-03-03T20:43:36.727" Score="3" Body="&lt;p&gt;The answer is that you can't use Emacs as a Feedly client, or at least not without regenerating a developer key every three months. I received the same information as the folks at &lt;a href=&quot;http://sourceforge.net/projects/feednix/&quot; rel=&quot;nofollow&quot;&gt;Feednix&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two possible alternate solutions, neither of which I've yet tested:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;a href=&quot;https://github.com/turbodog/rss2email&quot; rel=&quot;nofollow&quot;&gt;rss2email&lt;/a&gt; and have it send the articles from your list of RSS feeds to an email account on an IMAP mail server (thereby providing read/unread synchronising across devices and platforms). With this any old email client that supports IMAP becomes your feed reader. You'd need to export your Feedly OPML, convert it, then script parsing each feed. And you have to rely on cron or something similar for it to run..&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use a (self-)hosted &lt;a href=&quot;http://tt-rss.org/&quot; rel=&quot;nofollow&quot;&gt;Tiny Tiny RSS&lt;/a&gt; server to replace Feedly. You'll need feed reader apps that support tt-rss's APIs. There's apparently an Android client and an Emacs package.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Anyone got thoughts on these or other (possible) alternate solutions?&lt;/p&gt;&#xA;" OwnerUserId="2794" LastEditorDisplayName="user227" LastEditDate="2015-03-04T09:04:25.307" LastActivityDate="2015-03-04T09:04:25.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9792" PostTypeId="2" ParentId="9735" CreationDate="2015-03-03T21:09:36.967" Score="1" Body="&lt;p&gt;Here is a workaround using the &lt;a href=&quot;https://emacs.stackexchange.com/questions/9738/org-agenda-todo-effort-rollup&quot;&gt;%(expression) syntax&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-agenda-prefix ()&#xA;  (format &quot;%s&quot; (my-agenda-indent-string (org-current-level))))&#xA;&#xA;(defun my-agenda-indent-string (level)&#xA;  (if (= level 1)&#xA;      &quot;&quot;&#xA;    (let ((str &quot;&quot;))&#xA;      (while (&amp;gt; level 2)&#xA;        (setq level (1- level)&#xA;              str (concat str &quot;──&quot;)))&#xA;      (concat str &quot;►&quot;))))&#xA;&#xA;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;My TODOs&quot;&#xA;         ((tags-todo &quot;mytag&quot;&#xA;                     ((org-agenda-prefix-format &quot; %e %(my-agenda-prefix) &quot;)&#xA;                      (org-tags-match-list-sublevels t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not that there is a third bug or oddity here: you can only use %(expression) once, so any other customisations should be added to &lt;code&gt;my-agenda-prefix&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6647" LastActivityDate="2015-03-03T21:09:36.967" CommentCount="0" CommunityOwnedDate="2015-03-03T21:09:36.967" ContentLicense="CC BY-SA 3.0" />
  <row Id="9793" PostTypeId="2" ParentId="9738" CreationDate="2015-03-03T21:24:02.060" Score="6" Body="&lt;p&gt;It turns out that &lt;code&gt;%(expression)&lt;/code&gt; is not a function which is passed any arguments, but the &lt;code&gt;(point)&lt;/code&gt; is set to the current headline as it is processed, so you can write something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-prefix-format &quot; %e %(or (org-entry-get (point) &quot;Effort&quot;) &quot;0:00&quot;) &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and the reported effort should agree with &lt;code&gt;%e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;code&gt;org-entry-get&lt;/code&gt; does support searching &lt;strong&gt;&lt;em&gt;up&lt;/em&gt;&lt;/strong&gt; the hierarchy if the property is not set on the current item, but what's required is gathering &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; the properties &lt;strong&gt;&lt;em&gt;down&lt;/em&gt;&lt;/strong&gt; the hierarchy, so we can sum up the effort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a first go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-entry-get-subtree (property)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (org-narrow-to-subtree)&#xA;      (goto-char (point-max))&#xA;      (save-match-data&#xA;        (cl-loop while (re-search-backward org-heading-regexp nil t)&#xA;                 collect (org-entry-get (point) property))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which can be used to sum the effort:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-effort-sum-current-item ()&#xA;  (org-minutes-to-hh:mm-string&#xA;    (cl-loop for minutes in (my-org-entry-get-subtree &quot;Effort&quot;)&#xA;             sum (org-hh:mm-string-to-minutes (or minutes &quot;0:00&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Problem: if you have a TODO with 3 sub-TODOs each with one hour of effort, and the you complete one sub-TODO, the sum remaining effort is 2 hours. But the above code includes the effort from the item in the DONE state, miss-stating 3 hours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We must match only the items in the subtree which are in the TODO state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-effort-sum-current-item-in-state (state)&#xA;  (org-minutes-to-hh:mm-string&#xA;    (cl-loop for minutes in (my-org-entry-subtree-in-state-get state &quot;Effort&quot;)&#xA;             sum (org-hh:mm-string-to-minutes (or minutes &quot;0:00&quot;)))))&#xA;&#xA;(defun my-org-entry-subtree-in-state-get (state property)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (org-narrow-to-subtree)&#xA;      (goto-char (point-max))&#xA;      (save-match-data&#xA;        (cl-loop while (re-search-backward org-heading-regexp nil t)&#xA;                 when (string-equal state (org-get-todo-state))&#xA;                 collect (org-entry-get (point) property))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add this to the &lt;code&gt;org-agenda-prefix-format&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;My TODOs&quot;&#xA;         ((tags-todo &quot;mytag&quot;&#xA;                     ((org-agenda-prefix-format &quot;[%(my-org-effort-sum-current-item-in-state &quot;TODO&quot;)] &quot;)&#xA;                      (org-tags-match-list-sublevels t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and you end up with something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Projects&#xA;[3:00] TODO Some Project Task&#xA;[1:00] TODO Sub-task A&#xA;[1:00] TODO Sub-task B&#xA;[1:00] TODO Sub-task C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(see &lt;a href=&quot;https://emacs.stackexchange.com/questions/9735/org-agenda-tags-todo-hierarchy-weirdness/9792&quot;&gt;this other question&lt;/a&gt; for how to get the sub-tasks to indent)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6647" LastEditorUserId="6647" LastEditDate="2015-03-04T16:46:13.070" LastActivityDate="2015-03-04T16:46:13.070" CommentCount="0" CommunityOwnedDate="2015-03-03T21:24:02.060" ContentLicense="CC BY-SA 3.0" />
  <row Id="9794" PostTypeId="1" CreationDate="2015-03-04T03:56:54.867" Score="0" ViewCount="551" Body="&lt;p&gt;I have been using Emacs 24 on Windows 7 for almost a year without any issues. But recently, kill-ring in my Emacs has stopped synchronizing with clipboard (actually whatever I copy from within Emacs is available in system's clipboard but not other way around). I've successfully used &lt;code&gt;Shift + insert&lt;/code&gt; to paste things off my clipboard all the time earlier but not any more :(. I've tried adding lines below to my Emacs init script.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq x-select-enable-clipboard t)&#xA;  (setq x-select-enable-primary nil)&#xA;  ;; Treat clipboard input as UTF-8 string first; compound text next, etc.&#xA;  (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it has not affect on the erroneous behaviour of synchronization between kill-ring and clipboard. Any help or suggestions or guidance to debug the issue would be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Notes&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I'm using &lt;code&gt;arsclip&lt;/code&gt; as clipboard manager.&lt;/li&gt;&#xA;&lt;li&gt;I'm running Windows 7 x64 and emacs-w64.&lt;/li&gt;&#xA;&lt;li&gt;I use conemu, I noticed that my clipboard is no synchronizing both ways.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6668" LastEditorUserId="2055" LastEditDate="2016-02-14T08:32:01.330" LastActivityDate="2016-02-14T08:32:01.330" Title="Kill ring not synchronizing with clipboard in Windows" Tags="|microsoft-windows|yank|kill-ring|clipboard|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9796" PostTypeId="2" ParentId="9703" CreationDate="2015-03-04T05:24:53.213" Score="4" Body="&lt;p&gt;Above feature is not supported by epresent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;epresent-mode&lt;/code&gt; &#xA;(derived from &lt;code&gt;org-mode&lt;/code&gt;) doesn't export org files to html (or) any other format. It just changes how your org document is displayed. Some parts of the document such as TODO tags and property drawers are hidden, bigger fonts are used, and only one slide at a time is displayed.`&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy: @tmalsburg -&lt;a href=&quot;https://github.com/eschulte/epresent/issues/6#issuecomment-77003286&quot; rel=&quot;nofollow&quot;&gt;git-talk&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="50" LastEditDate="2015-03-04T09:54:29.930" LastActivityDate="2015-03-04T09:54:29.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9797" PostTypeId="1" CreationDate="2015-03-04T05:41:35.197" Score="1" ViewCount="598" Body="&lt;p&gt;In org mode, previewing a particular latex fragment with &lt;code&gt;C-c C-x C-l&lt;/code&gt; renders incorrectly when using ImageMagick instead of the default dvipng.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rendering with dvipng works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8saxc.png&quot; alt=&quot;dvipng&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rendering with ImageMagick doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iRQhh.png&quot; alt=&quot;imagemagick&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elisp to use ImageMagick instead of dvipng:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq org-latex-create-formula-image-program 'imagemagick)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I need to use ImageMagick because the dvipng setting doesn't respect &lt;code&gt;org-latex-pdf-process&lt;/code&gt;, &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-preview.html#sec-3&quot; rel=&quot;nofollow noreferrer&quot;&gt;as documented here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 25.0.50.1 64bit linux&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ImageMagick 6.7.7&lt;/p&gt;&#xA;" OwnerUserId="6670" LastActivityDate="2015-03-04T05:41:35.197" Title="Latex fragment preview doesn't work with ImageMagick" Tags="|org-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9798" PostTypeId="1" AcceptedAnswerId="20289" CreationDate="2015-03-04T06:52:40.653" Score="1" ViewCount="292" Body="&lt;p&gt;&lt;code&gt;current-prefix-arg&lt;/code&gt;'s &#xA;help doc says, the variable can contain a list (or) number (or) minus symbol. I mostly set a number as the &lt;code&gt;prefix-arg&lt;/code&gt; by keypress, &lt;code&gt;C-[1-9]&lt;/code&gt;. &lt;code&gt;&#xA;&lt;/code&gt;&#xA;But how can i assign a list or string to &lt;code&gt;current-prefix-arg&lt;/code&gt;?&#xA;   I ask this, since &lt;code&gt;isearch-forward&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-forward (&amp;amp;optional regexp-p no-recursive-edit)&#xA;  (interactive &quot;P/np&quot;)&#xA;  (........))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;takes the search string through interactive key &quot;P&quot;  but i am having zero clue on how to set a string to this prefix-arg?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="50" LastEditDate="2015-03-04T09:29:46.830" LastActivityDate="2016-03-15T02:42:00.123" Title="how to assign a list or string to current-prefix-arg?" Tags="|isearch|prefix-argument|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9799" PostTypeId="1" CreationDate="2015-03-04T09:01:08.807" Score="0" ViewCount="179" Body="&lt;p&gt;The first &lt;code&gt;C-c C-c&lt;/code&gt; by default suggests to run LaTeX command, and the second suggests View. The latter, in its turn suggest me a command to run the viewer, and I always have to change the editor to &lt;code&gt;zathura&lt;/code&gt;. I’d want to make emacs stop asking and do &lt;code&gt;LaTeX&lt;/code&gt; whenever I press &lt;code&gt;C-c C-c&lt;/code&gt; and run &lt;code&gt;View&lt;/code&gt; whenever I pass &lt;code&gt;C-c C-v&lt;/code&gt;, since it doesn’t seem to do anything to me right now. Also I’d want to set up the default command for running the viewer, but I couldn’t find it. The &lt;code&gt;LaTeX&lt;/code&gt; and the &lt;code&gt;View&lt;/code&gt; commands are set in AUCTeX group under ‘Tex Command List’, and when we go down to the description of the &lt;code&gt;View&lt;/code&gt; command we see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Name: View&#xA;        Command: %V&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Oh wow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expansion of &lt;code&gt;%V&lt;/code&gt; is defined below Tex Command List, under Tex Expand List, and here we see…&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Key: %V&#xA;            Expander: &#xA;(lambda nil&#xA;  (TeX-source-correlate-start-server-maybe)&#xA;  (TeX-view-command-raw))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-function RET TeX-view-command-raw&lt;/code&gt; says &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TeX-view-command-raw is a compiled Lisp function in `tex.el'.&#xA;(TeX-view-command-raw)&#xA;Choose a viewer and return its unexpanded command string.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I have to somehow replace it with the actual command I want, a-and… How do I actually do that? Excuse me, I am aware of that that’s being very silly of me trying to do something with Emacs without a firm grasp of elisp, but how do I do that? Why isn’t there a filed for a command like Latex Command has?&lt;/p&gt;&#xA;" OwnerUserId="6672" LastActivityDate="2015-03-04T09:01:08.807" Title="Change the editor in the View command called by TeX-command-master" Tags="|auctex|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9800" PostTypeId="1" AcceptedAnswerId="9802" CreationDate="2015-03-04T09:19:18.593" Score="8" ViewCount="560" Body="&lt;p&gt;Currently, I have this code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defalias 'hydra-set-transient-map&#xA;    (if (fboundp 'set-transient-map)&#xA;        'set-transient-map&#xA;      (lambda (map keep-pred &amp;amp;optional on-exit)&#xA;        (set-temporary-overlay-map map (hydra--pred on-exit)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It uses the newer &lt;code&gt;set-transient-map&lt;/code&gt; that obsoletes &lt;code&gt;set-temporary-overlay-map&lt;/code&gt; when it's&#xA;available, however I still want the package to work for Emacs versions that don't have&#xA;&lt;code&gt;set-transient-map&lt;/code&gt;. And I'm getting this warning when byte compiling:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;set-temporary-overlay-map is an obsolete function (as of 24.4);&#xA;  use set-transient-map instead.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What's the proper procedure to avoid the warning in this case, without&#xA;ignoring a whole class of warnings?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-04T10:08:21.480" Title="How to avoid obsolete warning when defining a compatibility alias?" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9802" PostTypeId="2" ParentId="9800" CreationDate="2015-03-04T10:08:21.480" Score="7" Body="&lt;p&gt;Wrap your obsolete code with a &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/with-no-warnings&quot;&gt;&lt;code&gt;with-no-warnings&lt;/code&gt;&lt;/a&gt; form. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'hydra-set-transient-map&#xA;  (if (fboundp 'set-transient-map)&#xA;      'set-transient-map&#xA;    (with-no-warnings&#xA;      (lambda (map keep-pred &amp;amp;optional on-exit)&#xA;        (set-temporary-overlay-map map (hydra--pred on-exit))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(with-no-warnings &amp;amp;rest BODY)&lt;br&gt;&#xA;  Like &lt;code&gt;progn&lt;/code&gt;, but prevents compiler warnings in the body. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-04T10:08:21.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9803" PostTypeId="1" CreationDate="2015-03-04T11:19:16.443" Score="3" ViewCount="345" Body="&lt;p&gt;There is a built-in org-mode shortcut where a &lt;code&gt;t&lt;/code&gt; character followed by &lt;code&gt;TAB&lt;/code&gt; key results in an auto-complete function that produces the &lt;code&gt;# TODO:&lt;/code&gt; string literal. How can I disable this? Even better, how can I look up the function/key-binding that is called when this org-mode shortcut occurs so I can disable similar auto-complete functions from getting called?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of the &lt;code&gt;C-h k&lt;/code&gt; and &lt;code&gt;C-h f&lt;/code&gt; commands, but this is not a normal key-binding and I don't know what the function is called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to disable this shortcut because I find it annoying, especially when tabbing through org-mode tables.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="50" LastEditDate="2015-03-04T15:03:02.540" LastActivityDate="2015-03-04T15:03:02.540" Title="Org-mode: Disable `t` + `TAB` =&gt; `# TODO: ` autocomplete feature" Tags="|org-mode|key-bindings|yasnippet|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9804" PostTypeId="1" AcceptedAnswerId="9827" CreationDate="2015-03-04T11:36:27.357" Score="7" ViewCount="379" Body="&lt;p&gt;&lt;strong&gt;Two related questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is it possible to use opacity while theming in emacs? I mean defining theme which - for example - would add 25% of blue to the background color of elements it is applied to. Or which would make font 30% lighter. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Or, if not.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Is it possible to dynamically recalculate some theme properties whenever main custom theme changes?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such a thing would be great for various „add-some-mark” modes. One case I mean specifically is flycheck-error face, which would be less invasive if it gave  background slight red accent instead of underlining text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But my main case is crosshairs mode (which combines highlighting current row and current column). I configured it to use background slightly different than default, and that created nice subtle indication of cursor location. But once I started switching themes more often, it turned out to be nuisance, as proper color depends on current background.&lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-03-04T23:02:48.707" Title="Theme background with opacity? Or theme callback?" Tags="|themes|colors|overlays|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9805" PostTypeId="2" ParentId="9803" CreationDate="2015-03-04T11:49:35.603" Score="2" Body="&lt;pre&gt;&lt;code&gt;M-x find-function-on-key  RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then, &lt;code&gt;TAB&lt;/code&gt; keypress will take you to the function that plays spoilsport in org-mode.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-03-04T11:49:35.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9806" PostTypeId="2" ParentId="9803" CreationDate="2015-03-04T13:48:54.283" Score="6" Body="&lt;p&gt;It's a snippet, activated with &lt;code&gt;yasnippet&lt;/code&gt;. Notice how it starts with a comment character, this hinted to me that it wasn't an &lt;code&gt;org-mode&lt;/code&gt; feature. Why would &lt;code&gt;org-mode&lt;/code&gt; comment out a todo? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have something similar that I got from &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot;&gt;this&lt;/a&gt; snippet repository, but it only works in modes derived from &lt;code&gt;prog-mode&lt;/code&gt; (which excludes &lt;code&gt;org-mode&lt;/code&gt;). However, the snippets directory is actually a git submodule, and if you inspect &lt;em&gt;that&lt;/em&gt; repository, you find a commit called &quot;Split text snippets into prog and fundamental&quot;. The commit message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;None of the text-mode snippets were actually specific to text-mode;&#xA;  fixme, todo, and xxx were for making comments, those were moved to&#xA;  prog-mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it seems like you're using an old version of that submodule repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To change this, either delete the snippet file (simply named &quot;todo&quot;), or change the key that activates it.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-03-04T13:48:54.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9807" PostTypeId="1" CreationDate="2015-03-04T13:51:16.550" Score="5" ViewCount="918" Body="&lt;p&gt;How can I prevent Org from exporting &lt;code&gt;[[/][site root]]&lt;/code&gt; as &lt;code&gt;&amp;lt;a href=&quot;file:///&quot;&amp;gt;site root&amp;lt;/a&amp;gt;&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2019-12-19T13:27:05.350" Title="Org-mode don't change relative URLs" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9808" PostTypeId="1" AcceptedAnswerId="9816" CreationDate="2015-03-04T15:05:22.170" Score="4" ViewCount="2488" Body="&lt;p&gt;One of my key bindings is not working on one particular machine and I don't understand why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Ubuntu 14.04, with the &lt;code&gt;emacs24&lt;/code&gt; package version &lt;code&gt;24.3+1-2ubuntu1&lt;/code&gt;, I start &lt;code&gt;emacs -Q&lt;/code&gt; (under X) and run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [(meta backspace)] 'undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;H&lt;/kbd&gt;, &lt;kbd&gt;c&lt;/kbd&gt;, &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;BackSpace&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On machine 1, I see as expected that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;M-backspace&amp;gt; runs the command undo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On machine 2, I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-DEL (translated from &amp;lt;M-backspace&amp;gt;) runs the command backward-kill-word&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The machines are running the same distribution and should be configured pretty much identically. The Emacs packages are the same, yet they react differently even under &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a bit of investigation, it turns out that the culprit is &lt;code&gt;input-decode-map&lt;/code&gt;, which on machine 2 contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(keymap&#xA; (27 keymap&#xA;     (C-backspace .&#xA;          [27 C-delete])&#xA;     (C-delete .&#xA;           [27 C-backspace]))&#xA; (C-M-backspace .&#xA;        [C-M-delete])&#xA; (C-M-delete .&#xA;         [C-M-backspace])&#xA; (M-backspace .&#xA;          [M-delete])&#xA; (M-delete .&#xA;       [M-backspace]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On machine 1, the keymap contains the same keys, but they're all bound to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Why does &lt;code&gt;input-decode-map&lt;/code&gt; exchange &lt;kbd&gt;BackSpace&lt;/kbd&gt; and &lt;kbd&gt;Delete&lt;/kbd&gt; on machine 2?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;How do I fix this? I can obviously remove the entries, but there may be terminals where it's warranted; how do I change &lt;code&gt;input-decode-map&lt;/code&gt; on X11 only (keeping in mind that I do sometimes open terminal and X11 frames in the same instance, so testing &lt;code&gt;window-system&lt;/code&gt; in &lt;code&gt;.emacs&lt;/code&gt; isn't good enough)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-03-04T16:12:41.477" Title="Why does Emacs swap Backspace and Delete on this one machine?" Tags="|key-bindings|linux|x11|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9809" PostTypeId="2" ParentId="9764" CreationDate="2015-03-04T15:11:41.447" Score="3" Body="&lt;p&gt;You might also get some useful feedback by creating a page on Emacs Wiki about your package (and explicitly encouraging feedback!). You can also post the code itself to the wiki, in its Elisp Area. I, for one, have received lots of useful feedback for code I've posted to the wiki.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-04T15:11:41.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9810" PostTypeId="1" AcceptedAnswerId="9812" CreationDate="2015-03-04T15:23:04.947" Score="2" ViewCount="358" Body="&lt;p&gt;There is a very convenient function &lt;kbd&gt;M-@&lt;/kbd&gt; Mark-word. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I usually find my self typing things, than marking things backwards to copy it some place else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something equivalent for mark-word-backwards or would I have to write a script to manually mark and go backwards? If so, is there a recommended key sequence to map this to?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-03-04T15:33:15.317" Title="Can you mark-word backwards?" Tags="|text-editing|mark|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9811" PostTypeId="2" ParentId="9808" CreationDate="2015-03-04T15:24:18.960" Score="-1" Body="&lt;p&gt;When you see &lt;kbd&gt;DEL&lt;/kbd&gt; in Emacs-land, it doesn't mean the &lt;kbd&gt;Delete&lt;/kbd&gt; key, it means the backspace control character (so it's [almost] synonymous with backspace).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the doc string of &lt;code&gt;(edmacro-mode)&lt;/code&gt; (which defines the keys that &lt;code&gt;kbd&lt;/code&gt; uses):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;The special words RET, SPC, TAB, DEL, LFD, ESC, and NUL represent&#xA;  special control characters.  The words must be written in uppercase.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;A word in angle brackets, e.g., , , or , represents&#xA;  a function key.  (Note that in the standard configuration, the&#xA;  function key  and the control key RET are synonymous.)&#xA;  You can use angle brackets on the words RET, SPC, etc., but they&#xA;  are not required there.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So Emacs is not swapping anything, you're just confused because it's key naming scheme is a bit odd. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;backward-kill-word&lt;/code&gt; is the default binding for &lt;kbd&gt;M-DEL&lt;/kbd&gt;. So, while I'm not exactly sure why your specific &lt;code&gt;global-set-key&lt;/code&gt; isn't working on one machine (could be a weird keyboard or keyboard layout), I would bet that the following does:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-DEL&quot;) 'undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If not, try using &lt;code&gt;(kbd &quot;M-&amp;lt;backspace&amp;gt;&quot;)&lt;/code&gt;. In general, using &lt;code&gt;kbd&lt;/code&gt; is almost always better than trying to figure out how to write the keys manually with the proper escapes, codes, etc. It's more readable and consistent.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-03-04T15:24:18.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9812" PostTypeId="2" ParentId="9810" CreationDate="2015-03-04T15:24:59.100" Score="5" Body="&lt;p&gt;Use a negative prefix argument to mark backwards, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M--&lt;/kbd&gt; &lt;kbd&gt;M-@&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can also mark a number of words forwards or backwards. For example, mark backwards four words:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M--&lt;/kbd&gt; &lt;kbd&gt;M-4&lt;/kbd&gt; &lt;kbd&gt;M-@&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that by default Emacs binds the prefix keys with a variety of modifiers. This makes it easier to specify a prefix when you are holding down some combination of modifiers for whatever command you are about to call. For example, I often use the following to mark a sexp backwards: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-M--&lt;/kbd&gt;&lt;kbd&gt;C-M-SPC&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-04T15:33:15.317" LastActivityDate="2015-03-04T15:33:15.317" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9813" PostTypeId="2" ParentId="3302" CreationDate="2015-03-04T15:35:21.087" Score="9" Body="&lt;p&gt;This works for me on Emacs 24.4.1 with OS X using the included &lt;code&gt;org-mode&lt;/code&gt; (note the use of redisplay vs. display).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shk-fix-inline-images ()&#xA;  (when org-inline-image-overlays&#xA;    (org-redisplay-inline-images)))&#xA;&#xA;(after-loading 'org&#xA;  (add-hook 'org-babel-after-execute-hook 'shk-fix-inline-images))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6676" LastEditorUserId="2710" LastEditDate="2015-03-04T17:33:56.153" LastActivityDate="2015-03-04T17:33:56.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9814" PostTypeId="2" ParentId="5954" CreationDate="2015-03-04T15:38:21.700" Score="5" Body="&lt;p&gt;To expand on Tarsius' answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;display-pixel-width&lt;/code&gt; and &lt;code&gt;display-pixel-height&lt;/code&gt; return the width and height respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;display-monitor-attributes-list&lt;/code&gt; will give you information on all the available monitors attached to the DISPLAY.  If you're dealing with a multi-monitor situation you'll probably need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(assq 'workarea (nth X (display-monitor-attributes-list)))  ;; X is the howmany-eth monitor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This gives you &lt;code&gt;(workarea X Y WIDTH HEIGHT)&lt;/code&gt; where &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; are the available space on the current monitor.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2015-03-04T20:59:49.937" LastActivityDate="2015-03-04T20:59:49.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9815" PostTypeId="1" AcceptedAnswerId="22014" CreationDate="2015-03-04T16:02:16.063" Score="17" ViewCount="2179" Body="&lt;p&gt;i am keen on using jira with &lt;code&gt;org-mode&lt;/code&gt; . &lt;a href=&quot;http://www.emacswiki.org/emacs/OrgJiraMode&quot;&gt;org-jira-mode&lt;/a&gt; looks like a potential candidate but i use &lt;code&gt;HTTP REST&lt;/code&gt; in most scenarios, and i don't want to break my head with &lt;code&gt;soap&lt;/code&gt; protocol for the sake of &lt;code&gt;org-jira-mode&lt;/code&gt;. &#xA;&lt;code&gt;&#xA;&lt;/code&gt;Is there any other jira plugin that does its talk through the  &lt;code&gt;rest&lt;/code&gt; protocol?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-03-04T16:08:03.777" LastActivityDate="2017-04-28T03:29:04.283" Title="org-mode with bug tracker jira" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9816" PostTypeId="2" ParentId="9808" CreationDate="2015-03-04T16:12:41.477" Score="4" Body="&lt;p&gt;It turns out that &lt;kbd&gt;Delete&lt;/kbd&gt; (&lt;code&gt;delete&lt;/code&gt;) is also translated to &lt;code&gt;DEL&lt;/code&gt; rather than &lt;code&gt;deletechar&lt;/code&gt;; this happens in &lt;code&gt;local-function-key-map&lt;/code&gt;, not in &lt;code&gt;input-decode-map&lt;/code&gt;, so I didn't notice it at first because my keybindings overrode that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual has a section &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/DEL-Does-Not-Delete.html#DEL-Does-Not-Delete&quot; rel=&quot;nofollow noreferrer&quot;&gt;“If &amp;lt;DEL&amp;gt; Fails to Delete”&lt;/a&gt;, which pointed me to &lt;code&gt;normal-erase-is-backspace&lt;/code&gt;, which is used when a frame is created in the function &lt;code&gt;normal-erase-is-backspace-setup-frame&lt;/code&gt; from &lt;code&gt;simple.el&lt;/code&gt; and &lt;code&gt;normal-erase-is-backspace&lt;/code&gt; has the value &lt;code&gt;maybe&lt;/code&gt; (that last is the case on both machines). For X11, this calls the native function &lt;code&gt;x-backspace-delete-keys-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Check if both Backspace and Delete keys are on the keyboard of FRAME.&#xA;  FRAME nil means use the selected frame.&lt;br&gt;&#xA;  Value is t if we know that both keys are present, and are mapped to the&#xA;  usual X keysyms.  Value is &lt;code&gt;lambda&lt;/code&gt; if we cannot determine if both keys are&#xA;  present and mapped to the usual X keysyms.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Looking at the C implementation, it uses XKB and tests whether the physical key &lt;code&gt;DELE&lt;/code&gt; sends the keysym &lt;code&gt;Delete&lt;/code&gt; and the physical key &lt;code&gt;BKSP&lt;/code&gt; sends the keysym &lt;code&gt;BackSpace&lt;/code&gt;. This is normally the case, but machine 2 is a laptop with cursor keys placed awkwardly, and I used xmodmap to shuffle a few keysyms around including &lt;code&gt;Delete&lt;/code&gt;. Thus on machine 2 &lt;code&gt;DELE&lt;/code&gt; doesn't send &lt;code&gt;Delete&lt;/code&gt;, so &lt;code&gt;x-backspace-delete-keys-p&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, so &lt;code&gt;normal-erase-is-backspace-setup-frame&lt;/code&gt; calls &lt;code&gt;normal-erase-is-backspace-mode&lt;/code&gt; with the argument 0, which causes this undesired remapping (&lt;code&gt;delete&lt;/code&gt; to &lt;code&gt;DEL&lt;/code&gt; in &lt;code&gt;local-function-key-map&lt;/code&gt;, &lt;code&gt;M-backspace&lt;/code&gt; to &lt;code&gt;M-delete&lt;/code&gt; in &lt;code&gt;input-decode-map&lt;/code&gt;, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One fix would be to use XKB rather than xmodmap to shuffle my cursor keys, and declare the physical keys &lt;code&gt;DELE&lt;/code&gt; and others as having different keycodes, rather than declare the keycodes to have different keysyms. See &lt;a href=&quot;https://unix.stackexchange.com/questions/188164/override-a-few-keycodes-with-xkb&quot;&gt;my follow-up question on Unix &amp;amp; Linux&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside Emacs, my blunt fix for now is to force &lt;code&gt;x-backspace-delete-keys-p&lt;/code&gt; to return &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (subrp (symbol-function 'x-backspace-delete-keys-p))&#xA;  (fset 'builtin-x-backspace-delete-keys-p&#xA;        (symbol-function 'x-backspace-delete-keys-p))&#xA;  (defun my-x-backspace-delete-keys-p ()&#xA;    t)&#xA;  (defalias 'x-backspace-delete-keys-p 'my-x-backspace-delete-keys-p)&#xA;  (if (eq window-system 'x)&#xA;      (mapc (lambda (frame)&#xA;              (when (frame-parameter frame 'display)&#xA;                (set-terminal-parameter frame 'normal-erase-is-backspace nil)&#xA;                (normal-erase-is-backspace-setup-frame frame)))&#xA;            (frame-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2015-03-04T16:12:41.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9818" PostTypeId="1" CreationDate="2015-03-04T17:18:53.950" Score="3" ViewCount="71" Body="&lt;p&gt;Currently, when you work with entries and clock things in/out, you can press:&#xA;&lt;code&gt;C-c C-x C-d&lt;/code&gt; to display totals of entries next to them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This uses the function org-clock-display: &lt;a href=&quot;https://github.com/yyr/org-mode/blob/master/lisp/org-clock.el#L1809&quot; rel=&quot;nofollow&quot;&gt;source code here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be nice to be able to see estimates as well, like:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* my task  ... 2:00 / 3:00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any ideas on whether it's possible to add something like an advice function or another function that does this already? &lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="50" LastEditDate="2015-03-04T22:30:11.973" LastActivityDate="2015-03-04T22:30:11.973" Title="Can org-clock-display be made show estimates also?" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9819" PostTypeId="1" AcceptedAnswerId="9822" CreationDate="2015-03-04T17:24:47.663" Score="7" ViewCount="388" Body="&lt;p&gt;I use &lt;code&gt;use-package&lt;/code&gt; to organize my &lt;code&gt;init.el&lt;/code&gt;. I noticed that all my declarations use &lt;code&gt;:ensure t&lt;/code&gt;. An example declaration is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package auto-complete&#xA;  :ensure t&#xA;  :diminish auto-complete-mode&#xA;  :init (global-auto-complete-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since all my &lt;code&gt;use-package&lt;/code&gt; declarations use &lt;code&gt;:ensure t&lt;/code&gt;, is there a way to modify &lt;code&gt;use-package&lt;/code&gt; to implicitly include &lt;code&gt;:ensure t&lt;/code&gt; without modifying use-package.el directly? Ideally I'd like not to use a differently-named function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a little bit familiar with &lt;code&gt;advice-add&lt;/code&gt;, but my impression is that this is used to add a hook or environment to a function, not to modify the function or macro itself.&lt;/p&gt;&#xA;" OwnerUserId="6677" LastEditorUserId="780" LastEditDate="2015-03-04T17:33:25.103" LastActivityDate="2016-01-04T04:22:22.540" Title="How can I modify a macro I call frequently?" Tags="|elisp-macros|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9820" PostTypeId="2" ParentId="8185" CreationDate="2015-03-04T17:30:15.090" Score="4" Body="&lt;p&gt;Since Emacs 23, you no longer need to care whether Emacs was started from inside X. Start Emacs however you like, possibly as a daemon. Open and close frames on any display as desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start Emacs with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then when you want to edit a file, run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient MYFILE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or if you just want to create a frame, run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will create an X11 frame if an X11 display is available, and a terminal frame otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you prefer to start Emacs with a frame on a terminal, make sure that your init file includes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(server-start)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;emacs&lt;/code&gt; normally. If you've started it outside X, you'll get a terminal frame. You can at any point call &lt;code&gt;emacsclient -c&lt;/code&gt; with the &lt;code&gt;DISPLAY&lt;/code&gt; environment set to open a GUI frame. Once a GUI frame exists, you can close the terminal frame. The Emacs process will still have the original terminal as its controlling terminal, but you can send it to the background (&lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Z&lt;/kbd&gt; then use the shell command &lt;code&gt;bg&lt;/code&gt;) and close the original terminal, and keep using the new GUI frame (and any other frame you care to create). What you can't do as far as I know is close the initial terminal frame but keep Emacs running in the background to open new frames later, i.e. you can't daemonize a running Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for some reason you want to run a new instance of Emacs and you want it to use an X11 display and refuse to start otherwise, you can do this with a shell command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -d &quot;$DISPLAY&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Explicitly passing the &lt;code&gt;-d&lt;/code&gt; option forces the use of an X11 display.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-03-04T17:30:15.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9821" PostTypeId="2" ParentId="9724" CreationDate="2015-03-04T18:00:17.040" Score="0" Body="&lt;p&gt;I use 'Workgroups' session manager (I don't like Frames). Its behaviour is very similar to GNUScreen/Tmux and you can save differents sessions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And with 'Bookmark Plus' you can access quickly to any session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/pashinin/workgroups2&quot; rel=&quot;nofollow&quot;&gt;https://github.com/pashinin/workgroups2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/BookmarkPlus&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6679" LastActivityDate="2015-03-04T18:00:17.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9822" PostTypeId="2" ParentId="9819" CreationDate="2015-03-04T19:38:20.173" Score="6" Body="&lt;p&gt;Based on @politza's comment that (of course!) advice works with macros, I found something that seems to work. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun use-package-always-ensure (form)&#xA;  (append form '(:ensure t)))&#xA;&#xA;(advice-add #'use-package :filter-args #'use-package-always-ensure)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note this example is using the Emacs 24.4 advice functions. I haven't figured out what the equivalent would be for older versions of Emacs. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-03-04T19:38:20.173" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9823" PostTypeId="1" CreationDate="2015-03-04T19:51:40.630" Score="15" ViewCount="2421" Body="&lt;p&gt;&lt;code&gt;company-ispell&lt;/code&gt; can &lt;em&gt;complete&lt;/em&gt; a word at point, but what if you want&#xA;to use Company to list the possible corrections for spelling?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an added bonus, is there any way to integrate this into Flyspell?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-06-28T13:46:31.813" Title="How can I use Company to spell-check a word?" Tags="|company-mode|ispell|spell-checking|flyspell|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9825" PostTypeId="1" AcceptedAnswerId="9829" CreationDate="2015-03-04T21:11:08.237" Score="2" ViewCount="473" Body="&lt;p&gt;I exclusively use frames and I've long wondered if there's a way to get &lt;code&gt;dired-dwim-target&lt;/code&gt; to suggest a dired buffer from another frame instead of just another window.&lt;/p&gt;&#xA;" OwnerUserId="265" LastActivityDate="2015-05-09T20:21:38.310" Title="dired-dwim-target for frames?" Tags="|dired|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9826" PostTypeId="1" AcceptedAnswerId="9859" CreationDate="2015-03-04T22:48:53.277" Score="18" ViewCount="1497" Body="&lt;p&gt;I want to force emacs to be activated, be bought to frond and 'steal' focus in certain circumstances. E.g when I finish a org-Pomodoro or during an important appointment reminder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I'm looking for a 'native' way to do so, just to reduce external dependencies.&#xA;(just Linux is ok for me, cross-platform would be better). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this technically possible from inside emacs?  &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;[edit] Solution:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If using the GUI, this works well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(x-focus-frame nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;[For historical reasons...] I have tried:&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;Frame visibility (doesn't work)&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-frame-visible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And also:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-frame-invisible)&#xA;(make-frame-visible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But these seem to only work if Emacs is already activated. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Frame raising (doesn't work)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Lowering frame seems to actually hide emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lower-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But raising the frame from a timer doesn't. I.e, nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(raise-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems there is a missing 'activate-emacs' before raising it.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;[NOTE on external solution]&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Currently, as a (workaround/solution?) I use a bit of elisp:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process &quot;activateEmacs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the respective bash script: (you may need to install xdotool on your system first)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh &#xA;sleep 0.5&#xA;xdotool search --onlyvisible --class emacs windowactivate&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="105" LastEditDate="2019-02-07T18:09:51.957" LastActivityDate="2019-02-07T18:09:51.957" Title="Can you activate/(bring to front) emacs using native elisp? (e.g when working in another program)" Tags="|frames|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9827" PostTypeId="2" ParentId="9804" CreationDate="2015-03-04T23:02:48.707" Score="2" Body="&lt;p&gt;I finally found more-or-less satisfactory solution myself. Still, not sure whether it is perfect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Library hexrgb.el provides nice functions to perform actual color calculations. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hexrgb-increment-green (face-background 'default) 2 20)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;calculates color which is a bit more green than current background (in params above, 2 is how many digits each color has and 20 is relative change). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Then I adviced load-theme (as I write this it struck me that this is not the  good place and some lower level API - enable-theme or sth even deeper - could be better) to change various attributes of hl-line and col-highlight faces after theme changed (I had to set actual color, but also to clear :inherit).&lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-03-04T23:02:48.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9828" PostTypeId="1" CreationDate="2015-03-04T23:16:53.200" Score="5" ViewCount="476" Body="&lt;p&gt;Is it possible to temporarily disable buffer (and frame) redraws? I particuarly mean situation, when I disable some theme and enable another one, and would like to avoid a moment when emacs flashes with white background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Illustration&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prepare, load any two dark themes in any way you like. For example eval the following snippet (I use twilight and molokai but any dark themes will do):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'twilight 't 't) &#xA;(load-theme 'molokai 't 't)&#xA;(enable-theme 'twilight)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then simulate actual problem: try eval-ing that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(disable-theme 'twilight)&#xA;(enable-theme 'molokai)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at least in my case Emacs redraws itself in white before picking new colors, what causes unpleasant screen flash. Before you ask: reversing the order (enabling new before disabling old) does not help, in fact it sometimes flashes twice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution???&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I look for tricks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((inhibit-something-to-keep-emacs-from-repainting))&#xA;   (disable-theme 'twilight)&#xA;   (enable-theme 'molokai))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or maybe for another way to reload themes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS inhibit-redisplay, whatever it is, does not seem to help.&lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-03-04T23:16:53.200" Title="Avoiding screen flickering when one theme is disabled and another enabled (inhibit redraw???)" Tags="|colors|inhibit|event-sequence|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9829" PostTypeId="2" ParentId="9825" CreationDate="2015-03-04T23:18:58.317" Score="2" Body="&lt;p&gt;Redefine &lt;code&gt;dired-dwim-target-directory&lt;/code&gt; so that in the call to &lt;code&gt;get-window-with-predicate&lt;/code&gt; it passes a non-nil value (e.g., &lt;code&gt;visible&lt;/code&gt;) for optional arg &lt;code&gt;ALL-FRAMES&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-dwim-target-directory ()&#xA;  ;; Try to guess which target directory the user may want.&#xA;  ;; If there is a dired buffer displayed in one of the next windows,&#xA;  ;; use its current subdir, else use current subdir of this dired buffer.&#xA;  (let ((this-dir (and (eq major-mode 'dired-mode)&#xA;               (dired-current-directory))))&#xA;    ;; non-dired buffer may want to profit from this function, e.g. vm-uudecode&#xA;    (if dired-dwim-target&#xA;    (let* ((other-win (get-window-with-predicate&#xA;                       (lambda (window)&#xA;                         (with-current-buffer (window-buffer window)&#xA;                           (eq major-mode 'dired-mode)))&#xA;                         nil&#xA;                         'visible)) ; &amp;lt;========================&#xA;           (other-dir (and other-win&#xA;                           (with-current-buffer (window-buffer other-win)&#xA;                             (and (eq major-mode 'dired-mode)&#xA;                                  (dired-current-directory))))))&#xA;      (or other-dir this-dir))&#xA;      this-dir)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And please consider filing an enhancement request (&lt;code&gt;M-x report-emacs-bug&lt;/code&gt;), suggesting, for example, that this argument be taken from the value of &lt;code&gt;pop-up-frames&lt;/code&gt; (or from a new user option or from something else). The idea is to let users decide whether the Dired buffer is to be in another window of the same frame or in any (visible) frame.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added this to &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/a&gt;), so it should work out-of-the-box.  It respects a new Boolean option, &lt;strong&gt;&lt;code&gt;diredp-dwim-any-frame-flag&lt;/code&gt;&lt;/strong&gt;: non-nil means look also in other frames.  The default value is the value of &lt;code&gt;pop-up-frames&lt;/code&gt; (so if that option is non-nil then so is &lt;code&gt;diredp-dwim-any-frame-flag&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:21:38.310" LastActivityDate="2015-05-09T20:21:38.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9830" PostTypeId="2" ParentId="9760" CreationDate="2015-03-05T01:23:30.453" Score="1" Body="&lt;p&gt;Thanks for the suggestions. I found the culprit. Per my previous question on here, in which I was trying to get Javadoc comment indentation to behave the way I wanted, I had these lines in .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-newline-and-indent-mode-hook ()&#xA;  (local-set-key (kbd &quot;RET&quot;) (key-binding (kbd &quot;M-j&quot;)))&#xA;  (local-set-key (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) #'electric-indent-just-newline)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I commented out the &lt;code&gt;(local-set-key (kbd &quot;RET&quot;) (key-binding (kbd &quot;M-j&quot;)))&lt;/code&gt; and then it quit being so weird writing C. I'll have to do more research later, though, to figure out how to enable that key binding just when I'm writing Java.&lt;/p&gt;&#xA;" OwnerUserId="5218" LastActivityDate="2015-03-05T01:23:30.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9831" PostTypeId="1" CreationDate="2015-03-05T01:49:20.603" Score="2" ViewCount="359" Body="&lt;p&gt;I'm on Linux and I've been trying to set up a reliable notification system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g I have a task like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO submit weekly report&#xA;  SCHEDULED: &amp;lt;2014-03-04 WED 16:30&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like a &lt;em&gt;reliable&lt;/em&gt; notification to appear at 16:30, preferably a lib-notify one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus far, I have read and tried:&lt;br&gt;&#xA;&lt;a href=&quot;http://article.gmane.org/gmane.emacs.orgmode/5806&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.emacs.orgmode/5806&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://article.gmane.org/gmane.emacs.orgmode/5271&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.emacs.orgmode/5271&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.emacswiki.org/emacs/ToDoChiKu&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/ToDoChiKu&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a little bit of success with ToDoChiKu, in the sense that I had a notification pop up on a scheduled event, but it didn't seem to come up for every scheduled event. e.g when I rescheduled a task a new reminder didn't pop up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a working notification system that they would be willing to share? (linux) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt;&lt;br&gt;&#xA;I got something semi-functioning going. I had wrong configs in my warning and interval timings and my hooks weren't working well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In all of the examples, the appt-time-msg-list was updated in different situations. For one guy when he saved his file, for another when he reloads (but not loads) the agenda etc.. &#xA;By merging all hooks, I made it more reliable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll test-drive my solution for a couple of days and if it works well I'll post in here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you have a working solution, please feel free to post.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-03-05T03:18:40.617" LastActivityDate="2015-03-05T03:18:40.617" Title="Appt desktop notification system for org-mode?" Tags="|org-mode|linux|" AnswerCount="0" CommentCount="1" ClosedDate="2015-03-05T12:35:09.790" ContentLicense="CC BY-SA 3.0" />
  <row Id="9832" PostTypeId="1" AcceptedAnswerId="9839" CreationDate="2015-03-05T03:20:41.393" Score="8" ViewCount="1761" Body="&lt;p&gt;When exporting to HTML, org-mode renders a code block in a very ugly way, I don't like that. I want to use &lt;a href=&quot;https://highlightjs.org/&quot; rel=&quot;noreferrer&quot;&gt;HighlightJs&lt;/a&gt; to highlight my exported code blocks. But, &lt;strong&gt;how do I tell org-mode to simply insert the content of the code block and wrap it around &lt;code&gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;&lt;/code&gt; tags when exporting to HTML?&lt;/strong&gt; adding the language name to &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; as a class would be great.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2017-07-18T23:56:59.933" Title="How to insert the content of a org-mode's code block inside &lt;pre&gt;&lt;code&gt; tags when exporting to HTML?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9833" PostTypeId="1" AcceptedAnswerId="9836" CreationDate="2015-03-05T06:53:07.473" Score="2" ViewCount="98" Body="&lt;p&gt;I am having trouble understanding why two apparently different overlay strings are &lt;code&gt;equal&lt;/code&gt;.  The following test results positive -- i.e., &lt;code&gt;t&lt;/code&gt;.  The colors are different and the &lt;code&gt;:data&lt;/code&gt; identification names are different -- i.e., the first name is &lt;code&gt;pilcrow_plain_xpm&lt;/code&gt;; whereas the second name is &lt;code&gt;pilcrow_active_region_xpm&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  Why are they &lt;code&gt;equal&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(equal&#xA;&#xA;  #(&quot; &quot; 0 1&#xA;    (display&#xA;      (image :type xpm :mask nil :ascent center :data&#xA;        &quot;/* XPM */&#xA;        static char * pilcrow_plain_xpm[] = {&#xA;        \&quot;11 20 4 1\&quot;,&#xA;        \&quot;. c #000000\&quot;,&#xA;        \&quot;+ c #555555\&quot;,&#xA;        \&quot;@ c #7F0000\&quot;,&#xA;        \&quot;% c yellow\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...++++++..\&quot;,&#xA;        \&quot;..++++.+...\&quot;,&#xA;        \&quot;..++++.+...\&quot;,&#xA;        \&quot;..++++.+...\&quot;,&#xA;        \&quot;...+++.+...\&quot;,&#xA;        \&quot;.....+.+...\&quot;,&#xA;        \&quot;.....+.+...\&quot;,&#xA;        \&quot;.....+.+...\&quot;,&#xA;        \&quot;.....+.+...\&quot;,&#xA;        \&quot;.....+.+...\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;,&#xA;        \&quot;...........\&quot;};&quot;)&#xA;           cursor t))&#xA;&#xA;  #(&quot; &quot; 0 1&#xA;    (display&#xA;      (image :type xpm :mask nil :ascent center :data&#xA;       &quot;/* XPM */&#xA;       static char * pilcrow_active_region_xpm[] = {&#xA;       \&quot;11 20 4 1\&quot;,&#xA;       \&quot;. c #3c3c3c\&quot;,&#xA;       \&quot;+ c #555555\&quot;,&#xA;       \&quot;@ c #7F0000\&quot;,&#xA;       \&quot;% c yellow\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..++++++..\&quot;,&#xA;       \&quot;%.++++.+...\&quot;,&#xA;       \&quot;%.++++.+...\&quot;,&#xA;       \&quot;%.++++.+...\&quot;,&#xA;       \&quot;%..+++.+...\&quot;,&#xA;       \&quot;%....+.+...\&quot;,&#xA;       \&quot;%....+.+...\&quot;,&#xA;       \&quot;%....+.+...\&quot;,&#xA;       \&quot;%....+.+...\&quot;,&#xA;       \&quot;%....+.+...\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;,&#xA;       \&quot;%..........\&quot;};&quot;)&#xA;          cursor t)) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-03-05T08:51:42.033" Title="Understanding why two apparently different overlay strings are `equal`" Tags="|overlays|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9834" PostTypeId="1" AcceptedAnswerId="17792" CreationDate="2015-03-05T06:59:19.990" Score="2" ViewCount="354" Body="&lt;p&gt;I'm using mu4e for email and I really like it.  The only time it annoys me is when I'm switching buffers and I want to see a list of suggested buffer names in the echo area / minibuffer, because mu4e insists on writing &lt;code&gt;[mu4e] Retrieving mail... /&lt;/code&gt; into the echo area.  In order to refresh the list of buffer names I must edit the now invisible text in the minibuffer, but it only flashes for a moment as it is again overwritten by mu4e's notification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like this notification when I don't use the minibuffer, so I don't want to disable it completely.  Is there a way to prevent it from appearing when I'm actively using the minibuffer?&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2023-11-27T16:47:28.057" Title="mu4e overwrites minibuffer output when switching buffers" Tags="|minibuffer|echo-area|mu4e|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9835" PostTypeId="1" AcceptedAnswerId="14512" CreationDate="2015-03-05T07:21:35.067" Score="11" ViewCount="2049" Body="&lt;p&gt;In org-mode, when I type some numbers, company always pops up the number completion like:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;20&lt;br&gt; 20001   -----------1&lt;br&gt;200111 ----------2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;These numbers come from my org-mode files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to turn off company number completion. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2274" LastEditDate="2015-08-06T22:46:11.177" LastActivityDate="2015-08-06T22:46:11.177" Title="How can I prevent company-mode completing numbers?" Tags="|completion|company-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9836" PostTypeId="2" ParentId="9833" CreationDate="2015-03-05T08:51:42.033" Score="8" Body="&lt;p&gt;&lt;code&gt;equal&lt;/code&gt; compares by string content and ignores text properties.  If you wish to include properties into your check, use &lt;code&gt;equal-including-properties&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-03-05T08:51:42.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9838" PostTypeId="2" ParentId="9832" CreationDate="2015-03-05T10:42:37.260" Score="4" Body="&lt;p&gt;Maybe something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rasmus/org-html-wrap-blocks-in-code (src backend info)&#xA;  &quot;Wrap a source block in &amp;lt;pre&amp;gt;&amp;lt;code class=\&quot;lang\&quot;&amp;gt;.&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&quot;&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (replace-regexp-in-string&#xA;     &quot;\\(&amp;lt;/pre&amp;gt;\\)&quot; &quot;&amp;lt;/code&amp;gt;\n\\1&quot;&#xA;     (replace-regexp-in-string &quot;&amp;lt;pre class=\&quot;src src-\\([^\&quot;]*?\\)\&quot;&amp;gt;&quot;&#xA;                               &quot;&amp;lt;pre&amp;gt;\n&amp;lt;code class=\&quot;\\1\&quot;&amp;gt;\n&quot; src))))&#xA;&#xA;(add-to-list 'org-export-filter-src-block-functions&#xA;             'rasmus/org-html-wrap-blocks-in-code)&#xA;&#xA;(setq org-html-htmlize-output-type nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2015-03-05T23:36:24.140" LastActivityDate="2015-03-05T23:36:24.140" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9839" PostTypeId="2" ParentId="9832" CreationDate="2015-03-05T12:27:30.493" Score="6" Body="&lt;p&gt;see &lt;a href=&quot;https://github.com/redguardtoo/org2nikola/blob/master/org2nikola.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/org2nikola/blob/master/org2nikola.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I simplify it a little bit. Now you just run &lt;code&gt;org2html-export-subtree&lt;/code&gt; anywhere at the first level node, the  content of the node will be output into a html file whose name is normalized from the node's title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or you just &lt;code&gt;C-c C-e&lt;/code&gt; which is handled by &lt;code&gt;org2html-wrap-blocks-in-code&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original code is borrowed from org2blog, it supports org7 and org8. It's pretty stable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the complete code. &lt;strong&gt;It's exactly designed for highlight.js&lt;/strong&gt;! I've been using it for many months. See &lt;a href=&quot;http://blog.binchen.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blog.binchen.org&lt;/a&gt; for samples.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org2html-trim-string (string)&#xA;  (replace-regexp-in-string &quot;\\`[ \t\n]*&quot; &quot;&quot; (replace-regexp-in-string &quot;[ \t\n]*\\'&quot; &quot;&quot; string)))&#xA;&#xA;(defun org2html--char-to-string (ch)&#xA;  (let ((chspc 32)&#xA;        (chsq 39)&#xA;        (ch0 48)&#xA;        (ch9 57)&#xA;        (cha 97)&#xA;        (chz 122)&#xA;        (chA 65)&#xA;        (chZ 90)&#xA;        (chdot 46)&#xA;        (chminus 45)&#xA;        (chunderscore 95)&#xA;        rlt)&#xA;    (cond&#xA;     ((or (and (&amp;lt;= ch0 ch) (&amp;lt;= ch ch9))&#xA;          (and (&amp;lt;= cha ch) (&amp;lt;= ch chz))&#xA;          (and (&amp;lt;= chA ch) (&amp;lt;= ch chZ))&#xA;          (= chunderscore ch)&#xA;          (= chminus ch)&#xA;          )&#xA;      (setq rlt (char-to-string ch)))&#xA;     ((or (= chspc ch) (= chsq ch) (= chdot ch))&#xA;      (setq rlt &quot;-&quot;)))&#xA;    rlt&#xA;    ))&#xA;&#xA;(defun org2html-get-slug (str)&#xA;  (let (slug )&#xA;    (setq slug (mapconcat 'org2html--char-to-string str &quot;&quot;))&#xA;    ;; clean slug a little bit&#xA;    (setq slug (replace-regexp-in-string &quot;\-\-+&quot; &quot;-&quot; slug))&#xA;    (setq slug (replace-regexp-in-string &quot;^\-+&quot; &quot;&quot; slug))&#xA;    (setq slug (replace-regexp-in-string &quot;\-+$&quot; &quot;&quot; slug))&#xA;    (setq slug (org2html-trim-string slug))&#xA;    (setq slug (downcase slug))&#xA;    slug))&#xA;&#xA;(defun org2html-replace-pre (html)&#xA;  &quot;Replace pre blocks with sourcecode shortcode blocks.&#xA;shamelessly copied from org2blog/wp-replace-pre()&quot;&#xA;  (save-excursion&#xA;    (let (pos code lang info params header code-start code-end html-attrs pre-class)&#xA;      (with-temp-buffer&#xA;        (insert html)&#xA;        (goto-char (point-min))&#xA;        (save-match-data&#xA;          (while (re-search-forward &quot;&amp;lt;pre\\(.*?\\)&amp;gt;&quot; nil t 1)&#xA;&#xA;            ;; When the codeblock is a src_block&#xA;            (unless&#xA;                (save-match-data&#xA;                  (setq pre-class (match-string-no-properties 1))&#xA;                  (string-match &quot;example&quot; pre-class))&#xA;              ;; Replace the &amp;lt;pre...&amp;gt; text&#xA;              (setq lang (replace-regexp-in-string &quot;.*src-\\([a-zA-Z0-9]+\\).*&quot; &quot;\\1&quot; pre-class)  )&#xA;&#xA;              (replace-match &quot;&quot;)&#xA;              (setq code-start (point))&#xA;&#xA;              ;; Go to end of code and remove &amp;lt;/pre&amp;gt;&#xA;              (re-search-forward &quot;&amp;lt;/pre.*?&amp;gt;&quot; nil t 1)&#xA;              (replace-match &quot;&quot;)&#xA;              (setq code-end (point))&#xA;              (setq code (buffer-substring-no-properties code-start code-end))&#xA;&#xA;              ;; Delete the code&#xA;              (delete-region code-start code-end)&#xA;              ;; Stripping out all the code highlighting done by htmlize&#xA;              (setq code (replace-regexp-in-string &quot;&amp;lt;.*?&amp;gt;&quot; &quot;&quot; code))&#xA;&#xA;              ;; default is highlight.js, it's the best!&#xA;              (insert (concat &quot;\n&amp;lt;pre&amp;gt;&amp;lt;code class=\&quot;lang-&quot;&#xA;                              lang&#xA;                              &quot;\&quot;&amp;gt;\n&quot;&#xA;                              code&#xA;                              &quot;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;\n&quot;))&#xA;&#xA;              )))&#xA;&#xA;        ;; Get the new html!&#xA;        (setq html (buffer-substring-no-properties (point-min) (point-max))))&#xA;      ))&#xA;  html)&#xA;&#xA;(defun org2html--render-subtree ()&#xA;  &quot;Render current subtree&quot;&#xA;  (let ((org-directory default-directory)&#xA;         html-file&#xA;         tags&#xA;         title&#xA;         post-slug&#xA;         html-text)&#xA;&#xA;    ;; set title&#xA;    (setq title (nth 4 (org-heading-components)))&#xA;&#xA;    ;; set POST_SLUG if its does not exist&#xA;    (setq post-slug (org2html-get-slug title))&#xA;    ;; html file&#xA;    (setq html-file (concat (file-name-as-directory default-directory) post-slug &quot;.html&quot;))&#xA;    (setq html-text (org2html-export-into-html-text))&#xA;&#xA;    (save-excursion&#xA;      (setq html-text (org2html-replace-pre html-text)))&#xA;&#xA;    (with-temp-file html-file&#xA;      (insert html-text))&#xA;    (message &quot;%s created&quot; html-file)&#xA;    ))&#xA;&#xA;(defun org2html-export-into-html-text ()&#xA;  (let (html-text b e)&#xA;&#xA;    (save-excursion&#xA;      (org-mark-element)&#xA;      (forward-line) ;; donot export title&#xA;      (setq b (region-beginning))&#xA;      (setq e (region-end))&#xA;      )&#xA;&#xA;    ;; org-export-as will detect active region and narrow to the region&#xA;    (save-excursion&#xA;      (setq html-text&#xA;            (cond&#xA;             ((version-list-&amp;lt; (version-to-list (org-version)) '(8 0 0))&#xA;              (if (fboundp 'org-export-region-as-html)&#xA;                  (org-export-region-as-html b e t 'string)))&#xA;             (t&#xA;              (if (fboundp 'org-export-as)&#xA;                  (org-export-as 'html t nil t)))&#xA;             )))&#xA;    html-text))&#xA;&#xA;(defun org2html-export-subtree ()&#xA;  &quot;Export current first level subtree into HTML&quot;&#xA;  (interactive)&#xA;  (let ((org-directory default-directory)&#xA;        html-file&#xA;        tags&#xA;        title&#xA;        post-slug&#xA;        html-text)&#xA;&#xA;    ;; just goto the root element&#xA;    (condition-case nil&#xA;        (outline-up-heading 8)&#xA;      (error&#xA;       (message &quot;at the beginning ...&quot;)))&#xA;&#xA;    ;; should be nil&#xA;    (org2html--render-subtree)&#xA;    ))&#xA;&#xA;&#xA;(defun org2html-wrap-blocks-in-code (src backend info)&#xA;  (if (org-export-derived-backend-p backend 'html)&#xA;      (org2html-replace-pre src)))&#xA;&#xA;(eval-after-load 'ox&#xA;  '(progn&#xA;     (add-to-list 'org-export-filter-src-block-functions&#xA;                  'org2html-wrap-blocks-in-code)&#xA;     ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2017-07-18T23:56:59.933" LastActivityDate="2017-07-18T23:56:59.933" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9840" PostTypeId="1" CreationDate="2015-03-05T13:41:40.220" Score="2" ViewCount="1191" Body="&lt;p&gt;I am trying to add a comment feature to &lt;code&gt;json-mode&lt;/code&gt;. A comment starts with&#xA;a hash sign and ends at the end of the line. However, if the hash sign is inside a string it should not count as the start of the comment. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1u0Lj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.4, and installed &lt;code&gt;json-mode&lt;/code&gt; from the package manager in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q -l init.el test.json&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;init.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq package-load-list '((json-mode t) (json-reformat t) (json-snatcher t)))&#xA;(require 'package)&#xA;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;&#xA;(defun my-json-mode-comment-highlighter (limit)&#xA;  &quot;When this function is called, it receives one argument `limit', the limit&#xA;of the search; it should begin searching at point, and not search beyond the limit.&#xA;It should return non-nil if it succeeds, and set the match data to describe&#xA;the match that was found. Returning nil indicates failure of the search.&#xA;&#xA;Fontification will call function repeatedly with the same limit, &#xA;and with point where the previous invocation left it, until function fails. &#xA;On failure, this function need not reset point in any particular way.&quot;&#xA;  (let ((repeat 1)&#xA;        (noerror t))&#xA;    (re-search-forward &quot;\\(#.*\\)$&quot; limit noerror repeat)))&#xA;&#xA;(defun my-json-mode-hook ()&#xA;  (let* ( ;; `sub-expression', specifies which subexpression of matcher should&#xA;         ;; be highlighted (instead of the entire text that matcher matched)&#xA;         (sub-expression 1)&#xA;         ;; If `override' is t, override existing fontification made by previous&#xA;         ;; elements of `font-lock-keywords'&#xA;         (override t)&#xA;         ;; If `mode' is nil, adds keywords to `font-lock-keywords' in the current buffer.&#xA;         (mode nil)&#xA;         (keywords&#xA;          `((my-json-mode-comment-highlighter&#xA;             ,sub-expression&#xA;             font-lock-comment-face&#xA;             ,override))))&#xA;    (font-lock-add-keywords mode keywords)))&#xA;&#xA;(add-hook 'json-mode-hook #'my-json-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will highlight comments correctly, but also incorrectly assume that a hash sign inside a string starts a comment.&#xA;How can I extend the function &lt;code&gt;my-json-mode-comment-highlighter&lt;/code&gt; so it works as desired?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried to replace &lt;code&gt;my-json-mode-hook&lt;/code&gt; with:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-json-mode-hook ()&#xA;  (modify-syntax-entry ?# &quot;&amp;lt; b&quot;)&#xA;  (modify-syntax-entry ?\n &quot;&amp;gt; b&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But then nothing is highlighted.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-03-05T18:41:32.983" LastActivityDate="2015-12-28T22:09:40.873" Title="How to use font-lock to highlight end-of-line comments?" Tags="|font-lock|" AnswerCount="5" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9841" PostTypeId="2" ParentId="9840" CreationDate="2015-03-05T14:15:50.260" Score="1" Body="&lt;p&gt;Naive approach which will do slightly better: disallow quotes after #  -  &lt;code&gt;#[^&quot;']*$&lt;/code&gt; instead of &lt;code&gt;#.*$&lt;/code&gt;.  This won't colorize comments containing quote but won't go inside string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proper approach: complicate the loop. Scan the line searching for any interesting special characters (those are &quot;, ', \ and # unless I miss sth), keep track of whether you are inside some quotes, and find first # which is not inside quoted string. &lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-03-05T14:15:50.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9842" PostTypeId="1" AcceptedAnswerId="10588" CreationDate="2015-03-05T14:20:45.253" Score="6" ViewCount="2681" Body="&lt;p&gt;How do I disable &lt;code&gt;evil-mode&lt;/code&gt; in a buffer in which &lt;code&gt;git-timemachine&lt;/code&gt; is activated?&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="253" LastEditDate="2015-03-06T16:40:40.433" LastActivityDate="2015-04-09T14:11:40.807" Title="Disable evil-mode when git-timemachine mode is activated" Tags="|git|evil|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9843" PostTypeId="2" ParentId="9840" CreationDate="2015-03-05T14:43:04.133" Score="5" Body="&lt;p&gt;When using font-lock, things are colored in two phases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;strong&gt;syntactic&lt;/strong&gt; phase highlights comments and string&lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;keyword&lt;/strong&gt; phase highlights anything else.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The syntactic phase is based on information in the syntax table. If things are not highlighted properly this mean that the syntax table is broken. There are plenty of examples of other languages like Ruby that use the same string and comment conventions a JSon.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-03-05T14:43:04.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9844" PostTypeId="2" ParentId="3844" CreationDate="2015-03-05T14:47:40.973" Score="12" Body="&lt;p&gt;You can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Desktop-Notifications.html&quot; rel=&quot;noreferrer&quot;&gt;notifications&lt;/a&gt; in Emacs &gt; 24:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'notifications)&#xA;&#xA;(notifications-notify :title &quot;Achtung!&quot;&#xA;                      :body (format &quot;You have an appointment in %d minutes&quot; 10)&#xA;                      :app-name &quot;Emacs: Org&quot;&#xA;                      :sound-name &quot;alarm-clock-elapsed&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6690" LastEditorUserId="675" LastEditDate="2015-05-12T22:02:16.040" LastActivityDate="2015-05-12T22:02:16.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9845" PostTypeId="2" ParentId="9835" CreationDate="2015-03-05T16:23:24.537" Score="6" Body="&lt;p&gt;This is probably coming from the dabbrev back end. You can remove it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(delete 'company-dabbrev company-backends)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2015-03-05T16:23:24.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9846" PostTypeId="2" ParentId="9835" CreationDate="2015-03-05T18:13:26.560" Score="-2" Body="&lt;p&gt;You can set &lt;code&gt;company-dabbrev-other-buffers&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, so company only searches in the active buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq company-dabbrev-other-buffers nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6679" LastEditorUserId="504" LastEditDate="2015-03-16T07:18:20.427" LastActivityDate="2015-03-16T07:18:20.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9847" PostTypeId="2" ParentId="7874" CreationDate="2015-03-05T19:06:55.863" Score="0" Body="&lt;p&gt;The following snippet is an example of how to remove duplicate overlay objects from a LIST when the text properties are the same:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(setq LIST&#xA;  (remove-duplicates LIST&#xA;    :test (lambda (x y) (or (null y) (equal-including-properties x y)))&#xA;    :from-end t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following function is an example of how to remove overlays when the value includes text properties.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun lawlist-remove-overlays (beg end name val)&#xA;&quot;Remove the overlays that are `equal-including-properties`.&#xA;Includes a unique situation when an overlay with an `'after-string` property&#xA;is at the very end of a narrowed-buffer.&quot;&#xA;  (let* (&#xA;      (point-max (point-max))&#xA;      (point-min (point-min))&#xA;      (narrowed-p (buffer-narrowed-p))&#xA;      (beg (if beg beg point-min))&#xA;      (end&#xA;        (cond&#xA;          ((and&#xA;              (not narrowed-p)&#xA;              end)&#xA;            end)&#xA;          ((and&#xA;              (not narrowed-p)&#xA;              (null end))&#xA;            point-max)&#xA;          ((and&#xA;              narrowed-p&#xA;              end&#xA;              (&amp;lt; end point-max))&#xA;            end)&#xA;          ((and&#xA;              narrowed-p&#xA;              end&#xA;              (= end point-max))&#xA;            (1+ end))&#xA;          ((and&#xA;              narrowed-p&#xA;              (null end))&#xA;            (1+ point-max)) )) )&#xA;    (when (and beg end name val)&#xA;      (overlay-recenter end)&#xA;      (dolist (o (overlays-in beg end))&#xA;        (when (equal-including-properties (overlay-get o name) val)&#xA;          (delete-overlay o))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Related threads:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/3817075/2112489&quot;&gt;https://stackoverflow.com/a/3817075/2112489&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/9836/2287&quot;&gt;https://emacs.stackexchange.com/a/9836/2287&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-03-05T19:06:55.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9848" PostTypeId="1" AcceptedAnswerId="9850" CreationDate="2015-03-05T19:53:13.587" Score="3" ViewCount="1723" Body="&lt;p&gt;I am writing this mode where I only want to show one paragraph at a time. Ideally I'd like to show the paragraph in the center of the screen. Getting it horizontally centered is trivial, but I have not found out how to enter text vertically. What do you think would be the best way to achieve vertical alignment of a few lines of text in an otherwise empty buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently thinking of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pasting paragraph into new buffer&lt;/li&gt;&#xA;&lt;li&gt;Adding a bunch of new-lines&lt;/li&gt;&#xA;&lt;li&gt;Going to the top of the buffer&lt;/li&gt;&#xA;&lt;li&gt;Select the visible buffer &lt;/li&gt;&#xA;&lt;li&gt;Count the number of empty lines in visible buffer with (how-many &quot;^$&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Ensure that there are empty-lines-in-visible-buffer/2 empty lines before the paragraph.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm sure there is a better way to do this though.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2015-03-06T15:15:52.653" Title="Vertically aligning text in emacs" Tags="|elisp|align|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9849" PostTypeId="2" ParentId="9848" CreationDate="2015-03-05T20:26:21.200" Score="2" Body="&lt;p&gt;There is a &lt;code&gt;recenter&lt;/code&gt; command that should do what you want: it will center the line containing point in the current window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on how you want things to recenter as the paragraph grows, you may want to count the lines in the paragraph and move point to the middle line before calling &lt;code&gt;recenter&lt;/code&gt; each time. You also need enough empty lines before the paragraph to recenter. Here's a possible implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun recenter-paragraph ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (mark-paragraph)&#xA;    (let* ((start (region-beginning))&#xA;           (end (region-end))&#xA;           (count (count-lines start end))&#xA;           (min (/ (window-size) 2)))&#xA;&#xA;      ;; pad buffer with empty lines if necessary&#xA;      (when (&amp;lt; (line-number-at-pos start) min)&#xA;        (goto-char start)&#xA;        (newline min))&#xA;&#xA;      ;; go to paragraph midpoint and recenter&#xA;      (goto-char end)&#xA;      (previous-line (/ count 2))&#xA;      (recenter))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-05T20:55:02.043" LastActivityDate="2015-03-05T20:55:02.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9850" PostTypeId="2" ParentId="9848" CreationDate="2015-03-05T21:09:45.540" Score="2" Body="&lt;p&gt;My approach would be a bit different:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Figure out the height of the content to be centered&lt;/li&gt;&#xA;&lt;li&gt;Display a newly created buffer in a window&lt;/li&gt;&#xA;&lt;li&gt;Figure out the window's height&lt;/li&gt;&#xA;&lt;li&gt;Insert a newline with the &lt;code&gt;display&lt;/code&gt; property to make it appear tall enough with the height &lt;/li&gt;&#xA;&lt;li&gt;Insert content&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;An actual implementation is demonstrated in the &lt;a href=&quot;https://github.com/sabof/magic-buffer&quot; rel=&quot;nofollow&quot;&gt;magic-buffer&lt;/a&gt; package, it differs from the proposed strategy in that it's using an overlay for the height adjustment and the usage of various hooks that impact the window height and triggers readjustment on such events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-display-centered-paragraph (text)&#xA;  (let* ((buffer (get-buffer-create &quot;*demo*&quot;))&#xA;         (window (display-buffer buffer)))&#xA;    (with-current-buffer buffer&#xA;      (with-selected-window window&#xA;        (let ((inhibit-read-only t)&#xA;              (window-height (window-body-height window t))&#xA;              content-height)&#xA;          (delete-region (point-min) (point-max))&#xA;          (insert text)&#xA;          (set-window-start window (point-min))&#xA;          (unless (looking-back &quot;\n$&quot;)&#xA;            (insert &quot;\n&quot;))&#xA;          (setq content-height (cdr (posn-x-y (posn-at-point))))&#xA;          (goto-char (point-min))&#xA;          (insert (propertize &quot;\n&quot; 'line-height&#xA;                              (/ (- window-height content-height) 2))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-03-06T15:15:52.653" LastActivityDate="2015-03-06T15:15:52.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9851" PostTypeId="2" ParentId="9840" CreationDate="2015-03-05T22:19:23.720" Score="7" Body="&lt;p&gt;&lt;code&gt;(override t)&lt;/code&gt; is the culprit: that's what tells Emacs to apply the comment face to anything that starts with a &lt;code&gt;#&lt;/code&gt; even if part of that thing has already been recognized as something else. Remove it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However you shouldn't need to define a regex to highlight comments: Emacs understands comments out of the box, based on character syntax, &lt;a href=&quot;https://emacs.stackexchange.com/a/9843&quot;&gt;as described by Lindydancer&lt;/a&gt;. It should be enough to declare &lt;code&gt;#&lt;/code&gt; as a line comment start character with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-json-mode-hook ()&#xA;  (modify-syntax-entry ?# &quot;&amp;lt; b&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(and maybe &lt;code&gt;(modify-syntax-entry ?\n &quot;&amp;gt; b&quot;)&lt;/code&gt; if the JSON mode doesn't already define &lt;code&gt;//&lt;/code&gt; as a line comment start.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-03-05T22:19:23.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9852" PostTypeId="1" AcceptedAnswerId="10326" CreationDate="2015-03-05T22:41:09.360" Score="5" ViewCount="203" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there a way to (temporarily) increase the rate at which the mode line is redisplayed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was trying to write a package that adds a spinner to the mode line&#xA;(to indicate ongoing operations), but I hit a bit of a wall. If the&#xA;user is not interacting (not typing, or moving, or something), then&#xA;the mode-line might stop updating for up to a minute. If that's the&#xA;case then the spinner won't spin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started writing a solution with timers (that would periodically&#xA;call &lt;code&gt;redisplay&lt;/code&gt;), but that seems like a lot of work for something so&#xA;simple.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-03-05T23:17:47.283" LastActivityDate="2015-03-27T01:29:48.997" Title="Increasing the frequency of modeline redisplay" Tags="|mode-line|display|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9853" PostTypeId="1" AcceptedAnswerId="18145" CreationDate="2015-03-06T01:14:59.800" Score="3" ViewCount="933" Body="&lt;p&gt;Latex has the ability to include the contents of a file using the &lt;code&gt;lstinputlisting&lt;/code&gt; command.  When exporting an org-mode file to latex &lt;code&gt;#+include: somefile&lt;/code&gt; inserts the file contents at that point in the document, this makes sense for org files, but for many files it would make more sense to use the listing command when exporting to latex. Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;Here's some examples of what the org code and respective latex code would be.  One file is a plain text file, the other is marked as a c file so that it gets syntax highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the .org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: results.txt&#xA;#+INCLUDE: main.cpp src C++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the .tex file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\lstinputlisting[]{results.txt}&#xA;\lstinputlisting[language=c]{main.cpp}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main advantage with using the lstinputlisting over copy/pasting the file contents into the latex document is when the exported document will be edited further. The listing makes it more readable and allows easily incorporating changes made to the included files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I've looked a little bit at exporter's source code, and I'm not sure this is possible at the moment. &lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="2823" LastEditDate="2015-03-06T21:49:16.813" LastActivityDate="2015-11-30T04:59:28.243" Title="Exporting org mode includes as latex lstinputlisting, or equivalent" Tags="|latex|org-export|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9854" PostTypeId="1" AcceptedAnswerId="9855" CreationDate="2015-03-06T02:47:32.033" Score="1" ViewCount="114" Body="&lt;p&gt;Helm is very powerful, how to implement the feature to create a helm list/buffer to highlight all the lines containing the word currently under the cursor?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="50" LastEditDate="2015-03-06T16:50:53.640" LastActivityDate="2015-03-06T16:50:53.640" Title="List all lines containing the word under the cursor in helm" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9855" PostTypeId="2" ParentId="9854" CreationDate="2015-03-06T05:51:13.740" Score="3" Body="&lt;p&gt;This is what &lt;code&gt;helm-swoop&lt;/code&gt; does by default. See &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot; rel=&quot;nofollow&quot;&gt;GitHub&lt;/a&gt; for more info. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you specifically prefer to use a different &lt;code&gt;helm&lt;/code&gt; search tool, you could probably configure it to do something similar.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-06T05:51:13.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9856" PostTypeId="1" CreationDate="2015-03-06T09:31:08.017" Score="5" ViewCount="154" Body="&lt;p&gt;In the &quot;&lt;em&gt;Org tags&lt;/em&gt;&quot; buffer (the buffer showing the fast tag selection keys when pressing C-c C-c C-c in a headline) some fast selection keys are shown as e. g. [\212] instead of the actual key. How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs-version: GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.3.0, NS appkit-1265.21 Version 10.9.4 (Build 13E28)) of 2014-07-05&lt;/p&gt;&#xA;" OwnerUserId="6700" LastEditorUserId="253" LastEditDate="2016-01-28T12:38:05.607" LastActivityDate="2016-01-28T12:38:05.607" Title="Special characters (e. g. umlauts) not displayed correctly in *Org tags* fast tag selection buffer" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9858" PostTypeId="2" ParentId="9840" CreationDate="2015-03-06T10:17:27.533" Score="0" Body="&lt;p&gt;I agree with @Lindydancer that the best way would be to use the built-in syntax highlighting for highlighting comments. But in order to that, I think I would need to modify the source code of &lt;code&gt;json-mode.el&lt;/code&gt;.&#xA;Since I did not want to modify the source code of &lt;code&gt;json-mode&lt;/code&gt;, I tried to do work around this using &lt;code&gt;font-lock-add-keywords&lt;/code&gt; instead. It becomes a little bit complicated, but here is something that seems to work for me now:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-json-mode-comment-highlighter (limit)&#xA;  &quot;When this function is called, it receives one argument `limit', the limit&#xA;of the search; it should begin searching at point, and not search beyond the limit.&#xA;It should return non-nil if it succeeds, and set the match data to describe&#xA;the match that was found. Returning nil indicates failure of the search.&#xA;&#xA;Fontification will call function repeatedly with the same limit, &#xA;and with point where the previous invocation left it, until function fails. &#xA;On failure, this function need not reset point in any particular way.&quot;&#xA;  (let ((repeat 1)&#xA;        (noerror t)&#xA;        (string-pos-list nil)&#xA;        (found-match nil)&#xA;        (search-again t)&#xA;        (start-pos))&#xA;    (setq string-pos-list (my-json-mode--find-string-pos-list limit))&#xA;    (while search-again&#xA;      (if (re-search-forward &quot;\\(#.*\\)$&quot; limit noerror repeat)&#xA;          (progn&#xA;            (setq start-pos (match-beginning 1))&#xA;            (if (my-json-mode--check-outside-string string-pos-list start-pos)&#xA;                (progn&#xA;                  (setq found-match t)&#xA;                  (setq search-again nil))&#xA;              ;; comment was part of a string, so we move back from&#xA;              ;; the end of the line to the next character after the #&#xA;              (goto-char (+ start-pos 1)))) &#xA;        (setq search-again nil))) ; re-search-forward failed.&#xA;    found-match))&#xA;&#xA;(defun my-json-mode--check-outside-string (pos-list pos)&#xA;  &quot;Checks if `pos' is outside any string on the current line.&quot;      &#xA;  (catch 'my-loop&#xA;    (dolist (elt pos-list)&#xA;      (when (&amp;lt;= (car elt) pos (cadr elt))&#xA;        (throw 'my-loop nil)))&#xA;    t))&#xA;&#xA;(defun my-json-mode--find-string-pos-list (limit)&#xA;  &quot;Find the starting and end positions of all strings in the current buffer&#xA;from (line-beginning-position) to `limit'. Exclude strings inside comments&#xA;  (comments start with a # sign). To avoid starting the search from&#xA;the beginning of the buffer, we assume that a string &#xA;does not have newline characters.&quot;      &#xA;  (save-excursion&#xA;    (let ((noerror t)&#xA;          (repeat 1)&#xA;          (pos-list nil)&#xA;          (cur-pos nil))&#xA;      (beginning-of-line)&#xA;      (setq cur-pos (point))&#xA;      (while (re-search-forward json-mode-quoted-string-re limit noerror repeat)&#xA;        (let ((start-pos (match-beginning 1))&#xA;              (end-pos (match-end 1)))&#xA;          (if (my-json-mode--string-not-comment cur-pos start-pos)&#xA;              (push (list (match-beginning 1) (match-end 1)) pos-list)&#xA;            (end-of-line)) ; current line is a comment, so skip it&#xA;          (setq cur-pos end-pos)))&#xA;      pos-list)))&#xA;&#xA;(defun my-json-mode--string-not-comment (start-pos end-pos)&#xA;  &quot;Ensure that the string that starts at position `end-pos' is not part of a comment&#xA;starting after `start-pos' on the current line. We must have that `start-pos'&#xA;is strictly less than `end-pos'. If `start-pos' is not at the same line as&#xA;`end-pos', we set `start-pos' to (line-beginning-position)&quot;   &#xA;  (let ((beg-line-pos (line-beginning-position))&#xA;        (noerror t)&#xA;        (repeat 1)&#xA;        (string-ok t))&#xA;    (when (&amp;lt; start-pos beg-line-pos)&#xA;      (setq start-pos beg-line-pos))&#xA;    (save-excursion&#xA;      (goto-char start-pos)&#xA;      (when (search-forward &quot;#&quot; end-pos noerror repeat)&#xA;        (setq string-ok nil)))&#xA;    string-ok))&#xA;&#xA;(defun my-json-mode-hook ()&#xA;  (let* ( ;; `sub-expression', specifies which subexpression of matcher should&#xA;         ;; be highlighted (instead of the entire text that matcher matched)&#xA;         (sub-expression 1)&#xA;         ;; If `override' is t, override existing fontification made by previous&#xA;         ;; elements of `font-lock-keywords'&#xA;         (override nil)&#xA;         ;; If `mode' is nil, adds keywords to `font-lock-keywords' in the current buffer.&#xA;         (mode nil)&#xA;         (keywords&#xA;          `((my-json-mode-comment-highlighter&#xA;             ,sub-expression&#xA;             font-lock-comment-face&#xA;             ,override))))&#xA;    (font-lock-add-keywords mode keywords)))&#xA;&#xA;(add-hook 'json-mode-hook #'my-json-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-03-06T10:17:27.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9859" PostTypeId="2" ParentId="9826" CreationDate="2015-03-06T13:52:17.927" Score="17" Body="&lt;p&gt;If you're using a Window System, you might be able to use &lt;code&gt;x-focus-frame&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;x-focus-frame&lt;/code&gt; works for Windows as well as for Linux&lt;/li&gt;&#xA;&lt;li&gt;prior to Emacs 23.1, use &lt;code&gt;w32-focus-frame&lt;/code&gt; on Windows.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2612" LastEditorUserId="2612" LastEditDate="2017-07-20T07:24:04.103" LastActivityDate="2017-07-20T07:24:04.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9860" PostTypeId="2" ParentId="9842" CreationDate="2015-03-06T14:32:25.053" Score="1" Body="&lt;p&gt;If you want evil to be in emacs mode when you launch git-timemachine, try that: &lt;a href=&quot;http://wikemacs.org/wiki/Evil#Enter_an_emacs_mode_in_a_given_state&quot; rel=&quot;nofollow&quot;&gt;http://wikemacs.org/wiki/Evil#Enter_an_emacs_mode_in_a_given_state&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell, try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-set-initial-state 'git-timemachine 'emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="739" LastActivityDate="2015-03-06T14:32:25.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9861" PostTypeId="2" ParentId="9807" CreationDate="2015-03-06T15:44:22.837" Score="8" Body="&lt;p&gt;OK, since I didn't find a ready-made one, I decided to roll my own. This doesn't seem to be difficult at all, so here goes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun wvxvw/export-rel-url (path desc format)&#xA;  (cl-case format&#xA;    (html (format &quot;&amp;lt;a href=\&quot;%s\&quot;&amp;gt;%s&amp;lt;/a&amp;gt;&quot; path (or desc path)))&#xA;    (latex (format &quot;\\href{%s}{%s}&quot; path (or desc path)))&#xA;    (otherwise path)))&#xA;&#xA;(org-add-link-type &quot;rel&quot; 'browse-url 'wvxvw/export-rel-url)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage example: &lt;code&gt;[[rel:./foo/bar][foo bar]]&lt;/code&gt; translates into HTML: &lt;code&gt;&amp;lt;a href=&quot;./foo/bar&quot;&amp;gt;foo bar&amp;lt;/a&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important part is the &lt;code&gt;org-add-link-type&lt;/code&gt; - this allows to specify the way to export the link. This code isn't universal, since it doesn't support even all the back-ends enabled by Org by default, but it should be obvious how to add more.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Starting with &lt;strong&gt;Orgmode 9.0&lt;/strong&gt; the function &lt;code&gt;org-add-link-type&lt;/code&gt; is deprecated. One should use &lt;code&gt;org-link-set-parameters&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There follows the equivalent Elisp code for Orgmode 9.0. Note that the only change is the replacement of &lt;code&gt;org-add-link-type&lt;/code&gt; with &lt;code&gt;org-link-set-parameters&lt;/code&gt;. The function &lt;code&gt;wvxvw/export-rel-url&lt;/code&gt; is unchanged. It is only cited here to ease copy-paste.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun wvxvw/export-rel-url (path desc format)&#xA;  (cl-case format&#xA;    (html (format &quot;&amp;lt;a href=\&quot;%s\&quot;&amp;gt;%s&amp;lt;/a&amp;gt;&quot; path (or desc path)))&#xA;    (latex (format &quot;\\href{%s}{%s}&quot; path (or desc path)))&#xA;    (otherwise path)))&#xA;&#xA;(eval-after-load &quot;org&quot;&#xA;  '(org-link-set-parameters &quot;rel&quot; :follow #'browse-url :export #'wvxvw/export-rel-url))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="2370" LastEditDate="2019-12-19T13:27:05.350" LastActivityDate="2019-12-19T13:27:05.350" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="9862" PostTypeId="2" ParentId="9842" CreationDate="2015-03-06T16:40:12.060" Score="2" Body="&lt;p&gt;This piece of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;advice&lt;/a&gt; will toggle &lt;code&gt;evil-local-mode&lt;/code&gt;: disabling it when you enable &lt;code&gt;git-timemachine-mode&lt;/code&gt;, and enabling it when you turn off &lt;code&gt;git-timemachine-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice git-timemachine-mode (after toggle-evil activate)&#xA;  &quot;Turn off `evil-local-mode' when enabling&#xA;`git-timemachine-mode', and turn it back on when disabling&#xA;`git-timemachine-mode'.&quot;&#xA;  (evil-local-mode (if git-timemachine-mode -1 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-03-06T16:40:12.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9863" PostTypeId="2" ParentId="9853" CreationDate="2015-03-06T17:47:30.793" Score="1" Body="&lt;p&gt;Try the next in your org file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_HEADER: \usepackage[parameters]{listings}&#xA;&#xA;#+begin_latex&#xA;\lstinputlisting[]{results.txt}&#xA;\lstinputlisting[language=c]{main.cpp}&#xA;#+end_latex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;References:&#xA;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6572" LastActivityDate="2015-03-06T17:47:30.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9864" PostTypeId="2" ParentId="9853" CreationDate="2015-03-06T17:48:01.987" Score="1" Body="&lt;p&gt;You need to a) include the &lt;code&gt;src language&lt;/code&gt; key in the &lt;code&gt;#+include&lt;/code&gt; statement (as you already did) and b) tell org to export literal examples using listings, as described in &lt;code&gt;C-h v org-latex-listings&lt;/code&gt;. The example there suggests&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq org-latex-listings t)&#xA;  (require 'ox-latex)&#xA;  (add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;listings&quot;))&#xA;  (add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;color&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&#xA;This should give the desired result if you export to pdf, but it won't use &lt;code&gt;lstinputlisting&lt;/code&gt; in the .tex file.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastEditorUserId="5308" LastEditDate="2015-03-06T17:54:08.387" LastActivityDate="2015-03-06T17:54:08.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9865" PostTypeId="1" AcceptedAnswerId="10001" CreationDate="2015-03-06T17:57:31.683" Score="6" ViewCount="3938" Body="&lt;p&gt;I'd like to run two instances of IPython in Emacs at the same time, one with Python 2, and the other Python 3: is it something doable or there's something in the way &lt;code&gt;python.el&lt;/code&gt; is designed that would prevent it?&lt;/p&gt;&#xA;" OwnerUserId="2807" LastEditorUserId="253" LastEditDate="2015-03-06T18:56:38.540" LastActivityDate="2015-03-13T14:13:22.957" Title="Running two IPython instances at the same time" Tags="|python|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9866" PostTypeId="1" CreationDate="2015-03-06T18:27:33.260" Score="2" ViewCount="520" Body="&lt;p&gt;I am working on a project that includes some configuration in &lt;code&gt;.dir-locals.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((c++-mode&#xA;  . ((compile-command . &quot;cd ../../\; ./build.sh&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This gets picked up just fine for me and sets the compile command. A teammate's emacs doesn't seem to recognize the file. &lt;code&gt;.dir-locals.el&lt;/code&gt; is present, but doesn't set the compile command (still defaults to &lt;code&gt;make -k&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluating &lt;code&gt;(dir-locals-find-file &quot;Foo.h&quot;)&lt;/code&gt; in &lt;code&gt;*scratch*&lt;/code&gt; returns &lt;code&gt;.../project/src&lt;/code&gt; on my system (which is the folder where &lt;code&gt;.dir-locals.el&lt;/code&gt; is located), but returns &lt;code&gt;nil&lt;/code&gt; for the teammate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I troubleshoot this? Everything I can find in the documentation seems to assume that &lt;code&gt;.dir-locals.el&lt;/code&gt; will get picked up if it's present.&lt;/p&gt;&#xA;" OwnerUserId="6704" LastActivityDate="2015-03-06T18:27:33.260" Title=".dir-locals.el isn't recognized" Tags="|customize|compilation|file-local-variables|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9867" PostTypeId="2" ParentId="8309" CreationDate="2015-03-06T18:57:46.517" Score="1" Body="&lt;p&gt;I was on a similar boat. Assuming that you have your favorite calendar on google,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Go to google calendar and download i.e. click on &quot;Export Calendars&quot;&lt;/li&gt;&#xA;&lt;li&gt;Unzip calendar, which should give you a .ics file&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In your .emacs file, do the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(icalendar-import-file &quot;~/wherethefileis/calendar.ics&quot;&#xA;               &quot;~/diary&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You should comment out the above import command after your first load of .emacs file. Otherwise, every time you open your emacs, the .ics file will be imported to your diary and your diary would have multiple entries for same day.&lt;/p&gt;&#xA;" OwnerUserId="6664" LastEditorUserId="6664" LastEditDate="2015-03-07T19:26:21.923" LastActivityDate="2015-03-07T19:26:21.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9868" PostTypeId="1" AcceptedAnswerId="9875" CreationDate="2015-03-07T02:36:41.117" Score="4" ViewCount="632" Body="&lt;p&gt;I want to check the spelling in a buffer. I do that by &lt;code&gt;M-x  ispell&lt;/code&gt;. When it finds &lt;code&gt;nd&lt;/code&gt; in the folowing example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apple a nd orange&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hit the left or right arrow key, in order to move the cursor to the space after &lt;code&gt;a&lt;/code&gt; in the buffer and then delete the extra space between &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;nd&lt;/code&gt;. But it seems that I exit &lt;code&gt;ispell&lt;/code&gt; when I hit my arrow key. How can I do my edit without exiting &lt;code&gt;ispell&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, if I restart &lt;code&gt;M-x ispell&lt;/code&gt;, it will start from the beginning of the buffer, rather than from where I was last time. To start from where I was last time, I select the region from where I was to the end of buffer, and then &lt;code&gt;M-x ispell&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I continue from where I was left last time more efficiently?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="2710" LastEditDate="2015-03-07T16:27:31.287" LastActivityDate="2015-03-08T09:31:49.247" Title="Efficiently use the spell checker" Tags="|spell-checking|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9869" PostTypeId="1" AcceptedAnswerId="9870" CreationDate="2015-03-07T04:38:41.613" Score="5" ViewCount="1018" Body="&lt;p&gt;When I open Java files originally created and edited in Emacs, the indentation shows up correctly, as in the image below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kKvgo.png&quot; alt=&quot;Java file made in emacs&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I open the same file in Sublime Text, or any other editor besides Emacs, the indentation is messed up, and I can see that it's because Emacs inconsistently mixes spaces and tabs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6pjTe.png&quot; alt=&quot;The same file opened in sublime text&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone else encountered this?&lt;/p&gt;&#xA;" OwnerUserId="5389" LastEditorUserId="105" LastEditDate="2015-03-07T04:49:45.520" LastActivityDate="2015-05-09T20:21:15.423" Title="Make emacs format Java more consistently" Tags="|indentation|formatting|java|tabs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9870" PostTypeId="2" ParentId="9869" CreationDate="2015-03-07T04:48:03.650" Score="6" Body="&lt;p&gt;Set option &lt;strong&gt;&lt;code&gt;indent-tabs-mode&lt;/code&gt;&lt;/strong&gt; to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this in your init file, to make Emacs always indent using &lt;code&gt;SPC&lt;/code&gt; characters, never &lt;code&gt;TAB&lt;/code&gt; characters.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:21:15.423" LastActivityDate="2015-05-09T20:21:15.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9871" PostTypeId="1" AcceptedAnswerId="9880" CreationDate="2015-03-07T05:55:28.890" Score="1" ViewCount="585" Body="&lt;p&gt;Is there a way to get the Emacs terminal emulator to support cursor movement escape sequences beyond its vt100 features? A specific example is CHA (Cursor-Character-Absolute), e.g. &lt;code&gt;ESC[0G&lt;/code&gt; should move the cursor to column 0. CHA and a few other sequences were added as part of ISO-6429 (ECMA-48).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this rudimentary test in eterm and another terminal emulator:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;printf &quot;hello\033[0Gworld\n&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In eterm (&lt;code&gt;M-x term&lt;/code&gt; or &lt;code&gt;M-x multi-term&lt;/code&gt;) you will see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;helloworld&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Terminal.app I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a full featured test check out &lt;a href=&quot;http://invisible-island.net/vttest/&quot; rel=&quot;nofollow&quot;&gt;vttest&lt;/a&gt; (&lt;code&gt;brew install test&lt;/code&gt; for me).&lt;/p&gt;&#xA;" OwnerDisplayName="user6709" LastEditorDisplayName="user6709" LastEditDate="2015-03-07T06:05:10.707" LastActivityDate="2015-04-15T05:01:37.997" Title="Extended Cursor Movement in terminal emulator (CHA and others)" Tags="|term|cursor|ansi-term|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9872" PostTypeId="1" AcceptedAnswerId="24618" CreationDate="2015-03-07T06:22:21.513" Score="7" ViewCount="3585" Body="&lt;p&gt;On using an image link as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[./hello.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;org-mode&lt;/code&gt;, emacs doesn't toggle the inline image display. &lt;code&gt;org-toggle-inline-images&lt;/code&gt; works well on start-up. I run a presentation using &lt;code&gt;M-x epresent-run&lt;/code&gt; &lt;a href=&quot;https://github.com/eschulte/epresent&quot; rel=&quot;noreferrer&quot;&gt;epresent&lt;/a&gt; and come back to edit mode from the presentation mode by pressing &lt;code&gt;q&lt;/code&gt;. Then the image display stops toggling.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What I get after quitting &lt;code&gt;epresent-mode&lt;/code&gt;:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tVUqZ.png&quot; alt=&quot;image-display-on&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What I want:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ns9Cd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior is seen after I get into presentation mode using &lt;a href=&quot;https://github.com/eschulte/epresent&quot; rel=&quot;noreferrer&quot;&gt;epresent&lt;/a&gt; and come back to edit mode by pressing &lt;code&gt;q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="2710" LastEditDate="2015-03-07T18:45:32.510" LastActivityDate="2021-11-23T05:12:16.790" Title="Hide inline images and show links in org-mode" Tags="|org-mode|images|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9873" PostTypeId="1" CreationDate="2015-03-07T06:29:08.167" Score="2" ViewCount="472" Body="&lt;p&gt;When using ansi-term in line mode emacs lets you edit the buffer arbitrarily, not just after the last prompt. I'm trying to make it read only so I stop fudging with command output. The problem is all the solutions I've come up with also prevent me from entering any commands while in line mode. Here's my attempt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar-local etc-last-read-only 0)&#xA;&#xA;(defun etc-make-term-output-read-only (&amp;amp;rest args)&#xA;  (interactive)&#xA;  (let ((inhibit-modification-hooks t))&#xA;    (when (= 0 etc-last-read-only)&#xA;      (setq etc-last-read-only (point-min)))&#xA;    (let ((end-prompt (ignore-errors (save-excursion&#xA;                                       (goto-char (point-max))&#xA;                                       (term-previous-prompt 1)&#xA;                                       ;; (backward-char)&#xA;                                       (point)))))&#xA;      (when (and end-prompt (&amp;gt; end-prompt etc-last-read-only))&#xA;        (add-text-properties etc-last-read-only end-prompt&#xA;                             '(read-only t rear-sticky t&#xA;                                         front-sticky nil))&#xA;        (setq etc-last-read-only end-prompt)))))&#xA;&#xA;(add-hook 'term-mode-hook &#xA;    (lambda () (add-hook 'after-change-functions #'etc-make-term-output-read-only nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea is that whenever the buffer changes we try to make everything before the most recent prompt read only. I have term-prompt-regexp set to match my PS1 and I can tell that the regexp works correctly because C-c C-p and C-c C-n correctly jump between prompt instances, and I've manually verified with string-match that I get the right result, matching the prompt and one following space. To make the hook more efficient we track how much of the buffer we've made read only so far so we don't have to apply the read only property to the whole buffer every time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the backward-char call is included, then I can enter commands &lt;em&gt;as long as I never hit backspace at the beginning of the prompt&lt;/em&gt;. If I do then I get a text is read only error from then on and can never enter commands again. If I don't include it, then I never get to enter commands in the first place because it thinks everything is read only. I thought maybe this was an issue with stickiness from the earlier characters, so I tried disabling the stickiness as you can see but it made no difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some more changes that are needed to make this more robust (I put advice on term-emulate-terminal to inhibit read only and probably need it elsewhere) but first I just want this proof of concept working. What am I doing wrong? How do I get everything up to term-bol marked read only without preventing typing commands there?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-03-07T06:29:08.167" Title="How to make ansi-term output read only?" Tags="|hooks|term|ansi-term|read-only-mode|inhibit|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9874" PostTypeId="2" ParentId="9826" CreationDate="2015-03-07T08:25:22.053" Score="4" Body="&lt;p&gt;Either &lt;code&gt;(x-focus-frame nil)&lt;/code&gt; or &lt;code&gt;(other-frame 0)&lt;/code&gt; will do it. I'm not sure if there is any difference in behavior between the two.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-07T08:25:22.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9875" PostTypeId="2" ParentId="9868" CreationDate="2015-03-07T10:05:13.163" Score="7" Body="&lt;p&gt;You should use &lt;code&gt;recursive-edit&lt;/code&gt; for this.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter &lt;code&gt;recursive-edit&lt;/code&gt; with &lt;code&gt;C-r&lt;/code&gt;; make your changes to the buffer and then exit again with &lt;code&gt;C-M-c&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a general mechanism in emacs for escaping to make changes whilst you are in the middle of running a query replace type operation; this includes &lt;code&gt;ispell&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-03-08T09:31:49.247" LastActivityDate="2015-03-08T09:31:49.247" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9876" PostTypeId="2" ParentId="3878" CreationDate="2015-03-07T10:49:03.847" Score="3" Body="&lt;p&gt;You can define the encoding in your .emacs using the following environment variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;LANG&quot; &quot;en_US.UTF-8&quot;)&#xA;(setenv &quot;LC_ALL&quot; &quot;en_US.UTF-8&quot;)&#xA;(setenv &quot;LC_CTYPE&quot; &quot;en_US.UTF-8&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6712" LastActivityDate="2015-03-07T10:49:03.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9877" PostTypeId="1" CreationDate="2015-03-07T11:04:21.490" Score="6" ViewCount="4951" Body="&lt;p&gt;When I start up emacs, I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): Your `load-path' seems to contain&#xA;your `.emacs.d' directory: ~/.emacs.d/&#xA;This is likely to cause problems...&#xA;Consider using a subdirectory instead, e.g.: /home/faheem/.emacs.d/lisp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think I started seeing this message relatively recently, but in any case, here are the relevant lines in my &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/&quot;)&#xA;(add-to-list 'load-path &quot;/usr/share/emacs/site-lisp/slime/&quot;)&#xA;(add-to-list 'load-path &quot;/usr/share/emacs/site-lisp/slime/contrib&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is what my &lt;code&gt;emacs.d&lt;/code&gt; directory looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;faheem@orwell:~/.emacs.d$ ls&#xA;abbrev_defs     edit-server.el  session.10dbde7765000140938718700000055430258  session.10dbde7765000142073356500000315430010&#xA;auto-save-list  elpa            session.10dbde7765000141759448100000009970011  tramp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong, if anything?&lt;/p&gt;&#xA;" OwnerUserId="100" LastActivityDate="2015-03-07T11:33:25.420" Title="Warning message about load-path." Tags="|load-path|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9878" PostTypeId="2" ParentId="9877" CreationDate="2015-03-07T11:33:25.420" Score="13" Body="&lt;p&gt;So when you read this warning message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): Your `load-path' seems to contain&#xA;your `.emacs.d' directory: ~/.emacs.d/&#xA;This is likely to cause problems...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;and&lt;/em&gt; note that you have the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;hopefully you can recognise that this is &lt;em&gt;exactly&lt;/em&gt; what the warning was referring to?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to follow the recommendation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Consider using a subdirectory instead, e.g.: /home/faheem/.emacs.d/lisp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;by changing that line in your init file to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/lisp&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then create that sub-directory: &lt;code&gt;mkdir ~/.emacs.d/lisp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and finally take any elisp libraries (excluding your init file) that you yourself placed directly in &lt;code&gt;~/.emacs.d/&lt;/code&gt;, and move them into the new &lt;code&gt;lisp&lt;/code&gt; sub-directory (in this case it looks like &lt;code&gt;edit-server.el&lt;/code&gt; is the only file you need to move).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(and of course in future, you would add custom elisp libraries into that &lt;code&gt;lisp&lt;/code&gt; directory, instead of putting them in &lt;code&gt;~/.emacs.d&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-03-07T11:33:25.420" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="9880" PostTypeId="2" ParentId="9871" CreationDate="2015-03-07T19:09:48.010" Score="1" Body="&lt;p&gt;No, it doesn't look that it's possible without some hacking.  The function &lt;code&gt;term-handle-ansi-escape&lt;/code&gt; in &lt;code&gt;term.el&lt;/code&gt; doesn't have a case for &lt;code&gt;ESC [ G&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-03-07T19:09:48.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9881" PostTypeId="1" AcceptedAnswerId="9888" CreationDate="2015-03-07T20:44:44.830" Score="10" ViewCount="1114" Body="&lt;p&gt;In the Emacs Lisp documentation, I often come across quoted symbols like &lt;code&gt;`buffer-file-name'&lt;/code&gt; inside docstrings. The intersting thing here is the style of quoting, by surrounding the symbol name with a backtick and a quote. I was curious where this style came from. According to &lt;a href=&quot;https://english.stackexchange.com/a/18669/41598&quot;&gt;this answer&lt;/a&gt; it could be related to a limited character set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing to notice is that these quoted symbols have syntax highlighting in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, whereas symbols quoted with only single quotes, for example, 'buffer-file-name', does not get any syntax highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this indicates that the backtick-quote syntax has to be a well-known convention in Emacs. But after googling the documentation, I could not find it mentioned anywhere.&#xA;In the Emacs Lisp manual there is a section named &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html&quot; rel=&quot;noreferrer&quot;&gt;&quot;Tips for Documentation Strings&quot;&lt;/a&gt;; it says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When a documentation string refers to a Lisp symbol, write it as it&#xA;  would be printed (which usually means in lower case), with&#xA;  single-quotes around it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but it does not mention the style of quoting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;C-h f thing-at-point RET&lt;/code&gt; and then click the link to the source code to see some more examples of the quoting style:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(defun thing-at-point (thing &amp;amp;optional no-properties)   &quot;Return the&lt;br&gt;&#xA;  THING at point. THING should be a symbol specifying a type of&lt;br&gt;&#xA;  syntactic entity. Possibilities include `symbol', `list', `sexp',&lt;br&gt;&#xA;  `defun', `filename', `url', `email', `word', `sentence', `whitespace',&lt;br&gt;&#xA;  `line', `number', and `page'.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When the optional argument NO-PROPERTIES is non-nil, strip text&lt;br&gt;&#xA;  properties from the return value.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See the file `thingatpt.el' for documentation on how to define a&lt;br&gt;&#xA;  symbol as a valid THING.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So all this gives an indication that one should use the backtick-quote style to quote symbols, but is this style documented anywhere?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="-1" LastEditDate="2017-04-13T12:38:16.317" LastActivityDate="2015-03-08T04:49:10.373" Title="How to quote symbols in a documentation string?" Tags="|documentation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9882" PostTypeId="1" AcceptedAnswerId="9896" CreationDate="2015-03-08T00:14:50.100" Score="2" ViewCount="252" Body="&lt;p&gt;The documentation for the &lt;code&gt;'cursor&lt;/code&gt; overlay property does not discuss methods for altering the type of cursor that is used when point is on a particular overlay:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html&lt;/a&gt;  The default overlay cursor type is &lt;code&gt;hollow&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for a user to select the type of cursor that is displayed when point is on a particular overlay?  E.g., &lt;code&gt;box&lt;/code&gt;; &lt;code&gt;bar&lt;/code&gt;; &lt;code&gt;(bar . [WIDTH])&lt;/code&gt;; &lt;code&gt;hbar&lt;/code&gt;; &lt;code&gt;(hbar . [WIDTH])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example creates an overlay using an xpm image at the end of the current line, which requires an Emacs version that supports xpm images.  The test was performed with a default Emacs installation -- i.e., a white buffer background and a black cursor color -- the hollow cursor outline can be easily seen in this example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((xpm--pilcrow&#xA;       (propertize &quot; &quot; 'cursor t 'display&#xA;         `(image :type xpm :mask nil :ascent center :data&#xA;         &quot;/* XPM */&#xA;         static char * pilcrow_plain_xpm[] = {&#xA;         \&quot;11 20 2 1\&quot;,&#xA;         \&quot;. c white\&quot;,&#xA;         \&quot;+ c cyan\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...++++++..\&quot;,&#xA;         \&quot;..++++.+...\&quot;,&#xA;         \&quot;..++++.+...\&quot;,&#xA;         \&quot;..++++.+...\&quot;,&#xA;         \&quot;...+++.+...\&quot;,&#xA;         \&quot;.....+.+...\&quot;,&#xA;         \&quot;.....+.+...\&quot;,&#xA;         \&quot;.....+.+...\&quot;,&#xA;         \&quot;.....+.+...\&quot;,&#xA;         \&quot;.....+.+...\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;,&#xA;         \&quot;...........\&quot;};&quot;))))&#xA;  (overlay-put (make-overlay (point-at-eol) (point-at-eol)) 'after-string xpm--pilcrow))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-03-08T03:37:27.303" LastActivityDate="2015-03-08T16:20:57.807" Title="Selecting the cursor type when using an overlay 'cursor property" Tags="|overlays|cursor|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9883" PostTypeId="1" AcceptedAnswerId="9911" CreationDate="2015-03-08T00:33:30.167" Score="6" ViewCount="551" Body="&lt;p&gt;I currently have this in my init file &lt;code&gt;(key-chord-define-global &quot;xf&quot; 'find-file)&lt;/code&gt;. Actually, &lt;code&gt;xf&lt;/code&gt; and &lt;code&gt;fx&lt;/code&gt; will trigger the &lt;code&gt;find-file&lt;/code&gt; function. In fact, whatever the keychord I defined, it works whatever the order in which keys are pressed. So, just want to know if this is a normal behaviour, and if there is there a way to avoid &lt;code&gt;fx&lt;/code&gt; to be considered as a keychord.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="25" LastEditDate="2015-03-08T20:15:30.353" LastActivityDate="2015-03-09T19:08:53.003" Title="Non-symmetric keychord" Tags="|key-bindings|key-chord-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9884" PostTypeId="1" AcceptedAnswerId="9886" CreationDate="2015-03-08T01:04:06.060" Score="5" ViewCount="1538" Body="&lt;p&gt;How do I turn off fringes in text-mode? The closest I've gotten is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook&#xA;          (lambda ()&#xA;            (set-fringe-mode '(0 . 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that turns off fringes permanently for all buffers after I've visited a text buffer once.&lt;/p&gt;&#xA;" OwnerUserId="5341" LastActivityDate="2015-03-08T02:20:01.447" Title="Turn off fringes in text-mode" Tags="|minor-mode|text|fringe|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9885" PostTypeId="1" AcceptedAnswerId="9904" CreationDate="2015-03-08T01:21:17.147" Score="5" ViewCount="358" Body="&lt;p&gt;Is there a way to get more formatting options from a gnus message buffer when composing a mail? I'd like to do hyperlinks of the style common in markdown or org-mode, viz:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[example link][http://www.example.com]]&#xA;[example link](http://www.example.com)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similarly, I'm wondering if there's a way to enable more &quot;fancy&quot; options such as bullet points, blockquotes, etc. I found &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=lisp/org-gnus.el;hb=HEAD&quot; rel=&quot;noreferrer&quot;&gt;org-gnus.el&lt;/a&gt;, but I'm too much of a newbie to understand what it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Steven&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2274" LastEditDate="2015-03-08T02:10:57.797" LastActivityDate="2019-06-15T17:24:57.657" Title="gnus &quot;fancy&quot; hyperlinks, bullet points, etc" Tags="|gnus|message|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9886" PostTypeId="2" ParentId="9884" CreationDate="2015-03-08T02:20:01.447" Score="7" Body="&lt;p&gt;The documentation offers a couple of options:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Size_002fPos.html&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Size_002fPos.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the options mentioned uses buffer-local variables -- i.e., &lt;code&gt;left-window-fringe&lt;/code&gt; and &lt;code&gt;right-window-fringe&lt;/code&gt;.  However, the documentation discusses some exceptions when those settings will not take effect immediately.  The following example uses a value of &lt;code&gt;0&lt;/code&gt; for the width.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq left-fringe-width 0)&#xA;&#xA;(setq right-fringe-width 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another method described in the documentation uses the function &lt;code&gt;set-window-fringes&lt;/code&gt; -- e.g., &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-window-fringes (selected-window) 0 0 nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The latter example will take effect immediately when evaluating it in a window that is already displayed.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-03-08T02:20:01.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9887" PostTypeId="1" AcceptedAnswerId="9903" CreationDate="2015-03-08T03:18:09.627" Score="0" ViewCount="129" Body="&lt;p&gt;I want to define a configurable variable in Emacs, but make it can be used in Ruby code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The situation is like here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/zenspider/enhanced-ruby-mode/pull/68&quot; rel=&quot;nofollow&quot;&gt;https://github.com/zenspider/enhanced-ruby-mode/pull/68&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I copy the content to here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is the elisp code that want to define a emacs variable to config the ruby indent for access modifiers (private, public, protected).&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom enh-ruby-outdent-access-modifiers nil&#xA;  &quot;*Outdent public/protected/private modifiers if this is non-nil.&quot;&#xA;  :type 'boolean :group 'enh-ruby)&#xA;  (put 'enh-ruby-outdent-access-modifiers 'safe-local-variable 'booleanp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here is the ruby code.&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;when :period then&#xA;  add :ident, tok&#xA;else&#xA;  + indent :s if %w(private protected public).include? tok&#xA;  if @ermbuffer.extra_keywords.include? tok then&#xA;    add :kw, tok&#xA;  else&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2015-03-08T16:10:56.297" LastActivityDate="2015-03-09T13:24:22.787" Title="How to define a configurable variable in Elisp to be used in other program like Ruby?" Tags="|elisp|ruby|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="9888" PostTypeId="2" ParentId="9881" CreationDate="2015-03-08T04:49:10.373" Score="13" Body="&lt;p&gt;The convention is documented in the section you already referenced (Tips for Documentation Strings). The purpose of the quotes is mentioned, and examples are provided:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Help mode automatically creates a hyperlink when a documentation&#xA; string uses a symbol name inside single quotes ... For example, if&#xA; you write&#xA;&#xA;      This function sets the variable `buffer-file-name'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It sounds like the thing you are curious about is why &lt;code&gt;single quotes&lt;/code&gt; in this context really means &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`this' &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'this'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This representation of left and right quote characters using the ASCII backtick (grave accent) and single quote (apostrophe) appears to have been a common UNIX convention at one point, and as such I suspect it wasn't worth explaining further when the Emacs manual was written. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html&quot;&gt;this post&lt;/a&gt;, the old X Window System fonts and term fonts made these symbols look more like true quotes.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-03-08T04:49:10.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9889" PostTypeId="2" ParentId="9885" CreationDate="2015-03-08T07:00:38.237" Score="4" Body="&lt;p&gt;I located a package called &lt;a href=&quot;https://github.com/jwiegley/muse/blob/master/experimental/muse-message.el&quot; rel=&quot;nofollow&quot;&gt;muse-message&lt;/a&gt;, which does exactly what I was hoping for. I have not ever used &lt;a href=&quot;https://www.gnu.org/software/emacs-muse/&quot; rel=&quot;nofollow&quot;&gt;Muse&lt;/a&gt;, but it's a markup system similar to markdown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Muse-message allows for using Muse markup, and then &lt;code&gt;M-x muse-message-markup&lt;/code&gt; turns the message buffer into a multipart MIME message with an HTML component.&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2015-03-08T07:00:38.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9890" PostTypeId="1" AcceptedAnswerId="9891" CreationDate="2015-03-08T11:03:01.933" Score="6" ViewCount="4851" Body="&lt;p&gt;I'm trying to setup &lt;a href=&quot;https://github.com/dgutov/robe&quot; rel=&quot;noreferrer&quot;&gt;robe&lt;/a&gt; for Rails development. It needs &lt;a href=&quot;http://company-mode.github.io/&quot; rel=&quot;noreferrer&quot;&gt;company mode&lt;/a&gt;&#xA;and I have some issues with it:&#xA;Have following in &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; robe, documentation lookup and completion for Ruby&#xA;(require 'robe)&#xA;(add-hook 'ruby-mode-hook 'robe-mode)&#xA;(add-to-list 'load-path &quot;./elpa/company-20150306.1548/&quot;)&#xA;(autoload 'company-mode &quot;company&quot; nil t)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;(push 'company-robe company-backends)&#xA;;; end robe setup&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It raises:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's value as variable is void: company-backends&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Full error trace is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable company-backends)&#xA;  (cons (quote company-robe) company-backends)&#xA;  (setq company-backends (cons (quote company-robe) company-backends))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/me/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 3073&#xA;  load-with-code-conversion(&quot;/home/me/.emacs.d/init.el&quot; &quot;/home/me/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/me/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\262 \306=\203\307\310Q\202; \311=\204\307\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB\321\202;\316\322\323\322\211#\210\322=\203a\324\325\326\307\327Q!\&quot;\323\322\211#\210\322=\203`\210\203\243\330!\331\232\203\243\332!\211\333P\334!\203}\211\202\210\334!\203\207\202\210\314\262\203\241\335\&quot;\203\237\336\337#\210\340\341!\210\266\f?\205\260\314\323\342\322\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; (initialization &quot;`_emacs' init file is deprecated, please use `.emacs'&quot;) &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7 &quot;\n\n(fn)&quot;]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm newbie in Emacs world and I can't figure out why &lt;code&gt;company-backends&lt;/code&gt; is void?&#xA;I doubt that somewhere it is not set and I should set it to myself but I can't find the way to do this.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Edit&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs version is &lt;code&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian&lt;/code&gt; on &lt;code&gt;Ubuntu 14.04.1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6551" LastEditorUserId="6551" LastEditDate="2015-03-08T23:34:39.447" LastActivityDate="2015-03-08T23:34:39.447" Title="Symbol's value as variable is void: company-backends" Tags="|init-file|company-mode|ruby-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9891" PostTypeId="2" ParentId="9890" CreationDate="2015-03-08T11:15:07.383" Score="17" Body="&lt;p&gt;You've configured company-mode to load after your init file is evaluated using the &lt;code&gt;after-init-hook&lt;/code&gt;, but are then trying to modify &lt;code&gt;company-backends&lt;/code&gt; right away. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That variable isn't defined until company-mode is loaded. You either need to just &lt;code&gt;require&lt;/code&gt; company, or defer setting that variable using &lt;code&gt;eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'company&#xA;    '(push 'company-robe company-backends)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another option would be to modify the company backends in a mode hook for robe or ruby. That approach would allow you to set different company backends for different modes. For example, this will use only the robe backend in ruby mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ruby-mode-hook&#xA;        (lambda ()&#xA;          (setq-local company-backends '((company-robe)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-08T11:35:26.627" LastActivityDate="2015-03-08T11:35:26.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9892" PostTypeId="2" ParentId="9883" CreationDate="2015-03-08T12:12:22.173" Score="5" Body="&lt;p&gt;To get help with a function in emacs, type &lt;code&gt;C-h f &amp;lt;function name&amp;gt;&lt;/code&gt;. In your case, e.g. &lt;code&gt;key-chord-mode&lt;/code&gt;. This doesn't give you much info regarding your specific question, but the help buffer will contain a link to the file where the function is defined, in this case &lt;code&gt;key-chord.el&lt;/code&gt;. In this file there is documentation in the comments at the beginning of the file, containing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ########   Terminology   ########################################&#xA;;;&#xA;;; In this package, a &quot;key chord&quot; is two keys pressed simultaneously,&#xA;;; or a single key quickly pressed twice.&#xA;;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And further down:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ########   Tips   ########################################&#xA;;;&#xA;...&#xA;;; Grep your own texts to verify that a combination is unusual.&#xA;;; And don't forget to check both permutations: &quot;fg&quot; and &quot;gf&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2688" LastActivityDate="2015-03-08T12:12:22.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9893" PostTypeId="1" AcceptedAnswerId="9894" CreationDate="2015-03-08T14:31:12.610" Score="5" ViewCount="1008" Body="&lt;p&gt;I'm trying to set up a buffer-local behavior so that optionally, only after I execute the babel section, Org exports to LaTeX asynchronously after each save. I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kdm/org-save-and-export ()&#xA;  (interactive)&#xA;  (org-latex-export-to-latex t))&#xA;&#xA;(add-hook 'after-save-hook 'kdm/org-save-and-export)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it creates &lt;code&gt;file.tex.tex.tex.tex&lt;/code&gt; indefinitely. How do I modify this to only save 1x, and be a buffer-local change?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2019-09-01T15:04:43.273" Title="How can I export to LaTeX every time I save an Org mode buffer?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9894" PostTypeId="2" ParentId="9893" CreationDate="2015-03-08T14:47:17.217" Score="7" Body="&lt;p&gt;Probably, Emacs is creating a &lt;code&gt;file.tex&lt;/code&gt; buffer and then saving it, triggering the &lt;code&gt;after-save-hook&lt;/code&gt; again indefinitely.  Try checking &lt;code&gt;major-mode&lt;/code&gt; before calling the export function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kdm/org-save-and-export ()&#xA;  (interactive)&#xA;  (if (eq major-mode 'org-mode)&#xA;    (org-latex-export-to-latex)))&#xA;&#xA;(add-hook 'after-save-hook 'kdm/org-save-and-export nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="91" LastEditDate="2015-03-08T16:07:48.113" LastActivityDate="2015-03-08T16:07:48.113" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9895" PostTypeId="1" AcceptedAnswerId="10026" CreationDate="2015-03-08T15:16:26.030" Score="0" ViewCount="415" Body="&lt;p&gt;This bug currently prevents me switching to 24.4:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bitbucket.org/lyro/evil/issue/437/m-x-is-undefined-in-emacs-244&quot; rel=&quot;nofollow&quot;&gt;https://bitbucket.org/lyro/evil/issue/437/m-x-is-undefined-in-emacs-244&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a workaround to make both evil and M-x work in 24.4?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-03-14T21:33:51.010" Title="How to use evil in emacs 24.4?" Tags="|emacs24.4|evil|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9896" PostTypeId="2" ParentId="9882" CreationDate="2015-03-08T16:20:57.807" Score="0" Body="&lt;p&gt;The following is a &lt;em&gt;partial&lt;/em&gt; workaround to prevent the hollow outline around the primary xpm; and, it serves to create the visual appearance of a cursor-type &lt;code&gt;'bar&lt;/code&gt;.  It is achieved by creating an xpm image that is one (1) pixel in width and whatever the chosen height happens to be (in this example 20 pixels high).  The color of the one-pixel wide image should match the buffer background -- this effectively creates a very thin xpm image that is invisible because it blends in with the buffer's background.  The result is a visual vertical bar when the cursor touches it and it works with a blinking cursor.  The concatenated xpm does not get a hollow cursor.  This example reduces the concatenated image by one (1) pixel in width to compensate for the new xpm that is added to the left.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* (&#xA;    (xpm--cursor-vbar&#xA;      (propertize &quot; &quot; 'cursor t 'display&#xA;        `(image :type xpm :mask nil :ascent center :data&#xA;        &quot;/* XPM */&#xA;        static char * cursor_vbar_xpm[] = {&#xA;        \&quot;1 20 1 1\&quot;,&#xA;        \&quot;+ c white\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;,&#xA;        \&quot;+\&quot;};&quot;)))&#xA;    (xpm--pilcrow&#xA;      (propertize &quot; &quot; 'cursor t 'display&#xA;        `(image :type xpm :mask nil :ascent center :data&#xA;        &quot;/* XPM */&#xA;        static char * pilcrow_plain_xpm[] = {&#xA;        \&quot;10 20 2 1\&quot;,&#xA;        \&quot;. c white\&quot;,&#xA;        \&quot;+ c cyan\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..++++++..\&quot;,&#xA;        \&quot;.++++.+...\&quot;,&#xA;        \&quot;.++++.+...\&quot;,&#xA;        \&quot;.++++.+...\&quot;,&#xA;        \&quot;..+++.+...\&quot;,&#xA;        \&quot;....+.+...\&quot;,&#xA;        \&quot;....+.+...\&quot;,&#xA;        \&quot;....+.+...\&quot;,&#xA;        \&quot;....+.+...\&quot;,&#xA;        \&quot;....+.+...\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;,&#xA;        \&quot;..........\&quot;};&quot;))) )&#xA;  (overlay-put (make-overlay (point-at-eol) (point-at-eol)) 'after-string&#xA;    (concat xpm--cursor-vbar xpm--pilcrow)) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-03-08T16:20:57.807" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9897" PostTypeId="1" AcceptedAnswerId="10019" CreationDate="2015-03-08T16:48:05.260" Score="2" ViewCount="912" Body="&lt;p&gt;I am working with python code, and I would like to be able to evaluate it in an emacs buffer, rather than using another terminal window. I am working with the &lt;code&gt;python-mode&lt;/code&gt; from &lt;code&gt;python.el&lt;/code&gt;, bundled with emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works just fine with emacs 24.3 on two different computers (windows and linux). However, I cannot get it to work on a 4rd computer with emacs 24.4: after spawning the buffer, it only shows completion candidates for an empty string (even though I didn't ask for any completion), and if I send a string, be it from a &lt;code&gt;python-mode&lt;/code&gt; buffer or directly in the &lt;code&gt;comint&lt;/code&gt; buffer, it just shows this list of completions again, and not the result of the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's even more troubling is that according to google results, I am the only one with this issue, yet it is out-of-the-box experience!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some screenshots with &lt;code&gt;emacs -Q&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom of the output:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/rGnCw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Top of the output:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/PjiC9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using emacs 24.4.1 on linux, and the problem appears with both python 2.7.9 and python 3.4.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any clue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1&lt;/strong&gt; Thanks to Ista's answer, I was able to check that there is nothing different in my &lt;code&gt;*Messages*&lt;/code&gt; or in the content of variables &lt;code&gt;python-shell-interpreter&lt;/code&gt;, &lt;code&gt;python-shell-interpreter-args&lt;/code&gt;, &lt;code&gt;python-shell-completion-setup-code&lt;/code&gt;, &lt;code&gt;python-ffap-setup-code&lt;/code&gt; or &lt;code&gt;python-eldoc-setup-code&lt;/code&gt; when compared to a working setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt; Thanks to a comment by Ista, I tried with a new user, and the problem didn't appear! I have tried restoring various settings to default (notably desktop-wide shortcuts), but without success for now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 3&lt;/strong&gt; I also tried with the &lt;code&gt;ipython&lt;/code&gt; interpreter, the result is the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 4&lt;/strong&gt; I tried starting &lt;code&gt;python&lt;/code&gt; from &lt;code&gt;eshell&lt;/code&gt;, &lt;code&gt;shell&lt;/code&gt; and &lt;code&gt;term&lt;/code&gt; (&lt;code&gt;line-mode&lt;/code&gt;), it has the same problem: when I enter &lt;code&gt;2+2;&lt;/code&gt; and press &lt;code&gt;RET&lt;/code&gt;, I see a list of completions instead of &lt;code&gt;4&lt;/code&gt;. &lt;code&gt;term&lt;/code&gt; with &lt;code&gt;char-mode&lt;/code&gt; works fine.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Overall, it looks like emacs sends a &lt;code&gt;&amp;lt;TAB&amp;gt;&lt;/code&gt; to the inferior process whenever it tries to interact with it.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-03-14T12:09:20.363" LastActivityDate="2015-03-14T12:59:53.077" Title="Python interactive buffer showing completions of the empty string instead of regular output" Tags="|python|comint|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9898" PostTypeId="2" ParentId="9883" CreationDate="2015-03-08T18:40:51.113" Score="7" Body="&lt;p&gt;As mentioned in the comments, you may be able to achieve what you want using a different package like &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;noreferrer&quot;&gt;hydra&lt;/a&gt;. Here is an example that binds &lt;code&gt;find-file&lt;/code&gt; to the key sequence &lt;code&gt;x f&lt;/code&gt; with no modifiers. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'hydra)&#xA;&#xA;(defun x-hydra-pre ()&#xA;  (insert &quot;x&quot;)&#xA;  (hydra-timeout 0.5))&#xA;&#xA;(defhydra x-hydra (:body-pre x-hydra-pre&#xA;                   :color blue&#xA;                   :hint nil)&#xA;  (&quot;f&quot; (progn (zap-to-char -1 ?x) (ido-find-file))))&#xA;&#xA;(global-set-key &quot;x&quot; #'x-hydra/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this configuration, the key sequence &lt;kbd&gt;x&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; (with no modifiers) will call &lt;code&gt;ido-find-file&lt;/code&gt;. Typing an x followed by anything else will behave normally, and if you really need to type &quot;xf&quot; you can hit &lt;kbd&gt;x&lt;/kbd&gt; and wait half a second for the hydra to time out before hitting the &lt;kbd&gt;f&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what's happening here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;x&lt;/kbd&gt; is globally bound to enable a hydra, which sets up a temporary key map.&lt;/li&gt;&#xA;&lt;li&gt;The hydra has a &lt;code&gt;:body-pre&lt;/code&gt; hook which runs when the hydra body is invoked. In this case it inserts an &quot;x&quot; and starts a timeout timer.&lt;/li&gt;&#xA;&lt;li&gt;The hydra's temporary key map binds &lt;kbd&gt;f&lt;/kbd&gt; to delete the &quot;x&quot; that was just inserted and instead find a file.&lt;/li&gt;&#xA;&lt;li&gt;Any other key will exit the hydra and perform its normal action so you can just keep typing. &lt;/li&gt;&#xA;&lt;li&gt;When the 0.5 second timer elapses, the hydra exits so its temporary key bindings go away. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Note that at the time I tested this I had an error with hydra timeout support, but there is a fix available.)&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-09T13:39:32.810" LastActivityDate="2015-03-09T13:39:32.810" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="9899" PostTypeId="2" ParentId="9897" CreationDate="2015-03-08T19:26:00.210" Score="1" Body="&lt;p&gt;&lt;em&gt;Not an answer but posting here because it is too long for a comment.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That sounds very strange. Is there anything odd in your messages buffer after you start python? Here is what I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Making python-shell-interpreter local to *Python* while let-bound!&#xA;Making python-shell-interpreter-args local to *Python* while let-bound!&#xA;Sent python-shell-completion-setup-code&#xA;Sent python-ffap-setup-code&#xA;Sent python-eldoc-setup-code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and here are the contents of the mentioned variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python-shell-interpreter is a variable defined in `python.el'.&#xA;Its value is &quot;python&quot;&#xA;&#xA;python-shell-interpreter-args is a variable defined in `python.el'.&#xA;Its value is &quot;-i&quot;&#xA;&#xA;python-shell-completion-setup-code is a variable defined in `python.el'.&#xA;Its value is&#xA;&quot;try:&#xA;    import readline, rlcompleter&#xA;except ImportError:&#xA;    def __PYTHON_EL_get_completions(text):&#xA;        return []&#xA;else:&#xA;    def __PYTHON_EL_get_completions(text):&#xA;        completions = []&#xA;        try:&#xA;            splits = text.split()&#xA;            is_module = splits and splits[0] in ('from', 'import')&#xA;            is_ipython = getattr(&#xA;                __builtins__, '__IPYTHON__',&#xA;                getattr(__builtins__, '__IPYTHON__active', False))&#xA;            if is_module:&#xA;                from IPython.core.completerlib import module_completion&#xA;                completions = module_completion(text.strip())&#xA;            elif is_ipython and getattr(__builtins__, '__IP', None):&#xA;                completions = __IP.complete(text)&#xA;            elif is_ipython and getattr(__builtins__, 'get_ipython', None):&#xA;                completions = get_ipython().Completer.all_completions(text)&#xA;            else:&#xA;                i = 0&#xA;                while True:&#xA;                    res = readline.get_completer()(text, i)&#xA;                    if not res:&#xA;                        break&#xA;                    i += 1&#xA;                    completions.append(res)&#xA;        except:&#xA;            pass&#xA;        return completions&quot;&#xA;python-ffap-setup-code is a variable defined in `python.el'.&#xA;Its value is&#xA;&quot;def __FFAP_get_module_path(module):&#xA;    try:&#xA;        import os&#xA;        path = __import__(module).__file__&#xA;        if path[-4:] == '.pyc' and os.path.exists(path[0:-1]):&#xA;            path = path[:-1]&#xA;        return path&#xA;    except:&#xA;        return ''&quot;&#xA;&#xA;python-eldoc-setup-code is a variable defined in `python.el'.&#xA;Its value is&#xA;&quot;def __PYDOC_get_help(obj):&#xA;    try:&#xA;        import inspect&#xA;        if hasattr(obj, 'startswith'):&#xA;            obj = eval(obj, globals())&#xA;        doc = inspect.getdoc(obj)&#xA;        if not doc and callable(obj):&#xA;            target = None&#xA;            if inspect.isclass(obj) and hasattr(obj, '__init__'):&#xA;                target = obj.__init__&#xA;                objtype = 'class'&#xA;            else:&#xA;                target = obj&#xA;                objtype = 'def'&#xA;            if target:&#xA;                args = inspect.formatargspec(&#xA;                    *inspect.getargspec(target)&#xA;                )&#xA;                name = obj.__name__&#xA;                doc = '{objtype} {name}{args}'.format(&#xA;                    objtype=objtype, name=name, args=args&#xA;                )&#xA;        else:&#xA;            doc = doc.splitlines()[0]&#xA;    except:&#xA;        doc = ''&#xA;    try:&#xA;        exec('print doc')&#xA;    except SyntaxError:&#xA;        print(doc)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Perhaps you can spot a difference between my settings and yours that might be causing the issue (these are the settings I have when starting with &lt;code&gt;emacs -Q)&lt;/code&gt;. You may also try running the code defined in &lt;code&gt;python-shell-completion-setup-code&lt;/code&gt;, &lt;code&gt;python-ffap-setup-code&lt;/code&gt; and &lt;code&gt;python-eldoc-setup-code&lt;/code&gt; in python to see if they do something unexpected. Maybe you redefined one of the python functions called by them?&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2015-03-08T19:26:00.210" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9900" PostTypeId="1" AcceptedAnswerId="9902" CreationDate="2015-03-08T21:54:13.313" Score="1" ViewCount="307" Body="&lt;p&gt;If I type &lt;code&gt;C-f paredit-forward-slurp-sexp&lt;/code&gt;, Emacs tells me the command is mapped to &lt;code&gt;C-)&lt;/code&gt;. Yet through &lt;code&gt;C-h k&lt;/code&gt; I realized that both &lt;code&gt;C-)&lt;/code&gt; and &lt;code&gt;)&lt;/code&gt; run &lt;code&gt;evil-forward-sentence&lt;/code&gt;. If I do &lt;code&gt;C-f evil-forward-sentence&lt;/code&gt;, Emacs tells me it is bound only to &lt;code&gt;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I evaluate &lt;code&gt;(key-binding (kbd &quot;C-)&quot;))&lt;/code&gt; the result is &lt;code&gt;paredit-forward-slurp-sexp&lt;/code&gt;. If I go through what &lt;code&gt;describe-bindings&lt;/code&gt; prints, C-) is shown as associated with &lt;code&gt;paredit-forward-slurp-sexp&lt;/code&gt;, There are other paredit associations in the listing, like &lt;code&gt;M-&amp;lt;right arrow&amp;gt;&lt;/code&gt;, which works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this and how do I make the &lt;code&gt;C-)&lt;/code&gt; behave the way I want.&lt;/p&gt;&#xA;" OwnerUserId="6722" LastEditorUserId="6722" LastEditDate="2015-03-12T14:58:27.063" LastActivityDate="2017-10-16T10:38:34.683" Title="In terminal, C-) and ) both execute evil-forward-sentence. I want C-) to run paredit-forward-slurp-sexp" Tags="|key-bindings|evil|terminal-emacs|paredit|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9902" PostTypeId="2" ParentId="9900" CreationDate="2015-03-09T01:18:05.317" Score="4" Body="&lt;p&gt;Evil keymaps override the default global keymaps. To learn more, you may want to read:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keymaps.html&quot; rel=&quot;nofollow&quot;&gt;The Emacs manual on keymaps&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.masteringemacs.org/article/mastering-key-bindings-emacs&quot; rel=&quot;nofollow&quot;&gt;Mastering Emacs Key Bindings&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to override Evil keys, you'd need to do so to the Evil keymaps themselves:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;C-)&quot;) #'paredit-forward-slurp-sexp)&#xA;(define-key evil-normal-state-map (kbd &quot;C-)&quot;) #'paredit-forward-slurp-sexp)&#xA;(define-key evil-emacs-state-map (kbd &quot;C-)&quot;) #'paredit-forward-slurp-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-03-09T01:18:05.317" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9903" PostTypeId="2" ParentId="9887" CreationDate="2015-03-09T11:01:34.763" Score="3" Body="&lt;p&gt;The two main options are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Pass the value as an argument, or via standard input. Take a look at how &lt;code&gt;erm-ruby-get-process&lt;/code&gt; passes through the value of &lt;code&gt;enh-ruby-extra-keywords&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use an environment variable or several, and set them where you're calling the Ruby process. Maybe let-bind &lt;code&gt;process-environment&lt;/code&gt; to itself around that code so it's unchanged in the end (not necessary), and then use &lt;code&gt;setenv&lt;/code&gt; before the process call. All that could be done in the same function, &lt;code&gt;erm-ruby-get-process&lt;/code&gt;. Then the Ruby code has to fetch the value from &lt;code&gt;ENV&lt;/code&gt;, and parse it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="124" LastEditorUserId="124" LastEditDate="2015-03-09T13:24:22.787" LastActivityDate="2015-03-09T13:24:22.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9904" PostTypeId="2" ParentId="9885" CreationDate="2015-03-09T11:51:42.890" Score="6" Body="&lt;p&gt;Maybe &lt;a href=&quot;https://orgmode.org/worg/org-contrib/org-mime.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-mime.el&lt;/code&gt;&lt;/a&gt; by &lt;strong&gt;Eric Schulte&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; WYSWYG, html mime composition using org-mode&#xA;;;&#xA;;; For mail composed using the orgstruct-mode minor mode, this&#xA;;; provides a function for converting all or part of your mail buffer&#xA;;; to embedded html as exported by org-mode.  Call `org-mime-htmlize'&#xA;;; in a message buffer to convert either the active region or the&#xA;;; entire buffer to html.&#xA;;;&#xA;;; Similarly the `org-mime-org-buffer-htmlize' function can be called&#xA;;; from within an org-mode buffer to convert the buffer to html, and&#xA;;; package the results into an email handling with appropriate MIME&#xA;;; encoding.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="23745" LastEditDate="2019-06-15T17:24:57.657" LastActivityDate="2019-06-15T17:24:57.657" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="9906" PostTypeId="1" AcceptedAnswerId="9907" CreationDate="2015-03-09T14:16:19.383" Score="3" ViewCount="905" Body="&lt;p&gt;I mistakenly ran a keyboard macro with an Infinite Argument, which made the macro execute endlessly. Take the following example, which just inserts the character &lt;code&gt;a&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x ( a C-x )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I then run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u 0 C-x e&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the &lt;code&gt;*scratch*&lt;/code&gt; buffer, the newly defined keyboard macro will be executed over and over again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;C-g&lt;/code&gt; several times, as well as &lt;code&gt;ESC-ESC-ESC&lt;/code&gt;, but the execution did not stop, and I had to kill Emacs, as it was not responding. Is there any way to halt the execution of a macro without losing the Emacs session?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case it makes a difference, the Emacs version I tried is 24.3.1.&lt;/p&gt;&#xA;" OwnerUserId="6726" LastActivityDate="2015-03-09T15:28:26.200" Title="How to stop execution of keyboard macro?" Tags="|keyboard-macros|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9907" PostTypeId="2" ParentId="9906" CreationDate="2015-03-09T15:28:26.200" Score="3" Body="&lt;p&gt;&lt;code&gt;C-g&lt;/code&gt; works for me, starting from &lt;code&gt;emacs -Q&lt;/code&gt; (no init file). I did that with both Emacs 24.3 and a recent development snapshot for Emacs 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can give a recipe to reproduce what you see, starting from &lt;code&gt;emacs -Q&lt;/code&gt;, consider sending a bug report: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-09T15:28:26.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9908" PostTypeId="1" CreationDate="2015-03-09T15:49:50.043" Score="49" ViewCount="17846" Body="&lt;p&gt;Can I make my cursor in a buffer jump back to its last position? (preferrably without having to mark the previous position)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, C-a jumps to the beginning of the current line, can I jump back to where it was before?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when C-x C-f to open a file in a different directory, i want to jump back to the previous position in the path name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2022-07-06T22:32:37.810" Title="Can cursor jump back to the previous position?" Tags="|cursor|" AnswerCount="6" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9909" PostTypeId="1" CreationDate="2015-03-09T16:59:31.927" Score="5" ViewCount="222" Body="&lt;p&gt;How do I pass the bibtex2html option -nobibsource when publishing via ox-bibtex.el? I have added it directly to the ox-bibtex.el file by commentling out line 265 and adding my own:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;'(&quot;-a&quot; &quot;-nodoc&quot; &quot;-noheader&quot; &quot;-nofooter&quot;)&#xA;'(&quot;-a&quot; &quot;-nodoc&quot; &quot;-noheader&quot; &quot;-nofooter&quot; &quot;-nobibsource&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm sure this isn't the right way to do it. I'm using org 8.3beta.&lt;/p&gt;&#xA;" OwnerUserId="6532" LastEditorUserId="2274" LastEditDate="2015-03-09T20:25:34.087" LastActivityDate="2015-03-10T10:19:45.237" Title="bibtex2html options in org-mode publishing" Tags="|org-mode|bibtex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9910" PostTypeId="2" ParentId="9908" CreationDate="2015-03-09T18:43:14.303" Score="51" Body="&lt;p&gt;Here are few &lt;em&gt;mark&lt;/em&gt;-related bindings that can help you:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-SPC&lt;/code&gt; - set mark and activate region (bound to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Setting-Mark.html#Setting-Mark&quot;&gt;&lt;code&gt;set-mark-command&lt;/code&gt;&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-SPC C-SPC&lt;/code&gt; - set mark (activates and then deactivates region)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-x&lt;/code&gt; - bound to &lt;code&gt;exchange-point-and-mark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u C-SPC&lt;/code&gt; - move to previous mark&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Check out the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Mark.html&quot;&gt;&lt;strong&gt;Mark documentation&lt;/strong&gt;&lt;/a&gt; for better understanding of this topic.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="221" LastEditDate="2015-03-09T23:31:06.880" LastActivityDate="2015-03-09T23:31:06.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9911" PostTypeId="2" ParentId="9883" CreationDate="2015-03-09T19:08:53.003" Score="8" Body="&lt;p&gt;If you look at the source for &lt;code&gt;key-chord.el&lt;/code&gt;, when you add a binding for &lt;code&gt;xf&lt;/code&gt; it is explicitly creating two bindings, one for &lt;code&gt;xf&lt;/code&gt; and one for &lt;code&gt;fx&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just because this is the standard doesn't mean you have to adhere to it. You can modify the code that does this to only do one binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll just need to take a line out of &lt;code&gt;key-chord-define&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the function, and the line to remove:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun key-chord-define (keymap keys command)&#xA;  (if (/= 2 (length keys))&#xA;      (error &quot;Key-chord keys must have two elements&quot;))&#xA;  (let ((key1 (logand 255 (aref keys 0)))&#xA;        (key2 (logand 255 (aref keys 1))))&#xA;    (if (eq key1 key2)&#xA;        (define-key keymap (vector 'key-chord key1 key2) command)&#xA;      (define-key keymap (vector 'key-chord key1 key2) command)&#xA;      ;; just remove this line:&#xA;      (define-key keymap (vector 'key-chord key2 key1) command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-03-09T19:08:53.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9912" PostTypeId="1" CreationDate="2015-03-09T21:06:16.427" Score="2" ViewCount="1582" Body="&lt;p&gt;Is there a way to get emacs with 256 colors in FbTerm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen some old posts on the topic but I haven't seen any confirmation that it will work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start FbTerm with this command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FBTERM=1 fbterm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... and with this in my .bashrc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ -n $FBTERM ] &amp;amp;&amp;amp; export TERM=fbterm &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(as described &lt;a href=&quot;http://homepages.see.leeds.ac.uk/~eeaol/notes/1995/01/tty-256/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... then I get 256 colors in fbterm (confirmed by running the perl script from &lt;a href=&quot;http://www.robmeerman.co.uk/unix/256colours&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) but I still only get 8 colors in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, I've tried &lt;a href=&quot;http://osdir.com/ml/general/2011-08/msg50175.html&quot; rel=&quot;nofollow&quot;&gt;this solution&lt;/a&gt; but with no succes.&lt;/p&gt;&#xA;" OwnerUserId="5341" LastEditorUserId="5341" LastEditDate="2015-03-10T00:26:48.797" LastActivityDate="2024-01-19T08:01:55.087" Title="256 colors in FbTerm" Tags="|terminal-emacs|colors|term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9913" PostTypeId="1" AcceptedAnswerId="9914" CreationDate="2015-03-09T23:08:12.997" Score="2" ViewCount="60" Body="&lt;p&gt;Is the following a bug or a feature?  If the former, how do I file?  If the latter, can someone explain the logic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the following content in my buffer (*scratch*), upon marking the inner rectangle consisting of &quot;FG&quot; and &quot;JK&quot; using C-return &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ABCD&#xA;EFGH&#xA;IJKL&#xA;MNOP&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Applying &lt;code&gt;downcase-region&lt;/code&gt; yields the following unexpected result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ABCD&#xA;Efgh&#xA;ijKL&#xA;MNOP&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect &quot;fg&quot; and &quot;jk&quot; to be downcased, and not &quot;fgh&quot; and &quot;ij&quot;.&lt;/p&gt;&#xA;" OwnerUserId="5154" LastActivityDate="2015-03-09T23:53:01.220" Title="Bug in downcase-region when using cua-set-rectangle-mark?" Tags="|rectangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9914" PostTypeId="2" ParentId="9913" CreationDate="2015-03-09T23:53:01.220" Score="1" Body="&lt;p&gt;That looks like a bug to me.  But it might be an enhancement request: have commands such as &lt;code&gt;downcase-region&lt;/code&gt; act on a rectangle region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either case, use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; to report it (you can use your own email client to send the info, if you like). The Emacs developers will let you know whether it is a bug or an enhancement request (or neither).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-09T23:53:01.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9915" PostTypeId="1" AcceptedAnswerId="9916" CreationDate="2015-03-10T03:51:17.957" Score="2" ViewCount="394" Body="&lt;p&gt;I’m trying to implement this when I press C-return:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If there’s an active region, it activates multiple cursors by calling&#xA;&lt;code&gt;mc/edit-lines&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;If there’s no active region, it initiates rectangular selection by&#xA;calling &lt;code&gt;cua-rectangle-mark-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here’s the code I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun cua-or-multicursor ()&#xA;  (interactive)&#xA;  (if (use-region-p)&#xA;      (progn&#xA;        (message &quot;Using multi cursor~~&quot;) ;; For debug&#xA;        (mc/edit-lines))&#xA;    (progn&#xA;      (message &quot;Using cua...&quot;) ;; For debug&#xA;      (cua-rectangle-mark-mode))))&#xA;&#xA;(global-set-key (kbd &quot;C-&amp;lt;return&amp;gt;&quot;) 'cua-or-multicursor)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The cua part of it seems to work appropriately.  The problem is the multiple cursors part.  I selected for example 2 lines (by setting the mark and moving down once), and pressed C-return, it prompted me whether I wanted to call &lt;code&gt;cua-rectangle-mark-mode&lt;/code&gt; for all lines. I said yes.  Then I started moving my cursors (it did give me 2 cursors), and I saw that the 2 cursors left a region behind them (which doesn’t happen if I just bind &lt;code&gt;mc/edit-lines&lt;/code&gt; to C-return), just like if I set the mark and then move my cursor.  Here’s what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zixic.png&quot; alt=&quot;Region behind multi cursor?&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the message buffer it said&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Mark set&#xA;Using multicursor~~&#xA;Using cua...&#xA;Mark set&#xA;C-?:help M-p:pad M-o:open M-c:close M-b:blank M-s:string M-f:fill M-i:incr M-n:seq&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems &lt;code&gt;cua-rectangle-mark-mode&lt;/code&gt; is called right after multiple cursors…  Any idea on why this would happen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW I have GNU Emacs 24.4.1 on a Mac.&lt;/p&gt;&#xA;" OwnerUserId="514" LastEditorUserId="514" LastEditDate="2015-03-10T04:44:35.270" LastActivityDate="2015-03-10T05:35:10.357" Title="Use multiple cursor if region is active, otherwise use CUA, how?" Tags="|rectangle|region|multiple-cursors|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9916" PostTypeId="2" ParentId="9915" CreationDate="2015-03-10T05:05:34.187" Score="2" Body="&lt;p&gt;You have likely chosen to activate your function &lt;code&gt;cua-or-multicursor&lt;/code&gt; for &lt;em&gt;all&lt;/em&gt; cursors -- probably by answering &lt;code&gt;yes&lt;/code&gt; the first time you used it -- that initial choice was stored in the &lt;code&gt;mc/list-file&lt;/code&gt;.  The default location for the &lt;code&gt;mc/list-file&lt;/code&gt; is &lt;code&gt;&quot;~/.emacs.d/.mc-lists.el&quot;&lt;/code&gt;.  [Be sure to back it up before editing or deleting it, just in case it has a lot of choices you have previously stored.]  You need to manually edit or delete the &lt;code&gt;mc/list-file&lt;/code&gt;, &lt;em&gt;and&lt;/em&gt; add your new function &lt;code&gt;cua-or-multicursor&lt;/code&gt; to the run only once &lt;strong&gt;list&lt;/strong&gt; of &lt;code&gt;multiple-cursors-core.el&lt;/code&gt; -- i.e., &lt;code&gt;mc--default-cmds-to-run-once&lt;/code&gt; (this is a list of many such functions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your function as written is just fine.  What is happening is that your function works correctly for the first cursor, but because you repeat the function for each subsequent cursor, the region is no longer active and that is why the &lt;em&gt;else&lt;/em&gt; statement of your function is activating.  Your function only needs to run once (&lt;em&gt;not&lt;/em&gt; for each cursor).&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-03-10T05:35:10.357" LastActivityDate="2015-03-10T05:35:10.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9917" PostTypeId="1" AcceptedAnswerId="9926" CreationDate="2015-03-10T09:24:10.663" Score="6" ViewCount="923" Body="&lt;p&gt;Due to various/extensive remappings I insert symbols with &lt;kbd&gt;Control&lt;/kbd&gt;+&lt;kbd&gt;key&lt;/kbd&gt;, for example &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;9&lt;/kbd&gt; inserts a left parenthesis &lt;code&gt;(&lt;/code&gt;. This works fine with the remappings and the insert/insert-commands, however, modes such as smartparens do not catch this. In my example hitting &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;9&lt;/kbd&gt; with spartparens should insert a pair of parentheses &lt;code&gt;()&lt;/code&gt; instead of a single one (which works using &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;9&lt;/kbd&gt;). I suspect that the problem is due to using &lt;code&gt;insert&lt;/code&gt;/&lt;code&gt;insert-char&lt;/code&gt; instead of &lt;code&gt;self-insert-command&lt;/code&gt; so the mode does not see/register the event. I wonder if anyone has any idea for a fix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This my setup code for reference, essentially a loop over a macro that sets up a global keybinding for &lt;code&gt;C-&lt;em&gt;[unshifted char]&lt;/em&gt;&lt;/code&gt; to &lt;code&gt;&lt;em&gt;[corresponding shifted char]&lt;/em&gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Bind Ctrl as shift for symbols.&#xA;(defun my-bind-symbols-to-crtl ()&#xA;  (interactive)&#xA;  (let ( (chars (split-string&#xA;                 &quot;~1234567890-=;']\\,./&quot; &quot;&quot;))&#xA;         (shifted-chars (split-string&#xA;                         &quot;`!@#$%^&amp;amp;*()_+:\&quot;}|&amp;lt;&amp;gt;?&quot; &quot;&quot;))&#xA;         (char &quot;&quot;) (shifted-char &quot;&quot;) )&#xA;    (while chars&#xA;      (setq char (pop chars))&#xA;      (setq shifted-char (pop shifted-chars))&#xA;      (when (&amp;gt; (length char) 0)&#xA;        (global-set-key (kbd (concat &quot;C-&quot; char)) (eval(macroexpand `(insert-key-macro ,shifted-char)))) ) )))&#xA;&#xA;(defmacro insert-key-macro (in)&#xA;  `(lambda () (interactive) (insert ,in)))&#xA;(my-bind-symbols-to-crtl)&#xA;(global-set-key (kbd &quot;H-[&quot;) (lambda () (interactive) (insert &quot;{&quot;)))&#xA;(define-key input-decode-map (kbd &quot;C-[&quot;) (kbd &quot;H-[&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user6729" LastEditorUserId="25" LastEditDate="2015-03-10T21:22:29.580" LastActivityDate="2018-08-10T20:55:48.607" Title="Mimic self-insert-command with insert/insert-char?" Tags="|key-bindings|keymap|insert|self-insert-command|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9918" PostTypeId="2" ParentId="9909" CreationDate="2015-03-10T10:19:45.237" Score="5" Body="&lt;pre&gt;&lt;code&gt;(setq bibtex2html-program &quot;/path/to/bibtex2html -nobibsource&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sorry for answering my own question.&lt;/p&gt;&#xA;" OwnerUserId="6532" LastActivityDate="2015-03-10T10:19:45.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9920" PostTypeId="1" AcceptedAnswerId="9959" CreationDate="2015-03-10T14:03:33.337" Score="3" ViewCount="445" Body="&lt;p&gt;There are many 'prediction' frameworks for emacs, I'm a bit puzzled as whether and how they integrate with one another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for something that learns words I type and predicts them. Also something that predicts org-mode syntacx. Maybe come C/C++ in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across &lt;a href=&quot;http://emacswiki.org/emacs/AutoComplete&quot; rel=&quot;nofollow&quot;&gt;AutoComplete&lt;/a&gt; with &lt;a href=&quot;https://github.com/aki2o/org-ac&quot; rel=&quot;nofollow&quot;&gt;auto complete for org-mode&lt;/a&gt;.&lt;br&gt;&#xA;Then there is also &lt;a href=&quot;http://www.emacswiki.org/emacs/PredictiveMode&quot; rel=&quot;nofollow&quot;&gt;predictive mode&lt;/a&gt; that appears to have an &lt;a href=&quot;http://www.dr-qubit.org/predictive/predictive-user-manual/html/Auto_002dCompletion-Mode.html#Auto_002dCompletion-Mode&quot; rel=&quot;nofollow&quot;&gt;auto complete mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, does predictive mode actually make use of auto-complete, or is predictive's auto-complete different from the emacs/org-mode auto complete?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e, would I be able to configure predict mode to use autocomplete to auto-complete for org-mode?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-03-12T14:33:53.640" Title="Auto-complete mode (inside?) predictive mode &amp; org-mode?" Tags="|org-mode|auto-complete-mode|predictive-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9921" PostTypeId="1" AcceptedAnswerId="9927" CreationDate="2015-03-10T14:14:55.873" Score="8" ViewCount="3420" Body="&lt;p&gt;I have some sort of fundamental confusion about using src blocks in org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define a custom latex class in an emacs-lisp src block at the top of my org file. Export fails however, unless I manually execute the src block (because the required latex class doesn't exist until the src block is executed). I'm not prompted for permission to execute the block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a minimal example, I tried exporting this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: test&#xA;#+begin_src emacs-lisp&#xA;(message &quot;Success&quot;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On export, I see &lt;code&gt;org-babel-exp processing...&lt;/code&gt; in my messages buffer, and I would expect to see &lt;code&gt;&quot;Success&quot;&lt;/code&gt; immediately after it, but I don't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm clearly missing something obvious, but it's not clear to me from the info what I should be doing.&lt;/p&gt;&#xA;" OwnerUserId="6704" LastActivityDate="2022-04-15T21:06:14.727" Title="Execute src block on org mode export" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9922" PostTypeId="1" AcceptedAnswerId="9948" CreationDate="2015-03-10T15:03:55.750" Score="3" ViewCount="691" Body="&lt;p&gt;When I run a snippet of code (&lt;code&gt;C-c C-c&lt;/code&gt;) (e.g. for making a PlantUML diagram), there is a trailing new line in the results, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC plantuml file hello.png&#xA;...&#xA;#+END_SRC&#xA;&#xA;#+results&#xA;[[img]&#xA;   &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; new line here :-|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then have to manually delete that line as it messes with some of my header formatting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt; &#xA;As per comment below, I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: diagram123&#xA;#+BEGIN_SRC plantuml :file ./img/img_2015_03_11__09_32_36.png&#xA;start &#xA;:meh;&#xA;end&#xA;#+END_SRC&#xA;&#xA;&#xA;#+CALL: diagram123()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this generates a result block with a new line at the end also :-|&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5143" LastEditDate="2015-03-13T10:40:21.473" LastActivityDate="2015-03-13T10:40:21.473" Title="Can org-babel 'result' not insert a newline at the end?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="9923" PostTypeId="5" CreationDate="2015-03-10T15:15:27.957" Score="0" Body="&lt;p&gt;&lt;code&gt;shell-command&lt;/code&gt; is an Emacs command that executes a single shell command in a shell. It puts short output in the &lt;a href=&quot;/questions/tagged/echo-area&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;echo-area&amp;#39;&quot; rel=&quot;tag&quot;&gt;echo-area&lt;/a&gt; and long output in buffer &lt;code&gt;*Shell Command Output*&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tags related to &lt;a href=&quot;/questions/tagged/shell-command&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-command&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-command&lt;/a&gt; include &lt;a href=&quot;/questions/tagged/shell&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/eshell&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;eshell&amp;#39;&quot; rel=&quot;tag&quot;&gt;eshell&lt;/a&gt;, and &lt;a href=&quot;/questions/tagged/shell-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell.html#Shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;Running Shell Commands from Emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Single-Shell.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Single Shell Commands&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-History.html#Shell-History&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shell Command History&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Shell-Arguments.html#Shell-Arguments&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shell Arguments&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Synchronous-Processes.html#Synchronous-Processes&quot; rel=&quot;nofollow noreferrer&quot;&gt;Asynchronous Processes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6553" LastEditorUserId="105" LastEditDate="2017-02-28T02:33:11.490" LastActivityDate="2017-02-28T02:33:11.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9924" PostTypeId="4" CreationDate="2015-03-10T15:15:27.957" Score="0" Body="is for executing shell commands from Emacs (the default key binding is `M-!`). Shell output is shown in the echo area if it fits, in buffer `*Shell Command Output*` otherwise. Emacs comes with many supporting facilities for executing shell commands, including interactive execution, selective execution on a region, history cycling, directory tracking, connecting to serial ports, emulator options, and specifying remote hosts." OwnerUserId="6553" LastEditorUserId="105" LastEditDate="2017-02-28T02:35:15.850" LastActivityDate="2017-02-28T02:35:15.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9925" PostTypeId="1" AcceptedAnswerId="9952" CreationDate="2015-03-10T15:16:24.680" Score="16" ViewCount="3974" Body="&lt;p&gt;When I run &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Single-Shell.html&quot;&gt;&lt;code&gt;shell-command&lt;/code&gt;&lt;/a&gt; in a new session I do not have access to the history of commands from the last session. How can I have that?&lt;/p&gt;&#xA;" OwnerUserId="6553" LastActivityDate="2017-07-20T17:28:24.850" Title="Persistent shell-command history" Tags="|shell-command|session|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9926" PostTypeId="2" ParentId="9917" CreationDate="2015-03-10T15:33:51.133" Score="2" Body="&lt;p&gt;Keys defined by &lt;code&gt;global-set-key&lt;/code&gt; are shadowed by any local binding. In your case using &lt;code&gt;key-translation-map&lt;/code&gt; seems more appropriate. Also, when defining keys, you can use a string (interpreted as a keyboard macro) instead of a command. This would greatly simplify your code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-bind-symbols-to-crtl ()&#xA;  (cl-mapcar&#xA;   (lambda (char shifted-char)&#xA;     (define-key key-translation-map (kbd (concat &quot;C-&quot; char))&#xA;       shifted-char))&#xA;   (split-string&#xA;    &quot;~1234567890-=;']\\,./&quot; &quot;&quot; t)&#xA;   (split-string&#xA;    &quot;`!@#$%^&amp;amp;*()_+:\&quot;}|&amp;lt;&amp;gt;?&quot; &quot;&quot; t)))&#xA;&#xA;(my-bind-symbols-to-crtl)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2241" LastEditorUserId="2241" LastEditDate="2018-08-10T20:55:48.607" LastActivityDate="2018-08-10T20:55:48.607" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="9927" PostTypeId="2" ParentId="9921" CreationDate="2015-03-10T15:43:01.463" Score="9" Body="&lt;p&gt;The code blocks don't get evaluated unless you &lt;a href=&quot;https://orgmode.org/manual/Evaluating-Code-Blocks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;specifically tell Org mode to do it&lt;/a&gt; (or do &lt;code&gt;C-h i g (org)Evaluating Code Blocks&lt;/code&gt; in Emacs). The snippet in your example will simply export to a code block in your chosen export format: pdf, html, etc.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://orgmode.org/manual/Working-with-Source-Code.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;More on Org mode and source blocks.&lt;/strong&gt;&lt;/a&gt; (or do &lt;code&gt;C-h i g (org)Working with Source Code&lt;/code&gt; in Emacs)&lt;/p&gt;&#xA;&lt;p&gt;Here is the modified version of your example with the required &lt;code&gt;#+CALL:&lt;/code&gt; line and the good to have buffer local variable declaration to mark the execution of &lt;code&gt;emacs-lisp&lt;/code&gt; snippets as safe.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+name: test&#xA;#+begin_src emacs-lisp&#xA;(message &amp;quot;Success&amp;quot;)&#xA;#+end_src&#xA;  &#xA;#+call: test()&#xA;&#xA;# Local Variables:&#xA;# org-confirm-babel-evaluate: (lambda (lang body) (not (string= lang &amp;quot;emacs-lisp&amp;quot;)))&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2022-04-15T21:06:14.727" LastActivityDate="2022-04-15T21:06:14.727" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="9928" PostTypeId="1" AcceptedAnswerId="9929" CreationDate="2015-03-10T15:56:45.100" Score="2" ViewCount="770" Body="&lt;p&gt;I frequently work with &lt;a href=&quot;http://www.rcsb.org/pdb/home/home.do&quot; rel=&quot;nofollow&quot;&gt;Protein Data Bank&lt;/a&gt; files.  These are &lt;a href=&quot;http://deposit.rcsb.org/adit/docs/pdb_atom_format.html&quot; rel=&quot;nofollow&quot;&gt;text files that contain atomic level structure information of molecules&lt;/a&gt;.  They can be recognized by their '.pdb' extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever editing them in Emacs (GNU Emacs 24.3.1), in the main buffer I see a small box in the top left corner and the minibuffer has the instructions, &quot;Type &lt;code&gt;C-c C-c&lt;/code&gt; to view the image as text.&quot;  In the bar between the minibuffer and the main buffer, it list that the mode is &lt;code&gt;(Image[imagemagick])&lt;/code&gt;.  After pressing &lt;code&gt;C-c C-c&lt;/code&gt;, this mode changes to &lt;code&gt;(Fundamental Image[imagemagick])&lt;/code&gt;.  It has got to the point where I quickly type C-c C-c almost without thinking about it to view and edit the text file but I would rather not have to.  How do I make it default to the &lt;code&gt;(Fundamental Image[imagemagick])&lt;/code&gt; mode?  I would think I could add some hook to my init.el file but I am not sure what.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of text that when saved as &lt;code&gt;test.pdb&lt;/code&gt; produces the behavior described:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ATOM      1  O5' CYT X   1      32.071  -1.490 114.864  1.00  0.00      DNA1 O&#xA;ATOM      2  C5' CYT X   1      30.711  -1.577 114.398  1.00  0.00      DNA1 C&#xA;ATOM      3  C4' CYT X   1      30.171  -0.188 114.035  1.00  0.00      DNA1 C&#xA;ATOM      4  O4' CYT X   1      30.040   0.620 115.241  0.00  0.00      DNA1 O&#xA;ATOM      5  C1' CYT X   1      30.111   1.904 114.881  0.00  0.00      DNA1 C&#xA;ATOM      6  C2' CYT X   1      31.383   1.832 114.043  0.00  0.00      DNA1 C&#xA;ATOM      7  C3' CYT X   1      31.091   0.649 113.121  1.00  0.00      DNA1 C&#xA;ATOM      8  O3' CYT X   1      30.453   0.939 111.890  1.00  0.00      DNA1 O&#xA;ATOM      9  P   THY X   2      29.768   2.098 111.098  1.00  0.00      DNA1 P&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I noticed that when opening files in a terminal using the 'no window' option, &lt;code&gt;emacs -nw test.pdb&lt;/code&gt;, it opens using &lt;code&gt;(Fundamental Image)&lt;/code&gt; mode, without the &lt;code&gt;[imagemagick]&lt;/code&gt; part.  I am not sure the difference but if I would be happy if I could get that behavior in the windowed version (I do not intend to only edit within the terminal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do wonder why Emacs tries to render the file as an image.  It is clearly related to having ImageMagick installed but I am not sure the specifics.  Does anyone know if it actually can correctly read and render the molecule/s contained in pdb files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching Google for a solution, I see several hit regarding python interactive debugger, the pdb package, and using that from Emacs.  Obviously that is not what I am looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior has been consistent over multiple Emacs updates for the past several years on several computers but the specific version info for the Emacs I am currently using is the following: GNU Emacs 24.3.1&#xA; (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have recommendations of better Tags which will help this get seen by people that would have input, please let me know.&lt;/p&gt;&#xA;" OwnerUserId="6693" LastEditorUserId="6693" LastEditDate="2015-03-11T14:37:11.347" LastActivityDate="2015-03-11T14:37:11.347" Title="Always view *.pdb files as text file" Tags="|init-file|text|image-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9929" PostTypeId="2" ParentId="9928" CreationDate="2015-03-10T16:27:58.833" Score="5" Body="&lt;p&gt;This is controlled by the variable &lt;code&gt;auto-mode-alist&lt;/code&gt;, which you can modify by adding the following line to your emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.pdb$&quot; . text-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;&quot;\\.pdb$&quot;&lt;/code&gt; part is a regular expression that matches files ending in &lt;code&gt;pdb&lt;/code&gt;. The part after the period is the mode you want to use instead of the default.&lt;/p&gt;&#xA;" OwnerUserId="321" LastActivityDate="2015-03-10T16:27:58.833" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9930" PostTypeId="1" AcceptedAnswerId="9931" CreationDate="2015-03-10T19:28:47.437" Score="14" ViewCount="4546" Body="&lt;p&gt;The docs made me no wiser:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function returns the value stored in symbol's value cell. This is&#xA;  where the variable's current (dynamic) value is stored. If the&#xA;  variable has no local binding, this is simply its global value. If the&#xA;  variable is void, a void-variable error is signaled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the point of symbol-value? Where and when do I need to use it?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2015-07-11T04:45:22.207" LastActivityDate="2015-07-11T04:45:22.207" Title="What does `symbol-value` do?" Tags="|elisp|symbols|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9931" PostTypeId="2" ParentId="9930" CreationDate="2015-03-10T19:31:30.880" Score="17" Body="&lt;p&gt;You need it when, in Elisp code, you want to get the value of a symbol, that is, its value when considered as a variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that an Elisp symbol has several characteristics/features:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It has a name (which function &lt;code&gt;symbol-name&lt;/code&gt; gives)&lt;/li&gt;&#xA;&lt;li&gt;It might have a value, when considered as a variable (which &lt;code&gt;symbol-value&lt;/code&gt; gives)&lt;/li&gt;&#xA;&lt;li&gt;It might name a function, when considered as a function (which &lt;code&gt;symbol-function&lt;/code&gt; gives)&lt;/li&gt;&#xA;&lt;li&gt;It has a property list (which &lt;code&gt;symbol-plist&lt;/code&gt; gives)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Think of a symbol as an object, with various attributes.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-10T19:31:30.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9932" PostTypeId="2" ParentId="9930" CreationDate="2015-03-10T19:31:43.807" Score="7" Body="&lt;p&gt;Small demo:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq v1 10)&#xA;;;10&#xA;v1&#xA;;;10&#xA;(setq v2 'v1)&#xA;;;v1&#xA;v2&#xA;;;v1&#xA;(symbol-value v2)&#xA;;;10 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-10T19:31:43.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9933" PostTypeId="2" ParentId="9930" CreationDate="2015-03-10T19:40:02.913" Score="10" Body="&lt;p&gt;(Doh, @Drew already put some of the following up.  Anyway, here's some additional detail.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the manual page on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Components.html#Symbol-Components&quot;&gt;symbol components&lt;/a&gt; explains, there are four components (cells) to each symbol: its print name cell, its value cell, its function definition, and its property list.  Either the value cell or the function cell may be void, and the property list may be nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the manual also points out:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Because each symbol has separate value and function cells, variables names and function names do not conflict.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's why you can have, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq test &quot;kittens&quot;)&#xA;(defun test ()&#xA;  (message &quot;puppies&quot;))&#xA;(symbol-value 'test)    ; =&amp;gt; &quot;kittens&quot;&#xA;(symbol-function 'test) ; =&amp;gt; (lambda nil (message &quot;puppies&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-03-10T19:40:02.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9934" PostTypeId="2" ParentId="9930" CreationDate="2015-03-10T22:15:15.750" Score="8" Body="&lt;p&gt;Here's a bit of historical reference (I haven't been born yet when the described events took place, so maybe someone more knowledgeable will correct me.  All this is from reading old articles and some books).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having dispensed with the disclaimer, it seems like back in the days of Fortran vs Lisp &quot;symbolic&quot; was a kind of a buzzword as &quot;object oriented&quot; is today. I.e. programs were typically seen as just huge mathematical formulae where numbers will eventually be plugged and the placeholders for numbers were immaterial. All symbolic information contained in a program would vanish as soon as that program was either run, compiled or interpreted.  The novelty of Lisp was that it allowed symbols to persist in a program even after it is run, compiled or interpreted.  This inspired such terminology as &quot;symbolic algebra&quot; (as in manipulation on algebraic formulae as done on paper / blackboard rather than by direct calculation).  In order to support this (and other symbolic things) symbols were to be equipped with a name and some properties.  From a non-symbolic point of view, one might say that &quot;symbols are just named pointers&quot;, and while this isn't true, if anything they are more of pointers to structs, but for practical purposes, symbols are designators of the left hand side of a variable-value pair.  This also makes it possible to see &lt;code&gt;symbol-value&lt;/code&gt; function as pointer dereferencing in non-symbolic languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modern Lisps vary in that how much values can be associated with one symbol (suppose you had a non-symbolic language with multiple memory stacks / heaps, you could imagine a situation where the same pointer has meaning when interpreted in the context of different stacks / heaps). So, Lisp2 languages (Emacs Lisp being one such language) have separate storage for functions and variables, this is why there's also a &lt;code&gt;symbol-function&lt;/code&gt;, which &quot;dereferences a pointer pointing to a function storage&quot;. Scheme doesn't have this special storage and Clojure AFAIK, doesn't have neither that nor &lt;code&gt;symbol-plist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-03-10T22:15:15.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9937" PostTypeId="1" AcceptedAnswerId="10328" CreationDate="2015-03-11T05:24:38.267" Score="0" ViewCount="957" Body="&lt;p&gt;I am unable to install &lt;strong&gt;magit&lt;/strong&gt; with &lt;strong&gt;package.el&lt;/strong&gt;. While other packages install correctly, &lt;strong&gt;magit&lt;/strong&gt; (v 90150116) currently gives me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-number-of-arguments&#xA;#[(ad--addoit-function package-list requirements) &quot;\304\305 !\306   !\210&#xA;&#xA;    \304#\211)\207&quot; [ad-return-value requirements ad--addoit-function&#xA;package-list nil reverse print] 5] 4)  &#xA;ad-Advice-package-compute-transaction(#[770&#xA;&quot;\211\203I\211@\211@\211A@\262\302\211\2038esc magit (90150116)&#xA;&quot;control Git from Emacs&quot; ((cl-lib (0 3)) (git-commit-mode (0 14 0))&#xA;(git-rebase-mode (0 14 0))) tar &quot;melpa-stable&quot; nil ((:keywords &quot;vc&quot;&#xA;&quot;tools&quot;)) nil]))   apply(ad-Advice-package-compute-transaction #[770&#xA;&quot;\211\203I\211@\211@\211A@\262\302\211\20383)) (git-commit-mode&#xA;(0 14 0)) (git-rebase-mode (0 14 0))) tar &quot;melpa-stable&quot; nil&#xA;((:keywords &quot;vc&quot; &quot;tools&quot;)) nil])))  &#xA;package-compute-transaction(([cl-struct-package-desc magit (90150116)&#xA;&quot;control Git from Emacs&quot; ((cl-lib (0 3)) (git-commit-mode (0 14 0))&#xA;(git-rebase-mode (0 14 0))) tar &quot;melpa-stable&quot; nil ((:keywords &quot;vc&quot;&#xA;&quot;tools&quot;)) nil]) ((cl-lib (0 3)) (git-commit-mode (0 14 0))&#xA;(git-rebase-mode (0 14 0))) ([cl-struct-package-desc magit (90150116)&#xA;&quot;control Git from Emacs&quot; ((cl-lib (0 3)) (git-commit-mode (0 14 0))&#xA;(git-rebase-mode (0 14 0))) tar &quot;melpa-stable&quot; nil ((:keywords &quot;vc&quot;&#xA;&quot;tools&quot;)) nil]))   #[770&#xA;&quot;\211\203I\211@\211@\211A@\262\302\211\2038/24.4/lisp/emacs-lisp/package.elc&quot;&#xA;. 39624)](nil ((magit)) nil)  &#xA;ad-Advice-package-compute-transaction(#[770&#xA;&quot;\211\203I\211@\211@\211A@\262\302\211\20384\211A\262\242\211\303H&amp;gt;\204\272&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;a href=&quot;http://stable.melpa.org&quot; rel=&quot;nofollow&quot;&gt;http://stable.melpa.org&lt;/a&gt; and &lt;strong&gt;emacs 24.4.1&lt;/strong&gt;, compiled locally.&lt;/p&gt;&#xA;" OwnerUserId="3895" LastEditorUserId="563" LastEditDate="2015-03-11T09:58:06.727" LastActivityDate="2015-03-27T02:44:09.547" Title="magit fails to install" Tags="|package|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9939" PostTypeId="1" AcceptedAnswerId="9954" CreationDate="2015-03-11T06:13:24.097" Score="-1" ViewCount="417" Body="&lt;p&gt;This is what I got when I select a directory (whether it had a git repository) and choose &quot;yes&quot; when magit asks if I want to create one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;directory-file-name(nil)&#xA;magit-mode-get-buffer(&quot;*magit: %t*&quot; magit-status-mode)&#xA;magit-refresh()&#xA;magit-run-git(&quot;init&quot; &quot;/home/user/local/dir/&quot;)&#xA;magit-init(&quot;~/local/dir/&quot;)&#xA;magit-status(&quot;~/local/dir/&quot;)&#xA;call-interactively(magit-status record nil)&#xA;command-execute(magit-status record)&#xA;execute-extended-command(nil &quot;magit-status&quot;)&#xA;call-interactively(execute-extended-command nil nil)&#xA;command-execute(execute-extended-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;magit&lt;/strong&gt; (v 90150116), from &lt;a href=&quot;http://stable.melpa.org&quot; rel=&quot;nofollow&quot;&gt;http://stable.melpa.org&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;emacs 24.4.1&lt;/strong&gt;, compiled locally.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Verified with a bare &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3895" LastEditorUserId="306" LastEditDate="2015-03-11T09:51:04.610" LastActivityDate="2015-03-12T02:45:10.623" Title="Magit fails to create local repository" Tags="|magit|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9940" PostTypeId="1" AcceptedAnswerId="10268" CreationDate="2015-03-11T08:18:49.723" Score="1" ViewCount="498" Body="&lt;p&gt;I'm using tramp to edit files remotely. Now I would like to ediff two files which are at the remote location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, I get the following warning, which prevents using ediff completely.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cygwin warning:&#xA;  MS-DOS style path detected: c:\Users\beginner\AppData\Local\Temp\beginner.cpp&#xA;  Preferred POSIX equivalent is: /cygdrive/c/Users/beginner/AppData/Local/Temp/beginner.cpp&#xA;  CYGWIN environment variable option &quot;nodosfilewarning&quot; turns off this warning.&#xA;  Consult the user's guide for more details about POSIX paths:&#xA;    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to export nodosfilewarning, but this does not seem to affect the environment Emacs is running in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get ediff to work with tramp?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The emacs is windows native and I am connecting to the remote via &lt;a href=&quot;http://en.wikipedia.org/wiki/Plink&quot; rel=&quot;nofollow&quot;&gt;putty link&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-03-20T13:09:53.523" LastActivityDate="2015-03-24T15:31:20.327" Title="Tramp ediff problem MS-DOS style path detected" Tags="|microsoft-windows|tramp|ediff|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9942" PostTypeId="1" CreationDate="2015-03-11T11:39:19.073" Score="2" ViewCount="90" Body="&lt;p&gt;I am not sure which terms to search for this with, perhaps you can help. Sometimes when I move around my emacs window, some grey clutter emerges on the left hand side. The file that I am working on is growing in size (82 Kb), but is not that huge (I would expect). I also have gradually added a bunch of things to the .emacs startup, but again, not that much. The computer is not overloaded with other apps either. I'm working with Windows 7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The clutter is purely visual and apart from hiding the some letters briefly does not obstruct the use in any way. The clutter is easy to get rid of with some scrolling or looping through buffers, which works sometimes. Writing on the clutter also forces the cluttered part to be updated with the proper contents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea which problems I may be facing? And could it increase with file size? It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://lh4.googleusercontent.com/eXImVUC6UwO2LoIJ3ElSU5fZAgaz2u6mUs53ztb9z0FvEQg0eNvXeO42E63AjqYMicEjIYT3jAs=w1416-h612&quot; alt=&quot;This is how it looks like&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The image of how it looks like does not seem to work with google drive, but it should be visible here: &lt;a href=&quot;https://drive.google.com/file/d/0B-vbd3c7HrSJS240aUMxaV9xZmc/view?usp=sharing&quot; rel=&quot;nofollow&quot;&gt;https://drive.google.com/file/d/0B-vbd3c7HrSJS240aUMxaV9xZmc/view?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://lh6.googleusercontent.com/PZqf0EFcNpnjhTGrS0B3O8RDmZHNVCEJFuQtTHPe0a8P5cZj_jfJreYWrgg-6BTAVcNV8S0FbBA=w1416-h612&quot; alt=&quot;This is how it looks like&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem persists when starting up with &lt;code&gt;emacs -Q&lt;/code&gt; (noinit), and with no open files.&lt;/p&gt;&#xA;" OwnerUserId="5492" LastEditorUserId="5492" LastEditDate="2015-03-11T14:35:00.907" LastActivityDate="2015-03-11T14:35:00.907" Title="Visual clutter on the left edge" Tags="|large-files|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9943" PostTypeId="2" ParentId="9942" CreationDate="2015-03-11T12:44:16.140" Score="2" Body="&lt;p&gt;I'm not sure what I'm looking at in your screen shot. Do you have a wide left fringe? What effect does&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fringe-mode '0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;have?&lt;/p&gt;&#xA;" OwnerUserId="6532" LastActivityDate="2015-03-11T12:44:16.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9944" PostTypeId="2" ParentId="9942" CreationDate="2015-03-11T13:22:41.210" Score="1" Body="&lt;p&gt;What you show in that image seems like a redisplay problem. Does that gray noise go away if you use &lt;code&gt;C-l&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also report here about anything particular you might be doing, such as using Emacs remotely or via a particular window manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And let us know if this happens only with particular kinds of files - not just the size, but in particular the mode of the buffer. When a buffer is in a particular mode, different code is used to set up your editing environment. This info can be important to helping you find the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More importantly, what happens if you start Emacs without your init file: &lt;code&gt;emacs -Q&lt;/code&gt;? If the problem goes away then recursively bisect your init file to find the part that is problematic. You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment out blocks of the code (use &lt;code&gt;C-u&lt;/code&gt; to uncomment). Comment out 1/2 of the file, then 3/4, 7/8, 15/16, etc. until you see what's causing the problem. If the solution then is not obvious, report here just what is causing the problem.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-11T13:22:41.210" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9945" PostTypeId="1" AcceptedAnswerId="9946" CreationDate="2015-03-11T13:55:03.657" Score="2" ViewCount="352" Body="&lt;h2&gt;Problem:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For some mysterious reason, when I open a link in firefox, a new firefox instance opens. Also &lt;strong&gt;note&lt;/strong&gt; instead of the content of the link, my home-page shows up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead I would like a new tab to open in my running instance and actually show the content of the link. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I would like to make it work for firefox?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running Fedora Linux 21, with emacs 24.4.1.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Troubleshooting:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;1) If I set my browser to chrome/eww, then it works:   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq browse-url-browser-function 'browse-url-generic&#xA;      browse-url-generic-program &quot;google-chrome&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) I tried loading my emacs with &lt;code&gt;emacs -q&lt;/code&gt; and dissabling all firefox plugins, but the result was the same.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;EDIT: Solution:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As per post below, I rebuild emacs from sources and that solved the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case anyone reads this, I wrote a blog entry on how to rebuild emacs on fedora: &#xA;&lt;a href=&quot;https://coffeeorientedprogramming.wordpress.com/2015/03/11/how-to-compilebuild-emacs-from-scratch-on-fedora/&quot; rel=&quot;nofollow&quot;&gt;https://coffeeorientedprogramming.wordpress.com/2015/03/11/how-to-compilebuild-emacs-from-scratch-on-fedora/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Ubuntu:&#xA;&lt;a href=&quot;http://ergoemacs.org/emacs/building_emacs_on_linux.html&quot; rel=&quot;nofollow&quot;&gt;http://ergoemacs.org/emacs/building_emacs_on_linux.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-03-11T14:39:02.870" LastActivityDate="2015-03-11T14:39:02.870" Title="Links open firefox with starting page, instead of link content (linux)" Tags="|web-browser|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9946" PostTypeId="2" ParentId="9945" CreationDate="2015-03-11T13:57:21.823" Score="5" Body="&lt;p&gt;This is due to a Firefox upgrade that changed the command line parameters.&#xA;It's fixed in both trunk and &lt;code&gt;emacs24&lt;/code&gt; git branch. &lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-11T13:57:21.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9947" PostTypeId="2" ParentId="9925" CreationDate="2015-03-11T15:08:15.730" Score="0" Body="&lt;p&gt;I think you can advice &lt;code&gt;shell-command&lt;/code&gt; to save history and remap some related key bindings, e.g., &lt;code&gt;M-n/p&lt;/code&gt;, for invoking that history, or even write your own &lt;code&gt;shell-command&lt;/code&gt; by using &lt;code&gt;read-from-minibuffer&lt;/code&gt; if you like.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-03-11T15:08:15.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9948" PostTypeId="2" ParentId="9922" CreationDate="2015-03-11T15:26:40.237" Score="1" Body="&lt;p&gt;Using your code as example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: diagram123&#xA;#+BEGIN_SRC plantuml :file ./img/img_2015_03_11__09_32_36.png&#xA;start &#xA;:meh;&#xA;end&#xA;#+END_SRC&#xA;&#xA;Some text call_diagram123() some more text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exporting this to LaTeX gives this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Some text \texttt{./img/img\_2015\_03\_11\_\_09\_32\_36.png} some more text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: diagram123&#xA;#+BEGIN_SRC plantuml :file ./img/img_2015_03_11__09_32_36.png&#xA;start &#xA;:meh;&#xA;end&#xA;#+END_SRC&#xA;&#xA;#+CALL: diagram123() :results file :exports results&#xA;&#xA;#+RESULTS:&#xA;[[file:./img/img_2015_03_11__09_32_36.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a way to export it to be a file link.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-03-12T13:42:33.577" LastActivityDate="2015-03-12T13:42:33.577" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9949" PostTypeId="1" AcceptedAnswerId="9950" CreationDate="2015-03-11T16:34:44.467" Score="2" ViewCount="99" Body="&lt;p&gt;For example, take any buffer. Maybe one named &lt;code&gt;my-file&lt;/code&gt;. I want to run &lt;code&gt;M-x compile&lt;/code&gt; in it and have access to the &lt;code&gt;my-file&lt;/code&gt; buffer in &lt;code&gt;compilation-finish-functions&lt;/code&gt;. You'd think think might work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq compilation-finish-functions&#xA;      (lambda (buf string)&#xA;        (message &quot;Buffer name: %s&quot; (buffer-name (other-buffer buf)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it actually echos &lt;code&gt;my-file&lt;/code&gt;'s &lt;code&gt;other-buffer&lt;/code&gt;. &lt;code&gt;current-buffer&lt;/code&gt; just returns the compilation buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I reference the &lt;code&gt;my-file&lt;/code&gt; buffer in a &lt;code&gt;compilation-finish-functions&lt;/code&gt; function?&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="50" LastEditDate="2015-03-11T18:07:16.723" LastActivityDate="2015-03-11T18:07:16.723" Title="How to access the original buffer when running M-x compile and friends?" Tags="|elisp|hooks|compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9950" PostTypeId="2" ParentId="9949" CreationDate="2015-03-11T16:42:16.893" Score="2" Body="&lt;p&gt;While hardly a clean alternative, a workaround would be to advice &lt;code&gt;compile&lt;/code&gt; and store the calling buffer in a &quot;global&quot; var. This wouldn't work for concurrent executions of &lt;code&gt;compile&lt;/code&gt; though. So keep that in mind.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2015-03-11T16:42:16.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9951" PostTypeId="1" CreationDate="2015-03-11T18:55:08.457" Score="4" ViewCount="786" Body="&lt;p&gt;When I visit a new file, &lt;kbd&gt;^x&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;, that has an extension of .sql or .dsql I would like the coding system to be set to &lt;code&gt;utf-8-with-signature-dos&lt;/code&gt;. The default is currently &lt;code&gt;iso-latin-1-dos&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running &lt;code&gt;(version)&lt;/code&gt; of &lt;code&gt;&quot;GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601)\n of 2013-03-17 on MARVIN&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both the .sql and .dsql extension start up sql-mode, but I doubt a hook off of sql mode is the appropriate place to change the coding system for new files.&lt;/p&gt;&#xA;" OwnerUserId="884" LastActivityDate="2015-03-11T20:21:45.087" Title="How to set the coding system for new files with specific extensions" Tags="|character-encoding|find-file|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9952" PostTypeId="2" ParentId="9925" CreationDate="2015-03-11T19:09:05.130" Score="15" Body="&lt;p&gt;The short answer is enable &lt;a href=&quot;http://www.emacswiki.org/emacs/SaveHist&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(savehist-mode)&lt;/code&gt;&lt;/a&gt; in your .emacs. This will save all minibuffer history rings by default, which includes &lt;code&gt;shell-command-history&lt;/code&gt; which is used by &lt;code&gt;M-!&lt;/code&gt; / &lt;code&gt;(shell-command)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;While I'm at it, I figure I'll also explain how to load/save command histories from &lt;code&gt;shell-mode&lt;/code&gt; prompts and other modes that derive from &lt;code&gt;comint-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: this is for my setup with bash and OSX, but the guts of this should work in most environments.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First you need to copy your bash shell history into your emacs' environment. By default this is stored in a variable called &quot;HISTFILE&quot;. I do this with the &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(exec-path-from-shell)&lt;/code&gt;&lt;/a&gt; package like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(exec-path-from-shell-initialize)&#xA;(exec-path-from-shell-copy-env &quot;HISTFILE&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then you need to call &lt;code&gt;(turn-on-comint-history)&lt;/code&gt; in your appropriate mode hooks, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun turn-on-comint-history (history-file)&#xA;          (setq comint-input-ring-file-name history-file)&#xA;          (comint-read-input-ring 'silent))&#xA;&#xA;(add-hook 'shell-mode-hook&#xA;          (lambda ()&#xA;            (turn-on-comint-history (getenv &quot;HISTFILE&quot;))))&#xA;&#xA;(add-hook 'inf-ruby-mode-hook&#xA;          (lambda ()&#xA;            (turn-on-comint-history &quot;.pry_history&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For interactive ruby modes, you can see I'm using a local &lt;code&gt;.pry_history&lt;/code&gt; file on a per-project basis.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Then you need to make sure you save your comint history files when killing buffers and emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'kill-buffer-hook #'comint-write-input-ring)&#xA;(add-hook 'kill-emacs-hook&#xA;          (lambda ()&#xA;            (--each (buffer-list)&#xA;              (with-current-buffer it (comint-write-input-ring)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note I am using &lt;a href=&quot;https://github.com/magnars/dash.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;dash.el&lt;/code&gt;&lt;/a&gt; for the succinct &lt;code&gt;(--each)&lt;/code&gt; formatting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will make your minibuffer shell command history persistent as well as your bash prompt command history between emacs and other terms. &lt;/p&gt;&#xA;" OwnerUserId="264" LastEditorUserId="10115" LastEditDate="2017-01-08T15:01:05.033" LastActivityDate="2017-01-08T15:01:05.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9953" PostTypeId="2" ParentId="9951" CreationDate="2015-03-11T20:21:45.087" Score="4" Body="&lt;p&gt;I wrote a function and added to &lt;code&gt;find-file-not-found-functions&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun srs-set-new-sql-file-coding-system ()&#xA;  (with-current-buffer (current-buffer)&#xA;    (if (string-match &quot;\\.d?sql\\'&quot; buffer-file-name)&#xA;        (setq buffer-file-coding-system 'utf-8-with-signature-dos)&#xA;      nil)))&#xA;&#xA;(add-hook 'find-file-not-found-functions 'srs-set-new-sql-file-coding-system)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="884" LastActivityDate="2015-03-11T20:21:45.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9954" PostTypeId="2" ParentId="9939" CreationDate="2015-03-12T02:45:10.623" Score="2" Body="&lt;p&gt;@tarsius was right. &lt;strong&gt;magit&lt;/strong&gt; works fine with latest stable git (2.3.x).&lt;/p&gt;&#xA;" OwnerUserId="3895" LastActivityDate="2015-03-12T02:45:10.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9955" PostTypeId="1" AcceptedAnswerId="9986" CreationDate="2015-03-12T08:37:25.373" Score="5" ViewCount="1620" Body="&lt;p&gt;I'm using Prelude v 1.0.0. I want to turn off the syntax coloring when my lines exceed a certain word-limit. I don't know where that setting is set. Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I should be more precise. Prelude, by default, sets the color of the text from it's &quot;normal&quot; color to a brighter, more annoying color when it exceeds a certain word-limit. I'm trying to figure out where to tweak it in prelude. I'll give the below suggestion a whirl though.&lt;/p&gt;&#xA;" OwnerUserId="653" LastEditorUserId="653" LastEditDate="2015-03-13T01:14:19.803" LastActivityDate="2021-09-17T21:58:34.523" Title="How do I turn off syntax coloring for lines that exceed the word-limit in prelude?" Tags="|syntax-highlighting|prelude|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9956" PostTypeId="2" ParentId="9955" CreationDate="2015-03-12T09:57:33.593" Score="0" Body="&lt;p&gt;Something along the liens of following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords nil '((&quot;^.\\{70,\\}$&quot; 0 default prepend)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if it blocks other keywords from considering same line but I'm sure it's possbile.&#xA;Then you'll need to substitute &quot;.&quot; with a word regexp, if it's important and adjust the number 70 according to your sepcification.&lt;/p&gt;&#xA;" OwnerUserId="279" LastActivityDate="2015-03-12T09:57:33.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9957" PostTypeId="1" CreationDate="2015-03-12T12:16:52.733" Score="6" ViewCount="324" Body="&lt;p&gt;In the Emacs Multi-Media System, shuffling by song is as easy as &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;emms-shuffle&lt;/code&gt;, but i cant figure out how to shuffle by album, or to add a random album to the playlist. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="6745" LastEditorUserId="221" LastEditDate="2015-03-12T13:04:17.550" LastActivityDate="2015-03-14T16:07:57.357" Title="How to shuffle albums in EMMS?" Tags="|emms|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9959" PostTypeId="2" ParentId="9920" CreationDate="2015-03-12T14:33:53.640" Score="1" Body="&lt;p&gt;In the mean time I got a reply form the author. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seem that autocomplete and predictive mode are seperate entities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question/reply:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi Leo,&#xA;&#xA;&#xA;On Wed, Mar 11, 2015 at 07:24:53PM -0400, Leo Ufimtsev wrote:&#xA;&amp;gt; Hello Toby,&#xA;&amp;gt;&#xA;&amp;gt; I've been reading up on predictive mode. I noticed it has a page related to auto-complete-mode.&#xA;&amp;gt;&#xA;&amp;gt; http://www.dr-qubit.org/predictive/predictive-user-manual/html/Auto_002dCompletion-Mode.html#Auto_002dCompletion-Mode&#xA;&amp;gt;&#xA;&amp;gt; Does this mean that it uses the emacs AutoComplete:&#xA;&amp;gt; http://emacswiki.org/emacs/AutoComplete&#xA;&amp;gt;&#xA;&amp;gt; Or is that a different notion?&#xA;&#xA;No, predictive-mode uses the auto-completion-mode from the Completion-UI&#xA;library, which is in many ways significantly more powerful than&#xA;AutoComplete. (In particular, in ways that are useful for predictive&#xA;completion.)&#xA;&#xA;Best wishes,&#xA;Toby&#xA;-- &#xA;Dr T. S. Cubitt&#xA;Royal Society University Research Fellow&#xA;Fellow of Churchill College, Cambridge&#xA;Quantum Information Theory group&#xA;DAMTP, University of Cambridge&#xA;&#xA;email: tsc25@cantab.net&#xA;web:   www.dr-qubit.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-03-12T14:33:53.640" CommentCount="0" CommunityOwnedDate="2015-03-12T14:33:53.640" ContentLicense="CC BY-SA 3.0" />
  <row Id="9960" PostTypeId="2" ParentId="3166" CreationDate="2015-03-12T14:50:23.563" Score="3" Body="&lt;p&gt;No, unfortunatley there is no way to do so directly. The idea of clock table is to aggregate data.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But fear not, you have two ways to solve the dillema: (That I can think of? there may be others).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;1) Use step by day:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Insert the following into your report line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:step day   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;e.g: &lt;strong&gt;[edit, below not tested, see comment for working example]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN: clocktable :step day  :maxlevel 2 :scope subtree :timestamp t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then time reports will be split by day. By week is also an option, (The default shows total, the weekly shows by/week data.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;2) If you want it more granular than by day, then one option eaybe column view with sub-tasks might be the cup of tea that you've been longing for.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;e.g &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Make Pizza&#xA;** Buy groceries&#xA;** Speak with the italian neighbour &#xA;** prepare base &#xA;** put things on top&#xA;** bake &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then set an estimate on each sub-heading, clock in/out what you worked on. Then hover over * Make Pizzaa  and press &lt;kbd&gt;C-c-x-c&lt;/kbd&gt; and you will see a column with info on individual tasks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will look something like so:&#xA;&lt;a href=&quot;http://www.devalot.com/assets/articles/2008/07/project-planning/columns.jpg&quot; rel=&quot;nofollow&quot;&gt;http://www.devalot.com/assets/articles/2008/07/project-planning/columns.jpg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What ever you do, never forget: Just stay calm and org-on.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-06-04T14:28:59.007" LastActivityDate="2015-06-04T14:28:59.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9961" PostTypeId="2" ParentId="9900" CreationDate="2015-03-12T14:57:44.997" Score="0" Body="&lt;p&gt;As @PythonNut says in the comments below his or her answer, terminals don't have an escape code for &lt;code&gt;C-)&lt;/code&gt;. It is necessary to either remap to something like &lt;code&gt;M-)&lt;/code&gt; or use Emacs GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be quickly checked by pressing &lt;code&gt;C-v&lt;/code&gt; (outside of Emacs) which makes the terminal print the escape sequence for the shortcut that follows. &lt;code&gt;C-v C-)&lt;/code&gt; and &lt;code&gt;C-v )&lt;/code&gt; both print the same escape sequence, which happens to be a literal &lt;code&gt;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6722" LastEditorUserId="6722" LastEditDate="2017-10-16T10:38:34.683" LastActivityDate="2017-10-16T10:38:34.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9962" PostTypeId="1" AcceptedAnswerId="9969" CreationDate="2015-03-12T14:58:20.043" Score="3" ViewCount="1381" Body="&lt;p&gt;I'm a newbie elisp user. I would like to process a few hundred xml files and call an elisp function for each line which does an &lt;code&gt;query-replace&lt;/code&gt; to fix a problem in these files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: how do I write the modified lines back to the file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subquestion: currently the lines are not changed to upper case - can you give me a hint why this does not work?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun fix-xml-file (filePath)&#xA;  &quot;Fix xml file&quot;&#xA;    (with-temp-file **filePath**  &amp;lt;&amp;lt;-- Edit: the file path was missing here!&#xA;      (insert-file-contents filePath)&#xA;      ... do work here ... ) )&#xA;&#xA;(defun fix-xml-folder (folderPath)&#xA;  &quot;Fix all xml files in folder&quot;&#xA;  (interactive &quot;folder: &quot;)&#xA;  (require 'find-lisp)&#xA;  (mapcar 'fix-xml-file (find-lisp-find-files folderPath &quot;\\.xml$&quot;) ) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="115" LastEditDate="2015-03-18T22:00:05.387" LastActivityDate="2017-05-18T10:30:35.920" Title="Use emacs for batch-processing files" Tags="|elisp|files|string|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9964" PostTypeId="2" ParentId="5351" CreationDate="2015-03-12T15:23:36.113" Score="9" Body="&lt;p&gt;It turns out that the wildly varying performance was related to garbage collection. Each call to the function would get slower until a garbage collection was run. With stock emacs, gc was run every couple of seconds, but I had a line in my init.el to improve startup time that set gc-cons-threshold to 20 MB, and that meant gc was run much more infrequently, causing benchmarks to report slower and slower timing until a gc was run after a couple of minutes, then times would plummet and be fast again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reverting to the default gc-cons-threshhold, benchmarking became easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then profiled for memory with the built in profiler (&lt;code&gt;M-x profiler-start&lt;/code&gt;), and discovered that calls to syntax-ppss caused the most allocations, so after some optimization to call syntax-ppss less often I achieved acceptable performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using jit-lock-mode (adding a function via jit-lock-register) seems to be the easiest way to get multi line font locking to work reliably, so that was the method I chose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: After discovering that performance was still not good enough in very large buffers I spent a lot of time optimizing cpu use and allocation, measuring the performance improvements with the built in Emacs profiler (&lt;code&gt;M-x profiler-start&lt;/code&gt;). However, Emacs would still stutter and hang when scrolling quickly through very large buffers. Removing the jit-lock function I registered with &lt;code&gt;jit-lock-register&lt;/code&gt; would remove the stuttering and hangs, but profiling showed the jit-lock function to complete in around 8 ms which should be fast enough for smooth scrolling. Removing the call to &lt;code&gt;jit-lock-register&lt;/code&gt;and instead using a regular font-lock-keywords matcher solved the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TLDR: Doing this was slow and would stutter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-font-lock-function (start end)&#xA;&quot;Set faces for font-lock between START and END.&quot;)&#xA;&#xA;(jit-lock-register 'my-font-lock-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing this was fast and would not stutter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-font-lock-function (start end)&#xA;&quot;Set faces for font-lock between START and END.&quot;)&#xA;&#xA;(defun my-font-lock-matcher (limit)&#xA;    (my-font-lock-function (point) limit)&#xA;   nil)&#xA;&#xA;(setq font-lock-defaults&#xA;  (list &#xA;     ...&#xA;    ;; Note that the face specified here doesn't matter since&#xA;    ;; my-font-lock-matcher always returns nil and sets the face on&#xA;    ;; its own.&#xA;    `(my-font-lock-matcher (1 font-lock-keyword-face nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3858" LastEditorUserId="3858" LastEditDate="2017-01-14T23:17:06.700" LastActivityDate="2017-01-14T23:17:06.700" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9965" PostTypeId="1" CreationDate="2015-03-12T15:29:37.767" Score="1" ViewCount="160" Body="&lt;p&gt;When I try to comment a block of code using &lt;code&gt;comment-region&lt;/code&gt; in a file type emacs doesn't know the proper comment type for, then it prompts me &lt;code&gt;No comment syntax is defined.  Use:&lt;/code&gt; so I can specify the comment character and it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this only happens on modern versions of emacs. In older version that I have to use on our servers, e.g. 21.4.1 It doesn't prompt me for a character. It only says &lt;code&gt;No comment syntax is defined&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now my solution to this is that when I see this message, I run my own function e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x setcomchar RET &#xA;# RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this sets the comment character to #, or whatever else I want (90% of the time it will be #, but could also be //, -- etc) My function is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun setcomchar (cc)&#xA;  &quot;Sets the default comment characted in the current mode&quot;&#xA;  (interactive &quot;sCharacter::&quot;)&#xA;  (setq comment-start cc)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once I've set this, I can run comment-region again and it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what I would like to achieve is effectively to replicate the behaviour seen in newer versions of emacs. Whereby if no comment is set or known about then it automatically prompts me for one. And in fact, once I enter it, it automatically does the commenting for me without a need for another M-x comment-region. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do M-x comment-region, if there is a comment set then apply it.&#xA;Otherwise prompt me for a comment, (it would be nice for this to be pre-filled with the &quot;#&quot; character as it will be this one 90% of the time), then apply it without any further &lt;code&gt;M-x&lt;/code&gt; ing from me. Any thoughts on how to proceed with this one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also as a general point, how can I detect the status of a function in emacs, e.g. is there a concept of return code for something like comment-region. And since &lt;code&gt;comment-region&lt;/code&gt; returns the string &lt;code&gt;No comment syntax is defined&lt;/code&gt;, how can I get access to this string?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Joey &lt;/p&gt;&#xA;" OwnerUserId="2453" LastActivityDate="2015-03-12T18:36:10.740" Title="Automatically prompt for comment character and apply it in older versions of emacs" Tags="|comment|custom|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9966" PostTypeId="1" CreationDate="2015-03-12T15:56:58.680" Score="2" ViewCount="180" Body="&lt;p&gt;I recently discovered &lt;code&gt;helm-ag&lt;/code&gt;, and like its functionality. For some reason, though, I have to enter the pattern to search and then press &lt;kbd&gt;Return&lt;/kbd&gt; to actually get the &lt;code&gt;helm-ag&lt;/code&gt; buffer to appear in &lt;code&gt;helm-mini&lt;/code&gt;. Is this something that needs to be manually configured? Part of my setup for helm consists of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm-ag)&#xA;(global-set-key (kbd &quot;C-c s&quot;) 'helm-ag-this-file)&#xA;(global-set-key (kbd &quot;M-x&quot;) 'helm-M-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I was hoping that this would be enough to get things to appear in &lt;code&gt;helm-mini&lt;/code&gt; like the rest of the helm commands (like &lt;code&gt;helm-M-x&lt;/code&gt; does without any apparent additional setup).&lt;/p&gt;&#xA;" OwnerUserId="6750" LastActivityDate="2015-03-12T15:56:58.680" Title="Display helm-ag in helm-mini" Tags="|helm|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9967" PostTypeId="1" AcceptedAnswerId="10658" CreationDate="2015-03-12T16:30:54.933" Score="4" ViewCount="369" Body="&lt;p&gt;I'll describe what I'm doing currently to get an issue. First, I store the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;eval-expression&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq bb (current-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, &lt;kbd&gt;M-:&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer bb&#xA;  (insert &quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While still in minibuffer, &lt;kbd&gt;C-e&lt;/kbd&gt;, &lt;kbd&gt;C-x C-e&lt;/kbd&gt;. I get the expected result: &lt;code&gt;foo&lt;/code&gt;&#xA;is inserted in the buffer &lt;code&gt;bb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I change the expression to&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer bb&#xA;  (goto-char (point-min)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;kbd&gt;C-x C-e&lt;/kbd&gt; I get the result &lt;code&gt;1&lt;/code&gt;, but the point doesn't move.&#xA;It would seem that scrolling is disabled while in minibuffer. How can I enable it? &lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-07-11T04:40:31.243" LastActivityDate="2015-07-11T04:40:31.243" Title="How to scroll another buffer while in minibuffer?" Tags="|elisp|window|" AnswerCount="3" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="9968" PostTypeId="2" ParentId="9965" CreationDate="2015-03-12T18:36:10.740" Score="2" Body="&lt;p&gt;You can write a wrapper for &lt;code&gt;comment-region&lt;/code&gt; to check for and existing &lt;code&gt;comment-start&lt;/code&gt; and set it if there is none.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-comment-region (beg end arg)&#xA;  (interactive &quot;r\nP&quot;)&#xA;  (unless comment-start&#xA;    (setq comment-start (read-string &quot;Specify a comment starter: &quot;)))&#xA;  (comment-region beg end arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't test this on emacs 21 but I assume the functions used have not changed very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Side note: you said &quot;our servers&quot; so I assume you have some control of them, the version you are running was released a decade ago, your best solution is to update emacs if possible.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-03-12T18:36:10.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9969" PostTypeId="2" ParentId="9962" CreationDate="2015-03-12T19:30:45.777" Score="3" Body="&lt;p&gt;&lt;code&gt;with-temp-file&lt;/code&gt; writes &lt;code&gt;buffer&lt;/code&gt; to &lt;code&gt;FILE&lt;/code&gt;.  So on it's own it should do the trick.  However it requires &lt;code&gt;FILE&lt;/code&gt; to be passed as an argument before &lt;code&gt;BODY&lt;/code&gt; so that it knows what file to write.  Based on your code above, the following should upcase the entire file.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun fix-xml-file (filepath)&#xA;  (with-temp-file filepath&#xA;    (insert-file-contents filepath)&#xA;    (upcase-region (point-min)&#xA;                   (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For other purposes, replace &lt;code&gt;(upcase-region ...)&lt;/code&gt; with an appropriate modification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a regex-replace you will probably want something similar to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (eobp)&#xA;  (re-search-forward &quot;string to change&quot; (point-max) 'noerror)&#xA;  (replace-match &quot;replace with this&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2015-03-12T19:43:15.067" LastActivityDate="2015-03-12T19:43:15.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9970" PostTypeId="1" CreationDate="2015-03-12T19:58:29.570" Score="4" ViewCount="651" Body="&lt;p&gt;I'm dealing with large files of output from Haskell code, most of which is debug info of stuff generating using Haskell's &lt;code&gt;show&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The important thing about that is that it's a large file of things, nested in either parentheses, or square-brackets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[(Assign (FormalReturn (Canonical {home = Local, name = &quot;testState&quot;})) (Label 3),ReachingDefs (fromList [(IntermedExpr (Label 22),Just (Label 22)),(FormalReturn (Canonical {home = Local, name = &quot;testState&quot;}),Just (Label 3))])),&#xA;(Assign (ActualParam (Label 12)) (Label 12),ReachingDefs (fromList [(IntermedExpr (Label 22),Just (Label 22)),(ActualParam (Label 12),Just (Label 12)),(ActualParam (Label 19),Just (Label 19)),(FormalParam Anything (Label 9),Just (Label 8)),(FormalParam Anything (Label 16),Just (Label 15)),(Ref (Canonical {home = Local, name = &quot;ref&quot;}),Just (Label 16))]))]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The way it's printed, there's no spacing or newlines, so it's pretty much unreadable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering, is there a quick command which will take output like this in a buffer, and space/indent it in an easy-to-read way, based on the hierarchical structure of the parentheses?&lt;/p&gt;&#xA;" OwnerUserId="6742" LastEditorUserId="2642" LastEditDate="2015-03-12T21:08:54.543" LastActivityDate="2015-03-12T21:08:54.543" Title="Is there a command/package to pretty print based on parentheses?" Tags="|indentation|formatting|balanced-parentheses|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9971" PostTypeId="1" CreationDate="2015-03-12T20:00:46.620" Score="7" ViewCount="1443" Body="&lt;p&gt;I have the following line in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files (directory-files &quot;~/org-files&quot; 'absolute &quot;[^#]*.org$&quot; 'no-sort))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like for &lt;code&gt;org-agenda-files&lt;/code&gt; to be defined in this way on startup. However, a &lt;code&gt;(custom-set-variables '(org-agenda-files ...))&lt;/code&gt; keeps getting populated, which means that whenever I remove &lt;code&gt;.org&lt;/code&gt; files on another computer, I get hit with &lt;code&gt;Non-existent agenda file&lt;/code&gt; messages. How can I remove this persistent behavior?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-05-12T22:18:57.820" Title="Stop org-mode from defining agenda files in custom" Tags="|org-mode|org-agenda|custom|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9972" PostTypeId="2" ParentId="9970" CreationDate="2015-03-12T20:51:18.287" Score="4" Body="&lt;p&gt;You can try &lt;code&gt;read&lt;/code&gt;ing the sexp and then printing with &lt;a href=&quot;http://doc.endlessparentheses.com/Fun/pp&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;pp&lt;/code&gt;&lt;/a&gt;. The &lt;code&gt;read&lt;/code&gt; function expects elisp syntax, so it's going to stumble on a few&#xA;special chars like &lt;code&gt;,'#&lt;/code&gt;. So you'll have to work around that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since your example included commas, here's a hacky snippet that works&#xA;with commas.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/pretty-print-sexp ()&#xA;  &quot;Pretty print the sexp after point.&#xA;This assumes that the following sexp does not&#xA;contain any instance of \&quot;£$comma$£\&quot;. &quot;&#xA;  (interactive)&#xA;  (let* ((beg (point))&#xA;         (end (save-excursion&#xA;                (forward-sexp 1)&#xA;                (point-marker))))&#xA;    (while (search-forward &quot;,&quot; end 'noerror)&#xA;      (replace-match &quot; £$comma$£ &quot;))&#xA;    (goto-char beg)&#xA;    (let ((data (read (current-buffer))))&#xA;      (delete-region beg (point))&#xA;      (pp data (current-buffer)))&#xA;    (let ((end (point-marker)))&#xA;      (goto-char beg)&#xA;      (while (search-forward-regexp &quot;[[:space:]\n\r]*£$comma$£&quot; end 'noerror)&#xA;        (replace-match &quot;,&quot;))&#xA;      (goto-char end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the case of your example, here's what you're left with after invoking the command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[(Assign&#xA;  (FormalReturn&#xA;   (Canonical {home = Local, name = &quot;testState&quot; }))&#xA;  (Label 3), ReachingDefs&#xA;  (fromList&#xA;   [(IntermedExpr&#xA;     (Label 22), Just&#xA;     (Label 22)),&#xA;    (FormalReturn&#xA;     (Canonical {home = Local, name = &quot;testState&quot; }), Just&#xA;     (Label 3))])),&#xA; (Assign&#xA;  (ActualParam&#xA;   (Label 12))&#xA;  (Label 12), ReachingDefs&#xA;  (fromList&#xA;   [(IntermedExpr&#xA;     (Label 22), Just&#xA;     (Label 22)),&#xA;    (ActualParam&#xA;     (Label 12), Just&#xA;     (Label 12)),&#xA;    (ActualParam&#xA;     (Label 19), Just&#xA;     (Label 19)),&#xA;    (FormalParam Anything&#xA;                 (Label 9), Just&#xA;                 (Label 8)),&#xA;    (FormalParam Anything&#xA;                 (Label 16), Just&#xA;                 (Label 15)),&#xA;    (Ref&#xA;     (Canonical {home = Local, name = &quot;ref&quot; }), Just&#xA;     (Label 16))]))]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-12T20:51:18.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9973" PostTypeId="1" CreationDate="2015-03-12T20:55:43.050" Score="5" ViewCount="696" Body="&lt;p&gt;I have an org file, that looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Item 1&#xA;** Subitem 1.1&#xA;* Item 2&#xA;** Subitem 2.1&#xA;This text from Subitem 2.1 &#xA;** Subitem 2.2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am editing text under Subitem 2.1. Is there a way to hide everything from the screen, except Subitem 2.1, so ideally while editing the text I just want to have a view like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Subitem 2.1&#xA;This text from Subitem 2.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2431" LastActivityDate="2017-10-26T18:45:57.393" Title="Emacs Orgmode: hiding other items in the tree" Tags="|org-mode|focus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9974" PostTypeId="1" CreationDate="2015-03-12T20:58:22.477" Score="13" ViewCount="2193" Body="&lt;p&gt;The &lt;code&gt;format-time-string&lt;/code&gt; function takes a time argument like &lt;code&gt;'(21761 64499 350937 0)&lt;/code&gt; and a format string like &lt;code&gt;&quot;%y-%m-%d %a %H:%M&quot;&lt;/code&gt; and returns something like &lt;code&gt;&quot;15-03-12 Thu 16:49&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the inverse function, which takes &lt;code&gt;&quot;15-03-12 Thu 16:49&quot;&lt;/code&gt; and &lt;code&gt;&quot;%y-%m-%d %a %H:%M&quot;&lt;/code&gt;, and returns &lt;code&gt;'(21761 64499 350937 0)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to parse times out of a website so as to convert them into org-mode timestamps, but I'm having trouble finding the right function in the emacs documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; I'm promoting this from my comment to erikstoke's answer. &lt;code&gt;parse-time-string&lt;/code&gt; and &lt;code&gt;org-parse-time-string&lt;/code&gt; are insufficient because while they parse many standard time strings, they do not allow for specified formats. Both functions are rather incomprehensive. In particular, they lack &lt;a href=&quot;http://en.wikipedia.org/wiki/ISO_8601&quot; rel=&quot;noreferrer&quot;&gt;ISO8601&lt;/a&gt; support.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2015-03-12T21:11:06.683" LastActivityDate="2017-08-04T00:34:02.463" Title="Parsing formatted time string (inverse of format-time-string)" Tags="|time-date|parse-time|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9975" PostTypeId="2" ParentId="9973" CreationDate="2015-03-12T20:58:41.560" Score="7" Body="&lt;p&gt;What I need is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x n s     (org-narrow-to-subtree)&#xA;    Narrow buffer to current subtree. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To widen the buffer again, use &lt;code&gt;C-x n w&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(from &lt;a href=&quot;http://orgmode.org/manual/Structure-editing.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/Structure-editing.html&lt;/a&gt;)&lt;br/&gt;&#xA;P.S. I was googling using a wrong word: &quot;hide&quot; instead of &quot;narrow&quot; :)&lt;/p&gt;&#xA;" OwnerUserId="2431" LastEditorUserId="16579" LastEditDate="2017-10-26T18:45:57.393" LastActivityDate="2017-10-26T18:45:57.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9976" PostTypeId="2" ParentId="9974" CreationDate="2015-03-12T21:02:12.120" Score="5" Body="&lt;p&gt;&lt;code&gt;parse-time-string&lt;/code&gt; parses &quot;standard&quot; time strings, as does &lt;code&gt;org-parse-time-string&lt;/code&gt;. The documentation claims the latter will be faster.  Neither gives a way to specify the format of the string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also an undocumented function &lt;code&gt;parse-iso8601-time-string&lt;/code&gt; that parses ISO8601 into something.  It isn't clear to me what the output is supposed to be.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-03-12T21:21:54.710" LastActivityDate="2015-03-12T21:21:54.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9977" PostTypeId="2" ParentId="9529" CreationDate="2015-03-12T21:22:37.303" Score="0" Body="&lt;p&gt;I figured it out after a while.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c a  (agenda)&#xA;m   (match tags)&#xA;(helm-swoop) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this combo I first search headlines by tag, and then I can narrow things down further with helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing is that I need to have all the files I want to search as Agenda files.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-03-12T21:22:37.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9978" PostTypeId="2" ParentId="9971" CreationDate="2015-03-12T23:29:15.920" Score="2" Body="&lt;p&gt;You might be typing &lt;code&gt;C-c [&lt;/code&gt; which invokes &lt;code&gt;(org-agenda-file-to-front)&lt;/code&gt;. See &lt;a href=&quot;http://orgmode.org/manual/Agenda-files.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Agenda-files.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Redefine that key so that it does not mess with the agenda list (saving the changes in &lt;code&gt;emacs-custom.el&lt;/code&gt;), and your issue should go away.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-03-12T23:29:15.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9979" PostTypeId="2" ParentId="9967" CreationDate="2015-03-12T23:30:22.720" Score="3" Body="&lt;p&gt;I think this is happening because you're changing the point during recursive edit. I'm not sure how to avoid this situation in general, but here, instead of &lt;code&gt;goto-char&lt;/code&gt; you can set &lt;code&gt;window-point&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf (window-point (get-buffer-window bb)) (point-min))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-03-12T23:36:31.577" LastActivityDate="2015-03-12T23:36:31.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9980" PostTypeId="2" ParentId="9967" CreationDate="2015-03-12T23:50:37.517" Score="1" Body="&lt;p&gt;You're probably after this info:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html&quot; rel=&quot;nofollow&quot;&gt; (elisp) Window Point&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each window has its own value of point (*note Point::), independent of&#xA;  the value of point in other windows displaying the same buffer.  This&#xA;  makes it useful to have multiple windows showing one buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;As long as the selected window displays the current buffer, the&#xA;    window's point and the buffer's point always move together; they&#xA;    remain equal.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="279" LastEditorUserId="279" LastEditDate="2015-03-12T23:57:44.740" LastActivityDate="2015-03-12T23:57:44.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9981" PostTypeId="1" AcceptedAnswerId="9987" CreationDate="2015-03-13T01:26:13.080" Score="7" ViewCount="1797" Body="&lt;p&gt;I'd like to have this sort of functionality:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO master task&#xA;** [ ] my subtask 1   &amp;lt;&amp;lt; checkbox in heading :-D&#xA;** [X] my completed subtask&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the C-c C-c combo checking/unchecking such checkmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that I use sub-tasks extensivley but I don't want them to appear on my agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible somehow?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-03-13T18:13:13.653" Title="Can you have org-mode headings with checkboxes?" Tags="|org-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9982" PostTypeId="1" CreationDate="2015-03-13T06:55:52.007" Score="31" ViewCount="20696" Body="&lt;p&gt;What is the easiest way to configure Emacs to be able to look up where a function is defined? I want to highlight it in Emacs and press a key combo to look up where the source of the function is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you also find out where a specific function is being used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is easily done in PyCharm, but can it also be easily done in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="6753" LastEditorUserId="654" LastEditDate="2015-03-13T14:05:02.237" LastActivityDate="2020-03-07T14:06:36.137" Title="How do use Emacs to look up a function in Python?" Tags="|python|development|" AnswerCount="10" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9983" PostTypeId="2" ParentId="9957" CreationDate="2015-03-13T07:07:56.877" Score="1" Body="&lt;p&gt;If calling an external Python script is not a problem, then give &lt;a href=&quot;http://kmkeen.com/albumbler&quot; rel=&quot;nofollow&quot;&gt;Albumbler&lt;/a&gt; a try. The website lists EMMS support as &quot;untested&quot;, and I haven't had the chance to try it myself, but it might work for you.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-13T07:07:56.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9984" PostTypeId="1" AcceptedAnswerId="9998" CreationDate="2015-03-13T07:51:35.643" Score="0" ViewCount="184" Body="&lt;p&gt;I try to print all key bindings in the current buffer using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(current-active-maps)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the message buffer, the entries are not fully printed &amp;amp; are replaced by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after a level.&#xA;Like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((keymap (46 . tern-ac-dot-complete) (3 keymap (4 . tern-get-docs) (3 . tern-get-type) (18 . tern-rename-variable)) (27 keymap (44 . tern-pop-find-definition)&#xA; (67108910 . tern-find-definition-by-name) (46 . tern-find-definition))) (keymap (menu-bar keymap (Hide/Show menu-item &quot;Hide/Show&quot; ...)) (S-mouse-2 . hs-&#xA;mouse-toggle-hiding) (3 keymap (64 keymap ... ... ... ... ...)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and also, the print format is ugly. How to pretty print the list?&#xA;I can do list traversing and print it, but looking at the depth of output string, i am keen on avoiding it.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2022-06-26T22:38:33.090" LastActivityDate="2022-06-26T22:38:33.090" Title="current-active-maps shortens map entries" Tags="|keymap|scratch-buffer|" AnswerCount="1" CommentCount="1" ClosedDate="2015-03-14T07:06:41.507" ContentLicense="CC BY-SA 3.0" />
  <row Id="9985" PostTypeId="2" ParentId="9982" CreationDate="2015-03-13T07:54:26.533" Score="3" Body="&lt;p&gt;python-mode.el provides a command &lt;code&gt;py-find-definition&lt;/code&gt; - see in menu Help. &lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-03-13T07:54:26.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9986" PostTypeId="2" ParentId="9955" CreationDate="2015-03-13T08:02:24.463" Score="6" Body="&lt;p&gt;@lawlist is correct: This question is a (not-so-obvious) duplicate of &lt;a href=&quot;https://stackoverflow.com/q/28244739/1199226&quot;&gt;How to change word wrap highlighting in Emacs&lt;/a&gt; on StackOverflow. Since we can't close questions against posts on other StackExchange sites, I'm going to repeat the answer that I gave over there:&lt;/p&gt;&#xA;&lt;p&gt;Highlighting of content that exceeds word wrap bounds is provided by &lt;code&gt;whitespace-mode&lt;/code&gt; (which is actually a built-in mode).&lt;/p&gt;&#xA;&lt;p&gt;The Prelude &lt;a href=&quot;https://github.com/bbatsov/prelude/#disabling-whitespace-mode&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; explains how to disable it:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Disabling whitespace-mode&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Although &lt;code&gt;whitespace-mode&lt;/code&gt; is awesome some people might find it too intrusive. You can disable it in your personal config with the following bit of code:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(setq prelude-whitespace nil)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-03-13T08:02:24.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9987" PostTypeId="2" ParentId="9981" CreationDate="2015-03-13T08:25:13.763" Score="6" Body="&lt;p&gt;There are a couple of possibilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; If you generally want to omit subentries of todo items in the agenda, set &lt;code&gt;org-agenda-todo-list-sublevels&lt;/code&gt; to nil. This will generate lists with only the highest level todo item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all you need is folding, as Sean Allred pointed out, you can do this with plain list items of you set &lt;code&gt;org-cycle-include-plain-lists&lt;/code&gt; to 'integrate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a checkbox marker in a headline and be able to toggle it, this shouldn't be too hard either. Here is an idea:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-toggle-headine-checkbox ()&#xA;  &quot;Toggle checkbox marker in headlines.&quot;&#xA;  (interactive)&#xA;  (when (and (org-at-heading-p)&#xA;             (save-excursion&#xA;               (beginning-of-line)&#xA;               (looking-at &quot;\\*+ +\\[\\(?1:[X ]?\\)\\]&quot;)))&#xA;    (let ((state (string= (match-string 1) &quot;X&quot;)))&#xA;      (save-excursion&#xA;        (replace-match (format &quot;%s&quot; (if state &quot; &quot; &quot;X&quot;)) nil t nil 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bind it to a key of your liking. If you want it on C-c C-c, you could put a before advice on &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt;; the problem with this approach is that C-c C-c on headlines already sets the tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there are other possibilities: Don't set a todo keyword at all (you can still mark them DONE and clock into the headline); set a different keyword (e.g. TASK) and filter in the agenda. etc.&lt;/p&gt;&#xA;" OwnerUserId="2241" LastEditorUserId="2241" LastEditDate="2015-03-13T18:13:13.653" LastActivityDate="2015-03-13T18:13:13.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9988" PostTypeId="1" AcceptedAnswerId="11068" CreationDate="2015-03-13T09:15:13.260" Score="2" ViewCount="141" Body="&lt;p&gt;I use GNU Emacs 23.4.1 that comes with Debian Wheezy and UTF-8 as system character encoding. When I add bookmark it displays properly in minibuffer and in the buffer, however the bookmark name is mangled in Emacs bookmarks menu (&quot;Jump to bookmark&quot; list to be exact). Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="6755" LastActivityDate="2015-05-01T15:31:29.673" Title="How to get UTF-8 displayed properly in Emacs menus?" Tags="|fonts|character-encoding|menu-bar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9989" PostTypeId="1" AcceptedAnswerId="9991" CreationDate="2015-03-13T09:43:08.090" Score="5" ViewCount="840" Body="&lt;p&gt;Following scenario:&#xA;1) I start emacs and the initial frame is as follow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------------+&#xA;|               |&#xA;|               |&#xA;|               |&#xA;|               |&#xA;|               |&#xA;+---------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;1) I split the window horizontally (C-x 2).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------------+&#xA;|               |&#xA;|               |&#xA;+---------------+&#xA;|               |&#xA;|               |&#xA;+---------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) now I would like to have one third window, which stretches over the two horizontal ones, resulting in a layout as follow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+----------+----+&#xA;|          |    |&#xA;|          |    |&#xA;+----------+    +&#xA;|          |    |&#xA;|          |    |&#xA;+----------+----+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this easily without deleting one window (C-x 0), splitting vertically (C-x 3) and then splitting each window horizontally again (C-x 2) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My real setup is obviously much more complex, and I resort at the moment to creating a second frame which I would like to avoid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same question can be asked for horizontal.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2015-03-13T10:31:49.980" Title="Add window to the right of two horizontally split windows" Tags="|window|frames|emacs24.4|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9990" PostTypeId="2" ParentId="9982" CreationDate="2015-03-13T10:01:09.560" Score="1" Body="&lt;p&gt;Good question, that isn't available out of the box and is a handy feature of full blown IDEs. I do that with &lt;code&gt;cscope&lt;/code&gt;, with a nice helm interface: &lt;a href=&quot;http://wikemacs.org/wiki/Python#cscope&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://wikemacs.org/wiki/Python#cscope&lt;/a&gt; It can answers questions like &quot;where is this symbol defined ? Where is it used ?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps: in evil-mode we can go to the definition of a symbol in the same file with &lt;code&gt;gd&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="739" LastEditDate="2017-07-24T15:20:40.273" LastActivityDate="2017-07-24T15:20:40.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9991" PostTypeId="2" ParentId="9989" CreationDate="2015-03-13T10:31:49.980" Score="8" Body="&lt;p&gt;It is possible to split the frame's root window which encompasses both of your windows, thereby allowing you to add a third window at any side.  There is no built-in command to do that though, so here's some example code to define commands for this particular task:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-split-root-window (size direction)&#xA;  (split-window (frame-root-window)&#xA;                (and size (prefix-numeric-value size))&#xA;                direction))&#xA;&#xA;(defun my-split-root-window-below (&amp;amp;optional size)&#xA;  (interactive &quot;P&quot;)&#xA;  (my-split-root-window size 'below))&#xA;&#xA;(defun my-split-root-window-right (&amp;amp;optional size)&#xA;  (interactive &quot;P&quot;)&#xA;  (my-split-root-window size 'right))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-03-13T10:31:49.980" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9992" PostTypeId="1" CreationDate="2015-03-13T10:36:08.733" Score="3" ViewCount="883" Body="&lt;p&gt;When starting a server it's possible to set a name for the server (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html&lt;/a&gt;). These names are to be useful for connecting emacsclients to those servers, however it would be nice to switch some behavior in my config based on the server name(my initial thoughts are changing the theme).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've dug around on google and the best way seems to be setting an env var and then reading that back in the configuration (&lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsAsDaemon#toc13&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/EmacsAsDaemon#toc13&lt;/a&gt;). I can't seem to find a way to get this information from within emacs without setting the env var, and I'd rather not have to run a separate wrapper just to know what server is running. How would I go about finding this information programmatically?&lt;/p&gt;&#xA;" OwnerUserId="99" LastEditorUserId="25" LastEditDate="2018-06-11T21:11:03.687" LastActivityDate="2018-06-11T21:11:03.687" Title="How to get the server-name?" Tags="|server|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9993" PostTypeId="2" ParentId="9992" CreationDate="2015-03-13T11:00:58.863" Score="5" Body="&lt;p&gt;It appears &lt;code&gt;daemonp&lt;/code&gt; will return the name of the server. I ended up with code that looks something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA; ((string= &quot;org&quot; (daemonp))&#xA;  (load-theme 'solarized-light)&#xA; )&#xA; (t&#xA;  (load-theme 'solarized-dark)&#xA; )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="99" LastEditorUserId="99" LastEditDate="2015-03-13T11:48:49.507" LastActivityDate="2015-03-13T11:48:49.507" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9994" PostTypeId="2" ParentId="9992" CreationDate="2015-03-13T11:12:07.817" Score="4" Body="&lt;p&gt;In a client instance the variable &lt;code&gt;server-name&lt;/code&gt; is bound and contains the server name.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(and (boundp 'server-name) server-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-03-13T11:12:07.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9995" PostTypeId="1" CreationDate="2015-03-13T12:17:05.417" Score="7" ViewCount="1277" Body="&lt;p&gt;We all use multi-windows in Emacs, and for some projects, I developed a habit of using four windows, one each for a different buffer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if I can define a function and when I start to work in a project, it will take the project name as input and set up the working environment like this (using an R project as an example): &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Window 1 will always shows the &lt;code&gt;main.R&lt;/code&gt; file in the project folder;&lt;/li&gt;&#xA;&lt;li&gt;Window 2 will always shows the &lt;code&gt;*R-main*&lt;/code&gt; process buffer;&lt;/li&gt;&#xA;&lt;li&gt;Window 3 will shows the &lt;code&gt;project_log.org&lt;/code&gt; file in the project folder;&lt;/li&gt;&#xA;&lt;li&gt;Window 4 is a reference window, shows the &lt;code&gt;dired&lt;/code&gt; buffer in the&#xA;project folder.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Each window has equal size.   &lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="5143" LastEditDate="2015-03-13T13:19:11.480" LastActivityDate="2015-03-20T11:46:37.773" Title="Set windows layout by a function" Tags="|window|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9996" PostTypeId="1" AcceptedAnswerId="10000" CreationDate="2015-03-13T12:23:25.287" Score="22" ViewCount="17214" Body="&lt;p&gt;I need to see, how many characters contains my text, as I type. I found this pages of Emacs Wiki: &lt;a href=&quot;http://www.emacswiki.org/emacs/WordCount&quot; rel=&quot;noreferrer&quot;&gt;Word count&lt;/a&gt;, and there is a solution very close to what I need: I used the second solution from this page (Show the number of words in the mode-line), because it shows the amount of characters too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it doesn't count spaces. Is there any solution, that will show amount of characters including spaces in mode-line? Ideally, with setting target amount of characters (but this is not necessary). &lt;/p&gt;&#xA;" OwnerUserId="6757" LastActivityDate="2017-11-21T21:33:09.323" Title="How to count characters in buffer including spaces?" Tags="|mode-line|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9997" PostTypeId="2" ParentId="9996" CreationDate="2015-03-13T12:29:32.710" Score="2" Body="&lt;p&gt;Unless I'm misunderstanding, you could just use &lt;code&gt;point-max&lt;/code&gt; to get the number of characters in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun count-chars ()&#xA;  (interactive)&#xA;  (save-restriction&#xA;    (widen)&#xA;    (message &quot;%s characters&quot; (1- (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-03-13T12:29:32.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9998" PostTypeId="2" ParentId="9984" CreationDate="2015-03-13T12:30:35.897" Score="2" Body="&lt;p&gt;To see a pretty printed version of the result of &lt;code&gt;(current-active-maps)&lt;/code&gt;, you can use &lt;code&gt;M-x describe-bindings&lt;/code&gt; (or) &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="5383" LastEditDate="2015-03-13T13:57:55.977" LastActivityDate="2015-03-13T13:57:55.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9999" PostTypeId="2" ParentId="9996" CreationDate="2015-03-13T12:37:38.097" Score="4" Body="&lt;p&gt;Or you could simply &lt;kbd&gt;M-&gt;&lt;/kbd&gt;&lt;kbd&gt;C-x =&lt;/kbd&gt;. The relevant info will appear in the minibuffer. (Commands used: &lt;code&gt;end-of-buffer&lt;/code&gt; and &lt;code&gt;what-cursor-position&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-03-13T12:37:38.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10000" PostTypeId="2" ParentId="9996" CreationDate="2015-03-13T13:22:49.953" Score="7" Body="&lt;p&gt;The &lt;a href=&quot;http://doc.endlessparentheses.com/Var/mode-line-format&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;mode-line-format&lt;/code&gt;&lt;/a&gt; variable already has that capability built-in, the following snippet should add that near the end of your mode-line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'global-mode-string '(&quot; %i&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the Doc:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;%i -- print the size of the buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Technically, this is the size in bytes, so it might not match&#xA;perfectly the number of chars depending on the encoding you use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also try, &lt;code&gt;M-x size-indication-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If the number of bytes does not satisfy you, you can use the following&#xA;snippet, which may or may not cause lag as you type on very large&#xA;buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'global-mode-string&#xA;             '(:eval (format &quot; %s&quot;&#xA;                       (let ((tab-width 1))&#xA;                         (string-width (buffer-string))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-03-13T14:29:02.030" LastActivityDate="2015-03-13T14:29:02.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10001" PostTypeId="2" ParentId="9865" CreationDate="2015-03-13T14:13:22.957" Score="5" Body="&lt;p&gt;&lt;strong&gt;Yes&lt;/strong&gt;, that's possible. Add the following code to your init-file (note that you might have to adapt &lt;code&gt;/usr/bin/ipython2&lt;/code&gt; and &lt;code&gt;/usr/bin/ipython&lt;/code&gt; to point to appropriate executables for IPython 2 and IPython 3, respectively):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun run-python2 ()&#xA;  (interactive)&#xA;  &quot;Run IPython with Python 2.&quot;&#xA;  (let ((python-shell-buffer-name &quot;Python 2&quot;))&#xA;    (run-python &quot;/usr/bin/ipython2 -i&quot; nil t)))&#xA;&#xA;(defun run-python3 ()&#xA;  &quot;Run IPython with Python 3.&quot;&#xA;  (interactive)&#xA;  (let ((python-shell-buffer-name &quot;Python 3&quot;))&#xA;    (run-python &quot;/usr/bin/ipython -i&quot; nil t)))&#xA;&#xA;(global-set-key (kbd &quot;C-c C-2&quot;) 'run-python2)&#xA;(global-set-key (kbd &quot;C-c C-3&quot;) 'run-python3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place you can launch IPython 2 via &lt;kbd&gt;C-c C-2&lt;/kbd&gt; and IPython 3 via &lt;kbd&gt;C-c C-3&lt;/kbd&gt;. (You can of course change these bindings to your liking.)&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-03-13T14:13:22.957" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10002" PostTypeId="2" ParentId="9995" CreationDate="2015-03-13T14:51:28.323" Score="1" Body="&lt;p&gt;An easy way to do this is by storing a window configuration as a directory local variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, arrange the window the way you like them, open files etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the window configuration as directory local variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-dir-local-variable nil 'my-window-conf (window-state-get nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Restore the window configuration with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-window-conf-restore ()&#xA;  &quot;Restore project window configuration.&quot;&#xA;  (interactive)&#xA;  (when (boundp 'my-window-conf)&#xA;    (delete-other-windows)&#xA;    (window-state-put my-window-conf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2241" LastEditorUserId="2241" LastEditDate="2015-03-13T17:33:59.333" LastActivityDate="2015-03-13T17:33:59.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10003" PostTypeId="2" ParentId="9996" CreationDate="2015-03-13T14:54:36.690" Score="3" Body="&lt;p&gt;Other answers have given you useful info, I think. You can put whatever you want in the mode-line, and one place to start is &lt;code&gt;size-indication-mode&lt;/code&gt; and variable variable &lt;code&gt;mode-line-position&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other answers generally tell you the current buffer position relative to the &lt;em&gt;start of the buffer&lt;/em&gt; (or the start of its current restriction, if it is narrowed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes you might want the position relative to some other position.  For that, library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/modeline-posn.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;modeline-posn.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; can help (see &lt;a href=&quot;http://www.emacswiki.org/emacs/ModeLinePosition&quot; rel=&quot;nofollow&quot;&gt;Mode Line Position&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the region is not active, it shows you the usual information (well, a bit better). But when it is active it shows you (in the mode-line) the &lt;strong&gt;number of characters and lines in the selection&lt;/strong&gt; (region). So to see the current position relative to some other position, just use &lt;code&gt;C-SPC&lt;/code&gt; to set the mark at one of the positions.  &lt;code&gt;C-x C-x&lt;/code&gt; activates the region, which shows you its size in characters (and lines) in the mode-line. &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-13T14:54:36.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10004" PostTypeId="2" ParentId="9995" CreationDate="2015-03-13T15:01:07.103" Score="3" Body="&lt;p&gt;In addition to the other answers, consider bookmarks.  If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can bookmark any of these thingies to return to a particular configuration you like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a desktop&lt;/li&gt;&#xA;&lt;li&gt;a window configuration&lt;/li&gt;&#xA;&lt;li&gt;a frame configuration&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&quot;Jumping&quot; to such a bookmark restores the setup that was recorded. This means that you can easily and quickly switch among different desktops etc. You can of course jump to a bookmark programmatically (e.g. from your init file), as well as interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most general of these is a desktop bookmark. Starting with Emacs 24, it includes restoring frames, windows, and buffers as they were snapshot (as much as possible).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-13T15:01:07.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10005" PostTypeId="1" CreationDate="2015-03-13T16:50:23.683" Score="1" ViewCount="178" Body="&lt;p&gt;I would like to search for certain doxygen like pattern in my files and then add corresponding entries to a speedbar for easy browsing. Some of these entries I want to have colored in red.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured out that I can use imenu-generic-expression to easily add entries to my speedbar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'speedbar)&#xA;(speedbar-add-supported-extension &quot;.foo&quot;)&#xA;&#xA;(add-hook 'foo-mode-hook&#xA;          (lambda ()&#xA;            (setq imenu-generic-expression&#xA;                  '((&quot;BARS&quot; &quot;@bar\\s-+\\(.*\\)&quot; 1)&#xA;                    (&quot;FOOS&quot; &quot;@foo\\s-+\\(.*\\)&quot; 1)))&#xA;            ; no auto-grouping&#xA;            (setq speedbar-tag-hierarchy-method nil)&#xA;            (imenu-add-to-menubar &quot;FOO&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But how can I get the colors?&lt;/p&gt;&#xA;" OwnerUserId="6759" LastActivityDate="2015-03-13T16:50:23.683" Title="Speedbar: Colored entries using imenu-generic-expression" Tags="|colors|speedbar|imenu|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10006" PostTypeId="1" AcceptedAnswerId="20336" CreationDate="2015-03-13T19:27:43.453" Score="3" ViewCount="537" Body="&lt;p&gt;I'm trying to use &lt;code&gt;compose-region&lt;/code&gt; with &lt;code&gt;TABs&lt;/code&gt; but fail to see difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to get 'sqrt' composed to '√' but taking as much space as original text and aligned to the right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried each of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(compose-region begin end &quot;√&quot;)&#xA;(compose-region begin end &quot;\t√&quot;)&#xA;(compose-region begin end &quot;√\t&quot;)&#xA;(compose-region begin end &quot;\t√\t&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but fail to see any difference. Is there a way to compose region but keep its width?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is 24.4.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="25" LastEditDate="2015-03-13T21:50:06.647" LastActivityDate="2016-02-15T21:58:26.373" Title="compose-region and TABs" Tags="|text-properties|compose-region|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10008" PostTypeId="2" ParentId="9971" CreationDate="2015-03-13T20:57:29.407" Score="2" Body="&lt;p&gt;One solution to stop Emacs from modifying your custom settings is to not use custom settings at.  Setting the variable &lt;code&gt;custom-file&lt;/code&gt; to some filename will cause custom settings to be stored in that file.  The default is &lt;code&gt;nil&lt;/code&gt;, which means to use your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then load the custom settings with &lt;code&gt;(load custom-file)&lt;/code&gt;. Or not load them and then whatever goes in there is basically going into black hole.  On Linux, you can send them to a more literal black hole by setting &lt;code&gt;custom-file&lt;/code&gt; to &lt;code&gt;/dev/null&lt;/code&gt;. It's a little passive-aggressive, but it works.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-03-13T20:57:29.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10009" PostTypeId="2" ParentId="10006" CreationDate="2015-03-13T21:49:39.467" Score="5" Body="&lt;p&gt;As far as I understand, &lt;code&gt;compose-region&lt;/code&gt; and the underlying &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#index-composition-_0040r_007b_0028text-property_0029_007d-3102&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;composition&lt;/code&gt; text property&lt;/a&gt; can only result in displaying a single glyph (which may be built from several parts). When you pass multiple glyphs, they are assembled together in a single cell. The TAB character says to enlarge the cell so that the composite glyph fits entirely. It doesn't result in enlarging or padding the glyph to fill the cell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want can be done with the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Replacing-Specs.html#Replacing-Specs&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;display&lt;/code&gt; property&lt;/a&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-text-property begin end 'display &quot;   √&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may want to put this property in an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Overlays.html#Overlays&quot; rel=&quot;noreferrer&quot;&gt;overlay&lt;/a&gt; (especially as modifying overlays doesn't mark the buffer content as modified, unlike direct manipulation of text properties).&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-03-13T21:49:39.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10010" PostTypeId="1" AcceptedAnswerId="10014" CreationDate="2015-03-13T23:26:28.867" Score="3" ViewCount="196" Body="&lt;p&gt;I'd like to find all occurrences of &lt;code&gt;==&lt;/code&gt; in a buffer and overlay them with Unicode &lt;code&gt;≡&lt;/code&gt;, keeping width of two chars and centered in the space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about replacing text visual representation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-text-property 1 10 'display &quot;replacement&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;about keeping known width&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-text-property 1 10 'display '(space :width (119)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not know how to put this together and keep it centered.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastActivityDate="2015-03-14T07:04:45.090" Title="Display other text centered" Tags="|overlays|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10011" PostTypeId="2" ParentId="478" CreationDate="2015-03-13T23:46:18.870" Score="0" Body="&lt;p&gt;I ran runemacs.exe from the git shell. Now the git push from magit works.&lt;/p&gt;&#xA;" OwnerUserId="6762" LastEditorUserId="6762" LastEditDate="2015-03-14T15:40:11.687" LastActivityDate="2015-03-14T15:40:11.687" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10012" PostTypeId="1" AcceptedAnswerId="10017" CreationDate="2015-03-14T06:19:49.313" Score="13" ViewCount="7736" Body="&lt;p&gt;I use org-mode to take notes. Currently I have a root directory, say, &quot;Notes&quot;, and there are several subdirectories inside it, for example, &quot;Linux&quot;, &quot;Programming&quot;, etc. The notes taken using org-mode are stored under those subdirectories. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering whether there is an available set of settings so that I can search these notes(which are all org-mode files) very quickly. I know there is &lt;a href=&quot;http://jblevins.org/projects/deft/&quot; rel=&quot;noreferrer&quot;&gt;deft&lt;/a&gt;, but it is not designed for org-mode files. Actually I also tried helm-projectile but it's far from satisfactory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more precise, what I want to achieve is that I can search these files using tags, headlines, or other features which are org-mode-related, maybe using some predefined syntaxes. And if possible, I would prefer something like helm. If there is no such an extension, will it be worth to implement such an extension? I thought deft+helm-projectile might be a good start point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; I tried both methods, directory-local variables(as @itsjeyd suggests in the answer) and org-agenda-custom-commands, and I found the latter one seemed more convenient. So here is my setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  '((&quot;n&quot; . &quot;Search in notes&quot;)&#xA;    (&quot;nt&quot; &quot;Note tags search&quot; tags &quot;&quot;&#xA;     ((org-agenda-files (file-expand-wildcards &quot;path/to/Notes/*/*.org&quot;)))) &#xA;    (&quot;ns&quot; &quot;Note full text search&quot; search &quot;&quot;&#xA;     ((org-agenda-files (file-expand-wildcards &quot;path/to/Notes/*/*.org&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="5482" LastEditDate="2015-03-15T03:50:09.947" LastActivityDate="2015-03-15T03:50:09.947" Title="A search interface for org mode files" Tags="|org-mode|helm|projectile|deft-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10013" PostTypeId="2" ParentId="10012" CreationDate="2015-03-14T06:43:07.770" Score="3" Body="&lt;p&gt;There are a few org related functions in helm. I think &lt;code&gt;helm-org-agenda-files-headings&lt;/code&gt; is basically what you have in mind. If it's not already available for you in emacs, try getting &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/master/helm-org.el&quot; rel=&quot;nofollow&quot;&gt;helm-org.el off Github&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-14T06:43:07.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10014" PostTypeId="2" ParentId="10010" CreationDate="2015-03-14T07:04:45.090" Score="4" Body="&lt;p&gt;While my solution doesn't really center, it comes close enough I hope. There is a display property that adjusts the width of all spaces, if I use the string &lt;code&gt;≡&lt;/code&gt; and make its spaces half the width, it will look centered and two characters wide.  The only downside I could find so far is that putting the cursor on the propertized string highlights its first space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a demonstration that should produce two lines of code lining up perfectly upon evaluating it with C-x C-e and point after the end of the expression:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert &quot;\na == b\n&quot;&#xA;        &quot;a &quot; (propertize &quot;=&quot; 'display&#xA;                         (propertize &quot; ≡ &quot; 'display '(space-width 0.5)))&#xA;        &quot; b\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-03-14T07:04:45.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10015" PostTypeId="1" CreationDate="2015-03-14T08:20:45.530" Score="3" ViewCount="1453" Body="&lt;p&gt;I am looking into setting up an Arduino IDE environment in Emacs (on both PC and OS X). I came across the &lt;a href=&quot;http://www.emacswiki.org&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki&lt;/a&gt; &lt;a href=&quot;http://www.emacswiki.org/emacs/ArduinoSupport&quot; rel=&quot;nofollow&quot;&gt;ArduinoSupport&lt;/a&gt; page, which has a good guide for Mac OS X and Linux, which is perfect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have a couple of questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does such a guide for Emacs on windows exist? I find it a bit of an&#xA;odd omission from the page. Don't get me wrong, I don't like using&#xA;Windows at all, but my Arduino will not connect to my Mac and so I am&#xA;somewhat obliged to use Windows 7 to develop for it.&lt;/li&gt;&#xA;&lt;li&gt;Has anyone used or followed the above guide for Arduino on Emacs on Mac OS&#xA;X? Is it a good guide, or are there better options out there?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I didn't know whether to ask this on the SE Arduino site, but it is more Emacs configuration related than Arduino.&lt;/p&gt;&#xA;" OwnerUserId="5143" LastActivityDate="2015-03-14T08:20:45.530" Title="Arduino IDE for Emacs" Tags="|ide|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10017" PostTypeId="2" ParentId="10012" CreationDate="2015-03-14T09:52:06.143" Score="10" Body="&lt;p&gt;Org itself provides a facility for filtering/searching information stored in &lt;code&gt;.org&lt;/code&gt; files in various ways. It is called the &lt;a href=&quot;http://orgmode.org/manual/Agenda-Views.html&quot; rel=&quot;noreferrer&quot;&gt;&amp;quot;Agenda&amp;quot;&lt;/a&gt;. The &lt;code&gt;org-mode&lt;/code&gt; manual provides extensive information on how to use it (check the link above or do &lt;kbd&gt;C-h i&lt;/kbd&gt; &lt;kbd&gt;m&lt;/kbd&gt; &lt;code&gt;Org Mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; from within Emacs and navigate to the &amp;quot;Agenda Views&amp;quot; chapter), so it does not make sense to repeat all of this information here. The introductory text from the manual summarizes what you can do with it (emphasis mine):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Org can select items based on various criteria and display them in a separate buffer. Seven different view types are provided:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;an agenda that is like a calendar and shows information for specific dates,&lt;/li&gt;&#xA;&lt;li&gt;a TODO list that covers all unfinished action items,&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;a match view, showings headlines based on the tags, properties, and TODO state&lt;/strong&gt; associated with them,&lt;/li&gt;&#xA;&lt;li&gt;a timeline view that shows all events in a single Org file, in time-sorted view,&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;a text search view that shows all entries from multiple files that contain specified keywords&lt;/strong&gt;,&lt;/li&gt;&#xA;&lt;li&gt;a stuck projects view showing projects that currently don't move along, and&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;custom views that are special searches&lt;/strong&gt; and combinations of different views.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The only thing you need to do to start using the agenda for searching your notes is add any files you want to search to &lt;a href=&quot;http://orgmode.org/manual/Agenda-files.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-agenda-files&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The information to be shown is normally collected from all agenda files, the files listed in the variable &lt;code&gt;org-agenda-files&lt;/code&gt;. If a directory is part of this list, all files with the extension &lt;code&gt;.org&lt;/code&gt; in this directory will be part of the list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So in your case you'll want to add something like this to your init-file:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-files '(&amp;quot;/path/to/Notes/Linux&amp;quot; &amp;quot;/path/to/Notes/Programming&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For lots of examples and practical advice I also recommend you check out the article on &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/advanced-searching.html&quot; rel=&quot;noreferrer&quot;&gt;Advanced Searching&lt;/a&gt; on &lt;a href=&quot;http://orgmode.org/worg/&quot; rel=&quot;noreferrer&quot;&gt;Worg&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2&gt;[UPDATE] Limiting search to specific file sets&lt;/h2&gt;&#xA;&lt;p&gt;As mentioned in the comments, OP wants to be able to restrict searches to specific sets of files. In technical terms, this means setting &lt;code&gt;org-agenda-files&lt;/code&gt; to different values depending on context. This can be achieved using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;directory-local variables&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The usual way to define directory-local variables is to put a file named &lt;code&gt;.dir-locals.el&lt;/code&gt; in a directory. Whenever Emacs visits any file in that directory or any of its subdirectories, it will apply the directory-local variables specified in &lt;code&gt;.dir-locals.el&lt;/code&gt;, [...].&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;For example, let's say that&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;while visiting files stored in &lt;code&gt;Notes/Linux&lt;/code&gt; you want to use the agenda to only search &lt;code&gt;.org&lt;/code&gt; files stored in &lt;code&gt;Notes/Linux&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;while visiting files stored in &lt;code&gt;Notes/Programming&lt;/code&gt;, you want to use the agenda to only search &lt;code&gt;.org&lt;/code&gt; files stored in &lt;code&gt;Notes/Programming&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Here's what to do to enable this behavior:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Add a &lt;code&gt;.dir-locals.el&lt;/code&gt; file with the following content to both &lt;code&gt;Notes/Linux&lt;/code&gt; and &lt;code&gt;Notes/Programming&lt;/code&gt;:&lt;/p&gt;&#xA; &lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; ((nil . ((org-agenda-files . (&amp;quot;.&amp;quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This sets the list of &lt;code&gt;org-agenda-files&lt;/code&gt; to include all files in the current directory.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add the following code to your init-file:&lt;/p&gt;&#xA; &lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (add-hook 'org-agenda-mode-hook #'hack-dir-local-variables-non-file-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This step is necessary to ensure that &lt;code&gt;*Org Agenda*&lt;/code&gt; (a &lt;em&gt;non-file buffer&lt;/em&gt;) respects your directory-local settings for &lt;code&gt;org-agenda-files&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Next time you visit a file stored in &lt;code&gt;Notes/Linux&lt;/code&gt; or &lt;code&gt;Notes/Programming&lt;/code&gt;, Emacs will ask you whether you would like to apply the settings stored in &lt;code&gt;.dir-locals.el&lt;/code&gt;. Hit &lt;kbd&gt;!&lt;/kbd&gt; to tell Emacs to apply the settings &lt;em&gt;and&lt;/em&gt; mark them as safe for future sessions (you will not be prompted again for files in the same directory).&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-03-15T00:38:16.340" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="10019" PostTypeId="2" ParentId="9897" CreationDate="2015-03-14T12:59:53.077" Score="0" Body="&lt;p&gt;Investigating all my local settings finally gave the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had in my &lt;code&gt;.inputrc&lt;/code&gt; (settings for &lt;code&gt;readline&lt;/code&gt;, which is used by the interactive python interpreter) the line :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Control-j: menu-complete&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no idea what it was supposed to do, but at least commenting it out fixed it.&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2015-03-14T12:59:53.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10020" PostTypeId="1" CreationDate="2015-03-14T15:08:33.593" Score="1" ViewCount="170" Body="&lt;p&gt;How would one make sure that the .emacs (init file) automatically initializes when you open Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently running on Windows, if it's relevant. Thus far I have to locate and evaluate the .emacs file &lt;strong&gt;every time&lt;/strong&gt; I open Emacs, despite having package-initialize which is reported to do this automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are certain packages and customizations that are almost necessary to the &quot;proper&quot; functioning of Emacs, and so it is not hyperbolic to describe this as critical beyond the significant inconvenience it poses.&lt;/p&gt;&#xA;" OwnerUserId="6634" LastEditorUserId="2096" LastEditDate="2017-04-22T04:29:51.973" LastActivityDate="2017-04-22T04:29:51.973" Title="How would one make sure that the .emacs (init file) automatically initializes when you open Emacs?" Tags="|init-file|microsoft-windows|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10021" PostTypeId="2" ParentId="10020" CreationDate="2015-03-14T15:16:23.310" Score="10" Body="&lt;p&gt;Emacs will load the user-init-file at startup by default, unless you explicitly tell it not to (e.g. with the -Q argument on the command line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect your .emacs file is in the wrong place. Start Emacs and try &lt;code&gt;C-h v user-init-file&lt;/code&gt; to see where Emacs is looking. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Location-of-init-file.html#Location-of-init-file&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Location-of-init-file.html#Location-of-init-file&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest solution is likely that you need to set a HOME environment variable because Emacs is looking in places you don't expect (as detailed in the FAQ linked above).&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-03-14T15:16:23.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10022" PostTypeId="2" ParentId="9957" CreationDate="2015-03-14T16:07:57.357" Score="2" Body="&lt;p&gt;Here is an extremely crude function that will play a random album in EMMS.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun emms-play-random-album ()&#xA;  (interactive)&#xA;  (emms-browse-by-album)&#xA;  (goto-random-line)&#xA;  (emms-browser-add-tracks-and-play))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It depends on &lt;a href=&quot;http://www.emacswiki.org/emacs/goto-random-line.el&quot; rel=&quot;nofollow&quot;&gt;functions posted to the Emacs Wiki&lt;/a&gt; by sburke@cpan.org.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun goto-random-line ()&#xA;  &quot;Go to a random line in this buffer.&quot;&#xA;  ; good for electrobibliomancy.&#xA;  (interactive)&#xA;  (goto-line (1+ (random (buffer-line-count)))))&#xA;&#xA;(defun buffer-line-count () &#xA;  &quot;Return the number of lines in this buffer.&quot;&#xA;  (count-lines (point-min) (point-max))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm making this answer a community wiki as I'm sure it could be improved on.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-14T16:07:57.357" CommentCount="1" CommunityOwnedDate="2015-03-14T16:07:57.357" ContentLicense="CC BY-SA 3.0" />
  <row Id="10025" PostTypeId="2" ParentId="428" CreationDate="2015-03-14T17:58:15.940" Score="10" Body="&lt;p&gt;You are correct that ein at tkf's repository on &lt;a href=&quot;https://github.com/tkf/emacs-ipython-notebook&quot;&gt;github&lt;/a&gt; only works with versions of IPython prior to 2.x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that said, however, if you use this &lt;a href=&quot;https://github.com/millejoh/emacs-ipython-notebook&quot;&gt;version&lt;/a&gt; you will find that it works with IPython 2.x and Jupyter (i.e. IPython 3.0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Installing ein from MELPA or el-get will install the latest ein which works with the latest versions of IPython.&lt;/p&gt;&#xA;" OwnerUserId="6772" LastActivityDate="2015-03-14T17:58:15.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10026" PostTypeId="2" ParentId="9895" CreationDate="2015-03-14T21:33:51.010" Score="1" Body="&lt;p&gt;As recommended in the bug comments, I installed from melpa.org and was no longer able to reproduce the bug with evil-20150313.1208&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-03-14T21:33:51.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10027" PostTypeId="1" AcceptedAnswerId="10031" CreationDate="2015-03-14T23:19:32.883" Score="2" ViewCount="363" Body="&lt;p&gt;I have the variable &lt;code&gt;completing-read-function&lt;/code&gt; set to &lt;code&gt;helm--completing-read-default&lt;/code&gt;. When an external package invokes &lt;code&gt;completing-read&lt;/code&gt;, this gives &lt;code&gt;helm&lt;/code&gt;-based completion. However, the default item picked by the &lt;code&gt;helm&lt;/code&gt; completions buffer is the exact string that I have typed. In the &lt;code&gt;helm&lt;/code&gt; window, this is the one at the top of all the selections and prefixed by a &lt;code&gt;?&lt;/code&gt;. This isn't the behaviour I see with &lt;code&gt;helm-find-files&lt;/code&gt; - the default selection there is the top match. So, if I have entered &lt;code&gt;abc&lt;/code&gt; and there is a file named &lt;code&gt;xyzabc.txt&lt;/code&gt; it will be selected(assuming its the top match). How do I get this behaviour with &lt;code&gt;helm--completing-read-default&lt;/code&gt;? Note that I don't want to change the code of the external package which simply invokes &lt;code&gt;completing-read&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-03-15T08:09:24.817" Title="Configure helm--completing-read-default to pick the top match" Tags="|helm|completing-read|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10028" PostTypeId="1" AcceptedAnswerId="10030" CreationDate="2015-03-15T06:35:08.937" Score="1" ViewCount="101" Body="&lt;p&gt;C-x 2&#xA;On &lt;code&gt;Split-window-below&lt;/code&gt;, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) i like the cursor/point to be in the other window (newly opened) and not in present window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) instead of loading in the current-buffer in the other window, i prefer it to be the previously visited file (or) my first entry in &lt;code&gt;(switch-buffer)&lt;/code&gt; (or) &lt;code&gt;C-x b&lt;/code&gt; list&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Does elisp support hooks for methods (&lt;code&gt;split-window-below&lt;/code&gt; hook)?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-03-15T08:18:02.437" Title="Customize Split-window-below - C x 2" Tags="|window|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10029" PostTypeId="1" AcceptedAnswerId="10032" CreationDate="2015-03-15T07:34:15.370" Score="12" ViewCount="3353" Body="&lt;p&gt;I know I can use &lt;code&gt;*bold*&lt;/code&gt;, &lt;code&gt;/italic/&lt;/code&gt;, &lt;code&gt;_underline_&lt;/code&gt;, &lt;code&gt;=verbatim=&lt;/code&gt;, &lt;code&gt;~code~&lt;/code&gt;, and &lt;code&gt;+strike-through+&lt;/code&gt; to &lt;a href=&quot;http://orgmode.org/manual/Emphasis-and-monospace.html&quot; rel=&quot;noreferrer&quot;&gt;apply markup to text&lt;/a&gt; in &lt;code&gt;org-mode&lt;/code&gt;. But how do I create key bindings for applying these changes to a region of text? For example, if I want to make some text bold, is there an easier way than&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;navigating to the front of the text&lt;/li&gt;&#xA;&lt;li&gt;prefixing it with a &lt;code&gt;*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;navigating to the end of the text&lt;/li&gt;&#xA;&lt;li&gt;appending a &lt;code&gt;*&lt;/code&gt;? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I can't seem to find any command that &quot;bolds&quot; a stretch of text, such as &lt;code&gt;org-make-region-bold&lt;/code&gt;. Is there such a command?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="504" LastEditDate="2015-03-15T14:51:35.937" LastActivityDate="2020-07-03T18:27:46.203" Title="Org-Mode: How to create an &quot;org mode markup&quot; keybinding?" Tags="|org-mode|key-bindings|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10030" PostTypeId="2" ParentId="10028" CreationDate="2015-03-15T07:59:05.283" Score="3" Body="&lt;p&gt;I have the similar need, but for &lt;code&gt;C-x 3 (split-window-right)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun chunyang-split-window-right ()&#xA;  (interactive)&#xA;  (select-window (split-window-right))&#xA;  (switch-to-buffer (other-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-03-15T08:18:02.437" LastActivityDate="2015-03-15T08:18:02.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10031" PostTypeId="2" ParentId="10027" CreationDate="2015-03-15T08:09:24.817" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/376&quot; rel=&quot;noreferrer&quot;&gt;I've asked helm's author years ago about this particular issue&lt;/a&gt;.  Your described behaviour happens whenever a completing read does not specify that it requires an exact candidate match and is therefore not considered a helm bug.  That's why he recommends fixing these functions instead of providing an option to allow for this behaviour.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-03-15T08:09:24.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10032" PostTypeId="2" ParentId="10029" CreationDate="2015-03-15T12:18:01.950" Score="16" Body="&lt;ol&gt;&#xA;&lt;li&gt;Mark you region&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;C-c C-x C-f *&lt;/code&gt; for &lt;strong&gt;bold&lt;/strong&gt;, &lt;code&gt;C-c C-x C-f /&lt;/code&gt; for &lt;em&gt;italic&lt;/em&gt; etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;org-emphasize&lt;/code&gt; is an interactive compiled Lisp function in &lt;code&gt;org.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(org-emphasize &amp;amp;optional CHAR)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Insert or change an emphasis, i.e. a font like bold or italic.&#xA;If there is an active region, change that region to a new emphasis.&#xA;If there is no region, just insert the marker characters and position&#xA;the cursor between them.&#xA;CHAR should be the marker character.  If it is a space, it means to&#xA;remove the emphasis of the selected region.&#xA;If CHAR is not given (for example in an interactive call) it will be&#xA;prompted for.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1979" LastEditDate="2020-07-03T18:27:46.203" LastActivityDate="2020-07-03T18:27:46.203" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10033" PostTypeId="1" CreationDate="2015-03-15T13:49:53.900" Score="8" ViewCount="2924" Body="&lt;p&gt;&lt;strong&gt;Is there an Emacs face that can be used to control the colour of inactive buffer names?&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally when setting the face &lt;code&gt;mode-line-buffer-id&lt;/code&gt; all windows are affected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example the &lt;code&gt;mode-line&lt;/code&gt; has a light background, so I set &lt;code&gt;mode-line-buffer-id&lt;/code&gt; to a much darker &lt;code&gt;#333&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/NFq51.png&quot; alt=&quot;mode-line with dark buffer-id on light background&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to invert the colour combination for for &lt;code&gt;mode-line-inactive&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this is possible for most of the text in the mode-line of inactive windows, the buffer names becomes unreadable since it's still controlled by the &lt;code&gt;mode-line-buffer-id&lt;/code&gt; face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/4gakN.png&quot; alt=&quot;mode-line-inactive with dark buffer-id on dark background&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that setting &lt;code&gt;mode-line-inactive&lt;/code&gt; to a lighter background would work around the problem, but that's not the result I wish to achieve.&lt;/p&gt;&#xA;" OwnerDisplayName="user66" LastEditorUserId="15477" LastEditDate="2023-02-20T17:55:08.250" LastActivityDate="2023-02-20T17:55:08.250" Title="Change mode-line-buffer-id face for inactive windows" Tags="|themes|mode-line|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10034" PostTypeId="2" ParentId="10029" CreationDate="2015-03-15T14:41:37.597" Score="8" Body="&lt;p&gt;You can make use of &lt;a href=&quot;http://doc.endlessparentheses.com/Fun%2Felectric-pair-mode.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;electric-pair-mode&lt;/code&gt;&lt;/a&gt;&lt;sup&gt;1&lt;/sup&gt; to facilitate insertion of mark-up characters in &lt;code&gt;org-mode&lt;/code&gt;. Add the following code to your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(electric-pair-mode 1)&#xA;&#xA;(defvar org-electric-pairs '((?\* . ?\*) (?/ . ?/) (?= . ?=)&#xA;                             (?\_ . ?\_) (?~ . ?~) (?+ . ?+)) &quot;Electric pairs for org-mode.&quot;)&#xA;&#xA;(defun org-add-electric-pairs ()&#xA;  (setq-local electric-pair-pairs (append electric-pair-pairs org-electric-pairs))&#xA;  (setq-local electric-pair-text-pairs electric-pair-pairs))&#xA;&#xA;(add-hook 'org-mode-hook 'org-add-electric-pairs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this in place, all you need to do to wrap a region with mark-up characters is press the corresponding character (&lt;code&gt;*&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt;, &lt;code&gt;~&lt;/code&gt;, or &lt;code&gt;+&lt;/code&gt;) once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an additional benefit, Emacs will automatically insert matching pairs of mark-up characters at point if there is no region. For example, pressing &lt;kbd&gt;*&lt;/kbd&gt; will insert &lt;code&gt;**&lt;/code&gt; and leave point between the two chars so you can continue typing without having to move point.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; This mode is built-in; there's no need to install any third-party packages to use it.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-03-15T14:41:37.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10035" PostTypeId="2" ParentId="10029" CreationDate="2015-03-15T14:42:00.297" Score="8" Body="&lt;p&gt;You can use the &lt;a href=&quot;https://github.com/rejeep/wrap-region.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;wrap-region&lt;/code&gt;&lt;/a&gt; package (also available on Melpa) to wrap a region with any character of your choice. This of course can be configured per major mode. &lt;/p&gt;&#xA;&#xA; &lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'wrap-region)&#xA;&#xA;(add-hook 'org-mode-hook #'wrap-region-mode)&#xA;&#xA;(wrap-region-add-wrapper &quot;=&quot; &quot;=&quot; nil 'org-mode) ; select region, hit = then region -&amp;gt; =region= in org-mode&#xA;(wrap-region-add-wrapper &quot;*&quot; &quot;*&quot; nil 'org-mode) ; select region, hit * then region -&amp;gt; *region* in org-mode&#xA;(wrap-region-add-wrapper &quot;/&quot; &quot;/&quot; nil 'org-mode) ; select region, hit / then region -&amp;gt; /region/ in org-mode&#xA;(wrap-region-add-wrapper &quot;_&quot; &quot;_&quot; nil 'org-mode) ; select region, hit _ then region -&amp;gt; _region_ in org-mode&#xA;(wrap-region-add-wrapper &quot;+&quot; &quot;+&quot; nil 'org-mode) ; select region, hit + then region -&amp;gt; +region+ in org-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;expand-region&lt;/code&gt;&lt;/a&gt; package complements this package very well (also available in Melpa). &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Usage&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You select the word or phrase using the key binding you chose for &lt;code&gt;er/expand-region&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;*&lt;/code&gt; to emphasize that region as bold (in &lt;code&gt;org-mode&lt;/code&gt;). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-03-15T14:51:08.183" LastActivityDate="2015-03-15T14:51:08.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10036" PostTypeId="1" CreationDate="2015-03-15T15:12:34.283" Score="3" ViewCount="503" Body="&lt;p&gt;In emacs, the command &quot;escape-q&quot; word wraps a paragraph. However a lot of text I copy from the internet has paragraphs that each consist of several sentences, but are not separated by blank lines. Also, where code is embedded in the text, unless it is separated by a blank line from the previous text, it gets gathered up into the paragraph destroying the separate lines and indentation of the code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To word wrap these and preserve the paragraph breaks etc I have to go through the file and insert blank lines, which is long-winded and tedious in a long file..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way of word wrapping such text, by &quot;select all&quot; on a long file,  without inserting blank lines?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is some text as copied from the internet, and pasted into emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hello World&#xA; The famous &quot;hello world&quot; program, is the first program every programmer writes. It is one of the simplest possible programs to write, but there is still a lot to learn about what happens below the surface.&#xA; The hello world code in C:&#xA;&#xA; #include &amp;lt;stdio.h&amp;gt;&#xA; &#xA; int main(int argc, char **argv)&#xA; {&#xA;  char str[]=&quot;Hello world!!&quot;;&#xA;  printf(&quot;%s\n&quot;,str);&#xA;&#xA;  return 0;&#xA; }&#xA;&#xA;There it is, very simple to look at, only 5 real lines of meaningful code. However, all 5 of those lines are worth looking at in detail.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I select it all and use &quot;escape-q&quot; I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hello World  The famous &quot;hello world&quot; program, is the first program&#xA;every programmer writes. It is one of the simplest possible programs&#xA;to write, but there is still a lot to learn about what happens below&#xA;the surface.   The hello world code in C:&#xA;&#xA; #include &amp;lt;stdio.h&amp;gt;    int main(int argc, char **argv)  {   char&#xA;str[]=&quot;Hello world!!&quot;;   printf(&quot;%s\n&quot;,str);&#xA;&#xA;  return 0;  }&#xA;&#xA;There it is, very simple to look at, only 5 real lines of meaningful&#xA;code. However, all 5 of those lines are worth looking at in detail.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And, of course what I really want is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hello World&#xA; The famous &quot;hello world&quot; program, is the first program every programmer writes.&#xA;It is one of the simplest possible programs to write, but there is still a lot&#xA;to learn about what happens below the surface.&#xA; The hello world code in C:&#xA;&#xA; #include &amp;lt;stdio.h&amp;gt;&#xA;         &#xA; int main(int argc, char **argv)&#xA;   {&#xA;     char str[]=&quot;Hello world!!&quot;;&#xA;     printf(&quot;%s\n&quot;,str);&#xA;&#xA;     return 0;&#xA;   }&#xA;&#xA; There it is, very simple to look at, only 5 real lines of meaningful code.&#xA; However, all 5 of those lines are worth looking at in detail.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Acknowledgement: I copied the snippet from &lt;a href=&quot;http://betteros.org/tut/tut1.php&quot; rel=&quot;nofollow&quot;&gt;this BetterOs.org Tutorial&lt;/a&gt;. Thanks to the author for that excellent tutorial, and hope he doesn't mind.   &lt;/p&gt;&#xA;" OwnerUserId="6777" LastActivityDate="2015-05-09T20:19:55.640" Title="How can I easily word wrap long text files that include programming code" Tags="|fill-paragraph|formatting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10037" PostTypeId="1" AcceptedAnswerId="10038" CreationDate="2015-03-15T15:33:10.840" Score="2" ViewCount="348" Body="&lt;p&gt;Notice in the screenshot below, the &lt;code&gt;*Paradox Report*&lt;/code&gt; buffer is not&#xA;displayed in the menu-bar, even though it's clearly a buffer in the&#xA;buffer-list.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2iAdZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2iAdZ.png&quot; alt=&quot;Diverging menus&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&#xA;&lt;sub&gt;(source: &lt;a href=&quot;https://pbs.twimg.com/media/B_cjV6HWYAAgzIW.png:large&quot; rel=&quot;nofollow noreferrer&quot;&gt;twimg.com&lt;/a&gt;)&lt;/sub&gt;&lt;/p&gt;&#xA;&lt;p&gt;An easy way to test this is to run &lt;code&gt;M-: (get-buffer-create &amp;quot;*hello*&amp;quot;)&lt;/code&gt;, and then look for this buffer on the menu-bar.&lt;/p&gt;&#xA;&lt;p&gt;I'm guessing the menu-bar tries to be smart and ignore some buffers&#xA;the user probably doesn't care about. My question is &lt;strong&gt;what criteria&#xA;does it use?&lt;/strong&gt; and &lt;strong&gt;how can I get around it?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;That is, when I create the &lt;code&gt;*Paradox Report*&lt;/code&gt; buffer, I want to ensure&#xA;it will get displayed on the menu-bar.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;After I manually visit the buffer once it does get displayed on the menu-bar.&lt;/li&gt;&#xA;&lt;li&gt;The buffer name does not start with a space (is is &lt;code&gt;&amp;quot;*Paradox Report*&amp;quot;&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;It seems this only happens on (development code for what might become) Emacs 25.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastEditorUserId="14920" LastEditDate="2022-12-26T20:30:13.677" LastActivityDate="2022-12-26T20:30:13.677" Title="Why are some buffers not displayed in the menu-bar?" Tags="|buffers|menu-bar|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="10038" PostTypeId="2" ParentId="10037" CreationDate="2015-03-15T17:16:46.670" Score="0" Body="&lt;p&gt;Ok, it was a bug. Fixed now in the Emacs development code for what might become Emacs 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem was that, by default, Emacs only displays the first 10 buffers on the menu-bar. But that was done slightly wrong, so it caused much less than 10 buffers to be displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the screenshot, only 4 are displayed. On a clean &lt;code&gt;emacs -Q&lt;/code&gt;, I could get at most 6 buffers to display on the menu-bar.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="105" LastEditDate="2015-08-12T14:32:13.487" LastActivityDate="2015-08-12T14:32:13.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10039" PostTypeId="2" ParentId="10033" CreationDate="2015-03-15T18:15:57.190" Score="0" Body="&lt;p&gt;I'm not sure it is possible.  It seems that the mode line is updated only when its window is selected (testing using calls to &lt;code&gt;message&lt;/code&gt; bears this out).  And the code that does this is C code, not Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use a conditional expression in the definition of &lt;code&gt;mode-line-buffer-identification&lt;/code&gt;, so that the face to use is computed dynamically.  But I don't know of any function or variable that you can use to test whether a given window has an inactive mode-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot use &lt;code&gt;selected-window&lt;/code&gt;, for example, because that always points to the window with the active mode-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of dynamic updating that is based on the buffer name. It is not what you want, but it at least shows you what you can do.  If you can come up with a way to test whether the window being updated is selected then you could substitute that for the buffer-name test.  (But my impression is that only the selected window gets its mode-line updated.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default mode-line-buffer-identification&#xA;              '(:eval&#xA;                (list (propertize &quot;%b&quot;&#xA;                       'face (if ;; NOPE (eq (selected-window) (get-buffer-window (current-buffer)))&#xA;                                 (eq (current-buffer) (get-buffer &quot;some-buffer&quot;))&#xA;                                 'mode-line-buffer-id&#xA;                               'some-other-face)&#xA;                       'help-echo &quot;Buffer name mouse-1: Previous buffer\nmouse-3: Next buffer&quot;&#xA;                       'mouse-face 'mode-line-highlight&#xA;                       'local-map mode-line-buffer-identification-keymap))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another thing you might try is advising function &lt;code&gt;format-mode-line&lt;/code&gt;.  It does apparently distinguish a window with an active mode-line from one with an inactive mode-line.  But it too is coded in C, so I doubt you will get very far with advising it.  It tests C variable &lt;code&gt;Qmode_line_inactive&lt;/code&gt;, FWIW.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd suggest asking this question on one of the Emacs mailing lists (e.g. &lt;code&gt;help-gnu-emacs@gnu.org&lt;/code&gt;), if you don't get a satisfactory answer here. Seems like it could be good to be able to do what you request.  +1 for the question, in any case.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:20:31.770" LastActivityDate="2015-05-09T20:20:31.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10040" PostTypeId="1" AcceptedAnswerId="35792" CreationDate="2015-03-15T22:02:46.747" Score="4" ViewCount="581" Body="&lt;p&gt;When I copy some text into a buffer in Fundamental mode, from some website opened in Firefox, there are always some unnecessary indents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, from &lt;a href=&quot;https://github.com/hakimel/reveal.js/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/hakimel/reveal.js/&lt;/a&gt;, I selected and copied some text by Ctrl+c, and pasted it into a buffer in emacs running in a terminal. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PDF Export&#xA;&#xA;Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use Google Chrome. Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.&#xA;&#xA;    Open your presentation with print-pdf included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet (css/print/pdf.css). You can test this with lab.hakim.se/reveal-js?print-pdf.&#xA;    Open the in-browser print dialog (CMD+P).&#xA;    Change the Destination setting to Save as PDF.&#xA;    Change the Layout to Landscape.&#xA;    Change the Margins to None.&#xA;    Click Save.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The text in the buffer becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PDF Export&#xA;&#xA;Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use Google Chrome. Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.&#xA;&#xA;    Open your presentation with print-pdf included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet (css/print/pdf.css). You can test this with lab.hakim.se/reveal-js?print-pdf.&#xA;        Open the in-browser print dialog (CMD+P).&#xA;            Change the Destination setting to Save as PDF.&#xA;                Change the Layout to Landscape.&#xA;                    Change the Margins to None.&#xA;                        Click Save.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I avoid the unnessary indents? Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed GNU Emacs 24.4.1 from its official site, a few days ago, without having made any change to personal configuration. The mode is Fundamental. I don't know it uses some minor mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/F1VUR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When I copy from a website opened in Chrome:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use Google Chrome. Here's an example of an exported presentation that's been uploaded to SlideShare: &lt;a href=&quot;http://www.slideshare.net/hakimel/revealjs-300&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.slideshare.net/hakimel/revealjs-300&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Open your presentation with print-pdf included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet (css/print/pdf.css). You can test this with lab.hakim.se/reveal-js?print-pdf.&#xA;&#xA;Open the in-browser print dialog (CMD+P).&#xA;Change the Destination setting to Save as PDF.&#xA;Change the Layout to Landscape.&#xA;Change the Margins to None.&#xA;Click Save.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IGnF8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I agree the problem is browser dependent (notice how different the selected regions are in the two browsers, see the pictures), but it is also emacs dependent, since emacs can't handle tab without inheriting tabs from previous line.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2015-04-01T17:36:27.373" LastActivityDate="2017-09-27T15:41:26.053" Title="Unnecessary indents when copying some text into a buffer" Tags="|indentation|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10041" PostTypeId="2" ParentId="2861" CreationDate="2015-03-16T01:18:17.410" Score="4" Body="&lt;p&gt;Concise instructions for access with root are also found here &lt;a href=&quot;http://www.reddit.com/r/emacs/comments/2adkvc/how_to_get_emacs_to_run_on_android_painlessly/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.reddit.com/r/emacs/comments/2adkvc/how_to_get_emacs_to_run_on_android_painlessly/&lt;/a&gt;. Note the link &lt;a href=&quot;http://emacs.zielm.com/data/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emacs.zielm.com/data/&lt;/a&gt; seems broken. However, I tried to find a way to do this without root, and here are some results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried following the GNURoot option offered in a couple of places (in addition to the current answer, &lt;a href=&quot;http://www.linuxuser.co.uk/features/run-linux-on-android-part-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.linuxuser.co.uk/features/run-linux-on-android-part-1&lt;/a&gt;, &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsOnAndroid&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/EmacsOnAndroid&lt;/a&gt;), and since it was took moderate searching for someone with little Linux experience, this may be useful for others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNURoot lets you create a Linux build inside your Android. The 'wheezy' it offers by default is 'debian'. You can select a different build if you want to create it. Once you have created it, run it with fakeroot option ticked, you will then see console of your superuser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A guide on installing Emacs on various builds exists here: &lt;a href=&quot;http://wikemacs.org/wiki/Installing_Emacs_on_GNU/Linux&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://wikemacs.org/wiki/Installing_Emacs_on_GNU/Linux&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Emacs 23&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running Emacs 23 turned out to be quite easy. You just type in &lt;code&gt;apt-get install emacs&lt;/code&gt; in the console, answer yes on the checks, and you are able to run emacs by typing emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Emacs 24&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't get Emacs 24 running, but perhaps someone may be able to pick up from this and find a way quicker. If anyone is able to make it work, perhaps you can follow up, or update this post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24 seems much more tricky, as it is not well maintained on some builds (perhaps someone understands the situation better). This is available under 'emacs-snapshot' which can be found via the series of links &lt;a href=&quot;http://emacs.naquadah.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emacs.naquadah.org/&lt;/a&gt; -&gt; &lt;a href=&quot;https://launchpad.net/~cassou/+archive/ubuntu/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://launchpad.net/~cassou/+archive/ubuntu/emacs&lt;/a&gt; -&gt; &lt;a href=&quot;https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa&lt;/a&gt;, which should be the working version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining the results from the second of the link sequence, you would need to type the following. You don't have to type sudo if you tick the fake root box on startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: You won't have to purge if you haven't got any version of emacs installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note2: To gain the function &lt;code&gt;add-apt-repository&lt;/code&gt;, you'll have to install an extension beforehand, as said here &lt;a href=&quot;https://askubuntu.com/questions/38021/how-to-add-a-ppa-on-a-server&quot;&gt;https://askubuntu.com/questions/38021/how-to-add-a-ppa-on-a-server&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;For my version this command worked to add 'add-apt-repository'.&#xA;$ sudo apt-get install python-software-properties&#xA;&#xA;$ sudo apt-get update&#xA;$ sudo apt-get install&#xA;$ sudo apt-get purge emacs emacs-snapshot-common emacs-snapshot-bin-common emacs-snapshot emacs-snapshot-el emacs-snapshot-gtk emacs23 emacs23-bin-common emacs23-common emacs23-el emacs23-nox emacs23-lucid auctex apel emacs24 emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs24-el&#xA;&#xA;To add this PPA:&#xA;$ sudo add-apt-repository ppa:cassou/emacs&#xA;Or the one he refers to:&#xA;$ sudo add-apt-repository ppa:ubuntu-elisp/ppa &#xA;$ sudo apt-get update&#xA;&#xA;Then, you should be able to type for emacs-snapshot:&#xA;$ sudo apt-get install emacs-snapshot-el emacs-snapshot-gtk emacs-snapshot&#xA;&#xA;*Or*, for emacs24:&#xA;$ sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, neither of the ppa's offered in these links seem to be working at the moment, or I have missed a step in adding them. GNURoot does not seem an easy option to use. Perhaps someone is able to complete the sequence. I guess these kind of instructions should eventually be made into a community wiki.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info could be potentially found here: &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsSnapshotAndDebian&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/EmacsSnapshotAndDebian&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another useful option may be to instally the &lt;em&gt;wheezyx&lt;/em&gt; option instead of &lt;em&gt;wheezy&lt;/em&gt; to begin with, as it may offer a type of a mouse support via the touch interface.&lt;/p&gt;&#xA;" OwnerUserId="5492" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2015-03-16T01:31:50.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10042" PostTypeId="2" ParentId="10036" CreationDate="2015-03-16T02:23:55.427" Score="1" Body="&lt;p&gt;You say &amp;quot;&lt;em&gt;To word wrap these and preserve the paragraph breaks etc I have to go through the file and insert blank lines, which is long-winded and tedious in a long file.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you can do that - &lt;em&gt;manually go through and insert blank lines where they belong&lt;/em&gt; - then one of two things is true:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It is relatively straightforward to decide where the blank lines belong. By this I mean that the determination is relatively unsophisticated, and perhaps even trivial/mechanical.&lt;/p&gt;&#xA;&lt;p&gt;For example, maybe you do it whenever you see a sentence that begins at the start of a line (&lt;code&gt;bolp&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Such determination is not straightforward. It requires relatively deep consideration, thought, and judgment.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If (2) is the case, then I'd say that you are out of luck. If (1) is the case, however, the Emacs answer seems obvious: record what you do, and replay it. IOW, start with a &lt;em&gt;keyboard macro&lt;/em&gt;. You might end up defining a slightly more sophisticated command, but a keyboard macro is a good place to start, for something like this.&lt;/p&gt;&#xA;&lt;p&gt;Some things that might help:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Know how to move backward (&lt;code&gt;M-a&lt;/code&gt;) and forward (&lt;code&gt;M-e&lt;/code&gt;) across a sentence, to end up at its beginning or its end.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Know how to test for point being at a line beginning (&lt;code&gt;bolp&lt;/code&gt;) or end (&lt;code&gt;eolp&lt;/code&gt;), and for beginning (&lt;code&gt;bobp&lt;/code&gt;) and end (&lt;code&gt;eobp&lt;/code&gt;) of the buffer (possibly narrowed).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Maybe give it a try and ask again, saying what you've tried, if you need more help.&lt;/p&gt;&#xA;&lt;p&gt;[You also say &amp;quot;&lt;em&gt;Is there a way of word wrapping such text, by &amp;quot;select all&amp;quot; on a long file,&lt;/em&gt; &lt;em&gt;&lt;strong&gt;without inserting blank lines?&lt;/strong&gt;&lt;/em&gt;&amp;quot;.  I am assuming that by the last phrase you really mean &lt;em&gt;without having to insert blank lines manually&lt;/em&gt; (individually). If you meant that you do not want blank lines inserted at all then you need to look at something like &lt;code&gt;visual-line-mode&lt;/code&gt;, which pseudo-wraps.]&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Anyway, in case it helps, here is one quick possibility. But it's really worth trying to experiment on your own, either to improve this or to see what you can do in a different way.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun split-to-paras (beg end)&#xA;  &amp;quot;Split the buffer (or active region) into paragraphs.&#xA;Split whenever a sentence starts at the beginning of a line.&amp;quot;&#xA;  (interactive &amp;quot;r&amp;quot;)&#xA;  (unless (use-region-p) (setq beg (point-min) end (point-max)))&#xA;  (save-excursion&#xA;    (goto-char (point-max))&#xA;    (while (&amp;gt; (point) beg)&#xA;      (backward-sentence)&#xA;      (when (and (bolp)  (not (looking-back &amp;quot;\n\n&amp;quot;))  (not (bobp)))&#xA;        (insert-char ?\n)&#xA;        (backward-char)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then &lt;code&gt;M-x split-to-paras&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-09T20:19:55.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10043" PostTypeId="2" ParentId="2861" CreationDate="2015-03-16T03:14:45.177" Score="0" Body="&lt;p&gt;If I really need to get to Emacs on my iPad, I do it via SSH using &lt;a href=&quot;https://itunes.apple.com/us/app/serverauditor-ssh-shell-console/id549039908?mt=8&quot; rel=&quot;nofollow noreferrer&quot;&gt;Serverauditor&lt;/a&gt;. It's monochrome and the keyboard interface is tedious. A specially-designed Emacs client for the iPad could probably resolve these issues. (EDIT: This assumes you have access to an a server with Emacs, of course.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I've also recently discovered &lt;a href=&quot;http://c9.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cloud9&lt;/a&gt;, which allows me to access emacs via Safari. Keybindings remain this biggest problem, &lt;a href=&quot;https://emacs.stackexchange.com/questions/19827/configuration-for-using-emacs-on-cloud9&quot;&gt;even on Windows&lt;/a&gt;, and the fact that the general iOS keyboard has no &lt;kbd&gt;Ctrl&lt;/kbd&gt; or &lt;kbd&gt;Alt&lt;/kbd&gt; makes it much worse.  &lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-01-25T19:04:30.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10044" PostTypeId="2" ParentId="8203" CreationDate="2015-03-16T08:04:13.347" Score="1" Body="&lt;p&gt;You do not need to use a full Emacs email client like Gnus or mu4e (although I recommend it); &lt;code&gt;message-mode&lt;/code&gt; should be sufficient to compose and send email, and to encrypt or sign outgoing messages.  I have not used &lt;code&gt;smtpmail&lt;/code&gt; before.  My setup relies on an external smtp client (&lt;code&gt;msmtp&lt;/code&gt;), but this should not be necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compose emails, use &lt;code&gt;message-mail&lt;/code&gt;.  To sign the message, run &lt;code&gt;mml-secure-sign&lt;/code&gt;.  To send it with whatever mail function has been configured hit &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What must I {do, get, have} in order to generate keys with which to sign outgoing email?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You need to have a GPG keypair and run &lt;code&gt;mml-secure-sign&lt;/code&gt; before sending your mail from within a &lt;code&gt;message-mode&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-03-16T08:04:13.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10045" PostTypeId="2" ParentId="10040" CreationDate="2015-03-16T10:55:11.587" Score="1" Body="&lt;p&gt;Well, it's not happening with my emacs (GNU Emacs 23.4.1, started with &lt;code&gt;emacs -q -nw&lt;/code&gt;, &lt;code&gt;emacs -q&lt;/code&gt;, or for that matter, &lt;code&gt;emacs&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I remember running into that one.  Either with an older version or with some minor mode or variable.  I just can't remember which ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it act the same if you start with &lt;code&gt;emacs -q -nw&lt;/code&gt;?  (If so, what's your emacs version?)  If not, it's time to check your configs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ETA: Hang on, I've managed to reproduce it.  Or something like it.  If I copy a text with two leading tabs on consecutive lines, I get the jigsaw.  The text you indicated, didn't copy that way from my Firefox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Browser dependent issue, or a different issue with similar symptoms?  That is, are you seeing double tabs being copied?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though, looking at your pasted text, it looks like a single tab all the way.  And if &quot;the next line will inherit the indent of the current line&quot; after just a newline, it sure behaves differently from mine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps I should shut up until I find a version 24.4.1 to try …&lt;/p&gt;&#xA;" OwnerUserId="5450" LastEditorUserId="5450" LastEditDate="2015-03-16T12:40:39.217" LastActivityDate="2015-03-16T12:40:39.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10046" PostTypeId="1" AcceptedAnswerId="10048" CreationDate="2015-03-16T11:54:50.117" Score="4" ViewCount="8647" Body="&lt;p&gt;This is how I attempted to install the package:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran the command &lt;code&gt;list-packages&lt;/code&gt; and then tried to install the &lt;code&gt;auctex&lt;/code&gt; package in package mode. This was the line showing &lt;code&gt;auctex&lt;/code&gt; entry in package mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  auctex             11.88.2      available  gnu        Integrated environment for *TeX*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I try to install that, I get this message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;package--check-signature: Failed to verify signature&#xA;  auctex-11.88.2.tar.sig: (&quot;Bad signature from 474F05837FBDEF9B GNU ELPA&#xA;  Signing Agent &quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How do I fix this ? Any other method to install &lt;code&gt;auctex&lt;/code&gt; is also welcome.&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2021-11-12T18:03:24.427" Title="How to install Auctex" Tags="|auctex|latex|package|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10047" PostTypeId="2" ParentId="2861" CreationDate="2015-03-16T12:18:12.223" Score="0" Body="&lt;p&gt;I am running Emacs on Android 4.2.2. &#xA;Starting it from within Terminal IDE, everything loads fine. I have not stress tested it however.&lt;/p&gt;&#xA;" OwnerDisplayName="user6638" LastActivityDate="2015-03-16T12:18:12.223" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10048" PostTypeId="2" ParentId="10046" CreationDate="2015-03-16T12:22:51.247" Score="4" Body="&lt;p&gt;I just installed it from source:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;get the source code: &lt;a href=&quot;http://www.gnu.org/software/auctex/download.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/auctex/download.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;build:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --prefix=$HOME/.emacs.d/site-lisp/auctex --with-lispdir=$HOME/.emacs.d/site-lisp/auctex --with-texmf-dir=$HOME/.local/lib/texmf&#xA;make&#xA;make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(this builds auctex for a user and doesn't require superuser privilages)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;load to emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/site-lisp/auctex&quot;)&#xA;(load &quot;auctex.el&quot; nil t t)&#xA;(load &quot;preview-latex.el&quot; nil t t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That's it: calling &lt;code&gt;M-x latex-mode&lt;/code&gt; then loads auctex.&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-03-16T12:22:51.247" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10049" PostTypeId="1" AcceptedAnswerId="18958" CreationDate="2015-03-16T12:52:45.933" Score="3" ViewCount="1146" Body="&lt;p&gt;When I run the &lt;code&gt;find-file&lt;/code&gt; command and hit the tab key twice without giving anything, I get the &lt;code&gt;Completion List&lt;/code&gt; of my, for instance, home directory. By default it lists everything inside, including the hidden files and directories (&quot;dot-files&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to exclude the dot-files in this case? But additionally, when I start typing &lt;code&gt;.&lt;/code&gt; and then hit the tab twice, I would like to see the all or matched dot-files.&lt;/p&gt;&#xA;" OwnerUserId="2621" LastActivityDate="2018-10-09T17:22:58.447" Title="Exclude dot-files from the find-file Completion List" Tags="|completion|find-file|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10050" PostTypeId="1" AcceptedAnswerId="10051" CreationDate="2015-03-16T13:33:18.630" Score="1" ViewCount="108" Body="&lt;p&gt;If I do a &lt;kbd&gt;M-!&lt;/kbd&gt; to run a shell command, usually any output will appear in a new, temporary buffer. But sometimes, seemingly at random, the output will instead be inserted directly into the active buffer. If this happens and I run the same command over again, it normally works as expected the second time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this just me? Why might this be happening, and how do I prevent it? &lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-16T13:38:33.710" Title="Why does shell command output sometimes get inserted into an existing buffer?" Tags="|shell-command|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10051" PostTypeId="2" ParentId="10050" CreationDate="2015-03-16T13:38:33.710" Score="2" Body="&lt;p&gt;If you give &lt;code&gt;M-!&lt;/code&gt; a prefix argument, any prefix argument, it will insert the output at the point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h c &amp;lt;key&amp;gt;&lt;/code&gt; will tell you exactly which function is being run when you press a key. In this case, it's &lt;code&gt;shell-command&lt;/code&gt;. You can read the documentation by typing &lt;code&gt;C-h f shell-command RET&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Execute string COMMAND in inferior shell; display output, if any.&#xA;  With prefix argument, insert the COMMAND's output at point.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;C-h k&lt;/code&gt; to combine the above two help commands. That is, &lt;code&gt;C-h k M-!&lt;/code&gt; will open the help window for the command that &lt;code&gt;M-!&lt;/code&gt; runs, whatever it may be.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-03-16T13:38:33.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10052" PostTypeId="1" AcceptedAnswerId="10053" CreationDate="2015-03-16T14:11:06.690" Score="3" ViewCount="123" Body="&lt;p&gt;I see a lot of *-readme.txt files in my ELPA root. They seem to describe some of the packages that I&#xA;had installed at some point. A few related questions follow:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;why do some packages have them while others do not?&lt;/li&gt;&#xA;&lt;li&gt;why aren't they deleted automatically when a package is removed?&lt;/li&gt;&#xA;&lt;li&gt;is it possible to disable them? I would prefer to save screen space in the &lt;code&gt;dired&lt;/code&gt; buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-16T14:45:38.403" Title="*-readme.txt files in ELPA root, what do they do?" Tags="|package|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10053" PostTypeId="2" ParentId="10052" CreationDate="2015-03-16T14:35:50.663" Score="3" Body="&lt;p&gt;Those files are created when you look at the details of a package from the &lt;code&gt;*Packages*&lt;/code&gt; list view -- they provide the content shown in the &lt;code&gt;*Help*&lt;/code&gt; buffer when you use &lt;code&gt;describe-package&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will only see those files for packages that you happen to have clicked on (or otherwise queried) to get more information. You can delete them as they can always be retrieved again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if there is a way to delete them automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to ignore them in dired, one option would be to use &lt;code&gt;dired-omit-mode&lt;/code&gt;. You could add &quot;-readme.txt&quot; to the &lt;code&gt;dired-omit-extensions&lt;/code&gt; list.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-16T14:45:38.403" LastActivityDate="2015-03-16T14:45:38.403" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10054" PostTypeId="1" AcceptedAnswerId="10058" CreationDate="2015-03-16T15:37:35.770" Score="1" ViewCount="754" Body="&lt;p&gt;Here's a sample of the code that I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(define-error 'unsupported-mode-error &quot;Unsupported mode&quot;)&#xA;(condition-case e&#xA;    (if (eq 'a 'a)&#xA;        (message &quot;test&quot;)&#xA;      (signal 'unsupported-mode-error major-mode))&#xA;  (unsupported-mode-error&#xA;   (signal (car e) (cdr e)))&#xA;  (error&#xA;   (message &quot;error&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;lexical-binding&lt;/code&gt; in the current file, I get &lt;code&gt;Warning: Unused lexical argument e&lt;/code&gt; warning,&#xA;although I'm clearly using &lt;code&gt;e&lt;/code&gt;. Is this a bug or a misunderstanding on my part? And how could I&#xA;avoid this warning?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-16T19:18:05.463" Title="How to avoid &quot;Unused lexical argument&quot; for condition-case?" Tags="|elisp|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10055" PostTypeId="1" AcceptedAnswerId="10061" CreationDate="2015-03-16T16:02:00.947" Score="2" ViewCount="4591" Body="&lt;p&gt;How can I configure &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;spacemacs&lt;/a&gt; to always have &lt;code&gt;linum-mode&lt;/code&gt; active in C/C++ buffers (&lt;code&gt;cc-mode&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="6779" LastEditorUserId="330" LastEditDate="2015-03-17T10:55:48.613" LastActivityDate="2015-09-29T15:37:03.803" Title="How to configure linum-mode in spacemacs?" Tags="|cc-mode|linum-mode|spacemacs|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10056" PostTypeId="1" AcceptedAnswerId="10057" CreationDate="2015-03-16T18:39:11.267" Score="6" ViewCount="1698" Body="&lt;p&gt;I sometimes need to work in a terminal. E.g compile gtk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that the native emacs shell doesn't quite do what a native terminal does. And anyway I'd like to keep them two separate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, is there a terminal that has a similar feel as emacs? like C-x-3 to slip windows etc.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(e.g for firefox there are firemacs bindings, for eclipse there is emacs+ plugin) etc... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;br&gt;&#xA;If you down vote, please leave a comment explaining why so I can improve question.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-03-17T18:38:30.337" LastActivityDate="2015-12-06T21:06:12.943" Title="Is there a linux terminal with emacs keybindings?" Tags="|term|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10057" PostTypeId="2" ParentId="10056" CreationDate="2015-03-16T18:50:04.557" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://tmux.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tmux&lt;/a&gt; or almost any other terminal multiplexer. It won't immediately have Emacs-like bindings, but like emacs, you can customize it to suit your needs. See this question: &lt;a href=&quot;https://stackoverflow.com/questions/18240683/how-to-force-emacs-style-status-keys-in-tmux&quot;&gt;how-to-force-emacs-style-status-keys-in-tmux&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-03-16T18:50:04.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10058" PostTypeId="2" ParentId="10054" CreationDate="2015-03-16T19:18:05.463" Score="1" Body="&lt;p&gt;This is related to &lt;a href=&quot;http://debbugs.gnu.org/15103&quot; rel=&quot;nofollow&quot;&gt;bug #15103&lt;/a&gt;, as is now fixed in 25.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Earlier Emacs versions can do this to silence the warning:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq byte-compile--use-old-handlers nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-16T19:18:05.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10059" PostTypeId="1" AcceptedAnswerId="10710" CreationDate="2015-03-16T19:31:26.810" Score="0" ViewCount="530" Body="&lt;p&gt;I have written code to customize the compile-command to use MSBuild.exe if a .vcxproj file is found in the current directory for c-mode files via a c-mode-common-hook. Since MSBuild is not in the path my code sets compile command so that it includes the full path and file name of MSBuild.exe. This is obtained from the Windows registry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final compile command is for example &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\&quot;C:\\Program Files (x86)\\MSBuild\\12.0\\bin\\amd64\\MSBuild.exe\&quot; \&quot;JAWSCore.vcxproj\&quot; /p:Configuration=Debug&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that when I do a M-x compile I get the following error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'C:\Program' is not recognized as an internal or external command,&#xA;operable program or batch file.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to resolve this issue or would I be better off modifying my code to simply add the directory containing MSBuild to the exec-path and then simply setting compile command to the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;MSBuild.exe JAWSCore.vcxproj /p:Configuration=Debug&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6783" LastActivityDate="2015-04-15T23:25:02.730" Title="GNU Emacs - Space in compile command" Tags="|cc-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10060" PostTypeId="2" ParentId="10059" CreationDate="2015-03-16T20:41:04.267" Score="0" Body="&lt;p&gt;You need to quote the spaces. Replace &lt;code&gt;&amp;lt;space&amp;gt;&lt;/code&gt; with &lt;code&gt;\&amp;lt;space&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-03-16T20:41:04.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10061" PostTypeId="2" ParentId="10055" CreationDate="2015-03-16T21:22:22.407" Score="1" Body="&lt;p&gt;If it is specific to spacemacs then you can add this line in your &lt;code&gt;dotspacemacs/config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-hooks 'linum-mode '(c-mode-hook c++-mode-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-03-16T21:22:22.407" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10062" PostTypeId="1" AcceptedAnswerId="10063" CreationDate="2015-03-16T21:38:19.240" Score="6" ViewCount="3307" Body="&lt;p&gt;While I enjoy the table mode of org and love the way I can work with the data in these tables with eg Python or R I am currently stuck with a simple problem: How can I exclude the table from being exported? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: data&#xA;| Col1 | Col2 | Col3 | Col4 | Col5 |&#xA;...&#xA;#+TBLFM: ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While i do know where I would include the respective option when executing R code (here I write :exports results so that the source is hidden) and while I know that |: as an option should seal the deal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS:     H:2 num:t toc:t ::t |:f ^:t f:t tex:t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I still have my huge table in my document. What am I doing wrong? &lt;/p&gt;&#xA;" OwnerUserId="5392" LastActivityDate="2016-05-05T10:23:54.773" Title="Exclude table in org-mode export" Tags="|org-mode|org-export|org-table|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10063" PostTypeId="2" ParentId="10062" CreationDate="2015-03-16T22:49:08.217" Score="12" Body="&lt;p&gt;Embed your table inside a &lt;code&gt;COMMENT&lt;/code&gt; block thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_COMMENT&#xA;&#xA;#+TBLNAME: data&#xA;| Col1 | Col2 | Col3 | Col4 | Col5 |&#xA;...&#xA;#+TBLFM: ...&#xA;&#xA;#+END_COMMENT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use this method for defining tabular data which I then process to produce an exported diagram or plot.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-03-16T22:49:08.217" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10064" PostTypeId="2" ParentId="3375" CreationDate="2015-03-17T06:12:33.580" Score="4" Body="&lt;p&gt;It seems that ox-bibtex is not included in the latest org package (8.2.10-34-gc41bbc-elpa). So I searched it online and put into directory /org/lisp/ once downloaded. But I ran into the following error when trying to do an export involving some bibtex. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's function definition is void: org-element-insert-before&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then I check the file 'org-element.el', of course there is no such function predefined. But why isn't there? The online API document of org-element mentioned it in &lt;a href=&quot;http://orgmode.org/worg/dev/org-element-api.html&quot; rel=&quot;nofollow&quot;&gt;once&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess currently it is impossible to use RefTeX as the way the document describes unless you are willing to switch to the beta version or some older one. &lt;a href=&quot;https://github.com/masayuko/ox-rst/issues/5&quot; rel=&quot;nofollow&quot;&gt;See&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I share my way to use the beta version&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;git clone git://orgmode.org/org-mode.git&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Move the folder to &lt;code&gt;~/.emacs.d/&lt;/code&gt; and name it as &lt;code&gt;org-beta&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Modify &lt;code&gt;load-path&lt;/code&gt;, let the beta version shadow other version, and include the user contribute directory&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (add-to-list 'load-path (expand-file-name &quot;org-beta\\lisp&quot; user-emacs-directory))&#xA;&#xA;    (add-to-list 'load-path (expand-file-name &quot;org-beta\\org-contrib\\lisp&quot; user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(optional) you can use make command to compile the source file and build the doc&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Now you can &lt;code&gt;(require 'ox-bibtex)&lt;/code&gt;. I prefer to write like this: &lt;code&gt;(eval-after-load 'org (require 'ox-bibtex))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In order to generate reference list at the right place, put something like &lt;code&gt;#+BIBLIOGRAPHY: your_bib_lib_name plain option:-d&lt;/code&gt; to the end of the org file. More options please refer to the help document in &lt;code&gt;ox-bibtex.el&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To make the HTML export part work right, you may need the latest bibtex2html, i.e., 1.98. To build it from source, download it from github, and follow the instruction in the 'README' help document. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you are using windows like me, use Cygwin64 with all the devel packages. Using Cygwin64, cd to the dir of bibtex2html, and type &lt;code&gt;./configure&lt;/code&gt;, wait finish, then type &lt;code&gt;make&lt;/code&gt;, wait finish. Now in this dir, you will get &lt;code&gt;bib2bib.exe&lt;/code&gt;, &lt;code&gt;bibtex2html.exe&lt;/code&gt; and &lt;code&gt;aux2bib&lt;/code&gt;. Copy them to some dir in your environment var &lt;code&gt;PATH&lt;/code&gt;. Test it by typing &lt;code&gt;bibtex2html&lt;/code&gt; in the cmd.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to do the above job because I use texlive2014. If you are a miktek user, bibtex2html 1.95 may just work well, which can be easily installed with a windows installer.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;7&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;To make the PDF export part work right, use the following code to initialize your org-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-pdf-process&#xA;      '(&quot;xelatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;bibtex %b&quot;&#xA;        &quot;xelatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;xelatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It is the 'bibtex' part that does the job. I use the shell escape command for minted package of latex.&lt;/p&gt;&#xA;" OwnerUserId="6787" LastEditorUserId="968" LastEditDate="2015-08-07T18:47:18.840" LastActivityDate="2015-08-07T18:47:18.840" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10065" PostTypeId="1" AcceptedAnswerId="10068" CreationDate="2015-03-17T09:13:09.793" Score="10" ViewCount="3894" Body="&lt;p&gt;I've been updating all my use-package calls now that &lt;code&gt;:idle&lt;/code&gt; is no longer a decent way to defer stuff. At the moment one of the biggest hits on my load time is &lt;code&gt;elpy&lt;/code&gt; which loads a whole bunch of additional modules. At the moment my invocation is rather basic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package elpy&#xA;  :commands elpy-enable&#xA;  :init (elpy-enable)&#xA;  :config&#xA;  (progn&#xA;    (setq elpy-rpc-backend &quot;jedi&quot;&#xA;          elpy-rpc-project-specific 't)&#xA;    (when (fboundp 'flycheck-mode)&#xA;      (setq elpy-modules (delete 'elpy-module-flymake elpy-modules)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this is rather wasteful if I'm never editing any python modules. The trouble is elpy is a collection of modes so I can't just use the mode binding form as &lt;code&gt;elpy-enable&lt;/code&gt; needs to get called. So what approach should I use. Is it just a case of triggering on the python-mode hook?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2019-05-29T10:17:23.750" Title="How can I defer loading elpy using use-package?" Tags="|use-package|elpy|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10066" PostTypeId="2" ParentId="9512" CreationDate="2015-03-17T09:15:19.420" Score="4" Body="&lt;p&gt;This is common problem, seems to be a bug in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Potential solutions are; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;turn the number of CPUs down to 1 in virtual box.&lt;/li&gt;&#xA;&lt;li&gt;force display redraw in isearch (add-hook 'isearch-update-post-hook 'redraw-display)&lt;/li&gt;&#xA;&lt;li&gt;use this PPA (if you're on ubuntu) ppa:martin-trojer/emacs24-termfix&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's some references where this issue is also discussed;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://askubuntu.com/questions/418546/emacs-screen-drawing-issues-over-ssh&quot;&gt;https://askubuntu.com/questions/418546/emacs-screen-drawing-issues-over-ssh&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.virtualbox.org/ticket/13687&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.virtualbox.org/ticket/13687&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://lists.debian.org/debian-user/2014/12/msg01242.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lists.debian.org/debian-user/2014/12/msg01242.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=+17497&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=+17497&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6792" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2015-03-18T14:00:47.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10067" PostTypeId="1" CreationDate="2015-03-17T09:43:14.760" Score="1" ViewCount="246" Body="&lt;p&gt;In ruby-mode, using hs-minor-mode (hideshow) you can hide almost any block of code, but heredocs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried adding &quot;LONG_HEREDOC&quot; to hs-special-modes-alist, but it didn't worked:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;hideshow&quot;&#xA;  '(add-to-list 'hs-special-modes-alist&#xA;                 `(ruby-mode&#xA;                   ,(rx (or &quot;def&quot; &quot;class&quot; &quot;module&quot; &quot;{&quot; &quot;[&quot; &quot;do&quot; &quot;&amp;lt;&amp;lt;LONG_HEREDOC&quot;)) ; Block start&#xA;                   ,(rx (or &quot;}&quot; &quot;]&quot; &quot;end&quot; &quot;LONG_HEREDOC&quot;))                       ; Block end&#xA;                   ,(rx (or &quot;#&quot; &quot;=begin&quot;))                        ; Comment start&#xA;                   ruby-forward-sexp nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think it has todo with &quot;ruby-forward-sexp&quot;. It doesn't seem to work with heredoc comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does any one knows how to solve this?&lt;/p&gt;&#xA;" OwnerUserId="6791" LastActivityDate="2016-05-22T17:33:36.370" Title="How to hide heredoc block in ruby-mode?" Tags="|ruby-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10068" PostTypeId="2" ParentId="10065" CreationDate="2015-03-17T11:40:20.297" Score="7" Body="&lt;p&gt;I don’t know Elpy, so I’m not sure whether I understand your problem correctly.  I do know &lt;code&gt;use-package&lt;/code&gt;, though, and recently suffered from the very same issue, namely the removal of &lt;code&gt;:idle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, there are two ways out, depending on how you need to use Elpy.  You can either use a poor man’s &lt;code&gt;:idle&lt;/code&gt;, with &lt;code&gt;run-with-idle-timer&lt;/code&gt;, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:init (run-with-idle-timer 10 nil #'elpy-enable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can rely on good old &lt;code&gt;with-eval-after-load&lt;/code&gt; or use &lt;code&gt;python-mode-hook&lt;/code&gt; and delay Elpy until after Python Mode is loaded or enabled respectively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:init (add-hook 'python-mode-hook #'elpy-enable)&#xA;;; or&#xA;:init (with-eval-after-load 'python (elpy-enable))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-03-17T11:40:20.297" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10070" PostTypeId="1" CreationDate="2015-03-17T12:27:17.143" Score="0" ViewCount="397" Body="&lt;p&gt;In python mode (the one that Emacs uses to open python script by default), can I fold the definition of a function? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I quickly select the entire definition of a function? (so that I can copy and paste)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, which python package/IDE shall I install in emacs? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2015-03-17T20:26:01.687" Title="Fold and select the definition of a function in python?" Tags="|python|ide|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10071" PostTypeId="1" AcceptedAnswerId="10073" CreationDate="2015-03-17T12:44:45.073" Score="2" ViewCount="58" Body="&lt;p&gt;I have a question about macros.&#xA;When I call a macro with an argument, I call a function with it. It works.&#xA;But if I add another instruction below, the backquoted instruction is not executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the dummy example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq words '())&#xA;&#xA;(defun func-test (name)&#xA;  &quot;Function test.&quot;&#xA;  (message &quot;Function called with %s&quot; name)&#xA;  (add-to-list 'words name))&#xA;&#xA;(defmacro macro-test (name)&#xA;  &quot;Macro test.&quot;&#xA;  (message &quot;Before ...&quot;)&#xA;  (unless (member name words)&#xA;    `(func-test ,name))&#xA;  ;;;; /!\ Bug: if I uncomment this next line, it does not work anymore&#xA;  ;;(message &quot;... After&quot;)&#xA;  )&#xA;&#xA;(macro-test 'hello)&#xA;(message &quot;%S&quot; words)&#xA;;; Should be (hello)&#xA;&#xA;(macro-test 'thanks)&#xA;(message &quot;%S&quot; words)&#xA;;; Should be (thanks hello)&#xA;&#xA;(macro-test 'bye)&#xA;(message &quot;%S&quot; words)&#xA;;; Should be (bye thanks hello)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do you have any idea or tip to deal with it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus question: can I use several backquoted instructions in this macro or is there a specific form to use it? E.g. if I want to call several functions from my macro.&lt;/p&gt;&#xA;" OwnerUserId="6796" LastEditorUserId="675" LastEditDate="2016-07-13T02:15:50.433" LastActivityDate="2016-07-13T02:15:50.433" Title="Macros usage: execute instructions after a backquoted one" Tags="|elisp-macros|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10072" PostTypeId="2" ParentId="10070" CreationDate="2015-03-17T12:46:32.133" Score="3" Body="&lt;p&gt;For folding, I use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html&quot; rel=&quot;nofollow&quot;&gt;Hideshow mode&lt;/a&gt; (built-in) with &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow&quot;&gt;Hydra&lt;/a&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key&#xA; (kbd &quot;M-F&quot;)&#xA; (defhydra hydra-fold (global-map &quot;M-F&quot;)&#xA;   &quot;Fold&quot;&#xA;   (&quot;h&quot; hs-hide-all &quot;hide all&quot;)&#xA;   (&quot;s&quot; hs-show-all &quot;show all&quot;)&#xA;   (&quot;f&quot; hs-toggle-hiding &quot;toggle&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To mark the current function, press &lt;code&gt;C-M-h&lt;/code&gt; to run &lt;code&gt;mark-defun&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These work for nearly any language.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-03-17T12:46:32.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10073" PostTypeId="2" ParentId="10071" CreationDate="2015-03-17T13:08:30.753" Score="3" Body="&lt;p&gt;You are probably aware that macros get evaluated at macro-expansion-time which isn't the same as run-time (that's why you are not just using a function in the first place). When a macro is &quot;first evaluated&quot; at macro-expansion-time it returns a form which later gets evaluated at runtime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your &lt;code&gt;macro-test&lt;/code&gt; macro the last form is &lt;code&gt;(message &quot;... After&quot;)&lt;/code&gt;. At macro-expansion-time it is evaluated which results in &lt;code&gt;&quot;... After&quot;&lt;/code&gt; being shown in the echo area (which you shouldn't do except for debugging purposes) &lt;em&gt;and&lt;/em&gt; the same string being returned - first by the &lt;code&gt;message&lt;/code&gt; form, and then because that is the last form in the macro body, also by the macro being expanded. That string then becomes the macro expansion. Evaluating a string has no side-effect, so nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The form which is supposed to be evaluated at run-time has to be the last form in the macros body. Think of the macro as a function which just happens to be evaluated at some other time. If you want a function to return a value then you have to make sure that the last form in its body actually returns that value - it's exactly the same with macros.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To make a macro which expands to calls to several functions just return a form which does that, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro foo (arg)&#xA;  `(progn (bar ,arg)&#xA;          (baz)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-03-17T13:14:38.020" LastActivityDate="2015-03-17T13:14:38.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10074" PostTypeId="1" AcceptedAnswerId="10075" CreationDate="2015-03-17T13:15:38.040" Score="4" ViewCount="618" Body="&lt;p&gt;I use C-s to search for a string. All matches are highlighted.&#xA;Then I would like to scroll down by C-v, but all matches disappear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know keeping C-s will move to the next match, but it is too slow. How shall I do then? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="105" LastEditDate="2015-05-14T00:37:33.980" LastActivityDate="2015-05-14T00:37:33.980" Title="Scrolling during isearch stops searching, losing matches" Tags="|key-bindings|scrolling|isearch|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10075" PostTypeId="2" ParentId="10074" CreationDate="2015-03-17T13:25:24.173" Score="3" Body="&lt;p&gt;After scrolling down, hit &lt;code&gt;C-s&lt;/code&gt; twice. That will restart the search, using the search string from the previous time you used &lt;code&gt;C-s&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-03-17T13:25:24.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10076" PostTypeId="2" ParentId="10074" CreationDate="2015-03-17T14:46:32.690" Score="8" Body="&lt;p&gt;@legosia's answer is the usual one, and probably what you want. But be aware that there is an alternative Isearch behavior that lets you scroll the buffer being searched without exiting Isearch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you set (or bind) option &lt;strong&gt;&lt;code&gt;isearch-allow-scroll&lt;/code&gt;&lt;/strong&gt; to non-nil then you can scroll without exiting Isearch, as long as the current match is still on screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has the advantage that you can continue to see the set of matches highlighted.  The current context is maintained while you scroll.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Few are aware of this option, and probably fewer still make use of it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Some more info about &lt;code&gt;isearch-allow-scroll&lt;/code&gt; -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to allowing &lt;em&gt;scrolling&lt;/em&gt;, non-nil &lt;code&gt;isearch-allow-scroll&lt;/code&gt; also has the effect of non-nil option &lt;strong&gt;&lt;code&gt;isearch-allow-prefix&lt;/code&gt;&lt;/strong&gt; (available starting with Emacs 24.4). That is, it lets you pass a prefix argument to a command that is bound to a key in &lt;code&gt;isearch-mode-map&lt;/code&gt;.  So to use a prefix argument you must set either &lt;code&gt;isearch-allow-scroll&lt;/code&gt; or &lt;code&gt;isearch-allow-prefix&lt;/code&gt; (if available) to non-nil.  Otherwise, a prefix arg during Isearch exits Isearch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some Isearch enhancements, such as &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot;&gt;Isearch+&lt;/a&gt;, bind keys that let you make use of a prefix argument for various actions during Isearch.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-17T14:46:32.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10077" PostTypeId="1" AcceptedAnswerId="10080" CreationDate="2015-03-17T15:17:51.327" Score="19" ViewCount="3343" Body="&lt;p&gt;I know I can set the EDITOR variable and edit my crontab with emacs but that requires starting the process from a shell with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ crontab -e&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is how can I directly modify my crontab if I'm inside of emacs already?  I tried running starting up eshell and running crontab -e from there but the terminal complains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ crontab -e&#xA;emacs: Terminal type &quot;dumb&quot; is not powerful enough to run Emacs.&#xA;It lacks the ability to position the cursor.&#xA;If that is not the actual type of terminal you have,&#xA;use the Bourne shell command `TERM=... export TERM' (C-shell:&#xA;`setenv TERM ...') to specify the correct type.  It may be necessary&#xA;to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.&#xA;/usr/bin/crontab: no changes made to crontab&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If using crontab in eshell worked that would be a step in the right direction but it's still not exactly what I was hoping for.  Attempts to execute crontab -e from within an M-x term buffer in emacs fail as well (at least on OpenBSD 5.6 with emacs 24.3.1).  In the ideal case, there would be a crontab mode that allowed me to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M-x crontab&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that fires up a major mode and allowed me to do the usual stuff I do at the command line with crontab and have it all bound to keys.  I figured for sure there'd be a mode or something for this but I haven't had much luck locating one.&lt;/p&gt;&#xA;" OwnerUserId="2259" LastEditorUserId="2259" LastEditDate="2015-03-17T16:17:15.067" LastActivityDate="2022-10-29T17:18:44.323" Title="How to edit crontab directly within emacs when I already have emacs open?" Tags="|editing|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10079" PostTypeId="1" CreationDate="2015-03-17T16:14:50.097" Score="0" ViewCount="162" Body="&lt;p&gt;I'm trying to write a &lt;code&gt;yasnippet&lt;/code&gt; template to write a standard header at the top of files. I have &lt;code&gt;(goto-char (point-min))&lt;/code&gt; at the beginning of the template in order to move point to the top of the buffer; and while this works correctly, it outputs a &lt;code&gt;1&lt;/code&gt;. This is presumably an affirmation of success from &lt;code&gt;goto-char&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I suppress or eat that &lt;code&gt;1&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there a better way to position a &lt;code&gt;yasnippet&lt;/code&gt; template at the top of a buffer?&lt;/p&gt;&#xA;" OwnerUserId="2350" LastEditorUserId="14825" LastEditDate="2021-08-28T03:51:14.853" LastActivityDate="2021-08-28T03:51:14.853" Title="how to suppress elisp evaluation output in yasnippet?" Tags="|yasnippet|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10080" PostTypeId="2" ParentId="10077" CreationDate="2015-03-17T16:16:35.807" Score="30" Body="&lt;p&gt;You could try to use the &lt;code&gt;with-editor&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun crontab-e ()&#xA;    &quot;Run `crontab -e' in a emacs buffer.&quot;&#xA;    (interactive)&#xA;    (with-editor-async-shell-command &quot;crontab -e&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it will run crontab in a subshell, using the current Emacs as editor.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="21006" LastEditDate="2019-02-27T17:49:31.133" LastActivityDate="2019-02-27T17:49:31.133" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10081" PostTypeId="1" CreationDate="2015-03-17T16:36:24.990" Score="25" ViewCount="15536" Body="&lt;p&gt;I would like tabs like firefox but for emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this: &lt;a href=&quot;http://emacswiki.org/emacs/TabBarMode&quot; rel=&quot;noreferrer&quot;&gt;http://emacswiki.org/emacs/TabBarMode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it just add to each buffer (&lt;em&gt;window&lt;/em&gt; in Emacs terminology) a bar that shows currently open buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like a tab to be able to hold multiple buffers (&lt;em&gt;windows&lt;/em&gt; in Emacs teminology), which I can split as desired.  I.e. each tab should correspond to a &quot;window state&quot; (in the sense of &lt;code&gt;window-state-get&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd have one tab for my tasks, another for code, another for web-reading etc.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? Can tabbar be tailored to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit2]&lt;/strong&gt;&lt;br&gt;&#xA;This question has attracted more attention than I anticipated. &#xA;It looks like there is a solution, but one that would require a bit of research and tweaking. &#xA;While this/next week are a bit busy for me, I will parse through the answers and will try to build something that works and then I'll edit this question to reflect my findings. Please hold on =)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;&lt;br&gt;&#xA;Sort of similar to :&lt;br&gt;&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/24157754/make-frames-in-emacs-gui-behaves-like-frames-in-terminal&quot;&gt;https://stackoverflow.com/questions/24157754/make-frames-in-emacs-gui-behaves-like-frames-in-terminal&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would settle with multiple frames in a single GUI session also.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="262" LastEditDate="2019-09-09T17:39:26.143" LastActivityDate="2019-09-09T17:39:26.143" Title="Browser-style 'tabs' for emacs?" Tags="|tabbar|" AnswerCount="5" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="10082" PostTypeId="1" CreationDate="2015-03-17T17:07:14.480" Score="1" ViewCount="215" Body="&lt;p&gt;On startup, I want to create an empty buffer and switch to it, but only if no file has been specified in the command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I have is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(switch-to-buffer &quot;untitled&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at the end of &lt;code&gt;init.el&lt;/code&gt; but this still creates an &quot;untitled&quot; buffer even when I specify a file in the command line. I don't want this because it slows things down and leaves an unneeded buffer lying around.&lt;/p&gt;&#xA;" OwnerUserId="5263" LastEditorUserId="25" LastEditDate="2015-05-10T15:38:53.643" LastActivityDate="2015-05-10T15:38:53.643" Title="Switch to buffer conditional to no file having been specified in the command line?" Tags="|buffers|start-up|command-line-arguments|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10083" PostTypeId="2" ParentId="10082" CreationDate="2015-03-17T19:08:06.363" Score="1" Body="&lt;p&gt;Using the *scratch* buffer as an empty buffer, as suggested in the&#xA;comments, is a possible solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you prefer to leave the *scratch* buffer alone, then this is&#xA;an alternative&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-startup-hook&#xA;          (lambda () (when (cl-notany 'buffer-file-name (buffer-list))&#xA;                       (switch-to-buffer&#xA;                        (generate-new-buffer-name &quot;untitled&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will create a new &quot;untitled&quot; buffer and will switch to it, but only if&#xA;there isn't any buffer that is visiting a file (as would occur when Emacs is started with a filename argument).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Customizing &lt;code&gt;initial-buffer-choice&lt;/code&gt; didn't work for me, as it creates the buffer unconditionally.&lt;/p&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2015-03-17T19:08:06.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10085" PostTypeId="1" AcceptedAnswerId="10100" CreationDate="2015-03-17T19:38:30.587" Score="8" ViewCount="1866" Body="&lt;p&gt;I'm rewriting my personal home page as an org-file that I export to HTML.  In this HTML document, I'd like to include the content of some pregenerated HTML fragments stored in other files (my list of publications as generated by &lt;code&gt;bibtex2html&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My personal home page&#xA;** Articles&#xA;[insert HTML file with list of articles here]&#xA;&#xA;** Posters&#xA;[insert HTML file with list of posters here]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried using &lt;code&gt;#+INCLUDE:&lt;/code&gt; but that escapes all HTML and hence shows the HTML source in the resulting web page not the rendered HTML fragment.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_HTML&#xA;#+INCLUDE: &quot;file.html&quot;&#xA;#+END_HTML&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the &lt;code&gt;#+INCLUDE&lt;/code&gt; directive is not interpreted inside the HTML block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like there should be an easy way to achieve this but I can't seem to find it.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2015-03-18T18:12:48.683" LastActivityDate="2017-09-14T16:18:43.593" Title="Org-export: How to include a pregenerated HTML file when exporting org to HTML?" Tags="|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10086" PostTypeId="1" AcceptedAnswerId="32906" CreationDate="2015-03-17T19:49:34.640" Score="2" ViewCount="3323" Body="&lt;p&gt;How would I create a footer on the bottom of every page? Ideally, I wish I could just add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+FOOTER: Confidential.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then it would include it. How easy would it be to do that? Otherwise, is there another way to do this? Right now I'd be happy with this just working when exporting to PDF.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2017-05-18T09:11:08.397" Title="How to include a custom footer on the bottom of every page in org mode export?" Tags="|org-mode|latex|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10087" PostTypeId="1" CreationDate="2015-03-17T20:55:57.420" Score="10" ViewCount="2392" Body="&lt;p&gt;I prefer using variable-width fonts in Emacs whenever I can. That said, Org Mode tags are horribly aligned when headings use variable-width fonts, even if the tags themselves use fixed-width fonts. Is it possible to continue using variable-width fonts for org headings and have tags properly aligned?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another acceptable solution would be to customize Org Mode faces by file extension. This would allow the use of fixed-width fonts for org headings in .txt files, where I use a lot of tags, and variable-width fonts for .org files, where I rarely use tags. I just don't know how to customize faces based on file extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first situation, where I continue using variable-width fonts, is preferred; I'm just not hopeful that such a solution exists.&lt;/p&gt;&#xA;" OwnerUserId="5478" LastActivityDate="2024-02-19T19:01:25.170" Title="How to better align tags in Org Mode using variable-width font" Tags="|org-mode|fonts|faces|align|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10088" PostTypeId="2" ParentId="10086" CreationDate="2015-03-17T21:10:33.090" Score="2" Body="&lt;p&gt;If you want it in PDF, add LaTeX options&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\usepackage{fancyhdr}&#xA;\pagestyle{fancyplain}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then set one or more of &lt;code&gt;\lhead{}&lt;/code&gt;, &lt;code&gt;\chead{}&lt;/code&gt;, &lt;code&gt;\rhead{}&lt;/code&gt;, &lt;code&gt;\lfoot{}&lt;/code&gt;, &lt;code&gt;\cfoot{}&lt;/code&gt;, or &lt;code&gt;\rfoot{}&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-03-17T21:10:33.090" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10089" PostTypeId="2" ParentId="9982" CreationDate="2015-03-17T21:46:16.307" Score="12" Body="&lt;p&gt;I use Jedi mode for Python and I'm very happy with it. Not only does it do accurate look ups for function calls, it resolves functions to the correct definition even in complicated situations (like inheritance). Comes with auto complete to boot.&#xA;&lt;a href=&quot;http://tkf.github.io/emacs-jedi/latest/&quot;&gt;http://tkf.github.io/emacs-jedi/latest/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="54" LastActivityDate="2015-03-17T21:46:16.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10091" PostTypeId="1" AcceptedAnswerId="10093" CreationDate="2015-03-18T00:27:26.080" Score="2" ViewCount="958" Body="&lt;p&gt;I am running emacs 24 with the Inferior Python mode for the interpreter.&#xA;See below for all the minor modes in effect. Basically the problem is that particular lines (say at the prompt) remain read-only even when I mark toggle &quot;read-only-mode&quot; and I can edit the rest of the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not able to figure out why this might be happening.  I have tried toggle-read-only as well. It seems like something related with the font-lock or something else since the behavior happens only at the python prompt lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buffer is running the following minor-modes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption     &#xA;Column-Number Compilation-Shell Diff-Auto-Refine Electric-Indent           &#xA;Electric-Pair File-Name-Shadow Font-Lock Global-Company Global-Ede         &#xA;Global-Eldoc Global-Font-Lock Global-Semantic-Decoration                   &#xA;Global-Semantic-Highlight-Func Global-Semantic-Idle-Completions            &#xA;Global-Semantic-Idle-Scheduler Global-Semantic-Idle-Summary                &#xA;Global-Semantic-Mru-Bookmark Global-Semantic-Show-Unmatched-Syntax         &#xA;Global-Semanticdb Ido-Everywhere Line-Number Mouse-Wheel Recentf           &#xA;Semantic Shell-Dirtrack Tooltip Winner                                     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6589" LastActivityDate="2018-10-01T12:48:36.327" Title="Sentence in text is read only even though the buffer is not, how to fix this?" Tags="|python|shell|read-only-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10092" PostTypeId="2" ParentId="10091" CreationDate="2015-03-18T00:59:51.243" Score="1" Body="&lt;p&gt;That zone of text probably has a non-nil value for text property &lt;code&gt;read-only&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commands such as &lt;code&gt;read-only-mode&lt;/code&gt; (and &lt;code&gt;toggle-read-only&lt;/code&gt;) have no effect on this, as their doc tells you. &lt;code&gt;C-h f read-only-mode&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also, note that this&#xA;  command works by setting the variable &lt;code&gt;buffer-read-only&lt;/code&gt;, which&#xA;  does not affect read-only regions caused by text properties.  To&#xA;  ignore read-only status in a Lisp program (whether due to text&#xA;  properties or buffer state), bind `inhibit-read-only' temporarily&#xA;  to a non-nil value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To see the text properties at a given position, use &lt;code&gt;C-u C-x =&lt;/code&gt; at that position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be able to tell you just what you might want to do in your context, let us know &lt;em&gt;what you are really trying to do&lt;/em&gt;, which might include why. Are you doing something by program (Lisp)? If so, what? Or are you trying to do something only interactively? If so, what?&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-18T00:59:51.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10093" PostTypeId="2" ParentId="10091" CreationDate="2015-03-18T01:14:09.253" Score="4" Body="&lt;p&gt;You can use the following commands to set the &lt;code&gt;read-only&lt;/code&gt; text property for the marked region. The code is based on &lt;a href=&quot;https://stackoverflow.com/questions/7410125&quot;&gt;https://stackoverflow.com/questions/7410125&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun set-region-read-only (begin end)&#xA;  &quot;Sets the read-only text property on the marked region.&#xA;&#xA;Use `set-region-writeable' to remove this property.&quot;&#xA;  ;; See https://stackoverflow.com/questions/7410125&#xA;  (interactive &quot;r&quot;)&#xA;  (with-silent-modifications&#xA;    (put-text-property begin end 'read-only t)))&#xA;&#xA;(defun set-region-writeable (begin end)&#xA;  &quot;Removes the read-only text property from the marked region.&#xA;&#xA;Use `set-region-read-only' to set this property.&quot;&#xA;  ;; See https://stackoverflow.com/questions/7410125&#xA;  (interactive &quot;r&quot;)&#xA;  (with-silent-modifications&#xA;    (remove-text-properties begin end '(read-only t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="1979" LastEditDate="2018-10-01T12:48:36.327" LastActivityDate="2018-10-01T12:48:36.327" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10094" PostTypeId="1" AcceptedAnswerId="10095" CreationDate="2015-03-18T02:44:37.880" Score="4" ViewCount="904" Body="&lt;p&gt;While debugging a minor mode (separate issue), I wanted to generate a stack trace of the message function so I thought I would just enter&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x debug-on-entry RET message&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was quite surprised to see that this method did not work. No stack trace was generated instead I started to get the error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lisp nesting exceeds `max-lisp-eval-depth'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which probably means that the message function was being called from the debugger, and debugger was calling message again making an infinite loop. Is there a more fool-proof way of generating full traces of who called the message function ? &lt;/p&gt;&#xA;" OwnerUserId="6589" LastActivityDate="2015-03-18T03:36:57.990" Title="How to debug the &quot;message&quot; function on entry ?" Tags="|debugging|message|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10095" PostTypeId="2" ParentId="10094" CreationDate="2015-03-18T03:36:57.990" Score="7" Body="&lt;p&gt;You want to use the &lt;code&gt;debug-on-message&lt;/code&gt; variable in this situation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If non-nil, debug if a message matching this regexp is displayed.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-03-18T03:36:57.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10096" PostTypeId="2" ParentId="10081" CreationDate="2015-03-18T05:44:40.057" Score="5" Body="&lt;p&gt;Consider checking out &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsLispScreen&quot; rel=&quot;noreferrer&quot;&gt;elscreen&lt;/a&gt;, though it doesn't actually group buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it does do is group windows and provide access to multiple layouts (tabs) that you can move between quickly.  My workflow often has some Ruby code and associated tests in one screen, while my todo and Org notes are in another, and perhaps a scratch buffer for drafting SQL queries is in a third.  This allows me to jump between tasks and projects easily, even though each screen draws upon the same pool of buffers.&lt;/p&gt;&#xA;" OwnerUserId="618" LastActivityDate="2015-03-18T05:44:40.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10097" PostTypeId="2" ParentId="10081" CreationDate="2015-03-18T07:03:59.217" Score="10" Body="&lt;h1&gt;Split buffers in groups&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;It is possible with tabbar. You can add rules to group buffers in groups. Here's a basic snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun tabbar-buffer-groups ()&#xA;  &quot;Returns the list of group names the current buffer belongs to.&quot;&#xA;  (list&#xA;   (cond&#xA;&#xA;    ;; ADD RULES TO SPLIT BUFFERS IN GROUPS HERE!&#xA;&#xA;    ;; if buffer is not grouped by the rules you would add above &#xA;    ;; put it in the &quot;General&quot; group:&#xA;    (t&#xA;       &quot;General&quot;&#xA;     ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example rules:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;List buffer names:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    ((member (buffer-name)&#xA;             '(&quot;*scratch*&quot; &quot;*Messages*&quot; &quot;*Help*&quot;))&#xA;     &quot;Common&quot; ;; this is a group name&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Regarding common buffers I prefer to put in &quot;Common&quot; each buffer which name starts with a star. This gives an example of making a buffer for this rule:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    ((string-equal &quot;*&quot; (substring (buffer-name) 0 1))&#xA;     &quot;Common&quot;&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Here's an example of grouping buffers by major-mode:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    ((memq major-mode&#xA;           '(org-mode text-mode rst-mode))&#xA;     &quot;Text&quot;&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;Here's an example of grouping buffers based on mode they are derived from:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    ((or (get-buffer-process (current-buffer))&#xA;         ;; Check if the major mode derives from `comint-mode' or&#xA;         ;; `compilation-mode'.&#xA;         (tabbar-buffer-mode-derived-p&#xA;          major-mode '(comint-mode compilation-mode)))&#xA;     &quot;Process&quot;&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;Here's an example of grouping tabs by regexp:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    ((string-match &quot;^__&quot; (buffer-name))&#xA;     &quot;Templates&quot;&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;6&quot;&gt;&#xA;&lt;li&gt;Group buffers by major mode:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (if (and (stringp mode-name)&#xA;                  ;; Take care of preserving the match-data because this&#xA;                  ;; function is called when updating the header line.&#xA;                  (save-match-data (string-match &quot;[^ ]&quot; mode-name)))&#xA;             mode-name&#xA;           (symbol-name major-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you composed the rules, you can press on + or - on tabbar's tab line to toggle groups, and also ◀ and ▶ to switch between buffers. Or just bind the following defuns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tabbar-forward&#xA;tabbar-backward&#xA;tabbar-forward-group&#xA;tabbar-backward-group&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and move between tabs and tab groups with keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I group tabs, so that I see what is open, but navigate them with &lt;code&gt;ido-switch-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Switch between set of rules&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Also one can define different set of buffer grouping rules and cycle between these. Here's an example of cycling between two set of buffer grouping rules:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; tab-groups!&#xA;(setq tbbr-md &quot;common&quot;)&#xA;(defun toggle-tabbar-mode ()&#xA;  &quot;Toggles tabbar modes - all buffers vs. defined in the `tabbar-buffer-groups'.&quot;&#xA;  (interactive)&#xA;  (if (string= tbbr-md &quot;groups&quot;)&#xA;      (progn ;; then&#xA;        (setq tabbar-buffer-groups-function 'tabbar-buffer-groups-common)&#xA;        (setq tbbr-md &quot;common&quot;))&#xA;    (progn ;; else&#xA;      (setq tabbar-buffer-groups-function 'tabbar-buffer-groups)&#xA;      (setq tbbr-md &quot;groups&quot;))))&#xA;;; by default - all tabs:&#xA;(setq tabbar-buffer-groups-function 'tabbar-buffer-groups-common)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This toggles between &lt;code&gt;tabbar-buffer-groups-common&lt;/code&gt; and &lt;code&gt;tabbar-buffer-groups&lt;/code&gt; tab grouping defuns.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Sort tabbar buffers by name&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I find it beneficial to sort tabbar buffers by name. Here's how to get it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun tabbar-add-tab (tabset object &amp;amp;optional append_ignored)&#xA;  &quot;Add to TABSET a tab with value OBJECT if there isn't one there yet.&#xA;If the tab is added, it is added at the beginning of the tab list,&#xA;unless the optional argument APPEND is non-nil, in which case it is&#xA;added at the end.&quot;&#xA;  (let ((tabs (tabbar-tabs tabset)))&#xA;    (if (tabbar-get-tab object tabset)&#xA;        tabs&#xA;      (let ((tab (tabbar-make-tab object tabset)))&#xA;        (tabbar-set-template tabset nil)&#xA;        (set tabset (sort (cons tab tabs)&#xA;                          (lambda (a b) (string&amp;lt; (buffer-name (car a)) (buffer-name (car b))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2019-06-27T07:27:10.633" LastActivityDate="2019-06-27T07:27:10.633" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10098" PostTypeId="2" ParentId="9982" CreationDate="2015-03-18T08:54:37.540" Score="18" Body="&lt;p&gt;Did you try &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot;&gt;Elpy&lt;/a&gt;? It binds &lt;code&gt;elpy-goto-definition&lt;/code&gt; to the key &lt;code&gt;M-.&lt;/code&gt;.&lt;br&gt;&#xA;If you have a recent Emacs, I think you can also jump back with &lt;code&gt;xref-pop-marker-stack&lt;/code&gt; (&lt;code&gt;M-,&lt;/code&gt;). Elpy has some other nice features as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To install it, follow the instructions in the link.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-03-18T08:54:37.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10099" PostTypeId="1" AcceptedAnswerId="10101" CreationDate="2015-03-18T09:12:08.387" Score="9" ViewCount="2234" Body="&lt;p&gt;Is there a way to assign tags to list items and not just to headings? I can't seem to find anything relevant in the orgmode manual.&lt;/p&gt;&#xA;" OwnerUserId="6809" LastActivityDate="2015-04-10T14:57:51.807" Title="Can i assign tags to list items in orgmode?" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10100" PostTypeId="2" ParentId="10085" CreationDate="2015-03-18T10:10:34.993" Score="10" Body="&lt;p&gt;Cf. the second paragraph in the Org manual on &lt;code&gt;#+INCLUDE&lt;/code&gt; you can&#xA;archive what you want using (Org v9 syntax)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: &quot;file.html&quot; export html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For Org v8 you would write &lt;code&gt;#+INCLUDE: &quot;file.html&quot; html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This inserts is a block and requires org-mode v8.3 or higher.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;11.4 Include files&lt;/h1&gt;&#xA;  &#xA;  &lt;p&gt;During export, you can include the content of another file.  For&#xA;  example, to include your ‘.emacs’ file, you could use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+INCLUDE: &quot;~/.emacs&quot; src emacs-lisp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;The first parameter names the the file to include.  &lt;strong&gt;The optional second&#xA;  and third parameter specify the markup (i.e., ‘example’ or ‘src’)&lt;/strong&gt;, and,&#xA;  if the markup is ‘src’, the language for formatting the contents.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2017-09-14T16:18:43.593" LastActivityDate="2017-09-14T16:18:43.593" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10101" PostTypeId="2" ParentId="10099" CreationDate="2015-03-18T11:58:05.847" Score="11" Body="&lt;p&gt;Lists are intended to be very light and lack most of the features headings can have.  List entries can not have tags, keywords or properties.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-03-18T11:58:05.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10102" PostTypeId="2" ParentId="10056" CreationDate="2015-03-18T14:28:55.150" Score="1" Body="&lt;p&gt;Is perhaps &lt;code&gt;M-x shell&lt;/code&gt; what you are looking for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This shell mode is different from Emacs' native shell &lt;em&gt;eshell&lt;/em&gt;. Since it's running from within Emacs one can do &lt;code&gt;C-x 3&lt;/code&gt; and all the usual juggling.&#xA;You can run several instances by using a prefix argument (&lt;code&gt;C-u M-x shell&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="797" LastEditorUserId="9995" LastEditDate="2015-12-06T21:06:12.943" LastActivityDate="2015-12-06T21:06:12.943" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10103" PostTypeId="1" CreationDate="2015-03-18T14:46:31.877" Score="1" ViewCount="412" Body="&lt;p&gt;I use xdvi and auctex with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; 1&#xA;(setq tex-dvi-view-command &quot;xdvi -editor 'emacsclient -a emacs --no-wait +%l %f'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All works fine. Now I want xdvi to use the options -s 6 -geometry 917X736. First I tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; 2&#xA;(setq tex-dvi-view-command &quot;xdvi -s 6 -geometry 917X736 -editor 'emacsclient -a emacs --no-wait +%l %f'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That doesn't work. Next I tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; 3&#xA;(setq xdvi-program &quot;xdvi -s 6 -geometry 917X736&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which also doesn't work. What does work is to remove 1 and use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; 4&#xA;(setq TeX-view-program-selection&#xA;  '((output-dvi &quot;DVI Viewer&quot;)))&#xA;(setq TeX-view-program-list&#xA;  '((&quot;DVI Viewer&quot; &quot;xdvi -geometry 917X736 -s 6 %o&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which unfortunately looses the search forward via emacsclient. Does anyone know how to set the xdvi zoom and geometry options in 1, or to set the emacsclient in 4? I would be happy to use either solution. I'm using emacs-24.4 and AUCTeX 11.88. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6532" LastActivityDate="2015-03-18T17:32:34.230" Title="How to set xdvi options in auctex" Tags="|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10104" PostTypeId="1" AcceptedAnswerId="10109" CreationDate="2015-03-18T15:11:52.733" Score="8" ViewCount="455" Body="&lt;p&gt;Is there a convenient way to restore the previous restriction? So after the following sequence of events:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mark a region&lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;narrow-to-region&lt;/code&gt; and do some work.&lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;widen&lt;/code&gt; to jump around and look for something&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'd like to narrow to the original region again without having to go mark it again. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-18T15:23:33.727" LastActivityDate="2015-09-08T02:20:38.803" Title="Narrow to previous restriction" Tags="|region|narrowing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10105" PostTypeId="1" CreationDate="2015-03-18T15:16:58.847" Score="1" ViewCount="340" Body="&lt;p&gt;I am trying to create a Regex for Imenu indexing for my CSS modes but I'm having trouble getting it exactly right as I'm no regular expression guru. Here's a snippet of LESS CSS I'm using &lt;code&gt;(regexp-builder)&lt;/code&gt; to test against:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@font-face {&#xA;  font-family: 'sorts_mill_goudyregular';&#xA;  src: url('/webfonts/GoudyStM-webfont.eot');&#xA;  font-weight: normal;&#xA;  font-style: normal;&#xA;}&#xA;&#xA;body {&#xA;  margin: 0;&#xA;  padding: 0;&#xA;}&#xA;&#xA;#foo {&#xA;  color: blue;&#xA;}&#xA;&#xA;h1,&#xA;h2,&#xA;h3,&#xA;.CheltenhamBT-BoldHeadline {&#xA;  font-family: CheltenhamBT-BoldHeadline;&#xA;  font-weight: normal;&#xA;  font-style: normal;&#xA;}&#xA;&#xA;.ClarendonText-Bold {&#xA;  font-family: ClarendonText-Bold;&#xA;  font-weight: normal;&#xA;  font-style: normal;&#xA;  .bold {&#xA;    font-weight: bold;&#xA;  }  &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Given this, I would like the menu to contain the following entries:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;@font-face&lt;/li&gt;&#xA;&lt;li&gt;body&lt;/li&gt;&#xA;&lt;li&gt;#foo&lt;/li&gt;&#xA;&lt;li&gt;h1, h2, h3, .CheltenhamBT-BoldHeadline&lt;/li&gt;&#xA;&lt;li&gt;.ClarendonText-Bold&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note, I'm not interested in the nested &lt;code&gt;.bold&lt;/code&gt; declaration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried a few approaches and have it mainly working, but I'm having trouble accounting for the occasional &lt;code&gt;,\n&lt;/code&gt;. Here's my current regex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;^\\([\\.#@]?[a-z0-9_-]+\\(,\n\\)*\\)\\s-{$&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me out?&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2016-05-14T04:27:11.490" Title="Imenu Generic Regexp for CSS / LESS" Tags="|regular-expressions|imenu|css|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10106" PostTypeId="5" CreationDate="2015-03-18T15:32:53.347" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Narrowing.html&quot; rel=&quot;nofollow&quot;&gt;Narrowing&lt;/a&gt; a buffer temporarily focuses editing on a portion of the content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs provides the &lt;code&gt;narrow-to-region&lt;/code&gt; command (and several related commands) for setting the buffer restriction. These commands temporarily make content outside of the specified region inaccessible and hidden. The restriction can be removed using &lt;code&gt;widen&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-18T20:03:41.667" LastActivityDate="2015-03-18T20:03:41.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10107" PostTypeId="4" CreationDate="2015-03-18T15:32:53.347" Score="0" Body="Questions related to narrowing (restricting) the editable area of a buffer." OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-18T20:03:56.123" LastActivityDate="2015-03-18T20:03:56.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10108" PostTypeId="1" AcceptedAnswerId="10110" CreationDate="2015-03-18T15:52:54.303" Score="4" ViewCount="767" Body="&lt;p&gt;Messages displayed by Gnus with HTML rendering may contain links which don't display the URL, instead they display the text which tells what this link is about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found a way to extract the URL by doing &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;describe-text-properties&lt;/code&gt; and then in the buffer with the properties, I'd need to expand the &lt;code&gt;shr-url&lt;/code&gt; section.  The question thus: is there a more straight-forward way to do this?&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-03-18T16:07:14.297" Title="Show URL of a link in Gnus" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10109" PostTypeId="2" ParentId="10104" CreationDate="2015-03-18T16:05:08.553" Score="2" Body="&lt;p&gt;Instead of narrowing the main buffer, you could open a new &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Indirect Buffer &lt;/a&gt;and narrow that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun indirect-region (beg end name)&#xA;  &quot;Open a new named indirect buffer of the current buffer,&#xA;narrowed to region [BEG, END].&quot;&#xA;  (interactive &quot;r\nsname of narrowed buffer: &quot;)&#xA;  (let ((new-buff&#xA;         (make-indirect-buffer (current-buffer)&#xA;                               (generate-new-buffer-name name)&#xA;                               t)))&#xA;    (switch-to-buffer new-buff nil t)&#xA;    (narrow-to-region beg end)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will open a new indirect buffer of your current buffer narrowed to your current region, editing this buffer is just like editing the main buffer, and you'll be able to switch back and forth between them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ArxDR.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could expand on this with nice features like &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;automatically narrowing to the current function&lt;/li&gt;&#xA;&lt;li&gt;naming the new buffer after the current function&lt;/li&gt;&#xA;&lt;li&gt;a keybinding to jump between a function's indirect buffer and the main buffer&lt;/li&gt;&#xA;&lt;li&gt;not creating a new indirect buffer for functions that already have one open&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That is all up to you though.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-03-18T16:10:17.710" LastActivityDate="2015-03-18T16:10:17.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10110" PostTypeId="2" ParentId="10108" CreationDate="2015-03-18T16:07:14.297" Score="7" Body="&lt;p&gt;Move the cursor over the link, and press &quot;u&quot;. This calls &lt;code&gt;shr-copy-url&lt;/code&gt;, and copies the url into the &lt;code&gt;kill-ring&lt;/code&gt;. You can paste it then in any browser.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-03-18T16:07:14.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10111" PostTypeId="1" AcceptedAnswerId="10130" CreationDate="2015-03-18T16:48:08.387" Score="1" ViewCount="347" Body="&lt;p&gt;I have a list of yasnippets for php mode in &lt;code&gt;~/.emacs.d/yasnippets/php-mode&lt;/code&gt;. One of the them is var_dump.yasnippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#name : var_dump&#xA;# key: vd&#xA;# --&#xA;var_dump($0);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The weird thing is that it's not being loaded when I open a php file. All the other yasnippets are loaded. I thought, that a compiled version of php-mode yasnippets is used. But I don't have any compiled yasnippet files in php-mode directory. I upgraded yasnippet to the last version from github.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every time I start Emacs I have to manually navigate to var_dump.yasnippet and load it into the memory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to load var_dump yasnippet when php file is loaded?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastEditorUserId="2389" LastEditDate="2015-03-18T16:58:03.433" LastActivityDate="2015-03-19T09:45:43.663" Title="Yasnippet not being loaded automatically in php-mode" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10112" PostTypeId="2" ParentId="10081" CreationDate="2015-03-18T17:07:50.017" Score="6" Body="&lt;p&gt;ATTRIBUTE:  The grouping of buffers on a per frame basis is a direct implementation of the concepts and select portions of code developed / written by Alp Aker in the library frame-bufs:  &lt;a href=&quot;https://github.com/alpaker/Frame-Bufs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/alpaker/Frame-Bufs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is an example of how to use the library &lt;code&gt;tabbar.el&lt;/code&gt; and group tabs/buffers dynamically on a per-frame basis by either adding tabs/buffers with &lt;code&gt;C-c C-a&lt;/code&gt; or removing tabs/buffers with &lt;code&gt;C-c C-n&lt;/code&gt;.  There are only two (2) groups -- associated with the current frame (i.e., &lt;code&gt;&quot;A&quot;&lt;/code&gt;), and NOT associated with the current frame (i.e., &lt;code&gt;&quot;N&quot;&lt;/code&gt;).  The groups are frame-local, which means that each frame can have its own grouping.  The custom grouping can be reset with &lt;code&gt;C-c C-r&lt;/code&gt;.  Switch between associated and non-associated groups with &lt;code&gt;C-tab&lt;/code&gt;.  Switch to the next tab/buffer in the current group with &lt;code&gt;M-s-right&lt;/code&gt;.  Switch to the previous tab/buffer in the current group with &lt;code&gt;M-s-left&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tabs/buffers can be added or removed programmatically with &lt;code&gt;my-add-buffer&lt;/code&gt; and &lt;code&gt;my-remove-buffer&lt;/code&gt;.  For an example of how to open certain buffers in select frames, please see the related thread entitled &lt;strong&gt;How to intercept a file before it opens and decide which frame&lt;/strong&gt;:  &lt;a href=&quot;https://stackoverflow.com/a/18371427/2112489&quot;&gt;https://stackoverflow.com/a/18371427/2112489&lt;/a&gt;  The function &lt;code&gt;my-add-buffer&lt;/code&gt; would need to be incorporated at the appropriate locations of the code in the above link if a user chooses to implement that feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The user may wish to create an entry in a custom &lt;code&gt;mode-line-format&lt;/code&gt; that displays the name of the current tab group in the mode-line by incorporating the following snippet:  &lt;code&gt;(:eval (when tabbar-mode (format &quot;%s&quot; (tabbar-current-tabset t))))&lt;/code&gt;  Customizing the mode-line in more detail, however, is beyond the scope of this example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;tabbar-add-tab&lt;/code&gt; has been modified so as to alphabetize the tabs/buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;tabbar-line-tab&lt;/code&gt; has been modified so as to provide four (4) different faces depending upon the situation.  If the tab/buffer is associated with the frame and IS selected, then use &lt;code&gt;tabbar-selected-associated&lt;/code&gt; face.  If the tab/buffer is associated with the frame and NOT selected, then use &lt;code&gt;tabbar-unselected-associated&lt;/code&gt; face.  If the tab/buffer is NOT associated with the frame and IS selected, then use &lt;code&gt;tabbar-selected-unassociated&lt;/code&gt; face.  If the tab/buffer is NOT associated with the frame and is NOT selected, then use &lt;code&gt;tabbar-unselected-unassociated&lt;/code&gt; face.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Download tabbar version 2.0.1 by David Ponce:&#xA;;;   https://marmalade-repo.org/packages/tabbar&#xA;;; or use package-install for marmalade repositories.&#xA;&#xA;;; Place tabbar-2.0.1.el in the `load-path` -- it is okay to rename it to tabbar.el&#xA;;; or add the directory (where `tabbar.el` resides) to the `load-path`.&#xA;;; EXAMPLE:  (setq load-path (append '(&quot;/Users/HOME/.emacs.d/lisp/&quot;) load-path))&#xA;&#xA;(require 'tabbar)&#xA;&#xA;(setq tabbar-cycle-scope 'tabs)&#xA;&#xA;(remove-hook 'kill-buffer-hook 'tabbar-buffer-track-killed)&#xA;&#xA;(defun my-buffer-groups ()&#xA;  &quot;Function that gives the group names the current buffer belongs to.&#xA;It must return a list of group names, or nil if the buffer has no&#xA;group.  Notice that it is better that a buffer belongs to one group.&quot;&#xA;  (list&#xA;    (cond&#xA;      ((memq (current-buffer) (my-buffer-list (selected-frame)))&#xA;        &quot;A&quot;)&#xA;      (t&#xA;        &quot;N&quot;))))&#xA;&#xA;(setq tabbar-buffer-groups-function 'my-buffer-groups) ;; 'tabbar-buffer-groups&#xA;&#xA;;; redefine tabbar-add-tab so that it alphabetizes / sorts the tabs&#xA;(defun tabbar-add-tab (tabset object &amp;amp;optional append)&#xA;  &quot;Add to TABSET a tab with value OBJECT if there isn't one there yet.&#xA;If the tab is added, it is added at the beginning of the tab list,&#xA;unless the optional argument APPEND is non-nil, in which case it is&#xA;added at the end.&quot;&#xA;  (let ((tabs (tabbar-tabs tabset)))&#xA;    (if (tabbar-get-tab object tabset)&#xA;        tabs&#xA;      (let* ((tab (tabbar-make-tab object tabset))&#xA;             (tentative-new-tabset&#xA;               (if append&#xA;                 (append tabs (list tab))&#xA;                 (cons tab tabs)))&#xA;             (new-tabset&#xA;               (sort&#xA;                  tentative-new-tabset&#xA;                  #'(lambda (e1 e2)&#xA;                     (string-lessp&#xA;                       (format &quot;%s&quot; (car e1)) (format &quot;%s&quot; (car e2)))))))&#xA;        (tabbar-set-template tabset nil)&#xA;        (set tabset new-tabset)))))&#xA;&#xA;;; AUTHOR:  Alp Aker -- https://github.com/alpaker/Frame-Bufs&#xA;;; @lawlist extracted/revised the function(ality) from said library.&#xA;(defun my-buffer-list (frame)&#xA;  ;; Remove dead buffers.&#xA;  (set-frame-parameter frame 'frame-bufs-buffer-list&#xA;    (delq nil (mapcar #'(lambda (x) (if (buffer-live-p x) x))&#xA;      (frame-parameter frame 'frame-bufs-buffer-list))))&#xA;  ;; Return the associated-buffer list.&#xA;  (frame-parameter frame 'frame-bufs-buffer-list))&#xA;&#xA;(defun my-kill-buffer-fn ()&#xA;&quot;This function is attached to a buffer-local `kill-buffer-hook'.&quot;&#xA;  (let ((frame (selected-frame))&#xA;        (current-buffer (current-buffer)))&#xA;    (when (memq current-buffer (my-buffer-list frame))&#xA;      (my-remove-buffer current-buffer frame))))&#xA;&#xA;;; AUTHOR:  Alp Aker -- https://github.com/alpaker/Frame-Bufs&#xA;;; @lawlist extracted/revised the function(ality) from said library.&#xA;(defun my-add-buffer (&amp;amp;optional buf frame)&#xA;&quot;Add BUF to FRAME's associated-buffer list if not already present.&quot;&#xA;(interactive)&#xA;  (let* ((buf (if buf buf (current-buffer)))&#xA;         (frame (if frame frame (selected-frame)))&#xA;         (associated-bufs (frame-parameter frame 'frame-bufs-buffer-list)))&#xA;    (unless (bufferp buf)&#xA;      (signal 'wrong-type-argument (list 'bufferp buf)))&#xA;    (unless (memq buf associated-bufs)&#xA;      (set-frame-parameter frame 'frame-bufs-buffer-list (cons buf associated-bufs)))&#xA;    (with-current-buffer buf&#xA;      (add-hook 'kill-buffer-hook 'my-kill-buffer-fn 'append 'local))&#xA;    (when tabbar-mode (tabbar-display-update))))&#xA;&#xA;;; AUTHOR:  Alp Aker -- https://github.com/alpaker/Frame-Bufs&#xA;;; @lawlist extracted/revised the function(ality) from said library.&#xA;(defun my-remove-buffer (&amp;amp;optional buf frame)&#xA;&quot;Remove BUF from FRAME's associated-buffer list.&quot;&#xA;(interactive)&#xA;  (let ((buf (if buf buf (current-buffer)))&#xA;        (frame (if frame frame (selected-frame))))&#xA;    (set-frame-parameter frame 'frame-bufs-buffer-list&#xA;      (delq buf (frame-parameter frame 'frame-bufs-buffer-list)))&#xA;    (when tabbar-mode (tabbar-display-update))))&#xA;&#xA;;; AUTHOR:  Alp Aker -- https://github.com/alpaker/Frame-Bufs&#xA;;; @lawlist extracted/revised the function(ality) from said library.&#xA;(defun my-buffer-list-reset ()&#xA;    &quot;Wipe the entire slate clean for the selected frame.&quot;&#xA;  (interactive)&#xA;    (modify-frame-parameters (selected-frame) (list (cons 'frame-bufs-buffer-list nil)))&#xA;    (when tabbar-mode (tabbar-display-update)))&#xA;&#xA;(defun my-switch-tab-group ()&#xA;&quot;Switch between tab group `A` and `N`.&quot;&#xA;(interactive)&#xA;  (let ((current-group (format &quot;%s&quot; (tabbar-current-tabset t)))&#xA;        (tab-buffer-list (mapcar&#xA;            #'(lambda (b)&#xA;                (with-current-buffer b&#xA;                  (list (current-buffer)&#xA;                        (buffer-name)&#xA;                        (funcall tabbar-buffer-groups-function))))&#xA;                 (funcall tabbar-buffer-list-function))))&#xA;    (catch 'done&#xA;      (mapc&#xA;        #'(lambda (group)&#xA;            (when (not (equal current-group&#xA;                          (format &quot;%s&quot; (car (car (cdr (cdr group)))))))&#xA;              (throw 'done (switch-to-buffer (car (cdr group))))))&#xA;        tab-buffer-list))))&#xA;&#xA;(defface tabbar-selected-associated&#xA;  '((t :background &quot;black&quot; :foreground &quot;yellow&quot; :box (:line-width 2 :color &quot;yellow&quot;)))&#xA;  &quot;Face used for the selected tab -- associated with the `frame-bufs-buffer-list`.&quot;&#xA;  :group 'tabbar)&#xA;&#xA;(defface tabbar-unselected-associated&#xA;  '((t :background &quot;black&quot; :foreground &quot;white&quot; :box (:line-width 2 :color &quot;white&quot;)))&#xA;  &quot;Face used for unselected tabs  -- associated with the `frame-bufs-buffer-list`.&quot;&#xA;  :group 'tabbar)&#xA;&#xA;(defface tabbar-selected-unassociated&#xA;  '((t :background &quot;black&quot; :foreground &quot;white&quot; :box (:line-width 2 :color &quot;firebrick&quot;)))&#xA;  &quot;Face used for the selected tab -- UNassociated with the `frame-bufs-buffer-list`.&quot;&#xA;  :group 'tabbar)&#xA;&#xA;(defface tabbar-unselected-unassociated&#xA;  '((t :background &quot;black&quot; :foreground &quot;white&quot; :box (:line-width 2 :color &quot;blue&quot;)))&#xA;  &quot;Face used for unselected tabs -- UNassociated with the `frame-bufs-buffer-list`.&quot;&#xA;  :group 'tabbar)&#xA;&#xA;(setq tabbar-background-color &quot;black&quot;)&#xA;&#xA;(defsubst tabbar-line-tab (tab)&#xA;  &quot;Return the display representation of tab TAB.&#xA;That is, a propertized string used as an `header-line-format' template&#xA;element.&#xA;Call `tabbar-tab-label-function' to obtain a label for TAB.&quot;&#xA;  (concat&#xA;    (propertize&#xA;      (if tabbar-tab-label-function&#xA;          (funcall tabbar-tab-label-function tab)&#xA;        tab)&#xA;      'tabbar-tab tab&#xA;      'local-map (tabbar-make-tab-keymap tab)&#xA;      'help-echo 'tabbar-help-on-tab&#xA;      'mouse-face 'tabbar-highlight&#xA;      'face&#xA;        (cond&#xA;          ((and&#xA;              (tabbar-selected-p tab (tabbar-current-tabset))&#xA;              (memq (current-buffer) (my-buffer-list (selected-frame))))&#xA;            'tabbar-selected-associated)&#xA;          ((and&#xA;              (not (tabbar-selected-p tab (tabbar-current-tabset)))&#xA;              (memq (current-buffer) (my-buffer-list (selected-frame))))&#xA;            'tabbar-unselected-associated)&#xA;          ((and&#xA;              (tabbar-selected-p tab (tabbar-current-tabset))&#xA;              (not (memq (current-buffer) (my-buffer-list (selected-frame)))))&#xA;            'tabbar-selected-unassociated)&#xA;          ((and&#xA;              (not (tabbar-selected-p tab (tabbar-current-tabset)))&#xA;              (not (memq (current-buffer) (my-buffer-list (selected-frame)))))&#xA;            'tabbar-unselected-unassociated))&#xA;      'pointer 'hand)&#xA;    tabbar-separator-value))&#xA;&#xA;(define-key global-map &quot;\C-c\C-r&quot; 'my-buffer-list-reset)&#xA;&#xA;(define-key global-map &quot;\C-c\C-a&quot; 'my-add-buffer)&#xA;&#xA;(define-key global-map &quot;\C-c\C-n&quot; 'my-remove-buffer)&#xA;&#xA;(define-key global-map (kbd &quot;&amp;lt;M-s-right&amp;gt;&quot;) 'tabbar-forward)&#xA;&#xA;(define-key global-map (kbd &quot;&amp;lt;M-s-left&amp;gt;&quot;) 'tabbar-backward)&#xA;&#xA;(define-key global-map [C-tab] 'my-switch-tab-group)&#xA;&#xA;(tabbar-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The following screenshot depicts the two possible buffer/tab groupings:  (1) on the left is a grouping of those buffers/tabs that are associated with the frame named &lt;code&gt;SYSTEM&lt;/code&gt; [yellow and white tabs], with the capital letter &quot;A&quot; indicated in the mode-line; and (2) on the right is a grouping of those buffers/tabs that are &lt;em&gt;NOT&lt;/em&gt; associated with the frame named &lt;code&gt;SYSTEM&lt;/code&gt; [blue and red tabs], with a capital letter &quot;N&quot; indicated in the mode-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/tabbar_example.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2019-06-12T14:20:04.990" LastActivityDate="2019-06-12T14:20:04.990" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="10113" PostTypeId="2" ParentId="10103" CreationDate="2015-03-18T17:32:34.230" Score="1" Body="&lt;p&gt;AUCTeX supports by default forward/inverse search with xdvi, you can see the options used for that in the value of the variable &lt;code&gt;TeX-view-program-list-builtin&lt;/code&gt;.  This variable is not customizable, but you have (at least) two options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;setq&lt;/code&gt; the variable in your init file copying the default value and add there the flags &lt;code&gt;-geometry 917X736 -s 6&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;define a new viewer in &lt;code&gt;TeX-view-program-list&lt;/code&gt;, as you suggested in your question, and add there the options to enable forward/inverse search: &lt;code&gt;-sourceposition \&quot;%n %b\&quot; -editor \&quot;%cS\&quot;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-03-18T17:32:34.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10114" PostTypeId="1" CreationDate="2015-03-18T18:26:13.270" Score="10" ViewCount="8984" Body="&lt;p&gt;I am trying to display images in org files. I have used links such as&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;[[file:~/path/to/image.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I click on the link, it gives me another buffer in which there are only symbols. When I put the cursor on the link and type &lt;code&gt;C-c C-x C-v&lt;/code&gt;, there is an error message in the minibuffer saying&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;No images to display inline&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I tried to enable &lt;code&gt;iimage-mode&lt;/code&gt; but it didn't work either. So, I wonder if there is a problem with the org version installed with Emacs (I am using Emacs 24.4 with Org 8.2.10 and I am on Windows) or is there any configuration that I should do?&lt;/p&gt;&#xA;" OwnerUserId="6812" LastEditorUserId="40567" LastEditDate="2023-05-28T01:39:21.670" LastActivityDate="2023-05-28T01:39:21.670" Title="Org-mode: No images to display inline" Tags="|org-mode|microsoft-windows|images|" AnswerCount="4" CommentCount="12" ContentLicense="CC BY-SA 4.0" />
  <row Id="10115" PostTypeId="1" AcceptedAnswerId="10135" CreationDate="2015-03-18T18:43:46.397" Score="8" ViewCount="238" Body="&lt;p&gt;Is there a package that helps me to choose a predefined layout for an arbitrary number of windows in a frame? I would be perfect if it works in a similar way to the select-layout function in tmux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a gif showing how tmux switches between different layouts&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cOKX2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="536" LastEditDate="2015-03-19T11:36:29.873" LastActivityDate="2015-11-13T02:16:19.653" Title="Window Layout selecter" Tags="|window|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10116" PostTypeId="1" AcceptedAnswerId="10118" CreationDate="2015-03-18T19:17:02.933" Score="2" ViewCount="56" Body="&lt;p&gt;Is there any command which let me observe output of async-called process (just like &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;compile&lt;/kbd&gt;), but does not try to parse output buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background: for quite a lot of non-compilation tasks (hg push, python some_sample_script, unzip big_file.zip and much more...) I tend to prefer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;compile&lt;/kbd&gt;  «command»&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to both&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-!&lt;/kbd&gt; «command» &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-!&lt;/kbd&gt; «command» &lt;kbd&gt;&amp;amp;&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is simple: M-x compile does not block Emacs, let me observe command progress in a buffer (including &lt;kbd&gt;PgUp&lt;/kbd&gt;/&lt;kbd&gt;PgDn&lt;/kbd&gt; and search), always leaves output in solid non-disappearing buffer even if output happens to be short and can be safely &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;k&lt;/kbd&gt; in case of problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one problem, though: compilation parses command output, what brings unneeded coloring, sometimes causes confusing navigation, and - what is worst - introduces performance penalty on long outputs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is there anything what would spawn process exactly as &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;compile&lt;/kbd&gt;, but leave output buffer as plain text?&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="160" LastEditDate="2015-03-18T20:29:51.693" LastActivityDate="2015-03-18T20:29:51.693" Title="Running process interactively (like compilation) but without parsing" Tags="|compilation|process|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10117" PostTypeId="2" ParentId="10114" CreationDate="2015-03-18T19:36:32.827" Score="4" Body="&lt;p&gt;Emacs for Windows is generally not distributed with the necessary libraries to display PNG and other image formats. See this section of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Image-support.html#Image-support&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Emacs FAQ for MS Windows&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest solution is to install an Emacs distributions for Windows that is built with image support, such as &lt;a href=&quot;https://bitbucket.org/Haroogan/emacs-for-windows/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this one&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can add the necessary libraries. See this &lt;a href=&quot;https://stackoverflow.com/questions/2650041/emacs-under-windows-and-png-files&quot;&gt;question&lt;/a&gt; on Stack Overflow.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-03-18T21:41:42.573" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10118" PostTypeId="2" ParentId="10116" CreationDate="2015-03-18T20:24:27.470" Score="2" Body="&lt;p&gt;&lt;kbd&gt;M-&amp;amp;&lt;/kbd&gt; Runs &lt;code&gt;async-shell-command&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-03-18T20:24:27.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10119" PostTypeId="1" AcceptedAnswerId="33355" CreationDate="2015-03-18T20:30:14.443" Score="4" ViewCount="721" Body="&lt;p&gt;I try to make a clocktable report that filters by tags like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :tags (&quot;REP&quot;) :tstart &quot;&amp;lt;-6d&amp;gt;&quot; :tend &quot;&amp;lt;now&amp;gt;&quot;&#xA;...&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get an error:&#xA;Wrong argument type: stringp, (&quot;REP&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remove &lt;code&gt;:tags (&quot;REP&quot;)&lt;/code&gt; then it works. But I'd like to filter by tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me what I'm doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt; &#xA;On the side similar 'clocktable-by-tags' post:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/17353591/timetable-grouped-by-tag&quot;&gt;https://stackoverflow.com/questions/17353591/timetable-grouped-by-tag&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is similar to what I want, but not quite it. I'd like the classical clocktable report but only display entries that match certain tags. (REP meaining things that go on my weekly REPort.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-06-07T00:02:06.740" Title="clocktable tag filter not working?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10121" PostTypeId="1" AcceptedAnswerId="10122" CreationDate="2015-03-18T21:44:55.853" Score="13" ViewCount="2708" Body="&lt;p&gt;I am working on &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/tree/98e2a92831f401a934d17cde6241dbfca636391f/setup-files/setup-visual.el#L30-L73&quot; rel=&quot;noreferrer&quot;&gt;optimizing my emacs config&lt;/a&gt; where I can dynamically create interactive functions for all themes I have in a list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a simplified version of the construct I am trying to make work. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; List containing names of functions that I want to create&#xA;(setq my/defun-list '(zz-abc&#xA;                      zz-def&#xA;                      zz-ghi))&#xA;&#xA;;; Elisp macro to create an interactive defun whose name&#xA;;; is passed as the macro argument&#xA;(defmacro my/create-defun (defun-name)&#xA;  `(defun ,defun-name ()&#xA;     (interactive)&#xA;     (let ((fn-name (symbol-name ',defun-name)))&#xA;       (message &quot;Testing creation of function %s&quot; fn-name))))&#xA;&#xA;;; Loop to call the above macro for each element in the list&#xA;;; DOES *NOT* WORK&#xA;(dolist (name my/defun-list)&#xA;  (my/create-defun name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I unroll the loop manually, it works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; WORKS&#xA;(my/create-defun zz-abc)&#xA;(my/create-defun zz-def)&#xA;(my/create-defun zz-ghi)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the below does not work where I pass in the symbol names (which is probably what's happening when the loop unrolls by itself). Note the quotes before the macro arguments.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; DOES *NOT* WORK&#xA;(my/create-defun 'zz-abc)&#xA;(my/create-defun 'zz-def)&#xA;(my/create-defun 'zz-ghi)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Update&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;strong&gt;@wvxvw&lt;/strong&gt;'s help, I &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/tree/38331e71acce46256825b6941995ae573377f1cd/setup-files/setup-visual.el#L29-L84&quot; rel=&quot;noreferrer&quot;&gt;finally got this working&lt;/a&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @wvxvw suggests, I will not be batch-generating defuns for any and every use case. This was a special use case where for a theme named &lt;code&gt;XYZ&lt;/code&gt;, I want to generate a defun called &lt;code&gt;load-theme/XYZ&lt;/code&gt; that does the job of &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Disabling all other themes that might be active&lt;/li&gt;&#xA;&lt;li&gt;Calling &lt;code&gt;load-theme&lt;/code&gt; for &lt;code&gt;XYZ&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Doing some more custom stuff related to that theme; I pass in the custom settings for each theme through the &lt;code&gt;my/themes&lt;/code&gt; alist.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-03-20T14:59:31.833" LastActivityDate="2017-07-16T13:38:07.197" Title="How can I create multiple defuns by looping through a list?" Tags="|elisp-macros|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10122" PostTypeId="2" ParentId="10121" CreationDate="2015-03-18T22:31:45.687" Score="13" Body="&lt;p&gt;Here's an attempt at explaining and some suggestion.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my/create-defun (defun-name)&#xA;  `(defun ,defun-name ()&#xA;     (interactive)&#xA;     (let ((fn-name (symbol-name ',defun-name)))&#xA;       (message &quot;Testing creation of function %s&quot; fn-name))))&#xA;&#xA;(dolist (name my/defun-list)&#xA;  ;; Macros are meant to create code, not execute it.  Think&#xA;  ;; about simply substituting the contents of your macro here&#xA;  ;; what would you expect it to do?&#xA;  (my/create-defun name))&#xA;&#xA;(dolist (name my/defun-list)&#xA;  ;; This is not something a compiler (or interpreter)&#xA;  ;; can work with, it needs all sources of the code it&#xA;  ;; is going to execute&#xA;  (defun defun-name ()&#xA;    (interactive)&#xA;    (let ((fn-name (symbol-name 'defun-name)))&#xA;      (message &quot;Testing creation of function %s&quot; fn-name))))&#xA;&#xA;;; This works because you, indeed created three defuns&#xA;(my/create-defun zz-abc)&#xA;(my/create-defun zz-def)&#xA;(my/create-defun zz-ghi)&#xA;&#xA;;; This doesn't work because `defun' macro expect the name of&#xA;;; the function to be a symbol (but you are giving it a list&#xA;;; `(quote zz-abc)'.&#xA;(my/create-defun 'zz-abc)&#xA;(my/create-defun 'zz-def)&#xA;(my/create-defun 'zz-ghi)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Now, let's try to fix this:&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Rewriting the original macro as a function and using a&#xA;;; macro to collect the generated forms gives:&#xA;(defun my/create-defun (defun-name)&#xA;  `(defun ,defun-name ()&#xA;     (interactive)&#xA;     (let ((fn-name (symbol-name ',defun-name)))&#xA;       (message &quot;Testing creation of function %s&quot; fn-name))))&#xA;&#xA;(defmacro my/create-defuns (defuns)&#xA;  `(progn ,@(mapcar 'my/create-defun defuns)))&#xA;&#xA;(macroexpand '(my/create-defuns (zz-abc zz-def zz-ghi)))&#xA;;; Just to make sure&#xA;(progn&#xA;  (defun zz-abc nil&#xA;    (interactive)&#xA;    (let ((fn-name (symbol-name (quote zz-abc))))&#xA;      (message &quot;Testing creation of function %s&quot; fn-name)))&#xA;  (defun zz-def nil&#xA;    (interactive)&#xA;    (let ((fn-name (symbol-name (quote zz-def))))&#xA;      (message &quot;Testing creation of function %s&quot; fn-name)))&#xA;  (defun zz-ghi nil&#xA;    (interactive)&#xA;    (let ((fn-name (symbol-name (quote zz-ghi))))&#xA;      (message &quot;Testing creation of function %s&quot; fn-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Example with reading function names from a variable&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my/functions '((func-1 . 1) (func-2 . 2) (func-3 . 3)))&#xA;&#xA;(defun my/create-defun-n (defun-name n)&#xA;  `(defun ,defun-name ()&#xA;     (message &quot;function: %s, n %d&quot; ',defun-name ,n)))&#xA;&#xA;(defmacro my/create-defuns-var ()&#xA;  `(progn ,@(mapcar&#xA;             (lambda (x) (my/create-defun-n (car x) (cdr x)))&#xA;             my/functions)))&#xA;&#xA;(macroexpand '(my/create-defuns-var))&#xA;(progn&#xA;  (defun func-1 nil (message &quot;function: %s, n %d&quot; (quote func-1) 1))&#xA;  (defun func-2 nil (message &quot;function: %s, n %d&quot; (quote func-2) 2))&#xA;  (defun func-3 nil (message &quot;function: %s, n %d&quot; (quote func-3) 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem was of a conceptual kind: macros are for generating code when the environment wants to read it. When you execute the code yourself (as being the user of your program) this is already too late to do it (the environment should know by then what the program is).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;A marginal note: I would advise against lumping together several &lt;code&gt;defuns&lt;/code&gt;. The reason is that it makes debuggin a lot more complicated. The little redundancy you have in repeated definitions pays off very well during maintenance phase (and maintenance is typically the longest phase in program's life time).&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="115" LastEditDate="2015-03-20T13:53:22.757" LastActivityDate="2015-03-20T13:53:22.757" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="10123" PostTypeId="1" AcceptedAnswerId="10124" CreationDate="2015-03-19T00:49:25.883" Score="5" ViewCount="1080" Body="&lt;p&gt;To open a buffer on the source code for a command definition, I usually follow a convoluted procedure something like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Guess the name of the mode from the function name&lt;/li&gt;&#xA;&lt;li&gt;Guess the name of an elisp file involved in the implemention of that mode&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x locate-library&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Memorize the transiently-displayed path in the minibuffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-f&lt;/code&gt; and type in the path name from memory&lt;/li&gt;&#xA;&lt;li&gt;grep around for the function in the containing directory&lt;/li&gt;&#xA;&lt;li&gt;Open the buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s&lt;/code&gt; and search for the function name to jump to the right line&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What's the &lt;em&gt;good&lt;/em&gt; way to do this?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-03-19T02:52:11.647" Title="How to visit file containing source code for a given function?" Tags="|elisp|debugging|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10124" PostTypeId="2" ParentId="10123" CreationDate="2015-03-19T02:02:54.050" Score="7" Body="&lt;p&gt;As @Dan said in his comment, if you know the name of the function, then just use &lt;strong&gt;&lt;code&gt;C-h f&lt;/code&gt;&lt;/strong&gt; plus the function name, to see a description of it. Then hit &lt;code&gt;RET&lt;/code&gt; on, or click, the file-name link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more direct way is to use command &lt;strong&gt;&lt;code&gt;find-function&lt;/code&gt;&lt;/strong&gt;. You give it the function name and it takes you directly to its source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I bind &lt;code&gt;find-function-other-frame&lt;/code&gt; to &lt;code&gt;C-x 5 F&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This assumes that the function is loaded or autoloaded.  If not then your approach of trying to grep for it is OK.  But you don't need to memorize anything that is displayed transiently in the echo area (what you called the minibuffer - it shares the same screen space). Just &lt;code&gt;C-x 4 b *Messages*&lt;/code&gt; to show the &lt;code&gt;*Messages*&lt;/code&gt; buffer, where you can usually see the same message (and previous messages).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-19T02:08:21.837" LastActivityDate="2015-03-19T02:08:21.837" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10125" PostTypeId="1" AcceptedAnswerId="10128" CreationDate="2015-03-19T02:12:38.837" Score="14" ViewCount="15483" Body="&lt;p&gt;Does emacs have a function or library that can allow the user to go to the function declaration even if it was defined in another file? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, what languages is there support for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inspiration for this question, comes from the below article which talks about some of the reasons why emacs will never be able to compete with IDE's. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://henrikwarne.com/2012/06/17/programmer-productivity-emacs-versus-intellij-idea/&quot;&gt;http://henrikwarne.com/2012/06/17/programmer-productivity-emacs-versus-intellij-idea/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2021-01-12T14:47:11.570" Title="Can emacs support go to declaration of function in an entire project?" Tags="|project|ide|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10126" PostTypeId="2" ParentId="10123" CreationDate="2015-03-19T02:52:11.647" Score="5" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/purcell/elisp-slime-nav&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;elisp-slime-nav&lt;/code&gt;&lt;/a&gt; package (also available through Melpa) will collapse all of those steps into a single keyboard shortcut: &lt;code&gt;M-.&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install this package and put these lines in your init:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'elisp-slime-nav)&#xA;(dolist (hook '(emacs-lisp-mode-hook ielm-mode-hook))&#xA;  (add-hook hook 'elisp-slime-nav-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-.&lt;/code&gt; will navigate you to the variable/function under point&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-,&lt;/code&gt; will bring you back&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Check out its &lt;a href=&quot;https://github.com/purcell/elisp-slime-nav&quot; rel=&quot;noreferrer&quot;&gt;github page&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-03-19T02:52:11.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10127" PostTypeId="2" ParentId="10125" CreationDate="2015-03-19T03:12:38.360" Score="5" Body="&lt;p&gt;The primary solution for this in emacs is using TAGS files, which are created by programs such as etags or gtags. I myself use (and recommend) exuberant ctags, and etags-select.el to help you narrow down destinations when the search symbol lies in multiple destinations. The supported languages are quite numerous, see the individual tools' manuals. There is even support for adding your own language, whereby you can provide a regular expression that instructs ctags how to isolate the tags you are interested in. &lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2015-03-19T03:12:38.360" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10128" PostTypeId="2" ParentId="10125" CreationDate="2015-03-19T06:22:48.280" Score="15" Body="&lt;p&gt;You can jump to any definition/reference of entire project as large as Linux kernel source tree (more than 36k) in an instant. See &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;my C/C++ guide&lt;/a&gt; for details. For C/C++, I suggest using &lt;a href=&quot;http://www.gnu.org/software/global/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Global&lt;/a&gt; that supports C, C++, Yacc, Java, PHP4 and assembly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key is, if you want to have IDE features of a language, you have to install plugin of that language. Here are some packages for dynamic languages that I know of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Live web development: &lt;a href=&quot;https://github.com/skeeto/skewer-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;skewer-mode&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Javascript: &lt;a href=&quot;http://ternjs.net/doc/manual.html#emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tern&lt;/a&gt;. But before that, remember to install &lt;a href=&quot;https://github.com/mooz/js2-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;js2-mode&lt;/a&gt;. As for what &lt;code&gt;js2-mode&lt;/code&gt; does, see &lt;a href=&quot;http://elpa.gnu.org/packages/js2-mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the description&lt;/a&gt;; but in essence, &lt;code&gt;js2-mode&lt;/code&gt; is a complete Javascript parser that generates an AST to do proper IDE features. If you install &lt;code&gt;skewer-mode&lt;/code&gt; than you will have &lt;code&gt;js2-mode&lt;/code&gt; by default, since &lt;code&gt;skewer-mode&lt;/code&gt; depends on it.&lt;/li&gt;&#xA;&lt;li&gt;Python: &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;nofollow noreferrer&quot;&gt;elpy&lt;/a&gt;, see the &lt;a href=&quot;http://elpy.readthedocs.org/en/latest/ide.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;IDE features&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Ruby: &lt;a href=&quot;https://github.com/dgutov/robe&quot; rel=&quot;nofollow noreferrer&quot;&gt;robe&lt;/a&gt; provides these features:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Jump to method definition&lt;/li&gt;&#xA;  &lt;li&gt;Jump to super or a constructor called at point&lt;/li&gt;&#xA;  &lt;li&gt;Jump to a module or class (provided it has at least one method defined)&lt;/li&gt;&#xA;  &lt;li&gt;Display method documentation&lt;/li&gt;&#xA;  &lt;li&gt;Display information about method called at point using ElDoc&lt;/li&gt;&#xA;  &lt;li&gt;Method and constant name completion&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;R: &lt;a href=&quot;http://ess.r-project.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ESS - Emacs Speak Statistics&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Erlang: &lt;a href=&quot;https://github.com/tjarvstrand/edts&quot; rel=&quot;nofollow noreferrer&quot;&gt;EDTS - Erlang Development Tool Suite&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Haskell: &lt;a href=&quot;http://commercialhaskell.github.io/intero/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intero&lt;/a&gt; provides on-the-fly typechecking, type info, completion and navigation&lt;/li&gt;&#xA;&lt;li&gt;OCaml: &lt;a href=&quot;https://ocaml.github.io/merlin/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Merlin&lt;/a&gt; provides on-the-fly typechecking, type info, completion, navigation and &lt;a href=&quot;https://ocaml.github.io/merlin/destruct.ogv&quot; rel=&quot;nofollow noreferrer&quot;&gt;content-aware fill&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;ctags&lt;/code&gt; to support vast many languages such as shell script or Tcl...&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="730" LastEditDate="2017-08-21T10:26:14.083" LastActivityDate="2017-08-21T10:26:14.083" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10129" PostTypeId="1" CreationDate="2015-03-19T08:31:08.600" Score="1" ViewCount="45" Body="&lt;p&gt;I'd like to cross reference an input method from a minor mode docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode xxx&#xA;  ...&#xA;  &quot;Super `xxx' derived mode.&#xA;&#xA;  Cool to use with input method `my-magic-input-method'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;my-magic-input-method&lt;/code&gt; is not linked in &lt;code&gt;*Help*&lt;/code&gt; window. Is there a way to inform Emacs about input method links like there are methods to inform it about variables, functions and symbols?&lt;/p&gt;&#xA;" OwnerUserId="5213" LastActivityDate="2015-03-19T08:31:08.600" Title="How to cross reference input method in docstring?" Tags="|documentation|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10130" PostTypeId="2" ParentId="10111" CreationDate="2015-03-19T09:45:43.663" Score="1" Body="&lt;p&gt;It was another snippet having the same name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#name : var_dump&#xA;# key: getdefinedvars&#xA;# --&#xA;var_dump(get_defined_vars());&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2015-03-19T09:45:43.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10131" PostTypeId="2" ParentId="9982" CreationDate="2015-03-19T11:48:08.827" Score="2" Body="&lt;p&gt;&lt;code&gt;M-.&lt;/code&gt; works in anaconda-mode (which I switched to after having problems with elpy). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you need proper python environment, in my case I do the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;mkvirtualenv someenv&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;python setup.py develop&lt;/code&gt; for all modules develop or use (or prefer to reach source instead of installed version)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x venv-workon RET someenv&lt;/code&gt; to enable paths in Emacs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then I configure &lt;code&gt;anaconda-mode&lt;/code&gt; to be active whenever I edit python and voila, &lt;code&gt;M-.&lt;/code&gt; works&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="1979" LastEditDate="2020-03-07T14:06:36.137" LastActivityDate="2020-03-07T14:06:36.137" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10132" PostTypeId="2" ParentId="9962" CreationDate="2015-03-19T12:25:30.633" Score="4" Body="&lt;p&gt;Here are two apporaches one uses only emacs, and the other also uses shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases it is usefull to separate the problem in two:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;write a defun which process a single file&lt;/li&gt;&#xA;&lt;li&gt;get the list of files and apply the defun to each file&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also I wouldn't insert the file contents in the temp buffer. I would open the file, process it, and the save it -- so that I only need file name once.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;A. Using Lisp only&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;A.1. defun which process a single file&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-process-file (fpath)&#xA;  &quot;process the file at fullpath FPATH ...&quot;&#xA;  (let (mybuffer)&#xA;    (setq mybuffer (find-file fpath))&#xA;&#xA;    (goto-char (point-min)) ;; in case buffer is open&#xA;    (while (search-forward-regexp &quot;REGEXP&quot; nil t)&#xA;      (replace-match &quot;SUBSTITUTION&quot; nil t)) ;; if you need to reference things like (string-match 1) use: t nil&#xA;&#xA;    (save-buffer)&#xA;    (kill-buffer mybuffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;A.2. process files&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'find-lisp)&#xA;(mapc 'my-process-file (find-lisp-find-files &quot;/path/to/dir/&quot; &quot;\\.xml$&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;B. Using shell + elisp&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;B.1. script which process a single file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Make the following shell script &lt;code&gt;my-process-file.bash&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;#! /bin/sh&#xA;&quot;:&quot;; exec emacs --no-site-file --script &quot;$0&quot; -- &quot;$@&quot; # -*- mode:emacs-lisp -*-&#xA;&#xA;;; emacs options:&#xA;(setq make-backup-files nil)&#xA;(setq next-line-add-newlines nil)&#xA;&#xA;;; open file:&#xA;(find-file (nth 1 argv))&#xA;&#xA;;; process file:&#xA;(goto-char (point-min))&#xA;(while (search-forward-regexp &quot;REGEXP&quot; nil t)&#xA;  (replace-match &quot;SUBSTITUTION&quot; nil t)) ;; if you need to reference things like (string-match 1) use: t nil&#xA;&#xA;;; save file:&#xA;(save-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(do not alter first two lines)&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;B.2. command to process files&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Apply it to xml files:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;find . -type f -name &quot;*.xml&quot; | parallel my-process-file.bash {}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2017-05-18T10:30:35.920" LastActivityDate="2017-05-18T10:30:35.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10133" PostTypeId="1" AcceptedAnswerId="10787" CreationDate="2015-03-19T13:09:51.160" Score="8" ViewCount="1840" Body="&lt;p&gt;I've discovered &lt;code&gt;desktop-save-mode&lt;/code&gt; which allows Emacs to be closed and when it reopens, it appears with the same files that were open before.&lt;/p&gt;&#xA;&lt;p&gt;I want to take this a bit further and I was wondering if I could also:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Save the history of files I've open with &lt;code&gt;C-x C-f&lt;/code&gt;. I often end up opening the same files, so it'd be great to easily find those. If not possible to save this, maybe some bookmarks would help?&lt;/li&gt;&#xA;&lt;li&gt;Save the history of buffer commands executed via &lt;code&gt;M-x&lt;/code&gt; or &lt;code&gt;M-:&lt;/code&gt;, is this possible? If not possible, maybe I could keep some snippets around to do this?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="105" LastEditDate="2021-02-22T16:32:14.173" LastActivityDate="2021-02-22T16:32:14.173" Title="Saving open file list and buffer command history in between sessions" Tags="|buffers|files|eval-expression|savehist-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10134" PostTypeId="1" AcceptedAnswerId="10145" CreationDate="2015-03-19T13:48:15.627" Score="1" ViewCount="149" Body="&lt;p&gt;I am using &lt;code&gt;cperl-mode&lt;/code&gt; to edit Perl scripts. According to the Emacs wiki ( &lt;a href=&quot;http://www.emacswiki.org/emacs/CPerlMode&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; ) one could use &lt;code&gt;defalias&lt;/code&gt; to use &lt;code&gt;cperl-mode&lt;/code&gt; instead of &lt;code&gt;perl-mode&lt;/code&gt;. Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q -l init.el test.pl &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;init.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defalias 'perl-mode 'cperl-mode)&#xA;(defun my-test-hook ()&#xA;  (message-box (symbol-name major-mode)))&#xA;(add-hook 'cperl-mode-hook #'my-test-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This gives two message boxes, indicating that the hook &lt;code&gt;my-test-hook&lt;/code&gt; is being run twice at startup.. (I also tested this with &lt;code&gt;emacs-lisp-mode&lt;/code&gt; (without using &lt;code&gt;defalias&lt;/code&gt; of course) and then the hook was run only a single time, as expected.. So that was what lead me to suspect &lt;code&gt;defalias&lt;/code&gt; was the culprit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is the hook being run twice here? (I am asking because I would like to have it run only a single time if possible)&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="25" LastEditDate="2015-03-19T21:57:47.143" LastActivityDate="2015-03-19T21:57:47.143" Title="Why is cperl-mode-hook running twice?" Tags="|hooks|major-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10135" PostTypeId="2" ParentId="10115" CreationDate="2015-03-19T14:21:24.933" Score="4" Body="&lt;p&gt;I don't think that it will works &lt;em&gt;exactly&lt;/em&gt; the way that you want it, but &lt;a href=&quot;https://github.com/daic-h/emacs-rotate&quot; rel=&quot;nofollow&quot;&gt;emacs-rotate&lt;/a&gt; could be useful. You may have to add some custom Elisp to serve your specific purposes but check it though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even though I have a large monitor, I don't split-windows that much unless it's to watch the output of couple of &quot;consoles&quot;.&lt;/p&gt;&#xA;" OwnerUserId="943" LastActivityDate="2015-03-19T14:21:24.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10136" PostTypeId="1" CreationDate="2015-03-19T14:53:43.407" Score="3" ViewCount="144" Body="&lt;p&gt;How can one globally disable multi-frame animated graphic files (gif, tiff, etc.) from playing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Multi-frame images, for example animated GIFs, play by default. I would like to globally disable that function in my config while retaining the ability to use in-line images in ERC, org-mode, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The desired effect of disabling such images' auto-play function is to show the file's first frame only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;code&gt;image-toggle-animation&lt;/code&gt;, but it doesn't seem to do what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Emacs 24.4.1.&lt;/p&gt;&#xA;" OwnerUserId="2794" LastEditorUserId="25" LastEditDate="2015-03-19T22:03:38.860" LastActivityDate="2015-03-19T22:03:38.860" Title="Disable multi frame images from &quot;playing&quot; by default" Tags="|images|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10137" PostTypeId="1" CreationDate="2015-03-19T15:14:35.613" Score="6" ViewCount="5177" Body="&lt;p&gt;In &lt;code&gt;eshell&lt;/code&gt;, if I &lt;code&gt;echo $TERM&lt;/code&gt;, the result is &lt;code&gt;dumb&lt;/code&gt;. What does this mean? Is this an emacs specific thing, or a tty thing? &lt;/p&gt;&#xA;" OwnerUserId="118" LastActivityDate="2015-03-19T16:04:29.447" Title="What does TERM=dumb in eshell mean?" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10138" PostTypeId="1" CreationDate="2015-03-19T15:21:59.293" Score="1" ViewCount="682" Body="&lt;p&gt;I have some log files which contain ANSI colors, but ansi-color-for-comint-mode-on doesn't work, to get emacs to properly display the colors, and still shows the control codes. Is there another way to either show the colors, or at the very least remove the control codes for the colors.&lt;/p&gt;&#xA;" OwnerUserId="6817" LastActivityDate="2015-04-18T16:54:01.053" Title="ANSI colors in log4j mode" Tags="|colors|logging|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10139" PostTypeId="2" ParentId="10137" CreationDate="2015-03-19T15:53:20.007" Score="4" Body="&lt;p&gt;First, it's an Emacs thing. It tells the used shell, that the buffer for input/output has only limited capabilities. See the following comment and code in &lt;code&gt;lisp/startup.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;;; Subprocesses of Emacs do not have direct access to the terminal, so&#xA;;; unless told otherwise they should only assume a dumb terminal.&#xA;;; We are careful to do it late (after term-setup-hook), although the&#xA;;; new multi-tty code does not use $TERM any more there anyway.&#xA;(setenv &quot;TERM&quot; &quot;dumb&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is also an OS specific setting, see &lt;a href=&quot;http://en.wikipedia.org/wiki/Computer_terminal#Dumb_terminals&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Computer_terminal#Dumb_terminals&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2427" LastEditorUserId="2427" LastEditDate="2015-03-19T16:04:29.447" LastActivityDate="2015-03-19T16:04:29.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10140" PostTypeId="1" CreationDate="2015-03-19T15:58:26.023" Score="2" ViewCount="130" Body="&lt;p&gt;How can one quickly remove ancillary snippets of code in Python scripts under Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for debugging purposes, I often add some print statements to print out the values of some variables. When I finish coding, I would like to remove the print statements in a quicker way than manually selecting and deleting one by one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2015-03-19T17:24:53.103" Title="How can one quickly remove ancillary snippets of code?" Tags="|python|programming|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10141" PostTypeId="1" AcceptedAnswerId="17292" CreationDate="2015-03-19T15:59:29.477" Score="5" ViewCount="164" Body="&lt;p&gt;I am jealous about a SublimeText plugin:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/I9E32.png&quot; alt=&quot;get github issue interactively&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This plugin finds the github issues when you are in a commit message and you type a dash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't find an equivalent for Emacs so I decided that was a good exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the pieces in about an hour but I've got difficulties finishing it, so I thought I might as well ask for help :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I can do:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;find the github issues, with &lt;a href=&quot;https://github.com/inkel/github-issues.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/inkel/github-issues.el&lt;/a&gt; which isn't in melpa&lt;/li&gt;&#xA;&lt;li&gt;fire helm&lt;/li&gt;&#xA;&lt;li&gt;fire helm when one types &quot;Fixes #&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But I have to deal with some corner cases (repository not found, there is no issues, the github api rate limit is reached), I want to isolate the functions that call github but then my helm source doesn't work any more (this is the actual bug that I left for you). Also, how to define the helm source so that it doesn't call github when evaluating the whole buffer ? see &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(helm :sources '(issues-helm-source))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I'd enjoy very much to have reviews by experienced elisp developers. Thanks !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gitlab.com/emacs-stuff/git-commit-insert-issue&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gitlab.com/emacs-stuff/git-commit-insert-issue&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="739" LastEditDate="2015-10-11T03:59:49.247" LastActivityDate="2017-03-15T10:16:38.910" Title="In a commit message, interactively get the github issue on &quot;Fixes #&quot;" Tags="|helm|completion|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10142" PostTypeId="1" CreationDate="2015-03-19T16:07:26.970" Score="0" ViewCount="330" Body="&lt;p&gt;I use a pretty basic notes file that has headers like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Next Actions&#xA;** action 1&#xA;** action 2&#xA;* Deferred&#xA;** deferred 1&#xA;** deferred 2&#xA;etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I rarely use tags or todo states on the elements of my lists. So far I've only come across ways to create custom Agenda views by filtering the tags or todo states; I haven't found any info on filtering through headers instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible or is it not built-in into org-mode? I'm quite comfortable in lisp as I do all my coding (hobbyist) in Common Lisp but I'm not that familiar with eLisp.&lt;/p&gt;&#xA;" OwnerUserId="6818" LastActivityDate="2015-03-19T16:07:26.970" Title="Custom Agenda View based on headers?" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10143" PostTypeId="2" ParentId="10138" CreationDate="2015-03-19T16:35:43.267" Score="1" Body="&lt;p&gt;See this question and answer, you can do this same thing when opening a log file with ansi colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/3072648/cucumbers-ansi-colors-messing-up-emacs-compilation-buffer&quot;&gt;https://stackoverflow.com/questions/3072648/cucumbers-ansi-colors-messing-up-emacs-compilation-buffer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is a running log, I would suggest just opening a shell buffer and &lt;code&gt;tail -f&lt;/code&gt;ing the file which will handle colors.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-03-19T16:35:43.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10144" PostTypeId="2" ParentId="10140" CreationDate="2015-03-19T17:24:53.103" Score="3" Body="&lt;p&gt;Mark the region where your print statements are and perform this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;kbd&gt;flush-lines&lt;/kbd&gt; &lt;code&gt;^ *print.*&lt;/code&gt; &lt;kbd&gt;enter&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which will delete all the lines in your region that match a line that has zero or more spaces followed by the word print, followed by anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can wrap this up in a function if you'd like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-print-lines (beg end)&#xA;  &quot;Delete all lines in the selected region that start with the word print.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (flush-lines &quot;^ *print.*&quot; beg end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I usually do this using &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;multiple-cursors&lt;/a&gt; by selecting the give languages print function and using &lt;code&gt;mc/mark-next-like-this&lt;/code&gt; to select a bunch of them and deleting each line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar to what Kaushalmodi was describing, if you are using git, and magit, you can leave them in and individually revert each printing line from your changes from the status buffer, or even by using &lt;code&gt;ediff&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are really countless ways to do this, you just need to find the one that fits you.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-03-19T17:24:53.103" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10145" PostTypeId="2" ParentId="10134" CreationDate="2015-03-19T17:25:50.737" Score="4" Body="&lt;p&gt;It looks like a bug in &lt;code&gt;cperl-mode&lt;/code&gt;. It is defined using &lt;code&gt;define-derived-mode&lt;/code&gt;, a special form that defines a mode. When using it, it generates code to call the mode hook. However, the body of also contain an explicit call to the hooks, so it will be called twice.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-03-19T17:25:50.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10146" PostTypeId="1" AcceptedAnswerId="10157" CreationDate="2015-03-19T17:36:05.437" Score="0" ViewCount="1002" Body="&lt;p&gt;When I try to open a zip file in emacs I just see the binary file instead of a listing of the files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the following backgrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range 36585 36589)&#xA;  archive-zip-summarize()&#xA;  archive-summarize(nil)&#xA;  archive-mode()&#xA;  set-auto-mode-0(archive-mode nil)&#xA;  set-auto-mode()&#xA;  normal-mode(t)&#xA;  after-find-file(nil t)&#xA;  find-file-noselect-1(#&amp;lt;buffer cmyk.zip&amp;gt; &quot;~/Downloads/cmyk.zip&quot; nil nil &quot;~/Downloads/cmyk.zip&quot; (9179932 64513))&#xA;  find-file-noselect(&quot;/home/thayne/Downloads/cmyk.zip&quot; nil nil nil)&#xA;  find-file(&quot;/home/thayne/Downloads/cmyk.zip&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The numbers in args-out-of-range change depending on the zip file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have googled around and can't find anything that works. This happens for EVERY zip file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using emacs 24.3.1, I can get a listing when I use &lt;code&gt;emacs -q&lt;/code&gt;, so I guess it is something in my configuration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Prelude with a number of plugins installed, I'm not sure how to narrow down on what plugin and/or configuration is causing the problem though.&lt;/p&gt;&#xA;" OwnerUserId="6817" LastEditorUserId="6817" LastEditDate="2015-03-19T22:48:04.097" LastActivityDate="2015-05-19T01:24:02.227" Title="Can't open zip files in emacs" Tags="|archive-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10147" PostTypeId="1" AcceptedAnswerId="10149" CreationDate="2015-03-19T17:54:14.617" Score="2" ViewCount="732" Body="&lt;p&gt;The &lt;code&gt;verilog-mode&lt;/code&gt; package contains this code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-skeleton verilog-sk-header-tmpl&#xA;  &quot;Insert a comment block containing the module title, author, etc.&quot;&#xA;  &quot;[Description]: &quot;&#xA;  &quot;//                              -*- Mode: Verilog -*-&quot;&#xA;  &quot;\n// Filename        : &quot; (buffer-name)&#xA;  &quot;\n// Description     : &quot; str&#xA;  &quot;\n// Author          : &quot; (user-full-name)&#xA;  &quot;\n// Created On      : &quot; (current-time-string)&#xA;  &quot;\n// Last Modified By: .&quot;&#xA;  &quot;\n// Last Modified On: .&quot;&#xA;  &quot;\n// Update Count    : 0&quot;&#xA;  &quot;\n// Status          : Unknown, Use with caution!&quot;&#xA;  &quot;\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the cleanest and best way to redefine it in my .emacs init file ?&lt;/p&gt;&#xA;" OwnerUserId="6819" LastEditorUserId="115" LastEditDate="2015-03-19T19:00:32.877" LastActivityDate="2015-03-19T19:07:14.610" Title="Redefine verilog-mode header skeleton" Tags="|skeleton|verilog|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10148" PostTypeId="1" CreationDate="2015-03-19T18:43:25.130" Score="1" ViewCount="76" Body="&lt;p&gt;I want to include org-mode files into the default diary file of calendar mode, but there is a problem: the * symbol is used to match unspecific day. for example, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** 2nd heading&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the ~/diary file would generate &quot;2nd heading&quot; to appear each day. Is it possible to change how the calendar/diary mode mark unspecific day? like change * to % ?&lt;/p&gt;&#xA;" OwnerUserId="6820" LastEditorUserId="25" LastEditDate="2015-03-19T22:08:04.400" LastActivityDate="2015-03-19T22:08:04.400" Title="Conflict on the meaning of * when including Org mode files in a calendar diary" Tags="|org-mode|calendar|diary|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10149" PostTypeId="2" ParentId="10147" CreationDate="2015-03-19T19:07:14.610" Score="1" Body="&lt;p&gt;From the &lt;a href=&quot;http://www.veripool.org/ftp/verilog-mode.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;verilog-mode.el&lt;/code&gt;&lt;/a&gt; source, the &lt;code&gt;verilog-sk-header-tmpl&lt;/code&gt; is used only in two places:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Where the skeleton is defined&lt;/li&gt;&#xA;&lt;li&gt;Where the skeleton is used in a &lt;code&gt;verilog-sk-header&lt;/code&gt; function&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So all you need to do is define your own skeleton using &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-skeleton my/verilog-sk-header-tmpl&#xA;&quot;Insert a comment block containing the module title, author, etc.&quot;&#xA;  ;; !!INSERT YOUR CUSTOM TEMPLATE DEFINITION HERE!!&#xA;  &quot;\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and re-define &lt;code&gt;verilog-sk-header&lt;/code&gt; function to use that instead of the default skeleton:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun verilog-sk-header ()&#xA;  &quot;Insert a descriptive header at the top of the file.&#xA;See also `verilog-header' for an alternative format.&quot;&#xA;  (interactive &quot;*&quot;)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (my/verilog-sk-header-tmpl)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you are re-defining the function, now on calling this function using the keyboard shortcut (&lt;code&gt;C-c C-t h&lt;/code&gt;) or from the menu bar will insert your custom header skeleton.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-03-19T19:07:14.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10150" PostTypeId="1" AcceptedAnswerId="10151" CreationDate="2015-03-19T19:21:38.687" Score="5" ViewCount="882" Body="&lt;p&gt;I have some add-hook functions in my .emacs similar to below,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Send a notification when a pomodoro is completed:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-pomodoro-finished-hook&#xA;  (lambda ()&#xA;      (message &quot;Pomodoro finished&quot;)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I sometimes change something in these lambda functions that ran from the hook and often reload the whole .emacs (as oppose to a certain region etc..). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result, when pomodoro finishes, I get two notifications. It looks like add-hook adds two functions to the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a high level p.o.v, what's the best way of dealing with this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT/SOLUTION]&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As pointed out in the answer, the &lt;code&gt;add-hook&lt;/code&gt; only adds the function once if the function is identical to the previous definition. The thing is that changing the function no longer makes it identical and thus you get duplication in the hook list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e, Re-evaluating this does not produce multiple 'MEH' messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-pomodoro-finished-hook&#xA;  (lambda ()&#xA;      (message &quot;MEH&quot;)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I change &quot;MEH&quot; to something else (like &quot;BLEH&quot;), then I'll be seeing two messages (MEH and BLEH).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is to point add-hook to functions and change the functions instead of changing the hooks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example below, &quot;Meh&quot; can be changed to &quot;Bleh&quot;, the .emacs can be re-loaded and only &quot;Bleh&quot; will be displayed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/message ()&#xA;  (message &quot;Meh&quot;)&#xA;)&#xA;&#xA;(add-hook 'org-pomodoro-finished-hook 'my/message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="105" LastEditDate="2015-07-11T04:34:00.603" LastActivityDate="2015-07-11T04:34:00.603" Title="How to deal with 'add-hook' in .emacs when it's reloaded more than once?" Tags="|elisp|hooks|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10151" PostTypeId="2" ParentId="10150" CreationDate="2015-03-19T19:27:53.863" Score="6" Body="&lt;p&gt;No, &lt;code&gt;add-hook&lt;/code&gt; only adds an entry if it does not already exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to confirm this in the &lt;code&gt;*scratch*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-pomodoro-finished-hook&#xA;  (lambda ()&#xA;      (notification-send &quot;Pomodoro finished&quot;)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Type &lt;kbd&gt;C-j&lt;/kbd&gt; after the final paren. Emacs will evaluate the expression, and return the resulting list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now evaluate it again. And again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And to confirm the return value, evaluate just &lt;code&gt;org-pomodoro-finished-hook&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-03-19T19:27:53.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10152" PostTypeId="1" CreationDate="2015-03-19T20:08:01.283" Score="7" ViewCount="1525" Body="&lt;p&gt;I have virtual environment set on my system (actually &lt;a href=&quot;https://virtualenvwrapper.readthedocs.org/en/latest/&quot; rel=&quot;noreferrer&quot;&gt;virtualenvwrapper&lt;/a&gt;). I would like to direct org babel to use a specific environment in a single code block or on the whole buffer. How can I do it?&lt;/p&gt;&#xA;" OwnerUserId="861" LastActivityDate="2016-06-10T12:21:11.623" Title="How to allow org-babel to play with python virtual environment?" Tags="|org-mode|python|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10153" PostTypeId="1" AcceptedAnswerId="10471" CreationDate="2015-03-19T20:35:12.550" Score="2" ViewCount="790" Body="&lt;p&gt;When I want to push to a different upstream than origin, I use &lt;kbd&gt;P C-u C-u P&lt;/kbd&gt; so I can set the upstream of the command, however magit always prompts me with question to set upstream also. How do I prevent that prompt? &lt;/p&gt;&#xA;" OwnerUserId="2395" LastEditorUserId="306" LastEditDate="2015-04-02T15:43:22.660" LastActivityDate="2015-12-30T23:17:49.697" Title="How do I prevent magit from asking to set upstream while pushing?" Tags="|magit|" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10154" PostTypeId="2" ParentId="10153" CreationDate="2015-03-19T22:12:22.000" Score="1" Body="&lt;p&gt;This wouldn't fit in the comment. Make sure you have in your &lt;code&gt;.git/config&lt;/code&gt; file something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[push]&#xA;    default = tracking&#xA;[remote &quot;github&quot;]&#xA;    url = https://github.com/path-to-repostiry.git&#xA;    fetch = +refs/heads/*:refs/remotes/github/*&#xA;[branch &quot;master&quot;]&#xA;    remote = github&#xA;    merge = refs/heads/master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In particular that you have the &lt;code&gt;[branch &quot;branch-name&quot;]&lt;/code&gt;. Without this part Magit will always ask for the branch to push to, no matter what your push policy is or what other Magit settings you use (not sure why though).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will also see that in the Magit status buffer, in the description part you will see the &lt;code&gt;Local:&lt;/code&gt; line.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-03-19T22:12:22.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10155" PostTypeId="1" CreationDate="2015-03-20T00:07:01.583" Score="3" ViewCount="426" Body="&lt;p&gt;I want a single .emacs but one that branches depending on whether &lt;code&gt;-nw&lt;/code&gt; was in the argument list. (open in terminal [no window mode])&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e, in gui mode I'd like all my usual features. In terminal I want it to load only the bare necessities for fast loading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at the &lt;code&gt;command-line-args&lt;/code&gt; variable, but that var doesn't have flags. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternativley I've been considering not loading my regular init and load a custom terminal instead:&lt;br&gt;&#xA;&lt;code&gt;emacs -q -l &quot;terminal_Config.el&quot;&lt;/code&gt;&lt;br&gt;&#xA;But if possible, I'd prefer to be able to tell if &lt;code&gt;-nw&lt;/code&gt; was specified.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-03-20T00:22:25.820" Title="How to tell if -nw (no window) is in args?" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10156" PostTypeId="2" ParentId="10155" CreationDate="2015-03-20T00:16:19.367" Score="6" Body="&lt;p&gt;Check the variable &lt;code&gt;window-system&lt;/code&gt; or the function &lt;code&gt;display-graphic-p&lt;/code&gt;.  Either will give you &lt;code&gt;nil&lt;/code&gt; if you run Emacs with &lt;code&gt;-nw&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;window-system&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;window-system is a variable defined in `C source code'.&#xA;  Its value is x&#xA;  It is a terminal-local variable; global value is the same.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Name of window system through which the selected frame is displayed.&#xA;  The value is a symbol:&#xA;   nil for a termcap frame (a character-only terminal),&#xA;   'x' for an Emacs frame that is really an X window,&#xA;   'w32' for an Emacs frame that is a window on MS-Windows display,&#xA;   'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,&#xA;   'pc' for a direct-write MS-DOS frame.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use of this variable as a boolean is deprecated.  Instead,&#xA;  use &lt;code&gt;display-graphic-p' or any of the other&lt;/code&gt;display-*-p'&#xA;  predicates which report frame's specific UI-related capabilities.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;display-graphic-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(display-graphic-p &amp;amp;optional DISPLAY)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return non-nil if DISPLAY is a graphic display.&#xA;  Graphical displays are those which are capable of displaying several&#xA;  frames and several different fonts at once.  This is true for displays&#xA;  that use a window system such as X, and false for text-only terminals.&#xA;  DISPLAY can be a display name, a frame, or nil (meaning the selected&#xA;  frame's display).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-03-20T00:22:25.820" LastActivityDate="2015-03-20T00:22:25.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10157" PostTypeId="2" ParentId="10146" CreationDate="2015-03-20T00:31:47.413" Score="1" Body="&lt;p&gt;I figured it out.  I had the following line in my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq coding-system-for-read 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Deleting this line fixed it. I originally put this in because a website recommended doing this to make utf-8 the default coding system, however I later found a different way to do it, and the documentation for coding-system-for-read actually says not to set it globally. I feel like an idiot.&lt;/p&gt;&#xA;" OwnerUserId="6817" LastActivityDate="2015-03-20T00:31:47.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10158" PostTypeId="1" AcceptedAnswerId="10160" CreationDate="2015-03-20T01:18:53.213" Score="5" ViewCount="635" Body="&lt;p&gt;Does org-mode use some markup language? What is the language called? &#xA;I found that it is similar but different from Markdown. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2015-03-20T02:54:25.993" Title="Does org-mode use some markup language?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10159" PostTypeId="1" AcceptedAnswerId="10170" CreationDate="2015-03-20T01:20:06.700" Score="4" ViewCount="430" Body="&lt;p&gt;I have two time fields. My productivity and sleep. I would like to run a Coefficient-Determination &#xA;(As described here:&#xA;&lt;a href=&quot;http://www.r-tutor.com/elementary-statistics/simple-linear-regression/coefficient-determination&quot; rel=&quot;nofollow&quot;&gt;http://www.r-tutor.com/elementary-statistics/simple-linear-regression/coefficient-determination&lt;/a&gt; )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible in org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|Date | productivity | sleep|&#xA;|-----|--------------|------|&#xA;|[meh]| 4:00         | 8:00 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2016-04-22T08:24:28.450" Title="org-table, how to compute Coefficient of Determination between two time fields?" Tags="|org-mode|org-table|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10160" PostTypeId="2" ParentId="10158" CreationDate="2015-03-20T01:50:03.470" Score="9" Body="&lt;p&gt;Yes, it uses org-mode syntax. The syntax is documented in the &lt;a href=&quot;http://orgmode.org/manual/Markup.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; and in more technical detail &lt;a href=&quot;http://orgmode.org/worg/dev/org-syntax.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastEditorUserId="91" LastEditDate="2015-03-20T02:54:25.993" LastActivityDate="2015-03-20T02:54:25.993" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10163" PostTypeId="1" CreationDate="2015-03-20T04:47:46.917" Score="3" ViewCount="263" Body="&lt;p&gt;Emacs 24.4.1 - Gnus 5.13 - Ubuntu 14.0.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gnus is hanging on any POP email that's got an attachment greater than or equal to 1MB. It starts downloading, gets to ~950kb, and stalls. After many minutes, I cancel the operation. This hasn't always been an issue, but now it happens every time I get mail with large attachments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a beginner and I don't fully understand my own &lt;code&gt;.gnus.el&lt;/code&gt; file, which is cobbled together from various sources. The contents of that file are:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; My Gnus init file.&#xA;&#xA;(add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)&#xA;&#xA;;; setting expiry to two days&#xA;(setq gnus-agent-expire-days 2)&#xA;&#xA;;;init stuff&#xA;(setq gnus-select-method '(nntp &quot;news.gwene.org&quot;))&#xA;(add-to-list 'gnus-secondary-select-methods '(nnml &quot;&quot;))&#xA;(setq mail-sources '((pop :server &quot;mail.servers.com&quot; :user &quot;steven@emailaddress.com&quot;)))&#xA;&#xA;;; turning on topics by default&#xA;(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)&#xA;&#xA;;; email stuff I got from newsreader guy. it works!&#xA;(setq smtpmail-local-domain &quot;emailaddress.com&quot;)&#xA;(setq smtpmail-sendto-domain &quot;emailaddress.com&quot;)&#xA;(setq user-full-name &quot;Steven Arntson&quot;)&#xA;(setq user-mail-address (concat &quot;steven@&quot; smtpmail-local-domain))&#xA;(setq smtpmail-debug-info t) ; only to debug problems&#xA;&#xA;(setq message-send-mail-function 'smtpmail-send-it&#xA;      smtpmail-smtp-server &quot;mail.server.com&quot;&#xA;      smtpmail-default-smtp-server &quot;mail.server.com&quot;&#xA;      smtpmail-smtp-service 587                     ; TCP Port.&#xA;      smtpmail-starttls-credentials '((&quot;mail.server.com&quot; 587 nil nil))&#xA;      smtpmail-auth-credentials '((&quot;mail.server.com&quot; 587 &quot;steven@emailaddress.com&quot; nil)))&#xA;&#xA;;; getting sent mail into a single folder&#xA;(setq gnus-message-archive-group '(&quot;nnml:mail.sent&quot;) )&#xA;&#xA;;; DECLUTTERING FORWARDED MESSAGES&#xA;(setq message-forward-ignored-headers &quot;.*&quot;)&#xA;&#xA;;; to get gnus to use all of emacs generic message functions&#xA;(setq mail-user-agent 'gnus-user-agent)&#xA;&#xA;;; SPAM&#xA;&#xA;(setq nnmail-split-methods 'nnmail-split-fancy&#xA;      nnmail-split-fancy '(| (: kevin-spamassassin)&#xA;                         &quot;mail.misc&quot;))&#xA;&#xA;(defun kevin-spamassassin ()&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (widen)&#xA;      (if (eq 1 (call-process-region (point-min) (point-max)&#xA;                                     &quot;spamc&quot; nil nil nil &quot;-c&quot;))&#xA;          &quot;spam&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;killall USR2 emacs&lt;/code&gt; from the commandline generates this output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--beginning evaluation of function call form:&#xA;* (message &quot;Mail source %s failed: %s&quot; source cond)&#xA;nnmail-get-new-mail-1(nnml nnml-save-incremental-nov &quot;~/Mail/&quot; nil nil nil)&#xA;nnmail-get-new-mail(nnml nnml-save-incremental-nov &quot;~/Mail/&quot; nil)&#xA;nnml-request-scan(nil &quot;&quot;)&#xA;gnus-request-scan(nil (nnml &quot;&quot;))&#xA;gnus-read-active-file-1((nnml &quot;&quot;) nil)&#xA;gnus-read-active-for-groups((nnml &quot;&quot;) ((&quot;nnml:mail.sent&quot; 3 ((1 . 1239))   ((unexist)&#xA;(seen (1 . 1200)) (forward 298 855 995 1044) (reply 299 302 305 (307 . 308) (311 . 312) 359 473 496 1014)) &quot;nnml:&quot; ((visible . t))) (&quot;nnml:spam&quot; 3 ((1 . 2160)) ((unexist) (seen (1 . 675) (677 . 678) 680 (685 . 698) 700 (703 . 715) (725 . 754) (756 . 759) 763 (766 . 768) (771 . 780) 783 (792 . 825) (829 . 834) (852 . 858) 879 888 (890 . 891) (898 . 916) 925 (927 . 950) 962 (966 . 982) (987 . 990) 994 (997 . 1003) (1005 . 1025) (1027 . 1063) (1065 . 1071) (1073 . 1084) (1087 . 1092) 1100 1114 (1121 . 1129) (1133 . 1181) 1184 1186 (1198 . 1392) (1394 . 1479) (1481 . 1510) (1519 . 1809) (1818 . 2160))) &quot;nnml:&quot;) (&quot;nnml:mail.misc&quot; 3 ((1 . 7880)) ((unexist) (seen (1 . 10) (14 . 7880)) (forward 1488 1579 1766 1787 2021 2247 3245 3264 3623 3740 5121 6036 6073 6638 6683 6740 7562) (expire 7836 7850 7854 (7857 . 7861) (7863 . 7866) (7869 . 7871) (7873 . 7876) (7878 . 7879)) (reply 43 50 (54 . 55) 59 (94 . 97) (101 . 102) 104 106 108 (111 . 113) 115 117 121 131 133 (135 . 137) (141 . 142) (146 . 148) 151 154 (159 . 164) (167 . 169) (178 . 179) (183 . 185) 187 (204 . 207) 210 212 217 (219 . 221) 233 (235 . 237) 240 242 247 250 263 (267 . 268) 270 275 (282 . 283) 285 287 (292 . 295) (300 . 301) 303 305 307 (309 . 310) ...) (tick 3999 5364 6441 6769 6883 6893 6997 7497 7519 7699 7715 7779 7785 7795 7843 7862 7867 7877)) &quot;nnml:&quot; ((visible . t)))) nil)&#xA;gnus-get-unread-articles(nil nil)&#xA;gnus-setup-news(nil nil nil)&#xA;byte-code(&quot;\204 &amp;lt;&amp;lt;bunch of numbers redacted&amp;gt;&amp;gt;&#xA;[dont-connect did-connect gnus-startup-file gnus-current-startup-file gnus-slave gnus-use-dribble-file gnus-group-quit gnus-run-hooks gnus-startup-hook gnus-make-newsrc-file gnus-dribble-read-file gnus-setup-news nil gnus-setup-news-hook gnus-request-create-group &quot;queue&quot; (nndraft &quot;&quot;) gnus-start-draft-setup gnus-group-list-groups gnus-group-first-unread-group gnus-configure-windows group gnus-group-set-mode-line gnus-started-hook level gnus-agent] 4&#xA;  gnus-1(nil nil nil)&#xA;  gnus(nil)&#xA;  call-interactively(gnus record nil)&#xA;  command-execute(gnus record)&#xA;  helm-M-x(nil &quot;gnus&quot;)&#xA;  call-interactively(helm-M-x nil nil)&#xA;  command-execute(helm-M-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the cause of this problem?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-06-01T21:52:29.903" LastActivityDate="2015-06-01T21:52:29.903" Title="Why does gnus hang on downloading POP emails with large attachments?" Tags="|gnus|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10164" PostTypeId="1" AcceptedAnswerId="10210" CreationDate="2015-03-20T05:23:56.560" Score="1" ViewCount="592" Body="&lt;p&gt;I've installed the smartparens package, and features involving the normal pairs (parenthesis, brackets, curly braces, etc...) work fine; however, none of the features around tags (html tags for example) work for me. In particular, I can't get wrapping a selection in an html tag or auto-completing closing html tags to work in html-mode. Here's the relevant portion of my .emacs file, where I install the smartparens package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smartparens-config)&#xA;(smartparens-global-mode t)&#xA;(show-smartparens-global-mode t)&#xA;(setq sp-show-pair-delay 0)&#xA;&#xA;;; print offscreen matches in the echo buffer&#xA;(require 's)&#xA;;; show matching parens on steroids&#xA;(defadvice sp-show--pair-function&#xA;  (after sp-show--pair-function-offscreen activate)&#xA;  &quot;If the matching paren is offscreen, show the matching line in the&#xA;          echo area.&quot;&#xA;  (interactive)&#xA;  (let ((vis-buf (save-excursion&#xA;           (cons (progn (move-to-window-line 0) (point))&#xA;             (progn (move-to-window-line -1) (line-end-position)))))&#xA;    (matching-sexp (if (and (sp-get (sp-get-sexp nil) :beg)&#xA;                (= (point) (sp-get (sp-get-sexp nil) :beg)))&#xA;               (cons (sp-get (sp-get-sexp nil) :beg)&#xA;                 (sp-get (sp-get-sexp nil) :end))&#xA;             (if (and (sp-get (sp-get-sexp t) :end)&#xA;                  (= (point) (sp-get (sp-get-sexp t) :end)))&#xA;                 (cons (sp-get (sp-get-sexp t) :beg)&#xA;                   (sp-get (sp-get-sexp t) :end))&#xA;               nil))))&#xA;    (when matching-sexp&#xA;      (if (&amp;gt; (car vis-buf)&#xA;         (car matching-sexp))&#xA;      ;; opening delim is offscreen&#xA;      (message &quot;Matches %s&quot;&#xA;           (s-trim&#xA;            (save-excursion (goto-char (car matching-sexp))&#xA;                    (thing-at-point 'line))))&#xA;    (if (&amp;lt; (cdr vis-buf)&#xA;           (cdr matching-sexp))&#xA;        ;; closing delim is offscreen&#xA;        (message &quot;Matches %s&quot;&#xA;             (s-trim&#xA;              (save-excursion (goto-char (cdr matching-sexp))&#xA;                      (thing-at-point 'line)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The long second piece is a snippet from &lt;a href=&quot;https://github.com/Fuco1/smartparens/issues/346&quot; rel=&quot;nofollow&quot;&gt;this issue on github&lt;/a&gt;. I've been searching around awhile for a solution to this. Is there a key combination I need to use in order to start a 'tag' as opposed to a 'pair'? I'm using emacs 24.3, and I also have the packages linum-relative, autocomplete, auctex, and a couple others installed.&lt;/p&gt;&#xA;" OwnerUserId="6826" LastEditorUserId="6826" LastEditDate="2015-03-20T08:43:44.227" LastActivityDate="2015-03-21T19:59:52.920" Title="How to get html tag completion working with smartparens in emacs?" Tags="|smartparens|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10165" PostTypeId="1" AcceptedAnswerId="10178" CreationDate="2015-03-20T05:57:41.207" Score="6" ViewCount="1947" Body="&lt;p&gt;I'm trying to understand minor modes with the goal of adding a minor mode for Jinja2 syntax highlighting (from jinja2-mode) to stuff like YAML. I'm running into problems though. When following &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_syntax_coloring.html&quot; rel=&quot;noreferrer&quot;&gt;a tutorial&lt;/a&gt; on adding new syntax highlighting, I translate the &quot;simple&quot; example to a minor mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq kwds&#xA;      '((&quot;Sin\\|Cos\\|Sum&quot; . font-lock-function-name-face)&#xA;        (&quot;Pi\\|Infinity&quot; . font-lock-constant-face)))&#xA;&#xA;(define-minor-mode blah-mode&#xA;  :lighter &quot;blah&quot;&#xA;  (setq font-lock-defaults '(kwds)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and that doesn't work. Neither does the approach taken by the &lt;a href=&quot;https://github.com/paradoxxxzero/jinja2-mode/blob/master/jinja2-mode.el#L296-L316&quot; rel=&quot;noreferrer&quot;&gt;major mode in jinja2-mode&lt;/a&gt;. I'm at a bit of a loss here... is adding highlighting in a minor mode possible? It seems to be, but I can't find any examples online, and I don't see anything in the conventions for the minor modes about how to define this correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq kwds&#xA;      '((&quot;Sin\\|Cos\\|Sum&quot; . font-lock-function-name-face)&#xA;        (&quot;Pi\\|Infinity&quot; . font-lock-constant-face)))&#xA;&#xA;(define-minor-mode blah-mode&#xA;  :lighter &quot;blah&quot;&#xA;&#xA;  (font-lock-add-keywords nil kwds)&#xA;&#xA;  (if (fboundp 'font-lock-flush)&#xA;      (font-lock-flush)&#xA;    (when font-lock-mode&#xA;      (with-no-warnings (font-lock-fontify-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6827" LastEditorUserId="6827" LastEditDate="2015-03-20T13:50:08.537" LastActivityDate="2024-02-09T16:16:52.110" Title="Can I add highlighting in a minor mode?" Tags="|elisp|font-lock|minor-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10166" PostTypeId="1" CreationDate="2015-03-20T07:19:55.027" Score="1" ViewCount="305" Body="&lt;p&gt;I am using emacs with Anaconda's IPython console:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter (substitute-in-file-name &quot;$HOME/anaconda3/bin/ipython&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;IPython opens after C-c C-p, but always with four empty input lines at the beginning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uXYRS.png&quot; alt=&quot;emacs and ipython&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when I send a command by selecting a region and C-c C-r (&lt;code&gt;print('words')&lt;/code&gt;) in this case, again four empty lines show up and then the result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/I26uA.png&quot; alt=&quot;print words&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to fix this? I don't have any IPython related configuration apart from the line that I pasted at the top.&lt;/p&gt;&#xA;" OwnerUserId="2821" LastActivityDate="2015-03-20T07:19:55.027" Title="Emacs and IPython integration: multiple lines sent" Tags="|ipython|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10167" PostTypeId="1" AcceptedAnswerId="10185" CreationDate="2015-03-20T08:25:10.533" Score="9" ViewCount="3814" Body="&lt;p&gt;Let's say we are working with Python (or Matlab) with company.&#xA;Without an inferior process company messages that &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Completion needs an inferior Python process running&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the obvious solution to automatically run an inferior process&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'python-mode 'run-python)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would run a new python process every time I open a .py file (this becomes more expensive with Matlab) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a hook that gets run only the first time a major mode is run ? &#xA;Or is there a way to detect if a python/matlab inferior process is already running ? &#xA;Or is there another way to solve this problem of running an inferior process automatically with a major mode but only once ? &lt;/p&gt;&#xA;" OwnerUserId="6589" LastActivityDate="2016-07-18T18:06:39.053" Title="How to automatically run inferior process when loading major mode for the first time?" Tags="|python|company-mode|matlab|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10168" PostTypeId="1" AcceptedAnswerId="12446" CreationDate="2015-03-20T09:13:25.393" Score="6" ViewCount="4057" Body="&lt;p&gt;I am trying to use Tramp to log into a server that has no SSH keys, just a password. Unfortunately, upon execution of my &lt;code&gt;/ssh:root@111.111.111.111:~/&lt;/code&gt; command, there is no password prompt and the minibuffer says &lt;code&gt;Sending password&lt;/code&gt;, and fails to login. How can I get Tramp to prompt me for a password? Or, how can I configure Tramp to log into this server that has no SSH keys and just a password?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can SSH into the server via terminal just fine with &lt;code&gt;ssh root@111.111.111.111&lt;/code&gt;, where the password prompt is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;root@111.111.111.111's password:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unless I enter my password, there is no other output in the terminal. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is the output in my &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for root@111.111.111.111 using ssh...&#xA;Tramp: Sending command `exec ssh -l root  -e none 111.111.111.111'&#xA;&#xA;Tramp: Waiting for prompts from remote shell&#xA;Tramp: Sending password&#xA;Tramp: Sending command `exec ssh -l root  -e none 111.111.111.111'&#xA;Tramp: Opening connection for root@111.111.111.111 using ssh...done&#xA;Quit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and after setting a verbose output using &lt;code&gt;(setq tramp-verbose 10)&lt;/code&gt;, here is the output into my &lt;code&gt;*debug tramp/ssh root@111.111.111.111*&lt;/code&gt; buffer: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pastebin.com/UKJnzP66&quot; rel=&quot;noreferrer&quot;&gt;http://pastebin.com/UKJnzP66&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I get the same results when using &lt;code&gt;emacs -q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;M-x tramp-version&lt;/code&gt; is 2.2.6-24.3, running on Ubuntu 14.04.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated, or even a description of the logs. I am confused because Tramp seems to be sending some kind of default password without prompting me, even when run with &lt;code&gt;emacs -q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried setting &lt;code&gt;tramp-password-prompt-regexp&lt;/code&gt; with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq&#xA;    tramp-password-prompt-regexp&#xA;      (concat&#xA;        &quot;^.*&quot;&#xA;        (regexp-opt&#xA;          '(&quot;passphrase&quot; &quot;Passphrase&quot;&#xA;            ;; English&#xA;            &quot;password&quot; &quot;Password&quot;&#xA;            ;; Deutsch&#xA;            &quot;passwort&quot; &quot;Passwort&quot;&#xA;            ;; Français&#xA;            &quot;mot de passe&quot; &quot;Mot de passe&quot;) t)&#xA;        &quot;.*:\0? *&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is &lt;code&gt;^.*\(Mot de passe\|Pass\(?:phrase\|wor[dt]\)\|mot de passe\|pass\(?:phrase\|wor[dt]\)\).*:^@&lt;/code&gt; when evaluated with &lt;code&gt;(message tramp-password-prompt-regexp)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and here is the updated output from &lt;code&gt;*debug tramp/ssh root@111.111.111.111*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(lines 1-44)&#xA;&lt;a href=&quot;http://pastebin.com/99w6LbyX&quot; rel=&quot;noreferrer&quot;&gt;http://pastebin.com/99w6LbyX&lt;/a&gt;&#xA;(lines 45-88)&#xA;&lt;a href=&quot;http://pastebin.com/2LrDYzNk&quot; rel=&quot;noreferrer&quot;&gt;http://pastebin.com/2LrDYzNk&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-03-21T01:38:09.053" LastActivityDate="2015-05-16T07:59:58.637" Title="Tramp: SSH login does not prompt for password" Tags="|tramp|passwords|" AnswerCount="2" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="10169" PostTypeId="2" ParentId="10165" CreationDate="2015-03-20T09:45:44.273" Score="4" Body="&lt;p&gt;The easiest way is to call &lt;code&gt;font-lock-add-keywords&lt;/code&gt; when the mode is started and &lt;code&gt;font-lock-remove-keywords&lt;/code&gt; when it's disabled. To ensure that the new keywords take effect you can call &lt;code&gt;font-lock-flush&lt;/code&gt; (in newer Emacs versions) or &lt;code&gt;font-lock-fontify-buffer&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (if (fboundp 'font-lock-flush)&#xA;      (font-lock-flush)&#xA;    (when font-lock-mode&#xA;      (with-no-warnings&#xA;        (font-lock-fontify-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One example of such mode is &lt;code&gt;cwarn&lt;/code&gt; (a mode that highlights assignment in expressions and semicolons after &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;for&lt;/code&gt; etc. in C-like languages), it is part of the Emacs distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other examples are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Lindydancer/lisp-extra-font-lock&quot; rel=&quot;nofollow&quot;&gt;lisp-extra-font-lock&lt;/a&gt; -- Highlight things like variable bindings and quoted expressions in lisp&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Lindydancer/preproc-font-lock&quot; rel=&quot;nofollow&quot;&gt;preproc-font-lock&lt;/a&gt; -- Highlight multi-line macro C definitions&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Lindydancer/objc-font-lock&quot; rel=&quot;nofollow&quot;&gt;objc-font-lock&lt;/a&gt; -- Highlight Objective-C function calls.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-03-20T09:45:44.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10170" PostTypeId="2" ParentId="10159" CreationDate="2015-03-20T10:55:31.460" Score="7" Body="&lt;p&gt;My previous answer was just too convoluted (and it didn't actually compute what OP wanted). It appears there's a much simpler way to do it:&lt;/p&gt;&#xA;&lt;h1&gt;This is actually the way to do it&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;| Date  | sleep | productivity | determination coefficient |&#xA;|-------+-------+--------------+---------------------------|&#xA;| [meh] |  7.50 |         4.00 |                           |&#xA;| [meh] |  8.00 |         5.00 |                           |&#xA;| [meh] |  8.50 |         6.00 |                           |&#xA;| [meh] |  8.00 |         4.00 |                           |&#xA;| [meh] |  8.20 |         5.00 |                           |&#xA;| [meh] |  8.70 |         6.00 |                           |&#xA;|-------+-------+--------------+---------------------------|&#xA;|       |       |              |                0.89847792 |&#xA;|       |       |              |                0.89847792 |&#xA;#+TBLFM: @9$4=vcorr(@2$2..@7$2, @2$3..@7$3)&#xA;#+TBLFM: @8$4=vpcov(@2$2..@7$2, @2$3..@7$3)/(vpsdev(@2$2..@7$2)*vpsdev(@2$3..@7$3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As suggested by the comments. Note that this gives you &lt;strong&gt;r&lt;/strong&gt;, whereas RUserPassingBy's results give &lt;strong&gt;r^2&lt;/strong&gt; (but, finally, both results are correct).&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-06-25T21:09:47.737" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10171" PostTypeId="1" AcceptedAnswerId="10172" CreationDate="2015-03-20T11:03:38.877" Score="4" ViewCount="763" Body="&lt;p&gt;I have many files in many directories all with the same filename pattern. I want to rename them by replacing a substring with another, e.g. &lt;code&gt;bla_A.mat&lt;/code&gt; to &lt;code&gt;bla_B.mat&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can do this quite easily in a directory using &lt;code&gt;wdired&lt;/code&gt; mode and &lt;code&gt;replace-string&lt;/code&gt;. How can I do that same operation recursively on all my directories?&lt;/p&gt;&#xA;" OwnerUserId="6780" LastActivityDate="2015-03-20T11:40:51.333" Title="Recursively rename files using wdired" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10172" PostTypeId="2" ParentId="10171" CreationDate="2015-03-20T11:40:51.333" Score="8" Body="&lt;p&gt;Here's one way to do this with &lt;code&gt;dired&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;find-name-dired&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; select the top-level directory where all such files exist, &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;bla-*.mat&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;t&lt;/kbd&gt; will mark all files in the buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;%R&lt;/kbd&gt; &lt;code&gt;\(.*\)_A\.mat&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;\1_B.mat&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;More on renaming files: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Transforming-File-Names.html#Transforming-File-Names&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Transforming-File-Names.html#Transforming-File-Names&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-03-20T11:40:51.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10173" PostTypeId="2" ParentId="9995" CreationDate="2015-03-20T11:46:37.773" Score="1" Body="&lt;p&gt;Using &lt;a href=&quot;https://github.com/bmag/emacs-purpose&quot; rel=&quot;nofollow&quot;&gt;Purpose&lt;/a&gt;, you can try the following. Note that I don't really know R, so you need to fill in the code for creating the &lt;code&gt;*R-main*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you open more than 2 files with the same name, then Emacs will start playing with their buffer names. To fix this, use a proper regexp in &lt;code&gt;bmag-R-purpose-conf&lt;/code&gt; (exact regexp depends the value of &lt;code&gt;uniquify-buffer-name-style&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; define purposes suitable for R projects&#xA;(defvar bmag-R-purpose-conf (purpose-conf&#xA;                 &quot;R-project&quot;&#xA;                 ;; R files are considered &quot;code&quot; buffers&#xA;                 :regexp-purposes '((&quot;\\.R$&quot; . code))&#xA;                 ;; the *R-main* buffer is considered a &quot;repl&quot;&#xA;                 ;; buffer.&#xA;                 ;; the project_log.org buffer is considered a&#xA;                 ;; &quot;log&quot; buffer&#xA;                 :name-purposes '((&quot;*R-main*&quot; . repl)&#xA;                          (&quot;project_log.org&quot; . log))))&#xA;&#xA;;; mysterious incantation - generated with `purpose-save-window-layout'&#xA;(defvar bmag-R-layout&#xA;  '(t&#xA;    (0 0 92 36)&#xA;    (nil&#xA;     (0 0 92 18)&#xA;     ;; top-left window is dedicated to &quot;code&quot; buffers (R files)&#xA;     (:purpose code :purpose-dedicated t :width 0.5 :height 0.5 :edges&#xA;           (0.0 0.0 0.5 0.5))&#xA;     ;; top-right window is dedicated to &quot;repl&quot; buffers (*R-main*)&#xA;     (:purpose repl :purpose-dedicated t :width 0.5 :height 0.5 :edges&#xA;           (0.5 0.0 1.0 0.5)))&#xA;    (nil&#xA;     (0 18 92 36)&#xA;     ;; bottom-left window is not dedicated, but will initialy show a &quot;log&quot;&#xA;     ;; buffer (project_log.org)&#xA;     (:purpose log :purpose-dedicated nil :width 0.5 :height 0.5 :edges&#xA;           (0.0 0.5 0.5 1.0))&#xA;     ;; bottom-right window is not dedicated, but will initialy show a dired&#xA;     ;; buffer&#xA;     (:purpose dired :purpose-dedicated nil :width 0.5 :height 0.5 :edges&#xA;           (0.5 0.5 1.0 1.0)))))&#xA;&#xA;(defun bmag-project-root ()&#xA;  &quot;Get project's root directory.&quot;&#xA;  (expand-file-name (read-directory-name &quot;Project root directory: &quot; nil nil t)))&#xA;&#xA;(defun bmag-file-in-project (root name)&#xA;  (file-truename (concat root name)))&#xA;&#xA;(defun bmag-open-R-project ()&#xA;  (interactive)&#xA;  (let ((root (bmag-project-root)))&#xA;    (purpose-mode)&#xA;    ;; activate Purpose configuration for current project&#xA;    (purpose-set-extension-configuration :project bmag-R-purpose-conf)&#xA;    ;; make current frame display windows as specified in `bmag-R-layout'&#xA;    (purpose-set-window-layout bmag-R-layout)&#xA;    ;; open relevant buffers. Purpose takes care of displaying them in the correct windows&#xA;    (dired root)&#xA;    (find-file (bmag-file-in-project root &quot;/project_log.org&quot;))&#xA;    (find-file (bmag-file-in-project root &quot;/main.R&quot;))&#xA;    ;; --- insert code for creating *R-main* here ---&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can adapt this solution to other languages. For example, Python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar bmag-python-purpose-conf&#xA;  (purpose-conf &quot;python-project&quot;&#xA;        :mode-purposes '((python-mode . code)&#xA;                 (inferior-python-mode . repl))&#xA;        :name-purposes '((&quot;project_log.org&quot; . log))))&#xA;&#xA;;; note: `bmag-python-layout' is identical to `bmag-R-layout'&#xA;(defvar bmag-python-layout&#xA;  '(t&#xA;    (0 0 92 36)&#xA;    (nil&#xA;     (0 0 92 18)&#xA;     (:purpose code :purpose-dedicated t :width 0.5 :height 0.5 :edges&#xA;           (0.0 0.0 0.5 0.5))&#xA;     (:purpose repl :purpose-dedicated t :width 0.5 :height 0.5 :edges&#xA;           (0.5 0.0 1.0 0.5)))&#xA;    (nil&#xA;     (0 18 92 36)&#xA;     (:purpose log :purpose-dedicated nil :width 0.5 :height 0.5 :edges&#xA;           (0.0 0.5 0.5 1.0))&#xA;     (:purpose dired :purpose-dedicated nil :width 0.5 :height 0.5 :edges&#xA;           (0.5 0.5 1.0 1.0)))))&#xA;&#xA;(defun bmag-open-python-project ()&#xA;  (interactive)&#xA;  (let ((root (bmag-project-root)))&#xA;    (purpose-mode)&#xA;    (purpose-set-extension-configuration :project bmag-python-purpose-conf)&#xA;    (purpose-set-window-layout bmag-python-layout)&#xA;    (dired root)&#xA;    (find-file (bmag-file-in-project root &quot;/project_log.org&quot;))&#xA;    (find-file (bmag-file-in-project root &quot;/main.py&quot;))&#xA;    (python-shell-switch-to-shell)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt; (or an equivalent package), you could use it to get the project's root directory automatically.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-03-20T11:46:37.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10174" PostTypeId="1" AcceptedAnswerId="10197" CreationDate="2015-03-20T11:57:02.830" Score="10" ViewCount="852" Body="&lt;p&gt;I have a propertized string. I want to make a deep copy of it to add more properties, while&#xA;preserving the properties in the original string. How can I do that (easily)?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Evaluate one-by-one :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq test-str-1&#xA;      #(&quot;;; This `is' a test&quot;&#xA;        0 3 (fontified nil face font-lock-comment-delimiter-face)&#xA;        3 9 (fontified nil face font-lock-comment-face)&#xA;        9 11 (fontified nil face (font-lock-constant-face font-lock-comment-face))&#xA;        11 19 (fontified nil face font-lock-comment-face)))&#xA;(setq test-str-2 (concat test-str-1))&#xA;(add-face-text-property 0 (length test-str-2) 'foobar t test-str-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the result:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;test-str-2&#xA;;; =&amp;gt;&#xA;#(&quot;;; This `is' a test&quot; 0 3 (fontified nil face (font-lock-comment-delimiter-face foobar))&#xA;  3 9 (fontified nil face (font-lock-comment-face foobar))&#xA;  9 11 (fontified nil face (font-lock-constant-face font-lock-comment-face foobar))&#xA;  11 19 (fontified nil face (font-lock-comment-face foobar)))&#xA;test-str-1&#xA;;; =&amp;gt;&#xA;#(&quot;;; This `is' a test&quot; 0 3 (face font-lock-comment-delimiter-face fontified nil)&#xA;  3 9 (face font-lock-comment-face fontified nil)&#xA;  9 11 (face (font-lock-constant-face font-lock-comment-face foobar) ; &amp;lt;= foobar is here&#xA;        fontified nil)&#xA;  11 19 (face font-lock-comment-face fontified nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-03-20T12:06:13.830" LastActivityDate="2015-03-21T13:54:32.073" Title="Deep copy a string in Elisp?" Tags="|elisp|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10175" PostTypeId="2" ParentId="10174" CreationDate="2015-03-20T12:02:31.960" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;(concat the-original-string)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((s &quot;TEXT&quot;))&#xA;  (set-text-properties 2 3 '(:foreground &quot;blue&quot;) s)&#xA;  (let ((q (concat s)))&#xA;    (add-text-properties 2 3 '(:background &quot;red&quot;) q)&#xA;    (cons s q)))&#xA;;; Returns:&#xA;(#(&quot;TEXT&quot; 2 3 (:foreground &quot;blue&quot;)) . #(&quot;TEXT&quot; 2 3 (:foreground &quot;blue&quot; :background &quot;red&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-03-20T12:09:37.073" LastActivityDate="2015-03-20T12:09:37.073" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10176" PostTypeId="1" AcceptedAnswerId="10179" CreationDate="2015-03-20T13:36:54.840" Score="8" ViewCount="1031" Body="&lt;p&gt;In the org-mode documentation &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot;&gt;regarding export settings&lt;/a&gt;, it describes &lt;code&gt;arch&lt;/code&gt; as follows.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Configure export of archived trees. Can be set to &lt;strong&gt;headline&lt;/strong&gt; to only process the headline, skipping its contents (org-export-with-archived-trees). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's almost what I want, but it skips &lt;em&gt;all&lt;/em&gt; the contents, including the subheadings. I want those subheadings too (without their contents). Take this example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: arch:headline&#xA;&#xA;* I want to see this :ARCHIVE:&#xA;But not this.&#xA;** and also this.&#xA;And definitely not this.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I export this file, &lt;code&gt;I want to see this&lt;/code&gt; is the only thing that comes through. But I was expecting/hoping &lt;code&gt;and also this&lt;/code&gt; to be exported underneath it as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make that happen? I tried adding an extra &lt;code&gt;:ARCHIVE:&lt;/code&gt; tag to the second level heading, but that does nothing.&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2015-03-20T13:52:15.840" LastActivityDate="2015-03-20T14:44:11.353" Title="How to export headlines, including subheadings, without other contents in org-mode?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10177" PostTypeId="1" CreationDate="2015-03-20T14:19:33.700" Score="2" ViewCount="1587" Body="&lt;p&gt;Using PuTTY to connect to Linux from Windows and running Emacs: How do I bind &lt;code&gt;CTRL-&amp;lt;home&amp;gt;&lt;/code&gt; and &lt;code&gt;CTRL-&amp;lt;end&amp;gt;&lt;/code&gt; to beginning-of-buffer and end-of-buffer respectively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been searching the web for a while on this one. I've seen various suggestions but none of them seem to work. I understand that PuTTY can be configured to send different character codes for the HOME and END keys based on a setting and I can see what those codes are in the bash shell (via &lt;code&gt;C-v&lt;/code&gt; ) and in Emacs (via &lt;code&gt;C-q&lt;/code&gt;). I've read that I might need to &quot;bind&quot; those codes someone in my .bash_profile file and/or I then might need map those codes via a keymap in my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately I want to be able to add something like this to my .emacs file ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-&amp;lt;home&amp;gt;&quot;) 'beginning-of-buffer)&#xA;(global-set-key (kbd &quot;C-&amp;lt;end&amp;gt;&quot;) 'end-of-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... and make &lt;code&gt;CTRL-&amp;lt;home&amp;gt;&lt;/code&gt; and &lt;code&gt;CTRL-&amp;lt;end&amp;gt;&lt;/code&gt; behave as they do in most native Windows text editors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anybody been able to make this work? Please share your wisdom.&lt;/p&gt;&#xA;" OwnerUserId="6829" LastEditorUserId="50" LastEditDate="2015-03-25T13:08:07.720" LastActivityDate="2023-06-13T04:43:20.103" Title="How to bind CTRL-&lt;home&gt; and CTRL-&lt;end&gt; to beginning/end-of-buffer in Emacs?" Tags="|microsoft-windows|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10178" PostTypeId="2" ParentId="10165" CreationDate="2015-03-20T14:25:00.653" Score="5" Body="&lt;p&gt;You've got the arguments to &lt;code&gt;define-minor-mode&lt;/code&gt; wrong. The following adds a doc string and supplies the three optional arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode blah-mode&#xA;  &quot;Doc string.&quot;&#xA;  nil &quot;blah&quot; nil&#xA;  (font-lock-add-keywords nil kwds)&#xA;&#xA;  (if (fboundp 'font-lock-flush)&#xA;      (font-lock-flush)&#xA;    (when font-lock-mode&#xA;      (with-no-warnings (font-lock-fontify-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, you will will need to ensure that your keywords are removed when you disable the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing, your regexp:s will patch, say, Pi inside works like PaPiPo. Use &lt;code&gt;&quot;\\_&amp;lt;\\(Pi\\|Infinity\\)\\_&amp;gt;&quot;&lt;/code&gt; to fix this.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2016-12-10T07:20:30.983" LastActivityDate="2016-12-10T07:20:30.983" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10179" PostTypeId="2" ParentId="10176" CreationDate="2015-03-20T14:33:37.920" Score="3" Body="&lt;p&gt;You're right, the code that I posted &lt;a href=&quot;https://emacs.stackexchange.com/q/9492/504&quot;&gt;over there&lt;/a&gt; can be modified to achieve the behavior you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-remove-contents (backend)&#xA;  &quot;Remove contents of headlines with :ARCHIVE: tag.&quot;&#xA;  (org-map-entries (lambda () &#xA;                     (forward-line)&#xA;                     (let ((beg (point)))&#xA;                       (outline-next-visible-heading 1)&#xA;                       (backward-char)&#xA;                       (delete-region beg (point))))&#xA;                   &quot;ARCHIVE&quot; tree))&#xA;&#xA;(add-hook 'org-export-before-processing-hook #'org-remove-contents)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you'll need to set &lt;code&gt;arch&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in your per-file &lt;code&gt;#+OPTIONS&lt;/code&gt; for this to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: arch:t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-03-20T14:44:11.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10180" PostTypeId="2" ParentId="10177" CreationDate="2015-03-20T14:38:19.537" Score="1" Body="&lt;p&gt;Although this question being about Putty makes the actual issue off topic, the question is applicable (since troubleshooting is required to identify the cause).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a possible solution with Putty:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;set PuTTY &gt; Terminal &gt; Features &gt; Disable Application cursor keys mode to checked&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source &lt;a href=&quot;https://serverfault.com/questions/130128/using-ctrl-arrow-keys-with-putty-and-screen&quot;&gt;Using ctrl-arrow keys with putty and screen&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot guarantee that it will resolve all the issues but it appeared to be enough to allow CTRL+arrow to send the correct escape codes.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="-1" LastEditDate="2017-04-13T12:14:55.040" LastActivityDate="2015-03-20T14:38:19.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10181" PostTypeId="2" ParentId="10177" CreationDate="2015-03-20T14:41:29.603" Score="1" Body="&lt;p&gt;It turns out that this is a PuTTY issue as opposed to an Emacs issue, so I apologize for abusing the Emacs forum.  Since the frustration started with trying to configure Emacs though I'm guessing that others may run in to the issue too and so I'll post my own answer to hopefully provide those poor souls with some solace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that PuTTY does not send any keyboard codes for CTRL combinations with certain keys (including [home] and [end]).  So, when using PuTTY the CTRL-[home] that I enter on the keyboard doesn't even get to bash or Emacs and so there's no way to bind that to anything.  This is unfortunate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other terminal software may do this though.  I know now that my xterm (I'm using Cygwin with XFree86 from Windows) does.  So when using xterm, and launching character mode Emacs from there (emacs -nw), I can get the behavior I want.  I have also realized that I can get that behavior if I use an XServer and launch the X version Emacs from PuTTY (emacs) too.  So I don't have to completely abandon PuTTY.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, at least I learnt something today.  I hope this answer helps someone else one day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the relevant section of my .emacs file ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Notes:&#xA;;; * PuTTY doesn't send control characters for CTRL-&amp;lt;home&amp;gt; or CTRL-&amp;lt;end&amp;gt; so there's&#xA;;;   no way to make those key combinations work in character mode Emacs launched from&#xA;;;   a PuTTY terminal.  Character mode Emacs will work if launched from an xterm&#xA;;;   though and X mode Emacs launched from PuTTY will work too.&#xA;;; * Also, PuTTY mis-maps the &amp;lt;end&amp;gt; key to &amp;lt;select&amp;gt;&#xA;&#xA;;; Make CTRL-&amp;lt;home&amp;gt;/&amp;lt;end&amp;gt; work like in Windows.&#xA;;; X mode Emacs or character mode Emacs launched from xterm only.&#xA;(global-set-key (kbd &quot;C-&amp;lt;home&amp;gt;&quot;) 'beginning-of-buffer)&#xA;(global-set-key (kbd &quot;C-&amp;lt;end&amp;gt;&quot;) 'end-of-buffer)     ;; Works in X, not in PuTTY &#xA;(global-set-key (kbd &quot;C-&amp;lt;select&amp;gt;&quot;) 'end-of-buffer)  ;; For PuTTY&#xA;&#xA;;; Make &amp;lt;home&amp;gt;/&amp;lt;end&amp;gt; work like in Windows&#xA;(global-set-key (kbd &quot;&amp;lt;home&amp;gt;&quot;) 'beginning-of-line)&#xA;(global-set-key (kbd &quot;&amp;lt;end&amp;gt;&quot;) 'end-of-line)         ;; Works in X, not in PuTTY&#xA;(global-set-key (kbd &quot;&amp;lt;select&amp;gt;&quot;) 'end-of-line)      ;; For PuTTY&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6829" LastEditorUserId="6829" LastEditDate="2015-03-20T14:56:27.417" LastActivityDate="2015-03-20T14:56:27.417" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10182" PostTypeId="2" ParentId="10174" CreationDate="2015-03-20T14:49:41.170" Score="1" Body="&lt;p&gt;Found a (not very efficient) work-around:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq test-str-2&#xA;      (read (prin1-to-string test-str-1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-20T14:49:41.170" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10183" PostTypeId="1" AcceptedAnswerId="10187" CreationDate="2015-03-20T14:59:15.630" Score="7" ViewCount="1951" Body="&lt;p&gt;Projectile has a function to close all buffers related to a project (projectile-kill-buffers). Normally I also open non project related files during the day or emacs opens them when I'm stepping through compiler errors. Is there a way to close all buffers except project and special buffers?&lt;/p&gt;&#xA;" OwnerUserId="536" LastActivityDate="2015-03-20T19:55:54.860" Title="Close other buffers with projectile" Tags="|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10184" PostTypeId="2" ParentId="10121" CreationDate="2015-03-20T14:59:47.540" Score="1" Body="&lt;p&gt;I have the following in my init:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(my/work-properties '(&quot;hostname&quot; &quot;username&quot; &quot;location&quot;))&#xA;&#xA;(defmacro jlp/make-def (name props doc &amp;amp;rest body)&#xA;  &quot;Shortcut to programatically create new functions&quot;&#xA;  (let ((funsymbol (intern name)))&#xA;    `(defun ,funsymbol ,props ,doc ,@body)))&#xA;&#xA;(defun my/make-work-props (properties)&#xA;  &quot;Create functions to retrieve properties from Org headlines.&quot;&#xA;  (dolist (prop properties)&#xA;    (let ((funsym   (format &quot;my/org-get-%s&quot; prop))&#xA;          (property (intern (format &quot;:%s&quot; (upcase prop))))&#xA;          (doc      (format &quot;Retrieves `%s' from current headline&quot;&#xA;                            (upcase prop)))&#xA;          (err (format &quot;%s is not set&quot; (capitalize prop))))&#xA;      (eval&#xA;       `(jlp/make-def ,funsym&#xA;                      ()&#xA;                      ,doc&#xA;                      (interactive)&#xA;                      (let ((x (or&#xA;                                (save-excursion&#xA;                                  (org-back-to-heading)&#xA;                                  (org-element-property&#xA;                                   ,property&#xA;                                   (org-element-at-point)))&#xA;                                (user-error ,err))))&#xA;                        (message &quot;%s&quot; x)&#xA;                         (kill-new x)))))))&#xA;&#xA;(my/make-work-props my/org-work-properties)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is perhaps slightly more complex than needed (especially that extra eval) but it does allow me to generate the defuns I need for those properties (and include docstrings with the correct information in the strings).&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-03-20T14:59:47.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10185" PostTypeId="2" ParentId="10167" CreationDate="2015-03-20T15:10:50.213" Score="14" Body="&lt;p&gt;FYI, some modes open only one inferior processs. For example, &lt;code&gt;run-python&lt;/code&gt; will open an inferior process only if there isn't already an inferior process running. What you suggested with &lt;code&gt;run-python&lt;/code&gt; actually does what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other modes (Matlab?), you could use a function that unhooks itself, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun run-python-once ()&#xA;  (remove-hook 'python-mode-hook 'run-python-once)&#xA;  (run-python))&#xA;&#xA;(add-hook 'python-mode-hook 'run-python-once)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that on Emacs 24.5 (and older?), &lt;code&gt;run-python&lt;/code&gt; takes a mandatory &lt;code&gt;CMD&lt;/code&gt; argument, so the solution will be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun run-python-once ()&#xA;  (remove-hook 'python-mode-hook 'run-python-once)&#xA;  (run-python (python-shell-parse-command)))&#xA;&#xA;(add-hook 'python-mode-hook 'run-python-once)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6533" LastEditorUserId="6533" LastEditDate="2016-07-18T18:06:39.053" LastActivityDate="2016-07-18T18:06:39.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10187" PostTypeId="2" ParentId="10183" CreationDate="2015-03-20T19:55:54.860" Score="6" Body="&lt;p&gt;Save the below function to your emacs init and call it via &lt;code&gt;M-x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default this function will kill all buffers except the ones that belong to a &lt;code&gt;projectile&lt;/code&gt; project or are special.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same function will also kill special buffers (except *scratch* and *Messages*) if called with a prefix like &lt;code&gt;C-u&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/kill-non-project-buffers (&amp;amp;optional kill-special)&#xA;  &quot;Kill buffers that do not belong to a `projectile' project.&#xA;&#xA;With prefix argument (`C-u'), also kill the special buffers.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((bufs (buffer-list (selected-frame))))&#xA;    (dolist (buf bufs)&#xA;      (with-current-buffer buf&#xA;        (let ((buf-name (buffer-name buf)))&#xA;          (when (or (null (projectile-project-p))&#xA;                    (and kill-special&#xA;                         (string-match &quot;^\*&quot; buf-name)))&#xA;            ;; Preserve buffers with names starting with *scratch or *Messages&#xA;            (unless (string-match &quot;^\\*\\(\\scratch\\|Messages\\)&quot; buf-name)&#xA;              (message &quot;Killing buffer %s&quot; buf-name)&#xA;              (kill-buffer buf))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-03-20T19:55:54.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10188" PostTypeId="2" ParentId="9349" CreationDate="2015-03-20T22:08:30.790" Score="0" Body="&lt;p&gt;Take a look at &lt;code&gt;font-latex-user-keyword-classes&lt;/code&gt;, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq font-latex-user-keyword-classes&#xA;      '((&quot;quotes&quot; '(&quot;enquote&quot; &quot;*{&quot;) font-latex-string-face command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, as described in the info manual &lt;code&gt;(info &quot;(auctex) Fontification of macros&quot;)&lt;/code&gt;.  Note that changing this variable may require a restart of Emacs.  Also, I don't know what happens in case of multiple definitions, i.e. by this variable &lt;em&gt;and&lt;/em&gt; by your package.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-03-20T22:08:30.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10189" PostTypeId="1" AcceptedAnswerId="10190" CreationDate="2015-03-20T22:47:50.107" Score="0" ViewCount="118" Body="&lt;p&gt;Whenever I use browse-url function inside of w3m I would like to have&#xA;a default URL displayed for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It happens that what I mostly do is google searches, so if I could&#xA;have &lt;a href=&quot;https://google.com/search?q=&quot; rel=&quot;nofollow&quot;&gt;https://google.com/search?q=&lt;/a&gt; as default URL any time I use&#xA;browse-url it would save me a lot of typing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="684" LastActivityDate="2015-03-20T22:54:49.347" Title="browse-url default to certain url" Tags="|url|web-browser|w3m|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10190" PostTypeId="2" ParentId="10189" CreationDate="2015-03-20T22:54:49.347" Score="1" Body="&lt;p&gt;This is an example of what I have in my init file, just customize it a little bit and you're ready to go&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun duckduckgo (what)&#xA;  &quot;Use ddg to search for WHAT.&quot;&#xA;  (interactive &quot;sSearch: &quot;)&#xA;  (browse-url-firefox (concat &quot;https://duckduckgo.com/?t=lm&amp;amp;q=&quot;&#xA;                              (url-unhex-string what))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-03-20T22:54:49.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10191" PostTypeId="1" CreationDate="2015-03-20T23:10:13.677" Score="3" ViewCount="192" Body="&lt;p&gt;When pair programming with emacs I've found it is hard for the person who is not typing (&quot;driving&quot;) to follow scrolling.  I've seen this both as the &quot;passenger&quot; and the &quot;driver&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make motion within the file easier to follow for other people?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of the various smooth scrolling fixes, and I'm looking for some other visual indication here.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2015-03-21T22:38:14.213" LastActivityDate="2018-08-07T08:00:48.420" Title="Making scrolling easier to follow when pair programming" Tags="|scrolling|pairing|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="10192" PostTypeId="2" ParentId="10133" CreationDate="2015-03-20T23:21:15.633" Score="2" Body="&lt;p&gt;For file history, if you enable &lt;code&gt;ido-mode&lt;/code&gt; and customize &lt;code&gt;ido-use-virtual-buffers&lt;/code&gt; to t, even closed buffers remain in the ido history.  This persists across &lt;code&gt;desktop.el&lt;/code&gt; sessions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-k&lt;/code&gt; during an &lt;code&gt;ido-switch-buffer&lt;/code&gt; removes the selected buffer from the history, if you need to get it out of your way.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-03-20T23:21:15.633" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10193" PostTypeId="2" ParentId="10174" CreationDate="2015-03-21T00:15:14.837" Score="4" Body="&lt;p&gt;I found you can do this by iterating over the text properties, copying the underlying property data and overwriting the existing properties with new copies.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun deep-copy-text-properties (str)&#xA;  (with-temp-buffer&#xA;    (insert str)&#xA;    (goto-char 1)&#xA;    (while (not (eobp))&#xA;      (set-text-properties (point)&#xA;                           (goto-char (next-char-property-change (point) (point-max)))&#xA;                           ;; copy-tree is the important part&#xA;                           (copy-tree (text-properties-at (1- (point))))))&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my tests, this was about 20% faster than your &lt;code&gt;read&lt;/code&gt; solution. I also wrote a version that did not use a temp buffer and modified the properties of a string which was less code but was slower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the C code it copies the property plists, with copy_sequence which will rebuild the list structure but not copy the elements by value, so the properties like face in your example that have a list value are copied over by reference and modified. Bug or not, I don't know&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-03-21T13:54:32.073" LastActivityDate="2015-03-21T13:54:32.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10194" PostTypeId="1" AcceptedAnswerId="10198" CreationDate="2015-03-21T02:19:53.740" Score="4" ViewCount="322" Body="&lt;p&gt;Due to my lazy nature, I made something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro iλ (x)&#xA;  `(lambda () (interactive) ,x))&#xA;&#xA;(defmacro iλd (x y)&#xA;     `(lambda () ,x (interactive) ,y))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f8&amp;gt;&quot;) (iλ (message &quot;hello lambdas&quot;)))&#xA;(global-set-key (kbd &quot;&amp;lt;f7&amp;gt;&quot;) (iλd &quot;Func Docu&quot; (message &quot;hello lambda with docus&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Due to my lazy nature, I would like to merge these two but it's 10:16pm in the evening and I can't seem to figure it out. I would like something like this (Pseudo code follows):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defmacro iλ (x &amp;amp;optional y)   ;y is optional parameter:&#xA;  if x &amp;amp; y are defined:&#xA;  `(lambda () ,x (interactive) ,y))&#xA;  else if only x is defined:  &#xA;  `(lambda () (interactive) ,y)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can this be done, if so how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit solution]&lt;/strong&gt;&#xA;As per Malabarba's answer below, I now use the clever bit of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro iλ (x &amp;amp;rest y) &#xA;    (if (and (stringp x) y) &#xA;        `(lambda () ,x (interactive) ,@y) &#xA;      `(lambda () (interactive) ,x ,@y)))&#xA;;Example usage:&#xA;(global-set-key (kbd &quot;&amp;lt;f8&amp;gt;&quot;) (iλ &quot;A message that prints a hello&quot; (message &quot;hello 2&quot;)))&#xA;(global-set-key (kbd &quot;&amp;lt;f9&amp;gt;&quot;) (iλ  (message &quot;hello 1&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-03-26T21:55:15.537" LastActivityDate="2015-03-26T22:37:46.677" Title="Macro with optional paramaters that checks for whether an optional paramater is defined?" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10195" PostTypeId="1" CreationDate="2015-03-21T04:57:36.997" Score="0" ViewCount="710" Body="&lt;p&gt;I'm trying to configure other programs to emulate Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know Emacs' word delimiters are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;User configurable&lt;/li&gt;&#xA;&lt;li&gt;Mode dependent&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But I'd still like to know what the default word boundary characters are. &lt;em&gt;Because&lt;/em&gt; they are configurable and variable, I haven't found any lists. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love a list of the default word separators in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;. Of course, a description of how the delimiters vary by mode would be awesome too.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="253" LastEditDate="2015-05-18T23:49:22.343" LastActivityDate="2017-08-05T12:25:54.377" Title="Word delimiters in standard syntax table" Tags="|syntax-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10196" PostTypeId="2" ParentId="9512" CreationDate="2015-03-21T05:59:13.667" Score="1" Body="&lt;p&gt;Awesome @user3756658. The second option &lt;code&gt;(add-hook 'isearch-update-post-hook 'redraw-display)&lt;/code&gt; works for me. Text in the search buffer at the bottom still behaves weirdly, but this is an excellent workaround.&lt;/p&gt;&#xA;" OwnerUserId="6771" LastActivityDate="2015-03-21T05:59:13.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10197" PostTypeId="2" ParentId="10174" CreationDate="2015-03-21T08:24:03.843" Score="7" Body="&lt;p&gt;You can use the function &lt;code&gt;font-lock-append-text-property&lt;/code&gt; to add the text property. It does not modify the value destructively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq test-str-1&#xA;      #(&quot;;; This `is' a test&quot;&#xA;        0 3 (fontified nil face font-lock-comment-delimiter-face)&#xA;        3 9 (fontified nil face font-lock-comment-face)&#xA;        9 11 (fontified nil face (font-lock-constant-face font-lock-comment-face))&#xA;        11 19 (fontified nil face font-lock-comment-face)))&#xA;(setq test-str-2 (concat test-str-1))&#xA;(font-lock-append-text-property 0 (length test-str-2) 'face '(foobar t) test-str-2)&#xA;&#xA;&#xA;test-str-1&#xA;#(&quot;;; This `is' a test&quot;&#xA;  0 3 (face font-lock-comment-delimiter-face fontified nil)&#xA;  3 9 (face font-lock-comment-face fontified nil)&#xA;  9 11 (face (font-lock-constant-face font-lock-comment-face) fontified nil)&#xA;  11 19 (face font-lock-comment-face fontified nil))&#xA;&#xA;test-str-2&#xA;#(&quot;;; This `is' a test&quot;&#xA;  0 3 (fontified nil face (font-lock-comment-delimiter-face foobar t))&#xA;  3 9 (fontified nil face (font-lock-comment-face foobar t))&#xA;  9 11 (fontified nil face (font-lock-constant-face font-lock-comment-face foobar t))&#xA;  11 19 (fontified nil face (font-lock-comment-face foobar t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, in &lt;code&gt;test-str-1&lt;/code&gt;, has retained its original value.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-03-21T08:24:03.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10198" PostTypeId="2" ParentId="10194" CreationDate="2015-03-21T08:28:41.790" Score="6" Body="&lt;p&gt;Here's what you're trying to do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro iλ (x &amp;amp;optional y) &#xA;  (if (and (stringp x) y) &#xA;      `(lambda () ,x (interactive) ,y)) &#xA;    `(lambda () (interactive) ,x ,y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And, if you're taking suggestions, here's what I recommend. It should allow you to use any number of forms.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro iλ (x &amp;amp;rest y) &#xA;  (if (and (stringp x) y) &#xA;      `(lambda () ,x (interactive) ,@y)&#xA;    `(lambda () (interactive) ,x ,@y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @Stefan suggests, if you're on Emacs 25 you can do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro iλ (&amp;amp;rest body)&#xA;  (let ((x (macroexp-parse-body body)))&#xA;    `(lambda () ,@(car x) (interactive)&#xA;       ,@(cdr x))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-03-26T22:37:46.677" LastActivityDate="2015-03-26T22:37:46.677" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10199" PostTypeId="1" AcceptedAnswerId="10483" CreationDate="2015-03-21T08:42:29.500" Score="2" ViewCount="413" Body="&lt;p&gt;From indent.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun indent-relative (&amp;amp;optional unindented-ok)&#xA;  &quot;Space out to under next indent point in previous nonblank line.&#xA;An indent point is a non-whitespace character following whitespace.&#xA;The following line shows the indentation points in this line.&#xA;    ^         ^    ^     ^   ^           ^      ^  ^    ^&#xA;If the previous nonblank line has no indent points beyond the&#xA;column point starts at, `tab-to-tab-stop' is done instead, unless&#xA;this command is invoked with a numeric argument, in which case it&#xA;does nothing.&#xA;&#xA;See also `indent-relative-maybe'.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if (and abbrev-mode&#xA;       (eq (char-syntax (preceding-char)) ?w))&#xA;      (expand-abbrev))&#xA;  (let ((start-column (current-column))&#xA;    indent)&#xA;    (save-excursion&#xA;      (beginning-of-line)&#xA;      (if (re-search-backward &quot;^[^\n]&quot; nil t)&#xA;      (let ((end (save-excursion (forward-line 1) (point))))&#xA;        (move-to-column start-column)&#xA;        ;; Is start-column inside a tab on this line?&#xA;        (if (&amp;gt; (current-column) start-column)&#xA;        (backward-char 1))&#xA;        (or (looking-at &quot;[ \t]&quot;)&#xA;        unindented-ok&#xA;        (skip-chars-forward &quot;^ \t&quot; end))&#xA;        (skip-chars-forward &quot; \t&quot; end)&#xA;        (or (= (point) end) (setq indent (current-column))))))&#xA;    (if indent&#xA;    (let ((opoint (point-marker)))&#xA;      (delete-region (point) (progn (skip-chars-backward &quot; \t&quot;) (point)))&#xA;      (indent-to indent 0)&#xA;      (if (&amp;gt; opoint (point))&#xA;          (goto-char opoint))&#xA;      (move-marker opoint nil))&#xA;      (tab-to-tab-stop))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would I modify this function so that it aligns the current line with the indentation point in the &lt;strong&gt;next&lt;/strong&gt;, as opposed to the previous, line?&lt;/p&gt;&#xA;" OwnerUserId="6833" LastEditorUserId="6833" LastEditDate="2015-03-23T18:32:58.060" LastActivityDate="2015-04-03T04:41:30.330" Title="Hacking a &quot;line-below&quot; version of indent-relative" Tags="|elisp|indentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10200" PostTypeId="2" ParentId="10195" CreationDate="2015-03-21T11:37:07.637" Score="3" Body="&lt;p&gt;As far as I understand, in emacs -- word boundary is when next to a &quot;w&quot; syntax class stands char of some other class. This is in contrast to things like &lt;code&gt;sentence-end&lt;/code&gt; which is determined by matching a regexp (&lt;code&gt;sentence-end&lt;/code&gt; returns regexp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs lisp mode inherits &lt;code&gt;standard-syntax-table&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; from lisp-mode.el:&#xA;(defvar emacs-lisp-mode-syntax-table&#xA;  (let ((table (make-syntax-table))&#xA;  ..&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;make-syntax-table&lt;/code&gt; is default to &lt;code&gt;standard-syntax-table&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to browse &lt;code&gt;standard-syntax-table&lt;/code&gt; is to enter &lt;code&gt;fundamental-mode&lt;/code&gt; and call &lt;code&gt;describe-syntax&lt;/code&gt; (&lt;kbd&gt;C-h s&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs lisp mode makes some tweaks to &lt;code&gt;standard-syntax-table&lt;/code&gt;, of which I understand the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;`',@#&lt;/code&gt; are expression prefixes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?` &quot;'   &quot; table)&#xA;(modify-syntax-entry ?' &quot;'   &quot; table)&#xA;(modify-syntax-entry ?, &quot;'   &quot; table)&#xA;(modify-syntax-entry ?@ &quot;'   &quot; table)&#xA;(modify-syntax-entry ?# &quot;'   &quot; table)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;;&lt;/code&gt; starts a comment, &lt;code&gt;\n&lt;/code&gt; ends it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?\; &quot;&amp;lt;   &quot; table)&#xA;(modify-syntax-entry ?\n &quot;&amp;gt;   &quot; table)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;\&lt;/code&gt; is an escape char:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?\&quot; &quot;\&quot;    &quot; table)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2017-08-05T12:25:54.377" LastActivityDate="2017-08-05T12:25:54.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10203" PostTypeId="2" ParentId="10152" CreationDate="2015-03-21T13:38:15.547" Score="6" Body="&lt;p&gt;I believe I found the solution. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install &lt;a href=&quot;https://github.com/porterjamesj/virtualenvwrapper.el&quot; rel=&quot;noreferrer&quot;&gt;virtualenvwrapper&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run the setup: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'virtualenvwrapper)&#xA;(venv-initialize-interactive-shells) ;; if you want interactive shell support&#xA;(venv-initialize-eshell) ;; if you want eshell support&#xA;(setq venv-location &quot;/path/to/your/virtualenvs/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally, &lt;code&gt;workon&lt;/code&gt; the desired virtual environment. Then you can run code block and use the desired interpreter.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="861" LastEditorUserId="184" LastEditDate="2015-05-20T16:00:19.007" LastActivityDate="2015-05-20T16:00:19.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10204" PostTypeId="1" CreationDate="2015-03-21T13:48:25.777" Score="0" ViewCount="211" Body="&lt;p&gt;I updated all my packages via MELPA today and I previously had a solarized dark theme and now its solarized light. I did not change my init.el or any settings. Emacs is not showing any errors. Wondering what the issue likely is and how can I restore the theme?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have posted this as an issue on : &lt;a href=&quot;https://github.com/bbatsov/solarized-emacs/issues/167&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bbatsov/solarized-emacs/issues/167&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6877" LastEditorUserId="6877" LastEditDate="2015-03-21T16:56:03.973" LastActivityDate="2015-07-13T23:14:41.713" Title="Can not restore solarized dark theme after updating all packages via MELPA" Tags="|themes|package-repositories|upgrade|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10205" PostTypeId="2" ParentId="8068" CreationDate="2015-03-21T16:42:59.713" Score="27" Body="&lt;p&gt;This is a setting in Terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Terminal 2.5.1 the option is set differently than in the above comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the main Terminal menu, choose &quot;Preferences&quot; to open a dialog. Click the &quot;Profiles&quot; icon in the top of the dialog. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Profiles section, make sure there is a check in the checkbox called &quot;Use Option as Meta key.&quot; &lt;/p&gt;&#xA;" OwnerUserId="6771" LastEditorUserId="6771" LastEditDate="2015-03-22T07:13:48.000" LastActivityDate="2015-03-22T07:13:48.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10206" PostTypeId="1" AcceptedAnswerId="10209" CreationDate="2015-03-21T18:33:11.763" Score="4" ViewCount="657" Body="&lt;p&gt;I am a big fan of Kanban. I wrote Kanban-Dashboards with a decent metric analysis in Filemaker Pro and in Excel. However, some features I missed there and since my workflow is moving towards Emacs I would like to track my progress there. The Keyword here is org-mode, obviously. I already can generate a decent cumulative flow diagram (Kudos to &lt;a href=&quot;http://sachachua.com/blog/2014/05/getting-r-ggplot2-work-emacs-org-mode-babel-blocks-also-tracking-number-todos/&quot; rel=&quot;nofollow&quot;&gt;Sacha Chua&lt;/a&gt;!). One thing that keeps puzzling me though is how/whether I can limit the number of tasks for a given TODO-status. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets say, for example, that you have the Tasks TODO - DOING - DONE and would like to impose a WIP-limit on the middle-status. Is there a way so that I cannot change a task's status to &quot;DOING&quot; when already two tasks are on &quot;DOING&quot;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility would be to show the exceeding tasks in another color - is this possible in an Agenda?&lt;/p&gt;&#xA;" OwnerUserId="5392" LastEditorUserId="780" LastEditDate="2015-03-21T20:38:13.617" LastActivityDate="2015-03-22T14:34:28.313" Title="Limit number of Org TODO items in a certain state" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10207" PostTypeId="1" AcceptedAnswerId="10631" CreationDate="2015-03-21T19:00:58.297" Score="3" ViewCount="654" Body="&lt;p&gt;I have .authinfo.gpg set up and working as the authentication mechanism for ERC (with multiple IRC servers) and Gnus (with multiple IMAP servers) using the following in my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auth-source)&#xA;&#xA;(setq&#xA; auth-sources '(default&#xA;                 &quot;secrets:session&quot;&#xA;                 &quot;secrets:Login&quot;&#xA;                 &quot;~/.authinfo.gpg&quot;&#xA;                 &quot;~/.authinfo&quot;&#xA;                 &quot;~/.netrc&quot;&#xA;                 )&#xA; epa-file-cache-passphrase-for-symmetric-encryption t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My .authinfo.gpg includes entries like this (sanitized, naturally, and trimmed to just WordPress blog samples):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine example.com login JohnDoe password &quot;password&quot; port http&#xA;machine example2.com login JohnDoeJr password &quot;password2&quot; port http&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My org2blog config is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org2blog&#xA;  :defer t&#xA;  :ensure t&#xA;  :config&#xA;  (require 'org2blog-autoloads)&#xA;  ;;  (org2blog/wp-use-sourcecode-shortcode ‘t)&#xA;  (setq&#xA;   org2blog/wp-confirm-post t&#xA;   org2blog/wp-blog-alist&#xA;   '(&#xA;     (&quot;example1&quot;&#xA;      :url &quot;http://www.example.com/xmlrpc.php&quot;&#xA;      :username ,(car (auth-source-user-and-password &quot;example.com&quot;))&#xA;      :password ,(cadr (auth-source-user-and-password &quot;example.com&quot;))&#xA;      :default-title &quot;Hello, World!&quot;&#xA;      :default-categories (&quot;Uncategorized&quot;)&#xA;      )&#xA;     (&quot;example2&quot;&#xA;      :url &quot;http://www.example2.com/xmlrpc.php&quot;&#xA;      :username ,(car (auth-source-user-and-password &quot;example2.com&quot;))&#xA;      :password ,(cadr (auth-source-user-and-password &quot;example2.com&quot;))&#xA;      :default-title &quot;Hello, World!&quot;&#xA;      :default-categories (&quot;Uncategorized&quot;)&#xA;      ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the above when logging into either, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xml-rpc-value-to-xml-list: Wrong type argument: stringp, \,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried variations on the above but can't seem get get it to use .authinfo.gpg. The above error message is returned or I am prompted for my password.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've used the following references to help me but so far to no avail:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vxlabs.com/2014/05/25/emacs-24-with-prelude-org2blog-and-wordpress/&quot; rel=&quot;nofollow&quot;&gt;http://vxlabs.com/2014/05/25/emacs-24-with-prelude-org2blog-and-wordpress/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://thewanderingcoder.com/2015/02/publishing-from-org-mode-to-wordpress/&quot; rel=&quot;nofollow&quot;&gt;http://thewanderingcoder.com/2015/02/publishing-from-org-mode-to-wordpress/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/punchagan/org2blog&quot; rel=&quot;nofollow&quot;&gt;https://github.com/punchagan/org2blog&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm running:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of&#xA;2015-03-03 on lm-lvm-tpt430&lt;/li&gt;&#xA;&lt;li&gt;Org-mode version 8.2.10    (8.2.10-35-g19a7d6-elpaplus @&lt;br&gt;&#xA;/home/username/.emacs.d/elpa/org-plus-contrib-20150316/)&lt;/li&gt;&#xA;&lt;li&gt;org2blog 20150114.2301 from Melpa&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2794" LastEditorUserId="2794" LastEditDate="2015-03-23T01:07:00.487" LastActivityDate="2015-04-11T01:41:30.333" Title="How to get org2blog to use .authinfo.gpg" Tags="|org-mode|emacs24.4|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10209" PostTypeId="2" ParentId="10206" CreationDate="2015-03-21T19:55:19.367" Score="2" Body="&lt;p&gt;Org has support for blocking a TODO state change, used to implement TODO dependencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to leverage this to implement a work in progress limit:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;org-scan-tags&lt;/code&gt; to implement a custom function to count the number of TODO items in a given state. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add a custom function to &lt;code&gt;org-blocker-hook&lt;/code&gt; that counts the number of items in a given state and compares it to a configured limit.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's some code that seems to do the trick. This will prevent you from moving a task to the DOING state if there are already two or more tasks in that state. You can set &lt;code&gt;org-wip-state&lt;/code&gt; and &lt;code&gt;org-wip-limit&lt;/code&gt; to customize the limit.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-count-todos-in-state (state)&#xA;  (let ((count 0))&#xA;    (org-scan-tags (lambda ()&#xA;                     (when (string= (org-get-todo-state) state)&#xA;                       (setq count (1+ count))))&#xA;                   t t)&#xA;    count))&#xA;&#xA;(defvar org-wip-limit 2  &quot;Work-in-progress limit&quot;)&#xA;(defvar org-wip-state &quot;DOING&quot;)&#xA;&#xA;(defun org-block-wip-limit (change-plist)&#xA;  (catch 'dont-block&#xA;    (when (or (not (eq (plist-get change-plist :type) 'todo-state-change))&#xA;              (not (string= (plist-get change-plist :to) org-wip-state)))&#xA;      (throw 'dont-block t))&#xA;&#xA;    (when (&amp;gt;= (org-count-todos-in-state org-wip-state) org-wip-limit )&#xA;      (setq org-block-entry-blocking (format &quot;WIP limit: %s&quot; org-wip-state))&#xA;      (throw 'dont-block nil))&#xA;&#xA;    t)) ; do not block&#xA;&#xA;(add-hook 'org-blocker-hook #'org-block-wip-limit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-03-22T14:34:28.313" LastActivityDate="2015-03-22T14:34:28.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10210" PostTypeId="2" ParentId="10164" CreationDate="2015-03-21T19:59:52.920" Score="2" Body="&lt;p&gt;It turns out that the tag completion feature has been removed from the current version of smartparens. If you want to have tag completion, then you need to install the stable version, 1.6.3 from MELPA's stable package listing. &lt;/p&gt;&#xA;" OwnerUserId="6826" LastActivityDate="2015-03-21T19:59:52.920" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10211" PostTypeId="1" CreationDate="2015-03-21T22:21:59.070" Score="3" ViewCount="178" Body="&lt;p&gt;How can I run a &lt;code&gt;query-replace&lt;/code&gt; on the all the files pointed to by an arbitrary &lt;code&gt;compilation-mode&lt;/code&gt; buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think to be usable this would need to be resumable from &lt;code&gt;point&lt;/code&gt; in the &lt;code&gt;compilation-mode&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something very nearly exactly functionally equivalent to query-replace would of course be fine, but for the purposes of this question, I'm not interested in alternative UIs such as globrep, multiple cursors etc.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-03-29T14:42:16.183" Title="How to query-replace across all hits in a compilation-mode buffer" Tags="|search|compilation-mode|query-replace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10212" PostTypeId="1" CreationDate="2015-03-21T23:11:38.030" Score="0" ViewCount="739" Body="&lt;p&gt;I am in a .py file with python major mode (syntax highlighting is working).  I am trying to just use the TAB key to indent a code section. Nothing happens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it would be nice for emacs to do intelligent formatting. I am not even asking that! Just asking it to move text (code) over whatever the predefined number of spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can not paste the code.  The disable aggressive python indentation has been added but it did not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, I just want a way to &quot;indent no matter what&quot; ..&lt;/p&gt;&#xA;" OwnerUserId="6803" LastEditorUserId="6803" LastEditDate="2015-03-22T15:33:11.230" LastActivityDate="2015-03-22T16:02:13.850" Title="Indentation in python major mode" Tags="|indentation|python|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10213" PostTypeId="2" ParentId="10211" CreationDate="2015-03-22T01:49:52.377" Score="0" Body="&lt;p&gt;I understand that you are most interested in &quot;&lt;em&gt;something very nearly exactly functionally equivalent to query-replace&lt;/em&gt;&quot;. I don't have such an answer. I think I recall seeing something about that at some point in the last few years, so hopefully someone will give you an exact answer to your question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, here is an answer that presents an alternative that might help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of query-replace, you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; search in a &lt;code&gt;*grep*&lt;/code&gt; or compilation buffer. The key &lt;strong&gt;&lt;code&gt;C-c `&lt;/code&gt;&lt;/strong&gt; in these buffers is bound to &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Other_Search_Commands#IciclesCompileOrGrep&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-compilation-search&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;, which is a specialized version of &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-search&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each grep/compilation buffer hit defines a &lt;strong&gt;search context&lt;/strong&gt; in the buffer it points to. You then search for text within these contexts. For &lt;code&gt;grep&lt;/code&gt;, for example, each context is a matching line of source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While you search, you can &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search-And-Replace&quot; rel=&quot;nofollow&quot;&gt;replace search hits on demand&lt;/a&gt;.  This is unlike the case for query-replace, where you are queried for each search hit and you must answer for each one (or for all that remain, together).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is quite different from the searching and replacing you are used to, so be aware that it takes a bit of learning. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should first become somewhat familiar with using &lt;strong&gt;Icicles&lt;/strong&gt; in general, in particular using &lt;code&gt;C-down&lt;/code&gt; etc. to act on completion candidates (which for search means navigating to search hits). You should next experiment with &lt;strong&gt;Icicles&lt;/strong&gt; search, including its different possibilities (see the user options that affect it). Only when you are comfortable with these things should you try on-demand replacement during search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read about the various &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview#UserOptions&quot; rel=&quot;nofollow&quot;&gt;user options&lt;/a&gt; that affect &lt;strong&gt;Icicles&lt;/strong&gt; search and replace, in particular &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-search-replace-whole-candidate-flag&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-search-replace-whole-candidate-flag&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-expand-input-to-common-match&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-expand-input-to-common-match&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-search-replace-common-match-flag&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-search-replace-common-match-flag&lt;/code&gt;&lt;/a&gt;, and &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-search-highlight-all-current-flag&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-search-highlight-all-current-flag&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-22T15:46:02.370" LastActivityDate="2015-03-22T15:46:02.370" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10214" PostTypeId="1" AcceptedAnswerId="10227" CreationDate="2015-03-22T03:59:59.953" Score="1" ViewCount="221" Body="&lt;p&gt;It may be handy to make it shortly, for example use &lt;code&gt;(GET|POST): *\{&lt;/code&gt; instead of &lt;code&gt;\(GET\|POST\): *{&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="210" LastEditorUserId="105" LastEditDate="2015-03-22T06:06:22.650" LastActivityDate="2015-03-23T01:21:17.913" Title="Is there any way to configure isearch-forward-regexp invert backslashes usage?" Tags="|elisp|regular-expressions|syntax|isearch|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10215" PostTypeId="2" ParentId="10214" CreationDate="2015-03-22T06:05:51.477" Score="3" Body="&lt;p&gt;I'm afraid that the answer is no - there is no easy, out-of-the-box way to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has been discussed in the Emacs Dev mailing list a few times now, as a possible extension to Emacs Lisp.  Well, not just for Isearch but for regexps in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two interesting threads about it: &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00360.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;em&gt;1&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00724.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;em&gt;2&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-22T06:05:51.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10216" PostTypeId="2" ParentId="10212" CreationDate="2015-03-22T07:17:15.300" Score="1" Body="&lt;p&gt;Sometimes if the syntax on previous lines is incorrect emacs doesn't indent. One common case is a missing colon, e.g. at the end of an if statement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, your current syntax is correct and adding a tab would break the code, which is why emacs isn't letting you do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could always use spaces.&lt;/p&gt;&#xA;" OwnerUserId="6771" LastEditorUserId="6771" LastEditDate="2015-03-22T16:02:13.850" LastActivityDate="2015-03-22T16:02:13.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10217" PostTypeId="2" ParentId="10212" CreationDate="2015-03-22T09:06:05.437" Score="0" Body="&lt;p&gt;With python-mode.el, which needs to be installed explicitly, customize &lt;code&gt;py-tab-indents-region-p&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; - default is nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, in case indent is already at outmost reasonable level, first TAB will do nothing, following TAB will shift region cycling possible indents.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-03-22T09:06:05.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10218" PostTypeId="1" AcceptedAnswerId="10219" CreationDate="2015-03-22T09:38:14.663" Score="0" ViewCount="436" Body="&lt;p&gt;I actually know very little about &lt;code&gt;cask&lt;/code&gt;. I discover it after browsing the &lt;code&gt;emacs&lt;/code&gt; module of &lt;a href=&quot;https://github.com/sorin-ionescu/prezto&quot; rel=&quot;nofollow&quot;&gt;prezto&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this prezto module, the &lt;code&gt;cask&lt;/code&gt; command alias will not be created unless there exists a &lt;code&gt;.cask&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have run &lt;code&gt;cask init&lt;/code&gt; but the file is still absent. Is it right for me to expect this file to be created by &lt;code&gt;cask init&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the link to the key file in the said &lt;code&gt;emacs&lt;/code&gt; module &lt;a href=&quot;https://raw.githubusercontent.com/sorin-ionescu/prezto/master/modules/emacs/init.zsh&quot; rel=&quot;nofollow&quot;&gt;https://raw.githubusercontent.com/sorin-ionescu/prezto/master/modules/emacs/init.zsh&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="169" LastActivityDate="2015-03-22T11:47:19.057" Title="cask init does not create ~/.cask file" Tags="|osx|cask|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10219" PostTypeId="2" ParentId="10218" CreationDate="2015-03-22T11:47:19.057" Score="2" Body="&lt;p&gt;&lt;code&gt;~/.cask/&lt;/code&gt; is the standard installation directory for Cask.  Since you installed Cask in a non-standard way, you do not have this directory and you don't need to create it.  Cask is fully functional.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the prezto module was written before the Homebrew formula existed, and hasn't been updated since, so it doesn't know about Homebrew's installation directory and consequently doesn't find cask.  You need to fix the Prezto module.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: I contribute to Cask, and wrote this Prezto module.  But I've since stopped to use Prezto, and don't maintain it anymore.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-03-22T11:47:19.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10220" PostTypeId="1" CreationDate="2015-03-22T13:12:27.067" Score="1" ViewCount="91" Body="&lt;p&gt;When I have a running emacs process, before running another, I can make the running one a server, and then running the next as a client.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have two emacs processes already running, how can I exchange text between buffers in them as if in one emacs process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is some good practice to avoid such hassle?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2015-03-22T13:12:27.067" Title="How can I make two running emacs processes to exchange text like in one?" Tags="|process|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10221" PostTypeId="2" ParentId="5432" CreationDate="2015-03-22T13:44:57.093" Score="7" Body="&lt;p&gt;From the &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-drill.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-drill&lt;/code&gt; manual&lt;/a&gt; on &quot;Empty Cards&quot;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you have an item with an empty body, but still want it to be included in a drill session, put a brief comment ('# …') in the item body.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think &lt;code&gt;org-drill&lt;/code&gt; is seeing your card as empty, and so &lt;code&gt;org-drill-cram&lt;/code&gt; fails to retrieve your items. By comparison, the cards in &lt;code&gt;spanish.org&lt;/code&gt; are not empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is non-intuitive behavior because one expects comments to be meaningless, but here they are necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran into this problem myself when setting up similar reviews where I felt the title was a sufficient prompt, and it took a while to identify this as the cause. My previous incorrect hypothesis was that I hadn't added the file to the agenda and &lt;code&gt;org-drill-scope&lt;/code&gt; wasn't set properly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be possible to modify the &lt;code&gt;org-drill&lt;/code&gt; code to avoid this behavior, but I have not done so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On an unrelated note, you might also find the setting &lt;code&gt;org-drill-cram-hours&lt;/code&gt; useful.&lt;/p&gt;&#xA;" OwnerUserId="6842" LastActivityDate="2015-03-22T13:44:57.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10222" PostTypeId="1" AcceptedAnswerId="10637" CreationDate="2015-03-22T14:28:34.640" Score="9" ViewCount="2226" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html&quot; rel=&quot;noreferrer&quot;&gt;Mode line&lt;/a&gt;'s &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/_0025_002dConstructs.html#g_t_0025_002dConstructs&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;%p&lt;/code&gt;&lt;/a&gt; displays the percentage of the current view of the buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;%p The percentage of the buffer text above the top of window, or&#xA;  ‘Top’, ‘Bottom’ or ‘All’. Note that the default mode line construct&#xA;  truncates this to three characters.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't like the &lt;em&gt;Top/Bottom/All&lt;/em&gt; and I'd like to always display the percentage. Is there a way to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="5352" LastEditorUserId="50" LastEditDate="2015-03-25T14:07:06.290" LastActivityDate="2020-03-03T12:20:22.983" Title="Make the mode-line display percentage and not &quot;Top/Bottom/All&quot;" Tags="|mode-line|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10223" PostTypeId="1" AcceptedAnswerId="10225" CreationDate="2015-03-22T17:58:12.577" Score="13" ViewCount="9901" Body="&lt;p&gt;I have some UTF-8-encoded text files which display strange escape codes in Emacs. For instance, this text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In ista quaestione primo exponam quid intelligendum est per hoc nomen&#xA;  ‘Deus’; secundo, respondebo ad quaestionem.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Shows like this in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RPbsA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only happens in Emacs. Other editors show the text correctly. How can I fix this problem?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I call &lt;code&gt;revert-buffer-with-coding-system&lt;/code&gt; and select &lt;code&gt;utf-8&lt;/code&gt; the file get read correctly. So, as Gilles has correctly guessed, Emacs isn't detecting the file encoding. If I add the code &lt;code&gt;; -*- coding: utf-8 -*-&lt;/code&gt; to the file, Emacs opens and displays it correctly.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reencoded the file in &quot;UTF-8 with BOM encoding,&quot; and now it displays alright in Emacs. I don't know what's the difference between the two types, but Emacs seems to be aware of the BOMed one only.&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2015-03-22T19:34:46.133" LastActivityDate="2022-06-02T07:29:57.893" Title="How to display Unicode UTF-8 as Unicode?" Tags="|character-encoding|unicode|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10224" PostTypeId="1" CreationDate="2015-03-22T19:19:47.247" Score="3" ViewCount="545" Body="&lt;p&gt;I used this answer to try to get eww to use more readable colours for me in my configuration, which uses the &lt;code&gt;monokai&lt;/code&gt; theme:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/3523/5495&quot;&gt;https://emacs.stackexchange.com/a/3523/5495&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That answer uses &lt;code&gt;load-theme-buffer-local&lt;/code&gt;.  Using the answer as-is (with the &lt;code&gt;tango&lt;/code&gt; theme) still gives different results than running eww from &lt;code&gt;emacs -q&lt;/code&gt; (in particular, a darker background if I visit &lt;a href=&quot;https://news.ycombinator.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://news.ycombinator.com/&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a different theme name I can use here that will give results similar to what I get before applying any theme?  Or some other way to get an equivalent effect -- i.e. effectively not applying the monokai theme to eww buffers?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-03-22T19:19:47.247" Title="How to apply `load-theme-buffer-local` with &quot;default&quot; theme?" Tags="|themes|eww|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10225" PostTypeId="2" ParentId="10223" CreationDate="2015-03-22T19:38:36.103" Score="11" Body="&lt;p&gt;For some reason, Emacs isn't recognizing the file as UTF-8. &#xA;You can force Emacs to reopen the file as UTF-8 by running the command &lt;code&gt;C-x RET r&lt;/code&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html#Specify-Coding&quot;&gt;&lt;code&gt;revert-buffer-with-coding-system&lt;/code&gt;&lt;/a&gt;) and entering &lt;code&gt;utf-8&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why Emacs didn't recognize this file as UTF-8 (but recognizes other) is likely that it contains some invalid UTF-8 sequence. This sequence will still appear as backslash followed by three octal digits with a different color (the &lt;code&gt;escape-glyph&lt;/code&gt; face) after reinterpreting the file as UTF-8. You can search for such a sequence by running &lt;code&gt;C-M-s&lt;/code&gt; (&lt;code&gt;isearch-regexp&lt;/code&gt;) and looking for&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[^^@-~[:multibyte:]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;^@&lt;/code&gt; is entered by typing &lt;code&gt;C-q C-SPC&lt;/code&gt; (it's the character ^@ = 0, not the two-character sequence circumflex-at; the character before it is the circumflex character).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can force Emacs to recognize the file as UTF-8 by adding a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html#index-coding-1719&quot;&gt;coding system file variable&lt;/a&gt;: put something like &lt;code&gt;-*-coding: utf-8-*-&lt;/code&gt; on the first line, or put something like this near the end of the file (you can replace &lt;code&gt;#&lt;/code&gt; by any prefix, but &lt;code&gt;Local Variables:&lt;/code&gt; and &lt;code&gt;End:&lt;/code&gt; must appear exactly like this with the trailing colon):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# coding: utf-8&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Recognize-Coding.html#Recognize-Coding&quot;&gt;chooses the encoding according to which files are interpreted&lt;/a&gt; based on several settings, primarily &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Language-Environments.html#Language-Environments&quot;&gt;language environments&lt;/a&gt; and the variables &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Recognize-Coding.html#index-auto_002dcoding_002dalist-1716&quot;&gt;&lt;code&gt;auto-coding-alist&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;auto-coding-regexp-alist&lt;/code&gt;. Since you have the same problem with this file even when running &lt;code&gt;emacs -Q&lt;/code&gt;, I think that this isn't an issue with those settings, but with the file content.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-03-22T19:38:36.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10226" PostTypeId="2" ParentId="10222" CreationDate="2015-03-22T22:46:51.040" Score="0" Body="&lt;p&gt;The built-in code for &lt;code&gt;%p&lt;/code&gt; just looks at &lt;code&gt;window-start&lt;/code&gt; and &lt;code&gt;point-max&lt;/code&gt; and computes the percentage that way.  You can find this out using &lt;code&gt;C-h f format-mode-line&lt;/code&gt; and then following the link to the Emacs C sources (assuming you have them around somewhere).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you can do this same thing using a &lt;code&gt;:eval&lt;/code&gt; form in &lt;code&gt;mode-line-format&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-03-22T22:46:51.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10227" PostTypeId="2" ParentId="10214" CreationDate="2015-03-23T01:21:17.913" Score="3" Body="&lt;p&gt;Just adapt &lt;code&gt;isearch-search-fun-function&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-extended-regexp-forward ()&#xA;  (interactive)&#xA;  (let ((regexp-chars &quot;[|{}()`=&amp;lt;&amp;gt;]&quot;)&#xA;        (isearch-message-prefix-add &quot;Extended &quot;)&#xA;        (isearch-search-fun-function&#xA;         (lambda ()&#xA;           (lambda (regexp &amp;amp;rest other-args)&#xA;             (apply (isearch-search-fun-default)&#xA;               (replace-regexp-in-string&#xA;                regexp-chars &quot;\\\\\\&amp;amp;&quot; regexp t)&#xA;               other-args)))))&#xA;    (isearch-forward t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-03-23T01:21:17.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10228" PostTypeId="1" CreationDate="2015-03-23T04:56:31.813" Score="5" ViewCount="291" Body="&lt;p&gt;I'm thinking of using literate programming to investigate large amount, or hard to understand source code. For the purpose, I'd like refactor the source code into literate programming text with org-mode/babel, so that I can add annotations of my study, questions, and comments freely, while I can tangle back to get the original source code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just wondering if any kind soul has already done something similar? At the moment, it could be simple as:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Input the source code into org-mode/babel buffer, and wrap the whole source code into an initial code chunk;&lt;/li&gt;&#xA;&lt;li&gt;Provide a command to extract a region, or a sub-expression into separate code chunk with proper arrangement in terms of chunk name, headers, etc. so that the relationship in the source code can be expressed, and preserved, such as having another code check to aggregate those separated code chunk. (the name of the extracted code chunk may be automated as the first expression in the region, or something semantically making sense, and feasible) &lt;/li&gt;&#xA;&lt;li&gt;For more advance application, the tool can scan the source code directory, and generate an initial org-mode file with the source code being parsed into literate programming chunks for each major programming constructs, for each file, the header declaration, and each function/subroutine, etc., with proper arrangement to tangle back the original source code directories, and files. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The essence is to automate the manual operations in refactoring as much as possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that this might be a tremendous help to study source code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please share pointers, thought, contributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, Yu &lt;/p&gt;&#xA;" OwnerUserId="6845" LastActivityDate="2015-03-23T17:30:27.573" Title="Support to refactor/convert source into literate programming with org-mode/babel?" Tags="|org-babel|refactoring|literate-programming|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10229" PostTypeId="1" AcceptedAnswerId="10239" CreationDate="2015-03-23T06:40:09.870" Score="2" ViewCount="636" Body="&lt;p&gt;On my primary computer, I have the following set up for emacs and everything works like a charm. I use emacs cvs, auctex cvs, and latexmk on a Ubuntu 14.04. However, I just put the same set up on another computer running Ubuntu 14.04 but LaTeX files are opened in &lt;code&gt;fundamental-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/27Amr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my init I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Start server and set directory&#xA;(setq server-socket-dir (format &quot;/tmp/emacs1000&quot;))&#xA;;; Not sure if (useruid) does anything or the difference between&#xA;;; (server-start) and '(server-mode t) in custom&#xA;;(setq server-socket-dir (format &quot;/tmp/emacs1000&quot; (user-uid)))&#xA;;(server-start)&#xA;&#xA;;; Package list M-x package-list-packages&#xA;(require 'package)&#xA;(add-to-list 'package-archives &#xA;         '(&quot;marmelade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives &#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;(add-to-list 'package-archives &#xA;         '(&quot;elpa&quot; . &quot;http://tromey.com/elpa/&quot;))&#xA;&#xA;;; Package initialize&#xA;(package-initialize)&#xA;&#xA;;; AucTex &amp;amp; RefTeX&#xA;(add-to-list 'load-path &quot;/usr/local/share/emacs/site-lisp/&quot;)&#xA;(load &quot;auctex.el&quot; nil t t)&#xA;(load &quot;preview-latex.el&quot; nil t t)&#xA;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)&#xA;(setq reftex-plug-into-AUCTex t)&#xA;(global-font-lock-mode t)&#xA;(setq font-lock-maximum-decoration t)&#xA;(setq TeX-auto-save t)&#xA;(setq TeX-parse-self t)&#xA;(setq-default TeX-master nil)&#xA;(setq TeX-save-query nil)&#xA;&#xA;;; Copy and paste between Emac   instances     &#xA;(setq x-select-enable-clipboard t)&#xA;(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)&#xA;&#xA;;; Disablin autosave                                                           &#xA;(setq auto-save-default nil)&#xA;&#xA;;; Adjusting tab distance&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 2)&#xA;&#xA;;; Enable Line Numbering&#xA;(setq line-number-mode t)&#xA;(setq column-number-mode t)&#xA;&#xA;;; Set the fill column&#xA;(setq default-fill-column 80)&#xA;&#xA;;; Turn on Auto Fill mode automatically in all modes&#xA;;; Auto-fill-mode the the automatic wrapping of lines and insertion of&#xA;;; newlines when the cursor goes over the column limit.&#xA;;; This should actually turn on auto-fill-mode by default in all major&#xA;;; modes. The other way to do this is to turn on the fill for specific modes&#xA;;; via hooks.  &#xA;(setq auto-fill-mode 1)&#xA;&#xA;;;  Turn on visual line mode&#xA;(global-visual-line-mode t)&#xA;&#xA;;; Prevent Emacs from making backup files&#xA;(setq make-backup-files nil)&#xA;&#xA;;; Cleverref setup&#xA;(eval-after-load&#xA;    &quot;latex&quot;&#xA;  '(TeX-add-style-hook&#xA;    &quot;cleveref&quot;&#xA;    (lambda ()&#xA;      (if (boundp 'reftex-ref-style-alist)&#xA;      (add-to-list&#xA;       'reftex-ref-style-alist&#xA;       '(&quot;Cleveref&quot; &quot;cleveref&quot;&#xA;         ((&quot;\\cref&quot; ?c) (&quot;\\Cref&quot; ?C) (&quot;\\cpageref&quot; ?d) (&quot;\\Cpageref&quot; ?D)))))&#xA;      (add-to-list 'reftex-ref-style-default-list &quot;Cleveref&quot;)&#xA;      (TeX-add-symbols&#xA;       '(&quot;cref&quot; TeX-arg-ref)&#xA;       '(&quot;Cref&quot; TeX-arg-ref)&#xA;       '(&quot;cpageref&quot; TeX-arg-ref)&#xA;       '(&quot;Cpageref&quot; TeX-arg-ref)))))&#xA;&#xA;;; Latexmk setup&#xA;(defun run-latexmk ()&#xA;  (interactive)&#xA;  (let ((TeX-save-query nil)&#xA;        (TeX-process-asynchronous nil)&#xA;        (master-file (TeX-master-file)))&#xA;    (TeX-save-document &quot;&quot;)&#xA;    (TeX-run-TeX &quot;latexmk&quot;&#xA;         (TeX-command-expand &quot;latexmk -pdf %s&quot; 'TeX-master-file)&#xA;                 master-file))&#xA;  (if (plist-get TeX-error-report-switches (intern master-file))&#xA;      (TeX-next-error t)&#xA;    (progn&#xA;      (demolish-tex-help)&#xA;      (minibuffer-message &quot;latexmk: done.&quot;))))&#xA;&#xA;(add-hook 'LaTeX-mode-hook &#xA;      (lambda ()&#xA;        (push &#xA;         '(&quot;Latexmk&quot; &quot;latexmk -pdf %s&quot; TeX-run-TeX nil t&#xA;           :help &quot;Run Latexmk on file&quot;)&#xA;         TeX-command-list)))&#xA;&#xA;;; Set okular to open with C-c C-v view option &#xA;(setq TeX-view-program-list&#xA;      '((&quot;Okular&quot; &quot;okular --unique %u&quot;)))&#xA;(setq TeX-view-program-selection '((output-pdf &quot;Okular&quot;)))&#xA;&#xA;;; Paren checking&#xA;(load &quot;paren&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/rainbow-delimiters-20150320.17&quot;)&#xA;(require 'rainbow-delimiters)&#xA;(global-rainbow-delimiters-mode)&#xA;(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)&#xA;&#xA;;; Adaptive wrap&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/adaptive-wrap-0.5&quot;)&#xA;(require 'adaptive-wrap)&#xA;&#xA;(when (fboundp 'adaptive-wrap-prefix-mode)&#xA;  (defun my-activate-adaptive-wrap-prefix-mode ()&#xA;    &quot;Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously.&quot;&#xA;    (if visual-line-mode&#xA;        (adaptive-wrap-prefix-mode 1)&#xA;      (adaptive-wrap-prefix-mode -1)))&#xA;  (add-hook 'visual-line-mode-hook 'my-activate-adaptive-wrap-prefix-mode))&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(TeX-PDF-mode t)&#xA; '(TeX-newline-function (quote newline-and-indent))&#xA; '(TeX-show-compilation t)&#xA; '(TeX-source-correlate-method (quote synctex))&#xA; '(TeX-source-correlate-mode t)&#xA; '(TeX-view-program-list (quote ((&quot;Okular&quot; &quot;okular -unique %o#src:%n%b&quot;))) t)&#xA; '(TeX-view-program-selection (quote ((output-pdf &quot;Okular&quot;))) t)&#xA; '(compilation-auto-jump-to-first-error t)&#xA; '(inhibit-startup-screen t)&#xA; '(ispell-lazy-highlight nil)&#xA; '(server-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my latexmkrc, I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$pdflatex = 'pdflatex --shell-escape -interaction=nonstopmode %O %S&#xA;-file-line-error -synctex=1';&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my bash_aliases, I have the following &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias emacs='emacsclient -t -s server --alternate-editor='&#xA;alias ipython='ipython3'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Considering both set ups are identical running the same software, why wont this work on a different computer? I run into this problem every time I have to set back up emacs on any of my computers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Messages received from &lt;code&gt;C-h e&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading paren...done&#xA;Starting Emacs daemon.&#xA;File mode specification error: (void-function pushnew)&#xA;File local-variables error: (void-function pushnew)&#xA;When done with a buffer, type C-x #&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2603" LastEditorUserId="50" LastEditDate="2015-03-25T13:41:15.477" LastActivityDate="2015-03-25T13:41:15.477" Title="Opening latex files works on one computer but not the other" Tags="|auctex|latex|emacsclient|" AnswerCount="1" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="10230" PostTypeId="1" CreationDate="2015-03-23T08:59:14.010" Score="25" ViewCount="3799" Body="&lt;p&gt;Probably influenced by Clojure, I more often use property lists as data-structures.  Emacs most of the time indents them like this,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;`(:token ,token&#xA;         :token-quality ,quality)  , &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while this is what I would prefer&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;`(:token ,token&#xA;  :token-quality ,quality) . &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, I wonder, if someone has already tackled this ?&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="105" LastEditDate="2020-11-14T17:58:02.467" LastActivityDate="2023-12-28T23:09:06.797" Title="How to indent keywords aligned?" Tags="|indentation|" AnswerCount="5" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10232" PostTypeId="1" AcceptedAnswerId="10234" CreationDate="2015-03-23T12:53:07.057" Score="1" ViewCount="73" Body="&lt;p&gt;I'm trying to find a way to open files in helm-locate buffers using external software in OS X. Specifically, I'd like to be able to open PDFs in Skim. I know I can hit C-u C-c C-x to choose a program to open a file with, but I can't find a way to get Skim to show up on the list that helm produces.&lt;/p&gt;&#xA;" OwnerUserId="6849" LastActivityDate="2015-03-23T13:34:23.723" Title="Opening with default application (e.g. Skim) from helm-locate on OS X" Tags="|helm|osx|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10233" PostTypeId="2" ParentId="10230" CreationDate="2015-03-23T13:03:03.277" Score="6" Body="&lt;p&gt;That can be achieved by changing the &lt;code&gt;lisp-indent-function&lt;/code&gt; for emacs-lisp mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook&#xA;          (lambda () (setq-local lisp-indent-function #'common-lisp-indent-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;lisp-mode.el&lt;/code&gt; in emacs source,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (defcustom lisp-indent-function 'lisp-indent-function&#xA;  &quot;A function to be called by `calculate-lisp-indent'.&#xA;It indents the arguments of a Lisp function call.  This function&#xA;should accept two arguments: the indent-point, and the&#xA;`parse-partial-sexp' state at that position.  One option for this&#xA;function is `common-lisp-indent-function'.&quot;&#xA;  :type 'function&#xA;  :group 'lisp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Alternative&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;As &lt;strong&gt;@wasamasa&lt;/strong&gt; mentioned in a comment to the question, &lt;strong&gt;@Fuco1&lt;/strong&gt; (on github.com) has &lt;a href=&quot;https://github.com/Fuco1/.emacs.d/blob/af82072196564fa57726bdbabf97f1d35c43b7f7/site-lisp/redef.el#L20-L94&quot; rel=&quot;noreferrer&quot;&gt;modified the default &lt;code&gt;lisp-indent-function&lt;/code&gt;&lt;/a&gt; to fix the indentation of keywords (starting with &lt;code&gt;:&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has provided the variable &lt;code&gt;lisp-indent-function&lt;/code&gt; for the user to choose what function to use for indentation in lisp modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of overriding the original function definition, we can create our own function and assign the above variable to that function name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Save the &lt;a href=&quot;https://github.com/Fuco1/.emacs.d/blob/af82072196564fa57726bdbabf97f1d35c43b7f7/site-lisp/redef.el#L20-L94&quot; rel=&quot;noreferrer&quot;&gt;Fuco1 modded function&lt;/a&gt; as something like &lt;code&gt;Fuco1/lisp-indent-function&lt;/code&gt; in your emacs setup&lt;/li&gt;&#xA;&lt;li&gt;Make use of that function for indentation in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook&#xA;          (lambda () (setq-local lisp-indent-function #'Fuco1/lisp-indent-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Reference&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The modded function is pasted below in the event the source referenced to github is lost.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; https://github.com/Fuco1/.emacs.d/blob/af82072196564fa57726bdbabf97f1d35c43b7f7/site-lisp/redef.el#L20-L94&#xA;(defun Fuco1/lisp-indent-function (indent-point state)&#xA;  &quot;This function is the normal value of the variable `lisp-indent-function'.&#xA;The function `calculate-lisp-indent' calls this to determine&#xA;if the arguments of a Lisp function call should be indented specially.&#xA;&#xA;INDENT-POINT is the position at which the line being indented begins.&#xA;Point is located at the point to indent under (for default indentation);&#xA;STATE is the `parse-partial-sexp' state for that position.&#xA;&#xA;If the current line is in a call to a Lisp function that has a non-nil&#xA;property `lisp-indent-function' (or the deprecated `lisp-indent-hook'),&#xA;it specifies how to indent.  The property value can be:&#xA;&#xA;* `defun', meaning indent `defun'-style&#xA;  \(this is also the case if there is no property and the function&#xA;  has a name that begins with \&quot;def\&quot;, and three or more arguments);&#xA;&#xA;* an integer N, meaning indent the first N arguments specially&#xA;  (like ordinary function arguments), and then indent any further&#xA;  arguments like a body;&#xA;&#xA;* a function to call that returns the indentation (or nil).&#xA;  `lisp-indent-function' calls this function with the same two arguments&#xA;  that it itself received.&#xA;&#xA;This function returns either the indentation to use, or nil if the&#xA;Lisp function does not specify a special indentation.&quot;&#xA;  (let ((normal-indent (current-column))&#xA;        (orig-point (point)))&#xA;    (goto-char (1+ (elt state 1)))&#xA;    (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)&#xA;    (cond&#xA;     ;; car of form doesn't seem to be a symbol, or is a keyword&#xA;     ((and (elt state 2)&#xA;           (or (not (looking-at &quot;\\sw\\|\\s_&quot;))&#xA;               (looking-at &quot;:&quot;)))&#xA;      (if (not (&amp;gt; (save-excursion (forward-line 1) (point))&#xA;                  calculate-lisp-indent-last-sexp))&#xA;          (progn (goto-char calculate-lisp-indent-last-sexp)&#xA;                 (beginning-of-line)&#xA;                 (parse-partial-sexp (point)&#xA;                                     calculate-lisp-indent-last-sexp 0 t)))&#xA;      ;; Indent under the list or under the first sexp on the same&#xA;      ;; line as calculate-lisp-indent-last-sexp.  Note that first&#xA;      ;; thing on that line has to be complete sexp since we are&#xA;      ;; inside the innermost containing sexp.&#xA;      (backward-prefix-chars)&#xA;      (current-column))&#xA;     ((and (save-excursion&#xA;             (goto-char indent-point)&#xA;             (skip-syntax-forward &quot; &quot;)&#xA;             (not (looking-at &quot;:&quot;)))&#xA;           (save-excursion&#xA;             (goto-char orig-point)&#xA;             (looking-at &quot;:&quot;)))&#xA;      (save-excursion&#xA;        (goto-char (+ 2 (elt state 1)))&#xA;        (current-column)))&#xA;     (t&#xA;      (let ((function (buffer-substring (point)&#xA;                                        (progn (forward-sexp 1) (point))))&#xA;            method)&#xA;        (setq method (or (function-get (intern-soft function)&#xA;                                       'lisp-indent-function)&#xA;                         (get (intern-soft function) 'lisp-indent-hook)))&#xA;        (cond ((or (eq method 'defun)&#xA;                   (and (null method)&#xA;                        (&amp;gt; (length function) 3)&#xA;                        (string-match &quot;\\`def&quot; function)))&#xA;               (lisp-indent-defform state indent-point))&#xA;              ((integerp method)&#xA;               (lisp-indent-specform method state&#xA;                                     indent-point normal-indent))&#xA;              (method&#xA;               (funcall method indent-point state))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-03-23T15:04:14.173" LastActivityDate="2015-03-23T15:04:14.173" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10234" PostTypeId="2" ParentId="10232" CreationDate="2015-03-23T13:34:23.723" Score="1" Body="&lt;p&gt;If you use skim as your primary pdf viewer, then set it as default application to open PDFs in OSX, then use &lt;code&gt;open&lt;/code&gt; to open the file.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-03-23T13:34:23.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10235" PostTypeId="2" ParentId="10230" CreationDate="2015-03-23T14:26:18.640" Score="1" Body="&lt;p&gt;For a much hackier alternative to kaushalmodi's answer you could overwrite the &lt;code&gt;lisp-indent-function&lt;/code&gt; similar to what Mark H. Weaver did for the &lt;code&gt;scheme-indent-function&lt;/code&gt; to fix alignment of keywords in Guile Scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just copied the code from &lt;a href=&quot;http://netris.org/~mhw/scheme-indent-function.el&quot; rel=&quot;nofollow&quot;&gt;http://netris.org/~mhw/scheme-indent-function.el&lt;/a&gt;; the only change is to add a new &lt;code&gt;cond&lt;/code&gt; clause.  You may want to take the current code of &lt;code&gt;lisp-indent-function&lt;/code&gt; instead of using this function as is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It's a pity that the indent functions don't expose more hooks to simplify minor changes like this.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun scheme-indent-function (indent-point state)&#xA;  &quot;Scheme mode function for the value of the variable `lisp-indent-function'.&#xA;This behaves like the function `lisp-indent-function', except that:&#xA;&#xA;i) it checks for a non-nil value of the property `scheme-indent-function'&#xA;\(or the deprecated `scheme-indent-hook'), rather than `lisp-indent-function'.&#xA;&#xA;ii) if that property specifies a function, it is called with three&#xA;arguments (not two), the third argument being the default (i.e., current)&#xA;indentation.&quot;&#xA;  (let ((normal-indent (current-column)))&#xA;    (goto-char (1+ (elt state 1)))&#xA;    (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)&#xA;    (if (and (elt state 2)&#xA;             (not (looking-at &quot;\\sw\\|\\s_&quot;)))&#xA;        ;; car of form doesn't seem to be a symbol&#xA;        (progn&#xA;          (if (not (&amp;gt; (save-excursion (forward-line 1) (point))&#xA;                      calculate-lisp-indent-last-sexp))&#xA;              (progn (goto-char calculate-lisp-indent-last-sexp)&#xA;                     (beginning-of-line)&#xA;                     (parse-partial-sexp (point)&#xA;                     calculate-lisp-indent-last-sexp 0 t)))&#xA;          ;; Indent under the list or under the first sexp on the same&#xA;          ;; line as calculate-lisp-indent-last-sexp.  Note that first&#xA;          ;; thing on that line has to be complete sexp since we are&#xA;          ;; inside the innermost containing sexp.&#xA;          (backward-prefix-chars)&#xA;          (current-column))&#xA;      (let ((function (buffer-substring (point)&#xA;                    (progn (forward-sexp 1) (point))))&#xA;        method)&#xA;    (setq method (or (get (intern-soft function) 'scheme-indent-function)&#xA;             (get (intern-soft function) 'scheme-indent-hook)))&#xA;    (cond ((or (eq method 'defun)&#xA;           (and (null method)&#xA;            (&amp;gt; (length function) 3)&#xA;            (string-match &quot;\\`def&quot; function)))&#xA;           (lisp-indent-defform state indent-point))&#xA;              ;; This next cond clause is the only change -mhw&#xA;          ((and (null method)&#xA;                    (&amp;gt; (length function) 1)&#xA;                    ; The '#' in '#:' seems to get lost, not sure why&#xA;                    (string-match &quot;\\`:&quot; function))&#xA;               (let ((lisp-body-indent 1))&#xA;                 (lisp-indent-defform state indent-point)))&#xA;          ((integerp method)&#xA;           (lisp-indent-specform method state&#xA;                     indent-point normal-indent))&#xA;          (method&#xA;        (funcall method state indent-point normal-indent)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-03-23T15:51:09.713" LastActivityDate="2015-03-23T15:51:09.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10237" PostTypeId="1" AcceptedAnswerId="10238" CreationDate="2015-03-23T14:59:53.410" Score="2" ViewCount="249" Body="&lt;p&gt;When trying to run it I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x buffer-file-name [No match]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it has a function help entry via &lt;code&gt;C-h f&lt;/code&gt; and I can evaluate it with &lt;code&gt;M-: buffer-file-name&lt;/code&gt;. So why isn't it accessible via &lt;code&gt;M-x&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-03-23T15:04:46.840" Title="buffer-file-name is a function, so why doesn't M-x buffer-file-name work?" Tags="|buffers|files|functions|interactive|" AnswerCount="1" CommentCount="0" ClosedDate="2015-03-23T17:05:56.190" ContentLicense="CC BY-SA 3.0" />
  <row Id="10238" PostTypeId="2" ParentId="10237" CreationDate="2015-03-23T15:04:46.840" Score="7" Body="&lt;p&gt;&lt;code&gt;buffer-file-name&lt;/code&gt; is a &lt;em&gt;function&lt;/em&gt;, but not an interactive &lt;em&gt;command&lt;/em&gt;.  &lt;code&gt;M-x&lt;/code&gt; calls &lt;code&gt;execute-extended-command&lt;/code&gt;, so can't be used on non-command functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/3555/what-is-the-difference-between-a-function-and-a-command&quot;&gt;What is the difference between a function and a command?&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-03-23T15:04:46.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10239" PostTypeId="2" ParentId="10229" CreationDate="2015-03-23T15:58:32.817" Score="5" Body="&lt;p&gt;This might be the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/usr/local/share/emacs/site-lisp/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The packages in that directory don't necessarily come bundled with emacs, they're system-specific and they depend on how you install Emacs. So these packages might be present on one machine but absent from the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should install AucTeX yourself. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call &lt;code&gt;M-x list-packages&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;In that list install the Auctex package by hitting &lt;code&gt;i x&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-23T15:58:32.817" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="10240" PostTypeId="2" ParentId="10228" CreationDate="2015-03-23T17:30:27.573" Score="3" Body="&lt;p&gt;Your initial steps are a good starting point. You can implement #2 using Babel Templates and sessions. Having all the source blocks run in one sessions means you can easily split them into multiple chunks with the same result. Just make sure when you split it, it is not inside a loop. That would be OK for when you tangle, but it wouldn't let you execute the blocks inside the Org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two Python Babel Templates that I use for this type of work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-structure-template-alist&#xA;             '(&quot;p&quot; &quot;#+BEGIN_SRC python :results output :exports none\n?\n#+END_SRC\n#+RESULTS:&quot; &quot;&amp;lt;src lang=\&quot;python\&quot;&amp;gt;\n?\n&amp;lt;/src&amp;gt;&quot;))&#xA;(add-to-list 'org-structure-template-alist&#xA;             '(&quot;pe&quot; &quot;#+END_SRC\n#+RESULTS:\n?\n#+BEGIN_SRC python :results output :exports none\n&quot; &quot;&amp;lt;/src&amp;gt;\n&amp;lt;src lang=\&quot;python\&quot;&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first one lets me type &lt;code&gt;&amp;lt;pTAB&lt;/code&gt; and it expands to the default Python setup I want, and puts the cursor in between the &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; and &lt;code&gt;#+END_SRC&lt;/code&gt; blocks. The second one will be more useful to you. Instead of beginning and ending a source block, it ends and then begins (that is, splits one block into two), and places the cursor between the two blocks where you can enter your thoughts on the code above and below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should expand the templates to include the session name in the header, and possible non-Babel text, such as section headings and sub-headings (&lt;code&gt;**&lt;/code&gt;) assuming you want each block in a sub-section...&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-03-23T17:30:27.573" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10241" PostTypeId="1" AcceptedAnswerId="10242" CreationDate="2015-03-23T16:29:44.187" Score="2" ViewCount="185" Body="&lt;p&gt;When I execute a babel src block with &lt;code&gt;add-to-list&lt;/code&gt; function like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp &#xA;(add-to-list 'org-src-lang-modes (quote (&quot;plantuml&quot; . fundamental)))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I will get this error message: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;executing Emacs-Lisp code block...&#xA;orgtbl-format-line: Wrong type argument: listp, fundamental&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The syntax is correct, as I can evaluate it on &lt;code&gt;.emacs&lt;/code&gt; buffer without a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The org-mode version is 8.2.10 if it helps.  &lt;/p&gt;&#xA;" OwnerUserId="4044" OwnerDisplayName="yi.tang.uni" LastEditorUserId="50" LastEditDate="2015-03-23T17:33:51.207" LastActivityDate="2015-03-23T17:49:25.160" Title="Problem with add-to-list in babel src block" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10242" PostTypeId="2" ParentId="10241" CreationDate="2015-03-23T17:49:25.160" Score="3" Body="&lt;p&gt;When evaluating the code, Org-mode takes the return value of &lt;code&gt;add-to-list&lt;/code&gt;, which is the list with the new element added, and tries to display it.  Lists are displayed as tables, but apparently it doesn't like symbols in the list.  (I'm inclined to think that this is a bug in Org-mode.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can work around it by asking Org-mode not to display the return value of the code block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results silent&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-03-23T17:49:25.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10243" PostTypeId="1" CreationDate="2015-03-23T18:21:55.457" Score="0" ViewCount="63" Body="&lt;p&gt;I do not curate my &lt;code&gt;.emacs&lt;/code&gt; and packages very effectively. Right now I have an issue where, when working in the Ruby, I type &lt;code&gt;def[space]&lt;/code&gt; and then magically &lt;em&gt;two&lt;/em&gt; &lt;code&gt;end&lt;/code&gt; lines appear. Obviously I have managed to turn on two different autocompletion systems and they are both activating. Is it ruby-mode? rails-mode? autocomplete mode? Something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure I can hunt down this specific case, but my general issue is that it's hard to tell what emacs features are turned on and which are activating at any given time. There's so much stuff in my mode line that I don't know where to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you diagnose such issues? Are there tools for taming an emacs config gone wild?&lt;/p&gt;&#xA;" OwnerUserId="62" LastActivityDate="2015-03-23T18:21:55.457" Title="What completion modes am I using?" Tags="|debugging|minor-mode|auto-complete-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10244" PostTypeId="1" AcceptedAnswerId="10270" CreationDate="2015-03-23T19:02:43.627" Score="8" ViewCount="1997" Body="&lt;p&gt;I have some elips &lt;code&gt;*.el&lt;/code&gt; file in my &lt;code&gt;~/.emacs.d/gman/&lt;/code&gt; folder, e.g. &lt;code&gt;smart-inputp-methods.el&lt;/code&gt;. This folder is added to my load path at the beginning of &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/gman&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Leter I importing it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'smart-input-methods)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Functions defined there successfully loaded, however &lt;strong&gt;Flycheck&lt;/strong&gt; reports me error on that line, that file could not be found:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Cannot open load file: no such file or directory, smart-input-methods&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is quite annoying, how can I fix that?&lt;/p&gt;&#xA;" OwnerUserId="6844" LastEditorUserId="6844" LastEditDate="2015-03-23T19:24:04.863" LastActivityDate="2015-03-24T15:48:29.623" Title="Flycheck could not find file under load-path" Tags="|init-file|flycheck|load-path|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10245" PostTypeId="1" AcceptedAnswerId="10276" CreationDate="2015-03-23T19:06:00.510" Score="8" ViewCount="3210" Body="&lt;p&gt;I'm wondering if there is a good method of counting subheadings of a particular heading in org-mode.  For example, with the following, return &lt;code&gt;4&lt;/code&gt; (non-recursively) or &lt;code&gt;7&lt;/code&gt; (recursively).  Note that I don't want to use keywords (ex: &lt;code&gt;TODO&lt;/code&gt;) and &lt;code&gt;[/]&lt;/code&gt; syntax (&lt;a href=&quot;https://stackoverflow.com/questions/13372550/orgmode-show-number-of-children-under-heading&quot;&gt;https://stackoverflow.com/questions/13372550/orgmode-show-number-of-children-under-heading&lt;/a&gt;); I just want to calculate it programmatically using elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vFPJl.png&quot; alt=&quot;sample org-mode outline&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping that I'm just missing a useful org function.  Otherwise I may resort to counting results of a regex search using the outline patterns of levels &lt;code&gt;^\\*{n}&lt;/code&gt; bounded by the heading and &lt;code&gt;org-forward-heading-same-level&lt;/code&gt;.  This is messy and I'd like to do it the &quot;org way&quot; in case org mode ever ignores heading patterns found in source blocks or edge cases I haven't considered.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-03-24T23:23:06.500" Title="Counting sub-headings in org-mode using elisp" Tags="|org-mode|elisp|outline|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10246" PostTypeId="1" AcceptedAnswerId="10291" CreationDate="2015-03-23T19:26:56.783" Score="12" ViewCount="4045" Body="&lt;p&gt;My Emacs always prompts me if it should trust selected colour theme or not. I always answer &lt;code&gt;y&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; to trust and remember my choice. I'm loading colour theme manually:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(load-theme 'my-favourite-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suppose this is because easy customizations are placed below colour theme loading. Is it some way to fix it? Or should I just delegate colour theme loading to easy customizations too?&lt;/p&gt;&#xA;" OwnerUserId="6844" LastActivityDate="2021-05-05T09:00:01.207" Title="Emacs always ask to trust colour theme at startup" Tags="|init-file|themes|customize|customization|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10247" PostTypeId="2" ParentId="10245" CreationDate="2015-03-23T21:21:44.903" Score="4" Body="&lt;p&gt;Here's a function that will count the subheadings (which works more generally for &lt;code&gt;outline-mode&lt;/code&gt;, and therefore for &lt;code&gt;org-mode&lt;/code&gt;, which is built on top of &lt;code&gt;outline-mode&lt;/code&gt;).  You could, presumably, write a more elegant version, but this one works fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun outline-count-subheadings ()&#xA;  &quot;Count the number of subheadings below the current heading.&quot;&#xA;  (let ((sum 0)&#xA;        (end (save-excursion&#xA;               (ignore-errors&#xA;                 (outline-end-of-subtree)&#xA;                 (point)))))&#xA;    (when end&#xA;      (save-excursion &#xA;        (while (and (outline-next-heading)&#xA;                    (&amp;lt; (point) end)&#xA;                    (setf sum (1+ sum))))&#xA;        sum))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-03-23T21:21:44.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10248" PostTypeId="2" ParentId="3895" CreationDate="2015-03-24T01:34:58.703" Score="11" Body="&lt;p&gt;Finally, I abandoned relying on the current directory as it was too intrusive and other things like ido where ending being affected...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I use added my build directory to &lt;code&gt;compilation-search-path&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'compilation-search-path &quot;/path/to/build&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Found on this question: &lt;a href=&quot;https://stackoverflow.com/questions/10451242/how-to-adjust-the-path-that-emacs-compile-goto-error-gets-from-the-compilation&quot;&gt;How to adjust the path that Emacs' compile-goto-error gets from the compilation buffer?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question also explains that the directory matcher can change the directory automatically if some particular strings are emitted:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Entering directory `...'&#xA;... &#xA;Leaving directory `...'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is also customizable apparently.&lt;/p&gt;&#xA;" OwnerUserId="2709" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-03-24T01:34:58.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10249" PostTypeId="2" ParentId="10199" CreationDate="2015-03-24T01:37:49.000" Score="0" Body="&lt;p&gt;One way is to swap the current line with the next one, use &lt;code&gt;indent-relative&lt;/code&gt; and then swap back:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun indent-relative-below ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (next-line)&#xA;    (transpose-lines 1)&#xA;    (previous-line)&#xA;    (indent-relative)&#xA;    (transpose-lines 1)&#xA;    )&#xA;  (end-of-line)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-03-24T01:37:49.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10251" PostTypeId="1" CreationDate="2015-03-24T05:39:05.507" Score="1" ViewCount="552" Body="&lt;p&gt;I have both aquamacs and emacs (installed from &lt;code&gt;brew&lt;/code&gt;) on my macbookpro. I intend to learn to use aquamacs as my main editor/IDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;C-h v user-init-file&lt;/code&gt; in aquamacs, it reports the value as &lt;code&gt;~/.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I do a &lt;code&gt;ls -a&lt;/code&gt; I cannot find any  &lt;code&gt;~/.emacs&lt;/code&gt; in &lt;code&gt;$HOME&lt;/code&gt;. Instead I can see there is a &lt;code&gt;.emacs.d&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to understand how does it work. Does emacs and/or aquamacs requires the presence of &lt;code&gt;~/.emacs&lt;/code&gt; strictly? Can I just drop some &lt;code&gt;.el&lt;/code&gt; files in ~/.emacs.d and expect emacs/aquamacs to pick them up automatically? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to enable projectile in aqauamcs. I have already downloaded it from MELPA via cask  in &lt;code&gt;.cask/24.4.1&lt;/code&gt;, but I am at loss about how to enable projectile in aqacmacs.&lt;/p&gt;&#xA;" OwnerUserId="169" LastEditorUserId="50" LastEditDate="2015-03-24T19:17:17.223" LastActivityDate="2015-03-24T19:17:17.223" Title="Do I still need to create a .emacs file?" Tags="|init-file|aquamacs|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10252" PostTypeId="1" AcceptedAnswerId="10253" CreationDate="2015-03-24T06:08:47.850" Score="0" ViewCount="784" Body="&lt;p&gt;I have trouble to understand how to get projectile to work in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I first started I am under the impression that I should use package manager like &lt;code&gt;cask&lt;/code&gt; to download packages from ELPA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did that and I have the &lt;code&gt;CASK&lt;/code&gt; file and &lt;code&gt;~/.cask&lt;/code&gt; directory created. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I check the projectile website about how to activate it, I do not get much of information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It simply says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Installation&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The recommended way to install Projectile is via package.el.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think I am confused at this point. Do I need both cask and package.el to manage the packages? In my situation what is the best way to enable projectile?&lt;/p&gt;&#xA;" OwnerUserId="169" LastActivityDate="2015-03-24T06:31:22.067" Title="How do cask, package.el and projectile work together?" Tags="|package|emacs24.4|cask|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10253" PostTypeId="2" ParentId="10252" CreationDate="2015-03-24T06:26:04.740" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://wikemacs.org/wiki/Package.el&quot; rel=&quot;nofollow&quot;&gt;Package.el&lt;/a&gt; is a builtin package manager that can be used to install emacs packages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cask.readthedocs.org/en/latest/guide/introduction.html#introduction-why-cask&quot; rel=&quot;nofollow&quot;&gt;Cask&lt;/a&gt; is an Emacs Lisp project management tool, similar to Maven or Leiningen. It aims to control and automate the entire life cycle of an Emacs Lisp package, including dependency management, packaging, distribution and testing. You can use Cask to manage your emacs your emacs packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your emacs configuration, modifiy your init file and add: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cask &quot;/the/complete/path/to/your/cask.el/file/&quot;)&#xA;(cask-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inside the &lt;a href=&quot;http://cask.readthedocs.org/en/latest/guide/usage.html&quot; rel=&quot;nofollow&quot;&gt;Cask&lt;/a&gt; file, write the packages you want to be installed, example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(source &quot;melpa&quot; &quot;http://melpa.milkbox.net/packages/&quot;)&#xA;(source &quot;gnu&quot; &quot;http://elpa.gnu.org/packages/&quot;)&#xA;(source &quot;marmalade&quot; &quot;http://marmalade-repo.org/packages/&quot;)&#xA;&#xA;(depends-on &quot;ac-js2&quot;)&#xA;(depends-on &quot;adaptive-wrap&quot;)&#xA;(depends-on &quot;ag&quot;) &#xA;(depends-on &quot;bind-key&quot;)&#xA;(depends-on &quot;cask&quot;)&#xA;(depends-on &quot;dash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then ask Cask to install those emacs packages for you with: &lt;code&gt;cask install&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-03-24T06:31:22.067" LastActivityDate="2015-03-24T06:31:22.067" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10254" PostTypeId="1" AcceptedAnswerId="10259" CreationDate="2015-03-24T07:32:30.570" Score="7" ViewCount="2853" Body="&lt;p&gt;I often want to quickly mark everything from &lt;code&gt;point&lt;/code&gt; to the end of line, leaving &lt;code&gt;point&lt;/code&gt; at the same place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to write simple function for that purpose:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mark-from-point-to-end-of-line ()&#xA;  &quot;Marks everything from point to end of line&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (progn&#xA;      (set-mark-command nil)&#xA;      (move-end-of-line nil)&#xA;      (set-mark-command nil)&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it behaves not as expected, e.g. if you place point over &lt;code&gt;m&lt;/code&gt; in line &lt;code&gt;(move-end-of-line nil)&lt;/code&gt; and execute this command this will mark everything from beginning of buffer to point. I guess this is somehow related to &lt;code&gt;save-excursion&lt;/code&gt; function, but can't be certain. How should I fix that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Sorry for question title, don't know how to name it better.&lt;/p&gt;&#xA;" OwnerUserId="6844" LastEditorUserId="105" LastEditDate="2015-04-10T04:01:31.927" LastActivityDate="2023-01-06T23:12:19.320" Title="select text to end of line, without moving point" Tags="|mark|region|save-excursion|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10256" PostTypeId="1" CreationDate="2015-03-24T11:45:17.993" Score="2" ViewCount="362" Body="&lt;p&gt;In addition to monitoring how much time I spend on a task, I'd also like to note what's going on in that time block. It'd be useful to have it appear in the clocktable, or some other means so that I can graph this column against the time. Is this in any way possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: for example, I want to rate each time block, on scale 1 to 10, how much work actually gets done, and I want to be able to graph this quality vs time.&lt;/p&gt;&#xA;" OwnerUserId="6858" LastEditorUserId="6858" LastEditDate="2015-03-25T02:54:24.140" LastActivityDate="2015-03-25T05:02:40.920" Title="Adding graphable note to org-mode clock" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10257" PostTypeId="1" CreationDate="2015-03-24T11:58:06.890" Score="1" ViewCount="101" Body="&lt;p&gt;I am trying to simplify user input of Pod formatting sequences in &lt;code&gt;cperl-mode&lt;/code&gt;. For example, if you type &lt;code&gt;C&amp;lt;hello&amp;gt;&lt;/code&gt;, &lt;code&gt;C&amp;lt;&amp;gt;&lt;/code&gt; is a Pod formatting sequence for entering code, similar to the use of backticks in Markdown. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is that the user should only have to type &lt;code&gt;C&amp;lt;&lt;/code&gt; and then Emacs will ask for the code text and add the ending &lt;code&gt;&amp;gt;&lt;/code&gt; followed by as space automatically. Here is an example; for simplicity I have not added the function to &lt;code&gt;cperl-mode-hook&lt;/code&gt; yet, so you can test this by doing &lt;code&gt;emacs -Q -l init.el&lt;/code&gt;, where &lt;code&gt;init.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-perl-pod-format-start ()&#xA;  &quot;Simplify entering of Pod formatting sequences.&quot;&#xA;  (interactive)&#xA;  (let ((char (preceding-char)))&#xA;    (insert &quot;&amp;lt;&quot;)&#xA;    (when (or&#xA;           (char-equal char ?C)&#xA;           (char-equal char ?I)&#xA;           (char-equal char ?B))&#xA;      (insert (read-string &quot;Pod formatting code: &quot;))&#xA;      (insert &quot;&amp;gt; &quot;))))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;&quot;) #'my-perl-pod-format-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work fine, but there is at least one drawback: the flow of writing is interrupted, since as soon as the user type the &lt;code&gt;&amp;lt;&lt;/code&gt; the focus is moved to the minibuffer. So I wondered, is it possible to do this input (similar to &lt;code&gt;read-string&lt;/code&gt;) at the current cursor position (for example like in &lt;code&gt;auto-complete-mode&lt;/code&gt;) instead of in the minibuffer?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-03-24T11:58:06.890" Title="Read string at current cursor position instead of in minibuffer" Tags="|input-method|perl|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10258" PostTypeId="2" ParentId="10254" CreationDate="2015-03-24T12:02:00.267" Score="1" Body="&lt;p&gt;I knew, I'll need this function someday...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mark-line (&amp;amp;optional arg allow-extend)&#xA;  &quot;Set mark ARG lines away from point.&#xA;&#xA;The place mark goes is the same place \\[forward-line] would move&#xA;to with the same argument.  Interactively, if this command is&#xA;repeated or (in Transient Mark mode) if the mark is active, it&#xA;marks the next ARG lines after the ones already marked.&quot;&#xA;  (interactive &quot;P\np&quot;)&#xA;  (cond ((and allow-extend&#xA;              (or (and (eq last-command this-command) (mark t))&#xA;                  (region-active-p)))&#xA;         (setq arg (if arg (prefix-numeric-value arg)&#xA;                     (if (&amp;lt; (mark) (point)) -1 1)))&#xA;         (set-mark&#xA;          (save-excursion&#xA;            (goto-char (mark))&#xA;            (forward-line arg)&#xA;            (point))))&#xA;        (t&#xA;         (push-mark&#xA;          (save-excursion&#xA;            (forward-line (prefix-numeric-value arg))&#xA;            (point))&#xA;          nil t))))&#xA;&#xA;(global-set-key (kbd &quot;M-#&quot;) 'mark-line)              &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-03-24T12:07:02.523" LastActivityDate="2015-03-24T12:07:02.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10259" PostTypeId="2" ParentId="10254" CreationDate="2015-03-24T12:13:06.307" Score="11" Body="&lt;p&gt;Save-excursion restores point AND mark (as of emacs 24.4), so it is no help for you here.&#xA;You could save the point manually with this idiom:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((pos (point)))&#xA;  ...&#xA;  (goto-char pos))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, in your case it's better to just set the mark at the end of the line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mark-from-point-to-end-of-line ()&#xA;  &quot;Marks everything from point to end of line&quot;&#xA;  (interactive)&#xA;  (set-mark (line-end-position))&#xA;  (activate-mark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: In the current development version, save-excursion no longer restores the mark.&lt;/p&gt;&#xA;" OwnerUserId="2241" LastEditorUserId="2241" LastEditDate="2015-03-31T00:58:03.603" LastActivityDate="2015-03-31T00:58:03.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10260" PostTypeId="1" CreationDate="2015-03-24T12:25:43.363" Score="1" ViewCount="1095" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs site&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The current stable release is 24.4 (released October 20, 2014; see also dates of older releases). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have installed it on my Ubuntu 14.04, by downloading the source from the emacs site and compiling it. But I used &lt;code&gt;checkinstall&lt;/code&gt; and &lt;code&gt;dpkg&lt;/code&gt; instead of &lt;code&gt;make install&lt;/code&gt;, so dpkg knows about it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now Ubuntu software update asks me if I want to update emacs and other emacs packages, if I am not misunderstood, (also See the following list and the screenshots below).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Common facilities for all emacsen (Changes for emacsen-common versions: Installed version: None. Avaliable version: 2.0.7)&lt;/li&gt;&#xA;&lt;li&gt;Emacs (Changes for emacs versions: Installed version: 24.4-1; Available version: 45.0ubuntu1)&lt;/li&gt;&#xA;&lt;li&gt;GNU Emacs common non-DFSG items, including the core documentation (Changes for emacs24-common-non-dfsg versions: Installed version: None; Available version: 24.3+1-1)&lt;/li&gt;&#xA;&lt;li&gt;GNU Emacs editor (with GTK+ user interface) (Changes for emacs24 versions: Installed version: None; Available version: 24.3+1-2ubuntu1)&lt;/li&gt;&#xA;&lt;li&gt;GNU Emacs editor's shared, architecture dependent files (Changes for emacs24-bin-common versions: Installed version: None; Available version: 24.3+1-2ubuntu1)&lt;/li&gt;&#xA;&lt;li&gt;GNU Emacs editor's shared, architecture independent infrastructure (Changes for emacs24-common versions: Installed version: None; Available version: 24.3+1-2ubuntu1)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Q:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why does Ubuntu software update suggest me another version of emacs,&#xA;if my installed one is the latest?&lt;/li&gt;&#xA;&lt;li&gt;What is the difference between the second item (Emacs), the fourth item (GNU Emacs editor (with GTK+ user interface))  in the&#xA;update list, and my installed Emacs 24.4?&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Should I update the emacs, or install the emacs packages, or&#xA;neither?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QcK9a.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/dJy0c.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/TfwiA.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Xi0dI.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/QFo36.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/xwTAJ.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/uavnT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2015-03-24T12:53:06.007" LastActivityDate="2015-03-29T11:55:29.357" Title="Should I update or install emacs and related packages?" Tags="|ubuntu|install|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10261" PostTypeId="1" AcceptedAnswerId="10262" CreationDate="2015-03-24T12:41:57.410" Score="1" ViewCount="816" Body="&lt;p&gt;How can I convert a string containing an escaped unicode character to a character?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(string-to-char &quot;\\u03C0&quot;)&lt;/code&gt; evaluates to &lt;code&gt;92&lt;/code&gt; which is the character value of the first &lt;code&gt;\&lt;/code&gt; in the string.  I somehow need to modify the string so I can call &lt;code&gt;(string-to-char &quot;\u03C0&quot;)&lt;/code&gt; and get &lt;code&gt;960&lt;/code&gt;.  &lt;code&gt;(substring &quot;\\u03C0&quot; 1)&lt;/code&gt; evaluates to &lt;code&gt;&quot;u03c0&quot;&lt;/code&gt; which isn't quite right either!&lt;/p&gt;&#xA;" OwnerUserId="6859" LastEditorUserId="6859" LastEditDate="2015-03-24T12:50:34.593" LastActivityDate="2015-03-24T13:13:15.190" Title="Convert escaped unicode character in string to character" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10262" PostTypeId="2" ParentId="10261" CreationDate="2015-03-24T12:53:27.037" Score="1" Body="&lt;p&gt;Extract the part after &lt;code&gt;\u&lt;/code&gt; with &lt;code&gt;substring&lt;/code&gt;, and convert it to a number using base 16:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (string-to-number (substring &quot;\\u03C0&quot; 2) 16)&#xA;960 (#o1700, #x3c0, ?π)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-03-24T12:53:27.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10263" PostTypeId="2" ParentId="10261" CreationDate="2015-03-24T13:01:15.930" Score="2" Body="&lt;p&gt;14 characters shorter than legoscia's suggestion :)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read (format &quot;?%s&quot; &quot;\\u03C0&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-03-24T13:13:15.190" LastActivityDate="2015-03-24T13:13:15.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10264" PostTypeId="1" CreationDate="2015-03-24T13:56:29.997" Score="0" ViewCount="260" Body="&lt;p&gt;I typesetting a matrix with 12 columns in a latex block in org-mode and discovered I couldn't do it by default. Reading this &lt;a href=&quot;https://tex.stackexchange.com/questions/95162/how-to-create-a-matrix-with-20-columns-in-latex&quot;&gt;question&lt;/a&gt; on the &lt;code&gt;TeX&lt;/code&gt; stack exchange site made me think that I could just place &lt;code&gt;\setcounter{MaxMatrixCols}{20}&lt;/code&gt; as the first command in the block. This didn't work. However, it does export correctly. Is there a way to place this option in my &lt;code&gt;init.el&lt;/code&gt; so I don't have to remember this every time?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN_LATEX&#xA;  \setcounter{MaxMatrixCols}{20}&#xA;  \begin{equation*}&#xA;  \mathbf{X} = &#xA;  \begin{pmatrix}&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;  \end{pmatrix}&#xA;  \end{equation*}&#xA;  #+END_LATEX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="55" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2015-03-24T16:22:45.780" Title="`\setcounter` in latex block to typeset matrices with more than 10 columns" Tags="|org-mode|latex|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10265" PostTypeId="2" ParentId="5330" CreationDate="2015-03-24T14:26:18.897" Score="3" Body="&lt;p&gt;As Tom said, putting a display property on the newlines will kind of work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is to  figure out which lines to wrap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example to get you started:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((eol-regexp &quot;[[:graph:]] ?\\(\n\\)[^\t\n ]&quot;))&#xA;  (font-lock-add-keywords nil&#xA;   `((,eol-regexp 1 '(face default display &quot; &quot;)))))&#xA;&#xA;(visual-line-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will &quot;remove&quot; newlines if it is preceded by graphical characters and the next line is not indented or empty. You will have to experiment to find something that works for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some more explanations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;font-lock-add-keywords&lt;/code&gt; adds a list of rules to font locking (so font lock must be enabled. The first argument can be a mode (e.g. &lt;code&gt;text-mode&lt;/code&gt;); in our case it is nil, which means add the rule only for the current buffer.&lt;/li&gt;&#xA;&lt;li&gt;Our &quot;rule&quot; is &lt;code&gt;(,eol-regexp 1 '(face default display &quot; &quot;))&lt;/code&gt;. The first element is the regular expression we built earlier; the second is the subexpression we are interested in; the third is the &quot;face&quot; we want to apply.&lt;/li&gt;&#xA;&lt;li&gt;While using a face for the newlines is of no use for us, we can also add text properties. So we use the default face and than add a display property witch replaces the substring 1 (i.e. the newline) with a space.&lt;/li&gt;&#xA;&lt;li&gt;If you shoot yourself in the foot, delete the buffer or remove the keyword with &lt;code&gt;font-lock-remove-keywords&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You might also want to add &lt;code&gt;display&lt;/code&gt; to &lt;code&gt;font-lock-extra-managed-props&lt;/code&gt; (I have not tried this).&lt;/li&gt;&#xA;&lt;li&gt;The tricky part is to get the regexp right. &quot;\(\n\)[^\n]&quot; would match any newline that is not immediatly followed by another one. &quot;.\{30,\}\(\n\)&quot; would only match newlines preceeded by at least 30 characters. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2241" LastEditorUserId="2241" LastEditDate="2015-03-24T20:59:20.790" LastActivityDate="2015-03-24T20:59:20.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10266" PostTypeId="2" ParentId="10260" CreationDate="2015-03-24T14:29:40.220" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It looks like Ubuntu is using it's own numbering system, 45.0ubuntu1 vs 24.4. This may be tricking dpkg into thinking that the Ubuntu version (which appears to be 24.3) is actually newer than your compiled 24.4.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Debian (and thus Ubuntu) provides emacs in a number of different packages, to allow users to stick to a particular version, track the latest release, install only a terminal version etc. I suspect items 2 and 4 on your list are different ways of pointing to the (currently) same files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I prefer to use the official Emacs sources straight from GNU, and ignore the Debian packaging (or the Ubuntu packages, on that system). Debian pulls out some or all of the info files, for political reasons, and I get confused about which packages I need to get the complete install. I also prefer to track the development branch.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However, if you aren't concerned about getting new features as soon as possible, it may be easier to use the Ubuntu packages. The only thing I would recommend strongly against is trying to use a combination of both. Either use the compiled sources, or the Ubuntu packages, but not both together.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-03-24T14:29:40.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10267" PostTypeId="1" CreationDate="2015-03-24T15:25:09.170" Score="1" ViewCount="420" Body="&lt;p&gt;I use Emacs in command-line always on my Ubuntu 14.04 machine. And I use two languages frequently. Bengali/Bangla and English. Problem is when I use Bangla, commands with Ctrl as modifier work fine (e.g. C-x C-s) but with Meta they are not. e.g. M-x is not opening the minibuffer instead Emacs understands it as M-ূ. Is there any way to use Meta like Ctrl?&lt;/p&gt;&#xA;" OwnerUserId="6861" LastEditorUserId="421" LastEditDate="2015-04-19T01:15:49.007" LastActivityDate="2015-04-19T01:15:49.007" Title="Problem with meta key in Emacs" Tags="|terminal-emacs|input-method|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10268" PostTypeId="2" ParentId="9940" CreationDate="2015-03-24T15:31:20.327" Score="1" Body="&lt;p&gt;As I've mentioned in the comments, I highly recommend that people using Emacs on Windows use it through Cygwin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the &lt;code&gt;emacs-w32&lt;/code&gt; package, you'll also get a Windows-native GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the packages &lt;code&gt;openssh&lt;/code&gt;, &lt;code&gt;gnutls&lt;/code&gt;, and &lt;code&gt;inetutils&lt;/code&gt; you'll be able to use TRAMP on Windows transparently, as intended, with no configuration. Fiddling around with plink or trying to combine Windows Emacs with Cygwin (or Cygwin-lite software like msys/mingw) is just asking for a headache. In addition, you can install an up-to-date &lt;code&gt;aspell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll also obviously get the benefit of working in a POSIX environment. If Cygwin doesn't officially package some software that you'd like, try checking &lt;a href=&quot;http://cygwinports.org/&quot; rel=&quot;nofollow&quot;&gt;Cygwin Ports&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If they don't support it either, I've had much success compiling libraries and programs from source. I've even compiled more complex software like GNU Global, LLVM, GDB, and Python 3. (One of the only big things I'm missing is Valgrind, which is impossible to build on Cygwin.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also use &lt;a href=&quot;https://github.com/transcode-open/apt-cyg&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;apt-cyg&lt;/code&gt;&lt;/a&gt; as a command line package manager.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-03-24T15:31:20.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10269" PostTypeId="2" ParentId="10267" CreationDate="2015-03-24T15:36:02.847" Score="1" Body="&lt;p&gt;As a workaround, you can use &lt;code&gt;ESC&lt;/code&gt; as a prefix in the same manner that you would use meta as a modifier, like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ESC x&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you don't have to hold escape down, you can press the two keys sequentially. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do things like &lt;code&gt;ESC C-e&lt;/code&gt; to simulate &lt;code&gt;C-M-e&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-03-24T15:36:02.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10270" PostTypeId="2" ParentId="10244" CreationDate="2015-03-24T15:48:29.623" Score="14" Body="&lt;p&gt;Flycheck does simply not use your &lt;code&gt;load-path&lt;/code&gt; for checking.  By default, it always checks files in a clean environment, using only the built-in &lt;code&gt;load-path&lt;/code&gt; of Emacs.  IOW, Flycheck always checks in &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make your custom code visible to Flycheck, you can either explicitly add all directories to &lt;code&gt;flycheck-emacs-lisp-load-path&lt;/code&gt; as well, or set &lt;code&gt;flycheck-emacs-lisp-load-path&lt;/code&gt; to &lt;code&gt;inherit&lt;/code&gt;.  In the latter case, Flycheck will automatically use your entire &lt;code&gt;load-path&lt;/code&gt; when checking files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you edit &lt;code&gt;user-init-file&lt;/code&gt; or files inside &lt;code&gt;user-emacs-directory&lt;/code&gt;, Flycheck automatically adds ELPA packages to &lt;code&gt;load-path&lt;/code&gt;, though.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-03-24T15:48:29.623" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10271" PostTypeId="1" AcceptedAnswerId="10273" CreationDate="2015-03-24T15:57:45.943" Score="11" ViewCount="1188" Body="&lt;p&gt;Is there any way to bind &lt;code&gt;C-[&lt;/code&gt; to something and not have all &lt;code&gt;M-&lt;/code&gt; (Meta) bindings messed up? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not &lt;a href=&quot;https://emacs.stackexchange.com/questions/7832/how-to-bind-c-for-real&quot;&gt;the first time&lt;/a&gt; this question comes up. Unfortunately, the only solution offered in the previous thread is &lt;strong&gt;a)&lt;/strong&gt; Linux specific, &lt;strong&gt;b)&lt;/strong&gt; requires an external tool (again Linux specific) that has nothing to do with Emacs. In the same vein I could have used something like &lt;strong&gt;Karabiner&lt;/strong&gt; on a OS X to steal the &lt;code&gt;C-[&lt;/code&gt; sequence before Emacs ever gets it but this is clunky and expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that it is Emacs that insists on translating &lt;code&gt;C-[&lt;/code&gt; to &lt;code&gt;ESC&lt;/code&gt;, &lt;code&gt;C-i&lt;/code&gt; to &lt;code&gt;TAB&lt;/code&gt; and probably others I would very much like to break these relationships and get precious key sequences back. Recently I ran full speed into this problem and &lt;a href=&quot;https://github.com/Fuco1/smartparens/issues/447&quot; rel=&quot;nofollow noreferrer&quot;&gt;blamed&lt;/a&gt; quiet innocent &lt;strong&gt;smartparens&lt;/strong&gt; mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible solution that involved &lt;code&gt;function-key-map&lt;/code&gt; and &lt;code&gt;key-translation-map&lt;/code&gt; was &lt;a href=&quot;https://superuser.com/questions/173851/linux-remap-ctrl-key&quot;&gt;discussed here&lt;/a&gt; but alas it either no longer works or did not work in the first place (or I'm doing something wrong). I think it was going in the right direction though. &lt;/p&gt;&#xA;" OwnerUserId="509" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-08-30T15:17:43.977" Title="How to bind C-[ for real (seriously for real this time)" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10272" PostTypeId="1" CreationDate="2015-03-24T16:19:50.810" Score="4" ViewCount="713" Body="&lt;p&gt;A very simple Makefile:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;all:&#xA;        gcc -o hello hello.c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I already set:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'before-save-hook&#xA;      '(lambda ()&#xA;         (delete-trailing-whitespace)&#xA;         ;; indent the whole buffer before-save&#xA;         (when (derived-mode-p 'prog-mode)&#xA;           (indent-region (point-min) (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;init.el&lt;/code&gt;, so if I &lt;code&gt;C-x C-s&lt;/code&gt; in this Makefile file, it will become:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;all:&#xA;gcc -o hello hello.c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can make Emacs recognize that the lines under &lt;code&gt;:&lt;/code&gt; symbol should be indented with one TAB?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW: Typing TAB in the &lt;code&gt;gcc...&lt;/code&gt; line will keep inserting tabs, is there a way that typing TAB indents this line like doing it in C code and TAB again won't do anything like inserting another tab)?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="675" LastEditDate="2015-05-12T21:25:12.273" LastActivityDate="2015-05-12T21:25:12.273" Title="How to make indent-region keep the TAB in Makefile buffer?" Tags="|tabs|makefile-mode|indentation|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10273" PostTypeId="2" ParentId="10271" CreationDate="2015-03-24T16:27:57.923" Score="9" Body="&lt;p&gt;Adapted from &lt;a href=&quot;https://github.com/wasamasa/dotemacs/blob/8503aa99856d2f0142ee205b15f9177eb4886f6e/init.org#c-i&quot; rel=&quot;noreferrer&quot;&gt;my own config&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map [?\C-\[] (kbd &quot;&amp;lt;C-[&amp;gt;&quot;))&#xA;(global-set-key (kbd &quot;&amp;lt;C-[&amp;gt;&quot;) 'butterfly)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will obviously only work in the GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Note that &lt;code&gt;input-decode-map&lt;/code&gt; is terminal-local which means modifying it won't work if you're using &lt;code&gt;emacsclient&lt;/code&gt;, but will do if you're using &lt;code&gt;emacs&lt;/code&gt;. I've fixed the issue in my config by wrapping it in a command operating on a frame and adding it to the &lt;code&gt;after-make-frame-functions&lt;/code&gt; hook.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-03-25T13:05:21.540" LastActivityDate="2015-03-25T13:05:21.540" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10274" PostTypeId="1" CreationDate="2015-03-24T18:02:53.530" Score="2" ViewCount="257" Body="&lt;p&gt;I use C-s to search a pattern in a buffer. Then when I move the cursor, the highlighted matches lose highlight. Can I keep highlights however I move my cursor, or even edit the buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about when I search using regex?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="654" LastEditDate="2015-03-24T18:09:21.660" LastActivityDate="2016-06-13T21:29:23.010" Title="Highlight a pattern in a buffer" Tags="|search|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10275" PostTypeId="2" ParentId="10274" CreationDate="2015-03-24T18:07:36.690" Score="5" Body="&lt;p&gt;There's some built-in highlighting functionality bound to key sequences starting with &lt;code&gt;M-s h&lt;/code&gt;. To see them all, type &lt;code&gt;M-s h C-h&lt;/code&gt; to read about the &lt;code&gt;Global Bindings Starting With M-s h&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specific functionality you want is bound to &lt;code&gt;M-s h r&lt;/code&gt;, &lt;code&gt;highlight-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-03-24T18:07:36.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10276" PostTypeId="2" ParentId="10245" CreationDate="2015-03-24T19:08:46.243" Score="12" Body="&lt;p&gt;The org function you are looking for is &lt;code&gt;org-map-entries&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-map-entries FUNC &amp;amp;optional MATCH SCOPE &amp;amp;rest SKIP)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This calls function for each heading determined by MATCH and SCOPE&#xA;and returns a list of all return values. Thus&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(1-  (length (org-map-entries nil nil 'tree)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns the number of subentries of the heading at point. To get something a little bit more sophisticated, use FUNC:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-number-of-subentries (&amp;amp;optional pos match scope level)&#xA;  &quot;Return number of subentries for entry at POS.&#xA;MATCH and SCOPE are the same as for `org-map-entries', but&#xA;SCOPE defaults to 'tree.&#xA;By default, all subentries are counted; restrict with LEVEL.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (or pos (point)))&#xA;    ;; If we are in the middle ot an entry, use the current heading.&#xA;    (org-back-to-heading t)&#xA;    (let ((maxlevel (when (and level (org-current-level))&#xA;                      (+ level (org-current-level)))))&#xA;      (message &quot;%s subentries&quot;&#xA;               (1- (length&#xA;                    (delq nil&#xA;                          (org-map-entries&#xA;                           (lambda ()&#xA;                             ;; Return true, unless below maxlevel.&#xA;                             (or (not maxlevel)&#xA;                                 (&amp;lt;= (org-current-level) maxlevel)))&#xA;                           match (or scope 'tree)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea here is to call &lt;code&gt;org-map-entries&lt;/code&gt; and have the function return true for any heading, you want to count.&lt;/p&gt;&#xA;" OwnerUserId="2241" LastEditorUserId="2241" LastEditDate="2015-03-24T23:23:06.500" LastActivityDate="2015-03-24T23:23:06.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10277" PostTypeId="1" AcceptedAnswerId="10297" CreationDate="2015-03-24T20:01:27.317" Score="8" ViewCount="2062" Body="&lt;p&gt;How can I make emacs automatically open binary files in hexl-mode? It's probably sufficient to define &quot;binary&quot; as &quot;contains a null byte&quot; (I suppose &lt;a href=&quot;https://github.com/audreyr/binaryornot&quot;&gt;https://github.com/audreyr/binaryornot&lt;/a&gt; could be used if that ends up being an insufficient heuristic). &lt;/p&gt;&#xA;" OwnerUserId="118" LastActivityDate="2021-03-09T18:42:59.783" Title="Make emacs automatically open binary files in hexl-mode" Tags="|hexl-mode|binary|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10278" PostTypeId="1" AcceptedAnswerId="10295" CreationDate="2015-03-25T00:17:38.153" Score="8" ViewCount="1343" Body="&lt;p&gt;In some cases, when delegating work to an external process, it's useful to set a timeout on the command to prevent Emacs from hanging indefinitely.&lt;br&gt;&#xA;Unfortunately, the following does not work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-timeout (1 nil)&#xA;  (call-process &quot;/usr/bin/bash&quot; nil t nil &quot;-c&quot; &quot;sleep 10&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same goes for &lt;code&gt;shell-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to set a timeout on these synchronous processes?&lt;/strong&gt;&lt;br&gt;&#xA;That is, I want the process to be killed automatically if it doesn't&#xA;finish within a certain number of seconds. Is that possible?&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-03-25T12:18:58.307" LastActivityDate="2015-03-25T18:04:15.123" Title="Applying a timeout on call-process/shell-command?" Tags="|shell-command|process|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10279" PostTypeId="2" ParentId="10211" CreationDate="2015-03-25T04:09:07.243" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Yes, what I'm looking for is (something close to) a command that iterates over matched files in the grep buffer and calls query-replace for each.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;OK, I just added command &lt;code&gt;diredp-compilation-files-other-window&lt;/code&gt; to &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;, which can help with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You use it in a compilation buffer (any buffer, such as &lt;code&gt;*grep*&lt;/code&gt;, that is in a mode derived from `compilation-mode').&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It prompts you for the name of a new Dired buffer, and it opens Dired on all of the files corresponding to the compilation hits, regardless of what directories they are in.  IOW, the files can be in different directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that Dired buffer, you can then:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;t&lt;/code&gt; to mark all of the files.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;Q&lt;/code&gt; to query-replace across all of the files.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;Q&lt;/code&gt; is standard Dired command &lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative to using &lt;code&gt;t&lt;/code&gt; to mark all of the files, with &lt;strong&gt;Dired+&lt;/strong&gt; you can just use &lt;code&gt;C-u C-u Q&lt;/code&gt; to act on all files (without bothering to mark them).  With &lt;strong&gt;Dired+&lt;/strong&gt;, most commands that operate on the marked files let you use &lt;em&gt;multiple &lt;code&gt;C-u&lt;/code&gt; to act on&lt;/em&gt; &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;files&lt;/em&gt;, ignoring marks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;code&gt;Q&lt;/code&gt; you can use &lt;code&gt;A&lt;/code&gt; to  search the files, &lt;code&gt;D&lt;/code&gt; to delete them, &lt;code&gt;P&lt;/code&gt; to print, &lt;code&gt;Z&lt;/code&gt; to compress, &lt;code&gt;!&lt;/code&gt; to run a shell command, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you hit &lt;code&gt;?&lt;/code&gt; during query-replace you will see this information in buffer &lt;code&gt;*Help*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Query replacing regexp Sun with mooN.&#xA;&#xA;Type Space or `y' to replace one match, Delete or `n' to skip to next,&#xA;RET or `q' to exit, Period to replace one match and exit,&#xA;Comma to replace but not move point immediately,&#xA;C-r to enter recursive edit (C-M-c to get out again),&#xA;C-w to delete match and recursive edit,&#xA;C-l to clear the screen, redisplay, and offer same replacement again,&#xA;! to replace all remaining matches in this buffer with no more questions,&#xA;^ to move point back to previous match,&#xA;E to edit the replacement string.&#xA;In multi-buffer replacements type `Y' to replace all remaining&#xA;matches in all remaining buffers with no more questions,&#xA;`N' to skip to the next buffer without replacing remaining matches&#xA;in the current buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-29T14:42:16.183" LastActivityDate="2015-03-29T14:42:16.183" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10281" PostTypeId="2" ParentId="10256" CreationDate="2015-03-25T05:02:40.920" Score="2" Body="&lt;p&gt;If you are looking to use existing features instead of coding your own elisp function, you might have better luck with column view then clock reports. Here is an example of an org-mode file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Work&#xA; :PROPERTIES:&#xA; :COLUMNS: %50ITEM %Quality %CLOCKSUM&#xA; :END:&#xA; ** A long day of hard work&#xA; :PROPERTIES:&#xA; :Quality:  10&#xA; :END:&#xA;    CLOCK: [2015-03-24 Tue 07:20]--[2015-03-24 Tue 21:20] =&amp;gt; 14:00&#xA; ** A few minutes of messing around&#xA; :PROPERTIES:&#xA; :Quality:  1&#xA; :END:                   &#xA;    CLOCK: [2015-03-25 Wed 11:10]--[2015-03-25 Wed 11:20] =&amp;gt;  0:10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can sort by &lt;code&gt;Quality&lt;/code&gt; (&lt;kbd&gt;C-c ^&lt;/kbd&gt; &lt;kbd&gt;r&lt;/kbd&gt;) first, then enter column view with  &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt;. &lt;kbd&gt;Tab&lt;/kbd&gt; to fold and you can get a result like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PYksF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally, if you want to extend this further and literally &quot;graph&quot; your work, that should be possible by adding &lt;a href=&quot;http://orgmode.org/manual/Capturing-column-view.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;a &lt;code&gt;columnview&lt;/code&gt; dynamic block&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-25T05:02:40.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10282" PostTypeId="1" AcceptedAnswerId="10283" CreationDate="2015-03-25T05:52:11.910" Score="0" ViewCount="98" Body="&lt;p&gt;Currently, running &lt;code&gt;vc-update&lt;/code&gt; in my Emacs runs &lt;code&gt;git pull&lt;/code&gt;. Is there a way to customize it so that it runs something different like &lt;code&gt;git pull --prune&lt;/code&gt;? Is it even advisable to do that?&lt;/p&gt;&#xA;" OwnerUserId="6753" LastEditorUserId="504" LastEditDate="2015-03-25T07:45:51.853" LastActivityDate="2015-03-25T07:45:51.853" Title="Is there a way to customize 'vc-update'?" Tags="|git|version-control|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10283" PostTypeId="2" ParentId="10282" CreationDate="2015-03-25T07:36:36.153" Score="2" Body="&lt;p&gt;Looking at the source of &lt;code&gt;vc-update&lt;/code&gt; and &lt;code&gt;vc-git-pull&lt;/code&gt; (the function that is called by &lt;code&gt;vc-update&lt;/code&gt; when using a &lt;code&gt;git&lt;/code&gt; backend), there doesn't seem to be a straightforward way to &lt;em&gt;permanently&lt;/em&gt; customize the pull command that gets run (short of redefining &lt;code&gt;vc-git-pull&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a quick look at the documentation for &lt;code&gt;vc-update&lt;/code&gt; (via &lt;kbd&gt;C-h f&lt;/kbd&gt; &lt;code&gt;vc-update&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;) tells you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] On a distributed version control system, this runs a &quot;pull&quot;&#xA;  operation to update the current branch, prompting for an argument&#xA;  list if required.  &lt;strong&gt;Optional prefix ARG forces a prompt.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, if you want to alter the pull command that &lt;code&gt;vc-update&lt;/code&gt; uses, just prefix the call with &lt;kbd&gt;C-u&lt;/kbd&gt;. You'll get a prompt that says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Git pull command: git pull&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then append &lt;code&gt;--prune&lt;/code&gt; and hit &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-03-25T07:36:36.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10284" PostTypeId="1" CreationDate="2015-03-25T08:33:32.643" Score="1" ViewCount="581" Body="&lt;p&gt;How can I configure Emacs, such that I am able to compile files remotely on a Windows machine, while Emacs is running under Linux? I am using tramp via the smb method to edit files on the Windows machine, but I could not get remote compilation to work until now.&lt;/p&gt;&#xA;" OwnerUserId="2415" LastActivityDate="2020-03-14T14:54:35.527" Title="How to do remote compile on Windows from Linux" Tags="|compilation|remote|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10285" PostTypeId="1" AcceptedAnswerId="10286" CreationDate="2015-03-25T08:44:56.573" Score="0" ViewCount="206" Body="&lt;p&gt;Following &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html&quot; rel=&quot;nofollow&quot;&gt;this guide&lt;/a&gt;, I have setup an org-mode project &quot;foo&quot; that I want to (frequently) publish using a single keyboard short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have defined&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c C-1&quot;) 'org-publish)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so after typing C-c C-1, I still have to fill the prompt with the specific project I want to publish, here for example &quot;foo&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I setup a shortcut that automatically publishes the project &quot;foo&quot; without additional prompts?&lt;/p&gt;&#xA;" OwnerUserId="338" LastActivityDate="2015-03-25T12:11:33.283" Title="Keyboard shortcut for publishing a specific org-mode project" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10286" PostTypeId="2" ParentId="10285" CreationDate="2015-03-25T09:09:51.177" Score="1" Body="&lt;p&gt;The documentation for &lt;code&gt;org-publish&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-publish PROJECT &amp;amp;optional FORCE ASYNC)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Publish PROJECT.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;PROJECT is either a project name, as a string, or a project&#xA;  alist (see `org-publish-project-alist' variable).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c C-1&quot;) &#xA;   (lambda () &#xA;      (interactive) &#xA;      (org-publish &quot;foo&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="874" LastEditorUserId="115" LastEditDate="2015-03-25T12:11:33.283" LastActivityDate="2015-03-25T12:11:33.283" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10287" PostTypeId="2" ParentId="10284" CreationDate="2015-03-25T09:27:02.647" Score="1" Body="&lt;p&gt;Disclaimer: I don't use MS Windows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tramp's smb method is able to start processes on a remote MS Windows machine via winexe. Install it locally on your Linux machine, and adapt &lt;code&gt;tramp-smb-winexe-program&lt;/code&gt; if necessary. See also the Tramp manual &lt;code&gt;(info &quot;(tramp) Remote processes&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-03-25T09:27:02.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10288" PostTypeId="1" AcceptedAnswerId="10305" CreationDate="2015-03-25T10:05:39.643" Score="2" ViewCount="610" Body="&lt;p&gt;In org-mode, &lt;code&gt;C-c C-x C-j&lt;/code&gt; executes &lt;code&gt;org-clock-goto&lt;/code&gt;, jumping the cursor to the currently active or most recently used clock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After using this, I almost always want to go back to the point where I was, often another buffer.  I would expect running &lt;code&gt;org-clock-goto&lt;/code&gt; a second time would get me there, toggling back to where I started. But unfortunately, that doesn't work. &lt;code&gt;org-clock-goto&lt;/code&gt; does only what the name says.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In search of a solution, I came up with a pair of simple elisp functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-clock-goto ()&#xA;  (interactive)&#xA;  (bookmark-set &quot;before goto clock&quot;)&#xA;  (org-clock-goto))&#xA;&#xA;(defun my/org-clock-return ()&#xA;  (interactive)&#xA;  (bookmark-jump &quot;before goto clock&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This only works if I am starting off in a buffer which is a file (not &lt;code&gt;*scratch*&lt;/code&gt; for instance). But more importantly, what I really want is a &lt;em&gt;single&lt;/em&gt; function bound to &lt;code&gt;C-c C-x C-j&lt;/code&gt; that will let me jump between the original point and the last clock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints?&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-03-27T12:46:20.570" Title="How to return to previous point after `org-clock-goto`?" Tags="|org-mode|point|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10289" PostTypeId="1" CreationDate="2015-03-25T11:03:41.817" Score="2" ViewCount="228" Body="&lt;p&gt;I am using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq a-string &quot;\n* Headline \n body&quot;)&#xA;(append-to-file a-string nil &quot;~/tmp.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to write a string to a org file, since the string contains a &lt;code&gt;*&lt;/code&gt;, Emacs ask me to choose which coding system, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Select coding system (default raw-text):&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if there is any way I can remove this prompt and set it to &lt;code&gt;utf-8&lt;/code&gt; automatically? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: I get the following message on Emacs &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These default coding systems were tried to encode &quot;&#xA;* apple &#xA;...&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(prefer-utf-8-unix (215 . 4194274) (216 . 4194176) (217 . 4194196)&#xA;  (460 . 4194274) (461 . 4194176) (462 . 4194196)) (utf-8-unix (215&#xA;  . 4194274) (216 . 4194176) (217 . 4194196) (460 . 4194274) (461&#xA;  . 4194176) (462 . 4194196))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, each of them encountered characters it couldn't encode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;prefer-utf-8-unix cannot encode these: \342 \200 \224 \342 \200 \224 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;utf-8-unix cannot encode these: \342 \200 \224 \342 \200 \224 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Click on a character (or switch to this window by &lt;code&gt;C-x o'&#xA;and select the characters by RET) to jump to the place it appears,&#xA;where&lt;/code&gt;C-u C-x =' will give information about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select one of the safe coding systems listed below,&#xA;or cancel the writing with C-g and edit the buffer&#xA;   to remove or modify the problematic characters,&#xA;or specify any other coding system (and risk losing&#xA;   the problematic characters).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;raw-text no-conversion&lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="4044" LastEditDate="2015-03-28T13:29:12.883" LastActivityDate="2015-03-28T13:29:12.883" Title="coding-system for append-to-file" Tags="|emacs24.4|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10290" PostTypeId="2" ParentId="10289" CreationDate="2015-03-25T11:42:45.883" Score="1" Body="&lt;p&gt;I have this setting:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I get no query for your test code.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-25T11:42:45.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10291" PostTypeId="2" ParentId="10246" CreationDate="2015-03-25T12:22:16.100" Score="10" Body="&lt;p&gt;Your &lt;code&gt;init.el&lt;/code&gt; file probably contains a snippet like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Amongst many other things, this snippet is responsible for saving and&#xA;restoring the &lt;code&gt;custom-safe-themes&lt;/code&gt; variable. Therefore, if this&#xA;happens to be at the end of your init file (as is usually the case)&#xA;you probably added your &lt;code&gt;(load-theme ...)&lt;/code&gt; line above it, which&#xA;explains why Emacs doesn't know about your safe themes during startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply move that snippet to the top of your init-file, and that should solve your problem.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-25T12:22:16.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10292" PostTypeId="2" ParentId="3911" CreationDate="2015-03-25T13:13:30.197" Score="0" Body="&lt;p&gt;Without any configuration: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Ctrl-Alt-DownArrow&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;this selects the apple icon in the menu-bar. From them, move left or right using the right/left keys. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for OSX 10.11.3 but maybe previous versions too? Please confirm!&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cmd-?&lt;/strong&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Out of the box, OS X 10.10 has the shortcut 'Cmd-?' (That is, 'Cmd-Shift-/') to access the Help menu of the menu bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This opens the menu Help and put the cursor in the text box in the 'Search Help' menu item. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, use the arrow keys to access other menus/menu items.&lt;/p&gt;&#xA;" OwnerUserId="6865" LastEditorUserId="6865" LastEditDate="2016-04-13T14:11:30.150" LastActivityDate="2016-04-13T14:11:30.150" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10293" PostTypeId="2" ParentId="5828" CreationDate="2015-03-25T13:29:08.003" Score="3" Body="&lt;p&gt;I think the &lt;code&gt;after-init-hook&lt;/code&gt; solution mentioned in &lt;a href=&quot;https://stackoverflow.com/questions/11127109/emacs-24-package-system-initialization-problems&quot;&gt;this stack overflow answer&lt;/a&gt; should be mentioned:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-packages-init ()&#xA;  (require 'some-great-package))&#xA;&#xA;(add-hook 'after-init-hook 'my-packages-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought this was the way it was supposed to be done, but the other answers provide information on other ways to do it.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-03-25T13:29:08.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10294" PostTypeId="1" AcceptedAnswerId="10340" CreationDate="2015-03-25T14:30:48.877" Score="4" ViewCount="1141" Body="&lt;p&gt;I organize a technical user group and as part of that I use org-mode to schedule the same task tree every month so I remember to do everything for our meetings (food, speakers, projector, etc.) This, to me, sounds like a perfect use case for a capture template. What I'd like to do is specify an event name and date and have the rest of the tasks automatically calculated based on that. Here's the template I have so far (simplified a bit to show what I want to do):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;m&quot; &quot;Meetup&quot; (file+headline &quot;~/org/STLPython.org&quot; &quot;events&quot;)&#xA; &quot;** %^{Event}\n%^{Date}t\n*** Send a reminder to the group\nSCHEDULED: &amp;lt;%&amp;lt;%^{Date}t -5d&amp;gt;&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd get this output, after specifying &quot;Event&quot; and &quot;Date&quot; once each:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Documenting with Sphinx: Beyond Quickstart&#xA;&amp;lt;2015-05-05 Tue&amp;gt;&#xA;*** Send a reminder to the group&#xA;SCHEDULED: &amp;lt;2015-05-30 Thu&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, I get this output, and I have to specify &quot;Date&quot; twice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Documenting with Sphinx: Beyond Quickstart&#xA;&amp;lt;2015-05-05 Tue&amp;gt;&#xA;*** Send a reminder to the group&#xA;Scheduled: &amp;lt;&amp;lt;2015-05-05 Tue&amp;gt; -5d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I guess I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;how can I &quot;reuse&quot; an already captured variable?&lt;/li&gt;&#xA;&lt;li&gt;how can I modify the date? I saw an answer using &lt;code&gt;%(...)&lt;/code&gt; and now can't find it again, and at any rate it didn't seem to accept arguments.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6827" LastActivityDate="2020-11-03T02:32:32.187" Title="Relative dates in org template" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10295" PostTypeId="2" ParentId="10278" CreationDate="2015-03-25T15:33:31.330" Score="5" Body="&lt;p&gt;While &lt;code&gt;call-process&lt;/code&gt; is running, emacs will processing events, &lt;code&gt;with-timeout&lt;/code&gt; will not work without this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The timeout is checked whenever Emacs waits for some kind of external&#xA;  event (such as keyboard input, input from subprocesses, or a certain&#xA;  time); if the program loops without waiting in any way, the timeout&#xA;  will not be detected.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can still use &lt;code&gt;with-timeout&lt;/code&gt; with (semi) synchronous processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will actually use a asynchronous process but will synchrously wait while it is running, Emacs will process events when you run &lt;code&gt;sit-for&lt;/code&gt;, which you can run for 0 seconds. You can then use the timeout-forms argument of &lt;code&gt;with-timeout&lt;/code&gt; to kill the process if it is still running when the timeout fires.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer (get-buffer-create &quot;*my-proc-buffer*&quot;)&#xA;  (let ((proc (start-process &quot;myproc&quot; (current-buffer) &quot;bash&quot; &quot;-c&quot; &quot;sleep 4&quot;))) ;; start an async process&#xA;    (with-timeout (2 (kill-process proc)) ;; on timeout, kill the process&#xA;      (while (process-live-p proc) ;; while process is running&#xA;        (sit-for .05)) ;; let emacs read events and run timmers (and check for timeout)&#xA;      (message &quot;finished on time!!&quot;)))) ;; this will run only if there is no timeout&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-03-25T18:04:15.123" LastActivityDate="2015-03-25T18:04:15.123" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10296" PostTypeId="2" ParentId="10278" CreationDate="2015-03-25T16:22:20.247" Score="4" Body="&lt;p&gt;You can achieve this by just adding a &lt;a href=&quot;https://www.gnu.org/software/coreutils/manual/html_node/timeout-invocation.html&quot; rel=&quot;nofollow&quot;&gt;GNU timeout&lt;/a&gt; invocation to your shell command, which circumvents needing to know any details about Emacs behavior. For example running:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ timeout 5 sleep 10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will return in 5 seconds, not 10 (timeout effectively presses Ctrl-C for you).&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-03-25T16:22:20.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10297" PostTypeId="2" ParentId="10277" CreationDate="2015-03-25T16:48:04.477" Score="5" Body="&lt;p&gt;If you know the file extensions are working with, the best solution is to just use the &lt;a href=&quot;http://www.emacswiki.org/emacs/AutoModeAlist&quot; rel=&quot;noreferrer&quot;&gt;auto-mode-alist&lt;/a&gt; to startup hexl-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, and you take what you have said literally:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;It's probably sufficient to define &quot;binary&quot; as &quot;contains a null byte&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can do this by adding a function that turns on hexl-mode if a file contain a null byte to the &lt;code&gt;find-file-hooks&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun buffer-binary-p (&amp;amp;optional buffer)&#xA;  &quot;Return whether BUFFER or the current buffer is binary.&#xA;&#xA;A binary buffer is defined as containing at least on null byte.&#xA;&#xA;Returns either nil, or the position of the first null byte.&quot;&#xA;  (with-current-buffer (or buffer (current-buffer))&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (search-forward (string ?\x00) nil t 1))))&#xA;&#xA;(defun hexl-if-binary ()&#xA;  &quot;If `hexl-mode' is not already active, and the current buffer&#xA;is binary, activate `hexl-mode'.&quot;&#xA;  (interactive)&#xA;  (unless (eq major-mode 'hexl-mode)&#xA;    (when (buffer-binary-p)&#xA;      (hexl-mode))))&#xA;&#xA;(add-hook 'find-file-hooks 'hexl-if-binary)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-03-25T16:48:04.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10298" PostTypeId="1" AcceptedAnswerId="10299" CreationDate="2015-03-25T17:05:01.020" Score="1" ViewCount="86" Body="&lt;p&gt;'Hope it won't bother my using &lt;code&gt;defmacro&lt;/code&gt;s named in &lt;em&gt;the style of &lt;strong&gt;keywords&lt;/strong&gt;&lt;/em&gt; (colon-prefixed, e.g., &lt;code&gt;:set-this&lt;/code&gt; or &lt;code&gt;:get-that&lt;/code&gt;): it apparently tricks &lt;code&gt;ELisp&lt;/code&gt; from otherwise requiring &lt;em&gt;&lt;strong&gt;&lt;code&gt;quote&lt;/code&gt;d&lt;/strong&gt;&lt;/em&gt; symbols (&lt;code&gt;'&lt;/code&gt;) or &lt;em&gt;function&lt;/em&gt; symbols (&lt;code&gt;#'&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo :set-this value-that) ; line 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nevermind that: the problem goes as follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say there are two &quot;&lt;code&gt;keywordp&lt;/code&gt;&quot;-like &lt;code&gt;defmacro&lt;/code&gt;s with one parameter, and given a &lt;code&gt;cl-flet*&lt;/code&gt; context, there should be &lt;em&gt;&lt;strong&gt;two&lt;/strong&gt; similar&lt;/em&gt; forms (as in &lt;code&gt;line #0&lt;/code&gt;), but with two different macros and arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An &lt;strong&gt;MWE&lt;/strong&gt; is the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro :m (x) `(length ,x)) ; line 1&#xA;    ⇒ :m&#xA;(and (keywordp :m) (macrop :m)) ; line 2&#xA;    ⇒ t&#xA;&#xA;(:m `(3)) ; line 3&#xA;    ⇒ 1&#xA;&#xA;(defmacro :w (x) `(length (nreverse ,x))) ; line 4&#xA;    ⇒ :w&#xA;(and (keywordp :w) (macrop :w)) ; line 5&#xA;    ⇒ t&#xA;&#xA;(:w `(6)) ; line 6&#xA;    ⇒ 1&#xA;&#xA;(defun x (y z) (eval `(,y ,z))) ; line 7&#xA;    ⇒ x&#xA;&#xA;(x :m `(8)) ; line 8&#xA;    ⇒ Invalid function: 8&#xA;&#xA;(x :w '(9)) ; line 9&#xA;    ⇒ Invalid function: 8&#xA;&#xA;(- (eval `(:m '(8)) (eval `(:w `(9))) ; line 10&#xA;    ⇒ 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;faulty code&lt;/strong&gt; is in &lt;strong&gt;line &lt;code&gt;#7&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In these simple cases, it don't matter if the argument-list is backquoted &amp;#x60;&lt;code&gt;(8)&lt;/code&gt;, quoted &lt;code&gt;'(9)&lt;/code&gt;, or returned as &lt;code&gt;(list 8)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lines &lt;code&gt;#8&lt;/code&gt; and &lt;code&gt;#9&lt;/code&gt; show what is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, line &lt;code&gt;#10&lt;/code&gt; shows that &lt;code&gt;eval&lt;/code&gt;uating as it &quot;&lt;em&gt;should be&lt;/em&gt;&quot; is possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if instead of &lt;code&gt;defun&lt;/code&gt; there were a &lt;code&gt;defmacro&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro x (y z) `(eval (,y ,z))) ; line 11&#xA;    ⇒ x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then lines &lt;code&gt;#8&lt;/code&gt; or &lt;code&gt;#9&lt;/code&gt; would be equivalent to line &lt;code&gt;10&lt;/code&gt;, but this is impossible within a &lt;code&gt;cl-flet*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints? Thank s.&lt;/p&gt;&#xA;" OwnerUserId="6867" LastActivityDate="2015-03-25T17:15:26.107" Title="both keywordp and macrop then eval from a functionp" Tags="|elisp|elisp-macros|common-lisp|eval-expression|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10299" PostTypeId="2" ParentId="10298" CreationDate="2015-03-25T17:15:26.107" Score="1" Body="&lt;p&gt;Try this for line 7:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun x (y z) (eval `(,y ',z)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, ensure that the second argument is quoted in the expansion.  When you call &lt;code&gt;(x :m `(8))&lt;/code&gt;, in your version the body of &lt;code&gt;x&lt;/code&gt; ends up as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval '(:m (8)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which obviously implies a call to the function &lt;code&gt;8&lt;/code&gt;.  With the extra quote in the definition of &lt;code&gt;x&lt;/code&gt;, it would try this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval '(:m '(8)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which passes the list &lt;code&gt;(8)&lt;/code&gt; to the &lt;code&gt;:m&lt;/code&gt; macro without evaluating it.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-03-25T17:15:26.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10300" PostTypeId="1" AcceptedAnswerId="10306" CreationDate="2015-03-25T20:56:38.813" Score="3" ViewCount="237" Body="&lt;p&gt;I am using &lt;code&gt;desktop-save-mode&lt;/code&gt; and &lt;code&gt;desktop-change-dir&lt;/code&gt; to handle multiple desktops. This works fine, except for the case when I have modified some buffers, and then run &lt;code&gt;desktop-change-dir&lt;/code&gt; before having saved the changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that &lt;code&gt;desktop-change-dir&lt;/code&gt; would save any buffers before switching desktops, instead I get a question &lt;code&gt;Buffer &amp;lt;name&amp;gt; modified; kill anyway ? (yes/no)&lt;/code&gt;. (Note that this question is somewhat different from the question you get when killing emacs, in that it does not ask if you would like to save the buffer or not.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;yes&lt;/code&gt; to the question, the modification to the buffer is lost, if I type &lt;code&gt;no&lt;/code&gt; the buffer is carried on to the next desktop.&#xA;(Neither of these options is desired, so I have to press &lt;code&gt;C-g&lt;/code&gt; to abort and save the file manually)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead I would like to have the modified buffers saved automatically. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q -l init.el &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;init.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-desktop-dir1&#xA;  (file-name-as-directory (expand-file-name &quot;desktop1&quot;)))&#xA;&#xA;(defvar my-desktop-dir2&#xA;  (file-name-as-directory (expand-file-name &quot;desktop2&quot;)))&#xA;&#xA;(defun my-switch-desktop ()&#xA;  (interactive)&#xA;  ;; this line is commented out since `desktop-save' should be&#xA;  ;; called by `desktop-change-dir'&#xA;  ;;(desktop-save my-desktop-dir1 t t)&#xA;  (desktop-change-dir my-desktop-dir2))&#xA;&#xA;(require 'desktop)&#xA;(setq desktop-path (list my-desktop-dir1))&#xA;(setq desktop-save t)&#xA;(desktop-save-mode 1)&#xA;(desktop-read)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-04-25T06:09:35.113" Title="How to save modified buffers when changing desktop?" Tags="|desktop|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10301" PostTypeId="1" AcceptedAnswerId="10315" CreationDate="2015-03-25T23:11:41.410" Score="4" ViewCount="674" Body="&lt;p&gt;How would I be able to mark a specific occurrence of a searched phrase? In other words, I can use incremental search to search for a phrase, but would like to be able to mark that phrase once I found it. I don't believe this is already implemented into emacs but would be simple to do if I was able to retrieve the location of the searched word in elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below, you can see that highlighted is the result of searching for the word &quot;buffer.&quot; In pink, is the occurrence the cursor is currently on. I would like to edit this word directly. Currently, this can only be done by stopping search, which causes the cursor to position itself at the beginning of &quot;buffer&quot;, and then I would need to use ctrl-space to set mark and move forward a word to mark &quot;buffer&quot;. This is relatively simple to do for a word, but tedious if I searched for a phrase (which needs to be edited) such as &quot;is for notes&quot; in this example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/D27I2.png&quot; alt=&quot;emacs_incrementalsearch&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5398" LastActivityDate="2015-03-26T16:48:21.920" Title="Search and Mark" Tags="|elisp|isearch|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10302" PostTypeId="2" ParentId="10301" CreationDate="2015-03-26T01:31:53.880" Score="2" Body="&lt;p&gt;If the use-case is to &lt;em&gt;edit&lt;/em&gt; the text you've searched for, then maybe you don't need to worry about marking it at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-%&lt;/kbd&gt; (whilst isearching) starts an interactive search and replace for the search string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's a straight replacement, just enter the new text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to edit the original text, use the minibuffer history to populate the search string before editing it for the replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interactive help (&lt;kbd&gt;?&lt;/kbd&gt; once you've invoked the command) tells you the rest.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-03-26T01:31:53.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10303" PostTypeId="2" ParentId="10246" CreationDate="2015-03-26T02:19:01.723" Score="5" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/kuanyui/moe-theme.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;moe-them&lt;/a&gt;, and just&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'moe-theme)&#xA;(moe-dark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;will load the theme &lt;strong&gt;without error/warning/prompt&lt;/strong&gt;, but if I &lt;code&gt;M-x load-theme&lt;/code&gt; inside Emacs, it will prompt something like &amp;quot;treat the theme as safe&amp;quot;, and I found out a solution for that:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-safe-themes t)   ; Treat all themes as safe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I don't know if this will solve your problem, but you can give it a try.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="13589" LastEditDate="2021-05-05T09:00:01.207" LastActivityDate="2021-05-05T09:00:01.207" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10304" PostTypeId="1" CreationDate="2015-03-26T04:55:58.623" Score="1" ViewCount="198" Body="&lt;p&gt;I'm a relative emacs newbie and have set up my emacs (24.4.1) to work with clojure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The gist of it is that I am now using the latest org-mode from git and loading it in my init.el (I am using prelude btw) as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (add-to-list 'load-path &quot;~/repos/org-mode/lisp&quot;)&#xA;   (require 'org)&#xA;   (require 'ob-clojure)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am trying to use org to write a literate clojure program that I can export to markdown. Clojure and babel now work well, evaluation works etc, but when I try to export my org file I get an error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    load-with-code-conversion: Symbol's value as variable is void: p&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The stack trace when I set &lt;code&gt;toggle-debug-on-error&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Debugger entered--Lisp error: (void-variable p)&#xA;        eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil&#xA;             &quot;/Users/krisfoster/repos/org-mode/lisp/ox.el&quot; nil t)&#xA;             ; Reading at buffer position 229233&#xA;        load-with-code-conversion(&quot;/Users/krisfoster/repos/org-mode/lisp/ox.el&quot;&#xA;             &quot;/Users/krisfoster/repos/org-mode/lisp/ox.el&quot; nil t)&#xA;        autoload-do-load((autoload &quot;ox&quot; &quot;Export dispatcher for Org mode.\n&#xA;            \nIt provides an access to common export related tasks in a         &#xA;            buffer.\nIts interface comes in two flavors: standard and &#xA;            expert.\n\nWhile both share the same set of bindings, only the &#xA;            former\ndisplays the valid keys associations in a dedicated &#xA;            buffer.\nScrolling (resp. line-wise motion) in this buffer is done &#xA;            with\nSPC and DEL (resp. C-n and C-p) keys.\n\nSet variable `org-&#xA;            export-dispatch-use-expert-ui' to switch to one\nflavor or the &#xA;            other.\n\nWhen ARG is \\[universal-argument], repeat the last &#xA;            export action, with the same set\nof options used back then, on &#xA;            the current buffer.\n\nWhen ARG is \\[universal-argument] \\&#xA;            [universal-argument], display the asynchronous export &#xA;            stack.\n\n(fn &amp;amp;optional ARG)&quot; t nil) org-export-dispatch)&#xA;        command-execute(org-export-dispatch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to resolve this by &lt;code&gt;(require&lt;/code&gt;-ing the various &lt;code&gt;org&lt;/code&gt; export packages, the ones in the clone of the org git repo that is, from within my &lt;code&gt;init.el&lt;/code&gt;. But no dice - in fact that generated yet more issues. I have tried debugging but can't figure out what is wrong. I am suspecting I need to be requiring something but don't know what.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have my &lt;code&gt;init.el&lt;/code&gt; here - &lt;a href=&quot;https://gist.github.com/krisfoster/c1b5c3fa0300722c17b9&quot; rel=&quot;nofollow&quot;&gt;init.el gist&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any-one have any ideas what I am doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just did an update of org-mode and built with &lt;code&gt;make autoloads&lt;/code&gt; and now get a new error which is saved in this gist &lt;a href=&quot;https://gist.github.com/krisfoster/247358228d2f2bd3089f&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/krisfoster/247358228d2f2bd3089f&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note I have had to remove the link to the original article whose setup I was following as I don't have enough rep. points to post more than 2 links.&lt;/p&gt;&#xA;" OwnerUserId="6868" LastEditorUserId="6868" LastEditDate="2015-03-26T19:51:07.827" LastActivityDate="2015-03-26T19:51:07.827" Title="org mode with clojure - can't get export to work" Tags="|org-mode|org-export|clojure|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10305" PostTypeId="2" ParentId="10288" CreationDate="2015-03-26T05:36:55.930" Score="1" Body="&lt;p&gt;This advised &lt;code&gt;org-clock-goto&lt;/code&gt; will &lt;code&gt;push-mark&lt;/code&gt; to the &lt;code&gt;global-mark-ring&lt;/code&gt; whenever you are not at the currently clocked item. Otherwise it will jump back to the starting position with &lt;code&gt;pop-global-mark&lt;/code&gt;. (NOTE: &lt;code&gt;org-clock-goto&lt;/code&gt; will no longer work correctly without an open clock.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-clock-goto (around org-clock-goto--around)&#xA;  &quot;If not at clocked item already, push mark to `global-mark-ring'.&quot;&#xA;  (if (and (org-clocking-p)&#xA;           (&amp;lt; (save-excursion (outline-back-to-heading) (point))&#xA;              org-clock-marker)&#xA;           (&amp;gt; (save-excursion (outline-next-heading) (point))&#xA;              org-clock-marker))&#xA;      (pop-global-mark)&#xA;    (push-mark (point)) ad-do-it))&#xA;(ad-activate 'org-clock-goto)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="874" LastEditDate="2015-03-27T12:46:20.570" LastActivityDate="2015-03-27T12:46:20.570" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10306" PostTypeId="2" ParentId="10300" CreationDate="2015-03-26T05:47:46.467" Score="1" Body="&lt;p&gt;As a workaround, you can use &lt;code&gt;save-some-buffers&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-switch-desktop ()&#xA;  (interactive)&#xA;  ;; If save-silently-p is non-nil, saves all the file-visiting buffers&#xA;  ;;  without querying the user.&#xA;  (let ((save-silently t)) &#xA;    (save-some-buffers save-silently))&#xA;  (desktop-change-dir my-desktop-dir2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-03-26T05:47:46.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10307" PostTypeId="1" AcceptedAnswerId="10313" CreationDate="2015-03-26T08:01:42.427" Score="8" ViewCount="1254" Body="&lt;p&gt;During search and especially search-and-replace it would be nice to have the surrounding lines as context. But when jumping to the next hit, the cursor sometimes ends at the lowest visible line (or even worse at a corner).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like the text to follow the cursor during search. Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This question is &lt;a href=&quot;https://emacs.stackexchange.com/questions/3683/how-to-force-the-current-line-to-be-always-in-the-middle-of-the-screen&quot;&gt;similar to this one&lt;/a&gt;, but I don't want that all the time but only when jumping during search &lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2022-03-21T12:58:11.710" Title="How to center the current line vertically during Isearch" Tags="|search|scrolling|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10308" PostTypeId="1" AcceptedAnswerId="10323" CreationDate="2015-03-26T10:28:18.323" Score="0" ViewCount="1553" Body="&lt;p&gt;I'd really like full support for cross referencing in Python, in particular in Django. I'm a bit of a n00b when it comes to emacs, but I love it dearly. I've used and been very impressed with the ada-mode in emacs and its cross referencing but that requires compilation artifacts. Is there a way to get emacs to do it with Python?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &quot;Cross Referencing&quot; I mean that I can jump to the file containing a method definition from any reference in the project.&lt;/p&gt;&#xA;" OwnerUserId="905" LastEditorUserId="905" LastEditDate="2015-03-26T14:42:57.643" LastActivityDate="2015-03-26T23:30:30.550" Title="How to get cross referencing in a Python project?" Tags="|python|ide|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10309" PostTypeId="1" AcceptedAnswerId="10310" CreationDate="2015-03-26T10:36:16.997" Score="0" ViewCount="36" Body="&lt;p&gt;I was editing some code in an Emacs client, when all of a sudden it stopped reacting to my input. If I killed the client and connected with a new one, I got a pretty strange behaviour:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if I tried to open a file that has changed (due to &lt;code&gt;git rebase&lt;/code&gt; operations in another terminal), Emacs warned me about this and asked me if I wanted to re-read the buffer’s file. It accepted and displayed my input in the minibuffer. After that it presented me an empty window, and stopped reacting&lt;/li&gt;&#xA;&lt;li&gt;if I tried to open any other file/directory, I got the same empty window with no reaction again&lt;/li&gt;&#xA;&lt;li&gt;if I opened an X-Windows version of Emacs client with any file, I got the same result. Furthermore, the menu items didn’t react to clicking and the X window didn’t react to its close button, Alt-F4, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After this point, nothing happened. The minibuffer and all the other windows didn’t update, any input seemed to be discarded (C-x C-c, M-x, whatever).&lt;/p&gt;&#xA;" OwnerUserId="507" LastActivityDate="2015-04-25T11:09:35.423" Title="Client window hung with no visible cause" Tags="|python|emacsclient|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10310" PostTypeId="2" ParentId="10309" CreationDate="2015-03-26T10:36:16.997" Score="0" Body="&lt;p&gt;While I was writing this post I tried to simply press &lt;code&gt;C-g&lt;/code&gt; if some background operation is in progress I am not aware of, and I got control back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turned out that &lt;a href=&quot;http://company-mode.github.io/&quot; rel=&quot;nofollow&quot;&gt;company-mode&lt;/a&gt; hung somewhere. I was editing some Python code with a running Python instance (started with &lt;code&gt;M-x run-python&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="507" LastActivityDate="2015-03-26T10:36:16.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10312" PostTypeId="2" ParentId="9465" CreationDate="2015-03-26T14:18:20.157" Score="1" Body="&lt;p&gt;I found that by pressing Alt-4 and then SPC, I get the desired result. Not sure if this is the best way, but it works as well. &lt;/p&gt;&#xA;" OwnerUserId="2340" LastActivityDate="2015-03-26T14:18:20.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10313" PostTypeId="2" ParentId="10307" CreationDate="2015-03-26T14:19:41.083" Score="7" Body="&lt;p&gt;For Isearch, you can set option &lt;strong&gt;&lt;code&gt;isearch-allow-scroll&lt;/code&gt;&lt;/strong&gt; to non-&lt;code&gt;nil&lt;/code&gt;.  That lets you scroll the buffer you are searching, without exiting Isearch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And note that &quot;scrolling&quot; here includes &lt;code&gt;C-l&lt;/code&gt;, which recenters the text (repeat &lt;code&gt;C-l&lt;/code&gt; to put the current search hit at the top, middle, bottom of the window).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-26T14:19:41.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10314" PostTypeId="2" ParentId="10308" CreationDate="2015-03-26T15:26:50.233" Score="0" Body="&lt;p&gt;Look into anaconda-mode: &lt;a href=&quot;https://github.com/proofit404/anaconda-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/proofit404/anaconda-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For cross-referencing, you can mark the reference and then use &lt;code&gt;M-x anaconda-mode-usages&lt;/code&gt; to easily see the cross-references.&lt;/p&gt;&#xA;" OwnerUserId="5398" LastActivityDate="2015-03-26T15:26:50.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10315" PostTypeId="2" ParentId="10301" CreationDate="2015-03-26T16:48:21.920" Score="2" Body="&lt;p&gt;Not sure exactly what you're looking for. If what you want to do is to set the mark at the beginning of the final search hit when you exit Isearch with point at the end of that hit, then that means that you want to have Isearch select that search hit when you exit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's what you want then you can get that using library &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; and customizing option &lt;strong&gt;&lt;code&gt;isearchp-set-region-flag&lt;/code&gt;&lt;/strong&gt; to non-&lt;code&gt;nil&lt;/code&gt;. Or if you want to select the search hit when you exit sometimes, but only on demand, then you can use &lt;code&gt;M-x isearchp-set-region-around-search-target&lt;/code&gt; after you exit.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-26T16:48:21.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10316" PostTypeId="1" CreationDate="2015-03-26T18:12:31.227" Score="5" ViewCount="1415" Body="&lt;p&gt;While looking to exclude the uses of the &lt;code&gt;list&lt;/code&gt; &lt;em&gt;function&lt;/em&gt; through the &lt;strong&gt;backquote&lt;/strong&gt; substitutes in &lt;code&gt;defmacro&lt;/code&gt;s, my attempt failed when combined with the &lt;code&gt;let&lt;/code&gt; and &amp;#x60;&lt;code&gt;let*&lt;/code&gt; recipe, together with the &lt;code&gt;gensym&lt;/code&gt; function (as a source of &lt;code&gt;unintern&lt;/code&gt;ed symbols, as illustrated somewhere else), to create temporary variables - but the latter is not the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A running &lt;strong&gt;MWE [EDITED: inserted macroexpand]&lt;/strong&gt; is the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun w (a &amp;amp;optional b) ; line 1&#xA;  (let ((z (gensym)))&#xA;   `(let* ((,z (if (integerp ,b) '((,a ,b)) '((,a))))) ,z)))&#xA;    ⇒ w&#xA;&#xA;(eval (w 3)) ; line 2&#xA;    ⇒ ((3))&#xA;(eval (w 3 0)) ; line 3&#xA;    ⇒ ((3 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;w&lt;/code&gt; is a &lt;code&gt;defun&lt;/code&gt; above: when the optional &lt;code&gt;integerp&lt;/code&gt; second argument is present, return the pair as a &quot;&lt;strong&gt;&lt;em&gt;doubled&lt;/em&gt;&lt;/strong&gt;&quot; list; otherwise return only the first argument, also inside two pairs of parentheses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now comes the tricky part: need to replace the &lt;code&gt;defun&lt;/code&gt; with a &lt;code&gt;defmacro&lt;/code&gt; (&lt;code&gt;m&lt;/code&gt; for &lt;code&gt;w&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro m (a &amp;amp;optional b) ; line 4&#xA;  (let ((z (gensym)))&#xA;   `(let* ((,z (if (integerp ,b) `((,a ,b)) `((,a))))) ,z)))&#xA;    ⇒ m&#xA;&#xA;(macroexpand (m (+ 1 2) 0)) ; line 5&#xA;    ⇒ list: Symbol's value as variable is void: a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And also attempt to return the evaluation of &lt;code&gt;(+ 1 2)&lt;/code&gt;, i.e., &lt;code&gt;((3 0))&lt;/code&gt;. The loop shows the above &lt;code&gt;line #4&lt;/code&gt; is &lt;strong&gt;faulty&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next use instead simple quotes, i.e., &lt;code&gt;'((,a ,b))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro m (a &amp;amp;optional b) ; line 6&#xA;  (let ((z (gensym)))&#xA;   `(let* ((,z (if (integerp ,b) '((,a ,b)) '((,a))))) ,z)))&#xA;    ⇒ m&#xA;&#xA;(macroexpand (m (+ 1 2) 0)) ; line 7&#xA;    ⇒ (((+ 1 2) 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Okay, but there is no evaluation of the argument: not acceptable.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro m (a &amp;amp;optional b) ; line 8&#xA;  (let ((z (gensym)))&#xA;   `(let* ((,z (if (integerp ,b) (list (list ,a ,b)) (list (list ,a))))) ,z)))&#xA;    ⇒ m&#xA;&#xA;(macroexpand (m (+ 1 2) 0)) ; line 9&#xA;    ⇒ ((3 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, use the &lt;code&gt;list&lt;/code&gt; function for a change: this time it works, yet there is one &lt;code&gt;list&lt;/code&gt; too many.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is then how can &lt;code&gt;line #4&lt;/code&gt; keep its minimalistic form using (back)quotes, so that &lt;code&gt;line #5&lt;/code&gt; would result as &lt;code&gt;line #3&lt;/code&gt; - using &lt;code&gt;defmacro&lt;/code&gt; versus &lt;code&gt;defun&lt;/code&gt;. There is a &amp;#x60;&lt;code&gt;(...&lt;/code&gt; within &amp;#x60;&lt;code&gt;(---&lt;/code&gt; pattern. that might be the cause.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate all answers. Thank s.&lt;/p&gt;&#xA;" OwnerUserId="6867" LastEditorUserId="105" LastEditDate="2015-07-11T04:55:33.023" LastActivityDate="2015-07-11T04:55:33.023" Title="defun vs defmacro and backquote vs list" Tags="|elisp|elisp-macros|backquote|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10317" PostTypeId="2" ParentId="10316" CreationDate="2015-03-26T19:15:51.990" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/17429521/common-lisp-double-backquote-unquote-quote-unquote-sequence/%22nested%20backquotes%20pattern%22&quot;&gt;Nested backquotes require more commas.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro m (a &amp;amp;optional b) ; line 4&#xA;  (let ((z (gensym)))&#xA;   `(let* ((,z ,b)) (if (integerp ,z) `((,,a ,,z)) `((,,a))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6867" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-03-28T10:43:24.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10318" PostTypeId="2" ParentId="10316" CreationDate="2015-03-26T20:04:57.437" Score="5" Body="&lt;p&gt;It's not necessary to use a backquote inside another, that's the beauty of it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro m1 (a &amp;amp;optional b)&#xA;  (let ((z (gensym)))&#xA;    `(let ((,z (if (integerp ,b)&#xA;                   (list ,a ,b)&#xA;                 (list ,a))))&#xA;       ,z)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that isn't correct yet. The purpose of &lt;code&gt;z&lt;/code&gt; isn't to add another variable for the fun of it, but to protect &lt;code&gt;b&lt;/code&gt; from being evaluated more than once (because doing that might have side-effects or be costly). You are not doing that. Here's how to do it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro m2 (a &amp;amp;optional b)&#xA;  (let ((z (gensym)))&#xA;    `(let ((,z ,b))&#xA;       (if (integerp ,z)&#xA;           (list ,a ,z)&#xA;         (list ,a)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This demonstrates the difference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((v 1)) (m1 1 (cl-incf v))) =&amp;gt; (1 3)&#xA;(let ((v 1)) (m2 1 (cl-incf v))) =&amp;gt; (1 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You do not have to do the same for &lt;code&gt;a&lt;/code&gt; because, even though it appears twice, only ever one occurrence is evaluated.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-03-27T00:36:21.127" LastActivityDate="2015-03-27T00:36:21.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10319" PostTypeId="1" AcceptedAnswerId="10320" CreationDate="2015-03-26T20:25:42.130" Score="1" ViewCount="449" Body="&lt;p&gt;I'm writing a little cleanup function that will search for the word 'let' in a case insensitive manner then replace it with the lowercase 'let'.  It works in all my test cases, except for when the first letter is capitalized:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;leT x=1&#xA;Let y=2&#xA;let z=3&#xA;lEt a=3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the output, the second line is wrong:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let x=1&#xA;Let y=2&#xA;let z=3&#xA;let a=3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the elisp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun let-cmd()&#xA;  (goto-char (point-min))&#xA;  (while (search-forward-regexp &quot;Let&quot; nil t) &#xA;    (replace-match &quot;let&quot; (match-string 1)) t nil))&#xA;&#xA;(defun cleanup()&#xA;  (interactive)&#xA;  (let-cmd))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I fix this one example?&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="105" LastEditDate="2015-07-11T04:33:44.270" LastActivityDate="2015-07-11T04:33:44.270" Title="&quot;replace-match&quot; leaves first letter capitalized" Tags="|elisp|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10320" PostTypeId="2" ParentId="10319" CreationDate="2015-03-26T21:00:23.923" Score="2" Body="&lt;p&gt;You can pass a non-nil value as the FIXEDCASE parameter. From the built-in help:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(replace-match NEWTEXT &amp;amp;optional FIXEDCASE LITERAL STRING SUBEXP)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Replace text matched by last search with NEWTEXT.&#xA;  Leave point at the end of the replacement text.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If optional second arg FIXEDCASE is non-nil, do not alter the case of&#xA;  the replacement text.  Otherwise, maybe capitalize the whole text, or&#xA;  maybe just word initials, based on the replaced text.  If the replaced&#xA;  text has only capital letters and has at least one multiletter word,&#xA;  convert NEWTEXT to all caps.  Otherwise if all words are capitalized&#xA;  in the replaced text, capitalize each word in NEWTEXT.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-03-26T21:00:23.923" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10321" PostTypeId="1" CreationDate="2015-03-26T23:21:12.277" Score="7" ViewCount="724" Body="&lt;p&gt;In &lt;code&gt;auctex&lt;/code&gt; mode, whenever I write a new formula I have to type &lt;code&gt;C-c C-p C-p&lt;/code&gt; to render it as an inline image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if it's possible to automatically render the formula or equations as I write them in the buffer (similar to how flyspell highlights misspelled words)?&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="600" LastEditDate="2016-11-01T15:23:22.147" LastActivityDate="2016-11-01T15:23:22.147" Title="Is it possible to preview TeX formulas automatically on auctex-mode?" Tags="|latex|auctex|preview-latex|" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10322" PostTypeId="1" AcceptedAnswerId="10324" CreationDate="2015-03-26T23:28:26.720" Score="4" ViewCount="502" Body="&lt;p&gt;I have a pattern like this scattered &lt;strong&gt;all over my .emacs&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/function ()&#xA;   (interactive)&#xA;   (....stuff)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to write a &lt;code&gt;idefun&lt;/code&gt; macro so I could write as following instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(idefun my/function () &#xA;   (... stuff)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far, based on &lt;a href=&quot;https://emacs.stackexchange.com/questions/10194/macro-with-optional-paramaters-that-checks-for-whether-an-optional-paramater-is/10198?noredirect=1#comment15699_10198&quot;&gt;my previous ilambda macro&lt;/a&gt; post, I tried this business:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (defmacro idefun (name para &amp;amp;rest body) &#xA;       `(defun ,name ,para (interactive) ,body))&#xA;&#xA;&#xA;   (idefun my/idefun-test ()&#xA;            (message &quot;defun function&quot;))&#xA;&#xA;   ;I would like it to translate to:&#xA;   ;(defun my/idefun-test ()&#xA;   ;         (interactive)&#xA;   ;         (message &quot;defun function&quot;)&#xA;   ;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now 'my/idefun-test' is listed under M-x, but when running it tells me 'invalid function'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions/requests:&lt;br&gt;&#xA;1) Does anyone know how to get the above to work?&lt;br&gt;&#xA;2) Would it be possible to implement a version that conditionally inserts function documentation if the first item is a string? (like in &lt;a href=&quot;https://emacs.stackexchange.com/questions/10194/macro-with-optional-paramaters-that-checks-for-whether-an-optional-paramater-is/10198?noredirect=1#comment15699_10198&quot;&gt;the lambda post&lt;/a&gt;)I.e:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(idefun my/test () &quot;function docu&quot; (message &quot;MEH&quot;))&#xA;Should translate to:&#xA;(define my/test () &quot;function docu&quot; (interactive) (message &quot;MEH&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT SOLUTION]&lt;/strong&gt;&lt;br&gt;&#xA;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;em&gt;It is not reccomended to use a macro like this in a public package/library as it may lead to confusion. But for a personal .emacs it might just about prevent rsi.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the answer below, I pieced together the following working macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro idefun (name para docOrBody &amp;amp;rest body)&#xA;  (if (and (stringp docOrBody) body) ;if first arg is a string type&#xA;  ;then&#xA;  `(defun ,name ,para&#xA;     ,docOrBody ;this is the function documentation string in this case.&#xA;     (interactive)&#xA;     ,@body)&#xA;  ;else&#xA;  `(defun ,name ,para&#xA;     (interactive)&#xA;     ,docOrBody ,@body)) ;otherwise it is the body.&#xA;  )&#xA;&#xA;;-------&#xA;;Examples follow&#xA;;-------&#xA;(idefun my/id2 ()&#xA;         (message &quot;it works&quot;))&#xA;(idefun my/id2-with-docu ()&#xA;         &quot;Function documentation&quot;&#xA;         (message &quot;it works with docu&quot;))&#xA;&#xA;(idefun my/id2-args (a)&#xA;        (message a))&#xA;&#xA;(idefun my/hello-moto ()&#xA;    &quot;Function docu :-D!&quot;&#xA;    (message &quot;Hello moto&quot;))&#xA;&#xA;(global-unset-key (kbd &quot;&amp;lt;f8&amp;gt;&quot;))&#xA;(global-set-key (kbd &quot;&amp;lt;f8&amp;gt;&quot;) 'my/hello-moto)&#xA;&#xA;;This is funny if read out loud.&#xA;(idefun u () (message &quot;I am your father&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-03-27T01:14:20.480" Title="idefun : a macro to turn defun into an 'interactive' defun?" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10323" PostTypeId="2" ParentId="10308" CreationDate="2015-03-26T23:30:30.550" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;nofollow&quot;&gt;Elpy&lt;/a&gt; can do this with &lt;code&gt;elpy-goto-definition&lt;/code&gt; (bound to &lt;code&gt;M-.&lt;/code&gt; by default).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-03-26T23:30:30.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10324" PostTypeId="2" ParentId="10322" CreationDate="2015-03-26T23:39:12.670" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;1) Does anyone know how to get the above to work?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/macroexpand-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;macroexpand-1&lt;/code&gt;&lt;/a&gt; is&#xA;your friend. Let's se what we get by running it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(macroexpand-1 '(idefun my/test () (message &quot;MEH&quot;)))&#xA;;; =&amp;gt; (defun my/test nil (interactive) ((message &quot;MEH&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do you see the problem with that? There's an extra pair of parentheses&#xA;around the &lt;code&gt;message&lt;/code&gt; call. That's because the &lt;code&gt;&amp;amp;rest body&lt;/code&gt; argument is&#xA;a list of all arguments passed (besides the first two, of course). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to &lt;em&gt;splice&lt;/em&gt; that list into the body of the &lt;code&gt;defun&lt;/code&gt; (note the&#xA;extra &lt;code&gt;@&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro idefun (name para &amp;amp;rest body) &#xA;  `(defun ,name ,para&#xA;     (interactive)&#xA;     ,@body))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;2) Would it be possible to implement a version that conditionally&#xA;  inserts function documentation if the first item is a string? (like&#xA;  in the lambda post)I.e:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, you can do it the same way as in&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/a/10198/50&quot;&gt;this answer&lt;/a&gt; to the&#xA;question you linked. A &lt;code&gt;defun&lt;/code&gt; is not that different from a &lt;code&gt;lambda&lt;/code&gt;.&#xA;The same technique should work.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-03-26T23:39:12.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10325" PostTypeId="1" CreationDate="2015-03-27T00:12:02.050" Score="1" ViewCount="81" Body="&lt;p&gt;Lets say I'm editing a javascript file in emacs that has objects as such scattered through out the file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;foo: [1], foo: [2], foo: [3], foo: [4], foo: [5], foo: [6], foo: [7]&#xA;obo: [1], obo: [2], obo: [3], obo: [4], obo: [5], obo: [6], obo: [7]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to increment each object with a number greater then 3 by N, what would be an efficient way to do so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be nice to know how to perform the same operation but on a specific object or variable?&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-05-19T18:09:46.127" Title="How can I modify a variable in a javascript file that meets specific conditions?" Tags="|programming|javascript|automation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10326" PostTypeId="2" ParentId="9852" CreationDate="2015-03-27T01:29:48.997" Score="1" Body="&lt;p&gt;Here is a simplified version of the solution I came up (had to use&#xA;timers after all). For the complete solution, see&#xA;&lt;a href=&quot;https://github.com/Bruce-Connor/spinner.el&quot; rel=&quot;nofollow&quot;&gt;spinner.el&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((timer (run-at-time t 0.2 #'ignore)))&#xA;  (timer-set-function&#xA;   timer (lambda ()&#xA;           (if still-ongoing&#xA;               (force-mode-line-update)&#xA;             (ignore-errors (cancel-timer timer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This creates a timer that updates the mode-line 5 times per second.&#xA;When the variable &lt;code&gt;still-ongoing&lt;/code&gt; gets set to &lt;code&gt;nil&lt;/code&gt;, the time cancels&#xA;itself.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-03-27T01:29:48.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10327" PostTypeId="1" AcceptedAnswerId="10329" CreationDate="2015-03-27T02:37:16.833" Score="0" ViewCount="49" Body="&lt;p&gt;&lt;code&gt;markdown-mode&lt;/code&gt; &lt;a href=&quot;https://github.com/nicholasbishop/emacs-conf/blob/master/markdown-mode.el&quot; rel=&quot;nofollow&quot;&gt;defines &lt;code&gt;tab-width&lt;/code&gt; using a magic number&lt;/a&gt; when loaded, overwriting any global settings I have (namely, 2 spaces):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;###autoload&#xA;(define-derived-mode markdown-mode text-mode &quot;Markdown&quot;&#xA;&quot;Major mode for editing Markdown files.&quot;&#xA;;; Natural Markdown tab width&#xA;(setq tab-width 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem to be something I can advise on load. A load-hook also seems kind of hacky, and shadowing a specific copy of this file makes it brittle against updates. (Forking and submitting a PR is sort of a roundabout way too.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a set-and-forget way to clobber this setting so that it obeys the global setting?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2015-03-27T03:17:16.620" Title="What's the most effective way to modify this internal mode config?" Tags="|advice|markdown-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10328" PostTypeId="2" ParentId="9937" CreationDate="2015-03-27T02:44:09.547" Score="2" Body="&lt;p&gt;The issue was the latest stable &lt;strong&gt;magit&lt;/strong&gt; wasn't compatible with the version of &lt;strong&gt;git&lt;/strong&gt; I had in my system. As stated in &lt;a href=&quot;https://emacs.stackexchange.com/questions/9939/magit-fails-to-create-local-repository&quot;&gt;another question I posted&lt;/a&gt;, magit works fine with latest stable git (in my case, 2.3.x).&lt;/p&gt;&#xA;" OwnerUserId="3895" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-03-27T02:44:09.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10329" PostTypeId="2" ParentId="10327" CreationDate="2015-03-27T03:08:12.217" Score="2" Body="&lt;p&gt;In general, the major-mode hooks run &lt;em&gt;after&lt;/em&gt; the primary major-mode is established.  Thus, you can reset the &lt;code&gt;tab-width&lt;/code&gt; to 2 afterwards -- it happens so fast, you'll never see that it was set to 4 for a split second prior thereto.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to take complete control, you may wish to consider creating your own major-mode.  In the meantime, the following is the emacs-way to modify a setting established by a major-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-markdown-settings ()&#xA;  (setq tab-width 2))&#xA;&#xA;(add-hook 'markdown-mode-hook 'my-markdown-settings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SIDE-NOTE&lt;/strong&gt;:  Most people seem to prefer treating the source-code as sacred, and they enjoy checking for updates and updating the source code when updates by the author become available.  If the original poster is so inclined, another solution would be to modify the source code and re-byte-compile (if needed).&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-03-27T03:17:16.620" LastActivityDate="2015-03-27T03:17:16.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10331" PostTypeId="1" CreationDate="2015-03-27T04:01:22.363" Score="2" ViewCount="834" Body="&lt;p&gt;I have a major problem with gnus, running on debian testing in that I am now &lt;em&gt;totally&lt;/em&gt; unable to send any email out, and it even survives a reboot! When I try to send an email the following comes up in the debugger -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;make client process failed&quot; &quot;connection refused&quot; :name &quot;smtpmail&quot; :buffer #&amp;lt;buffer *trace of SMTP session to london*&amp;gt; :host &quot;london&quot; :service 25)&#xA;  make-network-process(:name &quot;smtpmail&quot; :buffer #&amp;lt;buffer *trace of SMTP session to london*&amp;gt; :host &quot;london&quot; :service 25)&#xA;  network-stream-open-starttls(&quot;smtpmail&quot; #&amp;lt;buffer *trace of SMTP session to london*&amp;gt; &quot;london&quot; 25 (:type plain :return-list t :capability-command &quot;EHLO london.london&#xA;\n&quot; :end-of-command &quot;^[0-9]+ .*&#xA;\n&quot; :success &quot;^2.*\n&quot; :always-query-capabilities t :starttls-function #[(capabilities) &quot;\301\302\&quot;\205&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a lot more but I'm unable to post it all. I've tried also at &lt;a href=&quot;http://paste.debian.net/163455/&quot; rel=&quot;nofollow&quot;&gt;http://paste.debian.net/163455/&lt;/a&gt; but theres not a lot of difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get round it please to stop me being locked out of sending emails?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is part of my gnus-file -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq smtpmail-smtp-server &quot;relay.plus.net&quot;)&#xA;(setq send-mail-function 'smtpmail-send-it)&#xA;(setq message-send-mail-function 'smtpmail-send-it)&#xA;(require 'smtpmail)&#xA;(require 'expiry-hack)&#xA;&#xA;(setq smtpmail-auth-credentials &quot;~/.authinfo&quot;)&#xA;&#xA;(setq starttls-use-gnutls t&#xA;      starttls-gnutls-program &quot;gnutls-cli&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when checked gnutls-cli is provided by &lt;code&gt;gnutils-bin&lt;/code&gt; which wasn't installed, but now is. So I'll reboot and see if that sorts the problem out.&lt;/p&gt;&#xA;" OwnerUserId="6878" LastEditorUserId="6878" LastEditDate="2015-03-27T13:03:17.067" LastActivityDate="2015-03-27T13:03:17.067" Title="unable to post out email from gnus - &quot;make client process failed&quot;" Tags="|gnus|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10332" PostTypeId="1" AcceptedAnswerId="10333" CreationDate="2015-03-27T07:15:13.893" Score="0" ViewCount="544" Body="&lt;pre&gt;&lt;code&gt;(setq revert-without-query '(&quot;\*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have set this to avoid emacs' &lt;code&gt;yes/no&lt;/code&gt; prompt when i revert a buffer and discard its changes. But, still the prompt keeps coming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other regex patterns, i tried with no success,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq revert-without-query '(&quot;*&quot;))&#xA;(setq revert-without-query '(&quot;\\*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The doc, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;says, set the variable revert-without-query to a list of regular expressions. &lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="50" LastEditDate="2015-03-27T09:51:25.680" LastActivityDate="2015-03-27T09:51:25.680" Title="Revert-without-query, regex pattern error" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10333" PostTypeId="2" ParentId="10332" CreationDate="2015-03-27T07:47:56.467" Score="5" Body="&lt;p&gt;The regexp &lt;code&gt;&quot;*&quot;&lt;/code&gt; is not a valid regexp, &lt;code&gt;&quot;*&quot;&lt;/code&gt; means that whatever precedes it can occur zero or more times. A regexp that match anything can be written &lt;code&gt;&quot;.*&quot;&lt;/code&gt;, or more simply &lt;code&gt;&quot;&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you can try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq revert-without-query '(&quot;.*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-03-27T08:56:26.900" LastActivityDate="2015-03-27T08:56:26.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10334" PostTypeId="5" CreationDate="2015-03-27T07:52:01.760" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-03-27T07:52:01.760" LastActivityDate="2015-03-27T07:52:01.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10335" PostTypeId="4" CreationDate="2015-03-27T07:52:01.760" Score="0" Body="Follow-mode makes side-by-side windows showing the same buffer act as one very tall window." OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-03-27T12:46:34.833" LastActivityDate="2015-03-27T12:46:34.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10336" PostTypeId="1" CreationDate="2015-03-27T08:31:31.227" Score="14" ViewCount="7899" Body="&lt;p&gt;I use eww to read online articles in Emacs instead of in a browser because it is less distracting and I can take notes in an org-mode quickly without switching applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder how feasible it is to read an e-books in epub, or pdf format in Emacs? I found the epubmode.el on emacswiki.org but it is broken and haven't been updated since 2011. &lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="50" LastEditDate="2015-03-27T09:52:25.360" LastActivityDate="2020-07-19T09:58:02.180" Title="read e-books in Emacs" Tags="|pdf|docview|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10337" PostTypeId="1" AcceptedAnswerId="10339" CreationDate="2015-03-27T10:17:21.920" Score="8" ViewCount="535" Body="&lt;p&gt;At some unidentifiable point of time (can be in a few days, can be in a few hours) something clicks in Emacs and it starts automatically recentering my cursor position. Like I move my cursor somewhere and in a few seconds the buffer is shifted so that cursor is now vertically in the middle of the window. Once this happens, it persists in all buffers until I restart Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't figure what triggers this, but I noticed that the probability of of this happening increases if I use GUI commands like &lt;code&gt;customize-group&lt;/code&gt;, &lt;code&gt;customize-variable&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that maybe my smooth scrolling setup was to blame. I used to have this in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default redisplay-dont-pause t&#xA;              scroll-margin 1&#xA;              scroll-step 1&#xA;              auto-window-vscroll nil&#xA;              scroll-conservatively 10000&#xA;              scroll-preserve-screen-position 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I replaced that with &lt;a href=&quot;https://github.com/aspiers/smooth-scrolling&quot; rel=&quot;noreferrer&quot;&gt;smooth-scrolling&lt;/a&gt; package and the mentioned behavior still occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help with this? I run Emacs as a daemon, and being forced to restart it because of such silly issue enrages me.&lt;/p&gt;&#xA;" OwnerUserId="6881" LastActivityDate="2015-05-02T16:33:02.197" Title="Emacs sometimes starts automatically recentering cursor position" Tags="|scrolling|cursor|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10338" PostTypeId="2" ParentId="10336" CreationDate="2015-03-27T11:10:22.337" Score="4" Body="&lt;p&gt;&lt;code&gt;.epub&lt;/code&gt; are in fact &lt;code&gt;.zip&lt;/code&gt; file with &lt;code&gt;.xhtml&lt;/code&gt; file inside. You can just open them, find the .xhtml file that has the content (often content.html), and open it. Then you can call &lt;code&gt;shr-render-buffer&lt;/code&gt; to display the html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This do not solve several problem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;finding automatically the correct .xhtml&lt;/li&gt;&#xA;&lt;li&gt;use the table of content,&lt;/li&gt;&#xA;&lt;li&gt;bigger epub have several .xhtml (say, one by chapter), one need a way to go from one to the next.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="2237" LastEditDate="2015-03-27T11:25:21.477" LastActivityDate="2015-03-27T11:25:21.477" CommentCount="4" CommunityOwnedDate="2015-03-27T11:10:22.337" ContentLicense="CC BY-SA 3.0" />
  <row Id="10339" PostTypeId="2" ParentId="10337" CreationDate="2015-03-27T12:23:30.060" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://www.reddit.com/r/emacs/comments/2dgy52/how_to_stop_emacs_automatically_recentering_the/&quot; rel=&quot;nofollow&quot;&gt;The answer is here&lt;/a&gt;. You probably have a buffer-list open somewhere, and version 24.3 has a bug in &lt;code&gt;tabulated-list-mode&lt;/code&gt; which causes the periodic recentering. If you close that buffer-list, behaviour reverts back to normal.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How to stop it permanently&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This bug was fixed in Emacs 24.5, so you need to install that, or&#xA;something more recent. Currently, 24.5 is the official released stable versions, so it should be available to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can&#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/&quot; rel=&quot;nofollow&quot;&gt;download the official release&lt;/a&gt;,&#xA;or do some Googling to find out if your OS has this version&#xA;available from its repositories.&lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="50" LastEditDate="2015-05-02T16:33:02.197" LastActivityDate="2015-05-02T16:33:02.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10340" PostTypeId="2" ParentId="10294" CreationDate="2015-03-27T13:28:41.973" Score="3" Body="&lt;p&gt;Instead of using the built in templates you can build your own via a function and pass this as the final argument to the capture template.  Then you can use arbitrary elisp to manipulate data.  Here is an example in your case, that uses &lt;code&gt;org-completing-read-no-i&lt;/code&gt; for string prompts and &lt;code&gt;org-read-date&lt;/code&gt; for date input.  I have updated it to show how to set a schedule on a date 5 days earlier (calculated as 3600 secs times 24 times 5):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-event-template ()&#xA;    &quot;Capture template for events&quot;&#xA;  (let* ((event (org-completing-read-no-i &quot;Event: &quot; nil))&#xA;         (date-input (org-read-date nil t nil &quot;Date: &quot;))&#xA;         (date (format-time-string &#xA;                      (car org-time-stamp-formats)&#xA;                      date-input))&#xA;         (date+shift (concat (substring date 0 -1) &quot; -5d&quot; (substring date -1)))&#xA;         (date-schedule (format-time-string (car org-time-stamp-formats)&#xA;                                            (time-subtract date-input &#xA;                                                           (seconds-to-time (* 3600 24 5))))))&#xA;  (format &quot;** %s\n  %s\n*** Send a reminder to the group\n  DEADLINE: %s SCHEDULED: %s&quot;&#xA;   event date date+shift date-schedule)))&#xA;&#xA;(custom-set-variables&#xA;  '(org-capture-templates&#xA;    (quote&#xA;     ((&quot;m&quot; &quot;Meetup&quot; entry (file+headline &quot;~/org/STLPython.org&quot; &quot;events&quot;)&#xA;       (function my-event-template))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Typical output from this is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** My event&#xA;  &amp;lt;2015-03-29 Sun&amp;gt;&#xA;*** Send a reminder to the group&#xA;  DEADLINE: &amp;lt;2015-03-29 Sun -5d&amp;gt; SCHEDULED: &amp;lt;2015-03-24 Tue&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The object &lt;code&gt;(car org-time-stamp-formats)&lt;/code&gt; is the standard format for an active timestamp.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-03-29T12:08:22.217" LastActivityDate="2015-03-29T12:08:22.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10341" PostTypeId="2" ParentId="10325" CreationDate="2015-03-27T13:49:22.107" Score="2" Body="&lt;p&gt;You can actually do this with a &lt;code&gt;replace-regexp&lt;/code&gt; because in your replacement, you can evaluate elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var stuff = {&#xA;  foo: [1],&#xA;  foo: [2],&#xA;  foo: [3],&#xA;  foo: [4],&#xA;  foo: [5],&#xA;  foo: [6],&#xA;  foo: [7]&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Select all the code in your region then run &lt;code&gt;replace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your regexp: you could use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\([a-z]: +\[\)\([4-9]\|[1-90][0-9]\)\(\]\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will select all text matching: &lt;code&gt;sometext: [&lt;/code&gt; &lt;code&gt;int over 3&lt;/code&gt; &lt;code&gt;]&lt;/code&gt; and will be grouped as specified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then in your replacement string use elisp to increase the number by N.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your replacement would look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\1\,(+ (string-to-number \2) N)\3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where you would replace N with any value you wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would replace the matched text with the first match group's text, a value N larger than the second match group's text, followed by the third match group's text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better yet, since you are updating a brittle old code base, you can use &lt;code&gt;query-replace-regexp&lt;/code&gt; with the same patterns listed above. This interactively take you through each match, tell you what the replacement will be and let you accept or skip each one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what that looks like: Note that I had already used the patterns specifed so it was the default option and I didn't have to enter them again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example I chose specifically NOT to update the last match. So I just press &lt;kbd&gt;y&lt;/kbd&gt; for each match until the last match, when I pressed &lt;kbd&gt;n&lt;/kbd&gt; to keep it as is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/K3n7O.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-05-19T18:09:46.127" LastActivityDate="2015-05-19T18:09:46.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10343" PostTypeId="1" AcceptedAnswerId="10381" CreationDate="2015-03-27T14:13:43.167" Score="3" ViewCount="2545" Body="&lt;p&gt;I am struggling with the setup for irony-mode's JSON cdb support. I have this in my initialization:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; C++ code completion &#xA;(eval-after-load 'company&#xA;  '(add-to-list 'company-backends 'company-irony))&#xA;(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)&#xA;(eval-after-load 'flycheck&#xA;  '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))&#xA;(add-hook 'c++-mode-hook 'flycheck-mode)&#xA;(add-hook 'c-mode-hook 'flycheck-mode)&#xA;(add-hook 'c++-mode-hook 'irony-mode)&#xA;(add-hook 'c-mode-hook 'irony-mode)&#xA;(add-hook 'objc-mode-hook 'irony-mode)&#xA;&#xA;;; replace the `completion-at-point' and `complete-symbol' bindings in&#xA;;; irony-mode's buffers by irony-mode's function&#xA;(defun my-irony-mode-hook ()&#xA;  (define-key irony-mode-map [remap completion-at-point]&#xA;    'irony-completion-at-point-async)&#xA;  (define-key irony-mode-map [remap complete-symbol]&#xA;    'irony-completion-at-point-async))&#xA;(add-hook 'irony-mode-hook 'my-irony-mode-hook)&#xA;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)&#xA;&#xA;(eval-after-load 'company&#xA;  '(add-to-list 'company-backends 'company-irony))&#xA;&#xA;;; (optional) adds CC special commands to `company-begin-commands' in order to&#xA;;; trigger completion at interesting places, such as after scope operator&#xA;;;     std::|&#xA;(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried running irony-cdb-json-add-compile-commands-path and setting the project root and compile_commands.json (generated using CMake), but when i go back to irony-cdb-menu, it just tells me that there is no compilation database in use. Any thoughts? Thanks! :)&lt;/p&gt;&#xA;" OwnerUserId="5510" LastActivityDate="2015-03-29T16:11:07.650" Title="setting up irony-mode json compilation database" Tags="|company-mode|c++|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10344" PostTypeId="1" AcceptedAnswerId="10345" CreationDate="2015-03-27T14:48:47.570" Score="6" ViewCount="2342" Body="&lt;p&gt;Once I have selected some text I use &lt;code&gt;Alt-w&lt;/code&gt; to copy the region and then use &lt;code&gt;ctrl-y&lt;/code&gt; to paste it. Is there a way to paste something I have selected and copied with &lt;code&gt;Alt-w&lt;/code&gt; prior to my latest paste?&lt;/p&gt;&#xA;" OwnerUserId="2340" LastActivityDate="2015-03-30T13:32:34.823" Title="How to paste text that had been copied (alt-w) prior to my latest paste (ctrl-y)?" Tags="|copy-paste|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10345" PostTypeId="2" ParentId="10344" CreationDate="2015-03-27T14:50:59.790" Score="5" Body="&lt;p&gt;After yanking with &lt;code&gt;C-y&lt;/code&gt;, press &lt;code&gt;M-y&lt;/code&gt; to run the command &lt;code&gt;yank-pop&lt;/code&gt;. Repeated presses will cycle through the &lt;code&gt;kill-ring&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hello, world!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and you kill &lt;code&gt;Hello&lt;/code&gt; and &lt;code&gt;world&lt;/code&gt; (you have &lt;code&gt;, !&lt;/code&gt; left), then go to the next line and hit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-y&lt;/kbd&gt; &lt;code&gt;world&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-y&lt;/kbd&gt; &lt;code&gt;Hello&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;C-y&lt;/kbd&gt; &lt;code&gt;Hello Hello&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C--&lt;/kbd&gt;&lt;kbd&gt;M-y&lt;/kbd&gt; &lt;code&gt;Hello world&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-03-27T14:56:31.493" LastActivityDate="2015-03-27T14:56:31.493" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10346" PostTypeId="2" ParentId="10344" CreationDate="2015-03-27T14:55:02.777" Score="1" Body="&lt;p&gt;After you paste, &lt;code&gt;M-y&lt;/code&gt; will replace the pasted text with previously copied text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you press &lt;code&gt;M-y&lt;/code&gt; multiple times then you can cycle through all your previously copied (or cut/killed) text&lt;/p&gt;&#xA;" OwnerUserId="915" LastActivityDate="2015-03-27T14:55:02.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10347" PostTypeId="2" ParentId="10344" CreationDate="2015-03-27T14:55:18.413" Score="3" Body="&lt;p&gt;@nanny has given you the answer. And if &lt;code&gt;M-y&lt;/code&gt; says that the previous command was not a yank then you probably forgot to do &lt;code&gt;C-y&lt;/code&gt; first.  IOW, you first do &lt;code&gt;C-y&lt;/code&gt; to yank the latest kill, which is not what you want. Then you do &lt;code&gt;M-y&lt;/code&gt; to get the previous one instead. You can repeat &lt;code&gt;M-y&lt;/code&gt; to cycle backward. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Yanking.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Yanking&lt;/strong&gt;&lt;/a&gt; for general information about copying and pasting, and the &lt;code&gt;kill-ring&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Anyway, I wanted to mention the &lt;a href=&quot;http://www.emacswiki.org/emacs/SecondarySelection&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;secondary selection&lt;/strong&gt;&lt;/a&gt;. In particular, it can be very handy in situations where you might otherwise want to use &lt;code&gt;C-y M-y&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The secondary selection is just what it says: a second selection, unrelated to the selection that is the region in Emacs. It stays available regardless of whether the region is active, and its position is not affected by point or mark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/SecondarySelection#secondary-sel.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;second-sel.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; then you get many of the advantages of the &lt;code&gt;kill-ring&lt;/code&gt; (which is for the region) for the secondary selection as well.  It adds the secondary selection to a second selection ring, &lt;code&gt;secondary-selection-ring&lt;/code&gt;, which is similar to, but separate from, the &lt;code&gt;kill-ring&lt;/code&gt;. It also prevents the secondary selection from being added to the &lt;code&gt;kill-ring&lt;/code&gt;, so you now have two separate selection-history rings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-y&lt;/code&gt; then cycles items from the appropriate ring, depending on whether it follows a yank of the primary (region) or pasting of the secondary selection.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-27T15:08:22.140" LastActivityDate="2015-03-27T15:08:22.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10348" PostTypeId="1" AcceptedAnswerId="10349" CreationDate="2015-03-27T16:38:10.010" Score="6" ViewCount="1590" Body="&lt;pre&gt;&lt;code&gt;(setq revert-without-query '(&quot;.*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this extra line in .emacs file, i have configured emacs to revert buffers without any prompt. It doesn't prompt for clean buffers but when the buffer has &lt;code&gt;unsaved&lt;/code&gt; changes, it &lt;code&gt;prompts&lt;/code&gt; for confirmation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how to use &lt;code&gt;revert-buffer&lt;/code&gt; with absolutely no prompts (no matter if buffer is clean (or) dirty)?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2015-03-27T18:57:08.057" LastActivityDate="2015-05-09T20:18:54.550" Title="Revert-buffer ---&gt; Discard unsaved changes without y/n prompt" Tags="|buffers|revert-buffer|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10349" PostTypeId="2" ParentId="10348" CreationDate="2015-03-27T16:40:52.600" Score="10" Body="&lt;p&gt;Not sure what you're asking. But FWIW, I use this, and I bind it to &lt;code&gt;&amp;lt;f5&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun revert-buffer-no-confirm ()&#xA;  &quot;Revert buffer without confirmation.&quot;&#xA;  (interactive) (revert-buffer t t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you probably do &lt;strong&gt;not&lt;/strong&gt; want to redefine or advise &lt;code&gt;revert-buffer&lt;/code&gt;. You probably want to change the behavior only for interactive calls (there are plenty of Lisp calls to &lt;code&gt;revert-buffer&lt;/code&gt;, and you don't want to affect their behavior).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's why I define a separate command, which I use when I want to revert without being prompted.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:18:54.550" LastActivityDate="2015-05-09T20:18:54.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10350" PostTypeId="1" AcceptedAnswerId="10352" CreationDate="2015-03-27T17:19:14.540" Score="10" ViewCount="1897" Body="&lt;p&gt;&lt;code&gt;evil-mode&lt;/code&gt; introduces vim-style colon commands (such as &lt;code&gt;:wq&lt;/code&gt; to save and close).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a few commands (such as &lt;code&gt;kill-buffer&lt;/code&gt;, &lt;code&gt;org-babel-tangle&lt;/code&gt;) that I'd like to be able to run through this instead of the keybindings they currently have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I add colon-commands like &lt;code&gt;:k&lt;/code&gt; for &lt;code&gt;kill-buffer&lt;/code&gt; and &lt;code&gt;:tangle&lt;/code&gt; for &lt;code&gt;org-babel-tangle&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2015-03-27T18:13:00.753" Title="How can I add a new colon-command to Evil?" Tags="|customize|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10352" PostTypeId="2" ParentId="10350" CreationDate="2015-03-27T18:13:00.753" Score="11" Body="&lt;p&gt;The official way of doing this is demonstrated in &lt;code&gt;evil-maps.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, creating a new ex command is very simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-ex-define-cmd &quot;b[utterfly]&quot; 'butterfly)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll want to either use this after enabling Evil or alternatively after loading the respective file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-ex&#xA;  '(evil-ex-define-cmd &quot;b[utterfly]&quot; 'butterfly))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing this will modify &lt;code&gt;evil-ex-commands&lt;/code&gt; appropriately.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-03-27T18:13:00.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10353" PostTypeId="1" AcceptedAnswerId="10546" CreationDate="2015-03-27T18:18:08.413" Score="6" ViewCount="2666" Body="&lt;p&gt;Occasionally I have this ugly red underline in my python code. It seems not related to any flymake error/warnings. Does anyone know why it shows and how it can be removed? Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using latest elpy and emacs (24.4) on Mac OSX 10.9&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UbAC8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem only occurs occasionally (but very annoying). Now it happens again. Here is the output of &lt;code&gt;describe-char&lt;/code&gt; on a SPACE character in red underline region:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             position: 848 of 1960 (43%), column: 6&#xA;            character: SPC (displayed as SPC) (codepoint 32, #o40, #x20)&#xA;    preferred charset: ascii (ASCII (ISO646 IRV))&#xA;code point in charset: 0x20&#xA;               script: latin&#xA;               syntax:      which means: whitespace&#xA;             category: .:Base, a:ASCII, l:Latin&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #x20&#xA;            file code: #x20 (encoded by coding system utf-8-unix)&#xA;              display: by this font (glyph code)&#xA;    mac-ct:-*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1 (#x03)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: SPACE&#xA;  general-category: Zs (Separator, Space)&#xA;  decomposition: (32) (' ')&#xA;&#xA;There are 4 overlays here:&#xA; From 42 to 1961&#xA;  semantic             [Show]&#xA; From 400 to 1961&#xA;  face                 semantic-unmatched-syntax-face&#xA;  semantic             unmatched&#xA; From 517 to 1469&#xA;  semantic             [Show]&#xA; From 531 to 1961&#xA;  face                 semantic-unmatched-syntax-face&#xA;  semantic             unmatched&#xA;&#xA;&#xA;There are text properties here:&#xA;  face                 font-lock-string-face&#xA;  fontified            t&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6885" LastEditorUserId="6885" LastEditDate="2015-04-04T00:50:28.623" LastActivityDate="2021-05-21T18:46:47.900" Title="how to remove the red underline" Tags="|python|elpy|" AnswerCount="2" CommentCount="12" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10354" PostTypeId="1" CreationDate="2015-03-27T19:14:39.497" Score="31" ViewCount="3402" Body="&lt;p&gt;I display images in-line with begin_src &amp;amp; result blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for large-images, when I scroll past the &lt;strong&gt;bottom&lt;/strong&gt; of the image, I get a 'jerk' and the whole image is scrolled away. Similarly if I scroll up and run into an image, I get a jerk and see the whole image instead of seeing it incrementally bit by bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes it hard to work with large plantuml/graphviz diagrams in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like a smooth scoll experience, to gently scroll past the image like in a web browser, without jerking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-window-vscroll nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and also &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq scroll-margin 1&#xA;scroll-conservatively 0&#xA;scroll-up-aggressively 0.01&#xA;scroll-down-aggressively 0.01)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried smooth-scroll package and &lt;a href=&quot;http://web.archive.org/web/20061025212623/http://www.cs.utexas.edu/users/hllu/EmacsSmoothScrolling.html&quot;&gt;this snippet&lt;/a&gt; also. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it seems an in-line image only takes up 'one-line' and fixing emacs to scroll only by 'one-line' doesn't fix the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any solution to this issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;  Keyboard vs Mouse scrolling: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mouse scrolling is implied. But keyboard scrolling would be a bonus if proper mouse scrolling would work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;&lt;br&gt;&#xA;Somewhat of a workaround, but useful for working with images in org-mode was to open them in an external app that auto-reloads on file change.&#xA;Example would be &lt;code&gt;eog (eye of gnome)&lt;/code&gt; or &lt;code&gt;shutter&lt;/code&gt; or &lt;code&gt;prievew (on OS X)&lt;/code&gt;. It can be configured via &lt;code&gt;org-file-apps&lt;/code&gt; by adding: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;extension: \.png\'&#xA;Command:   eog &quot;%s&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="105" LastEditDate="2015-12-19T21:51:38.713" LastActivityDate="2022-10-20T18:06:57.787" Title="Smooth (mouse) scroll for inline images?" Tags="|org-mode|org-babel|images|scrolling|mouse|" AnswerCount="4" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10355" PostTypeId="1" AcceptedAnswerId="10358" CreationDate="2015-03-27T19:49:26.103" Score="8" ViewCount="841" Body="&lt;p&gt;Rebinding your caps-lock key to control is a popular thing to do (though there are arguments against it, even if a bit pedantic).  However, the language I find a lot of my time in uses runs of capitals pretty extensively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a &lt;code&gt;caps-lock-mode&lt;/code&gt; that can simulate the behavior?  (Without affecting existing keybindings of course, e.g. striking &lt;code&gt;C-x C-s&lt;/code&gt; will not send &lt;code&gt;C-X C-S&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-03-27T21:47:33.240" Title="Is there a 'caps-lock-mode' for those of us who've rebound the key?" Tags="|key-bindings|minor-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10356" PostTypeId="5" CreationDate="2015-03-27T20:04:21.317" Score="0" Body="&lt;p&gt;Moving forward or backward among a set of things, to act on members successively. Can pertain to any kind of Emacs thing: buffers, windows, fonts, files, characters, completion candidates, colors,... whatever. The action performed on the thing can be different for different kinds of things (e.g., visit a file, change to a font, preview an image,...).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-27T20:04:21.317" LastActivityDate="2015-03-27T20:04:21.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10357" PostTypeId="4" CreationDate="2015-03-27T20:04:21.317" Score="0" Body="Moving forward or backward among a set of things, to act on members successively. Can pertain to any kind of Emacs thing: buffers, windows, fonts, files, characters, completion candidates, colors,... whatever." OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-27T20:04:21.317" LastActivityDate="2015-03-27T20:04:21.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10358" PostTypeId="2" ParentId="10355" CreationDate="2015-03-27T20:41:33.623" Score="10" Body="&lt;p&gt;Try the &lt;a href=&quot;http://elpa.gnu.org/packages/caps-lock.html&quot;&gt;&lt;code&gt;caps-lock&lt;/code&gt;&lt;/a&gt; minor mode package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Summary: Caps-lock as a minor mode&#xA;Homepage: http://elpa.gnu.org/packages/caps-lock.html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="115" LastEditDate="2015-03-27T21:47:33.240" LastActivityDate="2015-03-27T21:47:33.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10359" PostTypeId="1" AcceptedAnswerId="10360" CreationDate="2015-03-27T20:45:43.137" Score="12" ViewCount="708" Body="&lt;p&gt;I have the following&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun isearch-del-fail-or-char ()&#xA;  &quot;Delete failed isearch text, or if there is none, a single character.&quot;&#xA;  (interactive)&#xA;  (if (isearch-fail-pos)&#xA;      (delete-region (isearch-fail-pos) (point))&#xA;    (isearch-del-char)))&#xA;&#xA;(define-key isearch-mode-map (kbd &quot;DEL&quot;) 'isearch-del-fail-or-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The purpose of the code is to make &lt;code&gt;delete&lt;/code&gt; in isearch delete the entire failed string (or if there is no failed string just a single character). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;delete-region&lt;/code&gt; is deleting text from the buffer &lt;code&gt;isearch&lt;/code&gt; is searching in, not the isearch buffer itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the proper way to do this? Critique on the rest of my emacs lisp style is also welcome :)&lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="105" LastEditDate="2015-03-27T22:01:49.800" LastActivityDate="2015-04-30T05:39:44.447" Title="Delete portion of Isearch string that does not match, or last char if complete match" Tags="|isearch|deletion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10360" PostTypeId="2" ParentId="10359" CreationDate="2015-03-27T21:31:36.320" Score="13" Body="&lt;p&gt;Ah yes.  Isearch reads the keys you type, looks them up in &lt;code&gt;isearch-mode-map&lt;/code&gt;, and invokes them &lt;strong&gt;in the current buffer&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isearch does &lt;strong&gt;not&lt;/strong&gt;, in spite of appearances, use the minibuffer.  It uses the echo area. That is, what you see there is actually &lt;em&gt;output&lt;/em&gt; messages, including echoes of the characters you type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should do what you ask:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mydelete ()&#xA;  &quot;Delete the failed portion of the search string, or the last char if successful.&quot;&#xA;  (interactive)&#xA;  (with-isearch-suspended&#xA;      (setq isearch-new-string&#xA;            (substring&#xA;             isearch-string 0 (or (isearch-fail-pos) (1- (length isearch-string))))&#xA;            isearch-new-message&#xA;            (mapconcat 'isearch-text-char-description isearch-new-string &quot;&quot;))))&#xA;&#xA;(define-key isearch-mode-map (kbd &quot;DEL&quot;) 'mydelete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(BTW, your question says the &lt;code&gt;delete&lt;/code&gt; character, but you wrote &lt;code&gt;DEL&lt;/code&gt;, which is the backspace character.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As @Malabarba points out in a comment, when you set the new search string to &lt;strong&gt;&lt;code&gt;&quot;&quot;&lt;/code&gt;&lt;/strong&gt; (empty string), &lt;code&gt;with-isearch-suspended&lt;/code&gt; resumes by searching for the last search string, instead starting with an empty search string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a &quot;&lt;em&gt;feature&lt;/em&gt;&quot; of &lt;code&gt;with-isearch-suspended&lt;/code&gt;, in general.  But because you sometimes might really want to empty the search string for resumption, &#xA;in the version of &lt;code&gt;with-isearch-suspended&lt;/code&gt; in &lt;a href=&quot;http://www.emacswiki.org/emacs/download/isearch%2b.el&quot; rel=&quot;nofollow&quot;&gt;isearch+.el&lt;/a&gt; I've added variable &lt;strong&gt;&lt;code&gt;isearchp-if-empty-prefer-resuming-with-last&lt;/code&gt;&lt;/strong&gt;, to control this.  If you bind that to &lt;code&gt;nil&lt;/code&gt; and you set &lt;code&gt;isearch-new-string&lt;/code&gt; to &lt;code&gt;&quot;&quot;&lt;/code&gt; then search resumes with an empty search string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So with &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; you can do what you want with this definition:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mydelete ()&#xA;  &quot;Delete the failed portion of the search string, or the last char if successful.&quot;&#xA;  (interactive)&#xA;  (let ((isearchp-if-empty-prefer-resuming-with-last  nil))&#xA;    (with-isearch-suspended&#xA;        (setq isearch-new-string&#xA;              (substring&#xA;               isearch-string 0 (or (isearch-fail-pos) (1- (length isearch-string))))&#xA;              isearch-new-message&#xA;              (mapconcat 'isearch-text-char-description isearch-new-string &quot;&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I notice too now that Emacs 24.4 introduced a regression, which I've filed &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20466&quot; rel=&quot;nofollow&quot;&gt;Emacs bug #20466&lt;/a&gt; for, which means that binding &lt;code&gt;DEL&lt;/code&gt; in &lt;code&gt;isearch-mode-map&lt;/code&gt; is not sufficient.  They added a separate binding for &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt;, in addition to one for &lt;code&gt;DEL&lt;/code&gt;.  That means that &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; no longer gets translated to &lt;code&gt;DEL&lt;/code&gt;, for Isearch (but it does still get so translated for Emacs generally).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want the Backspace key to do what you asked in Emacs 24.4 or later then you cannot just bind &lt;code&gt;DEL&lt;/code&gt; to &lt;code&gt;mydelete&lt;/code&gt;.  You need to bind &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; to &lt;code&gt;mydelete&lt;/code&gt;.  Dumb, AFAICT, mais &lt;em&gt;on n'arrete pas le progres&lt;/em&gt;...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've added a similar command to &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; and bound it to &lt;strong&gt;&lt;code&gt;C-M-l&lt;/code&gt;&lt;/strong&gt; (the same key used to remove a completion mismatch in &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware too that &lt;code&gt;C-g&lt;/code&gt; in Isearch will also, when there is a mismatch, remove the mismatched text.  (But &lt;code&gt;C-g&lt;/code&gt; also has an effect when search is successful.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I should have mentioned that &lt;strong&gt;Isearch+&lt;/strong&gt; has also had an optional behavior along similar lines for quite a while now. &lt;strong&gt;&lt;code&gt;M-k&lt;/code&gt;&lt;/strong&gt; during Isearch toggles among 3 behaviors, which are controlled by the value of option &lt;strong&gt;&lt;code&gt;isearchp-drop-mismatch&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;replace-last&lt;/code&gt; - Your current input replaces the last mismatched&#xA;text.  You can always see your last input, even&#xA;if it is a mismatch.  And it is available for&#xA;editing using &lt;code&gt;M-e&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;nil&lt;/code&gt; - Your current input is appended, even if the&#xA;previous input has a mismatched portion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;anything else  - Your current input is ignored (removed) if it&#xA;causes a mismatch.  The search string always has successful matches.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-30T05:39:44.447" LastActivityDate="2015-04-30T05:39:44.447" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="10361" PostTypeId="1" AcceptedAnswerId="18333" CreationDate="2015-03-27T22:14:53.413" Score="4" ViewCount="147" Body="&lt;p&gt;I've looked for a solution to this a number of times. Suppose 'kg' normally expands to 'knowledge' in my abbrev file. I wonder if there is any way to get emacs to expand after a single or double quotation mark, as in expanding from&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;&quot;kg&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;&quot;knowledge&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't know lisp well but am willing to play with my .emacs. Thanks for any help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;: I just noticed that it works fine in the scratch buffer, but not in markdown or LaTeX modes.&lt;/p&gt;&#xA;" OwnerUserId="6886" LastEditorUserId="50" LastEditDate="2015-03-28T23:46:22.193" LastActivityDate="2016-08-02T02:59:37.027" Title="Abbrev expansion after quotation mark" Tags="|auctex|abbrev|markdown-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10362" PostTypeId="1" AcceptedAnswerId="10363" CreationDate="2015-03-27T22:49:11.517" Score="1" ViewCount="213" Body="&lt;p&gt;Is there a way to add text properties to empty strings? As far as I can tell, calling &lt;code&gt;put-text-property&lt;/code&gt; on an empty string silently does nothing. I seem to recall reading somewhere that the empty string is (at least potentially) a singleton, so perhaps this is why it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may seem like a perverse thing to want to do since a text property that doesn't apply to any text is pretty useless. I'm working on a company-mode backend that – for reasons which aren't really important to this question – needs to remember where the completion prefix starts. This is easy to calculate, and after doing so I stash the offset as a text property on the prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a prefix can, in some very important cases, be blank. Since I can't add properties to an empty prefix, I'm stuck checking whether the property is blank in lots of places. Hence, my initial question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's not possible to add text properties to blank strings, is there some other way I could transparently associate extra data with the empty prefix string? I know some lisps allow you to tack meta data onto objects, so perhaps there's something like this in elisp. Any ideas would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="105" LastEditDate="2015-05-20T05:08:36.383" LastActivityDate="2015-05-20T05:08:36.383" Title="Adding text properties to empty strings?" Tags="|elisp|company-mode|text-properties|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10363" PostTypeId="2" ParentId="10362" CreationDate="2015-03-27T23:03:37.320" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Nope. When you add text properties to a string you really add them to the characters in the string. There are no characters in an empty string - nothing to add the properties to.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I know of no way to associate anything with an empty string. However, you can associate data with a cons cell (which contains an empty string, for example). Or you can associate data with a non-empty string (which has an empty string as its prefix or suffix or anywhere else inside it, for example). And you can associate data with a symbol, and that symbol can have an associated string (either its print name or as a separate property).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;IOW, try encapsulating your string within a cons cell, a larger string, or a symbol, or a structure/object,...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or else keep track of the data in a separate structure that stores info about several such strings (e.g., the bookmarks model).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-27T23:03:37.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10364" PostTypeId="1" AcceptedAnswerId="10368" CreationDate="2015-03-28T00:20:23.760" Score="1" ViewCount="531" Body="&lt;p&gt;I have added these lines to a file &lt;code&gt;~/.emacs.d/package_init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I both restarting &lt;code&gt;aquamacs&lt;/code&gt; and runing &lt;code&gt;m-x package-initialize&lt;/code&gt;, but I fail to find &lt;code&gt;projectile&lt;/code&gt; in the listing. Here is a partial screenshot of the result of &lt;code&gt;m-x package-list-packages&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/T8U5B.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have confirmed that this package exists on MELPA &lt;a href=&quot;http://stable.melpa.org/#/projectile&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://stable.melpa.org/#/projectile&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What have I done wrong? How can I install this package?&lt;/p&gt;&#xA;" OwnerUserId="169" LastEditorUserId="50" LastEditDate="2015-03-28T12:33:42.790" LastActivityDate="2015-06-15T21:10:28.847" Title="Unable to find projectile in the package list" Tags="|package|package-repositories|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10365" PostTypeId="1" CreationDate="2015-03-28T04:20:43.447" Score="1" ViewCount="301" Body="&lt;p&gt;I have been trying to get Ergoemacs working on Mac for about 2 weeks now and I have finally managed to get it working using a combo of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ignoring Mac's supplied ancient build of Emacs&lt;/li&gt;&#xA;&lt;li&gt;Installing from Brew.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My final hurdle seems to be that the keyboard maps that comes with ITerm2 and Mac in general seems to be in loggerheads with those defined in Ergoemacs. I have looked at Aquamacs and they seem to come with another set of keyboard shortcuts. I would really hate to have to learn one set of keyboard shortcut during the time I work on Mac and the other times when I am on my Linux machine as that would really hurt my muscle memory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further digging indicated I need to change the key binding for Mac but the keybinding provided is only for Mac OS X. Any idea how to get it working on Yosemite or better yet how do I change the keybinding on Yosemite?&lt;/p&gt;&#xA;" OwnerUserId="6753" LastEditorUserId="25" LastEditDate="2015-04-19T14:07:00.373" LastActivityDate="2015-04-19T14:07:00.373" Title="Trying to use ergoemacs on Mac" Tags="|osx|ergoemacs|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10366" PostTypeId="2" ParentId="10364" CreationDate="2015-03-28T07:37:50.167" Score="1" Body="&lt;p&gt;Check &lt;code&gt;*Messages*&lt;/code&gt; for any errors that come up when you do &lt;code&gt;M-x package-initialize&lt;/code&gt;. You might also try doing a &lt;code&gt;C-h v package-archives&lt;/code&gt; to make sure that &lt;code&gt;http://melpa.org/packages/&lt;/code&gt; is really there, and not getting removed somehow.&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2015-03-28T09:02:12.457" LastActivityDate="2015-03-28T09:02:12.457" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10367" PostTypeId="1" AcceptedAnswerId="10369" CreationDate="2015-03-28T10:27:08.400" Score="3" ViewCount="1770" Body="&lt;p&gt;&lt;code&gt;'(1 2 3)&lt;/code&gt; gives me a list of three elements, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq A &quot;apple&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'(A)&lt;/code&gt; gives me &lt;code&gt;(A)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how can I get the list &lt;code&gt;'(&quot;apple&quot;)&lt;/code&gt; by referring variable A? &lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="115" LastEditDate="2015-03-28T14:10:01.677" LastActivityDate="2015-03-28T14:10:01.677" Title="Construct a list from a variable" Tags="|elisp|" AnswerCount="1" CommentCount="4" ClosedDate="2015-03-28T23:59:28.820" ContentLicense="CC BY-SA 3.0" />
  <row Id="10368" PostTypeId="2" ParentId="10364" CreationDate="2015-03-28T12:37:24.507" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What have I done wrong? How can I install this package?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You said you added this configuration to a file called&#xA;&lt;code&gt;~/.emacs.d/package_init.el&lt;/code&gt;, but Emacs will do nothing to load this&#xA;file by itself. If you want the configurations to take effect, you&#xA;need to either put them in &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; or add a line&#xA;like the following inside your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load (locate-user-emacs-file &quot;package_init.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-06-15T21:10:28.847" LastActivityDate="2015-06-15T21:10:28.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10369" PostTypeId="2" ParentId="10367" CreationDate="2015-03-28T13:39:05.557" Score="11" Body="&lt;p&gt;&lt;em&gt;How can I get the list '(&quot;apple&quot;) by referring variable A?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list A)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(,A)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How come there are several ways to construct a list?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;&lt;code&gt;'&lt;/code&gt;&lt;/strong&gt; in &lt;code&gt;'(A)&lt;/code&gt; does &lt;strong&gt;not&lt;/strong&gt; construct a list. The Lisp &lt;strong&gt;reader&lt;/strong&gt; constructs a list when it reads &lt;strong&gt;&lt;code&gt;(A)&lt;/code&gt;&lt;/strong&gt;. The &lt;code&gt;'&lt;/code&gt; prevents the Lisp REPL (i.e., the top-level loop) from evaluating the list that was read, so the list is just returned.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Function &lt;code&gt;list&lt;/code&gt; also does not construct a list, directly (depending on the Lisp implementation).  The two list constructors in Lisp are &lt;code&gt;cons&lt;/code&gt; and &lt;code&gt;nil&lt;/code&gt; (aka &lt;code&gt;()&lt;/code&gt;). Function &lt;code&gt;list&lt;/code&gt; uses those two constructors: &lt;code&gt;(list)&lt;/code&gt; returns &lt;code&gt;()&lt;/code&gt;, and &lt;code&gt;(list X)&lt;/code&gt; returns &lt;code&gt;(cons value-of-X nil)&lt;/code&gt;, which is also written &lt;code&gt;(value-of-X)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The backquote syntax of &lt;code&gt;`(,A)&lt;/code&gt; is syntactic sugar for calls to functions such as &lt;code&gt;list&lt;/code&gt; and &lt;code&gt;cons&lt;/code&gt;.  For example, in this case it could be an abbreviation for &lt;code&gt;(list A)&lt;/code&gt;. The comma (&lt;code&gt;,&lt;/code&gt;) means evaluate what follows, and the backquote (&lt;code&gt;`&lt;/code&gt;) means do not evaluate what follows, except for nested comma constructs.  So &lt;code&gt;`(,A)&lt;/code&gt; could be read as &quot;&lt;em&gt;evaluate &lt;code&gt;A&lt;/code&gt; and wrap it in parens to make a singleton list&lt;/em&gt;&quot;. Backquote syntax shows you a picture of what it produces. You just need to plug in (substitute) the value of whatever follows a comma.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-03-28T13:39:05.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10370" PostTypeId="1" CreationDate="2015-03-28T14:39:46.313" Score="1" ViewCount="136" Body="&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| low | high | students | F(students) |&#xA;|-----+------+----------+-------------|&#xA;|   0 |   30 |       15 |          15 |&#xA;|  30 |   60 |       30 |          45 |&#xA;|  60 |   70 |       40 |          85 |&#xA;|  70 |   90 |       60 |         145 |&#xA;|  90 |  100 |       15 |         160 |&#xA;#+TBLFM: @2$4..@&amp;gt;$4=mcol(accum(add, @2$3..@&amp;gt;$3), @#-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hoped to do away without &lt;code&gt;mcol()&lt;/code&gt;. For a small table like this it doesn't really matter, but, in general, this will needlessly recalculate the values as many times as there are rows. How would I avoid it?&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-06-25T19:16:29.760" Title="How to force Org to interpret Calc result as a column?" Tags="|org-mode|org-table|calc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10372" PostTypeId="1" CreationDate="2015-03-28T19:55:43.757" Score="2" ViewCount="775" Body="&lt;p&gt;Basically, I want to ensure that the &lt;code&gt;elfeed&lt;/code&gt; package is available and load it with &lt;code&gt;use-package&lt;/code&gt;, but only on one computer, so I wrote something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (string= system-name &quot;here-elfeed-shall-not-run&quot;)&#xA;  (use-package elfeed&#xA;    :ensure t&#xA;    :config&#xA;     (setq elfeed-feeds '(blabla doesnt matter))))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that even though the use-package part is not supposed to run (because system-name == &quot;here-elfeed-shall-not-run&quot;), it, in fact, runs.&#xA;I dealt with this by using an if keyword:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package elfeed&#xA;  :if (not (string= system-name &quot;here-elfeed...&quot;))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which would be great, if I could still ensure that elfeed is available on the computer on which I want it to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to ensure that elfeed exists on one PC, but shouldn't be downloaded on the other?&lt;/p&gt;&#xA;" OwnerUserId="6892" LastActivityDate="2015-03-30T14:51:28.850" Title="Conditional ensure in use-package" Tags="|use-package|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10373" PostTypeId="2" ParentId="10372" CreationDate="2015-03-28T20:02:27.897" Score="2" Body="&lt;p&gt;No need to complicate things. The code is as simple as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(unless (or (string= system-name &quot;here-elfeed-shall-not-run&quot;)&#xA;            (package-installed-p 'elfeed))&#xA;  (package-install 'elfeed))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-03-30T07:09:40.590" LastActivityDate="2015-03-30T07:09:40.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10374" PostTypeId="1" CreationDate="2015-03-28T21:12:48.623" Score="2" ViewCount="326" Body="&lt;p&gt;I wonder what is wrong with the following code?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defvar my-forward-word-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map (kbd &quot;n&quot;) 'forward-word)&#xA;    (define-key map (kbd &quot;p&quot;) 'my-backward-word)&#xA;    map))&#xA;&#xA;(defvar my-backward-word-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map (kbd &quot;p&quot;) 'backward-word)&#xA;    (define-key map (kbd &quot;n&quot;) 'my-forward-word)&#xA;    map))&#xA;&#xA;(defun my-forward-word ()&#xA;  (interactive)&#xA;  (set-transient-map my-forward-word-map t))&#xA;&#xA;(defun my-backward-word ()&#xA;  (interactive)&#xA;  (set-transient-map my-backward-word-map t))&#xA;&#xA;(global-set-key (kbd &quot;M-n&quot;) 'my-forward-word)&#xA;(global-set-key (kbd &quot;M-p&quot;) 'my-backward-word)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a buffer with the text: &lt;code&gt;|Hello world&lt;/code&gt;. &lt;code&gt;|&lt;/code&gt; - this is cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I press &lt;code&gt;M-n&lt;/code&gt;, &lt;code&gt;n&lt;/code&gt;. I get &lt;code&gt;Hello| world&lt;/code&gt; as I expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I press &lt;code&gt;p&lt;/code&gt;, &lt;code&gt;p&lt;/code&gt;. I get &lt;code&gt;|Hello world&lt;/code&gt; as was previously. And that's fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I press &lt;code&gt;n&lt;/code&gt; again nothing happens i.e. cursor doesn't change its position no matter how many time I press &lt;code&gt;n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt; I expected to get &lt;code&gt;Hello| world&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's wrong?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;$ emacs --version&#xA;GNU Emacs 24.4.1&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="336" LastEditorUserId="50" LastEditDate="2015-03-28T23:36:26.207" LastActivityDate="2015-03-29T03:19:57.097" Title="set-transient-map doesn't behave properly after repetitive call" Tags="|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10375" PostTypeId="1" AcceptedAnswerId="10385" CreationDate="2015-03-28T23:36:46.613" Score="1" ViewCount="436" Body="&lt;p&gt;I have two master files in the same directory, one &quot;main.tex&quot; for the main document (includes several files through &lt;code&gt;\input&lt;/code&gt;) and &quot;test.tex&quot; which I use to compile just a section at a time for testing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even while the footer of &quot;test.tex&quot; says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%% Local Variables:&#xA;%%% mode: latex&#xA;%%% TeX-master: t&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I hit &lt;code&gt;C-c C-c&lt;/code&gt; (&lt;code&gt;TeX-command-master&lt;/code&gt;), it compiles &quot;main.tex&quot;. How can I get it to compile &quot;test.tex&quot;?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastActivityDate="2015-03-29T21:33:04.990" Title="AucTeX multiple master files in same directory?" Tags="|auctex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10376" PostTypeId="2" ParentId="10374" CreationDate="2015-03-29T02:49:27.400" Score="1" Body="&lt;p&gt;It looks like a bug, to me. Adding some debug &lt;code&gt;message&lt;/code&gt; calls, I see that the first &lt;code&gt;n&lt;/code&gt; (after &lt;code&gt;p p&lt;/code&gt;), correctly calls &lt;code&gt;my-forward-word&lt;/code&gt;, but the second &lt;code&gt;n&lt;/code&gt; then is interpreted in &lt;code&gt;my-backward-word-map&lt;/code&gt;, not in &lt;code&gt;my-forward-word-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, the call in &lt;code&gt;my-forward-word&lt;/code&gt; of &lt;code&gt;(set-transient-map my-forward-word-map t)&lt;/code&gt; seems to have no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And you get the same behavior if you bind &lt;code&gt;M-n&lt;/code&gt; instead of &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;M-p&lt;/code&gt; instead of &lt;code&gt;p&lt;/code&gt;, in the transient maps; IOW, if you try to use only &lt;code&gt;M-n&lt;/code&gt; and &lt;code&gt;M-p&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless someone points out something we're missing, you might consider filing a bug report: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Yes, I'd say that it is definitely a bug.  I just tried it in Emacs 24.3, for which the function was named &lt;code&gt;set-temporary-overlay-map&lt;/code&gt; instead of &lt;code&gt;set-transient-map&lt;/code&gt;, and there it works. So this is apparently a regression, introduced in Emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please file a bug report.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-03-29T03:19:57.097" LastActivityDate="2015-03-29T03:19:57.097" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="10377" PostTypeId="2" ParentId="3458" CreationDate="2015-03-29T05:13:37.423" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/AceJump&quot; rel=&quot;nofollow&quot;&gt;Ace Jump&lt;/a&gt; lets you navigate your pointer to all words on a screen, regardless of what window or frame they're in, so it's not so different from using Ace Window or Switch Window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An advantage could be that while jumping windows you can also place your pointer with some precision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still find it a little cumbersome or distracting, and find I'm using &lt;code&gt;windmove&lt;/code&gt; more, because it's very simple, but still use Ace Jump when I've been reading in another window or frame and want to move to a spot there.&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="5168" LastEditDate="2015-03-29T06:17:06.117" LastActivityDate="2015-03-29T06:17:06.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10378" PostTypeId="1" AcceptedAnswerId="10550" CreationDate="2015-03-29T07:46:24.770" Score="1" ViewCount="799" Body="&lt;p&gt;As I'm typing into my buffer in &lt;code&gt;js2-mode&lt;/code&gt;, the syntax is not being updated and all my new code is plain white. Additionally, existing text keeps its original color. For example, when I uncomment some commented code, the color is still darkened as if it were still a comment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can refresh my buffer via &lt;code&gt;C-x C-v RET&lt;/code&gt; or refresh the mode via &lt;code&gt;M-x js2-mode RET&lt;/code&gt;, which updates the highlighting, but this is annoying. Any suggestions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, syntax errors that are shown in the mini buffer do not go away unless I refresh the buffer or mode as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After enabling &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt;, here is the output of my &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debug on Error enabled globally&#xA;Saving file /home/lucas/class/nodeschool/how-to-npm/web-sockets.js...&#xA;Wrote /home/lucas/class/nodeschool/how-to-npm/web-sockets.js&#xA;Saving file /home/lucas/class/nodeschool/how-to-npm/web-sockets.js...&#xA;Wrote /home/lucas/class/nodeschool/how-to-npm/web-sockets.js&#xA;Saving file /home/lucas/class/nodeschool/how-to-npm/web-sockets.js...&#xA;Wrote /home/lucas/class/nodeschool/how-to-npm/web-sockets.js&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions about what might be going wrong?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-04-01T07:07:45.913" LastActivityDate="2015-04-07T03:49:43.903" Title="js2-mode: Highlighting and syntax checks only update when the buffer or mode is refreshed" Tags="|syntax-highlighting|js2-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10379" PostTypeId="2" ParentId="10344" CreationDate="2015-03-29T10:37:06.857" Score="2" Body="&lt;p&gt;The best solution I've found is &lt;code&gt;helm-show-kill-ring&lt;/code&gt;.  I used Helm for quite a while before I even realized this existed.  I have it bound to &lt;code&gt;M-y&lt;/code&gt;.  It makes it very fast and easy to see existing entries, narrow them down, and choose the one you want.&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2015-03-29T10:37:06.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10380" PostTypeId="2" ParentId="10260" CreationDate="2015-03-29T11:55:29.357" Score="1" Body="&lt;p&gt;Debian and Ubuntu split up Emacs into several binary packages.  When you use &lt;code&gt;checkinstall&lt;/code&gt;, you instead put everything in a single package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you're installing something that isn't packaged by Debian/Ubuntu, that's usually fine; but when you install something that is already packaged by D/U, your custom package will overlap with some of the distro packages, and the dependencies will not mesh together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a few potential solutions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Remove all Emacs packages, then install your custom package again.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead of using &lt;code&gt;checkinstall&lt;/code&gt;, build the new version Debian-style.  First, download and extract the source package for the current Ubuntu package.  Then copy its &lt;code&gt;debian&lt;/code&gt; directory into the source directory for the new Emacs version.  Then use &lt;code&gt;dch&lt;/code&gt; to update the changelog.  Then build the package (there are different ways, but I usually use &lt;code&gt;dpkg-buildpackage -us -uc -rfakeroot -j4&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs 24.4 is packaged in Debian testing, even though it's not in Ubuntu yet.  So download the Debian source package and build it.  Then install the appropriate packages that are built.  This method often works for software that is fresher in Debian than in Ubuntu.  This is what I did for Emacs 24.4 and it works fine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2015-03-29T11:55:29.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10381" PostTypeId="2" ParentId="10343" CreationDate="2015-03-29T16:11:07.650" Score="2" Body="&lt;p&gt;How silly of me!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turns out I had been setting the project root to the source directory rather than the build directory. If set to build directory irony-cdb works great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, to set additional compile options, it's useful to set irony-additional-clang-options, and naturally, putting these into a script.&lt;/p&gt;&#xA;" OwnerUserId="5510" LastActivityDate="2015-03-29T16:11:07.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10382" PostTypeId="1" CreationDate="2015-03-29T18:19:31.923" Score="3" ViewCount="192" Body="&lt;p&gt;I want to define a function &lt;code&gt;org-move-subtree-top&lt;/code&gt; that calls &lt;code&gt;org-move-subtree-up&lt;/code&gt; until it returns a &lt;code&gt;user-error&lt;/code&gt; (in this case &quot;Cannot move past superior level or buffer limit&quot;). How can I do this in elisp?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="25" LastEditDate="2015-03-29T18:56:22.153" LastActivityDate="2015-03-29T19:10:15.050" Title="Perform function until it returns user-error" Tags="|org-mode|elisp|error-handling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10383" PostTypeId="2" ParentId="10382" CreationDate="2015-03-29T18:56:07.463" Score="2" Body="&lt;p&gt;Write an infinite loop, and catch the error outside the loop.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case nil&#xA;    (while t&#xA;      (org-move-subtree-up))&#xA;  (error nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org mode 7.8.11 throws a plain &lt;code&gt;error&lt;/code&gt; for this message. If you have a more recent version that calls &lt;code&gt;user-error&lt;/code&gt; instead of &lt;code&gt;error&lt;/code&gt;, replace &lt;code&gt;error&lt;/code&gt; by &lt;code&gt;user-error&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This hides all errors. It would be safer to catch only the specific error that you intended to happen, but that requires hard-coding the error message.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case err&#xA;    (while t&#xA;      (org-move-subtree-up))&#xA;  (error (or (equal (cdr err) &quot;Cannot move past superior level or buffer limit&quot;)&#xA;             (signal (car err) (cdr err)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could implement this without calling &lt;code&gt;org-move-subtree-up&lt;/code&gt;: find the boundaries of the subtree, find the target position, and move it there. Untested.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-move-subtree-top ()&#xA;  &quot;Move the current subtree just after the heading of its parent.&quot;&#xA;  (interactive &quot;*&quot;)&#xA;  (let* ((target (save-excursion&#xA;                   (org-back-to-heading)&#xA;                   (outline-up-heading)&#xA;                   (forward-line)&#xA;                   (point)))&#xA;        (beg (progn&#xA;               (org-back-to-heading)&#xA;               (point))&#xA;        (end (progn&#xA;               (org-end-of-subtree)&#xA;               (point)))&#xA;        (text (buffer-substring beg end)))&#xA;    (delete-region text)&#xA;    (goto-char target)&#xA;    (insert text)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-03-29T19:10:15.050" LastActivityDate="2015-03-29T19:10:15.050" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10384" PostTypeId="1" AcceptedAnswerId="10386" CreationDate="2015-03-29T21:32:12.633" Score="12" ViewCount="2905" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how does one test string equality but ignore case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've got a situation in which I'd like to compare strings but ignore case.  Case is significant for &lt;code&gt;string-equal&lt;/code&gt;, and apparently is insensitive to &lt;code&gt;case-fold-search&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-equal &quot;string&quot; &quot;StrinG&quot;)        ; =&amp;gt; nil&#xA;(let ((case-fold-search t))&#xA;  (string-equal &quot;string&quot; &quot;StrinG&quot;))     ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could always preprocess the strings (say, with &lt;code&gt;downcase&lt;/code&gt;) before comparing them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-equal (downcase &quot;string&quot;)&#xA;              (downcase &quot;StrinG&quot;))      ; =&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that seems like overkill to do two extra function calls every time.  Have I overlooked the relevant predicate function somewhere?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2021-04-12T12:58:36.420" Title="String equality, ignore case?" Tags="|elisp|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10385" PostTypeId="2" ParentId="10375" CreationDate="2015-03-29T21:33:04.990" Score="2" Body="&lt;p&gt;You previously set the master file of &lt;code&gt;test.tex&lt;/code&gt; to &lt;code&gt;main&lt;/code&gt;, and then changed it to &lt;code&gt;t&lt;/code&gt;.  In order to make the change effective you have to revert the buffer (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;revert-buffer&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;), or issue &lt;kbd&gt;C-c C-n&lt;/kbd&gt; (&lt;code&gt;TeX-normal-mode&lt;/code&gt;) if you want to exploit file parsing.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-03-29T21:33:04.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10386" PostTypeId="2" ParentId="10384" CreationDate="2015-03-29T22:09:04.470" Score="10" Body="&lt;p&gt;You can use &lt;code&gt;compare-strings&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(compare-strings STR1 START1 END1 STR2 START2 END2 &amp;amp;optional IGNORE-CASE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;nil&lt;/code&gt;s for starts and ends to use the whole strings.&lt;/p&gt;&#xA;" OwnerUserId="2526" LastActivityDate="2015-03-29T22:09:04.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10387" PostTypeId="1" AcceptedAnswerId="10390" CreationDate="2015-03-29T23:17:01.343" Score="2" ViewCount="138" Body="&lt;p&gt;I have Emacs Lisp program that I want to work inside either a comint process buffer or an eshell buffer. The code I currently am using is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/rocky/emacs-dbgr/blob/master/realgud/common/track-mode.el#L141-L147&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rocky/emacs-dbgr/blob/master/realgud/common/track-mode.el#L141-L147&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but this is a bit ugly and might be prone to breakage if either the comint or eshell changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? &lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-06-29T13:21:03.640" LastActivityDate="2015-06-29T13:21:03.640" Title="How can I tell if a buffer is a comint buffer, eshell buffer or neither?" Tags="|major-mode|eshell|comint|realgud|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10388" PostTypeId="1" CreationDate="2015-03-29T23:34:34.503" Score="3" ViewCount="173" Body="&lt;p&gt;I am writing some Elisp for a package. I was using &lt;code&gt;vc-working-revision&lt;/code&gt; to identify the current revision. But it only returns the branch &lt;em&gt;name&lt;/em&gt;, not the hash that name points to. Therefore, this information goes out of date quickly (&lt;code&gt;master&lt;/code&gt; now is not &lt;code&gt;master&lt;/code&gt; 20min from now).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I was surprised. Branch names have little to do with revisions.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to (cross vc-system) get a unique identifier for the current head that is not time-sensitive with &lt;code&gt;vc&lt;/code&gt;. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-05-04T09:19:33.753" Title="Get unique, permanant revision name in vc" Tags="|git|version-control|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10389" PostTypeId="1" AcceptedAnswerId="10406" CreationDate="2015-03-29T23:39:24.557" Score="1" ViewCount="118" Body="&lt;ul&gt;&#xA;&lt;li&gt;Operating system: Ubuntu 14.04&lt;/li&gt;&#xA;&lt;li&gt;Emacs version: GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2015-03-12 onlcy01-03&lt;/li&gt;&#xA;&lt;li&gt;AUCTeX version: AUCTeX-version is a variable defined in `tex-site.el'.&#xA;Its value is &quot;2015-03-08&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a screenshot of what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/l2zhR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tab button cause the first line after &lt;code&gt;\[&lt;/code&gt; to -2 indent and then &lt;code&gt;\]&lt;/code&gt; to do another -2 indent. It was causing this behavior with the &lt;code&gt;cases&lt;/code&gt; environment as well, but I was able to stop it by adding &lt;code&gt;(&quot;cases&quot; LaTeX-indent-tabular)&lt;/code&gt; to &lt;code&gt;'(LaTeX-indent-environment-list&lt;/code&gt;. I tried adding &lt;code&gt;(&quot;displaymath&quot; current-indentation)&lt;/code&gt; but this didn't solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Start server and set directory&#xA;(setq server-socket-dir (format &quot;/tmp/emacs1000&quot;))&#xA;;; Not sure if (useruid) does anything or the difference between&#xA;;; (server-start) and '(server-mode t) in custom&#xA;;(setq server-socket-dir (format &quot;/tmp/emacs1000&quot; (user-uid)))&#xA;;(server-start)&#xA;&#xA;;; Package initialize&#xA;(package-initialize)&#xA;&#xA;;; Package list M-x package-list-packages&#xA;(require 'package)&#xA;(add-to-list 'package-archives &#xA;         '(&quot;marmelade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives &#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;(add-to-list 'package-archives &#xA;         '(&quot;elpa&quot; . &quot;http://tromey.com/elpa/&quot;))&#xA;&#xA;;; AucTex &amp;amp; RefTeX&#xA;(add-to-list 'load-path &quot;/usr/local/share/emacs/site-lisp/&quot;)&#xA;(load &quot;auctex.el&quot; nil t t)&#xA;(load &quot;preview-latex.el&quot; nil t t)&#xA;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)&#xA;(setq reftex-plug-into-AUCTex t)&#xA;(global-font-lock-mode t)&#xA;(setq font-lock-maximum-decoration t)&#xA;(setq TeX-auto-save t)&#xA;(setq TeX-parse-self t)&#xA;(setq-default TeX-master nil)&#xA;(setq TeX-save-query nil)&#xA;&#xA;;; Copy and paste between Emac   instances     &#xA;(setq x-select-enable-clipboard t)&#xA;(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)&#xA;&#xA;;; Disablin autosave                                                           &#xA;(setq auto-save-default nil)&#xA;&#xA;;; Adjusting tab distance&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 2)&#xA;&#xA;;; Enable Line Numbering&#xA;(setq line-number-mode t)&#xA;(setq column-number-mode t)&#xA;&#xA;;; Set the fill column&#xA;(setq default-fill-column 80)&#xA;&#xA;;; Turn on Auto Fill mode automatically in all modes&#xA;;; Auto-fill-mode the the automatic wrapping of lines and insertion of&#xA;;; newlines when the cursor goes over the column limit.&#xA;;; This should actually turn on auto-fill-mode by default in all major&#xA;;; modes. The other way to do this is to turn on the fill for specific modes&#xA;;; via hooks.  &#xA;(setq auto-fill-mode 1)&#xA;&#xA;;;  Turn on visual line mode&#xA;(global-visual-line-mode t)&#xA;&#xA;;; Prevent Emacs from making backup files&#xA;(setq make-backup-files nil)&#xA;&#xA;;; Cleverref setup&#xA;(eval-after-load&#xA;    &quot;latex&quot;&#xA;  '(TeX-add-style-hook&#xA;    &quot;cleveref&quot;&#xA;    (lambda ()&#xA;      (if (boundp 'reftex-ref-style-alist)&#xA;      (add-to-list&#xA;       'reftex-ref-style-alist&#xA;       '(&quot;Cleveref&quot; &quot;cleveref&quot;&#xA;         ((&quot;\\cref&quot; ?c) (&quot;\\Cref&quot; ?C) (&quot;\\cpageref&quot; ?d) (&quot;\\Cpageref&quot; ?D)))))&#xA;      (add-to-list 'reftex-ref-style-default-list &quot;Cleveref&quot;)&#xA;      (TeX-add-symbols&#xA;       '(&quot;cref&quot; TeX-arg-ref)&#xA;       '(&quot;Cref&quot; TeX-arg-ref)&#xA;       '(&quot;cpageref&quot; TeX-arg-ref)&#xA;       '(&quot;Cpageref&quot; TeX-arg-ref)))))&#xA;&#xA;;; Latexmk setup&#xA;(defun run-latexmk ()&#xA;  (interactive)&#xA;  (let ((TeX-save-query nil)&#xA;        (TeX-process-asynchronous nil)&#xA;        (master-file (TeX-master-file)))&#xA;    (TeX-save-document &quot;&quot;)&#xA;    (TeX-run-TeX &quot;latexmk&quot;&#xA;         (TeX-command-expand &quot;latexmk -pdf %s&quot; 'TeX-master-file)&#xA;                 master-file))&#xA;  (if (plist-get TeX-error-report-switches (intern master-file))&#xA;      (TeX-next-error t)&#xA;    (progn&#xA;      (demolish-tex-help)&#xA;      (minibuffer-message &quot;latexmk: done.&quot;))))&#xA;&#xA;(add-hook 'LaTeX-mode-hook &#xA;      (lambda ()&#xA;        (push &#xA;         '(&quot;Latexmk&quot; &quot;latexmk -pdf %s&quot; TeX-run-TeX nil t&#xA;           :help &quot;Run Latexmk on file&quot;)&#xA;         TeX-command-list)))&#xA;&#xA;;; Set okular to open with C-c C-v view option &#xA;(setq TeX-view-program-list&#xA;      '((&quot;Okular&quot; &quot;okular --unique %u&quot;)))&#xA;(setq TeX-view-program-selection '((output-pdf &quot;Okular&quot;)))&#xA;&#xA;;; Paren checking&#xA;(load &quot;paren&quot;)&#xA;(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)&#xA;&#xA;;; Adaptive wrap&#xA;;(require 'adaptive-wrap)&#xA;&#xA;(when (fboundp 'adaptive-wrap-prefix-mode)&#xA;  (defun my-activate-adaptive-wrap-prefix-mode ()&#xA;    &quot;Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously.&quot;&#xA;    (if visual-line-mode&#xA;        (adaptive-wrap-prefix-mode 1)&#xA;      (adaptive-wrap-prefix-mode -1)))&#xA;  (add-hook 'visual-line-mode-hook 'my-activate-adaptive-wrap-prefix-mode))&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(LaTeX-indent-environment-list&#xA;   (quote&#xA;    ((&quot;verbatim&quot; current-indentation)&#xA;     (&quot;verbatim*&quot; current-indentation)&#xA;     (&quot;tabular&quot; LaTeX-indent-tabular)&#xA;     (&quot;tabular*&quot; LaTeX-indent-tabular)&#xA;     (&quot;align&quot; LaTeX-indent-tabular)&#xA;     (&quot;align*&quot; LaTeX-indent-tabular)&#xA;     (&quot;array&quot; LaTeX-indent-tabular)&#xA;     (&quot;eqnarray&quot; LaTeX-indent-tabular)&#xA;     (&quot;eqnarray*&quot; LaTeX-indent-tabular)&#xA;     (&quot;displaymath&quot; current-indentation)&#xA;     (&quot;equation&quot;)&#xA;     (&quot;equation*&quot;)&#xA;     (&quot;picture&quot;)&#xA;     (&quot;tabbing&quot;)&#xA;     (&quot;table&quot;)&#xA;     (&quot;table*&quot;)&#xA;     (&quot;cases&quot; LaTeX-indent-tabular))))&#xA; '(TeX-PDF-mode t)&#xA; '(TeX-newline-function (quote newline-and-indent))&#xA; '(TeX-show-compilation t)&#xA; '(TeX-source-correlate-method (quote synctex))&#xA; '(TeX-source-correlate-mode t)&#xA; '(TeX-view-program-list (quote ((&quot;Okular&quot; &quot;okular -unique %o#src:%n%b&quot;))))&#xA; '(TeX-view-program-selection (quote ((output-pdf &quot;Okular&quot;))))&#xA; '(compilation-auto-jump-to-first-error t)&#xA; '(inhibit-startup-screen t)&#xA; '(ispell-lazy-highlight nil)&#xA; '(package-selected-packages (quote (rainbow-delimiters adaptive-wrap auto-indent-mode)))&#xA; '(server-mode t))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally, &lt;code&gt;synctex&lt;/code&gt; has stopped working as well. I have in my &lt;code&gt;~\.latexmkrc&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$pdflatex = 'pdflatex --shell-escape -interaction=nonstopmode -file-line-error -synctex=1' %O %S;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so I am not quite sure with what has cause &lt;code&gt;synctex&lt;/code&gt; to stop working. All these problems started to occur when I setup emacs, AUCTeX, and Latexmk on a different laptop. I used the same configuration settings but they only work properly on the other computer.&lt;/p&gt;&#xA;" OwnerUserId="2603" LastEditorUserId="2603" LastEditDate="2015-03-30T03:00:09.617" LastActivityDate="2015-03-30T14:26:23.623" Title="Using tab causes math in between `\[ \]` to move back two spaces instead of being align" Tags="|auctex|latex|indentation|emacsclient|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10390" PostTypeId="2" ParentId="10387" CreationDate="2015-03-29T23:54:26.523" Score="4" Body="&lt;p&gt;You can test the current major-mode by querying the &lt;code&gt;major-mode&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (eq major-mode 'eshell-mode) ...)&#xA;(if (eq major-mode 'comint-mode) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you would like to test a mode, and all of it's child modes, try this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (derived-mode-p 'eshell-mode) ...)&#xA;(if (derived-mode-p 'comint-mode) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-03-31T04:36:03.290" LastActivityDate="2015-03-31T04:36:03.290" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10391" PostTypeId="1" AcceptedAnswerId="10404" CreationDate="2015-03-30T00:12:12.587" Score="16" ViewCount="6752" Body="&lt;p&gt;My org file is named &lt;code&gt;README.org&lt;/code&gt; and I want to export to Markdown into a file named &lt;code&gt;README&lt;/code&gt;. Every time I run the export it writes to &lt;code&gt;README.md&lt;/code&gt;. Here is my org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: EXPORT_FILE_NAME thing&#xA;&#xA;* Test export&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using the &lt;code&gt;EXPORT_FILE_NAME&lt;/code&gt; property based on this link: &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html#index-property_002c-EXPORT_005fFILE_005fNAME-1617&quot;&gt;http://orgmode.org/manual/Export-settings.html#index-property_002c-EXPORT_005fFILE_005fNAME-1617&lt;/a&gt; but it doesn't seem to do anything.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2021-05-05T02:09:08.013" Title="How can I specify the filename for org-mode export in Emacs?" Tags="|org-mode|org-export|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10392" PostTypeId="1" AcceptedAnswerId="10428" CreationDate="2015-03-30T02:54:26.137" Score="19" ViewCount="4437" Body="&lt;p&gt;What command-line arguments do I use to get Emacs to export an org-mode file to a Beamer PDF?  (I want to create a &lt;code&gt;Makefile&lt;/code&gt; that produces a PDF when the user runs &lt;code&gt;make&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried following &lt;a href=&quot;https://stackoverflow.com/q/22072773/712605&quot;&gt;this answer&lt;/a&gt; but couldn't get it to work:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;$ emacs --batch foo.org -f org-beamer-export-to-pdf&#xA;Symbol's function definition is void: org-beamer-export-to-pdf&#xA;$ emacs --batch -l ox-beamer foo.org -f org-beamer-export-to-pdf&#xA;Cannot open load file: ox-beamer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above error comes from the fact that the org-mode files are in a custom location and my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; is not loaded (&lt;code&gt;--batch&lt;/code&gt; implies &lt;code&gt;-q&lt;/code&gt; a.k.a. &lt;code&gt;--no-init-file&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I tell Emacs to load my init file it will work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;$ emacs --batch -l ~/.emacs.d/init.el foo.org -f org-beamer-export-to-pdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this doesn't work for other users that use &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.el&lt;/code&gt; instead of &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;.  I tried telling Emacs to load &lt;code&gt;user-init-file&lt;/code&gt; but it didn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;$ emacs --batch --eval '(load user-init-file)' foo.org -f org-beamer-export-to-pdf&#xA;Wrong type argument: stringp, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming all users can successfully press &lt;code&gt;C-x C-e l P&lt;/code&gt; to export a Beamer PDF when using Emacs interactively, what non-interactive command will produce a PDF?&lt;/p&gt;&#xA;" OwnerUserId="6898" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2020-05-25T12:03:19.460" Title="Export an org-mode file as a PDF via command line?" Tags="|org-mode|init-file|org-export|beamer|batch-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10393" PostTypeId="1" AcceptedAnswerId="10416" CreationDate="2015-03-30T04:44:04.527" Score="11" ViewCount="1715" Body="&lt;p&gt;I occasionally find myself using interactive functions inside of a function that I'm writing for my own use. If a function asks for some information (e.g. &quot;Output file: ~/&quot;) is there a general elisp way to add text to the minibuffer and then press enter so that the user doesn't have to do so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, suppose that I want to run &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt; inside of a function but I don't want the user to have to specify a file name. Running &lt;code&gt;(org-latex-export-to-pdf)&lt;/code&gt; will move the point to the minibuffer, but putting something like &lt;code&gt;(insert &quot;filename.tex&quot;)&lt;/code&gt; on the next line doesn't seem to work.&lt;/p&gt;&#xA;" OwnerUserId="2511" LastEditorUserId="2511" LastEditDate="2015-03-30T17:32:40.593" LastActivityDate="2017-07-26T08:25:49.170" Title="How can I answer a minibuffer prompt from elisp?" Tags="|elisp|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10394" PostTypeId="1" AcceptedAnswerId="10395" CreationDate="2015-03-30T05:29:12.943" Score="6" ViewCount="1152" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; conf file, I've got this function that adds a hook to set the &lt;code&gt;compile-command&lt;/code&gt; based on the mode. It looks something like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-compile-cmd (mode-hook cmd)&#xA;  (add-hook mode-hook (lambda () &#xA;    (set (make-local-variable 'compile-command) cmd))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get an error that says value of symbol &lt;code&gt;cmd&lt;/code&gt; is void. Shouldn't &lt;code&gt;cmd&lt;/code&gt; exist in the scope of the lambda as well?&lt;/p&gt;&#xA;" OwnerUserId="6899" LastEditorUserId="105" LastEditDate="2019-06-01T15:07:52.733" LastActivityDate="2019-06-01T15:07:52.733" Title="Scope in lambda" Tags="|elisp|variables|lexical-scoping|dynamic-scoping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10395" PostTypeId="2" ParentId="10394" CreationDate="2015-03-30T06:02:38.937" Score="11" Body="&lt;p&gt;No, it shouldn't, if you use dynamic binding. Here are two choices (alternatives) that can help:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use lexical binding.  Set variable &lt;code&gt;lexical-binding&lt;/code&gt; for the file.&lt;/li&gt;&#xA;&lt;li&gt;Use dynamic binding (what you are doing now, no doubt), but also substitute the &lt;strong&gt;value&lt;/strong&gt; of the variable &lt;code&gt;cmd&lt;/code&gt; for the &lt;strong&gt;variable&lt;/strong&gt; &lt;code&gt;cmd&lt;/code&gt; in the &lt;code&gt;lambda&lt;/code&gt; body. You can do this only if the function body of the &lt;code&gt;lambda&lt;/code&gt; does not actually need &lt;code&gt;cmd&lt;/code&gt; to be a variable when it is invoked and can get by with just its value (its value at the time the function is added to the hook).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For &lt;strong&gt;#1&lt;/strong&gt;, see node&#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Using Lexical Binding&lt;/code&gt;&lt;/a&gt;&#xA;in the Elisp manual. Essentially, you'll have to add &lt;code&gt;-*- lexical-binding: t; -*-&lt;/code&gt; &#xA;to the end of the first line of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;strong&gt;#2&lt;/strong&gt;, you do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook mode-hook `(lambda () (set (make-local-variable 'compile-command) ',cmd))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For information about this, see node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Backquote&lt;/code&gt;&lt;/a&gt; in the Elisp manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of #2, what is added to the hook is a textual &lt;code&gt;lambda&lt;/code&gt; expression. It is interpreted (and so invoked) as a function only &lt;strong&gt;when the hook is run&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of #1, the function (a closure, actually) corresponding to the &lt;code&gt;lambda&lt;/code&gt; expression is interpreted as (understood to be) a function &lt;strong&gt;when it is added to the hook&lt;/strong&gt;, and it can thus even be byte-compiled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closure contains a variable binding of &lt;code&gt;cmd&lt;/code&gt; to the value it had when the function was added to the hook), as part of the function code (compiled or not). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that when that function is invoked any code that it runs has &lt;strong&gt;access to &lt;code&gt;cmd&lt;/code&gt; as a variable&lt;/strong&gt; at that time (not just a value).  If you don't really need a variable &lt;code&gt;cmd&lt;/code&gt; at that time and a value will do, and if you don't care about byte-compiling the &lt;code&gt;lambda&lt;/code&gt; code, then #1 is typically adequate.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="50" LastEditDate="2015-04-19T15:40:57.303" LastActivityDate="2015-04-19T15:40:57.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10396" PostTypeId="1" AcceptedAnswerId="10403" CreationDate="2015-03-30T07:56:42.740" Score="25" ViewCount="9092" Body="&lt;p&gt;I have a configuration like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package html-mode&#xA;  :mode &quot;\\.html\\'&quot;&#xA;  :config&#xA;  (progn&#xA;    (add-hook 'html-mode-hook 'turn-off-auto-fill)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I go and visit an HTML file, I observe that &lt;code&gt;auto-fill&lt;/code&gt; is not turned off. But if I use &lt;code&gt;:init&lt;/code&gt; instead of &lt;code&gt;:config&lt;/code&gt;, &lt;code&gt;auto-fill&lt;/code&gt; gets turned off. So my question is when are the commands under &lt;code&gt;:config&lt;/code&gt; executed ?&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2015-10-28T15:40:17.083" Title="Difference between init and config in use-package" Tags="|package|use-package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10397" PostTypeId="1" CreationDate="2015-03-30T08:38:47.877" Score="0" ViewCount="134" Body="&lt;p&gt;When setting the &lt;code&gt;js-indent-level&lt;/code&gt; to &lt;code&gt;4&lt;/code&gt;, my code is aligned in (1-based) columns 4, 8, 12, 16, ...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me this makes perfect sense, but unfortunately I'm sharing code with others whose editors interpret such an indentation level to mean the code should align  at (1-based) columns 5, 9, 13, 17, ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still more unfortunately, an automated style checker rejects code that is not aligned in those latter columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me configure javascript mode (or emacs in general) to align the code at (1-based) columns 5, 9, 13, 17, ... ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some example code followed by the complaints from &lt;code&gt;jshint&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA; * Foo header&#xA; *&#xA; * @module widgets/foo/views/foo-header-view&#xA; */&#xA;define([&quot;classes/layout&quot;,&#xA;        &quot;services/foo-service&quot;,&#xA;        &quot;utils/util&quot;,&#xA;        &quot;hbs!widgets/foo/templates/foo-header&quot;&#xA;       ],&#xA;       function (Layout, FooService, util, headerTmpl) {&#xA;           /**&#xA;            * Foo Header View&#xA;            */&#xA;           var FooHeaderView = Layout.extend({&#xA;               /**&#xA;                * Header template&#xA;                *&#xA;                * @property Template&#xA;                * @type {Template}&#xA;                */&#xA;               template: headerTmpl,&#xA;&#xA;               hubEvents: {&#xA;                   &quot;foo:list:change&quot;: &quot;_reloadData&quot;&#xA;               },&#xA;&#xA;               initialize: function () {&#xA;                   this.foo = null;&#xA;                   this.fooService = FooService.getInstance();&#xA;               }&#xA;           });&#xA;           return FooHeaderView;&#xA;       });&#xA;&#xA;&#xA;&#xA;[L15:C12] W015: Expected 'var' to have an indentation at 13 instead at 12.&#xA;           var FooHeaderView = Layout.extend({&#xA;[L22:C16] W015: Expected 'template' to have an indentation at 17 instead at 16.&#xA;               template: headerTmpl,&#xA;[L24:C16] W015: Expected 'hubEvents' to have an indentation at 17 instead at 16.&#xA;               hubEvents: {&#xA;[L25:C20] W015: Expected 'foo:list:change' to have an indentation at 21 instead at 20.&#xA;                   &quot;foo:list:change&quot;: &quot;_reloadData&quot;&#xA;[L26:C16] W015: Expected '}' to have an indentation at 17 instead at 16.&#xA;               },&#xA;[L28:C16] W015: Expected 'initialize' to have an indentation at 17 instead at 16.&#xA;               initialize: function () {&#xA;[L29:C20] W015: Expected 'this' to have an indentation at 21 instead at 20.&#xA;                   this.foo = null;&#xA;[L30:C20] W015: Expected 'this' to have an indentation at 21 instead at 20.&#xA;                   this.fooService = FooService.getInstance();&#xA;[L31:C16] W015: Expected '}' to have an indentation at 17 instead at 16.&#xA;               }&#xA;[L32:C12] W015: Expected '}' to have an indentation at 13 instead at 12.&#xA;           });&#xA;[L33:C12] W015: Expected 'return' to have an indentation at 13 instead at 12.&#xA;           return FooHeaderView;&#xA;[L34:C8] W015: Expected '}' to have an indentation at 9 instead at 8.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-03-30T14:34:30.913" LastActivityDate="2015-03-30T14:34:30.913" Title="Set javascript mode indents to (1-based) columns 5, 9, 13, 17," Tags="|indentation|javascript|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10398" PostTypeId="1" AcceptedAnswerId="10399" CreationDate="2015-03-30T08:43:53.513" Score="3" ViewCount="128" Body="&lt;p&gt;Is there any way of getting Helm to default to the shortest match? In many cases the way Helm works at the moment (unless I have some weird configuration) is inferior to vanilla Emacs in many cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example... I want to invoke &quot;revert-buffer&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In standard Emacs it's 9 keystrokes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x revert &amp;lt;tab&amp;gt; &amp;lt;return&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Helm mode it's 13:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x revert-b C-n C-n C-n &amp;lt;return&amp;gt;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...although if it was set to default to the shortest match (which makes sense, Occam's razor, right?) it would be something like 8:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x rev buf &amp;lt;return&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6902" LastActivityDate="2015-03-30T10:33:50.937" Title="Getting Helm to default to the shortest match" Tags="|helm|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10399" PostTypeId="2" ParentId="10398" CreationDate="2015-03-30T10:33:50.937" Score="4" Body="&lt;p&gt;Use &lt;code&gt;helm-M-x&lt;/code&gt;. It is not bound to &lt;code&gt;M-x&lt;/code&gt; by default, so you have to do it yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-x&quot;) 'helm-M-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;code&gt;helm-M-x&lt;/code&gt;, I only need to type &lt;code&gt;re buf&lt;/code&gt; to get &lt;code&gt;revert-buffer&lt;/code&gt; as the first match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can learn more about Helm in &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot; rel=&quot;nofollow&quot;&gt;this guide&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-03-30T10:33:50.937" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10400" PostTypeId="1" AcceptedAnswerId="10405" CreationDate="2015-03-30T12:11:32.247" Score="8" ViewCount="1102" Body="&lt;p&gt;Is there a way to find out the type of the surrounding parenthesis (i.e. '(', '[' or '{') around point? For example (using &lt;code&gt;|&lt;/code&gt; to represent point)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{ abc, | df }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should return '{', and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{ abc[ | ], 123 }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should return '['. Ideally I would like it to handle quotation marks as well.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In case anyone is curious or needs more details: my aim is to set up smart automatic spacing around &lt;code&gt;:&lt;/code&gt; in python using &lt;a href=&quot;https://github.com/xwl/electric-spacing&quot; rel=&quot;nofollow&quot;&gt;electric-spacing&lt;/a&gt; (also known as &lt;a href=&quot;http://www.emacswiki.org/emacs/SmartOperator&quot; rel=&quot;nofollow&quot;&gt;smart-operator&lt;/a&gt;). The problem is that normally (in python) &lt;code&gt;:&lt;/code&gt; is either the slice operator or the start of a for/if/... statement, which shouldn't be surrounded by spaces. However, within a dictionary it is something like an assignment operator, and so it should be surrounded by spaces. So I a way need to check if point is inside a dict (i.e. inside &lt;code&gt;{}&lt;/code&gt;), but not inside a slice operation or string within that dict (i.e. not inside &lt;code&gt;[]&lt;/code&gt; or &lt;code&gt;&quot;&quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Edit:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Here's the helper function I wrote, based on abo-abo's answer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun enclosing-paren ()&#xA;  &quot;Return the closing parenthesis of the enclosing parens, or nil if not inside any parens.&quot;&#xA;  (ignore-errors&#xA;    (save-excursion&#xA;      (up-list)&#xA;      (char-before))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then then the final predicate is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(and (not (in-string-p))&#xA;     (eq (enclosing-paren) ?\}))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Edit 2:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The above function turned out to be too slow (it often caused a noticeable lag when a &lt;code&gt;:&lt;/code&gt; was typed). I'm using Stefan's answer instead now, which seems to be much faster.&lt;/p&gt;&#xA;" OwnerUserId="237" LastEditorUserId="237" LastEditDate="2015-06-01T09:44:31.987" LastActivityDate="2020-01-05T02:11:08.890" Title="How can I find surrounding parenthesis (from emacs lisp)?" Tags="|balanced-parentheses|parsing|sexp|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10401" PostTypeId="2" ParentId="10400" CreationDate="2015-03-30T12:16:51.067" Score="5" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion&#xA;  (up-list)&#xA;  (char-before))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;up-list&lt;/code&gt; can throw, so you need to handle errors as well.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-30T12:16:51.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10402" PostTypeId="2" ParentId="10344" CreationDate="2015-03-30T13:32:34.823" Score="0" Body="&lt;p&gt;If you want to easily &lt;strong&gt;see&lt;/strong&gt; previously pieces of copied and killed text, and choose one or more such pieces, these can help:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/BrowseKillRing&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Browse Kill Ring&lt;/strong&gt;&lt;/a&gt; - Browse the &lt;code&gt;kill-ring&lt;/code&gt; to choose a kill to yank. That page shows several alternative libraries that offer this behavior in different ways. The main one is &lt;a href=&quot;http://www.emacswiki.org/emacs/download/browse-kill-ring.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;browse-kill-ring.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; -&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;M-y&lt;/code&gt;&lt;/strong&gt;: Yank from either the &lt;code&gt;kill-ring&lt;/code&gt; or the &lt;code&gt;secondary-selection-ring&lt;/code&gt;, depending on the last yank type (you need library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/second-sel.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;second-sel.el&lt;/code&gt;&lt;/a&gt; for the second alternative). If the last command was not a yank then this is the same as &lt;code&gt;C-- C-y&lt;/code&gt; (see next).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-- C-y&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;C-y&lt;/code&gt; with a negative prefix arg): Lets you choose any number of kills to insert using completion.  During completion you can use:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-,&lt;/code&gt; to sort the candidates to yank in different ways (repeat)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;S-delete&lt;/code&gt; to remove a candidate entry from the selection ring&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-S-return&lt;/code&gt; to copy a candidate to the other selection ring&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Helm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Helm&lt;/strong&gt;&lt;/a&gt; - See @bluejay's &lt;a href=&quot;https://emacs.stackexchange.com/a/10379/105&quot;&gt;answer&lt;/a&gt; on this page.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-03-30T13:32:34.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10403" PostTypeId="2" ParentId="10396" CreationDate="2015-03-30T13:38:23.957" Score="29" Body="&lt;p&gt;They are different if the package is deferred, i.e. not loaded until it is needed. In that case &lt;code&gt;:init&lt;/code&gt; will be executed at the time your emacs file is first read, but &lt;code&gt;:config&lt;/code&gt; will be executed at the time the package is actually loaded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, the use of &lt;code&gt;mode&lt;/code&gt; implicitly defers loading the package. You have configured the package to be loaded the first time an html file is visited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could use &lt;code&gt;:demand&lt;/code&gt; to make sure the package is always loaded at startup, but more likely what you want to do here is put your hook in &lt;code&gt;:init&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:init Code to run when `use-package' form evals.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since you're putting this in your user-init file, that basically means it will run at startup.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:config Runs if and when package loads.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, not run until the package is actually being loaded.. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:defer Defer loading of package -- automatic if :commands, :bind, :bind*,  :mode or :interpreter are used.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the list of things that automatically make a package deferred. Basically if you tell &lt;code&gt;use-package&lt;/code&gt; the conditions in which you need this package, it assumes you don't want to load it until those conditions arise. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:demand Prevent deferred loading in all cases.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make sure the package is loaded at startup, regardless of what other options you've specified. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Revisiting this based on the recent comments... What I said above is all true, but I don't think it correctly answers the question. The root problem here is actually that &lt;code&gt;html-mode&lt;/code&gt; is not a package, but rather a mode defined by the package &lt;code&gt;sgml-mode&lt;/code&gt;. This works as expected for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package sgml-mode&#xA;  :mode (&quot;\\.html\\'&quot; . html-mode)&#xA;  :config (add-hook 'html-mode-hook 'turn-off-auto-fill))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the original example, the &lt;code&gt;:config&lt;/code&gt; expression never gets evaluated because a package named &lt;code&gt;html-mode&lt;/code&gt; never gets loaded. Moving the same expression to &lt;code&gt;:init&lt;/code&gt; works because init code is always evaluated, regardless of whether the package ever gets loaded.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-10-28T15:40:17.083" LastActivityDate="2015-10-28T15:40:17.083" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10404" PostTypeId="2" ParentId="10391" CreationDate="2015-03-30T13:51:49.100" Score="15" Body="&lt;p&gt;According to the cited manual page, &lt;code&gt;EXPORT_FILE_NAME&lt;/code&gt; applies only for subtree export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whole file export will take its name from the buffer file name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you only have 1 level-1 headline, you may add this property to a drawer inside the first heading, and always export as subtree from inside this top-level heading to get your desired file name.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-03-30T13:51:49.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10405" PostTypeId="2" ParentId="10400" CreationDate="2015-03-30T14:15:43.250" Score="11" Body="&lt;p&gt;Rather than &lt;code&gt;up-list&lt;/code&gt; I'd recommend you use &lt;code&gt;(syntax-ppss)&lt;/code&gt; which will return to you some parsing state.  This will include info about whether you're inside a string or a comment, the position of the last open &quot;paren&quot; etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. you can find the kind of paren with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((ppss (syntax-ppss)))&#xA;  (when (nth 1 ppss) (char-after (nth 1 ppss))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it should hopefully let you handle quotation marks as well (by checking &lt;code&gt;(nth 3 ppss)&lt;/code&gt; and &lt;code&gt;(char-after (nth 8 ppss))&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-03-30T14:15:43.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10406" PostTypeId="2" ParentId="10389" CreationDate="2015-03-30T14:26:23.623" Score="1" Body="&lt;p&gt;The problem with indentation of &lt;code&gt;\[...\]&lt;/code&gt; should have been fixed with this commit: &lt;a href=&quot;http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=c2f6e9c4ad208ebddadd42a0314a59503399d00f&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=c2f6e9c4ad208ebddadd42a0314a59503399d00f&lt;/a&gt;  You can apply the patch locally or wait for the AUCTeX package in GNU Elpa to be updated.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-03-30T14:26:23.623" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10407" PostTypeId="2" ParentId="10372" CreationDate="2015-03-30T14:46:02.850" Score="0" Body="&lt;p&gt;Well, it turns out there's a keyword one can use to fix this: &lt;code&gt;:unless&lt;/code&gt;, though it still needs elisp's unless, otherwise it throws an error.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(unless (string= system-name &quot;here-elfeed-shall-not-run&quot;)&#xA;  (use-package elfeed&#xA;    :unless (string= system-name &quot;here-elfeed-shall-not-run&quot;)&#xA;    :ensure t&#xA;    :config&#xA;      (setq elfeed-feeds '(blabla doesnt matter))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6892" LastEditorUserId="6892" LastEditDate="2015-03-30T14:51:28.850" LastActivityDate="2015-03-30T14:51:28.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10408" PostTypeId="2" ParentId="9517" CreationDate="2015-03-30T15:07:03.057" Score="5" Body="&lt;p&gt;Eshell and &lt;code&gt;shell-mode&lt;/code&gt; both use &lt;code&gt;ansi-color.el&lt;/code&gt; to turn ansi color codes into faces.  &lt;code&gt;ansi-color.el&lt;/code&gt; supports the following faces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Parameter  Description        Face used by default&#xA;  0        default            default&#xA;  1        bold               bold&#xA;  2        faint              default&#xA;  3        italic             italic&#xA;  4        underlined         underline&#xA;  5        slowly blinking    success&#xA;  6        rapidly blinking   warning&#xA;  7        negative image     error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;negative image&quot; is &quot;reverse&quot; and it is mapped to the &lt;code&gt;error&lt;/code&gt; face.  When I configure my repository such...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[color]&#xA;        ui = always&#xA;[color &quot;branch&quot;]&#xA;        current = yellow reverse&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and run &lt;code&gt;git branch&lt;/code&gt; I see my local branches, and the current branch is rendered in bold yellow.  When I put point onto the yellow text and run &lt;code&gt;describe-face&lt;/code&gt; I see that it is in fact rendered with the &lt;code&gt;error&lt;/code&gt; face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customise &lt;code&gt;ansi-color-faces-vector&lt;/code&gt; to assign a different face other than &lt;code&gt;error&lt;/code&gt; to &quot;negative image&quot;/&quot;reverse&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You do not need &lt;code&gt;(add-hook 'eshell-preoutput-filter-functions  'ansi-color-apply)&lt;/code&gt; to use ansi colors in eshell.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-03-30T15:07:03.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10410" PostTypeId="2" ParentId="10400" CreationDate="2015-03-30T16:30:44.147" Score="1" Body="&lt;p&gt;While the preferable answer IMO was given by Stefan, here an example which includes a solution not relying on syntax-table WRT delimiters: It uses something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (skip-chars-backward &quot;^{\(\[\]\)}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and a stack. See source here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-berlin/general-close&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-berlin/general-close&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-03-31T08:12:59.713" LastActivityDate="2015-03-31T08:12:59.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10411" PostTypeId="2" ParentId="10393" CreationDate="2015-03-30T17:39:40.040" Score="0" Body="&lt;p&gt;It seems that using &lt;code&gt;run-with-timer&lt;/code&gt; with &lt;code&gt;insert&lt;/code&gt; will get the job done.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-timer .2 nil 'insert &quot;filename.tex&quot;)&#xA;(run-with-timer .3 nil 'execute-kbd-macro (kbd &quot;RET&quot;))&#xA;(org-latex-export-to-pdf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;insert&lt;/code&gt; when placed afterwards is coming up too quickly. It tries to insert the string before there is a place to insert it.&lt;/p&gt;&#xA;" OwnerUserId="2511" LastActivityDate="2015-03-30T17:39:40.040" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10412" PostTypeId="1" AcceptedAnswerId="10435" CreationDate="2015-03-30T18:41:42.663" Score="1" ViewCount="187" Body="&lt;p&gt;I've been using the &lt;a href=&quot;https://www.gnu.org/software/emms/&quot; rel=&quot;nofollow&quot;&gt;Emacs Multi-Media System&lt;/a&gt; and it works pretty well, but one thing i can't figure out how to do is sort by &lt;em&gt;AlbumArtist&lt;/em&gt;. This is important, because i have many compilation albums and soundtracks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to sort the music browser by AlbumArtist(defaulting to Artist if the file lacks an AlbumArtist tag)? (btw, i am using libtag because the default tag reader didn't work right on some of my files)&lt;/p&gt;&#xA;" OwnerUserId="6745" LastEditorUserId="253" LastEditDate="2015-04-01T00:24:25.050" LastActivityDate="2015-04-01T00:24:25.050" Title="Sort by artist in EMMS with compilation albums?" Tags="|emms|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10413" PostTypeId="1" CreationDate="2015-03-30T20:55:58.080" Score="4" ViewCount="364" Body="&lt;p&gt;I search Org files with &lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;isearch-forward&lt;/code&gt;. However, when the match is hidden inside a code block in a child several levels deep, and everything is collapsed, it takes a lot of extra keystrokes to see the match. Can &lt;code&gt;isearch-forward&lt;/code&gt; or Org be configured to expand sections where matches are found?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-04-30T03:37:42.857" Title="How can I make Org expand sections while searching?" Tags="|org-mode|isearch|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="10414" PostTypeId="1" AcceptedAnswerId="10420" CreationDate="2015-03-30T22:46:57.617" Score="1" ViewCount="525" Body="&lt;p&gt;I have been using the following function to maximize and unmaximize a window for two years now. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun toggle-maximize-buffer () &quot;Toggle maximize buffer&quot;&#xA;  (interactive)&#xA;  (if (= 1 (length (window-list)))&#xA;    (set-window-configuration my-saved-window-configuration)&#xA;    (progn&#xA;      (setq my-saved-window-configuration (current-window-configuration))&#xA;      (delete-other-windows))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have it bound to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-keys-minor-mode-map (kbd &quot;C-M-u&quot;) 'toggle-maximize-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It always worked great, but today, after upgrading to the latest version of Emacs in OS X:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --HEAD --use-git-head --cocoa --with-gnutls --with-rsvg --with-imagemagick&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this function stopped working properly when invoking it from a buffer running &lt;code&gt;M-x ansi-term&lt;/code&gt;.  More specifically, it works, but it &lt;strong&gt;moves&lt;/strong&gt; cursor in my buffer whenever I do &lt;code&gt;C-M-u RET&lt;/code&gt;. It happens regardless weather I am in &lt;code&gt;character&lt;/code&gt; or &lt;code&gt;line-mode&lt;/code&gt; in the &lt;code&gt;ansi-term&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem does not happen in any other type of buffer. Why am I having this problem, and what I can do about it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case it matters, here is the specific version I am using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C1514))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could this be a bug? Or is it perhaps a problem with my configuration?&lt;/p&gt;&#xA;" OwnerUserId="6" LastActivityDate="2015-03-31T08:58:07.947" Title="Toggling maximize-window in a buffer running ansi-term" Tags="|key-bindings|window|keymap|ansi-term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10415" PostTypeId="2" ParentId="10413" CreationDate="2015-03-30T22:50:04.103" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;C-c /&lt;/code&gt;, (&lt;code&gt;org-sparse-tree&lt;/code&gt;) to generate a sparse tree, expanding the tree to display the matches.&lt;/p&gt;&#xA;" OwnerUserId="838" LastEditorUserId="838" LastEditDate="2015-03-31T02:47:01.193" LastActivityDate="2015-03-31T02:47:01.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10416" PostTypeId="2" ParentId="10393" CreationDate="2015-03-30T22:54:54.257" Score="3" Body="&lt;p&gt;Interesting problem.  Looks like the editor runs the &lt;code&gt;post-command-hook&lt;/code&gt; every time it enters a new command-loop, i.e. a &lt;code&gt;recursive-edit&lt;/code&gt;.  But we can start with &lt;code&gt;minibuffer-setup-hook&lt;/code&gt;, which executes a function after entering the minibuffer. While this allows the inserting of input, it is too soon to exit the minibuffer, because the catch hasn't been setup yet.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-minibuffer-input (form &amp;amp;rest inputs)&#xA;  (declare (indent 1))&#xA;  `(minibuffer-with-setup-hook&#xA;       (lambda ()&#xA;         (minibuffer-input-provider ',inputs))&#xA;     ,form))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's were we need to wrap the 'arguments' in our own 'command loop', which get's executed every time we enter a &lt;code&gt;recursive-edit&lt;/code&gt;, at which point it pops one argument and throws one level up, via &lt;code&gt;exit-minibuffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;(defun minibuffer-input-provider (inputs)&#xA;  (let ((hook (make-symbol &quot;hook&quot;)))&#xA;    (fset hook (lambda ()&#xA;                 (remove-hook 'post-command-hook hook)&#xA;                 (when inputs&#xA;                   (when (= 0 (minibuffer-depth))&#xA;                     (error &quot;Too many inputs&quot;))&#xA;                   (when (cdr inputs)&#xA;                     (add-hook 'post-command-hook hook))&#xA;                   (insert (pop inputs))&#xA;                   (exit-minibuffer))))&#xA;    (add-hook 'post-command-hook hook)))&#xA;&#xA;&#xA;(with-minibuffer-input (call-interactively 'find-file)&#xA;  &quot;/&quot;)&#xA;&#xA;(with-minibuffer-input (call-interactively 'occur)&#xA;  &quot;\\(foo\\)\\(bar\\)&quot; &quot;\\1&quot;);;C-u C-x C-e&#xA;&#xA;;;foobar&#xA;&#xA;(with-minibuffer-input (call-interactively 'replace-string)&#xA;  &quot;foo&quot; &quot;bar&quot;)&#xA;&#xA;;; foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-03-30T22:54:54.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10417" PostTypeId="1" CreationDate="2015-03-31T01:35:04.043" Score="4" ViewCount="1810" Body="&lt;p&gt;I have trouble getting the &lt;code&gt;doc-view-mode&lt;/code&gt; displaying pdfs. Here's the error message generated :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No PNG support is available, or some conversion utility for pdf files is missing.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From what &lt;a href=&quot;https://stackoverflow.com/a/26476882/152244&quot;&gt;I've gathered&lt;/a&gt;, I must make sure that &lt;code&gt;gs&lt;/code&gt; is in emacs path variable. Again, all of this looks good, the path given by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$which gs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is also found in &lt;code&gt;(getenv &quot;PATH&quot;)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm not too sure where the bug comes from, any idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running OS X 10.10.3, Emacs 24.4, ghostscript 9.15&lt;/p&gt;&#xA;" OwnerUserId="6909" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-03-31T01:35:04.043" Title="Doc-view not working despite gs being in my path" Tags="|pdf|docview|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10418" PostTypeId="1" CreationDate="2015-03-31T03:55:21.617" Score="4" ViewCount="579" Body="&lt;p&gt;&lt;code&gt;emacs -nw -q&lt;/code&gt; or &lt;code&gt;emacs -nw -Q&lt;/code&gt; takes more than 10 seconds to start in terminal, but the result of &lt;code&gt;M-x emacs-init-time&lt;/code&gt; is 0.0 seconds, and the &lt;code&gt;emacs&lt;/code&gt; takes shorter time (still more than 5s) than &lt;code&gt;emacs -nw -q&lt;/code&gt; or &lt;code&gt;emacs -nw -Q&lt;/code&gt; and the result &lt;code&gt;M-x emacs-init-time&lt;/code&gt; is 3.5 seconds, this is really weird.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what is going on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CentOS 6.5 32-bit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.4.2 (compiled from the source code at the official gnu website)&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2015-05-10T17:28:31.407" Title="emacs -nw -q takes long time" Tags="|start-up|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10419" PostTypeId="1" CreationDate="2015-03-31T06:38:21.613" Score="0" ViewCount="571" Body="&lt;p&gt;In my coding style tabs used to indent and spaces for align. I've configure Emacs for this, but some times emacs places 4 spaces instead of tabulation in some blocks of code. If can be fixed by reindenting whole block (beetwin &lt;code&gt;{}&lt;/code&gt;), but some times this way not work too.&#xA;How can I fix it?&#xA;PS &lt;code&gt;.emacs&lt;/code&gt; here &lt;a href=&quot;http://pastebin.com/c2pcD79k&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/c2pcD79k&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6882" LastActivityDate="2015-03-31T06:38:21.613" Title="Wrong indent in c-mode and c++-mode" Tags="|c++|align|c|indentation|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10420" PostTypeId="2" ParentId="10414" CreationDate="2015-03-31T08:58:07.947" Score="2" Body="&lt;p&gt;Saving the last value of &lt;code&gt;(point)&lt;/code&gt; and restoring it with &lt;code&gt;goto-char&lt;/code&gt; should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun toggle-maximize-buffer ()&#xA;  &quot;Toggle maximize buffer&quot;&#xA;  (interactive)&#xA;  (if (= 1 (length (window-list)))&#xA;      (progn&#xA;        (set-window-configuration my-saved-window-configuration)&#xA;        (goto-char my-saved-point))&#xA;    (setq my-saved-window-configuration (current-window-configuration)&#xA;          my-saved-point (point))&#xA;    (delete-other-windows)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this behaviour sounds like a bug to me.  I'd check what the latest version of Emacs is that doesn't exhibit it and include that additionally to the other information in a &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; mail.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-03-31T08:58:07.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10421" PostTypeId="1" AcceptedAnswerId="10456" CreationDate="2015-03-31T09:03:25.823" Score="5" ViewCount="682" Body="&lt;p&gt;I'm using org-mode to write some documentation. After changing some wording, &lt;code&gt;fill-paragraph&lt;/code&gt; has arranged things so there's a number followed by a full stop at the start of a line. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Blah blah blah blah blah blah blah blah blah blah blah blah blah blah&#xA;64. Blah blah blah blah blah blah blah blah&#xA;&#xA;Blah blah blah blah blah.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export to HTML, org-mode then makes an ordered list item of that one line, making things look a mess. Is there anything I can do to indicate that a particular number followed by a full stop should never be treated as a list item?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the list behaviour elsewhere, so I don't want to globally disable it.&lt;/p&gt;&#xA;" OwnerUserId="2354" LastActivityDate="2017-01-05T10:52:42.223" Title="How can I stop org-mode treating a number followed by a full stop as a bullet point?" Tags="|org-mode|org-export|fill-paragraph|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10422" PostTypeId="2" ParentId="10421" CreationDate="2015-03-31T09:54:41.773" Score="11" Body="&lt;p&gt;This has been a problem for me when creating documents in Danish, where &quot;3rd quarter&quot; is &quot;3. kvartal&quot;.   The solution I use in such situations is to replace the space after the dot by a non-breaking space by typing &lt;code&gt;C-q 240&lt;/code&gt;.  This is appropriate in such situations where the dot is not an end of sentence character and could perhaps be used as a work around in your situation.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2017-01-05T10:52:42.223" LastActivityDate="2017-01-05T10:52:42.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10423" PostTypeId="1" AcceptedAnswerId="10425" CreationDate="2015-03-31T10:48:10.730" Score="2" ViewCount="342" Body="&lt;p&gt;I have this tester code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defvar dbg-vec nil)&#xA;(defun foobar ()&#xA;  (interactive)&#xA;  (message &quot;%S&quot; (setq dbg-vec (this-command-keys-vector))))&#xA;(set-transient-map '(keymap (left . foobar)&#xA;                     (t . foobar)&#xA;                     (97 . foobar)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works as expected in the GUI. But for &lt;code&gt;emacs -nw&lt;/code&gt; it gives strange behavior.&#xA;If I press &lt;kbd&gt;left&lt;/kbd&gt; after evaling the last statement, I get:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;error &quot;No previous locations for find-tag invocation&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;dbg-vec&lt;/code&gt; becomes &lt;code&gt;[27]&lt;/code&gt;, although the key code for left is 113.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that it still works as expected if I press &lt;kbd&gt;a&lt;/kbd&gt;.&#xA;What could be the source of this error and how can I fix it?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-03-31T13:57:36.050" Title="set-transient-map oddity for emacs -nw" Tags="|elisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10424" PostTypeId="1" CreationDate="2015-03-31T11:45:16.650" Score="4" ViewCount="1567" Body="&lt;p&gt;I have the following line at the start of an org file to configure it to use listings for code blocks.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: setup-listings&#xA;#+begin_src emacs-lisp :results silent :export none&#xA;  (setq org-latex-listings 't)&#xA;  (require 'ox-latex)&#xA;  (add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;listings&quot;))&#xA;  (add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;color&quot;))&#xA;#+end_src&#xA;#+call: setup-listings()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export this to a latex document the listings package gets set up correctly. But this block is also put in the latex document. What do I need to do so that this one specific block is not included into the output?&lt;/p&gt;&#xA;" OwnerUserId="536" LastActivityDate="2017-09-12T16:23:50.967" Title="How can I hide a code block in the latex output?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10425" PostTypeId="2" ParentId="10423" CreationDate="2015-03-31T13:57:36.050" Score="1" Body="&lt;p&gt;The right fix is to not use a catchall &lt;code&gt;t&lt;/code&gt; binding.  These are very tricky to use and basically can't be made 100% reliable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole motivation behind &lt;code&gt;set-transient-map&lt;/code&gt; was actually to avoid using &lt;code&gt;t&lt;/code&gt; bindings (which are typically used to exit from some transient mode, so they just take the event and then want to &quot;unread&quot; it by putting it on &lt;code&gt;unread-command-event&lt;/code&gt; but &quot;unreading&quot; can't be done reliably).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-03-31T13:57:36.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10426" PostTypeId="1" AcceptedAnswerId="10696" CreationDate="2015-03-31T14:56:37.413" Score="29" ViewCount="5509" Body="&lt;p&gt;I'd like to have a link like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:~/projects][Projects]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;open directly in Dired rather than Finder (I'm on a Mac), which is what it does now.  Is there a way?  (Of course there's a way.  It's Emacs.)&lt;/p&gt;&#xA;" OwnerUserId="505" LastEditorUserId="504" LastEditDate="2015-04-10T13:02:53.870" LastActivityDate="2024-01-16T05:35:09.890" Title="Org Mode link to open directory in Dired" Tags="|org-mode|osx|directories|" AnswerCount="4" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10427" PostTypeId="1" CreationDate="2015-03-31T17:41:36.913" Score="3" ViewCount="197" Body="&lt;p&gt;I like the variable font size feature that emacs has under xwindows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, I dislike the menus under xwindows.  They are generated by GTK or something and they stick out like a sore thumb.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uaEUU.png&quot; alt=&quot;Comparison of Text-mode menus with GTK menus&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use emacs's rendering engine instead of GTK to draw the menus when I'm running under xwindows?  Would that allow me to customize their appearance the same way I'd customize the appearance of the modeline?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If I build emacs with &lt;code&gt;configure --with-x --with-x-toolkit=no&lt;/code&gt;, I get an emacs which looks like this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/SJpMj.png&quot; alt=&quot;emacs compiled --with-x and --with-x-toolkit=no&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, these menus are worse and now my emacs no longer supports the xwidgets stuff (not that I've played with it anyway).&lt;/p&gt;&#xA;" OwnerUserId="870" LastEditorUserId="870" LastEditDate="2015-04-15T16:01:26.183" LastActivityDate="2015-04-15T16:33:38.043" Title="How can I use the console's menu-bar while running under xwindows?" Tags="|menu-bar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10428" PostTypeId="2" ParentId="10392" CreationDate="2015-03-31T17:52:14.900" Score="11" Body="&lt;p&gt;The following worked for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;emacs \&#xA;    -u &quot;$(id -un)&quot; \&#xA;    --batch \&#xA;    --eval '(load user-init-file)' \&#xA;    foo.org \&#xA;    -f org-beamer-export-to-pdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks go to @mutbuerger for the hint to pass &lt;code&gt;-u &amp;lt;username&amp;gt;&lt;/code&gt; to get &lt;code&gt;user-init-file&lt;/code&gt; defined.&lt;/p&gt;&#xA;" OwnerUserId="6898" LastActivityDate="2015-03-31T17:52:14.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10429" PostTypeId="1" CreationDate="2015-03-31T18:22:29.803" Score="2" ViewCount="871" Body="&lt;p&gt;I have installed auto-complete in the /Users/angeldelcastillo/.emacs.d/auto-complete directory following the instruction on the website, using install.el. The process finishes all right, but when I open Emacs I get this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (initialization): An error occurred while loading       &gt;`/Users/angeldelcastillo/.emacs':&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;File error: Cannot open load file, no such file or directory, popup&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To ensure normal operation, you should investigate and remove the&#xA;  cause of the error in your initialization file.  Start Emacs with&#xA;  the `--debug-init' option to view a complete error backtrace.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have modified ~/.emacs as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ;; autocomplete-mode&#xA;    (add-to-list 'load-path &quot;~/.emacs.d/auto-complete&quot;)&#xA;    (require 'auto-complete-config.el)&#xA;    (ac-config-default)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.4 on OSX. I have this installed on a Ubuntu machine and there it works. So the trouble is with the popup directory, which I don't know where to find. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="6912" LastActivityDate="2015-03-31T18:22:29.803" Title="Cannot load auto-complete library" Tags="|auto-complete-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10431" PostTypeId="1" AcceptedAnswerId="10520" CreationDate="2015-03-31T19:46:17.307" Score="19" ViewCount="9051" Body="&lt;p&gt;I use the packages Company mode and Yasnippet.  When I'm typing in a buffer, I get autocompletion suggestions from Company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Yasnippet, I have a directory which contains the snippets. In that directory I have for example, the file &lt;code&gt;foo.yasnippet&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm typing &lt;code&gt;foo&lt;/code&gt; in the buffer, and press &lt;kbd&gt;Tab&lt;/kbd&gt;, I get a popup menu for yasnippets, which I chan choose which snippet (&lt;code&gt;foo&lt;/code&gt; or &lt;code&gt;foo-bar&lt;/code&gt;) I want to insert. &#xA;I would like to integrate the yasnippet &lt;code&gt;foo&lt;/code&gt; in Company completion. When I type &lt;code&gt;foo&lt;/code&gt;, then I would like to see the snippet in Company completion popup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? If so, how could I achieve this? &#xA;In Vim you have that with Neocomplete and VimSnippets. When I googled around, I found &lt;a href=&quot;https://github.com/company-mode/company-mode/blob/master/company-yasnippet.el&quot; rel=&quot;noreferrer&quot;&gt;this link with Elisp&lt;/a&gt; but I couldn't wrap my head around how to apply it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-12-29T07:25:45.150" LastActivityDate="2015-12-29T07:25:45.150" Title="Get Company to show suggestions for Yasnippet names" Tags="|completion|company-mode|yasnippet|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10432" PostTypeId="2" ParentId="10307" CreationDate="2015-03-31T20:43:16.280" Score="7" Body="&lt;p&gt;The simplest way to do this is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice isearch-update (before my-isearch-reposite activate)&#xA;  (sit-for 0)&#xA;  (recenter 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A better but more complicated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice isearch-update (before my-isearch-update activate)&#xA;  (sit-for 0)&#xA;  (if (and&#xA;       ;; not the scrolling command&#xA;       (not (eq this-command 'isearch-other-control-char))&#xA;       ;; not the empty string&#xA;       (&amp;gt; (length isearch-string) 0)&#xA;       ;; not the first key (to lazy highlight all matches w/o recenter)&#xA;       (&amp;gt; (length isearch-cmds) 2)&#xA;       ;; the point in within the given window boundaries&#xA;       (let ((line (count-screen-lines (point) (window-start))))&#xA;         (or (&amp;gt; line (* (/ (window-height) 4) 3))&#xA;             (&amp;lt; line (* (/ (window-height) 9) 1)))))&#xA;      (let ((recenter-position 0.3))&#xA;        (recenter '(4)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="478" LastActivityDate="2015-03-31T20:43:16.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10433" PostTypeId="1" AcceptedAnswerId="10467" CreationDate="2015-03-31T21:05:37.383" Score="6" ViewCount="185" Body="&lt;p&gt;I want to add better support for &lt;code&gt;expl3&lt;/code&gt; to AUCTeX.  I have regular expressions that properly group according to the naming conventions for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://regex101.com/r/sL8tY9/1&quot; rel=&quot;nofollow&quot;&gt;functions &lt;code&gt;(\\(?:__)?[a-z]+_)([a-z_]+)(:[nNpTFwcVvxof]*)&lt;/code&gt;&lt;/a&gt;,&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://regex101.com/r/jW6hN7/2&quot; rel=&quot;nofollow&quot;&gt;variables &lt;code&gt;(\\[cgl]__?)([a-z][a-z_]+)(_[A-Za-z]+)&lt;/code&gt;&lt;/a&gt;, and&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://regex101.com/r/aO0tC8/1&quot; rel=&quot;nofollow&quot;&gt;key-value segments &lt;code&gt;\s*([a-z\-]+)\s+(\.[a-z_]+):([nNpTFwcVvxof]*)\s+=&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I apply faces to both&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the match as a whole and&lt;/li&gt;&#xA;&lt;li&gt;the individual groups (overriding the whole match where appropriate)?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Just a proof-of-concept using the function-regexp would be &lt;em&gt;very&lt;/em&gt; helpful :)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;rx&lt;/code&gt; Forms&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq LaTeX-expl3-function-regexp&#xA;      (rx symbol-start&#xA;          (group &quot;\\&quot; (optional &quot;__&quot;) (+ alpha) &quot;_&quot;)&#xA;          (group (+ (any alpha &quot;_&quot;)))&#xA;          (group &quot;:&quot; (* (any &quot;nNpTFwcVvxofD&quot;)))&#xA;          symbol-end)&#xA;&#xA;      LaTeX-expl3-variable-regexp&#xA;      (rx symbol-start&#xA;          (group &quot;\\&quot; (any &quot;cgl&quot;) &quot;_&quot; (optional &quot;_&quot;))&#xA;          (group (or (seq (any alpha) &quot;_&quot;) &quot;@@_&quot;)) &#xA;          (group (any alpha) (+ (any alpha &quot;_&quot;)))&#xA;          (group &quot;_&quot; (+ alpha))&#xA;          symbol-end)&#xA;&#xA;      LaTeX-expl3-keyval-regexp&#xA;      (rx (* whitespace)&#xA;          (group (any alpha &quot;-&quot;))&#xA;          (+ whitespace)&#xA;          (group &quot;.&quot; (+ (any alpha)))&#xA;          (group &quot;:&quot; (* (any &quot;nNpTFwcVvxofD&quot;)))&#xA;          (+ whitespace) &quot;=&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-04-02T04:58:27.780" LastActivityDate="2015-04-03T14:18:07.077" Title="How can I fontify a symbol by regexp match group (as in a naming convention)?" Tags="|auctex|faces|regular-expressions|font-lock|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="10434" PostTypeId="2" ParentId="164" CreationDate="2015-03-31T21:07:17.607" Score="2" Body="&lt;p&gt;I don't have automatic but if you wanted to have it in a quick one key here how you can have that :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-gnus-bbdb-snarf-sender ()&#xA;  (interactive)&#xA;  (gnus-with-article-buffer&#xA;    (let ((from (mail-fetch-field &quot;from&quot;)))&#xA;      (bbdb-snarf from 'mail))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and add in a hook for gnus-summary-hook to a key, like for example :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-gnus-summary-mode-hook ()&#xA;  (local-set-key '[(\')] 'my-gnus-bbdb-snarf-sender))&#xA;(add-hook 'gnus-summary-mode-hook 'my-gnus-summary-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which bind it to the quote ' keyboard to add the sender directly to BBDB&lt;/p&gt;&#xA;" OwnerUserId="2466" LastActivityDate="2015-03-31T21:07:17.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10435" PostTypeId="2" ParentId="10412" CreationDate="2015-03-31T21:10:32.560" Score="1" Body="&lt;p&gt;This post offers a partial solution to your problem.  Note that it does &lt;em&gt;not&lt;/em&gt; do a sort by &lt;code&gt;AlbumArtist&lt;/code&gt; (hence the &quot;partial&quot;), but it does deal with compilation albums in the browser in a sane way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will want to modify &lt;code&gt;emms-browser-get-track-field-function&lt;/code&gt;, whose doctstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;*A function to get an element from a track.&#xA;  Change this to customize the way data is organized in the&#xA;  browser. For example,&#xA;  &lt;code&gt;emms-browser-get-track-field-use-directory-name&lt;/code&gt; uses the&#xA;  directory name to determine the artist. This means that&#xA;  soundtracks, compilations and so on don't populate the artist&#xA;  view with lots of 1-track elements.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;code&gt;emms-browser-get-track-field-use-directory-name&lt;/code&gt; itself is undocumented (a lot of &lt;code&gt;emms&lt;/code&gt; is like this, unfortunately).  You can either try to use the built-in function as suggested by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq emms-browser-get-track-field-function&#xA;      #'emms-browser-get-track-field-use-directory-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found the built-in function unsatisfactory for reasons I can't recall (it's been a while since I looked at the source code).  Instead, I rolled my own, which you're free to use/modify as you see fit:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dan-emms-get-artist-from-path (track)&#xA;  &quot;Identify artist name from directory name directly below&#xA;default directory.&quot;&#xA;  (let* ((path  (emms-track-get track 'name))&#xA;         (base  (expand-file-name emms-source-file-default-directory))&#xA;         (trunc (substring path (length base))))&#xA;    (car (split-string trunc &quot;/&quot;))))&#xA;&#xA;(defun dan-emms-get-track-field (track type)&#xA;  &quot;Sort artists by directory name in EMMS browser (avoids the&#xA;compilation albums propagating orphans in the list).&quot;&#xA;  (if (eq type 'info-artist)&#xA;      (dan-emms-get-artist-from-path track)&#xA;    (emms-track-get track type &quot;misc&quot;)))&#xA;&#xA;;; make compilations follow from the directory name (no orphans)&#xA;(setq emms-browser-get-track-field-function&#xA;      #'dan-emms-get-track-field)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-03-31T21:10:32.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10436" PostTypeId="1" CreationDate="2015-03-31T21:45:02.300" Score="1" ViewCount="956" Body="&lt;p&gt;My .emacs file includes a line I presumably added ages ago&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'some-random-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't actually been able to learn anything about the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;load-path&lt;/code&gt; is quite complicated (it takes up about a screenful) so a manual solution digging through the load path isn't ideal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware emacs' rules for loading a package are to look through the directories in the load path for foo.elc and foo. How can I find where the package came from?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-04-09T15:55:22.550" Title="Look up where package came from" Tags="|package|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10437" PostTypeId="1" CreationDate="2015-03-31T21:56:05.010" Score="4" ViewCount="766" Body="&lt;p&gt;I'm trying to get rid of tabs, following &lt;a href=&quot;http://www.emacswiki.org/emacs/NoTabs&quot; rel=&quot;nofollow&quot;&gt;this guide&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So: why &lt;code&gt;setq-default&lt;/code&gt; and not &lt;code&gt;setq&lt;/code&gt;? I know I would need to use &lt;code&gt;setq-default&lt;/code&gt; for a buffer-local variable, but I can't actually determine (except from inferring from the guide) whether &lt;code&gt;indent-tabs-mode&lt;/code&gt; is buffer local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h v&lt;/code&gt; return something more confusing to me:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Automatically becomes buffer-local when set.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it would become buffer local if I &lt;code&gt;setq&lt;/code&gt; it, so I must &lt;code&gt;setq-default&lt;/code&gt; it?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-04-09T14:37:23.300" Title="How to find out if variable is buffer-local?" Tags="|buffer-local|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10438" PostTypeId="1" AcceptedAnswerId="10439" CreationDate="2015-03-31T23:13:41.820" Score="17" ViewCount="22900" Body="&lt;p&gt;I find myself consistently zooming out (C-x C--) in every buffer that I am using in order to see more lines of code that I'm working on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to set the zoom level in my .emacs, not interactively?&#xA;Or should I look into setting the fontsize?&#xA;I've been using the zoom, because it's been the easiest/quickest solution, but I'd rather find a more permanent solution.  Are there disadvantages or advantages to using one versus the other?  I am unclear on the differences.&lt;/p&gt;&#xA;" OwnerUserId="477" LastEditorUserId="105" LastEditDate="2015-04-01T15:30:52.763" LastActivityDate="2021-12-22T17:41:43.400" Title="How to set the default font size?" Tags="|fonts|" AnswerCount="4" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="10439" PostTypeId="2" ParentId="10438" CreationDate="2015-04-01T00:08:48.190" Score="12" Body="&lt;p&gt;Yes. What you want is to &lt;strong&gt;zoom (the font size for) a frame&lt;/strong&gt;, regardless of which buffers are displayed there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/zoom-frm.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;zoom-frm.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;, and these descriptions of &lt;a href=&quot;http://www.emacswiki.org/emacs/SetFonts#ZoomFrame&quot; rel=&quot;noreferrer&quot;&gt;zooming a frame&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/SetFonts#ZoomBuffer&quot; rel=&quot;noreferrer&quot;&gt;zooming a buffer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See, in particular, command &lt;strong&gt;&lt;code&gt;zoom-in/out&lt;/code&gt;&lt;/strong&gt;, which does both.  It is bound by default to the keys normally bound to just buffer zooming: &lt;code&gt;C-x C-+&lt;/code&gt;, &lt;code&gt;C-x C--&lt;/code&gt;, &lt;code&gt;C-x C-0&lt;/code&gt;, and &lt;code&gt;C-x C-=&lt;/code&gt;.  You can also bind commands &lt;code&gt;zoom-in&lt;/code&gt; and &lt;code&gt;zoom-out&lt;/code&gt; to mouse-wheel rotations.  Using &lt;code&gt;C-u&lt;/code&gt; with any of these commands toggles between frame zooming and buffer zooming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides interactively zooming frames or buffers, you can of course set the default font size you want for all frames. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same &lt;a href=&quot;http://www.emacswiki.org/emacs/SetFonts&quot; rel=&quot;noreferrer&quot;&gt;Emacs-Wiki page&lt;/a&gt; has more info about setting fonts and font sizes.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update after you decided that you want to set the default font size&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is in the last line I wrote above: See section &lt;a href=&quot;http://www.emacswiki.org/emacs/SetFonts#GloballyChangingFont&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;em&gt;Globally Change the Default Font&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; on the Emacs Wiki &lt;a href=&quot;http://www.emacswiki.org/emacs/SetFonts&quot; rel=&quot;noreferrer&quot;&gt;Set Fonts&lt;/a&gt; page.  It tells you how to set the default font. (It also tells you how to zoom font sizes interactively.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is that information in a nutshell - put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(font . FONT ))&#xA;(set-face-attribute 'default t :font FONT )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But do read the entire section of that page, as it tells you more, including how to set the default font using &lt;code&gt;.Xresources&lt;/code&gt; and the Emacs daemon. An &lt;a href=&quot;https://stackoverflow.com/a/49013809/94687&quot;&gt;example&lt;/a&gt; of a line suitable for &lt;code&gt;~/.Xresources&lt;/code&gt; for setting the default font size is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs.default.attributeHeight: 94&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="5165" LastEditDate="2018-02-27T19:21:04.157" LastActivityDate="2018-02-27T19:21:04.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10440" PostTypeId="1" CreationDate="2015-04-01T03:49:16.857" Score="8" ViewCount="857" Body="&lt;p&gt;I frequently mistype &quot;_&quot; as &quot;-&quot; when doing a quick &lt;code&gt;isearch-forward&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. I'm looking for &lt;code&gt;snake_case&lt;/code&gt; and accidentally type &lt;kbd&gt;C-s&lt;/kbd&gt; &lt;code&gt;snake-case&lt;/code&gt; and get no results. Best case I notice quickly enough and don't have to delete too much of the search term, worst case I basically have to type it over again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way to hook into &lt;code&gt;isearch-forward&lt;/code&gt; to change my query into a &lt;code&gt;isearch-forward-regexp&lt;/code&gt; like &lt;code&gt;snake[-_]case&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to actually search for &lt;code&gt;lisp-case&lt;/code&gt; often enough that simply changing &quot;-&quot; to &quot;_&quot; is going to cause more problems than it solves.&lt;/p&gt;&#xA;" OwnerUserId="6917" LastActivityDate="2015-04-01T07:30:04.270" Title="How can I match &quot;snake_case&quot; automatically when I search for &quot;snake-case&quot; by mistake?" Tags="|isearch|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10441" PostTypeId="2" ParentId="10440" CreationDate="2015-04-01T04:43:21.443" Score="8" Body="&lt;p&gt;I can't imagine any such automated behaviour not then causing you pain when that's &lt;em&gt;not&lt;/em&gt; what you wanted it to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my mind kaushalmodi's recommendation of &lt;kbd&gt;M-e&lt;/kbd&gt; is the best answer -- making it easy to correct the problem seems preferable to trying to make isearch read your mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that isearch is smart enough to take note of the first character where the search failed, and &lt;kbd&gt;M-e&lt;/kbd&gt; places the cursor at that position automatically so, even when you've continued to type subsequent characters, the typical key sequence to fix the pattern and resume searching would just be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-e&lt;/kbd&gt;&lt;kbd&gt;C-d&lt;/kbd&gt;&lt;kbd&gt;_&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-04-01T04:43:21.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10442" PostTypeId="2" ParentId="10440" CreationDate="2015-04-01T07:30:04.270" Score="5" Body="&lt;p&gt;If you use &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;swiper&lt;/a&gt; and search for &lt;code&gt;snake case&lt;/code&gt;, it will match&#xA;both &lt;code&gt;snake_case&lt;/code&gt; and &lt;code&gt;snake-case&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;swiper&lt;/code&gt; is a new &lt;code&gt;isearch&lt;/code&gt; alternative that gives you an overview in the minibuffer as you search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://oremacs.com/download/ivy-swiper-3.png&quot; alt=&quot;swiper.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the image above, the input is &lt;code&gt;ivy m&lt;/code&gt; that translates to the regex &lt;code&gt;ivy.*m&lt;/code&gt;.&#xA;There are 36 matches for this regex. You can navigate between them with &lt;kbd&gt;C-s&lt;/kbd&gt;/&lt;kbd&gt;C-r&lt;/kbd&gt;&#xA;or &lt;kbd&gt;C-n&lt;/kbd&gt;/ &lt;kbd&gt;C-p&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install &lt;code&gt;swiper&lt;/code&gt; with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;package-install&lt;/code&gt;. It's available in both MELPA and GNU&#xA;ELPA.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.530" LastActivityDate="2015-04-01T07:30:04.270" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10444" PostTypeId="2" ParentId="10438" CreationDate="2015-04-01T09:31:12.173" Score="5" Body="&lt;p&gt;I'm using this for zooming Emacs-wide (not just the current buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; http://blog.vivekhaldar.com/post/4809065853/dotemacs-extract-interactively-change-font-size&#xA;(defun my/zoom-in ()&#xA;  &quot;Increase font size by 10 points&quot;&#xA;  (interactive)&#xA;  (set-face-attribute 'default nil&#xA;                      :height&#xA;                      (+ (face-attribute 'default :height)&#xA;                         10)))&#xA;&#xA;(defun my/zoom-out ()&#xA;  &quot;Decrease font size by 10 points&quot;&#xA;  (interactive)&#xA;  (set-face-attribute 'default nil&#xA;                      :height&#xA;                      (- (face-attribute 'default :height)&#xA;                         10)))&#xA;&#xA;;; change font size, interactively&#xA;(global-set-key (kbd &quot;C-&amp;gt;&quot;) 'my/zoom-in)&#xA;(global-set-key (kbd &quot;C-&amp;lt;&quot;) 'my/zoom-out)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-04-01T09:31:12.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10445" PostTypeId="1" AcceptedAnswerId="10463" CreationDate="2015-04-01T09:41:54.567" Score="11" ViewCount="2233" Body="&lt;p&gt;With:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when window-system&#xA;  (set-face-background 'hl-line &quot;light yellow&quot;)&#xA;  (global-hl-line-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;current line highlighted by yellow background, but if text has background properties it also overwritten (like diff-mode, rainbow-mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to set background only for parts that have no appropriate properties?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; I start experimenting, seems that stipple isn't conflicting with background:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-stipple 'hl-line '(4 4 &quot;\x01\x00\x00\x00&quot;))&#xA;(set-face-attribute 'hl-line nil :inherit nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But stipple unfortunately damage text appearance...&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2016-12-22T17:28:25.497" LastActivityDate="2021-05-20T08:58:08.647" Title="hl-line-mode hide background, how to avoid this?" Tags="|elisp|syntax-highlighting|hl-line-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10446" PostTypeId="2" ParentId="10445" CreationDate="2015-04-01T11:51:27.713" Score="6" Body="&lt;p&gt;I end with a partial solution - highlight only from the end of line:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-hl-line-range-function ()&#xA;  (cons (line-end-position) (line-beginning-position 2)))&#xA;(setq hl-line-range-function #'my-hl-line-range-function)&#xA;&#xA;(when window-system&#xA;  (require 'hl-line)&#xA;  (set-face-attribute 'hl-line nil :inherit nil :background &amp;quot;light yellow&amp;quot;)&#xA;  (setq global-hl-line-sticky-flag t)&#xA;  (global-hl-line-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2021-05-20T08:58:08.647" LastActivityDate="2021-05-20T08:58:08.647" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10447" PostTypeId="1" AcceptedAnswerId="10448" CreationDate="2015-04-01T15:59:16.160" Score="5" ViewCount="2293" Body="&lt;p&gt;I am a newbie in emacs and have heard a lot about how powerful emacs is. But the leaning curve seems to be quite steep. If there was a fun way to learn emacs (something like the game &lt;a href=&quot;http://vim-adventures.com/&quot; rel=&quot;noreferrer&quot;&gt;VIM adventures&lt;/a&gt;) that could help me quickly to familiarize the key binding and modes, I could dig deeper into more advanced features of emacs.  &lt;/p&gt;&#xA;" OwnerUserId="6864" LastEditorUserId="253" LastEditDate="2015-04-01T16:01:01.810" LastActivityDate="2015-04-01T16:03:34.597" Title="Are there any games to kickstart learning emacs like VIM Adventures?" Tags="|learning|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10448" PostTypeId="2" ParentId="10447" CreationDate="2015-04-01T16:03:34.597" Score="2" Body="&lt;p&gt;It isn't nearly as gamified as Vim Adventures, but &lt;a href=&quot;http://users-phys.au.dk/harder/keywiz.el&quot; rel=&quot;nofollow&quot;&gt;keywiz&lt;/a&gt; has points, time limits, and high scores; maybe that's enough to qualify it as a game.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-04-01T16:03:34.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10449" PostTypeId="1" CreationDate="2015-04-01T16:28:54.157" Score="0" ViewCount="218" Body="&lt;p&gt;Despite respectable variety of &lt;code&gt;display-buffer-*&lt;/code&gt; functions some of them stand out with lack of flexibility, such as &lt;code&gt;display-buffer-at-bottom&lt;/code&gt; or &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html#index-display_002dbuffer_002dbelow_002dselected-2387&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;display-buffer-below-selected&lt;/code&gt;&lt;/a&gt; that exist in absence of reverse variant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that decision was intentional, I would like to know what limitations are stopping these procedures from following the suit, or if there exists an easy way to create opposite implementation on the spot using existing inventory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make it more clear, here's my own attempt at making &lt;a href=&quot;https://gist.github.com/myeffort/3526f886c494a9e2b5b9&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;display-buffer-above-selected&lt;/code&gt;&lt;/a&gt; which only exposes the duplication that lays burden on those that seek to replace missing functionality.&lt;/p&gt;&#xA;" OwnerUserId="279" LastActivityDate="2015-04-01T16:28:54.157" Title="Conventional implementation of display-buffer-above-selected" Tags="|window|display-buffer-alist|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10450" PostTypeId="1" AcceptedAnswerId="21719" CreationDate="2015-04-01T17:03:19.867" Score="1" ViewCount="902" Body="&lt;p&gt;I'm currently having difficulty with a graphical glitch in Emacs 24.4.1. Occasionally all the text in my current frame will tear, and I'll have to force Windows to redraw everything by covering up the Emacs frame with another window. This doesn't seem to happen with any consistency, and only occurs with Emacs. I'm not entirely sure how to reliably reproduce the error, rather it just happens randomly whenever I'm working in it. Any help would be greatly appreciated, and an example picture is attached below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hYSub.png&quot; alt=&quot;Emacs Graphical Glitch&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6654" LastActivityDate="2016-04-19T19:35:29.720" Title="Graphical Glitch/Screen Tearing in Emacs" Tags="|frames|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10451" PostTypeId="5" CreationDate="2015-04-01T17:25:46.600" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-04-01T17:25:46.600" LastActivityDate="2015-04-01T17:25:46.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10452" PostTypeId="4" CreationDate="2015-04-01T17:25:46.600" Score="0" Body="Running Emacs non-interactively via the `--batch` command-line option." OwnerUserId="6898" LastEditorUserId="6898" LastEditDate="2015-04-01T20:25:51.020" LastActivityDate="2015-04-01T20:25:51.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10453" PostTypeId="1" AcceptedAnswerId="10509" CreationDate="2015-04-01T17:26:45.197" Score="1" ViewCount="1305" Body="&lt;p&gt;I'm pretty new to emacs customization and lisp, so I don't really know how to debug this problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to install a custom theme. &lt;a href=&quot;https://github.com/TheQZ/emerald-emacs/blob/master/emerald-theme.el#L27&quot; rel=&quot;nofollow&quot;&gt;Here's a link to the .el file.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The theme's load-path is set correctly, and it shows up in the &lt;code&gt;M-x customize-themes&lt;/code&gt; menu, but when I try to enable it I get this in the echo area:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Undefined Custom theme emerald&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea why this is happening? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6927" LastActivityDate="2015-04-04T20:39:40.197" Title="Why is emacs saying my theme is undefined?" Tags="|themes|customize|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10454" PostTypeId="1" CreationDate="2015-04-01T17:53:34.090" Score="9" ViewCount="365" Body="&lt;p&gt;I'm looking at &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;emacs helm&lt;/a&gt; specifically, which has the following properties:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it has thousands of commits&lt;/li&gt;&#xA;&lt;li&gt;it is largely maintained by one user&lt;/li&gt;&#xA;&lt;li&gt;the maintainer has no other profiles (social media, etc.) I was able to find on a few searches&lt;/li&gt;&#xA;&lt;li&gt;it is actively maintained (today)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since I'm about to install arbitrary code on my computer to use in my text editor, I wanted to verify if this has undergone any review process. I'd like to say &quot;well it's open source&quot; but I really am far from the elisp ability to audit all the code myself. I would like to assume others in the community have reviewed it but one that's probably false, and two there are up-to-the-minute commits. Are there other strategies I am missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the record the vector is simple: &quot;open source&quot; doesn't matter all that much if the contributor is working under a throwaway account, or if there's no review process.&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-05-28T18:08:22.350" Title="How do I verify a large package in a git repo is safe?" Tags="|helm|package|security|github|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10455" PostTypeId="1" AcceptedAnswerId="10457" CreationDate="2015-04-01T18:04:18.240" Score="6" ViewCount="1491" Body="&lt;p&gt;I am trying to create something like &lt;code&gt;uniquely&lt;/code&gt;, which renames the buffer to the full path within the &lt;code&gt;projectile&lt;/code&gt; project. I have the code working, however, I can't seem to figure out how to get it to run when a new buffer is open. It seems like Emacs does not provide any hooks for when a new buffer is opened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a good way to run the code when a new buffer is opened? How does &lt;code&gt;uniquely&lt;/code&gt; do it? I tried reading its source, but I can't seem to find where the code gets triggered to run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="5418" LastActivityDate="2015-04-01T18:13:10.367" Title="Run hook on new buffer" Tags="|hooks|projectile|uniquify|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10456" PostTypeId="2" ParentId="10421" CreationDate="2015-04-01T18:10:00.213" Score="4" Body="&lt;p&gt;Customize &lt;code&gt;org-plain-list-ordered-item-terminator&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While generally, customizing what org considers or doesn't consider a list item is somewhat tricky, the option provides exactly what you need. You have three options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;ol&gt;&#xA;&lt;li&gt;this is an item,&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;2) this is an item, or&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;3 both 1. and 2) are items.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;[Note that stackexchange also seems to have a problem interpreting this.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select 2, and you should be set.&lt;/p&gt;&#xA;" OwnerUserId="2241" LastActivityDate="2015-04-01T18:10:00.213" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10457" PostTypeId="2" ParentId="10455" CreationDate="2015-04-01T18:13:10.367" Score="7" Body="&lt;p&gt;You can advise &lt;code&gt;create-file-buffer&lt;/code&gt;, if you care only about file buffers.&#xA;Likewise, you can advise &lt;code&gt;rename-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's what &lt;code&gt;uniquify&lt;/code&gt; does, for instance. Are you familiar with &lt;code&gt;uniquify.el&lt;/code&gt;? Maybe it offers all that you need. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;Uniquify&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-01T18:13:10.367" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10458" PostTypeId="1" AcceptedAnswerId="10511" CreationDate="2015-04-01T18:23:34.410" Score="5" ViewCount="2026" Body="&lt;p&gt;What is the difference between &lt;code&gt;reftex-citation&lt;/code&gt; and &lt;code&gt;org-reftex-citation&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And where can I find the documentation for &lt;code&gt;org-reftex-citation&lt;/code&gt; referenced in &lt;a href=&quot;https://emacs.stackexchange.com/a/3381/6890&quot;&gt;this answer&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/reftex/Options-_002d-Creating-Citations.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs manual: Creating citations&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6890" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-04-04T21:11:42.830" Title="What is the difference between reftex-citation and org-reftex-citation?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10459" PostTypeId="1" CreationDate="2015-04-01T18:54:04.443" Score="1" ViewCount="115" Body="&lt;p&gt;I would like to embedd full references of BibTeX entries in selected sections of my org-mode files or at least have the ability to quickly open the full reference in a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c &amp;amp;&lt;/code&gt; (&lt;code&gt;reftex-view-crossref&lt;/code&gt;) does not work and only opens an empty buffer when using the following configuration for reftex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org&#xA;  (defun org-mode-reftex-setup ()&#xA;    ;; (load-library &quot;reftex&quot;)&#xA;    (require 'reftex)&#xA;    (and (buffer-file-name)&#xA;         (file-exists-p (buffer-file-name))&#xA;          (reftex-parse-all)&#xA;         )&#xA;        (make-local-variable 'reftex-cite-format)&#xA;    (setq reftex-cite-format &quot;[[%l]]&quot;)&#xA;    (setq reftex-default-bibliography '(&quot;references&quot;))&#xA;    (define-key org-mode-map (kbd &quot;C-c )&quot;) 'reftex-citation))&#xA;  (add-hook 'org-mode-hook 'org-mode-reftex-setup))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/reftex.html#Viewing-Cross_002dReferences&quot; rel=&quot;nofollow&quot;&gt;Reftex manual: Viewing cross references&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6890" LastActivityDate="2015-04-01T18:54:04.443" Title="How can I print a full reference using reftex?" Tags="|reftex-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10460" PostTypeId="1" AcceptedAnswerId="10461" CreationDate="2015-04-01T21:29:39.960" Score="2" ViewCount="365" Body="&lt;p&gt;I need to use Emacs built-in &lt;code&gt;url.el&lt;/code&gt; &lt;code&gt;url-unhex-string&lt;/code&gt; to decode uri (e.g. &lt;code&gt;/%E5%85%B6%E4%BB%96/other&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works, but all non-ascii (I guess it should be Unicode) characters are all converted into integers with backslashes (e.g. &lt;code&gt;/\345\205\266\344\273\226/other&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I encode these integers back to correct characters? Emacs built-in function is prefered.&lt;/p&gt;&#xA;" OwnerUserId="515" LastEditorUserId="515" LastEditDate="2015-04-01T21:43:28.643" LastActivityDate="2015-04-01T22:01:46.473" Title="Unicode and `url-unhex-string` and something like \345\205\266\344\273\226" Tags="|character-encoding|unicode|url|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10461" PostTypeId="2" ParentId="10460" CreationDate="2015-04-01T22:01:46.473" Score="2" Body="&lt;p&gt;Just found solution: use &lt;code&gt;decode-coding-string&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(url-unhex-string &quot;/%E5%85%B6%E4%BB%96/other&quot;) &#xA;;; =&amp;gt; &quot;/\345\205\266\344\273\226/other&quot;&#xA;(decode-coding-string (url-unhex-string &quot;/%E5%85%B6%E4%BB%96/other&quot;) 'utf-8) &#xA;;; =&amp;gt; &quot;/其他/other&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="515" LastActivityDate="2015-04-01T22:01:46.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10462" PostTypeId="1" CreationDate="2015-04-02T02:23:00.820" Score="4" ViewCount="1943" Body="&lt;p&gt;I have installed &lt;a href=&quot;https://github.com/bastibe/org-journal&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-journal&lt;/code&gt;&lt;/a&gt; and it seems to work well to create entries. However, I can't find and view them again. The &lt;a href=&quot;http://www.emacswiki.org/emacs/OrgJournal&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation on EmacsWiki&lt;/a&gt; says to view the entry:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;In calendar view:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;j&lt;/code&gt; to view an entry&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I'm not sure what is meant by &amp;quot;calendar view&amp;quot;. I exececute &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;calendar&lt;/code&gt; and the bottom of the screen has a 3-month calendar and the days that have journal entries are highlighted. I move the cursor over one of the highlighted dates and press &lt;kbd&gt;j&lt;/kbd&gt;. I get an error about undefined key.&lt;/p&gt;&#xA;&lt;p&gt;So, what exactly is meant by &amp;quot;calendar view&amp;quot;? Does &lt;code&gt;org-mode&lt;/code&gt; have its own calendar view?&lt;/p&gt;&#xA;&lt;p&gt;Any advice appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6929" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-04-07T20:32:29.103" Title="Viewing org-journal entries" Tags="|org-mode|calendar|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10463" PostTypeId="2" ParentId="10445" CreationDate="2015-04-02T03:44:42.357" Score="5" Body="&lt;p&gt;The problem is that sometimes text property &lt;code&gt;face&lt;/code&gt; is used for highlighting, and &lt;code&gt;hl-line-mode&lt;/code&gt; uses an overlay. And &lt;em&gt;overlays always appear &quot;on top of&quot; text property &lt;code&gt;face&lt;/code&gt; highlighting&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;diff-mode&lt;/code&gt;, for example, uses the text property, not an overlay. So for cases like this you are out of luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for highlighting that is produced by an overlay you can just reduce the overlay priority of the hl-line overlay: either &lt;code&gt;hl-line-overlay&lt;/code&gt; or &lt;code&gt;global-hl-line-overlay&lt;/code&gt;, so that that overlay appears to be &quot;below&quot; the other overlay highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/hl-line%2b.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;hl-line+.el&lt;/code&gt;&lt;/a&gt; then you can use option &lt;code&gt;hl-line-overlay-priority&lt;/code&gt; to set the overlay priority. See also Emacs Wiki page &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightCurrentLine&quot; rel=&quot;noreferrer&quot;&gt;Highlight Current Line&lt;/a&gt;.  (But again, changing the overlay priority has no effect if the other highlighting is not from an overlay.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-02T03:44:42.357" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10464" PostTypeId="1" CreationDate="2015-04-02T04:20:54.443" Score="9" ViewCount="2138" Body="&lt;p&gt;I've had this right at one point in the past on one machine with a certain font type at a particular font size, but I can't seem to get it right again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look e.g. at how my org mode tables look once I add Japanese characters. Here are two examples using fonts that were supposed to align properly (I read somewhere).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VMnOe.png&quot; alt=&quot;DejaVu Sans Mono Book 10&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RcKT6.png&quot; alt=&quot;Insolata Medium 10&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is version&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2014-12-10 on gaia, modified by Debian&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; A copy-and-pasteable version of a bunch of alignment problems for anyone who wants to try themselves:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| a 漢字       |   |&#xA;| b はどう     |   |&#xA;| f デショウ a |   |&#xA;| ﾊｰﾌ          |   |&#xA;| ｗｈｏｌｅ   |   |&#xA;| half         |   |&#xA;| ○            |   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3951" LastEditorUserId="3951" LastEditDate="2015-04-03T00:59:50.163" LastActivityDate="2016-09-08T22:03:52.837" Title="Japanese / CJK font settings for proper horizontal alignment" Tags="|fonts|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10465" PostTypeId="1" AcceptedAnswerId="10466" CreationDate="2015-04-02T04:41:59.187" Score="8" ViewCount="1508" Body="&lt;p&gt;Projectile is pretty great, but I'm finding it difficult to have it turned on only in places where it would be effective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, the two standard choices are to turn it on manually, as in major mode hooks, or to enable it globally with &lt;code&gt;projectile-global-mode&lt;/code&gt;.  I find the former not broad enough; I want to be able to access projectile commands while visting &lt;em&gt;any&lt;/em&gt; file in a project, regardless of its type.  But turning the mode on globally is &lt;em&gt;too&lt;/em&gt; broad; it gets turned on even when visiting such manifestly non-project directories as my home directory, &lt;code&gt;/tmp&lt;/code&gt;, &lt;code&gt;/etc&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a standard way to activate &lt;code&gt;projectile-mode&lt;/code&gt; only when visiting a file that lives in an actual project, as might be determined by, say, checking for the existence of a &lt;code&gt;.git&lt;/code&gt;, &lt;code&gt;.svn&lt;/code&gt;, etc, directory in some ancestor directory of the current file?&lt;/p&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2016-01-09T15:02:44.640" Title="Turn on projectile-mode only for files in actual projects" Tags="|projectile|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10466" PostTypeId="2" ParentId="10465" CreationDate="2015-04-02T05:39:43.597" Score="11" Body="&lt;p&gt;So, it's about the modeline. You can set &lt;code&gt;projectile-mode-line&lt;/code&gt; to check if you are in a project root; if so, displays in the modeline, otherwise displays nothing:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq projectile-mode-line&#xA;      '(:eval (if (projectile-project-p)&#xA;                  (format &quot; Projectile[%s]&quot;&#xA;                          (projectile-project-name))&#xA;                &quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastEditorUserId="3889" LastEditDate="2016-01-09T15:02:44.640" LastActivityDate="2016-01-09T15:02:44.640" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10467" PostTypeId="2" ParentId="10433" CreationDate="2015-04-02T07:45:57.967" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;font-lock-add-keywords&lt;/code&gt; in a major mode hook to add new rules. The format of the rules is described in the help text to the variable &lt;code&gt;font-lock-keywords&lt;/code&gt;. In short, your code would look something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-LaTeX-expl3-hook ()&#xA;  (font-lock-add-keywords nil&#xA;                          `((,LaTeX-expl3-function-regexp&#xA;                             (0 face-for-whole-match prepend)&#xA;                             (1 face-for-group-one prepend)&#xA;                             (2 face-for-group-two prepend))&#xA;                            (,LaTeX-expl3-variable-regexp&#xA;                             (0 font-lock-variable-name-face prepend))&#xA;                            (,LaTeX-expl3-keyval-regexp&#xA;                             (0 font-lock-keyword-face prepend)))&#xA;                          t)) ;; Append&#xA;(add-hook 'latex-mode-hook 'my-LaTeX-expl3-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, I've used &lt;code&gt;0&lt;/code&gt; to highlight the entire match. If you would like to highlight only parts, supply a integer 1, 2, 3 etc. that corresponds the the parenthesis you would like to highlight. You can supply more than one such rule to each regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;prepend&lt;/code&gt; flag indicates that this takes precedence over already present fontification. (However, unlike passing &lt;code&gt;t&lt;/code&gt;, it leaves, for example, the background intact even if it overrides the foreground.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you find that you keywords doesn't work as intended, I would recommend using &lt;a href=&quot;https://github.com/Lindydancer/font-lock-studio&quot; rel=&quot;nofollow&quot;&gt;font-lock-studio&lt;/a&gt;, an interactive debugger that lets you step the font-lock machinery one step at a time, it highlights matches in the source buffer and in the regexps using a palette of background colors etc.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-04-03T14:18:07.077" LastActivityDate="2015-04-03T14:18:07.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10468" PostTypeId="1" AcceptedAnswerId="10476" CreationDate="2015-04-02T08:37:06.483" Score="11" ViewCount="1073" Body="&lt;p&gt;AFAIK emacs does not support &lt;code&gt;keyup/keydown&lt;/code&gt; events, only &lt;code&gt;keypressed&lt;/code&gt;. An example of a consequence is that when we want to mark a region we have to first set a mark &lt;code&gt;set-mark-command&lt;/code&gt; and can then mark the region by moving around the point. While this is really an interesting feature as you don't have to hold a shift key pressed while marking the text, sometimes it would be desirable to have the same behavior like in other editors. This question is to understand why emacs doesn't support this feature and why this is considered &lt;em&gt;better&lt;/em&gt;. Also is there an ideomatic approach how we could solve this in emacs?  &lt;/p&gt;&#xA;" OwnerUserId="6930" LastEditorUserId="253" LastEditDate="2015-04-02T12:10:35.603" LastActivityDate="2015-04-02T19:48:16.097" Title="why doesn't emacs support key up/down events" Tags="|key-bindings|keystrokes|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10469" PostTypeId="1" AcceptedAnswerId="10565" CreationDate="2015-04-02T10:08:18.187" Score="0" ViewCount="441" Body="&lt;p&gt;I run Emacs on development host under X Window as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs24&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;code&gt;~/.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(server-start)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next when I connect to Emacs as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ssh -Y localhost&#xA;ssh$ emacsclient -c&#xA;C-x C-c&#xA;ssh$ exit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ startx xterm -- `command -v Xnest` :1 -geometry 800x600&#xA;xnest$ emacsclient -c&#xA;C-x C-c&#xA;xnest$ exit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;main Emacs exit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like ability to join to my Emacs session from remote host for getting working context immediately. But when I come to original host or try to re-establish X connection - I have to start new Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make Emacs live when I close remote X connection?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; I don't try &lt;code&gt;--daemon&lt;/code&gt;as think that &lt;code&gt;(server-start)&lt;/code&gt; are equivalent form.&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-02-01T08:04:13.383" Title="Emacs server exit when losing connection to Xserver" Tags="|server|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10470" PostTypeId="2" ParentId="9455" CreationDate="2015-04-02T13:54:26.677" Score="3" Body="&lt;p&gt;Ha!  There's a subtle bug in your code: the 3rd argument of &lt;code&gt;define-abbrev-table&lt;/code&gt; is the &lt;em&gt;docstring&lt;/em&gt;, so it treats &lt;code&gt;:enable-function&lt;/code&gt; as the docstring and the subsequent function as a property name (with missing value).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-02T13:54:26.677" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10471" PostTypeId="2" ParentId="10153" CreationDate="2015-04-02T14:58:25.180" Score="4" Body="&lt;p&gt;Beginning with &lt;code&gt;v2.1&lt;/code&gt; Magit features several push variants, all of which are available from the new pushing popup on &lt;kbd&gt;P&lt;/kbd&gt;. In &lt;code&gt;v2.4&lt;/code&gt; this has been improved again. The popup now features &lt;kbd&gt;p&lt;/kbd&gt; to push to the configured push-remote, &lt;kbd&gt;u&lt;/kbd&gt; to push to the configured upstream branch, and &lt;kbd&gt;e&lt;/kbd&gt; to push to somewhere else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;kbd&gt;p&lt;/kbd&gt; and &lt;kbd&gt;u&lt;/kbd&gt; offer to set the respective remote/branch before pushing if it is not configured yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also there is a new &lt;code&gt;magit-branch-set-upstream&lt;/code&gt; command, which &lt;kbd&gt;b u&lt;/kbd&gt; is bound to. And when creating a new branch with a starting-point that is a remote branch, then that is automatically used as upstream. After running &lt;code&gt;git commit --global branch.autoSetupMerge always&lt;/code&gt; once, the same happens if the starting-point is a local branch.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also see &lt;a href=&quot;https://emacs.stackexchange.com/a/6023/306&quot;&gt;this answer&lt;/a&gt; on a related question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And to learn more about the push-remote see the &lt;em&gt;Branching&lt;/em&gt; node in the info manual, as well as &lt;a href=&quot;https://emacs.stackexchange.com/a/19150/306&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-30T23:17:49.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10472" PostTypeId="2" ParentId="7741" CreationDate="2015-04-02T15:34:55.800" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If it happens with &lt;code&gt;emacs -Q&lt;/code&gt;, file a bug report with &lt;code&gt;M-x bug-report&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you verify that this doesn't happen on Emacs 24.4, you can even:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Send an email to the dev list. It's likely that the person who inadvertently introduced the bug will immediately know what's happening.&lt;/li&gt;&#xA;&lt;li&gt;Open the ChangeLog file and search for changes to the affected package. There should be something related to indentation in there, and it will be easy to spot.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-04-02T16:35:08.293" LastActivityDate="2015-04-02T16:35:08.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10474" PostTypeId="2" ParentId="10464" CreationDate="2015-04-02T17:00:22.830" Score="3" Body="&lt;p&gt;There's a solution that may be the best one currently (I use this solution):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://coldnew.github.io/blog/2013/11/16_d2f3a.html&quot; rel=&quot;nofollow&quot;&gt;http://coldnew.github.io/blog/2013/11/16_d2f3a.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though the article is in Chinese, but you still can read the Emacs Lisp code easily to understand what mechanism it has done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/kuanyui/.emacs.d/blob/master/rc/rc-basic.el#L102&quot; rel=&quot;nofollow&quot;&gt;My configuration example&lt;/a&gt; may be helpful.&lt;/p&gt;&#xA;" OwnerUserId="515" LastActivityDate="2015-04-02T17:00:22.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10475" PostTypeId="1" CreationDate="2015-04-02T19:45:20.543" Score="3" ViewCount="2257" Body="&lt;p&gt;I'm using &lt;a href=&quot;http://webdraft.hu/fonts/classic-console/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Classic Console Homepage&quot;&gt;Classic Console&lt;/a&gt; font in buffers. Unfortunately for some reason letter spacing is terrible in Emacs while being correct in Konsole and other programs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Text in Emacs:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/ItjDG.png&quot; alt=&quot;Classic Console in Emacs&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Text in Konsole (using the same font and size):&#xA;&lt;img src=&quot;https://i.stack.imgur.com/qlTfh.png&quot; alt=&quot;Classic Console in Konsole&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Another case with Courier Prime:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0ZMwC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0ZMwC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(default ((t (:family &quot;Courier Prime&quot; :foundry &quot;QUQA&quot; &#xA;               :slant normal :weight normal :height 83 &#xA;               :width normal :spacing 10))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:spacing 10&lt;/code&gt; did not work.&lt;/p&gt;&#xA;" OwnerUserId="6933" LastEditorUserId="20387" LastEditDate="2019-09-17T15:59:07.133" LastActivityDate="2021-06-18T19:03:45.293" Title="Wrong letter spacing when using certain fonts" Tags="|fonts|linux|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="10476" PostTypeId="2" ParentId="10468" CreationDate="2015-04-02T19:48:16.097" Score="2" Body="&lt;p&gt;As answered in comments for historical reason Emacs run in terminals and those devices are character oriented - you get byte sequence without any guarantee when this happen at keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discussion also point that it is possible to implement this for graphical environment. But nobody interested in that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that some programs like games or music software may use detailed info about when key pressed, how long, and when released but text editing have nothing common with these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From manual &lt;code&gt;(info &quot;(elisp)Mouse Events&quot;)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs supports four kinds of mouse events:&#xA;click events, drag events, button-down events, and motion events.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hover event can be emulated by idle timer - analyzing thing at point after delay.&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2015-04-02T19:48:16.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10477" PostTypeId="1" CreationDate="2015-04-02T19:57:59.110" Score="2" ViewCount="251" Body="&lt;p&gt;Under GNU Emacs 24.4.1, in Message Mode, C-c C-w runs &lt;code&gt;message-insert-signature&lt;/code&gt;, which inserts the file &lt;code&gt;message-signature-file&lt;/code&gt; at the end of the buffer, if such a signature is not already present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I extend the function &lt;code&gt;message-insert-signature&lt;/code&gt; so that to maintain its current functionalities but add one such that, when prefixing the command with C-u (which gives C-u C-c C-w), the signature is rather inserted at point (e.g. for mails where there are attachments which I wish to be AFTER the signature)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be easy to define a function to insert &lt;code&gt;&quot;\n-- \n&quot;&lt;/code&gt; and perform &lt;code&gt;(insert-file-contents signature-file)&lt;/code&gt; at point, and to bind it to a new key combination, but my muscle memory is set to &lt;code&gt;C-u C-c C-w&lt;/code&gt; from my previous use of VM, and I thought it could be the same for other users.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code of the function &lt;code&gt;message-insert-signature&lt;/code&gt;  bound by default to &lt;code&gt;C-c C-w&lt;/code&gt; is interactive with parameters &lt;code&gt;(&amp;amp;optional force)&lt;/code&gt;, which suggests that one could &quot;force&quot; the signature to be inserted, but I don't understand how the &lt;code&gt;(interactive (list 0))&lt;/code&gt; works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun message-insert-signature (&amp;amp;optional force)&#xA;  &quot;Insert a signature.  See documentation for variable `message-signature'.&quot;&#xA;  (interactive (list 0))&#xA;  (let* ((signature&#xA;      (cond&#xA;       ((and (null message-signature)&#xA;         (eq force 0))&#xA;        (save-excursion&#xA;          (goto-char (point-max))&#xA;          (not (re-search-backward message-signature-separator nil t))))&#xA;       ((and (null message-signature)&#xA;         force)&#xA;        t)&#xA;       ((functionp message-signature)&#xA;        (funcall message-signature))&#xA;       ((listp message-signature)&#xA;        (eval message-signature))&#xA;       (t message-signature)))&#xA;     signature-file)&#xA;    (setq signature&#xA;      (cond ((stringp signature)&#xA;         signature)&#xA;        ((and (eq t signature) message-signature-file)&#xA;         (setq signature-file&#xA;               (if (and message-signature-directory&#xA;                ;; don't actually use the signature directory&#xA;                ;; if message-signature-file contains a path.&#xA;                (not (file-name-directory&#xA;                      message-signature-file)))&#xA;               (expand-file-name message-signature-file&#xA;                         message-signature-directory)&#xA;             message-signature-file))&#xA;         (file-exists-p signature-file))))&#xA;    (when signature&#xA;      (goto-char (point-max))&#xA;      ;; Insert the signature.&#xA;      (unless (bolp)&#xA;    (insert &quot;\n&quot;))&#xA;      (when message-signature-insert-empty-line&#xA;    (insert &quot;\n&quot;))&#xA;      (insert &quot;-- \n&quot;)&#xA;      (if (eq signature t)&#xA;      (insert-file-contents signature-file)&#xA;    (insert signature))&#xA;      (goto-char (point-max))&#xA;      (or (bolp) (insert &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6934" LastEditorUserId="6934" LastEditDate="2015-04-06T19:41:00.830" LastActivityDate="2015-04-06T19:41:00.830" Title="elisp function to insert signature at point or at end, according to the prefix parameter" Tags="|message-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10478" PostTypeId="1" CreationDate="2015-04-02T21:07:33.643" Score="0" ViewCount="135" Body="&lt;p&gt;In python-mode, I invoke pdb on a python script by &lt;code&gt;M-x pdb script.py&lt;/code&gt;. I then type &lt;code&gt;c&lt;/code&gt; to run till a breakpoint, and hit the name of a big list. It keeps on printing the content of the list in the buffer for pdb, and how can I cancel the printing? &#xA;C-c C-c doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2015-04-03T07:07:50.097" Title="cancel outputing in pdb in emacs" Tags="|python|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10479" PostTypeId="2" ParentId="10477" CreationDate="2015-04-02T21:15:55.637" Score="5" Body="&lt;p&gt;What you need to do is write a new interactive function that receives the optional &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html&quot; rel=&quot;nofollow&quot;&gt;prefix argument&lt;/a&gt; and runs either the &quot;insert here&quot; or &quot;insert at bottom&quot; functions.  For your function to receive the prefix, it needs to have &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt;.  A single &lt;code&gt;C-u&lt;/code&gt; prefix will be received as the list &lt;code&gt;(4)&lt;/code&gt;.  Below is the general sort of thing you have to do.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/insert-signature (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (if (equal arg '(4))&#xA;      (progn&#xA;        (insert &quot;\n--\n&quot;)&#xA;        (insert-file-contents mail-signature-file))&#xA;    (message-insert-signature)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="115" LastEditDate="2015-04-06T19:25:10.993" LastActivityDate="2015-04-06T19:25:10.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10480" PostTypeId="1" AcceptedAnswerId="10499" CreationDate="2015-04-02T23:43:04.907" Score="2" ViewCount="6584" Body="&lt;p&gt;I am trying to install package &lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow&quot;&gt;auto-complete&lt;/a&gt;. But when I typed M-x package-install [ret], then emacs showed &quot;contacting host: elpa.gnu.org:80&quot;. After a while, it showed &quot;Install package&quot;. Then I typed &quot;auto-complete&quot;, it prompted &quot;no match&quot;. Do I miss something here? thanks.&lt;/p&gt;&#xA;" OwnerUserId="6937" LastActivityDate="2015-04-06T18:16:47.700" Title="cannot install auto-complete package" Tags="|auto-complete-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10481" PostTypeId="2" ParentId="10464" CreationDate="2015-04-03T00:48:58.183" Score="1" Body="&lt;p&gt;The solution turned out to be surprisingly easy. After &lt;a href=&quot;https://stackoverflow.com/a/3958530/709537&quot;&gt;adding&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-default-font &quot;Inconsolata-12&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the end of my &lt;code&gt;~/.emacs&lt;/code&gt;, it kind of (see below for details) worked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YSrT0.png&quot; alt=&quot;Emacs Inconsolata 12&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The Full story:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After copy-and-pasting the table into LibreOffice I noticed that Inconsolata worked, whereas DejaVu Sans Mono does not - which depends, I suppose, on my xorg font substitution settings. (My LibreOffice font substitution settings are empty.) To wit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/NTeFk.png&quot; alt=&quot;LibreOffice rendering of org-table format&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That lead me to just play around with Inconsolata in emacs a little more, and to the &lt;code&gt;set-default-font&lt;/code&gt; solution mentioned above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not all font sizes work however, and if I increase/decrease the font size, the alignment gets messed up again. Here are the results for the sizes I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;━━━━━━━━━━━&#xA; size  ok? &#xA;───────────&#xA;    6  ok  &#xA;    8      &#xA;   10      &#xA;   12  ok  &#xA;   14      &#xA;   16      &#xA;   18  ok  &#xA;   20      &#xA;   22  ok  &#xA;   24      &#xA;   26      &#xA;━━━━━━━━━━━&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is also one minor issue which I guess must be blamed on org-table, that is when I use the &lt;code&gt;TAB&lt;/code&gt; key to navigate through cells, the formatting sometimes changes for the worse. The following is the result of pressing &lt;code&gt;TAB&lt;/code&gt; in the leftmost cell:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/g0O7L.png&quot; alt=&quot;TAB in org-table&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily though, a quick &lt;code&gt;C-c C-c&lt;/code&gt; will repair the whole table again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; Turns out there are still some characters that do not align properly. Neither in LibreOffice, nor in emacs. Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;character: ○ (displayed as ○) (codepoint 9675, #o22713, #x25cb)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Corresponding screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SUEQD.png&quot; alt=&quot;some characters still don&amp;#39;t align&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3951" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-09-08T22:03:52.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10482" PostTypeId="2" ParentId="10462" CreationDate="2015-04-03T02:59:00.370" Score="1" Body="&lt;p&gt;C-j does seem to work (for me).&#xA;And the README says there's a breaking change from j to C-j&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[EDIT]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One or two more clarifications:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Both j and C-j work (in calendar) -- current version of org-journal&lt;/li&gt;&#xA;&lt;li&gt;The date tracked by calendar is the date (encoded in) the file name not the date inside the file. So if my file contains &quot;* Friday, 04/03/2015&quot;&#xA;but is itself having the name 20150402, then Thursday will be highlighted not Friday. IOW journal is not clever enough to detect/correct date-anomalies&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5223" LastEditorUserId="5223" LastEditDate="2015-04-03T03:49:43.300" LastActivityDate="2015-04-03T03:49:43.300" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10483" PostTypeId="2" ParentId="10199" CreationDate="2015-04-03T03:45:47.043" Score="0" Body="&lt;p&gt;Based on erikstokes suggestion, I've come up with a working solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: I also used code from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsredux.com/blog/2013/04/02/move-current-line-up-or-down/&quot; rel=&quot;nofollow&quot;&gt;http://emacsredux.com/blog/2013/04/02/move-current-line-up-or-down/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun move-line-down ()&#xA;  (interactive)&#xA;  (let ((col (current-column)))&#xA;    (save-excursion&#xA;      (forward-line)&#xA;      (transpose-lines 1))&#xA;    (forward-line)&#xA;    (move-to-column col)))&#xA;&#xA;(defun move-line-up ()&#xA;  (interactive)&#xA;  (let ((col (current-column)))&#xA;    (save-excursion&#xA;      (forward-line)&#xA;      (transpose-lines -1))&#xA;    (move-to-column col)))&#xA;&#xA;;; Indent relative, but works for the line below rather than above &#xA;(defun indent-relative-below ()&#xA;  (interactive)&#xA;  (move-line-down)&#xA;  (indent-relative)&#xA;  (move-line-up))&#xA;(global-set-key  (kbd &quot;C-;&quot;) 'indent-relative-below)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6833" LastEditorUserId="6833" LastEditDate="2015-04-03T04:41:30.330" LastActivityDate="2015-04-03T04:41:30.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10484" PostTypeId="2" ParentId="10480" CreationDate="2015-04-03T04:09:08.997" Score="3" Body="&lt;p&gt;You must add the urls for gnu, melpa, marmalade repositories in .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives &#xA;  '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After doing this, run &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; and &lt;code&gt;M-x auto-complete&lt;/code&gt;. It should work.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="50" LastEditDate="2015-04-06T17:50:36.287" LastActivityDate="2015-04-06T17:50:36.287" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10485" PostTypeId="1" AcceptedAnswerId="10495" CreationDate="2015-04-03T06:10:15.670" Score="4" ViewCount="1115" Body="&lt;p&gt;I read &lt;a href=&quot;https://github.com/lunaryorn/blog/blob/master/posts/byte-compiling-eval-after-load.md&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lunaryorn/blog/blob/master/posts/byte-compiling-eval-after-load.md&lt;/a&gt; which contains this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro stante-after (feature &amp;amp;rest forms)&#xA;  `(,(if (or (not byte-compile-current-file)&#xA;             (if (symbolp feature)&#xA;                 (require feature nil :no-error)&#xA;               (load feature :no-message :no-error)))&#xA;         'progn&#xA;       (message &quot;stante-after: cannot find %s&quot; feature)&#xA;       'with-no-warnings)&#xA;    (eval-after-load ',feature&#xA;      `(funcall (function ,(lambda () ,@forms))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I read &lt;code&gt;(info &quot;(elisp)&quot;)&lt;/code&gt; but can't find a strict statement that the inner macro is expanded before the outer one. I can't find the semantics of nested backquotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that &lt;code&gt;,(lambda () ,@forms)&lt;/code&gt; has a comma before &lt;code&gt;lambda&lt;/code&gt; in order to mark the form as functional and that triggers byte-compilation, but I can't figure out in which order that comma is interpreted by the &lt;code&gt;backquote&lt;/code&gt; macro.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="25" LastEditDate="2015-04-03T21:39:52.113" LastActivityDate="2015-04-03T21:39:52.113" Title="Order of evaluation of nested macros and backquotes" Tags="|elisp|elisp-macros|quote|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10486" PostTypeId="2" ParentId="10478" CreationDate="2015-04-03T07:07:50.097" Score="1" Body="&lt;p&gt;As lawlist commented, at this point the Python-process must be stopped. See also M-x list-processes. A brute-force method would kill the buffer.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-04-03T07:07:50.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10487" PostTypeId="2" ParentId="8218" CreationDate="2015-04-03T08:16:10.303" Score="3" Body="&lt;p&gt;There has been a bug reported and fixed last December.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://thread.gmane.org/gmane.emacs.orgmode/93505/focus=93514&quot; rel=&quot;nofollow&quot;&gt;http://thread.gmane.org/gmane.emacs.orgmode/93505/focus=93514&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6938" LastActivityDate="2015-04-03T08:16:10.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10488" PostTypeId="2" ParentId="7991" CreationDate="2015-04-03T09:34:30.567" Score="2" Body="&lt;p&gt;After googling around and tweaking the code snippets from the internet, I got this solution and it works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar all-gud-modes&#xA;  '(gud-mode comint-mode gdb-locals-mode gdb-frames-mode  gdb-breakpoints-mode)&#xA;  &quot;A list of modes when using gdb&quot;)&#xA;(defun kill-all-gud-buffers ()&#xA;  &quot;Kill all gud buffers including Debugger, Locals, Frames, Breakpoints.&#xA;Do this after `q` in Debugger buffer.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;        (let ((count 0))&#xA;          (dolist (buffer (buffer-list))&#xA;                (set-buffer buffer)&#xA;                (when (member major-mode all-gud-modes)&#xA;                  (setq count (1+ count))&#xA;                  (kill-buffer buffer)&#xA;                  (delete-other-windows))) ;; fix the remaining two windows issue&#xA;          (message &quot;Killed %i buffer(s).&quot; count))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind the &lt;code&gt;kill-all-gud-buffers&lt;/code&gt; to a key or &lt;code&gt;defalias&lt;/code&gt; it to a short name or even change the function name so you can type it easily.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2015-04-03T09:34:30.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10489" PostTypeId="1" AcceptedAnswerId="10514" CreationDate="2015-04-03T13:45:36.907" Score="5" ViewCount="838" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; is there a predicate function for dotted pairs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, is there a function that distinguishes between dotted pairs and 2-element proper lists:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(some-predicate-p '(a . b))             ; =&amp;gt; t&#xA;(some-predicate-p '(a   b))             ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The broader context: I need to access the second element of a pair of values, and would like the function to &quot;do the right thing&quot; when it's fed either a dotted pair or a 2-element proper list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cdr  '(a . b))                           ; =&amp;gt; b&#xA;(cadr '(a   b))                           ; =&amp;gt; b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;cdr&lt;/code&gt; and &lt;code&gt;cadr&lt;/code&gt; cannot be dropped in interchangeably between proper and improper lists:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cadr '(a . b))                           ; =&amp;gt; error&#xA;(cdr  '(a   b))                           ; =&amp;gt; (b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-05-09T20:17:08.367" Title="Predicate function for dotted pairs?" Tags="|elisp|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10490" PostTypeId="2" ParentId="10489" CreationDate="2015-04-03T13:48:35.950" Score="2" Body="&lt;p&gt;There isn't such a function to my knowledge, but you can use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun codr (x)&#xA;  (let ((y (cdr x)))&#xA;    (if (consp y)&#xA;        (car y)&#xA;      y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's better to just know what kind of data you're expecting.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-03T13:48:35.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10491" PostTypeId="2" ParentId="10489" CreationDate="2015-04-03T13:56:37.583" Score="3" Body="&lt;p&gt;Got it: helped along by @abo-abo's answer, the following predicate function detects dotted pairs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotted-p (x)&#xA;  &quot;Returns `t' if X is a dotted-pair.&quot;&#xA;  (not (consp (cdr x))))&#xA;&#xA;(dotted-p '(a . b))                     ; =&amp;gt; t&#xA;(dotted-p '(a   b))                     ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-03T13:56:37.583" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10492" PostTypeId="1" AcceptedAnswerId="10494" CreationDate="2015-04-03T14:18:19.143" Score="22" ViewCount="9433" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I get the element number in a list?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nth&lt;/code&gt; gets element number &lt;em&gt;n&lt;/em&gt; from a list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nth 2 '(a b c d))                      ; =&amp;gt; c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to do the reverse: get the element number given the element:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(some-function 'c '(a b c d))           ; =&amp;gt; 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I may have missed it, but does such a function exist?  How would one do this?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-04-03T14:28:08.527" LastActivityDate="2022-01-28T00:25:15.630" Title="How to get element number in a list?" Tags="|elisp|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10493" PostTypeId="2" ParentId="10492" CreationDate="2015-04-03T14:24:55.610" Score="2" Body="&lt;p&gt;Turns out it's a simple function to write, although it may not be all that efficient:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nth-elt (elt list)&#xA;  &quot;Return element number of ELT in LIST.&quot;&#xA;  (let ((loc (length (member elt list))))&#xA;    (unless (zerop loc)&#xA;      (- (length list) loc))))&#xA;&#xA;(nth-elt 'c '(a b c d))                 ; =&amp;gt; 2&#xA;(nth-elt 'f '(a b c d))                 ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd prefer a built-in solution if one exists, of course.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="1979" LastEditDate="2015-04-03T15:36:03.450" LastActivityDate="2015-04-03T15:36:03.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10494" PostTypeId="2" ParentId="10492" CreationDate="2015-04-03T14:35:23.843" Score="26" Body="&lt;ol&gt;&#xA;&lt;li&gt;Here's a function that is included with Emacs 24.3 and later:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(cl-position 2 '(6 7 8 2 3 4)) ;; =&amp;gt; 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Before Emacs 24.3, use function &lt;code&gt;position&lt;/code&gt; from library &lt;code&gt;cl.el&lt;/code&gt;, which is included with Emacs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the &lt;code&gt;:test&lt;/code&gt; keyword to specify the comparison function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(cl-position &quot;bar&quot; '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;) :test 'equal) ;; =&amp;gt; 1&#xA;(cl-position '(1 2) '((3) (5 6) (1 2) nil) :test 'equal) ;; =&amp;gt; 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/cl.html#Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Common Lisp Emulation Manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;code&gt;dash.el&lt;/code&gt; has a function that can do this: &lt;a href=&quot;https://github.com/magnars/dash.el#-elem-index-elem-list&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;-elem-index&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(-elem-index 2 '(6 7 8 2 3 4)) ;; =&amp;gt; 3&#xA;(-elem-index &quot;bar&quot; '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;)) ;; =&amp;gt; 1&#xA;(-elem-index '(1 2) '((3) (5 6) (1 2) nil)) ;; =&amp;gt; 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not included with Emacs, but a lot of Emacs users already have it installed (it's a dependency of &lt;code&gt;projectile&lt;/code&gt;, &lt;code&gt;flycheck&lt;/code&gt;, and &lt;code&gt;smartparens&lt;/code&gt;, which gives it a ton of coverage).&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="23396" LastEditDate="2019-09-17T16:47:22.087" LastActivityDate="2019-09-17T16:47:22.087" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10495" PostTypeId="2" ParentId="10485" CreationDate="2015-04-03T16:06:02.977" Score="5" Body="&lt;p&gt;Comma and backquote are transformed by the reader into regular function calls with the following sexp as argument.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(read &quot;`(list ,fill-column `(list ,fill-column))&quot;)&#xA;;; =&amp;gt; (\` (list (\, fill-column) (\` (list (\, fill-column)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can look-up the backquote macro's help.  Comma is actually not a macro, but like a marker for backquote, i.e. it's argument gets evaluated.  Also,  backquote does not recurse into another nested backquote.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval (read &quot;`(list ,fill-column `(list ,fill-column))&quot;))&#xA;;; =&amp;gt; (list 70 (\` (list (\, fill-column))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you can view backquote as a regular macro and apply your knowledge about them.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-04-03T17:59:23.050" LastActivityDate="2015-04-03T17:59:23.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10496" PostTypeId="2" ParentId="10492" CreationDate="2015-04-03T17:40:20.880" Score="8" Body="&lt;p&gt;Well, if you want to roll your own instead of using &lt;code&gt;cl-position&lt;/code&gt;, and you don't want to traverse twice (using &lt;code&gt;length&lt;/code&gt;)...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nth-elt (element xs)&#xA;  &quot;Return zero-indexed position of ELEMENT in list XS, or nil if absent.&quot;&#xA;  (let ((idx  0))&#xA;    (catch 'nth-elt&#xA;      (dolist (x  xs)&#xA;        (when (equal element x) (throw 'nth-elt idx))&#xA;        (setq idx  (1+ idx)))&#xA;      nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's good for even old Emacs versions.  However, it has this behavior difference, which you might or might not want: It works also for the cars of a dotted list. That is, it correctly returns the position instead of raising an error, for sexps such as &lt;code&gt;(nth-elt 'c '(a b c . d))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to always raise an error for an improper list, then you will want to check for that case, which requires always traversing to the end of the list:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nth-elt (element xs)&#xA;  &quot;Return zero-indexed position of ELEMENT in list XS, or nil if absent.&quot;&#xA;  (let ((idx  0))&#xA;    (when (atom (cdr (last xs))) (error &quot;Not a proper list&quot;))&#xA;    (catch 'nth-elt&#xA;      (dolist (x  xs)&#xA;        (when (equal element x) (throw 'nth-elt idx))&#xA;        (setq idx  (1+ idx)))&#xA;      nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:17:45.280" LastActivityDate="2015-05-09T20:17:45.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10497" PostTypeId="1" CreationDate="2015-04-03T18:58:44.333" Score="0" ViewCount="390" Body="&lt;p&gt;A strange behaviour happens when I move up or down the point (using the keyboard): Emacs automatically scrolls up or down whenever I pass a certain line threshold. See here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/v8MfN.gif&quot; alt=&quot;Scrolling example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When moving down, at line 20 the scroll locks (until I reach the end of the buffer). When moving up, the threshold is at line 10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to disable this scroll locking. That is, I would wish the point could move to the top or bottom of the screen withoug auto-locking the scroll. Any ideas? (Using GNU Emacs 24.4.4 in Linux and Mac.)&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2015-04-03T19:11:19.223" Title="How to disable scroll lock when moving point" Tags="|scrolling|point|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10498" PostTypeId="2" ParentId="10497" CreationDate="2015-04-03T19:11:19.223" Score="2" Body="&lt;p&gt;This is not how Emacs normally behaves. It looks as though you have configures something like &lt;code&gt;scroll-margin&lt;/code&gt;. From the built-in help:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Number of lines of margin at the top and bottom of a window.&#xA;  Recenter the window whenever point gets within this many lines&#xA;  of the top or bottom of the window.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-04-03T19:11:19.223" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10499" PostTypeId="2" ParentId="10480" CreationDate="2015-04-04T03:21:40.503" Score="5" Body="&lt;p&gt;The following has been tested to work on an &lt;code&gt;emacs -Q&lt;/code&gt; session:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Launch &lt;code&gt;emacs -Q&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Add the below in the scratch buffer:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Evaluate the buffer (&lt;code&gt;M-x eval-buffer&lt;/code&gt;) &lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x package-install RET auto-complete RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The package will install.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that step 4 will NOT work if you already have the package installed in the &lt;code&gt;~/.emacs.d/elpa/&lt;/code&gt; folder. So to test this, either move the &lt;code&gt;elpa/&lt;/code&gt; folder to something like &lt;code&gt;elpa.bkp/&lt;/code&gt; before step 1 or do &lt;code&gt;M-x list-packages&lt;/code&gt; (after step 3), find the &lt;code&gt;auto-complete&lt;/code&gt; package in there, hit &lt;code&gt;d&lt;/code&gt; to mark it for deletion and then &lt;code&gt;x&lt;/code&gt; to execute the deletion. Then step 4 will work once again. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-06T18:16:47.700" LastActivityDate="2015-04-06T18:16:47.700" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="10500" PostTypeId="1" AcceptedAnswerId="10501" CreationDate="2015-04-04T08:01:29.387" Score="38" ViewCount="12292" Body="&lt;p&gt;This has always confused me, since people are saying that MELPA does have newer versions of packages, but it's not really clear, if GNU ELPA is just a subset of MELPA, or if I do need both?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why I'm asking is that I'm experimenting with my packages a lot, and &lt;code&gt;package-list-packages&lt;/code&gt; takes quite a while. I'm aware of &lt;code&gt;package-list-packages-no-fetch&lt;/code&gt;, but more often than not I'd like to get the most recent package list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is, &lt;strong&gt;can I just use MELPA and get the same (and possibly newer versions) packages as if I used both MELPA and GNU ELPA?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="6823" LastEditorUserId="105" LastEditDate="2015-04-04T14:51:57.160" LastActivityDate="2020-12-19T17:48:25.760" Title="Do I still need GNU ELPA if I have MELPA?" Tags="|package|package-repositories|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10501" PostTypeId="2" ParentId="10500" CreationDate="2015-04-04T08:47:13.380" Score="62" Body="&lt;p&gt;First of all, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Package-Archives&quot; rel=&quot;noreferrer&quot;&gt;ELPA&lt;/a&gt; is the name of a &lt;em&gt;specification&lt;/em&gt;, the Emacs Lisp Package Archive.  There are three widely known &lt;em&gt;implementations&lt;/em&gt; of that specification, GNU ELPA, Marmalade and MELPA.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://elpa.gnu.org/&quot; rel=&quot;noreferrer&quot;&gt;GNU ELPA&lt;/a&gt; is the official GNU Emacs archive, enabled out of the box for sufficiently new Emacs installations.  It is comparatively small, contributing to it requires copyright assignment and cooperating with the official mailing list.  It is the closest thing we have to a vetting comparable to a Linux distribution package archive.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://melpa.org/&quot; rel=&quot;noreferrer&quot;&gt;MELPA&lt;/a&gt; is an unofficial archive with the largest amount of packages.  Each package is briefly vetted for code style with its pull request for inclusion, after that packages are automatically built from their (usually VCS) sources.  Rebuilds can happen every hour.  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There is also &lt;a href=&quot;http://stable.melpa.org/&quot; rel=&quot;noreferrer&quot;&gt;MELPA stable&lt;/a&gt; which builds tagged releases only, but has a lot less packages, less even than Marmalade.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://marmalade-repo.org/&quot; rel=&quot;noreferrer&quot;&gt;Marmalade&lt;/a&gt; was another (now dead) unofficial archive with a good amount of versioned packages.  Authors and maintainers need to upload their releases manually to it.  Vetting is done once for every new member before allowing them to have an user account, after that is done, they are free to release as they wish.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As for the overlap, there is practically no overlap between GNU ELPA and Marmalade, and similarly for GNU ELPA and MELPA.  Marmalade and MELPA however overlap a fair amount. I'd estimate that most of Marmalade is a subset of MELPA. That's why you can go with MELPA for most packages and maybe GNU ELPA for a few missing ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: According to &lt;a href=&quot;http://malabarba.github.io/emacs-archive-tracker/&quot; rel=&quot;noreferrer&quot;&gt;malabarba's package stats&lt;/a&gt; MELPA Stable did surpass Marmalade in number of available packages.  I'd pick it over Marmalade now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Marmalade is essentially dead.  The certificate has expired and there's hardly any new packages uploaded.  This is due to its rather unusual process, you need to be manually added to the users by its owner and as he's gone missing, no new users have been added since 2016 or so.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="2059" LastEditDate="2020-04-13T21:37:11.827" LastActivityDate="2020-04-13T21:37:11.827" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="10502" PostTypeId="2" ParentId="10388" CreationDate="2015-04-04T09:13:33.903" Score="1" Body="&lt;p&gt;In case of Git you can call &lt;code&gt;vc-git--rev-parse&lt;/code&gt; on return value of &lt;code&gt;vc-working-revision&lt;/code&gt;. If you pass whatever what may or may not be SHA1, including branch names and &quot;HEAD&quot;. It will also return valid SHA1's intact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately there isn't a guaranteed general solution that you're looking for. Interface we used is specific to Git and general API doesn't provide alternatives. This is knowledge that has to be introduced on per backend basis.&lt;/p&gt;&#xA;" OwnerUserId="279" LastActivityDate="2015-04-04T09:13:33.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10503" PostTypeId="2" ParentId="10462" CreationDate="2015-04-04T09:58:10.680" Score="2" Body="&lt;p&gt;I'm the author of &lt;a href=&quot;https://github.com/bastibe/org-journal&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-journal&lt;/a&gt;. As &lt;a href=&quot;https://emacs.stackexchange.com/questions/10462/viewing-org-journal-entries#comment16084_10482&quot;&gt;Rusi pointed out&lt;/a&gt;, the problem is that Emacs 23 does not support &lt;code&gt;setq-local&lt;/code&gt;. You can backport &lt;code&gt;setq-local&lt;/code&gt; from Emacs 24 to 23, but you'll have to delete or recreate &lt;code&gt;org-journal.elc&lt;/code&gt; for the backport to take effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, I have removed the dependence on &lt;code&gt;setq-local&lt;/code&gt; in the latest version of org-journal. Org-journal is now compatible with Emacs 23.1.1.&lt;/p&gt;&#xA;" OwnerUserId="80" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-04-04T09:58:10.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10504" PostTypeId="1" AcceptedAnswerId="10506" CreationDate="2015-04-04T12:08:10.113" Score="35" ViewCount="12039" Body="&lt;p&gt;I've read the various manual pages about DEADLINE and SCHEDULED, and have used them both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that DEADLINE is used in the Agenda to alert in advance about an upcoming deadline, and to continue to alert after the deadline if the item is not marked DONE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am not sure that I completely understand how to use SCHEDULED. My understanding is that if I have a task, which is larger than just a once-off action, I can use SCHEDULED so that the item keeps appearing daily on my Agenda, until I mark it as DONE. Therefore, each day on my Agenda, I will see the same SCHEDULED task, reminding me to continue working on it. Is this correct? I know SCHEDULED is not intended to simply &quot;schedule&quot; a meeting.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="5345" LastEditDate="2017-10-08T13:23:04.807" LastActivityDate="2017-10-08T13:23:04.807" Title="Understanding SCHEDULED in Org mode" Tags="|org-mode|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10505" PostTypeId="2" ParentId="10504" CreationDate="2015-04-04T12:14:27.920" Score="14" Body="&lt;p&gt;&lt;strong&gt;Scheduled&lt;/strong&gt; time is when you want to start working on the task. So a task scheduled to start on a particular day will not show up in agenda before that day. It's a way to show only relevant to do items in the agenda. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example would be that you would want to schedule your car inspection only 2-3 months before the inspection is due. There is no point cluttering the agenda with that task a year in advance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Deadline&lt;/strong&gt; is obviously the date by which you need the task to be done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put it an other way, you would want to or have to or would have time to work on a particular task only between the Scheduled and Deadline time, not before that. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-04-04T12:14:27.920" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10506" PostTypeId="2" ParentId="10504" CreationDate="2015-04-04T14:15:22.367" Score="57" Body="&lt;p&gt;Building on @kaushalmodi's answer a bit futher, there are three ways to attach a date to an Org entry:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A plain timestamp, &lt;code&gt;C-c .&lt;/code&gt;: This is used for things like appointments where the entry occurs at a specific date/time. Such an entry will show up in the agenda on the specified day, and will not show up after that day has passed. Note that an appointment in the past won't keep showing up on your agenda regardless of whether you mark it DONE: if you didn't go to your doctor's appointment yesterday, that doesn't mean you still have one today! &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A SCHEDULED timestamp, &lt;code&gt;C-c C-s&lt;/code&gt;: This is used to indicate when you intend to do the task. It will show up on the agenda on the scheduled day. If you don't complete the task at that time, it will continue to show up on the agenda on the following days to show you that you have not completed something that you planned to do.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A DEADLINE timestamp, &lt;code&gt;C-c C-d&lt;/code&gt;: This is used to indicate when something must be completed. Typically you want to see deadlines ahead of time, so that you can do whatever it is that must be done to meet them. Like a scheduled entry, if you miss a deadline it will continue to appear on the agenda as past due.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Strictly speaking there is a fourth option: an inactive timestamp, &lt;code&gt;C-c !&lt;/code&gt;. This is when you want to attach a date to an entry but do not want it to show up in the agenda at all. Inactive timestamps have no special behavior.) &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-04-04T15:16:05.353" LastActivityDate="2015-04-04T15:16:05.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10507" PostTypeId="1" AcceptedAnswerId="10508" CreationDate="2015-04-04T14:47:48.487" Score="9" ViewCount="2765" Body="&lt;p&gt;In org-mode, I would like to add a timestamp to a TODO marking the date completed. What is the best way to do this?&lt;/p&gt;&#xA;" OwnerUserId="6948" LastActivityDate="2016-06-28T23:15:54.080" Title="Adding &quot;date completed&quot; timestamp in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10508" PostTypeId="2" ParentId="10507" CreationDate="2015-04-04T15:22:40.367" Score="13" Body="&lt;p&gt;You can set &lt;code&gt;org-log-done&lt;/code&gt; to put the completion time in the &lt;code&gt;CLOSED&lt;/code&gt; property.  The possible values are (as strings):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;nil     Don't add anything, just change the keyword&lt;/p&gt;&#xA;&lt;p&gt;time    Add a time stamp to the task&lt;/p&gt;&#xA;&lt;p&gt;note    Prompt for a note and add it with template `org-log-note-headings'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It is also possible to log any state change by adding &amp;quot;!&amp;quot; or &amp;quot;@&amp;quot; to the keyword definition.  For example,&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;TODO(t)&amp;quot; &amp;quot;NEXT(n)&amp;quot; &amp;quot;STARTED(s!)&amp;quot; &amp;quot;|&amp;quot; &amp;quot;DONE(d!/!)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;will add a log entry whenever you change the state to &lt;code&gt;STARTED&lt;/code&gt; or &lt;code&gt;DONE&lt;/code&gt;, but not &lt;code&gt;TODO&lt;/code&gt; or &lt;code&gt;NEXT&lt;/code&gt;.  Using &amp;quot;@&amp;quot; instead of &amp;quot;!&amp;quot; will prompt for note when entering that state.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-06-28T23:15:54.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10509" PostTypeId="2" ParentId="10453" CreationDate="2015-04-04T20:39:40.197" Score="1" Body="&lt;p&gt;Okay, I figured it out. My fault entirely. I had been changing the name of the theme, and forgot to change some of the name definitions (e.g. &lt;code&gt;deftheme emerald&lt;/code&gt;) in the theme file. Now it works fine. Thanks for your help, anyways!&lt;/p&gt;&#xA;" OwnerUserId="6927" LastActivityDate="2015-04-04T20:39:40.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10510" PostTypeId="1" AcceptedAnswerId="10513" CreationDate="2015-04-04T20:54:33.387" Score="1" ViewCount="520" Body="&lt;p&gt;I use several minor modes, which are enabled globally by default:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;whitespace-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;linum-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;fci-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm finding them very helpful when editing code sources and text files, however I does not want to activate them with some major modes, e.g. &lt;code&gt;dired-mode&lt;/code&gt;, &lt;code&gt;eshell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to solve this as following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'prog-mode-hook '(linum-mode 1))&#xA;&#xA;(require 'whitespace)&#xA;(add-hook 'prog-mode-hook '(whitespace-mode 1))&#xA;&#xA;(require 'fill-column-indicator)&#xA;(add-hook 'prog-mode-hook '(fci-mode 1))&#xA;(add-hook 'text-mode-hook '(fci-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this solution does not works well:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;ul&gt;&#xA;&lt;li&gt;reverting buffer toggles off &lt;code&gt;linum-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;whitespace-mode&lt;/code&gt; not activating&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;fci-mode&lt;/code&gt; not activating, producing error message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;File mode specification error: (invalid-function (fci-mode 1)) [2 times]&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  What is the correct way to make smart toggle mentioned modes only with source code buffers and text buffers?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P.S. A note about &lt;code&gt;fci-mode&lt;/code&gt;: error message looks odd to me, because I can either use &lt;code&gt;M-x fci-mode&lt;/code&gt; to toggle it, or evaluate &lt;code&gt;(fci-mode 1)&lt;/code&gt; or &lt;code&gt;(fci-mode -1)&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6844" LastEditorUserId="50" LastEditDate="2015-04-04T23:10:03.707" LastActivityDate="2015-04-04T23:10:03.707" Title="Smart minor mode toggle depending on major mode" Tags="|init-file|hooks|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10511" PostTypeId="2" ParentId="10458" CreationDate="2015-04-04T21:11:42.830" Score="3" Body="&lt;p&gt;You can find the documentation for &lt;code&gt;org-reftex-citation&lt;/code&gt; by doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h f&lt;/kbd&gt; &lt;code&gt;org-reftex-citation&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, you can use &lt;kbd&gt;C-h f&lt;/kbd&gt; (&lt;code&gt;describe-function&lt;/code&gt;) to look up documentation for any &lt;a href=&quot;https://emacs.stackexchange.com/a/3556/504&quot;&gt;command or function&lt;/a&gt; that is available in your Emacs installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the difference between &lt;code&gt;reftex-citation&lt;/code&gt; and &lt;code&gt;org-reftex-citation&lt;/code&gt;: The former allows you to quickly insert citations into LaTeX documents, while the latter enables you to do the same for &lt;code&gt;org-mode&lt;/code&gt; files. They are related in the sense that after identifying the correct &lt;code&gt;.bib&lt;/code&gt; file to use for the current file, &lt;code&gt;org-reftex-citation&lt;/code&gt; calls &lt;code&gt;reftex-citation&lt;/code&gt; to insert a citation at point.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Bonus: More on getting help from Emacs itself&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In addition to &lt;code&gt;describe-function&lt;/code&gt; there are a number of commands that you can use to ask Emacs about itself. Some of the most useful ones are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;describe-variable&lt;/code&gt; (&lt;kbd&gt;C-h v&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;describe-key&lt;/code&gt; (&lt;kbd&gt;C-h k&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;describe-key-briefly&lt;/code&gt; (&lt;kbd&gt;C-h c&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;describe-mode&lt;/code&gt; (&lt;kbd&gt;C-h m&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;describe-package&lt;/code&gt; (&lt;kbd&gt;C-h P&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-04-04T21:11:42.830" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10512" PostTypeId="2" ParentId="10510" CreationDate="2015-04-04T21:45:25.687" Score="6" Body="&lt;p&gt;A hook expects its entries to be &lt;strong&gt;&lt;em&gt;functions&lt;/em&gt;&lt;/strong&gt;.  &lt;code&gt;(fci-mode 1)&lt;/code&gt; is not a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want to use as a function is presumably &lt;code&gt;turn-on-fci-mode&lt;/code&gt;, if that function exists, or &lt;code&gt;(lambda () (fci-mode 1))&lt;/code&gt;, if not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Minor-Modes.html&quot;&gt;&lt;code&gt;Defining Minor Modes&lt;/code&gt;&lt;/a&gt;, particularly macro &lt;code&gt;define-globalized-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You give no references for the global-mode functions you cite, so I don't know how they were defined.  But if they were defined using &lt;code&gt;define-globalized-minor-mode&lt;/code&gt; then there is likely a &lt;code&gt;TURN-ON&lt;/code&gt; function that you can use on a hook.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-04T21:45:25.687" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10513" PostTypeId="2" ParentId="10510" CreationDate="2015-04-04T21:45:58.620" Score="1" Body="&lt;p&gt;In Emacs 23 &lt;code&gt;(some-mode 1)&lt;/code&gt; was the typical way to turn on minor modes (but see this &lt;a href=&quot;https://emacs.stackexchange.com/a/10512/2274&quot;&gt;answer&lt;/a&gt; for the proper way to add them to the hooks).  But Emacs 24 changed the rules for turning on minor modes.  The argument to mode functions is no longer needed to turn the mode on anymore: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Toggle display of line numbers in the left margin (Linum mode).&#xA;  With a prefix argument ARG, enable Linum mode if ARG is positive,&#xA;  and disable it otherwise.  If called from Lisp, enable the mode&#xA;  if ARG is omitted or nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So to simply turn on a minor mode, what you want is just &lt;code&gt;#'linum-mode&lt;/code&gt; in your hooks.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-04-04T22:22:38.617" LastActivityDate="2015-04-04T22:22:38.617" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10514" PostTypeId="2" ParentId="10489" CreationDate="2015-04-04T22:22:12.837" Score="5" Body="&lt;p&gt;Here is a simple test for a dotted pair (your question):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(and (cdr x) (atom (cdr x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here is a test for a dotted list (of any length):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((last  (last x))) (and (cdr last) (atom (cdr last))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:17:08.367" LastActivityDate="2015-05-09T20:17:08.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10515" PostTypeId="1" AcceptedAnswerId="10517" CreationDate="2015-04-04T22:49:01.690" Score="1" ViewCount="553" Body="&lt;p&gt;I would like to have my dollar sign yellow coloured. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after searching around, I learnt that the Emacs regex's are different from default regexs. After a while, I got this worked: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(defface font-lock-sigil-face&#xA;  '((t (:foreground &quot;#BD9800&quot;)))&#xA;  &quot;Face to display sigils in.&quot;)&#xA;(font-lock-add-keywords 'php-mode&#xA;  '((&quot;\\(\\$\\)[_a-zA-Z]&quot; 1 'font-lock-sigil-face)))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the dollar sign for $variable, gets a yellow color. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like to make the numbers red. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;var $variable = 0123;&lt;/code&gt; (this gets red).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But not the strings would be red.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;var $variable = &quot;0123&quot;;&lt;/code&gt; (So the regex will not makes this red). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried many ways, but I don't understand the backslashes in '((&quot;\(\$\)[_a-zA-Z] clearly enough. &#xA;I would really appreciate it if anyone could explain this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="50" LastEditDate="2015-04-04T23:07:24.283" LastActivityDate="2015-04-05T15:07:48.583" Title="Regexp to font-lock numbers but not strings?" Tags="|regular-expressions|font-lock|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10516" PostTypeId="1" CreationDate="2015-04-04T23:13:37.433" Score="13" ViewCount="3089" Body="&lt;p&gt;For a long time I've been using DejaVu Sans Mono as my programming font.  I've yet to find a better font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But a little while ago I discovered &lt;a href=&quot;https://mozilla.github.io/Fira/&quot; rel=&quot;noreferrer&quot;&gt;Mozilla's Fira&lt;/a&gt;, which &lt;a href=&quot;http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt&quot; rel=&quot;noreferrer&quot;&gt;looks very nice for code&lt;/a&gt;.  So I decided to give it a try in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, when I use it in Emacs, the line spacing blows up and reduces the number of lines I can see by about 10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;code&gt;(setq line-spacing 0)&lt;/code&gt; and different combinations of things like &lt;code&gt;(set-frame-font (font-spec :name &quot;Fira Mono&quot; :width 'normal :height 100))&lt;/code&gt;, but no matter what I do, the excessive line spacing remains.  (It's not possible to use negative &lt;code&gt;line-spacing&lt;/code&gt; values in Emacs, unfortunately, which would seem like the obvious solution.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't seem to be a bug in the font though, because when I use Fira Mono in Kate at the same size, the line spacing is what I would consider normal, and apparently about the same as the Emacs line spacing with DejaVu Sans.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug in Emacs?  Is there any way to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any advice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Left:&lt;/strong&gt; Emacs Fira Mono  &lt;strong&gt;Right:&lt;/strong&gt; Emacs DejaVu Sans Mono&#xA;&lt;a href=&quot;https://i.stack.imgur.com/o4Lcu.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o4Lcu.png&quot; alt=&quot;Emacs Fira Mono vs. Emacs DejaVu Sans Mono&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Left:&lt;/strong&gt; Emacs Fira Mono  &lt;strong&gt;Right:&lt;/strong&gt; Kate Fira Mono&#xA;&lt;a href=&quot;https://i.stack.imgur.com/bvNWL.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bvNWL.png&quot; alt=&quot;Emacs Fira Mono vs. Kate Fira Mono&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2015-09-01T18:02:58.127" Title="Excessive line spacing with certain fonts" Tags="|fonts|line-spacing|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="10517" PostTypeId="2" ParentId="10515" CreationDate="2015-04-04T23:21:30.410" Score="1" Body="&lt;p&gt;&lt;code&gt;&quot;\\(\\$\\)[_a-zA-Z]&quot;&lt;/code&gt; &amp;lt;-- anything that begins by a dollar sign and followed by and underscore character or a (from a to z: lowercase letter or uppercase letter) or underscore and lowercaser/uppercase in any order.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I tried many ways, but I don't understand the backslashes in&#xA;  '((&quot;(\$)[_a-zA-Z] clearly enough&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\\&lt;/code&gt; &amp;lt;-- do not interpret the next following character. (be careful, it's exactly 2 backslashes, not one)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;()&lt;/code&gt; &amp;lt;-- memorize the matched group&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 &amp;lt;-- apply the font lock to the first matched group, in our case the dollar sign.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To finish, you should use an emacs hook to tell emacs when to apply your font rules, the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Font-Lock.html&quot; rel=&quot;nofollow&quot;&gt;doc&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, in your case, you probably want a regex to catch a dollar sign followed by a word, a space, an equal sign, and a digit, something close to this (just an example):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'php-mode-hook&#xA;          (lambda ()&#xA;            (font-lock-add-keywords nil&#xA;                                    '((&quot;\\(\\$\\)[[:word:]]+ = \\([[:digit:]]+\\)&quot;&#xA;                                       (1 font-lock-type-face t)&#xA;                                       (2 font-lock-warning-face t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope I did not miss something, and I hope it will help. &lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-04-05T10:16:00.530" LastActivityDate="2015-04-05T10:16:00.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10518" PostTypeId="1" AcceptedAnswerId="10586" CreationDate="2015-04-05T00:29:19.980" Score="4" ViewCount="436" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how does one approximate the functionality of the non-existent &lt;code&gt;pre-self-insert-hook&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is inspired by the curiosity that is the combination of &lt;code&gt;abbrev-mode&lt;/code&gt; and &lt;code&gt;self-insert-command&lt;/code&gt;.  The docstring for the latter:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Insert the character you type.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Whichever character you type to run this command is inserted.&#xA;  Before insertion, &lt;code&gt;expand-abbrev&lt;/code&gt; is executed if the inserted character does&#xA;  not have word syntax and the previous character in the buffer does.&#xA;  After insertion, the value of &lt;code&gt;auto-fill-function&lt;/code&gt; is called if the&#xA;  &lt;code&gt;auto-fill-chars&lt;/code&gt; table has a non-nil value for the inserted character.&#xA;  At the end, it runs &lt;code&gt;post-self-insert-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It looks to be the case that the call to &lt;code&gt;expand-abbrev&lt;/code&gt; is baked directly into &lt;code&gt;self-insert-command&lt;/code&gt; -- I assume for efficiency reasons, because it is ancient, or both (feel free to comment if you happen to know why).  Ordinarily, I would have expected such a function to run via a hook.  However, although there is a &lt;code&gt;post-self-insert-hook&lt;/code&gt;, there is no &lt;code&gt;pre-self-insert-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In the absence of such a hook, how does one approximate that functionality, and, more importantly, do so with a minimum of fuss?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;None of the options I can think of are ideal:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;advice: &lt;code&gt;self-insert-command&lt;/code&gt; is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Named-Functions.html&quot; rel=&quot;nofollow&quot;&gt;a primitive defined in C and therefore ignores advice&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;pre-command-hook: simple, but it's overkill because it runs before &lt;em&gt;every&lt;/em&gt; command, and not just &lt;code&gt;self-insert-command&lt;/code&gt;, and one may only want to run the command as part of &lt;code&gt;self-insert-command&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;define a wrapper around &lt;code&gt;self-insert-command&lt;/code&gt;: this appears to be what &lt;code&gt;org-mode&lt;/code&gt; and &lt;code&gt;smartparens&lt;/code&gt; do (with &lt;code&gt;org-self-insert-command&lt;/code&gt; and &lt;code&gt;sp--self-insert-command&lt;/code&gt;), but seems complicated by the fact that a) you'd need to rebind an awful lot of keys to use it, b) if one uses multiple major or minor modes that use their own wrapper functions, one needs to keep track of fallback functions so that one does not lose the functionality of other wrappers when rebinding keys (at least I think so; I'm not so sure I understand this part).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-09T13:26:02.770" Title="How to approximate pre-self-insert-hook (which doesn't exist)?" Tags="|elisp|hooks|self-insert-command|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10520" PostTypeId="2" ParentId="10431" CreationDate="2015-04-05T11:16:45.537" Score="41" Body="&lt;p&gt;I have the following snippet in my configuration and it seems like it's exactly what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Add yasnippet support for all company backends&#xA;;; https://github.com/syl20bnr/spacemacs/pull/179&#xA;(defvar company-mode/enable-yas t&#xA;  &quot;Enable yasnippet for all backends.&quot;)&#xA;&#xA;(defun company-mode/backend-with-yas (backend)&#xA;  (if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend)))&#xA;      backend&#xA;    (append (if (consp backend) backend (list backend))&#xA;            '(:with company-yasnippet))))&#xA;&#xA;(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically it sets up the yasnippet backend with every other backend you have activated, so you get the proper completion for the corresponding backend as well as your snippets.&lt;/p&gt;&#xA;" OwnerUserId="492" LastActivityDate="2015-04-05T11:16:45.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10521" PostTypeId="1" AcceptedAnswerId="10674" CreationDate="2015-04-05T11:40:11.977" Score="1" ViewCount="1763" Body="&lt;p&gt;I have emmet-mode installed and smart-tab installed and I want to rebind the  default  C-j of  emmet to smart-tabs TAB.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'emmet-mode)&#xA;(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes&#xA;(add-hook 'css-mode-hook  'emmet-mode) ;; enable Emmet's css abbreviation.&#xA;(setq emmet-move-cursor-between-quotes t) ;; default nil&#xA;&#xA;(require 'smart-tab)&#xA;(global-smart-tab-mode 1)&#xA;(define-key emmet-expand-line [(tab)] 'smart-tab)&#xA;&#xA;;;; http://www.emacswiki.org/emacs/TabCompletion&#xA;(defun hippie-unexpand ()&#xA;  (interactive)&#xA;  (hippie-expand 0))&#xA;&#xA;(define-key read-expression-map [(shift tab)] 'hippie-unexpand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `c:/Users/Sayth/AppData/Roaming/.emacs.d/init.el':&#xA;&#xA;Symbol's value as variable is void: emmet-expand-line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am copying the format from here &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Remapping-Commands&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Remapping-Commands&lt;/a&gt; but I appear to be getting it wrong.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-mode-map [remap kill-line] 'my-kill-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this action is what is advised by the  package  author &lt;a href=&quot;https://github.com/smihica/emmet-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/smihica/emmet-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;press C-j to expand it (or alternatively, alias your preferred&#xA;  keystroke to M-x emmet-expand-line)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6952" LastEditorUserId="253" LastEditDate="2015-04-05T15:17:28.863" LastActivityDate="2015-04-14T00:10:16.693" Title="Rebind emmet-mode to smart-tab" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10522" PostTypeId="2" ParentId="10515" CreationDate="2015-04-05T15:07:48.583" Score="2" Body="&lt;p&gt;How about &lt;a href=&quot;https://github.com/Fanael/highlight-numbers&quot; rel=&quot;nofollow&quot;&gt;highlight-numbers-mode&lt;/a&gt; for the number highlighting portion of your question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://github.com/Fanael/highlight-numbers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6955" LastActivityDate="2015-04-05T15:07:48.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10523" PostTypeId="1" AcceptedAnswerId="10531" CreationDate="2015-04-05T15:39:34.860" Score="5" ViewCount="898" Body="&lt;p&gt;yasnippet does not complete snippets that I add to &lt;code&gt;yas/root-directory&lt;/code&gt; (typing the key and hitting tab does not complete).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remove &lt;code&gt;.yas-compiled-snippets.el&lt;/code&gt; from an affected directory, then run &lt;code&gt;yas/recompile-all&lt;/code&gt; then &lt;code&gt;yas/reload-all&lt;/code&gt;, I can temporarily use the snippets in that directory.  This works for one emacs session, but when I start emacs again, yasnippet again does not recognize the extra snippets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make the configuration &quot;stick&quot; across runs of emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My yasnippet configuration is like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'yasnippet)&#xA;(yas/initialize)&#xA;(add-hook 'python-mode-hook '(lambda ()&#xA;                               (yas-minor-mode)))&#xA;(add-to-list 'yas/root-directory &quot;/path/to/elisp/yasnippet-snippets/&quot;)&#xA;(add-to-list 'yas/root-directory &quot;/path/to/elisp/yasnippet-extra-snippets/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-11-18T03:24:32.923" Title="yasnippet configuration does not persist across emacs runs" Tags="|completion|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10524" PostTypeId="1" AcceptedAnswerId="10526" CreationDate="2015-04-05T15:52:18.867" Score="7" ViewCount="2600" Body="&lt;p&gt;If I create the following in an &lt;code&gt;org-mode&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* one&#xA;** two&#xA;** three&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then move point to the line containing &quot;two&quot; and do &lt;code&gt;C-c C-c spam &amp;lt;RET&amp;gt;&lt;/code&gt;, I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* one&#xA;** two                                                                :spam:&#xA;** three&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why all that whitespace between &quot;two&quot; and &quot;:spam:&quot;?  Can I stop org-mode from inserting it somehow?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2017-11-19T12:11:37.307" Title="Too much whitespace on setting org-mode tags" Tags="|org-mode|whitespace|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10525" PostTypeId="1" AcceptedAnswerId="10529" CreationDate="2015-04-05T16:07:35.517" Score="2" ViewCount="705" Body="&lt;p&gt;With point over the link here, &lt;code&gt;org-open-at-point&lt;/code&gt; jumps to the following line (&quot;ham eggs&quot;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* spam&#xA;** spam [[ham%20eggs][ham eggs]]&#xA;** ham eggs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here however (final line extended), the same action makes emacs prompt &lt;code&gt;No match - create this as a new heading? (y or n)&lt;/code&gt; in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* spam&#xA;** spam [[ham%20eggs][ham eggs]]&#xA;** ham eggs spam&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to define links that do a substring search, so that the search would succeed in this case?  It certainly is possible when linking to non-org mode files, and I would like to do the same for internal links.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-04-05T17:12:11.937" Title="How to find heading substrings with org-mode internal links" Tags="|org-mode|search|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10526" PostTypeId="2" ParentId="10524" CreationDate="2015-04-05T16:47:42.460" Score="11" Body="&lt;p&gt;The variable &lt;code&gt;org-tags-column&lt;/code&gt; controls the distance of tags at the end of the heading. To have just one space, the original poster may wish to consider using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-tags-column 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To apply the changes on an existing org file, use &lt;a href=&quot;https://superuser.com/a/772684/486288&quot;&gt;&lt;code&gt;C-u C-c C-q&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc-string for &lt;code&gt;org-tags-column&lt;/code&gt;, which can be seen by typing &lt;code&gt;M-x describe-variable RET org-tags-column RET&lt;/code&gt; states as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;em&gt;The column to which tags should be indented in a headline. If this number is positive, it specifies the column. If it is negative, it means that the tags should be flushright to that column. For example, -80 works well for a normal 80 character screen. When 0, place tags directly after headline text, with only one space in between.&lt;/em&gt;&quot; &lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="16579" LastEditDate="2017-11-19T12:11:37.307" LastActivityDate="2017-11-19T12:11:37.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10527" PostTypeId="1" AcceptedAnswerId="10534" CreationDate="2015-04-05T17:07:23.090" Score="4" ViewCount="594" Body="&lt;p&gt;Here's my intended use case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs Instance 1: I have an emacs instance containing open buffers of the project I'm working on.  All directly related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs Instance 2: I'm in the Windows explorer, and I'm looking at a bunch of local files (for reference) that are not directly related to my project.  I'd like to double click on these files and have all of the files open on Emacs Instance 2.  This way, these reference files don't clutter up my other instance, and all referenced files are grouped together in a single frame (think Notepad++, when you double click a file, it uses the same instance and creates a tab for all open files).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The flow would be something along the lines of&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Emacs is already open with a buffer list of just buffers related to project (&quot;Emacs Instance 1&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Open up a file manager (repository, Windows Explorer, or Mac OS X Finder), browse to a file, and double click&lt;/li&gt;&#xA;&lt;li&gt;Check for instance of &quot;Emacs Instance 2&quot;.  If not available, then create a new instance and open the file there.  If it is, then open the buffer on this existing instance.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is the above behavior possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I call out a separate instance of Emacs because as far as I can tell, that's the only way to keep the buffer list filtered.  If there's a way to use the same instance, but keep the buffer list filtered to that specific frame, that works just as well for me!&lt;/p&gt;&#xA;" OwnerUserId="2265" LastEditorUserId="2265" LastEditDate="2015-04-05T20:14:01.207" LastActivityDate="2015-04-05T22:06:54.513" Title="From File Manager, open file in specific instance of Emacs" Tags="|frames|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10528" PostTypeId="1" CreationDate="2015-04-05T17:09:55.447" Score="4" ViewCount="184" Body="&lt;p&gt;When I try to execute the following, font-lock fails abruptly after it matches the first group.  A little bit of debugging with the neat tool &lt;code&gt;font-lock-studio&lt;/code&gt; and I realized that &lt;code&gt;font-lock&lt;/code&gt; is upset that it can't find group &lt;code&gt;2&lt;/code&gt;.  How can I tell it not to freak out?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-derived-mode expl3-mode prog-mode&#xA;  &quot;expl3&quot;&#xA;  &quot;Mode for editing expl3 source code.&quot;&#xA;&#xA;  (setq font-lock-set-defaults nil)&#xA;  (font-lock-set-defaults)&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   `((,(rx (* whitespace)&#xA;           (group (+ (any alnum &quot;-&quot;)))&#xA;           (* whitespace)&#xA;           (optional &quot;/&quot; (* whitespace)&#xA;                     (group (+ (any alnum &quot;_&quot;))))      ; note&#xA;           (+ whitespace)&#xA;           (group &quot;.&quot; (+ (any alpha)) (optional &quot;_&quot;))&#xA;           (group (optional (any alpha) (+ (any alpha &quot;_&quot;))))&#xA;           (group &quot;:&quot; (* (any &quot;nNpTFwcVvxofD&quot;))))&#xA;      (1 font-lock-variable-name-face t)&#xA;      (2 font-lock-variable-name-face t)               ; the optional group&#xA;      (3 font-lock-type-face t)&#xA;      (4 font-lock-function-name-face t)&#xA;      (5 font-lock-keyword-face t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Test string&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test-key .tl_set:N ...&#xA;with / grouping .code:n ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-04-05T18:40:37.490" LastActivityDate="2015-07-04T19:35:05.303" Title="Can I apply a face to an optional group?" Tags="|regular-expressions|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10529" PostTypeId="2" ParentId="10525" CreationDate="2015-04-05T17:12:11.937" Score="3" Body="&lt;p&gt;You can set &lt;code&gt;org-link-search-must-match-exact-headline&lt;/code&gt; to nil.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-link-search-must-match-exact-headline nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now this will search the buffer for 'ham eggs' (which does not need to&#xA;be in a heading.).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* spam [[ham eggs]]&#xA;* ham eggs spam&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To restrict it to a heading (and an exact match), lead with a '*'.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* spam [[*ham eggs]]&#xA;* ham eggs spam&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;(info &quot;(org)External links&quot;)&lt;/code&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-04-05T17:12:11.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10530" PostTypeId="2" ParentId="10528" CreationDate="2015-04-05T17:22:18.070" Score="2" Body="&lt;p&gt;Looks like you can use the &lt;code&gt;LAXMATCH&lt;/code&gt; flag for the second group:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(2 font-lock-variable-name-face t t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-04-05T18:40:20.947" LastActivityDate="2015-04-05T18:40:20.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10531" PostTypeId="2" ParentId="10523" CreationDate="2015-04-05T19:28:33.513" Score="6" Body="&lt;p&gt;&lt;code&gt;yas-reload-all&lt;/code&gt; is the correct way to tell yasnippet about updates to &lt;code&gt;yas-snippet-dirs&lt;/code&gt; (aka &lt;code&gt;yas/root-directory&lt;/code&gt;), recompilation is not needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;yas/initialize&lt;/code&gt; is basically an obsolete way of saying &lt;code&gt;(yas-global-mode +1)&lt;/code&gt;, hence your &lt;code&gt;python-mode-hook&lt;/code&gt; is redundant. &lt;code&gt;yas-global-mode&lt;/code&gt; also calls &lt;code&gt;yas-reload-all&lt;/code&gt; when it's turned on, so if you just set &lt;code&gt;yas-snippet-dirs&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; calling it, your snippets will already be picked up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'yasnippet)&#xA;(add-to-list 'yas-snippet-dirs &quot;/path/to/elisp/yasnippet-snippets/&quot;)&#xA;(add-to-list 'yas-snippet-dirs &quot;/path/to/elisp/yasnippet-extra-snippets/&quot;)&#xA;(yas-global-mode +1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, enabling yasnippet only in &lt;code&gt;python-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'yasnippet)&#xA;(add-to-list 'yas-snippet-dirs &quot;/path/to/elisp/yasnippet-snippets/&quot;)&#xA;(add-to-list 'yas-snippet-dirs &quot;/path/to/elisp/yasnippet-extra-snippets/&quot;)&#xA;(yas-reload-all)&#xA;(add-hook 'python-mode-hook #'yas-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-11-18T03:24:32.923" LastActivityDate="2015-11-18T03:24:32.923" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10532" PostTypeId="1" AcceptedAnswerId="10533" CreationDate="2015-04-05T19:49:22.023" Score="0" ViewCount="208" Body="&lt;p&gt;I'm writing an extension to a major mode (&lt;code&gt;coq-mode&lt;/code&gt;) that adds extra features, plus a few keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To makes it easy to disable or redefine these keybindings, I packaged them in a keymap. That keymap is tied to a &lt;code&gt;myplugin-keybindings-minor-mode&lt;/code&gt; minor mode, which gets enabled in &lt;code&gt;coq-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of these keybindings do not make sense outside of &lt;code&gt;coq-mode&lt;/code&gt;. Yet when I open new buffers from a &lt;code&gt;coq-mode&lt;/code&gt; buffer, &lt;code&gt;myplugin-keybindings-minor-mode&lt;/code&gt; is enabled in the newly opened buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I prevent this from happening? &lt;strong&gt;How do I tie my minor mode to &lt;code&gt;coq-mode&lt;/code&gt;, so that &lt;code&gt;myplugin-keybindings-minor-mode&lt;/code&gt; is never active when &lt;code&gt;coq-mode&lt;/code&gt; isn't?&lt;/strong&gt; Altenatively, which other approach should I use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minor mode is enabled by using &lt;code&gt;(add-hook 'coq-mode-hook #'myplugin-initialize)&lt;/code&gt;, and &lt;code&gt;myplugin-initialize&lt;/code&gt; calls &lt;code&gt;(myplugin-keybindings-mode 1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT2: You can see the problem I'm talking about by opening a &lt;code&gt;diff-mode&lt;/code&gt; buffer (&lt;code&gt;C-x f test.diff&lt;/code&gt;), and then running &lt;code&gt;M-x shell&lt;/code&gt; from it. The shell buffer had the &lt;code&gt;Diff-Auto-Refine&lt;/code&gt; mode on, inherited from the diff buffer. This isn't a problem for &lt;code&gt;Diff-Auto-Refine&lt;/code&gt;, but it is for &lt;code&gt;myplugin-keybindings&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2015-04-05T20:02:17.270" LastActivityDate="2015-04-05T20:14:16.340" Title="Tie a minor-mode to a particular major mode" Tags="|keymap|hooks|major-mode|minor-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10533" PostTypeId="2" ParentId="10532" CreationDate="2015-04-05T20:14:16.340" Score="2" Body="&lt;p&gt;How about something like this?:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode myplugin-keybindings-mode&#xA;&quot;A minor-mode for . . . . .&quot;&#xA;  :init-value nil&#xA;  :lighter &quot; myplugin&quot;&#xA;  :keymap nil&#xA;  :global nil&#xA;  :group 'coq-mode&#xA;  (cond&#xA;    ((and&#xA;        myplugin-keybindings-mode&#xA;        (eq major-mode 'coq-mode))&#xA;      (my-main-function)&#xA;      ;; *** insert additional stuff&#xA;      (when (called-interactively-p 'any)&#xA;        (message &quot;Turned ON `myplugin-keybindings-mode`.&quot;)))&#xA;    (t&#xA;      ;; *** insert additional stuff&#xA;      (when (called-interactively-p 'any)&#xA;        (message &quot;Turned OFF `myplugin-keybindings-mode`.&quot;)))))&#xA;&#xA;(defun my-main-function ()&#xA;  (when&#xA;      (and&#xA;        myplugin-keybindings-mode&#xA;        (eq major-mode 'coq-mode))&#xA;    (message &quot;Hello-world!&quot;)&#xA;    ;; insert more stuff&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-04-05T20:14:16.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10534" PostTypeId="2" ParentId="10527" CreationDate="2015-04-05T22:06:54.513" Score="2" Body="&lt;h2&gt;With two separate instances&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Start the Emacs server in instance 2. Don't start it, or start it with a non-default name, in instance 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, put &lt;code&gt;(server-start)&lt;/code&gt; in your init file. Launch instance 2 normally, with &lt;code&gt;emacs&lt;/code&gt; (or let emacsclient do it). Launch instance 1 with &lt;code&gt;emacs --eval &quot;(setq server-name \&quot;work\&quot;)&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-04-05T22:06:54.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10535" PostTypeId="1" AcceptedAnswerId="10536" CreationDate="2015-04-05T23:37:04.593" Score="10" ViewCount="4613" Body="&lt;p&gt;I have some customisation in my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. My command line emacs can pick up the &lt;code&gt;init.el&lt;/code&gt; as expected. However Aquamacs does not seem to read the file at all. Here is the buffer of the &lt;code&gt;*message*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading prestart plugin files ...&#xA;... done.&#xA;Wrote /Users/antkong/Library/Preferences/Aquamacs Emacs/Packages/.nosearch&#xA;Shell: /bin/zsh&#xA;Loading /Users/antkong/Library/Preferences/Aquamacs Emacs/Recent Files.el (source)...done&#xA;Cleaning up the recentf list...done (0 removed)&#xA;22 environment variables imported from login shell (/bin/zsh).&#xA;Loading /opt/homebrew-cask/Caskroom/aquamacs/3.2/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/auctex.el (source)...done&#xA;Loading plugins ...&#xA;Loading /opt/homebrew-cask/Caskroom/aquamacs/3.2/Aquamacs.app/Contents/Resources/lisp/aquamacs/site-start.el (source)...done&#xA;... done.&#xA;Loading `custom-file' failed.&#xA;Loading /Users/antkong/Library/Preferences/Aquamacs Emacs/Preferences.el (source)...done&#xA;Mark set&#xA;one-buffer-one-frame-mode disabled.&#xA;Mark set [26 times]&#xA;Loading /Users/antkong/Library/Preferences/Aquamacs Emacs/frame-positions.el (source)...done&#xA;file-error: (Opening directory no such file or directory /Users/antkong/Library/Logs/CrashReporter)&#xA;Mark set [5 times]&#xA;Aquamacs is based on GNU Emacs, a part of the GNU/Linux system. It is Free Software: you can improve and redistribute it under the GNU General Public License, version 3 or later. (C) 2014 Free Software Foundation, and D. Reitter. No Warranty.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why Aqacmacs does not read the init.el file?&lt;/p&gt;&#xA;" OwnerUserId="169" LastActivityDate="2022-07-11T02:12:52.870" Title="Why aquamacs does not read ~/.emacs.d/init.el?" Tags="|osx|aquamacs|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10536" PostTypeId="2" ParentId="10535" CreationDate="2015-04-06T01:01:42.943" Score="7" Body="&lt;p&gt;The following answer relates to current public release of Aquamacs available for download at &lt;a href=&quot;http://aquamacs.org/download.shtml&quot; rel=&quot;noreferrer&quot;&gt;http://aquamacs.org/download.shtml&lt;/a&gt; -- i.e., &lt;code&gt;Aquamacs 3.2 GNU Emacs 24.4.51.2 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14) of 2014-11-07 (Aquamacs-3.2) on watson.local&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aquamacs does indeed read the &lt;code&gt;init.el&lt;/code&gt; that can be placed inside &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;.  This can be verified by placing a simple message inside the &lt;code&gt;init.el&lt;/code&gt; file and restarting Aquamacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;Hello-world -- this is my init.el file loading!&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the &lt;code&gt;*Messages*&lt;/code&gt; buffer output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading prestart plugin files ...&#xA;... done.&#xA;Wrote /Users/HOME/Library/Preferences/Aquamacs Emacs/Packages/.nosearch&#xA;Shell: /bin/bash&#xA;Loading /Users/HOME/Library/Preferences/Aquamacs Emacs/Recent Files.el (source)...done&#xA;Cleaning up the recentf list...done (0 removed)&#xA;14 environment variables imported from login shell (/bin/bash).&#xA;Loading /Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/auctex.el (source)...done&#xA;Loading plugins ...&#xA;Loading /Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/site-start.el (source)...done&#xA;... done.&#xA;Loading `custom-file' failed.&#xA;Loading /Users/HOME/Library/Preferences/Aquamacs Emacs/Preferences.el (source)...done&#xA;Hello-world -- this is my init.el file loading!&#xA;Mark set&#xA;one-buffer-one-frame-mode disabled.&#xA;Mark set [26 times]&#xA;Loading /Users/HOME/Library/Preferences/Aquamacs Emacs/frame-positions.el (source)...done&#xA;Mark set [5 times]&#xA;Aquamacs is based on GNU Emacs, a part of the GNU/Linux system. It is Free Software: you can improve and redistribute it under the GNU General Public License, version 3 or later. (C) 2014 Free Software Foundation, and D. Reitter. No Warranty.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-04-06T01:01:42.943" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10537" PostTypeId="1" AcceptedAnswerId="10538" CreationDate="2015-04-06T02:53:35.733" Score="0" ViewCount="745" Body="&lt;p&gt;This is the script I used to initialise packages in emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside &lt;code&gt;~/.emacs.d/init.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(load (expand-file-name &quot;package_init.el&quot;)&#xA;      user-emacs-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inside &lt;code&gt;~/.emacs.d/package_init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These two scripts work well in emacs 24.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bLTtF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it does not work in Aquamacs (&lt;code&gt;melpa&lt;/code&gt; is not added to the variable &lt;code&gt;package-archives&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ShA2U.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have already verified that aquamacs reads &lt;code&gt;init.el&lt;/code&gt; when it starts. Here is the start up message in &lt;code&gt;*message*&lt;/code&gt; buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading prestart plugin files ...&#xA;... done.&#xA;Wrote /Users/antkong/Library/Preferences/Aquamacs Emacs/Packages/.nosearch&#xA;Shell: /bin/zsh&#xA;Loading /Users/antkong/Library/Preferences/Aquamacs Emacs/Recent Files.el (source)...done&#xA;Cleaning up the recentf list...done (0 removed)&#xA;22 environment variables imported from login shell (/bin/zsh).&#xA;Loading /opt/homebrew-cask/Caskroom/aquamacs/3.2/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/auctex.el (source)...done&#xA;Loading plugins ...&#xA;Loading /opt/homebrew-cask/Caskroom/aquamacs/3.2/Aquamacs.app/Contents/Resources/lisp/aquamacs/site-start.el (source)...done&#xA;... done.&#xA;Loading `custom-file' failed.&#xA;Loading /Users/antkong/Library/Preferences/Aquamacs Emacs/Preferences.el (source)...done&#xA;Mark set&#xA;one-buffer-one-frame-mode disabled.&#xA;Mark set [26 times]&#xA;Loading /Users/antkong/Library/Preferences/Aquamacs Emacs/frame-positions.el (source)...done&#xA;file-error: (Opening directory no such file or directory /Users/antkong/Library/Logs/CrashReporter)&#xA;Mark set [5 times]&#xA;Aquamacs is based on GNU Emacs, a part of the GNU/Linux system. It is Free Software: you can improve and redistribute it under the GNU General Public License, version 3 or later. (C) 2014 Free Software Foundation, and D. Reitter. No Warranty.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="169" LastEditorUserId="160" LastEditDate="2015-05-06T18:38:02.817" LastActivityDate="2015-05-06T18:38:02.817" Title="Why doesn't this script set package-archives in Aquamacs?" Tags="|package|aquamacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10538" PostTypeId="2" ParentId="10537" CreationDate="2015-04-06T03:11:15.220" Score="3" Body="&lt;p&gt;I think I found out why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;user-emacs-directory&lt;/code&gt; is set to &lt;code&gt;&quot;~/Library/Preferences/Aquamacs Emacs/Packages/&quot;&lt;/code&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I add this to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-emacs-directory &quot;~/.emacs.d&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the problem is resolved.&lt;/p&gt;&#xA;" OwnerUserId="169" LastActivityDate="2015-04-06T03:11:15.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10540" PostTypeId="1" AcceptedAnswerId="10666" CreationDate="2015-04-06T12:58:13.650" Score="3" ViewCount="320" Body="&lt;p&gt;Is there a way to modify the Emacs modeline so I'll be able to see all the emacsclients or just the number of emacsclients actually editing/displaying the buffer I'm currently working on? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found inside server.el.gz: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; The buffer local variable &quot;server-buffer-clients&quot; lists &#xA;;; the clients who are waiting for this buffer to be edited.&#xA;;; The global variable &quot;server-clients&quot; lists all the waiting clients,&#xA;;; and which files are yet to be edited for each.   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this is one example of ouput when I call &lt;code&gt;M-x describe-variable server-buffer-clients&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;server-buffer-clients is a variable defined in `server.el'.                                                     &#xA;Its value is&#xA;(#&amp;lt;process server &amp;lt;5&amp;gt;&amp;gt; #&amp;lt;process server &amp;lt;3&amp;gt;&amp;gt; #&amp;lt;process server &amp;lt;1&amp;gt;&amp;gt;)&#xA;&#xA;Local in buffer basics.hs; global value is nil&#xA;&#xA;  Automatically becomes permanently buffer-local when set.&#xA;&#xA;Documentation:&#xA;List of client processes requesting editing of current buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't really understand how to interpret the line: &lt;code&gt;(#&amp;lt;process server &amp;lt;5&amp;gt;&amp;gt; #&amp;lt;process server &amp;lt;3&amp;gt;&amp;gt; #&amp;lt;process server &amp;lt;1&amp;gt;&amp;gt;)&lt;/code&gt;. Thanks for your suggestions.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-04-06T14:07:49.897" LastActivityDate="2015-04-13T17:53:57.620" Title="Modify the modeline to show all emacsclients editing buffer" Tags="|emacsclient|mode-line|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10541" PostTypeId="2" ParentId="10540" CreationDate="2015-04-06T13:10:33.773" Score="1" Body="&lt;p&gt;Not the answer that you hope for, but with &lt;a href=&quot;https://github.com/Bruce-Connor/smart-mode-line&quot; rel=&quot;nofollow&quot;&gt;Smart Mode Line&lt;/a&gt; you should be notified with a red M, to indicate that the buffer is edited in another Emacs Client. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-04-06T13:10:33.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10542" PostTypeId="1" AcceptedAnswerId="10543" CreationDate="2015-04-06T14:10:25.997" Score="2" ViewCount="346" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I get &lt;code&gt;this-command-key-vector&lt;/code&gt; to return a character vector when called with the return key?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following simple command, which will echo the vector of keys that invoked it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-echo ()&#xA;  (interactive)&#xA;  (message &quot;%s&quot; (this-command-keys-vector)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now let's bind it to two keys:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key &quot;i&quot; #'test-echo)&#xA;(local-set-key [return] #'test-echo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When typing &lt;kbd&gt;i&lt;/kbd&gt;, the function correctly messages me with the vector &lt;code&gt;[105]&lt;/code&gt;, which corresponds to &lt;em&gt;i&lt;/em&gt;'s character representation &lt;code&gt;(eq ?i 105)&lt;/code&gt;.  However, when typing &lt;kbd&gt;return&lt;/kbd&gt;, it echoes &lt;code&gt;[return]&lt;/code&gt;, when I would have expected &lt;code&gt;[10]&lt;/code&gt;, i.e., &lt;code&gt;?\n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, is this a problem with my understanding of &lt;code&gt;this-command-key-vector&lt;/code&gt;, my understanding of &lt;code&gt;return&lt;/code&gt;, or both?  Second of all, how do I get &lt;code&gt;this-command-key-vector&lt;/code&gt; to return a character (ie, the integer value) rather than the symbol &lt;code&gt;return&lt;/code&gt; (or, alternately, how do I translate &lt;code&gt;return&lt;/code&gt; to a character)?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="105" LastEditDate="2015-04-06T15:29:40.517" LastActivityDate="2015-04-06T15:29:40.517" Title="this-command-key-vector and representation of Return key?" Tags="|elisp|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10543" PostTypeId="2" ParentId="10542" CreationDate="2015-04-06T15:23:55.653" Score="2" Body="&lt;p&gt;It's a problem with your understanding of &lt;code&gt;return&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt; is a pseudo-function key. It is not the same thing as &lt;code&gt;RET&lt;/code&gt;, which corresponds to &lt;code&gt;C-m&lt;/code&gt; (decimal &lt;code&gt;13&lt;/code&gt;).  Depending on your keyboard, when you hit the &lt;code&gt;Enter&lt;/code&gt; or &lt;code&gt;Return&lt;/code&gt; key, Emacs might receive one or the other. Use &lt;code&gt;C-h k&lt;/code&gt; followed by hitting that key, to see what Emacs tells you it receives.  For example, when I do that I see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RET (translated from &amp;lt;return&amp;gt;) runs the command...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[return]&lt;/code&gt; is the vector representation of the pseudo-function key &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-06T15:23:55.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10544" PostTypeId="1" AcceptedAnswerId="10844" CreationDate="2015-04-06T16:38:14.253" Score="3" ViewCount="1742" Body="&lt;p&gt;Helm features buffer navigation that is more powerful than ido but apparently has a bit of a learning curve. Say I want to open a file in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;java/com/example/apple/banana/cat/dog/elephant/fig/grape/Hello.java&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And my mini buffer currently reads&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Find files or Url: ~/java/com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The helm buffer list will not let me &amp;lt;TAB&gt; for completion like in ido. &amp;lt;RETURN&gt; will open the buffer list, which is also not what I want. However to select the directory I must hit the right arrow key which requires leaving the home keys on my keyboard and is therefore very slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Per answer below &lt;code&gt;C-j&lt;/code&gt; or &lt;code&gt;C-z&lt;/code&gt; is the answer I'm looking for. However at that point it's still very hard to navigate, as Helm will default to &lt;code&gt;./&lt;/code&gt; as the directory listed, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to &lt;code&gt;helm-find-files&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pick any directory&lt;/li&gt;&#xA;&lt;li&gt;After you are taken to the next file list, the entry highlighted in &quot;green&quot; will be &lt;code&gt;the_directory/.&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This means if you type &lt;code&gt;C-j&lt;/code&gt; again it will &quot;take&quot; you to exactly where you are. This contrasts with ido, where hitting &amp;lt;RETURN&gt; a few times will auto-complete out using logic (I think just &quot;last picked directory&quot;) to determine which directory should be default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I must always type &lt;code&gt;C-n&lt;/code&gt; twice or type the first letter of the directory. It certainly doesn't &quot;fly&quot; like ido-mode does, so this is still too unusable for me. Is there a hack for this as well?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastEditorUserId="6641" LastEditDate="2015-04-06T19:44:41.390" LastActivityDate="2015-09-03T09:38:48.180" Title="How to open files out of long directory trees using helm-find-files?" Tags="|buffers|helm|navigation|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10545" PostTypeId="2" ParentId="10544" CreationDate="2015-04-06T16:52:16.640" Score="2" Body="&lt;p&gt;&lt;code&gt;C-c ?&lt;/code&gt; is your friend when it comes to Helm for context dependent help. So hit that when you're in helm-find-files, and it will tell you that &lt;code&gt;C-j&lt;/code&gt; will expand to a file (or directory) name. When the candidate directory you want is highlighted, hit &lt;code&gt;C-j&lt;/code&gt; and continue your travels from that directory, like you woud with &lt;code&gt;return&lt;/code&gt; in ido.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, &lt;code&gt;C-l&lt;/code&gt; will remove the current directory/file name, allowing for new input.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="2688" LastEditDate="2015-04-06T19:37:04.840" LastActivityDate="2015-04-06T19:37:04.840" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10546" PostTypeId="2" ParentId="10353" CreationDate="2015-04-06T16:56:13.173" Score="8" Body="&lt;p&gt;When you spot a problem in the way how emacs behaves and if that happens only when you load your emacs config (&lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt;) and not when you run &lt;code&gt;emacs -Q&lt;/code&gt;, you need to bisect your init to find the culprit as @Drew mentioned in the comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, you don't have to bisect your init in this case as you have a tangible visual clue of the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The visual problem is that you get the red underlines which you don't want. As it is visual, you can always figure out what's causing that formatting by following these steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Move the point to one of that characters that has the unwanted red underline.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x describe-char&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Find out which faces are active for that character (from the information that the above step prints out).&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Grep&lt;/em&gt; for that face name in your &lt;code&gt;elpa/&lt;/code&gt; (technically the directory name saved in &lt;code&gt;package-user-dir&lt;/code&gt; variable) directory. If that does not yield any results, repeat the grep in the emacs source code &lt;code&gt;lisp/&lt;/code&gt; directory. This step will tell you which package and function(s) assigned that face to that string.&lt;/li&gt;&#xA;&lt;li&gt;Once you figure out the function name(s) assigning this face, you need to figure out where you are calling that(those) function(s); &lt;em&gt;grep&lt;/em&gt; for it(them) in your &lt;code&gt;~/.emacs.d&lt;/code&gt; (technically the directory name saved in &lt;code&gt;user-emacs-directory&lt;/code&gt;). &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That will tell you which piece of code is enabling those faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;PS: Though bisecting the init is default way to debug your emacs setup issues.&lt;/em&gt; &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-06T17:06:57.867" LastActivityDate="2015-04-06T17:06:57.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10547" PostTypeId="2" ParentId="5518" CreationDate="2015-04-06T17:25:09.510" Score="5" Body="&lt;p&gt;This feature does not yet seem to exist. I have opened an &lt;a href=&quot;https://github.com/politza/pdf-tools/issues/74&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt; requesting this feature on &lt;code&gt;pdf-tools&lt;/code&gt; git.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-07T02:33:50.727" LastActivityDate="2015-04-07T02:33:50.727" CommentCount="2" CommunityOwnedDate="2015-04-07T02:33:50.727" ContentLicense="CC BY-SA 3.0" />
  <row Id="10548" PostTypeId="2" ParentId="10477" CreationDate="2015-04-06T19:31:29.863" Score="0" Body="&lt;p&gt;Here is my solution, based on the original function called by &lt;code&gt;C-c C-w&lt;/code&gt; in message mode, &lt;code&gt;message-insert-signature&lt;/code&gt;, and on @erikstokes's answer and @malabarba's comment, followed by the instruction to bind it to &lt;code&gt;C-c C-w&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works as I wished: it inserts the signature at the end of the email via &lt;code&gt;C-c C-w&lt;/code&gt;, and at point when called via &lt;code&gt;C-u C-c C-w&lt;/code&gt;. As the original function, it &lt;em&gt;does not&lt;/em&gt; insert the signature if one is already present in the email. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jyby/insert-signature (&amp;amp;optional arg)&#xA;  &quot;Insert a signature.&#xA;  If prefixed with C-u, inserts it at point,&#xA;  otherwise inserts it at the end of the buffer.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((signature&#xA;      (cond&#xA;       ((null message-signature)     &#xA;        (save-excursion&#xA;          (goto-char (point-max))&#xA;          (not (re-search-backward message-signature-separator nil t))))&#xA;       ((null message-signature) t)&#xA;       ((functionp message-signature)&#xA;        (funcall message-signature))&#xA;       ((listp message-signature)&#xA;        (eval message-signature))&#xA;       (t message-signature)))&#xA;     signature-file)&#xA;    (setq signature&#xA;      (cond ((stringp signature)&#xA;         signature)&#xA;        ((and (eq t signature) message-signature-file)&#xA;         (setq signature-file&#xA;               (if (and message-signature-directory&#xA;                ;; don't actually use the signature directory&#xA;                ;; if message-signature-file contains a path.&#xA;                (not (file-name-directory&#xA;                      message-signature-file)))&#xA;               (expand-file-name message-signature-file&#xA;                         message-signature-directory)&#xA;             message-signature-file))&#xA;         (file-exists-p signature-file))))&#xA;    (when signature &#xA;     (save-excursion&#xA;      (if (not arg)&#xA;        (goto-char (point-max))&#xA;      )&#xA;      ;; Insert the signature.&#xA;      (unless (bolp)&#xA;    (insert &quot;\n&quot;))&#xA;      (when message-signature-insert-empty-line&#xA;    (insert &quot;\n&quot;))&#xA;      (insert &quot;-- \n&quot;)&#xA;      (if (eq signature t)&#xA;      (insert-file-contents signature-file)&#xA;    (insert signature))&#xA;      (goto-char (point-max))&#xA;      (or (bolp) (insert &quot;\n&quot;))))))&#xA;&#xA;(local-unset-key (kbd &quot;C-c C-w&quot;))  (local-set-key (kbd &quot;C-c C-w&quot;) 'jyby/insert-signature)    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I might modify it later so that it ignores existing signatures when called with a prefix.&lt;/p&gt;&#xA;" OwnerUserId="6934" LastActivityDate="2015-04-06T19:31:29.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10549" PostTypeId="1" AcceptedAnswerId="10620" CreationDate="2015-04-07T02:58:49.707" Score="41" ViewCount="18212" Body="&lt;p&gt;I am using &lt;code&gt;org-mode&lt;/code&gt;, and the document I am writing has a table name whose name looks like this: &lt;code&gt;tab_weekly_report&lt;/code&gt;. When I export the document to HTML, I expect the name to exported as &lt;code&gt;tab_weekly_report&lt;/code&gt;, but &lt;code&gt;org-mode&lt;/code&gt; treats &lt;code&gt;_&lt;/code&gt; specially (as a markup character). How can I avoid this?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="504" LastEditDate="2015-04-07T20:23:06.533" LastActivityDate="2024-02-03T16:52:47.187" Title="org-mode: How to export underscore as underscore instead of highlight in HTML?" Tags="|org-mode|org-export|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10550" PostTypeId="2" ParentId="10378" CreationDate="2015-04-07T03:49:43.903" Score="0" Body="&lt;p&gt;I don't think my questions has enough information to diagnose the problem, but in case someone runs across the same issue, here is how I resolved it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had &lt;code&gt;(js2-minor-mode)&lt;/code&gt; in my hook, although I am using the major mode &lt;code&gt;js2-mode&lt;/code&gt;. When I toggle &lt;code&gt;js2-minor-mode&lt;/code&gt; followed by a buffer reload, the parsing error resolves whenever &lt;code&gt;js2-minor-mode&lt;/code&gt; is disabled. So the solution is to disable &lt;code&gt;js2-minor-mode&lt;/code&gt;, or remove it from my hook. I'm not sure why a &lt;code&gt;js2-minor-mode&lt;/code&gt; even exists?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a little confusing because there are lots of packages/modes involved with running a Javascript IDE, but I only have a basic understanding of Emacs. If someone can post a more thorough explanation of what's going on, I would gladly accept their answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the output of my major and minor modes after the correction, from running &lt;code&gt;C-h m&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Ac-Js2 Auto-Complete Auto-Composition&#xA;Auto-Compression Auto-Encryption Blink-Cursor Column-Number&#xA;Desktop-Save Electric-Indent Erc-Autojoin Erc-Button Erc-Fill&#xA;Erc-Irccontrols Erc-List Erc-Match Erc-Menu Erc-Move-To-Prompt&#xA;Erc-Netsplit Erc-Networks Erc-Noncommands Erc-Pcomplete Erc-Readonly&#xA;Erc-Ring Erc-Stamp Erc-Track Evil Evil-Local File-Name-Shadow&#xA;Font-Lock Global-Auto-Complete Global-Font-Lock Global-Hl-Line&#xA;Global-Undo-Tree Global-Visual-Line Line-Number Linum Menu-Bar&#xA;Mouse-Wheel Show-Paren Size-Indication Subword Tooltip Transient-Mark&#xA;Undo-Tree Yas Yas-Global&#xA;&#xA;(Information about these minor modes follows the major mode info.)&#xA;&#xA;Javascript-IDE mode defined in `js2-mode.el':&#xA;Major mode for editing JavaScript code.&#xA;&#xA;In addition to any hooks its parent mode `prog-mode' might have run,&#xA;this mode runs the hook `js2-mode-hook', as the final step&#xA;during initialization.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-04-07T03:49:43.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10551" PostTypeId="2" ParentId="10549" CreationDate="2015-04-07T04:20:42.880" Score="27" Body="&lt;p&gt;Add the following at the beginning of your file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: ^:nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It should do the trick. If it doesn't, I'd check org-symbols: &lt;a href=&quot;http://orgmode.org/worg/org-symbols.html&quot;&gt;http://orgmode.org/worg/org-symbols.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6664" LastActivityDate="2015-04-07T04:20:42.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10552" PostTypeId="1" AcceptedAnswerId="10555" CreationDate="2015-04-07T07:54:14.187" Score="2" ViewCount="1357" Body="&lt;p&gt;I am addicted to helm-projectile, unfortunately after a recent update, all of a sudden I get the warning message at Emacs start-up that the function &lt;code&gt;projectile-global-mode&lt;/code&gt; is void. Before that, everything was working perfectly fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;related init.el&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package) ; only once in init.el&#xA;(package-initialize) ; only once in init.el&#xA;(require 'helm) ; install package&#xA;(require 'helm-config)&#xA;(helm-mode 1)&#xA;(setq exec-path (add-to-list 'exec-path &quot;C:/Program Files/Gow/bin&quot;))&#xA;(setenv &quot;PATH&quot; (concat &quot;C:\\Program Files\\Gow\\bin;&quot; (getenv &quot;PATH&quot;)))&#xA;(projectile-global-mode)        &#xA;(setq projectile-completion-system 'helm)&#xA;(helm-projectile-on)&#xA;(setq projectile-indexing-method 'alien) &#xA;(setq projectile-switch-project-action 'projectile-dired)&#xA;(setq projectile-enable-caching t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to change it to:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(projectile-global-mode +1)     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but no success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to search for this function &lt;code&gt;projectile-global-mode&lt;/code&gt; but could not find it when I do &lt;code&gt;C-h f&lt;/code&gt; and could not even find it in the &lt;code&gt;helm-projectile.el&lt;/code&gt; file where supposed to be AFAIK. So what am I missing?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;br&gt;&#xA;- Windows 7 machine 32bit&lt;br&gt;&#xA;- Emacs version 24.4.1&lt;br&gt;&#xA;- all packages were updated from MELPA  &lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-04-07T08:24:02.473" LastActivityDate="2015-04-07T13:32:39.367" Title="'projectile-global-mode' function is void at the startup, why?" Tags="|init-file|helm|projectile|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10553" PostTypeId="1" AcceptedAnswerId="10564" CreationDate="2015-04-07T09:01:00.223" Score="1" ViewCount="825" Body="&lt;p&gt;I find myself applying the same attributes to multiple faces quite often:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'sml/line-number nil :background zenburn/bg-1 :foreground zenburn/fg :weight 'unspecified)&#xA;(set-face-attribute 'sml/numbers-separator nil :background zenburn/bg-1 :foreground zenburn/fg :weight 'unspecified)&#xA;(set-face-attribute 'sml/col-number nil :background zenburn/bg-1 :foreground zenburn/fg :weight 'unspecified)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can regroup those face attributes and apply them to a list of faces ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to define a group:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defgroup me/sml-numbers '('sml/line-number 'sml/numbers-separator 'sml/col-number)&#xA;  &quot;Faces for numbers within `smart-mode-line'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;set-face-attribute&lt;/code&gt; takes a face as parameter:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;set-face-attribute: Invalid face: me/sml-numbers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2015-05-09T20:16:38.177" Title="How to regroup set-face-attribute calls" Tags="|faces|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10554" PostTypeId="1" CreationDate="2015-04-07T09:53:08.633" Score="1" ViewCount="336" Body="&lt;p&gt;I am using &lt;code&gt;lstlisting&lt;/code&gt; to add &lt;code&gt;shell&lt;/code&gt; code into my tex document. The &lt;code&gt;shell&lt;/code&gt; code contains special character, &lt;code&gt;$&lt;/code&gt;. Emacs assumes it as a Math mode mark &amp;amp; all characters that come after dollar symbol are shown in math-mode and latex keywords are n't highlighted in their normal bright green color. It looks like this,&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Ihjqx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use AUCTeX.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="620" LastEditDate="2015-04-07T15:53:25.347" LastActivityDate="2015-04-07T15:53:25.347" Title="Dollar symbol inside lstlisting block turns on font-latex-math-face" Tags="|auctex|latex|font-lock|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10555" PostTypeId="2" ParentId="10552" CreationDate="2015-04-07T13:32:39.367" Score="3" Body="&lt;p&gt;This is a problem of bad installation. Just remove and install, and it will work again.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-04-07T13:32:39.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10556" PostTypeId="1" AcceptedAnswerId="10560" CreationDate="2015-04-07T13:53:49.257" Score="2" ViewCount="161" Body="&lt;p&gt;I forgot to type &lt;code&gt;:results none&lt;/code&gt; in babel and now I have a huge table in my org file. How can I select all of those lines and delete them? When I try the straight forward approach of moving to the end of the buffer, Emacs freezes up and I get a &quot;Timed out waiting for property viewers&quot; message in the minibuffer.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-04-07T20:15:07.327" Title="How to delete a huge org-table" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10557" PostTypeId="2" ParentId="10554" CreationDate="2015-04-07T14:42:36.650" Score="1" Body="&lt;p&gt;Add &quot;lstlisting&quot; to &lt;code&gt;LaTeX-verbatim-environments&lt;/code&gt; (using &lt;code&gt;M-x customize-variable&lt;/code&gt;) and reopen your file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;courtesy: &lt;a href=&quot;https://stackoverflow.com/questions/14802450/emacs-how-to-render-lslisting-as-verbatim&quot;&gt;s.overflow&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-04-07T14:42:36.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10558" PostTypeId="1" AcceptedAnswerId="10559" CreationDate="2015-04-07T14:48:26.687" Score="1" ViewCount="522" Body="&lt;p&gt;I have my &lt;code&gt;emacs&lt;/code&gt; setup as an alias in the &lt;code&gt;bashrc&lt;/code&gt; as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias=&quot;emacsclient -t -s server alternate-editor=&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in case this helps. The &lt;code&gt;emacs&lt;/code&gt; version is &lt;code&gt;24.4.1&lt;/code&gt; and AUCTeX is compiled from the git repo and was update just yesterday the version is &lt;code&gt;2015-04-02&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to trouble shoot an issue with &lt;code&gt;emacs&lt;/code&gt;. When I run &lt;code&gt;emacs --debug-init&lt;/code&gt;, I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable modes)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/dustin/.emacs&quot; nil t)  ; Reading at buffer position 1657&#xA;  load-with-code-conversion(&quot;/home/dustin/.emacs&quot; &quot;/home/dustin/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 &quot;\205\262�    \306=\203�\307\310Q\202;�   \311=\204�\307\312Q\202;�\313\307\314\315#\203*�\316\202;�\313\307\314\317#\203:�\320\nB\321\202;�\316\322\323\322\211#\210\322=\203a�\324\325\326\307\327Q!\&quot;\323\322\211#\210\322=\203`�\210\203\243�\330!\331\232\203\243�\332!\211\333P\334!\203}�\211\202\210�\334!\203\207�\202\210�\314\262\203\241�\335\&quot;\203\237�\336\337#\210\340\341!\210\266\f?\205\260�\314\323\342\322\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; (initialization &quot;`_emacs' init file is deprecated, please use `.emacs'&quot;) &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7 &quot;\n\n(fn)&quot;]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I &lt;code&gt;M-x goto-char&lt;/code&gt; return &lt;code&gt;1657&lt;/code&gt; return, it says &quot;You can run the command got-char with &lt;code&gt;M-g c&lt;/code&gt;&quot; and that is it. How do I jump to position &lt;code&gt;1657&lt;/code&gt; to see what the issue is?&lt;/p&gt;&#xA;" OwnerUserId="2603" LastEditorUserId="654" LastEditDate="2015-04-07T15:25:43.260" LastActivityDate="2015-04-07T15:25:43.260" Title="How can I debug my init file using information from --debug-init?" Tags="|init-file|debugging|" AnswerCount="1" CommentCount="3" ClosedDate="2015-04-08T11:05:36.363" ContentLicense="CC BY-SA 3.0" />
  <row Id="10559" PostTypeId="2" ParentId="10558" CreationDate="2015-04-07T14:57:10.387" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;When I &lt;code&gt;M-x goto-char return 1657 return&lt;/code&gt;, it says &quot;You can run the command got-char with M-g c&quot; and that is it. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, that is standard behavior. Your point will now be on position 1657. You can verify this by hitting &lt;code&gt;C-x =&lt;/code&gt; (this runs the extended command &lt;code&gt;what-cursor-position&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more important part of the error message is &lt;code&gt;(void-variable modes)&lt;/code&gt;. You're trying to access some variable that hasn't been set.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-04-07T15:15:00.963" LastActivityDate="2015-04-07T15:15:00.963" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10560" PostTypeId="2" ParentId="10556" CreationDate="2015-04-07T14:57:14.140" Score="2" Body="&lt;p&gt;Using &lt;code&gt;org-narrow-to-element&lt;/code&gt; might help:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In the &lt;code&gt;#+RESULT&lt;/code&gt; line call &lt;code&gt;C-x n e&lt;/code&gt; to narrow to the result.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do something like &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-:&lt;/code&gt; &lt;code&gt;(delete-region (point-min) (point-max))&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to clear everything in the narrowed file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;C-x n w&lt;/code&gt; to widen back to the whole file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="504" LastEditDate="2015-04-07T20:15:07.327" LastActivityDate="2015-04-07T20:15:07.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10561" PostTypeId="1" AcceptedAnswerId="10562" CreationDate="2015-04-07T17:33:21.120" Score="2" ViewCount="1075" Body="&lt;p&gt;I have forked the &lt;code&gt;interleave&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made certain commits in my fork but now I want to discard them. I added the remote upstream branch (master branch by the &lt;code&gt;interleave&lt;/code&gt; author), fetched it and rebased to &lt;code&gt;upstream/master&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now the magit status shows the below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Local:    master ~/.emacs.d/elisp/interleave/&#xA;Remote:   master @ origin (http://kaushalmodi@github.com/kaushalmodi/interleave)&#xA;Head:     5a9e4ce Refine docs&#xA;Tag:      v0.4.0 (8 ahead)&#xA;&#xA;Unpulled commits:&#xA;3b836ef Merge branch 'master' of http://github.com/kaushalmodi/interleave&#xA;a297270 Merge org sorting fix from upstream&#xA;7a855c3 Fix the org-sort-entries issue&#xA;57b68fd Merge branch 'master' of http://github.com/kaushalmodi/interleave&#xA;39b872a Merge org sorting fix from upstream&#xA;88857ea Fix the org-sort-entries issue&#xA;9e53d4b Merge org sorting fix from upstream&#xA;50939fa Fix the org-sort-entries issue&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above shows my recursive failed attempts to do a clean rebase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get rid of those &lt;em&gt;Unpulled commits&lt;/em&gt; so that the fork master commit hash matches with the original master commit hash?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have already tried the &lt;code&gt;git reset --hard &amp;lt;upstream master commit hash&amp;gt;&lt;/code&gt; method as suggested in &lt;a href=&quot;https://stackoverflow.com/a/5097487/1219634&quot;&gt;this SO thread&lt;/a&gt; but that did not help; I simply want to get rid of all the unpulled commits so that I can do &lt;code&gt;c c&lt;/code&gt; in &lt;code&gt;magit&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-12-30T23:15:38.580" Title="How do I clean up my local commits and rebase to upstream master in magit?" Tags="|magit|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10562" PostTypeId="2" ParentId="10561" CreationDate="2015-04-07T18:11:34.253" Score="5" Body="&lt;p&gt;By doing a hard reset locally you only discarded the commits locally. To make the commits go away on your public fork also, you have to remove them there too. Since you haven't done so yet, and your local branch tracks the respective branch on your fork, the commits you have discarded locally show up as unpulled commits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To remove the commits on the remote too you have to do a forced push, using &lt;kbd&gt;P - f u&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that one should usually push to the push-remote instead of the upstream. To force push to the push-remote use &lt;kbd&gt;P - f p&lt;/kbd&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that one usually should not change published commits. But since this is your personal fork, most likely nobody based any work of their own on it, the commits are basically mistakes (as opposed to generally good changes with a defect; or so I assume from what you said), the history contains git usage mistakes, and this all happened recently, I would say that it is okay to just nuke the mess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would actually like to keep the changes (but just once, and possibly after further improving them), then start by creating a new branch starting at what is in &lt;code&gt;origin/master&lt;/code&gt;, and only then force push. Then show the log and cherry-pick the appropriate commits using &lt;kbd&gt;A&lt;/kbd&gt; in the correct order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should also not name your fork &lt;code&gt;origin&lt;/code&gt;, that should be used for the upstream repository. I usually use my username as the name of my public fork.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T23:15:38.580" LastActivityDate="2015-12-30T23:15:38.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10563" PostTypeId="2" ParentId="9491" CreationDate="2015-04-07T19:48:58.717" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-swoop&lt;/code&gt;&lt;/a&gt; solves exactly this problem.  You can match strings (order insensitive), regexps, and even strings against distance (try out &lt;code&gt;C-u M-x helm-swoop&lt;/code&gt; or &lt;code&gt;C-6 M-x helm-swoop&lt;/code&gt;...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xLzqU.gif&quot; alt=&quot;demo&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-04-07T19:48:58.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10564" PostTypeId="2" ParentId="10553" CreationDate="2015-04-07T20:31:51.027" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This has nothing to do with &lt;code&gt;defgroup&lt;/code&gt;, which is about &lt;code&gt;defcustom&lt;/code&gt; &lt;code&gt;:group&lt;/code&gt;. See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Group-Definitions.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Group Definitions&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you insist on grouping here then you need to iterate over the faces using a function that calls &lt;code&gt;set-face-attribute&lt;/code&gt; on a face (variable) with those other argument values.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(dolist (face  '(sml/line-number sml/numbers-separator sml/col-number))&#xA;  (set-face-attribute face nil&#xA;                      :background zenburn/bg-1&#xA;                      :foreground zenburn/fg&#xA;                      :weight 'unspecified))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what have you really gained by this iteration?  Now if you had 500 such settings to make then maybe...&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:16:38.177" LastActivityDate="2015-05-09T20:16:38.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10565" PostTypeId="2" ParentId="10469" CreationDate="2015-04-07T21:14:05.720" Score="2" Body="&lt;p&gt;I submitted a &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?archive=yes&amp;amp;bug=20263&quot; rel=&quot;nofollow&quot;&gt;bug&lt;/a&gt; and got response that this is &lt;a href=&quot;https://bugzilla.gnome.org/show_bug.cgi?id=85715&quot; rel=&quot;nofollow&quot;&gt;known bug&lt;/a&gt; of GTK since 2002. See &lt;code&gt;etc/PROBLEMS&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** When Emacs is compiled with Gtk+, closing a display kills Emacs.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As temporary solution - it is recommended to use Lucid Emacs build:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo apt-get install emacs-lucid&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastActivityDate="2015-04-07T21:14:05.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10566" PostTypeId="1" AcceptedAnswerId="10567" CreationDate="2015-04-07T23:05:53.003" Score="3" ViewCount="382" Body="&lt;p&gt;What is exactly the purpose of the &lt;code&gt;*code-conversion-work*&lt;/code&gt; buffer and why is the variable &lt;code&gt;default-directory&lt;/code&gt; in the &lt;code&gt;*code-conversion-work*&lt;/code&gt; buffer set to the folder in which Emacs was built?&lt;/p&gt;&#xA;" OwnerUserId="6969" LastEditorUserId="6969" LastEditDate="2015-04-13T10:29:36.067" LastActivityDate="2020-05-24T02:51:47.360" Title="What is the *code-conversion-work* buffer" Tags="|buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10567" PostTypeId="2" ParentId="10566" CreationDate="2015-04-07T23:41:04.800" Score="5" Body="&lt;p&gt;It's part of the &quot;coding system&quot; machinery (source code is in &lt;code&gt;src/coding.c&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;CODING SYSTEM&#xA;&#xA;A coding system is an object for an encoding mechanism that contains&#xA;information about how to convert byte sequences to character&#xA;sequences and vice versa.  When we say &quot;decode&quot;, it means converting&#xA;a byte sequence of a specific coding system into a character&#xA;sequence that is represented by Emacs' internal coding system&#xA;`emacs-utf-8', and when we say &quot;encode&quot;, it means converting a&#xA;character sequence of emacs-utf-8 to a byte sequence of a specific&#xA;coding system.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Listed examples of coding systems are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;UTF-8&lt;/li&gt;&#xA;&lt;li&gt;UTF-16&lt;/li&gt;&#xA;&lt;li&gt;Charset-base coding system&lt;/li&gt;&#xA;&lt;li&gt;Old Emacs internal format (emacs-mule)&lt;/li&gt;&#xA;&lt;li&gt;ISO2022-base coding system&lt;/li&gt;&#xA;&lt;li&gt;SJIS (or Shift-JIS or MS-Kanji-Code)&lt;/li&gt;&#xA;&lt;li&gt;BIG5&lt;/li&gt;&#xA;&lt;li&gt;CCL&lt;/li&gt;&#xA;&lt;li&gt;Raw-text&lt;/li&gt;&#xA;&lt;li&gt;No-conversion&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;*code-conversion-work*&lt;/code&gt; (n.b. has leading space) buffer is described in the source as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;A working buffer used by the top level conversion.  Once it is&#xA;created, it is never destroyed. [...] The other working buffers are&#xA;destroyed after the use is finished, and their names are modified&#xA;versions of [this name].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know definitively why &lt;code&gt;default-directory&lt;/code&gt; for this buffer is the source code directory. Obviously we can see that it's the directory where &lt;code&gt;coding.c&lt;/code&gt; lives, so that &lt;em&gt;might&lt;/em&gt; be the reason. Typically a new buffer not associated with a file path simply inherits its default directory from the previous buffer. My guesses would be that either this buffer is created very early in the bootstrap process and that directory is the earliest default value for &lt;code&gt;default-directory&lt;/code&gt;; or else it may be part of the dumped binary when Emacs is built, in which case that value certainly makes sense.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-04-08T00:24:47.170" LastActivityDate="2015-04-08T00:24:47.170" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10568" PostTypeId="1" AcceptedAnswerId="10587" CreationDate="2015-04-08T01:12:07.420" Score="1" ViewCount="205" Body="&lt;p&gt;I would like to have a command that inserts some text at a distance, while keeping the point in place during its own execution and while being undone. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate the point, consider following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion (goto-char (point-at-eol)) (insert &quot;test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EFOml.gif&quot; alt=&quot;enter Demonstration of point being moved by undo.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I was writing this, I found a solution through making an invisible change at the original position, at the beginning and at the end of execution.&#xA;This will ensure that original position is the last position visited by point during undo or redo. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following solution works, however I would like to apply more conventional approach if one exists:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(atomic-change-group (insert &quot; &quot;) (delete-char -1)&#xA;                     (save-excursion (goto-char (point-at-eol))&#xA;                                     (insert &quot;test&quot;))&#xA;                     (insert &quot; &quot;) (delete-char -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="279" LastEditorUserId="279" LastEditDate="2015-04-08T01:47:31.147" LastActivityDate="2015-05-09T20:16:21.143" Title="Undo custom command without moving the point" Tags="|point|undo|insert|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10569" PostTypeId="2" ParentId="10568" CreationDate="2015-04-08T04:32:54.083" Score="1" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion (undo-boundary) (goto-char (point-at-eol)) (insert &quot;test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;IOW, tell undo what you want it to do.  One way to do that is to use &lt;code&gt;undo-boundary&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want more info about what you are calling an &quot;&lt;em&gt;atomic [undo] group&lt;/em&gt;&quot;, see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Undo.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;Undo&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:16:21.143" LastActivityDate="2015-05-09T20:16:21.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10570" PostTypeId="1" AcceptedAnswerId="10572" CreationDate="2015-04-08T05:33:24.983" Score="5" ViewCount="1494" Body="&lt;p&gt;If I do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;  (getenv &quot;PATH&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get a list of colon-separated directories, including:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  /Users/michaeln/Library/Haskell/bin&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I look at the &lt;code&gt;exec-path&lt;/code&gt; variable, I see a list including the same directory.  If I do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;  (shell-command &quot;echo $PATH&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get a list of colon-separated directories including the same &lt;code&gt;Haskell/bin&lt;/code&gt; directory as above.  There is an executable &lt;code&gt;pandoc&lt;/code&gt; in that directory.  And yet, if I do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;  (shell-command &quot;pandoc&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get in response:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  /bin/bash: pandoc: command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong? &lt;/p&gt;&#xA;" OwnerUserId="528" LastEditorUserId="675" LastEditDate="2015-04-08T19:56:24.410" LastActivityDate="2015-04-08T19:56:24.410" Title="Executing commands through shell-command (what is the PATH used)?" Tags="|shell-command|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="10572" PostTypeId="2" ParentId="10570" CreationDate="2015-04-08T14:47:12.690" Score="5" Body="&lt;p&gt;If you are adding your Haskell bin to your &lt;code&gt;PATH&lt;/code&gt; in a &lt;code&gt;.bashrc&lt;/code&gt; or similar dotfile, this file only gets loaded when running an &quot;interactive&quot; shell. This happens when running &lt;code&gt;M-x shell&lt;/code&gt; but not when running &lt;code&gt;M-!&lt;/code&gt; / &lt;code&gt;(shell-command)&lt;/code&gt;, as there is no prompt. You can adjust the option flags that are sent to &lt;code&gt;(shell-command)&lt;/code&gt; by adjusting &lt;code&gt;shell-command-switch&lt;/code&gt; to instruct it to act interactively and load your shell dotfile with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shell-command-switch &quot;-ic&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="264" LastActivityDate="2015-04-08T14:47:12.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10573" PostTypeId="1" AcceptedAnswerId="13190" CreationDate="2015-04-08T18:32:35.860" Score="2" ViewCount="353" Body="&lt;p&gt;I'm using comint to communicate with a REPL. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From time to time the REPL sends large amounts of data. This causes a significant lag (about one second), because my filter function gets called on a bunch of small strings, instead of fewer, larger strings. (even with a fast filter function, parsing 1MB of output still ends up taking 0.001 ms per filter call, times 1000 = 1s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get emacs to package the output into larger chunks? &lt;code&gt;process-adaptive-read-buffering&lt;/code&gt; is already set to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The output to the filter may come in chunks of any size. A program that produces the same output twice in a row may send it as one batch of 200 characters one time, and five batches of 40 characters the next. If the filter looks for certain text strings in the subprocess output, make sure to handle the case where one of these strings is split across two or more batches of output; one way to do this is to insert the received text into a temporary buffer, which can then be searched. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2015-04-08T18:48:18.383" LastActivityDate="2015-08-04T01:11:07.877" Title="Size of process output sent to filter functions" Tags="|performance|comint|process|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10574" PostTypeId="1" CreationDate="2015-04-08T18:41:08.010" Score="1" ViewCount="62" Body="&lt;p&gt;I'm debugging with &lt;a href=&quot;https://docs.python.org/2/library/pdb.html&quot; rel=&quot;nofollow&quot;&gt;pdb&lt;/a&gt; in emacs and one of the parameters to the program I'm debugging is a list of regular expressions wrapped in quotes. Basically,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pdb someProgram.py 'regex .* .*'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from the minibuffer, I think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that shell expansion happens here for some reason and the &lt;code&gt;.*&lt;/code&gt; becomes expanded to a file wildcard pattern and becomes a list of all files in the current directory that start with &lt;code&gt;.&lt;/code&gt; including &lt;code&gt;..&lt;/code&gt; and any hidden files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't happen if I'm running the program from the standard command line like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python someProgram.py 'regex .* .*'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is the expansion happening in the minibuffer? And how do I prevent it from happening?&lt;/p&gt;&#xA;" OwnerUserId="6971" LastActivityDate="2015-04-08T18:41:08.010" Title="wildcard expansion in buffer" Tags="|debugging|minibuffer|wildcard|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10575" PostTypeId="1" AcceptedAnswerId="10576" CreationDate="2015-04-08T19:53:58.807" Score="6" ViewCount="1050" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html&quot; rel=&quot;noreferrer&quot;&gt;This&lt;/a&gt; documentation explains how to set up custom agenda views, and I understand the example code I've seen there. But there is one thing I'd like to do that might not be possible: I'd like to look over my next actions by category instead of looking through all of them at once. However, to do this I need a &quot;miscellaneous&quot; category to make sure I don't lose anything. This category would include all TODOs that are &lt;em&gt;not&lt;/em&gt; tagged with &lt;code&gt;OFFICE&lt;/code&gt;, &lt;code&gt;ERRANDS&lt;/code&gt;, or &lt;code&gt;HOME&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;O&quot; tags-todo &quot;OFFICE&quot;) &#xA;        (&quot;B&quot; tags-todo &quot;ERRANDS&quot;)       &#xA;        (&quot;H&quot; tags-todo &quot;HOME&quot;) &#xA;        ; Here comes the part where I make up pseudocode to show that&#xA;        ; I want a list of all TODOs that do not contain any of the&#xA;        ; tags specified above:&#xA;        ; (&quot;M&quot; tags-todo-NOT &quot;OFFICE&quot; &quot;ERRANDS&quot; &quot;HOME&quot;)&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible using Elisp?&lt;/p&gt;&#xA;" OwnerUserId="6973" LastEditorUserId="504" LastEditDate="2015-04-08T20:38:22.590" LastActivityDate="2015-04-08T20:38:22.590" Title="org-mode: List everything except certain tags in custom agenda view?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10576" PostTypeId="2" ParentId="10575" CreationDate="2015-04-08T20:21:55.570" Score="10" Body="&lt;p&gt;Yes, that's possible:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;O&quot; tags-todo &quot;OFFICE&quot;) &#xA;        (&quot;B&quot; tags-todo &quot;ERRANDS&quot;)   &#xA;        (&quot;H&quot; tags-todo &quot;HOME&quot;) &#xA;        (&quot;M&quot; tags-todo &quot;-OFFICE-ERRANDS-HOME&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's two things at work here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;-&lt;/code&gt; negates a search term. For example, &lt;code&gt;-OFFICE&lt;/code&gt; matches headlines that are &lt;em&gt;not&lt;/em&gt; tagged with &lt;code&gt;:OFFICE:&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Search terms can be concatenated with &lt;code&gt;+&lt;/code&gt; or &lt;code&gt;-&lt;/code&gt;. A &lt;code&gt;+&lt;/code&gt; in front of a tag means that headlines matching a query must include that tag.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-04-08T20:27:37.353" LastActivityDate="2015-04-08T20:27:37.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10577" PostTypeId="1" CreationDate="2015-04-08T20:42:13.580" Score="10" ViewCount="1451" Body="&lt;p&gt;I am using emacs 24.4. I have added a large number of installed packages via the M-x list-packages directive over about a year of usage. I would love to export my installed packages list for use elsewhere. Copying my .emacs gives me some errors on startup, which jogs my memory to install certain things. I suspect I could copy the .emacs.d, but that seems like maybe a bad idea. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a procedure or directive I can issue to dump the list of installed packages to a file that can be used to get them on foreign machines easily?&lt;/p&gt;&#xA;" OwnerUserId="2662" LastEditorUserId="2662" LastEditDate="2015-04-08T20:59:03.330" LastActivityDate="2015-04-09T03:49:37.680" Title="Export Emacs installed packages?" Tags="|package|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10578" PostTypeId="2" ParentId="10577" CreationDate="2015-04-08T20:54:55.440" Score="5" Body="&lt;p&gt;The directory &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; contains all packages installed with &lt;code&gt;list-packages&lt;/code&gt;. You can copy this directory over. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would probably also run something like &lt;code&gt;(byte-recompile-directory &quot;~/.emacs.d/elpa&quot; 0 t)&lt;/code&gt; (&lt;code&gt;0&lt;/code&gt; means don't ask, &lt;code&gt;t&lt;/code&gt; means force recompile) to byte-recompile everything because I believe there is some incompatibility of byte-compiled files between Emacs versions.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-04-08T20:54:55.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10579" PostTypeId="2" ParentId="10577" CreationDate="2015-04-08T21:54:39.883" Score="2" Body="&lt;p&gt;One way of doing could be to install package if not already installed, you should update your init file, and add those lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-packages&#xA;  '(color-theme db-pg db kv magit-push-remote magit-tramp&#xA;                magit git-rebase-mode git-commit-mode pg&#xA;                pretty-lambdada projectile pkg-info epl dash&#xA;                python-mode rich-minority s yasnippet yasnippet-bundle&#xA;                use-package key-chord undo-tree guide-key move-text&#xA;                openwith ack ag aggressive-indent nginx-mode multiple-cursors&#xA;                smartparens with-editor haskell-mode)&#xA;  &quot;A list of packages to ensure are installed at launch.&quot;)&#xA;&#xA;(defun my-packages-installed-p ()&#xA;  (loop for p in my-packages&#xA;        when (not (package-installed-p p)) do (return nil)&#xA;        finally (return t)))&#xA;&#xA;(unless (my-packages-installed-p)&#xA;  ;; check for new packages (package versions)                                  &#xA;  (package-refresh-contents)&#xA;  ;; install the missing packages                                                                               &#xA;  (dolist (p my-packages)&#xA;    (when (not (package-installed-p p))&#xA;      (package-install p))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Modify the &lt;code&gt;my-packages&lt;/code&gt; variable and add/remove the package you want to be installed. &lt;code&gt;M-x describe-variable package-activated-list&lt;/code&gt; will give you the list of your currently installed package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, the only thing to share is your init file. &#xA;I hope it will help.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="245" LastEditDate="2015-04-09T00:41:30.547" LastActivityDate="2015-04-09T00:41:30.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10580" PostTypeId="2" ParentId="10577" CreationDate="2015-04-09T03:44:25.103" Score="4" Body="&lt;p&gt;I had a look through the &lt;code&gt;package.el&lt;/code&gt; file and found the variable &lt;code&gt;package-alist&lt;/code&gt;. This seems to be a list of all installed packages including packages that are required by packages that you have installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all you want is a list of the package names installed the the following code will write out the names of the packages from this list to the &lt;code&gt;*Messages*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (p1 (sort (mapcar 'symbol-name (mapcar 'car package-alist)) 'string&amp;lt;))&#xA;  (message &quot;%s&quot; p1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm no Lisp programmer so I'm sure somebody can write a much better version of this code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also started to use the &lt;a href=&quot;https://github.com/jwiegley/use-package#for-packageel-users&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt; code with the &lt;code&gt;:ensure t&lt;/code&gt; option in order to install all my packages on a new PC.&lt;/p&gt;&#xA;" OwnerUserId="146" LastEditorUserId="146" LastEditDate="2015-04-09T03:49:37.680" LastActivityDate="2015-04-09T03:49:37.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10582" PostTypeId="1" CreationDate="2015-04-09T08:40:11.740" Score="13" ViewCount="813" Body="&lt;p&gt;I am used to writing files where paragraphs are split into several lines, e.g. with &lt;code&gt;fill-column&lt;/code&gt;. When I search for a string (&lt;code&gt;C-s&lt;/code&gt;) such as &lt;code&gt;this is a long text&lt;/code&gt;, the search results would not return the locations where the string appears with a line break between two of the words (like &lt;code&gt;this\nis a long text&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a command that would also return these results?&lt;/p&gt;&#xA;" OwnerUserId="6977" LastEditorUserId="105" LastEditDate="2016-12-28T03:26:55.277" LastActivityDate="2022-03-03T14:15:43.177" Title="Search for string ignoring new lines" Tags="|search|isearch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10583" PostTypeId="2" ParentId="10582" CreationDate="2015-04-09T10:14:26.370" Score="13" Body="&lt;p&gt;Take a look at the variables &lt;code&gt;isearch-lax-whitespace&lt;/code&gt;, &lt;code&gt;isearch-regexp-lax-whitespace&lt;/code&gt;, and &lt;code&gt;search-whitespace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If the first two variables are set to something non-nil (e.g. &lt;code&gt;t&lt;/code&gt;) any space character in your search string will match any sequence matched by the regular expression defined by the &lt;code&gt;search-whitespace-regexp&lt;/code&gt; variable.&lt;/p&gt;&#xA;&lt;p&gt;To match words across line breaks do this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Make Isearch work across spaces, tabs, and newlines.&#xA;(setq isearch-lax-whitespace t&#xA;      isearch-regexp-lax-whitespace t&#xA;      search-whitespace-regexp &amp;quot;[ \t\r\n]+&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;A space character in your query will now match any space, tab, or linebreak any number of times.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="32139" LastEditDate="2022-03-03T14:15:43.177" LastActivityDate="2022-03-03T14:15:43.177" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="10584" PostTypeId="1" AcceptedAnswerId="10585" CreationDate="2015-04-09T11:36:26.897" Score="1" ViewCount="653" Body="&lt;p&gt;I am trying to install the &lt;code&gt;projectile&lt;/code&gt; library. I am using Emacs 24.4.1, and I installed  &lt;code&gt;projectile-20150405.126&lt;/code&gt; from the Emacs package manager. Then I tried to activate it in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'projectile)&#xA;(projectile-global-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this gives an error when I am starting Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Warning (initialization): An error occurred while loading `/home/hakon/.emacs':&#xA;File error: Cannot open load file, no such file or directory, projectile&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tried to debug using &lt;code&gt;emacs -Q&lt;/code&gt; and it seems like I am missing a package called &lt;code&gt;dash&lt;/code&gt;..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the installation instructions at &lt;a href=&quot;http://batsov.com/projectile/&quot; rel=&quot;nofollow&quot;&gt;http://batsov.com/projectile/&lt;/a&gt; I should not need to install &lt;code&gt;dash&lt;/code&gt; first when using the package manager..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-04-09T13:05:35.423" Title="Not able to use projectile-mode after installation from Emacs package manager" Tags="|projectile|" AnswerCount="1" CommentCount="0" ClosedDate="2015-04-09T15:25:15.920" ContentLicense="CC BY-SA 3.0" />
  <row Id="10585" PostTypeId="2" ParentId="10584" CreationDate="2015-04-09T13:05:35.423" Score="2" Body="&lt;p&gt;By default Emacs initializes packages &lt;em&gt;after&lt;/em&gt; loading your init file, for historic and obscure reasons.  Hence packages are normally not available in your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need explicitly initialize the package manager first with &lt;code&gt;(package-initialize)&lt;/code&gt;. This adds all packages to &lt;code&gt;load-path&lt;/code&gt;, thus fixing this specific error.  Alternatively, you can delay Projectile setup until after &lt;code&gt;init.el&lt;/code&gt; was loaded, by using &lt;code&gt;(add-hook 'after-init-hook #'projectile-global-mode)&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-04-09T13:05:35.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10586" PostTypeId="2" ParentId="10518" CreationDate="2015-04-09T13:26:02.770" Score="5" Body="&lt;p&gt;You can advise &lt;code&gt;self-insert-command&lt;/code&gt; just fine.  In older Emacsen, it was sometimes (often) called directly from C, but since Emacs-24 (IIRC) it's never called directly from C, so the advice should work reliably.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-09T13:26:02.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10587" PostTypeId="2" ParentId="10568" CreationDate="2015-04-09T13:35:21.960" Score="1" Body="&lt;p&gt;The undo log normally doesn't keep track of point motion (tho it does try to put point back to where it was before a change, it does so under the assumption that point was only moved as a side effect of the changes and doesn't try to handle pointmotions that happened before the buffer modification).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you'll have to explicitly add an undo entry to put point back to where it was, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion (if (listp buffer-undo-list)&#xA;                    (push (point) buffer-undo-list))&#xA;                (goto-char (point-at-eol))&#xA;                (insert &quot;test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-09T13:35:21.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10588" PostTypeId="2" ParentId="9842" CreationDate="2015-04-09T14:11:40.807" Score="11" Body="&lt;p&gt;This answer is directly from the EVIL developer Frank Fischer,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested on Emacs24.4 with latest evil1.0.9+. Most evil key bindings still works, but we let git-timemachine's hotkeys take priority.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; @see https://bitbucket.org/lyro/evil/issue/511/let-certain-minor-modes-key-bindings&#xA;(eval-after-load 'git-timemachine&#xA;  '(progn&#xA;     (evil-make-overriding-map git-timemachine-mode-map 'normal)&#xA;     ;; force update evil keymaps after git-timemachine-mode loaded&#xA;     (add-hook 'git-timemachine-mode-hook #'evil-normalize-keymaps)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-04-09T14:11:40.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10589" PostTypeId="2" ParentId="10437" CreationDate="2015-04-09T14:37:23.300" Score="2" Body="&lt;p&gt;When you see &lt;em&gt;Automatically becomes buffer-local when set&lt;/em&gt; you can rely on it meaning just what it says: whenever that variable is set (e.g., using &lt;code&gt;setq&lt;/code&gt;), it becomes buffer-local if it was not already buffer-local. So yes, &lt;code&gt;setq&lt;/code&gt; sets the buffer-local value, and if you want to set the global, default value then you need to use &lt;code&gt;setq-default&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-09T14:37:23.300" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10590" PostTypeId="2" ParentId="10436" CreationDate="2015-04-09T15:55:22.550" Score="3" Body="&lt;p&gt;There are two built-in &lt;em&gt;interactive&lt;/em&gt; functions to help a user track down a library that is within the &lt;code&gt;load-path&lt;/code&gt; -- i.e., &lt;code&gt;locate-library&lt;/code&gt; [&lt;em&gt;to see the path&lt;/em&gt;] and &lt;code&gt;find-library&lt;/code&gt; [&lt;em&gt;to open the library in a buffer&lt;/em&gt;].&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;M-x locate-library&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;locate-library is an interactive compiled Lisp function in 'subr.el'.&#xA;&#xA;(locate-library LIBRARY &amp;amp;optional NOSUFFIX PATH INTERACTIVE-CALL)&#xA;&#xA;Show the precise file name of Emacs library LIBRARY.&#xA;LIBRARY should be a relative file name of the library, a string.&#xA;It can omit the suffix (a.k.a. file-name extension) if NOSUFFIX is&#xA;nil (which is the default, see below).&#xA;This command searches the directories in 'load-path' like 'M-x load-library'&#xA;to find the file that 'M-x load-library RET LIBRARY RET' would load.&#xA;Optional second arg NOSUFFIX non-nil means don't add suffixes 'load-suffixes'&#xA;to the specified name LIBRARY.&#xA;&#xA;If the optional third arg PATH is specified, that list of directories&#xA;is used instead of 'load-path'.&#xA;&#xA;When called from a program, the file name is normally returned as a&#xA;string.  When run interactively, the argument INTERACTIVE-CALL is t,&#xA;and the file name is displayed in the echo area.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;M-x find-library&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find-library is an interactive autoloaded compiled Lisp function in&#xA;'find-func.el'.&#xA;&#xA;(find-library LIBRARY)&#xA;&#xA;Find the Emacs Lisp source of LIBRARY.&#xA;LIBRARY should be a string (the name of the library).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-04-09T15:55:22.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10591" PostTypeId="1" CreationDate="2015-04-09T17:15:14.100" Score="2" ViewCount="1711" Body="&lt;p&gt;I want to match two or more consecutive lines with numbers only, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abc&#xA;1&#xA;2&#xA;abc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs, my regex is &lt;code&gt;\(^ *[[:digit:]]+ *$^J\)\{2,\}&lt;/code&gt;, but it doesn't match any. I find &lt;code&gt;\(^ *[[:digit:]]+ *^J\)\{2,\}&lt;/code&gt; can match. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't it true that &lt;code&gt;$&lt;/code&gt; doesn't consume a character, but signals the end of a line (just before a newline character)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Python, I remember it doesn't matter that I specify &lt;code&gt;$\n&lt;/code&gt; or &lt;code&gt;\n&lt;/code&gt;. So why does it matter in Emacs? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2015-04-09T19:00:27.247" Title="Why doesn't &quot;$^J&quot; match a new line character after another line?" Tags="|regular-expressions|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10592" PostTypeId="2" ParentId="10591" CreationDate="2015-04-09T17:38:19.793" Score="2" Body="&lt;p&gt;Using &lt;code&gt;\n&lt;/code&gt; to represent the newline should work (compare &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_line_ending_char.html&quot; rel=&quot;nofollow&quot;&gt;this description of Emacs newline representation&lt;/a&gt;.  This re puts point just after the 2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(re-search-forward &quot;\\(^\\s-*[0-9]+\\s-*\n\\)\\{2,\\}&quot; nil t)&#xA;&#xA;abc&#xA;1&#xA;2&#xA;abc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-09T17:38:19.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10593" PostTypeId="2" ParentId="10591" CreationDate="2015-04-09T17:41:41.103" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Isn't it true that $ doesn't consume a character, but signals the end of a line (just before a newline character)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;$ can only be used at the end of a regexp, or just before &lt;code&gt;\)&lt;/code&gt; or &lt;code&gt;\|&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html&quot; rel=&quot;nofollow&quot;&gt;From the manual:&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;is similar to ‘^’ but matches only at the end of a line. Thus, ‘x+$’ matches a string of one ‘x’ or more at the end of a line.&#xA;    For historical compatibility reasons, ‘$’ can be used with this meaning only at the end of the regular expression, or before ‘)’&#xA;  or ‘\|’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What these &quot;historical reasons&quot; are, I don't know. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to use &lt;code&gt;$&lt;/code&gt; and &lt;code&gt;^J&lt;/code&gt; you can replace &lt;code&gt;$^J&lt;/code&gt; with &lt;code&gt;\($\)^J&lt;/code&gt; and it will work as expected, though there is no need to express the end of a line in this redundant way.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-04-09T19:00:27.247" LastActivityDate="2015-04-09T19:00:27.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10594" PostTypeId="2" ParentId="10591" CreationDate="2015-04-09T18:36:56.323" Score="3" Body="&lt;p&gt;Note that the &lt;code&gt;$&lt;/code&gt; is redundant when used just before a &lt;code&gt;^J&lt;/code&gt; character (aka LF or newline or &lt;code&gt;\n&lt;/code&gt;).  So while @JordonBiondo has the right answer, I think a better alternative is to just ditch the &lt;code&gt;$&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-09T18:36:56.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10595" PostTypeId="1" AcceptedAnswerId="10614" CreationDate="2015-04-09T19:55:18.010" Score="14" ViewCount="1924" Body="&lt;p&gt;I saw some folks have a way to strike out &lt;code&gt;DONE&lt;/code&gt; items in &lt;code&gt;org-mode&lt;/code&gt;. How do you do that?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-04-10T14:03:13.540" LastActivityDate="2015-04-10T14:03:52.083" Title="How to Strike out DONE items in org-mode?" Tags="|org-mode|fonts|faces|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10596" PostTypeId="1" CreationDate="2015-04-09T21:03:55.120" Score="1" ViewCount="27" Body="&lt;p&gt;Say I have two directories &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;, with &lt;code&gt;A&lt;/code&gt; containing &lt;code&gt;B&lt;/code&gt;. Both &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; have directory local variables specified through their own &lt;code&gt;.dir-locals.el&lt;/code&gt; files. &lt;code&gt;B/.dir-locals.el&lt;/code&gt; whenever emacs visits a file in &lt;code&gt;B&lt;/code&gt;. However, I want emacs to load &lt;code&gt;B/.dir-locals.el&lt;/code&gt; and &lt;code&gt;A/.dir-locals.el&lt;/code&gt;. Is there a way to customize this behaviour? If not, how do I achieve this behaviour?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-04-09T21:03:55.120" Title="Using multiple .dir-locals.el" Tags="|directory-local-variables|" AnswerCount="0" CommentCount="0" ClosedDate="2015-04-09T21:27:27.947" ContentLicense="CC BY-SA 3.0" />
  <row Id="10597" PostTypeId="1" AcceptedAnswerId="10762" CreationDate="2015-04-09T21:38:30.220" Score="5" ViewCount="3301" Body="&lt;p&gt;Is it possible to refile a dated item into the appropriate place in a datetree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen some posts that describe the use of org-archive-location but I cannot get that to work - perhaps its the wrong thing to use?&lt;/p&gt;&#xA;" OwnerUserId="5463" LastActivityDate="2020-06-25T00:13:17.390" Title="How to refile into a datetree" Tags="|org-mode|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10598" PostTypeId="1" AcceptedAnswerId="10600" CreationDate="2015-04-09T22:05:09.057" Score="4" ViewCount="200" Body="&lt;p&gt;I want to open a file in &lt;code&gt;makefile-gmake&lt;/code&gt; mode.  Is there a way to do this from the command line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -m makefile-gmake filename&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not want to change any config files or embed a mode comment in the file itself.  I want a solution that works for any &lt;code&gt;filename&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6983" LastEditorUserId="25" LastEditDate="2015-05-10T15:38:36.577" LastActivityDate="2015-05-10T15:38:36.577" Title="How to specify the buffer mode on the command line?" Tags="|buffers|major-mode|command-line-arguments|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10599" PostTypeId="1" AcceptedAnswerId="12440" CreationDate="2015-04-09T22:07:20.827" Score="6" ViewCount="1790" Body="&lt;p&gt;It throws the error &lt;code&gt;After 0 kbd macro iterations: isearch-search: Keyboard macro terminated by a command ringing the bell&lt;/code&gt; and I have no idea why, nor can I find anything about it by searching. Any help?&lt;/p&gt;&#xA;" OwnerUserId="6986" LastActivityDate="2024-02-14T13:15:21.247" Title="Ringing Bell in Macro with Search" Tags="|search|isearch|keyboard-macros|bell|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10600" PostTypeId="2" ParentId="10598" CreationDate="2015-04-09T22:10:21.113" Score="6" Body="&lt;p&gt;You can use the &lt;code&gt;--eval&lt;/code&gt; command line argument:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs filename --eval &quot;(makefile-gmake-mode)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-09T22:10:21.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10601" PostTypeId="2" ParentId="10599" CreationDate="2015-04-09T23:03:35.963" Score="2" Body="&lt;p&gt;Admittedly, that message could be a little more clear. &quot;terminated by a command ringing the bell&quot; means a command went wrong during your macro (threw an error).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it happened during isearch, it probably just means the search failed during the keyboard macro. Redo the macro, being careful not to mistype anything during the search.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-04-09T23:03:35.963" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10602" PostTypeId="2" ParentId="2508" CreationDate="2015-04-09T23:27:48.217" Score="0" Body="&lt;p&gt;I took &lt;a href=&quot;https://emacs.stackexchange.com/a/2569/6987&quot;&gt;Billy Highlights' solution&lt;/a&gt; and modified the regular expression so it would correctly capture the printf format based on &lt;a href=&quot;http://www.cplusplus.com/reference/cstdio/printf/&quot; rel=&quot;nofollow noreferrer&quot;&gt;cplusplus.com&lt;/a&gt;. I used &lt;a href=&quot;http://regexlib.com/REDetails.aspx?regexp_id=3363&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; as a reference to get going.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'c-mode&#xA;  '((&quot;\\(\\\\\\).&quot; 1 'my-backslash-escape-backslash-face prepend)&#xA;    (&quot;\\\\\\(.\\)&quot; 1 'my-backslash-escape-char-face      prepend)&#xA;    (&quot;\\(%\\)\\(\\(\\([-0 #\\+]\\)?\\([0-9]+\\|\\*\\)?\\(\\.\\*\\|\\.[0-9]+\\)?\\([hljztL]\\|l\\{2\\}\\|h\\{2\\}\\)?\\([diuoxXfFeEgGaAcspn]\\)\\)\\|%\\)&quot;&#xA;      (1 'my-format-code-format-face         prepend)&#xA;      (2 'my-format-code-directive-face      prepend))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6987" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-04-09T23:27:48.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10603" PostTypeId="1" CreationDate="2015-04-10T01:04:05.657" Score="0" ViewCount="140" Body="&lt;p&gt;What should I do? After just updating packages my &lt;em&gt;Emacs&lt;/em&gt; installation does not initialise. I tried the same process in two Macs with the same result. The error message (using &lt;code&gt;--debug-init&lt;/code&gt;) is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Debugger entered--Lisp error: (void-variable left)&#xA;  powerline-reset()&#xA;  require(powerline)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-583073&amp;gt; nil &quot;/Users/sergiobacelar/.emacs.d/starter-kit-misc.el&quot; nil t)  ; Reading at buffer position 2361&#xA;  load-with-code-conversion(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-misc.el&quot; &quot;/Users/sergiobacelar/.emacs.d/starter-kit-misc.el&quot; nil nil)&#xA;  load(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-misc.el&quot; nil nil t)&#xA;  load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-misc.el&quot;)&#xA;  org-babel-load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-misc.org&quot;)&#xA;  starter-kit-load(&quot;starter-kit-misc.org&quot;)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-903092&amp;gt; nil &quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; nil t)  ; Reading at buffer position 3819&#xA;  load-with-code-conversion(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; &quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; nil nil)&#xA;  load(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; nil nil t)&#xA;  load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot;)&#xA;  org-babel-load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.org&quot;)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/Users/sergiobacelar/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 2725&#xA;  load-with-code-conversion(&quot;/Users/sergiobacelar/.emacs.d/init.el&quot; &quot;/Users/sergiobacelar/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/Users/sergiobacelar/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\262�    \306=\203�\307\310Q\202;�   \311=\204�\307\312Q\202;�\313\307\314\315#\203*�\316\202;�\313\307\314\317#\203:�\320\nB\321\202;�\316\322\323\322\211#\210\322=\203a�\324\325\326\307\327Q!\&quot;\323\322\211#\210\322=\203`�\210\203\243�\330!\331\232\203\243�\332!\211\333P\334!\203}�\211\202\210�\334!\203\207�\202\210�\314\262\203\241�\335\&quot;\203\237�\336\337#\210\340\341!\210\266\f?\205\260�\314\323\342\322\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; (initialization &quot;`_emacs' init file is deprecated, please use `.emacs'&quot;) &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7 &quot;\n\n(fn)&quot;]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6988" LastActivityDate="2015-04-10T02:43:22.523" Title="Emacs installation does not initialise after updating packages" Tags="|init-file|package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10604" PostTypeId="2" ParentId="10603" CreationDate="2015-04-10T02:10:25.117" Score="1" Body="&lt;p&gt;Well generally speaking, updating software (any software) might break things if the newer version has bugs or other incompatibilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a new version of something isn't working, and you don't want to go through the process of reporting a bug (or debugging it yourself), then you should simply revert back to the working version and maybe try again sometime in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're just updating for the sake of updating, you should probably expect this sort of thing to happen from time to time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you're using MELPA as a package repository, you should treat those packages as (potentially) unstable code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I recommend keeping your .emacs.d directory under version control, as it makes reverting any and all changes trivial. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Failing that, it looks like Emacs asks&lt;sup&gt;1&lt;/sup&gt; whether you want to delete the old package after installing an update. Obviously you should be answering &quot;no&quot; if you don't yet know whether the new one works, as it's then simple to delete the new package directory in order to restore the older one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; on the dev version I'm running, at least.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-04-10T02:43:22.523" LastActivityDate="2015-04-10T02:43:22.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10605" PostTypeId="2" ParentId="10254" CreationDate="2015-04-10T05:36:49.093" Score="1" Body="&lt;p&gt;Once you have a region, you can use &lt;code&gt;C-x C-x&lt;/code&gt; ('exchange-point-and-mark') to restore your point, for example, &lt;code&gt;C-SPC C-e C-x C-x&lt;/code&gt; should do what you want.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-04-10T05:36:49.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10606" PostTypeId="1" CreationDate="2015-04-10T06:05:22.667" Score="1" ViewCount="1261" Body="&lt;p&gt;I am using Emacs (v24.4) for writing Java applications. I have created a Java library that I am building using Gradle (v2.2) and testing with Spock Framework where I have all my test cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to debug my Java code using Emacs. However, I haven't found any way of doing this. I would like to set a breakpoint and step through my Java code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my Gradle build file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply plugin: 'java'&#xA;apply plugin: 'groovy'&#xA;&#xA;repositories {&#xA;    mavenCentral()&#xA;}&#xA;&#xA;dependencies {&#xA;    compile 'org.igniterealtime.smack:smack-core:4.1.0'&#xA;    compile 'org.igniterealtime.smack:smack-tcp:4.1.0'&#xA;&#xA;    testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'&#xA;    testCompile 'org.codehaus.groovy:groovy:2.3.6'&#xA;}&#xA;&#xA;jar {&#xA;    baseName = 'SunSmackClient'&#xA;    version = '1.0.0'&#xA;}&#xA;&#xA;gradle.projectsEvaluated {&#xA;    tasks.withType(JavaCompile) {&#xA;        options.compilerArgs &amp;lt;&amp;lt; '-Xlint:unchecked'&#xA;   }&#xA;}&#xA;&#xA;task wrapper(type: Wrapper) {&#xA;    gradleVersion = '2.1'&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example Spock Framework test:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-java prettyprint-override&quot;&gt;&lt;code&gt;public class SmackClientSpec extends Specification {&#xA;    private SmackClient smackClient;&#xA;&#xA;    /* Test 1 */&#xA;    @IgnoreRest&#xA;    def 'Create a connection to XMPP server'() {&#xA;        setup: /* Setup connection object */&#xA;&#xA;        def domain = 'domain'  &#xA;        def username = 'username'&#xA;        def password = 'password'&#xA;&#xA;        SmackClient smackClient = new SmackClient()&#xA;&#xA;        expect: /* Connection to return true */&#xA;        smackClient.createConnection(domain, username, password) == true&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="6990" LastEditorUserId="504" LastEditDate="2015-04-10T09:41:12.257" LastActivityDate="2024-03-21T01:04:00.547" Title="Debugging and setting breakpoints in Java code built with Gradle" Tags="|debugging|java|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10607" PostTypeId="1" AcceptedAnswerId="12831" CreationDate="2015-04-10T08:29:48.533" Score="2" ViewCount="240" Body="&lt;p&gt;I'm struggling again with &lt;code&gt;Emacs 24.4&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt; (version 8.3beta (release_8.3beta-1013-g187dae`` @ c:/Users/mbec.POLYWBR/Documents/sorga/org-mode/org_current/lisp/)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having problem with paths like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[[file+sys:\\servername.domain.de\dir\]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which produce the error &lt;strong&gt;&quot;No such file c:/servername.domain.de/dir/&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So org-mode seems to replace \ by / and then create a local path on my hard disk c: instead of resolving the path to the network server correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone else work on Windows in a Windows Server network environment with similar paths and can tell me how to set things up correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Remark:&lt;/em&gt; &lt;strong&gt;in dired+ it works well&lt;/strong&gt;:&lt;br&gt;&#xA;if I launch &lt;code&gt;M-x RET dired&lt;/code&gt; and then paste a path like &lt;code&gt;\\server.domain.de\dir1\dir2&lt;/code&gt; , &lt;code&gt;dired&lt;/code&gt; seems to convert it to &lt;code&gt;//server.domain.de/dir1/dir2&lt;/code&gt;and opens the right directory&lt;/p&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2377" LastEditDate="2015-06-02T12:09:11.643" LastActivityDate="2015-06-02T12:09:11.643" Title="Problems with backslashes in hyperlinks in Emacs org-mode on Windows" Tags="|org-mode|microsoft-windows|hyperlinks|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10608" PostTypeId="2" ParentId="10099" CreationDate="2015-04-10T09:54:01.333" Score="4" Body="&lt;p&gt;If you just want to put a tag-like message when exporting plain lists, you can define a macro like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: tag @@latex:\hfill{}\textsc{$1}@@ @@html:&amp;amp;#xa0;&amp;amp;#xa0;&amp;amp;#xa0;&amp;lt;span class=&quot;tag&quot;&amp;gt;&amp;lt;span class=&quot;$1&quot;&amp;gt;$1&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;@@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And use it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading with its real tag  :mytag:&#xA;  - Plain list item with its simulated tag  {{{tag(mytag)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is only useful to get a message similar to a tag when exporting to PDF/Latex or HTML, of course it is not a real Org tag.&lt;/p&gt;&#xA;" OwnerUserId="6994" LastEditorUserId="6994" LastEditDate="2015-04-10T14:57:51.807" LastActivityDate="2015-04-10T14:57:51.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10609" PostTypeId="1" AcceptedAnswerId="10619" CreationDate="2015-04-10T13:35:46.253" Score="1" ViewCount="154" Body="&lt;p&gt;Every time I use the command &lt;code&gt;helm-list-elisp-packages&lt;/code&gt; it downloads all the index files from melpa, gnu etc. Is there a way to make it rely on the previous cache of the index files ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there is &lt;code&gt;package-list-packages-no-fetch&lt;/code&gt; which does what I want but it doesn't have the nice helm interface.&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2015-04-10T18:23:18.590" Title="make helm-list-elisp-packages use cache" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10610" PostTypeId="1" AcceptedAnswerId="10613" CreationDate="2015-04-10T13:43:06.927" Score="1" ViewCount="1023" Body="&lt;p&gt;For instance, let's say I have the following block of code in a buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pattern TTF_STYLE_NORMAL = #{const TTF_STYLE_NORMAL}&#xA;pattern TTF_STYLE_BOLD = #{const TTF_STYLE_BOLD}&#xA;pattern TTF_STYLE_ITALIC = #{const TTF_STYLE_ITALIC}&#xA;pattern TTF_STYLE_STRIKETHROUGH = #{const TTF_STYLE_STRIKETHROUGH}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to convert it into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pattern TTF_STYLE_NORMAL        = #{const TTF_STYLE_NORMAL}&#xA;pattern TTF_STYLE_BOLD          = #{const TTF_STYLE_BOLD}&#xA;pattern TTF_STYLE_ITALIC        = #{const TTF_STYLE_ITALIC}&#xA;pattern TTF_STYLE_STRIKETHROUGH = #{const TTF_STYLE_STRIKETHROUGH}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I need some way of saying &lt;em&gt;align this block into columns divided by the &lt;code&gt;=&lt;/code&gt; character&lt;/em&gt;. Ideally, I'd like to be able to do the same thing with multiple delimiter characters, like splitting on a &lt;code&gt;-&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I accomplish this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there's a minor mode for it - great! Code samples welcome also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="278" LastActivityDate="2015-04-10T13:56:47.783" Title="How do I align a block of text into columns?" Tags="|align|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10611" PostTypeId="1" AcceptedAnswerId="13678" CreationDate="2015-04-10T13:48:39.883" Score="63" ViewCount="18329" Body="&lt;p&gt;I've been using magit for a few months now and I like it a lot. But one thing I still do it in a terminal is cherry picking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a simple way to do this?&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2021-11-24T04:32:34.903" Title="How to easily cherry pick with magit?" Tags="|magit|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10612" PostTypeId="2" ParentId="10611" CreationDate="2015-04-10T13:54:34.043" Score="9" Body="&lt;p&gt;I don't use cherry picking, but hitting &lt;code&gt;?&lt;/code&gt; in &lt;code&gt;magit-status&lt;/code&gt; shows &lt;code&gt;y: Cherry&lt;/code&gt;. This runs the command &lt;code&gt;magit-cherry&lt;/code&gt;, which lets you pick a head and an upstream. It sounds like this is what you want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can type &lt;code&gt;C-h r d m Magit RET&lt;/code&gt; to read the Magit manual. You can use &lt;code&gt;C-s cherry&lt;/code&gt; and repeated hit &lt;code&gt;C-s&lt;/code&gt; to search through the manual. Looks like the info is in section 23:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One of the comforts of &lt;code&gt;git&lt;/code&gt; is that it can tell you which commits have&#xA;  been merged upstream but not locally and vice versa.  Git's sub-command&#xA;  for this is &lt;code&gt;cherry&lt;/code&gt; (not to be confused with &lt;code&gt;cherry-pick&lt;/code&gt;).  Magit has&#xA;  support for this by invoking &lt;code&gt;magit-cherry&lt;/code&gt; which is bound to &lt;code&gt;y&lt;/code&gt; by&#xA;  default.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Magit will then ask you first for the upstream revision (which&#xA;  defaults to the currently tracked remote branch if any) and the head&#xA;  revision (which defaults to the current branch) to use in the&#xA;  comparison.  You will then see a new buffer in which all commits are&#xA;  listed with a directional marker, their revision and the commit&#xA;  message's first line.  The directional marker is either &lt;code&gt;+&lt;/code&gt; indicating a&#xA;  commit that's present in upstream but not in head or &lt;code&gt;-&lt;/code&gt; which indicates&#xA;  a commit present in head but not in upstream.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;From this list you can use the usual key bindings for cherry-picking&#xA;  individual commits (&lt;code&gt;a&lt;/code&gt; for cherry-picking without committing and &lt;code&gt;A&lt;/code&gt;&#xA;  for the same plus the automatic commit).&lt;/strong&gt; The buffer is refreshed&#xA;  automatically after each cherry-pick.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="654" LastEditorUserId="504" LastEditDate="2015-04-10T14:40:53.267" LastActivityDate="2015-04-10T14:40:53.267" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10613" PostTypeId="2" ParentId="10610" CreationDate="2015-04-10T13:56:47.783" Score="3" Body="&lt;p&gt;I should have googled a bit more before asking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can align the code by selecting it and applying &lt;code&gt;align-regexp&lt;/code&gt; with an argument of &lt;code&gt;=&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to give a potentially better and/or more detailed answer, I'll accept it.&lt;/p&gt;&#xA;" OwnerUserId="278" LastActivityDate="2015-04-10T13:56:47.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10614" PostTypeId="2" ParentId="10595" CreationDate="2015-04-10T14:03:52.083" Score="10" Body="&lt;p&gt;If of use: I came across &lt;a href=&quot;http://sachachua.com/blog/2012/12/emacs-strike-through-headlines-for-done-tasks-in-org/&quot;&gt;Sacha's post&lt;/a&gt; that talks about how to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the code in her post and on the feedback from the comments, I now use the code below (I have a light theme). You may note lazy loading, this prevents an 'undefined' error at start up as per a comment in original blog post:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/modify-org-done-face ()&#xA;  (setq org-fontify-done-headline t)&#xA;  (set-face-attribute 'org-done nil :strike-through t)&#xA;  (set-face-attribute 'org-headline-done nil&#xA;                      :strike-through t&#xA;                      :foreground &quot;light gray&quot;))&#xA;&#xA;(eval-after-load &quot;org&quot;&#xA;  (add-hook 'org-add-hook 'my/modify-org-done-face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-04-10T14:03:52.083" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10615" PostTypeId="1" AcceptedAnswerId="10617" CreationDate="2015-04-10T14:20:57.480" Score="6" ViewCount="2290" Body="&lt;p&gt;In order to test that some code handles an invalid UTF-8 sequence properly, I need to insert an invalid UTF-8 sequence into an existing text file.  However, my attempts to do so result in a valid UTF-8 sequence, not an invalid one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The byte 0xff is always invalid in UTF-8, so I tried to insert it, following the instructions on the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Inserting-Text.html&quot; rel=&quot;nofollow&quot;&gt;&quot;Inserting Text&quot;&lt;/a&gt; page of the Emacs manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c-q 377 &amp;lt;RET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A funny-looking character got inserted into the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-OP INC       ÿ3713 SOUTHS&#xA;              ^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I examine the contents of the file using the Unix command &lt;code&gt;od -c &amp;lt;path&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0001240   C  \t 303 277   3   7   1   3       S   O   U   T   H   S   H&#xA;                ^^^ ^^^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can see that a valid UTF-8 sequence 303 277 (octal) has been inserted, not the single byte 377 that I tried to insert.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I insert an invalid UTF-8 sequence into a file?&lt;/p&gt;&#xA;" OwnerUserId="6996" LastEditorUserId="6996" LastEditDate="2015-04-23T13:02:12.113" LastActivityDate="2015-04-23T13:02:12.113" Title="How to insert invalid UTF-8 sequence" Tags="|character-encoding|unicode|insert|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10616" PostTypeId="2" ParentId="10500" CreationDate="2015-04-10T14:27:59.613" Score="-6" Body="&lt;p&gt;No, you might don't need GNU ELPA or any ELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The practical reason not to use GNU ELPA or any third party repository is to protect my Emacs from ELPA shut down. Shutdown did happen from time to time (see &lt;a href=&quot;https://www.reddit.com/r/emacs/search/?q=elpa%20down&amp;amp;restrict_sr=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.reddit.com/r/emacs/search/?q=elpa%20down&amp;amp;restrict_sr=1&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of my packages are downloaded from https//melpa.org , I could avoid GNU ELPA by creating a small local package mirror of selected GNU ELPA packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check my setup at &lt;code&gt;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-elpa.el&lt;/code&gt;, GNU ELPA is not used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have to use some GNU ELPA only packages, I'd rather create my own local ELPA instead (it's as simple as create a text file &lt;code&gt;archive-contents&lt;/code&gt;), Check my &lt;code&gt;~/.emacs.d/localelpa&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;seq-2.20.tar&lt;/code&gt; only exist at GNU ELPA and I need this it. So I add this package into my local elpa at &lt;code&gt;https://github.com/redguardtoo/emacs.d/tree/master/localelpa&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I only use four packages from GNU ELPA,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnu-elpa-keyring-update-2019.3.tar&#xA;let-alist-1.0.5.el&#xA;seq-2.20.tar&#xA;undo-tree-20170706.246.tar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These packages are placed in my &lt;code&gt;localelpa&lt;/code&gt; so I don't need access GNU ELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also check my package &lt;a href=&quot;https://github.com/redguardtoo/elpa-mirror&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/elpa-mirror&lt;/a&gt; which creates a local repository from installed packages. So even remote repository (GNU ELPA, MELPA) is optional now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use source instead downloaded package. Please check &lt;a href=&quot;https://github.com/redguardtoo/emacs.d/tree/master/site-lisp&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/tree/master/site-lisp&lt;/a&gt;. &lt;code&gt;rainbow-mode&lt;/code&gt;, You need understand what's &lt;code&gt;load-path&lt;/code&gt; (&lt;a href=&quot;http://emacswiki.org/emacs/LoadPath&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emacswiki.org/emacs/LoadPath&lt;/a&gt;) if you use source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also advice &lt;code&gt;package--add-to-archive-contents&lt;/code&gt; to tweak packages before they are displayed in package manager. This is kind of undocumented hack. It works from Emacs 23.4 to Emacs 27. See &lt;code&gt;init-elpa.el&lt;/code&gt; for example.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2019-08-01T08:04:08.023" LastActivityDate="2019-08-01T08:04:08.023" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="10617" PostTypeId="2" ParentId="10615" CreationDate="2015-04-10T14:48:26.360" Score="5" Body="&lt;p&gt;After some trial and error, I managed to convert &lt;code&gt;ÿ&lt;/code&gt; to the byte 377 using &lt;code&gt;M-x recode-region&lt;/code&gt;, specifying that it was really in &lt;code&gt;raw-text&lt;/code&gt; but was interpreted as &lt;code&gt;latin-1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When saving the file, Emacs didn't want to save it as UTF-8, offering to save it as &lt;code&gt;raw-text&lt;/code&gt; instead, which seems to have had the desired effect.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-04-10T14:48:26.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10618" PostTypeId="2" ParentId="10607" CreationDate="2015-04-10T14:51:25.630" Score="1" Body="&lt;p&gt;I can't test this, but try&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[[file+sys:\\\\servername.domain.de\dir\]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[[file+sys:\\\\servername.domain.de\\dir\\]]&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2015-04-10T14:51:25.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10619" PostTypeId="2" ParentId="10609" CreationDate="2015-04-10T14:59:45.510" Score="1" Body="&lt;p&gt;Actually, &lt;code&gt;helm-list-elisp-package&lt;/code&gt; already does what you want: it only downloads descriptions of all configured ELPA packages for the first time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even without downloading, It may still looks slow because of a great number of packages. In this case, you can use &lt;code&gt;helm-resume&lt;/code&gt; to resurrect previously invoked &lt;code&gt;helm-list-elisp-package&lt;/code&gt;, it is much faster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please also see the implementation of &lt;code&gt;helm-list-elisp-package&lt;/code&gt; and the docstring of &lt;code&gt;helm-resume&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't fetch the updated list of packages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-list-elisp-packages-no-fetch ()&#xA;  (interactive)&#xA;  (setq helm-el-package--initialized-p t)&#xA;  (helm-list-elisp-packages nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do fetch the updated list of packages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u M-x helm-list-elisp-packages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Only fetch for the first time during one Emacs session and don't refetch for the rest time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x helm-list-elisp-packages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-04-10T18:23:18.590" LastActivityDate="2015-04-10T18:23:18.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10620" PostTypeId="2" ParentId="10549" CreationDate="2015-04-10T15:22:11.497" Score="37" Body="&lt;h1&gt;&lt;code&gt;org-mode&lt;/code&gt; exports &lt;code&gt;_&lt;/code&gt; as subscripts and &lt;code&gt;^&lt;/code&gt; as superscripts&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The default export behavior can be &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-customize.html&quot; rel=&quot;noreferrer&quot;&gt;customized&lt;/a&gt; using the menus &lt;code&gt;Org -&amp;gt; Customize -&amp;gt; Browse Org Group&lt;/code&gt;.&#xA;To update the default behavior for subscripts &amp;amp; superscripts, choose:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;[-]-\ Group Org Export&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;[-]-\ Group Org Export General&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&amp;#x2014; Option Org Export With Sub Superscripts&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Org Export With Sub Superscripts Examples&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;Examples&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Interpret them - Default&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Underscore_subscript becomes Underscore&lt;sub&gt;subscript&lt;/sub&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hat^superscript becomes Hat&lt;sup&gt;superscript&lt;/sup&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Curly brackets only&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Underscore_WithCurlyBrackets_{subscript} becomes Underscore_WithCurlyBrackets&lt;sub&gt;subscript&lt;/sub&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hat^WithCurlyBrackets^{superscript} becomes Hat^WithCurlyBrackets&lt;sup&gt;superscript&lt;/sup&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do not interpret them&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Underscore_subscript becomes Underscore_subscript&lt;/li&gt;&#xA;&lt;li&gt;Hat^superscript becomes Hat^superscript&lt;/li&gt;&#xA;&lt;li&gt;Underscore_WithCurlyBrackets_{subscript} becomes Underscore_WithCurlyBrackets_{subscript}&lt;/li&gt;&#xA;&lt;li&gt;Hat^WithCurlyBrackets^{superscript} becomes Hat^WithCurlyBrackets^{superscript}&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you don't want to mess around with settings, the quick and easy solution is to disable superscripts and subscripts by setting export option for &lt;code&gt;^&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. &lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;To disable superscripts and subscripts, add the following lines to your org file:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: ^:nil&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2019-03-11T17:15:23.547" LastActivityDate="2019-03-11T17:15:23.547" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="10621" PostTypeId="1" CreationDate="2015-04-10T15:23:21.323" Score="6" ViewCount="1921" Body="&lt;p&gt;So I'm looking for some insight into how to customize my ibuffer window. I don't know much lisp but have a decent amount of emacs experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried solving it based on some google searches:&lt;br/&gt;&#xA;&lt;a href=&quot;http://emacswiki.org/emacs/IbufferMode#toc10&quot;&gt;http://emacswiki.org/emacs/IbufferMode#toc10&lt;/a&gt; &lt;br/&gt;&#xA;&lt;a href=&quot;http://www.emacswiki.org/emacs/DiredMode&quot;&gt;http://www.emacswiki.org/emacs/DiredMode&lt;/a&gt;&lt;br/&gt;&#xA;and a few more links. I've tried various combinations of the tools they describe, but nothing does exactly what I want, which is roughly a combination of sorting by pathname, and filter groups. However, instead of predefined 'saved-filter-groups', I want to have filter groups based on the directory structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally my ibuffer would display directory names as filter groups, and then sort the files alphabetically within each group. Also if possible, I would like the named directory filter groups to only display up to 3 parent directory levels&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the buffers I have open are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/SomeDir/Foo/Bar/a/file_1a.js&#xA;~/SomeDir/Foo/Bar/a/file_2a.js&#xA;~/SomeDir/Foo/Bar/b/file_1b.js&#xA;~/SomeDir/Foo/Bar/b/file_2b.js&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then my ibuffer window would look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ .../Foo/Bar/a ]&#xA;  file_1a.js&#xA;  file_2a.js&#xA;[ .../Foo/Bar/b ]&#xA;  file_1b.js&#xA;  file_2b.js&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While I'd love a complete solution, any insight or resources you could point me towards would be nice too.&lt;/p&gt;&#xA;" OwnerUserId="6998" LastEditorUserId="105" LastEditDate="2023-11-23T02:20:08.047" LastActivityDate="2023-11-23T02:20:08.047" Title="How to get ibuffer to use directory tree as filter groups" Tags="|dired|ibuffer|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10622" PostTypeId="2" ParentId="10621" CreationDate="2015-04-10T16:46:28.720" Score="0" Body="&lt;p&gt;Here's a solution offered by &lt;a href=&quot;http://blog.puercopop.com/post/47260064349/emacs-grouping-by-projects-in-ibuffer&quot; rel=&quot;nofollow&quot;&gt;puercopop&lt;/a&gt; that I've been using, which works pretty well.  I've modified it slightly in the following rehash (reproduced here to sidestep possible link rot):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; create a &quot;default&quot; placeholder to build the filter groups&#xA;(setf ibuffer-saved-filter-groups (quote ((&quot;default&quot;))))&#xA;&#xA;;; replace the PROJECTS directory with whatever you like&#xA;(cl-dolist (dir (directory-files &quot;~/projects/&quot;))&#xA;  (when (not (member dir '(&quot;.&quot; &quot;..&quot;)))&#xA;    (setf (car ibuffer-saved-filter-groups)&#xA;          (append (car ibuffer-saved-filter-groups)&#xA;                  `((,dir&#xA;                     (filename . ,(expand-file-name&#xA;                                   dir &quot;~/projects/&quot;))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-10T16:46:28.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10623" PostTypeId="1" AcceptedAnswerId="10626" CreationDate="2015-04-10T16:52:09.927" Score="4" ViewCount="765" Body="&lt;p&gt;I installed helm and projectile and added the following to my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm)&#xA;(projectile-global-mode)&#xA;(setq projectile-completion-system 'helm)&#xA;(helm-projectile-on)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get this error when I startup emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: helm-projectile-on&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="7001" LastActivityDate="2015-04-10T19:40:04.930" Title="helm-projectile startup issue" Tags="|helm|projectile|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10624" PostTypeId="2" ParentId="10615" CreationDate="2015-04-10T17:50:48.037" Score="9" Body="&lt;p&gt;&lt;code&gt;C-q 377 RET&lt;/code&gt; inserts the character with octal code 377 (aka LATIN SMALL LETTER Y WITH DIAERESIS).  If you want to insert a byte instead of a character, you can do it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (insert (unibyte-string #o377)) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @legoscia mentioned, Emacs will probably ask you to use another coding system after inserting such a character, but you can choose &lt;code&gt;utf-8&lt;/code&gt; at that prompt anyway.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-10T17:50:48.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10625" PostTypeId="1" AcceptedAnswerId="10656" CreationDate="2015-04-10T19:17:50.970" Score="6" ViewCount="839" Body="&lt;p&gt;In a Microsoft-centric workplace, I use task attachments &lt;em&gt;heavily&lt;/em&gt; to store emails, design documents, and the like.  Especially with email attachments, I'll usually open up the task's attachment folder (&lt;code&gt;C-c C-a f&lt;/code&gt;) and simply drag the relevant emails to the folder (which conveniently also copies all of &lt;em&gt;its&lt;/em&gt; attachments &lt;code&gt;:)&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Org isn't the one adding attachments, the &lt;code&gt;ATTACH&lt;/code&gt; tag is often missing.  As I move around attachments and tasks, I'll also move their attachments appropriately, sometimes emptying the folder.  This causes &lt;code&gt;ATTACH&lt;/code&gt; to become a false-positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can synchronize the presence of the &lt;code&gt;ATTACH&lt;/code&gt; tag with the presence of actual attachments?  As an added bonus, can I also update the &lt;code&gt;:Attachments:&lt;/code&gt; property with the appropriate file list?  (It helps with searching.)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2022-10-15T15:18:36.580" Title="How can I update ATTACH tags in org-mode to reflect reality?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10626" PostTypeId="2" ParentId="10623" CreationDate="2015-04-10T19:40:04.930" Score="3" Body="&lt;p&gt;You must add &lt;code&gt;(require 'helm-projectile)&lt;/code&gt; and make sure to install &lt;code&gt;helm-projectile&lt;/code&gt;. It's a package of its own. &lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-04-10T19:40:04.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10627" PostTypeId="2" ParentId="10621" CreationDate="2015-04-10T19:57:29.293" Score="0" Body="&lt;p&gt;Here are some hints: First you need to write a filter, which will match members of one of the desired groups, i.e. by directory-name.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-ibuffer-filter directory-name&#xA;    &quot;Filter by directory-name `equal'ity.&quot;&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you need to write some function, which will setup &lt;code&gt;ibuffer-filter-groups&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ibuffer-filter-groups&#xA;      ((&quot;abbrev-dir1&quot; (directory-name . &quot;dir1&quot;))&#xA;       (&quot;abbrev-dir2&quot; (directory-name . &quot;dir2&quot;))&#xA;       ....))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, where dir1, dir2, etc. are the directories occuring in the ibuffer buffer (see e.g. &lt;code&gt;ibuffer-map-lines&lt;/code&gt;).  Finally use &lt;code&gt;ibuffer-update&lt;/code&gt; to display the groups.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-04-10T19:57:29.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10628" PostTypeId="1" AcceptedAnswerId="10630" CreationDate="2015-04-10T20:42:25.437" Score="20" ViewCount="3107" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; what is the idiomatic way to map a function across a property list?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The various mapping functions (&lt;code&gt;mapcar&lt;/code&gt; and family) map a function over a sequence such as a list.  How does one use these functions when dealing with a &lt;em&gt;property&lt;/em&gt; list, i.e., when trying to map across each of the properties contained in the list (which would be every other element starting from the first one)?  It seems to me that the mapping function would need to access the list in pairs of elements rather than as individual elements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a toy example, how would one take a property list and collect all of the property values?  If it were an association list instead it would be pretty simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar #'cadr '((:prop1 a) (:prop2 b) (:prop3 c))) ;=&amp;gt; (a b c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm sure this could be done with a loop, but it seems a little laborious and I'm wondering if there's a more idiomatic way to do it.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="105" LastEditDate="2015-07-11T04:44:01.850" LastActivityDate="2016-01-12T01:55:47.903" Title="Map a function across a property list?" Tags="|elisp|mapping|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10629" PostTypeId="2" ParentId="10628" CreationDate="2015-04-10T21:40:00.217" Score="5" Body="&lt;p&gt;To me the answer is to turn the plist into an alist, which is an equivalent data-structure, just half as deep and easier to manipulate.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-10T21:40:00.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10630" PostTypeId="2" ParentId="10628" CreationDate="2015-04-10T21:52:51.867" Score="9" Body="&lt;p&gt;You will likely get various &lt;code&gt;loop&lt;/code&gt; and iteration answers. AFAIK, there is no idiomatic way to do this. I don't even think it's very common to want to accumulate only the property values (not associating them with the properties).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one simple way to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun prop-values (plist)&#xA;  &quot;...&quot;&#xA;  (let ((pl    (cdr plist))&#xA;        (vals  ()))&#xA;    (while pl&#xA;      (push (car pl) vals)&#xA;      (setq pl  (cddr pl)))&#xA;    (nreverse vals)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the more general case, where you want to map a binary function over a plist:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun map-plist (fn plist)&#xA;  &quot;...&quot;&#xA;  (let ((pl    plist)&#xA;        (vals  ()))&#xA;    (while pl&#xA;      (push (funcall fn (car pl) (cadr pl)) vals)&#xA;      (setq pl (cddr pl)))&#xA;    (nreverse vals)))&#xA;&#xA;(setq foo '(a 1 b 2 c 3 d 4 e 5))&#xA;&#xA;(map-plist #'cons foo) ; =&amp;gt; ((a . 1) (b . 2) (c . 3) (d . 4) (e . 5))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:16:00.820" LastActivityDate="2015-05-09T20:16:00.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10631" PostTypeId="2" ParentId="10207" CreationDate="2015-04-11T01:41:30.333" Score="1" Body="&lt;p&gt;According to punchagan, the org2blog maintainer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You'll need to use a backtick instead of a quote (when setting&#xA;  org2blog/wp-blog-alist) to evaluate the expressions following a comma.&#xA;  See the 2nd example in the README.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; org2blog/wp-confirm-post t&#xA; org2blog/wp-blog-alist&#xA; `(&#xA;   (&quot;example1&quot;&#xA;    :url &quot;http://www.example.com/xmlrpc.php&quot;&#xA;    :username ,(car (auth-source-user-and-password &quot;example.com&quot;))&#xA;    :password ,(cadr (auth-source-user-and-password &quot;example.com&quot;))&#xA;    :default-title &quot;Hello, World!&quot;&#xA;    :default-categories (&quot;Uncategorized&quot;)&#xA;    )&#xA;   (&quot;example2&quot;&#xA;    :url &quot;http://www.example2.com/xmlrpc.php&quot;&#xA;    :username ,(car (auth-source-user-and-password &quot;example2.com&quot;))&#xA;    :password ,(cadr (auth-source-user-and-password &quot;example2.com&quot;))&#xA;    :default-title &quot;Hello, World!&quot;&#xA;    :default-categories (&quot;Uncategorized&quot;)&#xA;    )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Oh, the backtick!&lt;/p&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2015-04-11T01:41:30.333" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10632" PostTypeId="1" CreationDate="2015-04-11T05:18:07.320" Score="4" ViewCount="1564" Body="&lt;p&gt;I have a latex document in which there are many incorrectly Capitalized words. Could anybody suggest a clever regex to track them? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even better if there is a function which cycles through such words corrects them by asking yes or no.&lt;/p&gt;&#xA;" OwnerUserId="224" LastEditorUserId="105" LastEditDate="2015-04-12T14:37:34.010" LastActivityDate="2015-04-12T19:24:43.863" Title="Search for and correct capitalized words that are not at the beginning of a sentence" Tags="|regular-expressions|search|replace|capitalization|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10633" PostTypeId="2" ParentId="10632" CreationDate="2015-04-11T06:36:48.427" Score="4" Body="&lt;p&gt;One suggestion might be to do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Lower-case all capitalized words.  E.g., &lt;code&gt;C-x h&lt;/code&gt; &lt;code&gt;M-x downcase-region&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Capitalize all words that begin a sentence.  Function &lt;code&gt;sentence-end&lt;/code&gt; returns a regexp that matches sentence ends - you can adapt that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;query-replace-regexp&lt;/code&gt; is your friend. You can even replace subgroup matches with text produced or transformed by a Lisp sexp. See &lt;code&gt;C-h f query-replace-regexp&lt;/code&gt;, argument &lt;code&gt;TO-STRING&lt;/code&gt;.  (There is also the similar command &lt;code&gt;replace-regexp&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For #1, you could use a regexp such as &lt;code&gt;\([A-Z]\)\([a-z]*\)&lt;/code&gt; and a &lt;code&gt;TO-STRING&lt;/code&gt; such as &lt;code&gt;\,(downcase \1)\2&lt;/code&gt;.  (But if you don't need to check each candidate you can just use &lt;code&gt;M-x downcase-region&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This command will pretty much do it (without querying):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun capitalize-only-sentence-starts ()&#xA;  (interactive)&#xA;  (downcase-region (point-min) (point-max))&#xA;  (let* ((sent-end    (sentence-end))&#xA;         (sent-start  (format &quot;%s\\([a-z]\\)&quot; sent-end)))&#xA;    (while (re-search-forward sent-start nil t)&#xA;      ;; Replace 3rd subgroup match by its uppercase equivalent.&#xA;      (replace-match (upcase (match-string 3)) nil nil nil 3))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That will capitalize only sentence starts that appear after sentence ends, so it won't pick up the very first sentence start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note too that function &lt;code&gt;sentence-end&lt;/code&gt; matches sentence endings that are defined by these user options:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sentence-end&#xA;sentence-end-base      &#xA;sentence-end-double-space&#xA;sentence-end-without-period&#xA;sentence-end-without-space&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my case, &lt;code&gt;(sentence-end)&lt;/code&gt; returns this, which is why I used &lt;code&gt;(match-string 3)&lt;/code&gt; above, to pick up the sentence start char:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\([.?!][]\&quot;'”)}]*\\($\\|[  ]$\\|  \\|[  ][  ]\\)\\|[。．？！]+\\)[    \n]*&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That has 2 subgroups (0 is for the whole match, 1 for the first subgroup match, 2 is for the second).  The third subgroup for the full regexp is from &lt;code&gt;sent-start&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But here is a simpler command. ;-)  The sentence-end regexp is handled for you, by &lt;code&gt;backward-sentence&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun capitalize-only-sentence-starts ()&#xA;  (interactive)&#xA;  (downcase-region (point-min) (point-max))&#xA;  (save-excursion&#xA;    (goto-char (point-max))&#xA;    (while (not (bobp))&#xA;      (backward-sentence)&#xA;      (save-excursion (capitalize-word 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-11T08:03:06.653" LastActivityDate="2015-04-11T08:03:06.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10634" PostTypeId="2" ParentId="10628" CreationDate="2015-04-11T09:02:48.250" Score="13" Body="&lt;p&gt;This would probably depend on a situation. In general, if I need to tie a number of values with a number of names, I'd use a hash-table, but if I have to use a property list, I'd use &lt;code&gt;cl-loop&lt;/code&gt;. Below are some examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-loop for (key value) on '(:prop1 a :prop2 b :prop3 c) by 'cddr&#xA;         collect value)&#xA;;;; (a b c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if you have a data-structure you show in your example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-loop for (key value) in '((:prop1 a) (:prop2 b) (:prop3 c))&#xA;         collect value)&#xA;;;; (a b c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-04-11T09:02:48.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10636" PostTypeId="1" CreationDate="2015-04-11T11:43:55.003" Score="10" ViewCount="689" Body="&lt;p&gt;I've got multiple source blocks which are all tangled to the same file. When I invoke &lt;code&gt;C-c '&lt;/code&gt; inside one block, only this specific block is shown in a new buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a possibility to show all parts of this file inside this buffer (instead of just this specific snippet)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+begin_src emacs-lisp :tangle foo.el&#xA;(defvar *ok* &quot;&quot;)&#xA;#+end_src&#xA;&#xA;This is where the variable is stored...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+begin_src emacs-lisp :tangle foo.el&#xA;(defun add-one (n) (+ 1 n))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I hit &lt;code&gt;C-c '&lt;/code&gt; in the first block I get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar *ok* &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar *ok* &quot;&quot;)&#xA;(defun add-one (n) (+ 1 n))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7005" LastEditorUserId="12497" LastEditDate="2019-05-23T17:13:46.783" LastActivityDate="2019-08-18T20:41:58.783" Title="Editing multiple source blocks in one buffer" Tags="|org-mode|org-babel|text-editing|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="10637" PostTypeId="2" ParentId="10222" CreationDate="2015-04-11T13:58:26.307" Score="5" Body="&lt;p&gt;Here's an example of how you can do something like this. Note,&#xA;however, that it displays exactly what you asked for (percentage of&#xA;text above the window), which is probably not what you actually want.&#xA;For instance, it never displays &lt;code&gt;100%&lt;/code&gt;, since there will always be&#xA;some text inside the window.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar mode-line-position&#xA;        '(:eval (format &quot;%3d%%&quot; (/ (window-start) 0.01 (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also use &lt;code&gt;window-end&lt;/code&gt;, which has the opposite disadvantage&#xA;(it almost never displays 0).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar mode-line-position&#xA;        '(:eval (format &quot;%3d%%&quot; (/ (window-end) 0.01 (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may want to sorround these strings with spaces or some other padding.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="675" LastEditDate="2015-05-12T21:25:29.117" LastActivityDate="2015-05-12T21:25:29.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10638" PostTypeId="1" AcceptedAnswerId="10639" CreationDate="2015-04-11T14:05:03.067" Score="5" ViewCount="159" Body="&lt;p&gt;I like &lt;code&gt;recentf&lt;/code&gt; and like &lt;code&gt;jump-to-register&lt;/code&gt;, &lt;code&gt;ibuffer&lt;/code&gt;, &lt;code&gt;ido-switch-buffer&lt;/code&gt; but during code investigation I need a lot of switching between already visited points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having short memory I like reviewing possibilities through list of available options, like that provide &lt;code&gt;recentf&lt;/code&gt;. But that all lack support for positioning across files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems that this known as bookmarking and I read &lt;code&gt;(elisp)Bookmarks&lt;/code&gt; and try most promising &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot;&gt;http://www.emacswiki.org/emacs/BookmarkPlus&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That bookmarking packages provide persistent storage and simple interface to select the bookmarks but I don't like type bookmark name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually name can be easy derived from context - in RST mode - this is section title, in C/ELisp - function name, in Info - page title... For C++/Java I like to see also enclosing context - namespece and package path (through CEDET or other sources).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any implementation or support from another packages (or extension point) to get automatically named bookmarks?&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2015-04-14T13:23:52.273" Title="Bookmarks mode with quick selection list and autodetected names from context?" Tags="|bookmarks|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10639" PostTypeId="2" ParentId="10638" CreationDate="2015-04-11T15:20:18.393" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; already provides &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#AutonamedBookmarks&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;automatically named bookmarks&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, the names used do not come from RST mode section titles etc., however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x p RET&lt;/code&gt; creates a bookmark at point without prompting you for the name. By default, it is named using the &lt;em&gt;current buffer name&lt;/em&gt; preceded by the &lt;em&gt;position&lt;/em&gt; in the buffer. For example, the autonamed bookmark in buffer &lt;code&gt;foo.el&lt;/code&gt; at position 58356 is called &lt;code&gt;000058356 foo.el&lt;/code&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can customize the format of autonamed bookmarks using options &lt;code&gt;bmkp-autoname-bookmark-function&lt;/code&gt; and &lt;code&gt;bmkp-autoname-format&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also define your own bookmark types, and a jump command that is specific to only bookmarks of that type.  There are many &lt;strong&gt;Bookmark+&lt;/strong&gt; jump commands that are specific to &lt;strong&gt;Bookmark+&lt;/strong&gt; bookmark types.  You can control the naming and any other bookmark attributes when you define a bookmark type.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also easily rename bookmarks.  So you could use autonamed bookmarks with the default names or other names to start with, and then systematically rename them according to your own design. (If your design can fit with customization of options &lt;code&gt;bmkp-autoname-bookmark-function&lt;/code&gt; and &lt;code&gt;bmkp-autoname-format&lt;/code&gt; then you would not need to rename, of course.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can define a particular set of bookmarks to use as the completion candidates for choosing a bookmark name when jumping to a bookmark.  That is, you can define a bookmark jump command whose candidates are from a limited set, not all bookmarks.  Completion is very quick. It is not related to automatic naming, but can mean more time saved.     &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="2710" LastEditDate="2015-04-14T13:23:52.273" LastActivityDate="2015-04-14T13:23:52.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10640" PostTypeId="1" CreationDate="2015-04-11T16:17:55.290" Score="0" ViewCount="233" Body="&lt;p&gt;I have a mac-book-air. I swapped my Alt  &amp;amp; Win with xmodmap as per &lt;a href=&quot;https://unix.stackexchange.com/questions/86933/swap-alt-and-super#_=_&quot;&gt;linux post&lt;/a&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;keycode 64 = Alt_L&#xA;keycode 133 = Super_L&#xA;remove Mod1 = Alt_L&#xA;remove Mod4 = Super_L&#xA;add Mod1 = Super_L&#xA;add Mod4 = Alt_L&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I apply it via: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xmodmap xmodmap.file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now my Alt+tab works properly, but in Emacs meta(alt) and Super(cmd) are not swapped. I.e, s-x and M-x are not swapped. After 3 hours of googling around I've not made more progress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any tips/advise/things to try? (I'm very desperate). &#xA;Is it possible to re-map these from inside emacs itself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background:&lt;br&gt;&#xA; - I'm using MATE Desktop.&#xA; - I tried Gnome Tweak Tool to swap alt &amp;amp; cmd, but it doesn't seem to function under MATE Desktop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;br&gt;&#xA;- This issue occurs only in GUI version of emacs. In terminal it get's the right keys.&lt;br&gt;&#xA;- I have tried re-starting emacs, restarting system, applying the change then start emacs. No Luck.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-04-11T21:51:41.770" LastActivityDate="2015-04-11T21:51:41.770" Title="Emacs does not use swapped alt&amp;win after xmodmap runs? (GUI emacs)" Tags="|package|package-repositories|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10641" PostTypeId="1" AcceptedAnswerId="12921" CreationDate="2015-04-11T17:31:37.407" Score="2" ViewCount="3059" Body="&lt;p&gt;Somewhere long ago I read I could use additional latex packages in org-mode using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-packages-alist '())&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;color&quot; t))&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;physics&quot; t))&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;mathtools&quot; t))&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;xfrac&quot; t))&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;siunitx&quot; t))&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;mhchem&quot; t))&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;fontenc&quot; t))&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;multirow&quot; t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After updating my system I noticed latex images weren't being rendered. Investigating in &lt;code&gt;/tmp&lt;/code&gt;, I discovered that &lt;code&gt;mhchem&lt;/code&gt; wanted me to specify it's version number.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&#xA;!&#xA;! mhchem error: &quot;options/no-version&quot;&#xA;! &#xA;! You did not specify a 'version' option for the mhchem package. Please write&#xA;! \usepackage[version=3]{mhchem} in your preamble (or any lower number for&#xA;! compatibility mode).&#xA;! &#xA;! See the mhchem documentation for further information.&#xA;! &#xA;! Type &amp;lt;return&amp;gt; to continue.&#xA;!...............................................  &#xA;&#xA;l.2971   }&#xA;&#xA;? &#xA;! Emergency stop.&#xA;!...............................................  &#xA;&#xA;l.2971   }&#xA;&#xA;|'''''''''''''''''''''''''''''''''''''''''''''''&#xA;| LaTeX does not know anything more about this error, sorry.&#xA;| &#xA;| Try typing &amp;lt;return&amp;gt; to proceed.&#xA;| If that doesn't work, type X &amp;lt;return&amp;gt; to quit.&#xA;|...............................................&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By educated guess and trial and error, I determined I needed to put &lt;code&gt;version=3&lt;/code&gt; in the first set of quotations. I was wondering if this was documented anywhere?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-06-06T08:30:44.147" Title="Specifying version when using extra latex packages with org mode" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10642" PostTypeId="1" AcceptedAnswerId="10654" CreationDate="2015-04-12T00:28:30.640" Score="7" ViewCount="237" Body="&lt;p&gt;To speed up visually scanning my org file I would like to add icons to my headings. I am using 16x16 images which seem to fit well with the size of the font, but the images always appear slightly offset, lower than they should be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this expected behavior? Is there a way to fix it so it is vertically aligned with the text? Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/MDQaz.png&quot; alt=&quot;example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-04-13T06:00:13.557" Title="Inline images appear shifted down relative to text" Tags="|org-mode|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10643" PostTypeId="2" ParentId="10632" CreationDate="2015-04-12T00:37:25.853" Score="4" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can do what you want pretty much directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can search only for &lt;em&gt;uppercase letters that do not start a sentence&lt;/em&gt;.  And you can &lt;em&gt;replace them by their lowercase equivalents&lt;/em&gt; -- either selectively or all at once. You do this using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles search&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the building blocks:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You define a set of &lt;strong&gt;search contexts&lt;/strong&gt; - using a regexp, for example.&#xA;In this case, you define the search-context regexp so that it matches an uppercase letter that follows a sentence end.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;But those are &lt;em&gt;not&lt;/em&gt; the contexts that you want to search - you want the opposite. So you tell Icicles that from now on (until you toggle it again) you are searching the contexts that are defined not by matches of that regexp but by its &lt;em&gt;non&lt;/em&gt;-matches.  That is, you search the &lt;strong&gt;complement&lt;/strong&gt; of the zones defined by the regexp matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this using &lt;code&gt;C-c `&lt;/code&gt; &lt;strong&gt;&lt;code&gt;C-M-~&lt;/code&gt;&lt;/strong&gt; &lt;code&gt;C-g&lt;/code&gt;.  The &lt;code&gt;C-c `&lt;/code&gt; invokes Icicles search.  The &lt;code&gt;C-M-~&lt;/code&gt; tells it to toggle complementing, and the &lt;code&gt;C-g&lt;/code&gt; exits.  (All this accomplishes is to toggle the default value of variable &lt;code&gt;icicle-search-complement-domain-p&lt;/code&gt;, turning it on - you can do that using &lt;code&gt;setq&lt;/code&gt;, if you prefer.  This is a one-time thing - it stays on until you toggle it again, with &lt;code&gt;C-M-~&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You tell Icicles that when you ask for an on-demand replacement you want to replace only the part that matches your current minibuffer input, not the whole search context (actually its complement, in this case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You do this explicitly once, because replacing the whole search candidate is the default behavior.  You can do it during Icicles search, using &lt;strong&gt;&lt;code&gt;M-_&lt;/code&gt;&lt;/strong&gt;, or you can just set option &lt;code&gt;icicle-search-replace-whole-candidate-flag&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You tell Icicles that, when you ask for to replace a match, the replacement is computed using function &lt;code&gt;downcase&lt;/code&gt;.  That is, you will replace a given match by its lowercase version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as for vanilla Emacs &lt;code&gt;query-replace&lt;/code&gt;, replacement can use a literal string or it can use special constructs such as &lt;code&gt;\&amp;amp;&lt;/code&gt;, &lt;code&gt;\1&lt;/code&gt;, &lt;code&gt;\,(something)&lt;/code&gt;.  But unlike &lt;code&gt;query-replace&lt;/code&gt; you can also specify a function that computes the replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this by just requesting to replace, using &lt;code&gt;C-S-RET&lt;/code&gt;.  When you first try to replace, Icicles prompts you for the replacement to use.  However, the replacement is usually a string, just as for &lt;code&gt;query-replace-regexp&lt;/code&gt; (the same string constructs are supported).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in this less common case you want to instead tell Icicles to compute the replacement from the match using &lt;strong&gt;function&lt;/strong&gt; &lt;code&gt;downcase&lt;/code&gt;.  To be prompted for a replacement function and not for a replacement string, you need to use &lt;code&gt;C-u&lt;/code&gt;: &lt;strong&gt;&lt;code&gt;C-u C-S-RET&lt;/code&gt;&lt;/strong&gt;.  You can change the replacement anytime, using &lt;strong&gt;&lt;code&gt;M-,&lt;/code&gt;&lt;/strong&gt; (or &lt;code&gt;C-u M-,&lt;/code&gt;, for a function) - you are prompted similarly.  (You can also use a &lt;code&gt;lambda&lt;/code&gt; form as the replacement function.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All of the above is essentially just setup!  You've told Icicles what kind of search-and-replace you want to perform.  (You could encapsulate all of that in a specialized &lt;code&gt;icicle-search&lt;/code&gt; command - just bind &lt;code&gt;icicle-search-complement-domain-p&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, &lt;code&gt;icicle-search-replace-whole-candidate-flag&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Now you are ready to search and replace.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-c `&lt;/code&gt;&lt;/strong&gt; invokes command &lt;code&gt;icicle-search&lt;/code&gt;.  It prompts you for a context-defining regexp and which subgroup to use to define the context.  In this case, you enter (a) a regexp that matches the end of a sentence followed by an uppercase letter, and (b) the number of the subgroup that matches only the uppercase-letter part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regexp you want is the value of &lt;code&gt;(sentence-end)&lt;/code&gt; followed by &lt;code&gt;\\([A-Z]\\)&lt;/code&gt;.  In my Emacs this is the giant regexp, and it is the 3rd subgroup that matches the letter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\([.?!][]&quot;'”)}]*\($\|[  ]$\|    \|[  ][  ]\)\|[。．？！]+\)[&#xA;]*\([A-Z]\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A simpler version of such a regexp would be just this: &lt;strong&gt;&lt;code&gt;.&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;?&lt;/code&gt;&lt;/strong&gt;, or &lt;strong&gt;&lt;code&gt;!&lt;/code&gt;&lt;/strong&gt;, followed by two spaces, followed by an uppercase letter.  (In this case you would use subgroup 2, not 3, to match the uppercase letter.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\([.?!][ ][ ]\)\([A-Z]\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can set a Lisp variable to the regexp string, and then use the variable to insert the regexp in the minibuffer when prompted for the regexp (notice the doubling of backslashes for a Lisp string): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo &quot;\\([.?!][ ][ ]\\)\\([A-Z]\\)&quot;) ; With this, use subgroup 2.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Icicles, whenever you use &lt;strong&gt;&lt;code&gt;C-u C-=&lt;/code&gt;&lt;/strong&gt; in the minibuffer you are prompted for a string-valued &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Inserting_a_Regexp_from_a_Variable_or_Register&quot; rel=&quot;nofollow&quot;&gt;variable whose value you want to insert&lt;/a&gt;.  In this case you enter &lt;code&gt;foo&lt;/code&gt; and the regexp is inserted as if you had typed it.  (If you put the regexp in variable &lt;code&gt;icicle-input-string&lt;/code&gt; then you do not need to use &lt;code&gt;C-u&lt;/code&gt;, and you are not prompted.  You can also insert a string from a register, using &lt;code&gt;C-x r i&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After you enter the regexp and the subgroup that define the search contexts, you type text to search for within the contexts.  In this case, you type &lt;code&gt;[A-Z]&lt;/code&gt;, meaning that you want to match uppercase letters within the search contexts.  (You don't hit &lt;code&gt;RET&lt;/code&gt; - that would exit completion and Icicles search.  You can dynamically change the text you want to match.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The search contexts act as &lt;em&gt;completion candidates&lt;/em&gt; - all search hits.  In this case, they are the zones of text in between the zones of uppercase letters that follow a sentence end.  The current set of candidates is filtered by whatever input pattern you have typed in the minibuffer.  Use &lt;strong&gt;&lt;code&gt;S-TAB&lt;/code&gt;&lt;/strong&gt; to show the candidates in buffer &lt;code&gt;*Completions*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parts of each search candidate that you are interested in (because you will replace them) are the pieces that match your minibuffer input - the uppercase letters that do not begin a sentence.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can cycle among all search hits, visiting them in turn, or you can navigate directly to any of them.  (You can even sort them.)  Use &lt;strong&gt;&lt;code&gt;C-down&lt;/code&gt;&lt;/strong&gt; to cycle.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can &lt;em&gt;replace individual matches&lt;/em&gt; of your minibuffer input (&lt;code&gt;[A-Z]&lt;/code&gt;), or you can replace all of them, i.e., downcase them all at once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To replace them all, just hit &lt;strong&gt;&lt;code&gt;M-|&lt;/code&gt;&lt;/strong&gt;.  (You can hit &lt;code&gt;C-g&lt;/code&gt; to exit searching.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To replace an individual match, or several in sequence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you are at any given search hit (again: a zone of text that does not include an uppercase letter at the beginning of a sentence), you can tell Icicles to replace the parts of the hit that match your minibuffer input, which is &lt;code&gt;[A-Z]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You do this using &lt;strong&gt;&lt;code&gt;C-S-RET&lt;/code&gt;&lt;/strong&gt;.  Just repeat it to change each match within the search candidate - and on to the next candidate.  That is , you can keep hitting &lt;code&gt;C-S-RET&lt;/code&gt; to continue replacing matches within the next candidate, and the next.  (IOW, you do not need to hit &lt;code&gt;C-down&lt;/code&gt; to go to the next candidate - &lt;code&gt;C-S-RET&lt;/code&gt; does that after you replace the last match in the previous candidate.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Whew!  That's a lot to write and read.  &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search-And-Replace&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is probably a better explanation.  Hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-12T00:37:25.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10644" PostTypeId="1" CreationDate="2015-04-12T01:12:12.947" Score="7" ViewCount="706" Body="&lt;p&gt;Emac's &lt;code&gt;backward-kill-word&lt;/code&gt; tends to delete more than I want.&lt;br&gt;&#xA;E.g when I press delete multiple times on this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)   ;heading search. |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)   ;heading|&#xA;2. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)   ;|&#xA;3. (key-chord &quot;qf&quot; 'helm-org-in-buffer-|   &amp;lt;&amp;lt;&amp;lt; too much deletion. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expected this in the 3rd step:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;3. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to know:&#xA;- Is there a philosophy behind deleting more than what's wanted?&lt;br&gt;&#xA;- Can I make emac's backward-delete-word more friendly? I.e, remove white spaces but don't kill off 'too' much?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; &#xA;I don't really know 'what' I want. Maybe make it more like other delet functions like in google-keep or other text editing applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit2&lt;/strong&gt;&lt;br&gt;&#xA;In the mean time, lawlist fixed up his custom function which works rather well: &lt;a href=&quot;https://emacs.stackexchange.com/questions/10644/backward-kill-word-ignores-whitespaces-is-there-another-friendlier-version&quot;&gt;enter link description here&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-04-13T13:56:09.007" Title="backward-kill-word ignores whitespaces, is there another friendlier version?" Tags="|deletion|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10645" PostTypeId="1" CreationDate="2015-04-12T01:37:23.373" Score="1" ViewCount="76" Body="&lt;p&gt;I'm trying to create &lt;code&gt;paredit&lt;/code&gt; functionality for TeX modes and I'd &lt;em&gt;really&lt;/em&gt; like to avoid actually rewriting &lt;code&gt;paredit.el&lt;/code&gt;.  (I've spent a good portion of the day doing this with no significant progress.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had figured &lt;code&gt;paredit&lt;/code&gt; would simply look at the syntax table for its open/close paren bits, but this appears to not be the case.  Is there a way to alter &lt;code&gt;paredit&lt;/code&gt; variables to get the result I need, or is there perhaps another, more minimalistic minor mode I can use?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-04-12T01:37:23.373" Title="Can I make paredit work with only braces {…} instead of other parens?" Tags="|paredit|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10646" PostTypeId="2" ParentId="10644" CreationDate="2015-04-12T04:58:24.073" Score="4" Body="&lt;p&gt;The behaviour of &lt;code&gt;backward-kill-word&lt;/code&gt; depends on the definition of a &quot;word&quot; in the current mode.  You can either change this definition and risk breaking stuff or you could modify &lt;code&gt;kill-word&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;backward-kill-word&lt;/code&gt; is just &lt;code&gt;kill-word&lt;/code&gt; with a negative argument; &lt;code&gt;kill-word&lt;/code&gt; is &lt;code&gt;kill-region&lt;/code&gt; over the region spanned by point and the position after running &lt;code&gt;(forward-word arg)&lt;/code&gt;.  Replacing &lt;code&gt;forward-word&lt;/code&gt; temporarily should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I'm temporarily replacing &lt;code&gt;forward-word&lt;/code&gt; with &lt;code&gt;forward-same-syntax&lt;/code&gt; to achieve the desired effect in &lt;code&gt;backward-kill-word&lt;/code&gt; (and &lt;code&gt;kill-word&lt;/code&gt; because I like things to be consistent):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/kill-word-advice (orig-fun &amp;amp;rest args)&#xA;  &quot;Replace forward-word with forward-same-syntax.&quot;&#xA;  (cl-letf (((symbol-function 'forward-word) #'forward-same-syntax))&#xA;    (apply orig-fun args)))&#xA;(advice-add 'kill-word :around #'my/kill-word-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the behaviour is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)   ;heading|&#xA;2. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)   ;|&#xA;3. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)   |&#xA;4. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings)|&#xA;5. (key-chord &quot;qf&quot; 'helm-org-in-buffer-headings|&#xA;5. (key-chord &quot;qf&quot; 'helm-org-in-buffer-|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-04-12T04:58:24.073" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10647" PostTypeId="1" AcceptedAnswerId="10672" CreationDate="2015-04-12T15:17:14.453" Score="2" ViewCount="398" Body="&lt;p&gt;I would like to increase my font size, so I used the &lt;code&gt;C-x C-=&lt;/code&gt; keybinding, followed by &lt;code&gt;=&lt;/code&gt; to further increase the size. However, it stops zooming far too soon, and I realized that I can only cycle through 8 levels of zoom. I can zoom in twice past default and zoom out 5 times past default. Is there a way to increase the zoom range? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, when I continue trying to zoom (by pressing &lt;code&gt;=&lt;/code&gt;) after reaching the max zoom level, I am unable to zoom out (by pressing &lt;code&gt;-&lt;/code&gt;) until I press &lt;code&gt;-&lt;/code&gt; the same number of times that I pressed &lt;code&gt;=&lt;/code&gt;. For example, if at my max zoom level, I push &lt;code&gt;=&lt;/code&gt; three times, I must push &lt;code&gt;-&lt;/code&gt; three times with no results before I can push &lt;code&gt;-&lt;/code&gt; again to zoom out. It seems as if the zoom levels are being recorded, but not rendered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the command that I am using via &lt;code&gt;C-h k C-x C-=&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-= runs the command text-scale-adjust, which is an interactive&#xA;autoloaded compiled Lisp function in `face-remap.el'.&#xA;&#xA;It is bound to C-x C-0, C-x C-=, C-x C--, C-x C-+.&#xA;&#xA;(text-scale-adjust INC)&#xA;&#xA;Adjust the height of the default face by INC.&#xA;&#xA;INC may be passed as a numeric prefix argument.&#xA;&#xA;The actual adjustment made depends on the final component of the&#xA;key-binding used to invoke the command, with all modifiers removed:&#xA;&#xA;   +, =   Increase the default face height by one step&#xA;   -      Decrease the default face height by one step&#xA;   0      Reset the default face height to the global default&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="105" LastEditDate="2018-03-08T14:40:10.960" LastActivityDate="2018-03-08T14:40:10.960" Title="Zooming / font sizes / text scaling has a very limited range?" Tags="|fonts|scaling|zooming|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10648" PostTypeId="1" AcceptedAnswerId="21337" CreationDate="2015-04-12T15:52:30.813" Score="2" ViewCount="271" Body="&lt;p&gt;This is something I asked on the &lt;a href=&quot;https://github.com/Malabarba/smart-mode-line/issues/129&quot; rel=&quot;nofollow&quot;&gt;official repository&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, &lt;code&gt;smart-mode-line&lt;/code&gt; displays the current projectile project-name before the buffer-name, and the &lt;code&gt;vc-mode&lt;/code&gt; string after it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;... [P/myproject]BUFFER-NAME :master ...  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to combine the project name and the branch together, and&#xA;display them both before the buffer-name.&lt;br&gt;&#xA;Here is what I want to achieve:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;... [myproject:master]BUFFER-NAME ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="50" LastEditDate="2015-04-12T19:50:52.790" LastActivityDate="2016-04-01T13:17:07.527" Title="How to add branch label next to projectile string with smart-mode-line" Tags="|mode-line|projectile|vc-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10649" PostTypeId="2" ParentId="10638" CreationDate="2015-04-12T17:29:17.617" Score="0" Body="&lt;p&gt;&lt;code&gt;semantic-mru-bookmark-mode&lt;/code&gt; is interesting thing but UI is very limiting in compare to &lt;code&gt;bookmark+&lt;/code&gt;. It has &lt;code&gt;C-x B&lt;/code&gt; key binding only in buffers that have &lt;code&gt;semantic&lt;/code&gt; enabled and completion through minibufer. For Java code its name is package+class without method name ((&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2015-04-12T17:34:22.870" LastActivityDate="2015-04-12T17:34:22.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10650" PostTypeId="1" AcceptedAnswerId="10663" CreationDate="2015-04-12T17:39:47.030" Score="4" ViewCount="411" Body="&lt;p&gt;I am trying to set a variable for ESS.  This is how I load ESS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ess / try to not (require 'ess-site) as it slows down start-up&#xA;(autoload 'R-mode &quot;ess-site.el&quot; &quot;Major mode for editing R source.&quot; t)&#xA;(autoload 'Rd-mode &quot;ess-rd&quot; &quot;Major mode for editing R documentation.&quot; t)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.[rR]\\'&quot; . R-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.[Rr]out&quot; . R-transcript-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rd\\'&quot; . Rd-mode))&#xA;(add-to-list 'interpreter-mode-alist '(&quot;Rscript&quot; . R-mode))&#xA;(add-to-list 'interpreter-mode-alist '(&quot;r&quot; . R-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;ess&quot;&#xA;  '(progn&#xA;     (setq inferior-R-args &quot;--no-save --quiet&quot;)))&#xA;&#xA;(eval-after-load &quot;ess-site&quot;&#xA;  '(progn&#xA;     (setq inferior-R-args &quot;--no-save --quiet&quot;)))&#xA;&#xA;(add-hook 'ess-mode-hook&#xA;          (lambda ()&#xA;            (setq inferior-R-args &quot;--no-save --quiet&quot;)))&#xA;&#xA;(setq inferior-R-args &quot;--no-save --quiet&quot;)&#xA;&#xA;(setq-default inferior-R-args &quot;--no-save --quiet&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But none works.  When ESS starts, the value of &lt;code&gt;inferior-R-args&lt;/code&gt; is &lt;code&gt;&quot;&quot;&lt;/code&gt;.&#xA;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2016-04-19T21:54:44.807" Title="setting inferior-R-args variable in init.el has no effect" Tags="|init-file|ess|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10651" PostTypeId="2" ParentId="10632" CreationDate="2015-04-12T19:04:35.453" Score="3" Body="&lt;p&gt;Here is another way to search for uppercase letters that do not start a sentence, and replace them by lowercase on demand (selective occurrences or all).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use this method you need libraries  &lt;a href=&quot;http://www.emacswiki.org/emacs/download/isearch-prop.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/download/isearch%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;isearch+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; - see &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;code&gt;isearch-prop.el&lt;/code&gt; lets you add properties to zones of your buffer.  And it lets you search only such propertied zones.  Or it lets you search the complement: the zones that do &lt;strong&gt;NOT&lt;/strong&gt; have a given property. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, you will search the zones that do not have uppercase letters at the beginning of a sentence.  You will search the zones for an uppercase letter. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;code&gt;isearch+.el&lt;/code&gt; lets you replace the current search hit (or all subsequent search hits) on demand.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here we go:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x isearchp-regexp-context-regexp-search&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are prompted for a regexp that defines the zones to search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You enter: &lt;strong&gt;&lt;code&gt;\([.?!][ ][ ]\)\([A-Z]\)&lt;/code&gt;&lt;/strong&gt;, which means end of sentence followed by an uppercase letter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are prompted for the subgroup that corresponds to the part of the regexp you want to match.  You enter: &lt;strong&gt;&lt;code&gt;2&lt;/code&gt;&lt;/strong&gt;, because &lt;code&gt;\([A-Z]\)&lt;/code&gt; is the second subgroup, and its matches are what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are prompted for a predicate, to further filter the set of zones.  Just hit &lt;code&gt;RET&lt;/code&gt; without typing any predicate name - no predicate needed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-M-~&lt;/code&gt;&lt;/strong&gt;, which means search not the zones defined by that regexp, but the rest of the text (i.e., the complement).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Type &lt;strong&gt;&lt;code&gt;.&lt;/code&gt;&lt;/strong&gt; to search the zones (for any char besides newline).  (You could type &lt;strong&gt;&lt;code&gt;[A-Z]&lt;/code&gt;&lt;/strong&gt;, to search for an uppercase letter, but the zones as defined contain only uppercase letters.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-u C-M-RET&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;isearchp-replace-on-demand&lt;/code&gt;), to replace the current search hit.  The plain prefix arg (&lt;code&gt;C-u&lt;/code&gt;) means replace (only) the current hit.  You can also use:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A negative prefix arg (e.g. &lt;code&gt;C--&lt;/code&gt;), to make search keys (e.g. &lt;code&gt;C-s&lt;/code&gt;)&#xA;replace search hits you visit, from now on.  They thus act the same as &lt;code&gt;C-M-RET&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A positive prefix arg &lt;code&gt;N&lt;/code&gt;, to replace &lt;code&gt;N&lt;/code&gt; search hits.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A zero prefix arg (e.g. &lt;code&gt;C-0&lt;/code&gt;), to replace &lt;strong&gt;all&lt;/strong&gt; remaining search&#xA;hits.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No prefix arg, to just &lt;em&gt;delete&lt;/em&gt; the current hit.  You are not prompted for a replacement.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You are prompted for the replacement text to use.  Just like &lt;code&gt;query-replace&lt;/code&gt;, you can use &lt;code&gt;\,&lt;/code&gt; to define the replacement. In this case, you enter &lt;strong&gt;&lt;code&gt;\,(downcase \0)&lt;/code&gt;&lt;/strong&gt;.  The &lt;code&gt;\0&lt;/code&gt; means that you want to act on the whole search hit, which in this case is a single uppercase character.  The replacement will be the downcased character.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-s&lt;/code&gt; to continue regexp searching, i.e., move to the next hit.  If you want to replace it, hit &lt;code&gt;C-M-RET&lt;/code&gt;; if not, use &lt;code&gt;C-s&lt;/code&gt; to move on to the next hit.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Repeat #5.  You can also use &lt;code&gt;C-0 C-M-RET&lt;/code&gt; to just replace &lt;em&gt;all&lt;/em&gt; remaining search hits at once.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In case you are wondering what this has to do with &lt;strong&gt;properties&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/download/isearch-prop.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/a&gt; lets you work with any text or overlay properties.  But for the particular command used here, &lt;code&gt;isearchp-regexp-context-regexp-search&lt;/code&gt;, the text property used is the Lisp &lt;em&gt;symbol&lt;/em&gt; whose name is the regexp.  The&#xA;property value is a cons whose car is the regexp (a string) and whose&#xA;cdr is the predicate, which together define the zones. This way, you can have various sets of zones corresponding to different regexps and predicates.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-12T19:24:43.863" LastActivityDate="2015-04-12T19:24:43.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10652" PostTypeId="2" ParentId="10647" CreationDate="2015-04-12T19:32:06.457" Score="2" Body="&lt;p&gt;Do you see the same problem when you start Emacs using &lt;code&gt;emacs -Q&lt;/code&gt;? I doubt it. If so, and if your Emacs version is recent, report the problem: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, then recursively bisect your init file to determine the culprit. You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment out a region of text (and with &lt;code&gt;C-u&lt;/code&gt; it uncomments a region).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(With &lt;code&gt;emacs -Q&lt;/code&gt;, I see virtually no limit on zooming size.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-12T19:32:06.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10653" PostTypeId="2" ParentId="8057" CreationDate="2015-04-12T20:17:49.910" Score="2" Body="&lt;p&gt;As @kaushalmodi explained, you can do this with the &lt;code&gt;customize&lt;/code&gt; interface. For the safe of completion, the answer to your original question is that &quot;loading&quot; a library always refers to calling &lt;code&gt;load&lt;/code&gt; or &lt;code&gt;require&lt;/code&gt; on it. So, in you case, the &lt;code&gt;setq&lt;/code&gt; needs to come before the &lt;code&gt;require&lt;/code&gt; (that's what the docstring is telling you).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq outline-minor-mode-prefix &quot;\M-#&quot;)&#xA;(require 'outshine)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-04-12T20:23:30.513" LastActivityDate="2015-04-12T20:23:30.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10654" PostTypeId="2" ParentId="10642" CreationDate="2015-04-12T20:33:52.903" Score="5" Body="&lt;p&gt;Create the image with an&lt;code&gt;:ascent&lt;/code&gt; property of value &lt;code&gt;center&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Advising &lt;code&gt;org-display-inline-images&lt;/code&gt; might be a way of doing this in &lt;code&gt;org-mode&lt;/code&gt;, though it will apply to all images.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-display-inline-images (around center-images activate)&#xA;  (let ((create-image-orig (symbol-function 'create-image)))&#xA;    (cl-letf (((symbol-function 'create-image)&#xA;               (lambda (file-or-data &amp;amp;optional type data-p &amp;amp;rest props)&#xA;                 (apply create-image-orig file-or-data type data-p&#xA;                        (plist-put props :ascent 'center)))))&#xA;      ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-04-13T06:00:13.557" LastActivityDate="2015-04-13T06:00:13.557" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10655" PostTypeId="1" CreationDate="2015-04-12T21:28:26.370" Score="5" ViewCount="157" Body="&lt;p&gt;After editing a couple of encrypted files with Emacs and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/epa.html&quot;&gt;EasyPG Assistant&lt;/a&gt; I realized that parts of those files were still stored in various lists within Emacs, e.g the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Kill-Ring.html&quot;&gt;kill-ring&lt;/a&gt; and the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-History.html&quot;&gt;minibuffer history&lt;/a&gt;. This, along with things like &lt;a href=&quot;http://emacswiki.org/emacs/SaveHist&quot;&gt;savehist&lt;/a&gt;, increases the chances of sensitive information leaking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to specify that history should be handled differently for some buffers? E.g. that they should each have their own &lt;code&gt;kill-ring&lt;/code&gt; and minibuffer history that is purged on buffer close and not actually stored anywhere?&lt;/p&gt;&#xA;" OwnerUserId="7016" LastActivityDate="2015-05-13T10:21:20.963" Title="Specifying how history is managed for each buffer" Tags="|minibuffer|history-variables|encryption|history|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10656" PostTypeId="2" ParentId="10625" CreationDate="2015-04-13T03:11:00.973" Score="5" Body="&lt;p&gt;There is a function &lt;code&gt;org-attach-sync&lt;/code&gt; that claims to do this, but it seems to be expecting you to keep your attachments in a git repository, which you may not be doing (I don't).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, here's a function that uses &lt;code&gt;org-attach-file-list&lt;/code&gt; to look at the list of attachments and change things appropriately.  The &lt;code&gt;:ATTACH:&lt;/code&gt; tag will be toggled and the &lt;code&gt;Attachments&lt;/code&gt; property will be updated or deleted.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-sync-attachments ()&#xA;  &quot;Update the current entry's attachment metadata.&quot;&#xA;  (interactive)&#xA;  (let* ((attachments (if (org-attach-dir)&#xA;                         (org-attach-file-list (org-attach-dir)))&#xA;                     )&#xA;        (tag-state (if attachments 'on 'off)))&#xA;&#xA;    (if attachments &#xA;        (org-set-property org-attach-file-list-property&#xA;                          (mapconcat #'url-encode-url&#xA;                                     attachments &quot; &quot;))&#xA;      (org-delete-property org-attach-file-list-property))&#xA;    (org-toggle-tag org-attach-auto-tag tag-state)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-04-13T20:55:14.623" LastActivityDate="2015-04-13T20:55:14.623" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10657" PostTypeId="2" ParentId="10655" CreationDate="2015-04-13T09:21:09.470" Score="1" Body="&lt;p&gt;Based on the comments to my question, I was able to come up with a (partial?) solution:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a list of variables with sensitive information.&lt;/li&gt;&#xA;&lt;li&gt;Create a function that makes them local to a buffer.&lt;/li&gt;&#xA;&lt;li&gt;Create another function that sets them to &lt;code&gt;nil&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Add a &lt;code&gt;find-file-hook&lt;/code&gt; to conditionally call the first function.&lt;/li&gt;&#xA;&lt;li&gt;Add a &lt;code&gt;kill-buffer-hook&lt;/code&gt; to conditionally call  the second function.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The Emacs Lisp code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq private-variable-list '(kill-ring minibuffer-history&#xA;                              regexp-search-ring search-ring))&#xA;&#xA;(defun setup-private-buffer ()&#xA;  &quot;Enhance the privacy of the current buffer&quot;&#xA;  (interactive)&#xA;  (dolist (variable private-variable-list)&#xA;    (make-local-variable variable)))&#xA;&#xA;(defun clear-private-buffer()&#xA;  &quot;Clean-up the current private buffer&quot;&#xA;  (interactive)&#xA;  (dolist (variable private-variable-list)&#xA;    (set variable nil)))&#xA;&#xA;(add-hook 'find-file-hook&#xA;          (lambda ()&#xA;            (if epa-file-encrypt-to&#xA;                (setup-private-buffer))))&#xA;&#xA;(add-hook 'kill-buffer-hook&#xA;          (lambda ()&#xA;            (if epa-file-encrypt-to&#xA;                (clear-private-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work for all cases that I tried, although I expect that there may be a few corner cases e.g. when handling any buffer than the current one.&lt;/p&gt;&#xA;" OwnerUserId="7016" LastActivityDate="2015-04-13T09:21:09.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10658" PostTypeId="2" ParentId="9967" CreationDate="2015-04-13T10:39:45.090" Score="4" Body="&lt;p&gt;The problem is solved by using &lt;code&gt;with-selected-window&lt;/code&gt; instead of &lt;code&gt;with-current-buffer&lt;/code&gt;.&#xA;I thought that they would be equivalent in this case, but they're not.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-13T10:39:45.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10659" PostTypeId="1" CreationDate="2015-04-13T11:37:56.637" Score="0" ViewCount="459" Body="&lt;p&gt;The cedet info I am using with emacs 23.4.1&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ECB 2.40 uses CEDET 1.0 (contains semantic 2.0, eieio 1.3, speedbar &amp;lt;unknown version&amp;gt;).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am trying to create a cpp-root-project for out-of-source-tree building, however, when I try to create a project definition using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ede-cpp-root-project &quot;project-root&quot;&#xA;                      :file &quot;~/dev/gorgon/build/dummy-makefile&quot;&#xA;                      :include-path '(&quot;/Source&quot;)&#xA;                      ;:system-include-path '(&quot;~/linux&quot;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;by requiring the file containing above code to load with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'projects)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it gives following error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void : ede-cpp-root-project&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at first I thought maybe this &quot;feature&quot; is lacking so I tried to list available projects from ede projects and it listed&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Automake&#xA;make&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is does this functionality supported in CEDET 1.0 or am I doing something wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the codes related to ede in my init.el file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-ede-mode 1)&#xA;(semantic-mode 1)&#xA;(ede-enable-generic-projects)&#xA;(global-semantic-idle-scheduler-mode)&#xA;(global-semantic-idle-completions-mode)&#xA;(global-semantic-decoration-mode)&#xA;(global-semantic-highlight-func-mode)&#xA;(global-semantic-show-unmatched-syntax-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7034" LastEditorUserId="7034" LastEditDate="2015-04-13T14:00:18.770" LastActivityDate="2024-01-05T23:04:45.543" Title="ede-cpp-root-project is missing" Tags="|cedet|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10660" PostTypeId="1" CreationDate="2015-04-13T12:12:53.747" Score="1" ViewCount="642" Body="&lt;p&gt;I am a total emacs newbie. I was following the &lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/guide-en.org&quot; rel=&quot;nofollow&quot;&gt;Master Emacs in one year&lt;/a&gt; guide by Chen Bin. Following it, I cloned Steve Purcell's &lt;a href=&quot;https://github.com/purcell/emacs.d&quot; rel=&quot;nofollow&quot;&gt;.emacs.d&lt;/a&gt; repo. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the guide works just fine when I do M-x eval-buffer for my &quot;~/.emacs.d/init.el&quot; file. However, as soon as I restart Emacs, the changes are gone. I have to eval-buffer every time I start emacs.&#xA;I also checked some websites which explains me to have either .emacs file or init.el file and not both. But every time I delete my .emacs file, Emacs generates it automatically when I restart it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong? &lt;/p&gt;&#xA;" OwnerUserId="6864" LastActivityDate="2015-04-13T12:12:53.747" Title="M-x eval-buffer my init.el file every time I start emacs" Tags="|init-file|" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="10661" PostTypeId="1" AcceptedAnswerId="10662" CreationDate="2015-04-13T13:26:40.730" Score="1" ViewCount="305" Body="&lt;p&gt;At the weekend I wiped my dotfiles and replaced them with prelude. I do most of my work in C#, so I've got csharp-mode installed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typing in c# is laggy, in a painful bursty way. A few words come out smoothly, then there's a big pause over the next few words. There's no problem with moving the cursor around or scrolling the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried turning off minor modes on a buffer and continuing to type. I've disabled the following with no change to the problem:&lt;br&gt;&#xA; - projectile-mode&lt;br&gt;&#xA; - company-mode&lt;br&gt;&#xA; - guru-mode (think this is a prelude thing?)&lt;br&gt;&#xA; - flycheck-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My mode line says I've got &lt;code&gt;C#/l&lt;/code&gt;, &lt;code&gt;MRev&lt;/code&gt;, &lt;code&gt;Helm&lt;/code&gt;, &lt;code&gt;SP&lt;/code&gt;, &lt;code&gt;Pre&lt;/code&gt; and &lt;code&gt;Abbrev&lt;/code&gt; still running. They all seem pretty important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's nothing in the messages buffer when these pauses occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 24.4. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any keystroke profiling I can turn on, to see what's slowing things down?&lt;/p&gt;&#xA;" OwnerUserId="110" LastEditorUserId="160" LastEditDate="2015-04-13T13:38:40.960" LastActivityDate="2015-04-13T14:01:19.350" Title="Diagnose laggy typing in csharp-mode" Tags="|prelude|profiler|csharp-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10662" PostTypeId="2" ParentId="10661" CreationDate="2015-04-13T14:01:19.350" Score="1" Body="&lt;p&gt;With help from nanny and jordan biondo, I profiled, entered some newlines in a class, and found the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zSsiN.png&quot; alt=&quot;imenu-update-menubar&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't tend to use imenu anyway, so I customised &lt;code&gt;csharp-want-imenu&lt;/code&gt; to nil, rebooted, and now things are much much better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good work everyone!&lt;/p&gt;&#xA;" OwnerUserId="110" LastActivityDate="2015-04-13T14:01:19.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10663" PostTypeId="2" ParentId="10650" CreationDate="2015-04-13T15:22:30.057" Score="3" Body="&lt;p&gt;&lt;code&gt;inferior-r-args&lt;/code&gt; is a customization variable, so you can edit it via &lt;code&gt;M-x customize-variable inferior-r-args&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ESS is a fairly complex package, and figuring out the timing for modifying variables can be a bit tricky - easier to use the customize facility when possible!&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-04-13T15:22:30.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10664" PostTypeId="1" CreationDate="2015-04-13T16:15:35.977" Score="3" ViewCount="580" Body="&lt;p&gt;I'm looking for an emacs package that can continuously run my unit tests. As I make changes, I'd like to be alerted as soon as a test fails. Preferably, a package that is language agnostic would be great (this is a C++ project). In my case, running the tests is all command-line driven.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does such a package exist?&lt;/p&gt;&#xA;" OwnerUserId="2804" LastActivityDate="2015-04-14T18:02:07.910" Title="In need of a continuous testing package" Tags="|package|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10665" PostTypeId="1" AcceptedAnswerId="13161" CreationDate="2015-04-13T17:03:01.090" Score="3" ViewCount="1637" Body="&lt;p&gt;Elpy provides company-mode to handle autocompletion. The way it is set up, company only turns on when I am in something handled by Elpy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I enable auto-complete it works in non-python files, but then both company and auto-complete pop up, which is not desired behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I enable company to still work within Elpy, but turn on auto-complete to be on elsewhere, and not clobber company?&lt;/p&gt;&#xA;" OwnerUserId="7038" LastActivityDate="2015-09-13T08:17:08.757" Title="How to use elpy and non-python autocomplete" Tags="|python|company-mode|auto-complete-mode|elpy|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10666" PostTypeId="2" ParentId="10540" CreationDate="2015-04-13T17:53:57.620" Score="1" Body="&lt;p&gt;From the documentation you quoted, I think the following construct&#xA;should give what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(:eval (when server-buffer-clients&#xA;          (format &quot; %d&quot; (length server-buffer-clients))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's an example of how to add it to the mode-line, but you can also&#xA;add it other places if preferred.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(:eval (when server-buffer-clients&#xA;                (format &quot; %d&quot; (length server-buffer-clients))))&#xA;      global-mode-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is another example, closer to the left side.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-line-client&#xA;      (list mode-line-client&#xA;            '(:eval (when server-buffer-clients&#xA;                      (format &quot; %d&quot; (length server-buffer-clients))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-04-13T17:53:57.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10667" PostTypeId="1" CreationDate="2015-04-13T18:49:13.337" Score="1" ViewCount="302" Body="&lt;p&gt;I am using &lt;code&gt;restclient-mode&lt;/code&gt; and trying to POST JSON to an API I'm writing. Making curl requests works fine but I'm getting these errors from restclient.el:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My restclient-mode request looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;POST https://www.example.com/&#xA;Content-Type: application/json&#xA;&#xA;{&#xA;  &quot;email&quot;: &quot;bitops@example.com&quot;,&#xA;  &quot;password&quot;: &quot;secretP@55word&quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see this output in the &lt;strong&gt;Messages&lt;/strong&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Contacting host: **API URL**:443&#xA;Opening TLS connection to `**API URL**'...&#xA;Opening TLS connection with `gnutls-cli --insecure -p 443 **API URL**'...failed&#xA;Opening TLS connection with `gnutls-cli --insecure -p 443 **API URL** --protocols ssl3'...failed&#xA;Opening TLS connection with `openssl s_client -connect **API URL**:443 -no_ssl2 -ign_eof'...failed&#xA;Opening TLS connection to `**API URL**'...failed&#xA;url-http: Could not create connection to **API URL**:443&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My gnutls-cli info:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ /usr/local/bin/gnutls-cli --version&#xA;gnutls-cli 3.3.9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7015" LastActivityDate="2015-04-13T18:49:13.337" Title="url-http unable to connect to api - gnutls error" Tags="|gnutls|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10668" PostTypeId="1" AcceptedAnswerId="10669" CreationDate="2015-04-13T19:38:29.440" Score="7" ViewCount="4843" Body="&lt;p&gt;So far, I've tried this, but it doesn't see to be working - new buffers still start in normal mode. I'd prefer to default to evils emacs mode, and be able to switch into evil with C-z when I'm ready&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-emacs-state-modes (append evil-normal-state-modes evil-motion-state-modes))&#xA;(setq evil-normal-state-modes nil)&#xA;(setq evil-motion-state-modes nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2188" LastActivityDate="2015-04-13T19:50:37.190" Title="How to set evil-mode to use evil-emacs-state-mode in new buffers?" Tags="|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10669" PostTypeId="2" ParentId="10668" CreationDate="2015-04-13T19:42:01.157" Score="10" Body="&lt;p&gt;You can set &lt;code&gt;evil-default-state&lt;/code&gt; to &lt;code&gt;emacs&lt;/code&gt;.  The docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The default state.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This is the state a mode comes up in when it is not listed&#xA;  in &lt;code&gt;evil-emacs-state-modes&lt;/code&gt;, &lt;code&gt;evil-insert-state-modes&lt;/code&gt; or&#xA;  &lt;code&gt;evil-motion-state-modes&lt;/code&gt;. The value may be one of &lt;code&gt;normal&lt;/code&gt;,&#xA;  &lt;code&gt;insert&lt;/code&gt;, &lt;code&gt;visual&lt;/code&gt;, &lt;code&gt;replace&lt;/code&gt;, &lt;code&gt;operator&lt;/code&gt;, &lt;code&gt;motion&lt;/code&gt; and&#xA;  &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hence: &lt;code&gt;(setq evil-default-state 'emacs)&lt;/code&gt; should do it.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-04-13T19:50:37.190" LastActivityDate="2015-04-13T19:50:37.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10670" PostTypeId="1" CreationDate="2015-04-13T21:12:36.603" Score="8" ViewCount="167" Body="&lt;p&gt;How can I make &lt;code&gt;browse-url&lt;/code&gt; follow URLs with line breaks?&lt;/p&gt;&#xA;&lt;p&gt;Example from &lt;a href=&quot;https://www.ietf.org/rfc/rfc1738.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;RFC 1738&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Yes, Jim, I found it under &amp;lt;URL:ftp://info.cern.ch/pub/www/doc;&#xA;type=d&amp;gt; but you can probably pick it up from &amp;lt;URL:ftp://ds.in&#xA;ternic.net/rfc&amp;gt;.  Note the warning in &amp;lt;URL:http://ds.internic.&#xA;net/instructions/overview.html#WARNING&amp;gt;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Example from &lt;a href=&quot;https://www.ietf.org/rfc/rfc3986.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;RFC 3986&lt;/a&gt;, which updates 1738:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Yes, Jim, I found it under &amp;quot;http://www.w3.org/Addressing/&amp;quot;,&#xA;but you can probably pick it up from &amp;lt;ftp://foo.example.&#xA;com/rfc/&amp;gt;.  Note the warning in &amp;lt;http://www.ics.uci.edu/pub/&#xA;ietf/uri/historical.html#WARNING&amp;gt;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&lt;p&gt;I just played around a bit.  For parsing URLs prefixed with &lt;code&gt;URL:&lt;/code&gt;, there is a regexp stored in &lt;code&gt;thing-at-point-markedup-url-regexp&lt;/code&gt;.  By default, it excludes line breaks. I changed it to:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;quot;&amp;lt;URL:\\([^&amp;lt;&amp;gt;]+\\)&amp;gt;&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Furthermore, the function &lt;code&gt;thing-at-point--bounds-of-markedup-url&lt;/code&gt;, which parses these strings, also excludes line breaks.  This can be fixed by changing:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(and (re-search-forward thing-at-point-markedup-url-regexp&#xA;                        end 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(and (re-search-forward thing-at-point-markedup-url-regexp&#xA;                        nil 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Those are just some first steps that I note down here for reference. A lot more work would need to be done to properly detect and clean up URLs with white space. It's not trivial, and maybe that's the reason why it's currently not supported. I may be one of few who regularly line break URLs in text documents.&lt;/p&gt;&#xA;" OwnerUserId="5327" LastEditorUserId="5327" LastEditDate="2022-01-25T09:33:30.493" LastActivityDate="2022-01-25T09:33:30.493" Title="Make browse-url follow URLs with line breaks?" Tags="|url|web-browser|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="10671" PostTypeId="1" CreationDate="2015-04-13T22:00:35.407" Score="2" ViewCount="921" Body="&lt;p&gt;If I have a URL to a file (for example, &lt;a href=&quot;https://gist.githubusercontent.com/camdez/c0f4c53ee847d5d1e2f0/raw/7582c4d8a5340afbda18390c2bddeadd47d3ad5d/experimental.el&quot; rel=&quot;nofollow&quot;&gt;this gist&lt;/a&gt;), what's the easiest way to fetch that file from Emacs and edit &lt;strong&gt;a copy&lt;/strong&gt; of it? Is there a better option than &lt;code&gt;M-! curl -n [insert URL here] RET&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd consider an answer &quot;better&quot; if it didn't rely on an external facility, for instance. Also if it used the remote name of the file as the local file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could certainly script up a solution to this myself but it seems like a pretty normal thing to do—is there existing functionality to do this within Emacs? Is there a pre-existing package?&lt;/p&gt;&#xA;" OwnerUserId="812" LastActivityDate="2015-04-14T06:30:15.130" Title="How can I access a file at an (HTTP / HTTPS) URL?" Tags="|url|remote|http|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10672" PostTypeId="2" ParentId="10647" CreationDate="2015-04-13T22:13:35.397" Score="1" Body="&lt;p&gt;I believe this is related to a recent OS change (from Ubuntu to Arch), which included an Emacs upgrade from 24.3 to 24.4. I think my &lt;code&gt;.emacs.desktop&lt;/code&gt; files were not compatible with this update, and this zoom bug was one effect. My desktop files are used to save my open buffers for each emacs session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to @Drew's answer, I found the cause of this issue when commenting out the following line in my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I comment it out, zooming worked fine. By deleting my old desktop files and creating new ones, I was able to uncomment the &lt;code&gt;desktop-save-mode&lt;/code&gt; command again.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-04-13T22:13:35.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10673" PostTypeId="2" ParentId="10671" CreationDate="2015-04-13T23:21:40.600" Score="2" Body="&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;browse-url-emacs&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;em&gt;URL&lt;/em&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-04-13T23:21:40.600" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10674" PostTypeId="2" ParentId="10521" CreationDate="2015-04-14T00:10:16.693" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/genehack/smart-tab&quot; rel=&quot;nofollow&quot;&gt;https://github.com/genehack/smart-tab&lt;/a&gt; provides &lt;a href=&quot;https://github.com/genehack/smart-tab/blob/7926b478bd225ef4aafe8842b7d442f4b301a9ba/smart-tab.el#L79&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smart-tab-completion-functions-alist&lt;/code&gt;&lt;/a&gt; for adding per mode actions. It doesn't check parent modes, so to make it work for &lt;code&gt;sgml-mode&lt;/code&gt; and all derivatives we can add an entry in the mode hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smart-tab)&#xA;(global-smart-tab-mode 1)&#xA;&#xA;(defun add-emmet-expand-to-smart-tab-completions ()&#xA;  ;; Add an entry for current major mode in&#xA;  ;; `smart-tab-completion-functions-alist' to use&#xA;  ;; `emmet-expand-line'.&#xA;  (add-to-list 'smart-tab-completion-functions-alist&#xA;               (cons major-mode #'emmet-expand-line)))   &#xA;&#xA;(require 'emmet-mode)&#xA;(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes&#xA;(add-hook 'sgml-mode-hook 'add-emmet-expand-to-smart-tab-completions)&#xA;(add-hook 'css-mode-hook  'emmet-mode) ;; enable Emmet's css abbreviation.&#xA;(add-hook 'css-mode-hook 'add-emmet-expand-to-smart-tab-completions)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;and this action is what is advised by the package author &lt;a href=&quot;https://github.com/smihica/emmet-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/smihica/emmet-mode&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;press C-j to expand it (or alternatively, alias your preferred keystroke to M-x emmet-expand-line)&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They meant something like &lt;code&gt;(define-key emmet-mode-keymap [tab] 'emmet-expand-line)&lt;/code&gt;, but that would take over the tab key and you wouldn't be using &lt;code&gt;smart-tab&lt;/code&gt; anymore.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-04-14T00:10:16.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10675" PostTypeId="1" CreationDate="2015-04-14T05:33:10.903" Score="1" ViewCount="224" Body="&lt;p&gt;I am using &lt;code&gt;js2-mode&lt;/code&gt; and &lt;code&gt;comint-mode&lt;/code&gt; to run the Node REPL in emacs.  For some reason the prompt is returning a lot of &lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;...undefined&lt;/code&gt; responses, which it wouldn't do normally.  for instance, this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function run () {&#xA;    console.log('hello there');&#xA;}&#xA;function next () {&#xA;    console.log('hello again');&#xA;}&#xA;&#xA;run();&#xA;next();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Prints out the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;... ... undefined                                                                       &#xA;&amp;gt; undefined                                                                                                                                                                ... ... undefined                                                                                                                                                         &amp;gt; undefined  &#xA;&amp;gt; hello there                                                                           &#xA;undefined                                                                               &#xA;&amp;gt; hello again                                                                                                                                                                undefined                                                                               &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="7047" LastEditDate="2015-04-25T02:07:23.140" LastActivityDate="2016-08-21T06:44:08.423" Title="js-comint mode (node) returning too many undefined responses?" Tags="|major-mode|comint|javascript|js2-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10676" PostTypeId="1" AcceptedAnswerId="10678" CreationDate="2015-04-14T05:41:47.117" Score="2" ViewCount="1343" Body="&lt;p&gt;I really want to use emacs as a Javascript IDE.  I have followed all the directions I can, includings &lt;code&gt;Yasnippets&lt;/code&gt; and &lt;code&gt;Autocomplete&lt;/code&gt;, but I still have some issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If  you look at the differences, in &lt;code&gt;Jedi&lt;/code&gt; the auto-completion and pop-up window appears almost right away in Python files. In my javascript, the only words that appear for autocorrect are those that previously appear (and they are not in a drop-down window) not even function (see attached).&#xA;&lt;img src=&quot;https://i.stack.imgur.com/KNGlp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FgvW3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have loaded external libraries and it looks like everything works, does any body have advice here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; js2 mode                                                                                                                                                                     &#xA;(add-hook 'js-mode-hook 'js2-minor-mode)                                                                                                                                        &#xA;(add-hook 'js-mode-hook 'ac-js2-mode)                                                                                                                                           &#xA;(setq js2-highlight-level 3)                                                                                                                                                    &#xA;(add-to-list 'auto-mode-alist (cons (rx &quot;.js&quot; eos) 'js2-mode))                                                                                                                  &#xA;(add-to-list 'auto-mode-alist '(&quot;\\.json$&quot; . js2-mode)) &#xA;&#xA;;; yasnippit                                                                                                                                                                    &#xA;;; load before auto complete                                                                                                                                                    &#xA;(require 'yasnippet)                                                                                                                                                            &#xA;(setq yas-snippet-dirs                                                                                                                                                          &#xA;      '(&quot;~/.emacs.d/snippets/javascript-mode&quot;                                                                                                                                   &#xA;        &quot;~/.emacs.d/snippets/js-yasnippets&quot;                                                                                                                                     &#xA;      ))                                                                                                                                                                        &#xA;(yas-global-mode 1)                                                                                                                                                             &#xA;&#xA;&#xA;;; autocomplete mode                                                                                                                                                            &#xA;(require 'auto-complete-config)                                                                                                                                                 &#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;)                                                                                                                   &#xA;(add-to-list 'ac-sources 'ac-source-yasnippet)                                                                                                                                  &#xA;(ac-config-default)                                                                                                                                                             &#xA;(ac-set-trigger-key &quot;TAB&quot;)                                                                                                                                                      &#xA;(ac-set-trigger-key &quot;&amp;lt;tab&amp;gt;&quot;)                                                                                                                                                    &#xA;&#xA;;; use spaces instead of tabs                                                                                                                                                   &#xA;(setq-default indent-tabs-mode nil) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2015-04-14T06:41:03.087" Title="Javascript not autocompleting with Yasnippet and Auto-complete" Tags="|auto-complete-mode|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10677" PostTypeId="2" ParentId="10671" CreationDate="2015-04-14T06:30:15.130" Score="2" Body="&lt;pre&gt;&lt;code&gt;,----[ C-h f url-handler-mode RET ]&#xA;| url-handler-mode is an interactive autoloaded compiled Lisp function&#xA;| in `url-handlers.el'.&#xA;| &#xA;| (url-handler-mode &amp;amp;optional ARG)&#xA;| &#xA;| Toggle using `url' library for URL filenames (URL Handler mode).&#xA;`----&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-04-14T06:30:15.130" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10678" PostTypeId="2" ParentId="10676" CreationDate="2015-04-14T06:41:03.087" Score="5" Body="&lt;p&gt;That is because &lt;a href=&quot;https://github.com/davidhalter/jedi&quot;&gt;jedi&lt;/a&gt; is a Python library that statically analyzes Python code to suggest completion candidates.   Installing the &lt;a href=&quot;https://github.com/tkf/emacs-jedi&quot;&gt;jedi.el package&lt;/a&gt; enabled its abilities for &lt;code&gt;auto-complete-mode&lt;/code&gt; and extended them beyond the suggestion of already used words and predefined ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wish to have the same experience with Javascript, you will either need to find a similiarly powerful backend like &lt;a href=&quot;http://ternjs.net/&quot;&gt;tern.js&lt;/a&gt; and install an Emacs package for it or alternatively could check whether your major mode supports completion suggestions (by hitting &lt;code&gt;M-TAB&lt;/code&gt; after typing a word partially) and enable these in &lt;code&gt;auto-complete-mode&lt;/code&gt; with the &lt;a href=&quot;https://github.com/syohex/emacs-ac-capf&quot;&gt;ac-capf&lt;/a&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-04-14T06:41:03.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10679" PostTypeId="1" AcceptedAnswerId="10683" CreationDate="2015-04-14T07:55:46.480" Score="3" ViewCount="767" Body="&lt;p&gt;I would like to write a elisp function that corrects a few formatting issues in my LaTeX code. Precisely, I would like to transform the following text&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Some useless text&#xA;\begin{equation}&#xA;    some math stuff&#xA;\end{equation}&#xA;Further text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Some useless text&#xA;%&#xA;\begin{equation}&#xA;    some math stuff&#xA;\end{equation}&#xA;%&#xA;Further text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. I want that equation environments that are not surrounded by comments  get an empty comment line before and after the environment. My idea was to write a small elisp function that replaces all such occurences with some regex. With lots of trial and error I found the following regex that seems to find the \begin{equations} that are not preceeded by % in the line before.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^[[:space:]]*[^%].*\n[[:space:]]*\\\\begin{equation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also found the following snippet on the internet to do search an replace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (beginning-of-buffer)&#xA;    (while (re-search-forward &quot;foo\nbar&quot; nil t)&#xA;      (replace-match &quot;bar\nfoo&quot; nil nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My guess is the a clever combination of these things will give me my result, but so far all my attempts have failed. Can anybody give me some hints on how I achieve the sought substitution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/4329278/emacs-regexp-groups-in-regex-replace&quot;&gt;Emacs regexp groups in regex-replace&lt;/a&gt; I came up with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (beginning-of-buffer)&#xA;    (while (re-search-forward &quot;\\(^[[:space:]]*[^%].*\n\\)\\([[:space:]]*\\)\\(\\\\begin{equation}\\)&quot; nil t)&#xA;    (replace-match &quot;\\1\\2%\n\\2\\3&quot; nil nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which seems to work for the few test cases that I tried so far. It fails when \begin{equation} terms are nested immediately after each other, but since this is not allowed in LaTeX anyway its not a critical issue.&lt;/p&gt;&#xA;" OwnerUserId="7048" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-04-14T15:28:53.700" Title="Multiline regex replace within elisp function" Tags="|regular-expressions|replace|elisp-macros|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10680" PostTypeId="2" ParentId="10611" CreationDate="2015-04-14T09:20:33.003" Score="84" Body="&lt;h2&gt;Magit version &amp;gt;= 2.1.0&lt;/h2&gt;&#xA;&lt;p&gt;For both methods, first start up &lt;code&gt;magit-status&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Method A&lt;/strong&gt;: &lt;em&gt;Cherry Pick changes from another branch one by one, or by ranges&lt;/em&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;code&gt;l&lt;/code&gt; and then &lt;code&gt;o&lt;/code&gt; to get a list of other branches.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Select the branch you want to cherry pick from.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Move to the commit you need and press &lt;code&gt;A&lt;/code&gt; followed by &lt;code&gt;A&lt;/code&gt; again. You can also select the lines with the commit range you want with &lt;code&gt;C-space&lt;/code&gt; and press &lt;code&gt;A&lt;/code&gt; followed by &lt;code&gt;A&lt;/code&gt; again.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The status line will show you which commit you selected&lt;/p&gt;&#xA;&lt;p&gt;e.g. &lt;code&gt;feature/ABC~4&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Press &lt;code&gt;Enter&lt;/code&gt; to apply changes.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;Method B&lt;/strong&gt;: &lt;em&gt;Cherry Pick all changes from another branch&lt;/em&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Press &lt;code&gt;A&lt;/code&gt; to choose the cherry pick mode.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;A&lt;/code&gt; again to apply and commit changes.&#xA;Press &lt;code&gt;a&lt;/code&gt; to only apply changes.&lt;/li&gt;&#xA;&lt;li&gt;Choose a branch to cherry pick changes from and press &lt;code&gt;Enter&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I personally prefer method A as you can handle merge conflicts better.&lt;/p&gt;&#xA;&lt;h2&gt;Magit version &amp;lt;= 1.4.2&lt;/h2&gt;&#xA;&lt;p&gt;The workflow was different in earlier versions:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Enter overview &lt;code&gt;magit-status&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Check out (press &lt;code&gt;b b&lt;/code&gt;) the branch you want to cherry pick into.&lt;/li&gt;&#xA;&lt;li&gt;Do a log range (press &lt;code&gt;l r l&lt;/code&gt;) to find the commits that you want to cherry pick. Here you select the 2 branches you want to compare.&lt;/li&gt;&#xA;&lt;li&gt;Scroll to the commit you want to pick and press &lt;code&gt;A&lt;/code&gt; to apply the changes and also stage them togeteher with the commit message. If you press &lt;code&gt;a&lt;/code&gt; it will not stage the changes but only apply them.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;You don't need to do a log range to cherry pick. Whenever you see a commit log you can press &lt;code&gt;A&lt;/code&gt; to cherry pick it.&lt;/p&gt;&#xA;" OwnerUserId="2315" LastEditorUserId="16713" LastEditDate="2021-11-24T04:32:34.903" LastActivityDate="2021-11-24T04:32:34.903" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10681" PostTypeId="1" AcceptedAnswerId="10682" CreationDate="2015-04-14T10:10:27.380" Score="4" ViewCount="311" Body="&lt;p&gt;Specifically, I want to set &lt;code&gt;overriding-terminal-local-map&lt;/code&gt; to nil in all terminals.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-15T02:05:24.897" Title="How to set a terminal-local variable in all terminals?" Tags="|elisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10682" PostTypeId="2" ParentId="10681" CreationDate="2015-04-14T10:35:03.510" Score="6" Body="&lt;p&gt;I've had a similiar problem and found out after studying the sources of Evil that using the &lt;code&gt;after-make-frame-functions&lt;/code&gt; hook comes close enough.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-terminal-local-map-override (&amp;amp;optional frame)&#xA;  (with-selected-frame frame&#xA;    (setq overriding-terminal-local-map nil)))&#xA;&#xA;(add-hook 'after-make-frame-functions 'my-terminal-local-map-override)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For my specific usecase I needed to call the &lt;code&gt;my-terminal-local-map-override&lt;/code&gt; function unconditionally additionally to that, so if it doesn't work for you in both Emacs and &lt;code&gt;emacsclient&lt;/code&gt;, give that extra hack a try.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="454" LastEditDate="2015-04-15T02:05:24.897" LastActivityDate="2015-04-15T02:05:24.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10683" PostTypeId="2" ParentId="10679" CreationDate="2015-04-14T12:20:50.007" Score="0" Body="&lt;p&gt;Here's something quick I came up with. It looks like it can catch situations when equations follow each other, but do tell if I missed some corner cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/wrap-equation-with-% ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (beginning-of-buffer)&#xA;    (let ((last &quot;&quot;))&#xA;      (while (not (eobp))&#xA;        (search-forward-regexp &quot;^.*$&quot; nil t)&#xA;        (let ((line (match-string 0)))&#xA;          (cond&#xA;           ((and (not (string-equal last &quot;%&quot;))&#xA;                 (s-starts-with-p &quot;\\begin{equation&quot; (s-trim-left line)))&#xA;            (move-beginning-of-line 0)&#xA;            (forward-line)&#xA;            (insert &quot;%\n&quot;))&#xA;           ((and (s-starts-with-p &quot;\\end{equation&quot; (s-trim-left last))&#xA;                 (not (string-equal line &quot;%&quot;)))&#xA;            (move-end-of-line 0)&#xA;            (insert &quot;\n%&quot;)&#xA;            (forward-line)))&#xA;          (setf last line)&#xA;          (forward-line))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ah, this also uses &lt;code&gt;s-starts-with&lt;/code&gt; from &lt;a href=&quot;https://github.com/magnars/s.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magnars/s.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-04-14T15:28:53.700" LastActivityDate="2015-04-14T15:28:53.700" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10684" PostTypeId="2" ParentId="10664" CreationDate="2015-04-14T16:27:11.300" Score="5" Body="&lt;p&gt;You can with the package &lt;a href=&quot;https://github.com/tuhdo/auto-recompile&quot; rel=&quot;nofollow&quot;&gt;auto-recompile&lt;/a&gt;. I took it from &lt;a href=&quot;http://fredrik.hubbe.net/hacks/auto-recompile.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and fixed a bug to make it compatible with latest Emacs. To use it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First load the package in your Emacs (I assume you know how to do this).&lt;/li&gt;&#xA;&lt;li&gt;Then, &lt;code&gt;M-x auto-recompile&lt;/code&gt;. After that, it displays a message &lt;code&gt;Auto-recompile mode is on&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Next, &lt;code&gt;M-x compile&lt;/code&gt; and run your test command.&lt;/li&gt;&#xA;&lt;li&gt;Now, everytime you save, the compile command (which is the test command you've just executed) runs automatically and display in &lt;code&gt;*compilation*&lt;/code&gt; buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You should bind a key to &lt;code&gt;auto-recompile&lt;/code&gt; to toggle it on/off when needed, since it's annoying when enabled globally because the recompile is triggered in unrelated modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can combine it with &lt;code&gt;auto-save-mode&lt;/code&gt; to achieve what you want: periodically see test results by periodically save your current buffer and in turn, invoke &lt;code&gt;auto-recompile&lt;/code&gt; (the function is taken from &lt;a href=&quot;http://emacswiki.org/emacs/AutoSave#toc7&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun save-buffer-if-visiting-file (&amp;amp;optional args)&#xA;  &quot;Save the current buffer only if it is visiting a file&quot;&#xA;  (interactive)&#xA;  (if (and (buffer-file-name) (buffer-modified-p))&#xA;      (save-buffer args)))&#xA;&#xA;(add-hook 'prog-mode-hook 'auto-save-mode)&#xA;(add-hook 'auto-save-hook 'save-buffer-if-visiting-file)&#xA;(setq auto-save-timeout 10)             ; auto save every 10 seconds&#xA;(setq auto-save-interval 100)           ; auto save every 100 input events&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-04-14T17:19:07.220" LastActivityDate="2015-04-14T17:19:07.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10685" PostTypeId="2" ParentId="10664" CreationDate="2015-04-14T16:58:13.160" Score="2" Body="&lt;p&gt;I happen to have written &lt;a href=&quot;https://github.com/wasamasa/firestarter&quot; rel=&quot;nofollow&quot;&gt;a generic package for doing things on save&lt;/a&gt;, such as running (shell) commands not too long ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It supports shell commands, interactive commands and generic Emacs Lisp code.  When using shell commands, you get a reporting buffer containing output of the entire history and can configure on which condition it should pop up (like for example, only when the command failed with a non-zero status code). Finally, it supports format codes in the commands which are tremendously useful for calls that need to know the current file it's running upon or parts of it. Since it uses a customizable buffer-local variable to determine how to do its job, you can customize it globally, per mode, per directory, per file or even just interactively, unlike things like &lt;code&gt;M-x compile&lt;/code&gt; where you start with a default and need to change it for every &quot;project&quot; for each new Emacs session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe it to be the simplest solution for a workflow approximating full CI solutions.  If there's anything obvious missing from it, feel free to open an issue on its bug tracker.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-04-14T18:02:07.910" LastActivityDate="2015-04-14T18:02:07.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10686" PostTypeId="2" ParentId="10427" CreationDate="2015-04-14T17:40:50.883" Score="3" Body="&lt;p&gt;You could disable the menu-bar completely with &lt;code&gt;(menu-bar-mode -1)&lt;/code&gt; and use &lt;code&gt;tmm-menubar&lt;/code&gt; whenever you want to access something in the menus. &lt;code&gt;tmm-menubar&lt;/code&gt; is a text-only, key-binding driven menu-bar alternative which I like very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YHPwp.png&quot; alt=&quot;Screenshot of tmm-menubar from ergoemacs&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7052" LastEditorUserId="870" LastEditDate="2015-04-15T16:33:38.043" LastActivityDate="2015-04-15T16:33:38.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10687" PostTypeId="2" ParentId="10418" CreationDate="2015-04-14T17:44:55.883" Score="4" Body="&lt;p&gt;One slow startup problem is usually that you don't have your machines fully qualified hostname declared in /etc/hosts which causes emacs to hang at some syscall during startup. However, that would not explain why &lt;code&gt;emacs&lt;/code&gt; is faster than &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2015-04-14T17:44:55.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10688" PostTypeId="1" AcceptedAnswerId="10705" CreationDate="2015-04-14T18:00:28.990" Score="0" ViewCount="646" Body="&lt;p&gt;I tried to install auto-complete and followed the steps below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(emacs version: GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.9))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) delete dir elpa (make sure it's not installed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) M-x package-install RET auto-complete RET&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Leaving directory `/home/taochen/.emacs.d/elpa/popup-20150315.612'&#xA; ^L&#xA; Compiling file /home/taochen/.emacs.d/elpa/popup-20150315.612/popup-pkg.el at Tue Apr 14 10:47:58 2015&#xA; Entering directory `/home/taochen/.emacs.d/elpa/popup-20150315.612/'&#xA; ^L&#xA; Compiling file /home/taochen/.emacs.d/elpa/popup-20150315.612/popup.el at Tue Apr 14 10:47:58 2015&#xA; ^L&#xA; Compiling no file at Tue Apr 14 10:47:58 2015&#xA; Leaving directory `/home/taochen/.emacs.d/elpa/auto-complete-20150408.1132'&#xA;^L&#xA;Compiling file /home/taochen/.emacs.d/elpa/auto-complete-20150408.1132/auto-complete-config.el at Tue Apr 14 10:47:58 2015&#xA;Entering directory `/home/taochen/.emacs.d/elpa/auto-complete-20150408.1132/'&#xA;&#xA;In end of data:&#xA;auto-complete-config.el:544:1:Warning: the following functions are not known to be defined:&#xA;    semantic-analyze-current-context, semantic-tag-class,&#xA;    semantic-tag-function-arguments, yas-expand-snippet,&#xA;    semantic-format-tag-type, semantic-format-tag-name&#xA;^L&#xA;Compiling file /home/taochen/.emacs.d/elpa/auto-complete-20150408.1132/auto-complete.el at Tue Apr 14 10:47:59 2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6937" LastEditorUserId="105" LastEditDate="2015-04-14T22:36:44.473" LastActivityDate="2015-04-15T17:44:36.157" Title="compiling warning when installing auto-complete package in emacs 24" Tags="|auto-complete-mode|" AnswerCount="1" CommentCount="4" ClosedDate="2015-04-16T06:24:10.993" ContentLicense="CC BY-SA 3.0" />
  <row Id="10690" PostTypeId="1" CreationDate="2015-04-14T19:31:21.223" Score="0" ViewCount="109" Body="&lt;p&gt;I'm trying &lt;code&gt;elint&lt;/code&gt; for the first time, because I just learned that it reports things that bytecode compiling doesn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mainly it is showing me a few missing &lt;code&gt;require&lt;/code&gt;s, which I'm adding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only a &lt;code&gt;tests.el&lt;/code&gt; is giving many warnings and errors. Distilled example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ert)&#xA;(ert-deftest my/test ()&#xA;  (should t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;elint-current-buffer&lt;/code&gt; reports:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In top level expression:&#xA;tests.el:2:Warning: Reference to unbound symbol: my/test&#xA;tests.el:2:Error: Call to undefined function: should&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I figured it might have something to do with macro evaluation. And indeed this makes &lt;code&gt;elint&lt;/code&gt; happy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (ert-deftest my/test ()&#xA;    (should t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However. I've never seen anyone do this. (Not that I've read all Elisp ever written. But I've looked at a fair amount, and even tried a quick GitHub search. I also didn't see any discussion of this in &lt;code&gt;ert&lt;/code&gt; or &lt;code&gt;elint&lt;/code&gt; docs/comments.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically speaking, should I bother to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I realize &quot;the value of linting&quot; is probably an opinion-based question, which is no good. That's not my intent. I'm looking for practical advice from experienced Elisp programmers -- what sort of problems will I have from either using or not using &lt;code&gt;eval-when-compile&lt;/code&gt; here?)&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="849" LastEditDate="2015-04-15T13:30:00.520" LastActivityDate="2015-04-15T13:30:00.520" Title="ert and elint: Use (eval-when-compile (ert-deftest ....))?" Tags="|ert|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10691" PostTypeId="1" AcceptedAnswerId="10702" CreationDate="2015-04-14T22:42:36.813" Score="6" ViewCount="5348" Body="&lt;p&gt;I use DropBox to share my .emacs and .emacs.d with the various machines I use.  I setup helm using emacs on my mac but now I'm having issues when opening emacs on my Linux box:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (emacs): Unable to activate package `helm'.&#xA;Required package `emacs-24' is unavailable&#xA;Warning (emacs): Unable to activate package `helm'.&#xA;Required package `emacs-24' is unavailable&#xA;Warning (initialization): An error occurred while loading `/home/gibson/.emacs':&#xA;&#xA;File error: Cannot open load file, helm&#xA;&#xA;To ensure normal operation, you should investigate and remove the &#xA;cause of the error in your initialization file.  Start Emacs &#xA;with the `--debug-init' option to view a complete error backtrace.&#xA;Warning (emacs): Unable to activate package `helm'.&#xA;Required package `emacs-24' is unavailable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also get &quot;Package 'emacs-24' is unavailable&quot; when I try to M-x package-install helm&lt;/p&gt;&#xA;" OwnerUserId="7001" LastEditorUserId="50" LastEditDate="2015-05-20T17:51:50.703" LastActivityDate="2015-05-20T17:51:50.703" Title="Required package `emacs-24' is unavailable" Tags="|helm|package|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10692" PostTypeId="1" CreationDate="2015-04-15T00:56:21.727" Score="0" ViewCount="800" Body="&lt;p&gt;I am using spacemacs nXML mode to edit build.xml (java ant configuration file), the file is very long, how to fold and unfold it? &lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="11" LastEditDate="2015-04-15T09:19:46.390" LastActivityDate="2015-04-15T09:49:09.517" Title="how to fold xml file (or specifically build.xml)" Tags="|code-folding|xml|nxml|" AnswerCount="1" CommentCount="2" ClosedDate="2015-04-15T15:21:12.530" ContentLicense="CC BY-SA 3.0" />
  <row Id="10693" PostTypeId="1" AcceptedAnswerId="10848" CreationDate="2015-04-15T01:08:57.033" Score="0" ViewCount="2781" Body="&lt;p&gt;My computer system and set up are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;OS: Arch Linux 64bit&#xA;emacs version: 24.4&#xA;alias emacs='emacsclient -t -s server --alternate-editor='&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;auto complete&lt;/code&gt; is working with &lt;code&gt;yasnippet&lt;/code&gt; occasionally now but not as expected. I changed the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'achead:include-directories&#xA;       '&quot;/usr/include/c++/4.9.2/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;#include &amp;lt;io&lt;/code&gt; and hit tab, I get back &lt;code&gt;#include &amp;lt;#include &amp;lt;iostream&amp;gt;&lt;/code&gt;. Therefore, I then tried just typing &lt;code&gt;&amp;lt;io&lt;/code&gt; and tab which produces &lt;code&gt;&amp;lt;#include &amp;lt;iostream&amp;gt;&lt;/code&gt;. If I type &lt;code&gt;ios&lt;/code&gt; and hit type, the desired result is achieved. I then tested this with &lt;code&gt;float.h&lt;/code&gt;. No iteration works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then tried re-testing &lt;code&gt;io&lt;/code&gt; and tab. This doesn't work 100% of the time. 50% of the time I get &lt;code&gt;#include &amp;lt;iostream&amp;gt;&lt;/code&gt; and the other 50% nothing happens. Needless to say, I have no idea what is going on with this package or feature. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am trying to get auto complete to work with C/C++ headers; however, I have been unable to do so. I executed the following command in the terminal to locate the C/C++ headers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[dustin@dustin ~]$ g++ -print-prog-name=cc1plus -v&#xA;Using built-in specs.&#xA;COLLECT_GCC=g++&#xA;COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper&#xA;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/cc1plus&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but using &lt;code&gt;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/cc1plus&lt;/code&gt; does not produce the desired outcome. I have also ran a search looking for &lt;code&gt;float.h&lt;/code&gt; just to determine locations as well and came up with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[dustin@dustin ~]$ sudo find / -name float.h&#xA;[sudo] password for dustin: &#xA;/usr/include/c++/4.9.2/tr1/float.h&#xA;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include/float.h&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I also tried &lt;code&gt;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include&lt;/code&gt;. I am not to sure about &lt;code&gt;/usr/include/c++/4.9.2/tr1&lt;/code&gt; though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is the relevant information in my &lt;code&gt;.emacs&lt;/code&gt;. All packages were downloaded and install from &lt;code&gt;melpa&lt;/code&gt; are up-to-date. If I run &lt;code&gt;'emacs' --debug-init&lt;/code&gt;, there are no error messages. The &lt;code&gt;' '&lt;/code&gt; around emacs is so that emacs will open without options for debugging only.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Start server and set directory&#xA;(setq server-socket-dir (format &quot;/tmp/emacs1000&quot;))&#xA;&#xA;;; Package list M-x package-list-packages&#xA;(require 'package)&#xA;(add-to-list 'package-archives &#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;&#xA;;; Package initialize&#xA;(package-initialize)&#xA;&#xA;;; C/C++ configuration&#xA;(require 'cc-mode)&#xA;&#xA;;; auto complete for C/C++&#xA;(require 'auto-complete)&#xA;;; default config for auto-complete&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;&#xA;;; start yasnippets&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;&#xA;;; auto complete C++-headers&#xA;(defun my:ac-c-header-init ()&#xA;  (require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-header)&#xA;  (add-to-list 'achead:include-directories&#xA;               '&quot;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include&quot;)&#xA;  )&#xA;&#xA;;; call ac-c-headers from c/c++ hooks&#xA;(add-hook 'c++-mode-hook 'my:ac-c-header-init)&#xA;(add-hook 'c-mode-hook 'my:ac-c-header-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2603" LastEditorUserId="2603" LastEditDate="2015-04-15T16:10:14.167" LastActivityDate="2015-04-22T02:50:07.403" Title="Configuring yasnippet and autocomplete to work with C/C++ headers" Tags="|auto-complete-mode|yasnippet|linux|c++|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10695" PostTypeId="1" AcceptedAnswerId="10697" CreationDate="2015-04-15T02:59:31.643" Score="7" ViewCount="741" Body="&lt;p&gt;I want use Org-mode to keep track of e-mails. When I've read the e-mail, and added it to Org, I want to archive the e-mail but still have a link to the archived e-mail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pretty much exactly this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/15736590/how-to-automatically-track-links-in-org-mode-to-gnus-messages&quot;&gt;https://stackoverflow.com/questions/15736590/how-to-automatically-track-links-in-org-mode-to-gnus-messages&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've followed the answer, but it doesn't work. It seems the hook has been updated to: &lt;code&gt;org-capture-before-finalize-hook&lt;/code&gt; so I've updated the code as necessary, and it runs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm getting the message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Replaced 0 occurrences (skipped 1 filtered out)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, it seems that while the buffer is in org-mode, the hidden URL link text gets filtered out if I use &lt;code&gt;replace-string&lt;/code&gt; on the buffer. Is there a way around this?&lt;/p&gt;&#xA;" OwnerUserId="182" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-04-15T13:28:46.580" Title="&quot;replace-string&quot; with Org-mode capture buffer and link URLs" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10696" PostTypeId="2" ParentId="10426" CreationDate="2015-04-15T03:46:06.220" Score="30" Body="&lt;p&gt;There are (at least) two ways.  First, typing &lt;code&gt;C-u C-c C-o&lt;/code&gt; on a link should force it to be opened in emacs, rather than in an external app.  Second, you can permanently override the default behavior by adding an entry to the variable &lt;code&gt;org-file-apps&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-file-apps '(directory . emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which tells org-mode to use dired for all directory links.  Alternatively, you could use &lt;code&gt;customize-variable&lt;/code&gt; to achieve the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that the default behavior is different between OS X and Linux is that &lt;code&gt;org-file-apps-default-macosx&lt;/code&gt; contains a fall-through entry &lt;code&gt;(t . &quot;open %s&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2015-04-15T03:46:06.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10697" PostTypeId="2" ParentId="10695" CreationDate="2015-04-15T04:14:30.777" Score="5" Body="&lt;p&gt;From the help text for &lt;code&gt;replace-string&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;... ignore hidden matches if `search-invisible' is nil ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So setting &lt;code&gt;(setq search-invisible t)&lt;/code&gt; ought to solve your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, to avoid side-effects, set it temporarily inside your function, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hs/replace ()&#xA;   (interactive)&#xA;   (goto-char 1)&#xA;   (let ((search-invisible t))&#xA;     (replace-string &quot;INBOX&quot; &quot;Archive&quot;))&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="1980" LastEditDate="2015-04-15T13:28:46.580" LastActivityDate="2015-04-15T13:28:46.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10698" PostTypeId="2" ParentId="9871" CreationDate="2015-04-15T04:39:37.780" Score="3" Body="&lt;p&gt;Given the pointer to &lt;code&gt;term-handle-ansi-escape&lt;/code&gt; by @jch I was able to add support for CHA as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun toolbear:term-handle-more-ansi-escapes (proc char)&#xA;  &quot;Handle additional ansi escapes.&quot;&#xA;  (cond&#xA;   ;; \E[nG - Cursor Horizontal Absolute, e.g. move cursor to column n&#xA;   ((eq char ?G)&#xA;    (let ((col (min term-width (max 0 term-terminal-parameter))))&#xA;      (term-move-columns (- col (term-current-column)))))&#xA;   (t)))&#xA;(advice-add 'term-handle-ansi-escape :before #'toolbear:term-handle-more-ansi-escapes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user6709" LastEditorDisplayName="user6709" LastEditDate="2015-04-15T05:01:37.997" LastActivityDate="2015-04-15T05:01:37.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10699" PostTypeId="2" ParentId="10628" CreationDate="2015-04-15T06:15:29.287" Score="7" Body="&lt;p&gt;With Emacs from the current Git HEAD which will become Emacs 25, you can do the&#xA;following, i.e., turn the plist into an alist easily with the new&#xA;&lt;code&gt;seq-partition&lt;/code&gt; function, and then process the alist entries using standard&#xA;&lt;code&gt;mapcar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((my-plist (list :a 1 :b 2 :c 3 :more (list 4 5 6)))&#xA;       (my-alist (seq-partition my-plist 2))&#xA;       (my-reverse-alist (mapcar (lambda (entry)&#xA;                                   (let ((prop (car entry))&#xA;                                         (val  (cadr entry)))&#xA;                                     (list val prop)))&#xA;                                 my-alist)))&#xA;  (message &quot;my-plist: %s\nmy-alist: %s\nmy-reverse-alist: %s&quot;&#xA;           my-plist my-alist my-reverse-alist))&#xA;;; my-plist: (:a 1 :b 2 :c 3 :more (4 5 6))&#xA;;; my-alist: ((:a 1) (:b 2) (:c 3) (:more (4 5 6)))&#xA;;; my-reverse-alist: ((1 :a) (2 :b) (3 :c) ((4 5 6) :more))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Have a look at the &lt;code&gt;seq-partition&lt;/code&gt; docs using &lt;code&gt;C-h f seq-partition RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2015-04-15T06:15:29.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10700" PostTypeId="2" ParentId="10692" CreationDate="2015-04-15T07:26:01.283" Score="1" Body="&lt;p&gt;You need to add this hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'nxml-mode-hook 'hs-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that put this in your init.el file or somewhere it'll be loaded.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key nxml-mode-map (kbd &quot;C-c h&quot;) 'hs-toggle-hiding)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you now press &lt;code&gt;C-c h&lt;/code&gt; it will fold the xml at the element where your cursor is. &lt;/p&gt;&#xA;" OwnerUserId="2315" LastEditorUserId="2315" LastEditDate="2015-04-15T09:49:09.517" LastActivityDate="2015-04-15T09:49:09.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10701" PostTypeId="1" CreationDate="2015-04-15T09:14:43.783" Score="0" ViewCount="1519" Body="&lt;p&gt;helm swoop is very good, it could show me the lines matching some word, but I need to edit the lines around the matching line. How to do that? I can only view the them. I tried to use mouse to position the line I want to modify, but it doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2015-05-16T00:53:08.803" Title="how to edit in the place highlighted by helm swoop" Tags="|helm|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10702" PostTypeId="2" ParentId="10691" CreationDate="2015-04-15T12:46:19.057" Score="8" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;The reason for this can be a lingering old version of &lt;code&gt;package.el&lt;/code&gt; in your load path.  &lt;code&gt;package.el&lt;/code&gt; was officially included in GNU Emacs 24, and the downloadable file for earlier Emacs versions doesn't support dependencies on built-in packages (&lt;code&gt;emacs-24.1&lt;/code&gt; is considered a built-in package here).&lt;/p&gt;&#xA;&lt;p&gt;Type &lt;code&gt;M-x locate-library RET package&lt;/code&gt; to find where Emacs is getting its &lt;code&gt;package.el&lt;/code&gt; from. The path it shows should end with &lt;code&gt;lisp/emacs-lisp/package.elc&lt;/code&gt;. If it doesn't, try getting rid of the indicated file (or changing the load path so Emacs doesn't find it).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;From: &lt;a href=&quot;https://stackoverflow.com/q/16177807/1279369&quot;&gt;https://stackoverflow.com/q/16177807/1279369&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-04-15T12:46:19.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10703" PostTypeId="2" ParentId="10426" CreationDate="2015-04-15T14:33:11.047" Score="27" Body="&lt;p&gt;You can modify the link description as follows : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     [[file+emacs:~/projects][Projects]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will open the link in Emacs with typing &lt;code&gt;C-c C-o&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="499" LastActivityDate="2015-04-15T14:33:11.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10704" PostTypeId="2" ParentId="10693" CreationDate="2015-04-15T16:37:11.297" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;hippie-expand&lt;/code&gt; and avoid all this key binding conflict headache altogether:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (global-set-key (kbd &quot;M-/&quot;) 'hippie-expand) ;; replace dabbrev-expand&#xA;  (setq hippie-expand-try-functions-list&#xA;        '(&#xA;          ;; Try to expand yasnippet&#xA;          yas-hippie-try-expand&#xA;          ;; Try to expand word &quot;dynamically&quot;, searching the current buffer.&#xA;          try-expand-dabbrev&#xA;          ;; Try to expand word &quot;dynamically&quot;, searching all other buffers.&#xA;          try-expand-dabbrev-all-buffers&#xA;          ;; Try to expand word &quot;dynamically&quot;, searching the kill ring.&#xA;          try-expand-dabbrev-from-kill&#xA;          ;; Try to complete text as a file name, as many characters as unique.&#xA;          try-complete-file-name-partially&#xA;          ;; Try to complete text as a file name.&#xA;          try-complete-file-name&#xA;          ;; Try to expand word before point according to all abbrev tables.&#xA;          try-expand-all-abbrevs&#xA;          ;; Try to complete the current line to an entire line in the buffer.&#xA;          try-expand-list&#xA;          ;; Try to complete the current line to an entire line in the buffer.&#xA;          try-expand-line&#xA;          ;; Try to complete as an Emacs Lisp symbol, as many characters as&#xA;          ;; unique.&#xA;          try-complete-lisp-symbol-partially&#xA;          ;; Try to complete word as an Emacs Lisp symbol.&#xA;          try-complete-lisp-symbol))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, whenever you want to expand a snippet, press &lt;kbd&gt;M-/&lt;/kbd&gt; and want to complete, press &lt;kbd&gt;&amp;lt;tab&amp;gt;&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="2642" LastEditDate="2015-04-15T17:45:45.040" LastActivityDate="2015-04-15T17:45:45.040" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10705" PostTypeId="2" ParentId="10688" CreationDate="2015-04-15T17:44:36.157" Score="1" Body="&lt;p&gt;This is normal. I would venture to say that the majority of packages on ELPA trigger some warning(s). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If you build Emacs from source, you'll notice that even Emacs' own files trigger warnings too&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Warnings are not fatal. And it's often a bit of a pain to fix them, so developers may not spend the time to fix them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes, warnings are unavoidable. As a developer myself, I usually wrap the offending code in &lt;code&gt;(with-no-warnings ...)&lt;/code&gt;, but that's a matter of taste.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;TL;DR&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Don't worry about them. They won't hurt you. :-)&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-04-15T17:44:36.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10706" PostTypeId="1" AcceptedAnswerId="10718" CreationDate="2015-04-15T17:48:19.980" Score="1" ViewCount="794" Body="&lt;h3&gt;This works:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;semantic-decoration-include-visit&lt;/code&gt;  (opens the included header): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;string.h&amp;gt;    &#xA;#include &quot;/usr/include/gtk-3.0/gtk/gtk.h&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works well.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;This does not:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;But if I run it on a &lt;strong&gt;relative&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;gtk&lt;/em&gt;&lt;/strong&gt; path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;gtk/gtk.h&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I get an error:&lt;br&gt;&#xA;&lt;em&gt;semantic-decoration-include-visit: Could not location include gtk/gtk.h&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Troubleshooting attempts:&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Add include manually:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(semantic-add-system-include &quot;/usr/include/gtk-3.0/gtk&quot;)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;My own .h file:&lt;br&gt;&#xA;If I create a 'hello.h' inside /usr/include, and add the following to some C file, then semantic include visit works on that also:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#include &amp;lt;hello.c&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sym linking &lt;code&gt;/usr/include/gtk&lt;/code&gt; to &lt;code&gt;/usr/include/gtk-3.0/gtk&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cd /usr/include&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;sudo ln -s gtk-3.0/gtk gtk&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This actually gets the desired result. (but this has issues as I do Gtk2/Gtk3 development and I'd have to re-link many many many times...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question being, why doesn't &lt;code&gt;(semantic-add-system-include &quot;/usr/include/gtk-3.0/gtk&quot;)&lt;/code&gt; make it so that  is properly located?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Please note&lt;/strong&gt;&lt;br&gt;&#xA;- I'm an intern, learning about C development. I might be missing something obvious.&lt;br&gt;&#xA;- I'm setting up Emacs for C-Development as per &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;nofollow&quot;&gt;this guide&lt;/a&gt;&lt;br&gt;&#xA;- I'm on Emacs 25.0.50.4, using build-in CEDET (although tried with latest CEDET, had same error)&#xA;- I compile the gtk using pkg-config which appends some flags: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gcc `pkg-config --cflags gtk+-3.0` -o main main.c `pkg-config --libs gtk+-3.0`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SOLUTION&lt;/strong&gt;&lt;br&gt;&#xA;As per comment below, It turns out this is wrong:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(semantic-add-system-include &quot;/usr/include/gtk-3.0/gtk&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is Correct (minus 'gtk' at end), to match the  pattern:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(semantic-add-system-include &quot;/usr/include/gtk-3.0/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-04-16T13:47:23.923" LastActivityDate="2015-04-16T14:16:35.497" Title="Emacs (semantic) include not working for relative personal includes" Tags="|semantic-mode|c|development|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10707" PostTypeId="1" AcceptedAnswerId="10714" CreationDate="2015-04-15T19:41:53.523" Score="20" ViewCount="4247" Body="&lt;p&gt;How do I remove an existing hyperlink without having to wade in and manually delete a bunch of brackets? When I try to &lt;code&gt;org-insert-link&lt;/code&gt; and just delete the existing link, I get &lt;code&gt;Lisp error: (error &quot;Empty link&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to remove the link and preserve the text (i.e. the description).&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="780" LastEditDate="2015-04-16T15:57:54.043" LastActivityDate="2021-08-18T09:30:11.637" Title="in org-mode, how to remove a link?" Tags="|org-mode|" AnswerCount="7" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10708" PostTypeId="1" CreationDate="2015-04-15T20:06:05.787" Score="1" ViewCount="408" Body="&lt;p&gt;I know that this can be avoided easily, in fact there is a &lt;a href=&quot;https://emacs.stackexchange.com/q/2086/560&quot;&gt;previous question&lt;/a&gt; here that covered this matter before, but &lt;em&gt;this only works if we are using Emacs without Evil or using Evil with the&lt;/em&gt; &lt;code&gt;emacs-state&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq-default org-catch-invisible-edits  'error&#xA;                org-ctrl-k-protect-subtree 'error)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;em&gt;works perfectly fine without Evil&lt;/em&gt;. So, my question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make this work with &lt;strong&gt;Evil&lt;/strong&gt; without use &lt;code&gt;emacs-state&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="560" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-04-15T20:06:05.787" Title="Org Mode &amp; Evil: Prevent editing of hidden text within collapsed subtree" Tags="|org-mode|evil|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10709" PostTypeId="2" ParentId="10707" CreationDate="2015-04-15T21:11:20.990" Score="4" Body="&lt;p&gt;The quickest may be to place the cursor before the link, then type &lt;code&gt;C-M-space&lt;/code&gt; (&lt;code&gt;mark-sexp&lt;/code&gt;), which will mark the entire link. Then delete it by typing a backspace (if you use &lt;code&gt;delete-selection-mode&lt;/code&gt;) or &lt;code&gt;C-w&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2015-04-15T21:11:20.990" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10710" PostTypeId="2" ParentId="10059" CreationDate="2015-04-15T23:25:02.730" Score="2" Body="&lt;p&gt;This looks like a variant of &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18745&quot; rel=&quot;nofollow&quot;&gt;Emacs bug #18745&lt;/a&gt; (really a bug of Windows' &lt;code&gt;CreateProcess()&lt;/code&gt; function and/or &lt;code&gt;cmd.exe&lt;/code&gt;), apparently it applies to .exes when called via the shell. It works if you &lt;strong&gt;don't&lt;/strong&gt; quote the second argument: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(concat (shell-quote-argument msbuild) &quot; &quot; proj-file &quot; /p:Configuration=Debug&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or use the short file name instead of quoting the exe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(concat (w32-short-file-name msbuild) &quot; &quot; (shell-quote-argument proj-file) &quot; /p:Configuration=Debug&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-04-15T23:25:02.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10711" PostTypeId="2" ParentId="10707" CreationDate="2015-04-16T02:37:48.767" Score="1" Body="&lt;p&gt;This very quick and very dirty macro would be one way, not the best way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'my/org-remove-link&#xA;   [?\M-a delete delete ?\M-x ?z ?a ?p ?- ?t ?o ?- ?c ?h ?a ?r return ?\[ ?\C-e backspace backspace ?\C-x])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-04-16T02:37:48.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10712" PostTypeId="2" ParentId="10707" CreationDate="2015-04-16T04:46:56.390" Score="4" Body="&lt;p&gt;Call this command when the point is anywhere after the first &lt;code&gt;[[&lt;/code&gt; brackets of an org-link (or anywhere on/after an hyper-linked org-link).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An org link will be deleted if it is of the format &lt;code&gt;[[LINK][DESCRIPTION]]&lt;/code&gt; or &lt;code&gt;[[LINK]]&lt;/code&gt; in an &lt;code&gt;org-mode&lt;/code&gt; buffer; else nothing will happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For safety, the discarded LINK from org-link is saved to the &lt;code&gt;kill-ring&lt;/code&gt; in the event a need arises to use that link elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-delete-link ()&#xA;  &quot;Replace an org link of the format [[LINK][DESCRIPTION]] with DESCRIPTION.&#xA;If the link is of the format [[LINK]], delete the whole org link.&#xA;&#xA;In both the cases, save the LINK to the kill-ring.&#xA;&#xA;Execute this command while the point is on or after the hyper-linked org link.&quot;&#xA;  (interactive)&#xA;  (when (derived-mode-p 'org-mode)&#xA;    (let ((search-invisible t) start end)&#xA;      (save-excursion&#xA;        (when (re-search-backward &quot;\\[\\[&quot; nil :noerror)&#xA;          (when (re-search-forward &quot;\\[\\[\\(.*?\\)\\(\\]\\[.*?\\)*\\]\\]&quot; nil :noerror)&#xA;            (setq start (match-beginning 0))&#xA;            (setq end   (match-end 0))&#xA;            (kill-new (match-string-no-properties 1)) ; Save the link to kill-ring&#xA;            (replace-regexp &quot;\\[\\[.*?\\(\\]\\[\\(.*?\\)\\)*\\]\\]&quot; &quot;\\2&quot; nil start end)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-16T14:08:52.243" LastActivityDate="2015-04-16T14:08:52.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10713" PostTypeId="1" AcceptedAnswerId="10715" CreationDate="2015-04-16T08:09:47.377" Score="9" ViewCount="4146" Body="&lt;p&gt;By default, &lt;code&gt;comment-region&lt;/code&gt; inserts &lt;code&gt;#&lt;/code&gt; for comments in Octave major mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to modify the behavior so that it inserts the percent sign &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% foo &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I used the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq octave-mode-hook&#xA;      (lambda () (setq octave-comment-char ?%) ))&#xA;(modify-syntax-entry ?% &quot;&amp;lt;&quot;  octave-mode-syntax-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it gives me this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's value as variable is void: octave-mode-syntax-table&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know about elisp so well, so how can I solve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the configuration needed to make &lt;code&gt;octave-mode&lt;/code&gt; the default one for &lt;code&gt;.m&lt;/code&gt; files and change commenting behaviour to that of MATLAB's. Note that for Octave, both &lt;code&gt;%&lt;/code&gt; and &lt;code&gt;#&lt;/code&gt; are valid for commenting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.m\\'&quot; . octave-mode))&#xA;&#xA;(add-hook 'octave-mode-hook&#xA;    (lambda () (progn (setq octave-comment-char ?%)&#xA;                      (setq comment-start &quot;% &quot;)&#xA;                      (setq comment-add 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="47" LastEditorUserId="18737" LastEditDate="2018-10-12T12:15:51.770" LastActivityDate="2018-10-12T13:22:45.627" Title="How to change comment character from # (hash) to % (percent sign) for Octave major mode" Tags="|major-mode|comment|syntax-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10714" PostTypeId="2" ParentId="10707" CreationDate="2015-04-16T08:48:29.207" Score="14" Body="&lt;p&gt;The following elisp function will take a link around the current point as recognised by &lt;code&gt;org-bracket-link-regexp&lt;/code&gt;, so either &lt;code&gt;[[Link][Description]]&lt;/code&gt; or &lt;code&gt;[[Link]]&lt;/code&gt;, and replace it by &lt;code&gt;Description&lt;/code&gt; in the first case or &lt;code&gt;Link&lt;/code&gt; in the second case.&lt;/p&gt;&#xA;&lt;p&gt;New version: for org 9.3 or newer (also added &lt;code&gt;save-excursion&lt;/code&gt; as in the answer of @Chris)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun afs/org-replace-link-by-link-description ()&#xA;    &amp;quot;Replace an org link by its description or if empty its address&amp;quot;&#xA;  (interactive)&#xA;  (if (org-in-regexp org-link-bracket-re 1)&#xA;      (save-excursion&#xA;        (let ((remove (list (match-beginning 0) (match-end 0)))&#xA;              (description&#xA;               (if (match-end 2) &#xA;                   (org-match-string-no-properties 2)&#xA;                 (org-match-string-no-properties 1))))&#xA;          (apply 'delete-region remove)&#xA;          (insert description)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Alternatively the following elisp function will do such a replacement on all links in the buffer or region:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun afs/org-replace-all-links-by-description (&amp;amp;optional start end)&#xA;  &amp;quot;Find all org links and replace by their descriptions.&amp;quot;&#xA;  (interactive&#xA;   (if (use-region-p) (list (region-beginning) (region-end))&#xA;     (list (point-min) (point-max))))&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (narrow-to-region start end)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward org-link-bracket-re nil t)&#xA;        (replace-match (match-string-no-properties &#xA;                        (if (match-end 2) 2 1)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above is for org 9.4, where &lt;code&gt;org-match-string-no-properities&lt;/code&gt; has been obseleted in favour of &lt;code&gt;match-string-no-properties&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Old version: before org 9.3&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun afs/org-replace-link-by-link-description ()&#xA;    &amp;quot;Replace an org link by its description or if empty its address&amp;quot;&#xA;  (interactive)&#xA;  (if (org-in-regexp org-bracket-link-regexp 1)&#xA;      (let ((remove (list (match-beginning 0) (match-end 0)))&#xA;        (description (if (match-end 3) &#xA;                 (org-match-string-no-properties 3)&#xA;                 (org-match-string-no-properties 1))))&#xA;    (apply 'delete-region remove)&#xA;    (insert description))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In org version 9.3 &lt;code&gt;org-bracket-link-regexp&lt;/code&gt; was obsoleted, but aliased to the new &lt;code&gt;org-link-bracket-re&lt;/code&gt;.  The new regexp is documented in &lt;code&gt;ol.el&lt;/code&gt; as&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;org-link-bracket-re&#xA;(rx (seq &amp;quot;[[&amp;quot;&#xA;         ;; URI part: match group 1.&#xA;         (group&#xA;          (one-or-more&#xA;               (or (not (any &amp;quot;[]\\&amp;quot;))&#xA;               (and &amp;quot;\\&amp;quot; (zero-or-more &amp;quot;\\\\&amp;quot;) (any &amp;quot;[]&amp;quot;))&#xA;               (and (one-or-more &amp;quot;\\&amp;quot;) (not (any &amp;quot;[]&amp;quot;))))))&#xA;         &amp;quot;]&amp;quot;&#xA;         ;; Description (optional): match group 2.&#xA;         (opt &amp;quot;[&amp;quot; (group (+? anything)) &amp;quot;]&amp;quot;)&#xA;         &amp;quot;]&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;so the second group now matches the description of the link if present.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2021-08-18T09:30:11.637" LastActivityDate="2021-08-18T09:30:11.637" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="10715" PostTypeId="2" ParentId="10713" CreationDate="2015-04-16T09:36:19.673" Score="11" Body="&lt;p&gt;Inside your hook put this: &lt;code&gt;(setq comment-start &quot;% &quot;)&lt;/code&gt;. Also, this will explain why:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;comment-region is an interactive compiled Lisp function.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(comment-region BEG END &amp;amp;optional ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Comment or uncomment each line in the region. With just C-u prefix&#xA;  arg, uncomment each line in region BEG .. END. Numeric prefix ARG&#xA;  means use ARG comment characters. If ARG is negative, delete that many&#xA;  comment characters instead.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The strings used as comment starts are built from &lt;code&gt;comment-start&lt;/code&gt; and&#xA;  &lt;code&gt;comment-padding&lt;/code&gt;; the strings used as comment ends are built from&#xA;  &lt;code&gt;comment-end&lt;/code&gt; and &lt;code&gt;comment-padding&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;By default, the &lt;code&gt;comment-start&lt;/code&gt; markers are inserted at the current&#xA;  indentation of the region, and comments are terminated on each line&#xA;  (even for syntaxes in which newline does not end the comment and blank&#xA;  lines do not get comments).  This can be changed with &lt;code&gt;comment-style&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-04-16T09:36:19.673" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10716" PostTypeId="1" AcceptedAnswerId="10719" CreationDate="2015-04-16T11:57:35.180" Score="1" ViewCount="1403" Body="&lt;p&gt;I want CTRL to be my personal modifier for my bindings and CAPSLOCK to act as CTRL only in Emacs. Most of the material out there shows you how to &lt;em&gt;swap&lt;/em&gt; these two modifiers. However, since I use CTRL outside of Emacs regularly, changing the meaning of CTRL in OS level is not something I desire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OS: Debian Wheezy (amd64), Gnome 3.4.2&lt;/p&gt;&#xA;" OwnerUserId="7034" LastEditorUserId="7034" LastEditDate="2015-04-16T12:20:02.037" LastActivityDate="2015-04-16T14:50:10.160" Title="Changing CTRL with CAPSLOCK" Tags="|keymap|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10717" PostTypeId="1" AcceptedAnswerId="13745" CreationDate="2015-04-16T13:05:07.187" Score="11" ViewCount="997" Body="&lt;p&gt;I recently started using Helm and am really enjoying it. However, I use emacs to write a lot of LaTeX. When I cite articles, I often need to cite several in the same cite macro - I could search my bibliography file for two separate entries very easily, using RefTex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;citekey1\|citekey2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However when helm mode is on, this no longer works. I can still search for single articles but not multiple articles. How can I do the above in helm?&lt;/p&gt;&#xA;" OwnerUserId="7067" LastEditorUserId="7067" LastEditDate="2015-04-17T19:29:53.307" LastActivityDate="2015-07-06T14:32:24.933" Title="RefTex searching for multiple articles with Helm" Tags="|helm|auctex|latex|reftex-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10718" PostTypeId="2" ParentId="10706" CreationDate="2015-04-16T14:16:35.497" Score="1" Body="&lt;p&gt;Just add &lt;code&gt;(semantic-add-system-include &quot;/usr/include/gtk-3.0/&quot;)&lt;/code&gt;. It is because you use include your header as &lt;code&gt;#include &amp;lt;gtk/gtk.h&amp;gt;&lt;/code&gt;, so the file you included will be found when the two paths are combined. It is the same thing for other packages or editors out there.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-04-16T14:16:35.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10719" PostTypeId="2" ParentId="10716" CreationDate="2015-04-16T14:50:10.160" Score="1" Body="&lt;p&gt;According to &lt;a href=&quot;https://stackoverflow.com/questions/508874/how-to-remap-keys-when-in-emacs&quot;&gt;this&lt;/a&gt; you can not rebind the CAPSLOCK. However, with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;setxkbmap -option caps:hyper&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I remapped capslock to hyper modifier which effectively granted me an additional modifier that I could use to bind keys. I would prefer the location of CTRL instead of CAPSLOCK for personal bindings, but unfortunately, that may not be possible without altering default CTRL button behaviour.&lt;/p&gt;&#xA;" OwnerUserId="7034" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-04-16T14:50:10.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10720" PostTypeId="1" AcceptedAnswerId="10721" CreationDate="2015-04-16T15:57:00.817" Score="3" ViewCount="227" Body="&lt;p&gt;When I open a group in Gnus, it insists on resetting the window layout and using the entire frame for the group buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd rather manage the window layout myself, so how can I make Gnus not change it for me?&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-04-16T15:57:00.817" Title="How do I prevent Gnus from changing the window layout?" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10721" PostTypeId="2" ParentId="10720" CreationDate="2015-04-16T15:57:00.817" Score="4" Body="&lt;p&gt;Set the variable &lt;code&gt;gnus-use-full-window&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Window-Layout.html&quot; rel=&quot;nofollow&quot;&gt;The manual warns&lt;/a&gt; against doing so:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Setting this variable to &lt;code&gt;nil&lt;/code&gt; kinda works, but there are glitches. Use at your own peril.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But I haven't seen anything I'd call &quot;glitches&quot; related to that.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-04-16T15:57:00.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10722" PostTypeId="1" AcceptedAnswerId="10735" CreationDate="2015-04-16T16:21:37.470" Score="25" ViewCount="22254" Body="&lt;p&gt;Having some issues with &lt;code&gt;PATH&lt;/code&gt; settings on Emacs that are affecting my Haskell environment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using ZSH, and when I go to the command line and call &lt;code&gt;echo $PATH&lt;/code&gt;, it returns: &lt;code&gt;/Users/g/Library/Haskell/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is coming from &lt;code&gt;.zprofile&lt;/code&gt; configuration where I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Set the list of directories that Zsh searches for programs.&#xA;path=(&#xA;  ~/Library/Haskell/bin&#xA;  /usr/local/{bin,sbin}&#xA;  $path&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, from command line, when I call &lt;code&gt;which cabal&lt;/code&gt;, I correctly get: &lt;code&gt;/Users/g/Library/Haskell/bin/cabal&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start Emacs and go to the &lt;code&gt;shell&lt;/code&gt; and call &lt;code&gt;which cabal&lt;/code&gt;, I get: &lt;code&gt;/usr/bin/cabal&lt;/code&gt; which is causing me issue since it's a different version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I inspect &lt;code&gt;echo $PATH&lt;/code&gt; from the Emacs &lt;code&gt;shell&lt;/code&gt;, I see: &lt;code&gt;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/g/Library/Haskell/bin:/usr/local/sbin&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've no idea how on earth the &lt;code&gt;PATH&lt;/code&gt; can be different...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone knows how to get my &lt;code&gt;ZSH&lt;/code&gt; shell and Emacs to agree on the same &lt;code&gt;PATH&lt;/code&gt;? I suspect that's what's controlling where &lt;code&gt;cabal&lt;/code&gt; is being loaded from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Running &lt;code&gt;echo $SHELL&lt;/code&gt; from Emacs prints: &lt;code&gt;/bin/zsh&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE 2&lt;/strong&gt;: This is on &lt;strong&gt;OSX&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE 3&lt;/strong&gt;: I have tried to use &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt; module and it does not work. I still have same issues, and as a side effect, it messes up my terminal theme colours :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE 4&lt;/strong&gt;: I've installed Emacs via &lt;code&gt;brew install --cocoa --srgb emacs&lt;/code&gt; and I run emacs that's linked this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ ❯❯❯ which emacs&#xA;/usr/local/bin/emacs&#xA;~ ❯❯❯ l /usr/local/bin/emacs&#xA;lrwxr-xr-x  1 g  admin    30B 29 Jan 18:34 /usr/local/bin/emacs -&amp;gt; ../Cellar/emacs/24.4/bin/emacs&#xA;~ ❯❯❯ l /usr/local/Cellar/emacs/24.4/bin/emacs&#xA;-r-xr-xr-x  1 g  admin    87B 29 Jan 18:34 /usr/local/Cellar/emacs/24.4/bin/emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="25" LastEditDate="2015-06-27T10:46:34.247" LastActivityDate="2023-01-09T12:50:06.493" Title="Emacs and command line $PATH disagreements on OSX" Tags="|osx|shell|path|haskell-mode|" AnswerCount="7" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10723" PostTypeId="1" AcceptedAnswerId="10725" CreationDate="2015-04-16T18:33:22.677" Score="12" ViewCount="1848" Body="&lt;p&gt;How do I avoid byte-compiler warnings &lt;code&gt;Unused lexical variable&lt;/code&gt; in functions defined using macros expanding to &lt;code&gt;defun&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., macro &lt;code&gt;defun-rcirc-command&lt;/code&gt; in&#xA;&lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/net/rcirc.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;rcirc.el&lt;/code&gt;&lt;/a&gt;&#xA;uses the &lt;code&gt;target&lt;/code&gt; variable which is not used by several invocations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Common Lisp I can use the&#xA;&lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Body/d_ignore.htm&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ignorable&lt;/code&gt;&lt;/a&gt;&#xA;declaration: &lt;code&gt;(declare (ignorable target))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bad solutions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Add something like &lt;code&gt;(setq target target)&lt;/code&gt; to all the users of&#xA;&lt;code&gt;defun-rcirc-command&lt;/code&gt; which do not use &lt;code&gt;target&lt;/code&gt;: that requires&#xA;modifying &lt;em&gt;many&lt;/em&gt; macro invocations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Prefixing the ignorable variable with an underscore - &lt;code&gt;_target&lt;/code&gt; - does not help because &lt;code&gt;_&lt;/code&gt; means &lt;code&gt;ignore&lt;/code&gt;, not &lt;code&gt;ignorable&lt;/code&gt;, i.e., when it is used, I get &lt;code&gt;variable '_target' not left unused&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2015-04-17T16:48:52.417" LastActivityDate="2015-04-17T16:48:52.417" Title="How do I declare a variable ignorable?" Tags="|compilation|warning|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10724" PostTypeId="2" ParentId="10723" CreationDate="2015-04-16T21:21:46.740" Score="-1" Body="&lt;p&gt;Looking at the code, it appears that target is not intended to be a global variable but passed to the created function when it is called.  If that is the case, it is better to create it as a symbol local to the macro.  A simple example of a macro that creates a function that accepts an argument and adds 10 to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro xxx (name)  &#xA;  &quot;&quot;&#xA;  (let ((target (make-symbol &quot;target&quot;)))&#xA;  `(defun ,name (,target) (+ 10 ,target))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(xxx hamster)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will result in a function named hamster that accepts one argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can call &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hamster 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it will return &lt;code&gt;15&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick is to create a new symbol that will act as the argument to the new function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have always seen that if you are referring to the generated symbol in the passed in body expression, you include the name in the call like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro xxx (name t2 &amp;amp;rest body)  &#xA;  &quot;&quot;&#xA;  (let ((t2-arg (make-symbol &quot;target&quot;)))&#xA;  `(defun ,name (&amp;amp;optional ,t2-arg) &#xA;     (let ((,t2 (or ,t2-arg 10)))&#xA;       ,@body))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which then turns the calls into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(xxx hamster target (+ target 20))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hamster)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which returns &lt;code&gt;30&lt;/code&gt; and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hamster 20)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns &lt;code&gt;40&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Admittedly, this always bugs me when I write macros this way until I look at the usage in which it appears a parameter is declared and later used.&lt;/p&gt;&#xA;" OwnerUserId="181" LastEditorUserId="181" LastEditDate="2015-04-16T21:53:25.087" LastActivityDate="2015-04-16T21:53:25.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10725" PostTypeId="2" ParentId="10723" CreationDate="2015-04-16T21:34:43.753" Score="16" Body="&lt;p&gt;The way I've done that so far is to add a call of the shape&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ignore &amp;lt;var&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function call will be optimized away, but before that the compiler will still count it as a use, so the &quot;unused&quot; warning won't be triggered.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-16T21:34:43.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10726" PostTypeId="1" CreationDate="2015-04-16T21:50:14.963" Score="3" ViewCount="1140" Body="&lt;p&gt;I'm using Spacemacs. I noticed that in &lt;code&gt;help-mode&lt;/code&gt;, &lt;kbd&gt;q&lt;/kbd&gt; quits, which is exactly what I want. However, in certain other modes, &lt;code&gt;customize-mode&lt;/code&gt;, for example, &lt;kbd&gt;q&lt;/kbd&gt; is bound to &lt;code&gt;evil-record-macro&lt;/code&gt;. (I set it to start in normal state rather than in emacs state because I like the vim navigation keybindings.) I tried &lt;code&gt;(evil-define-key 'normal custom-mode-map &quot;q&quot; nil)&lt;/code&gt;, but it didn't rebind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I modify the keybinding so that &lt;kbd&gt;q&lt;/kbd&gt; quits as expected?&lt;/p&gt;&#xA;" OwnerUserId="6761" LastEditorUserId="675" LastEditDate="2015-04-17T01:22:59.097" LastActivityDate="2016-01-12T08:25:30.223" Title="How can I disable &quot;q&quot; in normal state in evil for some modes?" Tags="|customize|evil|spacemacs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10727" PostTypeId="2" ParentId="10722" CreationDate="2015-04-16T21:56:47.117" Score="6" Body="&lt;p&gt;If you start emacs from your GUI environment (gnome, kde, ...) your shell startup scripts will not be sourced into your environment. So the &lt;code&gt;$PATH&lt;/code&gt; that you carefully set in your &lt;code&gt;.zsh&lt;/code&gt; will not be loaded. GUI environments do not generally source these, though they may load your &lt;code&gt;~/.profile&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try adding this to your &lt;code&gt;.pam_environment&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;PATH DEFAULT=${PATH}:/MYHOMEDIR/Library/Haskell/bin:/usr/local/bin:/usr/local/sbin&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to restart your GUI session to load it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This document might help you to get your &lt;code&gt;$PATH&lt;/code&gt; variable set properly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://help.ubuntu.com/community/EnvironmentVariables#Session-wide_environment_variables&quot; rel=&quot;noreferrer&quot;&gt;https://help.ubuntu.com/community/EnvironmentVariables#Session-wide_environment_variables&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the &lt;code&gt;~/.pam_environment&lt;/code&gt; file to managed environment variables that I need to be accessible from my shell or emacs processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: An astute commenter points out that you are probably on Mac. I don't know how to set up your &lt;code&gt;$PATH&lt;/code&gt; in the Mac GUI, but the point still stands regarding the difference between your shell's environment and the GUI environment.  How you set up the &lt;code&gt;$PATH&lt;/code&gt; for the GUI seems to depend on the OS version. However you can use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:/foo/bar&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in your &lt;code&gt;~/.emacs.d/init&lt;/code&gt; if you just want a solution that should work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PPS: If you want to run a shell in emacs, you are probably better off using &lt;code&gt;ansi-term&lt;/code&gt; rather than &lt;code&gt;shell&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="838" LastEditorUserId="838" LastEditDate="2015-04-17T02:25:02.800" LastActivityDate="2015-04-17T02:25:02.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10728" PostTypeId="2" ParentId="10726" CreationDate="2015-04-16T22:02:37.467" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html&quot; rel=&quot;nofollow&quot;&gt;Customize&lt;/a&gt; appears to be &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html&quot; rel=&quot;nofollow&quot;&gt;autoloaded&lt;/a&gt;, so Emacs won't know about &lt;code&gt;custom-mode-map&lt;/code&gt; until after you run &lt;code&gt;customize&lt;/code&gt;.  The following should rebind &lt;kbd&gt;q&lt;/kbd&gt; to run &lt;code&gt;test&lt;/code&gt; in normal state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  (interactive)&#xA;  (message &quot;testing&quot;))&#xA;&#xA;(eval-after-load &quot;custom&quot;&#xA;  '(evil-define-key 'normal custom-mode-map &quot;q&quot; #'test))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-16T22:02:37.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10729" PostTypeId="1" CreationDate="2015-04-16T22:16:50.220" Score="2" ViewCount="181" Body="&lt;p&gt;In Mac OS X Lion and above, scroll bars can &quot;float&quot; on top of the content and only appear when scrolling. This provides insight on where you are in a document as well as the size of the document, without the scroll bar taking up room. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs by default does not respect this system setting. For the Emacs GUI, is there any way to enable this?&lt;/p&gt;&#xA;" OwnerUserId="6745" LastEditorUserId="25" LastEditDate="2015-04-19T14:05:51.220" LastActivityDate="2015-04-19T14:05:51.220" Title="Floating Scroll Bars" Tags="|osx|scroll-bars|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10730" PostTypeId="1" CreationDate="2015-04-16T23:14:26.543" Score="0" ViewCount="102" Body="&lt;p&gt;So this is some elisp code I have in my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun complete-dollar () &#xA;  (interactive)&#xA;  (insert &quot;$$&quot;)&#xA;  (backward-char 1))&#xA;&#xA;(defun my-latex-keys ()&#xA;  &quot;Modify keymaps by latex-mode&quot;&#xA;  (local-set-key (kbd &quot;$&quot;) 'complete-dollar))&#xA;&#xA;(add-hook 'latex-mode-hook 'my-latex-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I open a tex file to test it. And when I type a &lt;code&gt;$&lt;/code&gt; it just gives&#xA;me &lt;code&gt;$&lt;/code&gt; instead of &lt;code&gt;$$&lt;/code&gt; as expected from the above elisp code. This is&#xA;the value for the major-mode variable in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;major-mode: latex-mode&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also the key &lt;code&gt;$&lt;/code&gt; is binded to &lt;code&gt;autopair-insert-or-skip-paired-delimiter&lt;/code&gt; when I inspect it. Any&#xA;reason on why it's not working ? (Also, if my elisp code isn't the&#xA;correct way of doing this, I would love to know the recommended&#xA;approach)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;Ok, this made it to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'sibi-latex-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my question is how to find which hook is the approriate one out of the following choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;latex-mode-hook &lt;/li&gt;&#xA;&lt;li&gt;LaTeX-mode-hook&lt;/li&gt;&#xA;&lt;li&gt;tex-mode-hook&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="904" LastEditorUserId="904" LastEditDate="2015-04-16T23:22:14.050" LastActivityDate="2015-04-17T18:28:36.270" Title="Finding proper hook for a major mode" Tags="|latex|hooks|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10731" PostTypeId="1" AcceptedAnswerId="10734" CreationDate="2015-04-16T23:45:29.577" Score="4" ViewCount="347" Body="&lt;p&gt;Let's say I want to provide partial input to an interactive function such as &lt;code&gt;insert-char&lt;/code&gt;. For example, I might want to have a command that automatically starts typing &lt;code&gt;GREEK SMALL LETTER&lt;/code&gt; or &lt;code&gt;BOX DRAWINGS&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does not work, because &lt;code&gt;call-interactively&lt;/code&gt; exits before &lt;code&gt;insert&lt;/code&gt; is called:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-box-drawing-char ()&#xA;  (interactive)&#xA;  (call-interactively 'insert-char)&#xA;  (insert &quot;BOX DRAWING&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I provide partial input to an interactive function?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-04-17T05:46:37.000" Title="Partial input to interactive command" Tags="|interactive|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10732" PostTypeId="1" CreationDate="2015-04-16T23:53:55.077" Score="2" ViewCount="423" Body="&lt;p&gt;I would like the org capture buffer (which IIUC is in org-capture-mode, a minor mode) to start in insert state; It seems that both the evil-insert-state-modes variable and the evil-set-initial-state function operate over major modes (or at least, when I run org-capture after modifying the former or calling the latter, the buffer that opens up does not start in insert state).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone ahve any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="6761" LastActivityDate="2022-12-22T18:06:20.603" Title="Start in insert state based on minor mode" Tags="|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10733" PostTypeId="2" ParentId="10396" CreationDate="2015-04-16T23:59:34.070" Score="11" Body="&lt;p&gt;This example made me much easy to understand the difference between &lt;code&gt;:init&lt;/code&gt; and &lt;code&gt;:config&lt;/code&gt;. Let's take an example of &lt;code&gt;ace-window&lt;/code&gt; package (but this can be any package). Put this in your &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ace-window&#xA;  :ensure t&#xA;  :defer t&#xA;  :config&#xA;  (progn&#xA;    (message &quot;ace window: hello world&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now open your emacs and see in the &lt;code&gt;*Messages*&lt;/code&gt; buffer to see if there any &lt;code&gt;hello world&lt;/code&gt; message. You won't be able to find any because the package is deferred. Now change from &lt;code&gt;config&lt;/code&gt; to &lt;code&gt;init&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ace-window&#xA;  :ensure t&#xA;  :defer t&#xA;  :init&#xA;  (progn&#xA;    (message &quot;ace window: hello world&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now close and re-open emacs and inspect the &lt;code&gt;*Messages*&lt;/code&gt; buffer. You will see the message &lt;code&gt;ace window: hello world&lt;/code&gt; because the code is run no matter what when &lt;code&gt;:init&lt;/code&gt; is given. In the case of &lt;code&gt;config&lt;/code&gt; it will be only run when that package is loaded.&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="904" LastEditDate="2015-04-17T00:07:54.303" LastActivityDate="2015-04-17T00:07:54.303" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10734" PostTypeId="2" ParentId="10731" CreationDate="2015-04-17T05:34:30.823" Score="5" Body="&lt;p&gt;So you want to invoke a command and have a given string automatically inserted at that command's interactive prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this using &lt;code&gt;minibuffer-setup-hook&lt;/code&gt;, and there is a handy macro which takes care of adding and removing the desired function to this hook, while ensuring that it only runs when you wanted it to run:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(minibuffer-with-setup-hook&#xA;    (lambda () (insert &quot;BOX DRAWING&quot;))&#xA;  (call-interactively 'insert-char))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-04-17T05:46:37.000" LastActivityDate="2015-04-17T05:46:37.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10735" PostTypeId="2" ParentId="10722" CreationDate="2015-04-17T07:16:36.430" Score="11" Body="&lt;p&gt;This is an OSX annoying environment issue, the &lt;code&gt;$PATH&lt;/code&gt; appearing in Emacs is coming from &lt;code&gt;/etc/paths&lt;/code&gt; file, which then gets appended with whatever I've set in the shell. I added &lt;code&gt;/Users/g/Library/Haskell/bin&lt;/code&gt; to the top of the &lt;code&gt;/etc/paths&lt;/code&gt; file and it then worked fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going into shell and calling &lt;code&gt;echo $PATH&lt;/code&gt; in Emacs shows now: &lt;code&gt;/Users/g/Library/Haskell/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;cabal&lt;/code&gt;'s version is indeed &lt;code&gt;cabal-install version 1.22.2.0&lt;/code&gt; :D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks all!!&lt;/p&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2015-04-17T07:16:36.430" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10736" PostTypeId="1" AcceptedAnswerId="10744" CreationDate="2015-04-17T07:52:43.107" Score="3" ViewCount="777" Body="&lt;p&gt;It annoys, when autocompletion &amp;amp; indentation both gets called on &lt;code&gt;TAB&lt;/code&gt; press. So, i configured to use &lt;code&gt;TAB&lt;/code&gt; key only for indentation as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tab-always-indent t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, when i enable &lt;code&gt;yas-minor-mode&lt;/code&gt; to place code snippets, it doesn't work since i have bound &lt;code&gt;TAB&lt;/code&gt; key only for indentation. Is there any other key binding (or) &lt;code&gt;yasnippet&lt;/code&gt; function that can i use/call to get this feature?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2024-03-04T16:35:34.610" Title="Yasnippet doesn't work when tab-always-indent set to true" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10737" PostTypeId="2" ParentId="10722" CreationDate="2015-04-17T09:55:55.133" Score="27" Body="&lt;p&gt;You can also install &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell package&lt;/a&gt; and add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(exec-path-from-shell-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6732" LastEditorUserId="6732" LastEditDate="2015-04-18T14:58:19.587" LastActivityDate="2015-04-18T14:58:19.587" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10738" PostTypeId="1" AcceptedAnswerId="12224" CreationDate="2015-04-17T11:15:25.617" Score="0" ViewCount="1102" Body="&lt;p&gt;I am trying to debug a C/MPI library that I have built. All objects are compiled using GCC and &lt;code&gt;-ggdb&lt;/code&gt;, they are also linked using &lt;code&gt;-ggdb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to attach a gdb session to the process with the &lt;code&gt;-p PID&lt;/code&gt; flag from a standard shell, I have no problems. I can debug and access all source file info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I invoke a GDB session in Emacs 24.3.1, GDB reports that it cannot load my shared library:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; warning: Could not load shared library symbols for ./libllg.so.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I noticed that Emacs called GDB with the flag &lt;code&gt;-i=mi&lt;/code&gt; is this causing the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything is exactly the same, the symbol is found from a normal bash shell but not from the emacs GDB implementation. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="7078" LastActivityDate="2015-05-07T14:08:29.587" Title="Emacs GDB does not load shared library symbols" Tags="|libraries|c|gdb|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10739" PostTypeId="1" AcceptedAnswerId="10742" CreationDate="2015-04-17T11:24:45.323" Score="2" ViewCount="260" Body="&lt;p&gt;How to determine if in the current buffer some text is selected?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-04-17T13:54:52.327" Title="How to detect if in the current buffer some text is selected (marked)?" Tags="|mark|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10741" PostTypeId="2" ParentId="10722" CreationDate="2015-04-17T12:56:06.843" Score="3" Body="&lt;p&gt;If some part of the PATH gets lost then you can add it in your ~/.emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; We add /path/to/something/extra by appending it to the path&#xA;(setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:/path/to/something/extra&quot;))&#xA;;;; /path/to/something/extra is now at the end of the PATH.&#xA;;;; or you can use:&#xA;;(setenv &quot;PATH&quot; (concat &quot;/path/to/something/extra:&quot; (getenv &quot;PATH&quot;)))&#xA;;;; /path/to/something/extra is now at the beginning of the PATH.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To avoid PATH issues, I always start emacs from the command line with the PATH exported from ~/.bashrc. &lt;/p&gt;&#xA;" OwnerUserId="6532" LastActivityDate="2015-04-17T12:56:06.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10742" PostTypeId="2" ParentId="10739" CreationDate="2015-04-17T13:54:52.327" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;region-active-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to add something to the short answer, &lt;code&gt;region-active-p&lt;/code&gt; won't&#xA;work in &lt;code&gt;-batch&lt;/code&gt;, so you need to enable this (which is actually&#xA;default in plain Emacs):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(transient-mark-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-17T13:54:52.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10743" PostTypeId="1" CreationDate="2015-04-17T14:01:03.363" Score="2" ViewCount="257" Body="&lt;p&gt;Is there a way to format target links created by org-mode when using radio targets such as the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;some text&amp;gt;&amp;gt;&amp;gt; where that some text is linked back &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When outputting to HTML or PDF (created through LaTeX processor), the links are active and work well when clicked. However, I want the second &quot;some text&quot; printed in a different format so visually it's apparent that is a hyperlink. By default radio source and targets print the same. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-04-17T14:01:03.363" Title="Format &lt;&lt;&lt;target links&gt;&gt;&gt; in org-mode for printing" Tags="|org-mode|org-export|org-babel|pdf|hyperlinks|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10744" PostTypeId="2" ParentId="10736" CreationDate="2015-04-17T14:34:30.780" Score="2" Body="&lt;p&gt;From the &lt;a href=&quot;https://joaotavora.github.io/yasnippet/snippet-expansion.html#org87a6f68&quot; rel=&quot;nofollow noreferrer&quot;&gt;yas-snippet manual&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;h1&gt;Trigger key&lt;/h1&gt;&#xA;&lt;p&gt;yas-expand tries to expand a snippet abbrev (also known as snippet key) before point.&lt;/p&gt;&#xA;&lt;p&gt;When yas-minor-mode is enabled, it binds yas-expand to TAB and  by default, however, you can freely set it to some other key:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key yas-minor-mode-map (kbd &amp;quot;&amp;lt;tab&amp;gt;&amp;quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &amp;quot;TAB&amp;quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &amp;quot;&amp;lt;the new key&amp;gt;&amp;quot;) 'yas-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="18529" LastEditDate="2024-03-04T16:35:34.610" LastActivityDate="2024-03-04T16:35:34.610" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10745" PostTypeId="1" AcceptedAnswerId="16613" CreationDate="2015-04-17T15:30:20.020" Score="4" ViewCount="372" Body="&lt;h2&gt;Issue&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I am able to change the frame position using &lt;code&gt;set-frame-position&lt;/code&gt;. But the moment I use a function which uses &lt;code&gt;read-from-minibuffer&lt;/code&gt;, the frame restores its position to where it was set using the mouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this is a bug because I have seen this issue probably since emacs 24.3 and am still seeing it in the latest build of emacs from its master branch.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How to replicate this problem?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here's a test function to help you replicate this problem.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/alter-frame-pos ()&#xA;  (interactive)&#xA;  (set-frame-position nil 100 100)) ; pixels x y from upper left&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Launch &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Eval the above function in the *scratch* buffer.&lt;/li&gt;&#xA;&lt;li&gt;Position the frame to any random location &lt;strong&gt;using&lt;/strong&gt; the mouse&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x my/alter-frame-pos&lt;/code&gt;. You should see the frame jump to (100,100) pixel location.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x find-file&lt;/code&gt; or &lt;code&gt;C-x C-f&lt;/code&gt; (this is one of the functions that uses &lt;code&gt;read-from-minibuffer&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;The frame will jump back to wherever you set it using the mouse!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So basically my frame altering elisp snippet is useless as I have to use the mouse to make the position stick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried edebug but I couldn't go further as &lt;code&gt;read-from-minibuffer&lt;/code&gt; is in C and I can't figure out how mouse based frame dragging sets its position.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution attempt 1&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I tried using Drew's suggestion but the problem still persists.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/alter-frame-pos ()&#xA;  (interactive)&#xA;  (set-frame-parameter nil 'user-position t)&#xA;  (set-frame-position nil 100 100)) ; pixels x y from upper left&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;As of writing this question, I was using emacs 25 built on April 16 2015 on RHEL 5.10, GTK+ version 2.10.4, Gnome 2.16.0.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Questions&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Are you able to replicate this issue?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As Drew reported, this issue is not replicated on Windows. So the problem could be specific to Linux or the flavor of Linux I am using (default Gnome that came with RHEL 5.10).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;s&gt;If so, is there a right way of setting the frame position using elisp?&lt;/s&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Should this be filed as a bug report?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;debbugs &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20361&quot; rel=&quot;nofollow&quot;&gt;#20361&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-17T18:09:11.477" LastActivityDate="2015-09-14T20:43:05.007" Title="Frame position change using elisp not sticking" Tags="|elisp|frames|linux|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10747" PostTypeId="2" ParentId="10745" CreationDate="2015-04-17T16:47:07.917" Score="0" Body="&lt;p&gt;See frame parameter &lt;code&gt;user-position&lt;/code&gt;, and the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Position-Parameters.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Positional Parameters&lt;/code&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set parameter &lt;code&gt;user-position&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt;, to tell your window manager that the position you have moved the frame to is, in effect, a user-defined position.  This suggests to the window manager not to mess with it further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And no, I don't see that problem using your recipe. But I am using MS Windows, and the behavior for this kind of thing can be window manager-specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And no, this should not be filed as a bug report, I think.  Whether programmatic setting of frame parameters should be considered by the window manager as having been set by the user is a choice that depends on the context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is the raison d'etre for parameter &lt;code&gt;user-position&lt;/code&gt;. In some cases you do not want programmatic changes to override the position that a user might have established. In your example, suppose that, for some context, you do &lt;em&gt;not&lt;/em&gt; want the program to override the position the user chose with the mouse.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-17T17:02:39.320" LastActivityDate="2015-04-17T17:02:39.320" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10748" PostTypeId="1" CreationDate="2015-04-09T22:42:55.863" Score="10" ViewCount="1349" Body="&lt;p&gt;If the buffer is too narrow, if I make a tag for a heading, the amount of whitespace before the tag causes the tag to wrap past the end of the line onto a new line (I have &lt;code&gt;visual-line-mode&lt;/code&gt; turned on). This makes it difficult to skim and read the headlines, and wastes vertical screen real-estate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think ideally the tag would always display as right aligned, regardless of the true number of spaces. Is there a way to do that? If not, is there some other way of avoiding the wasted space?&lt;/p&gt;&#xA;" OwnerUserId="8234" OwnerDisplayName="avv" LastActivityDate="2016-07-12T18:46:49.893" Title="Is there a way to make tags work well with line wrapping in emacs org mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10751" PostTypeId="2" ParentId="10748" CreationDate="2015-04-17T18:30:06.657" Score="2" Body="&lt;p&gt;I've been working on some elisp to solve an issue similar to this. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nanny/org-realign-tag-column ()&#xA;  (interactive)&#xA;  (if (and (equal major-mode 'org-mode)&#xA;           (org-get-buffer-tags))&#xA;      ;; ignore `message' with flet so org-set-tags doesn't yell at us.&#xA;      (flet ((message (&amp;amp;rest args) 'ignore))&#xA;        (let ((col (- (- (window-width) 3)))&#xA;              (already-modified? (buffer-modified-p)))&#xA;          (setq org-tags-column col)&#xA;          (org-set-tags 4 t)&#xA;          ;; `org-set-tags' modifies the buffer, but I don't really care, so&#xA;          ;; mark the buffer as unmodified if it was unmodified previously.&#xA;          (if (not already-modified?)&#xA;              (set-buffer-modified-p nil))))))&#xA;(add-hook 'window-configuration-change-hook 'nanny/org-realign-tag-column)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should realign the tags column so that it's always the perfect size. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now it doesn't work properly if the horizontally-split window widths are not equal.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="675" LastEditDate="2016-07-12T18:46:49.893" LastActivityDate="2016-07-12T18:46:49.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10752" PostTypeId="1" CreationDate="2015-04-17T20:04:20.940" Score="7" ViewCount="663" Body="&lt;p&gt;I would like to be able to review Github pull requests as a single ediff&#xA;&quot;session&quot; (if that's the right word). However, whenever I use &lt;code&gt;magit-ediff&lt;/code&gt; from&#xA;Magit, I can only ediff a single file at once, then I have to exit the ediff&#xA;session and restart a new ediff session on the next file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can use ediff to review an entire Github pull request that may&#xA;have multiple commits and multiple changed files?&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2015-04-24T16:50:38.847" Title="Using ediff to view a Github pull request" Tags="|ediff|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10753" PostTypeId="1" AcceptedAnswerId="10755" CreationDate="2015-04-17T22:30:26.060" Score="2" ViewCount="873" Body="&lt;p&gt;In &lt;code&gt;cc-mode&lt;/code&gt;, when we go to compile, &lt;kbd&gt;M-x&lt;/kbd&gt; followed by &lt;code&gt;compile&lt;/code&gt;, the default option is &lt;code&gt;make -k&lt;/code&gt;. If I hit the down arrow, I am told no defaults available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to add the option &lt;code&gt;g++ -Wall currentfile.cpp -o currentfile -std=c++14&lt;/code&gt; to the default compile options where currentfile is filled in by the name of the &lt;code&gt;.cpp&lt;/code&gt; program I am editing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is too difficult to have the currentfile populate, would it be possible to have &lt;code&gt;g++ -Wall -std=c++14&lt;/code&gt; come up? Then I can fill in &lt;code&gt;x.cpp -o x&lt;/code&gt;. However, option is one is the most desirable.&lt;/p&gt;&#xA;" OwnerUserId="2603" LastActivityDate="2016-11-24T14:52:39.017" Title="Changing or adding compiling options in cc-mode" Tags="|compilation|c++|cc-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10754" PostTypeId="2" ParentId="10753" CreationDate="2015-04-18T02:55:20.173" Score="0" Body="&lt;p&gt;The manual has a very useful entry on this, with an example of setting it based on the current file. (use &lt;kbd&gt;Ctrl-h&lt;/kbd&gt; &lt;kbd&gt; v &lt;/kbd&gt;compile-command)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sometimes it is useful for files to supply local values for this variable.&#xA;  You might also use mode hooks to specify it in certain modes, like this:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c-mode-hook&#xA;   (lambda ()&#xA; (unless (or (file-exists-p &quot;makefile&quot;)&#xA;         (file-exists-p &quot;Makefile&quot;))&#xA;   (set (make-local-variable 'compile-command)&#xA;    (concat &quot;make -k &quot;&#xA;        (file-name-sans-extension buffer-file-name))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally, you can use &lt;code&gt;set-file-local-variable-prop-line&lt;/code&gt; to save the compile command for a single file.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-04-18T02:55:20.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10755" PostTypeId="2" ParentId="10753" CreationDate="2015-04-18T04:05:50.930" Score="3" Body="&lt;p&gt;Thanks to the &lt;a href=&quot;http://www.cs.uwyo.edu/~jlc/courses/4780/emacs/_emacs&quot; rel=&quot;nofollow&quot;&gt;University of Wyoming&lt;/a&gt; I have been able to achieve the result with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Make M-x compile smarter in order to guess language&#xA;(require 'compile)&#xA;(defvar compile-guess-command-table&#xA;  '((c-mode       . &quot;gcc -Wall -g %s -o %s -lm&quot;)&#xA;    (c++-mode     . &quot;g++ -Wall %s -o %s -std=c++14&quot;)&#xA;    (fortran-mode . &quot;gfortran -C %s -o %s&quot;)&#xA;    ))&#xA;&#xA;(defun compile-guess-command ()&#xA;  (let ((command-for-mode (cdr (assq major-mode&#xA;                                     compile-guess-command-table))))&#xA;    (if (and command-for-mode&#xA;             (stringp buffer-file-name))&#xA;        (let* ((file-name (file-name-nondirectory buffer-file-name))&#xA;               (file-name-sans-suffix (if (and (string-match &quot;\\.[^.]*\\'&quot;&#xA;                                                             file-name)&#xA;                                               (&amp;gt; (match-beginning 0) 0))&#xA;                                          (substring file-name&#xA;                                                     0 (match-beginning 0))&#xA;                                        nil)))&#xA;          (if file-name-sans-suffix&#xA;              (progn&#xA;                (make-local-variable 'compile-command)&#xA;                (setq compile-command&#xA;                      (if (stringp command-for-mode)&#xA;                          ;; Optimize the common case.&#xA;                          (format command-for-mode&#xA;                                  file-name file-name-sans-suffix)&#xA;                        (funcall command-for-mode&#xA;                                 file-name file-name-sans-suffix)))&#xA;                compile-command)&#xA;            nil))&#xA;      nil)))&#xA;&#xA;&#xA;;; Add the appropriate mode hooks.&#xA;(add-hook 'c-mode-hook       (function compile-guess-command))&#xA;(add-hook 'c++-mode-hook     (function compile-guess-command))&#xA;(add-hook 'fortran-mode-hook (function compile-guess-command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally, this solution also adds support for C and Fortran which I left in the solution.&lt;/p&gt;&#xA;" OwnerUserId="2603" LastEditorUserId="2603" LastEditDate="2015-04-18T20:49:44.173" LastActivityDate="2015-04-18T20:49:44.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10756" PostTypeId="1" CreationDate="2015-04-18T04:32:35.093" Score="1" ViewCount="754" Body="&lt;p&gt;Note: I had asked this question before under &lt;a href=&quot;https://apple.stackexchange.com/questions/181007/emacsclient-waits-when-alternate-editor-is-used&quot;&gt;https://apple.stackexchange.com/questions/181007/emacsclient-waits-when-alternate-editor-is-used&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I created the following script &lt;code&gt;emc&lt;/code&gt; to invoke emacs (if already an emacs instance is running, the arguments should be opened in this instance, otherwise, a new instance should be started; the &lt;code&gt;-n&lt;/code&gt; causes emacsclient not to wait):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;/Applications/MacPorts/Emacs.app/Contents/MacOS/bin/emacsclient --alternate-editor &quot;/Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs&quot; --no-wait  ${1+&quot;$@&quot;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When already an emacs is running, the script works as expected; if, however, no emacs is running so far, a new one is started and the files are opened, but emacsclient waits until this instance is closed and gives the following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;computerName:bin user$ emc .&#xA;/Applications/MacPorts/Emacs.app/Contents/MacOS/bin/emacsclient: &#xA;can't find socket; have you started the server?&#xA;To start the server in Emacs, type &quot;M-x server-start&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I avoid this waiting?&lt;/p&gt;&#xA;" OwnerUserId="7086" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:30.630" LastActivityDate="2015-04-18T13:55:22.823" Title="How can I avoid EmacsClient to wait under MacOSX when it starts the alternate editor?" Tags="|osx|emacsclient|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10757" PostTypeId="1" AcceptedAnswerId="10758" CreationDate="2015-04-18T05:33:44.837" Score="4" ViewCount="1092" Body="&lt;p&gt;I tried the following to assign Ctrl-left/right for moving one word forward/backward, but none of them works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;C-left&amp;gt;&quot;) 'backward-word)&#xA;(global-set-key (kbd &quot;&amp;lt;C-right&amp;gt;&quot;) 'forward-word)&#xA;(global-set-key (kbd &quot;C-&amp;lt;left&amp;gt;&quot;) 'backward-word)&#xA;(global-set-key (kbd &quot;C-&amp;lt;right&amp;gt;&quot;) 'forward-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Has anyone an idea?&lt;/p&gt;&#xA;" OwnerUserId="7086" LastEditorUserId="25" LastEditDate="2015-04-19T14:04:02.030" LastActivityDate="2015-04-19T14:04:02.030" Title="How can I use C-&lt;left&gt; C-&lt;right&gt; for backward/forard-word under MacOsX?" Tags="|key-bindings|osx|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10758" PostTypeId="2" ParentId="10757" CreationDate="2015-04-18T11:05:52.420" Score="6" Body="&lt;p&gt;Ctrl-left/right is assigned to Mission Control by default.  Remove the assignment of those two shortcuts in Mac OS X system preferences / keyboard / keyboard shortcuts: Chose Mission Control on the left side and uncheck assignments on the right side.&lt;/p&gt;&#xA;" OwnerUserId="7089" LastActivityDate="2015-04-18T11:05:52.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10759" PostTypeId="1" AcceptedAnswerId="10761" CreationDate="2015-04-18T12:27:02.003" Score="1" ViewCount="49" Body="&lt;p&gt;In recent Emacs versions, &lt;code&gt;eval-expression&lt;/code&gt; makes use of &lt;code&gt;global-eldoc-mode&lt;/code&gt; in a quite intelligent way, using the modeline to display hints.  However, &lt;code&gt;icicle-pp-eval-expression&lt;/code&gt;, which is Icicles' variant of &lt;code&gt;eval-expression&lt;/code&gt;, does not have this functionality.  How to enable it?  Simple grepping for &lt;code&gt;eldoc&lt;/code&gt; in the body of &lt;code&gt;eval-expression&lt;/code&gt; didn't show any reference.&lt;/p&gt;&#xA;" OwnerUserId="642" LastActivityDate="2015-04-18T15:17:57.540" Title="How to make icicle-pp-eval-expression use eldoc like eval-expression?" Tags="|eval-expression|icicles|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10760" PostTypeId="2" ParentId="10756" CreationDate="2015-04-18T13:55:22.823" Score="2" Body="&lt;p&gt;I think the wait may be because of the command you specified for the alternate editor. The no wait flag, wont help you here, as that flag is for emacsclient not emacs. As you're probably aware the alternate editor will be run, if there is no emacs instance running, so try using &lt;code&gt;Emacs -Q&lt;/code&gt; or &lt;code&gt;Emacs -q&lt;/code&gt; if those work without the wait, then try: &lt;code&gt;Emacs --debug-init&lt;/code&gt; as it may be something in your configuration causing the wait. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get rid of the message you can add a &lt;code&gt;2&amp;gt; /dev/null&lt;/code&gt; at the end of your command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use OS X but I compile my own emacs, I use it as follows and have no wait time, I don't specify an alternate editor command, this ensures that the emacs daemon starts if not already running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -a &quot;&quot; -n -c &quot;$@&quot; 2&amp;gt; /dev/null&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To run on the terminal I use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -a &quot;&quot; -t &quot;$@&quot; 2&amp;gt; /dev/null&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I experience no wait time using the above method. This should work with your macports version as well as with any other version, I use this same script in Linux without issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="666" LastActivityDate="2015-04-18T13:55:22.823" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10761" PostTypeId="2" ParentId="10759" CreationDate="2015-04-18T14:30:41.533" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I will take a look to see what, if anything, I think might be done as an improvement.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-h f icicle-pp-eval-expression&lt;/code&gt; tells you how to do without that function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;By default, Icicle mode remaps all key sequences that are normally&#xA;bound to `eval-expression` or `pp-eval-expression` to&#xA;`icicle-pp-eval-expression`.  If you do not want this remapping, then&#xA;customize option `icicle-top-level-key-bindings`.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That should at least give you a workaround.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should be OK now. Please download the latest &lt;a href=&quot;http://www.emacswiki.org/emacs/download/icicles-cmd1.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicles-cmd1.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; from Emacs Wiki (or wait up to a day for it to be mirrored on MELPA).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-18T15:17:57.540" LastActivityDate="2015-04-18T15:17:57.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10762" PostTypeId="2" ParentId="10597" CreationDate="2015-04-18T15:17:12.853" Score="5" Body="&lt;p&gt;I posted a previous version of this code to answer a similar question on &lt;a href=&quot;https://stackoverflow.com/questions/26648731/refile-existing-entry-to-different-location-in-org-mode-date-tree/26683663&quot;&gt;Stack Overflow&lt;/a&gt;.  This version is slightly imporoved.&lt;/p&gt;&#xA;&lt;p&gt;You can select a file to refile into and if the entry has no timestamp, the current date is used.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-refile-to-datetree (&amp;amp;optional file)&#xA;  &amp;quot;Refile a subtree to a datetree corresponding to it's timestamp.&#xA;&#xA;The current time is used if the entry has no timestamp. If FILE&#xA;is nil, refile in the current file.&amp;quot;&#xA;  (interactive &amp;quot;f&amp;quot;)&#xA;  (let* ((datetree-date (or (org-entry-get nil &amp;quot;TIMESTAMP&amp;quot; t)&#xA;                            (org-read-date t nil &amp;quot;now&amp;quot;)))&#xA;         (date (org-date-to-gregorian datetree-date))&#xA;         )&#xA;    (with-current-buffer (current-buffer)&#xA;      (save-excursion&#xA;        (org-cut-subtree)&#xA;        (if file (find-file file))&#xA;        (org-datetree-find-date-create date)&#xA;        (org-narrow-to-subtree)&#xA;        (show-subtree)&#xA;        (org-end-of-subtree t)&#xA;        (newline)&#xA;        (goto-char (point-max))&#xA;        (org-paste-subtree 4)&#xA;        (widen)&#xA;        ))&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Excursions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the manual&lt;/a&gt; &lt;code&gt;save-excursion&lt;/code&gt; should be used within &lt;code&gt;with-current-buffer&lt;/code&gt; to avoid certain side-effects.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="29382" LastEditDate="2020-06-25T00:13:17.390" LastActivityDate="2020-06-25T00:13:17.390" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10763" PostTypeId="1" CreationDate="2015-04-18T16:54:42.753" Score="4" ViewCount="282" Body="&lt;p&gt;While debugging &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow&quot;&gt;swiper&lt;/a&gt; I've encountered a situation when&#xA;the point is changed inside &lt;code&gt;with-selected-window&lt;/code&gt;, but &lt;code&gt;window-start&lt;/code&gt; isn't updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be annoying, because I need the up-to-date window bounds to update the overlays.&#xA;From the doc, I've read that &lt;code&gt;window-start&lt;/code&gt; can be updated with &lt;code&gt;redisplay&lt;/code&gt;, and it is indeed updated,&#xA;but calling &lt;code&gt;redisplay&lt;/code&gt; after each key results in uncomfortable screen blinking and tearing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way around it, i.e. update &lt;code&gt;window-start&lt;/code&gt; like &lt;code&gt;redisplay&lt;/code&gt; does it, but don't actually&#xA;redisplay to avoid blinking? &lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-07-11T04:33:24.173" LastActivityDate="2016-02-01T03:56:58.337" Title="How to update window-start without calling redisplay?" Tags="|elisp|window|redisplay|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10764" PostTypeId="1" AcceptedAnswerId="10765" CreationDate="2015-04-18T17:51:42.020" Score="1" ViewCount="145" Body="&lt;p&gt;I want to store the credentials for posting to my blog secret. Therefore I load them using &lt;a href=&quot;http://epg.sourceforge.jp/&quot; rel=&quot;nofollow&quot;&gt;EasyPG&lt;/a&gt; and put them in the variables &lt;code&gt;blog-username&lt;/code&gt; and &lt;code&gt;blog-password&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I show the content of those vars using &lt;code&gt;C-h v blog-username&lt;/code&gt; (&lt;code&gt;describe-variable&lt;/code&gt;) the values are correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I set the &lt;code&gt;wp-blog-alist&lt;/code&gt; value those values seem to not be parsed. This is the error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;xml-rpc-value-to-xml-list: Wrong type argument: stringp,&#xA;  blog-username&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is how I use the function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; org2blog/wp-confirm-post t&#xA; org2blog/wp-blog-alist&#xA; '(&#xA;   (&quot;0xcb0&quot;&#xA;    :url &quot;http://www.my_blog_address.com/xmlrpc.php&quot;&#xA;    :username blog-username&#xA;    :password blog-password&#xA;    :default-title &quot;Hello, World!&quot;&#xA;    :default-categories (&quot;Uncategorized&quot;)&#xA;    :tags-as-categories nil)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What syntax do I need to use inside the second &lt;code&gt;setq&lt;/code&gt;for &lt;code&gt;org2blog/wp-blog-alist&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="2315" LastEditorUserId="50" LastEditDate="2015-04-18T21:02:35.260" LastActivityDate="2015-04-18T21:02:35.260" Title="Variable not parsed inside other variable definition" Tags="|elisp|variables|quote|" AnswerCount="1" CommentCount="0" ClosedDate="2015-04-18T21:04:44.620" ContentLicense="CC BY-SA 3.0" />
  <row Id="10765" PostTypeId="2" ParentId="10764" CreationDate="2015-04-18T18:14:14.207" Score="4" Body="&lt;p&gt;The quote (&lt;code&gt;'&lt;/code&gt;) causes the following expression to be not evaluated, therefore &lt;code&gt;blog-username&lt;/code&gt; and &lt;code&gt;blog-password&lt;/code&gt; are not evaluated to their string values, but instead taken as symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way of getting around this is using the &lt;code&gt;list&lt;/code&gt; function to explicitly quote symbols when necessary (note that the colon automatically quotes keywords):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; org2blog/wp-confirm-post t&#xA; org2blog/wp-blog-alist&#xA; (list (list &quot;0xcb0&quot;&#xA;             :url &quot;http://www.my_blog_address.com/xmlrpc.php&quot;&#xA;             :username blog-username&#xA;             :password blog-password&#xA;             :default-title &quot;Hello, World!&quot;&#xA;             :default-categories (list &quot;Uncategorized&quot;)&#xA;             :tags-as-categories nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The other option is using the backquote construct (```) and selectively unquote (&lt;code&gt;,&lt;/code&gt;) values you want to be exempt from quoting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; org2blog/wp-confirm-post t&#xA; org2blog/wp-blog-alist&#xA; `((&quot;0xcb0&quot;&#xA;    :url &quot;http://www.my_blog_address.com/xmlrpc.php&quot;&#xA;    :username ,blog-username&#xA;    :password ,blog-password&#xA;    :default-title &quot;Hello, World!&quot;&#xA;    :default-categories (&quot;Uncategorized&quot;)&#xA;    :tags-as-categories nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-04-18T18:14:14.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10767" PostTypeId="1" AcceptedAnswerId="10790" CreationDate="2015-04-18T22:37:58.173" Score="2" ViewCount="141" Body="&lt;p&gt;I tried org-mode, and I'm impressed. My org-file for notes is organized like this: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Header 1 &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Sub header 1&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Foo [ cursor here] &#xA;&#xA;  Bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Sub header 2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Currently I use the function &lt;code&gt;org-cycle&lt;/code&gt; a lot. It toggles (close or open) the header or the sub header. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when the cursor is on the text &lt;code&gt;foo&lt;/code&gt;, then when I call &lt;code&gt;org-cycle&lt;/code&gt; with a key, the subheader will not close. Only when I move the cursor to the sub header 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to figure out how I could come with a function, that &lt;code&gt;org-cycle&lt;/code&gt; will also work in the text fields under a subheader/header. But I couldn't wrap my head around it... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? It will be appreciated!&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="253" LastEditDate="2015-04-19T01:29:14.567" LastActivityDate="2015-04-20T03:46:22.280" Title="How create a function to navigate between text and header?" Tags="|org-mode|outline-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10768" PostTypeId="2" ParentId="10763" CreationDate="2015-04-18T23:26:26.530" Score="2" Body="&lt;p&gt;See also Emacs bug tracker feature request #22404 (which has not yet been implemented, but the mailing archive contains a rough draft rudimentary patch that creates a new hook for this specific issue):  &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22404&quot; rel=&quot;nofollow&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22404&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Whenever point moves outside of the visible window, the &lt;code&gt;window-scroll-functions&lt;/code&gt; hook is triggered -- &lt;strong&gt;at the very least&lt;/strong&gt; one (1) time -- before the screen updates visually.  The &lt;code&gt;window-scroll-functions&lt;/code&gt; hook is one of the last hooks available to the user via &lt;code&gt;elisp&lt;/code&gt; from which to obtain the new values for &lt;code&gt;window-start&lt;/code&gt; and &lt;code&gt;window-end&lt;/code&gt; before a visual redisplay occurs.  It is necessary to use the optional second argument in &lt;code&gt;window-end&lt;/code&gt; -- i.e., &lt;code&gt;t&lt;/code&gt; for force.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;abo-abo-wsf-fn&lt;/code&gt; when attached to the &lt;code&gt;window-scroll-functions&lt;/code&gt; hook will generate the new values for &lt;code&gt;window-start&lt;/code&gt; and &lt;code&gt;window-end&lt;/code&gt; prior to visual redisplay.  The hook is using a &lt;code&gt;buffer-local&lt;/code&gt; argument.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun abo-abo-wsf-fn (win _start)&#xA;&quot;A function attached to the `window-scroll-functions` hook.&quot;&#xA;  (when&#xA;      (and&#xA;        (window-live-p (get-buffer-window (current-buffer)))&#xA;        (not (minibufferp)))&#xA;    (let* (&#xA;        (selected-window (selected-window))&#xA;        (window-start (window-start selected-window))&#xA;        (window-end (window-end selected-window t)) )&#xA;      (message &quot;window-start: %s | window-end: %s&quot; window-start window-end) )))&#xA;&#xA;(add-hook 'window-scroll-functions 'abo-abo-wsf-fn nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;COMPLEXITIES&lt;/strong&gt;:  The above-example is not designed to deal with the complexities of a point being partially visible, or situations when the &lt;code&gt;window-scroll-functions&lt;/code&gt; hook is triggered more than one time per command loop.  The links in the comments underneath the question of the original poster deal with those complexities.  The original poster has not requested specific assistance in relation to those issues; however, so they are excluded from this limited example.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-02-01T03:56:58.337" LastActivityDate="2016-02-01T03:56:58.337" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10769" PostTypeId="2" ParentId="10767" CreationDate="2015-04-19T01:28:37.043" Score="1" Body="&lt;p&gt;Org-mode is built on top of Outline-mode, so you can use all of the latter's functionality at no additional cost. The functions you want specifically are hide-entry and show-entry. &lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-19T01:28:37.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10770" PostTypeId="2" ParentId="10717" CreationDate="2015-04-19T04:39:15.237" Score="6" Body="&lt;p&gt;You can do this with &lt;a href=&quot;https://github.com/tmalsburg/helm-bibtex&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;helm-bibtex&lt;/code&gt;&lt;/a&gt;, available through MELPA or GitHub. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use &lt;code&gt;C-SPC&lt;/code&gt; to select entries and then &lt;code&gt;TAB&lt;/code&gt; and &quot;insert citation&quot;.&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="115" LastEditDate="2015-05-27T13:37:30.093" LastActivityDate="2015-05-27T13:37:30.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10771" PostTypeId="1" AcceptedAnswerId="10810" CreationDate="2015-04-19T05:40:06.180" Score="6" ViewCount="3380" Body="&lt;p&gt;Something similar to this: &lt;a href=&quot;https://stackoverflow.com/questions/14323854/emacs-org-mode-and-html-publishing-how-to-change-structure-of-generated-html&quot;&gt;emacs-org mode and html publishing: how to change structure of generated HTML&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to have more control on the layout of HTML files generated from org-mode files. The default layout is good, but not good enough for my needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the default layout for any custom one?&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-04-20T23:27:23.670" Title="How to use my custom layout for generating HTML files from org files instead of using the default layout?" Tags="|org-mode|org-export|org-publish|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10772" PostTypeId="2" ParentId="10771" CreationDate="2015-04-19T07:02:01.163" Score="4" Body="&lt;p&gt;Have a look at some of the HTML-derived exporter backends, for example &lt;a href=&quot;https://github.com/yyr/org-mode/blob/master/contrib/lisp/ox-rss.el#L114&quot; rel=&quot;nofollow&quot;&gt;https://github.com/yyr/org-mode/blob/master/contrib/lisp/ox-rss.el#L114&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This uses &lt;code&gt;org-export-define-derived-backend&lt;/code&gt; to customize how the HTML backend processes org files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-define-derived-backend 'rss 'html&#xA; :menu-entry&#xA; '(?r &quot;Export to RSS&quot;&#xA;       ((?R &quot;As RSS buffer&quot;&#xA;        (lambda (a s v b) (org-rss-export-as-rss a s v)))&#xA;    (?r &quot;As RSS file&quot; (lambda (a s v b) (org-rss-export-to-rss a s v)))&#xA;    (?o &quot;As RSS file and open&quot;&#xA;        (lambda (a s v b)&#xA;          (if a (org-rss-export-to-rss t s v)&#xA;        (org-open-file (org-rss-export-to-rss nil s v)))))))&#xA;  :options-alist&#xA;  '((:description &quot;DESCRIPTION&quot; nil nil newline)&#xA;    (:keywords &quot;KEYWORDS&quot; nil nil space)&#xA;    (:with-toc nil nil nil) ;; Never include HTML's toc&#xA;    (:rss-extension &quot;RSS_EXTENSION&quot; nil org-rss-extension)&#xA;    (:rss-image-url &quot;RSS_IMAGE_URL&quot; nil org-rss-image-url)&#xA;    (:rss-categories nil nil org-rss-categories))&#xA;  :filters-alist '((:filter-final-output . org-rss-final-function))&#xA;  :translate-alist '((headline . org-rss-headline)&#xA;             (comment . (lambda (&amp;amp;rest args) &quot;&quot;))&#xA;             (comment-block . (lambda (&amp;amp;rest args) &quot;&quot;))&#xA;             (timestamp . (lambda (&amp;amp;rest args) &quot;&quot;))&#xA;             (plain-text . org-rss-plain-text)&#xA;             (section . org-rss-section)&#xA;             (template . org-rss-template)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in this, example &lt;code&gt;:filters-alist '((:filter-final-output . org-rss-final-function))&lt;/code&gt; is used to specify a function &lt;code&gt;org-rss-final-function&lt;/code&gt; that can exclude some items from being exported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, &lt;code&gt;:translate-alist '((headline . org-rss-headline) ...&lt;/code&gt; defines a bunch of other functions for certain elements, in this case headlines. These functions will be called with the org data structure of the element, and return the corresponding HTML string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this, you should be able to define your own HTML-derived org exporter that outputs exactly what you want.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2015-04-19T07:02:01.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10773" PostTypeId="1" AcceptedAnswerId="14845" CreationDate="2015-04-19T09:05:44.097" Score="0" ViewCount="384" Body="&lt;p&gt;I'm trying to use &lt;code&gt;github.com/milkypostman/melpa&lt;/code&gt; for creating a package from my own org-mode git repository. There are many recipes which I can create by &lt;code&gt;make recipes/foo&lt;/code&gt; command, but there isn't the recipe for org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I look org-mode.rcp, el-get's recipe - it uses special commands for building. Also I know that elpa org-mode package and el-get org-mode package have slightly different file structure: el-get org-mode package has &lt;code&gt;etc&lt;/code&gt; and &lt;code&gt;lisp&lt;/code&gt; directories, but elpa org-mode package has few additional files.&lt;/p&gt;&#xA;" OwnerUserId="2064" LastEditorUserId="2064" LastEditDate="2016-07-12T15:57:53.610" LastActivityDate="2016-07-12T15:57:53.610" Title="How to create org-mode recipe for melpa?" Tags="|org-mode|package-repositories|package-development|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10774" PostTypeId="1" AcceptedAnswerId="10775" CreationDate="2015-04-19T11:00:18.767" Score="0" ViewCount="595" Body="&lt;p&gt;I want to save all open buffers to the relevant files (not an autosave file) at some regular interval (between 5 and 1 minutes). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/13229494/4064800&quot;&gt;This&lt;/a&gt; seemed like it was the correct solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; In ~/.emacs file make following changes.&#xA;&#xA;(require 'auto-save-buffers)&#xA;(run-with-idle-timer 5 t 'auto-save-buffers) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;eval-region&lt;/code&gt; on this code gives the following error message: &lt;code&gt;eval-region: Cannot open load file: no such file or directory, auto-save-buffers&lt;/code&gt;. I run emacs 24.4. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the &lt;code&gt;auto-save-buffers&lt;/code&gt; functionality no longer available? Is there some other way to do what I want? Is it actually the right tool for saving to the file I have opened rather than a separate autosave file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen &lt;code&gt;auto-save-buffers-enhanced&lt;/code&gt; in the list of available packages (ie. &lt;code&gt;M-x list-packages&lt;/code&gt;) and using that instead of &lt;code&gt;auto-save-buffers&lt;/code&gt; might be an option, but I'd prefer a solution that only requires things that come with emacs by default.&lt;/p&gt;&#xA;" OwnerUserId="6973" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-04-19T22:27:31.400" Title="Trying to save open buffers to file every n seconds in emacs, why does this solution not work?" Tags="|auto-save|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10775" PostTypeId="2" ParentId="10774" CreationDate="2015-04-19T12:24:16.787" Score="2" Body="&lt;p&gt;I'm not actually sure what &lt;code&gt;auto-save-buffers&lt;/code&gt; is/was; I can't see a reference to it (nor to it being removed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if I understand the question correctly, you could do this by ditching the &lt;code&gt;require&lt;/code&gt;, and then replacing &lt;code&gt;'auto-save-buffers&lt;/code&gt; with &lt;code&gt;(lambda () (save-some-buffers t))&lt;/code&gt; in the timer call:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(run-with-idle-timer 5 t (lambda () (save-some-buffers t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;save-some-buffers&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, while it's probably obvious from the name &lt;code&gt;run-with-idle-timer&lt;/code&gt;, note that your code doesn't do something &quot;every N seconds&quot;. It triggers whenever Emacs has been &lt;em&gt;idle&lt;/em&gt; for N seconds, and requires an intervening period of &lt;em&gt;not-idle&lt;/em&gt;-ness before it can trigger again. In this case I imagine you're entirely happy with that behaviour, however.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-04-19T22:27:31.400" LastActivityDate="2015-04-19T22:27:31.400" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10776" PostTypeId="2" ParentId="10104" CreationDate="2015-04-19T15:52:43.403" Score="7" Body="&lt;p&gt;Sorry I didn't see your question sooner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is precisely one of the reasons for library &lt;a href=&quot;http://www.emacswiki.org/emacs/Zones&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Zones&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/zones.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;zones.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you narrow the buffer, each narrowing is added to a &lt;em&gt;ring of narrowings&lt;/em&gt;, which includes the full (unnarrowed) buffer.  The narrowings can be nested, but they need not be. They can be any regions at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can cycle among the narrowings (using &lt;code&gt;C-x n x x x...&lt;/code&gt;).  You can go directly to the &lt;em&gt;N&lt;/em&gt;th previous narrowing by using a numeric prefix arg; e.g., &lt;code&gt;C-3 C-x n x&lt;/code&gt;.  Plain &lt;code&gt;C-u&lt;/code&gt; widens completely (same as &lt;code&gt;C-x n w&lt;/code&gt; or cycling to the unnarrowed ring entry). &lt;code&gt;C-0&lt;/code&gt; empties the ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode line tells you which narrowing (buffer restriction) is current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can even save the ring of current buffer restrictions persistently and restore it later.  If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can bookmark a ring of restrictions and then restore it later by jumping to the bookmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, see &lt;a href=&quot;http://www.emacswiki.org/emacs/MultipleNarrowings&quot; rel=&quot;nofollow&quot;&gt;Multiple Narrowings&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://www.emacswiki.org/emacs/NarrowIndirect&quot; rel=&quot;nofollow&quot;&gt;Narrow Indirect&lt;/a&gt; (library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/narrow-indirect.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;narrow-indirect.el&lt;/code&gt;&lt;/a&gt;).  It lets you easily create any number of indirect buffers that are clones of the main buffer and that are narrowed to particular portions of it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-08T02:20:38.803" LastActivityDate="2015-09-08T02:20:38.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10779" PostTypeId="1" AcceptedAnswerId="10781" CreationDate="2015-04-19T18:39:37.520" Score="1" ViewCount="426" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/no5Rx.png&quot; alt=&quot;Buffer name&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this? Currently, the click events are bound to previous/next buffer, but I would rather like to see a list of all buffers when I click the buffer name. Perhaps, it could make use of a simple OS native context menu similar to the major and minor mode buttons:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1NYiC.png&quot; alt=&quot;OS native context menu&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="600" LastEditDate="2015-04-19T18:47:11.633" LastActivityDate="2015-05-09T20:14:59.530" Title="How can I display a list of all buffers when clicking on the buffer name?" Tags="|buffers|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10780" PostTypeId="1" AcceptedAnswerId="10796" CreationDate="2015-04-19T21:17:15.480" Score="3" ViewCount="885" Body="&lt;p&gt;When you insert a snippet from Yasnippet, you have this, for example &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# --------------------------------------------------------------&#xA;# $1 (`(insert-date)`)&#xA;# --------------------------------------------------------------&#xA;$2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you press tab, to switch from the place &lt;code&gt;$1&lt;/code&gt; to the place &lt;code&gt;$2&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not in a snippet, the tab key works normal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured out the function that's get called when you press &lt;code&gt;Tab&lt;/code&gt; into snippet, is &lt;code&gt;yas-next-field&lt;/code&gt;. I would like to bind the function to another key instead &lt;code&gt;Tab&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But only when it's inside a snippet, not affecting the normal working of another key outside snippet, like &lt;code&gt;Tab&lt;/code&gt; already is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I couldn't find any refefence on internet about keymapping for only inside yasnippet, not as normal key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for the suggestion, it's really appreciated. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-04-20T06:22:57.193" Title="How configure keybinding for Yasnippet only?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10781" PostTypeId="2" ParentId="10779" CreationDate="2015-04-19T21:59:55.110" Score="2" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key mode-line-buffer-identification-keymap [mode-line mouse-3] 'list-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That does not show buffers whose names begin with a space.  If you really want to show &lt;em&gt;all&lt;/em&gt; buffers, then try this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key mode-line-buffer-identification-keymap&#xA;            [mode-line mouse-3]&#xA;            (lambda ()&#xA;              (interactive)&#xA;              (display-buffer (list-buffers-noselect nil (buffer-list)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(However, I agree with those who commented that this is a very useful thing to do.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:14:59.530" LastActivityDate="2015-05-09T20:14:59.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10782" PostTypeId="1" AcceptedAnswerId="10788" CreationDate="2015-04-19T22:01:14.507" Score="5" ViewCount="2268" Body="&lt;p&gt;I have little experience with CL/ELisp and don't know any function that iterate list and apply another function until get non-nil value, which is returned from loop, leaving rest list unprocessed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It like lazy &lt;code&gt;mapcar&lt;/code&gt; or merged &lt;code&gt;or&lt;/code&gt; with &lt;code&gt;apply&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I like fold &lt;code&gt;while&lt;/code&gt; loop into more declarative code in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar autobm-try-thingatpt-things&#xA;  '(symbol url email))&#xA;&#xA;(defun autobm-try-thingatpt ()&#xA;  (let ((things autobm-try-thingatpt-things) name)&#xA;    (while (and things (not name))&#xA;      (setq name (thing-at-point (car things)))&#xA;      (setq things (cdr things)))&#xA;    name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; With answer of I rewrote code to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun autobm-try-thingatpt ()&#xA;  (cl-some #'thing-at-point autobm-try-thingatpt-things))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It look elegant! Only question to experienced elispers why &lt;code&gt;cl-extra&lt;/code&gt; does not &lt;code&gt;provide&lt;/code&gt; itself? &lt;del&gt;So I must use &lt;code&gt;(load &quot;cl-extra&quot;)&lt;/code&gt;  instead of &lt;code&gt;(require 'cl-extra)&lt;/code&gt;...&lt;/del&gt;&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2015-04-21T20:54:45.517" LastActivityDate="2015-05-09T20:14:35.577" Title="Apply function to a list until first success (non-nil) and return this value" Tags="|elisp|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10783" PostTypeId="1" CreationDate="2015-04-19T22:04:16.887" Score="3" ViewCount="217" Body="&lt;p&gt;If I'm in a terminal, I can just type &lt;code&gt;info glibc&lt;/code&gt; and get info about glibc. Since emacs reads info files, it's silly to use &lt;code&gt;M-x term&lt;/code&gt; to read info files from within emacs. I know you can use &lt;code&gt;C-u C-h i&lt;/code&gt; followed by the &lt;em&gt;path&lt;/em&gt; to the info file, but how can I just tell emacs to get info on glibc like I would on the command line?&lt;/p&gt;&#xA;" OwnerUserId="5376" LastEditorUserId="2688" LastEditDate="2015-04-20T11:15:49.240" LastActivityDate="2015-04-20T12:55:26.980" Title="Reading info files without knowing their path" Tags="|commands|ansi-term|term|info|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10784" PostTypeId="2" ParentId="10782" CreationDate="2015-04-19T22:16:42.363" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun autobm-try-thingatpt (fn)&#xA;  (let ((result  nil))&#xA;    (catch 'here&#xA;      (dolist (thg  autobm-try-thingatpt-things)&#xA;        (when (setq result  (funcall fn thg))&#xA;          (throw 'here result))))&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That assumes that the result you want returned is the value of applying the function to the list element.  If instead you wanted the (first) list element for which applying the function to it returns non-nil, then set &lt;code&gt;result&lt;/code&gt; to the &lt;code&gt;thg&lt;/code&gt; before &lt;code&gt;throw&lt;/code&gt;ing it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:14:35.577" LastActivityDate="2015-05-09T20:14:35.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10785" PostTypeId="1" AcceptedAnswerId="62414" CreationDate="2015-04-19T22:42:46.273" Score="20" ViewCount="7228" Body="&lt;p&gt;How get a list of active minor modes in current buffer?&lt;/p&gt;&#xA;&lt;p&gt;Docs &lt;code&gt;(info &amp;quot;(elisp)Minor Mode Conventions&amp;quot;)&lt;/code&gt; say:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; Define a variable whose name ends in ‘-mode’.  We call this the&#xA; &amp;quot;mode variable&amp;quot;.  The minor mode command should set this variable.&#xA; The value will be ‘nil’ if the mode is disabled, and non-‘nil’ if&#xA; the mode is enabled.  The variable should be buffer-local if the&#xA; minor mode is buffer-local.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I ended with:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (m minor-mode-list)&#xA;  (when (symbol-value m)&#xA;    (push m modes)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;describe-mode&lt;/code&gt; sources have notes that:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;;; Older packages do not register in minor-mode-list but only in&#xA;;; minor-mode-alist.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I don't know if that still valid point...&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2020-12-22T21:42:12.983" LastActivityDate="2020-12-22T21:42:12.983" Title="Get list of active minor modes in buffer" Tags="|minor-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="10786" PostTypeId="1" CreationDate="2015-04-19T23:06:16.143" Score="9" ViewCount="4213" Body="&lt;p&gt;Is there a better alternative to this function I use to remove parens around a region? I'm looking for an Emacs builtin, or something better written, something that will remove any pairs around the selected region (ex: brackets, curly brackets, double quotes, single quotes)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-delete-surrounded-parens ()&#xA;  (interactive)&#xA;  ;; save where region begins &amp;amp; ends                                                                            &#xA;  (let ((beginning (region-beginning))&#xA;        (end (region-end)))&#xA;    (cond ((not (eq (char-after beginning) ?\())&#xA;           ;; if region not begins by (, trigger error                                                          &#xA;           (error &quot;Char at region-begin not an open-parens&quot;))&#xA;          ((not (eq (char-before end) ?\)))&#xA;           ;; if region not ends by ), trigger error                                                            &#xA;           (error &quot;Char at region-end not a close-parens&quot;))&#xA;          ;; save mark, pt, current buffer &amp;amp; execute body                                                       &#xA;          ((save-excursion&#xA;             (goto-char beginning)&#xA;             (forward-sexp)&#xA;             (not (eq (point) end)))&#xA;           ;; if parens are not balanced, trigger error                                                         &#xA;           (error &quot;parens not balanced&quot;))&#xA;          (t (save-excursion&#xA;               (goto-char end)&#xA;               (delete-char -1)&#xA;               (goto-char beginning)&#xA;               (delete-char 1)))))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastEditorDisplayName="user2005" LastEditDate="2015-04-20T05:52:52.560" LastActivityDate="2015-04-20T14:43:22.053" Title="Remove parentheses around region" Tags="|balanced-parentheses|region|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10787" PostTypeId="2" ParentId="10133" CreationDate="2015-04-20T01:07:53.353" Score="9" Body="&lt;p&gt;The &lt;code&gt;savehist&lt;/code&gt; library is the general option for persisting variable values across sessions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply enabling &lt;code&gt;savehist-mode&lt;/code&gt; ensures that most minibuffer histories will persist, but you can also tell it to do likewise for any other variable, by adding it to &lt;code&gt;savehist-additional-variables&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;savehist&quot;&#xA; '(add-to-list 'savehist-additional-variables 'foo))&#xA;&#xA;(savehist-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-group&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;savehist&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-04-20T01:07:53.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10788" PostTypeId="2" ParentId="10782" CreationDate="2015-04-20T02:43:13.630" Score="7" Body="&lt;p&gt;You're looking for &lt;code&gt;cl-some&lt;/code&gt;, which is found in &lt;code&gt;'cl-extra&lt;/code&gt;. It takes a predicate&lt;sup&gt;1&lt;/sup&gt; and a sequence, and returns the first non-nil call of the predicate called on each element of the sequence, or nil if that function returns nil on all elements of the sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, I'm going to use a helper function for this example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun if-negative-return-absolute-value (num)&#xA;  &quot;If NUM is negative, return its absolute value. Otherwise, return nil.&quot;&#xA;  (when (&amp;lt; num 0)&#xA;    (abs num)))&#xA;&#xA;&#xA;(require 'cl-extra)&#xA;&#xA;(cl-some  #'if-negative-return-absolute-value '(1 2 3))&#xA;=&amp;gt; nil    ;; if-negative-return-absolute-value returns nil on all elements&#xA;&#xA;(cl-some  #'if-negative-return-absolute-value '(1 2 3 -4 -5))&#xA;=&amp;gt; 4      ;; the first non-nil result of if-negative-return-absolute-value&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your code can now be rewritten to be a lot simpler:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun autobm-try-thingatpt ()&#xA;  (cl-some #'thing-at-point autobm-try-thingatpt-things))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may want to switch around the order of things in &lt;code&gt;autobm-try-thingatpt-things&lt;/code&gt;; having the order be &lt;code&gt;'(url email symbol)&lt;/code&gt; seems to be correct, as if point is inside a url or email, it'll still find a symbol, and urls can contain things that look like email addresses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to @npostavs for pointing out the proper cl function to use here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] A predicate is just a function used for the &quot;truthiness&quot; of its result -- whether it's &lt;code&gt;nil&lt;/code&gt; or not.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-04-20T20:00:43.993" LastActivityDate="2015-04-20T20:00:43.993" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10789" PostTypeId="1" AcceptedAnswerId="10797" CreationDate="2015-04-20T02:54:24.653" Score="1" ViewCount="317" Body="&lt;p&gt;&lt;strong&gt;How do I programmatically extract key-value pairs from &quot;Babel Languages&quot; list in &lt;code&gt;defcustom org-babel-load-languages&lt;/code&gt; section of &lt;code&gt;org.el&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to read the &quot;Babel Languages&quot; configuration into an &lt;code&gt;org-mode&lt;/code&gt; code block and return the full list of the available programming languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I'm want to transform the input below:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(const :tag &quot;Awk&quot; awk)&lt;br&gt;&#xA;  (const :tag &quot;C&quot; C)&lt;br&gt;&#xA;  (const :tag &quot;R&quot; R)  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;into an output value like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;Awk&quot;) (&quot;C&quot;) (&quot;R&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I included the specific &lt;code&gt;defcustom&lt;/code&gt; section from &lt;code&gt;org.el&lt;/code&gt; for clarification.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom org-babel-load-languages '((emacs-lisp . t))&#xA;  &quot;Languages which can be evaluated in Org-mode buffers.&#xA;This list can be used to load support for any of the languages&#xA;below, note that each language will depend on a different set of&#xA;system executables and/or Emacs modes.  When a language is&#xA;\&quot;loaded\&quot;, then code blocks in that language can be evaluated&#xA;with `org-babel-execute-src-block' bound by default to C-c&#xA;C-c (note the `org-babel-no-eval-on-ctrl-c-ctrl-c' variable can&#xA;be set to remove code block evaluation from the C-c C-c&#xA;keybinding.  By default only Emacs Lisp (which has no&#xA;requirements) is loaded.&quot;&#xA;  :group 'org-babel&#xA;  :set 'org-babel-do-load-languages&#xA;  :version &quot;24.1&quot;&#xA;  :type '(alist :tag &quot;Babel Languages&quot;&#xA;        :key-type&#xA;        (choice&#xA;         (const :tag &quot;Awk&quot; awk)&#xA;         (const :tag &quot;C&quot; C)&#xA;         (const :tag &quot;R&quot; R)&#xA;         (const :tag &quot;Asymptote&quot; asymptote)&#xA;         (const :tag &quot;Calc&quot; calc)&#xA;         (const :tag &quot;Clojure&quot; clojure)&#xA;         (const :tag &quot;CSS&quot; css)&#xA;         (const :tag &quot;Ditaa&quot; ditaa)&#xA;         (const :tag &quot;Dot&quot; dot)&#xA;         (const :tag &quot;Emacs Lisp&quot; emacs-lisp)&#xA;         (const :tag &quot;Fortran&quot; fortran)&#xA;         (const :tag &quot;Gnuplot&quot; gnuplot)&#xA;         (const :tag &quot;Haskell&quot; haskell)&#xA;         (const :tag &quot;IO&quot; io)&#xA;         (const :tag &quot;Java&quot; java)&#xA;         (const :tag &quot;Javascript&quot; js)&#xA;         (const :tag &quot;LaTeX&quot; latex)&#xA;         (const :tag &quot;Ledger&quot; ledger)&#xA;         (const :tag &quot;Lilypond&quot; lilypond)&#xA;         (const :tag &quot;Lisp&quot; lisp)&#xA;         (const :tag &quot;Makefile&quot; makefile)&#xA;         (const :tag &quot;Maxima&quot; maxima)&#xA;         (const :tag &quot;Matlab&quot; matlab)&#xA;         (const :tag &quot;Mscgen&quot; mscgen)&#xA;         (const :tag &quot;Ocaml&quot; ocaml)&#xA;         (const :tag &quot;Octave&quot; octave)&#xA;         (const :tag &quot;Org&quot; org)&#xA;         (const :tag &quot;Perl&quot; perl)&#xA;         (const :tag &quot;Pico Lisp&quot; picolisp)&#xA;         (const :tag &quot;PlantUML&quot; plantuml)&#xA;         (const :tag &quot;Python&quot; python)&#xA;         (const :tag &quot;Ruby&quot; ruby)&#xA;         (const :tag &quot;Sass&quot; sass)&#xA;         (const :tag &quot;Scala&quot; scala)&#xA;         (const :tag &quot;Scheme&quot; scheme)&#xA;         (const :tag &quot;Screen&quot; screen)&#xA;         (const :tag &quot;Shell Script&quot; sh)&#xA;         (const :tag &quot;Shen&quot; shen)&#xA;         (const :tag &quot;Sql&quot; sql)&#xA;         (const :tag &quot;Sqlite&quot; sqlite))&#xA;        :value-type (boolean :tag &quot;Activate&quot; :value t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="388" LastEditorUserId="50" LastEditDate="2015-04-20T13:00:41.807" LastActivityDate="2015-04-20T13:00:41.807" Title="How to programmatically extract configurations from a defcustom variable?" Tags="|org-mode|elisp|variables|custom|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10790" PostTypeId="2" ParentId="10767" CreationDate="2015-04-20T03:46:22.280" Score="1" Body="&lt;p&gt;This functionality is already built in to org mode.  You just need to set the following option in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-cycle-emulate-tab nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that setting the &lt;code&gt;TAB&lt;/code&gt; key should always call &lt;code&gt;org-cycle&lt;/code&gt; on the current subtree, wherever your cursor happens to be.  There are other possible values for this variable, which give more fine-grained control over when to cycle and when not. See the docs for details. &lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2015-04-20T03:46:22.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10791" PostTypeId="2" ParentId="10786" CreationDate="2015-04-20T04:05:17.937" Score="8" Body="&lt;p&gt;If you install &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;noreferrer&quot;&gt;smartparens&lt;/a&gt;, then you can use the function &lt;code&gt;sp-splice-sexp&lt;/code&gt;, which does exactly what you are asking for.  It works on all valid types of braces and quotes, according to the current major mode.  See the &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Working-with-expressions#manipulation-functions&quot; rel=&quot;noreferrer&quot;&gt;docs&lt;/a&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; The principal advantage of &lt;code&gt;smartparens&lt;/code&gt; over &lt;code&gt;paredit&lt;/code&gt; (see rekado's answer) is that &lt;code&gt;smartparens&lt;/code&gt; has better support for languages other than lisp.  It also allows multi-character delimiters such as triple-quotes in python or tags in XML/HTML. &lt;/p&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="1980" LastEditDate="2015-04-20T14:43:22.053" LastActivityDate="2015-04-20T14:43:22.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10792" PostTypeId="2" ParentId="10783" CreationDate="2015-04-20T04:36:48.357" Score="0" Body="&lt;p&gt;Hm... indeed &lt;code&gt;C-u C-h i&lt;/code&gt; doesn't seem to let you do that.&#xA;OTOH, you can do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h i g (glibc) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-20T04:36:48.357" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10793" PostTypeId="2" ParentId="10783" CreationDate="2015-04-20T05:18:44.060" Score="7" Body="&lt;p&gt;The info reader in Emacs can be accessed with &lt;code&gt;C-h i&lt;/code&gt;.  There you can jump directly into the &lt;code&gt;some-node&lt;/code&gt; node with &lt;code&gt;g (some-node) RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can go to the &lt;code&gt;some-node&lt;/code&gt; node by eval'ing &lt;code&gt;(info &quot;some-node&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the info reader on the terminal picks man pages when info nodes cannot be found.  There is no &quot;glibc&quot; info node, but just a man page.  To read man pages within Emacs just use &lt;code&gt;woman&lt;/code&gt;, e.g. &lt;code&gt;woman RET glibc RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The info node for the GNU C library is called &quot;libc&quot;, so you should run &lt;code&gt;(info &quot;libc&quot;)&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eshell has a function &lt;code&gt;eshell/info&lt;/code&gt; with the following documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Run the info command in-frame with the same behavior as command-line&#xA;`info', ie:&#xA;  'info'           =&amp;gt; goes to top info window&#xA;  'info arg1'      =&amp;gt; IF arg1 is a file, then visits arg1&#xA;  'info arg1'      =&amp;gt; OTHERWISE goes to top info window and then menu item arg1&#xA;  'info arg1 arg2' =&amp;gt; does action for arg1 (either visit-file or menu-item) and then menu item arg2&#xA;  etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, to access the Emacs info documentation in an Eshell session you can just type &lt;code&gt;info Emacs&lt;/code&gt;.  For the libc documentation run &lt;code&gt;info libc&lt;/code&gt; in an Eshell session.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-04-20T05:20:28.703" LastActivityDate="2015-04-20T05:20:28.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10795" PostTypeId="2" ParentId="10786" CreationDate="2015-04-20T05:36:00.637" Score="7" Body="&lt;p&gt;There's &lt;code&gt;paredit&lt;/code&gt; which has a function &lt;code&gt;paredit-splice-sexp&lt;/code&gt;, which might do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example &lt;code&gt;|&lt;/code&gt; indicates point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hello world &quot;no |way&quot;)  ; run paredit-splice-sexp&#xA;(hello world no way)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's another example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((a b))&#xA;  (fo|rmat #t &quot;meh&quot;)) ; run paredit-splice-sexp&#xA;&#xA;(let ((a b))&#xA;  format #t &quot;meh&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does &lt;em&gt;not&lt;/em&gt; work on the top level, however, because that would result in an invalid s-expression.  It also does &lt;em&gt;not&lt;/em&gt; operate on a region but on s-expressions.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-04-20T05:52:25.320" LastActivityDate="2015-04-20T05:52:25.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10796" PostTypeId="2" ParentId="10780" CreationDate="2015-04-20T06:22:57.193" Score="5" Body="&lt;p&gt;Customize &lt;code&gt;yas-keymap&lt;/code&gt; for that.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'yasnippet&#xA;  '(progn&#xA;     (define-key yas-keymap (kbd &quot;TAB&quot;) nil)&#xA;     (define-key yas-keymap (kbd &quot;C-o&quot;) 'yas-next-field-or-maybe-expand)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-04-20T06:22:57.193" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10797" PostTypeId="2" ParentId="10789" CreationDate="2015-04-20T06:34:09.350" Score="3" Body="&lt;p&gt;I think that what you want is &lt;code&gt;(get 'org-babel-load-languages 'custom-type)&lt;/code&gt;. You might also want to look into what &lt;code&gt;custom-declare-variable&lt;/code&gt; function does to find out what are the name of other properties the customized variable may have.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-04-20T06:34:09.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10798" PostTypeId="1" AcceptedAnswerId="10799" CreationDate="2015-04-20T07:45:55.447" Score="7" ViewCount="1869" Body="&lt;p&gt;I'm now trying to switch from Vim to Spacemacs. It seems that &lt;code&gt;Longlines Mode&lt;/code&gt; is the way to go in Emacs to soft-wrap the line around the column &lt;a href=&quot;http://emacswiki.org/emacs/LineWrap&quot; rel=&quot;noreferrer&quot;&gt;http://emacswiki.org/emacs/LineWrap&lt;/a&gt;. However it seems that this mode has been removed since Emacs 24.4 &lt;a href=&quot;http://www.emacswiki.org/emacs/LongLines&quot; rel=&quot;noreferrer&quot;&gt;http://www.emacswiki.org/emacs/LongLines&lt;/a&gt;, in favor of &lt;code&gt;Visual Line Mode&lt;/code&gt;, which soft-wraps the text around the window edge... Which is not exactly what I want. How am I able to get the functionality of longlines mode back? I see a longlines.el at &lt;a href=&quot;http://www.emacswiki.org/emacs/longlines.el&quot; rel=&quot;noreferrer&quot;&gt;http://www.emacswiki.org/emacs/longlines.el&lt;/a&gt;, should I just manually download the file and add it to Spacemacs configuration layer?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-04-21T13:09:47.627" Title="If longlines-mode is removed in new emacs, how can I soft-wrap the line around the column instead of window edge?" Tags="|line-break|spacemacs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10799" PostTypeId="2" ParentId="10798" CreationDate="2015-04-20T08:13:46.327" Score="9" Body="&lt;p&gt;No. To emulate the behaviour of &lt;code&gt;longlines-mode&lt;/code&gt;, use &lt;code&gt;visual-line-mode&lt;/code&gt; in combination with the &lt;a href=&quot;https://github.com/joostkremers/visual-fill-column&quot;&gt;visual-fill-column&lt;/a&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-04-20T08:13:46.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10800" PostTypeId="1" AcceptedAnswerId="10809" CreationDate="2015-04-20T10:33:34.030" Score="5" ViewCount="396" Body="&lt;p&gt;Is there a (quick) way of resetting a variable to its default value (as defined in some .el file) after it has been modified? e.g. via commands in the .emacs file, without having to restart emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;Set &lt;code&gt;ispell-tex-skip-alists&lt;/code&gt; to the value as defined in `ispell.el' after modification.&lt;/p&gt;&#xA;" OwnerUserId="7103" LastEditorUserId="50" LastEditDate="2015-04-20T10:58:45.923" LastActivityDate="2015-04-20T20:18:47.890" Title="Set (non-custom) variable to its initial value" Tags="|elisp|variables|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10801" PostTypeId="2" ParentId="10800" CreationDate="2015-04-20T10:39:08.157" Score="1" Body="&lt;p&gt;It's possible if the variable was declared as a &lt;code&gt;defcustom&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(eval (car (get 'ediff-split-window-function 'standard-value)))&#xA;;; =&amp;gt; split-window-vertically&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;ispell-tex-skip-alists&lt;/code&gt; was declared as &lt;code&gt;defvar&lt;/code&gt;, so this isn't possible.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-20T10:39:08.157" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10802" PostTypeId="2" ParentId="10783" CreationDate="2015-04-20T12:55:26.980" Score="0" Body="&lt;p&gt;If you have &lt;code&gt;ivy-mode&lt;/code&gt; on from the package &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;swiper&lt;/a&gt;,&#xA;after pressing &lt;kbd&gt;g&lt;/kbd&gt; you get this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/LrzEe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the input is &lt;code&gt;li&lt;/code&gt;. But with no input, it gives me a list&#xA;of 137 files that I have in alphabetical order.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-20T12:55:26.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10803" PostTypeId="2" ParentId="10800" CreationDate="2015-04-20T15:07:48.923" Score="4" Body="&lt;p&gt;No.  Non-custom variables need not even &lt;em&gt;have&lt;/em&gt; a default value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Except if you mean a global value as opposed to a &lt;strong&gt;buffer-local&lt;/strong&gt; value. In the case of a variable that has buffer-local values, yes, you can use function &lt;strong&gt;&lt;code&gt;default-value&lt;/code&gt;&lt;/strong&gt; to obtain its default value, and you can then use &lt;code&gt;setq&lt;/code&gt; to set any buffer-local value to that default value.  (You can also use &lt;code&gt;set-default-value&lt;/code&gt; to change the default value.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-20T15:07:48.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10804" PostTypeId="1" CreationDate="2015-04-20T16:21:51.287" Score="2" ViewCount="151" Body="&lt;p&gt;I am implementing a feature to automatically generate a bookmark name by extracting information from the current context. Many packages provide such info. For example &lt;code&gt;which-func&lt;/code&gt; (through &lt;code&gt;(which-function)&lt;/code&gt;) and &lt;code&gt;semantic/find&lt;/code&gt; (through &lt;code&gt;(semantic-current-tag)&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I detect availability/support of &lt;code&gt;which-func&lt;/code&gt; or &lt;code&gt;semantic/find&lt;/code&gt; for the current buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this exposed by the mode writer through modes so from &lt;code&gt;(eq major-mode DESIRED-FEATURE-mode)&lt;/code&gt; and &lt;code&gt;DESIRED-FEATURE-minor-mode&lt;/code&gt; variable?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorDisplayName="user2005" LastEditDate="2015-04-20T18:29:41.943" LastActivityDate="2015-04-20T18:58:49.000" Title="How to detect if current major-mode supports which-function and semantic/find?" Tags="|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10805" PostTypeId="2" ParentId="10785" CreationDate="2015-04-20T18:51:23.083" Score="8" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapcar #'car minor-mode-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In fact, you will find that this value often differs from &lt;code&gt;minor-mode-list&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-04-20T21:06:34.900" LastActivityDate="2015-04-20T21:06:34.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10806" PostTypeId="2" ParentId="10804" CreationDate="2015-04-20T18:58:49.000" Score="3" Body="&lt;p&gt;You can check if &lt;code&gt;which-func&lt;/code&gt; feature is useful in a major-mode by checking the value of the variable &lt;code&gt;which-func-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List of functions for &lt;code&gt;which-function&lt;/code&gt; to call with no arguments.&#xA;  It calls them sequentially, and if any returns non-nil,&#xA;  &lt;code&gt;which-function&lt;/code&gt; uses that name and stops looking for the name.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If the major-mode does not use &lt;code&gt;which-func&lt;/code&gt;, the value of this variable will be &lt;code&gt;nil&lt;/code&gt; and you will see &lt;code&gt;[???]&lt;/code&gt; in the mode-line in bottom-right when you enable the &lt;code&gt;which-function-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the major-mode makes use of &lt;code&gt;which-func&lt;/code&gt;, you will see a list of function names assigned to this variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The &lt;code&gt;which-func&lt;/code&gt; package is not required by default and is autoloaded when you call the &lt;code&gt;which-function-mode&lt;/code&gt; command. After that you will be able to access the &lt;code&gt;which-func-functions&lt;/code&gt; variable.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-04-20T18:58:49.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10807" PostTypeId="2" ParentId="10701" CreationDate="2015-04-20T19:03:07.737" Score="4" Body="&lt;p&gt;For this purpose there is &lt;code&gt;helm-resume&lt;/code&gt;. It allows you to 'continue' with the previous helm session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e, your flow would be as following:&lt;br&gt;&#xA;1. Fire up helm session .&lt;br&gt;&#xA;2. Select the item to edit. Press RET to jump to that place to edit it..&lt;br&gt;&#xA;3. Run &lt;code&gt;helm-resume&lt;/code&gt; (C-c h b) and you should be back in your previous session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can tie it to some more convienient short cut like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'helm-resume) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is also a detailed explanation about helm-resume and helm in general:&#xA;&lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#ID-9d698347-33ee-447d-9fd1-eb01e9770dbb&quot; rel=&quot;nofollow&quot;&gt;http://tuhdo.github.io/helm-intro.html#ID-9d698347-33ee-447d-9fd1-eb01e9770dbb&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if you have further questions.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-04-20T19:03:07.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10808" PostTypeId="1" AcceptedAnswerId="13540" CreationDate="2015-04-20T19:18:46.057" Score="4" ViewCount="3540" Body="&lt;p&gt;In the vanilla &lt;code&gt;gdb&lt;/code&gt; interface, I can hit &lt;code&gt;C-c&lt;/code&gt; to break the running program, insert breakpoints, etc., and then run &lt;code&gt;continue&lt;/code&gt; to resume execution of the program being debugged.  Is this possible with &lt;code&gt;gud&lt;/code&gt;?  &lt;code&gt;C-c C-c&lt;/code&gt; in &lt;code&gt;gud&lt;/code&gt; actually sends &lt;code&gt;SIGKILL&lt;/code&gt; to the program, rather than breaking in &lt;code&gt;gdb&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;More info and repro&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I'm actually trying to debug &lt;code&gt;emacs&lt;/code&gt; (from a separate &lt;code&gt;emacs+gud&lt;/code&gt; instance, of course) to try to get to the bottom of &lt;a href=&quot;https://debbugs.gnu.org/db/19/19320.html&quot; rel=&quot;nofollow&quot;&gt;this guy&lt;/a&gt;.  Here's what I'm doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cd path/to/emacs-24.5 # where I've built emacs with debugging symbols, etc&#xA;$ ./src/emacs -Q&#xA;M-x gdb&#xA;Run gdb (like this): gdb -i=mi ./src/emacs&#xA;run&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At this point I'd like to break the execution of the new &lt;code&gt;emacs&lt;/code&gt; process so that I can poke around, set breakpoints, etc.  My end game is to wait for the new &lt;code&gt;emacs&lt;/code&gt; process to get into the bad state described in &lt;a href=&quot;https://debbugs.gnu.org/db/19/19320.html&quot; rel=&quot;nofollow&quot;&gt;my bug report&lt;/a&gt; (sometimes takes days).  That's when I really want to break execution of emacs and set the breakpoints.&lt;/p&gt;&#xA;" OwnerUserId="573" LastEditorUserId="573" LastEditDate="2015-09-29T04:41:25.537" LastActivityDate="2018-06-12T13:15:43.830" Title="How do you break a running program under gud?" Tags="|gud|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10809" PostTypeId="2" ParentId="10800" CreationDate="2015-04-20T20:18:47.890" Score="5" Body="&lt;p&gt;Here you go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/reset-var-at-point ()&#xA;  &quot;Revaluate the definition of variable at point.&quot;&#xA;  (interactive)&#xA;  (save-window-excursion&#xA;    (save-excursion&#xA;      (let ((buf (current-buffer)))&#xA;        (find-variable-at-point)&#xA;        (when (looking-at-p &quot;(def\\(var\\|custom\\|const\\) &quot;)&#xA;          (eval-defun nil))&#xA;        (unless (equal buf (current-buffer))&#xA;          (bury-buffer (current-buffer)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As others have stated, the initial value of a &lt;code&gt;defvar&lt;/code&gt; is not stored&#xA;anywhere. However, the location of its definition does get stored by&#xA;Emacs, so you can visit it and reevaluate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this will only work if the location of the variable is&#xA;known, and if it is defined in a conventional way (not as part of a&#xA;wierd macro or something).&lt;br&gt;&#xA;It will also leave a buffer hanging around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is very much &lt;strong&gt;not designed for used in lisp code&lt;/strong&gt;. For&#xA;interactive use, it should do just fine.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-04-20T20:18:47.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10810" PostTypeId="2" ParentId="10771" CreationDate="2015-04-20T23:27:23.670" Score="7" Body="&lt;p&gt;A derived export backend is what you want. Here's &lt;a href=&quot;https://github.com/pdixon/emacs.d/blob/master/lisp/pd-html.el&quot; rel=&quot;noreferrer&quot;&gt;an example&lt;/a&gt; where I've created a derived backend that changes the main html template.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;org-export-define-derived-backend&lt;/code&gt; you provide an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Association-List-Type.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;alist&lt;/code&gt;&lt;/a&gt; with the parts of the backend you want to override.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my backend I only wanted to replace the top level template.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-define-derived-backend 'pd-html 'html&#xA;     :translate-alist '((template . pd-html-template)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pd-html-template&lt;/code&gt; is a function that takes the sub-elements and produces the final html. I'm just using basic string formatting and concatenation functions to produce the html. The following is a simplified implementation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pd-html-template (contents info)&#xA;   (concat&#xA;      &quot;&amp;lt;!DOCTYPE html&amp;gt;\n&quot;&#xA;      (format &quot;&amp;lt;html lang=\&quot;%s\&quot;&amp;gt;\n&quot; (plist-get info :language))&#xA;      &quot;&amp;lt;head&amp;gt;\n&quot;&#xA;      (format &quot;&amp;lt;meta charset=\&quot;%s\&quot;&amp;gt;\n&quot;&#xA;       (coding-system-get org-html-coding-system 'mime-charset))&#xA;      (format &quot;&amp;lt;title&amp;gt;%s&amp;lt;/title&amp;gt;\n&quot;&#xA;       (org-export-data (or (plist-get info :title) &quot;&quot;) info))&#xA;      (format &quot;&amp;lt;meta name=\&quot;author\&quot; content=\&quot;%s\&quot;&amp;gt;\n&quot;&#xA;       (org-export-data (plist-get info :author) info))&#xA;     &quot;&amp;lt;link href=\&quot;/css/style.css\&quot; rel=\&quot;stylesheet\&quot; style=\&quot;text/css\&quot; /&amp;gt;\n&quot;&#xA;     &quot;&amp;lt;/head&amp;gt;\n&quot;&#xA;     &quot;&amp;lt;body&amp;gt;\n&quot;&#xA;     (format &quot;&amp;lt;h1 class=\&quot;title\&quot;&amp;gt;%s&amp;lt;/h1&amp;gt;\n&quot;&#xA;       (org-export-data (or (plist-get info :title) &quot;&quot;) info))&#xA;     contents&#xA;     &quot;&amp;lt;/body&amp;gt;\n&quot;&#xA;     &quot;&amp;lt;/html&amp;gt;\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Other elements of the export backend can be customised in the same way; write a function that generates an output snippet and register in the &lt;code&gt;translate-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="640" LastActivityDate="2015-04-20T23:27:23.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10811" PostTypeId="1" AcceptedAnswerId="10813" CreationDate="2015-04-20T23:33:21.773" Score="4" ViewCount="975" Body="&lt;p&gt;I'm entirely new with Emacs. I'm trying to split vertically my window, but I can't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Googling, I've discovered the commands to do it is &lt;code&gt;C-Mouse-2&lt;/code&gt;. So I clicked Ctrl+scroll button+2 but it matched C-down-mouse-2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I deploy &lt;code&gt;C-Mouse-2&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7033" LastEditorUserId="105" LastEditDate="2021-01-24T18:27:41.847" LastActivityDate="2021-01-24T18:27:41.847" Title="What does C-Mouse-2 mean?" Tags="|key-bindings|commands|help|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10812" PostTypeId="2" ParentId="10811" CreationDate="2015-04-21T01:11:02.820" Score="1" Body="&lt;p&gt;&lt;code&gt;C-mouse-2&lt;/code&gt; is not what you want. What you want is &lt;code&gt;C-x 2&lt;/code&gt;.  That means first press and hold &lt;code&gt;Control&lt;/code&gt; while hitting &lt;code&gt;x&lt;/code&gt;, and then hit &lt;code&gt;2&lt;/code&gt; (that's the keyboard key labeled &lt;code&gt;2&lt;/code&gt;, not the second mouse button).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This assumes that your init file has not changed any of the default key bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it has, then you will need to let us know what &lt;code&gt;C-h k mouse-2&lt;/code&gt; tells you. That is: Hold &lt;code&gt;Control&lt;/code&gt; while hitting &lt;code&gt;h&lt;/code&gt;, then hit &lt;code&gt;k&lt;/code&gt;, then click &lt;code&gt;mouse-2&lt;/code&gt; (that's the middle mouse button). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to read a little of the Emacs manual, to find out about how Emacs denotes keys and mouse actions.  To consult the manual, use &lt;code&gt;C-h r&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start at the beginning of the manual, for an intro. The fourth &quot;node&quot; (page) of the manual is named &lt;code&gt;User Input&lt;/code&gt;, and it gives you an intro to keys and characters, and how Emacs talks about them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also read the manual in a web browser, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;em&gt;here&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it is much better to read the manual in Emacs itself.  You can read about how to do that by consulting the &lt;code&gt;Info&lt;/code&gt; manual from Emacs.  To do that, use &lt;code&gt;C-h i&lt;/code&gt; and choose the first link, named &lt;code&gt;Info&lt;/code&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-21T01:16:32.440" LastActivityDate="2015-04-21T01:16:32.440" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10813" PostTypeId="2" ParentId="10811" CreationDate="2015-04-21T01:28:23.607" Score="5" Body="&lt;h2&gt;Where did C-Mouse-2 come from?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I assume you're talking about &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Split-Window.html&quot; rel=&quot;noreferrer&quot;&gt;this page&lt;/a&gt; about splitting windows from the Emacs documentation, which has three commands:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;C-x 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Split the selected window into two windows,&#xA;one above the other (split-window-below). &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;C-x 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Split the selected window into two windows,&#xA;positioned side by side (split-window-right). &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;C-Mouse-2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In the mode line of a window, split that window.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The third one is the one you're talking about, and is the one least frequently used. Most people use Emacs almost entirely by the keyboard, and consider the keyboard faster than the mouse for most tasks. But that's outside the scope of this question.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Why didn't it work when you tried it?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Note the description of &lt;code&gt;C-Mouse-2&lt;/code&gt;: &quot;&lt;strong&gt;In the mode line&lt;/strong&gt; of a window, split that window.&quot; (Emphasis added)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode line is the part of the window near the bottom that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;U:---  *scratch*    All L5     (Lisp Interaction)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It changes based on the buffer you're in, the modes you have active, and more!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the command to split the window isn't &lt;code&gt;C-Mouse-2&lt;/code&gt; just anywhere on the screen; you have to click with the mouse pointer over the mode line.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Running C-Mouse-2 to split the window&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;To run this command, press and hold &lt;code&gt;Control&lt;/code&gt;, move the mouse over to the mode line of the window you want to split, press and release &lt;code&gt;Mouse-2&lt;/code&gt; -- that is, the middle mouse button -- then release &lt;code&gt;Control&lt;/code&gt;. Emacs will split the window at the point you clicked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The effect is the same as the second function the page points out -- &lt;code&gt;split-window-right&lt;/code&gt;, which is bound to &lt;code&gt;C-x 3&lt;/code&gt; by default. When you use the mouse, you get to control the position of the split; using the keyboard splits the window evenly.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-04-21T01:44:26.620" LastActivityDate="2015-04-21T01:44:26.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10814" PostTypeId="1" AcceptedAnswerId="10817" CreationDate="2015-04-21T02:49:45.343" Score="4" ViewCount="2244" Body="&lt;p&gt;My situation is similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/7238/info-file-emacs-does-not-exist&quot;&gt;Info file emacs does not exist&lt;/a&gt;. I installed &lt;code&gt;emacs24&lt;/code&gt;, &lt;code&gt;emacs24-el&lt;/code&gt;, and &lt;code&gt;emacs24-common-non-dfsg&lt;/code&gt; on Ubuntu 14.04. Unlike in that other question, &lt;kbd&gt;C-h r&lt;/kbd&gt; &lt;em&gt;does&lt;/em&gt; work for me and I do get the &quot;Emacs&quot; manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However from using Emacs on OS X, I'm accustomed to &lt;kbd&gt;C-h i&lt;/kbd&gt; bringing up a full directory of many, many topics. Instead, my directory only has three nodes, for a few packages that provide info files (Flycheck, Haskell Mode, and Magit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(Info-default-dirs)&lt;/code&gt; evaluates to &lt;code&gt;(&quot;/usr/share/info/emacs-24&quot; &quot;/usr/share/info/&quot; &quot;/usr/share/info/&quot;)&lt;/code&gt;.  I do see all the individual info.gz files in &lt;code&gt;/usr/share/info/emacs-24&lt;/code&gt;. I can open them individually, for example &lt;code&gt;(info &quot;/usr/share/info/emacs-24/elisp.info.gz&quot;)&lt;/code&gt; &lt;em&gt;does&lt;/em&gt; bring up the &quot;Emacs Lisp&quot; node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But again, I'm accustomed to &lt;kbd&gt;C-h i&lt;/kbd&gt; bringing up the full directory. I don't know much about info files. How can I make this work?&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-04-21T07:49:22.320" Title="C-h i *info* directory is nearly empty" Tags="|documentation|info|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10815" PostTypeId="2" ParentId="10814" CreationDate="2015-04-21T05:33:12.670" Score="7" Body="&lt;p&gt;&lt;code&gt;C-h i&lt;/code&gt; runs the &lt;code&gt;info&lt;/code&gt; command by default, which searches for info files in &lt;code&gt;Info-directory-list&lt;/code&gt;.  If this is nil Info uses the environment variable &lt;code&gt;INFOPATH&lt;/code&gt; or &lt;code&gt;Info-default-directory-list&lt;/code&gt; if no &lt;code&gt;INFOPATH&lt;/code&gt; variable is defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the info files are not found it is possible that one or more of these values has been incorrectly customised.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-04-21T05:33:12.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10816" PostTypeId="1" AcceptedAnswerId="10835" CreationDate="2015-04-21T06:13:45.300" Score="2" ViewCount="1790" Body="&lt;p&gt;In &lt;code&gt;.emacs&lt;/code&gt;, I bound the key for &lt;code&gt;yasnippet&lt;/code&gt; as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key yas-minor-mode-map (kbd &quot;C-SPC&quot;) 'yas-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In a buffer with &lt;code&gt;python&lt;/code&gt; as major mode and &lt;code&gt;yasnippet, autocomplete&lt;/code&gt; as minor mode, &lt;code&gt;yasnippet&lt;/code&gt; doesn't expand on &lt;code&gt;C-SPC&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, i started doubting if there are any snippets available. I did &lt;code&gt;C-c &amp;amp; C-v&lt;/code&gt; (or) &lt;code&gt;Visit Snippet File&lt;/code&gt; and it gives alarm, &lt;code&gt;No snippet tables active&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to add snippets to a major mode?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-04-21T17:11:48.767" LastActivityDate="2015-04-21T17:50:24.460" Title="Yasnippet - No snippet tables active/ YASnippet tables empty" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10817" PostTypeId="2" ParentId="10814" CreationDate="2015-04-21T07:49:22.320" Score="9" Body="&lt;p&gt;It sounds as if the &lt;code&gt;dir&lt;/code&gt; file within your info directories don't contain all the nodes that it should. You can verify this by looking at the contents of the file &lt;code&gt;/usr/share/info/emacs-24/dir&lt;/code&gt; (if this is the directory that's lacking entries).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally, this file will be updated by the program that installs the info file, but you can also do it manually. If the info directory that is missing entries is &lt;code&gt;/usr/share/info/emacs-24&lt;/code&gt;, you can create the dir entries by running&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd /usr/share/info/emacs-24&#xA;for i in *info*; do install-info $i dir; done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="756" LastActivityDate="2015-04-21T07:49:22.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10818" PostTypeId="1" AcceptedAnswerId="10825" CreationDate="2015-04-21T09:37:37.900" Score="1" ViewCount="939" Body="&lt;p&gt;So far I have only used Emacs on Ubuntu. So it was time for a change, and on my new MacBook Pro, I installed Emacs 24.5 from &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;http://emacsformacosx.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when I go to the terminal window and type &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ /Applications/Emacs.app/Contents/MacOS/Emacs -mm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs does not open maximized. What am I missing here? (I have not created any Emacs init file yet)&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-02-23T18:53:31.787" Title="How to open Emacs 24.5 maximized from terminal in OSX?" Tags="|osx|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10819" PostTypeId="1" CreationDate="2015-04-21T10:44:18.837" Score="5" ViewCount="1494" Body="&lt;p&gt;I look for ideas, how to diagnose reason of Emacs freezes (by which I mean taking 100% CPU and being irresponsive for some time). This question is not about any specific case¹ but about approach…&lt;/p&gt;&#xA;&lt;p&gt;Is it possible to ask Emacs „show me/dump somewhere current stack trace(s) of all currently running Lisp thread(s)”? Or maybe „dump stack trace very 10 seconds somewhere”? &lt;em&gt;Sth I could do to check what's going on once I see my emacs frozen…&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Or, is it possible to enable some kind of global profiling (with output put to some disk file at regular intervals) so I could look there for likely culprit?&lt;/p&gt;&#xA;&lt;p&gt;Or, is there any other trick? What would you do if you saw misbehaving Emacs and bisecting all libraries would not seem promising²?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;¹ Currently I experience two problems:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;from time to time, Ctrl-Y takes 10-30 seconds (and Emacs takes 100% some CPU core during this time),&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;from time to time Emacs turns sluggish (albeit works more or less properly), and it turns out one of Emacs processes takes 100% of CPU&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Both surely are related to some rogue lisp code (I load plenty of melpa modules) or caused by unexpected relationship of some modules, and it is fairly likely that it is my very specific configuration what makes them appear.&lt;/p&gt;&#xA;&lt;p&gt;² My current problem appeared after I made major package-update which installed many updated versions of various packages and to which I also added a couple of new modules. Bisecting that doesn't seem promising as sometimes it takes a day or two before the problem appears, reverting to old versions for good also is not sth I would like…&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-04-21T11:35:19.627" Title="Is it possible to get stack trace of currently running code? Or profile? Or how do you diagnose „hangs”" Tags="|debugging|elisp|problem-tracking|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10820" PostTypeId="1" AcceptedAnswerId="10854" CreationDate="2015-04-21T11:09:54.867" Score="9" ViewCount="2632" Body="&lt;p&gt;I use &lt;code&gt;flycheck&lt;/code&gt; with &lt;code&gt;flycheck-elisp-checkdoc&lt;/code&gt; checker active and find them fairly useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, I find it irritating to be nagged about missing &lt;code&gt;(provide)&lt;/code&gt;, section headers (&lt;code&gt;;;; Code&lt;/code&gt;, ...), package metadata and similar things while I am editing my &lt;code&gt;~/emacs/etc&lt;/code&gt; (that's &lt;code&gt;~/.emacs&lt;/code&gt; split into smaller pieces). Those files are short configuration snippets and adding those comments would only make them longer and less readable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what is the best way to disable those warnings in this very place (but only there, the same reminders are very useful once I edit my true lisp modules...)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I do not really mind whether it would mean disabling flycheck-elisp-checkdoc checker for flycheck in this very dir, or reconfiguring checkdoc in this ery place, or something in-between – although the latter case would also handle other ways of spawning checkdoc…&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="253" LastEditDate="2015-05-10T22:59:11.917" LastActivityDate="2018-04-07T14:51:40.967" Title="Best way to disable flycheck checkdoc warnings on specific elisp directory?" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10821" PostTypeId="2" ParentId="10819" CreationDate="2015-04-21T11:29:42.103" Score="4" Body="&lt;p&gt;(Idea taken from one of the questions suggested by legoscia)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like killing emacs with &lt;code&gt;SIGUSR2&lt;/code&gt; does exactly what I looked for, at least in the first (&lt;em&gt;hang on yank&lt;/em&gt;) case (which politely reappeared soon after I got this advice). I am yet to understand the stacktrace³, but killing emacs with &lt;code&gt;SIGUSR2&lt;/code&gt; nicely interrupted the freeze and dumped stacktrace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the answer to my question is &lt;code&gt;kill -USR2 «emacspid»&lt;/code&gt; (or, easier, &lt;code&gt;htop&lt;/code&gt;, &lt;code&gt;p&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, &lt;code&gt;12&lt;/code&gt;, &lt;code&gt;Enter&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;³ Here is what I got (byte code commented out as it contained unreadable characters):&#xA;&lt;code&gt;&#xA;Debugger entered--entering a function:&#xA;* command-error-default-function((quit) &quot;&quot; nil)&#xA;  #&amp;lt;subr recursive-edit&amp;gt;()&#xA;  byte-code(...)&#xA;  ad-Advice-recursive-edit(#&amp;lt;subr recursive-edit&amp;gt;)&#xA;  apply(ad-Advice-recursive-edit #&amp;lt;subr recursive-edit&amp;gt; nil)&#xA;  recursive-edit()&#xA;  debug(error (quit))&#xA;  accept-process-output()&#xA;  semantic-c-lexer(778 1374 nil nil)&#xA;  semantic-lex(778 1374 nil)&#xA;  semantic-parse-region-default(778 1374 nil nil nil)&#xA;  semantic-parse-region-c-mode(778 1374 nil nil nil)&#xA;  semantic-parse-region(778 1374 nil)&#xA;  semantic-edits-incremental-parser-1()&#xA;  byte-code(...)&#xA;  semantic-parse-changes-default()&#xA;  semantic-parse-changes()&#xA;  semantic-fetch-tags()&#xA;  byte-code(...)&#xA;  semantic-idle-scheduler-refresh-tags()&#xA;  byte-code(...)&#xA;  semantic-idle-core-handler()&#xA;  semantic-idle-scheduler-function()&#xA;  apply(semantic-idle-scheduler-function nil)&#xA;  byte-code(...)&#xA;  timer-event-handler([nil 0 1 0 t semantic-idle-scheduler-function nil idle 0])&#xA;&lt;/code&gt;&#xA;Still semantic is not necessarily guilty as while all above is semantic and most commented bytecodes too, the deepest byte-code mentions various &lt;code&gt;persp-&lt;/code&gt; functions, mayhaps semantic triggers some event which persp binds too etc etc… Here is the readable part of it:&#xA;&lt;code&gt;&#xA; byte-code(&quot;...&quot; [persp-recursive G94967 persp-curr perspectives-hash old-hash ad--addoit-function persp-save boundp ((byte-code &quot;...&quot; [G94967 persp-recursive makunbound] 2)) copy-hash-table maphash #[(key new-persp) &quot;...&quot; [key old-hash persp cl-struct-perspective-tags v new-persp gethash 0 error &quot;%s accessing a non-%s&quot; persp-buffers perspective 2] 7] ad-return-value] 3)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="2404" LastEditDate="2015-04-21T11:35:19.627" LastActivityDate="2015-04-21T11:35:19.627" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10822" PostTypeId="1" AcceptedAnswerId="10829" CreationDate="2015-04-21T11:46:20.850" Score="6" ViewCount="2120" Body="&lt;p&gt;I'm running OS X Yosemite and Emacs 24.3 from Homebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;locale&lt;/code&gt; setting for my user is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;LANG=&quot;en_AU.UTF-8&quot;&#xA;LC_COLLATE=&quot;en_AU.UTF-8&quot;&#xA;LC_CTYPE=&quot;en_AU.UTF-8&quot;&#xA;LC_MESSAGES=&quot;en_AU.UTF-8&quot;&#xA;LC_MONETARY=&quot;en_AU.UTF-8&quot;&#xA;LC_NUMERIC=&quot;en_AU.UTF-8&quot;&#xA;LC_TIME=&quot;en_AU.UTF-8&quot;&#xA;LC_ALL=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet, when I launch Emacs.app via the launcher (or the OS X UI generally), and run &lt;code&gt;locale&lt;/code&gt; in ansi-term, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;LANG=&#xA;LC_COLLATE=&quot;C&quot;&#xA;LC_CTYPE=&quot;C&quot;&#xA;LC_MESSAGES=&quot;C&quot;&#xA;LC_MONETARY=&quot;C&quot;&#xA;LC_NUMERIC=&quot;C&quot;&#xA;LC_TIME=&quot;C&quot;&#xA;LC_ALL=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I ensure that I get my user's locale when launching Emacs.app via the OS X UI?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: Launching Emacs.app from a shell &lt;strong&gt;does&lt;/strong&gt; pickup the correct locale, but that is not the solution I'm looking for).&lt;/p&gt;&#xA;" OwnerUserId="5485" LastEditorUserId="2710" LastEditDate="2015-04-21T12:53:51.487" LastActivityDate="2016-08-14T09:18:35.690" Title="locale when launching Emacs.app on OS X" Tags="|osx|ansi-term|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10823" PostTypeId="1" CreationDate="2015-04-21T11:56:31.043" Score="0" ViewCount="713" Body="&lt;p&gt;I'm using Projectile and pyenv-mode (&lt;a href=&quot;https://github.com/proofit404/pyenv-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/proofit404/pyenv-mode&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;pyenv-mode has projectile integration to update the virtual environment while switching projects. This is the code to do so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-pyenv-mode-set ()&#xA;  &quot;Set pyenv version matching project name.&#xA;Version must be already installed.&quot;&#xA;  (pyenv-mode-set (projectile-project-name)))&#xA;&#xA;(add-hook 'projectile-switch-project-hook 'projectile-pyenv-mode-set)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've enabled this code in my &lt;code&gt;init.el&lt;/code&gt;. I'm not sure if or how this is supposed to integrate with shells (ansi-term and shell specifically), but I am trying to achieve the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When switching to a new project&#xA;&lt;ul&gt;&#xA;&lt;li&gt;switch any open shell buffers to the new python venv (can clear the buffer if required)&lt;/li&gt;&#xA;&lt;li&gt;ensure than any wheel buffers opened while in a project also activate with that virtual env&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What actually happens is that I get my default system Python in these shells at all times, unless I manually activate a virtual environment from in one of them.&lt;/p&gt;&#xA;" OwnerUserId="5485" LastEditorUserId="5485" LastEditDate="2015-04-21T18:08:19.667" LastActivityDate="2015-04-21T18:08:19.667" Title="how can I set a Python virtual environment in any shells (open, or that will be opened) based on changing projectile project" Tags="|python|projectile|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10825" PostTypeId="2" ParentId="10818" CreationDate="2015-04-21T12:25:40.867" Score="3" Body="&lt;p&gt;As far as I know, the &lt;code&gt;-mm -fs -fh -fw&lt;/code&gt; flags do not work with OS X because they require X11 to work. I've tried them in Linux and they work fine there. However the &lt;code&gt;-g&lt;/code&gt; flag does work. For a 1920x1200 display you can pass a geometry of &lt;code&gt;271x82&lt;/code&gt; and you'll get a maximised frame. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer to use code to set this up, I use the following snippet to maximise emacs when started, the benefit is that no matter the display geometry I always get emacs to display as expected.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((px (display-pixel-width))&#xA;  (py (display-pixel-height))&#xA;  (fx (frame-char-width))&#xA;  (fy (frame-char-height))&#xA;  tx ty)&#xA;(setq tx (- (/ px fx) 7))&#xA;(setq ty (- (/ py fy) 4))&#xA;(setq initial-frame-alist '((top . 2) (left . 2)))&#xA;(add-to-list 'default-frame-alist (cons 'width tx))&#xA;(add-to-list 'default-frame-alist (cons 'height ty)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm sure there are other ways to do this, maybe better ways, but this is enough for my needs.&lt;/p&gt;&#xA;" OwnerUserId="666" LastActivityDate="2015-04-21T12:25:40.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10826" PostTypeId="2" ParentId="10798" CreationDate="2015-04-21T13:09:47.627" Score="2" Body="&lt;p&gt;It has not been removed (yet).  It has been marked obsolete, which among other things implies that it is not autoloaded any more.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'longlines)&#xA;(longlines-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;still works as before.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-21T13:09:47.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10827" PostTypeId="1" CreationDate="2015-04-21T13:13:43.867" Score="6" ViewCount="1340" Body="&lt;p&gt;I have been trying to figure out what attribute is setting the background for inline plots in EIN. The background for the plot seems to always take the default background color for my color theme, even though I'm changing the default background color for the major mode that it's contained in. I.e.: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun switch-color ()&#xA;  &quot;Switch default bg for ipython notebook.&quot;&#xA;  (face-remap-add-relative 'default '((:background &quot;white&quot;))))&#xA;(add-hook 'ein:notebook-multilang-mode-hook 'switch-color)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works for everything except for the inline plots that are generated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried editing matplotlibrc, and have been able to change the coloring for different parts of the plot (ticks, axes, etc) with the exception of the background. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know enough about how the plots are generated inline to figure out where they're inheriting their background color from. I've looking through the &lt;code&gt;M-x customize-group&lt;/code&gt; options for ein, but haven't been able to find anything that affects the inline plot background. &lt;/p&gt;&#xA;" OwnerUserId="7113" LastActivityDate="2018-08-29T11:17:19.710" Title="Emacs Ipython Notebook - What is determining inline plot background?" Tags="|faces|ipython|ein|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10828" PostTypeId="1" CreationDate="2015-04-21T13:28:48.233" Score="4" ViewCount="315" Body="&lt;p&gt;I'm trying to override the keymap &lt;code&gt;C-l&lt;/code&gt; binding when in helm mode. &#xA;However, it doesn't seem to be working - even though my other bindings work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried setting &lt;code&gt;C-l&lt;/code&gt; to nil and also binding to both helm-map and helm-find-files-map but it still has the default binding.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (define-key helm-find-files-map (kbd &quot;C-l&quot;) nil)&#xA;    (define-key helm-map (kbd &quot;C-l&quot;) nil)&#xA;&#xA;    (define-key helm-map (kbd &quot;C-l&quot;) 'helm-execute-persistent-action)&#xA;    (define-key helm-find-files-map (kbd &quot;C-l&quot;) 'helm-execute-persistent-action)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there something that I'm missing here that is preventing me from overriding this keybinding?&lt;/p&gt;&#xA;" OwnerUserId="7115" LastActivityDate="2015-05-22T01:01:11.493" Title="Cannot override C-l bindings in helm-mode" Tags="|helm|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10829" PostTypeId="2" ParentId="10822" CreationDate="2015-04-21T15:35:05.173" Score="4" Body="&lt;p&gt;A nice package that helps with setting up the environment is &lt;code&gt;exec-path-from-shell&lt;/code&gt; (at MELPA or &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;https://github.com/purcell/exec-path-from-shell&lt;/a&gt;). As the name suggests it sets the PATH variable to a more useful value, but it is also able to set any number of environment variables. I use it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (and (memq window-system '(mac ns))&#xA;           (require 'exec-path-from-shell nil t))&#xA;  ;; (setq exec-path-from-shell-debug t)&#xA;  (exec-path-from-shell-initialize)&#xA;  (exec-path-from-shell-copy-envs '(&quot;LANG&quot; &quot;GPG_AGENT_INFO&quot; &quot;SSH_AUTH_SOCK&quot;))&#xA;  (message &quot;Initialized PATH and other variables from SHELL.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With these lines I get the same locale environment as in my plain terminal sessions. A more simple variant of the above, that will throw errors if the library is not available is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'exec-path-from-shell)&#xA;(exec-path-from-shell-initialize)&#xA;(exec-path-from-shell-copy-envs '(&quot;LANG&quot; &quot;GPG_AGENT_INFO&quot; &quot;SSH_AUTH_SOCK&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to check if an environment variable has found its way inside Emacs, call the function &lt;code&gt;getenv&lt;/code&gt; via M-x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: As has been mentioned in the comments, you should double check that your environment variables, that should be imported by Emacs, are really available in a default shell. This can be check via &lt;code&gt;env&lt;/code&gt; (in the shell or terminal). If the variable is missing in the env output, it has to be exported from your shells init script (e.g. &lt;code&gt;~/.bash_login&lt;/code&gt; or &lt;code&gt;~/.bashrc&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="7068" LastEditorUserId="7068" LastEditDate="2015-04-22T15:12:20.450" LastActivityDate="2015-04-22T15:12:20.450" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10830" PostTypeId="1" AcceptedAnswerId="10834" CreationDate="2015-04-21T15:59:20.520" Score="5" ViewCount="425" Body="&lt;p&gt;I have seen &lt;a href=&quot;https://emacs.stackexchange.com/a/3827/2592&quot;&gt;posts&lt;/a&gt; on the topic of getting &quot;??&quot; in the modeline instead of the line number. However despite my best efforts I can't get rid of the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have put those settings in my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq line-number-display-limit nil)&#xA;  (setq line-number-display-limit-width most-positive-fixnum)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure they help, &lt;em&gt;sometimes&lt;/em&gt; now it's OK. But at least half of the time it's not. It's funny, I made myself a &lt;a href=&quot;https://dl.dropboxusercontent.com/u/22600720/no_lines.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;test file&lt;/a&gt; and it's kind of randomly working or not...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;spacemacs&lt;/code&gt; and put &lt;a href=&quot;https://github.com/emmanueltouzery/dotspacemacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;my config&lt;/a&gt; on github.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/spacemacs/packages.el#L2320&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; is the relevant code in spacemacs if that helps...&lt;/p&gt;&#xA;" OwnerUserId="2592" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-04-22T08:55:40.010" Title="?? in the modeline instead of the line number" Tags="|mode-line|" AnswerCount="1" CommentCount="4" ClosedDate="2015-04-21T20:32:56.660" ContentLicense="CC BY-SA 3.0" />
  <row Id="10831" PostTypeId="1" CreationDate="2015-04-21T16:30:50.440" Score="1" ViewCount="267" Body="&lt;p&gt;This is when I was trying to install helm-projectile package via &lt;code&gt;M-x package-install&lt;/code&gt;. What's this mean? How do I resolve?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-04-21T16:30:50.440" Title="Tried to install package, got &quot;Error during download request: Not found&quot;" Tags="|helm|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10832" PostTypeId="2" ParentId="10831" CreationDate="2015-04-21T16:30:50.440" Score="2" Body="&lt;p&gt;I dug up the answer in &lt;a href=&quot;https://github.com/bbatsov/prelude/issues/296&quot; rel=&quot;nofollow&quot;&gt;this thread&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-refresh-contents&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://xkcd.com/979/&quot; rel=&quot;nofollow&quot;&gt;attached XKCD&lt;/a&gt; inspired me to make this Q&amp;amp;A on StackExchange.&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-04-21T16:30:50.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10833" PostTypeId="1" CreationDate="2015-04-21T17:01:17.097" Score="2" ViewCount="216" Body="&lt;pre&gt;&lt;code&gt;(error &quot;You must be before a list form&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I instrument a function in emacs. Now, this function is calling some other function. I try to step into this new function using the shortcut key &lt;code&gt;i&lt;/code&gt; (&lt;code&gt;step-into-function&lt;/code&gt;). Emacs throws an error, with this message -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You must be before a list form&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The irony is, for forms emacs evaluate, it always places the cursor at the end of a form like this,&#xA;&lt;img src=&quot;https://i.stack.imgur.com/tR02q.png&quot; alt=&quot;cursor-position&quot;&gt;&#xA;So, why doesn't edebug &lt;code&gt;step-in&lt;/code&gt; work properly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since my cursor keeps blinking, i have put a black mark for cursor instead of the usual white mark.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-04-21T17:01:17.097" Title="Edebug step-in throws error" Tags="|edebug|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10834" PostTypeId="2" ParentId="10830" CreationDate="2015-04-21T17:14:50.943" Score="4" Body="&lt;p&gt;I did replace the value of &lt;code&gt;line-number-display-limit-width&lt;/code&gt; with something substantially smaller eventually and that fixed the issue for me.  Judging by the code in &lt;code&gt;xdisp.c&lt;/code&gt; Emacs is using a heuristics that involves multiplying &lt;code&gt;line-number-display-limit-width&lt;/code&gt; with the window height times two plus thirty.  Doing that on &lt;code&gt;most-positive-fixnum&lt;/code&gt; will overflow into a negative number and probably makes the heuristics fail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the worst case with a 32bit system (where &lt;code&gt;most-positive-fixnum&lt;/code&gt; is &lt;code&gt;2^29-1&lt;/code&gt;) and with 85 lines of text, a safe value should be &lt;code&gt;(2^29-1)/(2*85+30) = 2684354&lt;/code&gt; or lower.  So, try the following instead (and keep &lt;code&gt;line-number-display-limit&lt;/code&gt; as is):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq line-number-display-limit-width 2000000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-04-21T17:19:57.517" LastActivityDate="2015-04-21T17:19:57.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10835" PostTypeId="2" ParentId="10816" CreationDate="2015-04-21T17:50:24.460" Score="1" Body="&lt;p&gt;Looks like, &lt;code&gt;yas-snippets&lt;/code&gt; doesn't get loaded by default. Calling &lt;code&gt;yas-reload-all&lt;/code&gt; loaded the python snippets. I confirmed, the snippets are loaded by listing them with &lt;code&gt;C-c &amp;amp; C-v&lt;/code&gt;. And it works now...&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-04-21T17:50:24.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10836" PostTypeId="1" AcceptedAnswerId="10841" CreationDate="2015-04-21T18:26:29.300" Score="5" ViewCount="285" Body="&lt;p&gt;Say we have a file with several cursors. Not all lines have cursors, but every cursor is on a different line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I kill all the lines without cursors? I couldn't find a single &lt;code&gt;mc&lt;/code&gt; command for this, but maybe there is a still a way to do it with the other commands?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2015-04-21T18:32:11.457" LastActivityDate="2015-04-21T23:18:07.387" Title="Keeping only the lines with the cursors in multiple-cursors" Tags="|multiple-cursors|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10837" PostTypeId="1" AcceptedAnswerId="10838" CreationDate="2015-04-21T19:19:12.680" Score="49" ViewCount="5208" Body="&lt;p&gt;By default, Company mode seems to convert every prediction into lower case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  HelloWorldOfGoo&#xA;  HelloWorldOfEmacs&#xA;  -&amp;gt;&#xA;  Hell&#xA;  [Helloworldofgoo]  //Company prediction&#xA;  [Helloworldofemacs]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is not very practical for case sensitive programming languages without a special backend. How can I make company mode case sensitive?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-04-21T20:53:16.133" LastActivityDate="2015-04-21T20:53:16.133" Title="How to make Company mode be case-sensitive on plain Text?" Tags="|company-mode|dabbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10838" PostTypeId="2" ParentId="10837" CreationDate="2015-04-21T19:20:45.957" Score="77" Body="&lt;p&gt;After some research, I came across the &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/14&quot;&gt;company mode git hub ticket&lt;/a&gt;, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which says that company mode uses dabbrev for plain text as backend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;dabbrev has an option to downcase things, it is turned on by default but can be turned off:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-dabbrev-downcase nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now all is well.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-04-21T19:20:45.957" CommentCount="4" CommunityOwnedDate="2015-04-21T19:20:45.957" ContentLicense="CC BY-SA 3.0" />
  <row Id="10839" PostTypeId="1" AcceptedAnswerId="10840" CreationDate="2015-04-21T19:39:37.203" Score="1" ViewCount="336" Body="&lt;p&gt;I have web-mode (which is awesome, by the way). &#xA;The following line: &#xA;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.html\\'&quot; . web-mode))&lt;/code&gt;&#xA;every time when a .html file is loaded, web-mode will be enabled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like when web-mode is loading in &lt;code&gt;.html&lt;/code&gt;-files, then the zencoding-mode (a minor mode) will be also enabled by default. I tried various ways to get this worked. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example &lt;code&gt;(add-hook 'web-mode-hook 'zencoding-mode)&lt;/code&gt;will not work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.html\\'&quot; . zencoding-mode))&lt;/code&gt;&#xA;gives problems. Then web-mode is not being loaded, but zencoding mode is being loaded (because that's the last line to be evaluated, so replaces web-mode when a html-file is being opened. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? I would be genuinely thankful. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-04-21T20:27:31.037" Title="How automatically load a mode with another mode (web-mode with zencoding-mode)?" Tags="|elisp|hooks|web-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10840" PostTypeId="2" ParentId="10839" CreationDate="2015-04-21T20:13:18.107" Score="2" Body="&lt;p&gt;Your problem appears to be only that you have not loaded both of those Lisp files. I downloaded those files and loaded them both, then did what you did, and had no problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'web-mode)&#xA;(require 'zencoding-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.html\\'&quot; . web-mode))&#xA;(add-hook 'web-mode-hook 'zencoding-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You of course need to put the directory that contains those files in your &lt;code&gt;load-path&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/the/location/of/those/files/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-21T20:27:31.037" LastActivityDate="2015-04-21T20:27:31.037" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10841" PostTypeId="2" ParentId="10836" CreationDate="2015-04-21T20:56:59.863" Score="3" Body="&lt;p&gt;The following function creates messages only, instead of actually deleting anything.  If this approach seems appealing, then &lt;code&gt;(message &quot;No real or fake cursor here:  %s&quot; line)&lt;/code&gt; can be substituted with &lt;code&gt;(kill-region pbol peol)&lt;/code&gt; to kill the line and place it into the kill-ring. If the user wishes to also remove the &lt;code&gt;\n&lt;/code&gt; at the end of the line, then use &lt;code&gt;(kill-region pbol (1+ peol))&lt;/code&gt;.  The section of code &lt;code&gt;(message &quot;MC exists:  %s&quot; line)&lt;/code&gt; can be replaced with &lt;code&gt;nil&lt;/code&gt; so that the function is silent in its operation.  This function should only run one time, so it is added to the list of &lt;code&gt;mc--default-cmds-to-run-once&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mc/kill-all-lines-without-cursors ()&#xA;&quot;Kill all lines that do not have fake or real cursors.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      mc&#xA;      line&#xA;      pbol&#xA;      peol&#xA;      (starting-line (line-number-at-pos))&#xA;      (my-list&#xA;        (mapcar&#xA;          (lambda (x)&#xA;            (cons (mc/cursor-beg x) (mc/cursor-end x)))&#xA;          (mc/all-fake-cursors))))&#xA;    (save-excursion&#xA;      (goto-char (point-max))&#xA;      (catch 'done&#xA;        (while t&#xA;          (setq line (line-number-at-pos))&#xA;          (setq mc nil)&#xA;          (setq pbol (point-at-bol))&#xA;          (setq peol (point-at-eol))&#xA;          (catch 'found&#xA;            (mapcar&#xA;              (lambda (x)&#xA;                (when&#xA;                  (or&#xA;                    (and&#xA;                      (&amp;gt;= (car x) pbol)&#xA;                      (&amp;lt;= (car x) peol))&#xA;                    (and&#xA;                      (&amp;gt;= (cdr x) pbol)&#xA;                      (&amp;lt;= (cdr x) peol)))&#xA;                  (setq mc t)&#xA;                  (throw 'found (message &quot;MC exists:  %s&quot; line))))&#xA;              my-list))&#xA;          (unless (or mc (= line starting-line))&#xA;            (message &quot;No real or fake cursor here:  %s&quot; line))&#xA;          (when (= 1 line) (throw 'done nil))&#xA;          (re-search-backward &quot;\n&quot; nil t))))))&#xA;&#xA;(add-to-list 'mc--default-cmds-to-run-once 'mc/kill-all-lines-without-cursors)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-04-21T23:18:07.387" LastActivityDate="2015-04-21T23:18:07.387" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10842" PostTypeId="1" CreationDate="2015-04-21T21:45:23.900" Score="11" ViewCount="10136" Body="&lt;p&gt;A recursive grep in a directory should be the simplest thing, but I haven't found the recipe to get it to work yet. I'm juggling between the following commands and am not sure which has the functionality buried within it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;helm-find-files&lt;/code&gt;: The problem is this is really bad at finding a directory recursively.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;projectile-find-dir&lt;/code&gt;: This is great at finding the dir! However despite using helm complete you don't wind up in helm mode, so the &lt;code&gt;C-u C-s&lt;/code&gt; command doesn't work here.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;helm-find&lt;/code&gt;: gets the recursion right but targets files, not directories&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;helm-projectile-find-dir&lt;/code&gt;: Seems to be what I want.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2017-03-09T12:30:36.017" Title="Recursive grep in directory with helm and/or projectile?" Tags="|helm|projectile|grep|" AnswerCount="6" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10843" PostTypeId="2" ParentId="10842" CreationDate="2015-04-21T21:45:23.900" Score="0" Body="&lt;p&gt;&lt;code&gt;helm-projectile-find-dir&lt;/code&gt; is probably the proper functionality. You can&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Find a directory as in &lt;code&gt;projectile-find-dir&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;But then you finish in Helm mode where you can run &lt;code&gt;C-u C-s&lt;/code&gt; for a recursive search as desired.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-04-21T21:45:23.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10844" PostTypeId="2" ParentId="10544" CreationDate="2015-04-21T21:59:02.450" Score="1" Body="&lt;p&gt;I found two solutions to this problem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;code&gt;helm-find&lt;/code&gt; instead, which, as in unix find, will search recursively.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;helm-projectile&lt;/code&gt; with projectile instead.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-04-21T21:59:02.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10845" PostTypeId="2" ParentId="10842" CreationDate="2015-04-21T22:07:27.067" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;A recursive grep in a directory should be the simplest thing&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For a simple recursive grep inside current directory, just: &lt;code&gt;M-x grep&lt;/code&gt; then, inside the minibuffer: &lt;code&gt;Run grep (like this): grep -nHr &quot;pattern&quot;&lt;/code&gt;. (notice the -r flag).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also be interested by &lt;code&gt;rgrep&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;rgrep is an interactive autoloaded compiled Lisp function in&lt;br&gt;&#xA;  `grep.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(rgrep REGEXP &amp;amp;optional FILES DIR CONFIRM)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Recursively grep for REGEXP in FILES in directory tree rooted at DIR.&#xA;  The search is limited to file names matching shell pattern FILES.&#xA;  FILES may use abbreviations defined in &lt;code&gt;grep-files-aliases', e.g.&#xA;  entering&lt;/code&gt;ch' is equivalent to `*.[ch]'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-04-21T22:07:27.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10846" PostTypeId="1" AcceptedAnswerId="10874" CreationDate="2015-04-21T22:15:19.143" Score="8" ViewCount="422" Body="&lt;p&gt;I currently truncate buffers at 20,000 lines by adding the following to my&#xA;configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq eshell-buffer-maximum-lines 20000)&#xA;;; automatically truncate buffer after output&#xA;(add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works great for &amp;lt; 20,000 lines, and once the buffer reaches 20,000 lines it&#xA;gets truncated on every line (so it sits at 20,001 lines forever). However, when&#xA;the buffer reaches 20,000 lines, each subsequent line takes much longer to be&#xA;printed and causes the CPU of emacs to sit at 100% for quite a while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to improve the performance of the buffer truncation? Perhaps only&#xA;truncating every 100 added lines? It's not like I really need it to be &lt;em&gt;exactly&lt;/em&gt;&#xA;20,000 lines, I just don't want the buffer to grow infinitely.&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2015-04-22T21:32:25.163" Title="How to improve the performance of eshell buffer truncation?" Tags="|eshell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10847" PostTypeId="2" ParentId="10828" CreationDate="2015-04-22T00:20:17.010" Score="3" Body="&lt;p&gt;Turns &lt;a href=&quot;https://emacs.stackexchange.com/users/97/zck&quot;&gt;zck&lt;/a&gt; was correct here.&#xA;I wasn't using &lt;code&gt;helm-read-file-map&lt;/code&gt; in my situation - which was to go down a level in helm mode.&lt;/p&gt;&#xA;" OwnerUserId="7115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-04-22T00:20:17.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10848" PostTypeId="2" ParentId="10693" CreationDate="2015-04-22T02:50:07.403" Score="0" Body="&lt;p&gt;I found on SO the following &lt;a href=&quot;https://stackoverflow.com/questions/24231619/emacs-auto-complete-c-headers-symbols-value-as-variable-is-void/27546823#27546823&quot;&gt;answer&lt;/a&gt; that works by &lt;a href=&quot;https://stackoverflow.com/users/2255631/abdimuna&quot;&gt;abdimuna&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First locate C/C++ headers on your computer by running the following command. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gcc -xc++ -E -v - &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On my ArchLinux they are located here &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/x86_64-unknown-linux-gnu&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/backward&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/include&#xA; /usr/local/include&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/include-fixed&#xA; /usr/include&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the complete C/C++ auto-completion which works for me is this. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; C++ auto completion mode&#xA;(require 'auto-complete)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;;a function which initializes auto-complete-c-headers and get called for c/c++ hooks&#xA;(defun my:acc-c-header-init ()&#xA;  (require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-headers)&#xA;  (add-to-list 'achead:include-directories '&quot; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/x86_64-unknown-linux-gnu&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../include/c++/4.9.1/backward&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/include&#xA; /usr/local/include&#xA; /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/include-fixed&#xA; /usr/include&quot;&#xA;     )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2603" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-04-22T02:50:07.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10849" PostTypeId="1" AcceptedAnswerId="10850" CreationDate="2015-04-22T03:01:28.250" Score="3" ViewCount="110" Body="&lt;p&gt;I am looking for an alternative to &lt;code&gt;file-name-extension&lt;/code&gt; that will include an ending &lt;code&gt;~&lt;/code&gt; if there is one.  For example, if there is a file named &lt;code&gt;foo.el~&lt;/code&gt;, the result should be &lt;code&gt;el~&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than using the generic &lt;code&gt;split-string&lt;/code&gt;, I was hoping there might be something more specific geared towards file extensions.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-04-22T04:12:23.367" Title="Alternative to `file-name-extension` that will include `~`" Tags="|string|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10850" PostTypeId="2" ParentId="10849" CreationDate="2015-04-22T04:05:56.300" Score="3" Body="&lt;p&gt;The built-in function &lt;code&gt;file-name-extension&lt;/code&gt; uses &lt;code&gt;file-name-sans-versions&lt;/code&gt;, which does us the &lt;em&gt;favor&lt;/em&gt; of removing the &lt;strong&gt;tilde&lt;/strong&gt;.  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Components.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Components.html&lt;/a&gt;  Removing &lt;code&gt;file-name-sans-versions&lt;/code&gt; from said function achieves the desired effect.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-file-name-extension (filename &amp;amp;optional period)&#xA;&quot;This function is a modification of `file-name-extension`, in that the function&#xA;`file-name-sans-extensions` has been removed -- thus, the tilde (if any) remains.&quot;&#xA;  (save-match-data&#xA;    (let ((file (file-name-nondirectory filename)))&#xA;      (if (and (string-match &quot;\\.[^.]*\\'&quot; file)&#xA;        (not (eq 0 (match-beginning 0))))&#xA;          (substring file (+ (match-beginning 0) (if period 0 1)))&#xA;        (if period&#xA;            &quot;&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-04-22T04:12:23.367" LastActivityDate="2015-04-22T04:12:23.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10851" PostTypeId="2" ParentId="10842" CreationDate="2015-04-22T08:20:52.683" Score="1" Body="&lt;p&gt;You could try &lt;code&gt;helm-do-grep&lt;/code&gt;. Calling it with a prefix arg gives you a recursive grep, as explained in the &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#grepdirectoryrecursively&quot; rel=&quot;nofollow&quot;&gt;Helm Wiki&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you want to launch helm-do-grep recursively without starting&#xA;  helm-find-files, do:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;C-u helm-command-prefix-key M-g s&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;NOTE: If you forget to hit C-u before M-g s you can do it after file&#xA;  selection.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You will be prompted for selecting in which category of files to&#xA;  search: Use the wilcard syntax like *.el for example (search in only&#xA;  .el files).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;By default, the extension of the file at point is used when the cursor&#xA;  is on a filename. If the cursor is at root of a directory, all the&#xA;  filename extensions found in the directory and not matching&#xA;  grep-find-ignored-files are inserted into the prompt.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Try it like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-u helm-command-prefix-key M-g s&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2015-04-22T08:27:23.750" LastActivityDate="2015-04-22T08:27:23.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10852" PostTypeId="1" AcceptedAnswerId="10853" CreationDate="2015-04-22T08:48:08.987" Score="1" ViewCount="213" Body="&lt;p&gt;In the following skeleton definition, I like to have quote characters &lt;code&gt;&quot;&lt;/code&gt;, &lt;code&gt;`&lt;/code&gt; and &lt;code&gt;'&lt;/code&gt; &#xA;in the generated skeleton code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to have the effect of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME:a-function-test &#xA;#+BEGIN_SRC clojure &#xA;(facts &quot;about `a-function'&quot;&#xA; ) &#xA;#+END_SRC &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'm only able to do this now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME:a-function-test &#xA;#+BEGIN_SRC clojure &#xA;(facts about a-function&#xA; ) &#xA;#+END_SRC &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is my current implementation. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results output :exports none&#xA;  (define-skeleton tdd-clojure-skeleton&#xA;    &quot;Define a skeleton &quot;&#xA;    &quot;function name: &quot;&#xA;&#xA;    &quot;#+NAME:&quot; str &quot;-test&quot; &quot; \n&quot;&#xA;      &quot;#+BEGIN_SRC clojure&quot; &quot; \n&quot;&#xA;      &quot;(facts &quot; &quot;about &quot; str &quot;\n&quot;&#xA;      &quot; )&quot; &quot; \n&quot;&#xA;      &quot;#+END_SRC&quot; &quot; \n&quot;&#xA;&#xA;  )&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="6845" LastEditorUserId="2710" LastEditDate="2015-04-22T12:51:00.140" LastActivityDate="2015-04-22T12:51:00.140" Title="Insert quote characters in define-skeleton" Tags="|skeleton|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10853" PostTypeId="2" ParentId="10852" CreationDate="2015-04-22T09:08:48.313" Score="3" Body="&lt;p&gt;You just need to escape the &lt;code&gt;&quot;&lt;/code&gt; with a backslash &lt;code&gt;\&quot;&lt;/code&gt;.  You can also concatenate some of the strings.  Only the final newline needs to be quoted:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton tdd-clojure-skeleton&#xA;    &quot;Define a skeleton &quot;&#xA;    &quot;function name: &quot;&#xA;&#xA;    &quot;#+NAME:&quot; str &quot;-test&quot; \n&#xA;      &quot;#+BEGIN_SRC clojure&quot; \n&#xA;      &quot;(facts  \&quot;about \'&quot; str &quot;\'\&quot;&quot; \n&#xA;      &quot; )&quot; \n&#xA;      &quot;#+END_SRC \n&quot;&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This run with input &lt;code&gt;test&lt;/code&gt; gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME:test-test&#xA;#+BEGIN_SRC clojure&#xA;(facts &quot;about 'test'&quot;&#xA; )&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-04-22T09:36:32.597" LastActivityDate="2015-04-22T09:36:32.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10854" PostTypeId="2" ParentId="10820" CreationDate="2015-04-22T09:55:17.980" Score="10" Body="&lt;p&gt;Set &lt;code&gt;flycheck-disabled-checkers&lt;/code&gt; to &lt;code&gt;(emacs-lisp-checkdoc)&lt;/code&gt; via file or directory variables, i.e. &lt;code&gt;M-x add-file-local-variable RET flycheck-disabled-checkers RET (emacs-lisp-checkdoc)&lt;/code&gt; or &lt;code&gt;add-dir-local-variable RET emacs-lisp-mode RET flycheck-disabled-checkers RET (emacs-lisp-checkdoc)&lt;/code&gt; respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.flycheck.org/en/latest/user/syntax-checkers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Syntax checkers&lt;/a&gt; in the Flycheck manual for more information.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="2666" LastEditDate="2018-04-07T14:51:40.967" LastActivityDate="2018-04-07T14:51:40.967" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10855" PostTypeId="2" ParentId="5776" CreationDate="2015-04-22T10:03:52.607" Score="1" Body="&lt;p&gt;This was an &lt;a href=&quot;https://github.com/haskell/haskell-mode/issues/403&quot; rel=&quot;nofollow&quot;&gt;upstream bug&lt;/a&gt; that has been fixed in the meantime.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-04-22T10:03:52.607" CommentCount="0" CommunityOwnedDate="2015-04-22T10:03:52.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="10856" PostTypeId="1" AcceptedAnswerId="10859" CreationDate="2015-04-22T10:16:17.323" Score="11" ViewCount="4490" Body="&lt;p&gt;I have a set of key bindings that I use for both &lt;code&gt;web-mode&lt;/code&gt; and &lt;code&gt;php-mode&lt;/code&gt; in insert mode (of Evil). So I cannot use &lt;code&gt;set-local-map&lt;/code&gt; or something. Because in normal mode, the same keys will then call other commands. So the bindings need to be active in &lt;code&gt;evil-insert-state-map&lt;/code&gt; only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'php-mode&#xA;  '(progn&#xA;     (define-key evil-insert-state-map&#xA;       (kbd &quot;C-&amp;lt;next&amp;gt;&quot;) (lambda () (interactive) (insert &quot; = &quot;)))&#xA;     (define-key evil-insert-state-map&#xA;       (kbd &quot;C-&amp;lt;prior&amp;gt;&quot;) (lambda () (interactive) (insert &quot;-&amp;gt;&quot;)))))&#xA;&#xA;(eval-after-load 'web-mode&#xA;  '(progn&#xA;     (define-key evil-insert-state-map&#xA;       (kbd &quot;C-&amp;lt;next&amp;gt;&quot;) 'zencoding-expand-yas) &#xA;     (define-key evil-insert-state-map&#xA;       (kbd &quot;C-&amp;lt;prior&amp;gt;&quot;) 'zencoding-expand-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So every time &lt;code&gt;web-mode&lt;/code&gt; or &lt;code&gt;php-mode&lt;/code&gt; is being loaded, these key bindings will be activated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The problem is:&lt;/strong&gt; Suppose I have two open buffers, one in the &lt;code&gt;php-mode&lt;/code&gt; and the other in &lt;code&gt;web-mode&lt;/code&gt;. When the &lt;code&gt;web-mode&lt;/code&gt; buffer is the current buffer and I switch to an another buffer which's in &lt;code&gt;php-mode&lt;/code&gt;, the &lt;code&gt;web-mode&lt;/code&gt; bindings are still active inside the &lt;code&gt;php-mode&lt;/code&gt; buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to solve this problem by using &lt;code&gt;(add-hook 'web-mode-hook [...])&lt;/code&gt; and &lt;code&gt;(add-hook 'php-mode-hook [...])&lt;/code&gt; instead of setting up the bindings in &lt;code&gt;eval-after-load&lt;/code&gt;. But that solution doesn't work in this situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? I would really appreciate it.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-08-20T10:53:15.323" LastActivityDate="2016-08-20T10:53:15.323" Title="How do I set up key bindings for modes in a specific Evil state?" Tags="|key-bindings|evil|web-mode|php-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10858" PostTypeId="1" AcceptedAnswerId="10873" CreationDate="2015-04-22T10:47:57.917" Score="3" ViewCount="89" Body="&lt;p&gt;I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(TeX-insert-braces nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my customizations, which according to the document should mean that braces &lt;code&gt;{}&lt;/code&gt; are not automatically inserted after macros via &lt;code&gt;TeX-insert-macro&lt;/code&gt;.  However, when &#xA;I insert the accent macro &lt;code&gt;\tilde&lt;/code&gt; the braces are added, contrary to my wish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can trace this down to &lt;code&gt;latex.el&lt;/code&gt; containing &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (TeX-add-symbols&#xA;    ...&#xA;    '(&quot;tilde&quot; t)&#xA;    ...&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the function &lt;code&gt;LaTeX-common-initialisation&lt;/code&gt;.  As a result I have tried to override the setting by adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(TeX-add-symbols '(&quot;tilde&quot; nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;'LaTeX-mode-hook&lt;/code&gt;, but this doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do this and&#xA;is there a systematic way to implement this for all accent symbols?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the list of such symbols is available in the &lt;code&gt;Math &amp;gt; Accents&lt;/code&gt; menu, when math mode is enable (which I do by default).&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-04-22T11:01:47.663" LastActivityDate="2015-04-23T13:57:08.670" Title="Override auctex adding brace after accent macro" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10859" PostTypeId="2" ParentId="10856" CreationDate="2015-04-22T11:59:32.433" Score="13" Body="&lt;p&gt;Evil has the &lt;code&gt;evil-define-key&lt;/code&gt; macro for defining commands for certain states in a specific keymap only:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'insert emacs-lisp-mode-map (kbd &quot;C-c C-c&quot;) 'butterfly&#xA;                                             (kbd &quot;&amp;lt;pause&amp;gt;&quot;) 'zone)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is able to delay the execution of the binding (by using &lt;code&gt;eval-after-load&lt;/code&gt; itself) and can also take more than one key-command pair which is a pretty nifty addition.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-04-22T11:59:32.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10860" PostTypeId="1" CreationDate="2015-04-22T14:15:06.687" Score="3" ViewCount="795" Body="&lt;p&gt;I need to create a parser for Ruby so I can use the &lt;a href=&quot;https://github.com/gregsexton/origami.el&quot; rel=&quot;nofollow&quot;&gt;origami&lt;/a&gt; folding package. To make matters more complex, I use &lt;a href=&quot;https://github.com/zenspider/enhanced-ruby-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;enh-ruby-mode&lt;/code&gt;&lt;/a&gt;, so I 'd like to build the parser for that, if it makes a difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package has the following instructions:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It should be fairly easy to write a parser. An origami parser is a&#xA;  function that takes a 'create function' and returns a function taking&#xA;  the string to be parsed. The returned function should return a list of&#xA;  fold nodes. Fold nodes are created using the passed-in create&#xA;  function. Best to use an example:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun my-amazing-parser (create)&#xA;   (lambda (content)&#xA;     (list (funcall create beginning-of-the-fold-node-point-position ; inclusive&#xA;                           end-of-the-fold-node-point-position ; exclusive&#xA;                           offset  ; this allows you to show some of the start of the folded text&#xA;                           child-nodes))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The origami package has a &lt;a href=&quot;https://github.com/gregsexton/origami.el/blob/master/origami-parsers.el&quot; rel=&quot;nofollow&quot;&gt;parsers&lt;/a&gt; file that has the built-in examples, and they also support regular expressions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I am a little too weak with elisp yet to understand it (and it looks like he uses some libraries with functions like &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt; and I don't know how to go and find out what they are or where they came from).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first guess would be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun origami-ruby-parser (create)&#xA;   (lambda (content)&#xA;     (list (funcall create (enh-ruby-beginning-of-block) ; inclusive&#xA;                           (enh-ruby-end-of-block) ; exclusive&#xA;                           10  ; this allows you to show some of the start of the folded text&#xA;                           child-nodes))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know what &lt;code&gt;child-nodes&lt;/code&gt; is supposed to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And from there, the question will be &quot;can I create more complex matching rules using if/else/etc ?&quot;&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2015-04-25T14:35:23.263" Title="origami (folding) package: create parser for Ruby" Tags="|code-folding|enh-ruby-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10861" PostTypeId="2" ParentId="10808" CreationDate="2015-04-22T14:17:34.453" Score="0" Body="&lt;p&gt;You can either use the &lt;code&gt;stop&lt;/code&gt; command or you can use &lt;code&gt;C-c C-z&lt;/code&gt; which sends the stop signal. You could also just add the new breakpoints, if the new breakpoints are after your current position, when you do &lt;code&gt;continue&lt;/code&gt; it will stop in the new breakpoint. If the breakpoint is before your current position, then you can restart the program by doing &lt;code&gt;run&lt;/code&gt; this will restart the process. You can find more information here &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Commands-of-GUD.html#Commands-of-GUD&quot; rel=&quot;nofollow&quot;&gt;GUD Commands&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&#xA;In that case, you might want to read &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/DEBUG&quot; rel=&quot;nofollow&quot;&gt;etc/DEBUG&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the gdb shell, you can start it by doing: &lt;code&gt;C-u M-x gdb&lt;/code&gt; and then pass the &lt;code&gt;-i=mi -p PID&lt;/code&gt; as well as any other flag you might need.&lt;/p&gt;&#xA;" OwnerUserId="666" LastEditorUserId="666" LastEditDate="2015-04-23T23:45:32.683" LastActivityDate="2015-04-23T23:45:32.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10862" PostTypeId="2" ParentId="7519" CreationDate="2015-04-22T14:19:53.097" Score="2" Body="&lt;p&gt;There is a &lt;strong&gt;much simpler solution&lt;/strong&gt;, please study my code at &lt;a href=&quot;https://github.com/redguardtoo/evil-nerd-commenter/blob/master/evil-nerd-commenter.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/evil-nerd-commenter/blob/master/evil-nerd-commenter.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I won't copy/paste all the code here. but here are the key points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;comment has its own font face, search font-lock-comment-face and font-lock-comment-delimiter-face in my code&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;use Emacs own API to uncomment the second line, then join it with the first line&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It should work on any sensible major modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This trick is not invented by me. It's actually from Emacs own code, (more specifically, flyspell). So the solution should support any major-modes flyspell supports&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-04-22T14:40:25.807" LastActivityDate="2015-04-22T14:40:25.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10863" PostTypeId="1" CreationDate="2015-04-22T14:21:26.563" Score="3" ViewCount="2324" Body="&lt;p&gt;What would prevent &lt;code&gt;org-anniversary&lt;/code&gt; entries from appearing in the Agenda? Entries such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%(org-anniversary 2015 01 01) New Year's Day&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fail to show in the Agenda. I have toggled &lt;code&gt;org-agenda-include-diary&lt;/code&gt; FWIW.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Using Org 9.0.4:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have ensured that the &lt;code&gt;%%&lt;/code&gt; starts flush on the left margin.&lt;/li&gt;&#xA;&lt;li&gt;I have tested the anniversary entry under a &lt;code&gt;*&lt;/code&gt; and &lt;code&gt;**&lt;/code&gt; headline.&lt;/li&gt;&#xA;&lt;li&gt;I have included the &lt;code&gt;PROPERTIES&lt;/code&gt; drawer, as included in some example.&lt;/li&gt;&#xA;&lt;li&gt;I have  replaced the leading &lt;code&gt;0&lt;/code&gt; characters in the dates with a space.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;None of the above solved this -- the anniverary does still not appear in the agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting Emacs with &lt;code&gt;-Q&lt;/code&gt; and then evaluating only &lt;code&gt;setq org-agenda-files&lt;/code&gt; ... to set my agenda file also doesn't result in the anniverary appearing in the agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Including &lt;code&gt;%%(org-calendar-holiday)&lt;/code&gt; results in those holidays appearing in the agenda.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="5345" LastEditDate="2017-03-09T12:17:32.793" LastActivityDate="2024-03-05T11:06:45.783" Title="org-anniversary entries not appearing in Agenda" Tags="|org-mode|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10864" PostTypeId="2" ParentId="10842" CreationDate="2015-04-22T14:21:31.967" Score="2" Body="&lt;p&gt;In addition to the tools mentioned in the other answers, another cool function is &lt;code&gt;find-grep-dired&lt;/code&gt; which creates a &lt;code&gt;dired&lt;/code&gt; buffer containing all files matching a recursive grep pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It just runs &lt;code&gt;find . \( -type f -exec grep -q -e my-regular-expression \{\} \; \) -ls&lt;/code&gt; and displays the results in a &lt;code&gt;dired&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-04-22T14:21:31.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10865" PostTypeId="1" AcceptedAnswerId="10866" CreationDate="2015-04-22T15:27:24.933" Score="1" ViewCount="199" Body="&lt;p&gt;I have Emacs run in daemon mode at system startup, and run emacsclient automatically when I login to X. I also recently started running &lt;code&gt;midnight-mode&lt;/code&gt;, which regularly runs &lt;code&gt;clean-buffer-list&lt;/code&gt;, which wants to kill the buffer showing my home folder since I rarely visit it. This is a problem because that buffer is associated with the emacsclient invocation, so killing it closes all my frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to decouple emacsclient from that particular buffer? I have to run emacsclient on something in order for it to open a window, so I give it $HOME.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, is there a way to get &lt;code&gt;clean-buffer-list&lt;/code&gt; to look at &lt;code&gt;server-buffer-clients&lt;/code&gt; and skip buffers with it set?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="1979" LastEditDate="2015-04-22T16:29:03.800" LastActivityDate="2015-04-22T16:29:03.800" Title="Having clean-buffer-list skip buffers with server-buffer-clients?" Tags="|emacsclient|daemon|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10866" PostTypeId="2" ParentId="10865" CreationDate="2015-04-22T16:27:04.487" Score="1" Body="&lt;p&gt;Oddly enough, &lt;code&gt;clean-buffer-list&lt;/code&gt; doesn't directly offer a convenient hook for that, no.  But I think you can get the behavior you're asking for with a hack like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-midnight-hack (orig-fun buffer)&#xA;  (with-current-buffer buffer&#xA;    (if server-buffer-clients&#xA;         ;; Return the current time, to pretend it's in use.&#xA;         (float-time)&#xA;      (funcall orig-fun buffer))))&#xA;(advice-add 'midnight-buffer-display-time :around #'my-midnight-hack)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another approach would be to run &lt;code&gt;emacsclient -n ...&lt;/code&gt; so that emacsclient immediately returns and killing that buffer should then not kill all your frames (because the buffer is not marked as belonging to an emacsclient).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-22T16:27:04.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10867" PostTypeId="1" AcceptedAnswerId="10868" CreationDate="2015-04-22T16:40:24.433" Score="1" ViewCount="213" Body="&lt;p&gt;In my emacs, i have set &lt;code&gt;(debug-on-error t)&lt;/code&gt; to see the error's stacktrace. It is very helpful but for mundane errors, it becomes annoying...&#xA;One such error is,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Command attempted to use minibuffer while in minibuffer&quot;)&#xA;  read-from-minibuffer(&quot;Goto line: &quot; nil nil nil nil (&quot;1&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs has provided a way to suppress &lt;code&gt;backtrace prints&lt;/code&gt; on such errors using the variable, &lt;code&gt;debug-ignored-errors&lt;/code&gt;. It takes a list of error codes. Say for the error that the variable has no value - the code is &lt;code&gt;'(void-variable)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do i find the error codes for all the other stacktrace messages?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-04-22T21:05:44.980" LastActivityDate="2015-04-22T21:05:44.980" Title="debug-ignored-errors --&gt; suppress an annoying error/false-positives" Tags="|debugging|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10868" PostTypeId="2" ParentId="10867" CreationDate="2015-04-22T17:18:50.673" Score="3" Body="&lt;p&gt;&lt;code&gt;debug-ignored-errors&lt;/code&gt; can hold signal names (e.g. &lt;code&gt;user-error&lt;/code&gt;) but also regular expressions.  So try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push &quot;\\`Command attempted to use minibuffer while in minibuffer&quot;&#xA;      debug-ignored-errors)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But you might also like to report this issue as a bug.  This error should probably be changed to a &lt;code&gt;user-error&lt;/code&gt; so you don't need to change &lt;code&gt;debug-ignored-errors&lt;/code&gt; yourself.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-22T17:18:50.673" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10870" PostTypeId="2" ParentId="7946" CreationDate="2015-04-22T19:59:26.183" Score="4" Body="&lt;p&gt;I have dealt with this issue a lot. The encoding will be depending on information in the file. If there is no information in the file explicitly to determine what it is, you could get such things as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your work doesn't involve a lot of ancient systems which require different coding, you could consider to force default UTF-8 coding &lt;em&gt;everywhere&lt;/em&gt;. &#xA;It’s practically a standard nowadays, at least in the West (for me anyway), as it is dominant on the Web; has a one-to-one mapping with ASCII; flexible enough to represent any unicode character in the world. But in order to make Emacs use UTF-8 everywhere by default:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;(set-default-coding-systems 'utf-8)&#xA;(set-terminal-coding-system 'utf-8)&#xA;(set-keyboard-coding-system 'utf-8)&#xA;(set-language-environment 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once evaluated, Emacs will treat new files, buffers, processes, and so on as though they are UTF-8. Keep in mind Emacs will still use a different coding system if the file has a file-local variable like this &lt;code&gt;-*- coding: euc-tw -*-&lt;/code&gt; near the top of the file. (Check &lt;code&gt;48.2.4 Local Variables&lt;/code&gt; in Files in the Emacs manual.)&lt;/p&gt;&#xA;" OwnerUserId="7125" LastEditorUserId="675" LastEditDate="2015-04-22T22:18:16.980" LastActivityDate="2015-04-22T22:18:16.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10871" PostTypeId="1" AcceptedAnswerId="10872" CreationDate="2015-04-22T20:38:48.077" Score="7" ViewCount="4759" Body="&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; offers a few built-in options to add birthdays/holidays to the agenda view in &lt;code&gt;org-mode&lt;/code&gt;; however, there is no built-in support to add those dates entirely programmatically -- without manually adding diary entries or entries in the standard org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Weekly_002fdaily-agenda.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Weekly_002fdaily-agenda.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to add birthdays/holidays to the agenda view programmatically, similar to what &lt;code&gt;calendar-mode&lt;/code&gt; offers?  In &lt;code&gt;calendar-mode&lt;/code&gt;, a user may define holidays and birthdays with a variable combined with functions such as &lt;code&gt;holiday-fixed&lt;/code&gt; and &lt;code&gt;holiday-float&lt;/code&gt;.  The same type of set-up for &lt;code&gt;org-mode&lt;/code&gt; seems useful.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-04-27T19:05:50.617" LastActivityDate="2015-04-27T21:34:36.967" Title="Programmatically add birthdays/holidays to agenda view in org-mode" Tags="|org-mode|org-agenda|calendar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10872" PostTypeId="2" ParentId="10871" CreationDate="2015-04-22T20:42:30.273" Score="8" Body="&lt;p&gt;The following is a modification to &lt;code&gt;org-agenda-list&lt;/code&gt;, with additional new variables and a new function to add holidays/ birthdays.  When &lt;code&gt;org-agenda--show-holidays-birthdays&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt;, birthdays and holidays will appear programmatically in the agenda view.  The variables &lt;code&gt;org-agenda--birthday-list&lt;/code&gt; and &lt;code&gt;org-agenda--holiday-list&lt;/code&gt; can be customized by the user.  An entry has been added to the &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; to try out this new feature -- the capital letter &quot;Y&quot; launches the year view containing holidays/birthdays.  Some limited functionality has been added to support a few basic text properties, and others may be added at a later date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For examples of how to format the holidays and birthdays that are used within the above-mentioned variables, please refer to the doc-string for the variable &lt;code&gt;calendar-holidays&lt;/code&gt; within the library &lt;code&gt;holidays.el&lt;/code&gt; -- e.g., &lt;code&gt;holiday-fixed&lt;/code&gt;; &lt;code&gt;holiday-float&lt;/code&gt;; &lt;code&gt;holiday-sexp&lt;/code&gt;; &lt;code&gt;(lunar-phases)&lt;/code&gt;; &lt;code&gt;(solar-equinoxes-solstices)&lt;/code&gt;; &lt;code&gt;holiday-hebrew&lt;/code&gt;; &lt;code&gt;holiday-islamic&lt;/code&gt;; &lt;code&gt;holiday-bahai&lt;/code&gt;; &lt;code&gt;holiday-julian&lt;/code&gt;; &lt;code&gt;holiday-chinese&lt;/code&gt;; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can you try out this example?&lt;/strong&gt;:  Block/copy/paste the code into your &lt;code&gt;*Scratch*&lt;/code&gt; buffer; and type &lt;code&gt;M-x eval-buffer RET&lt;/code&gt;; and then type &lt;code&gt;M-x org-agenda RET&lt;/code&gt; and then select the CAPITAL letter &lt;code&gt;Y&lt;/code&gt;. It is a fully functional working draft, but needs a little customization to make it prettier and add ability to sort alphabetically, etc. If you decide that you don't like it after you try it, just restart Emacs and you'll be back to where you were before you tried it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The source-code that was modified and the testing that was performed was done with the most recent public release of Emacs:  &lt;em&gt;Org-mode version 8.2.10 (release_8.2.10 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)&lt;/em&gt;; and, &#xA;&lt;em&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36) of 2014-10-20 on builder10-6.porkrind.org&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;THE CODE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-agenda)&#xA;(require 'holidays)&#xA;&#xA;(add-to-list 'org-agenda-custom-commands '(&#xA;  &quot;Y&quot; &quot;365 Days -- holidays/birthdays&quot; agenda &quot;Year View&quot; (&#xA;  (org-agenda-span 365)&#xA;  (org-agenda-time-grid nil)&#xA;  (org-agenda--show-holidays-birthdays t) )))&#xA;&#xA;(defcustom org-agenda--show-holidays-birthdays nil&#xA;  &quot;When non-`nil`, show holidays/birthdays in the agenda view.&quot;&#xA;  :group 'holidays)&#xA;&#xA;(defcustom org-agenda--birthday-list (mapcar 'purecopy '(&#xA;  (holiday-fixed 1 2 &quot;Jane Doe -- 01/02/1940&quot;)&#xA;  (holiday-fixed 2 15 &quot;John Doe -- 02/15/1963&quot;)&#xA;  (holiday-fixed 3 2 &quot;Seymoure Hersh -- 03/03/1999&quot;)&#xA;  (holiday-fixed 3 3 &quot;Jashua Smith -- 03/03/1964&quot;)&#xA;  (holiday-fixed 3 5 &quot;Frederick Holmes -- 03/05/1966&quot;)&#xA;  (holiday-fixed 4 7 &quot;Fannie Mae -- 04/07/1970&quot;)&#xA;  (holiday-fixed 4 25 &quot;Freddie Mack -- 04/25/1952&quot;)&#xA;  (holiday-float 5 0 2 &quot;Mother's Day -- the second Sunday in May&quot;)&#xA;  (holiday-fixed 5 11 &quot;George Lucas -- 05/11/1976&quot;)&#xA;  (holiday-fixed 5 18 &quot;Harry Potter -- 05/18&quot;)&#xA;  (holiday-fixed 5 30 &quot;Darth Vader -- 05/30/1972&quot;)&#xA;  (holiday-fixed 6 7 &quot;Jabba the Hut -- 06/07/2007&quot;)&#xA;  (holiday-fixed 6 19 &quot;Princess Lea -- 06/19/1983&quot;)&#xA;  (holiday-fixed 7 14 &quot;Super Man -- 07/14/1970&quot;)&#xA;  (holiday-fixed 7 18 &quot;Wonder Woman -- 07/18/1993&quot;)&#xA;  (holiday-fixed 10 3 &quot;Jenifer Lopez (DOB:  10/03/2011)&quot;)&#xA;  (holiday-fixed 10 8 &quot;Samuel Jacks (10/08/1965)&quot;)&#xA;  (holiday-fixed 10 25 &quot;C3PO -- 10/25/2007&quot;)&#xA;  (holiday-fixed 11 14 &quot;R2D2 -- 11/14/1981&quot;)&#xA;  (holiday-fixed 12 21 &quot;Yoda -- 12/21/1958&quot;)&#xA;  (holiday-fixed 12 22 &quot;Wookie -- 12/22/1967&quot;) ))&#xA;  &quot;Birthdays.&quot;&#xA;  :type 'sexp&#xA;  :group 'holidays)&#xA;&#xA;(defcustom org-agenda--holiday-list (mapcar 'purecopy '(&#xA;  (holiday-fixed 1 1 &quot;New Year's Day&quot;)&#xA;  (holiday-float 1 1 3 &quot;Martin Luther King Day&quot;)&#xA;  (holiday-float 2 1 3 &quot;President's Day&quot;)&#xA;  (holiday-float 5 1 -1 &quot;Memorial Day&quot;)&#xA;  (holiday-fixed 7 4 &quot;Independence Day&quot;)&#xA;  (holiday-float 9 1 1 &quot;Labor Day&quot;)&#xA;  (holiday-float 10 1 2 &quot;Columbus Day&quot;)&#xA;  (holiday-fixed 11 11 &quot;Veteran's Day&quot;)&#xA;  (holiday-float 11 4 4 &quot;Thanksgiving&quot;)&#xA;  (holiday-fixed 12 25 &quot;Christmas&quot;)&#xA;  (solar-equinoxes-solstices)&#xA;  (holiday-sexp calendar-daylight-savings-starts&#xA;    (format &quot;Daylight Saving Time Begins %s&quot;&#xA;      (solar-time-string&#xA;        (/ calendar-daylight-savings-starts-time (float 60))&#xA;        calendar-standard-time-zone-name)))&#xA;  (holiday-sexp calendar-daylight-savings-ends&#xA;      (format &quot;Daylight Saving Time Ends %s&quot;&#xA;       (solar-time-string&#xA;         (/ calendar-daylight-savings-ends-time (float 60))&#xA;         calendar-daylight-time-zone-name))) ))&#xA;  &quot;Custom holidays defined by the user.&quot;&#xA;  :type 'sexp&#xA;  :group 'holidays)&#xA;&#xA;(defface org-agenda--holiday-face&#xA;  '((t (:foreground &quot;red&quot;)))&#xA;  &quot;Face for `org-agenda--holiday-face`.&quot;&#xA;  :group 'org-agenda)&#xA;&#xA;(defface org-agenda--birthday-face&#xA;  '((t (:foreground &quot;magenta&quot;)))&#xA;  &quot;Face for `org-agenda--birthday-face`.&quot;&#xA;  :group 'org-agenda)&#xA;&#xA;(defun org-agenda-list (&amp;amp;optional arg start-day span with-hour)&#xA;  &quot;Produce a daily/weekly view from all files in variable `org-agenda-files'.&#xA;The view will be for the current day or week, but from the overview buffer&#xA;you will be able to go to other days/weeks.&#xA;&#xA;With a numeric prefix argument in an interactive call, the agenda will&#xA;span ARG days.  Lisp programs should instead specify SPAN to change&#xA;the number of days.  SPAN defaults to `org-agenda-span'.&#xA;&#xA;START-DAY defaults to TODAY, or to the most recent match for the weekday&#xA;given in `org-agenda-start-on-weekday'.&#xA;&#xA;When WITH-HOUR is non-nil, only include scheduled and deadline&#xA;items if they have an hour specification like [h]h:mm.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if org-agenda-overriding-arguments&#xA;      (setq arg (car org-agenda-overriding-arguments)&#xA;      start-day (nth 1 org-agenda-overriding-arguments)&#xA;      span (nth 2 org-agenda-overriding-arguments)))&#xA;  (if (and (integerp arg) (&amp;gt; arg 0))&#xA;      (setq span arg arg nil))&#xA;  (catch 'exit&#xA;    (setq org-agenda-buffer-name&#xA;    (or org-agenda-buffer-tmp-name&#xA;        (if org-agenda-sticky&#xA;      (cond ((and org-keys (stringp org-match))&#xA;       (format &quot;*Org Agenda(%s:%s)*&quot; org-keys org-match))&#xA;      (org-keys&#xA;       (format &quot;*Org Agenda(%s)*&quot; org-keys))&#xA;      (t &quot;*Org Agenda(a)*&quot;)))&#xA;        org-agenda-buffer-name))&#xA;    (org-agenda-prepare &quot;Day/Week&quot;)&#xA;    (setq start-day (or start-day org-agenda-start-day))&#xA;    (if (stringp start-day)&#xA;  ;; Convert to an absolute day number&#xA;  (setq start-day (time-to-days (org-read-date nil t start-day))))&#xA;    (org-compile-prefix-format 'agenda)&#xA;    (org-set-sorting-strategy 'agenda)&#xA;    (let* ((span (org-agenda-ndays-to-span&#xA;      (or span org-agenda-ndays org-agenda-span)))&#xA;     (today (org-today))&#xA;     (sd (or start-day today))&#xA;     (ndays (org-agenda-span-to-ndays span sd))&#xA;     (org-agenda-start-on-weekday&#xA;      (if (or (eq ndays 7) (eq ndays 14))&#xA;    org-agenda-start-on-weekday))&#xA;     (thefiles (org-agenda-files nil 'ifmode))&#xA;     (files thefiles)&#xA;     (start (if (or (null org-agenda-start-on-weekday)&#xA;        (&amp;lt; ndays 7))&#xA;          sd&#xA;        (let* ((nt (calendar-day-of-week&#xA;        (calendar-gregorian-from-absolute sd)))&#xA;         (n1 org-agenda-start-on-weekday)&#xA;         (d (- nt n1)))&#xA;          (- sd (+ (if (&amp;lt; d 0) 7 0) d)))))&#xA;     (day-numbers (list start))&#xA;     (day-cnt 0)&#xA;     (inhibit-redisplay (not debug-on-error))&#xA;     (org-agenda-show-log-scoped org-agenda-show-log)&#xA;     s e rtn rtnall file date d start-pos end-pos todayp&#xA;     clocktable-start clocktable-end filter)&#xA;      (setq org-agenda-redo-command&#xA;      (list 'org-agenda-list (list 'quote arg) start-day (list 'quote span) with-hour))&#xA;      (dotimes (n (1- ndays))&#xA;  (push (1+ (car day-numbers)) day-numbers))&#xA;      (setq day-numbers (nreverse day-numbers))&#xA;      (setq clocktable-start (car day-numbers)&#xA;      clocktable-end (1+ (or (org-last day-numbers) 0)))&#xA;      (org-set-local 'org-starting-day (car day-numbers))&#xA;      (org-set-local 'org-arg-loc arg)&#xA;      (org-set-local 'org-agenda-current-span (org-agenda-ndays-to-span span))&#xA;      (unless org-agenda-compact-blocks&#xA;  (let* ((d1 (car day-numbers))&#xA;         (d2 (org-last day-numbers))&#xA;         (w1 (org-days-to-iso-week d1))&#xA;         (w2 (org-days-to-iso-week d2)))&#xA;    (setq s (point))&#xA;    (if org-agenda-overriding-header&#xA;        (insert (org-add-props (copy-sequence org-agenda-overriding-header)&#xA;        nil 'face 'org-agenda-structure) &quot;\n&quot;)&#xA;      (insert (org-agenda-span-name span)&#xA;        &quot;-agenda&quot;&#xA;        (if (&amp;lt; (- d2 d1) 350)&#xA;      (if (= w1 w2)&#xA;          (format &quot; (W%02d)&quot; w1)&#xA;        (format &quot; (W%02d-W%02d)&quot; w1 w2))&#xA;          &quot;&quot;)&#xA;        &quot;:\n&quot;)))&#xA;  (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure&#xA;              'org-date-line t))&#xA;  (org-agenda-mark-header-line s))&#xA;      (while (setq d (pop day-numbers))&#xA;  (setq date (calendar-gregorian-from-absolute d)&#xA;        s (point))&#xA;  (if (or (setq todayp (= d today))&#xA;    (and (not start-pos) (= d sd)))&#xA;      (setq start-pos (point))&#xA;    (if (and start-pos (not end-pos))&#xA;        (setq end-pos (point))))&#xA;  (setq files thefiles&#xA;        rtnall nil)&#xA;  (while (setq file (pop files))&#xA;    (catch 'nextfile&#xA;      (org-check-agenda-file file)&#xA;      (let ((org-agenda-entry-types org-agenda-entry-types))&#xA;        ;; Starred types override non-starred equivalents&#xA;        (when (member :deadline* org-agenda-entry-types)&#xA;    (setq org-agenda-entry-types&#xA;          (delq :deadline org-agenda-entry-types)))&#xA;        (when (member :scheduled* org-agenda-entry-types)&#xA;    (setq org-agenda-entry-types&#xA;          (delq :scheduled org-agenda-entry-types)))&#xA;        ;; Honor with-hour&#xA;        (when with-hour&#xA;    (when (member :deadline org-agenda-entry-types)&#xA;      (setq org-agenda-entry-types&#xA;      (delq :deadline org-agenda-entry-types))&#xA;      (push :deadline* org-agenda-entry-types))&#xA;    (when (member :scheduled org-agenda-entry-types)&#xA;      (setq org-agenda-entry-types&#xA;      (delq :scheduled org-agenda-entry-types))&#xA;      (push :scheduled* org-agenda-entry-types)))&#xA;        (unless org-agenda-include-deadlines&#xA;    (setq org-agenda-entry-types&#xA;          (delq :deadline* (delq :deadline org-agenda-entry-types))))&#xA;        (cond&#xA;         ((memq org-agenda-show-log-scoped '(only clockcheck))&#xA;    (setq rtn (org-agenda-get-day-entries&#xA;         file date :closed)))&#xA;         (org-agenda-show-log-scoped&#xA;    (setq rtn (apply 'org-agenda-get-day-entries&#xA;         file date&#xA;         (append '(:closed) org-agenda-entry-types))))&#xA;         (t&#xA;    (setq rtn (apply 'org-agenda-get-day-entries&#xA;         file date&#xA;         org-agenda-entry-types)))))&#xA;      (setq rtnall (append rtnall rtn)))) ;; all entries&#xA;  (if org-agenda-include-diary&#xA;      (let ((org-agenda-search-headline-for-time t))&#xA;        (require 'diary-lib)&#xA;        (setq rtn (org-get-entries-from-diary date))&#xA;        (setq rtnall (append rtnall rtn))))&#xA;  ;; BEGIN -- MODIFICATION&#xA;  (when org-agenda--show-holidays-birthdays&#xA;    (setq rtn (org-agenda--get-birthdays-holidays))&#xA;    (setq rtnall (append rtnall rtn)))&#xA;  ;; END -- MODIFICATION&#xA;  (if (or rtnall org-agenda-show-all-dates)&#xA;      (progn&#xA;        (setq day-cnt (1+ day-cnt))&#xA;        (insert&#xA;         (if (stringp org-agenda-format-date)&#xA;       (format-time-string org-agenda-format-date&#xA;               (org-time-from-absolute date))&#xA;     (funcall org-agenda-format-date date))&#xA;         &quot;\n&quot;)&#xA;        (put-text-property s (1- (point)) 'face&#xA;         (org-agenda-get-day-face date))&#xA;        (put-text-property s (1- (point)) 'org-date-line t)&#xA;        (put-text-property s (1- (point)) 'org-agenda-date-header t)&#xA;        (put-text-property s (1- (point)) 'org-day-cnt day-cnt)&#xA;        (when todayp&#xA;    (put-text-property s (1- (point)) 'org-today t))&#xA;        (setq rtnall&#xA;        (org-agenda-add-time-grid-maybe rtnall ndays todayp))&#xA;        (if rtnall (insert ;; all entries&#xA;        (org-agenda-finalize-entries rtnall 'agenda)&#xA;        &quot;\n&quot;))&#xA;        (put-text-property s (1- (point)) 'day d)&#xA;        (put-text-property s (1- (point)) 'org-day-cnt day-cnt))))&#xA;      (when (and org-agenda-clockreport-mode clocktable-start)&#xA;  (let ((org-agenda-files (org-agenda-files nil 'ifmode))&#xA;        ;; the above line is to ensure the restricted range!&#xA;        (p (copy-sequence org-agenda-clockreport-parameter-plist))&#xA;        tbl)&#xA;    (setq p (org-plist-delete p :block))&#xA;    (setq p (plist-put p :tstart clocktable-start))&#xA;    (setq p (plist-put p :tend clocktable-end))&#xA;    (setq p (plist-put p :scope 'agenda))&#xA;    (setq tbl (apply 'org-clock-get-clocktable p))&#xA;    (insert tbl)))&#xA;      (goto-char (point-min))&#xA;      (or org-agenda-multi (org-agenda-fit-window-to-buffer))&#xA;      (unless (and (pos-visible-in-window-p (point-min))&#xA;       (pos-visible-in-window-p (point-max)))&#xA;  (goto-char (1- (point-max)))&#xA;  (recenter -1)&#xA;  (if (not (pos-visible-in-window-p (or start-pos 1)))&#xA;      (progn&#xA;        (goto-char (or start-pos 1))&#xA;        (recenter 1))))&#xA;      (goto-char (or start-pos 1))&#xA;      (add-text-properties (point-min) (point-max)&#xA;         `(org-agenda-type agenda&#xA;               org-last-args (,arg ,start-day ,span)&#xA;               org-redo-cmd ,org-agenda-redo-command&#xA;               org-series-cmd ,org-cmd))&#xA;      (if (eq org-agenda-show-log-scoped 'clockcheck)&#xA;    (org-agenda-show-clocking-issues))&#xA;      (org-agenda-finalize)&#xA;      (setq buffer-read-only t)&#xA;      (message &quot;&quot;))))&#xA;&#xA;(defun org-agenda--get-birthdays-holidays ()&#xA;  &quot;Add holidays/birthdays to the agenda view.&quot;&#xA;  (let* (&#xA;      (props (list&#xA;        'mouse-face 'highlight&#xA;        'org-not-done-regexp org-not-done-regexp&#xA;        'org-todo-regexp org-todo-regexp&#xA;        'org-complex-heading-regexp org-complex-heading-regexp&#xA;        'help-echo &quot;Birthdays and Holidays&quot;))&#xA;      (d1 (calendar-absolute-from-gregorian date))&#xA;      ee&#xA;      res-holidays&#xA;      res-birthdays&#xA;      (displayed-month (nth 0 date))&#xA;      (displayed-year (nth 2 date))&#xA;      (holiday-list&#xA;        (dolist (p org-agenda--holiday-list res-holidays)&#xA;          (let* (h)&#xA;           (when (setq h (eval p))&#xA;             (setq res-holidays (append h res-holidays))))))&#xA;      (birthday-list&#xA;        (dolist (p org-agenda--birthday-list res-birthdays)&#xA;          (let* (h)&#xA;           (when (setq h (eval p))&#xA;             (setq res-birthdays (append h res-birthdays)))))) )&#xA;    (when org-agenda--show-holidays-birthdays&#xA;      (mapcar&#xA;        (lambda (x)&#xA;          (let ((txt (format &quot;%s -- holiday -- %s&quot; (car x) (car (cdr x)))))&#xA;            (when (eq d1 (calendar-absolute-from-gregorian (car x)))&#xA;              (org-add-props txt props&#xA;                'ts-date d1&#xA;                ;; (char-to-string 65) = A; 66 = B; 67 = C; 68 = D; 69 = E&#xA;                'priority 65&#xA;                'type &quot;holiday&quot;&#xA;                'date d1&#xA;                'face 'org-agenda--holiday-face&#xA;                 ;; RESERVED FOR POTENTIAL FUTURE USE.&#xA;                'org-hd-marker nil&#xA;                'org-marker nil&#xA;                'warntime nil&#xA;                'level nil&#xA;                'org-category nil&#xA;                'org-category-position nil&#xA;                'todo-state nil&#xA;                'undone-face nil&#xA;                'done-face nil)&#xA;              (push txt ee))))&#xA;        holiday-list)&#xA;      (mapcar&#xA;        (lambda (x)&#xA;          (let ((txt (format &quot;%s -- birthday -- %s&quot; (car x) (car (cdr x)))))&#xA;            (when (eq d1 (calendar-absolute-from-gregorian (car x)))&#xA;              (org-add-props txt props&#xA;                'ts-date d1&#xA;                ;; (char-to-string 65) = A; 66 = B; 67 = C; 68 = D; 69 = E&#xA;                'priority 65&#xA;                'type &quot;birthday&quot;&#xA;                'date d1&#xA;                'face 'org-agenda--birthday-face&#xA;                 ;; RESERVED FOR POTENTIAL FUTURE USE.&#xA;                'org-hd-marker nil&#xA;                'org-marker nil&#xA;                'warntime nil&#xA;                'level nil&#xA;                'org-category nil&#xA;                'org-category-position nil&#xA;                'todo-state nil&#xA;                'undone-face nil&#xA;                'done-face nil)&#xA;              (push txt ee))))&#xA;        birthday-list))&#xA;    (nreverse ee)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/birthdays_holidays_a.png&quot; alt=&quot;Example&quot;&gt;&#xA;&lt;img src=&quot;https://www.lawlist.com/images/birthdays_holidays_b.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.550" LastActivityDate="2015-04-27T21:34:36.967" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10873" PostTypeId="2" ParentId="10858" CreationDate="2015-04-22T21:30:31.993" Score="1" Body="&lt;p&gt;If you don't want braces at all use &lt;code&gt;0&lt;/code&gt; as argument specification:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(TeX-add-symbols '(&quot;tilde&quot; 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#index-TeX_002dadd_002dsymbols&quot; rel=&quot;nofollow&quot;&gt;documentation of &lt;code&gt;TeX-add-symbols&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;number&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Insert that many braces, leave point inside the first. &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;-1&lt;/code&gt; are special. &lt;code&gt;0&lt;/code&gt; means that no braces are inserted. &lt;code&gt;-1&lt;/code&gt; means that braces are inserted around the macro and an active region (e.g &lt;code&gt;{\tiny foo}&lt;/code&gt;). If there is no active region, no braces are inserted.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="620" LastEditorUserId="2710" LastEditDate="2015-04-23T13:57:08.670" LastActivityDate="2015-04-23T13:57:08.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10874" PostTypeId="2" ParentId="10846" CreationDate="2015-04-22T21:32:25.163" Score="7" Body="&lt;p&gt;Taking the suggestion from PythonNut and rekado, I have switched to truncating when idle, so my current solution looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/truncate-eshell-buffers ()&#xA;  &quot;Truncates all eshell buffers&quot;&#xA;  (interactive)&#xA;  (save-current-buffer&#xA;    (dolist (buffer (buffer-list t))&#xA;      (set-buffer buffer)&#xA;      (when (eq major-mode 'eshell-mode)&#xA;        (eshell-truncate-buffer)))))&#xA;&#xA;;; After being idle for 5 seconds, truncate all the eshell-buffers if&#xA;;; needed. If this needs to be canceled, you can run `(cancel-timer&#xA;;; my/eshell-truncate-timer)'&#xA;(setq my/eshell-truncate-timer&#xA;      (run-with-idle-timer 5 t #'my/truncate-eshell-buffers))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After this, I no longer need to add &lt;code&gt;'eshell-truncate-buffer&lt;/code&gt; to &lt;code&gt;'eshell-output-filter-functions&lt;/code&gt;. It is working great!&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2015-04-22T21:32:25.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10875" PostTypeId="1" CreationDate="2015-04-22T21:57:39.063" Score="2" ViewCount="789" Body="&lt;p&gt;I am running Ubuntu 14.04. I don't use emacs from its repository. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed  my emacs by compling from source, the default location is &lt;code&gt;/usr/local&lt;/code&gt;. e.g. &lt;code&gt;/usr/local/bin/emacs&lt;/code&gt;and &lt;code&gt;/usr/local/share/emacs/24.4/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed &lt;a href=&quot;http://ess.r-project.org/downloads/ess/ess-15.03.tgz&quot; rel=&quot;nofollow&quot;&gt;ESS from its offical site&lt;/a&gt;. The default install location is &lt;code&gt;/usr&lt;/code&gt; e.g. &lt;code&gt;/usr/share/emacs/&lt;/code&gt;. I don't find a way to specify &lt;code&gt;--prefix&lt;/code&gt; for ESS. I run &lt;code&gt;make install&lt;/code&gt; directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in my emacs, I can't find S mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What shall I do? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shall I reinstall emacs with &lt;code&gt;./configure --prefix=/usr&lt;/code&gt;? Generally speaking, should installation from source be in &lt;code&gt;/usr&lt;/code&gt; or &lt;code&gt;/usr/local&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2015-04-22T22:18:11.520" LastActivityDate="2016-02-26T17:24:50.423" Title="default location to install ess not works with the self installed emacs" Tags="|ess|install|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10876" PostTypeId="2" ParentId="10875" CreationDate="2015-04-22T22:53:37.710" Score="2" Body="&lt;p&gt;One easy option is to change the default &lt;code&gt;DESTDIR&lt;/code&gt; directly in the &lt;a href=&quot;https://github.com/emacs-ess/ESS/blob/master/Makeconf#L19&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Makeconf&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5497" LastActivityDate="2015-04-22T22:53:37.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10877" PostTypeId="1" AcceptedAnswerId="10878" CreationDate="2015-04-22T23:05:31.280" Score="7" ViewCount="419" Body="&lt;p&gt;In my environment, the &lt;code&gt;find-file&lt;/code&gt; is remapped to &lt;code&gt;ido-find-file&lt;/code&gt;. How could I cancel the remap and just get the non-Ido version?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-04-23T12:51:42.513" Title="How to cancel or reverse the remapped keybinding?" Tags="|key-bindings|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10878" PostTypeId="2" ParentId="10877" CreationDate="2015-04-22T23:26:23.587" Score="7" Body="&lt;pre&gt;&lt;code&gt;(define-key KEYMAP [remap find-file] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;KEYMAP&lt;/code&gt; is the keymap where the remapping was done.  For example, it might be the variable &lt;code&gt;global-map&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The keymap is apparently not accessible directly by a variable, but it is the cdr of the cons that is pointed to by variable &lt;code&gt;ido-minor-mode-map-entry&lt;/code&gt;.  So this should pretty much do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key (cdr ido-minor-mode-map-entry) [remap find-file] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(That assumes that &lt;code&gt;ido-mode&lt;/code&gt; has been called at least once.  If not, call it. ;-))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, you bind the remapping of &lt;code&gt;find-file&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, which means that you give it no binding (you unbind it).  Binding to &lt;code&gt;nil&lt;/code&gt; is how you unbind a key generally.  In this case, the &quot;key&quot; to be unbound is &lt;code&gt;[remap find-file]&lt;/code&gt;, which is a pseudo-key, a remapping.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-04-23T06:07:08.453" LastActivityDate="2015-04-23T06:07:08.453" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10879" PostTypeId="1" AcceptedAnswerId="10882" CreationDate="2015-04-23T01:19:51.690" Score="14" ViewCount="2142" Body="&lt;p&gt;Say we want to kill the region selected by all cursors in multiple-cursors, and yank it all to a new, empty buffer. How do you do that with multiple-cursors? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that a simple copy and paste of the text on the new buffer does &lt;strong&gt;not&lt;/strong&gt; work, since it only yanks the region from the first cursor (as reported &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el/issues/189&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This question is motivated by the answer and problem presented in:&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/10836/keeping-only-the-lines-with-the-cursors-in-multiple-cursors/10841?noredirect=1#comment16825_10841&quot;&gt;Keeping only the lines with the cursors in multiple-cursors&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2019-07-06T19:34:20.373" Title="Copying text selected by multiple cursors to a new buffer" Tags="|multiple-cursors|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10881" PostTypeId="2" ParentId="10842" CreationDate="2015-04-23T03:24:33.620" Score="10" Body="&lt;p&gt;You have two ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;helm-projectile-grep/ack/ag&lt;/code&gt;: You can search for everything starting from project root. Later if you want to save the search results, press &lt;code&gt;F3&lt;/code&gt; or press &lt;code&gt;TAB&lt;/code&gt; to switch to action menu and select the 3rd action. To navigate &lt;code&gt;hgrep&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-&amp;lt;down&amp;gt;&lt;/code&gt;: go to next match and open the match.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-&amp;lt;up&amp;gt;&lt;/code&gt;: go to previous match and open the match.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-&amp;lt;down&amp;gt;&lt;/code&gt;: go to next match without opening the match.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-&amp;lt;up&amp;gt;&lt;/code&gt;: go to next match without opening the match.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-o&lt;/code&gt;: open current match in other window.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RET&lt;/code&gt;: open current match in current window.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;helm-projectile-find-dir&lt;/code&gt; (note the &lt;code&gt;helm&lt;/code&gt; prefix; you must use proper Helm commands from &lt;code&gt;helm-projectile&lt;/code&gt; package in general): narrow to a desired directory and press &lt;code&gt;C-u C-s&lt;/code&gt; to recursively search in that directory. If you don't press &lt;code&gt;C-u&lt;/code&gt;, it just searches in that directory without going deeper.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-04-23T03:24:33.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10882" PostTypeId="2" ParentId="10879" CreationDate="2015-04-23T03:30:52.680" Score="13" Body="&lt;p&gt;Once text has been killed, exit multiple-cursor (&lt;code&gt;enter&lt;/code&gt;) and while in new buffer hit &lt;code&gt;C-x r y&lt;/code&gt; (normally the killed text is in the rectangle kill-ring)&lt;/p&gt;&#xA;" OwnerUserId="499" LastActivityDate="2015-04-23T03:30:52.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10883" PostTypeId="2" ParentId="10752" CreationDate="2015-04-23T08:19:21.937" Score="2" Body="&lt;p&gt;You can view a Github pull request as a regular patch by appending &lt;code&gt;.patch&lt;/code&gt; to the pull request's URL.  For example, a pull request with URL &lt;a href=&quot;https://github.com/bli25wisc/RSEM/pull/6&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bli25wisc/RSEM/pull/6&lt;/a&gt; (modifying four files with three commits) can be viewed as a regular patch by visiting &lt;a href=&quot;https://github.com/bli25wisc/RSEM/pull/6.patch&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bli25wisc/RSEM/pull/6.patch&lt;/a&gt; which is automatically redirected to &lt;a href=&quot;https://patch-diff.githubusercontent.com/raw/bli25wisc/RSEM/pull/6&quot; rel=&quot;nofollow&quot;&gt;https://patch-diff.githubusercontent.com/raw/bli25wisc/RSEM/pull/6&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The patch can be viewed in &lt;code&gt;diff-mode&lt;/code&gt; or you can apply it and compare the differences with &lt;code&gt;ediff-patch-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="11" LastEditDate="2015-04-24T16:50:38.847" LastActivityDate="2015-04-24T16:50:38.847" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10884" PostTypeId="1" AcceptedAnswerId="10889" CreationDate="2015-04-23T08:38:06.373" Score="27" ViewCount="5771" Body="&lt;p&gt;I am using &lt;code&gt;mu4e&lt;/code&gt; for email in Emacs, and it is currently only&#xA;configured for one mail account, and I set key to view different inbox. I wonder how to use mu4e for managing multiple email accounts?&lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorDisplayName="user2005" LastEditDate="2015-04-23T11:55:31.643" LastActivityDate="2020-05-12T15:31:55.050" Title="mu4e - multiple accounts" Tags="|mu4e|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10885" PostTypeId="1" AcceptedAnswerId="10891" CreationDate="2015-04-23T10:28:42.367" Score="1" ViewCount="709" Body="&lt;p&gt;How does 'epa-encrypt' decide which private key to use? If I have two private keys, and I've only shared one of my public keys with the recipient, and I encrypt with &lt;code&gt;epa-encrypt-region&lt;/code&gt; and select the recipient's public key, which one of my private keys will be used to encrypt? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when I execute &lt;code&gt;epa-encrypt-region&lt;/code&gt;, I get the following menu to choose which public key to encrypt with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Select recipients for encryption.&#xA;If no one is selected, symmetric encryption will be performed.  &#xA;- `M-x epa-mark-key' to mark a key on the line&#xA;- `M-x epa-unmark-key' to unmark a key on the line&#xA;[Cancel][OK]&#xA;&#xA;  u 372XXXXX Joe Blow &amp;lt;joe@blow.org&amp;gt;&#xA;  u 1F0XXXXX Joe Blow &amp;lt;joe.blow@gmail.com&amp;gt;&#xA;  - 7F2XXXXX Jane Doe &amp;lt;jane@archlinux.org&amp;gt;&#xA;  - A4DXXXXX John Doe &amp;lt;john@doe.com&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I am &lt;code&gt;Joe Blow&lt;/code&gt; with two private keys, and I want to send a message to Jane Doe, who only has my gmail public key. Thus, I need to encrypt with my gmail private key. How do I know if &lt;code&gt;epa-encrypt&lt;/code&gt; is using the right private key for encryption?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or does 'epa-encrypt' or the key-ring auto-magically know if the recipient has my public key?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-04-23T12:53:55.677" Title="EPA (EasyPG Assistant): How to select which private key to use when encrypting?" Tags="|gnutls|encryption|pgp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10886" PostTypeId="1" AcceptedAnswerId="10888" CreationDate="2015-04-23T10:45:25.420" Score="5" ViewCount="289" Body="&lt;p&gt;&lt;code&gt;git status&lt;/code&gt; tells me names of files that are currently untracked.  How can I get a dired buffer containing those files? e.g. if I run the command &lt;code&gt;git ls-files --others --exclude-standard&lt;/code&gt;, I'd like all of those files in a dired buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like &lt;code&gt;M-x find-dired&lt;/code&gt; would work, except I don't want the output of find, I need the output of the git command above.&lt;/p&gt;&#xA;" OwnerUserId="2717" LastActivityDate="2015-04-24T11:01:27.590" Title="how to produce a dired buffer listing all untracked files?" Tags="|dired|git|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10887" PostTypeId="1" AcceptedAnswerId="10937" CreationDate="2015-04-23T11:16:13.767" Score="5" ViewCount="164" Body="&lt;p&gt;We have this policy that the account gets locked if a user tries to login with the wrong password for three times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if I mistype my password when connecting via tramp, it will try to login several times, locking my account immediately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could not find a way to disable multiple login attempts. Is there a way to tell tramp to try only once?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastActivityDate="2015-04-26T14:23:32.147" Title="Tell Tramp not to try again if login fails" Tags="|tramp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10888" PostTypeId="2" ParentId="10886" CreationDate="2015-04-23T11:25:49.730" Score="5" Body="&lt;p&gt;I think this does what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/dired-untracked (dir)&#xA;  (interactive &quot;DUntracked in directory: &quot;)&#xA;  (cd dir)&#xA;  (switch-to-buffer (get-buffer-create &quot;*untracked*&quot;))&#xA;  (shell-command &quot;git ls-files --others --exclude-standard | xargs ls -l&quot; (current-buffer))&#xA;  (dired-mode dir)&#xA;  (set (make-local-variable 'dired-subdir-alist)&#xA;       (list (cons default-directory (point-min-marker)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It prompts for a directory, changes to the directory, runs the git command, and finally turns this into an actual &lt;code&gt;dired&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using &lt;code&gt;magit&lt;/code&gt;, however, it is much nicer to see all tracked and untracked files in the buffer created by &lt;code&gt;magit-status&lt;/code&gt;.  It doesn't behave like a &lt;code&gt;dired&lt;/code&gt; buffer but you can visit and delete files from there as well.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-04-24T11:01:27.590" LastActivityDate="2015-04-24T11:01:27.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10889" PostTypeId="2" ParentId="10884" CreationDate="2015-04-23T11:52:25.100" Score="17" Body="&lt;p&gt;I'm using mu4e with two accounts.  Each account has its own maildir:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/Mail&#xA;|&#xA;+---- work&#xA;|&#xA;`---- private&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The manual comes with an example function to choose an account:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-mu4e-set-account ()&#xA;  &quot;Set the account for composing a message.&quot;&#xA;  (let* ((account&#xA;          (if mu4e-compose-parent-message&#xA;              (let ((maildir (mu4e-message-field mu4e-compose-parent-message :maildir)))&#xA;                (string-match &quot;/\\(.*?\\)/&quot; maildir)&#xA;                (match-string 1 maildir))&#xA;            (completing-read (format &quot;Compose with account: (%s) &quot;&#xA;                                     (mapconcat #'(lambda (var) (car var))&#xA;                                                my-mu4e-account-alist &quot;/&quot;))&#xA;                             (mapcar #'(lambda (var) (car var)) my-mu4e-account-alist)&#xA;                             nil t nil nil (caar my-mu4e-account-alist))))&#xA;         (account-vars (cdr (assoc account my-mu4e-account-alist))))&#xA;    (if account-vars&#xA;        (mapc #'(lambda (var)&#xA;                  (set (car var) (cadr var)))&#xA;              account-vars)&#xA;      (error &quot;No email account found&quot;))))&#xA;&#xA;;; ask for account when composing mail&#xA;(add-hook 'mu4e-compose-pre-hook 'my-mu4e-set-account)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For that to work you will also need the &lt;code&gt;my-mu4e-account-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-mu4e-account-alist&#xA;  '((&quot;private&quot;&#xA;     (user-mail-address  &quot;private@domain.net&quot;)&#xA;     (user-full-name     &quot;My Name&quot;)&#xA;     (mu4e-sent-folder   &quot;/private/Sent Items&quot;)&#xA;     (mu4e-drafts-folder &quot;/private/Drafts&quot;)&#xA;     (mu4e-trash-folder  &quot;/private/Deleted Items&quot;)&#xA;     (mu4e-refile-folder &quot;/private/Archive&quot;))&#xA;    (&quot;work&quot;&#xA;     (user-mail-address  &quot;work@domain.net&quot;)&#xA;     (mu4e-sent-folder   &quot;/work/Sent Items&quot;)&#xA;     (mu4e-drafts-folder &quot;/work/Drafts&quot;)&#xA;     (mu4e-trash-folder  &quot;/work/Deleted Items&quot;)&#xA;     (mu4e-refile-folder &quot;/work/Archives&quot;))))&#xA;&#xA;(setq mu4e-user-mail-address-list&#xA;      (mapcar (lambda (account) (cadr (assq 'user-mail-address account)))&#xA;              my-mu4e-account-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can simply switch between mail folders with &lt;code&gt;j&lt;/code&gt;, as long as all of your maildirs are subdirectories of &lt;code&gt;mu4e-maildir&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm actually using a more elaborate function for &lt;code&gt;mu4e-trash-folder&lt;/code&gt; and &lt;code&gt;mu4e-refile-folder&lt;/code&gt; to avoid moving emails from one maildir over to another, but the information above should be sufficient to use multiple accounts.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-04-23T11:52:25.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10890" PostTypeId="2" ParentId="10877" CreationDate="2015-04-23T12:51:42.513" Score="-1" Body="&lt;p&gt;Normally, you do that with &lt;code&gt;(ido-mode -1)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-23T12:51:42.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10891" PostTypeId="2" ParentId="10885" CreationDate="2015-04-23T12:53:55.677" Score="2" Body="&lt;p&gt;When encrypting, GPG uses the recipient's public key (so only she can decrypt it, with her private key).  Your own keys are not used (neither private nor public).  You private key is only used either to &lt;em&gt;sign&lt;/em&gt; what you send, or to decrypt what ou receive.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-23T12:53:55.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10892" PostTypeId="1" AcceptedAnswerId="10893" CreationDate="2015-04-23T13:26:47.087" Score="14" ViewCount="2252" Body="&lt;p&gt;Currently when I bring up the local magit log (&quot;l l&quot;) it takes a fair amount of time. It would be nice for the log just to limit itself to the nearest merge base (e.g. vs origin/master) but I haven't been able to work out how to do this.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-07-03T18:59:16.113" Title="Is it possible to limit magit's log view to just commits from the current branch?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10893" PostTypeId="2" ParentId="10892" CreationDate="2015-04-23T13:56:55.810" Score="13" Body="&lt;p&gt;&lt;code&gt;magit-log&lt;/code&gt; accepts an optional &lt;code&gt;range&lt;/code&gt; argument.  You can also do &lt;code&gt;l r l&lt;/code&gt; followed by &lt;code&gt;origin/master&lt;/code&gt; and then &lt;code&gt;HEAD&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Magit 2.x you can use &lt;code&gt;l o&lt;/code&gt; to the same effect. In this case you would specify a range using &lt;a href=&quot;http://git-scm.com/book/en/v2/Git-Tools-Revision-Selection#Commit-Ranges&quot; rel=&quot;noreferrer&quot;&gt;standard git range specifiers&lt;/a&gt; (typically the 'double-dot' notation):&lt;br&gt;&#xA;&lt;code&gt;l o&lt;/code&gt; &lt;code&gt;origin/master..HEAD&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="454" LastEditDate="2015-04-29T02:54:04.303" LastActivityDate="2015-04-29T02:54:04.303" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10894" PostTypeId="2" ParentId="10887" CreationDate="2015-04-23T15:21:47.410" Score="0" Body="&lt;p&gt;You can try pressing &lt;code&gt;C-g&lt;/code&gt; right after the first login attempt fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then clean the connection with &lt;code&gt;M-x tramp-cleanup-this-connection&lt;/code&gt; before trying to login again.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2015-04-23T15:21:47.410" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10895" PostTypeId="1" CreationDate="2015-04-23T15:35:07.067" Score="2" ViewCount="846" Body="&lt;p&gt;I have seen that the online LaTeX editor &lt;a href=&quot;https://www.overleaf.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Overleaf&lt;/a&gt; has a nice Rich Text format so instead of this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pUyGY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you see this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RVUgl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see it for yourselves without any login required if you go in the website and press &quot;Create New Paper&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I add this functionality in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case it is relevant I already use AUCTeX.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2015-04-23T15:55:58.443" LastActivityDate="2015-07-28T21:38:01.563" Title="Rich Text Format for LaTeX in Emacs" Tags="|latex|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10896" PostTypeId="1" AcceptedAnswerId="10899" CreationDate="2015-04-23T19:58:16.360" Score="1" ViewCount="213" Body="&lt;p&gt;I'm following the Haskell Emacs Tutorial &lt;a href=&quot;https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and Emacs is annoying me with the way it adds some extra &lt;code&gt;TAB&lt;/code&gt; characters. E.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data ExampleType = ExampleType Int Int&#xA;&#xA;instance Eq ExampleType where&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I position myself in instance and execute &lt;code&gt;C-u M-t&lt;/code&gt;, it generates&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;instance Eq ExampleType where&#xA;  x == y = _body&#xA;           x /= y = _body&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;instance Eq ExampleType where&#xA;  x == y = _body&#xA;  x /= y = _body&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyone knows why the 2nd line is added with an extra &lt;code&gt;TAB&lt;/code&gt;? How do you avoid Emacs doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&#xA;Galder&lt;/p&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="5486" LastEditDate="2015-04-24T15:48:20.777" LastActivityDate="2015-04-24T15:48:20.777" Title="Avoid extra tabs when generating Haskell code with ghc-mod" Tags="|indentation|osx|tabs|haskell-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10897" PostTypeId="1" CreationDate="2015-04-24T04:19:42.030" Score="5" ViewCount="4933" Body="&lt;p&gt;I wrote &lt;a href=&quot;https://notabug.org/koz.ross/flycheck-ldc/src/master/flycheck-ldc.el&quot; rel=&quot;nofollow&quot;&gt;a Flycheck frontend&lt;/a&gt; for &lt;a href=&quot;http://wiki.dlang.org/LDC&quot; rel=&quot;nofollow&quot;&gt;LDC&lt;/a&gt;. It installs into Emacs fine, and I remember to &lt;code&gt;require&lt;/code&gt; it, but for some reason, it doesn't automatically enable itself when I open a file in &lt;code&gt;d-mode&lt;/code&gt;. What did I miss?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; As per request, here are the relevant parts of my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;D&#xA;(autoload 'd-mode &quot;d-mode&quot; &quot;Major mode for editing D code.&quot; t)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.d[i]?\\'&quot; . d-mode))&#xA;&#xA;;;Flycheck&#xA;(require 'flycheck-ldc)&#xA;(add-hook 'after-init-hook #'global-flycheck-mode)&#xA;(setq-default flycheck-disabled-checkers '(c/c++-clang))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; As per request, here is the result of &lt;code&gt;C-c ! v&lt;/code&gt; in a &lt;code&gt;d-mode&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Syntax checkers for buffer logic.d in d-mode:&#xA;&#xA;  d-dmd&#xA;    - predicate:  nil&#xA;    - executable: Not found&#xA;&#xA;Flycheck Mode is enabled.&#xA;&#xA;The following syntax checkers are not registered:&#xA;&#xA;  - d-ldc&#xA;&#xA; Try adding these syntax checkers to `flycheck-checkers'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="561" LastEditorDisplayName="user227" LastEditDate="2016-01-03T21:43:14.933" LastActivityDate="2016-01-03T21:43:14.933" Title="Why does my Flycheck syntax checker not activate automatically?" Tags="|flycheck|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10898" PostTypeId="1" AcceptedAnswerId="10902" CreationDate="2015-04-24T12:35:48.767" Score="7" ViewCount="150" Body="&lt;p&gt;If I have a long document that I run &lt;code&gt;query-replace&lt;/code&gt; (or any other number of commands) in, as I'm saying &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;n&lt;/code&gt; to replace that match or not, the current potential item to be replaced is always at the bottom of the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to see more of what's below this match, to see the context a little more easily --- effectively, hitting &lt;code&gt;C-l&lt;/code&gt; after each match update.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could probably find some specific hooks that run at the point a new match is found to do this for me, but is there a more generic way of doing things, not involving writing a hook for each function that has this behaviour? (It seems pretty general.)&lt;/p&gt;&#xA;" OwnerUserId="7132" LastActivityDate="2015-12-24T01:41:36.653" Title="`query-replace` leaves potential match to be replaced at bottom of window" Tags="|window|hooks|search|replace|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10899" PostTypeId="2" ParentId="10896" CreationDate="2015-04-24T15:48:08.487" Score="1" Body="&lt;p&gt;I found the answer in this Stackoverflow &lt;a href=&quot;https://stackoverflow.com/questions/27736107/emacs-started-adding-extra-tabs-in-when-i-paste-into-it-on-os-x/27736214#27736214&quot;&gt;post&lt;/a&gt;. Adding the following to your init file avoids the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Avoid extra TAB indents when pasting or auto-generating code&#xA;(electric-indent-mode 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2015-04-24T15:48:08.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10900" PostTypeId="1" AcceptedAnswerId="10963" CreationDate="2015-04-24T16:35:40.507" Score="33" ViewCount="22438" Body="&lt;p&gt;When I run Emacs in a text terminal instead of the normal GUI mode, I can copy in Emacs by activating the start of a region with &lt;code&gt;C-SPC&lt;/code&gt;, and then select what I want, and then do &lt;code&gt;M-w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to get a region copied this way be available in the OSX clipboard to paste it say in a web page (other than by running Emacs in its GUI mode, obviously)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not interested in creating a different shortcut to do that, and ideally it should not require installing any modules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen &lt;a href=&quot;https://apple.stackexchange.com/questions/85222/configure-emacs-to-cut-and-copy-text-to-mac-os-x-clipboard&quot;&gt;this post&lt;/a&gt; and tried the accepted answer but it does not work seem to work the way I expect above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other ideas?&lt;/p&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="1979" LastEditDate="2018-01-18T14:41:18.833" LastActivityDate="2018-01-18T14:47:36.680" Title="Copy text from Emacs to OS X clipboard" Tags="|osx|copy-paste|" AnswerCount="7" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10902" PostTypeId="2" ParentId="10898" CreationDate="2015-04-24T17:52:27.037" Score="5" Body="&lt;p&gt;Set the variable &lt;code&gt;scroll-margin&lt;/code&gt; to some value such as &lt;code&gt;5&lt;/code&gt; or &lt;code&gt;10&lt;/code&gt;, then the point where the current replace candidate is will always be at least this number of lines from the bottom of the screen.  By default the value is &lt;code&gt;0&lt;/code&gt;, which allows the point to sit on the final line of the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;scroll-margin&lt;/code&gt; &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Number of lines of margin at the top and bottom of&#xA;  a window. Recenter the window whenever point gets within this many&#xA;  lines of the top or bottom of the window.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can set a temporary value of &lt;code&gt;scroll-margin&lt;/code&gt; for most of the interactive replace functions by advising &lt;code&gt;perform-replace&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun afs/scroll-margin-perform-replace (orig-function from-string replacements&#xA;                        query-flag regexp-flag delimited-flag&#xA;                        &amp;amp;optional repeat-count map start end backward)&#xA;  &quot;Set scroll-margin temporarily while running perform-replace&quot;&#xA;  (let ((scroll-margin 5))&#xA;    (apply orig-function from-string replacements&#xA;                        query-flag regexp-flag delimited-flag&#xA;                        repeat-count map start end backward)))&#xA;&#xA;(advice-add 'perform-replace :around #'afs/scroll-margin-perform-replace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="160" LastEditDate="2015-05-22T22:19:22.997" LastActivityDate="2015-05-22T22:19:22.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10903" PostTypeId="2" ParentId="10898" CreationDate="2015-04-24T17:53:14.120" Score="3" Body="&lt;p&gt;I see nothing in the code that would help with this, out of the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say that you should consider filing an enhancement request (&lt;code&gt;M-x report-emacs-bug&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Consider requesting a hook to be run after point is moved to the next search hit and before reading your input char.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another possibility is to request that &lt;code&gt;recenter&lt;/code&gt; be called at that time, with users having the possibility of customizing which member of &lt;code&gt;recenter-positions&lt;/code&gt; to start with (so that &lt;code&gt;C-l&lt;/code&gt; would then move to the next member).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As @AndrewSwann says, you can also customize &lt;code&gt;scroll-margin&lt;/code&gt;, but that seems like overkill.  You could also write your own wrapper command for each query-replace command, in which you bind &lt;code&gt;scroll-margin&lt;/code&gt; to what you want for query-replacing. That would not affect the global value of the option.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-24T17:53:14.120" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10904" PostTypeId="1" CreationDate="2015-04-24T20:42:08.297" Score="3" ViewCount="558" Body="&lt;p&gt;The &lt;code&gt;append-to-buffer&lt;/code&gt; function's definition ends with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(dolist (window windows)&#xA;  (when (= (window-point window) point)&#xA;    (set-window-point window (point))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the purpose of this?  Experimenting, I commented out this code and re-ran, but could detect no difference in functionality?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Thanks for your responses, I'm responding to Drew's response.  Perhaps I did something wrong in my experiment.  However, in my experiment, I split the buffer into two windows, with identical window points, commented out the pertinent code, and executed the (altered) append-to-buffer.  I observed that the &lt;em&gt;other&lt;/em&gt; window's &lt;em&gt;point&lt;/em&gt;  &quot;seemed&quot; to have been adjusted correctly, despite the fact that I had commented out the code.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I specified &lt;em&gt;point&lt;/em&gt; to emphasize that I was observing the 2nd window's point, not window-point, which I have no way of eyeballing.  Can anyone repeat my experiment to see if (in emacs 24.4) I've interpreted the actions correctly.  If so, that would suggest that emacs 24.4 was enhanced so that the code become redundant.  If not, then I did something wrong in my experiment.  This will help me, because I will be writing my own personal code, and I need to know what is necessary....  Thanks&lt;/p&gt;&#xA;" OwnerUserId="7145" LastEditorUserId="160" LastEditDate="2015-05-22T22:20:16.523" LastActivityDate="2015-05-22T22:20:16.523" Title="What is the purpose of this code in `append-to-buffer`?" Tags="|elisp|point|window-point|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10905" PostTypeId="2" ParentId="10904" CreationDate="2015-04-24T20:49:55.667" Score="1" Body="&lt;p&gt;Emacs says the following about this function:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;set-window-point is a built-in function in `C source code'.&lt;/p&gt;&#xA;&lt;p&gt;(set-window-point WINDOW POS)&lt;/p&gt;&#xA;&lt;p&gt;Make point value in WINDOW be at position POS in WINDOW's buffer.&#xA;WINDOW must be a live window and defaults to the selected one.&#xA;Return POS.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;To ask Emacs type &lt;code&gt;C-h f&lt;/code&gt; and then input the function name.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-04-24T20:49:55.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10906" PostTypeId="2" ParentId="10904" CreationDate="2015-04-24T21:31:35.523" Score="5" Body="&lt;p&gt;If your question is what is the use of &lt;code&gt;set-window-point&lt;/code&gt; then the answer is that it sets the window-point value for the given window's buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Window Point&lt;/code&gt;&lt;/a&gt;. It starts by telling you this, which should already answer your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each window has its own value of point (*note Point::), independent of&#xA;  the value of point in other windows displaying the same buffer.  This&#xA;  makes it useful to have multiple windows showing one buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;set-window-point&lt;/code&gt; gives you a way to set the point value for a given window.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Wrt the question of why the code you posted is used in &lt;code&gt;append-to-buffer&lt;/code&gt; -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the full code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun append-to-buffer (buffer start end)&#xA;  &quot;Append to specified buffer the text of the region.&#xA;It is inserted into that buffer before its point.&#xA;&#xA;When calling from a program, give three arguments:&#xA;BUFFER (or buffer name), START and END.&#xA;START and END specify the portion of the current buffer to be copied.&quot;&#xA;  (interactive&#xA;   (list (read-buffer &quot;Append to buffer: &quot; (other-buffer (current-buffer) t))&#xA;     (region-beginning) (region-end)))&#xA;  (let* ((oldbuf (current-buffer))&#xA;         (append-to (get-buffer-create buffer))&#xA;         (windows (get-buffer-window-list append-to t t))&#xA;         point)&#xA;    (save-excursion&#xA;      (with-current-buffer append-to&#xA;        (setq point (point))&#xA;        (barf-if-buffer-read-only)&#xA;        (insert-buffer-substring oldbuf start end)&#xA;        (dolist (window windows)&#xA;          (when (= (window-point window) point)&#xA;            (set-window-point window (point))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The part you quoted comes right after (a) saving the current value of point to a variable named &lt;code&gt;point&lt;/code&gt; and then (b) inserting a string &lt;strong&gt;before point&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That last part is significant: point moves forward by the length of the inserted string. The doc string of &lt;code&gt;insert-buffer-substring&lt;/code&gt; does not say this explicitly - but it &lt;em&gt;should&lt;/em&gt;. (The doc string of function &lt;code&gt;insert&lt;/code&gt; does say this explicitly. I just filed &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20421&quot; rel=&quot;nofollow&quot;&gt;Emacs bug #20421&lt;/a&gt;, to ask that this doc string be improved this way.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that after the string is inserted the saved position (in variable &lt;code&gt;point&lt;/code&gt;) typically is no longer equal to &lt;code&gt;(point)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What the &lt;code&gt;dolist&lt;/code&gt; loop does is to check existing windows for the same buffer, to see if any of them still have their &lt;code&gt;window-point&lt;/code&gt; pointing to the saved position, &lt;code&gt;point&lt;/code&gt;, and if so, updating those window points to the new position of &lt;code&gt;(point)&lt;/code&gt;, that is, to where the cursor is now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, it resyncs all windows showing the same buffer, with respect to their cursor positions (their window points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(More typically, the variable used to save the original value of &lt;code&gt;(point)&lt;/code&gt; would be called &lt;code&gt;opoint&lt;/code&gt; or &lt;code&gt;orig-point&lt;/code&gt; or some such, and not just &lt;code&gt;point&lt;/code&gt;. That would make the code a bit clearer - it is too easy to misread the difference between &lt;code&gt;point&lt;/code&gt; (a variable) and &lt;code&gt;(point)&lt;/code&gt; (the current point value).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:13:48.250" LastActivityDate="2015-05-09T20:13:48.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10908" PostTypeId="1" AcceptedAnswerId="10910" CreationDate="2015-04-24T23:46:09.700" Score="3" ViewCount="924" Body="&lt;p&gt;For a few years Emacs has had SVG support, however I don't know of a reliable way to detect it, before using it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we detect in EmacsLisp, SVG rendering ability in the current Emacs GUI (X/NS/Mac/Win etc.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not sufficient to assume a GUI build has SVG support, as this is not always the case.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2015-04-25T07:36:56.067" Title="Detecting availability of SVG?" Tags="|elisp|gui-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10910" PostTypeId="2" ParentId="10908" CreationDate="2015-04-25T02:07:14.420" Score="8" Body="&lt;p&gt;Maybe some clue in 'image.el'.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;C-h v image-type-available-p&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;image-type-available-p is an autoloaded compiled Lisp function in&#xA;  `image.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(image-type-available-p TYPE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return non-nil if image type TYPE is available. Image types are&#xA;  symbols like `xbm' or `jpeg'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6679" LastEditorUserId="563" LastEditDate="2015-04-25T07:36:56.067" LastActivityDate="2015-04-25T07:36:56.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10911" PostTypeId="1" AcceptedAnswerId="10917" CreationDate="2015-04-25T02:47:22.990" Score="0" ViewCount="107" Body="&lt;p&gt;Sometimes, i wish to mark all code in a file as comments. I tried putting all code between the markups &lt;code&gt;#||&lt;/code&gt; and &lt;code&gt;#||&lt;/code&gt;. On file loading, emacs threw the error,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid read syntax: #&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't use &lt;code&gt;#+nil&lt;/code&gt;, because the file has multiple statements and not a single function. Is there a way to comment?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-04-25T13:01:36.153" Title="Mark all code in a file as comments" Tags="|comment|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10913" PostTypeId="1" CreationDate="2015-04-25T03:24:09.940" Score="1" ViewCount="693" Body="&lt;p&gt;Org-Mode can automatically track TODO state changes as described &lt;a href=&quot;http://orgmode.org/manual/Tracking-TODO-state-changes.html&quot; rel=&quot;nofollow&quot;&gt;in the docs&lt;/a&gt;. It also allows the option &lt;code&gt;todo: nil&lt;/code&gt; option, &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot; rel=&quot;nofollow&quot;&gt;as mentioned here&lt;/a&gt;, so that TODO keywords will not appear in an export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems rather intuitive to me that if I set &lt;code&gt;todo: nil&lt;/code&gt; then I don't want messages like &lt;code&gt;• State “NEXT” from &quot;&quot; [2015-04-23 Thu 18:44]&lt;/code&gt; to appear when I export. But they do appear, at least for me they do, in Org-Mode version 8.2.10. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is another option to do what I want, I'm not seeing it. Does anyone have a good fix for this? &lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-04-25T07:16:23.647" Title="How to exclude TODO state change messages from export?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10915" PostTypeId="2" ParentId="10913" CreationDate="2015-04-25T07:16:23.647" Score="3" Body="&lt;p&gt;Setting the variable &lt;code&gt;org-log-into-drawer&lt;/code&gt; will put new logs inside a drawer, one called &lt;code&gt;:LOGBOOK:&lt;/code&gt; by default. Logs inside drawers are not exported by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does not solve the problem of existing logs which are not already in drawers, but it certainly helps.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-04-25T07:16:23.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10916" PostTypeId="1" AcceptedAnswerId="10918" CreationDate="2015-04-25T10:14:04.523" Score="12" ViewCount="542" Body="&lt;p&gt;If you visit a directory with &lt;code&gt;helm-find-files&lt;/code&gt; and type the name of a file that doesn't exist, before opening it in a new buffer helm will prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File does not exist, create buffer?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like helm to just create the buffer, without the prompt. I can't find an option for it to do this: essentially I want a variable just like &lt;code&gt;ido-create-new-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7132" LastEditorUserId="105" LastEditDate="2017-05-16T22:37:58.020" LastActivityDate="2017-05-16T22:37:58.020" Title="Prevent helm from prompting to create a new buffer" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10917" PostTypeId="2" ParentId="10911" CreationDate="2015-04-25T13:01:36.153" Score="1" Body="&lt;p&gt;Select the whole buffer (&lt;code&gt;C-x h&lt;/code&gt;) and comment it (&lt;code&gt;M-;&lt;/code&gt;). &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-04-25T13:01:36.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10918" PostTypeId="2" ParentId="10916" CreationDate="2015-04-25T13:11:40.723" Score="16" Body="&lt;p&gt;You can set &lt;code&gt;helm-ff-newfile-prompt-p&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; and Helm won't ask you anymore:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-ff-newfile-prompt-p nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-04-25T13:11:40.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10919" PostTypeId="2" ParentId="10900" CreationDate="2015-04-25T13:42:28.900" Score="9" Body="&lt;p&gt;If you use Emacs &quot;the normal way&quot; (i.e. as a GUI application), then it should already do that by default.  If you use Emacs inside a terminal emulator, then indeed it doesn't know how to do that by default, but you can install the &lt;code&gt;xclip&lt;/code&gt; package from GNU ELPA and then enable the &lt;code&gt;xclip-mode&lt;/code&gt; which teaches Emacs how to do that both for GNU/Linux and for OSX.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2018-01-18T14:47:36.680" LastActivityDate="2018-01-18T14:47:36.680" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10920" PostTypeId="2" ParentId="10860" CreationDate="2015-04-25T14:35:23.263" Score="3" Body="&lt;p&gt;Sorry, my documentation - if you can even call it that - is terrible. I imagine this is intimidating even if you're not new to elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt; is a threading macro from the dash library, as wvxvw correctly points out. The easiest way to explore elisp is to use &lt;code&gt;C-h f&lt;/code&gt; to read about functions you aren't familiar with. There should be a link to the source code here too, if you want to dig deeper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your first guess isn't bad. You'll only create a single fold here though. Essentially you're trying to create a list of trees from the buffer text. Each tree is a description of nested folds in the buffer. A node tells origami where the fold starts and ends and which folds are included inside of this - this is what the child nodes are.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And from there, the question will be &quot;can I create more complex matching rules using if/else/etc ?&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is a very general api that will allow you to pretty much do anything and create any fold structure you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully I've answered here your initial questions. I've created an issue to improve the documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/gregsexton/origami.el/issues/12&quot; rel=&quot;nofollow&quot;&gt;https://github.com/gregsexton/origami.el/issues/12&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7151" LastActivityDate="2015-04-25T14:35:23.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10921" PostTypeId="1" AcceptedAnswerId="10976" CreationDate="2015-04-25T14:43:40.497" Score="1" ViewCount="144" Body="&lt;p&gt;I have a test for fsharp-mode to exercise the jump to definition&#xA;functionality. Communicating with the background process involves&#xA;sending a command and then letting the filter function handle the&#xA;response, which may involve switching to a different buffer. This&#xA;works fine &quot;for real&quot;, but no in the test. Strangely, the buffer&#xA;switch seems to have worked in the filter function, but has no effect&#xA;on what the main test function considers to be the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have created a minimal repro, which is included below. It simply&#xA;runs ls, and has a filter function that uses find-file to switch&#xA;buffer. The output from message indicates that the buffer switch has&#xA;succeeded, but the test function which polls the current buffer at 1s&#xA;intervals always outputs the same result for the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The test can be run with emacs -Q --batch -l repro.el -l ert -f&#xA;ert-run-tests-batch-and-exit if the below text is saved to repro.el.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ert)&#xA;&#xA;(defun start-proc ()&#xA;  (let ((proc (let (process-connection-type)&#xA;                (start-process &quot;background&quot; &quot;*background*&quot; &quot;/bin/ls&quot;))))&#xA;    (when (process-live-p proc)&#xA;      (progn&#xA;        (set-process-coding-system proc 'utf-8-auto)&#xA;        (set-process-filter proc 'bg-filter-output)&#xA;        (set-process-query-on-exit-flag proc nil)))))&#xA;&#xA;(defun bg-filter-output (proc str)&#xA;  (message &quot;In filter&quot;)&#xA;  (find-file &quot;2.txt&quot;)&#xA;  (message &quot;Buffer name now: %s&quot; (file-name-nondirectory buffer-file-name)))&#xA;&#xA;(defun wait-for-condition (fun)&#xA;  (with-timeout (3)&#xA;    (while (not (funcall fun))&#xA;      (sleep-for 1))))&#xA;&#xA;(ert-deftest change-file-bg ()&#xA;  &quot;Check it changes file even in filter output&quot;&#xA;  (find-file &quot;1.txt&quot;)&#xA;  (start-proc)&#xA;  (wait-for-condition&#xA;   (lambda () (progn&#xA;           (message &quot;buffer: %s&quot; (file-name-nondirectory buffer-file-name))&#xA;           (not (equal &quot;1.txt&quot; (file-name-nondirectory buffer-file-name))))))&#xA;  (should (equal (file-name-nondirectory buffer-file-name) &quot;2.txt&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What have I done wrong?&lt;/p&gt;&#xA;" OwnerUserId="753" LastActivityDate="2015-04-28T06:20:39.673" Title="Why doesn't changing buffer in filter function have any effect in ERT?" Tags="|process|ert|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10923" PostTypeId="1" AcceptedAnswerId="10925" CreationDate="2015-04-25T18:11:09.567" Score="2" ViewCount="252" Body="&lt;p&gt;When I type &lt;code&gt;C-x C-+&lt;/code&gt; the height of the default face in the current buffer is increased. However, when I revert the buffer, the text scaling is reset to normal. I would like to keep the same scaling after reverting the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to determine the amount of scaling in the current buffer, in order to save it and restore the same scaling when a buffer is reverted?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-04-25T19:49:19.280" Title="How to determine the current text scaling?" Tags="|revert-buffer|scaling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10924" PostTypeId="2" ParentId="9630" CreationDate="2015-04-25T18:58:13.673" Score="1" Body="&lt;p&gt;You can change the highlighting using &lt;code&gt;set-face-foreground&lt;/code&gt; (or more generally &lt;code&gt;set-face-attribute&lt;/code&gt;.  &lt;code&gt;$..$&lt;/code&gt; seems to be highlighted with &lt;code&gt;font-latex-math-face&lt;/code&gt;, so to set the foreground to whatever the default is we can use &lt;code&gt;(set-face-foreground 'font-latex-math-face nil)&lt;/code&gt;.  It's still &quot;highlighted&quot; but it will look identical to the surrounding text.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-04-25T18:58:13.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10925" PostTypeId="2" ParentId="10923" CreationDate="2015-04-25T19:49:19.280" Score="4" Body="&lt;p&gt;Variable &lt;code&gt;text-scale-mode-amount&lt;/code&gt; holds the number of &lt;code&gt;text-scale-mode&lt;/code&gt; steps. (Variable &lt;code&gt;text-scale-mode-step&lt;/code&gt; holds the amount to scale for each step.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Save &lt;code&gt;text-scale-mode-amount&lt;/code&gt;, then later pass it to &lt;code&gt;text-scale-increase&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-25T19:49:19.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10929" PostTypeId="1" AcceptedAnswerId="10930" CreationDate="2015-04-25T21:54:11.017" Score="2" ViewCount="425" Body="&lt;p&gt;&lt;code&gt;(message &quot;abc\ndef&quot;)&lt;/code&gt; displays a two line message, while&#xA;&lt;code&gt;(message-box &quot;%s&quot; &quot;abc\ndef&quot;)&lt;/code&gt; does not.  Can the controlled two line&#xA;display be replicated in message-box?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;code&gt;M-x customize&lt;/code&gt; didn't seem to have a section for customizing &#xA;the message-box appearance (e.g. different background colors for the OK vs&#xA;the message).  Can message-box's appearance be customized?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can either of these issues be remedied by going to a pop-up &#xA;(of some sort, e.g. x-popup-dialog), or some other emacs package?&lt;/p&gt;&#xA;" OwnerUserId="7145" LastEditorUserId="115" LastEditDate="2015-05-26T13:58:53.873" LastActivityDate="2015-06-25T14:57:32.347" Title="message-box new line and customize" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10930" PostTypeId="2" ParentId="10929" CreationDate="2015-04-25T22:17:11.890" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;No, &lt;code&gt;message-box&lt;/code&gt; does not allow that. It simply removes the newline char.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No, there is no customization for &lt;code&gt;message-box&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;x-pop-dialog&lt;/code&gt; won't help either. It too removes newline chars.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And neither will &lt;code&gt;display-message-or-buffer&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Your best bet is probably to display a buffer that shows whatever complex text you like, and then read user input - either a character or a string.  You can use &lt;code&gt;read-char&lt;/code&gt; and the like to read a char, and you can use &lt;code&gt;read-from-minibuffer&lt;/code&gt;, &lt;code&gt;read-string&lt;/code&gt;, &lt;code&gt;completing-read&lt;/code&gt; and the like to read a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also variable (option) &lt;code&gt;use-dialog-box&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-25T22:17:11.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10931" PostTypeId="2" ParentId="9503" CreationDate="2015-04-26T04:05:56.897" Score="2" Body="&lt;p&gt;Not actually &lt;code&gt;dired&lt;/code&gt;-based, but it is closer to the Atom screenshot provided.  As of &lt;a href=&quot;https://github.com/jaypei/emacs-neotree/pull/93&quot; rel=&quot;nofollow noreferrer&quot;&gt;PR#93&lt;/a&gt;, &lt;code&gt;neotree&lt;/code&gt; can display VCS status as part of the listing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vLd3a.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the configuration that would effect the screenshot above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq neo-vc-integration '(char face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The presence of &lt;code&gt;char&lt;/code&gt; controls the &lt;code&gt;?&lt;/code&gt; and &lt;code&gt;E&lt;/code&gt; that you see.&#xA;The presence of &lt;code&gt;face&lt;/code&gt; controls the highlighting.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2019-01-07T03:59:36.967" LastActivityDate="2019-01-07T03:59:36.967" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10932" PostTypeId="1" AcceptedAnswerId="20039" CreationDate="2015-04-26T05:31:46.930" Score="6" ViewCount="2694" Body="&lt;p&gt;I see that I can do something like &lt;a href=&quot;https://emacs.stackexchange.com/a/2108/2685&quot;&gt;this&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun limit-warnings ()&#xA;  (set (make-local-variable 'warning-minimum-level) 'fatal))&#xA;&#xA;(add-hook 'minibuffer-setup-hook 'disable-warnings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Sorry for syntax errors; I'm not very familiar with Lisp and the above is just an example.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I combine that with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Warning-Options.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;warning options&lt;/a&gt; to disable warnings from only the minibuffer? (For example, the minibuffer doesn't need to tell me that I've hit the end of the buffer or that the &lt;code&gt;M-x:&lt;/code&gt; prompt string is read-only.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;describe-variable&lt;/code&gt; with &lt;code&gt;warning-minimum-level&lt;/code&gt; and there was no such variable defined.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-03T19:28:04.647" Title="How do you disable the buffer end/beginning warnings in the minibuffer?" Tags="|minibuffer|buffer-local|warning|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10933" PostTypeId="1" CreationDate="2015-04-26T09:36:23.960" Score="14" ViewCount="1381" Body="&lt;p&gt;Org-mode offers a variety of different link types ([http], [file], [bibtex], [magit]...). However, they all get the same look defined by the face value for org-link. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to e.g. change the background color depending on the type of link? So that http links would have a yellow background and file links a blue one?&lt;/p&gt;&#xA;" OwnerUserId="7156" LastEditorUserId="50" LastEditDate="2015-04-26T19:54:18.960" LastActivityDate="2021-09-29T08:55:40.793" Title="How to change faces of org-mode links depending on the link type?" Tags="|org-mode|faces|hyperlinks|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10934" PostTypeId="1" CreationDate="2015-04-26T11:52:39.317" Score="3" ViewCount="1399" Body="&lt;p&gt;Does emacs support editing odf.odt, that is open document format files? There are some &lt;code&gt;odf2org&lt;/code&gt; convertors available like &lt;a href=&quot;https://bitbucket.org/josemaria.alkala/odt2org/wiki/Home&quot; rel=&quot;nofollow&quot;&gt;python odt2org.py&lt;/a&gt;. On running the command &lt;code&gt;python odt2org.py xyz.odf.odt&lt;/code&gt;, it crashes like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File &quot;/home/sk/src/odt2org/odt2org.py&quot;, line 105, in &amp;lt;module&amp;gt;&#xA;    _list, _extra = _odtfile.gen_list()&#xA;  File &quot;/home/sk/src/odt2org/odtfile.py&quot;, line 266, in gen_list&#xA;    _list = self.process_tables(_list)&#xA;  File &quot;/home/sk/src/odt2org/odtfile.py&quot;, line 441, in process_tables&#xA;    _txt += _m['text'] + ' '&#xA;KeyError: 'text'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so, odf to org mode is the way to go (or) emacs has any plugins for directly loading &lt;code&gt;odt&lt;/code&gt; type documents  &lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-04-26T12:03:43.640" LastActivityDate="2015-04-26T12:03:43.640" Title="Editing odf - libreoffice/word documents in emacs" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10935" PostTypeId="1" CreationDate="2015-04-26T12:36:58.537" Score="5" ViewCount="585" Body="&lt;p&gt;Is there anywhere I can download a pre-compiled executable of the Emacs development version, all built and ready to run on Windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doesn't have to be a daily build. Anything from the last month or so would be fine.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-11-05T03:54:19.327" Title="Emacs dev builds for MS Windows" Tags="|microsoft-windows|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10936" PostTypeId="2" ParentId="10935" CreationDate="2015-04-26T14:09:24.713" Score="4" Body="&lt;p&gt;&lt;strong&gt;emacsbinw64&lt;/strong&gt; and &lt;strong&gt;emacs-bin&lt;/strong&gt; projects on sourceforge.net provide development and stable builds of emacs for Windows (both 32-bit and 64-bit versions).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Emacs Snapshot builds for 64-bit Windows&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Built by Chris Zheng&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://sourceforge.net/projects/emacsbinw64&quot; rel=&quot;nofollow&quot;&gt;Download&lt;/a&gt; | &lt;a href=&quot;http://sourceforge.net/projects/emacsbinw64/rss?path=/snapshot&quot; rel=&quot;nofollow&quot;&gt;RSS&lt;/a&gt;&lt;sup&gt;1&lt;/sup&gt; | &lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Homepage&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From the homepage,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;100% unmodified source code from git master and release version.  &lt;/li&gt;&#xA;  &lt;li&gt;Native 64-Bit binary for MS-Windows.&lt;/li&gt;&#xA;  &lt;li&gt;Compiled with optimization.&lt;/li&gt;&#xA;  &lt;li&gt;With JPEG, GIF, PNG, TIFF, SVG, XML2, and GnuTLS support.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h2&gt;Emacs Snapshot builds for 32-bit Windows&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Built by Dani Moncayo&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://sourceforge.net/projects/emacs-bin&quot; rel=&quot;nofollow&quot;&gt;Download&lt;/a&gt; | &lt;a href=&quot;http://sourceforge.net/projects/emacs-bin/rss?path=/snapshots&quot; rel=&quot;nofollow&quot;&gt;RSS&lt;/a&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each package contains exactly what &quot;make install&quot; produces.&#xA;  Therefore, even though they have support for optional libraries, the&#xA;  binaries of those libraries are not bundled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;As &lt;strong&gt;lawlist&lt;/strong&gt; mentions in the comments, the 32-bit version does not come pre-packaged with PNG and other image support.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; Get notified via your favorite RSS reader when a new build is available.&lt;/p&gt;&#xA;" OwnerUserId="499" LastEditorUserId="115" LastEditDate="2015-11-05T03:54:19.327" LastActivityDate="2015-11-05T03:54:19.327" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10937" PostTypeId="2" ParentId="10887" CreationDate="2015-04-26T14:23:32.147" Score="1" Body="&lt;p&gt;Tramp should automatically recognise a wrong password error and prompt you for a new password.  If it doesn't, it probably indicates that the remote host is using a weird string to report password errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please set the variable &lt;code&gt;tramp-verbose&lt;/code&gt; to &lt;code&gt;6&lt;/code&gt;, then check the &lt;code&gt;*debug tramp/whatever*&lt;/code&gt; buffer to find out what error message the host is checking.  Then customise the variable &lt;code&gt;tramp-wrong-password-reject&lt;/code&gt; to match it.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-04-26T14:23:32.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10938" PostTypeId="1" AcceptedAnswerId="10943" CreationDate="2015-04-26T18:22:19.603" Score="35" ViewCount="5028" Body="&lt;p&gt;I'm a little new to Emacs.&#xA;When looking at some of the configurations, I found there are two types command in &quot;add-hook&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'LaTeX-math-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has confused me for a long time and I don't know how to search &quot;#'&quot; in google...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7160" LastEditorUserId="25" LastEditDate="2015-04-27T12:39:04.283" LastActivityDate="2016-02-07T06:51:57.480" Title="What is the difference between ' and #' in front of a symbol?" Tags="|elisp|hooks|functions|quote|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10939" PostTypeId="1" AcceptedAnswerId="10942" CreationDate="2015-04-26T18:57:40.803" Score="9" ViewCount="2237" Body="&lt;p&gt;How can I sum a set of numbers interspersed with text in the region (not a rectangular region).  For example, if the region contains this text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Widgets 234&#xA;Sprockets 44&#xA;Nubbins 12&#xA;Fork handles 4&#xA;4 Candles&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a command that will report 298 somehow (298 = 234 + 44 + 12 + 4 + 4) -- I guess either by echoing that to the message area or inserting it in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally it would cope with both integers and floating point numbers.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2023-05-16T13:36:20.887" Title="Sum numbers in region" Tags="|commands|region|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10940" PostTypeId="1" AcceptedAnswerId="11016" CreationDate="2015-04-26T19:21:15.670" Score="2" ViewCount="844" Body="&lt;p&gt;I'm trying to connect to HipChat via jabber.el. Here is my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq jabber-account-list '((&quot;myhipchatid@chat.hipchat.com&quot;&#xA;                             (:network-server . &quot;chat.hipchat.com&quot;)&#xA;                             (:password . &quot;secret&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to connect using &lt;code&gt;jabber-connect&lt;/code&gt; I continually get this error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;nil@nil: connection lost: `Couldn't connect to nil:5222: binding stack&#xA;  not balanced (serious byte compiler bug)'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This leads me to believe that jabber-connect is not picking up the values I set in jabber-account-list. Can anyone provide guidance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For what it's worth I've been working off of this gist: &lt;a href=&quot;https://gist.github.com/puffnfresh/4002033&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/puffnfresh/4002033&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Final update&lt;/em&gt;: thanks all for the help! I've written up the final form of my working configuration here: &lt;a href=&quot;https://gist.github.com/bitops/77308b347bceb54302a2&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/bitops/77308b347bceb54302a2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7015" LastEditorUserId="7015" LastEditDate="2015-04-30T07:43:25.850" LastActivityDate="2015-04-30T07:43:25.850" Title="Connecting to HipChat XMPP via jabber.el" Tags="|jabber|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10941" PostTypeId="2" ParentId="10939" CreationDate="2015-04-26T19:38:56.503" Score="2" Body="&lt;p&gt;I don't know of a built-in command that does this, but you could make your own:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun sum-region-nums (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (let (nums total)&#xA;      (while (re-search-forward &quot;\\b[0-9]+\\(\\.[0-9]+\\)*\\b&quot; end t)&#xA;        (push (string-to-number (match-string-no-properties 0))&#xA;              nums))&#xA;      (setq total (apply #'+ nums))&#xA;      (message &quot;%s&quot; total)&#xA;      total)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="160" LastEditDate="2015-05-22T22:17:01.393" LastActivityDate="2015-05-22T22:17:01.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10942" PostTypeId="2" ParentId="10939" CreationDate="2015-04-26T19:44:21.590" Score="7" Body="&lt;p&gt;Here's one:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;(defun sum-numbers-in-region (start end)&#xA;  (interactive &quot;r&quot;)&#xA;  (message &quot;%s&quot;&#xA;           (cl-reduce #'+&#xA;                      (split-string (buffer-substring start&#xA;                                                      end))&#xA;                      :key #'string-to-number)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because it uses &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/String-Conversion.html#index-string_002dto_002dnumber&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;string-to-number&lt;/code&gt;&lt;/a&gt;, it will treat the the token &quot;1hello&quot; as the number &quot;1&quot;, but won't treat &quot;hello2&quot; as a number. It also works with decimals (e.g., 2.4). &lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="160" LastEditDate="2015-05-22T22:16:51.417" LastActivityDate="2015-05-22T22:16:51.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10943" PostTypeId="2" ParentId="10938" CreationDate="2015-04-26T19:55:09.380" Score="33" Body="&lt;p&gt;In Emacs Lisp, if &lt;code&gt;foo&lt;/code&gt; is a symbol, then &lt;code&gt;'foo&lt;/code&gt; and &lt;code&gt;#'foo&lt;/code&gt; are completely equivalent.  The latter form (with &lt;code&gt;#'&lt;/code&gt;) is preferred when &lt;code&gt;foo&lt;/code&gt; is a function, as it documents the fact that it is intended to be funcalled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your two forms are therefore completely equivalent, and the one with &lt;code&gt;#'&lt;/code&gt; is preferred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: as pointed out by Malabarba, this is not quite true: &lt;code&gt;#'&lt;/code&gt; on symbols will cause the byte-compiler to emit a warning if the function is not defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that this is not the case for lambda-forms, for which plain &lt;code&gt;'&lt;/code&gt; prevents the byte-compiler from compiling the lambda-form, as &lt;a href=&quot;https://emacs.stackexchange.com/questions/3595/when-to-sharp-quote-a-lambda-expression&quot;&gt;documented elsewhere&lt;/a&gt;.  Note further that this is also not necessarily the case in other Lisp dialects, for example in Common Lisp &lt;code&gt;#'foo&lt;/code&gt; performs early binding.)&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-04-26T23:11:33.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10944" PostTypeId="2" ParentId="10939" CreationDate="2015-04-26T20:51:31.417" Score="5" Body="&lt;p&gt;Specifically for your case, assuming this is the entire text of the buffer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;replace-regexp&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;[^0-9]+&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;+&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x h&lt;/kbd&gt; - select all.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x * e&lt;/kbd&gt; &lt;em&gt;(make sure there is no trailing plus sign)&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-04-27T05:05:30.820" LastActivityDate="2015-04-27T05:05:30.820" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10945" PostTypeId="1" AcceptedAnswerId="10946" CreationDate="2015-04-26T21:40:54.277" Score="2" ViewCount="1889" Body="&lt;p&gt;How can I recalculate this entire table?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;C-u C-c C-c&lt;/code&gt; with point at the start of the 'End Nubbin' line, only the formula that computes the total above the line containing 'other' gets recalculated, and not the other formulae.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can get the result I want by placing point on each TBLFM line in turn and typing &lt;code&gt;C-c C-c&lt;/code&gt;.  I would like to get that same result with a single command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|-------------+---------|&#xA;| Other       |         |&#xA;|-------------+---------|&#xA;| Spam        |     100 |&#xA;| Ham         |      75 |&#xA;|             |         |&#xA;| ^           |   other |&#xA;|-------------+---------|&#xA;| Widgets     |         |&#xA;|-------------+---------|&#xA;| End Nubbin  |      10 |&#xA;| Side Nubbin |      20 |&#xA;|             |         |&#xA;| ^           | widgets |&#xA;|-------------+---------|&#xA;| Total       |         |&#xA;|-------------+---------|&#xA;|             |         |&#xA;| ^           |   total |&#xA;|-------------+---------|&#xA;#+TBLFM: $other=vsum(@-I..@-1)&#xA;#+TBLFM: $widgets=vsum(@-I..@-1)&#xA;#+TBLFM: $total=$other+$widgets&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-04-27T01:07:09.680" Title="Recalculating entire org-mode table with multiple sections" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10946" PostTypeId="2" ParentId="10945" CreationDate="2015-04-27T00:00:21.540" Score="8" Body="&lt;p&gt;There are three issues here I think. First, you need to put the markers &lt;code&gt;^&lt;/code&gt; in a dedicated column, not mixed in like you have. Second, you need to have all your formulae in a single line. Fixing those, you would have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|---+-------------+---------|&#xA;|   | Other       |         |&#xA;|---+-------------+---------|&#xA;|   | Spam        |     100 |&#xA;|   | Ham         |      75 |&#xA;|   |             |         |&#xA;| ^ |             |   other |&#xA;|---+-------------+---------|&#xA;|   | Widgets     |         |&#xA;|---+-------------+---------|&#xA;|   | End Nubbin  |      10 |&#xA;|   | Side Nubbin |      20 |&#xA;|   |             |         |&#xA;| ^ |             | widgets |&#xA;|---+-------------+---------|&#xA;|   | Total       |         |&#xA;|---+-------------+---------|&#xA;|   |             |         |&#xA;| ^ |             |   total |&#xA;|---+-------------+---------|&#xA;#+TBLFM: $other=vsum(@-I..@-1)::$widgets=vsum(@-I..@-1)::$total=$other+$widgets&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But then there is the third issue, which is that you need to double up the &lt;code&gt;C-u&lt;/code&gt; argument: either &lt;code&gt;C-u C-u C-c C-c&lt;/code&gt; or &lt;code&gt;C-u C-u C-c *&lt;/code&gt;.  This is because you have one formula that references the results of another formula, so multiple passes are needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the &lt;a href=&quot;http://orgmode.org/manual/Updating-the-table.html&quot;&gt;relevant section&lt;/a&gt; of the org manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;3.5.9 Updating the table&#xA;------------------------&#xA;&#xA;Recalculation of a table is normally not automatic, but needs to be&#xA;triggered by a command.  See *note Advanced features::, for a way to&#xA;make recalculation at least semi-automatic.&#xA;&#xA;   In order to recalculate a line of a table or the entire table, use&#xA;the following commands:&#xA;&#xA;`C-c *     (`org-table-recalculate')'&#xA;     Recalculate the current row by first applying the stored column&#xA;     formulas from left to right, and all field/range formulas in the&#xA;     current row.  &#xA;&#xA;`C-u C-c *'&#xA;`C-u C-c C-c'&#xA;     Recompute the entire table, line by line.  Any lines before the&#xA;     first hline are left alone, assuming that these are part of the&#xA;     table header.  &#xA;&#xA;`C-u C-u C-c *  or  C-u C-u C-c C-c     (`org-table-iterate')'&#xA;     Iterate the table by recomputing it until no further changes occur.&#xA;     This may be necessary if some computed fields use the value of&#xA;     other fields that are computed later in the calculation sequence.&#xA;&#xA;`M-x org-table-recalculate-buffer-tables RET'&#xA;     Recompute all tables in the current buffer.&#xA;&#xA;`M-x org-table-iterate-buffer-tables RET'&#xA;     Iterate all tables in the current buffer, in order to converge&#xA;     table-to-table dependencies.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; With respect to the second issue: multiple &lt;code&gt;TBLFM&lt;/code&gt; lines &lt;em&gt;are&lt;/em&gt; allowed, but they are for specifying multiple variants of the table formulae. Only the first &lt;code&gt;TBLFM&lt;/code&gt; line gets applied automatically, see &lt;a href=&quot;http://orgmode.org/manual/Editing-and-debugging-formulas.html#Using-multiple-_0023_002bTBLFM-lines&quot;&gt;this section&lt;/a&gt; of the manual. &lt;/p&gt;&#xA;" OwnerUserId="1980" LastEditorUserId="1980" LastEditDate="2015-04-27T01:07:09.680" LastActivityDate="2015-04-27T01:07:09.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10947" PostTypeId="2" ParentId="10900" CreationDate="2015-04-27T00:20:19.777" Score="0" Body="&lt;p&gt;Check out &lt;code&gt;clipboard-kill-region&lt;/code&gt; and &lt;code&gt;clipboard-yank&lt;/code&gt;. These come from &lt;code&gt;menu-bar.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once a region is highlighted, you can use clipboard-kill-region to kill the region to both your paste buffer and the system clipboard. clipboard-yank &quot;pastes&quot; whatever is currently on the system clipboard.&lt;/p&gt;&#xA;" OwnerUserId="7015" LastEditorUserId="7015" LastEditDate="2015-04-27T00:54:24.780" LastActivityDate="2015-04-27T00:54:24.780" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10948" PostTypeId="1" CreationDate="2015-04-27T02:05:09.937" Score="2" ViewCount="2581" Body="&lt;p&gt;I use &lt;code&gt;Emacs&lt;/code&gt; under Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to bind the &lt;code&gt;make&lt;/code&gt; command to a shortcut, so that &lt;code&gt;makefile&lt;/code&gt; could be launched. If the compilation fails, I would the error message to be shown in a sub-window or the message bar; otherwise, I would all the sub-windows to be closed except the one containing the main text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to realize that? Also which shortcut should be chosen?&lt;/p&gt;&#xA;" OwnerUserId="7162" LastActivityDate="2015-04-27T11:55:13.297" Title="Bind the make command to a shortcut" Tags="|key-bindings|makefile-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10949" PostTypeId="1" AcceptedAnswerId="11013" CreationDate="2015-04-27T02:45:15.273" Score="4" ViewCount="286" Body="&lt;p&gt;A while ago, skimming through emacs-orgmode mailing list, I read &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2015-04/msg00304.html&quot; rel=&quot;nofollow&quot;&gt;this message&lt;/a&gt; by Stefan Monnier:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'm on a crusade to eradicate the `intangible' property, which happens&#xA;  to rub me the wrong way because it's implemented at too-low a level (it&#xA;  affects every point movement) which incurs a significant performance&#xA;  penalty (even when not used) and affects a lot of code &lt;em&gt;which then&#xA;  needs to be fixed by binding inhibit-point-motion-hooks (which I'm&#xA;  considering defaulting to t).&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Got me wondering about this &lt;code&gt;inhibit-point-motion-hooks&lt;/code&gt; variable. In what particular cases is it used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming Stefan's statement about &quot;defaulting it to t&quot; isn't motivated by weariness, does it make a difference to change its value globally? What about performance-wise?&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="253" LastEditDate="2015-04-27T23:55:20.047" LastActivityDate="2015-04-29T13:43:55.603" Title="What is inhibit-point-motion-hooks?" Tags="|elisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10950" PostTypeId="2" ParentId="10948" CreationDate="2015-04-27T04:02:47.377" Score="5" Body="&lt;p&gt;One possibility (based on an original suggestion by Kyle Meyer) is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c m&quot;) 'recompile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can type &lt;code&gt;C-c m&lt;/code&gt;, which will first offer to save the current buffer if necessary, and then will run the command &lt;code&gt;make -k&lt;/code&gt; in the directory containing the associated file.  The &lt;code&gt;-k&lt;/code&gt; switch causes make to try to keep going even if some commands fail.  In case you want to modify this, you can type &lt;code&gt;C-u C-c m&lt;/code&gt; and you will get the chance to edit the compilation command in the minibuffer first.  The edited command will then be remembered on a per-buffer basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any compilation errors will be shown in a dedicated buffer (called &lt;code&gt;*compilation*&lt;/code&gt;) and you can either click on these with the mouse (to jump to the relevant point in the source file) or use &lt;code&gt;C-x backtick&lt;/code&gt; to cycle through them (sorry, I can't work out how to type a literal backtick inside backticks!).  The compilation buffer is not shown if no errors occur but you get a notification in the echo area when compilation is complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you can use any other key of your choice instead of &lt;code&gt;C-c m&lt;/code&gt; - I chose that for the mnemonic &lt;code&gt;m&lt;/code&gt; = &quot;make&quot; and because the &lt;code&gt;C-c letter&lt;/code&gt; keys are reserved for the end-user, so there is little risk of collision. &lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2015-04-27T04:02:47.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10952" PostTypeId="2" ParentId="10935" CreationDate="2015-04-27T05:04:20.640" Score="1" Body="&lt;p&gt;Here's one place:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sourceforge.net/projects/emacs-bin/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/projects/emacs-bin/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sourceforge.net/u/dmoncayo/profile/&quot; rel=&quot;nofollow&quot;&gt;Dani Moncayo&lt;/a&gt; provides these builds.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-27T05:04:20.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10953" PostTypeId="1" CreationDate="2015-04-27T10:40:46.147" Score="3" ViewCount="238" Body="&lt;p&gt;I use the &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow&quot;&gt;yasnippet&lt;/a&gt; bundle and it works like charm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I want to include placeholders in a PROPERTIES section of an org-document it is not working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the snipper:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#type: snippet&#xA;# --&#xA;:PROPERTIES:&#xA;${1: :var: name=&quot;$2&quot;}&#xA;${3: :var: url=&quot;$4&quot;}&#xA;:END:&#xA;$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What this does is to define 2 optional variables, &quot;name&quot; and &quot;url&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When calling &lt;code&gt;(yas-tryout-snippet)&lt;/code&gt; on the snippet above, the cursor is not positioned correctly. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here where it &lt;strong&gt;&lt;em&gt;should&lt;/em&gt;&lt;/strong&gt; jump:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press tab 1st: Make whole line &lt;code&gt;${1: :var: name=&quot;$2&quot;}&lt;/code&gt; because it can be optional&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press tab 2nd: Make only &quot;$2&quot; in the line &lt;code&gt;${1: :var: name=&quot;$2&quot;}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press tab 3rd: Make whole line &lt;code&gt;${3: :var: url=&quot;$4&quot;}&lt;/code&gt; because it can be optional&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... and so on&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what it &lt;strong&gt;&lt;em&gt;actually&lt;/em&gt;&lt;/strong&gt;  does:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press tab 1st: Make whole line &lt;code&gt;${1: :var: name=&quot;$2&quot;}&lt;/code&gt; because it can be optional&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press tab 2nd: Make whole line &lt;code&gt;${3: :var: url=&quot;$4&quot;}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The problem seem to be produced by the &lt;code&gt;:var:&lt;/code&gt; Keyword. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It stops yasnippet from jumping to the &lt;code&gt;$2&lt;/code&gt;. If I change it to only &lt;code&gt;var:&lt;/code&gt; or &lt;code&gt;:var&lt;/code&gt; it will work. But then it won't be able to include these properties into a src code block and work with it.&#xA;It will also work if I remove the quotes from the placeholder. So this will work, but as before, then I cannot eval the url var in code blocks&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${3: :var: url=$4}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried excaping things with no luck:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${3: :var: url=\&quot;$4\&quot;}&#xA;or&#xA;${3: :var: url='$4'}&#xA;or&#xA;${3: \:var\: url=&quot;$4&quot;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to write this snippet or what I'm doing wrong.&lt;/p&gt;&#xA;" OwnerUserId="2315" LastActivityDate="2015-04-27T10:40:46.147" Title="Jump sequence for placeholders in yasnippet not working in org-property blocks" Tags="|org-mode|org-babel|yasnippet|quote|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10954" PostTypeId="1" AcceptedAnswerId="10979" CreationDate="2015-04-27T11:25:33.357" Score="5" ViewCount="1759" Body="&lt;p&gt;In an otherwise empty *.org file I have a table like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: tbl1&#xA;|Name|Value|&#xA;|A   |    1|&#xA;|B   |    2|&#xA;|A   |    3|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to &lt;em&gt;somehow&lt;/em&gt; create a table that should look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: tbl2&#xA;|Name|Frequency|Sum|&#xA;|A   |2        |4  |&#xA;|B   |1        |2  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my real case tbl1 is 150 rows and changing, so it is only feasible if tbl2 is autogenerated somehow.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$2..@&amp;gt;$2='(length (org-lookup-all $1 '(remote(tbl1,@2$1..@&amp;gt;$1)) '(remote(tbl,@2$2..@&amp;gt;$2))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Produces the desired content for column 2 in tbl2, but&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$3..@&amp;gt;$3='(apply '+ (org-lookup-all $1 '(remote(tbl,@2$1..@&amp;gt;$1)) '(remote(tbl1,@2$2..@&amp;gt;$2))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;produces &quot;#ERROR&quot; with the following content in &lt;em&gt;Substitution history&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Substitution history of formula&#xA;Orig:   '(apply '+ (org-lookup-all $1 '(remote(tbl,@2$1..@&amp;gt;$1)) '(remote(tbl,@2$2..@&amp;gt;$2))))&#xA;$xyz-&amp;gt;  '(apply '+ (org-lookup-all $1 '(remote(tbl,@2$1..@&amp;gt;$1)) '(remote(tbl,@2$2..@&amp;gt;$2))))&#xA;@r$c-&amp;gt;  '(apply '+ (org-lookup-all $1 '(#(&quot;A&quot; 0 1 (fontified t face org-table)) #(&quot;B&quot; 0 1 (fontified t face org-table)) #(&quot;A&quot; 0 1 (fontified t face org-table))) '(#(&quot;1&quot; 0 1 (fontified t face org-table)) #(&quot;2&quot; 0 1 (fontified t face org-table)) #(&quot;3&quot; 0 1 (fontified t face org-table)))))&#xA;$1-&amp;gt;    '(apply '+ (org-lookup-all &quot;B&quot; '(#(&quot;A&quot; 0 1 (fontified t face org-table)) #(&quot;B&quot; 0 1 (fontified t face org-table)) #(&quot;A&quot; 0 1 (fontified t face org-table))) '(#(&quot;1&quot; 0 1 (fontified t face org-table)) #(&quot;2&quot; 0 1 (fontified t face org-table)) #(&quot;3&quot; 0 1 (fontified t face org-table)))))&#xA;Result: #ERROR&#xA;Format: NONE&#xA;Final:  #ERROR&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When appending &quot;;N&quot; to the second TBLFM, both rows in tbl2 &quot;Sum&quot; is 6 (that is, the sum of all entries). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is wrong with the second TBLFM?&lt;/p&gt;&#xA;" OwnerUserId="531" LastEditorUserId="531" LastEditDate="2015-04-28T06:58:01.793" LastActivityDate="2016-05-06T20:59:13.727" Title="Generate (populate?) table in org-mode using org-lookup-all" Tags="|org-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10955" PostTypeId="1" CreationDate="2015-04-27T11:27:18.997" Score="8" ViewCount="2901" Body="&lt;p&gt;I use &lt;code&gt;vc-mode&lt;/code&gt; to show information about the current VC state in my mode line, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-line-format '(… (vc-mode vc-mode) …))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I find the default format of &lt;code&gt;vc-mode&lt;/code&gt; pretty verbose.  Notably, it includes the name of the current VC backend, which is not particularly interesting to me—I usually know which VCS the current buffer as, and I don’t really use any VCS other than Git anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I customize the appearance of &lt;code&gt;vc-mode&lt;/code&gt;?  Ideally, I’d hide the name of the backend, and show just the name of the current branch (or probably something similar to &lt;code&gt;git describe&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if &lt;code&gt;vc-mode&lt;/code&gt; can’t be customized, can I somehow get the current branch name from VC, for use in a custom &lt;code&gt;(:eval …)&lt;/code&gt; construct?&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2020-10-20T09:43:51.283" Title="Customize vc-mode appearance in mode-line" Tags="|mode-line|git|vc|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10956" PostTypeId="2" ParentId="10948" CreationDate="2015-04-27T11:55:13.297" Score="1" Body="&lt;p&gt;So the global set key to recompile is the first way to go. Now we can try another option, more interactive and visual, which is &lt;code&gt;helm-make&lt;/code&gt; by abo-abo, a prolific emacs lisp developer: &lt;a href=&quot;https://github.com/abo-abo/helm-make&quot; rel=&quot;nofollow&quot;&gt;https://github.com/abo-abo/helm-make&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the command &lt;code&gt;helm-make-projectile&lt;/code&gt; you will have a nice helm buffer which suggests the targets of the makefile, that it will find at your project root directory (handy). Choose one and it calls &lt;code&gt;compile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;package-install RET helm-make RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(you need &lt;a href=&quot;http://wikemacs.org/wiki/MELPA&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: and &lt;a href=&quot;https://gitlab.com/emacs-stuff/make-menu&quot; rel=&quot;nofollow&quot;&gt;this package&lt;/a&gt; is similar, but it's mine, it displays a menu with the Makefile targets, and it isn't in melpa. To try it copy it in a buffer and call &lt;code&gt;M-x eval-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2015-04-27T11:55:13.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10957" PostTypeId="2" ParentId="10955" CreationDate="2015-04-27T12:21:35.283" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I customize the appearance of &lt;code&gt;vc-mode&lt;/code&gt;? Ideally, I’d hide the name of the backend, and show just the name of the current branch.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's pretty much what&#xA;&lt;a href=&quot;https://github.com/Malabarba/smart-mode-line/&quot; rel=&quot;noreferrer&quot;&gt;smart-mode-line&lt;/a&gt; does.&#xA;You can give it a try, or you can just copy the advice that it uses:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice vc-mode-line (after strip-backend () activate)&#xA;  (when (stringp vc-mode)&#xA;    (let ((noback (replace-regexp-in-string &#xA;                   (format &quot;^ %s&quot; (vc-backend buffer-file-name))&#xA;                   &quot; &quot; vc-mode)))&#xA;      (setq vc-mode noback))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this is a streamlined version of it.&#xA;You can find the full code for the advice&#xA;&lt;a href=&quot;https://github.com/Malabarba/smart-mode-line/blob/007ae4bed22edff2fd2fe4fa1d68c87d50e14ae0/smart-mode-line.el#L1119&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;,&#xA;which also applies different faces depending on the state of the&#xA;branch.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As an alternative, here's an even more streamlined version that&#xA;doesn't use an advice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcdr (assq 'vc-mode mode-line-format)&#xA;        '((:eval (replace-regexp-in-string &quot;^ Git&quot; &quot; &quot; vc-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-04-27T16:33:40.983" LastActivityDate="2015-04-27T16:33:40.983" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10958" PostTypeId="1" CreationDate="2015-04-27T13:26:06.123" Score="1" ViewCount="519" Body="&lt;p&gt;I have a common file to track the time logged in multiple files across various directories. Manually adding files to &lt;code&gt;:scope&lt;/code&gt; becomes tedious very quickly. How can I automatically add all the files in a given directory?&lt;/p&gt;&#xA;" OwnerUserId="7165" LastEditorUserId="675" LastEditDate="2015-04-27T18:17:43.500" LastActivityDate="2015-05-28T10:55:03.723" Title="How to add a directory to :scope options in clock report?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ClosedDate="2015-05-29T13:35:22.327" ContentLicense="CC BY-SA 3.0" />
  <row Id="10959" PostTypeId="2" ParentId="10954" CreationDate="2015-04-27T13:37:02.100" Score="2" Body="&lt;p&gt;Here's in case you were interested, a way to do that using SQLite (I wrote this mostly as an exercise, since I didn't need to import Org tables into SQLite before), but it seems to work, so, why not.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Populate source.db using SQLite&#xA;  #+header: :results silent&#xA;  #+header: :dir ~/Projects/org/&#xA;  #+header: :db source.db&#xA;  #+begin_src sqlite&#xA;    create table example(name varchar(10), value int);&#xA;    insert into example values('A', 1);&#xA;    insert into example values('B', 2);&#xA;    insert into example values('A', 3);&#xA;  #+end_src&#xA;&#xA;* Populate source.db from Org table&#xA;  :PROPERTIES:&#xA;  :TABLE_EXPORT_FILE: ~/Projects/org/exported.csv&#xA;  :TABLE_EXPORT_FORMAT: orgtbl-to-csv&#xA;  :END:&#xA;  #+TBLNAME: tbl1&#xA;  | Name | Value |&#xA;  |------+-------|&#xA;  | A    |     1 |&#xA;  | B    |     2 |&#xA;  | A    |     3 | &#xA;&#xA;  This is only needed to remove the first row of the table.  For&#xA;  some reason the SQLite import option, where it creates column&#xA;  names from the first row didn't work.&#xA;  #+begin_src sh&#xA;    tail -n +2 ~/Projects/org/exported.csv &amp;gt; ~/Projects/org/exported.tmp&#xA;    mv ~/Projects/org/exported.tmp ~/Projects/org/exported.csv&#xA;  #+end_src&#xA;&#xA;  #+header: :results silent&#xA;  #+header: :dir ~/Projects/org/&#xA;  #+header: :db source.db&#xA;  #+begin_src sqlite&#xA;    create table if not exists org_export(name varchar(10), value int);&#xA;    .mode csv&#xA;    .import /home/wvxvw/Projects/org/exported.csv org_export&#xA;  #+end_src&#xA;&#xA;* Retrieve from source.db&#xA;  #+header: :list :colnames yes&#xA;  #+header: :dir ~/Projects/org/&#xA;  #+header: :db source.db&#xA;  #+begin_src sqlite&#xA;    select `name`, &#xA;           count(`name`) as frequency,&#xA;           sum(`value`) as sum&#xA;     from example group by `name`;&#xA;  #+end_src&#xA;&#xA;  #+RESULTS:&#xA;  | name | frequency | sum |&#xA;  |------+-----------+-----|&#xA;  | A    |         2 |   4 |&#xA;  | B    |         1 |   2 |&#xA;&#xA;  #+header: :list :colnames yes&#xA;  #+header: :dir ~/Projects/org/&#xA;  #+header: :db source.db&#xA;  #+begin_src sqlite&#xA;    select `name`, &#xA;           count(`name`) as frequency,&#xA;           sum(`value`) as sum&#xA;     from org_export group by `name`;&#xA;  #+end_src&#xA;&#xA;  #+RESULTS:&#xA;  | name | frequency | sum |&#xA;  |------+-----------+-----|&#xA;  | A    |         2 |   4 |&#xA;  | B    |         1 |   2 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-04-27T13:37:02.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10960" PostTypeId="1" AcceptedAnswerId="10962" CreationDate="2015-04-27T14:00:26.110" Score="18" ViewCount="3000" Body="&lt;p&gt;I have the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# contributor: Song Qiang &amp;lt;tsiangsung@gmail.com&amp;gt;&#xA;# key: m&#xA;# group: Math&#xA;# name: Inline math \( ... \)&#xA;# --&#xA;\\($1\\)$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want it to be available for both &lt;code&gt;latex-mode&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt;. How can this be achieved? I could symlink, but I'm trying to find a smarter way.&lt;/p&gt;&#xA;" OwnerUserId="861" LastActivityDate="2020-10-26T18:14:13.583" Title="One yasnippet snippet for multiple modes" Tags="|yasnippet|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10961" PostTypeId="2" ParentId="408" CreationDate="2015-04-27T15:09:26.367" Score="18" Body="&lt;p&gt;In Emacs-25, there is the variable &lt;code&gt;package-selected-packages&lt;/code&gt;, so you can customize this variable and use &lt;code&gt;package-install-selected-packages&lt;/code&gt; to make sure they're installed.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-02-15T13:37:26.497" LastActivityDate="2016-02-15T13:37:26.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10962" PostTypeId="2" ParentId="10960" CreationDate="2015-04-27T15:56:32.350" Score="25" Body="&lt;p&gt;The &lt;a href=&quot;http://joaotavora.github.io/yasnippet/snippet-organization.html#org7468fa9&quot; rel=&quot;noreferrer&quot;&gt;Yasnippet documentation&lt;/a&gt; explains that you will need to include a &lt;code&gt;.yas-parents&lt;/code&gt; file with the parent modes:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;It's very useful to have certain modes share snippets between themselves. To do this, choose a mode subdirectory and place a &lt;code&gt;.yas-parents&lt;/code&gt; containing a whitespace-separated list of other mode names. When you reload those modes become parents of the original mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;.&#xA;|-- c-mode&#xA;|   |-- .yas-parents    # contains &amp;quot;cc-mode text-mode&amp;quot;&#xA;|   `-- printf&#xA;|-- cc-mode&#xA;|   |-- for&#xA;|   `-- while&#xA;|-- java-mode&#xA;|   |-- .yas-parents    # contains &amp;quot;cc-mode text-mode&amp;quot;&#xA;|   `-- println&#xA;`-- text-mode&#xA;    |-- email&#xA;    `-- time&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Hence, you could, for example, put your snippet in a &lt;code&gt;text-mode&lt;/code&gt; directory, and then, in the &lt;code&gt;latex-mode&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt; directories, include a &lt;code&gt;.yas-parents&lt;/code&gt; file that include the text &lt;code&gt;text-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="25937" LastEditDate="2020-10-26T02:56:01.823" LastActivityDate="2020-10-26T02:56:01.823" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="10963" PostTypeId="2" ParentId="10900" CreationDate="2015-04-27T16:00:28.527" Score="31" Body="&lt;p&gt;The following just works, copied from &lt;a href=&quot;https://gist.github.com/the-kenny/267162&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun copy-from-osx ()&#xA;  (shell-command-to-string &quot;pbpaste&quot;))&#xA;&#xA;(defun paste-to-osx (text &amp;amp;optional push)&#xA;  (let ((process-connection-type nil))&#xA;    (let ((proc (start-process &quot;pbcopy&quot; &quot;*Messages*&quot; &quot;pbcopy&quot;)))&#xA;      (process-send-string proc text)&#xA;      (process-send-eof proc))))&#xA;&#xA;(setq interprogram-cut-function 'paste-to-osx)&#xA;(setq interprogram-paste-function 'copy-from-osx)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="7078" LastEditDate="2016-05-24T12:00:14.860" LastActivityDate="2016-05-24T12:00:14.860" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10964" PostTypeId="2" ParentId="10955" CreationDate="2015-04-27T16:11:32.443" Score="4" Body="&lt;p&gt;I was not happy with the default behavior either. I could never keep the vc info characters straight— &quot;:&quot; for edited, &quot;@&quot; for added, etc. You can feel free to use my method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I defined several custom faces to display the statuses in various colors. Then I wrote a function to translate the default vc info into a string to insert into the mode line. Then I added a &lt;code&gt;:eval&lt;/code&gt; line in my mode line definition to show it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;;; Define faces.&#xA;&#xA;(defface my/mode:vc-added&#xA;  `(&#xA;     (  ((class color))&#xA;        (:background &quot;#FFAA55&quot;  :foreground &quot;black&quot;)  )&#xA;     (  t&#xA;        (:weight bold :underline t)  )&#xA;   )&#xA;  &quot;VC status tag face for files that have just been added to&#xA;version-control.&quot;&#xA;  :group 'MY/mode)&#xA;&#xA;(defface my/mode:vc-edited&#xA;  `(&#xA;     (  ((class color))&#xA;        (:background &quot;#F05B80&quot;  :foreground &quot;black&quot;)  )   ; &quot;#F04040&quot; maybe?&#xA;     (  t&#xA;        (:weight bold :underline t)  )&#xA;   )&#xA;  &quot;VC status tag face for files that are under version control&#xA;but which have been edited.&quot;&#xA;  :group 'MY/mode)&#xA;&#xA;(defface my/mode:vc-in-sync&#xA;  `(&#xA;     (  ((class color))&#xA;        (:background &quot;#60CC60&quot;  :foreground &quot;black&quot;)  )&#xA;     (  t&#xA;        (:weight bold :underline t)  )&#xA;   )&#xA;  &quot;VC status tag face for files that are under version control&#xA;and which are in sync with the respository.&quot;&#xA;  :group 'MY/mode)&#xA;&#xA;(defface my/mode:vc-none&#xA;  `(&#xA;     (  ((class color))&#xA;        (:background &quot;#70A0D0&quot;  :foreground &quot;black&quot;)  )&#xA;     (  t&#xA;        (:weight bold :underline t)  )&#xA;   )&#xA;  &quot;VC status tag face for files that are not under version&#xA;control&quot;&#xA;  :group 'MY/mode)&#xA;&#xA;(defface my/mode:vc-unknown&#xA;  `(&#xA;     (  ((class color))&#xA;        (:background &quot;#FF0000&quot;  :foreground &quot;white&quot;)  )&#xA;     (  t&#xA;        (:weight bold :underline t)  )&#xA;   )&#xA;  &quot;VC status tag face for files whose version-control status&#xA;cannot be determined.&quot;&#xA;  :group 'MY/mode)&#xA;&#xA;(defvar my-vc-mode-attrs&#xA;  '((&quot;&quot;  . (&quot; NoVC &quot;  my/mode:vc-none))&#xA;    (&quot;-&quot; . (&quot; VC = &quot;  my/mode:vc-in-sync))&#xA;    (&quot;:&quot; . (&quot; VC &gt; &quot;  my/mode:vc-edited))&#xA;    (&quot;@&quot; . (&quot; VC + &quot;  my/mode:vc-added))&#xA;    (&quot;?&quot; . (&quot; ?VC? &quot;  my/mode:vc-unknown))&#xA;    )&#xA;  &quot;Lookup table to translate vc-mode character into another string/face.&quot;&#xA;)&#xA;&#xA;&#xA;;; This function helps me understand the version-control status.&#xA;(defun my-mode-line-vc-info ()&#xA;  &quot;Return version-control status information about the file in&#xA;the current buffer, as a fontified string.&#xA;&#xA;The mode-line variable `vc-mode' is nil if the file is not under&#xA;version control, and displays a hyphen or a colon depending on whether&#xA;the file has been modified since check-in.  I can never keep those&#xA;straight.&#xA;&#xA;This function returns \&quot;NoVC\&quot; if the file is not under version &#xA;control.  It displays a string with an = sign if the file is in sync&#xA;with its version control, and a string with a &gt; sign if the file has&#xA;been modified since its last check-in.&quot;&#xA;  (let* ((class&#xA;          (cond&#xA;           ;; If not under version-control&#xA;           ((not vc-mode)&#xA;            &quot;&quot;)&#xA;&#xA;           ;; If under version-control decode the -:@ character&#xA;           ((string-match &quot;\\` ?\\(?:CVS\\|Git\\)\\([-:@]\\)\\([^^:~ \x00-\x1F\\\\/]+\\)?&quot; vc-mode)&#xA;            (match-string-no-properties 1 vc-mode))&#xA;&#xA;           ;; Otherwise, indicate confusion&#xA;           (t&#xA;            &quot;?&quot;)&#xA;           ))&#xA;&#xA;         (branch&#xA;          (if (any class '(&quot;-&quot; &quot;:&quot; &quot;@&quot;))&#xA;              (concat &quot; &quot; (match-string-no-properties 2 vc-mode))&#xA;            &quot;&quot;))&#xA;&#xA;         ;; Fetch properties list for the class character above&#xA;         (props (cdr (assoc class my-vc-mode-attrs)))&#xA;         )&#xA;&#xA;    (concat (propertize (car props) 'face (cadr props))&#xA;            branch)))&#xA;&#xA;(set-default 'mode-line-format&#xA;   '(&#xA;     ...&#xA;        (:eval (my-mode-line-vc-info))&#xA;     ...))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="321" LastActivityDate="2015-04-27T16:11:32.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10965" PostTypeId="1" CreationDate="2015-04-27T17:20:02.780" Score="10" ViewCount="5060" Body="&lt;p&gt;This may have an obvious solution, which would explain why I cannot find it anywhere online, but I would like to customize the holidays that show up in my &lt;code&gt;org-agenda&lt;/code&gt;--as easily as possible. Instead of manually entering each holiday in a diary or org mode file, I'd ideally like to draw on the &quot;holidays.el&quot; package. To do this I currently have the line &lt;code&gt;%%(org-calendar-holiday)&lt;/code&gt; in an org mode file. The only problem is that I get every single holiday showing up in my agenda now, most of which are only useful in clogging up my agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to &quot;turn off&quot; some of these calendar lists so they don't get displayed in my agenda? I tried going the route of setting variables like &lt;code&gt;holiday-solar-holidays&lt;/code&gt; to &quot;nil,&quot; but that doesn't seem to affect their display in the agenda. This increases my suspicion that the &lt;code&gt;holiday-xx-holidays&lt;/code&gt; variables are only applicable to the calendar, and not the agenda. If that's the case I'll assuredly have to go another route, and other suggestions would be welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My end goal is to have major U.S. holidays and solar holidays displayed in my agenda. With so few holidays you may ask why I don't manually enter them and forget the &lt;code&gt;org-calendar-holiday&lt;/code&gt; function and &quot;holidays.el&quot; library all together. Well, coding the dates of all future solstices and equinoxes doesn't sound very appealing. Plus, I like drawing on what's already been done when I can--in this case the &quot;holidays&quot; package. Although I could be using it in an entirely different manner than it was intended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side note, I read the post entitled &quot;&lt;a href=&quot;https://emacs.stackexchange.com/questions/10871/programmatically-add-birthdays-holidays-to-agenda-view-in-org-mode&quot; title=&quot;https://emacs.stackexchange.com/questions/10871/programmatically-add-birthdays-holidays-to-agenda-view-in-org-mode&quot;&gt;Programmatically add birthdays/holidays to agenda view in org-mode&lt;/a&gt;&quot;, but there didn't seem to be enough detail to tell if it's the same issue I'm encountering. And interesting as the current answer in that post is, it's not the solution I'm hoping for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="5478" LastEditDate="2015-06-17T12:52:34.493" LastActivityDate="2019-07-11T09:57:04.567" Title="Easiest way to customize holidays that appear in org-agenda" Tags="|org-agenda|calendar|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10966" PostTypeId="1" AcceptedAnswerId="10970" CreationDate="2015-04-27T17:26:16.483" Score="10" ViewCount="3681" Body="&lt;p&gt;My init file includes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq global-auto-revert-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I can confirm it's true with C-h v. But I still have to manually revert all my files with revert-buffer whenever I change git branches. I even get as far as trying to save and getting the &quot;file changed on disk&quot; prompt. Any suggestions for how to debug this?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastEditorUserId="115" LastEditDate="2015-05-08T13:03:33.713" LastActivityDate="2019-03-06T12:15:00.630" Title="global-auto-revert-mode doesn't seem to work?" Tags="|minor-mode|revert-buffer|auto-revert-mode|" AnswerCount="3" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="10967" PostTypeId="1" AcceptedAnswerId="10969" CreationDate="2015-04-27T17:41:39.807" Score="8" ViewCount="14922" Body="&lt;p&gt;I want to check if there is a &amp;quot;\r&amp;quot; at the end of a line of a plain text file (compressed as .gz file). I try the whitespace mode, and I don't find &lt;code&gt;^M&lt;/code&gt; shown. Is &lt;code&gt;\r&lt;/code&gt; shown as &lt;code&gt;^M&lt;/code&gt; in whitespace mode?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/76Yys.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;But my python program says something is wrong with the &lt;code&gt;1&lt;/code&gt; at the end of the second line&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;line 67, in transform&#xA;    vals = [eval(v) for v in line.replace('\n', '').split(',')]&#xA;  File &amp;quot;&amp;lt;string&amp;gt;&amp;quot;, line 1&#xA;    1&#xA;    ^&#xA;SyntaxError: unexpected EOF while parsing&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Did I use emacs correctly to show the &lt;code&gt;\r&lt;/code&gt;, &lt;code&gt;\n&lt;/code&gt; and other characters at the end of each line?&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2023-12-23T04:41:43.233" Title="How to examine the new line characters in emacs?" Tags="|newlines|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10968" PostTypeId="2" ParentId="10966" CreationDate="2015-04-27T18:01:28.140" Score="1" Body="&lt;p&gt;auto-revert only works for buffers which are not modified.  So at least for the &quot;trying to save and getting the file changed on disk prompt&quot; the behavior you describe is normal.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-27T18:01:28.140" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10969" PostTypeId="2" ParentId="10967" CreationDate="2015-04-27T18:14:24.200" Score="12" Body="&lt;p&gt;On the left side of the modeline, you'll see &lt;code&gt;(DOS)&lt;/code&gt;. This means that Emacs is viewing the buffer as if it had DOS-style line endings. To view the buffer as if it had Unix-style line endings, use the command &lt;code&gt;revert-buffer-with-coding-system&lt;/code&gt; (bound to &lt;code&gt;C-x RET r&lt;/code&gt; or &lt;code&gt;C-x C-m r&lt;/code&gt;), and select something like &lt;code&gt;utf-8-unix&lt;/code&gt;. Then the &lt;code&gt;^M&lt;/code&gt; characters will be visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you want to convert the file to Unix-style line endings, use &lt;code&gt;set-buffer-file-coding-system&lt;/code&gt; (&lt;code&gt;C-x RET f&lt;/code&gt;/&lt;code&gt;C-x C-m f&lt;/code&gt;) and choose &lt;code&gt;utf-8-unix&lt;/code&gt;, then save the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Emacs manual, 22.6 Recognizing Coding Systems:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs recognizes which kind of end-of-line conversion to use based on the contents of the file: if it sees only carriage-returns, or only carriage-return linefeed sequences, then it chooses the end-of-line conversion accordingly. You can inhibit the automatic use of end-of-line conversion by setting the variable inhibit-eol-conversion to non-nil. If you do that, DOS-style files will be displayed with the ‘^M’ characters visible in the buffer; some people prefer this to the more subtle ‘(DOS)’ end-of-line type indication near the left edge of the mode line (see eol-mnemonic).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Recognize-Coding.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Recognize-Coding.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-04-27T18:33:52.147" LastActivityDate="2015-04-27T18:33:52.147" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10970" PostTypeId="2" ParentId="10966" CreationDate="2015-04-27T18:54:31.427" Score="5" Body="&lt;p&gt;You don't set the variable using &lt;code&gt;setq&lt;/code&gt;, you call the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-auto-revert-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6641" LastEditorUserId="6641" LastEditDate="2015-04-27T21:38:46.747" LastActivityDate="2015-04-27T21:38:46.747" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10971" PostTypeId="2" ParentId="10966" CreationDate="2015-04-27T19:15:26.067" Score="16" Body="&lt;p&gt;&lt;strong&gt;A minor mode is not enabled/disabled by setting a variable.&lt;/strong&gt; The minor mode variable should be used to check the &quot;mode enabled&quot; status, not to set the mode state. If its value is &lt;code&gt;t&lt;/code&gt;, the minor mode is on, else the mode is off.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See the below snippets to see how to control any minor mode. &lt;em&gt;Replace &lt;code&gt;MINOR-MODE-NAME&lt;/code&gt; with the actual minor mode name you are dealing with (&lt;code&gt;global-auto-revert-name&lt;/code&gt; as is the case in the question).&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Enabling a minor mode&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Using elisp&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Directly&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(MINOR-MODE-NAME)&#xA;;; or&#xA;(MINOR-MODE-NAME 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Based on a hook activation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'SOME-HOOK #'MINOR-MODE-NAME)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Disabling a minor mode&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Using elisp&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Directly&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(MINOR-MODE-NAME 0)&#xA;;; or&#xA;(MINOR-MODE-NAME -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Based on a hook activation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'SOME-HOOK (lambda () (MINOR-MODE-NAME -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Toggling a minor mode&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Interactively&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x MINOR-MODE-NAME&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Using a key binding&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;KEY&amp;gt;&quot;) #'MINOR-MODE-NAME)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Using elisp (non-interactively)&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(MINOR-MODE-NAME 'toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Sources&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Minor-Mode-Conventions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Manual - Minor Mode Conventions&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ergoemacs.org/emacs/emacs-tip_mode_on_off_toggle.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Xah's blog - Turning major.minor mode on/off&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2019-03-06T12:15:00.630" LastActivityDate="2019-03-06T12:15:00.630" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="10972" PostTypeId="1" AcceptedAnswerId="10974" CreationDate="2015-04-27T20:22:23.920" Score="2" ViewCount="380" Body="&lt;p&gt;I'm on Windows 7, running GNU Emacs 24.4.1, and I have also installed Cygwin and I am trying to use Cygwin as the shell in Emacs. I followed the answer here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/235254/how-can-i-run-cygwin-bash-shell-from-within-emacs&quot;&gt;https://stackoverflow.com/questions/235254/how-can-i-run-cygwin-bash-shell-from-within-emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And have this in my init-file&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq shell-file-name &quot;C:/cygwin64/bin/bash&quot;)&#xA;(setq explicit-shell-file-name shell-file-name)&#xA;(setenv &quot;PATH&quot;&#xA;(concat &quot;~/bin:/usr/local/bin:/usr/bin:&quot;&#xA;    (replace-regexp-in-string &quot; &quot; &quot;\\\\ &quot;&#xA;        (replace-regexp-in-string &quot;\\\\&quot; &quot;/&quot;&#xA;            (replace-regexp-in-string &quot;\\([A-Za-z]\\):&quot; &quot;/\\1&quot;&#xA;                (getenv &quot;PATH&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to compile on Latex, I get this error:&#xA;&quot;ERROR: LaTeX Error: File `fullpage.sty' not found.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disabling cygwin in my init file fixes the problem. I feel like enabling Cygwin might mess up Emacs with path names, so it can't find the fullpage.sty and other Latex packages. Anyone ideas on how to fix this?&lt;/p&gt;&#xA;" OwnerUserId="6584" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-04-22T06:47:19.577" Title="Latex failing with Cygwin" Tags="|latex|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10973" PostTypeId="2" ParentId="10897" CreationDate="2015-04-27T21:54:03.567" Score="1" Body="&lt;p&gt;For &lt;code&gt;malabar-mode&lt;/code&gt;, which is enabled in java and groovy buffers,  I also added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-define-generic-checker 'jvm-mode-malabar&#xA;  &quot;Integrate flycheck with the malabar JVM service.&quot;&#xA;  :start #'malabar-flycheck-command&#xA;  :modes '(java-mode groovy-mode)&#xA;)&#xA;&#xA;(add-to-list 'flycheck-checkers 'jvm-mode-malabar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="181" LastActivityDate="2015-04-27T21:54:03.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10974" PostTypeId="2" ParentId="10972" CreationDate="2015-04-27T22:00:21.097" Score="1" Body="&lt;p&gt;The problem is that &lt;code&gt;.bashrc&lt;/code&gt; is only loaded in interactive mode. Doing a C-c C-b to compile in latex mode executes a shell-command, which is by default non interactive. If you add these lines to your emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq shell-file-name &quot;bash&quot;)&#xA;(setq shell-command-switch &quot;-ic&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now any shell-commands will be run interactively. Also as a side note maybe people should enable this anyways because it allows you to use your bashrc aliases when executing shell-command.&lt;/p&gt;&#xA;" OwnerUserId="6584" LastEditorUserId="675" LastEditDate="2015-05-27T23:50:14.720" LastActivityDate="2015-05-27T23:50:14.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10975" PostTypeId="1" AcceptedAnswerId="12323" CreationDate="2015-04-28T06:13:59.537" Score="2" ViewCount="1309" Body="&lt;p&gt;I have a problem with the &lt;code&gt;magit-item-highlight&lt;/code&gt; in different themes. With monokai, zenburn, etc., the item highlight is a background, and does not interfere with green and red diff faces. However, with the default theme, it inherits the face from secondary-selection and overrides the red and green colouring of diffs. The interim solution would be just to customise this to empty face, but how can I actually fix it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bFKvM.png&quot; alt=&quot;bad&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/homDg.png&quot; alt=&quot;good&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2207" LastEditorUserId="253" LastEditDate="2015-05-08T21:45:33.663" LastActivityDate="2015-07-03T12:58:20.393" Title="customize-face magit-item-highlight properly" Tags="|magit|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10976" PostTypeId="2" ParentId="10921" CreationDate="2015-04-28T06:20:39.673" Score="2" Body="&lt;p&gt;&lt;code&gt;find-file&lt;/code&gt; calls &lt;code&gt;switch-to-buffer&lt;/code&gt; which &quot;Display buffer BUFFER-OR-NAME in the selected window.&quot; Once control returns to the command loop, it makes the buffer in the selected window the current. However, in your case, this never happens since you're still running the ert code. You can get around this by doing something like &lt;code&gt;(set-buffer (window-buffer (selected-window)))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command loop is documented in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Current-Buffer.html&quot; rel=&quot;nofollow&quot;&gt;the elisp manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-04-28T06:20:39.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10977" PostTypeId="1" CreationDate="2015-04-28T07:57:19.297" Score="0" ViewCount="97" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt;, I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-to-pdf-process (list &quot;latexmk -f -pdf %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when exporting an &lt;code&gt;org&lt;/code&gt; it uses the &quot;wrong&quot; version of &lt;code&gt;latexmk&lt;/code&gt;. More precisely, from my &lt;code&gt;shell&lt;/code&gt; (outside of &lt;code&gt;emacs&lt;/code&gt;), I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/local/texlive/2014/bin/x86_64-linux/latexmk&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, it seems like, &lt;code&gt;org&lt;/code&gt; is using a different one that is associated to the wrong version of TeXLive. How can I set the &lt;strong&gt;right&lt;/strong&gt; LaTeX to be used when exporting &lt;code&gt;org&lt;/code&gt; files?&lt;/p&gt;&#xA;" OwnerUserId="861" LastActivityDate="2015-04-28T13:46:02.510" Title="Set LaTeX version to use when exporting using org-mode" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10978" PostTypeId="1" CreationDate="2015-04-28T08:20:05.350" Score="-3" ViewCount="253" Body="&lt;p&gt;Searching for &lt;code&gt;helm.el&lt;/code&gt; with &lt;a href=&quot;https://github.com/Wilfred/ag.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ag.el&lt;/code&gt;&lt;/a&gt; in the Helm directory produces this error: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-bash prettyprint-override&quot;&gt;&lt;code&gt;d:/emacs/share/emacs/site-lisp/helm/helm-1.7.0/:&#xA;  ag --nocolor -g 'helm\.el' &quot;d:/emacs/share/emacs/site-lisp/helm/helm-1.7.0/&quot; | grep -v '^$' | sed s/\'/\\\\\'/ | xargs -I '{}' ls -alh '{}' &amp;amp;&#xA;  sed: -e expression #1,        char 8: unterminated `s' command&#xA;&#xA;  ag finished at Tue Apr 28 16:16:58&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using MSYS on Windows 7 32 bit &lt;/p&gt;&#xA;" OwnerUserId="7173" LastEditorUserId="2642" LastEditDate="2015-04-28T19:19:41.183" LastActivityDate="2015-04-29T10:02:26.000" Title="ag-dired can't find any file" Tags="|microsoft-windows|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10979" PostTypeId="2" ParentId="10954" CreationDate="2015-04-28T09:14:25.470" Score="3" Body="&lt;p&gt;The problem is that the return is a group of strings (&lt;a href=&quot;http://thread.gmane.org/gmane.emacs.orgmode/90427/focus=90432&quot; rel=&quot;nofollow&quot;&gt;Re: Help with org-lookup-all&lt;/a&gt;) so they must me mapcar'ed like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$3..@&amp;gt;$3='(apply '+ (mapcar (function string-to-number) (org-lookup-all $1 '(remote(tbl,@2$1..@&amp;gt;$1)) '(remote(tbl1,@2$2..@&amp;gt;$2)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This produces the desired table. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to go about it?&lt;/p&gt;&#xA;" OwnerUserId="531" LastActivityDate="2015-04-28T09:14:25.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10980" PostTypeId="2" ParentId="10978" CreationDate="2015-04-28T09:49:17.500" Score="0" Body="&lt;p&gt;This appears to be a bug in ag.el, see: &lt;a href=&quot;https://github.com/Wilfred/ag.el/issues/87&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Wilfred/ag.el/issues/87&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I initially misunderstood the question.  Please consider updating it for clarity.)&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2015-04-29T10:02:16.500" LastActivityDate="2015-04-29T10:02:16.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10981" PostTypeId="1" AcceptedAnswerId="10986" CreationDate="2015-04-28T09:56:48.947" Score="16" ViewCount="2864" Body="&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt;, when the contents of a subtree are hidden you see something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some tree&#xA;  :PROPERTIES:...&#xA;&#xA;** Another One...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to change those &lt;code&gt;...&lt;/code&gt; to something else? I'd like to use something shorter like a utf-8 ellipsis or a rounded arrow.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-04-28T12:56:44.917" Title="Changing the appearance of org-mode “hidden contents” ellipsis" Tags="|org-mode|outline|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10982" PostTypeId="2" ParentId="10958" CreationDate="2015-04-28T10:11:55.277" Score="1" Body="&lt;p&gt;I think this question can be closed. I found the solution here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/5481/is-there-a-simple-way-to-use-all-org-files-referenced-in-a-main-file-for-the-org?rq=1&quot;&gt;Is there a simple way to use all org-files referenced in a main file for the org-mode clock table&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7165" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-04-28T10:11:55.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10983" PostTypeId="1" CreationDate="2015-04-28T10:52:36.157" Score="22" ViewCount="3580" Body="&lt;p&gt;In many of my projects I use &lt;code&gt;.dir-locals.el&lt;/code&gt; files to setup project specific variables such as compile commands. Upon opening a file within a directory containing such a file, &lt;code&gt;emacs&lt;/code&gt; complains about &lt;em&gt;&quot;risky local variables&quot;&lt;/em&gt;, specifically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The local variables list in $DIR$/ contains variables that are risky (**)&#xA;&#xA;Do you want to apply it? You can type&#xA;y  -- to apply the local variables list.&#xA;n  -- to ignore the local variables list.&#xA;&#xA;** LaTeX-command : &quot;lualatex -shell-escape&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't want to turn this feature off but I would like to be asked only once (during an emacs session) for a specific &lt;code&gt;.dir-locals.el&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using some plugins which want to parse the whole sourcetree and it is quite annoying to hit &lt;code&gt;y&lt;/code&gt; hundreds of times just to parse everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the actual question:  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can &lt;code&gt;emacs&lt;/code&gt;' local-variable loading mechanism be configure / modified such that it allows to allow / deny loading of a specific local variables list for the entirety of an &lt;code&gt;emacs&lt;/code&gt; session?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="448" LastActivityDate="2018-09-06T20:48:23.807" Title="Remember permission to execute &quot;risky&quot; local variables" Tags="|local-variables|directory-local-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10984" PostTypeId="1" AcceptedAnswerId="10985" CreationDate="2015-04-28T11:12:39.650" Score="1" ViewCount="392" Body="&lt;p&gt;I use this function in &lt;code&gt;init.el&lt;/code&gt; file so that I can switch to Arabic language when writing code in Arabic and select an Arabic font for that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun arabic-input-font ()&#xA;  &quot;changes the set-input-method to Arabic and selects another font&quot;&#xA;  (interactive)&#xA;  (set-input-method &quot;arabic&quot;)&#xA;  (face-remap-add-relative 'default :family &quot;Droid Arabic Naskh&quot; :height 110))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use any other Arabic font there is no problem. Problem arises &lt;em&gt;only&lt;/em&gt; when I choose this font &lt;code&gt;Droid Arabic Naskh&lt;/code&gt;, &lt;a href=&quot;http://openfontlibrary.org/en/font/droid-arabic-naskh#Droid%20Arabic%20Naskh-Regular&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt; of this font. I like this font for its clarity in writing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scratch buffer &lt;strong&gt;before&lt;/strong&gt; switching to this font:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/rQ07r.png&quot; alt=&quot;enter image description here&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scratch buffer &lt;strong&gt;after&lt;/strong&gt;:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/5oeh7.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use the following fonts for the three languages as fallback fonts for their respective languges:&#xA;English - &lt;code&gt;consolas&lt;/code&gt;&#xA;Arabic - &lt;code&gt;Droid Arabic Naskh&lt;/code&gt;&#xA;Hebrew - &lt;code&gt;SBL Hebrew&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will be very grateful for fixing this issue and let English script appears along with the Arabic one using this font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version: GNU Emacs 24.4.1 (i686-pc-mingw32)&lt;br&gt;&#xA;Windows platform&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2015-04-28T11:29:52.520" LastActivityDate="2015-04-28T11:39:57.270" Title="Text is shown as bounding boxes when I switch to Arabic input method and use a certain font" Tags="|fonts|faces|functions|input-method|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10985" PostTypeId="2" ParentId="10984" CreationDate="2015-04-28T11:39:57.270" Score="5" Body="&lt;p&gt;Emacs is stuck somewhere between not supporting font fallback at all and supporting fully automatic fallback.  As soon as you tell it to use a specific font, it will make use of this font's glyphs only, requiring you to explicitly set up fallback fonts with a fontset to display any extra glyphs not covered by it.  Your arabic font for example doesn't have any non-arabic glyphs, I assume that's why you get to see these funny boxes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your main font doesn't have the extra glyphs you wish to cover, it's possible to modify the default fontset of the current frame by appending the font covering the extra glyphs to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font &quot;fontset-default&quot; nil &quot;Droid Arabic Naskh&quot; nil 'append))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you wish to override a certain set of glyphs with your other font, you need to specify it explicitly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font &quot;fontset-default&quot; 'arabic &quot;Droid Arabic Naskh&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that if you're creating extra frames or use the Emacs daemon, you'll need to apply this invocation on both the initial frame and every subsequent one.  I recommend wrapping the invocation into a function using an optional argument and adding it to &lt;code&gt;after-make-frame-functions&lt;/code&gt;. Here's an example lifted from my own config that adds support for Emoji:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist '((font . &quot;DejaVu Sans Mono-10.5&quot;)))&#xA;(defun my-fix-emojis (&amp;amp;optional frame)&#xA;  (set-fontset-font &quot;fontset-default&quot; nil &quot;Symbola&quot; frame 'append))&#xA;(my-fix-emojis)&#xA;(add-hook 'after-make-frame-functions 'my-fix-emojis)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-04-28T11:39:57.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10986" PostTypeId="2" ParentId="10981" CreationDate="2015-04-28T12:32:28.620" Score="16" Body="&lt;p&gt;Just customise the variable &lt;code&gt;org-ellipsis&lt;/code&gt;.  Something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-ellipsis &quot;…&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-04-28T12:32:28.620" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10987" PostTypeId="2" ParentId="10981" CreationDate="2015-04-28T12:54:21.120" Score="8" Body="&lt;p&gt;Personally, instead of setting it only for Org, I do it globally with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless standard-display-table&#xA;  (setq standard-display-table (make-display-table)))&#xA;(when (fboundp 'make-glyph-code)&#xA;  (set-display-table-slot standard-display-table 4&#xA;                          (vector (make-glyph-code ?…)&#xA;                                  (make-glyph-code ?…))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-28T12:54:21.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10988" PostTypeId="2" ParentId="10981" CreationDate="2015-04-28T12:56:44.917" Score="9" Body="&lt;p&gt;You can change the characters more generally for selective display with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-display-table-slot standard-display-table &#xA;                        'selective-display (string-to-vector &quot; ◦◦◦ &quot;)) ; or whatever you like&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've been using these characters because I find them easier to see than the periods, and yet not too distracting.  To each their own, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got this from the &lt;a href=&quot;http://emacswiki.org/emacs/OutlineMode&quot;&gt;EmacsWiki&lt;/a&gt;: look for the section on &quot;Customizing Outline ellipsis&quot; for more details.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-04-28T12:56:44.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10989" PostTypeId="2" ParentId="10983" CreationDate="2015-04-28T13:00:51.897" Score="9" Body="&lt;p&gt;Emacs should offer (and normally does offer) the option to accept and remember the choice for later sessions.  I suggest you &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; about this missing choice in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the mean time, you can add the following to your &lt;code&gt;~/.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'safe-local-variable-values&#xA;             '(LaTeX-command . &quot;lualatex -shell-escape&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-28T13:00:51.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10990" PostTypeId="2" ParentId="10977" CreationDate="2015-04-28T13:46:02.510" Score="1" Body="&lt;p&gt;If you run Emacs on OS X, then it may have different environment variables values than the ones you see in terminal shell. You can check the value of PATH environment variable that Emacs process has by typing &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;getenv&lt;/code&gt; RET &lt;code&gt;PATH&lt;/code&gt;. Most likely you don't have &lt;code&gt;/usr/texbin&lt;/code&gt; in &lt;code&gt;PATH&lt;/code&gt; that &lt;code&gt;getenv&lt;/code&gt; will show you.  I run emacs from shell prompt on OS X like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ /usr/local/opt/emacs/Emacs.app/Contents/MacOS/Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to get the exact environment I have in shell. This path to Emacs works if you installed Emacs as a homebrew package.  Otherwise the path to emacs executable is likely to be different.  All other solutions don't quite work for me since upgrade to OS X 10.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess you could put the absolute path to &lt;code&gt;latexmk&lt;/code&gt; in the definition of &lt;code&gt;org-latex-to-pdf-process&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5443" LastActivityDate="2015-04-28T13:46:02.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10991" PostTypeId="2" ParentId="3380" CreationDate="2015-04-28T16:46:09.897" Score="0" Body="&lt;p&gt;These work on the latest version of &lt;code&gt;magit&lt;/code&gt; from Melpa (from &lt;strong&gt;master&lt;/strong&gt; branch) as tested today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While in the Magit Status window,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u j u&lt;/code&gt; - Jump to the &lt;strong&gt;u&lt;/strong&gt;nstaged section, expand it and bring that to the top of the buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u j s&lt;/code&gt; - Jump to the &lt;strong&gt;s&lt;/strong&gt;taged section, expand it and bring that to the top of the buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Similar action will apply to other &lt;code&gt;C-u j ..&lt;/code&gt; bindings in the &lt;code&gt;magit-section-jump-map&lt;/code&gt; too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://github.com/magit/magit/blob/40f33c9b8a0cd5ac39fdcca525dd734e7e79e1af/magit.el#L1710-L1720&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;magit.el&lt;/code&gt; in &lt;strong&gt;master&lt;/strong&gt; branch&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar magit-section-jump-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map (kbd &quot;z&quot;) 'magit-jump-to-stashes)&#xA;    (define-key map (kbd &quot;n&quot;) 'magit-jump-to-untracked)&#xA;    (define-key map (kbd &quot;u&quot;) 'magit-jump-to-unstaged)&#xA;    (define-key map (kbd &quot;s&quot;) 'magit-jump-to-staged)&#xA;    (define-key map (kbd &quot;f&quot;) 'magit-jump-to-unpulled)&#xA;    (define-key map (kbd &quot;p&quot;) 'magit-jump-to-unpushed)&#xA;    (define-key map (kbd &quot;r&quot;) 'magit-jump-to-pending)&#xA;    map)&#xA;  &quot;Submap for jumping to sections in `magit-status-mode'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Answer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;To answer your specific application to review the hunks in unstaged section, do &lt;code&gt;C-u j u&lt;/code&gt; in the Magit Status buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Applies to the magit master branch code; haven't tried out the next branch.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;An example workflow using these bindings&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x magit-status&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Stage the files you want using &lt;code&gt;s&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Expand the staged files showing the hunk diffs, while also positioning the top of the staged section to the top of the buffer: &lt;code&gt;C-u j s&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Commit &lt;code&gt;c c&lt;/code&gt;, opens COMMIT buffer &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/913c74477796a10dd01bb225e88fa423c312ad34/setup-files/setup-magit.el#L22-L30&quot; rel=&quot;nofollow&quot;&gt;in a split window&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Write log while reviewing staged diffs in other window. If diff exceeds the window height, I use the &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/913c74477796a10dd01bb225e88fa423c312ad34/setup-files/setup-windows-buffers.el#L308-L316&quot; rel=&quot;nofollow&quot;&gt;'scroll other window commands'&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Finish commit &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-04-28T20:14:12.770" LastActivityDate="2015-04-28T20:14:12.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10993" PostTypeId="1" AcceptedAnswerId="10994" CreationDate="2015-04-28T19:59:39.953" Score="1" ViewCount="157" Body="&lt;p&gt;Suppose that we have two functions &lt;code&gt;foo1&lt;/code&gt; and &lt;code&gt;foo2&lt;/code&gt;. I would like to write a third function &lt;code&gt;foo3&lt;/code&gt; in such a way that the first execution of &lt;code&gt;foo3&lt;/code&gt;results in the execution of &lt;code&gt;foo1&lt;/code&gt;, the second execution of &lt;code&gt;foo3&lt;/code&gt; results in the execution of &lt;code&gt;foo2&lt;/code&gt; and so on (i.e. the nth execution of &lt;code&gt;foo3&lt;/code&gt; results in the execution of &lt;code&gt;foo1&lt;/code&gt; if &lt;code&gt;n&lt;/code&gt; is odd, and results in the execution of &lt;code&gt;foo2&lt;/code&gt; if &lt;code&gt;n&lt;/code&gt; is even).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-04-28T20:32:15.233" LastActivityDate="2015-05-22T22:17:34.663" Title="How to write a function which toggles between the executions of two other functions?" Tags="|elisp|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10994" PostTypeId="2" ParentId="10993" CreationDate="2015-04-28T20:07:53.697" Score="3" Body="&lt;p&gt;You can create a state variable to keep track of which function you called most recently, and condition the call in the third function on its value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun fn1 ()&#xA;  (message &quot;Function 1&quot;))&#xA;&#xA;(defun fn2 ()&#xA;  (message &quot;Function 2&quot;))&#xA;&#xA;(defvar fn1-p nil)&#xA;&#xA;(defun fn3 ()&#xA;  (setf fn1-p (not fn1-p))&#xA;  (funcall (if fn1-p #'fn1 #'fn2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; as per @politza's suggestion, here's a way to do the toggle with a closure (compare the example in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html#Lexical-Binding&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setf lexical-binding t)                ; need to create a closure&#xA;(let (toggle)&#xA;  (setf fn4 (lambda ()&#xA;              (setf toggle (not toggle))&#xA;              (funcall (if toggle #'fn1 #'fn2)))))&#xA;(funcall fn4)                           ; =&amp;gt; &quot;Function 1&quot;&#xA;(funcall fn4)                           ; =&amp;gt; &quot;Function 2&quot;&#xA;(funcall fn4)                           ; =&amp;gt; &quot;Function 1&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-04-28T21:19:25.570" LastActivityDate="2015-04-28T21:19:25.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10995" PostTypeId="2" ParentId="10675" CreationDate="2015-04-28T20:10:47.787" Score="1" Body="&lt;p&gt;After many attempts to get rid of undefined... I ended up using a shell command and send all my Javascript to node and return just the result instead of a console.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested here is the code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key js-mode-map (kbd &quot;C-c C-c&quot;)&#xA;    #'(lambda ()  &#xA;       (interactive)&#xA;       (shell-command-on-region (point-min) (point-max) &quot;node&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="2223" LastEditDate="2015-04-28T22:35:01.417" LastActivityDate="2015-04-28T22:35:01.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10996" PostTypeId="1" AcceptedAnswerId="10997" CreationDate="2015-04-28T21:10:07.447" Score="4" ViewCount="568" Body="&lt;p&gt;One of the things that I love in Vim, was the faster way of insert double quotes (saves me hitting the shift key&quot; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; inoremap '' &quot;&quot;&amp;lt;Left&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when I press the single quote, and type further, I get the quote and the text, which I close with the closing quote, like &lt;code&gt;'foo bar'&lt;/code&gt;&#xA;But when I double tap the quote, I get double quotes instead, then I get &lt;code&gt;&quot;foo bar&quot;&lt;/code&gt;. Evil doesn't support if the next character after the single quote is not included in the configuration. I tried various ways to figure out how I could get this feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions how I could configure this feature in Elisp? (I'm using Evil mode by the way, if that helps). &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-08-25T17:48:27.543" Title="Any idea how turn quotes into double quotes?" Tags="|elisp|evil|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10997" PostTypeId="2" ParentId="10996" CreationDate="2015-04-28T21:16:49.137" Score="5" Body="&lt;p&gt;Sounds like a task for the &lt;a href=&quot;http://www.emacswiki.org/emacs/KeyChord&quot;&gt;KeyChord&lt;/a&gt; library. Presumably something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(key-chord-define-global &quot;''&quot; (lambda () (interactive) (insert &quot;\&quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or maybe:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(key-chord-define evil-insert-state-map &quot;''&quot; (lambda () (interactive) (insert &quot;\&quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-04-28T21:16:49.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10998" PostTypeId="2" ParentId="10993" CreationDate="2015-04-28T21:34:15.147" Score="3" Body="&lt;p&gt;In this instance I think I'd forgo using a separate variable or a lexical closure, and just use a property on the function symbol to track its own state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's Dan's answer adapted to that approach:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun fn1 ()&#xA;  (message &quot;Function 1&quot;))&#xA;&#xA;(defun fn2 ()&#xA;  (message &quot;Function 2&quot;))&#xA;&#xA;(defun fn3 ()&#xA;  (put 'fn3 'fn1-p (not (get 'fn3 'fn1-p)))&#xA;  (funcall (if (get 'fn3 'fn1-p) #'fn1 #'fn2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-04-28T21:34:15.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10999" PostTypeId="2" ParentId="10993" CreationDate="2015-04-28T23:08:34.927" Score="4" Body="&lt;p&gt;This answer is written to demonstrate the little-known &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Rings.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ring&lt;/code&gt;&lt;/a&gt; data structure available in Emacs' built-ins:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun function-1 () (print &quot;Function 1&quot;))&#xA;&#xA;(defun function-2 () (print &quot;Function 2&quot;))&#xA;&#xA;(defun function-3 () (print &quot;Function 3&quot;))&#xA;&#xA;(defvar functions (let ((result (make-ring 3)))&#xA;                    (ring-insert result 'function-1)&#xA;                    (ring-insert result 'function-2)&#xA;                    (ring-insert result 'function-3)&#xA;                    result))&#xA;&#xA;(defun cycle-functions ()&#xA;  (funcall&#xA;   (ring-insert functions&#xA;                (ring-ref functions&#xA;                          (1- (ring-size functions))))))&#xA;&#xA;(with-output-to-string&#xA;  (cl-loop repeat 10 do (cycle-functions)))&#xA;&quot;&#xA;\&quot;Function 1\&quot;&#xA;&#xA;\&quot;Function 2\&quot;&#xA;&#xA;\&quot;Function 3\&quot;&#xA;&#xA;\&quot;Function 1\&quot;&#xA;&#xA;\&quot;Function 2\&quot;&#xA;&#xA;\&quot;Function 3\&quot;&#xA;&#xA;\&quot;Function 1\&quot;&#xA;&#xA;\&quot;Function 2\&quot;&#xA;&#xA;\&quot;Function 3\&quot;&#xA;&#xA;\&quot;Function 1\&quot;&#xA;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The difference between this and other answers is that here you have the data structure to manipulate, which means that you can program a change in the order of execution of functions, whereas in other suggested answers this isn't an option. Whether you need that or not, is, of course, up to you.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-04-29T12:49:11.650" LastActivityDate="2015-04-29T12:49:11.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11000" PostTypeId="2" ParentId="10996" CreationDate="2015-04-28T23:57:23.247" Score="5" Body="&lt;p&gt;You will want to bind the &lt;code&gt;'&lt;/code&gt; key to a function that performs different activities the first and the second time it is called.  This is done by checking the variable &lt;code&gt;last-command&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-single-quote ()&#xA;  (interactive)&#xA;  (cond&#xA;    ((and (eq last-command 'insert-single-quote) (eql (char-before) ?'))&#xA;     (delete-backward-char 1) (insert &quot;\&quot;&quot;))&#xA;    (t (insert &quot;'&quot;))))&#xA;&#xA;(global-set-key &quot;'&quot; #'insert-single-quote)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="160" LastEditDate="2015-05-22T22:17:25.043" LastActivityDate="2015-05-22T22:17:25.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11001" PostTypeId="1" CreationDate="2015-04-29T03:01:41.493" Score="3" ViewCount="2551" Body="&lt;p&gt;What is the best solution for writing Makefile, GNU Makefile specifically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FILES:= file0.cpp          \&#xA;        file1.cpp          \&#xA;        file2.cpp          \&#xA;        fileYetAnother.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After typing the first &lt;code&gt;\&lt;/code&gt;(or after saving the buffer), and &lt;code&gt;ENTER&lt;/code&gt;, I want the file1.cpp to align with the file0.cpp, do not mind the &lt;code&gt;\&lt;/code&gt; at the end of each line, I can use &lt;code&gt;align-regexp&lt;/code&gt; to align all of them after finished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it turns out this by default:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FILES:= file0.cpp  \&#xA;file1.cpp          \&#xA;file2.cpp          \&#xA;fileYetAnother.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know I can define my own indentation like &lt;a href=&quot;https://emacs.stackexchange.com/a/3644/794&quot;&gt;Customizing indentation in makefile mode?&lt;/a&gt;, but it will fix the indentation to number like 4, that is not smart for different situations, what if the &lt;code&gt;FILES&lt;/code&gt; word is long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides it does not work for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;all:&#xA;        gcc ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have to type &lt;code&gt;C-q TAB&lt;/code&gt; to indent the &lt;code&gt;gcc ...&lt;/code&gt; line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another problem for this kind of situation, by default, if you keep typing &lt;code&gt;TAB&lt;/code&gt; below the &lt;code&gt;all:&lt;/code&gt; line and then type the real commands for &lt;code&gt;all&lt;/code&gt;, Emacs will keep inserting &lt;code&gt;Tab&lt;/code&gt; when typing &lt;code&gt;TAB&lt;/code&gt;, AFAIK, it must be 8 spaces (a &lt;code&gt;Tab&lt;/code&gt; exactly） at the beginning of the command line after &lt;code&gt;all&lt;/code&gt;, so typing multiple typing-&lt;code&gt;TAB&lt;/code&gt;s should only remain one &lt;code&gt;TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any package to handle all the messed up format in the Makefile, or you just do that manually?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-06-27T00:24:13.227" Title="Indentation in makefile: alignment in multi-line assignments" Tags="|makefile-mode|indentation|" AnswerCount="0" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="11002" PostTypeId="2" ParentId="10993" CreationDate="2015-04-29T03:52:48.277" Score="1" Body="&lt;p&gt;FWIW, here's the kind of way this kind of thing is usually done in existing Elisp packages (tho for repeated interactive execution of a command rather than just for repeated calls to a function):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (if (eq this-command last-command)&#xA;      (progn&#xA;        (setq this-command 'foo2)&#xA;        &amp;lt;foo2-behavior&amp;gt;)&#xA;    &amp;lt;foo1-behavior&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="160" LastEditDate="2015-05-22T22:17:34.663" LastActivityDate="2015-05-22T22:17:34.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11003" PostTypeId="1" AcceptedAnswerId="11057" CreationDate="2015-04-29T05:09:41.753" Score="3" ViewCount="1013" Body="&lt;p&gt;Is there a hook that would run as soon as control returns to the user (i.e. to the command loop)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Context: I'd like to register a function to run as soon as all functions in the current sequence of recursive calls have exited. The call stack looks like &#xA;&lt;code&gt;... -&amp;gt; a -&amp;gt; b -&amp;gt; ... -&amp;gt; my function&lt;/code&gt;, and I would like my function to run when all functions on the stack have exited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More context: Somewhere up in the call chain to &lt;code&gt;my function&lt;/code&gt; there is a function &lt;code&gt;f&lt;/code&gt; that is ill-behaved, insofar as I can't call it from one of its children (it needs to do some cleanup before I can call it again). Since I can't call &lt;code&gt;f&lt;/code&gt; from &lt;code&gt;my function&lt;/code&gt;, I'd like to register the call to &lt;code&gt;f&lt;/code&gt; to run as soon as &lt;code&gt;f&lt;/code&gt; has completed.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-04-30T20:59:42.423" Title="Run a function after control returns to the command loop" Tags="|elisp|hooks|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11004" PostTypeId="2" ParentId="11003" CreationDate="2015-04-29T05:48:14.823" Score="2" Body="&lt;p&gt;As lawlist says, you can use &lt;code&gt;post-command-hook&lt;/code&gt; for that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But another option might be to add an advice to the offending function.  Along the lines of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'f :after&#xA;            (lambda (&amp;amp;rest args)&#xA;              &amp;lt;do-something-after-f-runs&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-29T05:48:14.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11005" PostTypeId="1" AcceptedAnswerId="11010" CreationDate="2015-04-29T08:14:00.040" Score="7" ViewCount="1059" Body="&lt;p&gt;I found the package &lt;a href=&quot;http://emacswiki.org/emacs/AutomaticFileHeaders&quot;&gt;Automatic File Headers&lt;/a&gt;, I cheered and installed it with MELPA. &#xA;I have found file headers to be very valuable in project development.  I always know who has been where and how many times they were there. Most often, I also know what they did. The update count and last modified date are very useful in determining the proper version of a file to use.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one thing that I couldn't figure it out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, after installing &lt;code&gt;header2&lt;/code&gt; from MELPA, declare it in your dot-emacs: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; To have Emacs update file headers automatically whenever you save a&#xA;;; file, put this in your init file (~/.emacs):&#xA;&#xA;(autoload 'auto-update-file-header &quot;header2&quot;)&#xA;(add-hook 'write-file-hooks 'auto-update-file-header)&#xA;&#xA;;; To have Emacs add a file header whenever you create a new file in&#xA;;; some mode, put this in your init file (~/.emacs):&#xA;&#xA;(autoload 'auto-make-header &quot;header2&quot;)&#xA;(add-hook 'emacs-lisp-mode-hook 'auto-make-header)&#xA;(add-hook 'c-mode-common-hook   'auto-make-header)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when you create a new file in Emacs, for example foobar.el. You see a header. And it will automatically update when you write the file. Okay, let's assume I would like to change the text &lt;code&gt;Last-Updated:&lt;/code&gt; into &lt;code&gt;Foo-Last-Updated&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I did a grep on &lt;code&gt;Last-Updated&lt;/code&gt; from the package &lt;code&gt;header2&lt;/code&gt; and replaced all occurences with &lt;code&gt;Foo-Last-Updated&lt;/code&gt;. I restarted Emacs to be sure. And there is still &lt;code&gt;Last-Updated&lt;/code&gt; displayed instead &lt;code&gt;Foo-Last-Updated&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion, in order to change the header contents? I found nothing in the manuals.  &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="253" LastEditDate="2015-04-29T09:43:36.587" LastActivityDate="2016-02-23T19:27:11.143" Title="How change the contents of a package (header2.el)?" Tags="|package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11006" PostTypeId="2" ParentId="10933" CreationDate="2015-04-29T08:59:10.533" Score="1" Body="&lt;p&gt;I would make this a comment, but I don't have enough rep so here goes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out this function: org-activate-plain-links (in org.el).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can modify the function around the 'add-text-properties', doing a match on each link using a cond for instance.&#xA;I have student supervision now, but if you don't succeed in doing this, I'll add more information later.&lt;/p&gt;&#xA;" OwnerUserId="7019" LastActivityDate="2015-04-29T08:59:10.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11007" PostTypeId="1" CreationDate="2015-04-29T09:20:24.490" Score="1" ViewCount="71" Body="&lt;p&gt;Is there a way to generate data structure overviews like the &lt;a href=&quot;http://texdoc.net/texmf-dist/doc/latex/bytefield/bytefield.pdf&quot; rel=&quot;nofollow&quot;&gt;bytefield package for latex&lt;/a&gt; with plain tables? (I.e. I don't want to fall back to LaTeX)&lt;/p&gt;&#xA;" OwnerUserId="5417" LastEditorUserId="14825" LastEditDate="2022-11-05T01:18:26.087" LastActivityDate="2022-11-05T01:18:26.087" Title="org-mode: Something like bytefield package" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11008" PostTypeId="1" AcceptedAnswerId="11011" CreationDate="2015-04-29T09:30:53.677" Score="6" ViewCount="2699" Body="&lt;p&gt;In my Emacs I have set &lt;code&gt;browse-url-browser-function&lt;/code&gt; to &lt;code&gt;eww&lt;/code&gt; and &lt;code&gt;org-open-at-point&lt;/code&gt; (&lt;code&gt;org-return&lt;/code&gt;) will open my links using &lt;code&gt;eww&lt;/code&gt; as expected.  However, I would like to configure &lt;code&gt;org-mode&lt;/code&gt; so that when I press prefix + return (&lt;code&gt;C-u RET&lt;/code&gt;) the link is opened using an external browser instead, is this possible without modifying &lt;code&gt;org-open-at-point&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already have a helper function, &lt;code&gt;user/browse-url-external&lt;/code&gt;, that I use in other modes to open URL at-point in an external browser instead of &lt;code&gt;eww&lt;/code&gt;.  It doesn't work with links in &lt;code&gt;org-mode&lt;/code&gt; since &lt;code&gt;browse-url&lt;/code&gt; only sees the descriptive text and not the hyperlink.&lt;/p&gt;&#xA;" OwnerUserId="457" LastActivityDate="2021-03-19T09:28:15.753" Title="Can org-mode open a link in external browser when using prefix key?" Tags="|org-mode|web-browser|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11010" PostTypeId="2" ParentId="11005" CreationDate="2015-04-29T12:53:55.797" Score="4" Body="&lt;h2&gt;Customizing &lt;code&gt;header2&lt;/code&gt; headers&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From the documentation in &lt;a href=&quot;http://www.emacswiki.org/emacs/header2.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;header2.el&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Define individual header elements.  These are the building blocks used to construct a site specific header.  You may add your own functions either in this file or in your &lt;code&gt;.emacs&lt;/code&gt; file.  The variable &lt;code&gt;make-header-hook&lt;/code&gt; specifies the functions that will actually be called.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is an example of how to customize the header to your liking:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'header2)&#xA;&#xA;(defsubst my/header-timestamp ()&#xA;  &quot;Insert field for timestamp&quot;&#xA;  (insert header-prefix-string  &quot;Time-stamp: &amp;lt;&amp;gt;\n&quot;))&#xA;&#xA;(defsubst my/header-projectname ()&#xA;  &quot;Insert Project Name&quot;&#xA;  (insert header-prefix-string &quot;Project    : &quot;&#xA;          (when (featurep 'projectile)&#xA;            (replace-regexp-in-string &quot;/proj/\\(.*?\\)/.*&quot;&#xA;                                      &quot;\\1&quot;&#xA;                                      (projectile-project-root)))&#xA;          &quot;\n&quot;))&#xA;&#xA;(defsubst my/header-description ()&#xA;  &quot;Insert \&quot;Description: \&quot; line.&quot;&#xA;  (insert header-prefix-string &quot;Description: \n&quot;))&#xA;&#xA;(defsubst my/header-dash-line ()&#xA;  &quot;Insert dashed line&quot;&#xA;  (insert header-prefix-string)&#xA;  (insert-char ?- fill-column)&#xA;  (insert &quot;\n&quot;))&#xA;&#xA;(setq make-header-hook '(my/header-timestamp&#xA;                         header-blank&#xA;                         my/header-dash-line&#xA;                         my/header-projectname&#xA;                         header-file-name&#xA;                         header-author&#xA;                         my/header-description&#xA;                         my/header-dash-line))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook #'auto-make-header)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Modifying the packages directly&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In general this is not recommended because if you like to update the packages using the package manager then your edits will be lost when the package updates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from version 24.4 of emacs, you can add the below to your emacs init at very beginning before you start loading packages. That will ensure that always the newest file is loaded (be it a .el or .elc file).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq load-prefer-newer t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you don't have that, by default, the .elc file is loaded if present (and the .el is ignored).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But again, try not to edit the package .el files directly.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;More info&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Inline-Functions.html&quot; rel=&quot;nofollow&quot;&gt;Inline Functions (&lt;code&gt;defsubst&lt;/code&gt;)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-header2.el&quot; rel=&quot;nofollow&quot;&gt;My setup for &lt;code&gt;header2&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-02-23T19:27:11.143" LastActivityDate="2016-02-23T19:27:11.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11011" PostTypeId="2" ParentId="11008" CreationDate="2015-04-29T12:58:09.317" Score="8" Body="&lt;p&gt;That's not directly possible, since &lt;code&gt;org-open-at-point&lt;/code&gt; already uses the prefix argument for something else.  But of course there's nothing preventing you from wrapping &lt;code&gt;org-open-at-point&lt;/code&gt; with your own code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-open-at-point (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (if (not arg)&#xA;      (org-open-at-point)&#xA;      (let ((browse-url-browser-function #'browse-url-chromium))&#xA;        (org-open-at-point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and binding it to &lt;code&gt;C-c C-o&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c C-o&quot;) #'my-org-open-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I didn't just advise &lt;code&gt;org-open-at-point&lt;/code&gt;, since I'm a little nervous about changing its behaviour — it might break some other parts of &lt;em&gt;Org&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="115" LastEditDate="2015-04-29T13:14:31.613" LastActivityDate="2015-04-29T13:14:31.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11012" PostTypeId="2" ParentId="10940" CreationDate="2015-04-29T13:21:59.140" Score="1" Body="&lt;p&gt;Connecting as &lt;code&gt;nil@nil&lt;/code&gt; is something that would happen if you type &lt;code&gt;M-x jabber-connect&lt;/code&gt; and hit &lt;code&gt;RET&lt;/code&gt; at the prompt.  (This is a bug.) &lt;code&gt;jabber-connect&lt;/code&gt; lets you specify any JID to connect as, and only uses &lt;code&gt;jabber-account-list&lt;/code&gt; as a source for tab completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;code&gt;M-x jabber-connect-all&lt;/code&gt; instead; it will pick up any and all accounts specified in &lt;code&gt;jabber-account-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The byte compiler error sounds exciting, but it might not be directly related.)&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-04-29T13:21:59.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11013" PostTypeId="2" ParentId="10949" CreationDate="2015-04-29T13:43:55.603" Score="2" Body="&lt;p&gt;BTW, with respect to performance, yes it can make a measurable difference in some circumstances (because this variable controls the lookup of the &lt;code&gt;point-entered&lt;/code&gt;, &lt;code&gt;point-left&lt;/code&gt;, and &lt;code&gt;intangible&lt;/code&gt; text-properties, which is done every time &lt;code&gt;point&lt;/code&gt; is changes, i.e. for every call to &lt;code&gt;goto-char&lt;/code&gt; or any other function which moves &lt;code&gt;point&lt;/code&gt;, and such movements can happen thousands of times in a single command).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, my recent activity around this subject was triggered by a complaint about a performance problem which can be significantly reduced by setting &lt;code&gt;inhibit-point-motion-hooks&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-29T13:43:55.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11015" PostTypeId="1" CreationDate="2015-04-29T14:55:46.440" Score="2" ViewCount="185" Body="&lt;p&gt;I am using gnus to read my email and the current setting for the gnus-summary-line-format in my .gnus.el is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-summary-line-format &#xA;  &quot;%U%~(pad-left 5)R: %~(max-right 25)D | %~(pad-right 25)~(max-right 25)a | %~(max-right 50)s \n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to modify this setting in order to show a short preview of each article in the summary buffer (say the first line, or the first x characters of the corresponding email) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is raised in &lt;a href=&quot;http://www.emacswiki.org/emacs/GnusGmail#toc17&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki&lt;/a&gt; but I could not find answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help&lt;/p&gt;&#xA;" OwnerUserId="7184" LastActivityDate="2015-04-29T14:55:46.440" Title="Add an article preview to the gnus-summary-line-format" Tags="|buffers|gnus|email|previewing|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11016" PostTypeId="2" ParentId="10940" CreationDate="2015-04-29T15:08:36.773" Score="1" Body="&lt;p&gt;I use that same gist to connect and had some troubles. Very different troubles, but troubles none the less. I needed to set certain ssl variable values, and add some options to the account as follows in order to get connected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ssl-program-name &quot;gnutls-cli&quot;&#xA;      ssl-program-arguments '(&quot;--insecure&quot; &quot;-p&quot; service host)&#xA;      ssl-certificate-verification-policy 1)&#xA;&#xA;(setq jabber-account-list `((&quot;xxxxxx_yyyyyyy@chat.hipchat.com&quot; (:port . 5223) (:connection-type . ssl))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-04-29T15:08:36.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11018" PostTypeId="1" AcceptedAnswerId="11034" CreationDate="2015-04-29T16:27:03.277" Score="2" ViewCount="180" Body="&lt;p&gt;I use Emacs in a terminal window on Linux, using the &lt;code&gt;--no-window-system&lt;/code&gt; option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prior to version 24, if I clicked the middle mouse button in another application window, it would paste the last-killed region into that application via the X Windows primary selection. In version 24 this no long works; it appears that killing a region does not add that region to the X primary selection when Emacs is run from the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When killing a region in the GUI version the region is added to the primary selection, but I would like to be able to use this feature while running Emacs in the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I add to my &lt;code&gt;~/.emacs&lt;/code&gt; file to make this work again?&lt;/p&gt;&#xA;" OwnerUserId="7189" LastActivityDate="2015-04-30T06:12:10.380" Title="How to add killed region to X Window primary selection" Tags="|x11|clipboard|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11020" PostTypeId="1" AcceptedAnswerId="11021" CreationDate="2015-04-29T18:22:25.960" Score="4" ViewCount="609" Body="&lt;p&gt;This might be a trivial issue, but here goes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to search (&lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;M-C-s&lt;/code&gt; for regexp search) often, and I want to be able to search in the buffer I'm in - jumping up and down (&lt;code&gt;C-r&lt;/code&gt;, &lt;code&gt;C-s&lt;/code&gt;) between the results found, but I also want an easy way to get back to the minibuffer to edit the search and start over again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the easiest way to do this without having to use the mouse to click the minibuffer and edit the search query term?  Ideally, I'd have some key-combination that takes me back to the minibuffer to edit the search, and then the standard &lt;code&gt;C-s&lt;/code&gt; to start the search results again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Right now, I'm doing&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Trigger search: &lt;code&gt;C-s&lt;/code&gt; or &lt;code&gt;M-C-s&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Type query, &lt;code&gt;C-s&lt;/code&gt; and jump through results.  Notice that I should search for something similar but different (ie- &lt;em&gt;I need to edit my current search term&lt;/em&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-f&lt;/code&gt; to get out of searching (just so I can go back to searching again).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s&lt;/code&gt; to search again, &lt;code&gt;M-p&lt;/code&gt; to pull the last result, edit and &lt;code&gt;C-s&lt;/code&gt; again.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'd love a way to short-circuit steps 3 &amp;amp; 4.  All in an effort to not use the mouse.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-04-29T18:56:01.067" Title="How to get back to minibuffer during an interactive search?" Tags="|search|minibuffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11021" PostTypeId="2" ParentId="11020" CreationDate="2015-04-29T18:25:02.570" Score="7" Body="&lt;p&gt;You can hit &lt;code&gt;M-e&lt;/code&gt; to edit the current search term. This runs the command &lt;code&gt;isearch-edit-string&lt;/code&gt;. You can then type &lt;code&gt;C-s&lt;/code&gt; to resume the search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a list of all key bindings available during isearch, type &lt;code&gt;C-s&lt;/code&gt; (to enter isearch) and then &lt;code&gt;C-h b&lt;/code&gt;. You can also get some documentation by typing &lt;code&gt;C-s C-h m&lt;/code&gt; (&lt;code&gt;describe-mode&lt;/code&gt;). Here's some basic key bindings from that documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEL:       cancel last input item from end of search string.&#xA;RET:       exit, leaving point at location found.&#xA;LFD (C-j): to match end of line.&#xA;C-s:       search again forward, C-r to search again backward.&#xA;C-w:       yank next word or character in buffer onto the end of the search&#xA;    string, and search for it.&#xA;C-M-w:     delete character from end of search string.&#xA;C-M-y:     yank char from buffer onto end of search string and search for it.&#xA;M-s C-e:   yank rest of line onto end of search string and search for it.&#xA;C-y:       yank the last string of killed text.&#xA;M-y:       replace string just yanked into search prompt with string killed&#xA;    before it.&#xA;C-q:       quote control character to search for it.&#xA;C-x 8 RET: add a character to search by Unicode name, with completion.&#xA;C-g:       while searching or when search has failed cancels input back to what&#xA;    has been found successfully.&#xA;&#xA;C-g:       when search is successful aborts and moves point to starting point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As aside, please note that isearch does not actually use the minibuffer; it only appears to. It actually uses the echo area.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-04-29T18:56:01.067" LastActivityDate="2015-04-29T18:56:01.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11022" PostTypeId="1" CreationDate="2015-04-29T18:36:47.057" Score="2" ViewCount="538" Body="&lt;p&gt;In elisp, how can I tell whether the org heading under point is a leaf node or whether it has child headings? I've found &lt;code&gt;org-list-has-child-p&lt;/code&gt;, but I'm having trouble delivering the struct to the function.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-04-29T19:07:10.577" Title="Determine if an org heading has children" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11023" PostTypeId="2" ParentId="11020" CreationDate="2015-04-29T18:55:04.547" Score="1" Body="&lt;p&gt;@Nanny's answer tells you about editing the search string and then resuming searching with the edited string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question is not too clear to me, but here is some other info about ways to temporarily stopping your current search, doing something else, and then resuming that search.  Perhaps it is relevant to what you are trying to do and will help.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use &lt;code&gt;M-p&lt;/code&gt; and &lt;code&gt;M-n&lt;/code&gt; to cycle to previously used search strings. So you can search for &lt;code&gt;foo&lt;/code&gt;, bouncing around looking at its search hits, and then use &lt;code&gt;M-p&lt;/code&gt; (repeat to get to older search strings) to retrieve a previous search string and search for that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you just want to be able to scroll past the current set of highlighted search hits, and then come back and resume where you left off, you can do that by setting option &lt;code&gt;isearch-allow-scroll&lt;/code&gt; to non-nil.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;Isearch+&lt;/a&gt; then you can use &lt;code&gt;C-x o&lt;/code&gt; while searching, to enter a recursive edit. In the recursive edit you can do anything you like (you have left Isearch), including search for something else. You end the recursive edit using &lt;code&gt;C-]&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-29T18:55:04.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11024" PostTypeId="2" ParentId="11022" CreationDate="2015-04-29T19:04:30.003" Score="4" Body="&lt;p&gt;You could try &lt;code&gt;org-goto-first-child&lt;/code&gt; (inside &lt;code&gt;save-excursion&lt;/code&gt;, so you don't actually move the point) and see if it returned &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-has-child-p ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (org-goto-first-child)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2290" LastEditorUserId="654" LastEditDate="2015-04-29T19:07:10.577" LastActivityDate="2015-04-29T19:07:10.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11025" PostTypeId="1" CreationDate="2015-04-29T19:12:13.107" Score="8" ViewCount="11035" Body="&lt;p&gt;I am installing Emacs 24.5.0, and I want to install it with X. I am on Fedora. the configuration script cannot find any x-toolkit. How do I find out which one is good for me, and in which folder do I find it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhere I have read that the x-toolkit for fedora should be gtk. How can I check if and where this library is installed?&lt;/p&gt;&#xA;" OwnerUserId="5445" LastEditorUserId="262" LastEditDate="2019-10-25T15:18:40.477" LastActivityDate="2019-10-25T15:18:40.477" Title="installing emacs: which x-toolkit?" Tags="|display|linux|install|build|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11026" PostTypeId="1" CreationDate="2015-04-29T21:01:57.977" Score="5" ViewCount="1238" Body="&lt;p&gt;Is there a pre-defined emacs function or emacs add-on package that will fill a rectangle with numbers?  For example:&#xA;&lt;code&gt;&#xA;012       9 &#xA;010  or  10 &#xA;008      11 &#xA;&lt;/code&gt;&#xA;The closest I've found is &lt;code&gt;rectangle-number-lines&lt;/code&gt;, which seems to have limitations.&#xA;If I'm not mistaken, it doesn't allow decreasing numbers and forces step-value=1 &#xA;(e.g. can't have 1, 3, 5).&lt;/p&gt;&#xA;" OwnerUserId="7145" LastEditorUserId="253" LastEditDate="2015-04-29T21:04:27.687" LastActivityDate="2015-05-22T22:19:32.120" Title="numeric rectangular fill" Tags="|elisp|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11027" PostTypeId="1" CreationDate="2015-04-29T21:09:24.050" Score="1" ViewCount="141" Body="&lt;p&gt;I really like easy-menu but have discovered an item separator problem; a minimum working example is given below.  When I hybrid &lt;code&gt;define-key-after&lt;/code&gt; with &lt;code&gt;easy-menu-add-item&lt;/code&gt;, the item separators in the &amp;quot;Words and Lines&amp;quot; submenu are fine.  However in the primary menu, &amp;quot;My-XEditing&amp;quot;, the second item separator is missing.&lt;/p&gt;&#xA;&lt;p&gt;Apparently, using this approach, easy-menu will only allow one item separator in the primary menu.  Since this is the only easy-menu problem that I have, I want to avoid having to delve through elisp (keymaps).  My guess is that a workaround might be found by grafting on &lt;code&gt;easy-menu-define&lt;/code&gt;, but I can't figure out how.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-key-after global-map [menu-bar my-xediting]&#xA;    (cons &amp;quot;My-XEditing&amp;quot; (make-sparse-keymap &amp;quot;My-XEditing&amp;quot;)))&#xA;(easy-menu-add-item nil '(&amp;quot;My-XEditing&amp;quot;) &#xA;    [&amp;quot;Move Character Forward&amp;quot; forward-char t])&#xA;(easy-menu-add-item nil '(&amp;quot;My-XEditing&amp;quot;) &amp;quot;--&amp;quot;)&#xA;(easy-menu-add-item nil '(&amp;quot;My-XEditing&amp;quot;) &#xA;    [&amp;quot;Move Character Backward&amp;quot; backward-char t])&#xA;(easy-menu-add-item nil '(&amp;quot;My-XEditing&amp;quot;) &amp;quot;--&amp;quot;)&#xA;(easy-menu-add-item nil '(&amp;quot;My-XEditing&amp;quot;)&#xA;    (easy-menu-create-menu &amp;quot;Words and Lines&amp;quot;&#xA;        '([&amp;quot;Move Word Backward&amp;quot; backward-word t]&#xA;        &amp;quot;--&amp;quot;&#xA;        [&amp;quot;Move Word Forward&amp;quot; forward-word t]&#xA;        &amp;quot;--&amp;quot;&#xA;        [&amp;quot;Move Line Backward&amp;quot; previous-line t]&#xA;        &amp;quot;--&amp;quot;&#xA;        [&amp;quot;Move Line Forward&amp;quot; next-line t])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7145" LastEditorUserId="17507" LastEditDate="2021-01-12T00:05:46.347" LastActivityDate="2021-01-12T00:05:46.347" Title="easy-menu primary menu separator problem" Tags="|keymap|menu-bar|easy-menu|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="11028" PostTypeId="1" AcceptedAnswerId="11030" CreationDate="2015-04-29T21:12:42.940" Score="1" ViewCount="310" Body="&lt;p&gt;Suppose I select some text in an emacs buffer using point and mark.&#xA;How do I tell emacs to replace each non-whitespace character with &lt;code&gt;x&lt;/code&gt;, say? For concreteness, that I select the text using point and mark.&#xA;Also, for clarity, I consider newlines to be whitespace for the purpose of this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to keep the structure of the text intact, but remove all information. My current use case is a LaTeX MWE document.&lt;/p&gt;&#xA;" OwnerUserId="100" LastEditorUserId="100" LastEditDate="2015-04-29T21:38:00.940" LastActivityDate="2015-04-29T21:38:00.940" Title="Anonymizing text using emacs (replace all non-whitespace characters by x)" Tags="|replace|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11029" PostTypeId="2" ParentId="11026" CreationDate="2015-04-29T21:26:46.367" Score="4" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt; and the function &lt;code&gt;mc/insert-numbers&lt;/code&gt; to do most of what you want (I don't think you can set the step). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pipes are cursors.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|&#xA;|&#xA;|&#xA;|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After running &lt;code&gt;mc/insert-numbers&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0|&#xA;1|&#xA;2|&#xA;3|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;C-4 C-2 mc/insert-numbers&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;42|&#xA;43|&#xA;44|&#xA;45|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-04-29T21:26:46.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11030" PostTypeId="2" ParentId="11028" CreationDate="2015-04-29T21:28:16.543" Score="6" Body="&lt;p&gt;Use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html#Regexp-Replace&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;M-x replace-regexp&lt;/code&gt;&lt;/a&gt; to replace all non-whitespace characters by &lt;code&gt;x&lt;/code&gt;. You can use &lt;code&gt;C-M-%&lt;/code&gt; to run &lt;code&gt;query-replace-regexp&lt;/code&gt; and, once a match is found, press &lt;code&gt;!&lt;/code&gt; to replace all matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for a regexp that matches non-whitespace characters. You'd think that the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Char-Classes.html#Char-Classes&quot; rel=&quot;nofollow noreferrer&quot;&gt;character class&lt;/a&gt; &lt;code&gt;[:space:]&lt;/code&gt; would match whitespace characters, and so you'd use &lt;code&gt;[^[:space:]]&lt;/code&gt; as the regexp to mean “any non-whitespace character”. But in LaTeX mode, newlines have the “comment end” syntax instead of the “whitespace” syntax, so they don't count as whitespace for the purpose of &lt;code&gt;[:space:]&lt;/code&gt;. So you need to use the regexp&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[^[:space:]&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To enter a newline in the regexp, press &lt;code&gt;C-q C-j&lt;/code&gt;: the command &lt;code&gt;C-q&lt;/code&gt; means to enter the next character literally instead of interpreting it as a command, and &lt;code&gt;C-j&lt;/code&gt; (not the &lt;code&gt;C-m&lt;/code&gt; character that the &lt;kbd&gt;Enter&lt;/kbd&gt; key sends) is the newline character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, you type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-regexp RET&#xA;[^[:space:] C-q C-j ] RET&#xA;x RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this replaces all non-whitespace, including LaTeX commands, comments, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why not use &lt;a href=&quot;https://tex.stackexchange.com/tags/lipsum&quot;&gt;lipsum&lt;/a&gt; instead?&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2015-04-29T21:28:16.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11031" PostTypeId="2" ParentId="11026" CreationDate="2015-04-29T22:38:05.950" Score="5" Body="&lt;p&gt;Here's a way to do this using Calc:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x * c&lt;/kbd&gt; launches the calculator.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v x&lt;/kbd&gt; ask to create a vector of a given length.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;10 RET&lt;/kbd&gt; let it be ten elements long (for example).&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;P *&lt;/kbd&gt; multiply all numbers by Pi (again, just an example).&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v u&lt;/kbd&gt; unpacks the vector into the stack.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u 0 y&lt;/kbd&gt; copy the entire stack back into the last active buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This might look like a lot of operations to do, but really, if you are used to Calc, then it takes less than a few seconds to do it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Below is the result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;3.14159265359&#xA;6.28318530718&#xA;9.42477796077&#xA;12.5663706144&#xA;15.707963268&#xA;18.8495559215&#xA;21.9911485751&#xA;25.1327412287&#xA;28.2743338823&#xA;31.4159265359&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-04-29T22:38:05.950" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11032" PostTypeId="2" ParentId="11026" CreationDate="2015-04-30T02:42:51.057" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/abo-abo/tiny&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;tiny&lt;/code&gt;&lt;/a&gt; package might suit your needs, which is also available through Melpa.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How to use &lt;code&gt;tiny-expand&lt;/code&gt;?&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Write a little &lt;code&gt;snippet&lt;/code&gt; following the below general format&lt;/li&gt;&#xA;&lt;li&gt;With point at the end of that snippet, &lt;code&gt;M-x tiny-expand&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;General Format&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; General Format&#xA;;; mBSEO|F&#xA;;;  ||||||&#xA;;;  |||||+--&amp;gt; (optional) Format - %x | 0x%x | %c | %s | %(+ x x) | %014.2f | %03d | %(date &quot;Jan 16&quot; (* x 7))&#xA;;;  ||||+---&amp;gt; (optional) Pipe character to separate Format for reading clarity&#xA;;;  |||+----&amp;gt; (optional) Operator - *xx | (* x x) | (+ x ?A) | *2+3x | (* 2 (+ 3 x))&#xA;;;  ||+-----&amp;gt; End value&#xA;;;  |+------&amp;gt; (optional) Separator - Space | , | \n (default=Space)&#xA;;;  +-------&amp;gt; (optional) Begin value (default=0)&#xA;;; - No space allowed between 'm' and 'B'&#xA;;; - No space allowed between 'E' and 'O'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Following the above general format, here is how you can get a column of numbers with different increments, starting number, end number, etc&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Type any of the below snippets in the buffer&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Numbers starting with 0, incrementing by 1: &lt;code&gt;m0\n10&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Numbers starting with 0, incrementing by 2: &lt;code&gt;m0\n10*2x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Numbers starting with 1, incrementing by 2: &lt;code&gt;m0\n10+1*2x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x tiny-expand&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-tiny.el&quot; rel=&quot;nofollow&quot;&gt;More of my notes on using this package&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-04-30T02:42:51.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11033" PostTypeId="1" CreationDate="2015-04-30T03:09:27.747" Score="0" ViewCount="143" Body="&lt;p&gt;Emacs version is 24.5.1, terminal is Mintty 1.1.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;kbd&gt;C-2&lt;/kbd&gt; in Emacs it produces &lt;code&gt;M-[ 5 0 ; 5 u&lt;/code&gt; key which is very strange because &lt;kbd&gt;C-1&lt;/kbd&gt; behaves as expected.&lt;/p&gt;&#xA;" OwnerUserId="5292" OwnerDisplayName="netawater" LastEditorUserId="504" LastEditDate="2015-05-05T06:45:03.440" LastActivityDate="2015-05-05T06:45:03.440" Title="Emacs doesn't recognize Ctrl+2 in a terminal" Tags="|key-bindings|terminal-emacs|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11034" PostTypeId="2" ParentId="11018" CreationDate="2015-04-30T06:12:10.380" Score="3" Body="&lt;p&gt;I suggest you try out the &lt;code&gt;xclip&lt;/code&gt; package, availble in GNU ELPA.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-04-30T06:12:10.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11035" PostTypeId="1" AcceptedAnswerId="11043" CreationDate="2015-04-30T07:08:47.800" Score="3" ViewCount="1130" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacsclient to open files in a Emacs server. The server configuration depends on the content of a JSON configuration file. A Perl script can read the config file and write a suitable Emacs Lisp hashtable load file, which the server can read to update its configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to avoid running the Perl script when there has been no modification to the JSON file. So I am thinking about setting a global variable &lt;code&gt;my-config-last-mod&lt;/code&gt; in the server, and check that against the current last-modification time of the JSON file. If there is a difference, the Perl script should run to update the server config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to compare file modification timestamps in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have in mind:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-config-last-mod nil)&#xA;(defun my-update-config ()&#xA;  (let* ((config-fn &quot;myconfig.json&quot;)&#xA;         (last-mod (shell-command-to-string (concat &quot;stat -c %y &quot; config-fn)))&#xA;         (fixed-case t)&#xA;         (literal t)&#xA;         (reload-config t))&#xA;    ;; trim space at end&#xA;    (when (string-match &quot;\\([[:space:]]\\|\n\\)*\\'&quot; last-mod)&#xA;      (setq last-mod (replace-match &quot;&quot; fixed-case literal last-mod)))&#xA;    (when my-config-last-mod&#xA;      (when (my-compare-time-stamps my-config-last-mod last-mod)&#xA;        (setq reload-config nil)))&#xA;    (when reload-config&#xA;      (setq my-config-last-mod last-mod)&#xA;      (shell-command-to-string &quot;my_update_config&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to write &lt;code&gt;my-compare-time-stamps&lt;/code&gt; in pure Lisp, or would I have to use an external program?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-04-30T07:14:27.117" LastActivityDate="2015-04-30T10:49:07.807" Title="Compare file modification time stamps" Tags="|time-date|parse-time|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11036" PostTypeId="1" AcceptedAnswerId="11040" CreationDate="2015-04-30T09:01:41.687" Score="0" ViewCount="431" Body="&lt;p&gt;I know I can run &lt;code&gt;M-x pwd&lt;/code&gt; which will give me &lt;code&gt;Directory ~/&lt;/code&gt; or something like that. Can I get it without the &quot;Directory&quot; bit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="7117" LastEditDate="2015-04-30T10:12:10.160" LastActivityDate="2015-04-30T10:12:10.160" Title="How can I save the current Unix working directory in a variable?" Tags="|directories|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11037" PostTypeId="2" ParentId="11036" CreationDate="2015-04-30T09:03:07.870" Score="0" Body="&lt;p&gt;I just found out I can do &lt;code&gt;(getenv &quot;PWD&quot;)&lt;/code&gt; on Linux on bash. I'm not sure if there's a better (more platform-agnostic and Emacs) way to do so.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2015-04-30T09:03:07.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11038" PostTypeId="1" AcceptedAnswerId="11042" CreationDate="2015-04-30T09:18:39.960" Score="2" ViewCount="841" Body="&lt;p&gt;If I:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start Emacs in my home directory (&lt;code&gt;~&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Find a file in the &lt;code&gt;~/Projects/ruby-play&lt;/code&gt; directory with &lt;code&gt;C-x C-f&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Try to find another file with &lt;code&gt;C-x C-f&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The default directory in the file finder will be &lt;code&gt;~/Projects/ruby-play&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'd like to see is the default directory being &lt;code&gt;~&lt;/code&gt; still.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P. S.&lt;/em&gt; Can I maybe use some external package for it? Will Projectile do it for me, for instance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P. P. S.&lt;/em&gt; Since, apparently, I wasn't clear enough... I don't want Emacs to return to my home directory every time. I wish to preserve &lt;em&gt;any&lt;/em&gt; directory I need (e. g., if I start Emacs in the &lt;code&gt;Project&lt;/code&gt; directory, I want the file finder to start in the &lt;code&gt;Project&lt;/code&gt; directory as well).&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="7117" LastEditDate="2015-04-30T14:04:42.510" LastActivityDate="2015-04-30T14:04:42.510" Title="Can I stop Emacs from resetting default-directory every time I open a file?" Tags="|find-file|directories|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11039" PostTypeId="2" ParentId="11036" CreationDate="2015-04-30T09:35:51.647" Score="2" Body="&lt;p&gt;Check the &lt;code&gt;default-directory&lt;/code&gt; variable.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-30T09:35:51.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11040" PostTypeId="2" ParentId="11036" CreationDate="2015-04-30T09:49:44.497" Score="3" Body="&lt;p&gt;You could also add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-initial-directory default-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your Emacs init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that way, you could later access the directory where Emacs was launched by evaluating &lt;code&gt;my-initial-directory&lt;/code&gt;..&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-04-30T09:49:44.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11041" PostTypeId="2" ParentId="11036" CreationDate="2015-04-30T10:09:39.137" Score="0" Body="&lt;p&gt;You can evaluate &lt;code&gt;(call-process &quot;pwd&quot; nil t)&lt;/code&gt;, e.g. typing &lt;code&gt;M-:&lt;/code&gt; &lt;code&gt;(call-process &quot;pwd&quot; nil t)&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;. This will run Unix &lt;code&gt;pwd&lt;/code&gt; command and insert its output at the point in the current buffer, if the buffer is not read-only.  It's not clear from the question what for and why you need the current directory without &lt;code&gt;Directory&lt;/code&gt; prefix.&lt;/p&gt;&#xA;" OwnerUserId="5443" LastActivityDate="2015-04-30T10:09:39.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11042" PostTypeId="2" ParentId="11038" CreationDate="2015-04-30T10:22:40.957" Score="5" Body="&lt;p&gt;&lt;code&gt;default-directory&lt;/code&gt; is a buffer local variable which can be set by all sorts of things although it is always set on loading a file. The simplest dumb solution is to use the &lt;code&gt;find-file-hook&lt;/code&gt; and set it back to what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'find-file-hook #'(lambda () (setq default-directory (expand-file-name &quot;~/&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this does have the disadvantage of always setting it to your home directory. More complex tricks are possible, so for example I have a hook in my mailer to set the directory to the relevant source tree depending on the source of the email:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Set default directory when viewing messages&#xA;(defvar my-mailing-list-dir-mapping&#xA;  '( (&quot;qemu-devel.nongnu.org&quot; . &quot;~/lsrc/qemu/qemu.git/&quot;)&#xA;     (&quot;kvmarm.lists.cs.columbia.edu&quot; . &quot;~/lsrc/kvm/linux.git/&quot;) )&#xA;  &quot;Mapping from mailing lists to source tree.&quot;)&#xA;&#xA;(defvar my-maildir-mapping&#xA;  '( (&quot;linaro/virtualization/.qemu&quot; . &quot;~/lsrc/qemu/qemu.git/&quot;)&#xA;     (&quot;linaro/kernel&quot; . &quot;~/lsrc/kvm/linux.git/&quot;) )&#xA;  &quot;Mapping from maildirs to source tree.&quot;)&#xA;&#xA;(defun my-set-view-directory ()&#xA;  &quot;Switch the `default-directory' depending on the mailing list we&#xA;  are in.&quot;&#xA;  (interactive)&#xA;  (let ((list (mu4e-message-field (mu4e-message-at-point)&#xA;                                  :mailing-list))&#xA;        (maildir (mu4e-message-field (mu4e-message-at-point)&#xA;                                     :maildir)))&#xA;    (setq default-directory&#xA;          (expand-file-name&#xA;           (or&#xA;            (assoc-default list my-mailing-list-dir-mapping)&#xA;            (assoc-default maildir my-maildir-mapping 'string-match)&#xA;            &quot;~&quot;))))))&#xA;&#xA;(add-hook 'mu4e-view-mode-hook 'my-set-view-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-04-30T10:22:40.957" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11043" PostTypeId="2" ParentId="11035" CreationDate="2015-04-30T10:49:07.807" Score="5" Body="&lt;p&gt;The function you are looking for is &lt;code&gt;file-attributes&lt;/code&gt;. The help text is fairly detailed but you will be wanting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;4. Last access time, as a list of integers (HIGH LOW USEC PSEC) in the&#xA; same style as (current-time).&#xA; (See a note below about access time on FAT-based filesystems.)&#xA;5. Last modification time, likewise.  This is the time of the last&#xA; change to the file's contents.&#xA;6. Last status change time, likewise.  This is the time of last change&#xA; to the file's attributes: owner and group, access mode bits, etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-config-file&#xA;  &quot;~/test.txt&quot;&#xA;  &quot;Path to my config file&quot;)&#xA;&#xA;(defvar my-config-last-mod&#xA;  (nth 5 (file-attributes my-config-file))&#xA;  &quot;Last modification time for my config file&quot;)&#xA;&#xA;(defun my-config-updated-p ()&#xA;  &quot;Check if my config file has been updated since I last checked&quot;&#xA;  (time-less-p my-config-last-mod&#xA;               (nth 5 (file-attributes my-config-file))))&#xA;&#xA;(defun my-do-something ()&#xA;  &quot;Do something with my config&quot;&#xA;  (when (my-config-updated-p)&#xA;    (setq my-config-last-mod&#xA;          (nth 5 (file-attributes my-config-file)))&#xA;    (message &quot;do stuff&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-04-30T10:49:07.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11044" PostTypeId="1" AcceptedAnswerId="16916" CreationDate="2015-04-30T11:19:33.423" Score="3" ViewCount="211" Body="&lt;p&gt;I just recently found the &quot;rainbow-delimiters-mode&quot; package and found it quite useful, however I seem to have run into a snag with it when using it in C-like languages:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturally, I'd prefer to enable it for all programming modes, so I added the following to my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This apparently worked fine for everything but C-like languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;guess&lt;/em&gt; &lt;code&gt;cc-mode&lt;/code&gt; is derived from &lt;code&gt;prog-mode&lt;/code&gt;, hence &lt;code&gt;prog-mode-hook&lt;/code&gt; is run before cc-mode, overriding some settings. The cc-mode settings I want are basically the ones in this snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cc-mode-common-hook ()&#xA;  &quot;Setup common utilities for all C-like modes.&quot;&#xA;  (setq-local c-doc-comment-style&#xA;        '((java-mode . javadoc)&#xA;            (pike-mode . autodoc)&#xA;            (c-mode    . javadoc)&#xA;            (c++-mode  . javadoc)))&#xA;  (face-remap-add-relative 'font-lock-doc-face&#xA;           :foreground (face-foreground font-lock-comment-face)))&#xA;(add-hook 'c-mode-common-hook 'my-cc-mode-common-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, with the rainbow-delimiters-mode in &lt;code&gt;prog-mode-hook&lt;/code&gt;, the above snippet breaks. I thought I could fix this by temporarily disabling the mode at the beginning of the hook and then re-enable it again at the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cc-mode-common-hook ()&#xA;  (rainbow-delimiters-mode 0)&#xA;   ;; ...&#xA;  (rainbow-delimiter-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work at all however, so I guess I have to do something else to enable the configuration in cc-mode to fix this issue. Anyone have any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, simply disabling &lt;code&gt;rainbow-delimiters-mode&lt;/code&gt; doesn't re-enable the cc-mode settings I listed above, that is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cc-mode-common-hook ()&#xA;  (rainbow-delimiters-mode 0)&#xA;   ;; ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doesn't work, at least not on it's own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should note that it &lt;em&gt;is&lt;/em&gt; possible to fix this by not having rainbow-delimiters-mode in the &lt;code&gt;prog-mode-hook&lt;/code&gt; and instead place it in &lt;code&gt;c-mode-common-hook&lt;/code&gt; or any other major-mode hook. It does however seem like a hassle to add it to every new programming mode instead of fixing it where it breaks.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2653" LastEditDate="2015-04-30T13:52:12.657" LastActivityDate="2015-09-25T10:07:21.997" Title="Rainbow-Delimiters and CC-Mode Conflics" Tags="|cc-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11045" PostTypeId="1" CreationDate="2015-04-30T11:21:50.707" Score="1" ViewCount="107" Body="&lt;p&gt;I've been following this &lt;a href=&quot;https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md#insertion-commands&quot; rel=&quot;nofollow&quot;&gt;Emacs+Haskell tutorial&lt;/a&gt; and I'm going through the &lt;a href=&quot;https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md#insertion-commands&quot; rel=&quot;nofollow&quot;&gt;Insertion Commands&lt;/a&gt; section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Emacs 24.4.1, GHC 7.10.1 and &lt;a href=&quot;https://github.com/kazu-yamamoto/ghc-mod&quot; rel=&quot;nofollow&quot;&gt;ghc-mod master build&lt;/a&gt;, I've managed to get &lt;code&gt;C-u M-t&lt;/code&gt; to work, so it generates implementations for both &lt;code&gt;instance Eq ExampleType where&lt;/code&gt; and &lt;code&gt;maybeMap :: Maybe a -&amp;gt; (a -&amp;gt; b) -&amp;gt; Maybe b&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm now trying to get &lt;code&gt;maybeMap x f = _maybeMap_body&lt;/code&gt; to expand, so I position myself on top of &lt;code&gt;x&lt;/code&gt;, then execute &lt;code&gt;M-t&lt;/code&gt; but nothing happens. The status bar indicates &lt;code&gt;Nothing to be done&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what it's wrong here or how to debug it further? Could it be a bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; The reason I'm using &lt;code&gt;ghc-mod&lt;/code&gt; master is because with updated Cabal 1.22 and GHC 7.8 I was having &lt;a href=&quot;https://github.com/kazu-yamamoto/ghc-mod/issues/429&quot; rel=&quot;nofollow&quot;&gt;this issue&lt;/a&gt;. Once I updated to GHC 7.10, I was having &lt;a href=&quot;https://github.com/kazu-yamamoto/ghc-mod/issues/437&quot; rel=&quot;nofollow&quot;&gt;this other issue&lt;/a&gt;, so ended up having to build/install &lt;code&gt;master&lt;/code&gt; &lt;code&gt;ghc-mod&lt;/code&gt; to get it to work...&lt;/p&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2015-04-30T11:21:50.707" Title="ghc-mod template generation (M-t) not working" Tags="|completion|haskell-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11046" PostTypeId="1" AcceptedAnswerId="11048" CreationDate="2015-04-30T12:42:52.010" Score="11" ViewCount="474" Body="&lt;p&gt;From the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Execute BODY only as long as there's no pending input.&lt;br&gt;&#xA;  If input arrives, that ends the execution of BODY,&#xA;  and &lt;code&gt;while-no-input&lt;/code&gt; returns t.  Quitting makes it return nil.&#xA;  If BODY finishes, &lt;code&gt;while-no-input&lt;/code&gt; returns whatever value BODY produced.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I understand correctly, this macro allows me to (attempt to)&#xA;perform a heavy computation without hanging the interface. That's&#xA;certainly a concept that I find attractive, but I'm left wondering&#xA;when is that useful in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that the computation can be interrupted at any moment, with&#xA;no information on where that happened, and no easy way of resuming it&#xA;later. Which makes me think it might not be that useful after all...&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is there a recommended way of using the &lt;code&gt;while-no-input&lt;/code&gt; macro?&lt;/li&gt;&#xA;&lt;li&gt;Are there any example usages of this macro in the wild?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="50" LastActivityDate="2023-11-23T17:19:10.363" Title="How to use while-no-input?" Tags="|elisp|elisp-macros|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11048" PostTypeId="2" ParentId="11046" CreationDate="2015-04-30T13:08:36.897" Score="11" Body="&lt;p&gt;Indeed, there is no support for resumption.  Of course, the body of &lt;code&gt;while-no-input&lt;/code&gt; can do regular &quot;checkpoints&quot; so as to know where to start next time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the original motivation for this functionality was in cases where the computed information is likely useless after the next command.  More specifically, it was introduced for &lt;code&gt;icomplete&lt;/code&gt;, so that the computation of the set of completion candidates does not prevent the user from typing further text (which in turn requires recomputation of that set of completion candidates anyway).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-04-30T21:35:45.697" LastActivityDate="2015-04-30T21:35:45.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11049" PostTypeId="2" ParentId="11026" CreationDate="2015-04-30T14:24:50.607" Score="1" Body="&lt;p&gt;You could wrap rectangle-number-lines and add a step argument.  Call it like &lt;kbd&gt;C-u M-x my-r-n-l&lt;/kbd&gt; to prompt for the arguments.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-r-n-l (start end start-at step &amp;amp;optional format)&#xA;  &quot;Insert numbers in front of the region-rectangle.&#xA;&#xA;START-AT, if non-nil, should be a number from which to begin&#xA;counting.  STEP, if non-nil should be a number to increment by.&#xA;FORMAT, if non-nil, should be a format string to pass to `format'&#xA;along with the line count.  When called interactively with a&#xA;prefix argument, prompt for START-AT, STEP, and FORMAT.&quot;&#xA;  (interactive&#xA;   (if current-prefix-arg&#xA;       (let* ((start (region-beginning))&#xA;              (end   (region-end))&#xA;              (start-at (read-number &quot;Number to count from: &quot; 1))&#xA;              (step (read-number &quot;Step: &quot; 1)))&#xA;         (list start end start-at step&#xA;               (read-string &quot;Format string: &quot;&#xA;                            (rectange--default-line-number-format&#xA;                             start end start-at))))&#xA;     (list (region-beginning) (region-end) 1 1 nil)))&#xA;  (cl-letf (((symbol-function 'rectangle-number-line-callback)&#xA;             `(lambda (start _end format-string)&#xA;                (move-to-column start t)&#xA;                (insert (format format-string rectangle-number-line-counter))&#xA;                (setq rectangle-number-line-counter&#xA;                      (+ rectangle-number-line-counter ,step)))))&#xA;    (rectangle-number-lines start end start-at format)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2316" LastEditorUserId="160" LastEditDate="2015-05-22T22:19:32.120" LastActivityDate="2015-05-22T22:19:32.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11050" PostTypeId="1" AcceptedAnswerId="11058" CreationDate="2015-04-30T14:38:36.847" Score="6" ViewCount="1784" Body="&lt;p&gt;Whenever I write, in my &lt;code&gt;org-mode&lt;/code&gt; file, &lt;code&gt;\footnote{bla bla bla $\whatever_{something}$}&lt;/code&gt; I get an error in the &lt;code&gt;.tex&lt;/code&gt; file generated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it exports to the &lt;code&gt;tex&lt;/code&gt; file is &lt;code&gt;\footnote\\{bla bla bla \whatever_{something} \\\}&lt;/code&gt; (note the lack of dollar signs),&#xA;which obviously is not compiled in the right way by latex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I remove the parentheses around the subscript, i.e.&lt;code&gt;\footnote{bla bla bla $\whatever_s$}&lt;/code&gt;, then it is exported correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I fix the export?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="7199" LastEditorUserId="253" LastEditDate="2015-04-30T19:32:35.177" LastActivityDate="2021-06-28T22:44:07.050" Title="Org-mode export to Latex error with footnotes" Tags="|org-mode|latex|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11051" PostTypeId="2" ParentId="11046" CreationDate="2015-04-30T15:04:01.290" Score="4" Body="&lt;p&gt;It's super-useful in &lt;a href=&quot;https://github.com/abo-abo/swiper/blob/master/counsel.el&quot; rel=&quot;nofollow&quot;&gt;counsel-git-grep&lt;/a&gt;: I'm able to call &lt;code&gt;git grep&lt;/code&gt; on the whole 3,800,000 lines of the Emacs git repository &lt;strong&gt;after each&lt;/strong&gt; key stroke. No hangups.&#xA;And it's OK to be interrupted, you just need to check for that.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-04-30T15:04:01.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11052" PostTypeId="1" CreationDate="2015-04-30T15:06:08.463" Score="5" ViewCount="871" Body="&lt;p&gt;I've tried searching around but have come up with nothing: How can I determine the bits (32-bit or 64-bit) of my operating system with elisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my 64-bit Linux machine, &lt;code&gt;system-configuration&lt;/code&gt; evaluates to &lt;code&gt;&quot;x86_64-unknown-linux-gnu&quot;&lt;/code&gt;. I don't have a Windows 32-bit machine available, but could I potentially do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst 32-bit (not (null (string-match &quot;^i386-.*&quot; system-configuration))))&#xA;(defconst 64-bit (not (null (string-match &quot;^x86_64-.*&quot; system-configuration))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to detect the bits?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &quot;Why would you want to know that?&quot; I wanted to write an Elisp script that would download and run the appropriate version of an executable (32 or 64-bit) for the user's OS.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastEditorUserId="2631" LastEditDate="2015-05-01T06:37:36.017" LastActivityDate="2015-05-01T13:01:05.333" Title="How to determine operating system bits (32 vs 64-bit) in elisp" Tags="|elisp|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11053" PostTypeId="2" ParentId="11052" CreationDate="2015-04-30T15:37:04.000" Score="3" Body="&lt;p&gt;This is quite hacky, and I'm not sure how reliable it is, but the value &lt;code&gt;gc-cons-threshold&lt;/code&gt; depends on the underlying word size. It's &lt;code&gt;800000&lt;/code&gt; on 64-bit systems, and &lt;code&gt;400000&lt;/code&gt; on 32-bit systems.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst 32-bit (= gc-cons-threshold 400000))&#xA;(defconst 64-bit (= gc-cons-threshold 800000))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-04-30T15:37:04.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11054" PostTypeId="2" ParentId="11052" CreationDate="2015-04-30T15:46:44.223" Score="0" Body="&lt;p&gt;Why would you want to now that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be looking at the specific Emacs property/capability and not the hardware attributes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Integer-Basics.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;most-positive-fixnum&lt;/code&gt;&lt;/a&gt; will tell you the size of the &lt;code&gt;fixnum&lt;/code&gt; (incidentally, it will also tell you the word size: if it is bugger than 2^32, then you have a 64-bit CPU).&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2015-05-01T11:16:41.483" LastActivityDate="2015-05-01T11:16:41.483" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11055" PostTypeId="1" AcceptedAnswerId="11056" CreationDate="2015-04-30T16:30:08.423" Score="3" ViewCount="303" Body="&lt;p&gt;When I type &lt;code&gt;C-x d&lt;/code&gt; for the first time after starting emacs I get regular &lt;em&gt;dired&lt;/em&gt;, not &lt;em&gt;dired+&lt;/em&gt; view. If I execute &lt;code&gt;M-x diredp-dired-for-files&lt;/code&gt; I get &lt;em&gt;dired+&lt;/em&gt; view of the directory, &lt;strong&gt;and&lt;/strong&gt; every &lt;code&gt;C-x d&lt;/code&gt; after that opens &lt;em&gt;dired+&lt;/em&gt; view of any directory I visit.  Also if &lt;em&gt;dired+&lt;/em&gt; package was updated from &lt;code&gt;list-packages&lt;/code&gt; then &lt;code&gt;C-x d&lt;/code&gt; invokes &lt;em&gt;dired+&lt;/em&gt; automatically even the first time and without me having to execute &lt;code&gt;diredp-dired-for-files&lt;/code&gt;.  Why doesn't &lt;em&gt;dired+&lt;/em&gt; get invoked automatically on the first and subsequent &lt;code&gt;C-x d&lt;/code&gt; until I manually invoke it as &lt;code&gt;diredp-dired-for-files&lt;/code&gt;?  Is this how it supposed to work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; I forgot to mention, &lt;code&gt;package-initialize&lt;/code&gt; is the first command in my &lt;code&gt;init.el&lt;/code&gt;. In fact, the packaging system takes care of this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Added by Package.el.  This must come before configurations of&#xA;;; installed packages.  Don't delete this line.  If you don't want it,&#xA;;; just comment it out by adding a semicolon to the start of the line.&#xA;;; You may delete these explanatory comments.&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5443" LastEditorUserId="5443" LastEditDate="2015-04-30T18:29:53.540" LastActivityDate="2015-04-30T18:29:53.540" Title="dired+ is not invoked by default" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11056" PostTypeId="2" ParentId="11055" CreationDate="2015-04-30T18:23:14.337" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are using the package system (e.g. MELPA), make sure you have used &lt;code&gt;(package-initialize&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Alternatively (especially if you are not using the package system): Put &lt;code&gt;dired+.el&lt;/code&gt; (or &lt;code&gt;dired+.elc&lt;/code&gt;) in a directory that is in your &lt;code&gt;load-path&lt;/code&gt;, and put &lt;code&gt;(require 'dired+)&lt;/code&gt; in your init file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The reason Dired+ was not available from the outset is that it was not loaded by default.  The above instructions should fix that. The reason that Dired+ was available after you used a Dired+ command was that the command you used was autoloaded, meaning that you could invoke it before Dired+ was loaded, and invoking it automatically loaded Dired+. Once it was loaded it was available from then on.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-04-30T18:23:14.337" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11057" PostTypeId="2" ParentId="11003" CreationDate="2015-04-30T20:39:25.470" Score="4" Body="&lt;p&gt;If you want to run something after the stack clears, run it on a 0 second timer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-timer 0 nil 'your-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could wrap this is a macro like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro after-stack-clears (&amp;amp;rest body)&#xA;  &quot;Do BODY after the call stack is clear&quot;&#xA;  `(run-with-timer 0 nil (lambda () ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's an example usage mimicking your described scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example, &lt;code&gt;annoying-func&lt;/code&gt; is calling another provided function. In the provided function you'd like to call &lt;code&gt;annoying-func&lt;/code&gt; again but &lt;code&gt;annoying-func&lt;/code&gt; will error if called more than once on the call stack. So to counter this, the provided macro to ensure that &lt;code&gt;annoying-func&lt;/code&gt; is called a second time, but only after the call stack has cleared and &lt;code&gt;annoying-func&lt;/code&gt; has done its cleanup&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun your-func-simple ()&#xA;  &quot;try to directly call `annoying-func'.&quot;&#xA;  (annoying-func (lambda () (message &quot;hi&quot;))))&#xA;&#xA;(defun your-func-smart ()&#xA;  &quot;ensure `annoying-func' is called after the stack clears.&quot;&#xA;  (after-stack-clears&#xA;   (annoying-func (lambda () (message &quot;hi&quot;)))))&#xA;&#xA;(setq annoying-var nil)&#xA;&#xA;(defun annoying-func (func)&#xA;  &quot;This function will apply FUNC, if `annoying-function' is called&#xA;somewhere down the line by FUNC, the second call will error, because this &#xA;is the annoying function after all.&quot;&#xA;  (if annoying-var&#xA;      (error &quot;Can't call recursively!&quot;)&#xA;    (condition-case err&#xA;        (progn (setq annoying-var t)&#xA;               (apply func nil)&#xA;               (setq annoying-var nil))&#xA;      (error (progn (message &quot;errored! %s&quot; err) (setq annoying-var nil))))))&#xA;&#xA;&#xA;(defun erroring-example ()&#xA;  (annoying-func 'your-func-simple))&#xA;&#xA;(defun working-example ()&#xA;  (annoying-func 'your-func-smart))&#xA;&#xA;;; will error due to annoying-func being called twice on the stack&#xA;(erroring-example) &#xA;&#xA;;; will NOT error since annoying-func is called again only after the stack has cleared&#xA;(working-example) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-04-30T20:59:42.423" LastActivityDate="2015-04-30T20:59:42.423" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11058" PostTypeId="2" ParentId="11050" CreationDate="2015-05-01T03:37:10.573" Score="9" Body="&lt;p&gt;You can use org-mode's own built-in &lt;a href=&quot;http://orgmode.org/manual/Footnotes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;footnote feature&lt;/a&gt;. The default binding to insert a footnote automatically is, &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt;. Here is a MWE of an org-mode file that exports to LaTeX correctly, tested in org-mode v8.2.10.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;A sentence[fn:1].&#xA;&#xA;* Footnotes&#xA;&#xA;[fn:1] bla bla bla $\whatever_{something}$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2021-06-28T22:44:07.050" LastActivityDate="2021-06-28T22:44:07.050" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="11059" PostTypeId="1" CreationDate="2015-05-01T06:33:51.817" Score="1" ViewCount="260" Body="&lt;p&gt;I recently had my Ubuntu Linux upgraded to 14.04, and my emacs got upgraded to 24.3.1 in the process. I noticed that it scrolls by itself. I finally realized that it automatically centers the cursor vertically after a few seconds. This is extremely annoying to me. I decided to give it a try for an hour or so to see if I can get used to it, but it still annoys me. I went to the options menu, but I see nothing about that feature. Can anyone tell me how to disable it? Thanks. &lt;/p&gt;&#xA;" OwnerUserId="7202" LastActivityDate="2015-05-01T23:16:36.157" Title="how to disable vertical auto-centering of cursor" Tags="|customize|" AnswerCount="2" CommentCount="1" ClosedDate="2015-05-02T16:11:11.187" ContentLicense="CC BY-SA 3.0" />
  <row Id="11060" PostTypeId="2" ParentId="11059" CreationDate="2015-05-01T07:19:31.453" Score="1" Body="&lt;p&gt;Try to start with &lt;code&gt;emacs -Q&lt;/code&gt; first and see if the problem still exists (it should not).  Then bisect your init file to figure out what causes it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;centered-cursor-mode&lt;/code&gt; as a global minor mode to keep the cursor vertically centered, but it behaves somewhat differently than what you describe.  Your best bet is to bisect your init file (comment half of it and concentrate on the half that appears to be responsible, then repeat on that half until you are at the line that causes the undesired behaviour).&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-05-01T07:19:31.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11061" PostTypeId="1" CreationDate="2015-05-01T08:40:46.200" Score="13" ViewCount="2132" Body="&lt;p&gt;How I can I swap two arguments in a call to a Python function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I put &lt;code&gt;point&lt;/code&gt; on the space between these two arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;self.assertEqual(json.loads(some.data), json_data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then &lt;code&gt;M-t&lt;/code&gt; (&lt;code&gt;transpose-words&lt;/code&gt;), I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;self.assertEqual(json.loads(some.json), data_data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the other hand with C-M-t (&lt;code&gt;transpose-sexps&lt;/code&gt;) I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;self.assertEqual(json.loadsjson_data, (some.data))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;self.assertEqual(json_data, json.loads(some.data))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a command that will do that?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="2418" LastEditDate="2019-02-20T12:53:48.300" LastActivityDate="2023-08-22T00:54:02.930" Title="How to transpose two arguments of a function in Python?" Tags="|python|text-editing|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="11062" PostTypeId="2" ParentId="11061" CreationDate="2015-05-01T10:07:34.180" Score="4" Body="&lt;p&gt;This is something I, too, wanted to have for a long time, and here I've found some motivation to work on it.  It's probably not very robust, but at the first try it seems to cover the cases I tried:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/calculate-stops ()&#xA;  (save-excursion&#xA;    (let ((start&#xA;           (condition-case e&#xA;               (while t (backward-sexp))&#xA;             (error (point))))&#xA;          stops)&#xA;      (push start stops)&#xA;      (condition-case e&#xA;          (while t&#xA;            (forward-sexp)&#xA;            (when (looking-at-p &amp;quot;\\s-*,&amp;quot;)&#xA;              (push (point) stops)))&#xA;        (error (push (point) stops)))&#xA;      (nreverse stops))))&#xA;&#xA;(defun my/transpose-args ()&#xA;  (interactive)&#xA;  (when (looking-at-p &amp;quot;\\s-&amp;quot;) (backward-sexp))&#xA;  (cl-loop with p = (point)&#xA;           with previous = nil&#xA;           for stop on (my/calculate-stops)&#xA;           for i upfrom 0&#xA;           when (&amp;lt;= p (car stop)) do&#xA;           (when previous&#xA;             (let* ((end (cadr stop))&#xA;                    (whole (buffer-substring previous end))&#xA;                    middle last)&#xA;               (delete-region previous end)&#xA;               (goto-char previous)&#xA;               (setf middle (if (&amp;gt; i 1) (- (car stop) previous)&#xA;                              (string-match-p &amp;quot;[^, \\t]&amp;quot; whole &#xA;                                              (- (car stop) previous)))&#xA;                     last (if (&amp;gt; i 1) (substring whole 0 middle)&#xA;                            (concat (substring whole (- (car stop) previous) middle)&#xA;                                    (substring whole 0 (- (car stop) previous)))))&#xA;               (insert (substring whole middle) last)))&#xA;           (cl-return)&#xA;           end do (setf previous (car stop))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="2418" LastEditDate="2023-08-22T00:54:02.930" LastActivityDate="2023-08-22T00:54:02.930" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="11063" PostTypeId="2" ParentId="11052" CreationDate="2015-05-01T10:48:09.187" Score="1" Body="&lt;p&gt;Given the use case (taken from a comment &lt;code&gt;I wanted to write an Elisp script that would download and run the appropriate version of an executable (32 or 64-bit) for the user's OS.&lt;/code&gt;), the nicest way might be just to ask the user which version to download.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how you'd do that in elisp though&lt;/p&gt;&#xA;" OwnerUserId="503" LastActivityDate="2015-05-01T10:48:09.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11064" PostTypeId="2" ParentId="7892" CreationDate="2015-05-01T12:38:48.570" Score="4" Body="&lt;p&gt;As noted by abo-abo, the function &lt;code&gt;keyboard-quit&lt;/code&gt; explicitly deactivates the mark.  While you could in principle edit this function, it is better to advise it so that it conditionally reactivates the mark if it was active before.  Since &lt;code&gt;keyboard-quit&lt;/code&gt; may exit by signalling a condition, you must do that in an &lt;code&gt;unwind-protect&lt;/code&gt; unwind handler:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-keyboard-quit-advice (fn &amp;amp;rest args)&#xA;  (let ((region-was-active (region-active-p)))&#xA;    (unwind-protect&#xA;         (apply fn args)&#xA;      (when region-was-active&#xA;        (activate-mark t)))))&#xA;&#xA;(advice-add 'keyboard-quit :around #'my-keyboard-quit-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2015-05-01T14:50:30.020" LastActivityDate="2015-05-01T14:50:30.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11065" PostTypeId="2" ParentId="11052" CreationDate="2015-05-01T13:01:05.333" Score="2" Body="&lt;p&gt;The issue of 64/32 bit is just a part of the problem.  Look at the larger problem: the user may be running Debian on a machine with an ARM processor, for example.  Or she may be running a FreeBSD system.  Also, under Windows, if the downloaded program will want to interact with Emacs, you'll probably want a different version depending on whether your Emacs is a Cygwin or a &quot;native&quot; build.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, &lt;code&gt;system-configuration&lt;/code&gt; is probably a good starting point, but you probably want to keep &lt;em&gt;more&lt;/em&gt; of it than just the 64/32 bit info.  You may actually want to keep the whole of &lt;code&gt;system-configuration&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-01T13:01:05.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11066" PostTypeId="2" ParentId="11061" CreationDate="2015-05-01T13:08:44.610" Score="2" Body="&lt;p&gt;In modes that use SMIE, &lt;code&gt;transpose-sexp&lt;/code&gt; should work correctly for that case.  They will still fail when the infix symbol (aka &quot;separator&quot;) is not a &lt;code&gt;,&lt;/code&gt; (or a &lt;code&gt;;&lt;/code&gt;) but is a word (e.g. &lt;code&gt;and&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my opinion is that the command for that is &lt;code&gt;transpose-sexp&lt;/code&gt; and when this doesn't work correctly, I consider it as a bug (but a bug that may be hard and/or take time to fix and have low-priority, so don't hold your breath).  The way to fix it is by setting &lt;code&gt;forward-sexp-function&lt;/code&gt; to a function that will know that &quot;after I see a comma, I just jump around the whole argument&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-01T13:08:44.610" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11067" PostTypeId="2" ParentId="11061" CreationDate="2015-05-01T13:37:21.170" Score="5" Body="&lt;p&gt;I use a variation of &lt;code&gt;transpose-sexps&lt;/code&gt; that looks for the case you describe and transposes things-separated-by-commas, or just does regular &lt;code&gt;transpose-sexps&lt;/code&gt;.  It also leaves the cursor in place instead of dragging it forward, which is a bit different but I personally like.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-transpose-sexps ()&#xA;  &quot;If point is after certain chars transpose chunks around that.&#xA;Otherwise transpose sexps.&quot;&#xA;  (interactive &quot;*&quot;)&#xA;  (if (not (looking-back &quot;[,]\\s-*&quot; (point-at-bol)))&#xA;      (progn (transpose-sexps 1) (forward-sexp -1))&#xA;    (let ((beg (point)) end rhs lhs)&#xA;      (while (and (not (eobp))&#xA;                  (not (looking-at &quot;\\s-*\\([,]\\|\\s)\\)&quot;)))&#xA;        (forward-sexp 1))&#xA;      (setq rhs (buffer-substring beg (point)))&#xA;      (delete-region beg (point))&#xA;      (re-search-backward &quot;[,]\\s-*&quot; nil t)&#xA;      (setq beg (point))&#xA;      (while (and (not (bobp))&#xA;                  (not (looking-back &quot;\\([,]\\|\\s(\\)\\s-*&quot; (point-at-bol))))&#xA;        (forward-sexp -1))&#xA;      (setq lhs (buffer-substring beg (point)))&#xA;      (delete-region beg (point))&#xA;      (insert rhs)&#xA;      (re-search-forward &quot;[,]\\s-*&quot; nil t)&#xA;      (save-excursion&#xA;        (insert lhs)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2316" LastEditorUserId="160" LastEditDate="2015-05-22T22:17:14.490" LastActivityDate="2015-05-22T22:17:14.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11068" PostTypeId="2" ParentId="9988" CreationDate="2015-05-01T15:25:51.167" Score="0" Body="&lt;p&gt;The problem is solved in emacs 24 which comes with Debian Jessie.&lt;/p&gt;&#xA;" OwnerUserId="6755" LastEditorUserId="6755" LastEditDate="2015-05-01T15:31:29.673" LastActivityDate="2015-05-01T15:31:29.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11069" PostTypeId="1" AcceptedAnswerId="12085" CreationDate="2015-05-01T15:38:42.817" Score="4" ViewCount="86" Body="&lt;p&gt;I occasionally have the problem that the character to the right of my point starts blinking. Can anyone think of anything that could be causing this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fecZz.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5199" LastEditorUserId="675" LastEditDate="2015-05-01T16:15:39.823" LastActivityDate="2015-05-03T06:43:04.000" Title="What is causing the letter to the right of my point to flicker?" Tags="|point|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11070" PostTypeId="1" AcceptedAnswerId="11074" CreationDate="2015-05-01T17:06:11.453" Score="0" ViewCount="90" Body="&lt;p&gt;I'm using &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin14.0.0, NS appkit-1343.14 Version 10.10 (Build 14A389)) of 2014-10-20&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I interesting in knowing how emacs does an icon in the top window frame for certain file extensions, for example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/3aoVL.png&quot; alt=&quot;CPP example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;img src=&quot;https://i.stack.imgur.com/VF3yo.png&quot; alt=&quot;Swift example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect this is an emacs source code kind of solution since I couldn't find an icon in the swift-mode package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone shed some light on this? (I want to add an icon for OCaml)&lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="105" LastEditDate="2023-06-16T22:14:37.153" LastActivityDate="2023-06-16T22:14:37.153" Title="How to control the favicon as a function of file extension." Tags="|filenames|icons|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11072" PostTypeId="2" ParentId="2567" CreationDate="2015-05-01T18:33:59.620" Score="3" Body="&lt;p&gt;Here's a command to do this when the list of files is in a buffer, with one file per line.   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dired-virtual-vanilla ()&#xA;  (interactive)&#xA;  (dired (cons &quot;*Dired*&quot; (split-string (buffer-string) &quot;\n&quot; t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3853" LastActivityDate="2015-05-01T18:33:59.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11073" PostTypeId="1" CreationDate="2015-05-01T19:29:55.510" Score="3" ViewCount="553" Body="&lt;p&gt;I wonder if it is possible to write a bash oneline to export org-files to pdf. Something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -q --eval 'org-latex-export-to-pdf manual.org'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm aware of the &lt;a href=&quot;http://pandoc.org/&quot; rel=&quot;nofollow&quot;&gt;pandoc&lt;/a&gt; project. I would like to do it with emacs, as I also want to add some style options for the export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a document where I will occasionally work with others. To make it easy for them I would like to add a Makefile to generate the pdf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution from the comments&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --batch -q --eval '(progn (find-file &quot;manual.org&quot;) (org-latex-export-to-pdf))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="536" LastEditorUserId="536" LastEditDate="2015-05-02T17:52:29.030" LastActivityDate="2015-05-02T17:52:29.030" Title="export org-file to pdf on the CLI" Tags="|org-mode|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="11074" PostTypeId="2" ParentId="11070" CreationDate="2015-05-01T19:47:14.563" Score="1" Body="&lt;p&gt;Emacs does not choose the icon, it is provided by OSX, look at those files in Finder, they'll have that same icon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This image can be gathered through by using the AppKit class &lt;a href=&quot;https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/index.html#//apple_ref/doc/uid/20000391-iconForFileType_&quot; rel=&quot;nofollow noreferrer&quot;&gt;NSWorkspace's function iconForFileType&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Grep the source for &lt;code&gt;iconForFileType&lt;/code&gt; and you'll find the usage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you wanted to change what a swift file's icon was you'd need to change it for all of OSX. I do not believe you can put your own images in the frame title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to choose an icon for OSX to use for OCaml files then &lt;a href=&quot;https://superuser.com/questions/178316/how-to-set-an-icon-for-a-file-type-on-mac&quot;&gt;this is the answer you want: How to set an icon for a file type on Mac?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-03-20T10:04:44.717" LastActivityDate="2015-05-01T19:47:14.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11075" PostTypeId="1" CreationDate="2015-05-01T21:13:08.677" Score="4" ViewCount="988" Body="&lt;p&gt;In the &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html&quot; rel=&quot;nofollow&quot;&gt;following link&lt;/a&gt; you can find the following simple example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :session :results file&#xA;import matplotlib&#xA;matplotlib.use('Agg')&#xA;import matplotlib.pyplot as plt&#xA;fig=plt.figure(figsize=(3,2))&#xA;plt.plot([1,3,2])&#xA;fig.tight_layout()&#xA;plt.savefig('myfig.pdf')&#xA;'myfig.pdf' # return this to org-mode&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the problem that the string that contains the file name is not returned. Thus, I don't get something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;[[file:images/myfig.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is what I can see in the session's buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Process Python finished&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Python 3.4.3 (default, Feb 27 2015, 00:22:26) &#xA;[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin&#xA;Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; r/folders/kz/1c2cxn1x60n_t5p2j1p02b180000gn/T/py6499_X0''', 'exec'));&#xA;import matplotlib&#xA;&amp;gt;&amp;gt;&amp;gt; import matplotlib&#xA;matplotlib.use('Agg')&#xA;matplotlib.use('Agg')&#xA;import matplotlib.pyplot as plt&#xA;import matplotlib.pyplot as plt&#xA;fig=plt.figure(figsize=(3,2))&#xA;fig=plt.figure(figsize=(3,2))&#xA;plt.plot([1,3,2])&#xA;plt.plot([1,3,2])&#xA;fig.tight_layout()&#xA;fig.tight_layout()&#xA;plt.savefig('myfig.pdf')&#xA;plt.savefig('myfig.pdf')&#xA;'myfig.pdf' # return this to org-mode&#xA;'myfig.pdf' # return this to org-mode&#xA;&#xA;&#xA;open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b180000gn/T/babel-64998Up/python-6499xhD', 'w').write(str(_))&#xA;open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b180000gn/T/babel-64998Up/python-6499xhD', 'w').write(str(_))&#xA;&#xA;&#xA;&#xA;&#xA;'org_babel_python_eoe'&#xA;'org_babel_python_eoe'&#xA;&amp;gt;&amp;gt;&amp;gt; [&amp;lt;matplotlib.lines.Line2D object at 0x10bc987f0&amp;gt;]&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; 'myfig.pdf'&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; 9&#xA;&amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; 'org_babel_python_eoe'&#xA;&amp;gt;&amp;gt;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the following works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :session :results file&#xA;'./myfig.pdf' # return this to org-mode&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;[[file:./myfig.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the problem here? How can I debug it? It seems like &lt;code&gt;matplotlib&lt;/code&gt; causes some problem.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Edit:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Same org file behaves as expected on a Linux box. The problem described above happens on Mac. So, probably it has something to do with the installed python versions. Still, I don't know how to debug it... &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Edit 2 (Debugging steps):&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Ok, I'm trying to break the steps. Consider the complete example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session :results file&#xA;import matplotlib             #1&#xA;matplotlib.use('Agg')         #2&#xA;import matplotlib.pyplot      #3&#xA;fig=plt.figure(figsize=(3,2)) #4&#xA;plt.plot([1,3,2])             #5&#xA;fig.tight_layout()            #6&#xA;plt.savefig('myfig.png')      #7&#xA;'myfig.png'                   #8 return this to org-mode&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I comment lines 1-7, then the results block is correct:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;[[file:myfig.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I start to add the lines in their order. Each time I exit the interpreter, so it will be a &quot;fresh&quot; run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With lines 1,8: The result is correct (as can be found above)&#xA;With lines 1-2,8: Still correct&#xA;With lines 1-3,8: Result is incorrect! &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;[[file:]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Therefore, if I understand correctly, this is not a problem of the interpreter, but something else. The version of python I use is (as indicated by &lt;code&gt;import sys; sys.version&lt;/code&gt; invoked from the interactive interpreter that was started by babel):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'3.4.3 (default, Feb 27 2015, 00:22:26) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Furthermore, &lt;code&gt;matplotlib.__version__&lt;/code&gt; yields: `1.4.3'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x version&lt;/code&gt; returns: &lt;code&gt;GNU Emacs 24.4.51.1 (x86_64-apple-darwin14.1.0, NS apple-appkit-1344.72) of 2015-02-02 on Boxname&lt;/code&gt; and it runs in OS X 10.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe this additional information can help someone solve this issue?&lt;/p&gt;&#xA;" OwnerUserId="861" LastEditorUserId="861" LastEditDate="2015-05-08T08:16:21.287" LastActivityDate="2016-03-03T12:32:01.903" Title="Org mode python session does not return a file name" Tags="|org-mode|python|" AnswerCount="0" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="11076" PostTypeId="2" ParentId="11059" CreationDate="2015-05-01T23:16:36.157" Score="1" Body="&lt;p&gt;Please check &lt;a href=&quot;https://emacs.stackexchange.com/questions/10337/emacs-sometimes-starts-automatically-recentering-cursor-position/10339#10339&quot;&gt;this answer&lt;/a&gt; to a similar question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try killing any buffer-list buffer.&lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-05-01T23:16:36.157" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11077" PostTypeId="1" AcceptedAnswerId="12099" CreationDate="2015-05-02T17:19:37.373" Score="3" ViewCount="97" Body="&lt;p&gt;Every once in a while I notice that the mode name on the mode-line&#xA;says &lt;code&gt;[Emacs-Lisp]&lt;/code&gt; instead of just &lt;code&gt;Emacs-Lisp&lt;/code&gt;. I realise that this&#xA;indicates a recursive edit, and I can get rid of it with &lt;code&gt;C-M-c&lt;/code&gt;, but&#xA;I never know what triggered it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to find out the cause of a current recursive-edit?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-05-03T13:21:02.443" Title="How to identify the source of a recursive edit?" Tags="|recursive-edit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11078" PostTypeId="1" AcceptedAnswerId="11079" CreationDate="2015-05-02T17:27:34.007" Score="9" ViewCount="1752" Body="&lt;p&gt;It seems like this should be pretty straightforward since Emacs knows how to display images.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a buffer, let's say I have a URL to an image like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;http://centre.nikkeiplace.org/wp-content/uploads/2012/07/aikido11.jpg&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to put the caret on that url, call a function like &lt;code&gt;expand-image-from-url&lt;/code&gt; and have it render the image in-line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this something that's easily possible?&lt;/p&gt;&#xA;" OwnerUserId="7015" LastEditorUserId="7015" LastEditDate="2015-05-02T18:10:52.433" LastActivityDate="2016-01-14T08:49:18.680" Title="Show image from image url in buffer" Tags="|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11079" PostTypeId="2" ParentId="11078" CreationDate="2015-05-02T18:16:59.290" Score="12" Body="&lt;p&gt;If you don't mind the image being displayed in a different buffer, just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x ffap&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you insist on the image appearing in the current buffer, you'll need to do just a little more work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'url)&#xA;&#xA;(defun insert-image-from-url (&amp;amp;optional url)&#xA;  (interactive)&#xA;  (unless url (setq url (url-get-url-at-point)))&#xA;  (unless url&#xA;    (error &quot;Couldn't find URL.&quot;))&#xA;  (let ((buffer (url-retrieve-synchronously url)))&#xA;    (unwind-protect&#xA;         (let ((data (with-current-buffer buffer&#xA;                       (goto-char (point-min))&#xA;                       (search-forward &quot;\n\n&quot;)&#xA;                       (buffer-substring (point) (point-max)))))&#xA;           (insert-image (create-image data nil t)))&#xA;      (kill-buffer buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2015-05-02T23:03:12.570" LastActivityDate="2015-05-02T23:03:12.570" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12079" PostTypeId="1" CreationDate="2015-05-02T19:03:02.380" Score="5" ViewCount="216" Body="&lt;p&gt;I'm a beginner in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In dired+, if I query the mouse click on a directory item with &lt;code&gt;C-h k&lt;/code&gt;, I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;----------------- up-event (short click) ----------------&#xA;&#xA;&amp;lt;mouse-2&amp;gt; at that spot is remapped to &amp;lt;mouse-2&amp;gt;, which runs the&#xA;command dired-mouse-find-file-other-window, which is an interactive&#xA;compiled Lisp function in `dired+.el'.&#xA;&#xA;...&#xA;&#xA;----------------- up-event (long click) ----------------&#xA;&#xA;Pressing &amp;lt;mouse-1&amp;gt; at that spot for longer than 450 milli-seconds&#xA;runs the command mouse-set-point, which is an interactive compiled&#xA;Lisp function in `mouse.el'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I set these &quot;short&quot; and &quot;long&quot; clicks somewhere? I couldn't find anything about mouse-up events; is this specific to dired+? Also, it seemed to me that the short click is mapped to &lt;code&gt;mouse-2&lt;/code&gt; somehow; if I set &lt;code&gt;mouse-2&lt;/code&gt;, then the &lt;code&gt;mouse-1&lt;/code&gt; short click changed accordingly. I find this a bit annoying though, because I can't set &lt;code&gt;mouse-2&lt;/code&gt; and the &lt;code&gt;mouse-1&lt;/code&gt; short click to different commands. I'd like to also be able to set them differently. &lt;/p&gt;&#xA;" OwnerUserId="7214" LastEditorUserId="105" LastEditDate="2015-05-03T15:24:20.867" LastActivityDate="2015-06-02T15:38:13.917" Title="`mouse-1` (button 1) follows links, like `mouse-2` does - how to modify the behavior?" Tags="|mouse|hyperlinks|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12080" PostTypeId="1" CreationDate="2015-05-02T22:49:23.350" Score="1" ViewCount="102" Body="&lt;p&gt;When writing text, I would like not to have to press &quot;Shift&quot; when, say, the preceding text is a sentence end (e.g., &lt;code&gt;&quot;.  &quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for example, if I have written &lt;code&gt;Hi.&lt;/code&gt; and then I type &lt;code&gt;b&lt;/code&gt;, a &lt;code&gt;B&lt;/code&gt; should appear on the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine this could be done by advising &lt;code&gt;self-insert-command&lt;/code&gt; or &lt;code&gt;expand-abbrev&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important that the solution works well with abbreviations.  So, if &lt;code&gt;b&lt;/code&gt; is expanded into &quot;bye&quot;, then typing &lt;code&gt;b&lt;/code&gt; in the previous example should expand into &lt;code&gt;Bye&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to use the &lt;code&gt;auto-capitalize&lt;/code&gt; package, as it is noticeably slow and sometimes incompatible with other packages.&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-05-02T22:49:23.350" Title="Simulate shift key press depending on preceding text" Tags="|key-bindings|capitalization|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12081" PostTypeId="1" AcceptedAnswerId="12083" CreationDate="2015-05-02T23:05:28.717" Score="4" ViewCount="178" Body="&lt;p&gt;I use subword-mode when I'm editing Python and C++ code, and it's jarring when deleting a word backwards/forwards (Ctrl+Space and Ctrl+Delete) works one way in the source code buffer and a different way when I'm in the minibuffer. Is there a way to make it consistent? I've never tried having a minor mode active in a minibuffer before.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-05-03T03:19:12.933" Title="subword-mode in minibuffer?" Tags="|minibuffer|subword-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12082" PostTypeId="1" AcceptedAnswerId="12087" CreationDate="2015-05-03T01:06:45.467" Score="1" ViewCount="419" Body="&lt;p&gt;Given a face using a proportional font, can an accurate pixel width of a single row of text be measured in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Note: not monospaced text.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="2485" LastEditDate="2015-05-03T01:19:32.380" LastActivityDate="2015-05-04T00:26:00.773" Title="EmacsLisp : Can the pixel width of text in a proportional font be measured?" Tags="|faces|elisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12083" PostTypeId="2" ParentId="12081" CreationDate="2015-05-03T03:19:12.933" Score="5" Body="&lt;p&gt;You can enable the subword mode in the minibuffer by adding the below to your emacs init.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'minibuffer-setup-hook #'subword-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same applies for any hook and minor mode. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-Misc.html&quot; rel=&quot;noreferrer&quot;&gt;Emacs manual - Minibuffer Misc&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-05-03T03:19:12.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12084" PostTypeId="1" AcceptedAnswerId="12088" CreationDate="2015-05-03T06:31:19.960" Score="3" ViewCount="2901" Body="&lt;p&gt;I try to install merlin by typing &quot;opam install merlin&quot; in the terminal. After the installation is done, I am asked to do this, but it doesn't seem to work. The github instruction seems to be different&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xBXeF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(load &quot;/Users/yxchng/.opam/system/share/emacs/site-lisp/tuareg-site-file&quot;)&#xA;&#xA;&#xA;(add-to-list 'load-path&#xA;&quot;/Users/yxchng/.opam/system/share/emacs/site-lisp&quot;)&#xA;(require 'ocp-indent)&#xA;&#xA;&#xA;;; Add opam emacs directory to the load-path&#xA;(setq opam-share (substring (shell-command-to-string &quot;opam config var&#xA;share 2&amp;gt; /dev/null&quot;) 0 -1))&#xA;(add-to-list 'load-path (concat opam-share &quot;/emacs/site-lisp&quot;))&#xA;;; Load merlin-mode&#xA;(require 'merlin)&#xA;;; Start merlin on ocaml files&#xA;(add-hook 'tuareg-mode-hook 'merlin-mode t)&#xA;(add-hook 'caml-mode-hook 'merlin-mode t)&#xA;;; Enable auto-complete&#xA;(setq merlin-use-auto-complete-mode 'easy)&#xA;;; Use opam switch to lookup ocamlmerlin binary&#xA;(setq merlin-command 'opam)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I added this code to .emacs but it doesn't seem to work&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it gives me spurious error and says &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/local/Cellar/emacs/24.5/Emacs.app/Contents/MacOS/Emacs: \&#xA;/bin/bash: opam: command not found/ocamlmerlin: No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(linebreak added to prevent scrolling)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error is like this &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QMkfH.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;How should I solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="8219" LastEditorUserId="115" LastEditDate="2015-05-03T11:56:28.977" LastActivityDate="2017-02-12T23:39:51.380" Title="How to get merlin mode to work in emacs?" Tags="|osx|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12085" PostTypeId="2" ParentId="11069" CreationDate="2015-05-03T06:43:04.000" Score="3" Body="&lt;p&gt;Emacs comes with a timer feature that allows you to run a function in periodical intervals.  Some packages abuse this feature by setting their timer intervals very low (around 0.01s) and use it for polling, if they don't manage cleaning up the timers after themselves and leave spurious ones in the &lt;code&gt;timer-list&lt;/code&gt;, one after-effect is flickering of letters after point in syntax-highlighted buffers (the other one is more wakeups/CPU usage than necessary).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To check up whether that's the cause of your problem, inspect this timer list with &lt;code&gt;F1 v timer-list&lt;/code&gt; (or with &lt;code&gt;M-x helm-timers&lt;/code&gt; if you've got &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;helm&lt;/a&gt; installed) and see whether it contains repeated entries that can be traced back to a specific package.  I used to have such problems with the &lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow&quot;&gt;Auto-Complete&lt;/a&gt;, popwin and helm packages (though, helm seems to have finally fixed it, I've migrated from Auto-Complete to &lt;a href=&quot;https://github.com/company-mode/company-mode&quot; rel=&quot;nofollow&quot;&gt;company-mode&lt;/a&gt;).  Either get the packages themselves fixed (be it by handing in a pull request or submitting a ticket on their issue tracker), write better ones (what I did with popwin in favour of &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow&quot;&gt;shackle&lt;/a&gt;) or just abstain from them completely.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-05-03T06:43:04.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12086" PostTypeId="1" AcceptedAnswerId="12116" CreationDate="2015-05-03T06:45:03.090" Score="12" ViewCount="3006" Body="&lt;p&gt;I'm starting to use &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;noreferrer&quot;&gt;Spacemacs&lt;/a&gt; and occasionally I get stuck with Emacs beginning to require infinite amount of CPU and memory. Inspecting my &lt;code&gt;.emacs.d/.cache&lt;/code&gt; folder reveals that the file &lt;code&gt;savehist&lt;/code&gt; is 1.16 GB large... Deleting this file made Emacs work again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Googling returned no result for me. Is there any precedent of such an abnormality, and how might one try to debug and fix it.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="16543" LastEditDate="2020-03-04T00:55:20.310" LastActivityDate="2023-06-22T12:24:43.067" Title="High CPU/memory usage and abnormally large savehist file?" Tags="|spacemacs|history|history-variables|savehist-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="12087" PostTypeId="2" ParentId="12082" CreationDate="2015-05-03T07:44:45.553" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Size-of-Displayed-Text.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;In the Emacs 24.4+ Manual Section 37.10 Size of Displayed Text&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The following function returns the size in pixels of text as if it were displayed in a given window.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt; &lt;code&gt;window-text-pixel-size &amp;amp;optional window from to x-limit y-limit mode-and-header-line&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This function returns the size of the text of window’s buffer in pixels. &lt;code&gt;window&lt;/code&gt; must be a live window and defaults to the selected one. The return value is a cons of the maximum pixel-width of any text line and the maximum pixel-height of all text lines.&lt;/p&gt;&#xA;&lt;p&gt;The optional argument &lt;code&gt;from&lt;/code&gt;, if non-nil, specifies the first text position to consider and defaults to the minimum accessible position of the buffer. If &lt;code&gt;from&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;, it uses the minimum accessible position that is not a newline character. The optional argument &lt;code&gt;to&lt;/code&gt;, if non-nil, specifies the last text position to consider and defaults to the maximum accessible position of the buffer. If &lt;code&gt;to&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;, it uses the maximum accessible position that is not a newline character.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;See the documentation for full details on the other parameters.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Please Note:&lt;/strong&gt; window-text-pixel-size is a function introduced in emacs 24.4&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-04T00:26:00.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12088" PostTypeId="2" ParentId="12084" CreationDate="2015-05-03T09:36:31.843" Score="6" Body="&lt;p&gt;OS X does not evaluate your shell configuration for GUI applications.  Hence, your Emacs runs with a different &lt;code&gt;$PATH&lt;/code&gt; than your shell, and thus can't find the &lt;code&gt;opam&lt;/code&gt; executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;exec-path-from-shell&lt;/a&gt; package helps you to work around this issue.  Simply install the package with &lt;code&gt;M-x package-install&lt;/code&gt; and then add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (memq window-system '(mac ns))&#xA;  (exec-path-from-shell-initialize))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Likewise, I'd recommend you to install Merlin via &lt;code&gt;M-x package-install RET merlin&lt;/code&gt;, because that makes all the &lt;code&gt;load-path&lt;/code&gt; management in your init file redundant, and reduces your OPAM configuration to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'tuareg-mode-hook #'merlin-mode)&#xA;(add-hook 'caml-mode-hook #'merlin-mode) ; If you really like to use Caml Mode&#xA;&#xA;(with-eval-after-load 'merlin&#xA;  (setq merlin-command 'opam))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="14530" LastEditDate="2017-02-12T23:39:51.380" LastActivityDate="2017-02-12T23:39:51.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12089" PostTypeId="1" CreationDate="2015-05-03T09:41:33.703" Score="9" ViewCount="3033" Body="&lt;p&gt;Is it possible that emacs shows real formulas in the editor if they are written in Latex or similiar? I am asking because it would be much more readable if you are coding (in lets say python or C++) and the comments contain real formulas instead of something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// Calculate average for $\mu_1 = \frac{1}{n} ~ \sum_{1=i}^n ~ x_i$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a plugin which compiles Latex code in a comment to a picture and display it in the editor?&lt;/p&gt;&#xA;" OwnerUserId="5122" LastActivityDate="2019-11-12T22:48:10.417" Title="Show math formula in emacs when coding" Tags="|latex|display|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12091" PostTypeId="5" CreationDate="2015-05-03T09:56:02.753" Score="0" Body="" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-05-03T09:56:02.753" LastActivityDate="2015-05-03T09:56:02.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12092" PostTypeId="4" CreationDate="2015-05-03T09:56:02.753" Score="0" Body="Make a video of an Emacs session" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-05-03T09:56:02.753" LastActivityDate="2015-05-03T09:56:02.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12093" PostTypeId="2" ParentId="12089" CreationDate="2015-05-03T10:00:35.217" Score="1" Body="&lt;p&gt;It seems to me that an actual image would be more trouble than it's worth in &lt;code&gt;c++-mode&lt;/code&gt; or &lt;code&gt;python-mode&lt;/code&gt;.  It could work in &lt;code&gt;org-mode&lt;/code&gt; though, which has a mechanism for storing the images and refreshing them.  Even then, it's awkward for scrolling if the image has a large height.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can still fontify bits if you want. For instance, here's my setup for font-locking doxygen tags in C++:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defface font-lock-doxygen-face&#xA;    '((nil (:foreground &quot;SaddleBrown&quot; :background &quot;#f7f7f7&quot;)))&#xA;  &quot;Special face to highlight doxygen tags such as &amp;lt;tt&amp;gt;...&amp;lt;/tt&amp;gt;&#xA;and &amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt;.&quot;&#xA;  :group 'font-lock-highlighting-faces)&#xA;&#xA;(font-lock-add-keywords&#xA; 'c++-mode&#xA; '((&quot;\\(&amp;lt;\\(?:code\\|tt\\)&amp;gt;\&quot;?\\)\\([^&amp;lt;]*?\\)\\(\&quot;?&amp;lt;/\\(?:code\\|tt\\)&amp;gt;\\)&quot;&#xA;    (0 (prog1 ()&#xA;         (let* ((expr (match-string-no-properties 2))&#xA;                (expr-len (length expr)))&#xA;           (if (eq 1 expr-len)&#xA;               (compose-region (match-beginning 0)&#xA;                               (match-end 0)&#xA;                               (aref expr 0))&#xA;             (compose-region (match-beginning 1)&#xA;                             (1+ (match-end 1))&#xA;                             (aref expr 0))&#xA;             (compose-region (1- (match-beginning 3))&#xA;                             (match-end 3)&#xA;                             (aref expr (1- expr-len)))))))&#xA;    (0 'font-lock-doxygen-face t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will replace &lt;code&gt;&amp;lt;tt&amp;gt;foo&amp;lt;/tt&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;code&amp;gt;bar&amp;lt;/code&amp;gt;&lt;/code&gt; with colored symbols.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-03T10:00:35.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12094" PostTypeId="5" CreationDate="2015-05-03T10:01:02.020" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Picture-Mode.html&quot; rel=&quot;nofollow&quot;&gt;Picture mode&lt;/a&gt; is a major mode to edit ASCII art pictures. In Picture mode, the cursor transparently moves beyond the right margin and the last line of the file; if characters are inserted in these positions, spaces and newlines are automatically added to reach the right position.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-05-03T10:01:02.020" LastActivityDate="2015-05-03T10:01:02.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12095" PostTypeId="4" CreationDate="2015-05-03T10:01:02.020" Score="0" Body="Picture mode is a major mode to edit ASCII art pictures" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-05-03T10:01:02.020" LastActivityDate="2015-05-03T10:01:02.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12096" PostTypeId="1" AcceptedAnswerId="12097" CreationDate="2015-05-03T10:43:01.947" Score="5" ViewCount="2894" Body="&lt;p&gt;I'd like to match either word start or subword start in a simple way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I went with this regex: &lt;code&gt;&quot;\\(\\b\\sw\\)\\|\\(?:[^A-Z]\\([A-Z]\\)\\)&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I want to skip &lt;code&gt;[^A-Z]&lt;/code&gt; and only get the bounds for &lt;code&gt;[A-Z]&lt;/code&gt;, otherwise it would be simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I expected: since there are two capturing groups, tied with an &lt;code&gt;\\|&lt;/code&gt;, (match-string 1) should give me what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I got: if a word start matches it's in &lt;code&gt;(match-string 1)&lt;/code&gt;, and if a subword start matches it's in &lt;code&gt;(match-string 2)&lt;/code&gt;.  That seems pretty useless with no chance to collect the matches in a generic way.  How could I rebuild the regex to have both cases in &lt;code&gt;(match-string 1)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-07-11T04:46:55.620" LastActivityDate="2015-07-11T04:46:55.620" Title="Emacs regex group assignment" Tags="|elisp|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12097" PostTypeId="2" ParentId="12096" CreationDate="2015-05-03T11:12:10.493" Score="10" Body="&lt;p&gt;I don't know where your expectation comes from, but I for my part don't know any programming language where it'd hold.  In every regular expression engine I'm aware of anonymous groups are numbered in order of appearance, Emacs Lisp being no exception.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your pattern has two distinct anonymous groups, which are numbered from left to right.  Hence the first branch gets the number 1, the second gets number 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see, though, why this should be “useless”.  Since the groups are in distinct branches of an alternation, you can just use &lt;code&gt;(or (match-string 1) (match-string 2))&lt;/code&gt; to extract the matching text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can give explicit numbers to both groups:  &lt;code&gt;&quot;\\(?1:\\b\\sw\\)\\|\\(?:[^A-Z]\\(?1:[A-Z]\\)\\)&quot;&lt;/code&gt;.  With this pattern, both groups get the same number, and the matching text always ends up in &lt;code&gt;(match-string 1)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-05-03T11:12:10.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12098" PostTypeId="2" ParentId="12089" CreationDate="2015-05-03T12:53:24.403" Score="5" Body="&lt;p&gt;Yes. See &lt;code&gt;pretty-symbols&lt;/code&gt; package. It can look like this, for example, when coding Python, or any other language:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cNDLm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-05-03T12:53:24.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12099" PostTypeId="2" ParentId="11077" CreationDate="2015-05-03T13:21:02.443" Score="2" Body="&lt;p&gt;I don't think there's a &quot;clean command&quot; that will tell you that directly.  But &lt;code&gt;M-x debug RET&lt;/code&gt; will give you the current backtrace, where you should be able to find both &lt;code&gt;recursive-edit&lt;/code&gt; and its predecessor (i.e. caller).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-03T13:21:02.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12100" PostTypeId="2" ParentId="12079" CreationDate="2015-05-03T13:22:46.297" Score="4" Body="&lt;p&gt;You want to look at &lt;code&gt;C-h v mouse-1-click-follows-link RET&lt;/code&gt;, I think.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-03T13:22:46.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12101" PostTypeId="2" ParentId="6036" CreationDate="2015-05-03T14:41:17.510" Score="1" Body="&lt;p&gt;Okay so I had to update one of the libraries that my old version of emacs was using so I took this week-end as an opportunity to make my own major mode for HaXe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I based it on fundamental mode, which may be controversial because CC-mode might make more sense, but we'll avoid future problems with CC-mode evolution — as it was the case here — when doing so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in case it helps anybody, here's a public git (I've released it on GPL v3):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/pierre-arlaud/funda-haxe-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/pierre-arlaud/funda-haxe-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mode is pretty basic but it somehow supports syntax highlighting and indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found a few minor bugs or improvements to make already, but at this point I believe it's already better than using a javascript mode.&lt;/p&gt;&#xA;" OwnerUserId="4088" LastActivityDate="2015-05-03T14:41:17.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12102" PostTypeId="1" AcceptedAnswerId="12104" CreationDate="2015-05-03T15:39:54.843" Score="6" ViewCount="2995" Body="&lt;p&gt;When programming in Emacs Lisp, should variable and function names always be lower case? According to &lt;a href=&quot;https://github.com/bbatsov/emacs-lisp-style-guide#naming&quot; rel=&quot;nofollow&quot;&gt;The Emacs Lisp Style Guide&lt;/a&gt; they should use &lt;code&gt;&quot;lisp-case&quot;&lt;/code&gt;, but what is that? In &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html&quot; rel=&quot;nofollow&quot;&gt;Emacs Lisp manual&lt;/a&gt; the case of symbols is not mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The motivation for this question came when I studied the Lisp code for &lt;code&gt;M-x buffer-menu&lt;/code&gt;, see  &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/buff-menu.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-mirror/emacs/blob/master/lisp/buff-menu.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see that the code mixes two types of symbols. One type is starting with &lt;code&gt;Buffer-menu&lt;/code&gt; (note capital B) and the other is starting with &lt;code&gt;buffer-menu&lt;/code&gt;.. I think this is confusing, is this a recommended way of programming?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="105" LastEditDate="2015-05-20T05:04:24.610" LastActivityDate="2015-05-20T05:04:24.610" Title="Naming convention for variable and function names" Tags="|elisp|symbols|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12103" PostTypeId="1" CreationDate="2015-05-03T16:00:35.020" Score="2" ViewCount="789" Body="&lt;p&gt;I am currently writing a conversion from org-mode headline deadlines/schedules to pgf-gantt charts.&#xA;Ideally I would like to create a &lt;a href=&quot;http://orgmode.org/manual/Dynamic-blocks.html&quot; rel=&quot;nofollow&quot;&gt;custom dynamic block&lt;/a&gt; that contains the result of my parsing, and then have a custom exporter for that dynamic block that creates the pgf-gantt code, so that I can later add exporters for other formats.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1: So, is there a mechanism similar to org-dblock-write: only for exporting dblocks? I cannot find any documentation on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2: If there is no such mechanism, what would be the best way of storing that pgf source code so that it gets integrated into latex export, but doesn't interfere with other exporters?&lt;/p&gt;&#xA;" OwnerUserId="8218" LastEditorUserId="8218" LastEditDate="2015-05-03T17:34:08.780" LastActivityDate="2015-05-03T17:34:08.780" Title="Exporting custom dynamic org-mode blocks" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12104" PostTypeId="2" ParentId="12102" CreationDate="2015-05-03T16:09:27.720" Score="13" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There is no &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html&quot; rel=&quot;noreferrer&quot;&gt;GNU Emacs convention&lt;/a&gt; wrt case for Emacs-Lisp function and variable names.  (There can be any number of such &quot;conventions&quot; that anyone could come up with, of course.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &quot;&lt;a href=&quot;https://github.com/bbatsov/emacs-lisp-style-guide#naming&quot; rel=&quot;noreferrer&quot;&gt;Emacs Lisp Style Guide&lt;/a&gt;&quot; that you reference is just one person's proposed guidelines.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A (very) few longstanding libraries distributed with Emacs do use two styles that you mentioned: Some names are title-case (capitalized) and some are lowercase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some cases a distinction was made between names of commands and customizable variables that it is expected might be &lt;em&gt;typed&lt;/em&gt; by users (e.g., for &lt;code&gt;M-x&lt;/code&gt; or &lt;code&gt;C-h f&lt;/code&gt;), and names of non-interactive functions and variables that are expected to be invoked mainly by keys or from Lisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this has not been adopted generally, and it has not always been implemented consistently.  It typically applies to particular modes (e.g. &lt;code&gt;Info-mode&lt;/code&gt;) where there are lots of commands that a user is not expected to input by name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the commands in &lt;code&gt;buff-menu.el&lt;/code&gt; that are expected to be invoked mainly by &lt;code&gt;M-x&lt;/code&gt; are lowercase (for typing convenience), and the commands that are bound to keys in the buffer-list display are capitalized, as are other objects in the library (variables, non-interactive functions, etc.).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such libraries are a small minority (hence the doc says that &lt;em&gt;usually&lt;/em&gt; function and variable names are lowercase).  But the logic behind this design by RMS 30 years ago is still valid today.  The idea is to simplify choices (and typing) for commands that you might invoke using &lt;code&gt;M-x&lt;/code&gt;, by excluding commands that are useful only in a particular buffer and are bound to keys there.  So &lt;code&gt;Info-prev-reference&lt;/code&gt; (bound to &lt;code&gt;C-M-i&lt;/code&gt; in Info), but &lt;code&gt;info-apropos&lt;/code&gt; (useful outside Info).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Usually it makes sense to use all lowercase, especially for names that a user will type (e.g., to &lt;code&gt;M-x&lt;/code&gt;, as input).  It's just easier that way.  And in practice most names are in fact lowercase.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But you can use whatever you want. Use whatever you feel is &lt;em&gt;most convenient for your use cases&lt;/em&gt;.  It is the particular context that should guide you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is important for your use case to distinguish command &lt;code&gt;Abc&lt;/code&gt; from command &lt;code&gt;abc&lt;/code&gt;, go for it.  This is &lt;strong&gt;Lisp&lt;/strong&gt;.  You can have command, variable, face,.. whatever names that start with digits, symbols (e.g. &lt;code&gt;&amp;gt;&lt;/code&gt;), etc. - pretty much any chars you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to keep things simple for most users who might type a name using a common keyboard, then you might want to stick with lowercase &lt;code&gt;a&lt;/code&gt; to &lt;code&gt;z&lt;/code&gt; plus digits and hyphen (&lt;code&gt;-&lt;/code&gt;) instead of underscore (&lt;code&gt;_&lt;/code&gt;), to obviate their needing to use the Shift key.  But it's really up to you.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-07T15:22:34.910" LastActivityDate="2015-05-07T15:22:34.910" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12105" PostTypeId="1" CreationDate="2015-05-03T16:31:43.550" Score="12" ViewCount="3311" Body="&lt;p&gt;I'm an avid helm user and am reading the description for icicles. It includes things like:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;cycle through completion candidates that match your current input *&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which sounds weaker to me than seeing the entire list of matches in helm (since I'm willing to have a buffer open up like that)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;use a pattern to match completion candidates, including:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which is exactly a Helm feature, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Icicles sounds like a good package but it seems to be a direct competitor to Helm, and in exploring Icicles, I haven't found a reason to install it given that I have Helm. What features might I be missing?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-05-03T17:13:32.800" Title="Does icicles offer features that Helm doesn't?" Tags="|helm|completion|icicles|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12106" PostTypeId="2" ParentId="12105" CreationDate="2015-05-03T16:41:23.320" Score="12" Body="&lt;p&gt;A good answer would be quite long. The short answer is yes. Each of Helm and Icicles offers features not offered by the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are not necessarily alternatives/competitors. You can use both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wrt your question about matching candidates, there is no difference wrt showing all candidates. IOW, Icicles too will show all candidates anytime you like (including initially, without hitting any keys).  &quot;&lt;em&gt;candidates that match your current input&lt;/em&gt;&quot; is completely general, and includes the case of your input being empty, which means all candidates are included.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a high-level list of the &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#MostImportantFeatures&quot;&gt;most important Icicles features&lt;/a&gt;. Some of these have also been added progressively to Helm over the years, if in a different form.  Other answers to your question might help more wrt what Helm offers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, I seriously doubt that a discussion of what you can or cannot do with each of these packages is useful here.  My suggestion, if you are interested in exploring Icicles, would be to try it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But just as using Helm benefits from (or implies or requires) a different mental model (mindset) from using vanilla Emacs, so does using Icicles.  To try Icicles or Helm, it is helpful to try to do things the Icicles way or the Helm way, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Icicles is not Helm, and Helm is not Icicles.  Neither tries to be the other.  Expecting to use one the same way you use the other would (a) likely be disappointing and (b) make you miss a lot (including the point of the design).  It's a bit like an &quot;avid&quot; &lt;code&gt;vi&lt;/code&gt; user taking a look at Emacs (or an Emacs user taking a look at &lt;code&gt;vi&lt;/code&gt;).  If you really want to check it out then try to get into its approach/POV, instead of asking how to reproduce a particular behavior or effect you are used to and are &quot;avid&quot; about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deciding to take a look at Icicles based only on a feature-list comparison with Helm would take the fun out of learning Icicles, IMHO.&#xA;It's kind of like learning a new math subject: you just have to go with the flow of &lt;em&gt;Let x...&lt;/em&gt;, to give it the benefit of the doubt. See what happens next and subsequently discover why it might be interesting and what you can do with it.  If your attitude from the outset is &quot;&lt;em&gt;What good is linear algebra (or group theory or...)?&lt;/em&gt;&quot; then I'd say don't bother - it might not be any good to you at all.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-03T17:13:32.800" LastActivityDate="2015-05-03T17:13:32.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12109" PostTypeId="2" ParentId="12102" CreationDate="2015-05-03T19:28:02.733" Score="5" Body="&lt;p&gt;Nothing is set in stone or enforced. That said, I highly recommend&#xA;the lower-case and hyphens style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only relevant thing I've found is in custom.texi:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As described in @ref{Commands}, each Emacs command is a Lisp&#xA;  function whose definition provides for interactive use.  Like every&#xA;  Lisp function, a command has a function name, which usually consists&#xA;  of lower-case letters and hyphens.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Apparently, there are ~6% of upcase symbols loaded on my system:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(let ((case-fold-search nil)&#xA;      (up 0)&#xA;      (down 0))&#xA;  (mapatoms (lambda (x)&#xA;              (cond ((string-match &quot;^[A-Z]&quot; (symbol-name x))&#xA;                     (cl-incf up))&#xA;                    ((string-match &quot;^[a-z]&quot; (symbol-name x))&#xA;                     (cl-incf down)))))&#xA;  (list up down (/ (float up) (+ up down))))&#xA;;; =&amp;gt;&#xA;;; (4518 67496 0.06273780098314216)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-05-06T09:44:42.910" LastActivityDate="2015-05-06T09:44:42.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12110" PostTypeId="1" AcceptedAnswerId="12112" CreationDate="2015-05-03T20:39:58.757" Score="2" ViewCount="515" Body="&lt;p&gt;Let's say I have a language which looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;anchor (item something item some thing item some item thing) item item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and that I'm playing with font-lock a bit. I would like to highlight &quot;anchor&quot; as being a function and every &quot;item&quot; in the parens as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq test-font-lock-keywords&#xA;      `(&#xA;        (&quot;\\&amp;lt;anchor\\&amp;gt;&quot; (0 font-lock-function-name-face)&#xA;         (&quot;\\&amp;lt;item\\&amp;gt;&quot; nil nil (0 font-lock-constant-face))&#xA;         )&#xA;        )&#xA;)&#xA;&#xA;(define-derived-mode test-mode fundamental-mode&#xA;  &quot;test mode&quot;&#xA;  &quot;Test mode&quot;&#xA;  (kill-all-local-variables)&#xA;  (interactive)&#xA;  (setq font-lock-defaults '(test-font-lock-keywords))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem is that it considers every &quot;item&quot; word that comes after an &quot;anchor&quot; until the &lt;em&gt;end&lt;/em&gt; of the line. The words &quot;item item&quot; in the end of my example should thus not receive syntax highlighting.&#xA;There may be a way to achieve this with a &lt;em&gt;post-form&lt;/em&gt; but I'm not sure that's how it's meant to be used or how to do it anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I tried with the following, much less sexy regular expression:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq regexp &quot;\\(\\&amp;lt;anchor\\&amp;gt;\\)[\t ]*(\\(?:\\(item\\)\\|[^)]\\)*)&quot;)&#xA;&#xA;(setq test-font-lock-keywords&#xA;      `(&#xA;        (,regexp (1 font-lock-function-name-face) (2 font-lock-constant-face))&#xA;       )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it only highlights the last found &quot;item&quot; before the parens. How can I make this regex capture every &quot;item&quot; here represented with index 2?&lt;/p&gt;&#xA;" OwnerUserId="4088" LastActivityDate="2015-05-03T21:06:59.377" Title="Repeated regex capture for font-lock" Tags="|regular-expressions|font-lock|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12111" PostTypeId="1" CreationDate="2015-05-03T21:05:00.777" Score="12" ViewCount="2303" Body="&lt;p&gt;I'm reading the &lt;code&gt;ido&lt;/code&gt; source and see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defgroup ido nil&#xA; &quot;Switch between files using substrings.&quot;&#xA; :group 'extensions&#xA; :group 'convenience&#xA; :version &quot;22.1&quot;&#xA; :link '(emacs-commentary-link :tag &quot;Commentary&quot; &quot;ido.el&quot;)&#xA; :link '(emacs-library-link :tag &quot;Lisp File&quot; &quot;ido.el&quot;)&#xA; :link '(custom-manual &quot;(ido) Top&quot;)&#xA; :link '(info-link &quot;(ido) Customization&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defgroup&lt;/code&gt; appears at the top of many large packages. I see it does this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Declare SYMBOL as a customization group containing MEMBERS.&#xA;  SYMBOL does not need to be quoted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Customization-Groups.html&quot;&gt;page on customization groups&lt;/a&gt; doesn't really answer when or how to use them. When or how do you use them?&lt;/p&gt;&#xA;" OwnerUserId="6641" LastActivityDate="2015-05-03T22:51:08.147" Title="Why is defgroup useful?" Tags="|customization|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12112" PostTypeId="2" ParentId="12110" CreationDate="2015-05-03T21:06:59.377" Score="3" Body="&lt;p&gt;There is a little-known secret hidden in the &lt;em&gt;pre-match form&lt;/em&gt;. This is from the built-in help of the &lt;code&gt;font-lock-keywords&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;if PRE-MATCH-FORM returns a position greater than the position after&#xA;  PRE-MATCH-FORM is evaluated, that position is used as the limit of the search.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Below, the pre-match form set the end of the parentesis following &lt;code&gt;anchor&lt;/code&gt; as the end of the search:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;\\_&amp;lt;anchor *(&quot;&#xA;   (0 font-lock-function-name-face)&#xA;   (&quot;\\_&amp;lt;\\item\\_&amp;gt;&quot;&#xA;    ;; Pre-match form -- limit the sub-search to the end of the argument list.&#xA;    (save-excursion&#xA;      (goto-char (match-end 0))&#xA;      (backward-char)&#xA;      (ignore-errors&#xA;        (forward-sexp))&#xA;      (point))&#xA;    ;; Post-match form&#xA;    (goto-char (match-end 0))&#xA;    (0 font-lock-constant-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: If you set &lt;code&gt;font-lock-multiline&lt;/code&gt; to a non-nil value, this works even when the &lt;code&gt;anchor&lt;/code&gt; construct span multiple lines.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-05-03T21:06:59.377" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12113" PostTypeId="1" CreationDate="2015-05-03T22:34:48.477" Score="2" ViewCount="920" Body="&lt;p&gt;So I've been trying to learn and use both Emacs and Org-mode for a while and it has been going pretty well but I am certainly a beginner in these topics including Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this really good-looking org package called org-drill and I've been struggling to get it running. I initially tried what it said in the installation manual, as in changing the org default variables and ticking the box where it says dril... that didn't work. I tried googling for a bit and I figured that maybe I don't have contrib packages installed. I tried doing what was given as the answer here: &lt;a href=&quot;https://emacs.stackexchange.com/questions/7890/org-plus-contrib-and-org-with-require-or-use-package&quot;&gt;org-plus-contrib and org with `require` or `use-package`&lt;/a&gt;&#xA;again, to no avail. I tried manually searching for the package org-plus-contrib and I couldn't find it. In my init.el I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ELPA&#xA;(setq package-user-dir (concat dotfiles-dir &quot;elpa&quot;))&#xA;(require 'package)&#xA;(dolist (source '((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;              (&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;              (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)&#xA;              (&quot;elpa&quot; . &quot;http://tromey.com/elpa/&quot;)))&#xA;  (add-to-list 'package-archives source t))&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So as I said, installing org-plus-contrib doesn't work. Neither does manually searching for it. Is it already installed? Am I missing something? Requiring org-drill in any manner doesn't work either. Do I have to manually include the contrib folder? I tried searching where it is but that didn't work either. I'm just not sure where to look next.&#xA;Any suggestions would be brilliant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="8222" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-05-04T00:54:52.743" Title="Can't load org-drill package" Tags="|org-mode|org-drill|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="12114" PostTypeId="2" ParentId="12111" CreationDate="2015-05-03T22:40:38.713" Score="10" Body="&lt;p&gt;When and why do you use any grouping? To be able to act on the group as a whole or on its individual members - only its members.  That's the answer here also.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;There are commands and other functions that act on a given group or set of groups. &lt;code&gt;customize-group&lt;/code&gt; is one that acts on a given group. &lt;code&gt;customize-apropos-groups&lt;/code&gt; is one that acts on a set of groups.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When you use &lt;code&gt;customize-group&lt;/code&gt; you see links that let you customize subgroups (if any) and individual members (options and faces) of that group.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In addition, a group typically has a prefix, and you can use that for pattern-matching against function, face, etc. names when you interact with Emacs. This is another way of limiting actions to a given set (customization group) of things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A group can also provide quick access to the online doc, source code, bug reporting, etc. for a package.  Here, for instance, is the definition of group &lt;code&gt;Icicles-Key-Completion&lt;/code&gt; (with some code elided).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defgroup Icicles-Key-Completion nil&#xA;  &quot;Icicles preferences related to key completion (`icicle-complete-keys').&quot;&#xA;  :prefix &quot;icicle-&quot; :group 'Icicles&#xA;  :link `(url-link :tag &quot;Send Bug Report&quot; ...)&#xA;  :link '(url-link :tag &quot;Other Libraries by Drew&quot; ...)&#xA;  :link '(url-link :tag &quot;Download&quot; ...)&#xA;  :link '(url-link :tag &quot;Description&quot; ...)&#xA;  :link '(emacs-commentary-link :tag &quot;Doc-Part2&quot; &quot;icicles-doc2&quot;)&#xA;  :link '(emacs-commentary-link :tag &quot;Doc-Part1&quot; &quot;icicles-doc1&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This group is itself a subgroup of group &lt;code&gt;Icicles&lt;/code&gt; (see &lt;code&gt;:group&lt;/code&gt;).  It provides links in the Customize buffer for sending a bug report, downloading, and accessing the doc in the source code or on the Web.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-03T22:51:08.147" LastActivityDate="2015-05-03T22:51:08.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12115" PostTypeId="1" AcceptedAnswerId="12117" CreationDate="2015-05-04T04:32:34.140" Score="16" ViewCount="855" Body="&lt;p&gt;Why do elisp files usually end with&#xA;&lt;code&gt;;;; file.el ends here&lt;/code&gt;?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some historical reason why this was useful? I've seen it recommended in elisp style guides and I still see it in modern elisp packages.  &lt;code&gt;auto-insert-mode&lt;/code&gt; also adds such a comment to new elisp files by default.&lt;/p&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="97" LastEditDate="2015-11-23T13:49:08.167" LastActivityDate="2015-11-23T13:49:08.167" Title="Why do elisp files have end of file comments?" Tags="|elisp|coding-conventions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12116" PostTypeId="2" ParentId="12086" CreationDate="2015-05-04T05:19:25.250" Score="18" Body="&lt;p&gt;I would guess that's a result of one specific persistent variable getting enormous (it just seems less likely that you would have multiple instances at the same time), but if you've deleted the file you can't see which variable it was.&lt;/p&gt;&#xA;&lt;p&gt;You can always rename the file rather than deleting it, so that you can make Emacs happy again, but still analyse the data.&lt;/p&gt;&#xA;&lt;p&gt;If you recreate this situation, and the file is really massive, opening it in Emacs to check might not be a great idea. I would use &lt;code&gt;grep&lt;/code&gt; to find out the offset for each variable, and just look for any really big jumps:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;$ grep -E -b -o '^\(setq [^ ]+' ~/.emacs.d/.cache/savehist&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;(Or whatever your &lt;code&gt;savehist-file&lt;/code&gt; path is -- the standard filename is &lt;code&gt;~/.emacs.d/history&lt;/code&gt; but I presume &lt;code&gt;~/.emacs.d/.cache/savehist&lt;/code&gt; is what Spacemacs configures.)&lt;/p&gt;&#xA;&lt;hr/&gt;&#xA;&lt;p&gt;&lt;em&gt;Edit: The results of this from the comments below were:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;116:(setq savehist-minibuffer-history-variables &#xA;350:(setq regexp-search-ring &#xA;566:(setq magit-read-rev-history &#xA;637:(setq read-expression-history &#xA;694:(setq command-history &#xA;19045:(setq helm-grep-history &#xA;20687:(setq minibuffer-history &#xA;75425:(setq file-name-history &#xA;83278:(setq ido-file-history &#xA;83377:(setq evil-ex-history &#xA;111288:(setq kill-ring &#xA;1162765006:(setq mark-ring &#xA;1162765028:(setq search-ring &#xA;1162765052:(setq regexp-search-ring &#xA;1162765268:(setq extended-command-history&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;em&gt;From this we can see that &lt;code&gt;kill-ring&lt;/code&gt; is the biggest culprit by some orders of magnitude!&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Edit 2:&lt;/em&gt; &lt;a href=&quot;https://emacs.stackexchange.com/q/4187&quot;&gt;Strip text properties in savehist&lt;/a&gt; almost certainly accounts for the excessive size of the &lt;code&gt;kill-ring&lt;/code&gt; entry. The remainder of this answer is still useful information, but I recommend also looking at that other Q&amp;amp;A.&lt;/p&gt;&#xA;&lt;hr/&gt;&#xA;&lt;p&gt;It's possible that you need to fix a bug somewhere -- whatever is causing that value to become so huge. Even if you're not writing a value to the history file, Emacs may still be burning a lot of memory on that data (especially if you rarely quit Emacs, and it's accumulating rapidly).&lt;/p&gt;&#xA;&lt;p&gt;If that's not an issue, though, it might be sufficient for Emacs to simply not persist the variable(s) in question -- if they're not persistent, the size won't be growing continually from session to session.&lt;/p&gt;&#xA;&lt;p&gt;If you just don't want it written to the history file, and the offending variable is a member of &lt;code&gt;savehist-additional-variables&lt;/code&gt;, then it's probably your own config which is responsible for having added it, so you should find and remedy that.&lt;/p&gt;&#xA;&lt;p&gt;Otherwise it's most likely a minibuffer history variable which savehist is adding automatically, in which case you could add it to &lt;code&gt;savehist-ignored-variables&lt;/code&gt; to prevent this from occuring.&lt;/p&gt;&#xA;&lt;p&gt;Alternatively (and preferably) for variables which are explicitly used as histories, you should be able to alleviate this via the &lt;code&gt;history-length&lt;/code&gt; variable, which means you can still maintain the most recent history for variables of interest. Note in particular that you can specify this on a per-variable basis:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;This variable only affects history lists that don't specify their own&#xA;maximum lengths.  Setting the `history-length' property of a history&#xA;variable overrides this default.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;e.g.:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq history-length 100)&#xA;(put 'minibuffer-history 'history-length 50)&#xA;(put 'evil-ex-history 'history-length 50)&#xA;(put 'kill-ring 'history-length 25)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;em&gt;n.b. If you have set the value of &lt;code&gt;history-length&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, that disables truncation, and the affected histories will be allowed to grow without restraints! (of course an integer value which is simply very very large can be just as problematic.)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note that setting a (sensible integer) &lt;code&gt;history-length&lt;/code&gt; value is beneficial for Emacs' memory usage as well as the history file size, because the list truncation happens as history items are added, and so the in-memory variable never exceeds its maximum length + 1.&lt;/p&gt;&#xA;&lt;p&gt;Also note that &lt;code&gt;kill-ring&lt;/code&gt; is not a history variable, and so it is unaffected by &lt;code&gt;history-length&lt;/code&gt;. It does however have its own analogous constraint in the &lt;code&gt;kill-ring-max&lt;/code&gt; variable, so you should definitely check your setting for that.&lt;/p&gt;&#xA;&lt;p&gt;You may like to make &lt;code&gt;kill-ring&lt;/code&gt; an ignored variable regardless, unless you particularly want that to persist between sessions. (I don't think that it's persistent by default, mind, so you should maybe check why that's happening?)&lt;/p&gt;&#xA;&lt;p&gt;Finally, you can utilise &lt;code&gt;savehist-save-hook&lt;/code&gt; to run your own custom functions before the variables are written to the history file, so you can do pretty much anything you want at that point. For example if you wished to maintain a larger &lt;code&gt;history-length&lt;/code&gt; while Emacs is running, but only write a smaller sub-set of that data to the history file when Emacs exits, then you could write a custom function to cut those lists down to size.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2021-08-05T22:18:44.357" LastActivityDate="2021-08-05T22:18:44.357" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="12117" PostTypeId="2" ParentId="12115" CreationDate="2015-05-04T05:20:24.853" Score="18" Body="&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Headers.html#index-commentary_002c-in-a-Lisp-library&quot;&gt;Emacs Documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;‘;;; filename ends here’&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This is the footer line; it appears at the very end of the file. Its purpose is to enable people to detect truncated versions of the&#xA;  file from the lack of a footer line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-05-04T05:20:24.853" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12118" PostTypeId="2" ParentId="10897" CreationDate="2015-05-04T06:39:46.027" Score="3" Body="&lt;p&gt;Flycheck does not find syntax checkers automagically.  It's not enough to just define a syntax checker, you also need to &lt;em&gt;register&lt;/em&gt; it, by adding it to &lt;code&gt;flycheck-checkers&lt;/code&gt;, as Flycheck told you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'flycheck-checkers 'd-ldc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more information please consult the  Flycheck manual which guides you through the whole process of &lt;a href=&quot;http://www.flycheck.org/manual/latest/Syntax-checker-definitions.html%23Syntax-checker-definitions&quot; rel=&quot;nofollow&quot;&gt;defining a new syntax checker&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-05-04T06:39:46.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12119" PostTypeId="1" CreationDate="2015-05-04T08:24:52.460" Score="3" ViewCount="209" Body="&lt;p&gt;It is possible to manually toggle sign for a message, I wonder how it can be done for any message created?&lt;/p&gt;&#xA;" OwnerUserId="474" LastActivityDate="2016-12-21T21:18:53.250" Title="Wanderlust: use GPG sign by default" Tags="|email|wanderlust|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12120" PostTypeId="1" AcceptedAnswerId="12356" CreationDate="2015-05-04T09:59:14.010" Score="1" ViewCount="1570" Body="&lt;p&gt;I am trying to write functions that insert entries, or link to entries of my contacts org-mode file using &lt;code&gt;org-contacts&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The functions would work as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First prompt for a contact name (maybe using the &lt;code&gt;org-contacts&lt;/code&gt; command).&lt;/li&gt;&#xA;&lt;li&gt;On pressing &lt;code&gt;l&lt;/code&gt;, insert a link to the selected contact where point was in the original buffer, then quit the temporary contacts buffer.&lt;/li&gt;&#xA;&lt;li&gt;On pressing &lt;code&gt;c&lt;/code&gt;, insert a copy of the subtree corresponding to the selected contact and exit the temporary buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think the following commands may come in handy: &lt;code&gt;org-contact&lt;/code&gt;, &lt;code&gt;org-store-link&lt;/code&gt;,     &lt;code&gt;org-agenda-quit&lt;/code&gt;. I am working on it right now but my lisp skills are very limited. Any idea about how to proceed would be very welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linking could be made more robust by using a setup similare to these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www-public.telecom-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/&quot; rel=&quot;nofollow&quot;&gt;managing bibliography in org mode 1&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/&quot; rel=&quot;nofollow&quot;&gt;managing bibliography in org mode 2&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but this is probably even more complex.&lt;/p&gt;&#xA;" OwnerUserId="6760" LastActivityDate="2015-05-18T16:47:21.293" Title="Insert entries and link to entries from org-contacts" Tags="|org-mode|org-agenda|hyperlinks|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12121" PostTypeId="1" AcceptedAnswerId="12124" CreationDate="2015-05-04T10:57:59.180" Score="19" ViewCount="3661" Body="&lt;p&gt;Currently, for notetaking tools like &lt;code&gt;Evernote&lt;/code&gt; and &lt;code&gt;Quiver&lt;/code&gt;, I can directly copy HTML content from my favorite browser and then paste them into the app, with all the formatting + link preserved. However in orgmode it seems that all the formatting info is lost. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen somebody &lt;a href=&quot;https://emacs.stackexchange.com/q/7171/115&quot;&gt;suggest using &lt;code&gt;eww&lt;/code&gt; to browse the web and copy the content via &lt;code&gt;eww-org&lt;/code&gt;&lt;/a&gt;. However that is really tedious(I don't think there would be a lot of people browsing the web using &lt;code&gt;eww&lt;/code&gt; instead of modern browsers nowadays. I'll have to open that link again in &lt;code&gt;eww&lt;/code&gt; and do the copying, not to mention sometimes &lt;code&gt;eww&lt;/code&gt; doesn't render the contents nicely). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to let &lt;code&gt;Emacs&lt;/code&gt; directly parse the copied HTML when pasting? Even if there's no existing tool for that yet, is it feasible to make one? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is almost the only thing that stops me from switching to &lt;code&gt;orgmode&lt;/code&gt; from other notetaking tools.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2021-09-30T05:56:51.123" Title="Org mode - Parsing rich HTML directly when pasting?" Tags="|org-mode|copy-paste|formatting|html|" AnswerCount="4" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="12122" PostTypeId="1" AcceptedAnswerId="13412" CreationDate="2015-05-04T11:58:00.297" Score="10" ViewCount="10206" Body="&lt;p&gt;How can i yank to/from windows clipboard when using:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Windows 7 (x64)&lt;/li&gt;&#xA;&lt;li&gt;GNU Emacs 24.4.1 (x64)&lt;/li&gt;&#xA;&lt;li&gt;Evil 1.0.9&lt;/li&gt;&#xA;&lt;li&gt;and having &lt;code&gt;(setq x-select-enable-clipboard nil)&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt;? (I put this line there because i didn't want vim changes (&lt;kbd&gt;x&lt;/kbd&gt;, &lt;kbd&gt;d&lt;/kbd&gt;, etc) to clobber my os clipboard.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;kbd&gt;&quot;+p&lt;/kbd&gt;, &lt;kbd&gt;&quot;*p&lt;/kbd&gt;, &lt;kbd&gt;&quot;+y&lt;/kbd&gt;, &lt;kbd&gt;&quot;*y&lt;/kbd&gt;, &lt;kbd&gt;CTRL+Y&lt;/kbd&gt; but it doesn't work. When i run &lt;code&gt;:registers&lt;/code&gt; it doesn't even show &lt;code&gt;+&lt;/code&gt; or &lt;code&gt;*&lt;/code&gt; registers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify: I want Emacs to behave like Vim when copying/yanking to/from different registers, without clobbering os clipboard with every text changing command. In particular:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;yy&lt;/kbd&gt; - should NOT yank text to os clipboard (only to &lt;code&gt;0&lt;/code&gt; register)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;&quot;+yy&lt;/kbd&gt; - should yank text to os clipboard&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;dd&lt;/kbd&gt; - should NOT clobber os clipboard&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;cw&lt;/kbd&gt; - shold NOT clobber os clipboard&lt;/li&gt;&#xA;&lt;li&gt;etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4005" LastEditorUserId="50" LastEditDate="2015-05-04T22:28:52.767" LastActivityDate="2023-05-16T10:42:21.630" Title="How to access os clipboard using Emacs + Evil" Tags="|microsoft-windows|evil|copy-paste|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12124" PostTypeId="2" ParentId="12121" CreationDate="2015-05-04T12:41:42.103" Score="21" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;is it feasible to make one?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since this is emacs, &lt;strong&gt;yes&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach is to use a 3rd party tools that can take HTML and convert to plain text or even directly to Org format. I think this is an ugly hack, and there may be better ways to do this, but it looks like it works for my test cases.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kdm/html2org-clipboard ()&#xA;  &quot;Convert clipboard contents from HTML to Org and then paste (yank).&quot;&#xA;  (interactive)&#xA;  (kill-new (shell-command-to-string &quot;osascript -e 'the clipboard as \&quot;HTML\&quot;' | perl -ne 'print chr foreach unpack(\&quot;C*\&quot;,pack(\&quot;H*\&quot;,substr($_,11,-3)))' | pandoc -f html -t json | pandoc -f json -t org | sed 's/ / /g'&quot;))&#xA;  (yank))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, HTML is incredibly complex now - no longer some simple hand-written tags. This complex HTML tagging requires the complicated shell command above. It does the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;osascript&lt;/code&gt; gets the HTML text from the clipboard. It is hex encoded, so&lt;/li&gt;&#xA;&lt;li&gt;perl converts the hex to a string&lt;/li&gt;&#xA;&lt;li&gt;We could convert that HTML to Org directly with pandoc, but the HTML is full of complicated tags and therefore produces a ton of Org code. In order to simply the HTML to the minimal set of tags needed to capture the formatting, I&lt;/li&gt;&#xA;&lt;li&gt;Convert the HTML to json, and then&lt;/li&gt;&#xA;&lt;li&gt;Convert the json to Org (these two steps simplify the HTML).&lt;/li&gt;&#xA;&lt;li&gt;Replace non-standard spaces with standard ones. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;osascript&lt;/code&gt; is for MacOS.  To modify steps 1-2 for Linux, replace the argument of shell-command-to-string with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;xclip -o -t text/html | pandoc -f html -t json | pandoc -f json -t org&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In any case, the output of the &lt;code&gt;pandoc&lt;/code&gt; command is returned to emacs, and inserted into the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bind the new Emacs command to a key similar to &quot;paste&quot; but that means &quot;paste-and-convert-from-html&quot; to you, and it should work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you don't want to think about which paste command to use, here is a Linux version that will convert HTML when that is available on the clipboard and will otherwise fall back to plain text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;xclip -o -t TARGETS | grep -q text/html &amp;amp;&amp;amp; (xclip -o -t text/html | pandoc -f html -t json | pandoc -f json -t org) || xclip -o&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastEditorUserId="8234" LastEditDate="2020-06-10T14:24:34.410" LastActivityDate="2020-06-10T14:24:34.410" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="12125" PostTypeId="1" AcceptedAnswerId="12166" CreationDate="2015-05-04T14:44:36.270" Score="5" ViewCount="2009" Body="&lt;p&gt;I have a function called &lt;code&gt;create-org-link&lt;/code&gt; that creates a file link based on an arbitrary string that I pass to it. I would like to be able to invoke this function when I invoke org capture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I have tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;  '((&quot;w&quot; &quot;Work Log&quot; entry (file+headline &quot;c:/td/gtd/org/WorkLogs.org&quot; &quot;Today&quot;) &quot;** %(create-org-link) %?&quot;)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that the function works because I can use it outside of this template.&#xA;However, when I execute if from here I get the following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** %![Error: (wrong-number-of-arguments (lambda (title) Foobar de roobarb (interactive sPlease enter a title: ) (insert (format [[file:%s-%s.org][%s - %s]] (format-time-string org-link-date-stamp-format (current-time)) (replace-regexp-in-string    title) (format-time-string org-link-date-stamp-format (current-time)) title))) 0)] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a different template element that I should be using?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt; - 5/5/2014 @ 12:48&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the function that is being called:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun create-org-link (title)&#xA;  &quot;Foobar de roobarb&quot;&#xA;  (interactive &quot;sPlease enter a title: &quot;)&#xA;  (insert (format &quot;[[file:%s-%s.org][%s - %s]]&quot; (format-time-string org-link-date-stamp-format(current-time)) (replace-regexp-in-string &quot; &quot; &quot;&quot; title) (format-time-string org-link-date-stamp-format(current-time)) title)))&#xA;&#xA;(defvar org-link-date-stamp-format &quot;%y%m%d&quot;&#xA;  &quot;Format of date stamps to use in Org links&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ha ha - I guess I should take out my placeholder comments before asking questions about it in a forum :-) &lt;/p&gt;&#xA;" OwnerUserId="8228" LastEditorUserId="8228" LastEditDate="2015-05-05T16:56:02.843" LastActivityDate="2015-05-05T18:04:03.700" Title="Invoke Interactive Function From org-capture-templates" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12126" PostTypeId="1" AcceptedAnswerId="12129" CreationDate="2015-05-04T14:51:01.483" Score="6" ViewCount="733" Body="&lt;p&gt;Emacs supports syntax flags for &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Flags.html#Syntax-Flags&quot; rel=&quot;noreferrer&quot;&gt;1- and 2-characters comment delimiters&lt;/a&gt;. Can it be made to recognize and properly highlight 3-characters delimiters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In Emacs Lisp:&#xA;    ;;; Headings&#xA;&#xA;In C#:&#xA;    /// XML Comment&#xA;&#xA;In Java:&#xA;    /** Javadoc comment */&#xA;&#xA;In Coq:&#xA;    (** Codoc comment (nestable with (* ... *) and (** ... *)) *)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-06-20T10:14:05.730" Title="Three-characters comment syntax" Tags="|font-lock|syntax-highlighting|comment|syntax-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12127" PostTypeId="1" AcceptedAnswerId="12128" CreationDate="2015-05-04T15:28:35.947" Score="2" ViewCount="1331" Body="&lt;p&gt;When I use &lt;code&gt;company-mode&lt;/code&gt; in &lt;code&gt;shell-mode&lt;/code&gt;, by default company seems to pull candidates from tokens in open buffers. How can I set up the backend to get candidates from shell commands, directory names, and file names? Googling &quot;company-shell&quot; returns somewhat &lt;a href=&quot;http://en.wikipedia.org/wiki/Shell_Oil_Company&quot; rel=&quot;nofollow&quot;&gt;oily&lt;/a&gt; results.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-05-04T15:50:48.910" Title="Setting up company for shell autocompletion" Tags="|shell|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12128" PostTypeId="2" ParentId="12127" CreationDate="2015-05-04T15:50:48.910" Score="3" Body="&lt;p&gt;&lt;code&gt;company-backends&lt;/code&gt; specifies in what backends to try out in which order.  The first backend signaling that it can deliver candidates (based on the current input) is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make use of the current major mode's built-in completion facility (as can be used by &lt;code&gt;M-TAB&lt;/code&gt; in code/text and &lt;code&gt;TAB&lt;/code&gt; in interactive modes), use the new &lt;code&gt;company-capf&lt;/code&gt; backend.  It should be put as the very first one in more recent installations and can be made use of in at least Emacs 24.4.  You can check which backend is used currently by inspecting the modeline lighter.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-05-04T15:50:48.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12129" PostTypeId="2" ParentId="12126" CreationDate="2015-05-04T15:53:40.533" Score="10" Body="&lt;p&gt;AFAIK the example you give are actually 2-char comment delimiters, except that depending on the 3rd character, these comments are treated in different ways (but always as comments in the sense that the semantics of the code is unaffected).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the support offered by Emacs's syntax tables should be sufficient in most cirsumstances.  If you want to highlight them differently, you can use &lt;code&gt;font-lock-syntactic-face-function&lt;/code&gt; so as to return different faces for those different comments (typically by looking at the chracters after &lt;code&gt;(nth 8 state)&lt;/code&gt; to recognize which kind of element is being processed).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-04T15:53:40.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12130" PostTypeId="1" AcceptedAnswerId="12131" CreationDate="2015-05-04T21:26:55.133" Score="7" ViewCount="2027" Body="&lt;p&gt;&lt;kbd&gt;C-u C-c ! &lt;/kbd&gt; generates a time stamp like [2015-05-04 Mon 17:13]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to assign a shortcut (e.g F1) to this action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/timenow (&amp;amp;optional arg) &#xA; (interactive) &#xA; (let ((current-prefix-arg 4)) ;; emulate C-u&#xA; (org-time-stamp arg 'inactive)&#xA; )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this prompts me for the time and I have to press &lt;kbd&gt;RET&lt;/kbd&gt; to insert it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I insert the inactive timestamp without any prompts at all?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="105" LastEditDate="2021-04-14T16:28:10.190" LastActivityDate="2021-04-14T16:28:10.190" Title="How to insert inactive [timestamp] via function?" Tags="|org-mode|time-date|prefix-argument|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12131" PostTypeId="2" ParentId="12130" CreationDate="2015-05-04T21:38:15.537" Score="11" Body="&lt;p&gt;From the documentation of &lt;code&gt;org-time-stamp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With two universal prefix arguments, insert an active timestamp&#xA;  with the current time without prompting the user.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So eval the below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-time-stamp '(16) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;'(4)&lt;/code&gt; - one prefix arg (4)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;'(16)&lt;/code&gt; - two prefix args (4 * 4)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;'(64)&lt;/code&gt; - three prefix args (4 * 4 * 4)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To read more about the universal arguments and arguments in general:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html&quot; rel=&quot;noreferrer&quot;&gt;Prefix Command Args - Emacs Manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot; rel=&quot;noreferrer&quot;&gt;Arguments - Elisp Manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ergoemacs.org/emacs/elisp_universal_argument.html&quot; rel=&quot;noreferrer&quot;&gt;Elisp Universal Args - ergoemacs.org&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-05T14:10:16.193" LastActivityDate="2015-05-05T14:10:16.193" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12132" PostTypeId="1" AcceptedAnswerId="12133" CreationDate="2015-05-05T00:44:58.900" Score="19" ViewCount="1797" Body="&lt;p&gt;The manual &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Special.html&quot; rel=&quot;noreferrer&quot;&gt;describes&lt;/a&gt; the regexp special characters &lt;code&gt;^&lt;/code&gt; and &lt;code&gt;$&lt;/code&gt;. Like in most regular expression dialects I know, they seem to match the start or end of a string. However, I've also discovered that there are &lt;code&gt;`&lt;/code&gt; and &lt;code&gt;'&lt;/code&gt; characters available. Based on the explanation found &lt;a href=&quot;https://stackoverflow.com/a/3504600/1468130&quot;&gt;here&lt;/a&gt;, they seem to also match the start or end of strings. Could someone please explain the difference between these special characters, with an example and recommendation on when to use them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look at the value of &lt;code&gt;auto-mode-alist&lt;/code&gt;, they seem to be used interchangeably to match the end of strings:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(...&#xA; (&quot;\\.scss\\'&quot; . scss-mode)&#xA; (&quot;\\.ya?ml$&quot; . yaml-mode)&#xA;...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2631" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-05-22T22:13:05.010" Title="Elisp regexps ^ and $ vs ` and '" Tags="|elisp|regular-expressions|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12133" PostTypeId="2" ParentId="12132" CreationDate="2015-05-05T01:11:14.600" Score="16" Body="&lt;p&gt;Your string might have an embedded newline character, in which case &lt;code&gt;\'&lt;/code&gt; matches the end of the string but &lt;code&gt;$&lt;/code&gt; matches just before the newline char.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To quote the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Special.html&quot;&gt;Regexp Special&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When matching a string instead of a buffer, `$' matches at the end&#xA;  of the string or before a newline character.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Similarly, &lt;code&gt;\`&lt;/code&gt; matches the beginning of the string, but &lt;code&gt;^&lt;/code&gt; matches just after the newline char. Again, the manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When matching a string instead of a buffer, `^' matches at the&#xA;  beginning of the string or after a newline character.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So for strings you generally want to use &lt;code&gt;\`&lt;/code&gt; and &lt;code&gt;\'&lt;/code&gt;, especially if your code cannot know ahead of time whether there might be newline chars in the string. For text in a buffer you typically use &lt;code&gt;^&lt;/code&gt; and &lt;code&gt;$&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-05T01:11:14.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12134" PostTypeId="2" ParentId="12132" CreationDate="2015-05-05T01:14:24.367" Score="2" Body="&lt;pre&gt;&lt;code&gt;there are ` and ' characters available. [...] they seem to also match the start or end of strings&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Special characters are: &lt;code&gt;. * + ? ^ $ \ [&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Between brackets &lt;code&gt;[]&lt;/code&gt;, the following are special too: &lt;code&gt;] - ^&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many characters including backtick `, and single quote ', become special when they follow a backslash. See &lt;a href=&quot;http://www.emacswiki.org/emacs/RegularExpression#toc1&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Could someone please explain the difference between these special characters, with an example and recommendation on when to use them?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a difference between &lt;code&gt;beginning of string&lt;/code&gt;, and &lt;code&gt;beginning of each line in the string&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Courtesy of Ergoemacs. You can read more &lt;a href=&quot;http://www.ergoemacs.org/emacs/emacs_regex_begin_end_line_string.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-05-05T01:14:24.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12135" PostTypeId="1" AcceptedAnswerId="12136" CreationDate="2015-05-05T01:42:12.673" Score="7" ViewCount="4400" Body="&lt;p&gt;I'm writing some elisp code and would like to replace some string with some another string in a buffer. Which elisp function does that ? I did a search on documentation for the related function but all I'm getting is the interactive commands. Would love to see a sample code if possible.&lt;/p&gt;&#xA;" OwnerUserId="904" LastActivityDate="2015-05-05T03:13:38.310" Title="Replace string in buffer programatically" Tags="|elisp|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12136" PostTypeId="2" ParentId="12135" CreationDate="2015-05-05T01:48:04.500" Score="13" Body="&lt;p&gt;Use functions &lt;code&gt;re-search-forward&lt;/code&gt; and &lt;code&gt;replace-match&lt;/code&gt; in a loop, or function &lt;code&gt;perform-replace&lt;/code&gt;. See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Search-and-Replace.html&quot;&gt;Search and Replace&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while (re-search-forward &quot;hello&quot; nil t)&#xA;    (replace-match &quot;world&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="97" LastEditDate="2015-05-05T03:13:38.310" LastActivityDate="2015-05-05T03:13:38.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12137" PostTypeId="1" AcceptedAnswerId="12138" CreationDate="2015-05-05T02:11:09.783" Score="2" ViewCount="263" Body="&lt;p&gt;I have some sample code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-function ()&#xA;  (interactive)&#xA;  (push-mark)&#xA;  (goto-char (point-min))&#xA;  ; do some stuff&#xA;  (pop-mark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I'm expecting pop-mark to get me back to the original location. But that doesn't seem to be happening. Any idea on how to do this properly ?&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="105" LastEditDate="2016-08-22T00:57:56.560" LastActivityDate="2016-08-22T00:57:56.560" Title="pop-mark not working as expected" Tags="|mark|mark-ring|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12138" PostTypeId="2" ParentId="12137" CreationDate="2015-05-05T02:29:20.637" Score="6" Body="&lt;p&gt;From &lt;code&gt;pop-mark&lt;/code&gt;'s documentation:  &lt;code&gt;...This does not move point in the buffer&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; do some stuff&#xA;(goto-char (mark))&#xA;(pop-mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if all you care about is returning to a previous location, and not actually using the mark ring, then you could either &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) save &lt;code&gt;(point)&lt;/code&gt; in a variable and return to it&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) use &lt;code&gt;save-excursion&lt;/code&gt; which does this for you&lt;/p&gt;&#xA;" OwnerUserId="6931" LastActivityDate="2015-05-05T02:29:20.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12139" PostTypeId="1" CreationDate="2015-05-05T05:33:50.703" Score="2" ViewCount="402" Body="&lt;p&gt;I'm building a new appliance, linking BusyBox with Tor on top of a minimal GNU/Linux operating system.  I'd like to try something different for the automated build infrastructure with this one and Emacs Lisp has been calling me lately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have a project written in C that uses automated build scripts written in Elisp?  Guile might might be a runner-up but I need to get up-to-speed quickly on the infrastructure needed, so I'm hoping for Elisp for familiarity's sake.&lt;/p&gt;&#xA;" OwnerUserId="8235" LastActivityDate="2015-05-07T07:15:01.010" Title="Does your project use Elisp for build automation?" Tags="|elisp|compilation|linux|c|automation|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12140" PostTypeId="2" ParentId="12132" CreationDate="2015-05-05T08:32:33.350" Score="7" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(string-match &quot;^foo&quot; &quot;foo&quot;)         ; =&amp;gt; 0&#xA;(string-match &quot;\\`foo&quot; &quot;foo&quot;)       ; =&amp;gt; 0&#xA;(string-match &quot;^foo&quot; &quot;bar\nfoo&quot;)    ; =&amp;gt; 4&#xA;(string-match &quot;\\`foo&quot; &quot;bar\nfoo&quot;)  ; =&amp;gt; nil&#xA;&#xA;(string-match &quot;foo$&quot; &quot;foo&quot;)         ; =&amp;gt; 0&#xA;(string-match &quot;foo\\'&quot; &quot;foo&quot;)       ; =&amp;gt; 0&#xA;(string-match &quot;foo$&quot; &quot;foo\nbar&quot;)    ; =&amp;gt; 0&#xA;(string-match &quot;foo\\'&quot; &quot;foo\nbar&quot;)  ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;^&lt;/code&gt; and &lt;code&gt;$&lt;/code&gt; match the start and end of &lt;em&gt;lines&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\`&lt;/code&gt; and &lt;code&gt;\'&lt;/code&gt; match the start and end of the &lt;em&gt;entire string&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastEditorUserId="160" LastEditDate="2015-05-22T22:12:44.033" LastActivityDate="2015-05-22T22:12:44.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12141" PostTypeId="1" CreationDate="2015-05-05T09:17:56.687" Score="0" ViewCount="590" Body="&lt;p&gt;&lt;em&gt;I'm definitely loading the correct file. There's no rogue&lt;/em&gt; &lt;code&gt;~/.emacs&lt;/code&gt; &lt;em&gt;or byte compiled file&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I load emacs, even with my entire init.el commented out, the first line in &lt;code&gt;*messages*&lt;/code&gt;, the first line is messages is &lt;code&gt;(wrong-type-argument stringp nil) [36 times]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run emacs with my init.el totally commented out, and &lt;code&gt;--debug-init&lt;/code&gt;, I don't get backtraces for these errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I invoke emacs with &lt;code&gt;-q&lt;/code&gt;, I don't get these errors at all in &lt;code&gt;*messages*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to proceed in debugging this, but there are more normal problems too, so I can't just ignore. For example, zenburn won't load - it too fails with &lt;code&gt;(wrong-type-argument stringp nil)&lt;/code&gt;, but I can get a backtrace for this, and it's related caused by &lt;code&gt;file-name-directory&lt;/code&gt; receiving nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I 'manually' load my commented-out init file, by running &lt;code&gt;emacs -q -l init.el&lt;/code&gt; there are no complaints about &lt;code&gt;(wrong-type-argument stringp nil) [36 times]&lt;/code&gt;&#xA;What could be causing these initial, non &lt;code&gt;debug-on-init&lt;/code&gt;able stringp errors, and how can I fix them?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;EDIT - New information. Deleting every &lt;code&gt;.elc&lt;/code&gt; in elpa seems to fix this problem, and recompiling the &lt;code&gt;.elc&lt;/code&gt; files re-introduces it. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="503" LastEditorUserId="503" LastEditDate="2015-05-14T14:52:15.233" LastActivityDate="2015-05-14T14:52:15.233" Title="(wrong-type-argument stringp nil) [36 times] when loading emacs, even with init.el commented out" Tags="|config|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12142" PostTypeId="1" AcceptedAnswerId="12144" CreationDate="2015-05-05T09:35:21.093" Score="8" ViewCount="2312" Body="&lt;p&gt;According to the Emacs Lisp manual &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A symbol whose name starts with a colon (‘:’) is called a keyword&#xA;  symbol. These symbols automatically act as constants, and are normally&#xA;  used only by comparing an unknown symbol with a few specific&#xA;  alternatives. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html#Property-Lists&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html#Property-Lists&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A property list (plist for short) is a list of paired elements. Each&#xA;  of the pairs associates a property name (usually a symbol) with a&#xA;  property or value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the difference between:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((my-plist '(bar t foo 4)))&#xA;  (plist-get my-plist 'foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((my-plist '(bar t :foo 4)))&#xA;  (plist-get my-plist :foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and which one is preferred?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="105" LastEditDate="2023-02-03T16:36:51.317" LastActivityDate="2023-02-03T16:36:51.317" Title="Use of keyword symbols in property lists" Tags="|symbols|property-lists|keywords|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12144" PostTypeId="2" ParentId="12142" CreationDate="2015-05-05T09:43:11.403" Score="5" Body="&lt;p&gt;There's no difference to my knowledge. You can see &lt;code&gt;:foo&lt;/code&gt; as an auto-quoting &lt;code&gt;'foo&lt;/code&gt;.  Keyword arguments show more clearly that they are constants, so you should use them if you want to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also experiment with this if you like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(let (cands)&#xA;  (mapatoms (lambda (x)&#xA;              (when (string-match &quot;foobarbaz&quot; (symbol-name x))&#xA;                (push x cands))))&#xA;  cands)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The initial eval should return nil.&#xA;But after you eval &lt;code&gt;(list :foobarbaz)&lt;/code&gt;, it will change.&#xA;After you eval &lt;code&gt;(list 'foobarbaz)&lt;/code&gt;, it will change once more.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-05T09:43:11.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12145" PostTypeId="1" CreationDate="2015-05-05T09:57:02.827" Score="2" ViewCount="988" Body="&lt;p&gt;I have a bunch of packages installed. &#xA;One of them is adding &lt;code&gt;~/.emacs.d&lt;/code&gt; to my &lt;code&gt;load-path&lt;/code&gt;, which Emacs is (unsurprisingly) complaining about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could be incorrect here, but:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempting to bisect my set of packages is a slow work, because I'd have to uninstall all my packages, and then re-install only half of them, which means downloading, and a lot of fairly manual work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easier way to determine which package is setting the value of &lt;code&gt;load-path&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extra information:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This doesn't happen when loading emacs with &lt;code&gt;-Q&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;I've not changed my config between it working and breaking, only upgrade packages&lt;/li&gt;&#xA;&lt;li&gt;&lt;s&gt;This &lt;em&gt;doesn't&lt;/em&gt; happen if I run &lt;code&gt;emacs&lt;/code&gt; without a site-file (&lt;code&gt;--no-site-file&lt;/code&gt;), regardless of whether I add &lt;code&gt;--no-site-lisp&lt;/code&gt;&lt;/s&gt; I confused my flags here. &lt;/li&gt;&#xA;&lt;li&gt;This &lt;em&gt;doesn't&lt;/em&gt; happen if run &lt;code&gt;emacs&lt;/code&gt; with &lt;code&gt;--no-init-file&lt;/code&gt;. &lt;code&gt;site-file&lt;/code&gt; / &lt;code&gt;site-lisp&lt;/code&gt; have no effect&lt;/li&gt;&#xA;&lt;li&gt;GNU Emacs 24.4.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2015-03-31&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Bug Hunter&lt;/code&gt; tells me that &lt;strong&gt;&lt;code&gt;package-initialise&lt;/code&gt;&lt;/strong&gt; is to blame&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;grep -aR &quot;'load-path&quot; ~/.emac.d/elpa --include '*el' | egrep -v ':[[:space:]]*;+' | fgrep -v &quot;(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))&quot;&lt;/code&gt; gives no results&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Removing all my&lt;/strong&gt; &lt;code&gt;.elc&lt;/code&gt; &lt;strong&gt;files in&lt;/strong&gt; &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; &lt;strong&gt;appeared to fix this problem&lt;/strong&gt;, although it's not a great solution. I'm not going to submit &amp;amp; accept because I've no idea how works or whether it's really a fix. This is easily done with &lt;code&gt;find ~/.emacs.d/elpa -name '*.elc' -delete&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="503" LastEditorUserId="795" LastEditDate="2015-07-21T21:36:09.667" LastActivityDate="2015-07-21T21:36:09.667" Title="How can I determine which package is adding .emacs.d to my load-path?" Tags="|elisp|debugging|config|" AnswerCount="3" CommentCount="10" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12146" PostTypeId="2" ParentId="12139" CreationDate="2015-05-05T10:35:03.343" Score="4" Body="&lt;p&gt;I had a similar idea once, but honestly? there are quite a few things that a proper build system needs, and which will require quite a lot of work.  One thing you want is memorizing things you've built and building only the things you have to.  This would typically call for interaction with database, version control system and writing code which builds a tree from the targets that you have and ensures that no change goes unnoticed.  You would also want it to be multilingual, that is not specific to a programming language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like it's all possible to do inside Emacs, but it will be difficult to share it with other people who don't use Emacs.  My experience with other build systems so far is that they create the largest amount of frustration the software can give to a programmer.  This is because programmers see them as inessential thus rarely learn them well.  On the other hand, the popular build systems are really, really bad :) To make this a little more concrete: for a year, I was responsible for my company's CI server, which ran a couple of build scripts, most of them written in Ant, some in Gradle and others used Fabric. Other programmers in the company really struggled with all of them.  And that struggle was never over.  Programmers could spend days trying to configure their Eclipse to build using Ant (something that seems trivial to me, but that's my job, so...)  When I imagine same people trying to use Emacs for builds--oy-vey!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Bottom line: I don't think it's the editor's place to be also the build system, instead, it could be a much improved interface to a build system! For instance, displaying the hierarchy of the build tasks, examining the history, looking for stale outputs, navigation and housekeeping are all equally valuable.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-05-05T10:35:03.343" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="12147" PostTypeId="2" ParentId="12141" CreationDate="2015-05-05T10:40:19.663" Score="2" Body="&lt;p&gt;Maybe you're not loading the init file you think you're loading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Double check if the &lt;code&gt;init.el&lt;/code&gt; file you use with &lt;code&gt;-q&lt;/code&gt; and &lt;code&gt;--debug-init&lt;/code&gt; is the same file you use when loading emacs &lt;em&gt;normally&lt;/em&gt;. Check for the first line in &lt;code&gt;*Messages*&lt;/code&gt; starting with &lt;code&gt;Loading &amp;lt;path-to-init-file&amp;gt;...&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="797" LastActivityDate="2015-05-05T10:40:19.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12148" PostTypeId="1" AcceptedAnswerId="12149" CreationDate="2015-05-05T10:56:56.847" Score="37" ViewCount="41706" Body="&lt;p&gt;I'm using &lt;code&gt;spacemacs&lt;/code&gt; but presumably it's emacs knowledge that's required here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a JSON file with a single long line, let's say this JSON from json.org/example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;{&quot;menu&quot;: {&quot;id&quot;: &quot;file&quot;, &quot;value&quot;: &quot;File&quot;, &quot;popup&quot;: {&quot;menuitem&quot;: [{&quot;value&quot;: &quot;New&quot;, &quot;onclick&quot;: &quot;CreateNewDoc()&quot;}, {&quot;value&quot;: &quot;Open&quot;, &quot;onclick&quot;: &quot;OpenDoc()&quot;}, {&quot;value&quot;: &quot;Close&quot;, &quot;onclick&quot;: &quot;CloseDoc()&quot;}]}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like emacs to reindent this, which means to me not change the leftmost character of line to the proper indentation level, but break the line in several lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;code&gt;spacemacs/indent-region-or-buffer&lt;/code&gt; (&lt;code&gt;SPC j =&lt;/code&gt;) then the text is not changed at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I ask from emacs to actually break this long line and reindent to get something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;{&quot;menu&quot;: {&#xA;  &quot;id&quot;: &quot;file&quot;,&#xA;  &quot;value&quot;: &quot;File&quot;,&#xA;  &quot;popup&quot;: {&#xA;    &quot;menuitem&quot;: [&#xA;      {&quot;value&quot;: &quot;New&quot;, &quot;onclick&quot;: &quot;CreateNewDoc()&quot;},&#xA;      {&quot;value&quot;: &quot;Open&quot;, &quot;onclick&quot;: &quot;OpenDoc()&quot;},&#xA;      {&quot;value&quot;: &quot;Close&quot;, &quot;onclick&quot;: &quot;CloseDoc()&quot;}&#xA;    ]&#xA;  }&#xA;}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not interested in a JSON-specific answer, for instance I believe that intelliJ does that for any language it supports (java, json...). I would think it's achievable for any language emacs has a major mode for, or let's say the most popular ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; I discovered &lt;code&gt;M-x json-reformat-region&lt;/code&gt; that &lt;code&gt;spacemacs&lt;/code&gt; ships with and works, but yes, I would like that for any language and with always the same shortcut, based on the major mode...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT2&lt;/strong&gt; Ok so my conclusion is that it's implemented for various languages, JSON &amp;amp; lisp at least, presumably others, and it would be easy for yet more (XML/XHTML, go which has go-fmt and also using clang). However there's no generic function name that would do it for all the languages. There is space here to implement it in &lt;code&gt;spacemacs&lt;/code&gt; layers for the various languages... I didn't find a X/HTML implementation though, which surprises me a bit.&lt;/p&gt;&#xA;" OwnerUserId="2592" LastEditorUserId="160" LastEditDate="2015-05-22T22:21:11.523" LastActivityDate="2024-01-19T07:39:02.917" Title="How to pretty-format code (auto-insert newlines, indent, etc)?" Tags="|indentation|spacemacs|" AnswerCount="7" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12149" PostTypeId="2" ParentId="12148" CreationDate="2015-05-05T11:07:16.547" Score="16" Body="&lt;p&gt;It looks like you need the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Fill-Commands.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;fill-region&lt;/code&gt;&lt;/a&gt; function more than the indentation. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select that line and do &lt;code&gt;M-x fill-region&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Select the same, now split across multiple lines, and do &lt;code&gt;M-x indent-region&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That will, though, not insert new lines at the exact points as shown in your example. It will simply make the line fit in the fill columns. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-05-05T11:07:16.547" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12150" PostTypeId="1" AcceptedAnswerId="12155" CreationDate="2015-05-05T11:46:07.570" Score="8" ViewCount="3624" Body="&lt;p&gt;Consider the following MWE&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :session :results file&#xA;import matplotlib&#xA;matplotlib.use('Agg')&#xA;import matplotlib.pyplot as plt&#xA;fig=plt.figure(figsize=(3,2))&#xA;plt.plot([1,3,2])&#xA;fig.tight_layout()&#xA;plt.savefig('myfig.pdf')&#xA;'myfig.pdf' # return this to org-mode&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;[[file:myfig.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I add a caption (and maybe also name) to the generated results block that contain a figure?&lt;/p&gt;&#xA;" OwnerUserId="861" LastActivityDate="2016-02-01T19:43:08.240" Title="Add caption to an image generated by a code block" Tags="|org-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12151" PostTypeId="2" ParentId="12145" CreationDate="2015-05-05T11:53:21.060" Score="3" Body="&lt;p&gt;Two approaches come to mind.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Use &lt;code&gt;rgrep&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;... to search for offending code:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Open your &lt;code&gt;elpa&lt;/code&gt; directory in Dired. If you're not sure where this directory is located, check the value of &lt;code&gt;package-user-dir&lt;/code&gt; with &lt;kbd&gt;C-h v&lt;/kbd&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Call &lt;code&gt;rgrep&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;rgrep&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;add-to-list 'loadpath&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;*.el&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might need to play around with the exact search string a bit to narrow down the list of results.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Use &lt;code&gt;package-load-list&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;... to control which packages are loaded:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Check the value of &lt;code&gt;package-activated-list&lt;/code&gt; to get a list of packages that are currently activated.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add the following code to your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq package-load-list '((magit nil) (multiple-cursors nil) ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace &lt;code&gt;(magit nil) (multiple-cursors nil) ...&lt;/code&gt; with about half of the packages that are currently activated. (Note that &lt;code&gt;nil&lt;/code&gt; means &quot;load the latest version&quot; in this context.) Emacs will load all packages that you list at startup and ignore the remaining packages.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Restart Emacs to see if the error persists. If it does, keep bisecting the list of packages you are loading until you are left with the package that is causing the problem.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-05-05T11:53:21.060" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12152" PostTypeId="2" ParentId="12148" CreationDate="2015-05-05T12:25:29.417" Score="7" Body="&lt;p&gt;According to the tip &lt;a href=&quot;http://irreal.org/blog/?p=354&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, you can use external command to format a region in your Json file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun json-format ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (shell-command-on-region (region-beginning)&#xA;                             (region-end)&#xA;                             &quot;python -m json.tool&quot;&#xA;                             (buffer-name)&#xA;                             t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can easily extend it to format the whole buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun json-format ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (shell-command-on-region (point-min)&#xA;                             (point-max)&#xA;                             &quot;python -m json.tool&quot;&#xA;                             (buffer-name) t))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs does not have formatting tool for programming languages (&lt;a href=&quot;https://github.com/tuhdo/semantic-refactor/blob/master/srefactor-demos/demos-elisp.org&quot; rel=&quot;noreferrer&quot;&gt;except for Lisp&lt;/a&gt;), only indentation commands.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="160" LastEditDate="2015-05-22T22:22:03.520" LastActivityDate="2015-05-22T22:22:03.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12153" PostTypeId="1" AcceptedAnswerId="12164" CreationDate="2015-05-05T13:57:38.780" Score="7" ViewCount="1089" Body="&lt;p&gt;I'm looking for a command inside Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you are currently in a directory. &#xA;In the directory there are 2 files: &lt;code&gt;foo.txt&lt;/code&gt; and &lt;code&gt;bar.txt&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;foo.txt&lt;/code&gt; opened in Emacs and is being displayed in a buffer. Then I would like to go to the next file of the current directory of the buffer, so open the &lt;code&gt;bar.txt&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there is a Helm source for displaying the another files of the current directory, but I would like to make a keybinding for it, to scroll forth and back between the files in the directory. Dired gave me no suitable commands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone knows a suitable command? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="50" LastEditDate="2015-05-05T17:31:08.230" LastActivityDate="2015-05-05T22:52:51.740" Title="Does some command exist, which goes to the next file of the current directory?" Tags="|dired|files|directories|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12155" PostTypeId="2" ParentId="12150" CreationDate="2015-05-05T14:11:22.260" Score="10" Body="&lt;pre&gt;&lt;code&gt;#+NAME: fig:org_fig&#xA;#+BEGIN_SRC python :results file :exports results :session org_org&#xA;clf()&#xA;plot(np.sin(np.arange(0,7,0.1)))&#xA;plt.savefig('org.png', transparent=True, bbox_inches='tight')&#xA;'org.png'&#xA;#+END_SRC&#xA;#+CAPTION: Org Fig&#xA;#+LABEL: fig:org_fig&#xA;#+ATTR_LATEX: :width 0.5\textwidth&#xA;#+RESULTS: fig:org_fig&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Order is important. Putting &lt;code&gt;+#NAME&lt;/code&gt; or &lt;code&gt;+CAPTION&lt;/code&gt; higher/lower may cause issues.&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="91" LastEditDate="2016-02-01T19:43:08.240" LastActivityDate="2016-02-01T19:43:08.240" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12156" PostTypeId="2" ParentId="12153" CreationDate="2015-05-05T14:49:18.610" Score="3" Body="&lt;p&gt;Here is one way to implement this but you will need to first install the &lt;a href=&quot;https://github.com/jaypei/emacs-neotree&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;neotree&lt;/code&gt;&lt;/a&gt; package from Melpa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then put the below in your emacs init.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/find-file-next-in-dir (&amp;amp;optional prev)&#xA;  &quot;Open the next file in the directory.&#xA;When PREV is non-nil, open the previous file in the directory.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((neo-init-state (neo-global--window-exists-p)))&#xA;    (if (null neo-init-state)&#xA;        (neotree-show))&#xA;    (neo-global--select-window)&#xA;    (if (if prev&#xA;            (neotree-previous-line)&#xA;          (neotree-next-line))&#xA;        (progn&#xA;          (neo-buffer--execute nil&#xA;                               (quote neo-open-file)&#xA;                               (lambda (full-path &amp;amp;optional arg)&#xA;                                 (message &quot;Reached dir: %s/&quot; full-path)&#xA;                                 (if prev&#xA;                                     (neotree-next-line)&#xA;                                   (neotree-previous-line)))))&#xA;      (progn&#xA;        (if prev&#xA;            (message &quot;You are already on the first file in the directory.&quot;)&#xA;          (message &quot;You are already on the last file in the directory.&quot;))))&#xA;    (if (null neo-init-state)&#xA;        (neotree-hide))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the sake of this explanation, let's say you bound this function to &lt;code&gt;C-c n&lt;/code&gt;. Then ..&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c n&lt;/code&gt; - Go to the &lt;strong&gt;next&lt;/strong&gt; file/dir in the current path&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-u C-c n&lt;/code&gt; - Go to the &lt;strong&gt;prev&lt;/strong&gt; file/dir in the current path&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-05T15:59:39.597" LastActivityDate="2015-05-05T15:59:39.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12157" PostTypeId="2" ParentId="12153" CreationDate="2015-05-05T15:45:50.340" Score="1" Body="&lt;p&gt;Since you mentioned that you use helm, here's one way to do it using helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open the first file normally using &lt;code&gt;helm-find-files&lt;/code&gt; and do whatever you need to with it.  Then run &lt;code&gt;helm-resume&lt;/code&gt; and press &lt;code&gt;C-n RET&lt;/code&gt;.  This will open the next file assuming that you are happy with the way helm orders the files (if not, it can be customized).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside of this approach is of course that you cannot use any helm commands in between files.  If you do, &lt;code&gt;helm-resume&lt;/code&gt; will resume that helm session instead.&lt;/p&gt;&#xA;" OwnerUserId="7146" LastActivityDate="2015-05-05T15:45:50.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12158" PostTypeId="1" AcceptedAnswerId="12184" CreationDate="2015-05-05T15:56:52.520" Score="5" ViewCount="247" Body="&lt;p&gt;When I upgrade packages in the &lt;code&gt;M-x list-packages&lt;/code&gt; menu, the docstrings and locations of the function definitions are invalid so that &lt;code&gt;describe-function&lt;/code&gt; gives an error and &lt;code&gt;find-function&lt;/code&gt; does not jump to the correct file.  For example, running &lt;code&gt;M-x describe-function&lt;/code&gt; on slime yields a help buffer that shows the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;slime is an interactive compiled Lisp function.&#xA;&#xA;(slime &amp;amp;optional ARG1 ARG2)&#xA;&#xA;Cannot open doc string file &quot;/home/user/.emacs.d/elpa/slime-20150501.137/slime.elc&quot;&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;M-x find-function&lt;/code&gt; on slime yields the following (I have debug-on-error set to t):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Can't find library /home/user/.emacs.d/elpa/slime-20150501.137/slime.el&quot;)&#xA;  signal(error (&quot;Can't find library /home/user/.emacs.d/elpa/slime-20150501.137/slime.el&quot;))&#xA;  error(&quot;Can't find library %s&quot; &quot;/home/user/.emacs.d/elpa/slime-20150501.137/slime.el&quot;)&#xA;  find-library-name(&quot;/home/user/.emacs.d/elpa/slime-20150501.137/slime.el&quot;)&#xA;  find-function-search-for-symbol(slime nil &quot;/home/user/.emacs.d/elpa/slime-20150501.137/slime.elc&quot;)&#xA;  find-function-noselect(slime)&#xA;  find-definition-noselect(slime nil)&#xA;  find-function-do-it(slime nil switch-to-buffer)&#xA;  find-function(slime)&#xA;  call-interactively(find-function nil nil)&#xA;  command-execute(find-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to fix this that doesn't require restarting Emacs?&lt;/p&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="11" LastEditDate="2015-05-06T13:40:41.550" LastActivityDate="2015-05-06T13:40:41.550" Title="Docstrings are invalid after upgrading packages" Tags="|package|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12159" PostTypeId="2" ParentId="12150" CreationDate="2015-05-05T15:58:13.093" Score="1" Body="&lt;p&gt;Here's the example I had in mind:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Example&#xA;  #+name: example_plot&#xA;  #+begin_src python :exports none&#xA;    import matplotlib&#xA;    matplotlib.use('Agg')&#xA;    import matplotlib.pyplot as plt&#xA;&#xA;    fig = plt.figure(figsize = (3, 2))&#xA;    plt.plot([1, 3, 2])&#xA;    fig.tight_layout()&#xA;    plt.savefig('myfig.pdf')&#xA;    'myfig.pdf'&#xA;  #+end_src&#xA;&#xA;* Example output&#xA;  #+caption: This is an example plot&#xA;  #+label: example-label&#xA;  call_example_plot[:session]()[:results file :exports results]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exported to LaTeX it produces:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Created 2015-05-05 Tue 18:53&#xA;\documentclass[11pt]{article}&#xA;\usepackage[utf8]{inputenc}&#xA;\usepackage[T1]{fontenc}&#xA;\usepackage{fixltx2e}&#xA;\usepackage{graphicx}&#xA;\usepackage{longtable}&#xA;\usepackage{float}&#xA;\usepackage{wrapfig}&#xA;\usepackage{rotating}&#xA;\usepackage[normalem]{ulem}&#xA;\usepackage{amsmath}&#xA;\usepackage{textcomp}&#xA;\usepackage{marvosym}&#xA;\usepackage{wasysym}&#xA;\usepackage{amssymb}&#xA;\usepackage{hyperref}&#xA;\tolerance=1000&#xA;\usepackage[utf8]{inputenc}&#xA;\author{wvxvw}&#xA;\date{\today}&#xA;\title{test-plot}&#xA;\hypersetup{&#xA;  pdfkeywords={},&#xA;  pdfsubject={},&#xA;  pdfcreator={Emacs 25.0.50.1 (Org mode 8.2.2)}}&#xA;\begin{document}&#xA;&#xA;\maketitle&#xA;\tableofcontents&#xA;&#xA;\section{Example}&#xA;\label{sec-1}&#xA;\section{Example output}&#xA;\label{sec-2}&#xA;\begin{figure}[htb]&#xA;\centering&#xA;\includegraphics[width=.9\linewidth]{myfig.pdf}&#xA;\caption{\label{example-label}This is an example plot}&#xA;\end{figure}&#xA;% Emacs 25.0.50.1 (Org mode 8.2.2)&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-05-05T15:58:13.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12160" PostTypeId="2" ParentId="6073" CreationDate="2015-05-05T16:11:50.240" Score="3" Body="&lt;p&gt;The code on the web page is a bit outdated. You spotted that it replaces existing syntax highlighting. In addition, it uses functions (&lt;code&gt;outline-depth&lt;/code&gt;) which doesn't seem to exist in modern Emacs versions. The code below reimplements this using &lt;code&gt;font-lock-add-keywords&lt;/code&gt;. Also, it doesn't use the &lt;code&gt;eval&lt;/code&gt; form, as it typically is only used in extreme situations where keywords can't be formed when the hook is called, fortunately, this isn't the case here.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-allout-mode-hook ()&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   `((,(concat &quot;^\\(&quot; outline-regexp &quot;\\).+&quot;)&#xA;      (0 (or (cdr (assq (- (match-end 1) (match-beginning 1))&#xA;                        '((1 . font-lock-function-name-face)&#xA;                          (2 . font-lock-variable-name-face)&#xA;                          (3 . font-lock-keyword-face)&#xA;                          (4 . font-lock-builtin-face)&#xA;                          (5 . font-lock-comment-face)&#xA;                          (6 . font-lock-constant-face)&#xA;                          (7 . font-lock-type-face)&#xA;                          (8 . font-lock-string-face))))&#xA;             font-lock-warning-face)))))&#xA;  (if (fboundp 'font-lock-flush)&#xA;      (font-lock-flush)&#xA;    (when font-lock-mode&#xA;      (with-no-warnings&#xA;        (font-lock-fontify-buffer)))))&#xA;&#xA;(add-hook 'allout-mode-hook 'my-allout-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="675" LastEditDate="2016-07-14T23:14:49.773" LastActivityDate="2016-07-14T23:14:49.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12161" PostTypeId="1" CreationDate="2015-05-05T16:16:25.247" Score="4" ViewCount="1121" Body="&lt;p&gt;I've remapped the laptop key fn to Hyper using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ns-function-modifier 'hyper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to scroll other window I set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;H-n&quot;) 'scroll-other-window)&#xA;(global-set-key (kbd &quot;H-p&quot; ) 'scroll-other-window-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;H-n works but H-p inserts a * char instead of scrolling down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M-x scroll-other-window-down works fine, only the mapping does not.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="50" LastEditDate="2015-05-05T16:43:14.360" LastActivityDate="2015-05-05T16:43:14.360" Title="Why can't I remap the laptop fn key modifier?" Tags="|key-bindings|keystrokes|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12162" PostTypeId="2" ParentId="12148" CreationDate="2015-05-05T16:21:31.757" Score="36" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/thorstadt/json.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;json.el&lt;/code&gt;&lt;/a&gt; package provides &lt;code&gt;json-pretty-print-buffer&lt;/code&gt;.  This is what it produces for your example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;{&#xA;  &quot;menu&quot;: {&#xA;    &quot;popup&quot;: {&#xA;      &quot;menuitem&quot;: [&#xA;        {&#xA;          &quot;onclick&quot;: &quot;CreateNewDoc()&quot;,&#xA;          &quot;value&quot;: &quot;New&quot;&#xA;        },&#xA;        {&#xA;          &quot;onclick&quot;: &quot;OpenDoc()&quot;,&#xA;          &quot;value&quot;: &quot;Open&quot;&#xA;        },&#xA;        {&#xA;          &quot;onclick&quot;: &quot;CloseDoc()&quot;,&#xA;          &quot;value&quot;: &quot;Close&quot;&#xA;        }&#xA;      ]&#xA;    },&#xA;    &quot;value&quot;: &quot;File&quot;,&#xA;    &quot;id&quot;: &quot;file&quot;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Seems pretty decent to me.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="160" LastEditDate="2015-05-22T22:21:25.100" LastActivityDate="2015-05-22T22:21:25.100" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12163" PostTypeId="2" ParentId="12145" CreationDate="2015-05-05T17:21:42.720" Score="3" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/Malabarba/elisp-bug-hunter&quot; rel=&quot;nofollow&quot;&gt;Bug-Hunter&lt;/a&gt; may be able to help you with that.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the &lt;code&gt;bug-hunter&lt;/code&gt; package from the Package-Menu.&lt;/li&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;M-x bug-hunter-init-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It will ask you for an assertion, type (or paste) in the following predicate and hit &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(or (member &quot;~/.emacs.d/&quot; load-path)&#xA;    (member (expand-file-name &quot;~/.emacs.d/&quot;) load-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That's it! You'll be presented with a buffer reporting the results, similar to this one:&lt;br&gt;&#xA;&lt;img src=&quot;https://github.com/Malabarba/elisp-bug-hunter/raw/master/cl-example.png&quot; alt=&quot;cl&quot;&gt;&lt;br&gt;&#xA;&lt;em&gt;(this run was testing which package was doing a &lt;code&gt;(require 'cl)&lt;/code&gt;)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Things to consider&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The bug-hunter can only analyse your init file, so if the problem is&#xA;happening during autoloading time, then it's only going to blame&#xA;&lt;code&gt;(package-initialize)&lt;/code&gt; (which is not very useful).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if it happens during package &lt;code&gt;require&lt;/code&gt; time, if&#xA;it's something else in your init file, or if it's something in the&#xA;site-files, the Bug-Hunter should give some relevant information.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-05-05T17:26:43.063" LastActivityDate="2015-05-05T17:26:43.063" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12164" PostTypeId="2" ParentId="12153" CreationDate="2015-05-05T17:28:07.717" Score="5" Body="&lt;p&gt;For simplicity, here is another take on a function that opens the next or previous file (by name) in the current directory.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun find-next-file (&amp;amp;optional backward)&#xA;  &quot;Find the next file (by name) in the current directory.&#xA;&#xA;With prefix arg, find the previous file.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (when buffer-file-name&#xA;    (let* ((file (expand-file-name buffer-file-name))&#xA;           (files (cl-remove-if (lambda (file) (cl-first (file-attributes file)))&#xA;                                (sort (directory-files (file-name-directory file) t nil t) 'string&amp;lt;)))&#xA;           (pos (mod (+ (cl-position file files :test 'equal) (if backward -1 1))&#xA;                     (length files))))&#xA;      (find-file (nth pos files)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-05-05T17:34:08.060" LastActivityDate="2015-05-05T17:34:08.060" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12166" PostTypeId="2" ParentId="12125" CreationDate="2015-05-05T18:04:03.700" Score="4" Body="&lt;p&gt;You can use the following:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun create-org-link (&amp;amp;optional title)&#xA;  &quot;Foobar de roobarb&quot;&#xA;  (interactive)&#xA;  (unless title&#xA;    (setq title&#xA;          (read-string &quot;Please enter a title: &quot;)))&#xA;  (let ((out (format &quot;[[file:%s-%s.org][%s - %s]]&quot;&#xA;                     (format-time-string&#xA;                      org-link-date-stamp-format(current-time))&#xA;                     (replace-regexp-in-string &quot; &quot; &quot;&quot; title)&#xA;                     (format-time-string&#xA;                      org-link-date-stamp-format(current-time))&#xA;                     title)))&#xA;    (if (called-interactively-p)&#xA;        (insert out)&#xA;      out)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Rather than prompt for the title as part of the interactive call, prompt for it manually if it wasn't passed.  &lt;code&gt;org-capture&lt;/code&gt; doesn't default to &lt;code&gt;interactive&lt;/code&gt; when calling the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wrapping it as &lt;code&gt;(call-interactively #'create-org-link)&lt;/code&gt; would work as well, however you will need to remove &lt;code&gt;insert&lt;/code&gt; so that only the format call is passed.  Otherwise the data is inserted into the wrong buffer (as part of the prompt/parsing rather than passed to the final template).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;if&lt;/code&gt; statement at the end of the function takes care of inserting it (when interactive) vs returning the string (when called from the template).&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-05-05T18:04:03.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12167" PostTypeId="1" AcceptedAnswerId="12211" CreationDate="2015-05-05T18:41:53.877" Score="2" ViewCount="1012" Body="&lt;p&gt;I am reading the &lt;a href=&quot;https://jgmaox.wordpress.com/2013/11/05/setup-markdown-in-emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;following&lt;/a&gt; blog on setting up Emacs to use pandoc in such away that &lt;kbd&gt;C-c C-p&lt;/kbd&gt; will open the document in my browser.&lt;/p&gt;&#xA;&lt;p&gt;It says:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Restart Emacs, and open a markdown file (for example test.md). Then select Options-&amp;gt;Customize Emacs-&amp;gt;Specific Option, enter &lt;code&gt;markdown-command&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;enter &lt;code&gt;pandoc -f markdown -t html -s --mathjax --highlight-style=pygments&lt;/code&gt; in the &amp;quot;Markdown Command&amp;quot; field and select &amp;quot;Apply and save&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;Then when you are editing your markdown file in Emacs, try &lt;kbd&gt;C-c C-c p&lt;/kbd&gt;, the generated html will show up in your default browser.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;What would be the Elisp entry in &lt;code&gt;.emacs&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;p&gt;I am using Emacs 24.5.&lt;/p&gt;&#xA;" OwnerUserId="2603" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-10T09:37:25.900" Title="Emacs init pandoc setup" Tags="|elisp|init-file|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12168" PostTypeId="1" AcceptedAnswerId="12169" CreationDate="2015-05-05T20:18:05.117" Score="3" ViewCount="741" Body="&lt;p&gt;In org-mode, how can I change the formatting of timestamps exported to LaTeX PDF?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the generated .tex file, I see that my timestamps are rendered in LaTeX as &lt;code&gt;\textit&lt;/code&gt;. How can I modify this? I probably want to change it to non-italic monospace font.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-10-12T17:45:06.513" Title="in org-mode, how to change the formatting of timestamps in export to LaTeX?" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12169" PostTypeId="2" ParentId="12168" CreationDate="2015-05-05T22:13:30.273" Score="4" Body="&lt;p&gt;The variables are &lt;code&gt;org-latex-active-timestamp-format&lt;/code&gt; and &lt;code&gt;org-latex-inactive-timestamp-format&lt;/code&gt;.  Setting them to &quot;\\texttt{%s}&quot; (note the two backslashes) gives you non-italic monospace.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="13625" LastEditDate="2016-10-12T17:45:06.513" LastActivityDate="2016-10-12T17:45:06.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12170" PostTypeId="2" ParentId="12153" CreationDate="2015-05-05T22:52:51.740" Score="1" Body="&lt;p&gt;Here's a simple solution. First, you know that Dired gives you the commands &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; to go to the next and previous file, &lt;code&gt;o&lt;/code&gt; to open it in the other window and &lt;code&gt;s&lt;/code&gt; to sort (by modification time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package &lt;code&gt;peep-dired&lt;/code&gt; automates a bit everything (like the ranger command line file browser).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/asok/peep-dired&quot; rel=&quot;nofollow&quot;&gt;https://github.com/asok/peep-dired&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Install it with &lt;code&gt;M-x package-install&lt;/code&gt; (with &lt;a href=&quot;http://melpa.milkbox.net/#/getting-started&quot; rel=&quot;nofollow&quot;&gt;melpa&lt;/a&gt;)&#xA;Now when you use the arrow keys or &lt;code&gt;C-n&lt;/code&gt; and &lt;code&gt;C-p&lt;/code&gt; it will automatically display the file content in the other window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More about Dired: &lt;a href=&quot;http://wikemacs.org/wiki/Dired&quot; rel=&quot;nofollow&quot;&gt;http://wikemacs.org/wiki/Dired&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More about (m)elpa: &lt;a href=&quot;http://wikemacs.org/wiki/MELPA&quot; rel=&quot;nofollow&quot;&gt;http://wikemacs.org/wiki/MELPA&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2015-05-05T22:52:51.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12171" PostTypeId="1" CreationDate="2015-05-06T00:50:03.787" Score="1" ViewCount="966" Body="&lt;p&gt;This is probably simple and I've been trying to develop some lisp skills but I'm completely stumped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm trying to do is insert a link in one file every time a TODO state change occurs (probably not necessary, but you can see more details in my older &lt;a href=&quot;https://stackoverflow.com/questions/25649170/how-can-i-log-org-mode-clock-entries-to-current-clock-and-to-an-index-file&quot;&gt;Stackoverflow post&lt;/a&gt;).  The goal is to create an index of my activities throughout the day that all link back to my agenda file.  E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[2014-09-03 Wed 09:05] - STARTED this is my heading&#xA;[2014-09-03 Wed 09:34] - DONE this is my heading&#xA;[2014-09-03 Wed 09:50] - STARTED this is another task in my agenda&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun andy/journal-state-change (plist-chg)&#xA;  &quot;When the state changes, link it into the journal&quot;&#xA;    (org-journal-add-entry (plist-get plist-chg :position))&#xA;    )&#xA;&#xA;(add-hook 'org-trigger-hook&#xA;          'andy/journal-state-change)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which, according to the &lt;a href=&quot;http://orgmode.org/worg/doc.html#org-trigger-hook&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-trigger-hook documentation&lt;/a&gt; will be give a property list which includes a &lt;code&gt;:position&lt;/code&gt; property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I modified the &lt;a href=&quot;http://www.emacswiki.org/emacs/OrgJournal&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-journal&lt;/a&gt; library to integrate this function into its journaling (snipped down for brevity):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-journal-add-entry (apoint)&#xA;  &quot;APJ 5/4/15 add call for inserting from todo state change&quot;&#xA;  (interactive)&#xA;  ;; code snipped here which prepares this buffer to get the new&#xA;  ;; journal entry&#xA;  ;; my additions here:&#xA;      (org-insert-link (org-entry-get apoint &quot;LOCATION&quot;) (org-entry-get apoint &quot;DESCRIPTION&quot;) (org-entry-get apoint &quot;DESCRIPTION&quot;) )&#xA;      (set-buffer-modified-p unsaved)&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure that's not the way to do it because I'm dealing with a point and trying to insert a link.  It would be nice to just pass the TODO entry from the original but I'm not sure either how to get the link or to insert it in the other file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions greatly welcomed!&lt;/p&gt;&#xA;" OwnerUserId="8240" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-09-05T19:44:17.573" Title="How can I insert a link from one org file into another?" Tags="|org-mode|hooks|customize|hyperlinks|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12173" PostTypeId="1" CreationDate="2015-05-06T03:22:06.230" Score="6" ViewCount="4446" Body="&lt;p&gt;I use &lt;code&gt;(setq-default indent-tabs-mode nil)&lt;/code&gt; in my init file so to avoid using TABs but when I write some files (like C++ files) then it allows me to insert TABs if I am in an if-statement for example. Why is that happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I thought initially that &lt;code&gt;(setq-default indent-tabs-mode nil)&lt;/code&gt; prevents the usage of TABs completely but I have seen in a lot of answers that it converts TABs to spaces. How is it doing that?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2018-11-07T02:34:57.127" Title="Confusion by the usage of indent-tabs-mode nil" Tags="|indentation|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12174" PostTypeId="2" ParentId="12173" CreationDate="2015-05-06T03:37:14.530" Score="4" Body="&lt;p&gt;Not sure what you are asking. Non-&lt;code&gt;nil&lt;/code&gt; &lt;code&gt;indent-tabs-mode&lt;/code&gt; means that Emacs can use &lt;code&gt;TAB&lt;/code&gt; chars instead of a number of consecutive &lt;code&gt;SPC&lt;/code&gt; chars.  If the value is &lt;code&gt;nil&lt;/code&gt; in a given buffer then indentation by Emacs (e.g. automatic indentation) uses only &lt;code&gt;SPC&lt;/code&gt; chars.  But even in that case there is nothing preventing you from inserting a &lt;code&gt;TAB&lt;/code&gt; char (e.g., using &lt;code&gt;C-q TAB&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What &lt;code&gt;setq-default&lt;/code&gt; does determines only the default behavior.  In any given buffer (e.g., in any given mode), the value can be different from the default (aka global) value.  It is the buffer-local value that determines the behavior (as described in the previous paragraph).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Conversion&quot; of &lt;code&gt;TAB&lt;/code&gt; chars to one or more consecutive &lt;code&gt;SPC&lt;/code&gt; chars happens if &lt;code&gt;indent-tabs-mode&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; and you hit &lt;code&gt;DEL&lt;/code&gt; (the Backspace key) or you change the code in such a way that the appropriate indentation column changes.  All that happens is that if a &lt;code&gt;TAB&lt;/code&gt; char needs to be removed to meet the new indentation level then &lt;code&gt;SPC&lt;/code&gt; chars replace it as needed.  Existing &lt;code&gt;TAB&lt;/code&gt; chars that do not need to be removed to get proper indentation are not removed.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(On a different but related subject, be aware that you can replace all existing &lt;code&gt;TAB&lt;/code&gt; chars in a buffer by doing &lt;code&gt;C-x h M-x untabify&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-11-07T02:34:57.127" LastActivityDate="2018-11-07T02:34:57.127" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="12175" PostTypeId="1" AcceptedAnswerId="12176" CreationDate="2015-05-06T05:01:11.033" Score="15" ViewCount="12806" Body="&lt;p&gt;I am considering in giving Evil Mode a chance. I have searched extensively to find how do you use it and everyone is just sharing their customizations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I can't understand is when you install and activate Evil Mode does automatically use the keys of Vim or you have to customize them to your needs? To put it another way when I activate it should I change anything or everything will work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more thing. In Emacs when you install packages you should use specific keys for some tasks. For example in AUCTeX you use &lt;code&gt;C-c C-c&lt;/code&gt; to compile so   in Evil Mode what keys do you use for the packages? You have to customize them for every package?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2016-12-12T21:58:22.450" Title="Instructions on how to work with Evil Mode" Tags="|evil|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12176" PostTypeId="2" ParentId="12175" CreationDate="2015-05-06T06:59:28.757" Score="19" Body="&lt;p&gt;Evil is basically a global minor mode that enables a few extra keymaps on top of Emacs and comes with the respective editing commands you'd use in them.  It is intentionally built to reuse as much existing Emacs Lisp code as possible for better interoperability and less wasted effort, you'll for instance find out that window movement was lifted from &lt;a href=&quot;http://www.emacswiki.org/emacs/WindMove&quot;&gt;windmove.el&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upon activating &lt;code&gt;evil-mode&lt;/code&gt; it is enabled for all buffers and an initial state (Vim calls them modes, but modes already mean something different in Emacs, so Evil calls them states) is picked.  That state is just a keymap, so commands bound in that keymap will just work, any other keys will be passed through to the next keymap in charge.  The Evil devs did poke a few holes on purpose in these, like for &lt;code&gt;C-g&lt;/code&gt;, &lt;code&gt;C-x&lt;/code&gt; and &lt;code&gt;C-c&lt;/code&gt; (keybinds using the meta key will just work since Vim doesn't use it at all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This essentially means that using &lt;code&gt;gg&lt;/code&gt; in normal state will do the right thing.  It also means that using &lt;code&gt;C-c C-c&lt;/code&gt; will call the respective Emacs command.  In case you find an useful command to be obscured, you can switch into Emacs state with &lt;code&gt;C-z&lt;/code&gt; (and switch back into the previous one by hitting it again), then later customize Evil to use a different initial state for the mode in question or change its keymaps directly.  If Emacs state is picked for a buffer where you'd prefer having at least Vim-style movement, you can use motion state and have them.  The amount of customization remains as small as you'd like it to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at &lt;a href=&quot;https://github.com/wasamasa/dotemacs/blob/master/init.org#evil&quot;&gt;my config&lt;/a&gt; to get an idea how more elaborate configuration could look like.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-05-06T06:59:28.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12177" PostTypeId="1" CreationDate="2015-05-06T09:47:53.367" Score="5" ViewCount="386" Body="&lt;p&gt;I'm new to org mode. Something about levels in org mode confused me but i found no info around (both in tutorials and Google).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can put text under any heading, and the text is treated as a child node of the heading. But I wonder, is it possible to lay some text in the same level with some other headings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading Level 1&#xA;    Some Text A&#xA;    ** Heading Level 2&#xA;        Some Text B&#xA;    Some Text C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My purpose is to put 'Some Text A' and 'Some Text C' under 'Heading Level 1' but parallel to 'Heading Level 2'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default way of org mode is that 'Some Text C' is treated as a child of 'Heading Level 2' (just after 'Some Text B'), which is not I want. Noted that 'Some Text A' performs well.&lt;/p&gt;&#xA;" OwnerUserId="8243" LastActivityDate="2015-05-06T11:03:37.727" Title="Questions About Org Mode Levels" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12178" PostTypeId="2" ParentId="12177" CreationDate="2015-05-06T10:28:28.183" Score="1" Body="&lt;p&gt;There is an &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#closing-outline-sections&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;FAQ entry&quot;&gt;FAQ entry&lt;/a&gt; that discusses this question and suggests some work arounds.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Edit: this is the relevant fragment of the FAQ entry:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The short answer to the question is no. Org-mode adheres to the cascading logic of outlines, in which a section is closed only by another section that occupies an equal or greater level.&lt;/p&gt;&#xA;&lt;p&gt;Here are some workarounds:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You can use inline tasks to create non-folding subsections. See the&#xA;documentation in org-inlinetask.el, which is part of the org-mode&#xA;distribution.&lt;/li&gt;&#xA;&lt;li&gt;You can create a temporary heading, such as &amp;quot;**&#xA;Continue main section&amp;quot; and then remove it when you are ready to&#xA;export.&lt;/li&gt;&#xA;&lt;li&gt;You can create a separate outline heading (e.g., * ACTIONS),&#xA;creating TODOs there with links to the relevant sections of your&#xA;main text.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5443" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-06T11:03:37.727" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12179" PostTypeId="2" ParentId="12173" CreationDate="2015-05-06T12:36:39.363" Score="0" Body="&lt;p&gt;&lt;code&gt;(setq indent-tabs-mode nil)&lt;/code&gt; in &lt;code&gt;c++-mode-hook&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="25" LastEditDate="2015-05-07T19:04:23.973" LastActivityDate="2015-05-07T19:04:23.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12180" PostTypeId="1" AcceptedAnswerId="12182" CreationDate="2015-05-06T12:59:32.970" Score="19" ViewCount="3184" Body="&lt;p&gt;What are the benefits of using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html#Indirect-Buffers&quot;&gt;indirect buffers&lt;/a&gt;? Under what circumstances are they useful?&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="115" LastEditDate="2015-05-06T13:13:15.713" LastActivityDate="2015-05-07T15:29:11.793" Title="Why use indirect buffers?" Tags="|buffers|indirect-buffers|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12181" PostTypeId="1" AcceptedAnswerId="12183" CreationDate="2015-05-06T13:06:44.713" Score="2" ViewCount="195" Body="&lt;p&gt;I want &lt;code&gt;web-mode&lt;/code&gt; to use &lt;code&gt;comment-dwim&lt;/code&gt; instead of &lt;code&gt;web-mode-comment-or-uncomment&lt;/code&gt; (bound to &lt;code&gt;M-;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Web Mode (http://web-mode.org/)&#xA;(with-eval-after-load 'web-mode&#xA;  (setq&#xA;   web-mode-markup-indent-offset 2&#xA;   web-mode-css-indent-offset 2&#xA;   web-mode-code-indent-offset 2)&#xA;  ;; (add-to-list 'auto-mode-alist '(&quot;\\.html?\\'&quot; . web-mode))&#xA;  (global-set-key (kbd &quot;M-;&quot;) 'comment-dwim))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the change doesn't apply, I've also tried with &lt;code&gt;local-set-key&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2015-05-06T13:20:25.183" Title="How can I set web-mode to use comment-dwim?" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12182" PostTypeId="2" ParentId="12180" CreationDate="2015-05-06T13:09:50.957" Score="19" Body="&lt;p&gt;To see and edit multiple locations of the same buffer. So, you don't have to scroll a long buffer but simply switch window to visible region. Each cloned buffer also has different mark ring, narrowing and other buffer properties. If you don't use indirect buffer but create another window of the same buffer, then everything is shared and you cannot perform other advance features beyond viewing and editing different locations. For example, with an indirect buffer, you can fold all the code block, effectively create a &quot;tag tree&quot; without affecting the original buffer. Using a window, both buffers in both windows are folded because both buffers are the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, indirect buffer is a completely different buffer that happens to share the same text and file in your original  buffer, so when you save cloned buffer, it saves your original file too.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-05-07T15:29:11.793" LastActivityDate="2015-05-07T15:29:11.793" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12183" PostTypeId="2" ParentId="12181" CreationDate="2015-05-06T13:20:25.183" Score="5" Body="&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'web-mode&#xA;  (define-key web-mode-map (kbd &quot;M-;&quot;) 'comment-dwim))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-05-06T13:20:25.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12184" PostTypeId="2" ParentId="12158" CreationDate="2015-05-06T13:20:33.883" Score="5" Body="&lt;p&gt;A solution is to load that package again: &lt;code&gt;M-x load-library &amp;lt;package&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen the same problem. I believe it is because the docstrings etc. are &quot;pointing&quot; to the old version of the code which was deleted when you upgraded the package. By loading it you reset these links.&lt;/p&gt;&#xA;" OwnerUserId="245" LastActivityDate="2015-05-06T13:20:33.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12185" PostTypeId="2" ParentId="12180" CreationDate="2015-05-06T13:45:43.170" Score="11" Body="&lt;p&gt;One use case is using a different major mode on one part of a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance I was at one time working with xml documents with code inside certain elements. I wanted to be able to edit the entire document as if it were xml, but still have all the major mode features for the programming language embedded in certain elements, so I narrowed to the body of those elements in an indirect buffer that was running the appropriate major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a function from my config that I use to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun indirect-region (start end)&#xA;  &quot;Edit the current region in another indirect buffer.&#xA;    Prompt for a major mode to activate.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((buffer-name (generate-new-buffer-name &quot;*indirect*&quot;))&#xA;        (mode (intern&#xA;               (completing-read&#xA;                &quot;Mode: &quot;&#xA;                (mapcar (lambda (e)&#xA;                          (list (symbol-name e)))&#xA;                        (apropos-internal &quot;-mode$&quot; 'commandp))&#xA;                nil t))))&#xA;    (pop-to-buffer (make-indirect-buffer (current-buffer) buffer-name))&#xA;    (funcall mode)&#xA;    (narrow-to-region start end)&#xA;    (goto-char (point-min))&#xA;    (shrink-window-if-larger-than-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: this isn't perfect, things like font-lock require special additional work for use in this scenario.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-05-06T13:45:43.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12186" PostTypeId="1" AcceptedAnswerId="12188" CreationDate="2015-05-06T13:58:50.873" Score="4" ViewCount="357" Body="&lt;p&gt;When I run &lt;code&gt;M-x clipboard-kill-ring-save&lt;/code&gt;, emacs tells me: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;You can run the command `clipboard-kill-ring-save' with &amp;lt;copy&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How do I use &lt;code&gt;&amp;lt;copy&amp;gt;&lt;/code&gt;? &lt;code&gt;M-x &amp;lt;copy&amp;gt;&lt;/code&gt; simply says &lt;code&gt;[No match]&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="296" LastEditorUserId="253" LastEditDate="2015-05-06T14:11:42.953" LastActivityDate="2015-05-06T14:13:05.540" Title="What does &lt;copy&gt; mean?" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12187" PostTypeId="2" ParentId="12186" CreationDate="2015-05-06T14:08:34.600" Score="2" Body="&lt;p&gt;Emacs refers to special (&quot;pseudo&quot;) keys with &lt;code&gt;&amp;lt;angle brackets&amp;gt;&lt;/code&gt;.  From the &lt;a href=&quot;http://emacswiki.org/emacs/EmacsKeyNotation&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki on key notation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Some keys are referred to as “function” keys or “pseudo” keys. This includes keys that are not among the keyboard function keys &lt;code&gt;F1&lt;/code&gt;,…&lt;code&gt;F12&lt;/code&gt;. It includes keys that might not be on your keyboard, but are on other keyboards. &lt;strong&gt;It even includes keys, such as &lt;code&gt;&amp;lt;insert-file&amp;gt;&lt;/code&gt;, that are not on any keyboard, anywhere.&lt;/strong&gt; For one thing, &lt;strong&gt;Emacs treats menu bindings as key bindings&lt;/strong&gt;: a menu item is implemented as a pseudo key.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, for example, &lt;code&gt;&amp;lt;left&amp;gt;&lt;/code&gt; refers to the left arrow key.  I've never heard of the &lt;code&gt;&amp;lt;copy&amp;gt;&lt;/code&gt; key, so I presume it's referring to the menu binding rather than a key.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-05-06T14:08:34.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12188" PostTypeId="2" ParentId="12186" CreationDate="2015-05-06T14:13:05.540" Score="8" Body="&lt;p&gt;It refers to the &quot;Copy&quot; key found on e.g. Sun keyboards, as in this photo (second key from the left, third from the bottom):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Oyx8B.jpg&quot; alt=&quot;Photo of left part of Sun keyboard&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-05-06T14:13:05.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12189" PostTypeId="1" CreationDate="2015-05-06T14:21:26.303" Score="10" ViewCount="1074" Body="&lt;p&gt;I've started editing a lot of files that have no extensions, but are still in a major mode format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm the only Emacs user on the team, and I don't want to make it a painfully obvious that my editor needs &lt;em&gt;special&lt;/em&gt; stuff. I would like to avoid changing the codebase. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I can't change the filename&lt;/li&gt;&#xA;&lt;li&gt;I can't use special Emacs comments&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would like Emacs to remember whatever mode I put the file manually in last (with, say &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;conf-mode&lt;/code&gt;) and automatically activate that mode when I visit it again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;savehist-mode&lt;/code&gt; to handle persistence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I do this painlessly?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-05-06T19:02:47.773" Title="Remember modes for files without extensions" Tags="|major-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12190" PostTypeId="1" CreationDate="2015-05-06T15:09:30.843" Score="4" ViewCount="453" Body="&lt;p&gt;That is, if I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-empty-dir-a/&#xA;-nonempty-dir-a/&#xA;  -empty-dir-a/&#xA;    -empty-dir-a/&#xA;  file-a&#xA;file-a&#xA;file-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-nonempty-dir-a/&#xA;  file-a&#xA;file-a&#xA;file-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm aware that there are many OS-specific solutions to this, but I'd like to stick to elisp, ideally &lt;code&gt;:)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-05-06T19:13:17.650" LastActivityDate="2015-05-06T19:14:20.670" Title="How can I recursively delete all empty directories?" Tags="|directories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12191" PostTypeId="2" ParentId="12190" CreationDate="2015-05-06T15:09:30.843" Score="2" Body="&lt;p&gt;This requires the following functions from &lt;a href=&quot;https://github.com/rejeep/f.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;f.el&lt;/code&gt;&lt;/a&gt;, available from MELPA:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;f-directories&lt;/code&gt; returns a list of directories in the given directory&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;f-entries&lt;/code&gt; returns all files and folders in the given directory&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun *-delete-empty-directories (root-directory)&#xA;  &quot;Recursively delete empty directories in ROOT-DIRECTORY.&#xA;&#xA;When called from dired, `dired-current-directory' is used for&#xA;ROOT-DIRECTORY.&quot;&#xA;&#xA;  ;; Interface&#xA;  (interactive (list (if (eq major-mode 'dired-mode)&#xA;                         (expand-file-name (dired-current-directory))&#xA;                       (read-from-minibuffer &quot;Root directory: &quot;))))&#xA;  (when (or (null root-directory) (string= &quot;&quot; root-directory))&#xA;    (user-error &quot;No root directory provided&quot;))&#xA;  (when (called-interactively-p 'interactive)&#xA;    (unless (yes-or-no-p (format &quot;Delete all non-empty directories in `%s'? &quot;&#xA;                                 root-directory))&#xA;      (user-error &quot;Directory `%s' has been left untouched&quot; root-directory)))&#xA;&#xA;  ;; Implementation&#xA;  (require 'f)&#xA;  (let ((entries (f-directories root-directory)))&#xA;    (while entries&#xA;      (let ((curdir (car entries)))&#xA;        (when (f-directories curdir)&#xA;          (*-delete-empty-directories curdir))&#xA;        (unless (f-entries curdir)&#xA;          (delete-directory curdir)&#xA;          (message &quot;Directory deleted: `%s'&quot; curdir))&#xA;        (setq entries (cdr entries))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-05-06T19:14:20.670" LastActivityDate="2015-05-06T19:14:20.670" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12192" PostTypeId="1" CreationDate="2015-05-06T15:18:23.840" Score="3" ViewCount="266" Body="&lt;p&gt;I currently have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-save-hook&#xA;  'executable-make-buffer-file-executable-if-script-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my config to automatically make scripts executable when saving them.  However, I personally don't like that this means that also the autosaved files ending in &lt;code&gt;~&lt;/code&gt;, e.g., &lt;code&gt;myscript.sh~&lt;/code&gt;, will automatically be rendered executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I automatically make only files not ending in &lt;code&gt;~&lt;/code&gt; executable upon save?  I guess one has to write a small wrapper function, but my elisp skills are quite under-developed ... Any help is appreciated!&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2015-05-06T20:17:13.813" Title="Don't apply executable-make-buffer-file-executable-if-script-p to backup files" Tags="|auto-save|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12193" PostTypeId="1" AcceptedAnswerId="12195" CreationDate="2015-05-06T15:20:48.583" Score="5" ViewCount="107" Body="&lt;p&gt;Let's say I use abbrev to expand &lt;code&gt;eq&lt;/code&gt; into &lt;code&gt;equation&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want &lt;code&gt;eq&lt;/code&gt; to always expand, except when followed by a colon (&lt;code&gt;:&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The logic is that in LaTeX I do not want equation identifiers (e.g., &lt;code&gt;eq:xyz&lt;/code&gt;) to be expanded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas about how to selectively disable abbrev expansion?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="253" LastEditDate="2015-05-06T15:30:47.837" LastActivityDate="2015-05-06T15:30:47.837" Title="Do not expand a given abbrev when followed by &quot;:&quot;" Tags="|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12194" PostTypeId="2" ParentId="12189" CreationDate="2015-05-06T15:26:50.480" Score="13" Body="&lt;p&gt;There are a number of ways to identify the major mode for a file that don't rely on an extension, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes&quot;&gt;Choosing File Modes&lt;/a&gt; in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on the kinds of files you are dealing with, perhaps you could use the &lt;code&gt;magic-mode-alist&lt;/code&gt;. Also note that &lt;code&gt;auto-mode-alist&lt;/code&gt; is not limited to matching extensions: you can match any part of the file name or path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the files you are dealing with are not consistent enough for those mechanisms, one option is to add &lt;code&gt;auto-mode-alist&lt;/code&gt; entries that match the entire file name, or match the root path of some project and call a custom function to match names to modes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all the files in a given directory are of the same type you could also use a directory-local variable to set the mode. Directory variables can be set in your init file rather than in a .dir-locals  file -- see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables&quot;&gt;Directory Variables&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a quick attempt at managing your own alist of absolute file names and major-modes. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-custom-mode-alist '())&#xA;(defvar my-custom-mode-alist-file (expand-file-name &quot;custom-file-assoc&quot; user-emacs-directory))&#xA;&#xA;;; command to save the file-&amp;gt;mode association of the current buffer&#xA;(defun save-file-mode-association ()&#xA;  (interactive)&#xA;  (when buffer-file-name&#xA;    (add-to-list 'my-custom-mode-alist (cons buffer-file-name major-mode))&#xA;    (write-custom-mode-alist my-custom-mode-alist-file)))&#xA;&#xA;(defun write-custom-mode-alist (file)&#xA;  (with-current-buffer (get-buffer-create &quot; *Custom File Assocations*&quot;)&#xA;    (goto-char (point-min))&#xA;    (delete-region (point-min) (point-max))&#xA;    (pp my-custom-mode-alist (current-buffer))&#xA;    (condition-case nil&#xA;        (write-region (point-min) (point-max) file)&#xA;      (file-error (message &quot;Can't write %s&quot; file)))&#xA;    (kill-buffer (current-buffer))&#xA;    (message &quot;Wrote custom file associations to file %s&quot; file)))&#xA;&#xA;(defun load-custom-mode-alist (file)&#xA;  (when (file-exists-p file)&#xA;    (with-current-buffer&#xA;        (let ((enable-local-variables nil))&#xA;          (find-file-noselect file))&#xA;      (goto-char (point-min))&#xA;      (setq my-custom-mode-alist (read (current-buffer)))&#xA;      (setq auto-mode-alist (append auto-mode-alist my-custom-mode-alist))&#xA;      (kill-buffer (current-buffer)))))&#xA;&#xA;;; Load any custom file associations and add them to auto-mode-alist&#xA;(load-custom-mode-alist my-custom-mode-alist-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="115" LastEditDate="2015-05-06T17:32:15.273" LastActivityDate="2015-05-06T17:32:15.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12195" PostTypeId="2" ParentId="12193" CreationDate="2015-05-06T15:29:45.220" Score="5" Body="&lt;p&gt;You could either hack the syntax table so as not to treat the &lt;code&gt;:&lt;/code&gt; as a non-word constituent, or you could write an &lt;code&gt;:enable-function&lt;/code&gt; that will prevent expansion on the basis of &lt;code&gt;:&lt;/code&gt;.  This one works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'text-mode-abbrev-table&#xA;  '((&quot;eq&quot; &quot;equation&quot;))&#xA;  &quot;My table.&quot;&#xA;  :enable-function (lambda ()&#xA;                     (let* ((vec  (this-command-keys-vector))&#xA;                            (char (aref vec (1- (length vec)))))&#xA;                       (not (eq ?: char)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-05-06T15:29:45.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12196" PostTypeId="2" ParentId="12180" CreationDate="2015-05-06T16:10:03.960" Score="6" Body="&lt;p&gt;Indirect buffers give you multiple views of the same buffer, in particular, multiple narrowings, each of which acts, in many respects, like a separate buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the Commentary for library &lt;a href=&quot;http://www.emacswiki.org/emacs/NarrowIndirect&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;narrow-indirect.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can use indirect buffers for more than you might think.  You&#xA;  can use clones taken from portions of Dired buffers, for example,&#xA;  to give you useful (active) views into a directory listing.  There&#xA;  are only a few keys/commands (such as &lt;code&gt;g&lt;/code&gt; to update the listing)&#xA;  that do not work, because they depend on a view of the whole Dired&#xA;  buffer.  Experiment, and you will no doubt find interesting new&#xA;  uses for indirect buffers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-06T16:10:03.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12197" PostTypeId="1" CreationDate="2015-05-06T17:28:47.677" Score="1" ViewCount="557" Body="&lt;p&gt;I'm trying to define a new major mode using &lt;code&gt;define-generic-mode&lt;/code&gt; and want to try reusing &lt;code&gt;c-indent-line-or-region&lt;/code&gt; for my &lt;code&gt;indent-line-function&lt;/code&gt;. I've inserted &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'indent-line-function) 'c-indent-line-or-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the initialisation part of &lt;code&gt;define-generic-mode&lt;/code&gt; and it is correctly set. However, when I hit enter in a buffer using that mode I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c-indent-line-or-region: Variable binding depth exceeds max-specpdl-size&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've searched around and found suggestions to enable &lt;code&gt;debug-on-error&lt;/code&gt;, which I have done, but the &lt;code&gt;*Backtrace*&lt;/code&gt; buffer is always empty and accompanied by a message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lisp nesting exceeds max-lisp-eval-depth'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How should I go about debugging this?&lt;/p&gt;&#xA;" OwnerUserId="753" LastActivityDate="2015-05-06T17:28:47.677" Title="c-indent-line-or-region: Variable binding depth exceeds max-specpdl-size" Tags="|indentation|debugging|cc-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12198" PostTypeId="2" ParentId="12190" CreationDate="2015-05-06T18:13:01.653" Score="3" Body="&lt;p&gt;You could just use the find tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-!&lt;/kbd&gt; &lt;code&gt;find . -empty -type d -delete&lt;/code&gt; &lt;kbd&gt;return&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it is wrapped in a function that confirms the delete:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-empty-dirs ()&#xA;  (interactive)&#xA;  (let ((dirs (split-string (shell-command-to-string &quot;find -X $(pwd) -empty -type d&quot;) &quot;[ \n]&quot; t)))&#xA;    (when (yes-or-no-p (format &quot;Delete %d empty directories? &quot; (length dirs)))&#xA;      (with-temp-buffer (shell-command &quot;find -X $(pwd) -empty -type d -delete&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-05-06T18:13:01.653" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12199" PostTypeId="2" ParentId="12189" CreationDate="2015-05-06T19:02:47.773" Score="4" Body="&lt;p&gt;The following, based on Glucas' advice seems to work perfectly.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar file-name-mode-alist '())&#xA;;; other stuff here, of course&#xA;(setq savehist-additional-variables '(file-name-mode-alist))&#xA;(savehist-mode +1)&#xA;(setq auto-mode-alist (append auto-mode-alist file-name-mode-alist))&#xA;&#xA;(add-hook 'after-change-major-mode-hook&#xA;  (lambda ()&#xA;    (when (and&#xA;            buffer-file-name&#xA;            (not&#xA;              (file-name-extension&#xA;                buffer-file-name)))&#xA;       (setq file-name-mode-alist&#xA;        (cons&#xA;          (cons buffer-file-name major-mode)&#xA;          file-name-mode-alist))&#xA;      (setq auto-mode-alist&#xA;        (append auto-mode-alist&#xA;          (list (cons buffer-file-name major-mode)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-05-06T19:02:47.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12200" PostTypeId="1" CreationDate="2015-05-06T19:55:30.360" Score="1" ViewCount="111" Body="&lt;p&gt;I'm trying to set-up an &lt;code&gt;org-mode&lt;/code&gt; habit (i.e., &quot;STYLE&quot; property = &quot;habit&quot;) to repeat at a maximum of one month, on the first of the month, and a minimum of one month and five days (the fifth of the month). Is it possible to achieve something like this, something like &lt;code&gt;SCHEDULED: &amp;lt;2015-05-01 Fri +1m/1m5d&amp;gt;&lt;/code&gt;? Emacs doesn't see the &quot;&lt;code&gt;5d&lt;/code&gt;&quot; portion in this script though--it only recognizes the &quot;&lt;code&gt;+1m/1m&lt;/code&gt;&quot; and subsequently throws an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a syntax that enables Emacs to handle this mixed time scale?&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="253" LastEditDate="2015-12-22T00:45:36.323" LastActivityDate="2015-12-22T00:45:36.323" Title="Mixed time scales for org mode repeated habits" Tags="|org-mode|org-habit|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12201" PostTypeId="2" ParentId="12192" CreationDate="2015-05-06T20:07:41.667" Score="1" Body="&lt;p&gt;Wrap it with &lt;code&gt;backup-file-name-p&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-maybe-make-executable ()&#xA;  &quot;Maybe make file executable unless it is a backup file.&quot;&#xA;  (unless (backup-file-name-p buffer-file-name)&#xA;    (executable-make-buffer-file-executable-if-script-p)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The issue pointed out by @Kaushalmodi seems like a deal breaker though, perhaps a better solution is to specify a separate backup file directory. And remove executable privileges from the whole backup directory when backups occur.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-05-06T20:17:13.813" LastActivityDate="2015-05-06T20:17:13.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12202" PostTypeId="1" CreationDate="2015-05-06T22:05:03.223" Score="2" ViewCount="427" Body="&lt;p&gt;I'm using jabber.el and it's working great. I'm trying to find out if there's a way to have jabber download my recent chat history when initiating a chat with someone. It seems like my history is cached for conversations that occur while I'm online, but messages I missed while offline are not downloaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to change this behavior?&lt;/p&gt;&#xA;" OwnerUserId="7015" LastActivityDate="2015-05-06T22:05:03.223" Title="How to get jabber.el to download all message history?" Tags="|jabber|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12203" PostTypeId="1" AcceptedAnswerId="12204" CreationDate="2015-05-06T22:14:25.423" Score="4" ViewCount="1569" Body="&lt;p&gt;I am trying to send email via SMTP in gnus. I can receive email via IMAP just fine, but whenever I try to compose a message send, I get this error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;smtpmail-send-it: Sending failed: 530 5.7.0 Must issue a STARTTLS&#xA;  command first. e5sm37529pdc.94 - gsmtp&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is my smtpmail-send-it configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq message-send-mail-function 'smtpmail-send-it&#xA;      smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; 587 nil nil))&#xA;      smtpmail-auth-credentials '((&quot;smtp.gmail.com&quot; 587 &quot;email@example.com&quot; nil))&#xA;      smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-service 587&#xA;      starttls-use-gnutls t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what I'm doing wrong here. Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7015" LastEditorUserId="11" LastEditDate="2015-08-12T12:34:53.553" LastActivityDate="2015-08-12T12:34:53.553" Title="Sending smtp email via gmail" Tags="|gnus|smtpmail|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12204" PostTypeId="2" ParentId="12203" CreationDate="2015-05-06T22:22:55.503" Score="4" Body="&lt;p&gt;I found a solution! I had to tell it where to find gnutls.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq message-send-mail-function 'smtpmail-send-it&#xA;      smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; 587 nil nil))&#xA;      smtpmail-auth-credentials '((&quot;smtp.gmail.com&quot; 587 &quot;email@example.com&quot; nil))&#xA;      smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-service 587&#xA;      starttls-gnutls-program &quot;/usr/local/bin/gnutls-cli&quot;&#xA;      starttls-extra-arguments nil&#xA;      starttls-use-gnutls t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7015" LastActivityDate="2015-05-06T22:22:55.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12207" PostTypeId="1" CreationDate="2015-05-07T05:30:48.840" Score="4" ViewCount="691" Body="&lt;p&gt;I would like to learn Org Mode well by reading the whole org manual. However there seem to be only HTML version and PDF version which are not very convenient for me to take notes while reading. Is there an &lt;code&gt;.org&lt;/code&gt; version of the manual or some way to produce an easily notable version?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2023-04-11T16:21:52.470" Title=".org Source for Org Manual?" Tags="|org-mode|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12208" PostTypeId="2" ParentId="12207" CreationDate="2015-05-07T06:17:08.600" Score="1" Body="&lt;p&gt;Never mind it seems that the org documentation was written in &lt;code&gt;Texinfo&lt;/code&gt; and the source was available at org distribution itself &lt;a href=&quot;http://orgmode.org/org-8.2.10.tar.gz&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/org-8.2.10.tar.gz&lt;/a&gt; or &lt;a href=&quot;http://orgmode.org/org-8.2.10.zip&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/org-8.2.10.zip&lt;/a&gt; . Maybe tools like &lt;code&gt;pandoc&lt;/code&gt; will do the conversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Actually the &lt;code&gt;info&lt;/code&gt; format of the file was really fine. I could directly browse it nicely in &lt;code&gt;Emacs&lt;/code&gt; and take notes side-by-side. Use &lt;code&gt;M-x org-info&lt;/code&gt; to open the manual directly or find the info file inside of the distribution.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="7097" LastEditDate="2015-05-08T12:54:07.650" LastActivityDate="2015-05-08T12:54:07.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12209" PostTypeId="2" ParentId="12139" CreationDate="2015-05-07T07:15:01.010" Score="1" Body="&lt;p&gt;I would not want to write build automation in a language with &lt;a href=&quot;http://www.lunaryorn.com/2014/08/12/emacs-script-pitfalls.html&quot; rel=&quot;nofollow&quot;&gt;no simple script interface&lt;/a&gt;, no parallelism, primitive networking, no good facilities for external processes—you can't even pipe in Emacs Lisp—and zero integration into basically anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;YMMV, but to me that's basically the &lt;em&gt;antithesis&lt;/em&gt; of what I'd want for build automation which is all about scripting, networking and calling external processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs Lisp is a good language in its own way, and for its specific purpose, but I would not try to bend it for something it wasn't made for and is inherently poor at.  The pain that I'd suffer from this choice on the long run isn't worth the temporary convenience of using this language—not that I'm a particular fan of Emacs Lisp anyway, but I think you get my point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd use Python and Fabric, or Ruby and Rake, for the simple reason that these languages are frequently used for this purpose, so almost any problem that you can possibly find has already been solved before by someone else, which in turn means that you can spend less time on the boring task of build automation and spend more time on the real problem—unless build automation is your real problem, that is, but I don't hope so for your sake :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TL;DR: No, and it never will.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-05-07T07:15:01.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12210" PostTypeId="1" AcceptedAnswerId="12551" CreationDate="2015-05-07T09:22:23.770" Score="4" ViewCount="680" Body="&lt;p&gt;Using my prelude-based emacs install full-screen on my laptop, I normally have 2 vertical windows side-by-side. If I invoke helm-mini, it normally takes up half of one vertical window, so about a quarter of my laptop screen. However when it's showing the full path of recent files, these trail off the right edge of the helm window, hiding the useful file name:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/T9gAu.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I know I can hit &lt;code&gt;C-t&lt;/code&gt; a few times to move the helm window around, and hopefully get a winder window that can hopefully show the file name, but that's cumbersome.&lt;/p&gt;&#xA;&lt;p&gt;Is there a setting or feature that will help here? Maybe truncating the left side of the line, not the right? Or wrapping the line around? Or something else?&lt;/p&gt;&#xA;" OwnerUserId="110" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2019-04-09T09:40:23.803" Title="Helm entries run off right edge" Tags="|helm|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12211" PostTypeId="2" ParentId="12167" CreationDate="2015-05-07T09:43:11.463" Score="5" Body="&lt;p&gt;Here's the Elisp code for setting &lt;code&gt;markdown-command&lt;/code&gt; in your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq markdown-command &#xA;      &quot;pandoc -f markdown -t html -s --mathjax --highlight-style=pygments&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should check whether &lt;code&gt;markdown-command&lt;/code&gt; is a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer_002dLocal-Variables.html&quot; rel=&quot;nofollow&quot;&gt;buffer-local variable&lt;/a&gt;. Do &lt;kbd&gt;C-h v&lt;/kbd&gt; &lt;code&gt;markdown-command&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; and look for a line that says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Automatically becomes buffer-local when set.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;markdown-command&lt;/code&gt; is in fact buffer-local, you'll need to replace &lt;code&gt;setq&lt;/code&gt; with &lt;code&gt;setq-default&lt;/code&gt; in the code above.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To set up a custom key binding for the command that is bound to &lt;code&gt;C-c C-c p&lt;/code&gt;, add the following code to your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key markdown-mode-map (kbd &quot;C-c C-p&quot;) #'command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't know what &lt;code&gt;C-c C-c p&lt;/code&gt; is bound to, do &lt;kbd&gt;C-h k&lt;/kbd&gt; &lt;kbd&gt;C-c C-c p&lt;/kbd&gt; from a &lt;code&gt;markdown-mode&lt;/code&gt; buffer to find out.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-05-10T09:37:25.900" LastActivityDate="2015-05-10T09:37:25.900" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12212" PostTypeId="1" AcceptedAnswerId="12213" CreationDate="2015-05-07T10:01:44.787" Score="28" ViewCount="6931" Body="&lt;p&gt;&lt;sub&gt;&lt;em&gt;(I understand the security implications of the following, and I'm fine with them.)&lt;/em&gt;&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a single encrypted file in my org directory, &lt;code&gt;diary.org.gpg&lt;/code&gt;.&#xA;I never did any special configuration for it to work, still&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Whenever I visit the file, I'm prompted for the encryption password. Which is great.&lt;/li&gt;&#xA;&lt;li&gt;Whenever I save the buffer, I'm prompted for the password again twice. &lt;em&gt;Which is my problem&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that I haven't configured anything for this to work, so any answers regarding agents or keyrings will have to come with configuration instructions.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought of keeping the password written somewhere inside the file (at the header or end-of-file comments). Then, whenever I save, Emacs could read the password in the buffer and use that instead of prompting me. But when I started looking into this, I got completely lost somewhere inside &lt;code&gt;epa.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I send a password directly from Emacs to the encryption system/process when saving the buffer, instead of being prompted for it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the rest (finding the password in the buffer) I can figure out myself. I just got lost when trying to understand how Emacs interfaced with gpg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that I'm on Ubuntu, Arch Linux, and Windows. Which is why my first idea was an emacs-centric solution.&lt;br&gt;&#xA;I can live with a solution that doesn't work on Windows, as long as I can still access the file on it in the manual way.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="330" LastEditDate="2015-05-08T00:26:26.697" LastActivityDate="2021-05-15T18:33:44.467" Title="How to type the password of a .gpg file only when opening it" Tags="|encryption|epa|gpg|" AnswerCount="3" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="12213" PostTypeId="2" ParentId="12212" CreationDate="2015-05-07T10:51:26.240" Score="19" Body="&lt;h2&gt;Encryption using password + key&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This does not save the password directly in the file but does something similar without any security risk and helps you achieve what you want. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You need to use asymmetric encryption so that your password is associated with an email ID in a &lt;em&gt;keyring&lt;/em&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Save the below at the top of your .gpg file &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;-*- epa-file-encrypt-to: (&quot;your@email.address&quot;) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The password is prompted the very first time the file is saved/created. But after that the password is prompted only once each time you open the saved file  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;The only catch is that you must not lose the keyring file which is saved in &lt;code&gt;~/.gnupg/&lt;/code&gt; by default.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;GPG Setup&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Emacs Setup&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;No setup is needed to be done for this in emacs.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;System Setup&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;But you do need to have your system environment ready with few libraries for the GPG feature to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the time of setting this up, I had to install the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;gpgme-1.5.3      &lt;/li&gt;&#xA;&lt;li&gt;libgpg-error-1.17&lt;/li&gt;&#xA;&lt;li&gt;libksba-1.3.2    &lt;/li&gt;&#xA;&lt;li&gt;libassuan-2.2.0  &lt;/li&gt;&#xA;&lt;li&gt;libgcrypt-1.6.2  &lt;/li&gt;&#xA;&lt;li&gt;gnupg-2.0.26     &lt;/li&gt;&#xA;&lt;li&gt;pinentry-0.9.0   &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I needed one or two of the above libraries and I ended up installing the others because they were either mandatory or optional dependencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once everything is installed, do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; gpg --gen-key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And generate a &lt;em&gt;never-expiring&lt;/em&gt; key for yourself and associate it with your real name and email. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The generated key will be saved in your &lt;code&gt;~/.gnupg/&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Changing the keyring location&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change the location of keyring by either changing &lt;code&gt;$GNUPGHOME&lt;/code&gt;, using &lt;code&gt;--homedir&lt;/code&gt; or &lt;code&gt;--keyring&lt;/code&gt; options for &lt;code&gt;gpg&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;man gpg&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;--keyring file&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Add file to the current list of keyrings.  If file begins with a tilde  and&#xA;    a  slash,  these  are replaced by the $HOME directory. If the filename does&#xA;    not contain a slash, it is assumed  to  be  in  the  GnuPG  home  directory&#xA;    (&quot;~/.gnupg&quot; if --homedir or $GNUPGHOME is not used).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note that this adds a keyring to the current list.  If the intent is to use&#xA;    the specified keyring alone, use --keyring along with --no-default-keyring.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h3&gt;Using GPG with emacs&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In emacs, you simply create a file with a &lt;code&gt;.gpg&lt;/code&gt; extension. For example, if the file was originally &lt;code&gt;auth.el&lt;/code&gt;, you would rename it to &lt;code&gt;auth.el.gpg&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Place this line at the top of the file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; -*- epa-file-encrypt-to: (&quot;your@email.address&quot;) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that I have used the elisp comment chars &lt;code&gt;;;&lt;/code&gt; as the example file here is &lt;code&gt;auth.el.gpg&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the exact email address you used at the time of key generation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you try to save it, emacs will show this prompt in a buffer:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Select recipients for encryption.&#xA;If no one is selected, symmetric encryption will be performed.  &#xA;- `m' to mark a key on the line&#xA;- `u' to unmark a key on the line&#xA;[Cancel][OK]&#xA;&#xA;  u &amp;lt;GPG KEY&amp;gt; &amp;lt;YOUR NAME&amp;gt; (&amp;lt;YOUR GPG KEY NAME&amp;gt;) &amp;lt;&amp;lt;YOUR GPG KEY EMAIL&amp;gt;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Navigate the point to the line containing the key, hit &lt;code&gt;m&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Navigate the point to the &lt;code&gt;[OK]&lt;/code&gt; button and hit &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can now save the file and kill that file buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next time when you open that .gpg file, you will be prompted for the password only once and then consecutive saves will be password-prompt-free.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;More info&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://nakkaya.com/2009/11/19/keeping-secrets-with-emacs-and-gpg/&quot;&gt;Here&lt;/a&gt; is one of the blog posts that talks about the emacs and GPG setup which you can refer as well.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacswiki.org/emacs/EasyPG&quot;&gt;EasyPG - emacswiki.org&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-11T13:37:42.783" LastActivityDate="2015-05-11T13:37:42.783" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12214" PostTypeId="2" ParentId="12207" CreationDate="2015-05-07T11:19:40.520" Score="2" Body="&lt;p&gt;There is an out-of-date (~2 years old) version of the manual hosted on github &lt;a href=&quot;https://github.com/tsdye/orgmanual&quot; rel=&quot;nofollow&quot;&gt;Org Manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Org format is capable of supporting the majority of the Info format and can certainly cross-link well enough to handle the requirements (The issue it has with info is formatting the correct types of &lt;code&gt;@?ref&lt;/code&gt; since it does not distinguish between types of links).  It does not however support appendices (natively, they can be added in using org macros).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initially there was no exporter for &lt;code&gt;texinfo&lt;/code&gt;, I built &lt;code&gt;ox-texinfo&lt;/code&gt; following the creation of the new &lt;code&gt;ox-&lt;/code&gt; export framework.  &lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-05-07T11:19:40.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12216" PostTypeId="1" AcceptedAnswerId="12514" CreationDate="2015-05-07T11:59:44.510" Score="4" ViewCount="1086" Body="&lt;p&gt;I am trying to copy a file from a remote folder to a directory on my machine. I use Dired, and this the setup related to Dired in my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package dired&#xA;  :bind ((&quot;C-c z&quot; . dired-get-size)&#xA;         (&quot;C-c C&quot; . copy-file-name-to-clipboard))&#xA;  :config (progn&#xA;            (setq dired-auto-revert-buffer t ; Revert buffers on revisiting&#xA;                  dired-listing-switches &quot;-lFaGh1v --group-directories-first&quot;&#xA;                  global-auto-revert-non-file-buffers t ; Auto refresh dired&#xA;                  auto-revert-verbose nil ; But be quiet about it&#xA;                  dired-dwim-target t ; Use other pane as target when copying&#xA;                  dired-recursive-copies 'always ; Copy dirs recursively&#xA;                  dired-ls-F-marks-symlinks t ; -F marks links with @&#xA;                  dired-guess-shell-alist-user ; Use LibreOffice when needed&#xA;                  '((&quot;\\.ods\\'\\|\\.xls?\\'\\|\\.xlsx?\\'&quot; &quot;libreoffice&quot;)&#xA;                    (&quot;\\.odt\\'\\|\\.doc?\\'\\|\\.docx?\\'&quot; &quot;libreoffice&quot;)))&#xA;&#xA;            ;; Make find-name-dired faster&#xA;            (use-package find-dired&#xA;              :config (setq find-ls-option&#xA;                            '(&quot;-print0 | xargs -0 ls -ld&quot; . &quot;-ld&quot;)))&#xA;&#xA;            ;; Better M-&amp;lt; and M-&amp;gt;&#xA;            (defun dired-back-to-top ()&#xA;              (interactive)&#xA;              (beginning-of-buffer)&#xA;              (dired-next-line 2))&#xA;&#xA;            (define-key dired-mode-map&#xA;              (vector 'remap 'beginning-of-buffer) 'dired-back-to-top)&#xA;&#xA;            (defun dired-jump-to-bottom ()&#xA;              (interactive)&#xA;              (end-of-buffer)&#xA;              (dired-next-line -1))&#xA;&#xA;            (define-key dired-mode-map&#xA;              (vector 'remap 'end-of-buffer) 'dired-jump-to-bottom)&#xA;&#xA;            ;; Open directory with sudo in dired&#xA;            (define-key dired-mode-map &quot;!&quot; 'sudired)&#xA;&#xA;            (defun sudired ()&#xA;              &quot;Open directory with sudo in dired.&quot;&#xA;              (interactive)&#xA;              (use-package tramp)&#xA;              (let ((dir (expand-file-name default-directory)))&#xA;                (if (string-match &quot;^/sudo:&quot; dir)&#xA;                    (user-error &quot;Already in sudo&quot;)&#xA;                  (dired (concat &quot;/sudo::&quot; dir)))))&#xA;&#xA;            ;; Get files size in dired&#xA;            (defun dired-get-size ()&#xA;              &quot;Quick and easy way to get file size in dired.&quot;&#xA;              (interactive)&#xA;              (let ((files (dired-get-marked-files)))&#xA;                (with-temp-buffer&#xA;                  (apply 'call-process &quot;/usr/bin/du&quot; nil t nil &quot;-sch&quot; files)&#xA;                  (message&#xA;                   &quot;Size of all marked files: %s&quot;&#xA;                   (progn&#xA;                     (re-search-backward &quot;\\(^[0-9.,]+[A-Za-z]+\\).*total$&quot;)&#xA;                     (match-string 1))))))))&#xA;&#xA;(use-package dired-x ; Enable some nice dired features&#xA;  :config (progn&#xA;            ;; Omit hidden files by default (C-x M-o to show them)&#xA;            (setq-default dired-omit-files-p t)&#xA;            (setq dired-omit-files (concat dired-omit-files &quot;\\|^\\..+$&quot;)&#xA;                  dired-omit-verbose nil)))&#xA;&#xA;;; Note: to override dired+ faces, customize `font-lock-maximum-decoration'&#xA;;; adding an entry for `dired-mode' and setting decoration to default&#xA;(use-package dired+ ; Extend dired&#xA;  :ensure t&#xA;  :defer 5&#xA;  :config (progn&#xA;            ;; Reuse buffer for directories&#xA;            (diredp-toggle-find-file-reuse-dir 1)&#xA;            (setq diredp-hide-details-initially-flag nil&#xA;                  diredp-hide-details-propagate-flag nil)))&#xA;&#xA;(use-package bookmark+ ; Better bookmarks&#xA;  :ensure t&#xA;  :defer 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Every time I try to copy from remote to local I get this error: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;file-error Setting current directory No such file or directory&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is happening only when I'm copying a file in some nested directory on the remote machine. For instance, if I try to copy &lt;code&gt;/home/admin/bin/foo&lt;/code&gt; to my local directory, it works. But if I try to copy &lt;code&gt;/home/admin/bin/foo/bar&lt;/code&gt; I get the above mentioned error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some extra info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;with &lt;code&gt;emacs -Q&lt;/code&gt; copying files from remote to local works;&lt;/li&gt;&#xA;&lt;li&gt;with &lt;code&gt;emacs -q&lt;/code&gt; I get the same error;&lt;/li&gt;&#xA;&lt;li&gt;copying from local to remote works every time;&lt;/li&gt;&#xA;&lt;li&gt;I am using Emacs &lt;code&gt;25.0.50.1&lt;/code&gt; (build: &lt;code&gt;ad39858&lt;/code&gt;) on Debian unstable;&lt;/li&gt;&#xA;&lt;li&gt;I listed (through &lt;code&gt;C-h m&lt;/code&gt;) the active minor modes both with my init.el and with &lt;code&gt;emacs -Q&lt;/code&gt; right before starting to copy the remote file: they are the same.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After some debugging, I nailed down the issue to this line of &lt;code&gt;dired-copy-file-recursive&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(copy-file from to ok-flag preserve-time)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="675" LastEditDate="2015-05-19T16:35:58.470" LastActivityDate="2015-06-01T16:13:58.307" Title="Remote copy through Dired fails" Tags="|dired|tramp|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="12217" PostTypeId="2" ParentId="12173" CreationDate="2015-05-07T12:40:42.667" Score="5" Body="&lt;p&gt;Major modes and minor modes are allowed to locally change the &lt;code&gt;indent-tabs-mode&lt;/code&gt; variable, and a lot of them do. That's why &lt;code&gt;(setq-default indent-tabs-mode nil)&lt;/code&gt; might not always be enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I use.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun endless/c-hook ()&#xA;  (setq indent-tabs-mode nil))&#xA;(add-hook 'c++-mode-hook #'endless/c-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-05-07T12:40:42.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12218" PostTypeId="1" CreationDate="2015-05-07T12:48:39.130" Score="33" ViewCount="4075" Body="&lt;p&gt;Suppose that I have already selected some text in the current buffer.&#xA;Is it possible to select another stretch of text, while keeping the previous selection (and so on)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added&lt;/strong&gt;: One motivation for this functionality is as follows:&#xA;Assume that I have some text that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;paragraph 1 ...&#xA;&#xA;paragraph 2 ...&#xA;&#xA;paragraph 3 ...&#xA;&#xA;paragraph 4 ...&#xA;&#xA;paragraph 5 ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to remove some paragraphs (e.g. 2, 4 and 6) and insert them before paragraph 1.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="504" LastEditDate="2015-10-30T21:02:31.253" LastActivityDate="2018-12-01T21:53:44.823" Title="How to select non-contiguous regions in Emacs?" Tags="|region|" AnswerCount="8" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="12219" PostTypeId="1" AcceptedAnswerId="12220" CreationDate="2015-05-07T13:27:56.940" Score="9" ViewCount="2679" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I print a message in the echo area without surrounding quotes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a simple command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-fn ()&#xA;  (interactive)&#xA;  (message &quot;Test message&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call it as an interactive command via &lt;code&gt;M-x test-fn&lt;/code&gt;, it prints &lt;code&gt;Test message&lt;/code&gt; in the echo areas &lt;em&gt;without&lt;/em&gt; surrounding quotation marks.  However, when I evaluate it in elisp as &lt;code&gt;(test-fn)&lt;/code&gt;, it prints &lt;code&gt;&quot;Test message&quot;&lt;/code&gt; in the echo area &lt;em&gt;with&lt;/em&gt; surrounding quotation marks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, why is there a difference between these two use cases?  Second, and more to the point, how can I call the function non-interactively and have the message print to the echo area without the surrounding quotes?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="105" LastEditDate="2019-04-12T14:19:19.907" LastActivityDate="2023-08-21T21:35:44.463" Title="Print message in echo area with no &quot;quotes&quot;?" Tags="|formatting|echo-area|message|print|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12220" PostTypeId="2" ParentId="12219" CreationDate="2015-05-07T13:34:53.177" Score="6" Body="&lt;p&gt;What you see printed in the echo area when evaluating the command is its &lt;em&gt;return value&lt;/em&gt; - a string. The print syntax for strings includes quotation marks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you call the command non-interactively from another function/command, you shouldn't see the quotation marks:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun test-test-fn ()&#xA;  (interactive)&#xA;  (test-fn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then call &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;test-test-fn&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to test.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-05-07T13:34:53.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12221" PostTypeId="2" ParentId="12218" CreationDate="2015-05-07T13:39:33.253" Score="11" Body="&lt;p&gt;You can use registers combined with the mark ring.  Push the current marks with &lt;code&gt;C-&amp;lt;SPC&amp;gt; C-&amp;lt;SPC&amp;gt;&lt;/code&gt;, recover them later with &lt;code&gt;C-u C-&amp;lt;SPC&amp;gt;&lt;/code&gt;, or save them in a register, say &lt;code&gt;b&lt;/code&gt;, via &lt;code&gt;C-x r &amp;lt;SPC&amp;gt; b&lt;/code&gt;, and jump back later with &lt;code&gt;C-x r j b&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now mark another region.  &lt;code&gt;C-u C-x r s a&lt;/code&gt; will copy the marked region to register &lt;code&gt;a&lt;/code&gt; and delete the text.   Then mark the next region and &lt;code&gt;C-u C-x r + a&lt;/code&gt; will append another selection to that register &lt;code&gt;a&lt;/code&gt; and delete it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then insert the contents with &lt;code&gt;C-x r i a&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &quot;Saving Text in Registers&quot; section of the Emacs manual.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-05-07T13:44:57.863" LastActivityDate="2015-05-07T13:44:57.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12222" PostTypeId="2" ParentId="12218" CreationDate="2015-05-07T13:47:59.827" Score="45" Body="&lt;p&gt;You can use &lt;code&gt;append-next-kill&lt;/code&gt; (bound to &lt;code&gt;C-M-w&lt;/code&gt; by default) to accumulate the text you want to insert above &lt;code&gt;paragraph 1&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Kill &lt;code&gt;paragraph 2&lt;/code&gt; as you normally would.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Mark &lt;code&gt;paragraph 4&lt;/code&gt; and press &lt;code&gt;C-M-w&lt;/code&gt; before killing it. Repeat this step for all paragraphs you'd like to move before &lt;code&gt;paragraph 1&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When you're done, you can yank the accumulated text before &lt;code&gt;paragraph 1&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="504" LastActivityDate="2015-05-07T13:47:59.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12223" PostTypeId="2" ParentId="12219" CreationDate="2015-05-07T13:56:01.920" Score="5" Body="&lt;p&gt;When you evaluate a function with &lt;code&gt;M-:&lt;/code&gt;, the function gets run, and then its return value is displayed in the echo area.  The return value of &lt;code&gt;test-fn&lt;/code&gt; is the value returned by &lt;code&gt;message&lt;/code&gt;, which is the string that was printed.  Thus, though &lt;code&gt;message&lt;/code&gt; did actually display the message, it was overwritten by &lt;code&gt;M-:&lt;/code&gt; displaying the return value.  (You can confirm that both messages appeared by looking in the &lt;code&gt;*Messages*&lt;/code&gt; buffer.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to evaluate the function without displaying its return value in the echo area is to type &lt;code&gt;(test-fn)&lt;/code&gt; into the scratch buffer and hit &lt;code&gt;C-j&lt;/code&gt;. The return value will be inserted into the scratch buffer instead, and the original message will be left in the echo area.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-05-07T13:56:01.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12224" PostTypeId="2" ParentId="10738" CreationDate="2015-05-07T14:08:29.587" Score="1" Body="&lt;p&gt;As suggested in the comments, this was an issue with my LD_LIBRARY_PATH, which contained a relative path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs GDB launches with the working directory equal to that of the buffer you are in when you call the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means that in order to load a library from &lt;code&gt;./&lt;/code&gt; I had to make sure that I was in that directory when launching the debugger. The shared library was then loaded correctly.&lt;/p&gt;&#xA;" OwnerUserId="7078" LastActivityDate="2015-05-07T14:08:29.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12225" PostTypeId="1" CreationDate="2015-05-07T14:27:13.147" Score="1" ViewCount="114" Body="&lt;p&gt;In &lt;code&gt;emacs.el&lt;/code&gt; I am using the following construct to set up an &lt;code&gt;org-remember&lt;/code&gt; template:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-remember-templates&#xA;    '((&quot;Todo&quot; ?t &quot;* TODO %^{Brief Description} %^g\n%?\nAdded: %U&quot; &quot;~/GTD/newgtd.org&quot; &quot;Tasks&quot;)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That works OK, but now I'd like to introduce parameters into this template definition. Specifically, I'd like to use a variable (or a constant) in place of &lt;code&gt;&quot;~/GTD/newgtd.org&quot;&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I have this definition earlier in the &lt;code&gt;emacs.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq todo-file (concat org-directory &quot;todo.org&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use thid variable &lt;code&gt;todo-file&lt;/code&gt; in the &lt;code&gt;setq org-remember-templates&lt;/code&gt; definition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried &lt;code&gt;'todo-file&lt;/code&gt;, &lt;code&gt;&quot;todo-file&lt;/code&gt; and simply &lt;code&gt;todo-file&lt;/code&gt; in place of &lt;code&gt;&quot;~/GTD/newgtd.org&quot;&lt;/code&gt; with no luck. What is the secret to reference a variable value here?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2015-05-07T14:49:19.987" Title="Use a variable's value in setq" Tags="|org-mode|init-file|variables|syntax|" AnswerCount="1" CommentCount="1" ClosedDate="2015-05-07T16:51:08.327" ContentLicense="CC BY-SA 3.0" />
  <row Id="12226" PostTypeId="2" ParentId="12218" CreationDate="2015-05-07T14:48:40.110" Score="4" Body="&lt;p&gt;Install browse-kill-ring.el &lt;/p&gt;&#xA;&#xA;&lt;p&gt;copy-and-kill all regions of interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Got to point where re-insert should start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;browse-kill-ring&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; will open a buffer and place cursor in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;kbd&gt;n&lt;/kbd&gt; to travel chunks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;RET&lt;/kbd&gt; there will insert the chunk at point in original/other buffer.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-05-07T14:48:40.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12227" PostTypeId="2" ParentId="12225" CreationDate="2015-05-07T14:49:19.987" Score="2" Body="&lt;p&gt;Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq org-remember-templates&#xA;      `((&quot;Todo&quot;&#xA;         ?t&#xA;         &quot;* TODO %^{Brief Description} %^g\n%?\nAdded: %U&quot;&#xA;         ,todo-file &quot;Tasks&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's called backquote.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-07T14:49:19.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12228" PostTypeId="1" AcceptedAnswerId="12229" CreationDate="2015-05-07T15:07:44.833" Score="0" ViewCount="77" Body="&lt;p&gt;I would like to ediff files (or buffers) A and B, and also A and C.  The need arises from the fact that A and B were both forked from C, and I need to merge B into A while checking I'm not destroying any ideas in A\C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not an experienced diff-er, but I thought I would do this by viewing ediff A,C while merging bits of B in to A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that when I start the second ediff involving A, it takes over my emacs instance and I can't seem to see the other ediff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first thought is to just run two different instances of emacs, but how would you do this?&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2020-03-04T06:15:35.167" Title="How do I run two simultaneous ediffs involving the same file? i.e., ediffs A, B and A, C" Tags="|ediff|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12229" PostTypeId="2" ParentId="12228" CreationDate="2015-05-07T15:26:53.163" Score="0" Body="&lt;p&gt;No problem. Just use &lt;code&gt;ediff-buffers&lt;/code&gt; on A and B. And then use &lt;code&gt;ediff-buffers&lt;/code&gt; on A and C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have two different control panels, one for A vs B and one for A vs C. Just put your input focus in one or the other of the two panels (windows) to navigate among the differences it controls.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-07T15:26:53.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12230" PostTypeId="2" ParentId="12218" CreationDate="2015-05-07T15:43:18.223" Score="5" Body="&lt;p&gt;This responds to your general question, but not particularly to the use case you mention (moving bits of code around).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs now has what it calls a &lt;em&gt;noncontiguous region&lt;/em&gt;, which is the kind of selection that you are asking about. Vanilla Emacs does not provide any special way to create a noncontiguous region, except if it is a &lt;em&gt;rectangle&lt;/em&gt;. But library &lt;a href=&quot;http://www.emacswiki.org/emacs/Zones&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zones&lt;/a&gt; does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Library Zones lets you define multiple &lt;em&gt;zones&lt;/em&gt; in your buffer.  A &lt;em&gt;list of zones is a noncontiguous region&lt;/em&gt;.  You can also think of it as &lt;em&gt;multiple&lt;/em&gt; regions, depending on how you want to make use of it.  You can have multiple zone lists defined at any time, each assigned to a different zones variable, and you can switch among them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you also use library &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bookmark+&lt;/a&gt; then you can save lists of zones persistently and restore them in later Emacs sessions. Bookmark+ also lets you assign arbitrary tags to a bookmark. This means that you can tag a list of zones. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The zones in a given zone list are typically in the same buffer, but they need not be.  In this, a zone list is more general than a noncontiguous region.  It is also more general in that each zone can contain additional information, besides just the zone limits, and it can have an identifier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several ways to create a zone.  One of the easiest is to use &lt;strong&gt;&lt;code&gt;C-x n a&lt;/code&gt;&lt;/strong&gt;: it defines a zone from the active region, and adds it to the current zone set.  (&lt;code&gt;C-x n n&lt;/code&gt; (&lt;code&gt;narrow-to-region&lt;/code&gt;) also does this, in addition to narrowing.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are some of the things you can do with a set (list) of zones:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sort them.&lt;/li&gt;&#xA;&lt;li&gt;Unite (coalesce) adjacent or overlapping zones (which includes sorting them).&lt;/li&gt;&#xA;&lt;li&gt;Intersect them.&lt;/li&gt;&#xA;&lt;li&gt;Narrow the buffer to a zone in the list. Cycle among narrowings.  See &lt;a href=&quot;https://www.emacswiki.org/emacs/MultipleNarrowings&quot; rel=&quot;nofollow noreferrer&quot;&gt;Multiple Narrowings&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Select a zone in the list as the active region.  Cycle among regions.&lt;/li&gt;&#xA;&lt;li&gt;Search them (they are automatically united first).  For this&#xA;you need library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/isearch+.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;Isearch+&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Query-replace over them.&lt;/li&gt;&#xA;&lt;li&gt;Highlight and unhighlight them.  (For this you need library &lt;a href=&quot;https://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow noreferrer&quot;&gt;Highlight&lt;/a&gt; or library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/facemenu%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;facemenu+.el&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://www.emacswiki.org/emacs/NarrowIndirect&quot; rel=&quot;nofollow noreferrer&quot;&gt;Narrow Indirect&lt;/a&gt;, which lets you create &lt;em&gt;indirect buffers&lt;/em&gt; that are clones of a given buffer and that are narrowed to different portions of it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-12-01T21:53:44.823" LastActivityDate="2018-12-01T21:53:44.823" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="12231" PostTypeId="2" ParentId="12212" CreationDate="2015-05-07T16:11:21.027" Score="16" Body="&lt;p&gt;Turns out all I had to do was &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq epa-file-cache-passphrase-for-symmetric-encryption t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This solution works on both Linux and Windows, and is a courtesy of&#xA;Ted and Michael over at help-gnu-emacs.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-05-07T18:09:12.223" LastActivityDate="2015-05-07T18:09:12.223" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12232" PostTypeId="1" AcceptedAnswerId="12237" CreationDate="2015-05-07T17:11:13.763" Score="4" ViewCount="365" Body="&lt;p&gt;In some projects I'm working with, there are coding rules that don't allow C++ operators such as &lt;code&gt;==&lt;/code&gt; (for fear of being confused with &lt;code&gt;=&lt;/code&gt; I suppose, but oh well...). Instead, special macros such as &lt;code&gt;_EQ_&lt;/code&gt; have to be inserted, which &lt;code&gt;#define&lt;/code&gt; to &lt;code&gt;==&lt;/code&gt;. There are other &lt;code&gt;#defines&lt;/code&gt; as well, such as &lt;code&gt;_SH_LEFT_&lt;/code&gt;, &lt;code&gt;_BITAND_&lt;/code&gt; and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Needless to say, this is all quite tedious to write and I would love to have a meachanism that makes me type &lt;code&gt;==&lt;/code&gt; as I'm used to and have it automatically replaced by &lt;code&gt;_EQ_&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;abbrev-mode&lt;/code&gt;, but as &lt;a href=&quot;https://unix.stackexchange.com/a/71103&quot;&gt;this answer&lt;/a&gt; explains, abbrevs can only be defined for words, and I don't really want to change the definition all the required syntax entries. Also, it would be nice if I don't have to type a space after the keyword, but have the macro appear as soon as I hit the last char of the &quot;forbidden&quot; sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to achieve this, maybe a &quot;more aggressive&quot; abbrev-mode or some package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Here are some replacements that need to be performed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I type:            I want:        &#xA;=                  =              (works with key-combo)&#xA;==                 _EQ_           (works with key-combo)&#xA;&amp;amp;                  _BITAND_       (works with key-combo)&#xA;&amp;amp;&amp;amp;                 _AND_          (works with key-combo)&#xA;|                  _BITOR_        (works with key-combo)&#xA;||                 _OR_           (works with key-combo)&#xA;!                  _NOT_          (works with key-combo)&#xA;!=                 _NOT_EQ_       (doesn't work with key-combo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7004" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2017-09-02T14:15:52.097" Title="Automatically replace C++ operators" Tags="|text-editing|replace|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12233" PostTypeId="2" ParentId="12232" CreationDate="2015-05-07T17:39:05.150" Score="3" Body="&lt;p&gt;There is &lt;a href=&quot;https://github.com/uk-ar/key-combo&quot; rel=&quot;nofollow&quot;&gt;key-combo&lt;/a&gt; which allows for the desired behavior&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(key-combo-define c++-mode-map  &quot;=&quot;  '(&quot;= &quot; &quot;_EQ_ &quot; &quot;==&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As I understand it, this is not straightforward with key-combo. What I would do is just:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(key-combo-define c++-mode-map &quot;!&quot;  '(&quot;! &quot; &quot;_NOT_EQ_ &quot;=! &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After all, it's easier to press &quot;!!&quot; than &quot;!=&quot; and shouldn't conflict with C++ syntax as far as I know. &#xA;You can also put a function in the list supplied as third arg to &lt;code&gt;key-combo-define&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you could do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-noteq-or-eq ()&#xA;  (if (eq (preceding-char) ?\!)&#xA;      (progn &#xA;        (backward-delete-char 1)&#xA;        (insert &quot;_NOT_EQ_ &quot;))&#xA;    (insert &quot;=&quot;)))&#xA;&#xA;(key-combo-define c++-mode-map &quot;=&quot;  '(insert-noteq-or-eq &quot;_EQ_ &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This leads to the undesired behavior of the &quot;!&quot; reappearing when pressing &quot;=&quot; after &quot;_NOT_EQ_ &quot; has been inserted, but you get the idea.  &lt;/p&gt;&#xA;" OwnerUserId="7148" LastEditorUserId="160" LastEditDate="2015-05-22T22:15:30.630" LastActivityDate="2015-05-22T22:15:30.630" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12234" PostTypeId="1" AcceptedAnswerId="15244" CreationDate="2015-05-07T17:49:22.567" Score="4" ViewCount="515" Body="&lt;p&gt;When I run the command &lt;code&gt;forward-sexp&lt;/code&gt; at the beginning of the line in Python mode, my cursor jumps to the end of the line.  I assume that the line is a statement, and is therefore considered to be a sexp.  Can I modify this behavior so that forward-sexp only jumps to the end of the symbol?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Steps to Reproduce:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Paste the following lines into a buffer in Python mode&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def dummy():&#xA;    my_count_variable = 0&#xA;    (a, b, c) = (1, 2, 3)&#xA;    return my_count_variable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Case 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Move the cursor to the &lt;code&gt;m&lt;/code&gt; at the beginning of &lt;code&gt;my_count_variable&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;forward-sexp&lt;/code&gt; (&lt;code&gt;C-M-f&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Notice that the cursor has jumped to the end of the line&lt;/li&gt;&#xA;&lt;li&gt;(I would prefer to jump to the end of the symbol here)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Case 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Place the cursor at the beginning of the second line, just under the &lt;code&gt;d&lt;/code&gt; in &lt;code&gt;def&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;forward-sexp&lt;/code&gt; (&lt;code&gt;C-M-f&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Notice that the cursor has moved to the end of &lt;code&gt;my_count_variable&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;(This seems inconsistent with Case 1)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Case 3:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Place the cursor at the first &lt;code&gt;(&lt;/code&gt; on the third line&lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;forward-sexp&lt;/code&gt; (&lt;code&gt;C-M-f&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Notice that the cursor jumps to the end of the first tuple instead of the end of the statement.&lt;/li&gt;&#xA;&lt;li&gt;(Again, why not jump to the end of the expression?)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to modify the behavior of &lt;code&gt;forward-sexp&lt;/code&gt; so that it does not treat a python &quot;statement&quot; as a balanced expression?&lt;/strong&gt;  There seems to be some inconsistency which causes the command to work how I want, but only sometimes (i.e. cases 2 and 3). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I am using the built-in python-mode from python.el&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2015-05-11T23:48:20.603" LastActivityDate="2015-09-01T20:04:21.003" Title="forward-sexp goes to eol in python mode (but only sometimes)" Tags="|python|navigation|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12235" PostTypeId="1" AcceptedAnswerId="12242" CreationDate="2015-05-07T19:12:56.627" Score="5" ViewCount="530" Body="&lt;p&gt;Right now, I have the following in my init&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-edit-file-as-root ()&#xA;  &quot;Find file as root&quot;&#xA;  (interactive)&#xA;  (find-alternate-file (concat &quot;/su:root@localhost:&quot; buffer-file-name)))&#xA;&#xA;(defun my-edit-file-as-root-maybe ()&#xA;  &quot;Find file as root if necessary.&quot;&#xA;  (unless (and buffer-file-name (file-writable-p buffer-file-name))&#xA;    (when (y-or-n-p &quot;File is not writable. Open with root? &quot;)&#xA;      (my-edit-file-as-root))))&#xA;&#xA;(add-hook 'find-file-hook #'my-edit-file-as-root-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(a distant child of &lt;a href=&quot;http://emacsredux.com/blog/2013/04/21/edit-files-as-root/&quot; rel=&quot;nofollow&quot;&gt;this code&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this obviously doesn't work if I'm already using TRAMP (because it blindly concatenates the &lt;code&gt;/su...&lt;/code&gt; at the beginning).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know TRAMP internals well enough to determine how to flexibly parse TRAMP filenames and determine what to add to get root access.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I modify this to work when already using TRAMP (possibly with multi-hops already in use)?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-05-07T19:37:18.813" LastActivityDate="2015-05-08T03:26:17.097" Title="Edit file as root over when already using TRAMP" Tags="|tramp|root|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12236" PostTypeId="2" ParentId="12235" CreationDate="2015-05-07T19:17:39.367" Score="0" Body="&lt;p&gt;Tramp can jump over multiple hops separated by pipe, here's the relevant documentation: &lt;a href=&quot;http://www.gnu.org/software/tramp/#Ad_002dhoc-multi_002dhops&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/tramp/#Ad_002dhoc-multi_002dhops&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-05-07T19:17:39.367" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12237" PostTypeId="2" ParentId="12232" CreationDate="2015-05-07T20:09:42.563" Score="7" Body="&lt;p&gt;You could define a dedicated input-method, unless you're already using one.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(quail-define-package &quot;C++-operator&quot; &quot;C&quot; &quot;Cop&quot;)&#xA;&#xA;(quail-define-rules&#xA; (&quot;==&quot; [&quot;_EQ_&quot;])&#xA; (&quot;&amp;amp;&quot; [&quot;_BITAND_&quot;])&#xA; (&quot;&amp;amp;&amp;amp;&quot; [&quot;_AND_&quot;])&#xA; (&quot;|&quot; [&quot;_BITOR_&quot;])&#xA; (&quot;||&quot; [&quot;_OR_&quot;])&#xA; (&quot;!&quot; [&quot;_NOT_&quot;])&#xA; (&quot;!=&quot; [&quot;_NOT_EQ_&quot;]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Activating it with &lt;code&gt;C-u C-\ C++-operator RET&lt;/code&gt;. Note that you can still insert the original characters by using &lt;kbd&gt;C-q&lt;/kbd&gt; as a prefix. (Just an idea I had and posted it, beeing suprised that it seems to work so easily.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can activate this automatically for c++-mode in the following way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-activate-C++-operator ()&#xA;  (interactive)&#xA;  (quail-activate &quot;C++-operator&quot;))&#xA;(add-hook 'c++-mode-hook  'my-activate-C++-operator)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2017-09-02T14:15:52.097" LastActivityDate="2017-09-02T14:15:52.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12239" PostTypeId="1" CreationDate="2015-05-07T21:18:01.303" Score="2" ViewCount="107" Body="&lt;p&gt;My situation is this: I compile by invoking a system that runs perl scripts that invoke the Visual Studio compiler, as well as running some pre-compile tasks. By and large, the system works fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem comes when something in the pre-compile step fails. There's an error, but the compilation scripts expect input (since this would've normally been run in an interactive terminal). I usually just fix the problem and hit compile again, which kills off the previous process without issue. This isn't great, though, since I don't get any notifications that the compilation has 'finished', so sometimes I don't notice that I need to restart it. (I could stare at the compilation until it finishes, but that would get on my nerves really fast.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess what would be ideal would be to parse the compilation buffer until I see &quot;Press a key to continue&quot; and then send some sort of input that would finish the compilation and get my compile-finished-hooks to run. I've written compilation error regexps, but is it possible to cause a matched line to call a function? Or perhaps, since the output stops, I can use that as some sort of signal?&lt;/p&gt;&#xA;" OwnerUserId="8254" LastEditorUserId="50" LastEditDate="2015-05-08T10:44:10.413" LastActivityDate="2015-05-08T10:44:10.413" Title="Automatically reply to input-requests in compilation buffer" Tags="|compilation|compilation-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12240" PostTypeId="1" AcceptedAnswerId="12244" CreationDate="2015-05-07T21:26:09.400" Score="0" ViewCount="560" Body="&lt;p&gt;The built-in backslash fringe bitmap is somewhat mysterious in that it is not available to the user through a common name such as &lt;code&gt;backslash&lt;/code&gt; or &lt;code&gt;back-slash&lt;/code&gt;.  I created my own -- using &lt;code&gt;fringe-helper-convert&lt;/code&gt; and &lt;code&gt;define-fringe-bitmap&lt;/code&gt; -- but it looks like a miniature staircase instead of a good looking smooth line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a special name for the built-in backslash fringe bitmap, and if so, what is it called?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following snippet demonstrates how to display a bitmap in the right fringe (assuming the fringe is visible and wide enough) -- the example uses a &lt;code&gt;question-mark&lt;/code&gt; since the built-in backslash appears to be unavailable?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((peol (point-at-eol)))&#xA;  (overlay-put (make-overlay peol peol) 'after-string&#xA;    (propertize (char-to-string ?\uE000) 'display&#xA;      '(right-fringe question-mark font-lock-keyword-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are links to the limited documentation regarding fringe bitmaps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Bitmaps.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Bitmaps.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Customizing-Bitmaps.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Customizing-Bitmaps.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The built-in fringe backslash is visible in the right fringe in a GUI version of Emacs when the fringes are turned &lt;strong&gt;OFF&lt;/strong&gt; -- i.e., &lt;code&gt;(set-window-fringes (selected-window) 0 0)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/fringe_screenshot.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is my staircase-looking version of the backslash, which is not a smooth line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; AUTHOR:  Nikolaj Schumacher -- https://github.com/nschum/fringe-helper.el&#xA;;;&#xA;(defun fringe-helper-convert (&amp;amp;rest strings)&#xA;&quot;Convert STRINGS into a vector usable for `define-fringe-bitmap'.&#xA;Each string in STRINGS represents a line of the fringe bitmap.&#xA;Periods (.) are background-colored pixel; Xs are foreground-colored. The&#xA;fringe bitmap always is aligned to the right. If the fringe has half&#xA;width, only the left 4 pixels of an 8 pixel bitmap will be shown.&#xA;For example, the following code defines a diagonal line.&#xA;\(fringe-helper-convert&#xA;\&quot;XX......\&quot;&#xA;\&quot;..XX....\&quot;&#xA;\&quot;....XX..\&quot;&#xA;\&quot;......XX\&quot;\)&quot;&#xA;  (unless (cdr strings)&#xA;  ;; only one string, probably with newlines&#xA;    (setq strings (split-string (car strings) &quot;\n&quot;)))&#xA;  (apply 'vector&#xA;    (mapcar&#xA;      (lambda (str)&#xA;        (let ((num 0))&#xA;          (dolist (c (string-to-list str))&#xA;            (setq num (+ (* num 2) (if (eq c ?.) 0 1))))&#xA;          num))&#xA;      strings)))&#xA;&#xA;(define-fringe-bitmap 'backslash (fringe-helper-convert&#xA;  &quot;XX......&quot;&#xA;  &quot;XX......&quot;&#xA;  &quot; XX.....&quot;&#xA;  &quot;.XX.....&quot;&#xA;  &quot;..XX....&quot;&#xA;  &quot;..XX....&quot;&#xA;  &quot;...XX...&quot;&#xA;  &quot;...XX...&quot;&#xA;  &quot;....XX..&quot;&#xA;  &quot;....XX..&quot;&#xA;  &quot;.....XX.&quot;&#xA;  &quot;.....XX.&quot;) nil nil 'center)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.590" LastActivityDate="2015-05-08T03:59:02.180" Title="Using the built-in backslash fringe bitmap" Tags="|fringe|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12241" PostTypeId="2" ParentId="12239" CreationDate="2015-05-07T22:15:36.907" Score="1" Body="&lt;p&gt;Problem solved--it turns out sending an invisible input as the compilation starts will queue up, and when the buffer is ready for input, it accepts it right away.&lt;/p&gt;&#xA;" OwnerUserId="8254" LastActivityDate="2015-05-07T22:15:36.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12242" PostTypeId="2" ParentId="12235" CreationDate="2015-05-08T00:17:47.597" Score="1" Body="&lt;p&gt;Based on the advice of politza and wvxvw:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-edit-file-as-root ()&#xA;  &quot;Find file as root&quot;&#xA;  (interactive)&#xA;  (let*&#xA;    ((sudo (/= (call-process &quot;sudo&quot; nil nil &quot;-n true&quot;) 0))&#xA;      (file-name&#xA;        (if (tramp-tramp-file-p buffer-file-name)&#xA;          (with-parsed-tramp-file-name buffer-file-name parsed&#xA;            (tramp-make-tramp-file-name&#xA;              (if sudo &quot;sudo&quot; &quot;su&quot;)&#xA;              &quot;root&quot;&#xA;              parsed-host&#xA;              parsed-localname&#xA;              (let ((tramp-postfix-host-format &quot;|&quot;)&#xA;                     (tramp-prefix-format))&#xA;                (tramp-make-tramp-file-name&#xA;                  parsed-method&#xA;                  parsed-user&#xA;                  parsed-host&#xA;                  &quot;&quot;&#xA;                  parsed-hop))))&#xA;          (concat (if sudo&#xA;                    &quot;/sudo::&quot;&#xA;                    &quot;/su::&quot;)&#xA;            buffer-file-name))))&#xA;    (find-alternate-file file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work perfectly in all the cases I tested.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-05-08T03:26:17.097" LastActivityDate="2015-05-08T03:26:17.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12243" PostTypeId="2" ParentId="12218" CreationDate="2015-05-08T01:46:43.520" Score="3" Body="&lt;p&gt;If the lines you want to manipulate can be distinguished via a regex match, you can use &lt;a href=&quot;http://emacswiki.org/emacs/OccurMode&quot; rel=&quot;nofollow&quot;&gt;occur-mode&lt;/a&gt; to view them in a new window.  You can then use &lt;a href=&quot;http://irreal.org/blog/?p=1173&quot; rel=&quot;nofollow&quot;&gt;occur-edit-mode&lt;/a&gt; to edit them, with the original buffer reflecting the changes that you make in the Occur buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works wonderfully, for example, in combination with &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;multiple-cursors-mode&lt;/a&gt;: because the lines you've selected to appear in the Occur buffer are displayed contiguously regardless of how far they are in the original buffer, you can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Marking-Objects.html&quot; rel=&quot;nofollow&quot;&gt;mark all of them or a subset&lt;/a&gt; and then activate &lt;code&gt;mc/edit-lines&lt;/code&gt; and edit them all at once.  (Yes, I know that multiple-cursors can do this all by itself with &lt;code&gt;mc/mark-all-like-this&lt;/code&gt;, but it's nice to have options.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other editing operation that would be more easily done if you were seeing only the lines you wanted to work on, such as setting up a complicated regex search and replace, or a macro that needs to run on each line of a buffer in turn, can also be done this way.&lt;/p&gt;&#xA;" OwnerUserId="2374" LastActivityDate="2015-05-08T01:46:43.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12244" PostTypeId="2" ParentId="12240" CreationDate="2015-05-08T01:50:36.243" Score="1" Body="&lt;p&gt;When fringes are turned &lt;strong&gt;OFF&lt;/strong&gt; in a GUI version of Emacs, the continuation image that is displayed in what appeared to be the right fringe is actually a &lt;strong&gt;glyph&lt;/strong&gt;, not a &lt;strong&gt;bitmap&lt;/strong&gt;.  Therefore, users must create their own backslash if they want to display that image in the fringe -- i.e., the staircase-looking bitmap in the question is about as good as it gets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Tables.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Tables.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also -- the following is the relevant excerpt from &lt;code&gt;xdisp.c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* Get information about special display element WHAT in an&#xA;   environment described by IT.  WHAT is one of IT_TRUNCATION or&#xA;   IT_CONTINUATION.  Maybe produce glyphs for WHAT if IT has a&#xA;   non-null glyph_row member.  This function ensures that fields like&#xA;   face_id, c, len of IT are left untouched.  */&#xA;&#xA;static void&#xA;produce_special_glyphs (struct it *it, enum display_element_type what)&#xA;{&#xA;  struct it temp_it;&#xA;  Lisp_Object gc;&#xA;  GLYPH glyph;&#xA;&#xA;  temp_it = *it;&#xA;  temp_it.object = make_number (0);&#xA;  memset (&amp;amp;temp_it.current, 0, sizeof temp_it.current);&#xA;&#xA;  if (what == IT_CONTINUATION)&#xA;    {&#xA;      /* Continuation glyph.  For R2L lines, we mirror it by hand.  */&#xA;      if (it-&amp;gt;bidi_it.paragraph_dir == R2L)&#xA;    SET_GLYPH_FROM_CHAR (glyph, '/');&#xA;      else&#xA;    SET_GLYPH_FROM_CHAR (glyph, '\\');&#xA;      if (it-&amp;gt;dp&#xA;      &amp;amp;&amp;amp; (gc = DISP_CONTINUE_GLYPH (it-&amp;gt;dp), GLYPH_CODE_P (gc)))&#xA;    {&#xA;      /* FIXME: Should we mirror GC for R2L lines?  */&#xA;      SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);&#xA;      spec_glyph_lookup_face (XWINDOW (it-&amp;gt;window), &amp;amp;glyph);&#xA;    }&#xA;    }&#xA;  else if (what == IT_TRUNCATION)&#xA;    {&#xA;      /* Truncation glyph.  */&#xA;      SET_GLYPH_FROM_CHAR (glyph, '$');&#xA;      if (it-&amp;gt;dp&#xA;      &amp;amp;&amp;amp; (gc = DISP_TRUNC_GLYPH (it-&amp;gt;dp), GLYPH_CODE_P (gc)))&#xA;    {&#xA;      /* FIXME: Should we mirror GC for R2L lines?  */&#xA;      SET_GLYPH_FROM_GLYPH_CODE (glyph, gc);&#xA;      spec_glyph_lookup_face (XWINDOW (it-&amp;gt;window), &amp;amp;glyph);&#xA;    }&#xA;    }&#xA;  else&#xA;    emacs_abort ();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-05-08T03:59:02.180" LastActivityDate="2015-05-08T03:59:02.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12245" PostTypeId="1" AcceptedAnswerId="12259" CreationDate="2015-05-08T04:48:28.543" Score="2" ViewCount="439" Body="&lt;p&gt;Every mode in Emacs has its own rules for indentation. I don't want that. How can I disable it and have custom indentation rules for every mode?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2017-03-06T16:12:33.597" Title="Disable indentation in all modes" Tags="|indentation|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12246" PostTypeId="1" CreationDate="2015-05-08T07:53:48.610" Score="5" ViewCount="269" Body="&lt;p&gt;I am using Mac OS X Yosemite if this matters at all.&#xA;Is there a way, while in the emacs GUI, to force every key combination to run the emacs command specified by this key binding instead of other application's command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can only think of one such conflict for now, but I'm sure more will come up as I learn more about emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-&amp;lt;SPC&amp;gt;&lt;/code&gt; should run just-one-space, but instead it opens albert's search functionality.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8258" LastEditorUserId="50" LastEditDate="2015-05-08T08:13:51.523" LastActivityDate="2015-11-10T02:47:25.253" Title="Forcing keys to run emacs commands instead of other app's commands" Tags="|key-bindings|osx|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12247" PostTypeId="2" ParentId="12245" CreationDate="2015-05-08T08:57:14.773" Score="1" Body="&lt;pre&gt;&lt;code&gt;(defun indent-according-to-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There might be some mode-specific indent-functions which still need treatment.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-05-08T08:57:14.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12248" PostTypeId="1" AcceptedAnswerId="12798" CreationDate="2015-05-08T09:26:46.013" Score="10" ViewCount="1246" Body="&lt;p&gt;I've hit a problem that region is deactivated (in transient-mark-mode). The function &lt;code&gt;deactivate-mark&lt;/code&gt; is called and I would like to find out where (and why) it is called from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;M-x debug-on-entry RET deactivate-mark&lt;/code&gt; and it stops but I found no way to find out the caller. Whole displayed stacktrace is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--entering a function:&#xA;* deactivate-mark()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;M-x edebug-eval-defun&lt;/code&gt; but Edebug does not show the caller either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I find out why (where from) &lt;code&gt;deactivate-mark&lt;/code&gt; is called? I'm look for backtrace or stacktrace functinality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An &lt;code&gt;advice-add&lt;/code&gt; trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun message-show-backtrace ()&#xA;  (message &quot;%s&quot; (backtrace-frame 10)))&#xA;&#xA;(advice-add deactivate-mark :before #'message-show-backtrace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;produces &lt;code&gt;nil&lt;/code&gt; in &lt;code&gt;*Messages*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: more info about &lt;code&gt;deactivate-mark&lt;/code&gt;: &lt;a href=&quot;http://emacshorrors.com/posts/deactivate-mark.html&quot; rel=&quot;nofollow&quot;&gt;http://emacshorrors.com/posts/deactivate-mark.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="5213" LastEditDate="2016-08-03T05:44:01.680" LastActivityDate="2016-08-03T05:44:01.680" Title="How to find out where a function is called from (backtrace/stacktrace)?" Tags="|debugging|functions|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12249" PostTypeId="1" AcceptedAnswerId="12251" CreationDate="2015-05-08T11:35:25.293" Score="6" ViewCount="4828" Body="&lt;p&gt;Is there a way to open a file from Neotree in a new split window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to achive same functionality as Vim NERDTree shortcuts &quot;i&quot; and &quot;s&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is that the wrong approach?&lt;/p&gt;&#xA;" OwnerUserId="8260" LastEditorUserId="115" LastEditDate="2015-05-08T11:51:08.493" LastActivityDate="2017-01-16T18:12:55.890" Title="Neotree open file in split window" Tags="|package|window|frames|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12251" PostTypeId="2" ParentId="12249" CreationDate="2015-05-08T11:50:41.307" Score="10" Body="&lt;h2&gt;New recommendation (Jan 2017)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jaypei/emacs-neotree&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;neotree&lt;/code&gt;&lt;/a&gt; comes with default bindings of &lt;code&gt;|&lt;/code&gt; for vertical split and &lt;code&gt;-&lt;/code&gt; for horizontal split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The functions &lt;code&gt;neotree-enter-horizontal-split&lt;/code&gt; and &lt;code&gt;neotree-enter-vertical-split&lt;/code&gt; mentioned in my older recommendation below do not exist any more!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Old recommendation (May 2015)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Currently the &lt;code&gt;i&lt;/code&gt; and &lt;code&gt;I&lt;/code&gt; keys are not bound in &lt;code&gt;neotree-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can use the below after &lt;code&gt;(require 'neotree)&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key neotree-mode-map (kbd &quot;i&quot;) #'neotree-enter-horizontal-split)&#xA;(define-key neotree-mode-map (kbd &quot;I&quot;) #'neotree-enter-vertical-split)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, when the cursor is on a file name, pressing &lt;code&gt;i&lt;/code&gt; will open that file in a new window after horizontal split.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2017-01-16T18:12:55.890" LastActivityDate="2017-01-16T18:12:55.890" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12252" PostTypeId="1" AcceptedAnswerId="12253" CreationDate="2015-05-08T13:01:35.370" Score="0" ViewCount="80" Body="&lt;p&gt;I would like to be able to toggle abbrev-mode on and off with ease. Of course I could use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x abbrev-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like to set this to some keyboard shortcut. To this end I've added the following to my .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f7&amp;gt;&quot;) (lambda () (interactive) (abbrev-mode nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this doesn't have the desired effect. How do I enable this functionality?&lt;/p&gt;&#xA;" OwnerUserId="2180" LastActivityDate="2015-05-08T13:03:47.030" Title="Toggle abbrev-mode using keyboard" Tags="|elisp|abbrev|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12253" PostTypeId="2" ParentId="12252" CreationDate="2015-05-08T13:03:47.030" Score="2" Body="&lt;p&gt;Remove the wrapper:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f7&amp;gt;&quot;) 'abbrev-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-08T13:03:47.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12254" PostTypeId="1" CreationDate="2015-05-08T14:17:25.420" Score="4" ViewCount="386" Body="&lt;p&gt;Wanderlust uses &quot;mime-view&quot; internally for displaying mail messages. Sometimes &quot;text/plain&quot; messages actually have very long lines (like &quot;text/flowed&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If in mime-view I toggle &lt;code&gt;visual-line-mode&lt;/code&gt; message is displayed correctly. I've tried to add the following hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'mime-display-text/plain-hook&#xA;  (lambda ()&#xA;    (visual-line-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately it doesn't work - &lt;code&gt;visual-line-mode&lt;/code&gt; is set, but message is still displayed unwrapped. Any ideas how that could be solved?&lt;/p&gt;&#xA;" OwnerUserId="474" LastEditorUserId="2223" LastEditDate="2015-05-16T23:35:38.560" LastActivityDate="2015-05-16T23:35:38.560" Title="Mime-view: wrap automatically" Tags="|email|wanderlust|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12257" PostTypeId="2" ParentId="12171" CreationDate="2015-05-08T17:14:15.800" Score="1" Body="&lt;p&gt;This is what I used to get the information I needed from the hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun andy/journal-state-change (plist-chg)&#xA;  &quot;When the state changes, link it into the journal&quot;&#xA;&#xA;  (let* ((element (org-element-at-point))&#xA;         (heading (org-element-property :title element))&#xA;         (fromprop (plist-get plist-chg :from))&#xA;         (toprop (plist-get plist-chg :to))&#xA;         (jentry (format &quot;%s (%s)&quot; heading toprop))&#xA;         )&#xA;    (org-journal-add-entry  (buffer-file-name) jentry)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I inserted it using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-journal-add-entry (fname entry)&#xA;  ...blah&#xA;  (insert (org-make-link-string (format &quot;file:%s&quot; fname) entry))&#xA;  ...blah&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8240" LastActivityDate="2015-05-08T17:14:15.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12258" PostTypeId="1" AcceptedAnswerId="12260" CreationDate="2015-05-08T17:16:14.920" Score="8" ViewCount="266" Body="&lt;p&gt;How do I find the elisp code for the major mode in use in the current buffer?&lt;/p&gt;&#xA;" OwnerUserId="2069" LastActivityDate="2015-05-08T17:27:04.627" Title="How do I find the code for the current major mode?" Tags="|elisp|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12259" PostTypeId="2" ParentId="12245" CreationDate="2015-05-08T17:18:39.080" Score="3" Body="&lt;p&gt;Here's the docstring for the function &lt;code&gt;indent-according-to-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Indent line in proper way for current major mode.&#xA;  Normally, this is done by calling the function specified by the&#xA;  variable &lt;code&gt;indent-line-function&lt;/code&gt;.  However, if the value of that&#xA;  variable is &lt;code&gt;indent-relative&lt;/code&gt; or &lt;code&gt;indent-relative-maybe&lt;/code&gt;, handle&#xA;  it specially (since those functions are used for tabbing); in&#xA;  that case, indent by aligning to the previous non-blank line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want to turn off indentation (but why...?) in a particular buffer, you can more or less achieve this via &lt;code&gt;M-: (setf indent-line-function #'indent-relative-maybe)&lt;/code&gt; (but have a look at &lt;code&gt;indent-relative-maybe&lt;/code&gt;'s docstring for more information).  If you want to make that the default for a given mode, put the line in the mode hook.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to write your own indentation rules, you can &lt;code&gt;(setf indent-line-function #'your-custom-function)&lt;/code&gt; in the mode hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please consider, however, that writing a custom indentation function is a non-trivial amount of work (browse the code for &lt;code&gt;lisp-indent-function&lt;/code&gt; and you'll see what I mean), so unless you have a really compelling reason to deviate from the default indentation style, it's probably not worth the effort.  Moreover, it's arguably a bad idea: letting Emacs indent according to the default indentation rules means that your code is more likely to conform to general coding conventions, which will make it easier for other people to read your code.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-05-08T17:18:39.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12260" PostTypeId="2" ParentId="12258" CreationDate="2015-05-08T17:27:04.627" Score="11" Body="&lt;p&gt;The variable &lt;code&gt;major-mode&lt;/code&gt; will be set to a symbol describing the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the mode was written anytime in recent history, that symbol will be a function that activates the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can simply &quot;find&quot; the major mode's code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(find-function major-mode)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or interactively, run &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;describe-mode&lt;/code&gt; and click the link to the source file.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-05-08T17:27:04.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12261" PostTypeId="1" CreationDate="2015-05-08T18:04:18.040" Score="7" ViewCount="1067" Body="&lt;p&gt;How can I construct a parse tree from a string and a simple grammar? Semantic seems very tricky, and SMIE does not seem to produce a parse tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example, assuming a language that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BLAH [ FOO &quot;aaa&quot;; &quot;bbb&quot; | BAR [ &quot;ccc&quot; | &quot;ddd&quot; ] ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I simply transform that string into the following sexp, or something close?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(seq (ident &quot;BLAH&quot;)&#xA;     (choice (cons (seq (ident &quot;FOO&quot;) (str &quot;aaa&quot;))&#xA;                   (seq (str &quot;bbb&quot;)))&#xA;             (seq  (ident &quot;BAR&quot;)&#xA;                   (choice (seq (str &quot;ccc&quot;)) (seq (str &quot;ddd&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(essentially there are sequences &lt;code&gt;seq&lt;/code&gt; (no delimiters), grouping choices &lt;code&gt;choice&lt;/code&gt; (&lt;code&gt;[]&lt;/code&gt;), strings &lt;code&gt;&quot;&quot;&lt;/code&gt;, identifiers &lt;code&gt;ident&lt;/code&gt; (capitals), and delimited sequences &lt;code&gt;cons&lt;/code&gt; (&lt;code&gt;;&lt;/code&gt;-delimited))&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="675" LastEditDate="2015-05-12T21:02:30.640" LastActivityDate="2015-05-12T21:02:30.640" Title="How do I parse a simple grammar and obtain a syntax tree in Emacs lisp?" Tags="|syntax|semantic-mode|parsing|smie|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12262" PostTypeId="2" ParentId="12234" CreationDate="2015-05-08T18:09:02.477" Score="1" Body="&lt;p&gt;The behavior is correct and the expected one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;forward-sexp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;means:&#xA;Move forward across one balanced expression. However, what should be &quot;balanced&quot;?&#xA;Obviously this is a very general term. Emacs takes a single word as balanced expression, but not a single operator-sign. Lists are commonly well detected as balanced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When starting from &quot;(&quot; in your example, call &lt;code&gt;python-nav-end-of-statement&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-05-08T18:09:02.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12263" PostTypeId="1" CreationDate="2015-05-08T20:03:09.230" Score="1" ViewCount="140" Body="&lt;p&gt;&lt;code&gt;helm&lt;/code&gt; sources have a slot named &lt;code&gt;match-part&lt;/code&gt; which, IIUC, is the part of the transformed candidate that will be matched. In particular, the source &lt;code&gt;helm-files-in-current-dir-source&lt;/code&gt; has the following &lt;code&gt;match-part&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(match-part :initform (lambda (candidate)&#xA;                           (if (or helm-ff-transformer-show-only-basename&#xA;                                   helm-recentf--basename-flag)&#xA;                               (helm-basename candidate) candidate)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This source also has &lt;code&gt;fuzzy-match&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;. With &lt;code&gt;helm-ff-transformer-show-only-basename&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;, I still see this source, when used as part of &lt;code&gt;helm-for-files&lt;/code&gt;, doing fuzzy-matching on the full file name and not just the basename. For example, &lt;code&gt;abc&lt;/code&gt; matches the file &lt;code&gt;aaa/bbb/ccc&lt;/code&gt;. I had assumed &lt;code&gt;match-part&lt;/code&gt; would transform the candidate &lt;code&gt;aaa/bbb/ccc&lt;/code&gt; to just &lt;code&gt;ccc&lt;/code&gt;, which &lt;code&gt;abc&lt;/code&gt; would fail to match even with fuzzy matching on. What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fuzzy match function which kicks in for the source &lt;code&gt;helm-files-in-current-dir-source&lt;/code&gt; is the default &lt;code&gt;helm-fuzzy-match&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-05-08T20:03:09.230" Title="Restricting helm's fuzzy match to a substring of the candidate" Tags="|helm|helm-for-files|fuzzy-search|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12264" PostTypeId="2" ParentId="10975" CreationDate="2015-05-08T20:50:44.173" Score="3" Body="&lt;p&gt;&lt;em&gt;Update: &lt;code&gt;2.1.0&lt;/code&gt; has been released.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;1.4.*&lt;/code&gt;/&lt;code&gt;master&lt;/code&gt; the face is named &lt;code&gt;magit-item-highlight&lt;/code&gt;. In &lt;code&gt;2.1.*&lt;/code&gt;/&lt;code&gt;next&lt;/code&gt; it is named &lt;code&gt;magit-section-highlight&lt;/code&gt;, because that's what these ui elements are called everywhere else too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using &lt;code&gt;1.4.*&lt;/code&gt; diffstats lose their appearance when they are highlighted because a face is used which overrides not only the background color but also the foreground color. The reason that doesn't happen for certain other sections is that we explicitly hack around the issue by using overlays for things that should be unaffected by the highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix that you could change the &lt;strong&gt;option&lt;/strong&gt; &lt;code&gt;magit-item-highlight-face&lt;/code&gt; to another face which does not set the foreground color. Or you could make &lt;code&gt;magit-item-highlight&lt;/code&gt; inherit from another face which does not set the foreground. You &lt;strong&gt;cannot&lt;/strong&gt; just set &lt;code&gt;magit-item-highlight&lt;/code&gt;s foreground to &quot;none&quot;, because there is no such value - that's a limitation in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason there are many issue related to the section highlighting is that there are diverging opinions one &quot;how it should be&quot; and &quot;this is the worst possible thing you could do&quot;. It took a while implementing something that allows everyone to configuring it the way they want. And that will be released as &lt;code&gt;2.1.0&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should either update to the &lt;code&gt;next&lt;/code&gt; branch now, or just live with diffstats losing their foreground colors when highlighted - that seems like a very minor issue.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T12:58:20.393" LastActivityDate="2015-07-03T12:58:20.393" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12265" PostTypeId="1" CreationDate="2015-05-08T21:59:42.190" Score="1" ViewCount="149" Body="&lt;p&gt;Is it possible to adjust the behavior of the commands &lt;code&gt;'left-word'&lt;/code&gt; and &lt;code&gt;'right-word'&lt;/code&gt; (which I have bound to &lt;code&gt;m-left&lt;/code&gt; and &lt;code&gt;m-right&lt;/code&gt;) so that when I invoke, say, &lt;code&gt;'right-word'&lt;/code&gt; and the point jumps to the end of the next word, it also includes the &lt;code&gt;space&lt;/code&gt; following it? But NOT any punctuation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to do this because I use &lt;code&gt;m-left&lt;/code&gt; and &lt;code&gt;m-right&lt;/code&gt;, with the mark set, to highlight regions for deletion. With current behavior, when I set the mark, then do &lt;code&gt;m-right&lt;/code&gt; to highlight a word or set of words then delete them, I am left with two spaces in a row. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Theoretically &lt;code&gt;left-word&lt;/code&gt; should then also be greedy and jump to to a position BEFORE a PRECEDING space, though I almost always select words moving forward, not backward.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm deleting just one word, I invoke &lt;code&gt;kill-word&lt;/code&gt;, but when deleting multiple words, I prefer to first highlight them all and then delete them all at once. &lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2274" LastEditDate="2015-05-08T22:29:23.243" LastActivityDate="2015-05-08T22:29:23.243" Title="possible to make it so that left-word and right-word include spaces?" Tags="|motion|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12266" PostTypeId="1" AcceptedAnswerId="12321" CreationDate="2015-05-08T22:36:34.093" Score="4" ViewCount="313" Body="&lt;p&gt;I'd like to modify the behavior of &lt;code&gt;kill-sentence&lt;/code&gt; (which I have bound to &lt;code&gt;M-k&lt;/code&gt;) according to context, in the following way:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the point is at the beginning of a sentence, then kill the sentence in the usual way, deleting all the words of the sentence, as well as the period and the space after the period. &lt;/li&gt;&#xA;&lt;li&gt;If the point is in the middle of a sentence somewhere, it makes no sense to delete the period and space, because this unwantedly joins two sentences. So if point is inside a sentence, I want Emacs to run &lt;code&gt;kill-sentence-to-period&lt;/code&gt;, below, so as to preserve the period. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;i.e. something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-sentence-to-period ()&#xA;    &quot;Kill the rest of the sentence but leave the period.&quot;&#xA;    (interactive)&#xA;    (kill-sentence)&#xA;    (push-mark)&#xA;    (insert &quot;.&quot;)&#xA;    (backward-char))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to change the behavior of &lt;code&gt;M-k&lt;/code&gt; depending on the context, conditional on whether or not the point is inside a sentence? &lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="245" LastEditDate="2015-05-12T18:19:52.463" LastActivityDate="2015-05-12T18:59:55.717" Title="how change behavior of kill-sentence based on position in sentence?" Tags="|text-editing|sentences|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12267" PostTypeId="2" ParentId="12218" CreationDate="2015-05-08T23:01:26.617" Score="6" Body="&lt;p&gt;The new rectangle-region support in Emacs-24.4 actually introduced (a big part of) the infrastructure needed for this functionality [ after all, a rectangular region &lt;em&gt;is&lt;/em&gt; a non-contiguous region].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, it should be possible now to implement a &quot;split-region&quot; package which provides just the functionality you're asking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Admittedly, lots of Emacs commands still haven't been adapted to use the new infrastructure (e.g. commands like upcase-region, or undo-in-region, query-replace, ...) and hence don't work properly on rectangles yet (so they wouldn't work properly on a &quot;split-region&quot; either), but these are bugs which should hopefully get fixed over time.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-08T23:01:26.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12268" PostTypeId="2" ParentId="12266" CreationDate="2015-05-09T02:03:45.157" Score="1" Body="&lt;p&gt;A quick-and-dirty (i.e., too simplistic) answer is this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun at-sentence-beginning-p ()&#xA;  &quot;Return non-nil if at the beginning of a sentence.&quot;&#xA;  (looking-back (sentence-end)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It really tests whether point is after a sentence end.  There are plenty of cases where it does not do the right thing, including, for example, a sentence enclosed in parens.  But it might help you get started.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T20:12:06.977" LastActivityDate="2015-05-09T20:12:06.977" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12269" PostTypeId="1" AcceptedAnswerId="12273" CreationDate="2015-05-09T02:49:07.350" Score="5" ViewCount="939" Body="&lt;p&gt;Electric-pair-mode always tries to insert a closing delimiter after the opening one if nothing is selected. However, if you're placing delimiters around an existing something that you don't want to select for some reason, this adds another keystroke instead of saving you one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a good way to tell electric-pair-mode to check if the point is adjacent to a non-empty string first, and not bother adding a closing delimiter if so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For instance, this is the behavior of RStudio's electric pairs.)&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2015-08-18T15:01:13.457" Title="Getting electric-pair mode to behave more nicely around existing strings" Tags="|advice|electric-pair-mode|delimiters|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12270" PostTypeId="2" ParentId="4138" CreationDate="2015-05-09T07:15:53.160" Score="3" Body="&lt;p&gt;Did you test &lt;a href=&quot;http://nullprogram.com/blog/2013/09/04/&quot; rel=&quot;nofollow&quot;&gt;elfeed&lt;/a&gt;? Is not a client for feedly.com, but you can read your RSS feeds within Emacs anyway&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-05-09T07:15:53.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12271" PostTypeId="1" CreationDate="2015-05-09T08:35:10.287" Score="1" ViewCount="168" Body="&lt;p&gt;In my &lt;code&gt;python-mode&lt;/code&gt; the &lt;code&gt;backspace&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt; keys gets remapped to &lt;code&gt;py-electric-backspace&lt;/code&gt;, etc. This breaks the behaviour set by the variable &lt;code&gt;delete-active-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to unify the behaviour so that when I mark a region and press &lt;code&gt;delete&lt;/code&gt; it will actually delete the region and if unmarked act as dedicated by &lt;code&gt;py-electric-backspace&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A related question has been posted &lt;a href=&quot;https://emacs.stackexchange.com/questions/9693/use-normal-delete-region-with-backspace-in-markdown-mode&quot;&gt;here&lt;/a&gt;, but not completely applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;This has been fixed in the latest &lt;code&gt;python-mode&lt;/code&gt; package by &lt;em&gt;Andreas&lt;/em&gt; (See comments below)&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2015-05-10T17:38:40.867" LastActivityDate="2015-05-10T17:38:40.867" Title="Delete marked region with py-electric-backspace py-electric-delete" Tags="|python|region|mark|elpy|deletion|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12272" PostTypeId="1" CreationDate="2015-05-09T10:47:12.257" Score="0" ViewCount="111" Body="&lt;p&gt;I experience when using &lt;code&gt;TAB&lt;/code&gt; bound to &lt;code&gt;py-indent-or-complete&lt;/code&gt; that it gives me completion suggestions. however when leaving, or deciding the completion, the &lt;code&gt;*Python Completion*&lt;/code&gt; buffer is left open instead of getting buried. I also experience that after tab completing the word at point a newline is needlessly inserted moving me one line down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the underlying settings to configure these two things when using &lt;code&gt;py-indent-or-complete&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="427" LastActivityDate="2015-05-09T12:23:39.790" Title="py-indent-or-complete leaves the *Python Completion* buffer open" Tags="|python|completion|elpy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12273" PostTypeId="2" ParentId="12269" CreationDate="2015-05-09T10:47:46.483" Score="3" Body="&lt;p&gt;Change the way pair insertion is inhibited:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2316" LastActivityDate="2015-05-09T10:47:46.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12274" PostTypeId="2" ParentId="12272" CreationDate="2015-05-09T12:23:39.790" Score="1" Body="&lt;p&gt;This would constitute a bug. Please check out current trunk either at &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://launchpad.net/python-mode&quot; rel=&quot;nofollow&quot;&gt;https://launchpad.net/python-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or at some distributor. AFAIK melpa.org ships it.&#xA;Using el-get should work too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case bug still occurs, please file a report at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bugs.launchpad.net/python-mode&quot; rel=&quot;nofollow&quot;&gt;https://bugs.launchpad.net/python-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;attaching some example code which triggers it - for now can't see it.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-05-09T12:23:39.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12275" PostTypeId="2" ParentId="12271" CreationDate="2015-05-09T12:25:48.357" Score="1" Body="&lt;p&gt;The normal way to fix this is to fix &lt;code&gt;py-electric-backspace&lt;/code&gt; to check &lt;code&gt;use-region-p&lt;/code&gt; and &lt;code&gt;delete-active-region&lt;/code&gt; and handle them as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, I'd submit a bug report to the maintainers of the package.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-09T12:25:48.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12277" PostTypeId="1" AcceptedAnswerId="12278" CreationDate="2015-05-09T19:41:18.097" Score="3" ViewCount="1140" Body="&lt;p&gt;I am writing a function to get the foreground color of the face at point and am thinking that Emacs may already provide a better method than the one I'm composing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am going to be using this function about 50 times every &lt;code&gt;redisplay&lt;/code&gt; (i.e., once for every visible horizontal line, going down a column vertically from &lt;code&gt;window-start&lt;/code&gt; to &lt;code&gt;window-end&lt;/code&gt;), so I want it to be as efficient as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the proposed function &lt;code&gt;get-face&lt;/code&gt;, I would use:  &lt;code&gt;(when (eq (car (text-properties-at (point))) 'face) (nth 23 (get-face (nth 1 (text-properties-at (point))))))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not certain under what circumstances more than one face will exist, or whether the &lt;code&gt;car&lt;/code&gt; of &lt;code&gt;text-properties-at&lt;/code&gt; will &lt;strong&gt;always&lt;/strong&gt; contain the symbol &lt;code&gt;face&lt;/code&gt; if a face is present?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still have not dealt with handling an &lt;code&gt;inherit&lt;/code&gt; situation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-face (face)&#xA;&quot;Doc-string.&quot;&#xA;  (let* (&#xA;      (attributes (face-all-attributes face (selected-frame)))&#xA;      (family-car (car (nth 0 attributes)))&#xA;      (family-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 0 attributes))))&#xA;          &quot;Courier&quot;&#xA;          (cdr (nth 0 attributes))))&#xA;      (foundry-car (car (nth 1 attributes)))&#xA;      (foundry-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 1 attributes))))&#xA;          nil&#xA;          (cdr (nth 1 attributes))))&#xA;      (width-car (car (nth 2 attributes)))&#xA;      (width-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 2 attributes))))&#xA;          'normal&#xA;          (cdr (nth 2 attributes))))&#xA;      (height-car (car (nth 3 attributes)))&#xA;      (height-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 3 attributes))))&#xA;          180&#xA;          (cdr (nth 3 attributes))))&#xA;      (weight-car (car (nth 4 attributes)))&#xA;      (weight-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 4 attributes))))&#xA;          'normal&#xA;          (cdr (nth 4 attributes))))&#xA;      (slant-car (car (nth 5 attributes)))&#xA;      (slant-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 5 attributes))))&#xA;          'normal&#xA;          (cdr (nth 5 attributes))))&#xA;      (underline-car (car (nth 6 attributes)))&#xA;      (underline-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 6 attributes))))&#xA;          nil&#xA;          (cdr (nth 6 attributes))))&#xA;      (overline-car (car (nth 7 attributes)))&#xA;      (overline-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 7 attributes))))&#xA;          nil&#xA;          (cdr (nth 7 attributes))))&#xA;      (strike-through-car (car (nth 8 attributes)))&#xA;      (strike-through-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 8 attributes))))&#xA;          nil&#xA;          (cdr (nth 8 attributes))))&#xA;      (box-car (car (nth 9 attributes)))&#xA;      (box-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 9 attributes))))&#xA;          nil&#xA;          (cdr (nth 9 attributes))))&#xA;      (inverse-video-car (car (nth 10 attributes)))&#xA;      (inverse-video-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 10 attributes))))&#xA;          nil&#xA;          (cdr (nth 10 attributes))))&#xA;      (foreground-car (car (nth 11 attributes)))&#xA;      (foreground-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 11 attributes))))&#xA;          'unspecified&#xA;          (cdr (nth 11 attributes))))&#xA;      (background-car (car (nth 12 attributes)))&#xA;      (background-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 12 attributes))))&#xA;          'unspecified&#xA;          (cdr (nth 12 attributes))))&#xA;      (stipple-car (car (nth 13 attributes)))&#xA;      (stipple-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 13 attributes))))&#xA;          nil&#xA;          (cdr (nth 13 attributes))))&#xA;      (inherit-car (car (nth 14 attributes)))&#xA;      (inherit-cdr&#xA;        (if (equal &quot;unspecified&quot; (format &quot;%s&quot; (cdr (nth 14 attributes))))&#xA;          nil&#xA;          (cdr (nth 14 attributes)))))&#xA;    (list&#xA;      family-car family-cdr&#xA;      foundry-car foundry-cdr&#xA;      width-car width-cdr&#xA;      height-car height-cdr&#xA;      weight-car weight-cdr&#xA;      slant-car slant-cdr&#xA;      underline-car underline-cdr&#xA;      overline-car overline-cdr&#xA;      strike-through-car strike-through-cdr&#xA;      box-car box-cdr&#xA;      inverse-video-car inverse-video-cdr&#xA;      foreground-car foreground-cdr&#xA;      background-car background-cdr&#xA;      stipple-car stipple-cdr&#xA;      inherit-car inherit-cdr)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2019-03-14T13:23:38.837" Title="Get foreground color of face at point" Tags="|faces|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12278" PostTypeId="2" ParentId="12277" CreationDate="2015-05-09T20:07:47.287" Score="2" Body="&lt;p&gt;This is what I use, from library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/eyedropper.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;eyedropper.el&lt;/code&gt;&lt;/a&gt;.  (Note the comment about the foreground not being specified by a named face.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eyedrop-foreground-at-point (&amp;amp;optional msg-p)&#xA;  &quot;Return the foreground color under the text cursor.&#xA;Non-nil optional arg MSG-P means display an informative message.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  ;; `eyedrop-face-at-point' alone is not sufficient.  It only gets named faces.&#xA;  ;; Need also pick up any face properties that are not associated with named faces.&#xA;  (let* ((face  (or (eyedrop-face-at-point)&#xA;                    (get-char-property (point) 'read-face-name)&#xA;                    (get-char-property (point) 'face)))&#xA;         (fg    (cond ((and face (symbolp face))&#xA;                       (condition-case nil&#xA;                           (face-foreground face nil 'default) ; Emacs 22+.&#xA;                         (error (or (face-foreground face) ; Emacs 20&#xA;                                    (cdr (assq 'foreground-color (frame-parameters)))))))&#xA;                      ((consp face)&#xA;                       (cond ((memq 'foreground-color face)&#xA;                              (cdr (memq 'foreground-color face)))&#xA;                             ((memq ':foreground face)&#xA;                              (cadr (memq ':foreground face)))))&#xA;                      (t nil)))         ; Invalid face value.&#xA;         (fg    (and (not (member fg '(&quot;unspecified-fg&quot; &quot;unspecified-bg&quot;)))  fg)))&#xA;    (when msg-p&#xA;      (if fg (eyedrop-color-message fg) (message &quot;No foreground color here&quot;)))&#xA;    fg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this, slightly better, is the version from library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/palette.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;palette.el&lt;/code&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/ColorPalette&quot; rel=&quot;nofollow&quot;&gt;Color Palette&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun palette-foreground-at-point (&amp;amp;optional msg-p)&#xA;  &quot;Return the foreground color under the text cursor.&#xA;Display it in a message, respecting option `palette-hex-rgb-digits'.&#xA;Return the full value, however, ignoring `palette-hex-rgb-digits'.&#xA;&#xA;There need be no defined face at the cursor position (point).&#xA;&#xA;Non-interactively, non-nil optional arg MSG-P means display an&#xA;informative message.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  ;; Outside the palette, we need to check both for a named face (via `palette-face-at-point')&#xA;  ;; and face properties that are not associated with named faces.&#xA;  ;; Inside the palette, there is no need to check for a named face.&#xA;  (let* ((face  (or (and (not (eq major-mode 'palette-mode))&#xA;                         (palette-face-at-point))&#xA;                    (get-char-property (point) 'read-face-name)&#xA;                    (get-char-property (point) 'face)&#xA;                    'default))&#xA;         (fg    (cond ((and face (symbolp face))&#xA;                       (condition-case nil&#xA;                           (face-foreground face nil 'default) ; Emacs 22.&#xA;                         (error (or (face-foreground face) ; Emacs 20&#xA;                                    (cdr (assq 'foreground-color (frame-parameters)))))))&#xA;                      ((consp face)&#xA;                       (cond ((eq 'foreground-color (car face)) (cdr face))&#xA;                             ((and (consp (cdr face)) (memq 'foreground-color face))&#xA;                              (cdr (memq 'foreground-color face)))&#xA;                             ((and (consp (cdr face)) (memq ':foreground face))&#xA;                              (cadr (memq ':foreground face)))&#xA;                             (t (cdr (assq 'foreground-color (frame-parameters)))))) ; No fg.&#xA;                      (t nil)))         ; Invalid face value.&#xA;         (fg    (and (not (member fg '(&quot;unspecified-fg&quot; &quot;unspecified-bg&quot;)))  fg)))&#xA;    (when msg-p (if fg (palette-color-message fg t) (message &quot;No foreground color here&quot;)))&#xA;    fg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-09T21:11:17.973" LastActivityDate="2015-05-09T21:11:17.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12279" PostTypeId="1" AcceptedAnswerId="12280" CreationDate="2015-05-09T22:41:58.253" Score="6" ViewCount="4490" Body="&lt;p&gt;I often use registers in &lt;code&gt;evil&lt;/code&gt;, but I have a common use case that I cannot seem to resolve.  I would like to have all copied text stored somewhere that does not get overwritten when I explicitly make another copy to a specific register.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Here is an example:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I want to copy this FIRST line, so I copy it (without explicitly using a register)&lt;/p&gt;&#xA;&lt;p&gt;I later realize that I want to copy this SECOND line as well, and I want to be able paste it separately from the FIRST line, so I copy it to a register (ie register &lt;code&gt;j&lt;/code&gt; via &lt;code&gt;&amp;quot;jVy&lt;/code&gt;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I can easily paste that SECOND line (ie &lt;code&gt;&amp;quot;jp&lt;/code&gt;), but how can I paste the FIRST line? The default register is overwritten by my second copy command (ie &lt;code&gt;&amp;quot;*p&lt;/code&gt; would paste the SECOND line) and my clipboard stores the SECOND line as well (ie &lt;code&gt;p&lt;/code&gt; would paste the SECOND line).&lt;/p&gt;&#xA;&lt;p&gt;In sum, I don't want to explicitly use a register for all of my copy commands - that is too tedious. Is there a &amp;quot;default&amp;quot; register that I can use that is not overwritten when I copy to a specific register? Perhaps I can bind all copy commands to a specific register?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I prefer a solution that uses pure vim/evil commands, so that it is extensible for my other vim editors and vim plugins (ie JetBrains' &lt;code&gt;idea-vim&lt;/code&gt;). I found my solution by using the &lt;code&gt;0&lt;/code&gt; register. In my example above, I can paste the FIRST line by running &lt;code&gt;&amp;quot;0p&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In hindsight, I think this solution would have been better suited for a vim-related forum, but I hope it proves helpful for other Evil-mode users.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-09T23:27:10.890" Title="Evil: Is there a default register that does not get overwritten by later yanks to explicit registers?" Tags="|evil|copy-paste|kill-ring|registers|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12280" PostTypeId="2" ParentId="12279" CreationDate="2015-05-09T23:01:30.737" Score="8" Body="&lt;p&gt;Simply use the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Kill-Ring.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;kill ring&lt;/code&gt;&lt;/a&gt;.  In &lt;code&gt;evil&lt;/code&gt;, your simplest option is to use &lt;code&gt;evil-paste-pop&lt;/code&gt;, bound by default to &lt;code&gt;C-p&lt;/code&gt;.  Here's the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Replace the just-yanked stretch of killed text with a different stretch.&#xA;  This command is allowed only immediatly after a &lt;code&gt;yank&lt;/code&gt;,&#xA;  &lt;code&gt;evil-paste-before&lt;/code&gt;, &lt;code&gt;evil-paste-after&lt;/code&gt; or &lt;code&gt;evil-paste-pop&lt;/code&gt;.&#xA;  This command uses the same paste command as before, i.e., when&#xA;  used after &lt;code&gt;evil-paste-after&lt;/code&gt; the new text is also yanked using&#xA;  &lt;code&gt;evil-paste-after&lt;/code&gt;, used with the same paste-count argument.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Copy the first line (&lt;code&gt;yy&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Copy the second line into your register (&lt;code&gt;&quot;jyy&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Paste (&lt;code&gt;p&lt;/code&gt;), which pastes the second line.&lt;/li&gt;&#xA;&lt;li&gt;Cycle through the kill ring with &lt;code&gt;C-p&lt;/code&gt;, which will switch out your first paste (the second line) with the previous line you copied.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-05-09T23:09:43.957" LastActivityDate="2015-05-09T23:09:43.957" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12281" PostTypeId="2" ParentId="12279" CreationDate="2015-05-09T23:25:07.897" Score="2" Body="&lt;p&gt;I found a solution, which sticks to using the vim registers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use the 0 register. In my example above, I can paste the FIRST line by running &lt;code&gt;&quot;0p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dan's kill-ring answer is also very helpful, and may be preferable for some. I prefer using the &lt;code&gt;0&lt;/code&gt; register above because it keeps consistent with pure vim keybindings, which allows me to use it across other editors that support vim keybindings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also prefer to explicitly paste my first copy with one command, instead of cycling through all of my yanks.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-05-09T23:25:07.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12282" PostTypeId="2" ParentId="3535" CreationDate="2015-05-10T04:04:32.863" Score="1" Body="&lt;p&gt;If you use &lt;code&gt;helm-M-x&lt;/code&gt;, there is no need to type &lt;code&gt;C-h f&lt;/code&gt; to look up commands's documentation, just use &lt;code&gt;C-j&lt;/code&gt; or &lt;code&gt;C-z&lt;/code&gt; while running &lt;code&gt;helm-M-x&lt;/code&gt; to toggle the display of documentation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#9-helm-m-x&quot; rel=&quot;nofollow&quot;&gt;Helm M-x's features&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-05-10T04:04:32.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12284" PostTypeId="1" AcceptedAnswerId="12285" CreationDate="2015-05-10T12:05:04.167" Score="1" ViewCount="1410" Body="&lt;p&gt;I would like to know if it is possible, with a single command from bash, to open a file with &lt;code&gt;emacs -nw&lt;/code&gt;and execute a command in the same time, for example &lt;code&gt;goto-line 20&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7199" LastEditorUserId="25" LastEditDate="2015-05-10T15:37:19.077" LastActivityDate="2021-07-02T20:08:54.693" Title="Open &quot;emacs -nw&quot; and running a command from bash" Tags="|terminal-emacs|command-line-arguments|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12285" PostTypeId="2" ParentId="12284" CreationDate="2015-05-10T13:07:01.157" Score="4" Body="&lt;h3&gt;Generic solution&lt;/h3&gt;&#xA;&lt;p&gt;Here's a generic solution to eval some elisp expression after launching emacs&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval=&amp;quot;SEXP&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For your example, that will be&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs -nw --eval=&amp;quot;(goto-line 20)&amp;quot; FILE &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;em&gt;Also check out  the &lt;code&gt;--load&lt;/code&gt; option from the below referenced link if you want to load an elisp file instead of writing elisp at command line.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h3&gt;Solution specific for opening emacs at a particular position&lt;/h3&gt;&#xA;&lt;p&gt;From the command line, if you want to open a specific FILE and position the cursor at a specific LINE and COL, you would do&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs +LINE:COL FILE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Of course, as you want to jump to a specific line number in terminal mode, you can do&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs -nw +LINE FILE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h3&gt;Reference&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Action-Arguments.html#Action-Arguments&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Manual - Command line Action Args&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2021-07-02T20:08:54.693" LastActivityDate="2021-07-02T20:08:54.693" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="12286" PostTypeId="1" AcceptedAnswerId="12288" CreationDate="2015-05-10T16:54:00.130" Score="14" ViewCount="5157" Body="&lt;p&gt;For example, say I have a list of strings &lt;code&gt;L&lt;/code&gt;, perhaps from an &lt;code&gt;&amp;amp;rest&lt;/code&gt; argument.  What can I do to &lt;code&gt;L&lt;/code&gt; that would have the same effect as the following?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(concat (first L) (second L) ... (last L))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I know &lt;code&gt;mapconcat&lt;/code&gt; would work here for &lt;em&gt;this&lt;/em&gt; example, but I'm looking for a general process.)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-05-10T21:46:18.113" LastActivityDate="2015-05-10T21:46:18.113" Title="Is there a general way to 'expand' a list for to be used as individual arguments to another function?" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12287" PostTypeId="1" AcceptedAnswerId="12303" CreationDate="2015-05-10T16:55:45.637" Score="3" ViewCount="2278" Body="&lt;p&gt;I've been using vim for a while (though I'm only a basic user) and I've been trying out Emacs (specifically spacemacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have remapped &lt;code&gt;H&lt;/code&gt; and &lt;code&gt;L&lt;/code&gt; to go to the start / end of the line by adding the following at the end of &lt;code&gt;~/.emacs.d/spacemacs/config.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;H&quot; &quot;^&quot;)&#xA;(define-key evil-normal-state-map &quot;L&quot; &quot;$&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have other mappings in my &lt;code&gt;.vimrc&lt;/code&gt; that I really want to transfer for familiar functionality, but I'm not sure how to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I have tried adding the following line to &lt;code&gt;~/.emacs.d/spacemacs/config.el&lt;/code&gt; (which doesn't work)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map &quot;jf&quot; &quot;&amp;lt;ESC&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How could I transfer that and the rest of my mappings over to emacs/spacemacs?&lt;/p&gt;&#xA;" OwnerUserId="8277" LastEditorUserId="8967" LastEditDate="2015-07-20T12:13:37.717" LastActivityDate="2015-10-09T16:30:46.933" Title="Re-creating .vimrc key mappings in Emacs" Tags="|key-bindings|keymap|evil|vim-emulation|spacemacs|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12288" PostTypeId="2" ParentId="12286" CreationDate="2015-05-10T17:11:04.747" Score="12" Body="&lt;pre&gt;&lt;code&gt;(apply #'concat '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="2264" LastEditDate="2015-05-10T17:11:21.407" LastActivityDate="2015-05-10T17:11:21.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12289" PostTypeId="2" ParentId="10418" CreationDate="2015-05-10T17:28:31.407" Score="2" Body="&lt;p&gt;I'd try running it under &lt;code&gt;strace&lt;/code&gt;:&#xA;&lt;code&gt;&#xA;strace -o /tmp/yow emacs -Q -nw&#xA;&lt;/code&gt;&#xA;then look at &lt;code&gt;/tmp/yow&lt;/code&gt; and you should get an idea of where it's hanging.&lt;/p&gt;&#xA;" OwnerUserId="786" LastActivityDate="2015-05-10T17:28:31.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12291" PostTypeId="1" AcceptedAnswerId="12292" CreationDate="2015-05-10T17:35:21.443" Score="7" ViewCount="3280" Body="&lt;p&gt;I create the id of the heading (with &lt;code&gt;org-id-copy&lt;/code&gt; function) and somewhere in the file i create link to it: &lt;code&gt;[[id:XXXXXXXXXXXXXXXXXXXXX][name]]&lt;/code&gt;. The problem is that the link works only on the computer i created it. When i move the file to another computer, the link stops working, giving the error:&#xA;&lt;code&gt;No match - create this as new heading? (y/n)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i make it work on another computer? Is there any function to scan all ids and make links work again?&lt;/p&gt;&#xA;" OwnerUserId="4005" LastActivityDate="2022-09-23T16:40:19.320" Title="orgmode: link to id doesn't work" Tags="|org-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12292" PostTypeId="2" ParentId="12291" CreationDate="2015-05-10T19:20:45.783" Score="1" Body="&lt;p&gt;I do not know the answer for your specific question. But alternatively using &lt;code&gt;org-store-link&lt;/code&gt; (I bind it to &lt;code&gt;C-c l&lt;/code&gt;) to store the link to the heading and then insert the link with &lt;code&gt;org-insert-link&lt;/code&gt; (I bind it to &lt;code&gt;C-c C-l&lt;/code&gt;) will do what you want, since &lt;code&gt;org-store-link&lt;/code&gt; will make a link containing the location of the &lt;code&gt;org&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to be able to change the heading names freely, then you can add &lt;code&gt;CUSTOM_ID&lt;/code&gt; property to the target heading and generate a link to it (for example, &lt;code&gt;[[#my_casutom_id]]&lt;/code&gt;). Then you can freely change the heading itself without breaking the link.&lt;/p&gt;&#xA;" OwnerUserId="6807" LastEditorUserId="6807" LastEditDate="2015-05-11T18:42:20.423" LastActivityDate="2015-05-11T18:42:20.423" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12293" PostTypeId="1" AcceptedAnswerId="12442" CreationDate="2015-05-10T19:36:37.513" Score="2" ViewCount="1868" Body="&lt;p&gt;I am trying to set up some keybindings for working with scheme. I have these two mode hooks which contain the bindings I want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'scheme-mode-hook&#xA;          (lambda ()&#xA;            (local-set-key (kbd &quot;C-j&quot;) 'scheme-send-last-sexp)))&#xA;&#xA;(add-hook 'scheme-mode-hook&#xA;          (lambda ()&#xA;            (local-set-key (kbd &quot;C-c C-j&quot;) 'scheme-send-region)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that I also have these hooks defined which I use for elisp:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;paredit&quot;&#xA;  #'(define-key paredit-mode-map (kbd &quot;C-j&quot;) 'eval-last-sexp))&#xA;&#xA;(eval-after-load &quot;paredit&quot;&#xA;  #'(define-key paredit-mode-map (kbd &quot;C-c C-j&quot;) 'eval-region))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is: how can I modify eval-after-load to set up my scheme key bindings only when in Scheme mode?&lt;/p&gt;&#xA;" OwnerUserId="7015" LastEditorUserId="50" LastEditDate="2015-05-16T12:46:47.827" LastActivityDate="2015-05-16T12:46:47.827" Title="mode hooks and eval-after-load" Tags="|key-bindings|hooks|scheme|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12294" PostTypeId="1" AcceptedAnswerId="12297" CreationDate="2015-05-10T19:42:48.543" Score="0" ViewCount="54" Body="&lt;p&gt;Asking this question because it's really hard to Google &amp;quot;emacs customize&amp;quot; and get to the feature.&lt;/p&gt;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/defcustom.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;defcustom&lt;/code&gt; documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You can specify variables using &lt;code&gt;defcustom&lt;/code&gt; so that you and others can then use Emacs’s &lt;code&gt;customize&lt;/code&gt; feature to set their values. (You cannot use customize to write function definitions; but you can write &lt;code&gt;defuns&lt;/code&gt; in your .emacs file. Indeed, you can write any Lisp expression in your .emacs file.)&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;customize&lt;/code&gt; feature depends on the &lt;code&gt;defcustom&lt;/code&gt; macro. Although you can use &lt;code&gt;defvar&lt;/code&gt; or &lt;code&gt;setq&lt;/code&gt; for variables that users set, the defcustom macro is designed for the job.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I haven't been able to figure out what &amp;quot;customize&amp;quot; is from this definition.&lt;/p&gt;&#xA;&lt;p&gt;For completeness I am reading the &lt;a href=&quot;https://github.com/bbatsov/projectile/blob/master/projectile.el#L131&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;projectile.el&lt;/code&gt;&lt;/a&gt; source code where this is used (although I don't really expect the answer to depend on the package).&lt;/p&gt;&#xA;" OwnerUserId="6641" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-10T20:31:29.120" Title="What is the &quot;customize&quot; feature associated with defcustom and used in projectile.el?" Tags="|customize|projectile|defcustom|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12295" PostTypeId="2" ParentId="12286" CreationDate="2015-05-10T19:47:45.310" Score="7" Body="&lt;p&gt;What you wanted to do seems like folding or un-folding of a sequence of objects of the same type.  It is tempting to use &lt;code&gt;apply&lt;/code&gt; for this purpose, because in many cases it will indeed work.  But it's not exactly the right tool for this, and here is why:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;apply&lt;/code&gt; is a meta-programming mechanism, not only that, it is also too general for the task because it can handle sequences of objects of different types, not necessarily calling functions of two arguments.  As a consequence, some times you will get an incorrect behaviour, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply 'concat &quot;baz&quot; '(&quot;foo&quot; &quot;bar&quot;))&#xA; &amp;gt; &quot;bazfoobar&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But intuitively, you'd expect a type mismatch here.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is no way to ensure &lt;code&gt;apply&lt;/code&gt; will be able to process as many arguments as you can give it, it's typically a limit imposed by the language implementation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The function called by &lt;code&gt;apply&lt;/code&gt; will be able to get a reference of the arguments list passed to it in this way.  This is also not obvious, and may lead to errors later:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((test (list 1 2 3)))&#xA;  (cons &#xA;   (apply (lambda (&amp;amp;rest x)&#xA;            (prog1 (cl-reduce '+ x) (setcar x 0)))&#xA;          test)&#xA;   test))&#xA;;; This behaviour is undefined.  Could end up both ways&#xA;&amp;gt; (6 1 2 3)&#xA;&amp;gt; (6 0 2 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the arguments list is copied, then you pay the price of consing more memory than needed, but if it's not copied (passed as is), then you risk spoiling the list, if the function being called modifies it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So, the better way of doing it is to use &lt;code&gt;cl-reduce&lt;/code&gt;.  The benefit is that it was specifically designed to do this kind of tasks.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-reduce 'concat '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;))&#xA;&amp;gt; &quot;foobarbaz&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-05-10T19:47:45.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12296" PostTypeId="1" CreationDate="2015-05-10T20:27:02.903" Score="4" ViewCount="255" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how does one determine how much memory an arbitrary lisp object is consuming?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example use case: I've got a hash table holding lists of strings.  I'm curious about how much memory it's using.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="105" LastEditDate="2022-06-19T17:29:26.020" LastActivityDate="2022-06-19T17:29:26.020" Title="Determine lisp object size in memory?" Tags="|debugging|performance|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12297" PostTypeId="2" ParentId="12294" CreationDate="2015-05-10T20:31:29.120" Score="3" Body="&lt;p&gt;&quot;customize feature&quot; there should probably be written as &quot;Customize feature&quot; or &quot;the Customize user interface&quot; or some such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;code&gt;M-x customize-option&lt;/code&gt; or &lt;code&gt;M-x customize-face&lt;/code&gt; or &lt;code&gt;M-x customize&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Easy Customization&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And remember that the Emacs manual is your friend:&#xA;&lt;code&gt;C-h r i customize RET&lt;/code&gt; takes you to the above part of the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Projectile is normal then you should be able to use &lt;code&gt;M-x customize-group projectile&lt;/code&gt; or &lt;code&gt;M-x customize-option projectile TAB&lt;/code&gt; or some such (depending on what Customize group(s) and prefix Projectile has defined).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-10T20:31:29.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12298" PostTypeId="2" ParentId="12293" CreationDate="2015-05-10T20:36:36.733" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I think you mean &lt;em&gt;set up only my scheme key bindings&lt;/em&gt; instead of &amp;quot;&lt;em&gt;set up my scheme bindings only&lt;/em&gt;&amp;quot;. Otherwise, if you do mean set up the scheme bindings only in Scheme mode then that should already be happening.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If &lt;code&gt;paredit-mode&lt;/code&gt; is a minor mode and &lt;code&gt;scheme-mode&lt;/code&gt; is a major mode then you can't. A minor-mode keymap takes precedence over a major-mode keymap (aka local map).&lt;/p&gt;&#xA;&lt;p&gt;You can put one or the other command on a different key. But if you put both commands on the same key then the minor-mode binding wins.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-10T20:36:36.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12299" PostTypeId="1" AcceptedAnswerId="12301" CreationDate="2015-05-10T21:50:07.023" Score="2" ViewCount="374" Body="&lt;p&gt;I have this Vim command to jump outside any parentheses or quotes or double quotes or bracked, when you're inside a closed region. When I press jj fast, it allows me to jump outside the closed region: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;inoremap jj &amp;lt;Esc&amp;gt;/[)}&quot;'\]&amp;gt;]&amp;lt;CR&amp;gt;:nohl&amp;lt;CR&amp;gt;a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the regular expression begins after &lt;code&gt;&amp;lt;Esc&amp;gt;&lt;/code&gt;. I was missing this in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided to give a try with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(key-chord-define evil-insert-state-map &quot;jj&quot; &#xA;  ;; Escape from capsuled string&#xA;  '(lambda () &#xA;     (interactive) &#xA;     (forward-char 1)&#xA;     (insert &quot; &quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, * is the place of the cursor. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is an another &quot;example of a string *&quot; within this sentence&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pressing the &lt;code&gt;jj&lt;/code&gt; fast allows me to jump outside the string inside the sentence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2 questions:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; It's only working if the cursor is on the last character before the quote. And not in middle for example. How to solve it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; How get it working for single quotes ('), brackets '}', or parentheses ())?. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be really appreciated. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="675" LastEditDate="2015-05-11T06:07:13.850" LastActivityDate="2015-05-22T22:18:34.370" Title="Define a function that jumps outside paired delimiters (including braces, parens and quotes)?" Tags="|elisp|regular-expressions|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12300" PostTypeId="1" CreationDate="2015-05-10T21:52:14.033" Score="1" ViewCount="1334" Body="&lt;p&gt;I'm working on an embedded system and need to limit clang to only the header files of the embedded system code while I'm editing its code. I need to make the following work:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Make sure that company-mode with the clang backend only includes stuff inside the header files of the embedded system.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Make sure that C-c C-e includes system headers of the embedded platform&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In other words, if a file contains &lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/code&gt; it should look into the folder &lt;code&gt;/home/&amp;lt;user&amp;gt;/src/include&lt;/code&gt; and not e.g. &lt;code&gt;/usr/include&lt;/code&gt;. I assume this should be done by making sure that &lt;code&gt;-nobuiltininc&lt;/code&gt; is always passed to clang together with the appropriate &lt;code&gt;-I/home/&amp;lt;user&amp;gt;/src/include&lt;/code&gt;. My question is what should I put in the &lt;code&gt;.dir-locals.el&lt;/code&gt; file under &lt;code&gt;~/src&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8279" LastEditorUserId="253" LastEditDate="2015-05-10T23:00:15.413" LastActivityDate="2020-12-25T17:04:45.543" Title="Setting include file paths for clang in .dir-locals.el" Tags="|company-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12301" PostTypeId="2" ParentId="12299" CreationDate="2015-05-11T01:27:55.380" Score="4" Body="&lt;p&gt;Here is a function I use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-step-out-forward ()&#xA;  &quot;Step forward out of current list or string.&quot;&#xA;  (interactive)&#xA;  (if (nth 3 (syntax-ppss (point)))&#xA;      (progn&#xA;        (forward-char)&#xA;        (while (and (not (eobp)) (nth 3 (syntax-ppss (point))))&#xA;          (forward-char)))&#xA;    (up-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;syntax-ppss&lt;/code&gt; stuff is a bit obtuse, but what it does is get a set of info about your current position in the buffer, the 3rd piece being if you are inside a string.  So if you are, it walks forward until it's out of the string.  There may be a better way to do this, but for an interactive function I find it's good enough.  The &lt;code&gt;up-list&lt;/code&gt; is the easier part, it simply jumps outside the nearest enclosing paren, for whatever is defined to be a paren in the current mode.&lt;/p&gt;&#xA;" OwnerUserId="2316" LastEditorUserId="160" LastEditDate="2015-05-22T22:18:16.163" LastActivityDate="2015-05-22T22:18:16.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12302" PostTypeId="1" CreationDate="2015-05-11T01:56:55.533" Score="19" ViewCount="1953" Body="&lt;p&gt;I generally have a long-running instance of &lt;code&gt;emacs --daemon&lt;/code&gt;, which I connect to with various &lt;code&gt;emacsclient&lt;/code&gt;s. Recently I have started experiencing random crashes. I say &quot;random&quot; because I haven't been able to figure out what causes the crashes. Often it happens e.g. when I leave my work computer over the weekend. However, I also remember at least one time when I started Emacs again after a crash, and it crashed again after a couple hours, during the same session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started an instance with &lt;code&gt;emacs -Q&lt;/code&gt; (and then did &lt;code&gt;M-x server-start&lt;/code&gt;) on my unused laptop, and it has not crashed yet. (Currently it has been: about a week.) One day I had need to use Emacs on that laptop, so I started up a separate session by doing &lt;code&gt;emacs&lt;/code&gt; from a terminal window, and did not start the server. I left that session running, and when I came back a day or two later, I found that it had crashed, giving &lt;code&gt;Segmentation fault&lt;/code&gt;. Thus, it would seem that this is &lt;strong&gt;not&lt;/strong&gt; related to running Emacs in daemon mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would do a binary search of my init file, but due to the randomness of the crashes, it would be a pain to go without much of the functionality I'm used to for an extended amount of time. Also, I wouldn't have a good way to know when I had fixed it, and the crashes weren't occuring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Emacs 24.4, on Debian GNU/Linux 8, and on Ubuntu. (I have used Emacs on Windows before, but &lt;s&gt;didn't use the &lt;code&gt;--daemon&lt;/code&gt;, and&lt;/s&gt; didn't experience any crashes.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How else can I debug these random crashes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I get the same result when I launch Emacs and then do &lt;code&gt;M-x server-start&lt;/code&gt;, and also when I use the Lucid toolkit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran &lt;code&gt;gdb emacs&lt;/code&gt;, and then at the &lt;code&gt;(gdb)&lt;/code&gt; prompt did &lt;code&gt;run&lt;/code&gt;, and this was the output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Starting program: /usr/bin/emacs&#xA;[Thread debugging using libthread_db_enabled]&#xA;Using host libthread_db library &quot;/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.&#xA;Warning: Cannot convert string &quot;-*-courier-medium-r-*-*-*-120-*-*-*-*-io8859-*&quot; to type FontStruct&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that the last line also appears as terminal output when I launch Emacs outside of GDB.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs, I did &lt;code&gt;M-x server-start&lt;/code&gt;, and started work. It didn't crash all day, so I left it running over the weekend. When I got back today, I found Emacs unresponsive, and this additional output in GDB:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Program received signal SIGSEGV, Segmentation fault.&#xA;mark_object (arg=42366066) at alloc.c:5601&#xA;5601    alloc.c: No such file or directory.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that line, control returned to the GDB prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; After building Emacs from source, I again ran it from GDB and did &lt;code&gt;M-x server-start&lt;/code&gt;. Today I again found it unresponsive, and this was the output in GDB:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Starting program: [snip]/emacs-24.5/src/emacs &#xA;[Thread debugging using libthread_db enabled]&#xA;Using host libthread_db library &quot;/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.&#xA;[New Thread 0x7fffee188700 (LWP 20124)]&#xA;[New Thread 0x7fffe7df2700 (LWP 20125)]&#xA;[New Thread 0x7fffe75f1700 (LWP 20126)]&#xA;&#xA;Program received signal SIGSEGV, Segmentation fault.&#xA;mark_object (arg=47086818) at alloc.c:5973&#xA;5973    {&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="675" LastEditorUserId="105" LastEditDate="2015-12-19T21:50:39.193" LastActivityDate="2020-04-10T01:18:11.520" Title="How can I debug random Emacs server crashes?" Tags="|emacsclient|debugging|daemon|" AnswerCount="1" CommentCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="12303" PostTypeId="2" ParentId="12287" CreationDate="2015-05-11T03:13:05.463" Score="5" Body="&lt;p&gt;(This answer is more focused on Spacemacs, so it won't give a general answer about Vim-style mappings in Emacs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you define &lt;code&gt;jf&lt;/code&gt; in the &lt;code&gt;insert-state&lt;/code&gt; map, then you won't be able to insert &lt;code&gt;j&lt;/code&gt; any more. Simulating &lt;code&gt;ESC&lt;/code&gt; in &lt;code&gt;insert-state&lt;/code&gt; by quickly pressing a sequence of keys is a non-trivial task. There are several packages for this, &lt;code&gt;keychord.el&lt;/code&gt; is one of them, I guess it is the best known one but there are some edge cases with evil. So for spacemacs I made &lt;a href=&quot;https://github.com/syl20bnr/evil-escape&quot; rel=&quot;nofollow&quot;&gt;the &lt;code&gt;evil-escape&lt;/code&gt; package&lt;/a&gt; to support the &lt;code&gt;ESC&lt;/code&gt; use case (and much more). You can set the sequence to &lt;code&gt;jf&lt;/code&gt; by setting the variable &lt;code&gt;evil-escape-key-sequence&lt;/code&gt; to &lt;code&gt;&quot;jf&quot;&lt;/code&gt; in the &lt;code&gt;dotspacemacs/init&lt;/code&gt; function of the dotfile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another macro available in Spacemacs to mimic some easy remapping in VimL, it is called &lt;code&gt;evil-map&lt;/code&gt;, the source code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defmacro evil-map (state key seq)&#xA;        &quot;Map for a given STATE a KEY to a sequence SEQ of keys.&#xA;Can handle recursive definition only if KEY is the first key of SEQ.&#xA;Example: (evil-map visual \&quot;&amp;lt;\&quot; \&quot;&amp;lt;gv\&quot;)&quot;&#xA;        (let ((map (intern (format &quot;evil-%S-state-map&quot; state))))&#xA;          `(define-key ,map ,key&#xA;             (lambda ()&#xA;               (interactive)&#xA;               ,(if (string-equal key (substring seq 0 1))&#xA;                    `(progn&#xA;                       (call-interactively ',(lookup-key evil-normal-state-map key))&#xA;                       (execute-kbd-macro ,(substring seq 1)))&#xA;                  (execute-kbd-macro ,seq))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It can handle some recursive remapping. For now it is only used for the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; Keep the region active when shifting&#xA;  (evil-map visual &quot;&amp;lt;&quot; &quot;&amp;lt;gv&quot;)&#xA;  (evil-map visual &quot;&amp;gt;&quot; &quot;&amp;gt;gv&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="167" LastEditorUserId="8967" LastEditDate="2015-07-20T12:13:54.033" LastActivityDate="2015-07-20T12:13:54.033" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12304" PostTypeId="1" CreationDate="2015-05-11T04:50:28.787" Score="3" ViewCount="127" Body="&lt;p&gt;I am using these commands in order to customize the height and the width of the Emacs frames when it starts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(height . 50))&#xA;(add-to-list 'default-frame-alist '(width . 120))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My goal was to have Emacs use all the available height of my screen. The problem is that up to height 50 (circa) the frame is getting bigger as expected but from that point on it stops, although its height hasn't reached the maximum, as you can see in the image below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/obvMc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the start-up I can maximize it with the mouse. Why is that happening and after a number the frames can't even reach their maximum? How can I make it cover the whole screen's height?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2015-05-11T05:19:26.353" LastActivityDate="2015-05-11T05:19:26.353" Title="Emacs frames can't cover the screen's height" Tags="|frames|" AnswerCount="0" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="12305" PostTypeId="2" ParentId="12299" CreationDate="2015-05-11T05:27:55.560" Score="3" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun ar-leave-delimited-forward ()&#xA;  &quot;Go one char beyond string, paren, bracket etc. &quot;&#xA;  (interactive)&#xA;  (ar-beginn-of-delimited)&#xA;  (forward-sexp))&#xA;&#xA;(defun ar-beginn-of-delimited ()&#xA;  &quot;Go to beginn of a string or parentized/braced/bracketed. &quot;&#xA;  (let ((pps (parse-partial-sexp (point-min) (point))))&#xA;    (cond&#xA;     ((nth 3 pps)&#xA;      (goto-char (nth 8 pps)))&#xA;     ((nth 1 pps)&#xA;      (goto-char (nth 1 pps))))))    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Code is developed here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-berlin/leave-delimited/blob/master/leave-delimited.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-berlin/leave-delimited/blob/master/leave-delimited.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which provides also an &lt;code&gt;ar-leave-delimited-backward&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="160" LastEditDate="2015-05-22T22:18:34.370" LastActivityDate="2015-05-22T22:18:34.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12306" PostTypeId="1" AcceptedAnswerId="12307" CreationDate="2015-05-11T06:52:45.657" Score="5" ViewCount="317" Body="&lt;p&gt;I use &lt;code&gt;m-x eval-expression&lt;/code&gt; to evaluate a very simple lisp code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ( + 1 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I got my result like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HglWs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does the symbols &lt;code&gt;(#o4, #x4, ?\C-d)&lt;/code&gt; mean in this context?&lt;/p&gt;&#xA;" OwnerUserId="169" LastActivityDate="2015-06-15T12:13:48.973" Title="What does &quot;(#o4, #x4, ?\C-d)&quot; mean here?" Tags="|eval-expression|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12307" PostTypeId="2" ParentId="12306" CreationDate="2015-05-11T06:59:14.233" Score="8" Body="&lt;p&gt;These are alternative representations of an integer with their reader literals for octal, hexadecimal and char notation.  In other words, evaluating the octal number &lt;code&gt;#o4&lt;/code&gt;, hexadecimal number &lt;code&gt;#x4&lt;/code&gt; or char &lt;code&gt;?\C-d&lt;/code&gt; yields 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: FWIW, this behaviour seems to be &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20691&quot; rel=&quot;nofollow&quot;&gt;a bug&lt;/a&gt; and should be fixed on master (and hopefully become part of the upcoming 25.1 release).&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-06-15T12:13:48.973" LastActivityDate="2015-06-15T12:13:48.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12308" PostTypeId="1" CreationDate="2015-05-11T10:21:54.280" Score="3" ViewCount="1230" Body="&lt;p&gt;I have a frequently opened file in Emacs, which is deep inside my device. I want to bind the F5 key(or any other key) to open that file, how can I do that?&#xA;(Using android to run emacs. [GNURoot, Wheezy. ])&lt;/p&gt;&#xA;" OwnerUserId="8282" LastEditorUserId="105" LastEditDate="2019-01-14T03:51:00.343" LastActivityDate="2019-01-14T03:51:00.343" Title="How to create a keybinding to a file in Emacs?" Tags="|key-bindings|files|find-file|android|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="12309" PostTypeId="2" ParentId="12308" CreationDate="2015-05-11T10:44:55.797" Score="2" Body="&lt;p&gt;One way of doing could be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; quickly open some files&#xA;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt; h&quot;) (lambda () (interactive) (find-file &quot;~/.emacs.d/lisp/init_hooks.el&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another way of doing:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ido) ; part of emacs&#xA;&#xA;(defvar xah-filelist nil &quot;alist for files i need to open frequently. Key is a short abbrev string, Value is file path string.&quot;)&#xA;&#xA;(setq xah-filelist&#xA;      '(&#xA;        (&quot;3emacs&quot; . &quot;~/web/ergoemacs_org/emacs/blog.html&quot; )&#xA;        (&quot;4code&quot; . &quot;~/web/xahlee_info/comp/blog.html&quot; )&#xA;        (&quot;keys&quot; . &quot;~/git/xah_emacs_init/xah_emacs_keybinding.el&quot; )&#xA;        (&quot;download&quot; . &quot;~/Downloads/&quot; )&#xA;        (&quot;pictures&quot; . &quot;~/Pictures/&quot; )&#xA;        ;; more here&#xA;        ) )&#xA;&#xA;(defun xah-open-file-fast ()&#xA;  &quot;Prompt to open a file from `xah-filelist'.&#xA;URL `http://ergoemacs.org/emacs/emacs_hotkey_open_file_fast.html'&#xA;Version 2015-04-23&quot;&#xA;  (interactive)&#xA;  (let ((ξabbrevCode&#xA;         (ido-completing-read &quot;Open:&quot; (mapcar (lambda (ξx) (car ξx)) xah-filelist))))&#xA;    (find-file (cdr (assoc ξabbrevCode xah-filelist)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_hotkey_open_file_fast.html&quot; rel=&quot;nofollow&quot;&gt;ErgoEmacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="115" LastEditDate="2015-05-11T13:03:19.713" LastActivityDate="2015-05-11T13:03:19.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12310" PostTypeId="1" CreationDate="2015-05-11T11:02:44.023" Score="2" ViewCount="518" Body="&lt;p&gt;I want &lt;code&gt;ediff&lt;/code&gt; to use &lt;code&gt;split-window-sensibly&lt;/code&gt; so it will stack the diffs on top/bottom when the window is narrow, but side-by-side when the window is wide. I'd like to use a single frame instead of the overlay help window (&lt;code&gt;ediff-setup-windows-plain&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I set these two settings in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ediff-split-window-function 'split-window-sensibly)&#xA;(setq ediff-window-setup-function 'ediff-setup-windows-plain)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;M-x vc-ediff&lt;/code&gt; in a git-controlled and modified file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;ediff&lt;/code&gt; fails to display the top window. Only the help buffer and buffer &lt;code&gt;B&lt;/code&gt; are displayed (with diff highlighting and &lt;code&gt;ediff&lt;/code&gt; keybindings). As far as I can tell, all I can do to fix this is to use &lt;code&gt;ediff-setup-windows-multiframe&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24 on Ubuntu (I'm also using spacemacs, but I reproduced without my &lt;code&gt;.emacs.d&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what I can do? I'm not even sure where I'd report a bug (emacs bug, ediff bug, already fixed bug?).&lt;/p&gt;&#xA;" OwnerUserId="8283" LastEditorUserId="115" LastEditDate="2015-05-11T14:47:54.417" LastActivityDate="2015-05-11T14:47:54.417" Title="How do I use split-window-sensibly with ediff-setup-windows-plain together?" Tags="|window|ediff|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12311" PostTypeId="1" AcceptedAnswerId="12317" CreationDate="2015-05-11T12:18:02.603" Score="1" ViewCount="92" Body="&lt;p&gt;I'm using &lt;code&gt;prettify-symbols-mode&lt;/code&gt; with this basic setting:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq prettify-symbols-alist&#xA;      '((&quot;lambda&quot; . ?λ)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I'm before the lambda, and e.g. the point is 50, and I press&#xA;&lt;kbd&gt;C-f&lt;/kbd&gt;, the point will increase by 6 to 56.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in the same situation &lt;code&gt;(call-interactively 'forward-char)&lt;/code&gt; will advance the point only by 1.  What am I missing here? I'd like &lt;code&gt;(call-interactively 'forward-char)&lt;/code&gt; to advance the point by 6.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-11T13:28:39.850" Title="forward-char and prettify-symbols-mode interaction" Tags="|elisp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12312" PostTypeId="1" AcceptedAnswerId="12318" CreationDate="2015-05-11T12:33:52.943" Score="4" ViewCount="507" Body="&lt;p&gt;I often use isearch (&lt;code&gt;C-s&lt;/code&gt; normally or &lt;code&gt;/&lt;/code&gt; in evil) and then want to use that query (or part of it) for replacing. &lt;a href=&quot;https://emacs.stackexchange.com/a/8146/8283&quot;&gt;This answer&lt;/a&gt; explains how to cycle history, but &lt;code&gt;M-p&lt;/code&gt; cycles the history for each mode &lt;em&gt;separately&lt;/em&gt; so I don't see isearch queries from query-replace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, the query I used for either search is automatically saved and I can use a key binding to insert the query into a buffer or minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: search for &quot;fib-function&quot;, &lt;code&gt;C-h f&lt;/code&gt; and insert &quot;fib-function&quot; for help, or helm-do-grep to search for it in files, or just insert it into the current file to start defining it.&lt;/p&gt;&#xA;" OwnerUserId="8283" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-05-11T14:15:17.380" Title="How to combine the history of isearch and query-replace?" Tags="|isearch|query-replace|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12313" PostTypeId="2" ParentId="12308" CreationDate="2015-05-11T12:49:15.537" Score="3" Body="&lt;p&gt;Try bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;visit the file&lt;/li&gt;&#xA;&lt;li&gt;add a bookmark to it with &lt;code&gt;C-x r m&lt;/code&gt; or by running &lt;code&gt;bookmark-set&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;jump to the bookmark at any time with &lt;code&gt;C-x r b&lt;/code&gt; (&lt;code&gt;M-x bookmark-jump&lt;/code&gt;) or display a list of all your bookmarks with &lt;code&gt;C-x r l&lt;/code&gt; (&lt;code&gt;M-x bookmark-bmenu-list&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can, of course, also bind &lt;code&gt;F5&lt;/code&gt; (or any other key) to a function that calls &lt;code&gt;bookmark-jump&lt;/code&gt; with a given bookmark name.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-05-11T12:49:15.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12314" PostTypeId="2" ParentId="12308" CreationDate="2015-05-11T12:58:05.553" Score="0" Body="&lt;p&gt;I'm using bookmarks for this purpose, together with the &lt;code&gt;headlong&lt;/code&gt; package (to select the bookmark much faster). See &lt;a href=&quot;http://oremacs.com/2015/01/06/rushing-headlong/&quot; rel=&quot;nofollow&quot;&gt;my blog post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One cool feature that I recently added to my config is &lt;code&gt;ido-use-virtual-buffers&lt;/code&gt; / &lt;code&gt;ivy-use-virtual-buffers&lt;/code&gt;: if you set them to t, then &lt;code&gt;ido-switch-buffer&lt;/code&gt; / &lt;code&gt;ivy-switch-buffer&lt;/code&gt; will actually use all your bookmarks.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-11T12:58:05.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12315" PostTypeId="1" AcceptedAnswerId="12379" CreationDate="2015-05-11T13:23:00.707" Score="3" ViewCount="875" Body="&lt;p&gt;I use helm-M-x and helm-descbinds to show functions and keybindings I can execute. I would like to be able to see the help for a function without having to ESC, C-h f, retype function. (Like &lt;a href=&quot;https://emacs.stackexchange.com/a/3538/8283&quot;&gt;this answer for smex&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Defining a key as part of helm-map (even after emacs has loaded) doesn't work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;C-u&quot;) 'describe-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;helm: Error: Trying to run helm within a running helm session&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Running describe-function from M-x opens helm.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-3&quot; rel=&quot;nofollow noreferrer&quot;&gt;This helm intro&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If helm-mode is activated... &lt;code&gt;C-h f&lt;/code&gt;, which runs describe-function, automatically takes the symbol at point as default for searching function.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does that mean &lt;code&gt;C-h f&lt;/code&gt; should work in the helm minibuffer? Or is it referring to other functionality?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I invoke other commands on the helm results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I use spacemacs on Emacs 24, but I don't think that matters?&lt;/p&gt;&#xA;" OwnerUserId="8283" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-05-16T15:51:11.203" Title="How to get help from Helm-M-x?" Tags="|helm|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12316" PostTypeId="2" ParentId="12296" CreationDate="2015-05-11T13:23:09.743" Score="2" Body="&lt;p&gt;How to determine the size?  By looking at the C source code whee those objects are defined (e.g. &lt;code&gt;src/lisp.h&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IIRC in the case of a hash-table, you should count more or less 6 words (32 or 64bit, depending on your system) per element in the hash-table.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-11T13:23:09.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12317" PostTypeId="2" ParentId="12311" CreationDate="2015-05-11T13:28:39.850" Score="2" Body="&lt;p&gt;I think the answer is simple: &lt;code&gt;forward-char&lt;/code&gt; always only advances by 1 char.  It's the top-level read-eval-loop which then advances an extra 5 chars to move point away from the inside of the composed text.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-11T13:28:39.850" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12318" PostTypeId="2" ParentId="12312" CreationDate="2015-05-11T14:15:17.380" Score="6" Body="&lt;p&gt;Customize option &lt;code&gt;query-replace-from-history-variable&lt;/code&gt; (or &lt;code&gt;query-replace-to-history-variable&lt;/code&gt;, or both).  Point to &lt;code&gt;search-ring&lt;/code&gt; or &lt;code&gt;regexp-search-ring&lt;/code&gt; instead of &lt;code&gt;query-replace-history&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-11T14:15:17.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12319" PostTypeId="2" ParentId="12299" CreationDate="2015-05-11T14:40:56.427" Score="0" Body="&lt;p&gt;I previously posted this as a comment, but I think this tip is useful enough to warrant an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, in Lisp, code is organized into nested lists, or trees, of s-expressions. To jump &quot;outside a delimiter&quot; is then analogous to moving &quot;up&quot; the list/tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;https://github.com/odyssomay/paredit&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;paredit&lt;/code&gt;&lt;/a&gt; you can use the commands &lt;code&gt;sp-up-sexp&lt;/code&gt;/&lt;code&gt;paredit-forward-up&lt;/code&gt; (bound to &lt;code&gt;C-M-n&lt;/code&gt;) to move up the tree. It should work in any major mode as long as &lt;code&gt;smartparens&lt;/code&gt; or &lt;code&gt;paredit&lt;/code&gt; is active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following tree of sexps, where the cursor is a pipe:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define (greet-someone name) &#xA;  (apply string-append `(&quot;Hello, |&quot; ,name &quot;!\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Repeatedly pressing &lt;code&gt;C-M-n&lt;/code&gt; take you outside the quotes, then outside the quasiquote, then outside the &lt;code&gt;(apply ...)&lt;/code&gt; expression, then outside the entire &lt;code&gt;define&lt;/code&gt;. Pressing &lt;code&gt;C-M-p&lt;/code&gt; (&lt;code&gt;sp&lt;/code&gt;/&lt;code&gt;paredit-backward-down&lt;/code&gt;) will do the same thing in reverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Along with these &quot;up&quot; commands, there are also commands to go in the opposite directions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-M-d&lt;/code&gt;: &lt;code&gt;down-list&lt;/code&gt;/&lt;code&gt;sp-down-sexp&lt;/code&gt;/&lt;code&gt;paredit-forward-down&lt;/code&gt; &lt;code&gt;C-M-u&lt;/code&gt;: &lt;code&gt;up-list&lt;/code&gt;/&lt;code&gt;sp-backward-up-sexp&lt;/code&gt;/&lt;code&gt;paredit-backward-up&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These commands are extremely useful for navigating (especially in Lisp), but I don't see them mentioned a lot, at least relative to their value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There are also built-in commands &lt;code&gt;forward-list&lt;/code&gt; and &lt;code&gt;backward-list&lt;/code&gt; but they don't work in as many cases and the &lt;code&gt;smartparens&lt;/code&gt;/&lt;code&gt;paredit&lt;/code&gt; ones do.)&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="160" LastEditDate="2015-05-22T22:18:25.617" LastActivityDate="2015-05-22T22:18:25.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12320" PostTypeId="1" AcceptedAnswerId="12324" CreationDate="2015-05-11T14:53:57.603" Score="1" ViewCount="354" Body="&lt;p&gt;I have this code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(minibuffer-with-setup-hook&#xA;    #'ivy--minibuffer-setup&#xA;  (read-from-minibuffer&#xA;   ;; ...&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works fine unless the code is called when already in the minibuffer. In that case &lt;code&gt;ivy--minibuffer-setup&lt;/code&gt; isn't called.  Is there a way to achieve what I want: while in minibuffer, call &lt;code&gt;read-from-minibuffer&lt;/code&gt; and call some code after the recursive minibuffer is entered?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2015-07-11T04:47:52.653" LastActivityDate="2015-07-11T04:47:52.653" Title="Is there a hook for a recursive minibuffer setup?" Tags="|elisp|hooks|minibuffer|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12321" PostTypeId="2" ParentId="12266" CreationDate="2015-05-11T14:56:09.087" Score="2" Body="&lt;p&gt;Here's an attempt at defining a custom &lt;code&gt;kill-sentence-dwim&lt;/code&gt; command that will either kill the entire sentence or kill up to the sentence-ending punctuation.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/forward-to-sentence-end ()&#xA;  &quot;Move point to just before the end of the current sentence.&quot;&#xA;  (forward-sentence)&#xA;  (backward-char)&#xA;  (unless (looking-back &quot;[[:alnum:]]&quot;)&#xA;    (backward-char)))&#xA;&#xA;(defun my/beginning-of-sentence-p ()&#xA;  &quot;Return  t if point is at the beginning of a sentence.&quot;&#xA;  (let ((start (point))&#xA;        (beg (save-excursion (forward-sentence) (forward-sentence -1))))&#xA;    (eq start beg)))&#xA;&#xA;(defun my/kill-sentence-dwim ()&#xA;  &quot;Kill the current sentence up to and possibly including the punctuation.&#xA;When point is at the beginning of a sentence, kill the entire&#xA;sentence. Otherwise kill forward but preserve any punctuation at the sentence end.&quot;&#xA;  (interactive)&#xA;  (if (my/beginning-of-sentence-p)&#xA;      (progn&#xA;        (kill-sentence)&#xA;        (just-one-space)&#xA;        (when (looking-back &quot;^[[:space:]]+&quot;) (delete-horizontal-space)))&#xA;      (kill-region (point) (progn (my/forward-to-sentence-end) (point)))&#xA;      (just-one-space 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind &lt;code&gt;my/kill-sentence-dwim&lt;/code&gt; to a key binding of your choice. If you want to replace the existing &lt;code&gt;kill-sentence&lt;/code&gt; binding you could use this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key (current-global-map) [remap kill-sentence] 'my/kill-sentence-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A couple notes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead of just assuming a period, &lt;code&gt;my/forward-to-sentence-end&lt;/code&gt; moves to the end of the sentence and then backs up to just after the last alphanumeric character. That should preserve any closing punctuation including any quotes or parens. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm checking whether point is at the beginning of the sentence by calling &lt;code&gt;forward-sentence&lt;/code&gt; to jump to the end and then back to the beginning, then seeing if point changed. Not sure how reliable this will be but it seems correct in the simple cases I tried. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As requested in the comments, this kill command also attempts to fix up whitespace. When deleting a partial sentence it removes whitespace before the ending punctuation. When deleting an entire sentence it leaves one space between sentences or no spaces at the beginning of the line. There will likely still be edge cases...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastEditorUserId="675" LastEditDate="2015-05-12T18:59:55.717" LastActivityDate="2015-05-12T18:59:55.717" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="12322" PostTypeId="2" ParentId="12254" CreationDate="2015-05-11T15:58:16.427" Score="2" Body="&lt;p&gt;Format &lt;code&gt;text/plain&lt;/code&gt; should not have long lines — wrapping is only allowed for &lt;code&gt;text/plain; format=flowed&lt;/code&gt;.  Unfortunately, while Apple did get it correct in previous versions, recent versions of Apple's &lt;code&gt;Mail.app&lt;/code&gt; tend to send &lt;code&gt;text/plain&lt;/code&gt; with long lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I work around this with the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wl-summary-refill-message ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (wl-summary-set-message-buffer-or-redisplay)&#xA;    (goto-char (point-min))&#xA;    (re-search-forward &quot;^$&quot;)&#xA;    (while (looking-at &quot;^$&quot;)&#xA;      (forward-line 1))&#xA;    (let ((buffer-read-only nil))&#xA;      (fill-region (point) (point-max)))))&#xA;&#xA;(define-key wl-summary-mode-map &quot;\M-q&quot; 'wl-summary-refill-message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I encounter an incorrect message, I type &lt;code&gt;M-q&lt;/code&gt; in the summary buffer, which wraps the text.  The wrapped message will get cached, so the wrapping will persist if you come back to the message.  You can undo the wrapping with &lt;code&gt;C-u .&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-05-11T15:58:16.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12323" PostTypeId="2" ParentId="10975" CreationDate="2015-05-11T17:19:33.010" Score="0" Body="&lt;p&gt;The highlighting is applied to the whole line, thus if the highlight face has a background, it will override all other backgrounds. The other themes only work because they use the face's foreground attribute instead of the background like the default face does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An easy fix would be to change the diff faces such that they represent adds and removals by using a foreground color instead of a background color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead of this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/v2Zap.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZRLDe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and thus the green still shows when highlighted:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wmc8p.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this do customize the faces appropriately:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-faces  &#xA; '(diff-added ((t (:foreground &quot;#149914&quot; :background nil :inherit nil))))&#xA; '(diff-removed ((t (:foreground &quot;#991414&quot; :background nil :inherit nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the magit diff faces inherit from the core diff faces, so I just modified those. If you want to change how magit displays diffs but not the rest of emacs, modify the &lt;code&gt;magit-diff-add&lt;/code&gt; and &lt;code&gt;magit-diff-del&lt;/code&gt; faces instead.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-05-11T17:19:33.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12324" PostTypeId="2" ParentId="12320" CreationDate="2015-05-11T17:25:47.347" Score="2" Body="&lt;p&gt;Perhaps it is this part of the &lt;code&gt;minibuffer-with-setup-hook&lt;/code&gt; macro code?  It apparently removes the hook for recursive calls.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(lambda ()&#xA;  ;; Clear out this hook so it does not interfere&#xA;  ;; with any recursive minibuffer usage.&#xA;  (remove-hook 'minibuffer-setup-hook ,hook)&#xA;  (funcall ,fun))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try doing without &lt;code&gt;minibuffer-with-setup-hook&lt;/code&gt; and just doing the &lt;code&gt;add-hook&lt;/code&gt; and &lt;code&gt;remove-hook&lt;/code&gt; (at the end) yourself.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-11T17:25:47.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12325" PostTypeId="1" CreationDate="2015-05-11T18:32:55.283" Score="11" ViewCount="893" Body="&lt;p&gt;Suppose that I have this function, that inserts some stuff into the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun foobar ()&#xA;  (interactive)&#xA;  (minibuffer-with-setup-hook&#xA;      (lambda ()&#xA;        (let ((resize-mini-windows t))&#xA;          (save-excursion&#xA;            (insert &quot;foo\nbar&quot;)&#xA;            (fit-window-to-buffer))))&#xA;    (read-from-minibuffer &quot;string: &quot;)))&#xA;(global-set-key (kbd &quot;M-RET&quot;) 'foobar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works fine if I call it from any buffer, except when I'm already in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I eval &lt;code&gt;(read-from-minibuffer &quot;test: &quot;)&lt;/code&gt;, and then press &lt;kbd&gt;M-RET&lt;/kbd&gt;, my minibuffer becomes &lt;code&gt;string: foo&lt;/code&gt; (note the 1 line height). After I press any character, I see that &lt;code&gt;bar&lt;/code&gt; is also in the minibuffer.  The problem is that the minibuffer height won't update until I press any character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does this happen and how to get around it?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2016-08-14T21:09:46.263" LastActivityDate="2016-08-14T21:09:46.263" Title="How to immediately resize the minibuffer window?" Tags="|window|minibuffer|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12326" PostTypeId="1" AcceptedAnswerId="12330" CreationDate="2015-05-11T19:35:34.713" Score="4" ViewCount="283" Body="&lt;h3&gt;Background&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;With jumping packages like Ace and Avy, you can start a function, provide a query char, and then jump to somewhere based on further input. (Lately I've preferred Avy, but that's irrelevant here.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have had both bound to &lt;code&gt;C-' C-;&lt;/code&gt; (with other jumping functions bound to the home row) so that I can just hold control and fire off the sequence. It's very distracting though to have to lift my finger off control to input a 'plain' character for &lt;code&gt;read-char&lt;/code&gt; to read.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Question&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;How can I strip all modifier keys off a &lt;code&gt;read-char&lt;/code&gt;-returned key code?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="25" LastEditDate="2015-06-07T21:12:59.030" LastActivityDate="2015-06-07T21:12:59.030" Title="How can I convert a C-key code into a 'normal' key code?" Tags="|key-bindings|keystrokes|events|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12327" PostTypeId="1" AcceptedAnswerId="12348" CreationDate="2015-05-11T20:11:48.490" Score="4" ViewCount="93" Body="&lt;p&gt;I would like to have a workflow where I could make my &lt;kbd&gt;F9&lt;/kbd&gt; key open up a shell in a split pane, and then have the same key effectively do a &lt;code&gt;C-x 0&lt;/code&gt; on it. That way I could split, run a command, do some stuff, and go back to the file I was editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt at this has some problems:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun split-shell-toggle ()&#xA;  (interactive)&#xA;  (split-window-below)&#xA;  (eshell))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'split-shell-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In particular, I need to modify the function to check if the pane is visible, and then close the pane if it is. Right now I get this kind of thing: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/T0rWW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It keeps splitting again and again. How can I check if the pane is already open, and close it if it is?&lt;/p&gt;&#xA;" OwnerUserId="8264" LastActivityDate="2015-05-12T17:53:26.577" Title="Open pane temporarily with function key" Tags="|key-bindings|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12330" PostTypeId="2" ParentId="12326" CreationDate="2015-05-11T21:29:46.030" Score="4" Body="&lt;p&gt;I think you want &lt;code&gt;event-basic-type&lt;/code&gt;.  E.g. &lt;code&gt;(event-basic-type ?\C-;)&lt;/code&gt; returns &lt;code&gt;?;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to only stop the &lt;code&gt;control&lt;/code&gt; modifier but keep the other modifiers (e.g. the shift modifier), then you can try something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;(defun my-strip-control (event)&#xA;  (event-convert-list&#xA;   (append (cl-set-difference (event-modifiers event)&#xA;                              '(control click))&#xA;           (list (event-basic-type event)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-05-11T22:08:30.593" LastActivityDate="2015-05-11T22:08:30.593" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12331" PostTypeId="1" CreationDate="2015-05-12T00:27:14.703" Score="5" ViewCount="644" Body="&lt;p&gt;With &lt;code&gt;ido-find-file&lt;/code&gt;, if the file I am looking is not in current directory but in the parents directory, it can automatically find it as candidate. I am not sure if &lt;code&gt;helm&lt;/code&gt; can do the same thing?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2017-09-04T12:12:02.320" Title="Can helm `find-file` in the parents directory automatically?" Tags="|helm|ido|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12332" PostTypeId="1" CreationDate="2015-05-12T01:52:46.883" Score="1" ViewCount="94" Body="&lt;p&gt;I'm learning to program with buffer local variables. The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Intro-to-Buffer_002dLocal.html#Intro-to-Buffer_002dLocal&quot; rel=&quot;nofollow&quot;&gt;emacs documentation&lt;/a&gt; describes buffer local variables as:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A buffer-local variable has a buffer-local binding associated with a particular buffer. The binding is in effect when that buffer is current; otherwise, it is not in effect. If you set the variable while a buffer-local binding is in effect, the new value goes in that binding, so its other bindings are unchanged. This means that the change is visible only in the buffer where you made it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How does a buffer-local binding go into effect? This is an amateurish question. I assume it has something to do with the buffer being loaded, but I can't begin to imagine what this looks like in code.&lt;/p&gt;&#xA;" OwnerUserId="6641" LastEditorUserId="105" LastEditDate="2015-05-20T05:10:46.423" LastActivityDate="2015-05-20T05:10:46.423" Title="How do buffer local bindings go into effect?" Tags="|elisp|buffer-local|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12333" PostTypeId="2" ParentId="12332" CreationDate="2015-05-12T02:19:34.343" Score="3" Body="&lt;p&gt;Not exactly sure what the question is, but this might help.  It's hard to add to what is said in the doc section you cite - I think that section describes the situation well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A buffer is in a (major) mode.  When the major mode is turned on (becomes active), one of the things that happens (by the major-mode function's code) is that all (buffer) local variables are killed (using &lt;code&gt;kill-all-local-variables&lt;/code&gt;). That clears the slate. (That's not directly important to the question, but it is important to realize, in general.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code that is &lt;em&gt;executed while the given buffer is current&lt;/em&gt; sets the (buffer) local value of a variable by first declaring the variable to be buffer local, using &lt;code&gt;make-local-variable&lt;/code&gt;. E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-local-variable 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, whenever that buffer is current and you set that variable, it is the buffer-local value that gets set.  E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo 42)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;make-local-variable&lt;/code&gt; returns the variable, so you often see the two operations combined in one sexp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'foo) 42)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A different declaration, &lt;code&gt;make-variable-buffer-local&lt;/code&gt; declares a variable to become local to every buffer where it is set.  So if you do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-variable-buffer-local 'bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then whenever &lt;code&gt;bar&lt;/code&gt; is given a value, that value is local to the buffer that is current when the setting takes place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I feel, without looking, that I am no doubt repeating what the doc says, using other words.  Dunno what else to say, to make things clear.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-12T02:25:01.003" LastActivityDate="2015-05-12T02:25:01.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12334" PostTypeId="1" AcceptedAnswerId="12335" CreationDate="2015-05-12T02:20:52.857" Score="27" ViewCount="4087" Body="&lt;p&gt;Say, I have some code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-function ()&#xA;  (interactive)&#xA;  ;; do something&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want &lt;code&gt;some-function&lt;/code&gt; to operate only on the selected region in&#xA;the buffer ? How can I do that ? Also, can there be two separate code&#xA;path for doing something if I have selected some region and doing&#xA;something else If I haven't selected.&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="105" LastEditDate="2016-09-21T19:42:13.537" LastActivityDate="2024-01-02T22:40:06.750" Title="Elisp for applying command to only the selected region" Tags="|region|interactive|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12335" PostTypeId="2" ParentId="12334" CreationDate="2015-05-12T02:39:21.117" Score="36" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun some-function (beginning end)&#xA;  (interactive &amp;quot;r&amp;quot;)&#xA;  (if (use-region-p)&#xA;      (message &amp;quot;The region is active, and is from %d to %d&amp;quot; beginning end)&#xA;    (message &amp;quot;The region is still there (from % d to %d), but it is inactive&amp;quot; &#xA;             beginning end)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The use of &lt;code&gt;(interactive &amp;quot;r&amp;quot;)&lt;/code&gt; means that the parameters &lt;code&gt;beginning&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; will automatically receive the values of the region beginning and the region end, respectively, when the function is invoked. (You can also get those values anytime using the functions &lt;code&gt;region-beginning&lt;/code&gt; and &lt;code&gt;region-end&lt;/code&gt;, respectively.)&lt;/p&gt;&#xA;&lt;p&gt;The region is always present (if there is a mark in the current buffer), but you might not think it is.  The region is &lt;strong&gt;active&lt;/strong&gt; when it is highlighted (text is selected). You can test whether the region is active using predicate &lt;code&gt;region-active-p&lt;/code&gt;.  But the better test is usually &lt;code&gt;use-region-p&lt;/code&gt;, because (by default) it returns true (non-&lt;code&gt;nil&lt;/code&gt;) only when the region is both active and nonempty (point and mark are different).&lt;/p&gt;&#xA;&lt;p&gt;Originally, there was no highlighting of the region.  And for a long time, even though highlighting was available, it was not the default behavior.  For highlighting to occur, you must have &lt;code&gt;transient-mark-mode&lt;/code&gt; turned on (or turned on at least temporarily). By default, &lt;code&gt;transient-mark-mode&lt;/code&gt; is turned on in recent Emacs versions.&lt;/p&gt;&#xA;&lt;p&gt;It's helpful to look at the definition of predicate &lt;code&gt;use-region-p&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun use-region-p ()&#xA;  (and (region-active-p)&#xA;       (or use-empty-active-region&#xA;           (&amp;gt; (region-end) (region-beginning)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;use-empty-active-region&lt;/code&gt; is a user option, whose default value is &lt;code&gt;nil&lt;/code&gt; (false), meaning that by default &lt;code&gt;use-region-p&lt;/code&gt; will not return true if the region is empty.  In that case, for it to return true, the end of the region must be greater than the beginning (the behavior I described above).&lt;/p&gt;&#xA;&lt;p&gt;And if we look at the definition of &lt;code&gt;region-active-p&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun region-active-p ()&#xA;  (and transient-mark-mode&#xA;       mark-active&#xA;       (mark)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We see that it returns true (non-&lt;code&gt;nil&lt;/code&gt;) when all of these are true:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;transient-mark-mode&lt;/code&gt; is turned on.&lt;/li&gt;&#xA;&lt;li&gt;The mark is active (&lt;code&gt;mark-active&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;There is a mark in the current buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The mark being active is really what the region being active is all about.  When it is active, assuming that &lt;code&gt;transient-mark-mode&lt;/code&gt; is on and there is a mark in the current buffer, the region is highlighted.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2024-01-02T22:40:06.750" LastActivityDate="2024-01-02T22:40:06.750" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="12336" PostTypeId="1" AcceptedAnswerId="12363" CreationDate="2015-05-12T02:50:31.973" Score="8" ViewCount="3444" Body="&lt;p&gt;I have been working on a document that I want to export to both HTML and latex; while working on the document I noticed that using latex &lt;code&gt;\label{}&lt;/code&gt; and &lt;code&gt;\ref{}&lt;/code&gt; tags works properly for latex export, but these are shown as plain tex in the HTML export.&#xA;Similarly if I use Org links for references inside the document (for example a link to an Org header ) these are translated as links in the HTML export, but the latex export only shows a different typografy (&lt;code&gt;\texttt{}&lt;/code&gt;), but I don't get any hyperlink characteristic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to the same behavior for both exports, either latex directives to translate into html links or Org links as in-file references for the latex export?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an example of what I'm dealing with please check the following snippet.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+OPTIONS: H4 num:3 toc:nil \n:nil @:t ::t |:t ^:nil -_t f:t *:t &amp;lt;:t&#xA;#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc&#xA;#+OPTIONS: author:t email:nil creator:nil timestamp:nil&#xA;#+LATEX_HEADER: \usepackage{geometry}&#xA;#+LATEX_HEADER: \hypersetup{colorlinks, citecolor=black, filecolor=black, linkcolor=black, urlcolor=blue}&#xA;&#xA;&#xA;* Section name&#xA;\label{sec:section_name} (not working properly in html export)&#xA;some text&#xA;#+LABEL: fig:image&#xA;[[img][file:image]]&#xA;some reference to figure \ref{fig:image} =link work in latex but not in html=&#xA;* other section&#xA;reference to [[* Section name][link work in html, but not latex export]],but if I use the reference \nameref{sec:section_name} will not work in html, but it will in latex export&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS: I'm aware that I may try to use pandoc, but I have never used it and I don't know if I will get the desired result, and I'd rather not use add additional tools to the toolchain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- Edit, Added org-mode fragment as example&lt;/p&gt;&#xA;" OwnerUserId="8289" LastEditorUserId="1974" LastEditDate="2015-05-13T09:52:38.470" LastActivityDate="2015-05-14T14:39:51.173" Title="Org export to latex and HTML references" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12337" PostTypeId="1" AcceptedAnswerId="12347" CreationDate="2015-05-12T04:48:58.650" Score="4" ViewCount="1605" Body="&lt;p&gt;I'm running Mac OS 10.10.3; Emacs is complied and installed via Homebrew; I run it as a GUI application and it reports&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is GNU Emacs 24.4.1 (x86_64-apple-darwin14.1.0, NS apple-appkit-1344.72)&#xA; of 2015-03-23 on boomer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inside of Emacs shell or Emacs ansi-term, my prompt looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash-4.3$ echo $PS1&#xA;\s-\v\$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But inside of Terminal.app, my prompt looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;boomer:~ dgrady$ echo $PS1&#xA;\h:\W \u\$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The value of &lt;code&gt;PS1&lt;/code&gt; that Terminal.app sees comes from the system-wide &lt;code&gt;/etc/bashrc&lt;/code&gt; file, which reads&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# System-wide .bashrc file for interactive bash(1) shells.&#xA;if [ -z &quot;$PS1&quot; ]; then&#xA;   return&#xA;fi&#xA;&#xA;PS1='\h:\W \u\$ '&#xA;# Make bash check its window size after a process completes&#xA;shopt -s checkwinsize&#xA;# Tell the terminal about the working directory at each prompt.&#xA;if [ &quot;$TERM_PROGRAM&quot; == &quot;Apple_Terminal&quot; ] &amp;amp;&amp;amp; [ -z &quot;$INSIDE_EMACS&quot; ]; then&#xA;    update_terminal_cwd() {&#xA;        # Identify the directory using a &quot;file:&quot; scheme URL,&#xA;        # including the host name to disambiguate local vs.&#xA;        # remote connections. Percent-escape spaces.&#xA;        local SEARCH=' '&#xA;        local REPLACE='%20'&#xA;        local PWD_URL=&quot;file://$HOSTNAME${PWD//$SEARCH/$REPLACE}&quot;&#xA;        printf '\e]7;%s\a' &quot;$PWD_URL&quot;&#xA;    }&#xA;    PROMPT_COMMAND=&quot;update_terminal_cwd; $PROMPT_COMMAND&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why do Bash shells I start from within Emacs not see the same value of &lt;code&gt;PS1&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6852" LastActivityDate="2015-05-12T16:07:11.507" Title="Why does the Emacs ansi-term and Emacs shell PS1 prompt not match my system PS1?" Tags="|shell|ansi-term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12338" PostTypeId="1" AcceptedAnswerId="12730" CreationDate="2015-05-12T08:54:28.530" Score="9" ViewCount="156" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;When operating as &lt;strong&gt;separate&lt;/strong&gt; Doctor Fates, Inza wears the &lt;strong&gt;helm&lt;/strong&gt;et and&#xA;  Kent's original costume while...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;– &lt;em&gt;Google on &lt;code&gt;helm separate history&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;kbd&gt;M-p&lt;/kbd&gt; in the Helm prompt for &lt;code&gt;helm-git-grep&lt;/code&gt; I get a file path I entered previously in &lt;code&gt;helm-find-files&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/AaYBH.png&quot; width=&quot;548&quot; /&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would really like to see is the pattern I searched with previously in &lt;code&gt;helm-git-grep&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make Helm have separate mini-buffer histories for different kinds of Helm (&lt;code&gt;helm-M-x&lt;/code&gt;, &lt;code&gt;helm-mini&lt;/code&gt;, &lt;code&gt;helm-git-grep&lt;/code&gt; and &lt;code&gt;helm-find-files&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="2332" LastActivityDate="2015-05-27T12:27:06.637" Title="How to separate histories for different Helm prompts" Tags="|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12339" PostTypeId="1" AcceptedAnswerId="12341" CreationDate="2015-05-12T09:50:36.363" Score="2" ViewCount="1354" Body="&lt;p&gt;I'm trying to achieve the following with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$pricelist = pricelist();&#xA;$hotels[$index ]['id']&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to copy the bottom line into the &lt;code&gt;pricelist()&lt;/code&gt; function like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$pricelist = pricelist($hotels[$index ]['id']);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm selecting the bottom line text only in visual mode, and yanking it, then when I go to the first parenthesis it pastes the line below, but with the last square bracket moved like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     $pricelist = pricelist();&#xA;]$hotels[$index ]['id&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain what I am doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently I can't paste anything into the parentheses, it puts it on the line below.&lt;/p&gt;&#xA;" OwnerUserId="8260" LastEditorDisplayName="user8748" LastEditDate="2018-11-17T10:28:39.057" LastActivityDate="2018-11-17T10:28:39.057" Title="Evil mode pasting under line" Tags="|evil|yank|" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="12340" PostTypeId="2" ParentId="12339" CreationDate="2015-05-12T11:04:33.487" Score="0" Body="&lt;p&gt;I can reproduce the fact to not copy anything in the parenthesis but not the brocken braket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It pastes on the line below if you copy the new line character, so if you copy the whole line. There's two ways to copy in the parenthesis:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;go in insert mode inside the parenthesis and paste with &lt;code&gt;C-y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;copy the whole line in visual mode (and not visual mode line), i.e. with &lt;code&gt;v$y&lt;/code&gt; and copy in normal mode with &lt;code&gt;p&lt;/code&gt; inside the parenthesis.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another way: give &lt;code&gt;0&lt;/code&gt; as prefix argument for &lt;code&gt;kill-whole-line&lt;/code&gt; with &lt;code&gt;C-u 0&lt;/code&gt;. This doesn't copy the trailing newline character. This function is bound to &lt;code&gt;C-S backspace&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2015-05-12T11:04:33.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12341" PostTypeId="2" ParentId="12339" CreationDate="2015-05-12T11:06:58.410" Score="0" Body="&lt;p&gt;Found the problem. I had this in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-idle-delay 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no set it to 1 and i have no problems. &lt;/p&gt;&#xA;" OwnerUserId="8260" LastActivityDate="2015-05-12T11:06:58.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12342" PostTypeId="1" AcceptedAnswerId="12346" CreationDate="2015-05-12T11:09:48.973" Score="3" ViewCount="1276" Body="&lt;p&gt;I'm trying to implement «effective append» for log buffer, e.g. if a &lt;code&gt;point&lt;/code&gt; is at &lt;code&gt;point-max&lt;/code&gt; position then insert text and move &lt;code&gt;point&lt;/code&gt; to new &lt;code&gt;point-max&lt;/code&gt;, otherwise append text and preserve &lt;code&gt;point&lt;/code&gt; position.&#xA;I though this will be very trivial code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer&#xA;  (get-buffer-create &quot;*scratch*&quot;)&#xA;  (if (eq (point) (point-max))&#xA;      (insert &quot;\n;; ===\n&quot;)&#xA;    (save-excursion&#xA;      (goto-char (point-max))&#xA;      (insert &quot;\n;; ===\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this works as expected only if invoked in &lt;code&gt;*scratch*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;having point somewhere in the middle =&gt; text appended, point not moved&lt;/li&gt;&#xA;&lt;li&gt;having point at the end of buffer =&gt; text appended, point at the end&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now if I change buffer and invoke this command again, point never goes to new point-max and always stays where it was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple tests showed that &lt;code&gt;if&lt;/code&gt; statement gives correct results always, thus it is correct branch selected. I also tried explicitly move point or do scroll in &lt;code&gt;true&lt;/code&gt;-branch, but nothing helped:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (eq (point) (point-max))&#xA;    (progn&#xA;      (insert &quot;\n;; ===\n&quot;)&#xA;      (View-scroll-to-buffer-end)  ;; not works&#xA;      (goto-char (point-max)))     ;; so does it too&#xA;  (…))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I missing something? &lt;/p&gt;&#xA;" OwnerUserId="6844" LastEditorUserId="105" LastEditDate="2015-05-13T14:09:18.630" LastActivityDate="2015-05-13T14:09:18.630" Title="How to move point to the end of another buffer, using `with-current-buffer` and `goto-char`?" Tags="|buffers|scrolling|point|save-excursion|window-point|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12343" PostTypeId="2" ParentId="12331" CreationDate="2015-05-12T11:43:19.267" Score="3" Body="&lt;p&gt;As mentioned by others in the comments, this probably isn't gong to happen. But I'll make a few suggestions that I hope might help you work with &lt;code&gt;helm&lt;/code&gt; the way you want to.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may be obvious, but if you are using &lt;code&gt;helm-find-file&lt;/code&gt;, you can press &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Backspace&lt;/kbd&gt;. It sounds like you may know that already, but don't want to have to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to rely more on &lt;code&gt;helm-for-files&lt;/code&gt; instead, and not think about what directory I am in at all. If your search string is only one word, any candidate in the parent directory will hopefully appear under the &lt;code&gt;locate&lt;/code&gt; heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you may want to look further into &lt;code&gt;projectile&lt;/code&gt; over &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. You don't need to put a folder under version control to make it a project, just create an empty &lt;code&gt;.projectile&lt;/code&gt; file in any parent directory you want to include. &lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-05-12T11:43:19.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12344" PostTypeId="2" ParentId="12342" CreationDate="2015-05-12T12:06:32.423" Score="0" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer (get-buffer-create &quot;MY-BUF&quot;)&#xA;  (let ((orig (point)))&#xA;    (if (eq (point) (point-max))&#xA;    (insert &quot;\n;; ===\n&quot;)&#xA;      (goto-char (point-max))&#xA;      (insert &quot;\n;; ===\n&quot;)&#xA;      (goto-char orig))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW I'd not use &lt;code&gt;save-excursion&lt;/code&gt; inside &lt;code&gt;with-current-buffer&lt;/code&gt;, as &lt;code&gt;save-excursion&lt;/code&gt; is a complex funciton, while &lt;code&gt;goto-char orig&lt;/code&gt; looks cleaner.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="675" LastEditDate="2015-05-12T18:59:58.590" LastActivityDate="2015-05-12T18:59:58.590" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12345" PostTypeId="1" CreationDate="2015-05-11T18:33:00.750" Score="7" ViewCount="1809" Body="&lt;p&gt;I'm using Emacs on Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have a VirtualBox VM that I connect to using plink.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then, when I use the eshell, and I do &lt;code&gt;cd &amp;lt;some folder&amp;gt;&lt;/code&gt; it tells me &lt;code&gt;No such directory found via CDPATH environment variable&lt;/code&gt; even though I started the eshell from a dired buffer and directly typed &lt;code&gt;cd folder&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the key is to make this variable &lt;code&gt;command-line-default-directory&lt;/code&gt; follow the directory where the buffer is opened at? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to reiterate my question, suppose I'm in &lt;code&gt;C://plink:&amp;lt;username&amp;gt;@&amp;lt;ip&amp;gt;:/home/asti/folder&lt;/code&gt;, I want to be able to type &lt;code&gt;cd foldername&lt;/code&gt; and not get the error &lt;code&gt;No such directory found via CDPATH environment variable&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8306" OwnerDisplayName="Jenia Ivanov" LastEditorUserId="105" LastEditDate="2016-08-15T01:06:03.450" LastActivityDate="2019-08-16T10:03:20.457" Title="emacs command-line-default-directory variable is not set correctly" Tags="|start-up|remote|environment|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12346" PostTypeId="2" ParentId="12342" CreationDate="2015-05-12T14:58:44.170" Score="2" Body="&lt;p&gt;I think the following code will help. It is modified from an example in the emacs-lisp intro at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/append_002dto_002dbuffer-overview.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/eintr/append_002dto_002dbuffer-overview.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun append-string-to-buffer (buffer string)&#xA;  ;; Modified from append-to-buffer, defined in the emacs-lisp intro&#xA;  &quot;Append to specified buffer the specified text.&#xA;It is inserted into that buffer at end of buffer.&#xA;&#xA;When calling from a program, give two arguments:&#xA;BUFFER (or buffer name), and the STRING to be copied.&quot;&#xA;  (interactive&#xA;   (list (read-buffer &quot;Append to buffer: &quot; (other-buffer&#xA;                                            (current-buffer) t))&#xA;         (read-string &quot;String to append: &quot;)))&#xA;&#xA;  (let* ((append-to (get-buffer-create buffer))&#xA;         (windows (get-buffer-window-list append-to t t))&#xA;         move-point-in-windows)&#xA;    (with-current-buffer append-to&#xA;      (barf-if-buffer-read-only)&#xA;      ;; record in which windows we should keep point at eob.&#xA;      (dolist (window windows)&#xA;        (when (= (window-point window) (point-max))&#xA;          (push window move-point-in-windows)))&#xA;      (let (return-to-position)&#xA;        ;; decide whether we should reset point to return-to-position&#xA;        ;; or leave it at eob.&#xA;        (unless (= (point) (point-max))&#xA;          (setq return-to-position (point))&#xA;          (goto-char (point-max)))&#xA;        (insert string)&#xA;        (when return-to-position&#xA;          (goto-char return-to-position)))&#xA;      ;; advance to point-max in windows where it is needed&#xA;      (dolist (window move-point-in-windows)&#xA;        (set-window-point window (point-max))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="675" LastEditDate="2015-05-12T17:31:17.510" LastActivityDate="2015-05-12T17:31:17.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12347" PostTypeId="2" ParentId="12337" CreationDate="2015-05-12T16:07:11.507" Score="3" Body="&lt;p&gt;Terminal.app starts an interactive login shell, while Emacs starts interactive non-login shells. The Bash manual's &lt;a href=&quot;http://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;section on startup files&lt;/a&gt; explains that for login shells, Bash will first source &lt;code&gt;/etc/profile&lt;/code&gt; (and on Mac OS this file instructs Bash to source &lt;code&gt;/etc/bashrc&lt;/code&gt;, which sets &lt;code&gt;PS1&lt;/code&gt;) and then goes on to look for user-specific config files. Interactive non-login shells look only for user-specific config files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to check that this is the case: in Emacs,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash-4.3$ echo $0&#xA;/usr/local/bin/bash&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while in Terminal.app,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;boomer:~ dgrady$ echo $0&#xA;-bash&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Related: &lt;a href=&quot;https://unix.stackexchange.com/questions/119627/why-are-interactive-shells-on-osx-login-shells-by-default&quot;&gt;https://unix.stackexchange.com/questions/119627/why-are-interactive-shells-on-osx-login-shells-by-default&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6852" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2015-05-12T16:07:11.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12348" PostTypeId="2" ParentId="12327" CreationDate="2015-05-12T17:53:26.577" Score="2" Body="&lt;p&gt;You may interest in &lt;a href=&quot;https://github.com/kyagi/shell-pop-el&quot; rel=&quot;nofollow&quot;&gt;shell-pop&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-05-12T17:53:26.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12350" PostTypeId="1" CreationDate="2015-05-12T19:36:47.777" Score="2" ViewCount="574" Body="&lt;p&gt;Opening &lt;code&gt;/sudo::/etc/hosts&lt;/code&gt; with tramp prompts for a password even though I have passwordless sudo. I use ido.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo grep NOPASSWD /etc/sudoers&#xA;%wheel ALL=(ALL) NOPASSWD: ALL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to fix this?&lt;/p&gt;&#xA;" OwnerUserId="5504" LastEditorUserId="25" LastEditDate="2015-06-12T21:20:02.740" LastActivityDate="2015-06-12T21:20:02.740" Title="Prevent Tramp from asking for a password for passwordless sudo" Tags="|tramp|ido|passwords|sudo|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12351" PostTypeId="1" AcceptedAnswerId="12352" CreationDate="2015-05-12T19:52:40.890" Score="3" ViewCount="920" Body="&lt;p&gt;I would like to use certain unicode characters in the mode-line only if the Symbola font is available on the system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I put this in my emacs config and it's a great way to check if those fonts are available for a regular, non-daemon emacs session&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar font-symbola-p nil&#xA;  &quot;If non-nil, Symbola font is available on the system.&quot;)&#xA;&#xA;(when (find-font (font-spec :name &quot;Symbola&quot;))&#xA;  (setq font-symbola-p t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run emacs using &lt;code&gt;emacsclient -a '' -c&lt;/code&gt; &lt;em&gt;aka&lt;/em&gt; &lt;strong&gt;daemon&lt;/strong&gt; mode, the value of &lt;code&gt;font-symbola-p&lt;/code&gt; stays &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems as if emacs reads the &quot;font database&quot; at some point after the above code is eval'd from my config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt;&#xA;What is the right time to call &lt;code&gt;find-font&lt;/code&gt; when running emacs in daemon mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;PS: I tried the below too but that too didn't work ONLY in daemon mode.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'window-setup-hook&#xA;          (lambda ()&#xA;            (when (find-font (font-spec :name &quot;Symbola&quot;))&#xA;              (setq font-symbola-p t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-05-23T15:09:31.597" Title="When to call find-font if launching emacs in daemon mode?" Tags="|fonts|daemon|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12352" PostTypeId="2" ParentId="12351" CreationDate="2015-05-12T20:04:23.150" Score="2" Body="&lt;p&gt;This trick worked for me; I basically wait for emacs to be idle for a second (which happens after its startup finishes) and do the Symbola font check just once. This seems to work when emacs in launched in regular or daemon mode.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(run-with-idle-timer 1 nil&#xA;                     (lambda ()&#xA;                       (when (find-font (font-spec :name &quot;Symbola&quot;))&#xA;                         (setq font-symbola-p t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Slightly more refined solution&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Below macro is used to wrap stuff that need to be run only after emacs&#xA;;; starts up completely. This is very crucial when calling functions like&#xA;;; `find-font' which return correct value only after emacs startup is finished&#xA;;; especially when emacs is started in daemon mode.&#xA;(defmacro do-once-1-sec-after-emacs-startup (&amp;amp;rest body)&#xA;  `(run-with-idle-timer 1 ; run this after emacs is idle for 1 second&#xA;                        nil ; do this just once; don't repeat&#xA;                        (lambda () ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example Use&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Check if the Symbola font is available just once, after a second delay after&#xA;;; emacs startup. This trick works when emacs is launched in regular or daemon&#xA;;; mode&#xA;(do-once-1-sec-after-emacs-startup&#xA; (when (find-font (font-spec :name &quot;Symbola&quot;))&#xA;   ;; Manually choose a fallback font for Unicode&#xA;   ;; http://endlessparentheses.com/manually-choose-a-fallback-font-for-unicode.html&#xA;   (set-fontset-font &quot;fontset-default&quot; nil (font-spec :size 20 :name &quot;Symbola&quot;))&#xA;   (setq font-symbola-p t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Update - Alternative solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Save the below to a file &lt;code&gt;setup-symbola.el&lt;/code&gt; in your &lt;code&gt;user-emacs-directory&lt;/code&gt; (or one of the directories in your &lt;code&gt;load-path&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; setup-symbola.el&#xA;(defvar font-symbola-p nil&#xA;  &quot;If non-nil, Symbola font is available on the system.&quot;)&#xA;&#xA;(when (find-font (font-spec :name &quot;Symbola&quot;))&#xA;  ;; Manually choose a fallback font for Unicode&#xA;  ;; http://endlessparentheses.com/manually-choose-a-fallback-font-for-unicode.html&#xA;  (set-fontset-font &quot;fontset-default&quot; nil (font-spec :size 20 :name &quot;Symbola&quot;))&#xA;  (setq font-symbola-p t))&#xA;&#xA;(provide 'setup-symbola)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put the below in the &lt;code&gt;init.el&lt;/code&gt;. You can use the same approach (of using &lt;code&gt;use-package&lt;/code&gt;) or use &lt;code&gt;run-with-idle-timer&lt;/code&gt; instead to delay the loading of &lt;code&gt;setup-symbola&lt;/code&gt; by 1 second:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package setup-symbola :defer 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is an example of how I use the above setup to set an alternative lighter for &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;shackle-mode&lt;/code&gt;&lt;/a&gt; if the Symbola font that supports Unicode characters is available. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'setup-symbola&#xA;     (unless font-symbola-p&#xA;       (setq shackle-lighter &quot; §&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-28T04:04:10.657" LastActivityDate="2015-05-28T04:04:10.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12354" PostTypeId="2" ParentId="5811" CreationDate="2015-05-12T20:37:31.060" Score="1" Body="&lt;p&gt;If you install php-ext (&lt;a href=&quot;https://savannah.nongnu.org/projects/php-ext-el/&quot; rel=&quot;nofollow&quot;&gt;https://savannah.nongnu.org/projects/php-ext-el/&lt;/a&gt;), you will have autocompletion and skeleton templates for many, many php functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cd ~&#xA;&#xA;$ mkdir mydir&#xA;&#xA;$ cd mydir&#xA;&#xA;$ git clone git://git.savannah.nongnu.org/php-ext-el.git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit you .emacs and add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq php-ext-path &quot;~/mydir&quot;)&#xA;&#xA;(load (concat php-ext-path &quot;php-ext.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8295" LastActivityDate="2015-05-12T20:37:31.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12355" PostTypeId="1" CreationDate="2015-05-12T20:39:17.287" Score="1" ViewCount="154" Body="&lt;p&gt;With &lt;code&gt;flyspell-mode&lt;/code&gt;, one can maintain a buffer local dictionary. For example, I may middle-click &lt;em&gt;&quot;stackexchange&quot;&lt;/em&gt; and select &lt;em&gt;Accept (buffer)&lt;/em&gt;. This adds the word to the dictionary at the end of the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%  LocalWords:  stackexchange&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would be nice to have the same functionality with &lt;a href=&quot;https://github.com/tlikonen/wcheck-mode&quot; rel=&quot;nofollow&quot;&gt;wcheck-mode&lt;/a&gt;. Documentation for release 2014.6.21 contains &lt;a href=&quot;https://github.com/tlikonen/wcheck-mode&quot; rel=&quot;nofollow&quot;&gt;example code&lt;/a&gt; for an &lt;em&gt;&quot;Add to dictionary&quot;&lt;/em&gt; menu entry, but that's not buffer local.&lt;/p&gt;&#xA;" OwnerUserId="5327" LastActivityDate="2015-05-12T20:39:17.287" Title="wcheck-mode: Add buffer local dictionary?" Tags="|spell-checking|flyspell|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12356" PostTypeId="2" ParentId="12120" CreationDate="2015-05-12T22:12:15.093" Score="3" Body="&lt;p&gt;One way to accomplish what you want is to wrap &lt;code&gt;org-contacts&lt;/code&gt; with a special &lt;code&gt;org-contacts-mode&lt;/code&gt; as demonstrated in the following.&#xA;This new major mode defines the keys &lt;kbd&gt;l&lt;/kbd&gt; and &lt;kbd&gt;c&lt;/kbd&gt; as you specified it in its local keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may paste the code into your &lt;code&gt;.emacs&lt;/code&gt; file after &lt;code&gt;(require 'org-contacts)&lt;/code&gt; or a suitable &lt;code&gt;autoload&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can just call &lt;code&gt;org-contacts&lt;/code&gt; instead of your proposed new function. Put point at the entry you want to insert into the original buffer and press &lt;kbd&gt;l&lt;/kbd&gt; or &lt;kbd&gt;c&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org-contacts)&#xA;&#xA;(define-derived-mode org-contacts-mode org-agenda-mode &quot;org-contacts&quot;&#xA;  &quot;Like `org-agenda-mode' with the following alternative key-bindings:&#xA;l: insert a link to the selected contact at point in the original buffer&#xA;c: insert a copy of the subtree corresponding to the contact at point in the original buffer&#xA;Both commands burry the contacts buffer afterwards.&#xA;&quot;)&#xA;&#xA;(defadvice org-contacts (around contacts-mode activate)&#xA;  &quot;Wrap `org-contacts' with `org-contacts-mode' where special keybindings are in effect.&#xA;See `org-contacts-mode' for further details.&quot;&#xA;  (let* ((org-contacts-buffer (get-buffer-create &quot;*org-contacts*&quot;))&#xA;     (original-buffer (current-buffer))&#xA;     (org-agenda-buffer-name (buffer-name org-contacts-buffer)))&#xA;    (switch-to-buffer org-contacts-buffer)&#xA;    ad-do-it&#xA;    (org-contacts-mode)&#xA;    (setq-local org-contacts-original-buffer original-buffer)))&#xA;&#xA;(defun org-contacts-return (content)&#xA;  &quot;Insert CONTENT into original buffer and switch there.&quot;&#xA;  (declare (special org-contacts-original-buffer))&#xA;  (unless (and&#xA;       (boundp 'org-contacts-original-buffer)&#xA;       org-contacts-original-buffer)&#xA;    (error &quot;Cannot determine the original buffer.&#xA;Note, you should not manually activate `org-contacts-mode'.&quot;))&#xA;  (let ((original-buffer org-contacts-original-buffer))&#xA;   (bury-buffer)&#xA;   (switch-to-buffer original-buffer)&#xA;   (insert content)))&#xA;&#xA;(defun org-subtree-string (&amp;amp;optional marker)&#xA;  &quot;Return subtree at location MARKER.&#xA;MARKER should be nil or a marker pointing to a live org-buffer.&#xA;If MARKER is nil it corresponds to the current point in the current buffer.&quot;&#xA;  (let ((buf (or (and (markerp marker) (marker-buffer marker)) (current-buffer)))&#xA;    (pt (or (and (markerp marker) (marker-position marker)) (point)))&#xA;    b e)&#xA;    (with-current-buffer buf&#xA;      (unless (derived-mode-p 'org-mode)&#xA;    (error &quot;This is not an org-mode buffer.&quot;))&#xA;      (save-excursion&#xA;    (goto-char pt)&#xA;    (org-back-to-heading t)&#xA;    (setq b (point))&#xA;    (org-end-of-subtree t)&#xA;    (setq e (point)))&#xA;      (buffer-substring b e))))&#xA;&#xA;(setq org-contacts-mode-map (let ((map (make-sparse-keymap)))&#xA;                  (define-key map [?l]&#xA;                (lambda () (interactive)&#xA;                  (let* ((marker (org-get-at-bol 'org-hd-marker))&#xA;                     (buf (marker-buffer marker))&#xA;                     (filename (expand-file-name (buffer-file-name buf))))&#xA;                    (org-contacts-return&#xA;                     (concat &quot;[[file:&quot; filename &quot;::&quot;&#xA;                         (nth 4 (org-with-point-at marker&#xA;                              (org-heading-components)))&#xA;                         &quot;]]&quot;)))))&#xA;                  (define-key map [?c]&#xA;                (lambda () (interactive)&#xA;                  (let* ((marker (org-get-at-bol 'org-hd-marker)))&#xA;                    (org-contacts-return&#xA;                     (org-subtree-string marker)))))&#xA;                  map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage-Example:&#xA;Assume you have already defined some contact with name &lt;code&gt;Nobody&lt;/code&gt; and you want to insert a copy of the contact in file &lt;code&gt;test.org&lt;/code&gt; at the current point position.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With point at the place where you want to insert the copy of the contact call &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;org-contacts&lt;/code&gt;. Maybe, you have already a key-sequence for that. You get the prompt for the contact name from &lt;code&gt;org-contacts&lt;/code&gt; as shown in the following figure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/BoJHy.png&quot; alt=&quot;org-contacts call&quot;&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Input the contact name (&quot;Nobody&quot; in our example). You get an org-contacts buffer with all matches of &quot;Nobody&quot;. In our example there is just one match. Place point on the match of your like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2oZ8v.png&quot; alt=&quot;org-contacts buffer&quot;&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For copying the corresponding contact into the target buffer press &lt;kbd&gt;c&lt;/kbd&gt; (see following figure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9R1AX.png&quot; alt=&quot;Copy of the contact&quot;&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you press &lt;kbd&gt;l&lt;/kbd&gt; instead of &lt;kbd&gt;c&lt;/kbd&gt; you get a link to the contact as shown in the following figure below the copied contact. (Note, that I have replaced some sensitive data by three dots. Actually, you get the absolute path to the contact file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mlDAI.png&quot; alt=&quot;Link to contact&quot;&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-05-18T16:47:21.293" LastActivityDate="2015-05-18T16:47:21.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12357" PostTypeId="2" ParentId="275" CreationDate="2015-05-12T23:49:38.193" Score="0" Body="&lt;p&gt;You'd need to poll the event queue until a different event, or none, was read.  CPU load is noticable, though reasonably low.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-preview-command ()&#xA;  (interactive)&#xA;  (let* ((file (or (dired-get-filename nil t)&#xA;                   (error &quot;No file here&quot;)))&#xA;         (visited-p (get-file-buffer file))&#xA;         (buffer (or visited-p (find-file-noselect file)))&#xA;         (window&#xA;          (display-buffer buffer '(nil . ((inhibit-same-window . t)))))&#xA;         (event (read-event)))&#xA;    (while (and event (eq last-command-event event))&#xA;      (setq event (read-event nil nil 0.1)))&#xA;    (when event&#xA;      (setq unread-command-events&#xA;            (list event)))&#xA;    (quit-window (not visited-p) window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-05-12T23:49:38.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12359" PostTypeId="1" AcceptedAnswerId="12387" CreationDate="2015-05-13T02:35:30.583" Score="2" ViewCount="72" Body="&lt;p&gt;I'm working on a utility that communicates with an external process using line and column positions in the current file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have configured Haskell mode to use &lt;code&gt;compose-region&lt;/code&gt; to display certain parts of the syntax in Unicode, which can replace multiple characters with a single one (ie turning &lt;code&gt;-&amp;gt;&lt;/code&gt; into &lt;code&gt;→&lt;/code&gt;). Unfortunately, this means that the line and column position in the buffer no longer correspond to their position in the underlying file, but instead map to the position in the buffer, counting the composed region as a single character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code I currently use to get the line and column:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list (line-number-at-pos) (current-column))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get the position ignoring these composed characters, in terms of the underlying file?&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2015-05-13T21:49:00.120" Title="How can I find the current line and column ignoring text composition?" Tags="|point|compose-region|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12360" PostTypeId="1" AcceptedAnswerId="12403" CreationDate="2015-05-13T02:55:34.663" Score="7" ViewCount="607" Body="&lt;p&gt;I'm using emacs with company-mode and I'd like the 'private' methods (method that start with underline) to be shown last, since they are kind of useless for imported libraries in python. See the image:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/agSep.png&quot; alt=&quot;underline methods&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like it to be sorted like this:&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/G9hRt.png&quot; alt=&quot;desired way&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="105" LastEditDate="2015-05-13T14:06:20.920" LastActivityDate="2018-04-30T19:34:59.350" Title="How to make private python methods the last company-mode choices?" Tags="|python|completion|company-mode|sorting|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12361" PostTypeId="1" AcceptedAnswerId="50168" CreationDate="2015-05-13T04:29:29.527" Score="18" ViewCount="1957" Body="&lt;p&gt;Is it possible to effectively use org-mode as a front end to github issues and milestones (with two way sync)?&lt;/p&gt;&#xA;" OwnerUserId="6723" LastEditorUserId="6723" LastEditDate="2015-05-17T13:50:00.560" LastActivityDate="2019-04-26T09:42:57.153" Title="Can I sync github issues and milestones with org-mode?" Tags="|org-mode|github|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12362" PostTypeId="2" ParentId="12361" CreationDate="2015-05-13T04:38:13.330" Score="14" Body="&lt;p&gt;There is a project to allow such functionality, called &lt;code&gt;org-sync&lt;/code&gt;. (Or rather, &lt;code&gt;org-sync&lt;/code&gt; has a GitHub backend.) You can find it &lt;a href=&quot;http://orgmode.org/worg/org-contrib/gsoc2012/student-projects/org-sync/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, it doesn't seem to be actively maintained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem I have noticed is that it doesn't support syncing comments on the issues. As for milestones, it does attach an item to &lt;code&gt;PROPERTIES&lt;/code&gt; that tells you which one an issue belongs to, but it doesn't look like you can edit milestones directly.&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2015-05-13T16:41:44.037" LastActivityDate="2015-05-13T16:41:44.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12363" PostTypeId="2" ParentId="12336" CreationDate="2015-05-13T04:38:25.270" Score="9" Body="&lt;p&gt;A couple of things..&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The syntax for figure/table labels is &lt;code&gt;#+NAME:&lt;/code&gt;. You also need to use &lt;code&gt;#+CAPTION:&lt;/code&gt; if you want to cross-reference them.&lt;/li&gt;&#xA;&lt;li&gt;You do not need to use the &lt;code&gt;\label&lt;/code&gt; syntax; it's much simpler in org-mode. &#xA;&lt;ul&gt;&#xA;&lt;li&gt;To reference the section &lt;code&gt;Section name&lt;/code&gt; (from your example), you use &lt;code&gt;[[Section name]]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;To reference that figure in your example, you use &lt;code&gt;[[fig:image]]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;You need to use the &lt;code&gt;#+LaTeX:&lt;/code&gt; prefix for LaTeX-only code.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Working MWE&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* Section name&#xA;some text&#xA;#+CAPTION: Fig Caption&#xA;#+NAME: fig:image&#xA;[[file:img]]&#xA;some reference to figure [[fig:image]] =link will work in both html and latex=&#xA;* other section&#xA;reference to Section [[Section name]] =link will work in both html and latex=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Using &lt;code&gt;CUSTOM_ID&lt;/code&gt; to refer to sections&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Thanks to the tip from &lt;strong&gt;@rasmus&lt;/strong&gt; in the comments, this is a better way to link to sections as it decouples the section name from the link name.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* Introduction&#xA;:PROPERTIES:&#xA;:CUSTOM_ID: sec:intro&#xA;:END:&#xA;some text&#xA;* Conclusion&#xA;This links to Section [[#sec:intro]] and this link will work in both html and latex. &#xA;*It is important to prefix the custom ID with the =#= character.*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;One more way to refer to sections (&lt;a href=&quot;http://orgmode.org/manual/Internal-links.html&quot; rel=&quot;noreferrer&quot;&gt;double angular brackets&lt;/a&gt;)&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* Introduction&#xA;&amp;lt;&amp;lt;sec:intro&amp;gt;&amp;gt;&#xA;some text&#xA;* Conclusion&#xA;This links to Section [[sec:intro]] and this link will work in both html and latex.&#xA;*You do not prefix the link name with the =#= character here.*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Images-and-tables.html&quot; rel=&quot;noreferrer&quot;&gt;Figures in org-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Internal-links.html&quot; rel=&quot;noreferrer&quot;&gt;Internal Links&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Quoting-LaTeX-code.html&quot; rel=&quot;noreferrer&quot;&gt;Quoting LaTeX&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-14T14:39:51.173" LastActivityDate="2015-05-14T14:39:51.173" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12364" PostTypeId="1" AcceptedAnswerId="12393" CreationDate="2015-05-13T05:16:42.987" Score="7" ViewCount="3887" Body="&lt;p&gt;Popular todo softwares nowadays usually list tasks with their scheduled due date attached by default so that we can have a general idea about the progress of our different projects. However in org agenda global todo list view (&lt;kbd&gt;C-c a t&lt;/kbd&gt;) it seems that only the project and priority of the tasks are listed, without any of their timestamps(deadline, scheduled, or just normal timestamp). This makes the view much less useful because looking at tasks without due dates is not very helpful for me to arrange my work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Default agenda view has dates but it doesn't offer an overview of all tasks, which usually span a long period of time beyond default agenda view timespan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to show timestamps associated with TODOs in global TODO list?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-09-12T02:13:37.993" Title="Show Timestamp for each TODO in Org Agenda Global Todo List?" Tags="|org-mode|org-agenda|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12365" PostTypeId="1" CreationDate="2015-05-13T07:21:01.113" Score="3" ViewCount="665" Body="&lt;p&gt;I have successfully configured Company-ycmd and ycmd as my C/C++ auto completion engine. It works great but the Flycheck-ycmd seems not support the C++11 syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it give the following errors:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Such as: &quot;nullptr is not compatible with c++98&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6816" LastActivityDate="2015-05-13T15:01:59.020" Title="emacs-ycmd flycheck integration doesn't support C++11" Tags="|company-mode|flycheck|" AnswerCount="1" CommentCount="2" ClosedDate="2015-05-14T02:57:31.830" ContentLicense="CC BY-SA 3.0" />
  <row Id="12367" PostTypeId="1" AcceptedAnswerId="13030" CreationDate="2015-05-13T10:24:52.327" Score="2" ViewCount="534" Body="&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt;&#xA;Last weekend I had some discussion with a friend about how I could improve my writing skills. As a result I would like to experiment with a new document structure to guide the process of scientific writing. Therefore I want to introduce for each section of my document several subsections:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Goals&lt;/em&gt; that describe what should be achieved in this section, i.e. what is the reader expected to know at the beginning and what should he know afterwards.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Strategies&lt;/em&gt; that sketch how this goal can be met (i.e. argumentation or text flow)&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Literature&lt;/em&gt; which contains a review of related publications that forms the theoretical foundation for this section and has a subsubsection for each publication.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Notes&lt;/em&gt; contains all information (ordered according to the strategy) that is needed to write the final text&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Text&lt;/em&gt; written in the last step. The text may contain a paragraph with a heading.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For each of these tasks I would like to track the time spent on it by having a separate logbook for each of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if it is a good idea to have everything in a single document but I could imagine that it's easier to manage in the case of re-organisations. The draw back is that exporting gets somehow complicated. This is the reason for this request of help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Document structure&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Section (can be everything from one to five stars)&#xA;****** Goals                                   :Goal:&#xA;:LOGBOOK:&#xA;:END:&#xA;&#xA;****** Strategy                            :Strategy:&#xA;:LOGBOOK:&#xA;:END:&#xA;&#xA;****** Literature                        :Literature:&#xA;:LOGBOOK:&#xA;:END:&#xA;&#xA;******* Publication 1&#xA;:LOGBOOK:&#xA;:END:&#xA;&#xA;******* Publication 2&#xA;:LOGBOOK:&#xA;:END:&#xA;&#xA;****** Notes                                  :Notes:&#xA;:LOGBOOK:&#xA;:END:&#xA;&#xA;- Argument 1&#xA;- Argument 2&#xA;- Argument 3&#xA;&#xA;****** Text                                    :Text:&#xA;:LOGBOOK:&#xA;:END:&#xA;&#xA;Some introductory words.&#xA;&#xA;******* Paragraph 1&#xA;Some text.&#xA;&#xA;******** Subparagraph (unlikely but for completeness)&#xA;Some text.&#xA;&#xA;******* Paragraph 2&#xA;Some text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see that the headings start with indentation of six. This is because it seems that the LaTeX exporter only supports five levels of headings. In order to do not run into conflicts I think that it's better to avoid overlaps. This requires us to perform some demotes to lower levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Exporting&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to export three separate documents from this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Goals and strategy&lt;/em&gt;. Hide all other sections and demote to level 4 (paragraph).&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Literature&lt;/em&gt;. Hide all other sections, remove heading and demote each subsection to level six, thus making it a enumerated list item.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Notes&lt;/em&gt;. Hide all other sections and remove heading.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Text&lt;/em&gt;. Hide all other sections and remove heading and demote each subsection to level four (paragraph).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What do I have so far?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have defined a new export configuration, such that each of the documents described above is generated. It's using &lt;code&gt;:preparation-function&lt;/code&gt; and &lt;code&gt;:completion-function&lt;/code&gt; (&lt;a href=&quot;http://orgmode.org/manual/Sources-and-destinations.html#Sources-and-destinations&quot; rel=&quot;nofollow noreferrer&quot;&gt;docs&lt;/a&gt;) to perform the changes to the original document. The code to remove sections and headings is based on the &lt;a href=&quot;https://emacs.stackexchange.com/a/9494/6890&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-prepare-export-strategy (backend)&#xA;  &quot;Remove sections with :Literature|Notes|Text: tag.&quot;&#xA;  (org-map-entries (lambda () (let ((beg (point)))&#xA;                                (outline-next-visible-heading 1)&#xA;                                (backward-char)&#xA;                                (delete-region beg (point))))&#xA;                   &quot;Literature|Notes|Text&quot; tree)&#xA;)&#xA;&#xA;(defun org-prepare-export-literature (backend)&#xA;  &quot;Remove sections with :Goal|Strategy|Notes|Text: tag.&quot;&#xA;  (org-map-entries (lambda () (let ((beg (point)))&#xA;                                (outline-next-visible-heading 1)&#xA;                                (backward-char)&#xA;                                (delete-region beg (point))))&#xA;                   &quot;Goal|Strategy|Notes|Text&quot; tree)&#xA;  (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol)))&#xA;                   &quot;Literature&quot;)&#xA;)&#xA;&#xA;(defun org-prepare-export-notes (backend)&#xA;  &quot;Remove sections with :Goal|Strategy|Literature|Text: tag.&quot;&#xA;  (org-map-entries (lambda () (let ((beg (point)))&#xA;                                (outline-next-visible-heading 1)&#xA;                                (backward-char)&#xA;                                (delete-region beg (point))))&#xA;                   &quot;Goal|Strategy|Literature|Text&quot; tree)&#xA;  (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol)))&#xA;                   &quot;Notes&quot;)&#xA;)&#xA;&#xA;(defun org-prepare-export-draft (backend)&#xA;  &quot;Remove sections with :Goal|Strategy|Literature|Notes: tag.&quot;&#xA;  (org-map-entries (lambda () (let ((beg (point)))&#xA;                                (outline-next-visible-heading 1)&#xA;                                (backward-char)&#xA;                                (delete-region beg (point))))&#xA;                   &quot;Goal|Strategy|Literature|Notes&quot; tree)&#xA;  (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol)))&#xA;                   &quot;Text&quot;)&#xA;)&#xA;&#xA;(defun org-enable-prepare-export-strategy () (add-hook 'org-export-before-processing-hook #'org-prepare-export-strategy))&#xA;(defun org-disable-prepare-export-strategy () (remove-hook 'org-export-before-processing-hook #'org-prepare-export-strategy))&#xA;&#xA;(defun org-enable-prepare-export-literature () (add-hook 'org-export-before-processing-hook #'org-prepare-export-literature))&#xA;(defun org-disable-prepare-export-literature () (remove-hook 'org-export-before-processing-hook #'org-prepare-export-literature))&#xA;&#xA;(defun org-enable-prepare-export-notes () (add-hook 'org-export-before-processing-hook #'org-prepare-export-notes))&#xA;(defun org-disable-prepare-export-notes () (remove-hook 'org-export-before-processing-hook #'org-prepare-export-notes))&#xA;&#xA;(defun org-enable-prepare-export-draft () (add-hook 'org-export-before-processing-hook #'org-prepare-export-draft))&#xA;(defun org-disable-prepare-export-draft () (remove-hook 'org-export-before-processing-hook #'org-prepare-export-draft))&#xA;&#xA;(setq org-publish-project-alist&#xA;      '(&#xA;        (&quot;outline-strategy&quot;&#xA;         :base-directory &quot;~/org-mode/test/&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;~/org-mode/test/strategy&quot;&#xA;     :preparation-function org-enable-prepare-export-strategy&#xA;     :completion-function  org-disable-prepare-export-strategy&#xA;         :publishing-function org-latex-publish-to-latex&#xA;         :include (&quot;Test.org&quot;)&#xA;         :exclude &quot;\\.org$&quot;&#xA;         )&#xA;        (&quot;outline-literature&quot;&#xA;         :base-directory &quot;~/org-mode/test/&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;~/org-mode/test/literature&quot;&#xA;     :preparation-function org-enable-prepare-export-literature&#xA;     :completion-function  org-disable-prepare-export-literature&#xA;         :publishing-function org-latex-publish-to-latex&#xA;         :include (&quot;Test.org&quot;)&#xA;         :exclude &quot;\\.org$&quot;&#xA;         )&#xA;        (&quot;outline-notes&quot;&#xA;         :base-directory &quot;~/org-mode/test/&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;~/org-mode/test/notes&quot;&#xA;     :preparation-function org-enable-prepare-export-notes&#xA;     :completion-function  org-disable-prepare-export-notes&#xA;         :publishing-function org-latex-publish-to-latex&#xA;         :include (&quot;Test.org&quot;)&#xA;         :exclude &quot;\\.org$&quot;&#xA;         )&#xA;        (&quot;outline-draft&quot;&#xA;         :base-directory &quot;~/org-mode/test/&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;~/org-mode/test/draft&quot;&#xA;     :preparation-function org-enable-prepare-export-draft&#xA;     :completion-function  org-disable-prepare-export-draft&#xA;         :publishing-function org-latex-publish-to-latex&#xA;         :include (&quot;Test.org&quot;)&#xA;         :exclude &quot;\\.org$&quot;&#xA;         )&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Issues&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Subsection headings are removed because of the inherited tags.&lt;/li&gt;&#xA;&lt;li&gt;Goals and Strategy are not demoted to paragraph level.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do I call &lt;code&gt;org-demote&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/manual/Using-the-mapping-API.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(mapping API docs)&lt;/a&gt; for the section matched by &lt;code&gt;org-map-entries&lt;/code&gt; and it's childs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Changelog&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Added working preparation functions (2015-05-25)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6890" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-06-09T14:42:32.163" Title="Demoting sections on org-export" Tags="|org-mode|latex|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12368" PostTypeId="1" AcceptedAnswerId="12372" CreationDate="2015-05-13T11:33:38.590" Score="5" ViewCount="478" Body="&lt;p&gt;Upon pressing enter inside a newly created block I would like the Emacs to move the ending curly brace an extra newline down, and then indent the cursor. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before pressing Enter&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i := range x {&amp;lt;cursor&amp;gt;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After pressing Enter once I get this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i := range x {&#xA;&amp;lt;cursor&amp;gt;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However what I would like to get is this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i := range x {&#xA;    &amp;lt;cursor&amp;gt;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8301" LastEditorUserId="105" LastEditDate="2016-03-14T01:12:05.800" LastActivityDate="2016-03-14T01:12:05.800" Title="Make ending curly brace of block go down an extra newline in Golang" Tags="|indentation|golang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12369" PostTypeId="1" AcceptedAnswerId="21872" CreationDate="2015-05-13T11:58:40.033" Score="8" ViewCount="617" Body="&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt; When working on a larger document in &lt;code&gt;org-mode&lt;/code&gt; I would like to clock the whole work time without gaps. As I usually have a &lt;code&gt;logbook&lt;/code&gt; in each section I wonder if it's possible to automatically clock in when moving the cursor into a section and clock out when leaving it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know there are only projects that clock out automatically when finishing tasks and that clock in a default clock afterwards. Although I really like the approach I have the feeling that it's not appropriate when writing a longer document whose sections usually get into the finished state very late and where sometimes jumping between section occurs, for example in periods in which only small issues are fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first time at least I saw such automatic clocking was in &lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot;&gt;Bernt Hansen's org-mode configuration&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How can automatic clocking be implemented, such that there is a clock-in when moving into a section and a clock-out when moving out of a section?&lt;/p&gt;&#xA;" OwnerUserId="6890" LastActivityDate="2020-12-17T14:05:20.723" Title="Automatic clocking in org-mode when moving into section" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12370" PostTypeId="2" ParentId="3893" CreationDate="2015-05-13T12:31:12.137" Score="0" Body="&lt;p&gt;While it's not exactly what you want (diff in your commit buffer), you can set magit to expand the staged diffs in the &lt;strong&gt;status&lt;/strong&gt; window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq magit-expand-staged-on-commit 'full)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The magit workflow seems to always be open status buffer and then open split with commit buffer, you always end up with two buffers displayed. The above setting will make the second (previously not useful) buffer display your diff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;t&lt;/code&gt; to only expand the diff headers (so it shows the line numbers):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq magit-expand-staged-on-commit t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While writing your diff, you can switch to the status buffer and use &lt;code&gt;TAB&lt;/code&gt; to expand (or fold) the diffs.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use &lt;code&gt;C-c C-d&lt;/code&gt; from the commit buffer to open another buffer with a diff with &lt;code&gt;magit-diff-staged&lt;/code&gt;. (See &lt;a href=&quot;https://github.com/magit/magit/issues/946&quot; rel=&quot;nofollow&quot;&gt;this issue&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="8283" LastActivityDate="2015-05-13T12:31:12.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12371" PostTypeId="1" CreationDate="2015-05-13T12:37:53.777" Score="6" ViewCount="1421" Body="&lt;p&gt;How do you stage a hunk into git from ediff?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to view a side-by-side diff and stage hunks into the &quot;HEAD&quot; side of the diff, but that buffer (i.e., &lt;code&gt;spacemacs.~master~&lt;/code&gt;) is read-only. Ideally, I could also edit that staged file (to achieve the precision I'd get from editing a hunk from git command-line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It &lt;a href=&quot;http://daemianmack.com/magit-cheatsheet.html&quot; rel=&quot;noreferrer&quot;&gt;looks like&lt;/a&gt; I can invoke magit status (&lt;code&gt;M-x magit-status&lt;/code&gt;), expand a diff (&lt;code&gt;TAB&lt;/code&gt;), and use &lt;code&gt;s&lt;/code&gt; to stage a diff hunk, but I'd like to do this on a file-by-file basis and from a side-by-side diff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping to replicate the behavior of &lt;a href=&quot;http://vimcasts.org/episodes/fugitive-vim-working-with-the-git-index/&quot; rel=&quot;noreferrer&quot;&gt;vim-fugitive&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8283" LastActivityDate="2015-07-03T14:12:15.520" Title="Stage diff hunk into git from ediff?" Tags="|magit|git|ediff|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12372" PostTypeId="2" ParentId="12368" CreationDate="2015-05-13T12:55:46.783" Score="5" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt; for exactly this. It uses sort of a cryptic syntax in&#xA;the &lt;code&gt;:post-handlers&lt;/code&gt; keyword for doing things after you insert a pair and press&#xA;a button. Here's a pair config to do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(sp-pair &quot;{&quot; nil :post-handlers '((&quot;||\n[i]&quot; &quot;RET&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the relevant documentation on the Github wiki: &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Permissions#pre-and-post-action-hooks&quot; rel=&quot;nofollow&quot;&gt;Pre and Post Action Hooks&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="675" LastEditDate="2015-05-13T16:34:43.943" LastActivityDate="2015-05-13T16:34:43.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12373" PostTypeId="2" ParentId="12364" CreationDate="2015-05-13T14:12:31.700" Score="1" Body="&lt;p&gt;You can modify &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; and add eg. &lt;code&gt;%s&lt;/code&gt; to the &lt;code&gt;todo&lt;/code&gt; tuple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If none of the built-in format specifiers are sufficient you can use &lt;code&gt;%(my-function-here)&lt;/code&gt; as a specifier and &lt;code&gt;my-function-here&lt;/code&gt; will be called with the point on each headline in turn, so you can call functions like &lt;code&gt;org-get-scheduled-time&lt;/code&gt; and then manipulate the value and return any kind of string you want as the headline prefix.&lt;/p&gt;&#xA;" OwnerUserId="8303" LastActivityDate="2015-05-13T14:12:31.700" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12374" PostTypeId="1" CreationDate="2015-05-13T14:26:42.903" Score="3" ViewCount="488" Body="&lt;p&gt;Say I have a simple perl program:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-perl prettyprint-override&quot;&gt;&lt;code&gt;for my $i (0..10) {&#xA;    print &quot;$i\r&quot;&#xA;}&#xA;&#xA;print &quot;\n&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I run the program through &lt;code&gt;shell-command&lt;/code&gt;,&#xA;instead of getting a single line with &lt;code&gt;10&lt;/code&gt;, I will see the following thing&#xA;in the output buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  0^M1^M2^M3^M4^M5^M6^M7^M8^M9^M10^M&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is how can I make the output look like the way similar to shell output (i.e. &lt;code&gt;\r&lt;/code&gt; moves to the begin of a line, further output overwrites previous one, and &lt;code&gt;\n&lt;/code&gt; switches to a newline).&lt;/p&gt;&#xA;" OwnerUserId="8294" LastEditorUserId="15748" LastEditDate="2018-05-10T14:34:43.663" LastActivityDate="2018-05-10T14:34:43.663" Title="Make shell-command / async-shell-command respect carriage return?" Tags="|process|shell-command|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12375" PostTypeId="2" ParentId="12371" CreationDate="2015-05-13T14:54:48.253" Score="9" Body="&lt;p&gt;Move point to the file you want to partially stage/unstage using Ediff and press &lt;code&gt;e&lt;/code&gt; (&lt;code&gt;magit-ediff-dwim&lt;/code&gt;). Alternatively you can also leave point where it is and press &lt;code&gt;E s&lt;/code&gt; (&lt;code&gt;magit-ediff-stage&lt;/code&gt;) but then you will be asked about the file in the minibuffer - so moving to the file first might be more convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the resulting Ediff session use &lt;code&gt;c b&lt;/code&gt; to stage and &lt;code&gt;a b&lt;/code&gt; to unstage. Then finish the session using &lt;code&gt;q&lt;/code&gt;. You'll be asked whether you really want to finish the session. Then you'll also be asked whether you want to update the index with the contents of the buffer representing the index in Ediff. You do - the Ediff commands used previously only modified the buffer without modifying the actual index.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T14:12:15.520" LastActivityDate="2015-07-03T14:12:15.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12376" PostTypeId="1" CreationDate="2015-05-13T15:01:23.923" Score="0" ViewCount="265" Body="&lt;p&gt;I'm using evil (via spacemacs) and I want to bind &lt;code&gt;&amp;lt;f2&amp;gt;&lt;/code&gt; to open and close the undo-tree (like vim-Gundo). I can successfully bind opening &lt;code&gt;undo-tree-visualize&lt;/code&gt;, but I can't figure out how to quit. I tried the obvious:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;&amp;lt;f2&amp;gt;&quot;) 'undo-tree-visualizer)&#xA;(define-key undo-tree-visualizer-mode-map (kbd &quot;&amp;lt;f2&amp;gt;&quot;) 'undo-tree-visualizer-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It correctly opens undo-tree but doesn't close it (I get a &quot;no undo information&quot; error). I also tried to hook on load:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-undo-tree-hook ()&#xA;    (define-key undo-tree-visualizer-mode-map (kbd &quot;&amp;lt;f2&amp;gt;&quot;) 'undo-tree-visualizer-quit))&#xA;(add-hook 'undo-tree-visualizer-mode-hook 'my-undo-tree-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that also doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="8283" LastEditorUserId="115" LastEditDate="2015-05-13T15:08:27.420" LastActivityDate="2015-05-13T15:08:49.690" Title="How do I bind a key to open or close a mode? (undo-tree)" Tags="|key-bindings|evil|undo-tree-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12377" PostTypeId="2" ParentId="12376" CreationDate="2015-05-13T15:01:23.923" Score="1" Body="&lt;p&gt;To get the same key to do different things in different contexts, bind it to a function that checks if the undo tree is open. You can use &lt;code&gt;get-buffer&lt;/code&gt;[&lt;a href=&quot;https://stackoverflow.com/a/586753/79125&quot;&gt;1&lt;/a&gt;]  [&lt;a href=&quot;http://doc.endlessparentheses.com/Fun/get-buffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;2&lt;/a&gt;] to check for the undo-tree window and use the variable for the buffer name:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun undo-tree-visualizer-toggle ()&#xA;  (interactive)&#xA;  (if (get-buffer undo-tree-visualizer-buffer-name)&#xA;      (undo-tree-visualizer-quit)&#xA;    (undo-tree-visualize)))&#xA;;; You're usually in normal mode.&#xA;(define-key evil-normal-state-map (kbd &quot;&amp;lt;f2&amp;gt;&quot;) 'undo-tree-visualizer-toggle)&#xA;;; Inside the undo-tree, you're in motion mode.&#xA;(define-key evil-motion-state-map (kbd &quot;&amp;lt;f2&amp;gt;&quot;) 'undo-tree-visualizer-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can find variables with &lt;code&gt;C-h v&lt;/code&gt; (with helm I incrementally searched for &quot;undo-tree buffer&quot; to find it).&lt;/p&gt;&#xA;" OwnerUserId="8283" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-05-13T15:08:49.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12378" PostTypeId="2" ParentId="12365" CreationDate="2015-05-13T15:01:59.020" Score="3" Body="&lt;p&gt;I remove &lt;code&gt;-Wc++98-compat&lt;/code&gt; flag in my &lt;code&gt;.ycm_extra_conf.py&lt;/code&gt; file and the errors disappeared. And I also suggest to use &lt;a href=&quot;https://github.com/rdnetto/YCM-Generator&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rdnetto/YCM-Generator&lt;/a&gt; to generate  &lt;code&gt;.ycm_extra_conf.py&lt;/code&gt; file for your project.&lt;/p&gt;&#xA;" OwnerUserId="6816" LastActivityDate="2015-05-13T15:01:59.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12379" PostTypeId="2" ParentId="12315" CreationDate="2015-05-13T15:34:47.420" Score="3" Body="&lt;p&gt;Somehow I missed that at the top of the helm window it says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-z: helm-descbinds-action:describe (keeping session)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That (I think) is the persistent action that will be executed by &lt;code&gt;C-z&lt;/code&gt;. So both commands will show help for the selected function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other examples, I could use &lt;code&gt;helm-add-action-to-source&lt;/code&gt; to add new actions to them menu when you press &lt;code&gt;TAB&lt;/code&gt;. &lt;a href=&quot;https://groups.google.com/forum/#!topic/emacs-helm/Rq10QaXQdNQ&quot; rel=&quot;nofollow&quot;&gt;Example&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8283" LastEditorUserId="8283" LastEditDate="2015-05-16T15:51:11.203" LastActivityDate="2015-05-16T15:51:11.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12380" PostTypeId="2" ParentId="12350" CreationDate="2015-05-13T16:33:49.937" Score="1" Body="&lt;p&gt;The issue seemed to have something to do with ido, so I added Option B from &lt;a href=&quot;http://emacsredux.com/blog/2013/04/21/edit-files-as-root/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and it works great.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice ido-find-file (after find-file-sudo activate)&#xA;  &quot;Find file as root if necessary.&quot;&#xA;  (unless (and buffer-file-name&#xA;              (file-writable-p buffer-file-name))&#xA;    (find-alternate-file (concat &quot;/sudo:root@localhost:&quot; buffer-file-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5504" LastActivityDate="2015-05-13T16:33:49.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12383" PostTypeId="1" CreationDate="2015-05-13T19:00:39.487" Score="26" ViewCount="18302" Body="&lt;p&gt;I want to get rid of the &lt;code&gt;C-e&lt;/code&gt; binding so I can bind &lt;code&gt;C-e e&lt;/code&gt;, and &lt;code&gt;C-e r&lt;/code&gt; to a command. How do I do this?&lt;/p&gt;&#xA;&lt;p&gt;My init file has this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (global-set-key (kbd &amp;quot;C-e e&amp;quot;) 'move-end-of-line)&#xA;    (global-set-key (kbd &amp;quot;C-e r&amp;quot;) 'end-of-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8282" LastEditorUserId="105" LastEditDate="2022-04-06T15:31:47.970" LastActivityDate="2022-04-06T15:31:47.970" Title="How to unbind a key?" Tags="|key-bindings|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="12384" PostTypeId="2" ParentId="12383" CreationDate="2015-05-13T19:08:28.153" Score="32" Body="&lt;p&gt;You can &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Commands.html&quot; rel=&quot;noreferrer&quot;&gt;unset the key&lt;/a&gt; in at least two ways:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-e&quot;) nil)&#xA;(global-unset-key (kbd &quot;C-e&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I got this information with a web search for &lt;a href=&quot;https://www.google.com/search?q=emacs+unset+key&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&amp;amp;channel=fflb&quot; rel=&quot;noreferrer&quot;&gt;emacs unset key&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-05-13T19:08:28.153" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12385" PostTypeId="2" ParentId="12383" CreationDate="2015-05-13T20:05:53.340" Score="7" Body="&lt;p&gt;See @lawlist's comment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-h m&lt;/code&gt;, &lt;code&gt;C-h k&lt;/code&gt;, and &lt;code&gt;C-h b&lt;/code&gt; wherever you want to make the change.  That will help you figure out the keymap in which you need to make the change. If Dan's suggestion didn't help then clearly that keymap is not the global map. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting the key binding to &lt;code&gt;nil&lt;/code&gt; is indeed the way to unbind it.  You just need to do that in the right map.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;C-h M-k&lt;/code&gt; (&lt;code&gt;describe-keymap&lt;/code&gt;), from library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/help-fns%2b.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/a&gt; will give you a human-readable list of the bindings in a given keymap (bound to a keymap variable, such as &lt;code&gt;global-map&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-13T20:05:53.340" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12386" PostTypeId="1" CreationDate="2015-05-13T21:33:57.287" Score="1" ViewCount="1055" Body="&lt;p&gt;I'm trying to make it possible to easily edit text in Cyrillic / Russian on a remote OpenBSD 5.2 amd64.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;a href=&quot;http://OpenBSD.SU/ports/editors/emacs21,no_x11,-main&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;emacs-21.4p18-no_x11&lt;/code&gt;&lt;/a&gt;, which doesn't show any Cyrillic characters whatsoever when I try opening up a file with a &lt;code&gt;windows-1251&lt;/code&gt; encoding (instead showing question marks and sometimes even randomly mangling the file when a save is attempted), unless I start it as &lt;code&gt;env LANG=bg_BG.CP1251 emacs&lt;/code&gt; (for some reason, there's no &lt;code&gt;ru_RU.CP1251&lt;/code&gt; in &lt;a href=&quot;http://OpenBSD.SU/src/share/locale/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;/usr/share/locale/&lt;/code&gt;&lt;/a&gt;) and PuTTY to &lt;code&gt;Win1251 (Cyrillic)&lt;/code&gt;; however, this only works in displaying the characters, not for typing any characters&amp;nbsp;&amp;mdash; switching the local keyboard to Russian and typing into emacs causes various random internal commands to be executed, even though quitting emacs and using &lt;a href=&quot;http://mdoc.su/o/cat.1&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;cat(1)&lt;/code&gt;&lt;/a&gt; works without any issues for Russian input (which could then be opened up in emacs and copy-pasted from the temp file to the real one, which is very cumbersome and unproductive).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(FWIIW, I've also tried &lt;a href=&quot;http://OpenBSD.SU/src/usr.bin/mg/tutorial&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;mg(1)&lt;/code&gt;&lt;/a&gt;, but it shows up Russian characters as &lt;code&gt;\315&lt;/code&gt; etc, and doesn't let you type in Russian, either.)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If the files I'm editing are &lt;code&gt;nginx.conf&lt;/code&gt;, is there a way to automatically specify the encoding for emacs?  All the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;File Variables&lt;/a&gt; examples appear to start with a &lt;code&gt;mode&lt;/code&gt;, but there's no mode for &lt;code&gt;nginx.conf&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do I make emacs / mg load files in either &lt;code&gt;windows-1251&lt;/code&gt; or &lt;code&gt;koi8-r&lt;/code&gt;, and show them in &lt;code&gt;UTF-8&lt;/code&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do I make emacs / mg accept Cyrillic input?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7179" LastActivityDate="2015-05-13T21:33:57.287" Title="How do I edit text in Cyrillic / Russian on OpenBSD?" Tags="|character-encoding|input-method|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12387" PostTypeId="2" ParentId="12359" CreationDate="2015-05-13T21:49:00.120" Score="1" Body="&lt;p&gt;Assuming there are not TAB characters (which is usually true in Haskell files), then &lt;code&gt;(- (point) (line-beginning-position))&lt;/code&gt; should give you the &quot;column&quot; info you need (and &lt;code&gt;(forward-char N)&lt;/code&gt; should advance by the right number of &quot;columns&quot;).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-13T21:49:00.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12388" PostTypeId="1" CreationDate="2015-05-13T22:01:42.550" Score="5" ViewCount="3198" Body="&lt;p&gt;Right now the font in the menu bar is way too big, so I would like to add a line to my .emacs file that regulates that font size.  I already have a line that takes care of the buffer font size, but it doesn't affect the menu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Context: I am sshing into a unix machine from my Mac, and launching emacs from the terminal there.&lt;/p&gt;&#xA;" OwnerUserId="8308" LastEditorUserId="8308" LastEditDate="2015-05-13T23:29:26.173" LastActivityDate="2023-05-16T09:54:29.960" Title="How do I change the menu font size?" Tags="|fonts|menu-bar|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12390" PostTypeId="1" AcceptedAnswerId="12513" CreationDate="2015-05-13T23:53:00.967" Score="2" ViewCount="502" Body="&lt;p&gt;For &lt;a href=&quot;https://github.com/jgarvin/mandimus&quot; rel=&quot;nofollow&quot;&gt;my speech recognition mode&lt;/a&gt; I have emacs listen asynchronously using &lt;code&gt;make-network-process&lt;/code&gt; for messages sent by my python client. If I say anything that should translate to emacs taking an action the python client send an elisp snippet to execute. To prevent bad code snippets from causing emacs to go unresponsive I wrap the code in a &lt;code&gt;with-timeout&lt;/code&gt; as a failsafe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is if I use TRAMP to try to open say C-x C-f &lt;code&gt;/sudo::/tmp/foo&lt;/code&gt;, emacs completely blocks on waiting for me to enter my password. Any packets sent by the client are ignored -- emacs isn't pulling any data off the socket. This means that if I'm only using my voice with-timeout always fires, and even if I'm typing that day I need to type really quickly. This is weird because 99% of the time minibuffer prompts don't do this -- usually the rest of emacs keeps running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have tramp mode not completely block? Maybe a custom command prompting for the password that sticks it in tramp's password cache so that tramp's command to ask doesn't fire?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-05-19T14:46:34.177" Title="How to prevent tramp from blocking when entering password?" Tags="|tramp|async|sudo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12391" PostTypeId="1" AcceptedAnswerId="12434" CreationDate="2015-05-14T00:48:10.527" Score="16" ViewCount="2103" Body="&lt;p&gt;Currently to insert internal org-mode org-id links, I navigate to a heading or pull it up in agenda view (C-a s heading test search RET), store the link with C-l (org-store-link), going back to where I want to insert the link, then insert the link with C-c C-l (org-insert-link).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I would prefer to map a key that allows me to insert a link at &#xA;the current point using tab completion similar to org-refile (C-c C-w). The intended result would be an org-id internal link in the form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[id:d7534b2f-c221-4dea-8566-d5ce3e4e1b78][Example Link]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looking through org-id.el, it seems like org-id-get-with-outline-path-completion was designed for this purpose. I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-ci&quot; (lambda () (interactive) (org-id-get-with-outline-path-completion)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it didn't work as intended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following in my init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Use global IDs&#xA;(require 'org-id)&#xA;(setq org-id-link-to-org-use-id t)&#xA;&#xA;;; Update ID file .org-id-locations on startup&#xA;(org-id-update-id-locations)&#xA;&#xA;;; Refile options&#xA;(setq org-refile-targets (quote ((nil :maxlevel . 9) (org-agenda-files :maxlevel . 9))))&#xA;(setq org-refile-use-outline-path 'file)&#xA;(setq org-outline-path-complete-in-steps t)&#xA;(setq org-refile-allow-creating-parent-nodes t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="804" LastEditorUserId="804" LastEditDate="2015-05-14T05:15:33.173" LastActivityDate="2016-11-04T17:40:54.987" Title="Insert Org-id Link at Point via Outline Path Completion" Tags="|org-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12392" PostTypeId="1" AcceptedAnswerId="12419" CreationDate="2015-05-14T02:27:57.430" Score="4" ViewCount="315" Body="&lt;p&gt;Stumbled upon the following problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever &lt;code&gt;fill-paragraph&lt;/code&gt; finds a LaTeX citation such as &lt;code&gt;\citep[][p. 10]{darwin1859}&lt;/code&gt; (which appears as &lt;code&gt;(Darwin, 1859, p. 10)&lt;/code&gt;), the paragraph gets broken like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Text text text text \citep[][p.&#xA;10]{darwin1859} text text text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I keep the citation intact, including the whitespace in &lt;code&gt;[p. 10]&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now for what I've found so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a &lt;code&gt;fill-nobreak-predicate&lt;/code&gt; hook that may contain functions that check whether &lt;code&gt;fill-paragraph&lt;/code&gt; should skip certain regexps from being split (if I'm not mistaken).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried with this code but failed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-nobreak-p ()&#xA;  (looking-at-p &quot;\\\\citep.*\\}&quot;))&#xA;(add-hook 'fill-nobreak-predicate #'my-nobreak-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="920" LastActivityDate="2015-05-15T20:39:04.263" Title="Prevent fill-paragraph from breaking LaTeX citations in Org Mode" Tags="|org-mode|elisp|regular-expressions|fill-paragraph|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12393" PostTypeId="2" ParentId="12364" CreationDate="2015-05-14T02:46:04.233" Score="9" Body="&lt;p&gt;One way to show extra information in the todo list with the &lt;a href=&quot;http://orgmode.org/manual/Column-view.html#Column-view&quot; rel=&quot;noreferrer&quot;&gt;columns&lt;/a&gt; view.  Activate it with &lt;code&gt;C-c C-x C-c&lt;/code&gt; (which runs &lt;code&gt;org-agenda-columns&lt;/code&gt;).  This gives you a spreadsheet like view where the default columns are given by &lt;code&gt;org-columns-default-format&lt;/code&gt;.  Adding the string &quot;TIMESTAMP&quot; to this will display any timestamp found in the entry.  You can also use &quot;SCHEDULED&quot; or &quot;DEADLINE&quot; to show specific kinds of timestamps.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-columns-default-format&#xA;      &quot;%25ITEM %TODO %3PRIORITY %TIMESTAMP&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;shows the item's headline, the todo state, the priority and the timestamp.  If you want to show the column view by default, set &lt;code&gt;org-agenda-view-columns-initially&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.  If you want this to affect only a single agenda view, add it as a local setting in &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;t&quot; &quot;List of all TODO entries&quot;&#xA;               alltodo &quot;&quot;&#xA;               ((org-agenda-view-columns-initially t))&#xA;               ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The column format can be set here as well to have different sets of columns for different agendas&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="675" LastEditDate="2015-05-15T21:40:45.050" LastActivityDate="2015-05-15T21:40:45.050" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12394" PostTypeId="1" AcceptedAnswerId="12395" CreationDate="2015-05-14T04:48:05.153" Score="4" ViewCount="1504" Body="&lt;p&gt;I am trying to understand the implication of using&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq deactivate-mark t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;vs&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(deactivate-mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to try to notice any difference, I made this dummy function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/dummy-fn (arg start end)&#xA;  (interactive &quot;P\nr&quot;)&#xA;  (if arg&#xA;      (setq deactivate-mark t)&#xA;    (deactivate-mark))&#xA;  (message &quot;Arg: %0s Region: %s&quot; arg (buffer-substring start end)))&#xA;(global-set-key (kbd &quot;C-c n&quot;) #'my/dummy-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Eval the above, including the &lt;code&gt;global-set-key&lt;/code&gt;; it will be easier to try out the snippet. You can later eval &lt;code&gt;(global-set-key (kbd &quot;C-c n&quot;) nil)&lt;/code&gt; to free up the &lt;code&gt;C-c n&lt;/code&gt; binding.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;When you select a region and hit &lt;code&gt;C-c n&lt;/code&gt;, &lt;code&gt;(deactivate-mark)&lt;/code&gt; will be used and it will print&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Arg: nil Region:«YOUR-SELECTED-REGION»&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When you select a region and hit &lt;code&gt;C-u C-c n&lt;/code&gt;, &lt;code&gt;(setq deactivate-mark t)&lt;/code&gt; will be used and it will print&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Arg: (4) Region:«YOUR-SELECTED-REGION»&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I did not notice any difference between the two executions (and most likely this dummy function was not ideal to tell the difference).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;When would one use the function and not the setq, and vice-versa?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;A rough survey in emacs elisp source code tells that both are used, but the use of &lt;code&gt;(deactivate-mark)&lt;/code&gt; as a function is more prominent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Below, the number following the file name and colon tells the number of times the searched pattern occurred in that file.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use as a function&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;km²~/downloads/:git/emacs&amp;gt; ag '\(deactivate-mark[\st]*\)' -G '\.el' -c&#xA;emacs-lisp/ert-x.el:1&#xA;emulation/cua-base.el:1&#xA;emulation/edt.el:1&#xA;emulation/viper-util.el:1&#xA;erc/erc-goodies.el:2&#xA;emacs-lisp/tcover-ses.el:1&#xA;gnus/nnnil.el:1&#xA;isearch.el:1&#xA;info.el:2&#xA;international/mule.el:2&#xA;leim/quail/hangul.el:1&#xA;mail/rmail.el:1&#xA;mwheel.el:1&#xA;replace.el:2&#xA;mouse.el:5&#xA;obsolete/mouse-sel.el:1&#xA;obsolete/tpu-edt.el:1&#xA;org/org-w3m.el:1&#xA;ses.el:1&#xA;ps-print.el:1&#xA;org/org.el:4&#xA;progmodes/f90.el:2&#xA;skeleton.el:1&#xA;tempo.el:1&#xA;term/ns-win.el:2&#xA;startup.el:1&#xA;term.el:1&#xA;textmodes/picture.el:2&#xA;simple.el:10&#xA;textmodes/reftex-index.el:1&#xA;textmodes/bibtex.el:1&#xA;type-break.el:1&#xA;vc/ediff-util.el:1&#xA;winner.el:1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Setting the var&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;km²~/downloads/:git/emacs&amp;gt; ag '\(setq deactivate-mark t\)' -G '\.el' -c&#xA;delsel.el:1&#xA;emulation/cua-rect.el:1&#xA;emulation/cua-base.el:1&#xA;indent.el:1&#xA;ses.el:2&#xA;rect.el:2&#xA;register.el:4&#xA;simple.el:2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-05-14T16:23:21.090" Title="When should one use the deactivate-mark function vs just setting that var to t?" Tags="|elisp|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12395" PostTypeId="2" ParentId="12394" CreationDate="2015-05-14T05:35:26.073" Score="5" Body="&lt;p&gt;Good question.  If you compare the doc strings of the two, or compare their code, the use cases amount to these, I think:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Variable:&lt;/strong&gt; If it is non-&lt;code&gt;nil&lt;/code&gt; at the end of a command, then the command loop deactivates the mark after that command.  If it is &lt;code&gt;nil&lt;/code&gt; at the end of the command then the mark is not deactivated.  You can set it to &lt;code&gt;nil&lt;/code&gt; at the end of a command that you will invoke while the region is active, to keep it active when the command is done.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt; Use it to deactivate the mark now.  For example, your code or the user has activated the region and maybe done some stuff with that active region.  But then your code needs to do some stuff without the region being active, so it deactivates it.  IOW, you can call this function to deactivate the mark, so subsequent code won't do something wrong because the region is active.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They are really about two different things.  The variable is used generally to prevent subsequent automatic deactivation (e.g. by the command loop).  The function's aim is to turn off the region now, so that some subsequent processing is not messed up because it might act wrong if the region were active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of using the variable (from &lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt; - the command needs to keep the region active when it finishes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mark-buffer-after-point (reversep)&#xA;  &quot;Select the part of the buffer after point.&#xA;With a prefix argument, select the part before point.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (push-mark (if reversep (point-min) (point-max)) nil t)&#xA;  (setq deactivate-mark  nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example of using the function (from &lt;code&gt;info.el&lt;/code&gt;) - the command wants to do its thing with the region deactivated, so the first thing it does is deactivate it.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun Info-search (regexp &amp;amp;optional bound _noerror _count direction)&#xA;  (interactive...)&#xA;  (deactivate-mark)&#xA;  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="780" LastEditDate="2015-05-14T16:23:21.090" LastActivityDate="2015-05-14T16:23:21.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12396" PostTypeId="1" AcceptedAnswerId="12406" CreationDate="2015-05-14T08:03:54.747" Score="20" ViewCount="11909" Body="&lt;p&gt;I'm trying to get a lisp script to run some commands for me when I open a file of a specific filetype. I know that I'm working in the correct init file because if I remove the theme from it, emacs has no theme when I start it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the script I'm using which doesn't work (no errors or anything):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-project-hook (filename)&#xA;  (when (string= (file-name-extension filename) &quot;ts&quot;)&#xA;    ((typescript-mode)&#xA;     (tss-setup-current-buffer))&#xA;  ) &#xA;)&#xA;&#xA;(add-hook 'after-load-functions 'my-project-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8312" LastEditorUserId="25" LastEditDate="2015-05-14T13:47:51.640" LastActivityDate="2015-05-14T13:47:51.640" Title="Run command when opening a file of a specific filetype" Tags="|hooks|files|major-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12397" PostTypeId="1" CreationDate="2015-05-14T08:55:28.620" Score="6" ViewCount="2405" Body="&lt;p&gt;My particular setup is that my code lives on my machine and is mounted via vagrant onto a linux container upon which the virtual env lives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to edit all the code, including the site-packages which live on the LXC seemlessly and have them all integrated with something like elpy (which is amazing, all credit to those guys) in the context of the virtuall environment which is on the LXC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do this?&lt;/p&gt;&#xA;" OwnerUserId="905" LastEditorUserId="905" LastEditDate="2015-06-02T08:19:07.323" LastActivityDate="2022-03-30T10:59:14.280" Title="How do I use a remote virtual environment with emacs?" Tags="|python|remote|environment|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12398" PostTypeId="5" CreationDate="2015-05-14T10:26:40.303" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-05-14T10:26:40.303" LastActivityDate="2015-05-14T10:26:40.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12399" PostTypeId="4" CreationDate="2015-05-14T10:26:40.303" Score="0" Body="ERT is a tool for automated testing in Emacs Lisp. Its main features are facilities for defining tests, running them and reporting the results, and for debugging test failures interactively." OwnerUserId="5472" LastEditorUserId="5472" LastEditDate="2015-05-14T11:01:13.947" LastActivityDate="2015-05-14T11:01:13.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12400" PostTypeId="1" AcceptedAnswerId="12405" CreationDate="2015-05-14T10:30:05.233" Score="2" ViewCount="120" Body="&lt;p&gt;I'm currently starting to build a package the TDD way, and for that I'm using &lt;code&gt;ert&lt;/code&gt;, following &lt;code&gt;ert-runner&lt;/code&gt; &lt;em&gt;opinions&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to write a set of &lt;strong&gt;pending tests&lt;/strong&gt;, to identify what I have I to test, before to implement the test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is it possible to write pending test in &lt;code&gt;ert&lt;/code&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so how? :)&lt;/p&gt;&#xA;" OwnerUserId="5472" LastActivityDate="2015-05-15T18:55:17.167" Title="Pending test in Ert" Tags="|ert|testing|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12401" PostTypeId="2" ParentId="12396" CreationDate="2015-05-14T11:25:44.897" Score="11" Body="&lt;p&gt;What you are looking for is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Visiting-Functions.html#Visiting-Functions&quot;&gt;&lt;code&gt;find-file-hook&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'find-file-hook 'my-project-hook)&#xA;(defun my-project-hook ()&#xA;  (when (string= (file-name-extension buffer-file-name) &quot;ts&quot;)&#xA;    (typescript-mode)&#xA;    (tss-setup-current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-05-14T11:25:44.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12402" PostTypeId="1" CreationDate="2015-05-14T12:03:27.177" Score="0" ViewCount="519" Body="&lt;p&gt;I can't tell in what update exactly did this happen but since not so long ago Org adds a &lt;code&gt;label{orgsrcblock#}&lt;/code&gt; to custom listings environments. Unfortunately, I can't find a way to tell listings to ignore this line, and it gets printed together with the source code.  Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :exports none&#xA;  (setq org-latex-pdf-process&#xA;          '(&quot;latexmk -pdflatex='pdflatex -shell-escape -interaction nonstopmode' -pdf -f %f&quot;)&#xA;          org-latex-listings t&#xA;          org-src-fontify-natively t&#xA;          org-latex-custom-lang-environments '((maxima &quot;maxima&quot;))&#xA;          org-babel-latex-htlatex &quot;htlatex&quot;)&#xA;  (defmacro by-backend (&amp;amp;rest body)&#xA;      `(cl-case (when (boundp 'backend) (org-export-backend-name backend))&#xA;         ,@body))&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_LATEX&#xA;\definecolor{codebg}{rgb}{0.96,0.99,0.8}&#xA;\lstnewenvironment{maxima}{%&#xA;  \lstset{%&#xA;    backgroundcolor=\color{codebg},&#xA;    aboveskip=20pt,&#xA;    captionpos=b,&#xA;    showstringspaces=false,&#xA;    frame=single,&#xA;    framerule=0pt,&#xA;    basicstyle=\ttfamily\scriptsize,&#xA;    columns=fixed}}{}&#xA;}&#xA;#+END_LATEX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then somewhere later:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*Solution:*&#xA;#+NAME: prob3&#xA;#+HEADER: :exports both&#xA;#+BEGIN_SRC maxima :results output raw&#xA;  n: 4;&#xA;  tex(sum(binomial(n, i) * 3^i * (-2)^(n - i), i, 0, n));&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in LaTeX code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\textbf{Solution:}&#xA;\begin{maxima}&#xA;n: 4;&#xA;tex(sum(binomial(n, i) * 3^i * (-2)^(n - i), i, 0, n));&#xA;\label{orgsrcblock1}&#xA;&#xA;\end{maxima}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and is displayed as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZPKxl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;The relevant part of Org code which generates this is:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-latex-src-block&lt;/code&gt; in &lt;code&gt;ox-latex.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Case 2.  Custom environment.&#xA;   (custom-env&#xA;(let ((caption-str (org-latex--caption/label-string src-block info)))&#xA;  (format &quot;\\begin{%s}\n%s\\end{%s}\n&quot;&#xA;      custom-env&#xA;      (concat (and caption-above-p caption-str)&#xA;          (org-export-format-code-default src-block info)&#xA;          (and (not caption-above-p) caption-str))&#xA;      custom-env)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-13T15:11:43.433" Title="Why is Org adding a label in custom Babel environment?" Tags="|org-mode|latex|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12403" PostTypeId="2" ParentId="12360" CreationDate="2015-05-14T13:21:35.373" Score="4" Body="&lt;p&gt;I've managed to do it myself. Here's the code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun company-transform-python (candidates)&#xA;  (let ((deleted))&#xA;    (mapcar #'(lambda (c)&#xA;        (if (or (string-prefix-p &quot;_&quot; c) (string-prefix-p &quot;._&quot; c))&#xA;            (progn&#xA;              (add-to-list 'deleted c)&#xA;              (setq candidates (delete c candidates)))))&#xA;        candidates) &#xA;    (append candidates (nreverse deleted))))&#xA;&#xA;&#xA;(defun my-python-conf()&#xA;  (setq-local company-transformers&#xA;          (append company-transformers '(company-transform-python))))&#xA;&#xA;(add-hook 'python-mode-hook 'my-python-conf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's kind of my first contact more deeply with elisp, so please excuse the bad code.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-05-22T11:54:55.627" LastActivityDate="2015-05-22T11:54:55.627" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12404" PostTypeId="1" CreationDate="2015-05-14T13:28:56.430" Score="3" ViewCount="1521" Body="&lt;p&gt;I am trying to load &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-drill.html&quot; rel=&quot;nofollow&quot;&gt;org-drill&lt;/a&gt; in Emacs with &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;spacemacs&lt;/a&gt; configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have added the module into &lt;code&gt;.spacemacs&lt;/code&gt; file as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-variable&#xA; ;; ...&#xA; '(org-modules&#xA;   (quote&#xA;    (org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail org-w3m org-drill)))&#xA;  ;; ...&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I am opening &lt;code&gt;spanish.org&lt;/code&gt; (as in instruction), I see an error in &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Problems while trying to load feature &lt;code&gt;org-drill&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Does anyone know how can I fix this?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8314" LastEditorUserId="504" LastEditDate="2015-05-15T10:24:24.717" LastActivityDate="2017-04-04T14:50:07.870" Title="org-drill doesn't load with spacemacs configuration" Tags="|org-mode|spacemacs|org-drill|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12405" PostTypeId="2" ParentId="12400" CreationDate="2015-05-14T13:36:54.217" Score="2" Body="&lt;p&gt;Placing a call to &lt;code&gt;ert-skip&lt;/code&gt; at the beginning of your test would be the solution I believe. If you'd like, you can pass the string &quot;pending&quot; to the function to better show why it was skipped.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest my-pending-test ()&#xA;  (ert-skip &quot;pending&quot;)&#xA;  (should (dostuff)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-05-14T13:36:54.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12406" PostTypeId="2" ParentId="12396" CreationDate="2015-05-14T13:47:25.523" Score="21" Body="&lt;p&gt;In Emacs terminology, these are two different steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Associate files with the &lt;code&gt;.ts&lt;/code&gt; extension with the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Major-Modes.html#Major-Modes&quot;&gt;major mode&lt;/a&gt; &lt;code&gt;typescript-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Run the function &lt;code&gt;tss-setup-current-buffer&lt;/code&gt; when Typescript mode starts.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To choose &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#index-magic_002dmode_002dalist&quot;&gt;which major mode to use&lt;/a&gt; for certain file names, add an entry to the variable &lt;code&gt;auto-mode-alist&lt;/code&gt;. Put the following line in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.ts\\'&quot; . typescript-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\.ts\'&lt;/code&gt; is a regular expression that matches file names with the &lt;code&gt;.ts&lt;/code&gt; extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To run the function &lt;code&gt;tss-setup-current-buffer&lt;/code&gt; whenever Typescript mode starts (I presume that you want to run it even for Typescript mode files that don't have the &lt;code&gt;.ts&lt;/code&gt; extension), add it to the Typescript mode startup &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html#Hooks&quot;&gt;hook&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'typescript-mode-hook 'tss-setup-current-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depending on how you installed &lt;code&gt;typescript.el&lt;/code&gt; and &lt;code&gt;tss.el&lt;/code&gt;, you may also need to declare that the functions &lt;code&gt;typescript-mode&lt;/code&gt; and &lt;code&gt;tss-setup-current-buffer&lt;/code&gt; have to be loaded from those files. This avoids having to load &lt;code&gt;typescript.el&lt;/code&gt; and &lt;code&gt;tss.el&lt;/code&gt; as soon as Emacs start: they will be loaded on demand, when you first open a &lt;code&gt;.ts&lt;/code&gt; file or run &lt;code&gt;typescript-mode&lt;/code&gt; explicitly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'typescript-mode &quot;Major mode for typescript files&quot; t)&#xA;(autoload 'tss-setup-current-buffer &quot;Set up the current file for TSS&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-05-14T13:47:25.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12407" PostTypeId="1" CreationDate="2015-05-08T12:30:27.073" Score="4" ViewCount="335" Body="&lt;p&gt;While using slime+emacs, I'm having a problem when interacting with the debugger: every time that I choose one of the debugger's option, a new window pops up in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when evaluating:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(step (progn&#xA;        (print 1)&#xA;        (print 2)&#xA;        (print 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The debugger prints:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Evaluating call:&#xA;  (PRINT 1)&#xA;With arguments:&#xA;  1&#xA;   [Condition of type SB-EXT:STEP-FORM-CONDITION]&#xA;&#xA;Restarts:&#xA; 0: [STEP-CONTINUE] Resume normal execution&#xA; 1: [STEP-OUT] Resume stepping after returning from this function&#xA; 2: [STEP-NEXT] Step over call&#xA; 3: [STEP-INTO] Step into call&#xA; 4: [RETRY] Retry SLIME REPL evaluation request.&#xA; 5: [ABORT] Return to sldb level 3.&#xA; --more--&#xA;&#xA;Backtrace:&#xA;  0: ((LAMBDA ()))&#xA;  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LET ((SB-IMPL::*STEP-OUT* :MAYBE)) (UNWIND-PROTECT (SB-IMPL::WITH-STEPPING-ENABLED #))) #S(SB-KERNEL:LEXENV :FUNS NIL :VARS NIL :BLOCKS NIL :TAGS NIL :TYPE-RESTRICTIONS ..&#xA;  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (STEP (PROGN (PRINT 1) (PRINT 2) (PRINT 3))) #&amp;lt;NULL-LEXENV&amp;gt;)&#xA;  3: (EVAL (STEP (PROGN (PRINT 1) (PRINT 2) (PRINT 3))))&#xA; --more--&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I choose the option 2, &lt;code&gt;STEP-NEXT&lt;/code&gt; and it correctly goes to the next form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Evaluating call:&#xA;  (PRINT 2)&#xA;With arguments:&#xA;  2&#xA;   [Condition of type SB-EXT:STEP-FORM-CONDITION]&#xA;&#xA;Restarts:&#xA; 0: [STEP-CONTINUE] Resume normal execution&#xA; 1: [STEP-OUT] Resume stepping after returning from this function&#xA; 2: [STEP-NEXT] Step over call&#xA; 3: [STEP-INTO] Step into call&#xA; 4: [RETRY] Retry SLIME REPL evaluation request.&#xA; 5: [ABORT] Return to sldb level 3.&#xA; --more--&#xA;&#xA;Backtrace:&#xA;  0: ((LAMBDA ()))&#xA;  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LET ((SB-IMPL::*STEP-OUT* :MAYBE)) (UNWIND-PROTECT (SB-IMPL::WITH-STEPPING-ENABLED #))) #S(SB-KERNEL:LEXENV :FUNS NIL :VARS NIL :BLOCKS NIL :TAGS NIL :TYPE-RESTRICTIONS ..&#xA;  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (STEP (PROGN (PRINT 1) (PRINT 2) (PRINT 3))) #&amp;lt;NULL-LEXENV&amp;gt;)&#xA;  3: (EVAL (STEP (PROGN (PRINT 1) (PRINT 2) (PRINT 3))))&#xA; --more--&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it also splits emacs window, adding a brand new one! After 3 or 4 of these it stops working, with many new windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is causing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;I'm using SBCL-1.2.11 and SLIME 2015-02-19. My Emacs is the latest version of &lt;a href=&quot;http://overtone.github.io/emacs-live/&quot; rel=&quot;nofollow&quot;&gt;Emacs Live&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8328" OwnerDisplayName="EuAndré" LastEditorUserId="8328" LastEditDate="2015-05-16T01:14:01.257" LastActivityDate="2015-05-16T01:14:01.257" Title="Slime creates new window every time you interact with the debugger" Tags="|common-lisp|slime|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12408" PostTypeId="2" ParentId="12402" CreationDate="2015-05-14T14:14:50.560" Score="1" Body="&lt;p&gt;This appears to be a problem with how &lt;code&gt;listings&lt;/code&gt; package treats LaTeX code inside listings. Below is a patch, for those who may encounter this problem, but I doubt Org developers will be willing to incorporate this, so use at your own risk.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;From 063a5ea97a9d7810a344b3e6fafcb6ebb1588d6c Mon Sep 17 00:00:00 2001&#xA;From: wvxvw &amp;lt;wvxvw@localhost&amp;gt;&#xA;Date: Thu, 14 May 2015 17:00:25 +0300&#xA;Subject: [PATCH] Wrap labels when in custom listings environment.&#xA;&#xA;---&#xA; lisp/ox-latex.el | 27 +++++++++++++++++++++++----&#xA; 1 file changed, 23 insertions(+), 4 deletions(-)&#xA;&#xA;diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el&#xA;index 192739a..bd57e13 100644&#xA;--- a/lisp/ox-latex.el&#xA;+++ b/lisp/ox-latex.el&#xA;@@ -1058,6 +1058,17 @@ INFO is a plist holding contextual information.&quot;&#xA;       (let ((type (org-element-type element)))&#xA;    (memq (if (eq type 'link) 'image type) above)))))&#xA;&#xA;+(defvar org-listings-escape-inside nil&#xA;+  &quot;Whenever `org-latex-custom-lang-environments' is set setting&#xA;+this variable will result in \&quot;\\label{}\&quot; being wrapped into &#xA;+specified delimiters.  For example, if set to '(\&quot;(@*\&quot; . \&quot;*@)\&quot;)&#xA;+will produces \&quot;(@*\\label{}*@)\&quot;.  This must correspond with&#xA;+\\lstnewenvironment{new-language}{%&#xA;+  \\lstset{%&#xA;+    escapeinside={(*@}{@*)},&#xA;+    ...}}&#xA;+&quot;)&#xA;+&#xA; (defun org-latex--label (datum info &amp;amp;optional force full)&#xA;   &quot;Return an appropriate label for DATUM.&#xA; DATUM is an element or a `target' type object.  INFO is the&#xA;@@ -1068,7 +1079,8 @@ keyword or no CUSTOM_ID property, unless FORCE is non-nil.  In&#xA; this case always return a unique label.&#xA;&#xA; Eventually, if FULL is non-nil, wrap label within \&quot;\\label{}\&quot;.&quot;&#xA;-  (let* ((type (org-element-type datum))&#xA;+  (let* ((lang (org-element-property :language datum))&#xA;+    (type (org-element-type datum))&#xA;     (user-label&#xA;      (org-element-property&#xA;       (case type&#xA;@@ -1093,9 +1105,16 @@ Eventually, if FULL is non-nil, wrap label within \&quot;\\label{}\&quot;.&quot;&#xA;                 &quot;fig:&quot;)))&#xA;             (org-export-get-reference datum info))))))&#xA;     (cond ((not full) label)&#xA;-     (label (format &quot;\\label{%s}%s&quot;&#xA;-            label&#xA;-            (if (eq type 'target) &quot;&quot; &quot;\n&quot;)))&#xA;+     (label&#xA;+      (cl-destructuring-bind (left . right)&#xA;+          (if (and lang org-listings-escape-inside&#xA;+           (cadr (assq (intern lang)&#xA;+                   org-latex-custom-lang-environments)))&#xA;+          org-listings-escape-inside&#xA;+        '(&quot;&quot; . &quot;&quot;))&#xA;+        (format &quot;%s\\label{%s}%s%s&quot;&#xA;+            left label&#xA;+            (if (eq type 'target) &quot;&quot; &quot;\n&quot;) right)))&#xA;      (t &quot;&quot;))))&#xA;&#xA; (defun org-latex--caption/label-string (element info)&#xA;-- &#xA;2.1.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The source of the problem was that &lt;code&gt;listings&lt;/code&gt; package treats LaTeX code inside its environment as verbatim.  But it is also possible to make it look for interpretable LaTeX code.  In order to do this, you need to wrap that code in special delimiters.  So, for example, your environment definition could look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\lstnewenvironment{maxima}{%&#xA;  \lstset{%&#xA;    backgroundcolor=\color{codebg},&#xA;    escapeinside={(*@}{@*)},&#xA;    aboveskip=20pt,&#xA;    captionpos=b,&#xA;    label=,&#xA;    caption=,&#xA;    showstringspaces=false,&#xA;    frame=single,&#xA;    framerule=0pt,&#xA;    basicstyle=\ttfamily\scriptsize,&#xA;    columns=fixed}}{}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the &lt;code&gt;escapeinside={(*@}{@*)},&lt;/code&gt; line.  Then you would also set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-custom-lang-environments '((maxima &quot;maxima&quot;))&#xA;      org-listings-escape-inside '(&quot;(*@&quot; . &quot;@*)&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And, provided you applied the patch, Org will generate the code similar to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{maxima}&#xA;n: 4;&#xA;tex(sum(binomial(n, i) * 3^i * (-2)^(n - i), i, 0, n));&#xA;(*@\label{orgsrcblock1}&#xA;@*)&#xA;\end{maxima}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-05-14T14:14:50.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12409" PostTypeId="1" CreationDate="2015-05-14T17:05:16.920" Score="1" ViewCount="616" Body="&lt;p&gt;I would like to write an Emacs lisp function, that I can bind to a key shortcut. It will read in the two previous time entries in the format HHMM from the buffer and spit out the difference between them in the format 0.75, that is 45 minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the format it should operate with. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1400 Enable ftp access for Sarah&#xA;1430   &#xA;.5 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;find the previous instance of HHMM in this buffer, occurs at the beginning of a line, and then find the one before that&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;determine the difference between the two times&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;output in hours with decimal fractions instead of minutes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Pseudo code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$end-time      = (search back from pointer for previous instance of HHMM)&#xA;$begin-time    = (search for second previous instance of HHMM)&#xA;&#xA;$end-hour      = $end-time[0,1]&#xA;$end-minute    = $end-time[2,3]&#xA;&#xA;$begin-hour    = $begin-time[0,1]&#xA;$begin-minute  = $begin-time[2,3]&#xA;&#xA;$total-hours   = $end-hour - $begin-hour&#xA;$total-minutes = $end-minutes - $begin-minutes&#xA;&#xA;return $total-hours + ($total-minutes * 0.01666666667)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8317" LastEditorUserId="8317" LastEditDate="2015-05-14T20:32:18.620" LastActivityDate="2015-05-15T10:54:47.317" Title="Emacs lisp function to count the difference between two times" Tags="|elisp|parse-time|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12410" PostTypeId="1" AcceptedAnswerId="12417" CreationDate="2015-05-14T17:11:20.013" Score="2" ViewCount="246" Body="&lt;p&gt;I have the strong feeling that the functionality of the following two functions should already be provided by some standard macro or function in emacs. It would be nice if someone could give me a pointer to those.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun classify (classifier list &amp;amp;rest key-values)&#xA;  &quot;Maps the LIST entries through CLASSIFIER to class denotators.&#xA;Returns the alist of equivalence classes.  Each equivalence class&#xA;is a cons whose `car' is the class denotator and the cdr is the&#xA;list of members.&#xA;Keywords supported: :test&quot;&#xA;  (let ((test (or (plist-get key-values :test) 'equal)))&#xA;    (let (classify-res)&#xA;      (dolist (classify-li list)&#xA;    (let* ((classify-key (funcall classifier classify-li))&#xA;           (classify-class (cl-assoc classify-key classify-res :test test)))&#xA;      (if classify-class&#xA;          (setcdr classify-class (cons classify-li (cdr classify-class)))&#xA;        (setq classify-res (cons (list classify-key classify-li) classify-res)))))&#xA;      classify-res)))&#xA;&#xA;(defun max-el (list &amp;amp;rest key-values)&#xA;  &quot;Return maximal element.&#xA;Keywords supported: :test&quot;&#xA;  (let ((max-el-max (car-safe list))&#xA;    (max-el-test (or (plist-get key-values :test) '&amp;gt;)))&#xA;    (setq list (cdr list))&#xA;    (while list&#xA;      (when (funcall max-el-test (car list) max-el-max)&#xA;    (setq max-el-max (car list)))&#xA;      (setq list (cdr list)))&#xA;    max-el-max))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq classes (classify 'file-name-extension&#xA;               '(&quot;first.txt&quot; &quot;second.txt&quot;&#xA;                 &quot;script1.el&quot; &quot;script2.el&quot; &quot;script3.el&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;el&quot; &quot;script3.el&quot; &quot;script2.el&quot; &quot;script1.el&quot;) (&quot;txt&quot; &quot;second.txt&quot; &quot;first.txt&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(max-el classes :test  (lambda (c1 c2) (&amp;gt; (length c1) (length c2))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;el&quot; &quot;script3.el&quot; &quot;script2.el&quot; &quot;script1.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, that I did not care very much about the efficiency of the function definitions above since I assume that there is already an efficient standard version. These definitions are just listed here to show which behavior I need.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-05-14T17:16:30.877" LastActivityDate="2015-05-15T06:52:51.103" Title="classify and determine maximal element" Tags="|elisp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12411" PostTypeId="1" AcceptedAnswerId="12412" CreationDate="2015-05-14T17:19:43.127" Score="8" ViewCount="1437" Body="&lt;p&gt;Is there a way of asking &lt;code&gt;company&lt;/code&gt; to sort the results it shows based on past choices? The custom variable &lt;code&gt;company-transformers&lt;/code&gt; controls this behaviour. The only built-in choices are &lt;code&gt;company-sort-by-occurrence&lt;/code&gt; and &lt;code&gt;company-sort-by-backend-importance&lt;/code&gt;. Is there an existing method, possibly from another package, that I could use to do adaptive filtering of these results?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2015-05-14T18:04:40.023" Title="Adaptive sorting of a company backends results" Tags="|company-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12412" PostTypeId="2" ParentId="12411" CreationDate="2015-05-14T17:34:37.350" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/company-mode/company-statistics&quot;&gt;company-statistics&lt;/a&gt; should solve your problem.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-05-14T17:34:37.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12413" PostTypeId="2" ParentId="12411" CreationDate="2015-05-14T18:04:40.023" Score="3" Body="&lt;p&gt;Besides company-statics, you can also write functions to do the sorting yourself, and then you add the function to the variable &lt;code&gt;company-transformers&lt;/code&gt;. I did this for sorting python private methods last, see: &lt;a href=&quot;https://emacs.stackexchange.com/questions/12360/how-to-make-private-python-methods-the-last-company-mode-choices&quot;&gt;How to make private python methods the last company-mode choices?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-05-14T18:04:40.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12414" PostTypeId="1" CreationDate="2015-05-14T18:17:59.147" Score="27" ViewCount="845" Body="&lt;p&gt;The function &lt;code&gt;ps-print-buffer-with-faces&lt;/code&gt; prints an Emacs buffer.  Is&#xA;there a way to print a frame with more than one buffer in it?  I would&#xA;like to print an Emacs calc frame both with the RPN stack and the&#xA;trail buffer.&lt;/p&gt;&#xA;" OwnerUserId="6663" LastActivityDate="2019-03-29T19:10:52.410" Title="How can I print an Emacs frame?" Tags="|frames|calc|print|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12415" PostTypeId="2" ParentId="3175" CreationDate="2015-05-14T18:59:39.260" Score="0" Body="&lt;p&gt;I've always used M-[number] to do things. This also works if you just want to type out 80/132 characters to measure the width of your screen or something. There doesn't seem to be a limit on the number of numbers you can put in the prefix.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-80 #&#xA;;;Prints out 80 #&#xA;&#xA;M-4 M-x indent-rigidly&#xA;;; Indents 4 times&#xA;&#xA;;; Need to separate M-# with C-u if your command is a number&#xA;M-80 C-u 0&#xA;;; Prints out eighty 0 characters&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8254" LastEditorUserId="8254" LastEditDate="2015-05-19T13:29:20.547" LastActivityDate="2015-05-19T13:29:20.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12416" PostTypeId="2" ParentId="12409" CreationDate="2015-05-14T21:19:45.573" Score="1" Body="&lt;p&gt;Below should work. It does not strictly follow your pseudo-code but I have put in your pseudo code as comments in-between so that you can get a rough idea of how elisp correlates to that. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/return-time-diff-frac-hours ()&#xA;  (interactive)&#xA;  (let (begin-hh begin-mm end-hh end-mm diff)&#xA;    (save-excursion&#xA;      ;; $end-time      = (search back from pointer for previous instance of HHMM)&#xA;      ;; $begin-time    = (search for second previous instance of HHMM)&#xA;      (if (re-search-backward (concat &quot;^\\([0-2][0-9]\\)\\([0-5][0-9]\\)&quot;&#xA;                                      &quot;\\(?:.*\n\\)&quot;&#xA;                                      &quot;\\([0-2][0-9]\\)\\([0-5][0-9]\\)&quot;&#xA;                                      &quot;\\(.*\n\\)&quot;&#xA;                                      ) nil :noerror)&#xA;          (progn&#xA;            ;; $begin-hour    = $begin-time[0,1]&#xA;            ;; $begin-minute  = $begin-time[2,3]&#xA;            (setq begin-hh (string-to-number (match-string 1))) &#xA;            (setq begin-mm (string-to-number (match-string 2))) &#xA;            ;; $end-hour      = $end-time[0,1]&#xA;            ;; $end-minute    = $end-time[2,3]&#xA;            (setq end-hh (string-to-number (match-string 3))) &#xA;            (setq end-mm (string-to-number (match-string 4)))&#xA;            ;; $total-hours   = $end-hour - $begin-hour&#xA;            ;; $total-minutes = $end-minutes - $begin-minutes&#xA;            ;; return $total-hours + ($total-minutes * 0.01666666667)&#xA;            (setq diff (/ (- (+ end-mm  ; end minutes&#xA;                                (* 60 end-hh))&#xA;                             (+ begin-mm ; begin minutes&#xA;                                (* 60 begin-hh)))&#xA;                          60.0)))&#xA;        (message &quot;Unable to find time strings on consecutive lines.&quot;)))&#xA;    (when diff&#xA;      (insert (number-to-string diff)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Paste the above code in the *scratch* buffer and do &lt;code&gt;M-x eval-buffer&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Place the cursor at the beginning of 3rd line as in your example and call &lt;code&gt;M-x my/return-time-diff-frac-hours&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-15T10:54:47.317" LastActivityDate="2015-05-15T10:54:47.317" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12417" PostTypeId="2" ParentId="12410" CreationDate="2015-05-14T22:11:32.843" Score="4" Body="&lt;p&gt;While the extent of Emacs packages may suggest otherwise, Emacs Lisp is pretty small for &lt;a href=&quot;https://www.gnu.org/gnu/rms-lisp.html&quot; rel=&quot;nofollow&quot;&gt;historical reasons&lt;/a&gt;.  To remedy this situation, one can use packages like the built-in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/Overview.html&quot; rel=&quot;nofollow&quot;&gt;CL library&lt;/a&gt; or the external &lt;a href=&quot;https://github.com/magnars/dash.el&quot; rel=&quot;nofollow&quot;&gt;dash.el&lt;/a&gt;.  As I cannot spot the equivalents for your proposed functions in &lt;code&gt;cl-lib.el&lt;/code&gt;, I'm going to point you to &lt;code&gt;-max-by&lt;/code&gt; and &lt;code&gt;-group-by&lt;/code&gt; from &lt;code&gt;dash.el&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-05-15T06:52:51.103" LastActivityDate="2015-05-15T06:52:51.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12418" PostTypeId="1" AcceptedAnswerId="12421" CreationDate="2015-05-15T01:24:16.637" Score="1" ViewCount="278" Body="&lt;p&gt;In c mode, &lt;code&gt;C-c C-c&lt;/code&gt; will put marked text in comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In python mode, &lt;code&gt;C-c C-c&lt;/code&gt; will execute a python runtime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually how do experienced emacs users resolve this inconsistency of key shortcut? Or we just accept it as is?&lt;/p&gt;&#xA;" OwnerUserId="169" LastActivityDate="2015-05-15T05:08:59.730" Title="C-c c-c behaves differently for c and python modes. What is the recommended way to resolve it?" Tags="|key-bindings|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12419" PostTypeId="2" ParentId="12392" CreationDate="2015-05-15T01:39:23.993" Score="3" Body="&lt;p&gt;The function you put on &lt;code&gt;fill-nobreak-predicate&lt;/code&gt; should return non-nil &lt;em&gt;when point is at the space you don't want to break&lt;/em&gt;.  So your &lt;code&gt;my-nobreak-p&lt;/code&gt; doesn't help because that position is not followed by &lt;code&gt;\cite...&lt;/code&gt; and hence doesn't match the regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-nobreak-p ()&#xA;  (and (looking-at &quot; *[0-9]&quot;)&#xA;       (looking-back &quot;\\[p\\. *&quot; (- (point) 5))))&#xA;(add-hook 'fill-nobreak-predicate #'my-nobreak-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-05-15T20:39:04.263" LastActivityDate="2015-05-15T20:39:04.263" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12420" PostTypeId="2" ParentId="12418" CreationDate="2015-05-15T02:00:47.793" Score="3" Body="&lt;p&gt;C-c C-c is generally used to run interpreted code, but as C is not interpreted, it was assigned to a different function. But one of the best features of emacs is to customize it to make it behave just like you want, so if you wish to you can change the shortcut for C modes with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key c-mode-map &quot;\C-c\C-c&quot; 'your-function-of-choice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-15T02:00:47.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12421" PostTypeId="2" ParentId="12418" CreationDate="2015-05-15T05:08:59.730" Score="5" Body="&lt;p&gt;There is &lt;strong&gt;no&lt;/strong&gt; recommended way to resolve such an &quot;inconsistency&quot;. Major modes are free to define &lt;code&gt;C-c C-c&lt;/code&gt; as they see fit. And users are free to bind it to whatever they like, overruling what a major mode defines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things between modes are often &quot;inconsistent&quot;, because modes can differ dramatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Search for &lt;code&gt;C-c C-c&lt;/code&gt; in the Emacs manual, and you will see that what it does varies widely from mode to mode - &lt;em&gt;very&lt;/em&gt; widely. If such &quot;inconsistency&quot; bothers you, bind it to something that does the same thing or something similar in all modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only convention in effect that applies to &lt;code&gt;C-c C-c&lt;/code&gt; is this one, from the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html&quot;&gt;&lt;code&gt;Key Binding Conventions&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sequences consisting of `C-c' followed by a control character or a  digit are reserved for major modes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-15T05:08:59.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12423" PostTypeId="2" ParentId="8205" CreationDate="2015-05-15T07:47:27.390" Score="2" Body="&lt;p&gt;For this feature, Helm is using &lt;em&gt;ffap&lt;/em&gt; (&quot;find file at point&quot;). Over at EmacsWiki, I found &lt;a href=&quot;http://emacswiki.org/emacs/FindFileAtPoint&quot; rel=&quot;nofollow&quot;&gt;advice on how to make ffap behave better in HTML&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h2&gt;Ignore '/'&lt;/h2&gt;&#xA;  &#xA;  &lt;p&gt;On unix based systems, / is the root path. So all string starts with / is recognized as a path.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This is annoying especially when editing HTML or XML. The following advice ignore / as a wrong result.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice ffap-file-at-point (after ffap-file-at-point-after-advice ())&#xA;  (if (string= ad-return-value &quot;/&quot;)&#xA;      (setq ad-return-value nil)))&#xA;(ad-activate 'ffap-file-at-point)&#xA;;; (ad-deactivate 'ffap-file-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;– tomykaira, feel free to use this snippet in any way.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It seems to work great. Real filenames are still recognized, but false positives (which made Helm fall back to '/') are not.&lt;/p&gt;&#xA;" OwnerUserId="476" LastActivityDate="2015-05-15T07:47:27.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12424" PostTypeId="2" ParentId="12404" CreationDate="2015-05-15T09:36:11.040" Score="0" Body="&lt;p&gt;I would try with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variable&#xA;...&#xA; '(org-modules&#xA;   (org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail org-w3m org-drill))&#xA;...&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;quote&lt;/code&gt; in the &lt;code&gt;'(org....)&lt;/code&gt; sounds redundant.&lt;/p&gt;&#xA;" OwnerUserId="5472" LastActivityDate="2015-05-15T09:36:11.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12425" PostTypeId="5" CreationDate="2015-05-15T09:38:51.903" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-05-15T09:38:51.903" LastActivityDate="2015-05-15T09:38:51.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12426" PostTypeId="4" CreationDate="2015-05-15T09:38:51.903" Score="0" Body="Software testing is any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results." OwnerUserId="5472" LastEditorUserId="5472" LastEditDate="2015-05-15T13:33:14.157" LastActivityDate="2015-05-15T13:33:14.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12427" PostTypeId="1" CreationDate="2015-05-15T09:40:27.237" Score="7" ViewCount="184" Body="&lt;p&gt;I have two vectors, &lt;code&gt;[apple orange]&lt;/code&gt; and &lt;code&gt;[5 10]&lt;/code&gt;. How do I construct an association list &lt;code&gt;((apple 5) (orange 10))&lt;/code&gt; from them? &lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="105" LastEditDate="2015-05-16T01:29:52.597" LastActivityDate="2015-05-16T18:59:26.717" Title="construct an association list from two vectors" Tags="|elisp|association-lists|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12428" PostTypeId="2" ParentId="12427" CreationDate="2015-05-15T09:44:25.213" Score="11" Body="&lt;p&gt;You can use &lt;code&gt;cl-pairlis&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(cl-pairlis '(apple orange) '(5 10))&#xA;;; =&amp;gt;&#xA;;; ((apple . 5) (orange . 10))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also works for vectors:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(cl-pairlis [apple orange] [5 10])&#xA;;; =&amp;gt;&#xA;;; ((apple . 5) (orange . 10))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(The &lt;code&gt;cl&lt;/code&gt; library defines the shorter alias &lt;code&gt;pairlis&lt;/code&gt; for &lt;code&gt;cl-pairlis&lt;/code&gt;, but this is deprecated in newer Emacs versions.)&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2223" LastEditDate="2015-05-15T10:48:01.450" LastActivityDate="2015-05-15T10:48:01.450" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12429" PostTypeId="1" AcceptedAnswerId="12451" CreationDate="2015-05-15T10:12:18.243" Score="3" ViewCount="152" Body="&lt;p&gt;In a buffer with source code that has already been syntax highlighted (eg some Python code in python-mode), how do I access the results of the syntax parsing to select text from elisp that is a particular syntax?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if I want to select the next keyword, or select all of the current comment around the point, or all of the string around point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6595" LastActivityDate="2015-05-16T17:12:01.703" Title="How do I select a region that has been syntax highlighted?" Tags="|elisp|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12430" PostTypeId="1" CreationDate="2015-05-15T11:00:08.693" Score="4" ViewCount="1600" Body="&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt; As far as I know it is possible to define &lt;a href=&quot;http://orgmode.org/manual/Property-syntax.html#Property-syntax&quot; rel=&quot;nofollow&quot;&gt;properties&lt;/a&gt; for a section in a &lt;code&gt;PROPERTIES&lt;/code&gt; drawer like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Introduction&#xA;:PROPERTIES:&#xA;:PlannedPages: 0.5&#xA;:ActualPages: 0.5&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see that there are two properties, that should reflect the number of pages that I plan to write for this section and the number of pages that I actually wrote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&#xA;Do you know an example that shows to some extent how to program a &lt;a href=&quot;http://orgmode.org/manual/Dynamic-blocks.html&quot; rel=&quot;nofollow&quot;&gt;dynamic block&lt;/a&gt; similiar to &lt;a href=&quot;http://orgmode.org/manual/The-clock-table.html#The-clock-table&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;CLOCKTABLE&lt;/code&gt;&lt;/a&gt; which maintains a table that contains sections in it's rows and the values of some properties in it's columns?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:DOCUMENTSCOPE: &#xA;|                   | Planned | Actual |&#xA;| Section           |   Pages | Pages  |&#xA;|-------------------+---------+--------|&#xA;| Introduction      |     0.5 |        |&#xA;| Background        |       2 |        |&#xA;| Thesis objectives |       1 |        |&#xA;| Time schedule     |     0.5 |        |&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6890" LastActivityDate="2015-06-01T20:43:48.790" Title="Display property value of each section in table like in clocktable" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12431" PostTypeId="5" CreationDate="2015-05-15T11:09:52.153" Score="0" Body="&lt;p&gt;Emacs has a number of different ways to break or display long lines.&#xA;This tag should be used for question that relate line-breaking questions on the display or changing the line breaks in the file.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="25" LastEditDate="2015-05-15T12:22:24.883" LastActivityDate="2015-05-15T12:22:24.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12432" PostTypeId="4" CreationDate="2015-05-15T11:09:52.153" Score="0" Body="Breaking of lines on the display or in the file" OwnerUserId="2710" LastEditorUserId="25" LastEditDate="2015-05-15T12:22:43.023" LastActivityDate="2015-05-15T12:22:43.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12433" PostTypeId="1" AcceptedAnswerId="12436" CreationDate="2015-05-15T12:05:44.230" Score="3" ViewCount="3022" Body="&lt;p&gt;I want to use &lt;code&gt;.dir-locals.el&lt;/code&gt; to append to the &lt;code&gt;before-save-hook&lt;/code&gt; in a project for c++ files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c++-mode-hook&#xA;          (lambda ()&#xA;            (add-hook 'before-save-hook 'clang-format-buffer nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set &lt;code&gt;before-save-hook&lt;/code&gt; as a &lt;em&gt;buffer local variable&lt;/em&gt; ignoring everything that I set globally. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I create a buffer-local variable of 'before-save-hook' that takes the value from the global version and then adds &lt;code&gt;clang-format-buffer&lt;/code&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing that is a little bit annoying is that this will only be applied after the second file I open in the project. In the first cpp file that I open the hook is not applied.&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="105" LastEditDate="2015-05-16T02:39:25.870" LastActivityDate="2015-05-16T02:39:25.870" Title="Use `.dir-locals.el' to append to `before-save-hook' as a buffer local variable" Tags="|hooks|buffer-local|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12434" PostTypeId="2" ParentId="12391" CreationDate="2015-05-15T14:01:03.523" Score="12" Body="&lt;p&gt;I poked around in the org-mode source and found a minimally &lt;a href=&quot;http://orgmode.org/manual/Handling-links.html#fn-5&quot; rel=&quot;noreferrer&quot;&gt;documented&lt;/a&gt; feature.  If you define a function &lt;code&gt;org-TYPE-complete-link&lt;/code&gt;, it will be used to provide completion for links of type &lt;code&gt;TYPE&lt;/code&gt;.  So we just need to define a function &lt;code&gt;org-id-complete-link&lt;/code&gt; that does our completion and returns the link (including the &quot;id:&quot; prefix).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-id-complete-link (&amp;amp;optional arg)&#xA;  &quot;Create an id: link using completion&quot;&#xA;  (concat &quot;id:&quot;&#xA;          (org-id-get-with-outline-path-completion)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Insert the link the normal way (with &lt;code&gt;C-c C-l&lt;/code&gt;), select &quot;id:&quot; as the type and the completion function will fire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;As of &lt;code&gt;org-mode&lt;/code&gt; version 9.0 just defining the function as above above no longer works (&lt;a href=&quot;http://orgmode.org/Changes.html#orga95073a&quot; rel=&quot;noreferrer&quot;&gt;ref&lt;/a&gt;).  Instead you have to add the completion function to &lt;code&gt;org-link-parameters&lt;/code&gt; using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-link-set-parameters &quot;id&quot;&#xA;                         :complete 'org-id-complete-link)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2016-11-04T17:40:54.987" LastActivityDate="2016-11-04T17:40:54.987" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12436" PostTypeId="2" ParentId="12433" CreationDate="2015-05-15T14:48:48.980" Score="7" Body="&lt;pre&gt;&lt;code&gt;(add-hook 'before-save-hook #'clang-format-buffer nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the right way to add a function locally to a hook.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This will set before-save-hook as a buffer local variable ignoring everything that I set globally.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, it won't. The global value will still exist, and &lt;strong&gt;&lt;code&gt;run-hooks&lt;/code&gt; will run both values&lt;/strong&gt;.&#xA;&lt;code&gt;before-save-hook&lt;/code&gt; is no exception here, try it out and you will see. Nothing will get ignored.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Another thing that is a little bit annoying is that this will only be applied after the second file I open in the project. In the first cpp file that I open the hook is not applied.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is what your &lt;code&gt;.dir-locals.el&lt;/code&gt; should look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Directory Local Variables&#xA;;;; For more information see (info &quot;(emacs) Directory Variables&quot;)&#xA;&#xA;((c++-mode&#xA;  (eval add-hook 'before-save-hook #'clang-format-buffer nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-05-15T14:54:39.213" LastActivityDate="2015-05-15T14:54:39.213" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12437" PostTypeId="2" ParentId="7432" CreationDate="2015-05-15T15:35:00.947" Score="20" Body="&lt;p&gt;Another solution is to use &lt;a href=&quot;http://elpa.gnu.org/packages/adaptive-wrap.html&quot;&gt;adaptive-wrap-prefix-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way you'll see the full header and source but it will wrap nicely indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;visual-line-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dh4rO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;visual-line-mode&lt;/code&gt; and &lt;code&gt;adaptive-wrap-prefix-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Iqrf0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-05-15T15:41:20.953" LastActivityDate="2015-05-15T15:41:20.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12438" PostTypeId="2" ParentId="12400" CreationDate="2015-05-15T18:55:17.167" Score="4" Body="&lt;p&gt;It's not specifically for &quot;pending&quot;, but marking the test as expected to fail seems like it would be what you want: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/ert/Expected-Failures.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/ert/Expected-Failures.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;add `:expected-result :failed' to the test definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (ert-deftest future-bug ()&#xA;   &quot;Test `time-forward' with negative arguments.&#xA; Since this functionality isn't implemented, the test is known to fail.&quot;&#xA;   :expected-result :failed&#xA;   (time-forward -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;ERT will still display a small `f' in the progress bar as a&#xA;  reminder that there is a known bug, and will count the test as failed,&#xA;  but it will be quiet about it otherwise.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-05-15T18:55:17.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12439" PostTypeId="1" CreationDate="2015-05-15T21:04:20.307" Score="1" ViewCount="832" Body="&lt;p&gt;I am using &lt;code&gt;(setq scroll-preserve-screen-position t)&lt;/code&gt; as suggested at  &lt;a href=&quot;https://superuser.com/a/184421/39697&quot;&gt;https://superuser.com/a/184421/39697&lt;/a&gt;, and it works well, except for me, when I scroll at the top of the screen using &lt;code&gt;scroll-up-line&lt;/code&gt;, the cursor moves foward one character (same with the bottom of the screen). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't happening with &lt;code&gt;emacs -Q&lt;/code&gt;, so I'm unsure what in my &lt;a href=&quot;https://github.com/asmeurer/dotfiles&quot; rel=&quot;nofollow noreferrer&quot;&gt;configuration&lt;/a&gt; is causing it. I'd like to use &lt;a href=&quot;https://github.com/Malabarba/elisp-bug-hunter&quot; rel=&quot;nofollow noreferrer&quot;&gt;bug-hunter&lt;/a&gt; to find why, but I'm unsure how to encode this as a test expression. &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2015-05-15T21:04:20.307" Title="scroll-preserve-screen-position causes cursor to move forward one character at screen boundary" Tags="|scrolling|cursor|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12440" PostTypeId="2" ParentId="10599" CreationDate="2015-05-15T21:54:58.603" Score="3" Body="&lt;p&gt;According to Emacs Wiki, you can't use isearch during a keyboard macro. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/KeyboardMacros#toc2&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/KeyboardMacros#toc2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8327" LastActivityDate="2015-05-15T21:54:58.603" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12441" PostTypeId="1" CreationDate="2015-05-15T22:46:12.150" Score="8" ViewCount="3224" Body="&lt;p&gt;Autocompletion is particularly useful in writing CSS, to see the available options for a given property. Company provides &lt;code&gt;company-minimum-prefix-length&lt;/code&gt; to control how many characters I have to type before it starts offering options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I want completion without any characters, so I get this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/quHrI.png&quot; alt=&quot;company mode completion of css&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I can only get this by either:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Explicitly calling &lt;code&gt;M-x company-complete&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Setting &lt;code&gt;(setq company-minimum-prefix-length 0)&lt;/code&gt;, typing a single character and backspace, e.g. &lt;code&gt;a DEL&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is this possible? Ideally I'd be able to do it for both properties and their values.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2018-12-28T09:32:31.243" Title="Is it possible to start company completion without a prefix?" Tags="|completion|company-mode|css|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12442" PostTypeId="2" ParentId="12293" CreationDate="2015-05-16T00:18:44.677" Score="0" Body="&lt;p&gt;I ended up solving this by unwinding paredit's keybindings first, then setting up my mode-hooks.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; clear paredit bindings paredit mode&#xA;(eval-after-load &quot;paredit&quot;&#xA;  #'(define-key paredit-mode-map (kbd &quot;C-j&quot;) nil))&#xA;&#xA;(eval-after-load &quot;paredit&quot;&#xA;  #'(define-key paredit-mode-map (kbd &quot;C-c C-j&quot;) nil))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook&#xA;          '(lambda ()&#xA;             (local-set-key (kbd &quot;C-c C-j&quot;) 'eval-region)&#xA;             (local-set-key (kbd &quot;C-j&quot;) 'eval-last-sexp)))&#xA;&#xA;(add-hook 'racket-mode-hook&#xA;          '(lambda ()&#xA;             (paredit-mode)&#xA;             (local-set-key (kbd &quot;C-j&quot;) 'racket-send-last-sexp)&#xA;             (local-set-key (kbd &quot;C-c C-j&quot;) 'racket-send-region)&#xA;             (local-set-key (kbd &quot;C-c C-s&quot;) 'racket-repl)&#xA;             (local-set-key (kbd &quot;C-c C-p&quot;) 'clipboard-yank)&#xA;             ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7015" LastActivityDate="2015-05-16T00:18:44.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12443" PostTypeId="2" ParentId="10701" CreationDate="2015-05-16T00:53:08.803" Score="2" Body="&lt;p&gt;You should use Helm-Swoop's &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop#multiline-behavior&quot; rel=&quot;nofollow&quot;&gt;Multiline Behavior&lt;/a&gt;.&#xA;Basically you specify the number using a prefix argument (C-u n M-x helm-swoop )of context lines to use in helm swoop buffer.&#xA;Then for the lines you want to modify you enter to edit mode using C-c C-e from the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I'm rephrasing HeyYO's comment, as a proper answer as I share his solution.&lt;/p&gt;&#xA;" OwnerUserId="8289" LastActivityDate="2015-05-16T00:53:08.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12444" PostTypeId="2" ParentId="12427" CreationDate="2015-05-16T02:48:19.513" Score="10" Body="&lt;p&gt;&lt;code&gt;(cl-mapcar #'cons [apple orange] [5 10])&lt;/code&gt; =&gt;  &lt;code&gt;((apple . 5) (orange . 10))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(cl-mapcar #'list [apple orange] [5 10])&lt;/code&gt; =&gt;  &lt;code&gt;((apple 5) (orange 10))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs's &lt;code&gt;cl-mapcar&lt;/code&gt; takes as arguments a function of arity one or more and the same number of sequences as its arity. Common Lisp's &lt;code&gt;mapcar&lt;/code&gt; is similar, but the only sequences it accepts are lists.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-16T18:59:26.717" LastActivityDate="2015-05-16T18:59:26.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12445" PostTypeId="2" ParentId="10168" CreationDate="2015-05-16T06:51:27.467" Score="3" Body="&lt;p&gt;If the account you're trying to log in with uses some weird fancy shell prompt, then there is a good chance that this is what makes tramp trip.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to test it: Log in as root, then enter &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PS1=&quot;&amp;gt; &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(that's a normal, standard shell (ZSH, BASH, younameit) prompt, one that tramp will understand)&#xA;then switch to the user account, and launch  &lt;code&gt;emacs -q&lt;/code&gt; (to make sure that your &lt;code&gt;.emacs&lt;/code&gt; is not causing this mess) and try to &lt;code&gt;C-x C-f /sudo:root@localhost:/etc/hosts&lt;/code&gt; and see what's what.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can (not recommended) also customize the regexp that defines what tramps expects :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-variable RET tramp-terminal-prompt-regexp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My approach : &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make sure The variable &lt;code&gt;tramp-terminal-type&lt;/code&gt; is set to &quot;dumb&quot; &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x customize-variable RET  tramp-terminal-type&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Test that in your .*shrc and serve the correct prompt :&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;case &quot;$TERM&quot; in&#xA;&quot;dumb&quot;)&#xA;    PS1=&quot;&amp;gt; &quot;&#xA;    ;;&#xA;xterm*|rxvt*|eterm*|screen*)&#xA;    PS1=&quot;my fancy multi-line \n prompt &amp;gt; &quot;&#xA;    ;;&#xA;*)&#xA;    PS1=&quot;&amp;gt; &quot;&#xA;    ;;&#xA;esac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6701" LastActivityDate="2015-05-16T06:51:27.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12446" PostTypeId="2" ParentId="10168" CreationDate="2015-05-16T07:59:58.637" Score="2" Body="&lt;p&gt;In short, I had an incorrectly configured &lt;code&gt;~/.authinfo&lt;/code&gt; that causes Tramp to automatically send a default password (which was the incorrect password). Deleting &lt;code&gt;~/.authinfo&lt;/code&gt; resolved my issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An incorrectly configured &lt;code&gt;~/.netrc&lt;/code&gt; can also cause this same issue. So make sure to check whether a &lt;code&gt;.authinfo&lt;/code&gt; or &lt;code&gt;.netrc&lt;/code&gt; file exists, and ensure that it is not submitting an incorrect password as the default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@MichaelAlbinus and the Tramp-dev team helped me resolve this issue. After submitting my verbose log output to the Tramp-dev team, I received this response:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp sends a password, but a wrong one:&#xA;&#xA;&amp;gt; 19:58:17.561007 tramp-send-command (6) # exec ssh -l root  -e none 111.111.111.111&#xA;&amp;gt; 19:58:19.457169 tramp-accept-process-output (10) #&#xA;&amp;gt; root@111.111.111.111's password:&#xA;&amp;gt; 19:58:19.463921 tramp-action-password (3) # Sending password&#xA;&amp;gt; 19:58:21.526264 tramp-process-actions (6) #&#xA;&amp;gt; root@111.111.111.111's password:&#xA;&amp;gt; Received disconnect from 111.111.111.111: 2: Too many authentication failures for root&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Deleting my &lt;code&gt;.authinfo&lt;/code&gt; file brought back Tramp's password prompt. It was my error for not having Gnus Authinfo properly configured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately my complete logs are too long to attach or pastebin here, but I hope this is enough of a summary to help others out.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-05-16T07:59:58.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12447" PostTypeId="1" CreationDate="2015-05-16T11:21:17.177" Score="1" ViewCount="1308" Body="&lt;p&gt;1.I downloads package from this: &lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/auto-complete/auto-complete&lt;/a&gt;&lt;/p&gt;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Type: M-x load-file RET ~/auto-complete-master/etc/install.el RET&lt;/li&gt;&#xA;&lt;li&gt;install to: ~/.emacs.d/ RET&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Installation Result show:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Successfully installed!&lt;/p&gt;&#xA;&lt;p&gt;Add the following code to your .emacs:&lt;/p&gt;&#xA;&lt;p&gt;(add-to-list 'load-path &amp;quot;~/.emacs.d&amp;quot;)&lt;br /&gt;&#xA;(require 'auto-complete-config)&lt;/p&gt;&#xA;&lt;p&gt;(ac-config-default)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;However, I don't see characters AC in mode-line. I type:&#xA;M-x auto-complete-mode, but it show: [No match]&lt;/p&gt;&#xA;&lt;p&gt;What problem with my emacs?&#xA;(GNU Emacs 23, Ubuntu 14.04)&lt;/p&gt;&#xA;" OwnerUserId="8330" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-16T11:21:17.177" Title="emacs auto-complete-mode not work" Tags="|auto-complete-mode|emacs23|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12448" PostTypeId="1" AcceptedAnswerId="12449" CreationDate="2015-05-16T12:44:17.550" Score="1" ViewCount="405" Body="&lt;p&gt;I am a total emacs newbie and am trying to figure my way around emacs(I am kinda liking it).&#xA;Now my question is that when I type rails commands in my terminal, they work perfectly well.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user ~ $ rails -v&#xA;Rails 4.2.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run the same commands in eshell, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Welcome to the Emacs shell&#xA;&#xA;~/.emacs.d $ rails -v&#xA;rails: command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To my understanding, eshell is a shell within emacs. Right? Or I have it completely wrong?&lt;/p&gt;&#xA;" OwnerUserId="6864" LastActivityDate="2015-05-16T13:53:19.287" Title="Why don't rails commands run in eshell?" Tags="|eshell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12449" PostTypeId="2" ParentId="12448" CreationDate="2015-05-16T13:53:19.287" Score="2" Body="&lt;p&gt;Eshell does not run your default shell, so it will ignore whatever you have set up in the shell rc script.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set environment variables in &lt;code&gt;~/.eshell/login&lt;/code&gt; or &lt;code&gt;~/.eshell/profile&lt;/code&gt;, use &lt;code&gt;addpath PATH&lt;/code&gt; (for some string value of &lt;code&gt;PATH&lt;/code&gt;), or add a hook to evaluate &lt;code&gt;(setenv ...)&lt;/code&gt; with the appropriate values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more regular shell I recommend using &lt;code&gt;M-x shell&lt;/code&gt;, which just communicates with an external shell process.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-05-16T13:53:19.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12450" PostTypeId="1" AcceptedAnswerId="12456" CreationDate="2015-05-16T14:13:42.453" Score="5" ViewCount="851" Body="&lt;p&gt;I'm trying to capture stderr separately from stdout for a (synchronous) process run from emacs. I've found one way of doing it based on some code copied from emacs' &lt;code&gt;shell-command&lt;/code&gt; function (I don't want to use &lt;code&gt;shell-command&lt;/code&gt; directly because there is no need for a shell and &lt;code&gt;shell-command&lt;/code&gt; puts stdout into a buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-dash-sql (db-path sql)&#xA;  &quot;Run the sql command, parse the results and display errors&quot;&#xA;  (helm-dash-parse-sql-results&#xA;   (with-output-to-string&#xA;     (let ((error-file (make-temp-file &quot;helm-dash-errors-file&quot;)))&#xA;       (call-process &quot;sqlite3&quot; nil (list standard-output error-file) nil&#xA;                     ;; args for sqlite3:&#xA;                     db-path sql)&#xA;&#xA;       ;; display errors, stolen from emacs' `shell-command` function&#xA;       (when (and error-file (file-exists-p error-file))&#xA;         (if (&amp;lt; 0 (nth 7 (file-attributes error-file)))&#xA;             (with-current-buffer (get-buffer-create &quot;*helm-dash-errors*&quot;)&#xA;               (let ((pos-from-end (- (point-max) (point))))&#xA;                 (or (bobp)&#xA;                     (insert &quot;\f\n&quot;))&#xA;                 ;; Do no formatting while reading error file,&#xA;                 ;; because that can run a shell command, and we&#xA;                 ;; don't want that to cause an infinite recursion.&#xA;                 (format-insert-file error-file nil)&#xA;                 ;; Put point after the inserted errors.&#xA;                 (goto-char (- (point-max) pos-from-end)))&#xA;               (display-buffer (current-buffer))))&#xA;     (delete-file error-file))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However I suspect it could be done better in two ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It seems like this should be a solved problem and emacs should have a function that just &quot;does the right thing&quot; with stderr, but I can't find one. Is there such a function?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Every time a process is run &lt;code&gt;shell-command&lt;/code&gt; creates (and later deletes) a temp file in which to store stderr. We are slightly concerned that this could have a performance impact because multiple processes are run for every keypress while inside this &lt;code&gt;helm&lt;/code&gt; command. Is this likely to be an issue, and if so what is the best way around it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For anyone curious: this is for &lt;a href=&quot;https://github.com/areina/helm-dash&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;helm-dash&lt;/code&gt;&lt;/a&gt;. The exact code I'm currently using is in &lt;a href=&quot;https://github.com/areina/helm-dash/pull/82/files&quot; rel=&quot;noreferrer&quot;&gt;this pull-request&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="237" LastActivityDate="2015-05-16T19:46:16.643" Title="Capturing stderr of subprocesses" Tags="|elisp|process|error-handling|subprocess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12451" PostTypeId="2" ParentId="12429" CreationDate="2015-05-16T16:40:56.403" Score="2" Body="&lt;p&gt;Select the string around point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-string-atpt ()&#xA;  &quot;Hightlight string at point. &quot;&#xA;  (interactive)&#xA;  (let ((pps (parse-partial-sexp (point-min) (point))))&#xA;    (when&#xA;    (nth 3 pps)&#xA;      (goto-char (nth 8 pps))&#xA;      (set-mark (point))&#xA;      (forward-sexp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Comment at point might start that way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-comment-atpt ()&#xA;  &quot;Highlight comment at point. &quot;&#xA;  (interactive)&#xA;  (let ((pps (parse-partial-sexp (point-min) (point))))&#xA;    (when&#xA;    (nth 4 pps)&#xA;      (goto-char (nth 8 pps))&#xA;      (set-mark (point))...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, as &lt;code&gt;(nth 4 pps)&lt;/code&gt; is reliable only WRT current line, needs a loop still to detect the beginning of a commented section, likewise the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A complete implemention as &lt;code&gt;ar-comment-atpt&lt;/code&gt; should exist there:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/andreas-roehler/werkstatt/blob/master/thing-at-point-utils.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/andreas-roehler/werkstatt/blob/master/thing-at-point-utils.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select the next item fontified as keyword like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-next-font-lock-keyword-face ()&#xA;  (interactive)&#xA;  (while (and (not (eobp)) (forward-char 1) (not (eq (face-at-point) 'font-lock-keyword-face))))&#xA;  (when (eq (face-at-point) 'font-lock-keyword-face)&#xA;    (set-mark (point))&#xA;    (while (eq (face-at-point) 'font-lock-keyword-face)&#xA;      (forward-char 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-05-16T17:12:01.703" LastActivityDate="2015-05-16T17:12:01.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12452" PostTypeId="2" ParentId="10827" CreationDate="2015-05-16T17:10:39.103" Score="2" Body="&lt;p&gt;this was discussed on the emacs-ipython-notebook github recently.&#xA;&lt;a href=&quot;https://github.com/millejoh/emacs-ipython-notebook/issues/41&quot; rel=&quot;nofollow&quot;&gt;https://github.com/millejoh/emacs-ipython-notebook/issues/41&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like a bug in iPython, but for the moment there is a work around by setting the matplotlab rc parameters directly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import matplotlib as mpl&#xA;mpl.rcParams[&quot;figure.facecolor&quot;] = &quot;white&quot;&#xA;mpl.rcParams[&quot;axes.facecolor&quot;] = &quot;white&quot;&#xA;mpl.rcParams[&quot;savefig.facecolor&quot;] = &quot;white&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="613" LastActivityDate="2015-05-16T17:10:39.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12454" PostTypeId="1" AcceptedAnswerId="12455" CreationDate="2015-05-16T19:14:45.407" Score="2" ViewCount="134" Body="&lt;p&gt;When I am typing in the scratch buffer, I type certain functions such as defun and while and they are recognized by the buffer and appear in purple. However, with other Lisp functions such as set or +, they do not appear in any color and I was wondering why that is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8332" LastEditorUserId="105" LastEditDate="2015-05-16T20:53:00.420" LastActivityDate="2015-05-16T20:53:00.420" Title="Function coloring in scratch buffer" Tags="|font-lock|scratch-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12455" PostTypeId="2" ParentId="12454" CreationDate="2015-05-16T19:31:27.030" Score="3" Body="&lt;p&gt;&lt;code&gt;defun&lt;/code&gt; and &lt;code&gt;while&lt;/code&gt; are macros, and are highlighted as such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;set&lt;/code&gt; and &lt;code&gt;+&lt;/code&gt; are functions, and are not highlighted like macros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Old versions of Emacs seem to have a list of specific macros to highlight, but more recent (possibly unreleased?) versions simply highlight all known macros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the docs on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Functions.html&quot; rel=&quot;nofollow&quot;&gt;functions&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Macros.html&quot; rel=&quot;nofollow&quot;&gt;macros&lt;/a&gt; so you can tell them apart. I admit, in Lisp the difference between calling a function and a macro is difficult to distinguish. This is both one of its great features, and great stumbling blocks.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-05-16T19:31:27.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12456" PostTypeId="2" ParentId="12450" CreationDate="2015-05-16T19:46:16.643" Score="6" Body="&lt;p&gt;This is fixed in Emacs 25, where you can use the &lt;code&gt;make-process&lt;/code&gt; function with the &lt;code&gt;:stderr&lt;/code&gt; argument.  I don't think there's anything suitable in Emacs 24.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-05-16T19:46:16.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12457" PostTypeId="2" ParentId="12441" CreationDate="2015-05-16T20:50:42.190" Score="5" Body="&lt;p&gt;I use TAB to trigger company-mode on demand in cases like that -- it works fine in your CSS example. I also use TAB to indent (&lt;code&gt;tab-always-indent&lt;/code&gt; set to &lt;code&gt;complete&lt;/code&gt;). You can integrate company with the built-in &lt;code&gt;indent-for-tab-command&lt;/code&gt; using the configuration described here:&#xA;&lt;a href=&quot;https://github.com/company-mode/company-mode/issues/94#issuecomment-40884387&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/company-mode/company-mode/issues/94#issuecomment-40884387&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the relevant code from the linked github comment:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key company-mode-map [remap indent-for-tab-command]&#xA;  'company-indent-for-tab-command)&#xA;&#xA;(setq tab-always-indent 'complete)&#xA;&#xA;(defvar completion-at-point-functions-saved nil)&#xA;&#xA;(defun company-indent-for-tab-command (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((completion-at-point-functions-saved completion-at-point-functions)&#xA;        (completion-at-point-functions '(company-complete-common-wrapper)))&#xA;    (indent-for-tab-command arg)))&#xA;&#xA;(defun company-complete-common-wrapper ()&#xA;  (let ((completion-at-point-functions completion-at-point-functions-saved))&#xA;    (company-complete-common)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-05-16T20:50:42.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12458" PostTypeId="1" CreationDate="2015-05-16T18:52:22.933" Score="0" ViewCount="32" Body="&lt;p&gt;So I'm entirely new to programming but I have been trying to familiarize myself with emacs for future scripting. When I am typing in the scratch buffer, I type certain functions such as defun and while and they are recognized by the buffer and appear in purple. However, with other Lisp functions such as set or +, they do not appear in any color and I was wondering why that is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8332" OwnerDisplayName="Ahmed Noor" LastEditorUserId="14920" LastEditDate="2018-05-22T21:15:00.300" LastActivityDate="2018-05-22T21:15:00.300" Title="Emacs scratch buffer Lisp eval" Tags="|scratch-buffer|" AnswerCount="0" CommentCount="4" ClosedDate="2015-05-17T02:16:19.090" ContentLicense="CC BY-SA 3.0" />
  <row Id="12459" PostTypeId="1" CreationDate="2015-05-17T03:16:15.983" Score="8" ViewCount="2433" Body="&lt;p&gt;I'd like to know if it is possible the buffer is saved at the exact moment of modification; at the instant of the key up event.&lt;/p&gt;&#xA;" OwnerUserId="7033" LastEditorUserId="7033" LastEditDate="2015-05-17T03:33:59.247" LastActivityDate="2021-02-28T20:58:27.283" Title="Save buffer at each modification" Tags="|auto-save|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12460" PostTypeId="1" AcceptedAnswerId="12473" CreationDate="2015-05-17T03:23:30.513" Score="2" ViewCount="335" Body="&lt;p&gt;My system: Debian GNU/Linux (Jessie)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs: GNU Emacs 24.1, installed from Debian package&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that when I saved ~/.emacs for any change, Emacs started to compile files into .elc under ~/.emacs.d/elpa directory.  It didn't take much time but it's annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had all my Emacs setting and package in a Git repository.  Is that the cause of the auto-compiling behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to disable it?&lt;/p&gt;&#xA;" OwnerUserId="8336" LastActivityDate="2015-05-17T18:33:08.647" Title="How to disable auto-compile after saving ~/.emacs file?" Tags="|init-file|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12461" PostTypeId="2" ParentId="12459" CreationDate="2015-05-17T04:56:24.103" Score="7" Body="&lt;p&gt;I had the same requirement and auto-save feature of emacs hasn't worked well for me because it can't addadvice to c functions. So, I wrote a package &lt;a href=&quot;https://github.com/ChillarAnand/real-auto-save&quot; rel=&quot;nofollow&quot;&gt;real-auto-save&lt;/a&gt; for that. It is available on melpa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install it by &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET real-auto-save &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and in your config you can add&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'real-auto-save)&#xA;(add-hook 'prog-mode-hook 'real-auto-save-mode)&#xA;(setq real-auto-save-interval 1) ;; in seconds&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After every second, if your buffer is modified, it will be saved automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you specifically want to save after key up event, you can write a lisp function for that.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="160" LastEditDate="2015-05-22T22:16:31.487" LastActivityDate="2015-05-22T22:16:31.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12462" PostTypeId="1" CreationDate="2015-05-17T08:44:19.080" Score="1" ViewCount="316" Body="&lt;p&gt;I'm using auth-source-search to retrieve passwords from ~/.authinfo.gpg. According to the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/auth.html#Help-for-developers&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; I may have to unwrap the secret property because it's in a function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((secret (plist-get found :secret)))&#xA;            (if (functionp secret)&#xA;                (funcall secret)&#xA;              secret))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in my case the password is somehow wrapped in two functions, so I would have to retrieve it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall (funcall secret))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This would result in very ugly code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((secret (plist-get info :secret))&#xA;    (if (functionp secret)&#xA;        (if (functionp (funcall secret))&#xA;            (funcall (funcall secret))&#xA;        (funcall secret))&#xA;    secret)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a more elegant way to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="8339" LastActivityDate="2015-05-17T08:44:19.080" Title="Unwrapping password from auth-sources" Tags="|elisp|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12463" PostTypeId="1" AcceptedAnswerId="12466" CreationDate="2015-05-17T10:26:39.113" Score="3" ViewCount="1430" Body="&lt;p&gt;I am aware of the [0/2] checkbox summary in parent heading, but how could one get the same going for [(total TODO)/(total DONE)] ?&lt;/p&gt;&#xA;" OwnerUserId="2121" LastActivityDate="2015-05-18T08:42:30.757" Title="Is it possible to get a summary of DONE and TODO's in Orgmode" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12464" PostTypeId="1" AcceptedAnswerId="29798" CreationDate="2015-05-17T11:10:37.087" Score="15" ViewCount="4337" Body="&lt;p&gt;I use &lt;code&gt;url-retrieve-synchronously&lt;/code&gt; to download a JSON file from a remote server.  This function returns a buffer which contains the &lt;em&gt;entire&lt;/em&gt; content of the response, including HTTP headers.  However, I'm just interested in the body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, short of parsing a HTTP response manually, how can I jump to the beginning of the body?  I have found the variable &lt;code&gt;url-http-end-of-headers&lt;/code&gt;, which works, but it's not documented at all, and using it feels “dirty”.  Is there a proper API for this purpose?&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2018-01-31T01:55:34.777" Title="Go to body after url-retrieve-synchronously" Tags="|url|http|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12465" PostTypeId="2" ParentId="12459" CreationDate="2015-05-17T11:24:40.077" Score="3" Body="&lt;p&gt;You can enable &lt;code&gt;auto-save-mode&lt;/code&gt;, so Emacs automatically saves your current buffer in a different file. Then, add this function to &lt;code&gt;auto-save-hook&lt;/code&gt; to also write it directly on the actual file you are editing:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun save-buffer-if-visiting-file (&amp;amp;optional args)&#xA;   &quot;Save the current buffer only if it is visiting a file&quot;&#xA;   (interactive)&#xA;   (if (and (buffer-file-name) (buffer-modified-p))&#xA;       (save-buffer args)))&#xA;&#xA;(add-hook 'auto-save-hook 'save-buffer-if-visiting-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save-Control.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual on auto-save control&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The variable auto-save-interval specifies how many characters there are between auto-saves. By default, it is 300. Emacs doesn’t accept values that are too small: if you customize auto-save-interval to a value less than 20, Emacs will behave as if the value is 20.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, if you want Emacs to save for every key press, change &lt;code&gt;auto-save-interval&lt;/code&gt; to &lt;code&gt;1&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq auto-save-interval 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastEditorUserId="160" LastEditDate="2015-05-22T22:16:18.330" LastActivityDate="2015-05-22T22:16:18.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12466" PostTypeId="2" ParentId="12463" CreationDate="2015-05-17T11:26:48.753" Score="4" Body="&lt;p&gt;Just put the &lt;code&gt;[/]&lt;/code&gt; cookie in the upper level heading and then this will be updated with &lt;code&gt;[(total DONE)/(total TODO)]&lt;/code&gt; each time you change the status of a subheading.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** My heading [2/4]&#xA;*** DONE bake cake&#xA;    CLOSED: [2015-05-17 Sun 13:24]&#xA;*** DONE make tea&#xA;    CLOSED: [2015-05-17 Sun 13:24]&#xA;*** TODO drink tea&#xA;*** TODO eat cake&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the cookie is not up-to-date, move the cursor to the cookie and type &lt;code&gt;C-c C-c&lt;/code&gt; to update.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2015-05-17T11:26:48.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12467" PostTypeId="2" ParentId="12464" CreationDate="2015-05-17T12:21:34.237" Score="12" Body="&lt;p&gt;Since there is a newline after the HTTP headers, the only alternative I'm aware of is using a &lt;code&gt;re-search-forward&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer&#xA;    (url-retrieve-synchronously my-url)&#xA;  (goto-char (point-min))&#xA;  (re-search-forward &quot;^$&quot;)&#xA;  (delete-region (point) (point-min))&#xA;  (buffer-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2015-05-17T12:21:34.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12468" PostTypeId="1" CreationDate="2015-05-17T12:56:23.793" Score="3" ViewCount="235" Body="&lt;p&gt;I need to read a char at a time to interactively build a filter string while I show the results in a regular buffer. And what I've written works, except when a cursor key is pressed  - then bang, I get a &lt;em&gt;&quot;non-character input event message&quot;&lt;/em&gt; and my code exits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example. If I run the following command, and hit one of the arrow keys, I get an error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foobar ()&#xA;  (interactive)&#xA;  (setq r (read-char)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;code&gt;read-char&lt;/code&gt;, &lt;code&gt;read-event&lt;/code&gt; and &lt;code&gt;read-char-exclusive&lt;/code&gt; with and without &lt;code&gt;ignore-errors&lt;/code&gt;. I've tried &lt;code&gt;read-char-choice&lt;/code&gt; and logic that looks for the vector result a cursor key would give. Nothing works (although I can handle return and backspace perfectly.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do I need to do? I don't need the cursor keys to do anything; I just need to make it safe to press them.&lt;/p&gt;&#xA;" OwnerUserId="8342" LastEditorUserId="50" LastEditDate="2015-05-17T17:16:22.507" LastActivityDate="2015-05-17T17:19:56.243" Title="Making read-char input robust?" Tags="|minibuffer|events|" AnswerCount="1" CommentCount="7" ClosedDate="2015-05-18T14:20:07.137" ContentLicense="CC BY-SA 3.0" />
  <row Id="12469" PostTypeId="2" ParentId="12459" CreationDate="2015-05-17T14:07:50.723" Score="11" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-instant-save-buffer (eins zwei drei)&#xA;  &quot;To be hooked into list `after-change-functions' &#xA;&#xA;`after-change-functions' expects functions receiving three arguments. &#xA;Arguments are ignored here, but slots needed by add-hook&quot;&#xA;  (save-buffer))&#xA;&#xA;(add-hook 'after-change-functions 'my-instant-save-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="160" LastEditDate="2015-05-22T22:16:04.870" LastActivityDate="2015-05-22T22:16:04.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12470" PostTypeId="1" AcceptedAnswerId="12671" CreationDate="2015-05-17T14:44:48.117" Score="2" ViewCount="285" Body="&lt;p&gt;From a &lt;a href=&quot;https://emacs.stackexchange.com/questions/4045/automatically-update-packages-and-delete-old-versions&quot;&gt;previous question&lt;/a&gt; of mine, I've included the following function in my &lt;code&gt;.emacs&lt;/code&gt; to quickly update all installed packages:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun endless/upgrade ()&#xA;  &quot;Upgrade all packages, no questions asked.&quot;&#xA;  (interactive)&#xA;  (save-window-excursion&#xA;    (list-packages)&#xA;    (package-menu-mark-upgrades)&#xA;    (package-menu-execute 'no-query)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I recently installed openSUSE (came from Windows), and running that command does not currently work. I'm getting an error message in the minibuffer area (I think) that looks more or less like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;progn: Wrong number of arguments: #[nil &quot;ÆÇ!&#xA;ÈÉ!ÊebmUÊfË=OÊÌ*`Í\&quot;²   Î=DÏ@!ÐA!B&#xA;BO  Ñ=O@BÊy)}ÒGÓUjÔÕ@\&quot;tÔÖG×ÏØ##!}ÙÚ\&quot;&#xA;ÙÒ&#xA;GÓUÔÛ&#xA;@@)&#xA;@A#¢ÔÜ&#xA;G×Ý&#xA;Ø##!Õ&#xA;Ê(Ñ(@Þ)*Â) Çßàá)(A(¯*ÙÈâ!&#xA;ääã &#xA;ìóäå\&quot;öæç!,&quot; [id cmd delete-list install-list x elt derived-mode-p package-menu-mode error &quot;The current buffer is not in Package Menu mode&quot; ...] 9 (&quot;/usr/share/emacs/24.3/lisp/emacs-lisp/package.elc&quot; . 51221) nil], 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;debug-on-error&lt;/code&gt; toggled on, I get the following after the error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;package-menu-execute(no-query)&#xA;(progn (list-packages) (package-menu-mark-upgrades) (package-menu-execute (quote no-query)))&#xA;(unwind-protect (progn (list-packages) (package-menu-mark-upgrades) (package-menu-execute (quote no-query))) (set-window-configuration wconfig))&#xA;(let ((wconfig (current-window-configuration))) (unwind-protect (progn (list-packages) (package-menu-mark-upgrades) (package-menu-execute (quote no-query))) (set-window-configuration wconfig)))&#xA;endless/upgrade()&#xA;call-interactively(endless/upgrade record nil)&#xA;command-execute(endless/upgrade record)&#xA;helm-M-x(nil &quot;endless/upgrade&quot;)&#xA;call-interactively(helm-M-x nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After re-loading &lt;code&gt;package.el&lt;/code&gt; I get a different error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 package can be upgraded; type `U' to mark it for upgrading.&#xA;1 package marked for upgrading.&#xA;progn: Wrong number of arguments: (lambda nil &quot;Perform marked Package Menu actions.&#xA;Packages marked for installation are downloaded and installed;&#xA;packages marked for deletion are removed.&quot; (interactive) (if (derived-mode-p (quote package-menu-mode)) nil (error &quot;The current buffer is not in Package Menu mode&quot;)) (let (install-list delete-list cmd id) (save-excursion (goto-char (point-min)) (while (not (eobp)) (setq cmd (char-after)) (if (eq cmd 32) nil (setq id (tabulated-list-get-id)) (cond ((eq cmd 68) (setq delete-list (cons (cons ... ...) delete-list))) ((eq cmd 73) (setq install-list (cons (car id) install-list))))) (forward-line))) (if install-list (progn (if (yes-or-no-p (if (= (length install-list) 1) (format &quot;Install package `%s'? &quot; (car install-list)) (format &quot;Install these %d packages (%s)? &quot; (length install-list) (mapconcat (quote symbol-name) install-list &quot;, &quot;)))) (mapc (quote package-install) install-list)))) (if delete-list (progn (if (yes-or-no-p (if (= (length delete-list) 1) (format &quot;Delete package `%s-%s'? &quot; (caar delete-list) (cdr (car delete-list))) (format &quot;Delete these %d packages (%s)? &quot; (length delete-list) (mapconcat (function ...) delete-list &quot;, &quot;)))) (progn (let ((--dolist-tail-- delete-list) elt) (while --dolist-tail-- (setq elt (car --dolist-tail--)) (let (...) (if debug-on-error ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (error &quot;Aborted&quot;)))) (and delete-list (null install-list) (package-initialize)) (if (or delete-list install-list) (package-menu--generate t t) (message &quot;No operations specified.&quot;)))), 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Did I miss installing something I need? I can still update packages manually with &lt;code&gt;list-packages&lt;/code&gt; etc.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="5243" LastEditDate="2015-05-23T01:30:39.470" LastActivityDate="2015-05-24T16:19:24.403" Title="Weird message when trying to upgrade all packages" Tags="|package|linux|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12472" PostTypeId="2" ParentId="12468" CreationDate="2015-05-17T16:06:57.283" Score="3" Body="&lt;p&gt;Ok: the answer really is just to use &lt;code&gt;read-char-exclusive&lt;/code&gt; instead of &lt;code&gt;read-char&lt;/code&gt;. It works perfectly.&lt;br&gt;&#xA;I wasn't working for me because of some problem in my configurations.&lt;/p&gt;&#xA;" OwnerUserId="8342" LastEditorUserId="50" LastEditDate="2015-05-17T17:19:56.243" LastActivityDate="2015-05-17T17:19:56.243" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12473" PostTypeId="2" ParentId="12460" CreationDate="2015-05-17T18:33:08.647" Score="1" Body="&lt;p&gt;You likely have a package installed or a function defined that is auto-compiling &lt;em&gt;el&lt;/em&gt; files on save. As recommended by others check your &lt;em&gt;init&lt;/em&gt; file, installed packages and also your &lt;em&gt;hooks&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="943" LastActivityDate="2015-05-17T18:33:08.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12475" PostTypeId="1" CreationDate="2015-05-17T20:44:21.923" Score="4" ViewCount="212" Body="&lt;p&gt;In my directory I keep on winding up with dozens of files with names like these:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#%2AOrg%20Agenda%2A#12182wk#&#xA;#%2AOrg%20Agenda%2A#13353nN#&#xA;#%2AOrg%20Agenda%2A#13568-1B#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The content of which is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Week-agenda (W20):&#xA;Monday     11 May 2015 W20&#xA;Tuesday    12 May 2015&#xA;Wednesday  13 May 2015&#xA;Thursday   14 May 2015&#xA;Friday     15 May 2015&#xA;Saturday   16 May 2015&#xA;Sunday     17 May 2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe they're getting created when I run save-some-buffers, which I do to save all open files I'm working with. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to get Emacs to ignore my org-agenda files when saving, but my attempt isn't working:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pastebin.com/UPVrGgLf&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/UPVrGgLf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-05-19T19:10:48.017" LastActivityDate="2015-05-19T19:10:48.017" Title="how to get Emacs to stop saving org-agenda as a file?" Tags="|org-mode|auto-save|" AnswerCount="0" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="12476" PostTypeId="1" CreationDate="2015-05-17T21:19:58.730" Score="1" ViewCount="1129" Body="&lt;p&gt;This may seem like an odd question but I believe there absolutely should be a standard or most common way to use LaTeX on emacs, and that this community would benefit from owning a complete answer to this question, so here goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stefanom.org/setting-up-a-nice-auctex-environment-on-mac-os-x/&quot; rel=&quot;nofollow&quot;&gt;This is my first Google hit for &quot;emacs latex mac&quot;&lt;/a&gt;, which seems to imply AucTeX is the way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/auctex/&quot; rel=&quot;nofollow&quot;&gt;AucTex lives here&lt;/a&gt; and it is covered in the GNU wiki &lt;a href=&quot;http://www.emacswiki.org/emacs/AUCTeX&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying installing it now but I'm not sure how out-of-the-box it is. The wiki says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-c C-c to run LaTeX over your document, then, once it has compiled correctly, C-c C-c again to view it, or if it failed to compile correctly, C-c ` to see the errors.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;C-c C-c&lt;/code&gt; doesn't do this (it brings up a prompt).&lt;/p&gt;&#xA;" OwnerUserId="6641" LastEditorUserId="25" LastEditDate="2015-05-18T19:14:47.207" LastActivityDate="2015-05-18T19:27:36.510" Title="Why doesn't C-c C-c compile my LaTeX document? Did I set up AUCTeX correctly?" Tags="|latex|auctex|osx|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12477" PostTypeId="1" CreationDate="2015-05-18T00:33:42.403" Score="4" ViewCount="1143" Body="&lt;p&gt;When I type C-x C-b (i.e. the command list-buffers), how can I force it to list buffers in the other window? i.e. I typically have my screen split into 2 buffers. I am editing one buffer. I want a command which &lt;em&gt;always&lt;/em&gt; lists buffers in the other window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. list-buffers used to always do this. But somewhere between emacs 24.3 and 24.5 it changed, so now it sometimes puts the buffer list in the current window.&lt;/p&gt;&#xA;" OwnerUserId="8345" LastActivityDate="2020-02-26T19:16:52.173" Title="How can I force &quot;list-buffers&quot; to use the other window" Tags="|buffers|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12478" PostTypeId="2" ParentId="12477" CreationDate="2015-05-18T01:21:08.510" Score="1" Body="&lt;p&gt;I've discovered the command buffer-menu-other-window, which seems to do what I want. It'll take a few hours of use before I'm sure.&lt;/p&gt;&#xA;" OwnerUserId="8345" LastActivityDate="2015-05-18T01:21:08.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12479" PostTypeId="1" AcceptedAnswerId="12491" CreationDate="2015-05-18T02:02:20.077" Score="5" ViewCount="2546" Body="&lt;p&gt;I want to use yasnippets to generate control flow statements in Lua.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lua prettyprint-override&quot;&gt;&lt;code&gt;-- a control flow statement in Lua&#xA;if foo then&#xA;   return &quot;foo&quot;&#xA;elseif bar then&#xA;   return &quot;bar&quot;&#xA;else &#xA;   return &quot;baz&quot;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First I make a yasnippet for &lt;code&gt;if&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: if&#xA;# key: if&#xA;# binding: direct-keybinding&#xA;# --&#xA;if $1 then&#xA;  $0&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No problem. Now I make a yasnippet for &lt;code&gt;elseif&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: elseif&#xA;# key: elseif&#xA;# binding: direct-keybinding&#xA;# --&#xA;elseif $1 then&#xA;  $0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and one for &lt;code&gt;else&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: else&#xA;# key: else&#xA;# binding: direct-keybinding&#xA;# --&#xA;else&#xA;  $0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, using these snippets to generate the target control flow statement yields the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lua prettyprint-override&quot;&gt;&lt;code&gt;-- a misformatted control flow statement in Lua&#xA;if foo then&#xA;   return &quot;foo&quot;&#xA;   elseif bar then&#xA;     return &quot;bar&quot;&#xA;     else &#xA;       return &quot;baz&quot;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to have the statements automatically align themselves correctly, just as if I pressed &lt;kbd&gt;Tab&lt;/kbd&gt; on each line. &lt;code&gt;yas-indent-line&lt;/code&gt; is already set to the default value of &lt;code&gt;'auto&lt;/code&gt;, and of course setting it to &lt;code&gt;'fixed&lt;/code&gt; is not the solution. I could accomplish the reindentation by customizing &lt;code&gt;yas-after-exit-snippet-hook&lt;/code&gt;, but that seems too heavyweight. Is there an option in yasnippets to automatically indent each line according to the mode's default indentation of the line?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-05-18T18:05:25.253" Title="Indent each yasnippet line according to major mode" Tags="|indentation|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12480" PostTypeId="1" AcceptedAnswerId="12481" CreationDate="2015-05-18T02:23:18.563" Score="3" ViewCount="207" Body="&lt;p&gt;I'm new to Emacs, and I'm storing my Emacs configuration in a GitHub repo. Whenever I move to a new computer, I want Emacs to install all packages I specify if they do not present on this computer. Pretty much like &lt;code&gt;PluginInstall!&lt;/code&gt; in Vundle for Vim. Or like &lt;code&gt;pip install -r requirements.txt&lt;/code&gt;. How can I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've just got my hands on Emacs. So if you know the answer, please provide some detailed instructions so I won't get lost.&lt;/p&gt;&#xA;" OwnerUserId="8346" LastActivityDate="2015-05-18T02:34:44.397" Title="Install packages automatically" Tags="|package|use-package|" AnswerCount="1" CommentCount="1" ClosedDate="2015-05-18T11:38:16.087" ContentLicense="CC BY-SA 3.0" />
  <row Id="12481" PostTypeId="2" ParentId="12480" CreationDate="2015-05-18T02:34:44.397" Score="3" Body="&lt;p&gt;If you load packages with &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt; you can add &lt;code&gt;:ensure t&lt;/code&gt; to make sure the package is installed on your system (installing it if needed).  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package helm&#xA;  :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-05-18T02:34:44.397" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12482" PostTypeId="1" CreationDate="2015-05-18T04:49:17.160" Score="3" ViewCount="349" Body="&lt;p&gt;I'm using a &lt;code&gt;virtualenvwrapper&lt;/code&gt; setup for Python. On my emacs, I have &lt;code&gt;virtualenvwrapper&lt;/code&gt; and &lt;code&gt;jedi&lt;/code&gt; installed from MELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I currently do is, I open Emacs, &lt;kbd&gt;M-x venv-workon RET blabla RET&lt;/kbd&gt;, then &lt;kbd&gt;M-x jedi:setup RET&lt;/kbd&gt;. Now I have Numpy installed in environment &lt;code&gt;blabla&lt;/code&gt;, but not globally. After &lt;code&gt;workon&lt;/code&gt; and restarting of the Jedi server, I anticipate Jedi would auto complete Numpy functions from the package automatically. Say when I type &lt;code&gt;import numpy; numpy.&lt;/code&gt;, after the dot, I want Jedi to jump out and give me a list of completions. But it doesn't. I tried &lt;code&gt;jedi:install-server&lt;/code&gt;, it installs it to the old path &lt;code&gt;~/.emacs.d/.python-environments/default&lt;/code&gt;. I guess Jedi is not reading &lt;code&gt;virtualenvwrapper&lt;/code&gt; correctly. What's the right way to setup Jedi with &lt;code&gt;virtualenvwrapper&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8346" LastActivityDate="2015-05-18T04:49:17.160" Title="Set up Jedi with virtualenvwrapper" Tags="|python|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12483" PostTypeId="1" CreationDate="2015-05-18T05:42:15.587" Score="1" ViewCount="1155" Body="&lt;p&gt;You can attach a local file such as picture or text file as part of a PDF or doc file, when you send it to other people or copy this file to other computer or place, the attachment will be one part of the PDF or doc file and you can open it even you don't have the attachment in your local disk, I wonder if this is possible when writing org-mode file using Emacs.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2015-05-18T15:12:45.763" Title="Is it possible to attach a local file to org-mode file like PDF?" Tags="|org-mode|attachment|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12485" PostTypeId="2" ParentId="12463" CreationDate="2015-05-18T08:42:30.757" Score="2" Body="&lt;p&gt;&lt;strong&gt;Side comment&lt;/strong&gt; -- &lt;em&gt;If&lt;/em&gt; you're exporting your task list to HTML, you might be interested by the dashboard of my theme Bigblow [1] (which I'll try to add into ReadTheOrg as well). There, you can easily see counts of items, and even highlight them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See demo on &lt;a href=&quot;https://www.youtube.com/watch?v=DnSGSiXYuOk&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=DnSGSiXYuOk&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;https://github.com/fniessen/org-html-themes&quot; rel=&quot;nofollow&quot;&gt;https://github.com/fniessen/org-html-themes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5156" LastActivityDate="2015-05-18T08:42:30.757" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12486" PostTypeId="1" CreationDate="2015-05-18T10:54:37.577" Score="1" ViewCount="408" Body="&lt;p&gt;I need to backup few files on my Mac, and it can be done inside of Emacs by calling a function. But it is a tedious task to do everyday and sometimes I forgot doing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if I can automate it by using the &lt;code&gt;run-at-time&lt;/code&gt; function and make it backup at the mid night, and wonder what if &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the computer is locked? &lt;/li&gt;&#xA;&lt;li&gt;the laptop lip is closed? &lt;/li&gt;&#xA;&lt;li&gt;the computer is inactive for a long time and in sleep mode?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="105" LastEditDate="2015-07-11T04:59:38.633" LastActivityDate="2015-07-11T04:59:38.633" Title="run-at-time under certain circumstance" Tags="|elisp|timers|" AnswerCount="1" CommentCount="3" ClosedDate="2015-05-18T17:04:14.343" ContentLicense="CC BY-SA 3.0" />
  <row Id="12487" PostTypeId="1" AcceptedAnswerId="20966" CreationDate="2015-05-18T13:04:29.597" Score="19" ViewCount="10855" Body="&lt;p&gt;I went over my configuration files and wanted to do some cleanup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding of &lt;code&gt;with-eval-after-load&lt;/code&gt; was that its body would be evaluated right after the related package is loaded. While cleaning up my configurations files and splitting them even more, I wanted to enclose every package configuration with &lt;code&gt;with-eval-after-load&lt;/code&gt;. Everything went as expected until I enclosed the configuration for &lt;code&gt;helm&lt;/code&gt; and &lt;code&gt;helm-projectile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I had in mind (&lt;a href=&quot;https://bitbucket.org/angrybacon/dotemacs/src/ae2eba9abd6e6abb826e49198b5b2a21661ed904/lisp/init-helm.el#cl-19&quot; rel=&quot;noreferrer&quot;&gt;lisp/init-helm.el&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'helm&#xA;  (setq helm-mode-line-string &quot;&quot;)&#xA;  (add-to-list 'helm-sources-using-default-as-input 'helm-source-man-pages)&#xA;  (define-key global-map (kbd &quot;C-c m&quot;) 'helm-imenu)&#xA;  (define-key global-map (kbd &quot;C-x b&quot;) 'helm-buffers-list))&#xA;&#xA;(with-eval-after-load 'helm-command&#xA;  (global-set-key (kbd &quot;M-x&quot;) 'helm-M-x))&#xA;&#xA;(with-eval-after-load 'helm-projectile&#xA;  (helm-projectile-on))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After restarting Emacs, I get this window size issue:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/01XHe.png&quot; alt=&quot;emacs-window-size-issue&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I resize my window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter nil 'fullscreen 'fullboth)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm guessing I am misusing &lt;code&gt;with-eval-after-load&lt;/code&gt;, how would one sanitize his Emacs configuration and make sure nothing breaks no matter what package are installed ?&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="105" LastEditDate="2015-05-18T14:10:47.590" LastActivityDate="2021-04-29T14:19:52.463" Title="When should I use with-eval-after-load in my configuration files?" Tags="|init-file|package|window|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12488" PostTypeId="1" CreationDate="2015-05-18T14:07:18.387" Score="1" ViewCount="288" Body="&lt;p&gt;I have a problem with org smart-quotes. There are two cases that don't seem to be covered by the standard regexps to identify quotes, namely in the case &lt;code&gt;'&quot;&lt;/code&gt; and the case &lt;code&gt;&quot;'&lt;/code&gt;. The double quote in both examples is not identified and left as it is. I'm wandering if that's a bug to signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if there is a use-case for the second case, but the first is common for exemple in french: L'assise d'&quot;opinions&quot; muettes...&#xA;But to make a general point I did a general example.&#xA;For a working example, use virgin emacs with &#xA;    #+OPTIONS: ':t &#xA;and that's all&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lines in org:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;Lorem&quot; ipsum 'dolor' sit &quot;'amet' consectetur&quot; adipiscing &quot;elit 'sed'&quot; &#xA;do '&quot;eiusmod&quot; tempor' incididunt 'ut &quot;labore&quot;' et dolore magna aliqua. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;become exported in tex as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;``Lorem'' ipsum `dolor' sit ``'amet' consectetur'' adipiscing ``elit `sed''' &#xA;do '&quot;eiusmod'' tempor' incididunt `ut ``labore&quot;' et dolore magna aliqua. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and so in the pdf it reads:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;“Lorem” ipsum ‘dolor’ sit “’amet’ consectetur” adipiscing “elit ‘sed” ’ &#xA;do ’&quot;eiusmod” tempor’ incididunt ‘ut “labore&quot;’ et dolore magna aliqua.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So everything works fine except the cases that I mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A minimal exemple easier to follow: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;L'assise d'&quot;opinions&quot; muettes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in org becomes in tex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;L'assise d'&quot;opinions'' muettes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My guess is that the double quote in these cases is not covered in the regexps used by smart-quotes and is overlooked.&#xA;The standard regexps in &lt;code&gt;org-export-smart-quotes-regexps&lt;/code&gt; are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;\\`\\([\&quot;']\\)\\(\\w\\|\\s.\\|\\s_\\|\\s(\\)&quot; &#xA; &quot;\\`\\([\&quot;']\\)\\(\\s-\\|\\s)\\|\\s.\\)&quot; &#xA; &quot;\\`\\('\\)\\S-&quot; &#xA; &quot;\\(?:\\s-\\|\\s(\\)\\([\&quot;']\\)\\(?:\\w\\|\\s.\\|\\s_\\)&quot; &#xA; &quot;\\(?:\\w\\|\\s.\\|\\s_\\)\\([\&quot;']\\)\\(?:\\s-\\|\\s)\\|\\s.\\)&quot; &#xA; &quot;\\S-\\('\\)\\S-&quot; &#xA; &quot;\\(?:\\s-\\|\\s(\\)\\([\&quot;']\\)\\'&quot; &#xA; &quot;\\(?:\\w\\|\\s.\\|\\s_\\)\\([\&quot;']\\)\\'&quot; &#xA; &quot;\\S-\\('\\)\\'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not a programmer so to me this is gibberish. Could somebody good at regexps tell me how to modify it to cover my orimary case? Or if someone had another solution, that would evidently be as good. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the Documentation of org-export-smart-quotes-regexps is &quot;brief&quot; and doesn't say how the regexps are used. It says only:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List of regexps matching a quote or an apostrophe. In every regexp, quote or apostrophe matched is put in group 1.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So one would have to identify which regexp is interesting here and how to modify it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!!&lt;/p&gt;&#xA;" OwnerUserId="8350" LastEditorUserId="8350" LastEditDate="2015-05-21T08:28:02.237" LastActivityDate="2015-05-21T08:28:02.237" Title="org-mode smart-quotes (probably prb with the regexps)" Tags="|org-mode|org-export|regular-expressions|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12489" PostTypeId="2" ParentId="12486" CreationDate="2015-05-18T14:59:40.130" Score="3" Body="&lt;p&gt;My personal opinion is that &lt;a href=&quot;https://d0edfcdc0ccc1cd13cdab5eb986fb92e8660dbef.googledrive.com/host/0B6LMD0u8OhYYZEotN2QyR1hwR1k/trinity.html&quot; rel=&quot;nofollow&quot;&gt;Emacs is not an operating system&lt;/a&gt;, and while it is often convenient to do things in Emacs, this is the kind of task that is better solved outside of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scheduling your backups within Emacs means that they won't run if Emacs is not running, and that they might run twice if you have two instances of Emacs open.  Since Emacs has very primitive facilities for asynchronous tasks, your Emacs might stutter or even hang while the backup is being done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of OS-level tools for scheduling tasks (&lt;code&gt;cron&lt;/code&gt;, &lt;code&gt;anacron&lt;/code&gt;, &lt;code&gt;launchd&lt;/code&gt;), but they are best discussed &lt;a href=&quot;http://superuser.com&quot;&gt;elsewhere&lt;/a&gt; or &lt;a href=&quot;http://unix.stackexchange.com&quot;&gt;somewhere else&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2015-05-18T16:58:27.070" LastActivityDate="2015-05-18T16:58:27.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12490" PostTypeId="2" ParentId="12483" CreationDate="2015-05-18T15:12:45.763" Score="2" Body="&lt;p&gt;Org-mode files are plain text, by design, and Org therefore has no native facilities for attaching binary files.  (The &lt;code&gt;org-attach&lt;/code&gt; family of commands copy the attachment into a subdirectory of the current directory, and are therefore unrelated to what you are asking.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there's nothing preventing you from encoding your binary file as plain text (using e.g. the &lt;code&gt;base64&lt;/code&gt; utility, or the older &lt;code&gt;uuencode&lt;/code&gt; program) and including it in the Org-mode file.  However, this will make the Org-mode file extremely large, and you risk corrupting the encoding data if you're not extremely careful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As pointed out by wasamasa, it is a better choice to create an archive (using &lt;code&gt;tar&lt;/code&gt;, &lt;code&gt;zip&lt;/code&gt; or &lt;code&gt;7z&lt;/code&gt;) that contains the Org-mode file and the related files.  By using &lt;code&gt;archive-mode&lt;/code&gt;, you can edit the Org-mode file within the archive itself, without needing to manually update the archive each time.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-05-18T15:12:45.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12491" PostTypeId="2" ParentId="12479" CreationDate="2015-05-18T18:05:25.253" Score="7" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there an option in yasnippets to automatically indent each line according to the mode's default indentation of the line?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is what setting &lt;code&gt;yas-indent-line&lt;/code&gt; to &lt;code&gt;'auto&lt;/code&gt; is for, except that you also want to set &lt;code&gt;yas-also-auto-indent-first-line&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. I guess it defaults to &lt;code&gt;nil&lt;/code&gt; because it causes problems in some cases.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-05-18T18:05:25.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12492" PostTypeId="2" ParentId="12476" CreationDate="2015-05-18T19:27:36.510" Score="4" Body="&lt;p&gt;Emacs comes with a built-in mode to edit (La)TeX documents. You can install AUCTeX as an additional package, either via your operating system's package manager if it's available there, or via Emacs's own package manager &lt;a href=&quot;http://elpa.gnu.org/packages/auctex.html&quot; rel=&quot;nofollow&quot;&gt;ELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can tell whether you're using AUCTeX by bringing up the major mode documentation with &lt;code&gt;C-h m&lt;/code&gt; (&lt;code&gt;describe-mode&lt;/code&gt;). If the first paragraph of the description mentions AUCTeX, you're using AUCTeX, otherwise you're using the built-in support. If you have AUCTeX installed, &lt;code&gt;.tex&lt;/code&gt; and other TeX documents will open in AUCTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both the built-in mode and AUCTeX, the key binding &lt;code&gt;C-c C-c&lt;/code&gt; invokes an Emacs command which prompts you to ask what TeX-related command you want to run. The sentence you quote from the wiki is misleading: you need to press &lt;code&gt;C-c C-c RET&lt;/code&gt; to invoke the default TeX-related command. With the built-in mode, this runs (PDF)(La)TeX. With AUCTeX, this command is more intelligent and defaults to (PDF)(La)TeX if it looks like your document needs recompiling, or to launching a DVI/PDF viewer if your document looks up to date, or to launching one of a few other commands such as BibTeX if it looks like this is needed. As everywhere in Emacs, press &lt;kbd&gt;Tab&lt;/kbd&gt; to invoke completion, which will show the possible/predefined commands.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-05-18T19:27:36.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12493" PostTypeId="1" AcceptedAnswerId="12497" CreationDate="2015-05-18T22:24:07.350" Score="2" ViewCount="1786" Body="&lt;p&gt;I have setup Emacs to work almost like an IDE but I haven't managed to make it suggest the available methods of every class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently write in C++ and previously I was using Visual Studio so when I was pressing the dot it would suggest to me the available methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the methods most of the times are countless this is a very important feature for me but I have yet to find how to implement it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that this is a problem of every person writing code so I can only guess that there is surely a package for Emacs to offer this functionality. Can someone suggest any?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2374" LastEditDate="2015-05-19T06:10:28.857" LastActivityDate="2015-05-19T06:10:28.857" Title="Enable Emacs to suggest the available methods of a class" Tags="|completion|c++|ide|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12494" PostTypeId="1" AcceptedAnswerId="12501" CreationDate="2015-05-18T23:27:50.407" Score="5" ViewCount="332" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I change the syntax of a character for a single function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;text-mode&lt;/code&gt; and its derivatives, the &lt;code&gt;'&lt;/code&gt; character has word syntax rather than, say punctuation or string quote syntax.  That's a problem when using &lt;code&gt;abbrev-mode&lt;/code&gt;, as I would like the &lt;code&gt;'&lt;/code&gt; character to fire the &lt;code&gt;abbrev&lt;/code&gt; when I'm using a possessive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the &lt;code&gt;abbrev&lt;/code&gt; &quot;pres&quot; expands to &quot;president&quot; and I want to write the &quot;president's cat&quot;, I'd expect to be able to type &lt;kbd&gt;p&lt;/kbd&gt; &lt;kbd&gt;r&lt;/kbd&gt; &lt;kbd&gt;e&lt;/kbd&gt; &lt;kbd&gt;s&lt;/kbd&gt; &lt;kbd&gt;'&lt;/kbd&gt; &lt;kbd&gt;s&lt;/kbd&gt;, where &quot;pres&quot; expands automatically to &quot;president&quot; when I hit &lt;kbd&gt;'&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now: I don't want to change the syntax for &lt;code&gt;'&lt;/code&gt; globally or permanently, because I don't want to interfere with any other functions that depend on &lt;code&gt;'&lt;/code&gt; having word syntax.  I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice self-insert-command (around testing activate)&#xA;  (with-syntax-table (copy-syntax-table (syntax-table))&#xA;    (modify-syntax-entry ?' &quot;\&quot;&quot;)&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Two problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First: although it does fire the &lt;code&gt;abbrev&lt;/code&gt; as expected, &lt;code&gt;smartparens-mode&lt;/code&gt; complains every second time the &lt;code&gt;abbrev&lt;/code&gt; fires (really: it's every second time).  That's a tangent on the main point, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, and more importantly: this advice seems awfully costly for a function that gets invoked on every insertion command.  It calls up the syntax table, copies it, modifies it, uses it, and then restores the original syntax table.  That seems awfully silly when I really only care about one character, which leads me to suspect I'm going about this wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a smarter way to do this?  (Note that I'm most interested in temporarily changing the syntax of a character and am using the &lt;code&gt;abbrev&lt;/code&gt; example to motivate it.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-05-19T13:10:43.477" Title="Change character syntax temporarily?" Tags="|elisp|syntax|syntax-table|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12495" PostTypeId="1" CreationDate="2015-05-18T23:32:29.497" Score="4" ViewCount="997" Body="&lt;p&gt;For the last few weeks, I decide to work directly in a remote server using tramp-mode, with great success and joy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, recently I decide to add python-mode and an inferior ipython3 sheel to emacs, still working with remote files via tramp. The setup mostly works, and I can run the ipython kernel from the remote servet with little problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, everytime I try to send the current buffer (or region, or file) to be executed, I get the following kind of error (the filename may change to a real filename, according to the function):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FileNotFoundError: [Errno 2] No such file or directory: '/ssh:mss:/tmp/df1fefb99e7a8013d07dcc5ef8b002be-psss-temp.py&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(mss being my server alias).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to be due to python-mode sending the file path with the TRAMP ssh prefix in it. If I just erase the '/ssh:mss:', the remote iPython functions as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I correct this? I suppose I could change python-mode code to correct for the TRAMP prefix, but I don't know where to look for changing. My emacs file, if anyone is interested is in &lt;a href=&quot;https://github.com/aylons/emacsd/tree/master/&quot; rel=&quot;nofollow&quot;&gt;https://github.com/aylons/emacsd/tree/master/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="374" LastActivityDate="2015-05-19T15:39:48.930" Title="Using inferior python and tramp together" Tags="|python|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12496" PostTypeId="1" AcceptedAnswerId="12510" CreationDate="2015-05-18T23:36:57.610" Score="4" ViewCount="1984" Body="&lt;p&gt;I'd like to include a custom latex wrapper around src blocks result. For example, given:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results latex&#xA;which awk&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to generate&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_LaTeX&#xA;\begin{myverbatim}&#xA;/usr/bin/awk&#xA;\end{myverbatim}&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of the standard&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_LaTeX&#xA;/usr/bin/awk&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a straightforward way to get this?&lt;/p&gt;&#xA;" OwnerUserId="6704" LastActivityDate="2015-05-19T14:42:44.313" Title="Wrap org src block results" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12497" PostTypeId="2" ParentId="12493" CreationDate="2015-05-19T03:01:09.733" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://cedet.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;CEDET&lt;/a&gt; is a complete package that is supposed to give Emacs IDE features comparable to Visual Studio or Eclipse.  It has a reputation for being fairly complicated to set up, but there are a lot of tutorials on it in both web page and YouTube form: &lt;a href=&quot;https://www.logilab.org/blogentry/173886&quot; rel=&quot;nofollow&quot;&gt;here's one that looks pretty easy to follow&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if all you want is auto-suggestion of member function names, I have heard &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow&quot;&gt;irony-mode&lt;/a&gt; recommended highly.  Combined with &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsTags#tags&quot; rel=&quot;nofollow&quot;&gt;tags&lt;/a&gt; and &lt;a href=&quot;http://batsov.com/projectile/&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt; you would have a much lighter-weight installation than CEDET with most of the key IDE functionality.&lt;/p&gt;&#xA;" OwnerUserId="2374" LastActivityDate="2015-05-19T03:01:09.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12498" PostTypeId="1" CreationDate="2015-05-19T03:09:33.253" Score="0" ViewCount="89" Body="&lt;p&gt;When the point is at the end of a headline in org-mode and I hit &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Enter&lt;/kbd&gt; (bound to &lt;code&gt;org-meta-return&lt;/code&gt;), the new headline often starts on the &lt;em&gt;same&lt;/em&gt; line instead of on a new one. It happens frequently, but far from always and seemingly at random. I'm not able to reproduce this from a clean init, but I have no idea which package or variable is causing the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have encountered this or have any ideas how to fix it, please let me know because it's driving me mad.&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2015-05-19T04:33:31.700" LastActivityDate="2015-05-19T04:33:31.700" Title="New headlines in org-mode don't always appear on a new line" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12499" PostTypeId="2" ParentId="12493" CreationDate="2015-05-19T03:21:35.977" Score="3" Body="&lt;p&gt;For code completion, I suggest you to use &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;irony-mode&lt;/a&gt; along with &lt;a href=&quot;https://github.com/Sarcasm/company-irony&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-irony&lt;/a&gt;. You can easily get them from MELPA. When you finished installing, you have to build Irony server with &lt;code&gt;M-x irony-install-server&lt;/code&gt;. You also have to add a &lt;code&gt;.clang_complete&lt;/code&gt; file at the project root path with compile flags for including source header paths, so Irony can use that information to parse your files and provide the feature you are needing. If files are in the current directory, Irony can automatically recognize it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;C/C++ guide&lt;/a&gt; my help you to do the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Find definitions in project, even as large as Linux kernel.&lt;/li&gt;&#xA;&lt;li&gt;Find references in project.&lt;/li&gt;&#xA;&lt;li&gt;Find any file in a using Projectile using Helm and Helm Projectile, as in &lt;a href=&quot;http://tuhdo.github.io/helm-projectile.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this guide&lt;/a&gt;, even if your project has as many files as Linux kernel or more.&lt;/li&gt;&#xA;&lt;li&gt;Completion system header with &lt;a href=&quot;https://github.com/randomphrase/company-c-headers&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-c-headers&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Source code information for current identifier at point that look like this:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5sfYg.jpg&quot; alt=&quot;semantic-idle-summary&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Display out of screen function name at the top. This is from the package &lt;a href=&quot;https://github.com/tuhdo/semantic-stickyfunc-enhance&quot; rel=&quot;nofollow noreferrer&quot;&gt;semantic-stickyfunc-enhance&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5Wf0O.gif&quot; alt=&quot;stickyfunc-enhance&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Small scale code refactoring with &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor&quot; rel=&quot;nofollow noreferrer&quot;&gt;semantic-refactor&lt;/a&gt;. You can see all the demos &lt;a href=&quot;https://github.com/tuhdo/semantic-refactor/blob/master/srefactor-demos/demos.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Context-sensitive menu offers appropriate refactoring actions&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate class implementation (also handles nested class and class template)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate class getters and setters&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate function implementation (also handles function template)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate function prototype&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Convert function to function pointer&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Convert function to function parameter&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Move semantic units (class, function, variable)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Extract function with proper type information&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Precise local variable rename&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-05-19T03:36:01.367" LastActivityDate="2015-05-19T03:36:01.367" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12500" PostTypeId="1" AcceptedAnswerId="12502" CreationDate="2015-05-19T03:40:44.547" Score="4" ViewCount="2267" Body="&lt;p&gt;Is it possible to create a regexp that excludes a string? For example, I want to create a regexp that accepts a set of strings with &lt;code&gt;*.*helm.**&lt;/code&gt;except a few ones such as &lt;code&gt;*helm help*&lt;/code&gt;. It means, &lt;code&gt;*helm help*&lt;/code&gt; should be excluded. I want this regexp functionality because I set &lt;code&gt;display-buffer-alist&lt;/code&gt; to position Helm windows where I like it to be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist `(&quot;*.*helm.**&quot;&#xA;                                    (display-buffer-in-side-window)&#xA;                                    (inhibit-same-window . t)&#xA;                                    (window-height . 0.4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, doing so would prevent a Helm buffer by default displayed in fullscreen, like &lt;code&gt;*helm help*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-05-19T04:04:53.587" LastActivityDate="2015-05-19T09:12:55.637" Title="Exclude a string in Emacs Regexp" Tags="|regular-expressions|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12501" PostTypeId="2" ParentId="12494" CreationDate="2015-05-19T06:22:34.593" Score="2" Body="&lt;p&gt;Use macro &lt;code&gt;with-syntax-table&lt;/code&gt;. You create a syntax table (e.g. inheriting from the current table), then change the syntax of any chars you want in that new table, then pass that table to &lt;code&gt;with-syntax-table&lt;/code&gt;, wrapping your code (e.g. your function) with the macro. Within the context of the macro, your code will use the syntax table you specify.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If you have an older Emacs version, which does not have macro &lt;code&gt;with-syntax-table&lt;/code&gt;, then you need to switch to a new table and then switch back again (e.g. using &lt;code&gt;unwind-protect&lt;/code&gt;).)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can save and restore particular syntax settings, modifying the current table in between, using &lt;code&gt;modify-syntax-entry&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-19T13:10:43.477" LastActivityDate="2015-05-19T13:10:43.477" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12502" PostTypeId="2" ParentId="12500" CreationDate="2015-05-19T06:29:16.033" Score="4" Body="&lt;p&gt;AFAIK Emacs Lisp doesn't support lookahead resp. lookbehind assertions.&#xA;So a function is needed checking twice - match and not-match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As &lt;code&gt;display-buffer-alist&lt;/code&gt; accepts functions as argument, there should be a way to realize it.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-05-19T09:12:55.637" LastActivityDate="2015-05-19T09:12:55.637" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12503" PostTypeId="1" CreationDate="2015-05-19T07:53:02.903" Score="12" ViewCount="7079" Body="&lt;p&gt;After looking at &lt;a href=&quot;https://stackoverflow.com/questions/7733668/command-to-clear-shell-while-using-emacs-shell&quot;&gt;this answer&lt;/a&gt; I find it hard to believe there is no way to clear the eShell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know of a short function or method to delete the entire buffer. Pressing &lt;code&gt;C-l&lt;/code&gt; just scrolls the text, as soon as enter is pressed all of that text comes back. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2023-04-05T20:51:17.887" Title="How to clear the eshell" Tags="|eshell|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12504" PostTypeId="2" ParentId="12503" CreationDate="2015-05-19T08:45:39.213" Score="11" Body="&lt;p&gt;There is a function in the current development version, as you can see on the &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00176.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-devel mailing list&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function is very simple:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eshell/clear ()&#xA;  &quot;Clear the eshell buffer.&quot;&#xA;  (let ((inhibit-read-only t))&#xA;    (erase-buffer)&#xA;    (eshell-send-input)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Typing &lt;code&gt;clear&lt;/code&gt; in eshell will then result in clearing the buffer.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorUserId="10269" LastEditDate="2017-09-28T17:19:21.067" LastActivityDate="2017-09-28T17:19:21.067" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12505" PostTypeId="1" CreationDate="2015-05-19T08:49:08.150" Score="0" ViewCount="1099" Body="&lt;p&gt;I'm trying to configure Emacs with Tern.js to use AngularJS in it.&#xA;When add angular to &lt;code&gt;.tern-project&lt;/code&gt; like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;  &quot;plugins&quot;: {&#xA;    &quot;node&quot;: {&#xA;    },&#xA;    &quot;angular&quot;: {&#xA;    }&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and type &lt;code&gt;app.|&lt;/code&gt; I get ReferenceError in Angular itself printed in minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/my/project/home/angular.js:26307&#xA;})(window, document);&#xA;   ^&#xA;ReferenceError: window is not defined&#xA;    at Object.&amp;lt;anonymous&amp;gt; (/my/project/home/angular.js:26307:4)&#xA;    at Module._compile (module.js:456:26)&#xA;    at Object.Module._extensions..js (module.js:474:10)&#xA;    at Module.load (module.js:356:32)&#xA;    at Function.Module._load (module.js:312:12)&#xA;    at Module.require (module.js:364:17)&#xA;    at require (module.js:380:17)&#xA;    at loadPlugins (/usr/local/lib/node_modules/tern/bin/tern:111:15)&#xA;    at startServer (/usr/local/lib/node_modules/tern/bin/tern:136:17)&#xA;    at Object.&amp;lt;anonymous&amp;gt; (/usr/local/lib/node_modules/tern/bin/tern:132:14)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone have some experience with this or advice?&lt;/p&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2015-12-02T11:02:42.577" Title="Angular and Tern.js - ReferenceError in angular.js" Tags="|javascript|tern|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12506" PostTypeId="2" ParentId="12500" CreationDate="2015-05-19T09:11:37.657" Score="0" Body="&lt;p&gt;The accepted answer is the correct answer to my regexp problem, so I left it there. But to solve my own problem, I found a way to do it: instead of trying to negate specific string in the regexp in my original entry added to &lt;code&gt;display-buffer-alist&lt;/code&gt; to handle Helm buffers, just add another entry for the case you are trying to exclude. For example, if you want to exclude any Helm help buffer, simply defines another entry for it in &lt;code&gt;display-buffer-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar helm-display-help-buffer-regexp '(&quot;*.*Helm.*Help.**&quot;))&#xA;&#xA;(add-to-list 'display-buffer-alist helm-display-help-buffer-regexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that  must be added after your original Helm entry to handle normal Helm buffers, because the &lt;code&gt;display-buffer-alist&lt;/code&gt; is scanned from left to right and the one that matches first is selected. This means, before checking all other Helm buffers, we must first check whether the current Helm buffer is a Helm help and if so, use the configuration in &lt;code&gt;helm-display-help-buffer-regexp&lt;/code&gt;. Otherwise, the configuration for common Helm buffers is used for Helm help buffer and as a result, the help buffer can't be displayed because it requires a full window.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-05-19T09:11:37.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12507" PostTypeId="2" ParentId="12496" CreationDate="2015-05-19T09:57:44.657" Score="3" Body="&lt;p&gt;Based on this answer: &lt;a href=&quot;https://stackoverflow.com/questions/20194347/org-mode-with-code-example-as-html&quot;&gt;https://stackoverflow.com/questions/20194347/org-mode-with-code-example-as-html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* test using post-wrap&#xA;  #+name: wrap-myverbatim&#xA;  #+begin_src emacs-lisp :var text=&quot;&quot; :exports none&#xA;    (concat &quot;\\begin{myverbatim}\n&quot;&#xA;            text &quot;\n\\end{myverbatim}\n&quot;)&#xA;  #+end_src&#xA;&#xA;  #+BEGIN_SRC sh :results latex :post wrap-myverbatim(text=*this*)&#xA;    which awk&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS:&#xA;  #+BEGIN_LaTeX&#xA;  \begin{myverbatim}&#xA;  /usr/bin/awk&#xA;  \end{myverbatim}&#xA;  #+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-05-19T14:42:44.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12508" PostTypeId="1" CreationDate="2015-05-19T11:14:54.973" Score="3" ViewCount="55" Body="&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt; I have a document with recurring section structures, similiar to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Section&#xA;****** Goals&#xA;****** Strategy&#xA;****** Bibliography&#xA;****** Notes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and usually an emacs frame with four windows inside where three of those windows are showing the Goals, the Strategy and the Bibliography subsections according to the section I am working in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; How can I register a callback handler that can receive the section I am working on in the fourth window and is able to change the view port of the other three windows such that Goal, Strategy and Bibliography are visible accordingly?&lt;/p&gt;&#xA;" OwnerUserId="6890" LastActivityDate="2015-05-19T11:14:54.973" Title="Automatically show related sections in a multi window setup" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12509" PostTypeId="1" CreationDate="2015-05-19T11:36:19.523" Score="4" ViewCount="2624" Body="&lt;p&gt;One of my collaborators has written a long rtf document that goes like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a paragraph of text&#xA;&#xA;(1) some text&#xA;&#xA;another paragraph or two of text&#xA;&#xA;(2) some text&#xA;&#xA;another paragraph or two of text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And so on. I've opened the file in emacs and I was trying to run &lt;code&gt;replace-regexp&lt;/code&gt; to turn the parenthesized numbers into &lt;code&gt;\exx{&lt;/code&gt; , where &lt;code&gt;\exx{&lt;/code&gt; is a newcommand I have defined in the preamble and will take turn of sequential numbering. However, if I type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-regexp ^([0-9]\{1,2\}) RET \exx\{ RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I get the following error message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid use of `\' in replacement text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried using this alternative expression&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-regexp ^([0-9]\{1,2\}) RET \\\\exx\\{ RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this simply replaces &lt;code&gt;(1)&lt;/code&gt; and subsequent numbers with &lt;code&gt;\\exx\{&lt;/code&gt; , which is not what I want. Every other combination of backslashes that I have tried returns the &lt;code&gt;Invalid use of \ in replacement text&lt;/code&gt; error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can use &lt;code&gt;sed&lt;/code&gt; to get regexp replacement I want, but that is not the issue. I'm asking this question here because I want to understand how to do this particular type of regexp replacement internally to emacs.&lt;/p&gt;&#xA;" OwnerUserId="5454" LastEditorUserId="5454" LastEditDate="2015-05-19T11:53:37.210" LastActivityDate="2015-10-20T11:40:12.133" Title="replace-regexp: invalid use of \ in replacement text" Tags="|regular-expressions|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12510" PostTypeId="2" ParentId="12496" CreationDate="2015-05-19T13:36:55.663" Score="4" Body="&lt;p&gt;Unless you want to restrict your output to LaTeX there is no reason to wrap in &lt;code&gt;#+begin_latex . #+end_latex&lt;/code&gt;.   As such, you could simply use the &lt;code&gt;wrap&lt;/code&gt; keyword.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacs -q&lt;/code&gt; example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (org-babel-do-load-languages 'org-babel-load-languages &#xA;               '((shell .  t)))&#xA;  (insert &quot;&#xA;#+BEGIN_SRC sh :wrap myverbatim :exports results&#xA;which awk&#xA;#+END_SRC&quot;)&#xA;  (org-latex-export-as-latex nil nil nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;=&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{myverbatim}&#xA;/usr/bin/awk&#xA;\end{myverbatim}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2015-05-19T13:36:55.663" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12512" PostTypeId="1" CreationDate="2015-05-19T14:44:10.520" Score="2" ViewCount="1474" Body="&lt;p&gt;I'm writing a document that I would like to export to LaTeX and HTML. To write my formulas I mostly use the &lt;code&gt;align&lt;/code&gt; environment of TeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;code&gt;.org&lt;/code&gt; file I write the formulas like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_align&#xA;   a &amp;amp;= b + x \\&#xA;   d &amp;amp;= a - b \\&#xA;#+end_align&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The export to LaTeX works as expected and I get the correct &lt;code&gt;align&lt;/code&gt; environment. But for the HTML export &lt;code&gt;begin_align&lt;/code&gt; and &lt;code&gt;end_align&lt;/code&gt; are ignored and the ASCII text is displayed instead of a formula rendered with MathJax. The same happens if I use &lt;code&gt;\begin{align}&lt;/code&gt; and &lt;code&gt;\end{align}&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standalone formulas work out of box. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should/can I change the HTML export function to correctly display &lt;code&gt;align&lt;/code&gt; environments with MathJax?&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="504" LastEditDate="2015-05-21T22:28:01.070" LastActivityDate="2015-05-22T06:16:39.863" Title="Render align environments with MathJax for 'org-html-export-to-html'" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12513" PostTypeId="2" ParentId="12390" CreationDate="2015-05-19T14:46:34.177" Score="1" Body="&lt;p&gt;Turns out this is an issue with projectile mode in emacs 24+. &lt;a href=&quot;https://github.com/bbatsov/prelude/issues/594&quot; rel=&quot;nofollow&quot;&gt;See here&lt;/a&gt;. Quick fix is to eval the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-mode-line &quot; Projectile&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-05-19T14:46:34.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12514" PostTypeId="2" ParentId="12216" CreationDate="2015-05-19T15:14:24.533" Score="1" Body="&lt;p&gt;To solve this issue I opened a bug on the bug tracker, and finally a fix was found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Checking with &lt;code&gt;M-x list-load-path-shadows&lt;/code&gt;, I found out that tramp* files in &lt;code&gt;/usr/local/share/emacs/site-lisp/&lt;/code&gt; were hiding the correct tramp* files. Just removing them fixed this issue once and for all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to Michael Albinus, then. I'll leave a &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20662#95&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; to the bug tracker if anyone is interested in the details.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2015-06-01T16:13:58.307" LastActivityDate="2015-06-01T16:13:58.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12515" PostTypeId="2" ParentId="12495" CreationDate="2015-05-19T15:39:48.930" Score="1" Body="&lt;p&gt;Which Emacs version are you using? Reading python.el, this problem seems to have been fixed back in September 2012. I don't know which Emacs version this fix belongs to, but I guess it shall work at least for Emacs 24.3. See also this &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12340&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-05-19T15:39:48.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12516" PostTypeId="1" CreationDate="2015-05-19T17:01:42.190" Score="3" ViewCount="141" Body="&lt;p&gt;In some habit-tracking apps nowadays, the user can set for the activity to take place on indeterminate days, as long as it's done n times a week &lt;em&gt;in total&lt;/em&gt;. So for example if I want to go to the gym 4 times a week, I wouldn't care if I went there on certain specific days during the week. Is there a similar functionality in org mode/org-habit? It seems that &lt;code&gt;&quot;+1d/2d&quot;&lt;/code&gt; style of scheduling is really the closest thing I can get, but that doesn't exactly achieve the same thing as described above.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-05-19T17:01:42.190" Title="org-habit - Can I arrange for a habit to take place n times during a week, but on indeterminate days?" Tags="|org-mode|org-habit|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12517" PostTypeId="1" AcceptedAnswerId="12518" CreationDate="2015-05-19T17:22:31.993" Score="24" ViewCount="6339" Body="&lt;p&gt;If today is Thursday, I want the agenda to be from Wednesday (yesterday) through next Tuesday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I set &lt;code&gt;org-agenda-day&lt;/code&gt; to &lt;code&gt;&quot;-1d&quot;&lt;/code&gt;, it shows the full week (starting Monday) that contains yesterday. I want it to start yesterday, even if yesterday isn't Monday.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-05-20T08:37:27.070" Title="How do I make the timespan shown by org agenda start yesterday?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12518" PostTypeId="2" ParentId="12517" CreationDate="2015-05-19T17:22:31.993" Score="38" Body="&lt;p&gt;If &lt;code&gt;org-agenda-start-on-weekday&lt;/code&gt; is set to an integer (by default it's set to 1, corresponding to Monday), and &lt;code&gt;org-agenda-span&lt;/code&gt; is set to &lt;em&gt;either&lt;/em&gt; &lt;code&gt;'week&lt;/code&gt; or &lt;code&gt;7&lt;/code&gt;, org will always start the agenda on the day specified by &lt;code&gt;org-agenda-start-on-weekday&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to always start yesterday, you must set &lt;code&gt;org-agenda-start-day&lt;/code&gt; to &lt;code&gt;&quot;-1d&quot;&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; do one of the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Set &lt;code&gt;org-agenda-start-on-weekday&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. Then, the first day of the agenda will be determined by &lt;code&gt;org-agenda-start-day&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set &lt;code&gt;org-agenda-span&lt;/code&gt; to a value that isn't &lt;code&gt;'week&lt;/code&gt;. For example, setting it to &lt;code&gt;5&lt;/code&gt; will show five days, and then it will respect &lt;code&gt;org-agenda-start-day&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I recommend doing both, in case you decide you want to show a full week. Here's code to show five days starting yesterday:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-start-day &quot;-1d&quot;)&#xA;(setq org-agenda-span 5)&#xA;(setq org-agenda-start-on-weekday nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="504" LastEditDate="2015-05-20T08:37:27.070" LastActivityDate="2015-05-20T08:37:27.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12519" PostTypeId="1" AcceptedAnswerId="12520" CreationDate="2015-05-19T17:37:19.723" Score="1" ViewCount="212" Body="&lt;p&gt;How can &lt;code&gt;string-rectangle&lt;/code&gt; or &lt;code&gt;C-xrt&lt;/code&gt; convert&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;aRandomText_-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aRandomText_0&#xA;aRandomText_1&#xA;aRandomText_2&#xA;aRandomText_3&#xA;aRandomText_4&#xA;aRandomText_5&#xA;aRandomText_6&#xA;aRandomText_7&#xA;aRandomText_8&#xA;aRandomText_9&#xA;aRandomText_10&#xA;aRandomText_11&#xA;aRandomText_12&#xA;aRandomText_13&#xA;aRandomText_14&#xA;aRandomText_15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One can write the above from scratch with &lt;code&gt;eval-expression&lt;/code&gt; (&lt;code&gt;M-:&lt;/code&gt;) and then &lt;code&gt;(dotimes (i 16) (insert (format &quot;aRandomText_%d\n&quot; i)))&lt;/code&gt;, but how can you do it on an &lt;em&gt;existing&lt;/em&gt; (rectangle of) text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how can you do this when using letters?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aRandomText_a&#xA;aRandomText_b&#xA;aRandomText_c&#xA;etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5449" LastEditorUserId="253" LastEditDate="2015-05-19T17:38:32.133" LastActivityDate="2015-05-19T18:52:27.347" Title="string-rectangle: how to make input vary?" Tags="|rectangle|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12520" PostTypeId="2" ParentId="12519" CreationDate="2015-05-19T17:52:09.427" Score="1" Body="&lt;p&gt;You can do this with &lt;code&gt;replace-regexp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your replacement you have access to which Nth replacement is running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is from the docs:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In interactive calls, the replacement text can contain &lt;code&gt;\,&lt;/code&gt; followed&#xA;  by a Lisp expression.  Each replacement evaluates that expression to&#xA;  compute the replacement string.  Inside of that expression, &lt;code&gt;\&amp;amp;&lt;/code&gt; is a&#xA;  string denoting the whole match as a string, &lt;code&gt;\N&lt;/code&gt; for a partial match,&#xA;  &lt;code&gt;\#&amp;amp;&lt;/code&gt; and &lt;code&gt;\#N&lt;/code&gt; for the whole or a partial match converted to a number&#xA;  with &lt;code&gt;string-to-number&lt;/code&gt;, and &lt;code&gt;\#&lt;/code&gt; itself for the number of&#xA;  replacements done so far (starting with zero).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you could mark your text and run &lt;code&gt;replace-regexp&lt;/code&gt; replacing &lt;code&gt;_-1&lt;/code&gt; with &lt;code&gt;_\,\#&lt;/code&gt; and you would get &lt;code&gt;_0&lt;/code&gt;, &lt;code&gt;_1&lt;/code&gt;, ... &lt;code&gt;_N&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, mark your text and then do this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;kbd&gt;replace-regexp&lt;/kbd&gt;&lt;kbd&gt;enter&lt;/kbd&gt; &lt;code&gt;_-1&lt;/code&gt; &lt;kbd&gt;enter&lt;/kbd&gt; &lt;code&gt;_\,\#&lt;/code&gt; &lt;kbd&gt;enter&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the &lt;code&gt;\,&lt;/code&gt; construct in the replacement to run any code you want which you could use to add increasing characters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a demo of doing characters for up to 26 entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/BdYx1.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer has an example of a more advanced usage of the function: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/10325/how-can-i-modify-a-variable-in-a-javascript-file-that-meets-specific-conditions/10341#10341&quot;&gt;How can I modify a variable in a javascript file that meets specific conditions?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-05-19T18:52:27.347" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="12521" PostTypeId="2" ParentId="12519" CreationDate="2015-05-19T17:54:00.317" Score="1" Body="&lt;p&gt;It's not a rectangle-based answer, so if you're not tied to that, you could do this using an Emacs macro and the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macro-Counter.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;macro counter&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2&gt;Inserting numbers&lt;/h2&gt;&#xA;&lt;p&gt;So record a macro:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x ( C-e &amp;lt;DEL&amp;gt; C-x C-k C-i C-n C-x e&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And continue running it until you hit the end of the area you want to change by pressing &lt;code&gt;e&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Let me break down the macro definition, because it's confusing:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-x (&lt;/code&gt;&lt;/strong&gt; -- start the macro recording&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-e &amp;lt;DEL&amp;gt;&lt;/code&gt;&lt;/strong&gt; -- go to the end of the line, and delete the &lt;code&gt;1&lt;/code&gt; there.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-x C-k C-i&lt;/code&gt;&lt;/strong&gt; -- call &lt;code&gt;#'kmacro-insert-counter&lt;/code&gt;, which will start the macro counter and insert its number. This gives you the state tracking of &amp;quot;which number gets inserted next?&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-n&lt;/code&gt;&lt;/strong&gt; -- go to the next line.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-x e&lt;/code&gt;&lt;/strong&gt; -- end recording the macro, and run it again. You can now repeat the macro just by pressing &lt;code&gt;e&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2&gt;Inserting characters&lt;/h2&gt;&#xA;&lt;p&gt;If you want to insert characters instead, we need to set the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Formatting-Strings.html#Formatting-Strings&quot; rel=&quot;nofollow noreferrer&quot;&gt;format string&lt;/a&gt; the macro uses to insert the counter. We can do that with &lt;code&gt;kmacro-set-format&lt;/code&gt;, which is bound to &lt;code&gt;C-x C-k C-f&lt;/code&gt;. So tell it to print the integer as a character:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-k C-f %c &amp;lt;RET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that the macro counter format string is global; it's shared for other macros. So if you want to make another macro that inserts numbers, you have to reset it. You can do that again, with &lt;code&gt;C-x C-k C-f &amp;lt;RET&amp;gt;&lt;/code&gt;. This resets the value to the default, which is &lt;code&gt;%d&lt;/code&gt;. But if we instead set the format string &lt;em&gt;inside&lt;/em&gt; the definition of the macro, it won't affect other macros. So we're left with this as the macro definition:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x (  C-x C-k C-f %c &amp;lt;RET&amp;gt;  C-e &amp;lt;DEL&amp;gt; C-x C-k C-i C-n C-x e&#xA;start | set the macro's     | the macro body&#xA;macro | format string       | as above     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So now we'll get something that inserts characters, but they're not the right ones; we'll get characters like &lt;code&gt;^@ ^A ^B&lt;/code&gt; and so forth, because those are the characters corresponding to the ASCII codes starting at 0. We need to start the macro's counter not at 0, but at the code for the character &lt;code&gt;a&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now, that character happens to be 97, so let's set that using &lt;code&gt;kmacro-set-counter&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-k C-c 97 &amp;lt;RET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And let's put the whole thing together. There's nothing new here, so instead of fully annotating it, I've just noted what the parts are doing. You can do them separately. Here it is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-k C-c 97 &amp;lt;RET&amp;gt;  C-x (  C-x C-k C-f %c &amp;lt;RET&amp;gt;  C-e &amp;lt;DEL&amp;gt; C-x C-k C-i C-n C-x e&#xA; set the macro's    | start | set the macro's     | the macro body&#xA; counter value      | macro | format string       | as above&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-19T18:38:19.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12522" PostTypeId="1" AcceptedAnswerId="12531" CreationDate="2015-05-19T18:08:45.857" Score="0" ViewCount="532" Body="&lt;p&gt;When I try to connect to a remote machine from an &lt;code&gt;ansi-term&lt;/code&gt; terminal using &lt;a href=&quot;https://mosh.mit.edu/&quot; rel=&quot;nofollow&quot;&gt;mosh&lt;/a&gt; (a remote terminal application), I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ mosh -- user@host.domain&#xA;&#xA;mosh-server needs a UTF-8 native locale to run.&#xA;&#xA;Unfortunately, the local environment (LC_CTYPE=) specifies&#xA;the character set &quot;US-ASCII&quot;,&#xA;&#xA;The client-supplied environment (LC_CTYPE=) specifies&#xA;the character set &quot;US-ASCII&quot;.&#xA;&#xA;LANG=&#xA;LC_CTYPE=&#xA;LC_NUMERIC=&quot;POSIX&quot;&#xA;LC_TIME=&quot;POSIX&quot;&#xA;LC_COLLATE=&quot;POSIX&quot;&#xA;LC_MONETARY=&quot;POSIX&quot;&#xA;LC_MESSAGES=&quot;POSIX&quot;&#xA;LC_PAPER=&quot;POSIX&quot;&#xA;LC_NAME=&quot;POSIX&quot;&#xA;LC_ADDRESS=&quot;POSIX&quot;&#xA;LC_TELEPHONE=&quot;POSIX&quot;&#xA;LC_MEASUREMENT=&quot;POSIX&quot;&#xA;LC_IDENTIFICATION=&quot;POSIX&quot;&#xA;LC_ALL=&#xA;Connection to user@host.domain closed.&#xA;/usr/local/bin/mosh: Did not find mosh server startup message.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't have this problem from &lt;code&gt;iTerm2&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="6" LastActivityDate="2015-05-19T21:20:50.983" Title="UTF-8 native locale for ansi-term" Tags="|ansi-term|ssh|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12523" PostTypeId="2" ParentId="12519" CreationDate="2015-05-19T18:26:57.297" Score="1" Body="&lt;p&gt;Similar to this question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/7612/add-a-constant-decimal-value-to-a-column-of-numbers/&quot;&gt;Add a constant decimal value to a column of numbers&lt;/a&gt; you could do this with Calc.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate the number of rows you need (just look at the modeline while the point is at the last row), let than number be &lt;code&gt;N&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x * c&lt;/kbd&gt; starts Calc.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v x&lt;/kbd&gt;&lt;code&gt;N&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; creates a vector of length &lt;code&gt;N&lt;/code&gt; and populates it with numbers 1..N.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v u&lt;/kbd&gt; unpacks the vector.&lt;/li&gt;&#xA;&lt;li&gt;Select the entire stack and &lt;kbd&gt;C-x r r&lt;/kbd&gt;&lt;code&gt;1&lt;/code&gt; - copies the selected rectangle to the register &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Return to the buffer with your text, remove the &lt;code&gt;-1&lt;/code&gt; bit, by, for example, making a rectangular selection and &lt;kbd&gt;C-x r k&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Move the point to the end of the first line and press &lt;kbd&gt;C-x r i&lt;/kbd&gt;&lt;code&gt;1&lt;/code&gt; - this will paste the rectangle stored in the register &lt;code&gt;1&lt;/code&gt; in place of the (previously removed) column of &lt;code&gt;-1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There's also a way to do this with Org table (the data you are trying to arrange does look like a table, so why not use something more specialized for it?).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;org-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Place point in the beginning of the buffer, &lt;kbd&gt;C-SPC&lt;/kbd&gt;, move it to the beginning of the last line, &lt;kbd&gt;C-x r t&lt;/kbd&gt;&lt;code&gt;|&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In a similar way replace the column of &lt;code&gt;-1&lt;/code&gt; with a &lt;code&gt;||&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;TAB&lt;/kbd&gt; on the table to align.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add &lt;code&gt;#+tblfm: $2=@#-1&lt;/code&gt; after the table, the result will look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| aRandomText |  0 |&#xA;| aRandomText |  1 |&#xA;| aRandomText |  2 |&#xA;| aRandomText |  3 |&#xA;| aRandomText |  4 |&#xA;| aRandomText |  5 |&#xA;| aRandomText |  6 |&#xA;| aRandomText |  7 |&#xA;| aRandomText |  8 |&#xA;| aRandomText |  9 |&#xA;| aRandomText | 10 |&#xA;| aRandomText | 11 |&#xA;| aRandomText | 12 |&#xA;| aRandomText | 13 |&#xA;| aRandomText | 14 |&#xA;| aRandomText | 15 |&#xA;#+tblfm: $2=@#-1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-05-19T18:38:12.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12524" PostTypeId="1" CreationDate="2015-05-19T19:20:55.983" Score="3" ViewCount="446" Body="&lt;p&gt;I use package manager to update my packages automatically by doing &lt;code&gt;package-list-packages&lt;/code&gt;, &lt;code&gt;package-menu-mark-upgrades&lt;/code&gt;, &lt;code&gt;package-menu-execute&lt;/code&gt;. (I assume this is the easiest way to automatically update all my packages, though I don't really know.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this, org-mode winds up in a directory with a path like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/Dropbox/emacs/prelude/elpa/org-20150511/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use packages that are part of &lt;code&gt;contrib&lt;/code&gt;, so my .emacs includes these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/Dropbox/emacs/prelude/elpa/org-20150511/lisp&quot; load-path)  &#xA;(add-to-list 'load-path &quot;~/Dropbox/emacs/prelude/elpa/org-20150511/contrib&quot; load-path)&#xA;(add-to-list 'load-path &quot;~/Dropbox/emacs/prelude/elpa/org-20150511/contrib/lisp&quot; load-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since the org directory is named according to the date of the release, this means I have to either: &#xA;1. edit the directory name in the load paths &#xA;2. rename the org folder&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get org-mode to find the contrib directories automatically when I upgrade org?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="50" LastEditDate="2015-05-20T18:04:38.927" LastActivityDate="2015-05-20T18:52:06.807" Title="Do I have to rename my org-mode load-path folder after every update?" Tags="|org-mode|package|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12526" PostTypeId="1" AcceptedAnswerId="12527" CreationDate="2015-05-19T20:09:24.540" Score="5" ViewCount="1424" Body="&lt;p&gt;The function &lt;code&gt;remove-text-properties&lt;/code&gt; requires a list for the third argument &lt;code&gt;props&lt;/code&gt; -- e.g., &lt;code&gt;(remove-text-properties start end '(face nil))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I remove &lt;strong&gt;all&lt;/strong&gt; text properties in a buffer in one fell swoop, without necessarily knowing what all of those properties are?&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-05-19T20:12:28.107" Title="How to remove all text properties in a buffer" Tags="|text-properties|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12527" PostTypeId="2" ParentId="12526" CreationDate="2015-05-19T20:12:28.107" Score="7" Body="&lt;p&gt;Maybe this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(let ((inhibit-read-only t))&#xA;  (set-text-properties (point-min) (point-max) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-19T20:12:28.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12528" PostTypeId="1" CreationDate="2015-05-19T20:36:28.300" Score="1" ViewCount="43" Body="&lt;p&gt;As an alternative to &lt;a href=&quot;https://github.com/KabbAmine/vCoolor.vim&quot; rel=&quot;nofollow&quot;&gt;the awesome vCoolor plugin&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to find alternatives in Emacs. When you do &lt;code&gt;M-x color&lt;/code&gt;. You see a list of possible color functions. But nothing of them reads the color under the cursor and lets you input the HTML color (e.g. &lt;code&gt;#BD9800&lt;/code&gt;). &#xA;Or something in that way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any function or package that offers same functionality as the vCoolor plugin for Vim? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-05-19T20:36:28.300" Title="Is there a color selector in Emacs, that reads the HTML color under cursor?" Tags="|package|colors|coloring|" AnswerCount="0" CommentCount="3" ClosedDate="2015-05-20T14:11:56.533" ContentLicense="CC BY-SA 3.0" />
  <row Id="12529" PostTypeId="1" CreationDate="2015-05-19T20:44:08.677" Score="1" ViewCount="111" Body="&lt;p&gt;Using GNU Emacs 24.5.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My c++-mode hook has &lt;code&gt;(c-set-style &quot;cc-mode&quot;)&lt;/code&gt;.  This works fairly well for me, with the following exceptions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all: &lt;code&gt;try&lt;/code&gt;-blocks are indented&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;int main()&#xA;   try &#xA;      {&#xA;        //...&#xA;      }&#xA;   catch (...)&#xA;      {&#xA;        // ...&#xA;      }&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would prefer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;int main()&#xA;try &#xA;{&#xA;        //...&#xA;}&#xA;catch (...)&#xA;{&#xA;        // ...&#xA;}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In addition, when using &lt;code&gt;enum class&lt;/code&gt;, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;enum class Month {&#xA;  jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec&#xA;    };&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would be more natural for the closing brace to be flush left:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;enum class Month {&#xA;  jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec&#xA;};&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also tried all the other built-in styles.  The two that work best are &lt;code&gt;cc-mode&lt;/code&gt; and &lt;code&gt;stroustrup&lt;/code&gt;, but neither give me the behavior I would like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions? Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="8355" LastActivityDate="2015-05-19T20:44:08.677" Title="getting the &quot;right&quot; indentation via my c++-mode-hook" Tags="|indentation|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12530" PostTypeId="1" CreationDate="2015-05-19T21:10:54.283" Score="0" ViewCount="699" Body="&lt;p&gt;I am trying to configure &lt;code&gt;highlight-symbol&lt;/code&gt; mode with &lt;code&gt;use-package&lt;/code&gt; for only programming modes. This is what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package highlight-symbol&#xA;  :ensure t&#xA;  :init &#xA;  (add-hook 'prog-mode-hook&#xA;            (lambda()&#xA;              (highlight-symbol-mode 1)))&#xA;  (add-hook 'prog-mode-hook&#xA;            (lambda()&#xA;              (highlight-symbol-nav-mode 1)))&#xA;  :config&#xA;  (setq highlight-symbol-idle-delay 1.0&#xA;        highlight-symbol-on-navigation-p t)&#xA;  :diminish highlight-symbol-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I open a .cpp file for example, I see that highlighting is not enabled (the minor mode is not enabled). I have also tried using lambda functions in the hooks to pass a non-nil argument, but that does not help. Invoking, &lt;code&gt;M-x highlight-symbol-mode&lt;/code&gt; on the buffer works as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2292" LastEditorUserId="675" LastEditDate="2015-05-20T03:03:45.883" LastActivityDate="2015-11-16T06:49:37.097" Title="Enable highlighting symbols in prog-mode" Tags="|syntax-highlighting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12531" PostTypeId="2" ParentId="12522" CreationDate="2015-05-19T21:20:50.983" Score="2" Body="&lt;p&gt;iTerm2 and Terminal.app automatically set &lt;code&gt;LANG&lt;/code&gt; and &lt;code&gt;LC_*&lt;/code&gt; from the global language settings of OS X.  For instance, if your OS X installation is configured for US language a shell in iTerm2 and Terminal.app automatically receives &lt;code&gt;LANG=en_US.utf8&lt;/code&gt; in its environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs' &lt;code&gt;ansi-term&lt;/code&gt; however does not do this.  Hence you need to explicitly configure your language environment in the initialisation file of your shell.  For Zsh for instance you would add the following to &lt;code&gt;~/.zshenv&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z $LANG ]]; then export LANG=en_US.utf8; fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-05-19T21:20:50.983" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12532" PostTypeId="1" AcceptedAnswerId="13275" CreationDate="2015-05-19T21:56:18.253" Score="8" ViewCount="765" Body="&lt;p&gt;I would like to use an idle timer that is local to the current buffer in one of my packages. However, I can't seem to find out how.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I create (or fake) the behavior of a buffer local idle timer? Is the only way to call a function that checks &lt;code&gt;(current-buffer)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2021-09-25T07:36:31.630" Title="Buffer local idle-timer" Tags="|emacs-internals|idle-timer|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12533" PostTypeId="2" ParentId="12530" CreationDate="2015-05-19T22:25:49.457" Score="1" Body="&lt;p&gt;Found the issue, it was a mistake in my init setup. I have split up my configuration into separate files, and the file where I had clubbed highlighting changes wasn't getting actually invoked. And I noticed it after a few days!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@lunaryorn's setup works for me as well on 24.5.&lt;/p&gt;&#xA;" OwnerUserId="2292" LastEditorUserId="2292" LastEditDate="2015-05-20T02:47:09.017" LastActivityDate="2015-05-20T02:47:09.017" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12534" PostTypeId="1" AcceptedAnswerId="12547" CreationDate="2015-05-19T22:36:57.333" Score="0" ViewCount="174" Body="&lt;p&gt;I have installed the English ispell dictionary &lt;code&gt;english.hash&lt;/code&gt; for using in Emacs, and placed it at &lt;code&gt;C:\Users\espend\AppData\Roaming&lt;/code&gt;. When typing &lt;code&gt;M-x ispell-change-dictionary&lt;/code&gt;, in Emacs, this English dictionary become available as an option to chose. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, I am not able to get the Norwegaian dictionary available within Emacs. This dictionary has another name format than the English one, and come in two files, respectively, &lt;code&gt;nb_NO.dic&lt;/code&gt; and &lt;code&gt;nb_NO.aff&lt;/code&gt;. When these two files are placed at the same location as the English dictionary, they are not available for Emacs by the &lt;code&gt;M-x ispell-change-dictionary&lt;/code&gt; command. Hence, I cannot turn to Norwegian spell checking when I need it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What have I done wrong?&lt;br&gt;&#xA;Thanks in advance to those solving this problem for me :)&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="8348" LastEditDate="2015-05-20T06:26:34.690" LastActivityDate="2015-05-20T10:55:00.640" Title="Why doesn't my Norwegian ispell dictionary work on Emacs (Windows)?" Tags="|ispell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12535" PostTypeId="1" AcceptedAnswerId="12573" CreationDate="2015-05-19T22:50:06.047" Score="4" ViewCount="375" Body="&lt;p&gt;I need to be able to parse a string like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (forward-word 4) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and execute it from elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that purpose I'm trying to use &lt;code&gt;execute-kbd-macro&lt;/code&gt; and &lt;code&gt;edmacro-parse-keys&lt;/code&gt; but I'm a little bit surprised as these functions won't be executed in the current buffer (with current buffer, i.e. using &lt;code&gt;with-current-buffer&lt;/code&gt;), please take a look:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun execute-macro-in-the-current-buffer ()&#xA;    (interactive)&#xA;    (with-current-buffer (get-buffer-create &quot;*test-buffer*&quot;)&#xA;        (erase-buffer)&#xA;        (insert &quot;Lorem Ipsum is simply dummy text of the printing and typesetting industry.&quot;)&#xA;        (goto-char 0)&#xA;        (execute-kbd-macro&#xA;          (edmacro-parse-keys &quot;M-&amp;gt;&quot;) t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I execute it then my point moves to the end of the current buffer but not of the buffer &lt;code&gt;*test-buffer*&lt;/code&gt; as I was expected. But why? What is wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;May be I need another way to parse a string and execute it? Which one?&lt;/p&gt;&#xA;" OwnerUserId="336" LastActivityDate="2015-05-21T09:06:11.187" Title="Execute keyboard macro in the current buffer" Tags="|buffers|keyboard-macros|" AnswerCount="1" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="12536" PostTypeId="1" AcceptedAnswerId="12537" CreationDate="2015-05-20T00:03:25.917" Score="3" ViewCount="369" Body="&lt;p&gt;I have a phrase, e.g. &lt;em&gt;This is an example phrase&lt;/em&gt;, and a collection of text files (&lt;code&gt;coll.d/a.txt&lt;/code&gt;, &lt;code&gt;coll.d/b.txt&lt;/code&gt;, etc.), and I'm looking for the former in the latter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, maybe my pattern is splitted over several lines of text, so plain grep &lt;a href=&quot;https://unix.stackexchange.com/q/204139/24170&quot;&gt;isn't so simple&lt;/a&gt;.&lt;br&gt;&#xA;I like the way &lt;kbd&gt;C-s&lt;/kbd&gt; deals with spaces, case, the kill-ring, and so on, and look for such behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I search many files with it ?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Certainly an answer is burried somewhere in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Search.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt; or &lt;a href=&quot;http://emacswiki.org/emacs/CategorySearchAndReplace&quot; rel=&quot;nofollow noreferrer&quot;&gt;manuals&lt;/a&gt; but &lt;code&gt;rgrep&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;replace&lt;/code&gt;, &lt;code&gt;regexp&lt;/code&gt;, and &lt;code&gt;occur&lt;/code&gt; somewhat complicate the search, without even mentionning all things &lt;code&gt;dired&lt;/code&gt;.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="2047" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2015-05-24T14:38:02.857" Title="Searching for multi-line text in many files" Tags="|isearch|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12537" PostTypeId="2" ParentId="12536" CreationDate="2015-05-20T00:47:37.187" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Mark the files in Dired (&lt;code&gt;* t&lt;/code&gt; to mark all).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;M-s a C-s&lt;/code&gt; to search them. For regexp search, use &lt;code&gt;M-s a C-M-s&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, nodes &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Dired-Features.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Misc Dired Features&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Marks-vs-Flags.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Marks vs Flags&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need to search in a hierarchy of directories (i.e., recursively), use &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; and prefix key &lt;strong&gt;&lt;code&gt;M-+&lt;/code&gt;&lt;/strong&gt; (i.e., &lt;code&gt;M-+ M-s a C-s&lt;/code&gt; or &lt;code&gt;M-+ M-s a C-M-s&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can also search a set of files anywhere the same way. Create a &lt;a href=&quot;https://emacs.stackexchange.com/a/6008/105&quot;&gt;Dired buffer of arbitrary files&lt;/a&gt;, from anywhere, and use the same search keys.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-05-24T14:38:02.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12538" PostTypeId="1" AcceptedAnswerId="12544" CreationDate="2015-05-20T02:33:27.903" Score="3" ViewCount="294" Body="&lt;p&gt;It's clear that AUCTeX has some way of determining the documentclass, since some functions behave differently depending on which documentclass is selected.  For example, &lt;code&gt;LaTeX-insert-item&lt;/code&gt; behaves differently when the documentclass is beamer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm writing some custom code that needs to test what the documentclass is.  Obviously, I could roll my own code to do this, but I'd prefer to use the same functionality as AUCTeX.  Is there a function or variable in AUCTeX that contains this information?  I looked, but did not find anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7146" LastActivityDate="2015-05-20T14:40:57.537" Title="How does AUCTeX determine the documentclass?" Tags="|latex|auctex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12539" PostTypeId="2" ParentId="12524" CreationDate="2015-05-20T03:02:24.050" Score="2" Body="&lt;p&gt;This is a hacky answer but it works (add the code to your &lt;code&gt;.emacs&lt;/code&gt; file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; First, define a variable to hold the directory name. It will always&#xA;;; be updated whenever there's a new Org version.&#xA;;; The important part is this function:&#xA;;; (file-name-completion &quot;org-20&quot; &quot;~/Dropbox/emacs/prelude/elpa/&quot;)&#xA;;; returns:&#xA;;; &quot;org-20150511/&quot;&#xA;;; or in the future:&#xA;;; &quot;org-20250314/&quot;&#xA;;; etc.&#xA;&#xA;(setq my-org-from-elpa-dir (expand-file-name (file-name-completion &quot;org-20&quot; &quot;~/Dropbox/emacs/prelude/elpa/&quot;) &quot;~/Dropbox/emacs/prelude/elpa/&quot;)&#xA;&#xA;;; Finally, add the directories to load-path.&#xA;;; (concat my-org-from-elpa-dir &quot;lisp/&quot;)&#xA;;; returns:&#xA;;; &quot;/home/YOU/Dropbox/emacs/prelude/elpa/org-20150511/lisp/&quot;&#xA;;; and so on.&#xA;&#xA;(add-to-list 'load-path (concat my-org-from-elpa-dir &quot;lisp/&quot;))&#xA;(add-to-list 'load-path (concat my-org-from-elpa-dir &quot;contrib/&quot;))&#xA;(add-to-list 'load-path (concat my-org-from-elpa-dir &quot;contrib/lisp/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Caveats:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code will be evaluated only at startup so you'll have to restart Emacs after you've upgraded your packages. Or else run &lt;code&gt;eval-buffer&lt;/code&gt;. Or define a command based on this answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the year 3000 you'll have to change &quot;org-20&quot; for &quot;org-30&quot;.&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="920" LastEditDate="2015-05-20T14:05:20.913" LastActivityDate="2015-05-20T14:05:20.913" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12540" PostTypeId="1" AcceptedAnswerId="12588" CreationDate="2015-05-20T03:26:21.857" Score="6" ViewCount="665" Body="&lt;p&gt;If I have a buffer with the contents&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo()&#xA;  (interactive)&#xA;  (bar)&#xA;  (message &quot;foo&quot;))&#xA;&#xA;(defun bar()&#xA;  (interactive)&#xA;  (message &quot;bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and call &lt;code&gt;eval-buffer&lt;/code&gt; with &lt;code&gt;edebug-all-defs&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;, then both calls to &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt; directly throw me into &lt;code&gt;edebug-mode&lt;/code&gt; (despite not having set any breakpoints).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if I set &lt;code&gt;edebug-all-defs&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, evaluate the buffer with &lt;code&gt;eval-buffer&lt;/code&gt; and then manually instrument the &lt;code&gt;foo&lt;/code&gt; definition with &lt;code&gt;edebug-eval-defun&lt;/code&gt; (&lt;code&gt;C-u C-M-x&lt;/code&gt;) things work a little better: calling &lt;code&gt;foo&lt;/code&gt; invokes the debugger, and calling &lt;code&gt;bar&lt;/code&gt; does not. However, when stepping through &lt;code&gt;foo&lt;/code&gt;, I'm now unable to step &lt;em&gt;into&lt;/em&gt; the &lt;code&gt;bar&lt;/code&gt; function (presumably because it hasn't been instrumented, the error is &lt;code&gt;Don't know where `bar' is defined&lt;/code&gt;. Stepping &lt;em&gt;over&lt;/em&gt; the call to &lt;code&gt;bar&lt;/code&gt; works just fine and gives the correct result).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to instrument all functions in a buffer &lt;em&gt;without&lt;/em&gt; making them breakpoints at the same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.4.1 on Debian Jessie. Running with &lt;code&gt;-Q&lt;/code&gt; does not seem to make a difference.&lt;/p&gt;&#xA;" OwnerUserId="8357" LastEditorUserId="8357" LastEditDate="2015-05-21T15:21:35.727" LastActivityDate="2015-05-21T16:11:25.263" Title="Edebug: instrument function without setting breakpoint?" Tags="|elisp|edebug|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12541" PostTypeId="2" ParentId="3154" CreationDate="2015-05-20T04:56:24.427" Score="0" Body="&lt;p&gt;You can use command &lt;strong&gt;&lt;code&gt;apropos-char&lt;/code&gt;&lt;/strong&gt; in library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/apu.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;apu.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to show all of the Unicode chars whose names match a regexp or list of words you type.  By default, words are matched as substrings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the list of matches, you can hit &lt;strong&gt;&lt;code&gt;^&lt;/code&gt;&lt;/strong&gt; to &lt;em&gt;insert the char&lt;/em&gt; shown on the current line into the buffer where you invoked &lt;code&gt;apropos-char&lt;/code&gt;, at point.  Or you can hit &lt;code&gt;C-y&lt;/code&gt; to copy that char to the kill ring (or &lt;code&gt;M-y&lt;/code&gt; to copy it to the &lt;a href=&quot;http://www.emacswiki.org/emacs/SecondarySelection&quot; rel=&quot;nofollow&quot;&gt;secondary selection&lt;/a&gt;). (Hit &lt;code&gt;RET&lt;/code&gt; to see more info about the char.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-10T04:05:48.473" LastActivityDate="2015-06-10T04:05:48.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12543" PostTypeId="2" ParentId="12538" CreationDate="2015-05-20T05:34:44.503" Score="2" Body="&lt;p&gt;You can check &lt;code&gt;TeX-style-hook-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (member '(&quot;beamer&quot;) TeX-style-hook-list)&#xA;    (message &quot;beamer is used&quot;)&#xA;  (message &quot;beamer is not used&quot;) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution is based on expecting aux file auctex creates for each tex file you visit. When I wrote this solution emacs parsed that file and it worked. Now when I open the same tex file emacs doesn't seem to read this file anymore. So one has to force emacs to read it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load (concat (file-name-directory buffer-file-name)&#xA;              TeX-auto-local&#xA;              &quot;/&quot;&#xA;              (file-name-sans-extension (file-name-nondirectory  buffer-file-name))&#xA;              &quot;.el&quot;) )&#xA;(if (member '(&quot;beamer&quot;) TeX-style-hook-list)&#xA;    (message &quot;beamer is used&quot;)&#xA;  (message &quot;beamer is not used&quot;) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then it works.&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-05-20T08:43:51.547" LastActivityDate="2015-05-20T08:43:51.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12544" PostTypeId="2" ParentId="12538" CreationDate="2015-05-20T06:31:22.187" Score="6" Body="&lt;p&gt;AUCTeX doesn't really know the class used in a document, all the packages and class loaded are listed in the variable &lt;code&gt;TeX-active-styles&lt;/code&gt;.  The only problem with it is that it mixes packages and classes, but this isn't usually a big deal since packages tend not to have the same name of a class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can search for the wanted package/class with &lt;code&gt;member&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(if (member &quot;beamer&quot; TeX-active-styles)&#xA;    ;; true...&#xA;  ;; false...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In addition, starting from AUCTeX 11.88 there is also the possibility to check for the options passed to a specific package or class (and here packages and classes are separated) with functions &lt;code&gt;LaTeX-provided-class-options-member&lt;/code&gt; and &lt;code&gt;LaTeX-provided-package-options-member&lt;/code&gt;, but if there are no options passed to a package/class these functions are useless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before version 11.88, all the options were listed in &lt;code&gt;TeX-active-styles&lt;/code&gt; too, making it impossible to distinguish between options and packages/classes.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Actually, the different behavior you describe for &lt;code&gt;\item&lt;/code&gt; is obtained by adding the &lt;code&gt;(&quot;itemize&quot; . LaTeX-item-beamer)&lt;/code&gt; entry to &lt;code&gt;LaTeX-item-list&lt;/code&gt; in &lt;code&gt;style/beamer.el&lt;/code&gt;, so &lt;code&gt;TeX-active-styles&lt;/code&gt; is not used at all.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-05-20T14:40:57.537" LastActivityDate="2015-05-20T14:40:57.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12545" PostTypeId="2" ParentId="12540" CreationDate="2015-05-20T08:59:50.933" Score="3" Body="&lt;p&gt;You can step into &lt;code&gt;bar&lt;/code&gt; (or any function call) with no previous preparation.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;eval-buffer&lt;/code&gt; (not necessary if everything's already defined).&lt;/li&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;C-u C-M-x&lt;/code&gt; on &lt;code&gt;foo&lt;/code&gt; to instrument it.&lt;/li&gt;&#xA;&lt;li&gt;Ivoke &lt;code&gt;M-x foo&lt;/code&gt; and you'll be taken immediately into edebug, with point right before the &lt;code&gt;(bar)&lt;/code&gt; expression.&lt;/li&gt;&#xA;&lt;li&gt;In edebug, with point right before a function call, you can hit &lt;code&gt;i&lt;/code&gt; to instrument and step into that function, even if it was not prevously instrumented.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;i&lt;/code&gt; key is described &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Jumping.html#Jumping&quot; rel=&quot;nofollow&quot;&gt;in this manual page&lt;/a&gt;. More keys are described &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Edebug-Execution-Modes.html#Edebug-Execution-Modes&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Edebug-Misc.html#Edebug-Misc&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;br&gt;&#xA;I also have a &lt;a href=&quot;http://endlessparentheses.com/debugging-elisp-part-2-advanced-topics.html&quot; rel=&quot;nofollow&quot;&gt;couple of&lt;/a&gt; &lt;a href=&quot;http://endlessparentheses.com/debugging-emacs-lisp-part-1-earn-your-independence.html&quot; rel=&quot;nofollow&quot;&gt;blog posts&lt;/a&gt; describing the keys I find most useful.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-05-20T08:59:50.933" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12546" PostTypeId="1" AcceptedAnswerId="12718" CreationDate="2015-05-20T09:32:32.723" Score="11" ViewCount="4597" Body="&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt;, I am trying to define a function, a variable, and then assigning to another variable the result of the function call on the first variable. However, then it seems that I cannot use this new variable in subsequent functions calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inlining the function calls does work, but affecting the value to a variable first would allow for faster debug in case something goes wrong in the first function call, and to avoid duplicating potentially expensive computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MWE: (use &lt;code&gt;(require 'ob-emacs-lisp)&lt;/code&gt; if needed)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: square&#xA;#+begin_src emacs-lisp :var x=3&#xA;  (message (format &quot;%s&quot; (* x x)))&#xA;#+end_src&#xA;&#xA;#+RESULTS: square&#xA;: 9&#xA;&#xA;#+name: value&#xA;: 45&#xA;&#xA;#+name: squaredvalue&#xA;#+call: square(x=value)&#xA;&#xA;#+RESULTS: squaredvalue&#xA;: 2025&#xA;&#xA;Now I try to reuse this value: &#xA;&#xA;#+begin_src emacs-lisp :var res=squaredvalue&#xA;  (message res)&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: nil&#xA;&#xA;Inlined calls do work:    &#xA;&#xA;#+begin_src emacs-lisp :var res=square(value)&#xA;  (message res)&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: 2025&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Expanding the second code block shows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((res (quote &quot;nil&quot;)))&#xA;  (message res))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This has been tested on emacs 24.3.1, 24.4 and 24.5, using org 8.2.10)&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-05-25T21:40:30.377" LastActivityDate="2015-05-26T18:01:21.907" Title="With org-babel, how to name the results of a function call and reuse them" Tags="|org-mode|org-babel|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12547" PostTypeId="2" ParentId="12534" CreationDate="2015-05-20T10:55:00.640" Score="1" Body="&lt;p&gt;Your Norwegian dictionary is for a different spell-checking application. Hunspell (available from &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;nofollow&quot;&gt;ezwinports&lt;/a&gt;) should be able to handle those types of file.&lt;/p&gt;&#xA;" OwnerUserId="7069" LastActivityDate="2015-05-20T10:55:00.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12548" PostTypeId="2" ParentId="12540" CreationDate="2015-05-20T10:55:31.530" Score="2" Body="&lt;p&gt;I prefer to debug stuff with &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt; instead of Edebug, possibly using Edebug for setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, the biggest advantage is that I can keep the debug state around, without worrying that if I mistype something in Edebug, all the debug context that I've worked on for 10 minutes will vanish and I would have to start from scratch. It's also great for setting test cases, sinks / mocks etc.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Stepping in and stepping through&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You don't need to instrument anything, just press &lt;kbd&gt;xj&lt;/kbd&gt; or &lt;kbd&gt;C-x C-j&lt;/kbd&gt; to step in.  All the debug state will be kept as global variables. Then just use &lt;kbd&gt;e&lt;/kbd&gt; or &lt;kbd&gt;C-x C-e&lt;/kbd&gt; to&#xA;step.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Using Edebug for setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you're debugging a first function call, but actually are interested in how it affects a second function several layers down, just edebug the second function with &lt;kbd&gt;xe&lt;/kbd&gt;, eval the first function call with &lt;kbd&gt;e&lt;/kbd&gt;, and you'll end up in Edebug.  Press &lt;kbd&gt;Z&lt;/kbd&gt; to exit in Edebug, while storing the arguments of the current function in global vars. Now, you can continue as before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you expect the arguments to be modified in the debug process and don't wish to repeat the setup above, just generate a set of &lt;code&gt;setq&lt;/code&gt; statements in &lt;code&gt;*scratch*&lt;/code&gt;, so that you can reset them easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;|(setq foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;code&gt;foo&lt;/code&gt; e.g. having the value &lt;code&gt;42&lt;/code&gt;, by typing &lt;kbd&gt;2mE&lt;/kbd&gt; you get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq foo&#xA;      42|)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;2m&lt;/kbd&gt;: mark second element of sexp&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;E&lt;/kbd&gt;: eval current selection (list or region) and insert the result&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The standard equivalent for &lt;kbd&gt;2mE&lt;/kbd&gt; would be: &lt;kbd&gt;M-f M-f SPC C-u C-x C-e&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-20T10:55:31.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12549" PostTypeId="1" AcceptedAnswerId="12550" CreationDate="2015-05-20T13:17:24.177" Score="1" ViewCount="404" Body="&lt;p&gt;When I open my emacs 24.4, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (emacs): Unable to activate package `emacs-eclim'.&#xA;Required package `s-1.9.0' is unavailable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but If I open version 24.1 there is no such error. eclim works pretty fine in both version, why it is happening ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I had a warning in version 24.4 which is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): Your `load-path' seems to contain&#xA;your `.emacs.d' directory: ~/.emacs.d/&#xA;This is likely to cause problems...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I disabled it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this warning is connected with eclim warning somehow, better know it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why am I getting these warnings in version 24.4 ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance...&lt;/p&gt;&#xA;" OwnerUserId="2305" LastEditorUserId="50" LastEditDate="2015-05-20T17:50:53.200" LastActivityDate="2015-05-20T17:50:53.200" Title="Unable to activate package `emacs-eclim'" Tags="|package|emacs24.4|warning|" AnswerCount="1" CommentCount="0" ClosedDate="2015-05-20T17:53:09.147" ContentLicense="CC BY-SA 3.0" />
  <row Id="12550" PostTypeId="2" ParentId="12549" CreationDate="2015-05-20T13:52:33.223" Score="4" Body="&lt;p&gt;Might be that the package &quot;s&quot; was removed from emacs default packages or that you had it somehow installed on the previous version.&#xA;The package is available on the melpa repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this in your init.el (.emacs)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use M-x list-packages. &#xA;Find the package named &quot;s&quot;, type i (mark for installation), then x (execute). &#xA;This will install the proper package and you should'n have the &quot;is unavailable&quot; message anymore.&lt;/p&gt;&#xA;" OwnerUserId="8360" LastEditorUserId="675" LastEditDate="2015-05-20T15:41:18.953" LastActivityDate="2015-05-20T15:41:18.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12551" PostTypeId="2" ParentId="12210" CreationDate="2015-05-20T13:55:54.957" Score="8" Body="&lt;p&gt;To wrap the entries in Helm buffer instead of truncating them, add function to &lt;code&gt;helm-after-initialize-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'helm-after-initialize-hook (lambda ()&#xA;                                        (with-helm-buffer&#xA;                                          (visual-line-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use &lt;code&gt;helm-buffers-list&lt;/code&gt; and add this setting: &lt;code&gt;(setq ido-use-virtual-buffers t)&lt;/code&gt; to enable visited files to be displayed in &lt;code&gt;helm-buffers-list&lt;/code&gt;. Choose one depends one whether you want to see the full paths or not.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="160" LastEditDate="2015-05-22T22:18:07.867" LastActivityDate="2015-05-22T22:18:07.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12552" PostTypeId="1" AcceptedAnswerId="13901" CreationDate="2015-05-20T14:11:37.793" Score="4" ViewCount="1303" Body="&#xA;&#xA;&lt;p&gt;Let's say I have a &lt;code&gt;yasnippet&lt;/code&gt; snippet called &lt;code&gt;foobar&lt;/code&gt; and I have configured it to work it with &lt;code&gt;company-mode&lt;/code&gt; (which is not relevant here). Now each time I needed to type &lt;code&gt;foobar&lt;/code&gt; I would select it from completion popup to expand &lt;code&gt;yasnippet&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I would like to bind this &lt;code&gt;yasnippet&lt;/code&gt; insertion action to a key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the &lt;code&gt;yas/insert-snippet&lt;/code&gt; function. But then I need to select the corresponding snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a configuration like below to insert the &lt;code&gt;foobar&lt;/code&gt; snippet.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;C-b&quot; yas/insert-snippet &quot;foobar&quot;) ;; PSEUDO CODE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? It would be really appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="115" LastEditDate="2015-07-11T18:38:16.190" LastActivityDate="2015-08-03T19:41:08.003" Title="How bind keys to a specific snippet in yasnippet folder?" Tags="|elisp|key-bindings|yasnippet|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12553" PostTypeId="1" AcceptedAnswerId="12555" CreationDate="2015-05-20T14:29:01.223" Score="6" ViewCount="941" Body="&lt;p&gt;I looked around to be sure, that none had this issue earlier. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay, sometimes I'm having too many buffers to manage. So I would like to kill all these buffers, except the buffers that are currently opened in my windows and elscreen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect there should be an existing function for that, &lt;a href=&quot;https://stackoverflow.com/questions/8450919/how-can-i-delete-all-hidden-buffers&quot;&gt;like in Vim&lt;/a&gt; but I couldn't found it inside Emacs and wiki pages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-05-20T19:11:34.253" Title="How kill all hidden (non-visible) buffers?" Tags="|buffers|window|functions|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12555" PostTypeId="2" ParentId="12553" CreationDate="2015-05-20T15:20:45.863" Score="4" Body="&lt;p&gt;I don't really think you want (ought) to do it, but this does it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  &quot;Kill all buffers not currently shown in a window somewhere.&quot;&#xA;  (interactive)&#xA;  (dolist (buf  (buffer-list))&#xA;    (unless (get-buffer-window buf 'visible) (kill-buffer buf))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Function &lt;code&gt;buffer-list&lt;/code&gt; gives you all buffers. Function &lt;code&gt;get-buffer-window&lt;/code&gt; checks whether a given buffer is shown in a window. Argument &lt;code&gt;visible&lt;/code&gt; to &lt;code&gt;get-buffer-window&lt;/code&gt; means check all windows on visible frames (ignore invisible and iconified frames).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-20T15:20:45.863" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12556" PostTypeId="1" AcceptedAnswerId="55155" CreationDate="2015-05-20T18:14:38.023" Score="15" ViewCount="1209" Body="&lt;p&gt;I want my documents to be auto-saved, but I don't want to be interrupted with the message &quot;Auto-saving...done&quot; every few minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to just disable this message, but not the auto-saving functionality?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried the following without success:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/22511847/how-to-disable-auto-save-message&quot;&gt;https://stackoverflow.com/questions/22511847/how-to-disable-auto-save-message&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2020-01-28T00:39:28.947" Title="Disabling the &quot;Auto-saving...done&quot; message" Tags="|auto-save|message|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12557" PostTypeId="2" ParentId="12524" CreationDate="2015-05-20T18:52:06.807" Score="3" Body="&lt;p&gt;This solution is specific to how to add the &lt;strong&gt;org contrib&lt;/strong&gt; packages to the load path.&lt;/p&gt;&#xA;&lt;p&gt;You can add &lt;code&gt;orgmode.org/elpa/&lt;/code&gt; to &lt;code&gt;package-archives&lt;/code&gt; as per the instructions &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and install &lt;code&gt;org-plus-contrib&lt;/code&gt; using the package manager. That will install the regular org files plus the contrib content in a flat folder hierarchy.&lt;/p&gt;&#xA;&lt;p&gt;The installation instructions from the reference link are repeated here for convenience:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Add this to your Emacs init file to be able to list the Org mode archives:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(require 'package)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(add-to-list 'package-archives '(&amp;quot;org&amp;quot; . &amp;quot;http://orgmode.org/elpa/&amp;quot;) t)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then &lt;code&gt;M-x list-packages RET&lt;/code&gt; will list both the latest &lt;code&gt;org&lt;/code&gt; and &lt;code&gt;org-plus-contrib&lt;/code&gt; packages.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;code&gt;org&lt;/code&gt; contains the same set of files that are included in GNU Emacs.&lt;/em&gt;&#xA;&lt;em&gt;&lt;code&gt;org-plus-contrib&lt;/code&gt; contains these files plus all contribs files, the ones you find in &lt;code&gt;contrib/&lt;/code&gt; from the git repo.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-20T18:52:06.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12558" PostTypeId="1" CreationDate="2015-05-20T19:22:16.627" Score="1" ViewCount="175" Body="&lt;p&gt;I started using CEDET with Emacs and although it works fine sometimes it is too slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if I write &lt;code&gt;std::&lt;/code&gt; and wait for suggestions then in the minibuffer says &lt;code&gt;parsing file.cpp (LL) done&lt;/code&gt;&#xA;and for 1-2 seconds it freezes and I can't write. Then if I repeat it although it doesn't say anything in the minibuffer it still freezes the same. Eventually it shows the list of possible items but after that &quot;freeze time&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is that happening? How can I fix it? I don't thing that this is the default behaviour as it is very annoying.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2015-05-26T20:08:40.933" LastActivityDate="2015-05-26T20:08:40.933" Title="Slow behaviour of CEDET" Tags="|cedet|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12559" PostTypeId="1" AcceptedAnswerId="12561" CreationDate="2015-05-20T21:46:13.123" Score="2" ViewCount="603" Body="&lt;p&gt;I'm currently using &lt;a href=&quot;http://www.reddit.com/r/emacs/comments/349779/pro_tip_get_automatic_headers_when_create_new/&quot; rel=&quot;nofollow&quot;&gt;autoheader&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this configuration, which causes the &lt;code&gt;&amp;lt;?php&lt;/code&gt; tag to be inserted in other modes: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defsubst my/header-title ()&#xA;  &quot;Insert buffer's first row.&quot;&#xA;&#xA;  (insert &quot;&amp;lt;?php \n \n&quot; (concat comment-start  &quot; Foo bar &quot;  (and (= 1 (length comment-start)) header-prefix-string )&#xA;                                (if (buffer-file-name)&#xA;                                    (file-name-nondirectory (buffer-file-name))&#xA;                                  (buffer-name))&#xA;                                &quot; &quot; &quot;\n&quot;))&#xA;  )  &#xA;&#xA;(setq make-header-hook '( my/header-title))  &#xA;&#xA;;; To have Emacs add a file header whenever you create a new file in some mode: &#xA;(autoload 'auto-make-header &quot;header2&quot;)&#xA;(add-hook 'php-mode-hook 'auto-make-header) &#xA;(add-hook 'emacs-lisp-mode-hook 'auto-make-header)&#xA;(add-hook 'web-mode-hook 'auto-make-header)&#xA;(add-hook 'html-mode-hook 'auto-make-header)&#xA;(add-hook 'js-mode-hook 'auto-make-header) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I'm creating a new file with the extension &lt;code&gt;.html&lt;/code&gt; or &lt;code&gt;.lisp&lt;/code&gt;, then the &lt;code&gt;&amp;lt;?php&lt;/code&gt; opening tag will be inserted too. I want the &lt;code&gt;&amp;lt;?php&lt;/code&gt; opening tag inserted in the header only when the newly created buffer is in PHP-mode.  When PHP-mode is not enabled, it should not insert the PHP tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to solve this with the following modifications:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defsubst my/header-title ()&#xA;   (insert &#xA;   ;; comparison major mode with the PHP-mode&#xA;    (if equal major-mode &quot;PHP-mode&quot; &#xA;    ;; If true, insert this:&#xA;      (&quot;&amp;lt;?php \n \n&quot;) &#xA;    ;; If false, insert empty string&#xA;  &quot; \n&quot;)&#xA;   (concat[...] rest of the function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work. The comparison seems logical, following the Emacs manual. So I couldn't figure it out. So I'm wondering how I could detect if there is PHP-mode enabled, then insert the &lt;code&gt;&amp;lt;?php&lt;/code&gt; tag, or otherwise do nothing? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any answer would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="2710" LastEditDate="2015-05-21T08:41:06.513" LastActivityDate="2015-05-21T08:41:06.513" Title="How to detect mode, then execute?" Tags="|major-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12560" PostTypeId="2" ParentId="12559" CreationDate="2015-05-20T22:06:48.160" Score="0" Body="&lt;p&gt;Since &lt;code&gt;auto-make-header&lt;/code&gt; contains php related header, this hook must be added only to php as, &lt;code&gt;(add-hook 'php-mode-hook 'auto-make-header)&lt;/code&gt;. You can remove all the other &lt;code&gt;add-hook&lt;/code&gt; statements.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-05-20T22:06:48.160" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12561" PostTypeId="2" ParentId="12559" CreationDate="2015-05-20T22:29:13.867" Score="3" Body="&lt;p&gt;Replace this part&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;equal major-mode &quot;PHP-mode&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this expression&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(equal major-mode 'php-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-05-20T22:29:13.867" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12562" PostTypeId="1" CreationDate="2015-05-20T22:31:18.557" Score="17" ViewCount="1887" Body="&lt;p&gt;I'd like to organize my headings in multiple ways at once. (with the same degree of flexibility that I have when organizing things in any one place - e.g. more than the Agenda provides)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I'd be able to make a heading in part of a document, and then create a &quot;hard link&quot; to the heading somewhere else, which would update both as the content of heading changed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next best would be &quot;soft links&quot; which only store the heading content in one canonical location, and just show it in the other location (and if you edit it in either, it just updates in the canonical location). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now the best I know how to do is just create normal links, which I need to manually follow to see the content. Is there any way to do better than this?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastEditorUserId="8234" LastEditDate="2015-06-03T18:58:03.617" LastActivityDate="2018-11-13T00:02:40.463" Title="Org-mode headings in multiple places at once? (transclusion)" Tags="|org-mode|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="12563" PostTypeId="2" ParentId="4063" CreationDate="2015-05-20T22:35:00.933" Score="4" Body="&lt;p&gt;The following is a condensed example of how to extract the data that goes into an &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer when normally using the function &lt;code&gt;org-agenda-list&lt;/code&gt;, with &lt;code&gt;org-agenda-entry-types&lt;/code&gt; such as &lt;code&gt;:deadline&lt;/code&gt;, &lt;code&gt;:scheduled&lt;/code&gt;, &lt;code&gt;:timestamp&lt;/code&gt;, &lt;code&gt;sexp&lt;/code&gt;, &lt;code&gt;:deadline*&lt;/code&gt;, and &lt;code&gt;:scheduled*&lt;/code&gt;.  The range of dates -- &lt;code&gt;begin&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; -- should be in a Gregorian list format -- e.g., &lt;code&gt;'(6 1 2015)&lt;/code&gt;.  The customizable let-bound options are &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; and &lt;code&gt;org-agenda-entry-types&lt;/code&gt;.  The function returns a result in the format of a list.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'calendar)&#xA;(require 'org)&#xA;(require 'org-agenda)&#xA;(require 'cl)&#xA;&#xA;;; Portions of following code were extracted from:&#xA;;;   https://github.com/kiwanami/emacs-calfw written by Masashi Sakurai&#xA;;; Said code has been modified by @lawlist hereinbelow.&#xA;;;&#xA;(defun org-get-entries-fn (begin end)&#xA;&quot;Return org schedule items between BEGIN and END.&#xA;USAGE:  (org-get-entries-fn '(6 1 2015) '(12 31 2020))&quot;&#xA;  (unless&#xA;      (and&#xA;        (calendar-date-is-valid-p begin)&#xA;        (calendar-date-is-valid-p end))&#xA;    (let ((debug-on-quit nil))&#xA;      (signal 'quit '(&quot;One or both of your Gregorian dates are invalid.&quot;))))&#xA;  (let* (&#xA;      result&#xA;      (org-agenda-buffer nil) ;; prevent error from `org-compile-prefix-format'&#xA;      ;; The variable `org-agenda-only-exact-dates' is apparently not operational.&#xA;      (org-scheduled-past-days 0) ;; avoid duplicate entries for overdue items&#xA;      (org-agenda-prefix-format &quot;• &quot;)&#xA;      (org-agenda-entry-types '(:scheduled))&#xA;      (date-after&#xA;        (lambda (date num)&#xA;          &quot;Return the date after NUM days from DATE.&quot;&#xA;          (calendar-gregorian-from-absolute&#xA;           (+ (calendar-absolute-from-gregorian date) num))))&#xA;      (enumerate-days&#xA;        (lambda (begin end)&#xA;          &quot;Enumerate date objects between BEGIN and END.&quot;&#xA;          (when (&amp;gt; (calendar-absolute-from-gregorian begin)&#xA;                   (calendar-absolute-from-gregorian end))&#xA;            (error &quot;Invalid period : %S - %S&quot; begin end))&#xA;          (let ((d begin) ret (cont t))&#xA;            (while cont&#xA;              (push (copy-sequence d) ret)&#xA;              (setq cont (not (equal d end)))&#xA;              (setq d (funcall date-after d 1)))&#xA;            (nreverse ret)))) )&#xA;    (org-compile-prefix-format nil)&#xA;    (setq result&#xA;      (loop for date in (funcall enumerate-days begin end) append&#xA;        (loop for file in (org-agenda-files nil 'ifmode) append&#xA;          (progn&#xA;            (org-check-agenda-file file)&#xA;            (apply 'org-agenda-get-day-entries file date org-agenda-entry-types)))))&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-05T02:11:31.067" LastActivityDate="2017-01-05T02:11:31.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12565" PostTypeId="1" AcceptedAnswerId="12622" CreationDate="2015-05-20T23:35:48.627" Score="1" ViewCount="1677" Body="&lt;h3&gt;What works&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I have installed &lt;code&gt;emacs-eclim&lt;/code&gt; and have it working in my Java buffers. For example, I can invoke &lt;code&gt;eclim-java-refactor-rename-symbol-at-point&lt;/code&gt; or &lt;code&gt;eclim-java-show-documentation-for-current-element&lt;/code&gt; and they behave as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can run &lt;code&gt;eclim-complete&lt;/code&gt;, and I receive a list of correct completions in another buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I evaluate something like &lt;code&gt;company-emacs-eclim--candidates &quot;Object.&quot;)&lt;/code&gt; in a java buffer, and I get a list of completion candidates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without any &lt;code&gt;eclim&lt;/code&gt; backends, &lt;code&gt;company&lt;/code&gt; also works as expected.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;What doesn't work&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Hoping to get &lt;code&gt;eclim&lt;/code&gt; completion candidates in my Java buffers, I added the following lines to my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'company-emacs-eclim)&#xA;(company-emacs-eclim-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I do not get eclim completions as expected. If I invoke &lt;code&gt;company-emacs-eclim&lt;/code&gt; explicitly, I get the error &lt;code&gt;&quot;Cannot complete at point&quot;&lt;/code&gt;, with the following backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Cannot complete at point&quot;)&#xA;  signal(error (&quot;Cannot complete at point&quot;))&#xA;  error(&quot;Cannot complete at point&quot;)&#xA;  company-begin-backend(company-emacs-eclim)&#xA;  company-emacs-eclim(interactive)&#xA;  ad-Orig-call-interactively(company-emacs-eclim record nil)&#xA;  call-interactively(company-emacs-eclim record nil)&#xA;  command-execute(company-emacs-eclim record)&#xA;  execute-extended-command(nil &quot;company-emacs-eclim&quot;)&#xA;  smex-read-and-run((&quot;toggle-debug-on-error&quot; &quot;company-emacs-eclim&quot; ...))&#xA;  smex()&#xA;  ad-Orig-call-interactively(smex nil nil)&#xA;  call-interactively(smex nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Version information&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)&#xA; of 2014-03-07 on lamiak, modified by Debian&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacs-eclim 20150502.516&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2015-05-21T14:44:19.483" LastActivityDate="2015-05-22T17:32:26.640" Title="Company eclim: cannot complete at point" Tags="|company-mode|java|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12567" PostTypeId="1" CreationDate="2015-05-21T01:06:20.473" Score="2" ViewCount="520" Body="&lt;p&gt;On python, you can repeat a value several times inside a string when formatting it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; print &quot;Hello, {name}, how are you, {name}?&quot;.format(name=&quot;George&quot;)&#xA;    &quot;Hello, George, how are you, George?&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I don't know how to achieve this with elisp. I'm trying to make a function that returns the GPLv3 copyright text (&lt;em&gt;This file is part of Foobar. Foobar is free software:&lt;/em&gt;) with the name of any projectile project on it.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-05-21T09:29:49.943" Title="Format with the same value many times in a string" Tags="|elisp|formatting|" AnswerCount="1" CommentCount="0" ClosedDate="2015-05-21T11:30:08.337" ContentLicense="CC BY-SA 3.0" />
  <row Id="12568" PostTypeId="1" AcceptedAnswerId="12569" CreationDate="2015-05-21T01:21:23.270" Score="1" ViewCount="402" Body="&lt;p&gt;I understand how Emacs can remove tabs when using the &lt;code&gt;untabify&lt;/code&gt; command (simply place a number of spaces in the place of the tabs) but what I can't understand is how does it place tabs in the place of spaces? When you use &lt;code&gt;tabify&lt;/code&gt; how does Emacs knows where to place tabs? At first I thought that if there were 4 spaces (or a particular number) then it would change them with one tab but clearly that is not the case (as I saw using &lt;code&gt;whitespace-mode&lt;/code&gt;). Clearly it is logical that this doesn't happen but if that is not the case then how does Emacs decides where should tabs be?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2015-05-21T05:45:58.323" Title="Tabify: How does Emacs decides where to place tabs?" Tags="|tabs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12569" PostTypeId="2" ParentId="12568" CreationDate="2015-05-21T05:45:58.323" Score="2" Body="&lt;p&gt;From the description of &lt;code&gt;tabify&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A group of spaces is partially replaced by tabs&#xA;  when this can be done without changing the column they end at.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it seems like it's behaviour depends on &lt;code&gt;tab-width&lt;/code&gt; variable.&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-05-21T05:45:58.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12570" PostTypeId="1" AcceptedAnswerId="12571" CreationDate="2015-05-21T06:21:37.587" Score="1" ViewCount="169" Body="&lt;p&gt;I just want to indicate that a task took 2 hours - I don't care when it started or ended, and I'd prefer not to put in false info for that!&#xA;Is there a way to do this? &lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2015-05-21T07:35:41.490" Title="Can I clock a duration without a start/end time in org mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12571" PostTypeId="2" ParentId="12570" CreationDate="2015-05-21T07:35:41.490" Score="3" Body="&lt;p&gt;There is no such way as of now. Though, if you want to make it easy, and still want to know this is a fake time, I'd clock each time from 0:00 to 2:00 (for example).&lt;/p&gt;&#xA;" OwnerUserId="5156" LastActivityDate="2015-05-21T07:35:41.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12572" PostTypeId="2" ParentId="12567" CreationDate="2015-05-21T08:30:48.640" Score="0" Body="&lt;p&gt;Still another solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((name &quot;George&quot;))&#xA;  (format &quot;%s&quot; (concat &quot;Hello, &quot; name &quot;, how are you, &quot; name &quot;?&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-05-21T09:29:49.943" LastActivityDate="2015-05-21T09:29:49.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12573" PostTypeId="2" ParentId="12535" CreationDate="2015-05-21T08:45:39.753" Score="5" Body="&lt;p&gt;You need to select a window that shows the buffer, too. Here's an example :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun execute-macro-in-the-current-buffer ()&#xA;  (interactive)&#xA;  (let ((win (selected-window)))&#xA;    (unwind-protect&#xA;        (with-current-buffer (get-buffer-create &quot;*test-buffer*&quot;)&#xA;          (set-window-buffer win (current-buffer) t)&#xA;          (erase-buffer)&#xA;          (insert &quot;Lorem Ipsum is simply dummy text of the printing and typesetting industry.&quot;)&#xA;          (goto-char 0)&#xA;          (execute-kbd-macro (edmacro-parse-keys &quot;M-&amp;gt;&quot;)))&#xA;      (set-window-buffer win (current-buffer) t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that, for this to work, the test buffer should not be shown in any window. This is is because each window has its own value of (point). If you wanted to avoid this, you could first check whether the test buffer is shown in any window. But then you have to think about what you want to happen if there are more than one windows (i.e. in which one should the macro run ?).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-05-21T09:06:11.187" LastActivityDate="2015-05-21T09:06:11.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12574" PostTypeId="1" CreationDate="2015-05-21T09:39:13.040" Score="1" ViewCount="59" Body="&lt;p&gt;I have an org-mode document that looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Total Score&#xA;&#xA;** First Part [2/3] * 4&#xA;- [X] Item 1&#xA;- [X] Item 2&#xA;- [ ] Item 3&#xA;&#xA;** Second Part [2/3] * 3&#xA;- [X] Item 1&#xA;- [ ] Item 2&#xA;- [X] Item 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can multiply the number of checked items in each headline by a number and accumulate the result on the parent headline?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Total Score [14/21]&#xA;&#xA;** First Part [2/3] * 4&#xA;- [X] Item 1&#xA;- [X] Item 2&#xA;- [ ] Item 3&#xA;&#xA;** Second Part [2/3] * 3&#xA;- [X] Item 1&#xA;- [ ] Item 2&#xA;- [X] Item 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If that's not possible, is there a way I can use these counts of checked-items as numbers in an org-table?&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-05-21T09:39:13.040" Title="Multiplying org-mode check-boxes" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12575" PostTypeId="1" CreationDate="2015-05-21T09:47:22.820" Score="1" ViewCount="1725" Body="&lt;p&gt;Is there a way to &lt;em&gt;easily&lt;/em&gt; switch to no-distractions writing environment in Emacs for MS-Windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prefer to have Emacs started without window titlebar and without menubar and have that without any complex patching or other intrusive system modifications.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2015-05-21T12:39:06.170" Title="Fullscreen with no titlebar and no menubar in MS-Windows" Tags="|window|frames|microsoft-windows|menu-bar|writing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12576" PostTypeId="1" AcceptedAnswerId="12577" CreationDate="2015-05-21T10:23:43.250" Score="9" ViewCount="1658" Body="&lt;p&gt;In Org-mode, I would like to have a capture template get stored like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 2015&#xA;** 2015-05 May&#xA;*** 2015-05-21 Thursday     &amp;lt;--- I can get this with file+datetree&#xA;**** Todo today             &amp;lt;--- here's the problem&#xA;***** TODO something        &amp;lt;--- this is the captured content&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is that possible out of the box? If not, any ideas how to go about implementing it?&lt;/p&gt;&#xA;" OwnerUserId="8367" LastEditorUserId="504" LastEditDate="2015-05-22T07:20:08.787" LastActivityDate="2015-05-22T07:20:08.787" Title="Is it possible to file a capture template in a subheading of a day in a datetree?" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12577" PostTypeId="2" ParentId="12576" CreationDate="2015-05-21T11:39:28.300" Score="13" Body="&lt;p&gt;You can achieve what you want by defining a custom function that returns the target location for template expansion:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-find-heading-in-datetree ()&#xA;  (org-datetree-find-date-create (calendar-current-date))&#xA;  (goto-char (point-at-eol))&#xA;  (when (not (re-search-forward&#xA;              (format org-complex-heading-regexp-format&#xA;                      (regexp-quote &quot;Todo today&quot;)) nil t))&#xA;    (insert &quot;\n**** Todo today\n&quot;))&#xA;  (goto-char (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then set your template up like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-capture-templates&#xA;      '((&quot;t&quot; &quot;Test&quot; plain (file+function &quot;~/org/test.org&quot;&#xA;                                         org-find-heading-in-datetree)&#xA;         &quot;***** TODO %?&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-05-21T22:18:41.257" LastActivityDate="2015-05-21T22:18:41.257" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12578" PostTypeId="2" ParentId="12575" CreationDate="2015-05-21T11:50:06.973" Score="0" Body="&lt;p&gt;Emacs &lt;a href=&quot;http://www.martyn.se/code/emacs/darkroom-mode/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;darkroom-mode&lt;/code&gt;&lt;/a&gt; appears to allow to do the trick, if the right function is called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how to use it.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the &lt;code&gt;darkroom-mode&lt;/code&gt; as described on its homepage&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add the following code snippet into some of your startup files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(if (eq system-type 'windows-nt)&#xA;    (progn&#xA;      (require 'darkroom-mode)&#xA;      (w32-fullscreen-on)&#xA;      (w32-fullscreen-restore-frame)&#xA;      (w32-fullscreen-maximize-frame)))&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Somehow it doesn't work properly when calling &lt;code&gt;w32-fullscreen-maximize-frame&lt;/code&gt; right away, without calling &lt;code&gt;w32-fullscreen-restore-frame&lt;/code&gt; first.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2015-05-21T11:50:06.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12579" PostTypeId="1" AcceptedAnswerId="12582" CreationDate="2015-05-21T12:35:29.670" Score="0" ViewCount="211" Body="&lt;p&gt;I am running emacs 24.4.1 on Kubuntu 15.04 and when I open a new frame, Emacs' own default font (i.e. its default default font) is used as the font for that new font, rather than the default font that I have set &lt;s&gt;and saved.&lt;/s&gt; So I have to set the default font again every time I open a new frame. How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastEditorUserId="115" LastEditDate="2015-05-21T13:45:15.933" LastActivityDate="2015-05-21T13:45:15.933" Title="Setting the default font from menu bar does not stick" Tags="|fonts|menu-bar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12580" PostTypeId="1" AcceptedAnswerId="12583" CreationDate="2015-05-21T12:36:37.307" Score="1" ViewCount="882" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: how do I get yasnippet to insert the comment sign, when I press return to start new line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, my snippet looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         ;; $1 .&#xA;         ;; / END &#xA;         $2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the cursor is on the $1, and I'm typing some text, I would like to press return.&#xA; It will start a new line, but the &lt;code&gt;;;&lt;/code&gt; is missing on the new line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found nothing on this specific issue. I could also use elisp forms to create a new mapping on the new line, like (concat comment-start), but it's not clear to me how to expand them appropriately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the comment below. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-05-21T18:52:24.717" LastActivityDate="2015-05-21T18:52:24.717" Title="How start a new line in Yasnippet, with the comment?" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12581" PostTypeId="2" ParentId="12575" CreationDate="2015-05-21T12:39:06.170" Score="1" Body="&lt;p&gt;I have used this tool in the past and it works great&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bitbucket.org/manenko/emacs-fullscreen-win32/wiki/Home&quot; rel=&quot;nofollow&quot;&gt;emacs-fullscreen-win32&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a executable and when run it looks for emacs and does some windows magic to make Emacs frames full screen. The readme has all the info you need to get it setup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just download the executable and add something like this to your config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-full-screen ()&#xA;  &quot;Toggles full-screen mode for Emacs window on Win32.&quot;&#xA;  (interactive)&#xA;  (shell-command &quot;/path/to/emacs_fullscreen.exe&quot;))&#xA;&#xA;(defun toggle-bars ()&#xA;  &quot;Toggles bars visibility.&quot;&#xA;  (interactive)&#xA;  (menu-bar-mode)&#xA;  (tool-bar-mode)&#xA;  (scroll-bar-mode))&#xA;&#xA;(defun toggle-full-screen-and-bars ()&#xA;  &quot;Toggles full-screen mode and bars.&quot;&#xA;  (interactive)&#xA;  (toggle-bars)&#xA;  (toggle-full-screen))&#xA;&#xA;(global-set-key [f11] 'toggle-full-screen-and-bars)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-05-21T12:39:06.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12582" PostTypeId="2" ParentId="12579" CreationDate="2015-05-21T13:38:33.290" Score="2" Body="&lt;p&gt;If you are using the &lt;em&gt;Options &gt; Set Default Font...&lt;/em&gt; from the menu bar to set the default font, you also need to hit on &lt;strong&gt;&lt;em&gt;Options &gt; Save Options&lt;/em&gt;&lt;/strong&gt; when you are happy with the settings you changed using the menu bar.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-05-21T13:38:33.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12583" PostTypeId="2" ParentId="12580" CreationDate="2015-05-21T13:46:10.620" Score="2" Body="&lt;p&gt;Before I created a function to solve this, I looked into the Lisp documentation about comment strings and Yasnippet bindings. What about this one: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo-bar ()&#xA;  (interactive)&#xA;  (newline)&#xA;  (insert (concat comment-start) &quot; &quot;)&#xA;  )&#xA;&#xA;(eval-after-load 'yasnippet&#xA;  '(progn&#xA;     (define-key yas-keymap (kbd &quot;&amp;lt;return&amp;gt;&quot;) 'foo-bar)))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7125" LastEditorUserId="115" LastEditDate="2015-05-21T13:48:53.887" LastActivityDate="2015-05-21T13:48:53.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12584" PostTypeId="1" CreationDate="2015-05-21T14:12:02.933" Score="1" ViewCount="219" Body="&lt;p&gt;Is there an easy way to supplement emacs' info manual with additional nodes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or does one have to go through &lt;a href=&quot;http://www.gnu.org/manual/manual.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/manual/manual.html&lt;/a&gt; to download manuals, and then manually insert them into emacs?&#xA;This seems pretty tedious, especially since there are numerous documents that I would like to add. (gdb, C, gcc, djvu package, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the same line, I have installed gdb through homebrew (on OS X Yosemite) but still when I run the command &quot;info gdb&quot; in the terminal it brings me to the man pages. Shouldn't info pages come packaged with GNU installations by default?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I meant by &quot;an easy way&quot; was an interface through emacs or likewise such as that for packages (&lt;em&gt;package-list-packages&lt;/em&gt; function in emacs).&lt;/p&gt;&#xA;" OwnerUserId="8258" LastEditorUserId="8258" LastEditDate="2015-05-21T14:46:06.887" LastActivityDate="2015-05-21T14:46:06.887" Title="How to add additional info manuals to emacs' collection" Tags="|osx|info|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12585" PostTypeId="1" CreationDate="2015-05-21T14:23:55.747" Score="0" ViewCount="386" Body="&lt;p&gt;How can I configure my ~/.emacs so as to get the following effect?  In C++ mode, I want C++ comments (but not C-style comments), to always be unindented, i.e., the double slashes should always be first in a line, not preceded by whitespace.  By default, the Emacs C++ mode will indent C++ comments in the same way as it would any single-line statement.  I.e., I want code to look like:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-cpp prettyprint-override&quot;&gt;&lt;code&gt;int main() {&#xA;        /* x is the number of foos */&#xA;        int x = 1; &#xA;//      int x = 2;&#xA;        if (x == y) {&#xA;                 /* a is the number of bars */&#xA;                 int a = x;&#xA;//               int a = 2 * x;&#xA;        }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that C-style comments should still be indented normally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background:  I have a C++ codebase in which all &quot;normal&quot; comments are in C-style, and C++ comments are only used to comment out code.  This means that I can search for the string &quot;//&quot; within the cleanup to remove all such comments before I commit my code to SVN.  When commenting out code using C++ comments, the default behavior of Emacs makes it harder to see the old (commented-out) and new code side by side.  I.e., Emacs would give this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cpp prettyprint-override&quot;&gt;&lt;code&gt;int main() {&#xA;        /* x is the number of foos */&#xA;        int x = 1; &#xA;        //      int x = 2;&#xA;        if (x == y) { &#xA;                 /* a is the number of bars */&#xA;                 int a = x;&#xA;                 //               int a = 2 * x;&#xA;        }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note also that C++ comments that follow code on a line should not be affected.&lt;/p&gt;&#xA;" OwnerUserId="8370" LastEditorUserId="5243" LastEditDate="2015-05-23T02:11:46.167" LastActivityDate="2015-05-23T02:11:46.167" Title="Non-Indentation of only C++ comments in C++ mode" Tags="|indentation|c++|comment|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12586" PostTypeId="1" AcceptedAnswerId="12587" CreationDate="2015-05-21T14:47:46.140" Score="0" ViewCount="160" Body="&lt;p&gt;I am writing a document in Aquamacs, and I want some (not all) of the text to be in a different colour. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I googled it but could only see how to change the font colour of all the text.&lt;/p&gt;&#xA;" OwnerUserId="8372" LastActivityDate="2015-05-21T14:59:55.153" Title="Have different font colours in the same Aquamacs document" Tags="|aquamacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12587" PostTypeId="2" ParentId="12586" CreationDate="2015-05-21T14:59:55.153" Score="1" Body="&lt;p&gt;The question is quite unclear. Please specify. What do you mean by putting some of the text in a different color? &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Do you want syntax-specific highlighting? If so, turn on font-locking. And you might need to define &lt;code&gt;font-lock-keywords&lt;/code&gt; for the current mode. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Font-Lock.html&quot; rel=&quot;nofollow&quot;&gt;Font Lock&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do you want ad hoc highlighting? If so, try the &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;Highlight library&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For information about font coloring and faces, see Emacs Wiki, Category &lt;a href=&quot;http://www.emacswiki.org/emacs/CategoryFaces&quot; rel=&quot;nofollow&quot;&gt;Faces&lt;/a&gt;. Or ask Emacs: &lt;code&gt;C-h r&lt;/code&gt; &lt;code&gt;C-h i faces RET&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-21T14:59:55.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12588" PostTypeId="2" ParentId="12540" CreationDate="2015-05-21T16:11:25.263" Score="4" Body="&lt;p&gt;So it appears that the problem in this case was related to the function being declared in a buffer which doesn't have a file associated with it, thus Emacs was unable to locate the definition.  Here's how I discovered this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I started by looking into the definition of &lt;code&gt;edebug-step-in&lt;/code&gt; (I figured out this is the function called in debug mode when I press &lt;kbd&gt;i&lt;/kbd&gt; for stepping in by inspecting the help page for debug mode (available through pressing &lt;kbd&gt;?&lt;/kbd&gt; while in debug mode).&lt;/li&gt;&#xA;&lt;li&gt;Thus I found &lt;code&gt;edebug-instrument-callee&lt;/code&gt;, then &lt;code&gt;edebug-instrument-function&lt;/code&gt;, then &lt;code&gt;find-function-noselect&lt;/code&gt;, then &lt;code&gt;find-function-search-for-symbol&lt;/code&gt;, then &lt;code&gt;find-function-library&lt;/code&gt; and finally, &lt;code&gt;symbol-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;symbol-file&lt;/code&gt; is the same function used to locate the references whenever you see those references highlighted in a help buffer, or when you call &lt;code&gt;describe-function&lt;/code&gt; (&lt;kbd&gt;C-h f&lt;/kbd&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then I tried to copy what &lt;code&gt;symbol-file&lt;/code&gt; does (roughly, just to convince myself that I am on the right track):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/defined-in-file (s)&#xA;  (car &#xA;   (cl-find-if&#xA;    (lambda (x)&#xA;      (cl-some&#xA;       (lambda (y) (eql s (if (symbolp y) y (cdr y))))&#xA;       (cdr x)))&#xA;    load-history)))&#xA;&#xA;(my/defined-in-file 'symbol-file)&#xA;&quot;/usr/local/share/emacs/25.0.50/lisp/subr.elc&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The results turned out positive.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;When I tried to do the same thing with the functions, which were declared in &lt;code&gt;*scratch*&lt;/code&gt; buffer, I've got no results.&lt;/li&gt;&#xA;&lt;li&gt;Hence, the conclusion: the automatic instrumentation during &quot;step-in&quot; operation must have failed due to Emacs not being able to locate the source file for the function.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-05-21T16:11:25.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12590" PostTypeId="1" AcceptedAnswerId="12591" CreationDate="2015-05-21T16:51:31.250" Score="5" ViewCount="1682" Body="&lt;p&gt;Let's say I have &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=a31ca4ef50efae51f9281be11cb6668789a57f08&quot; rel=&quot;nofollow&quot;&gt;this patch file&lt;/a&gt; from emacs git.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually fix stuff manually by reviewing the patch files. But I am sure there is an automated way to do that. I played a bit by opening package.el in emacs source and trying to use &lt;code&gt;ediff-patch-file&lt;/code&gt; but was unsuccessful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be good to get a brief walk-through for the patching process. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The patch referenced above:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---&#xA;diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el&#xA;index 444adf0..79f37e7 100644&#xA;--- a/lisp/emacs-lisp/package.el&#xA;+++ b/lisp/emacs-lisp/package.el&#xA;@@ -2943,12 +2943,9 @@ objects removed.&quot;&#xA;                 (format status-format (cl-incf i)))&#xA;           (force-mode-line-update)&#xA;           (redisplay 'force)&#xA;-          (package-install&#xA;-           ;; Don't mark as selected if it's a new version of an&#xA;-           ;; installed package.&#xA;-           pkg (and (not (package-installed-p pkg))&#xA;-                    (package-installed-p&#xA;-                     (package-desc-name pkg))))))&#xA;+          ;; Don't mark as selected, `package-menu-execute' already&#xA;+          ;; does that.&#xA;+          (package-install pkg 'dont-select)))&#xA;     ;; Once there are no more packages to install, proceed to&#xA;     ;; deletion.&#xA;     (let ((package-menu--transaction-status &quot;:Deleting&quot;))&#xA;@@ -2995,6 +2992,10 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm.&quot;&#xA;                        (when .upgrade (format &quot;Upgrad__ %s&quot; (length .upgrade)))&#xA;                        &quot;]&quot;)))&#xA;           (message (replace-regexp-in-string &quot;__&quot; &quot;ing&quot; message-template) &quot;started&quot;)&#xA;+          ;; Packages being upgraded are not marked as selected.&#xA;+          (package--save-selected-packages&#xA;+           (remove-dups (append (mapcar #'package-desc-name .install)&#xA;+                                package-selected-packages)))&#xA;           (package-menu--perform-transaction install-list delete-list)&#xA;           (when package-selected-packages&#xA;             (if-let ((removable (package--removable-packages)))&#xA;--&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2018-09-06T11:46:46.590" LastActivityDate="2018-09-06T11:46:46.590" Title="What is the work-flow for applying a patch?" Tags="|git|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12591" PostTypeId="2" ParentId="12590" CreationDate="2015-05-21T16:58:56.087" Score="7" Body="&lt;p&gt;You can use either: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;enter &lt;code&gt;diff-mode&lt;/code&gt;, then &lt;code&gt;C-c C-a&lt;/code&gt; when point is on each hunk to apply the patch to the destination file. You should open the file in a window to see the effect.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;epatch-buffer&lt;/code&gt;: if patch is already in the buffer, the command asks for the patch and the buffer to be applied, then create patched and unpatched windows side by side for you to compare with &lt;code&gt;ediff&lt;/code&gt;. If you are satisfied, you can press &lt;code&gt;q&lt;/code&gt; to quit and save the patched version into your original file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;epatch&lt;/code&gt;: the same as &lt;code&gt;epatch-buffer&lt;/code&gt; but asking for a source file instead of a buffer to patch.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-05-21T16:58:56.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12592" PostTypeId="1" AcceptedAnswerId="12594" CreationDate="2015-05-21T17:07:49.800" Score="10" ViewCount="3336" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; to manage installed packages and &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot;&gt;&lt;code&gt;bind-key&lt;/code&gt;&lt;/a&gt; to assign actions to custom keys that I like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I override most of the default Emacs keybinding (e.g. &lt;kbd&gt;C-n&lt;/kbd&gt; becomes &lt;kbd&gt;M-k&lt;/kbd&gt;, &lt;kbd&gt;C-p&lt;/kbd&gt; becomes &lt;kbd&gt;M-i&lt;/kbd&gt;), but I'm OK with other modes overriding my keybinding scheme. Sometimes, I want my keybinding persist, however. I want &lt;kbd&gt;M-k&lt;/kbd&gt; mean something else, than in default Gnus or Helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However they all conflict with each other on Emacs startup, because I can't add a binding to a keymap, if it doesn't exist (because &lt;code&gt;use-package&lt;/code&gt; sometimes defers loading of a package). E.g., the following commands throw errors (e.g. &lt;code&gt;(void-variable helm-map)&lt;/code&gt;), because Helm and Gnus aren't yet fully loaded.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-key &quot;M-Y&quot; 'helm-end-of-buffer helm-map)&#xA;(bind-key &quot;M-k&quot; 'helm-next-line helm-find-files-map)&#xA;(bind-key &quot;M-s&quot; 'other-window gnus-summary-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have all my &lt;code&gt;use-package&lt;/code&gt; invocations in one file and &lt;code&gt;bind-key&lt;/code&gt; for custom keybindings in another file. I don't want to put bindings into &lt;code&gt;use-package&lt;/code&gt; calls, because maybe I want to publish my custom keybinding scheme as a standalone package. What if I want someone installing my scheme had Helm and Gnus local keybindings overriden too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I manage mode-local keybindings using &lt;code&gt;bind-key&lt;/code&gt;, so that all keys are set even if packages are loaded lately, and all key settings are inside one file?&lt;/p&gt;&#xA;" OwnerUserId="3972" LastEditorUserId="675" LastEditDate="2015-05-21T18:17:23.393" LastActivityDate="2023-09-24T05:48:29.027" Title="How to bind your keys to keymaps that aren't loaded yet?" Tags="|key-bindings|keymap|use-package|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12593" PostTypeId="1" AcceptedAnswerId="12615" CreationDate="2015-05-21T17:12:06.923" Score="2" ViewCount="284" Body="&lt;p&gt;I use Emacs 24.5.1 with &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;Spacemacs&lt;/a&gt; and added &lt;a href=&quot;http://sourceforge.net/projects/msys2/&quot; rel=&quot;nofollow&quot;&gt;Msys2&lt;/a&gt; to the exec-path to use git.exe&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run 'Magit-status' I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C:/c/user/...my-folder/ isn't an existing directory.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can see there is something weird going on with the path. There is an extra '/c/'&#xA;There is a very similar error to users that use Git from Cygwin, and there is a work around to fix that by removing the extra '/cygdrive/' added to the file path. Unfortunately I haven't found anything to fix my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas anyone?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6546" LastActivityDate="2015-05-25T19:51:20.080" Title="&quot;C:/c/user/...my-folder/ isn't an existing directory&quot; error" Tags="|magit|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12594" PostTypeId="2" ParentId="12592" CreationDate="2015-05-21T17:20:14.930" Score="22" Body="&lt;p&gt;You can use &lt;code&gt;with-eval-after-load&lt;/code&gt; to defer the key binding until after a certain module has been loaded (and thus defined the keymap):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;helm&quot;&#xA;  (bind-key &quot;M-Y&quot; #'helm-end-of-buffer helm-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-h v helm-map&lt;/code&gt; to find which module the keymap is defined in, and thus what to put in the string on the first line.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-eval-after-load&lt;/code&gt; was introduced in Emacs 24.4. If you have an earlier Emacs version, you need to use &lt;code&gt;eval-after-load&lt;/code&gt; instead, and put a single quote in front of the &lt;code&gt;bind-key&lt;/code&gt; call:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;helm&quot;&#xA;  '(bind-key &quot;M-Y&quot; #'helm-end-of-buffer helm-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to put several &lt;code&gt;bind-key&lt;/code&gt; calls in this form, with &lt;code&gt;with-eval-after-load&lt;/code&gt; you just put them one after another, but with &lt;code&gt;eval-after-load&lt;/code&gt; you need to wrap them all in a &lt;code&gt;progn&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;helm&quot;&#xA;  '(progn&#xA;     (bind-key &quot;M-Y&quot; #'helm-end-of-buffer helm-map)&#xA;     (bind-key &quot;M-k&quot; #'helm-next-line helm-find-files-map)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastEditorUserId="115" LastEditDate="2015-05-22T13:40:07.253" LastActivityDate="2015-05-22T13:40:07.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12595" PostTypeId="2" ParentId="12592" CreationDate="2015-05-21T17:22:02.210" Score="9" Body="&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In order to execute stuff after a given package is loaded, you need to put that after &lt;code&gt;:config&lt;/code&gt; in &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example using the snippet in your question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Snippet # 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package helm&#xA;  :config&#xA;  (progn&#xA;    (bind-key &quot;M-Y&quot; #'helm-end-of-buffer helm-map)&#xA;    (bind-key &quot;M-k&quot; #'helm-next-line helm-find-files-map)))&#xA;&#xA;(use-package gnus&#xA;  :config&#xA;  (bind-key &quot;M-s&quot; #'other-window gnus-summary-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Explanation&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;It is OK to have the below 2 snippets at different places in your emacs &lt;code&gt;init.el&lt;/code&gt; or in any of the nested files loaded/required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Snippet # 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package gnus)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Snippet # 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package gnus&#xA;  :config&#xA;  (bind-key &quot;M-s&quot; #'other-window gnus-summary-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason is that it does not matter which of the above 2 snippets is executed first. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is why.. below is what Snippet # 3 expands to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;You get the below by doing &lt;code&gt;M-x pp-macroexpand-last-sexp&lt;/code&gt; when the point (cursor) is after the last closing parenthesis of that snippet.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Snippet # 4&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (not (require 'gnus nil t))&#xA;    (ignore (message (format &quot;Could not load %s&quot; 'gnus)))&#xA;  (condition-case-unless-debug err&#xA;      (bind-key &quot;M-s&quot; #'other-window gnus-summary-mode-map)&#xA;    (error&#xA;     (ignore&#xA;      (display-warning 'use-package&#xA;                       (format &quot;%s %s: %s&quot; &quot;gnus&quot; &quot;:config&quot;&#xA;                               (error-message-string err))&#xA;                       :error))))&#xA;  t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above snippet basically means that &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;gnus&lt;/code&gt; is required first and then the &lt;code&gt;bind-key&lt;/code&gt; form is executed. &lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;gnus&lt;/code&gt; is not found then you will see a message in the *Messages* buffer saying that that package couldn't be loaded.&lt;/li&gt;&#xA;&lt;li&gt;It will throw error if there is any problem in the executing &lt;code&gt;(bind-key &quot;M-s&quot; #'other-window gnus-summary-mode-map)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also if &lt;code&gt;gnus&lt;/code&gt; is already required by &lt;em&gt;Snippet # 2&lt;/em&gt; above and it is required again by &lt;em&gt;Snippet # 3&lt;/em&gt;, it does not matter because &lt;code&gt;require&lt;/code&gt; does not load a package again if it is already loaded.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Reference&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://github.com/jwiegley/use-package#the-basics&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt; basics&lt;/a&gt; on its github,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;:config&lt;/code&gt; can be used to execute code after a package is loaded. In cases where loading is done lazily (see more about autoloading below), this execution is deferred until after the autoload occurs:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Snippet # 5&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package foo&#xA;  :init&#xA;  (setq foo-variable t)&#xA;  :config&#xA;  (foo-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Above executes the &lt;code&gt;:init&lt;/code&gt; section ( &lt;code&gt;(setq foo-variable t)&lt;/code&gt; ) &lt;strong&gt;before&lt;/strong&gt; &lt;code&gt;foo&lt;/code&gt; package is loaded. But &lt;code&gt;(foo-mode 1)&lt;/code&gt; in the &lt;code&gt;:config&lt;/code&gt; section is executed &lt;strong&gt;after&lt;/strong&gt; &lt;code&gt;foo&lt;/code&gt; is loaded.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-22T12:09:48.107" LastActivityDate="2015-05-22T12:09:48.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12596" PostTypeId="1" CreationDate="2015-05-21T17:49:45.387" Score="1" ViewCount="221" Body="&lt;p&gt;I'm using Ubuntu 14.04 lts and emacs 24.3.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error I get is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/guy/.emacs':&#xA;&#xA;Symbol's value as variable is void: org2blog-autoloads&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I set the in comment while it is not working.&#xA;The file exists and I have user privileges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org2blog portion of my .emacs file :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; org2blog&#xA;;; org2blog dependencies&#xA;(add-to-list 'load-path '“~/.emacs.d/elisps/metaweblog/”)&#xA;(add-to-list 'load-path '“~/.emacs.d/elpa/xml-rpc-1.6.8/”)&#xA;(add-to-list 'load-path '“~/.emacs.d/elpa/org2blog-0.5/”)&#xA;;(require 'org2blog-autoloads)&#xA;&#xA;;; org2blog setup blog&#xA;(setq org2blog/wp-blog-alist&#xA;      '((&quot;steptoharmony&quot;&#xA;         :url &quot;http://steptoharmony.wordpress.com/xmlrpc.php&quot;&#xA;         :username &quot;guybon&quot;&#xA;         :default-title &quot;Hello World&quot;&#xA;         :default-categories ()&#xA;         :tags-as-categories nil)&#xA;       )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;location of file :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.emacs.d/elpa/org2blog-0.5:&#xA;metaweblog.el org2blog-autoloads.el org2blog-autoloads.elc org2blog.elc org2blog-pkg.elc&#xA;metaweblog.elc org2blog-autoloads.el~ org2blog.el org2blog-pkg.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Starting emacs with '--debug-init' gives this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;org2blog-autoloads&quot;)&#xA;require(org2blog-autoloads)&#xA;eval-buffer(# nil &quot;/home/guy/.emacs&quot; nil t) ; Reading at buffer position 1169&#xA;load-with-code-conversion(&quot;/home/guy/.emacs&quot; &quot;/home/guy/.emacs&quot; t t)&#xA;load(&quot;~/.emacs&quot; t t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;load-path = &#xA;    (&quot;/home/guy/.emacs.d/elpa/org2blog-0.5&quot; &quot;/home/guy/.emacs.d/elpa/org-20150223&quot; &quot;/home/guy/.emacs.d/elpa/xml-rpc-1.6.8&quot; “~/.emacs.d/elpa/org2blog-0.5/” “~/.emacs.d/elpa/xml-rpc-1.6.8/” “~/.emacs.d/elisps/metaweblog/” &quot;/etc/emacs24&quot; &quot;/etc/emacs&quot; &quot;/usr/local/share/emacs/24.3/site-lisp&quot; &quot;/usr/local/share/emacs/site-lisp&quot; &quot;/usr/share/emacs24/site-lisp/git&quot; &quot;/usr/share/emacs24/site-lisp/dictionaries-common&quot; &quot;/usr/share/emacs/24.3/site-lisp&quot; &quot;/usr/share/emacs/24.3/site-lisp/git&quot; &quot;/usr/share/emacs/site-lisp&quot; &quot;/usr/share/emacs/24.3/lisp&quot; &quot;/usr/share/emacs/24.3/lisp/vc&quot; &quot;/usr/share/emacs/24.3/lisp/url&quot; &quot;/usr/share/emacs/24.3/lisp/textmodes&quot; &quot;/usr/share/emacs/24.3/lisp/progmodes&quot; &quot;/usr/share/emacs/24.3/lisp/play&quot; &quot;/usr/share/emacs/24.3/lisp/org&quot; &quot;/usr/share/emacs/24.3/lisp/nxml&quot; &quot;/usr/share/emacs/24.3/lisp/net&quot; &quot;/usr/share/emacs/24.3/lisp/mh-e&quot; &quot;/usr/share/emacs/24.3/lisp/mail&quot; &quot;/usr/share/emacs/24.3/lisp/language&quot; &quot;/usr/share/emacs/24.3/lisp/international&quot; &quot;/usr/share/emacs/24.3/lisp/gnus&quot; &quot;/usr/share/emacs/24.3/lisp/eshell&quot; &quot;/usr/share/emacs/24.3/lisp/erc&quot; &quot;/usr/share/emacs/24.3/lisp/emulation&quot; &quot;/usr/share/emacs/24.3/lisp/emacs-lisp&quot; &quot;/usr/share/emacs/24.3/lisp/cedet&quot; &quot;/usr/share/emacs/24.3/lisp/calendar&quot; &quot;/usr/share/emacs/24.3/lisp/calc&quot; &quot;/usr/share/emacs/24.3/lisp/obsolete&quot; &quot;/usr/share/emacs/24.3/leim&quot;)&lt;/p&gt;&#xA;" OwnerUserId="8374" LastEditorUserId="8374" LastEditDate="2015-05-22T11:33:38.487" LastActivityDate="2015-05-22T11:33:38.487" Title="cannot open load file org2blog-autoloads" Tags="|org-mode|init-file|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12597" PostTypeId="1" CreationDate="2015-05-21T18:00:02.130" Score="5" ViewCount="261" Body="&lt;p&gt;I'd like to browse source code in emacs by searching for 'word' or 'tag' hits in a way somewhat similar to etags but:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;clicking on words to search for matches across a code base (say a directory or project)&lt;/li&gt;&#xA;&lt;li&gt;each click leads to a search hits listing view that itself has words that can be clicked to search again&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To be more specific: Here's a program that works similarly to what I would like to use in emacs -- it's a small web application in Python:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/mseaborn/sbrowse&quot;&gt;https://github.com/mseaborn/sbrowse&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are basically two views, which might perhaps map onto emacs something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;web view -&amp;gt; emacs 'view'&#xA;------------------------&#xA;source code -&amp;gt; a regular editing buffer with appropriate mode (say python-mode)&#xA;hits listing -&amp;gt; something like compilation-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the source code view, one can click on a 'word' to jump to the hits listing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hits listing looks like the inline block below (here I've shown what you'd see on searching for 'spam'&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;path/to/file.py:&#xA;104:    ham = spam()&#xA;123:    # Some more spam&#xA;&#xA;path/to/other/file.py&#xA;98:     ham *= spam ** 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From here one might:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Click on 'ham' or 'Some' and get a similar listing for that word&lt;/li&gt;&#xA;&lt;li&gt;Click on a line number ('98:') to jump to a source code view that shows the hit in context&lt;/li&gt;&#xA;&lt;li&gt;Click on a file path is a link to jump to the top of the corresponding source code view&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Usually the search is done by simple grepping for words based on regexp word boundaries or similar.  One other feature of sbrowse that is nice, though, is that it has pluggable search implementations.  For example, I would like to be able to implement an elisp function or unix command to search using &lt;a href=&quot;https://github.com/google/codesearch&quot;&gt;https://github.com/google/codesearch&lt;/a&gt;, so that clicks in both views perform the search using that program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything available like this in the emacs universe?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2015-05-21T18:07:33.873" LastActivityDate="2016-03-17T13:01:55.363" Title="Hyperlinked code navigation" Tags="|search|hyperlinks|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12598" PostTypeId="2" ParentId="12592" CreationDate="2015-05-21T18:23:46.090" Score="2" Body="&lt;p&gt;Since you are already using bind-key, straight from documentation of &lt;code&gt;bind-key.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you want the keybinding to override all minor modes that may also bind&#xA;   the same key, use the `bind-key*' form:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-key* &quot;&amp;lt;C-return&amp;gt;&quot; 'other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To unbind a key within a keymap (for example, to stop your favorite major mode from changing a binding that you don't want to override everywhere), use unbind-key:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(unbind-key &quot;C-c x&quot; some-other-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last form breaks down if the keymap is currently undefined because the file defining &lt;code&gt;some-other-mode-map&lt;/code&gt;has not yet be loaded. So you could put this in a &lt;code&gt;use-package&lt;/code&gt; for &lt;code&gt;some-other-mode&lt;/code&gt;(the package defining &lt;code&gt;some-other-mode-map&lt;/code&gt;), or using &lt;code&gt;with-eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'some-other-mode&#xA;  (unbind-key &quot;C-c x&quot; some-other-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An other alternative would be defining your own minor mode containing all bindings which should not be overridden by major modes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-very-own-keymap (make-keymap) &quot;my very own keymap.&quot;)&#xA;&#xA;(define-key my-very-own-keymap (kbd &quot;M-i&quot;) 'my-foo)&#xA;&#xA;(define-minor-mode my-very-own-keys-minor-mode&#xA;  &quot;Minor mode with my very own keybindings.&quot;&#xA;  t &quot; my-own-keys&quot; my-very-own-keymap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7148" LastEditorUserId="7148" LastEditDate="2015-05-22T07:35:03.487" LastActivityDate="2015-05-22T07:35:03.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12599" PostTypeId="2" ParentId="12597" CreationDate="2015-05-21T18:47:02.423" Score="1" Body="&lt;p&gt;Perhaps you could try any of the AG interface variants. AG with PCRE support regex searches over files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is one example of doing this in Emacs : &lt;a href=&quot;https://github.com/syohex/emacs-helm-ag&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syohex/emacs-helm-ag&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see the custom option: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(setq helm-ag-use-emacs-lisp-regexp t)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2121" LastActivityDate="2015-05-21T18:47:02.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12600" PostTypeId="1" AcceptedAnswerId="12627" CreationDate="2015-05-21T18:47:51.263" Score="0" ViewCount="368" Body="&lt;p&gt;I have two different compile commands, and they need to run in different directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've gone through the trouble of making sure that if at all possible, I re-use the open compile buffer, rather than open a new view to it over and over again. The problem is that the default-directory of the buffer is set after I run one command, and subsequent calls don't seem to be able to override the default directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun build-engine ()&#xA;  &quot;Build the exe.&quot;&#xA;  (interactive)&#xA;  (let ((default-directory &quot;f:/Projects/build/&quot;))&#xA;    (compile &quot;build.pl -target=release_fastbuild -platform=win64 %*&quot;)))&#xA;&#xA;(defun build-test (name)&#xA;  &quot;Build a test from the current tool executable with the specified name&quot;&#xA;  (interactive &quot;sMap Name: &quot;)&#xA;  (let ((default-directory &quot;f:/Projects/bin/&quot;))&#xA;    (compile (concat &quot;tool_win64.exe /genfastload:PC /name:&quot; name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Those are the two compile commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I always switch to the open compile buffer, so I don't keep opening new ones. (It's also how I keep the buffer from vertically splitting.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice compile (around split-vertically activate)&#xA;  (if (and (get-buffer &quot;*compilation*&quot;)&#xA;           (not (eq (current-buffer) (get-buffer &quot;*compilation*&quot;))))&#xA;      (switch-to-buffer-other-frame (get-buffer &quot;*compilation*&quot;))&#xA;    (let ((split-width-threshold 9999)&#xA;          (split-height-threshold 0))))&#xA;    ad-do-it)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run the first build command, it works. Then if I build the second, it fails because the default-directory is still set to f:/Projects/build/. If I kill the first compile buffer, my command works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could write some infrastructure so that the build-engine command only uses build buffers and the build-test command only uses test buffers, but it seems like that let should override the previous one, shouldn't it?&lt;/p&gt;&#xA;" OwnerUserId="8254" LastActivityDate="2015-06-21T19:18:23.153" Title="Changing the default-directory of an open compilation buffer" Tags="|buffers|compilation|compilation-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12601" PostTypeId="2" ParentId="12590" CreationDate="2015-05-21T19:03:27.407" Score="4" Body="&lt;p&gt;The patch that you linked was generated with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git format-patch HEAD~1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At least that's what I use when I send patches to the mailing list.  To apply it, call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git am foo.patch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, you need to do it in a compatible git repository. A nice thing is that you get a full commit, with all the metadata and all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case the patch can't be applied cleanly, I use &lt;a href=&quot;http://www.pizzhacks.com/bugdrome/2011/10/deal-with-git-am-failures/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git apply .git/rebase-apply/0001 --reject&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then resolve the conflicts with magit &lt;kbd&gt;e&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-21T19:03:27.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12602" PostTypeId="1" CreationDate="2015-05-21T19:45:13.790" Score="2" ViewCount="74" Body="&lt;p&gt;The &lt;code&gt;debug-on-message&lt;/code&gt; variable tells Emacs to start the debugger when a matching message is displayed. How can I get Emacs to invoke my own function when a matching message is displayed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My motivation in this case is to build a contingency engine for common errors. Not all of these are well-handled locally through &lt;code&gt;advice&lt;/code&gt; or &lt;code&gt;unwind-protect&lt;/code&gt;, so I would like to use the echo area (or equivalently the &lt;code&gt;*Messages*&lt;/code&gt; buffer) as my input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example usage: &lt;code&gt;(do-on-message &quot;Foo error&quot; 'handle-foo)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-05-21T21:08:55.653" Title="Invoke function on message" Tags="|echo-area|error-handling|message|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12603" PostTypeId="1" CreationDate="2015-05-21T20:28:40.510" Score="1" ViewCount="55" Body="&lt;p&gt;Whenever I use &lt;code&gt;M-x compile&lt;/code&gt;, I like to have the shell that's running to be configured with &lt;code&gt;bash -ic&lt;/code&gt; so that I can easily type the compilation command (I switch between languages often, so the building mechanism varies and I need have an interactive shell for appropriate auto-completion and language-specific bash aliases to be activated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;easy solution&quot; would be putting the following at the top of my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shell-file-name &quot;bash&quot;)&#xA;(setq shell-command-switch &quot;-ic&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, having an interactive shell messes up a lot of important background tasks when launched by emacs (most importantly, &lt;code&gt;emerge&lt;/code&gt; doesn't play nicely with it). Furthermore, interactive mode needlessly slows things down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have one &lt;code&gt;shell-command-switch&lt;/code&gt; when running &lt;code&gt;M-x compile&lt;/code&gt;, and another for everything else? As a hacky first step, is it possible to redefine &lt;code&gt;compile&lt;/code&gt; to first copy the old &lt;code&gt;shell-command-switch&lt;/code&gt; value, set it to &lt;code&gt;-ic&lt;/code&gt;, then evaluate the old &lt;code&gt;compile&lt;/code&gt;, and finally switch the value back?&lt;/p&gt;&#xA;" OwnerUserId="8378" LastActivityDate="2015-05-21T20:28:40.510" Title="Can I have a separate shell switch when compiling?" Tags="|shell|compilation|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12604" PostTypeId="2" ParentId="12602" CreationDate="2015-05-21T20:47:07.970" Score="1" Body="&lt;p&gt;Well, you could advise &lt;code&gt;message&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But do you really need/want this to take effect for calls to &lt;code&gt;message&lt;/code&gt;, i.e., including for calls that your code does not make?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If what you are really trying to do is &quot;&lt;em&gt;build a contingency engine for common errors&lt;/em&gt;&quot; then it sounds like what it would be helpful to define your own error symbols. To do that, you use &lt;code&gt;define-error&lt;/code&gt; - see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Symbols.html&quot; rel=&quot;nofollow&quot;&gt;Error Symbols&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And see these nodes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Signaling-Errors.html&quot; rel=&quot;nofollow&quot;&gt;Signaling Errors&lt;/a&gt; for how to signal an error of a type that you define&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html&quot; rel=&quot;nofollow&quot;&gt;Handling Errors&lt;/a&gt; for how to handle errors, including those you define.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In versions of Emacs prior to Emacs 24.4, there was no &lt;code&gt;define-error&lt;/code&gt;. You accomplished the same thing using symbol property &lt;code&gt;error-conditions&lt;/code&gt; (and you can still do this).  Here are the Emacs 24.4 and Emacs 24.3 definitions of error condition &lt;code&gt;bookmark-error-no-filename&lt;/code&gt;, for instance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.4 (+):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-error 'bookmark-errors nil)&#xA;(define-error 'bookmark-error-no-filename&#xA;  &quot;Bookmark has no associated file (or directory)&quot; 'bookmark-errors)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.3:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(put 'bookmark-error-no-filename&#xA;     'error-conditions&#xA;     '(error bookmark-errors bookmark-error-no-filename))&#xA;(put 'bookmark-error-no-filename&#xA;     'error-message&#xA;     &quot;Bookmark has no associated file (or directory)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;P.S. If my guess is right about what your question is really about, please consider editing the question (at least the title) to make it clear.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-21T21:08:55.653" LastActivityDate="2015-05-21T21:08:55.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12605" PostTypeId="1" AcceptedAnswerId="14958" CreationDate="2015-05-22T02:48:33.527" Score="2" ViewCount="1048" Body="&lt;p&gt;When I press &lt;kbd&gt;dd&lt;/kbd&gt; in &lt;code&gt;haskell-interactive-mode&lt;/code&gt; at the prompt, it doesn't delete anything, because part of the line is read-only. I would like to map &lt;kbd&gt;dd&lt;/kbd&gt; to &lt;code&gt;'haskell-interactive-mode-kill-whole-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'normal haskell-interactive-mode-map&#xA;  (kbd &quot;dd&quot;) 'haskell-interactive-mode-kill-whole-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;doesn't solve the problem. Although it binds &lt;kbd&gt;dd&lt;/kbd&gt;, it clobbers evil-mode's &lt;kbd&gt;d&lt;/kbd&gt; binding, making commands like &lt;kbd&gt;dw&lt;/kbd&gt; no longer work. Just adding things to the &lt;code&gt;evil-operator-shortcut-map&lt;/code&gt; (like what evil-surround does) doesn't quite cut it either, because that would bind nonsensical sequences like &lt;kbd&gt;yd&lt;/kbd&gt; which should remain unbound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/9394/6761&quot;&gt;These&lt;/a&gt; &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.vim-emulation/2000&quot; rel=&quot;nofollow noreferrer&quot;&gt;two&lt;/a&gt; links are relevant, but not quite answers.&lt;/p&gt;&#xA;" OwnerUserId="6761" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-08-22T14:21:57.813" Title="How do I change only what &quot;dd&quot; does in evil-mode's normal-state in a minor mode" Tags="|key-bindings|evil|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12606" PostTypeId="1" CreationDate="2015-05-22T04:52:51.577" Score="1" ViewCount="202" Body="&lt;p&gt;When I open an org-mode file that has a babel block in emacs-lisp format, afterwards, whenever I run &lt;code&gt;save-some-buffers&lt;/code&gt;, I get the &lt;code&gt;File to save in:&lt;/code&gt; prompt for the current org-mode file. I get this prompt every time I run &lt;code&gt;save-some-buffers&lt;/code&gt;, and each time, I have to Quit out of it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To try to make the prompt go away I tried accepting it and saving the current file again, which had the effect of overwriting the entire org-mode file with just the first emacs-lisp block. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get org-mode to stop prompting me to save org files that contain Babel blocks? &lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-05-22T04:52:51.577" Title="How to get org-mode to stop prompting me to save org-mode files that contain Babel blocks?" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12607" PostTypeId="2" ParentId="12512" CreationDate="2015-05-22T06:16:39.863" Score="2" Body="&lt;p&gt;As the &lt;a href=&quot;http://orgmode.org/manual/LaTeX-fragments.html&quot; rel=&quot;nofollow&quot;&gt;org manual:LaTeX fragments&lt;/a&gt; said, LaTeX environment should work out of box. you may mistakenly changed the default export option somewhere. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following is a minimal example that works with &lt;code&gt;emacs -q&lt;/code&gt; where the Org-mode version is &lt;code&gt;8.2.10 (release_8.2.10 @ /usr/share/emacs/25.0.50/lisp/org/)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;#+OPTIONS: tex:t&#xA;#+HTML_MATHJAX:  path:&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js&quot;&#xA;\begin{align}&#xA;   a &amp;= b + x \\&#xA;   d &amp;= a - b&#xA;\end{align}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Besides, there should no &lt;code&gt;\\&lt;/code&gt; for the last equation inside LaTeX &lt;code&gt;align&lt;/code&gt; environment.&lt;/p&gt;&#xA;" OwnerUserId="5197" LastActivityDate="2015-05-22T06:16:39.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12608" PostTypeId="1" AcceptedAnswerId="12636" CreationDate="2015-05-22T06:31:15.763" Score="6" ViewCount="590" Body="&lt;p&gt;I am attempting to clean up my modeline due to overcrowding. In my quest I have come across a problem I cannot figure out, namely projectile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By this I mean the project name after the file name, it appends [project-name] after the file name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example (if I was too vague):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-U:---/path/to/file[project-name] (modes) etc...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have checked the customize projectile group and the readme on the github repo, but to no avail. Is there any other way I can remove this?&lt;/p&gt;&#xA;" OwnerUserId="8385" LastActivityDate="2015-06-09T07:50:04.013" Title="How to remove the projectile project name after the file name" Tags="|projectile|mode-line|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12609" PostTypeId="1" AcceptedAnswerId="12618" CreationDate="2015-05-22T07:01:05.097" Score="15" ViewCount="2649" Body="&lt;p&gt;It seems to be obvious but I don't seem to have been able to find an answer yet... I have some repetitive tasks which have a property in the style of &lt;code&gt;SCHEDULED: &amp;lt;2015-05-22 Fri 23:00 .+4d&amp;gt;&lt;/code&gt;. However this has the effect of making that task also showing up on the agenda view of May 26, May 30... etc. etc., which clutters up the agenda view significantly. I notice that scheduled entries with &lt;code&gt;habit&lt;/code&gt; style don't behave like this, however I don't want to make all repetitive tasks into &lt;code&gt;habit&lt;/code&gt;. There must be a way to prevent future occurrences of repetitive tasks(Both &lt;code&gt;DEADLINE&lt;/code&gt; and &lt;code&gt;SCHEDULED&lt;/code&gt;) from showing up on calendar prematurely?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2019-11-25T19:38:53.760" Title="org mode - prevent future repetitive entries from showing up in agenda view" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12610" PostTypeId="1" CreationDate="2015-05-22T08:33:23.913" Score="1" ViewCount="85" Body="&lt;p&gt;I was constructing a macro that nested another macro and I ran into something that confused me. If the backquoted macro was the last form in the defmacro it evaluated as expected. If added an additional result it wouldn't work without an &lt;a href=&quot;https://github.com/stsquad/async-org-babel/commit/53cd7672dfa84f875e0d383893b6c41bf75255f8&quot; rel=&quot;nofollow&quot;&gt;explicit eval&lt;/a&gt;. I've written some toy examples to illustrate my confusion:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my-test-macro (arg1)&#xA;  `(format &quot;we have %s&quot; ,arg1))&#xA;&#xA;(defmacro my-test-macro2 (arg1)&#xA;  (let ((part1 `(format &quot;we have %s&quot; ,arg1)))&#xA;    (format &quot;this is outside quote (%s)&quot; part1)))&#xA;&#xA;(defmacro my-test-macro3 (arg1)&#xA;  (let ((part1 (eval `(format &quot;we have %s&quot; ,arg1))))&#xA;    (format &quot;this is outside quote (%s)&quot; part1)))&#xA;&#xA;(my-test-macro &quot;test1&quot;)&#xA;&quot;we have test1&quot;&#xA;&#xA;(my-test-macro2 &quot;test2&quot;)&#xA;&quot;this is outside quote ((format we have %s test2))&quot;&#xA;&#xA;(my-test-macro3 &quot;test3&quot;)&#xA;&quot;this is outside quote (we have test3)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So was it bad practice not to eval the result for my backquote? In the wider context of elisp macros do they tend to just return a single form which gets automatically evaluated?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="105" LastEditDate="2015-07-11T04:54:43.833" LastActivityDate="2015-07-11T04:54:43.833" Title="Are there implicit evaluation rules for backquoted structures?" Tags="|elisp|elisp-macros|backquote|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12611" PostTypeId="1" AcceptedAnswerId="12619" CreationDate="2015-05-22T10:25:26.553" Score="2" ViewCount="1092" Body="&lt;p&gt;If I paste a string from some web page into an Emacs buffer sometimes it will show the Unicode representation of some characters with a backslash and some octal code.  How can I convert this to the character representation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8387" LastActivityDate="2023-10-26T22:06:50.223" Title="How to convert Unicode backslash octal representation to the character it represents?" Tags="|character-encoding|unicode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12612" PostTypeId="2" ParentId="12610" CreationDate="2015-05-22T11:14:24.770" Score="4" Body="&lt;p&gt;LISP is simple business:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;function calls receive their arguments evaluated, their result is used verbatim&lt;/li&gt;&#xA;&lt;li&gt;macro calls receive their arguments un-evaluated, their result is used evaluated&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other than that, you can almost look at macros as functions. In your&#xA;case, since the arguments are strings, they're the same whether&#xA;evaluated or not, so the difference between &lt;code&gt;my-test-macro&lt;/code&gt; being a&#xA;function or a macro is only in whether the result it returns will be&#xA;evaluated or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of a useful macro:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defmacro when (cond &amp;amp;rest body)&#xA;  &quot;If COND yields non-nil, do BODY, else return nil.&#xA;When COND yields non-nil, eval BODY forms sequentially and return&#xA;value of last one, or nil if there are none.&#xA;\(fn COND BODY...)&quot;&#xA;  (declare (indent 1) (debug t))&#xA;  (list 'if cond (cons 'progn body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that it doesn't use a backquote at all. But it could, here's an&#xA;equivalent implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defmacro when (cond &amp;amp;rest body)&#xA;  &quot;If COND yields non-nil, do BODY, else return nil.&#xA;When COND yields non-nil, eval BODY forms sequentially and return&#xA;value of last one, or nil if there are none.&#xA;\(fn COND BODY...)&quot;&#xA;  (declare (indent 1) (debug t))&#xA;  `(if ,cond&#xA;       (progn&#xA;         ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-22T11:14:24.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12613" PostTypeId="1" AcceptedAnswerId="12614" CreationDate="2015-05-22T11:39:08.343" Score="7" ViewCount="4700" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; I have the following Yasnippet, which looks like this:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; MYNAME - $1 (`(insert-mode-description)`).&#xA; $2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I insert the snippet, the cursor starts on &lt;code&gt;$1&lt;/code&gt;. Then I begin with typing. I would like to convert the first character of the sentence that I'm typing to uppercase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look in the documentation of Yasnippet, there is a transformer that converts your text to uppercase. I need only to capitalize the first character. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I figured out another option: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MYNAME - $1 $2 (`(insert-mode-description)`).&#xA;$3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So Everything in &lt;code&gt;$1&lt;/code&gt;-place gets converted to uppercase. Then press &lt;code&gt;tab&lt;/code&gt;, to jump to &lt;code&gt;$2&lt;/code&gt; and typing further in lowercase letters. &#xA;But I'm not looking for that. Then I need to press &lt;code&gt;tab&lt;/code&gt; every time after I insert the first character.&#xA;                                                                                                      I would just convert the first character of $1 to be uppercase. Any suggestion?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2015-05-22T15:07:18.707" LastActivityDate="2020-03-25T13:43:47.313" Title="Convert the first character to uppercase/capital letter using yasnippet" Tags="|yasnippet|capitalization|" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12614" PostTypeId="2" ParentId="12613" CreationDate="2015-05-22T12:33:55.230" Score="8" Body="&lt;h2&gt;Function to capitalize only the first char&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Make sure that the below function is evaluated in your emacs config before the &lt;code&gt;yasnippet&lt;/code&gt; snippets are loaded.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/capitalize-first-char (&amp;amp;optional string)&#xA;  &quot;Capitalize only the first character of the input STRING.&quot;&#xA;  (when (and string (&amp;gt; (length string) 0))&#xA;    (let ((first-char (substring string nil 1))&#xA;          (rest-str   (substring string 1)))&#xA;      (concat (capitalize first-char) rest-str))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Snippet&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is a snippet that makes use of the above function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: intro&#xA;# key: zname&#xA;# --&#xA;Hi, my name is ${1:$$(my/capitalize-first-char yas-text)}.&#xA;$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Demo&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Tokx3.gif&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;a href=&quot;https://capitaomorte.github.io/yasnippet/snippet-development.html#sec-3-7&quot; rel=&quot;noreferrer&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-23T15:08:11.633" LastActivityDate="2015-05-23T15:08:11.633" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="12615" PostTypeId="2" ParentId="12593" CreationDate="2015-05-22T13:18:48.473" Score="1" Body="&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is a very similar error to users that use Git from Cygwin, and there is a work around to fix that by removing the extra '/cygdrive/' added to the file path.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/magit/magit/blob/1b467126f43a2f752b32299156c6772b12ca0c29/magit-git.el#L438-L441&quot; rel=&quot;nofollow&quot;&gt;existing workaround&lt;/a&gt; that was recently added to &lt;code&gt;next&lt;/code&gt; (see &lt;a href=&quot;https://github.com/magit/magit/issues/1318&quot; rel=&quot;nofollow&quot;&gt;magit issue #1318&lt;/a&gt;, commits &lt;a href=&quot;https://github.com/magit/magit/commit/2b4b366dde1c56496d46e033ff9e00c16aa1e2ed&quot; rel=&quot;nofollow&quot;&gt;&quot;work around a cygwin path issue&quot;&lt;/a&gt; and &lt;a href=&quot;https://github.com/magit/magit/commit/dab31162f44021e1889a8fefe6b33de1d1b09e5b&quot; rel=&quot;nofollow&quot;&gt;&quot;limit cygwin path kludge to non-cygwin Emacs with cygwin Git&quot;&lt;/a&gt;) works for Msys2 as well. So &lt;a href=&quot;https://github.com/magit/magit/wiki/Installation#installing-from-the-next-branch&quot; rel=&quot;nofollow&quot;&gt;installing the &lt;code&gt;next&lt;/code&gt; branch&lt;/a&gt; will fix the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a copy of the relevant function for easy reference:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun magit-expand-git-file-name (filename &amp;amp;optional localname)&#xA;  (setq filename&#xA;        (if (file-name-absolute-p filename)&#xA;            (if localname&#xA;                filename&#xA;              (concat (file-remote-p default-directory) filename))&#xA;          (expand-file-name&#xA;           filename&#xA;           (and localname (file-remote-p default-directory 'localname)))))&#xA;  (if (and (eq system-type 'windows-nt) ; together with cygwin git, see #1318&#xA;           (string-match &quot;^/\\(cygdrive/\\)?\\([a-z]\\)/\\(.*\\)&quot; filename))&#xA;      (concat (match-string 2 filename) &quot;:/&quot;&#xA;              (match-string 3 filename))&#xA;    filename))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-05-25T19:51:20.080" LastActivityDate="2015-05-25T19:51:20.080" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12616" PostTypeId="2" ParentId="12592" CreationDate="2015-05-22T13:36:41.027" Score="3" Body="&lt;p&gt;On the opposite of the other answers, I've always used hooks for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-company-maps()&#xA;  (define-key company-active-map &quot;\C-x\M-h&quot; 'company-show-doc-buffer)&#xA;  (define-key company-active-map &quot;\C-n&quot; 'company-select-next)&#xA;  (define-key company-active-map &quot;\C-p&quot; 'company-select-previous)&#xA;  (define-key company-active-map &quot;\C-h&quot; 'delete-backward-char))&#xA;&#xA;(add-hook 'company-mode-hook 'my-company-maps)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-22T13:36:41.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12618" PostTypeId="2" ParentId="12609" CreationDate="2015-05-22T14:13:05.470" Score="12" Body="&lt;p&gt;The default value for the variable &lt;code&gt;org-agenda-repeating-timestamp-show-all&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt; -- i.e., &quot;&lt;em&gt;Non-nil means show all occurrences of a repeating stamp in the agenda.&lt;/em&gt;&quot;  The variable can be set to &quot;&lt;em&gt;a list of strings&lt;/em&gt;&quot; to &quot;&lt;em&gt;only show occurrences of repeating stamps for these TODO keywords&lt;/em&gt;.&quot; When the variable is set to &lt;code&gt;nil&lt;/code&gt;, &quot;&lt;em&gt;only one occurrence is shown, either today or the nearest into the future.&lt;/em&gt;&quot;  Therefore, the original poster may wish to add the following line to the &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-repeating-timestamp-show-all nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-05-22T14:13:05.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12619" PostTypeId="2" ParentId="12611" CreationDate="2015-05-22T14:40:52.973" Score="0" Body="&lt;p&gt;Specify whether you are using Emacs in a terminal or GUI Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use a font in Emacs that can display that Unicode character.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If your buffer is Unibyte (single-byte), then consider using multibyte instead. In any case, see the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Unibyte-Mode.html&quot; rel=&quot;nofollow&quot;&gt;Unibyte Mode&lt;/a&gt; and the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Representations.html&quot; rel=&quot;nofollow&quot;&gt;Text Representations&lt;/a&gt;. Consider using function &lt;code&gt;set-buffer-multibyte&lt;/code&gt; to convert the buffer to multibyte. See also (elisp) &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Disabling-Multibyte.html&quot; rel=&quot;nofollow&quot;&gt;Disabling Multibyte&lt;/a&gt; (not to disable it, but for more info about it).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-22T14:40:52.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12620" PostTypeId="2" ParentId="12611" CreationDate="2015-05-22T15:12:27.093" Score="0" Body="&lt;p&gt;Copying the whole buffer and pasting it into another new buffer somethimes helps here. &lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-05-22T15:12:27.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12621" PostTypeId="2" ParentId="12605" CreationDate="2015-05-22T17:23:39.570" Score="0" Body="&lt;p&gt;I found that the right way to map operators is using &lt;code&gt;evil-operator-state-map&lt;/code&gt;. So this &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-haskell-maps() &#xA;  (define-key evil-operator-state-local-map&#xA;  &quot;D&quot; 'haskell-interactive-mode-kill-whole-line))&#xA;&#xA;(add-hook 'haskell-interactive-mode-hook 'my-haskell-maps)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will map &lt;code&gt;dD&lt;/code&gt; to the correct function without interfere with the other &lt;code&gt;d&lt;/code&gt; operators. However, for some reason, mapping &lt;code&gt;dd&lt;/code&gt; does not work. Maybe because it doesn't override evil defaults. I'll let you know if I manage to fix the &lt;code&gt;dd&lt;/code&gt; binding&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-22T17:23:39.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12622" PostTypeId="2" ParentId="12565" CreationDate="2015-05-22T17:32:26.640" Score="2" Body="&lt;p&gt;Try enabling &lt;code&gt;eclim-mode&lt;/code&gt; when editing the file. That should bring up the completion automatically.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-22T17:32:26.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12623" PostTypeId="1" AcceptedAnswerId="12633" CreationDate="2015-05-22T17:42:47.317" Score="6" ViewCount="339" Body="&lt;p&gt;When I'm in the middle of implementing a new function, I like to narrow my source buffer to just that function (&lt;code&gt;C-x n d&lt;/code&gt;). However, this leaves the function indented as it was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have the function aligned to the left, but returned to its original position when the buffer is widened again.&#xA;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Default&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        function foo(bar) {&#xA;            return 'baz';&#xA;        }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Desired&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function foo(bar) {&#xA;    return 'baz';&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an existing method to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="105" LastEditDate="2015-05-29T21:49:11.287" LastActivityDate="2015-07-23T16:17:14.230" Title="How can I hide indentation on a narrowed defun?" Tags="|indentation|narrowing|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12624" PostTypeId="1" AcceptedAnswerId="12634" CreationDate="2015-05-22T18:10:21.270" Score="2" ViewCount="422" Body="&lt;p&gt;I'm trying to migrate my current blogging platform (Pelican) where I wrote the&#xA;posts using Markdown to a one based in org-mode (still considering how).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the problems that I found is that I have used the &lt;code&gt;&amp;lt;abbr&amp;gt;&lt;/code&gt; HTML tag in&#xA;several of my articles --thanks to the Markdown Extra markup &lt;code&gt;*[abbr]: definition&lt;/code&gt;&#xA;that I could use with Pelican-- but I can not find a way in &lt;em&gt;org-mode&lt;/em&gt; to export that&#xA;tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to generate this tag from org-mode?&lt;/p&gt;&#xA;" OwnerUserId="560" LastActivityDate="2015-05-22T23:31:57.440" Title="How can I generate the &lt;abbr&gt; HTML tag from org-mode?" Tags="|org-mode|org-export|html|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12625" PostTypeId="1" AcceptedAnswerId="12626" CreationDate="2015-05-22T18:22:13.057" Score="0" ViewCount="361" Body="&lt;p&gt;I've installed &lt;a href=&quot;http://www.emacswiki.org/emacs/Smex&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smex&lt;/code&gt;&lt;/a&gt; through MELPA as a replacement for the default &lt;kbd&gt;M-x&lt;/kbd&gt; (&lt;code&gt;execute-extended-command&lt;/code&gt;). The issue is that in &lt;code&gt;smex&lt;/code&gt;, certain global keybindings don't work. For instance, &lt;kbd&gt;C-h&lt;/kbd&gt; should work as backspace, yet in &lt;code&gt;smex&lt;/code&gt; it's still bound to default &lt;code&gt;help&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-h&quot;) 'delete-backward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea why the above &lt;code&gt;global-set-key&lt;/code&gt; might not work in &lt;code&gt;smex&lt;/code&gt;, while it does elsewhere (in minibuffer, eshell, etc.)?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Addendum to Jesse's answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;When using &lt;code&gt;ido-vertical-mode&lt;/code&gt; one should also rebind &lt;code&gt;M-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun ido-vertical-define-keys ()&#xA;(define-key ido-completion-map (kbd &quot;C-n&quot;) 'ido-next-match)&#xA;(define-key ido-completion-map (kbd &quot;C-p&quot;) 'ido-prev-match)&#xA;(define-key ido-completion-map (kbd &quot;M-p&quot;) 'previous-history-element))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5449" LastEditorUserId="5243" LastEditDate="2015-05-23T01:30:24.837" LastActivityDate="2020-07-27T00:44:14.927" Title="Global keybindings don't work in 'smex'" Tags="|ido|flx-ido|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12626" PostTypeId="2" ParentId="12625" CreationDate="2015-05-22T18:27:11.803" Score="3" Body="&lt;p&gt;I also had this problem and couldn't fix. My workaround was overriding the smex keybindings function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun smex-prepare-ido-bindings ()&#xA;  (define-key ido-completion-map (kbd &quot;TAB&quot;) #'minibuffer-complete)&#xA;  (define-key ido-completion-map (kbd &quot;M-p&quot;) #'previous-history-element)&#xA;  (define-key ido-completion-map (kbd &quot;M-.&quot;) #'smex-find-function)&#xA;  (define-key ido-completion-map (kbd &quot;C-h&quot;) #'delete-backward-char)&#xA;  (define-key ido-completion-map (kbd &quot;C-a&quot;) #'move-beginning-of-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="115" LastEditDate="2015-05-22T18:45:01.273" LastActivityDate="2015-05-22T18:45:01.273" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12627" PostTypeId="2" ParentId="12600" CreationDate="2015-05-22T18:28:55.990" Score="0" Body="&lt;p&gt;Based on Kyle's observation, I've made a few changes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun build-engine ()&#xA;  &quot;Build the exe.&quot;&#xA;  (interactive)&#xA;  (setq global-default-compile-directory &quot;f:/Projects/build&quot;)&#xA;  (let (compile &quot;build.pl -target=release_fastbuild -platform=win64 %*&quot;)))&#xA;&#xA;(defun build-test (name)&#xA;  &quot;Build a test from the current tool executable with the specified name&quot;&#xA;  (interactive &quot;sMap Name: &quot;)&#xA;  (setq global-default-compile-directory &quot;f:/Projects/bin&quot;)&#xA;  (let (compile (concat &quot;tool_win64.exe /genfastload:PC /name:&quot; name))))&#xA;&#xA;(defadvice compile (around split-vertically activate)&#xA;    (let ( ((default-directory global-default-compile-directory))&#xA;     (split-width-threshold 9999)&#xA;     (split-height-threshold 0)))&#xA;    (switch-to-appropriate-compile-buffer)&#xA;    ad-do-it)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works perfectly well. &lt;/p&gt;&#xA;" OwnerUserId="8254" LastActivityDate="2015-05-22T18:28:55.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12628" PostTypeId="1" AcceptedAnswerId="12645" CreationDate="2015-05-22T19:05:16.190" Score="3" ViewCount="599" Body="&lt;p&gt;Using examples from octave mode to explain this, but it would be useful in other places as well.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When going through the command history it would be nice to only display entries that match what's already been typed.  For example, &#xA;if I've typed out &lt;code&gt;x=&lt;/code&gt; pressing &lt;kbd&gt; M-p&lt;/kbd&gt; would go to the last commands beginning with that, eg &lt;code&gt;x=3&lt;/code&gt; or &lt;code&gt;x=y+4&lt;/code&gt;, even if several unrelated commands have been entered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the simplest way to achieve this in emacs?&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="25" LastEditDate="2015-05-26T05:26:31.650" LastActivityDate="2015-05-26T05:26:31.650" Title="How to go through command history based on what's been typed (matlab style)" Tags="|comint|history|octave|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12629" PostTypeId="2" ParentId="12623" CreationDate="2015-05-22T19:16:09.577" Score="2" Body="&lt;p&gt;For the first part advise &lt;code&gt;narrow-to-defun&lt;/code&gt; with that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-indent-narrowed-region-counter 0) &#xA;&#xA;(defun my-indent-narrowed-region ()&#xA;  (interactive &quot;*&quot;)&#xA;  (setq my-indent-narrowed-region-counter 0)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (&amp;lt; 0 (current-indentation))&#xA;      (setq my-indent-narrowed-region-counter (1+ my-indent-narrowed-region-counter))&#xA;      (indent-rigidly (point-min) (point-max) -1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now widen needs a reciproke advise called before, taking the my-indent-narrowed-region-counter for re-indent.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="675" LastEditDate="2015-05-22T21:16:53.653" LastActivityDate="2015-05-22T21:16:53.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12630" PostTypeId="1" AcceptedAnswerId="12694" CreationDate="2015-05-22T19:38:31.043" Score="0" ViewCount="410" Body="&lt;p&gt;When I run &lt;code&gt;sql-mysql&lt;/code&gt;, it gives me an unusable console:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/qRTTD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note how the commands and results are misplaced. My emacs version is 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-26T00:58:11.730" Title="sql-mysql console with glitches" Tags="|sql-interactive-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12631" PostTypeId="2" ParentId="12623" CreationDate="2015-05-22T20:49:03.327" Score="0" Body="&lt;p&gt;Bind a key to &lt;code&gt;toggle-removing-indentation&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar saved-indent nil&#xA;  &quot;Start, end, and indentation from last `narrow-and-outdent' here.&quot;)&#xA;(make-variable-buffer-local 'saved-indent)&#xA;&#xA;(defun toggle-removing-indentation ()&#xA;  &quot;Toggle removal of indentation for the region.&#xA;When removed, the least indented line of region is moved to bol,&#xA;and relative indentation is preserved within the region.&quot;&#xA;  (interactive)&#xA;  (if saved-indent (widen-and-indent) (narrow-and-outdent)))&#xA;&#xA;(defun narrow-and-outdent ()&#xA;  &quot;Narrow region and outdent to left margin, keeping relative indentation.&quot;&#xA;  (interactive)&#xA;  (unless (use-region-p) (error &quot;No non-empty active region&quot;))&#xA;  (let ((beg  (save-excursion (goto-char (region-beginning)) (line-beginning-position)))&#xA;        (end  (region-end)))&#xA;    (narrow-to-region beg end)&#xA;    (setq saved-indent  `(,beg ,end ,(indent-rigidly--current-indentation beg end)))&#xA;    (indent-rigidly beg end (- (nth 2 saved-indent)))))&#xA;&#xA;(defun widen-and-indent ()&#xA;  &quot;Widen, restoring indentation before last `narrow-and-outdent' here.&quot;&#xA;  (interactive)&#xA;  (let ((beg   (nth 0 saved-indent))&#xA;        (end   (nth 1 saved-indent))&#xA;        (dent  (nth 2 saved-indent)))&#xA;    (indent-rigidly beg end dent))&#xA;  (setq saved-indent  nil)&#xA;  (widen))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(It's not clear to me why you want to do this, however.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you want to remove indentation from more than one region in the same buffer, and you don't want to widen in between, you can do that using command &lt;code&gt;narrow-and-outdent&lt;/code&gt; for each region.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-22T21:00:13.467" LastActivityDate="2015-05-22T21:00:13.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12632" PostTypeId="1" AcceptedAnswerId="12659" CreationDate="2015-05-22T21:15:22.310" Score="0" ViewCount="133" Body="&lt;p&gt;Today I discovered that if you re-evaluate a defun using &lt;code&gt;eval-defun&lt;/code&gt; (&lt;kbd&gt;C-M-x&lt;/kbd&gt;) in a buffer with &lt;code&gt;lexical-binding&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;, the defun is recreated as an ordinary lambda, not a closure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, after you evaluate this file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; -*- lexical-binding: t; -*-&#xA;&#xA;(defun foo (x) (lambda (y) (+ x y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;(symbol-function 'foo)&lt;/code&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(closure (t) (x) (function (lambda (y) (+ x y))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you put point in the body of the function, press &lt;kbd&gt;C-M-x&lt;/kbd&gt;, and evaluate &lt;code&gt;(symbol-function 'foo)&lt;/code&gt; again, you get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda (x) (function (lambda (y) (+ x y))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Certainly not the same thing, and in fact it throws a &lt;code&gt;void-variable&lt;/code&gt; error when you call the returned function, if &lt;code&gt;x&lt;/code&gt; is not globally bound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the intended behavior?  Do I just need to remember not to use &lt;code&gt;eval-defun&lt;/code&gt; but rather &lt;code&gt;eval-buffer&lt;/code&gt; whenever I modify a function in a file where &lt;code&gt;lexical-binding&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 25.0.50.2.&lt;/p&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2015-05-23T18:08:50.657" Title="eval-defun ignores lexical-binding" Tags="|lexical-scoping|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12633" PostTypeId="2" ParentId="12623" CreationDate="2015-05-22T21:57:57.067" Score="3" Body="&lt;p&gt;Both @andreas-röhler and @drew had reasonable answers. However, I wasn't happy with either of them on their own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems I had were:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Both leave stuff on the undo stack, which interferes with editing and can neadlessly mark a buffer as dirty.&lt;/li&gt;&#xA;&lt;li&gt;@drew's requires rebinding, which I'd like to avoid.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, what I did is make my own based mostly on @drew's code. It defines a minor mode &lt;code&gt;narrow-reindent-mode&lt;/code&gt; which advises &lt;code&gt;narrow-to-*&lt;/code&gt; and &lt;code&gt;widen&lt;/code&gt; to use &lt;code&gt;indent-rigidly&lt;/code&gt; to perform alignment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full code is ~70 lines so I won't post it here, but it is in &lt;a href=&quot;https://gist.github.com/emallson/4a65592d94885d217b34&quot; rel=&quot;nofollow&quot;&gt;this gist&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The heart of it is &lt;code&gt;narrow-reindent--after-narrow&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun narrow-reindent--after-narrow (&amp;amp;rest _r)&#xA;  &quot;Indent narrowed buffer. This function is used as advice for&#xA;`narrow-to-defun' and friends.&quot;&#xA;  (when narrow-reindent-mode&#xA;    (let ((beg (point-min))&#xA;          (end (point-max)))&#xA;      (setq narrow-reindent--point-min beg)&#xA;      (setq narrow-reindent--point-max end)&#xA;      (setq narrow-reindent--indent-amount (indent-rigidly--current-indentation beg end))&#xA;      (without-undo&#xA;       (indent-rigidly beg end (- narrow-reindent--indent-amount))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works with both &lt;code&gt;narrow-to-defun&lt;/code&gt; and &lt;code&gt;narrow-to-region&lt;/code&gt; (have not tested &lt;code&gt;narrow-to-page&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; This has been turned into a full-fledged package and is available on MELPA and MELPA Stable as &lt;code&gt;narrow-reindent&lt;/code&gt;. The current repository is &lt;a href=&quot;https://github.com/emallson/narrow-reindent.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="147" LastEditDate="2015-07-23T16:17:14.230" LastActivityDate="2015-07-23T16:17:14.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12634" PostTypeId="2" ParentId="12624" CreationDate="2015-05-22T22:10:16.010" Score="5" Body="&lt;p&gt;I guess the simplest way is to define a macro in your orgmode file with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: abbr @@html:&amp;lt;abbr title=&quot;$1&quot;&amp;gt;$2&amp;lt;/abbr&amp;gt;@@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then add an abbr in your text with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{{{abbr(Definition, abbreviation)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is probably the better solution: Add a special tag for abbr:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-export-abbr (backend)&#xA;  &quot;Replace {abbreviation|description} to &amp;lt;abbr&amp;gt; html text in&#xA;current buffer&quot;&#xA;  (when (equal backend 'html)&#xA;    (save-excursion&#xA;      (beginning-of-buffer)&#xA;      (replace-regexp &quot;{\\(.*?\\)|\\(.*?\\)}&quot;&#xA;                      &quot;@@html:&amp;lt;abbr title=\&quot;\\2\&quot;&amp;gt;\\1&amp;lt;/abbr&amp;gt;@@&quot;))))&#xA;&#xA;(add-hook 'org-export-before-parsing-hook 'org-export-abbr)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will replace occurence of {abbreviation|description} into an abbr tag on HTML export.&lt;/p&gt;&#xA;" OwnerUserId="5243" LastEditorUserId="5243" LastEditDate="2015-05-22T23:31:57.440" LastActivityDate="2015-05-22T23:31:57.440" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12635" PostTypeId="1" CreationDate="2015-05-22T22:57:13.607" Score="1" ViewCount="97" Body="&lt;p&gt;I use&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-view-program-list (quote ((&quot;Emacs&quot; &quot;emacsclient -e '(split-window-horizontally 88) 'emacsclient -e '(other-window 1)'; emacsclient %o;&quot;))))&#xA;(setq TeX-view-program-selection (quote (((output-dvi style-pstricks) &quot;dvips and gv&quot;) (output-dvi &quot;xdvi&quot;) (output-html &quot;xdg-open&quot;) (output-pdf &quot;Emacs&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to view the pdf files in a split window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to extend the first command a little bit (right now it splits the window, changes to the other window and opens the pdf file there)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The split command leaves the new (pdf) buffer active, but I would like to have the original one active.&lt;/li&gt;&#xA;&lt;li&gt;I would like to sync the position in the source file with the pdf file.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I can do this by hand by calling &lt;code&gt;other window&lt;/code&gt; and &lt;code&gt;pdf-sync-forward-search&lt;/code&gt; right after the latex view command, but I am sure this can be done automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to add &lt;code&gt;emacsclient -e '(other-window 1)'&lt;/code&gt;, but it looks like I don't quite understand how the commands work.&lt;/p&gt;&#xA;" OwnerUserId="5367" LastEditorUserId="5243" LastEditDate="2015-05-22T23:55:26.910" LastActivityDate="2015-05-22T23:55:26.910" Title="Add commands after custom LaTeX split window view" Tags="|latex|window|emacsclient|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12636" PostTypeId="2" ParentId="12608" CreationDate="2015-05-22T23:37:19.590" Score="2" Body="&lt;p&gt;Never mind, I found the root of the problem. if you set variable Projectile Mode Line in customize or edit the variable directly in the emacs configuration file to nil, both the lighter and the [project-name] disappear.&lt;/p&gt;&#xA;" OwnerUserId="8385" LastActivityDate="2015-05-22T23:37:19.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12637" PostTypeId="1" AcceptedAnswerId="12642" CreationDate="2015-05-22T23:56:25.870" Score="1" ViewCount="235" Body="&lt;p&gt;There is an annoying quirk of my minibuffer.  Can you help me trace its origin?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typing into the minibuffer causes it to instantaneously resize to 2 or 3 lines in height, and then back to 1 line.  It happens far too quickly to take a screenshot.  Best guess is it is a side effect of minibuffer autocompletion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do minor modes in other buffers, like Yas and AC, apply to the minibuffer?  I thought not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time!&lt;/p&gt;&#xA;" OwnerUserId="6682" LastActivityDate="2015-05-23T02:08:41.613" Title="minibuffer resizes while typing into minibuffer" Tags="|minibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12638" PostTypeId="1" CreationDate="2015-05-23T00:30:17.977" Score="4" ViewCount="2148" Body="&lt;p&gt;When I open a file with emacsclient without invoking -c, Emacs visits the file in a new buffer in the background while leaving my current window configuration in place.  I'd like to change this, e.g. to open the file in whichever buffer is currently active.  &lt;/p&gt;&#xA;" OwnerUserId="8363" LastActivityDate="2015-05-23T00:30:17.977" Title="When using emacsclient, how can I open the file in the active buffer?" Tags="|buffers|window|hooks|files|emacsclient|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12639" PostTypeId="1" CreationDate="2015-05-23T01:09:33.477" Score="1" ViewCount="143" Body="&lt;p&gt;In Emacs 24.3.1, I upgraded Mediawiki package to the latest version, 20150403...,  using the package manager.  After restarting, I found that I can't access remote Mediawiki sites any more, after inputting user name and password as usual, I got a&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: listp, 0 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;error in the mini buffer.  Anybody else?  Any idea how to fix it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I get in a backtrace buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp 0)&#xA;  mediawiki-page-get-revision((page ((pageid . &quot;1&quot;) (ns . &quot;0&quot;) (title . &quot;Main Page&quot;) (contentmodel . &quot;wikitext&quot;) (pagelanguage . &quot;en&quot;) (touched . &quot;2014-03-12T04:57:54Z&quot;) (lastrevid . &quot;505&quot;) (counter . &quot;2691&quot;) (length . &quot;141&quot;) (starttimestamp . &quot;2015-05-29T07:52:26Z&quot;) (edittoken . &quot;b3b54027c1c571738764f73dee1e4abd+\\&quot;)) (revisions nil (rev ((revid . &quot;505&quot;) (parentid . &quot;454&quot;) (user . &quot;XXX&quot;) (timestamp . &quot;2014-03-12T04:57:54Z&quot;) (comment . &quot;&quot;) (contentformat . &quot;text/x-wiki&quot;) (contentmodel . &quot;wikitext&quot;) (xml:space . &quot;preserve&quot;)) &quot;Main page.&quot;))) 0 timestamp)&#xA;  mediawiki-save-metadata(&quot;1&quot; (page ((pageid . &quot;1&quot;) (ns . &quot;0&quot;) (title . &quot;Main Page&quot;) (contentmodel . &quot;wikitext&quot;) (pagelanguage . &quot;en&quot;) (touched . &quot;2014-03-12T04:57:54Z&quot;) (lastrevid . &quot;505&quot;) (counter . &quot;2691&quot;) (length . &quot;141&quot;) (starttimestamp . &quot;2015-05-29T07:52:26Z&quot;) (edittoken . &quot;b3b54027c1c571738764f73dee1e4abd+\\&quot;)) (revisions nil (rev ((revid . &quot;505&quot;) (parentid . &quot;454&quot;) (user . &quot;XXX&quot;) (timestamp . &quot;2014-03-12T04:57:54Z&quot;) (comment . &quot;&quot;) (contentformat . &quot;text/x-wiki&quot;) (contentmodel . &quot;wikitext&quot;) (xml:space . &quot;preserve&quot;)) &quot;Main page.&quot;))))&#xA;  mediawiki-get(&quot;1&quot; &quot;Main Page&quot;)&#xA;  mediawiki-edit(&quot;1&quot; &quot;Main_Page&quot;)&#xA;  mediawiki-site()&#xA;  call-interactively(mediawiki-site record nil)&#xA;  command-execute(mediawiki-site record)&#xA;  execute-extended-command(nil &quot;mediawiki-site&quot;)&#xA;  call-interactively(execute-extended-command nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8396" LastEditorUserId="8396" LastEditDate="2015-05-29T07:55:51.570" LastActivityDate="2015-06-21T16:13:39.380" Title="Mediawiki mode stopped working after upgrading to the latest 20150403" Tags="|package|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12640" PostTypeId="1" AcceptedAnswerId="12641" CreationDate="2015-05-23T01:11:21.337" Score="3" ViewCount="545" Body="&lt;p&gt;I don't know how to display in the mode line a character count for the line I'm currently editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried searching on Google, but nothing came up, only for the whole document or for a selection.  I wanted it to count on its own without need for a manual selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to do it?&lt;/p&gt;&#xA;" OwnerUserId="8395" LastActivityDate="2015-05-23T02:04:59.103" Title="Show character count for the current line on mode line" Tags="|mode-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12641" PostTypeId="2" ParentId="12640" CreationDate="2015-05-23T02:04:59.103" Score="3" Body="&lt;p&gt;Here's one simple way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq global-mode-string&#xA;      '(:eval (format &quot;%d chars&quot; (- (line-end-position) (line-beginning-position)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-23T02:04:59.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12642" PostTypeId="2" ParentId="12637" CreationDate="2015-05-23T02:08:41.613" Score="1" Body="&lt;p&gt;Set &lt;code&gt;resize-mini-windows&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq resize-mini-windows nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also customize option &lt;code&gt;max-mini-window-height&lt;/code&gt;, to let it resize but limit how much it grows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-Edit.html&quot; rel=&quot;nofollow&quot;&gt;Minibuffer Edit&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-23T02:08:41.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12643" PostTypeId="1" AcceptedAnswerId="12644" CreationDate="2015-05-23T05:36:56.977" Score="4" ViewCount="1069" Body="&lt;p&gt;I have not done much with abbrev-mode or yasnippet, but I recently started using AucTex mode with great success, and I think some common TeX markup I'm inputting could benefit from expansion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Type &lt;code&gt;dots&lt;/code&gt; and get &lt;code&gt;\dots{}&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;txt&lt;/code&gt; and get &lt;code&gt;\textit{}&lt;/code&gt; (with cursor between the brackets)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm a beginner user, and abbrev-mode looks easier. However, I am not sure if it has the funcionality I'm looking for. If it must be Yasnippet, could someone advise on a good tutorial aimed at beginners?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&#xA;steven arntson&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2015-05-23T06:28:35.090" Title="abbrev vs yasnippet for this use case" Tags="|yasnippet|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12644" PostTypeId="2" ParentId="12643" CreationDate="2015-05-23T06:20:49.897" Score="8" Body="&lt;p&gt;I'd use yasnippet for this, especially because of the desired cursor&#xA;placement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first snippet could be something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: dots&#xA;# key: dots&#xA;# --&#xA;\dots{$0}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should store this file in a directory named &lt;code&gt;latex-mode&lt;/code&gt; under a&#xA;directory that is listed in &lt;code&gt;yas-snippet-dirs&lt;/code&gt;.  I think the&#xA;&lt;a href=&quot;http://capitaomorte.github.io/yasnippet/&quot;&gt;official documentation&lt;/a&gt; is&#xA;probably the best place to look for more information, but perhaps that's because I haven't actively looked for other information or tutorials.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-05-23T06:28:35.090" LastActivityDate="2015-05-23T06:28:35.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12645" PostTypeId="2" ParentId="12628" CreationDate="2015-05-23T06:46:34.737" Score="4" Body="&lt;p&gt;You're looking for the commands &lt;code&gt;comint-previous-matching-input-from-input&lt;/code&gt; and &lt;code&gt;comint-next-matching-input-from-input&lt;/code&gt;, which by default are bound to &lt;kbd&gt;C-c M-r&lt;/kbd&gt; and &lt;kbd&gt;C-c M-s&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend binding these command to M-p and M-n, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'comint&#xA;  '(progn&#xA;     ;; originally on C-c M-r and C-c M-s&#xA;     (define-key comint-mode-map (kbd &quot;M-p&quot;) #'comint-previous-matching-input-from-input)&#xA;     (define-key comint-mode-map (kbd &quot;M-n&quot;) #'comint-next-matching-input-from-input)&#xA;     ;; originally on M-p and M-n&#xA;     (define-key comint-mode-map (kbd &quot;C-c M-r&quot;) #'comint-previous-input)&#xA;     (define-key comint-mode-map (kbd &quot;C-c M-s&quot;) #'comint-next-input)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should work for any mode the derives from &lt;code&gt;comint-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-05-23T06:46:34.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12646" PostTypeId="1" AcceptedAnswerId="12647" CreationDate="2015-05-23T07:45:25.887" Score="3" ViewCount="271" Body="&lt;p&gt;I am trying to move from Sublime to Emacs. (Because free and all that.) One thing that I miss is the convenient text expansion available by default in Sublime where it picks up similar strings in the same buffer and makes it easy to select a proper expansion. I am sure this is possible in emacs also but haven't figured out how yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start typing on a string that is already present in the buffer I would like to be able to expand using a shortcut like Ctrl-Space, Alt-Enter or something like that. How do I set this up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus question. How to find expansion candidates in other buffers also as a secondary option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: tried out dabbrev and it seems to be what sublime does. I sense that the step to move on towards more dynamic completions isn't that far away but I will leave it for now. I bound M-RET to M-/ with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-RET&quot;) 'dabbrev-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Why I don't like M-/? Because on a swedish keyboard it comes with a Shift. / is Shift-7.....)&lt;/p&gt;&#xA;" OwnerUserId="8397" LastEditorUserId="105" LastEditDate="2015-05-29T21:46:54.950" LastActivityDate="2015-05-29T21:46:54.950" Title="Equivalent of Sublimes text expansion" Tags="|completion|text-editing|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12647" PostTypeId="2" ParentId="12646" CreationDate="2015-05-23T08:04:03.107" Score="10" Body="&lt;p&gt;Try using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Dynamic-Abbrevs.html#Dynamic-Abbrevs&quot;&gt;dabbrev&lt;/a&gt; with &lt;code&gt;M-/&lt;/code&gt;, it expands strings from the same and other buffers inline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more powerful alternative you can customize with your own functions is &lt;a href=&quot;http://www.emacswiki.org/emacs/HippieExpand&quot;&gt;hippie-expand&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-05-23T08:04:03.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12649" PostTypeId="1" CreationDate="2015-05-23T12:25:23.693" Score="3" ViewCount="479" Body="&lt;p&gt;In Emacs 24, the function &lt;code&gt;system-name&lt;/code&gt; returns an &lt;a href=&quot;http://en.wikipedia.org/wiki/Fully_qualified_domain_name&quot; rel=&quot;nofollow&quot;&gt;FQDN&lt;/a&gt;.  In Emacs 25, &lt;code&gt;system-name&lt;/code&gt; returns just the host name, and there doesn't seem to be a good way to get the FQDN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get an FQDN portably across Emacs versions?&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2016-04-29T14:47:16.807" LastActivityDate="2017-04-16T22:09:06.067" Title="Local host's FQDN in Emacs 25?" Tags="|elisp|networking|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12650" PostTypeId="1" AcceptedAnswerId="12651" CreationDate="2015-05-23T12:30:42.083" Score="2" ViewCount="359" Body="&lt;p&gt;How can I bind &lt;kbd&gt;C-x C-f&lt;/kbd&gt; to invoke &lt;code&gt;projectile-find-file&lt;/code&gt; when inside a project, and &lt;code&gt;ido-find-file&lt;/code&gt; when not in a project?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="105" LastEditDate="2017-05-16T22:37:41.697" LastActivityDate="2017-05-16T22:37:41.697" Title="Have `projectile-find-file` fall back to `ido-find-file` outside of projects" Tags="|projectile|ido|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12651" PostTypeId="2" ParentId="12650" CreationDate="2015-05-23T14:01:14.840" Score="7" Body="&lt;p&gt;Write your own command that checks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun maybe-projectile-find-file ()&#xA;  (interactive)&#xA;  (call-interactively&#xA;   (if (projectile-project-p)&#xA;       #'projectile-find-file&#xA;       #'ido-find-file)))&#xA;&#xA;(global-set-key (kbd &quot;C-x C-f&quot;) 'maybe-projectile-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2223" LastEditDate="2015-05-24T00:16:21.283" LastActivityDate="2015-05-24T00:16:21.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12652" PostTypeId="2" ParentId="12649" CreationDate="2015-05-23T14:31:07.967" Score="5" Body="&lt;p&gt;Emacs used to try and set &lt;code&gt;system-name&lt;/code&gt; to an FQDN.  This has caused a fair bit of bug-reports and frustration over the years, since it caused Emacs to sometimes hang for somewhere between 30s and 2min at startup in case of a &quot;misconfigured&quot; DNS setup.  Things have gotten worse nowadays since in many common situations (e.g. machine behind NAT) it's almost impossible to find such an FQDN, and it can change at any time during the Emacs session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in Emacs-25 we decided to stop trying.  This is also indirectly the answer to your question: no, we don't know how to get an FQDN portably, so we don't try to find an FQDN any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For those situations where you do need an FQDN, you will generally have some extra knowledge about your machine's config which will make it possible for you to find the FQDN and/or to write a little chunk of code which can find this FQDN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One easy way (in some situations) might be to change the machine's &lt;code&gt;localname&lt;/code&gt; to be this FQDN (so Emacs's &lt;code&gt;system-name&lt;/code&gt; will again be an FQDN).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-05-23T14:57:53.613" LastActivityDate="2015-05-23T14:57:53.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12653" PostTypeId="1" CreationDate="2015-05-23T15:50:59.353" Score="3" ViewCount="1441" Body="&lt;p&gt;EDIT: Now I can see the error only happens if I include certain code to do an automatic push, adopted from &lt;a href=&quot;https://gist.github.com/3111823&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/3111823&lt;/a&gt;. It seems that this block of code wants to use org-mobile-files-alist while it hasn't been initialized, because &lt;code&gt;'org&lt;/code&gt; is set to have an async loading by default. No matter whether I put the code in &lt;code&gt;init&lt;/code&gt; or &lt;code&gt;config&lt;/code&gt; when I require &lt;code&gt;'org&lt;/code&gt;, it doesn't seem to recognize the variable. Another person seems to be encountering the same error, using the auto-push code below, as seen on github.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately if I put the code after &lt;code&gt;(package-initialize)&lt;/code&gt; it doesn't seem to run at all(i.e. no automatic push no matter what).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code to do automatic push:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;  ;; https://gist.github.com/3111823 ASYNC org mobile push...&#xA;(require 'gnus-async) &#xA;;; Define a timer variable&#xA;(defvar org-mobile-push-timer nil&#xA;  &quot;Timer that `org-mobile-push-timer' used to reschedule itself, or nil.&quot;)&#xA;;; Push to mobile when the idle timer runs out&#xA;(defun org-mobile-push-with-delay (secs)&#xA;  (when org-mobile-push-timer&#xA;    (cancel-timer org-mobile-push-timer))&#xA;  (setq org-mobile-push-timer&#xA;        (run-with-idle-timer&#xA;        (* 1 secs) nil 'org-mobile-push)))&#xA;;; After saving files, start an idle timer after which we are going to push &#xA;(add-hook 'after-save-hook &#xA;(lambda () &#xA;  (if (or (eq major-mode 'org-mode) (eq major-mode 'org-agenda-mode))&#xA;    (dolist (file (org-mobile-files-alist))&#xA;      (if (string= (expand-file-name (car file)) (buffer-file-name))&#xA;          (org-mobile-push-with-delay 25)))&#xA;    )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code to initialize org mode asynchronously:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;(package-initialize)&#xA;(require 'org)&#xA;(require 'ox)&#xA;(require 'ox-beamer)&#xA;(require 'ox-latex)&#xA;(setq org-export-async-debug nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm new to Emacs and I'm actually using a starter kit called &lt;code&gt;spacemacs&lt;/code&gt;. So I'm not sure how to fix this problem even after two hours' of trying...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm seeing the error &lt;code&gt;Symbol's function definition is void: org-mobile-files-alist&lt;/code&gt; when performing certain operations. Strangely, the error doesn't occur again &lt;em&gt;after&lt;/em&gt; I execute &lt;code&gt;org-mobile-push&lt;/code&gt; or &lt;code&gt;org-mobile-pull&lt;/code&gt; at least once. The nuisance is that it doesn't seem to only influence &lt;code&gt;org mobile&lt;/code&gt; itself, but also interferes with other functionalities such as archiving. Now whenever I run &lt;code&gt;C-c C-x C-a&lt;/code&gt; I'll get this error and the entry will &lt;em&gt;not&lt;/em&gt; be removed from its original &lt;code&gt;.org&lt;/code&gt; file, &lt;strong&gt;although&lt;/strong&gt; it indeed does get archived into the &lt;code&gt;.org_archive&lt;/code&gt; file. Thus if I try to archive multiple times, the entry gets repeated in the &lt;code&gt;.org_archive&lt;/code&gt; file but it still remains in the original file. It seems that the process of removing the entry and then saving the file gets interrupted by this error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Copied: Subtree(s) with 262 characters&#xA;Saving file /Users/JX/Dropbox/orgmode/Personal.org_archive...&#xA;Wrote /Users/JX/Dropbox/orgmode/Personal.org_archive&#xA;let: Symbol's function definition is void: org-mobile-files-alist&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I already set my &lt;code&gt;org-mobile-files&lt;/code&gt; variable. However it seems that for some reasons it doesn't get picked up &lt;em&gt;until&lt;/em&gt; I execute &lt;code&gt;org-mobile-push&lt;/code&gt; or &lt;code&gt;org-mobile-pull&lt;/code&gt; manually.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-mobile-directory &quot;/Users/JX/Dropbox/MobileOrg&quot;&#xA;org-mobile-files (quote (org-agenda-files))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="7097" LastEditDate="2015-05-23T18:23:44.717" LastActivityDate="2015-05-23T18:23:44.717" Title="Symbol's function definition is void: org-mobile-files-alist" Tags="|org-mode|mobileorg|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12654" PostTypeId="2" ParentId="12653" CreationDate="2015-05-23T16:07:15.917" Score="1" Body="&lt;p&gt;Sounds like you need to &lt;code&gt;require&lt;/code&gt; the library in which &lt;code&gt;org-mobile-files-alist&lt;/code&gt; is defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that it is defined after you use &lt;code&gt;org-mobile-push&lt;/code&gt; or &lt;code&gt;org-mobile-pull&lt;/code&gt; is no doubt because those are autoloaded.  IOW when you try to use them Emacs automatically loads the library that defines them, and that has the result of defining &lt;code&gt;org-mobile-files-alist&lt;/code&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If you are using the package system to load such code, instead of, say, putting the code in your &lt;code&gt;load-path&lt;/code&gt; and using &lt;code&gt;require&lt;/code&gt;, then be sure you use &lt;code&gt;package-initialize&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-23T16:07:15.917" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12655" PostTypeId="2" ParentId="12646" CreationDate="2015-05-23T16:16:51.760" Score="2" Body="&lt;p&gt;@wasamusa provided the usual (and good) answer: use dabbrev.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another answer is to use &lt;strong&gt;dynamic completion mode&lt;/strong&gt;, provided by library &lt;code&gt;completion.el&lt;/code&gt;.  This is a very old, but still useful, library that is (still) included as part of Emacs.  The only doc for it is in the file commentary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information about dynamic completion mode (similar Q&amp;amp;A, from StackOverflow):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/28143563/729907&quot;&gt;https://stackoverflow.com/a/28143563/729907&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/25627343/729907&quot;&gt;https://stackoverflow.com/a/25627343/729907&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-05-23T16:16:51.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12656" PostTypeId="1" AcceptedAnswerId="12657" CreationDate="2015-05-23T16:22:20.670" Score="3" ViewCount="817" Body="&lt;p&gt;is it possible to let helm complete the current file name in helm-dired-do-rename? &#xA;It is not convenient if I need to type in a long name only to change a part of it.&#xA;Thank you for your help!&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="2223" LastEditDate="2015-05-23T18:43:29.103" LastActivityDate="2015-05-27T03:04:57.150" Title="how to complete the original name in helm dired rename" Tags="|helm|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12657" PostTypeId="2" ParentId="12656" CreationDate="2015-05-23T16:34:36.140" Score="1" Body="&lt;p&gt;You can navigate to that file, execute persistent actdion (default is &lt;code&gt;C-z&lt;/code&gt;) to complete it, then start modifying.&lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2015-05-23T16:34:36.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12658" PostTypeId="1" AcceptedAnswerId="12717" CreationDate="2015-05-23T17:02:00.887" Score="3" ViewCount="351" Body="&lt;p&gt;Writing Greek in emacs is proving to be quite inconvenient. If my keyboard is set to Greek, normal shortcuts do not work and I have to switch to latin just to navigate around the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, let's say I'm writing a Greek sentence and I want to go back a character to fix a mistake. The usual way is to press C-b, but because my keyboard is set to Greek, emacs actually receives C-β and gives me an error: &quot;C-β is undefined&quot;. What I have to do next is press alt-shift to switch to latin, enter C-b again, and switch to Greek once again with alt-shift. Quite a hassle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way around this? I could, of course, map C-β to do what C-b does, but I'd have to do that for hundreds of shortcuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It'd be nice if the solution worked for evil-mode, too.&lt;/p&gt;&#xA;" OwnerUserId="8403" LastEditorUserId="105" LastEditDate="2015-05-29T21:46:07.183" LastActivityDate="2015-05-29T21:46:07.183" Title="Executing emacs shortcuts when keyboard is set to Greek" Tags="|key-bindings|evil|text-editing|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12659" PostTypeId="2" ParentId="12632" CreationDate="2015-05-23T18:08:50.657" Score="2" Body="&lt;p&gt;The &lt;code&gt;-*- lexical-binding: t; -*-&lt;/code&gt; only takes effect when you open the file.  So after adding it, you need to re-open the file otherwise your buffer is still in dynamic-binding mode.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-05-23T18:08:50.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12660" PostTypeId="1" AcceptedAnswerId="13542" CreationDate="2015-05-23T20:28:41.160" Score="1" ViewCount="424" Body="&lt;p&gt;When I launch ERC or org2blog I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;dbus-call-method: peculiar error: &quot;Emacs not compiled with dbus&#xA;  support&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've been trying to run down this error for weeks. How do I find out where dbus is called from? And how can I make it a non-blocking error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if you need more information, other than this is happening on 24.4+.&lt;/p&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2015-10-27T17:24:10.580" Title="Peculiar Error triggered when calling ERC, org2blog from Windows, OS X" Tags="|erc|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12661" PostTypeId="1" CreationDate="2015-05-23T21:15:31.240" Score="1" ViewCount="148" Body="&lt;p&gt;I want to change the shebang string every time I create a new Python file, some projects use Python 2 and other use Python 3, so the shebang should change according to the value of a variable in the &lt;code&gt;.dir-locals.el&lt;/code&gt; file of the project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To generate the header text I use header2.el. There is the code I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar-local shackra:var-python-ver 2&#xA;    &quot;Indica que versión de Python estamos usando, Python2 o Python3&quot;)&#xA;(put 'shackra:var-python-ver 'safe-local-variable-values #'integerp)&#xA;&#xA;;; configuración basica para python-mode y elpy-mode&#xA;(setf python-indent-guess-indent-offset nil&#xA;    python-indent 4&#xA;    python-indent-offset 4&#xA;    elpy-modules '(elpy-module-company&#xA;        elpy-module-eldoc&#xA;        elpy-module-pyvenv&#xA;        elpy-module-yasnippet)&#xA;    elpy-rpc-backend &quot;jedi&quot;)&#xA;&#xA;;; habilita elpy&#xA;(elpy-enable)&#xA;&#xA;(defun shackra:python-switch-python-version ()&#xA;    &quot;Cambia entre (i)Python2 o (i)Python3 dependiendo de ciertas variables&quot;&#xA;    (if (eq shackra:var-python-ver 2)&#xA;        (setf elpy-rpc-python-command &quot;python2&quot;&#xA;            elpy-interactive-python-command &quot;ipython2&quot;))&#xA;        (setf elpy-rpc-python-command &quot;python3&quot;&#xA;        elpy-interactive-python-command &quot;ipython&quot;))&#xA;&#xA;(defun shackra:header-python-shebang-coding ()&#xA;    &quot;Inserta los famosos shebang (#!) y “coding”&quot;&#xA;    (if (eq shackra:var-python-ver 2)&#xA;        (insert &quot;#!/usr/bin/python2\n&quot;)&#xA;    (insert &quot;#!/usr/bin/python3\n&quot;))&#xA;    (insert header-prefix-string &quot;-*- coding: utf-8 -*-\n\n&quot;))&#xA;&#xA;(add-hook 'python-mode-hook (lambda ()&#xA;    (electric-indent-local-mode -1)&#xA;    (shackra:python-switch-python-version)&#xA;    (setf make-header-hook '(shackra:header-python-shebang-coding))&#xA;    (auto-make-header)&#xA;    (py-autopep8-enable-on-save)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the content of a &lt;code&gt;.dirs-locals.el&lt;/code&gt; for a directory is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((python-mode&#xA;    (shackra:var-python-ver . 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My configuration changes correctly in &lt;code&gt;(shackra:python-switch-python-version)&lt;/code&gt;, however, &lt;code&gt;(shackra:header-python-shebang-coding)&lt;/code&gt; inserts the string &lt;code&gt;#!/usr/bin/python2&lt;/code&gt; when creating a new Python file inside that directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does this happens and how can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-06-24T12:15:00.013" Title="My function seems to not know a variable has changed and gives the wrong output" Tags="|elisp|functions|variables|local-variables|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12662" PostTypeId="1" CreationDate="2015-05-24T01:33:30.373" Score="7" ViewCount="1232" Body="&lt;p&gt;I've set up MPD, and it's definitely running and indexing everything correctly. I followed the instructions &lt;a href=&quot;https://www.gnu.org/software/emms/manual/Music-Player-Daemon.html&quot;&gt;here&lt;/a&gt; to set up EMMS to work with MPD, and after running &lt;code&gt;M-x emms-cache-set-from-mpd-all&lt;/code&gt;, it indexed the right number of tracks, and connecting via &lt;code&gt;emms-player-connect&lt;/code&gt; seems to work without error. However, when I call &lt;code&gt;M-x emms&lt;/code&gt;, all I see is an empty window. What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, this is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;Media&#xA;(require 'emms-player-mpd)&#xA;(require 'emms-setup)&#xA;(emms-standard)&#xA;(emms-default-players)&#xA;(setq emms-player-mpd-server-name &quot;localhost&quot;)&#xA;(setq emms-player-mpd-server-port &quot;6600&quot;)&#xA;(add-to-list 'emms-player-list 'emms-player-mpd)&#xA;(add-to-list 'emms-info-functions 'emms-info-mpd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="561" LastActivityDate="2024-03-04T20:05:15.673" Title="EMMS doesn't seem to see anything from MPD" Tags="|emms|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12663" PostTypeId="1" AcceptedAnswerId="12664" CreationDate="2015-05-24T02:10:00.913" Score="2" ViewCount="96" Body="&lt;p&gt;I'm looking at the magit source code, and there's this &lt;code&gt;make-magit-section&lt;/code&gt; function that doesn't seem to found anywhere in the project (grep doesn't return any results). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;describe-function&lt;/code&gt; says that it's defined in &lt;code&gt;magit.el&lt;/code&gt; and that it has a compiler macro &lt;code&gt;make-magit-section--cmacro&lt;/code&gt;. This macro has no results in grep as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the one place it is being used in the magit repo &lt;a href=&quot;https://github.com/magit/magit/blob/next/magit-section.el#L635&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magit/magit/blob/next/magit-section.el#L635&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where could this function be defined?&lt;/p&gt;&#xA;" OwnerUserId="251" LastEditorUserId="50" LastEditDate="2015-05-29T23:51:26.730" LastActivityDate="2015-05-29T23:51:26.730" Title="Where is this `make-magit-section` function defined?" Tags="|magit|functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12664" PostTypeId="2" ParentId="12663" CreationDate="2015-05-24T03:16:03.943" Score="3" Body="&lt;p&gt;It is defined using &lt;code&gt;cl-defstruct&lt;/code&gt; (&lt;a href=&quot;https://github.com/magit/magit/blob/3026b56182c767e16f57707d440a680b60fc337a/magit-section.el#L108&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-05-24T03:16:03.943" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12665" PostTypeId="5" CreationDate="2015-05-24T08:38:00.217" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-05-24T08:38:00.217" LastActivityDate="2015-05-24T08:38:00.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12666" PostTypeId="4" CreationDate="2015-05-24T08:38:00.217" Score="0" Body="Prelude is an enhanced Emacs configuration that should make your experience with Emacs both more pleasant and more powerful." OwnerUserId="5472" LastEditorUserId="5472" LastEditDate="2015-05-24T16:12:20.020" LastActivityDate="2015-05-24T16:12:20.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12667" PostTypeId="2" ParentId="2427" CreationDate="2015-05-24T08:53:57.630" Score="6" Body="&lt;p&gt;I wrote httprepl for exactly this purpose. It gives you a comint-based repl where you can issue http requests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/gregsexton/httprepl.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/gregsexton/httprepl.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily add functions that consume the result of requests. These are usually used for pretty printing etc but parsing to an elisp structure should be simple using the builtin json library.&lt;/p&gt;&#xA;" OwnerUserId="7151" LastActivityDate="2015-05-24T08:53:57.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12668" PostTypeId="1" AcceptedAnswerId="12678" CreationDate="2015-05-24T08:56:12.620" Score="1" ViewCount="625" Body="&lt;p&gt;I'm refactoring my config from a monolithic init file (a .org that is tangled) to something more modular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the same time, I am trying out &lt;em&gt;Prelude&lt;/em&gt; and &lt;em&gt;Spacemacs&lt;/em&gt;, and I feeling it very likely to use both of them in different context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result I am trying to find a &lt;strong&gt;way to dispatch and structure my original init file in a way that can be easily plugged into both Prelude and Spacemacs&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The Spacemacs way uses pushes to create (private) configuration layers. But I'm not sure I could find a way to use them in Prelude. (and I'm not fond of dispatching, dep, function, keybindings into different files)&lt;/li&gt;&#xA;&lt;li&gt;The Prelude way puts different &lt;em&gt;modules&lt;/em&gt; into dedicated files, which you place in folder &lt;code&gt;personal&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I do this? Has someone already tried?&lt;/p&gt;&#xA;" OwnerUserId="5472" LastEditorUserId="105" LastEditDate="2015-05-24T21:16:25.627" LastActivityDate="2015-05-25T03:08:30.280" Title="Make a monolithic personal config compatible with Prelude and Spacemacs" Tags="|init-file|spacemacs|prelude|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12670" PostTypeId="1" AcceptedAnswerId="12674" CreationDate="2015-05-24T10:38:33.470" Score="1" ViewCount="365" Body="&lt;p&gt;I have an open buffer with major mode &lt;code&gt;ansi-term&lt;/code&gt;, and with scrollback. This buffer has crashed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to &quot;recycle&quot; the buffer into a new &lt;code&gt;ansi-term&lt;/code&gt; such that scrollback is kept. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="8405" LastActivityDate="2015-05-24T17:07:02.023" Title="How can I restart an ansi-term buffer?" Tags="|ansi-term|process|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12671" PostTypeId="2" ParentId="12470" CreationDate="2015-05-24T16:19:24.403" Score="0" Body="&lt;p&gt;I was never able to figure out exactly what caused the issue. I suspect some incompatibility in the OpenSUSE repo for Emacs 24.3 (the most up-to-date version there right now). I instead downloaded the most recent release (24.5) from gnu.org and compiled it myself. I haven't seen any error messages since then.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-05-24T16:19:24.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12672" PostTypeId="2" ParentId="4260" CreationDate="2015-05-24T16:27:52.990" Score="2" Body="&lt;p&gt;The following is more like a comment since&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it solves only to a small part of the problem (&lt;code&gt;rainbow-delimiters-mode&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;it is not thoroughly tested (just with one latex-file)&lt;/li&gt;&#xA;&lt;li&gt;I do not completely understand why it works (&lt;code&gt;font-lock-mode&lt;/code&gt; is really quite a complicated machinery)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At first the solution for &lt;code&gt;rainbow-delimiters-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We replace the text property &lt;code&gt;font-lock-face&lt;/code&gt; by &lt;code&gt;face&lt;/code&gt; in &lt;code&gt;rainbow-delimiters-propertize-delimiter&lt;/code&gt; and &lt;code&gt;rainbow-delimiters-unpropertize-delimiter&lt;/code&gt;. Since &lt;code&gt;defsubst&lt;/code&gt; is used in the package instead of &lt;code&gt;defun&lt;/code&gt; we cannot employ &lt;code&gt;defalias&lt;/code&gt; but must modify the functions themselves (as far as I understand it -- please comment if I am wrong in this regard).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modified functions are:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defsubst rainbow-delimiters-propertize-delimiter (loc depth)&#xA;  &quot;Highlight a single delimiter at LOC according to DEPTH.&#xA;&#xA;LOC is the location of the character to add text properties to.&#xA;DEPTH is the nested depth at LOC, which determines the face to use.&#xA;&#xA;Sets text properties:&#xA;`font-lock-face' to the appropriate delimiter face.&#xA;`rear-nonsticky' to prevent color from bleeding into subsequent characters typed by the user.&quot;&#xA;  (with-silent-modifications&#xA;    (let ((delim-face (if (&amp;lt;= depth 0)&#xA;                          'rainbow-delimiters-unmatched-face&#xA;                        (rainbow-delimiters-depth-face depth))))&#xA;      ;; (when (eq depth -1) (message &quot;Unmatched delimiter at char %s.&quot; loc))&#xA;      (add-text-properties loc (1+ loc)&#xA;               ;; 2015-05-24: Changed font-lock-face to face to enable rainbow after syntax fontification in latex-mode&#xA;               ;; (see http://emacs.stackexchange.com/questions/4260/how-to-get-rainbow-delimiters-rainbow-blocks-to-highlight-in-line-math-in-latex)&#xA;                           `(face ,delim-face&#xA;                             rear-nonsticky t)))))&#xA;&#xA;&#xA;(defsubst rainbow-delimiters-unpropertize-delimiter (loc)&#xA;  &quot;Remove text properties set by rainbow-delimiters mode from char at LOC.&quot;&#xA;  (with-silent-modifications&#xA;    (remove-text-properties loc (1+ loc)&#xA;                ;; 2015-05-24: See corresponding line in `rainbow-delimiters-propertize-delimiter'.&#xA;                            '(face nil&#xA;                              rear-nonsticky nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the reasoning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The embedded formulas between the $-delimiters are syntax fontified by font-lock-mode (as already Kirill pointed out). The registration of this fontification looks normal (see variable &lt;code&gt;font-lock-syntactic-face-function&lt;/code&gt; and function &lt;code&gt;font-latex-syntactic-face-function&lt;/code&gt;).&#xA;But &lt;code&gt;describe-char&lt;/code&gt; at the characters of an embedded formula shows that syntactic fontification uses the &lt;code&gt;face&lt;/code&gt;-property instead of the &lt;code&gt;font-lock-face&lt;/code&gt;-property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is hypothetical since I do not completely understand the font-lock machinery which is quite complex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that &lt;code&gt;face&lt;/code&gt; is stronger than &lt;code&gt;font-lock-face&lt;/code&gt;.&#xA;Rainbow-delimiters uses &lt;code&gt;font-lock-face&lt;/code&gt; which is dominated by &lt;code&gt;face&lt;/code&gt; of syntactic fontification.&#xA;Nevertheless, we have the advantage that syntactic fontification comes first before search (keyword) based fontification which in turn uses jit-lock (see info-pages of &lt;code&gt;font-lock-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That leads me to the conclusion that the problem is solved if we use &lt;code&gt;face&lt;/code&gt; in &lt;code&gt;rainbow-delimiters&lt;/code&gt; instead of &lt;code&gt;font-lock-face&lt;/code&gt;.&#xA;And here I do not know the full consequences. But, since &lt;code&gt;rainbow-delimiters&lt;/code&gt; also uses &lt;code&gt;jit-lock&lt;/code&gt; directly (and not through &lt;code&gt;font-lock-mode&lt;/code&gt;) we are standing on a shaky floor anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, that I had already some contact with &lt;code&gt;rainbow-delimiters&lt;/code&gt; (see &lt;a href=&quot;https://stackoverflow.com/questions/19800243/highlight-first-mismatching-paren/20022030#20022030&quot;&gt;https://stackoverflow.com/questions/19800243/highlight-first-mismatching-paren/20022030#20022030&lt;/a&gt;) but not with &lt;code&gt;rainbow-blocks&lt;/code&gt;. Because I have only a limited frame of time I chose to concentrate on &lt;code&gt;rainbow-delimiters&lt;/code&gt;. Maybe, you can solve the &lt;code&gt;rainbow-blocks&lt;/code&gt;-problem in a similar way.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-05-24T16:47:39.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12674" PostTypeId="2" ParentId="12670" CreationDate="2015-05-24T17:07:02.023" Score="1" Body="&lt;p&gt;I exited from an bash shell in ansi-term, and this worked for me to resurrect my terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (make-term &quot;ansi-term&quot; &quot;/bin/bash&quot;) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Credits to wgreenhouse on freenode #emacs irc, though he used &lt;code&gt;zsh&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="591" LastActivityDate="2015-05-24T17:07:02.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12677" PostTypeId="1" CreationDate="2015-05-25T00:39:41.007" Score="1" ViewCount="99" Body="&lt;p&gt;I'm trying to create a formula that modifies overlays on an org-table. I need to figure out the position in the buffer of the cell so I can create an overlay that spans the length of the cell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I figure out the start-pos and end-pos of the cell?&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2015-05-25T09:57:23.560" Title="How can I find the buffer position of an org-mode cell?" Tags="|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12678" PostTypeId="2" ParentId="12668" CreationDate="2015-05-25T03:08:30.280" Score="2" Body="&lt;p&gt;There is no need to dispatch you configuration in Spacemacs, config.el, keybindings.el and funcs.el are facultative. But for now you have to put ELPA packages in &lt;code&gt;packages.el&lt;/code&gt; and extensions (i.e. source code not in an ELPA repo) in extensions.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm no expert with Prelude but here is my guess:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you can match Prelude module and Spacemacs layer.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a module for Prelude with the structure of Spacemacs (that is a list for the packages with the associated init functions), the magic variables of Spacemacs mean nothing to Prelude so Prelude won't trigger any of the configuration.&lt;/li&gt;&#xA;&lt;li&gt;Then find a way to know if you are in Spacemacs or Prelude and when you are in Prelude call all the init function explicitly which in turn will call all the use-package stuff and your config.&lt;/li&gt;&#xA;&lt;li&gt;At last for Spacemacs create a &lt;code&gt;packages.el&lt;/code&gt; with &lt;code&gt;load-file&lt;/code&gt; of your Prelude module which has the structure of a Spacemacs packages.el file.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-05-25T03:08:30.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12679" PostTypeId="1" AcceptedAnswerId="12773" CreationDate="2015-05-25T03:54:05.997" Score="17" ViewCount="2076" Body="&lt;p&gt;There are files like &lt;code&gt;session.10110ac205e127d7e2143131143297155100000021880037&lt;/code&gt; in my &lt;code&gt;.emacs.d&lt;/code&gt; folder. I would like to do something about it but could not figure out what to do.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What are these files for ? &lt;/li&gt;&#xA;&lt;li&gt;Why emacs generate multiple files ? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="165" LastActivityDate="2021-08-17T07:06:53.290" Title="Session files in emacs.d folder" Tags="|session|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12680" PostTypeId="1" CreationDate="2015-05-25T07:04:29.077" Score="1" ViewCount="54" Body="&lt;p&gt;When I play something through LibreFM's web client, I can ask it to love or ban certain tracks. How do I do this in EMMS configured to play music from LibreFM?&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2015-05-31T21:27:38.467" Title="EMMS and LibreFM: How do I tell LibreFM to love or ban tracks?" Tags="|emms|music-player|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12681" PostTypeId="2" ParentId="12677" CreationDate="2015-05-25T08:04:20.337" Score="1" Body="&lt;p&gt;Here's something to get you started&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rasmus/org-cell-pos (row column)&#xA;  &quot;Return cons of and org table cell beginning and end.&#xA;ROW is the line of the cell and COLUMN is the column of cell.&quot;&#xA;  (if (org-at-table-p)&#xA;      (progn&#xA;        (org-table-goto-line row)&#xA;        (org-table-goto-column column)&#xA;        (cons (save-excursion (search-backward &quot;|&quot;)&#xA;                              (1+ (point)))&#xA;              (save-excursion (search-forward &quot;|&quot;)&#xA;                              (1- (point)))))&#xA;    (error &quot;Not at org table&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2015-05-25T08:04:20.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12682" PostTypeId="2" ParentId="12677" CreationDate="2015-05-25T08:08:51.783" Score="2" Body="&lt;p&gt;It is relatively easy to get the beginning and end position of a cell within a tbl-formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* First heading&#xA;  | first column | second column | third column |&#xA;  |--------------+---------------+--------------|&#xA;  |            1 | 139,154       |              |&#xA;  |              | 189,204       |              |&#xA;  #+TBLFM: $2='(progn (org-table-goto-line  @#) (org-table-goto-column  $#) (format &quot;%d,%d&quot; (save-excursion (skip-chars-backward &quot;^|&quot;) (point)) (save-excursion (skip-chars-forward &quot;^|&quot;) (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can check that this delivers the right positions by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(overlay-put (make-overlay 189 204) 'face 'org-warning)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where you have to replace the pair of numbers &lt;code&gt;189 204&lt;/code&gt; with a pair from the second column of the table (after re-calculation of the table).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, I am afraid that this does not help you very much to put overlays on cells. At least the overlays are not very stable:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You have to give the formula a return value and this return value will overwrite the content of the cell (or some cell). So the formula will effect the table aside of putting an overlay over some text.&lt;/li&gt;&#xA;&lt;li&gt;Any formatting of the table such as &lt;kbd&gt;tab&lt;/kbd&gt; will overwrite your manually formatted text of the table.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The following table demonstrates the problems with creating overlays in formulas.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* First heading&#xA;  | first column | second column                   | third column              |&#xA;  |--------------+---------------------------------+---------------------------|&#xA;  |              | Example: cell start 201 end 234 | Superfluous modification. |&#xA;  |              | Example: cell start 282 end 315 | Superfluous modification. |&#xA;  |              | Example: cell start 363 end 396 | Superfluous modification. |&#xA;  #+TBLFM: $2='(save-excursion (org-table-goto-line  @#) (org-table-goto-column $#) (format &quot;Example: cell start %d end %d&quot; (progn (skip-chars-backward &quot;^|&quot;) (point)) (progn (skip-chars-forward &quot;^|&quot;) (point))))::$3='(save-excursion (org-table-goto-line  @#) (org-table-goto-column (1- $#)) (overlay-put (make-overlay (progn (skip-chars-backward &quot;^|&quot;) (point)) (progn (skip-chars-forward &quot;^|&quot;) (point))) 'face 'org-warning) &quot;Superfluous modification.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you switch on formula-debugging and re-calculate the table you will see that the expected overlays are put onto the cells of the second column but removed again when the table is re-formatted at the end of the calculation.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-05-25T09:57:23.560" LastActivityDate="2015-05-25T09:57:23.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12683" PostTypeId="1" AcceptedAnswerId="12802" CreationDate="2015-05-25T09:49:46.260" Score="4" ViewCount="917" Body="&lt;p&gt;I'm trying to use EMMS with mplayer as its backend. So far, everything works fine, but for some reason, EMMS refuses point-blank to play anything with a .flac extension in my playlist. I've checked the regex EMMS uses for mplayer, and .flac is a viable extension for it. What could be causing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, here is my EMMS config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;EMMS&#xA;(require 'emms-setup)&#xA;(require 'emms-streams)&#xA;(require 'emms-librefm-stream)&#xA;(require 'emms-librefm-scrobbler)&#xA;(emms-devel)&#xA;(emms-default-players)&#xA;(setq emms-source-file-default-directory &quot;~/Music/&quot;)&#xA;(setq emms-librefm-scrobbler-username &quot;Chuck_Finley&quot;) ;not my real name&#xA;(setq emms-librefm-scrobbler-password &quot;tequila-miami&quot;) ;not my real password&#xA;(emms-add-directory-tree &quot;~/Music/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="561" LastEditorUserId="115" LastEditDate="2015-05-30T03:43:09.413" LastActivityDate="2015-05-30T13:32:22.103" Title="Why can't EMMS play flac files using the mplayer backend?" Tags="|emms|music-player|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12684" PostTypeId="1" CreationDate="2015-05-25T11:41:22.720" Score="5" ViewCount="163" Body="&lt;p&gt;I'm using &lt;code&gt;pdf-tools&lt;/code&gt; to read PDFs in Emacs, and am pretty happy so far. However, I've found when I modify, and then &lt;code&gt;eval-buffer&lt;/code&gt; my configuration file, the PDFs I opened earlier with &lt;code&gt;pdf-tools&lt;/code&gt; get put back to their first page! This is highly annoying behaviour, and I'm not sure how to fix it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, all the config file contains that relates to pdf-tools is the necessary &lt;code&gt;(pdf-tools-install)&lt;/code&gt; to ensure that it becomes operational.&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2015-05-25T11:41:22.720" Title="Stopping pdf-tools from resetting to the beginning of an open PDF when I eval-buffer my config file" Tags="|init-file|pdf|eval-expression|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12686" PostTypeId="1" CreationDate="2015-05-25T14:39:17.430" Score="3" ViewCount="270" Body="&lt;p&gt;I'd like to see the inheritance tree for classes which I have currently open, similarly to how it ECB shows related files (e.g. I have a class B in my buffer, its parent A and child C are in different files - show me a tree with classes A, B, C).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried ebrowse and it sort of works, but I'd like to see only the relevant part of it and in a more user-friendly format. I'm using semantic and I'd guess that it should be able to figure out the hierarchy from its database, but I cannot find anything about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;http://www.mit.edu/afs.new/athena/contrib/xemacs/share/2005-12-08/xemacs-packages/lisp/semantic/semantic-cb.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;semantic-cb-speedbar-mode&lt;/a&gt; in a file &lt;code&gt;semantic-cb.el&lt;/code&gt; in XEmacs,  which sounds like what I want, but my distribution of Emacs doesn't have it (I'm using GNU Emacs 24.4).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar question: &lt;a href=&quot;https://emacs.stackexchange.com/q/3119/8412&quot;&gt;Class Browsing in C++&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8412" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-05-25T14:39:17.430" Title="Class inheritance tree in ECB" Tags="|c++|semantic-mode|ctags|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12687" PostTypeId="2" ParentId="12546" CreationDate="2015-05-25T16:22:17.953" Score="5" Body="&lt;p&gt;You can use a &lt;code&gt;:post&lt;/code&gt;-routine which outputs the result as &lt;code&gt;:name&lt;/code&gt;. Call your babel-block with this post routine and put the result into a drawer.&#xA;In the following example this post routine is named &lt;code&gt;asValue&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: asValue&#xA;#+begin_src emacs-lisp :var name=&quot;last&quot; :var val=0 :results drawer&#xA;(format &quot;#+NAME: %s\n: %s&quot; name val)&#xA;#+end_src&#xA;&#xA;#+name: square&#xA;#+begin_src emacs-lisp :var x=3&#xA;(message &quot;Running square&quot;)&#xA;(* x x)&#xA;#+end_src&#xA;&#xA;#+RESULTS: square&#xA;: 9&#xA;&#xA;#+NAME: value&#xA;: 45&#xA;&#xA;#+call: square(value) :post asValue(name=&quot;squaredValue&quot;,val=*this*) :results drawer&#xA;&#xA;#+RESULTS:&#xA;:RESULTS:&#xA;#+NAME: squaredValue&#xA;: 2025&#xA;:END:&#xA;&#xA;Now I try to reuse this value: &#xA;&#xA;#+begin_src emacs-lisp  :var res=squaredValue&#xA;  (format &quot;Re-used value: %s&quot; res)&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: Re-used value: 2025&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another way to avoid re-calculation of code blocks is the &lt;code&gt;:cache&lt;/code&gt; header argument. If this is set to &lt;code&gt;yes&lt;/code&gt; the code block and its arguments are checked for changes and if there are no changes the previous result is used without re-evaluation of the source code block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Running of source blocks with caching&#xA;&#xA;#+name: square&#xA;#+begin_src emacs-lisp :cache yes :var x=4&#xA;(message &quot;Running square&quot;)&#xA;(* x x)&#xA;#+end_src&#xA;&#xA;#+RESULTS[31bcff57ec9977f9b237fdc62ab18b1378b8c646]: square&#xA;: 16&#xA;&#xA;#+NAME: value&#xA;: 40&#xA;&#xA;#+name: squaredValue&#xA;#+begin_src emacs-lisp :cache yes :var x=square(x=value)&#xA;x&#xA;#+end_src&#xA;&#xA;#+RESULTS[f90a5856e446c3120f7e91c4b77959598078526e]: squaredValue&#xA;: 1600&#xA;&#xA;Now I try to reuse this value: &#xA;&#xA;#+begin_src emacs-lisp  :var res=squaredValue&#xA;  (format &quot;Re-used value: %s&quot; res)&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: Re-used value: 1600&#xA;&#xA;Re-trying with call:&#xA;&#xA;#+NAME: value2&#xA;: 20&#xA;&#xA;#+NAME: squaredResult&#xA;#+call: square(x=value2) :cache yes&#xA;&#xA;#+RESULTS[2f7c47d4c609a1a49ce00b4696afb7b5a5517b97]: squaredResult&#xA;: 400&#xA;&#xA;The last version gives the following error with org-mode 8.2.4 in emacs 24.3.1.&#xA;(I do not know why.)&#xA;&#xA;Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)&#xA;  org-babel-set-current-result-hash(&quot;94ef10d9192a0be25e46238df4cf05389ff69040&quot;)&#xA;  org-babel-lob-execute((&quot;square(x=value2)&quot; &quot;:cache yes&quot; 0 &quot;squaredResult&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-05-25T20:31:47.113" LastActivityDate="2015-05-25T20:31:47.113" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12688" PostTypeId="1" AcceptedAnswerId="12691" CreationDate="2015-05-25T18:26:22.983" Score="4" ViewCount="2571" Body="&lt;p&gt;I know the command isearch-forward-word, but there doesn't seem to be an isearch-replace-word. I'd like to search and replace every instance of a certain word in a buffer. For instance, search for every instance of &lt;code&gt;i&lt;/code&gt; and replace with &lt;code&gt;I&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;https://stackoverflow.com/questions/7060946/how-to-replace-a-word-in-emacs&quot;&gt;this answer&lt;/a&gt;, which seems to allow a digit argument, but I just want to replace every instance in my buffer.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-05-29T21:43:12.470" Title="how to search and replace an entire word?" Tags="|search|replace|isearch|words|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12689" PostTypeId="2" ParentId="12688" CreationDate="2015-05-25T18:56:57.953" Score="4" Body="&lt;p&gt;Run &lt;code&gt;query-replace-regexp&lt;/code&gt; with '\bi\b' as the query and 'I' as the replacement.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Update to comment)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function @lawlist linked to should work nicely if you want to replace all instances without questions.  To still be prompted for each instance, below should do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun query-replace-word (word new-word)&#xA;  (interactive &quot;sWord: \nsNew word: &quot;)&#xA;  (query-replace-regexp (format &quot;\\b%s\\b&quot; word) new-word))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Update in response to Drew's answer)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doh.  See Drew's better answer.  I didn't know that this could be done with a prefix argument to &lt;code&gt;query-replace&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-05-25T23:16:34.343" LastActivityDate="2015-05-25T23:16:34.343" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12690" PostTypeId="2" ParentId="12546" CreationDate="2015-05-25T20:28:04.073" Score="3" Body="&lt;p&gt;I suspect you just need to upgrade your Org mode.  This works on my end (current developmental version of Org) and in general should work as of the tag &lt;code&gt;release_8.3beta&lt;/code&gt;.  Below is the commit that I think fixes the problem you're describing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;commit 1877652ce0234cf333fa103b5ada08fbf5946ab1&#xA;Date:   Wed Nov 13 11:42:40 2013 -0700&#xA;&#xA;    allow reference to named call lines&#xA;&#xA;    * lisp/ob-ref.el (org-babel-ref-resolve): Look for call lines when&#xA;      resolving references.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Aside from loading Org from the git repo, another option for running a newer version is to &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow&quot;&gt;install the ELPA package&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-05-26T02:11:42.943" LastActivityDate="2015-05-26T02:11:42.943" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12691" PostTypeId="2" ParentId="12688" CreationDate="2015-05-25T20:56:44.980" Score="11" Body="&lt;p&gt;You don't need to define a separate function (command) for this.  And even if you did define one, it need not use &lt;code&gt;query-replace-regexp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard command &lt;code&gt;query-replace&lt;/code&gt; does just what you request, if you provide it with a prefix argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So just use &lt;strong&gt;&lt;code&gt;C-u M-%&lt;/code&gt;&lt;/strong&gt; to query-replace words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f query-replace&lt;/code&gt; tells you this (note the part in &lt;strong&gt;bold&lt;/strong&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;query-replace is an interactive compiled Lisp function in&#xA;  `replace.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;M-%&lt;/code&gt;, &lt;code&gt;&amp;lt;menu-bar&amp;gt; &amp;lt;edit&amp;gt; &amp;lt;replace&amp;gt; &amp;lt;query-replace&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(query-replace FROM-STRING TO-STRING &amp;amp;optional DELIMITED START END&#xA;  BACKWARD)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Replace some occurrences of FROM-STRING with TO-STRING.&#xA;  As each match is found, the user must type a character saying&#xA;  what to do with it.  For directions, type C-h at that time.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In Transient Mark mode, if the mark is active, operate on the contents&#xA;  of the region.  Otherwise, operate from point to the end of the buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use M-n to pull the last incremental search string to the minibuffer&#xA;  that reads FROM-STRING, or invoke replacements from&#xA;  incremental search with a key sequence like &lt;code&gt;C-s C-s M-%&lt;/code&gt;&#xA;  to use its current search string as the string to replace.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Matching is independent of case if &lt;code&gt;case-fold-search&lt;/code&gt; is non-nil and&#xA;  FROM-STRING has no uppercase letters.  Replacement transfers the case&#xA;  pattern of the old text to the new text, if &lt;code&gt;case-replace&lt;/code&gt; and&#xA;  &lt;code&gt;case-fold-search&lt;/code&gt; are non-nil and FROM-STRING has no uppercase&#xA;  letters.  (Transferring the case pattern means that if the old text&#xA;  matched is all caps, or capitalized, then its replacement is upcased&#xA;  or capitalized.)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Ignore read-only matches if &lt;code&gt;query-replace-skip-read-only&lt;/code&gt; is non-nil,&#xA;  ignore hidden matches if &lt;code&gt;search-invisible&lt;/code&gt; is nil, and ignore more&#xA;  matches using &lt;code&gt;isearch-filter-predicate&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;replace-lax-whitespace&lt;/code&gt; is non-nil, a space or spaces in the string&#xA;  to be replaced will match a sequence of whitespace chars defined by the&#xA;  regexp in &lt;code&gt;search-whitespace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace&#xA;  only matches surrounded by word boundaries.  A negative prefix arg means&#xA;  replace backward.&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Fourth and fifth arg START and END specify the region to operate on.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To customize possible responses, change the bindings in &lt;code&gt;query-replace-map&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And if you insist that you want a separate command for this, then just do the obvious:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun q-r-word ()&#xA;  &quot;Query-replace whole words.&quot;&#xA;  (interactive)&#xA;  (let ((current-prefix-arg  t))&#xA;    (call-interactively #'query-replace)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-25T21:29:11.367" LastActivityDate="2015-05-25T21:29:11.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12692" PostTypeId="2" ParentId="2427" CreationDate="2015-05-25T21:05:57.293" Score="31" Body="&lt;p&gt;Old question, yes... But in the event that anyone Googles this; another option is using &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/&quot;&gt;Org Babel&lt;/a&gt; and &lt;a href=&quot;https://github.com/zweifisch/ob-http&quot;&gt;&lt;code&gt;ob-http&lt;/code&gt;&lt;/a&gt;... (Can be installed from &lt;a href=&quot;http://melpa.org&quot;&gt;melpa&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;org-babel&lt;/code&gt;, you can make an &lt;code&gt;.org&lt;/code&gt; file containing &quot;&lt;code&gt;http&lt;/code&gt;&quot; code blocks. When these blocks are evaluated, they will make the HTTP request and return the response as the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If these blocks have a &quot;&lt;code&gt;#+NAME:&lt;/code&gt;&quot; attribute, you can use their results in any other &lt;code&gt;org-babel&lt;/code&gt; block. This allows for some pretty neat literate programming using the results of HTTP requests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here is a little Org document demonstrating making an HTTP request and parsing the returned JSON in Ruby:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* The request&#xA;The following is the example request shown on [[https://github.com/zweifisch/ob-http][ob-http's Github page]]...&#xA;&#xA;It isn't anything fancy, but it is a REST API request, and returns&#xA;JSON, so it works for the sake of this demonstration:&#xA;&#xA;#+NAME:ob-languages&#xA;#+BEGIN_SRC http :pretty&#xA;  GET https://api.github.com/repos/zweifisch/ob-http/languages&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: {&#xA;:   &quot;Emacs Lisp&quot;: 7034&#xA;: }&#xA;&#xA;Notice how this has a &quot;=#+NAME:=&quot; attribute? This is a name we can use&#xA;in other =org-babel= blocks. (As you will see below)&#xA;&#xA;* Using the request&#xA;Now that I have an =http= request in an org block with a name... Lets&#xA;write something in a completely different language and use our HTTP&#xA;request's response:&#xA;&#xA;#+BEGIN_SRC ruby :var langs=ob-languages&#xA;  require 'json'&#xA;  JSON.parse(langs)['Emacs Lisp']&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 7034&#xA;&#xA;The =:var= keyword allowed me to assign the &quot;=langs=&quot; variable in the&#xA;Ruby block to the result of the =ob-languages= block [[The request][above]].&#xA;&#xA;This didn't have to be in Ruby, this could have been any language,&#xA;including another =http= block.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what this looks like in &lt;code&gt;org-mode&lt;/code&gt;:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/eaAac.png&quot; alt=&quot;ob-http in org-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hitting &lt;code&gt;C-c C-c&lt;/code&gt; on the bottom block (The Ruby one) will automagically evaluate the top one for its dependency (That's the &lt;code&gt;:var&lt;/code&gt; bit in the block's header.). This will mean that the &lt;code&gt;http&lt;/code&gt; request is made first, and then the results are passed to Ruby for further processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this with as many blocks as you like and with as many languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this suits your needs, &lt;code&gt;ob-http&lt;/code&gt; requires a little bit of manual tweaking after you install it to get it working. (Don't worry, it isn't that much)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After installing &lt;code&gt;ob-http&lt;/code&gt;, you need to customize two variables: &lt;code&gt;org-src-lang-modes&lt;/code&gt;, and &lt;code&gt;org-babel-load-languages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, by running &lt;code&gt;M-x customize-variable&lt;/code&gt;, you can customize each to include the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;org-src-lang-modes&lt;/code&gt;&lt;/strong&gt;:&#xA;You will want to customize this variable to include one more language mapping, so you can insert one more value to the end of the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;String: http&#xA;Symbol: ob-http&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can &lt;code&gt;C-x C-s&lt;/code&gt; to save that customization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;org-babel-load-languages&lt;/code&gt;&lt;/strong&gt;:&#xA;You will want to add one more item to the list of enabled &lt;code&gt;org&lt;/code&gt; languages. &quot;&lt;code&gt;http&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though, you might need to add it to the list manually if the option is not in the possible options, you can do that by clicking &quot;State&quot; and choosing &quot;&lt;code&gt;:&lt;/code&gt;&quot; to show the Lisp expression... Then you would add the following just before the last closing parenthesis:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(http . t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that, a quick &lt;code&gt;C-x C-s&lt;/code&gt; and &lt;code&gt;M-x org-reload&lt;/code&gt; should be all you need..!&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2015-11-02T17:07:03.157" LastActivityDate="2015-11-02T17:07:03.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12693" PostTypeId="1" AcceptedAnswerId="12736" CreationDate="2015-05-25T21:26:16.583" Score="2" ViewCount="333" Body="&lt;p&gt;I have the latest Emacs and php-mode setup and this code does not get indented correctly&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;$app-&amp;gt;group('/route', function () use ($app) {&#xA;    echo 'hello';&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead it looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;$app-&amp;gt;group('/route', function () use ($app) {&#xA;        echo 'hello';&#xA;    });&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note both the last line and that it indents the &lt;code&gt;echo&lt;/code&gt; with 8 spaces instead of 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;php-enable-psr2-coding-style&lt;/code&gt; but it still doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="597" LastEditorUserId="675" LastEditDate="2015-05-27T18:59:02.523" LastActivityDate="2015-05-30T14:10:24.167" Title="php-mode indents anonymous function incorrectly" Tags="|indentation|php-mode|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12694" PostTypeId="2" ParentId="12630" CreationDate="2015-05-26T00:58:11.730" Score="0" Body="&lt;p&gt;Turns out the problem is an incompatibility with the MariaDB console. You need to change the mysql regex stored in &lt;code&gt;sql-product-alist&lt;/code&gt; variable to &lt;code&gt;\\(?:mysql\\|mariadb\\).*&amp;gt;&lt;/code&gt; to make it compatible with MariaDB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm not experienced with elisp and couldn't write a command to do that automatically, so instead I just overrode the variable in my init.el. If anyone knows a practical command for that please let me know.)&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-26T00:58:11.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12695" PostTypeId="1" CreationDate="2015-05-26T03:43:32.977" Score="4" ViewCount="418" Body="&lt;p&gt;For example, I got a small window, a long whole line is split into multiple lines, not actually split, but with one arrow at the end of each line of the window, if I use C-e or End key, this will move end point to the end of this actual line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq truncate-lines nil)&lt;/code&gt;is set in my init.el, how can I move my point to the end of the window/screen line?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2015-05-26T03:53:15.917" LastActivityDate="2015-05-26T03:54:16.807" Title="How to move to the end/beginning of the window/screen line?" Tags="|window|motion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12696" PostTypeId="2" ParentId="12695" CreationDate="2015-05-26T03:48:51.660" Score="3" Body="&lt;p&gt;You want &lt;code&gt;visual-line-mode&lt;/code&gt;. You can enable it with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;visual-line-mode&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the EmacsWiki on:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/VisualLineMode&quot; rel=&quot;nofollow&quot;&gt;Visual Lines&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacswiki.org/emacs/LineWrap&quot; rel=&quot;nofollow&quot;&gt;Line wrapping&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See the GNU Emacs manual on:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;visual-line-mode&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-05-26T03:48:51.660" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12697" PostTypeId="2" ParentId="12695" CreationDate="2015-05-26T03:54:16.807" Score="3" Body="&lt;p&gt;I already find the solution, I can use &lt;code&gt;beginning/end-of-visual-line&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-S-e&quot;) 'end-of-visual-line)&#xA;(global-set-key (kbd &quot;C-S-a&quot;) 'beginning-of-visual-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, use C-S-a/e to do that motion.&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2015-05-26T03:54:16.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12698" PostTypeId="1" AcceptedAnswerId="12699" CreationDate="2015-05-26T07:48:56.570" Score="3" ViewCount="288" Body="&lt;p&gt;How does &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;transpose-sentences&lt;/code&gt; work? I tested it by executing the command with point at various places (as indicated) in the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;this is sentence 1. this is sentence 2. this is sentence 3.&#xA;^       ^        ^^^^       ^        ^^^^       ^        ^^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It either appears to do nothing, or returns &quot;Don't have two things to transpose&quot;.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="105" LastEditDate="2015-05-29T21:42:01.090" LastActivityDate="2015-05-29T21:42:01.090" Title="How does &quot;transpose-sentences&quot; work?" Tags="|text-editing|sentences|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12699" PostTypeId="2" ParentId="12698" CreationDate="2015-05-26T08:30:34.273" Score="7" Body="&lt;p&gt;How the function works will depend on your configuration. As a default, Emacs expects two spaces after a sentence. You can change this to one space by setting the variable &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. Once you've done that, it'll work as you expect.&lt;/p&gt;&#xA;" OwnerUserId="756" LastActivityDate="2015-05-26T08:30:34.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12700" PostTypeId="1" AcceptedAnswerId="12719" CreationDate="2015-05-26T09:15:50.933" Score="4" ViewCount="1527" Body="&lt;p&gt;Is it possible to convert plain text dates to Org dates automatically? I have entries in the format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;16 February 2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I would like to convert to Org dates: &lt;code&gt;&amp;lt;2015-02-16 Mon&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="105" LastEditDate="2015-05-29T21:41:32.127" LastActivityDate="2015-05-29T21:41:32.127" Title="Converting plain text to dates" Tags="|org-mode|time-date|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12701" PostTypeId="1" AcceptedAnswerId="12702" CreationDate="2015-05-26T09:18:27.513" Score="2" ViewCount="510" Body="&lt;p&gt;On deleting a line in Emacs using &lt;kbd&gt;C-k&lt;/kbd&gt;, Emacs removes the line contents but it leaves a blank newline character. To remove this, I again press &lt;kbd&gt;C-k&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I delete the complete line with no traces left behind in one shot?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="504" LastEditDate="2015-05-26T11:38:38.893" LastActivityDate="2021-10-15T09:57:55.153" Title="Kill a line deletes the line but leaves a blank newline character" Tags="|editing|kill-ring|" AnswerCount="3" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12702" PostTypeId="2" ParentId="12701" CreationDate="2015-05-26T09:35:51.790" Score="6" Body="&lt;p&gt;From documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;kill-whole-line is an interactive compiled Lisp function.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;&amp;lt;C-S-backspace&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(kill-whole-line &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Kill current line. With prefix ARG, kill that many lines starting from&#xA;  the current line. If ARG is negative, kill backward.  Also kill the&#xA;  preceding newline. (This is meant to make C-x z work well with&#xA;  negative arguments.) If ARG is zero, kill current line but exclude the&#xA;  trailing newline.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-05-26T09:35:51.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12703" PostTypeId="2" ParentId="12700" CreationDate="2015-05-26T09:53:11.207" Score="4" Body="&lt;p&gt;I came up with something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-format-time (time-string)&#xA;  (let* ((time (parse-time-string time-string))&#xA;         (day (nth 3 time))&#xA;         (month (nth 4 time))&#xA;         (year (nth 5 time)))&#xA;    (format-time-string &quot;&amp;lt;%Y-%m-%d&amp;gt;&quot; &#xA;      ;; I would love to do an 'apply here, but the given list to be encoded contains nil which does n&#xA;      (encode-time 0 0 0 day month year))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that you can create an interactive function that scans for your specific date format and replaces the found date strings with the desired format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For further reading have a look at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ergoemacs.org/emacs/elisp_parse_time.html&quot; rel=&quot;nofollow&quot;&gt;http://ergoemacs.org/emacs/elisp_parse_time.html&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5448" LastEditorUserId="5448" LastEditDate="2015-05-26T10:02:04.963" LastActivityDate="2015-05-26T10:02:04.963" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12704" PostTypeId="1" AcceptedAnswerId="12710" CreationDate="2015-05-26T11:21:09.190" Score="8" ViewCount="271" Body="&lt;p&gt;Many Emacs commands alter their behavior when called with one or more &lt;kbd&gt;C-u&lt;/kbd&gt; prefixes. In some cases the default behavior of a command is less useful to me than the behavior I get when prefixing it with &lt;kbd&gt;C-u&lt;/kbd&gt;. At the same time, I do not want to get rid of the default behavior completely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give a concrete example, the &lt;code&gt;quit-window&lt;/code&gt; command (bound to &lt;code&gt;q&lt;/code&gt; in &lt;code&gt;help-mode&lt;/code&gt;) quits the current window and buries the buffer displayed in it by default. When called with &lt;kbd&gt;C-u&lt;/kbd&gt; it kills the buffer instead. I would like the command to kill the buffer by default and bury it when called with a &lt;kbd&gt;C-u&lt;/kbd&gt; prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; &lt;em&gt;How can I tell Emacs to make a command behave as if it was called with a&lt;/em&gt; &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;em&gt;prefix by default while moving the default behavior to the&lt;/em&gt; &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;em&gt;prefix&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I could address this by redefining the original command or wrapping it in a custom command that passes prefix args according to my preferences. But I'd rather do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(swap-args 'quit-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="504" LastActivityDate="2017-01-15T18:12:28.877" Title="Swap default behavior of command with C-u behavior" Tags="|commands|prefix-argument|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12705" PostTypeId="1" CreationDate="2015-05-26T13:09:19.340" Score="1" ViewCount="586" Body="&lt;p&gt;I'd like to remove the following two comments line, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## comments 1 &#xA;f &amp;lt;- function() {&#xA;  ## comments 2 &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;(search-forward-regexp &quot;^[[:space:]]+##&quot;)&lt;/code&gt; to search for  &quot;  ##&quot; (the line start with 2 indentation whitespaces followed by ##) and &lt;code&gt;(search-forward-regexp &quot;^##&quot;)&lt;/code&gt; to search for the line that starts with &lt;code&gt;##&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I combine them into one line of script like below?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(search-forward-regexp &quot;[[:space:]+\|^]##&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is obvious wrong, according to &lt;a href=&quot;http://www.emacswiki.org/emacs/RegularExpression&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/RegularExpression&lt;/a&gt;; &lt;code&gt;^&lt;/code&gt; inside of &lt;code&gt;[ ]&lt;/code&gt; means negate. &lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="184" LastEditDate="2015-05-26T18:51:30.137" LastActivityDate="2015-05-26T18:51:30.137" Title="use ^ inside of [] as start of line" Tags="|regular-expressions|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12706" PostTypeId="2" ParentId="12705" CreationDate="2015-05-26T13:15:41.717" Score="2" Body="&lt;p&gt;This should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward-regexp &quot;^\\(^\\|[[:space:]]+\\)##&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, create a group (between &lt;code&gt;\\(&lt;/code&gt; and &lt;code&gt;\\)&lt;/code&gt;) with two alternatives, separated by &lt;code&gt;\\|&lt;/code&gt;, one of them being &lt;code&gt;^&lt;/code&gt; and the other being &lt;code&gt;[[:space:]]+&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, &lt;code&gt;[[:space:]]+&lt;/code&gt; searches for one or more whitespace characters.  If you want two or more, use &lt;code&gt;[[:space:]]\\{2,\\}&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-05-26T13:15:41.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12707" PostTypeId="2" ParentId="12705" CreationDate="2015-05-26T13:33:04.840" Score="2" Body="&lt;p&gt;The other answer gives you a good regexp for your problem, I just want to add a bit more information about what seems to be your confusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The square brackets syntax &lt;code&gt;[...]&lt;/code&gt; means &lt;em&gt;one of any of the characters listed in the brackets&lt;/em&gt;. As such, you can not use any regular expression in it. As a side-note, this is why &lt;code&gt;^&lt;/code&gt; can have a different syntax in this context, otherwise that would create an unresolvable ambiguity for the regexp engine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are looking for is a syntax for &lt;em&gt;any string matching regexp1 OR regexp 2&lt;/em&gt;, which is the logical &lt;code&gt;\\|&lt;/code&gt;, within a group. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\\(a\\|b\\)   # a or b, equivalent to [ab]&#xA;\\(aa\\|bb\\) # aa or bb, no easy equivalent&#xA;\\(aa\\|\\)   # aa or nothing, equivalent to \\(aa\\)\\?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So indeed, for your problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^\\(\\|[[:blank:]]\\{2,\\}\\)##&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should match what you want: 0, 2 or more whitespace characters at the beginning of a line, followed by two &lt;code&gt;#&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-05-26T13:39:04.033" LastActivityDate="2015-05-26T13:39:04.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12708" PostTypeId="2" ParentId="12704" CreationDate="2015-05-26T14:03:09.677" Score="0" Body="&lt;p&gt;Not that easy as thought. However, as it's trivial to have the swapped command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-quit-window-args-swapped (&amp;amp;optional bury window)&#xA;&quot;Adapted docstring blah, blah &quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (quit-restore-window window (if bury 'bury 'kill)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-05-26T14:03:09.677" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12709" PostTypeId="1" AcceptedAnswerId="12712" CreationDate="2015-05-26T14:09:13.343" Score="9" ViewCount="1687" Body="&lt;p&gt;I would like to save the last position of point in the buffer I am visiting, so to have point still there when I go back to that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand I can use &lt;code&gt;saveplace&lt;/code&gt; for this, so I added this snippet in my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package saveplace ; Save point position in files&#xA;  :init (progn&#xA;          (setq-default save-place t)&#xA;          (toggle-save-place-globally)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet I am not getting the desired behavior: point is still place at the beginning of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 25.0.50.1 (&lt;code&gt;45c92dd&lt;/code&gt;), but the same thing is happening with &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="105" LastEditDate="2015-05-29T21:39:38.460" LastActivityDate="2015-05-29T21:39:38.460" Title="How to save last place of point in a buffer?" Tags="|buffers|point|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12710" PostTypeId="2" ParentId="12704" CreationDate="2015-05-26T14:22:11.207" Score="5" Body="&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun swap-args (fun)&#xA;  (if (not (equal (interactive-form fun)&#xA;                  '(interactive &quot;P&quot;)))&#xA;      (error &quot;Unexpected&quot;)&#xA;    (advice-add&#xA;     fun&#xA;     :around&#xA;     (lambda (x &amp;amp;rest args)&#xA;       &quot;Swap the meaning the universal prefix argument&quot;&#xA;       (if (called-interactively-p 'any)&#xA;           (apply x (cons (not (car args)) (cdr args)))&#xA;         (apply x args))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, only works for &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt;. For other types of &lt;code&gt;interactive&lt;/code&gt; it may not make sense to negate the first argument.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="9434" LastEditDate="2017-01-15T18:12:28.877" LastActivityDate="2017-01-15T18:12:28.877" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12711" PostTypeId="1" AcceptedAnswerId="12713" CreationDate="2015-05-26T14:31:18.223" Score="3" ViewCount="150" Body="&lt;p&gt;Is there an org-babel for the &lt;a href=&quot;http://www.jython.org/&quot; rel=&quot;nofollow&quot;&gt;Jython&lt;/a&gt; (not Python, it must be Jython) programming language? I am especially interested in session based evaluation for Jython. I am considering writing my own ob-jython.el, but want to make sure this has not been tackled yet.&lt;/p&gt;&#xA;" OwnerUserId="8424" LastEditorUserId="105" LastEditDate="2015-05-27T00:05:39.130" LastActivityDate="2015-05-27T00:05:39.130" Title="org-babel for Jython?" Tags="|org-babel|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12712" PostTypeId="2" ParentId="12709" CreationDate="2015-05-26T14:43:46.557" Score="13" Body="&lt;p&gt;I am using Emacs 25.0.50.8 and I noticed the behavior of the &lt;code&gt;save-place&lt;/code&gt; variable has been changed: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This variable is obsolete since 25.1; use `save-place-mode' instead.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can type &lt;code&gt;C-h v save-place&lt;/code&gt; to read its full documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package saveplace&#xA;  :init (save-place-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-05-26T16:08:38.233" LastActivityDate="2015-05-26T16:08:38.233" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12713" PostTypeId="2" ParentId="12711" CreationDate="2015-05-26T16:06:14.903" Score="4" Body="&lt;p&gt;You can change the babel python interpreter to jython with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq org-babel-python-command &quot;jython&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-26T16:06:14.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12714" PostTypeId="1" AcceptedAnswerId="12715" CreationDate="2015-05-26T16:29:16.043" Score="48" ViewCount="18673" Body="&lt;p&gt;Is there a way to issue the command: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;git checkout NameOfFile&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;on a modified and unstaged file from within MAGIT?&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2018-10-12T14:02:43.603" Title="How can I discard changes to unstaged files using magit?" Tags="|magit|git|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12715" PostTypeId="2" ParentId="12714" CreationDate="2015-05-26T16:33:59.097" Score="58" Body="&lt;p&gt;You can use one of the below to discard changes in unstaged files:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x magit-revert-item&lt;/code&gt; (bound to &lt;code&gt;v&lt;/code&gt; in &lt;code&gt;magit-status-mode&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x magit-discard-item&lt;/code&gt; (bound to &lt;code&gt;k&lt;/code&gt; in &lt;code&gt;magit-status-mode&lt;/code&gt;) - &lt;strong&gt;works on staged items too&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Using either method will ask you to confirm before discarding.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="115" LastEditDate="2015-05-26T16:43:40.340" LastActivityDate="2015-05-26T16:43:40.340" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="12716" PostTypeId="2" ParentId="12705" CreationDate="2015-05-26T17:17:07.293" Score="0" Body="&lt;p&gt;You can do this with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward-regexp &quot;^[[:space:]]*##&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This matches the beginning of a line (&lt;code&gt;^&lt;/code&gt;) followed by 0 or more spaces (&lt;code&gt;[[:space:]]*&lt;/code&gt;) followed by two hashes (&lt;code&gt;##&lt;/code&gt;). Thus, it matches both lines that start with &lt;code&gt;##&lt;/code&gt;, as well as those that have any number of spaces before the &lt;code&gt;##&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-05-26T17:17:07.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12717" PostTypeId="2" ParentId="12658" CreationDate="2015-05-26T17:53:58.823" Score="1" Body="&lt;p&gt;This can be achieved by setting the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html&quot; rel=&quot;nofollow&quot;&gt;input method&lt;/a&gt; of emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OS keyboard will remain set to English, but the latin keystrokes received by emacs will be re-interpreted to Greek ones. This will only happen when inserting text. Therefore, both emacs and evil-mode shortcuts will work properly even when the input method is set to Greek.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding the following to &lt;code&gt;.emacs&lt;/code&gt; enables us to use &lt;code&gt;C-\&lt;/code&gt; to toggle entering text in Greek.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-input-method &quot;greek&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;C-\&lt;/code&gt; is inconvenient to type, it can be changed using &lt;code&gt;global-set-key&lt;/code&gt;, ie&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c C-o&quot;) 'toggle-input-method)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8403" LastActivityDate="2015-05-26T17:53:58.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12718" PostTypeId="2" ParentId="12546" CreationDate="2015-05-26T18:01:21.907" Score="9" Body="&lt;h3&gt;Explicitly add new &lt;code&gt;#+name:&lt;/code&gt; above the &lt;code&gt;#+results:&lt;/code&gt; block.&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Updated your code from &lt;code&gt;(message res)&lt;/code&gt; to &lt;code&gt; (message (format &amp;quot;%s&amp;quot; res))&lt;/code&gt; to prevent a &lt;code&gt;Wrong type argument: stringp, 2025&lt;/code&gt; from causing additional confusion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+name: square&#xA;#+begin_src emacs-lisp :var x=3 &#xA;  (message (format &amp;quot;%s&amp;quot; (* x x)))&#xA;#+end_src&#xA;&#xA;#+RESULTS: square&#xA;: 9&#xA;&#xA;#+name: value&#xA;: 45&#xA;&#xA;#+name: squaredvalue&#xA;#+call: square(x=value)&#xA;&#xA;#+name: squaredvalue-results&#xA;#+RESULTS: squaredvalue&#xA;: 2025&#xA;&#xA;#+begin_src emacs-lisp :var res=squaredvalue&#xA;   (message (format &amp;quot;%s&amp;quot; res))&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: nil&#xA;&#xA;&#xA;#+begin_src emacs-lisp :var res=squaredvalue-results&#xA; (message (format &amp;quot;%s&amp;quot; res)) &#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: 2025&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Tested using&lt;/strong&gt;&lt;br /&gt;&#xA;GNU Emacs 24.4.1 (x86_64-unknown-cygwin, GTK+ Version 3.10.9)&lt;br /&gt;&#xA;Org-Mode Version: 8.2.10&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-26T18:01:21.907" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12719" PostTypeId="2" ParentId="12700" CreationDate="2015-05-26T23:22:32.423" Score="8" Body="&lt;p&gt;Internally, &lt;code&gt;org-mode&lt;/code&gt; uses the function &lt;code&gt;org-read-date&lt;/code&gt; to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-read-date &amp;amp;optional ORG-WITH-TIME TO-TIME FROM-STRING PROMPT&#xA;DEFAULT-TIME DEFAULT-INPUT INACTIVE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-read-date nil nil &quot;16 February 2015&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns &quot;2015-02-16&quot;.  This doesn't put in the &quot;&amp;lt;&gt;&quot; or &quot;[]&quot; for active/inactive time-stamps, but you can easily add them with a format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;&amp;lt;%s&amp;gt;&quot;   (org-read-date nil nil &quot;16 February 2015&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-05-27T11:43:48.113" LastActivityDate="2015-05-27T11:43:48.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12720" PostTypeId="1" AcceptedAnswerId="12834" CreationDate="2015-05-27T00:58:42.893" Score="3" ViewCount="538" Body="&lt;p&gt;I've tried setting &lt;code&gt;image-dired-thumb-size&lt;/code&gt; (and/or &lt;code&gt;image-dired-thumb-height&lt;/code&gt; &lt;code&gt;image-dired-thumb-width&lt;/code&gt;) and it has no effect. I've set it globally in &lt;code&gt;.emacs&lt;/code&gt; and in various mode-hooks, all to no avail. The default value is 100 and I change it to 256 and the thumbnails are still 100. Inquiring the variables says they are 256.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These variables seem to have no effect. Is there a way to make this work?&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="115" LastEditDate="2015-05-27T01:19:03.980" LastActivityDate="2015-06-01T16:27:51.230" Title="How to set thumbnail size in image-dired" Tags="|dired|image-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12721" PostTypeId="2" ParentId="7375" CreationDate="2015-05-27T02:18:44.927" Score="6" Body="&lt;p&gt;Using an overlay is how I'm going to want to do it. I can hook into org-ctrl-c-ctrl-c-hook. It means I can press C-c C-c to run the check.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to properly check that I'm inside a table and run this for all cells.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I probably need to hook into the alignment function to either redo the overlays or at least clear them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code will make the cell background red for the cell I'm in if the value is less than 1 or greater than 2 when I press C-c C-c ... But it is still buggy and will clear the overlays if one of them doesn't match the rules.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun staggering ()&#xA;  (save-excursion&#xA;    (let* ((ot-field-beginning (progn (org-table-beginning-of-field 1) (point)))&#xA;           (ot-field-end (progn (org-table-end-of-field 1) (point)))&#xA;           (cell-text (buffer-substring ot-field-beginning ot-field-end)))&#xA;      (if (or (&amp;lt; (string-to-number cell-text) 1)&#xA;              (&amp;gt; (string-to-number cell-text) 2))&#xA;          (overlay-put (make-overlay&#xA;                        (progn (org-table-beginning-of-field 1) (point))&#xA;                        (progn (org-table-end-of-field 1) (point)))&#xA;                       'face '(:background &quot;#FF0000&quot;))))))&#xA;(add-hook 'org-ctrl-c-ctrl-c-hook 'staggering)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="61" LastEditorUserId="6695" LastEditDate="2018-12-02T14:53:40.077" LastActivityDate="2018-12-02T14:53:40.077" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="12722" PostTypeId="2" ParentId="12656" CreationDate="2015-05-27T03:04:57.150" Score="3" Body="&lt;p&gt;Actually this is documented in the helm wiki:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To yank the symbol at point from helm-current-buffer (i.e. buffer where a helm command originated):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-n&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, customize helm-yank-symbol-first to enable&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-w&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to always yank the whole symbol on first invocation.&lt;/p&gt;&#xA;" OwnerUserId="4036" LastActivityDate="2015-05-27T03:04:57.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12723" PostTypeId="1" CreationDate="2015-05-27T06:31:10.193" Score="4" ViewCount="118" Body="&lt;p&gt;I want to sleep until a predicate is true, without blocking the rest of Emacs from executing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun clock-striking-one-p ()&#xA;  (eq clock 1))&#xA;&#xA;(defun hickory-dickory-dock ()&#xA;  (run-up-clock)&#xA;  (sleep-until clock-striking-one-p)&#xA;  (run-down))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="594" LastEditorUserId="14920" LastEditDate="2018-09-11T12:03:38.677" LastActivityDate="2018-09-11T12:03:38.677" Title="Sleep until predicate is true" Tags="|programming|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12724" PostTypeId="1" AcceptedAnswerId="12727" CreationDate="2015-05-27T07:33:28.260" Score="1" ViewCount="104" Body="&lt;p&gt;I have setup prelude and the setup is just great. There is one thing that bothers me: whenever I type double x, emacs opens &lt;em&gt;helm-mode-execute-extended-command&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to disable this shortcut?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="50" LastEditDate="2015-05-29T23:59:43.837" LastActivityDate="2015-05-29T23:59:43.837" Title="Disable double x shortcut in Prelude" Tags="|key-bindings|prelude|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12725" PostTypeId="1" AcceptedAnswerId="12755" CreationDate="2015-05-27T07:50:23.473" Score="4" ViewCount="504" Body="&lt;p&gt;When I move around specifically using &lt;code&gt;M-f/b&lt;/code&gt;, I want to treat any symbol such as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;, ', ., -, _, ?, !, *... &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as one word, so &lt;code&gt;M-f/b&lt;/code&gt; will move around them instead of skipping them and jump to the next/previous word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any variable builtin to do that? If no, how can I do that?&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="50" LastEditDate="2015-05-29T23:55:03.343" LastActivityDate="2015-05-29T23:55:03.343" Title="Is is possible to treat any symbol in the buffer as word when moving around?" Tags="|syntax|motion|words|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12726" PostTypeId="1" AcceptedAnswerId="12733" CreationDate="2015-05-27T09:15:02.233" Score="9" ViewCount="683" Body="&lt;p&gt;When I kill emacs (with &lt;code&gt;killall emacs&lt;/code&gt; from a shell prompt, for example), and I was editing a file, Emacs restarts with a message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;filename has auto save data; consider M-x recover-this-file&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I had recently saved the file, then modified it and then undone the changes, so that it looks just like the saved version, this message is displayed, even though the auto-save file has &lt;strong&gt;no changes at all&lt;/strong&gt; (seen via file size or &lt;code&gt;M-x diff&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be disabled?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could not find something in either the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/After-a-Crash.html&quot; rel=&quot;noreferrer&quot;&gt;official&lt;/a&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Recover.html#Recover&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;, or &lt;a href=&quot;http://emacswiki.org/emacs/AutoSave&quot; rel=&quot;noreferrer&quot;&gt;emacswiki&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8431" LastEditorUserId="25" LastEditDate="2015-05-27T11:59:21.083" LastActivityDate="2015-05-27T13:41:33.590" Title="Disable prompting to auto-recover when auto-save data is the same as file" Tags="|auto-save|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12727" PostTypeId="2" ParentId="12724" CreationDate="2015-05-27T09:53:14.993" Score="2" Body="&lt;p&gt;The following should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define-global &quot;xx&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can add it to your personal configuration file. This has been described in Prelude's &lt;a href=&quot;https://github.com/bbatsov/prelude#key-chords&quot; rel=&quot;nofollow&quot;&gt;README&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-05-27T09:53:14.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12728" PostTypeId="2" ParentId="12725" CreationDate="2015-05-27T11:54:56.647" Score="3" Body="&lt;p&gt;Emacs 24 defines &lt;code&gt;forward-whitespace&lt;/code&gt;, which moves by whitespace-delimited words (i.e. anything but whitespace is considered a word constituent), but oddly not &lt;code&gt;backward-whitespace&lt;/code&gt;. It only treats space, tab and newline as whitespace, not other Unicode whitespace or characters defined as whitespace. When going forward, it moves to the beginning of the next word, not to the end of the current word.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun backward-whitespace (arg)&#xA;  &quot;Move point to the beginning of the current sequence of whitespace characters.&quot;&#xA;  (interactive &quot;^p&quot;)&#xA;  (forward-whitespace (- arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It isn't bound to any key by default.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;\M-B&quot; 'backward-whitespace)&#xA;(global-set-key &quot;\M-F&quot; 'forward-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you prefer to rely on whitespace syntax, you can use these functions. The forward function moves to the end of the word. If you prefer to move to the beginning of the next word, swap the two calls to &lt;code&gt;skip-syntax-forward&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun forward-word-whitespace-syntax (arg)&#xA;  &quot;Move point forward ARG whitespace-delimited words.&#xA;Whitespace is defined as characters having the whitespace syntax,&#xA;plus newlines.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (with-syntax-table (make-syntax-table (syntax-table))&#xA;    ;; Always treat newlines as whitespace and not as e.g. comment ender&#xA;    (modify-syntax-entry ?\n &quot;-&quot;)&#xA;    (while (&amp;gt; arg 0)&#xA;      (skip-syntax-forward &quot;-&quot;)&#xA;      (skip-syntax-forward &quot;^-&quot;)&#xA;      (setq arg (1- arg)))&#xA;    (while (&amp;lt; arg 0)&#xA;      (skip-syntax-backward &quot;-&quot;)&#xA;      (skip-syntax-backward &quot;^-&quot;)&#xA;      (setq arg (1+ arg)))&#xA;    t))&#xA;(defun backward-word-whitespace-syntax (arg)&#xA;  &quot;Move point backward ARG whitespace-delimited words.&#xA;Whitespace is defined as characters having the whitespace syntax,&#xA;plus newlines.&quot;&#xA;  (interactive &quot;^p&quot;)&#xA;  (forward-word-whitespace-syntax (- arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Current versions of Emacs don't have good support for Unicode categories, I don't know how to search for characters that are classified as whitespace in the buffer's encoding. I believe this is slated to improve in Emacs 25.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="115" LastEditDate="2015-05-27T13:22:28.537" LastActivityDate="2015-05-27T13:22:28.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12730" PostTypeId="2" ParentId="12338" CreationDate="2015-05-27T12:27:06.637" Score="3" Body="&lt;p&gt;Helm has support for different histories which is already used quite heavily in the main helm package as well as some of the 3rd party helms. From the the helm manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:history&#xA;&#xA;By default all minibuffer input is pushed to `minibuffer-history',&#xA;if an argument HISTORY is provided, input will be pushed to HISTORY.&#xA;History element should be a symbol.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example the &lt;code&gt;helm-apt&lt;/code&gt; function calls helm with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(helm :sources 'helm-source-apt&#xA;          :prompt &quot;Search Package: &quot;&#xA;          :input query&#xA;          :buffer &quot;*helm apt*&quot;&#xA;          :history 'helm-apt-input-history)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you can simply redefine the helm calls to include a reference to a new history variable. In the longer term it might make more sense to submit patches to the various projects to use this feature. For example &lt;code&gt;helm-grep&lt;/code&gt; and &lt;code&gt;helm-ag&lt;/code&gt; may well want to share generic &lt;code&gt;helm-search-history&lt;/code&gt; variable?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-05-27T12:27:06.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12731" PostTypeId="2" ParentId="12714" CreationDate="2015-05-27T12:40:27.627" Score="20" Body="&lt;p&gt;Reversing, reverting and discarding are distinct actions. Together with staging and unstaging, they are referred to as &quot;apply variants&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To &lt;em&gt;discard&lt;/em&gt; a change means to throw it away. Only un-committed changes can be discarded. When a staged change is discarded it is not only removed from the index (that is known as unstaging), but also from the work tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To &lt;em&gt;reverse&lt;/em&gt; a change means to apply it to the work tree in reverse. Both committed and merely staged changes can be reversed. (Reversing staged changes is actually useful, i.e. when splitting up a commit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only commits can be &lt;em&gt;reverted&lt;/em&gt;, in other regards it's similar to &lt;em&gt;reversing&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/magit/magit/wiki/History-Manipulation&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/magit/magit/wiki/History-Manipulation&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T13:52:40.573" LastActivityDate="2015-07-03T13:52:40.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12732" PostTypeId="2" ParentId="12556" CreationDate="2015-05-27T13:17:04.127" Score="2" Body="&lt;p&gt;You can ensure &lt;code&gt;do-auto-save&lt;/code&gt; is called with the correct argument to suppress the message by &lt;em&gt;advising&lt;/em&gt; the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-auto-save-wrapper (save-fn &amp;amp;rest args)&#xA;  (apply save-fn '(t)))&#xA;&#xA;(advice-add 'do-auto-save :around #'my-auto-save-wrapper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-05-27T13:17:04.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12733" PostTypeId="2" ParentId="12726" CreationDate="2015-05-27T13:30:41.097" Score="4" Body="&lt;p&gt;I don't think there is a built-in mechanism for this, so you may need to roll your own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't have a direct answer, but I have something similar in my config: I don't want to be prompted for confirmation when killing a file that matches what is on disk. To check this I'm running diff and then scanning the output -- you can probably do something similar for your use case. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/matches-file-p ()&#xA;  &quot;Return t if the current buffer is identical to its associated file.&quot;&#xA;  (autoload 'diff-no-select &quot;diff&quot;)&#xA;  (when buffer-file-name&#xA;    (diff-no-select buffer-file-name (current-buffer) nil 'noasync)&#xA;    (with-current-buffer &quot;*Diff*&quot;&#xA;      (search-forward-regexp &quot;^Diff finished \(no differences\)\.&quot; (point-max) 'noerror))))&#xA;&#xA;(defun my/kill-buffer ()&#xA;  &quot;Kill the current buffer.&#xA;Don't prompt for confirmation if the buffer is unmodified or matches its file.&quot;&#xA;  (interactive)&#xA;  (when (my/matches-file-p)&#xA;    (set-buffer-modified-p nil))&#xA;  (kill-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looking more at the auto-revert case. It looks like that prompt comes from &lt;code&gt;after-find-file&lt;/code&gt;, which is looking at timestamps (&lt;code&gt;file-newer-than-file-p&lt;/code&gt;). I don't see a straightforward way to customize or advise this behavior. Maybe you could advise &lt;code&gt;after-find-file&lt;/code&gt; to compare the file with its auto-save file and set the &lt;code&gt;warn&lt;/code&gt; argument to nil if things match. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-05-27T13:41:33.590" LastActivityDate="2015-05-27T13:41:33.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12734" PostTypeId="1" CreationDate="2015-05-27T13:48:25.603" Score="3" ViewCount="215" Body="&lt;p&gt;I've subscribed to the emacs-orgmode list on my Gmail account.  I've also subscribed Gnus to the list too, which means that I'm getting duplicates.  I prefer to read the mail in Gnus, and have it archived in Gmail, so that I have it even when gmane goes down for some time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have an email marked as read in Gmail when I read it in the Gnus org-mode group.&#xA;I've set &lt;code&gt;nnmail-treat-duplicates&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, but it doesn't seem to have an effect.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2710" LastEditDate="2015-05-27T14:27:48.933" LastActivityDate="2015-05-27T14:27:48.933" Title="How to deal with duplicate mail in Gnus?" Tags="|gnus|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12735" PostTypeId="1" CreationDate="2015-05-27T14:38:36.407" Score="4" ViewCount="115" Body="&lt;p&gt;If you ask for a function description, there is a line that starts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;It is bound to &amp;lt;...&amp;gt; &amp;lt;...&amp;gt; &amp;lt;...&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, for &lt;strong&gt;isearch&lt;/strong&gt; it says: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;It is bound to &amp;lt;menu-bar&amp;gt; &amp;lt;search&amp;gt; &amp;lt;isearch-forward&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What does it mean? Isn't it supposed to show the keybindings associated with the function?&lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="105" LastEditDate="2015-05-29T21:37:35.647" LastActivityDate="2019-01-14T03:48:54.230" Title="Understanding &quot;It is bound to ...&quot; message in describe-function" Tags="|key-bindings|functions|menu-bar|help|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12736" PostTypeId="2" ParentId="12693" CreationDate="2015-05-27T14:39:17.310" Score="2" Body="&lt;p&gt;Instead of &lt;code&gt;php-mode&lt;/code&gt; you can try &lt;code&gt;web-mode&lt;/code&gt;. It supports php very well and  seemed to indent correctly your example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;In order to make flycheck parses php, add the following to your web-mode-hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-mode 1)&#xA;(flycheck-add-mode 'php 'web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-05-30T14:10:24.167" LastActivityDate="2015-05-30T14:10:24.167" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12737" PostTypeId="2" ParentId="12735" CreationDate="2015-05-27T14:48:50.753" Score="5" Body="&lt;p&gt;Menu bar items are represented as keybindings internally.  So, this means that on the one hand keybinding-related actions will involve menu bar items and on the other one that clicking the &quot;Search&quot; item in the menu bar would yield a list where &lt;code&gt;isearch-forward&lt;/code&gt; would be a valid action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, the docs tell me something slightly different:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;It is bound to C-s, &amp;lt;menu-bar&amp;gt; &amp;lt;edit&amp;gt; &amp;lt;search&amp;gt; &amp;lt;i-search&amp;gt; &amp;lt;isearch-forward&amp;gt;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-05-27T14:55:24.383" LastActivityDate="2015-05-27T14:55:24.383" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12738" PostTypeId="1" AcceptedAnswerId="12739" CreationDate="2015-05-27T14:59:11.980" Score="11" ViewCount="1148" Body="&lt;p&gt;Magit displays the progression of multi-step commands with popup windows. For example, pressing &lt;kbd&gt;c&lt;/kbd&gt; brings up the commit menu, whence pressing &lt;kbd&gt;a&lt;/kbd&gt; will invoke &lt;code&gt;magit-commit-amend&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to include my own command &lt;code&gt;magit-commit-snapshot&lt;/code&gt;, and invoke it with &lt;kbd&gt;c&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt;. &lt;br&gt; &lt;code&gt;n: Snapshot&lt;/code&gt; should be displayed in the commit menu, after &lt;code&gt;s: Squash&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this? I can see that the bindings exist in &lt;code&gt;magit-key-mode.el&lt;/code&gt;, but I don't see an easy way to add to them from my &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2019-10-31T01:22:37.530" Title="Magit custom commands" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12739" PostTypeId="2" ParentId="12738" CreationDate="2015-05-27T15:51:20.297" Score="16" Body="&lt;p&gt;Starting with &lt;code&gt;v2.1.0&lt;/code&gt; you can do so using this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-action 'magit-commit-popup&#xA;  ?n &quot;Snapshot&quot; 'magit-commit-snapshot)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The next release of Magit will replace magit-popup with &lt;a href=&quot;https://magit.vc/manual/transient/&quot; rel=&quot;nofollow noreferrer&quot;&gt;transient&lt;/a&gt;.  (As of writing the current Magit release is v2.90.1.)  Using transient, you can add a custom command with &lt;code&gt;transient-append-suffix&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(transient-append-suffix 'magit-commit &quot;c&quot;&#xA;  '(&quot;n&quot; &quot;Snapshot&quot; magit-commit-snapshot))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more information, see the &lt;a href=&quot;https://magit.vc/manual/transient/Modifying-Existing-Transients.html#Modifying-Existing-Transients&quot; rel=&quot;nofollow noreferrer&quot;&gt;section on modifying existing transients&lt;/a&gt; in the manual.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2019-10-31T01:22:37.530" LastActivityDate="2019-10-31T01:22:37.530" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="12740" PostTypeId="1" CreationDate="2015-05-27T16:17:49.050" Score="13" ViewCount="355" Body="&lt;p&gt;&lt;kbd&gt;M-v&lt;/kbd&gt; following &lt;kbd&gt;C-v&lt;/kbd&gt; doesn't move the cursor back to the original position. Why is that? Can we make it happen? &lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="504" LastEditDate="2015-05-27T16:58:37.320" LastActivityDate="2015-05-27T16:58:37.320" Title="Why doesn't M-v following C-v move cursor back to the original position?" Tags="|scrolling|cursor|motion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12741" PostTypeId="2" ParentId="12740" CreationDate="2015-05-27T16:32:11.947" Score="13" Body="&lt;p&gt;You can try setting &lt;code&gt;scroll-preserve-screen-position&lt;/code&gt; to &lt;code&gt;always&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq scroll-preserve-screen-position 'always)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the documentation (&lt;code&gt;C-h v scroll-preserve-screen-position&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Controls if scroll commands move point to keep its screen position unchanged.&#xA;  A value of &lt;code&gt;nil&lt;/code&gt; means point does not keep its screen position except&#xA;  at the scroll margin or window boundary respectively.&#xA;  A value of &lt;code&gt;t&lt;/code&gt; means point keeps its screen position if the scroll&#xA;  command moved it vertically out of the window, e.g. when scrolling&#xA;  by full screens.&#xA;  Any other value means point always keeps its screen position.&#xA;  Scroll commands should have the &lt;code&gt;scroll-command&lt;/code&gt; property&#xA;  on their symbols to be controlled by this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="504" LastEditDate="2015-05-27T16:55:55.097" LastActivityDate="2015-05-27T16:55:55.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12742" PostTypeId="1" AcceptedAnswerId="12744" CreationDate="2015-05-27T17:05:53.677" Score="11" ViewCount="895" Body="&lt;p&gt;I have some code using &lt;code&gt;(looking-back … (line-beginning-position))&lt;/code&gt;.  Doc string of &lt;code&gt;looking-back&lt;/code&gt; states that it's better to avoid this function because of slowness. I'm curious will following approach be faster?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion&#xA;  (goto-char (line-beginning-position))&#xA;  (looking-at regexp stuff))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6844" LastEditorUserId="50" LastEditDate="2015-05-29T14:41:48.297" LastActivityDate="2015-05-29T16:41:43.680" Title="`looking-back` performance" Tags="|regular-expressions|performance|save-excursion|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12743" PostTypeId="1" AcceptedAnswerId="12752" CreationDate="2015-05-27T19:38:55.887" Score="3" ViewCount="136" Body="&lt;p&gt;When I add a mailto link with &lt;code&gt;C-c C-l&lt;/code&gt;, the closing &lt;code&gt;&amp;gt;&lt;/code&gt; is missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I enter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mailto:Apa &amp;lt;apa@bepa.cepa&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Leaving the description blank, I get a link like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mailto:Apa &amp;lt;apa@bepa.cepa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I end with &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;, the link is correct. If I enter it with markup like below, it works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[mailto:Apa &amp;lt;apa@bepa.cepa&amp;gt;]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This comes from the following snippet of &lt;code&gt;org-insert-link&lt;/code&gt; (Emacs 24.4.1)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (and (string-match org-plain-link-re link)&#xA;         (not (string-match org-ts-regexp link)))&#xA;    ;; URL-like link, normalize the use of angular brackets.&#xA;    (setq link (org-remove-angle-brackets link)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So modifying &lt;code&gt;org-plain-link-re&lt;/code&gt; or &lt;code&gt;org-ts-regexp&lt;/code&gt; is one way to achieve this. These are pretty impressive expressions, which looks a bit intimidating to touch. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; tags are used by org, and this is the likely reason for these types of mail links not getting treated like one would naively think, but I also can't believe I'm the only one that uses addresses of this type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So has anyone tweaked emacs org to accept this, or is it a bug, or is this address format considered evil?&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="675" LastEditDate="2015-05-27T23:50:31.217" LastActivityDate="2015-05-28T13:22:04.867" Title="How to allow org-insert-link to accept mail addresses like 'Name &lt;name@some.address&gt;'?" Tags="|org-mode|email|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12744" PostTypeId="2" ParentId="12742" CreationDate="2015-05-27T19:52:10.127" Score="10" Body="&lt;p&gt;Definitely. You will especially gain if you just want to test &lt;code&gt;char-before&lt;/code&gt; or search backward for a literal string.  And if you must use &lt;code&gt;looking-back&lt;/code&gt; then try to use a &lt;code&gt;LIMIT&lt;/code&gt; argument, if possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Emacs bug #&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17284&quot; rel=&quot;noreferrer&quot;&gt;17284&lt;/a&gt; for an example.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="124" LastEditDate="2015-05-29T16:41:43.680" LastActivityDate="2015-05-29T16:41:43.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12745" PostTypeId="1" AcceptedAnswerId="12748" CreationDate="2015-05-27T19:56:24.783" Score="4" ViewCount="1089" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/5929/8406&quot;&gt;How to sort file list in helm-find-files&lt;/a&gt; asks how to sort the file list so that directories float to the top.  My question is different:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to sort the files returned by &lt;code&gt;helm-find-files&lt;/code&gt; so that they appear sorted by &lt;em&gt;modification time&lt;/em&gt;, rather than &lt;em&gt;alphabetical order&lt;/em&gt; (i.e., as if they had been listed by &lt;code&gt;ls -lt&lt;/code&gt; rather than &lt;code&gt;ls -la&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2018-09-27T10:45:18.973" Title="How to sort file list in helm-find-files by date" Tags="|helm|shell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12746" PostTypeId="2" ParentId="5929" CreationDate="2015-05-27T19:57:08.257" Score="2" Body="&lt;p&gt;According to the comments from @Tu Do above, apparently that was possible at one time, but the feature has been taken out in commit &lt;a href=&quot;https://github.com/emacs-helm/helm/commit/8489bee0ceb9076b0d9ad8f19af63bcd730177b8&quot; rel=&quot;nofollow&quot;&gt;8489bee&lt;/a&gt; and related commits.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastActivityDate="2015-05-27T19:57:08.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12747" PostTypeId="1" AcceptedAnswerId="12757" CreationDate="2015-05-27T20:02:48.647" Score="5" ViewCount="1862" Body="&lt;p&gt;&lt;code&gt;M-x view-echo-area-messages&lt;/code&gt; (bound to &lt;code&gt;C-h e&lt;/code&gt; by default) is used to see the *Messages* buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get the following behavior when I press &lt;code&gt;C-h e&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the frame has just 1 window, split the frame to create a new window and show *Messages* in that new window.&lt;/li&gt;&#xA;&lt;li&gt;If the frame already has 2 or more windows, display *Messages* in the other window (not the current one).&lt;/li&gt;&#xA;&lt;li&gt;If the current window is already displaying *Messages* buffer, do NOT do anything (I tend to press &lt;code&gt;C-h e&lt;/code&gt; by mistake even when I am in the *Messages* buffer).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am able to achieve points 1 and 2 above using the below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Control where the *Messages* buffer opens&#xA;(add-to-list 'display-buffer-alist&#xA;             '(&quot;\\*Messages\\*&quot; . ((display-buffer-reuse-window&#xA;                                    display-buffer-pop-up-window)&#xA;                                   . ((inhibit-same-window . t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But with the above elisp snippet, if I am already in a window with *Messages* and if I do &lt;code&gt;C-h e&lt;/code&gt;, it pops up another window displaying the same buffer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I basically need emacs to ignore &lt;code&gt;(inhibit-same-window . t)&lt;/code&gt; if the current buffer matches &lt;code&gt;&quot;\\*Messages\\*&quot;&lt;/code&gt;. How do I do it?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-27T20:12:46.443" LastActivityDate="2015-05-28T05:05:53.200" Title="How to conditionally reuse the current window to display a buffer?" Tags="|buffers|display-buffer-alist|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12748" PostTypeId="2" ParentId="12745" CreationDate="2015-05-27T20:26:19.217" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Yes -- use the source.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;With a little help from &lt;a href=&quot;https://stackoverflow.com/questions/26514437/emacs-sort-list-of-directories-files-by-modification-date&quot;&gt;StackOverflow | Emacs — sort list of directories / files by modification date&lt;/a&gt;...  Here's a modified version of &lt;code&gt;helm-ff-directory-files&lt;/code&gt; that does the job.   Note that you should &lt;code&gt;(require 'files)&lt;/code&gt; to get this working.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-ff-directory-files (directory)&#xA;  &quot;List contents of DIRECTORY.&#xA;Argument FULL mean absolute path.&#xA;It is same as `directory-files' but always returns the&#xA;dotted filename '.' and '..' even on root directories in Windows&#xA;systems.&quot;&#xA;  (setq directory (file-name-as-directory&#xA;                   (expand-file-name directory)))&#xA;  (let* (file-error&#xA;         (ls   (mapcar #'car&#xA;                       (sort (directory-files-and-attributes&#xA;                              directory 'full&#xA;                              directory-files-no-dot-files-regexp t)&#xA;                             #'(lambda (x y)&#xA;                                 (not (time-less-p (nth 6 x) (nth 6 y)))))))&#xA;         (dot  (concat directory &quot;.&quot;))&#xA;         (dot2 (concat directory &quot;..&quot;)))&#xA;    (puthash directory (+ (length ls) 2) helm-ff--directory-files-hash)&#xA;    (append (and (not file-error) (list dot dot2)) ls)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2018-09-27T10:45:18.973" LastActivityDate="2018-09-27T10:45:18.973" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="12749" PostTypeId="2" ParentId="12747" CreationDate="2015-05-27T20:36:43.890" Score="4" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (unless (equal &quot;*Messages*&quot; (buffer-name (window-buffer)))&#xA;    (display-buffer &quot;*Messages*&quot; (if (one-window-p)&#xA;                                     'display-buffer-pop-up-window&#xA;                                   'display-buffer-reuse-window))))&#xA;&#xA;(global-set-key (kbd &quot;C-h e&quot;) 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-27T20:36:43.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12750" PostTypeId="1" AcceptedAnswerId="12769" CreationDate="2015-05-27T22:09:44.400" Score="2" ViewCount="228" Body="&lt;p&gt;I am trying to pass an argument to a groovy babel block but I'm not sure it accepts arguments?  The &lt;a href=&quot;http://orgmode.org/org.html#var&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; says that it is language-specific but I didn't find any documentation for &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/plain/lisp/ob-groovy.el&quot; rel=&quot;nofollow&quot;&gt;ob-groovy&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want to try to feed one section of my document into the groovy block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME:current_paths&#xA;&#xA;path1&#xA;path2&#xA;path3&#xA;&#xA;&#xA;** Groovy Processing&#xA;#+BEGIN_SRC groovy :var paths=current_paths :results output :cache yes&#xA;    paths.each {&#xA;      println &quot;PATH: $it&quot;&#xA;    }&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Caught: groovy.lang.MissingPropertyException: &#xA;No such property: paths     for class: groovy-6160mqV&#xA;    at groovy-6160mqV.run(groovy-6160mqV:2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know if groovy babel support includes arguments?  Or maybe I'm doing this wrong?&lt;/p&gt;&#xA;" OwnerUserId="8240" LastActivityDate="2015-05-28T14:04:11.280" Title="Does org-babel for groovy take arguments?" Tags="|org-mode|org-babel|literate-programming|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12751" PostTypeId="2" ParentId="12725" CreationDate="2015-05-27T22:26:50.683" Score="0" Body="&lt;p&gt;Try superword-mode. This won't take you inside symbols like long-function-name though, it will skip over the whole thing.&lt;/p&gt;&#xA;" OwnerUserId="8327" LastActivityDate="2015-05-27T22:26:50.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12752" PostTypeId="2" ParentId="12743" CreationDate="2015-05-27T23:03:48.797" Score="2" Body="&lt;p&gt;Since &lt;code&gt;org-remove-angle-brackets&lt;/code&gt; is responsable for actually striping the &quot;&amp;lt;&gt;&quot; from the link, we can fix this by adding some advice saying that if the link starts with &quot;mailto:&quot;, just return the link, otherwise do whatever the original function does.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add #'org-remove-angle-brackets :before-until&#xA;            (lambda (s) (if (string-prefix-p &quot;mailto:&quot; s) s)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="675" LastEditDate="2015-05-27T23:50:05.837" LastActivityDate="2015-05-27T23:50:05.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12753" PostTypeId="1" AcceptedAnswerId="12758" CreationDate="2015-05-27T23:36:39.783" Score="1" ViewCount="403" Body="&lt;p&gt;I just started using evil-mode after having used elscreen for a long time. evil-mode will bind the &lt;code&gt;C-z&lt;/code&gt; key to &lt;code&gt;evil-emacs-state&lt;/code&gt; but do you know how I can rebind either this function, or the elscreen emacs key?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastEditorUserId="2421" LastEditDate="2015-05-28T00:09:13.840" LastActivityDate="2015-05-28T04:36:48.627" Title="Using evil and elscreen together" Tags="|evil|elscreen|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12754" PostTypeId="2" ParentId="12723" CreationDate="2015-05-28T00:24:20.260" Score="3" Body="&lt;p&gt;I'd set up a periodic timer to check for the condition and cancel the timer when the condition becomes true.  Since it requires a little bit of higher-order programming, it's somewhat easier with lexical binding (no need for backquote surgery).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;-*- lexical-binding: t -*-&#xA;&#xA;(defvar piziak-timer nil&#xA;  &quot;The currently active Piziak-style timer&quot;)&#xA;&#xA;(defvar piziak-interval 0.1&#xA;  &quot;Interval in seconds for Piziak-style timers&quot;)&#xA;&#xA;(defun piziak-cancel ()&#xA;  &quot;Cancel the current Piziak-style timer&quot;&#xA;  (cancel-timer piziak-timer)&#xA;  (setq piziak-timer nil))&#xA;&#xA;(defun piziak-do-when (predicate action)&#xA;  &quot;Execute action when predicate becomes true.&#xA;This sets up a Piziak-style timer.&quot;&#xA;  (when (not (null piziak-timer))&#xA;    (error &quot;I am a Bear of Very Little Brain&quot;))&#xA;  (let ((timer (timer-create)))&#xA;    (timer-set-time timer (current-time) piziak-interval)&#xA;    (timer-set-function&#xA;     timer&#xA;     ;; This depends on lexical binding&#xA;     #'(lambda () (when (funcall predicate)&#xA;                    (piziak-cancel)&#xA;                    (funcall action))))&#xA;    (timer-activate timer)&#xA;    (setq piziak-timer timer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-05-28T00:24:20.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12755" PostTypeId="2" ParentId="12725" CreationDate="2015-05-28T02:11:59.053" Score="5" Body="&lt;p&gt;Since the answer is picked from the comment from @kaushalmodi, I cannot choose the comment as an answer, so I post this as the right answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to comment from @kaushalmodim, &lt;code&gt;syntax-subword&lt;/code&gt; is great, it is exactly what I need. You can install it using package.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my configuration in &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-syntax-subword-mode)&#xA;(setq syntax-subword-skip-spaces t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="794" LastActivityDate="2015-05-28T02:11:59.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12756" PostTypeId="1" CreationDate="2015-05-28T02:16:36.343" Score="1" ViewCount="134" Body="&lt;p&gt;I have just started using org-mode and org-babel as a lab notebook. I am trying to use a code block to fill in two columns of a table. The code block seems to work for the first column because those are the right numbers. However, when trying to concatenate a string to the file name in column three so the code blocks works on a different set of files it seems to just run the code block on the original files instead, which produces the same output as column one.    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: tRNAs&#xA;#+begin_src sh :var filename=&quot;&quot; :results silent&#xA;cd Data/tRNA&#xA;grep -c &quot;&amp;gt;&quot; $filename&#xA;#+end_src&#xA;&#xA;&#xA;#+tblname: sequences&#xA;| # of Sequences before QC | # after QC | Original File name|&#xA;|--------------------------+------------+------------------|&#xA;|                   681865 |     681865 | read1            |&#xA;|                   324223 |     324223 | read2            |&#xA;|                  1014578 |    1014578 | read3            |&#xA;|                   971965 |     971965 | read4            |&#xA;|                   931777 |     931777 | read5            |&#xA;|                   810798 |     810798 | read6            |&#xA;|                   965134 |     965134 | read7            |&#xA;|                   718474 |     718474 | read8            |&#xA;|--------------------------+------------+------------------|&#xA;#+TBLFM: $1='(org-sbe tRNAs (filename (concat &quot;\&quot;&quot; $3 &quot;\&quot;&quot;)))&#xA;#+TBLFM: $2='(org-sbe tRNAs (filename (concat &quot;\&quot;final_&quot; $3 &quot;\&quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8439" LastActivityDate="2015-05-28T22:58:05.227" Title="org-babel not concatenating strings before sending to code block variable" Tags="|org-mode|org-babel|org-table|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12757" PostTypeId="2" ParentId="12747" CreationDate="2015-05-28T03:11:31.640" Score="4" Body="&lt;p&gt;While @Drew's solution works as I wanted, I was looking for a generic solution that I can apply to multiple cases; not just to *Messages* buffer. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Step 1: General Setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Advise &lt;code&gt;display-buffer&lt;/code&gt; to not execute if the current buffer is same as the&#xA;to-be-displayed buffer if the new ALIST entry &lt;code&gt;inhibit-duplicate-buffer&lt;/code&gt;&#xA;is non-nil.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/execute-display-buffer-if-nil (buffer-or-name &amp;amp;optional action frame)&#xA;  &quot;This functions advices `display-buffer' such that `display-buffer' gets&#xA;executed only if this function returns `nil'.&#xA;&#xA;This function returns `t' when below two conditions are true:&#xA;1. BUFFER-OR-NAME has a matching entry in `display-buffer-alist' with a&#xA;   non-nil `inhibit-duplicate-buffer' entry in its ALIST.&#xA;2. BUFFER-OR-NAME is same as the current buffer.&quot;&#xA;  ;; logic borrowed from the `display-function' definition&#xA;  (if (null display-buffer-function)&#xA;      (let* ((user-action&#xA;              (display-buffer-assq-regexp&#xA;               (buffer-name buffer-or-name) display-buffer-alist action))&#xA;             ;; end of borrowed logic&#xA;             (inhibit-duplicate-buffer (cdr (assq 'inhibit-duplicate-buffer user-action))))&#xA;        (and inhibit-duplicate-buffer ; condition 1&#xA;             (equal buffer-or-name (window-buffer)))) ; condition 2&#xA;    nil))&#xA;(advice-add 'display-buffer :before-until #'modi/execute-display-buffer-if-nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that this advice style needs emacs 24.4+.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Step 2: Configuration specific to *Messages* buffer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;display-buffer-alist&lt;/code&gt; to set the buffer displaying rules for *Messages* buffer; now setting a non-nil value for the new ALIST entry &lt;code&gt;inhibit-duplicate-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Control where to display the *Messages* buffer&#xA;(add-to-list 'display-buffer-alist&#xA;             '(&quot;\\*Messages\\*&quot; . ((display-buffer-reuse-window&#xA;                                    display-buffer-pop-up-window)&#xA;                                   . ((inhibit-duplicate-buffer . t)&#xA;                                      (inhibit-same-window      . t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-28T05:05:53.200" LastActivityDate="2015-05-28T05:05:53.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12758" PostTypeId="2" ParentId="12753" CreationDate="2015-05-28T04:36:48.627" Score="3" Body="&lt;p&gt;I believe you have three options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- Change elscreen key prefix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq elscreen-prefix-key &quot;\C-.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2- Manually override evil C-z binding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;\C-z\C-c&quot; 'elscreen-create)&#xA;(define-key evil-normal-state-map &quot;\C-zc&quot;    'elscreen-create)&#xA;(define-key evil-normal-state-map &quot;\C-zC&quot;    'elscreen-clone)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-k&quot; 'elscreen-kill)&#xA;(define-key evil-normal-state-map &quot;\C-zk&quot;    'elscreen-kill)&#xA;(define-key evil-normal-state-map &quot;\C-z\M-k&quot; 'elscreen-kill-screen-and-buffers)&#xA;(define-key evil-normal-state-map &quot;\C-zK&quot;    'elscreen-kill-others)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-p&quot; 'elscreen-previous)&#xA;(define-key evil-normal-state-map &quot;\C-zp&quot;    'elscreen-previous)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-n&quot; 'elscreen-next)&#xA;(define-key evil-normal-state-map &quot;\C-zn&quot;    'elscreen-next)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-a&quot; 'elscreen-toggle)&#xA;(define-key evil-normal-state-map &quot;\C-za&quot;    'elscreen-toggle)&#xA;(define-key evil-normal-state-map &quot;\C-z'&quot;    'elscreen-goto)&#xA;(define-key evil-normal-state-map &quot;\C-z\&quot;&quot;   'elscreen-select-and-goto)&#xA;(define-key evil-normal-state-map &quot;\C-z0&quot;    'elscreen-jump-0)&#xA;(define-key evil-normal-state-map &quot;\C-z1&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z2&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z3&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z4&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z5&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z6&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z7&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z8&quot;    'elscreen-jump)&#xA;(define-key evil-normal-state-map &quot;\C-z9&quot;    'elscreen-jump-9)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-s&quot; 'elscreen-swap)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-w&quot; 'elscreen-display-screen-name-list)&#xA;(define-key evil-normal-state-map &quot;\C-zw&quot;    'elscreen-display-screen-name-list)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-m&quot; 'elscreen-display-last-message)&#xA;(define-key evil-normal-state-map &quot;\C-zm&quot;    'elscreen-display-last-message)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-t&quot; 'elscreen-display-time)&#xA;(define-key evil-normal-state-map &quot;\C-zt&quot;    'elscreen-display-time)&#xA;(define-key evil-normal-state-map &quot;\C-zA&quot;    'elscreen-screen-nickname)&#xA;(define-key evil-normal-state-map &quot;\C-zb&quot;    'elscreen-find-and-goto-by-buffer)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-f&quot; 'elscreen-find-file)&#xA;(define-key evil-normal-state-map &quot;\C-z\C-r&quot; 'elscreen-find-file-read-only)&#xA;(define-key evil-normal-state-map &quot;\C-zd&quot;    'elscreen-dired)&#xA;(define-key evil-normal-state-map &quot;\C-z\M-x&quot; 'elscreen-execute-extended-command)&#xA;(define-key evil-normal-state-map &quot;\C-zi&quot;    'elscreen-toggle-display-screen-number)&#xA;(define-key evil-normal-state-map &quot;\C-zT&quot;    'elscreen-toggle-display-tab)&#xA;(define-key evil-normal-state-map &quot;\C-z?&quot;    'elscreen-help)&#xA;(define-key evil-normal-state-map &quot;\C-zv&quot;    'elscreen-display-version)&#xA;(define-key evil-normal-state-map &quot;\C-zj&quot;    'elscreen-link)&#xA;(define-key evil-normal-state-map &quot;\C-zs&quot;    'elscreen-split)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;3 Make your custom bindings to evil, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;gt&quot; 'elscreen-next)&#xA;(define-key evil-normal-state-map &quot;gT&quot; 'elscreen-previous)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-28T04:36:48.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12759" PostTypeId="1" AcceptedAnswerId="12783" CreationDate="2015-05-28T08:17:00.857" Score="3" ViewCount="436" Body="&lt;p&gt;I have following file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aaaa1&#xA;bbbb&#xA;cccc&#xA;dddd&#xA;aaaa2&#xA;eeee&#xA;ffff&#xA;aaaa3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to perform 'narrowing search', so if I search for &lt;code&gt;aaaa&lt;/code&gt; my original buffer will become:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aaaa1&#xA;aaaa2&#xA;aaaa3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any tool for doing such thing ?&lt;/p&gt;&#xA;" OwnerUserId="8440" LastEditorUserId="253" LastEditDate="2015-05-28T09:14:55.877" LastActivityDate="2015-05-28T23:29:38.937" Title="Narrowing search" Tags="|search|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12760" PostTypeId="2" ParentId="12759" CreationDate="2015-05-28T08:54:59.847" Score="3" Body="&lt;p&gt;So you can do &lt;code&gt;occur&lt;/code&gt; or use something fancier like &lt;code&gt;helm-swoop&lt;/code&gt; to bring up a narrowed search buffer depending on your criteria. Both of these modes can then edit the search buffer and the results can be saved to the original buffer. The narrow functions are really just for contiguous lines of text (by region, defun or page).&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-05-28T08:54:59.847" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12761" PostTypeId="1" AcceptedAnswerId="12767" CreationDate="2015-05-28T09:56:24.330" Score="3" ViewCount="422" Body="&lt;p&gt;I am still very much a beginner when it comes to version control, and am using magit.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like committing changes (frequently but not always?) triggers &quot;reverting buffer&quot; messages, one for each open buffer in the relevant repository. I panic every time I see one of these messages, thinking I lost the changes I just reviewed and/or committed. I don't really understand why there would be anything to revert. As far as I can tell my buffer should not have changed simply because I made a commit. I didn't kill a hunk, checkout a different branch or anything like that.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assuming this sounds like normal behavior and not a bug related to my configuration, can someone explain what is happening?&lt;/li&gt;&#xA;&lt;li&gt;And assuming its safe and reliable, is there a way to turn those messages off except when the buffer really has been changed?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="874" LastEditorUserId="306" LastEditDate="2015-07-03T12:53:47.130" LastActivityDate="2015-07-03T12:53:47.130" Title="Why does magit give so many &quot;reverting buffer&quot; messages?" Tags="|magit|version-control|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12763" PostTypeId="2" ParentId="12756" CreationDate="2015-05-28T11:23:25.427" Score="3" Body="&lt;p&gt;You can only have one &lt;code&gt;#+TBLFM&lt;/code&gt; line per table. Separate formula with &quot;::&quot;. Does it work if you have the following?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: $1='(org-sbe tRNAs (filename (concat &quot;\&quot;&quot; $3 &quot;\&quot;&quot;)))::$2='(org-sbe tRNAs (filename (concat &quot;\&quot;final_&quot; $3 &quot;\&quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastEditorUserId="91" LastEditDate="2015-05-28T22:58:05.227" LastActivityDate="2015-05-28T22:58:05.227" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12764" PostTypeId="2" ParentId="6111" CreationDate="2015-05-28T11:26:49.973" Score="1" Body="&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: make sure that important keys aren't hard to reach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I second wvxvw's answer about Kinesis as preventative against &quot;Emacs Pinky&quot;.  I've used mine for 14 years so the investment has pretty much paid off by now I'm sure.  On the Kinesis, I mapped the &lt;em&gt;bottom row&lt;/em&gt; to modifiers (&lt;code&gt;s-H-C-M&lt;/code&gt; / &lt;code&gt;M-C-H-s&lt;/code&gt;) and have &lt;code&gt;Mode_switch&lt;/code&gt; on thumb keys to access  &quot;embedded arrow keys&quot;.  This set up leaves very little to be desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are still times when I have to or choose to type on a laptop, and I have something similar set up, remapping the &lt;em&gt;number row&lt;/em&gt; to modifers, and putting the number symbols on the &lt;em&gt;function keys&lt;/em&gt; (see my &lt;a href=&quot;http://metameso.org/~joe/switched.modmap&quot; rel=&quot;nofollow&quot;&gt;.xmodmap&lt;/a&gt; or &lt;a href=&quot;http://metameso.org/~joe/mbp.xkb&quot; rel=&quot;nofollow&quot;&gt;.xkb&lt;/a&gt; file for details).  This, again, means that there is little torsion on my wrists, and no stress at all on the pinkies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In recent months I've noticed some stress in the fingers I use for &lt;code&gt;Control&lt;/code&gt; and &lt;code&gt;Mode_switch&lt;/code&gt; on the laptop.  It's always a good idea to try to reduce stress when you notice it.  I played around with &lt;a href=&quot;http://emacswiki.org/emacs/StickyModifiers&quot; rel=&quot;nofollow&quot;&gt;sticky keys&lt;/a&gt;, but I found that current support for them leaves a lot to be desired.  A pity, because they are a really good idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I've had some luck with &lt;a href=&quot;https://github.com/chrisdone/god-mode&quot; rel=&quot;nofollow&quot;&gt;God mode&lt;/a&gt;, which is like a souped up sticky &lt;code&gt;Control&lt;/code&gt; key, but only within Emacs.  Messing around with that and &lt;a href=&quot;https://gitorious.org/evil/pages/Home&quot; rel=&quot;nofollow&quot;&gt;Evil mode&lt;/a&gt;, I &lt;a href=&quot;https://gist.github.com/holtzermann17/ba34f4cccf732c29f6209e7e795005de&quot; rel=&quot;nofollow&quot;&gt;observed&lt;/a&gt; that it is straightforward to define a similar sticky &lt;code&gt;Meta&lt;/code&gt; key -- or you could define other modifiers or embedded layers. &lt;a href=&quot;https://github.com/jbranso/evil-dvorak#keymap&quot; rel=&quot;nofollow&quot;&gt;evil-dvorak&lt;/a&gt; is one related optimization, although the selected keymap is somewhat personal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize the main ergo-relevant customizations that have helped me &quot;live in emacs&quot; to a reasonably high degree:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;~10 years: Kinesis, dvorak, Xmodmap/Xkb, Ratpoison (important: set RP's escape to something within reach, &lt;code&gt;C-t&lt;/code&gt; is the default, but that can easily be improved upon) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;~1 year: Pentadactyl (with &lt;a href=&quot;http://www.jnanam.net/pentadactylemacs/.pentadactylrc&quot; rel=&quot;nofollow&quot;&gt;Emacs bindings&lt;/a&gt;), God mode + Evil mode (an unholy alliance), and switching to a standing desk during part of the day.  Also, Helm for quickly entering commands.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2016-10-24T20:31:02.683" LastActivityDate="2016-10-24T20:31:02.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12765" PostTypeId="2" ParentId="10454" CreationDate="2015-05-28T12:26:23.100" Score="7" Body="&lt;p&gt;The short answer is unless you read through the code yourself you are taking a lot on trust. Having said that trusting a project sourced from an upstream SCM is a little safer than one which has been pulled directly from the &lt;a href=&quot;http://www.emacswiki.org/emacs/ElispArea&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt; for example. However fundamentally you are trusting the author of the package not to turn evil and abuse the ability to run arbitrary code under your Emacs session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some things that may make you feel safer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Stick to popular packages&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;While popular packages don't automatically get more review the fact they have more users mean the chances of malicious behaviour being detected before it affects you increases.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Look at the code metrics&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On github you can get a fairly &lt;a href=&quot;https://github.com/emacs-helm/helm/graphs/contributors&quot; rel=&quot;nofollow&quot;&gt;good view&lt;/a&gt; of the projects contribution history. Even if the principle author makes most of the commits having a wide range of authors shows there are other people with an active interest in the stability and effectiveness of the code.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Prefer GNU ELPA and MELPA Stable to repositories tracking HEADs (MELPA) or allowing un-vetted submissions (Marmalade)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;While living on the bleeding edge has a certain appeal for those who want the latest shiny features it does mean you might be the first to accept the latest commit into your environment. Even if not malicious you may well get a package in a state of flux while an &quot;official&quot; release will of least had some sort of cursory review. For example GNU ELPA packages will only get committed by those emacs-devel users with commit rights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately I'm sure there will at some point be a security breach via the package system even if it is only a proof of concept experiment. That will be the point you may have to rely on your regular backups.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2015-05-28T18:08:22.350" LastActivityDate="2015-05-28T18:08:22.350" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12766" PostTypeId="2" ParentId="6111" CreationDate="2015-05-28T13:07:38.577" Score="4" Body="&lt;p&gt;step 1, install evil-mode (&lt;a href=&quot;http://www.emacswiki.org/emacs/Evil&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/Evil&lt;/a&gt;). It uses vim key bindings and provides advanced vim features like text objects, so you type much less Ctrl, Alt&lt;/p&gt;&#xA;&#xA;&lt;p&gt;step 2, use evil-leader (&lt;a href=&quot;https://github.com/cofi/evil-leader&quot; rel=&quot;nofollow&quot;&gt;https://github.com/cofi/evil-leader&lt;/a&gt;), you press leader key (I map it into &quot;,&quot;) first then type combination of any keys to trigger a command. Please take full advantage of it, you will never need Ctrl and Alt any more, for example, I use &quot;,mx&quot; to replace M-x&lt;/p&gt;&#xA;&#xA;&lt;p&gt;step 3, install evil-escape (&lt;a href=&quot;https://github.com/syl20bnr/evil-escape&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syl20bnr/evil-escape&lt;/a&gt;), you press &quot;kj&quot; to simulate &quot;C-g&quot; and &quot;ESC&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution works in any terminal, BTW.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An brilliant example is spacemacs &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syl20bnr/spacemacs&lt;/a&gt; (but SPACE key is used as leader key there)&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-06-17T03:40:36.110" LastActivityDate="2015-06-17T03:40:36.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12767" PostTypeId="2" ParentId="12761" CreationDate="2015-05-28T13:07:45.143" Score="7" Body="&lt;p&gt;Magit should only revert a file-visiting buffer if the file has actually changed on disk, see &lt;code&gt;magit-revert-buffers&lt;/code&gt;. That function uses &lt;code&gt;verify-visited-file-modtime&lt;/code&gt; to determine whether that is the case. Committing does not change any files, so you should not see any messages about files being reverted. Maybe something else, like e.g. a commit hook, is needlessly touching the files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reverting a buffer which doesn't need to be reverted isn't dangerous, but you will see the messages anyway.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-05-28T13:16:56.900" LastActivityDate="2015-05-28T13:16:56.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12768" PostTypeId="2" ParentId="12743" CreationDate="2015-05-28T13:22:04.867" Score="1" Body="&lt;p&gt;It's expecting a URL, and &lt;code&gt;' '&lt;/code&gt; (space), &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; (angle brackets), &lt;code&gt;&quot;&lt;/code&gt; (double quotes) are not valid characters in a URL, and so must be encoded.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;' '&lt;/code&gt; becomes &lt;code&gt;%20&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&quot;&lt;/code&gt; becomes &lt;code&gt;%22&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;lt;&lt;/code&gt; becomes &lt;code&gt;%3c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; becomes &lt;code&gt;%3e&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, the email address:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Apa &amp;lt;apa@bepa.cepa&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is expressed as a URL like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mailto:%22Apa%22%20%3capa@bepa.cepa%3e&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is a chore to write.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, Emacs would check whether the entered link uses the &lt;code&gt;mailto:&lt;/code&gt; URL scheme and encode the special characters for you. In the meantime, perhaps some advice?&lt;/p&gt;&#xA;" OwnerUserId="8442" LastActivityDate="2015-05-28T13:22:04.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12769" PostTypeId="2" ParentId="12750" CreationDate="2015-05-28T14:04:11.280" Score="1" Body="&lt;p&gt;Looking at the source code you linked, it seems that no, there is no support for the &lt;code&gt;:vars&lt;/code&gt; parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:results&lt;/code&gt; and &lt;code&gt;:cache&lt;/code&gt; parameters should be handled directly by &lt;code&gt;org-babel&lt;/code&gt; so these should work.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you're interested in the details, the function used to expand the source code body (mainly in charge of adding code before and after, and initializing variables) is the generic function &lt;code&gt;org-babel-expand-body:generic&lt;/code&gt; (not a groovy-specific function), and the third (optional) parameter of this function (lines to add to define variables) is not specified.&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2015-05-28T14:04:11.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12770" PostTypeId="1" AcceptedAnswerId="12771" CreationDate="2015-05-28T14:54:15.463" Score="4" ViewCount="1002" Body="&lt;p&gt;I want to automatically install packages that I don't have locally installed when I initialize Emacs. I use the following code to install some packages.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;(mapc #'(lambda (pkg)&#xA;           (if (not (package-installed-p pkg))&#xA;                     (package-install pkg)))&#xA;            (list&#xA;             'json-mode&#xA;             ; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when loading Emacs, Emacs says the package is not available for installation. However, it exists on the packages buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error: Package `json-mode' is not available for installation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what I am doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2804" LastEditorUserId="675" LastEditDate="2015-05-28T18:12:19.340" LastActivityDate="2015-05-28T18:12:19.340" Title="Automatic package install is not available, package exists" Tags="|package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12771" PostTypeId="2" ParentId="12770" CreationDate="2015-05-28T14:58:13.987" Score="7" Body="&lt;p&gt;You most likely need a &lt;code&gt;package-refresh-contents&lt;/code&gt; call to download the list of available packages first:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-useful-packages&#xA;  '(ace-jump-mode ace-jump-buffer ... ))&#xA;&#xA;(defun my-check-and-maybe-install (pkg)&#xA;  &quot;Check and potentially install `PKG'.&quot;&#xA;  (when (not (package-installed-p pkg))&#xA;    (when (not (require pkg nil t))&#xA;      (package-install pkg))))&#xA;&#xA;(defun my-packages-reset()&#xA;  &quot;Reset package manifest to the defined set.&quot;&#xA;  (interactive)&#xA;  (package-refresh-contents)&#xA;  (mapc 'my-check-and-maybe-install my-useful-packages))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="129" LastEditorUserId="115" LastEditDate="2015-05-28T15:21:43.560" LastActivityDate="2015-05-28T15:21:43.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12772" PostTypeId="1" AcceptedAnswerId="12775" CreationDate="2015-05-28T15:09:38.447" Score="26" ViewCount="16648" Body="&lt;p&gt;Where can I find pre-built Emacs for what Ubuntu calls &lt;em&gt;emacs 25.1&lt;/em&gt;?&lt;/p&gt;&#xA;" OwnerUserId="776" LastEditorUserId="2335" LastEditDate="2018-03-25T23:03:58.053" LastActivityDate="2018-03-25T23:03:58.053" Title="Prebuilt Ubuntu Emacs &quot;25.1&quot;" Tags="|linux|ubuntu|emacs25|binary|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12773" PostTypeId="2" ParentId="12679" CreationDate="2015-05-28T15:12:19.873" Score="14" Body="&lt;p&gt;These are saved session files which emacs dumps when the window manager notifies it that it is shutting down. See the function &lt;code&gt;emacs-session-save&lt;/code&gt;. There are multiple files because they are suffixed by the X session ID. Are you by chance in the habit of quitting your window manager before you exit emacs?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-05-28T15:12:19.873" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12774" PostTypeId="2" ParentId="12772" CreationDate="2015-05-28T15:17:17.287" Score="31" Body="&lt;p&gt;Use the snapshot:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo add-apt-repository -y ppa:ubuntu-elisp&#xA;sudo apt-get update&#xA;sudo apt-get install emacs-snapshot&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-28T15:17:17.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12775" PostTypeId="2" ParentId="12772" CreationDate="2015-05-28T15:35:33.693" Score="22" Body="&lt;p&gt;In addition to what abo-abo suggests, you can also build the sources by yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;git clone git://git.savannah.gnu.org/emacs.git&#xA;cd emacs&#xA;sudo apt-get build-dep emacs24 # for rpm-based linux: sudo yum-builddep emacs&#xA;./configure                    # if there's no configure script: ./autogen.sh&#xA;make                           # if that fails: make bootstrap&#xA;sudo make install&#xA;make clean&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="719" LastEditDate="2016-06-20T20:52:29.520" LastActivityDate="2016-06-20T20:52:29.520" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12776" PostTypeId="1" CreationDate="2015-05-28T17:59:45.523" Score="5" ViewCount="705" Body="&lt;p&gt;I would like to save an eww buffer as an html buffer with text formatting, hyperlinks, etc preserved. If I do &lt;code&gt;C-x C-w&lt;/code&gt;, it saves only the raw text visible in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my use case: I use the below helper function to clean up a web page to show only the information relevant to me.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/eww-keep-lines (regexp)&#xA;  &quot;Show only the lines matching regexp in the web page.&#xA;Call `eww-reload' to undo the filtering.&quot;&#xA;  (interactive (list (read-from-minibuffer&#xA;                      &quot;Keep only lines matching regexp: &quot;)))&#xA;  (let ((inhibit-read-only t)) ; ignore read-only status of eww buffers&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (keep-lines regexp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hyperlinks and text properties are preserved in the eww buffer after calling the above function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to save the filtered eww buffer I get after calling the above function as an html file.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-05-28T20:26:09.337" LastActivityDate="2015-05-28T20:26:09.337" Title="How to save an eww buffer as an html file with all formatting preserved?" Tags="|html|eww|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12777" PostTypeId="1" AcceptedAnswerId="12778" CreationDate="2015-05-28T19:23:06.627" Score="10" ViewCount="864" Body="&lt;p&gt;I like the idea of &lt;code&gt;.dir-locals.el&lt;/code&gt;.  I have my own &lt;code&gt;.dir-locals.el&lt;/code&gt; file in my home directory that should set all the variables for directories/files that I open unless there is &lt;code&gt;.dir-locals.el&lt;/code&gt; closer to the directory I open the file in.  However, even though the file is recognized, directory variables for subdirectories are not applied to opened files.&lt;/p&gt;&#xA;&lt;p&gt;This is my &lt;code&gt;~/.dir-locals.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;((&amp;quot;dev/school&amp;quot; .&#xA;  ((indent-tabs-mode . nil)&#xA;   (c-basic-offset . 4)))&#xA; (&amp;quot;dev/test&amp;quot; .&#xA;  ((indent-tabs-mode . nil)&#xA;   (c-basic-offset . 4)))&#xA; (c-mode .&#xA;  ((c-file-style . &amp;quot;linux&amp;quot;)&#xA;   (c-basic-offset . 8))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I open file &lt;code&gt;~/dev/test/test.c&lt;/code&gt; the variable &lt;code&gt;indent-tabs-mode&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt; and &lt;code&gt;c-basic-offset&lt;/code&gt; is &lt;code&gt;8&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(describe-variable 'c-basic-offset)&lt;/code&gt; in that file tells me it is set to &lt;code&gt;8&lt;/code&gt; from &lt;code&gt;~/.dir-locals.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(describe-variable 'indent-tabs-mode)&lt;/code&gt; in that file says it's value (&lt;code&gt;t&lt;/code&gt;) is just in its default state.&lt;/p&gt;&#xA;&lt;p&gt;Can I somehow achieve the desired behaviour?  What am I doing wrong?  How are file paths mapped to subdirectories in &lt;code&gt;~/.dir-locals.el&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;h3&gt;Edit:&lt;/h3&gt;&#xA;&lt;p&gt;As &lt;a href=&quot;https://emacs.stackexchange.com/questions/12777/how-are-file-paths-mapped-to-subdirectories-in-dir-locals-el/12778#12778&quot;&gt;Jonathan suggested&lt;/a&gt;, I also tried:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(;; dev/school subdir&#xA; (&amp;quot;dev/school&amp;quot; .&#xA;  ;; dev/school specification for all modes&#xA;  (nil . ((indent-tabs-mode . nil)&#xA;          (c-basic-offset . 4)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and even what &lt;code&gt;add-dir-local-variable&lt;/code&gt; added:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;((&amp;quot;dev/school&amp;quot;&#xA;  (indent-tabs-mode)&#xA;  (c-basic-offset . 4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Unfortunately, none of those work either.&lt;/p&gt;&#xA;" OwnerUserId="8445" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-05-29T13:32:22.720" Title="How are file paths mapped to subdirectories in .dir-locals.el?" Tags="|directory-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12778" PostTypeId="2" ParentId="12777" CreationDate="2015-05-28T19:41:43.437" Score="7" Body="&lt;p&gt;Based on the documentation in the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;, you are missing a portion of the subdir specification.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Sample .dir-locals.el&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;From the manual with comments for emphasis/clarification&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(;; Dir settings&#xA; (nil . ((indent-tabs-mode . t)&#xA;         (fill-column . 80)))&#xA; (c-mode . ((c-file-style . &quot;BSD&quot;)&#xA;            (subdirs . nil)))&#xA; ;; Subdir specification&#xA; (&quot;src/imported&quot; .&#xA;  ;; Subdir settings&#xA;  ((nil . ((change-log-default-name&#xA;            . &quot;ChangeLog.local&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Corrected .dir-locals.el&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;This is based on the assumption that you want the &lt;code&gt;subdir&lt;/code&gt; specifications to apply to all modes.  If you only want them to apply to &lt;code&gt;c-mode&lt;/code&gt; replace &lt;code&gt;nil&lt;/code&gt; with &lt;code&gt;c-mode&lt;/code&gt; in the mode-specification.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(;; dev/school subdir&#xA; (&quot;dev/school&quot; .&#xA;  ;; dev/school specification for all modes&#xA;  ((nil . ((indent-tabs-mode . nil)&#xA;           (c-basic-offset . 4)))))&#xA; ;; dev/test subdir&#xA; (&quot;dev/test&quot; .&#xA;  ;; dev/test specification for all modes&#xA;  ((nil . ((indent-tabs-mode . nil)&#xA;           (c-basic-offset . 4)))))&#xA; ;; c-mode specification for dir + subdirs&#xA; (c-mode .&#xA;  ((c-file-style . &quot;linux&quot;)&#xA;   (c-basic-offset . 8))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="337" LastEditorUserId="337" LastEditDate="2015-05-29T13:32:22.720" LastActivityDate="2015-05-29T13:32:22.720" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12779" PostTypeId="1" AcceptedAnswerId="12789" CreationDate="2015-05-28T20:28:15.340" Score="4" ViewCount="1833" Body="&lt;p&gt;I've started using the &lt;code&gt;emacsclient&lt;/code&gt; more along with the daemon, and I'm a huge fan, but it's started giving me trouble when I reboot my computer. After reboot when I open up a new &lt;code&gt;emacsclient&lt;/code&gt;, I don't get the usual daemon startup stuff in my terminal. Then once the window opens, I am unable to input anything to the minibuffer. Any time I try typing, for example &lt;code&gt;M-x&lt;/code&gt; or &lt;code&gt;C-x C-f&lt;/code&gt;, I get an error message reading &lt;code&gt;Error reading from stdin&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Killing emacs with &lt;code&gt;pkill emacs&lt;/code&gt; and restarting fixes the issue, but I'd rather not have it in the first place. How can I tell the daemon to die, or clean up after itself, when I'm rebooting my computer? If it makes any difference, I'm on OpenSUSE 13.2 with KDE.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-07-28T16:37:55.977" Title="&quot;Error reading from stdin&quot; after reboot" Tags="|emacsclient|daemon|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12780" PostTypeId="1" AcceptedAnswerId="12781" CreationDate="2015-05-28T20:30:46.897" Score="25" ViewCount="8128" Body="&lt;p&gt;When I do &lt;code&gt;M-x query-replace&lt;/code&gt; to replace all occurrences of &lt;code&gt;v&lt;/code&gt; by &lt;code&gt;w&lt;/code&gt;,  then it also matches &lt;code&gt;V&lt;/code&gt; (uppercase &lt;code&gt;V&lt;/code&gt;). How to force emacs to only find lowercase &lt;code&gt;v&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-05-29T21:33:29.043" LastActivityDate="2022-05-05T21:43:36.207" Title="How to perform case-sensitive query-replace?" Tags="|query-replace|case-folding|" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12781" PostTypeId="2" ParentId="12780" CreationDate="2015-05-28T20:33:30.323" Score="16" Body="&lt;pre&gt;&lt;code&gt;(customize-set-variable case-fold-search  nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or bind that variable (option) in your own command that is otherwise just a wrapper around &lt;code&gt;query-replace&lt;/code&gt;.  This has the advantage that it doesn't change the variable value for general use, outside of query-replacing.&lt;/p&gt;&#xA;&lt;p&gt;See also variable &lt;code&gt;case-replace&lt;/code&gt;, which controls case for the replacement text.&lt;/p&gt;&#xA;&lt;p&gt;See also &lt;code&gt;C-h f query-replace&lt;/code&gt;, where it says, for example:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Matching is independent of case if &lt;code&gt;case-fold-search&lt;/code&gt; is non-nil and&#xA;FROM-STRING has no uppercase letters.  Replacement transfers the case&#xA;pattern of the old text to the new text, if &lt;code&gt;case-replace&lt;/code&gt; and&#xA;&lt;code&gt;case-fold-search&lt;/code&gt; are non-nil and FROM-STRING has no uppercase&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;See also the comments below, and Emacs bug #&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20687&quot; rel=&quot;nofollow noreferrer&quot;&gt;20687&lt;/a&gt;, which show how you can patch &lt;code&gt;perform-replace&lt;/code&gt; to let you toggle case folding during &lt;code&gt;query-replace&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Note too that the existing code for &lt;code&gt;perform-replace&lt;/code&gt; binds &lt;code&gt;case-fold-search&lt;/code&gt; in this way (note the variables on which it depends):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(case-fold-search  (if (and case-fold-search search-upper-case)&#xA;                       (isearch-no-upper-case-p from-string regexp-flag)&#xA;                     case-fold-search))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2020-06-24T15:24:13.487" LastActivityDate="2020-06-24T15:24:13.487" CommentCount="19" ContentLicense="CC BY-SA 4.0" />
  <row Id="12782" PostTypeId="1" CreationDate="2015-05-28T21:36:05.713" Score="7" ViewCount="755" Body="&lt;p&gt;Let's assume we have a table that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FnBaU.png&quot; alt=&quot;table with correct alignment&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After running &lt;code&gt;org-preview-latex-fragment&lt;/code&gt; command I get this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Yos4P.png&quot; alt=&quot;table with broken alignment&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see the top row is not aligned with the other rows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one view latex formulas inside &lt;code&gt;org-mode&lt;/code&gt; tables without breaking table alignment?&lt;/p&gt;&#xA;" OwnerUserId="6527" LastEditorUserId="504" LastEditDate="2015-05-29T09:26:57.140" LastActivityDate="2018-12-01T19:02:05.420" Title="Table cell alignment breaks when using latex inside org table" Tags="|org-mode|latex|org-table|preview-latex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12783" PostTypeId="2" ParentId="12759" CreationDate="2015-05-28T23:29:38.937" Score="6" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/fourier/loccur&quot;&gt;&lt;code&gt;loccur&lt;/code&gt;&lt;/a&gt; package, also available on Melpa, does exactly what you want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From its github page: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;loccur&lt;/code&gt; is a minor mode for Emacs acting like &lt;code&gt;occur&lt;/code&gt; but without creating a new window. It just hides all the text except lines containing matches for a given regexp.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-05-28T23:29:38.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12784" PostTypeId="1" AcceptedAnswerId="12785" CreationDate="2015-05-29T02:54:32.227" Score="1" ViewCount="1243" Body="&lt;p&gt;in VIM on MS Windows, I could use &lt;code&gt;C-q&lt;/code&gt; to enter into visual block mode. How about in evil? I tried the same but it doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="105" LastEditDate="2015-05-29T21:32:50.337" LastActivityDate="2015-05-29T21:32:50.337" Title="how to enter into visual block mode in evil on windows?" Tags="|key-bindings|microsoft-windows|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12785" PostTypeId="2" ParentId="12784" CreationDate="2015-05-29T03:05:43.383" Score="2" Body="&lt;p&gt;I've never heard of &lt;code&gt;C-q&lt;/code&gt; to enter visual block, not even on Windows. The default binding for that, AFAIK, is &lt;code&gt;C-v&lt;/code&gt;, and that also applies to evil. But if you wish you can bind visual block to &lt;code&gt;C-q&lt;/code&gt; with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;\C-q&quot; 'evil-visual-block)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-05-29T03:05:43.383" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12786" PostTypeId="2" ParentId="1067" CreationDate="2015-05-29T09:21:55.503" Score="1" Body="&lt;p&gt;I'm not sure if this will help, but &lt;a href=&quot;https://github.com/rocky/emacs-dbgr&quot; rel=&quot;nofollow&quot;&gt;realgud&lt;/a&gt; doesn't have to use comint (although it &lt;em&gt;can)&lt;/em&gt;. It also works inside eshell. For use with &lt;em&gt;gdb&lt;/em&gt;, You have to run &quot;set annotate 1&quot; to get it to track source-code lines, after running &quot;M-x set-track-mode&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;realgud is available from Melpa. At some point it will be in GNU Emacs Elpa.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastActivityDate="2015-05-29T09:21:55.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12787" PostTypeId="1" AcceptedAnswerId="12788" CreationDate="2015-05-29T12:38:38.490" Score="12" ViewCount="3599" Body="&lt;p&gt;I have been trying to configure Emacs to use the proper Python mode. To this end I have read a few tutorials. Most importantly &lt;a href=&quot;http://www.jesshamrick.com/2012/09/18/emacs-as-a-python-ide/&quot; rel=&quot;noreferrer&quot;&gt;this one&lt;/a&gt;. The tutorial uses the &lt;code&gt;python-mode&lt;/code&gt; package. However, when I install it through the package manager (&lt;code&gt;M-x package-install RET python-mode RET&lt;/code&gt;) I can not use the shortcuts that are available for that package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I opened up a Python file to test &lt;a href=&quot;http://python.about.com/b/2007/09/24/emacs-tips-for-python-programmers.htm&quot; rel=&quot;noreferrer&quot;&gt;some shortcuts&lt;/a&gt; such as &lt;code&gt;C-c |&lt;/code&gt;, which should evaluate the selected expression. However, to my surprise these did not work so I decided to find out other tutorials on the topic. However, in my mode-line I do see &lt;code&gt;Python&lt;/code&gt;, so there is some &lt;code&gt;python-mode&lt;/code&gt; enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the emacs wiki I found the following snippet to add to my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (autoload 'python-mode &quot;python-mode&quot; &quot;Python Mode.&quot; t)&#xA; (add-to-list 'auto-mode-alist '(&quot;\\.py\\'&quot; . python-mode))&#xA; (add-to-list 'interpreter-mode-alist '(&quot;python&quot; . python-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I add this the &lt;code&gt;python-mode&lt;/code&gt; actually works and the aforementioned shortcuts work as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not understand properly what this does more than manually executing &lt;code&gt;M-x python-mode&lt;/code&gt; in a python file buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I removed every trace of &lt;code&gt;python-mode&lt;/code&gt; in my .emacs folder and opened up a python file I noticed that I still have a &lt;code&gt;python-mode&lt;/code&gt;. So my guess is that there are two &lt;code&gt;python-mode&lt;/code&gt;s?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I want the &lt;code&gt;python-mode&lt;/code&gt; from &lt;a href=&quot;https://launchpad.net/python-mode&quot; rel=&quot;noreferrer&quot;&gt;https://launchpad.net/python-mode&lt;/a&gt;. It seems that it is present in the package repository, but I am unsure how to remove the other Python mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could somebody elaborate please?&lt;/p&gt;&#xA;" OwnerUserId="8447" LastEditorUserId="2096" LastEditDate="2015-05-29T20:19:38.233" LastActivityDate="2022-01-06T16:01:59.437" Title="Two Python modes" Tags="|python|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12788" PostTypeId="2" ParentId="12787" CreationDate="2015-05-29T13:20:43.457" Score="12" Body="&lt;p&gt;Well yes there are two python modes: the one which ships with emacs is &lt;code&gt;python.el&lt;/code&gt; and the other one is &lt;code&gt;python-mode.el&lt;/code&gt; which is indeed this one: &lt;a href=&quot;https://launchpad.net/python-mode&quot; rel=&quot;noreferrer&quot;&gt;https://launchpad.net/python-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your tutorial has been referencing the later one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &lt;code&gt;python-mode&lt;/code&gt; setup snippet does the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; by default, the function 'python-mode is associated with&#xA;;; the package python.el. The following changes that to python-mode.el:&#xA;(autoload 'python-mode &quot;python-mode&quot; &quot;Python Mode.&quot; t)&#xA;&#xA;;; open py files with python-mode&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.py\\'&quot; . python-mode))&#xA;&#xA;;; sets python interpreter mode to be python-mode&#xA;(add-to-list 'interpreter-mode-alist '(&quot;python&quot; . python-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="2710" LastEditDate="2015-05-29T19:20:37.330" LastActivityDate="2015-05-29T19:20:37.330" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12789" PostTypeId="2" ParentId="12779" CreationDate="2015-05-29T15:53:13.343" Score="1" Body="&lt;p&gt;Following the comment of T. Verron, I determined that it was the following lines from my &lt;code&gt;.emacs&lt;/code&gt; that caused the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'server)&#xA;(or (server-running-p)&#xA;    (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've used this on Windows to allow me to open a file in an existing frame, but it's only needed there, as far as I can tell, because there is currently no Windows &lt;code&gt;--daemon&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-05-29T15:53:13.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12790" PostTypeId="2" ParentId="12787" CreationDate="2015-05-29T15:56:00.027" Score="8" Body="&lt;p&gt;As a maintainer of python-mode.el and in addition to answer by @Adobe: python-mode.el does not unload commands from python.el - both are available. Due to name of python-mode-map --which is used by both and can't be changed without breaking a lot of things-- keybindings and menu are delivered from the last one loaded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-c |&lt;/kbd&gt; calls &lt;code&gt;py-execute-region&lt;/code&gt; and works nicely here.&#xA;Maybe python.el was loaded afterwards and the binding gone. Calling the command via M-x might be an option than. In case of trouble, please consider a bug-report at &lt;a href=&quot;https://bugs.launchpad.net/python-mode&quot; rel=&quot;noreferrer&quot;&gt;https://bugs.launchpad.net/python-mode&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-05-29T16:27:28.453" LastActivityDate="2015-05-29T16:27:28.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12791" PostTypeId="1" CreationDate="2015-05-29T16:41:43.150" Score="9" ViewCount="4143" Body="&lt;p&gt;I want to replace the default org-mode priorities with my own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;default: &lt;code&gt;#A #B #C&lt;/code&gt;&lt;br&gt;&#xA;desired: &lt;code&gt;#1 #2 #3 #4 #5&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2017-09-15T20:52:10.140" Title="Customize org-mode priorities" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12792" PostTypeId="2" ParentId="12791" CreationDate="2015-05-29T17:13:36.187" Score="10" Body="&lt;p&gt;You can customize priorities in the group &lt;code&gt;org-priorities&lt;/code&gt;. &lt;code&gt;M-x customize-group&lt;/code&gt;, then type &lt;code&gt;org-priorities&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Accepted values are A to Z and 0 to 9, so you can actually set your desired priorities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be sure to customize the 3 settings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-highest-priority&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-lowest-priority&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-default-priority&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-05-29T17:13:36.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12793" PostTypeId="1" CreationDate="2015-05-29T19:43:23.273" Score="1" ViewCount="170" Body="&lt;p&gt;I am using table.el in Emacs 24.x on win7. I have created a table and updated the cell contents but cannot get the table to reformat to match the new contents. As far as I have read, EMACS should automatically reformat but it does not seem to. I have tried unrecognizing then re-recognizing the table to update how it is displayed but it remains the untidy mess that I edited. In Org-mode tables, TAB reformats the table after changes but I cannot find out how to do this with the Tables feature. Can someone educate me on how to properly reformat a table after editing its contents?&lt;/p&gt;&#xA;" OwnerUserId="8449" LastActivityDate="2015-05-29T19:43:23.273" Title="How to update edited table so that columns align" Tags="|table|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12794" PostTypeId="2" ParentId="8061" CreationDate="2015-05-29T20:14:10.727" Score="8" Body="&lt;p&gt;Following the interesting comments from PythonNut, I installed &lt;a href=&quot;https://github.com/syohex/emacs-helm-ag&quot;&gt;&lt;code&gt;helm-ag&lt;/code&gt;&lt;/a&gt;, and ran &lt;code&gt;helm-projectile-ag&lt;/code&gt; from the &lt;a href=&quot;https://github.com/bbatsov/projectile&quot;&gt;projectile&lt;/a&gt; package via &lt;code&gt;C-c p s s&lt;/code&gt;. I then switched to editing mode with &lt;code&gt;C-c C-e&lt;/code&gt;.  I changed a few lines and then pressed &lt;code&gt;C-c C-c&lt;/code&gt; and these were saved to the relevant files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This works, but at present one infellicity is that it saves each of the &quot;matched&quot; files multiple times regardless of whether there was a change or not.  I raised this as &lt;a href=&quot;https://github.com/bbatsov/projectile/issues/756&quot;&gt;projectile #756&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from that I think it would work well for the need mentioned in the question, and &quot;without custom functions&quot; :-)&lt;/p&gt;&#xA;" OwnerUserId="8406" LastActivityDate="2015-05-29T20:14:10.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12795" PostTypeId="2" ParentId="10895" CreationDate="2015-05-29T20:32:00.450" Score="3" Body="&lt;p&gt;One partial answer is &lt;a href=&quot;https://bitbucket.org/mortiferus/latex-pretty-symbols.el/src/f2056f85be402a1c365d688a4a04ba82d01fdc60/latex-pretty-symbols.el?at=default&quot; rel=&quot;nofollow&quot;&gt;latex-pretty-symbols.el&lt;/a&gt;.  It doesn't produce images, and just uses Unicode instead, so it doesn't look as pretty as the screenshot posted in the question.  However, if the OP does not want to generate images, it may be the best way to go at present.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastActivityDate="2015-05-29T20:32:00.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12796" PostTypeId="1" AcceptedAnswerId="12797" CreationDate="2015-05-29T21:33:22.010" Score="2" ViewCount="92" Body="&lt;p&gt;I have some function like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-function ()&#xA;  (interactive)&#xA;  (while (re-search-forward &quot;^(def&quot; nil t)&#xA;    (replace-match &quot;hello&quot;)&#xA;    ;; -- Go to next line and do something here&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now once the regexp matches on and replaces the word, I want to go to the next line and do some text manipulation in the second line (like inserting some characters at the start of the line). How would I do that ?&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="105" LastEditDate="2015-05-29T21:51:09.360" LastActivityDate="2015-05-29T21:55:00.387" Title="Text manipulation in next line after replace-match" Tags="|elisp|motion|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12797" PostTypeId="2" ParentId="12796" CreationDate="2015-05-29T21:55:00.387" Score="3" Body="&lt;p&gt;&lt;code&gt;(forward-line 1)&lt;/code&gt; will take the point to the next line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can learn more about that and other motion commands from &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Lines.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-05-29T21:55:00.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12798" PostTypeId="2" ParentId="12248" CreationDate="2015-05-29T22:17:18.887" Score="4" Body="&lt;p&gt;From &lt;code&gt;command_loop_1&lt;/code&gt; in &lt;code&gt;keyboard.c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;  ...&#xA;  if (!NILP (BVAR (current_buffer, mark_active))&#xA;  &amp;amp;&amp;amp; !NILP (Vrun_hooks))&#xA;{&#xA;  /* In Emacs 22, setting transient-mark-mode to `only' was a&#xA;     way of turning it on for just one command.  This usage is&#xA;     obsolete, but support it anyway.  */&#xA;  if (EQ (Vtransient_mark_mode, Qidentity))&#xA;    Vtransient_mark_mode = Qnil;&#xA;  else if (EQ (Vtransient_mark_mode, Qonly))&#xA;    Vtransient_mark_mode = Qidentity;&#xA;&#xA;  if (!NILP (Vdeactivate_mark))&#xA;    /* If `select-active-regions' is non-nil, this call to&#xA;       `deactivate-mark' also sets the PRIMARY selection.  */&#xA;    call0 (Qdeactivate_mark);&#xA;  else&#xA;  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That seems to be the only place where &lt;code&gt;Qdeactivate_mark&lt;/code&gt; is called in all of &lt;code&gt;src/*.c&lt;/code&gt;.  So my guess is that this what you're running into. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note, I am not an expert on Emacs C.  I &lt;a href=&quot;http://www.unknownroad.com/rtfm/gdbtut/gdbtoc.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;poked around&lt;/a&gt; with &lt;code&gt;gdb --args src/emacs -Q&lt;/code&gt; after reading &lt;a href=&quot;https://emacs.stackexchange.com/questions/4213/how-to-compile-emacs-with-debug-symbols&quot;&gt;How to compile emacs with debug symbols?&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-05-29T22:17:18.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12799" PostTypeId="1" AcceptedAnswerId="12800" CreationDate="2015-05-30T02:01:39.177" Score="13" ViewCount="2242" Body="&lt;p&gt;I've been using cursive's Structural Editing (a paredit-like mode for Intellij and Cursive) and I found a nice command there called move form-up (and down). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Move form up does this (the &lt;code&gt;|&lt;/code&gt; is the point):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(+ 1 |(+ 2 3) 4) =&amp;gt; (+ (+ 2 3) 1 4)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and Move form down is analogous: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(+ 1 |(+ 2 3) 4) =&amp;gt; (+ 1 4 (+ 2 3))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do this on Emacs paredit-mode ? I think it is not on the basic paredit set (at least it is not described &lt;a href=&quot;http://www.emacswiki.org/emacs/PareditCheatsheet&quot;&gt;on this cheat sheet&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8356" LastEditorUserId="50" LastEditDate="2015-05-30T08:17:54.117" LastActivityDate="2022-05-20T18:11:26.050" Title="Move form up and down on paredit mode" Tags="|editing|paredit|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12800" PostTypeId="2" ParentId="12799" CreationDate="2015-05-30T07:13:24.393" Score="17" Body="&lt;p&gt;As @Drew suggested, &lt;code&gt;C-M-t&lt;/code&gt; does what you want. The rule is like this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Put point in the middle of two sexps.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-M-t&lt;/code&gt; (which runs &lt;code&gt;transpose-sexp&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;left sexp&lt;/strong&gt; is always moved to the right along with point. &lt;strong&gt;This is very important&lt;/strong&gt;, otherwise you will be confused to no end.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Or, you can simply think that this is not transposing but simply to move forward, you have to place point after the sexp you want to move.&lt;/p&gt;&#xA;&lt;p&gt;However, there's one convenient that is, when you want to transpose the left sexp backward, you use the same &lt;code&gt;C-M-t&lt;/code&gt; but supplied with a negative prefix argument and this is inconvenient. Another issue is that point won't follow the backward transposed &lt;em&gt;left sexp&lt;/em&gt;. To solve this issue, we create a reverse version of &lt;code&gt;transpose-sexps&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun reverse-transpose-sexps (arg)&#xA;  (interactive &amp;quot;*p&amp;quot;)&#xA;  (transpose-sexps (- arg))&#xA;  ;; when transpose-sexps can no longer transpose, it throws an error and code&#xA;  ;; below this line won't be executed. So, we don't have to worry about side&#xA;  ;; effects of backward-sexp and forward-sexp.&#xA;  (backward-sexp (1+ arg))&#xA;  (forward-sexp 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then, bind it to &lt;code&gt;C-M-y&lt;/code&gt; which is next to &lt;code&gt;C-M-t&lt;/code&gt; and is free in default Emacs.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &amp;quot;C-M-y&amp;quot;) 'reverse-transpose-sexps)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Here is a demo; you will notice that &lt;code&gt;(MY-SEXP1)&lt;/code&gt; is on the left all the time to be moved forward/backward:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/E2gr6.gif&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="2731" LastEditDate="2022-05-20T18:11:26.050" LastActivityDate="2022-05-20T18:11:26.050" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="12801" PostTypeId="2" ParentId="12799" CreationDate="2015-05-30T08:34:21.733" Score="5" Body="&lt;p&gt;It's possible to do it with &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;noreferrer&quot;&gt;lispy&lt;/a&gt;, which is an advanced form of &lt;code&gt;paredit-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your use case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;w&lt;/kbd&gt; moves up&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;s&lt;/kbd&gt; moves down&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The only thing is that the cursor has to be at paren, which it is in your example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 1 |(+ 2 3) 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also move several sexps at once with &lt;kbd&gt;w&lt;/kbd&gt; and &lt;kbd&gt;s&lt;/kbd&gt;, if you mark them with a region.  See &lt;a href=&quot;http://oremacs.com/lispy/#lispy-move-down&quot; rel=&quot;noreferrer&quot;&gt;the documentation&lt;/a&gt; for more info.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-30T08:34:21.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12802" PostTypeId="2" ParentId="12683" CreationDate="2015-05-30T13:26:38.073" Score="4" Body="&lt;p&gt;Since it can be helpful to start with a &lt;a href=&quot;https://stackoverflow.com/help/mcve&quot;&gt;minimum &lt;em&gt;working&lt;/em&gt; example&lt;/a&gt;, please see if this works for you.  It should help debug any other features of your setup that are causing breakage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacs -Q --load emms-init.el&lt;/code&gt; and then &lt;strong&gt;&lt;code&gt;M-x emms-play-directory RET ~/Music RET&lt;/code&gt;&lt;/strong&gt;, where &lt;code&gt;emms-init.el&lt;/code&gt; is as follows, and where &lt;code&gt;~/Music/&lt;/code&gt; contains the 0.4 MB .flac test file downloaded from &lt;a href=&quot;http://www.linnrecords.com/linn-downloads-testfiles.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.linnrecords.com/linn-downloads-testfiles.aspx&lt;/a&gt;.  My &lt;code&gt;mplayer&lt;/code&gt; is MPlayer2 2.0-728-g2c378c7-2ubuntu3.  With all of this in place I hear an annoying but brief tone.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize nil)&#xA;(setq package-enable-at-startup nil)&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;(unless (assoc-default &quot;melpa&quot; package-archives)&#xA;  (add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;  (package-refresh-contents))&#xA;&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-install 'use-package))&#xA;&#xA;(setq use-package-verbose t)&#xA;(require 'use-package)&#xA;&#xA;;;EMMS&#xA;(use-package emms&#xA;  :ensure t :defer t&#xA;  :config&#xA;  (progn&#xA;    (require 'emms-player-simple)&#xA;    (require 'emms-source-file)&#xA;    (require 'emms-source-playlist)&#xA;    (require 'emms-player-mplayer)&#xA;    (setq emms-player-list '(emms-player-mplayer))&#xA;    (setq emms-source-file-default-directory &quot;~/Music/&quot;)&#xA;    (emms-add-directory-tree &quot;~/Music/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-05-30T13:32:22.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12803" PostTypeId="1" AcceptedAnswerId="12806" CreationDate="2015-05-30T14:03:32.533" Score="10" ViewCount="577" Body="&lt;p&gt;When using &lt;code&gt;web-mode&lt;/code&gt;, typing a &lt;code&gt;&amp;lt;/&lt;/code&gt; will autocomplete with the highest level open tag name. For example, if I have an open &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;/&lt;/code&gt; will be autocompleted to &lt;code&gt;&amp;lt;/div&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to get the same thing in LaTeX? For example, if I have a &lt;code&gt;\begin{foo}&lt;/code&gt; tag, how can I make emacs autocomplete an &lt;code&gt;\end&lt;/code&gt; or &lt;code&gt;\end{&lt;/code&gt; to &lt;code&gt;\end{foo}&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="241" LastEditorUserId="2274" LastEditDate="2015-05-30T15:14:36.980" LastActivityDate="2015-05-30T15:14:36.980" Title="Can emacs close open LaTeX tags automatically?" Tags="|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12805" PostTypeId="1" AcceptedAnswerId="12808" CreationDate="2015-05-30T15:07:58.397" Score="7" ViewCount="3294" Body="&lt;p&gt;From the built-in and MELPA available packages, which combination offers the easiest approach to managing a large collection of images (over 100K) in various formats (raw, jpg, tiff, png). I mainly want to view thumbnails, view full images to fit on screen, mark for deletion, copy, or move actual image files locally and sometimes to remote locations using tramp. Either Mac OS X or Linux compatibility is acceptable. I do not want to edit the actual images themselves (such as scaling, rotating, and similar image alterations). &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-06-28T04:23:59.760" Title="Which image viewer for large image collections?" Tags="|dired|image-mode|previewing|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12806" PostTypeId="2" ParentId="12803" CreationDate="2015-05-30T15:13:29.930" Score="17" Body="&lt;p&gt;In the built-in &lt;code&gt;latex-mode&lt;/code&gt;, &lt;code&gt;C-c C-e&lt;/code&gt; runs &lt;code&gt;latex-close-block&lt;/code&gt;, which closes the highest level open block.  No need to type the &lt;code&gt;\end&lt;/code&gt; first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're using AUCTex, &lt;code&gt;C-c ]&lt;/code&gt; does the same thing, or you can use &lt;code&gt;C-c C-e&lt;/code&gt; to insert a matched &lt;code&gt;\begin&lt;/code&gt;, &lt;code&gt;\end&lt;/code&gt; pair.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-05-30T15:13:29.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12807" PostTypeId="2" ParentId="12799" CreationDate="2015-05-30T16:07:45.590" Score="1" Body="&lt;p&gt;Here is another command (from library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;) that does pretty much what you request.  Just bind it to a single key (&lt;code&gt;C-M-t&lt;/code&gt; or whatever).  Use it to move a sexp both forward and backward repeatedly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A negative prefix arg transposes backward, like &lt;code&gt;transpose-sexp&lt;/code&gt;, but it also leaves point ready to do another backward transposition.  And when repeating, a negative prefix arg just flips the direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you bind the command to, say, &lt;code&gt;C-o&lt;/code&gt;, then &lt;code&gt;C-o C-o C-o&lt;/code&gt; &lt;strong&gt;&lt;em&gt;&lt;code&gt;C--&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt; &lt;code&gt;C-o C-o&lt;/code&gt; &lt;strong&gt;&lt;em&gt;&lt;code&gt;C--&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt; &lt;code&gt;C-o&lt;/code&gt; moves the sexp that is to the left of point to the right three times, then to the left twice, then to the right once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A numeric prefix arg has an effect only for the first use, i.e., not when repeating - when repeating, the movement is always one sexp at a time.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun reversible-transpose-sexps (arg)&#xA;  &quot;Reversible and repeatable `transpose-sexp'.&#xA;Like `transpose-sexps', but:&#xA; 1. Leaves point after the moved sexp.&#xA; 2. When repeated, a negative prefix arg flips the direction.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (when (eq last-command 'rev-transp-sexps-back) (setq arg  (- arg)))&#xA;  (transpose-sexps arg)&#xA;  (unless (natnump arg)&#xA;    (when (or (&amp;gt; emacs-major-version 24)&#xA;              (and (= emacs-major-version 24)  (&amp;gt; emacs-minor-version 3)))&#xA;      (backward-sexp (abs arg)) (skip-syntax-backward &quot; .&quot;))&#xA;    (setq this-command  'rev-transp-sexps-back)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Note: The behavior of &lt;code&gt;transpose-sexps&lt;/code&gt; changed in 24.4, hence the version test here.  Prior to 24.4, point ended up in the right place to continue (e.g. repeat).  Starting with 24.4, point is in the wrong place for that.  Whether that is a regression or adds a useful feature or fixes some other bug is presumably in the eye of the beholder. ;-)  I filed Emacs &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20698&quot; rel=&quot;nofollow&quot;&gt;bug #20698&lt;/a&gt; for this, just now.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-05-30T17:14:16.063" LastActivityDate="2015-05-30T17:14:16.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12808" PostTypeId="2" ParentId="12805" CreationDate="2015-05-30T20:18:57.997" Score="4" Body="&lt;p&gt;Others will no doubt mention packages that are made specifically for handling images. This answer, about some more general features, might nevertheless help.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; provides a few enhancements regarding image files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of these require standard library &lt;code&gt;image-dired.el&lt;/code&gt;.  One of them, command &lt;code&gt;diredp-do-display-images&lt;/code&gt;, which displays all of the marked image files, requires standard library &lt;code&gt;image-file.el&lt;/code&gt;.  (&lt;strong&gt;Dired+&lt;/strong&gt; loads these libraries automatically, if available.  You must of course also have installed whatever else your Emacs version needs to display images.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides command &lt;code&gt;diredp-do-display-images&lt;/code&gt;, there are these commands, whose&#xA;names have prefix &lt;code&gt;diredp-image-&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-comment-file&lt;/code&gt; -- Add a comment to an image file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-comment-files-recursive&lt;/code&gt; -- Add a comment to the marked files, including those in marked subdirs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-copy-with-exif-name&lt;/code&gt; -- Copy this image file to your main image directory.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-create-thumb&lt;/code&gt; -- Create or (with &lt;code&gt;C-u&lt;/code&gt;) replace a thumbnail image for a file (default: file on current line).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-delete-tag&lt;/code&gt; -- Remove an &lt;code&gt;image-dired&lt;/code&gt; tag from this image file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-delete-tag-recursive&lt;/code&gt; -- Remove an &lt;code&gt;image-dired&lt;/code&gt; tag from the marked files, including those in marked subdirs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-display-thumb&lt;/code&gt; -- Pop to a thumbnail of this image file, in &lt;code&gt;image-dired-thumbnail-buffer&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-display-thumbs-recursive&lt;/code&gt; -- Display thumbnails of the marked files, including those in marked subdirs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-edit-comment-and-tags&lt;/code&gt; -- Edit the &lt;code&gt;image-dired&lt;/code&gt; comment and tags for this image file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-tag-file&lt;/code&gt; -- Tag this image file with an &lt;code&gt;image-dired&lt;/code&gt; tag.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;diredp-image-dired-tag-files-recursive&lt;/code&gt; -- Tag the marked files with an `image-dired' tag, including those in marked subdirs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These options control the behavior of tooltip previews of image files:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;diredp-image-preview-in-tooltip&lt;/code&gt; -- Whether to show a tooltip preview on mouseover, and if so, whether to show the full image or just a thumbnail (and what size thumbnail).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;diredp-auto-focus-frame-for-thumbnail-tooltip-flag&lt;/code&gt; -- Whether to automatically focus the frame (so a thumbnail is shown on mouseover of a frame that is not yet focussed).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; lets you &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags&quot; rel=&quot;nofollow&quot;&gt;tag files&lt;/a&gt;, including image files, more flexibly than what you can do with &lt;code&gt;image-dired&lt;/code&gt; tags.&#xA;&lt;strong&gt;Dired+&lt;/strong&gt; lets you act on files that are tagged this way (using &lt;strong&gt;Bookmark+&lt;/strong&gt;).  You can easily:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Add or remove tags&lt;/em&gt; to/from the marked files.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Copy the tags&lt;/em&gt; from one file and &lt;em&gt;paste them to other files&lt;/em&gt;, either adding them to tags those files already have or replacing those tags.&lt;/li&gt;&#xA;&lt;li&gt;Set the value of a given tag for all of the marked files. (Yes, tags can have Lisp &lt;em&gt;values&lt;/em&gt;; they need not be just strings.)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; also gives you multiple ways to define and manipulate sets of bookmarks, which can for example be tagged image files.  You can, for instance, create a bookmark that when &quot;jumped to&quot; puts you in a Dired buffer of image files.  Or a bookmark that opens a bookmark display list of bookmarks that each display an image.  There are many possibilities for using bookmarks, and particularly bookmark tags, with images.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-05-30T20:18:57.997" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12809" PostTypeId="1" AcceptedAnswerId="12815" CreationDate="2015-05-30T21:15:28.473" Score="3" ViewCount="416" Body="&lt;p&gt;Suppose I call a function which is named as &lt;code&gt;foo&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes that function &lt;code&gt;foo&lt;/code&gt; will give a message such as &lt;code&gt;&quot;Example of error message&quot;&lt;/code&gt;.  If that is the case, then something else should be executed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that I need a way that to read the output of the messages buffer. &#xA;In particular, I want to define a function &lt;code&gt;bar&lt;/code&gt; that calls &lt;code&gt;foo&lt;/code&gt; and executes something when &lt;code&gt;foo&lt;/code&gt; gives a error:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun bar () &#xA;   (foo)&#xA;   (if (string-match `&quot;Example of error message&quot;` (minibuffer-output after calling foo))&#xA;           then do this)&#xA;      else do this thingy). &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I read the Emacs Documentation, I couldn't find anything that gives the functionality of reading the latest message from the minibuffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SITUATION FROM THE REAL WORLD&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems my post is not clear enough. I will detail it further from the actual situation here. I have the following: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo () &#xA;   (interactive)&#xA;   (evil-goto-mark ?8)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling the function &lt;code&gt;foo&lt;/code&gt; produces the error &lt;code&gt;Marker 8' is not set in this buffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I get that message after calling &lt;code&gt;(evil-goto-mark ?8)&lt;/code&gt;, I want to call &lt;code&gt;(evil-set-marker ?8)&lt;/code&gt;  instead. The answer below didn't work in my case, unfortunately. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="675" LastEditDate="2015-06-01T21:03:48.483" LastActivityDate="2015-06-01T21:03:48.483" Title="How to call another function, if one function gives an error message" Tags="|minibuffer|functions|error-handling|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12810" PostTypeId="2" ParentId="12809" CreationDate="2015-05-30T21:26:41.593" Score="11" Body="&lt;p&gt;No need to read &lt;code&gt;*Messages*&lt;/code&gt;. Here's how error handling works in Elisp:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun bar ()&#xA;  (error &quot;asdf&quot;))&#xA;&#xA;(defun foo ()&#xA;  (condition-case e&#xA;      (bar)&#xA;    (error&#xA;     (message &quot;Caught an error: %S&quot; e))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-05-30T21:26:41.593" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12812" PostTypeId="1" CreationDate="2015-05-31T00:49:28.583" Score="1" ViewCount="362" Body="&lt;p&gt;I use Emacs as server instance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start EMacs Client, he will check if the file &lt;code&gt;.emacs.d/server/server&lt;/code&gt; exists. If not so, then he will initiating a Emacs server instance, and my Emacs configuration files will be loaded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I start a new Emacs Client. He checks that the &lt;code&gt;server-file&lt;/code&gt; already exists. The Emacs configuration will not be loaded again, but it will create a new frame instead, connected with the Emacs server instance. It loads really fast. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I close the Emacs instance properly, the file &lt;code&gt;server&lt;/code&gt; will be deleted. But sometimes my Emacs crashes (it happens a lot, because I configure my Emacs like a crazy, believe me). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I start Emacs client again, after killing it in Windows. He sees the Emacs &lt;code&gt;server&lt;/code&gt; file already exists, but he cannot find the Emacs instance server, to create a frame from it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I decided to automatically delete the server-file, every time that Emacs file is being loaded (it's being loaded only when Emacs starts as server instance). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I created the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook before-init-hook '(shell-command &quot;c:/Dropbox/Sys/autohotkey/delete-server-file-emacs.ahk&quot;))&#xA;(require 'server)&#xA;(unless (server-running-p)&#xA;  (server-start)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is an AHK-script, that deletes the server file every time when the Emacs configuration is being read. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start the Emacs instance, while the server file still in the folder, he still tries to read the server-file first, before execute the autohotkey script. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I stil got the message that there no connection from emacsclient could be made, because the target machine actively refused it. So that means he is reading the server file, that means that there is a Emacs instance as server to connect with it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion, in order to solve this?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-06-04T21:00:12.943" Title="Emacs reads the server file, before executing the command" Tags="|server|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12813" PostTypeId="2" ParentId="12809" CreationDate="2015-05-31T06:59:55.780" Score="3" Body="&lt;p&gt;If the function your are calling really echoes a message, you can use &lt;code&gt;(current-message)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return the string currently displayed in the echo area, or nil if&#xA;  none.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Of course, it would be better to issue an error, see other answer for more details on this.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-05-31T06:59:55.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12814" PostTypeId="1" AcceptedAnswerId="12822" CreationDate="2015-05-31T07:54:32.913" Score="29" ViewCount="4787" Body="&lt;p&gt;I want to add a markup and formatting for such markup, i.e. &lt;code&gt;&amp;lt;kbd&amp;gt;...&amp;lt;/kbd&amp;gt;&lt;/code&gt; with a box surrounds such markup. I also want the mark up to be compatible with &lt;code&gt;(setq org-hide-emphasis-markers t)&lt;/code&gt;. That is, when the variable is set to &lt;code&gt;t&lt;/code&gt;, the &lt;code&gt;&amp;lt;kbd&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/kbd&amp;gt;&lt;/code&gt;tags should disappear, leaving the text between it with the specified formatting above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer posted in this question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/5889/how-to-highlight-text-permanently-in-org-mode&quot;&gt;How to highlight text permanently in org-mode&lt;/a&gt; &lt;strong&gt;does not&lt;/strong&gt; solve this problem, since it is only applicable for existing markups, not extending Org with new markups.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="14825" LastEditDate="2022-06-16T04:58:54.197" LastActivityDate="2022-06-16T04:58:54.197" Title="Extending org-mode with more markups" Tags="|org-mode|syntax-highlighting|org-emphasis|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12815" PostTypeId="2" ParentId="12809" CreationDate="2015-05-31T08:20:19.750" Score="5" Body="&lt;p&gt;The error in question is thrown with &lt;code&gt;user-error&lt;/code&gt;, not simply echoed with &lt;code&gt;message&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your particular case testing the return value of &lt;code&gt;evil-get-marker&lt;/code&gt; should work also:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (evil-get-marker ?8)&#xA;  (evil-goto-mark ?8)&#xA; (evil-set-marker ?8))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="295" LastEditorUserId="295" LastEditDate="2015-05-31T08:29:03.570" LastActivityDate="2015-05-31T08:29:03.570" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12816" PostTypeId="2" ParentId="12430" CreationDate="2015-05-31T15:40:28.410" Score="5" Body="&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/manual/Capturing-column-view.html&quot; rel=&quot;nofollow&quot;&gt;columnview&lt;/a&gt; dynamic block does this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN: columnview :hlines 1 :id global&#xA; | ITEM            | PlannedPages | ActualPages |&#xA; |-----------------+--------------+-------------|&#xA; | * first section |            7 |           3 |&#xA; |-----------------+--------------+-------------|&#xA; | * Introduction  |          0.5 |         0.5 |&#xA; #+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-c&lt;/code&gt; on the &lt;code&gt;#+BEGIN:&lt;/code&gt; line will update the block.  The option &lt;code&gt;:id global&lt;/code&gt; makes is collect the whole file, &lt;code&gt;:id local&lt;/code&gt; would collect only that entry.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Page planning example&#xA;#+COLUMNS: %25ITEM %4PlannedPages(Planned pages){+} %4ActualPages(Actual pages){+}&#xA;#+PROPERTY: ActualPages_All &quot;&quot; 0.25 0.5 1 1.5 2&#xA;#+PROPERTY: PlannedPages_ALL &quot;&quot; 0.25 0.5 1 1.5 2&#xA;&#xA;#+BEGIN: columnview :hlines 0 :id global :maxlevel 1&#xA;| ITEM           | Planned pages | Actual pages |&#xA;|----------------+---------------+--------------|&#xA;| * Introduction |           1.5 |              |&#xA;| * Main part    |           3.5 |              |&#xA;| * Conclusions  |           0.5 |              |&#xA;#+END&#xA;&#xA;* Introduction&#xA;  :PROPERTIES:&#xA;  :PlannedPages: 1.5&#xA;  :END:&#xA;* Main part&#xA;  :PROPERTIES:&#xA;  :PlannedPages: 3.5&#xA;  :END:&#xA;** Section 1&#xA;   :PROPERTIES:&#xA;   :PlannedPages: 2&#xA;   :END:&#xA;** Section 2&#xA;   :PROPERTIES:&#xA;   :PlannedPages: 1.5&#xA;   :END:&#xA;* Conclusions&#xA;  :PROPERTIES:&#xA;  :PlannedPages: 0.5&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="6890" LastEditDate="2015-06-01T20:43:48.790" LastActivityDate="2015-06-01T20:43:48.790" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12817" PostTypeId="1" CreationDate="2015-05-31T21:08:25.663" Score="4" ViewCount="307" Body="&lt;p&gt;I (finally!) have a working EMMS to play my music collection, and would like to sort it into playlists. At the moment, my music directory (&lt;code&gt;~/Music/&lt;/code&gt;) is already organized into folders (at the first level) which I would like to form the new playlists. Thus, I have an arrangement similar to this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The contents of &lt;code&gt;~/Music/foo&lt;/code&gt; should form a playlist &lt;code&gt;foo&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;The contents of &lt;code&gt;~/Music/bar&lt;/code&gt; should form a playlist &lt;code&gt;bar&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can this be done in EMMS, and if so, how? Ideally, I would like to do it programmatically, so that in future, if I add more music, it'll generate another playlist for me automatically.&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2015-05-31T21:08:25.663" Title="Is there a way for EMMS to create playlists based on an existing directory structure?" Tags="|emms|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12818" PostTypeId="1" CreationDate="2015-05-31T22:31:44.653" Score="6" ViewCount="70" Body="&lt;p&gt;I want to know which frame &lt;em&gt;on a given X11 display&lt;/em&gt; was most recently selected. In fact, I want to know which frame that is mapped on the current desktop was most recently selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can tell what display a frame is on with the &lt;code&gt;display&lt;/code&gt; frame parameter, and I can enumerate all the frames on the same display as a given frame with &lt;code&gt;next-frame&lt;/code&gt;. I can tell whether a frame is mapped with the &lt;code&gt;visibility&lt;/code&gt; frame parameter. I can also call &lt;code&gt;visible-frame-alist&lt;/code&gt; to list visible frames. But none of this helps me know which of these was most recently selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the most recently selected frame is on the display I'm interested in, the answer is &lt;code&gt;selected-frame&lt;/code&gt;. But what if it isn't?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I list all the frames (or all the frames on a given display) in the order in which they were last selected?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want a solution that works in GNU Emacs ≥23. Ideally this should work for all supported display types, not just X11.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-06-01T03:14:43.743" Title="Find the last selected frame on a given display" Tags="|frames|display|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12819" PostTypeId="1" CreationDate="2015-06-01T00:49:42.120" Score="4" ViewCount="115" Body="&lt;p&gt;I have just today started using gnus to read news groups.&#xA;I played around with subscribing and unsubscribing from certain groups, and read a few threads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I exit gnus and emacs, and now when I try to reenter into Gnus, I am stuck on the loading screen (with the blue horse) with the minibuffer indicating&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Reading /Users/samlaf/.newsrc.eld...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to reconfigure this file, or might I have possibly changed some configurations that would cause such a problem?&lt;/p&gt;&#xA;" OwnerUserId="8258" LastActivityDate="2015-06-01T00:49:42.120" Title="Gnus stuck at &quot;Reading .newsrc.eld...&quot;" Tags="|osx|gnus|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12820" PostTypeId="2" ParentId="12818" CreationDate="2015-06-01T03:14:43.743" Score="3" Body="&lt;p&gt;You might try this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever a frame is selected (e.g. advise relevant functions), you update a frame parameter on that frame with a timestamp value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should then be easy (dunno about performance) to check the frame list for a given display (or whatever), to either look for the most recent frame or to sort the frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is unclear, let me know and I'll come up with some code. But I think you get the idea: you add your own timestamps, as a frame parameter.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-01T03:14:43.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12821" PostTypeId="1" AcceptedAnswerId="12825" CreationDate="2015-06-01T08:07:07.930" Score="3" ViewCount="153" Body="&lt;p&gt;I did some research and I've found few similar questions, but not a single one is able to help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, recently I've started using &lt;a href=&quot;https://github.com/dholm/ttcn-el/blob/master/ttcn3.el&quot; rel=&quot;nofollow&quot;&gt;TTCN-3 major mode&lt;/a&gt; and I've found its indentation style awful. I've checked all available c-styles and there is no hope aswell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to turn off this whole smart indentations that are triggered for example by &lt;code&gt;indent-for-tab-command&lt;/code&gt; or ending line with semicolon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, due to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cc-mode)                      ; ttcn-3-mode inherits from cc-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;major mode &lt;code&gt;TTCN-3&lt;/code&gt; uses electric-indent-mode. I am trying to turn this off only for &lt;code&gt;TTCN-3&lt;/code&gt; but my wonderful lisp craft is not working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ttcn3-mode-hook (lambda () (electric-indent-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could someone please tell me how to do this properly ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw. Should I add hook after or before &lt;code&gt;load&lt;/code&gt; function in my &lt;code&gt;.emacs&lt;/code&gt; file ?&lt;/p&gt;&#xA;" OwnerUserId="8440" LastEditorUserId="105" LastEditDate="2015-06-01T16:11:02.787" LastActivityDate="2015-06-01T16:11:02.787" Title="How to turn off electric indentation only for TTCN-3 major mode" Tags="|indentation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12822" PostTypeId="2" ParentId="12814" CreationDate="2015-06-01T08:20:09.940" Score="30" Body="&lt;p&gt;I have done something &lt;a href=&quot;http://fredtantini.free.fr/blog/index.php?article13/un-peu-de-typographie-et-marquer-les-raccorcus-clavier-dans-org-mode&quot; rel=&quot;noreferrer&quot;&gt;similar&lt;/a&gt;.&#xA;It's in French, but the code should speak for itself. I use &lt;code&gt;‰&lt;/code&gt; for&#xA;the marker (I use a &lt;a href=&quot;http://bepo.fr&quot; rel=&quot;noreferrer&quot;&gt;bepo&lt;/a&gt; layout), and when I do, the&#xA;marked text as a pressed-button style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not fluent in lisp, so there may be room for improvement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have done is that, when using &lt;code&gt;‰&lt;/code&gt; for marker, the marked text has a pressed-button style, and when exported it is translated to &lt;code&gt;&amp;lt;kbd&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I had to define a new face:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defface my-face-org-keystroke&#xA;  '((t (:inherit shadow &#xA;        :box (:line-width -2 ;neg. in order to keep the same size of lines&#xA;              :color &quot;grey75&quot;&#xA;              :style pressed-button)))) &quot;Face for keystrokes&quot;&#xA;        :group 'org-faces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then customize  &lt;code&gt;org-emphasis-alist&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;((&quot;*&quot; bold)&#xA; (&quot;/&quot; italic)&#xA; (&quot;_&quot; underline)&#xA; (&quot;=&quot; org-code verbatim)&#xA; (&quot;~&quot; org-verbatim verbatim)&#xA; (&quot;+&quot;&#xA;  (:strike-through t))&#xA; (&quot;‰&quot; my-face-org-keystroke verbatim));This line is what you want to add&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the export, you may need to load &lt;code&gt;ox.el&lt;/code&gt; with &lt;code&gt;(require 'ox)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then each time &lt;code&gt;bold&lt;/code&gt; or &lt;code&gt;code&lt;/code&gt; appears in a function (in &lt;code&gt;ox-org.el&lt;/code&gt;), I have created a similar function (or modified existing ones):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;creation&#xA;(defun org-html-keystroke (keystroke contents info)&#xA;  &quot;Transcode KEYSTROKE from Org to HTML.&#xA;CONTENTS is nil.  INFO is a plist holding contextual&#xA;information.&quot;&#xA;  (format (or (cdr (assq 'my-object-keystroke org-html-text-markup-alist)) &quot;%s&quot;)&#xA;          (org-html-encode-plain-text (org-element-property :value keystroke))))&#xA;&#xA;&#xA;;creation&#xA;(defun org-element-my-object-keystroke-parser ()&#xA;  &quot;Parse code object at point.&#xA;&#xA;Return a list whose CAR is `my-object-keystroke' and CDR is a plist with&#xA;`:value', `:begin', `:end' and `:post-blank' keywords.&#xA;&#xA;Assume point is at the first tilde marker.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (unless (bolp) (backward-char 1))&#xA;    (looking-at org-emph-re)&#xA;    (let ((begin (match-beginning 2))&#xA;          (value (org-match-string-no-properties 4))&#xA;          (post-blank (progn (goto-char (match-end 2))&#xA;                             (skip-chars-forward &quot; \t&quot;)))&#xA;          (end (point)))&#xA;      (list 'my-object-keystroke&#xA;            (list :value value&#xA;                  :begin begin&#xA;                  :end end&#xA;                  :post-blank post-blank)))))&#xA;&#xA;;creation&#xA;(defun org-element-my-object-keystroke-interpreter (keystroke contents)&#xA;  &quot;Interpret KEYSTROKE object as Org syntax.&#xA;CONTENTS is nil.&quot;&#xA;  (format &quot;‰%s‰&quot; (org-element-property :value keystroke)))&#xA;&#xA;&#xA;;modification&#xA;(defconst org-element-object-successor-alist&#xA;  '((subscript . sub/superscript) (superscript . sub/superscript)&#xA;    (bold . text-markup) (code . text-markup) (italic . text-markup)&#xA;    (strike-through . text-markup) (underline . text-markup)&#xA;    (verbatim . text-markup) (entity . latex-or-entity)&#xA;    (latex-fragment . latex-or-entity) (my-object-keystroke . text-markup))&#xA;  &quot;Alist of translations between object type and successor name.&#xA;Sharing the same successor comes handy when, for example, the&#xA;regexp matching one object can also match the other object.&quot;)&#xA;&#xA;;modification&#xA;(defconst org-element-all-objects&#xA;  '(bold code entity export-snippet footnote-reference inline-babel-call&#xA;         inline-src-block italic line-break latex-fragment link macro&#xA;         radio-target statistics-cookie strike-through subscript superscript&#xA;         table-cell target timestamp underline verbatim my-object-keystroke)&#xA;  &quot;Complete list of object types.&quot;)&#xA;&#xA;&#xA;;modification&#xA;(defun org-element-text-markup-successor ()&#xA;  &quot;Search for the next text-markup object.&#xA;&#xA;Return value is a cons cell whose CAR is a symbol among `bold',&#xA;`italic', `underline', `strike-through', `code' and `verbatim'&#xA;and CDR is beginning position.&quot;&#xA;  (save-excursion&#xA;    (unless (bolp) (backward-char))&#xA;    (when (re-search-forward org-emph-re nil t)&#xA;      (let ((marker (match-string 3)))&#xA;        (cons (cond&#xA;               ((equal marker &quot;*&quot;) 'bold)&#xA;               ((equal marker &quot;/&quot;) 'italic)&#xA;               ((equal marker &quot;_&quot;) 'underline)&#xA;               ((equal marker &quot;+&quot;) 'strike-through)&#xA;               ((equal marker &quot;~&quot;) 'code)&#xA;               ((equal marker &quot;=&quot;) 'verbatim)&#xA;               ((equal marker &quot;‰&quot;) 'my-object-keystroke) &#xA;               (t (error &quot;Unknown marker at %d&quot; (match-beginning 3))))&#xA;              (match-beginning 2))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, I have defined a &lt;code&gt;my-html&lt;/code&gt; backend for the export:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(org-export-define-derived-backend 'my-html 'html&#xA;  :translate-alist '((my-object-keystroke . org-html-keystroke))&#xA;  :menu-entry ' (?h 1&#xA;                    ((?r &quot;my-html&quot;  org-html-export-to-my-html))))&#xA;&#xA;(defun org-html-export-to-my-html&#xA;  (&amp;amp;optional async subtreep visible-only body-only ext-plist)&#xA;  &quot;Export current buffer to a HTML file.&#xA;&#xA;Return output file's name.&quot;&#xA;  (interactive)&#xA;  (let* ((extension (concat &quot;.&quot; org-html-extension))&#xA;         (file (org-export-output-file-name extension subtreep))&#xA;         (org-export-coding-system org-html-coding-system))&#xA;    (org-export-to-file 'my-html file&#xA;      async subtreep visible-only body-only ext-plist)))&#xA;&#xA;&#xA;(defun org-html-publish-to-my-html (plist filename pub-dir)&#xA;  &quot;Publish an org file to my-html.&#xA;Return output file name.&quot;&#xA;  (org-publish-org-to 'my-html filename&#xA;                      (concat &quot;.&quot; (or (plist-get plist :html-extension)&#xA;                                      org-html-extension &quot;html&quot;))&#xA;                      plist pub-dir))&#xA;&#xA;(defun org-html-convert-region-to-my-html ()&#xA;  &quot;Assume the current region has org-mode syntax, and convert it to HTML.&#xA;This can be used in any buffer.  For example, you can write an&#xA;itemized list in org-mode syntax in an HTML buffer and use this&#xA;command to convert it.&quot;&#xA;  (interactive)&#xA;  (org-export-replace-region-by 'my-html))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when I use &lt;code&gt;C-c C-e h r&lt;/code&gt; it's exported correctly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/x6gbD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qb2Q7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UKUKm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As suggested by OP in comments, you may need to use &lt;code&gt;org-mode-restart&lt;/code&gt; (or &lt;code&gt;org-reload&lt;/code&gt;) or kill/reload your buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; This works for org-mode with versions prior 8.3 (that is till 8.2.10) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With versions ≥8.3.1, I have to modify&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;org-element-all-objects&lt;/li&gt;&#xA;&lt;li&gt;possibly org-element-object-restrictions&lt;/li&gt;&#xA;&lt;li&gt;org-element--set-regexps&lt;/li&gt;&#xA;&lt;li&gt;org-element--object-lex&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and of course still add the functions&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;org-element-my-object-keystroke-parser&lt;/li&gt;&#xA;&lt;li&gt;org-element-my-object-keystroke-interpreter&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;org-element-object-successor-alist &lt;/li&gt;&#xA;&lt;li&gt;org-element-text-markup-successor&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;are now deleted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.orgmode/106232&quot; rel=&quot;noreferrer&quot;&gt;Charles C. Berry&lt;/a&gt; for his help.&lt;/p&gt;&#xA;" OwnerUserId="437" LastEditorUserId="437" LastEditDate="2016-04-10T08:09:32.353" LastActivityDate="2016-04-10T08:09:32.353" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12823" PostTypeId="1" CreationDate="2015-06-01T08:52:48.603" Score="11" ViewCount="404" Body="&lt;p&gt;I want to prevent the &quot;first&quot; click on a frame in an inactive X window from having any effect, other than to make the frame active.  Specifically, I don't want it to reposition point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I can't seem to detect that he frame &lt;em&gt;was&lt;/em&gt; inactive when I get the mouse click.  So the following code &lt;em&gt;always&lt;/em&gt; shows &lt;code&gt;&quot;y&quot;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; detect if frame is active when clicking&#xA;(defun my/mouse-drag-region (event)&#xA;  (interactive &quot;e&quot;)&#xA;  (mouse-minibuffer-check event)&#xA;  (let* ((window (caadr event))&#xA;         (frame (window-frame window)))&#xA;    (if (eql frame (selected-frame))&#xA;        (print &quot;y&quot;)&#xA;      (print &quot;n&quot;))))&#xA;(global-set-key [down-mouse-1] 'my/mouse-drag-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I detect that the frame was previously inactive?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, has someone already achieved what I am trying to do elsewhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/strong&gt; I am asking for something different than &lt;a href=&quot;https://emacs.stackexchange.com/questions/7347/preventing-mouse-clicks-in-inactive-windows-from-repositioning-the-cursor&quot;&gt;this other question&lt;/a&gt;, which is about inactive windows, not inactive frames.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="8376" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-09-28T06:32:07.867" Title="Prevent mouse click in inactive frames from reposistioning point" Tags="|frames|x11|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12824" PostTypeId="1" AcceptedAnswerId="12854" CreationDate="2015-06-01T09:19:03.157" Score="5" ViewCount="75" Body="&lt;p&gt;I'm currently writing up a design document and I want to include a number of references to external documents/URLs. I can manually add reference brackets and links so that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;See the external file blah.txt [1]&#xA;....&#xA;(at bottom of file)&#xA;References&#xA;==========&#xA;[1] http://example.com/blah.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this is going to be prone to errors over the document as I add new references. Is there a built-in or 3rd party package to make adding and managing these references easier?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-06-02T17:00:30.157" Title="Is there a built-in or package solution for managing references in text files?" Tags="|text-editing|text|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12825" PostTypeId="2" ParentId="12821" CreationDate="2015-06-01T09:28:14.050" Score="2" Body="&lt;p&gt;Well, it took extra hour, but here it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ttcn3-mode-hook&#xA;          (lambda ()&#xA;            (setq-default indent-tabs-mode nil)&#xA;            (setq c-basic-offset 4)&#xA;            (c-toggle-electric-state -1)&#xA;            (setq c-syntactic-indentation nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Last two lines are most crucial.&lt;/p&gt;&#xA;" OwnerUserId="8440" LastActivityDate="2015-06-01T09:28:14.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12826" PostTypeId="1" AcceptedAnswerId="12827" CreationDate="2015-06-01T11:10:28.680" Score="13" ViewCount="1141" Body="&lt;p&gt;Is there a function for logging to &lt;em&gt;Messages&lt;/em&gt; buffer without displaying in the echo-area?  Or maybe another build in log mechanism? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm after a kind of console.log(&quot;string&quot;) kind of functionality. &lt;/p&gt;&#xA;" OwnerUserId="6656" LastActivityDate="2016-05-20T12:53:10.960" Title="Is there a function for logging to *Messages* buffer without displaying in the echo-area?" Tags="|logging|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12827" PostTypeId="2" ParentId="12826" CreationDate="2015-06-01T11:44:33.160" Score="11" Body="&lt;p&gt;With emacs-snapshot, you can let-bind &lt;code&gt;inhibit-message&lt;/code&gt; to t:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil means calls to `message' are not displayed.&#xA;  They are still logged to the &lt;em&gt;Messages&lt;/em&gt; buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-01T11:44:33.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12828" PostTypeId="2" ParentId="12826" CreationDate="2015-06-01T12:45:45.890" Score="0" Body="&lt;p&gt;One way to do it is to call &lt;code&gt;(message &quot;&quot;)&lt;/code&gt; immediately after. This will, however, wipe out any existing content in the echo area.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;foo&quot;)&#xA;(message &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastEditorUserId="11" LastEditDate="2016-05-20T12:53:10.960" LastActivityDate="2016-05-20T12:53:10.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12829" PostTypeId="1" CreationDate="2015-06-01T13:30:57.650" Score="1" ViewCount="173" Body="&lt;p&gt;It's been a while and &lt;a href=&quot;https://emacs.stackexchange.com/questions/9692/the-tls-connection-was-non-properly-terminated&quot;&gt;this question about ELPA fetch errors&lt;/a&gt; is getting a lot of views but has no resolution. I want to do some more research. I suspect that GNU ELPA is getting fetched and that the errors are spurious, but I do not know how to confirm that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can ask Emacs for the local GNU ELPA version, so that I can check if it is up to date? If the repository is versioned, how can I get the date of the most recent package update?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-07-02T12:23:16.837" Title="Get local GNU ELPA version" Tags="|package-repositories|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12830" PostTypeId="2" ParentId="3725" CreationDate="2015-06-01T15:16:15.553" Score="4" Body="&lt;p&gt;IIUC &lt;code&gt;buffer-undo-list&lt;/code&gt; is missing from &lt;code&gt;buffer-local-variables&lt;/code&gt; by accident.  The accident is that some code clean up ended up making &lt;code&gt;buffer-local-variables&lt;/code&gt; use the same loop over some of the buffer's local variables, as the loop used when the garbage collector looks for references in a buffer object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it turns out, &lt;code&gt;buffer-undo-list&lt;/code&gt; needs to be handled specially by the GC because we try to throw away elements from it (i.e. some of the entries are treated as &quot;weak references&quot;).  E.g. we throw away undo entries which manipulate markers which are not used elsewhere any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW I think it's just a plain bug, which you might like to report.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-06-01T15:16:15.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12831" PostTypeId="2" ParentId="10607" CreationDate="2015-06-01T15:24:25.433" Score="0" Body="&lt;p&gt;After installing &lt;code&gt;Emacs 24.5.1&lt;/code&gt; the problem did not occur any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works with &lt;code&gt;org-mode 8.2.10&lt;/code&gt; as well as with the current beta &lt;code&gt;8.3 beta&lt;/code&gt; (daily snapshot from today)&lt;/p&gt;&#xA;" OwnerUserId="2377" LastActivityDate="2015-06-01T15:24:25.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12832" PostTypeId="2" ParentId="8099" CreationDate="2015-06-01T15:29:15.467" Score="4" Body="&lt;p&gt;You can try to use &lt;code&gt;font-lock--remove-face-from-text-property&lt;/code&gt;, tho as the &quot;--&quot; indicates, this is not really meant to be used.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-06-01T15:29:15.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12833" PostTypeId="1" CreationDate="2015-06-01T16:15:43.387" Score="1" ViewCount="425" Body="&lt;p&gt;When I scroll up or down, Emacs automatically recenters the current position of point. I tried to disable this behavior by adding the following code to my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq scroll-margin 1&#xA;      scroll-conservatively 10000&#xA;      scroll-up-aggressively 0.01&#xA;      scroll-down-aggressively 0.01&#xA;      auto-hscroll-mode nil&#xA;      scroll-step 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, it doesn't work. I really tried all variables I can find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: I am using AUCTeX and &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6602" LastEditorUserId="504" LastEditDate="2015-06-02T11:12:48.533" LastActivityDate="2015-10-12T03:07:14.817" Title="Can't disable auto-scrolling" Tags="|auctex|emacsclient|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12834" PostTypeId="2" ParentId="12720" CreationDate="2015-06-01T16:27:51.230" Score="4" Body="&lt;p&gt;I found the problem. It appeared to be broken (changing values had no effect) because image-dired caches its thumbnails in &lt;code&gt;~/.emacs.d/image-dired/&lt;/code&gt;. Clearing the cache makes the changes effective.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-06-01T16:27:51.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12835" PostTypeId="1" CreationDate="2015-05-30T16:57:10.720" Score="4" ViewCount="82" Body="&lt;p&gt;I'm learning org-mode now. I'm making a document to keep track of jobs. So each job is a top-level item, and inside it, I have a property drawer along with some other things. In the property drawer, I'm keeping things like the location, contact person and referral source.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some job&#xA;  :PROPERTIES:&#xA;  :Location: The Matrix&#xA;  :Source: Referral from Oracle&#xA;  [...]&#xA;  :END:&#xA;  [ ... more stuff here ... ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure that I want to keep these as properties, since I want to be able to search for entries like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c a m &#xA;Match: Source=&quot;StackOverflow&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I go to export this to HTML or ASCII, the properties don't end up anywhere. What I would really like is a &lt;strong&gt;table of key-value pairs&lt;/strong&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+----------+----------------------+&#xA;| Location | The Matrix           |&#xA;+----------+----------------------+&#xA;| Source   | Referral from Oracle |&#xA;+----------+----------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which would be located right after the &quot;Some job&quot; heading in the example above. It doesn't matter if it's actually a table; a definition list or whatever would be fine. The only thing I've really tried is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: d:t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... and that did nothing (the properties drawer doesn't count as a drawer for this option maybe?)&lt;/p&gt;&#xA;" OwnerUserId="8465" OwnerDisplayName="Hut8" LastActivityDate="2015-06-01T18:21:47.963" Title="Export table from property drawer in org-mode" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ClosedDate="2015-06-03T22:52:01.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="12836" PostTypeId="1" AcceptedAnswerId="12838" CreationDate="2015-06-01T20:59:48.923" Score="3" ViewCount="522" Body="&lt;p&gt;I have some difficulties to understand how Lisp wanted to receive the arguments. When I look into the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html&quot; rel=&quot;nofollow&quot;&gt;documentation about arguments in functions&lt;/a&gt;, I need to name the arguments exactly as in the source code, when calling the same function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look into the documentation of Emacs function &lt;code&gt;indent-region&lt;/code&gt;, I get the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;= runs the command indent-region, which is an interactive compiled&#xA;Lisp function in `indent.el'.&#xA;&#xA;It is bound to =, &amp;lt;menu-bar&amp;gt; &amp;lt;emacs-lisp&amp;gt; &amp;lt;indent-region&amp;gt;, C-M-\.&#xA;&#xA;(indent-region START END &amp;amp;optional COLUMN)&#xA;&#xA;Indent each nonblank line in the region.&#xA;A numeric prefix argument specifies a column: indent each line to that column.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I create a function, that pass the arguments to the function itself, as described in the documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (start end)&#xA;  (interactive)&#xA;  (indent-region start end)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see no difference when comparing with how another custom functions handles the functionality. When I visually selected a region, and call the function, I got the error that the arguments are of the wrong type. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this led me to wonder why the &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; arguments are not accepted in this case?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-06-02T15:58:37.160" LastActivityDate="2015-06-02T15:58:37.160" Title="How interpret the Lisp way to include arguments in functions?" Tags="|functions|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12837" PostTypeId="2" ParentId="12836" CreationDate="2015-06-01T21:10:41.300" Score="7" Body="&lt;p&gt;Experimentation can only go so far without fundamentals.  The first two chapters of &lt;a href=&quot;http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_toc_start&quot;&gt;SICP&lt;/a&gt; will teach you &lt;em&gt;all the LISP&lt;/em&gt; you need to know for Emacs.  It takes about half a day to go through it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After this comes the easy part: learn the names of standard functions at your own pace.  Some of them you already know, others you can look up with &lt;code&gt;apropos&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-01T21:10:41.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12838" PostTypeId="2" ParentId="12836" CreationDate="2015-06-01T21:34:57.187" Score="10" Body="&lt;p&gt;This risks being closed as unclear. Show your code that provokes an error, as well as telling how you invoke it. Show a backtrace from setting &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your function &lt;code&gt;foo&lt;/code&gt; looks OK; &lt;code&gt;bar&lt;/code&gt; does not, because &lt;code&gt;indent-region&lt;/code&gt; needs two arguments and you are passing only one.  What's more, that argument would be the result of evaluating the sexp &lt;code&gt;(start end)&lt;/code&gt;, which means applying function &lt;code&gt;start&lt;/code&gt; to the value of variable &lt;code&gt;end&lt;/code&gt;.  If you wanted to pass the list &lt;code&gt;(start end)&lt;/code&gt; as an argument then you would need to quote it: &lt;code&gt;'(start end)&lt;/code&gt;. But that's no good for &lt;code&gt;indent-region&lt;/code&gt;, which expects separate arguments for the start and end positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A guess is that you tried to use &lt;code&gt;M-x foo&lt;/code&gt; instead of &lt;code&gt;M-: (foo (region-beginning) (region-end))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;code&gt;foo&lt;/code&gt; to be a command, so that you can bind it to a key or invoke it using &lt;code&gt;M-x&lt;/code&gt;, then you need an &lt;code&gt;interactive&lt;/code&gt; spec. Use &lt;code&gt;C-h f interactive&lt;/code&gt;. That tells you that to pass the region start and end positions you can use &lt;code&gt;(interactive &quot;r&quot;)&lt;/code&gt; -- there is only one &lt;code&gt;r&lt;/code&gt; there, but two arguments are passed to the function (e.g. &lt;code&gt;foo&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest doing &lt;code&gt;C-h i&lt;/code&gt;, choosing &lt;code&gt;Emacs Lisp Intro&lt;/code&gt;, and starting to read it. You can also get tips for &lt;a href=&quot;http://www.emacswiki.org/emacs/LearnEmacsLisp&quot;&gt;learning Emacs Lisp&lt;/a&gt; on Emacs Wiki.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-01T21:34:57.187" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12839" PostTypeId="1" AcceptedAnswerId="12883" CreationDate="2015-06-01T22:01:41.260" Score="9" ViewCount="1125" Body="&lt;p&gt;I'm trying to make the Agenda Clockreport show how many &lt;em&gt;pomodoros&lt;/em&gt; I've invested in a task.&#xA;A Pomodoro is 25 minutes. For example, 1:15 hours of work is 3 pomodoros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to customize &lt;code&gt;org-agenda-clockreport-paramater-plist&lt;/code&gt;, and I would like to extract &quot;Time&quot; and convert it to a pomodoro. &#xA;I.e., (time in minutes / 25) = pomodoro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was considering using &lt;code&gt;:formula&lt;/code&gt; from &lt;a href=&quot;http://orgmode.org/manual/The-clock-table.html&quot; rel=&quot;noreferrer&quot;&gt;The Clock Table&lt;/a&gt; but I'm not sure where to begin or where to look for examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this technically possible somehow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit Solution]&lt;/strong&gt;&lt;br&gt;&#xA;Thanks to Sacha's post, I use the config as following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-clockreport-parameter-plist &#xA; '(:fileskip0 t :link t :maxlevel 2 :formula &quot;$5=($3+$4)*(60/25);t&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This creates a report that skips empty org-agenda files, has 2 levels depth and adds a column that shows pomodoros with 2 decimals. ('t' = time in hours).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/99hBL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you like, please remember to up-vote Sacha's answer. &lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-07-14T14:38:40.670" LastActivityDate="2015-07-14T14:38:40.670" Title="Use formula in agenda clockreport to convert time? (pomodoro count in Agenda)" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12840" PostTypeId="1" AcceptedAnswerId="12850" CreationDate="2015-06-01T23:31:06.240" Score="2" ViewCount="3057" Body="&lt;p&gt;I tried the following methods in my custom mode-line, but they all failed.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-format&#xA;      (:propertize&#xA;       ;; TODO: concatenate the long string.&#xA;       ;; global-mode-string&#xA;       ;; (t org-mode-line-string org-timer-mode-line-string)&#xA;       ;; (t org-timer-mode-line-string) ; org-timer default time 25, (Pomodoro time management technique)&#xA;       ;; (:eval org-clock-mode-line-timer)&#xA;       ;; face (:foreground &quot;cyan&quot; :weight 'bold)&#xA;       ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="504" LastEditDate="2015-06-02T10:52:35.990" LastActivityDate="2015-06-02T12:43:59.257" Title="How to show org-clock (and org-pomodoro) timer in mode-line?" Tags="|org-mode|mode-line|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12841" PostTypeId="1" AcceptedAnswerId="12847" CreationDate="2015-06-02T03:52:01.807" Score="102" ViewCount="44884" Body="&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; has the ability to render source code, with blocks of the following syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: &amp;lt;name&amp;gt;&#xA;#+BEGIN_SRC &amp;lt;language&amp;gt; &amp;lt;switches&amp;gt; &amp;lt;header arguments&amp;gt;&#xA;    &amp;lt;body&amp;gt;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an existing command to quickly insert these blocks in &lt;code&gt;org-mode&lt;/code&gt;, or do I need to use an external tool like &lt;code&gt;yasnippet&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="504" LastEditDate="2015-06-02T11:15:54.100" LastActivityDate="2022-10-14T04:15:01.423" Title="Quickly insert source blocks in org mode" Tags="|org-mode|org-babel|" AnswerCount="7" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12842" PostTypeId="1" CreationDate="2015-06-02T03:58:36.223" Score="7" ViewCount="1841" Body="&lt;p&gt;I have an org project that has many &lt;code&gt;.org&lt;/code&gt; files (more than 300). When I invoke &lt;code&gt;org-publish&lt;/code&gt; in Emacs, after a while it aborts and shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;...&#xA;Publishing file e:/git/blog.site.src/src/org/life/day-time-plan.org using `org-html-publish-to-html'&#xA;Parsing config file...&#xA;apply: Creating pipe: too many open files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs version: 24.5.1 &lt;/li&gt;&#xA;&lt;li&gt;Org Mode version: 8.2.10 &lt;/li&gt;&#xA;&lt;li&gt;OS: Windows 8&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I found a similar issue here: &lt;a href=&quot;https://github.com/OmniSharp/omnisharp-emacs/issues/132&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/OmniSharp/omnisharp-emacs/issues/132&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... but there doesn't seem to be a known fix. Can anybody help me with this? Any info is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8466" LastEditorUserId="504" LastEditDate="2015-06-02T10:47:43.350" LastActivityDate="2015-06-02T10:47:43.350" Title="&quot;Creating pipe: too many open files&quot; error when running org-publish on large project" Tags="|org-export|org-publish|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="12843" PostTypeId="1" CreationDate="2015-06-02T06:16:20.167" Score="39" ViewCount="19379" Body="&lt;p&gt;I am using &lt;code&gt;spacemacs&lt;/code&gt; and often use the &lt;code&gt;SPC p f&lt;/code&gt; key binding to find files in a &lt;code&gt;projectile&lt;/code&gt; project. But even after removing a file from a git, &lt;code&gt;SPC p f&lt;/code&gt; will show me that deleted file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried using &lt;code&gt;SPC p I&lt;/code&gt; to invalid the cache, but that didn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to resolve the problem?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="115" LastEditDate="2015-06-02T20:34:05.940" LastActivityDate="2018-08-03T12:50:43.307" Title="How to clear cache of projectile file in spacemacs?" Tags="|projectile|spacemacs|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12844" PostTypeId="2" ParentId="12841" CreationDate="2015-06-02T06:39:51.787" Score="14" Body="&lt;p&gt;Here's a function which inserts the code block:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-insert-source-block (name language switches header)&#xA;  &amp;quot;Asks name, language, switches, header.&#xA;Inserts org-mode source code snippet&amp;quot;&#xA;  (interactive &amp;quot;sname? &#xA;slanguage? &#xA;sswitches? &#xA;sheader? &amp;quot;)&#xA;  (insert &#xA;   (if (string= name &amp;quot;&amp;quot;)&#xA;       &amp;quot;&amp;quot;&#xA;     (concat &amp;quot;#+NAME: &amp;quot; name) )&#xA;   (format &amp;quot;&#xA;#+BEGIN_SRC %s %s %s&#xA;&#xA;#+END_SRC&amp;quot; language switches header&#xA;)&#xA;   )&#xA;  (forward-line -1)&#xA;  (goto-char (line-end-position))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2021-07-07T20:48:14.327" LastActivityDate="2021-07-07T20:48:14.327" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="12845" PostTypeId="1" AcceptedAnswerId="12846" CreationDate="2015-06-02T07:20:12.210" Score="5" ViewCount="287" Body="&lt;p&gt;I have to launch almost any application by specifying the whole path which is annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;git&lt;/code&gt; works fine, but &lt;code&gt;lua&lt;/code&gt; does not. Both are installed in the same place:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which git&#xA;/usr/local/bin/git&#xA;$ which lua&#xA;/usr/local/bin/lua&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to make &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;shell&lt;/code&gt; behave like my standard shell? Or maybe there's a decent shell emulator as a package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;echo $SHELL&lt;/code&gt; outputs &lt;code&gt;/bin/bash&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="367" LastEditorUserId="504" LastEditDate="2015-06-02T10:38:57.173" LastActivityDate="2015-06-02T10:38:57.173" Title="M-x shell doesn't know about installed apps" Tags="|shell|path|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12846" PostTypeId="2" ParentId="12845" CreationDate="2015-06-02T07:54:37.180" Score="9" Body="&lt;p&gt;Well, as @dshepherd mentioned, you are missing &lt;code&gt;/usr/local/bin&lt;/code&gt; in PATH. &lt;code&gt;git&lt;/code&gt; is working probably only because there is symlink in &lt;code&gt;/bin&lt;/code&gt;. Try &lt;code&gt;export PATH=$PATH:/usr/local/bin&lt;/code&gt; in emacs terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also check this out: &lt;a href=&quot;https://stackoverflow.com/questions/8606954/path-and-exec-path-set-but-emacs-does-not-find-executable&quot;&gt;https://stackoverflow.com/questions/8606954/path-and-exec-path-set-but-emacs-does-not-find-executable&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the future, in case of similar issue, checking PATH (&lt;code&gt;echo $PATH&lt;/code&gt;) should be first thing you should do.&lt;/p&gt;&#xA;" OwnerUserId="8440" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-02T07:54:37.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12847" PostTypeId="2" ParentId="12841" CreationDate="2015-06-02T09:26:53.130" Score="125" Body="&lt;p&gt;As @kaushalmodi mentions in the comments you can use &lt;a href=&quot;https://orgmode.org/manual/Structure-Templates.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(org) Structure Templates&lt;/code&gt;&lt;/a&gt; to speed up insertion of different types of blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general procedure is to insert &lt;code&gt;&amp;lt;&lt;/code&gt; followed by a &lt;em&gt;template selector&lt;/em&gt; (usually a single letter) on an otherwise empty line and press &lt;kbd&gt;TAB&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The template selector for a generic source block template is &lt;code&gt;s&lt;/code&gt;, so typing &lt;code&gt;&amp;lt;s&lt;/code&gt; followed by &lt;kbd&gt;TAB&lt;/kbd&gt; will give you this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC &#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Point will be positioned at the end of the first line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a good first approximation of what you want to achieve, but this is Emacs, so let's make it better!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define custom templates by adding one or more entries to a variable called &lt;code&gt;org-structure-template-alist&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'org-structure-template-alist '(&quot;n&quot; &quot;#+NAME: ?&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code adds a &lt;code&gt;#+NAME:&lt;/code&gt; template to &lt;code&gt;org-structure-template-alist&lt;/code&gt;, using &lt;code&gt;n&lt;/code&gt; as a template selector. After expanding this template point will be positioned at the location of &lt;code&gt;?&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you always name your code blocks, you can also overwrite the original version of the source block template with an extended version that includes the &lt;code&gt;#+NAME:&lt;/code&gt; line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'org-structure-template-alist&#xA;             '(&quot;s&quot; &quot;#+NAME: ?\n#+BEGIN_SRC \n\n#+END_SRC&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Typing &lt;code&gt;&amp;lt;s&lt;/code&gt; followed by &lt;kbd&gt;TAB&lt;/kbd&gt; will then give you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: &#xA;#+BEGIN_SRC &#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is just the tip of the iceberg; you can use a similar approach to define additional templates for language-specific code blocks, code blocks with specific header arguments, etc.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="1979" LastEditDate="2020-02-04T15:16:10.873" LastActivityDate="2020-02-04T15:16:10.873" CommentCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="12848" PostTypeId="2" ParentId="12829" CreationDate="2015-06-02T11:01:28.653" Score="1" Body="&lt;p&gt;The version information is available by typing &lt;code&gt;list-packages&lt;/code&gt; (a) directly in the standard view in the second column (b) by hitting return on a given entry displaying more detailed information.   This is valid for both installed packages and for packages available from the repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For packages you have installed, they will be found in a directory of the form &lt;code&gt;~/.emacs.d/elpa/package-name-version&lt;/code&gt;, or under &lt;code&gt;package-user-dir&lt;/code&gt; if that has been changed, so the director name includes the version information.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other system installed packages may be found under the directories in the &lt;code&gt;package-directory-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Programmatically the list of packages installed is available after &lt;code&gt;package-initialize&lt;/code&gt; in the variable &lt;code&gt;package-alist&lt;/code&gt;, this contains version information to as a separate field in the data structure.  Note &quot;installed&quot; does not mean &quot;activated&quot;, the list of names of such activated packages is in &lt;code&gt;package-activated-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package.el&lt;/code&gt; includes the function &lt;code&gt;package-menu--find-upgrades&lt;/code&gt; which gives an example of checking version of installed packages against those available from the repository.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2015-06-02T11:01:28.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12849" PostTypeId="1" AcceptedAnswerId="12856" CreationDate="2015-06-02T11:32:02.103" Score="10" ViewCount="405" Body="&lt;p&gt;&lt;code&gt;^&lt;/code&gt; is the key binding for moving to the parent directory in &lt;code&gt;dired&lt;/code&gt; (&quot;Up directory&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in &lt;code&gt;Gnu Emacs&lt;/code&gt; on &lt;code&gt;Windows 7 Professional 64-bit&lt;/code&gt; with my German keyboard layout, it is not sufficient to type &quot;^&quot; but I have to type space afterwards to make the key-binding work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I redefine the key-binding to avoid having to press space and move upwards only with &quot;^&quot;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h k ^&amp;lt;space&amp;gt;&lt;/code&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;^ runs the command dired-up-directory, which is an interactive&#xA;  compiled Lisp function in `dired+.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to ^,   .&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(dired-up-directory &amp;amp;optional OTHER-WINDOW)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Run Dired on parent directory of current directory. Find the parent&#xA;  directory either in this buffer or another buffer. Creates a buffer if&#xA;  necessary.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2377" LastEditorUserId="2377" LastEditDate="2015-06-02T15:11:17.157" LastActivityDate="2015-06-02T20:03:54.260" Title="How to avoid typing &quot;space&quot; after &quot;^&quot; for moving up in directory in dired?" Tags="|key-bindings|dired|microsoft-windows|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12850" PostTypeId="2" ParentId="12840" CreationDate="2015-06-02T12:43:59.257" Score="3" Body="&lt;p&gt;Thanks @T.Verron 's coments hint, then I got this. And it work.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-format&#xA;      (:propertize&#xA;       (t org-mode-line-string)&#xA;       face (:foreground &quot;cyan&quot; :weight 'bold)))&#xA;&#xA;(add-hook 'org-clock-out-hook&#xA;          '(lambda ()&#xA;             (setq org-mode-line-string nil)&#xA;             (force-mode-line-update)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2015-06-02T12:43:59.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12851" PostTypeId="2" ParentId="9692" CreationDate="2015-06-02T13:15:56.447" Score="2" Body="&lt;p&gt;I can no longer reproduce the issue after upgrading to the the latest stable Emacs (currently 24.5). &lt;kbd&gt;C-h N&lt;/kbd&gt; shows that a number of changes have been made to package signatures in that version.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-06-02T13:15:56.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12852" PostTypeId="2" ParentId="5694" CreationDate="2015-06-02T13:37:38.953" Score="5" Body="&lt;p&gt;In the current version, if you make sure that each of your requests has a comment line immediately succeeding it, then the forms will be passed correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following code will send &lt;code&gt;'data':'foobar'&lt;/code&gt;, with no extra newline. The content length received by &lt;code&gt;netcat&lt;/code&gt; is exactly 11, which was what we wanted.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;POST :domain/thing&#xA;Content-Type: application/x-www-form-urlencoded&#xA;data=foobar&#xA;#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The block below, on the other hand, returns &lt;code&gt;'data': 'foobar\n'&lt;/code&gt; with a content length of 12.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;POST :domain/thing&#xA;Content-Type: application/x-www-form-urlencoded&#xA;data=foobar&#xA;&#xA;#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-06-02T13:37:38.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12853" PostTypeId="2" ParentId="12849" CreationDate="2015-06-02T14:28:48.483" Score="0" Body="&lt;p&gt;I guess you've confirmed the binding of &lt;code&gt;^&lt;/code&gt; in Dired as being &lt;code&gt;dired-up-directory&lt;/code&gt;, so which command is invoked is not the problem, unless you or something you load has advised that command.  (Use &lt;code&gt;C-h k ^&lt;/code&gt;, and let us know if the command is advised.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You tagged this with &lt;code&gt;microsoft-windows&lt;/code&gt;.  Maybe mention which MS Windows version you use.  I do not see this with Windows 7 64-bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you see the same behavior if you start Emacs by using &lt;code&gt;runemacs -Q&lt;/code&gt;, i.e., with no init file?  If so, please give a recipe here, starting from &lt;code&gt;runemacs -Q&lt;/code&gt;. In that case, this could be an Emacs bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not see the problem with &lt;code&gt;emacs -Q&lt;/code&gt; then recursively bisect your init file until you narrow it down to find the culprit.  You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment out the region of code (use &lt;code&gt;C-u&lt;/code&gt; with it to uncomment the region).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you find the culprit code, you can investigate that more closely.  Or you can report here what you've found, if you need further help. For the best help, be as specific as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for redefining the key: That's not a problem - just use &lt;code&gt;(define-key dired-mode-map SOME-KEY 'dired-up-directory)&lt;/code&gt;, where &lt;code&gt;SOME-KEY&lt;/code&gt; is a key description.  For example, to bind the command to &lt;code&gt;C-o&lt;/code&gt;, you can use this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key dired-mode-map (kbd &quot;C-o&quot;) 'dired-up-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Updated after your comment and others -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you see the same thing from &lt;code&gt;emacs -Q&lt;/code&gt;, the problem is either something in your MS Windows setup (i.e., outside Emacs) or a bug in Emacs itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But other comments make clear that the problem seems to be sticky keys in MS Windows.  Try &lt;a href=&quot;https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/access_stickykeys_settings.mspx?mfr=true&quot; rel=&quot;nofollow&quot;&gt;turning sticky keys off&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-02T15:28:45.573" LastActivityDate="2015-06-02T15:28:45.573" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12854" PostTypeId="2" ParentId="12824" CreationDate="2015-06-02T17:00:30.157" Score="7" Body="&lt;p&gt;Something like Markdown or Org seems appropriate here, but if you are just looking for an easier way to manage footnotes you can enable &lt;code&gt;footnote-mode&lt;/code&gt;. That provides key-bindings for adding a new footnote, jumping between the reference and the footnote, and so on. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-06-02T17:00:30.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12855" PostTypeId="2" ParentId="11025" CreationDate="2015-06-02T18:29:19.003" Score="5" Body="&lt;p&gt;In the release log of emacs:(&lt;a href=&quot;http://www.gnu.org/software/emacs/news/NEWS.24.5&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/news/NEWS.24.5&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Installation Changes in Emacs 24.3&#xA;&#xA;** The default X toolkit is now Gtk+ version 3.&#xA;&#xA;If you don't pass `--with-x-toolkit' to configure, or if you use&#xA;`--with-x-toolkit=gtk' or `--with-x-toolkit=yes', configure will try&#xA;to build with Gtk+ version 3, and if that fails, try Gtk+ version 2.&#xA;You can explicitly require a specific version by passing&#xA;`--with-x-toolkit=gtk2' or `--with-x-toolkit=gtk3' to configure.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6784" LastEditorUserId="675" LastEditDate="2015-06-02T20:34:42.473" LastActivityDate="2015-06-02T20:34:42.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12856" PostTypeId="2" ParentId="12849" CreationDate="2015-06-02T20:03:54.260" Score="12" Body="&lt;p&gt;With your keyboard setup, the key ^ is most probably a &quot;dead key&quot;. It is a key meant to be used in conjunction with another one, in order to produce another character. In this case, it is meant to produce accented characters : ^e will produce ê, ^a will produce â and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should not be specific to emacs though : I guess all your applications require you to hit ^ and  to produce an actual ^ on the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this, you simply have to use another keyboard layout. In the case of your german layout in a windows environment, I'll simply refer to &lt;a href=&quot;https://superuser.com/questions/280005/how-to-make-and-non-dead-keys-on-windows-7-with-german-keyboard-layout&quot;&gt;https://superuser.com/questions/280005/how-to-make-and-non-dead-keys-on-windows-7-with-german-keyboard-layout&lt;/a&gt;, hoping this is the right thing to do.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="-1" LastEditDate="2017-03-20T10:04:44.717" LastActivityDate="2015-06-02T20:03:54.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12857" PostTypeId="2" ParentId="7335" CreationDate="2015-06-02T22:51:02.983" Score="1" Body="&lt;p&gt;This is fixed in the under-development version of org-mode, per the thread at &lt;a href=&quot;http://thread.gmane.org/gmane.emacs.orgmode/98091&quot; rel=&quot;nofollow&quot;&gt;http://thread.gmane.org/gmane.emacs.orgmode/98091&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8470" LastActivityDate="2015-06-02T22:51:02.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12858" PostTypeId="1" AcceptedAnswerId="14421" CreationDate="2015-06-03T00:02:07.783" Score="6" ViewCount="630" Body="&lt;p&gt;Under &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Shift-Selection.html&quot;&gt;&lt;code&gt;shift-select-mode&lt;/code&gt;&lt;/a&gt;, cursor keys behave like many other text editing environments: &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;motion&lt;/kbd&gt; starts selecting (sets and activates the mark, in Emacs terms), and &lt;kbd&gt;motion&lt;/kbd&gt; without &lt;kbd&gt;Shift&lt;/kbd&gt; stops selecting (deactivates the mark, in Emacs terms).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far so good, but Emacs isn't your basic editor. It has so many sophisticated motions that it isn't practical to manage a &lt;kbd&gt;Shift&lt;/kbd&gt; variant for all of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't mesh well with commands that mark a region. For example, I type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and move the cursor to the beginning, then press C-M-SPC. This results in the mark at the end of the sexp, i.e. after &lt;code&gt;foo&lt;/code&gt;, and the point before the &lt;code&gt;f&lt;/code&gt;. I would expect that pressing &lt;code&gt;S-right&lt;/code&gt; will retain the mark and move the point. But it doesn't: since the previous command wasn't a shift-selectable command (a command with &lt;code&gt;^&lt;/code&gt; in its interactive specification), pressing &lt;code&gt;S-right&lt;/code&gt; at that point sets the mark before the &lt;code&gt;f&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure Emacs so that when the mark is already set and active, &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;motion&lt;/kbd&gt; doesn't move the mark? I always have &lt;code&gt;transient-mark-mode&lt;/code&gt; on, that's not a concern.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-08-03T07:58:11.060" Title="In shift selection, retain the mark if it's already active" Tags="|region|motion|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12859" PostTypeId="1" AcceptedAnswerId="12861" CreationDate="2015-06-03T00:55:17.647" Score="6" ViewCount="343" Body="&lt;p&gt;Using the input mode latin-1-prefix I can enter &quot;~a&quot; which gives me &quot;ã&quot;. I am looking for a similar way to enter the characters &quot;āēīōū&quot; (vocals with bars).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What input mode does allow me to input the characters &quot;āēīōū&quot;?&lt;/li&gt;&#xA;&lt;li&gt;Is there a general method to retreive a list of input modes that include a specified character?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8472" LastEditorUserId="8472" LastEditDate="2016-12-23T09:58:50.323" LastActivityDate="2016-12-23T09:58:50.323" Title="How do I find out which input modes include a specified uft-8 character?" Tags="|character-encoding|input-method|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12861" PostTypeId="2" ParentId="12859" CreationDate="2015-06-03T03:02:40.503" Score="5" Body="&lt;p&gt;There's no general way to find out what input methods give access to a given set of characters.  An input method is written in Emacs Lisp, and it can use any Emacs Lisp primitives to build characters.  From a quick look under &lt;code&gt;lisp/leim/quail&lt;/code&gt;, I see that the &lt;code&gt;latin-4-postfix&lt;/code&gt;, &lt;code&gt;latin-4-alt-postfix&lt;/code&gt;, and &lt;code&gt;TeX&lt;/code&gt; input methods include vowels with macrons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole point of Emacs, however, is that it is extensible — so why don't you define your own input method?  Say, something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(quail-define-package &quot;macron-underline&quot; &quot;Macron&quot; &quot;MC&quot;)&#xA;&#xA;(quail-define-rules&#xA; (&quot;_a&quot; ?ā)&#xA; (&quot;_e&quot; ?ē)&#xA; (&quot;_i&quot; ?ī)&#xA; (&quot;_o&quot; ?ō)&#xA; (&quot;_u&quot; ?ū)&#xA; (&quot;__&quot; ?_))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then say &lt;code&gt;M-x set-input-method macron-underline&lt;/code&gt;, and you're all set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Aside.  Many, many years ago, under the old, pre-Unicode MULE, I designed and implemented the &lt;code&gt;polish-slash&lt;/code&gt; input method.  While the code included in Emacs is no longer my original code, I'm still using it today.  End of aside.)&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-06-03T03:02:40.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12862" PostTypeId="1" CreationDate="2015-06-03T05:44:21.347" Score="1" ViewCount="68" Body="&lt;p&gt;I'm using refile in a table, but it tries to move all the table, not the line I'm in, if refile cannot move a table-row i think a more general way would be to move the line itself, without knowing if is a list-item, table row, or whatever, do you guys know how to set this? Thanks a lot&lt;/p&gt;&#xA;" OwnerUserId="8471" LastEditorUserId="504" LastEditDate="2015-06-03T07:10:41.427" LastActivityDate="2015-06-03T07:10:41.427" Title="Is there a way to refile a table row or a line?" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12863" PostTypeId="1" AcceptedAnswerId="12891" CreationDate="2015-06-03T07:13:46.867" Score="5" ViewCount="2457" Body="&lt;p&gt;In &lt;code&gt;web-mode&lt;/code&gt;, indentation for markup gets set to &lt;code&gt;8&lt;/code&gt; when I open a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have set &lt;code&gt;web-mode-indent-markup-indent-offset&lt;/code&gt; via customize to &lt;code&gt;2&lt;/code&gt;. When I check it outside of a &lt;code&gt;web-mode&lt;/code&gt; buffer, it is set to &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lines concerning &lt;code&gt;web-mode&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapcar (lambda (plugin-dir)&#xA;          (add-to-list 'load-path (concat &quot;~/.emacs.d/plugins/&quot; plugin-dir)))&#xA;        '( ;; ... some more plugins&#xA;          &quot;web-mode&quot;))&#xA;&#xA;(add-hook 'web-mode-hook 'zencoding-mode)&#xA;&#xA;(custom-set-variables&#xA; ;; ...&#xA; '(web-mode-markup-indent-offset 2)&#xA; ;; ...&#xA; )&#xA;&#xA;(require 'web-mode)&#xA;&#xA;(mapcar (lambda (file-ending)&#xA;          (add-to-list 'auto-mode-alist (cons file-ending 'web-mode)))&#xA;        '(&quot;\\.php\\'&quot; &quot;\\.ejb\\'&quot; &quot;\\.django\\'&quot; &quot;\\.tt\\'&quot; &quot;\\.html\\'&quot;))&#xA;&#xA;(define-key web-mode-map (kbd &quot;C-c /&quot;) 'web-mode-element-close)&#xA;&#xA;(defun expand-for-web-mode ()&#xA;  (when (equal mode-name &quot;Web&quot;)&#xA;    (make-local-variable 'yas-extra-modes)&#xA;    (setq yas-extra-modes&#xA;          (let ((web-lang (web-mode-language-at-pos)))&#xA;            (cond&#xA;             ((equal web-lang &quot;html&quot;)       '(html-mode))&#xA;             ((equal web-lang &quot;css&quot;)        '(css-mode))&#xA;             ((equal web-lang &quot;javascript&quot;) '(javascript-mode))&#xA;             )))))&#xA;&#xA;(add-hook 'yas-before-expand-snippet-hook 'expand-for-web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I use &lt;code&gt;expand-region&lt;/code&gt;. It sets a hook to &lt;code&gt;web-mode&lt;/code&gt;, but the hook just adds &lt;code&gt;web-mode-mark-and-expand&lt;/code&gt; to a local &lt;code&gt;er/try-expand-list&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried a &quot;minimal&quot; configuration, by starting Emacs via &lt;code&gt;emacs -q&lt;/code&gt; and just loading and requiring &lt;code&gt;web-mode&lt;/code&gt; and setting the variable to &lt;code&gt;2&lt;/code&gt; - same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every time I enter a &lt;code&gt;web-mode&lt;/code&gt; buffer it gets set locally to &lt;code&gt;8&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I could use a hook like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'web-mode-hook&#xA;  (lambda () &quot;&quot;&#xA;    (setq web-mode-markup-indent-offset 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To set it to &lt;code&gt;2&lt;/code&gt;, but that defeats the purpose of &lt;code&gt;customize&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5336" LastEditorUserId="2710" LastEditDate="2015-06-04T10:54:08.820" LastActivityDate="2015-06-04T10:54:08.820" Title="web-mode custom indent setting ignored" Tags="|indentation|web-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12864" PostTypeId="1" AcceptedAnswerId="13026" CreationDate="2015-06-03T07:28:42.940" Score="13" ViewCount="8551" Body="&lt;p&gt;Since &lt;code&gt;ediff-files&lt;/code&gt; and &lt;code&gt;ediff-buffers&lt;/code&gt; result in &lt;code&gt;apply: Searching for program: no such file or directory, diff&lt;/code&gt; error on windows machines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to compare two files using Emacs on a windows system?&lt;/p&gt;&#xA;" OwnerUserId="6527" LastEditorUserId="5173" LastEditDate="2019-05-29T16:03:45.167" LastActivityDate="2019-09-25T21:38:39.360" Title="Comparing two text files on a Windows system" Tags="|files|microsoft-windows|ediff|" AnswerCount="5" CommentCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="12865" PostTypeId="1" AcceptedAnswerId="12868" CreationDate="2015-06-03T08:47:15.657" Score="6" ViewCount="206" Body="&lt;p&gt;I would like to define a function which behaves differently depending on the last keystroke. More specifically I would like that it behaves differently if the last keystroke (&lt;strong&gt;before the execution of that function&lt;/strong&gt;) has been &lt;code&gt;&amp;lt;home&amp;gt;&lt;/code&gt;. Like below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (if (the-last-keystroke-is-home)&#xA;     (message &quot;yes&quot;)&#xA;    (message &quot;no&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-06-03T15:59:13.423" LastActivityDate="2015-06-03T15:59:13.423" Title="A function which acts differently depending on the last keystroke" Tags="|elisp|keystrokes|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12866" PostTypeId="2" ParentId="12864" CreationDate="2015-06-03T09:29:43.973" Score="0" Body="&lt;p&gt;If you don't need to produce a diff, but just want to find the differences between the files, one way to do it is to use &lt;code&gt;M-x compare-windows&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open the two files such that you see both of them at the same time, move point to the beginning in both buffers, and run &lt;code&gt;M-x compare-windows&lt;/code&gt;.  It will move point to the first place where the files differ.  This should work without any external executable.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-06-03T09:29:43.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12867" PostTypeId="1" CreationDate="2015-06-03T09:30:02.937" Score="7" ViewCount="1396" Body="&lt;p&gt;I'm searching for solution for viewing .pdf files in Emacs on both Linux and Windows platform. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is list of my requirements:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Outline (view, use to navigate)&lt;/li&gt;&#xA;&lt;li&gt;Follow links&lt;/li&gt;&#xA;&lt;li&gt;Search text&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Basically I'm searching for alternative to &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;pdf-tools&lt;/a&gt; since &lt;code&gt;pdf-tools&lt;/code&gt; does not support windows platform atm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Functionality I'm searching for can be seen in following gif&#xA;&lt;img src=&quot;https://i.stack.imgur.com/JW9J2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and in &lt;a href=&quot;http://www.dailymotion.com/video/x2bc1is_pdf-tools-tourdeforce_tech?forcedQuality%3Dhd720&quot; rel=&quot;noreferrer&quot;&gt;this video&lt;/a&gt; which show even more functionality than I desire.&lt;/p&gt;&#xA;" OwnerUserId="6527" LastEditorUserId="780" LastEditDate="2015-06-04T14:45:29.223" LastActivityDate="2016-01-05T16:09:06.150" Title="Multiplatform solution to view pdf files in Emacs" Tags="|microsoft-windows|pdf|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12868" PostTypeId="2" ParentId="12865" CreationDate="2015-06-03T09:37:11.863" Score="5" Body="&lt;p&gt;You could take advantage of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Recording-Input.html&quot;&gt;&lt;code&gt;recent-keys&lt;/code&gt;&lt;/a&gt; function. It returns a vector of the last 300 events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun get-last-key ()&#xA;  (interactive)&#xA;  (let ((vect (recent-keys)))&#xA;    (aref vect (1- (length vect)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then doing &lt;kbd&gt;C-x C-e&lt;/kbd&gt; on&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-last-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will get&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;5 (#o5, #x5, ?\C-e)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will &quot;just&quot; have to compare this to the keystroke you want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that as suggested by @stsquad, when you will call this function, your last keystroke probably won't be &lt;code&gt;&amp;lt;home&amp;gt;&lt;/code&gt; (more likely &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;). So depending on what you want to achieve, re-binding &lt;code&gt;&amp;lt;home&amp;gt;&lt;/code&gt; might be the way to go.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want a &quot;readable&quot; key, use the &lt;code&gt;single-key-description&lt;/code&gt; function. To be thorough, you should also use &lt;code&gt;prin1-to-string&lt;/code&gt;:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-last-key ()&#xA;  (interactive)&#xA;  (let* ((vect (recent-keys))&#xA;        (key (aref vect (1- (length vect)))))&#xA;        (if (or (integerp key) (symbolp key) (listp key))&#xA;            (single-key-description key)&#xA;            (prin1-to-string key nil)))&#xA;        )&#xA;&#xA;(get-last-key); C-xC-e will give the string &quot;C-e&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="437" LastEditorUserId="437" LastEditDate="2015-06-03T10:34:30.993" LastActivityDate="2015-06-03T10:34:30.993" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12869" PostTypeId="1" AcceptedAnswerId="12870" CreationDate="2015-06-03T09:59:11.393" Score="3" ViewCount="1761" Body="&lt;p&gt;I want to use python in spacemacs on window OS, and need to tell it where to find python shell. So I added one line of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default python-shell-interpreter &quot;C:\Anaconda\Scripts\ipython.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the &lt;code&gt;.spacemacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when restart the spacemacs, it won't start up as spacemacs, instead it's like normal emacs without spacemacs installed. But if I remove that line, I could get the spacemacs screen, so how should I set the variable in spacemacs init file?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/init ()&#xA;  &quot;Initialization function.&#xA;This function is called at the very startup of Spacemacs initialization&#xA;before layers configuration.&quot;   &#xA;  ;; This setq-default sexp is an exhaustive list of all the supported  &#xA;  ;; spacemacs settings.   &#xA;  dotspacemacs-default-package-repository nil)  &#xA; ;; User initialization goes here   &#xA;(setq-default python-shell-interpreter &quot;C:\Anaconda\Scripts\ipython.exe&quot;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="25" LastEditDate="2015-06-03T19:31:27.913" LastActivityDate="2015-06-03T19:31:27.913" Title="Set a variable to a Windows path in init file" Tags="|init-file|spacemacs|string|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12870" PostTypeId="2" ParentId="12869" CreationDate="2015-06-03T10:03:21.333" Score="7" Body="&lt;p&gt;In Emacs Lisp, backslashes inside strings start escape sequences.  For example, &lt;code&gt;\n&lt;/code&gt; means a newline, and &lt;code&gt;\a&lt;/code&gt; means a bell character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a string contains an unknown escape sequence, an error is signalled. &lt;code&gt;\A&lt;/code&gt; is an unknown escape sequence, and it seems like this leads to the rest of the init file not being loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either specify the path with forward slashes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default python-shell-interpreter &quot;C:/Anaconda/Scripts/ipython.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or escape the backslashes with another backslash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default python-shell-interpreter &quot;C:\\Anaconda\\Scripts\\ipython.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-06-03T10:03:21.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12871" PostTypeId="1" CreationDate="2015-06-03T13:04:41.510" Score="14" ViewCount="5032" Body="&lt;p&gt;As written in &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-2&quot; rel=&quot;noreferrer&quot; title=&quot;A Package in a league of its own: Helm&quot;&gt;A Package in a league of its own: Helm&lt;/a&gt; there's a way to &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;search for a file using &lt;code&gt;Helm&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;decide after searching whether open it in &lt;em&gt;same&lt;/em&gt; or &lt;em&gt;other window&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question is: How?&lt;/p&gt;&#xA;" OwnerUserId="6527" LastActivityDate="2017-02-16T00:44:08.970" Title="Open file in new window after searching it with helm" Tags="|helm|window|files|helm-for-files|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12872" PostTypeId="1" AcceptedAnswerId="12967" CreationDate="2015-06-03T14:05:52.770" Score="9" ViewCount="522" Body="&lt;p&gt;I have a tab-delimited data file I maintain in emacs.  Much of the data has more than seven characters per field, so at the top, I have the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- tab-width: 30 -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This keeps things nicely aligned; unfortunately it wastes a lot of space because most of the fields are not that long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to specify tab stop positions for the individual fields.  I tried setting &lt;code&gt;tab-stop-list&lt;/code&gt;, but that affects what emacs does when I press the tab key (which I never do when editing this file); I want only to change the column number to which emacs moves when &lt;em&gt;displaying&lt;/em&gt; tabs.&lt;/p&gt;&#xA;" OwnerUserId="8479" LastActivityDate="2019-06-03T00:49:52.553" Title="Is there a way to set a list of display tab stops?" Tags="|tabs|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12874" PostTypeId="2" ParentId="12858" CreationDate="2015-06-03T14:34:09.790" Score="1" Body="&lt;p&gt;This solution &lt;em&gt;appears&lt;/em&gt; to work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice handle-shift-selection&#xA;  (around leave-mark-intact activate preactivate compile)&#xA;  (cond ((and shift-select-mode this-command-keys-shift-translated)&#xA;          (unless mark-active&#xA;            (setq transient-mark-mode&#xA;              (cons 'only&#xA;                (unless (eq transient-mark-mode 'lambda)&#xA;                  transient-mark-mode)))&#xA;            (push-mark nil nil t)))&#xA;    ((eq (car-safe transient-mark-mode) 'only)&#xA;      (setq transient-mark-mode (cdr transient-mark-mode))&#xA;      (deactivate-mark))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The changes are simple. It simply does nothing if the mark is already set.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-06-03T14:34:09.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12875" PostTypeId="1" CreationDate="2015-06-03T14:44:44.847" Score="9" ViewCount="459" Body="&lt;p&gt;Given a string in elisp, I'd like to simulate emacs receiving whatever keypresses are necessary to re-create that string. So given the string &quot;Hello&quot; emacs would act exactly the same as if I had pressed Shift+H,e,l,l,o. Note that this is not always the same thing as inserting text into the buffer -- some modes like isearch-mode listen to keypress events directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this is necessary is because there are lots of modes and extensions that make the assumption that all input comes from the keyboard or make the assumption that any buffer/window/frame change will be associated with the keyboard input event, and a lot of the time they inspect data associated with that event. For the speech recognition mode that I work on to work seamlessly with the existing body of code, it can't just call directly into elisp to perform actions, instead it needs to tell elisp to press keys to cause those actions to happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found unread-command-events, but I'm not aware of any existing code that will translate strings to the necessary key sequences. Does something like that already exist?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-06-08T18:59:15.180" Title="Translating strings to keypresses" Tags="|keyboard-macros|keystrokes|events|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12876" PostTypeId="2" ParentId="12875" CreationDate="2015-06-03T14:57:28.193" Score="6" Body="&lt;p&gt;Does&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(execute-kbd-macro (kbd &quot;Hello&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;work by any chance?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-06-03T14:57:28.193" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12877" PostTypeId="2" ParentId="12865" CreationDate="2015-06-03T15:29:38.157" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (keys)&#xA;  (interactive &quot;kUse a key sequence: &quot;)&#xA;  (let ((ks  (this-single-command-keys)))&#xA;    (setq ks  (aref ks (1- (length ks))))&#xA;    (if (eq 'home ks) (message &quot;yes&quot;) (message &quot;no&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Get rid of the argument and the &lt;code&gt;interactive&lt;/code&gt; spec, if you intend to use this in a context where a key sequence has already been read and you want to test it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wrt other attempts shown here so far: Don't test key &lt;em&gt;descriptions&lt;/em&gt; (strings). Test the actual key/event values.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-03T15:29:38.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12878" PostTypeId="1" AcceptedAnswerId="12879" CreationDate="2015-06-03T15:36:47.690" Score="25" ViewCount="5558" Body="&lt;p&gt;I'm exporting (publishing) an org-mode document to PDF, and the results look great except for the hyperlinks. They look &lt;em&gt;terrible&lt;/em&gt;.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/0y05W.png&quot; alt=&quot;partial screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hyperlinks to the Web look the same, only with a pale blue outline. How can I control the style of links in the exported PDF document? (I don't know LaTeX, but can make simple configuration changes in LaTeX if necessary). &lt;/p&gt;&#xA;" OwnerUserId="321" LastActivityDate="2021-02-18T16:10:31.427" Title="How to change style of hyperlinks within PDF published from org-mode document?" Tags="|org-mode|org-export|pdf|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12879" PostTypeId="2" ParentId="12878" CreationDate="2015-06-03T16:42:30.577" Score="20" Body="&lt;p&gt;Hyperlinks in pdfs exported from org documents are generated by the LaTeX &lt;a href=&quot;https://www.tug.org/applications/hyperref/&quot; rel=&quot;noreferrer&quot;&gt;hyperref&lt;/a&gt; package. This package is included by default, and options can be set in the customize interface for &lt;code&gt;org-latex-default-packages-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example, adding the option &lt;code&gt;colorlinks=true&lt;/code&gt; to the entry for hyperref will switch from boxed links to coloured links. There are quite a few options you can set, listed in the &lt;a href=&quot;https://ftp.heanet.ie/mirrors/ctan.org/tex/macros/latex/contrib/hyperref/doc/hyperref-doc.html#x1-90003.5&quot; rel=&quot;noreferrer&quot;&gt;hyperref manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="17093" LastEditDate="2021-02-18T16:10:31.427" LastActivityDate="2021-02-18T16:10:31.427" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="12880" PostTypeId="1" AcceptedAnswerId="29583" CreationDate="2015-06-03T17:43:14.737" Score="4" ViewCount="191" Body="&lt;p&gt;I'm using the Outline minor mode. (Or the major mode or Org mode, but in these modes the scenario in this question is rare.) I want to show all of the headings that have no parent, plus the text before the very first heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In simple cases, this just means showing level 1 headings. But when a file starts with a larger-level heading, I want to show this larger-level heading, and all headings at the same level until the first heading at a smaller level, and so on. If the file starts with a non-heading line, I want to show all the text up to the first heading. For example consider the following LaTeX file meant to be included in a larger document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% This file contains stuff.&#xA;%% It starts with a comment.&#xA;\section*{Introduction}&#xA;There's stuff here, then more stuff.&#xA;\chapter{One}&#xA;Hello.&#xA;\chapter{Two}&#xA;More.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want a command that shows this and hides the rest:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% This file contains stuff.&#xA;%% It starts with a comment.&#xA;\section*{Introduction}…&#xA;\chapter{One}…&#xA;\chapter{Two}…&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is different from &lt;code&gt;hide-sublevels&lt;/code&gt; which shows headings up to a given level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to show only the minimum set of headings such that the whole document is somewhere under one of the visible headings, except for the first entry before the first heading, which remains visible. All entries (except for that top entry) and all headings that have a parent should be hidden.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'll use this to replace &lt;code&gt;hide-sublevels&lt;/code&gt; in &lt;a href=&quot;https://emacs.stackexchange.com/questions/2237/show-siblings-of-visible-headers-after-hide-other/2256#2256&quot;&gt;&lt;code&gt;outline-focus&lt;/code&gt;&lt;/a&gt;, so as to show parentless headings, plus all the headings on the path to the point, à la &lt;code&gt;hide-other&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this exist in Outline or Org, or do I need to roll my own?&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-12-26T17:06:20.697" Title="Show all parentless headings in Outline" Tags="|outline-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12881" PostTypeId="1" AcceptedAnswerId="12884" CreationDate="2015-06-03T17:50:51.217" Score="21" ViewCount="18763" Body="&lt;p&gt;I am using a Windows&amp;nbsp;7 computer and do not have administrator access. Therefore I can not place a dot emacs file in the root directory. Is there a way for me to specify a different location for the dot emacs file?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="2096" LastEditDate="2017-04-17T12:42:23.430" LastActivityDate="2024-01-30T21:49:38.580" Title="How do I set a different location for the dot emacs .emacs file on Windows 7?" Tags="|init-file|microsoft-windows|" AnswerCount="7" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12882" PostTypeId="2" ParentId="12881" CreationDate="2015-06-03T18:12:29.770" Score="5" Body="&lt;p&gt;Your .emacs file goes in your &lt;code&gt;HOME&lt;/code&gt; directory. From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html&quot; rel=&quot;noreferrer&quot;&gt;Emacs manual:&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Windows equivalent of HOME is the user-specific application data directory. The actual location depends on the Windows version...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can override this default value of HOME by explicitly setting the environment variable HOME to point to any directory on your system. HOME can be set either from the command shell prompt or from ‘Properties’ dialog of ‘My Computer’. HOME can also be set in the system registry, see MS-Windows Registry. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-06-03T18:12:29.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12883" PostTypeId="2" ParentId="12839" CreationDate="2015-06-03T20:15:22.627" Score="15" Body="&lt;p&gt;This will create a column in your clocktable report that sums the hours from columns 3 and 4, and then another column that shows you the round number of pomodoros that took up. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-clockreport-parameter-plist &#xA;      '(:link t :maxlevel 2 :formula &quot;$5=$3+$4;t::$6=ceil($5*60/25);N&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want in-between columns, here's a totally hackish approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-minutes-to-clocksum-string (m)&#xA;  &quot;Format number of minutes as a clocksum string.&#xA;Shows the number of 25-minute pomodoros.&quot;&#xA;  (format &quot;%dp&quot; (ceiling (/ m 25))))&#xA;(fset 'org-minutes-to-clocksum-string 'my/org-minutes-to-clocksum-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use :formatter, but the formatting function looks very long and annoying to change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="364" LastActivityDate="2015-06-03T20:15:22.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12884" PostTypeId="2" ParentId="12881" CreationDate="2015-06-03T20:16:53.423" Score="7" Body="&lt;p&gt;Emacs has several places it looks for init files, as documented in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt;. If you want to customize Emacs you must start with one of those files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common approach is to use the file &lt;code&gt;init.el&lt;/code&gt; in your &lt;code&gt;user-emacs-directory&lt;/code&gt;, instead of having a &lt;code&gt;.emacs&lt;/code&gt; in your HOME directory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;user-emacs-directory&lt;/code&gt; defaults to &lt;code&gt;~/.emacs.d&lt;/code&gt;, so it is still relative to your HOME, but the benefit of this approach is you can keep everything related to your Emacs configuration in one place. That directory could be under version control, backed up, shared across multiple machines, etc. You can use a symlink (&lt;code&gt;mklink&lt;/code&gt; on Windows) to keep the files in some other location. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, it is quite common to see folks maintain their Emacs configuration on Github. You can find lots of examples of this by &lt;a href=&quot;https://github.com/search?q=language%3Aelisp%20init.el&quot; rel=&quot;noreferrer&quot;&gt;searching Github for elisp projects with init.el files&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-09-10T12:11:27.957" LastActivityDate="2017-09-10T12:11:27.957" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12885" PostTypeId="2" ParentId="12881" CreationDate="2015-06-03T20:17:11.487" Score="2" Body="&lt;p&gt;You say:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;I know how to set the home directory however for version control reasons I want to be able to set emacs to read from a different directory (so that I can have a directory specific to emacs)&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your init file goes in your home directory, which you can put anywhere. Apparently you want to have a different directory for stuff that Emacs loads. That's not a problem. Put your init file in your home directory, and have that file add another directory to the value of variable &lt;code&gt;load-path&lt;/code&gt; and then require whatever other Emacs libraries you want to use. Put those libraries in that other directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, your init file need not contain anything beyond setup of the directory where you keep the Emacs libraries that you want to load.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-03T23:28:40.913" LastActivityDate="2015-06-03T23:28:40.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12886" PostTypeId="2" ParentId="12881" CreationDate="2015-06-03T22:55:27.517" Score="30" Body="&lt;p&gt;On every Windows install on which I use Emacs, I have the following code in a &lt;code&gt;.emacs&lt;/code&gt; file at the listed location:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;;; Place this file in C:\Users\Username\AppData\Roaming and point to the appropriate files&#xA;(setq user-init-file &quot;C:/path/to/.emacs&quot;)&#xA;(setq user-emacs-directory &quot;C:/path/to/.emacs.d/&quot;)&#xA;(setq default-directory &quot;C:/whatever/you/want/to/start/in&quot;)&#xA;(setenv &quot;HOME&quot; &quot;D:/my/home/directory&quot;)&#xA;(load user-init-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way I can put my &lt;code&gt;.emacs&lt;/code&gt; and &lt;code&gt;.emacs.d/&lt;/code&gt; anywhere I want.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2015-06-03T23:01:21.363" LastActivityDate="2015-06-03T23:01:21.363" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12889" PostTypeId="1" CreationDate="2015-06-04T05:48:26.530" Score="13" ViewCount="1721" Body="&lt;p&gt;I am using org-mode with fountain mode to write a screenplay. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org for organization and fountain for screenplay formatting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code I use for this purpose :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Settings for working with (fountain) source blocks in org.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; prevent org from messing with indentation of the source text.&#xA;(setq org-src-preserve-indentation t)&#xA;(setq org-edit-src-content-indentation 0)&#xA;&#xA;;; open the buffer for editing fountain in another window.&#xA;(setq org-src-window-setup (quote reorganize-frame))&#xA;&#xA;;; prevent a message in the edit buffer from being shown.&#xA;(setq org-edit-src-persistent-message nil)&#xA;&#xA;;; save edits in the fountain buffer to the org buffer after x sec&#xA;(setq org-edit-src-auto-save-idle-delay 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Act 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** SQ 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*** Scene 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bunch of text related to the scene and what the characters are doing and everything that I need to know but will never end up in the screenplay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BEGIN_SRC fountain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;screenplay text&lt;/p&gt;&#xA;&#xA;&lt;p&gt;END_SRC&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I C-c ' and it opens the above in a new buffer and I can take it up from there.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The problem with my current set up is that it doesn't let me see the screenplay text in its entirety. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have around 50+ such blocks and I'd like to achieve the following :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want org to export all fountain blocks to a specific file, say fountain-screenplay. That way I have a single file with the screenplay only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have all edits synced with the org file. If I edit anything in fountain-screenplay, the source block in org should update the change and vice-versa. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To do this, I inserted the following properties in my org file : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;:file: &quot;~/files/fountain-screenplay.fountain&quot;&#xA;:cache: yes&#xA;:comments: yes &#xA;:tangle: yes&#xA;:results: silent&#xA;:END: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I C-c C-c it returns with an error saying that No org-babel execute function found. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And when I C-c C-v t it says 0 blocks tangled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my approach incorrect or am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit : I changed the properties to : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+properties :file .fountain :cache yes and so on &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and when I C-c C-v t it tangles the source blocks to a filename.fountain. Now the sync part remains to be solved. &lt;/p&gt;&#xA;" OwnerUserId="5505" LastEditorUserId="675" LastEditDate="2015-06-04T22:04:09.750" LastActivityDate="2020-11-01T09:18:03.697" Title="Syncing changes on a tangled file back to the original org file" Tags="|org-mode|org-babel|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12890" PostTypeId="2" ParentId="12880" CreationDate="2015-06-04T05:53:18.870" Score="0" Body="&lt;p&gt;Difficulty is how to show all first entry before the first heading.&#xA;Seems outline-mode is based on regular expressions only. You could hard-code some lines before headers-match into outline-regexp. Something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;^[^\n]+\n\\\\[^ ]+&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which should include one line above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Determining a form with an unknown number of lines above would require a function. It should be possible to extend &lt;code&gt;outline-next-visible-heading&lt;/code&gt; and relatives taking an optional function-argument: when delivered, do not stop at match-beginning, run the fun.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-06-04T05:53:18.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12891" PostTypeId="2" ParentId="12863" CreationDate="2015-06-04T10:15:40.233" Score="6" Body="&lt;p&gt;Does adding &lt;code&gt;(setq-default indent-tabs-mode nil)&lt;/code&gt;change anything ?&lt;/p&gt;&#xA;" OwnerUserId="197" LastActivityDate="2015-06-04T10:15:40.233" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12892" PostTypeId="2" ParentId="2903" CreationDate="2015-06-04T11:50:36.667" Score="2" Body="&lt;p&gt;The general solution is to modify god-mode so that it takes the key translation mechanism into account. This way, it will work with any key translation you've set or will set (&lt;code&gt;C-h&lt;/code&gt; causing &lt;code&gt;DEL&lt;/code&gt; is another common one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had the same problem so I &lt;a href=&quot;https://github.com/chrisdone/god-mode/issues/75&quot; rel=&quot;nofollow&quot;&gt;filed a bug&lt;/a&gt; and &lt;a href=&quot;https://github.com/bard/god-mode/commit/4e84359e3e8e892ad341d1d40047bd12b5dee284&quot; rel=&quot;nofollow&quot;&gt;wrote a patch&lt;/a&gt; that fixes it, at least for &lt;code&gt;C-&lt;/code&gt; combinations. It changes the last sexp of &lt;code&gt;key-string-after-consuming-key&lt;/code&gt; from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if key-string-so-far&#xA;    (concat key-string-so-far &quot; &quot; next-modifier next-key)&#xA;  (concat next-modifier next-key))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((next-literal-key-string (concat next-modifier next-key))&#xA;       (translation (lookup-key key-translation-map&#xA;                                (read-kbd-macro next-literal-key-string t)))&#xA;       (next-interpreted-key-string&#xA;        (if translation&#xA;            (format-kbd-macro translation)&#xA;          next-literal-key-string)))&#xA;&#xA;  (if key-string-so-far&#xA;      (concat key-string-so-far &quot; &quot; next-interpreted-key-string)&#xA;    next-interpreted-key-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8491" LastEditorUserId="8491" LastEditDate="2015-06-05T08:45:48.920" LastActivityDate="2015-06-05T08:45:48.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12893" PostTypeId="1" CreationDate="2015-06-04T11:58:23.103" Score="6" ViewCount="836" Body="&lt;p&gt;Some years ago, I was working on a &lt;a href=&quot;http://repo.or.cz/w/arxana.git&quot; rel=&quot;nofollow noreferrer&quot;&gt;personal project&lt;/a&gt; that seemed to work best with Emacs as the user interface, and Common Lisp (SBCL) as the back-end.  The accepted answer on &lt;a href=&quot;https://emacs.stackexchange.com/questions/1017/how-to-use-slime-as-a-proxy-between-common-lisp-program-and-emacs-lisp&quot;&gt;How to use SLIME as a proxy between Common Lisp program and Emacs Lisp?&lt;/a&gt; talks about how to move code from Common Lisp to Emacs, but I needed to work in the other direction, which the macro below accomplishes.  At the time when I wrote this, &lt;a href=&quot;http://clsql.b9.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;clsql&lt;/a&gt; seemed more mature and usable than any existing Emacs database system.  I was also interested in experimenting with &lt;a href=&quot;https://common-lisp.net/project/elephant/&quot; rel=&quot;nofollow noreferrer&quot;&gt;elephant&lt;/a&gt;.  If I was to rewrite the code these days I might use &lt;a href=&quot;https://github.com/skeeto/emacsql&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacSQL&lt;/a&gt; directly within Emacs to connect to the database.  Or if I felt like being fancy I might try to bridge to Clojure rather than Common Lisp, and make use of the interesting ideas of &lt;a href=&quot;https://en.wikipedia.org/wiki/Software_transactional_memory&quot; rel=&quot;nofollow noreferrer&quot;&gt;software transactional memory&lt;/a&gt;, and then try to &lt;a href=&quot;https://stackoverflow.com/questions/4522796/how-should-i-make-a-clojure-stm-program-persistent&quot;&gt;persist&lt;/a&gt; &lt;a href=&quot;https://softwareengineering.stackexchange.com/questions/157432/clojure-state-and-persistence&quot;&gt;that&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These comments serve to underscore the point that it is potentially useful to bridge to different programming languages for different purposes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I'd like to ask is: Are other people currently doing this sort of bridging, getting Emacs to interoperate programmatically at run time with other platforms (not just over a web API, comint buffer, or &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_perl_wrapper.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;shell-command&lt;/code&gt;&lt;/a&gt;) and if so, how are you going about it?  What kind of Emacs-centric applications are you building?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I include the outline of my CL bridge for context.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro Defun (name arglist &amp;amp;rest body)&#xA;  (declare (indent defun))&#xA;  `(defun ,name ,arglist&#xA;     (let* ((outbound-string&#xA;             (translate-emacs-syntax-to-common-syntax&#xA;              (format &quot;%S&quot;&#xA;                      (append&#xA;                       (list&#xA;                        (append (list 'lambda ',arglist)&#xA;                                ',body))&#xA;                       (mapcar&#xA;                        (lambda (arg) `',arg)&#xA;                        (list&#xA;                         ,@(remove-if&#xA;                                 (lambda (testelt)&#xA;                                   (eq testelt&#xA;                                 '&amp;amp;optional))&#xA;                                 arglist)))))))&#xA;            (returned-string&#xA;             (second&#xA;              ;; we now specify the right package!&#xA;              (slime-eval&#xA;               (list 'swank:eval-and-grab-output&#xA;                     outbound-string)&#xA;               :arxana))))&#xA;       (process-slime-output returned-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With these helper functions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun translate-emacs-syntax-to-common-syntax (str)&#xA;  (with-temp-buffer&#xA;    (insert str)&#xA;    (dolist (swap '((&quot;(\\` &quot; &quot;`&quot;)&#xA;                    (&quot;(\\\, &quot; &quot;,&quot;)))&#xA;      (goto-char (point-min))&#xA;      (while (search-forward (first swap) nil t)&#xA;        (goto-char (match-beginning 0))&#xA;        (forward-sexp)&#xA;        (delete-char -1)&#xA;        (goto-char (match-beginning 0))&#xA;        (delete-region (match-beginning 0)&#xA;                       (match-end 0))&#xA;        (insert (second swap))))&#xA;    (buffer-substring-no-properties (point-min)&#xA;                                    (point-max))))&#xA;&#xA;(defun process-slime-output (str)&#xA;  (condition-case nil&#xA;      (let ((read-value (read str)))&#xA;        (if (symbolp read-value)&#xA;            (read (downcase str)))&#xA;        (nsubst nil 'NIL read-value))&#xA;    (error str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the end, what is achieved is that I can write functions like this, defined in Emacs, but whose bodies are evaluated on Common Lisp:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(Defun article (name contents &amp;amp;optional heading)&#xA;  (let ((coordinates (add-triple name&#xA;                                 &quot;has content&quot;&#xA;                                 contents)))&#xA;    (when theory (add-triple coordinates &quot;in&quot; heading))&#xA;    (when place (if (numberp place)&#xA;                    (put-in-place coordinates place)&#xA;                  (put-in-place coordinates)))&#xA;    coordinates))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-06-07T13:01:57.693" Title="writing emacs extensions in common lisp or other languages" Tags="|elisp-macros|slime|common-lisp|ffi|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="12894" PostTypeId="1" CreationDate="2015-06-04T12:43:14.960" Score="14" ViewCount="2577" Body="&lt;p&gt;How can I make &lt;code&gt;emacsclient -a '' -n&lt;/code&gt; create a new frame only if there isn't one already?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with the &lt;code&gt;-c&lt;/code&gt; flag is that it creates a new frame every time. The problem without it is that if there is no frame open it will open in the command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I can check if there is an open Emacs frame from the shell, I can call with or without &lt;code&gt;-c&lt;/code&gt; depending on that to get the behavior I want. I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -a '' --eval '(frames-on-display-list)'&#xA;(#&amp;lt;frame F1 0xba2740&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I always get the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could use temporary files or pgrep, but those approaches are very error prone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/388/how-to-prevent-emacsclient-starting-a-new-frame-every-time&quot;&gt;this question&lt;/a&gt;, but it is not a duplicate, since the OP there was satisfied with having to have a frame open before calling &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7098" LastEditorUserId="262" LastEditDate="2019-09-08T00:23:31.187" LastActivityDate="2019-09-08T00:23:31.187" Title="Make emacsclient create a frame only if there isn't one already" Tags="|frames|emacsclient|x11|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12895" PostTypeId="1" CreationDate="2015-06-04T13:05:31.593" Score="2" ViewCount="1334" Body="&lt;p&gt;I'm using &lt;code&gt;alchemist.el&lt;/code&gt; for editing Elixir code and have some difficulties to set it work properly with &lt;code&gt;company-mode&lt;/code&gt;'s completion.&#xA;When I type (e.g): &lt;code&gt;List.|&lt;/code&gt; I get &lt;code&gt;Company: An error occurred in auto-begin End of file during parsing&lt;/code&gt;.&lt;br&gt;&#xA;Alchemist's &lt;code&gt;README&lt;/code&gt; on GitHub say &lt;code&gt;Alchemist enables a company-mode elixir backend by default if company-mode is installed.&lt;/code&gt;&lt;br&gt;&#xA;I guess that company backend somehow is not properly provided or I have some conflicts in configuration.&lt;br&gt;&#xA;Does anyone have experience with this or have advice on how to debug this to see what is wrong or what is proper configuration?&lt;/p&gt;&#xA;" OwnerUserId="6551" LastEditorUserId="6551" LastEditDate="2015-06-13T08:48:25.177" LastActivityDate="2015-08-11T07:56:52.963" Title="Alchemist Elixir mode and its company-mode backend" Tags="|completion|company-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12896" PostTypeId="2" ParentId="12894" CreationDate="2015-06-04T13:53:02.320" Score="0" Body="&lt;p&gt;You can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s server_name -e '(+ 1 0)' &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to check if the Emacs server &lt;code&gt;&quot;server_name&quot;&lt;/code&gt; is already running. If the command returns exit code 0, it is running. If so, just use the &lt;code&gt;emacsclient&lt;/code&gt; command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s server_name -n file_name.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it is not running, you can open a new Emacs server with for example: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(setq server-name &quot;server_name&quot;)' --eval '(server-start)' file_name.txt &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-06-04T14:00:11.597" LastActivityDate="2015-06-04T14:00:11.597" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12897" PostTypeId="2" ParentId="12894" CreationDate="2015-06-04T15:12:00.837" Score="6" Body="&lt;p&gt;I ended up making this script based on &lt;a href=&quot;https://stackoverflow.com/a/21153375/1124271&quot;&gt;this&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash -e&#xA;&#xA;if [[ &quot;$DISPLAY&quot; ]]; then&#xA;        frame=`emacsclient -a '' -e &quot;(member \&quot;$DISPLAY\&quot; (mapcar 'terminal-name (frames-on-display-list)))&quot; 2&amp;gt;/dev/null`&#xA;        [[ &quot;$frame&quot; == &quot;nil&quot; ]] &amp;amp;&amp;amp; opts='-c' # if there is no frame open create one&#xA;        [[ &quot;${@/#-nw/}&quot; == &quot;$@&quot; ]] &amp;amp;&amp;amp; opts=&quot;$opts -n&quot; # don't wait unless we've asked to run in a terminal&#xA;else&#xA;        opts='-nw'&#xA;fi&#xA;&#xA;exec emacsclient -a '' $opts &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there is no display it opens with &lt;code&gt;-nw&lt;/code&gt;. If &lt;code&gt;$DISPLAY&lt;/code&gt; is set it looks for frames in that display to see if it needs to make a new one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I've modified it so that you can manually specify &lt;code&gt;-nw&lt;/code&gt; if you want to open in a terminal even if there is a display.&lt;/p&gt;&#xA;" OwnerUserId="7098" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-06-11T13:04:36.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12898" PostTypeId="2" ParentId="12878" CreationDate="2015-06-04T15:47:54.293" Score="4" Body="&lt;p&gt;Here's what worked for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\usepackage{xcolor}&#xA;\PassOptionsToPackage{hyperref,x11names}{xcolor}&#xA;\definecolor{electricblue}{HTML}{05ADF3}&#xA;\usepackage{tocloft}&#xA;\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}&#xA;\usepackage[breaklinks=true,linktocpage,xetex]{hyperref} &#xA;\hypersetup{colorlinks, citecolor=electricblue,filecolor=electricblue,linkcolor=electricblue,urlcolor=electricblue}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-06-04T15:47:54.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12899" PostTypeId="1" CreationDate="2015-06-04T17:06:03.633" Score="15" ViewCount="1587" Body="&lt;p&gt;I have been using Emacs with ESS and tramp to load remote files and run remote R processes on HPC computers. With ssh keys, tramp makes this easy with &lt;code&gt;C-x C-f&lt;/code&gt; to find file at &lt;code&gt;/ssh:myserver:/path/to/file&lt;/code&gt; followed by &lt;code&gt;M-x R&lt;/code&gt; to launch an R session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, on HPC computers that use a job scheduling system (e.g. Sun Grid Engine or Torque) there are restrictions on how much memory and CPU can be used on the head node, so I have to launch an interactive session using &lt;code&gt;qsub -I&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure tramp, ssh, and/or Emacs to launch an interactive session on a slave node (using &lt;code&gt;qsub -I&lt;/code&gt; or equivalent) after an ssh connection is made?&lt;/p&gt;&#xA;" OwnerUserId="6723" LastEditorUserId="6723" LastEditDate="2015-06-04T18:30:00.817" LastActivityDate="2021-06-16T13:09:17.377" Title="Can Emacs use tramp to run in an interactive session on a remote HPC node?" Tags="|tramp|ess|interactive|ssh|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12900" PostTypeId="1" AcceptedAnswerId="12926" CreationDate="2015-06-04T17:20:48.173" Score="9" ViewCount="2724" Body="&lt;p&gt;I'm using org-capture to insert expenses into a Ledger file with this template, along with auto-completion for the various expense categories:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ledger-expense-completions&#xA;    (list&#xA;     &quot;&quot; ;; needed for first | for mapconcat&#xA;     &quot;Expenses:Food&quot; &quot;Expenses:Food:Restaurants&quot; &quot;Expenses:Food:Groceries&quot;&#xA;     ))&#xA;&#xA;(setq capture-expense-template&#xA;    &quot;%%(org-read-date) * %%^{Description}&#xA;  %%^{Expense%s}  %%^{Amount}&#xA;  Account:Cash&quot;)&#xA;&#xA;(defun return-capture-expense-template () &#xA;    (let ((compstring&#xA;        (mapconcat 'identity ledger-expense-completions  &quot;|&quot; )))&#xA;            (format capture-expense-template compstring)))&#xA;&#xA;(setq org-capture-templates&#xA;    (append '((&quot;l&quot; &quot;Ledger entries&quot;)&#xA;              (&quot;lc&quot; &quot;Cash&quot; plain&#xA;              (file &quot;~/Documents/journal.ledger&quot;)&#xA;              (function return-capture-expense-template)&#xA;              :empty-lines-before 1&#xA;              :empty-lines-after 1))&#xA;            org-capture-templates))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine, however I'd like to modify &lt;code&gt;return-capture-expense-template&lt;/code&gt; to make it a bit more dynamic so that I can pass in the account, e.g., &lt;code&gt;&quot;Account:Bank&quot;&lt;/code&gt; or &lt;code&gt;&quot;Account:Cash&quot;&lt;/code&gt;, to support variations of this template without creating a separate &lt;code&gt;capture-expense-template&lt;/code&gt; for each variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's how I modified things:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ledger-expense-completions&#xA;    (list&#xA;     &quot;&quot; ;; needed for first | for mapconcat&#xA;     &quot;Expenses:Food&quot; &quot;Expenses:Food:Restaurants&quot; &quot;Expenses:Food:Groceries&quot;&#xA;     ))&#xA;&#xA;(setq capture-expense-template&#xA;    &quot;%%(org-read-date) * %%^{Description}&#xA;  %%^{Expense%s}  %%^{Amount}&#xA;  %s&quot;)&#xA;&#xA;&#xA;(defun return-capture-expense-template (account) &#xA;    (let ((compstring&#xA;        (mapconcat 'identity ledger-expense-completions  &quot;|&quot; )))&#xA;            (format capture-expense-template compstring account)))&#xA;&#xA;(setq org-capture-templates nil)&#xA;(setq org-capture-templates&#xA;    (append '((&quot;l&quot; &quot;Ledger entries&quot;)&#xA;              (&quot;lc&quot; &quot;Cash&quot; plain&#xA;              (file &quot;~/Documents/journal.ledger&quot;)&#xA;              (function return-capture-expense-template &quot;Account:Bank&quot;)&#xA;              :empty-lines-before 1&#xA;              :empty-lines-after 1))&#xA;            org-capture-templates))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try evaluating &lt;code&gt;(return-capture-expense-template &quot;Account:Bank&quot;)&lt;/code&gt; on a separate line, that gives me the template output that I would expect (with &lt;code&gt;&quot;Account:Bank&quot;&lt;/code&gt; dynamically inserted into the capture template), however when I run org-capture, I get &lt;code&gt;Wrong number of arguments&lt;/code&gt; because the &lt;code&gt;&quot;Account:Bank&quot;&lt;/code&gt; is not getting passed to &lt;code&gt;return-capture-expense-template&lt;/code&gt; on this line: &lt;code&gt;(function return-capture-expense-template &quot;Account:Bank&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reviewed &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html#index-function&quot; rel=&quot;noreferrer&quot;&gt;the docs for Anonymous Functions&lt;/a&gt; and tried writing that line in various ways, but nothing I do seems to be working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it not possible to pass a variable to a function when using the special form &lt;code&gt;function&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="8494" LastEditorUserId="105" LastEditDate="2015-06-04T17:34:15.043" LastActivityDate="2020-08-25T23:39:01.090" Title="Passing a variable to template function in org-capture-templates" Tags="|org-mode|elisp|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12901" PostTypeId="1" AcceptedAnswerId="12902" CreationDate="2015-06-04T19:31:27.983" Score="0" ViewCount="1355" Body="&lt;p&gt;I would like to write a regular expression to match two parentheses &lt;code&gt;(&lt;/code&gt; between $'s  (not necessarily consecutive).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example&lt;code&gt;$c(ad(b*$&lt;/code&gt;, &lt;code&gt;$a((*b$&lt;/code&gt; and &lt;code&gt;$$*(a(b(*$$&lt;/code&gt;  are match but &lt;code&gt;$a($&lt;/code&gt; and &lt;code&gt;$(a)$&lt;/code&gt; are not.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-06-04T20:02:21.797" Title="How to regex to match two non-necessarily consecutive parentheses between $'s" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12902" PostTypeId="2" ParentId="12901" CreationDate="2015-06-04T19:55:40.540" Score="2" Body="&lt;p&gt;A dollar sign &lt;code&gt;[$]&lt;/code&gt;, followed possibly by some chars that are neither a dollar sign nor a left paren &lt;code&gt;[^$(]*&lt;/code&gt;, followed by a left paren &lt;code&gt;[(]&lt;/code&gt;, followed (again) possibly by some chars that are neither a dollar sign nor a left paren &lt;code&gt;[^$(]*&lt;/code&gt;, followed by a dollar sign &lt;code&gt;[$]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;[$][^$(]*[(][^$(]*[(].*[$]&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-04T20:02:21.797" LastActivityDate="2015-06-04T20:02:21.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12903" PostTypeId="1" CreationDate="2015-06-04T20:43:12.040" Score="1" ViewCount="81" Body="&lt;p&gt;As already written elsewhere I have huge problems with my Emacs-Distribution after updating to Yosemite. The ESS-Version from Vincent Goulet (&lt;a href=&quot;http://vgoulet.act.ulaval.ca/en/emacs/&quot; rel=&quot;nofollow&quot;&gt;http://vgoulet.act.ulaval.ca/en/emacs/&lt;/a&gt;) worked pretty well under Mavericks - though I had to restart it sometimes when it hang during the startup - but now I cannot start Emacs at all. What should I do to have a proper running Emacs (or better yet: ESS) under Yosemite? &lt;/p&gt;&#xA;" OwnerUserId="5392" LastActivityDate="2015-07-05T06:53:05.260" Title="ESS in Yosemite" Tags="|osx|ess|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12904" PostTypeId="1" AcceptedAnswerId="12951" CreationDate="2015-06-04T20:51:06.860" Score="8" ViewCount="1912" Body="&lt;p&gt;I have noticed that opening a tramp connection on remote hosts sometimes created a .tramp_history file in the user's directory. Is there any way to disable such a behavior? I have to log in to many boxes and that's a lot of cleanup to do. No such options seem to be available in the tramp customization group. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution might certainly involve some lisp, but my skills are so far very limited... Thanks for your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: the same question was asked in 2011, see &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2011-01/msg00875.html&quot; rel=&quot;noreferrer&quot;&gt;http://lists.gnu.org/archive/html/help-gnu-emacs/2011-01/msg00875.html&lt;/a&gt;... &lt;/p&gt;&#xA;" OwnerUserId="424" LastActivityDate="2016-11-28T19:14:27.957" Title=".tramp_history files" Tags="|files|tramp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12905" PostTypeId="1" AcceptedAnswerId="12906" CreationDate="2015-06-04T21:13:24.043" Score="22" ViewCount="743" Body="&lt;p&gt;I'm bored of looking up key names for the &lt;code&gt;kbd&lt;/code&gt; function, is there a way to automatically insert the correct key name just by pressing the key?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example I want something to do this: I'm typing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I run &lt;code&gt;magical-insert-kbd-command&lt;/code&gt;, press f6 and I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key (kbd &quot;&amp;lt;f6&amp;gt;&quot;) |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="237" LastActivityDate="2015-06-29T15:26:11.203" Title="Is there a function to insert the correct `(kbd &quot;...&quot;)` by pressing the key?" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12906" PostTypeId="2" ParentId="12905" CreationDate="2015-06-04T21:33:10.007" Score="21" Body="&lt;p&gt;Not sure exactly what you are asking. But &lt;code&gt;C-h k&lt;/code&gt; followed by hitting the key shows you exactly what string you need to pass to &lt;code&gt;kbd&lt;/code&gt;. For example, &lt;code&gt;C-h k f6&lt;/code&gt; shows you &lt;code&gt;&amp;lt;f6&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a command that does what you want, I guess and binds the result to &lt;code&gt;C-c c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (key)&#xA;  (interactive &quot;kKey: &quot;)&#xA;  (insert (format &quot;(kbd %S)&quot; (key-description key))))&#xA;&#xA;(global-set-key (kbd &quot;C-c c&quot;) 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key C-c c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That prompts you to use a key.  If you hit the &lt;kbd&gt;F6&lt;/kbd&gt; key then you get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key (kbd &quot;&amp;lt;f6&amp;gt;&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[Updated per suggestion by @HaraldHancheOlsen: Changed &lt;code&gt;&quot;(kbd \&quot;%s\&quot;)&quot;&lt;/code&gt; to &lt;code&gt;&quot;.](kbd %S)&quot;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-29T15:26:11.203" LastActivityDate="2015-06-29T15:26:11.203" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12907" PostTypeId="1" AcceptedAnswerId="12915" CreationDate="2015-06-04T21:43:29.407" Score="5" ViewCount="1152" Body="&lt;p&gt;I'm using the homebrew-emacsmacport version of Emacs on OSX 10.10 Yosemite. I've created an OSX shortcut to do something in iTunes, but when I'm in Emacs, this is captured and displays &lt;code&gt;M-s-- is undefined&lt;/code&gt; (It's Command-Alt--). I understand that this is the correct behavior, but is it possible to have Emacs ignore this shortcut, so it can get to iTunes? Or is there some subset of keys that Emacs ignores generally?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/oH3x9.png&quot; alt=&quot;Screenshot of the offending behavior&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6737" LastEditorUserId="6737" LastEditDate="2015-06-05T04:42:26.150" LastActivityDate="2015-06-05T04:42:26.150" Title="Ignore certain system keyboard shortcuts" Tags="|key-bindings|osx|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12908" PostTypeId="2" ParentId="12904" CreationDate="2015-06-04T21:49:59.093" Score="1" Body="&lt;p&gt;The value of the variable &lt;code&gt;tramp-persistency-file-name&lt;/code&gt; is used by &lt;code&gt;tramp-dump-connection-properties&lt;/code&gt; and is also hard-coded into settings that load initially with &lt;code&gt;tramp-cache.el&lt;/code&gt;.  I would suggest changing the name/location to &lt;code&gt;/tmp/.tramp&lt;/code&gt; or something of that nature if you don't want to ever see it.  There is no user option to turn it off completely.  Of course, the &lt;code&gt;/tmp&lt;/code&gt; directory on some operating systems is emptied out each time the computer is started -- so bear that in mind when choosing a location.  A better idea is to set up folders for certain files that Emacs needs and store them in there.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp-cache)&#xA;(setq tramp-persistency-file-name &quot;/tmp/.tramp&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-04T22:00:54.337" LastActivityDate="2015-06-04T22:00:54.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12909" PostTypeId="1" AcceptedAnswerId="13054" CreationDate="2015-06-04T22:39:11.293" Score="5" ViewCount="365" Body="&lt;p&gt;With the &lt;a href=&quot;http://tuhdo.github.io/emacs-tutor3.html&quot; rel=&quot;nofollow&quot;&gt;guide on extending Emacs&lt;/a&gt;, I discovered the &lt;a href=&quot;http://www.emacswiki.org/emacs/VolatileHighlights&quot; rel=&quot;nofollow&quot;&gt;volatile highlights package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it only works on Emacs operations like kill and yank. I would like to use it with Evil operations like &lt;code&gt;evil-yank&lt;/code&gt; &lt;code&gt;evil-delete&lt;/code&gt;, and &lt;code&gt;evil-paste-after&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought about advising those functions with &lt;code&gt;defadvice&lt;/code&gt;, but that didn't work.  Any other suggestions for getting it working with Evil? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="786" LastEditDate="2015-06-13T05:02:28.307" LastActivityDate="2015-06-13T05:02:28.307" Title="How can I get VolatileHighlights to work with evil-yank, evil-delete, etc?" Tags="|evil|advice|highlighting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12910" PostTypeId="1" AcceptedAnswerId="12911" CreationDate="2015-06-04T22:40:19.750" Score="2" ViewCount="404" Body="&lt;p&gt;By default, when i do &lt;code&gt;M-x helm-do-grep&lt;/code&gt;, helm prompts to search from the current buffer's folder location. I would prefer it to list the git repository's base folder (where .git folder is located) as the default string in minibuffer and search recursively down all sub folders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to configure helm to automatically identify folder with &lt;code&gt;.git&lt;/code&gt; contents as base folder and use it for all search activities?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2017-01-20T20:21:47.670" Title="helm-do-grep, start search from git repository's base folder" Tags="|helm|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12911" PostTypeId="2" ParentId="12910" CreationDate="2015-06-04T23:39:08.140" Score="2" Body="&lt;p&gt;Probably not the direct nor best solution to your problem, but it does the trick:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-grep-repo ()&#xA;  (interactive)&#xA;  (helm-do-grep-1 '(&quot;/path/to/root/project&quot;)&#xA;                  '(4)&#xA;                  nil&#xA;                  '(&quot;*.py&quot; &quot;*.py&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also replace the &lt;code&gt;'(path/to/root/project)&lt;/code&gt; by the returned value of &lt;code&gt;vc-root-dir&lt;/code&gt; or &lt;code&gt;magit-get-top-dir&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-06-04T23:39:08.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12912" PostTypeId="1" CreationDate="2015-06-04T23:48:36.087" Score="3" ViewCount="60" Body="&lt;p&gt;I develop Java programs in Emacs occasionally, and adding a dependency to a dependency-injected class is a common action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, imagine adding the dependency &lt;code&gt;Qux&lt;/code&gt; to the following class:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-java prettyprint-override&quot;&gt;&lt;code&gt;// import statements here&#xA;&#xA;public class Foo {&#xA;&#xA;  private final Bar bar;&#xA;  private final Baz baz;&#xA;&#xA;  public Foo(&#xA;      Bar bar,&#xA;      Baz baz) {&#xA;    this.bar = bar;&#xA;    this.baz = baz;&#xA;  }&#xA;&#xA;  // methods here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following need to happen in order to inject &lt;code&gt;Qux&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;Qux&lt;/code&gt; must be imported.&lt;/li&gt;&#xA;&lt;li&gt;The field &lt;code&gt;private final Qux qux&lt;/code&gt; must be added to the class.&lt;/li&gt;&#xA;&lt;li&gt;The parameter &lt;code&gt;Qux qux&lt;/code&gt; must be added to the constructor.&lt;/li&gt;&#xA;&lt;li&gt;The assignment &lt;code&gt;this.qux = qux&lt;/code&gt; must be added to the constructor.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After injecting &lt;code&gt;Qux&lt;/code&gt;, the class should look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-java prettyprint-override&quot;&gt;&lt;code&gt;// import statements here&#xA;&#xA;public class Foo {&#xA;&#xA;  private final Bar bar;&#xA;  private final Baz baz;&#xA;  private final Qux qux;&#xA;&#xA;  public Foo(&#xA;      Bar bar,&#xA;      Baz baz,&#xA;      Qux qux) {&#xA;    this.bar = bar;&#xA;    this.baz = baz;&#xA;    this.qux = qux;&#xA;  }&#xA;&#xA;  // methods here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;emacs-eclim&lt;/code&gt;, so the first step is already handled via automatic imports. The remainder, however, I have to do by hand, since I do not see any function in eclim that will automatically inject the dependency for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use Emacs to quicken this task? The injection is fully defined by the type &lt;code&gt;Qux&lt;/code&gt;; everything else is boilerplate, making it a juicy target for automation.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-06-04T23:48:36.087" Title="Java dependency injection" Tags="|java|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12913" PostTypeId="1" CreationDate="2015-06-05T02:07:10.520" Score="0" ViewCount="114" Body="&lt;p&gt;When using helm-projectile-find-file, if I want to find java file (end by .java). I typed java, but it could also list file of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;jav/test/a.a&#xA;jav/test1/a.a&#xA;jav/test2/a.a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to make it work only list the file name whose continuous chars form a &quot;java&quot; word? Also I tried to regular express, such as &quot;java$&quot;, but it doesn't work. Any way to support regular express? &lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="3889" LastEditDate="2015-06-27T20:14:51.603" LastActivityDate="2015-06-27T20:14:51.603" Title="question of function of helm-projectile-find-file" Tags="|helm|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12914" PostTypeId="2" ParentId="12903" CreationDate="2015-06-05T04:21:24.873" Score="1" Body="&lt;p&gt;Install Emacs via macports, and then install ESS inside &lt;code&gt;M-x list-packages&lt;/code&gt; from &lt;a href=&quot;http://melpa.org/#/ess&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5392" LastEditorUserId="97" LastEditDate="2015-06-05T05:42:48.847" LastActivityDate="2015-06-05T05:42:48.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12915" PostTypeId="2" ParentId="12907" CreationDate="2015-06-05T04:24:09.107" Score="5" Body="&lt;p&gt;With a few exceptions (e.g., hiding the OSX menu-bar with &lt;code&gt;ns-auto-hide-menu-bar&lt;/code&gt;), Emacs does not alter basic system settings generally controlled by OSX (e.g., keyboard shortcuts defined within System Preferences / Keyboard / Keyboard Shortcuts).  The original poster has implied that Emacs is receiving the keyboard input of &lt;strong&gt;Command+ALT+-&lt;/strong&gt;, which Emacs responds to by displaying a message &lt;code&gt;M-s-- is undefined&lt;/code&gt;.  If the keyboard input had been hijacked by an OSX system keyboard shortcut for controlling iTunes, then Emacs would not have registered the input -- i.e., Emacs would have done nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a situation such as this, the original poster has two general options: &lt;strong&gt;(1)&lt;/strong&gt; keep trying to define an OSX system keyboard shortcut that prevents Emacs from ever receiving the keystrokes [this is &lt;strong&gt;not&lt;/strong&gt; done within Emacs, but rather at the OSX system level]; or, &lt;strong&gt;(2)&lt;/strong&gt; write an applescript or other mechanism to control iTunes from with Emacs.  [There are at least a couple of libraries already written for Emacs to control certain iTunes functions on OSX -- available by Googling.] Here is an example for opening Safari with an applescript from within Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun safari-activate ()&#xA;(interactive)&#xA;  (let ((script (concat&#xA;         &quot;tell application \&quot;Safari\&quot;\n&quot;&#xA;         &quot;activate\n&quot;&#xA;         &quot;end tell&quot;)))&#xA;    (start-process &quot;safari-activate&quot; nil &quot;osascript&quot; &quot;-e&quot; script)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The keyboard shortcut at issue is a little tricky because &lt;strong&gt;ALT+COMMAND+-&lt;/strong&gt; on OSX is actually creating an &lt;strong&gt;EN DASH&lt;/strong&gt; (i.e., &lt;code&gt;–&lt;/code&gt;, aka character code 8211) instead of a &lt;strong&gt;HYPHEN-MINUS&lt;/strong&gt; (i.e., &lt;code&gt;-&lt;/code&gt;, aka character code 45). The following example can be used to demonstrate whether an OSX system keyboard shortcut is intercepting the Emacs keyboard shortcut:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [(meta super ?–)] (lambda () (interactive) (message &quot;Hello-world!&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;:  In the above example, we use an &lt;strong&gt;EN DASH&lt;/strong&gt; to define the keyboard shortcut -- &lt;strong&gt;not&lt;/strong&gt; a &lt;strong&gt;HYPHEN-MINUS&lt;/strong&gt;. If an OSX system keyboard shortcut to control iTunes had been in effect, then Emacs would be silent instead of generating the message &lt;strong&gt;Hello-world!&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-05T04:29:32.557" LastActivityDate="2015-06-05T04:29:32.557" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12916" PostTypeId="1" CreationDate="2015-06-05T05:46:30.540" Score="0" ViewCount="33" Body="&lt;p&gt;I an emacs newbie and I generally write a lot html code(~800 lines in one file). Now I want to a compact view to the completed tags. An example of this would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;div class=&quot;col-md-4 col-sm-6&quot;&amp;gt;&#xA;   &amp;lt;div class=&quot;text-left&quot;&amp;gt;&#xA;     &amp;lt;div id=&quot;canvas-holder&quot;&amp;gt;&#xA;        &amp;lt;canvas id=&quot;chart-area3&quot;&amp;gt;&#xA;        &amp;lt;/canvas&amp;gt;&amp;lt;br&amp;gt;&#xA;     &amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&#xA;     &amp;lt;p class=&quot;text-center&quot;&amp;gt;Bachelor of Science&amp;lt;/p&amp;gt;&#xA;   &amp;lt;/div&amp;gt;&#xA; &amp;lt;/div&amp;gt;&amp;lt;!-- End of col-md-4 col-sm-6 chart3 div --&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code appears like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[+]&amp;lt;div class=&quot;col-md-4 col-sm-6&quot;&amp;gt;...&amp;lt;/div&amp;gt;&amp;lt;!-- End of col-md-4 col-sm-6 chart3 div --&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Well not exactly same but you get the idea. How can I achieve this?&#xA;Please also give some details of the key-bindings associated as well/&lt;/p&gt;&#xA;" OwnerUserId="6864" LastActivityDate="2015-06-05T05:46:30.540" Title="How do I get a compact view html tags in emacs?" Tags="|html|" AnswerCount="0" CommentCount="2" ClosedDate="2015-06-05T07:07:01.690" ContentLicense="CC BY-SA 3.0" />
  <row Id="12917" PostTypeId="1" AcceptedAnswerId="12918" CreationDate="2015-06-05T05:47:44.393" Score="1" ViewCount="338" Body="&lt;p&gt;I encountered the error &quot;Wrong type argument: number-or-marker-p&quot; with &lt;a href=&quot;https://github.com/hadronzoo/theme-changer&quot; rel=&quot;nofollow&quot;&gt;theme-changer&lt;/a&gt; in a fresh Emacs 24.5 install on Windows 8.1 64-bit. I found no information about this error when searching, but &lt;a href=&quot;https://github.com/hadronzoo/theme-changer/issues/3&quot; rel=&quot;nofollow&quot;&gt;reading through the issue log&lt;/a&gt; I found the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The solar package seems to get my system time/timezone which was out of sync with the location I specified in my config. Changing my timezone in ubuntu resolved it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Basically the OS timezone and the Emacs calendar setup need to match. As my home is Detroit but I'm traveling in Europe, mine weren't even close. (By the way, 'solar.el' is included in Emacs by default in recent versions.)&lt;/p&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2015-11-02T07:24:04.770" Title="Wrong type argument: number-or-marker-p error with package theme-changer" Tags="|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12918" PostTypeId="2" ParentId="12917" CreationDate="2015-06-05T05:47:44.393" Score="0" Body="&lt;p&gt;I changed my config to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; calendar-location-name &quot;Amsterdam, NL&quot;&#xA; calendar-latitude 52.36&#xA; calendar-longitude 4.90&#xA; ;;  calendar-location-name &quot;Detroit, MI&quot;&#xA; ;;  calendar-latitude       42.46&#xA; ;;  calendar-longitude     -83.13&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... and theme-changer worked like a champ. I just need to remember to flip it back when I get home or find a package that will detect my location on start-up (but before I require theme-changer).&lt;/p&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2015-06-05T05:47:44.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12919" PostTypeId="1" AcceptedAnswerId="12920" CreationDate="2015-06-05T08:32:54.823" Score="6" ViewCount="1093" Body="&lt;p&gt;I have a key binding that's bounded to &lt;code&gt;helm-for-files&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &amp;quot;&amp;lt;f9&amp;gt;&amp;quot;) 'helm-for-files)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;But when I enter a directory which is a project (to being recognized with &lt;code&gt;.projectile&lt;/code&gt; file), then I would like to change the key binding to the following:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &amp;quot;&amp;lt;f9&amp;gt;&amp;quot;) 'helm-projectile)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;But when I enter another directory without any project files, then revert back to the default &lt;code&gt;helm-for-files&lt;/code&gt; key binding.&lt;/p&gt;&#xA;&lt;p&gt;I looked if there a hook for Projectile exists, but there isn't any hook available. Any other suggestions, to detect if I'm currently in a Projectile directory?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2021-12-20T00:25:26.947" LastActivityDate="2021-12-20T00:25:26.947" Title="How to detect if in a project, then configure another key binding for Projectile?" Tags="|projectile|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="12920" PostTypeId="2" ParentId="12919" CreationDate="2015-06-05T09:18:28.480" Score="8" Body="&lt;p&gt;You can do it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun contextual-f9 ()&#xA;  (if (projectile-project-p) ;; detect if current buffer is in a project&#xA;      (define-key evil-normal-state-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'helm-projectile)&#xA;    (define-key evil-normal-state-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'helm-for-files)))&#xA;&#xA;(add-hook 'find-file-hook #'contextual-f9)&#xA;(add-hook 'dired-mode-hook #'contextual-f9)&#xA;(add-hook 'window-configuration-change-hook #'contextual-f9)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;window-configuration-change-hook&lt;/code&gt;, it is possible to update the keymap if you change window configuration, since it is always the case if you use Helm to switch buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another simpler solution is that you can just use &lt;code&gt;helm-for-files&lt;/code&gt;, but add Helm Projectile sources to &lt;code&gt;helm-for-files-preferred-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'helm-for-files-preferred-list helm-source-projectile-projects)&#xA;(add-to-list 'helm-for-files-preferred-list helm-source-projectile-files-list)&#xA;(add-to-list 'helm-for-files-preferred-list helm-source-projectile-directories-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When not in a project, you will get a normal &lt;code&gt;helm-find-files&lt;/code&gt; and when in a project, you get candidates from Helm Projectile.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2015-06-05T10:33:40.900" LastActivityDate="2015-06-05T10:33:40.900" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12921" PostTypeId="2" ParentId="10641" CreationDate="2015-06-05T09:23:26.997" Score="7" Body="&lt;p&gt;Here's the relevant info from the documentation of &lt;code&gt;org-latex-packages-alist&lt;/code&gt; (you can view it by pressing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;org-latex-packages-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;org-latex-packages-alist&lt;/code&gt; is a variable defined in &lt;code&gt;org.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Its value is &lt;code&gt;((&quot;AUTO&quot; &quot;inputenc&quot; t))&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Original value was &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Alist of packages to be inserted in every LaTeX header.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;These will be inserted after &lt;code&gt;org-latex-default-packages-alist&lt;/code&gt;. Each&#xA;  element is either a cell or a string.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A cell is of the format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;options&quot; &quot;package&quot; SNIPPET-FLAG)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;SNIPPET-FLAG&lt;/code&gt;, when non-nil, indicates that this package is also needed&#xA;  when turning LaTeX snippets into images for inclusion into non-LaTeX&#xA;  output.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A string will be inserted as-is in the header of the document.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Make sure that you only list packages here which:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;you want in every file;&lt;/li&gt;&#xA;  &lt;li&gt;do not conflict with the setup in &lt;code&gt;org-format-latex-header&lt;/code&gt;;&lt;/li&gt;&#xA;  &lt;li&gt;do not conflict with the default packages in&#xA;  &lt;code&gt;org-latex-default-packages-alist&lt;/code&gt;.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;option&lt;/code&gt; place in the cell is where the &lt;code&gt;version=3&lt;/code&gt; should go in your case.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="504" LastEditDate="2015-06-06T08:30:44.147" LastActivityDate="2015-06-06T08:30:44.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12922" PostTypeId="1" CreationDate="2015-06-05T11:02:43.843" Score="0" ViewCount="193" Body="&lt;p&gt;I've noticed that since my org files have been moved to a network share agenda views take an age (1 minute or more) to produce. This is particularly annoying because I am working on a new view and I have to wait a minute every time I rebuild (I am using sticky views).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I force org-mode to just read what is in the buffer rather than communicate across the network which is, I presume, what is slowing the reports.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Limiting the view to the current buffer shows no noticeable difference. (C-c a &amp;lt; ...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the results from my attempt to use the profiler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CPU&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+ org-agenda                                                     1257  72%&#xA;+ byte-code                                                       326  18%&#xA;+ call-interactively                                              123   7%&#xA;  Automatic GC                                                     21   1%&#xA;  redisplay_internal (C function)                                   7   0%&#xA;+ org-agenda-list                                                   1   0%&#xA;+ completing-read                                                   1   0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;MEMORY&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+ call-interactively                                        4,836,708  35%&#xA;+ org-agenda                                                3,757,174  27%&#xA;+ byte-code                                                 3,091,395  22%&#xA;+ org-agenda-prepare-window                                   992,490   7%&#xA;+ org-agenda-list                                             687,427   5%&#xA;+ redisplay_internal (C function)                             121,668   0%&#xA;+ org-agenda-prepare                                           24,278   0%&#xA;+ mouse-fixup-help-message                                     13,192   0%&#xA;+ profiler-report-cpu                                           8,188   0%&#xA;+ completing-read                                               6,336   0%&#xA;+ read-from-minibuffer                                          5,248   0%&#xA;+ read-extended-command                                         4,720   0%&#xA;+ list                                                          4,208   0%&#xA;+ completing-read-default                                       1,800   0%&#xA;+ let*                                                            192   0%&#xA;+ concat                                                          192   0%&#xA;+ org-agenda-get-restriction-and-command                           96   0%&#xA;+ pos-visible-in-window-p                                          40   0%&#xA;+ read-char-exclusive                                              40   0%&#xA;+ org-fit-window-to-buffer                                         32   0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;elp-results&lt;/code&gt; of org-agenda&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function name                                                 Call Count  Elapsed Time  Average Time&#xA;org-agenda-redo                                               1           134.932       134.932&#xA;org-agenda-prepare                                            1           134.089       134.089&#xA;org-agenda-mode                                               1           133.007       133.007&#xA;org-agenda-prepare-buffers                                    1           0.814         0.814&#xA;org-agenda-files                                              3           0.589         0.1963333333&#xA;org-agenda-get-day-entries                                    40          0.259         0.006475&#xA;org-agenda-finalize                                           1           0.109         0.109&#xA;org-agenda-finalize-entries                                   1           0.079         0.079&#xA;org-agenda-highlight-todo                                     108         0.0740000000  0.0006851851&#xA;org-agenda-get-todos                                          40          0.07          0.0017500000&#xA;org-agenda-dim-blocked-tasks                                  1           0.069         0.069&#xA;org-agenda-fit-window-to-buffer                               1           0.033         0.033&#xA;org-agenda-format-item                                        108         0.008         7.40...e-005&#xA;org-agenda-new-marker                                         108         0.004         3.70...e-005&#xA;org-agenda-skip                                               111         0.003         2.70...e-005&#xA;org-agenda-align-tags                                         1           0.002         0.002&#xA;org-agenda-fix-displayed-tags                                 108         0.001         9.25...e-006&#xA;org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item  110         0.001         9.09...e-006&#xA;org-agenda-mark-header-line                                   2           0.0           0.0&#xA;org-agenda-update-agenda-type                                 2           0.0           0.0&#xA;org-agenda-prepare-window                                     1           0.0           0.0&#xA;org-agenda-span-name                                          5           0.0           0.0&#xA;org-agenda-skip-eval                                          220         0.0           0.0&#xA;org-agenda-reset-markers                                      1           0.0           0.0&#xA;org-agenda-fontify-priorities                                 1           0.0           0.0&#xA;org-agenda-get-category-icon                                  108         0.0           0.0&#xA;org-agenda-set-mode-name                                      1           0.0           0.0&#xA;org-agenda-use-sticky-p                                       1           0.0           0.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I debug this further?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I identify where the network drive is causing the delay?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I force org-mode to just read what is in the buffer rather than communicate across the network?&lt;/p&gt;&#xA;" OwnerUserId="8495" LastEditorUserId="8495" LastEditDate="2015-06-05T12:18:44.447" LastActivityDate="2015-06-05T12:18:44.447" Title="How to produce agenda views from buffers in memory" Tags="|org-mode|org-agenda|profiler|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12923" PostTypeId="1" AcceptedAnswerId="15150" CreationDate="2015-06-05T12:13:53.403" Score="8" ViewCount="898" Body="&lt;p&gt;Imagine that you change your keyboard layout. You have to spend time training your muscles to find the keys that you want to type, this is already hard enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you will also have to spend time training your muscles to find the keys that you want to enter as part of shortcuts, which is ridiculous (you have usually chosen these keys because they are easy to reach, not because of their letter*).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have these key definitions not move around when you change your keyboard layout?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if I'm in azerty, and I want to learn qwerty, I would like to have &lt;code&gt;beginning-of-line&lt;/code&gt; remapped from &lt;code&gt;C-a&lt;/code&gt; to &lt;code&gt;C-q&lt;/code&gt;, so that it stays where it is on my keyboard (first key right of &lt;code&gt;TAB&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, it is partially implemented through input methods, but it takes the opposite way: it changes the way emacs interprets input characters for text. But it won't work if you want to change your keyboard layout system-wide, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that there are lots of ways to define key bindings, but for example, I would deem acceptable a solution that would take care of all key bindings converted from human strings with the &lt;code&gt;kbd&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;*. It is not true for certain keys that are less often used. For example, the &lt;code&gt;C-c&lt;/code&gt; map of most major modes use key names that are easy to remember, rather than easy to reach. As a bonus question, it would be nice to be able to preserve (remap so that the physical key doesn't move) some keybindings and move (don't remap, the letter associated to the key doesn't change) some others. The user could select one option or the other by using two different functions instead of &lt;code&gt;kbd&lt;/code&gt; when defining his keybindings.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-06-05T13:45:29.503" LastActivityDate="2015-08-28T20:48:21.647" Title="How to preserve emacs key bindings when changing keyboard layout?" Tags="|key-bindings|keyboard-layout|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12924" PostTypeId="1" AcceptedAnswerId="28609" CreationDate="2015-06-05T13:54:40.647" Score="0" ViewCount="399" Body="&lt;p&gt;I'm using vanilla &lt;code&gt;powerline&lt;/code&gt; with &lt;code&gt;solarized&lt;/code&gt; theme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'powerline)&#xA;(powerline-center-theme) &#xA;(load-theme 'solarized-light t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I get these artefacts (the &lt;em&gt;malformed&lt;/em&gt; and sticking-slightly-above-modeline arrows), both when loading a theme after:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/ABClz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... or before &lt;code&gt;powerline&lt;/code&gt;:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/O20Jv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It happens in other themes as well, so &lt;code&gt;solarized&lt;/code&gt; likely isn't at fault. Have you encountered this issue or would guesstimate what might cause it (e.g. &lt;code&gt;(global-linum-mode 0)&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.4, OS X 10.10.3&lt;/p&gt;&#xA;" OwnerUserId="5449" LastEditorUserId="5449" LastEditDate="2015-06-05T14:33:51.867" LastActivityDate="2016-11-11T21:06:38.670" Title="Modeline artefacts around powerline arrows" Tags="|mode-line|powerline|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12925" PostTypeId="2" ParentId="12905" CreationDate="2015-06-05T14:21:54.187" Score="7" Body="&lt;p&gt;If you use &lt;code&gt;M-x local-set-key&lt;/code&gt; to do your keybinding interactively, you can use &lt;code&gt;C-x ESC ESC&lt;/code&gt; (&lt;code&gt;repeat-complex-command&lt;/code&gt;) to get a Lisp expression that you can paste into your config. It probably won't use friendly &lt;code&gt;(kbd ...)&lt;/code&gt;-style descriptions, though.&lt;/p&gt;&#xA;" OwnerUserId="364" LastActivityDate="2015-06-05T14:21:54.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12926" PostTypeId="2" ParentId="12900" CreationDate="2015-06-05T14:33:22.170" Score="16" Body="&lt;p&gt;You can specify your own properties in the property list for the template, and then you can access those properties with &lt;code&gt;plist-get&lt;/code&gt; and &lt;code&gt;org-capture-plist&lt;/code&gt;. Here's a brief example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/expense-template ()&#xA;  (format &quot;Hello world %s&quot; (plist-get org-capture-plist :account)))&#xA;(setq org-capture-templates '((&quot;x&quot; &quot;Test entry 1&quot; plain&#xA;                               (file &quot;~/tmp/test.txt&quot;)&#xA;                               (function my/expense-template)&#xA;                               :account &quot;Account:Bank&quot;)&#xA;                              (&quot;y&quot; &quot;Test entry 2&quot; plain&#xA;                               (file &quot;~/tmp/test.txt&quot;)&#xA;                               (function my/expense-template)&#xA;                               :account &quot;Account:AnotherBank&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope that helps!&lt;/p&gt;&#xA;" OwnerUserId="364" LastActivityDate="2015-06-05T14:33:22.170" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12927" PostTypeId="1" CreationDate="2015-06-05T14:43:34.263" Score="101" ViewCount="45311" Body="&lt;p&gt;&lt;strong&gt;How can we use emacs to read and write email?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is intended to provide a canonical landing point for users wanting to deal with email using emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please post only one package/solution per answer, with as much details as you can. Information that may be useful include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;requirements, supported environment&lt;/li&gt;&#xA;&lt;li&gt;supported methods (read and/or send)&lt;/li&gt;&#xA;&lt;li&gt;supported protocols (pop, imap, smtp, local mail setup...)&lt;/li&gt;&#xA;&lt;li&gt;supported authentications&lt;/li&gt;&#xA;&lt;li&gt;password storage (none, plain-text, access to an external wallet...)&lt;/li&gt;&#xA;&lt;li&gt;offline support (none, aggressive caching, on-demand...)&lt;/li&gt;&#xA;&lt;li&gt;how easy is it to use attachements? (adding with drag-and-drop, downloading, opening with emacs or another application...)&lt;/li&gt;&#xA;&lt;li&gt;setup instructions (the more detailed the better), screenshots...&lt;/li&gt;&#xA;&lt;li&gt;support for additional email features (archiving, filtering, folders)&lt;/li&gt;&#xA;&lt;li&gt;support for additional related features (contacts, rss feeds)... no need to be too detailed here, depending on how closely the feature relates to email&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Solutions requiring an external tool in order to process the mail are welcome, as long as the user does not need to interact directly with the external process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Examples: a package acting as a front-end for mutt is on-topic, &lt;a href=&quot;https://emacs.stackexchange.com/q/3629/184&quot;&gt;a solution allowing a thunderbird user to write his message using emacs&lt;/a&gt; isn't.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.meta.stackexchange.com/q/218/184&quot;&gt;Meta post&lt;/a&gt; for discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quick links to answers (alphabetically):&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/13225/184&quot;&gt;GNUS&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/21536/184&quot;&gt;Mew&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/12932/184&quot;&gt;Mu4e&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/29322/184&quot;&gt;Notmuch&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/37941/184&quot;&gt;Wanderlust&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2018-01-07T09:03:28.800" LastActivityDate="2020-12-03T16:32:12.290" Title="Reading and writing email with emacs" Tags="|email|" AnswerCount="6" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12928" PostTypeId="1" AcceptedAnswerId="13059" CreationDate="2015-06-05T14:51:29.837" Score="4" ViewCount="372" Body="&lt;p&gt;I've been trying out spacemacs for a while and it looks pretty good. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've got a problem, since I don't remember all the different commands after you press SPC, i keep having to look them up. When I do press SPC, i only get the following options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bEMgH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XrrAy.png&quot; alt=&quot;http://codingwithaxe.com/from-vim-to-emacs-with-help-of-spacemacs/&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the second picture from &lt;code&gt;http://codingwithaxe.com/from-vim-to-emacs-with-help-of-spacemacs/&lt;/code&gt; but I'm not sure how they were able to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on windows8 and haven't made any changes to any configuration files.&lt;/p&gt;&#xA;" OwnerUserId="8505" LastActivityDate="2015-06-10T08:34:22.327" Title="spacemacs SPC - expand list of hints" Tags="|spacemacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12929" PostTypeId="1" CreationDate="2015-06-05T15:17:16.057" Score="0" ViewCount="138" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsLispScreen&quot; rel=&quot;nofollow noreferrer&quot;&gt;Elscreen, a sort of screen ulitily manager&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's like tabs like you have in Chrome. I use when I have too many buffers/windows to handle it, and when I run 2 different projects next to each other. I know there are other alternatives, but for now it suits me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is ony thingy that drives these fanatical tinker crazy. I can't change the way how the tabs looks. I added a screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kpaJy.png&quot; alt=&quot;Elscreen&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, you see &lt;code&gt;[X] #&lt;/code&gt; which # stands for number. I would like to remove the &lt;code&gt;[X] #&lt;/code&gt; by default in all Elscreen tabs. When I took a dive in the &lt;a href=&quot;https://github.com/shosti/elscreen/blob/master/elscreen.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;source code of Elscreen&lt;/a&gt;, I couldn't find where he defines the numbers, so that I could disable it in my Emacs init setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ever thought Lisp was easy, but I can't really find any numbers and cross defined to disable it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any input would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-06-06T09:58:39.553" LastActivityDate="2015-06-06T09:58:39.553" Title="How remove the numbers and cross on Elscreen tab?" Tags="|elscreen|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12930" PostTypeId="1" CreationDate="2015-06-05T17:04:26.333" Score="9" ViewCount="2971" Body="&lt;p&gt;Is there a way to get a list of org-mode entries with deadlines?  Ideally with the deadlines displayed and ordered by deadline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't found anything like this. The closest thing I find is &lt;code&gt;org-check-deadlines&lt;/code&gt;, which just let's me know about things that are due in the next fortnight or are already overdue.&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="253" LastEditDate="2015-12-22T00:44:23.580" LastActivityDate="2015-12-22T00:44:23.580" Title="Display org-todo-list of entries with deadlines?" Tags="|org-mode|todo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12932" PostTypeId="2" ParentId="12927" CreationDate="2015-06-05T20:05:49.907" Score="48" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e.html&quot; rel=&quot;noreferrer&quot;&gt;Mu4e&lt;/a&gt;. It is &lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e/index.html&quot; rel=&quot;noreferrer&quot;&gt;well documented&lt;/a&gt; (also via Info), and as of this writing, &lt;a href=&quot;https://github.com/djcb/mu/graphs/contributors&quot; rel=&quot;noreferrer&quot;&gt;actively developed&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mu4e is shipped as an add-on to &lt;a href=&quot;https://github.com/djcb/mu&quot; rel=&quot;noreferrer&quot;&gt;mu&lt;/a&gt;, &lt;em&gt;&quot;a set of tools to deal with Maildirs and message files, in particular to index and search e-mail messages&quot;&lt;/em&gt;.  It works together with &lt;a href=&quot;http://offlineimap.org/&quot; rel=&quot;noreferrer&quot;&gt;offlineimap&lt;/a&gt; or &lt;a href=&quot;http://sourceforge.net/projects/fetchmail/&quot; rel=&quot;noreferrer&quot;&gt;fetchmail&lt;/a&gt;.  I also use the Emacs package &lt;a href=&quot;https://github.com/vapniks/smtpmail-multi&quot; rel=&quot;noreferrer&quot;&gt;smtpmail-multi&lt;/a&gt; so that I can send from different accounts with different settings.  For smooth integration with your email provider, you should &lt;code&gt;apt-get install ca-certificates&lt;/code&gt;.  And if you want a package-managed version, you can grab mu itself with &lt;code&gt;apt-get install maildir-utils&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Several &lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e/Example-configurations.html#Example-configurations&quot; rel=&quot;noreferrer&quot;&gt;example configurations&lt;/a&gt; are supplied, including the following &quot;minimal configuration&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'mu4e)     &#xA;(setq message-send-mail-function   'smtpmail-send-it&#xA;      smtpmail-default-smtp-server &quot;smtp.example.com&quot;&#xA;      smtpmail-smtp-server         &quot;smtp.example.com&quot;&#xA;      smtpmail-local-domain        &quot;example.com&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depinding on the set-up of your mail provider, you will need to do a bit more; and in particular, you will need to configure OfflineIMAP or Fetchmail to actually retrieve the mail.  In my configuration, shown below, I set everything up to work with two accounts.  If you just need to retrieve from one account, you may want to refer to the &lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html#Setting-up-offlineimap&quot; rel=&quot;noreferrer&quot;&gt;sample .offlineimaprc&lt;/a&gt; included in the mu4e manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for extensions and integration with other Emacs packages: Mu4e integrates conveniently with Org Mode (for capturing links to messages or custom searches, and even for authoring HTML formatted emails using Org syntax, although I don't use that feature) via the included &lt;a href=&quot;https://github.com/djcb/mu/blob/master/mu4e/org-mu4e.el&quot; rel=&quot;noreferrer&quot;&gt;org-mu4e.el&lt;/a&gt;. There is a separate &lt;a href=&quot;https://github.com/emacs-helm/helm-mu&quot; rel=&quot;noreferrer&quot;&gt;helm-mu&lt;/a&gt; integration that is usable, but needs some more work IMO. It is themed in &lt;a href=&quot;https://github.com/sellout/emacs-color-theme-solarized&quot; rel=&quot;noreferrer&quot;&gt;solarized.el&lt;/a&gt;.  There is also a &lt;a href=&quot;https://github.com/agpchil/mu4e-maildirs-extension&quot; rel=&quot;noreferrer&quot;&gt;mu4e-maildirs-extension&lt;/a&gt; that gives a convenient count of read and unread messages per mail directory, and there is some &lt;a href=&quot;https://github.com/search?utf8=%E2%9C%93&amp;amp;q=mu4e&quot; rel=&quot;noreferrer&quot;&gt;other stuff&lt;/a&gt; I haven't tried.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Together with the docs, these sample configs may help a new mu4e user get off the ground.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;&lt;code&gt;.offlineimaprc&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[general]&#xA;accounts = Gmail, Uni&#xA;maxsyncaccounts = 3&#xA;&#xA;[Account Gmail]&#xA;localrepository = Local&#xA;remoterepository = Remote&#xA;status_backend = sqlite&#xA;&#xA;[Repository Local]&#xA;type = Maildir&#xA;localfolders = ~/Maildir/google&#xA;&#xA;[Repository Remote]&#xA;type = IMAP&#xA;remotehost = imap.gmail.com&#xA;remoteuser = other.e.mail@gmail.com&#xA;remotepass = TryAndGuess12345&#xA;ssl = yes&#xA;maxconnections = 1&#xA;realdelete = no&#xA;&#xA;# cert_fingerprint = fa88366ccd90cd02f7a5655800226c43c8044ada&#xA;# but they change all the time, so...&#xA;sslcacertfile = /etc/ssl/certs/ca-certificates.crt&#xA;&#xA;# Folders to get:&#xA;#&#xA;# In Gmail, filter all current mail that isn't *otherwise*&#xA;# filtered into the folder or folders you want to receive/sync.&#xA;# Keep that up to date; it will boost efficiency if you would&#xA;# otherwise be syncing a very large &quot;Inbox&quot; here.&#xA;folderfilter = lambda foldername: foldername in [&#xA;             'JUNE2015', 'Drafts', 'Sent']&#xA;&#xA;[Account Uni]&#xA;localrepository = UniLocal&#xA;remoterepository = UniRemote&#xA;status_backend = sqlite&#xA;&#xA;[Repository UniLocal]&#xA;type = Maildir&#xA;localfolders = ~/Maildir/uni&#xA;&#xA;[Repository UniRemote]&#xA;type = IMAP&#xA;remotehost = pod666.outlook.com&#xA;remoteuser = username@campus.university.ac.uk&#xA;remotepass = TryAndGuess9876&#xA;ssl = yes&#xA;maxconnections = 1&#xA;realdelete = no&#xA;&#xA;sslcacertfile = /etc/ssl/certs/ca-certificates.crt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Config for &lt;code&gt;mu4e&lt;/code&gt; and &lt;code&gt;smtpmail-multi&lt;/code&gt;:&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; Replies&#xA;&#xA;(setq message-citation-line-function 'message-insert-formatted-citation-line) &#xA;(setq message-citation-line-format &quot;On %a, %b %d %Y, %f wrote:\n&quot;)&#xA;&#xA;;;; smtp&#xA;&#xA;(add-to-list 'load-path &quot;~/smtpmail-multi&quot;)&#xA;(require 'smtpmail-multi)&#xA;(require 'smtpmail)&#xA;&#xA;(setq smtpmail-multi-accounts&#xA;      (quote&#xA;       ((uni . (&quot;username@campus.university.ac.uk&quot;&#xA;                 &quot;pod666.outlook.com&quot;&#xA;                 587&#xA;                 &quot;e.mail@uni.ac.uk&quot;&#xA;                 nil nil nil nil))&#xA;        (gmail . (&quot;other.e.mail@gmail.com&quot;&#xA;                   &quot;smtp.gmail.com&quot;&#xA;                   587&#xA;                   &quot;other.e.mail@gmail.com&quot;&#xA;                   starttls&#xA;                   nil nil nil)))))&#xA;&#xA;(setq smtpmail-multi-associations&#xA;      (quote&#xA;       ((&quot;other.e.mail@gmail.com&quot; gmail)&#xA;        (&quot;e.mail@uni.ac.uk&quot; uni))))&#xA;&#xA;(setq smtpmail-multi-default-account (quote gmail))&#xA;&#xA;(setq message-send-mail-function 'smtpmail-multi-send-it)&#xA;&#xA;(setq smtpmail-debug-info t)&#xA;(setq smtpmail-debug-verbose t)&#xA;&#xA;;;; MU4E config&#xA;&#xA;(require 'shr)&#xA;&#xA;(defun shr-render-current-buffer ()&#xA;  (shr-render-region (point-min) (point-max)))&#xA;&#xA;(setq mu4e-compose-dont-reply-to-self t)&#xA;(setq mu4e-compose-signature-auto-include nil)&#xA;(setq mu4e-html2text-command 'shr-render-current-buffer)&#xA;&#xA;(setq mu4e-mu-binary &quot;~/mu/mu/mu&quot;)&#xA;&#xA;(setq user-full-name &quot;Hello World&quot;)&#xA;(setq user-mail-address &quot;other.e.mail@gmail.com&quot;)&#xA;&#xA;(setq mu4e-hide-index-messages t)&#xA;&#xA;(setq&#xA;   mu4e-maildir       &quot;~/Maildir&quot;   ;; top-level Maildir&#xA;   mu4e-sent-folder   &quot;/sent&quot;       ;; folder for sent messages&#xA;   mu4e-drafts-folder &quot;/drafts&quot;     ;; unfinished messages&#xA;   mu4e-trash-folder  &quot;/trash&quot;      ;; trashed messages&#xA;   mu4e-refile-folder &quot;/archive&quot;)   ;; saved messages&#xA;&#xA;(setq&#xA;   mu4e-get-mail-command &quot;offlineimap&quot;   ;;  -a Uni to just do university acc't&#xA;   mu4e-update-interval nil)             ;; 300 to update every 5 minutes&#xA;&#xA;(setq mu4e-bookmarks&#xA;  '( (&quot;flag:unread AND NOT flag:trashed&quot;                &quot;Unread messages&quot;        ?u)&#xA;     (&quot;date:today..now&quot;                                 &quot;Today's messages&quot;       ?t)&#xA;     (&quot;date:7d..now&quot;                                    &quot;Last 7 days&quot;            ?w)&#xA;     (&quot;date:1d..now AND NOT list:emacs-orgmode.gnu.org&quot; &quot;Last 1 days&quot;            ?o)&#xA;     (&quot;date:1d..now AND list:emacs-orgmode.gnu.org&quot;     &quot;Last 1 days (org mode)&quot; ?m)&#xA;     (&quot;maildir:/sent&quot;                                   &quot;sent&quot;                   ?s)&#xA;     (&quot;maildir:/uni/INBOX AND date:7d..now&quot;             &quot;University Last 7 days&quot; ?g)&#xA;     (&quot;maildir:/google/JUNE2015 AND date:7d..now&quot;       &quot;Gmail Last 7 days&quot;      ?c)&#xA;     (&quot;mime:image/*&quot;                                    &quot;Messages with images&quot;   ?p)))&#xA;&#xA;(setq mu4e-maildir-shortcuts&#xA;      '( (&quot;/google/JUNE2015&quot; . ?c)&#xA;         (&quot;/uni/INBOX&quot;       . ?g)&#xA;         (&quot;/sent&quot;            . ?s)))&#xA;&#xA;(setq mu4e-user-mail-address-list (list &quot;other.e.mail@gmail.com&quot; &quot;e.mail@uni.ac.uk&quot;))&#xA;&#xA;(setq message-kill-buffer-on-exit t)&#xA;&#xA;(setq&#xA; mu4e-view-show-images t&#xA; mu4e-view-image-max-width 800)&#xA;&#xA;;; A little demo function for switching accounts&#xA;(defun switch ()&#xA;  (interactive)&#xA;  (save-excursion (goto-char (point-min))&#xA;                  (forward-char 19)&#xA;                  (cond&#xA;                   ((looking-at &quot;other.e.mail@gmail.com&quot;)&#xA;                    (delete-region (match-beginning 0) (match-end 0))&#xA;                    (insert &quot;e.mail@uni.ac.uk&quot;)&#xA;                    (buffer-face-set 'default))&#xA;                   ((looking-at &quot;e.mail@uni.ac.uk&quot;)&#xA;                    (delete-region (match-beginning 0) (match-end 0))&#xA;                    (insert &quot;other.e.mail@gmail.com&quot;)&#xA;                    (buffer-face-set 'bold-italic))&#xA;                   (t nil))))&#xA;&#xA;(add-hook 'mu4e-compose-mode-hook (lambda () (buffer-face-set 'bold-italic)))&#xA;&#xA;;;; Saving outgoing mail&#xA;&#xA;;; Following tip from documentation for `mu4e-sent-messages-behavior' - see also&#xA;;; http://www.djcbsoftware.nl/code/mu/mu4e/Saving-outgoing-messages.html&#xA;;; for some related points, but not necessary to do things both ways.&#xA;&#xA;(setq message-sendmail-envelope-from 'header)&#xA;&#xA;(setq mu4e-sent-messages-behavior&#xA;      (lambda ()&#xA;    (if (string= (message-sendmail-envelope-from) &quot;other.e.mail@gmail.com&quot;)&#xA;        (progn (message &quot;Delete sent mail.&quot;)&#xA;           'delete)&#xA;      (progn (message &quot;Save sent mail.&quot;)&#xA;         'sent))))&#xA;&#xA;;;; Org mode compatibility&#xA;&#xA;;; Use `org-store-link' to store links, and `org-insert-link' to paste them&#xA;&#xA;(require 'org-mu4e)&#xA;&#xA;;;; That's all&#xA;&#xA;(provide 'my-mu4e-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;screenshot: browsing with search term list:emacs-orgmode.gnu.org&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qVgRY.jpg&quot; alt=&quot;browsing the org list&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="11174" LastEditDate="2016-12-15T17:45:18.333" LastActivityDate="2016-12-15T17:45:18.333" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="12933" PostTypeId="1" AcceptedAnswerId="12943" CreationDate="2015-06-05T20:28:27.320" Score="6" ViewCount="234" Body="&lt;p&gt;I am quite bad at counting and remember how many times I have invoked a special command, so I wonder is there any way to count and show in the minibuffer how many time a keyboard macro was invoked? Say that I want to use the macro to navigate the buffer in a specific way, and increment a counter as I move.&lt;/p&gt;&#xA;" OwnerUserId="8508" LastEditorUserId="105" LastEditDate="2015-06-05T20:49:20.303" LastActivityDate="2015-06-06T11:58:11.743" Title="Function to count how many times a keyboard macro is invoked?" Tags="|keyboard-macros|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12934" PostTypeId="2" ParentId="12930" CreationDate="2015-06-05T22:09:57.880" Score="10" Body="&lt;p&gt;There are several ways to do this using &lt;a href=&quot;http://orgmode.org/manual/Agenda-Views.html#Agenda-Views&quot;&gt;agenda views&lt;/a&gt;.  The simplest is to use the week agenda: &lt;code&gt;C-a a a&lt;/code&gt;.  This will display the items in &lt;code&gt;org-agenda-files&lt;/code&gt; that have timestamps within the current week, as well as deadlines due in the next 14 days (or whatever the value of &lt;code&gt;org-deadline-warning-days&lt;/code&gt; is).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use the built-in &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/advanced-searching.html&quot;&gt;searching&lt;/a&gt; tools to do this (&lt;code&gt;C-c a m&lt;/code&gt;).  Just check the &lt;code&gt;DEADLINE&lt;/code&gt; property. A search for &lt;code&gt;DEADLINE&amp;gt;=&quot;&amp;lt;today&amp;gt;&quot;&lt;/code&gt; will return entries with deadlines of today or later and &lt;code&gt;DEADLINE&amp;lt;&quot;&amp;lt;today&amp;gt;&quot;&lt;/code&gt; returns overdue deadlines.  You can save the search in a &lt;code&gt;tags&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/manual/Storing-searches.html#Storing-searches&quot;&gt;custom view&lt;/a&gt; in &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; if you plan to use it a lot.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;      '(&quot;D&quot; &quot;Deadlines&quot;&#xA;        tags &quot;DEADLINE&amp;gt;=\&quot;&amp;lt;today&amp;gt;\&quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, you can make an agenda view that shows &lt;em&gt;only&lt;/em&gt; deadlines by setting &lt;code&gt;org-agenda-entry-types&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;A&quot; &quot;Agenda; only deadlines&quot;&#xA;               agenda &quot;&quot;&#xA;               ((org-agenda-entry-types '(:deadline)))&#xA;               ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To display the deadline, the easiest way is to use &lt;a href=&quot;http://orgmode.org/manual/Column-view.html#Column-view&quot;&gt;columns&lt;/a&gt;.  There is an example in the &lt;a href=&quot;https://emacs.stackexchange.com/questions/12364/show-timestamp-for-each-todo-in-org-agenda-global-todo-list&quot;&gt;answer&lt;/a&gt; @lawlist linked to in their comment.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-06-05T22:09:57.880" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12935" PostTypeId="1" AcceptedAnswerId="13156" CreationDate="2015-06-05T22:17:21.647" Score="5" ViewCount="591" Body="&lt;p&gt;If I evaluate this form:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(open-dribble-file &quot;/home/joe/keys.log&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then type something, Emacs saves what I type to the &lt;code&gt;keys.log&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;return&amp;gt;hellow&amp;lt;backspace&amp;gt; keyloggi&amp;lt;down-mouse-5&amp;gt;&amp;lt;mouse-5&amp;gt;ng world&amp;lt;down&amp;gt;&amp;lt;down&amp;gt;&#xA;^E^X&amp;lt;C-down-mouse-4&amp;gt;&amp;lt;C-mouse-4&amp;gt;^E^X^F^N^N&amp;lt;return&amp;gt;yes&amp;lt;return&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's stop that nonsense immediately.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(open-dribble-file nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I would like is a similar function that would save each keypress together with a timestamp and some other metadata.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;State of the art&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;There is &lt;a href=&quot;https://github.com/lewang/command-log-mode&quot; rel=&quot;nofollow&quot;&gt;command-log-mode&lt;/a&gt;, which can be adjusted to log every interactive command by setting &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq clm/log-command-exceptions* '(nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It stores the time of the command on a &lt;strong&gt;:time&lt;/strong&gt; text property, and that can be given a milisecond resolution by appending &lt;code&gt;.%3N&lt;/code&gt; to the relevant &lt;code&gt;format-time-string&lt;/code&gt; command.  The only thing it doesn't do yet is actually save the &lt;em&gt;text&lt;/em&gt; that I type.  Instead, it records the first letter, and the number of letters typed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t      self-insert-command [47 times] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm guessing it will not be too hard to collect and save the entered text.  I guess I'll report back when I figure out the text storage, unless someone beats me to it.  :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I won't need the &lt;em&gt;exact&lt;/em&gt; text for basic analytics, for which what I have here is sufficient -- but it could be useful to save it for broader life-logging purposes.) &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;related&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;In the mean time, I noticed that there is a &lt;code&gt;logkeys&lt;/code&gt; package in Ubuntu.  It does something similar to what I want, but I actually only want to track Emacs keypresses, because anything else is not likely to be productive work.  Here is some &lt;code&gt;logkeys&lt;/code&gt; output as a sample:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2015-06-05 23:02:15+0100 &amp;gt; 3;&amp;lt;E-e1&amp;gt;&amp;lt;E-e1&amp;gt;3&amp;lt;#+10&amp;gt;b3;ȁ&#xA;2015-06-05 23:02:22+0100 &amp;gt; &#xA;2015-06-05 23:02:22+0100 &amp;gt; &#xA;2015-06-05 23:02:22+0100 &amp;gt; 7'''u܂ccȁ3&amp;lt;#+7&amp;gt;&amp;lt;CpsLk&amp;gt;3;q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(It is typing garbage because it doesn't know my keyboard layout, and only creates a timestamp when I press &lt;code&gt;RET&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;note&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;When I first posted this question, I thought it would make sense to approach it via Emacs C, with a patch to &lt;code&gt;record_char&lt;/code&gt; from &lt;code&gt;keyboard.c&lt;/code&gt;, which is where the dribble file is written.  But given that there's a nearly complete solution in Lisp, that was almost certainly the wrong intuition.  I've mostly revised that out but I thought I should record the initial idea, even though it wasn't that apt.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="675" LastEditDate="2015-06-15T19:29:22.663" LastActivityDate="2015-06-15T19:29:22.663" Title="log keystrokes with timestamp and other metadata?" Tags="|interactive|keystrokes|logging|emacs-c|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12936" PostTypeId="1" AcceptedAnswerId="13012" CreationDate="2015-06-06T01:26:55.777" Score="2" ViewCount="133" Body="&lt;p&gt;With magit 1.4.1, I have magit-auto-revert-mode set to t. When I visit a file in a buffer, make a change and save, then call magit-status and run magit-discard-item on the modified file, then switch back to the buffer, I would expect not to see the change, ie, I'd expect the buffer to have been reverted since I discarded the change. But that's not the case. I still see the change. Is this the expected behavior or a bug?&lt;/p&gt;&#xA;" OwnerUserId="2163" LastActivityDate="2015-07-03T12:53:10.897" Title="Should magit revert a buffer after I discard a change from it when magit-auto-revert-mode is t?" Tags="|magit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12937" PostTypeId="1" AcceptedAnswerId="12939" CreationDate="2015-06-06T05:59:48.407" Score="1" ViewCount="517" Body="&lt;p&gt;How can you repeat last shell command with a single shortcut (and no y/n prompts)? How to replace this sequence:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u C-x s&lt;/kbd&gt; (or equivalent) to save all buffers&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-!&lt;/kbd&gt; for &lt;code&gt;(shell-command COMMAND &amp;amp;optional ...)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-p&lt;/kbd&gt; for &lt;code&gt;(previous-history-element N)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Basically, how can you get this working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-`&quot;) (lambda () (interactive)&#xA;              (save-some-buffers)  ;; 1.&#xA;              (shell-command nil)  ;; 2.&#xA;              (previous-history-element 1)  ;; 3.&#xA;              (&amp;lt;press RET&amp;gt;)))  ;; 4.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As is, it returns an error: &lt;code&gt;shell-command: Wrong type argument: stringp, nil&lt;/code&gt;. What should a &lt;code&gt;COMMAND&lt;/code&gt; be when calling &lt;code&gt;(shell-command COMMAND ...)&lt;/code&gt; from ELISP?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Somewhat related question:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/275842/is-there-a-repeat-last-command-in-emacs&quot;&gt;Is there a (repeat-last-command) in Emacs?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5449" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-06-06T06:35:02.933" Title="Repeat last shell command shortcut" Tags="|key-bindings|shell|shell-command|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12938" PostTypeId="1" CreationDate="2015-06-06T06:10:54.483" Score="21" ViewCount="7131" Body="&lt;p&gt;I have elisp code I'd like to run in orgmode files when they load (different for different files, and defined in the file itself). Is there a way to do this? I didn't see anything in &lt;a href=&quot;http://orgmode.org/manual/In_002dbuffer-settings.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/In_002dbuffer-settings.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I can add something to emacs initialization that runs a specially named code block whenever an orgmode file loads, that might be a solution, but I'm not sure how to do that, and ideally there is something built in.&lt;/p&gt;&#xA;" OwnerUserId="8234" LastEditorUserId="8234" LastEditDate="2015-07-22T04:41:23.557" LastActivityDate="2019-08-21T13:47:14.780" Title="How can I evaluate elisp in an orgmode file when it is opened?" Tags="|org-mode|elisp|" AnswerCount="5" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12939" PostTypeId="2" ParentId="12937" CreationDate="2015-06-06T06:35:02.933" Score="2" Body="&lt;p&gt;If you wish to do this properly in elisp, here's a stab at it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-repeat-last-shell-command ()&#xA;  (interactive)&#xA;  (save-some-buffers)&#xA;  (shell-command (cadr (assoc 'shell-command command-history))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-06-06T06:35:02.933" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12940" PostTypeId="1" AcceptedAnswerId="12970" CreationDate="2015-06-06T07:25:26.530" Score="10" ViewCount="3569" Body="&lt;p&gt;I'm using company-mode for completion in C++ code. To tell clang backend of company where the include files for the current project are I have to use the following &lt;code&gt;.dir-locals.el&lt;/code&gt; file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((c++-mode (eval setq company-clang-arguments (append &#xA;                                               company-clang-arguments&#xA;                                               '(&quot;-I/full/path/to/project/root/include&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have to specify the full path always. Is there a way to replace &lt;code&gt;full/path/to/project/root&lt;/code&gt; with a variable that stores the path the the &lt;code&gt;.dir-locals.el&lt;/code&gt; file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (c++-mode (eval setq company-clang-arguments (append&#xA;                                               company-clang-arguments&#xA;                                               (list concat &quot;-I&quot; default-directory &quot;src&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but since &lt;code&gt;default-directory&lt;/code&gt; is evaluated in the file that I'm opening it doesn't return to path the the project root but some other path inside the project.&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="536" LastEditDate="2015-06-07T18:04:46.327" LastActivityDate="2015-06-08T07:26:00.323" Title="variable project root folder in .dir-locals.el" Tags="|projectile|company-mode|directory-local-variables|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12941" PostTypeId="1" CreationDate="2015-06-06T10:26:31.860" Score="6" ViewCount="410" Body="&lt;p&gt;I'd like to be able to create GitHub issues from Emacs using a simple command, e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;create-github-issue&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;&amp;lt;comment&amp;gt;&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, the command would default to the current repo when called from a buffer visiting a file that belongs to a &lt;code&gt;git&lt;/code&gt; repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked the repos (&lt;a href=&quot;https://elpa.gnu.org/packages/&quot; rel=&quot;nofollow&quot;&gt;ELPA&lt;/a&gt;, &lt;a href=&quot;http://melpa.org/#/&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;, &lt;a href=&quot;http://marmalade.ferrier.me.uk/&quot; rel=&quot;nofollow&quot;&gt;Marmalade&lt;/a&gt;); the closest thing I could find is &lt;a href=&quot;https://github.com/sigma/gh.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gh&lt;/code&gt;&lt;/a&gt;, which is a&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GitHub API library for Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It includes &lt;a href=&quot;https://github.com/sigma/gh.el/blob/master/gh-issues.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gh-issues.el&lt;/code&gt;&lt;/a&gt; which looks like it could be used as a starting point for implementing such a feature. &lt;em&gt;But since I don't want to reinvent the wheel:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have a hand-rolled solution for this that they could share (or know of a package that I missed that implements this functionality)?&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="25" LastEditDate="2015-08-07T21:54:54.310" LastActivityDate="2015-08-07T21:54:54.310" Title="Create GitHub issue for current repository" Tags="|github|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12942" PostTypeId="1" CreationDate="2015-06-06T10:27:33.827" Score="1" ViewCount="637" Body="&lt;p&gt;I have configured yasnippet and auto-complete bindings so it won't collide, auto complete uses &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; and yasnippet uses &lt;code&gt;&amp;lt;backtab&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path&#xA;         &quot;~/.emacs.d/plugins/yasnippet&quot;)&#xA;(require 'yasnippet)&#xA;(setq yas-snippet-dirs&#xA;      '(&quot;~/.emacs.d/snippets/snippets&quot;&#xA;        &quot;~/.emacs.d/snippets/yasmate/snippets&quot; &#xA;        ))&#xA;(yas-global-mode 1)&#xA;&#xA;&#xA;;; Remove Yasnippet's default tab key binding&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;;; Set Yasnippet's key binding to shift+tab&#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;backtab&amp;gt;&quot;) 'yas-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also added yasnippet source like this to the ac-sources as recommended in &lt;a href=&quot;https://stackoverflow.com/questions/25682370/how-to-get-completion-for-yasnippets-using-auto-complete&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun add-yasnippet-ac-sources ()&#xA;  (add-to-list 'ac-sources 'ac-source-yasnippet))&#xA;(add-hook 'web-mode-hook 'add-yasnippet-ac-sources)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I created two yasnippets one with the key &lt;code&gt;lorem_dummy&lt;/code&gt; and the other with the key &lt;code&gt;lorem_image&lt;/code&gt;, one of the examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: lorem_image&#xA;# key: lorem_image&#xA;# binding: direct-keybinding&#xA;# --&#xA;&amp;lt;img src=&quot;http://lorempixel.com/${1:width}/${2:height}/${3:$$(yas-choose-value '(&quot;abstract&quot; &quot;city&quot; &quot;animals&quot; &quot;food&quot; &quot;people&quot; &quot;transport&quot; &quot;business&quot; &quot;sports&quot; &quot;technics&quot;))}/${4:text}&quot; alt=&quot;$3&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, the problem is that with this init.el AC it simply doesn't works with yasnippet. The autocomplete won't popup with the snippets.&#xA;If you want to watch exactly what its going on you can watch this video:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=aB03S39BHro&amp;amp;hd=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;video with update and comments&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7006" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-07T18:03:59.263" Title="Autocomple not working with yasnippet" Tags="|yasnippet|auto-complete-mode|web-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12943" PostTypeId="2" ParentId="12933" CreationDate="2015-06-06T11:50:00.227" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;Initialize some counter variable, say &lt;code&gt;counter&lt;/code&gt;, to 0. &lt;code&gt;(setq counter 0)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Define the macro&lt;/li&gt;&#xA;&lt;li&gt;Give the macro a name, say &quot;some-macro&quot; by &lt;code&gt;C-x C-k n&lt;/code&gt; (&lt;code&gt;kmacro-name-last-macro&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x insert-kbd-macro&lt;/code&gt;. This will dump the macro out as Lisp code.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add &lt;code&gt;(setq counter (1+ counter))&lt;/code&gt; to the Lisp code as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(fset 'some-macro&#xA;  (lambda (&amp;amp;optional arg) &quot;Keyboard macro.&quot; (interactive &quot;p&quot;) &#xA;  (setq counter (1+ counter)) (kmacro-exec-ring-item ...... arg)))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Evaluate the s-exp.&lt;/li&gt;&#xA;&lt;li&gt;Execute your macro by &lt;code&gt;M-x some-macro&lt;/code&gt;. If you find this cumbersome,&#xA;just define another keyboard to do this...&lt;/li&gt;&#xA;&lt;li&gt;To check how many times you've replayed the macro, just evaluate the variable &lt;code&gt;counter&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8380" LastEditorUserId="8380" LastEditDate="2015-06-06T11:58:11.743" LastActivityDate="2015-06-06T11:58:11.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12944" PostTypeId="2" ParentId="12941" CreationDate="2015-06-06T12:09:55.497" Score="2" Body="&lt;p&gt;I'm using syohex's &lt;a href=&quot;https://github.com/syohex/emacs-helm-open-github&quot; rel=&quot;nofollow&quot;&gt;emacs-helm-open-github&lt;/a&gt; which provides a set of commands to open issues/files/commits's URL in Github easily, it uses the gh library as well, I look down its code and change its &lt;code&gt;helm-open-github--collect-issues&lt;/code&gt; function into &lt;code&gt;create-github-issue&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun create-github-issue (title body)&#xA;  (let ((remote-url (helm-open-github--remote-url)))&#xA;    (cl-multiple-value-bind (user repo) (helm-open-github--extract-user-host remote-url)&#xA;      (gh-issues-issue-new helm-open-github-issues-api&#xA;                           user repo&#xA;                           (gh-issues-issue :title title&#xA;                                            :body body)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-open-github--extract-user-host&lt;/code&gt; is used for getting user/repo, &lt;code&gt;gh-issues-issue-new&lt;/code&gt; is used for creating new issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use it, try &lt;code&gt;(create-github-issue &quot;issue title&quot; &quot;issue content&quot;)&lt;/code&gt;, a example result: &lt;a href=&quot;https://github.com/xuchunyang/emacs.d/issues/2&quot; rel=&quot;nofollow&quot;&gt;https://github.com/xuchunyang/emacs.d/issues/2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-06-06T12:09:55.497" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12945" PostTypeId="1" AcceptedAnswerId="13018" CreationDate="2015-06-06T13:57:29.067" Score="3" ViewCount="1460" Body="&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt; I am embedding org-mode source code blocks and their results into my document and am exporting it to LaTeX. I usually wrap the output of my code into helper functions that generate formatted LaTeX code, for example equation environments or TikZ graphics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&#xA;Unfortunately I stumbled over blank lines after the results block leading to new paragraphs in the LaTeX document. Do you see a reasonin &lt;code&gt;org-mode&lt;/code&gt; for this behauvior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Related&lt;/strong&gt;&#xA;On StackOverflow there is a question regarding newline characters at the end of each python &lt;code&gt;print&lt;/code&gt; invocation but this does not resolve the issue:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;StackOverflow: &lt;a href=&quot;https://stackoverflow.com/questions/3419984/print-to-the-same-line-and-not-a-new-line-in-python&quot;&gt;Print to the same line and not a new line in python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modifying the &lt;code&gt;end&lt;/code&gt; paramter of &lt;code&gt;print&lt;/code&gt; does only insert &lt;em&gt;abc&lt;/em&gt; before the newline but is not replacing it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print('\\begin{equation}c+d\\end{equation}', end='abc'),&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Minimum working example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Blank lines after source block results on export&#xA;#+LaTeX_HEADER: \usepackage{lsthighlight}&#xA;&#xA;* Example&#xA;In this example I would like to show that exporting a paragraph with&#xA;the embedded two source blocks&#xA;#+BEGIN_SRC python :exports results :results output latex&#xA;print('\\begin{equation}a+b\\end{equation}')&#xA;#+END_SRC&#xA;and&#xA;#+BEGIN_SRC python :exports results :results output latex&#xA;print('\\begin{equation}c+d\\end{equation}')&#xA;#+END_SRC&#xA;will result in blank lines after the result listing in the exported&#xA;LaTeX document.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;LaTeX export:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{Example}&#xA;In this example I would like to show that exporting a paragraph with&#xA;the embedded two source blocks&#xA;\begin{equation}a+b\end{equation}&#xA;&#xA;and&#xA;\begin{equation}c+d\end{equation}&#xA;&#xA;will result in blank lines after the result listing in the exported&#xA;\LaTeX{} document.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/R0xbm.png&quot; alt=&quot;Exported LaTeX document&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Instead it should be exported as follows:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{Example}&#xA;In this example I would like to show that exporting a paragraph with&#xA;the embedded two source blocks&#xA;\begin{equation}a+b\end{equation}&#xA;and&#xA;\begin{equation}c+d\end{equation}&#xA;will result in blank lines after the result listing in the exported&#xA;\LaTeX{} document.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0N9v8.png&quot; alt=&quot;Expected LaTeX document&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really have no idea where to look for this issue. That's why I have the hope that you can help me with this. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="6890" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-09T00:56:42.210" Title="Blank lines after org-mode code block results in LaTeX export" Tags="|org-mode|latex|org-export|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12946" PostTypeId="1" AcceptedAnswerId="12950" CreationDate="2015-06-06T15:19:55.803" Score="2" ViewCount="1399" Body="&lt;p&gt;I have &lt;code&gt;tidy&lt;/code&gt; in my setup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run HTML-mode as major mode in html file, I do &lt;code&gt;flycheck-verify-setup&lt;/code&gt; and I get&#xA;tidy as syntax checker. the executable is also found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When running web-mode as major mode, I do &lt;code&gt;flycheck-verify-setup&lt;/code&gt; and I get&#xA;handlebars as syntax checker, which is not found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I configured it then as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq flycheck-handlebars-executable &quot;c:/Dropbox/Vim/vim74/tidy.exe&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it's running, verified with &lt;code&gt;flycheck-verify-setup&lt;/code&gt;, but when I made intentionally flaws in my html file, I get no error reporting from flycheck, which is using Tidy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I assume I'm mistaken somewhere. But I have really no idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-06-07T08:15:34.690" Title="How tell web-mode to use tidy syntaxchecker in flycheck?" Tags="|flycheck|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12947" PostTypeId="1" CreationDate="2015-06-06T17:37:33.490" Score="4" ViewCount="2480" Body="&lt;p&gt;Is there a way or tool in Emacs, specifically by use of &lt;strong&gt;go-mode&lt;/strong&gt;, to automatically add the lines of code to the &lt;code&gt;import&lt;/code&gt; statement, while writing code that uses those packages? Let us assume those packages is got by &lt;code&gt;go get&lt;/code&gt; or in some other way at a time before, they are somewhere in the &lt;code&gt;src&lt;/code&gt; dir or they are just built-in go packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like, in following go program, two built-in packages are used, &lt;code&gt;os&lt;/code&gt; and &lt;code&gt;fmt&lt;/code&gt;; however only one of them are imported, &lt;code&gt;os&lt;/code&gt;. While typing the first line in the main, that uses &lt;code&gt;fmt&lt;/code&gt; package, is it possible some tool, existence is in question here, can add the package name to to &lt;code&gt;import&lt;/code&gt;s.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;package main&#xA;&#xA;import (&#xA;    &quot;os&quot;&#xA;)&#xA;&#xA;func getHome() {&#xA;    return os.Getenv(&quot;HOME&quot;)&#xA;}&#xA;&#xA;func main() {&#xA;    fmt.Println(&quot;this is my go playground.&quot;)&#xA;&#xA;    h := os.Getenv(&quot;HOME&quot;)&#xA;    g := os.Getenv(&quot;GOPATH&quot;)&#xA;    p := os.Getenv(&quot;PATH&quot;)&#xA;&#xA;    getHome()&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8514" LastEditorUserId="105" LastEditDate="2015-06-06T18:54:08.273" LastActivityDate="2022-01-20T19:54:28.043" Title="Automatically add golang package names that are used but not imported to import statement" Tags="|golang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12948" PostTypeId="2" ParentId="4177" CreationDate="2015-06-06T18:27:31.667" Score="0" Body="&lt;p&gt;In recent versions of Emacs, you can simply use the customization variable &lt;code&gt;url-user-agent&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq url-user-agent &quot;User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="42" LastActivityDate="2015-06-06T18:27:31.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12949" PostTypeId="1" AcceptedAnswerId="13022" CreationDate="2015-06-06T19:09:19.020" Score="3" ViewCount="1357" Body="&lt;p&gt;I'm trying to use a fixed width font when in &lt;code&gt;org-mode&lt;/code&gt;'s column view (I use variable width font otherwise). Customizing the &lt;code&gt;org-column&lt;/code&gt; face attribute doesn't seem to do it. How can I get this to work? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's &lt;a href=&quot;http://article.gmane.org/gmane.emacs.orgmode/27560&quot; rel=&quot;nofollow&quot; title=&quot;Tiny font in org-agenda-columns when using emacs --daemon&quot;&gt;some related discussion&lt;/a&gt; out there (referenced in &lt;a href=&quot;http://orgmode.org/worg/org-faq.html&quot; rel=&quot;nofollow&quot; title=&quot;http://orgmode.org/worg/org-faq.html&quot;&gt;Org-mode FAQs&lt;/a&gt;), but it doesn't seem to help my situation. I'm thinking this excerpt from the documentation is the key, but I'm not sure how.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Face: org-column (sample) (customize this face)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Face for column display of entry properties.&#xA;  This is actually only part of the face definition for the text in column view.&#xA;  The following faces apply, with this priority.&lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;&lt;p&gt;The color of the reference face.  This is normally the level fact that&#xA;  is used in the outline.  In agenda-mode, it will be the face of the&#xA;  first character in the line.  The color is explicitly retained to&#xA;  make sure that the column line still looks a bit like the structure&#xA;  line it is masking.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;The `org-column' face.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;The remaining properties of the reference face.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;  &#xA;  &lt;p&gt;Since column view works by putting overlays with a display property&#xA;  over individual characters in the buffer, the face of the underlining&#xA;  character (this might for example be the a TODO keyword) might still&#xA;  shine through in some properties.  So when your column view looks&#xA;  funny, with &quot;random&quot; colors, weight, strike-through, try to explicitly&#xA;  set the properties in the `org-column' face.  For example, set&#xA;  :underline to nil, or the :slant to `normal'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Under XEmacs, the rules are simpler, because the XEmacs version of&#xA;  column view defines special faces for each outline level.  See the file&#xA;  `org-colview-xemacs.el' in Org's contrib/ directory for details.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Defined in `org-faces.el'.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;           Family: Lucida Console&#xA;          Foundry: unspecified&#xA;            Width: unspecified&#xA;           Height: 120&#xA;           Weight: normal&#xA;            Slant: normal&#xA;       Foreground: unspecified&#xA;DistantForeground: unspecified&#xA;       Background: grey90&#xA;        Underline: nil&#xA;         Overline: unspecified&#xA;   Strike-through: nil&#xA;              Box: unspecified&#xA;          Inverse: unspecified&#xA;          Stipple: unspecified&#xA;             Font: unspecified&#xA;          Fontset: unspecified&#xA;          Inherit: unspecified&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If it helps, I'm running Emacs 24.5 windows version on Mac OS X.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;When I call the function that has the default keybinding &lt;code&gt;C-u C-x =&lt;/code&gt; (I don't know the function's name) with my point in the &lt;code&gt;org-column&lt;/code&gt; view region I get the following (excerpt):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is an overlay here:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;From 24 to 25&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;display              [Show]&#xA;   face                 ((:foreground unspecified) (:height 120 :family &amp;gt;&quot;Helvetica&quot;) org-agenda-column-dateline org-agenda-date-today)&#xA;   keymap               [Show]&#xA;   line-prefix          &quot;&quot;&#xA;   org-columns-format   &quot;%-70.70s | &quot;&#xA;   org-columns-key      &quot;ITEM&quot;&#xA;   org-columns-pom      nil&#xA;   org-columns-value    &quot;Saturday    6 June 2015&quot;&#xA;   org-columns-value-modified &quot;Saturday    6 June 2015&quot;&#xA;   wrap-prefix          &quot;&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Where does emacs invoke this overlay? It looks like it's calling the Helvetica font family in the &lt;code&gt;face&lt;/code&gt;--this is precisely what I'm trying to prevent. I believe this is what is overruling the Lucida Console family that I defined for the &lt;code&gt;org-column&lt;/code&gt; face (above).&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="5478" LastEditDate="2015-06-07T01:19:45.307" LastActivityDate="2015-06-09T02:12:20.717" Title="Org-column face settings not coming through in org-mode column view" Tags="|org-mode|faces|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12950" PostTypeId="2" ParentId="12946" CreationDate="2015-06-06T20:09:16.563" Score="6" Body="&lt;p&gt;Undo all that you have done in your question.  Specifically unset the executable variable of handlebars again—how did you get the idea that this could possibly work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then add the following to your init file instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'flycheck&#xA;   '(flycheck-add-mode 'html-tidy 'web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That let's you use HTML Tidy for Web Mode.  Be warned though that this doesn't work so well for any mixed content, like templates.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-06-07T08:15:34.690" LastActivityDate="2015-06-07T08:15:34.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12951" PostTypeId="2" ParentId="12904" CreationDate="2015-06-06T20:14:02.980" Score="8" Body="&lt;p&gt;In recent Tramp versions, there is the variable &lt;code&gt;tramp-histfile-override&lt;/code&gt;. You can override its default value.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastEditorUserId="2427" LastEditDate="2016-11-28T19:14:27.957" LastActivityDate="2016-11-28T19:14:27.957" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12952" PostTypeId="1" AcceptedAnswerId="12954" CreationDate="2015-06-06T21:10:17.430" Score="19" ViewCount="2435" Body="&lt;p&gt;The &lt;code&gt;exchange-point-and-mark&lt;/code&gt; command is bound to &lt;kbd&gt;C-x C-x&lt;/kbd&gt;, but I cannot think of any use cases that would make it deserving of such a prominent binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use the &lt;code&gt;exchange-point-and-mark&lt;/code&gt; to improve my editing technique?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-06-07T23:55:30.490" Title="What is the usefulness of `exchange-point-and-mark`?" Tags="|text-editing|region|point|mark|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12953" PostTypeId="2" ParentId="12952" CreationDate="2015-06-06T21:46:25.720" Score="8" Body="&lt;p&gt;I use this when I've lost a selection due to some operation that removed it, and I want to restore selection. One such scenario would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select rectangle.&lt;/li&gt;&#xA;&lt;li&gt;Kill it.&lt;/li&gt;&#xA;&lt;li&gt;Undo killing rectangle.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x C-x&lt;/kbd&gt; to restore selection to rectangle.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This happens when I want to make an ad hoc backup of a selected area and to experiment on the copy, such as, for example, I want to make some find-and-replace, but I can't think of a way to do it in a way that doesn't destroy some text which is meant to remain, so I'd later revert it from the copy.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-06-06T21:46:25.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12954" PostTypeId="2" ParentId="12952" CreationDate="2015-06-06T21:57:46.190" Score="21" Body="&lt;p&gt;There are two cases I can think of: reactivating the region, and adjusting the size of the region. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I most often use this binding to reactivate the region after performing some command that deactivates it, or doing something that sets mark and moves point without activating the region. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, do a C-s and search forward for something. Hit RET to exit the search, then C-x C-x to mark everything from where you started the search. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example that I do a lot when I want to include some sample elisp in a StackExchange answer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Mark the bit of code I want to copy.&lt;/li&gt;&#xA;&lt;li&gt;Hit C-u C-x TAB to indent the code by 4 spaces. That way it'll be rendered as code here on the site. This step deactivates the region.&lt;/li&gt;&#xA;&lt;li&gt;Hit C-x C-x to reactivate the region, then M-w to copy it to the clipboard so I can paste it in my StackExchange answer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The other case is when you are marking a region and want to extend/shrink it. In that case it is convenient to be able to jump to the &quot;other end&quot; of the region, move it, then jump back. If the region is active already then hitting C-x C-x will leave it active, allowing you to move either end.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-06-06T22:11:48.137" LastActivityDate="2015-06-06T22:11:48.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12955" PostTypeId="2" ParentId="12952" CreationDate="2015-06-06T22:07:31.100" Score="17" Body="&lt;p&gt;Ask Emacs: &lt;code&gt;C-h r i exchange-point-and-mark RET&lt;/code&gt; or, better, &lt;code&gt;C-h r i C-x C-x RET&lt;/code&gt;.  This takes you to the information shown below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Setting-Mark.html&quot;&gt;Setting Mark&lt;/a&gt; says in answer to your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-x C-x&lt;/code&gt; is useful when you are&#xA;  satisfied with the position of point but want &lt;strong&gt;to move the other end of&#xA;  the region (where the mark is)&lt;/strong&gt;.  Using &lt;code&gt;C-x C-x&lt;/code&gt; a second time, if&#xA;  necessary, puts the mark at the new position with point back at its&#xA;  original position.  Normally, if the mark is inactive, this command&#xA;  first reactivates the mark wherever it was last set, to ensure that the&#xA;  region is left highlighted.  However, if you call it with a prefix&#xA;  argument, it leaves the mark inactive and the region unhighlighted; you&#xA;  can &lt;strong&gt;use this to jump to the mark&lt;/strong&gt; in a manner similar to &lt;code&gt;C-u C-&amp;lt;SPC&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And this is what it says about it in node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Disabled-Transient-Mark.html&quot;&gt;Disabled Transient Mark&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Turning [&lt;code&gt;transient-mark-mode&lt;/code&gt;] off switches&#xA;  Emacs to an alternative mode of operation:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;Setting the mark, with commands like &lt;code&gt;C-&amp;lt;SPC&amp;gt;&lt;/code&gt; or &lt;code&gt;C-x C-x&lt;/code&gt;, does&#xA;  not highlight the region.  Therefore, you can't tell by looking&#xA;  where the mark is located; you have to remember.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The usual solution to this problem is to set the mark and then use&#xA;  it soon, before you forget where it is.  You can also &lt;strong&gt;check where&#xA;  the mark is by using &lt;code&gt;C-x C-x&lt;/code&gt;&lt;/strong&gt;, which exchanges the positions of&#xA;  the point and the mark - see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Setting-Mark.html&quot;&gt;Setting Mark&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;While Transient Mark mode is off, you can activate it temporarily&#xA;  using &lt;code&gt;C-&amp;lt;SPC&amp;gt; C-&amp;lt;SPC&amp;gt;&lt;/code&gt; or &lt;code&gt;C-u C-x C-x&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-u C-x C-x&lt;/code&gt;&#xA;      Exchange point and mark, activate the mark and enable Transient&#xA;      Mark mode temporarily, until the mark is next deactivated.  (This&#xA;      is the &lt;code&gt;C-x C-x&lt;/code&gt; command, &lt;code&gt;exchange-point-and-mark&lt;/code&gt;, with a prefix&#xA;      argument.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-07T00:41:12.750" LastActivityDate="2015-06-07T00:41:12.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12956" PostTypeId="5" CreationDate="2015-06-06T23:37:06.727" Score="0" Body="&lt;p&gt;Questions about the C code underlying an Emacs implementation.  It is closely connected with Emacs Lisp.  As mentioned &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Writing-Emacs-Primitives.html&quot; rel=&quot;nofollow&quot;&gt;in the GNU Emacs manual&lt;/a&gt;, &lt;em&gt;&quot;Lisp primitives are Lisp functions implemented in C.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2015-06-07T01:02:48.880" LastActivityDate="2015-06-07T01:02:48.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12957" PostTypeId="4" CreationDate="2015-06-06T23:37:06.727" Score="0" Body="Questions about the C code underlying an Emacs implementation." OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2015-06-07T12:38:23.410" LastActivityDate="2015-06-07T12:38:23.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12958" PostTypeId="2" ParentId="12938" CreationDate="2015-06-07T02:19:56.307" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; ... In addition to any hooks its parent mode &lt;code&gt;outline-mode&lt;/code&gt; might have run, this mode runs the hook &lt;code&gt;org-mode-hook&lt;/code&gt;, as the final step&#xA;  during initialization.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, in your init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun function-that-finds-and-evaluates-special-block ()&#xA;;; DWIM :-)&#xA;)&#xA;(add-hook 'org-mode-hook 'function-that-finds-and-evaluates-special-block)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8406" LastActivityDate="2015-06-07T02:19:56.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12959" PostTypeId="2" ParentId="12938" CreationDate="2015-06-07T02:30:34.103" Score="1" Body="&lt;p&gt;I agree with @Joe Corneli's suggestion about using a hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It occurs to me too that you could leverage bookmarks here: put a specific bookmark jump on the hook.  An advantage of a bookmark to the code block is that it typically gets relocated automatically (e.g. as the file content changes), so locating the block should typically be automatically taken care of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[But it's not clear to me why you have the code in the Org-mode files, instead of elsewhere.  We're taking that as a given, per the problem statement, but I wonder why you are doing that.  Letting us know more about the design in that respect might lead to better help.]&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-07T02:30:34.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12960" PostTypeId="1" AcceptedAnswerId="12974" CreationDate="2015-06-07T02:48:05.077" Score="1" ViewCount="162" Body="&lt;p&gt;I'm attempting to override a mode-specific key binding, but my attempt so far hasn't been able to reassign it.&lt;/p&gt;&#xA;&lt;p&gt;I use the &lt;code&gt;M-j,k,i,l&lt;/code&gt; to navigate instead of the regular &lt;code&gt;C-n&lt;/code&gt;, &lt;code&gt;C-p&lt;/code&gt; etc. I find it to be a lot faster.&lt;/p&gt;&#xA;&lt;p&gt;However, &lt;code&gt;M-j&lt;/code&gt; is bound automatically to &lt;code&gt;c-indent-new-comment-line&lt;/code&gt; when editing in any C-like language. I'd like for &lt;code&gt;M-j&lt;/code&gt; to be bound to &lt;code&gt;backward-char&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here are my attempt so far to rebind this function:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c-mode-common-hook t&#xA;          ;; rebind key&#xA;          (lambda () (global-set-key (kbd &amp;quot;M-j&amp;quot;) 'backward-char)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Does anyone know what I'm doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2804" LastEditorUserId="105" LastEditDate="2021-12-20T00:29:29.230" LastActivityDate="2021-12-20T00:29:29.230" Title="add-hook unable to reassign a mode-specific key binding" Tags="|key-bindings|init-file|major-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="12961" PostTypeId="1" AcceptedAnswerId="12975" CreationDate="2015-06-07T06:31:00.560" Score="8" ViewCount="525" Body="&lt;p&gt;The key combination &lt;code&gt;C-c&lt;/code&gt; is not convenient to type in the keyboard layout I use, and I'm trying to do change it globally. The goal is to replace every occurrence of &lt;code&gt;C-c&lt;/code&gt; with another binding &lt;code&gt;&amp;lt;apps&amp;gt; d&lt;/code&gt;, such that sending a message in Gnus would be &lt;code&gt;&amp;lt;apps&amp;gt; d &amp;lt;apps&amp;gt; d&lt;/code&gt;, compiling in auxtex would be the same, and the user prefix key &lt;code&gt;C-c&lt;/code&gt; would also always be &lt;code&gt;&amp;lt;apps&amp;gt; d&lt;/code&gt;. The key &lt;code&gt;&amp;lt;apps&amp;gt;&lt;/code&gt; is &lt;code&gt;&amp;lt;f19&amp;gt;&lt;/code&gt; on my keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the manual, it seems that I need to use &lt;code&gt;key-translation map&lt;/code&gt;. It does work great with the translation of &lt;code&gt;&amp;lt;f19&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;apps&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;&amp;lt;f19&amp;gt;&quot;) (kbd &quot;&amp;lt;apps&amp;gt;&quot;))&#xA;(global-set-key (kbd &quot;&amp;lt;apps&amp;gt; s&quot;) 'save-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, it does not work when I want to do this for &lt;code&gt;C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;&amp;lt;apps&amp;gt; d&quot;) (kbd &quot;C-c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to use it, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;apps&amp;gt; d is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and if I look it up (&lt;code&gt;C-h k&lt;/code&gt;), I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;apps&amp;gt; d (translated from &amp;lt;f19&amp;gt; d) is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make this work?&lt;/p&gt;&#xA;" OwnerUserId="491" LastEditorUserId="25" LastEditDate="2015-06-07T21:12:31.617" LastActivityDate="2015-06-07T21:12:31.617" Title="How can I globally replace C-c with another key binding?" Tags="|key-bindings|keymap|prefix-keys|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12962" PostTypeId="2" ParentId="12893" CreationDate="2015-06-07T06:55:19.067" Score="3" Body="&lt;p&gt;The examples I'm aware of use either XEmacs or SXEmacs (a fork of XEmacs) and their module/FFI support to extend them with C or existing C functions.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://lgarc.narod.ru/sxemacsen/wand-mode-en.xhtml&quot; rel=&quot;nofollow&quot;&gt;wand-mode&lt;/a&gt;: Combines FFI and the imagemagick library for simple image manipulation, such as red-eyes removal.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.nongnu.org/xwem/&quot; rel=&quot;nofollow&quot;&gt;xwem&lt;/a&gt;: Emacs as window manager. Nuff said.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I recall Steve Youngs (the SXEmacs maintainer) speaking of even crazier things, such as putting &lt;code&gt;mplayer&lt;/code&gt; or Webkit into it, but don't have anything asides from IRC logs to show as proof.  Generally I'm afraid extension of Emacs in such ways is an endeavor only a few motivated individuals (yes, even less than usual) partake in, so that's why there's so little material on it.  On the upside, it means that you could be building the next Emacs killer app!&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-06-07T07:12:05.183" LastActivityDate="2015-06-07T07:12:05.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12963" PostTypeId="1" CreationDate="2015-06-07T08:07:48.923" Score="2" ViewCount="639" Body="&lt;p&gt;I use emacs a lot and have been using Org-mode more and more. One of&#xA;the killer features for me is the &lt;code&gt;inlinetask&lt;/code&gt;. These are TODOs which can&#xA;be placed anywhere in a document without being a part of the document&#xA;structure. I think of them as virtual sticky notes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two problems that I've found that I can't solve:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;an inline task at the end of a paragraph will cause the preceding&#xA;paragraph to be merged with the proceeding paragraph when exporting&#xA;(to ASCII, for example). Is there any way to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, If I start out with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: &#xA;#+OPTIONS: inline:nil toc:nil author:nil&#xA;&#xA;Here is paragraph one. It has some&#xA;mistakes so I need to make some changes.&#xA;*************** TODO revise&#xA;*************** END&#xA;&#xA;Here is paragraph two. I want it to&#xA;remain a separate paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I would expect this when I export&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is paragraph one. It has some mistakes so I need to make some&#xA;changes.&#xA;&#xA;Here is paragraph two. I want it to remain a separate paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is paragraph one. It has some mistakes so I need to make some&#xA;changes.&#xA;Here is paragraph two. I want it to remain a separate paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This problem is even more obvious when exporting to LaTeX because the two paragraphs will flow together with no obvious space between them.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;inline tasks can't be archived. When I try to archive an inline&#xA;task, I get an error: &quot;The kill is not a (set of) tree(s)&quot;. Is there&#xA;any way to archive inline tasks? The documentation notes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also, if you want to use refiling and archiving for inline tasks,  The END line must be present to make things work properly.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;All of my inline tasks have an END line, but I still get the error.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8518" LastEditorUserId="8518" LastEditDate="2015-06-09T21:22:26.817" LastActivityDate="2016-06-04T14:53:33.063" Title="Org-mode inlinetask neither exporting nor archiving correctly" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12964" PostTypeId="2" ParentId="7148" CreationDate="2015-06-07T08:43:39.353" Score="14" Body="&lt;p&gt;It's probably worth noting that invoking &lt;code&gt;occur&lt;/code&gt; with the universal argument causes it to populate the &lt;code&gt;*Occur*&lt;/code&gt; buffer with only matches — no file names, line numbers or header information. When combined with a capture group, this allows one to extract whatever pattern is desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;C-u M-x occur&lt;/code&gt; followed by &lt;code&gt;\&quot;\(.*\)\&quot;&lt;/code&gt; will prompt the user for which capture group to collect (default &lt;code&gt;\1&lt;/code&gt;), and then place the content of every quoted string into the &lt;code&gt;*Occur*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="8519" LastActivityDate="2015-06-07T08:43:39.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12965" PostTypeId="5" CreationDate="2015-06-07T13:17:09.973" Score="0" Body="&lt;p&gt;FFI stands for &lt;em&gt;Foreign Function Interface&lt;/em&gt;.  Available in at least one Emacs fork (&lt;a href=&quot;http://www.sxemacs.org/&quot; rel=&quot;nofollow&quot;&gt;SXEmacs&lt;/a&gt;) and to GNU Emacs via a &lt;a href=&quot;https://github.com/skeeto/elisp-ffi&quot; rel=&quot;nofollow&quot;&gt;library&lt;/a&gt; by Christopher Wellens.  Wellens &lt;a href=&quot;http://nullprogram.com/blog/2014/04/26/&quot; rel=&quot;nofollow&quot;&gt;explains&lt;/a&gt; why it did not form part of GNU Emacs earlier on:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[RMS] was concerned that people might use it to make proprietary extensions to the popular editor. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As of 2010, RMS &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00240.html&quot; rel=&quot;nofollow&quot;&gt;wrote&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We gave GCC a plug-in interface last year, after developing a method&#xA;  to make it safer.  So now it is ok to do this in Emacs as well.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2015-06-07T18:59:42.933" LastActivityDate="2015-06-07T18:59:42.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12966" PostTypeId="4" CreationDate="2015-06-07T13:17:09.973" Score="0" Body="FFI stands for _Foreign Function Interface_." OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2015-06-07T18:59:31.227" LastActivityDate="2015-06-07T18:59:31.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12967" PostTypeId="2" ParentId="12872" CreationDate="2015-06-07T16:42:47.623" Score="6" Body="&lt;p&gt;Here's some proof-of-concept code that displays tabs with a variable width. It kicks in if you turn on Font lock mode in a buffer where one of the variables &lt;code&gt;variable-tabs-tab-stop-initial-list&lt;/code&gt; or &lt;code&gt;variable-tabs-tab-stop-repeat-list&lt;/code&gt; is set to a non-nil value (typically through a file-local variable). These variable contain a list of column widths; first the initial list is applied, then the repeat list in a loop. For example, if the initial list is &lt;code&gt;(4 6)&lt;/code&gt; and the repeat list is &lt;code&gt;(5 3)&lt;/code&gt; then the tab stops are at positions 4, 10, 15, 18, 23, 26, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've only tested it cursorily. Use at your own risk.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; variable-tabs.el --- display tab characters with variable width&#xA;&#xA;;; http://emacs.stackexchange.com/questions/12872/is-there-a-way-to-set-a-list-of-display-tab-stops&#xA;&#xA;;;;###autoload&#xA;(defun variable-tabs-safe-list-p (x)&#xA;  (while (and (consp x)&#xA;              (integerp (car x))&#xA;              (&amp;gt; (car x) 0))&#xA;    (setq x (cdr x)))&#xA;  (null x))&#xA;&#xA;;;;###autoload&#xA;(defvar variable-tabs-tab-stop-initial-list nil&#xA;  &quot;The initial tab stop list for variable tabs.&#xA;This is a list of positive integers, which are the successive column widths.&#xA;After the columns listed here, `variable-tabs-tab-stop-repeat-list' applies.&quot;)&#xA;;;;###autoload&#xA;(defvar variable-tabs-tab-stop-repeat-list nil&#xA;  &quot;The repeated tab stop list for variable tabs.&#xA;This is a list of positive integers, which are the successive column widths.&#xA;First the columns listed in `variable-tabs-tab-stop-initial-list' apply,&#xA;then `variable-tabs-tab-stop-repeat-list' repeats forever.&#xA;If this variable is nil, it stands for (`tab-width').&quot;)&#xA;;;;###autoload&#xA;(make-variable-buffer-local 'variable-tabs-tab-stop-initial-list)&#xA;;;;###autoload&#xA;(make-variable-buffer-local 'variable-tabs-tab-stop-repeat-list)&#xA;;;;###autoload&#xA;(put 'variable-tabs-tab-stop-initial-list 'safe-local-variable 'variable-tabs-safe-list-p)&#xA;;;;###autoload&#xA;(put 'variable-tabs-tab-stop-repeat-list 'safe-local-variable 'variable-tabs-safe-list-p)&#xA;&#xA;(defun variable-tabs-next-tab (goal)&#xA;  &quot;Return the next variable tab position after GOAL.&#xA;First the columns listed in `variable-tabs-tab-stop-initial-list' apply,&#xA;then `variable-tabs-tab-stop-repeat-list' repeats forever.&quot;&#xA;  (let ((i 0)&#xA;        (tail variable-tabs-tab-stop-initial-list))&#xA;    (while (and tail (&amp;lt;= i goal))&#xA;      (setq i (+ i (car tail))&#xA;            tail (cdr tail)))&#xA;    (cond&#xA;     ((&amp;gt; i goal) i)&#xA;     (variable-tabs-tab-stop-repeat-list&#xA;      (setq tail variable-tabs-tab-stop-repeat-list)&#xA;      (while (&amp;lt;= i goal)&#xA;        (setq i (+ i (car tail))&#xA;              tail (or (cdr tail) variable-tabs-tab-stop-repeat-list)))&#xA;      i)&#xA;     (t&#xA;      (+ i (* tab-width (1+ (/ (- goal i) tab-width))))))))&#xA;&#xA;(defun variable-tabs-compute-alignment (pos)&#xA;  (let* ((column (save-excursion&#xA;                   (goto-char pos)&#xA;                   (current-column)))&#xA;         (goal (variable-tabs-next-tab column)))&#xA;    `(face nil display (space :align-to ,goal))))&#xA;&#xA;(defun variable-tabs-font-lock ()&#xA;  (if (or variable-tabs-tab-stop-initial-list variable-tabs-tab-stop-repeat-list)&#xA;      (font-lock-add-keywords nil&#xA;                              '((&quot;\t&quot; (0 (variable-tabs-compute-alignment&#xA;                                          (match-beginning 0))&#xA;                                         t))))))&#xA;;;;###autoload&#xA;(add-hook 'font-lock-mode-hook 'variable-tabs-font-lock)&#xA;&#xA;;;; The End.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-06-07T16:42:47.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12968" PostTypeId="1" CreationDate="2015-06-07T17:52:26.697" Score="1" ViewCount="206" Body="&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8bbpd.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make faces combine correctly? I am not opposed to providing a separate set of instructions for each combination (per theme), but do not know how to do that.&lt;/p&gt;&#xA;" OwnerUserId="5185" LastActivityDate="2015-06-07T17:52:26.697" Title="How do I make faces combine correctly?" Tags="|org-mode|faces|themes|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12970" PostTypeId="2" ParentId="12940" CreationDate="2015-06-07T18:04:33.090" Score="6" Body="&lt;p&gt;I found the solution with &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;projectile&lt;/a&gt;. It has a function &lt;code&gt;projectile-project-root&lt;/code&gt; which can be used to get the project path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can noe use the following in &lt;code&gt;.dir-locals.el&lt;/code&gt; and it will still work when I move the project or use it on another machine.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((eval . (progn&#xA;                   (require 'projectile)&#xA;                   (setq company-clang-arguments (delete-dups (append&#xA;                                                  company-clang-arguments&#xA;                                                  (list (concat &quot;-I&quot; (projectile-project-root) &quot;src&quot;))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Only downside is that it you need projectile and that the project has to be a projectile project (not much of a problem since every folder with git/bzr/hg/... is a valid project).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As pointed out in the comments it is also possible to use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(locate-dominating-file default-directory &quot;.dir-locals.el&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;instead of &lt;code&gt;projectile-project-root&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="536" LastEditDate="2015-06-08T07:26:00.323" LastActivityDate="2015-06-08T07:26:00.323" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12971" PostTypeId="1" AcceptedAnswerId="12972" CreationDate="2015-06-07T18:30:11.653" Score="7" ViewCount="117" Body="&lt;p&gt;When font-lock-mode is enabled I cannot get custom faces to stick with add-text-properties or set-text-properties. I've looked through libraries like hi-lock.el, but they all seem to be regexp based. I want to highlight by points; (point) to (point-max) for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I highlight text (similar to hi-lock) by regions?&lt;/p&gt;&#xA;" OwnerUserId="8523" LastEditorUserId="105" LastEditDate="2015-06-07T18:58:06.607" LastActivityDate="2015-06-07T18:58:06.607" Title="How to highlight text based on regions--not regular expresions" Tags="|font-lock|highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12972" PostTypeId="2" ParentId="12971" CreationDate="2015-06-07T18:57:52.460" Score="3" Body="&lt;p&gt;First, you can get highlighting to &quot;stick&quot; by using property &lt;code&gt;font-lock-face&lt;/code&gt; instead of property &lt;code&gt;face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, you can do what you want (using either property) with library &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use command &lt;strong&gt;&lt;code&gt;hlt-highlight&lt;/code&gt;&lt;/strong&gt; to highlight or unhighlight&#xA;the region, or to highlight or unhighlight a regexp throughout the&#xA;region, depending on the prefix argument.  It combines the&#xA;behaviors of commands &lt;code&gt;hlt-highlight-region&lt;/code&gt;,&#xA;&lt;code&gt;hlt-unhighlight-region&lt;/code&gt;, &lt;code&gt;hlt-highlight-regexp-region&lt;/code&gt;, and&#xA;&lt;code&gt;hlt-highlight-regexp-region&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-07T18:57:52.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12973" PostTypeId="1" CreationDate="2015-06-07T19:51:15.560" Score="4" ViewCount="995" Body="&lt;p&gt;My problem is that I can create, but not overwrite existing files.  This is &lt;a href=&quot;https://github.com/matteoserva/MegaFuse/issues/11&quot; rel=&quot;nofollow&quot;&gt;probably due to a bug&lt;/a&gt; in &lt;a href=&quot;https://github.com/matteoserva/MegaFuse&quot; rel=&quot;nofollow&quot;&gt;MegaFuse&lt;/a&gt;.  Because of this, when I finish editing a file I must first save it under a different name, and then replace the original by hand.  Of course, &lt;strong&gt;this also affects emacs' auto-save and backup, because it only functions well on the first attempt&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be happy enough with a function/command that could simply do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;delete-file &amp;lt;current-buffer-name&amp;gt;&#xA;write-file &amp;lt;current-buffer-name&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(I'm still an early beginner on emacs matters, and I still don't understand lisp very well.)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw, do you know any keybinding I could use for this command?&lt;/p&gt;&#xA;" OwnerUserId="8395" LastEditorUserId="8395" LastEditDate="2016-06-07T06:48:23.813" LastActivityDate="2016-06-07T06:48:23.813" Title="Delete file (if it exists) before saving" Tags="|key-bindings|commands|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12974" PostTypeId="2" ParentId="12960" CreationDate="2015-06-07T19:53:29.883" Score="1" Body="&lt;p&gt;&lt;code&gt;global-set-key&lt;/code&gt;, as the name suggests, changes a global key binding. Local bindings, determined by the buffer's mode override global bindings. See the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Local-Keymaps.html#Local-Keymaps&quot; rel=&quot;nofollow&quot;&gt;Emacs manual&lt;/a&gt; for an introduction to multiple keymaps and the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Active-Keymaps.html#Active-Keymaps&quot; rel=&quot;nofollow&quot;&gt;Elisp manual&lt;/a&gt; for the full story. What you're doing here is each time you open a file in C mode, change the global binding for &lt;code&gt;M-j&lt;/code&gt;, which doesn't make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you want to change the binding of &lt;code&gt;M-j&lt;/code&gt; in the CC mode familiy, you need to change it in &lt;code&gt;c-mode-base-map&lt;/code&gt; (that's what &lt;code&gt;c-mode-map&lt;/code&gt; is based on). You can check that &lt;code&gt;c-mode-base-map&lt;/code&gt; is indeed where &lt;code&gt;M-j&lt;/code&gt; is bound, to &lt;code&gt;c-indent-new-comment-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To override that binding, use the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Key-Bindings.html#index-define_002dkey&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;define-key&lt;/code&gt;&lt;/a&gt; function. You need to invoke it after &lt;code&gt;c-mode-base-map&lt;/code&gt; is defined, which is done when &lt;code&gt;cc-mode&lt;/code&gt; is loaded. Use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks-for-Loading.html#Hooks-for-Loading&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;with-eval-after-load&lt;/code&gt;&lt;/a&gt; in Emacs ≥24.4, or &lt;code&gt;eval-after-load&lt;/code&gt; in older versions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-after-load-cc-mode ()&#xA;  (define-key c-mode-base-map (kbd &quot;M-j&quot;) 'backward-char))&#xA;(eval-after-load &quot;cc-mode&quot; 'my-after-load-cc-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;code&gt;M-j&lt;/code&gt; to be bound to &lt;code&gt;backward-char&lt;/code&gt; all the time, then you need to define it as a global binding, and to stop major modes from overriding it. To remove a binding from a keymap, bind the key to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;M-j&quot; 'backward-char)&#xA;(defun my-after-load-cc-mode ()&#xA;  (define-key c-mode-base-map (kbd &quot;M-j&quot;) nil))&#xA;(eval-after-load &quot;cc-mode&quot; 'my-after-load-cc-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-07-07T20:36:59.850" LastActivityDate="2015-07-07T20:36:59.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12975" PostTypeId="2" ParentId="12961" CreationDate="2015-06-07T21:12:18.477" Score="3" Body="&lt;p&gt;The problem in your attempt is that &lt;code&gt;apps&lt;/code&gt; comes from a translation via &lt;code&gt;key-translation-map&lt;/code&gt;, and this output is not searched in &lt;code&gt;key-translation-map&lt;/code&gt; recursively. If you omit &lt;code&gt;apps&lt;/code&gt; altogether and work with &lt;code&gt;f19&lt;/code&gt; directly, it works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f19&amp;gt; s&quot;) 'save-buffer)&#xA;(define-key key-translation-map (kbd &quot;&amp;lt;f19&amp;gt; d&quot;) (kbd &quot;C-c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to use the &lt;code&gt;apps&lt;/code&gt; alias, you can make use of the fact that there are two similar translation maps: &lt;code&gt;input-decode-map&lt;/code&gt; and &lt;code&gt;key-translation-map&lt;/code&gt;. Use &lt;code&gt;input-decode-map&lt;/code&gt; to declare virtual function keys corresponding to key sequences send by your keyboard, e.g. the translation from &lt;code&gt;f19&lt;/code&gt; to &lt;code&gt;apps&lt;/code&gt;. Use &lt;code&gt;key-translation-map&lt;/code&gt; to make an internal translation in Emacs, e.g. from &lt;code&gt;apps d&lt;/code&gt; to &lt;code&gt;C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map (kbd &quot;&amp;lt;f19&amp;gt;&quot;) (kbd &quot;&amp;lt;apps&amp;gt;&quot;))&#xA;(global-set-key (kbd &quot;&amp;lt;apps&amp;gt; s&quot;) 'save-buffer)&#xA;(define-key key-translation-map (kbd &quot;&amp;lt;apps&amp;gt; d&quot;) (kbd &quot;C-c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-06-07T21:12:18.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12976" PostTypeId="5" CreationDate="2015-06-07T21:15:51.427" Score="0" Body="&lt;p&gt;Use this tag for Emacs features and packages related to translating text documents, such as dictionary lookup, editing two files side-by-side, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For key translations, see &lt;a href=&quot;/questions/tagged/keymap&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;keymap&amp;#39;&quot; rel=&quot;tag&quot;&gt;keymap&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/key-bindings&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;key-bindings&amp;#39;&quot; rel=&quot;tag&quot;&gt;key-bindings&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:15:51.427" LastActivityDate="2015-06-07T21:15:51.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12977" PostTypeId="4" CreationDate="2015-06-07T21:15:51.427" Score="0" Body="Using Emacs to translate documents" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:15:51.427" LastActivityDate="2015-06-07T21:15:51.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12978" PostTypeId="5" CreationDate="2015-06-07T21:19:13.577" Score="0" Body="&lt;p&gt;Use the &lt;a href=&quot;/questions/tagged/c&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c&amp;#39;&quot; rel=&quot;tag&quot;&gt;c&lt;/a&gt; tag for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/C-Modes.html#C-Modes&quot; rel=&quot;nofollow noreferrer&quot;&gt;C and Related Modes&lt;/a&gt;, which include C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs also provides basic support of &lt;a href=&quot;/questions/tagged/c&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c&amp;#39;&quot; rel=&quot;tag&quot;&gt;c&lt;/a&gt; programming through the &lt;a href=&quot;/questions/tagged/cc-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;cc-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;cc-mode&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are separate tags for &lt;a href=&quot;/questions/tagged/c%2b%2b&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c++&amp;#39;&quot; rel=&quot;tag&quot;&gt;c++&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/c%2b%2b-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c++-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;c++-mode&lt;/a&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/C-Modes.html#C-Modes&quot; rel=&quot;nofollow noreferrer&quot;&gt;C and Related Modes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/ccmode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;CC Mode Manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastEditorUserId="7045" LastEditDate="2017-02-27T16:45:08.213" LastActivityDate="2017-02-27T16:45:08.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12979" PostTypeId="4" CreationDate="2015-06-07T21:19:13.577" Score="0" Body="is for C source code editing, completions, formatting, compiling, folding, searching, executing, syntax checking, debugging, and other modern IDE features that Emacs supports." OwnerUserId="25" LastEditorUserId="7045" LastEditDate="2017-02-27T16:43:57.543" LastActivityDate="2017-02-27T16:43:57.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12980" PostTypeId="5" CreationDate="2015-06-07T21:24:07.847" Score="0" Body="&lt;p&gt;CC Mode is an Emacs mode for editing files in C-like languages: C, C++, Objective-C, Java, CORBA IDL, Pike, AWK. It is included in GNU Emacs and in XEmacs. Use the tag &lt;a href=&quot;/questions/tagged/cc-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;cc-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;cc-mode&lt;/a&gt; for questions about CC Mode in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For questions about a specific language supported by CC Mode, see the corresponding tag: &lt;a href=&quot;/questions/tagged/c&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c&amp;#39;&quot; rel=&quot;tag&quot;&gt;c&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/c%2b%2b&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c++&amp;#39;&quot; rel=&quot;tag&quot;&gt;c++&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/objective-c&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;objective-c&amp;#39;&quot; rel=&quot;tag&quot;&gt;objective-c&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/java&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;java&amp;#39;&quot; rel=&quot;tag&quot;&gt;java&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/idl&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;idl&amp;#39;&quot; rel=&quot;tag&quot;&gt;idl&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/pike&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;pike&amp;#39;&quot; rel=&quot;tag&quot;&gt;pike&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/awk&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;awk&amp;#39;&quot; rel=&quot;tag&quot;&gt;awk&lt;/a&gt;. For questions about CC Mode's support for that language, use both the language tag and &lt;a href=&quot;/questions/tagged/cc-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;cc-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;cc-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful links&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html&quot; rel=&quot;nofollow&quot;&gt;CC Mode documentation&lt;/a&gt; (latest version of GNU Emacs)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cc-mode.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;CC Mode upstream site&lt;/a&gt; (where development happens)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:24:07.847" LastActivityDate="2015-06-07T21:24:07.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12981" PostTypeId="4" CreationDate="2015-06-07T21:24:07.847" Score="0" Body="Major mode for C, C++, Objective-C, Java, CORBA IDL, Pike, AWK. Included in GNU Emacs and XEmacs." OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:24:07.847" LastActivityDate="2015-06-07T21:24:07.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12982" PostTypeId="5" CreationDate="2015-06-07T21:40:02.973" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/TeX&quot; rel=&quot;nofollow&quot;&gt;TeX&lt;/a&gt; document typesetting system. It is often used to typeset scientific or technical books and articles, usually with the &lt;a href=&quot;http://en.wikipedia.org/wiki/LaTeX&quot; rel=&quot;nofollow&quot;&gt;LaTeX&lt;/a&gt; &lt;a href=&quot;/questions/tagged/latex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;latex&amp;#39;&quot; rel=&quot;tag&quot;&gt;latex&lt;/a&gt; macro package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use this tag for general questions about working with TeX documents in Emacs. There are two modes for working with TeX documents:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The basic &lt;code&gt;tex-mode&lt;/code&gt; package included in GNU Emacs. Use the tag &lt;a href=&quot;/questions/tagged/tex-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;tex-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;tex-mode&lt;/a&gt; for questions about this mode.&lt;/li&gt;&#xA;&lt;li&gt;The more elaborate &lt;a href=&quot;http://en.wikipedia.org/wiki/AUCTeX&quot; rel=&quot;nofollow&quot;&gt;AUCTeX&lt;/a&gt; third-party package (included in XEmacs). AUCTeX provides more advanced features including syntax highlighting and completion of macros in third-party packages, better support for complex compilations, preview of mathematics, etc. Use the tag &lt;a href=&quot;/questions/tagged/auctex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;auctex&amp;#39;&quot; rel=&quot;tag&quot;&gt;auctex&lt;/a&gt; for questions about AUCTeX.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For questions about (La)TeX and companion tools that are not related to Emacs, see &lt;a href=&quot;http://tex.stackexchange.com/&quot;&gt;TeX - LaTeX Stack Exchange&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:40:02.973" LastActivityDate="2015-06-07T21:40:02.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12983" PostTypeId="4" CreationDate="2015-06-07T21:40:02.973" Score="0" Body="Working with TeX documents" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:40:02.973" LastActivityDate="2015-06-07T21:40:02.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12984" PostTypeId="5" CreationDate="2015-06-07T21:43:52.977" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/TeX-Mode.html&quot; rel=&quot;nofollow&quot;&gt;TeX mode&lt;/a&gt; is a family of major modes to edit files for the &lt;a href=&quot;http://en.wikipedia.org/wiki/TeX&quot; rel=&quot;nofollow&quot;&gt;TeX&lt;/a&gt; document processing system, including &lt;code&gt;latex-mode&lt;/code&gt; for &lt;a href=&quot;http://en.wikipedia.org/wiki/LaTeX&quot; rel=&quot;nofollow&quot;&gt;LaTeX&lt;/a&gt; files. It is included in GNU Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use this tag for questions about the TeX Mode family (&lt;code&gt;plain-tex-mode&lt;/code&gt;, &lt;code&gt;latex-mode&lt;/code&gt;, &lt;code&gt;slitex-mode&lt;/code&gt;, &lt;code&gt;doctex-mode&lt;/code&gt;). For questions about TeX documents in general, see &lt;a href=&quot;/questions/tagged/tex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;tex&amp;#39;&quot; rel=&quot;tag&quot;&gt;tex&lt;/a&gt;. For questions about LaTeX documents in general, see &lt;a href=&quot;/questions/tagged/latex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;latex&amp;#39;&quot; rel=&quot;tag&quot;&gt;latex&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative to TeX mode is &lt;a href=&quot;http://en.wikipedia.org/wiki/AUCTeX&quot; rel=&quot;nofollow&quot;&gt;AUCTeX&lt;/a&gt; &lt;a href=&quot;/questions/tagged/auctex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;auctex&amp;#39;&quot; rel=&quot;tag&quot;&gt;auctex&lt;/a&gt;, a third-party package (included in XEmacs) with more advanced features including syntax highlighting and completion of macros in third-party packages, better support for complex compilations, preview of mathematics, etc.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:43:52.977" LastActivityDate="2015-06-07T21:43:52.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12985" PostTypeId="4" CreationDate="2015-06-07T21:43:52.977" Score="0" Body="The basic major mode for (La)TeX included in GNU Emacs. Not to be confused with AUCTeX, a common third-party package." OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-03-07T21:48:55.483" LastActivityDate="2016-03-07T21:48:55.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12986" PostTypeId="5" CreationDate="2015-06-07T21:49:35.500" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://auto-complete.org/&quot; rel=&quot;nofollow&quot;&gt;Auto-Complete&lt;/a&gt;, also known as auto-complete.el or Auto-Complete Mode, is an Emacs extension that provides context-sensitive completion suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This tag is about the Auto-Complete package. For questions about completion in general, use the tag &lt;a href=&quot;/questions/tagged/completion&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;completion&amp;#39;&quot; rel=&quot;tag&quot;&gt;completion&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;External links&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://auto-complete.org/&quot; rel=&quot;nofollow&quot;&gt;Home page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://auto-complete.org/doc/manual.html&quot; rel=&quot;nofollow&quot;&gt;User manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow&quot;&gt;Source code&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacswiki.org/emacs/AutoComplete&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:49:35.500" LastActivityDate="2015-06-07T21:49:35.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12987" PostTypeId="4" CreationDate="2015-06-07T21:49:35.500" Score="0" Body="Auto-Complete, also known as auto-complete.el or Auto-Complete Mode, is an Emacs extension that provides context-sensitive completion suggestions" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-07T21:49:35.500" LastActivityDate="2015-06-07T21:49:35.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12988" PostTypeId="2" ParentId="12973" CreationDate="2015-06-07T21:54:05.107" Score="3" Body="&lt;p&gt;The functions you want are &lt;code&gt;delete-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(delete-file FILENAME &amp;amp;optional TRASH)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Delete file named FILENAME.  If it is a symlink, remove the symlink.&#xA;  If file has multiple names, it continues to exist with the other names.&#xA;  TRASH non-nil means to trash the file instead of deleting, provided&#xA;  ‘delete-by-moving-to-trash’ is non-nil.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When called interactively, TRASH is t if no prefix argument is given.&#xA;  With a prefix argument, TRASH is nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;buffer-file-name&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(buffer-file-name &amp;amp;optional BUFFER)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return name of file BUFFER is visiting, or nil if none.&#xA;  No argument or nil as argument means use the current buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We can can combine them into a function, making sure that &lt;code&gt;buffer-file-name&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt; before we try to delete it. This function could also run &lt;code&gt;save-buffer&lt;/code&gt;, but it sounds like what you really want is to always delete the file just before saving it, which is what &lt;code&gt;before-save-hook&lt;/code&gt; is for&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-if-file ()&#xA;  (if (buffer-file-name)&#xA;      (delete-file (buffer-file-name))&#xA;    ))&#xA;&#xA;(add-hook 'before-save-hook #'delete-if-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't really tested this except to check that files are getting saved.  Since it deletes things, you should be careful.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-06-08T02:41:42.820" LastActivityDate="2015-06-08T02:41:42.820" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12990" PostTypeId="2" ParentId="12952" CreationDate="2015-06-07T23:55:30.490" Score="8" Body="&lt;p&gt;The other answers focus on the usefulness of &lt;code&gt;C-x C-x&lt;/code&gt; when &lt;code&gt;transient-mark-mode&lt;/code&gt; is active.  But &lt;code&gt;C-x C-x&lt;/code&gt; predates &lt;code&gt;transient-mark-mode&lt;/code&gt;, and is useful independently of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main role of &lt;code&gt;C-x C-x&lt;/code&gt; is to swap point and mark.  This useful when you are editing two points in a single buffer and for some reason don't want to split the current window.  Do some editing, set mark, move to some other point in the buffer, do some editing, &lt;code&gt;C-x C-x&lt;/code&gt;, do some editing at the former place, &lt;code&gt;C-x C-x&lt;/code&gt;, do some more editing, ad nauseam.  (If you don't plan to come back to the second point, &lt;code&gt;C-u C-SPC&lt;/code&gt; may be more intuitive.  Look up the &lt;em&gt;mark ring&lt;/em&gt; in the Emacs manual.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;transient-mark-mode&lt;/code&gt; is disabled, &lt;code&gt;C-x C-x&lt;/code&gt; has another important purpose: it allows you to find out where the region is.  &lt;code&gt;C-x C-x&lt;/code&gt;, quick glimpse at point, &lt;code&gt;C-x C-x&lt;/code&gt; again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And in case you are wondering — yes, some of us still prefer to use Emacs with &lt;code&gt;transient-mark-mode&lt;/code&gt; disabled.)&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-06-07T23:55:30.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12991" PostTypeId="2" ParentId="5709" CreationDate="2015-06-08T00:09:42.233" Score="1" Body="&lt;p&gt;The function that sets up the minibuffer is &lt;code&gt;read_minibuf&lt;/code&gt; in &lt;code&gt;minibuf.c&lt;/code&gt;. As of Emacs 24, it is called from the primitives &lt;code&gt;read-from-minibuffer&lt;/code&gt; and &lt;code&gt;read-no-blanks-input&lt;/code&gt;, and &lt;code&gt;Fread_from_minibuffer&lt;/code&gt; is in turned called from &lt;code&gt;read-string&lt;/code&gt;. The hook &lt;code&gt;minibuffer-setup-hook&lt;/code&gt; is the first piece of Lisp code that &lt;code&gt;read_minibuf&lt;/code&gt; executes. If that's too late for you, you're going to need to run your code before any of  &lt;code&gt;read-from-minibuffer&lt;/code&gt;, &lt;code&gt;read-no-blanks-input&lt;/code&gt; and &lt;code&gt;read-string&lt;/code&gt; is executed. In earlier Emacs versions, there were more functions that called &lt;code&gt;read_minibuf&lt;/code&gt; via C, especially &lt;code&gt;completing-read&lt;/code&gt;, but these now go via Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some code for Emacs ≥24.4 that sets up a one-time advice executed before the first time one of these functions executed.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun before-first-read-from-minibuffer (&amp;amp;rest ignored)&#xA;  (message &quot;Before first read-from-minibuffer&quot;)&#xA;  (advice-remove 'read-from-minibuffer 'before-first-read-from-minibuffer)&#xA;  (advice-remove 'read-no-blanks-input 'before-first-read-from-minibuffer)&#xA;  (advice-remove 'read-string 'before-first-read-from-minibuffer))&#xA;(advice-add 'read-from-minibuffer :before 'before-first-read-from-minibuffer)&#xA;(advice-add 'read-no-blanks-input :before 'before-first-read-from-minibuffer)&#xA;(advice-add 'read-string :before 'before-first-read-from-minibuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The corresponding code with the older advice facility that works in previous Emacs versions would be something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice read-from-minibuffer&#xA;    (before before-first-read-from-minibuffer activate)&#xA;  (message &quot;Before first read-from-minibuffer&quot;)&#xA;  (ad-remove-advice 'read-from-minibuffer 'before 'before-first-read-from-minibuffer)&#xA;  (ad-activate 'read-from-minibuffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-06-09T00:20:38.163" LastActivityDate="2015-06-09T00:20:38.163" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12993" PostTypeId="2" ParentId="965" CreationDate="2015-06-08T00:35:22.180" Score="0" Body="&lt;p&gt;Well, that's a bug in the theme.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((gruvbox-dark0_hard  (if (display-graphic-p) &quot;#1d2021&quot; &quot;color-234&quot;))&#xA;  …&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It uses RGB values if the current terminal is a graphical one, and names like &lt;code&gt;color-234&lt;/code&gt; otherwise. So if you start Emacs as a demon, &lt;code&gt;color-234&lt;/code&gt; is used; when you open a GUI frame and load the theme again, there's a GUI, so the RGB values are used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious fix is to edit &lt;code&gt;gruvbox-theme.el&lt;/code&gt; and get rid of that &lt;code&gt;display-graphic-p&lt;/code&gt; nonsense: &lt;code&gt;replace-regexp&lt;/code&gt; all the occurrences of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (display-graphic-p) \(&quot;[^&quot;]*&quot;\) &quot;[^&quot;]*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;by &lt;code&gt;\1&lt;/code&gt;. The other case is for 256-color text terminals, but Emacs should already be translating color values. If Emacs doesn't know the color values corresponding to the terminal colors, the proper solution would be to call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Terminal-Colors.html#index-tty_002dcolor_002ddefine&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;tty-color-define&lt;/code&gt;&lt;/a&gt; to define them, not to break the theme for people who use both GUI frames and text frames or the demon.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-06-08T00:35:22.180" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12994" PostTypeId="1" AcceptedAnswerId="12995" CreationDate="2015-06-08T00:46:47.820" Score="5" ViewCount="696" Body="&lt;p&gt;I'm brand-new to Emacs and I want to put my ~/.emacs.d under version control, much like I've done in the past with my vim setup. I installed a couple packages before initializing a git repo, and now I'm sifting through the contents of emacs.d trying to figure out what came from where, and what I should add to my gitignore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The folder contents are currently&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;auto-save-list/&#xA;elpa/&#xA;url/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've added auto-save-list to my gitignore, but I'm less clear about the elpa and url directories. I gather elpa houses the packages I've installed, but I'm not sure whether I should put those under version control, and I have no idea what the url directory is about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help/advice to a noob would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2015-06-08T15:56:43.897" Title="Anatomy of ~/.emacs.d" Tags="|init-file|version-control|" AnswerCount="2" CommentCount="1" ClosedDate="2015-06-08T15:21:43.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="12995" PostTypeId="2" ParentId="12994" CreationDate="2015-06-08T01:19:33.610" Score="10" Body="&lt;p&gt;There are lots of different ways to organize your .emacs.d. You should probably have a look at some of the great examples &lt;a href=&quot;https://github.com/lunaryorn/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://github.com/itsjeyd/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time, what you want to keep under version control is your personal emacs configuration: the elisp files and directories you edit and modify to personalize your emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under my &lt;a href=&quot;https://github.com/LeMeteore/emacs.d&quot; rel=&quot;nofollow&quot;&gt;.emacs.d/&lt;/a&gt;, for example, I have an init.el file and the lisp/ &amp;amp; elisp/ directories (elisp configuration/customization files etc). Those are the only things I keep under version control.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my tiny experience, I've never found a good reason to keep those autogenerated directories under version control.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="-1" LastEditDate="2015-06-08T15:56:43.897" LastActivityDate="2015-06-08T15:56:43.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12996" PostTypeId="2" ParentId="12994" CreationDate="2015-06-08T01:52:16.160" Score="2" Body="&lt;p&gt;Since I also wanted to sync the same emacs.d folder to several other machines that I normally use (desktops, laptops, home, work, etc.), I kept the whole emacs.d folder under git when starting out. As I implemented various customizations, I started expanding .gitignore to selectively exclude unwanted sub-folders of the .emacs.d folder.  This approach allowed me to customize which folders got version control as my .emacs.d folder has several development folders, test folders, and so on. Not all folders need to be under version control, but you won't know which ones until you figure out your use case. Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-08T01:52:16.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12997" PostTypeId="1" AcceptedAnswerId="14827" CreationDate="2015-06-08T03:17:42.600" Score="31" ViewCount="3838" Body="&lt;p&gt;My config is full of advice, and I keep hearing about the new shiny minimalist &lt;code&gt;nadvice.el&lt;/code&gt; package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched the manuals, and I've read the &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/nadvice.el&quot;&gt;source&lt;/a&gt;, but I'll openly admit: &lt;em&gt;I still have no idea how to actually use it.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone here point me to a guide, or tell me how to get started porting my old-style advice over?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-04-01T21:02:26.790" Title="How do I use nadvice?" Tags="|advice|emacs-internals|elisp|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12998" PostTypeId="1" CreationDate="2015-06-08T03:27:32.063" Score="1" ViewCount="341" Body="&lt;p&gt;I'm using the railwaycat/emacs-mac-port, and would like to continue use it because of the very nice smooth scrolling. Anyone knows if there is a way to have the &lt;code&gt;&quot;M-s-h&quot;&lt;/code&gt; key work as in other Mac applications? In Cocoa emacs I can for example do &lt;code&gt;(global-set-key (kbd &quot;M-S-h&quot;) 'ns-do-hide-others)&lt;/code&gt;. Thanks&lt;/p&gt;&#xA;" OwnerUserId="8529" LastActivityDate="2024-03-13T20:53:53.370" Title="How to bind &quot;Hide Others&quot; to a key &quot;M-s-h&quot; in railwaycat/emacs-mac-port?" Tags="|key-bindings|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12999" PostTypeId="1" CreationDate="2015-06-08T05:18:02.980" Score="1" ViewCount="111" Body="&lt;p&gt;This weekend I've upgrade from emacs 23 to emacs 24 (with &lt;code&gt;apt-get install emacs24&lt;/code&gt;) and that broke some of the regular keybindings.  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-x C-o&lt;/code&gt; used to trigger &lt;code&gt;tex-latex-block&lt;/code&gt; and &lt;code&gt;C-x C-e&lt;/code&gt; used to trigger &lt;code&gt;tex-close-latex-block&lt;/code&gt;. The Emacs 24 manual states that these keybindings still work (see section 22.10.2), but instead, &lt;code&gt;C-x C-e&lt;/code&gt; triggers &lt;code&gt;Environment type&lt;/code&gt; and &lt;code&gt;C-x C-o&lt;/code&gt; isn't bound to anything. I've tried to get the old keybindings back through &lt;code&gt;M-x global-set-key RET key cmd RET&lt;/code&gt;, but I can't get things to work, even when I restart emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With Emacs 23, I would use &lt;code&gt;C-c C-f&lt;/code&gt; to trigger &lt;code&gt;latex&lt;/code&gt;, and then &lt;code&gt;C-c C-c&lt;/code&gt; to choose between &lt;code&gt;bibtex&lt;/code&gt;, &lt;code&gt;pdflatex&lt;/code&gt;, &lt;code&gt;dvips&lt;/code&gt;, and &lt;code&gt;ps2pdf&lt;/code&gt; (this is useful because, depending on the document I am working on, I might want to run either &lt;code&gt;pdflatex&lt;/code&gt; alone or a &lt;code&gt;latex&lt;/code&gt;, &lt;code&gt;dvips&lt;/code&gt;, &lt;code&gt;ps2pdf&lt;/code&gt; sequence). Now, &lt;code&gt;C-c C-f&lt;/code&gt; isn't tied to anything, and &lt;code&gt;C-c C-c&lt;/code&gt; simply doesn't recognize &lt;code&gt;dvips&lt;/code&gt; or &lt;code&gt;ps2pdf&lt;/code&gt; at all. Again, trying to get the old keybindings back fails.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, the question here is, how can I get Emacs behaving the way it used to?&lt;/p&gt;&#xA;" OwnerUserId="5454" LastEditorUserId="2710" LastEditDate="2015-06-08T08:43:09.240" LastActivityDate="2015-06-08T09:44:49.390" Title="Emacs 24 keybindings for tex" Tags="|key-bindings|emacs24.4|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13000" PostTypeId="2" ParentId="12999" CreationDate="2015-06-08T06:55:44.883" Score="4" Body="&lt;p&gt;Many installations of emacs 24 have the AUCTeX package activated in the default set-up.  The keybindings you are seeing come from that package, and you should look at its manual instead to find descriptions of them.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't wish to use AUCTeX, then may be you can uninstall it by running &lt;code&gt;list-packages&lt;/code&gt; and deleting the package. If not then may be &lt;a href=&quot;https://stackoverflow.com/q/10573067/4050592&quot;&gt;https://stackoverflow.com/q/10573067/4050592&lt;/a&gt; will help you remove the package.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-06-08T09:44:49.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13002" PostTypeId="1" AcceptedAnswerId="13181" CreationDate="2015-06-08T14:43:26.737" Score="5" ViewCount="989" Body="&lt;p&gt;I sometimes edit org files in non-org-mode. (e.g artist mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upon returning to org-mode, it will mess with the fold/collapse state.&#xA;E.g it will collapse all headers so that I loose my current spot and have to find it again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried editing &lt;code&gt;org-startup-folded&lt;/code&gt; and tried all the 4 options, but all of these mess with the collapse state in some way or another. I cannot find an  option to leave expanded state as is when loading org-mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-06-15T20:40:34.533" Title="How to get org-mode not to change fold-state upload loading?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13004" PostTypeId="1" AcceptedAnswerId="13035" CreationDate="2015-06-08T14:49:32.917" Score="5" ViewCount="1366" Body="&lt;p&gt;For some org-mode files, I would like to run specific commands when that file is opened for editing. These commands should be written in the heading of the file somewhere near the &lt;code&gt;#+CONFIG&lt;/code&gt; bits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g in my 'WeeklyReport.org' I would like it to automatically run my function &lt;code&gt;NavigateToOrCreateThisWeek()&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative, I currently have functions that load a file and then do something. But I'd like to instruct the functions to be ran when ever I open that file.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2021-07-27T21:21:34.487" Title="How to run file-specific commands?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13005" PostTypeId="1" CreationDate="2015-06-08T15:19:02.870" Score="13" ViewCount="2941" Body="&lt;p&gt;Some of the log files I'm working with are fairly large (&gt;200Mb) but it would be nice to browse them in Emacs. At the moment by default Emacs attempts to enable log4j mode which just slows everything down. What I really need is a lightweight viewer that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;disabled undo mode&lt;/li&gt;&#xA;&lt;li&gt;can auto-revert when the log file is updated&lt;/li&gt;&#xA;&lt;li&gt;can follow the tail of the log when it updates&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Ideally it would be nice just to map in a small portion of the log file as you browse through. Do any such log modes exist?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="14920" LastEditDate="2018-05-18T22:50:23.050" LastActivityDate="2018-05-18T22:50:23.050" Title="Is there a decent log viewing mode for large log files?" Tags="|logging|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13006" PostTypeId="1" AcceptedAnswerId="13009" CreationDate="2015-06-08T15:45:31.967" Score="1" ViewCount="66" Body="&lt;p&gt;I want to highlight keywords when I open an email (article) in Gnus. This is what I have so far. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'gnus-article-mode-hook (lambda() (highlight-phrase &quot;\\(TODO\\|job\\|Mike\\)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried this which did not work either.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnus-article-prepare-hook&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2121" LastActivityDate="2015-06-08T16:14:34.060" Title="gnus-article-mode-hook does not fire when opening an article in Gnus" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13007" PostTypeId="2" ParentId="13005" CreationDate="2015-06-08T15:51:52.917" Score="0" Body="&lt;p&gt;I have read that if you set global font locking to nil you should also see speed improvements&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-font-lock-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and maybe&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq jit-lock-defer-time 0.05)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will improve scrolling speeds&lt;/p&gt;&#xA;" OwnerUserId="2121" LastActivityDate="2015-06-08T15:51:52.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13008" PostTypeId="2" ParentId="13005" CreationDate="2015-06-08T16:05:52.257" Score="2" Body="&lt;p&gt;I have been using &lt;a href=&quot;https://github.com/re5et/itail&quot; rel=&quot;nofollow&quot;&gt;https://github.com/re5et/itail&lt;/a&gt; with success for a couple of years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a tail mode that opens in it's own buffer.&lt;/p&gt;&#xA;" OwnerUserId="469" LastActivityDate="2015-06-08T16:05:52.257" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13009" PostTypeId="2" ParentId="13006" CreationDate="2015-06-08T16:14:34.060" Score="0" Body="&lt;p&gt;Works fine for me on Emacs25. A better way to debug this is not to use the lambda:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun ora-gnus-article-hook ()&#xA;  (message &quot;test&quot;))&#xA;(add-hook 'gnus-article-mode-hook 'ora-gnus-article-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can instrument &lt;code&gt;ora-gnus-article-hook&lt;/code&gt; with &lt;kbd&gt;C-u C-M-x&lt;/kbd&gt; to see when it's getting called.  You can also continuously re-define &lt;code&gt;ora-gnus-article-hook&lt;/code&gt; without having to update &lt;code&gt;gnus-article-mode-hook&lt;/code&gt;.  In fact, once you put a lambda into a hook, the only way to remove it from that hook is basically &lt;code&gt;(setq gnus-article-mode-hook nil)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-08T16:14:34.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13010" PostTypeId="2" ParentId="13005" CreationDate="2015-06-08T16:22:03.557" Score="7" Body="&lt;p&gt;This is what I use. It disables everything that might slow emacs down, makes the buffer read only, and sets up auto-revert-tail-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; automagically tail log files&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.log\\'&quot; . auto-revert-tail-mode))&#xA;&#xA;(defun etc-log-tail-handler ()&#xA;  (end-of-buffer)&#xA;  (make-variable-buffer-local 'auto-revert-interval)&#xA;  (setq auto-revert-interval 1)&#xA;  (auto-revert-set-timer)&#xA;  (make-variable-buffer-local 'auto-revert-verbose)&#xA;  (setq auto-revert-verbose nil)&#xA;  (read-only-mode t)&#xA;  (font-lock-mode 0)&#xA;  (when (fboundp 'show-smartparens-mode)&#xA;    (show-smartparens-mode 0)))&#xA;&#xA;(add-hook 'auto-revert-tail-mode-hook 'etc-log-tail-handler)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want emacs to behave this way for all auto-revert-tail-mode buffers you could add a check to make sure the file actually ends in .log at the top of etc-log-tail-handler, or use whatever other criteria you like.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-06-08T16:22:03.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13011" PostTypeId="1" AcceptedAnswerId="17836" CreationDate="2015-06-08T18:07:42.607" Score="6" ViewCount="931" Body="&lt;p&gt;I would like to quickly use one of the already used tags when taking notes quickly using &lt;code&gt;org-capture&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one &lt;a href=&quot;http://orgmode.org/manual/Completion.html&quot;&gt;inbuilt way&lt;/a&gt; of using &lt;code&gt;M-TAB&lt;/code&gt; after &lt;code&gt;:&lt;/code&gt; but there are 2 issues with that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It does not work in the narrowed down Capture buffer.. I need to widen it first.&lt;/li&gt;&#xA;&lt;li&gt;I would like to have a &quot;list&quot; completion interface so that I can pick one of the existing tags from the minibuffer.. think of &lt;code&gt;imenu&lt;/code&gt;/&lt;code&gt;ido&lt;/code&gt;/&lt;code&gt;ivy&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is a typical use case (using my bindings for the example workflow):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c c j&lt;/code&gt; to make a quick &lt;code&gt;org-capture&lt;/code&gt; entry in my journal.org&lt;/li&gt;&#xA;&lt;li&gt;Type heading&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;C-c C-q&lt;/code&gt; to enter a tag&lt;/li&gt;&#xA;&lt;li&gt;Start typing the tag (and at this point I would like the minibuffer to show a list of tags that match with what I already typed in the minibuffer).&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Pick one from the list by hitting &lt;code&gt;RET&lt;/code&gt; if I want to reuse a tag, OR&lt;/li&gt;&#xA;&lt;li&gt;If that exact tag doesn't already exist, create it when I hit &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Currently, in step 4, if I want to use one of the already used tags, there is no way for me to ensure if I am doing so or creating a new tag with slight variation of that old tag. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: I might already have had a heading with a tag &lt;code&gt;PRJ_v1&lt;/code&gt; in the past and I intend to make a new heading with the same tag. But by mistake I end up creating a new tag called &lt;code&gt;PRJ_r1&lt;/code&gt; (because I did not remember if the original tag was &lt;code&gt;PRJ_v1&lt;/code&gt; or &lt;code&gt;PRJ_r1&lt;/code&gt;). I would like to prevent such tag duplication.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-11-03T19:49:30.497" Title="Tag completion using ido during org-capture" Tags="|org-mode|completion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13012" PostTypeId="2" ParentId="12936" CreationDate="2015-06-08T18:53:04.337" Score="2" Body="&lt;p&gt;That's a known issue when using Magit 1.4.1 together with Emacs 24.5. It was fixed on &lt;code&gt;master&lt;/code&gt; a few weeks ago and I have now also created a release, &lt;code&gt;1.4.2&lt;/code&gt;, which includes that fix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE: Magit 2.1.0 has been released, replacing the mode &lt;code&gt;magit-auto-revert-mode&lt;/code&gt; with the option &lt;code&gt;magit-revert-buffers&lt;/code&gt;. Like &lt;code&gt;1.4.2&lt;/code&gt;, &lt;code&gt;2.1.0&lt;/code&gt; does not have the issue that &lt;code&gt;1.4.1.&lt;/code&gt; had on Emacs &lt;code&gt;24.5&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T12:53:10.897" LastActivityDate="2015-07-03T12:53:10.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13013" PostTypeId="2" ParentId="12875" CreationDate="2015-06-08T18:59:15.180" Score="4" Body="&lt;p&gt;Okay, so my first answer has a number of shortcomings as detailed in its comments.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;execute-kbd-macro is a built-in function in &lt;code&gt;C source code&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(execute-kbd-macro MACRO &amp;amp;optional COUNT LOOPFUNC)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Execute MACRO as string of editor command characters.&#xA;  &lt;strong&gt;MACRO can also be a vector of keyboard events&lt;/strong&gt;.  If MACRO is a symbol,&#xA;  its function definition is used.&#xA;  COUNT is a repeat count, or nil for once, or 0 for infinite loop.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Optional third arg LOOPFUNC may be a function that is called prior to&#xA;  each iteration of the macro.  Iteration stops if LOOPFUNC returns nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(emphasis mine)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a solution to pass a string straight through to Emacs as individual keypresses is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-via-kbd (str)&#xA;  (execute-kbd-macro (vconcat str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work quite well (it even handles Japanese!), but there are still some oddities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;\n&lt;/code&gt; will trigger &lt;kbd&gt;C-j&lt;/kbd&gt; (not &lt;kbd&gt;C-m&lt;/kbd&gt;, &lt;code&gt;RET&lt;/code&gt;, or &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\t&lt;/code&gt; will trigger &lt;code&gt;TAB&lt;/code&gt; (not &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-06-08T18:59:15.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13014" PostTypeId="1" AcceptedAnswerId="13021" CreationDate="2015-06-08T20:12:02.330" Score="2" ViewCount="104" Body="&lt;p&gt;I'm trying to modify some face attributes in the buffer that appears when the &lt;code&gt;org-agenda&lt;/code&gt; command is called. This buffer displays &lt;code&gt;*Agenda Commands*&lt;/code&gt; and &lt;code&gt;Fundamental&lt;/code&gt; (mode) in the mode line. I've tried modifying &lt;code&gt;fundamental-mode&lt;/code&gt; face attributes but to no avail. Also, I can't seem to run the &lt;code&gt;what-cursor-position&lt;/code&gt; function (i.e., &lt;code&gt;C-u C-x =&lt;/code&gt;) like I normally would to find out more information regarding buffer properties--any one keystroke closes this buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What properties is this buffer calling on?&lt;/p&gt;&#xA;" OwnerUserId="5478" LastActivityDate="2015-06-09T02:14:47.917" Title="Where are face attributes defined for the `*Agenda Commands*` buffer?" Tags="|faces|org-agenda|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13015" PostTypeId="1" CreationDate="2015-06-08T21:33:59.907" Score="1" ViewCount="88" Body="&lt;p&gt;When I am moving through a &lt;code&gt;TODO&lt;/code&gt; list, I often want to complete the current task and clock into the next leaf node. In other words, I am performing a depth-first traversal of the task list.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Before&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO foo&#xA;** TODO foo-bar&#xA;   CLOCK: [...]&#xA;* TODO baz&#xA;** TODO baz-qux&#xA;** TODO baz-norf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once I complete &lt;code&gt;foo-bar&lt;/code&gt;, I want to be in the following state.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;After&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE foo&#xA;  CLOSED: [...]&#xA;** DONE foo-bar&#xA;   CLOSED: [...]&#xA;   CLOCK: [...]--[...]&#xA;* TODO baz&#xA;** TODO baz-qux&#xA;   CLOCK: [...]&#xA;** TODO baz-norf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;foo-bar&lt;/code&gt; has been marked complete. Since all of &lt;code&gt;foo&lt;/code&gt;'s dependencies have been marked complete, it too becomes marked complete. Since &lt;code&gt;baz-qux&lt;/code&gt; is the next leaf task, it becomes the clocked-in task. Since &lt;code&gt;foo-bar&lt;/code&gt; and &lt;code&gt;foo&lt;/code&gt; are complete, I also want them to be collapsed. For clarity I've omitted that from the above code block.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;After (including collapse)&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE foo...&#xA;* TODO baz&#xA;** TODO baz-qux&#xA;   CLOCK: [...]&#xA;** TODO baz-norf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I accomplish this pattern with a single command?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-06-08T21:33:59.907" Title="Close clocked-in org task and clock-in next leaf task" Tags="|org-mode|org-clock|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13017" PostTypeId="1" CreationDate="2015-06-09T00:03:32.480" Score="4" ViewCount="389" Body="&lt;p&gt;When i indent javascript code (inside html - web mode) that has no semicolons in it, the next statements are indented right with two extra spaces,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;lt;script&amp;gt;&#xA; function processTemplates(){&#xA;   var tmpldata = $( &quot;#suiteSummaryTemplate&quot; ).tmpl( tempData );&#xA;   $(tmpldata).appendTo( &quot;#example&quot; )&#xA;     //$( &quot;#example&quot; ).html(tmpldata)&#xA;     var logSummTmplStr = $( &quot;#logSummaryTemplate&quot; ).tmpl( logSummaryData )&#xA;     $(logSummTmplStr).appendTo( &quot;#logs_table&quot; )&#xA;     //$(&quot;#logs_table&quot;).html(logSummTmplStr)&#xA;} &#xA;&amp;lt;/script&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After adding semicolons to a line, it works properly like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  var tmpldata = $( &quot;#suiteSummaryTemplate&quot; ).tmpl( tempData );&#xA;  $(tmpldata).appendTo( &quot;#example&quot; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;javascript-mode&lt;/code&gt;, when i place the same code in a js file (after removing the script tag), it works properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i achieve this correct indentation without forcing the user to use semicolons everywhere?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-06-11T14:59:51.720" LastActivityDate="2015-06-11T14:59:51.720" Title="Web mode -indentation is misaligned on skipping semicolons" Tags="|indentation|javascript|web-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13018" PostTypeId="2" ParentId="12945" CreationDate="2015-06-09T00:47:05.187" Score="4" Body="&lt;p&gt;After looking under the hood of org-mode, here's what I'd suggest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comment out &lt;a href=&quot;http://orgmode.org/w/org-mode.git?p=org-mode.git;a=blob;f=lisp/ob-core.el;h=6821b6dfc970675e0260e5eecc87d0ca519faa12;hb=HEAD#l1987&quot; rel=&quot;nofollow&quot;&gt;Line 1987&lt;/a&gt; in the current/latest version &lt;code&gt;ob-core.el&lt;/code&gt;, evaluate, test, and if you like what you see, don't forget to byte compile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using a different version of Org, the line is part of the function &lt;code&gt;org-babel-where-is-src-block-result&lt;/code&gt;, and it reads as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(unless beg (insert &quot;\n&quot;) (backward-char))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want a cleaner solution, there is probably another function you could advise. But I'll leave you to find that; now you know where the newline comes from.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;method&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Maybe useful for you to know how I went about it.  I dug into the export routines, starting with &lt;code&gt;org-latex-export-as-latex&lt;/code&gt;, until I found the &lt;code&gt;ob-core.el&lt;/code&gt; file. There are lots of newlines introduced there.  To pinpoint which was responsible, I replaced each &lt;code&gt;&quot;\n&quot;&lt;/code&gt; with some &lt;code&gt;&quot;N\n&quot;&lt;/code&gt; (where &lt;code&gt;N&lt;/code&gt; is a counting number) then reran the export.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2015-06-09T00:56:42.210" LastActivityDate="2015-06-09T00:56:42.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13019" PostTypeId="1" AcceptedAnswerId="13034" CreationDate="2015-06-09T01:12:29.053" Score="4" ViewCount="1285" Body="&lt;p&gt;Is there a keybind or a way of undoing each of ediff A-B change? I often want to revert the previous modification.&lt;/p&gt;&#xA;" OwnerUserId="8537" LastEditorUserId="105" LastEditDate="2015-06-09T01:35:09.007" LastActivityDate="2015-06-09T16:15:20.120" Title="How to undo on ediff A-B changes" Tags="|ediff|undo|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13020" PostTypeId="2" ParentId="13019" CreationDate="2015-06-09T01:34:16.570" Score="2" Body="&lt;p&gt;Select the buffer that was changed by the last modification (e.g. put the cursor there), and then hit &lt;code&gt;C-_&lt;/code&gt; (&lt;code&gt;undo&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Undo is per buffer. Each Ediff change affects one buffer. Go to that buffer and use &lt;code&gt;undo&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-09T01:34:16.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13021" PostTypeId="2" ParentId="13014" CreationDate="2015-06-09T02:00:04.443" Score="1" Body="&lt;p&gt;The primary function responsible for creating the &lt;code&gt;*Agenda Commands*&lt;/code&gt; buffer is located within the &lt;code&gt;org-agenda.el&lt;/code&gt; library, and is called &lt;code&gt;org-agenda-get-restriction-and-command&lt;/code&gt;.  The function at issue can be found in the source code by typing &lt;code&gt;M-x find-function RET org-agenda-get-restriction-and-command RET&lt;/code&gt; &lt;em&gt;after&lt;/em&gt; first having loaded the &lt;code&gt;org-agenda.el&lt;/code&gt; library -- e.g., &lt;code&gt;M-x eval-expression RET (require 'org-agenda) RET&lt;/code&gt;.  The text-properties for the faces are hard-coded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the original poster decides to modify the function directly, the function can be copied and pasted to the &lt;code&gt;.emacs&lt;/code&gt; file with a &lt;em&gt;preceding&lt;/em&gt; &lt;code&gt;require&lt;/code&gt; statement for the library where the original function is located.  Although the internal workings of the function may be modified by the original poster, the original function will maintain its original name -- e.g., &lt;code&gt;(require 'org-agenda) (defun org-agenda-get-restriction-and-command (prefix-descriptions) . . . )&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options include, but are not limited to, hard-coding different faces defined by the original poster, changing the global settings for the existing faces used by the function, or including code to use the existing faces on a buffer-local basis (with different attributes) with something like &lt;code&gt;face-remap-add-relative&lt;/code&gt;, the documentation for which is at the following link:  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-09T02:14:47.917" LastActivityDate="2015-06-09T02:14:47.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13022" PostTypeId="2" ParentId="12949" CreationDate="2015-06-09T02:12:20.717" Score="2" Body="&lt;p&gt;The primary function responsible for the behavior described by the original poster is located within the &lt;code&gt;org-colview.el&lt;/code&gt; library, and is called &lt;code&gt;org-columns-display-here&lt;/code&gt;.  The function at issue can be found in the source code by typing &lt;code&gt;M-x find-function RET org-columns-display-here RET&lt;/code&gt; &lt;em&gt;after&lt;/em&gt; first having loaded the &lt;code&gt;org-colview.el&lt;/code&gt; library -- e.g., &lt;code&gt;M-x eval-expression RET (require 'org-colview) RET&lt;/code&gt;.  The faces and individual attributes at issue are hard coded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the original poster decides to modify the function directly, the function can be copied and pasted to the &lt;code&gt;.emacs&lt;/code&gt; file with a &lt;em&gt;preceding&lt;/em&gt; &lt;code&gt;require&lt;/code&gt; statement for the library where the original function is located.  Although the internal workings of the function may be modified by the original poster, the original function will maintain its original name -- e.g., &lt;code&gt;(require 'org-colview) (defun org-columns-display-here (prefix-descriptions) . . . )&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options include, but are not limited to, hard-coding different faces and/or individual attributes defined by the original poster, changing the global settings for the existing faces used by the function (e.g., &lt;code&gt;'default)&lt;/code&gt;, or including code to use the existing faces (e.g., &lt;code&gt;'default&lt;/code&gt;) on a buffer-local basis (with different attributes) with something like &lt;code&gt;face-remap-add-relative&lt;/code&gt;, the documentation for which is at the following link:  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-06-09T02:12:20.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13023" PostTypeId="1" AcceptedAnswerId="13028" CreationDate="2015-06-09T02:27:58.223" Score="4" ViewCount="1801" Body="&lt;p&gt;Is there some way to fill background of Emacs' windows (not frames) using some CSS rules rather than one solid color?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solid color fill is very unnatural for eyes &lt;em&gt;(at least of mine)&lt;/em&gt;.  There is an &lt;strong&gt;amazing cicada principle&lt;/strong&gt;&lt;sup&gt;&lt;a href=&quot;http://www.sitepoint.com/the-cicada-principle-and-why-it-matters-to-web-designers/&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; in the wild, and it will be very great to fill background using several low opacity gradient layers to make some slightly visible noise.  I believe this also helps to follow scrolling.&lt;/p&gt;&#xA;" OwnerUserId="6844" LastEditorUserId="253" LastEditDate="2015-06-23T13:43:10.607" LastActivityDate="2015-06-23T13:43:10.607" Title="Is it possible to fill Emacs' window background using CSS rules?" Tags="|customization|css|" AnswerCount="1" CommentCount="7" ClosedDate="2015-06-09T17:37:00.590" ContentLicense="CC BY-SA 3.0" />
  <row Id="13024" PostTypeId="2" ParentId="12973" CreationDate="2015-06-09T02:59:01.310" Score="1" Body="&lt;p&gt;Emacs works like this by default: when it saves a file, it moves the existing file to the backup file (&lt;code&gt;rename(&quot;foo&quot;, &quot;foo~&quot;)&lt;/code&gt;), which unlinks the backup file, and it creates a new file to write to. This is controlled by the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Rename-or-Copy.html#index-backup_002dby_002dcopying&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;backup-by-copying&lt;/code&gt;&lt;/a&gt; variable; the default value is &lt;code&gt;nil&lt;/code&gt;, meaning the rename-and-new strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of circumstances when Emacs will instead copy the existing file to the backup file (&lt;code&gt;open(&quot;foo~&lt;/code&gt;&quot;, O_TRUNC)&lt;code&gt;) then save the buffer to the existing file (&lt;/code&gt;open(&quot;foo&lt;code&gt;&quot;, O_TRUNC)&lt;/code&gt;), basically when Emacs thinks it won't be able to create a file with the same permissions or hard links.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Auto-save files are in your home directory by default, so they aren't a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seeing the &lt;a href=&quot;https://github.com/matteoserva/MegaFuse/issues/11&quot; rel=&quot;nofollow&quot;&gt;bug&lt;/a&gt;, I suspect that your problem is not in fact that you &lt;em&gt;cannot&lt;/em&gt; write the file, but rather that the filesystem advertises the file as read-only. If that's the case, then Emacs would believe that it can't re-create the file (which is a bit weird: Emacs applies the copy-and-overwrite strategy if it doesn't have the permission to overwrite the file!), which is one of the conditions that make it apply the copy-and-overwrite strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some heavy-handed code that forces Emacs to use the rename strategy in that case. Untested.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice backup-buffer&#xA;  (around backup-buffer-by-renaming-on-megafuse activate)&#xA;  (if (save-match-data&#xA;        (string-match megafuse-directory-regexp (file-chase-links buffer-file-name)))&#xA;      (letf (((symbol-function 'backup-buffer-copy)&#xA;              (lambda (from-name to-name modes extended-attributes)&#xA;                (rename-file from-name to-name t))))&#xA;        ad-do-it)&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-06-09T02:59:01.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13025" PostTypeId="2" ParentId="12608" CreationDate="2015-06-09T07:50:04.013" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/DiminishedModes&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/DiminishedModes&lt;/a&gt; is your friend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It hides the minor and eventually the major move that you don't want to be displayed in your mode-line.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-06-09T07:50:04.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13026" PostTypeId="2" ParentId="12864" CreationDate="2015-06-09T09:35:47.167" Score="10" Body="&lt;p&gt;As @nanny said in comments, solution is having installed Cygwin with diffutils.&#xA;Here is how to do it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Download Cygwin &lt;a href=&quot;https://cygwin.com/&quot; rel=&quot;noreferrer&quot;&gt;from its homepage&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Install Cygwin with &lt;code&gt;diffutils: A GNU collection of diff utilities&lt;/code&gt; package. This package can be found in &lt;code&gt;Utils&lt;/code&gt; section in one of few steps of Cygwin installation.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/i3hE9.png&quot; alt=&quot;installing Cygwin with diffutils&quot;&gt;&lt;/li&gt;&#xA;&lt;li&gt;Add Cygwin directories to the PATH windows system variable. This could be done by:&lt;br&gt;&#xA;   a) adding your own CYGWIN variable, to keep the order. &lt;img src=&quot;https://i.stack.imgur.com/JMB5S.png&quot; alt=&quot;creating CYGWIN system variable&quot;&gt;;&lt;br&gt;&#xA;   b) and adding variable you just created to the system PATH variable.&lt;img src=&quot;https://i.stack.imgur.com/dcgDW.png&quot; alt=&quot;adding CYGWIN variable to PATH system variable&quot;&gt;  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After this you are able to call &lt;code&gt;ediff-buffers&lt;/code&gt;, &lt;code&gt;ediff-files&lt;/code&gt; and others successfully. Which looks something like this:&lt;img src=&quot;https://i.stack.imgur.com/GqJLo.png&quot; alt=&quot;running ediff&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;" OwnerUserId="6527" LastEditorUserId="25" LastEditDate="2017-07-21T21:38:51.523" LastActivityDate="2017-07-21T21:38:51.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13027" PostTypeId="1" CreationDate="2015-06-09T10:57:14.903" Score="10" ViewCount="1523" Body="&lt;p&gt;It's so annoying...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When any text on a line has its face changed so that the text is bold, the height of the line increases by (I assume) a single pixel.  It's best shown with an image:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IG1gm.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this?  How do I prevent it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As requested, info on the platform:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Debian GNU/Linux sid (unstable) on amd64&lt;/li&gt;&#xA;&lt;li&gt;Emacs uses libgtk-3.so.0 (gtk 3.14.5), on XFCE 4.12&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've tried the following fonts at 8pt, 9pt, 10pt and 11pt:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;DejaVu Sans Mono&lt;/li&gt;&#xA;&lt;li&gt;DejaVu Sans&lt;/li&gt;&#xA;&lt;li&gt;DejaVu Serif&lt;/li&gt;&#xA;&lt;li&gt;Droid Sans Mono&lt;/li&gt;&#xA;&lt;li&gt;Liberation Mono&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The problem occurs only with DejaVu Sans Mono and DejaVu Sans, and only at 9pt and 10pt.  (Image above shows &lt;code&gt;DejaVu Sans Mono-9&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="8376" LastEditorUserId="8376" LastEditDate="2015-06-29T16:15:35.227" LastActivityDate="2016-01-07T03:54:07.407" Title="Why does the font height change when bold?" Tags="|faces|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13028" PostTypeId="2" ParentId="13023" CreationDate="2015-06-09T10:59:50.523" Score="4" Body="&lt;p&gt;Via &lt;a href=&quot;https://stackoverflow.com/questions/2010158/setting-an-emacs-background-image&quot;&gt;StackOverflow → Setting an Emacs background image&lt;/a&gt;, I found &lt;a href=&quot;https://github.com/wachikun/emacs_bgex&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/wachikun/emacs_bgex&lt;/a&gt; which will allow you to set background images.  Although it's an indirect method, if you can generate the image with CSS rules then you can now include it in Emacs BGex (i.e. a patched version of Emacs).  For the image generating step, there's a tip posted at &lt;a href=&quot;https://stackoverflow.com/questions/11814013/css-creating-textured-backgrounds&quot;&gt;StackOverflow → CSS: Creating textured backgrounds&lt;/a&gt;, which points to &lt;a href=&quot;http://lea.verou.me/css3patterns/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lea.verou.me/css3patterns/&lt;/a&gt;, where some images are specified like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;background-color:silver;&#xA;background-image: &#xA;radial-gradient(circle at 100% 150%, silver 24%, white 25%, white 28%, silver 29%, silver 36%, white 36%, white 40%, transparent 40%, transparent),&#xA;radial-gradient(circle at 0    150%, silver 24%, white 25%, white 28%, silver 29%, silver 36%, white 36%, white 40%, transparent 40%, transparent),&#xA;radial-gradient(circle at 50%  100%, white 10%, silver 11%, silver 23%, white 24%, white 30%, silver 31%, silver 43%, white 44%, white 50%, silver 51%, silver 63%, white 64%, white 71%, transparent 71%, transparent),&#xA;radial-gradient(circle at 100% 50%, white 5%, silver 6%, silver 15%, white 16%, white 20%, silver 21%, silver 30%, white 31%, white 35%, silver 36%, silver 45%, white 46%, white 49%, transparent 50%, transparent),&#xA;radial-gradient(circle at 0    50%, white 5%, silver 6%, silver 15%, white 16%, white 20%, silver 21%, silver 30%, white 31%, white 35%, silver 36%, silver 45%, white 46%, white 49%, transparent 50%, transparent);&#xA;background-size:100px 50px;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'd have to convert that to an image format that emacs_bgex understands, for example by taking a screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/O35ZN.jpg&quot; alt=&quot;possible emacs background&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-06-10T17:07:53.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13029" PostTypeId="1" AcceptedAnswerId="19413" CreationDate="2015-06-09T12:36:47.237" Score="5" ViewCount="1334" Body="&lt;p&gt;My Emacs 24.5.1 is not responding frequently recently on my MacBook Pro Yosemite 10.10.3. I have installed it from &lt;a href=&quot;http://emacsformacosx.com&quot;&gt;emacs for mac osx&lt;/a&gt;. Emacs window does not open, it shows Not Responding in the Activity Monitor. Sometimes it launches successfully without all these symptoms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can be the reason for this? Is the latest version of the Emacs is buggy for mac or there is a different known reason for that?&lt;/p&gt;&#xA;" OwnerUserId="8514" LastActivityDate="2016-01-10T18:19:34.087" Title="Emacs Not Responding on launch on Mac OS X" Tags="|init-file|" AnswerCount="1" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="13030" PostTypeId="2" ParentId="12367" CreationDate="2015-06-09T13:39:20.800" Score="1" Body="&lt;p&gt;You can promote tags on &lt;code&gt;org-publish&lt;/code&gt; by specifying a &lt;code&gt;preparation-function&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-prepare-export-literature (backend)&#xA;  &quot;Remove sections with :Goal|Strategy|Notes|Text: tag,&#xA;  remove headings from sections with :Literature|References: tag and &#xA;  promote sections with :Reference: tag.&quot;&#xA;  (show-all)&#xA;  (org-map-entries (lambda () (let ((beg (point)))&#xA;                                (outline-next-visible-heading 1)&#xA;                                (backward-char)&#xA;                                (delete-region beg (point))))&#xA;                   &quot;Goal|Strategy|Notes|Text&quot; tree)&#xA;  (org-map-entries (lambda () (delete-region (point-at-bol) (point-at-eol)))&#xA;                   &quot;Literature|References&quot;)&#xA;  (org-map-entries (lambda () (org-promote))&#xA;                   &quot;Reference&quot;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-map-entries&lt;/code&gt; matches all sections having a given tag and executes the lambda function on them. Within this it's possible to simply call &lt;code&gt;org-promote&lt;/code&gt;, &lt;code&gt;org-demote&lt;/code&gt; or &lt;code&gt;org-promote-subtree&lt;/code&gt; and &lt;code&gt;org-demote-subtree&lt;/code&gt; correspondingly. This function is then registered as a &lt;code&gt;preparation function&lt;/code&gt; as shown in the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code to remove of sections and to remove headings is left for completeness. The call to &lt;code&gt;show-all&lt;/code&gt; is required because hidden sections are removed when they appear after a section that should be removed. It is only effective in the internal buffer and will not change visibility in the user's frame.&lt;/p&gt;&#xA;" OwnerUserId="6890" LastEditorUserId="6890" LastEditDate="2015-06-09T13:58:51.513" LastActivityDate="2015-06-09T13:58:51.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13031" PostTypeId="2" ParentId="12367" CreationDate="2015-06-09T14:42:32.163" Score="1" Body="&lt;p&gt;Check your &lt;code&gt;org-export-headline-levels&lt;/code&gt; variable, it is probably set to 5, should be set to 2 or 3 to get rid of the extra starts. It will improve the readability a lot I think. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I don't understand &lt;code&gt;org-publish&lt;/code&gt; mechanism, but the following workflow can solve the distributing problem as well: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;search-forward&lt;/code&gt; to locate headline, and do all sort of editing, then pass the start and end point of the subtree to...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;write-region&lt;/code&gt; to append/write the subtree to a file which depends on the keywords just being searched in step 1. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;do 1. and 2. for different headlines, &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;wrap 3. in a while loop to make sure it apply to the whole buffer. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4044" LastActivityDate="2015-06-09T14:42:32.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13032" PostTypeId="2" ParentId="3387" CreationDate="2015-06-09T14:53:39.223" Score="3" Body="&lt;p&gt;Based on the answer from thisirs, I am using the following with success.  The scale factor in this example is 2.3:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun update-org-latex-fragment-scale ()&#xA;  (let ((text-scale-factor (expt text-scale-mode-step text-scale-mode-amount)))&#xA;    (plist-put org-format-latex-options :scale (* 2.3 text-scale-factor)))&#xA;)&#xA;(add-hook 'text-scale-mode-hook 'update-org-latex-fragment-scale)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I have removed the code that toggles the preview, since I prefer to do that manually, and it can take a while if there are many fragments to preview.  This code only adjusts the scale of previewed fragments, so that the next time they are displayed using &lt;code&gt;C-c C-x C-l&lt;/code&gt;, they will have an appropriate size that matches the text.&lt;/p&gt;&#xA;" OwnerUserId="8541" LastActivityDate="2015-06-09T14:53:39.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13033" PostTypeId="2" ParentId="13019" CreationDate="2015-06-09T16:01:28.843" Score="1" Body="&lt;p&gt;I managed to solve like below, thanks to Drew's answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; use undo-tree.el&#xA;(defun my-ediff-undo-A ()&#xA;  (interactive)&#xA;  (save-window-excursion (with-selected-window ediff-window-A (undo-tree-undo))))&#xA;(defun my-ediff-undo-B ()&#xA;  (interactive)&#xA;  (save-window-excursion (with-selected-window ediff-window-B (undo-tree-undo))))&#xA;(defun my-ediff-redo-A ()&#xA;  (interactive)&#xA;  (save-window-excursion (with-selected-window ediff-window-A (undo-tree-redo))))&#xA;(defun my-ediff-redo-B ()&#xA;  (interactive)&#xA;  (save-window-excursion (with-selected-window ediff-window-B (undo-tree-redo))))&#xA;&#xA;(defadvice ediff-setup-keymap (around my-ediff-undo activate)&#xA;  ad-do-it&#xA;  (define-key ediff-mode-map (kbd &quot;C-a&quot;) 'my-ediff-undo-A)&#xA;  (define-key ediff-mode-map (kbd &quot;C-b&quot;) 'my-ediff-undo-B)&#xA;  (define-key ediff-mode-map (kbd &quot;M-a&quot;) 'my-ediff-redo-A)&#xA;  (define-key ediff-mode-map (kbd &quot;M-b&quot;) 'my-ediff-redo-B))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8537" LastActivityDate="2015-06-09T16:01:28.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13034" PostTypeId="2" ParentId="13019" CreationDate="2015-06-09T16:15:20.120" Score="6" Body="&lt;p&gt;&lt;code&gt;ediff-mode&lt;/code&gt; has built-in bindings to apply and revert diff hunks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you are running ediff between files/buffers A and B.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To copy A's region to B, press &lt;code&gt;a&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;To undo that, i.e. to restore the original region in buffer B, do &lt;code&gt;rb&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Similarly&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To copy B's region to A, press &lt;code&gt;b&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;To undo that, i.e. to restore the original region in buffer A, do &lt;code&gt;ra&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;While the ediff is in progress, you can hit &lt;code&gt;?&lt;/code&gt; to know more bindings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      Move around      |      Toggle features      |        Manipulate&#xA;  =====================|===========================|=============================&#xA;  p,DEL -previous diff |     | -vert/horiz split   |a/b -copy A/B's region to B/A&#xA;  n,SPC -next diff     |     h -highlighting       | rx -restore buf X's old diff&#xA;      j -jump to diff  |     @ -auto-refinement    |  * -refine current region&#xA;     gx -goto X's point|    ## -ignore whitespace  |  ! -update diff regions&#xA;    C-l -recenter      |    #c -ignore case        |&#xA;    v/V -scroll up/dn  | #f/#h -focus/hide regions | wx -save buf X&#xA;    &amp;lt;/&amp;gt; -scroll lt/rt  |     X -read-only in buf X | wd -save diff output&#xA;      ~ -swap variants |     m -wide display       |&#xA;  =====================|===========================|=============================&#xA;      R -show registry |     = -compare regions    |  M   -show session group&#xA;      D -diff output   |     E -browse Ediff manual|  G   -send bug report&#xA;      i -status info   |     ? -help off           |  z/q -suspend/quit&#xA;  -------------------------------------------------------------------------------&#xA;  For help on a specific command:  Click Button 2 over it; or&#xA;                                   Put the cursor over it and type RET.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-06-09T16:15:20.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13035" PostTypeId="2" ParentId="13004" CreationDate="2015-06-09T16:56:42.513" Score="8" Body="&lt;p&gt;When using eval with Emacs file-specific variables, then any valid lisp function can be specified at the end of the file as shown here:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; eval: (myFunction arg1 arg2)&#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you need variable arguments based on org-mode features, then you can combine the above with &lt;a href=&quot;http://orgmode.org/manual/In_002dbuffer-settings.html#In_002dbuffer-settings&quot; rel=&quot;nofollow noreferrer&quot;&gt;in-buffer settings&lt;/a&gt; available for org-mode files.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="2494" LastEditDate="2021-07-27T21:21:34.487" LastActivityDate="2021-07-27T21:21:34.487" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="13036" PostTypeId="1" CreationDate="2015-06-09T17:52:18.627" Score="8" ViewCount="3338" Body="&lt;p&gt;My org file looks something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Space Radiation&#xA;** Gamma Ray Info &#xA;   - file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf&#xA;   - some notes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However the title has spaces so the link stops at the first space. As I have literally thousands of collected papers and books that spaces in the name, adding %20 or even '+' to fill the space is a major task and also makes the linked document title difficult to read especially if you have several lines of such links.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to work around this without having to change all the file names to convert or delete the spaces in the file name?&lt;/p&gt;&#xA;" OwnerUserId="8449" LastEditorUserId="8406" LastEditDate="2015-06-12T21:21:36.053" LastActivityDate="2015-06-12T21:21:36.053" Title="Create a file link in org-mode that accepts spaces in the text" Tags="|org-mode|customize|hyperlinks|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13037" PostTypeId="2" ParentId="13036" CreationDate="2015-06-09T19:00:55.343" Score="16" Body="&lt;p&gt;If you put the links in a file using org-mode (e.g. ending in .org), you can create links like this by:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;[[file:d:/path/to/filename with spaces]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm assuming you are on Windows, and this works for on Windows 8, Emacs 24.4.1.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="115" LastEditDate="2015-06-10T19:41:38.290" LastActivityDate="2015-06-10T19:41:38.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13038" PostTypeId="1" AcceptedAnswerId="13039" CreationDate="2015-06-09T19:06:22.277" Score="1" ViewCount="97" Body="&lt;p&gt;I think that question explains it all. I tried changing highlight face but nothing happened. &lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2015-06-09T19:10:04.700" Title="How do I change the background highlight color for a selection I marked with C-Spacebar?" Tags="|syntax-highlighting|highlighting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13039" PostTypeId="2" ParentId="13038" CreationDate="2015-06-09T19:10:04.700" Score="2" Body="&lt;p&gt;That face you need to change is the &lt;code&gt;region&lt;/code&gt; face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The area you highlight with &lt;kbd&gt;C-space&lt;/kbd&gt; is known as the region and is highlighted with a face of the name &lt;code&gt;region&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-06-09T19:10:04.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13040" PostTypeId="1" AcceptedAnswerId="13042" CreationDate="2015-06-09T19:39:20.500" Score="3" ViewCount="490" Body="&lt;p&gt;I would like expand-abbrev to operate differently depending on what is just after the abbreviation to be expanded.  In particular, if there is a space after the cursor, then expand-abbrev should not insert an additional space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example (assuming &lt;code&gt;|&lt;/code&gt; is the cursor, &lt;code&gt;_&lt;/code&gt; is a space, &lt;code&gt;a&lt;/code&gt; expands into &lt;code&gt;alpha&lt;/code&gt;, and a space is typed):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;insertion at the end of line:          a|      --&amp;gt; alpha_&#xA;insertion in the middle of a sentence: a| beta --&amp;gt; alpha_beta (not alpha__beta)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-06-10T13:04:56.547" Title="do not insert space after abbreviation if there's a space already there" Tags="|abbrev|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13041" PostTypeId="1" AcceptedAnswerId="13046" CreationDate="2015-06-09T20:00:48.200" Score="4" ViewCount="307" Body="&lt;p&gt;I was not very statisfied with the leading zero that I got in my insert-date function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks now as &lt;code&gt;09 jun 2015&lt;/code&gt;, instead &lt;code&gt;9 jun 2015&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this, I looked into the source code of &lt;a href=&quot;https://github.com/magnars/s.el#s-right-len-s&quot; rel=&quot;nofollow&quot;&gt;s.el&lt;/a&gt; and wrote a function for it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-date ()&#xA;  &quot;Insert current date 1 jun yyyy.&quot;&#xA;  (interactive)&#xA;  (insert&#xA;   (if (string-prefix-p &quot;0&quot; (format-time-string &quot;%d&quot;))   ;; Checks if there is a leding zero. &#xA;       (s-right (format-time-string &quot;%d&quot;) 1)             ;; If so, chop it off with the library s, then s-right. &#xA;     (format-time-string &quot;%d&quot;))                          ;; If not (for example, 10, 12, 25, 31), let it so. &#xA;   (format-time-string &quot;%b %Y&quot;))                         ;; Then the rest (jun 2015). &#xA;  ) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After some tweaking, I still got the same error that there is a wrong type argument in sequencep 1. But I couldn't figure out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anybody have the golden hint? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="97" LastEditDate="2015-06-09T21:21:43.997" LastActivityDate="2015-06-09T21:44:12.797" Title="How do I format dates without padding the values?" Tags="|functions|string|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13042" PostTypeId="2" ParentId="13040" CreationDate="2015-06-09T20:06:33.513" Score="5" Body="&lt;p&gt;You could use a &lt;code&gt;pre-abbrev-expand-hook&lt;/code&gt; to delete the extra space before the abbrev is expanded like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-preceding-space-before-expand ()&#xA;  (when (and (= (char-after) ?\s)&#xA;             ;; only do if expanded with space&#xA;             (= last-command-event ?\s)&#xA;             (abbrev--before-point))&#xA;    (message &quot;%S&quot; last-command-event)&#xA;    (delete-char 1)))&#xA;&#xA;(add-hook 'pre-abbrev-expand-hook 'delete-preceding-space-before-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Expanding on the given code:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code above is written to only work when abbrevs are expanded with &lt;kbd&gt;space&lt;/kbd&gt; you could also modify this to work with any non-word character so that something like &lt;code&gt;a|-bar&lt;/code&gt; expanded with &lt;kbd&gt;-&lt;/kbd&gt; would expand to &lt;code&gt;alpha-bar&lt;/code&gt; instead of &lt;code&gt;alpha--bar&lt;/code&gt; which would be useful in lisps and elsewhere. You could do this by comparing &lt;code&gt;(char-after)&lt;/code&gt; and &lt;code&gt;last-command-event&lt;/code&gt; for equality instead of checking if they are space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to delete all existing spaces (not just one) and ensure there is only a single space between the expansion and the next word, you could replace &lt;code&gt;(delete-char 1)&lt;/code&gt; in the function with &lt;code&gt;(just-one-space 0)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way &lt;code&gt;a|          foobar&lt;/code&gt; would expand to &lt;code&gt;alpha foobar&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-06-10T13:04:56.547" LastActivityDate="2015-06-10T13:04:56.547" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13043" PostTypeId="1" CreationDate="2015-06-09T20:17:57.697" Score="6" ViewCount="943" Body="&lt;p&gt;As every tinkerer will know, my Emacs configuration is steadily growing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a some sense of having a structure, I divided it in seperated files, each for every category. But I noticed lately that some people organize their configuration in an different way than I do.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose they have the confiugration &lt;code&gt;foo-configuration.el&lt;/code&gt;, they put &lt;code&gt;(provide 'foo-configuration)&lt;/code&gt; at the bottom of the file.&#xA;In their &lt;code&gt;dot-emacs/init.el&lt;/code&gt; they call the configuration with &lt;code&gt;(require 'foo-configuration)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I do it in the other way. I create &lt;code&gt;bar-configuration.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;dot-emacs/init.el&lt;/code&gt;, I call the configuration with &lt;code&gt;(load &quot;C:/Dropbox/Emacs/bar-configuration.el&quot;)&lt;/code&gt; which suits my needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm wondering if I'm missing something important (I'm relatively new to Elisp).&#xA;Is there any advantage to use &lt;code&gt;provide/require&lt;/code&gt; above the latter?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-06-09T20:48:39.697" LastActivityDate="2015-06-09T21:10:18.503" Title="What is the preferred structure of Emacs configuration?" Tags="|elisp|" AnswerCount="1" CommentCount="4" ClosedDate="2015-06-10T02:21:48.517" ContentLicense="CC BY-SA 3.0" />
  <row Id="13044" PostTypeId="2" ParentId="13041" CreationDate="2015-06-09T20:29:58.083" Score="0" Body="&lt;p&gt;The user &lt;code&gt;nanny&lt;/code&gt; solved it with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(string-trim (format-time-string &quot;%e %b %Y&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't wanted the &lt;code&gt;%e&lt;/code&gt; becauses it added a space. But I never knew the function &lt;code&gt;string-trim&lt;/code&gt; chops the spaces off.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-06-09T20:29:58.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13045" PostTypeId="2" ParentId="13043" CreationDate="2015-06-09T20:30:39.717" Score="5" Body="&lt;p&gt;&lt;code&gt;require/provide&lt;/code&gt; &gt; &lt;code&gt;load&lt;/code&gt; but neither solution is ideal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should typically never need to &lt;code&gt;require&lt;/code&gt; or &lt;code&gt;load&lt;/code&gt; anything in your init. Rather you should add the path to your configuration files to the &lt;code&gt;load-path&lt;/code&gt; variable and autoload any functions you might bind or add to hook variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you have &lt;code&gt;my-config.el&lt;/code&gt; in &lt;code&gt;/foo/bar/baz/my-config.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; my-config.el&#xA;&#xA;;;;###autoload&#xA;(defun my-super-command ()&#xA;  (interactive) ...)&#xA;&#xA;;;;###autoload&#xA;(defun my-c-mode-hook ()&#xA;  (progn ...))&#xA;&#xA;(provide 'my-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your init should look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; init.el&#xA;&#xA;(add-to-list 'load-path &quot;/foo/bar/baz/&quot;)&#xA;&#xA;(add-hook 'c-mode-hook 'my-c-mode-hook)&#xA;&#xA;(global-set-key (kbd &quot;C-c C-j&quot;) 'my-super-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your custom top level commands should be autoloaded so there is no need to &lt;code&gt;require&lt;/code&gt; or &lt;code&gt;load&lt;/code&gt; your config file. It will be loaded automatically when the command is executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also non-interactive functions you may use for hooks or other purposes can be autoloaded as well, so in this case when you your config file will be loaded automatically when &lt;code&gt;c-mode&lt;/code&gt; starts up because the hook function is autoloaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to load the absolute least amount of code on startup as possible. Anything that is major mode or package specific should be in a autoloaded major-mode/package hook or wrapped in &lt;code&gt;eval-after-load&lt;/code&gt; in your init.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, if you want to decide simply between &lt;code&gt;load&lt;/code&gt; and &lt;code&gt;require/provide&lt;/code&gt;, I think most would agree &lt;code&gt;require/provide&lt;/code&gt; is the &lt;em&gt;more correct&lt;/em&gt; solution.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-06-09T20:59:57.577" LastActivityDate="2015-06-09T20:59:57.577" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13046" PostTypeId="2" ParentId="13041" CreationDate="2015-06-09T21:08:30.960" Score="5" Body="&lt;p&gt;If you look in the documentation for &lt;code&gt;#'format-time-string&lt;/code&gt; (try &lt;code&gt;C-h f format-time-string&lt;/code&gt;), it explains &lt;code&gt;%d&lt;/code&gt; and &lt;code&gt;%e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%d is the day of the month, zero-padded, %e is blank-padded.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it also goes on to say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Certain flags and modifiers are available with some format controls.&#xA;The flags are `_', `-', `^' and `#'.  For certain characters X,&#xA;%_X is like %X, but padded with blanks; %-X is like %X,&#xA;but without padding.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So let's try it!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((time (date-to-time &quot;June 9 12:00 2015&quot;)))&#xA;  (format-time-string &quot;%-e %b %Y&quot; time))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in &lt;code&gt;9 Jun 2015&lt;/code&gt;, with no padding at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The flag &lt;code&gt;-&lt;/code&gt; is easier than trimming the string, as it also works if you want to use a numeric value inside the string, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((time (date-to-time &quot;June 9 12:00 2015&quot;)))&#xA;  (format-time-string &quot;%-e/%-m/%Y&quot; time))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in &lt;code&gt;9/6/2015&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-06-09T21:44:12.797" LastActivityDate="2015-06-09T21:44:12.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13048" PostTypeId="1" CreationDate="2015-06-09T21:13:37.180" Score="18" ViewCount="2168" Body="&lt;h1&gt;Background&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I use emacs daily, but mostly to get things done. I don't really like&#xA;customising it more than adding packages and I don't like&#xA;troubleshooting. I want emacs to fade into the background the way a&#xA;good OS does and just get on with things. A while ago I found that&#xA;&lt;code&gt;el-get&lt;/code&gt; allowed me to install the packages that I needed which were&#xA;unavailable with &lt;code&gt;package.el&lt;/code&gt; and also gave me more control such as&#xA;selecting the &lt;code&gt;maint&lt;/code&gt; branch of Org-mode rather than the bleeding edge&#xA;which can cause temporary problems. Now I'm not sure if I should be&#xA;using &lt;code&gt;el-get&lt;/code&gt; or not.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;el-get&lt;/code&gt; seemed to be a great solution to the various repositories and&#xA;emacs hacks out there. It offered capabilities which were simply not&#xA;possible with &lt;code&gt;package.el&lt;/code&gt;. Now that &lt;code&gt;package.el&lt;/code&gt; in newer versions of&#xA;emacs (&lt;code&gt;&amp;gt;=24.4&lt;/code&gt;) supports multiple repositories, what are the use cases for &lt;code&gt;el-get&lt;/code&gt; and similar alternatives to emacs's built-in package manager?&lt;/p&gt;&#xA;" OwnerUserId="8518" LastEditorUserId="8518" LastEditDate="2015-06-10T21:17:05.377" LastActivityDate="2017-07-13T03:45:12.960" Title="What are the use cases of alternative package managers vis-à-vis `package.el`?" Tags="|package|package-repositories|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13049" PostTypeId="2" ParentId="13048" CreationDate="2015-06-09T21:53:40.663" Score="9" Body="&lt;p&gt;There are things that are still impossible with ELPA, and there are things that will always be impossible with ELPA, because they do not fit into the concept of ELPA: You'll never be able to install a specific commit by its hash from a forked repository.  Likewise, you'll never be able to apply custom local patches to a package before installing it.  These features are simply beyond the scope of ELPA, and if you need them, you'll have to use an alternative package manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think, though, that el-get is kind of a legacy solution nowadays. Given that ELPA has become the de-facto standard package manager for Emacs, alternative packages managers should seamlessly integrate with ELPA.  el-get, however, does not expose its own packages to ELPA, meaning that its packages are entirely invisible to ELPA and ELPA packages can never depend on el-get packages, with obvious implications for dependency management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need features beyond ELPA, you should nowaday look at QUELPA rather than el-get.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-06-10T10:42:45.430" LastActivityDate="2015-06-10T10:42:45.430" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13050" PostTypeId="1" AcceptedAnswerId="13053" CreationDate="2015-06-09T22:11:34.137" Score="19" ViewCount="10771" Body="&lt;p&gt;I am running emacs (24.5.1) on Mac osx and using the solarized theme. For the gui version, the theme works well. If I run the application with the -nw flag:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Applications/Emacs.app/Contents/MacOS/Emacs -nw&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the colors for the theme get all wonky. I assume this is because:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TERM=xterm-256color&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What would I need to put in my .emacs to give the following conditional behavior:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (gui)&#xA;  theme=solarized&#xA;if (-nw)&#xA;  theme=wheatgrass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;??&lt;/p&gt;&#xA;" OwnerUserId="8546" LastActivityDate="2015-09-21T13:12:28.460" Title="Different theme for -nw (terminal)" Tags="|themes|terminal-emacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13051" PostTypeId="2" ParentId="13048" CreationDate="2015-06-09T23:09:38.403" Score="4" Body="&lt;p&gt;While there are pros and cons, I think that el-get is still relevant, despite the strong opinions of @lunaryon (rejeep too).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used raw &lt;em&gt;package.el&lt;/em&gt; with &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt; for a while (2 to 3 years), then switched to &lt;em&gt;el-get&lt;/em&gt;, then &lt;em&gt;Cask&lt;/em&gt;. I went back to el-get few days ago. Prior &lt;em&gt;package.el&lt;/em&gt;, like many others, I was manually handling add-ons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why did I go back to &lt;em&gt;el-get&lt;/em&gt;? I encountered some &lt;em&gt;Cask&lt;/em&gt; weirdness about something not being a git repo (a Github package of mine which is not in MELPA), while that package is actually using git... I didn't bother investigating or creating a ticket, just pulled my old &lt;em&gt;el-get&lt;/em&gt; config and I was good to go in no time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Few things that I like about &lt;em&gt;el-get&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It supports multiple fetchers, not just git.&lt;/li&gt;&#xA;&lt;li&gt;It contains enough pre-defined recipes&lt;/li&gt;&#xA;&lt;li&gt;Faster than &lt;em&gt;Cask&lt;/em&gt; on startup.&lt;/li&gt;&#xA;&lt;li&gt;and yes @lunaryorn, the Wiki is not a place to distribute code, still I don't want to create a Github repo if there's no clone on &lt;a href=&quot;https://github.com/emacsmirror&quot; rel=&quot;nofollow&quot;&gt;emacsmirror&lt;/a&gt; (Github).&lt;/li&gt;&#xA;&lt;li&gt;Self contained, with &lt;em&gt;Cask&lt;/em&gt; you need an external installation. I use a single init file(not a modular configuration) with &lt;a href=&quot;http://www.emacswiki.org/emacs/AllOut&quot; rel=&quot;nofollow&quot;&gt;allout-mode&lt;/a&gt; to navigate through sections.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;el-get&lt;/em&gt; is simple enough from a user perspective.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note: I'm running Emacs Git HEAD under OSX and Linux.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="943" LastActivityDate="2015-06-09T23:09:38.403" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13053" PostTypeId="2" ParentId="13050" CreationDate="2015-06-09T23:29:24.640" Score="31" Body="&lt;p&gt;Use &lt;code&gt;display-graphic-p&lt;/code&gt; to determine if Emacs is in a GUI or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming solarized is installed and loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(if (display-graphic-p) &#xA;    (enable-theme 'solarized) &#xA;  (enable-theme 'wheatgrass))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;https://emacs.stackexchange.com/questions/7151/is-there-a-way-to-detect-that-emacs-is-running-in-a-terminal&quot;&gt;Is there a way to detect that emacs is running in a terminal?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-09-21T13:12:28.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13054" PostTypeId="2" ParentId="12909" CreationDate="2015-06-10T01:58:08.807" Score="4" Body="&lt;p&gt;Read the source code of &lt;code&gt;volatile-highlights&lt;/code&gt; and you'll find you don't need advice at all, supporting any command is built into &lt;code&gt;volatile-highlights&lt;/code&gt;. All you need is two lines of code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(vhl/define-extension 'my-evil-highlights 'evil-yank 'evil-move 'some-other-functions ...)&#xA;(vhl/install-extension 'my-evil-highlights)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Read the docs for the two functions above for more info.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-06-10T01:58:08.807" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13055" PostTypeId="1" AcceptedAnswerId="13136" CreationDate="2015-06-10T03:25:04.213" Score="10" ViewCount="1802" Body="&lt;p&gt;Is there a switch on org-mode I can use on export to ODT (or other format) to format my source file of&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a paragraph this is a paragraph this is a paragraph this is a&#xA;  paragraph this is a paragraph this is a paragraph this is a paragraph&#xA;  this is a paragraph this is a paragraph.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This is another paragraph this is another paragraph this is another&#xA;  paragraph this is another paragraph this is another paragraph this is&#xA;  another paragraph this is another paragraph this is another paragraph.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     This is a paragraph this is a paragraph this is a paragraph this is a&#xA;paragraph this is a paragraph this is a paragraph this is a paragraph&#xA;this is a paragraph this is a paragraph.&#xA;     This is another paragraph this is another paragraph this is another&#xA;paragraph this is another paragraph this is another paragraph this is&#xA;another paragraph this is another paragraph this is another paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2274" LastEditDate="2015-06-13T16:32:32.630" LastActivityDate="2022-02-25T14:53:57.197" Title="Org-mode export: indent first line of each paragraph, &quot;literary&quot; style" Tags="|org-mode|org-export|formatting|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13056" PostTypeId="2" ParentId="4121" CreationDate="2015-06-10T04:19:34.133" Score="2" Body="&lt;p&gt;The accepted answer from @legoscia works only some of the time. It does not work for control characters, including code points between 0 and 32. They don't have a &lt;code&gt;name&lt;/code&gt; in the Unicode database.  But they do have an &lt;code&gt;old-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Unicode, surrogate code points, private-use characters, control codes, noncharacters, and unassigned code points have no names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want to try in general is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(or (get-char-code-property SOME-CHAR 'name)&#xA;    (get-char-code-property SOME-CHAR 'old-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And keep in mind that some some code points do not even have an &lt;code&gt;old-name&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-10T04:19:34.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13057" PostTypeId="1" CreationDate="2015-06-10T08:02:19.860" Score="0" ViewCount="410" Body="&lt;p&gt;Evil-mode has some minor wrinkles and unexpected effects when used with a few other major and minor modes, including org-mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does Evil-mode, in Emacs 24.5, interfere with or reduce the functionality of python-mode.el? &lt;/p&gt;&#xA;" OwnerUserId="2008" LastEditorUserId="8406" LastEditDate="2015-06-10T12:54:11.630" LastActivityDate="2017-11-09T18:50:52.457" Title="Is evil-mode compatible with the `python-mode.el`?" Tags="|python|evil|" AnswerCount="1" CommentCount="7" ClosedDate="2015-06-10T16:57:46.737" ContentLicense="CC BY-SA 3.0" />
  <row Id="13058" PostTypeId="2" ParentId="12963" CreationDate="2015-06-10T08:25:58.653" Score="1" Body="&lt;p&gt;I can only respond to the 2nd part of your question.  Inline tasks are not part of the Org tree structure.  So it cannot be archived.  To archive them, you need to archive the parent tree.  A work around might be to create a temporary tree that contains the inline task and archive it.&lt;/p&gt;&#xA;" OwnerUserId="2093" LastActivityDate="2015-06-10T08:25:58.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13059" PostTypeId="2" ParentId="12928" CreationDate="2015-06-10T08:34:22.327" Score="4" Body="&lt;p&gt;As far as I can tell, this seems to be an issue of how wide your emacs frame is and maybe how large your font is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem goes away when I widen the emacs frame to around 760pixels. It turns into the three column version when you widen the frame further. &lt;img src=&quot;https://i.stack.imgur.com/z0WRK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8505" LastActivityDate="2015-06-10T08:34:22.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13060" PostTypeId="5" CreationDate="2015-06-10T10:16:02.127" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://web-mode.org&quot; rel=&quot;nofollow&quot;&gt;web-mode.el&lt;/a&gt; is a major mode for editing web templates, i.e. HTML documents with embedded client-side (CSS, Javascript, …) and server-side (PHP, JSP, ASP, ERB, Twig, Django, JSX, …) blocks.&lt;/p&gt;&#xA;" OwnerUserId="197" LastEditorUserId="25" LastEditDate="2015-06-10T12:52:21.377" LastActivityDate="2015-06-10T12:52:21.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13061" PostTypeId="4" CreationDate="2015-06-10T10:16:02.127" Score="0" Body="web-mode.el is a major mode for editing HTML templates containing parts (CSS, JavaScript) and blocks (server/client side engines)" OwnerUserId="197" LastEditorUserId="25" LastEditDate="2015-06-10T12:53:35.610" LastActivityDate="2015-06-10T12:53:35.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13062" PostTypeId="2" ParentId="13057" CreationDate="2015-06-10T10:29:20.820" Score="4" Body="&lt;p&gt;It should. In case of conflicts we are determined to solve them. Please report any issues here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gitlab.com/python-mode-devs/python-mode/issues&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gitlab.com/python-mode-devs/python-mode/issues&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="6807" LastEditDate="2017-11-09T18:50:52.457" LastActivityDate="2017-11-09T18:50:52.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13063" PostTypeId="2" ParentId="7274" CreationDate="2015-06-10T10:44:17.887" Score="4" Body="&lt;p&gt;I did it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dwim-backward-kill-word ()&#xA;  &quot;DWIM kill characters backward until encountering the beginning of a&#xA;word or non-word.&quot;&#xA;  (interactive)&#xA;  (if (thing-at-point 'word) (backward-kill-word 1)&#xA;    (let* ((orig-point              (point))&#xA;           (orig-line               (line-number-at-pos))&#xA;           (backward-word-point     (progn (backward-word) (point)))&#xA;           (backward-non-word-point (progn (goto-char orig-point) (backward-non-word) (point)))&#xA;           (min-point               (max backward-word-point backward-non-word-point)))&#xA;&#xA;      (if (&amp;lt; (line-number-at-pos min-point) orig-line) (progn (goto-char min-point) (end-of-line) (delete-horizontal-space))&#xA;        (delete-region min-point orig-point)&#xA;        (goto-char min-point))&#xA;      )))&#xA;&#xA;(defun backward-non-word ()&#xA;  &quot;Move backward until encountering the beginning of a non-word.&quot;&#xA;  (interactive)&#xA;  (search-backward-regexp &quot;[^a-zA-Z0-9\s\n]&quot;)&#xA;  (while (looking-at &quot;[^a-zA-Z0-9\s\n]&quot;)&#xA;    (backward-char))&#xA;  (forward-char))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8554" LastEditorUserId="8554" LastEditDate="2015-06-10T23:57:50.547" LastActivityDate="2015-06-10T23:57:50.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13064" PostTypeId="1" AcceptedAnswerId="13170" CreationDate="2015-06-10T12:19:37.720" Score="3" ViewCount="3616" Body="&lt;p&gt;I'm using Emacs with company and company-quickhelp. This works fine for Elisp and Clojure.&#xA;However, displaying the quickhelp popup (or function signature) in Python mode doesn't work. I installed company-jedi and have the following settings in my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-init-hook 'global-company-mode)&#xA;(company-quickhelp-mode 1)&#xA;&#xA;(defun my/python-mode-hook ()&#xA;(add-to-list 'company-backends 'company-jedi))&#xA;&#xA;(add-hook 'python-mode-hook 'my/python-mode-hook)&#xA;(add-hook 'python-mode-hook 'run-python-internal)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The quickhelp popup doesn't show and after pressing F1 the minibuffer says &quot;No documentation available&quot;. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="2757" LastEditorUserId="2757" LastEditDate="2015-06-15T12:51:44.123" LastActivityDate="2015-06-15T12:51:44.123" Title="Documentation for Python with company" Tags="|python|company-mode|documentation|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13065" PostTypeId="1" AcceptedAnswerId="13066" CreationDate="2015-06-10T12:22:35.557" Score="6" ViewCount="4399" Body="&lt;p&gt;I want to use syntax checking with Flycheck in my C++ projects, but the Clang checker fails to find the local file includes. For example, when I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#include &quot;foo/bar/x.h&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the file &lt;code&gt;foo2/y.cc&lt;/code&gt;, it reports an error that it couldn't find the include file. Both &lt;code&gt;foo/&lt;/code&gt; and &lt;code&gt;foo2/&lt;/code&gt; are in the project root. I can work around this by adding the following to a &lt;code&gt;.dir-locals.el&lt;/code&gt; file in the project:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((c++-mode .&#xA;     ( (flycheck-clang-include-path . &quot;/home/user/src/myproject&quot;) ) )&#xA;     ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I have dozens of projects and it would be a lot of work to set this for each directory. I'm using Projectile and I think it should be possible to set the include path based on the project root automatically, but I cannot find any variable or function in Projectile that would return the path to the current project.&lt;/p&gt;&#xA;" OwnerUserId="8412" LastEditorUserId="675" LastEditDate="2015-06-10T15:34:02.043" LastActivityDate="2015-06-11T10:32:20.807" Title="Automatically add project directory to flycheck clang/gcc include path" Tags="|projectile|flycheck|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13066" PostTypeId="2" ParentId="13065" CreationDate="2015-06-10T13:53:07.393" Score="8" Body="&lt;p&gt;Use &lt;code&gt;projectile-project-root&lt;/code&gt; to get the root path and add it to the list with a &lt;code&gt;c++-mode-hook&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun setup-flycheck-clang-project-path ()&#xA;  (let ((root (ignore-errors (projectile-project-root))))&#xA;    (when root&#xA;      (add-to-list &#xA;       (make-variable-buffer-local 'flycheck-clang-include-path)&#xA;       root)))&#xA;&#xA;(add-hook 'c++-mode-hook 'setup-flycheck-clang-project-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-06-10T14:34:15.543" LastActivityDate="2015-06-10T14:34:15.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13067" PostTypeId="1" AcceptedAnswerId="13071" CreationDate="2015-06-10T14:00:01.587" Score="6" ViewCount="770" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; is there an alternative to &lt;code&gt;save-excursion&lt;/code&gt; that only saves/restores point?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When writing elisp functions, I often need to save point, do some stuff in the current buffer, and then restore point.  I had always used &lt;code&gt;save-excursion&lt;/code&gt; for doing so, but the docstring notes that it will:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Save point, mark, and current buffer; execute BODY; restore those things.&#xA;  Executes BODY just like &lt;code&gt;progn&lt;/code&gt;.&#xA;  The values of point, mark and the current buffer are restored&#xA;  even in case of abnormal exit (throw or error).&#xA;  The state of activation of the mark is also restored.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now: that seems like overkill if all I care about is point and I'm not touching (or otherwise don't care about) the mark and current buffer.  In the absence of something like &lt;code&gt;save-point&lt;/code&gt;, I wrote the following macro:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro save-point (&amp;amp;rest body)&#xA;  (cl-declare (debug t) (indent 0))&#xA;  (let ((orig (cl-gensym)))&#xA;    `(let ((,orig (point-marker)))&#xA;       (unwind-protect&#xA;           (progn ,@body)&#xA;         (goto-char ,orig)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;save-excursion&lt;/code&gt; is written in C, so it wasn't a priori clear that this macro would be faster than the C code despite saving and restoring fewer objects.  And, in fact, it's about an order of magnitude slower:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark-run-compiled 1000&#xA;  (save-point t))                   ; =&amp;gt; .0005ish&#xA;&#xA;(benchmark-run-compiled 1000&#xA;  (save-excursion t))               ; =&amp;gt; .00005ish&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It currently looks like the macro is a fool's errand.  So:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does something like this &lt;code&gt;save-point&lt;/code&gt; macro already exist?&lt;/li&gt;&#xA;&lt;li&gt;How could one streamline this macro to speed it up?&lt;/li&gt;&#xA;&lt;li&gt;Is there any way to make up the speed difference between the C code and the elisp code?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-10T15:33:59.770" Title="Alternative to save-excursion that only saves/restores point?" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13068" PostTypeId="1" CreationDate="2015-06-10T14:33:37.563" Score="6" ViewCount="1735" Body="&lt;p&gt;I have a sentence. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I do gl in Evil normal modus, that sentence turns into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; EDH: foo bar&#xA;;; ------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I need to bind the keys &lt;code&gt;gl&lt;/code&gt; to a function, that will turn the sentence into the above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eventually I came up with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-define-operator my-comment (beg end)&#xA;  &quot;Comment selected lines.&quot;&#xA;  :motion evil-line  ;; in normal mode, no motion is read but the current line is used&#xA;  :type line         ;; this operator always works on whole lines&#xA;  (goto-char beg)&#xA;  (insert &quot;EDH: &quot;)&#xA;  (goto-char (+ 4 end))&#xA;  (let ((n (- (line-end-position) (line-beginning-position))))&#xA;    (newline)&#xA;    (insert-char ?- n)&#xA;    (comment-region beg (point))))&#xA;&#xA;(define-key evil-normal-state-map &quot;gl&quot; #'my-comment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows, e.g., to visually select some lines and then gl comments those lines and adds EDH: before the first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later I noticed another bug with this function. For example, I have the code formatted as following. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;start&#xA;    foo []&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[] = cursor. &#xA;So I toggle &lt;code&gt;my-comment&lt;/code&gt; on &lt;code&gt;foo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it will be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;start&#xA;;; EDH:    foo&#xA;------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is wrong, I need to make it like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;start&#xA;     ;; EDH: foo&#xA;     ------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The culprit is the  &lt;code&gt;(line-end-position) and (line-beginning-position)&lt;/code&gt;, with no respect for the indentation.&#xA;So I'm wondering if is there a Evil alternative or a built-in Emacs command, that returns the position of the &lt;code&gt;(evil-first-non-blank)&lt;/code&gt; and &lt;code&gt;(evil-end-of-line)&lt;/code&gt;, as well the postion of the first character in the line and the last characther in the line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-12-09T17:43:59.357" LastActivityDate="2016-12-09T17:43:59.357" Title="Is there a function that returns the position of the first and last non-whitespace characters in a line?" Tags="|elisp|indentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13069" PostTypeId="2" ParentId="13068" CreationDate="2015-06-10T14:46:01.907" Score="8" Body="&lt;p&gt;The function &lt;code&gt;current-indentation&lt;/code&gt; will return the column number of the first non whitespace character on the current line.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(current-indentation)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return the indentation of the current line. This is the horizontal&#xA;  position of the character following any initial whitespace.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want the character position of the first non whitespace character on the line you could use &lt;code&gt;(save-excursion (back-to-indentation) (point))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(backward-to-indentation &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move backward ARG lines and position at first nonblank character.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-06-10T14:46:01.907" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13070" PostTypeId="2" ParentId="13068" CreationDate="2015-06-10T15:03:17.447" Score="2" Body="&lt;p&gt;The following function returns a list of the point positions of the first and last non-whitespace characters on the current line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun line-bounds-nonwhitespace ()&#xA;  (save-excursion&#xA;    (goto-char (point-at-bol))&#xA;    (skip-syntax-forward &quot; &quot; (point-at-eol))&#xA;    (let ((beg (point)))&#xA;      (goto-char (point-at-eol))&#xA;      (skip-syntax-backward &quot; &quot; (point-at-bol))&#xA;      (list beg (point)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="25" LastEditDate="2015-06-10T17:30:58.820" LastActivityDate="2015-06-10T17:30:58.820" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13071" PostTypeId="2" ParentId="13067" CreationDate="2015-06-10T15:33:59.770" Score="4" Body="&lt;p&gt;You can always easily save and restore point yourself, using &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;unwind-protect&lt;/code&gt;. And you can roll that into your own macro, if you like. But why bother? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a reason that these things are saved &amp;amp; restored together by &lt;code&gt;save-excursion&lt;/code&gt;. Otherwise, you had better be sure about which buffer you want to restore the value of point for etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice: use &lt;code&gt;save-excursion&lt;/code&gt;. My guess is that it really costs nothing more than what you would code yourself to save &amp;amp; restore just point, and in fact will be quite a bit faster because it is coded in C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if &lt;code&gt;save-excursion&lt;/code&gt; were coded in Lisp it would be just two more &lt;code&gt;let&lt;/code&gt; bindings, one call to &lt;code&gt;current-buffer&lt;/code&gt;, one more &lt;code&gt;setq&lt;/code&gt; and a &lt;code&gt;set-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-10T15:33:59.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13072" PostTypeId="1" AcceptedAnswerId="13076" CreationDate="2015-06-10T15:40:29.990" Score="4" ViewCount="408" Body="&lt;p&gt;I have this advice in place that executes the called function over the whole buffer if a region is not selected. But I would also like to print a message that tells the user that the function they just called acted on the whole buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/whole-buffer-if-not-region (orig-fn &amp;amp;rest args)&#xA;  (save-excursion&#xA;    (if (region-active-p) ; do the default thing if a region is selected&#xA;        (apply orig-fn args)&#xA;      (let (fn-name) ; indent the whole buffer otherwise&#xA;        (apply orig-fn (list (point-min) (point-max)))&#xA;        (setq fn-name (cl-case (type-of orig-fn)&#xA;                        ('subr              (subr-name orig-fn))&#xA;                        ;; ('compiled-function (symbol-name orig-fn)) ; doesn't work&#xA;                        (t     orig-fn)))&#xA;        (message &quot;Executed %s on the whole buffer&quot; fn-name)))))&#xA;&#xA;(advice-add #'indent-region :around #'modi/whole-buffer-if-not-region)&#xA;(advice-add #'eval-region   :around #'modi/whole-buffer-if-not-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the above code,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If I do &lt;code&gt;M-x eval-region&lt;/code&gt; without selecting a region, I see the message &lt;code&gt;Executed eval-region on the whole buffer&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I would like to get a similar message when I do &lt;code&gt;M-x indent-region&lt;/code&gt; without selecting a region. &lt;code&gt;symbol-name&lt;/code&gt; does not work here as I learned that the &lt;code&gt;indent-region&lt;/code&gt; function is of the type &lt;code&gt;'compiled-function&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With the above code I get the below when I do &lt;code&gt;M-x indent-region&lt;/code&gt; without region selection:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Executed #[770 \211\203A \303!\262\212b\210\304 \262b\210n\204 \305y\210`W\2038 `\306\307w\210`|\210l\2042 \310\311&quot;\210\305y\210\202 \307\211\223\210)\202\324 \203u \212b\210\304 \262b\210\312!`W\203p \313!\204j n\203g l\204j c\210\305y\210\202S \210)\202\324    \203\201    &quot;\210\202\324 \212\314!\262b\210\315 ?\205\225 \316\317`#`W\203\305 n\203\243 l\204\246 \320 \210\305y\210\211\203\225 \211`\211\247\203\273 \211@Y\203\300 \321&quot;\210\266\202\225 \211\203\315 \322!\210\307\211\223\266)\323\211\207 [fill-prefix indent-region-function deactivate-mark prefix-numeric-value point-marker 1    nil indent-to 0 regexp-quote looking-at copy-marker minibufferp make-progress-reporter Indenting region... indent-according-to-mode progress-reporter-do-update progress-reporter-done t] 9 2037903 r&#xA;P] on the whole buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I extract the &lt;code&gt;compiled-function&lt;/code&gt; name (&lt;code&gt;indent-region&lt;/code&gt; in this case)?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;strong&gt;@abo-abo&lt;/strong&gt;'s solution below, I got this working as I wanted using the below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro modi/add-whole-buffer-if-not-region-advice (symbol)&#xA;  &quot;Advice SYMBOL function (that originally acts on a region) to act on the&#xA;whole buffer if a region is not selected.&quot;&#xA;  `(advice-add ,symbol :around (lambda (orig-fn &amp;amp;rest args)&#xA;                                 (save-excursion&#xA;                                   ;; Execute the original SYMBOL function if&#xA;                                   ;; it is called indirectly. Example: we do&#xA;                                   ;; not want to trigger this advice if&#xA;                                   ;; `eval-region' is called via `eval-defun'.&#xA;                                   (if (or (not (eq ,symbol this-command))&#xA;                                           (use-region-p))&#xA;                                       (apply orig-fn args)&#xA;                                     (apply orig-fn (list (point-min) (point-max)))&#xA;                                     (message &quot;Executed %s on the whole buffer&quot;&#xA;                                              (propertize&#xA;                                               (symbol-name ,symbol)&#xA;                                               'face&#xA;                                               'font-lock-function-name-face)))))))&#xA;&#xA;(modi/add-whole-buffer-if-not-region-advice #'indent-region)&#xA;(modi/add-whole-buffer-if-not-region-advice #'eval-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-06-11T13:35:19.640" LastActivityDate="2024-03-22T11:54:36.847" Title="How do I get the name (string) of a compiled function?" Tags="|elisp|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13074" PostTypeId="1" AcceptedAnswerId="14602" CreationDate="2015-06-10T15:50:49.993" Score="1" ViewCount="310" Body="&lt;p&gt;I got a situation here, that I couldn't get resolved with the maintainer of &lt;code&gt;web-mode&lt;/code&gt;. So I'm asking here, if anyone knows a good suggestion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, what I have here: &#xA;GNU Emacs GUI (version 24.4.51.1 (x86_64-w64-mingw32) &#xA;&lt;a href=&quot;https://bitbucket.org/Haroogan/emacs-for-windows/&quot; rel=&quot;nofollow noreferrer&quot;&gt;compiled from Harroogan Emacs.&lt;/a&gt;)&#xA;Packages web-mode and &lt;a href=&quot;http://emacswiki.org/emacs/AutomaticFileHeaders&quot; rel=&quot;nofollow noreferrer&quot;&gt;header2.el&lt;/a&gt;. &#xA;If you need more detail about header2, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/12559/how-to-detect-mode-then-execute&quot;&gt;right answer here on StackExchange&lt;/a&gt;. It's a great package, I really recommend it. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;header2.el lets you define file headers for different types of file (C, shell, EmacsLisp, and so on). You can automatically insert a header when you open a new file buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran into crashes, when I use web-mode in combination with header2.el. This is tested with an empty Emacs configuration (&lt;code&gt;emacs -q&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use header2.el in combination with PHP-mode, JS-mode, and HTML-mode, I don't run into crashes and everything works fine. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Action:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;First, you need to configure your emacs.d, in order to get the packages. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq user-emacs-directory &quot;C:/Dropbox/Emacs/.emacs.d/&quot;)&#xA;(add-to-list 'load-path &quot;C:\\Dropbox\\Emacs\\.emacs.d\\&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then do load the packages Web-mode and header2.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'header2)&#xA;(require 'web-mode) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you need to configure the header, and set it up to be automatic created when create a new file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq php-tag &quot;&amp;lt;?php \n \n&quot;)&#xA;(setq html-close-tag &quot; --&amp;gt; \n&quot;) &#xA;&#xA;(defsubst my/header-title ()&#xA;(insert&#xA;(if (eq major-mode 'php-mode)&#xA;php-tag&#xA;&quot; \n&quot;)&#xA;(concat comment-start  &quot; File &quot; (buffer-name))&#xA;(if (eq major-mode 'web-mode)&#xA;html-close-tag&#xA;&quot; \n&quot;)&#xA;&quot;\n&quot;))&#xA;&#xA;(setq make-header-hook '(my/header-title))&#xA;&#xA;(autoload 'auto-update-file-header &quot;header2&quot;)&#xA;(add-hook 'write-file-hooks 'auto-update-file-header)&#xA;&#xA;(autoload 'auto-make-header &quot;header2&quot;)&#xA;(add-hook 'html-mode-hook 'auto-make-header) &#xA;(add-hook 'web-mode-hook 'auto-make-header) &#xA;(add-hook 'php-mode-hook 'auto-make-header) &#xA;(add-hook 'js-mde-hook 'auto-make-header)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Errornous behavior:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I create in Emacs a new file, called &lt;code&gt;foobar.php&lt;/code&gt;. I get the header automatically inserted for me. And I can type around and press &lt;code&gt;RET&lt;/code&gt;. Everything works fine. Same for &lt;code&gt;foobar.js&lt;/code&gt; and &lt;code&gt;foobar.html&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I add &lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.html\\'&quot; . web-mode))&lt;/code&gt; to my setup. This means that when I open a HTML file, Web-mode will be enabled as a major mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I restart Emacs. Then I create a new file, called &lt;code&gt;foobar.html&lt;/code&gt;. The &lt;code&gt;.html&lt;/code&gt;-filetype is hooked on web-mode. When typing some characters and press &lt;code&gt;RET&lt;/code&gt;, this causes Emacs to freeze. Nothing is appearing in the &lt;code&gt;*Messages*&lt;/code&gt;-buffer. This will not happen, when I don't add the &lt;code&gt;.html&lt;/code&gt; extension to the &lt;code&gt;Web-mode&lt;/code&gt; on auto-mode-alist, and get &lt;code&gt;html-mode&lt;/code&gt;instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that autoheader is not a minor mode. It's a action hook, that insert the text when you enter a major mode. So I'm puzzled why it lets unrecoverrable crashing Emacs. It's a fairly simple package, after all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-08-08T22:23:22.307" Title="Why is autoheader crashing with web-mode?" Tags="|web-mode|auto-insert|header-line|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13075" PostTypeId="1" AcceptedAnswerId="13182" CreationDate="2015-06-10T15:56:06.247" Score="6" ViewCount="1803" Body="&lt;p&gt;I write my weekly report on Wednesdays. As such I need to see what I've done starting last Wednesday until now. (usually a Wednesday). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to create an Agenda view for this, so I can quickly flick between the weeks, but I cannot find a way of specifying '-7' days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried customizing &lt;code&gt;org-agenad-custom-commands&lt;/code&gt; and setting the days to '-7' but that only shows the current day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At present I generate a report for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :tstart &quot;&amp;lt;-6d&amp;gt;&quot; :tend &quot;&amp;lt;now&amp;gt;&quot; :scope agenda-with-archives :narrow 70 :formatter my-org-clocktable-notodo :maxlevel 3 :fileskip0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I can't find a way to transpose this to an Agenda custom view. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit solution]&lt;/strong&gt;&lt;br&gt;&#xA;As per lawlist's advise in the comment I got it to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) I customized &lt;code&gt;org-agenad-custom-commands&lt;/code&gt;, added an agenda view that shows &quot;Number of days in agenda&quot; = 8. I assigned &quot;W&quot; to this agenda view.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(org-agenda-custom-commands&#xA;   ....&#xA;     (&quot;W&quot; &quot;Last 8 days.&quot; agenda &quot;&quot;&#xA;      ((org-agenda-span 8)&#xA;  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) I then defined a function that temporarily defines the variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/agenda-last-week () &#xA;  (interactive)&#xA;  (let ((org-agenda-start-day &quot;-7d&quot;))&#xA;       (org-agenda nil &quot;W&quot;))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then assign a hotkey to that function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can view my last week Wednesday to Wednesday, (inc time-report).  I am happy.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-06-15T19:04:25.547" LastActivityDate="2015-06-15T19:04:25.547" Title="Agenda span of &quot;last 7 days&quot;" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13076" PostTypeId="2" ParentId="13072" CreationDate="2015-06-10T16:08:02.177" Score="1" Body="&lt;p&gt;You can't get the name from &lt;code&gt;orig-fn&lt;/code&gt;, since it's just a byte-compiled lambda, and you can't get a name of lambda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use something (simpler) instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;(defun modi-add-region-advice (symbol)&#xA;  (advice-add&#xA;   symbol&#xA;   :around (lambda (orig-fn &amp;amp;rest args)&#xA;             (save-excursion&#xA;               (if (region-active-p)&#xA;                   (apply orig-fn args)&#xA;                 (message &quot;Executed %s on the whole buffer&quot; symbol))))))&#xA;(modi-add-region-advice 'indent-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-10T16:08:02.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13077" PostTypeId="1" CreationDate="2015-06-10T17:37:25.377" Score="3" ViewCount="239" Body="&lt;p&gt;I've defined my own major mode using &lt;code&gt;define-generic-mode&lt;/code&gt;, and in the setup function I have &lt;code&gt;(set (make-local-variable 'indent-line-function) 'my-indent-function)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works fine in general code, however it is not called at all when I'm inside a comment, as defined by the syntax table with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; // Comments (style a)&#xA;(modify-syntax-entry ?\/ &quot;. 124&quot; (syntax-table))&#xA;(modify-syntax-entry ?\n &quot;&amp;gt; &quot; (syntax-table))&#xA;;; /* Comments (style b) */&#xA;(modify-syntax-entry ?* &quot;. 23b&quot; (syntax-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Either &lt;code&gt;// line comments&lt;/code&gt; or &lt;code&gt;/* Java comments */&lt;/code&gt; are allowed.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried setting &lt;code&gt;comment-line-break-function&lt;/code&gt; as I saw that it is set in Java mode, but this doesn't have any effect. I also tried setting &lt;code&gt;comment-indent-function&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, but again I couldn't see any effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Added example minimal repro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test, just run &lt;code&gt;emacs -Q&lt;/code&gt;, paste the following into a buffer and run &lt;code&gt;eval-buffer&lt;/code&gt;, then open &lt;code&gt;test.tmp&lt;/code&gt;. Every time you hit return not inside a comment you will see &quot;Called indent-line!&quot; in the mini-buffer. Inside a comment you will not. This is my question. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-generic-mode&#xA;    tmp-mode ; mode name&#xA;&#xA;  ;; comments&#xA;  nil&#xA;&#xA;  ;; keywords&#xA;  '(&quot;if&quot; &quot;then&quot; &quot;else&quot;)&#xA;&#xA;  ;; other things to highlight&#xA;  nil&#xA;&#xA;  ;; auto mode alist&#xA;  '(&quot;\\.tmp?$&quot;)&#xA;&#xA;  ;; other function to run&#xA;  (list 'tmp-mode--setup-function)&#xA;  &quot;A mode for tmp files&quot;)&#xA;&#xA;(defun tmp-mode--setup-function ()&#xA;  (modify-syntax-entry ?_ &quot;w&quot; (syntax-table))&#xA;  ;; // Comments (style a)&#xA;  (modify-syntax-entry ?\/ &quot;. 124&quot; (syntax-table))&#xA;  (modify-syntax-entry ?\n &quot;&amp;gt; &quot; (syntax-table))&#xA;  ;; /* Comments (style b) */&#xA;  (modify-syntax-entry ?* &quot;. 23b&quot; (syntax-table))&#xA;  (modify-syntax-entry ?@ &quot;_&quot; (syntax-table))&#xA;&#xA;  (set (make-local-variable 'indent-line-function) 'tmp-mode/indent-line))&#xA;&#xA;(defun tmp-mode/indent-line ()&#xA;  (message &quot;Called indent-line!&quot;))&#xA;&#xA;(provide 'tmp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="753" LastEditorUserId="753" LastEditDate="2015-06-12T15:31:24.223" LastActivityDate="2015-06-13T05:22:53.077" Title="Why doesn't electric-indent-mode indent in comments?" Tags="|indentation|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13078" PostTypeId="1" CreationDate="2015-06-10T18:22:06.917" Score="2" ViewCount="233" Body="&lt;p&gt;I am an avid &lt;code&gt;hippie-expand&lt;/code&gt; user but I find it annoying that it natively doesn't complete ruby symbols without the prefix. For example (cursor is &lt;code&gt;|&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class ApplicationController &amp;lt; ActionController::Base&#xA;  before_action :some_action&#xA;&#xA;  protected&#xA;&#xA;  def some_a|&#xA;&#xA;  end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I trigger &lt;code&gt;hippie-expand&lt;/code&gt; here, it doesn't know that &lt;code&gt;:some_action&lt;/code&gt; is also a completion option without the &lt;code&gt;:&lt;/code&gt; prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the cleanest way to extend &lt;code&gt;hippie-expand&lt;/code&gt; (or perhaps &lt;code&gt;dabbrev-expand&lt;/code&gt;) to do this?&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2015-06-11T16:40:23.840" Title="Use hippie-expand to complete ruby symbols without prefix" Tags="|completion|ruby-mode|dabbrev|hippie-expand|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13080" PostTypeId="1" AcceptedAnswerId="13096" CreationDate="2015-06-10T20:16:49.050" Score="39" ViewCount="8165" Body="&lt;p&gt;How do you reload  directory-local variables?  I would like to modify a &lt;code&gt;.dir-locals.el&lt;/code&gt; and have such changes applied to the current Emacs session.&lt;/p&gt;&#xA;" OwnerUserId="2763" LastActivityDate="2021-07-18T17:03:51.137" Title="Reloading directory-local variables" Tags="|directory-local-variables|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13081" PostTypeId="1" CreationDate="2015-06-10T21:27:29.520" Score="3" ViewCount="82" Body="&lt;p&gt;How can one search a specific name or a pattern for the name of a specific package on the package menu returned from &lt;code&gt;M-x list-packages&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In documentation it says type &lt;code&gt;f&lt;/code&gt;. but in my case it yields an empty table list of packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same question generally for filtering this table based on package name, keywords, version(equality,  and optional inequality expressions) , status, archive, namely the column names. &lt;/p&gt;&#xA;" OwnerUserId="8514" LastEditorUserId="8514" LastEditDate="2015-06-10T22:18:16.910" LastActivityDate="2015-07-11T01:07:15.510" Title="searching filtering comprehension in package table in Packages Menu" Tags="|package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13082" PostTypeId="2" ParentId="13081" CreationDate="2015-06-11T01:01:57.563" Score="1" Body="&lt;p&gt;&lt;strong&gt;&lt;code&gt;f&lt;/code&gt;&lt;/strong&gt; works for me.  Does it not work for you even if you start Emacs without your init file (i.e., &lt;code&gt;emacs -Q&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that works for you, then recursively bisect your init file to find out what is interfering.  You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment out a region of text (&lt;code&gt;C-u&lt;/code&gt; with the command uncomments the region). Comment out 1/2, then 3/4, 7/8, 15/16, 31/32,... - it is very quick to do (binary search).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-11T01:01:57.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13083" PostTypeId="1" AcceptedAnswerId="13084" CreationDate="2015-06-11T02:52:24.713" Score="1" ViewCount="1458" Body="&lt;p&gt;I've recently started using Org-mode, and when I last restarted Emacs, I got the error message &lt;code&gt;Symbol's function definition is void: org-agenda-skip-scheduled-if-done&lt;/code&gt;. Upon opening Emacs again using &lt;code&gt;--debug-init&lt;/code&gt;, I get the following backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function org-agenda-skip-scheduled-if-done)&#xA;  (org-agenda-skip-scheduled-if-done t)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/daniel/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 3069&#xA;  load-with-code-conversion(&quot;/home/daniel/.emacs.d/init.el&quot; &quot;/home/daniel/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/daniel/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;^H\205\262^@ ;; more stuff after this that wouldn't paste for some reason&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is likely referring to the following line in my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-skip-scheduled-if-done t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I comment this line out and evaluate it, I get the following backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function org-agenda-skip-scheduled-if-done)&#xA;  (org-agenda-skip-scheduled-if-done t)&#xA;  eval((org-agenda-skip-scheduled-if-done t) nil)&#xA;  eval-expression((org-agenda-skip-scheduled-if-done t) nil)&#xA;  call-interactively(eval-expression nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.3.1 on Ubuntu 14.04.2. I have no idea what's happening. Can anybody help?&lt;/p&gt;&#xA;" OwnerUserId="8561" LastEditorUserId="8561" LastEditDate="2015-06-11T03:15:15.070" LastActivityDate="2015-06-11T03:26:24.503" Title="&quot;Symbol's function definition is void: org-agenda-skip-scheduled-if-done&quot;" Tags="|org-mode|init-file|debugging|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13084" PostTypeId="2" ParentId="13083" CreationDate="2015-06-11T03:26:24.503" Score="6" Body="&lt;p&gt;That error means that you're trying to call a variable as if it was a function. Use &lt;code&gt;setq&lt;/code&gt; to change the value of a variable: &lt;code&gt;(setq org-agenda-skip-scheduled-if-done t)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-06-11T03:26:24.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13085" PostTypeId="1" CreationDate="2015-06-11T05:09:00.447" Score="2" ViewCount="46" Body="&lt;p&gt;I have been using artist-mode and noticed that even at moderate mouse movement speeds the mouse event polling rate (here for down-mouse-1) does not seem to keep up (so lines end up with scattered holes in them instead of being continous).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to modify or increase the mouse (down) button event polling rate?&lt;/p&gt;&#xA;" OwnerUserId="8554" LastActivityDate="2015-06-11T05:09:00.447" Title="Control or set the emacs mouse button event polling rate?" Tags="|mouse|events|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13086" PostTypeId="1" AcceptedAnswerId="16685" CreationDate="2015-06-11T06:02:00.790" Score="4" ViewCount="1177" Body="&lt;p&gt;I am trying to set up Gnus (on Emacs 24.5) on Windows to access Gmail through IMAP and it seems like the connection is choking when it attempt to connect to the IMAP server. (Seems like Gnus is not attempting to send authentication data, either.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It basically hangs while showing &quot;Opening TLS connection to `imap.googlemail.com'...done&quot; and I will have to Ctrl-G to stop it. (I left it for an hour and still didn't work, either.) For both situations where I tried to use gnutls-cli or openssl, it seems to be hanging in exactly the same places, where it seems to be the server is waiting for the client to talk to it, but Gnus never talks to it.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;* OK Gimap ready for requests from  e203mb4768837ita&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I thought it was something to do with .authfile being encrypted, but it seems like Gnus is not even trying to touch it, and didn't work when I tried it with the plain text outfield.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tls-program '(&quot;c:/Progra~2/Git/bin/openssl.exe s_client -connect %h:%p -no_ssl2 -ign_eof -CAfile c:/full/path/to/ca-bundle.crt&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The odd thing is same configuration works on Linux and Mac on the same network, just Windows machine that's having issues.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-secondary-select-methods&#xA;  '((nnimap &quot;server&quot;&#xA;            (nnimap-address &quot;imap.googlemail.com&quot;)&#xA;            (nnimap-server-port 993)&#xA;            (nnimap-stream ssl)&#xA;            (nnimap-authinfo-file &quot;~/.authinfo&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there something I can try to fix this, and/or suggestions/insights will be highly appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="580" LastEditorUserId="11" LastEditDate="2015-06-11T10:02:42.577" LastActivityDate="2015-11-23T18:49:15.817" Title="GnuTLS / OpenSSL hangs on Windows when accessing Gmail" Tags="|microsoft-windows|gnus|email|gnutls|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13087" PostTypeId="2" ParentId="13077" CreationDate="2015-06-11T09:38:48.650" Score="1" Body="&lt;p&gt;May reproduce your problem meanwhile - answer edited. While without &lt;code&gt;electric-indent-mode&lt;/code&gt; &lt;code&gt;indent-according-to-mode&lt;/code&gt; would call &lt;code&gt;indent-line-function&lt;/code&gt;- if &lt;code&gt;electric-indent-mode&lt;/code&gt; is on, no indent any more. IIUC it's worth a bug-report.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-06-13T05:22:53.077" LastActivityDate="2015-06-13T05:22:53.077" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13088" PostTypeId="2" ParentId="13065" CreationDate="2015-06-11T10:32:20.807" Score="1" Body="&lt;p&gt;You could wait for &lt;a href=&quot;http://github.com/flycheck/flycheck/pull/661&quot; rel=&quot;nofollow&quot;&gt;this pull request&lt;/a&gt; to get merged. This adds a new &lt;code&gt;clang-check&lt;/code&gt; based checker to flycheck. The main difference is the tooling supports a &lt;a href=&quot;http://clang.llvm.org/docs/JSONCompilationDatabase.html&quot; rel=&quot;nofollow&quot;&gt;compilation database&lt;/a&gt; which contains all the include paths (and defines and other compilation controls) for the file. This database can be automatically created with CMAKE or you can use a tool like &lt;a href=&quot;http://github.com/rizsotto/bear&quot; rel=&quot;nofollow&quot;&gt;bear&lt;/a&gt; to create it.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-06-11T10:32:20.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13089" PostTypeId="1" AcceptedAnswerId="13106" CreationDate="2015-06-11T11:04:54.927" Score="1" ViewCount="1009" Body="&lt;p&gt;I set part settings of my EMACS with &lt;strong&gt;cusomize&lt;/strong&gt;, and part with manually editing &lt;strong&gt;.emacs&lt;/strong&gt;-file in my home directory. Not all settings from my &lt;strong&gt;.emacs&lt;/strong&gt; applyed at EMACS startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, not working &lt;strong&gt;web-beautify&lt;/strong&gt; before save, not enable &lt;strong&gt;js2-highlight-unused-variables&lt;/strong&gt; on js2-mode and more. But if I select these lines and call command &lt;code&gt;eval-region&lt;/code&gt;, she begin works!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also someone settings from &lt;strong&gt;.emacs&lt;/strong&gt; works on startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EMACS version: 24.5.1, builded from source&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EMACS repos: ELPA, GNU, ORG&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OS version: Ubuntu 14.04 x64&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link to my .emacs: &lt;a href=&quot;http://pastebin.com/NJup9cDP&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/NJup9cDP&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6919" LastActivityDate="2015-06-12T01:00:16.093" Title="Emacs ignore my .emacs?" Tags="|init-file|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13090" PostTypeId="1" CreationDate="2015-06-11T12:14:48.677" Score="2" ViewCount="188" Body="&lt;p&gt;I'm trying to format some text that matches a regexp using an external shell command. I've been able to use &lt;code&gt;C-u M-|&lt;/code&gt; successfully on a region, but I can't figure out how to do that within &lt;code&gt;replace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using &lt;code&gt;\,(shell-command-on-region point-min point-max &quot;python -m json.tool&quot;)&lt;/code&gt; as the second argument to &lt;code&gt;replace-regexp&lt;/code&gt;, but I get &lt;code&gt;Error evaluating replacement expression: (void-variable point-min)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to use &lt;code&gt;replace-regexp&lt;/code&gt; with &lt;code&gt;shell-command-on-region&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="58" LastActivityDate="2015-06-11T17:52:11.683" Title="Using replace-regexp with a shell command" Tags="|regular-expressions|region|shell-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13091" PostTypeId="2" ParentId="13090" CreationDate="2015-06-11T12:19:33.503" Score="3" Body="&lt;p&gt;&lt;code&gt;point-min&lt;/code&gt; and &lt;code&gt;point-max&lt;/code&gt; are functions not variables.&#xA;So try this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-on-region (point-min) (point-max) &quot;python -m json.tool&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to use &lt;code&gt;replace-regexp&lt;/code&gt; with &lt;code&gt;shell-command-on-region&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, but not combining them properly is not what the error message is about. But I can see where your confusion is coming from: &quot;Error evaluating replacement expression:&quot;. That's &lt;em&gt;additional&lt;/em&gt; information intended to help you figure out in what context the &lt;code&gt;void-variable&lt;/code&gt; error occurred. Unfortunately it did the opposite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: as pointed out in the comments there are a few more issues. I won't walk you though all of them; I suggest you read the documentation about the involved functions instead. But here is some code that should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((buf (generate-new-buffer &quot; *temp*&quot;)))&#xA;  (shell-command-on-region (point-min) (point-max)&#xA;                           &quot;python -m json.tool&quot; buf)&#xA;  (with-current-buffer buf&#xA;    (goto-char (point-min))&#xA;    (replace-regexp &quot;regexp&quot; &quot;replacement&quot;)&#xA;    (buffer-string))&#xA;  (kill-buffer buf))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-06-11T17:52:11.683" LastActivityDate="2015-06-11T17:52:11.683" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13092" PostTypeId="1" CreationDate="2015-06-11T13:44:58.547" Score="8" ViewCount="1999" Body="&lt;p&gt;Here's what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-show-duplicate-lines ()&#xA;  (interactive)&#xA;  (highlight-lines-matching-regexp&#xA;   (concat &quot;^&quot;&#xA;           (regexp-quote&#xA;            (substring-no-properties&#xA;             (thing-at-point 'line) 0 -1))&#xA;           &quot;$&quot;)&#xA;   font-lock-warning-face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My intention is to add this to &lt;code&gt;post-command-hook&lt;/code&gt; to find lines where I'm duplicating logic, but when I run the command a second time, it's ineffective (and the old font-locking is still in effect).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second problem is caused by font-lock not refreshing itself.  I've tried adding a &lt;code&gt;(font-lock-mode -1) (font-lock-mode 1)&lt;/code&gt; to the definition, but it was ineffective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea why the command would be only good for one run, though.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="675" LastEditDate="2015-06-11T16:01:38.533" LastActivityDate="2017-01-27T01:37:08.270" Title="How can I highlight duplicate lines?" Tags="|font-lock|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13093" PostTypeId="1" AcceptedAnswerId="13104" CreationDate="2015-06-11T14:11:40.607" Score="12" ViewCount="3089" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I get a custom &lt;code&gt;org&lt;/code&gt; link function to insert a description automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to store &lt;code&gt;org&lt;/code&gt; links to files in a &lt;code&gt;dired&lt;/code&gt; buffer, but would prefer that the link description be the file name sans path rather than report the full path, ie:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:~/the/full/path/myfile.ext     ; default, but no thanks&#xA;myfile.ext                          ; what I want&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now: &lt;code&gt;org-store-link&lt;/code&gt; hardcodes links from &lt;code&gt;dired&lt;/code&gt; to provide the default.  Instead, I've written a custom function (cribbing from the hard-coded function) and added it to &lt;code&gt;org-store-link-functions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dired-store-link ()&#xA;  (when (derived-mode-p 'dired-mode)&#xA;    (let ((file (dired-get-filename nil t)))&#xA;      (setf file (if file&#xA;                     (abbreviate-file-name (expand-file-name file))&#xA;                   default-directory))&#xA;      (org-store-link-props :type        &quot;dired&quot;&#xA;                            :link        file&#xA;                            :description (file-name-nondirectory file))&#xA;      file)))&#xA;&#xA;(add-to-list 'org-store-link-functions #'dired-store-link)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far so good, and it works as expected, but for one thing:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When calling &lt;code&gt;org-insert-link&lt;/code&gt; with the built-in, default behavior, it simply inserts the link without asking me for a description.&lt;/li&gt;&#xA;&lt;li&gt;When calling &lt;code&gt;org-insert-link&lt;/code&gt; with my custom function, it prompts me to enter a description (which it correctly populates with the file name stored in the &lt;code&gt;:description&lt;/code&gt; property).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'd rather not be prompted for the description each time, and want &lt;code&gt;org-insert-link&lt;/code&gt; to use the value of &lt;code&gt;:description&lt;/code&gt; that the custom function sets.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I convince &lt;code&gt;org-insert-link&lt;/code&gt; to use the &lt;code&gt;:description&lt;/code&gt; automatically without prompting me for it?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2018-03-20T08:02:50.870" Title="Get org link to insert link description automatically?" Tags="|org-mode|elisp|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13094" PostTypeId="1" AcceptedAnswerId="13095" CreationDate="2015-06-11T14:50:46.957" Score="1" ViewCount="103" Body="&lt;p&gt;When I type in a CJK language, I would still like to be able to use emacs key bindings such as &lt;kbd&gt;M-x&lt;/kbd&gt;, as well as vi keys in evil-mode normal-state. Is there a way to make emacs register the keyboard input as a US keyboard only when a modifier is pressed? Also, maybe more difficult, is there a way to make evil normal state register keypresses in the US keyboard (without manually mapping every single command to its CJK equivalent)?&lt;/p&gt;&#xA;" OwnerUserId="2207" LastEditorUserId="253" LastEditDate="2015-06-11T16:30:00.293" LastActivityDate="2015-06-11T16:30:00.293" Title="How to map CJK input to english alphabet for purposes of key bindings and evil?" Tags="|keyboard-layout|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13095" PostTypeId="2" ParentId="13094" CreationDate="2015-06-11T15:01:54.783" Score="0" Body="&lt;p&gt;You need to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html&quot; rel=&quot;nofollow&quot;&gt;select an input method&lt;/a&gt;.  It will allow you to use, say, a QWERTY keyboard layout for commands, but switch between QWERTY and CJK for inserting text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The keybinding for &lt;code&gt;toggle-input-method&lt;/code&gt; is set to &lt;code&gt;C-\&lt;/code&gt; by default.  You can also customize the &lt;code&gt;default-input-method&lt;/code&gt; variable.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-11T15:01:54.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13096" PostTypeId="2" ParentId="13080" CreationDate="2015-06-11T15:02:36.870" Score="38" Body="&lt;p&gt;This function will re-read the dir-locals file and set the new values for the current buffer:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-reload-dir-locals-for-current-buffer ()&#xA;  &amp;quot;reload dir locals for the current buffer&amp;quot;&#xA;  (interactive)&#xA;  (let ((enable-local-variables :all))&#xA;    (hack-dir-local-variables-non-file-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And if you want to reload dir-locals for every buffer in your current buffer's directory:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-reload-dir-locals-for-all-buffer-in-this-directory ()&#xA;  &amp;quot;For every buffer with the same `default-directory` as the &#xA;current buffer's, reload dir-locals.&amp;quot;&#xA;  (interactive)&#xA;  (let ((dir default-directory))&#xA;    (dolist (buffer (buffer-list))&#xA;      (with-current-buffer buffer&#xA;        (when (equal default-directory dir)&#xA;          (my-reload-dir-locals-for-current-buffer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You could have all the dir locals refresh every time you save a dir-locals file by adding an &lt;code&gt;after-save-hook&lt;/code&gt; to .dir-locals.el buffers.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook&#xA;          (defun enable-autoreload-for-dir-locals ()&#xA;            (when (and (buffer-file-name)&#xA;                       (equal dir-locals-file&#xA;                              (file-name-nondirectory (buffer-file-name))))&#xA;              (add-hook 'after-save-hook&#xA;                        'my-reload-dir-locals-for-all-buffer-in-this-directory&#xA;                        nil t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Of course this could have unintended consequences because it will reset the variables values regardless of whether they have been changed elsewhere, so use at your own risk.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="9248" LastEditDate="2021-07-18T17:03:51.137" LastActivityDate="2021-07-18T17:03:51.137" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="13097" PostTypeId="2" ParentId="13092" CreationDate="2015-06-11T15:10:22.333" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Take a look at &lt;code&gt;font-lock-keywords&lt;/code&gt; after you have called your function. You will see that it just has the regexp for the first line as the regexp to fontify. All you did was to pick up a given line and put a regexp to match it into &lt;code&gt;font-lock-keywords&lt;/code&gt; - so only dups of that line get highlighted. IOW, the regexp for that first line is hard-coded in &lt;code&gt;font-lock-keywords&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead, you could use a &lt;code&gt;FUNCTION&lt;/code&gt; in &lt;code&gt;font-lock-keywords&lt;/code&gt;.  But I would just search the buffer for dups of each line, in turn, and not bother with &lt;code&gt;font-lock-keywords&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here is one quick solution.  It uses function &lt;code&gt;hlt-highlight-region&lt;/code&gt; from the &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Highlight&lt;/strong&gt;&lt;/a&gt; library (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;), but you can use something else if you like.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun highlight-line-dups ()&#xA;  (interactive)&#xA;  (let ((count  0)&#xA;        line-re)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (not (eobp))&#xA;        (setq count    0&#xA;              line-re  (concat &quot;^&quot; (regexp-quote (buffer-substring-no-properties&#xA;                                                  (line-beginning-position)&#xA;                                                  (line-end-position)))&#xA;                               &quot;$&quot;))&#xA;        (save-excursion&#xA;          (goto-char (point-min))&#xA;          (while (not (eobp))&#xA;            (if (not (re-search-forward line-re nil t))&#xA;                (goto-char (point-max))&#xA;              (setq count  (1+ count))&#xA;              (unless (&amp;lt; count 2)&#xA;                (hlt-highlight-region (line-beginning-position) (line-end-position)&#xA;                                      'font-lock-warning-face)&#xA;                (forward-line 1)))))&#xA;        (forward-line 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here is a version that works on (a) the active region or (b) the full buffer if the region is not active:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun highlight-line-dups-region (&amp;amp;optional start end face msgp)&#xA;  (interactive `(,@(hlt-region-or-buffer-limits) nil t))&#xA;  (let ((count  0)&#xA;        line-re)&#xA;    (save-excursion&#xA;      (goto-char start)&#xA;      (while (&amp;lt; (point) end)&#xA;        (setq count    0&#xA;              line-re  (concat &quot;^&quot; (regexp-quote (buffer-substring-no-properties&#xA;                                                  (line-beginning-position)&#xA;                                                  (line-end-position)))&#xA;                               &quot;$&quot;))&#xA;        (save-excursion&#xA;          (goto-char start)&#xA;          (while (&amp;lt; (point) end)&#xA;            (if (not (re-search-forward line-re nil t))&#xA;                (goto-char end)&#xA;              (setq count  (1+ count))&#xA;              (unless (&amp;lt; count 2)&#xA;                (hlt-highlight-region&#xA;                 (line-beginning-position) (line-end-position)&#xA;                 face)&#xA;                (forward-line 1)))))&#xA;        (forward-line 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if you want a &lt;em&gt;different face for each set of dups&lt;/em&gt; then just bind a variable &lt;code&gt;face&lt;/code&gt; in the &lt;code&gt;let&lt;/code&gt;, and &lt;code&gt;setq&lt;/code&gt; it to &lt;code&gt;(hlt-next-face)&lt;/code&gt; next to where &lt;code&gt;line-re&lt;/code&gt; is set, and replace &lt;code&gt;font-lock-warning-face&lt;/code&gt; with &lt;code&gt;face&lt;/code&gt;.  Option &lt;code&gt;hlt-auto-face-backgrounds&lt;/code&gt; controls the faces used.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun hlt-highlight-line-dups-region (&amp;amp;optional start end msgp)&#xA;  (interactive `(,@(hlt-region-or-buffer-limits) t))&#xA;  (let ((hlt-auto-faces-flag  t)&#xA;        count line line-re ignore-re)&#xA;    (save-excursion&#xA;      (goto-char start)&#xA;      (while (&amp;lt; (point) end)&#xA;        (setq count    0&#xA;              line     (buffer-substring-no-properties (line-beginning-position)&#xA;                                                       (line-end-position))&#xA;              ignore   (and (not (string= &quot;&quot; line))  &quot;[ \t]*&quot;)&#xA;              line-re  (concat &quot;^&quot; ignore (regexp-quote line) ignore &quot;$&quot;))&#xA;        (save-excursion&#xA;          (goto-char start)&#xA;          (while (&amp;lt; (point) end)&#xA;            (if (not (re-search-forward line-re end t))&#xA;                (goto-char end)&#xA;              (setq count  (1+ count))&#xA;              (unless (&amp;lt; count 2)&#xA;                (hlt-highlight-region (line-beginning-position) (line-end-position))&#xA;                (forward-line 1)))))&#xA;        (forward-line 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-20T14:21:05.747" LastActivityDate="2015-06-20T14:21:05.747" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13098" PostTypeId="2" ParentId="13078" CreationDate="2015-06-11T16:40:23.840" Score="2" Body="&lt;p&gt;@Dmitry made a great point that &lt;code&gt;hippie-expand&lt;/code&gt; will do what I'm desiring when &lt;code&gt;:&lt;/code&gt; is considered a punctuation character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's obviously not ideal to just set &lt;code&gt;(modify-syntax-entry ?: &quot;.&quot; ruby-mode-syntax-table)&lt;/code&gt; in your init and call it a day, because then only &lt;code&gt;some_action&lt;/code&gt; in &lt;code&gt;:some_action&lt;/code&gt; is considered a symbol which would break expectations for other plugins. This seems ripe for re-defining with advice though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I came up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hippie-expand-ruby-symbols (orig-fun &amp;amp;rest args)&#xA;  (if (eq major-mode 'ruby-mode)&#xA;      (let ((table (make-syntax-table ruby-mode-syntax-table)))&#xA;        (modify-syntax-entry ?: &quot;.&quot; table)&#xA;        (with-syntax-table table (apply orig-fun args)))&#xA;    (apply orig-fun args)))&#xA;&#xA;(advice-add 'hippie-expand :around #'hippie-expand-ruby-symbols)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;hippie-expand&lt;/code&gt; is called when the major-mode is &lt;code&gt;ruby-mode&lt;/code&gt;, define a cloned temporary syntax table where &lt;code&gt;:&lt;/code&gt; is a punctuation character and call &lt;code&gt;hippie-expand&lt;/code&gt; with it. Otherwise, just call &lt;code&gt;hippie-expand&lt;/code&gt; as normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any downside to this approach?&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2015-06-11T16:40:23.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13099" PostTypeId="1" CreationDate="2015-06-11T16:44:23.927" Score="1" ViewCount="269" Body="&lt;p&gt;I'm connected to a FreeBSD Computer using &lt;code&gt;ssh [ip] -X&lt;/code&gt;, and emacs launches just fine, but this happens and all the icons are little pieces of paper with red X's:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; emacs&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'document-new' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'document-open' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'image-missing' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'window-close' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'document-save' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-undo' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-cut' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-copy' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-paste' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&#xA;(emacs:22812): GdkPixbuf-WARNING **: Bug! loader 'png' didn't set an error on failure&#xA;&#xA;(emacs:22812): Gtk-WARNING **: Error loading theme icon 'edit-find' for stock: Internal error: Image loader module 'png' failed to complete an operation, but didn't give a reason for the failure&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why this would be happening? GVIM loads just fine.&lt;/p&gt;&#xA;" OwnerUserId="6986" LastActivityDate="2015-06-11T16:44:23.927" Title="Toolbar icons unable to load when running Emacs through xhost from FreeBSD to Ubuntu" Tags="|images|ssh|menu-bar|x11|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13100" PostTypeId="1" CreationDate="2015-06-11T16:59:26.963" Score="9" ViewCount="563" Body="&lt;p&gt;Emacs has &lt;code&gt;repeat&lt;/code&gt; and &lt;code&gt;repeat-complex-command&lt;/code&gt;, that draw different commands from command history and are bound to different keys.  How do you repeat &lt;strong&gt;any&lt;/strong&gt; last command - whether it was complex or not - with a single key? In other words, such a repeating command would behave like &lt;code&gt;repeat-complex-command&lt;/code&gt; if the last command required input, otherwise it would behave like &lt;code&gt;repeat&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: In other words, I am looking for a way to read the last command, complex or not, and then call either &lt;code&gt;repeat-complex-command&lt;/code&gt; or &lt;code&gt;repeat&lt;/code&gt; on it, whichever is appropriate. For instance, let's say that such a new command is bound to &lt;code&gt;&amp;lt;f8&amp;gt;&lt;/code&gt;.  Then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;(mimicking &lt;code&gt;C-x M-: (repeat-complex-command)&lt;/code&gt; with &lt;code&gt;M-z (zap-to-char)&lt;/code&gt;): &lt;code&gt;C-u M-z a &amp;lt;f8&amp;gt; &amp;lt;f8&amp;gt;&lt;/code&gt; will be equivalent to &lt;code&gt;C-u M-z a C-x M-: RET C-x M-: RET&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(mimicking &lt;code&gt;C-x z (repeat)&lt;/code&gt; with &lt;code&gt;C-f (forward-char)&lt;/code&gt;): &lt;code&gt;C-u C-f &amp;lt;f8&amp;gt; &amp;lt;f8&amp;gt;&lt;/code&gt; will be equivalent to &lt;code&gt;C-u C-f C-x z z&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;code&gt;repeat-complex-command&lt;/code&gt; requires you to confirm the Lisp form that will be executed.  To allow for repeating a complex command without confirmation, I have written an alternative version of &lt;code&gt;repeat-complex-command&lt;/code&gt;, called &lt;code&gt;repeat-complex-command-no-confirm&lt;/code&gt; (see below for the implementation). The problem is that I can't understand how to determine whether I should call &lt;code&gt;repeat&lt;/code&gt; or &lt;code&gt;repeat-complex-command-no-confirm&lt;/code&gt; when pressing &lt;code&gt;&amp;lt;f8&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun repeat-complex-command-no-confirm (arg)&#xA;  &quot;Like `repeat-complex-command' but does not require confirmation.&quot;&#xA;  ;; Adapted from `repeat-complex-command' of Emacs 24.5.1.&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((elt (nth (1- arg) command-history))&#xA;        newcmd)&#xA;    (if elt&#xA;        (progn&#xA;          (setq newcmd elt)&#xA;&#xA;          ;; If command to be redone does not match front of history,&#xA;          ;; add it to the history.&#xA;          (or (equal newcmd (car command-history))&#xA;              (setq command-history (cons newcmd command-history)))&#xA;          (unwind-protect&#xA;              (progn&#xA;                ;; Trick called-interactively-p into thinking that `newcmd' is&#xA;                ;; an interactive call (bug#14136).&#xA;                (add-hook 'called-interactively-p-functions&#xA;                          #'repeat-complex-command--called-interactively-skip)&#xA;                (eval newcmd))&#xA;            (remove-hook 'called-interactively-p-functions&#xA;                         #'repeat-complex-command--called-interactively-skip)))&#xA;      (if command-history&#xA;          (error &quot;Argument %d is beyond length of command history&quot; arg)&#xA;        (error &quot;There are no previous complex commands to repeat&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="2763" LastEditDate="2015-06-11T19:07:57.343" LastActivityDate="2015-06-11T21:23:40.223" Title="Repeating any last command (complex or not)" Tags="|history|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13101" PostTypeId="2" ParentId="13092" CreationDate="2015-06-11T17:11:12.863" Score="0" Body="&lt;p&gt;This is a little sketchy, but with some effort (see &lt;kbd&gt;C-h f&lt;/kbd&gt;&lt;code&gt;ediff-buffers&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; for the info on the &lt;code&gt;HOOK&lt;/code&gt; argument) you could make it display better / perform a better cleanup upon exiting the diff mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/show-duplicate-lines (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (unless (region-active-p)&#xA;    (setf beg (point-min)&#xA;          end (point-max)))&#xA;  (let ((copy (buffer-substring beg end))&#xA;        (original (current-buffer))&#xA;        (dupes-buffer (get-buffer-create (format &quot;%s[dupes]&quot; (buffer-name)))))&#xA;    (with-current-buffer dupes-buffer&#xA;      (erase-buffer)&#xA;      (insert copy)&#xA;      (delete-duplicate-lines (point-min) (point-max))&#xA;      (ediff-buffers original dupes-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-06-11T17:11:12.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13102" PostTypeId="2" ParentId="13100" CreationDate="2015-06-11T17:12:14.163" Score="5" Body="&lt;p&gt;Others will no doubt provide different solutions. Here's mine, from library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun repeat-command (command)&#xA;  &quot;Repeat COMMAND.&quot;&#xA;  (let ((repeat-message-function  'ignore))&#xA;    (setq last-repeatable-command  command)&#xA;    (repeat nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then just define a new, repeating command for any non-repeating command, and remap the keys from the non-repeater to the repeater.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun next-buffer-repeat ()&#xA;  &quot;Switch to the next buffer in the selected window.&#xA;You can repeat this by hitting the last key again...&quot;&#xA;  (interactive)&#xA;  (require 'repeat)&#xA;  (repeat-command 'next-buffer))&#xA;&#xA;(global-set-key [remap next-buffer] 'next-buffer-repeat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In particular, you can use this to repeat a command that is on a prefix key.  For example remapping &lt;code&gt;next-buffer&lt;/code&gt; to &lt;code&gt;next-buffer-repeat&lt;/code&gt; means that you can use &lt;code&gt;C-x &amp;lt;right&amp;gt; &amp;lt;right&amp;gt;...&lt;/code&gt;.  The key it is bound to, &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt;, need not be a repeating key (one that you can just hold down.  All you need is to use &lt;code&gt;C-x&lt;/code&gt; once and then hold down &lt;code&gt;&amp;lt;right&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Sorry, I just realized that you also want to repeat a &quot;complex command&quot;. Actually (IMHO), repeating a complex command is a misnomer.  It just means repeating a command with (by default) the same arguments.  It purposefully lets you edit the Lisp sexp that will do that, so you can, for example, change the arguments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, command &lt;code&gt;repeat-complex-command&lt;/code&gt; (bound to &lt;code&gt;C-x ESC ESC&lt;/code&gt;, for example) does something special and quite different from just repeat the last command (i.e., from the kind of thing I showed above).  It's not clear what repeatedly repeating a &quot;complex command&quot; might mean or what use it would be.  IOW, the notion of repeating a command, e.g. by holding down a key that it is bound to, is quite different from using &lt;code&gt;repeat-complex-command&lt;/code&gt;, which initiates a dialog that lets you edit and then invoke a command specifying particular argument values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So unless you can better describe what you have in mind by somehow combining command repetition in the usual sense with what &lt;code&gt;repeat-complex-command&lt;/code&gt; does, I'm afraid I can't help with that part of your question.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update after your clarification. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is essentially what you have, to repeat the last &quot;complex&quot; command, meaning the last command that read input from the minibuffer.  (Note that you need to remove &lt;code&gt;repeat-complex-command-no-confirm&lt;/code&gt; from the history.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun repeat-complex-command-no-confirm ()&#xA;  &quot;...&quot;&#xA;  (interactive)&#xA;  (let* ((hist  command-history)&#xA;         newcmd)&#xA;    (while (eq 'repeat-complex-command-no-confirm (caar hist))&#xA;      (setq hist  (cdr hist)))&#xA;    (setq newcmd  (car hist))&#xA;    (if newcmd&#xA;        (apply #'funcall-interactively (car newcmd)&#xA;               (mapcar (lambda (ee) (eval ee t)) (cdr newcmd)))&#xA;      (error &quot;There are no previous complex commands to repeat&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind that to a repeatable key (e.g. &lt;code&gt;C-o').  Or you can define a repeatable command using&lt;/code&gt;repeat-command&lt;code&gt;(i.e., pass&lt;/code&gt;repeat-complex-command-no-confirm&lt;code&gt;to it), to be able to have it work when bound to a repeatable key that is on a prefix key (e.g.&lt;/code&gt;C-x o`).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when you use such a key, invoking &lt;code&gt;repeat-complex-command-no-confirm&lt;/code&gt;, you will repeat the last command that used the minibuffer, not necessarily the last command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, you can use something like the following to get what you say you want.  The last line prevents &lt;code&gt;my-repeat&lt;/code&gt; from being the last command, so that using it again does not try to repeat &lt;code&gt;my-repeat&lt;/code&gt; but repeats the last repeated command.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-repeat ()&#xA;  &quot;...&quot;&#xA;  (interactive)&#xA;  (if (eq last-command (caar command-history))&#xA;      (repeat-complex-command-no-confirm)&#xA;    (call-interactively last-command))&#xA;  (setq this-command  last-command))&#xA;&#xA;(global-set-key &quot;\C-o&quot; 'my-repeat) ; Bind it to a repeatable key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-11T21:23:40.223" LastActivityDate="2015-06-11T21:23:40.223" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13103" PostTypeId="2" ParentId="10636" CreationDate="2015-06-11T17:51:55.383" Score="2" Body="&lt;p&gt;What you are looking for is a two-way editing feature that survives edits during the round-trip and not just one-way output common to tangle and detangle commands. The best solution I found is &lt;a href=&quot;http://homepages.cs.ncl.ac.uk/phillip.lord/lentic/lenticular.html&quot; rel=&quot;nofollow&quot;&gt;lenticular text&lt;/a&gt; that is available as the package &lt;strong&gt;lentic&lt;/strong&gt; on MELPA.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-11T17:51:55.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13104" PostTypeId="2" ParentId="13093" CreationDate="2015-06-11T20:52:14.707" Score="5" Body="&lt;p&gt;Buried at the bottom of the docstring for &lt;code&gt;org-insert-link&lt;/code&gt; is a note that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If &lt;code&gt;org-make-link-description-function&lt;/code&gt; is non-nil, this function will be&#xA;  called with the link target, and the result will be the default&#xA;  link description.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Apparently &lt;code&gt;org&lt;/code&gt; throws away a lot of information in the process of storing a link, so all that's left in &lt;code&gt;org-stored-links&lt;/code&gt; is a list of entries of the form &lt;code&gt;(link description)&lt;/code&gt;.  Insofar as the earlier function has a file name for the link, it looks like the following works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-link-describe (link desc)&#xA;  (if (file-exists-p link)&#xA;      desc&#xA;    (read-string &quot;Description: &quot; desc)))&#xA;&#xA;(setf org-make-link-description-function #'org-link-describe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's kind of hacky, and I haven't tested it extensively, but it seems to work so far.  Would be thrilled to see a more elegant solution, of course.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-06-11T21:15:15.587" LastActivityDate="2015-06-11T21:15:15.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13105" PostTypeId="2" ParentId="13072" CreationDate="2015-06-11T22:29:28.437" Score="0" Body="&lt;p&gt;Small comment : IMO, the body of the question (in particular the part entitled &quot;Solution&quot;) is not really related to the title of the question. I suggested an edit of the title, but it was rejected. I think abo-abo's answer is the best to solve the problem described in the body, so now what follows is a solution to the problem stated in the title.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As others have said, the problem has no general solution : a function could very well have no name at all. So let us assume that it does have a name, i.e. there is a symbol (interned in &lt;code&gt;obarray&lt;/code&gt;) which holds that function in its function cell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way to find out the name of a function is to loop through obarray and check every symbol for one that matches. This is pretty simple to write with mapatoms, and left as an exercise to the reader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is one added difficulty : advices. If you advised indent-region, the function slot of that symbol no longer is the original indent-region. So the above method will not do what you want, and you have to dissect the function cell to check if it was advised, and what was the original function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that the job description is done, to the code !&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yf/find-function-in-symbols (function &amp;amp;optional advicep)&#xA;  &quot;Find FUNCTION in obarray and return a corresponding symbol, or nil.&#xA;When ADVICEP is non-nil, also return symbol if it is an advised&#xA;version of FUNCTION.&quot;&#xA;  (catch 'found&#xA;    (mapatoms (lambda (sym)&#xA;        (when (fboundp sym)&#xA;          (let ((symfun (symbol-function sym)))&#xA;            (when (or (eq symfun function)&#xA;                  (and advicep&#xA;                   (eq (advice--cd*r symfun)&#xA;                       function)))&#xA;              (throw 'found sym))))))&#xA;    nil))&#xA;&#xA;(defun modi/whole-buffer-if-not-region (orig-fn &amp;amp;rest args)&#xA;  (save-excursion&#xA;    (if (region-active-p)&#xA;        (progn&#xA;          ;; do the default thing if a region is selected&#xA;          (message &quot;Executed %s as usual&quot; (yf/find-function-in-symbols orig-fn t))&#xA;          (apply orig-fn args))&#xA;      ;; indent the whole buffer otherwise&#xA;      (apply orig-fn (list (point-min) (point-max)))&#xA;      (message &quot;Executed %s on the whole buffer&quot; (yf/find-function-in-symbols orig-fn t)))))&#xA;&#xA;(advice-add #'indent-region :around #'modi/whole-buffer-if-not-region)&#xA;(advice-add #'eval-region   :around #'modi/whole-buffer-if-not-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Last comment : when &lt;code&gt;yf/find-function-in-symbols&lt;/code&gt; is not given its optional ADVICEP argument, it gives an answer to the easier problem where no advising is involved.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-06-12T08:15:43.023" LastActivityDate="2015-06-12T08:15:43.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13106" PostTypeId="2" ParentId="13089" CreationDate="2015-06-12T00:34:16.140" Score="2" Body="&lt;p&gt;The function &lt;code&gt;js2-highlight-unused-variables&lt;/code&gt; is a function used by &lt;code&gt;js2-highlight-unused-variables-mode&lt;/code&gt;, which is a minor mode:  &lt;a href=&quot;https://github.com/mooz/js2-mode/blob/master/js2-mode.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mooz/js2-mode/blob/master/js2-mode.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, minor modes are turned on as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(js2-highlight-unused-variables-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And, they are turned off as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(js2-highlight-unused-variables-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The original poster has created a function that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun turn-on-highlight-unused-vars-on-js2-mode()(js2-highlight-unused-variables))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, the original poster could try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun turn-on-highlight-unused-vars-on-js2-mode ()&#xA;  (js2-highlight-unused-variables-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;With respect to &lt;code&gt;web-beautify&lt;/code&gt;, the original poster will need to carefully compare his/her own code to the instructions on the homepage for the github repository -- &lt;a href=&quot;https://github.com/yasuyk/web-beautify&quot; rel=&quot;nofollow&quot;&gt;https://github.com/yasuyk/web-beautify&lt;/a&gt;.  If those instructions do not appear to work, then the original poster may wish to reduce his/her &lt;code&gt;.emacs&lt;/code&gt; file to the absolute minimal installation needed for &lt;code&gt;web-beautify&lt;/code&gt; and see if it works as expected.  If &lt;code&gt;web-beautify&lt;/code&gt; works as expected with a minimal &lt;code&gt;.emacs&lt;/code&gt; installation, then the original poster can start enabling the other settings little by little until the culprit is located.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The instructions state in relevant part:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If you want to automatically format before saving a file, add the following hook to your emacs configuration:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'js2-mode&#xA;  '(add-hook 'js2-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-js-buffer t t))))&#xA;&#xA;;; Or if you're using 'js-mode' (a.k.a 'javascript-mode')&#xA;(eval-after-load 'js&#xA;  '(add-hook 'js-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-js-buffer t t))))&#xA;&#xA;(eval-after-load 'json-mode&#xA;  '(add-hook 'json-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-js-buffer t t))))&#xA;&#xA;(eval-after-load 'sgml-mode&#xA;  '(add-hook 'html-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-html-buffer t t))))&#xA;&#xA;(eval-after-load 'css-mode&#xA;  '(add-hook 'css-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-css-buffer t t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-12T01:00:16.093" LastActivityDate="2015-06-12T01:00:16.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13107" PostTypeId="1" CreationDate="2015-06-12T00:35:18.100" Score="7" ViewCount="3209" Body="&lt;p&gt;I write UML diagrams in org-mode with PlantUML and usually &quot;compile&quot; it to HTML to view the result. Is there a way to have the image show up in my buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to enable iimage-mode but it doesn't work well. It replaces the file name at the start of the source block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src plantuml :file my-diagram.png&#xA;...&#xA;#+end_src&#xA;#+results:&#xA;[[file:my-diagram.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both references to the filename get replaced and the source stays. Is there a way to hide the source block and only show one instance of the image?&lt;/p&gt;&#xA;" OwnerUserId="2120" LastActivityDate="2018-11-30T08:27:10.763" Title="Replace PlantUML source with generated image in org-mode" Tags="|org-mode|images|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13108" PostTypeId="2" ParentId="12889" CreationDate="2015-06-12T03:51:21.440" Score="8" Body="&lt;p&gt;One widely known option that implements two-way round-trip linkage between different document formats (org and fountain, for example) within the same file is the &lt;strong&gt;lentic server&lt;/strong&gt; feature developed by Phillip Lord. It can be installed as the &lt;strong&gt;lentic&lt;/strong&gt; package through MELPA repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a &lt;a href=&quot;https://vimeo.com/116078853&quot; rel=&quot;noreferrer&quot;&gt;screencast&lt;/a&gt; showing org-mode and lisp integration in the same file with two different editable views at the same time, linked. Changing in one makes changes in the other. Some initial setup may be required to accommodate the formats you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a richer integration, more suitable for editing, than say one-way output of tangle and detangle through org-babel.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-12T03:51:21.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13109" PostTypeId="1" CreationDate="2015-06-12T09:19:50.567" Score="2" ViewCount="668" Body="&lt;p&gt;I'd like to use &lt;a href=&quot;https://github.com/twisted/twistedchecker&quot; rel=&quot;nofollow&quot;&gt;twistedchecker&lt;/a&gt; when working on the &lt;a href=&quot;https://twistedmatrix.com&quot; rel=&quot;nofollow&quot;&gt;Twisted&lt;/a&gt; project. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Twisted has somewhat unusual &lt;a href=&quot;http://twistedmatrix.com/documents/current/core/development/policy/coding-standard.html&quot; rel=&quot;nofollow&quot;&gt;coding standards&lt;/a&gt; that aren't mutually compatible with PEP 8 (e.g. a mandatory three line gap between top-level definitions) so I would like the pylint checkers to be disabled and run only the twistedchecker and pyflakes checkers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried setting &lt;code&gt;flycheck-python-pylint-executable&lt;/code&gt; to &quot;twistedchecker&quot; in my &lt;code&gt;.dir-locals.el&lt;/code&gt; file, but that does not seem to change the output. (I have confirmed that it is set correctly).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that the answer is that I should write my own flycheck checker. There are &lt;a href=&quot;http://www.flycheck.org/extensions.html&quot; rel=&quot;nofollow&quot;&gt;plenty of examples&lt;/a&gt; of how to do this, so that should be OK. What I don't know is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;is there an easier way?&lt;/li&gt;&#xA;&lt;li&gt;if not, how would I tell flycheck to use the twisted checker for files in &lt;code&gt;~/src/Twisted/&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have also posted this question to the &lt;a href=&quot;http://twistedmatrix.com/pipermail/twisted-python/2015-June/029572.html&quot; rel=&quot;nofollow&quot;&gt;Twisted-Python mailing list&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8565" LastActivityDate="2015-06-12T11:38:27.153" Title="How can I use a custom Python linter for a specific project with flycheck?" Tags="|python|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13110" PostTypeId="1" AcceptedAnswerId="13111" CreationDate="2015-06-12T09:32:50.630" Score="5" ViewCount="1090" Body="&lt;p&gt;Since an upgrade to GNU Emacs 24.4.1, I &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error running timer `font-latex-jit-lock-force-redisplay': (wrong-number-of-arguments (2 . 2) 3) [N times]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;N&lt;/code&gt; in my observations ranges from single digits to &lt;code&gt;240&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f font-latex-jit-lock-force-redisplay&lt;/code&gt; says only&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Compatibility for Emacsen not offering `jit-lock-force-redisplay'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any pointers?&lt;/p&gt;&#xA;" OwnerUserId="8566" LastActivityDate="2015-10-10T12:24:19.337" Title="&quot;Error running timer `font-latex-jit-lock-force-redisplay'&quot; in LaTeX mode" Tags="|latex|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13111" PostTypeId="2" ParentId="13110" CreationDate="2015-06-12T09:43:34.717" Score="2" Body="&lt;p&gt;I found a following redefinition of &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16879&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;font-latex-jit-lock-force-redisplay&lt;/code&gt;&lt;/a&gt; that appears to solve my problem.  I put the following into my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'font-latex)&#xA;&#xA;(defun font-latex-jit-lock-force-redisplay (buf start end)&#xA;  &quot;Compatibility for Emacsen not offering `jit-lock-force-redisplay'.&quot;&#xA;    ;; The following block is an expansion of `jit-lock-force-redisplay'&#xA;    ;; and involved macros taken from CVS Emacs on 2007-04-28.&#xA;    (with-current-buffer buf&#xA;      (let ((modified (buffer-modified-p)))&#xA;    (unwind-protect&#xA;        (let ((buffer-undo-list t)&#xA;          (inhibit-read-only t)&#xA;          (inhibit-point-motion-hooks t)&#xA;          (inhibit-modification-hooks t)&#xA;          deactivate-mark&#xA;          buffer-file-name&#xA;          buffer-file-truename)&#xA;          (put-text-property start end 'fontified t))&#xA;      (unless modified&#xA;        (restore-buffer-modified-p nil))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first line was necessary, I suppose, because otherwise &lt;code&gt;font-latex.el&lt;/code&gt; is only loaded when the first &lt;code&gt;.tex&lt;/code&gt; file is visited and overwrites the definition from &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8566" LastActivityDate="2015-06-12T09:43:34.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13112" PostTypeId="1" AcceptedAnswerId="15262" CreationDate="2015-06-12T10:11:21.963" Score="8" ViewCount="2479" Body="&lt;p&gt;Since I updated the whole of my emacs third party packages projectile has started to see my home folder (which emacs opens in) as a projectile project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9QK17.png&quot; alt=&quot;Screenshot of helm-projectile showing the home folder as projectile project&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no &lt;code&gt;.projectile&lt;/code&gt; file in my home folder, neither is my home folder under version control.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;marcus@mri-tp:~ &amp;gt;&amp;gt;&amp;gt; cat ~/.projectile&#xA;cat: /home/marcus/.projectile: No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My home folder is also not in my &lt;code&gt;projectile-bookmarks.eld&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;~/.emacs.d/&quot; &quot;~/projects/pwb-ss15/&quot; &quot;~/projects/fhw-symmrecog/&quot; &quot;~/fhw/ss15/dbassistenz/&quot; &quot;~/projects/dsa-compendium/&quot; &quot;~/.zprezto/&quot; &quot;~/projects/pwb-ws13/&quot; &quot;~/fhw/ss15/db/&quot; &quot;~/fhw/ss15/ps2_00/&quot; &quot;~/projects/jekyll-school/&quot; &quot;~/projects/webIsoRogue/&quot; &quot;~/projects/spacerace/&quot; &quot;~/projects/marcusriemer.de/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am however using projectile together with &lt;code&gt;helm&lt;/code&gt; and &lt;code&gt;ecb&lt;/code&gt;. To sync the &lt;code&gt;ecb&lt;/code&gt; file tree I use the snippet from &lt;a href=&quot;http://www.emacswiki.org/emacs/Projectile&quot; rel=&quot;noreferrer&quot;&gt;the emacs wiki: ecb + projectile&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar default-ecb-source-path ())&#xA;&#xA;(add-hook 'ecb-basic-buffer-sync-hook&#xA;                (lambda ()&#xA;                        (when (functionp 'projectile-get-project-directories)&#xA;                        (when (projectile-project-p)&#xA;                                (dolist (path-dir (projectile-get-project-directories))&#xA;                                (unless (member (list path-dir path-dir) default-ecb-source-path)&#xA;                                        (push (list path-dir path-dir) default-ecb-source-path)&#xA;                                        (customize-set-variable 'ecb-source-path default-ecb-source-path)&#xA;                                        ))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell I have not set &lt;code&gt;projectile-require-project-root(nil)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;marcus@mri-tp:~/.emacs.d &amp;gt;&amp;gt;&amp;gt; find . -iname &quot;*.el&quot; | xargs grep &quot;projectile-require-project-root&quot;&#xA;./elpa/helm-projectile-20150610.253/helm-projectile.el:  (let ((projectile-require-project-root nil))&#xA;./elpa/helm-projectile-20150610.253/helm-projectile.el:  (let* ((projectile-require-project-root nil)&#xA;./elpa/helm-projectile-20150610.253/helm-projectile.el:                (let ((projectile-require-project-root nil))&#xA;./elpa/projectile-20150610.2247/projectile.el:(defcustom projectile-require-project-root t&#xA;./elpa/projectile-20150610.2247/projectile.el:        (if projectile-require-project-root&#xA;./elpa/projectile-20150610.2247/projectile.el:        (projectile-require-project-root nil))&#xA;./elpa/projectile-20150610.2247/projectile.el:  (let ((projectile-require-project-root nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an idea why projectile started to index my home directory? And how can I tell it to ignore my home folder once and for all?&lt;/p&gt;&#xA;" OwnerUserId="542" LastEditorUserId="542" LastEditDate="2015-06-12T13:17:30.827" LastActivityDate="2022-11-05T10:23:06.753" Title="Projectile indexes my home directory, how do I stop it from doing that?" Tags="|projectile|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13113" PostTypeId="1" CreationDate="2015-06-12T11:11:21.900" Score="3" ViewCount="232" Body="&lt;p&gt;I'm experiencing frustrating behaviour with automatic Python indentation when ending a highly indented block. I've used pilcrows to indicate where I want newlines in the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def f():&#xA;    if True:&#xA;        if True:&#xA;            if True:&#xA;                print &quot;&quot;&#xA;¶&#xA;¶&#xA;¶&#xA;def g():&#xA;    print &quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After finishing typing the first function, every subsequent line is automatically indented by 16 spaces, which all need to be deleted. I understand that the first time I hit return, indenting to that level makes sense. But I am surprised that when hitting return on an unindented line it would also be assumed that I wanted the maximum valid indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behaviour seems to occur in 24.4.1 with both the new &lt;code&gt;python.el&lt;/code&gt; (Gallina) and &lt;code&gt;python-mode.el&lt;/code&gt;. (It also appeared to happen when I tried to use the old &lt;code&gt;python.el&lt;/code&gt; by Dave Love, but I could not work out how to verify which &lt;code&gt;python.el&lt;/code&gt; had actually loaded). I note that with the new &lt;code&gt;python.el&lt;/code&gt; I can use &lt;code&gt;C-j&lt;/code&gt; to return without indenting, but that doesn't help much with a situation such as the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def f():&#xA;    if True:&#xA;        if True:&#xA;            if True:&#xA;                print &quot;&quot;&#xA;    ¶&#xA;    print &quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't want to disable automatic indentation, but is there a way to make it less aggressive and accept valid lower levels of indentation somehow?&lt;/p&gt;&#xA;" OwnerUserId="7189" LastActivityDate="2015-06-12T15:35:27.917" Title="How to achieve less zealous indentation in Python?" Tags="|indentation|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13114" PostTypeId="2" ParentId="13109" CreationDate="2015-06-12T11:38:27.153" Score="3" Body="&lt;p&gt;Indeed, you must write your own &lt;code&gt;python-twisted&lt;/code&gt; syntax checker [1]. There is no easier way—actually I think it's already pretty easy to write Flycheck checkers.  You don't even need to look at extensions for examples:  You can just look at the syntax checkers in Flycheck itself.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flycheck provides &lt;a href=&quot;http://www.flycheck.org/manual/latest/Syntax-checkers.html#index-flycheck_002dchecker&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;flycheck-checker&lt;/code&gt;&lt;/a&gt; to explicitly select a specific syntax checker for a buffer.  To use a specific syntax checker for all buffers in a project simply set &lt;code&gt;flycheck-checker&lt;/code&gt; via directory variables.  In other words, add &lt;code&gt;src/Twisted/.dir-locals.el&lt;/code&gt; with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((python-mode&#xA;  (flycheck-checker . python-twisted)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[1] I wonder how you got the idea that changing the Pylint executable to an entirely unrelated program could possibly work… &lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-06-12T11:38:27.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13115" PostTypeId="2" ParentId="13113" CreationDate="2015-06-12T12:44:06.937" Score="2" Body="&lt;p&gt;With python-mode.el each block may have it's own length of indent-step, i.e. the value of &lt;code&gt;py-indent-offset&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;py-smart-indentation&lt;/code&gt; must be on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When introducing a new block, the desired indentation needs to be set/correct on the first indented line. With the next line, the new distance should have been learned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of error, please file a bug-report here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bugs.launchpad.net/python-mode&quot; rel=&quot;nofollow&quot;&gt;https://bugs.launchpad.net/python-mode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="7189" LastEditDate="2015-06-12T15:35:27.917" LastActivityDate="2015-06-12T15:35:27.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13116" PostTypeId="1" AcceptedAnswerId="13118" CreationDate="2015-06-12T15:27:26.250" Score="6" ViewCount="771" Body="&lt;p&gt;&lt;kbd&gt;C-u C-SPC&lt;/kbd&gt; is used to &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Move point to where the mark was, and restore the mark from the ring&#xA;  of former marks.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When trying to get the function bound to &lt;kbd&gt;C-u C-SPC&lt;/kbd&gt; with &lt;code&gt;describe-key&lt;/code&gt; it just stops processing the query, with reason, in &lt;kbd&gt;C-u&lt;/kbd&gt; and returns the &lt;code&gt;universal-argument&lt;/code&gt; description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question can also extend to &lt;em&gt;&quot;How do you get the function bound to a keymap starting with &lt;kbd&gt;C-u&lt;/kbd&gt; where it acts differently from an ordinary argument&quot;&lt;/em&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8563" LastActivityDate="2015-06-12T16:14:54.867" Title="How to find out which function is bound to C-u C-SPC?" Tags="|key-bindings|keymap|functions|prefix-argument|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13117" PostTypeId="2" ParentId="13116" CreationDate="2015-06-12T15:30:29.500" Score="8" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;How do you get the function bound to a keymap starting with C-u where it acts differently from an ordinary argument&quot;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-u C-SPC&lt;/code&gt; and &lt;code&gt;C-SPC&lt;/code&gt; will run the same function, just with different arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll need to read the documentation or the source code to figure out exactly what the difference are.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-06-12T15:30:29.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13118" PostTypeId="2" ParentId="13116" CreationDate="2015-06-12T15:31:33.467" Score="9" Body="&lt;p&gt;Leave the &lt;code&gt;C-u&lt;/code&gt; off and check the binding for &lt;code&gt;C-SPC&lt;/code&gt; (or whatever you're interested in).  The universal argument (the &lt;code&gt;C-u&lt;/code&gt;) is often used to make commands do different things.  However, the docstring of the command will (or at least should) explain what the command does when preceded by universal arguments.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-12T15:31:33.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13119" PostTypeId="1" AcceptedAnswerId="13129" CreationDate="2015-06-12T15:45:03.203" Score="0" ViewCount="223" Body="&lt;p&gt;This are the first 4 lines of my &lt;code&gt;init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After loading emacs all the entries (&lt;code&gt;elpa/package.version&lt;/code&gt;) added by &lt;code&gt;package-initialize&lt;/code&gt; to the load-path are in it twice, once without a trailing slash and once with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why it does this? Won't it slow things down by searching the directories twice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It made me think I was adding them to the load path twice, but I'm not.&lt;/p&gt;&#xA;" OwnerUserId="7098" LastActivityDate="2015-08-20T17:14:49.640" Title="Why load-path duplicates?" Tags="|init-file|package|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13120" PostTypeId="2" ParentId="13116" CreationDate="2015-06-12T16:14:54.867" Score="4" Body="&lt;p&gt;&lt;code&gt;C-u C-SPC&lt;/code&gt; is not bound to a single key sequence. &lt;code&gt;C-u&lt;/code&gt; is bound to &lt;code&gt;universal-argument&lt;/code&gt;, and &lt;code&gt;C-SPC&lt;/code&gt; is bound to &lt;code&gt;set-mark-command&lt;/code&gt;. If you consult the doc for each of those you will get the answer to your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-u&lt;/code&gt; provides a prefix argument for the following command, in this case for command &lt;code&gt;set-mark-command&lt;/code&gt;.  Consulting the doc for &lt;code&gt;set-mark-command&lt;/code&gt; tells you how it interprets a prefix argument:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With prefix argument (e.g., C-u C-SPC), jump to the mark, and set the mark from&#xA;  position popped off the local mark ring (this does not affect the global&#xA;  mark ring).  Use C-x C-SPC to jump to a mark popped off the global&#xA;  mark ring (see &lt;code&gt;pop-global-mark&lt;/code&gt;).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;set-mark-command-repeat-pop&lt;/code&gt; is non-nil, repeating&#xA;  the C-SPC command with no prefix argument pops the next position&#xA;  off the local (or global) mark ring and jumps there.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With C-u C-u as prefix&#xA;  argument, unconditionally set mark where point is, even if&#xA;  &lt;code&gt;set-mark-command-repeat-pop&lt;/code&gt; is non-nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Consult the Emacs manual for more info about prefix arguments: &lt;code&gt;C-h r i prefix arguments RET&lt;/code&gt;.  That takes you to node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot; rel=&quot;nofollow&quot;&gt;Numeric Arguments&lt;/a&gt; of the manual.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-12T16:14:54.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13121" PostTypeId="1" CreationDate="2015-06-12T16:23:19.987" Score="0" ViewCount="190" Body="&lt;p&gt;I have two (org-mode) source blocks, both with parameters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;select-union(tbl=a_table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;column-names(tbl=a_table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both produce SQL artifacts from the table data.&#xA;Now I want to write a new source block which calls both of these. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sql :var tab=an_example_table &#xA;;with src as (&#xA;  select * from (&#xA;    &amp;lt;&amp;lt;select-union(tbl=tab)&amp;gt;&amp;gt;&#xA;  ) X(&amp;lt;&amp;lt;column-names(tbl=tab)&amp;gt;&amp;gt;)&#xA;)&#xA;select * from src&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This errors at me in a somewhat unfriendly manner, something about tab not being a valid block name. So here's my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a source block A, how do I call another source block B with one of A's parameters as parameter value?&lt;/p&gt;&#xA;" OwnerUserId="8570" LastActivityDate="2015-06-12T16:23:19.987" Title="how to quote parameters in source blocks" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13122" PostTypeId="2" ParentId="13092" CreationDate="2015-06-12T16:53:33.413" Score="1" Body="&lt;p&gt;How about using overlay instead of font-lock?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; https://github.com/ShingoFukuyama/ov.el&#xA;(require 'ov)&#xA;&#xA;(defun my-highlight-duplicate-lines-in-region ()&#xA;  (interactive)&#xA;  (if mark-active&#xA;      (let* (($beg (region-beginning))&#xA;             ($end (region-end))&#xA;             ($st (buffer-substring-no-properties&#xA;                   $beg $end))&#xA;             ($lines)&#xA;             $dup)&#xA;        (deactivate-mark t)&#xA;        (save-excursion&#xA;          (goto-char $beg)&#xA;          (while (&amp;lt; (point) $end)&#xA;            (let* (($b (point))&#xA;                   ($e (point-at-eol))&#xA;                   ($c (buffer-substring-no-properties $b $e))&#xA;                   ($a (assoc $c $lines)))&#xA;              (when (not (eq $b $e))&#xA;                (if $a&#xA;                    (progn&#xA;                      (setq $dup (cons $b $dup))&#xA;                      (setq $dup (cons (cdr $a) $dup)))&#xA;                  (setq $lines&#xA;                        (cons (cons $c $b) $lines)))))&#xA;            (forward-line 1))&#xA;          (mapc (lambda ($p)&#xA;                  (ov-set (ov-line $p) 'face '(:foreground &quot;red&quot;)))&#xA;                (sort (delete-dups $dup) '&amp;lt;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make region, and then &lt;code&gt;M-x my-highlight-duplicate-lines-in-region&lt;/code&gt;&#xA;You can clear all overlays by &lt;code&gt;M-x ov-clear&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8537" LastActivityDate="2015-06-12T16:53:33.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13123" PostTypeId="1" AcceptedAnswerId="13125" CreationDate="2015-06-12T17:25:35.230" Score="3" ViewCount="166" Body="&lt;p&gt;With the regular search forward from Emacs if you keep pressing &lt;code&gt;C-s&lt;/code&gt; you cycle through all the findings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I'm using &lt;a href=&quot;https://github.com/benma/visual-regexp.el&quot; rel=&quot;nofollow&quot;&gt;visual-regexp package&lt;/a&gt; with the &lt;a href=&quot;https://github.com/benma/visual-regexp-steroids.el/&quot; rel=&quot;nofollow&quot;&gt;visual-regexp-steroids extension&lt;/a&gt; that has a forward search too, but using regular expressions ( &lt;code&gt;vr/isearch-forward&lt;/code&gt;). After running the search how do I cycle through all the findings?.&lt;/p&gt;&#xA;" OwnerUserId="7006" LastEditorUserId="7006" LastEditDate="2015-06-12T19:30:46.887" LastActivityDate="2015-06-14T20:39:13.600" Title="How to cycle through visual-regexp package findings?" Tags="|search|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13125" PostTypeId="2" ParentId="13123" CreationDate="2015-06-12T19:56:38.413" Score="2" Body="&lt;p&gt;Now that you've clarified that you use &lt;code&gt;vr/isearch-forward&lt;/code&gt; from &lt;code&gt;visual-regexp-steroids.el&lt;/code&gt;, I tried it, and I see no problem. Repeating &lt;code&gt;C-s&lt;/code&gt; advances through the search hits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, it works for me, at least.  All I did was load the file, set &lt;code&gt;vr/engine&lt;/code&gt; to &lt;code&gt;emacs&lt;/code&gt; (since I am used to Emacs-style regexps), and try &lt;code&gt;vr/isearch-forward&lt;/code&gt; with a simple regexp. Using &lt;code&gt;C-s&lt;/code&gt; repeatedly after that navigated through the search hits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it not work if you start Emacs without your init file: &lt;code&gt;emacs -Q&lt;/code&gt;? If that works then recursively bisect your init file to find out what causes the problem.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-12T19:56:38.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13126" PostTypeId="1" CreationDate="2015-06-12T22:10:11.263" Score="2" ViewCount="85" Body="&lt;p&gt;I seem to have a problem with &lt;code&gt;[:upper:]&lt;/code&gt; &lt;code&gt;[:lower:]&lt;/code&gt; and Unicode characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This test fails:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest haskell-upper ()&#xA;  (set-buffer (get-buffer-create &quot;*haskell-mode-buffer*&quot;))&#xA;  (insert &quot;Ż&quot;)&#xA;  (goto-char (point-min))&#xA;  (should (looking-at &quot;[[:upper:]]&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This one (surprisingly) succeeds:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest haskell-upper ()&#xA;  (set-buffer (get-buffer-create &quot;*haskell-mode-buffer*&quot;))&#xA;  (insert &quot;Ż&quot;)&#xA;  (goto-char (point-min))&#xA;  (should (looking-at &quot;[[:lower:]]&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;%c&quot; (char-table-range (current-case-table) ?Ż))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;correctly returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ż&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So case table seems to be setup correctly but regexp machinery does not pick this up. Note that this is a problem only when running in batch mode, in interactive mode it works as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some initialization code that needs to be called before using &lt;code&gt;looking-at&lt;/code&gt;, char classes and Unicode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My version of Emacs:&#xA;Aquamacs 3.2 GNU Emacs 24.4.51.2 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14) of 2014-11-07 (Aquamacs-3.2) on watson.local&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also fails in the same way on Emacs 23.3.1 and Emacs 25.0.50.1.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="5213" LastEditDate="2015-06-13T18:10:07.067" LastActivityDate="2015-06-13T18:10:07.067" Title="Upper/lower regexp char classes and current-case-table" Tags="|regular-expressions|unicode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13127" PostTypeId="1" CreationDate="2015-06-12T23:08:31.807" Score="10" ViewCount="1605" Body="&lt;p&gt;I'm using flycheck for C++ development, and get the following warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#pragma once in main file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In all headers included in a main file.  Searching the webs, I get the impression this has something to do with how gcc and clang (both give the same warning) compile for flymake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get rid of this warning.  Is there anything I can do?  &lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="2274" LastEditDate="2015-06-13T16:31:28.717" LastActivityDate="2019-10-06T09:44:51.210" Title="disable specific warning in flycheck (specifically &quot;#pragma once in main file&quot;)" Tags="|c++|flycheck|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13128" PostTypeId="1" AcceptedAnswerId="13408" CreationDate="2015-06-13T00:53:06.043" Score="15" ViewCount="896" Body="&lt;p&gt;In vim, the following document will cause the &lt;code&gt;$PWD&lt;/code&gt; on lines 2 and 3 to be colored in two different ways:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#/bin/sh&#xA;echo &quot;Current Directory: $PWD&quot;&#xA;echo 'Current Directory: $PWD'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first instance of &lt;code&gt;$PWD&lt;/code&gt; will be in a different color from the rest of the string it is in.  This gives a clear visual indication that the variable will be expanded, rather than treated as literal text. By contrast, the second instance of &lt;code&gt;$PWD&lt;/code&gt; will be colored the same as the rest of the string, because the single quotes cause it to be treated as literal text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any existing emacs modes which provide this type of &quot;shell-quoting awareness?&quot;&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="253" LastEditDate="2015-06-24T19:09:49.023" LastActivityDate="2022-12-31T11:39:32.653" Title="Highlighting shell variables within quotes" Tags="|font-lock|bash|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13129" PostTypeId="2" ParentId="13119" CreationDate="2015-06-13T03:19:39.757" Score="2" Body="&lt;p&gt;Use these lines to avoid duplicate paths in load-path after package-initialize:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not providing the t value to add-to-list as optional APPEND argument avoids duplicate load-paths. To add-to-list to the end of the list without using the t value, then use this &lt;strong&gt;variation&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(reverse (cons '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) (reverse 'package-archives)))&#xA;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-08-20T17:14:49.640" LastActivityDate="2015-08-20T17:14:49.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13130" PostTypeId="1" CreationDate="2015-06-13T03:52:03.950" Score="1" ViewCount="1655" Body="&lt;p&gt;I am trying to move/rename 100+ images inside of a directory, so I am using Image-Dired to view the images as thumbnails and as I move/rename them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to move multiple images at a time, so I am &quot;marking&quot; the thumbnailed images with &lt;code&gt;image-dired-mark-thumb-original-file&lt;/code&gt;, which marks the associated file in the dired buffer. After this, I can move all of the marked files as usual using dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I am using Evil-mode, the default keybindings do not work in the image-dired thumbnail buffer, so I am planning to map some basic keybindings, such as &lt;code&gt;l&lt;/code&gt; and &lt;code&gt;h&lt;/code&gt; to move forward/backward one image, and &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;u&lt;/code&gt; to mark/unmark the image files in the dired buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following, but the keybindings are still being shadowed by evil-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun image-dired-keybindings()&#xA;  (message &quot;making keybindings!&quot;)&#xA;  (local-unset-key (kbd &quot;l&quot;))&#xA;  (local-unset-key (kbd &quot;h&quot;))&#xA;  (local-unset-key (kbd &quot;m&quot;))&#xA;  (local-unset-key (kbd &quot;u&quot;))&#xA;  (local-set-key (kbd &quot;m&quot;) &#xA;                 'image-dired-mark-thumb-original-file)&#xA;  (local-set-key (kbd &quot;u&quot;) &#xA;                 'image-dired-unmark-thumb-original-file)&#xA;  (local-set-key (kbd &quot;l&quot;) &#xA;                 'image-dired-forward-image)&#xA;  (local-set-key (kbd &quot;h&quot;) &#xA;                 'image-dired-backward-image)&#xA;  (message &quot;making keybindings finished&quot;))&#xA;&#xA;&#xA;(add-hook 'image-dired-thumbnail-mode-hook&#xA;          'image-dired-keybindings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? My &lt;code&gt;*Messages*&lt;/code&gt; buffer is logging the debug messages, and here is some detail on the modes in my image dired thumbnail buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption&#xA;Blink-Cursor Column-Number Desktop-Save Electric-Indent Erc-Autojoin&#xA;Erc-Button Erc-Fill Erc-Irccontrols Erc-List Erc-Match Erc-Menu&#xA;Erc-Move-To-Prompt Erc-Netsplit Erc-Networks Erc-Noncommands&#xA;Erc-Pcomplete Erc-Readonly Erc-Ring Erc-Stamp Erc-Track Evil&#xA;Evil-Local File-Name-Shadow Font-Lock Global-Auto-Complete&#xA;Global-Font-Lock Global-Hl-Line Global-Undo-Tree Global-Visual-Line&#xA;Imagex-Global-Sticky Imagex-Sticky Line-Number Menu-Bar Mouse-Wheel&#xA;Read-Only Show-Paren Size-Indication Tooltip Transient-Mark Undo-Tree&#xA;Yas Yas-Global&#xA;&#xA;(Information about these minor modes follows the major mode info.)&#xA;&#xA;image-dired-thumbnail mode defined in `image-dired.el':&#xA;Browse and manipulate thumbnail images using dired.&#xA;Use `image-dired-dired' and `image-dired-setup-dired-keybindings' to get a&#xA;nice setup to start with.&#xA;&#xA;This mode runs the hook `image-dired-thumbnail-mode-hook', as the final step&#xA;during initialization.&#xA;&#xA;key             binding&#xA;---             -------&#xA;&#xA;C-b             image-dired-backward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;C-d             image-dired-delete-char&#xA;  (that binding is currently shadowed by another mode)&#xA;C-f             image-dired-forward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;RET             image-dired-display-thumbnail-original-image&#xA;  (that binding is currently shadowed by another mode)&#xA;C-n             image-dired-next-line&#xA;  (that binding is currently shadowed by another mode)&#xA;C-p             image-dired-previous-line&#xA;  (that binding is currently shadowed by another mode)&#xA;SPC             image-dired-display-next-thumbnail-original&#xA;  (that binding is currently shadowed by another mode)&#xA;.               image-dired-track-original-file&#xA;  (that binding is currently shadowed by another mode)&#xA;D               image-dired-thumbnail-set-image-description&#xA;  (that binding is currently shadowed by another mode)&#xA;L               image-dired-rotate-original-left&#xA;  (that binding is currently shadowed by another mode)&#xA;R               image-dired-rotate-original-right&#xA;  (that binding is currently shadowed by another mode)&#xA;c               image-dired-comment-thumbnail&#xA;  (that binding is currently shadowed by another mode)&#xA;d               image-dired-flag-thumb-original-file&#xA;  (that binding is currently shadowed by another mode)&#xA;g               Prefix Command&#xA;h               image-dired-backward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;l               image-dired-forward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;m               image-dired-mark-thumb-original-file&#xA;  (that binding is currently shadowed by another mode)&#xA;q               image-dired-kill-buffer-and-window&#xA;  (that binding is currently shadowed by another mode)&#xA;r               image-dired-rotate-thumbnail-right&#xA;  (that binding is currently shadowed by another mode)&#xA;t               Prefix Command&#xA;  (that binding is currently shadowed by another mode)&#xA;u               image-dired-unmark-thumb-original-file&#xA;  (that binding is currently shadowed by another mode)&#xA;DEL             image-dired-display-previous-thumbnail-original&#xA;  (that binding is currently shadowed by another mode)&#xA;&amp;lt;C-mouse-1&amp;gt;     image-dired-mouse-toggle-mark&#xA;&amp;lt;C-return&amp;gt;      image-dired-thumbnail-display-external&#xA;&amp;lt;delete&amp;gt;        image-dired-flag-thumb-original-file&#xA;&amp;lt;down&amp;gt;          image-dired-next-line&#xA;  (that binding is currently shadowed by another mode)&#xA;&amp;lt;left&amp;gt;          image-dired-backward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;&amp;lt;mouse-1&amp;gt;       image-dired-mouse-select-thumbnail&#xA;&amp;lt;mouse-2&amp;gt;       image-dired-mouse-display-image&#xA;  (that binding is currently shadowed by another mode)&#xA;&amp;lt;right&amp;gt;         image-dired-forward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;&amp;lt;tab&amp;gt;           image-dired-jump-original-dired-buffer&#xA;  (that binding is currently shadowed by another mode)&#xA;&amp;lt;up&amp;gt;            image-dired-previous-line&#xA;  (that binding is currently shadowed by another mode)&#xA;&#xA;g f             image-dired-line-up&#xA;  (that binding is currently shadowed by another mode)&#xA;g g             image-dired-line-up-dynamic&#xA;  (that binding is currently shadowed by another mode)&#xA;g i             image-dired-line-up-interactive&#xA;  (that binding is currently shadowed by another mode)&#xA;&#xA;...TRUNCATED FOR BREVITY....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And inside the image-dired-thumbnail buffer, running &lt;code&gt;C-h k&lt;/code&gt; for the command &lt;code&gt;l&lt;/code&gt; shows that &lt;code&gt;l&lt;/code&gt; is still bound to the evil-mode keybinding &lt;code&gt;evil-forward-char&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;l runs the command evil-forward-char, which is an interactive compiled&#xA;Lisp function in `evil-commands.el'.&#xA;&#xA;It is bound to &amp;lt;right&amp;gt;, SPC, l.&#xA;&#xA;(evil-forward-char &amp;amp;optional COUNT CROSSLINES NOERROR)&#xA;&#xA;Move cursor to the right by COUNT characters.&#xA;Movement is restricted to the current line unless CROSSLINES is non-nil.&#xA;If NOERROR is non-nil, don't signal an error upon reaching the end&#xA;of the line or the buffer; just return nil.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to I resolve this conflict to easily mark and traverse images in my images-dired-thumbnail buffer?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following @Drew's suggestion below, I tried resolving this using the &lt;code&gt;image-dired-thumbnail-mode-map&lt;/code&gt;, as shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'image-dired-thumbnail-mode-hook&#xA;      (lambda ()&#xA;            (define-key image-dired-thumbnail-mode-map &quot;l&quot; 'image-dired-forward-image)&#xA;            (define-key image-dired-thumbnail-mode-map &quot;h&quot; 'image-dired-backward-image)&#xA;            (define-key image-dired-thumbnail-mode-map &quot;u&quot; 'image-dired-unmark-thumb-original-file)&#xA;            (define-key image-dired-thumbnail-mode-map &quot;m&quot; 'image-dired-mark-thumb-original-file)&#xA;            )&#xA;          )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried substituting &lt;code&gt;&quot;l&quot;&lt;/code&gt; with &lt;code&gt;(kbd &quot;l&quot;)&lt;/code&gt;, but no success. I am still getting the same issue, where my mode help menu lists the key bindings as &lt;code&gt;currently shadowed by another mode&lt;/code&gt;. &lt;code&gt;C-h m&lt;/code&gt; shows the same conflicts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;h               image-dired-backward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;l               image-dired-forward-image&#xA;  (that binding is currently shadowed by another mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I double-checked my version of &lt;code&gt;image-dired&lt;/code&gt; using &lt;code&gt;list-packages&lt;/code&gt;, and it was listed as 0.4.11. I believe the source is &lt;a href=&quot;http://web.mit.edu/Emacs/source/emacs/lisp/image-dired.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-06-13T08:11:54.063" LastActivityDate="2015-06-13T08:11:54.063" Title="Resolving keybinding conflicts with Evil-mode: Troubleshooting Image-Dired bindings" Tags="|key-bindings|evil|images|image-dired|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13131" PostTypeId="2" ParentId="13130" CreationDate="2015-06-13T08:11:17.227" Score="5" Body="&lt;p&gt;Apparently there was some kind of evil-mode conflict. The following line fixed everything:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-set-initial-state 'image-dired-thumbnail-mode 'emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this helps someone :-)&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-06-13T08:11:17.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13132" PostTypeId="1" AcceptedAnswerId="13158" CreationDate="2015-06-13T09:29:11.750" Score="12" ViewCount="7382" Body="&lt;p&gt;If I am exploring my file system in Dired-mode and I come across a video file, for example, it would be nice to be able to play that video file. How can I do this in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can use Emacs to open a video file, but the result is not very useful - I just get the encoded file displayed as text. Is there a way the Emacs can play video files, or perhaps link it to a command that has another program like vlc play the file?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-06-15T13:28:16.000" Title="Emacs: how to open and play a video file" Tags="|dired|video|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13133" PostTypeId="1" CreationDate="2015-06-13T10:37:58.473" Score="4" ViewCount="1038" Body="&lt;p&gt;I recently started using the &lt;a href=&quot;http://fishshell.com/&quot; rel=&quot;nofollow&quot;&gt;fish&lt;/a&gt; shell. I tried using it in &lt;code&gt;term-mode&lt;/code&gt; in Emacs. One characteristic of this shell is that it shortens the current working directory before printing it as the prompt. For example, if the current directory is &lt;code&gt;/media&lt;/code&gt;, the prompt will contain &lt;code&gt;/media&lt;/code&gt; but if the current working directory is &lt;code&gt;/media/directory&lt;/code&gt;, the prompt will be &lt;code&gt;/m/directory&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of this, Dirtrack mode in Emacs cannot keep track of the current directory, so &lt;code&gt;default-directory&lt;/code&gt; is not updated. This affects some commands like &lt;code&gt;C-c C-f&lt;/code&gt; which, as a prompt, suggests &lt;code&gt;default-directory&lt;/code&gt;. Since this variable is not updated, the prompt will be the directory from where I started &lt;code&gt;term-mode&lt;/code&gt; and not the current working directory in the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want &lt;code&gt;default-directory&lt;/code&gt; to be updated when I change directory in the shell just like how it works with bash. How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Caveats:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I like this shortening feature of &lt;code&gt;fish-shell&lt;/code&gt; and I don't want to change the prompt style.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since Emacs sends every key-stroke to the shell (with some exceptions), I thought to run a function every time &lt;code&gt;&amp;lt;Ret&amp;gt;&lt;/code&gt; is pressed. But I couldn't find out how this can be done. Suggestions on this approach are welcome.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8516" LastEditorUserId="25" LastEditDate="2015-06-15T09:17:54.553" LastActivityDate="2024-02-24T02:25:27.443" Title="dirtrack mode with fish-shell" Tags="|shell|term|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13134" PostTypeId="1" AcceptedAnswerId="45035" CreationDate="2015-06-13T11:45:51.413" Score="13" ViewCount="805" Body="&lt;p&gt;When running the compile command and jumping to the 'next error', emacs identifies the line of the current error by placing a little black triangle, pointing right, in the left-hand fringe of the &lt;strong&gt;*compilation*&lt;/strong&gt; buffer.  This is nice, but my old eyes would like a bolder indicator.   The fundamental goal here is to be able to quickly visually identify which line emacs is identifying as the current compiler error.  Some solutions which come to mind:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a different face for the current error (bigger for example).&lt;/li&gt;&#xA;&lt;li&gt;a different background color for the current error (something like hl-line-mode).&lt;/li&gt;&#xA;&lt;li&gt;a bigger triangle.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;but I'm open to other ideas too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me out? &lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="8576" LastEditDate="2015-06-14T08:52:16.753" LastActivityDate="2022-08-13T00:14:42.227" Title="emphasise the current error in the *compilation* window" Tags="|compilation|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13135" PostTypeId="2" ParentId="13133" CreationDate="2015-06-13T11:49:57.510" Score="2" Body="&lt;p&gt;You could try the procfs approach. If you'd use the &lt;code&gt;shell&lt;/code&gt; command, this should work.  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun shell-procfs-dirtrack (str)&#xA;  (prog1 str&#xA;    (when (string-match comint-prompt-regexp str)&#xA;      (let ((directory (file-symlink-p&#xA;                        (format &quot;/proc/%s/cwd&quot;&#xA;                                (process-id&#xA;                                 (get-buffer-process&#xA;                                  (current-buffer)))))))&#xA;        (when (file-directory-p directory)&#xA;          (cd directory))))))&#xA;&#xA;(define-minor-mode shell-procfs-dirtrack-mode&#xA;  &quot;Track shell directory by inspecting procfs.&quot;&#xA;  nil nil nil&#xA;  (cond (shell-procfs-dirtrack-mode&#xA;         (when (bound-and-true-p shell-dirtrack-mode)&#xA;           (shell-dirtrack-mode 0))&#xA;         (when (bound-and-true-p dirtrack-mode)&#xA;           (dirtrack-mode 0))&#xA;         (add-hook 'comint-preoutput-filter-functions&#xA;                   'shell-procfs-dirtrack nil t))&#xA;        (t&#xA;         (remove-hook 'comint-preoutput-filter-functions&#xA;                      'shell-procfs-dirtrack t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-06-13T19:00:53.810" LastActivityDate="2015-06-13T19:00:53.810" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13136" PostTypeId="2" ParentId="13055" CreationDate="2015-06-13T16:00:47.717" Score="3" Body="&lt;p&gt;Since you mentioned &quot;other format&quot; also, here's a solution for LaTex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_HEADER: \setlength{\parindent}{1cm} % Default is 15pt.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Insert the above line at the top of your org file and use the LaTex back-engine to print.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-13T16:00:47.717" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13137" PostTypeId="2" ParentId="13134" CreationDate="2015-06-13T16:28:34.843" Score="1" Body="&lt;p&gt;Doesn't &lt;code&gt;next-error&lt;/code&gt; scroll the compilation-errors buffer, so that the current error shows as the first line of the window? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, doesn't it at least put the cursor on the current error line? If it does, and if the cursor is not visible enough for you, consider using &lt;code&gt;hl-line-mode&lt;/code&gt; to highlight the current line.  Or consider using library &lt;a href=&quot;http://www.emacswiki.org/emacs/CrosshairHighlighting&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;crosshairs&lt;/code&gt;&lt;/a&gt; to highlight the current line and current column.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update after your comment&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought you were invoking &lt;code&gt;next-error&lt;/code&gt; in buffer &lt;code&gt;*compilation*&lt;/code&gt;.  If you do that then the line is scrolled to the top, as I described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you are invoking &lt;code&gt;next-error&lt;/code&gt; outside buffer &lt;code&gt;*compilation*&lt;/code&gt; then you need to use &lt;code&gt;next-error-hook&lt;/code&gt; to, &lt;strong&gt;in buffer &lt;code&gt;*compilation*&lt;/code&gt;&lt;/strong&gt;, highlight the current line or fringe or whatever, in whatever way you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a quick-and-dirty example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  &quot;...&quot;&#xA;  (with-current-buffer next-error-last-buffer&#xA;    (hl-line-mode 1)))&#xA;&#xA;(add-hook 'next-error-hook 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Of course, you really only need to turn on &lt;code&gt;hl-line-mode&lt;/code&gt; once in that buffer. &#xA;Doing it as shown above is overkill, but it doesn't hurt.&#xA;You might think that you could just add &lt;code&gt;foo&lt;/code&gt; to &lt;code&gt;grep-mode-hook&lt;/code&gt; or &lt;code&gt;compilation-mode-hook&lt;/code&gt;.  But when those hooks are invoked there is no &lt;code&gt;next-error-last-buffer&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There are two user options that control the ways to indicate the hit &lt;em&gt;in the source buffer&lt;/em&gt; (not in the compilation buffer): &lt;code&gt;next-error-highlight&lt;/code&gt; and &lt;code&gt;next-error-highlight-no-select&lt;/code&gt;.  They offer the same possibilities, but they are used by different commands.  The possibilities include using a fringe arrow or highlighting the match for a certain time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;But there is no such option controlling indication of the current hit in buffer &lt;code&gt;*compilation*&lt;/code&gt;.  So Emacs offers two options (where one would probably be enough) for the source buffer but no option for the compilation buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You might consider filing an enhancement request, to get a similar option for the compilation (including grep) buffer: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.  Using a hook with your own function to perform the highlighting is OK, but it shouldn't be necessary.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And if you just want to change the fringe indicator, you can do this (use whatever fringe bitmap you want, instead of &lt;code&gt;filled-rectangle&lt;/code&gt; -- see (elisp) &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Bitmaps.html&quot; rel=&quot;nofollow&quot;&gt;Fringe Bitmaps&lt;/a&gt; for a list of the predefined ones):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun bar ()&#xA;  (with-current-buffer next-error-last-buffer&#xA;    (unless (eq 'filled-rectangle (cdr (assq 'overlay-arrow fringe-indicator-alist)))&#xA;      (setq fringe-indicator-alist&#xA;            (cons '(overlay-arrow . filled-rectangle) fringe-indicator-alist)))))&#xA;&#xA;(add-hook 'next-error-hook 'bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update #2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just discovered that if you turn off showing the left fringe then you will see the behavior I described in the beginning: the window is scrolled to put the current error at the top.  So that is another possibility. (It is the behavior I see in my setup, since I do not show fringe.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a bug in this behavior, which I just reported (&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20829&quot; rel=&quot;nofollow&quot;&gt;#20829&lt;/a&gt;).  What counts (currently, until the bug is fixed) is whether the left fringe is showing in the selected window when you do &lt;code&gt;C-x `&lt;/code&gt; (&lt;code&gt;next-error&lt;/code&gt;). It is (currently) not enough that the window showing the compilation buffer does not show the left fringe.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-16T19:54:39.887" LastActivityDate="2015-06-16T19:54:39.887" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13138" PostTypeId="2" ParentId="13132" CreationDate="2015-06-13T16:48:59.710" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; helps with this, but even vanilla Dired offers the basics of what you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/3124/105&quot;&gt;This answer&lt;/a&gt; tells you how, in detail. It explains how to use any external program to access any file, even though the question it replies to is only about using an external PDF viewer to view PDF files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer also depends to some extent on what platform you use.  In particular, if you use MS Windows then you can take advantage of Windows file associations etc.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-06-13T16:48:59.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13139" PostTypeId="2" ParentId="12833" CreationDate="2015-06-13T20:44:28.213" Score="3" Body="&lt;p&gt;This variable preserves both the point and the screen position when scrolling:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq scroll-preserve-screen-position 'always)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-13T20:44:28.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13140" PostTypeId="2" ParentId="13134" CreationDate="2015-06-13T20:59:56.187" Score="1" Body="&lt;p&gt;Here is an example of how to modify the bitmap image that appears in the left-hand fringe of the &lt;code&gt;*compilation*&lt;/code&gt; buffer (e.g., the &lt;code&gt;*grep*&lt;/code&gt; results buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-fringe-bitmap 'custom-right-arrow [128 192 96 48 24 48 96 192 128] 9 8 'center)&#xA;&#xA;(put 'overlay-arrow-position 'overlay-arrow-bitmap 'custom-right-arrow)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an example of how to set the colors of fringe bitmaps:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface right-triangle-face&#xA;  '((t (:background &quot;red&quot; :foreground &quot;yellow&quot;)))&#xA;  &quot;Face for `right-triangle-face`.&quot;)&#xA;&#xA;(set-fringe-bitmap-face 'right-triangle 'right-triangle-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an example of how to create your own fringe bitmap:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; AUTHOR:  Nikolaj Schumacher -- https://github.com/nschum/fringe-helper.el&#xA;;;&#xA;(defun fringe-helper-convert (&amp;amp;rest strings)&#xA;&quot;Convert STRINGS into a vector usable for `define-fringe-bitmap'.&#xA;Each string in STRINGS represents a line of the fringe bitmap.&#xA;Periods (.) are background-colored pixel; Xs are foreground-colored. The&#xA;fringe bitmap always is aligned to the right. If the fringe has half&#xA;width, only the left 4 pixels of an 8 pixel bitmap will be shown.&#xA;For example, the following code defines a diagonal line.&#xA;\(fringe-helper-convert&#xA;\&quot;XX......\&quot;&#xA;\&quot;..XX....\&quot;&#xA;\&quot;....XX..\&quot;&#xA;\&quot;......XX\&quot;\)&quot;&#xA;  (unless (cdr strings)&#xA;  ;; only one string, probably with newlines&#xA;    (setq strings (split-string (car strings) &quot;\n&quot;)))&#xA;  (apply 'vector&#xA;    (mapcar&#xA;      (lambda (str)&#xA;        (let ((num 0))&#xA;          (dolist (c (string-to-list str))&#xA;            (setq num (+ (* num 2) (if (eq c ?.) 0 1))))&#xA;          num))&#xA;      strings)))&#xA;&#xA;(define-fringe-bitmap 'backslash (fringe-helper-convert&#xA;  &quot;XX......&quot;&#xA;  &quot;XX......&quot;&#xA;  &quot; XX.....&quot;&#xA;  &quot;.XX.....&quot;&#xA;  &quot;..XX....&quot;&#xA;  &quot;..XX....&quot;&#xA;  &quot;...XX...&quot;&#xA;  &quot;...XX...&quot;&#xA;  &quot;....XX..&quot;&#xA;  &quot;....XX..&quot;&#xA;  &quot;.....XX.&quot;&#xA;  &quot;.....XX.&quot;) nil nil 'center)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-14T05:18:46.993" LastActivityDate="2015-06-14T05:18:46.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13141" PostTypeId="2" ParentId="12374" CreationDate="2015-06-13T22:34:28.627" Score="1" Body="&lt;p&gt;Emacs's echo area is not a regular interactive terminal that responds to \r; instead it collects all the output and presents it on one line. Anything sent to echo is also logged to the &lt;em&gt;Messages&lt;/em&gt; buffer. Multi-line outputs to the echo area are instead displayed in a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to get just 10 as the response, then echo only the final result as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for my $i (0..10) {&#xA;    $result=$i&#xA;}&#xA;print &quot;$result&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if all output is needed with proper formatting, then replace \r with \n as shown here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for my $i (0..10) {&#xA;    print &quot;$i\n&quot;&#xA;}&#xA;print &quot;\n&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more complex output with multibyte character output that is being mangled by the shell, you can tweak the &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x universal-coding-system-argument&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to specify command-specific encoding before running the shell-command. The shortcut for universal-coding-system-arugment is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x RET c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope one of these helps.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-13T22:34:28.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13144" PostTypeId="2" ParentId="10204" CreationDate="2015-06-13T23:14:32.233" Score="1" Body="&lt;p&gt;If you have installed the theme from &lt;a href=&quot;https://github.com/sellout/emacs-color-theme-solarized&quot; rel=&quot;nofollow&quot;&gt;https://github.com/sellout/emacs-color-theme-solarized&lt;/a&gt; with package name that begins with color-theme-solarized, then I have noticed random changes also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reinstalled the theme from &lt;a href=&quot;https://github.com/bbatsov/solarized-emacs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bbatsov/solarized-emacs&lt;/a&gt; with package name solarized-theme, then everything went back to normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-13T23:14:32.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13145" PostTypeId="1" AcceptedAnswerId="13148" CreationDate="2015-06-13T23:41:08.823" Score="3" ViewCount="102" Body="&lt;p&gt;I'd like to maintain several distinct &lt;code&gt;abbrevs&lt;/code&gt; files for different types of abbreviation expansions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read-abbrev-file &quot;~/Dropbox/elisp/main-abbrevs-file.abbrev_defs&quot;)&#xA;(read-abbrev-file &quot;~/Dropbox/elisp/own-separate-abbrevs.abbrev_defs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what happens is the all the abbrevs in my other separate abbrevs files get automatically sucked into and added to my main abbrevs file, which I don't want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can do &lt;code&gt;(setq save-abbrevs nil)&lt;/code&gt;... but this disables other functionality that I want, which is to &lt;a href=&quot;http://endlessparentheses.com/ispell-and-abbrev-the-perfect-auto-correct.html&quot; rel=&quot;nofollow&quot;&gt;automatically learn my typos and add them to my main abbrevs file&lt;/a&gt;—functionality which seems to require &lt;code&gt;(setq save-abbrevs t)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get it so that Emacs automatically learns new abbrevs from ispell, but still allow me to keep a separate abbrevs file with abbrevs that don't get automatically added to my main abbrevs file?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-06-13T23:47:44.210" LastActivityDate="2015-06-14T05:51:10.677" Title="how to keep my abbrevs table files separate?" Tags="|abbrev|ispell|flyspell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13147" PostTypeId="2" ParentId="13132" CreationDate="2015-06-14T04:39:57.020" Score="0" Body="&lt;p&gt;The following snippet will work on an OSX operating system for just one file where the cursor is currently at -- the code does not provide for examining the file extension and/or guessing the correct application that matches the file extension:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(start-process&#xA;  &quot;my-process-name&quot; ;; process name&#xA;  nil ;; buffer output name, if an output buffer is so desired.&#xA;  &quot;open&quot; ;; argument 1&#xA;  &quot;-a&quot; ;; argument 2&#xA;  &quot;/Applications/VLC.app/Contents/MacOS/VLC&quot; ;; argument 3&#xA;  (dired-get-file-for-visit)) ;; argument 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the original poster wants to deal with opening multiple marked files, then use &lt;code&gt;dired-get-marked-files&lt;/code&gt; and &lt;code&gt;mapcar&lt;/code&gt; down the list.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-14T04:52:31.763" LastActivityDate="2015-06-14T04:52:31.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13148" PostTypeId="2" ParentId="13145" CreationDate="2015-06-14T05:51:10.677" Score="2" Body="&lt;p&gt;Calling a &lt;code&gt;(set (make-local-variable 'abbrev-file-name) 'My-current-abbrev-file)&lt;/code&gt; preceding this &lt;code&gt;read-abbrev-file&lt;/code&gt; should help.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-06-14T05:51:10.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13149" PostTypeId="1" AcceptedAnswerId="13151" CreationDate="2015-06-14T16:37:17.813" Score="2" ViewCount="541" Body="&lt;p&gt;I like to view pdf file in a dired buffer using xpdf. The following code in my ~/.emacs works fine for emacs-24. Just hitting &quot;v&quot; launches the xpdf with file (I stipulated xpdf in my ~/.mailcap file).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'mailcap-parse-mailcaps &quot;mailcap&quot; nil t)&#xA;(autoload 'mm-mailcap-command &quot;mm-decode&quot;)&#xA;(defadvice dired-view-file (around use-mailcap-mime-data activate)&#xA;&quot;Use an external viewer to view a file according to `mailcap-mime-data'.&quot;&#xA;(unless (let ((file (dired-get-file-for-visit))&#xA;extension type command)&#xA;(and (not (file-directory-p file))&#xA;(progn&#xA;(mailcap-parse-mailcaps)&#xA;(setq extension (file-name-extension file)))&#xA;(setq type (mailcap-extension-to-mime extension))&#xA;(setq command (mailcap-mime-info type))&#xA;(setq command (mm-mailcap-command command file nil))&#xA;(prog1&#xA;t&#xA;(shell-command command))))&#xA;ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However it stopped working with emacs-25 (emacs-25.0.5.11) with the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mm-mailcap-command: Wrong type argument: stringp, doc-view-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course I can run xpdf via a shell command, but I am curious why emacs-25 does not seem to parse mailcaps. I haven't found any answers on the emacs-devel forums.&lt;/p&gt;&#xA;" OwnerUserId="6532" LastActivityDate="2015-06-14T19:04:03.733" Title="emacs-25: mailcap settings for dired-view-file" Tags="|dired|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13150" PostTypeId="1" CreationDate="2015-06-14T16:47:50.543" Score="4" ViewCount="781" Body="&lt;p&gt;I'm using org-mode with &lt;code&gt;C-c C-x C-c&lt;/code&gt; &lt;code&gt;(org-agenda-columns)&lt;/code&gt; like a organizer, the format which I use for that&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-columns-default-format&#xA;      &amp;quot;%TODO %30ITEM %30DEADLINE %15SCHEDULED %3PRIORITY %TAGS %5Effort(Effort){:} %6CLOCKSUM&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As you see in &lt;strong&gt;DEADLINE&lt;/strong&gt; column, all dates format are &lt;code&gt;DD.MM.YYYY&lt;/code&gt; It's not easy to understand how many days that we have for due date.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wTpbe.png&quot; alt=&quot;agenda view&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Regular &lt;code&gt;org-agenda&lt;/code&gt; &lt;code&gt;(C-a a)&lt;/code&gt; shows to us what is the due date.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/lq63j.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I want to learn how to change &lt;code&gt;DEADLINE&lt;/code&gt; column like in &lt;code&gt;org-agenda&lt;/code&gt; (In 2 days,10 d. ago)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Maybe this links can help&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/12839/use-formula-in-agenda-clockreport-to-convert-time&quot;&gt;Use formula in agenda clockreport to convert time? (pomodoro count in Agenda)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Special-properties.html#Special-properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org Agenda Special Properies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Column-attributes.html#Column-attributes&quot; rel=&quot;nofollow noreferrer&quot;&gt;Column Attributes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8426" LastEditorUserId="8426" LastEditDate="2021-01-06T10:24:59.700" LastActivityDate="2021-01-06T10:24:59.700" Title="org-agenda-colums deadline time style" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="13151" PostTypeId="2" ParentId="13149" CreationDate="2015-06-14T19:04:03.733" Score="3" Body="&lt;h3&gt;What's happening&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The reason this is happening is that the &lt;code&gt;mailcap-mime-data&lt;/code&gt;&#xA;variable includes an entry for &lt;code&gt;docview-mode&lt;/code&gt; and another for &lt;code&gt;xpdf&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar mailcap-mime-data&#xA;  `((&quot;application&quot;&#xA;     ;; snip&#xA;     (&quot;pdf&quot;&#xA;      (viewer . doc-view-mode)&#xA;      (type . &quot;application/pdf&quot;)&#xA;      (test . (eq window-system 'x)))&#xA;     (&quot;pdf&quot;&#xA;      (viewer . &quot;xpdf %s&quot;)&#xA;      (type . &quot;application/pdf&quot;)&#xA;      (&quot;print&quot; . ,(concat &quot;pdftops %s - | &quot; mailcap-print-command))&#xA;      (test . (eq window-system 'x)))&#xA;     ;; snip&#xA;     )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both entries are viable on your system, and the function&#xA;&lt;code&gt;mailcap-viewer-lessp&lt;/code&gt; then decides that &lt;code&gt;doc-view-mode&lt;/code&gt; is&#xA;prefereable to &lt;code&gt;xpdf&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, note how the &lt;code&gt;viewer&lt;/code&gt; entry there is a symbol, not a string.&#xA;Whereas the advice you're using assumes that the &lt;code&gt;viewer&lt;/code&gt; is a string&#xA;(shell-command).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;How to fix&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;One way to work around your problem is to remove the &lt;code&gt;docview&lt;/code&gt; entry&#xA;from &lt;code&gt;mailcap-mime-data&lt;/code&gt; (you may also have to remove other non-xpdf&#xA;entries). But the advice you have might run into the same problem for&#xA;other file formats.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-06-14T19:04:03.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13152" PostTypeId="1" AcceptedAnswerId="13247" CreationDate="2015-06-14T20:30:43.707" Score="0" ViewCount="425" Body="&lt;p&gt;I'm using GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2015-04-10 on builder10-9.porkrind.org (from emacsformacosx.com) and I've got this annoying transparency going on and I don't know how to disable it. See attached image (it's not easy to spot but it's there).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/q7QnC.png&quot; alt=&quot;Took a photo with my phone since it&amp;#39;s not screen-grab-able&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8586" LastEditorUserId="8586" LastEditDate="2015-06-17T20:28:27.587" LastActivityDate="2015-06-17T22:21:43.630" Title="Emacs 24 GUI on OXS turn off transparency" Tags="|osx|emacs24.4|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13153" PostTypeId="1" AcceptedAnswerId="13155" CreationDate="2015-06-14T20:33:37.587" Score="1" ViewCount="430" Body="&lt;p&gt;I'm trying to manage my passwords using the &lt;a href=&quot;https://wiki.archlinux.org/index.php/Pass&quot; rel=&quot;nofollow&quot;&gt;pass&lt;/a&gt; script from &lt;code&gt;shell-mode&lt;/code&gt; inside Emacs. The script prompts me to enter the password twice as is customary when adding or changing passwords. The first time it asks for the password, Emacs successfully hides it, placing little dots in the message area. This is the desired behavior. Unfortunately, the second time it asks for the password, Emacs happily prints the characters to the &lt;code&gt;shell-mode&lt;/code&gt; buffer. Is there a configuration setting I can add to make sure it hides the password both times?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-06-14T21:48:09.753" Title="inserting passwords into pass from shell-mode" Tags="|shell-mode|passwords|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13154" PostTypeId="2" ParentId="13123" CreationDate="2015-06-14T20:39:13.600" Score="2" Body="&lt;p&gt;Author of the package here. Hitting &lt;code&gt;C-s&lt;/code&gt; and &lt;code&gt;C-r&lt;/code&gt; should work. Just tested it with the python engine.&lt;/p&gt;&#xA;" OwnerUserId="8587" LastActivityDate="2015-06-14T20:39:13.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13155" PostTypeId="2" ParentId="13153" CreationDate="2015-06-14T21:48:09.753" Score="5" Body="&lt;p&gt;Configure &lt;code&gt;comint-password-prompt-regexp&lt;/code&gt; so that it includes whatever text &lt;code&gt;pass&lt;/code&gt; gives at the second prompt. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternative answer, instead of just typing the password, you could type &lt;code&gt;M-x send-invisible RET enter-the-password RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastActivityDate="2015-06-14T21:48:09.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13156" PostTypeId="2" ParentId="12935" CreationDate="2015-06-14T22:52:54.490" Score="2" Body="&lt;p&gt;I've &lt;a href=&quot;https://github.com/holtzermann17/command-log-mode&quot; rel=&quot;nofollow&quot;&gt;added [in my fork]&lt;/a&gt; the following setup steps to &lt;code&gt;command-log-mode&lt;/code&gt; to stash recently typed text in a variable.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar clm/log-text t&#xA;  &quot;A non-nil setting means text will be saved to the command log.&quot;)&#xA;&#xA;(defvar clm/recent-history-string &quot;&quot;&#xA;  &quot;This string will hold recently typed text.&quot;)&#xA;&#xA;(defun clm/recent-history ()&#xA;  (setq clm/recent-history-string&#xA;    (concat clm/recent-history-string&#xA;        (buffer-substring-no-properties (- (point) 1) (point)))))&#xA;&#xA;(add-hook 'post-self-insert-hook 'clm/recent-history)&#xA;&#xA;(defun clm/zap-recent-history ()&#xA;  (unless (or (member this-original-command&#xA;              clm/log-command-exceptions*)&#xA;          (eq this-original-command #'self-insert-command))&#xA;    (setq clm/recent-history-string &quot;&quot;)))&#xA;&#xA;(add-hook 'post-command-hook 'clm/zap-recent-history)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I run the following snippet at a suitable point:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;     (when clm/log-text&#xA;       (if (eq clm/last-keyboard-command 'self-insert-command)&#xA;           (insert &quot;[text: &quot; clm/recent-history-string &quot;]\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've found that &lt;code&gt;(setq clm/log-command-exceptions* '(nil ignore))&lt;/code&gt; is a good setting for logging all commands, &lt;em&gt;except&lt;/em&gt; those which have been explicitly ignored (like inadvertent mouse actions).  And don't forget &lt;code&gt;(setq command-log-mode-is-global t)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample log:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;H      self-insert-command [35 times] &#xA;[text: Here is an example of how it works.]&#xA;RET    newline&#xA;P      self-insert-command [12 times] &#xA;[text: Pretty nice.]&#xA;RET    newline&#xA;I      self-insert-command [30 times] &#xA;[text: If you make mistakes when typo]&#xA;DEL    backward-delete-char-untabify&#xA;i      self-insert-command [41 times] &#xA;[text: ing you have to read the lines separetly.]&#xA;&amp;lt;C-backspace&amp;gt;&#xA;       (lambda nil (interactive) (kill-sexp -1))&#xA;s      self-insert-command [11 times] &#xA;[text: separately.]&#xA;RET    newline&#xA;C-x o      other-window&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As Andrew Swann asked in a comment on this post: Where are the requested timestamps?  They are there but really this requires an...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;: Command log mode stores time stamps in text properties, which is why you don't see them above.  I added &lt;a href=&quot;https://github.com/holtzermann17/command-log-mode/commit/dd497de38f4acdee068f21a9516e3ad94675fac9&quot; rel=&quot;nofollow&quot;&gt;[commit dd497d]&lt;/a&gt; an export function that exposes them in plain text in the log file when that is written to disk .  Here what that export looks like (for another bit of interaction):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[2015-06-15T00:46:24] ;    self-insert-command [19 times] &#xA;[text: ;; One question is ]&#xA;[2015-06-15T00:46:28] &amp;lt;C-backspace&amp;gt;&#xA;[2015-06-15T00:46:28]      (lambda nil (interactive) (kill-sexp -1))&#xA;[2015-06-15T00:46:28] t    self-insert-command [47 times] &#xA;[text: that seems worth asking is whether this noticeb]&#xA;[2015-06-15T00:46:35] DEL      backward-delete-char-untabify&#xA;[2015-06-15T00:46:36] a    self-insert-command [4 times] &#xA;[text: ably]&#xA;[2015-06-15T00:46:36] H-s      ispell-word&#xA;[2015-06-15T00:46:37] SPC      self-insert-command [59 times] &#xA;[text:  slows down the experience of typing.  If it does, I wonder]&#xA;[2015-06-15T00:46:48] RET      newline&#xA;[2015-06-15T00:46:48] ;    self-insert-command [25 times] &#xA;[text: ;; if there are things ta]&#xA;[2015-06-15T00:46:52] &amp;lt;C-backspace&amp;gt;&#xA;[2015-06-15T00:46:52]      (lambda nil (interactive) (kill-sexp -1))&#xA;[2015-06-15T00:46:52] t    self-insert-command [32 times] &#xA;[text: that could be done that would se]&#xA;[2015-06-15T00:46:56] DEL      backward-delete-char-untabify&#xA;[2015-06-15T00:46:56] p    self-insert-command [18 times] &#xA;[text: peed it up.  It's ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Some other natural metadata to include would be the name of the buffer and the current mode, which would help with subsequent analytics... coming up soon.)&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="8406" LastEditDate="2015-06-15T14:23:10.710" LastActivityDate="2015-06-15T14:23:10.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13157" PostTypeId="2" ParentId="13002" CreationDate="2015-06-15T02:22:41.230" Score="0" Body="&lt;p&gt;Instead of org-startup-folded, use an equivalent in-buffer setting to force org-mode to one of the four states. For example, insert this line at the top of the org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: showeverything&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and you will be able to open the org file fully expanded. As long as you don't edit that line while in artist mode, you'll get the behavior as specified in startup directive.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-15T02:22:41.230" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13158" PostTypeId="2" ParentId="13132" CreationDate="2015-06-15T02:23:10.230" Score="7" Body="&lt;p&gt;On Linux I do this all the time. &#xA;While in &lt;code&gt;dired&lt;/code&gt; mode, have the cursor on the file you want to watch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;!&lt;/code&gt;, followed by the program you want to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;mplayer&lt;/code&gt;, so I type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;!mplayer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And that's it. You could just as well use vlc, or whatever works on your platform:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;!vlc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's really good, using dired, is that I get a window with the mplayer output (which I don't get if, with a file editor such as &lt;code&gt;nautilus&lt;/code&gt; or &lt;code&gt;thunar&lt;/code&gt;, I right click and request the file to be stared with mplayer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, no need of any macros or extensions. Just ... &lt;code&gt;!&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8588" LastActivityDate="2015-06-15T02:23:10.230" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13159" PostTypeId="1" AcceptedAnswerId="13160" CreationDate="2015-06-15T04:21:52.527" Score="0" ViewCount="450" Body="&lt;p&gt;In OSX' iTerm, you can instantly show/hide the window by the (default) &lt;kbd&gt;alt-space&lt;/kbd&gt; keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure emacs to have similar functionality? I want to run GUI emacs, and be able to show/hide it on whim.&lt;/p&gt;&#xA;" OwnerUserId="8590" LastActivityDate="2015-06-15T06:23:54.377" Title="System Wide Hide/Show Keybinding" Tags="|key-bindings|window|keymap|gui-emacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13160" PostTypeId="2" ParentId="13159" CreationDate="2015-06-15T06:23:54.377" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://qsapp.com/index.php&quot; rel=&quot;nofollow&quot;&gt;Quicksilver&lt;/a&gt; can be used on the Mac to create a global keyboard shortcut to activate Emacs - for example I have F1 to bring up a terminal, F2 to bring up Emacs, F3 to bring up Firefox.  With these in place I don't find much of a need to hide applications as the one appears over the top of the old one, but as the previous poster said, you can bind &quot;ns-do-hide-emacs&quot; to hide it.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2015-06-15T06:23:54.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13161" PostTypeId="2" ParentId="10665" CreationDate="2015-06-15T07:10:18.157" Score="3" Body="&lt;p&gt;You should be able to just enable &lt;code&gt;company-mode&lt;/code&gt; globally without any problems with Elpy (if there are any, please do file a bug report!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use auto-complete in buffers other than Python mode buffers (auto-complete supports different backends from company-mode, so might be preferable for some), by removing &lt;code&gt;python-mode&lt;/code&gt; from &lt;code&gt;ac-modes&lt;/code&gt;. This will then not enable auto-complete in Python buffers.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2015-06-15T07:10:18.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13163" PostTypeId="1" AcceptedAnswerId="17198" CreationDate="2015-06-15T09:05:57.620" Score="2" ViewCount="610" Body="&lt;p&gt;In Emacs with &lt;code&gt;cider&lt;/code&gt; and &lt;code&gt;lein&lt;/code&gt; installed, I can &lt;code&gt;M-x cider-jack-in&lt;/code&gt; to start clojure repl. I installed &lt;code&gt;boot&lt;/code&gt; and would like to switch from &lt;code&gt;lein&lt;/code&gt; to &lt;code&gt;boot&lt;/code&gt;. How to set &lt;code&gt;cider&lt;/code&gt; to use &lt;code&gt;boot&lt;/code&gt; middle ware? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I don't want to remove leiningen right now.)&lt;/p&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2017-04-12T21:34:58.700" Title="How to set cider using boot middle ware?" Tags="|clojure|cider|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13164" PostTypeId="1" AcceptedAnswerId="13180" CreationDate="2015-06-15T09:16:32.417" Score="1" ViewCount="737" Body="&lt;p&gt;I am using &lt;code&gt;emacs -nw&lt;/code&gt; as in-place commit message editor for my git. When pressing &lt;kbd&gt;C-c C-c&lt;/kbd&gt; in &lt;code&gt;git-commit&lt;/code&gt; mode, I want emacs to quit automatically. Currently, &lt;code&gt;.git/COMMIT_EDITMSG&lt;/code&gt; is saved, and the buffer is killed. Then I am left with the scratch buffer, so I have to quit emacs manually as an extra step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess would be to either create some macro and bind it to some key, or add some kind of hook to &lt;code&gt;git-commit-commit&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8594" LastEditorUserId="306" LastEditDate="2015-06-15T18:04:53.663" LastActivityDate="2015-07-03T12:50:37.970" Title="Automatically quit emacs after git-commit-commit in git-commit mode" Tags="|magit|git|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13165" PostTypeId="2" ParentId="13133" CreationDate="2015-06-15T09:35:58.883" Score="1" Body="&lt;p&gt;In Term mode, you can use Term mode's own directory tracking feature. I can't find it documented in the manual. There is &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/emacs-25/lisp/term.el#L234&quot; rel=&quot;nofollow noreferrer&quot;&gt;some example code in the source code&lt;/a&gt;. The program running in the terminal can emit escape &lt;code&gt;AnSiT&lt;/code&gt; sequences to notify the terminal about its location:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;\eAnSiTc ${PWD}\n&lt;/code&gt; to indicate the current directory&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\eAnSiTh ${HOSTNAME}\n&lt;/code&gt; to indicate the current host&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\eAnSiTu ${USER}\n&lt;/code&gt; to indicate the current user&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In your &lt;code&gt;~/.config/fish/config.fish&lt;/code&gt;, add code to the &lt;a href=&quot;http://fishshell.com/docs/current/index.html#event&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;fish_prompt&lt;/code&gt; event handler&lt;/a&gt; to emit this escape sequence. Untested:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;switch $TERM&#xA;  case eterm eterm-color&#xA;    function -e fish_prompt prompt_AnSiT&#xA;      printf '\eAnSiTc %s\n' &quot;$PWD&quot;&#xA;    end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2019-07-08T16:40:47.223" LastActivityDate="2019-07-08T16:40:47.223" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="13166" PostTypeId="1" AcceptedAnswerId="13169" CreationDate="2015-06-15T10:38:01.063" Score="3" ViewCount="421" Body="&lt;p&gt;I appear to have broken something in my Emacs environment (running on Windows in case it's relevant).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;package-list is currently displaying all the packages I've just installed with it as Status 'external' - which as far as I can tell means I can't actually use package.el to manage them anymore. I can't remove them, update them anymore, as trying to mark them with 'd', or 'U' does nothing - no marks appear against the package, and consequently 'x' then says there's nothing to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample from the list-packages buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Package            Version       Status    Archive     Description&#xA;  magit              20150608.1139 external              control Git from Emacs&#xA;  magit-annex        20140629.1457 external              Use git annex within magit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My current .emacs :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ;; -*- emacs-lisp -*-&#xA;(add-to-list 'initial-frame-alist '(fullscreen . maximized))&#xA;(add-to-list 'default-frame-alist '(fullscreen . maximized))&#xA;&#xA;(setq url-proxy-services '((&quot;http&quot; .  &quot;127.0.0.1:3128&quot;)&#xA;                           (&quot;https&quot; . &quot;127.0.0.1:3128&quot;)))&#xA;(setq make-backup-files nil)&#xA;(require 'package)&#xA;(setq package-archives '((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)))&#xA;(package-initialize)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/lisp&quot;)&#xA;&#xA;(require 'powershell-mode)&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(package-selected-packages&#xA;   (quote&#xA;    (s afternoon-theme ample-theme ample-zen-theme async badger-theme base16-theme bubbleberry-theme busybee-theme caml circe clues-theme color-theme-sanityinc-solarized csharp-mode csv-nav cyberpunk-theme dakrone-theme darkburn-theme darkmine-theme dash deferred django-mode espresso-theme firebelly-theme flatland-theme gandalf-theme gh google grandshell-theme gruvbox-theme logito magit magit-annex magit-filenotify magit-find-file magit-svn moe-theme molokai-theme monokai-theme mustang-theme naquadah-theme niflheim-theme noctilux-theme nyan-mode obsidian-theme occidental-theme oldlace-theme org-plus-contrib pcache planet-theme powerline professional-theme purple-haze-theme rainbow-delimiters rich-minority rnc-mode seti-theme smart-mode-line smart-mode-line-powerline-theme smart-tabs-mode soft-morning-theme soft-stone-theme spacegray-theme stekene-theme subatomic-theme subatomic256-theme sublime-themes tango-plus-theme tangotango-theme tommyh-theme toxi-theme tracking tronesque-theme twilight-theme ujelly-theme underwater-theme vlf yaml-mode zen-and-art-theme zenburn-theme))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&#xA;(cua-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyone got any suggestions? I even nuked my entire .emacs and .emacs.d and started afresh (which is where the snippets above are from). What did I break?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;---Edit--- Including package help text for a sample package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;magit is an external package.&#xA;&#xA;     Status: External in ‘~/.emacs.d/elpa/magit-20150608.1139/’ (unsigned).&#xA;    Archive: n/a&#xA;    Version: 20150608.1139&#xA;   Requires: cl-lib-0.5, git-commit-mode-1.0.0, git-rebase-mode-1.0.0&#xA;Required by: magit-filenotify-20150125.1456, magit-annex-20140629.1457&#xA;    Summary: control Git from Emacs&#xA;   Keywords: vc tools &#xA;    Other versions: 20150608.1139 (melpa).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And for sake of completeness, the (default) setting of package-user-dir :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;package-user-dir is a variable defined in ‘package.el’.&#xA;Its value is &quot;~\\.emacs.d\\elpa&quot;&#xA;&#xA;  This variable may be risky if used as a file-local variable.&#xA;&#xA;Documentation:&#xA;Directory containing the user's Emacs Lisp packages.&#xA;The directory name should be absolute.&#xA;Apart from this directory, Emacs also looks for system-wide&#xA;packages in ‘package-directory-list’.&#xA;&#xA;You can customize this variable.&#xA;&#xA;This variable was introduced, or its default value was changed, in&#xA;version 24.1 of Emacs.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="574" LastEditorUserId="574" LastEditDate="2015-06-16T08:15:31.000" LastActivityDate="2015-06-16T08:15:31.000" Title="Why are packages showing as status 'External' in list-packages" Tags="|package|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="13167" PostTypeId="1" CreationDate="2015-06-15T10:43:14.177" Score="1" ViewCount="109" Body="&lt;p&gt;When I type a &lt;code&gt;}&lt;/code&gt; to close the &lt;code&gt;for&lt;/code&gt; loop, the '}' is moved to position as shown in the screen shot (where the cursor is)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect it to be at the same column of the &lt;code&gt;for&lt;/code&gt; keyword. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indentation for lines within the &lt;code&gt;if&lt;/code&gt; condition worked perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iDX2el.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway I can fix this behaviour?&lt;/p&gt;&#xA;" OwnerUserId="169" LastEditorUserId="50" LastEditDate="2015-06-15T21:13:34.953" LastActivityDate="2015-06-15T21:13:34.953" Title="Swift major mode indentation is not moving to expected position" Tags="|indentation|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13168" PostTypeId="2" ParentId="777" CreationDate="2015-06-15T11:42:11.727" Score="3" Body="&lt;p&gt;I've found out that if you have slime installed, there is a command to do this, called &lt;code&gt;slime-close-all-parens-in-sexp&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2015-06-15T11:42:11.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13169" PostTypeId="2" ParentId="13166" CreationDate="2015-06-15T12:32:30.220" Score="2" Body="&lt;p&gt;This is a bit of a sledgehammer approach - but I've fixed this in the short term by commenting out the line :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ((not (file-in-directory-p dir package-user-dir)) &quot;external&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from the package-desc-status function in package.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems to have done the trick for me.&lt;/p&gt;&#xA;" OwnerUserId="574" LastActivityDate="2015-06-15T12:32:30.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13170" PostTypeId="2" ParentId="13064" CreationDate="2015-06-15T12:49:26.350" Score="1" Body="&lt;p&gt;There was a bug in &lt;code&gt;jedi-core&lt;/code&gt; &lt;code&gt;20150528.2022&lt;/code&gt; from MELPA (&lt;a href=&quot;https://github.com/syohex/emacs-company-jedi/issues/2&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syohex/emacs-company-jedi/issues/2&lt;/a&gt;). After updating to &lt;code&gt;20150611.254&lt;/code&gt; displaying the function signature works as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/k4Sqt.png&quot; alt=&quot;company-jedi example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2757" LastActivityDate="2015-06-15T12:49:26.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13171" PostTypeId="1" AcceptedAnswerId="13172" CreationDate="2015-06-15T12:50:25.170" Score="18" ViewCount="5735" Body="&lt;p&gt;I'm a developer for a package (ycmd) used by spacemacs, and I'd like to try using spacemacs as well. I'd like spacemacs to use the &quot;development version&quot; of my package, i.e. the one I'm hacking on locally. What's the best/proper way to tell spacemacs to use that version of the package rather than the one from melpa? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I'm using the &lt;code&gt;:load-path&lt;/code&gt; argument to &lt;code&gt;use-package&lt;/code&gt;, but this seems to go against the grain a bit. Does spacemacs let me specify a load directory for specific packages in the layer configuration somewhere?&lt;/p&gt;&#xA;" OwnerUserId="216" LastActivityDate="2015-06-15T13:06:06.290" Title="What's the best way to use local packages in spacemacs?" Tags="|spacemacs|package-development|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13172" PostTypeId="2" ParentId="13171" CreationDate="2015-06-15T12:55:37.797" Score="14" Body="&lt;p&gt;Local packages are put in &lt;code&gt;extensions.el&lt;/code&gt; instead of &lt;code&gt;packages.el&lt;/code&gt;. There are two lists in an &lt;code&gt;extensions.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;lt;layer&amp;gt;-pre-extensions&lt;/code&gt; which are loaded before &lt;code&gt;packages.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;lt;layer&amp;gt;-post-extensions&lt;/code&gt; which are loaded after &lt;code&gt;packages.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Local packages are put in the folder &lt;code&gt;extensions&lt;/code&gt; within a sub-folder whose name is the name you put in one of the two lists. The &lt;code&gt;load-path&lt;/code&gt; variable is handled automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can look at some examples in the &lt;code&gt;python&lt;/code&gt; layer.&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2015-06-15T13:06:06.290" LastActivityDate="2015-06-15T13:06:06.290" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13173" PostTypeId="1" AcceptedAnswerId="13400" CreationDate="2015-06-15T13:15:15.833" Score="0" ViewCount="501" Body="&lt;p&gt;I've installed helm and projectile modes and I wanted to restore the previous behaviour of the C-backspace binding to kill whole last word. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In these modes, when looking for a file (after pressing C-x-f), this binding is changed to turn on/off auto expansion (it seems to run the &lt;code&gt;helm-ff-run-toggle-auto-update&lt;/code&gt; function).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've put this in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-find-files-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;) 'backward-kill-word)&#xA;(define-key helm-projectile-find-file-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;) 'backward-kill-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when I run &lt;code&gt;describe-variable&lt;/code&gt; for &lt;code&gt;helm-find-files-map&lt;/code&gt; and &lt;code&gt;helm-projectile-find-file-map&lt;/code&gt; they indeed contain the &lt;code&gt;(C-backspace . backward-kill-word)&lt;/code&gt; entry. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, pressing C-backspace in helm-find-file still toggles auto expansion instead of deleting the last path entry. How to achieve this?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is the minimal example of init.el contents that should reproduce this behaviour:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;(package-initialize)&#xA;&#xA;(require 'helm)&#xA;(require 'helm-config)&#xA;&#xA;(projectile-global-mode)&#xA;(setq projectile-completion-system 'helm)&#xA;(helm-projectile-on)&#xA;&#xA;(helm-mode 1)&#xA;&#xA;(define-key helm-find-files-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;) 'backward-kill-word)&#xA;(define-key helm-projectile-find-file-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;) 'backward-kill-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2510" LastEditorUserId="2510" LastEditDate="2015-06-24T09:43:02.617" LastActivityDate="2015-06-24T14:11:09.943" Title="How to rebind C-backspace in projectile find file?" Tags="|key-bindings|helm|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13174" PostTypeId="2" ParentId="13132" CreationDate="2015-06-15T13:28:16.000" Score="2" Body="&lt;p&gt;I've described my VLC setup in &lt;a href=&quot;http://oremacs.com/2015/01/04/dired-nohup/&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt;.  What's really cool about it is that the child process is disowned through &lt;code&gt;nohup&lt;/code&gt;, so you can safely restart or close Emacs without having VLC automatically close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired-aux)&#xA;(defvar dired-filelist-cmd&#xA;  '((&quot;vlc&quot; &quot;-L&quot;)))&#xA;(defun dired-start-process (cmd &amp;amp;optional file-list)&#xA;  (interactive&#xA;   (let ((files (dired-get-marked-files&#xA;                 t current-prefix-arg)))&#xA;     (list&#xA;      (dired-read-shell-command &quot;&amp;amp; on %s: &quot;&#xA;                                current-prefix-arg files)&#xA;      files)))&#xA;  (let (list-switch)&#xA;    (start-process&#xA;     cmd nil shell-file-name&#xA;     shell-command-switch&#xA;     (format&#xA;      &quot;nohup 1&amp;gt;/dev/null 2&amp;gt;/dev/null %s \&quot;%s\&quot;&quot;&#xA;      (if (and (&amp;gt; (length file-list) 1)&#xA;               (setq list-switch&#xA;                     (cadr (assoc cmd dired-filelist-cmd))))&#xA;          (format &quot;%s %s&quot; cmd list-switch)&#xA;        cmd)&#xA;      (mapconcat #'expand-file-name file-list &quot;\&quot; \&quot;&quot;)))))&#xA;&#xA;(define-key dired-mode-map &quot;r&quot; 'dired-start-process)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another thing the code does is that it allows to mark several files with &lt;kbd&gt;m&lt;/kbd&gt;, and then queue all of them to a VLC playlist.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-15T13:28:16.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13175" PostTypeId="1" AcceptedAnswerId="13179" CreationDate="2015-06-15T15:30:01.580" Score="2" ViewCount="2701" Body="&lt;p&gt;I am writing in org-mode and exporting to pdf via LaTeX. I am quite new to Emacs and org-mode, and not familiar with LaTeX, so I am flailing about on the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like for a small section of my text to be exported in a custom font which resides in my ~/.font directory (.ttf and .otf versions available).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Can it be done?&lt;/li&gt;&#xA;&lt;li&gt;What tags/statements/syntax are used within the document?&lt;/li&gt;&#xA;&lt;li&gt;Do I need to alter the Emacs setup? (My Emacs version is 24.5.1.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There is a related LaTeX question &lt;a href=&quot;https://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document/25251#25251&quot;&gt;here&lt;/a&gt;, but it does not involve Emacs/org-mode. The answer mentioning XeLaTeX would seem to offer the simplest route, but I don't know how to integrate this with org-mode. I had a look at org-mode's &lt;a href=&quot;http://orgmode.org/manual/Embedded-LaTeX.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation about embedded LaTeX&lt;/a&gt; - it seems to focus on math expressions, and I remain unclear as to whether something like font changing is supported, and then how.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any insights.&lt;/p&gt;&#xA;" OwnerUserId="2658" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2015-07-15T17:32:46.160" Title="How to use a custom export font for a section of text in org-mode?" Tags="|org-mode|latex|org-export|fonts|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13176" PostTypeId="1" CreationDate="2015-06-15T16:32:18.940" Score="1" ViewCount="65" Body="&lt;p&gt;When I have two buffers open side by side in as terminal (as shown in the screenshot), I cannot simply select text in a single buffer for copy and paste purpose. The selection will span across them, which is expected because it is how the terminal works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7ve9D.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: is it possible to copy the text via Crtl-space and then put it in OSX's clip broad? (e.g. pipe the selected text to &lt;code&gt;pbcopy&lt;/code&gt;?)&lt;/p&gt;&#xA;" OwnerUserId="169" LastEditorUserId="169" LastEditDate="2015-06-15T16:46:21.427" LastActivityDate="2015-06-15T16:53:30.120" Title="How can select text in a single window in a multi-window configuration?" Tags="|osx|copy-paste|" AnswerCount="1" CommentCount="0" ClosedDate="2015-06-15T17:21:44.437" ContentLicense="CC BY-SA 3.0" />
  <row Id="13177" PostTypeId="2" ParentId="13176" CreationDate="2015-06-15T16:53:30.120" Score="0" Body="&lt;p&gt;You could use &lt;code&gt;shell-command-on-region&lt;/code&gt; to send the region's text to &lt;code&gt;pbcopy&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun osx-copy-to-clipboard (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (message (if (zerop (shell-command-on-region beg end &quot;pbcopy&quot;)) &quot;copied&quot; &quot;copy failed&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-06-15T16:53:30.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13178" PostTypeId="1" CreationDate="2015-06-15T16:59:04.870" Score="1" ViewCount="620" Body="&lt;p&gt;I enabled windmove by running &lt;code&gt;m-x  windmove-default-keybindings&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;S-left and S-right work as expected when two windows are side by side. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when  a frame is splitted vertically, I cannot use S-up/S-down to switch between top and bottom window.  Instead they become text selection (much like ctrl-space)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this key bindings? Why &lt;code&gt;windmove-default-keybindings&lt;/code&gt; cannot set them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version: GNU Emacs 24.5.1&lt;/p&gt;&#xA;" OwnerUserId="169" LastEditorUserId="169" LastEditDate="2015-06-16T01:32:36.307" LastActivityDate="2015-06-16T02:23:17.923" Title="Windmove-mode: S-up and S-down becomes text selection instead of switching windows" Tags="|window|osx|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13179" PostTypeId="2" ParentId="13175" CreationDate="2015-06-15T17:09:47.120" Score="2" Body="&lt;p&gt;That custom font has to be first installed to your LaTeX&#xA;configuration. Follow these &lt;a href=&quot;http://math.stanford.edu/~jyzhao/latexfonts.php&quot; rel=&quot;nofollow&quot;&gt;instructions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use the custom font in org-mode files as shown in the sample below.&#xA;In org-mode, you should use C-e l p (which is export to LaTeX as PDF &#xA;file) to see the custom font printed. The full complement of LaTeX&#xA;font &lt;a href=&quot;https://en.wikibooks.org/wiki/LaTeX/Fonts&quot; rel=&quot;nofollow&quot;&gt;directives shown here&lt;/a&gt; can then be used with the custom font &#xA;in your org-mode file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;**** Some org header&#xA;&#xA;Some sample text in normal font followed by \customfont{text in&#xA;custom font} and then revert back to normal font.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-15T17:09:47.120" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="13180" PostTypeId="2" ParentId="13164" CreationDate="2015-06-15T18:04:08.063" Score="1" Body="&lt;p&gt;&lt;code&gt;git-commit.el&lt;/code&gt; assumes that the &lt;code&gt;emacsclient&lt;/code&gt; is used as &lt;code&gt;$GIT_EDITOR&lt;/code&gt;. When that is the case then aborting does still save the changes to &lt;code&gt;.git/COMMIT_EDITMSG&lt;/code&gt;, but &lt;code&gt;emacsclient&lt;/code&gt; then exits with a non-zero exit status, which instructs &lt;code&gt;git commit&lt;/code&gt; to not create the commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would probably be possible to make this work with &lt;code&gt;emacs&lt;/code&gt; too, but I am not sure whether that would be worth the increased complexity. It's always preferable to use the &lt;code&gt;emacsclient&lt;/code&gt;, most importantly this avoids an unnecessary startup delay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my recommendation is that you learn how to setup the emacs server and how to connect to it using &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or even to give Magit a try. In Magit a commit is initiated simply by pressing &lt;code&gt;c c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE 1: Op also opened a related issue &lt;a href=&quot;https://github.com/magit/git-modes/issues/127&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, let's discuss there whether a future version of &lt;code&gt;git-commit&lt;/code&gt; should also support using plain old &lt;code&gt;emacs&lt;/code&gt; as editor.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE 2: When OP asked the question &lt;code&gt;magit v2.1.0&lt;/code&gt; was not released yet. Now, after the release, &lt;code&gt;git-commit-mode.el&lt;/code&gt; has been renamed to &lt;code&gt;git-commit.el&lt;/code&gt; and the command that performs the commit is named &lt;code&gt;with-editor-finish&lt;/code&gt; (the key binding is still the same : &lt;kbd&gt;C-c C-c&lt;/kbd&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T12:50:37.970" LastActivityDate="2015-07-03T12:50:37.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13181" PostTypeId="2" ParentId="13002" CreationDate="2015-06-15T18:45:35.680" Score="4" Body="&lt;p&gt;The following snippet shows (in part) what happens when &lt;code&gt;org-mode&lt;/code&gt; is enabled: &lt;code&gt;. . . (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility)) . . .&lt;/code&gt;  The variable &lt;code&gt;org-inhibit-startup-visibility-stuff&lt;/code&gt; is &lt;em&gt;undocumented&lt;/em&gt; (i.e., there is no doc-string) and it has an initial default value of &lt;code&gt;nil&lt;/code&gt;.  The original poster may wish to try &lt;em&gt;globally&lt;/em&gt; setting this variable to &lt;code&gt;t&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-inhibit-startup-visibility-stuff t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The following should also work by setting &lt;code&gt;org-inhibit-startup-visibility-stuff&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; on a let-bound -- &lt;em&gt;temporary&lt;/em&gt; -- basis:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun enable-org-mode ()&#xA;&quot;Turn on org-mode with `org-inhibit-startup-visibility-stuff' set to `t` on&#xA;a let-bound -- i.e., temporary -- basis.&quot;&#xA;(interactive)&#xA;  (let ((org-inhibit-startup-visibility-stuff t))&#xA;    (org-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If the original poster prefers not using the undocumented variable &lt;code&gt;org-inhibit-startup-visibility-stuff&lt;/code&gt;, an alternative solution would be to use an &lt;code&gt;indirect-buffer&lt;/code&gt; when working in &lt;code&gt;artist-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x make-indirect-buffer RET base-buffer RET indirect-name RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The link to the manual that describes &lt;code&gt;indirect-buffer&lt;/code&gt; is as follows:  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It may behoove someone to send an email to the &lt;code&gt;org-mode&lt;/code&gt; team suggesting that they document the variable &lt;code&gt;org-inhibit-startup-visibility-stuff&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-15T20:40:34.533" LastActivityDate="2015-06-15T20:40:34.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13182" PostTypeId="2" ParentId="13075" CreationDate="2015-06-15T18:49:44.333" Score="5" Body="&lt;p&gt;The variable &lt;code&gt;org-agenda-start-day&lt;/code&gt; can be used to achieve the behavior desired by the original poster.  The doc-string provides as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Start day for the agenda view.&#xA;Custom commands can set this variable in the options section.&#xA;This is usually a string like &quot;2007-11-01&quot;, &quot;+2d&quot; or any other&#xA;input allowed when reading a date through the Org calendar.&#xA;See the docstring of `org-read-date' for details.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The manual -- &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Weekly_002fdaily-agenda.html&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/org/Weekly_002fdaily-agenda.html&lt;/a&gt; -- contains the following example:  &lt;em&gt;You can also set the start date using a date shift: &lt;code&gt;(setq org-agenda-start-day &quot;+10d&quot;)&lt;/code&gt; will start the agenda ten days from today in the future.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-06-15T18:49:44.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13183" PostTypeId="1" CreationDate="2015-06-15T22:49:39.397" Score="0" ViewCount="67" Body="&lt;p&gt;I've created the following LaTeX file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[10pt]{book}&#xA;\usepackage{subfiles}&#xA;\usepackage{mystyle}&#xA;\begin{document}&#xA;\subfile{./tex/title.tex}&#xA;\subfile{./tex/intro.tex} %warning here says: User Regex: /intro.. [44]&#xA;\subfile{./tex/dynamic.tex}&#xA;\subfile{./tex/tournament.tex}&#xA;\subfile{./tex/ltt.tex}&#xA;\subfile{./tex/experiments.tex}&#xA;\subfile{./tex/conclusion.tex}&#xA;\subfile{./tex/references.tex}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is that warning being displayed there, and what exactly does it mean? Should I be concerned, and how do I make it go away?&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2015-06-15T22:49:39.397" Title="Meaning of AucTeX warning here" Tags="|auctex|warning|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13185" PostTypeId="1" AcceptedAnswerId="13448" CreationDate="2015-06-15T23:37:49.117" Score="8" ViewCount="3856" Body="&lt;p&gt;My system is debian wheezy, I tried to do the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;S-&amp;lt;backspace&amp;gt;&quot;) 'evil-shift-left-line)&#xA;(global-set-key (kbd &quot;&amp;lt;S-backspace&amp;gt;&quot;) 'evil-shift-left-line)&#xA;(define-key global-map [S-backspace] 'evil-shift-left-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want is in evil insert mode, I can delete one tab width forward instead of press backspace 4 times. &#xA;The keybinding works on my laptop, but doen't work on my desktop. I check the binding for evil-shift-left-line, it has changed but doesn't work, and help on &quot;shift-backspace&quot; only shows &quot;backspace&quot;. However, shift do has effect on &quot;backspace&quot;, &quot;shift-backspace&quot; delete the previous word instead of character. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I insert &quot;shift-backspace&quot; after &quot;C-q&quot;, it has the same notation &quot;^?&quot; as &quot;backspace&quot; on my desktop, while on my laptop the former is &quot;^@&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on why it doesn't work on my desktop?&#xA;Thank you for your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question may be related to this one:&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal&quot;&gt;Shift+Up isn&amp;#39;t recognized by Emacs in a terminal&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-10-02T16:14:00.710" Title="Why I can't bind Shift-&lt;backspace&gt;?" Tags="|key-bindings|keymap|prefix-keys|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13186" PostTypeId="1" AcceptedAnswerId="14447" CreationDate="2015-06-16T01:47:51.477" Score="6" ViewCount="1123" Body="&lt;p&gt;It is possible to define ex commands using &lt;code&gt;evil-ex-define-cmd&lt;/code&gt;. For example, &lt;code&gt;:quit&lt;/code&gt; is defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-ex-define-cmd &quot;q[uit]&quot; 'evil-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to override this behaviour in particular modes; in particular, when running in &lt;code&gt;git-commit-mode&lt;/code&gt;, I'd like for &lt;code&gt;:q&lt;/code&gt; or &lt;code&gt;:wq&lt;/code&gt; to instead perform a &lt;code&gt;git-commit-commit&lt;/code&gt; rather than a regular &lt;code&gt;evil-quit&lt;/code&gt; (or &lt;code&gt;evil-save-and-close&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, evil does not maintain a mode-local ex command map, and so I need to write a function that calls &lt;code&gt;git-commit-commit&lt;/code&gt; if the major mode is &lt;code&gt;git-commit-mode&lt;/code&gt; (the easy part); otherwise, delegate to a separate evil function (with arguments forwarded down; the hard part).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition would look something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-command evil-save-and-close-or-commit (&amp;lt;args&amp;gt;)&#xA;   (if (eq major-mode &quot;git-commit-mode&quot;)&#xA;      (git-commit-commit)&#xA;    (evil-save-and-close &amp;lt;args&amp;gt;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any thoughts on how I could achieve this -- in particular, the forwarding of arbitrary arguments to an evil command?&lt;/p&gt;&#xA;" OwnerUserId="8608" LastActivityDate="2015-09-12T15:12:01.517" Title="How might I define (or fake) a mode-local ex command with evil?" Tags="|evil|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13187" PostTypeId="1" CreationDate="2015-06-16T01:57:52.203" Score="1" ViewCount="288" Body="&lt;p&gt;I have a file where every time I save the file emacs inserts a &lt;code&gt;# coding: utf-8&lt;/code&gt; at the top of the file. I'm using the &lt;code&gt;prelude&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I turn this off? I'm having a hard time tracing where this is coming from.&lt;/p&gt;&#xA;" OwnerUserId="653" LastActivityDate="2015-06-16T01:57:52.203" Title="Why does emacs insert a `#coding` header into my file?" Tags="|character-encoding|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13188" PostTypeId="2" ParentId="13178" CreationDate="2015-06-16T02:23:17.923" Score="2" Body="&lt;p&gt;Make sure that &lt;code&gt;shift-select-mode&lt;/code&gt; is set to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation:&#xA;When non-nil, shifted motion keys activate the mark momentarily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the mark is activated in this way, any shift-translated point&#xA;motion key extends the region, and if Transient Mark mode was off, it&#xA;is temporarily turned on.  Furthermore, the mark will be deactivated&#xA;by any subsequent point motion key that was not shift-translated, or&#xA;by any action that normally deactivates the mark in Transient Mark mode.&lt;/p&gt;&#xA;" OwnerUserId="146" LastActivityDate="2015-06-16T02:23:17.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13189" PostTypeId="1" CreationDate="2015-06-16T02:44:54.227" Score="17" ViewCount="3382" Body="&lt;p&gt;For example, if I have a markdown file with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;###This is my markdown file&#xA;here is some text.&#xA;here is my code block:&#xA;&#xA;``` js&#xA;var accountdown = require('accountdown');&#xA;var level = require('level');&#xA;var db = level('/tmp/users.db');&#xA;&#xA;var users = accountdown(db, {&#xA;    login: { basic: require('accountdown-basic') }&#xA;});&#xA;&#xA;var user = process.argv[2];&#xA;var pass = process.argv[3];&#xA;var bio = process.argv[4];&#xA;&#xA;var opts = {&#xA;    login: { basic: { username: user, password: pass } },&#xA;    value: { bio: bio }&#xA;};&#xA;users.create(user, opts, function (err) {&#xA;    if (err) console.error(err);&#xA;});&#xA;```&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I enable highlighting in the code block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps it's unrelated, but org-mode can highlight source code blocks as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA;      'org-babel-load-languages&#xA;      '((python . t)&#xA;        (js . t)&#xA;        (R . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2017-06-13T06:09:08.637" Title="Github-flavored markdown mode: syntax highlight code blocks" Tags="|syntax-highlighting|markdown-mode|gfm-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13190" PostTypeId="2" ParentId="10573" CreationDate="2015-06-16T02:54:05.690" Score="2" Body="&lt;p&gt;two options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Advise comint functions which use (accept-process-output proc), so that accept-process-output is redefined to send nil instead of proc. Without proc, it will use adaptive read buffering and a longer timeout. This was broken in recent emacs, (after emacs-24.3.91) but fixed and improved by me after ~25.05.50.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Change comint's accept-process-output to a function which does accept-process-output in a loop, with a custom timeout.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2654" LastEditorUserId="2654" LastEditDate="2015-08-04T01:11:07.877" LastActivityDate="2015-08-04T01:11:07.877" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13191" PostTypeId="1" CreationDate="2015-06-16T06:06:40.957" Score="7" ViewCount="4208" Body="&lt;p&gt;I want to specify a default output file for all my tangle exports. I'm using Org mode 8.x. (For Org mode ≥9.0, see &lt;a href=&quot;https://emacs.stackexchange.com/q/40721&quot;&gt;How to tangle all code blocks to a common file&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC js :tangle &quot;../js/out_file.js&quot;&#xA;console.log(&quot;hello from org mode&quot;);&#xA;#+END_SRC&#xA;** &#xA;#+BEGIN_SRC js :tangle &quot;../js/out_file.js&quot;&#xA;console.log(&quot;hello from org mode 2&quot;);&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I don't want to keep repeating &quot;../js/out_file.js&quot; on each block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at these following two links, which seem to be asking essentially the same question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/3785/how-to-specify-default-header-arguments-in-orgmode-code-blocks&quot;&gt;link 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/2328/using-org-babel-to-tangle-to-a-variable-file-name&quot;&gt;link 2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, none of the recommendations work:  If I just have a SRC block with no tangle arg, I get either &quot;Tangled 0 code blocks from dummy.org&quot; or &quot;Wrote ./org/dummy.org&quot; (which is the default file name)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my final code.  Currently, all the methods are uncommented, so it's possible they are interfering with each other, but I have tried each method in isolation to the same effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Header&#xA;&#xA;# method 1&#xA;:PROPERITES:&#xA;:tangle: &quot;../out_file.js&quot;&#xA;:END:&#xA;&#xA;# method 2&#xA;#+TANGLE: &quot;../js/out_file.js&quot;&#xA;&#xA;# method 3&#xA;#+BABEL: :tangle &quot;../js/out_file.js&quot; &#xA;&#xA;# method 4&#xA;#+PROPERTY: header-args+ :tangle  &quot;../js/out_file.js&quot; &#xA;&#xA;# method 5&#xA;#+PROPERTY: header-args :session *my_js_session* :results silent :tangle &quot;../js/out_file.js&quot; &#xA;&#xA;** some js source&#xA;#+BEGIN_SRC js&#xA;console.log(&quot;hello from org mode&quot;);&#xA;#+END_SRC&#xA;** &#xA;#+BEGIN_SRC js &#xA;console.log(&quot;hello from org mode 2&quot;);&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone see what I'm doing wrong? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I have to somehow evaluate the properties before they take effect? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any org commands I can issue to verify if the properties are properly set? &lt;/p&gt;&#xA;" OwnerUserId="6717" LastEditorUserId="25" LastEditDate="2018-03-29T20:36:02.757" LastActivityDate="2018-03-29T20:36:02.757" Title="Specify global tangle file for source code export in Org mode 8.x" Tags="|org-babel|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13192" PostTypeId="1" CreationDate="2015-06-16T07:06:46.983" Score="3" ViewCount="630" Body="&lt;p&gt;I am using the relative-line-numbers-mode and a 90 degree turned screen, which makes the text jump when it goes from displaying 100 in the relative number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to set a fixed width for the line numbers, i just need it set to 3 characters. &lt;/p&gt;&#xA;" OwnerUserId="8260" LastActivityDate="2022-09-14T07:26:28.750" Title="Setting width of relative-line-numbers" Tags="|line-numbers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13193" PostTypeId="1" AcceptedAnswerId="13195" CreationDate="2015-06-16T07:36:23.397" Score="5" ViewCount="3140" Body="&lt;p&gt;Is there any extension or easy way to invert colors in emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to show code a lot through screen sharing and often a light theme is better while the dark is more comfortable for me to work alone.&lt;/p&gt;&#xA;" OwnerUserId="5247" LastActivityDate="2020-12-08T08:31:53.843" Title="Inverting colors in emacs" Tags="|themes|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13194" PostTypeId="1" AcceptedAnswerId="13207" CreationDate="2015-06-16T08:00:56.973" Score="6" ViewCount="628" Body="&lt;p&gt;I use &lt;code&gt;clipboard-kill-region&lt;/code&gt; to copy contents from Emacs to other programs. But sometimes, it copies the same content twice into the clipboard. &#xA;It looks like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/user/.emacs/home/user/.emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I copy the filename &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/user/.emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can empty the clipboard contents before calling &lt;code&gt;clipboard-kill-region&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My complete function is shown here; it is a utility function to copy the absolute path of currently opened file in Emacs buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun sk-copy-file-name ()&#xA;  &quot;Put the current file name on the clipboard&quot;&#xA;  (interactive)&#xA;  (let ((filename (if (equal major-mode 'dired-mode)&#xA;                      default-directory&#xA;                    (buffer-file-name))))&#xA;    (when filename&#xA;      (with-temp-buffer&#xA;        (insert filename)&#xA;        (clipboard-kill-region (point-min) (point-max)))&#xA;      (message filename))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="675" LastEditDate="2015-06-16T16:17:57.407" LastActivityDate="2015-06-16T16:17:57.407" Title="How can I clear the contents of the clipboard before calling clipboard-kill-region?" Tags="|clipboard|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13195" PostTypeId="2" ParentId="13193" CreationDate="2015-06-16T09:14:38.953" Score="4" Body="&lt;p&gt;You could use two different color themes and switch between them.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [f5] (lambda () (interactive) (load-theme 'sanityinc-tomorrow-day t)))&#xA;(global-set-key [f6] (lambda () (interactive) (load-theme 'sanityinc-tomorrow-night t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2757" LastEditorUserId="2757" LastEditDate="2015-06-16T10:37:42.960" LastActivityDate="2015-06-16T10:37:42.960" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13196" PostTypeId="2" ParentId="13193" CreationDate="2015-06-16T09:27:16.990" Score="2" Body="&lt;p&gt;There's a &lt;code&gt;-rv&lt;/code&gt; switch you can use to boot up Emacs in reverse video mode, however I've found it not to work in combination with custom themes.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-06-16T09:27:16.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13198" PostTypeId="5" CreationDate="2015-06-16T10:09:25.230" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-06-16T10:09:25.230" LastActivityDate="2015-06-16T10:09:25.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13199" PostTypeId="4" CreationDate="2015-06-16T10:09:25.230" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-06-16T10:09:25.230" LastActivityDate="2015-06-16T10:09:25.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13200" PostTypeId="1" AcceptedAnswerId="13233" CreationDate="2015-06-16T11:17:30.073" Score="1" ViewCount="121" Body="&lt;p&gt;When I was watching Emacs Rocks, there was a feature showed, called &lt;code&gt;sgml-close-tag&lt;/code&gt;. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/9uitN.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;You can see an example here.&lt;/a&gt;&#xA;When called that command, he will close the tag for you if there is a tag missing.  I bounded it to &lt;code&gt;C-l&lt;/code&gt; and was hooked with it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I was wondering if I could apply this with another languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, like in PHP, you have the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; public function Foobar(){&#xA;&#xA; echo &quot;Foobar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I will get a syntax error, there is a double quote (&lt;code&gt;&quot;&lt;/code&gt;) missing in order to close the string &quot;Foobar&quot;, then a semicolon (&lt;code&gt;;&lt;/code&gt;) to end the line, and then a bracket (&lt;code&gt;}&lt;/code&gt;) to close the function Foobar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if I could develop the same functionality as in the screencast above, that you need to press only one key and he will close the syntax accordingly. Would be totally awesome and an immense productivity boost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm wondering if I could be able to develop a package with this feature. I couldn't figure out to which functions I need to look. Could anyone gives me a push in the right direction, or do another suggestion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: this issue got solved by Andreas: &lt;a href=&quot;https://github.com/emacs-berlin/general-close&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/emacs-berlin/general-close&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-06-19T18:14:31.730" LastActivityDate="2015-06-19T18:14:31.730" Title="Is there a possibility to close the right syntax for another languages?" Tags="|syntax|syntax-table|package-development|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13201" PostTypeId="1" AcceptedAnswerId="13204" CreationDate="2015-06-16T11:29:27.603" Score="9" ViewCount="2698" Body="&lt;p&gt;I would like some Emacs Lisp forms to be indented like Common Lisp.  For instance, in Emacs Lisp, &lt;code&gt;if&lt;/code&gt; is indented like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if COND&#xA;    THEN&#xA;  ELSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;whilst I would prefer it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if COND&#xA;    THEN&#xA;    ELSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lisp-indent-function #'common-lisp-indent-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this impacts all forms, thus breaking the indentation of Emacs Lisp macros, like &lt;code&gt;cl-letf&lt;/code&gt; and any user-defined macro.&lt;/p&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="454" LastEditDate="2016-09-27T04:54:06.920" LastActivityDate="2016-09-27T04:54:06.920" Title="Modifying the indentation of some Emacs Lisp forms" Tags="|indentation|common-lisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13202" PostTypeId="2" ParentId="13201" CreationDate="2015-06-16T11:33:18.277" Score="2" Body="&lt;p&gt;I actually use Common Lisp indent, with the Elisp indent for &lt;code&gt;if&lt;/code&gt;. You could customize some code similar to mine:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq lisp-indent-function 'common-lisp-indent-function)&#xA;(eval-after-load 'cl-indent&#xA;  `(progn&#xA;     (put 'cl-flet 'common-lisp-indent-function&#xA;          (get 'flet 'common-lisp-indent-function))&#xA;     (put 'cl-labels 'common-lisp-indent-function&#xA;          (get 'labels 'common-lisp-indent-function))&#xA;     (put 'if 'common-lisp-indent-function 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-16T11:33:18.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13203" PostTypeId="1" AcceptedAnswerId="13205" CreationDate="2015-06-16T13:24:05.437" Score="8" ViewCount="2339" Body="&lt;p&gt;First off, a picture of what I see, editing a handlebars file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/m2bTN.png&quot; alt=&quot;tag highlighting&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My colour theme is base16-grayscale, so that blue is probably hard coded somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I asked on the web-mode mailing list, but was told to ask here instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I disable and/or change the colour of this highlighting?&lt;/p&gt;&#xA;" OwnerUserId="3945" LastActivityDate="2015-06-16T14:39:09.660" Title="Web mode HTML tag highlighting" Tags="|syntax-highlighting|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13204" PostTypeId="2" ParentId="13201" CreationDate="2015-06-16T13:31:02.880" Score="16" Body="&lt;h2&gt;Answer:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Symbols for functions and macros have a &lt;code&gt;lisp-indent-function&lt;/code&gt; property which you can set with &lt;code&gt;declare&lt;/code&gt; or in your case, since &lt;code&gt;if&lt;/code&gt; is already defined, you can just use &lt;code&gt;put&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read about the possible property values here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(info &quot;(elisp) Indenting Macros&quot;)&lt;/code&gt; &lt;kbd&gt;return&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;if&lt;/code&gt;'s default setting is &lt;code&gt;2&lt;/code&gt; which means the second form get's special treatment and is offset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change the property value to &lt;code&gt;'defun&lt;/code&gt; and all the body forms will line up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(put 'if 'lisp-indent-function 'defun)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Best Practice:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It is important to note that there is a reason for the indentation style. &lt;code&gt;if&lt;/code&gt; in Elisp is NOT like &lt;code&gt;if&lt;/code&gt; in Common Lisp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the different signatures:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Common Lisp: &lt;code&gt;(if TEST THEN &amp;amp;OPTIONAL ELSE)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs Lisp: &lt;code&gt;(if COND THEN ELSE...)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs lisp, you can have as many forms after the condition as you want but only the first form is the THEN clause, all other forms are part of the ELSE clause.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a valid Elisp &lt;code&gt;if&lt;/code&gt; form that is not valid in CL:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if something&#xA;    (message &quot;THEN&quot;)&#xA;  (message &quot;all&quot;)&#xA;  (message &quot;these&quot;)&#xA;  (message &quot;run&quot;)&#xA;  (message &quot;on&quot;)&#xA;  (message &quot;ELSE&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This shows why it is important that the THEN clause is indented more, it is to make it stand out against all the ELSE forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the indentation being important to the users ability to parse the code, it would also go against the accepted styling patterns of elisp. 99.99999% (carfefully calculated) of elisp code you encounter will use the exact same default indentation scheme. Changing the indentation of &lt;code&gt;if&lt;/code&gt; for you own use will make it hard for you to work on other peoples elisp and make it hard for others to work on yours.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-09-26T17:19:57.773" LastActivityDate="2016-09-26T17:19:57.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13205" PostTypeId="2" ParentId="13203" CreationDate="2015-06-16T13:54:12.657" Score="9" Body="&lt;p&gt;To disable the behavior..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Programmatically: &#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-enable-current-element-highlight nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;web-mode-enable-current-element-highlight is a variable defined in&#xA;  ‘web-mode.el’. Its value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Disable element highlight.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Interactively:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;web-mode-toggle-current-element-highlight&lt;/code&gt; &lt;kbd&gt;return&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;web-mode-toggle-current-element-highlight is an interactive compiled&#xA;  Lisp function in ‘web-mode.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(web-mode-toggle-current-element-highlight)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Toggle highlighting of the current html element.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To continue to use the highlighting and just use a better color:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;web-mode&quot;&#xA;  '(set-face-background 'web-mode-current-element-highlight-face &quot;your-color&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can find what face is applied to text a number of ways. If you can get your cursor on the text. You can use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;describe-face&lt;/code&gt; which will give you a default option of the current face. Or you can use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;describe-char&lt;/code&gt; which will tell you what face is applied. You can customize faces through the &lt;code&gt;customize&lt;/code&gt; feature or with elisp. If you can't get your cursor on the face, try finding the face using &lt;code&gt;customize-group&lt;/code&gt;, &lt;code&gt;list-faces-display&lt;/code&gt; or by reading the packages code.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-06-16T14:39:09.660" LastActivityDate="2015-06-16T14:39:09.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13206" PostTypeId="2" ParentId="13192" CreationDate="2015-06-16T13:54:35.020" Score="7" Body="&lt;p&gt;You can customize how to display the number. For example, define the following function that formats numbers as &lt;code&gt;003:&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun jp-rel-format (offset)&#xA;  &amp;quot;Another formatting function&amp;quot;&#xA;  (format &amp;quot;%03d: &amp;quot; (abs offset)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then customize the variable &lt;code&gt;relative-line-numbers-format&lt;/code&gt; to use this new function instead of the default &lt;code&gt;relative-line-numbers-default-format&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You may try other format strings such as &amp;quot;%3d&amp;quot; to avoid leading zeros.&lt;/p&gt;&#xA;&lt;p&gt;However, I just installed &lt;code&gt;relative-line-numbers-mode&lt;/code&gt; and I don't experience the jump with numbers beyond 100. Are you using variable pitch font?&lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="14825" LastEditDate="2022-09-14T07:26:28.750" LastActivityDate="2022-09-14T07:26:28.750" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="13207" PostTypeId="2" ParentId="13194" CreationDate="2015-06-16T14:11:07.490" Score="6" Body="&lt;p&gt;Use &lt;code&gt;kill-new&lt;/code&gt; instead of &lt;code&gt;clipboard-kill-region&lt;/code&gt; for this. &lt;code&gt;clipboard-kill-region&lt;/code&gt; uses &lt;code&gt;kill-region&lt;/code&gt; which will append the text to the last kill if the last call was &lt;code&gt;kill-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun sk-copy-file-name ()&#xA;  &quot;Put the current file name on the clipboard&quot;&#xA;  (interactive)&#xA;  (kill-new (or (buffer-file-name) default-directory)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-06-16T14:16:52.577" LastActivityDate="2015-06-16T14:16:52.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13208" PostTypeId="1" AcceptedAnswerId="13219" CreationDate="2015-06-16T14:11:44.563" Score="2" ViewCount="1019" Body="&lt;p&gt;I created a &lt;code&gt;yasnippet&lt;/code&gt; template to quickly timestamp a note I'd like to make in &lt;code&gt;org-mode&lt;/code&gt;. The body of the &lt;code&gt;yasnippet&lt;/code&gt; file reads&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$0 &#xA;:PROPERTIES:&#xA;:CREATED: `(org-insert-time-stamp nil t t)`&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the effect is the &lt;code&gt;CREATED&lt;/code&gt; property being populated with double inactive timestamps, e.g., &lt;code&gt;:CREATED:  [2015-06-16 Tue 10:08][2015-06-16 Tue 10:08]&lt;/code&gt;. Why is this behavior occurring, and how do I prevent the redundant timestamp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;References:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/23938018/elisp-avoid-prompt-in-interactive-function&quot; title=&quot;https://stackoverflow.com/questions/23938018/elisp-avoid-prompt-in-interactive-function&quot;&gt;Elisp - Avoid prompt in interactive function&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/7250/in-org-mode-how-to-insert-timestamp-with-todays-date&quot; title=&quot;https://emacs.stackexchange.com/questions/7250/in-org-mode-how-to-insert-timestamp-with-todays-date&quot;&gt;in org-mode, how to insert timestamp with today's date?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: Trying either one of the methods described in the reference links yields the same doubled timestamp result.&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-17T23:48:25.063" Title="Yasnippet invoked org-time-stamp function inserts double timestamp" Tags="|org-mode|yasnippet|time-date|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13209" PostTypeId="2" ParentId="13193" CreationDate="2015-06-16T14:50:29.330" Score="2" Body="&lt;p&gt;Your question asks about &quot;inverting colors&quot;, which I interpret as &quot;complementing colors&quot;. But then you also talk about themes.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/ColorPalette&quot; rel=&quot;nofollow&quot;&gt;Palette&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/palette.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;palette.el&lt;/code&gt;&lt;/a&gt;) to obtain the complement of any color in a WYSIWYG way (so you can easily tweak the result if you like).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/hexrgb.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;hexrgb.el&lt;/code&gt;&lt;/a&gt; to obtain the complement of any color programmatically (command &lt;code&gt;hexrgb-complement&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/DoReMi&quot; rel=&quot;nofollow&quot;&gt;Do Re Mi&lt;/a&gt; or library &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; to incrementally adjust colors or face foregrounds/backgrounds.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use these things (above) to define a new theme starting from an existing theme.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; to cycle among existing themes (&lt;a href=&quot;http://www.emacswiki.org/emacs/ColorAndCustomThemes&quot; rel=&quot;nofollow&quot;&gt;color themes or custom themes&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-16T14:50:29.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13210" PostTypeId="1" AcceptedAnswerId="13211" CreationDate="2015-06-16T15:29:27.987" Score="2" ViewCount="866" Body="&lt;p&gt;I wrote a Python script to parse an org file that I keep my tasks in, reformat those tasks, and save them to a taskpaper file so that I can easily view and&#xA;process the tasks on my phone. The script works the way I want it to, but I have to &#xA;rememeber to run it every time I want my tasks to 'sync'. I&#xA;have been trying to use &lt;code&gt;after-save-hook&lt;/code&gt; to run the script whenever I save changes&#xA;to my org file, but I haven't been able to get it to work. I am new to Emacs, and&#xA;don't know much about lisp. This is what I have come up with based mostly on the &#xA;answer to &lt;a href=&quot;https://emacs.stackexchange.com/questions/4108/execute-external-script-upon-save-when-in-a-certain-mode&quot;&gt;this&lt;/a&gt; question.  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun sync-to-taskpaper ()&#xA;  &quot;Sync org file to taskpaper file for mobile access&quot;&#xA;  (when (eq buffer-file-name &quot;~/path/to/org/file.org&quot;)&#xA;    (shell-command &quot;python3 ~/path/to/python/script.py&quot;)))&#xA;&#xA;(add-hook 'after-save-hook #'sync-to-taskpaper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am not getting any error messages when I save the file, it just is not running &#xA;my custom function. Is it possible to do it this way, and if so, what am I &#xA;missing? Thank you for your help!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-06-16T16:02:44.780" Title="Run Python script with after-save-hook" Tags="|init-file|python|elisp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13211" PostTypeId="2" ParentId="13210" CreationDate="2015-06-16T15:46:36.983" Score="2" Body="&lt;p&gt;This is a mistake: &lt;code&gt;(eq buffer-file-name &quot;~/path/to/org/file.org&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do &lt;em&gt;not&lt;/em&gt; compare file names or any other strings using &lt;code&gt;eq&lt;/code&gt;. See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Equality-Predicates.html&quot; rel=&quot;nofollow&quot;&gt;Equality Predicates&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;strong&gt;strings&lt;/strong&gt;, use &lt;code&gt;string=&lt;/code&gt; or &lt;code&gt;equal&lt;/code&gt;. For &lt;strong&gt;file names&lt;/strong&gt;, use &lt;code&gt;file-equal-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is another function that I also use to compare filenames, to see whether they reference the same file.  It avoids accessing remote files when possible.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun same-file-p (file1 file2)&#xA;  &quot;Return non-nil if FILE1 and FILE2 name the same file.&#xA;If either name is not absolute, then it is expanded relative to&#xA;`default-directory' for the test.&quot;&#xA;  (let ((remote1  (file-remote-p file1))&#xA;        (remote2  (file-remote-p file2)))&#xA;    (and (equal remote1 remote2)  (file-equal-p file1 file2))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-16T16:02:44.780" LastActivityDate="2015-06-16T16:02:44.780" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13212" PostTypeId="1" AcceptedAnswerId="13213" CreationDate="2015-06-16T17:06:18.443" Score="8" ViewCount="858" Body="&lt;p&gt;Is it possible to make the &lt;code&gt;occur&lt;/code&gt; mode grab the cursor &lt;code&gt;(point)&lt;/code&gt;?, right now when I do &lt;code&gt;M-x occur&lt;/code&gt; and search anything in a buffer, it will open the new buffer with the findings but the cursor stays in the buffer instead going to the findings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to do &lt;code&gt;C-x 0&lt;/code&gt; to go to the other buffer every time I do a search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried doing it with a blank &lt;code&gt;init.el&lt;/code&gt; just in case is &lt;code&gt;helm&lt;/code&gt; or some other package, but I haven't been able to make it focus the cursor on the new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know that there's the &lt;code&gt;helm-occur&lt;/code&gt; that does that, but is it possible with any command or function to make the cursor change to the active buffer when that command opens a new buffer? )&lt;/p&gt;&#xA;" OwnerUserId="7006" LastEditorUserId="795" LastEditDate="2018-11-12T14:49:25.193" LastActivityDate="2018-11-12T14:49:25.193" Title="How to make occur mode select the window of buffer `*Occur*`?" Tags="|window|occur|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="13213" PostTypeId="2" ParentId="13212" CreationDate="2015-06-16T17:18:56.310" Score="11" Body="&lt;p&gt;Occur has a hook, &lt;code&gt;occur-hook&lt;/code&gt;, that contains a list of functions to run after a match is found. So we can add a hook to jump to the &lt;code&gt;*Occur*&lt;/code&gt; window there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'occur-hook&#xA;          '(lambda ()&#xA;             (switch-to-buffer-other-window &quot;*Occur*&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-06-16T17:18:56.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13214" PostTypeId="1" AcceptedAnswerId="13215" CreationDate="2015-06-16T17:22:34.293" Score="18" ViewCount="7695" Body="&lt;p&gt;There are some general well-known &lt;a href=&quot;https://stackoverflow.com/questions/522356/what-sql-coding-standard-do-you-follow&quot;&gt;coding standards&lt;/a&gt; and styles for SQL (e.g. capitalizing reserved words, placing main keywords in different lines, etc.). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does Emacs come with any modes for this, or are there any packages for formatting SQL to make it adhere to common standards?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2018-08-07T10:45:03.360" Title="Automatically formatting SQL code" Tags="|major-mode|formatting|sql|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13215" PostTypeId="2" ParentId="13214" CreationDate="2015-06-16T17:38:44.723" Score="7" Body="&lt;p&gt;Emacs does not come anything useful for sql indenting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best thing out there is &lt;a href=&quot;https://github.com/bsvingen/sql-indent&quot; rel=&quot;nofollow noreferrer&quot;&gt;sql-indent.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which doesn't do auto-indenting only on command indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/24659949/1191643&quot;&gt;I have found it pretty useful at times&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-16T17:38:44.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13216" PostTypeId="2" ParentId="13214" CreationDate="2015-06-16T17:41:55.527" Score="1" Body="&lt;p&gt;Not a complete answer to your query, but for capitalizing reserved words, I have some abbrev definitions. Here is a short example just to show you (not including all reserved sql words)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'sql-mode abbrev-table &#xA;(mapcar #'(lambda (v) (list v (upcase v) nil 1))&#xA;'(&quot;absolute&quot; &quot;action&quot; &quot;add&quot; &quot;after&quot; &quot;all&quot; &quot;allocate&quot; &quot;alter&quot; &quot;and&quot; &quot;any&quot; &quot;are&quot; &quot;array&quot; &quot;as&quot; &quot;asc&quot; &quot;asensitive&quot; )&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-06-16T17:41:55.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13217" PostTypeId="2" ParentId="13208" CreationDate="2015-06-16T17:49:56.200" Score="1" Body="&lt;p&gt;Adapted from an answer found in &lt;a href=&quot;https://stackoverflow.com/a/24344714/2623701&quot; title=&quot;https://stackoverflow.com/a/24344714/2623701&quot;&gt;Elisp - Avoid prompt in interactive function&lt;/a&gt;, the following body of the &lt;code&gt;yasnippet&lt;/code&gt; file &lt;em&gt;works&lt;/em&gt;, but I'm sure there's a better solution using &lt;code&gt;(org-insert-time-stamp)&lt;/code&gt; or similar. This also doesn't address the peculiar double timestamp behavior described in the original question.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$0&#xA;:PROPERTIES:&#xA;:CREATED: `(insert (format-time-string &quot;[%Y-%m-%d %a %H:%M]&quot;))`&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;: This solution does oddly leave two spaces between &lt;code&gt;:CREATED:&lt;/code&gt; and the inserted timestamp. I'm not sure why.&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-06-16T17:49:56.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13218" PostTypeId="1" CreationDate="2015-06-16T19:33:20.227" Score="1" ViewCount="152" Body="&lt;p&gt;This seems like it should be a very basic question, but I cannot find an answer anywhere. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When writing in AUCTeX mode the auto-inserted paired quotation marks are now unbalanced. That is, when I type the double quote button, I get two backpacks and ONE single quote, rather than two backticks and two single quotes, as expected: ``' instead of the two '' after the backticks. (Sorry that looks odd...I couldn't get two backticks in two places without it converting into a code block).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I do not have this problem in other modes. All other text entry modes have balanced quotes auto-inserted. And the problem under AUCTeX seems limited to quotes (I have not found any braces, parens, brackets or other pairs that are unbalanced). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has happened in the past month, and I don't recall installing anything new that I &lt;em&gt;thought&lt;/em&gt; would conflict. I have been trying to uninstall modes/packages/etc., changing my .emacs file, and other tweaks to fix the problem, or at least figure out where the problem arises. But so far, no luck. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it helps, here are the list of minor modes running when I am editing a .tex file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Abbrev Anzu Auto-Composition Auto-Compression&#xA;Auto-Encryption Auto-Fill Auto-Insert Centered-Cursor Column-Number&#xA;Company Delete-Selection Desktop-Save Diff-Auto-Refine Diff-Hl&#xA;Electric-Indent Erc-Autojoin Erc-Button Erc-Fill Erc-Irccontrols&#xA;Erc-List Erc-Match Erc-Menu Erc-Move-To-Prompt Erc-Netsplit&#xA;Erc-Networks Erc-Noncommands Erc-Pcomplete Erc-Readonly Erc-Ring&#xA;Erc-Spelling Erc-Stamp Erc-Track Erc-Truncate File-Name-Shadow Flx-Ido&#xA;Flycheck Flyspell Font-Lock Global-Anzu Global-Auto-Revert&#xA;Global-Company Global-Diff-Hl Global-Flycheck Global-Font-Lock&#xA;Global-Hl-Line Global-Undo-Tree Ido-Ubiquitous Latex-Math Line-Number&#xA;Magit-Auto-Revert Menu-Bar Mouse-Wheel Prelude Prelude-Global&#xA;Projectile Projectile-Global Recentf Reftex Savehist Shell-Dirtrack&#xA;Show-Smartparens Show-Smartparens-Global Size-Indication Smartparens&#xA;Sublimity Tex-Pdf Tooltip Transient-Mark Undo-Tree Visual-Line&#xA;Volatile-Highlights Which-Function Whitespace Winner&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Geeze, that seems like too many. Maybe a topic for another question.) &lt;/p&gt;&#xA;" OwnerUserId="554" LastEditorUserId="50" LastEditDate="2015-06-17T07:54:15.387" LastActivityDate="2015-06-17T07:54:15.387" Title="Unbalanced quotes auto-inserted in AUCTeX mode" Tags="|auctex|text-editing|pairing|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13219" PostTypeId="2" ParentId="13208" CreationDate="2015-06-16T21:56:12.367" Score="6" Body="&lt;p&gt;This happens because &lt;code&gt;org-insert-time-stamp&lt;/code&gt; inserts a time stamp (like the name says), but also &lt;em&gt;returns&lt;/em&gt; the time stamp.  Yasnippit inserts the return value but you're also left with the one inserted by the function call.  A fix is to capture the return value, leaving only the inserted value: &lt;code&gt;(let ((x (org-insert-time-stamp nil t t ))))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-06-17T23:48:25.063" LastActivityDate="2015-06-17T23:48:25.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13220" PostTypeId="1" AcceptedAnswerId="13359" CreationDate="2015-06-16T22:06:12.983" Score="6" ViewCount="1094" Body="&lt;p&gt;Some buffers are created by Emacs and is set in fundamental mode, like the &lt;code&gt;*Org-Babel results*&lt;/code&gt;. I think it is more convenient to set them in special mode, which can be closed with key &lt;code&gt;q&lt;/code&gt;. How do set the mode for those automatic buffers or if the name contains &lt;code&gt;*&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;p&gt;Lawlist and Drew's comments below show possible ways to do it, what I want is a special-display buffers for some buffers with &lt;code&gt;*...*&lt;/code&gt; names. The appropriate way of course is to find the function for creating the buffer and change it in the package, but it doesn't suit everybody.&lt;/p&gt;&#xA;&lt;p&gt;Since &lt;code&gt;special-display-regexps&lt;/code&gt; is obsolete, can anyone help me on an &lt;code&gt;display-buffer-alist&lt;/code&gt; with a custom function to look for &lt;code&gt;*Org-Babel Results*&lt;/code&gt; and set it to special mode?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2022-05-26T14:25:33.797" LastActivityDate="2022-05-26T14:25:33.797" Title="How to set major mode according to buffer name for non-file buffers" Tags="|org-mode|buffers|major-mode|" AnswerCount="2" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="13221" PostTypeId="1" CreationDate="2015-06-17T01:05:21.900" Score="2" ViewCount="1366" Body="&lt;p&gt;So I just switched from autocomplete to company-mode. I followed the steps outlined on &lt;a href=&quot;http://company-mode.github.io&quot; rel=&quot;nofollow&quot;&gt;http://company-mode.github.io&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and added these lines to my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but even then I get no autocomplete suggestions when I type any sort of string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To debug this I ran a vanilla emacs init file with essentially only company mode and nothing else:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After this I opened a simple test file to test company mode &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;monkey = 3&#xA;donkey= 4&#xA;elephant= 3&#xA;&#xA;def fox():&#xA;    return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried typing the string &quot;mon&quot; in the editor waiting for some sort of autocomplete popup and nothing appeared. I even trying typing M-x company-complete &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it did nothing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something really trivial I'm missing?&lt;/p&gt;&#xA;" OwnerUserId="8614" LastEditorUserId="50" LastEditDate="2015-06-17T07:42:42.590" LastActivityDate="2015-08-17T19:08:29.053" Title="Company mode completely unresponsive" Tags="|company-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13222" PostTypeId="1" AcceptedAnswerId="13223" CreationDate="2015-06-17T03:10:11.697" Score="2" ViewCount="873" Body="&lt;p&gt;Here is the function spec: &lt;code&gt;(defun jump-to-matched (open-char closed-char)  )&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;say the content of current buffer is &quot;a([b]c()d)&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I move the cursor over the first &quot;(&quot; and run &lt;code&gt;(jump-to-matched &quot;(&quot; &quot;)&quot;)&lt;/code&gt;, I expect the function return 9 which is the position of &quot;)&quot; at the end of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I move the cursor over the &quot;[&quot; at the position 2 and run &lt;code&gt;(jump-to-matched &quot;[&quot; &quot;]&quot;)&lt;/code&gt;, I expect the function return 4 which is the position of &quot;]&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to implement such function?&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="105" LastEditDate="2015-06-17T03:17:01.180" LastActivityDate="2017-11-02T14:02:57.183" Title="A elisp function to jump between matched pair" Tags="|elisp|motion|sexp|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13223" PostTypeId="2" ParentId="13222" CreationDate="2015-06-17T03:30:21.940" Score="4" Body="&lt;p&gt;If you want to write your own use the contents of &lt;code&gt;(syntax-ppss (point))&lt;/code&gt; which you give you the positions of matching pairs in the current context amongst other data. Read the docs for &lt;code&gt;syntax-ppss&lt;/code&gt; for more info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you don't need to implement the function, you can use &lt;code&gt;forward-sexp&lt;/code&gt; and &lt;code&gt;backward-sexp&lt;/code&gt; to jump between matching pairs. bound by default to &lt;kbd&gt;C-M-f&lt;/kbd&gt; and &lt;kbd&gt;C-M-b&lt;/kbd&gt;. These commands are also extremely useful for intelligently moving about code.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-06-17T03:35:15.043" LastActivityDate="2015-06-17T03:35:15.043" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13224" PostTypeId="2" ParentId="6111" CreationDate="2015-06-17T04:19:46.547" Score="0" Body="&lt;p&gt;You will notice that this is a very touchy subject among long-time emacs users. As other responses here have suggested, try the defaults for a bit to find out what key sequences are particularly difficult for you, for the languages you type on your particular keyboard. Then implement one or two remaps of critical keys, such as Ctrl, Meta, and Escape. Depending on your laptop and OS, you may have several ways to remap. For example on Mac OS X, keyboard preferences panel along with &lt;a href=&quot;https://github.com/tekezo/Karabiner/&quot; rel=&quot;nofollow&quot;&gt;Karabiner&lt;/a&gt; will be sufficient to find a workable remap of keys. Try one solution at a time to see if it suits your needs. It may take sometime to find what fits your needs. Long-time users will suggest avoiding overloading your pinky fingers. Take heed. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-17T04:19:46.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13225" PostTypeId="2" ParentId="12927" CreationDate="2015-06-17T05:19:42.613" Score="28" Body="&lt;p&gt;If you use Gnus (bundled with Emacs already), check &lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the summary of the guide:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use minimum setup from EmacsWiki is enough (&lt;a href=&quot;http://www.emacswiki.org/emacs/GnusGmail&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/GnusGmail&lt;/a&gt;). It's setup for any mail service, not only Gmail&lt;/li&gt;&#xA;&lt;li&gt;You can read/write html mail&lt;/li&gt;&#xA;&lt;li&gt;You need subscribe mail folders manually&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-u Enter&lt;/code&gt; on any mail folder to see ALL items in that folder, or else, only unread mails are visible&lt;/li&gt;&#xA;&lt;li&gt;popular protocols and authentication methods are supported out of box&lt;/li&gt;&#xA;&lt;li&gt;for password storage, I just used easygpg which is bundled with Emacs. easygpg is a general framework. So the password is encrypted and stored offline.&lt;/li&gt;&#xA;&lt;li&gt;email offline local cache is supported in Gnus ages ago&lt;/li&gt;&#xA;&lt;li&gt;add/remove/download attachments is easy. I don't know the drag-and-drop thing because I only use keyboard. You need setup 'mailcap-mime-data` to open attachment with 3rd party applications.&lt;/li&gt;&#xA;&lt;li&gt;mail searching locally/remotely is supported out of the box&lt;/li&gt;&#xA;&lt;li&gt;filter/archive is supported. But I suggest popfile which is an independent mail filter software. I use popfile because it's much much better than any other mail filter (Gmail's own filter, for example).&lt;/li&gt;&#xA;&lt;li&gt;Contacts management is handled by bbdb (another Emacs plugin), it's also easy to import contacts from Gmail by using gmail2bbdb.el (written by me).&lt;/li&gt;&#xA;&lt;li&gt;For rss reading, you'd better use elfeed (Gnus supports rss by using Gwene service. But elfeed is easier to set up). Gwene is powerful but requires much more knowledge (my Gnus guide, APIs of emacs-w3m, hydra, Lisp programming, Linux cli tools, shell)&lt;/li&gt;&#xA;&lt;li&gt;Gnus supports all platforms. But on Windows, you need add binary from OpenSSH and GnuTLS to your environment variable PATH. These two packages could be installed through Cygwin. Emacs could be Windows native version. Please note since Emacs 26, all dependencies are packaged into one bundle on Windows.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Check my guide for more tips.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMO, you'd better not replace Gmail's web UI (or any other mail service's web UI) with Gnus completely. The best practice to master Gnus is treating Gnus as an enhancement of Gmail. So you won't get frustrated if Gnus can's do certain thing because you always can fallback on web UI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vXpdr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2019-12-23T01:00:42.570" LastActivityDate="2019-12-23T01:00:42.570" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="13226" PostTypeId="1" CreationDate="2015-06-17T07:43:59.503" Score="1" ViewCount="142" Body="&lt;p&gt;I'm using emacs for perl scripting and for some unknown reason the syntax highlighting is inactivated when opening new or existing scripts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if I press a key unknowingly that disactivates it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently my only option is to close emacs and start a new session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to reactivate it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure which mode is providing the highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="2725" LastActivityDate="2015-06-17T10:26:15.350" Title="perl syntax highlighting disactivated" Tags="|syntax-highlighting|perl|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13227" PostTypeId="1" AcceptedAnswerId="13228" CreationDate="2015-06-17T08:39:18.997" Score="0" ViewCount="549" Body="&lt;p&gt;Is there an easy way to give the time (as displayed by &lt;code&gt;M-x display-time-mode&lt;/code&gt;) a separate face in the modeline?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't need anything too fancy like powerline, I'd just like to be able to have the time in its own colour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="727" LastActivityDate="2015-06-17T09:02:21.623" Title="Easy way to give the time its own face in modeline?" Tags="|mode-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13228" PostTypeId="2" ParentId="13227" CreationDate="2015-06-17T09:02:21.623" Score="4" Body="&lt;p&gt;Display Time Mode constructs a dynamic mode line based on &lt;code&gt;display-time-string-forms&lt;/code&gt;, which is a customizable option.  The value of this option is a list of Emacs Lisp expressions.  Display Time Mode constructs a &lt;code&gt;(:eval …)&lt;/code&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html#Mode-Line-Data&quot; rel=&quot;nofollow&quot;&gt;mode line data&lt;/a&gt; from these expressions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do whatever you want with these expressions, as long as they return strings.  Specifically, you can use the built-in &lt;code&gt;propertize&lt;/code&gt; function to change the face of the string. For instance, the following construct will show the current time in 24hr format in &lt;code&gt;bold&lt;/code&gt; face:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-time-string-forms&#xA;      '((propertize (format-time-string &quot;%H:%M&quot; now) 'face 'bold)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course you can use whatever face you like instead.  Take a look at the default value of this variable in &lt;code&gt;time.el&lt;/code&gt; to get an idea of what is possible.  You can visit the definition with &lt;code&gt;M-x find-variable RET display-time-string-forms&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you customize &lt;code&gt;display-time-string-forms&lt;/code&gt; this way, several other customization options of Display Time Mode (e.g. &lt;code&gt;display-time-format&lt;/code&gt;, &lt;code&gt;display-time-24hr-format&lt;/code&gt;, etc.) and mail display cease to work.  It doesn't matter since you are defining your very own display style, but you should be aware of.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;PS: While writing this answer I realized that &lt;code&gt;time.el&lt;/code&gt; is a bloody piece of  implementation-wise.  Notably, it defines a dozen of unprefixed dynamic variables with names as innocent as &lt;code&gt;now&lt;/code&gt;.  If you enable Display Time Mode, you'd better make sure that you don't use any package which binds &lt;code&gt;now&lt;/code&gt; as a closure variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, be prepared for strange issues with other packages if you enable Display Time Mode.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-06-17T09:02:21.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13229" PostTypeId="2" ParentId="13226" CreationDate="2015-06-17T10:26:15.350" Score="2" Body="&lt;p&gt;You can always turn syntax highlighting back on using &lt;code&gt;M-x font-lock-mode&lt;/code&gt;. Using the same command a second time will turn it back off. If you've got it bound to a key that you've inadvertently pressed, use &lt;code&gt;Ctrl+h w font-lock-mode&lt;/code&gt; to find which key it's bound to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to set font-lock-mode permanently for cperl, you can do so by setting either &lt;code&gt;cperl-font-lock&lt;/code&gt; or &lt;code&gt;cperl-hairy&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. The former sets only syntax highlighting; the latter also sets some other values - check the info for the variable for more information.&lt;/p&gt;&#xA;" OwnerUserId="756" LastActivityDate="2015-06-17T10:26:15.350" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13230" PostTypeId="1" AcceptedAnswerId="13231" CreationDate="2015-06-17T12:32:54.857" Score="8" ViewCount="1367" Body="&lt;p&gt;How do you escape the &lt;code&gt;+&lt;/code&gt; to not mean strikethrough in a single file?&#xA;  For example, when typing&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;use += 1 instead of ++&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;how can this not-be-strikethrough'ed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Escaping the &lt;code&gt;+&lt;/code&gt; with &lt;code&gt;\&lt;/code&gt; as in &lt;code&gt;\+&lt;/code&gt; works well, but it is not by-file.&lt;/p&gt;&#xA;" OwnerUserId="8431" LastEditorUserId="50" LastEditDate="2015-06-17T13:01:13.630" LastActivityDate="2015-06-17T13:43:51.730" Title="Disable '+' markup in org-mode on a by-file basis" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13231" PostTypeId="2" ParentId="13230" CreationDate="2015-06-17T12:57:54.287" Score="15" Body="&lt;p&gt;This behaviour is defined in the &lt;code&gt;org-emphasis-alist&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable all markup, just write on your first line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- org-emphasis-alist: nil -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To disable only the strike-through:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- org-emphasis-alist: ((&quot;*&quot; bold) (&quot;/&quot; italic) (&quot;_&quot; underline) (&quot;=&quot; org-verbatim verbatim) (&quot;~&quot; org-code verbatim) (&quot;+&quot; (:strike-through nil))); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use the syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# org-emphasis-alist: ((&quot;*&quot; bold) (&quot;/&quot; italic) (&quot;_&quot; underline) (&quot;=&quot; org-verbatim verbatim) (&quot;~&quot; org-code verbatim) (&quot;+&quot; (:strike-through nil)))&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;noreferrer&quot;&gt;Specifying file variable&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;((&quot;*&quot; bold) (&quot;/&quot; italic) (&quot;_&quot; underline) (&quot;=&quot; org-verbatim verbatim) (&quot;~&quot; org-code verbatim))&lt;/code&gt; without the &lt;code&gt;(&quot;+&quot; (:strike-through nil))&lt;/code&gt; may work too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing so, when you may have a warning when opening the file or reverting the buffer. Please refer to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html#Safe-File-Variables&quot; rel=&quot;noreferrer&quot;&gt;safe file variable&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable the warning, when doing &lt;code&gt;M-x customize-variable safe-local-variable-values&lt;/code&gt; click on &lt;code&gt;INS&lt;/code&gt;, and add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Key: org-emphasis-alist&#xA;Value: ((&quot;&quot; bold) (&quot;/&quot; italic) (&quot;_&quot; underline) (&quot;=&quot; org-verbatim verbatim) (&quot;~&quot; org-code verbatim))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;Apply&lt;/code&gt; or &lt;code&gt;Apply and Save&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="437" LastEditorUserId="437" LastEditDate="2015-06-17T13:43:51.730" LastActivityDate="2015-06-17T13:43:51.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13232" PostTypeId="2" ParentId="6104" CreationDate="2015-06-17T14:11:01.583" Score="3" Body="&lt;p&gt;I used to use this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;function export-emacs {&#xA;    if [ &quot;$(emacsclient -e t)&quot; != 't' ]; then&#xA;        return 1&#xA;    fi&#xA;&#xA;    for name in &quot;${@}&quot;; do&#xA;        value=$(eval echo \&quot;\$${name}\&quot;)&#xA;        emacsclient -e &quot;(setenv \&quot;${name}\&quot; \&quot;${value}\&quot;)&quot; &amp;gt;/dev/null&#xA;    done&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Lets you export a named variable, E.G:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export EDITOR=vim&#xA;export-emacs EDITOR&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8265" LastEditorUserId="675" LastEditDate="2015-06-17T17:55:25.060" LastActivityDate="2015-06-17T17:55:25.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13233" PostTypeId="2" ParentId="13200" CreationDate="2015-06-17T15:52:43.373" Score="2" Body="&lt;p&gt;Such is developed here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-berlin/general-close&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-berlin/general-close&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to send bug-reports and feature requests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00512.html&quot; rel=&quot;nofollow&quot;&gt;http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00512.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-06-17T15:52:43.373" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13234" PostTypeId="1" AcceptedAnswerId="13258" CreationDate="2015-06-17T16:43:54.290" Score="4" ViewCount="3467" Body="&lt;p&gt;I've seen this demonstrated before in various screencasts and can't find it searching through the docs. I do use &lt;code&gt;helm-swoop-edit&lt;/code&gt; quite often in a single buffer but when I need to change all occurrences across a project it gets a bit tedious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bonus points if there is a utility function to build such a buffer from &lt;em&gt;helm&lt;/em&gt; results? I'd be very interested as my general project searching methods are &lt;code&gt;helm-git-grep&lt;/code&gt;, &lt;code&gt;helm-do-grep&lt;/code&gt; and &lt;code&gt;helm-do-ag&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="50" LastEditDate="2015-06-17T17:07:49.947" LastActivityDate="2015-06-18T15:12:15.863" Title="How can I edit the Helm results buffer and have the changes reflected in the original buffers?" Tags="|helm|replace|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13235" PostTypeId="2" ParentId="13191" CreationDate="2015-06-17T16:46:01.260" Score="8" Body="&lt;p&gt;To set ‘tangle file’ globally we should use &lt;code&gt;#+PROPERTY: tangle &quot;~/.path/to/file.extension&quot;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunatelly, that change is not enough; we need to trigger a refresh. We put cursor on that line and press &lt;code&gt;C-c C-c&lt;/code&gt; which gives &lt;em&gt;Local setup has been refreshed&lt;/em&gt; message in a minibuffer (or in &lt;em&gt;*Messages*&lt;/em&gt; buffer). We could also reopen file which applies new settings. &lt;code&gt;C-c C-c&lt;/code&gt; is a binding for &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt; — a ‘&lt;a href=&quot;http://orgmode.org/manual/The-very-busy-C_002dc-C_002dc-key.html&quot; rel=&quot;noreferrer&quot;&gt;swiss knife&lt;/a&gt;’ org-mode function which&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the cursor is in one of the special #+KEYWORD lines, this&#xA;    triggers scanning the buffer for these lines and updating the&#xA;    information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, when our changes are ready we can &lt;code&gt;C-c C-v t&lt;/code&gt; (or &lt;code&gt;C-c C-v C-t&lt;/code&gt;;&#xA;or &lt;code&gt;M-x org-babel-tangle&lt;/code&gt;) to tangle our file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can read more about specifying header arguments (not only at global&#xA;level) at &lt;a href=&quot;http://orgmode.org/manual/Using-header-arguments.html#Using-header-arguments&quot; rel=&quot;noreferrer&quot;&gt;org manual page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="220" LastActivityDate="2015-06-17T16:46:01.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13236" PostTypeId="2" ParentId="10965" CreationDate="2015-06-17T17:46:04.973" Score="9" Body="&lt;p&gt;I have holidays displayed in my org-agenda; here's how I do it.&#xA;Via Customize, (changing &lt;strong&gt;custom-set-variables&lt;/strong&gt;) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turn off holidays I don't want displayed :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(holiday-bahai-holidays nil)&#xA;'(holiday-hebrew-holidays nil)&#xA;'(holiday-islamic-holidays nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tell agenda to display events from calendar diary:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(org-agenda-include-diary t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result : holidays will show up in agenda. You can also create your own holidays by changing the variable &lt;strong&gt;holiday-other-holidays&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8558" LastActivityDate="2015-06-17T17:46:04.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13237" PostTypeId="1" AcceptedAnswerId="13240" CreationDate="2015-06-17T19:02:59.707" Score="20" ViewCount="7008" Body="&lt;p&gt;In org-mode, I like to run &lt;code&gt;org-todo-list&lt;/code&gt;, which displays the global todo list including all my org-agenda files. How do I view a TODO list for only the current buffer, ignoring my other org-agenda files?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="253" LastEditDate="2015-06-17T19:44:36.337" LastActivityDate="2020-06-01T10:42:34.200" Title="in org-mode, how to view TODO items for current buffer only?" Tags="|org-mode|org-agenda|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13238" PostTypeId="2" ParentId="13237" CreationDate="2015-06-17T19:14:14.460" Score="9" Body="&lt;p&gt;You could bind &lt;code&gt;org-agenda-files&lt;/code&gt; dynamically to the current buffer's file and call &lt;code&gt;org-todo-list&lt;/code&gt; from there:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-todo-list-current-file (&amp;amp;optional arg)&#xA;  &quot;Like `org-todo-list', but using only the current buffer's file.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((org-agenda-files (list (buffer-file-name (current-buffer)))))&#xA;    (if (null (car org-agenda-files))&#xA;        (error &quot;%s is not visiting a file&quot; (buffer-name (current-buffer)))&#xA;      (org-todo-list arg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-17T19:14:14.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13239" PostTypeId="2" ParentId="13237" CreationDate="2015-06-17T19:17:05.020" Score="13" Body="&lt;p&gt;You can use &lt;code&gt;org-show-todo-tree&lt;/code&gt; to get a sparse tree view of the current buffer's TODO items. It's bound to &lt;code&gt;C-c / t&lt;/code&gt; by default.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-06-17T19:17:05.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13240" PostTypeId="2" ParentId="13237" CreationDate="2015-06-17T19:44:57.143" Score="22" Body="&lt;p&gt;You can use &lt;code&gt;&amp;lt;&lt;/code&gt; from the agenda menu to restrict the current agenda call to the buffer that the agenda was invoked from.  To restrict to that file for more than one call, you can use &lt;code&gt;C-c C-x &amp;lt;&lt;/code&gt; (&lt;code&gt;org-agenda-set-restriction-lock&lt;/code&gt;).  See &lt;code&gt;(info &quot;(org) Agenda files&quot;)&lt;/code&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-06-17T19:44:57.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13241" PostTypeId="1" AcceptedAnswerId="13242" CreationDate="2015-06-17T20:25:32.163" Score="13" ViewCount="5564" Body="&lt;p&gt;I'm composing a complex regular expression and the user can supply a part of the expression.  However, the user-supplied part should be interpreted literally, i.e. regexp special characters should be escaped.  Is there a function for escaping these characters?  It seems like a common thing to do but all my googling was unsuccessful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(re-search-forward (format &quot;\b%s\b&quot; user-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;user-string&lt;/code&gt; is &lt;code&gt;test*case&lt;/code&gt;, I want to match &lt;code&gt;test*case&lt;/code&gt; but not &lt;code&gt;testttttcase&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2015-06-17T20:38:06.447" Title="How to escape regexp special characters in a string?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13242" PostTypeId="2" ParentId="13241" CreationDate="2015-06-17T20:38:06.447" Score="18" Body="&lt;p&gt;You can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Functions.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;regexp-quote&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function returns a regular expression whose only exact match is string. Using this regular expression in looking-at will succeed only if the next characters in the buffer are string; using it in a search function will succeed if the text being searched contains string.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(regexp-quote &quot;^The cat$&quot;) =&amp;gt; \\^The cat\\$&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-17T20:38:06.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13243" PostTypeId="1" CreationDate="2015-06-17T21:48:32.913" Score="4" ViewCount="959" Body="&lt;p&gt;I'm trying to create an &lt;code&gt;org-capture&lt;/code&gt; template that creates a task &lt;em&gt;and&lt;/em&gt; (important part) automatically adds a parent's property to this new task. I'm comfortable creating new &lt;code&gt;capture&lt;/code&gt; templates--I'm just unsure of the latter part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it matters I'm trying to &quot;inherit&quot; the &lt;code&gt;CATEGORY&lt;/code&gt; property to my new tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I prefer not to use property inheritance if I can help it. The documentation is very clear that this can adversely affect performance.&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="5478" LastEditDate="2015-06-17T22:30:40.793" LastActivityDate="2015-10-17T00:51:43.083" Title="How to use Org Capture to add a task *and* automatically add parent's property" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13244" PostTypeId="1" CreationDate="2015-06-17T21:58:42.090" Score="12" ViewCount="1098" Body="&lt;p&gt;What is the standard method to debug emacs-lisp orgmode source code blocks with input variables as header arguments?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the hacky solution to insert the following snipped in front of a source code block.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when t ;; t: do debug, nil: do not debug&#xA;  (org-edit-src-code)&#xA;  (let ((parse-sexp-ignore-comments t))&#xA;    (goto-char (point-min))&#xA;    (forward-sexp 2)&#xA;    (edebug-defun)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Debugging of the source code block can be turned on or off by the boolean on the first line. The &lt;code&gt;org-edit-src-code&lt;/code&gt; makes sure that point is in the special source edit buffer when one executes the source code block. The snippet puts point in front of the actual code and enters &lt;code&gt;edebug-defun&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There follows a full working example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* edebug emacs-lisp source code block with input variables&#xA;&#xA;  Example input data:&#xA;  #+TBLNAME: input-table&#xA;  | This   | table       | contains |&#xA;  | some   | strings     | for      |&#xA;  | trying | source code | blocks   |&#xA;&#xA;  Further example input data (strings to be highlighted):&#xA;  #+TBLNAME: emph&#xA;  | table | strings | blocks |&#xA;&#xA;  The code-block to be debugged:&#xA;  #+NAME: emphDebug&#xA;  #+BEGIN_SRC emacs-lisp :var input=input-table emph=emph&#xA;(when t ;; t: do debug, nil: do not debug&#xA;  (org-edit-src-code)&#xA;  (let ((parse-sexp-ignore-comments t))&#xA;    (goto-char (point-min))&#xA;    (forward-sexp 2)&#xA;    (edebug-defun)))&#xA;;; The actual program starts here.&#xA;(let ((re (regexp-opt (car emph))))&#xA;  (mapcar (lambda (row)&#xA;        (mapcar (lambda (col)&#xA;              (if (string-match re col)&#xA;              (concat &quot;*&quot; (match-string 0 col) &quot;*&quot;)&#xA;            col))&#xA;            row))&#xA;      input))&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS: emphDebug&#xA;  | This   | *table*     | contains |&#xA;  | some   | *strings*   | for      |&#xA;  | trying | source code | *blocks* |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Place point on the &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; line and press &lt;kbd&gt;C-c C-c&lt;/kbd&gt; to start debugging.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If one often needs to debug source code blocks one can define the following function somewhere in his configuration file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-src-debug ()&#xA;  &quot;Put a call to this function at the beginning of the org source block to debug it.&quot;&#xA;  (save-excursion&#xA;    (let ((pt (let ((case-fold-search t)) (org-babel-where-is-src-block-head))))&#xA;      (unless pt (error &quot;Not at source block&quot;))&#xA;      (goto-char pt)&#xA;      (org-edit-src-code)&#xA;      (let ((parse-sexp-ignore-comments t))&#xA;        (goto-char (point-min))&#xA;        (forward-sexp 2)&#xA;        (edebug-defun)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function can then be used at the beginning of source code blocks. Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :var test='(1 2 3)&#xA;   (org-src-debug)&#xA;   (message &quot;arg: %s&quot; test)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But, I guess there is some org-standard way for debugging which I am not yet aware of.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="105" LastEditDate="2016-08-15T01:26:39.733" LastActivityDate="2022-06-14T12:52:48.217" Title="Edebug orgmode source code blocks with input variables" Tags="|org-mode|org-babel|debugging|edebug|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13245" PostTypeId="2" ParentId="3330" CreationDate="2015-06-17T22:06:57.133" Score="1" Body="&lt;p&gt;ErgoEmacs has a function &lt;code&gt;close-current-buffer&lt;/code&gt; which in particular keeps a list of recently closed buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar recently-closed-buffers (cons nil nil) &quot;A list of recently closed buffers. The max number to track is controlled by the variable recently-closed-buffers-max.&quot;)&#xA;(defvar recently-closed-buffers-max 10 &quot;The maximum length for recently-closed-buffers.&quot;)&#xA;&#xA;(defun close-current-buffer ()&#xA;&quot;Close the current buffer.&#xA;&#xA;Similar to (kill-buffer (current-buffer)) with the following addition:&#xA;&#xA;• prompt user to save if the buffer has been modified even if the buffer is not associated with a file.&#xA;• make sure the buffer shown after closing is a user buffer.&#xA;• if the buffer is a file, add the path to the list recently-closed-buffers.&#xA;&#xA;A emacs buffer is one who's name starts with *.&#xA;Else it is a user buffer.&quot;&#xA; (interactive)&#xA; (let (emacsBuff-p isEmacsBufferAfter)&#xA;   (if (string-match &quot;^*&quot; (buffer-name))&#xA;       (setq emacsBuff-p t)&#xA;     (setq emacsBuff-p nil))&#xA;&#xA;   ;; offer to save buffers that are non-empty and modified, even for non-file visiting buffer. (because kill-buffer does not offer to save buffers that are not associated with files)&#xA;   (when (and (buffer-modified-p)&#xA;              (not emacsBuff-p)&#xA;              (not (string-equal major-mode &quot;dired-mode&quot;))&#xA;              (if (equal (buffer-file-name) nil) &#xA;                  (if (string-equal &quot;&quot; (save-restriction (widen) (buffer-string))) nil t)&#xA;                t&#xA;                )&#xA;              )&#xA;     ;; (progn ;; I'VE ADDED THIS LINE&#xA;     ;;   (switch-to-buffer (buffer-name)) ;; AND THIS LINE&#xA;     (if (y-or-n-p&#xA;          (concat &quot;Buffer &quot; (buffer-name) &quot; modified; Do you want to save?&quot;))&#xA;         (save-buffer)&#xA;       (set-buffer-modified-p nil))&#xA;     ;; ) ;; AND ALSO A PARENTHESIS HERE&#xA;     )&#xA;&#xA;   ;; save to a list of closed buffer&#xA;   (when (not (equal buffer-file-name nil))&#xA;     (setq recently-closed-buffers&#xA;           (cons (cons (buffer-name) (buffer-file-name)) recently-closed-buffers))&#xA;     (when (&amp;gt; (length recently-closed-buffers) recently-closed-buffers-max)&#xA;           (setq recently-closed-buffers (butlast recently-closed-buffers 1))&#xA;           )&#xA;     )&#xA;&#xA;   ;; close&#xA;   (kill-buffer (current-buffer))&#xA;&#xA;   ;; if emacs buffer, switch to a user buffer&#xA;   (if (string-match &quot;^*&quot; (buffer-name))&#xA;       (setq isEmacsBufferAfter t)&#xA;     (setq isEmacsBufferAfter nil))&#xA;   (when isEmacsBufferAfter&#xA;     (next-user-buffer)&#xA;     )&#xA;   )&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So using these one can re-open this session closed buffer with&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; undo close this-session buffer:&#xA;(defun ergo-undo-close-buffer ()&#xA;  &quot;Opens some this-session closed buffer.&quot;&#xA;  (interactive)&#xA;  (let* ((mylist (delq nil (delete-dups (mapcar 'car recently-closed-buffers))))&#xA;         (baseName (ido-completing-read &quot;Open this session closed buffer: &quot; mylist))&#xA;         (fileName (cdr (assoc baseName recently-closed-buffers))))&#xA;    (find-file fileName)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-06-17T22:06:57.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13246" PostTypeId="1" CreationDate="2015-06-17T22:11:02.517" Score="2" ViewCount="127" Body="&lt;p&gt;When I try to open an encrypted message, Gnus asks me for my passphrase, which it seems to accept. But then it doesn't decrypt the message, and it doesn't report errors either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can otherwise decrypt the message by directly feeding its text to GPG. How do I debug this problem?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;More info: If I run &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;epa-decrypt-region&lt;/code&gt; on the text of the message, while in Gnus, it decrypts it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key associated with the sender has multiple email addresses associated with it, and the address in question is the second in the list. Is it possible that this is a problem?&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-06-18T06:16:09.980" LastActivityDate="2015-06-18T06:16:09.980" Title="Gnus fails to decrypt an email encrypted using GPG" Tags="|gnus|gpg|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13247" PostTypeId="2" ParentId="13152" CreationDate="2015-06-17T22:21:43.630" Score="1" Body="&lt;p&gt;If you're working on a MBPro Retina or Thunderbolt Display, or any display that uses in-plane switching (IPS) technology, your issue is likely image persistence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was experiencing the same problem on my Mac with all programs. I would close or hide a window (or Emacs frame), and I could see a very faint remnant of that window (frame). It also occurred when I switched OS X 'spaces.'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After putting it off for some time your question prompted me to finally investigate the issue. I would recommend Apple's article on &lt;a href=&quot;https://support.apple.com/en-nz/HT202580&quot; rel=&quot;nofollow&quot; title=&quot;https://support.apple.com/en-nz/HT202580&quot;&gt;Avoiding image persistence on Apple displays&lt;/a&gt;. The punchline: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To clear the persistent image, allow the screen saver to run for approximately as long as the image was being displayed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5478" LastActivityDate="2015-06-17T22:21:43.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13248" PostTypeId="1" CreationDate="2015-06-17T22:39:00.153" Score="2" ViewCount="2063" Body="&lt;p&gt;An Emacs configuration is vital to an effective efficient workflow thus it would advantageous to have ubiquitous access to the Emacs, I have laboriously, setup. I would prefer mobile storage solution because of internet restrictions and problematic connections, and the difficultly and hassle associated with transport a computer. I have try consulting searching for the solution - even venturing beyond the first page of results - and have not found something that works well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relocating the initialization file for Emacs, of which there are several examples, however by default Emacs still has problems and requires a native init to redirect it and tends to want to find package files on the drive. Portable apps has Emacs which installed and seems quite promising, because it's specifically designed for this purpose, though has difficulty installing packages as in using the standard package.el seems missing and require package in my _emacs throws errors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally if its necessary or preferable to store Emacs configurations online then is it possible and how would one pursue using google drive, as the storage solution, rather then dropbox which I have seen as an option.&lt;/p&gt;&#xA;" OwnerUserId="6634" LastActivityDate="2015-08-19T10:58:41.217" Title="Portable Emacs for ubiquitous usage" Tags="|init-file|" AnswerCount="3" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13249" PostTypeId="1" CreationDate="2015-06-18T00:04:10.000" Score="5" ViewCount="2441" Body="&lt;p&gt;&lt;em&gt;How can I control the indentation of a line in a plain text file?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;fundamental-mode&lt;/code&gt;, when you begin to type a line (call it &lt;em&gt;Line A&lt;/em&gt;) after a previous line by hitting &lt;kbd&gt;return&lt;/kbd&gt;, the line will automatically inherit the indent of the previous line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I manually delete the automated indent, and want 3 tabs as indent instead by hitting &lt;kbd&gt;tab&lt;/kbd&gt; three times, it seems that the second tab is converted to spaces, because I saw the cursor didn't jump by tab but by a character when I hit the second tab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I create another line (call it &lt;em&gt;Line B&lt;/em&gt;) and remove any automated indent of it, if I hit just one &lt;kbd&gt;tab&lt;/kbd&gt; key, it will jump to the same indent as that of &lt;em&gt;Line A&lt;/em&gt;, and &lt;em&gt;Line A&lt;/em&gt; has an indent more than just one tab.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="253" LastEditDate="2015-06-18T18:44:21.063" LastActivityDate="2015-06-18T18:44:21.063" Title="Indention and tabs in fundamental mode" Tags="|indentation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13250" PostTypeId="1" CreationDate="2015-06-18T00:14:27.993" Score="10" ViewCount="1524" Body="&lt;p&gt;I alternatively run 24.5 and 25.0.50. Unfortunately, packages installed and compiled from 25.0.50 don't work with Emacs 24.5 (&lt;code&gt;cl-struct-define&lt;/code&gt; is a common culprit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One trivial solution is to not byte-compile anything. That makes things pretty slow, though. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use compiled packages (for performance) while using the same &lt;code&gt;.emacs.d&lt;/code&gt; for both 24.5 and 25.0.50? I'd also be ok with 24.5 ignoring the compiled files.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2023-03-19T01:40:26.537" Title="How do I run multiple versions of Emacs with the same .emacs.d" Tags="|byte-compilation|version-compatibilty|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13251" PostTypeId="2" ParentId="13250" CreationDate="2015-06-18T01:12:35.380" Score="3" Body="&lt;p&gt;Put the byte-compiled files for different Emacs versions in different directories. Make your &lt;code&gt;load-path&lt;/code&gt; conditional on the Emacs version you are running, so that you load the appropriate byte-compiled libraries.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-18T01:12:35.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13252" PostTypeId="1" CreationDate="2015-06-18T04:00:02.730" Score="5" ViewCount="93" Body="&lt;p&gt;Assuming I have a task where I store a timestamp for every taskchange I do: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE Extremely important dummy task         :categorywhatevs:&#xA;- State &quot;DONE&quot;       from &quot;IN PROGRESS&quot; [2015-06-08 Mo 14:19]&#xA;- State &quot;In PROGRESS&quot;       from &quot;URGENT&quot;     [2015-06-04 Do 08:36]&#xA;- State &quot;URGENT&quot;     from &quot;QUEUE&quot;      [2015-06-04 Do 08:09]&#xA;- State &quot;QUEUE&quot;      from &quot;&quot;           [2015-06-04 Do 08:09]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These timestamps contain valuable information: Theoretically I can deduce how long a distinct task took me. We even can think about an outlook and have an analysis which measures the average task duration - certainly good for planning ahead. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But here I have a problem: How do I get this information? Of course I could string-parse everything under the task and store the durations within some property tags. I could do this automatically by using a hook (the &lt;code&gt;org-after-todo-state-change-hook&lt;/code&gt; seems to be a good candidate). However as a complete lisp newbie I do not know how I got the information in upper two lines below a heading. &lt;/p&gt;&#xA;" OwnerUserId="5392" LastEditorUserId="105" LastEditDate="2017-10-15T18:01:34.453" LastActivityDate="2017-10-15T18:01:34.453" Title="Get task duration from old timestamps" Tags="|org-mode|hooks|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13254" PostTypeId="1" CreationDate="2015-06-18T07:30:47.373" Score="7" ViewCount="3557" Body="&lt;p&gt;Using gtags.el or ggtags.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a project A depending on project B.  While in a buffer belonging to A, I want to jump to a definition in B. How do I do this with &lt;code&gt;ggtags-mode&lt;/code&gt; ?  &lt;code&gt;M-.&lt;/code&gt; simply lists the occurences in project A.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2020-06-05T19:34:31.410" Title="Find external definition with gtags or ggtags" Tags="|gtags|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13255" PostTypeId="2" ParentId="13222" CreationDate="2015-06-18T08:17:23.487" Score="2" Body="&lt;p&gt;An implementation of this command was provided around 20 years ago, unfortunately forgot the source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here a basic approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ar-simple-match-paren ()&#xA;  &quot;Jump between matching paren. &quot;&#xA;  (interactive)&#xA;  (cond ((eq 4 (car (syntax-after (point))))&#xA;     (forward-sexp)&#xA;     (forward-char -1))&#xA;    ((eq 5 (car (syntax-after (point))))&#xA;     (forward-char 1)&#xA;     (backward-sexp))&#xA;    (t (message &quot;%s&quot; &quot;Don't see a matching paren&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here with historical key &quot;%&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ar-match-paren (&amp;amp;optional arg)&#xA;  &quot;Go to the matching brace, bracket or parenthesis if on its counterpart.&#xA;&#xA;Otherwise insert the character, the key is assigned to, here `%'.&#xA;With \\[universal argument] insert a `%'. &quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if arg&#xA;      (self-insert-command (if (numberp arg) arg 1))&#xA;    (cond ((eq 4 (car (syntax-after (point))))&#xA;       (forward-sexp)&#xA;       (forward-char -1))&#xA;      ((eq 5 (car (syntax-after (point))))&#xA;       (forward-char 1)&#xA;       (backward-sexp))&#xA;      (t (self-insert-command 1)))))&#xA;&#xA;(global-set-key [(%)] 'ar-match-paren)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Errors are mine...&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-06-18T10:55:57.123" LastActivityDate="2015-06-18T10:55:57.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13256" PostTypeId="1" AcceptedAnswerId="13263" CreationDate="2015-06-18T09:24:57.617" Score="4" ViewCount="1145" Body="&lt;p&gt;Usually I have two windows vertical split layout when using Emacs.  I'm curious is it possible to change default font size for one of them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, I use 14 points font height with 80 columns limit, when windows have same width this gives no line wrapping.  But I've found bigger font size is better for eyes and eases viewing perception, however if windows have equal width the lines become too long and wrapping appears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the idea is to have one wide (major) window with bigger font size, and another window being narrowed with smaller font-size.  I know I can set up font per buffer, but this is not what I need, e.g. I want same buffer being rendered with bigger font when visited in major window and with smaller font when visited in secondary window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wQNmN.png&quot; alt=&quot;layout screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a screenshot above there are major window is outlined with green colour and secondary window is outlined with blue one.  For example I want to have 18pt font size for major window and 12pt font size for blue window.&lt;/p&gt;&#xA;" OwnerUserId="6844" LastEditorUserId="6844" LastEditDate="2015-06-18T13:43:56.083" LastActivityDate="2015-06-18T16:48:18.443" Title="Different fonts for different Emacs' windows" Tags="|window|fonts|customization|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13257" PostTypeId="2" ParentId="13254" CreationDate="2015-06-18T11:02:21.907" Score="6" Body="&lt;p&gt;I would create a symbolic link to project B in one of the directories on project A and run &lt;code&gt;gtags&lt;/code&gt; in both the projects (as you might also need to use tags for Project B only).&lt;/p&gt;&#xA;&lt;p&gt;There's also another way to solve this problem; here's more info from &lt;code&gt;global&lt;/code&gt; documentation:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;If you want to locate symbols that are not defined in the source tree, then you can specify library directories with GTAGSLIBPATH environment variable.&lt;/p&gt;&#xA;&lt;p&gt;You should execute gtags(1) at each directory in the GTAGSLIBPATH. If ‘GTAGS’ is not found there, global ignores such directories.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ pwd&#xA; /develop/src/mh # this is a source project &#xA;$ gtags &#xA;$ ls&#xA; G*TAGS GRTAGS GTAGS &#xA;$ global mhl &#xA;uip/mhlsbr.c # mhl() is found &#xA;$ global strlen # strlen() is not found &#xA;$ (cd /usr/src/lib; gtags) # library source &#xA;$ (cd /usr/src/sys; gtags) # kernel source &#xA;$ export GTAGSLIBPATH=/usr/src/lib:/usr/src/sys &#xA;$ global strlen ../../../usr/src/lib/libc/string/strlen.c # found in library $ global access ../../../usr/src/sys/kern/vfs_syscalls.c # found in kernel &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Or, you can take a more straightforward way to do the same thing. In the following example, we treat as if the system library and the kernel are part of our project.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ ln -s /usr/src/lib . &#xA;$ ln -s /usr/src/sys . &#xA;$ gtags &#xA;$ global strlen&#xA; lib/libc/string/strlen.c &#xA;$ global access&#xA; sys/kern/vfs_syscalls.c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;[&lt;a href=&quot;http://www.gnu.org/software/global/globaldoc_toc.html#Applied-usage&quot; rel=&quot;noreferrer&quot;&gt;Source&lt;/a&gt;]&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-06-18T11:02:21.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13258" PostTypeId="2" ParentId="13234" CreationDate="2015-06-18T15:12:15.863" Score="3" Body="&lt;p&gt;It's documented in helm's wiki: &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#810-save-grep-session&quot; rel=&quot;nofollow&quot;&gt;8.10. Save grep session&lt;/a&gt;, when using &lt;code&gt;helm-occur&lt;/code&gt;/&lt;code&gt;helm-do-grep&lt;/code&gt;/&lt;code&gt;helm-do-ag&lt;/code&gt;, you can use &lt;kbd&gt;C-x C-s&lt;/kbd&gt; to save search result to buffer, after installing &lt;code&gt;wgrep-helm&lt;/code&gt;, you can use &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-wgrep#usage&quot; rel=&quot;nofollow&quot;&gt;wgrep's commands&lt;/a&gt; to edit that buffer.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-06-18T15:12:15.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13259" PostTypeId="2" ParentId="13220" CreationDate="2015-06-18T16:04:00.957" Score="3" Body="&lt;p&gt;Thanks to lawlist. I finally got it working.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun db-regexp-match-p (regexps string)&#xA;  (and string&#xA;       (catch 'matched&#xA;         (let ((inhibit-changing-match-data t))&#xA;           (dolist (regexp regexps)&#xA;             (when (string-match regexp string)&#xA;               (throw 'matched t)))))))&#xA;(defvar special-buffer-regexp&#xA;  '(&quot;[*].*results.*[*]&quot; &quot;[*].*out.*[*]&quot;)&#xA;  &quot;Regexp of special mode buffer names&quot;)&#xA;(defun set_special_mode (buffer alist)&#xA;  (interactive)&#xA;  (if (db-regexp-match-p special-buffer-regexp (buffer-name buffer))&#xA;  (with-current-buffer buffer &#xA;      (special-mode))))&#xA;&#xA;(add-to-list 'display-buffer-alist '(&quot;.*&quot; . (set_special_mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="4036" LastEditDate="2015-06-27T15:29:13.107" LastActivityDate="2015-06-27T15:29:13.107" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="13260" PostTypeId="1" AcceptedAnswerId="13262" CreationDate="2015-06-18T16:10:16.507" Score="8" ViewCount="3365" Body="&lt;p&gt;I had tried to create my first (private) layer for spacemacs, for the yafolding package. So I had created the &lt;code&gt;~/.emacs.d/private/yafolding/packages.el&lt;/code&gt; file with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yafolding-packages&#xA;    '(&#xA;      yafolding&#xA;      ))&#xA;&#xA;(setq yafolding-excluded-packages '())&#xA;&#xA;(defun yafolding/init-my-package ()&#xA;   &quot;Initialize my package&quot;&#xA;   (use-package yafolding))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And also enabled this layer in &lt;code&gt;~/.spacemacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-configuration-layers&#xA;'(&#xA;  ;; ... &#xA;  yafolding&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I start &lt;code&gt;emacs&lt;/code&gt; &lt;code&gt;*Messages*&lt;/code&gt; lists my private layer as loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading c:/Users/ZsBotykai/AppData/Roaming/.emacs.d/private/yafolding/packages.el (source)...done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But as far as I see, &lt;code&gt;yafolding&lt;/code&gt; did not get installed (&lt;code&gt;ls ~/.emacs.d/elpa/*yaf*&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What did I miss? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: as you might noticed it: I'm on Windows, with the official GNU Emacs windows binaries, although I'm having cygwin installed just in case (but without cygwin emacs). Also I had enabled other official layers but they were installed properly.&lt;/p&gt;&#xA;" OwnerUserId="473" LastActivityDate="2015-07-18T16:55:25.353" Title="Create private spacemacs layer for yafolding" Tags="|package|spacemacs|install|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13261" PostTypeId="2" ParentId="10159" CreationDate="2015-06-18T16:15:23.790" Score="3" Body="&lt;p&gt;Here Emacs Calc is!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-table is based on Calc function.&#xA;Calc function &lt;em&gt;vcorr&lt;/em&gt; calculates a correlation coefficient among two vectors.&#xA;Use &lt;em&gt;vcorr&lt;/em&gt; with &lt;em&gt;calc-eval&lt;/em&gt; in Emacs Lisp with Org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Coefficient-Determination is the same as R-square.&#xA;R-square for a simple regression analysis Y on X equals to a squared value of a correlation coefficient between X and Y.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: My productivity and sleep&#xA;#+NAME: MY-TABLE&#xA;| Date    | sleep | productivity |&#xA;|---------+-------+--------------|&#xA;| ~[meh]~ |  7.50 |         4.00 |&#xA;| ~[meh]~ |  8.00 |         5.00 |&#xA;| ~[meh]~ |  8.50 |         6.00 |&#xA;| ~[meh]~ |  8.00 |         4.00 |&#xA;| ~[meh]~ |  8.20 |         5.00 |&#xA;| ~[meh]~ |  8.70 |         6.00 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When importing lists from Org-table to Emacs Lisp, you can select rows and columns.&#xA;:var TMP=MY-TABLE[,1:2] selects for whole rows, with 2nd and 3rd columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c.f. &lt;a href=&quot;http://orgmode.org/manual/var.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/var.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value :exports both :var TMP=MY-TABLE[,1:2]&#xA;(require 'cl)                             ;; required for (first) and (second) function.&#xA;(setq LST (cddr TMP))                     ;; import data to list LST excluding column names and hline.&#xA;(setq VEC (apply #'mapcar* #'vector LST)) ;; transpose and change to vector VEC, as Calc accepts vectors only.&#xA;(setq X (first VEC))                      ;; X is a vector of sleep ('car').&#xA;(setq Y (second VEC))                     ;; Y is a vector or productivity ('cadr').&#xA;(setq VALUE-R                             ;; correlation coefficient.&#xA;  (string-to-number                   ;; calc-eval returns string.&#xA;   (calc-eval (format &quot;vcorr(%s,%s)&quot; X Y)))) ;; alas, calc-eval accepts only strings.&#xA;(setq VALUE-R2 (* VALUE-R VALUE-R))       ;; R-square for a simple regression&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 0.8072625698326307&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-06-25T19:15:09.530" LastActivityDate="2015-06-25T19:15:09.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13262" PostTypeId="2" ParentId="13260" CreationDate="2015-06-18T16:17:10.300" Score="5" Body="&lt;p&gt;Instead of &lt;code&gt;(defun yafolding/init-my-package ()&lt;/code&gt; it should have been &lt;code&gt;(defun yafolding/init-yafolding ()&lt;/code&gt;, as pointed out in by &lt;a href=&quot;https://gitter.im/syl20bnr/spacemacs?at=5582ec8adeac73ee5b859fc1&quot;&gt;cpaulik in the official support chat&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="473" LastActivityDate="2015-06-18T16:17:10.300" CommentCount="0" CommunityOwnedDate="2015-06-18T16:17:10.300" ContentLicense="CC BY-SA 3.0" />
  <row Id="13263" PostTypeId="2" ParentId="13256" CreationDate="2015-06-18T16:36:24.827" Score="1" Body="&lt;p&gt;As long as you don't plan on having a buffer open in two windows at the same time this solution could work for you:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'face-remap)&#xA;&#xA;(defun buffer-resize-font-for-window ()&#xA;  &quot;Scale the buffer's text for the current window.&quot;&#xA;  (let ((scale (or (window-parameter (selected-window) 'my-custom-font-scale) 0)))&#xA;    (when (integerp scale)&#xA;      (let ((text-scale-mode-amount scale))&#xA;        (text-scale-mode t)))))&#xA;&#xA;(defun my-set-window-font-scale (&amp;amp;optional scale)&#xA;  &quot;Set the window scale for the current window.&#xA; 0 is the default height.&quot;&#xA;  (interactive (list (string-to-number&#xA;                      (completing-read &#xA;                       &quot;Window Font Scale: &quot; &#xA;                       (mapcar 'number-to-string (number-sequence 0 5)) nil t))))&#xA;  (set-window-parameter (selected-window) 'my-custom-font-scale scale)&#xA;  (buffer-resize-font-for-window))&#xA;&#xA;&#xA;(add-hook 'buffer-list-update-hook 'buffer-resize-font-for-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After you evaluate that go the the window you want scaled larger and run &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;my-set-window-font-scale&lt;/code&gt; and choose a scale. You should see that every buffer you open in that window get's automatically scaled up.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way every time you switch buffers or switch the current buffer in a window, Emacs will check for a window specific scaling value and scale the buffer accordingly. The scaling is buffer specific so if you have a buffer open in two windows with different scales they will both be scaled according to the last used window. Scaling is buffer-specific so you can hack it in fake window-specific support but it's just a hack.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is more of a starting point than a solution ready for daily use, but hopefully you can build on it to make something really useful.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-06-18T16:48:18.443" LastActivityDate="2015-06-18T16:48:18.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13264" PostTypeId="2" ParentId="13248" CreationDate="2015-06-18T17:02:07.797" Score="0" Body="&lt;p&gt;Have a look at &lt;a href=&quot;https://stackoverflow.com/questions/350345/how-can-i-have-a-portable-emacs&quot;&gt;StackOverflow → How can I have a portable Emacs?&lt;/a&gt;  There is also &lt;a href=&quot;https://github.com/mlf176f2/EmacsPortable.App&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/mlf176f2/EmacsPortable.App&lt;/a&gt;, last updated a year ago.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EmacsPortable.App attempts to make a portable version of Emacs that runs off a USB drive under either Windows, Linux, or Mac OSX. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can get some idea about how this sort of solution works, &lt;a href=&quot;https://unix.stackexchange.com/a/174790/37299&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from that, you could review the options at &lt;a href=&quot;https://stackoverflow.com/questions/2236778/emacs-cloud-storage-options&quot;&gt;StackOverflow → Emacs cloud storage options?&lt;/a&gt;.  So far, the solutions for storing your config files mentioned there include SVN, Git, Dropbox, WebDrive, and JungleDisk.  None of those are Emacs-specific.  They also mention Tramp, but that's not really relevant to your issue (since it assumes you have a working Emacs already).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To this list I would also add: X11 forwarding, see &lt;a href=&quot;https://stackoverflow.com/questions/8994898/running-emacs-in-graphics-mode-on-remote-server&quot;&gt;StackOverflow → Running emacs in graphics mode on remote server&lt;/a&gt; -- or the old-school method of simply ssh'ing into the server and running Emacs in a terminal.&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-06-18T17:15:45.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13265" PostTypeId="2" ParentId="13249" CreationDate="2015-06-18T17:29:09.417" Score="3" Body="&lt;p&gt;First of all, are you really editing in &lt;code&gt;fundamental-mode&lt;/code&gt;?  If you're talking about a plain text file, are you sure you're not in &lt;code&gt;text-mode&lt;/code&gt;?  You can check with &lt;code&gt;M-: major-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, have a look at the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indentation.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual node on &quot;Indentation&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;tab&lt;/kbd&gt; runs &lt;code&gt;indent-for-tab-command&lt;/code&gt; in &lt;code&gt;fundamental-mode&lt;/code&gt;.  The first part of its docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Indent the current line or region, or insert a tab, as appropriate.&#xA;  This function either inserts a tab, or indents the current line,&#xA;  or performs symbol completion, depending on &lt;code&gt;tab-always-indent&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can control the tab stops via &lt;code&gt;tab-stop-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List of tab stop positions used by &lt;code&gt;tab-to-tab-stop&lt;/code&gt;.&#xA;  This should be a list of integers, ordered from smallest to largest.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you'd prefer all of your tabs to be converted to spaces, you can &lt;a href=&quot;http://www.emacswiki.org/emacs/NoTabs&quot; rel=&quot;nofollow noreferrer&quot;&gt;turn off &lt;code&gt;indent-tabs-mode&lt;/code&gt;&lt;/a&gt; with &lt;code&gt;(setq-default indent-tabs-mode nil)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you'd like to prevent &lt;kbd&gt;enter&lt;/kbd&gt; from &lt;a href=&quot;http://emacswiki.org/emacs/AutoIndentation&quot; rel=&quot;nofollow noreferrer&quot;&gt;auto-indenting&lt;/a&gt;, have a look at the threads for &lt;a href=&quot;https://emacs.stackexchange.com/questions/5939/how-to-disable-auto-indentation-of-new-lines&quot;&gt;How to disable auto-indentation of new lines?&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/questions/27718310/emacs-version-24-4-new-obnoxious-loss-of-indentation-on-hitting-return&quot;&gt;Emacs version 24.4: New obnoxious loss of indentation on hitting RETURN&lt;/a&gt;.  Short version: either turn off &lt;code&gt;electric-indent-mode&lt;/code&gt; or bind &lt;kbd&gt;enter&lt;/kbd&gt; to &lt;code&gt;newline&lt;/code&gt; rather than &lt;code&gt;newline-and-indent&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-18T17:29:09.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13266" PostTypeId="2" ParentId="13221" CreationDate="2015-06-18T17:57:51.147" Score="1" Body="&lt;p&gt;From what I understood reading your question, you're trying to use company to complete python code, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, python completion does not work out of the box with company. You need to install a python backend. The options I tried so far are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Jedi mode. This is the most popular and is implemented in many other editors as well&lt;/li&gt;&#xA;&lt;li&gt;Anaconda mode. This one is not so complete as Jedi, AFAIK, but it works great and it's simpler to install.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both packages are available in melpa, and don't forget to enable their modes after installing, otherwise the completion won't work. For more information check &lt;a href=&quot;https://github.com/proofit404/anaconda-mode&quot; rel=&quot;nofollow&quot;&gt;anaconda&lt;/a&gt; or &lt;a href=&quot;https://github.com/tkf/emacs-jedi&quot; rel=&quot;nofollow&quot;&gt;jedi&lt;/a&gt; github pages.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-06-18T17:57:51.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13269" PostTypeId="2" ParentId="13243" CreationDate="2015-06-18T23:26:11.790" Score="2" Body="&lt;p&gt;Here's how you can get the properties from the &quot;parent&quot; in a tree.  Does this help you with what you're trying to achieve?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;* foo  &#xA;  :PROPERTIES:&#xA;  :CATEGORY: awesome&#xA;  :END:&#xA;** bar &#xA;Run commands like these&#xA;#+BEGIN_SRC emacs-lisp&#xA;(org-set-property &quot;CATEGORY&quot;&#xA;          (save-excursion (org-up-heading-safe)&#xA;                  (org-entry-get (point) &quot;CATEGORY&quot;)))&#xA;#+END_SRC&#xA;*** baz &#xA;http://orgmode.org/manual/Using-the-property-API.html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8406" LastActivityDate="2015-06-18T23:26:11.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13270" PostTypeId="1" AcceptedAnswerId="13271" CreationDate="2015-06-19T01:07:40.600" Score="2" ViewCount="278" Body="&lt;p&gt;This is not urgent, but just wondering if an Emacs user could let me know which face I need to adjust to remove the faint gutters at the edge of my windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using GUI &lt;code&gt;GNU Emacs 25.0.50.1 X86_64-apple-darwin14.1.0&lt;/code&gt; (installed via Homebrew if that makes a difference) and using &lt;code&gt;molokai&lt;/code&gt; theme installed via &lt;code&gt;color-theme&lt;/code&gt; package&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9gL7F.png&quot; alt=&quot;These buffers here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="8618" LastEditorUserId="8618" LastEditDate="2015-06-20T00:13:28.667" LastActivityDate="2015-06-20T00:13:28.667" Title="What face do I need to adjust to remove the gutters at the edges of my windows?" Tags="|faces|themes|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13271" PostTypeId="2" ParentId="13270" CreationDate="2015-06-19T01:14:20.023" Score="3" Body="&lt;p&gt;The face is called...&lt;code&gt;fringe&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see all currently defined faces using &lt;code&gt;M-x list-faces-display&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So just &lt;code&gt;M-x customize-face fringe&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-19T01:14:20.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13272" PostTypeId="1" CreationDate="2015-06-19T02:01:55.613" Score="27" ViewCount="30578" Body="&lt;p&gt;I usually download Emacs for Windows from the official GNU site:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ftp.gnu.org/gnu/emacs/windows/&quot;&gt;http://ftp.gnu.org/gnu/emacs/windows/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latest version is: &lt;code&gt;emacs-24.5-bin-i686-mingw32.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm curious that why there's no 64-bit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Emacs manual:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html&quot;&gt;http://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;2.1 Where can I download Emacs?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Pre-compiled versions are distributed from ftp.gnu.org mirrors. Emacs&#xA;  binaries are distributed as zip files, digitally signed by the&#xA;  developer who built them. Generally most users will want the file&#xA;  &lt;code&gt;emacs-24.5-bin-i686-pc-mingw.zip&lt;/code&gt; for the &lt;strong&gt;32-bit&lt;/strong&gt; build, and&#xA;  &lt;code&gt;emacs-24.5-bin-x86_64-w64-mingw32.zip&lt;/code&gt; for the &lt;strong&gt;64-bit&lt;/strong&gt; build. The zip&#xA;  archive contains everything you need to get started.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The latest source is available from ftp.gnu.org mirrors. It is&#xA;  distributed as a compressed tar file, digitally signed by the&#xA;  maintainer who made the release.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The development version of Emacs is available from Savannah, the GNU&#xA;  development site.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since the manual said there's 64-bit, where is it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the response from the debugs.gnu.org:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20851&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20851&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The FAQ docs is obsolete. &lt;/li&gt;&#xA;&lt;li&gt;64-bit Emacs on Windows is built by volunteers, and there's no such volunteer currently.        &lt;/li&gt;&#xA;&lt;li&gt;They've removed the obsolete docs from the Emacs repo. Web pages get updated at next release.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="3872" LastEditDate="2015-06-22T23:37:13.653" LastActivityDate="2016-12-06T23:54:43.577" Title="Where is official 64-bit Emacs for Windows? (The manual said there is!)" Tags="|microsoft-windows|" AnswerCount="3" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="13273" PostTypeId="1" CreationDate="2015-06-19T07:31:06.263" Score="2" ViewCount="1178" Body="&lt;p&gt;I'd like to quickly go down the file hierarchy and select the following dir when there is only one to select.&#xA;There would be two way of doing this :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Stop showing the current and parent dir&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Select by default the first normal available file (preferred solution)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It there a way to configure that ?  &lt;/p&gt;&#xA;" OwnerUserId="8360" LastActivityDate="2015-06-19T16:19:50.590" Title="How can I quickly enter a directory in helm-find-file when there is only one to select?" Tags="|helm|helm-for-files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13274" PostTypeId="1" CreationDate="2015-06-19T08:19:00.560" Score="13" ViewCount="312" Body="&lt;p&gt;I work on some projects with indentation styles that I find really irritating.  I'd like to view the code with a certain indentation style, but always save to disk with the prescribed indentation style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically,  I like emacs default style of indentation on multi-line function arguments...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void foo(int a, int b,&#xA;         string c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the project is tab-only, single indent on everything... &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void foo(int a, int b,&#xA;    string c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I &lt;strong&gt;see&lt;/strong&gt; the first case, but share the second?&lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="5213" LastEditDate="2016-03-16T16:42:38.023" LastActivityDate="2016-03-17T03:16:51.577" Title="View code with different indentation than saved to disk" Tags="|indentation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13275" PostTypeId="2" ParentId="12532" CreationDate="2015-06-19T08:48:25.343" Score="5" Body="&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-with-local-idle-timer (secs repeat function &amp;amp;rest args)&#xA;  &quot;Like `run-with-idle-timer', but always runs in the `current-buffer'.&#xA;&#xA;Cancels itself, if this buffer was killed.&quot;&#xA;  (let* (;; Chicken and egg problem.&#xA;         (fns (make-symbol &quot;local-idle-timer&quot;))&#xA;         (timer (apply 'run-with-idle-timer secs repeat fns args))&#xA;         (fn `(lambda (&amp;amp;rest args)&#xA;                (if (not (buffer-live-p ,(current-buffer)))&#xA;                    (cancel-timer ,timer)&#xA;                  (with-current-buffer ,(current-buffer)&#xA;                    (apply (function ,function) args))))))&#xA;    (fset fns fn)&#xA;    fn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-06-19T08:48:25.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13276" PostTypeId="1" AcceptedAnswerId="13342" CreationDate="2015-06-19T09:38:04.223" Score="3" ViewCount="465" Body="&lt;p&gt;Here's a code that works for setting a string foreground:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defface test-face&#xA;  '((t (:height 1.2 :foreground &quot;green&quot;)))&#xA;  &quot;doc.&quot;)&#xA;(setq asdf (propertize &quot;asdf&quot; 'face 'test-face))&#xA;(add-face-text-property 0 (length asdf) '(:foreground &quot;red&quot;) nil asdf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;asdf&lt;/code&gt; will still have the height 1.2 through &lt;code&gt;test-face&lt;/code&gt; while gaining a red foreground, instead of green.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-face-text-property 0 (length asdf) '(:height 1.0) nil asdf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While the text properties will change, when inserting &lt;code&gt;asdf&lt;/code&gt; into a fundamental-mode buffer, it will still have the height 1.2.  How can I set the height to &lt;code&gt;1.0&lt;/code&gt;, while preserving the face?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="50" LastEditDate="2015-06-19T15:45:18.070" LastActivityDate="2015-06-22T15:40:15.370" Title="How to modify string height while keeping the face?" Tags="|faces|text-properties|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13277" PostTypeId="2" ParentId="13274" CreationDate="2015-06-19T12:28:23.910" Score="1" Body="&lt;p&gt;An obvious approach to this would be to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;indent a copy of the buffer using &lt;code&gt;c-mode&lt;/code&gt;; and then&lt;/li&gt;&#xA;&lt;li&gt;put the copy's indent as display properties on the indentation space in the original buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note 1: Implementing this while keeping the ability to edit the buffer could be a nightmare, so I'd make the buffer read-only.&lt;br&gt;&#xA;Note 2: Text properties are much faster than overlays, so I'd use them.  Unless in the odd case where the original buffer's indent is 0 and &lt;code&gt;c-mode&lt;/code&gt;'s is not.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-06-19T12:28:23.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13278" PostTypeId="1" CreationDate="2015-06-19T15:17:41.623" Score="6" ViewCount="449" Body="&lt;p&gt;I have been successfully using &lt;code&gt;M-x woman&lt;/code&gt; to access the linux &lt;code&gt;man&lt;/code&gt; pages.&lt;/p&gt;&#xA;&lt;p&gt;But when I tried to read the &lt;code&gt;tmux&lt;/code&gt; manpage using &lt;code&gt;woman&lt;/code&gt;, it did not work.&#xA;But &lt;code&gt;M-: (man &amp;quot;tmux&amp;quot;)&lt;/code&gt; works.&lt;/p&gt;&#xA;&lt;p&gt;Using &lt;code&gt;woman&lt;/code&gt; to access &lt;code&gt;tmux&lt;/code&gt; man page gave me this error&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;WoMan formatting buffer...&lt;/p&gt;&#xA;&lt;p&gt;woman-decode-region: WoMan can only format man pages written with the usual `-man' macros&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;and the man page shows up without any formatting as below:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;.Dd $Mdocdate: March 25 2013 $&#xA;.Dt TMUX 1&#xA;.Os&#xA;.Sh NAME&#xA;.Nm tmux&#xA;.Nd terminal multiplexer&#xA;.Sh SYNOPSIS&#xA;.Nm tmux&#xA;.Bk -words&#xA;.Op Fl 2CluvV&#xA;.Op Fl c Ar shell-command&#xA;.Op Fl f Ar file&#xA;.Op Fl L Ar socket-name&#xA;- snip -&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Later I learned that that's because the tmux man pages are generated using a &lt;a href=&quot;https://bitbucket.org/gdamore/less-fork/issue/4/use-mdoc-macros-for-manpages&quot; rel=&quot;nofollow noreferrer&quot;&gt;new &lt;code&gt;-mdoc&lt;/code&gt; macro&lt;/a&gt; instead of the &lt;code&gt;-man&lt;/code&gt; macro.&lt;/p&gt;&#xA;&lt;p&gt;Is there a way to read &lt;code&gt;-mdoc&lt;/code&gt; generated man pages using &lt;code&gt;woman&lt;/code&gt;? I prefer that vs doing &lt;code&gt;M-x man&lt;/code&gt; because the cache generation for &lt;code&gt;completing-read&lt;/code&gt; is much faster and accurate with &lt;code&gt;M-x woman&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;I am using the latest versions of tmux (2.1+) and emacs (25.0+) from the master branches of their gits.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-06-19T16:16:05.033" Title="How can I read -mdoc /-mandoc man pages using `M-x woman`?" Tags="|package|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13279" PostTypeId="1" CreationDate="2015-06-19T15:22:41.397" Score="11" ViewCount="430" Body="&lt;p&gt;(I apologize in advance for my general technical / emacs inexperience. I use &lt;code&gt;org-mode&lt;/code&gt; for writing novels, so have not delved very deep into its many options)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;visual-line-mode&lt;/code&gt; set as my default with the line &lt;code&gt;(global-visual-line-mode t)&lt;/code&gt; in my &lt;code&gt;~/.emacs&lt;/code&gt;. In the past, &lt;code&gt;ctrl-k&lt;/code&gt; (&lt;code&gt;kill-line&lt;/code&gt;) has killed the entire line in this mode, but on a recently reformatted computer, &lt;code&gt;ctrl-k&lt;/code&gt; is only killing to the screen edge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you suggest setting &lt;code&gt;ctrl-k&lt;/code&gt; to kill past the screen edge again?&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2023-01-23T13:48:54.963" Title="Ctrl-K Kill Line, Not Screen Edge in Visual Line Mode" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13280" PostTypeId="2" ParentId="13279" CreationDate="2015-06-19T15:58:27.813" Score="10" Body="&lt;p&gt;The cause of the behavior described by the original poster is the line of code from the variable &lt;code&gt;visual-line-mode-map&lt;/code&gt; within &lt;code&gt;simple.el&lt;/code&gt; that states:  &lt;code&gt;(define-key map [remap kill-line] 'kill-visual-line)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to reverse the process is simply removing the minor-mode key binding as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define-key visual-line-mode-map [remap kill-line] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-19T16:07:27.787" LastActivityDate="2015-06-19T16:07:27.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13281" PostTypeId="2" ParentId="13273" CreationDate="2015-06-19T16:19:50.590" Score="2" Body="&lt;p&gt;Yes, there's exactly this feature. You can hit &lt;code&gt;C-&amp;lt;backspace&amp;gt;&lt;/code&gt; to toggle it, or set the variable &lt;code&gt;helm-ff-auto-update-initial-value&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Auto update when only one candidate directory is matched.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Default value when starting ‘helm-find-files’ is nil because&#xA;  it prevent using  to delete char backward and by the way&#xA;  confuse beginners.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For a better experience with ‘helm-find-files’ set this to non--nil&#xA;  and use C- to toggle it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-06-19T16:19:50.590" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13282" PostTypeId="2" ParentId="13272" CreationDate="2015-06-19T16:35:03.043" Score="22" Body="&lt;p&gt;Courtesy of @Drew, here is a 64-bit Emacs for Windows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;noreferrer&quot;&gt;http://emacsbinw64.sourceforge.net/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a stable version, make sure download the &lt;strong&gt;Release&lt;/strong&gt;, not latest version. From my experience, the latest version is Emacs 25.x, and there's no &lt;code&gt;runemacs.exe&lt;/code&gt; in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Please note this is not the official GNU version.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of November 2016, the author has also made it available on Github: &lt;a href=&quot;https://github.com/zklhp/emacs-w64&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/zklhp/emacs-w64&lt;/a&gt;. The latest stable version is already 25.1&lt;/p&gt;&#xA;" OwnerUserId="3872" LastEditorUserId="7097" LastEditDate="2016-11-06T13:47:41.637" LastActivityDate="2016-11-06T13:47:41.637" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13283" PostTypeId="1" AcceptedAnswerId="13285" CreationDate="2015-06-19T17:55:50.383" Score="5" ViewCount="303" Body="&lt;p&gt;If you have a GPG-encrypted file, say &lt;code&gt;notes.org.gpg&lt;/code&gt;, emacs figures out that the major mode has to be set to &lt;code&gt;org-mode&lt;/code&gt;. This applies in general to any major mode out there; you do not need to modify the &lt;code&gt;auto-mode-alist&lt;/code&gt; for each major mode to support that &lt;code&gt;.gpg&lt;/code&gt; extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have my own extra extension, let's say &lt;code&gt;.~bkp~&lt;/code&gt; and have emacs ignore that when determining the major mode. Currently, if I have a file named &lt;code&gt;notes.org.~bkp~&lt;/code&gt;, the &lt;code&gt;org-mode&lt;/code&gt; is not set automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I scoured through &lt;code&gt;files.el&lt;/code&gt;, &lt;code&gt;epa*.el&lt;/code&gt;, googled but couldn't figure out how emacs is ignoring the &lt;code&gt;.gpg&lt;/code&gt; in the file names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What function can I probably advice or a variable can I tweak to support my custom appended extensions?&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-06-19T19:50:25.907" Title="How can I make emacs ignore part of the file name when deciding major mode?" Tags="|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13284" PostTypeId="1" CreationDate="2015-06-19T18:09:22.343" Score="0" ViewCount="101" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/4146/8406&quot;&gt;Parsing parentheses: smie vs syntax table&lt;/a&gt; gives one example of how to use &lt;code&gt;syntax-propertize-function&lt;/code&gt; but I wonder if someone could help me with another example.  I'm working with &lt;code&gt;clojure-mode&lt;/code&gt;.  Here's a recipe to reproduce the problem:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;;; load with emacs -Q -l clojure-init.el&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize nil)&#xA;(setq package-enable-at-startup nil)&#xA;(unless (assoc-default &quot;melpa&quot; package-archives)&#xA;  (add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;  (package-refresh-contents))&#xA;&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-install 'use-package))&#xA;&#xA;(setq use-package-verbose t)&#xA;(require 'use-package)&#xA;&#xA;(use-package clojure-mode&#xA;  :ensure t :defer t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;M-x clojure-mode RET&lt;/code&gt; and insert&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-clj prettyprint-override&quot;&gt;&lt;code&gt;([&quot;phonemes&quot; java.lang.String] [&quot;rhymingPair&quot; [Ljava.lang.String;])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll see that &lt;code&gt;backward-sexp&lt;/code&gt; / &lt;code&gt;forward-sexp&lt;/code&gt; breaks in the viscinity of the &lt;code&gt;[Ljava...&lt;/code&gt; and that the last few characters are understood as a comment.  More specifically, &lt;code&gt;[&quot;rhymingPair&quot; [Ljava.lang.String;]&lt;/code&gt; should be understood as one valid sexp.  &lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-06-20T09:50:24.303" Title="remove delimiter and comment typing from [Ljava.lang.String; in clojure-mode" Tags="|syntax-table|clojure|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13285" PostTypeId="2" ParentId="13283" CreationDate="2015-06-19T18:10:17.220" Score="5" Body="&lt;p&gt;The relevant entry in &lt;code&gt;auto-mode-alist&lt;/code&gt; is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ([...] (&quot;\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'&quot; nil epa-file) [...])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here is the documentation that describes what is going on:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;auto-mode-alist&lt;/code&gt; is a variable defined in &lt;code&gt;files.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This variable may be risky if used as a file-local variable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Alist of filename patterns vs corresponding major mode functions. Each element looks like &lt;code&gt;(REGEXP . FUNCTION)&lt;/code&gt; or &lt;code&gt;(REGEXP FUNCTION NON-NIL)&lt;/code&gt;. (NON-NIL stands for anything that is not nil; the value does not matter.) Visiting a file whose name matches &lt;code&gt;REGEXP&lt;/code&gt; specifies &lt;code&gt;FUNCTION&lt;/code&gt; as the mode function to use. &lt;code&gt;FUNCTION&lt;/code&gt; will be called, unless it is &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;If the element has the form &lt;code&gt;(REGEXP FUNCTION NON-NIL)&lt;/code&gt;, then after&#xA;  calling &lt;code&gt;FUNCTION&lt;/code&gt; (if it's not &lt;code&gt;nil&lt;/code&gt;), we delete the suffix that matched&#xA;  &lt;code&gt;REGEXP&lt;/code&gt; and search the list again for another match.&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The extensions whose &lt;code&gt;FUNCTION&lt;/code&gt; is &lt;code&gt;archive-mode&lt;/code&gt; should also appear in &lt;code&gt;auto-coding-alist&lt;/code&gt; with &lt;code&gt;no-conversion&lt;/code&gt; coding system.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See also &lt;code&gt;interpreter-mode-alist&lt;/code&gt;, which detects executable script modes based on the interpreters they specify to run, and &lt;code&gt;magic-mode-alist&lt;/code&gt;, which determines modes based on file contents.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So there you go!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.bkp\\(~[0-9_]+~\\)\\'&quot; nil backup-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-06-19T19:50:25.907" LastActivityDate="2015-06-19T19:50:25.907" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="13286" PostTypeId="1" AcceptedAnswerId="13290" CreationDate="2015-06-19T19:32:58.097" Score="26" ViewCount="8042" Body="&lt;p&gt;I often want to go to a newline while the company mode suggestion is showing. How can I set up company mode so only the tab key triggers a completion?&lt;/p&gt;&#xA;" OwnerUserId="58" LastEditorUserId="105" LastEditDate="2015-06-19T20:11:44.723" LastActivityDate="2017-06-29T16:02:01.060" Title="How can I stop the enter key from triggering a completion in company mode?" Tags="|key-bindings|completion|company-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13287" PostTypeId="1" AcceptedAnswerId="13288" CreationDate="2015-06-19T19:48:04.437" Score="5" ViewCount="654" Body="&lt;p&gt;At some point I remember encountering a command that generated a skeleton of a properly formatted emacs-lisp library as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; library.el --- summary&#xA;&#xA;;; Copyright ...&#xA;&#xA;;; Author:&#xA;;; Keywords:&#xA;&#xA;;; License&#xA;&#xA;;;; Commentary:&#xA;;; &#xA;&#xA;;;; Code:&#xA;&#xA;(provide 'library)&#xA;&#xA;;;; library.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After some searching I found &lt;code&gt;checkdoc&lt;/code&gt;, which prompts for summary, and commentary and code. Is that the only template generation for a new emacs lisp library builtin to emacs core? Are there any tempo or skeleton based templates for a new emacs lisp library builtin to Emacs core, or somewhere else with yasnippet? &lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2015-06-19T20:15:02.380" Title="What templates are available for generating an elisp library?" Tags="|yasnippet|libraries|skeleton|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13288" PostTypeId="2" ParentId="13287" CreationDate="2015-06-19T19:52:41.550" Score="6" Body="&lt;p&gt;Just remembered it was &lt;code&gt;auto-insert-mode&lt;/code&gt;. Make a new elisp file, run &lt;code&gt;M-x auto-insert&lt;/code&gt;, and it prompts for summary, author, inserts the license and everything.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2015-06-19T19:52:41.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13289" PostTypeId="2" ParentId="13287" CreationDate="2015-06-19T20:15:02.380" Score="0" Body="&lt;p&gt;I guess you found your answer.  But you might also want to look at library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/header2.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;header2.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't prompt you for anything. But it can automatically provide a customized file header for a new file. And it can automatically update the header (e.g. when you save the file).  Unlike the example you show, by default it does not insert any code - just comments.  But that too you can customize.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-19T20:15:02.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13290" PostTypeId="2" ParentId="13286" CreationDate="2015-06-19T20:27:08.483" Score="15" Body="&lt;p&gt;This is defined in &lt;code&gt;company-active-map&lt;/code&gt;. You can unbind the return key in that map:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key company-active-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note however that return and tab do different things when there are multiple candidates. Tab is bound to &lt;code&gt;company-complete-common&lt;/code&gt;, while return is bound to &lt;code&gt;company-complete-selection&lt;/code&gt;. If you unbind the return key then you won't be able to use &lt;code&gt;M-n&lt;/code&gt; and &lt;code&gt;M-p&lt;/code&gt; to pick a completion from the list. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to pick some other key to use for &lt;code&gt;company-complete-selection&lt;/code&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'company&#xA;  (define-key company-active-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) nil)&#xA;  (define-key company-active-map (kbd &quot;RET&quot;) nil)&#xA;  (define-key company-active-map (kbd &quot;C-SPC&quot;) #'company-complete-selection))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-06-19T20:58:05.373" LastActivityDate="2015-06-19T20:58:05.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13291" PostTypeId="1" AcceptedAnswerId="14575" CreationDate="2015-06-19T21:55:11.160" Score="8" ViewCount="2090" Body="&lt;p&gt;There's some weird stuff I encounter when running Emacs under KDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how it looks when I run it normally, via the &lt;code&gt;emacs&lt;/code&gt; command:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/p2ISa.png&quot; alt=&quot;normal emacs&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run it as a daemon, here's what I see:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/oNie0.png&quot; alt=&quot;emacsclient&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if I run &lt;code&gt;customize-face cursor&lt;/code&gt; in the emacsclient, here's what I see:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6ObKv.png&quot; alt=&quot;emacsclient customize face&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The face is changed outside customize. What could've changed it? How can I prevent it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to say that under Xfce I don't get anything of sorts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P. S. Apparently, &lt;code&gt;--no-init-file&lt;/code&gt; solves the problem. Here's &lt;a href=&quot;http://pastebin.com/mVfY7dMK&quot; rel=&quot;noreferrer&quot;&gt;my &lt;code&gt;.emacs&lt;/code&gt;&lt;/a&gt;. The rest of the files are located &lt;a href=&quot;https://github.com/art-solopov/emacsd&quot; rel=&quot;noreferrer&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P. P. S. &lt;a href=&quot;http://ftp.gnu.org/old-gnu/Manuals/emacs-lisp-intro/html_node/X11-Colors.html&quot; rel=&quot;noreferrer&quot;&gt;This recipe worked for me.&lt;/a&gt; In fact, it worked so well that even removing these lines from &lt;code&gt;~/.Xresources&lt;/code&gt; and restarting the PC didn't bring back the errors. I can set the cursor face with &lt;code&gt;customize-face&lt;/code&gt; and it'll start in the daemon keeping that setting. So that's nice.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="7117" LastEditDate="2015-08-09T19:09:06.150" LastActivityDate="2017-05-13T10:33:58.960" Title="Emacs cursor color is different in daemon and non-daemon modes" Tags="|emacsclient|linux|colors|cursor|x11|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13292" PostTypeId="1" AcceptedAnswerId="13308" CreationDate="2015-06-20T02:55:02.177" Score="11" ViewCount="5512" Body="&lt;p&gt;Is it possible to convert convert an &lt;code&gt;xls&lt;/code&gt; file into an &lt;code&gt;org&lt;/code&gt; table? I found &lt;a href=&quot;http://www.emacswiki.org/emacs/UnXls&quot;&gt;this article&lt;/a&gt; on the emacs wiki but wasn't able to get it to work.&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2015-06-26T02:11:39.200" Title="Converting an xls file to org-mode?" Tags="|org-mode|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13293" PostTypeId="1" CreationDate="2015-06-20T05:57:46.017" Score="6" ViewCount="64" Body="&lt;p&gt;I like to use the forward- and back-paragraph methods to jump around my source code.  I would like it to behave slightly differently though.  Consider the following comment block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// comment line one.&#xA;//&#xA;// comment line two.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to jump over the entire comment block, and not land in-between line and and two -- in other words, I'd like it to consider a contiguous comment block as a single paragraph.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone know how to do this?&lt;/p&gt;&#xA;" OwnerUserId="8576" LastActivityDate="2015-06-20T14:56:21.430" Title="forward paragraph -- ignore carriage return in comment" Tags="|navigation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13294" PostTypeId="1" AcceptedAnswerId="14431" CreationDate="2015-06-20T06:44:48.620" Score="2" ViewCount="93" Body="&lt;p&gt;Currently I have to press some modifier combo + letter to trigger ace jump with letter. This is obnoxiously time-consuming for a command I use all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to be able to just hold down a key (æ in my case) and press &quot;s&quot; (like I'd do shift-s to write capital S) to trigger ace-jump for s. And so on for the other letters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem is taking a general letter and triggering the command for that letter, I presume. (I could probably have come up with a hard-coded solution myself and will be hesitant to accept one as an answer.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. ace-jump tag missing.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2015-06-21T05:53:12.470" LastActivityDate="2015-08-03T23:15:47.807" Title="Hold button+[a-z] to immediately trigger ace-jump+[a-z]?" Tags="|key-bindings|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13295" PostTypeId="2" ParentId="13292" CreationDate="2015-06-20T06:46:43.447" Score="4" Body="&lt;p&gt;Here's what I do. Not ideal, but kind of works.&#xA;First, I use LibreOffice Calc to convert to CSV:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;localc --convert-to csv --headless filename&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I use pcsv.el (a CSV parser) to convert from CSV to Lisp, then insert the result as an Org mode table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yf/lisp-table-to-org-table (table &amp;amp;optional function)&#xA;  &quot;Convert a lisp table to `org-mode' syntax, applying FUNCTION to each of its elements.&#xA;The elements should not have any more newlines in them after&#xA;applying FUNCTION ; the default converts them to spaces. Return&#xA;value is a string containg the unaligned `org-mode' table.&quot;&#xA;  (unless (functionp function)&#xA;    (setq function (lambda (x) (replace-regexp-in-string &quot;\n&quot; &quot; &quot; x))))&#xA;  (mapconcat (lambda (x)                ; x is a line.&#xA;               (concat &quot;| &quot; (mapconcat function x &quot; | &quot;) &quot; |&quot;))&#xA;             table &quot;\n&quot;))&#xA;(defun yf/csv-to-table (beg end &amp;amp;optional separator)&#xA;  &quot;Convert from BEG to END (a region in csv format) to an&#xA;`org-mode' table.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (region-beginning)&#xA;    (region-end)&#xA;    (when current-prefix-arg&#xA;      (string-to-char (read-from-minibuffer &quot;Separator? &quot;)))))&#xA;  (require 'pcsv)&#xA;  (insert&#xA;   (yf/lisp-table-to-org-table&#xA;    (let&#xA;        ((pcsv-separator (or separator pcsv-separator)))&#xA;      (pcsv-parse-region beg end))))&#xA;  (delete-region beg end)&#xA;  (org-table-align))&#xA;(defun yf/insert-csv-as-table (filename &amp;amp;optional separator)&#xA;  &quot;Insert a csv file as a org-mode table.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (read-file-name &quot;CSV file: &quot;)&#xA;    (when current-prefix-arg&#xA;      (string-to-char&#xA;       (read-from-minibuffer &quot;Separator? &quot;)))))&#xA;  (yf/csv-to-table (point)&#xA;                   (progn (forward-char&#xA;                           (cadr (insert-file-contents filename)))&#xA;                          (point))&#xA;                   separator))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's a bit longish due to how I factored the functions. What we need here is &lt;code&gt;yf/insert-csv-as-table&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-06-20T06:46:43.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13296" PostTypeId="1" AcceptedAnswerId="13305" CreationDate="2015-06-20T07:23:58.877" Score="3" ViewCount="508" Body="&lt;p&gt;I used a theme in emacs 24, but recently, the background color just filled area where characters are instead of the buffer completely. Even though I killed the orignal ~/.emacs, and used command like customize-* to change the theme to another one, it's not improved. &lt;img src=&quot;https://i.stack.imgur.com/LTDN9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later, I added &quot;Emacs.background:#303030&quot; to ~/.Xdefaults and start it with &quot;emacs -Q&quot; to try to solve the problem, but it didn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Version Info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;GNU Emacs 24.3.1&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;gtk 3.10.8~8+qiana&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Distro: Linux Mint 17.1&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8644" LastActivityDate="2017-01-31T19:27:32.123" Title="The background color can't fill the buffer completely" Tags="|window|themes|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13297" PostTypeId="1" CreationDate="2015-06-20T08:21:00.203" Score="12" ViewCount="560" Body="&lt;p&gt;I have the following problem : when i use 'C-x r t' (string-rectangle), i am prompted to enter some string, to replace the selected rectangle. Lets say i type &quot;;;&quot; (to comment out the rectangle). This works just fine, but the next time i call the same function, and i want to replace with nothing (empty string), i can not do that, because there is &quot;default&quot; string &quot;;;&quot; that i previously used, and if i just hit enter the command will use that &quot;;;&quot; string instead of empty one. How do i set it to empty string ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar problem i had with some search/replace functions. Basicaly, when it remembers the last string i used, and sets it to default, how do i &quot;enter&quot; empty string instead ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kill-rectangle, mentioned by YoungFrog solves the specific problem, but i had another thing in mind : basicaly, in what ever function emacs remembers the last value you entered, and uses it as &quot;default&quot; when you just hit enter, you should be able to clear that &quot;default&quot; to whatever was real default before you first used the function. Here is another example : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In dired mode, if you 'M-x rgrep' it asks you for 3 inputs :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) What to search for : whatever you enter here, will be used as default next time you use rgrep. As someone pointed out, it makes no sense to search for empty string, so clearing this &quot;default&quot; value is indeed never needed i guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Next it will ask in what files to search for. It's real default is &quot;all&quot; files. If i enter *.txt, and search, next time when i use rgrep, *.txt will be used as &quot;default&quot;. Now i wish to clear this &quot;default&quot; *.txt, and return to its original default, &quot;all&quot;, just as i wanted to clear &quot;;;&quot; &quot;default&quot; in string-rectangle function to it's real default, empty string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this specific problem for all files could probably be solved with typing * ? But this general problem potentialy remains with other commands that remember last used value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) It will next ask for Base directory, no problem here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the way i see it, whenever emacs tries to help me by remembering my last used value in some command (which i find very helpful most of the time) there should be a way to clear that used value as if i never used that command before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I am still new to emacs, and perhaps the functionality i require is not needed, as there is always some workaround ?&lt;/p&gt;&#xA;" OwnerUserId="8645" LastEditorUserId="8645" LastEditDate="2015-06-20T22:19:32.847" LastActivityDate="2015-11-18T19:16:38.833" Title="How do i get rid of &quot;default&quot; (last used) string in some emacs functions?" Tags="|string|rectangle|default|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13298" PostTypeId="2" ParentId="13284" CreationDate="2015-06-20T09:50:24.303" Score="2" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun clojure-syntax-propertize-array-class (beg end)&#xA;  &quot;Put word `syntax-table' property on \&quot;[Lfoo.Bar;\&quot;.&quot;&#xA;  (let ((word-syntax (string-to-syntax &quot;w&quot;)))&#xA;    (put-text-property&#xA;     beg end 'syntax-table nil)&#xA;    (save-excursion&#xA;      (goto-char beg)&#xA;      (while (re-search-forward&#xA;              (rx (and (group ?\[)&#xA;                       ?L&#xA;                       (* (or (syntax ?w) ?.))&#xA;                       (group ?\;)))&#xA;              end t)&#xA;        (dotimes (i 2)&#xA;          (put-text-property&#xA;           (match-beginning (1+ i))&#xA;           (match-end (1+ i))&#xA;           'syntax-table word-syntax))))))&#xA;&#xA;(define-minor-mode clojure-weird-syntax-mode&#xA;  nil nil nil nil&#xA;  (cond&#xA;   (clojure-weird-syntax-mode&#xA;    (jit-lock-register 'clojure-syntax-propertize-array-class)&#xA;    (setq-local parse-sexp-lookup-properties t))&#xA;   (clojure-weird-syntax-mode&#xA;    (jit-lock-unregister 'clojure-syntax-propertize-array-class)&#xA;    (kill-local-variable 'parse-sexp-lookup-properties))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-06-20T09:50:24.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13299" PostTypeId="2" ParentId="13292" CreationDate="2015-06-20T10:00:25.000" Score="6" Body="&lt;p&gt;Since you are using Excel, you might as well be interested in other tools to work with statistical data. Here's how you could use R programming language to import an XSL file into Emacs Org mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Import XLS File Using R&#xA;  Install =gdata= package (you need to only run it once unles you already&#xA;  have this package installed).  The code below is meant to get you started&#xA;  with just this file and nothing else, but generally, you'd simply run&#xA;  =install.packages(&quot;gdata&quot;)= from ESS session to install the package.&#xA;  The reason you can't do it here is that by default =install.packages= will&#xA;  try to install into location found in =.libPaths()=, which is likely to&#xA;  require super-user permissions.&#xA;&#xA;  #+begin_src R :var tmpdir=&quot;/tmp&quot;&#xA;    firstpath &amp;lt;- .libPaths()[1]&#xA;    .libPaths(c(firstpath, tmpdir))&#xA;    install.packages(&quot;gdata&quot;, lib = tmpdir, repos = &quot;http://cran.rstudio.com/&quot;)&#xA;    library(gdata)&#xA;    read.xls(&quot;example.xls&quot;)&#xA;  #+end_src&#xA;&#xA;  #+RESULTS:&#xA;  |         | Created with Microsoft Excel 2003 SP1 |&#xA;  |       X |                                     Y |&#xA;  | 0.42491 |                               0.15039 |&#xA;  | 0.03927 |                               0.54603 |&#xA;  |    some |                     rows were skipped |&#xA;  | 0.72372 |                               0.78759 |&#xA;  | 0.73772 |                               0.97298 |&#xA;  | 0.35374 |                               0.38789 |&#xA;&#xA;  Or, open the ESS session by executing =M-x R=, then type into the&#xA;  R console (your input starts with `&amp;gt;' symbol, you don't need to type the&#xA;  symbol itself).  Answer the prompts by typing `y' or `n'.&#xA;&#xA;  #+begin_example&#xA;  &amp;gt; install.packages(&quot;gdata&quot;)&#xA;  Installing package into ‘/usr/lib64/R/library’&#xA;  (as ‘lib’ is unspecified)&#xA;  Warning in install.packages(&quot;gdata&quot;) :&#xA;  'lib = &quot;/usr/lib64/R/library&quot;' is not writable&#xA;  Would you like to use a personal library instead?  (y/n) y&#xA;  Would you like to create a personal library&#xA;  ~/R/x86_64-redhat-linux-gnu-library/3.2&#xA;  to install packages into?  (y/n) y&#xA;  --- Please select a CRAN mirror for use in this session ---&#xA;  &amp;lt;install log skipped&amp;gt;&#xA;  ,** building package indices&#xA;  ,** installing vignettes&#xA;  ,** testing if installed package can be loaded&#xA;  ,* DONE (gdata)&#xA;&#xA;  The downloaded source packages are in&#xA;  ‘/tmp/RtmpMiDPfR/downloaded_packages’&#xA;  #+end_example&#xA;&#xA;  Load the XLS file and output an Org table:&#xA;&#xA;  #+begin_src R&#xA;    library(gdata)&#xA;    read.xls(&quot;example.xls&quot;)&#xA;  #+end_src&#xA;&#xA;  #+RESULTS:&#xA;  |         | Created with Microsoft Excel 2003 SP1 |&#xA;  |       X |                                     Y |&#xA;  | 0.42491 |                               0.15039 |&#xA;  | 0.03927 |                               0.54603 |&#xA;  |    some |                     rows were skipped |&#xA;  | 0.72372 |                               0.78759 |&#xA;  | 0.73772 |                               0.97298 |&#xA;  | 0.35374 |                               0.38789 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the example XLS file I used &lt;a href=&quot;http://berkeleycollege.edu/browser_check/samples/excel.xls&quot; rel=&quot;noreferrer&quot;&gt;http://berkeleycollege.edu/browser_check/samples/excel.xls&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to install ESS package to interact with R from Emacs, as well as R language itself.  Look here: &lt;a href=&quot;http://ess.r-project.org/Manual/ess.html#Installation&quot; rel=&quot;noreferrer&quot;&gt;http://ess.r-project.org/Manual/ess.html#Installation&lt;/a&gt; for instructions (or just do &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;package-install&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;ESS&lt;/code&gt;). You will need to enable R in Org Babel code blocks by adding this to your Emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA;  'org-babel-load-languages '((R . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to install R look here: &lt;a href=&quot;http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installation&quot; rel=&quot;noreferrer&quot;&gt;http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Installation&lt;/a&gt;, but these instructions are meant for those who want to build the language on their own. You could typically install it on Linux using your package manager, eg. &lt;code&gt;apt-get install R&lt;/code&gt; or &lt;code&gt;yum install R&lt;/code&gt; etc. There are also binaries for other platforms, for example: MS Windows binaries can be found here: &lt;a href=&quot;http://cran.r-project.org/bin/windows/base/&quot; rel=&quot;noreferrer&quot;&gt;http://cran.r-project.org/bin/windows/base/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-06-20T10:00:25.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13300" PostTypeId="2" ParentId="12126" CreationDate="2015-06-20T10:14:05.730" Score="3" Body="&lt;p&gt;Take a look at the docs for &lt;code&gt;syntax-propertize-function&lt;/code&gt; also. That's used for scanning a buffer and applying syntax categories programmatically, rather than using the syntax table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/25245469/how-to-define-whole-line-comment-syntax-in-emacs&quot;&gt;This Stack Overflow answer&lt;/a&gt; has a couple examples.&lt;/p&gt;&#xA;" OwnerUserId="8646" LastActivityDate="2015-06-20T10:14:05.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13302" PostTypeId="2" ParentId="13297" CreationDate="2015-06-20T13:13:35.830" Score="5" Body="&lt;p&gt;Don't use &lt;code&gt;C-x r t&lt;/code&gt; (&lt;code&gt;string-rectangle&lt;/code&gt;), use &lt;code&gt;C-x r k&lt;/code&gt; (&lt;code&gt;kill-rectangle&lt;/code&gt;) instead.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-06-20T13:13:35.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13303" PostTypeId="2" ParentId="13296" CreationDate="2015-06-20T14:19:13.660" Score="1" Body="&lt;p&gt;You should remove your .Xdefaults settings for emacs and just put this in your init&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-background 'default &quot;#303030&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-06-20T14:19:13.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13304" PostTypeId="1" AcceptedAnswerId="13307" CreationDate="2015-06-20T14:19:41.343" Score="6" ViewCount="807" Body="&lt;p&gt;How can I narrow a buffer to the python class at point?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;narrow-to-region&lt;/code&gt; works but requires first selecting the class as a region, and it seems &lt;code&gt;python-mode&lt;/code&gt; has moved on since this was written:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blogs.fluidinfo.com/terry/2011/01/28/py-narrow-to-class/&quot;&gt;http://blogs.fluidinfo.com/terry/2011/01/28/py-narrow-to-class/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2017-02-08T19:46:24.280" Title="How to narrow to python class?" Tags="|python|narrowing|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13305" PostTypeId="2" ParentId="13296" CreationDate="2015-06-20T14:50:05.853" Score="1" Body="&lt;p&gt;@JordonBiondo provided the answer.  Here are some alternative, related ways to do the same thing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize face &lt;code&gt;default&lt;/code&gt;, to set its foreground to that color.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize option &lt;code&gt;default-frame-alist&lt;/code&gt;, to set its &lt;code&gt;background-color&lt;/code&gt; to that color.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These all do the same thing. Face &lt;code&gt;default&lt;/code&gt; correponds to the default settings for frame parameters &lt;code&gt;foreground-color&lt;/code&gt; and &lt;code&gt;background-color&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Customize has the advantage that it type-checks things, preventing simple typo mistakes and other, more important mistakes.  And more generally (not in this case, however), it manages things like initialization and updating triggers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using simple assignment code in your init file does not handle these things (but it is often sufficient).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do use Customize (which you can do interactively, with the Customize UI, or from your init file, using &lt;code&gt;customize-set-variable&lt;/code&gt; etc.) then I recommend that you define option &lt;code&gt;custom-file&lt;/code&gt;, so Customize uses a separate file and doesn't mess with your init file.  Just load &lt;code&gt;custom-file&lt;/code&gt; from your init file.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-20T14:50:05.853" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13306" PostTypeId="2" ParentId="13293" CreationDate="2015-06-20T14:56:21.430" Score="2" Body="&lt;p&gt;If what you want to do is skip forward over all of a set of contiguous comments then &lt;code&gt;M-: (forward-comment (buffer-size))&lt;/code&gt; should do more or less what you request. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course wrap that sexp to define a command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-fwd-comment ()&#xA; (interactive)&#xA; (forward-comment (buffer-size)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Motion-via-Parsing.html&quot; rel=&quot;nofollow&quot;&gt;Motion via Parsing&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-20T14:56:21.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13307" PostTypeId="2" ParentId="13304" CreationDate="2015-06-20T15:02:05.397" Score="6" Body="&lt;p&gt;Move the cursor the the top of the class and use &lt;code&gt;narrow-to-defun&lt;/code&gt;.  You can reach the top of the class by using &lt;code&gt;python-nav-backward-up-list&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-06-20T15:02:05.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13308" PostTypeId="2" ParentId="13292" CreationDate="2015-06-20T15:06:38.450" Score="7" Body="&lt;p&gt;Save the file as a tab delimited file (using Excel or the &lt;code&gt;localc&lt;/code&gt; command mentioned in @YoungFrog's answer).  Then run &lt;code&gt;org-table-import&lt;/code&gt; at the point where you want the table inserted.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-06-20T15:06:38.450" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13309" PostTypeId="2" ParentId="13304" CreationDate="2015-06-20T16:26:01.853" Score="4" Body="&lt;p&gt;With erikstokes' answer, I was able to write this, which uses python.el to narrow to the outermost scope regardless of where point is in the class:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/python-narrow-to-outer-scope ()&#xA;    (interactive)&#xA;    (save-excursion&#xA;        (python-nav-beginning-of-block)&#xA;        (let ((last-point nil))&#xA;            (while (or (null last-point) (/= (point) last-point))&#xA;                (setq last-point (point))&#xA;                (python-nav-backward-up-list)))&#xA;        (forward-line)&#xA;        (narrow-to-defun)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or more specifically narrowing to the 'nearest' opening class definition (nearest moving up the hierarchy of class/def nesting from point):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/py-statement-opens-base (regexp)&#xA;(let ((orig (point))&#xA;        erg)&#xA;    (save-excursion&#xA;    (back-to-indentation)&#xA;    (python-nav-forward-statement)&#xA;    (python-nav-backward-statement)&#xA;    (when (and&#xA;            (&amp;lt;= (line-beginning-position) orig)(looking-back &quot;^[ \t]*&quot; (line-beginning-position))(looking-at regexp))&#xA;        (setq erg (point))))&#xA;    (when (called-interactively-p 'any) (message &quot;%s&quot; erg))&#xA;    erg))&#xA;&#xA;(defconst my/py-class-re &quot;[ \t]*\\_&amp;lt;\\(class\\)\\_&amp;gt;[ \n\t]&quot;&#xA;&quot;Matches the beginning of a class definition. &quot;)&#xA;&#xA;(defun my/py-statement-opens-class-p ()&#xA;&quot;Return `t' if the statement opens a functions or class definition, nil otherwise. &quot;&#xA;    (my/py-statement-opens-base my/py-class-re))&#xA;&#xA;(defun my/python-narrow-to-class ()&#xA;    (interactive)&#xA;    (save-excursion&#xA;        (python-nav-beginning-of-block)&#xA;        (while (not (my/py-statement-opens-class-p))&#xA;            (python-nav-backward-up-list))&#xA;        (forward-line)&#xA;        (narrow-to-defun)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2017-02-08T19:46:24.280" LastActivityDate="2017-02-08T19:46:24.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13310" PostTypeId="2" ParentId="13304" CreationDate="2015-06-20T19:28:12.867" Score="1" Body="&lt;pre&gt;&lt;code&gt;   (defun py-narrow-to-class ()&#xA;      &quot;Make text outside current class invisible. &quot;&#xA;      (interactive)&#xA;      (save-excursion&#xA;        (let ((start (if (py--statement-opens-class-p)&#xA;                         (point)&#xA;                       (py-beginning-of-class))))&#xA;          (py-end-of-class)&#xA;          (narrow-to-region (point) start))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Meanwhile narrowing of basic forms like this --or block, statement etc.-- is implemented in python-mode.el.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-06-22T09:59:16.697" LastActivityDate="2015-06-22T09:59:16.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13311" PostTypeId="1" AcceptedAnswerId="17418" CreationDate="2015-06-20T21:00:33.103" Score="12" ViewCount="2497" Body="&lt;p&gt;Like many of us, I use org-mode for two different things:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;As a TODO list manager  &lt;/li&gt;&#xA;&lt;li&gt;As a text outliner  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'd like my blank lines to work differently based on context. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;TODO list: no blank lines&lt;/li&gt;&#xA;&lt;li&gt;text outline: automatically insert 1 blank line when non-heading text precedes a heading  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In other words, when I'm doing a TODO list when I have many headings in a row, I don't want stray line breaks between them.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TODO list mode, no line breaks:&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Organize Party [33%]&#xA; ** TODO Call people [1/2]&#xA; *** TODO Peter&#xA; *** DONE Sarah&#xA; ** TODO Buy food&#xA; ** DONE Talk to neighbor &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I'm writing text, I want line breaks for the sake of visual whitespace / ease of reading.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;outline mode, blank line before heading:&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading &#xA;This is a document that has a heading, and a body. The body will consist of two paragraphs with sub-headings.&#xA;&#xA;* Body  &#xA;This is an introduction to the body. The body has two sub-headings, each of which have their own paragraph.  &#xA;&#xA;** The First Paragraph  &#xA;This is the first of two paragraphs. &#xA;&#xA;** The Second Paragraph&#xA;This is the second of two paragraphs.  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've already set org-blank-before-new-entry to auto:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ((heading . auto)&#xA; (plain-list-item . auto))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I think org-blank-before-new-entry works by detecting other blank lines in the area. I want it to detect whether the preceding line of text is a heading or a non-heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I modify org-blank-before-new-entry so that when I'm in a TODO list consisting only of headings, &lt;code&gt;org-meta-return&lt;/code&gt; doesn't add a line break? but after a block of text, it does?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-06-22T17:45:25.830" LastActivityDate="2015-10-16T03:28:18.230" Title="make org-blank-before-new-entry distinguish between a TODO list and a text outline?" Tags="|org-mode|line-break|outline-mode|todo|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13312" PostTypeId="1" AcceptedAnswerId="13317" CreationDate="2015-06-20T21:14:28.557" Score="3" ViewCount="259" Body="&lt;p&gt;Is there a function (or some kind of prefix command) that will allow me to do an action to the &lt;strong&gt;next&lt;/strong&gt; word I type, not the word under point or the region? Currently:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;upcase-word&lt;/code&gt; puts the word under the point in uppercase&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-emphasize&lt;/code&gt; bolds or italicizes the word under point&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But when typing text, I often want to do this to the &lt;strong&gt;next&lt;/strong&gt; word I type, the one I haven't typed yet (using &lt;kbd&gt;SPC&lt;/KBD&gt; as the delimiter). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I want function I can call &lt;strong&gt;before&lt;/strong&gt; I enter a word that will place &lt;code&gt;*&lt;/code&gt; on either side of the next word I type, without my having to type the closing &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say my keybinding for bold-next-word is M-S-b.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample input:&lt;br&gt;&#xA;This is an &lt;KBD&gt;M-S-b&lt;/KBD&gt;important&lt;kbd&gt;SPC&lt;/kbd&gt;point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Desired output: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is an *important* point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-emphasize&lt;/code&gt; is my main use case, but it would be nice to be able to do this with upcase, downcase, etc. &lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="50" LastEditDate="2015-12-30T17:19:31.283" LastActivityDate="2015-12-30T17:19:31.283" Title="how to do action on *next* word?" Tags="|org-mode|text-editing|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13313" PostTypeId="2" ParentId="13312" CreationDate="2015-06-21T03:58:03.460" Score="1" Body="&lt;p&gt;It sounds like what you want is a way to type and have words you type be emboldened automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's easier to do after you enter the word, as soon as you hit a non-word char. On &lt;code&gt;post-command-hook&lt;/code&gt; you can check whether &lt;code&gt;(looking-back &quot;\w\W&quot;)&lt;/code&gt; (a word char followed by a non-word char), and if so, &lt;code&gt;save-excursion&lt;/code&gt;, &lt;code&gt;backward-word&lt;/code&gt;, insert a &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;forward-word&lt;/code&gt;, and insert another &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun embolden-last-word ()&#xA;  (interactive)&#xA;  (when (and (eq last-command 'self-insert-command)&#xA;             (looking-back &quot;\\w\\W&quot;)&#xA;             (not (eq (char-after) ?*)))&#xA;    (save-excursion&#xA;      (backward-word) (insert ?*) (forward-word) (insert ?*))))&#xA;&#xA;(add-hook 'post-command-hook 'embolden-last-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Be aware that this emboldens &lt;strong&gt;words&lt;/strong&gt;, since that's what you asked for.  For example, in a mode like &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, since &lt;code&gt;-&lt;/code&gt; is not a word-constituent character, you will get &lt;code&gt;*foo*-*bar*&lt;/code&gt; and not &lt;code&gt;*foo-bar*&lt;/code&gt;.  If you want the latter, then either make &lt;code&gt;-&lt;/code&gt; be a word constituent in your mode or use &lt;code&gt;symbol&lt;/code&gt; instead of &lt;code&gt;word&lt;/code&gt; in the code.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could of course bind a command to a key that toggles add/remove of &lt;code&gt;embolden-last-word&lt;/code&gt; from &lt;code&gt;post-command-hook&lt;/code&gt;, so you can quickly enable and disable emboldening.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode toggle-embolden-word&#xA;    &quot;Toggle making words you type bold.&quot;&#xA;  nil nil nil&#xA;  (if toggle-embolden-word&#xA;      (add-hook 'post-command-hook 'embolden-last-word)&#xA;    (remove-hook 'post-command-hook 'embolden-last-word)))&#xA;&#xA;(global-set-key &quot;\C-o&quot; 'toggle-embolden-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(And if you do that then you do not need to do the &lt;code&gt;(add-hook 'post-command-hook 'embolden-last-word)&lt;/code&gt; shown above. Just use the toggle key to turn it on/off.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-21T04:31:05.847" LastActivityDate="2015-06-21T04:31:05.847" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13314" PostTypeId="1" AcceptedAnswerId="13339" CreationDate="2015-06-21T12:35:19.030" Score="10" ViewCount="11401" Body="&lt;p&gt;&lt;strong&gt;Aim&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;PDF Tools&lt;/a&gt; installed on my GUI Emacs on MacOSX (version 25.0.50 installed via Homebrew on MacOSX 10.10.2) because the &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;README&lt;/a&gt; says it's possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed &lt;code&gt;poppler&lt;/code&gt; and exported the PKG_CONFIG_PATH variable to my shell as advised by the README.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then installed PDF Tools via MELPA and it installed a directory in my &lt;code&gt;.emacs.d/elpa&lt;/code&gt; directory named &lt;code&gt;~/.emacs.d/elpa/pdf-tools-20150620.1632&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I ran the &lt;code&gt;pdf-tools-install&lt;/code&gt; command I get the following errors about not being able to find the correct directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Need to build the server, do it now ? (y or n) y&#xA;&#xA;pdf-tools--melpa-build-server: No such directory: /Users/m/.emacs.d/elpa/pdf-tools-20150613.414/build&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I've tried&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I have tried re-installing the package with &lt;code&gt;package-reinstall&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I have searched for specific answers on EmacsWiki, this site, reddit.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8618" LastEditorUserId="8618" LastEditDate="2015-06-22T14:09:51.793" LastActivityDate="2023-08-25T18:57:37.537" Title="Install Pdf-Tools on Emacs MacOSX" Tags="|osx|pdf|" AnswerCount="9" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13315" PostTypeId="1" CreationDate="2015-06-21T13:57:08.753" Score="7" ViewCount="1538" Body="&lt;p&gt;Anyone know how to fix this? I'm connecting to Postgres, and when I use a command like &lt;code&gt;sql-send-paragraph&lt;/code&gt; to send a SQL query to the interactive &lt;code&gt;*SQL*&lt;/code&gt; buffer, the headers are not aligned right.  It's really hard to read.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example a multiline query like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;select a, b, c&#xA;from table1&#xA;where a = 1;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will give something like this in the &lt;code&gt;*SQL*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mydb=&amp;gt; mydb=&amp;gt; mydb-&amp;gt; mydb-&amp;gt; mydb-&amp;gt;     a     |      b       |   c&#xA;----------+--------------+-------&#xA;        1 | 2015-01-05   | 59120&#xA;        7 | 2015-01-06   | 59121&#xA;        3 | 2015-01-07   | 59122&#xA;(3 rows)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It needs to put an extra newline in there so the column headers are on  their own line.&lt;/p&gt;&#xA;" OwnerUserId="8651" LastActivityDate="2015-11-26T08:51:17.510" Title="sql-send-paragraph results in mis-aligned headers" Tags="|sql-interactive-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13316" PostTypeId="2" ParentId="13315" CreationDate="2015-06-21T14:35:41.313" Score="0" Body="&lt;p&gt;Maybe try one of these things?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize &lt;code&gt;sql-send-terminator&lt;/code&gt; with a &lt;code&gt;PAT&lt;/code&gt; that matches the terminator that gets sent and a &lt;code&gt;TERM&lt;/code&gt; that specifies the terminator to really use, which would include a newline char.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize &lt;code&gt;sql-product-alist&lt;/code&gt; to add a &lt;code&gt;:terminator&lt;/code&gt; for your platform that includes a newline char after the &lt;code&gt;;&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;(sql-set-product-feature sql-product :terminator MY-TERMINATOR)&lt;/code&gt;, where &lt;code&gt;MY-TERMINATOR&lt;/code&gt; is the terminator you really want to use, which presumably would end in a newline char.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Dunno - these are just guesses that occur to me by looking over the &lt;code&gt;sql.el&lt;/code&gt; code superficially. The point is that there see to already be means provided for specifying the actual terminator to send to the SQL shell/interaction.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-21T14:35:41.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13317" PostTypeId="2" ParentId="13312" CreationDate="2015-06-21T15:39:23.950" Score="1" Body="&lt;p&gt;Here's a very cheap way to accomplish the job for &quot;embolden next word.&quot;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Hello &lt;code&gt;M-s-b&lt;/code&gt; world &lt;code&gt;M-s-m&lt;/code&gt; → &lt;code&gt;Hello␣*world*.␣&lt;/code&gt;← point is here&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hello &lt;code&gt;M-s-b&lt;/code&gt; world &lt;code&gt;M-s-w&lt;/code&gt; → &lt;code&gt;Hello␣*world*␣&lt;/code&gt;← point is here&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;M-s-b&quot;) '(lambda () (interactive)&#xA;                 (just-one-space)&#xA;                 (insert &quot;**&quot;)&#xA;                 (backward-char 1)))&#xA;&#xA;(global-set-key (kbd &quot;M-s-w&quot;) '(lambda () (interactive)&#xA;                 (move-end-of-line nil)&#xA;                 (just-one-space)))&#xA;&#xA;(global-set-key (kbd &quot;M-s-m&quot;) '(lambda () (interactive)&#xA;                 (move-end-of-line nil)&#xA;                 (insert &quot;.&quot;)&#xA;                 (just-one-space)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's another solution, adjusting Drew's answer so that it applies to the next word.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode embolden-next-word&#xA;    &quot;Make the next word you type bold.&quot;&#xA;  nil &#xA;  :lighter &quot; EMBOLDEN&quot;&#xA;  :keymap (let ((map (make-sparse-keymap)))&#xA;            (define-key map (kbd &quot;SPC&quot;) (lambda ()&#xA;                      (interactive)&#xA;                      (save-excursion &#xA;                        (goto-char (get-register 'p))&#xA;                        (insert &quot;*&quot;))&#xA;                      (insert &quot;* &quot;)&#xA;                      (embolden-next-word -1)))&#xA;        (define-key map (kbd &quot;.&quot;) (lambda ()&#xA;                    (interactive)&#xA;                    (save-excursion &#xA;                      (goto-char (get-register 'p))&#xA;                      (insert &quot;*&quot;))&#xA;                    (insert &quot;*. &quot;)&#xA;                    (embolden-next-word -1)))&#xA;            map)&#xA;  (if embolden-next-word&#xA;      (set-register 'p (point))&#xA;    (set-register 'p nil)))&#xA;&#xA;(global-set-key &quot;\C-o&quot; 'embolden-next-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want a really generic solution, maybe the thing to do is define a macro that would allow you to generalise that minor mode so you can &lt;em&gt;foo&lt;/em&gt; next word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. As Drew indicates, it's easier to apply markup commands to words after you've already typed them.  For instance, here's a binding I use a lot:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;H-o&quot;) (lambda () (interactive) (upcase-word -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8406" LastActivityDate="2015-06-21T15:39:23.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13318" PostTypeId="1" AcceptedAnswerId="13327" CreationDate="2015-06-21T16:05:20.390" Score="6" ViewCount="1912" Body="&lt;p&gt;When I use &lt;code&gt;git checkout&lt;/code&gt; to change to a different state of a project with files open in emacs with different state, the files are not changed automatically. Instead on any modify attempt, emacs is asking to modify or revert etc the file. Typing r is opening current state of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a module to give auto change the open current buffer upon file change on isk with &lt;code&gt;git checkout&lt;/code&gt; s? &lt;/p&gt;&#xA;" OwnerUserId="8514" LastActivityDate="2015-06-22T03:09:12.620" Title="Auto refresh buffer upon git checkout" Tags="|git|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13319" PostTypeId="2" ParentId="12639" CreationDate="2015-06-21T16:13:39.380" Score="2" Body="&lt;p&gt;I fixed it by changing lines 177 and following from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (cadr revision))&#xA; ((assoc bit (car revision))&#xA;  (cdr (assoc bit (car revision))))&#xA; (t revision))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (cadr rev))&#xA; ((assoc bit (car rev))&#xA;  (cdr (assoc bit (car rev))))&#xA; (t rev))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8652" LastActivityDate="2015-06-21T16:13:39.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13320" PostTypeId="1" CreationDate="2015-06-21T16:36:41.927" Score="6" ViewCount="391" Body="&lt;p&gt;I'm trying to write a major-mode that highlights triple-quoted strings. Here's a minimal reproducible example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst demo-triple-quoted-string-regex&#xA;  (rx &quot;\&quot;\&quot;\&quot;&quot;&#xA;      ;; After the delimiter, we're a sequence of&#xA;      ;; non-backslashes or blackslashes paired with something.&#xA;      (*? (or (not (any &quot;\\&quot;))&#xA;              (seq &quot;\\&quot; anything)))&#xA;      &quot;\&quot;\&quot;\&quot;&quot;))&#xA;&#xA;(defun demo-stringify-triple-quote ()&#xA;  &quot;Put `syntax-table' property on triple-quoted strings.&quot;&#xA;  (let* ((string-literal (match-string 0))&#xA;         (string-start-pos (- (point) (length string-literal)))&#xA;         (string-end-pos (point)))&#xA;    (unless (nth 4 (syntax-ppss)) ;; not inside comment&#xA;      (put-text-property string-start-pos string-end-pos&#xA;                         'syntax-table (string-to-syntax &quot;|&quot;)))))&#xA;&#xA;(defconst demo-syntax-propertize-function&#xA;  (syntax-propertize-rules&#xA;   (demo-triple-quoted-string-regex&#xA;    (0 (ignore (demo-stringify-triple-quote))))))&#xA;&#xA;(define-derived-mode demo-mode prog-mode &quot;Demo&quot;&#xA;  &quot;Major mode showing stack overflow question.&quot;&#xA;  (set (make-local-variable 'font-lock-defaults) '(()))&#xA;  (set (make-local-variable 'syntax-propertize-function)&#xA;       demo-syntax-propertize-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this leads to really bizarre behaviour when modifying the buffer. Here's my buffer contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dodgy when we put a newline after babel&#xA;&#xA;&quot;&quot;&quot;&#xA;a&#xA;&quot;&#xA;babel&#xA;&#xA;&quot;&quot;&quot;&#xA;&#xA;x = 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x demo-mode&lt;/code&gt; gives correct highlighting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/oyJuL.png&quot; alt=&quot;demo-before&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but pressing enter suddenly gives this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VQElp.png&quot; alt=&quot;demo-after&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="115" LastEditDate="2015-06-23T21:16:23.710" LastActivityDate="2015-06-23T21:58:19.433" Title="Why does inserting a newline break highlighting with syntax-propertize-function?" Tags="|font-lock|syntax-highlighting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13322" PostTypeId="1" AcceptedAnswerId="13352" CreationDate="2015-06-21T22:28:56.907" Score="6" ViewCount="990" Body="&lt;p&gt;Is it possible to tangle &lt;code&gt;#+RESULTS:&lt;/code&gt; block? For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC rst :tangle ./test.txt :noweb yes&#xA;&amp;lt;&amp;lt;Tangle_Test&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :exports results :results output raw&#xA;print(&quot;Results&quot;)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: &#xA;Results&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I want to tangle &lt;code&gt;#+RESULTS:&lt;/code&gt; part, not the actual Python source code.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Following radebrecht's answer, here is a working example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC rst :tangle  ./test.txt :noweb yes&#xA;&amp;lt;&amp;lt;Tangle_Test&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :results output code :tangle no :results_switches &quot;:tangle no :noweb-ref Tangle_Test&quot;&#xA;print(&quot;Print Results&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you evaluate the code block (&lt;code&gt;C-c C-c&lt;/code&gt;), then the following &lt;code&gt;#+RESULTS&lt;/code&gt; block will be generated: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_SRC python :tangle no :noweb-ref Tangle_Test&#xA;Print Results&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can tangle the file (&lt;code&gt;org-babel-tangle&lt;/code&gt;) and the resulting &lt;code&gt;test.txt&lt;/code&gt; will contain &lt;code&gt;Print Results&lt;/code&gt; only.&lt;/p&gt;&#xA;" OwnerUserId="6807" LastEditorUserId="6807" LastEditDate="2015-06-22T19:18:51.993" LastActivityDate="2022-06-02T02:35:04.490" Title="Is it possible to tangle Results block?" Tags="|org-mode|org-babel|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13323" PostTypeId="1" AcceptedAnswerId="14193" CreationDate="2015-06-21T23:02:58.470" Score="1" ViewCount="674" Body="&lt;p&gt;I'm fairly new to emacs. I'm using OS X 10.10. I have been learning to use helm. I was interested in &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;its integration with surfraw&lt;/a&gt;. I installed surfraw from teh source tarball following the instructions at surfraw.alioth.debian.org. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I use helm-surfraw, I originally got a file not found error. Following &lt;a href=&quot;http://daemonforums.org/showthread.php?t=8813&quot; rel=&quot;nofollow noreferrer&quot;&gt;this discussion&lt;/a&gt;, I determined this was partly due to lack of a default browser.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed lynx as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo mkdir /usr/local/src&#xA;cd /usr/local/src&#xA;sudo curl -O http://lynx.isc.org/lynx2.8.7/lynx2.8.7.tar.gz&#xA;sudo tar -xzvf lynx2.8.7.tar.gz&#xA;cd lynx2-8-7&#xA;sudo ./configure --mandir=/usr/share/man&#xA;sudo make&#xA;sudo make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, I did the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ mkdir -p ~/.config/surfraw&#xA;$ echo &quot;SURFRAW_text_browser=/usr/local/bin/lynx&quot; &amp;gt;&amp;gt; ~/.config/surfraw/conf&#xA;$ echo &quot;SURFRAW_graphical=no&quot; &amp;gt;&amp;gt; ~/.config/surfraw/conf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The good news is that I can now run surfraw from the terminal. However, helm-surfraw still doesn't work. I'm not given any options for a search engine (see screenshot). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in helm-surfraw alternatives, but I'd also like to understand what I'm doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uWuEg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8654" LastEditorUserId="8654" LastEditDate="2015-06-22T22:29:02.920" LastActivityDate="2015-07-23T16:01:53.207" Title="problem using surfraw with helm" Tags="|helm|web-browser|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13325" PostTypeId="2" ParentId="13323" CreationDate="2015-06-21T23:52:45.737" Score="1" Body="&lt;p&gt;Since you asked for alternatives as well, here are some: try helm-google for general searches and sx or sos for stackexchange searches. sx uses native api. There are other specialized searches, such as helm-dash to search documentation for over 150 APIs. Search for &lt;em&gt;engine&lt;/em&gt; or &lt;em&gt;search&lt;/em&gt; to a list of packages on &lt;strong&gt;MELPA&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-21T23:52:45.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13326" PostTypeId="1" CreationDate="2015-06-22T02:31:30.987" Score="1" ViewCount="55" Body="&lt;p&gt;Im attempting to run a perl script on a buffer which will rearrange/edit the contents. I want to highlight a string and let that be my input as well as the buffer or file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I can come close. I know &lt;code&gt;C-x h M-| shell command&lt;/code&gt; will pass the buffer to STDIN which can be used. But it doesnt give me the ability to also pass a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to pass both?&lt;/p&gt;&#xA;" OwnerUserId="8655" LastActivityDate="2015-06-22T02:31:30.987" Title="How can I pass an argument (via highlighting) to a shell command while also passing the filename as an argument?" Tags="|shell-command|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13327" PostTypeId="2" ParentId="13318" CreationDate="2015-06-22T03:09:12.620" Score="7" Body="&lt;p&gt;Turn on &lt;code&gt;auto-revert-mode&lt;/code&gt;.  When active the buffer will be refreshed whenever the file changes on disk (because of a &lt;code&gt;git checkout&lt;/code&gt; for example) and you have no unsaved changes.  To activate it everywhere at once, add &lt;code&gt;(global-auto-revert-mode t)&lt;/code&gt; to you Emacs config.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-06-22T03:09:12.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13328" PostTypeId="1" AcceptedAnswerId="14121" CreationDate="2015-06-22T06:03:18.523" Score="10" ViewCount="2784" Body="&lt;p&gt;I have an org-mode file that contains a BASH script in an org-babel source block. I would like to pass environmental variable values to it through &lt;code&gt;:var&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;something like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :var VAR1=&amp;quot;~/foo&amp;quot;&#xA;  mkdir ${VAR1}/test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;or:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :var VAR1=&amp;quot;${MY_ENV_VAR}/foo&amp;quot;&#xA;  mkdir ${VAR1}/test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I run the blocks with &lt;code&gt;C-c C-c&lt;/code&gt;, they complain about not being able to find the &lt;code&gt;${VAR1}&lt;/code&gt; directory.&lt;/p&gt;&#xA;&lt;p&gt;I think &lt;code&gt;${VAR1}&lt;/code&gt; is not being expanded properly inside the bash shell.&lt;/p&gt;&#xA;&lt;p&gt;What's the right way to do it?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="38139" LastEditDate="2022-10-04T12:24:30.233" LastActivityDate="2022-10-04T12:24:30.233" Title="How to pass environment variables to org source BASH script block?" Tags="|org-mode|org-babel|bash|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="13329" PostTypeId="1" AcceptedAnswerId="13330" CreationDate="2015-06-22T06:19:21.513" Score="23" ViewCount="22239" Body="&lt;p&gt;I'm making yet another attempt to convert over to Emacs. I'm a decent Vi user but have been using Eclipse for most of my development work for the past 10+ years (has it been that long).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I did some reading up and thought that JDEE is the way to go -- have it configured but still have some basic questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, after doing some more research -- it seems JDEE may not be well maintained and perhaps all I need is CEDET?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So question:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Can Emacs serve as my Eclipse replacement? I organize my build using Maven?&lt;/li&gt;&#xA;&lt;li&gt;If &quot;1&quot; is yes that what suite of tools should I start with: CEDET? JDEE?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8656" LastEditorUserId="504" LastEditDate="2015-06-22T08:21:55.680" LastActivityDate="2018-06-02T09:46:00.503" Title="Suitability of Emacs as a Java development IDE" Tags="|java|ide|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13330" PostTypeId="2" ParentId="13329" CreationDate="2015-06-22T08:19:17.307" Score="20" Body="&lt;p&gt;I'm going to be conservative and say &lt;em&gt;no&lt;/em&gt;, Emacs is &lt;em&gt;not a drop-in replacement&lt;/em&gt; for Eclipse (especially not out of the box). However, that doesn't mean that it's not suitable for Java development.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are already familiar with Eclipse I suggest you have a look at &lt;a href=&quot;http://eclim.org/&quot;&gt;&lt;code&gt;eclim&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Eclim provides the ability to access Eclipse code editing features (code completion, searching, code validation, and &lt;a href=&quot;http://eclim.org/features.html&quot;&gt;&lt;em&gt;many more&lt;/em&gt;&lt;/a&gt;) via the command line or a local network connection, allowing those features to be integrated with your favorite editor.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Eclim &lt;a href=&quot;http://eclim.org/features.html#maven&quot;&gt;supports Maven&lt;/a&gt;. It integrates with Emacs via a package called &lt;a href=&quot;https://github.com/senny/emacs-eclim&quot;&gt;&lt;code&gt;emacs-eclim&lt;/code&gt;&lt;/a&gt;. Follow the steps outlined in the &lt;code&gt;emacs-eclim&lt;/code&gt; &lt;a href=&quot;https://github.com/senny/emacs-eclim#installation&quot;&gt;README&lt;/a&gt; to install it&lt;sup&gt;1&lt;/sup&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://eclim.org/install.html&quot;&gt;Download and install&lt;/a&gt; eclim.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Install &lt;code&gt;emacs-eclim&lt;/code&gt;:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;If you haven't already, add MELPA to &lt;code&gt;package-archives&lt;/code&gt;: &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Evaluate the code above (by pressing &lt;kbd&gt;C-x C-e&lt;/kbd&gt; with point positioned after the last closing paren) or restart Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;Install &lt;code&gt;emacs-eclim&lt;/code&gt; by doing &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;package-install&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;emacs-eclim&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;  &lt;/ul&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Add the following code to your init-file:&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'eclim)&#xA;(global-eclim-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;Instructions modified to include only a single installation method.&lt;/p&gt;&#xA;" OwnerUserId="504" LastEditorUserId="504" LastEditDate="2015-06-22T09:10:09.440" LastActivityDate="2015-06-22T09:10:09.440" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13331" PostTypeId="1" CreationDate="2015-06-22T12:12:05.887" Score="2" ViewCount="429" Body="&lt;p&gt;Using emacsw32.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual suggested way to make a selection using &lt;code&gt;S-down-mouse-1&lt;/code&gt; is to bind that to &lt;code&gt;mouse-save-then-kill&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar command which selects a region, but does not save the region?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to have the following scenario:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some text in the kill ring. I make a selection by holding shift and clicking the left mouse button. I delete the selection using &lt;code&gt;&amp;lt;delete&amp;gt;&lt;/code&gt;. Then I paste something (using &lt;code&gt;cua-paste&lt;/code&gt;) and this something is not the same as the region I just deleted.&lt;/p&gt;&#xA;" OwnerUserId="8662" LastEditorUserId="18121" LastEditDate="2019-01-15T23:48:12.210" LastActivityDate="2019-01-15T23:48:12.210" Title="Any way to select a region using `S-down-mouse-1` without saving the region as a kill?" Tags="|region|copy-paste|mouse|kill-ring|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="13332" PostTypeId="1" AcceptedAnswerId="13355" CreationDate="2015-06-22T12:52:27.377" Score="1" ViewCount="104" Body="&lt;p&gt;I'm currently working on a file that has a lot of duplicate lines splattered across the file and I'm trying to remove those duplicates. I tried using &lt;code&gt;replace-regexp&lt;/code&gt; with &lt;code&gt;\(.+^J\)\(\(.+^J\)+?\)\1+&lt;/code&gt; =&gt; &lt;code&gt;\1\2&lt;/code&gt; which is working okay. Then I realised that there'll be some lines not caught by that so I captured it in a macro. But now I'm stuck running that several times and not knowing if/when it'll ever be done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the feeling I should be able to use some sort of function to do this but I'm not entirely sure how. What should I be doing instead?&lt;/p&gt;&#xA;" OwnerUserId="8664" LastActivityDate="2015-06-22T20:17:25.330" Title="Running A regex replace infinite times" Tags="|regular-expressions|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13333" PostTypeId="2" ParentId="13332" CreationDate="2015-06-22T13:10:34.363" Score="1" Body="&lt;p&gt;You can run a macro endlessly till the first error occurs (like reaching the end of buffer) by passing it a &lt;code&gt;0&lt;/code&gt; prefix. Using the default keyboard macro binding, that would be &lt;code&gt;M-0 F4&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-06-22T13:10:34.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13334" PostTypeId="1" AcceptedAnswerId="13341" CreationDate="2015-06-22T13:41:18.903" Score="3" ViewCount="375" Body="&lt;p&gt;I used to be able to access Emacs registers with key sequence that were one item shorter. For example, I could jump to a point with &lt;code&gt;C-xj &amp;lt;register&amp;gt;&lt;/code&gt;. This shortcut key seems to be gone in newer Emacsen. I'm wondering why these shortcuts went away and if there's any reason not to add them back.&lt;/p&gt;&#xA;" OwnerUserId="8665" LastEditorUserId="8665" LastEditDate="2015-06-22T13:51:31.990" LastActivityDate="2015-06-22T14:26:54.103" Title="Using &quot;C-x /&quot; to access registers?" Tags="|key-bindings|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13335" PostTypeId="2" ParentId="13334" CreationDate="2015-06-22T13:56:01.567" Score="3" Body="&lt;p&gt;Doing a quick &lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ag&lt;/code&gt;&lt;/a&gt; (&lt;em&gt;like grep, but better&lt;/em&gt;) of the regular expression &lt;code&gt;'C-x\s*/'&lt;/code&gt; in the emacs lisp source code gives the below as one of the results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ChangeLog.12&#xA;1889:   C-x /, C-x j, C-x x, and C-x g (deprecated since Emacs 19).&#xA;18917:  item instead of &quot;C-x/C-c/C-v (CUA)&quot; if cua-enable-cua-keys is nil.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/ChangeLog.12#n1888&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ChangeLog.12&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2007-02-11  Kim F. Storm  &amp;lt;storm@cua.dk&amp;gt;&#xA;&#xA;    * bindings.el (ctl-x-map): Remove register compatibility bindings&#xA;    C-x /, C-x j, C-x x, and C-x g (deprecated since Emacs 19).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So looks like &lt;code&gt;C-x /&lt;/code&gt; is one of the bindings long deprecated. You can, though, always define your own bindings. Have a look at this Elisp Manual page on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Commands.html&quot; rel=&quot;nofollow&quot;&gt;How to set key bindings&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-06-22T14:04:02.750" LastActivityDate="2015-06-22T14:04:02.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13336" PostTypeId="1" AcceptedAnswerId="13337" CreationDate="2015-06-22T13:59:47.850" Score="5" ViewCount="2390" Body="&lt;p&gt;I have the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn 3 4)                ;; =&amp;gt; 4 &#xA;(list 1 (progn 3 4))       ;; =&amp;gt; (1 4) &#xA;(car (list 1 (progn 3 4))) ;; =&amp;gt; 1 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand these return values.  But why does the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cdr (list 1 (progn 3 4))  ;; =&amp;gt; (4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Return &lt;code&gt;(4)&lt;/code&gt; rather than &lt;code&gt;4&lt;/code&gt;?  I would have thought &lt;code&gt;4&lt;/code&gt;, so what am I misunderstanding here?&lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="253" LastEditDate="2015-07-28T14:48:58.947" LastActivityDate="2015-07-28T20:07:48.673" Title="why does cdr return a list of one element?" Tags="|elisp|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13337" PostTypeId="2" ParentId="13336" CreationDate="2015-06-22T14:04:48.907" Score="12" Body="&lt;p&gt;Here's the docstring for &lt;code&gt;cdr&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(cdr LIST)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return the cdr of LIST.  If arg is nil, return nil.&#xA;  Error if arg is not nil and not a cons cell.  See also `cdr-safe'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See Info node `(elisp)Cons Cells' for a discussion of related basic&#xA;  Lisp concepts such as cdr, car, cons cell and list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cdr&lt;/code&gt; returns the second slot of the &lt;code&gt;cons&lt;/code&gt; cell, which is referring to the rest of the list -- in your case, the rest of the list is one element long, but it's still a list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/List-Elements.html&quot;&gt;manual&lt;/a&gt; for more information on &lt;code&gt;cons&lt;/code&gt; cells.  In particular:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Function: cdr cons-cell&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function returns the value referred to by the second slot of the &#xA;  cons cell cons-cell. In other words, it returns the CDR of cons-cell.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;As a special case, if cons-cell is nil, this function returns nil; therefore, any list is a valid argument. An error is signaled if the argument is not a cons cell or nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cdr '(a b c))&#xA;     ⇒ (b c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-22T14:04:48.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13338" PostTypeId="2" ParentId="13336" CreationDate="2015-06-22T14:05:29.200" Score="6" Body="&lt;p&gt;When given a list &lt;code&gt;cdr&lt;/code&gt; returns a &lt;em&gt;list&lt;/em&gt; from second element to the end:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(car '(1 2 3)) ; ⇒ 1&#xA;(cdr '(1 2 3)) ; ⇒ (2 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exceptions to this include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;lists of fewer than two elements:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(cdr nil)  ; ⇒ nil&#xA;(cdr '(1)) ; ⇒ nil&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;things like &lt;code&gt;'(1 . 2)&lt;/code&gt; (which are produced with e.g. &lt;code&gt;(cons 1 2)&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(cdr '(1 . 2)) ; ⇒ 2&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-06-23T07:45:00.127" LastActivityDate="2015-06-23T07:45:00.127" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="13339" PostTypeId="2" ParentId="13314" CreationDate="2015-06-22T14:07:08.547" Score="4" Body="&lt;p&gt;&lt;strong&gt;It worked!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not 100% sure on the specifics as to what made it work. As commenters correctly point out, there was an issue with the packages/directories that were installed/compiled but it worked the next time I ran &lt;code&gt;pdf-tools-install&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Things I tried/did&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I started/re-started my &lt;code&gt;emacs --daemon&lt;/code&gt; server (ie turned on/off my computer)&lt;/li&gt;&#xA;&lt;li&gt;re-installed the pdf-tools package &lt;em&gt;again&lt;/em&gt; (I had tried this, yes)&lt;/li&gt;&#xA;&lt;li&gt;Installed CLISP via &lt;code&gt;homebrew&lt;/code&gt; (I have a suspicion this may have helped the script find the right directories because when I was running it via &lt;code&gt;pdf-tools-install&lt;/code&gt; it was asking for a directory where &lt;code&gt;autogen.sh&lt;/code&gt; was and I was pointing it to the &lt;code&gt;elpa/pdf-tools&lt;/code&gt; directory and had tried &lt;code&gt;/usr/local/Cask/...&lt;/code&gt; directories where homebrew installed Emacs. Maybe this helped it find the right ones?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Anyways, super happy now as can have my PDF's inside Emacs &lt;em&gt;and&lt;/em&gt; as an extra bonus it seems to render eww buffers much better too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best of luck to other OSX users getting it up and working. Please post if you pinpoint what helped you get it set up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you @politza!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Tw0oi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8618" LastActivityDate="2015-06-22T14:07:08.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13340" PostTypeId="1" AcceptedAnswerId="13441" CreationDate="2015-06-22T14:20:26.263" Score="3" ViewCount="658" Body="&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/strong&gt; This was initially posted &lt;a href=&quot;https://stackoverflow.com/q/29957437/1843248&quot;&gt;on StackOverflow&lt;/a&gt; a few months back and hasn't received an answer, but I'm reposting it since the Emacs StackExchange is now available.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm in the process of converting over from using Eclipse to Emacs 24.3 and Elpy 1.7.50 for my Python development.  However, I'm running into a roadblock in getting Elpy to recognize my project.  Based on my understanding of the way elpy should work from the &lt;a href=&quot;http://elpy.readthedocs.org/en/latest/introduction.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt;, if I set a project root folder, that folder should be included in the &lt;code&gt;sys.path&lt;/code&gt; to search for modules.  This is not happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://elpy.readthedocs.org/en/latest/introduction.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Elpy Documentation&lt;/a&gt; doesn't seem to have any answers to my particular conundrum, nor can I find a basic tutorial that walks me through creating my first Elpy project to break it down and show me what I'm doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the shell, I first create the virtual environment &lt;code&gt;virtualenv&lt;/code&gt; using&#xA;&lt;code&gt;mkvirtualenv&lt;/code&gt; from &lt;code&gt;virtualenvwrapper&lt;/code&gt;.  Then I create the following&#xA;folder/file structure within the virtualenv folder:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;virtualenv/&#xA;└─ my_project/&#xA;   ├─ src/&#xA;   │  └─ my_project/&#xA;   │     ├─ __init__.py&#xA;   │     └─ foo.py&#xA;   └─ test/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The contents of &lt;code&gt;foo.py&lt;/code&gt; are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class foo(object):&#xA;    pass&#xA;&#xA;&#xA;if __name__ == '__main__':&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, I connect to an already-running instance of Emacs server using the Emacs client. Within Emacs, I enter: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x pyvenv-workon virtualenv&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs does show &lt;code&gt;[my_project]&lt;/code&gt; in the mode line.  Next, I enter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x elpy-set-project-root ~/Projects/my_project/src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, I type &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-f&lt;/kbd&gt; to search the project for a file, and I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-f is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, I type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x elpy-find-file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No project root found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I create the file &lt;code&gt;test/test_foo.py&lt;/code&gt; with the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from my_project import foo&#xA;&#xA;if __name__ == '__main__':&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then run it using &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;  File &quot;/home/doug/Projects/my_project/src/test/test_foo.py&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;    from my_project import foo&#xA;ImportError: No module named 'my_project'&#xA;&amp;gt;&amp;gt;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8666" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-11-22T21:35:41.693" Title="Emacs 24 with Elpy 1.7.50 does not recognize Python Project" Tags="|python|ide|elpy|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13341" PostTypeId="2" ParentId="13334" CreationDate="2015-06-22T14:26:54.103" Score="1" Body="&lt;p&gt;Based on kaushalmodi's answer I was able to dig the following explanation up of why these keys were deprecated (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x a&#xA;C-x n&#xA;C-x r&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Three new prefix keys have been created &lt;strong&gt;to make many of the C-x commands more systematic&lt;/strong&gt;: C-x a, C-x n and C-x r. C-x a is used for abbreviation commands, C-x n for commands pertaining to narrowing, and C-x r for register and rectangle commands...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(&lt;a href=&quot;http://www.cumc.columbia.edu/computers/download/manuals/emacs/emacs_34.htm#SEC272&quot; rel=&quot;nofollow&quot;&gt;source&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="8665" LastActivityDate="2015-06-22T14:26:54.103" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13342" PostTypeId="2" ParentId="13276" CreationDate="2015-06-22T15:40:15.370" Score="1" Body="&lt;p&gt;Turns out the text height stacks the modifiers, so this works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(add-face-text-property&#xA; 0 (length asdf)&#xA; `(:height ,(/ 1 1.2)) nil asdf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-22T15:40:15.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13343" PostTypeId="1" AcceptedAnswerId="13346" CreationDate="2015-06-22T15:59:37.007" Score="2" ViewCount="752" Body="&lt;p&gt;Is there a straightforward way to make all text with a given face invisible? I don't believe I can make invisibility be intrinsic to the face, but can I perhaps specify a minor mode that makes sure all appropriate text is invisible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &quot;invisible&quot; here I mean the text works as if you'd set the invisible property, so the text in question doesn't even take up an horizontal space.&lt;/p&gt;&#xA;" OwnerUserId="8665" LastEditorUserId="8665" LastEditDate="2015-06-22T16:22:28.193" LastActivityDate="2015-06-23T13:27:52.073" Title="Make all text of a given face invisible" Tags="|faces|minor-mode|text-properties|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13344" PostTypeId="1" CreationDate="2015-06-22T16:05:29.120" Score="0" ViewCount="95" Body="&lt;p&gt;For some reason, variable-pitch fonts have stopped rendering correctly.  They previously worked fine, but something seems to have changed (though nothing in my .emacs has changed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using OS X 10.10.3 and Emacs installed thru homebrew.  From the startup screen:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is GNU Emacs 24.5.1 (x86_64-apple-darwin14.3.0, NS apple-appkit-1347.57).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Question: how do I fix this to make variable-pitch work again?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a couple pictures to explain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/saDXJ.png&quot; alt=&quot;Emacs startup screen&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs startup screen uses both fixed-width and variable-width fonts, and the ones that inherit from variable-pitch are rendered incorrectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/BBkZQ.png&quot; alt=&quot;Examples of several fixed- and variable-width fonts&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a &lt;a href=&quot;http://www.emacswiki.org/emacs/GoodFonts#toc15&quot; rel=&quot;nofollow noreferrer&quot;&gt;script on EmacsWiki&lt;/a&gt; to test several fonts at once.  Again, fixed-width fonts render correctly, but variable-width fonts do not.&lt;/p&gt;&#xA;" OwnerUserId="8668" LastEditorUserId="8668" LastEditDate="2015-06-22T17:11:55.557" LastActivityDate="2015-06-22T17:11:55.557" Title="Variable-pitch font has stopped rendering correctly" Tags="|fonts|customize|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13345" PostTypeId="1" AcceptedAnswerId="13347" CreationDate="2015-06-22T16:49:01.110" Score="0" ViewCount="195" Body="&lt;p&gt;I have a set of tests that involve loading files from the file-system and I would like to use the current filename to locate the test files relative to the test file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below code shows the pattern I am trying, but unfortunately when I run the test using &lt;code&gt;M-x ert&lt;/code&gt;, it fails with &lt;code&gt;(wrong-type-argument stringp nil)&lt;/code&gt;, because both the &lt;code&gt;load-file-name&lt;/code&gt; and &lt;code&gt;buffer-file-name&lt;/code&gt; are &lt;code&gt;nil&lt;/code&gt;. How should I approach this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest closing-braces ()&#xA;  (find-file (concat (file-name-directory&#xA;                       (or load-file-name buffer-file-name))&#xA;                     &quot;ClosingBrace.file&quot;))&#xA;  ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="753" LastActivityDate="2015-06-22T20:21:58.790" Title="How to get current file name when running under ERT?" Tags="|ert|testing|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13346" PostTypeId="2" ParentId="13343" CreationDate="2015-06-22T17:17:42.867" Score="4" Body="&lt;p&gt;OK, here's a simple demonstration of @Lindydancer's technique, which in this case turns the whole buffer invisible.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-mode () &quot;my-mode&quot; (interactive)&#xA;  (kill-all-local-variables)&#xA;  (make-local-variable 'font-lock-defaults)&#xA;  (setq font-lock-defaults  '(my-mode-font-lock-keywords t)))&#xA;&#xA;(defvar my-mode-font-lock-keywords nil &#xA;  &quot;Keywords/Regexp for fontlocking of my-mode&quot;)&#xA;&#xA;(setq my-mode-font-lock-keywords&#xA;      (list&#xA;       '(&quot;.*&quot; 0&#xA;         (progn (add-text-properties (match-beginning 0) &#xA;                                     (match-end 0) &#xA;                                     '(invisible t))&#xA;                'bold))))&#xA;&#xA;(add-to-list 'font-lock-extra-managed-props 'invisible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8665" LastEditorUserId="8665" LastEditDate="2015-06-23T13:27:52.073" LastActivityDate="2015-06-23T13:27:52.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13347" PostTypeId="2" ParentId="13345" CreationDate="2015-06-22T17:38:55.787" Score="3" Body="&lt;p&gt;A wild guess: put the file name in a &lt;code&gt;defvar&lt;/code&gt; or a &lt;code&gt;defconst&lt;/code&gt;, and use it in the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst my-test-location (file-name-directory (or load-file-name buffer-file-name)))&#xA;&#xA;(ert-deftest closing-braces ()&#xA;  (find-file (concat my-test-location &quot;ClosingBrace.file&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What you want is the value of &lt;code&gt;load-file-name&lt;/code&gt; or &lt;code&gt;buffer-file-name&lt;/code&gt; at compile/load time, but when you reference it within your function (&lt;code&gt;ert-deftest&lt;/code&gt; is a fancy version of &lt;code&gt;defun&lt;/code&gt;), you get the value at run time, which is not as useful. With &lt;code&gt;defvar&lt;/code&gt; or &lt;code&gt;defconst&lt;/code&gt;, you should be able to &quot;lock in&quot; the compile/load time value.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-06-22T17:38:55.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13348" PostTypeId="1" CreationDate="2015-06-22T17:53:50.937" Score="5" ViewCount="183" Body="&lt;p&gt;A programming language that I use lets me format comments and docstrings using markdown, and then export my code and documentation to PDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I edit the file, though, Emacs doesn't see comments as markdown; just as plain boring text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to access the full power of &lt;code&gt;markdown-mode&lt;/code&gt; when I edit comments, without giving up the nice features of my programming languages' major mode outside of comments. How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A similar problem would include using a Javadoc specific mode map and syntax highlighting inside of Javadoc comments, for example)&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-06-22T18:33:25.697" Title="Using a different major mode in comments" Tags="|major-mode|comment|literate-programming|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13349" PostTypeId="1" AcceptedAnswerId="13351" CreationDate="2015-06-22T17:56:26.173" Score="1" ViewCount="727" Body="&lt;p&gt;I am using the default &lt;strong&gt;python.el&lt;/strong&gt; python-mode for my Python development in Emacs. When I run the command &lt;code&gt;python-shell-send-buffer&lt;/code&gt; with &lt;code&gt;C-c C-c&lt;/code&gt;, it prompts me by default with: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Run Python:&lt;/strong&gt; /usr/bin/python -i&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like this to default to &lt;code&gt;/usr/bin/python3&lt;/code&gt; without the &lt;code&gt;-i&lt;/code&gt; option. Is there a variable where I can set for the path that shows up for the &lt;code&gt;python-shell-send-buffer&lt;/code&gt; command? I have looked through the completions for &lt;code&gt;python-shell-&lt;/code&gt; but couldn't find what I am looking for. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2017-02-26T12:16:14.987" Title="How can I change the behavior for python-shell-send-buffer?" Tags="|python|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13350" PostTypeId="2" ParentId="13348" CreationDate="2015-06-22T18:33:25.697" Score="5" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/QBobWatson/poporg&quot; rel=&quot;noreferrer&quot;&gt;poporg&lt;/a&gt; for this.&#xA;People mostly use it to edit comments in Org mode, but you can use whatever&#xA;mode you want by setting &lt;code&gt;poporg-edit-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(remove-hook 'poporg-edit-hook 'org-mode)&#xA;(add-hook 'poporg-edit-hook 'markdown-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-06-22T18:33:25.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13351" PostTypeId="2" ParentId="13349" CreationDate="2015-06-22T18:33:38.110" Score="3" Body="&lt;p&gt;&lt;code&gt;python-shell-interpreter&lt;/code&gt; is a variable defined in &lt;code&gt;python.el&lt;/code&gt;. Its [default] value is &lt;strong&gt;&quot;python&quot;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Documentation: Default Python interpreter for shell.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;python-shell-interpreter-args&lt;/code&gt; is a variable defined in &lt;code&gt;python.el&lt;/code&gt;.  Its [default] value is &lt;strong&gt;&quot;-i&quot;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Documentation:  Default arguments for the Python interpreter.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-06-22T18:33:38.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13352" PostTypeId="2" ParentId="13322" CreationDate="2015-06-22T18:42:19.320" Score="6" Body="&lt;p&gt;Try the &lt;code&gt;:results&lt;/code&gt; and &lt;code&gt;:results_switches&lt;/code&gt;parameters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :results output code :results_switches &quot;:tangle test.py&quot;&#xA;print(&quot;Results&quot;)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;#+BEGIN_SRC python :tangle test.py&#xA;Results&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this only seems to work with the resulting block using the same language as the code-generator. If you want to switch languages or use the results as data in another block, have a look at the &lt;code&gt;:var&lt;/code&gt; parameter.&lt;/p&gt;&#xA;" OwnerUserId="8570" LastActivityDate="2015-06-22T18:42:19.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13353" PostTypeId="1" AcceptedAnswerId="13362" CreationDate="2015-06-22T18:48:35.523" Score="27" ViewCount="5486" Body="&lt;p&gt;I wish to have an &quot;inbox.org&quot; file where I collect notes into (trying to implement &lt;a href=&quot;https://en.wikipedia.org/wiki/Getting_Things_Done&quot; rel=&quot;noreferrer&quot;&gt;GTD&lt;/a&gt; :P), and then later move things around to the proper places. I understand that &lt;code&gt;org-refile&lt;/code&gt; is the way to do this (move things around), but it seems that it is only possible to refile stuff under headlines, not directly into files. What I want is to take a note from my inbox.org and add it as a toplevel heading in the proper org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this by any chance possible? I read the info on &lt;code&gt;org-refile-targets&lt;/code&gt; and it seems like it is only able to refile into an existing headline, although the info on &lt;code&gt;org-refile-use-outline-path&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-refile-use-outline-path is a variable defined in `org.el'. Its&#xA;  value is &quot;file&quot; Original value was nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Non-nil means provide refile targets as paths. So a&#xA;  level 3 headline will be available as level1/level2/level3.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When the value is `file', also include the file name (without&#xA;  directory) into the path.  In this case, you can also stop the&#xA;  completion after the file name, &lt;strong&gt;to get entries inserted as top level&lt;/strong&gt;&#xA;  in the file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, autocompletion on the &lt;code&gt;org-refile&lt;/code&gt; prompt does not even provide the file names as options. Is there a way to do this with &lt;code&gt;org-refile-targets&lt;/code&gt; or any other means?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running gnu emacs 24.5.1 on windows 8.1 64bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance ;)&lt;/p&gt;&#xA;" OwnerUserId="8660" LastEditorUserId="23" LastEditDate="2016-04-21T12:31:33.957" LastActivityDate="2016-04-21T12:31:33.957" Title="How to use org-refile to move a headline to a file as a toplevel headline?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13354" PostTypeId="1" AcceptedAnswerId="13414" CreationDate="2015-06-22T19:44:42.547" Score="7" ViewCount="550" Body="&lt;p&gt;Speedbar has a nice feature wherein the directory heading at the top of a files/directory buffer contains various text properties for the user to jump to any of the parent directories by placing the cursor on the corresponding name and pressing the enter key.  I took it one step further and placed a text property at &lt;code&gt;point-min&lt;/code&gt; to jump to root.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:   Is there an existing modification for &lt;code&gt;dired-mode&lt;/code&gt; that accomplishes the same thing?  If not, then this thread can be used to create such a new feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GOAL -- &lt;code&gt;dired-mode&lt;/code&gt;&lt;/strong&gt;:  For example, the heading directory in &lt;code&gt;dired-mode&lt;/code&gt; is:  &lt;code&gt;/Users/HOME/data/emacs/lisp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Placing the cursor at &lt;code&gt;point-min&lt;/code&gt; and pressing enter will open a &lt;code&gt;dired&lt;/code&gt; buffer at &lt;code&gt;/&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Placing the cursor anywhere on the word &lt;code&gt;Users&lt;/code&gt; and pressing enter will open a &lt;code&gt;dired&lt;/code&gt; buffer at &lt;code&gt;/Users&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Placing the cursor anywhere on the word &lt;code&gt;HOME&lt;/code&gt; and pressing enter will open a &lt;code&gt;dired&lt;/code&gt; buffer at &lt;code&gt;/Users/HOME&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Placing the cursor anywhere on the word &lt;code&gt;data&lt;/code&gt; and pressing enter will open a &lt;code&gt;dired&lt;/code&gt; buffer at &lt;code&gt;/Users/HOME/data&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Placing the cursor anywhere on the word &lt;code&gt;emacs&lt;/code&gt; and pressing enter will open a &lt;code&gt;dired&lt;/code&gt; buffer at &lt;code&gt;/Users/HOME/data/emacs&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-23T17:43:28.233" LastActivityDate="2015-09-28T00:49:29.910" Title="Dired heading directory with text-properties to jump to parent directories" Tags="|dired|breadcrumbs|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13355" PostTypeId="2" ParentId="13332" CreationDate="2015-06-22T20:17:25.330" Score="2" Body="&lt;p&gt;Why not use a simpler function than regex? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x delete-duplicate-lines&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is often what I use. It is a function in sort.el.gz. If there is a special reason for keeping/retaining one copy of the duplicate line (say you want to keep the last one but delete all others), then you may want to explore repeatable macros with regex conditions.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-22T20:17:25.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13356" PostTypeId="2" ParentId="13345" CreationDate="2015-06-22T20:21:58.790" Score="2" Body="&lt;p&gt;I've used the following construct:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar objc-font-lock-test-setup-directory&#xA;  (if load-file-name&#xA;      (file-name-directory load-file-name)&#xA;   default-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works both when the file is loaded or when doing something like an &lt;code&gt;eval-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-06-22T20:21:58.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13357" PostTypeId="1" AcceptedAnswerId="13363" CreationDate="2015-06-22T20:56:32.000" Score="4" ViewCount="4469" Body="&lt;p&gt;I'm trying to test a program written in Python with a front panel generated with Qt Designer (converted from .ui to .py using pyuic4). I can make the following code work outside Emacs, from a terminal (it is just a main window with some labels and buttons):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from PyQt4 import QtCore, QtGui&#xA;from panelSimple import Ui_VentanaPrincipal&#xA;&#xA;class Window(QtGui.QMainWindow):&#xA;    def __init__(self):&#xA;        QtGui.QMainWindow.__init__(self)&#xA;        self.ui = Ui_VentanaPrincipal()&#xA;        self.ui.setupUi(self)&#xA;&#xA;if __name__ == '__main__':&#xA;&#xA;    import sys&#xA;    app = QtGui.QApplication(sys.argv)&#xA;&#xA;    miVentana = Window()&#xA;    miVentana.show()&#xA;&#xA;    sys.exit(app.exec_())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to execute this code from within Emacs, but when I send the buffer to the Python interpreter, and it opens an &quot;Inferior Python&quot; buffer, nothing happens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if I don't use any graphical user interface, python programs work very well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is it possible to make my program's GUI execute from inside Emacs?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started using Spacemacs with its default settings. For my tries I select a virtual environment (with PyQt4 installed), and then I send the buffer to the interpreter. I don't know what other information could be useful to answer my question.&lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="77" LastEditDate="2015-06-23T16:32:02.937" LastActivityDate="2015-06-23T16:32:02.937" Title="How to execute a python program (with a GUI) from Emacs?" Tags="|python|spacemacs|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13358" PostTypeId="1" CreationDate="2015-06-22T21:25:18.870" Score="1" ViewCount="263" Body="&lt;p&gt;I'd like to be able to use different color themes when I'm editing text versus when I'm using a terminal such as ansi-term. (Note: I'm not referring to different color schemes for GUI mode versus terminal mode). Is this possible? In general, is it possible to switch the color scheme on a per-buffer basis rather than global?&lt;/p&gt;&#xA;" OwnerUserId="8675" LastActivityDate="2015-06-22T21:25:18.870" Title="Different themes for text buffers vs ansi-term?" Tags="|colors|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13359" PostTypeId="2" ParentId="13220" CreationDate="2015-06-22T21:40:44.930" Score="1" Body="&lt;p&gt;Below is another solution which is more elegant&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default major-mode&#xA;  (lambda ()&#xA;  (if (db-regexp-match-p special-buffer-regexp (buffer-name))&#xA;      (special-mode)(fundamental-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastActivityDate="2015-06-22T21:40:44.930" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13360" PostTypeId="1" CreationDate="2015-06-22T23:11:27.187" Score="10" ViewCount="2989" Body="&lt;p&gt;I'm using org-habit, and the habit graphs show up nicely on the normal agenda view.  However, I'd like to use the todo list with tag filtering, and there the habits look like normal todo items, without the habit graph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make the habit graph appear when using the todo list agenda view?&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="2274" LastEditDate="2015-06-22T23:36:46.640" LastActivityDate="2015-10-13T17:48:07.563" Title="org-habit graph on todo list agenda view" Tags="|org-mode|org-agenda|org-habit|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13361" PostTypeId="1" AcceptedAnswerId="13372" CreationDate="2015-06-22T23:19:40.727" Score="3" ViewCount="739" Body="&lt;p&gt;I already use middle mouse to paste/yank. However flyspell seems to hijack this, making it impossible to paste in the vicinity of a correctable word. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the help of &lt;a href=&quot;https://stackoverflow.com/questions/10973000/emacs-23-4-mouse-2-behaviour-on-os-x-10-7&quot;&gt;this question&lt;/a&gt; I have discovered that I can add the correct-word functionality to the more sane right-mouse button with &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;flyspell&quot;&#xA;  '(progn&#xA;     (define-key flyspell-mouse-map [down-mouse-3] #'flyspell-correct-word)&#xA;     (define-key flyspell-mouse-map [mouse-3] #'undefined)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;however this doesn't change the middle mouse button behaviour. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I clear flyspell's default binding of the middle mouse so I can always use middle mouse to paste? It would also be appreciated if the relevant lisp could be explained. Although I managed to copy and paste the above to good effect, it's inner workings are a mystery to me.&lt;/p&gt;&#xA;" OwnerUserId="8676" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-23T23:16:36.620" Title="How do I disable the emacs flyspell middle mouse correction?" Tags="|flyspell|yank|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13362" PostTypeId="2" ParentId="13353" CreationDate="2015-06-22T23:29:21.787" Score="23" Body="&lt;p&gt;I figured out the small detail I was missing. The docs say &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When the value is `file', also include the file name (without&#xA;  directory) into the path.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I misinterpreted this as &lt;code&gt;&quot;file&quot;&lt;/code&gt;, which had no effect on the refile targets presented to me. What should be the value of &lt;code&gt;org-refile-use-outline-path&lt;/code&gt; is actually &lt;code&gt;'file&lt;/code&gt;, the quoted symbol &lt;code&gt;file&lt;/code&gt;!! :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this saves someone the time I wasted looking for the solution to a non-existent problem. Anyway, the documentation should not have that single quote character after &lt;code&gt;'file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discovered the solution on &lt;a href=&quot;https://stackoverflow.com/questions/21334817/emacs-org-mode-refile-to-main-tree-and-not-as-a-subtree&quot;&gt;this answer&lt;/a&gt; to the same question on stackoverflow, so maybe it is still useful to post it here.&lt;/p&gt;&#xA;" OwnerUserId="8660" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-22T23:29:21.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13363" PostTypeId="2" ParentId="13357" CreationDate="2015-06-23T01:30:51.620" Score="3" Body="&lt;p&gt;Try to use C-u C-c C-c. This allows you to run your script in an inferior Python buffer, and executes the code in the &lt;code&gt;if __name__ == '__main__':&lt;/code&gt; block. I am not sure why, but when you simply send the script to the shell with C-c C-c without the prefix argument, it won't execute the code in the   &lt;code&gt;if __name__ == '__main__':&lt;/code&gt; block. This works for me at least, using the default Python mode from python.el in Emacs 24&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-06-23T01:30:51.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13364" PostTypeId="1" CreationDate="2015-06-23T02:04:54.520" Score="3" ViewCount="1252" Body="&lt;p&gt;What can I add to my .emacs to make the cursor move more quickly? Specifically, I'm looking for faster rates for (holding arrow-keys and C-arrow keys (ie skipping over whitespace with my current config)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize I can tune this at the OS level, but was hoping for something emacs specific.&lt;/p&gt;&#xA;" OwnerUserId="8546" LastActivityDate="2015-06-23T02:04:54.520" Title="fast moving cursor?" Tags="|scrolling|cursor|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13365" PostTypeId="1" AcceptedAnswerId="13533" CreationDate="2015-06-23T02:33:41.277" Score="1" ViewCount="117" Body="&lt;p&gt;I was led to this place by @Chris from stackoverflow. My original question and steps I have taken (thanks to Chris' suggestion) and outcomes are at : &lt;a href=&quot;https://stackoverflow.com/questions/30972920/emacs-hang-after-installing-gtk3-in-windows-7&quot;&gt;https://stackoverflow.com/questions/30972920/emacs-hang-after-installing-gtk3-in-windows-7&lt;/a&gt;. Basically under windows 7, emacs setup was fine until I installed GTK3+ for windows 7. Then emacs hang while starting. The menu appears but everything else not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My original intent is to learn common lisp, and specifically use cl-cffi-gtk package. Now it looks like that I have to do this under linux using a VM.  It bugs me a lot since my main working environment is windows 7. Thanks a lot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry that I can't use gtk3 as tag because of lack of reputation. &lt;/p&gt;&#xA;" OwnerUserId="8677" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-06-29T03:07:34.120" Title="Emacs hang after installing GTK3 in windows 7" Tags="|microsoft-windows|gtk3|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13366" PostTypeId="2" ParentId="13322" CreationDate="2015-06-23T03:05:45.100" Score="5" Body="&lt;p&gt;Actually it was explained in the documentation of &lt;a href=&quot;http://orgmode.org/manual/Noweb-reference-syntax.html#Noweb-reference-syntax&quot; rel=&quot;noreferrer&quot;&gt;Noweb reference syntax&lt;/a&gt; (I cannot believe I missed this):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is possible to include the results of a code block rather than the&#xA;  body. This is done by appending parenthesis to the code block name&#xA;  which may optionally contain arguments to the code block as shown&#xA;  below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;&amp;lt;code-block-name(optional arguments)&amp;gt;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you specify &lt;code&gt;&amp;lt;&amp;lt;code-block-name()&amp;gt;&amp;gt;&lt;/code&gt;, it will evaluate the specified code block and tangle only the results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only caveat is that you have to use different &lt;code&gt;code-block-name&lt;/code&gt; for the code blocks that you actually want to tangle the source. In that sense, radebrecht's answer is also good since you can use one name for all code blocks, you just need to specify &lt;code&gt;:results_switches&lt;/code&gt; for the blocks which you want to tangle their results.&lt;/p&gt;&#xA;" OwnerUserId="6807" LastActivityDate="2015-06-23T03:05:45.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13367" PostTypeId="1" CreationDate="2015-06-23T07:55:42.087" Score="1" ViewCount="56" Body="&lt;p&gt;In org-mode, normal hierarchy goes like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Section 1&#xA;  Content of section 1&#xA;&#xA;  ** Section 1-1&#xA;     Content of section 1-1&#xA;&#xA;  ** Section 1-2&#xA;     Content of section 1-2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As I understand it, everything after a header belongs to that section until it meets another (higher or lower) header.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is it possible to break the current section without using another header, and to continue the content of the previous section? Something like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Section 1&#xA;  Content of section 1&#xA;&#xA;  ** Section 1-1&#xA;     Content of section 1-1&#xA;  ** Section 1-1 end&#xA;&#xA;  Content of section 1 continues ...&#xA;&#xA;  ** Section 1-2&#xA;     Content of section 1-2&#xA;  ** Section 1-2 ends&#xA;&#xA;&#xA;  Content of section 1 continues ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8679" LastActivityDate="2015-06-23T16:35:38.647" Title="In org-mode how to break current section and escape to upper level" Tags="|org-mode|" AnswerCount="0" CommentCount="9" ClosedDate="2015-06-23T16:35:59.610" ContentLicense="CC BY-SA 3.0" />
  <row Id="13368" PostTypeId="1" CreationDate="2015-06-23T11:09:35.663" Score="3" ViewCount="658" Body="&lt;p&gt;If you look closely there is a background on the text that is different than the frame background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know why this happens? According to the manual (if I read it correctly) it says that they should be the same. I've tried changing the default-face but to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The theme is the &lt;a href=&quot;http://melpa.org/#/moe-theme&quot; rel=&quot;nofollow noreferrer&quot;&gt;moe-theme&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dotfiles are at &lt;a href=&quot;https://github.com/zackp30/dotfiles/blob/master/home/.emacs.d/config.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/zackp30/dotfiles/blob/master/home/.emacs.d/config.org&lt;/a&gt; if somebody who is brave enough to try and debug them...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also happened with the material theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XsPZN.png&quot; alt=&quot;Example of what happens&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;So, after trying the suggestions answered, I recompiled Emacs using &lt;code&gt;--with-x-toolkit=lucid&lt;/code&gt; and the problem disappeared, so it appears to be a problem with Gtk, is there any solution for this? I found this out via the #emacs channel @ freenode. The OS is openSUSE 13.2.&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;EDIT 2: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disregard the previous edit; when using Emacs as it is (as in, not as a daemon) it's fine and has the right colors), but when I am using it as a daemon it has the issue displayed previously. Very very weird...&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 3:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gah! Forgot about the fact that I reproduced it in an X11 window, with &lt;code&gt;emacs -Q&lt;/code&gt; without using the daemon. I'll be submitting an Emacs bug.&lt;/p&gt;&#xA;" OwnerUserId="7096" LastEditorUserId="7096" LastEditDate="2015-06-23T19:03:00.057" LastActivityDate="2015-06-23T19:03:00.057" Title="Why does the background of the text not correspond to the background color of the frame?" Tags="|faces|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13369" PostTypeId="2" ParentId="13368" CreationDate="2015-06-23T12:16:50.730" Score="1" Body="&lt;p&gt;You can get information by placing the cursor on a character of the type you want information about, just like in your picture, and then type &lt;code&gt;M-x describe-char&lt;/code&gt;. You will then get a buffer, with among other things the name of the face of the character, through the entry &lt;code&gt;font-lock-face&lt;/code&gt;. Following that link will take you to the definition of the face, where the background might have been set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is no &lt;code&gt;font-lock-face&lt;/code&gt; entry, the character is likely in the default face. &lt;code&gt;M-x describe-face&lt;/code&gt; and then selecting &lt;code&gt;default&lt;/code&gt; should give you the properties of that.&lt;/p&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="2688" LastEditDate="2015-06-23T14:45:57.690" LastActivityDate="2015-06-23T14:45:57.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13370" PostTypeId="2" ParentId="13354" CreationDate="2015-06-23T13:17:04.487" Score="1" Body="&lt;p&gt;Another approach to achieve the same thing. I've got this in use for a while now. To use it press &lt;kbd&gt;mouse-2&lt;/kbd&gt; on the directory name.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired+)&#xA;&#xA;(defadvice diredp-mouse-find-file-reuse-dir-buffer (before breadcrumb activate)&#xA;    (let (file)&#xA;    (with-current-buffer (window-buffer (posn-window (event-end event)))&#xA;      (save-excursion&#xA;    (goto-char (posn-point (event-end event)))&#xA;    (when (and (= (line-beginning-position) 1)&#xA;           (null (and (looking-back &quot;^[[:blank:]]*&quot;) (= (char-after) ?/)))&#xA;           (search-forward-regexp &quot;[/:]&quot; (line-end-position) 'noErr))&#xA;      (search-backward-regexp &quot;^[[:blank:]]*\\(.*\\).&quot;)&#xA;      (setq file (match-string-no-properties 1))&#xA;      (if (file-directory-p file)&#xA;          (progn&#xA;        (find-alternate-file (file-name-sans-versions file t))&#xA;        (deactivate-mark))&#xA;        (error &quot;First line in dired buffer is no dir. I am confused.&quot;)&#xA;        ))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that this is hacky. But, it works for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not want to require &lt;code&gt;dired+&lt;/code&gt; advice &lt;code&gt;dired-mouse-find-file-other-window&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-06-23T13:24:06.330" LastActivityDate="2015-06-23T13:24:06.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13371" PostTypeId="2" ParentId="13368" CreationDate="2015-06-23T14:33:20.510" Score="1" Body="&lt;p&gt;Possibly a duplicate of &lt;a href=&quot;https://emacs.stackexchange.com/q/13296/105&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answers there should help you with this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, start from &lt;code&gt;emacs -Q&lt;/code&gt; (no init file).  Do whatever you need to do (e.g. load the theme) to repro the problem, but without doing all the rest of what might be in your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then check the face(s) used on the text in question, using &lt;code&gt;C-u C-x =&lt;/code&gt;. Check the face's background. Check the background of face &lt;code&gt;default&lt;/code&gt;, which is used for the non-text areas of the frame. If they are not the same, just customize  one or the other face, so that it has the same background as the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The frame background is the background of face &lt;code&gt;default&lt;/code&gt;. It is also the value of frame parameter &lt;code&gt;background-color&lt;/code&gt;.  You can customize either face &lt;code&gt;default&lt;/code&gt; or option &lt;code&gt;default-frame-alist&lt;/code&gt; (parameter &lt;code&gt;background-color&lt;/code&gt;), to fit your theme or whatever.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-06-23T14:33:20.510" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13372" PostTypeId="2" ParentId="13361" CreationDate="2015-06-23T14:44:38.823" Score="3" Body="&lt;p&gt;You can extend your current code to bind &lt;code&gt;[mouse-2]&lt;/code&gt; and &lt;code&gt;[down-mouse-2]&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in &lt;code&gt;flyspell-mouse-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;flyspell&quot;&#xA;  '(progn&#xA;     (define-key flyspell-mouse-map [down-mouse-3] #'flyspell-correct-word)&#xA;     (define-key flyspell-mouse-map [mouse-3] #'undefined)&#xA;     (define-key flyspell-mouse-map [down-mouse-2] nil)&#xA;     (define-key flyspell-mouse-map [mouse-2] nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to @nanny for testing it out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What the code is doing is: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Telling emacs that you want to make some modifications only &lt;em&gt;after&lt;/em&gt; it loads &lt;code&gt;flyspell&lt;/code&gt; (that's the &lt;code&gt;eval-after-load&lt;/code&gt; part).  &lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;progn&lt;/code&gt; tells emacs that you're going to tell it to do a number of things.  &lt;/li&gt;&#xA;&lt;li&gt;Each of the &lt;code&gt;define-key&lt;/code&gt; lines tells emacs that you're going to change something in the &lt;code&gt;flyspell-mouse-map&lt;/code&gt;.  &lt;/li&gt;&#xA;&lt;li&gt;Setting a binding to &lt;code&gt;nil&lt;/code&gt; tells emacs that it should do nothing in that map.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In other words: unbinding it in &lt;code&gt;flyspell-mouse-map&lt;/code&gt; means that &lt;code&gt;flyspell&lt;/code&gt; won't override your existing middle-mouse-as-yank setup.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-06-23T14:50:19.657" LastActivityDate="2015-06-23T14:50:19.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13373" PostTypeId="1" CreationDate="2015-06-23T14:54:30.040" Score="9" ViewCount="845" Body="&lt;p&gt;Experienced lisp, scheme, clojure programmer making the move to elisp from python for automating routine, everyday, basic tasks: I got an enormous surprise from the following in &lt;code&gt;ielm&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (setq h2 (make-hash-table))&#xA;#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 data ())&#xA;ELISP&amp;gt; (puthash &quot;a&quot; 1 h2)&#xA;1 (#o1, #x1, ?\C-a)&#xA;ELISP&amp;gt; (gethash &quot;a&quot; h2)&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;huh?  The key and the value appear to be present:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; h2&#xA;#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 data (&quot;a&quot; 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;/slaps forehead.  I must be missing something totally obvious. Info says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-- Function: gethash key table &amp;amp;optional default&#xA; This function looks up KEY in TABLE, and returns its associated&#xA; VALUE—or DEFAULT, if KEY has no association in TABLE.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;great.  Let's see if we can get &lt;code&gt;gethash&lt;/code&gt; to return anything other than &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (gethash &quot;a&quot; h2 'fubar) &#xA;fubar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;wow.  Ok, I'm a lot dumber than I thought.  What on earth am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="596" LastEditorUserId="253" LastEditDate="2015-06-23T15:01:35.127" LastActivityDate="2015-06-23T15:01:35.127" Title="why won't gethash return my key's value?" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13374" PostTypeId="2" ParentId="13373" CreationDate="2015-06-23T14:58:10.767" Score="14" Body="&lt;p&gt;The default membership test for a hash table is &lt;code&gt;eql&lt;/code&gt;.  If you'd like to use a string as the key, set it to &lt;code&gt;equal&lt;/code&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setf hash (make-hash-table :test #'equal))&#xA;(puthash &quot;a&quot; 1 hash)&#xA;(gethash &quot;a&quot; hash)                      ; ==&amp;gt; 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For reference, here's the relevant part of the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;make-hash-table&lt;/code&gt; is a built-in function in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(make-hash-table &amp;amp;rest KEYWORD-ARGS)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Create and return a new hash table.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Arguments are specified as keyword/argument pairs.  The following&#xA;  arguments are defined:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;:test&lt;/code&gt; TEST -- TEST must be a symbol that specifies how to compare&#xA;  keys.  Default is &lt;code&gt;eql&lt;/code&gt;.  Predefined are the tests &lt;code&gt;eq&lt;/code&gt;, &lt;code&gt;eql&lt;/code&gt;, and&#xA;  &lt;code&gt;equal&lt;/code&gt;.  User-supplied test and hash functions can be specified via&#xA;  &lt;code&gt;define-hash-table-test&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-23T14:58:10.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13375" PostTypeId="1" AcceptedAnswerId="13394" CreationDate="2015-06-23T16:16:14.883" Score="1" ViewCount="166" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm&lt;/code&gt;&lt;/a&gt; seems to implicitly insert the current symbol at point as an initial query.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uwiAC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For reference, this is &lt;code&gt;helm-omni&lt;/code&gt; from &lt;a href=&quot;https://github.com/PythonNut/emacs-config/blob/dev/modules/config-helm.el#L142-L225&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note how the minibuffer is empty, yet helm is already searching for &lt;code&gt;idle-require&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has some performance implications that I'd like to avoid. Is there any way I can turn this behavior off? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Probably will require advice, as Helm's author says he doesn't want to add an option to turn it off).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been a lot of interest in this (but nothing's come of it yet):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/648&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm #648&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/658&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm #658&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/876&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm #876&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-06-23T22:43:06.127" LastActivityDate="2015-06-24T08:44:10.627" Title="Keep helm from picking up symbol at point" Tags="|helm|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13376" PostTypeId="1" AcceptedAnswerId="13377" CreationDate="2015-06-23T16:20:45.963" Score="20" ViewCount="6428" Body="&lt;p&gt;Having a file for a particular project, I would like all the nodes in that file to have a tag identifying the project, so that I can later use it to create agenda views for that project only. So far all I've found is &lt;code&gt;#+TAGS: foo bar spam&lt;/code&gt; which specifies a hard list of tags offered in tag autocompletion for that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of a &lt;code&gt;#+XXX&lt;/code&gt;-like instruction to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="8660" LastActivityDate="2022-03-02T21:55:24.243" Title="Orgmode: is it possible to set tags at a file level?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13377" PostTypeId="2" ParentId="13376" CreationDate="2015-06-23T16:31:14.657" Score="28" Body="&lt;p&gt;Yes. From the &lt;a href=&quot;http://orgmode.org/manual/Tag-Inheritance.html&quot; rel=&quot;noreferrer&quot;&gt;Tag inheritance&lt;/a&gt; chapter of the &lt;code&gt;org-mode&lt;/code&gt; manual (emphasis mine):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Tags make use of the hierarchical structure of outline trees. If a heading has a certain tag, all subheadings will inherit the tag as well. For example, in the list&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Meeting with the French group      :work:&#xA;** Summary by Frank                  :boss:notes:&#xA;*** TODO Prepare slides for him      :action:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;the final heading will have the tags &lt;code&gt;:work:&lt;/code&gt;, &lt;code&gt;:boss:&lt;/code&gt;, &lt;code&gt;:notes:&lt;/code&gt;, and &lt;code&gt;:action:&lt;/code&gt; even though the final heading is not explicitly marked with those tags. &lt;strong&gt;You can also set tags that all entries in a file should inherit&lt;/strong&gt; just as if these tags were defined in a hypothetical level zero that surrounds the entire file. Use a line like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+FILETAGS: :Peter:Boss:Secret:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="504" LastEditorUserId="19819" LastEditDate="2022-01-04T12:37:46.047" LastActivityDate="2022-01-04T12:37:46.047" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="13378" PostTypeId="2" ParentId="13376" CreationDate="2015-06-23T16:31:25.907" Score="11" Body="&lt;p&gt;Okay, I found the answer to the question right after posting it... anyway, here it goes for those who might not know how to do this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+FILETAGS: :foo:bar:spam:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Found the info in &lt;a href=&quot;https://orgmode.org/manual/In_002dbuffer-Settings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; very useful page with all the in-buffer settings.&lt;/p&gt;&#xA;" OwnerUserId="8660" LastEditorUserId="26427" LastEditDate="2022-03-02T21:55:24.243" LastActivityDate="2022-03-02T21:55:24.243" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="13379" PostTypeId="2" ParentId="13376" CreationDate="2015-06-23T16:32:06.440" Score="13" Body="&lt;p&gt;File specific tags can be specified as: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+FILETAGS: :tag1:tag2:tag3:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These tags then apply to lower level entries through inheritance. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-23T16:32:06.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13380" PostTypeId="2" ParentId="13354" CreationDate="2015-06-23T17:42:25.050" Score="2" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired)&#xA;&#xA;(defface dired-mouseover-face&#xA;  '((t (:foreground &quot;green&quot;)))&#xA;  &quot;Face for `dired-mouseover-face'.&quot;&#xA;  :group 'dired)&#xA;&#xA;(defvar dired-mouse-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map [mouse-2] 'dired-follow-link)&#xA;    (define-key map [return] 'dired-follow-link)&#xA;    (define-key map [follow-link] 'mouse-face)&#xA;      map)&#xA;  &quot;Keymap for mouse when in `dired-mode'.&quot;)&#xA;&#xA;;; Author:  Drew Adams -- http://emacs.stackexchange.com/a/13411/2287&#xA;(defun dired-follow-link (event)&#xA;&quot;Follow the link in the dired directory heading, causing a new&#xA;dired buffer to be opened.&quot;&#xA;  (interactive (list last-nonmenu-event))&#xA;  (run-hooks 'mouse-leave-buffer-hook)&#xA;  (with-current-buffer (window-buffer (posn-window (event-start event)))&#xA;    (let ((path  (get-text-property (posn-point (event-start event)) 'breadcrumb)))&#xA;      (dired path))))&#xA;&#xA;(defun dired-propertize-directory-heading ()&#xA;(interactive)&#xA;  (unless (buffer-narrowed-p)&#xA;    (let* (&#xA;        p beg end path peol&#xA;        (inhibit-read-only t) )&#xA;      (save-excursion&#xA;        (goto-char (point-min))&#xA;        (setq peol (point-at-eol))&#xA;        (set-text-properties (point) peol nil)&#xA;        (re-search-forward &quot;\\([^/\\]+\\)[/\\]&quot; peol t)&#xA;        (when (looking-back &quot;\\(^ +\\)\\([a-zA-Z]:\\)?/&quot;)&#xA;          (setq p (match-end 1))&#xA;          (setq path (if (match-string 2) (concat (match-string 2) &quot;/&quot;) &quot;/&quot;))&#xA;          (add-text-properties (point-min) (1- (match-end 0)) (list&#xA;            'breadcrumb path&#xA;            'mouse-face 'dired-mouseover-face&#xA;            'help-echo (format &quot;mouse-2, RET: Follow the link to \&quot;%s\&quot;.&quot; path)&#xA;            'keymap dired-mouse-map)))&#xA;        (while (re-search-forward &quot;\\([^/\\]+\\)[/\\]&quot; peol t)&#xA;          (setq beg (match-beginning 1))&#xA;          (setq end (match-end 1))&#xA;          (setq path (buffer-substring-no-properties p end))&#xA;          (add-text-properties beg end (list&#xA;            'breadcrumb path&#xA;            'mouse-face 'dired-mouseover-face&#xA;            'help-echo (format &quot;mouse-2, RET: Follow the link to \&quot;%s\&quot;.&quot; path)&#xA;            'keymap dired-mouse-map)))&#xA;        (setq path (buffer-substring-no-properties p (1- peol)))&#xA;        (add-text-properties (point) (1- peol) (list&#xA;          'breadcrumb path&#xA;          'mouse-face 'dired-mouseover-face&#xA;          'help-echo (format &quot;mouse-2, RET: Follow the link to \&quot;%s\&quot;.&quot; path)&#xA;          'keymap dired-mouse-map))))))&#xA;&#xA;(add-hook 'dired-after-readin-hook 'dired-propertize-directory-heading)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/dired_breadcrumb.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.770" LastActivityDate="2015-09-28T00:49:29.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13381" PostTypeId="1" CreationDate="2015-06-23T18:50:01.683" Score="9" ViewCount="361" Body="&lt;p&gt;The docstring for &lt;code&gt;modify-syntax-entry&lt;/code&gt; says the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry CHAR NEWENTRY &amp;amp;optional SYNTAX-TABLE)&#xA;...&#xA;The first character of NEWENTRY should be one of the following:&#xA;...&#xA;  /           character-quote.      @   inherit from parent table.&#xA;  |           generic string fence. !   generic comment fence.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is a fence, and when would I use one? I can't find anything in the info manual.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2015-06-23T22:26:53.330" Title="What is a string fence or comment fence?" Tags="|syntax-highlighting|syntax-table|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13382" PostTypeId="2" ParentId="13381" CreationDate="2015-06-23T19:25:32.887" Score="5" Body="&lt;p&gt;Taken from syntax.h:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* A syntax table is a chartable whose elements are cons cells&#xA;   (CODE+FLAGS . MATCHING-CHAR).  MATCHING-CHAR can be nil if the char&#xA;   is not a kind of parenthesis.&#xA;&#xA;   The low 8 bits of CODE+FLAGS is a code, as follows:  */&#xA;&#xA;enum syntaxcode&#xA;  {&#xA;    Swhitespace, /* for a whitespace character */&#xA;    Spunct,      /* for random punctuation characters */&#xA;    Sword,       /* for a word constituent */&#xA;    Ssymbol,     /* symbol constituent but not word constituent */&#xA;    Sopen,       /* for a beginning delimiter */&#xA;    Sclose,      /* for an ending delimiter */&#xA;    Squote,      /* for a prefix character like Lisp ' */&#xA;    Sstring,     /* for a string-grouping character like Lisp &quot; */&#xA;    Smath,       /* for delimiters like $ in Tex.  */&#xA;    Sescape,     /* for a character that begins a C-style escape */&#xA;    Scharquote,  /* for a character that quotes the following character */&#xA;    Scomment,    /* for a comment-starting character */&#xA;    Sendcomment, /* for a comment-ending character */&#xA;    Sinherit,    /* use the standard syntax table for this character */&#xA;    Scomment_fence, /* Starts/ends comment which is delimited on the&#xA;                       other side by any char with the same syntaxcode.  */&#xA;    Sstring_fence,  /* Starts/ends string which is delimited on the&#xA;                       other side by any char with the same syntaxcode.  */&#xA;    Smax         /* Upper bound on codes that are meaningful */&#xA;  };&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming that the syntax codes and the regex syntax classes refer to the same thing, I've spotted use of &lt;code&gt;|&lt;/code&gt; in &lt;code&gt;cc-awk.el&lt;/code&gt; which uses &lt;code&gt;&quot;\\s|&quot;&lt;/code&gt; for highlighting unbalanced string delimiters.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-06-23T19:25:32.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13383" PostTypeId="2" ParentId="13320" CreationDate="2015-06-23T21:58:19.433" Score="3" Body="&lt;p&gt;Thanks to Politza, and stepping through &lt;code&gt;python-syntax-stringify&lt;/code&gt; with edebug, I've got this working. The changes were:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;|&lt;/code&gt; should only be applied to the first and last character in the triple-quoted-string.&lt;/li&gt;&#xA;&lt;li&gt;(Because syntax parsing is incremental?) It's not possible to search for a whole string. Instead, search for a delimiter and see whether or not you're in a triple-quoted string.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Working code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst demo-triple-quoted-string-regex&#xA;  (rx &quot;\&quot;\&quot;\&quot;&quot;))&#xA;&#xA;(defun demo-stringify-triple-quote ()&#xA;  &quot;Put `syntax-table' property on triple-quoted strings.&quot;&#xA;  (let* ((string-end-pos (point))&#xA;         (string-start-pos (- string-end-pos 3))&#xA;         (ppss (prog2&#xA;                   (backward-char 3)&#xA;                   (syntax-ppss)&#xA;                 (forward-char 3))))&#xA;    (unless (nth 4 (syntax-ppss)) ;; not inside comment&#xA;      (if (nth 8 (syntax-ppss))&#xA;          ;; We're in a string, so this must be the closing triple-quote.&#xA;          ;; Put | on the last &quot; character.&#xA;          (put-text-property (1- string-end-pos) string-end-pos&#xA;                             'syntax-table (string-to-syntax &quot;|&quot;))&#xA;        ;; We're not in a string, so this is the opening triple-quote.&#xA;        ;; Put | on the first &quot; character.&#xA;        (put-text-property string-start-pos (1+ string-start-pos)&#xA;                           'syntax-table (string-to-syntax &quot;|&quot;))))))&#xA;&#xA;(defconst demo-syntax-propertize-function&#xA;  (syntax-propertize-rules&#xA;   (demo-triple-quoted-string-regex&#xA;    (0 (ignore (demo-stringify-triple-quote))))))&#xA;&#xA;(define-derived-mode demo-mode prog-mode &quot;Demo&quot;&#xA;  &quot;Major mode showing stack overflow question.&quot;&#xA;  (set (make-local-variable 'font-lock-defaults) '(()))&#xA;  (set (make-local-variable 'syntax-propertize-function)&#xA;       demo-syntax-propertize-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastActivityDate="2015-06-23T21:58:19.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13384" PostTypeId="1" CreationDate="2015-06-23T21:59:47.920" Score="2" ViewCount="128" Body="&lt;p&gt;i am using &lt;code&gt;cider&lt;/code&gt;.  I want to do the following: when I finish editing in a source buffer, I want to compile the source and execute it in the repl, all with a single key-binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;cider-mode&lt;/code&gt;, compiling source can be done by &lt;code&gt;C-c C-k&lt;/code&gt; or &lt;code&gt;M-x some-function&lt;/code&gt;, so the workflow is basically like this: &lt;code&gt;C-c C-k&lt;/code&gt;, &lt;code&gt;C-c C-z&lt;/code&gt; (switch to repl buffer), and type and execute &lt;code&gt;my-function&lt;/code&gt;.  How do I bind all the actions together and popup the repl buffer with results?&lt;/p&gt;&#xA;" OwnerUserId="8622" LastEditorUserId="8622" LastEditDate="2015-09-23T13:07:21.580" LastActivityDate="2015-09-23T13:07:21.580" Title="How do I perform a sequence of actions with a single keybinding?" Tags="|clojure|cider|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13385" PostTypeId="1" CreationDate="2015-06-23T22:14:17.273" Score="11" ViewCount="4184" Body="&lt;p&gt;I am trying to run an ipython interpreter remotely (with Emacs 24.5 and native &lt;code&gt;python.el&lt;/code&gt;), but I'm not sure I have the right approach: whenever I try to run such a command for instance (which gets triggered with &lt;code&gt;C-c C-c&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Run Python: /ssh:&amp;lt;server_name&amp;gt;:/usr/local/bin/ipython -i&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(with &lt;code&gt;&amp;lt;server_name&amp;gt;&lt;/code&gt; a valid entry in my &lt;code&gt;~/.ssh/config&lt;/code&gt;, and &lt;code&gt;ipython&lt;/code&gt; available at that remote location), I get an error like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (emacs): Python shell prompts cannot be detected.&#xA;If your emacs session hangs when starting python shells&#xA;recover with `keyboard-quit' and then try fixing the&#xA;interactive flag for your interpreter by adjusting the&#xA;`python-shell-interpreter-interactive-arg' or add regexps&#xA;matching shell prompts in the directory-local friendly vars:&#xA;  + `python-shell-prompt-regexp'&#xA;  + `python-shell-prompt-block-regexp'&#xA;  + `python-shell-prompt-output-regexp'&#xA;Or alternatively in:&#xA;  + `python-shell-prompt-input-regexps'&#xA;  + `python-shell-prompt-output-regexps'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as well as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;env: /ssh:&amp;lt;server_name&amp;gt;:/usr/local/bin/ipython: No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in a &lt;code&gt;*Python*&lt;/code&gt; buffer.. Is this making use of &lt;code&gt;tramp&lt;/code&gt;, and is &lt;code&gt;python.el&lt;/code&gt; able to run remote interpreters in such a way?&lt;/p&gt;&#xA;" OwnerUserId="2807" LastEditorUserId="2807" LastEditDate="2017-04-10T12:18:47.493" LastActivityDate="2018-02-20T02:23:10.890" Title="Running ipython remotely" Tags="|python|tramp|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13386" PostTypeId="2" ParentId="13381" CreationDate="2015-06-23T22:26:53.330" Score="8" Body="&lt;p&gt;They are documented in the manual, but it doesn't use the word “fence”. The characters &lt;code&gt;!&lt;/code&gt; and &lt;code&gt;|&lt;/code&gt; are listed as “generic comment delimiters” and “generic string delimiters” in the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table&quot;&gt;syntax class reference&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These characters were introduced in Emacs 20.1. Quoting the NEWS file:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There are two new syntax-codes, &lt;code&gt;!&lt;/code&gt; and &lt;code&gt;|&lt;/code&gt; (numeric values 14&#xA;  and 15).  A character with a code &lt;code&gt;!&lt;/code&gt; starts a comment which is ended&#xA;  only by another character with the same code (unless quoted).  A&#xA;  character with a code &lt;code&gt;|&lt;/code&gt; starts a string which is ended only by&#xA;  another character with the same code (unless quoted).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;These codes are mainly meant for use as values of the `syntax-table'&#xA;  text property.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I can't find any use of &lt;code&gt;!&lt;/code&gt; in the standard Emacs modes. There are several uses of &lt;code&gt;|&lt;/code&gt;. The intended use case is languages which have literals that use delimiters other than the usual string delimiters, usually set via overlays added by font locking based on the context. For example, in perl, a regular expression match can be written &lt;code&gt;/REGEXP/&lt;/code&gt;, or &lt;code&gt;m/REGEXP/&lt;/code&gt; or &lt;code&gt;m~REGEXP~&lt;/code&gt; or &lt;code&gt;m[REGEXP]&lt;/code&gt; or any number of variations. A literal string can be written &lt;code&gt;'STRING'&lt;/code&gt; but also &lt;code&gt;q'STRING'&lt;/code&gt;, &lt;code&gt;q~STRING~&lt;/code&gt;, &lt;code&gt;q[STRING]&lt;/code&gt;, etc. When font lock recognizes such constructs, it sets the quote characters (&lt;code&gt;/&lt;/code&gt;/&lt;code&gt;/&lt;/code&gt; or &lt;code&gt;'&lt;/code&gt;/&lt;code&gt;'&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt;/&lt;code&gt;~&lt;/code&gt; or &lt;code&gt;[&lt;/code&gt;/&lt;code&gt;]&lt;/code&gt; in the examples I gave) to generic string delimiter syntax. Even if a habitual string delimiter is present (e.g. &lt;code&gt;q[foo&quot;bar]&lt;/code&gt;), that delimiter will be considered an ordinary part of the string, it won't terminate the string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I admit that I don't see a definitive benefit — for example CPerl mode does some very fancy things and doesn't use this facility.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-06-23T22:26:53.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13387" PostTypeId="2" ParentId="13385" CreationDate="2015-06-23T23:10:17.867" Score="7" Body="&lt;p&gt;One way is to use &lt;code&gt;*eshell*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;eshell&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cd /ssh:&amp;lt;server_name&amp;gt;:~&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;run-python /usr/bin/ipython&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Switch to &lt;code&gt;*Python*&lt;/code&gt; buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-06-23T23:15:57.713" LastActivityDate="2015-06-23T23:15:57.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13389" PostTypeId="1" AcceptedAnswerId="13391" CreationDate="2015-06-24T05:49:35.070" Score="2" ViewCount="1436" Body="&lt;p&gt;I'd like to define a function to do a &lt;code&gt;query-replace-regexp&lt;/code&gt; with a pattern I often use. When not using capture groups, it works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-replace ()&#xA;    (interactive)&#xA;    (query-replace-regexp &quot;[[:nonascii:][:ascii:]]*xxx&quot; &quot;replacedText&quot; nil (point-min) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I couldn't figure out how to use capture groups -- neither '\(\)' nor '()' works: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-replace ()&#xA;  (interactive)&#xA;  (query-replace-regexp &quot;([[:nonascii:][:ascii:]]*)xxx&quot; &quot;\1replacedText&quot; nil (point-min) (point-max)))&#xA;&#xA;&#xA;(defun my-replace ()&#xA;    (interactive)&#xA;    (query-replace-regexp &quot;\([[:nonascii:][:ascii:]]*\)xxx&quot; &quot;\1replacedText&quot; nil (point-min) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when invoked with M-x &lt;code&gt;query-replace-regexp&lt;/code&gt;, &lt;code&gt;\([[:nonascii:][:ascii:]]*\)xxx&lt;/code&gt; would work.&lt;/p&gt;&#xA;" OwnerUserId="8396" LastActivityDate="2015-06-24T06:49:57.813" Title="Named groups for query-replace-regexp" Tags="|regular-expressions|replace|query-replace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13390" PostTypeId="2" ParentId="13389" CreationDate="2015-06-24T06:36:00.683" Score="3" Body="&lt;p&gt;Use &quot;\&quot; to quote &quot;\&quot;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-replace ()&#xA;  (interactive)&#xA;  (query-replace-regexp &quot;\\([[:nonascii:][:ascii:]]*\\)xxx&quot; &quot;\\1replacedText&quot;&#xA;                        nil (point-min) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-06-24T06:36:00.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13391" PostTypeId="2" ParentId="13389" CreationDate="2015-06-24T06:40:07.820" Score="5" Body="&lt;p&gt;In Emacs Lisp string literals, backslash is an escape character.  To express a single literal backslash character, as required by many regular expression constructs, you need two backslashes, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\([[:nonascii:][:ascii:]]*\\)xxx&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't need the extra backslashes when you run &lt;code&gt;query-replace-regexp&lt;/code&gt; interactively because you're not entering a string literal, ie, an Emacs Lisp language construct; you're entering the characters of the regexp directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try hitting &lt;kbd&gt;M-:&lt;/kbd&gt; (&lt;code&gt;eval-expression&lt;/code&gt;) and entering this expression:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\(foo\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;(foo)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...indicating that an escaped parenthesis in a string literal is the same as an unescaped parenthesis.  So the regular expression engine was seeing parentheses without a preceding backslash, which match only themselves; they weren't starting or ending a capturing group as you expected.&lt;/p&gt;&#xA;" OwnerUserId="2463" LastEditorUserId="2463" LastEditDate="2015-06-24T06:49:57.813" LastActivityDate="2015-06-24T06:49:57.813" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13392" PostTypeId="1" CreationDate="2015-06-24T06:55:00.853" Score="9" ViewCount="3335" Body="&lt;p&gt;I'm trying to configure Flycheck to use both csslint and tidy checkers in &lt;code&gt;web-mode&lt;/code&gt; without any success. &lt;a href=&quot;https://emacs.stackexchange.com/questions/12946/how-tell-web-mode-to-use-tidy-syntaxchecker-in-flycheck&quot;&gt;This post&lt;/a&gt; suggests using this code for tidy:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'flycheck&#xA;  '(flycheck-add-mode 'html-tidy 'web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But adding an extra line like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;'(flycheck-add-mode 'css-csslint 'web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is not possible which I think is due to &lt;code&gt;eval-after-load&lt;/code&gt;. Any suggestions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it at all possible for &lt;code&gt;web-mode&lt;/code&gt; to change Flycheck language say by using &lt;code&gt;web-mode-cur-language&lt;/code&gt; and &lt;code&gt;web-mode-language-at-pos&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8688" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-06-24T09:53:48.477" Title="Using multiple flycheck syntax checkers in web-mode" Tags="|flycheck|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13393" PostTypeId="2" ParentId="13392" CreationDate="2015-06-24T07:19:47.653" Score="14" Body="&lt;p&gt;&lt;code&gt;eval-after-load&lt;/code&gt; takes a &lt;em&gt;single&lt;/em&gt; form, hence:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'flycheck&#xA;  '(progn&#xA;     (flycheck-add-mode 'html-tidy 'web-mode)&#xA;     (flycheck-add-mode 'css-csslint 'web-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're using Emacs 24.4 or newer, &lt;code&gt;with-eval-after-load&lt;/code&gt; is preferable, which neatly avoids this particular source of confusion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'flycheck&#xA;  (flycheck-add-mode 'html-tidy 'web-mode)&#xA;  (flycheck-add-mode 'css-csslint 'web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;However, while this arranges for both HTML-Tidy and CSS Lint to be available in Web Mode, the result is probably not what you'd like to have.  You'll see an overwhelming amount of false errors, because neither HTML Tidy nor CSS Lint can deal with mixed-language files.  CSS Lint specifically expects plain CSS, and will choke badly if applied to a HTML buffer, to the point that the result is likely entirely unusable.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Likewise, HTML Tidy will choke on any template language elements in the buffer, and frequently so bad that the result is unusable as well.  In fact, Flycheck used to run HTML Tidy in Web Mode in the past, and &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/464#issuecomment-52606726&quot;&gt;I explicitly removed this feature&lt;/a&gt; because the results were generally very poor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presumably, you hope that you can somehow apply CSS Lint only to the CSS parts and HTML Tidy only to the HTML parts, but Flycheck does not support that, and quite likely never will.  It'd be a major effort to write and test such a feature, and it'd be very hard to get it right.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-06-24T07:19:47.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13394" PostTypeId="2" ParentId="13375" CreationDate="2015-06-24T08:44:10.627" Score="2" Body="&lt;p&gt;Some sources used by you like &lt;code&gt;helm-source-imenu&lt;/code&gt; and &lt;code&gt;helm-source-occur&lt;/code&gt; are in the &lt;code&gt;helm-sources-using-default-as-input&lt;/code&gt; list, so &lt;code&gt;helm&lt;/code&gt; will build result initially, so setting that list to nil temporarily should work, for example&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((helm-sources-using-default-as-input nil))&#xA;  (helm ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-06-24T08:44:10.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13396" PostTypeId="1" CreationDate="2015-06-24T11:35:55.087" Score="1" ViewCount="340" Body="&lt;p&gt;I am using hunspell 1.3.2 (on Windows) for spell checking, and I've been trying to make a personal dictionary. It works just fine, except the encoding is garbled. Whether I encode the personal dictionary in UTF-8 or ISO-8859-1 (I'm using the French dictionary as the main one, and it's encoded with that), words with accents are not recognized correctly (words without accents work just fine). What should I do to make it work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: it seems to work fine when I fire up hunspell in a terminal.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Even stranger: when I put in the personal dictionary a word containing a character not present in ISO-8859-1 (eg. &lt;code&gt;ć&lt;/code&gt;), then spell checking works for that word!&lt;/p&gt;&#xA;" OwnerUserId="8692" LastEditorUserId="8692" LastEditDate="2015-06-24T11:56:02.937" LastActivityDate="2015-06-24T11:56:02.937" Title="Hunspell: encoding of personal dictionary" Tags="|microsoft-windows|character-encoding|ispell|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13397" PostTypeId="1" CreationDate="2015-06-24T13:26:12.930" Score="1" ViewCount="137" Body="&lt;p&gt;Using &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot; rel=&quot;nofollow&quot;&gt;emacs-mac-port&lt;/a&gt;, and I'm trying to configure horizontal scrolling with the trackpad. The following expressions work if I execute them manually via eval-last-sexp,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [wheel-right] (lambda ()&#xA;                                 (interactive)&#xA;                                 (scroll-left 1)))&#xA;(global-set-key [wheel-left] (lambda ()&#xA;                                (interactive)&#xA;                                (scroll-right 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but having added them to my init file seems to have no effect. I start up emacs, type a line long enough to be truncated, try to scroll sideways and I have no horizontal scroll. If I open up my init file (~/.emacs.d/init.el) and execute the relevant expressions manually, I DO get horizontal scrolling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some investigation shows that at initial startup, wheel-right and wheel-left are both bound to mac-mwheel-scroll, an interactive compiled Lisp function in &lt;code&gt;Emacs.app/Contents/Resources/lisp/term/mac-win.el&lt;/code&gt; which &quot;parses switches controlling interface with Mac window system&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly, the mac-mwheel-scroll definition includes a comment: &lt;code&gt;TODO: horizontal scrolling&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I give the settings in my init file a higher precedence than what's being set in mac-win.el? I'm guessing mac-win.el is being read later in startup process and thus overriding my settings, but I'm not really sure about that.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2015-06-24T14:07:34.513" LastActivityDate="2015-06-24T14:07:34.513" Title="How can I prevent a setting in init.el from being overridden during startup?" Tags="|init-file|scrolling|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13398" PostTypeId="2" ParentId="13384" CreationDate="2015-06-24T13:51:29.570" Score="1" Body="&lt;p&gt;Have you tried the already defined shortcut?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c M-e&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It evaluates the form preceding point and outputs to REPL buffer. See other &lt;a href=&quot;https://github.com/clojure-emacs/cider#keyboard-shortcuts&quot; rel=&quot;nofollow&quot;&gt;cider mode shortcuts here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-24T13:51:29.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13399" PostTypeId="1" AcceptedAnswerId="13403" CreationDate="2015-06-24T13:51:29.727" Score="7" ViewCount="1631" Body="&lt;p&gt;I am new to emacs. I'm trying to use cask to manage emacs packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cask &quot;~/etsi/cask/cask.el&quot;)&#xA;(cask-initialize &quot;~/etsi&quot;)&#xA;&#xA;(require 'evil)&#xA;(evil-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/etsi/Cask&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(source &quot;melpa&quot; &quot;http://melpa.milkbox.net/packages/&quot;)&#xA;(source &quot;gnu&quot; &quot;http://elpa.gnu.org/packages/&quot;)&#xA;&#xA;(depends-on &quot;evil&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it does not seem to work. For example, whenever I open a file, there seems to be no evil mode. (Yes I add &lt;code&gt;cask&lt;/code&gt; binary to &lt;code&gt;$PATH&lt;/code&gt; and ran &lt;code&gt;cask install&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at other people's publicly available dotfiles, I see they use Cask too and do the same or similar things, so I'm not sure what I did wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried the following for &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(require 'cask &quot;~/etsi/cask/cask.el&quot;)&#xA;(package-initialize)&#xA;(cask-initialize &quot;~/etsi&quot;)&#xA;&#xA;(require 'evil)&#xA;(evil-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which also does not work.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Why?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Because I am new to emacs, perhaps I'm doing it wrong, and explaining what exactly I'm trying to achieve might bring forward a more straightforward solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of manually &lt;code&gt;M-x package-install RET &amp;lt;package-name&amp;gt; RET&lt;/code&gt; for each and every package, I want to simply put a list of them somewhere (in a text file), and have something automatically install them all (and take care of initalization). This is because I want to replicate my emacs setup across multiple machines, and obviously doing &lt;code&gt;M-x package-install RET &amp;lt;package-name&amp;gt; RET&lt;/code&gt; for &lt;em&gt;each package&lt;/em&gt; on &lt;em&gt;each machine&lt;/em&gt; is not desirable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought cask was the correct tool for this, since you can have a &lt;code&gt;Cask&lt;/code&gt; file to list your packages. And just use the &lt;code&gt;cask install&lt;/code&gt; command to install them. When I ran &lt;code&gt;cask install&lt;/code&gt;, it &lt;em&gt;did&lt;/em&gt; download and &quot;install&quot; (to &lt;code&gt;.cask&lt;/code&gt; directory) evil and its dependencies. But emacs does not seem to load it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried &lt;code&gt;(add-to-list 'load-path (cask-load-path ((cask-initialize &quot;~/etsi&quot;))))&lt;/code&gt; instead of &lt;code&gt;(cask-initialize &quot;~/etsi&quot;)&lt;/code&gt;, but that did not work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is el-get the right tool for the job instead? Reading the introductory documentation, it wasn't clear that it was, hence why I chose clask, because their documentation specifically said &quot;If you are using Cask for your &lt;strong&gt;Emacs configuration&lt;/strong&gt; [...]&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Maybe I'm checking for evil mode wrong? Is there a reliable way to check for the existence of a package, i.e. whether or not it has been loaded? I'm checking for evil by just pressing j, or searching for evil mode help with &lt;code&gt;C-h evil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8693" LastEditorUserId="8693" LastEditDate="2015-06-24T14:11:11.127" LastActivityDate="2015-06-24T14:51:12.427" Title="Using cask for package management" Tags="|elisp|package|evil|cask|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="13400" PostTypeId="2" ParentId="13173" CreationDate="2015-06-24T14:11:09.943" Score="2" Body="&lt;p&gt;With &lt;code&gt;helm-mode&lt;/code&gt; enabled, the ordinary &lt;code&gt;find-file&lt;/code&gt; command will use &lt;code&gt;helm-read-file-map&lt;/code&gt;, so you should use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-read-file-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;) #'backward-kill-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you are using helm, &lt;code&gt;helm-find-files&lt;/code&gt; provides more features than &lt;code&gt;find-file&lt;/code&gt; so you are suggested to use the former.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-06-24T14:11:09.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13401" PostTypeId="1" AcceptedAnswerId="13402" CreationDate="2015-06-24T14:30:49.623" Score="4" ViewCount="719" Body="&lt;p&gt;Hopefully a simple question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I code in c++ in emacs with a dark background and the syntax highlighting is perfect for viewing that way, however when I print on white paper, some of the colours like yellow/orange don't show well against the light background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried doing M-x invert-faces default in the buffer and then printing, but this has no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to select the word, do M-x customize-face, and change the foreground colour this way, which works, but I don't want to do this when I'm printing. It's variable names that I want to change the colour of but only when printing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to do it have a custom functions, which would temporarily change all variable names in that buffer to a different colour, print it, and then change them back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output of customize-buffer looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Editing a setting changes only the text in this buffer.&#xA;To apply your changes, use the Save or Set buttons.&#xA;Saving a change normally works by editing your init file.&#xA;For details, see [Saving Customizations] in the [Emacs manual].&#xA;&#xA;&#xA; Operate on all settings in this buffer that are not marked HIDDEN:&#xA; [Set for current session] [Save for future sessions]&#xA; [Undo edits] [Reset to saved] [Erase customizations]   [Exit]&#xA;&#xA;Font Lock Variable Name Face:(sample) [Hide Face]&#xA;   [State]: SAVED and set.&#xA;   Font Lock mode face used to highlight variable names.&#xA;Groups: [Font Lock Faces]&#xA;Choice: [Value Menu]&#xA; Attributes: [ ] Font Family: *&#xA;             [ ] Font Foundry: *&#xA;             [ ] Width: *&#xA;             [ ] Height: *&#xA;             [X] Weight: [Value Menu] light&#xA;             [ ] Slant: *&#xA;             [ ] Underline: *&#xA;             [ ] Overline: *&#xA;             [ ] Strike-through: *&#xA;             [ ] Box around text: *&#xA;             [ ] Inverse-video: *&#xA;             [X] Foreground: #FF8400    (sample)&#xA;             [ ] Background: *&#xA;             [ ] Stipple: *&#xA;             [ ] Inherit: *&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any thoughts on how to proceed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Joey&lt;/p&gt;&#xA;" OwnerUserId="2453" LastActivityDate="2022-02-16T15:59:49.963" Title="Change syntax highlighting when doing ps-print-buffer-with-faces" Tags="|syntax|highlighting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13402" PostTypeId="2" ParentId="13401" CreationDate="2015-06-24T14:49:56.573" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;ps-extend-face&lt;/code&gt; to tell ps-print to print using anther color.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(ps-extend-face FACE-EXTENSION &amp;amp;optional MERGE-P ALIST-SYM)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Extend face in ALIST-SYM.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If optional MERGE-P is non-nil, extensions in FACE-EXTENSION list are&#xA;  merged with face extensions in ALIST-SYM; otherwise, overrides.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If optional ALIST-SYM is nil, `ps-print-face-extension-alist' is used;&#xA;  otherwise, it should be an alist symbol.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The elements of FACE-EXTENSION list have the form:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(FACE-NAME FOREGROUND BACKGROUND EXTENSION...)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;FACE-NAME is a face name symbol.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;FOREGROUND and BACKGROUND may be nil or a string that denotes the&#xA;  foreground and background colors respectively.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;EXTENSION is one of the following symbols:    bold      - use bold&#xA;  font.    italic    - use italic font.    underline - put a line under&#xA;  text.    strikeout - like underline, but the line is in middle of&#xA;  text.    overline  - like underline, but the line is over the text.&lt;br&gt;&#xA;  shadow    - text will have a shadow.    box       - text will be&#xA;  surrounded by a box.    outline   - print characters as hollow&#xA;  outlines.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If EXTENSION is any other symbol, it is ignored.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example (from the file comments):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ps-extend-face '(font-lock-keyword-face &quot;RoyalBlue&quot; nil bold) 'MERGE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-06-24T14:49:56.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13403" PostTypeId="2" ParentId="13399" CreationDate="2015-06-24T14:51:12.427" Score="3" Body="&lt;p&gt;Here's how I do it: &lt;a href=&quot;https://github.com/abo-abo/oremacs/blob/github/packages.el&quot; rel=&quot;nofollow&quot;&gt;packages.el&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cite some code, it's nothing too complex:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;;; install required&#xA;(dolist (package ora-packages)&#xA;  (unless (package-installed-p package)&#xA;    (package-install package)))&#xA;;; upgrade installed&#xA;(save-window-excursion&#xA;  (package-list-packages t)&#xA;  (package-menu-mark-upgrades)&#xA;  (condition-case nil&#xA;      (package-menu-execute t)&#xA;    (error&#xA;     (package-menu-execute))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And how to use it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -batch -l packages.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's it, after this single shell command all packages from the&#xA;&lt;code&gt;ora-packages&lt;/code&gt; variable will be installed/upgraded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this tied into my Emacs startup, if I want to start Emacs with an upgrade, I type &lt;code&gt;make up&lt;/code&gt;.  To start without an upgrade, I type &lt;code&gt;make run&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-24T14:51:12.427" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13404" PostTypeId="1" AcceptedAnswerId="13405" CreationDate="2015-06-24T15:43:20.397" Score="4" ViewCount="17311" Body="&lt;p&gt;I want to escape a underscore in a filename with a backslash (&lt;code&gt;\&lt;/code&gt;). So &lt;code&gt;file_01.jpg&lt;/code&gt; would become &lt;code&gt;file\_01.jpg&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;_&quot; &quot;\_&quot;  &quot;file_01.jpg&quot; t t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that produces &lt;code&gt;file_01.jpg&lt;/code&gt;. And:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string &quot;_&quot; &quot;\\_&quot;  &quot;file_01.jpg&quot; t t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives &lt;code&gt;file\\_01.jpg&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I insert a single backslash?&lt;/p&gt;&#xA;" OwnerUserId="8694" LastEditorUserId="675" LastEditDate="2016-07-19T01:22:33.437" LastActivityDate="2016-07-19T01:22:33.437" Title="How to escape underscore in string" Tags="|regular-expressions|replace|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13405" PostTypeId="2" ParentId="13404" CreationDate="2015-06-24T15:49:13.467" Score="8" Body="&lt;p&gt;Your second example is actually correct.  The resulting string contains a single backslash; it looks like a double backslash because it's printed as an Emacs Lisp string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see this by converting the string into a list of one-character strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar 'string (replace-regexp-in-string &quot;_&quot; &quot;\\_&quot; &quot;file_01.jpg&quot; t t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;f&quot; &quot;i&quot; &quot;l&quot; &quot;e&quot; &quot;\\&quot; &quot;_&quot; &quot;0&quot; &quot;1&quot; &quot;.&quot; &quot;j&quot; &quot;p&quot; &quot;g&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;\\&quot;&lt;/code&gt; is a string with one character, a backslash. It is displayed with two backslashes because that's required by Emacs Lisp string syntax.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="11" LastEditDate="2015-06-24T16:05:53.107" LastActivityDate="2015-06-24T16:05:53.107" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13406" PostTypeId="1" AcceptedAnswerId="13564" CreationDate="2015-06-24T15:52:03.910" Score="4" ViewCount="1551" Body="&lt;p&gt;I am running GNU Emacs on Ubuntu, using a Swedish PC-keyboard. When I use &lt;code&gt;swedish-keyboard&lt;/code&gt; as my input method, shift-key combinations work fine (e.g. &lt;code&gt;S-7&lt;/code&gt; gives the '/' character). But I have found a few things that doesn't work properly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Alt Gr-combinations&lt;/strong&gt;: Alt Gr is interpreted as Meta-key, so when I press e.g. (Alt Gr + 7) I get &lt;code&gt;M-7&lt;/code&gt; instead of '{'. So I can't type '@','£','$','{','[',']','}','\' or '|' using &lt;code&gt;swedish-keyboard&lt;/code&gt;. Is there a way to separate Alt and Alt Gr-key such that Alt is Meta-key and Alt Gr can be used for extended character input?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Misplaced characters&lt;/strong&gt;: Pressing e.g. '&amp;lt;' on the keyboard produces a ';' character (shift+'&amp;lt;' gives ':'). Similarly, '§' gives '~', shift+'§' gives '^', '´' gives '§', shift+'´' gives '½', '¨' gives 'é', shift+'¨' gives 'É'. So there is no way to type '&amp;lt;','&gt;','´','`' or accented characters other than 'é' and 'É'.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there a way to solve these issues? The way I solve it now is simply to toggle between swedish and american input whenever I need to type any of the unaccessible characters in the swedish input mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I am a bit of a noob on Emacs, so carefully explained solutions are appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8689" LastActivityDate="2015-06-30T09:29:56.810" Title="Using Emacs with Swedish keyboard" Tags="|input-method|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13407" PostTypeId="1" AcceptedAnswerId="13411" CreationDate="2015-06-24T17:27:27.160" Score="3" ViewCount="94" Body="&lt;p&gt;Is it possible to combine the following two functions so that the combined function will work with the keyboard keys (e.g., &lt;code&gt;[return]&lt;/code&gt;) and &lt;em&gt;also&lt;/em&gt; work with the &lt;em&gt;mouse&lt;/em&gt; buttons?  If so, how please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background:  The functions are custom creations for an addition to dired-mode that propertizes the dired heading directory (i.e., the path at the top of the dired buffer) with links to open new dired buffers -- e.g., bredcrumbs -- &lt;a href=&quot;https://emacs.stackexchange.com/q/13354/2287&quot;&gt;Dired heading directory with text-properties to jump to parent directories&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dired-follow-link-with-mouse (event)&#xA;&quot;Follow the link in the dired directory heading, causing a new&#xA;dired buffer to be opened.&quot;&#xA;(interactive &quot;e&quot;)&#xA;  (mouse-set-point event)&#xA;  (let ((path (get-text-property (point) 'breadcrumb)))&#xA;    (dired path)))&#xA;&#xA;(defun dired-follow-link-without-mouse ()&#xA;&quot;Follow the link in the dired directory heading, causing a new&#xA;dired buffer to be opened.&quot;&#xA;(interactive)&#xA;  (let ((path (get-text-property (point) 'breadcrumb)))&#xA;    (dired path)))&#xA;&#xA;(defvar dired-mouse-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map [mouse-2] 'dired-follow-link-with-mouse)&#xA;    (define-key map [return] 'dired-follow-link-without-mouse)&#xA;    (define-key map [follow-link] 'mouse-face)&#xA;      map)&#xA;  &quot;Keymap for mouse when in `dired-mode'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-06-25T03:52:10.010" Title="A dual-purpose function for keyboard shortcut and mouse" Tags="|mouse|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13408" PostTypeId="2" ParentId="13128" CreationDate="2015-06-24T18:25:16.640" Score="13" Body="&lt;p&gt;The code below use a font-lock rule with a function instead of a regexp, the function search for occurrences of &lt;code&gt;$VAR&lt;/code&gt; but only when they are inside a double-quoted string. The function &lt;code&gt;(syntax-ppss)&lt;/code&gt; is used to determine this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The font-lock rule use the &lt;code&gt;prepend&lt;/code&gt; flag to add itself on top of the existing string highlighting. (Note that many packages use &lt;code&gt;t&lt;/code&gt; for this. Unfortunately, this overwrites all aspects of the existing highlighting. For example, using &lt;code&gt;prepend&lt;/code&gt; will retain a string background color (if there is one) while replacing the foreground color.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sh-script-extra-font-lock-is-in-double-quoted-string ()&#xA;  &quot;Non-nil if point in inside a double-quoted string.&quot;&#xA;  (let ((state (syntax-ppss)))&#xA;    (eq (nth 3 state) ?\&quot;)))&#xA;&#xA;(defun sh-script-extra-font-lock-match-var-in-double-quoted-string (limit)&#xA;  &quot;Search for variables in double-quoted strings.&quot;&#xA;  (let (res)&#xA;    (while&#xA;        (and (setq res&#xA;                   (re-search-forward&#xA;                    &quot;\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\)&quot;&#xA;                    limit t))&#xA;             (not (sh-script-extra-font-lock-is-in-double-quoted-string))))&#xA;    res))&#xA;&#xA;(defvar sh-script-extra-font-lock-keywords&#xA;  '((sh-script-extra-font-lock-match-var-in-double-quoted-string&#xA;     (2 font-lock-variable-name-face prepend))))&#xA;&#xA;(defun sh-script-extra-font-lock-activate ()&#xA;  (interactive)&#xA;  (font-lock-add-keywords nil sh-script-extra-font-lock-keywords)&#xA;  (if (fboundp 'font-lock-flush)&#xA;      (font-lock-flush)&#xA;    (when font-lock-mode&#xA;      (with-no-warnings&#xA;        (font-lock-fontify-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can call use this by adding the last function to a suitable hook, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'sh-mode-hook 'sh-script-extra-font-lock-activate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-06-24T18:25:16.640" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13409" PostTypeId="2" ParentId="13331" CreationDate="2015-06-24T18:33:23.017" Score="1" Body="&lt;p&gt;The following works for me:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start &lt;code&gt;emacs-w32 -Q&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Paste the following code into the &lt;code&gt;*scratch*&lt;/code&gt;-buffer:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (cua-mode)&#xA;  (global-set-key [S-drag-mouse-1] (lambda (click) (interactive &quot;e&quot;) (let (mouse-drag-copy-region) (mouse-set-region click))))&#xA;  (global-set-key [S-down-mouse-1] 'mouse-set-point))&#xA;&#xA;111&#xA;222&#xA;333&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Execute the &lt;code&gt;progn&lt;/code&gt;-form with &lt;kbd&gt;C-x C-e&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select the string &quot;111&quot; with &lt;code&gt;mouse-1&lt;/code&gt; (&lt;code&gt;down&lt;/code&gt; and &lt;code&gt;drag&lt;/code&gt;) and copy with &lt;kbd&gt;C-c&lt;/li&gt;&#xA;&lt;li&gt;Shift-select the string &quot;222&quot; with &lt;code&gt;S-down-mouse-1&lt;/code&gt; and &lt;code&gt;S-drag-mouse-1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Kill the shift-selected string with &lt;kbd&gt;del&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Insert the string &quot;111&quot; from the &lt;code&gt;kill-ring&lt;/code&gt; with the key &lt;kbd&gt;C-v&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If I execute &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;emacs-version&lt;/code&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-unknown-cygwin) of 2015-04-10 on desktop-new&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also works with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on toyol, modified by Debian&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, that &lt;kbd&gt;del&lt;/kbd&gt; runs &lt;code&gt;delete-forward-char&lt;/code&gt; while C-x&lt;/kbd&gt; runs indirectly &lt;code&gt;cua-cut-region&lt;/code&gt; which copies the cut text to &lt;code&gt;kill-ring&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;delete-forward-char&lt;/code&gt; &lt;strong&gt;deletes&lt;/strong&gt; the active region if the variable &lt;code&gt;delete-active-region&lt;/code&gt; is set to a non-nil value &lt;strong&gt;other than &lt;code&gt;'kill&lt;/code&gt;&lt;/strong&gt;. The standard setting is &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-06-24T20:43:43.880" LastActivityDate="2015-06-24T20:43:43.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13410" PostTypeId="2" ParentId="13406" CreationDate="2015-06-24T19:24:48.810" Score="0" Body="&lt;p&gt;I have a Portuguese keyboard but I use only use the English layout for editing in Emacs. My solution to write special characters is using digraphs. I myself use evil, so I do &lt;code&gt;C-k ' e&lt;/code&gt; to insert &lt;code&gt;é&lt;/code&gt;, for example. If you do not use evil, you could do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'digraph-map)&#xA;(global-set-key (kbd &quot;C-c d&quot;) digraph-map)&#xA;&#xA;(define-key digraph-map &quot;'e&quot; '(lambda () (interactive) (insert &quot;é&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-06-24T19:24:48.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13411" PostTypeId="2" ParentId="13407" CreationDate="2015-06-24T19:31:35.167" Score="3" Body="&lt;p&gt;Yes.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-follow-link-with-mouse (event)&#xA;&quot;Follow the link in the dired directory heading, causing a new&#xA;dired buffer to be opened.&quot;&#xA;  (interactive (list last-nonmenu-event))&#xA;  (run-hooks 'mouse-leave-buffer-hook)&#xA;  (with-current-buffer (window-buffer (posn-window (event-start event)))&#xA;    (let ((path  (get-text-property (posn-point (event-start event)) 'breadcrumb)))&#xA;      (dired path))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-25T03:52:10.010" LastActivityDate="2015-06-25T03:52:10.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13412" PostTypeId="2" ParentId="12122" CreationDate="2015-06-24T19:38:41.423" Score="5" Body="&lt;p&gt;I disabled the clipboard integration with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-select-enable-clipboard nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you should still be able to copy and paste using the + register of evil. If you still want to integrate with the clipboard without evil, you could use this function to paste:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun paste-from-clipboard ()&#xA;  (interactive)&#xA;  (setq x-select-enable-clipboard t)&#xA;  (yank)&#xA;  (setq x-select-enable-clipboard nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this one for copyping:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-to-clipboard()&#xA;  (interactive)&#xA;  (setq x-select-enable-clipboard t)&#xA;  (kill-ring-save (region-beginning) (region-end))&#xA;  (setq x-select-enable-clipboard nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then bind &lt;code&gt;copy-to-clipboard&lt;/code&gt; to &lt;code&gt;M-w&lt;/code&gt; and &lt;code&gt;paste-from-clipboard&lt;/code&gt; to &lt;code&gt;C-y&lt;/code&gt;, or other keybinding of your choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I'm running Archlinux. Can't say if this'll work on Windows.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-06-26T18:29:19.213" LastActivityDate="2015-06-26T18:29:19.213" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13413" PostTypeId="1" CreationDate="2015-06-24T20:43:11.523" Score="7" ViewCount="1200" Body="&lt;p&gt;I'm having difficulty getting &lt;code&gt;flyspell&lt;/code&gt; to accept a &lt;code&gt;personal dictionary&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file I have the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ispell-personal-dictionary &quot;~/.karpov_dic&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This .karpov_dic file only has a few words such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Orionis&#xA;Virginis&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The words are separated by &lt;code&gt;\n&lt;/code&gt; characters. There's only one word per line, which is how I have seen ispell/aspell  customized dictionaries so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, in Emacs, when I start&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x flyspell-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: The file &quot;/home/karpov/.karpov_dic is not in the proper format.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any clues?&lt;/p&gt;&#xA;" OwnerUserId="8588" LastActivityDate="2016-02-20T09:57:44.370" Title="The format of ispell personal dictionary" Tags="|ispell|flyspell|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13414" PostTypeId="2" ParentId="13354" CreationDate="2015-06-24T20:56:30.530" Score="2" Body="&lt;p&gt;I added a similar feature to &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dired+&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turn on minor mode &lt;code&gt;diredp-breadcrumbs-in-header-line-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This puts breadcrumbs on a separate optional header line for the whole Dired buffer, not on each directory header (e.g. each inserted subdir).  If you prefer the latter then see &lt;a href=&quot;https://emacs.stackexchange.com/a/13380/105&quot;&gt;lawlist's approach&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to turn it on automatically in all Dired buffers, you can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'dired-before-readin-hook 'diredp-breadcrumbs-in-header-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is the code I use:  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode diredp-breadcrumbs-in-header-line-mode&#xA;    &quot;Toggle the use of breadcrumbs in Dired header line.&#xA;    With arg, show breadcrumbs iff arg is positive.&quot;&#xA;  :init-value nil :group 'header-line :group 'Dired-Plus&#xA;  (unless (derived-mode-p 'dired-mode)&#xA;    (error &quot;You must be in Dired or a mode derived from it to use this command&quot;))&#xA;  (if diredp-breadcrumbs-in-header-line-mode&#xA;      (diredp-set-header-line-breadcrumbs)&#xA;    (setq header-line-format  (default-value 'header-line-format))))&#xA;&#xA;(defun diredp-set-header-line-breadcrumbs ()&#xA;  &quot;Show a header line with breadcrumbs to parent directories.&quot;&#xA;  (let ((parent  (diredp-parent-dir default-directory))&#xA;        (crumbs  ())&#xA;        (text    &quot;&quot;))&#xA;    (while parent&#xA;      (push parent crumbs)&#xA;      (setq parent  (diredp-parent-dir parent)))&#xA;    (dolist (dir  crumbs)&#xA;      (let ((crumbs-map  (make-sparse-keymap))&#xA;            (menu-map    (make-sparse-keymap &quot;Breadcrumbs in Header Line&quot;)))&#xA;        (when dir&#xA;          (setq dir  (propertize&#xA;                      dir&#xA;                      'local-map&#xA;                      (progn (define-key crumbs-map [header-line mouse-1]&#xA;                               `(lambda () (interactive)&#xA;                                   (dired ,dir dired-actual-switches)))&#xA;                             (define-key crumbs-map [header-line mouse-2]&#xA;                               `(lambda () (interactive)&#xA;                                   (dired-other-window ,dir dired-actual-switches)))&#xA;                             crumbs-map)&#xA;                      'mouse-face 'mode-line-highlight&#xA;                      'help-echo &quot;mouse-1: Dired; mouse-2: Dired in other window&quot;))&#xA;          (setq text  (concat text (if (diredp-root-directory-p dir) &quot;&quot; &quot;  &quot;) dir)))&#xA;        (make-local-variable 'header-line-format)&#xA;        (setq header-line-format  text)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-06-25T04:14:53.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13415" PostTypeId="2" ParentId="9630" CreationDate="2015-06-24T21:20:08.530" Score="1" Body="&lt;p&gt;In the following I assume that you are using auctex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remove the syntax descriptor for &lt;code&gt;?$&lt;/code&gt;  from &lt;code&gt;font-latex-syntax-alist&lt;/code&gt; after loading &quot;font-latex&quot; to avoid fontification of inline formulas delimited by &lt;code&gt;$&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when '(compile)&#xA;  (require 'cl))&#xA;&#xA;(eval-after-load &quot;font-latex&quot;&#xA;  '(setq font-latex-syntax-alist (cl-delete-if (lambda (pair) (eq (car pair) ?$)) font-latex-syntax-alist)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2015-06-24T21:20:08.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13416" PostTypeId="1" AcceptedAnswerId="13433" CreationDate="2015-06-24T22:10:08.360" Score="4" ViewCount="1762" Body="&lt;p&gt;I have the following definition in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-motion-state-map (kbd &quot;SPC j&quot;) #'evilem-motion-next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works if I want to do &lt;kbd&gt;d&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;j&lt;/kbd&gt;, but I'd like to be able to do &lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;d&lt;/kbd&gt;&lt;kbd&gt;j&lt;/kbd&gt; as well. (Here, &lt;kbd&gt;SPC&lt;/kbd&gt; is meant to take the place of the prefix argument or &quot;count&quot;, which can come in either location. see &lt;a href=&quot;https://github.com/PythonNut/evil-easymotion&quot; rel=&quot;nofollow noreferrer&quot;&gt;evil-easymotion&lt;/a&gt; for a description of its behavior).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The naive solution&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;SPC d&quot;) (kbd &quot;d SPC&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does not work for the same reason described in &lt;a href=&quot;https://emacs.stackexchange.com/questions/6037/emacs-bind-key-to-prefix&quot;&gt;Emacs bind key to prefix&lt;/a&gt;. The solution to that question doesn't work for me because there is no prefix command to bind to, as all commands are hidden behind &lt;code&gt;evil-delete&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-06-25T14:53:24.367" Title="Bind key to a prefix in evil" Tags="|evil|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13417" PostTypeId="1" CreationDate="2015-06-24T23:25:12.330" Score="0" ViewCount="194" Body="&lt;p&gt;By default, when a pattern that has been typed matches no results, after a short pause in typing &lt;code&gt;ido-find-file&lt;/code&gt; goes on to try to locate a matching file in one of recently visited directories (I believe, in the recent-first order).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, are there any ido features or extensions available to include a whole filesystem subtree, not only a list of visited directories, to the ido search? I understand this is tricky in general (what happens if I stop typing at &lt;code&gt;/&lt;/code&gt;?), but I am all for spending some time configuring this extension to do what I want. I am working on a project with a zillion directories, shell scripts calling scripts calling scripts. Even setting explicit fixed expansion points would be fine by me, for example, a rule to the effect &lt;em&gt;if you are at or below any directory in this configured list, expand all subdirectories of that directory for ido search&lt;/em&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;code&gt;helm&lt;/code&gt;, but I am interested how far I can go with &lt;code&gt;ido&lt;/code&gt;, before jumping into the learning of such a complex package.&lt;/p&gt;&#xA;" OwnerUserId="8543" LastActivityDate="2015-06-24T23:25:12.330" Title="Completing from filesystem search in ido-find-file" Tags="|ido|ido-find-file|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13418" PostTypeId="2" ParentId="13416" CreationDate="2015-06-24T23:38:18.893" Score="1" Body="&lt;p&gt;So you want &lt;code&gt;SPC&lt;/code&gt; to be a prefix key, which means binding it to a keymap. You want &lt;code&gt;d&lt;/code&gt; to be bound in that map, and you want it too to be a prefix key, which means that you want to bind &lt;code&gt;d&lt;/code&gt; to another keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see &lt;em&gt;why&lt;/em&gt; you would want to do this, but if that's what you want to do then that's one way to do it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'space-map)&#xA;(define-key evil-normal-state-map (kbd &quot;&amp;lt;SPC&amp;gt;&quot;) space-map)                                    &#xA;&#xA;(define-prefix-command 'space-d-map)&#xA;(define-key space-map &quot;d&quot; space-d-map)                                    &#xA;&#xA;(define-key space-d-map &quot;j&quot; 'evilem-motion-next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-24T23:38:18.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13419" PostTypeId="2" ParentId="10159" CreationDate="2015-06-25T03:10:24.070" Score="3" Body="&lt;p&gt;if you calculate R^2 by R within org-mode and Babel, it's very simple.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: My productivity and sleep&#xA;#+NAME: MY-TABLE&#xA;| Date    | sleep | productivity |&#xA;|---------+-------+--------------|&#xA;| ~[meh]~ |  7.50 |         4.00 |&#xA;| ~[meh]~ |  8.00 |         5.00 |&#xA;| ~[meh]~ |  8.50 |         6.00 |&#xA;| ~[meh]~ |  8.00 |         4.00 |&#xA;| ~[meh]~ |  8.20 |         5.00 |&#xA;| ~[meh]~ |  8.70 |         6.00 |&#xA;&#xA;#+BEGIN_SRC R :session *R* :results output :exports results :var TMP=MY-TABLE[,1:2]&#xA;summary(lm(TMP))$r.squared&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: [1] 0.8072626&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastActivityDate="2015-06-25T03:10:24.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13420" PostTypeId="1" AcceptedAnswerId="13421" CreationDate="2015-06-25T04:00:40.630" Score="1" ViewCount="440" Body="&lt;p&gt;I'm trying using &lt;code&gt;ipython&lt;/code&gt; in emacs. I installed &lt;code&gt;python-mode&lt;/code&gt; and config &lt;code&gt;ipython&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'python-mode)&#xA;; use IPython&#xA;(setq-default py-shell-name &quot;ipython&quot;)&#xA;(setq-default py-which-bufname &quot;IPython&quot;)&#xA;(setq py-force-py-shell-name-p t)&#xA;(setq py-python-command-args '(&quot;-colors&quot; &quot;Linux&quot;))&#xA;; switch to the interpreter after executing code&#xA;(setq py-shell-switch-buffers-on-execute-p t)&#xA;(setq py-switch-buffers-on-execute-p t)&#xA;; don't split windows&#xA;(setq py-split-windows-on-execute-p nil)&#xA;(add-hook 'python-mode-hook&#xA;  (lambda ()&#xA;    (local-set-key (kbd &quot;C-c i&quot;) 'py-shell)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I didn't call &lt;code&gt;ipython&lt;/code&gt; with &lt;code&gt;matplotlib&lt;/code&gt;, but when I tried &lt;code&gt;C-c i&lt;/code&gt; in emacs, I got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[TerminalIPythonApp] WARNING | Eventloop or matplotlib integration failed.&#xA;Is matplotlib installed?&#xA;---------------------------------------------------------------------------&#xA;ImportError                               Traceback (most recent call last)&#xA;....&#xA;ImportError: No module named matplotlib&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's the same error with running &lt;code&gt;ipython --matplotlib&lt;/code&gt;. I didn't install &lt;code&gt;matplotlib&lt;/code&gt; because I don't want to use it. So, I didn't set it in my config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why did &lt;code&gt;emacs&lt;/code&gt; still call &lt;code&gt;ipython&lt;/code&gt; with &lt;code&gt;matplotlib&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8701" LastActivityDate="2015-06-25T09:28:59.433" Title="emacs always calls ipython with matplotlib" Tags="|init-file|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13421" PostTypeId="2" ParentId="13420" CreationDate="2015-06-25T06:07:47.467" Score="1" Body="&lt;p&gt;IPython process reads &lt;code&gt;py-ipython-command-args&lt;/code&gt;, which check.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW &lt;code&gt;py-buffer-name&lt;/code&gt; is used as an internal variable, do not set it.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-06-25T09:28:59.433" LastActivityDate="2015-06-25T09:28:59.433" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13422" PostTypeId="2" ParentId="13404" CreationDate="2015-06-25T06:22:33.057" Score="0" Body="&lt;p&gt;Use &lt;code&gt;(replace-string &quot;_&quot; &quot;\\_&quot;)&lt;/code&gt;, maybe in combined &lt;code&gt;with-temp-buffer&lt;/code&gt; to put the string in.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-06-25T06:22:33.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13423" PostTypeId="1" AcceptedAnswerId="13424" CreationDate="2015-06-25T07:37:49.143" Score="4" ViewCount="788" Body="&lt;p&gt;I want to add/subtract two vectors, X and Y in Calc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I &lt;code&gt;calc&lt;/code&gt; &lt;strong&gt;constant numerics&lt;/strong&gt; within Org-mode source block, it's o.k.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC calc :session *Calculator*&#xA;[1,1] + [2,2] + [3,3]&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: [6, 6]&#xA;&#xA;#+BEGIN_SRC calc :session *Calculator*&#xA;[3,3] - [2,2] - [1,1]&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: [0, 0]&#xA;&#xA;#+BEGIN_SRC calc :session *Calculator*&#xA;[1,10,100] * [10,100,1000]&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 101010&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Applying Calc within Emacs Lisp source code block in Org-mode is o.k.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value scalar :exports both&#xA;(setq X '[1 2])&#xA;(setq Y '[3 4])&#xA;(calc-eval (format &quot;%s+%s&quot; X Y))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &quot;[4, 6]&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the other hands, If I try in Calc source block with &lt;strong&gt;variables&lt;/strong&gt; , it fails.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC calc :var X=[1 2], Y=[3 4]&#xA;X+Y&#xA;#+END_SRC&#xA;&#xA;# (wrong-type-argument number-or-marker-p [1 2])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add can be done strangely with further extra brackets,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC calc :var X=[1 2], Y=[3 4]&#xA;[X]+[Y]&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: [[4, 6]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but fails in subtraction.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC calc :var X=[1 2], Y=[3 4]&#xA;[X]-[Y]&#xA;#+END_SRC&#xA;# (wrong-type-argument number-or-marker-p [3 4])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I add/subtract vectors by Calc in Org-mode source code block ?&lt;/p&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2016-11-02T04:00:24.813" LastActivityDate="2016-11-02T04:00:24.813" Title="How can I add/subtract vectors by Calc in Org-mode?" Tags="|org-mode|calc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13424" PostTypeId="2" ParentId="13423" CreationDate="2015-06-25T08:22:15.033" Score="5" Body="&lt;p&gt;I'm not sure about the actual reason plus won't work the way you expect, but this is what Calc does when you add vectors interactively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC calc :var X=[1 2], Y=[3 4]&#xA;  map(add, X, Y)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result where you get &lt;code&gt;[[4, 6]]&lt;/code&gt; seems to indicate that Calc needs vectors to be 2D matrices with a single column, rather than 1D matrices.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-06-25T08:22:15.033" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13425" PostTypeId="2" ParentId="13416" CreationDate="2015-06-25T11:02:28.890" Score="1" Body="&lt;p&gt;Mmh. But &lt;code&gt;SPC&lt;/code&gt; in your example is &lt;em&gt;not&lt;/em&gt; like a counter. It rather acts as a leader key for &lt;code&gt;j&lt;/code&gt;: &lt;code&gt;SPC j&lt;/code&gt; becomes a new unit, a motion that does &quot;something related to &lt;code&gt;j&lt;/code&gt;, but more advanced&quot; (as a mnemonic), and is bound to &lt;code&gt;#'evilem-motion-next-line&lt;/code&gt;. And - you don't usually break a &lt;code&gt;leader-key&lt;/code&gt; combination in the same way you'd use a counter (what I'm saying is - I don't &lt;em&gt;expect&lt;/em&gt; a leader to work the same way a counter does).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, what you want (with vim grammar power) translates (for me) as:&lt;br&gt;&#xA; &quot;Create a different &lt;em&gt;operation&lt;/em&gt;, and map it to &lt;code&gt;SPC d&lt;/code&gt;&quot; - one that understands the &lt;code&gt;j&lt;/code&gt; motion (and others). If done properly, it can happen that &lt;code&gt;SPC d&lt;/code&gt; &lt;code&gt;j&lt;/code&gt; will do the same thing as &lt;code&gt;d&lt;/code&gt; &lt;code&gt;SPC j&lt;/code&gt; :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although, IMHO, the &quot;Vim way&quot; would be to have &lt;code&gt;SPC d&lt;/code&gt; &lt;code&gt;j&lt;/code&gt; perform &lt;em&gt;another&lt;/em&gt; operation. So that one can also type &lt;code&gt;SPC d&lt;/code&gt; &lt;code&gt;SPC j&lt;/code&gt; for example, with a meaningful result. So, instead of the redundancy (&lt;code&gt;SPC d&lt;/code&gt; &lt;code&gt;j&lt;/code&gt; = &lt;code&gt;d&lt;/code&gt; &lt;code&gt;SPC j&lt;/code&gt;), more functionality (&lt;code&gt;SPC d&lt;/code&gt; &lt;code&gt;j&lt;/code&gt; != &lt;code&gt;d&lt;/code&gt; &lt;code&gt;SPC j&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although, I think in Emacs you probably &lt;em&gt;can&lt;/em&gt; implement the leader key as a counter, since the counter is also a custom Evil implementation.&lt;/p&gt;&#xA;" OwnerUserId="8708" LastEditorUserId="8708" LastEditDate="2015-06-25T11:29:19.157" LastActivityDate="2015-06-25T11:29:19.157" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13426" PostTypeId="1" AcceptedAnswerId="13870" CreationDate="2015-06-25T11:55:17.920" Score="8" ViewCount="4243" Body="&lt;p&gt;I'm using using AUCTeX to write a IEEEtrans LaTeX document with a seperate BibTeX file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I recall I used to simply hit &lt;code&gt;C-c C-c&lt;/code&gt; (currently bound to &lt;code&gt;TeX-command-master&lt;/code&gt;) repeatedly until it said &quot;view&quot; in the minibuffer, and then AUCTeX would have taken care of running &lt;code&gt;pdflatex&lt;/code&gt; and &lt;code&gt;bibtex&lt;/code&gt; as needed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've now moved to a new machine - Still same OS (Linux Mint 17.1) and same &lt;code&gt;~/.emacs&lt;/code&gt; (I keep it on github, but rely on el-get for e.g. AUCTeX)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my surprise AUCTeX doesn't pick up changes in bibtex file, but simply runs LaTeX and then View. Any suggestions as to why it doesn't realize the need to run BibTeX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some details: &#xA;(Please ask if you need more)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;OS: Linux Mint 17.1 x64_64&lt;/li&gt;&#xA;&lt;li&gt;Emacs: GNU Emacs 24.3.1, from apt-get&lt;/li&gt;&#xA;&lt;li&gt;AUCTeX: from el-get, tag: release_11_88, commit: 5178ba6&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Files, after &lt;code&gt;Clean All&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.&#xA;├── bib&#xA;│   └── paper.bib&#xA;└── paper.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Files if I call &lt;code&gt;LaTeX&lt;/code&gt;, &lt;code&gt;BibTex&lt;/code&gt;, &lt;code&gt;LaTeX&lt;/code&gt;, &lt;code&gt;LaTeX&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.&#xA;├── bib&#xA;│   └── paper.bib&#xA;├── paper.aux&#xA;├── paper.bbl&#xA;├── paper.blg&#xA;├── paper.log&#xA;├── paper.pdf&#xA;└── paper.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Contents of &lt;code&gt;paper.tex&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[conference]{IEEEtran}&#xA;\begin{document}&#xA;\cite{ref}&#xA;\bibliographystyle{IEEEtran}&#xA;\bibliography{IEEEabrv,bib/paper}&#xA;\end{document}&#xA;&#xA;%%% Local Variables:&#xA;%%% mode: latex&#xA;%%% TeX-master: t&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Contents of &lt;code&gt;bib/paper.bib&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@electronic{ref,&#xA;  author        = &quot;Someone&quot;,&#xA;  title         = &quot;Sometitle&quot;,&#xA;  url           = &quot;http://test.com&quot;,&#xA;  year          = &quot;2000&quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8658" LastEditorUserId="8658" LastEditDate="2015-07-01T11:30:29.587" LastActivityDate="2015-07-10T08:19:19.990" Title="Auctex doesn't run bibtex" Tags="|auctex|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13427" PostTypeId="1" CreationDate="2015-06-25T11:58:33.760" Score="2" ViewCount="260" Body="&lt;p&gt;The following is a very common workflow for me &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open a dired buffer, and place cursor on a file.&lt;/li&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;M-x org-store-link&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Visit an org file (that's usually in the same directory), and type &lt;code&gt;C-c C-l RET&lt;/code&gt; to insert the link.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This way, org-mode inserts a link like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:some-file.org][file:~/Dropbox/Work/some-file.org]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which displays on the buffer like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:~/Dropbox/Work/some-file.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems silly that org would use a relative file name for the link's&#xA;address, but use a long absolute file name for the human-readable description.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to change this automatically created description, so that&#xA;it always shows &lt;strong&gt;just&lt;/strong&gt; the file name (no directories). In the&#xA;example above it would look like &lt;code&gt;some-file.org&lt;/code&gt; or perhaps&#xA;&lt;code&gt;file:some-file.org&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;How can I customize the automatic description of links inserted with &lt;code&gt;C-c C-l RET&lt;/code&gt;?&lt;/h3&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-06-25T13:51:22.090" LastActivityDate="2015-06-25T13:51:22.090" Title="Changing the default description for org-mode file links" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ClosedDate="2015-06-25T14:49:59.880" ContentLicense="CC BY-SA 3.0" />
  <row Id="13428" PostTypeId="2" ParentId="13427" CreationDate="2015-06-25T12:06:24.510" Score="2" Body="&lt;p&gt;The recommended workflow is the use &lt;kbd&gt;C-u C-c C-l&lt;/kbd&gt; to insert a file link. That one will be relative to the current directory if possible.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-25T12:06:24.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13429" PostTypeId="1" AcceptedAnswerId="13434" CreationDate="2015-06-25T13:02:51.580" Score="3" ViewCount="601" Body="&lt;p&gt;I am trying to highlight particular chars for use in C++ in emacs. I have found the package &lt;a href=&quot;http://melpa.org/#/highlight-chars&quot; rel=&quot;nofollow&quot;&gt;highlight-chars&lt;/a&gt; works very easily. I can use &lt;code&gt;hc-highlight-chars&lt;/code&gt; command, it then prompts me for a set of chars and then asks for a face. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it expires when I restart emacs. I am very new to emacs so I can't figure out a way to achieve this permanently. Maybe some command I can put in &lt;code&gt;.emacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8709" LastActivityDate="2015-06-25T14:45:03.670" Title="highlight-chars permanently" Tags="|syntax-highlighting|highlight-chars|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13430" PostTypeId="1" CreationDate="2015-06-25T13:07:49.400" Score="2" ViewCount="264" Body="&lt;p&gt;I discovered a short time ago that &lt;a href=&quot;https://tex.stackexchange.com/a/252032/17423&quot;&gt;&lt;code&gt;M-x imenu&lt;/code&gt; plays nice with LaTeX documents&lt;/a&gt; – &lt;em&gt;mostly&lt;/em&gt;.  With a master/slave document setup (one file inputs another), &lt;code&gt;imenu&lt;/code&gt; will not pick up on the structural elements in the child documents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, running &lt;code&gt;M-x imenu&lt;/code&gt; on the child document will not pick up on the rest of the document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both of these are &lt;em&gt;understandable&lt;/em&gt;, but how can &lt;code&gt;imenu&lt;/code&gt; be extended to 'do the right thing' here?  (Probably making use of &lt;code&gt;TeX-master-file&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am using AucTeX, but RefTeX is a bit too heavy-weight for my needs.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2015-06-25T13:30:03.330" Title="How can I make imenu work with complex LaTeX documents?" Tags="|latex|auctex|imenu|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13431" PostTypeId="2" ParentId="13430" CreationDate="2015-06-25T13:30:03.330" Score="2" Body="&lt;p&gt;The 3rd party packages imenu-anywhere and helm-imenu provide an imenu over all buffers of the same mode, which will bring you pretty close to a whole-document imenu, provided that you have all parts of the document open in buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a proper whole document menu, though specifically one that preserves the hierarchy, &#xA;there's no way other than RefTex. Personally, I think that AUCTeX is no fun without RefTex, and would strongly recommend you to look at it again.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-06-25T13:30:03.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13432" PostTypeId="2" ParentId="6037" CreationDate="2015-06-25T13:32:39.890" Score="4" Body="&lt;p&gt;For completeness, here's an alternative to Drew's answer. It may or may not be completely equivalent.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun simulate-key-press (key)&#xA;  &quot;Pretend that KEY was pressed.&#xA;KEY must be given in `kbd' notation.&quot;&#xA;  `(lambda () (interactive)&#xA;     (setq prefix-arg current-prefix-arg)&#xA;     (setq unread-command-events (listify-key-sequence (read-kbd-macro ,key)))))&#xA;&#xA;(global-set-key (kbd &quot;C-x C-x&quot;) (simulate-key-press &quot;C-c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-06-25T13:32:39.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13433" PostTypeId="2" ParentId="13416" CreationDate="2015-06-25T13:35:36.597" Score="4" Body="&lt;p&gt;Try the following, not sure if it will work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun simulate-key-press (key)&#xA;  &quot;Return a command that pretends KEY was presssed.&#xA;KEY must be given in `kbd' notation.&quot;&#xA;  `(lambda () (interactive)&#xA;     (setq prefix-arg current-prefix-arg)&#xA;     (setq unread-command-events (listify-key-sequence (read-kbd-macro ,key)))))&#xA;&#xA;(define-key evil-normal-state-map (kbd &quot;SPC d&quot;) (simulate-key-press &quot;d SPC&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-06-25T14:53:24.367" LastActivityDate="2015-06-25T14:53:24.367" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13434" PostTypeId="2" ParentId="13429" CreationDate="2015-06-25T13:41:50.360" Score="3" Body="&lt;p&gt;You can use the &lt;a href=&quot;https://github.com/boyw165/hl-anything&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;hl-anything&lt;/code&gt;&lt;/a&gt; package (also available on Melpa) to get persistent highlights.&lt;/p&gt;&#xA;&lt;p&gt;From its github page,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Once hl-highlight-mode is on, it will save highlights automatically before Emacs exits. It will also try to restore highlights when Emacs opens.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x hl-save-highlights&lt;/code&gt; to save highlights; &lt;code&gt;M-x hl-restore-highlights&lt;/code&gt; to restore highlights.&lt;/p&gt;&#xA;&lt;p&gt;Saved file-path is stored in &lt;code&gt;hl-highlight-save-file&lt;/code&gt; variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Check out the rest of the &lt;a href=&quot;https://github.com/boyw165/hl-anything/blob/master/README.md&quot; rel=&quot;nofollow noreferrer&quot;&gt;README&lt;/a&gt; for more details, including gifs and screenshots.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-06-25T13:41:50.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13435" PostTypeId="2" ParentId="10370" CreationDate="2015-06-25T13:43:57.480" Score="1" Body="&lt;p&gt;This is a bad temporal solution, but it seems to be faster.&#xA;There must be a better solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ADDED: an important hline at the #+RESULTS output table)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: TABLE-CUM&#xA;| students | F(students) |&#xA;|----------+-------------|&#xA;|       15 |             |&#xA;|       30 |             |&#xA;|       40 |             |&#xA;|       60 |             |&#xA;|       15 |             |&#xA;#+TBLFM: &#xA;&#xA;&#xA;#+BEGIN_SRC emacs-lisp :results value :exports results :var TMP=TABLE-CUM&#xA;(require 'cl)&#xA;(setq LST (cddr TMP))                     ;; import data to list LST excluding column names and hline.&#xA;(setq VEC (apply #'mapcar* #'vector LST)) ;; transpose and change to vector VEC for function aref and aset&#xA;(setq X (first VEC))                      ;; data vector&#xA;(setq CUM (vconcat X))                    ;; temporary initial vector for cummultive sum; vconcat is required.&#xA;&#xA;(dotimes (i (1- (length X)))&#xA;  (setq j (1+ i))&#xA;  (aset CUM j (+ (aref CUM (- j 1)) (aref X j))))&#xA;&#xA;(setq TABLE-CUM-OUT1 (list (append X nil) (append CUM nil)))&#xA;(setq TABLE-CUM-OUT2 (apply #'mapcar* #'list TABLE-CUM-OUT1))&#xA;(append '((&quot;students&quot; &quot;F(students)&quot;)) '(hline) TABLE-CUM-OUT2)&#xA;#+END_SRC&#xA;&#xA;#+NAME: RESULT-TABLE-EMACS-LISP&#xA;#+RESULTS:&#xA;| students | F(students) |&#xA;|----------+-------------|&#xA;|       15 |          15 |&#xA;|       30 |          45 |&#xA;|       40 |          85 |&#xA;|       60 |         145 |&#xA;|       15 |         160 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-06-25T19:16:29.760" LastActivityDate="2015-06-25T19:16:29.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13436" PostTypeId="1" AcceptedAnswerId="13470" CreationDate="2015-06-25T13:56:00.493" Score="1" ViewCount="321" Body="&lt;p&gt;How do I wrap around and start from the beginning when I have reached the end of items in a helm buffer?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="4036" LastEditDate="2015-06-27T15:34:49.707" LastActivityDate="2015-06-27T16:01:31.587" Title="How to enable circular scroll in emacs helm" Tags="|helm|scrolling|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13437" PostTypeId="2" ParentId="13429" CreationDate="2015-06-25T14:03:55.270" Score="2" Body="&lt;p&gt;First, just what do you mean by &quot;&lt;em&gt;permanently&lt;/em&gt;&quot;? There are two approaches to making highlighting permanent (persistent), depending on what you mean/need.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Whenever the given file is opened, even in a new session, make Emacs rehighlight as it did before.  For this, you need to apply the same settings (e.g. use the same commands) whenever that file is opened. You can do this by defining a mode (or even a file handler) that does all the character the highlighting you want, and then associate that mode with the file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A little-used Emacs feature, which does not always play well with some other features, is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Enriched-Text.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Enriched&lt;/strong&gt; mode&lt;/a&gt;.  It allows you to highlight text and save the highlighting as part of the text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;However&lt;/strong&gt;, enriched mode does not work at all with font-lock highlighting. Font-lock interferes with it.  And library &lt;code&gt;highlight-chars.el&lt;/code&gt; uses font-lock to effect its highlighting.  So it is &lt;em&gt;not possible to use enriched mode to save its highlighting&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You &lt;em&gt;can&lt;/em&gt; use enriched mode with highlighting that you create using library &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt;, but not with highlighting that you create using library &lt;code&gt;highlight-chars.el&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So the answer is #1: set things up so that whenever that particular file is opened (e.g. in a future session) the character highlighting that you need is automatically performed again.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-25T14:45:03.670" LastActivityDate="2015-06-25T14:45:03.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13438" PostTypeId="2" ParentId="13292" CreationDate="2015-06-25T14:28:04.690" Score="2" Body="&lt;p&gt;I suppose you have to convert your XLS to CSV first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to avoid importing several CSV's to Org-mode, everytime manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggestion is similar to @erikstokes with org-table-import,&#xA;but within #+BEGIN_SRC emacs-lisp source block.&#xA;It's a very efficient way dealing with C-c C-v C-b (org-babel-execute-buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also include column names in CSV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here is `tmp.csv' in the same directory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;v1 id,v2 size,v3 width,v4,v5&#xA;1,2,3,4,5&#xA;2,2,3,4,5&#xA;3,2,3,4,5&#xA;4,2,3,4,5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is Org-mode Emacs-Lisp source code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value :exports both&#xA;(with-temp-buffer&#xA; (org-table-import &quot;tmp.csv&quot; nil) ;; MEMO on `nil' arg is in the footnotes.&#xA; (setq LST (org-table-to-lisp))&#xA; ;; comment out or cut below one line if you don't have column names in CSV file.&#xA; (append (list (car LST)) '(hline) (cdr (org-table-to-lisp)))&#xA; )&#xA;#+END_SRC&#xA;&#xA;#+NAME: TABLENAME-HERE-FOR-FURTHER-REUSE&#xA;#+RESULTS:&#xA;| v1 id | v2 size | v3 width | v4 | v5 |&#xA;|-------+---------+----------+----+----|&#xA;|     1 |       2 |        3 |  4 |  5 |&#xA;|     2 |       2 |        3 |  4 |  5 |&#xA;|     3 |       2 |        3 |  4 |  5 |&#xA;|     4 |       2 |        3 |  4 |  5 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a good simple contents on importing CSV with Org-mode Babel: titled &quot;Reading and writing files&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/plain/doc/library-of-babel.org&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/cgit.cgi/org-mode.git/plain/doc/library-of-babel.org&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Footenotes on nil arg from `org-table.el':&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;SEPARATOR specifies the field separator in the lines.&#xA;It can have the following values:&lt;/li&gt;&#xA;&lt;li&gt;'(4)     Use the comma as a field separator&lt;/li&gt;&#xA;&lt;li&gt;'(16)    Use a TAB as field separator&lt;/li&gt;&#xA;&lt;li&gt;integer  When a number, use that many spaces as field separator&lt;/li&gt;&#xA;&lt;li&gt;nil      When nil, the command tries to be smart and figure out the separator in the following way:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;when each line contains a TAB, assume TAB-separated material&lt;/li&gt;&#xA;&lt;li&gt;when each line contains a comma, assume CSV material&lt;/li&gt;&#xA;&lt;li&gt;else, assume one or more SPACE characters as separator.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I thank you for the comments of @Sean Allred, for the simplification and on the efficiency of process.&lt;/p&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-06-26T02:11:39.200" LastActivityDate="2015-06-26T02:11:39.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13440" PostTypeId="1" CreationDate="2015-06-25T15:50:06.793" Score="3" ViewCount="337" Body="&lt;p&gt;I'd like to customize &lt;code&gt;helm-mini&lt;/code&gt; in such a way that its &lt;code&gt;helm-source-buffers-list&lt;/code&gt; would be decomposed in two parts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;One source corresponding to buffers visiting a file (i.e. something like &lt;code&gt;(remove-if-not #'buffer-file-name (buffer-list))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another corresponding to the complement of (1) (i.e. &lt;code&gt;(remove-if #'buffer-file-name (buffer-list))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I looked at tutorials like this one which gives me an idea of how I could probably do it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2015/01/24/Anatomy-of-a-helm-source/&quot; rel=&quot;nofollow&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2015/01/24/Anatomy-of-a-helm-source/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I'm too new to Helm to imagine that whatever solution I will come up with will make complete sense or be minimal enough.. so I'd appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="2807" LastActivityDate="2016-10-10T16:22:02.947" Title="Decomposing helm-source-buffers-list in two parts" Tags="|helm|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13441" PostTypeId="2" ParentId="13340" CreationDate="2015-06-25T18:04:32.400" Score="2" Body="&lt;p&gt;Elpy knows of two &quot;roots&quot; for your directory, the &quot;project root&quot; and the &quot;library root&quot;. The project root is used for file searches and similar, while the library root is the directory added to &lt;code&gt;sys.path&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, &lt;code&gt;my_project/&lt;/code&gt; should be the project root, while &lt;code&gt;my_project/src/&lt;/code&gt; should be the library root. You can verify this using &lt;code&gt;M-: (elpy-project-root)&lt;/code&gt; and &lt;code&gt;M-: (elpy-library-root)&lt;/code&gt; in a Python file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you opened a file in &lt;code&gt;test/&lt;/code&gt;. For files in there, Elpy will find &lt;code&gt;my_project/test/&lt;/code&gt; as the library root, as it does not know about &lt;code&gt;src/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your best option is to use virtualenvwrapper's &lt;code&gt;add2virtualenv&lt;/code&gt; tool to add your project – &lt;code&gt;my_project/src/&lt;/code&gt; – to your virtauelvn's library path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps :-)&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2015-06-25T18:04:32.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13443" PostTypeId="1" CreationDate="2015-06-25T18:59:15.393" Score="1" ViewCount="1625" Body="&lt;p&gt;I'm using flake8 with emacs. If I begin a file with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# comment comment comment comment comment comment comment comment comment comment&#xA;class Foo(object):&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It says there is no syntax error. But if I wrap it to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# comment comment comment comment comment comment comment comment&#xA;# comment comment&#xA;class Foo(object):&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get &quot;E302 expected 2 blank lines, found 0&quot; for the &quot;class&quot; line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug? Can it be fixed with a config setting?&lt;/p&gt;&#xA;" OwnerUserId="8293" LastActivityDate="2015-07-07T03:43:03.157" Title="how to fix: flake8/pyflakes treats multiline comment before class as error" Tags="|python|" AnswerCount="1" CommentCount="2" ClosedDate="2015-07-09T23:43:23.587" ContentLicense="CC BY-SA 3.0" />
  <row Id="13444" PostTypeId="1" CreationDate="2015-06-25T19:07:23.410" Score="0" ViewCount="226" Body="&lt;p&gt;I installed elscreen through melpa &amp;amp; it works if I open the emacs and type &lt;code&gt;M-x elscreen-start&lt;/code&gt;. &lt;strong&gt;How to start the elscreen automatically?&lt;/strong&gt; &lt;code&gt;(require 'elscreen)&lt;/code&gt; in .emacs does NOT automatically start the elscreen option.&lt;/p&gt;&#xA;" OwnerUserId="8683" LastEditorUserId="262" LastEditDate="2019-05-01T19:39:27.427" LastActivityDate="2019-05-01T19:39:27.427" Title="elscreen on startup" Tags="|elscreen|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13446" PostTypeId="2" ParentId="13185" CreationDate="2015-06-25T19:58:41.017" Score="1" Body="&lt;p&gt;I am now happy with this setting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/backspace()&#xA;  (interactive)&#xA;  (if (string-match &quot;[^[:space:]]+&quot;&#xA;                    (buffer-substring-no-properties&#xA;     (line-beginning-position) (point))) ;; return nil no match&#xA;      (backward-kill-word 1)(evil-shift-left-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastActivityDate="2015-06-25T19:58:41.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13447" PostTypeId="1" AcceptedAnswerId="13450" CreationDate="2015-06-25T20:06:16.430" Score="2" ViewCount="832" Body="&lt;p&gt;Suppose we have 3 mode, one such rule is like key map for mode 1 should always come before mode 2, and mode 3 should always come before mode 1, finally mode 3 should always come before other minor mode. Is there a easy way to do it? How is the order determined in emacs? Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-09-22T15:52:11.650" LastActivityDate="2016-09-22T15:52:11.650" Title="How to set a rule for the order of minor-mode-map-alist" Tags="|minor-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13448" PostTypeId="2" ParentId="13185" CreationDate="2015-06-25T20:20:49.470" Score="6" Body="&lt;p&gt;Interestingly, you can try binding the &lt;code&gt;deletechar&lt;/code&gt; &lt;a href=&quot;http://emacswiki.org/emacs/EmacsKeyNotation&quot; rel=&quot;noreferrer&quot;&gt;pseudo key&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I check the binding of &lt;kbd&gt;backspace&lt;/kbd&gt; on my machine with &lt;code&gt;C-h k [backspace]&lt;/code&gt;, I get:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;DEL&lt;/code&gt; (translated from &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt;) runs the command... (blah blah blah)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I check the binding of &lt;kbd&gt;shift&lt;/kbd&gt; + &lt;kbd&gt;backspace&lt;/kbd&gt; on my machine with &lt;code&gt;C-h k S-[backspace]&lt;/code&gt;, I get:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;&amp;lt;deletechar&amp;gt;&lt;/code&gt; (translated from &lt;code&gt;&amp;lt;delete&amp;gt;&lt;/code&gt;) runs the command... (blah blah blah)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The following therefore works on my machine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [deletechar] #'evil-shift-left-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-25T20:20:49.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13450" PostTypeId="2" ParentId="13447" CreationDate="2015-06-25T20:57:37.760" Score="3" Body="&lt;p&gt;For a minor mode &lt;em&gt;MY-MINOR-MODE&lt;/em&gt;, you can make the bindings of that mode override ALL others (major and minor modes) by advising &lt;code&gt;load&lt;/code&gt; as below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice load (after give-my-keybindings-priority)&#xA;  &quot;Try to ensure that my keybindings always have priority.&quot;&#xA;  (when (not (eq (car (car minor-mode-map-alist)) 'MY-MINOR-MODE))&#xA;      (let ((mykeys (assq 'MY-MINOR-MODE minor-mode-map-alist)))&#xA;        (assq-delete-all 'MY-MINOR-MODE minor-mode-map-alist)&#xA;        (add-to-list 'minor-mode-map-alist mykeys))))&#xA;(ad-activate 'load)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/5340797/1219634&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So if you want &lt;em&gt;MINOR-MODE-A&lt;/em&gt; at the highest priority followed by &lt;em&gt;MINOR-MODE-B&lt;/em&gt;, followed by &lt;em&gt;MINOR-MODE-C&lt;/em&gt;, you would do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice load (after give-my-keybindings-priority)&#xA;  &quot;Try to ensure that the keymap priorities are in the following order:&#xA; MINOR-MODE-A &amp;gt; MINOR-MODE-B &amp;gt; MINOR-MODE-C.&quot;&#xA;  (when (not (eq (car (car minor-mode-map-alist)) 'MINOR-MODE-C))&#xA;    (let ((mykeys (assq 'MINOR-MODE-C minor-mode-map-alist)))&#xA;      (assq-delete-all 'MINOR-MODE-C minor-mode-map-alist)&#xA;      (add-to-list 'minor-mode-map-alist mykeys)))&#xA;&#xA;  (when (not (eq (car (car minor-mode-map-alist)) 'MINOR-MODE-B))&#xA;    (let ((mykeys (assq 'MINOR-MODE-B minor-mode-map-alist)))&#xA;      (assq-delete-all 'MINOR-MODE-B minor-mode-map-alist)&#xA;      (add-to-list 'minor-mode-map-alist mykeys)))&#xA;&#xA;  ;; `when' block for the highest priority minor mode put at the very last &#xA;  (when (not (eq (car (car minor-mode-map-alist)) 'MINOR-MODE-A))&#xA;    (let ((mykeys (assq 'MINOR-MODE-A minor-mode-map-alist)))&#xA;      (assq-delete-all 'MINOR-MODE-A minor-mode-map-alist)&#xA;      (add-to-list 'minor-mode-map-alist mykeys))))&#xA;(ad-activate 'load)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-06-25T21:03:22.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13451" PostTypeId="1" AcceptedAnswerId="16888" CreationDate="2015-06-25T21:01:00.480" Score="4" ViewCount="535" Body="&lt;p&gt;I know I can &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/calc.html#Yanking-Into-Stack&quot; rel=&quot;nofollow&quot;&gt;yank into the stack&lt;/a&gt; in &lt;code&gt;calc&lt;/code&gt; using &lt;code&gt;C-y&lt;/code&gt;.  However, it seems that &lt;code&gt;calc&lt;/code&gt; automatically assumes that I'm yanking in a base-10 number.  If I try to specify a radix (like &lt;code&gt;16#&lt;/code&gt; for hex) before yanking and &lt;em&gt;then&lt;/em&gt; pressing &lt;code&gt;C-y&lt;/code&gt; I get the error message &lt;code&gt;[Bad format]&lt;/code&gt; from &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/671974ef79012c8123182a0990c6d5580f53311a/lisp/calc/calc.el#L2367&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(calcDigit-nondigit)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I actually prefix my killed text with &lt;code&gt;16#&lt;/code&gt; then it works, but that's a little tedious.  Is there any way to tell &lt;code&gt;calc&lt;/code&gt; &quot;hey, I'm about to yank a number of base &lt;code&gt;n&lt;/code&gt;&quot;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Concrete examples:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;(1) yank a hex number with hex set as &lt;code&gt;calc&lt;/code&gt;'s default radix &lt;em&gt;(doesn't work)&lt;/em&gt;&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Kill the following text: &lt;code&gt;deadbeef&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Switch to a &lt;code&gt;calc&lt;/code&gt; buffer&lt;/li&gt;&#xA;&lt;li&gt;Make hex the default radix with &lt;code&gt;d 6&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;C-y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;(2) yank a hex number, with radix prefix typed into calc minibuffer &lt;em&gt;(doesn't work)&lt;/em&gt;&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Kill the following text: &lt;code&gt;deadbeef&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Switch to a &lt;code&gt;calc&lt;/code&gt; buffer&lt;/li&gt;&#xA;&lt;li&gt;Tell &lt;code&gt;calc&lt;/code&gt; that we're about to enter a hex number by typing &lt;code&gt;16#&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;C-y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;(3) yank a hex number along with the necessary &lt;code&gt;calc&lt;/code&gt; radix prefix &lt;em&gt;(works)&lt;/em&gt;&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Kill the following text: &lt;code&gt;16#deadbeef&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Switch to a &lt;code&gt;calc&lt;/code&gt; buffer&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;C-y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(3) works, but I'd like to get either (1) or (2) working.  If (3) is the only option I guess I'll write my own function to prepend my last kill with a &lt;code&gt;calc&lt;/code&gt; radix prefix...&lt;/p&gt;&#xA;" OwnerUserId="573" LastActivityDate="2015-10-12T13:34:42.187" Title="calc: how to specify radix while yanking" Tags="|calc|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13452" PostTypeId="1" AcceptedAnswerId="13454" CreationDate="2015-06-25T22:59:09.407" Score="8" ViewCount="479" Body="&lt;p&gt;What is a good way to assign a function to run when I open any file in a specified directory? Just like a hook but based on the location of a file rather than a major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be nice if I could enable this by having a special file in the directory, but adding the hook in my central config file would be good too.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2015-06-27T04:19:07.563" Title="What's a good way to have a hook that runs for every file in a given directory?" Tags="|hooks|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13453" PostTypeId="2" ParentId="13451" CreationDate="2015-06-25T23:02:12.577" Score="0" Body="&lt;p&gt;You ask:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Is there any way to tell calc &quot;hey, I'm about to yank a number of base n&quot;?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately no. In the Calc manual I found this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Numbers are not stored with any particular radix attached. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, you could try storing and yanking from registers. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r i (calc-insert-register)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-25T23:02:12.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13454" PostTypeId="2" ParentId="13452" CreationDate="2015-06-25T23:10:01.890" Score="7" Body="&lt;p&gt;&lt;code&gt;find-file-hook&lt;/code&gt;, and in your hook function, check whether the candidate file is in the given directory.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-25T23:10:01.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13455" PostTypeId="1" AcceptedAnswerId="13469" CreationDate="2015-06-25T23:30:30.713" Score="2" ViewCount="1585" Body="&lt;p&gt;I want to have a solid line seperating the line numbers from the text in linum mode. I have tried following this guide and have this code in my .emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/LineNumbers#toc8&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/LineNumbers#toc8&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;If you want a solid line separator, try something like this:&#xA;(setq linum-format &quot;%4d \u2502 &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the end result being.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/R5v20.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am not mistaken that is not a solid line it is a bunch of aligned bars. I want a solid grey line with specified thickness if that is possible.&lt;/p&gt;&#xA;" OwnerUserId="8713" LastEditorUserId="675" LastEditDate="2015-06-26T16:03:13.447" LastActivityDate="2015-06-26T16:03:13.447" Title="How to make a solid line seperator in linum mode?" Tags="|init-file|linum-mode|" AnswerCount="1" CommentCount="2" ClosedDate="2015-06-27T07:24:09.353" ContentLicense="CC BY-SA 3.0" />
  <row Id="13456" PostTypeId="1" CreationDate="2015-06-25T23:49:10.540" Score="3" ViewCount="1182" Body="&lt;p&gt;Basically, I am trying to have a good python development environment for sckit image and sklearn. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it seems to me the python version that runs in the emacs environment is different than the one in the system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/J17A1.png&quot; alt=&quot;Python Shell in Emacs&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/nvhgH.png&quot; alt=&quot;Python Shell in OS Terminal&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main issue being certain libraries seem to be missing from the version on emacs when running this code &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from skimage.viewer import ImageViewer&#xA;image = data.coins()&#xA;viewer = ImageViewer(image)&#xA;viewer.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get these errors.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;  File &quot;/Users/mods/Work/DR_Research/sample/imageProc.py&quot;, line 9, in &amp;lt;module&amp;gt;&#xA;    viewer = ImageViewer(image)&#xA;  File &quot;/Library/Python/2.7/site-packages/skimage/viewer/viewers/core.py&quot;, line 194, in __init__&#xA;    init_qtapp()&#xA;  File &quot;/Library/Python/2.7/site-packages/skimage/viewer/utils/core.py&quot;, line 29, in init_qtapp&#xA;    QApp = QtWidgets.QApplication.instance()&#xA;AttributeError: 'QtGui_cls' object has no attribute 'QApplication'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried setting all sorts of variables from in the init-file py-shell interpreter, py-shell command, python-python command. I have tried appending the $PATH. All to no avail always the same version python 2.7.6 is being used in emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same code runs normally on the os terminal. I only guessed that the different versions are the cause of the issue but it may be something else. I am kind of an amateur in python so detailed explanation is appreciated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Output of which python in os terminal&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;which python&#xA;/usr/local/bin/python&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Python related stuff in init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-python-command &quot;/usr/local/bin/python&quot;)&#xA;(require 'python-mode)&#xA;;; (setq-default py-shell-name &quot;/usr/local/bin/python&quot;)&#xA;;; (setq  python-shell-interpreter &quot;/usr/local/bin/python&quot;)&#xA;(setq py-force-py-shell-name-p t)&#xA;&#xA;; switch to the interpreter after executing code&#xA;(setq py-shell-switch-buffers-on-execute-p t)&#xA;(setq py-switch-buffers-on-execute-p t)&#xA;; don't split windows&#xA;(setq py-split-windows-on-execute-p nil)&#xA;; try to automagically figure out indentation&#xA;(setq py-smart-indentation t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8713" LastEditorUserId="253" LastEditDate="2015-06-26T13:49:57.610" LastActivityDate="2015-06-26T13:49:57.610" Title="How to specify python to use in emacs on os x?" Tags="|init-file|python|osx|" AnswerCount="1" CommentCount="3" ClosedDate="2015-06-30T20:46:08.247" ContentLicense="CC BY-SA 3.0" />
  <row Id="13457" PostTypeId="1" CreationDate="2015-06-26T00:05:28.933" Score="4" ViewCount="175" Body="&lt;p&gt;I’ve done quite a lot of source level blocks in org-mode, but I think I have a failure scenario if called functions inside the source code blocks are recursive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;ifconfig&lt;/code&gt; program displays all the important information, just in the wrong format. Let’s fix that. First, let’s retrieve the results and we’ll store that in a name, &lt;code&gt;ifconfig_data&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: ifconfig_data&#xA;#+BEGIN_SRC sh :results drawer&#xA;  ifconfig -a&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which spills out:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS: ifconfig_data&#xA;:RESULTS:&#xA;lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&#xA;        options=3&amp;lt;RXCSUM,TXCSUM&amp;gt;&#xA;        inet6 ::1 prefixlen 128&#xA;        inet 127.0.0.1 netmask 0xff000000&#xA;        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1&#xA;        nd6 options=1&amp;lt;PERFORMNUD&amp;gt;&#xA;gif0: flags=8010&amp;lt;POINTOPOINT,MULTICAST&amp;gt; mtu 1280&#xA;stf0: flags=0&amp;lt;&amp;gt; mtu 1280&#xA;en0: flags=8863&amp;lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&amp;gt; mtu 1500&#xA;        ether 6c:40:08:b7:ce:b8&#xA;        inet6 fe80::6e40:8ff:feb7:ceb8%en0 prefixlen 64 scopeid 0x4&#xA;        inet 192.168.77.40 netmask 0xfffffe00 broadcast 192.168.77.255&#xA;        nd6 options=1&amp;lt;PERFORMNUD&amp;gt;&#xA;        media: autoselect&#xA;        status: active&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can access that data easily in standard org-mode Babel thingie:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp :var datastring=ifconfig_data :results value&#xA;  (format &quot;Results: %s&quot; datastring)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the output format is awful, and I would like to have a list of tuples, where each tuple has the interface and the IP address.  Since some interfaces may not have an IPv4 address (which is what I’m wanting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To address this, I have a recursive function that calls itself for each regular expression match:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. Matched the Interface&#xA;   2. The name of the Interface&#xA;3. Matches the Address&#xA;   4. Optional `addr:` section that we don’t care about&#xA;   5. The value of the address&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the match is on an address, we assume that we passed in the interface name as a &lt;code&gt;header&lt;/code&gt; parameter, so that we can /build up/ the result.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: ifconfig-display&#xA;#+BEGIN_SRC elisp :var datastring=ifconfig_data :results value&#xA;  (defun split-ifconfig (datastr pos header)&#xA;    &quot;Assumes that the DATASTR is a string datastrput from ifconfig.  The POS is position within the string to search.  The HEADER is the current interface address.&quot;&#xA;    (when (string-match &quot;\\(^\\([^ :]+\\):?\\ \\)\\|\\( *inet \\(addr:\\)?\\([0-9.]+\\)\\)&quot; datastr pos)&#xA;      (cond&#xA;       ;; Interface:: Recurse with the name of this new header&#xA;       ((match-string 1 datastr)&#xA;            (split-ifconfig datastr (match-end 0) (match-string 2 datastr)))&#xA;&#xA;       ;; Address:: Return a list with our interface header, the&#xA;       ;;           address, and the results of parsing the rest&#xA;       ((match-string 3 datastr)&#xA;            (cons (list header (match-string 5 datastr))&#xA;                    (split-ifconfig datastr (match-end 0) nil))))))&#xA;&#xA;  (split-ifconfig datastring 0 nil)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works if I evaluate the function stuff directly with &lt;code&gt;C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last line, however, in the code block returns &lt;code&gt;nil&lt;/code&gt;. Always. The &lt;code&gt;datastring&lt;/code&gt; contains the data. The function, &lt;code&gt;split-ifconfig&lt;/code&gt; that was defined in the function is called. Still no go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn’t work, even if I pre-load the function into the global function space, and call it from the block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp :var out=ifconfig_data :results value&#xA;  (split-ifconfig out 0 nil)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I’ve tried making the &lt;code&gt;datastr&lt;/code&gt; aspect a global variable, and not keep passing it. Still no go.&lt;/p&gt;&#xA;" OwnerUserId="173" LastEditorUserId="504" LastEditDate="2015-06-26T06:14:23.450" LastActivityDate="2015-09-24T10:16:09.447" Title="Org Babel failing with Recursive Functions" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13458" PostTypeId="2" ParentId="13452" CreationDate="2015-06-26T00:05:32.170" Score="6" Body="&lt;p&gt;This sounds like what &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot;&gt;directory local&lt;/a&gt; variables are for.  Just create a &lt;code&gt;.dir-locals.el&lt;/code&gt; file in the directory with the settings you want, and every file will inherit those settings.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-06-26T00:05:32.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13459" PostTypeId="2" ParentId="10062" CreationDate="2015-06-26T03:04:19.523" Score="11" Body="&lt;p&gt;Another smart way is adding &lt;code&gt;:noexport:&lt;/code&gt; tag to the section header which includes the data table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-q&lt;/code&gt; (&lt;code&gt;org-set-tags-command&lt;/code&gt;), input &quot;noexport&quot; tag at the section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to export again, &lt;code&gt;C-c C-q&lt;/code&gt; and delete &lt;code&gt;:noexport:&lt;/code&gt; tag.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Data Section not for export                  :noexport:&#xA;&#xA;#+TBLNAME: data&#xA;| Col1 | Col2 | Col3 | Col4 | Col5 |&#xA;|------+------+------+------+------|&#xA;|    1 | 2    | 3    | 4    | 5    |&#xA;#+TBLFM: ...&#xA;&#xA;* Analysis Section&#xA;&#xA;#+BEGIN_SRC R :session *R* :results output :exports results :var tmp=data&#xA;tmp&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;:   Col1 Col2 Col3 Col4 Col5&#xA;: 1    1    2    3    4    5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-11-24T17:36:04.000" LastActivityDate="2015-11-24T17:36:04.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13460" PostTypeId="1" AcceptedAnswerId="14346" CreationDate="2015-06-26T07:30:31.713" Score="3" ViewCount="264" Body="&lt;p&gt;Suppose I have a sentence:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Two three four. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suppose I put the point on the &quot;T&quot; in &quot;Two&quot; and enter the text &lt;code&gt;one&lt;/code&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;. Auto-capitalize-mode will recognize that the point is at the beginning of a line or sentence, and will automatically capitalize the &quot;O&quot; in &quot;One.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current output:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;One Two three four.  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But since &quot;Two&quot; is no longer the beginning of the sentence, can I get auto-capitalize-mode to automatically downcase the next word in the sentence if there is one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Desired output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;One two three four.  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words, how can I instruct auto-capitalize-mode to downcase the next word whenever it auto-capitalizes a word if there is another word after the point before a line break or period?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-07-30T02:25:38.880" Title="how to make auto-capitalize-mode downcase next word upon auto-capitalization?" Tags="|capitalization|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13461" PostTypeId="2" ParentId="13457" CreationDate="2015-06-26T08:19:45.790" Score="3" Body="&lt;p&gt;I think that the problem was with the regular expression matching the preceding end-line character before the protocol name.  Below is your version with that problem fixed, plus a non-recursive version, in case you suspect it has anything to do with recursion.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: ifconfig_data&#xA;#+BEGIN_SRC sh :results drawer&#xA;  ifconfig -a&#xA;#+END_SRC&#xA;&#xA;#+NAME: ifconfig-display&#xA;#+BEGIN_SRC elisp :var datastring=ifconfig_data :results value&#xA;  (defun split-ifconfig (datastr pos header)&#xA;    &quot;Assumes that the DATASTR is a string datastrput from ifconfig.  &#xA;      The POS is position within the string to search.  &#xA;      The HEADER is the current interface address.&quot;&#xA;    (when (string-match &quot;\\(^\\([^ :]+\\):?\\ \\)\\|\\( *inet \\(addr:\\)?\\([0-9.]+\\)\\)&quot;&#xA;                        datastr pos)&#xA;      (cond&#xA;       ;; Interface:: Recurse with the name of this new header&#xA;       ((match-string 1 datastr)&#xA;        (split-ifconfig datastr (match-end 0) (match-string 2 datastr)))&#xA;&#xA;       ;; Address:: Return a list with our interface header, the&#xA;       ;;           address, and the results of parsing the rest&#xA;       ((match-string 3 datastr)&#xA;        (cons (list (org-trim header) (match-string 5 datastr))&#xA;              (split-ifconfig datastr (match-end 0) nil))))))&#xA;&#xA;  (split-ifconfig datastring 0 nil)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: ifconfig-display&#xA;| lo   |     127.0.0.1 |&#xA;| ppp0 | xx.xxx.xxx.xx |&#xA;&#xA;#+NAME: ifconfig-display-2&#xA;#+BEGIN_SRC elisp :var datastring=ifconfig_data :results value&#xA;  (defun split-ifconfig (datastr pos header)&#xA;    &quot;Assumes that the DATASTR is a string datastrput from ifconfig.  &#xA;          The POS is position within the string to search.  &#xA;          The HEADER is the current interface address.&quot;&#xA;    (cl-loop with state = :after&#xA;             and interface = nil&#xA;             and address = nil&#xA;             and result = nil&#xA;             for line in (split-string datastr &quot;\n&quot; nil &quot;[\t ]+&quot;) do&#xA;             (cond&#xA;              ((string-equal line &quot;&quot;)&#xA;               (when address&#xA;                 (push `(,interface ,address) result))&#xA;               (setf state :after interface nil address nil))&#xA;              ((eql state :after)&#xA;               (setf interface (cl-first (split-string line &quot;[:\t ]&quot;))&#xA;                     state :inside))&#xA;              ((string-prefix-p &quot;inet &quot; line)&#xA;               (setf address (cl-second (split-string line)))))&#xA;             finally (cl-return (nreverse result))))&#xA;&#xA;  (split-ifconfig datastring 0 nil)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: ifconfig-display-2&#xA;| lo   |     127.0.0.1 |&#xA;| ppp0 | xx.xxx.xxx.xx |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS, you could have tested the function by doing something like (in &lt;code&gt;*scratch*&lt;/code&gt; or REPL:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((datastring (shell-command-to-string &quot;ifconfig -a&quot;)))&#xA;  (split-ifconfig datastring 0 nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'd see right away where the problem is.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-06-26T08:19:45.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13463" PostTypeId="1" AcceptedAnswerId="13484" CreationDate="2015-06-26T08:36:01.683" Score="17" ViewCount="2734" Body="&lt;p&gt;When I write something like this: &lt;code&gt;&amp;lt;2015-07-05 Sun 20:00 GMT+0&amp;gt;&lt;/code&gt;, and then try to edit it by pressing &lt;kbd&gt;C-c .&lt;/kbd&gt;, Org removes the &lt;code&gt;GMT+0&lt;/code&gt; part.  So, I think it's in a wrong format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I don't want to set my time to a different timezone.  I want dates in a particular document to be in that timezone.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2020-09-16T21:42:55.893" Title="Specify timezone in Org date format" Tags="|org-mode|time-date|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13464" PostTypeId="2" ParentId="13452" CreationDate="2015-06-26T11:27:58.507" Score="1" Body="&lt;pre&gt;&lt;code&gt;;;; .dir-locals.el&#xA;&#xA;((nil&#xA;  (eval add-hook 'find-file-hook (lambda ()&#xA;                                   (message &quot;my find-file hook called...&quot;)) nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;nil&lt;/code&gt; means this applies to all files in the directories bellow &lt;code&gt;.dir-locals.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;t&lt;/code&gt; passed to &lt;code&gt;add-hook&lt;/code&gt; makes &lt;code&gt;find-file-hook&lt;/code&gt; buffer-local. Therefore the hook runs only for this file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dir-locals&lt;/code&gt; runs before &lt;code&gt;find-file-hook&lt;/code&gt;, so the whole thing works.&lt;/p&gt;&#xA;" OwnerUserId="8718" LastEditorUserId="-1" LastEditDate="2015-06-27T04:19:07.563" LastActivityDate="2015-06-27T04:19:07.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13465" PostTypeId="2" ParentId="13456" CreationDate="2015-06-26T12:51:52.950" Score="1" Body="&lt;p&gt;The solution as pointed out by @AndrewSwann was to use the exec-path-from-init package to set up the correct environment. By adding this to the init file the correct path variables are set from the operating system but only on mac os &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (memq window-system '(mac ns))&#xA;  (exec-path-from-shell-initialize))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8713" LastActivityDate="2015-06-26T12:51:52.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13466" PostTypeId="1" CreationDate="2015-06-26T13:55:04.457" Score="7" ViewCount="6398" Body="&lt;p&gt;I want to replace some words inside a region. I would like to use &lt;a href=&quot;https://github.com/victorhge/iedit&quot; rel=&quot;noreferrer&quot;&gt;iedit&lt;/a&gt; more than query-replace, but found the following problems (probably because I don't understand its documentation): &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I select a region, and then activate iedit, it takes the whole region as the text to change in the buffer. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I don't select any region, it takes the symbol under point as the text to change in the buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There's a function called &lt;code&gt;iedit-toggle-selection&lt;/code&gt;, but I don't understand how to use it (by default in &lt;code&gt;C-;&lt;/code&gt; and in Spacemacs in &lt;code&gt;M-;&lt;/code&gt;). How do you replace, let's say two contiguous words, with some arbitrary text, inside a region (using iedit)?&lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="105" LastEditDate="2015-06-26T16:25:47.293" LastActivityDate="2015-09-14T16:27:48.467" Title="How to replace words in a region using iedit?" Tags="|replace|region|iedit|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13467" PostTypeId="1" CreationDate="2015-06-26T13:55:19.110" Score="1" ViewCount="33" Body="&lt;p&gt;I am using GNU Emacs 24.4.1 with visual-line-mode turned on for LaTeX editing. This works great, except in tabular environments, where it would be nice to have the word-wrapping turned off. Is this even possible? My Lisp skills are limited so not sure where to start with this.&lt;/p&gt;&#xA;" OwnerUserId="8720" LastActivityDate="2015-06-26T13:55:19.110" Title="Emacs- visual-line-mode and latex tabular environment" Tags="|latex|auctex|" AnswerCount="0" CommentCount="2" ClosedDate="2015-06-26T23:03:12.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="13468" PostTypeId="2" ParentId="13440" CreationDate="2015-06-26T14:22:14.147" Score="3" Body="&lt;p&gt;Short answer: Create your own helm buffer sources and modify the &lt;code&gt;helm-mini-default-sources&lt;/code&gt; variable to use them.&#xA;&lt;hr/&gt;&#xA;The &lt;code&gt;helm-mini&lt;/code&gt; command uses &lt;code&gt;helm-mini-default-sources&lt;/code&gt; as its helm sources, so you can choose which sources to use and their order when showing in helm buffer. You cannot customize the &lt;code&gt;helm-source-buffers-list&lt;/code&gt; variable itself, except choosing to use it or not. You need to create your own buffer list source to replace &lt;code&gt;helm-source-buffers-list&lt;/code&gt;, for example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-mini-default-sources '(my-file-buffers&#xA;                                  my-other-buffers&#xA;                                  helm-source-recentf&#xA;                                  helm-source-buffer-not-found))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;here, you need to create two new sources: &lt;code&gt;my-file-buffers&lt;/code&gt; and &lt;code&gt;my-other-buffers&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, you should use the &lt;code&gt;helm-source-buffers&lt;/code&gt; class to make these two sources, but you cannot use them in one and the same helm command (see closed issue &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/1034&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/issues/1034&lt;/a&gt;), so you also need to create your own helm buffer source class, it's easy if you use &lt;code&gt;helm-source-buffers&lt;/code&gt; as a reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. helm wiki includes a section on Developping using helm: &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#developpingusinghelmframework&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/wiki#developpingusinghelmframework&lt;/a&gt;, it can be considered the official documentation of helm.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-06-26T14:44:40.877" LastActivityDate="2015-06-26T14:44:40.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13469" PostTypeId="2" ParentId="13455" CreationDate="2015-06-26T14:35:01.643" Score="1" Body="&lt;p&gt;The following example sets fringe widths globally for all new frames that will be created.  I like &lt;code&gt;face-spec-set&lt;/code&gt;, but the recommended approach is to use &lt;code&gt;set-face-attribute&lt;/code&gt; or &lt;code&gt;M-x customize-face&lt;/code&gt; to control color.  The width is adjustable to create a thin or thick vertical line on either side of the window.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(left-fringe . 8))&#xA;&#xA;(add-to-list 'default-frame-alist '(right-fringe . 8))&#xA;&#xA;(face-spec-set 'fringe&#xA;  '((((class color) (background light))&#xA;     :background &quot;red&quot;)&#xA;    (((class color) (background dark))&#xA;     :background &quot;yellow&quot;)&#xA;    (t&#xA;     :background &quot;cyan&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The following is a reprint of a prior post of mine in another forum relating to this issue:  &lt;a href=&quot;https://emacs.stackexchange.com/a/5310/2287&quot;&gt;https://emacs.stackexchange.com/a/5310/2287&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few ways to do this -- my preferred method is to set the frame defaults for the fringes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'fringe nil :background &quot;red&quot;)&#xA;(add-to-list 'default-frame-alist '(left-fringe . 11))&#xA;(add-to-list 'default-frame-alist '(right-fringe . 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is possible to set the windows fringes globally:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default left-fringe-width 11)&#xA;(setq-default right-fringe-width 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is also possible to set the windows fringes locally:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq left-fringe-width 11)&#xA;(setq right-fringe-width 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the doc-string for &lt;code&gt;left-fringe-width&lt;/code&gt; and &lt;code&gt;right-fringe-width&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Automatically becomes buffer-local when set.&#xA;&#xA;Documentation:&#xA;Width of this buffer's left/right fringe (in pixels).&#xA;A value of 0 means no left/right fringe is shown in this buffer's window.&#xA;A value of nil means to use the left/right fringe width from the window's frame.&#xA;&#xA;Setting this variable does not take effect until a new buffer is displayed&#xA;in a window.  To make the change take effect, call `set-window-buffer'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/fringe_example.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-06-26T16:03:04.247" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13470" PostTypeId="2" ParentId="13436" CreationDate="2015-06-26T14:41:29.713" Score="1" Body="&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: &lt;code&gt;(setq helm-move-to-line-cycle-in-source t)&lt;/code&gt; should do what you need, the option's documentation is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;helm-move-to-line-cycle-in-source is a variable defined in 'helm.el'.&#xA;  Its value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Move to end or beginning of source when reaching top or&#xA;  bottom of source. This happen when using 'helm-next/previous-line'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr /&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;M-&amp;lt;&lt;/kbd&gt;(&quot;helm-beginning-of-buffer&quot;).&#xA;&lt;hr /&gt;&#xA;&lt;kbd&gt;left&lt;/kbd&gt;(&quot;helm-previous-source&quot;) can always cycle all sources, &lt;kbd&gt;right&lt;/kbd&gt; or &lt;kbd&gt;C-o&lt;/kbd&gt; (&quot;helm-next-sources&quot;) can cycle all sources when there is no a dummy source.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-06-27T16:01:31.587" LastActivityDate="2015-06-27T16:01:31.587" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13471" PostTypeId="2" ParentId="13460" CreationDate="2015-06-26T14:53:35.697" Score="2" Body="&lt;p&gt;In your specific example you can hit &lt;code&gt;M-l&lt;/code&gt; to down-case the next word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A general solution would involve some code: you'd want a custom function to run after &lt;code&gt;auto-capitalize&lt;/code&gt; and call &lt;code&gt;downcase-word&lt;/code&gt;. You also want to make sure the next word is part of the same sentence first. Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun downcase-next-word-in-sentence ()&#xA;  (interactive)&#xA;  &quot;Downcase the next word after point, unless at the end of a sentence or line.&quot;&#xA;  (unless (looking-at (sentence-end)) &#xA;    (downcase-word 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can probably advise &lt;code&gt;auto-capitalize&lt;/code&gt; to call this after it executes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using 'after' advice does not seem to work here. In fact, once I add any advice to &lt;code&gt;auto-capitalize&lt;/code&gt; it seems to stop working altogether. Not sure why that is -- perhaps someone else can comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other limitation with this approach is that it is blindly downcasing the next word. After looking at the source of auto-capitalize I see it is doing smarter things like checking for words that are always supposed to be capitalized (&quot;I&quot;), etc.  &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="2494" LastEditDate="2015-06-27T04:18:41.967" LastActivityDate="2015-06-27T04:18:41.967" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="13472" PostTypeId="1" CreationDate="2015-06-26T15:02:07.097" Score="2" ViewCount="47" Body="&lt;p&gt;On upgrade from Emacs 24.3.1 to Emacs 25.0.50 pasting unicode from external applications with mouse wheel appears broken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start &lt;code&gt;emacs -Q&lt;/code&gt; and select e.g. title of &lt;a href=&quot;https://en.wikipedia.org/wiki/Paul_Erd%C5%91s&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Paul_Erdős&lt;/a&gt; wikipedia entry in firefox. However with mouse wheel I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Paul_Erd\u0151s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where as with normal &lt;code&gt;clipboard-yank&lt;/code&gt; works fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Paul_Erdős&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pasting the same with mouse wheel (aka &lt;code&gt;&amp;lt;mouse-2&amp;gt;&lt;/code&gt;) from Emacs selection works fine. &lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="105" LastEditDate="2015-08-12T14:26:54.193" LastActivityDate="2015-08-12T14:26:54.193" Title="Pasting unicode from external applications with mouse wheel on Unix" Tags="|linux|clipboard|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13473" PostTypeId="1" AcceptedAnswerId="13474" CreationDate="2015-06-26T16:04:10.457" Score="4" ViewCount="664" Body="&lt;p&gt;In one of my older elisp code snippets, I was surprised to find the below (and that even worked fine all this time!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem (which should have been) is that I did not escape the back-slashes in the regexp string: &lt;code&gt;&quot;\*abc\*&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(string-match-p &quot;\*abc\*&quot; &quot;def*abc*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I then fixed the expression to below.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(string-match-p &quot;\\*abc\\*&quot; &quot;def*abc*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both of the above expressions yield the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Why did the incorrect way work here?&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-06-26T16:20:03.813" Title="Is escaping backslash in regexp string expressions optional at times?" Tags="|elisp|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13474" PostTypeId="2" ParentId="13473" CreationDate="2015-06-26T16:20:03.813" Score="6" Body="&lt;pre&gt;&lt;code&gt;(string-match-p &quot;\*abc\*&quot; &quot;def*abc*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is equivalent to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match-p &quot;*abc*&quot; &quot;def*abc*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which matches because (1) the first &lt;code&gt;*&lt;/code&gt; is matched literally against the first &lt;code&gt;*&lt;/code&gt; in the second argument and (2) the second &lt;code&gt;*&lt;/code&gt; means zero or more occurrences of &lt;code&gt;c&lt;/code&gt;, which matches the one &lt;code&gt;c&lt;/code&gt; occurrence.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-26T16:20:03.813" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13475" PostTypeId="2" ParentId="13466" CreationDate="2015-06-26T17:06:07.670" Score="15" Body="&lt;p&gt;In &lt;strong&gt;Spacemacs&lt;/strong&gt; once you are in iedit state you can:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;press &lt;code&gt;F&lt;/code&gt; to limit the scope to the current function&lt;/li&gt;&#xA;&lt;li&gt;press &lt;code&gt;L&lt;/code&gt; to limit the scope to the current line&lt;/li&gt;&#xA;&lt;li&gt;press &lt;code&gt;J&lt;/code&gt; to increase the scope (starting from the current line) one line below&lt;/li&gt;&#xA;&lt;li&gt;press &lt;code&gt;K&lt;/code&gt; to increase the scope one line above&lt;/li&gt;&#xA;&lt;li&gt;navigate between the occurrences with &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;N&lt;/code&gt; and press &lt;code&gt;TAB&lt;/code&gt; to remove an occurrence.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-06-26T17:06:07.670" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13476" PostTypeId="1" AcceptedAnswerId="13483" CreationDate="2015-06-26T17:34:47.897" Score="9" ViewCount="34045" Body="&lt;p&gt;I'm using C-c C-c to send a buffer to a Python shell. The buffer has an import at the beginning. I found that if I modify the module I'm importing, it doesn't reflect the changes if I run the buffer again with C-c C-c (it seems the Inferior Python is doing the import only once).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I force the Python shell to import again the modules already called in the first run of the buffer?&lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2017-03-03T19:42:08.847" Title="How to force a Python shell to re-import modules when running a buffer?" Tags="|python|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13477" PostTypeId="2" ParentId="13466" CreationDate="2015-06-26T19:13:35.853" Score="7" Body="&lt;p&gt;There are a couple ways to do this. (I'm using standard GNU Emacs, not familiar with Spacemacs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can narrow the buffer to the region you are interested in and then use iedit to highlight / change all the visible matches. With this approach you want to mark the relevant region first and call &lt;code&gt;narrow-to-region&lt;/code&gt; (&lt;code&gt;C-x n n&lt;/code&gt;). Use iedit to make the changes you want and then call &lt;code&gt;widen&lt;/code&gt; (&lt;code&gt;C-x n w&lt;/code&gt;) to see the whole buffer again. Using narrow/widen this way is handy as it can be used in lots of other cases. Any command that operates on the buffer can be restricted to a smaller region this way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do it the other way around and start with iedit. Use &lt;code&gt;iedit-mode&lt;/code&gt; to highlight all instances of some bit of text you want to change. Then mark a region to restrict the changes and call &lt;code&gt;iedit-mode&lt;/code&gt; again. This will un-select all matches outside the region so that you can safely change just the matches you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some options for restricting the selection once you've called &lt;code&gt;iedit-mode&lt;/code&gt;. Use &lt;code&gt;M-H&lt;/code&gt; to narrow to the current function or &lt;code&gt;M-I&lt;/code&gt; to narrow to the current line. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-06-26T20:32:58.183" LastActivityDate="2015-06-26T20:32:58.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13478" PostTypeId="2" ParentId="13440" CreationDate="2015-06-26T21:36:20.060" Score="3" Body="&lt;p&gt;With the help of @xuchunyang's excellent answer and after an epic struggle with ELisp, this is the solution I came up with, and which seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; This decomposes helm-source-buffers-list in two parts/sources:&#xA;;; (1) Files: file-visiting buffers&#xA;;; (2) Buffers non-file-visiting buffers&#xA;&#xA;(defclass my-helm-source-file-buffers-class (helm-source-buffers)&#xA;  ((candidates :initform&#xA;               (lambda ()&#xA;                 (mapcar 'buffer-name&#xA;                         (cl-remove-if-not #'buffer-file-name (buffer-list)))))))&#xA;&#xA;(defclass my-helm-source-nonfile-buffers-class (helm-source-buffers)&#xA;   ((candidates :initform&#xA;               (lambda ()&#xA;                 (mapcar 'buffer-name&#xA;                         (cl-remove-if #'buffer-file-name (buffer-list)))))))&#xA;&#xA;;; Use the decomposition for helm-mini&#xA;&#xA;(setq my-helm-source-file-buffers-list&#xA;      (helm-make-source &quot;Files&quot; 'my-helm-source-file-buffers-class)&#xA;      my-helm-source-nonfile-buffers-list&#xA;      (helm-make-source &quot;Buffers&quot; 'my-helm-source-nonfile-buffers-class))&#xA;&#xA;(setq helm-mini-default-sources '(my-helm-source-file-buffers-list&#xA;                                  my-helm-source-nonfile-buffers-list&#xA;                                  helm-source-recentf&#xA;                                  helm-source-buffer-not-found))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2807" LastEditorUserId="2807" LastEditDate="2016-10-10T16:22:02.947" LastActivityDate="2016-10-10T16:22:02.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13479" PostTypeId="1" CreationDate="2015-06-26T22:06:52.327" Score="1" ViewCount="478" Body="&lt;p&gt;Is it possible to exclude from a project all directories matching a pattern at other than the project root level? In my case, I want to exclude subdirectories (deeper than the project root level) with the name matching &lt;code&gt;split*&lt;/code&gt;, for instance, exclude a path &lt;code&gt;&amp;lt;project_root&amp;gt;/egs/foo/exp/bar/split8&lt;/code&gt;. These directories are autogenerated, and the number after &quot;split&quot; changes, so I cannot explicitly list them. Anything I tried in the &lt;code&gt;.projectile&lt;/code&gt; file did not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tracing &lt;a href=&quot;https://github.com/bbatsov/projectile/blob/master/projectile.el&quot; rel=&quot;nofollow&quot;&gt;the code&lt;/a&gt; suggests this is not likely possible, but I am still daring to ask in case I overlooked something.&lt;/p&gt;&#xA;" OwnerUserId="8543" LastActivityDate="2015-06-26T22:06:52.327" Title="Projectile: how to exclude deep subdirectories by pattern?" Tags="|projectile|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13480" PostTypeId="1" CreationDate="2015-06-26T22:26:03.043" Score="5" ViewCount="510" Body="&lt;p&gt;I have Emacs doing a bunch of smart things to display text for me. In particular, some text has the &lt;code&gt;invisible&lt;/code&gt; property set, and I'm running &lt;a href=&quot;https://elpa.gnu.org/packages/adaptive-wrap.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;adaptive-wrap&lt;/code&gt;&lt;/a&gt; with &lt;code&gt;&amp;lt;!-- adaptive-wrap-extra-indent: 3 --&amp;gt;&lt;/code&gt; set. I'm wondering whether I can copy the text as it's rendered in Emacs, with newlines to re-create the smart line wrapping and with the invisible text gone. Is there a way I can access the text from my buffer in that form?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want is essentially the same as running &lt;code&gt;emacs -nw&lt;/code&gt;, selecting the text using the terminal's text selection capabilities, and then using the terminal app's copy function (&lt;em&gt;not&lt;/em&gt; marking using an Emacs region and then yanking). The chief problem with this technique for me is that I have to do it one screen at a time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;htmlfontify-buffer&lt;/code&gt; gets me part of the way there. My visible text is shown by I can make it go away by clicking on each individual instance, but the line-wrapping behavior is lost.&lt;/p&gt;&#xA;" OwnerUserId="8665" LastEditorUserId="8665" LastEditDate="2015-06-27T02:40:59.557" LastActivityDate="2015-09-25T05:39:48.300" Title="Copy text as it is rendered by Emacs" Tags="|copy-paste|rendering|visibility|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13481" PostTypeId="1" CreationDate="2015-06-26T23:19:58.727" Score="1" ViewCount="116" Body="&lt;p&gt;In some cases [0/4]&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Keybinding is too much!&lt;/li&gt;&#xA;&lt;li&gt;Keybinding naming is not intuitive. like projectile-rails-console has keybinding [prefix + r].&lt;/li&gt;&#xA;&lt;li&gt;Some keybindings naming will conflict under the intuitive principle. For example: projectile-rails-find-test, projectile-rails-find-template, [t].&lt;/li&gt;&#xA;&lt;li&gt;Borrow the idea from helm: search, filter, narrow to one candidate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So I want to create an emacs extension to do better job.&#xA;For example, I have following keybindings bind to those commands.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;    [C-c C-r r] -- projectile-rails-console&#xA;    [C-c C-r t] -- projectile-find-test&#xA;    [C-c C-r T] -- projectile-find-current-test&#xA;    []          -- projectile-goto-template-at-point&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Below is a list of things I'd like to achieve:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;UI Features&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Borrow the idea from helm: search, filter, narrow to one candidate.&lt;/li&gt;&#xA;&lt;li&gt;Borrow from “guide-key”, show the keybindings popup.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Core &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When you input a prefix, like [C-c], then the extension start popup the following keybindings like “guide-key”, then user can continue press key just like normal use “guide-key”, but user also can type key like [tem], this will filter out keybindings which bind to command projectile-rails-goto-template etc.&lt;/li&gt;&#xA;&lt;li&gt;I know I can archive this by directly use [M-x] to select command, but it is not intelligent, Emacs separated keybinding and command. I want to provide a smart way to do both in one place.&lt;/li&gt;&#xA;&lt;li&gt;The big problem is how to let Emacs treat the following key input as search input, instead of continuing key press.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I created an github reposition at here: &lt;a href=&quot;https://github.com/stardiviner/emacs-intelligent-key-guide&quot; rel=&quot;nofollow&quot;&gt;emacs-intelligent-key-guide&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody knows that is possible? And how? I need some hints.&#xA;Thanks in advanced.&#xA;And if you're interested in this project, welcome to contribute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My real question is:&#xA;How to treat following keybinding behind prefix map as normal input for searching commands?&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2015-06-27T08:11:51.923" LastActivityDate="2015-06-27T09:19:08.897" Title="How to treat keybinding as input to search?" Tags="|key-bindings|search|" AnswerCount="1" CommentCount="11" ClosedDate="2015-06-27T20:12:55.810" ContentLicense="CC BY-SA 3.0" />
  <row Id="13482" PostTypeId="2" ParentId="13480" CreationDate="2015-06-26T23:34:18.603" Score="2" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/subr%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;subr+.el&lt;/code&gt;&lt;/a&gt; has functions that help with this. This one, for instance:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun buffer-substring-of-visible (start end)&#xA;  &quot;Return contents of visible part of buffer from START to END, as a string.&#xA;START and END can be in either order.&quot;&#xA;  (buffer-substring-of-unpropertied start end 'invisible))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are some others, which are similar:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;buffer-substring-of-invisible&lt;/code&gt; - Return contents of invisible part of buffer from START to END, as a string.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;buffer-substring-of-faced&lt;/code&gt; - eturn faced contents of buffer from START to END, as a string.  That is, include only text that has property `face'.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;buffer-substring-of-unfaced&lt;/code&gt; - Return unfaced contents of buffer from START to END, as a string.  That is, include only text that has no `face' property.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And the more general functions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;buffer-substring-of-propertied&lt;/code&gt; - Return PROPERTY'ed contents of buffer from START to END, as a string. Only text from START to END that has PROPERTY is included.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;buffer-substring-of-unpropertied&lt;/code&gt; - Return unpropertied contents of buffer from START to END, as a string. Text from START to END that has PROPERTY is excluded from the string.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-26T23:34:18.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13483" PostTypeId="2" ParentId="13476" CreationDate="2015-06-27T00:24:39.540" Score="10" Body="&lt;p&gt;You can explicitly reload a module like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import mymodule&#xA;import imp&#xA;imp.reload(mymodule)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-06-27T00:24:39.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13484" PostTypeId="2" ParentId="13463" CreationDate="2015-06-27T07:19:30.527" Score="6" Body="&lt;p&gt;Time zone informatian is not currently part of date formats in &lt;code&gt;org-mode&lt;/code&gt; and thus not part of the output from &lt;code&gt;C-c .&lt;/code&gt;.  Like &lt;code&gt;C-c C-c&lt;/code&gt; on a timestamp any extraneous material in the date specification is removed and the week day is corrected to fit a given date, so partial junk input like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 13-6-3 Wed Xyz 13:00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is output as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;2013-06-03 Mon 13:00&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;a correct date, with matching day name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be appropriate to make a feature request to the &lt;code&gt;org-mode&lt;/code&gt; developers.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2015-06-27T07:19:30.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13485" PostTypeId="1" AcceptedAnswerId="13490" CreationDate="2015-06-27T07:29:04.607" Score="5" ViewCount="1786" Body="&lt;p&gt;I would like a more handy shortcut to basically the system's &lt;code&gt;alt-f4&lt;/code&gt; to close the current emacs window. &lt;code&gt;delete-frame&lt;/code&gt; is not far from that, but it refuses to close the last frame: &lt;code&gt;Attempt to delete the sole visible or iconified frame&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I get a function that would override that safety? Note that I'm using emacs-client with &lt;code&gt;emacsclient -c &quot;$@&quot; --alternate-editor= &amp;amp;&lt;/code&gt; and I would like that the server stays running -- with is the behaviour with &lt;code&gt;alt-f4&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not interested in OS shortcuts because I'm using &lt;code&gt;spacemacs&lt;/code&gt; and I can get better shortcuts, like &lt;code&gt;SPC o F&lt;/code&gt; for instance.&lt;/p&gt;&#xA;" OwnerUserId="2592" LastActivityDate="2015-06-28T04:32:03.223" Title="something like delete-frame but that would also delete the last frame -- like alt+f4" Tags="|frames|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13486" PostTypeId="2" ParentId="13481" CreationDate="2015-06-27T09:19:08.897" Score="1" Body="&lt;p&gt;Try &lt;code&gt;describe-buffer-bindings&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (get-buffer-create &quot;result&quot;)&#xA;  (describe-buffer-bindings (current-buffer) (kbd &quot;C-c&quot;) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will insert list of key binds that use &lt;code&gt;C-c&lt;/code&gt; as prefix in current buffer to &lt;code&gt;result&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using this function, &lt;code&gt;prefix ?&lt;/code&gt; (or &lt;code&gt;prefix C-h&lt;/code&gt;) lists all key binds that start with &lt;code&gt;prefix&lt;/code&gt; in the &lt;code&gt;*Help*&lt;/code&gt; buffer, &lt;a href=&quot;https://github.com/emacs-helm/helm-descbinds&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;helm-descbinds&lt;/code&gt;&lt;/a&gt; even provides a helm interface for &lt;code&gt;prefix ?&lt;/code&gt; i.e., type &lt;code&gt;prefix ?&lt;/code&gt; and then search &amp;amp; select a command in helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Reading &lt;code&gt;guide-key&lt;/code&gt;/&lt;code&gt;helm-descbinds&lt;/code&gt;'s source code to learn how they are implemented might be helpful since it seems like you want to make a helm interface for &lt;code&gt;guide-key&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-06-27T09:19:08.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13487" PostTypeId="1" CreationDate="2015-06-27T15:06:51.720" Score="2" ViewCount="230" Body="&lt;p&gt;I installed Emacs 24.5 using homebrew&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ brew install emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the &lt;a href=&quot;https://github.com/overtone/emacs-live&quot; rel=&quot;nofollow&quot;&gt;Emacs-Live package collection&lt;/a&gt;.  Most things work really well, but I'd like to get a python IDE going in emacs (so I don't have to leave emacs to run python, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I open up one of my python programs, foo.py:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print 42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and verify this works from the shell:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;shell&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ python foo.py&#xA;42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Great.  The underpinnings seem to be working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following the minor-mode help (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;help&lt;/code&gt;&lt;kbd&gt;m&lt;/kbd&gt;), which shows many key bindings, I now start the python subprocess:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-p&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Python 2.7.10 (default, Jun 10 2015, 19:42:47) &#xA; [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin&#xA; Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&#xA; &amp;gt;&amp;gt;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I try to send my program to this subprocess:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: stringp, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Uh-oh.  Ok, I can deal with this.  Back to &lt;code&gt;*Help*&lt;/code&gt; mode. &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;help&lt;/code&gt;, find the entry for &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-c      python-shell-send-buffer &amp;lt;&amp;lt;&amp;lt;--- that's a hyperlink&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;clink on the hyperlink:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python-shell-send-buffer is an interactive compiled Lisp function in&#xA;`python.el'.  &amp;lt;&amp;lt;&amp;lt;--- that's a hyperlink&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;click on that hyperlink:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun python-shell-send-buffer (&amp;amp;optional send-main)&#xA;  &quot;Send the entire buffer to inferior Python process.&#xA;When optional argument SEND-MAIN is non-nil, allow execution of&#xA;...etc...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;put the &lt;code&gt;point&lt;/code&gt; cursor in the &lt;code&gt;defun&lt;/code&gt; and press &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-M-x&lt;/kbd&gt;, which instruments the function for &lt;code&gt;Edebug&lt;/code&gt;. Another &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt; in my python buffer and &lt;code&gt;Edebug&lt;/code&gt; stops in this function.  Info-mode has full documentation of &lt;code&gt;Edebug&lt;/code&gt;, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;info&lt;/code&gt;&lt;kbd&gt;Ret&lt;/kbd&gt;&#xA;&lt;kbd&gt;m&lt;/kbd&gt;&lt;code&gt;m Elisp&lt;/code&gt;&lt;kbd&gt;Ret&lt;/kbd&gt;&#xA;&lt;kbd&gt;m&lt;/kbd&gt;&lt;code&gt;m Debugging&lt;/code&gt;&lt;kbd&gt;Ret&lt;/kbd&gt;&#xA;&lt;kbd&gt;m&lt;/kbd&gt;&lt;code&gt;m Edebug&lt;/code&gt;&lt;kbd&gt;Ret&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I do lots of stepping into and checking stuff, which I won't repeat here.  Suffice to say, I eventually find the offending line inside python.el, line 4138&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'outline-regexp)&#xA;       (python-rx (* space) block-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to step into this call of python-rx, Edebug either tells me that it can't find function python-rx, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: python-rx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or emacs goes into the weeds and I have to Force-Kill it, depending on how much other stuff I've done in the debugger session.  I try looking for python-rx&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; find-grep-dired&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/local/Cellar/emacs/24.5/share/emacs/24.5/lisp/progmodes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I think this is where homebrew puts emacs lisp code for program modes)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python-rx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;nothing found :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find it hard to believe that python mode is actually broken in this distro -- millions would have picked up their pitchforks and torches and taken to the streets.  It must be something I've done wrong.  I'd be grateful for any advice.&lt;/p&gt;&#xA;" OwnerUserId="596" LastEditorUserId="596" LastEditDate="2015-06-27T15:37:53.547" LastActivityDate="2015-06-27T15:37:53.547" Title="Issue with python mode in 24.5 on Mac OSX Yosemite: python-rx missing?" Tags="|python|minor-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13488" PostTypeId="1" CreationDate="2015-06-27T15:37:22.927" Score="1" ViewCount="594" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working with prolog in emacs and using &lt;code&gt;prolog-inferior-mode&lt;/code&gt; which has &lt;code&gt;comint-mode&lt;/code&gt; as a parent mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default completion in &lt;code&gt;comint-mode&lt;/code&gt;s is rather terrible, and I was hoping to be able to use helm to do tab completion on the history. I discovered &lt;code&gt;tab-always-indent&lt;/code&gt; and set it to &lt;code&gt;complete&lt;/code&gt;, which triggers completion when appropriate upon hitting the tab key. I also discovered &lt;code&gt;completion-at-point-functions&lt;/code&gt; and wrote a helm source that grabs the previous comint history, which is stored in &lt;code&gt;comint-input-ring&lt;/code&gt;. This variable only exists locally in comint buffers, it seems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote the following code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-comint-candidates ()&#xA;  (interactive)&#xA;  (let ((start (car comint-input-ring)) &#xA;        (end (car (cdr comint-input-ring)))&#xA;        (completed (append (nthcdr 2 comint-input-ring) nil)))&#xA;    (butlast (nthcdr start completed) (- (length completed) end)))&#xA;  )&#xA;&#xA;(defun comint-completion-source ()&#xA;  (interactive)&#xA;  (helm :sources '((name . &quot;helm comint-mode&quot;)&#xA;                   (candidates . get-comint-candidates)&#xA;                   (action . (lambda (cand) (insert cand)))&#xA;                   )&#xA;        :input (thing-at-point 'word)&#xA;        )&#xA;  )&#xA;&#xA;(add-hook 'comint-mode-hook (lambda () (setq completion-at-point-functions 'comint-completion-source)))&#xA;(setq tab-always-indent 'complete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am inside the prolog comint buffer and call &lt;code&gt;get-comint-candidates&lt;/code&gt;, it returns the candidates as it should. However, whenever I call &lt;code&gt;comint-completion-source&lt;/code&gt; either manually or using the tab key, the completion buffer is empty. Moreover, I'm not sure if this is the right solution. I would prefer to be able to basically tell helm that it's supposed to complete from my source and use the default helm &lt;code&gt;completion-at-point&lt;/code&gt; functionality, such that I don't have to manually take care of inserting only the parts of the chosen completion that I haven't already typed(that is to say, if I have typed &lt;code&gt;fo&lt;/code&gt; and complete &lt;code&gt;foobar&lt;/code&gt;, I want it to result in &lt;code&gt;foobar&lt;/code&gt;, not &lt;code&gt;fofoobar&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be very grateful for any hints or tips on how to solve this, as well as any on working with &lt;code&gt;comint-mode&lt;/code&gt; and its children modes in general.&lt;/p&gt;&#xA;" OwnerUserId="8733" LastActivityDate="2015-11-24T20:16:44.047" Title="Getting helm to do completion-at-point in comint-mode(and child modes)" Tags="|helm|completion|comint|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13489" PostTypeId="1" AcceptedAnswerId="13511" CreationDate="2015-06-27T15:43:27.467" Score="9" ViewCount="11778" Body="&lt;p&gt;My system is macOS and I have both python 2 and 3 installed. I am currently working on a side project for which I want to use Django 1.8 and python 3.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have created a virtual environment with the python 3 command &lt;code&gt;pyvenv venv&lt;/code&gt; in the parent folder of my project (I prefer to have my python project folders to be self contained).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment, I cannot get Emacs to recognise and therefore limit all code related assist to the virtual environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, is it possible to setup per-project settings such that I can have different projects use different python versions and environment? The ideal scenario will be, when I change into a project directory and start Emacs, it will pick all it's environment settings from that project directory according to some local settings file.&lt;/p&gt;&#xA;" OwnerUserId="8734" LastEditorUserId="1979" LastEditDate="2019-09-16T19:05:19.037" LastActivityDate="2019-09-21T03:34:35.763" Title="How do I get Emacs to recognize my python 3 virtual environment" Tags="|python|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="13490" PostTypeId="2" ParentId="13485" CreationDate="2015-06-27T16:06:55.970" Score="6" Body="&lt;p&gt;I think @harpo answered the question adequately in a comment.  Here's some additional info, in case it helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can bind a key to a command that deletes the frame, and if error &quot;&lt;em&gt;Attempt...&lt;/em&gt;&quot; is raised then kill Emacs instead. For that, use &lt;code&gt;condition-case&lt;/code&gt; to handle the error.  That way you can use a single key to either delete a frame or, if it is the last one, kill Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-frame-or-kill-emacs ()&#xA;  &quot;Delete the selected frame.  If the last one, kill Emacs.&quot;&#xA;  (interactive)&#xA;  (condition-case nil (delete-frame) (error (kill-emacs))))&#xA;&#xA;(global-set-key [remap delete-frame] 'delete-frame-or-kill-emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(However, I wouldn't recommend using such a command, as it is too easy to accidentally kill Emacs.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update after your comment.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using emacsserver and emacsclient then try &lt;code&gt;(save-buffers-kill-terminal)&lt;/code&gt; instead of &lt;code&gt;(kill-emacs)&lt;/code&gt;. That should delete the frame but keep the server alive. I didn't see that you had specified that you were in such a context.  (&lt;code&gt;save-buffers-kill-terminal&lt;/code&gt; is bound to &lt;code&gt;C-x C-c&lt;/code&gt; in a client frame.) See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;emacsclient&lt;/code&gt; Options&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in that case, &lt;code&gt;C-x C-c&lt;/code&gt; should be &lt;em&gt;all&lt;/em&gt; you need - it sounds like it does just what you are asking for. And if you prefer that it be invoked from another key then just bind that key to &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-27T20:53:28.390" LastActivityDate="2015-06-27T20:53:28.390" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13491" PostTypeId="1" CreationDate="2015-06-27T16:13:41.527" Score="2" ViewCount="276" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How to sort the &lt;code&gt;minor-mode-alist&lt;/code&gt; alphabetically (in the mode-line) using the &lt;code&gt;:lighter&lt;/code&gt; as the criteria for alphabetization.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Rough draft that does not work:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-format '(&#xA;  (:eval&#xA;    (let* (&#xA;        (copy-of-list (copy-list minor-mode-alist))&#xA;        (sorted-list&#xA;          (sort copy-of-list #'(lambda (x y) &#xA;            (when&#xA;                (and&#xA;                  (stringp (car (cdr x)))&#xA;                  (stringp (car (cdr y))))&#xA;              (when (eq ?\s (aref (car (cdr x)) 0))&#xA;                (setq x (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; (car (cdr x)))))&#xA;              (when (eq ?\s (aref (car (cdr y)) 0))&#xA;                (setq y (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; (car (cdr y)))))&#xA;              (when (and (stringp x) (stringp y))&#xA;                (string&amp;lt; x y )))))) )&#xA;      (list&#xA;        `(:propertize (&quot;&quot; sorted-list)&#xA;          face bold&#xA;          mouse-face highlight&#xA;          help-echo &quot;This is a mouseover help message.&quot;&#xA;          local-map ,mode-line-minor-mode-keymap))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  The following is a revised working draft based upon the guidance of @Drew in his answer below -- it appears to be working correctly for &lt;code&gt;:lighter&lt;/code&gt; in the form of either strings or symbols, and I'll be testing it out over the next day or so.  The draft will need to be revised to include the situations mentioned by @Drew -- e.g., &lt;code&gt;(text-scale-mode (&quot; &quot; text-scale-mode-lighter))&lt;/code&gt; and other possibilities described in the Elisp manual at node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html&quot; rel=&quot;nofollow&quot;&gt;Mode Line Data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(defmacro non-empty-name-p (name)       ; Error if NAME is neither nil nor a string.&#xA;  &quot;NAME if non-nil and not \&quot;\&quot;, else nil.&quot;&#xA;  `(and ,name (stringp ,name) (not (string= &quot;&quot; ,name)) ,name))&#xA;&#xA;(setq mode-line-format '(&#xA;  (:eval&#xA;    (let* (&#xA;        (copied-list&#xA;          (delq nil&#xA;            (mapcar&#xA;              (lambda (x)&#xA;                (when&#xA;                    (or&#xA;                      (and&#xA;                        (symbolp (cadr x))&#xA;                        (non-empty-name-p (symbol-value (cadr x))))&#xA;                      (stringp (cadr x)))&#xA;                  x))&#xA;              (copy-list minor-mode-alist))))&#xA;        (sorted-list&#xA;          (sort&#xA;            copied-list&#xA;            (lambda (x y)&#xA;              (let* (&#xA;                  (xname (cadr x))&#xA;                  (yname (cadr y)) )&#xA;                (when (symbolp xname) (setq xname (symbol-value xname)))&#xA;                (when (symbolp yname) (setq yname (symbol-value yname)))&#xA;                (when (and (stringp xname) (non-empty-name-p xname)&#xA;                           (stringp yname) (non-empty-name-p yname))&#xA;                  (when (eq ?\s (aref xname 0))&#xA;                    (setq xname (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; xname)))&#xA;                  (when (eq ?\s (aref yname 0))&#xA;                    (setq yname (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; yname)))&#xA;                  (string&amp;lt; xname yname)))))) )&#xA;      (list&#xA;    `(:propertize (&quot;&quot; mode-name)&#xA;      help-echo &quot;Major mode help message.&quot;&#xA;      face '(:foreground &quot;red&quot;)&#xA;      mouse-face '(:foreground &quot;blue&quot;)&#xA;      local-map ,mode-line-major-mode-keymap)&#xA;    `(:propertize (&quot;&quot; ,sorted-list)&#xA;      face '(:foreground &quot;purple&quot;)&#xA;      mouse-face '(:foreground &quot;blue&quot;)&#xA;      help-echo &quot;Minor mode help message.&quot;&#xA;      local-map ,mode-line-minor-mode-keymap))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-09-28T01:28:38.543" LastActivityDate="2015-09-28T01:28:38.543" Title="Sort minor-mode-alist alphabetically (in the mode-line) using :lighter" Tags="|mode-line|sorting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13494" PostTypeId="2" ParentId="13491" CreationDate="2015-06-27T17:03:42.290" Score="1" Body="&lt;p&gt;There are several things wrong with that code.  Here is an improvement, but it still does not serve the general case.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-format&#xA;      '((:eval&#xA;         (let* ((copy-of-list (copy-list minor-mode-alist))&#xA;                (sorted-list&#xA;                 (sort copy-of-list&#xA;                       (lambda (x y)&#xA;                         (let ((xname  (cadr x))&#xA;                               (yname  (cadr y)))&#xA;                           (when (symbolp xname) (setq xname  (symbol-value xname)))&#xA;                           (when (symbolp yname) (setq yname  (symbol-value yname)))&#xA;                           (when (and (stringp xname) (non-empty-name-p xname)&#xA;                                      (stringp yname) (non-empty-name-p yname))&#xA;                             (when (eq ?\s  (aref xname 0))&#xA;                               (setq x  (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; xname)))&#xA;                             (when (eq ?\s  (aref yname 0))&#xA;                               (setq y  (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; yname)))&#xA;                             (and (stringp x) (stringp y) (string&amp;lt; x y))))))))&#xA;           (list `(:propertize (&quot;&quot; ,sorted-list) face bold mouse-face highlight&#xA;                               help-echo &quot;This is a mouseover help message.&quot;&#xA;                               local-map ,mode-line-minor-mode-keymap))))))&#xA;&#xA;(defmacro non-empty-name-p (name)       ; Error if NAME is neither nil nor a string.&#xA;  &quot;NAME if non-nil and not \&quot;\&quot;, else nil.&quot;&#xA;  `(and ,name (not (string= &quot;&quot; ,name)) ,name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The general problem is that you are not handling the various cases of what the &lt;code&gt;cadr&lt;/code&gt; of &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; can be.  The above code handles the case where such a &lt;code&gt;cadr&lt;/code&gt; can be a symbol whose value is a string, e.g. &lt;code&gt;(eldoc-mode eldoc-minor-mode-string)&lt;/code&gt;.  But it does not yet handle the case where such a &lt;code&gt;cadr&lt;/code&gt; can be a list, such as &lt;code&gt;(text-scale-mode (&quot; &quot; text-scale-mode-lighter))&lt;/code&gt;.  You will need to tighten up such things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html&quot; rel=&quot;nofollow&quot;&gt;Mode Line Data&lt;/a&gt; for the various possibilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also forgot to put a comma in front of &lt;code&gt;sorted-list&lt;/code&gt;, so that symbol was being used instead of its value.  And you forgot to handle the &lt;code&gt;&quot;&quot;&lt;/code&gt; case for a string, which won't work with &lt;code&gt;aref...0&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For testing this kind of thing, evaluate the &lt;code&gt;let&lt;/code&gt; form that is passed to &lt;code&gt;:eval&lt;/code&gt;.  In that context you can insert calls to &lt;code&gt;debug&lt;/code&gt; or &lt;code&gt;message&lt;/code&gt; etc., to see what is going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-27T17:20:38.650" LastActivityDate="2015-06-27T17:20:38.650" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13495" PostTypeId="2" ParentId="13488" CreationDate="2015-06-27T17:58:43.953" Score="1" Body="&lt;p&gt;I write tcl code rather than prolog, so I tried your idea on &lt;code&gt;inferior-tcl-mode&lt;/code&gt; and it works as expected:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-inferior-tcl-complete ()&#xA;  (interactive)&#xA;  (helm :sources (helm-build-sync-source &quot;inferior tcl completion&quot;&#xA;                   :candidates (ring-elements comint-input-ring))))&#xA;&#xA;(add-hook 'inferior-tcl-mode-hook&#xA;          (lambda ()&#xA;            (define-key inferior-tcl-mode-map&#xA;              [remap completion-at-point] #'helm-inferior-tcl-complete)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS. Building helm source manually is the old way, nowadays, you might want to use the built-in macro/function/class provided by helm since it is easier to write and more readable. (related doc &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#254-building-sources&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/wiki#254-building-sources&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-06-27T18:05:50.177" LastActivityDate="2015-06-27T18:05:50.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13496" PostTypeId="2" ParentId="13485" CreationDate="2015-06-27T18:21:29.983" Score="2" Body="&lt;p&gt;It sounds like what you really want is &lt;code&gt;kill-emacs&lt;/code&gt;. In Windows, it's &lt;code&gt;Ctrl+F4&lt;/code&gt; that closes the &quot;frame&quot; (in apps that can have multiple windows), and it wouldn't close the app in any case that I can think of. Whereas &lt;code&gt;Alt+F4&lt;/code&gt; will close all of the child windows regardless (after prompting to save). So actually Emacs is parallel with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Answer moved from comment on question.)&lt;/p&gt;&#xA;" OwnerUserId="3896" LastActivityDate="2015-06-27T18:21:29.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13497" PostTypeId="1" AcceptedAnswerId="13498" CreationDate="2015-06-27T18:59:07.753" Score="1" ViewCount="196" Body="&lt;p&gt;How do you create options with radio boxes or check boxes in the menu bar?  I can't find any examples.&lt;/p&gt;&#xA;" OwnerUserId="2763" LastActivityDate="2015-06-27T20:35:08.340" Title="Adding a menu with radio boxes or check boxes" Tags="|menu-bar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13498" PostTypeId="2" ParentId="13497" CreationDate="2015-06-27T19:16:03.647" Score="1" Body="&lt;p&gt;See standard library &lt;code&gt;menu-bar.el&lt;/code&gt; and &lt;code&gt;C-h f menu-bar-make-toggle&lt;/code&gt;. Here are some examples from standard Emacs libraries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a checkbox (from &lt;code&gt;menu-bar.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key menu-bar-options-menu [case-fold-search]&#xA;  (menu-bar-make-toggle&#xA;    toggle-case-fold-search case-fold-search&#xA;    &quot;Ignore Case for Search&quot;&#xA;    &quot;Case-Insensitive Search %s&quot;&#xA;    &quot;Ignore letter-case in search commands&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a radio button (from &lt;code&gt;bubbles.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key bubbles-game-theme-menu [bubbles-set-game-hard]&#xA;  (list 'menu-item &quot;Hard&quot; 'bubbles-set-game-hard&#xA;        :button '(:radio . (eq bubbles-game-theme 'hard))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Extended-Menu-Items.html&quot; rel=&quot;nofollow&quot;&gt;Extended Menu Items&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-27T20:35:08.340" LastActivityDate="2015-06-27T20:35:08.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13499" PostTypeId="1" CreationDate="2015-06-27T21:00:30.237" Score="2" ViewCount="702" Body="&lt;p&gt;Hi all so last night I started using Emacs and I enjoyed it. Now I am looking to customize the look to the solarized port of Emacs. Now question is where is the &lt;code&gt;.emacs&lt;/code&gt; file in windows 8.1?  I have heard many answers to this question, I put my Emacs in &lt;code&gt;C:\Emacs&lt;/code&gt;.  So any ideas?&lt;/p&gt;&#xA;" OwnerUserId="8739" LastEditorUserId="10289" LastEditDate="2017-12-06T01:04:22.273" LastActivityDate="2017-12-06T01:04:22.273" Title="Where Is The .emacs file in Windows 8.1?" Tags="|microsoft-windows|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13500" PostTypeId="1" AcceptedAnswerId="13508" CreationDate="2015-06-27T21:09:56.193" Score="6" ViewCount="2919" Body="&lt;p&gt;People more knowlegable than I have suggested that intelligent fuzzy matching and sorting for both minibuffer completion and in-buffer completion could be accomplished by implementing a &lt;code&gt;completion-style&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A style that can match according to an arbitrary predicate and can sort according to an arbitrary comparison function would be ideal.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;completion-styles&lt;/code&gt; is a variable defined in &lt;code&gt;minibuffer.el&lt;/code&gt;. Its value is &lt;code&gt;(basic partial-completion emacs22)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  List of completion styles to use.&#xA;  The available styles are listed in &lt;code&gt;completion-styles-alist&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note that &lt;code&gt;completion-category-overrides&lt;/code&gt; may override these&#xA;  styles for specific categories, such as files, buffers, etc.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This variable was introduced, or its default value was changed, in version 23.1 of Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm would personally love to see fuzzy in-buffer completion (à la Visual Studio, Sublime Text, &lt;a href=&quot;https://github.com/Shougo/neocomplete.vim&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vim+Neocomplete&lt;/a&gt;, &lt;a href=&quot;https://github.com/Valloric/YouCompleteMe&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vim+YCM&lt;/a&gt;. However, after reading &lt;a href=&quot;https://emacs.stackexchange.com/questions/2671/how-can-i-get-fuzzy-code-completion&quot;&gt;&lt;code&gt;minibuffer.el&lt;/code&gt;&lt;/a&gt;, I'm completely lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be achieved?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a lot of interest in this problem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/company-mode/company-mode/issues/47&quot; rel=&quot;nofollow noreferrer&quot;&gt;[Github] Adding fuzzy matching to &lt;code&gt;company&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/lewang/flx/issues/54&quot; rel=&quot;nofollow noreferrer&quot;&gt;[Github] Implementing a completion style for &lt;code&gt;flx&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/2671/how-can-i-get-fuzzy-code-completion&quot;&gt;[Emacs.SE] How can I get fuzzy code completion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://superuser.com/questions/579847/is-there-emacs-plugins-to-do-sublime-like-completion-and-goto-anything&quot;&gt;[Superuser] Is there emacs plugins to do Sublime-like completion and goto anything?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/14016178/emacs-fuzzy-autocompletion&quot;&gt;[SO] Emacs fuzzy autocompletion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2013-12/msg00405.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;[Emacs ML] fuzzy auto-complete via &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.reddit.com/r/emacs/comments/1wgauv/autocomplete_with_flexidolike_matching/&quot; rel=&quot;nofollow noreferrer&quot;&gt;[Reddit] Auto-complete with flex/ido-like matching?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Of course, I'm not sure if anyone wants to use this without a framework, but you absolutely could.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-07-02T11:16:59.870" Title="fuzzy completion-style" Tags="|completion|minibuffer|fuzzy-search|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13501" PostTypeId="2" ParentId="13499" CreationDate="2015-06-27T21:33:19.093" Score="2" Body="&lt;p&gt;From inside Emacs, you can find out the path and file name with this command: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h v user-init-file RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Newer installations generally default to ~/.emacs.d but some custom installs put it in roaming or dropbox folders. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-06-27T21:33:19.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13502" PostTypeId="2" ParentId="2861" CreationDate="2015-06-27T21:46:03.530" Score="0" Body="&lt;p&gt;Although I got Emacs to work with some of the options here, I wasn't happy as the implementations were partly borked, just enough to be annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed the zshaolin app from Google Play. It's not free (a few dollars) but it does have an Emacs that seems fully usable, with keys working correctly and all the commands I've tried so far. It's an older Emacs, 24.1, and zshaolin just repackages a lot of things like Terminal IDE and others, but at least it works right. There are also a lot of other things like vi and Perl and so on.&lt;/p&gt;&#xA;" OwnerUserId="8740" LastActivityDate="2015-06-27T21:46:03.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13503" PostTypeId="1" CreationDate="2015-06-27T21:47:34.243" Score="0" ViewCount="916" Body="&lt;p&gt;So currently I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my .emacs file. Mind you I am using emacs 24.5. Every single time I run &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install solarized-theme&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get no match found. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="8739" LastEditorUserId="516" LastEditDate="2015-06-27T22:58:39.077" LastActivityDate="2015-09-26T00:46:18.470" Title="Problem Installing Solarized Theme For Emacs Via Melpa" Tags="|themes|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13504" PostTypeId="2" ParentId="13503" CreationDate="2015-06-27T21:51:33.570" Score="3" Body="&lt;p&gt;You have to run first &lt;code&gt;M-x package-list-packages&lt;/code&gt; for Emacs to refresh its package database.&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2015-06-27T21:51:33.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13505" PostTypeId="1" AcceptedAnswerId="13526" CreationDate="2015-06-27T22:09:20.167" Score="1" ViewCount="269" Body="&lt;p&gt;I'm trying to streamline my email-sending tasks into my org-mode workflow, and I’d like a way to quickly email a subtree to someone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to create a function that will:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;org-mime-subtree  &lt;/li&gt;&#xA;&lt;li&gt;insert my signature (including a link)&lt;/li&gt;&#xA;&lt;li&gt;org-mime-HTMLize  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's what I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-mime-subtree-and-HTMLize ()&#xA;  &quot;org-mime-subtree and HTMLize&quot;&#xA;  (interactive)&#xA;  (org-mime-subtree)&#xA;(insert &quot;\nBest,\nS.\n---\n &#xA;[[http://www.newyorkwritersintensive.com/][newyorkwritersintensive.com]]&quot;)&#xA;  (org-mime-htmlize)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run it, I get the error &quot;wrong number of arguments.&quot;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-06-27T22:24:01.937" LastActivityDate="2015-06-28T21:47:11.437" Title="a function to org-mime-subtree then org-mime-HTMLize?" Tags="|org-mime|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13507" PostTypeId="2" ParentId="13500" CreationDate="2015-06-27T23:59:27.173" Score="2" Body="&lt;p&gt;Others will no doubt provide information more directly specialized for in-buffer text completion, which is what I think your question is mainly asking about.&#xA;For my part, I offer this info.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There are many kinds of matching that are loosely called &quot;&lt;em&gt;fuzzy&lt;/em&gt;&quot;.  Some are quite simple; others are complex and sometimes costly in terms of computation.  Find out about what different ones are, and judge whether you think they fit your different use cases - just as there are different kinds of fuzzy matching, so there are different uses of fuzzy matching/completion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Out of the box, &lt;code&gt;completion-styles&lt;/code&gt; in vanilla Emacs provides some match methods that one could very loosely call &quot;fuzzy&quot;, but which are not typically thought of as such - in particular, the so-called &lt;code&gt;partial-completion&lt;/code&gt; style.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A common &quot;poor man's&quot; fuzzy matching is sometimes used, which is cheap to use and easy to implement.  It amounts to using a regexp that matches any succession of characters between a sequence of specified characters. That is, you type some characters in succession and they are matched in order against text that can contain arbitrary strings of characters between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs, Ido mode calls this &lt;em&gt;flex&lt;/em&gt; matching, and Icicles (see next) calls it &lt;em&gt;scatter matching&lt;/em&gt; (the chars you type are matched in a scattered, but ordered way against the target).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am most familiar with my library &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;, which supports &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;several kinds of fuzzy matching&lt;/em&gt;&lt;/a&gt; whenever completion is used. The rest of my answer describes Icicles support for fuzzy matching.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Icicles completion typically uses the minibuffer, even when you complete buffer text.  This is different from most Emacs UIs for completing buffer text, which typically either (1) insert a completion candidate and let you hit a key to cycle to the next candidate or (2) pop up a menu of candidates for you to cycle through, to select one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Icicles uses the traditional buffer &lt;code&gt;*Completions*&lt;/code&gt; to show completion candidates.  You can cycle among them to select one, or you can type some more characters or otherwise edit your minibuffer input to narrow the selection and choose one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example, in &lt;em&gt;Icicle&lt;/em&gt; mode if you complete buffer text using standard Emacs library &lt;code&gt;completion.el&lt;/code&gt;'s &lt;em&gt;dynamic completion mode&lt;/em&gt; (&lt;code&gt;M-RET&lt;/code&gt;) then whenever there are multiple completion candidates for the text you want to complete Icicles pops them up in buffer &lt;code&gt;*Completions*&lt;/code&gt;. Likewise, if you use the &lt;em&gt;dynamic abbreviation&lt;/em&gt; of standard Emacs library &lt;code&gt;dabbrev.el&lt;/code&gt; (&lt;code&gt;C-M-/&lt;/code&gt;). Or if you complete file or command names in shell mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Completion_in_Other_Buffers&quot; rel=&quot;nofollow&quot;&gt;This page&lt;/a&gt; summarizes Icicles in-buffer completion of text.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;More typically, you use Icicles completion for input that responds to a minibuffer prompt - input that can be used for anything - not necessarily inserted in the current buffer as a completion of text that precedes it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it does not matter which kind of completion you use in Icicles - in-buffer text completion or minibuffer input completion.  For all completion with Icicles you can use fuzzy matching.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And you can &lt;em&gt;change the matching mode on the fly&lt;/em&gt;, at any time. The doc page about &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion&quot; rel=&quot;nofollow&quot;&gt;fuzzy Icicles completion&lt;/a&gt; covers this, and it is described further in #4, below.&#xA;As far as I know, this feature is not available from other completion interfaces.  Different kinds of matching can be more or less useful for different kinds of completion in different contexts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Icicles matching methods are grouped on two different completion keys - by default &lt;code&gt;TAB&lt;/code&gt; and &lt;code&gt;S-TAB&lt;/code&gt;.  The &lt;code&gt;TAB&lt;/code&gt; methods I refer to loosely as &quot;&lt;em&gt;prefix&lt;/em&gt;&quot; completion methods, and the &lt;code&gt;S-TAB&lt;/code&gt; methods I refer to loosely as `&lt;em&gt;apropos&lt;/em&gt;&quot; completion methods.  The various methods are described on the &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion&quot; rel=&quot;nofollow&quot;&gt;fuzzy matching&lt;/a&gt; page of the Icicles doc.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;TAB&lt;/code&gt;&lt;/strong&gt; groups (1) &lt;code&gt;basic&lt;/code&gt; prefix matching, (2) the &lt;code&gt;vanilla&lt;/code&gt; matching defined by Emacs option &lt;code&gt;completion-styles&lt;/code&gt; (what you get with vanilla Emacs), (3) &lt;code&gt;fuzzy&lt;/code&gt; matching, and (4) &lt;code&gt;swank&lt;/code&gt; matching methods.  &lt;strong&gt;&lt;code&gt;C-(&lt;/code&gt;&lt;/strong&gt; during completion cycles among these.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;S-TAB&lt;/code&gt;&lt;/strong&gt; groups (1) &lt;code&gt;apropos&lt;/code&gt;, (2) &lt;code&gt;scatter&lt;/code&gt;, (3) &lt;code&gt;Levenshtein&lt;/code&gt;, (4) &lt;code&gt;Levenshtein strict&lt;/code&gt;, and (5) &lt;code&gt;Jaro-Winkler&lt;/code&gt; matching methods.  &lt;strong&gt;&lt;code&gt;M-(&lt;/code&gt;&lt;/strong&gt; during completion cycles among these.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;By default (i.e., unless you cycle to another method), &lt;code&gt;TAB&lt;/code&gt; does &lt;code&gt;basic&lt;/code&gt; prefix completion and &lt;code&gt;S-TAB&lt;/code&gt; does &lt;code&gt;apropos&lt;/code&gt; completion, which uses &lt;em&gt;regexp&lt;/em&gt; matching.  You can use &lt;strong&gt;&lt;code&gt;C-`&lt;/code&gt;&lt;/strong&gt; to toggle whether &lt;code&gt;apropos&lt;/code&gt; completion uses regexp matching or substring matching (escaping regexp special chars).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can customize which method is used by default for &lt;code&gt;TAB&lt;/code&gt; and for &lt;code&gt;S-TAB&lt;/code&gt;.  So for example, if you generally like vanilla Emacs completion, as controlled by option &lt;code&gt;completing-styles&lt;/code&gt;, then you can make &lt;code&gt;vanilla&lt;/code&gt;, instead of &lt;code&gt;basic&lt;/code&gt;, be the default method for &lt;code&gt;TAB&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-28T00:06:53.293" LastActivityDate="2015-06-28T00:06:53.293" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13508" PostTypeId="2" ParentId="13500" CreationDate="2015-06-28T00:42:00.877" Score="4" Body="&lt;p&gt;Some comments:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The Emacs completion system is focused on completion, i.e. actually putting characters into the buffer; while other systems are focused on narrowing down a list of candidate for display and letting the user make a choice.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sorting is determined by the completion table (i.e. the source) and not the completion-style. I think one option would be to use &lt;code&gt;completion-in-region-function&lt;/code&gt; and implement a different front-end, which may query the current completion-style via some to-be-defined interface about how to sort it's candidates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How to write a completion-style is left as an exercise to ther user.  Seriously, it is not very well documented, especially how to handle the boundaries right for filename completion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Anyway, here is some working code.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun completion-naive-fuzzy-completion (string table predicate point&#xA;                                                 &amp;amp;optional all-p)&#xA;  (let* ((beforepoint (substring string 0 point))&#xA;         (afterpoint (substring string point))&#xA;         (boundaries (completion-boundaries beforepoint table predicate afterpoint))&#xA;         (prefix (substring beforepoint 0 (car boundaries)))&#xA;         (infix (concat&#xA;                 (substring beforepoint (car boundaries))&#xA;                 (substring afterpoint 0 (cdr boundaries))))&#xA;         (suffix (substring afterpoint (cdr boundaries)))&#xA;         ;; |-              string                  -|&#xA;         ;;              point^&#xA;         ;;            |-  boundaries -|&#xA;         ;; |- prefix -|-    infix    -|-  suffix   -|&#xA;         ;;&#xA;         ;; Infix is the part supposed to be completed by table, AFAIKT.&#xA;         (regexp (concat &quot;\\`&quot;&#xA;                         (mapconcat&#xA;                          (lambda (x)&#xA;                            (concat &quot;[^&quot; (string x) &quot;]*?&quot; (string x)))&#xA;                          infix&#xA;                          &quot;&quot;)&#xA;                         &quot;.*\\'&quot;))&#xA;         (candidates (cl-remove-if-not&#xA;                      (apply-partially 'string-match-p regexp)&#xA;                      (all-completions prefix table predicate))))&#xA;    (if all-p&#xA;        ;; Implement completion-all-completions interface&#xA;        (when candidates&#xA;          ;; Not doing this may result in an error.&#xA;          (setcdr (last candidates) (length prefix))&#xA;          candidates)&#xA;      ;; Implement completion-try-completions interface&#xA;      (cond&#xA;       ((and (= (length candidates) 1)&#xA;             (equal infix (car candidates)))&#xA;        t)&#xA;       ((= (length candidates) 1)&#xA;        ;; Avoid quirk of double / for filename completion. I don't&#xA;        ;; know how this is *supposed* to be handled.&#xA;        (when (and (&amp;gt; (length (car candidates)) 0)&#xA;                   (&amp;gt; (length suffix) 0)&#xA;                   (char-equal (aref (car candidates)&#xA;                                     (1- (length (car candidates))))&#xA;                               (aref suffix 0)))&#xA;          (setq suffix (substring suffix 1)))&#xA;        (cons (concat prefix (car candidates) suffix)&#xA;              (length (concat prefix (car candidates)))))&#xA;       ;; Do nothing, i.e leave string as it is.&#xA;       (t (cons string point))))))&#xA;&#xA;(defun completion-naive-fuzzy-try-completion (string table predicate point)&#xA;  (completion-naive-fuzzy-completion string table predicate point))&#xA;(defun completion-naive-fuzzy-all-completions (string table predicate point)&#xA;  (completion-naive-fuzzy-completion string table predicate point 'all))&#xA;&#xA;(add-to-list 'completion-styles-alist&#xA;             '(naive-fuzzy&#xA;               completion-naive-fuzzy-try-completion&#xA;               completion-naive-fuzzy-all-completions&#xA;               &quot;Simple naive-fuzzy completion, which never alters the string to complete, unless a unique match exists.&quot;))&#xA;&#xA;;; (setq-local completion-styles '(naive-fuzzy))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2015-07-02T11:16:59.870" LastActivityDate="2015-07-02T11:16:59.870" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13509" PostTypeId="2" ParentId="13485" CreationDate="2015-06-28T04:32:03.223" Score="1" Body="&lt;p&gt;Since you are using Spacemacs, I suppose you set &lt;code&gt;dotspacemacs-persistent-server&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. Then you should be able to kill the current frame with &lt;code&gt;SPC q z&lt;/code&gt;. Note that I don't use that myself and I cannot verify it right now. There is also some documentation about it there: &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/5baa70057b4b2bfebce3ec8918101a252e00c405/doc/DOCUMENTATION.org#keeping-the-server-alive&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syl20bnr/spacemacs/blob/5baa70057b4b2bfebce3ec8918101a252e00c405/doc/DOCUMENTATION.org#keeping-the-server-alive&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-06-28T04:32:03.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13510" PostTypeId="1" AcceptedAnswerId="13523" CreationDate="2015-06-28T08:27:57.407" Score="0" ViewCount="258" Body="&lt;p&gt;I have a html snippet like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;body&amp;gt;&#xA;  &amp;lt;ul&amp;gt;&#xA;    &amp;lt;li&amp;gt;jasmine&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;cinthia&amp;lt;/li&amp;gt;&#xA;  &amp;lt;/ul&amp;gt;&#xA;&amp;lt;/body&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to wrap the ul element (after selection) inside a div element in web-mode like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;body&amp;gt;&#xA;  &amp;lt;div&amp;gt;   &amp;lt;!--- inserted via function ---&amp;gt;&#xA;    &amp;lt;ul&amp;gt;   &#xA;      &amp;lt;li&amp;gt;jasmine&amp;lt;/li&amp;gt;&#xA;      &amp;lt;li&amp;gt;cinthia&amp;lt;/li&amp;gt;&#xA;    &amp;lt;/ul&amp;gt;&#xA;  &amp;lt;/div&amp;gt;   &amp;lt;!--- inserted via function ---&amp;gt;&#xA;&amp;lt;/body&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use web-mode for html files.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2015-06-28T14:05:52.887" LastActivityDate="2015-06-28T20:01:24.990" Title="Function to wrap html snippet in a div/span element in web-mode" Tags="|html|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13511" PostTypeId="2" ParentId="13489" CreationDate="2015-06-28T10:35:15.267" Score="9" Body="&lt;p&gt;There is a package called pyvenv to manage virtual environmnets in emacs. Try installing it with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`M-x package-install RET pyvenv RET`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now You to activate env in your emacs, You can run &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x pyvenv-activate RET &amp;lt;path-to-venv&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Checkout: &lt;a href=&quot;https://github.com/jorgenschaefer/pyvenv&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/jorgenschaefer/pyvenv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For per project management, You can use hooks to activate venv automatically.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-06-28T10:35:15.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13512" PostTypeId="2" ParentId="9823" CreationDate="2015-06-28T13:46:31.813" Score="6" Body="&lt;p&gt;There are already some different ways to show ispell correction candidates, I guess you just meant correcting misspelled word in a popup menu, not company-mode itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To correct misspelled word at point, both built-in &lt;kbd&gt;M-$&lt;/kbd&gt; (&lt;code&gt;ispell-word&lt;/code&gt;) and &lt;kbd&gt;C-c $&lt;/kbd&gt; (&lt;code&gt;flyspell-correct-word-before-point&lt;/code&gt;) works great, the former uses a buffer to show correction choices, while the later uses a GUI popup menu:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/J5NzP.png&quot; alt=&quot;Running flyspell-correct-word-before-point on &amp;quot;flyspell&amp;quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;hr /&gt;&#xA;There are also some other interface like popup and helm:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/xuchunyang/flyspell-popup&quot; rel=&quot;noreferrer&quot;&gt;flyspell-popup&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uAbHE.png&quot; alt=&quot;flyspell-popup demo&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/pronobis/helm-flyspell&quot; rel=&quot;noreferrer&quot;&gt;helm-flyspell&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tcy79.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-06-28T13:46:31.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13513" PostTypeId="1" AcceptedAnswerId="13522" CreationDate="2015-06-28T14:14:55.733" Score="1" ViewCount="320" Body="&lt;p&gt;I forgot what a key is bound to, so I decided to run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h k &amp;lt;my key binding&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But after pressing &lt;code&gt;C-h k&lt;/code&gt;, I've remembered about that key binding and decided to quit. So I pressed &lt;code&gt;C-g&lt;/code&gt;. Instead of quitting that command, &lt;code&gt;describe-key&lt;/code&gt; described about &lt;code&gt;C-g&lt;/code&gt;. I tried various other quit functions but they didn't work. I am wondering how to quit &lt;code&gt;describe-key&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="306" LastEditDate="2015-06-28T19:55:11.253" LastActivityDate="2015-06-28T21:47:16.707" Title="how to quit describe-key function?" Tags="|key-bindings|quitting|builtin|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13514" PostTypeId="1" AcceptedAnswerId="13518" CreationDate="2015-06-28T16:08:42.927" Score="9" ViewCount="1293" Body="&lt;p&gt;For linguists and many other scientists, analyzing the frequency of the words appearing in a text is a great tool. Some commercial text editors and some websites provide this tool.&lt;/p&gt;&#xA;&lt;p&gt;In word frequency analysis, sort the words in decreasing order with respect to their frequency. For example in this text:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Emacs Stack Exchange is a question and answer site for those using, extending, or developing the emacs text editor. It's built and run by you as part of the Stack Exchange network of Q&amp;amp;A sites. With your help, we're working together to build a library of detailed answers to every question about emacs.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;we have:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;56 words&#xA;9: punctuation marks&#xA;&#xA;3: ,&#xA;3: .&#xA;3: a&#xA;3: emacs&#xA;3: of&#xA;2: '&#xA;2: and&#xA;2: exchange&#xA;2: question&#xA;2: stack&#xA;2: the&#xA;2: to&#xA;1: &amp;amp;&#xA;1: about&#xA;1: answer&#xA;1: answers&#xA;1: as&#xA;1: build&#xA;1: built&#xA;1: by&#xA;1: detailed&#xA;1: developing&#xA;1: editor&#xA;1: every&#xA;1: extending&#xA;1: for&#xA;1: help&#xA;1: is&#xA;1: it&#xA;1: library&#xA;1: network&#xA;1: or&#xA;1: part&#xA;1: q&#xA;1: re&#xA;1: run&#xA;1: s&#xA;1: site&#xA;1: sites&#xA;1: text&#xA;1: those&#xA;1: together&#xA;1: using&#xA;1: we&#xA;1: with&#xA;1: working&#xA;1: you&#xA;1: your&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I am wondering if there exists already a package which can be used to provide such statistics.&lt;/p&gt;&#xA;&lt;p&gt;PS I have already asked different question in the same spirit and an &lt;a href=&quot;https://emacs.stackexchange.com/a/8071/&quot;&gt;excellent answer&lt;/a&gt;  was provided (I wish to upvote it more if I could).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="14825" LastEditDate="2022-03-26T01:36:35.517" LastActivityDate="2022-03-26T01:36:35.517" Title="How to obtain the statistic of the frequency of words in a buffer" Tags="|text|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="13515" PostTypeId="1" AcceptedAnswerId="13517" CreationDate="2015-06-28T16:27:38.600" Score="2" ViewCount="134" Body="&lt;p&gt;I'd like to get the string representation of a keymap event. For instance &lt;code&gt;19&lt;/code&gt; should be printed as &lt;code&gt;C-s&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt; as &lt;code&gt;C-a&lt;/code&gt; etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could make my own function to do that but since &lt;code&gt;describe-key&lt;/code&gt;is capable of printing the string representation of an event there must be a built-in function to do that somewhere. I looked into the manual and browsed some code and was not able to found it.&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-06-28T17:46:50.353" Title="How to get the string representation of a keymap event?" Tags="|string|events|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13516" PostTypeId="2" ParentId="13514" CreationDate="2015-06-28T17:16:44.507" Score="4" Body="&lt;p&gt;Eval the following code and type M-x word-frequency in a buffer with the text. You will get a buffer with the number of word occurence and percent value. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar word-frequency-table (make-hash-table :test 'equal :size 128))&#xA;&#xA;(defvar word-frequency-buffer &quot;*frequencies*&quot;&#xA;  &quot;Buffer where frequencies are displayed.&quot;)&#xA;&#xA;(defun word-frequency-incr (word)&#xA;  (puthash word (1+ (gethash word word-frequency-table 0)) word-frequency-table))&#xA;&#xA;(defun word-frequency-list (&amp;amp;optional reverse limit)&#xA;  &quot;Returns a cons which car is sum of times any word was used&#xA;and cdr is a list of (word . count) pairs.  If REVERSE is nil&#xA;sorts it starting from the most used word; if it is 'no-sort&#xA;the list is not sorted; if it is non-nil and not 'no-sort sorts&#xA;it from the least used words.  If LIMIT is positive number&#xA;only words which were used more then LIMIT times will be&#xA;added.  If it is negative number only words which were used&#xA;less then -LIMIT times will be added.&quot;&#xA;  (let (l (sum 0))&#xA;    (maphash&#xA;     (cond&#xA;      ((or (not (numberp limit)) (= limit 0))&#xA;       (lambda (k v) (setq l (cons (cons k v) l) sum (+ sum v))))&#xA;      ((= limit -1) (lambda (k v) (setq sum (+ sum v))))&#xA;      ((&amp;lt; limit 0)&#xA;       (setq limit (- limit))&#xA;       (lambda (k v) (setq sum (+ sum v))&#xA;         (if (&amp;lt; v limit) (setq l (cons (cons k v) l)))))&#xA;      (t&#xA;       (lambda (k v) (setq sum (+ sum v))&#xA;         (if (&amp;gt; v limit) (setq l (cons (cons k v) l))))))&#xA;     word-frequency-table)&#xA;    (cons sum&#xA;          (cond&#xA;           ((equal reverse 'no-sort) l)&#xA;           (reverse (sort l (lambda (a b) (&amp;lt; (cdr a) (cdr b)))))&#xA;           (t       (sort l (lambda (a b) (&amp;gt; (cdr a) (cdr b)))))))))&#xA;&#xA;(defun word-frequency-string (&amp;amp;optional reverse limit func)&#xA;  &quot;Returns formatted string with word usage statistics.&#xA;&#xA;If FUNC is nil each line contains number of times word was&#xA;called and the word; if it is t percentage usage is added in&#xA;the middle; if it is 'raw each line will contain number an&#xA;word separated by single line (with no formatting) otherwise&#xA;FUNC must be a function returning a string which will be called&#xA;for each entry with three arguments: number of times word was&#xA;called, percentage usage and the word.&#xA;&#xA;See `word-frequency-list' for description of REVERSE and LIMIT&#xA;arguments.&quot;&#xA;  (let* ((list (word-frequency-list reverse)) (sum (car list)))&#xA;    (mapconcat&#xA;     (cond&#xA;      ((not func) (lambda (e) (format &quot;%7d  %s\n&quot; (cdr e) (car e))))&#xA;      ((equal func t)&#xA;       (lambda (e) (format &quot;%7d  %6.2f%%  %03d %s\n&quot;&#xA;                           (cdr e) &#xA;               (/ (* 1e2 (cdr e)) sum) &#xA;               (length (car e))&#xA;               (car e))))&#xA;      ((equal func 'raw) (lambda (e) (format &quot;%d %s\n&quot; (cdr e) (car e))))&#xA;      (t (lambda (e) (funcall func (cdr e) (/ (* 1e2 (cdr e)) sum) (car e)))))&#xA;     (cdr list) &quot;&quot;)))&#xA;&#xA;(defun word-frequency (&amp;amp;optional where reverse limit func)&#xA;  &quot;Formats word usage statistics using&#xA;`word-frequency-string' function (see for description of&#xA;REVERSE, LIMIT and FUNC arguments) and:&#xA;- if WHERE is nil inserts it in th e&#xA;  or displays it in echo area if possible; else&#xA;- if WHERE is t inserts it in the current buffer; else&#xA;- if WHERE is an empty string inserts it into&#xA;  `word-frequency-buffer' buffer; else&#xA;- inserts it into buffer WHERE.&#xA;&#xA;When called interactively behaves as if WHERE and LIMIT were nil,&#xA;FUNC was t and:&#xA;- with no prefix argument - REVERSE was nil;&#xA;- with universal or positive prefix arument - REVERSE was t;&#xA;- with negative prefix argument - REVERSE was 'no-sort.&quot;&#xA;&#xA;  (interactive (list nil&#xA;                     (cond&#xA;                      ((not current-prefix-arg) nil)&#xA;                      ((&amp;gt; (prefix-numeric-value current-prefix-arg) 0))&#xA;                      (t 'no-sort))&#xA;                     nil t))&#xA;  (clrhash word-frequency-table)&#xA;  (word-frequency-process-buffer)&#xA;  (cond&#xA;   ((not where)&#xA;    (display-message-or-buffer (word-frequency-string reverse limit func)&#xA;                               word-frequency-buffer))&#xA;   ((equal where t)&#xA;    (insert (word-frequency-string reverse limit func)))&#xA;   (t&#xA;    (display-buffer&#xA;     (if (and (stringp where) (string= where &quot;&quot;))&#xA;         word-frequency-buffer where)&#xA;     (word-frequency-string reverse limit func)))))&#xA;&#xA;(defun word-frequency-process-buffer ()&#xA;  (interactive)&#xA;  (let ((buffer (current-buffer))&#xA;        bounds&#xA;        beg&#xA;        end&#xA;        word)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward &quot;\\&amp;lt;[[:word:]]+\\&amp;gt;&quot; nil t)&#xA;;;    (while (forward-word 1)&#xA;        (word-frequency-incr (downcase (match-string 0)))&#xA;;;      (setq bounds (bounds-of-thing-at-point 'word))&#xA;;;      (setq beg (car bounds))&#xA;;;      (setq end (cdr bounds))&#xA;;;      (setq word (downcase (buffer-substring-no-properties beg end)))&#xA;;;      (word-frequency-incr word)&#xA;        ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8745" LastActivityDate="2015-06-28T17:16:44.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13517" PostTypeId="2" ParentId="13515" CreationDate="2015-06-28T17:46:50.353" Score="5" Body="&lt;p&gt;If a single key/character, just use function &lt;code&gt;single-key-description&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(single-key-description 19) ; =&amp;gt; &quot;C-s&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If a list of characters, convert them to a string and use function &lt;code&gt;key-description&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-description (string 19 25 20 5 43)) ; =&amp;gt; &quot;C-s C-y C-c C-e +&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If a key sequence as a string, use function &lt;code&gt;key-description&lt;/code&gt;.  (Here I write &lt;code&gt;&quot;^Y&quot;&lt;/code&gt; etc when I mean the string with a single control char, &lt;code&gt;^Y&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-description &quot;^S^Y^T^e+&quot;) ; =&amp;gt; &quot;C-s C-y C-c C-e +&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-28T17:46:50.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13518" PostTypeId="2" ParentId="13514" CreationDate="2015-06-28T18:18:26.300" Score="8" Body="&lt;p&gt;The format of output (org-mode table) is inspired by &lt;a href=&quot;https://emacs.stackexchange.com/a/8071/3889&quot;&gt;the link&lt;/a&gt; in your question.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defvar punctuation-marks '(&quot;,&quot;&#xA;                            &quot;.&quot;&#xA;                            &quot;'&quot;&#xA;                            &quot;&amp;amp;&quot;&#xA;                            &quot;\&quot;&quot;)&#xA;  &quot;List of Punctuation Marks that you want to count.&quot;)&#xA;&#xA;(defun count-raw-word-list (raw-word-list)&#xA;  (cl-loop with result = nil&#xA;           for elt in raw-word-list&#xA;           do (cl-incf (cdr (or (assoc elt result)&#xA;                             (first (push (cons elt 0) result)))))&#xA;           finally return (sort result&#xA;                                (lambda (a b) (string&amp;lt; (car a) (car b))))))&#xA;&#xA;(defun word-stats ()&#xA;  (interactive)&#xA;  (let* ((words (split-string&#xA;                 (downcase (buffer-string))&#xA;                 (format &quot;[ %s\f\t\n\r\v]+&quot;&#xA;                         (mapconcat #'identity punctuation-marks &quot;&quot;))&#xA;                 t))&#xA;         (punctuation-marks (cl-remove-if-not&#xA;                             (lambda (elt) (member elt punctuation-marks))&#xA;                             (split-string (buffer-string) &quot;&quot; t )))&#xA;         (raw-word-list (append punctuation-marks words))&#xA;         (word-list (count-raw-word-list raw-word-list)))&#xA;    (with-current-buffer (get-buffer-create &quot;*word-statistics*&quot;)&#xA;      (erase-buffer)&#xA;      (insert &quot;| word | occurences |&#xA;               |-----------+------------|\n&quot;)&#xA;&#xA;      (dolist (elt word-list)&#xA;        (insert (format &quot;| '%s' | %d |\n&quot; (car elt) (cdr elt))))&#xA;&#xA;      (org-mode)&#xA;      (indent-region (point-min) (point-max))&#xA;      (goto-char 100)&#xA;      (org-cycle)&#xA;      (goto-char 79)&#xA;      (org-table-sort-lines nil ?N)))&#xA;  (pop-to-buffer &quot;*word-statistics*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-11-04T03:53:08.933" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13519" PostTypeId="1" AcceptedAnswerId="13521" CreationDate="2015-06-28T19:30:38.633" Score="1" ViewCount="207" Body="&lt;p&gt;I have started programming in C++ recently and have been testing using classes.&#xA;What I have noticed is that if I declare a variable before my methods like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Test {&#xA;    int value;&#xA;public:&#xA;    int getValue() const;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the &lt;code&gt;public:&lt;/code&gt; is not colorized. But if I don't write the &lt;code&gt;int value;&lt;/code&gt; at all, then the &lt;code&gt;public:&lt;/code&gt; is colored blue, making it stand out more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't just an error with &lt;code&gt;public:&lt;/code&gt;, its a general rule error because having the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Test {&#xA;private:&#xA;    int value;&#xA;public:&#xA;    int getValue() const;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will colorized &lt;code&gt;private:&lt;/code&gt; but not &lt;code&gt;public:&lt;/code&gt;. (Here the line &lt;code&gt;int value;&lt;/code&gt; could still be removed and &lt;code&gt;public:&lt;/code&gt; would still not be colored differently).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a fix for this that I can put in my &lt;code&gt;$HOME/.emacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8725" LastActivityDate="2015-06-30T18:29:48.543" Title="C++ inconsistent foreground colors" Tags="|c++|colors|coloring|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13520" PostTypeId="1" AcceptedAnswerId="13525" CreationDate="2015-06-28T19:39:26.307" Score="1" ViewCount="338" Body="&lt;p&gt;I want to write a function that will write the output of &lt;code&gt;wc -l &amp;lt;file-name&amp;gt;&lt;/code&gt; next to each file in dired mode.&#xA;I got to this point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-dired-insert-add-wc (beg end)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (&amp;lt; (point) end)&#xA;      (condition-case nil&#xA;          (when (dired-move-to-filename)&#xA;            (shell-command &quot;wc -l *&quot;)) ;; &amp;lt;--- `shell-command` contains what I need&#xA;        (error nil))&#xA;      (forward-line 1))))&#xA;&#xA;(advice-add 'dired-insert-set-properties&#xA;            :after #'my-dired-insert-add-wc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, running this outputs &lt;code&gt;wc -l *&lt;/code&gt; into another buffer. So I decided to read &lt;code&gt;shell-command&lt;/code&gt; to see how it works internally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two things I dont understand:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What role does this program play in the &lt;code&gt;shell-command&lt;/code&gt; function?&#xA;I mean, I understand that it read  from the mini-buffer, but where is that fed into? Like, it's not an argument to anything else. So how does the rest of the program uses it? It's right in the beginning of the function shell-command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(interactive&#xA;   (list&#xA;    (read-shell-command &quot;Async shell command: &quot; nil nil&#xA;            (let ((filename&#xA;                   (cond&#xA;                (buffer-file-name)&#xA;                ((eq major-mode 'dired-mode)&#xA;                 (dired-get-filename nil t)))))&#xA;              (and filename (file-relative-name filename))))&#xA;    current-prefix-arg&#xA;    shell-command-default-error-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Where does the variable &lt;code&gt;command&lt;/code&gt; gets it's value?&#xA;It doesnt seems to be assigned to anywhere.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process shell-file-name nil&#xA;      (if error-file&#xA;          (list t error-file)&#xA;        t)&#xA;      nil shell-command-switch command)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So, to recapitaluete, I want to write the number of lines each file has in a dired buffer. I have written a small program that does something like what I want but the downside is that it outputs it into another buffer instead of the dired buffer. So I went to study the function &lt;code&gt;shell-command&lt;/code&gt; to learn more about how to achieve my goal. I now have two question about the function &lt;code&gt;shell-command&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please answer my two questions about the &lt;code&gt;shell-command&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="105" LastEditDate="2019-12-31T18:54:19.857" LastActivityDate="2019-12-31T18:54:19.857" Title="What does the (interactive ...) form mean?" Tags="|shell-command|interactive|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="13521" PostTypeId="2" ParentId="13519" CreationDate="2015-06-28T19:47:04.960" Score="1" Body="&lt;p&gt;By default, Emacs opens files ending in &lt;code&gt;.h&lt;/code&gt; in C mode. If you would like to open them in C++ (where &lt;code&gt;private&lt;/code&gt; and &lt;code&gt;public&lt;/code&gt; will be highlighted as keywords), you can add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(&quot;\\.h\\'&quot; . c++-mode) auto-mode-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or (even better):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.h\\'&quot; . c++-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-06-30T18:29:48.543" LastActivityDate="2015-06-30T18:29:48.543" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13522" PostTypeId="2" ParentId="13513" CreationDate="2015-06-28T19:49:32.607" Score="7" Body="&lt;p&gt;You cannot quit the &lt;code&gt;describe-key&lt;/code&gt; command. The reason is simple: it cannot know whether you changed your mind about requiring a description of a key or whether you want a description of the key &lt;kbd&gt;C-g&lt;/kbd&gt;. So it assumes it's the latter, because otherwise it would be impossible to get a description of that key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will just have to live with the &lt;code&gt;*Help*&lt;/code&gt; buffer being displayed in some window. Usually you should be able to make the window/buffer go away by pressing &lt;kbd&gt;C-x o&lt;/kbd&gt; and then &lt;kbd&gt;q&lt;/kbd&gt;. Or you could just use &lt;kbd&gt;C-h c&lt;/kbd&gt; (&lt;code&gt;describe-key-briefly&lt;/code&gt;) instead. That doesn't create a window.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-06-28T21:47:16.707" LastActivityDate="2015-06-28T21:47:16.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13523" PostTypeId="2" ParentId="13510" CreationDate="2015-06-28T20:01:24.990" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;M-x web-mode-element-wrap&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="197" LastActivityDate="2015-06-28T20:01:24.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13524" PostTypeId="2" ParentId="13520" CreationDate="2015-06-28T20:08:08.383" Score="5" Body="&lt;p&gt;Given the function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (arg1 arg2)&#xA;  (interactive (list 'interactive-value1 'interactive-value2)&#xA;  (message &quot;%s %s&quot; arg1 arg2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You would get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo 'value1 'value2) =&amp;gt; &quot;value1 value2&quot;&#xA;(call-interactively 'foo) =&amp;gt; &quot;interactive-value1 interactive-value2&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when actually using &lt;code&gt;foo&lt;/code&gt; as a command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x foo RET =&amp;gt; &quot;interactive-value1 interactive-value2&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Here &lt;code&gt;=&amp;gt;&lt;/code&gt; means &quot;shows in minibuffer&quot;, usually it means &quot;returns value&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first result google returns when asked about &quot;emacs interactive&quot; is this: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&lt;/a&gt;. You would get similar information if you did &lt;kbd&gt;C-h f interactive RET&lt;/kbd&gt; in Emacs. Another useful key binding is &lt;kbd&gt;C-h k&lt;/kbd&gt;, try it &quot;on itself&quot; (&lt;kbd&gt;C-h k C-h k&lt;/kbd&gt;) and on &lt;kbd&gt;C-h f&lt;/kbd&gt; too.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-10-09T15:54:27.490" LastActivityDate="2017-10-09T15:54:27.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13525" PostTypeId="2" ParentId="13520" CreationDate="2015-06-28T21:26:50.137" Score="1" Body="&lt;p&gt;Here is a working example of the project outlined by the original poster, which is based upon the comment by &lt;em&gt;politza&lt;/em&gt; above -- the other comments and answer address the fundamental concepts at issue in the original question.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-dired-insert-add-wc ()&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (re-search-forward directory-listing-before-filename-regexp nil t)&#xA;    (while (line-move 1 t)&#xA;      (let* (&#xA;          string&#xA;          (inhibit-read-only t)&#xA;          (filename (car (dired-get-marked-files)))&#xA;          (green-light&#xA;            (and&#xA;              filename&#xA;              (not (file-directory-p filename))&#xA;              (file-exists-p filename))) )&#xA;        (when green-light&#xA;          (setq string (shell-command-to-string (concat &quot;wc -l &quot; filename)))&#xA;          (setq string (replace-regexp-in-string &quot;^\s+\\|\n&quot; &quot;&quot; string))&#xA;          (end-of-line)&#xA;          (insert &quot; -- &quot; string))))))&#xA;&#xA;(add-hook 'dired-after-readin-hook 'my-dired-insert-add-wc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-06-28T21:35:03.687" LastActivityDate="2015-06-28T21:35:03.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13526" PostTypeId="2" ParentId="13505" CreationDate="2015-06-28T21:47:11.437" Score="2" Body="&lt;p&gt;The issue described by the original poster is caused by using &lt;code&gt;org-mime-htmlize&lt;/code&gt; on a non-interactive basis -- i.e., the single argument is &lt;em&gt;mandatory&lt;/em&gt; (when using said function on a non-interactive basis), rather than &lt;em&gt;optional&lt;/em&gt;.  The solution is to rewrite the function so that the argument is &lt;em&gt;optional&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org-mime)&#xA;&#xA;(defun org-mime-htmlize (&amp;amp;optional arg)&#xA;&quot;Export a portion of an email body composed using `mml-mode' to&#xA;html using `org-mode'.  If called with an active region only&#xA;export that region, otherwise export the entire body.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (require 'ox-org)&#xA;  (require 'ox-html)&#xA;  (let* ((region-p (org-region-active-p))&#xA;         (html-start (or (and region-p (region-beginning))&#xA;                         (save-excursion&#xA;                           (goto-char (point-min))&#xA;                           (search-forward mail-header-separator)&#xA;                           (+ (point) 1))))&#xA;         (html-end (or (and region-p (region-end))&#xA;                       ;; TODO: should catch signature...&#xA;                       (point-max)))&#xA;         (raw-body (concat org-mime-default-header&#xA;                           (buffer-substring html-start html-end)))&#xA;         (tmp-file (make-temp-name (expand-file-name&#xA;                                    &quot;mail&quot; temporary-file-directory)))&#xA;         (body (org-export-string-as raw-body 'org t))&#xA;         ;; because we probably don't want to export a huge style file&#xA;         (org-export-htmlize-output-type 'inline-css)&#xA;         ;; makes the replies with &quot;&amp;gt;&quot;s look nicer&#xA;         (org-export-preserve-breaks org-mime-preserve-breaks)&#xA;         ;; dvipng for inline latex because MathJax doesn't work in mail&#xA;         (org-html-with-latex 'dvipng)&#xA;         ;; to hold attachments for inline html images&#xA;         (html-and-images&#xA;          (org-mime-replace-images&#xA;           (org-export-string-as raw-body 'html t) tmp-file))&#xA;         (html-images (unless arg (cdr html-and-images)))&#xA;         (html (org-mime-apply-html-hook&#xA;                (if arg&#xA;                    (format org-mime-fixedwith-wrap body)&#xA;                  (car html-and-images)))))&#xA;    (delete-region html-start html-end)&#xA;    (save-excursion&#xA;      (goto-char html-start)&#xA;      (insert (org-mime-multipart&#xA;               body html (mapconcat 'identity html-images &quot;\n&quot;))))))&#xA;&#xA;(defun mime-send-mail ()&#xA;&quot;org-mime-subtree and HTMLize&quot;&#xA;(interactive)&#xA;  (org-mark-subtree)&#xA;  (org-mime-subtree)&#xA;  (insert &quot;\nBest,\nS.\n&quot;)&#xA;  (org-mime-htmlize))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-06-28T21:47:11.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13528" PostTypeId="1" CreationDate="2015-06-28T23:36:25.227" Score="2" ViewCount="354" Body="&lt;p&gt;I would like to change &lt;code&gt;C-y&lt;/code&gt; to not move the mark, but still be able to &lt;code&gt;yank-pop&lt;/code&gt;. I looked at the source code and saw that the major change needed was to remove the &lt;code&gt;(push-mark (point))&lt;/code&gt; command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yank (&amp;amp;optional arg)&#xA;  &quot;Reinsert (\&quot;paste\&quot;) the last stretch of killed text.&#xA;More precisely, reinsert the most recent kill, which is the&#xA;stretch of killed text most recently killed OR yanked.  Put point&#xA;at the end, and set mark at the beginning without activating it.&#xA;With just \\[universal-argument] as argument, put point at beginning, and mark at end.&#xA;With argument N, reinsert the Nth most recent kill.&#xA;&#xA;When this command inserts text into the buffer, it honors the&#xA;`yank-handled-properties' and `yank-excluded-properties'&#xA;variables, and the `yank-handler' text property.  See&#xA;`insert-for-yank-1' for details.&#xA;&#xA;See also the command `yank-pop' (\\[yank-pop]).&quot;&#xA;  (interactive &quot;*P&quot;)&#xA;  (setq yank-window-start (window-start))&#xA;  ;; If we don't get all the way thru, make last-command indicate that&#xA;  ;; for the following command.&#xA;  (setq this-command t)&#xA;  (push-mark (point))&#xA;  (insert-for-yank (current-kill (cond&#xA;                  ((listp arg) 0)&#xA;                  ((eq arg '-) -2)&#xA;                  (t (1- arg)))))&#xA;  (if (consp arg)&#xA;      ;; This is like exchange-point-and-mark, but doesn't activate the mark.&#xA;      ;; It is cleaner to avoid activation, even though the command&#xA;      ;; loop would deactivate the mark because we inserted text.&#xA;      (goto-char (prog1 (mark t)&#xA;           (set-marker (mark-marker) (point) (current-buffer)))))&#xA;  ;; If we do get all the way thru, make this-command indicate that.&#xA;  (if (eq this-command t)&#xA;      (setq this-command 'yank))&#xA;  nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I look at the source code for &lt;code&gt;M-y&lt;/code&gt;, it relies on the mark to be able to function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yank-pop (&amp;amp;optional arg)&#xA;  &quot;Replace just-yanked stretch of killed text with a different stretch.&#xA;This command is allowed only immediately after a `yank' or a `yank-pop'.&#xA;At such a time, the region contains a stretch of reinserted&#xA;previously-killed text.  `yank-pop' deletes that text and inserts in its&#xA;place a different stretch of killed text.&#xA;&#xA;With no argument, the previous kill is inserted.&#xA;With argument N, insert the Nth previous kill.&#xA;If N is negative, this is a more recent kill.&#xA;&#xA;The sequence of kills wraps around, so that after the oldest one&#xA;comes the newest one.&#xA;&#xA;When this command inserts killed text into the buffer, it honors&#xA;`yank-excluded-properties' and `yank-handler' as described in the&#xA;doc string for `insert-for-yank-1', which see.&quot;&#xA;  (interactive &quot;*p&quot;)&#xA;  (if (not (eq last-command 'yank))&#xA;      (error &quot;Previous command was not a yank&quot;))&#xA;  (setq this-command 'yank)&#xA;  (unless arg (setq arg 1))&#xA;  (let ((inhibit-read-only t)&#xA;    (before (&amp;lt; (point) (mark t))))&#xA;    (if before&#xA;    (funcall (or yank-undo-function 'delete-region) (point) (mark t))&#xA;      (funcall (or yank-undo-function 'delete-region) (mark t) (point)))&#xA;    (setq yank-undo-function nil)&#xA;    (set-marker (mark-marker) (point) (current-buffer))&#xA;    (insert-for-yank (current-kill arg))&#xA;    ;; Set the window start back where it was in the yank command,&#xA;    ;; if possible.&#xA;    (set-window-start (selected-window) yank-window-start t)&#xA;    (if before&#xA;    ;; This is like exchange-point-and-mark, but doesn't activate the mark.&#xA;    ;; It is cleaner to avoid activation, even though the command&#xA;    ;; loop would deactivate the mark because we inserted text.&#xA;    (goto-char (prog1 (mark t)&#xA;             (set-marker (mark-marker) (point) (current-buffer))))))&#xA;  nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how do I still maintain full yank functionality without having &lt;code&gt;yank&lt;/code&gt; (&lt;code&gt;C-y&lt;/code&gt;) move my cursor?&lt;/p&gt;&#xA;" OwnerUserId="8725" LastActivityDate="2015-06-29T00:28:23.347" Title="Yanking without moving the mark, but still be able to `yank-pop`" Tags="|mark|yank|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13529" PostTypeId="2" ParentId="13528" CreationDate="2015-06-29T00:28:23.347" Score="4" Body="&lt;p&gt;You'll have to advise &lt;code&gt;yank&lt;/code&gt; (to restore the mark after it, and to save the &quot;other end&quot; somewhere) and &lt;code&gt;yank-pop&lt;/code&gt; (to fetch the other end from that &quot;somewhere&quot;, move the mark to it, then run the original code, and after that, restore the mark again).  &lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-06-29T00:28:23.347" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13530" PostTypeId="1" CreationDate="2015-06-29T01:12:27.467" Score="3" ViewCount="192" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:   Why does there appear to be a &lt;code&gt;keymap&lt;/code&gt; on the hyphen of &lt;strong&gt;hello-world&lt;/strong&gt; in the following example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GOAL&lt;/strong&gt;:  Place text properties before the hyphen and after the hyphen -- &lt;strong&gt;without&lt;/strong&gt; any keymap being placed on the hyphen itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:  The following example has been constructed to place text properties only on the word &quot;&lt;strong&gt;hello&lt;/strong&gt;&quot; and the word &quot;&lt;strong&gt;world&lt;/strong&gt;&quot;.  As far as I can tell, the hyphen between &quot;&lt;strong&gt;hello&lt;/strong&gt;&quot; and &quot;&lt;strong&gt;world&lt;/strong&gt;&quot; should &lt;em&gt;not&lt;/em&gt; have any text properties.  Yet when I place the cursor at the hyphen and type &lt;code&gt;M-x describe-key RET RET&lt;/code&gt;, I see that it is linked to &lt;code&gt;my-follow-link&lt;/code&gt; from &lt;code&gt;my-mouse-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-mouse-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map [mouse-2] 'my-follow-link)&#xA;    (define-key map [return] 'my-follow-link)&#xA;    (define-key map [follow-link] 'mouse-face)&#xA;      map)&#xA;  &quot;Keymap for mouse when in `my-mode'.&quot;)&#xA;&#xA;;; Author:  Drew Adams -- http://emacs.stackexchange.com/a/13411/2287&#xA;;; Modified by @lawlist for purposes of testing different scenarios.&#xA;(defun my-follow-link (event)&#xA;&quot;Doc-string.&quot;&#xA;(interactive (list last-nonmenu-event))&#xA;  (run-hooks 'mouse-leave-buffer-hook)&#xA;  (with-current-buffer (window-buffer (posn-window (event-start event)))&#xA;    (let ((foo  (get-text-property (posn-point (event-start event)) 'test)))&#xA;      (message &quot;%s&quot; foo))))&#xA;&#xA;(defun test ()&#xA;(interactive)&#xA;  (fundamental-mode)&#xA;  (let* (beg end)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (setq beg (point))&#xA;      (insert &quot;hello&quot;)&#xA;      (setq end (point))&#xA;      (add-text-properties beg end (list&#xA;          'test &quot;This is my first half of the test.&quot;&#xA;          'face '(:foreground &quot;cyan&quot; :weight bold)&#xA;          'mouse-face '(:foreground &quot;red&quot; :weight bold)&#xA;          'help-echo &quot;mouse-2, RET:  My first message.&quot;&#xA;          'keymap my-mouse-map))&#xA;      (insert &quot;-&quot;)&#xA;      (setq beg (point))&#xA;      (insert &quot;world&quot;)&#xA;      (setq end (point))&#xA;      (add-text-properties beg end (list&#xA;          'test &quot;This is my seond half of the test.&quot;&#xA;          'face '(:foreground &quot;orange&quot; :weight bold)&#xA;          'mouse-face '(:foreground &quot;blue&quot; :weight bold)&#xA;          'help-echo &quot;mouse-2, RET:  My second message.&quot;&#xA;          'keymap my-mouse-map)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/text_property_example_1.png&quot; alt=&quot;Example&quot;&gt;&#xA;&lt;img src=&quot;https://www.lawlist.com/images/text_property_example_2.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.787" LastActivityDate="2016-11-20T09:37:44.660" Title="Debugging / understanding placement of keymap with text-properties" Tags="|text-properties|mouse|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13531" PostTypeId="2" ParentId="13530" CreationDate="2015-06-29T01:26:39.827" Score="1" Body="&lt;p&gt;It doesn't. I did &lt;code&gt;M-x test&lt;/code&gt; in a new buffer, and saw &lt;code&gt;hello-world&lt;/code&gt; got inserted. There are no text properties on the hyphen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps you are not showing all your code or describing the context from the beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And why are you using &lt;code&gt;describe-key&lt;/code&gt;? And what key do you hit after &lt;code&gt;RET&lt;/code&gt; - that key will be described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;code&gt;C-u C-x =&lt;/code&gt; instead, with point before the hyphen.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-29T01:26:39.827" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13532" PostTypeId="1" AcceptedAnswerId="39217" CreationDate="2015-06-29T02:13:56.313" Score="12" ViewCount="2250" Body="&lt;p&gt;When I start emacs, I get a couple of byte compilation warnings in a window that pops up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (bytecomp): `interactive-p' is an obsolete function (as of 23.2); use `called-interactively-p' instead. [7 times]&#xA;Warning (bytecomp): Use `with-current-buffer' rather than save-excursion+set-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I get emacs to give me locations?&lt;/p&gt;&#xA;" OwnerUserId="2354" LastEditorUserId="2354" LastEditDate="2015-06-29T02:27:04.413" LastActivityDate="2018-11-20T13:02:54.423" Title="`Warning (bytecomp)` is a bit vague - can I get any more information?" Tags="|byte-compilation|warning|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13533" PostTypeId="2" ParentId="13365" CreationDate="2015-06-29T03:07:34.120" Score="1" Body="&lt;p&gt;Oh, I just saw the &quot;Answer your question&quot; Button. So I copy the above solution in my comments here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use gtk3 with emacs under microsoft windows (7 at least): One has to use the image ports from ezwinports first. You only need the libsrvg and its required dependences: sourceforge.net/projects/ezwinports/files. And install them into the emacs (I use 24.5) directory. (All credits go to Eli Zaretskii from debbugs.gnu.org).&lt;/p&gt;&#xA;" OwnerUserId="8677" LastActivityDate="2015-06-29T03:07:34.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13534" PostTypeId="2" ParentId="10067" CreationDate="2015-06-29T08:24:58.307" Score="1" Body="&lt;pre&gt;&lt;code&gt;(require 'hideshow)&#xA;&#xA;;; Set up hs-mode (HideShow) for Ruby&#xA;(add-to-list 'hs-special-modes-alist&#xA;             `(ruby-mode&#xA;           ,(rx (or &quot;def&quot; &quot;class&quot; &quot;module&quot; &quot;do&quot;)) ; Block start&#xA;               ,(rx (or &quot;end&quot;))                       ; Block end&#xA;               ,(rx (or &quot;#&quot; &quot;=begin&quot;))                ; Comment start&#xA;               ruby-forward-sexp nil))&#xA;&#xA;(add-hook 'ruby-mode-hook 'hs-minor-mode)&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'hs-toggle-hiding)&#xA;(global-set-key (kbd &quot;C-&amp;lt;f9&amp;gt;&quot;) 'hs-hide-all)&#xA;(global-set-key (kbd &quot;C-S-&amp;lt;f9&amp;gt;&quot;) 'hs-show-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Stolen from &lt;a href=&quot;https://gist.github.com/Karina7777/e6207b027af0b391ff38&quot; rel=&quot;nofollow&quot;&gt;this gist&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8751" LastEditorUserId="3863" LastEditDate="2016-04-22T16:16:37.810" LastActivityDate="2016-04-22T16:16:37.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13535" PostTypeId="1" AcceptedAnswerId="13536" CreationDate="2015-06-29T08:38:24.690" Score="0" ViewCount="120" Body="&lt;p&gt;Yesterday I declared emacs bankruptcy and now I'm writing my init.el file from scratch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to call a function several times within my init.el file to output the current loading times.&#xA;I've found this piece of code which only tells the final loading time:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when window-system&#xA;  (let ((elapsed (float-time (time-subtract (current-time)&#xA;                                            emacs-start-time))))&#xA;    (message &quot;Loading %s...done (%.3fs)&quot; load-file-name elapsed))&#xA;&#xA;  (add-hook 'after-init-hook&#xA;            `(lambda ()&#xA;               (let ((elapsed (float-time (time-subtract (current-time)&#xA;                                                         emacs-start-time))))&#xA;                 (message &quot;Loading %s...done (%.3fs) [after-init]&quot;&#xA;                          ,load-file-name elapsed)))&#xA;            t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far I failed any attempt to 'extract' some bits and bobs from there to create the function I look for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I've using Emacs for several years, I have no idea about elisp. All I do is copy + paste + edit code, which is a shame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please don't accuse me of not even try it because I had spent a good couple of hours with zero results. I'd put some of the code I've written but I don't think it would help to anything apart from embarrass myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that there are several packages which help profiling Emacs configuration files but that's not really what I'm kindly asking here. I'd like some help to write a little function.&lt;/p&gt;&#xA;" OwnerUserId="6546" LastEditorUserId="253" LastEditDate="2015-06-29T21:48:30.763" LastActivityDate="2015-06-29T21:48:45.810" Title="Function to get init.el file loading times multiple times" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13536" PostTypeId="2" ParentId="13535" CreationDate="2015-06-29T09:31:17.103" Score="0" Body="&lt;p&gt;Right, I think I managed to do it. This is what I've written:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun get-time (package-loaded)&#xA;  (let ((elapsed (float-time (time-subtract (current-time) emacs-start-time))))&#xA;    (message &quot;loading %s package...done (%.3fs)&quot; package-loaded elapsed)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I can call that function like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(get-time &quot;use-package&quot;)&#xA;...&#xA;(get-time &quot;yasnippet&quot;)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6546" LastEditorUserId="675" LastEditDate="2015-06-29T21:48:45.810" LastActivityDate="2015-06-29T21:48:45.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13537" PostTypeId="2" ParentId="13027" CreationDate="2015-06-29T10:34:25.267" Score="3" Body="&lt;p&gt;The font height changes in DejaVu at that point size because font height information between the two normal and the bold font is different when it should be the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DejaVu Sans Mono 10 font that I use doesn't change the font height between normal and bold weight. I set that in my .emacs with &lt;code&gt;(set-frame-font &quot;DejaVu Sans Mono-10&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you have something to compare against, the info for &quot;DejaVu Sans 10&quot; font via (font-info on Emacs 25): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-info &quot;DejaVu Sans Mono-10&quot;)&#xA;[&quot;-unknown-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1&quot; &#xA;&quot;DejaVu Sans Mono:pixelsize=13:foundry=unknown:weight=normal:slant=normal:&#xA;width=normal:spacing=100:scalable=true&quot; 13 17 0 0 0 8 13 4 8 8 &#xA;&quot;/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf&quot; (opentype ((DFLT ...) )))]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT based on subsequent info:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the font information above, I show a font height of 17 and you report a height of 15 (normal) or 16 (bold). In emacs 25 there is additional font information after those 3 0's, in particular the font descent is 4. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I don't have a problem on Emacs 24 or 25 with DejaVu Sans Mono and the Bold variant, the simplest thing is to use a font and size that doesn't change width (as shown by font-info) between normal and bold or something other than DejaVu. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for what's causing this, it might one of your libraries, (my gtk is libgtk-x11-2.0.so.0), but I doubt it would be this particular library. Also doubt it is the ttf file or package. More likely is the freetype rendering (I have libfreetype.so.6). Since DejaVu are scaled as are the other fonts that do work for you, a computation error tickled by the way  DejaVu was written would explain why these work at some sizes but not others. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To verify whether the problem is Emacs specific or not, you might be able to bring up two terminal windows, one with a bold prompt and one without and compare the line spacing on them. If it's different like Emacs, then this has to do with the rendering and/or font. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you compiled emacs there might be something going on there.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-07-01T02:40:16.227" LastActivityDate="2015-07-01T02:40:16.227" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13538" PostTypeId="1" CreationDate="2015-06-29T11:55:43.560" Score="3" ViewCount="246" Body="&lt;p&gt;I'm defining a minor-mode not meant to be interactively activated. I'd like to use&#xA;&lt;code&gt;define-minor-mode&lt;/code&gt; because it's very convenient, but the downside is that it always sets &#xA;the mode function as interactive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make an already-defined command non-interactive?&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="105" LastEditDate="2018-05-07T23:56:41.713" LastActivityDate="2018-05-07T23:56:41.713" Title="Can I make a function non-interactive after it's been defined?" Tags="|interactive|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="13539" PostTypeId="1" AcceptedAnswerId="13594" CreationDate="2015-06-29T12:03:13.560" Score="7" ViewCount="614" Body="&lt;p&gt;I am able to add few extra sources to helm like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-mini-default-sources '(helm-source-buffers-list&#xA;                                  helm-source-recentf&#xA;                                  helm-source-dired-recent-dirs&#xA;                                  helm-chrome-source&#xA;                                  hgs/helm-c-source-stars&#xA;                                  hgs/helm-c-source-repos&#xA;                                  hgs/helm-c-source-search&#xA;                                  helm-source-buffer-not-found))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last thing i need to add to this is &lt;code&gt;helm-M-x&lt;/code&gt;. I just need to add all commands to default sources. By this i can invoke a single function and I can go to anything or i can invoke any command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;helm-M-x&lt;/code&gt; is a function and its source-code doesn't have any sources. Any help on how to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2022-05-01T23:04:56.377" Title="helm - adding helm-M-x to helm sources" Tags="|elisp|helm|m-x|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13540" PostTypeId="2" ParentId="10808" CreationDate="2015-06-29T13:53:06.260" Score="3" Body="&lt;p&gt;This works for me using C-c C-c&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Current directory is /src/build/emacs-24.5/src/&#xA;GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1&#xA;Copyright (C) 2014 Free Software Foundation, Inc.&#xA;...&#xA;(gdb) run &#xA;Starting program: /src/build/emacs-24.5/src/emacs &#xA;[Thread debugging using libthread_db enabled]&#xA;...&#xA;[New Thread 0xb4bffb40 (LWP 735)]&#xA; C-c C-c(gdb) &#xA;C-c C-c(gdb) break main&#xA;Breakpoint 1 at 0x815d7b8: file emacs.c, line 707.&#xA;(gdb) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But here are two other things to try. First is without the &lt;code&gt;-i=mi&lt;/code&gt; option. The second is to use &lt;a href=&quot;https://github.com/rocky/emacs-dbgr&quot; rel=&quot;nofollow&quot;&gt;realgud&lt;/a&gt; (available from MELPA); and in realgud this can be done in one of two ways. After &lt;code&gt;M-x load-library realgud&lt;/code&gt;, then &lt;code&gt;M-x realgud:gdb&lt;/code&gt; or you can go into a &quot;shell&quot; (comint) or &quot;term&quot; shell and run plain &lt;em&gt;gdb&lt;/em&gt;, &quot;set annotate 1&quot;, and then run the program. Run  &lt;code&gt;M-x realgud-track-mode&lt;/code&gt; and set the debugger to be &lt;em&gt;gdb&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-06-29T15:57:03.547" LastActivityDate="2015-06-29T15:57:03.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13541" PostTypeId="1" CreationDate="2015-06-29T14:07:11.290" Score="5" ViewCount="297" Body="&lt;p&gt;I sometimes would like to make changes to my emacs files but without changing the date of the modified file. For instance, I would like to write up a brief evaluation of a lecture I might have given. Ideally, I would not like to change the file's date under these circumstances. Is there any way to do this? I run emacs on Windows 7. I have noted too that changing a file's name also changes its date. It would be nice to change the name but without effecting the date.&lt;/p&gt;&#xA;" OwnerUserId="8753" LastActivityDate="2015-06-29T20:10:01.447" Title="Save changes to an emacs file without changing the date" Tags="|files|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13542" PostTypeId="2" ParentId="12660" CreationDate="2015-06-29T15:33:08.013" Score="0" Body="&lt;p&gt;I found the solution thanks to &lt;a href=&quot;https://github.com/punchagan&quot; rel=&quot;nofollow&quot;&gt;Punchagan&lt;/a&gt;. It's listed &lt;a href=&quot;https://github.com/punchagan/org2blog/issues/189&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, but I'll add the information here as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem was in my auth-source configuration. I removed three authentication facilities and the peculiar error went away.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package auth-source&#xA;  :config&#xA;  (setq&#xA;   auth-sources '(&#xA;                  ;; default&#xA;                  ;; &quot;secrets:session&quot;&#xA;                  ;; &quot;secrets:Login&quot;&#xA;                  &quot;~/.authinfo.gpg&quot;&#xA;                  &quot;~/.authinfo&quot;&#xA;                  &quot;~/.netrc&quot;&#xA;                  )&#xA;   epa-file-cache-passphrase-for-symmetric-encryption t&#xA;   auth-source-debug 'trivia&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2015-06-29T15:33:08.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13543" PostTypeId="5" CreationDate="2015-06-29T15:43:26.187" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-06-29T15:43:26.187" LastActivityDate="2015-06-29T15:43:26.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13544" PostTypeId="4" CreationDate="2015-06-29T15:43:26.187" Score="0" Body="realgud is a debugger front end. It is a potential replacement for gud" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-06-29T20:25:49.660" LastActivityDate="2015-06-29T20:25:49.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13545" PostTypeId="1" AcceptedAnswerId="13546" CreationDate="2015-06-29T15:43:56.090" Score="1" ViewCount="348" Body="&lt;p&gt;As my pet project, I'm contemplating to connect Sphinx search tools with Info pages.  In order to index these pages with Sphinx, I'd need them to be in plain text format and divided into nodes (i.e. I'd like to index every node separately).  After some reading, I can't find a simple way of getting a list of all nodes, did I miss anything?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, what I want is like &lt;code&gt;(Info-directory)&lt;/code&gt;, except I only need the list of the nodes, not the whole buffer with decoration and sectioning.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Actually, this is what I ended up doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sphinx-info-nodes ()&#xA;  (let ((tmp-file (make-temp-file &quot;info&quot;)))&#xA;    (shell-command (format &quot;info --subnodes -o '%s'&quot; tmp-file))&#xA;    (with-temp-buffer&#xA;      (insert-file-contents tmp-file)&#xA;      (cl-loop while (re-search-forward &quot;^\\*\\s-*\\([^:]+\\):&quot; nil t)&#xA;               collect (match-string 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-06-29T20:43:43.603" LastActivityDate="2015-06-29T20:43:43.603" Title="List all Info nodes" Tags="|search|info|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13546" PostTypeId="2" ParentId="13545" CreationDate="2015-06-29T16:55:35.127" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;If you want just a list of nodes, you can use something like &lt;code&gt;Info-build-node-completions&lt;/code&gt; in standard library &lt;code&gt;info.el&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun Info-build-node-completions (&amp;amp;optional filename)&#xA;      (if filename&#xA;          (or (cdr (assoc filename Info-file-completions))&#xA;          (with-temp-buffer (Info-mode)&#xA;            (Info-goto-node (format &quot;(%s)Top&quot; filename))&#xA;            (Info-build-node-completions-1)&#xA;            (push (cons filename Info-current-file-completions) Info-file-completions)&#xA;            Info-current-file-completions))&#xA;        (or Info-current-file-completions&#xA;        (Info-build-node-completions-1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;If you want the actual text of all of the nodes, then see library &lt;a href=&quot;http://www.emacswiki.org/emacs/InfoPlus&quot; rel=&quot;nofollow&quot;&gt;Info+&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/info%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;info+.el&lt;/code&gt;&lt;/a&gt;), function (command) &lt;code&gt;Info-merge-subnodes&lt;/code&gt;.  It gives you a fundamental-mode buffer with all of the subnodes of a given node merged. You can use it on a whole manual, for instance, to get a manual-in-a-buffer.&#xA;Doc string:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Info-merge-subnodes is an interactive compiled Lisp function in&#xA;  `info+.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(Info-merge-subnodes &amp;amp;optional RECURSIVE-DISPLAY-P RECURSIVE-CALL-P)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For more information check the manuals.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Integrate current node with nodes referred to in its Menu.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Displays the current Info node, together with the nodes in its Menu.&#xA;  Buffer &lt;code&gt;*Info: NODE*&lt;/code&gt; is used for the display, where NODE is the name&#xA;  of the current node.  The contents of this node's subnodes (the nodes&#xA;  named in this node's Menu) are included in the buffer, following the&#xA;  contents of the current node.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Optional arg RECURSIVE-DISPLAY-P (prefix arg if interactive) governs&#xA;  the way menus of subnodes are treated:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;If nil, nothing additional happens.  Subnode menus are not explored.&#xA;  Only the current node and its immediate subnodes are documented, in&#xA;  the single display buffer &lt;code&gt;*Info: NODE*&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;If non-nil, then the subnodes of a node are treated in the same way&#xA;  as the parent node, recursively: If any of them has, itself, a Menu,&#xA;  then that menu's subnodes are also explored, and so on.&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;If RECURSIVE-DISPLAY-P is zero, then a single display buffer is&#xA;  used for all of the nodes explored.  Otherwise, a separate display&#xA;  buffer is used for each subnode that has a Menu (see next).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use this when you want a single, flat compilation of the current&#xA;  node and all of its subnodes.  It is less appropriate when the&#xA;  current node has several levels of subnodes: The flattened&#xA;  result can be difficult to read.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;If RECURSIVE-DISPLAY-P is positive, then the contents of each&#xA;  subnode are displayed twice: once in the parent node's display,&#xA;  and once in the subnode's own display.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use this when the current node has several levels of subnodes&#xA;  and you want each display buffer to be self-contained.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;If RECURSIVE-DISPLAY-P is negative, then there is no redundancy: A&#xA;  subnode's contents are only displayed in its parent's buffer.  The&#xA;  subnode's own display buffer only contains the contents of its own&#xA;  subnodes.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use this when the current node has several levels of subnodes&#xA;  and you want no redundancy between the display buffers.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;The user option (variable) &lt;code&gt;Info-subtree-separator&lt;/code&gt; is a string to be&#xA;  inserted by &lt;code&gt;Info-merge-subnodes&lt;/code&gt; just before the title of each&#xA;  node (preceding its description).  By default it is &lt;code&gt;&quot;\n* &quot;&lt;/code&gt;, producing&#xA;  a node title resembling a menu item.  Setting this to &lt;code&gt;&quot;\f\n* &quot;&lt;/code&gt; will&#xA;  cause a page break before each node description.  For more on setting&#xA;  this variable, type &lt;code&gt;C-h v Info-subtree-separator&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;hr&gt;&#xA;  &#xA;  &lt;p&gt;Optional second arg RECURSIVE-CALL-P is only for internal use.  It is&#xA;  used to indicate whether (non-nil) or not (nil) this is a recursive&#xA;  (i.e. not a top-level) call to &lt;code&gt;Info-merge-subnodes&lt;/code&gt;.  Non-nil&#xA;  means that this is a subnode, and that its contents should only be&#xA;  included in the present display if RECURSIVE-DISPLAY-P is also&#xA;  non-nil.  For proper operation when RECURSIVE-DISPLAY-P is zero, the&#xA;  non-nil value of RECURSIVE-CALL-P should be the node name of the&#xA;  top-level call to &lt;code&gt;Info-merge-subnodes&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-29T17:02:02.547" LastActivityDate="2015-06-29T17:02:02.547" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13548" PostTypeId="1" AcceptedAnswerId="13605" CreationDate="2015-06-29T18:56:16.153" Score="2" ViewCount="289" Body="&lt;p&gt;Newbie question here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In intellij there is Ctrl-Shift T to go to the corresponding test file. (For java at least.) I would like something similar in emacs. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a language (or project) there need to ba a mapping between source code and corresponding test code. In Ruby it could be &lt;code&gt;lib&lt;/code&gt; and &lt;code&gt;spec&lt;/code&gt; and in Java/Maven it would be &lt;code&gt;src/main/java&lt;/code&gt; and &lt;code&gt;src/test/java&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a language (or project) there need to be a mapping between file names. In Ruby it could be &lt;code&gt;bits_of_code.rb&lt;/code&gt; maps to &lt;code&gt;bits_of_code_spec.rb&lt;/code&gt; and in Java i might be &lt;code&gt;BitsOfCode.java&lt;/code&gt; maps to &lt;code&gt;BitsOfCodeTest.java&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This (the easy part for me now - some progress at least) should be mapped to a shortcut. T seem to be taken already for character swapping so input on what mapping that would be a natural choice for an emacser is also appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8397" LastActivityDate="2015-07-01T18:20:18.287" Title="Find corresponding test file" Tags="|testing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13549" PostTypeId="2" ParentId="13541" CreationDate="2015-06-29T20:10:01.447" Score="8" Body="&lt;p&gt;I don't think you can avoid changing the timestamp when saving, but you could write a function that resets it back to the original pre-save timestamp:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun save-buffer-preserving-modtime ()&#xA;  &quot;Call `save-buffer', but keep the visited file's modtime the same.&quot;&#xA;  (interactive)&#xA;  (let ((original-time (visited-file-modtime)))&#xA;    (save-buffer)&#xA;    (set-file-times buffer-file-name original-time)&#xA;    (set-visited-file-modtime original-time)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-06-29T20:10:01.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13550" PostTypeId="1" CreationDate="2015-06-29T20:16:29.513" Score="14" ViewCount="497" Body="&lt;p&gt;Is there a possibility to save the Emacs Calculator Trail (as a file) and to  restore it later? If not, should it be feature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when I have an incomplete calculation but have to shutdown my Emacs, it would be great if i can continue afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second case: I do some calculations and want to store how I did it, to later check if I did it correctly or need to modify it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second reason is why I use MATLAB (I know, too much) for little calculations, just so i can restore them. But I would like to use Emacs Calc only!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the answers&lt;/p&gt;&#xA;" OwnerUserId="8758" LastActivityDate="2021-04-29T17:24:00.270" Title="Saving Calc trail for later use" Tags="|saving|calc|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13551" PostTypeId="2" ParentId="13538" CreationDate="2015-06-29T20:17:13.337" Score="5" Body="&lt;p&gt;If it's ok, that the function isn't interactive in the first&#xA;place, something like this might work.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro define-noninteractive-minor-mode (mode doc &amp;amp;optional&#xA;                                                 init-value lighter keymap&#xA;                                                 &amp;amp;rest body)&#xA;  `(cl-macrolet ((interactive (&amp;amp;rest _)))&#xA;     (define-minor-mode ,mode ,doc ,init-value ,lighter ,keymap ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-06-29T20:17:13.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13552" PostTypeId="1" AcceptedAnswerId="13554" CreationDate="2015-06-29T20:22:18.873" Score="1" ViewCount="1126" Body="&lt;p&gt;I want to mark interesting files while I am browsing my folders, when I am done with marking, I want to copy these files to another place (with dired copy or dired-ranger-copy) or send them as attachment. To prevent too many dired buffer I have this setting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (diredp-toggle-find-file-reuse-dir 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the problem is when I go into a subfolder and come back, the marks are gone, currently I have to mark in one folder, copy the files, mark in another folder, copy files, it's too many copying operations. I have tried to set reuse dire to nil, but I can't work on all marked files in different buffer either. Is there any package that can let me do that?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2022-05-26T14:24:34.420" LastActivityDate="2022-05-26T14:24:34.420" Title="How to make dired-mode copy and move all marked file in all dired buffer including the one just closed?" Tags="|dired|image-mode|image-dired|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13553" PostTypeId="1" CreationDate="2015-06-29T20:29:47.157" Score="3" ViewCount="1548" Body="&lt;p&gt;I have installed tern use npm and install tern.el from melpa. I put the path of tern.el in my init file as per instructions on the emacs section of the tern homepage. However when I enable tern mode and try to run a command such as jump to definition at point, I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Searching for program: no such file or directory, tern&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the issue?&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-09-28T21:29:43.970" Title="Receive error when trying to use tern mode" Tags="|javascript|tern|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13554" PostTypeId="2" ParentId="13552" CreationDate="2015-06-29T20:56:26.960" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;diredp-toggle-find-file-reuse-dir&lt;/code&gt; does not prevent you from opening multiple Dired buffers for different directories (e.g. subdirs). It should be irrelevant here, but you might want to describe just what you are doing, step by step.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With multiple Dired buffers open, you can mark files (and subdirs) in any of them. with Dired+ (which you are apparently using), you can use &lt;code&gt;M-+ C&lt;/code&gt; in a parent directory's Dired buffer to copy all of the files that are marked in that buffer and all of the files that are marked in any of its marked subdirs, with this rule applying recursively.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As an alternative to #2, you can of course also include subdirs in the same Dired buffer, using &lt;code&gt;i&lt;/code&gt;. Then act on (e.g. &lt;code&gt;C&lt;/code&gt; to copy) all files marked in the buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Your problem of losing marks happens because you are using &lt;code&gt;RET&lt;/code&gt; or &lt;code&gt;C-x C-f&lt;/code&gt; to move to another directory. Use &lt;code&gt;C-x d&lt;/code&gt; instead, and you do not lose the previous Dired buffer. Or just use &lt;code&gt;C-M-S-r&lt;/code&gt; to toggle &lt;code&gt;diredp-toggle-find-file-reuse-dir&lt;/code&gt; and turn off reusing temporarily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, I don't tell Dired+ to automatically reuse Dired buffers when I hit &lt;code&gt;RET&lt;/code&gt;.  Instead, I use &lt;code&gt;C-x C-v&lt;/code&gt; whenever I want to change to a different directory and I don't care to save the current Dired buffer. My fingers decide whether to keep or toss the current Dired buffer when I visit another one: &lt;code&gt;RET&lt;/code&gt; to keep, &lt;code&gt;C-x C-v&lt;/code&gt; to toss. (And I don't worry about having lots of buffers, in general.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, this comes under the heading of &quot;If it hurts, don't do it.&quot; If you purposely kill a Dired buffer, which is what &quot;reusing&quot; means here, then, well, the buffer no longer exists.  If it no longer exists then its markings etc. are gone too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, reuse when you want, and don't reuse when you want. Both behaviors are available at all times.  If you start marking things, then think before you use &lt;code&gt;RET&lt;/code&gt; to change directories - use &lt;code&gt;C-x d&lt;/code&gt; or &lt;code&gt;C-x 4 d&lt;/code&gt; instead. It's probably just a question of habit. And don't forget that you have &lt;code&gt;i&lt;/code&gt; too.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-29T21:09:45.837" LastActivityDate="2015-06-29T21:09:45.837" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13555" PostTypeId="1" CreationDate="2015-06-29T21:51:08.140" Score="0" ViewCount="477" Body="&lt;p&gt;I am looking into &lt;code&gt;sql.el&lt;/code&gt;, and I can't find a way to bypass creating comint buffer and setting some global variables in order to connect to the database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is less than ideal because I know the credentials, but I don't want to alter global variables which might be used for something else, and there is no way to just create a process and interact with it, or so it seems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd like to have a MySQL process, with which I could interact programmatically in an asynchronous way. I.e. the intent is not to let the user write queries, but rather to translate user's input into queries and to execute them as the program sees fit.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-30T09:57:52.737" Title="Emacs connect to MySQL (MariaDB) non-interactively" Tags="|sql|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13556" PostTypeId="1" CreationDate="2015-06-29T22:29:47.703" Score="2" ViewCount="71" Body="&lt;p&gt;&lt;code&gt;C-x n w (widen)&lt;/code&gt; does not restore the position of a formerly narrowed region in relation to the window, as it was before calling &lt;code&gt;C-x n n (narrow-to-region)&lt;/code&gt;.  Is it possible to have such behaviour?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The effect should be as if &lt;code&gt;C-x n n&lt;/code&gt; and &lt;code&gt;C-x n w&lt;/code&gt; were wrapped into a &lt;code&gt;save-excursion&lt;/code&gt; form, I guess.  If the first line of the region was the nth line of the window then, after widening, it should return to be the nth line of the window.  Point should keep its position relative to the formerly narrowed region.&lt;/p&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="2763" LastEditDate="2015-06-29T23:58:00.347" LastActivityDate="2015-06-29T23:58:00.347" Title="Restoring position in window after narrowing" Tags="|narrowing|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13557" PostTypeId="1" AcceptedAnswerId="13575" CreationDate="2015-06-29T23:08:05.740" Score="6" ViewCount="591" Body="&lt;p&gt;I am using the Spacemacs configuration files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I am typing code, electric-indent-mode reindents the current line whenever I press enter. This often causes the indentation to be incorrect when working in languages like Python or Haskell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.imgur.com/UP3y4Tp.gifv&quot; rel=&quot;noreferrer&quot;&gt;Here is an example of the problem&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent this re-indentation?&lt;/p&gt;&#xA;" OwnerUserId="8759" LastEditorUserId="105" LastEditDate="2019-11-25T14:32:28.357" LastActivityDate="2019-11-25T14:32:28.357" Title="Prevent electric-indent-mode from reindenting the current line on RET" Tags="|spacemacs|python|indentation|electric-indent|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13558" PostTypeId="1" AcceptedAnswerId="13559" CreationDate="2015-06-30T02:35:08.090" Score="3" ViewCount="178" Body="&lt;p&gt;When using ido, the command &lt;code&gt;ido-restrict-to-matches&lt;/code&gt; (bound to &lt;code&gt;C-SPC&lt;/code&gt;) is one of my favourite. What it does: instead of completing input against the initial collection of things, it will:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;restrict that collection to the list of those things that match[*] the current input, and&lt;/li&gt;&#xA;&lt;li&gt;remove the current input.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This allows to narrow down the list incrementally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to see such a mechanism work with the default completion system of emacs (I'm in particular interested in &lt;code&gt;icomplete-mode&lt;/code&gt;). Does it exist, or how to do it ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[*] Or, with a prefix arg, those that do not match (should be available in emacs-25.1, yet unreleased).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-07-02T12:01:24.330" LastActivityDate="2015-07-02T12:01:24.330" Title="ido-like restrict to matches while completing" Tags="|completion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13559" PostTypeId="2" ParentId="13558" CreationDate="2015-06-30T04:52:39.030" Score="4" Body="&lt;p&gt;AFAIK, the answer is &lt;em&gt;no&lt;/em&gt;; it does not exist for vanilla Emacs completion, and likewise for &lt;code&gt;icomplete-mode&lt;/code&gt;.  (Someone will correct me if I'm wrong.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This kind of narrowing is a key feature of &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;, which Icicles calls &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;progressive completion&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other completion UIs now provide such a feature, including &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;Helm&lt;/a&gt; and, as you point out, Ido. Icicles was the first to provide this feature, AFAIK; it has had it for almost a decade now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A related feature is to narrow, not by matching additional patterns, but by &lt;strong&gt;not&lt;/strong&gt; matching additional patterns. Icicles calls this &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#ChippingAway&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;chipping away the non-elephant&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, you match an additional pattern and then subtract those matches from the previous ones. This can be a powerful way to quickly narrow a set of completion candidates by simply weeding out those that match certain patterns.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Unlike Ido completion and Icomplete completion, Icicles completion is very close to &quot;&lt;em&gt;the default completion system of emacs&lt;/em&gt;&quot;. It uses the minibuffer the same way (you can edit there etc.), and it uses buffer &lt;code&gt;*Completions*&lt;/code&gt; the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, if you just use &lt;code&gt;TAB&lt;/code&gt; for completion and you do not use any of the Icicles-specific minibuffer keys, the completion behavior is pretty much the same as vanilla Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Icicles really does provide something very close to vanilla Emacs completion plus, by hitting &lt;code&gt;S-SPC&lt;/code&gt;, progressive completion (incremental narrowing).  &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-06-30T05:03:13.500" LastActivityDate="2015-06-30T05:03:13.500" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13560" PostTypeId="1" CreationDate="2015-06-30T07:50:07.517" Score="3" ViewCount="1538" Body="&lt;p&gt;I've been searching for a while the following org-mode color theme on the net, which replace asterisk by circle, but I can't find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone happens to know the name of this theme?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vKeKx.png&quot; alt=&quot;circle org mode&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6602" LastEditorUserId="14920" LastEditDate="2018-12-29T00:26:43.813" LastActivityDate="2018-12-29T00:26:43.813" Title="Finding a specify Org-mode Color Theme" Tags="|themes|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="13561" PostTypeId="1" AcceptedAnswerId="13573" CreationDate="2015-06-30T08:15:10.487" Score="3" ViewCount="269" Body="&lt;p&gt;I have this code to play mp3 files instead of opening them:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun ora-mp3 ()&#xA;  (interactive)&#xA;  (let ((file (buffer-file-name)))&#xA;    (kill-buffer (current-buffer))&#xA;    (ora-dired-start-process (format &quot;rhythmbox \&quot;%s\&quot;&quot; file))))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.mp3\\'&quot; . ora-mp3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here &lt;code&gt;ora-dired-start-process&lt;/code&gt; is just a variant of &lt;code&gt;shell-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I kind of like using &lt;code&gt;auto-mode-alist&lt;/code&gt;, since it's very granular: only&#xA;mp3 files are affected. But the problem is that my window&#xA;configuration gets messed up each time &lt;code&gt;ora-mp3&lt;/code&gt; is called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I avoid the problem with the current approach? Or maybe&#xA;there's another approach that doesn't have this problem?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-30T14:04:21.863" Title="What's a good way to run a command instead of opening a file?" Tags="|elisp|" AnswerCount="2" CommentCount="4" ClosedDate="2015-06-30T14:23:03.997" ContentLicense="CC BY-SA 3.0" />
  <row Id="13562" PostTypeId="2" ParentId="13560" CreationDate="2015-06-30T08:26:47.457" Score="10" Body="&lt;p&gt;Not sure of the specific colors, but to replace the asterisks with custom unicode chars, you might use &lt;a href=&quot;https://github.com/sabof/org-bullets&quot;&gt;https://github.com/sabof/org-bullets&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8273" LastActivityDate="2015-06-30T08:26:47.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13563" PostTypeId="2" ParentId="13560" CreationDate="2015-06-30T08:26:52.637" Score="8" Body="&lt;p&gt;Doesn't sound like a theme to be honest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;a href=&quot;https://github.com/sabof/org-bullets&quot; rel=&quot;noreferrer&quot;&gt;org-bullet&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-06-30T08:26:52.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13564" PostTypeId="2" ParentId="13406" CreationDate="2015-06-30T09:29:56.810" Score="4" Body="&lt;p&gt;Okay, so I found the real problem, and it was &lt;em&gt;not&lt;/em&gt; Emacs. The thing is that I connect to a remote Ubuntu computer from my Windows computer using PuTTy and Xming. I found that it not only in Emacs that I had the keyboard layout issue, but in &lt;em&gt;all&lt;/em&gt; programs that open in another window. The default setting in Xming was American keyboard layout. I changed the settings to Swedish layout, and the problem was solved! Sorry to bother you all with this non-Emacs problem... &lt;/p&gt;&#xA;" OwnerUserId="8689" LastActivityDate="2015-06-30T09:29:56.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13565" PostTypeId="2" ParentId="13555" CreationDate="2015-06-30T09:44:35.073" Score="1" Body="&lt;p&gt;OK, I've found this library: &lt;a href=&quot;https://github.com/skeeto/emacsql&quot; rel=&quot;nofollow&quot;&gt;https://github.com/skeeto/emacsql&lt;/a&gt;, and so far it seems good, so I'm going to stick with it for now.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-06-30T09:44:35.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13566" PostTypeId="1" CreationDate="2015-06-30T10:31:32.817" Score="9" ViewCount="2897" Body="&lt;p&gt;I want to change my default encoding system from non defined to UTF-8 (I think that would be useful). Now I have seen many different UTF-8 coding systems:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mule-utf-8        mule-utf-8-dos&#xA;mule-utf-8-mac    mule-utf-8-unix&#xA;prefer-utf-8      prefer-utf-8-dos&#xA;prefer-utf-8-mac  prefer-utf-8-unix&#xA;utf-8             utf-8-auto&#xA;utf-8-auto-dos    utf-8-auto-mac&#xA;utf-8-auto-unix   utf-8-dos&#xA;utf-8-emacs       utf-8-emacs-dos&#xA;utf-8-emacs-mac   utf-8-emacs-unix&#xA;utf-8-hfs         utf-8-hfs-dos&#xA;utf-8-hfs-mac     utf-8-hfs-unix&#xA;utf-8-mac         utf-8-unix&#xA;utf-8-with-signature     utf-8-with-signature-dos&#xA;utf-8-with-signature-mac utf-8-with-signature-unix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using a Mac and I am further confused about these different hfs and mac coding systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I decided to use utf-8 as follow based on &lt;a href=&quot;https://stackoverflow.com/a/2903256/632423&quot;&gt;this answer&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq utf-translate-cjk-mode nil) ; disable CJK coding/encoding (Chinese/Japanese/Korean characters)&#xA;(set-language-environment 'utf-8)&#xA;;; (set-keyboard-coding-system 'utf-8-mac) ; For old Carbon emacs on OS X only&#xA;(setq locale-coding-system 'utf-8)&#xA;(set-default-coding-systems 'utf-8)&#xA;(set-terminal-coding-system 'utf-8)&#xA;(unless (eq system-type 'windows-nt)&#xA;  (set-selection-coding-system 'utf-8))&#xA;(prefer-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like to understand some more what I am doing and why another utf-8 would be better as a default coding system?&lt;/p&gt;&#xA;" OwnerUserId="225" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2024-03-26T15:07:10.957" Title="Coding System utf-8 on Mac - Which one and why as default?" Tags="|init-file|character-encoding|unicode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13567" PostTypeId="2" ParentId="13561" CreationDate="2015-06-30T11:14:55.773" Score="1" Body="&lt;p&gt;I use &lt;kbd&gt;! open RET&lt;/kbd&gt; in &lt;code&gt;dired&lt;/code&gt; buffer which DTRT for all files like &lt;code&gt;mp3&lt;/code&gt;, &lt;code&gt;odt&lt;/code&gt; &amp;amp;c.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-06-30T11:14:55.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13568" PostTypeId="1" AcceptedAnswerId="13572" CreationDate="2015-06-30T12:12:40.407" Score="2" ViewCount="134" Body="&lt;p&gt;In Magit buffers, or helm-swoop, an unclosed double quote enables the string highlighting for the rest of the buffer (until another quote is found). This is how it looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/t4AGj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of that, I also lose the green/red highlighting of added/removed lines in Magit. When I disable the font-lock-mode, everything becomes fine (blue text is not blue anymore, +/- lines are colored).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could add hooks to disable font-lock-mode in those buffers but it is too much trouble to do that for every buffer. Can I somehow find out what causes the screwup in the first place?&lt;/p&gt;&#xA;" OwnerUserId="6881" LastActivityDate="2015-06-30T12:56:30.713" Title="Font-lock for strings messes up non-code buffers" Tags="|magit|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13569" PostTypeId="1" CreationDate="2015-06-30T12:12:59.120" Score="6" ViewCount="69" Body="&lt;p&gt;Is it possible to write an &lt;code&gt;execute-next-command&lt;/code&gt; function that calls the command that would have been called if the current binding was not active?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;RET&lt;/code&gt; is bound to &lt;code&gt;newline&lt;/code&gt; by default.  Let's say that I bind &lt;code&gt;RET&lt;/code&gt; to &lt;code&gt;my-command&lt;/code&gt;. In some cases, &lt;code&gt;my-command&lt;/code&gt; should execute whatever would have been executed for &lt;code&gt;RET&lt;/code&gt; if I hadn't bound it to &lt;code&gt;my-command&lt;/code&gt;.  I could save the old binding before rebinding &lt;code&gt;RET&lt;/code&gt;, but I would rather avoid that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: There is the &lt;code&gt;key-binding&lt;/code&gt; function, but it doesn't let you find the next binding.&lt;/p&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="2763" LastEditDate="2015-06-30T12:33:30.847" LastActivityDate="2015-06-30T12:33:30.847" Title="Executing the next command bound to the same key" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13570" PostTypeId="2" ParentId="13569" CreationDate="2015-06-30T12:22:35.697" Score="4" Body="&lt;p&gt;It's doable with minor modes. Suppose you have &lt;code&gt;my-minor-mode&lt;/code&gt; active in an org-mode buffer.  And you have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-minor-mode-map (kbd &quot;M-RET&quot;) #'save-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could call the old &lt;kbd&gt;RET&lt;/kbd&gt; binding in org-mode with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-interactively&#xA; (lookup-key org-mode-map (kbd &quot;M-RET&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-06-30T12:22:35.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13571" PostTypeId="1" AcceptedAnswerId="13577" CreationDate="2015-06-30T12:51:45.460" Score="1" ViewCount="435" Body="&lt;p&gt;While configuring &lt;a href=&quot;https://github.com/milkypostman/powerline&quot; rel=&quot;nofollow noreferrer&quot;&gt;powerline&lt;/a&gt;, I use my own format for the mode-line. I now want to apply a different face to the battery load string, depending on the battery status (dis/charging). However, when I compute the charging status within my &lt;code&gt;mode-line-format&lt;/code&gt; construct, Emacs gets really slow and I can't mark region with shift + arrow anymore.&lt;/p&gt;&#xA;&lt;p&gt;You can see the mode-line definition in my configuration that I keep on Bitbucket: &lt;a href=&quot;https://bitbucket.org/angrybacon/dotemacs/src/cfce24afb2139a10294154d7b923cc1fc697f80a/lisp/init-mode-line.el?at=master#cl-102&quot; rel=&quot;nofollow noreferrer&quot;&gt;init-mode-line.el:102&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The idea behind it was to have a boolean describing the battery status, and use it in the manner of &lt;code&gt;active&lt;/code&gt;, that I already use.&lt;/p&gt;&#xA;&lt;p&gt;Here is the output of &lt;code&gt;profile-report&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hncAB.png&quot; alt=&quot;Profile report&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-01T17:10:08.420" Title="Emacs gets really slow when trying to compute battery status within mode-line-format" Tags="|mode-line|powerline|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13572" PostTypeId="2" ParentId="13568" CreationDate="2015-06-30T12:56:30.713" Score="2" Body="&lt;p&gt;It turned out that I created a problem myself. I unconditionally enabled &#xA;&lt;a href=&quot;https://julien.danjou.info/projects/emacs-packages&quot; rel=&quot;nofollow&quot;&gt;rainbow-mode&lt;/a&gt; in all buffers, which sets the &lt;code&gt;font-lock-keywords&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To discover this I debugged the &lt;code&gt;font-lock-specified-p&lt;/code&gt; function which returned &lt;code&gt;t&lt;/code&gt; in Magit mode (and it shouldn't). Hope this information helps someone.&lt;/p&gt;&#xA;" OwnerUserId="6881" LastActivityDate="2015-06-30T12:56:30.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13573" PostTypeId="2" ParentId="13561" CreationDate="2015-06-30T14:04:21.863" Score="1" Body="&lt;p&gt;I used to use the &lt;a href=&quot;http://melpa.org/#/openwith&quot; rel=&quot;nofollow&quot;&gt;openwith&lt;/a&gt; package which provides a global minor mode that installs a file name handler that consults a customizable list of program associations. Even if you don't like openwith, I think the idea of using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Magic-File-Names.html&quot; rel=&quot;nofollow&quot;&gt;file name handlers&lt;/a&gt; is a good one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;openwith has the advantage of working everywhere you open a file, but also has the disadvantage of working everywhere Emacs implicitly opens a file for you! In particular I remember being annoyed that grepping across a directory in dired would open my PDFs in an external viewer and play my videos! I remember whipping up something to put in my &lt;code&gt;init.el&lt;/code&gt; to counteract that, maybe advising some dired function to deactivate &lt;code&gt;openwith-mode&lt;/code&gt; first, something like that. At any rate it was easy to workaround.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I stopped using openwith when I started using Helm, as I find typing &lt;code&gt;C-c C-x&lt;/code&gt; from &lt;code&gt;helm-find-files&lt;/code&gt; convenient enough. (Also nowadays, I only unconditionally open audio and video files outside of Emacs, so most of the time I like being able to either open a file in Emacs or in an external program.)&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2015-06-30T14:04:21.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13574" PostTypeId="1" AcceptedAnswerId="13576" CreationDate="2015-06-30T14:25:01.487" Score="10" ViewCount="773" Body="&lt;p&gt;I am noticing some notable package maintainers are choosing to not use the Emacs package management system (ESS?) or complaining about its limitations (Helm). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting from &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;Helm&lt;/a&gt;'s &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/master/README.md&quot; rel=&quot;nofollow&quot;&gt;README.md&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;WARNING&lt;/em&gt;: Due to a bad concept of package.el which is in charge of&#xA;  fetching helm files and compiling them, users had errors most of the&#xA;  time when upgrading from melpa and list-package. To avoid this Async&#xA;  have been added as dependency to helm to force package.el compiling&#xA;  its files in a clean environment. People installing from git and using&#xA;  the make file will not suffer from this problem and don't need Async&#xA;  though it is recommended as it fix installation of all other packages&#xA;  you may install with package.el from (m)elpa. See FAQ for more infos.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What exact technical limitations does the current package management system has that they could be alluding to, and why would packages need to use &lt;code&gt;async&lt;/code&gt; as a dependency?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="8899" LastEditDate="2015-10-29T18:20:40.540" LastActivityDate="2017-09-21T01:14:41.660" Title="Technical considerations for package maintainers to not use the Emacs package manager?" Tags="|package|package-repositories|ess|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13575" PostTypeId="2" ParentId="13557" CreationDate="2015-06-30T16:10:45.490" Score="1" Body="&lt;p&gt;Those major modes like python-mode and haskell-mode set (or should set) &lt;code&gt;electric-indent-inhibit&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-06-30T16:10:45.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13576" PostTypeId="2" ParentId="13574" CreationDate="2015-06-30T16:17:56.623" Score="19" Body="&lt;p&gt;The problem you're referring to is probably that when you upgrade a package from within an Emacs session where that package is already in use, the old version of the package will sometimes interfere during compilation of the new version, leading to miscompiled files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a tentative fix for that in Emacs-25, but AFAIK the problem is still present in 24.5.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-09-21T01:14:41.660" LastActivityDate="2017-09-21T01:14:41.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13577" PostTypeId="2" ParentId="13571" CreationDate="2015-06-30T17:07:50.917" Score="0" Body="&lt;p&gt;Shamelessly taken from &lt;a href=&quot;https://github.com/Malabarba/smart-mode-line/blob/master/smart-mode-line.el#L1592&quot; rel=&quot;nofollow&quot;&gt;smart-mode-line.el:1592&lt;/a&gt;. The defadvice will colorize the battery load string before every call to &lt;code&gt;battery-update&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice battery-update (before my/pl-colorize-battery-advice activate)&#xA;  &quot;Colorize the battery load string depending on its status (dis/charging).&quot;&#xA;&#xA;  (if (string-equal &quot;AC&quot; (cdr (assoc 76 (funcall battery-status-function))))&#xA;      (copy-face 'my/pl-battery-charging-face 'my/pl-battery-face)&#xA;    (copy-face 'my/pl-battery-discharging-face 'my/pl-battery-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2015-06-30T17:07:50.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13578" PostTypeId="2" ParentId="13553" CreationDate="2015-06-30T19:41:54.730" Score="3" Body="&lt;p&gt;I had the same issue. Tern was installed in /usr/local/bin, but emacs was not looking for it there. I added this to my init file to add /usr/local/bin to the path.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:/usr/local/bin&quot;))&#xA;    (setq exec-path (append exec-path '(&quot;/usr/local/bin&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="58" LastActivityDate="2015-06-30T19:41:54.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13579" PostTypeId="1" AcceptedAnswerId="13581" CreationDate="2015-06-30T20:14:03.807" Score="5" ViewCount="7873" Body="&lt;p&gt;By &lt;code&gt;M-x eshell&lt;/code&gt; or &lt;code&gt;M-x shell&lt;/code&gt; Emacs opens a &lt;code&gt;shell&lt;/code&gt; or an &lt;code&gt;eshell&lt;/code&gt; in the current window.&#xA;How to open this &lt;code&gt;shell&lt;/code&gt; or &lt;code&gt;eshell&lt;/code&gt; in a new window?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-06-30T20:56:38.330" LastActivityDate="2016-07-10T16:26:43.637" Title="How to open `shell` or `eshell` in a new window or frame" Tags="|shell|eshell|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13580" PostTypeId="1" CreationDate="2015-06-30T20:22:42.217" Score="8" ViewCount="1190" Body="&lt;p&gt;I just installed debian 8 and emacs24. I noticed a new feature! you now can push F11 to enter fullscreen mode. I wanted to put emacs on fullscreen mode at startup, but couldn't find the command... and then I though that it would be easier tell emacs just to &quot;push&quot; F11 on my .emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any command I can use so emacs will press a given sequence of keystrokes? something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(just-push-it &quot;\C-x&quot; &quot;3&quot; &quot;\C-x&quot; &quot;\C-o&quot; &quot;\M-x ansi-term&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8769" LastEditorUserId="105" LastEditDate="2015-06-30T20:46:32.117" LastActivityDate="2015-07-01T14:06:16.847" Title="press keystroke sequence with elisp" Tags="|elisp|frames|keystrokes|fullscreen|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13581" PostTypeId="2" ParentId="13579" CreationDate="2015-06-30T20:22:42.657" Score="5" Body="&lt;p&gt;Here's a simple command to open a &lt;code&gt;shell&lt;/code&gt; in a new window:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun shell-other-window ()&#xA;  &quot;Open a `shell' in a new window.&quot;&#xA;  (interactive)&#xA;  (let ((buf (shell)))&#xA;    (switch-to-buffer (other-buffer buf))&#xA;    (switch-to-buffer-other-window buf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt; If you want &lt;code&gt;shell&lt;/code&gt; to open in a new &lt;em&gt;frame&lt;/em&gt; rather than new &lt;em&gt;window&lt;/em&gt;, replace &lt;code&gt;switch-to-buffer-other-window&lt;/code&gt; with &lt;code&gt;switch-to-buffer-other-frame&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-06-30T20:38:12.167" LastActivityDate="2015-06-30T20:38:12.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13582" PostTypeId="2" ParentId="13580" CreationDate="2015-06-30T20:45:33.097" Score="1" Body="&lt;p&gt;Customize user option &lt;code&gt;default-frame-alist&lt;/code&gt;. Add (by clicking button &lt;code&gt;INS&lt;/code&gt;) parameter &lt;code&gt;fullscreen&lt;/code&gt; and give it a value of &lt;code&gt;fullboth&lt;/code&gt;. Save the option changes. &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-06-30T20:45:33.097" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13583" PostTypeId="1" AcceptedAnswerId="13584" CreationDate="2015-06-30T22:01:38.247" Score="45" ViewCount="10069" Body="&lt;p&gt;When posing questions on this site, people sometimes talk about &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Window.html#Basic-Window&quot; rel=&quot;noreferrer&quot;&gt;&quot;windows&quot;&lt;/a&gt; when they mean &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Frames.html&quot; rel=&quot;noreferrer&quot;&gt;&quot;frames,&quot;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Buffers.html&quot; rel=&quot;noreferrer&quot;&gt;&quot;buffers&quot;&lt;/a&gt; or &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Files.html#Files&quot; rel=&quot;noreferrer&quot;&gt;&quot;files&quot;&lt;/a&gt; when they mean &quot;windows.&quot;  So:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Q:&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;What is the difference between a buffer, a file, a window, and a frame?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm posing this question in the spirit of &lt;a href=&quot;https://emacs.stackexchange.com/questions/3555/what-is-the-difference-between-a-function-and-a-command&quot;&gt;this Q&amp;amp;A combo&lt;/a&gt;: to promote correct use of the terms.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-07-01T13:42:04.577" Title="What's the difference between a buffer, a file, a window, and a frame?" Tags="|buffers|window|frames|files|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13584" PostTypeId="2" ParentId="13583" CreationDate="2015-06-30T22:04:03.253" Score="57" Body="&lt;p&gt;Emacs predates contemporary window-based operating systems, so its&#xA;terminology also predates the current terms.  Unfortunately, it means that new users and experienced users sometimes have trouble making themselves understood to each other, since they're using the terms in different ways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In brief:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Frames&quot; are to Emacs what &quot;windows&quot; are to everything else&lt;/li&gt;&#xA;&lt;li&gt;&quot;Windows&quot; are subdivisions of frames (think &quot;window panes&quot;)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Buffers&quot; hold the contents you display/edit in windows&lt;/li&gt;&#xA;&lt;li&gt;When we &quot;open a file,&quot; we are, technically, opening a buffer&#xA;that &quot;visits&quot; that file&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following annotated screenshot illustrates these points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SAJFO.jpg&quot; alt=&quot;annotated screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This Emacs session has two &lt;em&gt;frames&lt;/em&gt; (blue outline) -- what, for&#xA;most other programs, we would call &quot;windows.&quot;&lt;/li&gt;&#xA;&lt;li&gt;There are a total of three Emacs &lt;em&gt;windows&lt;/em&gt; (red outline) open: one in the left&#xA;frame, and two in the right frame.&lt;/li&gt;&#xA;&lt;li&gt;The single window in the left frame is displaying the &lt;code&gt;scratch&lt;/code&gt;&#xA;&lt;em&gt;buffer&lt;/em&gt;.  It is not connected to (i.e., visiting) any &lt;em&gt;file&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The top window in the right frame is displaying the &lt;em&gt;buffer&lt;/em&gt;&#xA;&lt;code&gt;example.org&lt;/code&gt;, which is, in turn, visiting the &lt;em&gt;file&lt;/em&gt;&#xA;&lt;code&gt;~/path/to/example.org&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The bottom window in the right frame is displaying the&#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;indirect buffer&lt;/em&gt;&lt;/a&gt;&#xA;&lt;code&gt;example2&lt;/code&gt;, which has the same contents as the buffer&#xA;&lt;code&gt;example.org&lt;/code&gt; in the top window.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So here's the summary:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Frames.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;frames&lt;/strong&gt;&lt;/a&gt; are what you call &quot;windows&quot; in basically all of your&#xA;other software&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Window.html#Basic-Window&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;windows&lt;/strong&gt;&lt;/a&gt; are divisions of &lt;em&gt;frames&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Buffers.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;buffers&lt;/strong&gt;&lt;/a&gt; hold the stuff that you display in &lt;em&gt;windows&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;buffers&lt;/em&gt; may or may not be &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Visiting.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;visiting&lt;/strong&gt;&lt;/a&gt; (i.e., be associated with) a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Files.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;file&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-06-30T22:04:03.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13585" PostTypeId="2" ParentId="13579" CreationDate="2015-06-30T22:22:01.440" Score="9" Body="&lt;p&gt;The canonical way of altering the display behaviour for a buffer is to customize &lt;code&gt;display-buffer-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-buffer-alist '((&quot;\\`\\*e?shell&quot; display-buffer-pop-up-window)))&#xA;(setq display-buffer-alist '((&quot;\\`\\*e?shell&quot; display-buffer-pop-up-frame)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's a bit easier with my &lt;a href=&quot;https://github.com/wasamasa/shackle&quot;&gt;shackle&lt;/a&gt; package though:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shackle-rules '((&quot;\\`\\*e?shell&quot; :regexp t :popup t)))&#xA;(setq shackle-rules '((&quot;\\`\\*e?shell&quot; :regexp t :frame t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-07-01T07:30:31.330" LastActivityDate="2015-07-01T07:30:31.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13586" PostTypeId="2" ParentId="13583" CreationDate="2015-06-30T22:46:10.750" Score="11" Body="&lt;p&gt;I would point readers to (1) The &lt;strong&gt;glossaries&lt;/strong&gt; of &lt;a href=&quot;http://www.emacswiki.org/emacs/Glossary&quot; rel=&quot;noreferrer&quot;&gt;Emacs Wiki&lt;/a&gt; and (2) the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Glossary.html&quot; rel=&quot;noreferrer&quot;&gt;Emacs manual&lt;/a&gt; for such information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also to the EmacsWiki &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsNewbie&quot; rel=&quot;noreferrer&quot;&gt;Newbie&lt;/a&gt; page, which has lots of good introductory information about such things. And to the Emacs manual in general, which also introduces such things well: &lt;strong&gt;&lt;code&gt;C-h r&lt;/code&gt;&lt;/strong&gt; then &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt; followed by typing whatever you want to learn about, e.g., &lt;code&gt;window&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The EmacsWiki page linked from its &lt;em&gt;glossary&lt;/em&gt; for entry &lt;strong&gt;window&lt;/strong&gt; includes this graphic, which shows a &lt;em&gt;frame&lt;/em&gt; with 3 &lt;em&gt;windows&lt;/em&gt;, and indicates the menu bar for the current buffer and the mode lines of the windows.  The 3 &lt;em&gt;buffers&lt;/em&gt; shown in the windows are named &lt;code&gt;*Help*&lt;/code&gt;, &lt;code&gt;drews-lisp-20&lt;/code&gt;, and &lt;code&gt;shrink-fit.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ug72N.jpg&quot; alt=&quot;Emacs frame, windows, and window parts&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There are other combinations of things that could be asked about, BTW, if one really wants to ask such questions.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-01T13:42:04.577" LastActivityDate="2015-07-01T13:42:04.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13587" PostTypeId="1" CreationDate="2015-06-30T23:41:08.520" Score="2" ViewCount="53" Body="&lt;p&gt;When invoking &lt;code&gt;C-h h&lt;/code&gt;, emacs opens a &lt;code&gt;HELLO&lt;/code&gt; file located in &lt;code&gt;Emacs.app/Contents/Resources/etc&lt;/code&gt; directory (under Mac OS X). I looked for myself and there are tons of interesting files (&lt;code&gt;JOKES&lt;/code&gt;, &lt;code&gt;PROBLEMS&lt;/code&gt;, etc.) but I'm not certain what's the canonical way of accessing those files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Not too sure what tag should apply here.)&lt;/p&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2015-06-30T23:41:08.520" Title="How files in the etc directory should be accessed?" Tags="|config|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13588" PostTypeId="2" ParentId="13580" CreationDate="2015-07-01T00:26:47.657" Score="0" Body="&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun just-push-it (&amp;amp;rest keys)&#xA;  (setq unread-command-events&#xA;        (append (apply 'vconcat (mapcar 'kbd keys)) nil)))&#xA;&#xA;(just-push-it &quot;C-x 3&quot; &quot;C-x o&quot; &quot;M-x ansi-term&quot; &quot;RET&quot; &quot;RET&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-07-01T00:26:47.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13589" PostTypeId="1" AcceptedAnswerId="13597" CreationDate="2015-07-01T00:37:47.380" Score="3" ViewCount="1037" Body="&lt;p&gt;I have the following org-mode capture template:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(org-capture-templates (quote ((&quot;t&quot; &quot;Task&quot; entry (file+headline &quot;~/org/tasks.org&quot; &quot;Incoming&quot;) &quot;&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The resulting capture buffer looks like this  (very vaguely, but you get the idea):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** &#xA;   [[link to headline at point]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what I want, except for the link. How do I avoid getting that? I'm not finding anything in the &lt;a href=&quot;http://orgmode.org/manual/Template-elements.html&quot; rel=&quot;nofollow&quot;&gt;documentation on template elements&lt;/a&gt; but I must be missing something?&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-07-01T12:16:12.033" Title="How to remove the link from org-capture templates" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13590" PostTypeId="1" CreationDate="2015-07-01T01:06:26.073" Score="2" ViewCount="110" Body="&lt;p&gt;I'm using the Cocoa version of Emacs. When company mode presents a list of completions you can use the mouse to select one. It would seem natural to be able to use the mouse wheel to scroll through the selections as well, but it just scrolls the page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure the mouse wheel to scroll through company mode completions when the completions are visible?&lt;/p&gt;&#xA;" OwnerUserId="58" LastEditorUserId="105" LastEditDate="2015-07-01T02:07:14.617" LastActivityDate="2015-08-03T19:29:06.960" Title="Is it possible to use the mouse wheel for company mode?" Tags="|key-bindings|company-mode|scrolling|mouse|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13592" PostTypeId="1" AcceptedAnswerId="13610" CreationDate="2015-07-01T06:47:40.107" Score="4" ViewCount="505" Body="&lt;p&gt;My Emacs version is 24.5.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comint-mode protects the prompt by somehow defining the beginning of line to start directly after the prompt regex. This works for normal motion commands like &lt;code&gt;move-beginning-of-line&lt;/code&gt; and even evil-mode motions. For example I can kill the current input by calling &lt;code&gt;evil-change-whole-line&lt;/code&gt; and leave the prompt on the same line intact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eshell-mode isn't derived from comint mode, and the &lt;code&gt;C-a&lt;/code&gt; shortcut is overriden to eshell-bol, which takes the prompt into consideration. So by using normal Emacs shortcuts most things work, but trying to use the standard commands for movement like &lt;code&gt;move-beginning-of-line&lt;/code&gt; yields unexpected results. So by using &lt;code&gt;evil-change-whole-line&lt;/code&gt; I kill the whole line, when I only wanted to kill the input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does comint-mode protect the prompt and is it possible to implement the same behavior in eshell-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things I have tried but didn't bear fruit:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;comint-line-beginning-position&lt;/code&gt; and &lt;code&gt;comint-bol&lt;/code&gt;are defined in comint.el, but they aren't called when calling &lt;code&gt;evil-change-whole-line&lt;/code&gt; or &lt;code&gt;move-beginning-of-line&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I noticed some references to the &lt;code&gt;inhibit-field-text-motion&lt;/code&gt; variable in comint.el. But it is &lt;code&gt;nil&lt;/code&gt; in at least &lt;code&gt;shell-mode&lt;/code&gt;, which is comint-derived.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8339" LastActivityDate="2015-07-02T10:19:06.693" Title="How does comint-mode override beginning of line behavior? I want same functionality to eshell" Tags="|evil|eshell|comint|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13593" PostTypeId="2" ParentId="13580" CreationDate="2015-07-01T07:31:13.913" Score="3" Body="&lt;pre&gt;&lt;code&gt;(execute-kbd-macro (read-kbd-macro &quot;&amp;lt;f11&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for the key sequence syntax see the &lt;code&gt;edmacro-mode&lt;/code&gt; help (&lt;code&gt;C-h f edmacro-mode&lt;/code&gt;). For example, it allows you to write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(execute-kbd-macro (read-kbd-macro &quot;C-x 3 C-x o M-x ansi-term&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2450" LastEditorUserId="2450" LastEditDate="2015-07-01T10:20:04.157" LastActivityDate="2015-07-01T10:20:04.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13594" PostTypeId="2" ParentId="13539" CreationDate="2015-07-01T08:58:57.590" Score="4" Body="&lt;pre&gt;&lt;code&gt;(defvar helm-source-emacs-commands&#xA;  (helm-build-sync-source &quot;Emacs commands&quot;&#xA;    :candidates (lambda ()&#xA;                  (let ((cmds))&#xA;                    (mapatoms&#xA;                     (lambda (elt) (when (commandp elt) (push elt cmds))))&#xA;                    cmds))&#xA;    :coerce #'intern-soft&#xA;    :action #'command-execute)&#xA;  &quot;A simple helm source for Emacs commands.&quot;)&#xA;&#xA;;; Try it&#xA;(helm :sources helm-source-emacs-commands)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-07-01T08:58:57.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13595" PostTypeId="1" CreationDate="2015-07-01T10:14:53.577" Score="4" ViewCount="359" Body="&lt;p&gt;I really like the idea of structuring my &lt;code&gt;init.el&lt;/code&gt; file with orgmode. Now I wonder if this would also work with other configuration files like &lt;code&gt;vimrc&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8773" LastActivityDate="2015-07-09T19:46:52.103" Title="Can I use org-mode to structure other dotfiles?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13596" PostTypeId="1" AcceptedAnswerId="13604" CreationDate="2015-07-01T11:32:15.570" Score="3" ViewCount="662" Body="&lt;p&gt;I thought it would be great to save a Elisp file (in my init), and it compiles automatically a byte-compile Elisp-file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I wrote a function for this. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun remove-elc-and-compile-on-save ()&#xA;      &quot;If you're saving an elisp file, likely the .elc is no longer valid. And automatically byte-recompile this file whenever it's saved.&quot;&#xA;      (interactive)&#xA;      (if (file-exists-p (concat buffer-file-name &quot;c&quot;))&#xA;          (delete-file (concat buffer-file-name &quot;c&quot;))&#xA;        nil)&#xA;      (byte-compile-file buffer-file-name)&#xA;      )&#xA;&#xA;    (add-hook 'emacs-lisp-mode-hook &#xA;              (lambda () &#xA;                (add-hook 'after-save-hook 'remove-elc-and-compile-on-save nil 'make-it-local)))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, the directory structure where my Elisp files are: &lt;code&gt;C:\foobar\Emacs\setup-foobar.el.&lt;/code&gt; (It's a Windows structure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works perfectly. However, my Emacs directory with the Elips-files will be spoiled with the compiled &lt;code&gt;.elc&lt;/code&gt;-files all over the place. So I thought to move the &lt;code&gt;.elc&lt;/code&gt;-files to a specific directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the directory structure where my Elisp files are: &lt;code&gt;C:\foobar\Emacs\setup-foobar.el.&lt;/code&gt; (It's a Windows structure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I would like to move the &lt;code&gt;.elc&lt;/code&gt; files to &lt;code&gt;C:\foobar\Emacs\setup\setup-foobar.el.&lt;/code&gt; When I checked the documentation of the functions &lt;code&gt;file-exists-p&lt;/code&gt;, &lt;code&gt;delete-file&lt;/code&gt;, &lt;code&gt;byte-compile-file&lt;/code&gt;, there is no optional parameter available to specify the path where the delete/compilation operations should occur. They're executed in the same directory as the &lt;code&gt;buffer-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried another ways like: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(byte-compile-file (concat &quot;C:/foobar/Emacs/setup/&quot; buffer-file-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it didn't worked out, and it's not applicable for the &lt;code&gt;file-exists-p&lt;/code&gt; and &lt;code&gt;delete-file&lt;/code&gt; functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm wondering in which way I could specify the path where the operations should be executed, instead in the same directory as the buffer? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="253" LastEditDate="2015-07-02T20:58:29.517" LastActivityDate="2015-07-02T20:58:29.517" Title="How to specify the directory for file-exists/delete-file/byte-compile-file?" Tags="|directories|byte-compilation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13597" PostTypeId="2" ParentId="13589" CreationDate="2015-07-01T12:16:12.033" Score="4" Body="&lt;p&gt;The documentation I linked to in my original question mentions that if no template string is specified &quot;an appropriate default template will be used.&quot; Apparently that default template must be where the unwanted link was coming from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I resolved the issue by adding a template string, &lt;code&gt;* %?&lt;/code&gt;. So now my template customization looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'(org-capture-templates (quote ((&quot;t&quot; &quot;Task&quot; entry (file+headline &quot;~/org/tasks.org&quot; &quot;Incoming&quot;) &quot;* %?&quot;))))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-07-01T12:16:12.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13599" PostTypeId="1" AcceptedAnswerId="13882" CreationDate="2015-07-01T12:40:59.443" Score="4" ViewCount="341" Body="&#xA;&#xA;&lt;h2&gt;My setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs GUI (version 24.4.51.1 (x86_64-w64-mingw32) &#xA;                       &lt;a href=&quot;https://bitbucket.org/Haroogan/emacs-for-windows/&quot; rel=&quot;nofollow&quot;&gt;compiled from Harroogan Emacs.&lt;/a&gt;)&#xA;Package &lt;a href=&quot;http://emacswiki.org/emacs/header2.el&quot; rel=&quot;nofollow&quot;&gt;header2.el&lt;/a&gt;, which I use a lot. &#xA;If you need more detail about header2, see &lt;a href=&quot;http://emacswiki.org/emacs/AutomaticFileHeaders&quot; rel=&quot;nofollow&quot;&gt;the emacs wiki &lt;/a&gt;. It's a great package, I really recommend it. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;header2.el lets you define file headers for different types of file (C, shell, EmacsLisp, and so on). You can automatically insert a header when you open a new file buffer, and it modifies them whenever you're saving.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made a code, that focused only on inserting the version number and incrementing it every time whenever you're saving the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code below inserts the number 0 of version, when you're creating a new file. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (defsubst my/header-update-count ()&#xA;   &quot;Insert a count of the number of times the file has been saved.&quot;&#xA;   (insert (concat comment-start &quot; Version     : 0\n&quot;)))&#xA;&#xA; (setq make-header-hook '(my/header-update-count))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Configuring the update of the header whenever you're saving the file.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (defvar file-header-update-alist ()&#xA;   &quot;Used by `update-file-header' to know what to do in a file.&#xA; Is a list of sets of cons cells where the car is a regexp string and the cdr is&#xA; the function to call if the string is found near the start of the file.&quot;)&#xA;&#xA; (defvar header-prefix-string &quot;&quot;&#xA;   &quot;Mode-specific comment prefix string for use in headers.&quot;)&#xA;&#xA; (defun register-file-header-action (regexp function-to-call)&#xA;   &quot;Record FUNCTION-TO-CALL as the action to take if REGEXP is found&#xA; in the file header when a file is written.  The function will be called&#xA; with the cursor located just after the matched REGEXP.  Calling this twice&#xA; with the same args overwrites the previous FUNCTION-TO-CALL.&quot;&#xA;   (let ((ml  (assoc regexp file-header-update-alist)))&#xA;     (if ml&#xA;         (setcdr ml function-to-call);; overwrite old defn&#xA;       ;; This entry is new to us.  Add to the master alist&#xA;       (setq file-header-update-alist  (cons (cons regexp function-to-call)&#xA;                                             file-header-update-alist)))))&#xA;&#xA;&#xA; (register-file-header-action &quot;Version   [ \t]*: &quot; 'update-write-count) &#xA; (when (boundp 'libreq-file-header)&#xA;   (register-file-header-action libreq-file-header 'update-lib-requires))&#xA;&#xA;;; To have Emacs update file headers automatically whenever you save a&#xA;;; file, put this in your init file (~/.emacs):&#xA;(autoload 'auto-update-file-header &quot;header2&quot;)&#xA;(add-hook 'write-file-hooks 'auto-update-file-header)&#xA;&#xA;;; To have Emacs add a file header whenever you create a new file in&#xA;;; some mode, put this in your init file (~/.emacs):&#xA;(autoload 'auto-make-header &quot;header2&quot;)&#xA;(add-hook 'emacs-lisp-mode-hook 'auto-make-header)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Action:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now the version numbering works like your version is &lt;code&gt;0&lt;/code&gt;. When you're saving, it increments it with 1. So if your header have the version 5, when saving, it will change to version 6. &#xA;I would like to change the way of version numbering from one number to number dot number. For example, like when you're saving, it will update from &lt;code&gt;0.1&lt;/code&gt; to &lt;code&gt;0.2&lt;/code&gt; or from &lt;code&gt;3.12&lt;/code&gt; to &lt;code&gt;3.13&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in order to modify this, I changed the version numbering with adding a dot and number:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(insert (concat comment-start &quot; Version     : 0.0\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I save the buffer, it updates from &lt;code&gt;0.0&lt;/code&gt; to &lt;code&gt;1.0&lt;/code&gt; to &lt;code&gt;2.0&lt;/code&gt;, which is not the intention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my setup the following line uses regexp to update the version numbering &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(register-file-header-action &quot;Version   [ \t]*: &quot; 'update-write-count)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I look into the source of the package &lt;a href=&quot;http://emacswiki.org/emacs/header2.el&quot; rel=&quot;nofollow&quot;&gt;header2.el&lt;/a&gt;, I noticed it uses regexp. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(register-file-header-action &quot;\$VERSION[ \t]*=[ \t]*\&quot;\\([0-9]+\\.\\)+&quot;&#xA;                                   'update-write-count)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I modified the regexp, it didn't gives me the desired behaviour. Notice that adding a file header and updating it are not done by a minor mode. They are done on hooks.  Adding a file header is done, for example, on a major-mode hook, and updating is done, for example, on &lt;code&gt;write-file-hooks&lt;/code&gt;. It's a fairly not a difficult modification, but I couldn't even figure it out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="115" LastEditDate="2015-07-08T16:42:15.120" LastActivityDate="2015-07-10T17:51:00.823" Title="header2.el: how to increment the version number with dot?" Tags="|files|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13600" PostTypeId="1" CreationDate="2015-07-01T13:32:29.023" Score="4" ViewCount="119" Body="&lt;p&gt;I would like to, as part of Emacs Lisp package set-up process to run some programs which typically require superuser access, for instance, I would like to make sure that certain system packages are installed, and if not, then install them, I would also need to configure a database, which, will also require superuser access (once, in order to add a user with reduced privileges to operate on her own database).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was hoping to enlist Tramp for help, but after some searching, couldn't find a way to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, what I need is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make sure I need the permissions to do what I want.&lt;/li&gt;&#xA;&lt;li&gt;If test comes out positive, ask the user to start a shell with elevated permissions.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From that point on, I think I could manage it.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-01-27T22:50:11.397" Title="Install programs which require superuser permissions" Tags="|tramp|install|sudo|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13601" PostTypeId="2" ParentId="13599" CreationDate="2015-07-01T13:53:12.720" Score="2" Body="&lt;p&gt;The problem is that you are using existing function &lt;code&gt;update-write-count&lt;/code&gt;, which increments by 1 (integer). If you want something different (e.g. incrementing by 0.1) then you will need to use a different function here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(register-file-header-action &quot;Version   [ \t]*: &quot; 'my-update-version-count)&#xA;&#xA;(defun my-update-version-count ()&#xA;  (let* ((str  (delete-and-forget-line))&#xA;         (rem  (read-from-string str))&#xA;         (num  (car rem)))&#xA;    (if (numberp num)&#xA;        (insert (format &quot;%s&quot; (+ num 0.1)) (substring str (cdr rem)))&#xA;      (insert str)&#xA;      (error &quot;Invalid number for update count `%s'&quot; str))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-01T14:38:59.673" LastActivityDate="2015-07-01T14:38:59.673" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13602" PostTypeId="2" ParentId="13580" CreationDate="2015-07-01T14:06:16.847" Score="1" Body="&lt;p&gt;The other answers pretty much cover it, but you may run into a problem with &lt;code&gt;read-kbd-macro&lt;/code&gt; where it isn't really meant for reading raw text input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &quot;hello world&quot; becomes the macro to insert &quot;helloworld&quot; without the space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could write a function that gives you a way to specify what should be read as a macro and what is already read to be executed as is like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun push-it-real-good (&amp;amp;rest keys)&#xA;  (execute-kbd-macro&#xA;   (apply 'vconcat&#xA;          (mapcar (lambda (k)&#xA;                    (cond&#xA;                     ((listp k) (apply 'append k))&#xA;                     (t (read-kbd-macro k))))&#xA;                  keys))))&#xA;&#xA;(push-it-real-good &quot;hello world&quot;)    ;; =&amp;gt; helloworld&#xA;(push-it-real-good '(&quot;hello world&quot;)) ;; =&amp;gt; hello world&#xA;;; messages Hello World&#xA;(push-it-real-good &quot;M-:&quot; '(&quot;(message \&quot;Hello World\&quot;)&quot;) &quot;&amp;lt;return&amp;gt;&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-07-01T14:06:16.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13603" PostTypeId="1" AcceptedAnswerId="19135" CreationDate="2015-07-01T14:12:06.047" Score="2" ViewCount="664" Body="&lt;p&gt;I use Emacs 24.3.1 and AUCTeX. I switched on the &lt;code&gt;electric-pair-mode&lt;/code&gt; in LaTeX-buffers. The only time I would really like to disable it in the minibuffer while inserting math-mode parentheses via the &lt;code&gt;\left&lt;/code&gt; and &lt;code&gt;\right&lt;/code&gt; commands. For these commands in Emacs, I use  &lt;code&gt;\&lt;/code&gt; as &lt;code&gt;TeX-electric macro&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question would be if there is an easy way to disable the &lt;code&gt;electric-pair-mode&lt;/code&gt; inside the minibuffer? Or do I maybe use an inconvenient setup for putting parentheses into equations?&lt;/p&gt;&#xA;" OwnerUserId="8750" LastEditorUserId="8750" LastEditDate="2015-12-28T19:20:04.307" LastActivityDate="2016-12-16T23:01:26.803" Title="AucTeX: Disable electric-pair-mode in minibuffer during Macro definition?" Tags="|latex|auctex|minibuffer|electric-pair-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13604" PostTypeId="2" ParentId="13596" CreationDate="2015-07-01T14:35:30.503" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I agree with @wvxvw's comment: You don't need to move the *.elc files; it is enough to not look at them. ;-)  You can hide them from a Dired listing, for example.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;But if you really want to have byte-compiling automatically put the *.elc result in a different directory then you can set variable &lt;code&gt;byte-compile-dest-file-function&lt;/code&gt; to a function that is similar to &lt;code&gt;byte-compile-dest-file&lt;/code&gt; but which uses a different directory.  Something like this:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq byte-compile-dest-file-function #'my-byte-compile-dest-file)&#xA;&#xA;(defvar my-bytecomp-dir &quot;/PATH/TO/YOUR/ELC/DIRECTORY/&quot;)&#xA;&#xA;(defun my-byte-compile-dest-file (filename)&#xA;  &quot;Like `byte-compile-dest-file', but put `*.elc' in directory `my-bytecomp-dir'.&quot;&#xA;  (setq filename  (file-name-sans-versions  (byte-compiler-base-file-name filename)))&#xA;  (expand-file-name&#xA;   (file-name-nondirectory&#xA;    (cond ((string-match emacs-lisp-file-regexp filename)&#xA;           (concat (substring filename 0 (match-beginning 0)) &quot;.elc&quot;))&#xA;          (t (concat filename &quot;.elc&quot;))))&#xA;   my-bytecomp-dir))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-01T14:35:30.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13605" PostTypeId="2" ParentId="13548" CreationDate="2015-07-01T15:24:55.757" Score="2" Body="&lt;p&gt;I recommend &lt;a href=&quot;http://batsov.com/projectile/&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt; for this, and much more, project-related functionality.  Projectile has a binding &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;p&lt;/kbd&gt; &lt;kbd&gt;t&lt;/kbd&gt; (&lt;a href=&quot;https://github.com/bbatsov/projectile/blob/master/projectile.el#L1631&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;projectile-toggle-between-implementation-and-test&lt;/code&gt;&lt;/a&gt;) that offers exactly what you're looking for.&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="618" LastEditDate="2015-07-01T18:20:18.287" LastActivityDate="2015-07-01T18:20:18.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13606" PostTypeId="2" ParentId="13571" CreationDate="2015-07-01T17:10:08.420" Score="3" Body="&lt;p&gt;Your code calls &lt;code&gt;battery-status-function&lt;/code&gt; for every mode line update.  This function inherently slow, because it has to invoke external programs to obtain battery information.  Since Emacs is single-threaded, each invocation freezes Emacs until the function returns.  As the mode line is updated frequently, by almost every command, and often multiple times per command, these small delays amount to a very noticeable lag in all operations of Emacs, which renders Emacs almost entirely unusable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had the very same issue when I tried to customize the battery status appearance in my mode line, and wrote &lt;a href=&quot;https://github.com/lunaryorn/fancy-battery.el&quot; rel=&quot;nofollow&quot;&gt;fancy-battery.el&lt;/a&gt; to address it.  This package queries and caches the battery status independently of mode line updates, and thus reduces the frequency of invocations of &lt;code&gt;battery-status-function&lt;/code&gt;, removing the lag entirely.  It's written for the standard mode line, but it should work well with powerline, too.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-07-01T17:10:08.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13607" PostTypeId="1" CreationDate="2015-07-01T17:42:48.267" Score="2" ViewCount="134" Body="&lt;p&gt;I would like to bind &lt;code&gt;Ctrl + F&lt;/code&gt; aka &lt;code&gt;C-f&lt;/code&gt; to find the first occurrence of the word &quot;fun&quot;. Basically, I was this key to do the same thing as pressing &lt;code&gt;C-s&lt;/code&gt; and typing &lt;code&gt;&quot;fun&quot;&amp;lt;Enter&amp;gt;&lt;/code&gt;. Here's what I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-f&quot;) (lambda () (interactive) (isearch-forward &quot;fun&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this simply runs the &lt;code&gt;isearch-forward&lt;/code&gt; command without the &quot;fun&quot; argument.&lt;/p&gt;&#xA;" OwnerUserId="8776" LastEditorUserId="105" LastEditDate="2015-07-01T22:12:16.513" LastActivityDate="2015-07-01T23:07:50.270" Title="Bind a key to the search of a specific word in Emacs" Tags="|key-bindings|search|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13608" PostTypeId="1" CreationDate="2015-07-01T17:43:07.653" Score="1" ViewCount="349" Body="&lt;p&gt;In Python mode (python.el), I am in the habit of hitting C-j to return and indent properly. However, when I am in an inferior python buffer, this command only inserts a newline and does not indent. Is there any way to get the inferior-python-mode to work more like python-mode in this respect, or maybe even set up auto-indent the way it normally works in ipython? I have read through the documentation for inferior-python-mode, but can't find anything useful. I love using Emacs for Python, but there are a few pain points, and I am having trouble finding good documentation. Thanks in advance for any advice!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-06-22T18:17:05.603" Title="Indentaion in inferior-python-mode" Tags="|indentation|python|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13609" PostTypeId="2" ParentId="13607" CreationDate="2015-07-01T18:03:20.883" Score="2" Body="&lt;p&gt;Expanding Dan's comment, the solution is to use &lt;code&gt;search-forward&lt;/code&gt; instead of &lt;code&gt;isearch-forward&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-f&quot;) (lambda () (interactive) (search-forward &quot;fun&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8776" LastEditorUserId="1982" LastEditDate="2015-07-01T23:07:50.270" LastActivityDate="2015-07-01T23:07:50.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13610" PostTypeId="2" ParentId="13592" CreationDate="2015-07-01T18:42:20.213" Score="4" Body="&lt;p&gt;Dan's &lt;a href=&quot;https://emacs.stackexchange.com/questions/13592/how-does-comint-mode-override-beginning-of-line-behavior-i-want-same-functional#comment20428_13592&quot;&gt;comment&lt;/a&gt; helped me on the way. Comint achieves the prompt protecting functionality with text-properties. I can add the needed properties in eshell by evaluating.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-text-properties (point-at-bol)&#xA;                     (point)&#xA;                     '(inhibit-line-move-field-capture t&#xA;                       rear-nonsticky t&#xA;                       field output&#xA;                       front-sticky (field inhibit-line-move-field-capture)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm still unsure how this specific combination of properties result in the functionality. But I was satisfied and added these properties to my custom prompt with &lt;code&gt;propertize&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8339" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-07-02T10:19:06.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13611" PostTypeId="2" ParentId="13600" CreationDate="2015-07-01T20:46:48.807" Score="1" Body="&lt;p&gt;This could almost be it, except for the part, where I don't know how to make the shell buffer wait until the user finishes the interaction&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sphinx-install-prerequisites ()&#xA;  (let ((dir (format &quot;/sudo::%s&quot; (sphinx-install-dir)))&#xA;        (current default-directory))&#xA;    (cd dir)&#xA;    (condition-case error&#xA;        (progn&#xA;          (shell &quot;sphinx-install&quot;)&#xA;          (pop-to-buffer (current-buffer))&#xA;          (goto-char (point-max))&#xA;          (insert &quot;./install.sh&quot;)&#xA;          (comint-send-input))&#xA;      ;; Wait until the script finishes&#xA;      (with-local-quit&#xA;        (while (get-buffer-process &quot;sphinx-install&quot;)&#xA;          (sleep-for 5)&#xA;          (accept-process-output)))&#xA;      (error&#xA;       (message &quot;Installation failed. &#xA;You may still try to read %s and perform the required installations manually.&quot;)))&#xA;    (cd current)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-01T20:46:48.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13612" PostTypeId="1" AcceptedAnswerId="13617" CreationDate="2015-07-01T20:57:11.337" Score="1" ViewCount="164" Body="&lt;p&gt;When I use the up arrow or C-p to invoke &lt;code&gt;previous-line&lt;/code&gt;, some lines - even ones with content - are skipped (seemingly at random, though I am sure it is not). For example, this is the sequence of events when I press C-p (or up arrow) 6 times consecutively, with the cursor beginning in column 1 of the bottom line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TrfXz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/AUowt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 3:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ofYvi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 4:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Q3FWY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 5:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tp5FG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 6:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/juDMY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, in step 4 and step 6, lines are being skipped. I thought it might have something to do with &lt;code&gt;line-move-visual&lt;/code&gt; (which I have set to &lt;code&gt;t&lt;/code&gt;), but changing it to &lt;code&gt;nil&lt;/code&gt; doesn't affect this behavior. Also, the behaviour is not specific to any mode, it seems to have something to do with how text is spaced in the buffer. Also, this doesn't happen with &lt;code&gt;next-line&lt;/code&gt; (C-n/down arrow). Any suggestions? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-07-02T03:31:15.350" Title="Why is previous-line skipping lines?" Tags="|motion|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13614" PostTypeId="1" AcceptedAnswerId="13616" CreationDate="2015-07-02T00:47:28.760" Score="6" ViewCount="248" Body="&lt;p&gt;Not every unicode character occupies 3 lines, but '⊆', '∈', and other unicode mathematical symbols occupy 3 lines in emacs on my system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this rendering bug?&lt;/p&gt;&#xA;" OwnerDisplayName="user8780" LastEditorDisplayName="user8780" LastEditDate="2015-07-02T01:02:46.443" LastActivityDate="2015-07-02T01:54:13.227" Title="some unicode characters such as &quot;⊆&quot; occupy 3 lines in emacs 24.4.1 on ubuntu gnome 15.04 64bit" Tags="|fonts|rendering|ubuntu|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13615" PostTypeId="2" ParentId="13614" CreationDate="2015-07-02T01:41:47.070" Score="2" Body="&lt;p&gt;Try a different font. It works for me in DejaVu Mono but doesn't in some others.&lt;/p&gt;&#xA;" OwnerUserId="146" LastActivityDate="2015-07-02T01:41:47.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13616" PostTypeId="2" ParentId="13614" CreationDate="2015-07-02T01:42:06.337" Score="4" Body="&lt;p&gt;I'm pretty sure that the answer is: &lt;em&gt;try another font&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was quite a lot of discussion about this problem recently in the thread for &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20628&quot; rel=&quot;nofollow&quot;&gt;bug #20628&lt;/a&gt; of the Emacs bug list. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will even see some info about particular fonts there, which might be helpful for your particular question. Oh, and note that there were some changes made to how Emacs picks a font, as an attempt to deal with this problem. These fixes are planned to be merged into the Emacs development trunk soon.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-02T01:54:13.227" LastActivityDate="2015-07-02T01:54:13.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13617" PostTypeId="2" ParentId="13612" CreationDate="2015-07-02T03:31:15.350" Score="1" Body="&lt;p&gt;As @kaushalmodi guessed, I was seeing the effects of a bug in my version of Emacs, and solved the problem by compiling the latest stable version of Emacs from source (since I couldn't find anything later than 24.3 to install with apt). This was easier than I thought it would be, and I did so following the instructions in &lt;a href=&quot;https://askubuntu.com/questions/437255/how-to-install-emacs-24-4-on-ubuntu&quot;&gt;this answer&lt;/a&gt; (I just replaced the 24.4 with 24.5 to get the current stable release, again per @kaushalmodi's suggestion). &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2015-07-02T03:31:15.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13618" PostTypeId="2" ParentId="13539" CreationDate="2015-07-02T04:37:23.147" Score="4" Body="&lt;p&gt;Based on xuchunyang's answer, I was able to add &lt;code&gt;helm-M-x&lt;/code&gt; to helm sources.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar helm-source-emacs-commands&#xA;  (helm-build-sync-source &quot;Emacs commands&quot;&#xA;    :candidates (lambda ()&#xA;                  (let ((cmds))&#xA;                    (mapatoms&#xA;                     (lambda (elt) (when (commandp elt) (push elt cmds))))&#xA;                    cmds))&#xA;    :coerce #'intern-soft&#xA;    :action #'command-execute)&#xA;  &quot;A simple helm source for Emacs commands.&quot;)&#xA;&#xA;(defvar helm-source-emacs-commands-history&#xA;  (helm-build-sync-source &quot;Emacs commands history&quot;&#xA;    :candidates (lambda ()&#xA;                  (let ((cmds))&#xA;                    (dolist (elem extended-command-history)&#xA;                      (push (intern elem) cmds))&#xA;                    cmds))&#xA;    :coerce #'intern-soft&#xA;    :action #'command-execute)&#xA;  &quot;Emacs commands history&quot;)&#xA;&#xA;(setq helm-mini-default-sources '(helm-source-emacs-commands-history&#xA;                                  helm-source-emacs-commands))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-02T04:37:23.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13619" PostTypeId="1" AcceptedAnswerId="13627" CreationDate="2015-07-02T06:50:24.467" Score="1" ViewCount="2064" Body="&lt;p&gt;emacs 22.1 elpa error&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I installed emacs24.5 on osx it broke my .emacs.d/elpa directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is the error I get when emacs loads:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Cannot open load file&quot;, &quot;/Users/xxxx/.emacs.d/elpa/archives/-pkg&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is my emacs version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 22.1.1&#xA;Copyright (C) 2007 Free Software Foundation, Inc.&#xA;GNU Emacs comes with ABSOLUTELY NO WARRANTY.&#xA;You may redistribute copies of Emacs&#xA;under the terms of the GNU General Public License.&#xA;For more information about these matters, see the file named COPYING.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;here is my emacs --debug-int output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;/Users/codymallery/.emacs.d/elpa/archives/-pkg&quot;)&#xA;  load(&quot;/Users/codymallery/.emacs.d/elpa/archives/-pkg&quot; nil t)&#xA;  (if (file-directory-p pkg-dir) (load (concat pkg-dir ... &quot;-pkg&quot;) nil t))&#xA;  (let ((pkg-dir ...)) (if (file-directory-p pkg-dir) (load ... nil t)))&#xA;  package-load-descriptor(&quot;/Users/codymallery/.emacs.d/elpa/&quot; &quot;archives&quot;)&#xA;  (lambda (name) (package-load-descriptor dir name))(&quot;archives&quot;)&#xA;  mapc((lambda (name) (package-load-descriptor dir name)) (&quot;archive-contents&quot; &quot;archive-contents~&quot; &quot;archives&quot; &quot;builtin-package$&#xA;  (if (file-directory-p dir) (mapc (lambda ... ...) (directory-files dir nil &quot;^[^.]&quot;)))&#xA;  (lambda (dir) (if (file-directory-p dir) (mapc ... ...)))(&quot;/Users/codymallery/.emacs.d/elpa/&quot;)&#xA;  mapc((lambda (dir) (if (file-directory-p dir) (mapc ... ...))) (&quot;/Users/codymallery/.emacs.d/elpa/&quot; &quot;/usr/share/emacs/site-$&#xA;  package-load-all-descriptors()&#xA;  package-initialize()&#xA;  (progn (package-initialize))&#xA;  (if (load (expand-file-name &quot;~/.emacs.d/elpa/package.el&quot;)) (progn (package-initialize)))&#xA;  (when (load (expand-file-name &quot;~/.emacs.d/elpa/package.el&quot;)) (package-initialize))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/Users/codymallery/.emacs&quot; nil t)  ; Reading at buffer position 866&#xA;  load-with-code-conversion(&quot;/Users/codymallery/.emacs&quot; &quot;/Users/codymallery/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[nil &quot;^H\205\276^@   \306=\203^Q^@\307^H\310Q\202A^@ \311=\2033^@\312\307\313\314#\203#^@\315\202A^@\312\307\313\316#\203/$&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;here is my .emacs.d/elpa directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;archive-contents    archives        builtin-packages~   package.el      paredit-20&#xA;archive-contents~   builtin-packages    caml-20141015.634   package.el~     tuareg-20150621.1418&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;here is the archives directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls&#xA;gnu     marmalade   melpa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;here is my .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; This was installed by package-install.el.                                                                                 &#xA;;;; This provides support for the package system and                                                                          &#xA;;;; interfacing with ELPA, the package archive.                                                                               &#xA;;;; Move this code earlier if you want to reference                                                                           &#xA;;;; packages in your .emacs.                                                                                                  &#xA;(when&#xA;    (load&#xA;       (expand-file-name &quot;~/.emacs.d/elpa/package.el&quot;))&#xA;  (package-initialize))&#xA;&#xA;&#xA;;;gforth.el&#xA;(defvar HOME (expand-file-name &quot;~&quot;))&#xA;&#xA;&#xA;;; ------&#xA;;; FORTH&#xA;;; ------&#xA;(defvar GFORTH_EL (concat HOME &quot;/.emacs.d/gforth.el&quot;))&#xA;&#xA;(cond ((file-readable-p GFORTH_EL)&#xA;&#xA;  (load-library GFORTH_EL)&#xA;&#xA;  (autoload 'forth-mode GFORTH_EL)&#xA;&#xA;  (setq auto-mode-alist (cons '(&quot;\\.fs\\'&quot; . forth-mode)&#xA;                   auto-mode-alist))&#xA;&#xA;  (autoload 'forth-block-mode GFORTH_EL)&#xA;&#xA;  (setq auto-mode-alist (cons '(&quot;\\.fb\\'&quot; . forth-block-mode)&#xA;                   auto-mode-alist))&#xA;&#xA;  (add-hook 'forth-mode-hook (function (lambda ()&#xA;&#xA;    (setq forth-indent-level 4)&#xA;&#xA;    (setq forth-minor-indent-level 2)&#xA;&#xA;    (setq forth-hilight-level 3))))))&#xA;&#xA;(require 'w3m-load)&#xA;(setq browse-url-browser-function 'w3m-goto-url)&#xA;&#xA;;;rainbow parens support in lisp files&#xA;(load-file &quot;~/.emacs.d/rainbow-delimiters.el&quot;)&#xA;(require 'rainbow-delimiters)&#xA;(add-hook 'lisp-mode-hook 'rainbow-delimiters-mode)&#xA;(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)&#xA;&#xA;&#xA;&#xA;;;paredit support in slime repl&#xA;(add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1)))&#xA;&#xA;;;paredit support for lisp files     &#xA;(autoload 'enable-paredit-mode &quot;paredit&quot; &quot;Turn on pseudo-structural editing of Lisp code.&quot; t)&#xA;(add-hook 'emacs-lisp-mode-hook       #'enable-paredit-mode)&#xA;(add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)&#xA;(add-hook 'ielm-mode-hook             #'enable-paredit-mode)&#xA;(add-hook 'lisp-mode-hook             #'enable-paredit-mode)&#xA;(add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)&#xA;(add-hook 'scheme-mode-hook           #'enable-paredit-mode)&#xA;&#xA;&#xA;;;slime support&#xA;(setq inferior-lisp-program &quot;/usr/local/bin/sbcl&quot; --noinform)&#xA;(setq slime-backend &quot;/usr/local/bin/lisp/slime/swank-loader.lisp&quot;)&#xA;(add-to-list 'load-path &quot;/usr/local/bin/lisp/slime/&quot;)&#xA;(require 'slime)&#xA;(load-file &quot;/usr/local/bin/lisp/slime/slime.el&quot;)&#xA;(slime-setup)&#xA;(slime-setup '(slime-fancy))&#xA;&#xA;;; auto complete&#xA;(add-to-list 'load-path &quot;/usr/local/bin/lisp/complete/&quot;)&#xA;(require 'auto-complete-config)&#xA;(add-to-list 'ac-dictionary-directories &quot;~/emacs.d//ac-dict&quot;)&#xA;(ac-config-default)&#xA;(global-auto-complete-mode t)&#xA;(auto-complete-mode t)&#xA;&#xA;;; add Lisp auto-complete-support&#xA;(add-to-list 'load-path &quot;/usr/local/bin/lisp/complete/ac-slime/&quot;)&#xA;(require 'ac-slime)&#xA;(add-hook 'slime-mode-hook 'set-up-slime-ac)&#xA;(add-hook 'slime-repl-mode-hook 'set-up-slime-ac)&#xA;(eval-after-load &quot;auto-complete&quot;&#xA;    '(add-to-list 'ac-modes 'slime-repl-mode))&#xA;&#xA;;;AC everywhere fix&#xA;(define-globalized-minor-mode real-global-auto-complete-mode&#xA;    auto-complete-mode (lambda ()&#xA;                (if (not (minibufferp (current-buffer)))&#xA;                    (auto-complete-mode 1))))&#xA;    (real-global-auto-complete-mode t)&#xA;&#xA;&#xA;&#xA;&#xA;;;Cperl-mode&#xA;;; Use cperl-mode instead of the default perl-mode&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.\\([pP][Llm]\\|al\\)\\'&quot; . cperl-mode))&#xA;(add-to-list 'interpreter-mode-alist '(&quot;perl&quot; . cperl-mode))&#xA;(add-to-list 'interpreter-mode-alist '(&quot;perl5&quot; . cperl-mode))&#xA;(add-to-list 'interpreter-mode-alist '(&quot;miniperl&quot; . cperl-mode))&#xA;&#xA;(add-hook 'cperl-mode-hook 'n-cperl-mode-hook t)&#xA;(defun n-cperl-mode-hook ()&#xA;  (setq cperl-indent-level 4)&#xA;  (setq cperl-continued-statement-offset 0)&#xA;  (setq cperl-extra-newline-before-brace t)&#xA;  (set-face-background 'cperl-array-face &quot;wheat&quot;)&#xA;  (set-face-background 'cperl-hash-face &quot;wheat&quot;)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see I am loading the file but it thinks it's not there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's just so weird because I never edited the file it just stopped working once emacs 24 was ran once.&lt;/p&gt;&#xA;" OwnerUserId="8781" LastActivityDate="2015-07-02T13:26:46.427" Title="&quot;Cannot open load file&quot;, &quot;/Users/home/.emacs.d/elpa/archives/-pkg&quot; emacs 22.1" Tags="|init-file|package|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13620" PostTypeId="1" CreationDate="2015-07-02T09:28:46.627" Score="3" ViewCount="388" Body="&lt;p&gt;I upgraded to recently released Magit 2. There is a command &lt;code&gt;magit-log-buffer-file&lt;/code&gt;. However, it logs file without &lt;code&gt;--follow&lt;/code&gt; option, which makes it quite pointless for me (in our source code nearly everything has been moved around recently because of switch to Maven source layout). And I see no way of customizing options for logging anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to log individual files following renames?&lt;/p&gt;&#xA;" OwnerDisplayName="user8782" LastActivityDate="2015-07-02T14:06:20.860" Title="How to log file following all renames?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13623" PostTypeId="1" AcceptedAnswerId="13624" CreationDate="2015-07-02T12:21:25.000" Score="7" ViewCount="363" Body="&lt;p&gt;Assuming familiarity with regex, is there ever any reason to use the normal incremental search (C-s) over regex (C-M-s)?&lt;/p&gt;&#xA;" OwnerUserId="8716" LastEditorUserId="253" LastEditDate="2015-07-02T13:03:31.287" LastActivityDate="2015-07-02T15:55:57.623" Title="When to use normal incremental search in place of the regex version?" Tags="|regular-expressions|search|isearch|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13624" PostTypeId="2" ParentId="13623" CreationDate="2015-07-02T12:32:48.773" Score="7" Body="&lt;p&gt;Yes: if you want to search for a literal string, but that string contains special regex characters, it'll require extra escaping on your part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example text to search: &quot;some*text&quot;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s some*text&lt;/code&gt; matches&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-s some*text&lt;/code&gt; does not match&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-s some\*text&lt;/code&gt; matches&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-02T12:32:48.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13625" PostTypeId="1" AcceptedAnswerId="13631" CreationDate="2015-07-02T12:38:27.710" Score="6" ViewCount="456" Body="&lt;p&gt;In the previous version of Magit, I learned&#xA;&lt;a href=&quot;http://oremacs.com/2015/03/11/git-tricks/&quot;&gt;from oremacs&lt;/a&gt; that you can&#xA;view and checkout Github pull-requests in Magit by adding the&#xA;following line to a remote's definition in &lt;code&gt;.git/config&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fetch = +refs/pull/*/head:refs/pull/origin/*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this, I could type &lt;code&gt;b b&lt;/code&gt; and the PRs would be available with TAB-completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to no longer be the case in version 2.1.0. Is there a similar alternative?&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-07-11T13:27:33.553" Title="Viewing Github PRs in Magit 2.1.0" Tags="|magit|git|github|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13626" PostTypeId="2" ParentId="13620" CreationDate="2015-07-02T13:01:39.503" Score="2" Body="&lt;p&gt;Yeah, that should be improved. &lt;code&gt;magit-log-buffer-file&lt;/code&gt; should either always use &lt;code&gt;--follow&lt;/code&gt; or at least with a prefix argument. Please open a feature request so that I don't forget investigating the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; Unfortunately this does not actually work (see comments):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile you can take advantage of the fact that &lt;code&gt;M-x magit-log-buffer-file&lt;/code&gt; respects the arguments set in the log popup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First you have to make &lt;code&gt;--follow&lt;/code&gt; available from that popup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-switch 'magit-log-popup ?f &quot;Follow renames&quot; &quot;--follow&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then show the popup &lt;kbd&gt;l&lt;/kbd&gt;, set the switch &lt;kbd&gt;- f&lt;/kbd&gt;, and save as default &lt;kbd&gt;C-x C-s&lt;/kbd&gt;. Of course that means that this argument will now be used when using suffix commands from the log popup too.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-02T14:06:20.860" LastActivityDate="2015-07-02T14:06:20.860" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13627" PostTypeId="2" ParentId="13619" CreationDate="2015-07-02T13:26:46.427" Score="1" Body="&lt;p&gt;It looks like this issue will be fixed if you delete the &lt;code&gt;archives&lt;/code&gt; directory inside &lt;code&gt;~/.emacs.d/elpa/&lt;/code&gt;. You may also have problems with the &lt;code&gt;archive-contents&lt;/code&gt; and &lt;code&gt;builtin-packages&lt;/code&gt; directories. Just to be sure, don't actually delete them, just move them somewhere else. (I woul also get rid of all those &lt;code&gt;~&lt;/code&gt; backups).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I'll strongly recommend you upgrade to Emacs 24 (preferably&#xA;24.5). Emacs 22 was a very long time ago, and you're probably also&#xA;running a very old &lt;code&gt;package.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-07-02T13:26:46.427" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13628" PostTypeId="1" CreationDate="2015-07-02T13:34:11.353" Score="3" ViewCount="798" Body="&lt;p&gt;Quite a while ago, I've created a word document where I defined variables, did&#xA;calculations with them, and had the results printed inline into the&#xA;document. Example output, where the result has been calculated from&#xA;variables &lt;code&gt;a = 1&lt;/code&gt; and &lt;code&gt;b = 2&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;“The result of 1 plus 2 is 3”&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For org-mode, I found that I can defined properties, and do basic&#xA;calculations with them. &lt;em&gt;But how do I output their values into running&#xA;text, i.e. without using a table.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturally, I want the calculated value to be visible in the text buffer&#xA;right in EMACS. If it’s only possible to see the value in an exported&#xA;PDF, for example, then that’s not interesting.&lt;/p&gt;&#xA;" OwnerUserId="5327" LastEditorUserId="105" LastEditDate="2015-07-02T15:47:51.540" LastActivityDate="2015-07-02T15:47:51.540" Title="Inline the value of an Org-mode property?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13629" PostTypeId="1" CreationDate="2015-07-02T13:48:35.650" Score="2" ViewCount="575" Body="&lt;p&gt;Python scientific libs are immensily popular for the last decade or so. However googling and &quot;melping&quot; for its emacs minor-modes reveals nothing. Basically I need just syntax highlighting. Do you happen to know any efforts in this direction?&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-07-02T15:10:18.433" LastActivityDate="2024-02-16T06:02:25.587" Title="No numpy, scipy, sympy and matplotlib minor-modes?" Tags="|python|syntax-highlighting|minor-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13630" PostTypeId="2" ParentId="13628" CreationDate="2015-07-02T13:56:43.633" Score="7" Body="&lt;p&gt;You have to pick a language, and then &lt;code&gt;src_&amp;lt;lang&amp;gt;{code}&lt;/code&gt;. For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_octave{2+3}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you evaluate that (with &lt;code&gt;C-c C-c&lt;/code&gt;), you should see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_octave{2+3} {{{results(=5=)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;5&lt;/code&gt; will be exported to PDF. If you want to use variables defined elsewhere, you can use the &lt;code&gt;session&lt;/code&gt; option.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC octave :results output :session foo&#xA;a = 1;&#xA;b = 2;&#xA;#+END_SRC&#xA;#+RESULTS:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then elsewhere:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_octave[:session foo]{a+b} {{{results(=3=)}}}  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://orgmode.org/manual/Evaluating-code-blocks.html&quot;&gt;http://orgmode.org/manual/Evaluating-code-blocks.html&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-07-02T13:56:43.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13631" PostTypeId="2" ParentId="13625" CreationDate="2015-07-02T14:15:40.740" Score="1" Body="&lt;p&gt;&lt;code&gt;magit-read-other-branch-or-commit&lt;/code&gt; now also offers certain other non-branch refs for completion. Should something be missing, then you can still input the ref or abbreviated ref, without the help of completion. Provided the input is unambiguous, that works with the commands that use this function to read a branch or arbitrary commit.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-11T12:53:22.873" LastActivityDate="2015-07-11T12:53:22.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13632" PostTypeId="2" ParentId="13625" CreationDate="2015-07-02T14:18:31.213" Score="1" Body="&lt;p&gt;An alternative solution is to use &lt;a href=&quot;https://github.com/sigma/magit-gh-pulls&quot; rel=&quot;nofollow&quot;&gt;magit-gh-pulls&lt;/a&gt;. I use it with Magit 2.1 to manage Spacemacs.&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-07-02T14:18:31.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13633" PostTypeId="1" AcceptedAnswerId="13635" CreationDate="2015-07-02T14:23:50.440" Score="1" ViewCount="348" Body="&lt;p&gt;I'm trying to use the following function (extracted from the amazing &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow&quot;&gt;emacs-prelude&lt;/a&gt; configuration)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun prelude-duplicate-current-line-or-region (arg)&#xA;  &quot;Duplicates the current line or region ARG times.&#xA;If there's no region, the current line will be duplicated.  However, if&#xA;there's a region, all lines that region covers will be duplicated.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (pcase-let* ((origin (point))&#xA;               (`(,beg . ,end) (prelude-get-positions-of-line-or-region))&#xA;               (region (buffer-substring-no-properties beg end)))&#xA;    (-dotimes arg&#xA;      (lambda (n)&#xA;        (goto-char end)&#xA;        (newline)&#xA;        (insert region)&#xA;        (setq end (point))))&#xA;    (goto-char (+ origin (* (length region) arg) arg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;symbol's function definition is void: -dotimes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas why do I get this error? Do I have a library missing or something?&lt;/p&gt;&#xA;" OwnerUserId="6546" LastEditorUserId="15748" LastEditDate="2021-07-04T13:21:16.553" LastActivityDate="2021-07-04T13:23:40.193" Title="&quot;symbol's function definition is void: -dotimes&quot; Error" Tags="|debugging|dash.el|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13634" PostTypeId="1" AcceptedAnswerId="13640" CreationDate="2015-07-02T14:24:01.940" Score="2" ViewCount="315" Body="&lt;p&gt;I have my whitespace newline mark set to the &quot;↴&quot; character, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq whitespace-display-mappings '(&#xA;                                    (newline-mark 10 [8628 10])&#xA;                                    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, the spacing is fine when I use DejaVu monospace font, but with all the other fonts I've tried, I get this kind of behavior:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/1ueJC.png&quot; alt=&quot;weird spacing&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it's just because I'm using a weird whitespace character but I like it and I'd like to keep it. Is it just because of the font limitation, or are there other ways around this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! :)&lt;/p&gt;&#xA;" OwnerUserId="5510" LastActivityDate="2015-07-02T15:40:09.533" Title="Weird spacing with whitespace newline mark &quot;↴&quot;" Tags="|fonts|whitespace|newlines|" AnswerCount="1" CommentCount="1" ClosedDate="2015-07-03T04:29:54.107" ContentLicense="CC BY-SA 3.0" />
  <row Id="13635" PostTypeId="2" ParentId="13633" CreationDate="2015-07-02T14:28:45.587" Score="4" Body="&lt;p&gt;The &lt;code&gt;-dotimes&lt;/code&gt; function, and many other functions starting with a dash, can be found in the &lt;code&gt;dash&lt;/code&gt; library.  It's available on &lt;a href=&quot;https://elpa.gnu.org/packages/dash.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU ELPA&lt;/a&gt; and &lt;a href=&quot;https://stable.melpa.org/#/dash&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;(Not to be confused with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Iteration.html#index-dotimes&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;dotimes&lt;/code&gt;&lt;/a&gt;, without a dash, which is built in to Emacs.)&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="15748" LastEditDate="2021-07-04T13:23:40.193" LastActivityDate="2021-07-04T13:23:40.193" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="13636" PostTypeId="1" CreationDate="2015-07-02T14:30:47.220" Score="2" ViewCount="401" Body="&lt;p&gt;In Evil-Mode, when there is an buffer with alphabet keys bound, such as a help buffer (binding q) or a magit-popup buffer (strangely not a magit status buffer), I need to enter into insert mode in order to reach these bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make these buffers work without having to enter into insert mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have currently unbound and sacrificed &lt;kbd&gt;q&lt;/kbd&gt; which saves me a lot of trouble, but I am looking for a more general solution.&lt;/p&gt;&#xA;" OwnerUserId="8716" LastActivityDate="2018-12-16T21:37:54.143" Title="Evil-Mode: Problem &quot;interactive&quot; buffers with letters defined, like q to close popups" Tags="|evil|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13637" PostTypeId="2" ParentId="13636" CreationDate="2015-07-02T15:10:42.883" Score="3" Body="&lt;p&gt;You can temporarily permit Emacs keybindings with &lt;code&gt;C-z&lt;/code&gt; (to permanently switch to the Emacs state keymap) or with &lt;code&gt;\&lt;/code&gt; (to enter one command that is looked up in the Emacs state keymap).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's recommended though to customize the initial state of the buffer you're having issues with.  You can do this as described in the manual with something along the lines of &lt;code&gt;(evil-set-initial-state 'my-mode 'emacs)&lt;/code&gt; in your Emacs config.  The currently active state is represented by a &lt;code&gt;&amp;lt;X&amp;gt;&lt;/code&gt; style indicator in the modeline.  As suggested above Emacs state behaves nearly completely like Emacs would.  Motion state is a compromise between it and normal state, it binds all movement commands as known from Vim and permits Emacs keybindings to fall through for keys like &lt;code&gt;q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2018-12-16T21:37:54.143" LastActivityDate="2018-12-16T21:37:54.143" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="13638" PostTypeId="1" AcceptedAnswerId="13639" CreationDate="2015-07-02T15:11:14.233" Score="5" ViewCount="1150" Body="&lt;p&gt;In 1.x Magit used to provide &lt;code&gt;magit-file-log&lt;/code&gt; to list the Git log for the current file.  Unfortunately, this command seems to be gone from Magit 2.1?  How do I list the Git log for the current file now in Magit 2.1?&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-07-02T15:16:44.613" Title="Show git log for the current file in Magit 2.1" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13639" PostTypeId="2" ParentId="13638" CreationDate="2015-07-02T15:16:44.613" Score="8" Body="&lt;p&gt;It is now &lt;code&gt;magit-log-buffer-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-07-02T15:16:44.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13640" PostTypeId="2" ParentId="13634" CreationDate="2015-07-02T15:26:39.310" Score="1" Body="&lt;p&gt;When newline character(s) is/are anything other than &lt;code&gt;\n&lt;/code&gt;, the function &lt;code&gt;whitespace-display-char-on&lt;/code&gt; creates a glyph code for the newline character(s) using the face named &lt;code&gt;whitespace-newline&lt;/code&gt;, and that glyph code is then set as part of the &lt;code&gt;buffer-display-table&lt;/code&gt; in lieu of &lt;code&gt;\n&lt;/code&gt; or in addition to &lt;code&gt;\n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A workaround to the problem described by the original poster is to set the &lt;code&gt;:height&lt;/code&gt; of the face &lt;code&gt;whitespace-newline&lt;/code&gt; so that the chosen unicode character(s) is/are shrunken to a size that is less than or equal to the &lt;code&gt;'default&lt;/code&gt; face &lt;code&gt;:height&lt;/code&gt;.  This is a workaround, so the original poster will need to experiment to find the right number for the &lt;code&gt;:height&lt;/code&gt; that suits his/her needs.  The disadvantage with this workaround is that the chosen unicode character(s) may be too small and not visually appealing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other solution, of course, is to select a unicode character that is not larger than life.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-07-02T15:40:09.533" LastActivityDate="2015-07-02T15:40:09.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13641" PostTypeId="2" ParentId="13623" CreationDate="2015-07-02T15:55:57.623" Score="4" Body="&lt;p&gt;@Dan provided a good answer to the question.  I will add this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Adobe indicated in a comment, you can use &lt;strong&gt;&lt;code&gt;M-r&lt;/code&gt;&lt;/strong&gt; anytime during Isearch (literal search or regexp search) to &lt;em&gt;toggle between regexp search and literal search&lt;/em&gt;.  Easy-peasy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that it can make sense to start with whichever search mode you expect to use first, or most, and just toggle to the other as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's more, literal Isearch is not so &quot;heavy maintenance&quot; as regexp Isearch: what you type is directly and immediately what you get.  So generally, yes, I would say that it makes sense much of the time to start with &lt;code&gt;C-s&lt;/code&gt;, &lt;em&gt;not&lt;/em&gt; &lt;code&gt;C-M-s&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-02T15:55:57.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13642" PostTypeId="2" ParentId="13574" CreationDate="2015-07-02T18:01:19.177" Score="9" Body="&lt;p&gt;With the notable exception of ProofGeneral, I'm not aware of any major Emacs package that's not available in some ELPA archive.  Specifically, ESS is on MELPA &lt;a href=&quot;https://github.com/milkypostman/melpa/commits/master/recipes/ess&quot;&gt;since three years&lt;/a&gt;.  And PG is a story on its own, and definitely not representative for the whole Emacs ecosystem.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ELPA surely has its flaws, but for the vast majority of packages it works just fine, even for larges ones such as Magit.  Helm is the only package that I see complaining about ELPA. I'm not sure what exactly they complain about, but I guess it's about compilation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During upgrades Emacs compiles the new version of the package in an environment where the old version is still loaded.  Normally, this does no harm at all, but it can break macros in certain situations.  Emacs will compile the new version against the &lt;em&gt;old&lt;/em&gt; implementation of the macro, which can cause breakage if the new code relies on a specific change in that macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being a package maintainer myself, I pretty much disagree with this statement, though.  I tend to blame Helm rather than ELPA or Emacs.  In my opinion the statement is hyperbole, and the issue but a symptom of over- and ab-using macros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a lot of macros and—even worse—put non-trivial code into the body of macros you simply have to be aware of the implications this has for byte compilation and you have to be careful to maintain backwards compatibility with your own macros within your package.  Not doing so, and instead passing blame around, is not a very nice thing to do.  My 2 cents.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-07-02T18:01:19.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13643" PostTypeId="2" ParentId="5758" CreationDate="2015-07-02T18:11:11.603" Score="0" Body="&lt;p&gt;Throwing a &lt;code&gt;(require 'evil)&lt;/code&gt; in a function called by the hook &lt;code&gt;after-init-hook&lt;/code&gt; fixes it for me: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun after-all-loads () (require 'evil))&#xA;&#xA;(add-hook 'after-init-hook 'after-all-loads)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8788" LastActivityDate="2015-07-02T18:11:11.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13644" PostTypeId="1" AcceptedAnswerId="13645" CreationDate="2015-07-02T18:46:20.737" Score="3" ViewCount="597" Body="&lt;p&gt;I love vim keybindings. For older versions of Magit, I used this to allow &lt;kbd&gt;j&lt;/kbd&gt;/&lt;kbd&gt;k&lt;/kbd&gt; scrolling:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key magit-status-mode-map (kbd &quot;k&quot;) #'previous-line)&#xA;(define-key magit-status-mode-map (kbd &quot;K&quot;) #'magit-discard-item)&#xA;(define-key magit-status-mode-map (kbd &quot;j&quot;) #'next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now, of course, the keymaps have changed. I have a sort of hacked up solution that loops through all the keymaps, but it's quite complicated and brittle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any easy way to customize keybindings in &lt;code&gt;magit&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="306" LastEditDate="2015-07-02T19:59:54.287" LastActivityDate="2015-07-02T19:59:54.287" Title="Vim/Evil keybindings in Magit 2.1" Tags="|key-bindings|magit|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13645" PostTypeId="2" ParentId="13644" CreationDate="2015-07-02T19:57:05.883" Score="3" Body="&lt;p&gt;I have the same issue (and I am the maintainer :-), and I'm afraid there's no completely trivial fix. (I don't use vim bindings, but I use &lt;kbd&gt;C-{jikl}&lt;/kbd&gt; for character/line navigation, and in Magit &lt;kbd&gt;i&lt;/kbd&gt; and &lt;kbd&gt;k&lt;/kbd&gt; to go up/down a section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce your old customizations you could do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key magit-mode-map (kbd &quot;k&quot;) #'previous-line)&#xA;(define-key magit-mode-map (kbd &quot;K&quot;) #'magit-discard)&#xA;(define-key magit-mode-map (kbd &quot;j&quot;) #'next-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then search for &lt;code&gt;&quot;k&quot;&lt;/code&gt; (&lt;kbd&gt;M-x rgrep RET &quot;K&quot; RET *.el RET&lt;/kbd&gt;). Finally add for each found match:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key KEYMAP (kbd &quot;k&quot;) #'previous-line)&#xA;(define-key KEYMAP (kbd &quot;K&quot;) COMMAND)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-07-02T19:57:05.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13646" PostTypeId="1" AcceptedAnswerId="13647" CreationDate="2015-07-02T20:03:50.107" Score="9" ViewCount="2495" Body="&lt;p&gt;The &lt;code&gt;compilation-auto-jump-to-first-error&lt;/code&gt; option should make Emacs jump to the first error during compilation. However, it seems that Emacs treats warnings and errors in the same way, and jumps to the first one of either.  How would you make Emacs jump to the first error if any, or to the first warning otherwise?  I would rather fix errors first, and then warnings (especially because warnings could be caused by third-party libraries).&lt;/p&gt;&#xA;" OwnerUserId="2763" LastActivityDate="2015-07-02T21:28:03.583" Title="Jumping to the first error -- not warning -- when compiling" Tags="|compilation|compilation-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13647" PostTypeId="2" ParentId="13646" CreationDate="2015-07-02T21:28:03.583" Score="9" Body="&lt;p&gt;As described &lt;a href=&quot;http://endlessparentheses.com/better-compile-command.html&quot; rel=&quot;noreferrer&quot;&gt;on this blog post&lt;/a&gt;, you need a second option for that. &lt;a href=&quot;http://doc.endlessparentheses.com/Var/compilation-skip-threshold&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;compilation-skip-threshold&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq compilation-skip-threshold 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Compilation motion commands skip less important messages.&#xA;  The value can be either&lt;br&gt;&#xA;  2 -- skip anything less than error,&lt;br&gt;&#xA;  1 -- skip anything less than warning or&lt;br&gt;&#xA;  0 -- don't skip any messages.&lt;br&gt;&#xA;  Note that all messages not positively identified as warning or&#xA;  info, are considered errors.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-07-02T21:28:03.583" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13648" PostTypeId="1" AcceptedAnswerId="13649" CreationDate="2015-07-03T00:32:30.880" Score="1" ViewCount="94" Body="&lt;p&gt;I want to convert all the deques in my python code to lists. I.e. &lt;code&gt;deque([1])&lt;/code&gt; should become &lt;code&gt;[1]&lt;/code&gt;. I tried &lt;code&gt;M-% deque(\(.+\)) RET \1 RET&lt;/code&gt;, but it said &lt;code&gt;Replaced 0 occurences&lt;/code&gt;. What's wrong with my regexp?&lt;/p&gt;&#xA;" OwnerUserId="5376" LastEditorUserId="105" LastEditDate="2015-07-03T01:06:51.017" LastActivityDate="2015-07-03T01:06:51.017" Title="Regexp doesn't work" Tags="|regular-expressions|query-replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13649" PostTypeId="2" ParentId="13648" CreationDate="2015-07-03T01:06:28.440" Score="3" Body="&lt;p&gt;Try &lt;code&gt;C-M-%&lt;/code&gt; instead of &lt;code&gt;M-%&lt;/code&gt;.  You want &lt;code&gt;query-replace-regexp&lt;/code&gt;, not &lt;code&gt;query-replace&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-03T01:06:28.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13650" PostTypeId="1" AcceptedAnswerId="13651" CreationDate="2015-07-03T01:31:03.433" Score="2" ViewCount="345" Body="&lt;p&gt;I have followed &lt;a href=&quot;http://txt.arboreus.com/2013/02/21/jedi.el-jump-to-definition-and-back.html&quot; rel=&quot;nofollow&quot;&gt;these instruction&lt;/a&gt; to create a stack of visited position across buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar jedi:goto-stack '())&#xA;(defun jedi:jump-to-definition ()&#xA;  (interactive)&#xA;  (add-to-list 'jedi:goto-stack&#xA;               (list (buffer-name) (point)))&#xA;  (jedi:goto-definition))&#xA;(defun jedi:jump-back ()&#xA;  (interactive)&#xA;  (let ((p (pop jedi:goto-stack)))&#xA;    (if p (progn&#xA;            (switch-to-buffer (nth 0 p))&#xA;            (goto-char (nth 1 p))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This worked well in most case, except when you visited files with the same name under different directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example, you have two files &lt;code&gt;~/a/test.py&lt;/code&gt; and &lt;code&gt;~/b/test.py&lt;/code&gt;. When you first visit &lt;code&gt;~/a/test.py&lt;/code&gt;, the emacs buffer name will be &lt;code&gt;test.py&lt;/code&gt;. Now, I used &lt;code&gt;jedi:jump-to-definition&lt;/code&gt; function above to go to &lt;code&gt;~/b/test.py&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it intended to do, before switching to &lt;code&gt;~/b/test.py&lt;/code&gt;, it push current buffer name and position to stack &lt;code&gt;jedi:goto-stack&lt;/code&gt; as &lt;code&gt;(test.py (point))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But emacs saw two files have the same name, they &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html&quot; rel=&quot;nofollow&quot;&gt;uniquify&lt;/a&gt; them, make their buffer name to &lt;code&gt;test.py&amp;lt;a&amp;gt;&lt;/code&gt; and &lt;code&gt;test.py&amp;lt;b&amp;gt;&lt;/code&gt;. Now, I can't use &lt;code&gt;jedi:jump-back&lt;/code&gt; to go to previous buffer &lt;code&gt;~/a/test.py&lt;/code&gt;, because the stack only contains &lt;code&gt;(test.py (point))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I check when did emacs uniquify the buffer name, and push the new uniquify name to my stack instead of the old one?&lt;/p&gt;&#xA;" OwnerUserId="8701" LastActivityDate="2015-07-03T01:55:00.223" Title="How to hook to emacs uniquify?" Tags="|buffers|uniquify|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13651" PostTypeId="2" ParentId="13650" CreationDate="2015-07-03T01:55:00.223" Score="3" Body="&lt;p&gt;Rather than check when the name changes, you want to not use names at all.  Instead, use the actual buffer objects.  I.e. instead of &lt;code&gt;(buffer-name)&lt;/code&gt; use &lt;code&gt;(current-buffer)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While you're at it, you'll sometimes notice that you won't get back to the proper place in the buffer, because the buffer has been modified in the mean time and the saved &lt;code&gt;(point)&lt;/code&gt; value now corresponds to &quot;another place&quot;.  So, instead of saving &lt;code&gt;(point)&lt;/code&gt;, you should save a marker, e.g. &lt;code&gt;(point-marker)&lt;/code&gt;.  And once you do that, you'll notice you don't need to save &lt;code&gt;(current-buffer)&lt;/code&gt; separately since the marker object actually remembers the buffer as well, so you can replace &lt;code&gt;(list (buffer-name) (point))&lt;/code&gt; with &lt;code&gt;(point-marker)&lt;/code&gt;, and then replace &lt;code&gt;(nth 0 p)&lt;/code&gt; with &lt;code&gt;(marker-buffer p)&lt;/code&gt; and &lt;code&gt;(nth 1 p)&lt;/code&gt; with just &lt;code&gt;p&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-07-03T01:55:00.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13652" PostTypeId="1" AcceptedAnswerId="13653" CreationDate="2015-07-03T01:56:03.037" Score="6" ViewCount="5296" Body="&lt;p&gt;I want to customize &lt;code&gt;mode-line-format&lt;/code&gt; using &lt;code&gt;if&lt;/code&gt; or &lt;code&gt;cond&lt;/code&gt; etc., to let it show different text conditionally. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a demo that I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA; (quote&#xA;  (&#xA;   (:eval&#xA;    (cond&#xA;     (buffer-read-only&#xA;      (propertize &quot; ⚑ &quot;&#xA;                  'face (:foreground &quot;red&quot; :weight 'bold)&#xA;                  'help-echo &quot;buffer is read-only!!!&quot;))&#xA;     ;; (overwrite-mode&#xA;     ;;  (propertize &quot;??&quot;))&#xA;     (buffer-modified-p&#xA;      (propertize &quot; ☡ &quot;&#xA;                  'face (:foreground &quot;orange&quot;)&#xA;                  'help-echo &quot;buffer modified.&quot;))&#xA;     ))&#xA;&#xA;   (:eval (if (or (eq (buffer-local-value 'major-mode (current-buffer)) 'ruby-mode)&#xA;                 (eq (buffer-local-value 'major-mode (current-buffer)) 'enh-ruby-mode))&#xA;              (:propertize &quot;Ruby&quot;&#xA;                           face (:foreground &quot;green&quot;))&#xA;            (:propertize &quot;Not Ruby&quot;&#xA;                         face (:foreground &quot;orange&quot;))))&#xA;   )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it does not show anything, I don't know where is wrong. Need help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I googled this, And got two good results:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://amitp.blogspot.com/2011/08/emacs-custom-mode-line.html&quot; rel=&quot;nofollow&quot;&gt;http://amitp.blogspot.com/2011/08/emacs-custom-mode-line.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacs-fu.blogspot.com/2011/08/customizing-mode-line.html&quot; rel=&quot;nofollow&quot;&gt;http://emacs-fu.blogspot.com/2011/08/customizing-mode-line.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And I saw two different code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA; '(&#xA;   (:propertize var&#xA;                'face (:foreground &quot;green&quot;))&#xA;   ))&#xA;&#xA;(setq-default&#xA; mode-line-format&#xA; (list&#xA;   '(:eval (if ...))&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know what's the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;---------------- UPDATE ---------------------&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found I can't put multiple &lt;code&gt;(propertize ...)&lt;/code&gt; in one &lt;code&gt;(progn ...)&lt;/code&gt;.&#xA;Is there any solution to solve this?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA;'(&#xA;  (:eval&#xA;    (if (memq (buffer-local-value 'major-mode (current-buffer))&#xA;              '(ruby-mode enh-ruby-mode))&#xA;        (progn&#xA;          (propertize &quot; (&quot;&#xA;                      'face '(:foreground &quot;#444444&quot;))&#xA;          (propertize &quot;Ruby: &quot;&#xA;                      'face '(:family &quot;Segoe Print&quot;&#xA;                                      :height 80&#xA;                                      :foreground &quot;red2&quot;))&#xA;          (propertize (rbenv--active-ruby-version) ; `rbenv--modestring'&#xA;                      'face '(:foreground &quot;cyan&quot;)&#xA;                      'help-echo '(concat &quot;\nCurrent Ruby version: &quot; (rbenv--active-ruby-version)&#xA;                                          &quot;\nmouse-1: switch Ruby version menu&quot;)&#xA;                      ;; 'local-map&#xA;                      )&#xA;          (propertize &quot;)&quot;&#xA;                      'face '(:foreground &quot;#444444&quot;))&#xA;          )&#xA;      ;; (propertize &quot;Not Ruby&quot;&#xA;      ;;             'face '(:foreground &quot;red2&quot;))&#xA;      ))&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is solved, use &lt;code&gt;(list (propertize ...) (propertize ...)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2015-07-03T04:43:25.010" LastActivityDate="2015-07-03T04:43:25.010" Title="How to customize mode-line-format?" Tags="|mode-line|mode-line-format|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13653" PostTypeId="2" ParentId="13652" CreationDate="2015-07-03T02:43:00.950" Score="7" Body="&lt;p&gt;If you want something that changes according to conditions then you pretty much need to use &lt;code&gt;:eval&lt;/code&gt;, as in the second borrowed-code snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several things wrong with your code.  &lt;code&gt;buffer-modified-p&lt;/code&gt; is a function, not a variable; you forgot to quote some things; etc.  Try this, and then compare it carefully with your code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default mode-line-format&#xA;              '((:eval&#xA;                 (cond&#xA;                   (buffer-read-only&#xA;                    (propertize &quot; ⚑ &quot;&#xA;                                'face '(:foreground &quot;red&quot; :weight 'bold)&#xA;                                'help-echo &quot;buffer is read-only!!!&quot;))&#xA;                   ((buffer-modified-p)&#xA;                    (propertize &quot; ☡ &quot;&#xA;                                'face '(:foreground &quot;orange&quot;)&#xA;                                'help-echo &quot;buffer modified.&quot;))))&#xA;                (:eval (if (memq (buffer-local-value 'major-mode (current-buffer))&#xA;                                 '(ruby-mode enh-ruby-mode))&#xA;                           (propertize &quot;Ruby&quot; 'face '(:foreground &quot;green&quot;))&#xA;                         (propertize &quot;Not Ruby&quot; 'face '(:foreground &quot;orange&quot;)))))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-03T02:43:00.950" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13654" PostTypeId="1" AcceptedAnswerId="13692" CreationDate="2015-07-03T04:23:05.850" Score="2" ViewCount="337" Body="&lt;p&gt;I'm seeing rather bizarre behavior. I have the following code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun set-mode-line-face ()&#xA;  (let ((color&#xA;          (pcase (random 6)&#xA;            (`1  '(&quot;#586e75&quot; . &quot;#eee8d5&quot;))&#xA;            (`2   '(&quot;#859900&quot; . &quot;#eee8d5&quot;))&#xA;            (`3  '(&quot;#93a1a1&quot; . &quot;#073642&quot;))&#xA;            (`4  '(&quot;#268bd2&quot; . &quot;#eee8d5&quot;))&#xA;            (`5 '(&quot;#dc322f&quot; . &quot;#eee8d5&quot;))&#xA;            (other    '(&quot;grey70&quot; . &quot;black&quot;)))))&#xA;&#xA;    (set-face-attribute 'mode-line nil&#xA;      :background (car color)&#xA;      :foreground (cdr color))&#xA;&#xA;    (set-face-foreground 'mode-line-buffer-id (cdr color))))&#xA;&#xA;;; Change modeline color by Evil state&#xA;(add-hook 'post-command-hook #'set-mode-line-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Strangely enough, this causes emacs to become nearly unusable (~0.2s delays abound). Is the overhead of setting a face really that high? Is there any way I can fix it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is &lt;code&gt;Emacs 24.5&lt;/code&gt; on a graphical Linux frame.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-07-03T05:05:08.553" LastActivityDate="2015-07-03T16:57:00.560" Title="Setting faces is slow?" Tags="|buffers|faces|minibuffer|performance|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13655" PostTypeId="1" AcceptedAnswerId="13660" CreationDate="2015-07-03T04:48:23.647" Score="2" ViewCount="1279" Body="&lt;p&gt;I wanted a function in the style of &lt;code&gt;zip&lt;/code&gt;, but rather than stopping when one of the supplied lists runs out, I wanted it to continue using &lt;code&gt;zip&lt;/code&gt; on the rest of the lists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking around at a few Emacs functions (referring mainly to those internal to Emacs and in the Common Lisp, and &lt;code&gt;dash.el&lt;/code&gt; extensions), I found a few functions like &lt;code&gt;mapcar*&lt;/code&gt;, &lt;code&gt;-zip&lt;/code&gt;, and &lt;code&gt;-zip-fill&lt;/code&gt; that were close to what I was looking for, but ended when one of the given lists ran out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ended up writing my own function, but I'm interested in knowing why many of the functions I saw implement this behavior.  Looking &lt;a href=&quot;http://jessepollak.me/whats-up-with-zip/&quot; rel=&quot;nofollow&quot;&gt;online&lt;/a&gt;, it appears that this is the most common interpretation of how &lt;code&gt;zip&lt;/code&gt; should work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would my desired function be considered &lt;code&gt;zip&lt;/code&gt;?  I figure it may be called something else, unless is a specialized unnamed variant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To hopefully clarify myself some, here is the function I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-zip-alt (&amp;amp;rest lists)&#xA;  (when lists&#xA;    (cons (mapcar #'car lists)&#xA;          (apply #'my-zip-alt (delq nil (mapcar #'cdr lists))))))&#xA;&#xA;;; (my-zip-alt '(1 2 3) '(4 5) '(6) '(nil))&#xA;;;=&amp;gt; ((1 4 6 nil) (2 5) (3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Recommendations for making my function simpler or more efficient are welcome, of course :) &lt;/p&gt;&#xA;" OwnerDisplayName="user2267" LastActivityDate="2015-07-07T11:42:06.480" Title="Zip/Map functions ending when shortest list runs out" Tags="|functions|common-lisp|dash.el|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13656" PostTypeId="1" AcceptedAnswerId="13742" CreationDate="2015-07-03T06:11:05.683" Score="6" ViewCount="328" Body="&lt;p&gt;When editing human language text and moving text fragments around, I frequently run into the problem that whitespace moved at the beginning or end of a fragment doesn't fit into the new position.  For example, consider this paragraph:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is the first sentence.  This is the second sentence.  These&#xA;three sentences are the whole paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I move the last sentence before the first one by kill+yank, I have either leading or trailing whitespace.  A similar problem occurs in enumerations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another use case is if I want to insert a single word or expression which is in the kill ring without any trailing or leading whitespace.  For example, consider the word &quot;very&quot; in the kill ring, and the following sentence:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Such a minor mode would be useful.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After yanking, this may erroneously become:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Such a minor mode would bevery useful.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have white space in human texts adjusted automatically?&lt;/p&gt;&#xA;" OwnerUserId="8794" LastEditorUserId="8794" LastEditDate="2015-07-06T07:16:17.287" LastActivityDate="2015-07-06T13:32:46.613" Title="How to automatically adjust whitespace after yanks?" Tags="|whitespace|yank|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13657" PostTypeId="1" AcceptedAnswerId="13686" CreationDate="2015-07-03T06:42:58.467" Score="2" ViewCount="276" Body="&lt;p&gt;In Emacs &lt;code&gt;org-mode&lt;/code&gt;, I like to use TODO items. I switched on the automatic closing note, when an entry is marked DONE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A small annoyance is that the fill behavior of the closing note usually changes from the &lt;code&gt;*Org Note*&lt;/code&gt; buffer, where the message is entered, to the original Org-file. To have the right filling after inserting the closing note, I have to scroll down a few lines and use the &lt;code&gt;M-q&lt;/code&gt; (&lt;code&gt;fill-paragraph&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a possibility to have automatic filling for the closing note?&lt;/p&gt;&#xA;" OwnerUserId="8750" LastEditorUserId="8750" LastEditDate="2015-07-03T12:58:53.537" LastActivityDate="2015-07-03T15:25:18.147" Title="Org-mode: Automatic fill-paragraph for TODO Closing Note?" Tags="|org-mode|fill-paragraph|todo|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13658" PostTypeId="1" AcceptedAnswerId="13670" CreationDate="2015-07-03T06:47:53.847" Score="3" ViewCount="194" Body="&lt;p&gt;Magit allows renaming various Git references. I can't see how to rename a tag with Magit commands.&lt;/p&gt;&#xA;" OwnerUserId="2506" LastActivityDate="2015-07-03T12:34:59.537" Title="How can I rename a tag in Magit?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13659" PostTypeId="1" AcceptedAnswerId="13669" CreationDate="2015-07-03T09:23:00.877" Score="4" ViewCount="409" Body="&lt;p&gt;The release notes for magit 2.1.0 state &quot;Branch descriptions can now be displayed in the refs or status buffer&quot;. However, I can't find these features documented in the info pages. I am using magit 20150701.1326.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2021-01-24T02:41:18.253" Title="Displaying branch descriptions in magit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13660" PostTypeId="2" ParentId="13655" CreationDate="2015-07-03T09:52:15.200" Score="4" Body="&lt;p&gt;Perhaps, they could be called &lt;code&gt;align&lt;/code&gt; or &lt;code&gt;alignWith&lt;/code&gt;, as in the &lt;a href=&quot;http://hackage.haskell.org/package/these-0.4.2/docs/Data-Align.html&quot; rel=&quot;nofollow&quot;&gt;these&lt;/a&gt; Haskell package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;alignWith&lt;/code&gt; takes a function which decides how to combine all the variants of the non-uniform tuples (which arise after you continue when the shortest list ran out):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;align :: f a -&amp;gt; f b -&amp;gt; f (These a b)&#xA;alignWith :: (These a b -&amp;gt; c) -&amp;gt; f a -&amp;gt; f b -&amp;gt; f c&#xA;data These a b = This a | That b | These a b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Here, &lt;code&gt;f&lt;/code&gt; is to be understood as a functor type constructor, like &quot;list&quot;. A list of &lt;code&gt;a&lt;/code&gt; is a special case of &lt;code&gt;f a&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Sorry for the answer being in Haskell! but if we are looking for commonly used names for such functions, it shouldn't matter much.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've also seen another Haskell package implementing the same idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://www.reddit.com/r/haskell/comments/3bz9iw/apart_from_these_package_who_else_implements/csrcgji&quot; rel=&quot;nofollow&quot;&gt;Apart from &quot;these&quot; package, who else implements zipping that continues after the shortest list in a library?&lt;/a&gt;, the other implementation under the name &lt;a href=&quot;http://hackage.haskell.org/package/data-or-1.0.0.5/docs/Data-Or.html#v:zipOr&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;zipOr&lt;/code&gt;&lt;/a&gt; has been brought up.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And the version &quot;as in F#&quot; in the post online you have linked has been called &lt;code&gt;pair&lt;/code&gt; once in a Haskell library: &lt;a href=&quot;http://code.haskell.org/~wren/list-extras/dist/doc/html/list-extras/Data-List-Extras-Pair.html&quot; rel=&quot;nofollow&quot;&gt;A safe version of zip which will fail (return &lt;code&gt;Nothing&lt;/code&gt;) on uneven length lists&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5165" LastEditorUserId="5165" LastEditDate="2015-07-07T11:42:06.480" LastActivityDate="2015-07-07T11:42:06.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13661" PostTypeId="1" CreationDate="2015-07-03T09:52:42.810" Score="2" ViewCount="59" Body="&lt;p&gt;When i press &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-d&lt;/kbd&gt; (org-clock-display) emacs expands links in headers. How to prevent this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* h1 &#xA;** [[http://duckduckgo.com/?q%3Dvery%20long%20search%20term%20blabla][DuckDuckGo]]&#xA;   CLOCK: [2015-07-03 Pt 11:18]--[2015-07-03 Pt 11:30] =&amp;gt;  0:12&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;before:&lt;/b&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/aM5y3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;after running org-clock-display:&lt;/b&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/a2ZuV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Links is expanded and i don't see the time near second headline.&lt;/p&gt;&#xA;" OwnerUserId="4005" LastActivityDate="2015-07-03T09:52:42.810" Title="org-clock-display breaks links" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13662" PostTypeId="1" AcceptedAnswerId="13663" CreationDate="2015-07-03T09:54:58.590" Score="15" ViewCount="6407" Body="&lt;p&gt;Can I configure Emacs to ask for confirmation before exiting on &lt;code&gt;C-x C-c&lt;/code&gt;? (Sometimes, my fingers press this by mistake.)&lt;/p&gt;&#xA;" OwnerUserId="5165" LastEditorUserId="5165" LastEditDate="2017-12-07T12:51:13.337" LastActivityDate="2017-12-07T12:51:13.337" Title="a confirmation after C-x C-c before exiting Emacs" Tags="|key-bindings|exit|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13663" PostTypeId="2" ParentId="13662" CreationDate="2015-07-03T09:55:49.223" Score="22" Body="&lt;p&gt;Set the variable &lt;code&gt;confirm-kill-emacs&lt;/code&gt; to something like &lt;code&gt;yes-or-no-p&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-07-03T09:55:49.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13664" PostTypeId="1" AcceptedAnswerId="13665" CreationDate="2015-07-03T10:39:44.973" Score="4" ViewCount="94" Body="&lt;p&gt;I'm looking into a way to extend search in documents, especially, Org files by ways of indexing them. In order to make the indexing more robust, it would be great to make it aware of different sections of a file. In Org files, in particular, it would make sense to look separately into headers, the pargraphs of text, comments and snippets of other documents (code, tables etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to extract this information as some data-structure?&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-03T10:47:43.260" Title="Extract structure from Org document" Tags="|org-mode|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13665" PostTypeId="2" ParentId="13664" CreationDate="2015-07-03T10:47:43.260" Score="4" Body="&lt;p&gt;See for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-element-parse-buffer 'headline)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's also useful to grep the Org git repository for &lt;code&gt;org-element-map&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-03T10:47:43.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13666" PostTypeId="1" CreationDate="2015-07-03T11:06:54.553" Score="4" ViewCount="146" Body="&lt;p&gt;In column view i can use some &lt;a href=&quot;http://orgmode.org/manual/Special-properties.html&quot; rel=&quot;nofollow&quot;&gt;special columns&lt;/a&gt; like CLOCKSUM (total time) and CLOCKSUM_T (time for today). How can i create column CLOCKSUM_W which would sum all the time for current week?&lt;/p&gt;&#xA;" OwnerUserId="4005" LastActivityDate="2015-07-03T11:06:54.553" Title="how to create CLOCKSUM column for the week?" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13667" PostTypeId="1" CreationDate="2015-07-03T11:08:38.973" Score="1" ViewCount="222" Body="&lt;p&gt;I just helped a colleague to configure &lt;code&gt;package.el&lt;/code&gt;, &lt;code&gt;smex&lt;/code&gt;, and &lt;code&gt;ido&lt;/code&gt; and set up a nice theme (&lt;code&gt;spolsky&lt;/code&gt; from the &lt;code&gt;sublime-themes&lt;/code&gt; package) for Aquamacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I evaluate &lt;code&gt;(load-theme 'spolsky t)&lt;/code&gt; everything looks just fine, but when Aquamacs is started, the main text that is supposed to be white is black.  This is fixed when I manually evaluate &lt;code&gt;(load-theme 'spolsky t)&lt;/code&gt; with &lt;code&gt;C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The configuration file is minimal and nowhere do I change any colours explicitly.  The only theme-related line is &lt;code&gt;(load-theme 'spolsky t)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this is Aquamacs and not GNU Emacs (which I'm using) I don't really know how to debug this.  (I don't even know how to run a GUI Aquamacs from the command line because I'm completely Mac-illiterate.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I debug this?  There is no error message displayed and the equivalent of &lt;code&gt;custom.el&lt;/code&gt; does not mention any colours.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-07-03T13:54:09.817" Title="Text is black on startup --- how to debug?" Tags="|themes|colors|aquamacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13668" PostTypeId="2" ParentId="13662" CreationDate="2015-07-03T11:54:22.130" Score="8" Body="&lt;p&gt;A common alternative is to unbind the key using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-x C-c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can always quit via &lt;code&gt;M-x save-buffers-kill-terminal&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="318" LastActivityDate="2015-07-03T11:54:22.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13669" PostTypeId="2" ParentId="13659" CreationDate="2015-07-03T12:30:10.197" Score="6" Body="&lt;p&gt;For some buffers, including status and refs buffers, Magit &lt;a href=&quot;http://magit.vc/manual/magit/Section-Hooks.html#Section-hooks&quot; rel=&quot;nofollow noreferrer&quot;&gt;now uses customizable hooks&lt;/a&gt;. Such hook variables are named &lt;code&gt;magit-{*}-sections-hook&lt;/code&gt;. All functions that insert sections are named &lt;code&gt;magit-insert-WHAT&lt;/code&gt;. To add functions to section hook variables use &lt;code&gt;magit-add-section-hook&lt;/code&gt;. It offers a little more control over where exactly the function is inserted, than plain &lt;code&gt;add-hook&lt;/code&gt;. So try this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(magit-add-section-hook 'magit-status-sections-hook&#xA;                        'magit-insert-branch-description&#xA;                        nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and/or&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(magit-add-section-hook 'magit-refs-sections-hook&#xA;                        'magit-insert-branch-description)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="2731" LastEditDate="2021-01-24T02:41:18.253" LastActivityDate="2021-01-24T02:41:18.253" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="13670" PostTypeId="2" ParentId="13658" CreationDate="2015-07-03T12:34:59.537" Score="2" Body="&lt;p&gt;Tags cannot be renamed. Git itself does not offer a command for doing it. Magit could of course implement this by calling git multiple times, but I think it actually makes sense that tags cannot be renamed. Also this would only work for non-annotated tags anyway. I don't remember the details, but renaming an annotated tag confuses certain git commands. Git handles tags quite differently from all other refs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead just delete the old tag and then create a new one.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-07-03T12:34:59.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13671" PostTypeId="1" CreationDate="2015-07-03T12:41:52.667" Score="1" ViewCount="456" Body="&lt;p&gt;For my current works style guide I need to indent two units (tabs in their case) for a line continuation. the default in emacs lua mode appears to be one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. (assuming two spaces are a tab or an indentation width)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;correct example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function doStuff(foo)&#xA;  local foo = otherFunc(&#xA;      someArgs,&#xA;      someMoreArgsToIllustrateIndentation)&#xA;  return foo&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;incorrect (default behaviour):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function doStuff(foo)&#xA;  local foo = otherFunc(&#xA;    someArgs,&#xA;    someMoreArgsToIllustrateIndentation)&#xA;  return foo&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now it seems like I need to modify &lt;code&gt;lua-calculate-indentation&lt;/code&gt; in &lt;code&gt;lua-mode.el&lt;/code&gt; but I can't seem to grok how it's working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun lua-calculate-indentation (&amp;amp;optional parse-start)&#xA;  &quot;Return appropriate indentation for current line as Lua code.&quot;&#xA;  (save-excursion&#xA;    (let ((continuing-p (lua-is-continuing-statement-p))&#xA;          (cur-line-begin-pos (line-beginning-position)))&#xA;      (or&#xA;       ;; when calculating indentation, do the following:&#xA;       ;; 1. check, if the line starts with indentation-modifier (open/close brace)&#xA;       ;;    and if it should be indented/unindented in special way&#xA;       (lua-calculate-indentation-override)&#xA;&#xA;       (when (lua-forward-line-skip-blanks 'back)&#xA;         ;; the order of function calls here is important. block modifier&#xA;         ;; call may change the point to another line&#xA;         (let* ((modifier&#xA;                 (lua-calculate-indentation-block-modifier cur-line-begin-pos)))&#xA;           (+ (current-indentation) modifier)))&#xA;&#xA;       ;; 4. if there's no previous line, indentation is 0&#xA;       0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this the right function to modify, and if so how do I do it?&lt;/p&gt;&#xA;" OwnerUserId="5199" LastActivityDate="2015-07-03T12:41:52.667" Title="How do I make lua indent two indentation units for a line continuation" Tags="|indentation|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13672" PostTypeId="2" ParentId="12404" CreationDate="2015-07-03T12:56:46.507" Score="3" Body="&lt;p&gt;See this issue &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/1218&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/issues/1218&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically &lt;code&gt;org-drill.el&lt;/code&gt; is not included in the original emacs distribution, so one way you can include the file is to now add &lt;code&gt;org-plus-contrib&lt;/code&gt; under &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;, which will download all &lt;code&gt;org-contrib&lt;/code&gt; files, including &lt;code&gt;org-drill.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would look as follows : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-additional-packages '(org-plus-contrib)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More info can be seen at :  &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#without-a-layer&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#without-a-layer&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="105" LastEditDate="2017-04-04T14:50:07.870" LastActivityDate="2017-04-04T14:50:07.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13673" PostTypeId="2" ParentId="478" CreationDate="2015-07-03T13:50:53.617" Score="6" Body="&lt;p&gt;Magit's wiki now features a &lt;a href=&quot;https://github.com/magit/magit/wiki/Pushing-with-Magit-from-Windows&quot; rel=&quot;noreferrer&quot;&gt;page&lt;/a&gt; about the various ways one can push from Magit when using MS Windows. Also checkout the new &lt;a href=&quot;https://github.com/magit/magit/wiki/Pushing-with-Magit-from-Windows&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ssh-agency&lt;/code&gt;&lt;/a&gt; package. Both the wiki page and the package were written by @npostavs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that it is virtually never Magit's fault if you cannot push. It's usually a configuration issue (even if you can push from the shell but not when using Magit).&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T21:07:31.723" LastActivityDate="2015-07-03T21:07:31.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13674" PostTypeId="2" ParentId="13667" CreationDate="2015-07-03T13:54:09.817" Score="1" Body="&lt;p&gt;The themes installed are stored in &lt;code&gt;~/.emacs.d/elpa/your-installed-theme/&lt;/code&gt;. You could edit the theme file and investigate what line is causing the text to be black, then restart emacs and see if you caught the evil guy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But a possibility that comes to my mind is that emacs is using more than one theme, and that generally causes visual glitches. To prevent that, run &lt;code&gt;M-x customize-themes&lt;/code&gt; and uncheck &lt;code&gt;Select more than one theme at time&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-07-03T13:54:09.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13675" PostTypeId="1" AcceptedAnswerId="14435" CreationDate="2015-07-03T13:55:34.997" Score="2" ViewCount="102" Body="&lt;p&gt;I'm trying to write a very simple function to replicate the Vim 'p' command. &#xA;This is, paste some text after the current line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been googling for a while and haven't found a function to achieve this, which I think it's very strange as I consider this quite handy! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of the awesome Evil-mode, but I just require only this functionality to be happy :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far this is what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun paste-after-line ()&#xA;  (interactive)&#xA;  (prelude-smart-open-line nil) ;; This function opens a new line below&#xA;  (yank))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, but if the copied text has a line ending, then the yanked text also adds an empty line below the text and places the cursor there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone knows if is there a way to yank some text excluding any new line on it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6546" LastActivityDate="2015-08-03T20:13:17.173" Title="Function to paste killring after the current line (like &quot;p&quot; in vim)" Tags="|yank|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13676" PostTypeId="1" AcceptedAnswerId="13682" CreationDate="2015-07-03T14:04:52.960" Score="10" ViewCount="1819" Body="&lt;p&gt;Is it possible to run a shell command silently (in background)? When I use &lt;code&gt;async-shell-command&lt;/code&gt;, emacs split the windows. I would like that an specific shell command to be totally in background (without any visual effect).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an explicit example, I have the following code (borrowed from &lt;a href=&quot;https://emacs.stackexchange.com/a/7932&quot;&gt;https://emacs.stackexchange.com/a/7932&lt;/a&gt;). It opens the pdf version of the tex-file I working on. When running it, it splits the window, I would like to prevent it from this behavior in this particular situation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun my-view-pdf ()&#xA;  (interactive)&#xA;  (async-shell-command&#xA;    (concat &quot;SumatraPDF &quot; (file-name-base (buffer-file-name)) &quot;.pdf&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2022-06-22T09:08:12.163" Title="How to make a shell command totally silent (preventing it to split window or to open a new frame/window etc)" Tags="|latex|shell|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13677" PostTypeId="2" ParentId="10892" CreationDate="2015-07-03T14:07:28.033" Score="4" Body="&lt;p&gt;Beginning with &lt;code&gt;v2.1.0&lt;/code&gt; you can show logs for arbitrary branches, commits, and ranges using &lt;kbd&gt;l o  RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also possible to log commits from multiple branches at once by separating them with comas: &lt;kbd&gt;l o , RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T18:59:16.113" LastActivityDate="2015-07-03T18:59:16.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13678" PostTypeId="2" ParentId="10611" CreationDate="2015-07-03T14:10:53.817" Score="51" Body="&lt;p&gt;Everywhere you see a commit in a Magit buffer, you can &lt;a href=&quot;https://magit.vc/manual/magit/Cherry-picking.html&quot; rel=&quot;noreferrer&quot;&gt;cherry-pick&lt;/a&gt; it by moving point there and then typing &lt;kbd&gt;A A&lt;/kbd&gt;. You can also cherry-pick multiple commits at once: just select some commits using the region and then press &lt;kbd&gt;A A&lt;/kbd&gt;. &lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-06-09T09:59:20.620" LastActivityDate="2016-06-09T09:59:20.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13679" PostTypeId="2" ParentId="3893" CreationDate="2015-07-03T14:12:22.930" Score="0" Body="&lt;p&gt;As of &lt;code&gt;magit&lt;/code&gt; version &lt;code&gt;2.1&lt;/code&gt;, you can use this in your config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; When commiting enable verbose mode by default.&#xA;(setq magit-commit-arguments (quote (&quot;--verbose&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7112" LastActivityDate="2015-07-03T14:12:22.930" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13680" PostTypeId="2" ParentId="2194" CreationDate="2015-07-03T14:13:21.500" Score="2" Body="&lt;p&gt;Starting with &lt;code&gt;v2.1.0&lt;/code&gt; Magit by default shows the changes that are being committed alongside the buffer used to write the commit message.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-07-03T14:13:21.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13682" PostTypeId="2" ParentId="13676" CreationDate="2015-07-03T14:45:57.457" Score="10" Body="&lt;p&gt;&lt;code&gt;save-window-excursion&lt;/code&gt; is a macro for running a piece of code without altering the window configuration. Something like this should work:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; (defun my-view-pdf ()&#xA;  (interactive)&#xA;  (save-window-excursion&#xA;   (async-shell-command&#xA;     (concat &amp;quot;SumatraPDF &amp;quot; (file-name-base (buffer-file-name)) &amp;quot;.pdf&amp;quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Note the warning in the docstring of &lt;code&gt;save-window-excursion&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;BEWARE: Most uses of this macro introduce bugs.&lt;br /&gt;&#xA;E.g. it should not be used to try and prevent some code from opening&#xA;a new window, since that window may sometimes appear in another frame,&#xA;in which case &lt;code&gt;save-window-excursion&lt;/code&gt; cannot help.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In this case I think it should be fine, though, as it is an interactive function that doesn't really interact with any other code.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="11" LastEditDate="2022-06-22T09:08:12.163" LastActivityDate="2022-06-22T09:08:12.163" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="13683" PostTypeId="2" ParentId="3893" CreationDate="2015-07-03T14:51:25.947" Score="22" Body="&lt;p&gt;Beginning with &lt;code&gt;v2.1.0&lt;/code&gt;, Magit uses the library &lt;code&gt;magit-popup.el&lt;/code&gt; to implement such &quot;popup buffers&quot; or &quot;prefix-infix-suffix combos&quot;. Despite its name, that library can be used by packages not related to Magit, and is therefore made available as a separate Elpa package. It even has its &lt;a href=&quot;http://magit.vc/manual/magit-popup/#Top&quot;&gt;own manual&lt;/a&gt; now!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Default arguments can now be set directly from a popup buffer. To always use &lt;code&gt;--verbose&lt;/code&gt; when committing do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;c&lt;/kbd&gt; Show the committing popup&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;- v&lt;/kbd&gt; Turn on &lt;code&gt;--verbose&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x C-s&lt;/kbd&gt; Save the currently set arguments as defaults (in the custom option &lt;code&gt;magit-commit-arguments&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;By default all popup buffers end with a section named &quot;Common Commands&quot;. If not, use &lt;kbd&gt;C-t&lt;/kbd&gt; to show it. You probably don't want to see that section all the time and should therefore set &lt;code&gt;magit-popup-show-common-commands&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course it is also possible to set the value of &lt;code&gt;magit-commit-arguments&lt;/code&gt; and other such variables using the Custom interface, &lt;code&gt;setq&lt;/code&gt;, or &lt;code&gt;add-to-list&lt;/code&gt;. But I recommend against that, because that would make it impossible to change the defaults on-the-fly.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-03T15:03:57.067" LastActivityDate="2015-07-03T15:03:57.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13684" PostTypeId="2" ParentId="3289" CreationDate="2015-07-03T14:56:49.607" Score="2" Body="&lt;p&gt;Beginning with &lt;code&gt;v2.1.0&lt;/code&gt; Magit's logging popup no longer features the &lt;code&gt;--all&lt;/code&gt; infix argument. Instead the popup provides three new related &lt;em&gt;suffix commands&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;l L&lt;/kbd&gt; Log local branches (&lt;code&gt;--branches&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;l b&lt;/kbd&gt; Log all branches (&lt;code&gt;--branches --remotes&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;l a&lt;/kbd&gt; Log all references (&lt;code&gt;--all&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;While it is no longer possible (or necessary) to set the &lt;code&gt;--all&lt;/code&gt; argument, you might want to change the default value of some other argument. See &lt;a href=&quot;https://emacs.stackexchange.com/questions/3893&quot;&gt;How can I make `--verbose` flag be enabled by default in magit commit screen?&lt;/a&gt; for information about that.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-07-03T14:56:49.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13685" PostTypeId="2" ParentId="13662" CreationDate="2015-07-03T15:04:49.197" Score="9" Body="&lt;p&gt;I use this, which workds in all Emacs versions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'kill-emacs-query-functions&#xA;          (lambda () (y-or-n-p &quot;Do you really want to exit Emacs? &quot;))&#xA;          'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-04T05:56:27.740" LastActivityDate="2015-07-04T05:56:27.740" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13686" PostTypeId="2" ParentId="13657" CreationDate="2015-07-03T15:25:18.147" Score="2" Body="&lt;p&gt;You could adjust the value of &lt;code&gt;fill-column&lt;/code&gt; in the Org note buffer.&#xA;If &lt;code&gt;org-adapt-indentation&lt;/code&gt; is non-nil, this needs to take into account&#xA;the heading level.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar org-log-current-level nil)&#xA;(advice-add 'org-add-log-note :before&#xA;            (lambda ()&#xA;              (setq org-log-current-level (org-current-level))))&#xA;&#xA;(defun org-log-adjust-fill-column ()&#xA;  (let ((offset (if org-adapt-indentation (+ org-log-current-level 3) 2)))&#xA;    (setq fill-column (- fill-column offset))))&#xA;&#xA;(add-hook 'org-log-buffer-setup-hook #'org-log-adjust-fill-column)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-07-03T15:25:18.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13687" PostTypeId="2" ParentId="13676" CreationDate="2015-07-03T15:25:49.313" Score="8" Body="&lt;p&gt;Use &lt;code&gt;display-buffer-alist&lt;/code&gt; with the &lt;code&gt;display-buffer-no-window&lt;/code&gt; if you're on Emacs 24.4 or later.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-buffer-alist '((&quot;\\`\\*Async Shell Command\\*\\'&quot; display-buffer-no-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, use &lt;a href=&quot;https://github.com/wasamasa/shackle&quot;&gt;shackle&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shackle-rules '((&quot;*Async Shell Command*&quot; :ignore t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-07-03T15:39:44.023" LastActivityDate="2015-07-03T15:39:44.023" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13689" PostTypeId="1" AcceptedAnswerId="13691" CreationDate="2015-07-03T15:37:29.067" Score="0" ViewCount="40" Body="&lt;p&gt;I created a new macro and saved to &lt;code&gt;.emacs/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'foobar&#xA;   [?f ?o ?o return ?b ?a ?r return])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I use this macro after restarting emacs?&lt;/p&gt;&#xA;" OwnerUserId="8404" LastActivityDate="2015-07-03T16:25:03.373" Title="Insert saved macro" Tags="|elisp-macros|prelude|" AnswerCount="1" CommentCount="3" ClosedDate="2015-07-03T17:34:50.150" ContentLicense="CC BY-SA 3.0" />
  <row Id="13690" PostTypeId="2" ParentId="13656" CreationDate="2015-07-03T15:37:35.810" Score="2" Body="&#xA;&#xA;&lt;p&gt;Here's a function, &lt;code&gt;delete-leading-whitespace-on-line&lt;/code&gt; to do as the name suggests:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-leading-whitespace-on-line ()&#xA;  &quot;Delete whitespace at the beginning of the current line.&quot;&#xA;  (interactive)&#xA;  (let ((start (line-beginning-position))&#xA;        (end (line-end-position)))&#xA;    (save-excursion&#xA;      (delete-whitespace-rectangle start end nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For &lt;em&gt;trailing&lt;/em&gt; whitespace, I use &lt;code&gt;M-x delete-trailing-whitespace&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To trigger these after yanks, you could do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun yank-and-trim-whitespace ()&#xA;  &quot;Yank and then trim whitespace on the line.&quot;&#xA;  (interactive)&#xA;  (yank)&#xA;  (delete-leading-whitespace-on-line)&#xA;  (delete-trailing-whitespace))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bind it like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;\C-y&quot; 'yank-and-trim-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You might also like to try Steve Purcell's &lt;a href=&quot;https://github.com/purcell/whitespace-cleanup-mode&quot; rel=&quot;nofollow&quot;&gt;whitespace-cleanup-mode&lt;/a&gt;, a minor mode that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;will intelligently call whitespace-cleanup before buffers are saved.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;PS His GitHub account is a treasure trove of Emacs goodies.&lt;/p&gt;&#xA;" OwnerUserId="8797" LastEditorUserId="8797" LastEditDate="2015-07-03T17:32:11.267" LastActivityDate="2015-07-03T17:32:11.267" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13691" PostTypeId="2" ParentId="13689" CreationDate="2015-07-03T16:25:03.373" Score="1" Body="&lt;p&gt;You run that macro with &lt;code&gt;M-x foobar&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-07-03T16:25:03.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13692" PostTypeId="2" ParentId="13654" CreationDate="2015-07-03T16:57:00.560" Score="3" Body="&lt;p&gt;Due to the speed at which the mode-line needs to update, it is too costly to use functions like &lt;code&gt;set-face-attribute&lt;/code&gt;, &lt;code&gt;set-face-foreground&lt;/code&gt;, and &lt;code&gt;set-face-background&lt;/code&gt;.  The most efficient method of setting mode-line faces will be to use either ones that have already been defined -- e.g., &lt;code&gt;defface&lt;/code&gt; -- or, by modifying existing faces with &lt;code&gt;face-remap-add-relative&lt;/code&gt;:  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is a quote from &lt;em&gt;Stefan&lt;/em&gt; in the related thread at the following link &lt;a href=&quot;https://stackoverflow.com/a/25150669/2112489&quot;&gt;https://stackoverflow.com/a/25150669/2112489&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Changing faces dynamically is going to be slow because the redisplay code is written under the assumption that faces don't change (if they change, we basically redo a lot of work).  Using &lt;code&gt;face-remapping-alist&lt;/code&gt; will result in much better performance because the redisplay code does expect it to change and know how to cache the result.&quot;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-07-03T16:57:00.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13694" PostTypeId="1" AcceptedAnswerId="14481" CreationDate="2015-07-03T18:06:30.203" Score="2" ViewCount="482" Body="&lt;p&gt;I'm trying to execute &lt;code&gt;C-M--&lt;/code&gt; from Emacs on Terminal (iTerm2) running on OSX, but I keep getting an error saying &lt;code&gt;C-M-_ is undefined&lt;/code&gt;. Any ideas how to workaround this?&lt;/p&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="25" LastEditDate="2015-08-03T22:02:56.870" LastActivityDate="2015-10-04T14:52:44.537" Title="'C-M--' on Emacs Terminal on OSX fails with &quot;C-M-_ is undefined&quot;" Tags="|key-bindings|osx|terminal-emacs|term|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13695" PostTypeId="2" ParentId="13676" CreationDate="2015-07-03T20:19:32.300" Score="10" Body="&lt;p&gt;If you just would like to spawn a process in the background you don't need all the bells an whistles that shell command functions provide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, you can use the function &lt;code&gt;call-process&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process&#xA; &quot;a_command&quot;&#xA; nil&#xA; 0                                  ; &amp;lt;- Discard and don't wait&#xA; nil&#xA; &quot;arg1&quot;&#xA; &quot;arg2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Concretely, this mean that you can implement you command as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-view-pdf ()&#xA;    (interactive)&#xA;    (call-process &quot;SumatraPDF&quot; nil 0 nil&#xA;                  (concat (file-name-base (buffer-file-name)) &quot;.pdf&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-07-06T09:00:21.060" LastActivityDate="2015-07-06T09:00:21.060" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13696" PostTypeId="1" AcceptedAnswerId="13697" CreationDate="2015-07-03T20:28:16.657" Score="21" ViewCount="1573" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How does one pronounce &lt;em&gt;magit&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It occurred to me today that I've never said &quot;magit&quot; out loud, and I'd prefer not to make a fool of myself if I ever have to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: is the &lt;em&gt;g&lt;/em&gt; in &lt;em&gt;magit&lt;/em&gt; pronounced as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a &lt;em&gt;j&lt;/em&gt;, as in &lt;em&gt;magic&lt;/em&gt;, or&lt;/li&gt;&#xA;&lt;li&gt;a hard &lt;em&gt;g&lt;/em&gt;, as in &lt;em&gt;git&lt;/em&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I suppose I've always said it as &lt;em&gt;j&lt;/em&gt; in my head, but I could see the other way as well (aside from the unfortunate similarity to &quot;maggot&quot;).&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2023-12-03T20:11:11.620" Title="How to pronounce &quot;magit&quot;?" Tags="|magit|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13697" PostTypeId="2" ParentId="13696" CreationDate="2015-07-03T21:05:24.527" Score="20" Body="&lt;p&gt;Either &amp;quot;mu[m's] git&amp;quot; or &lt;a href=&quot;https://magit.vc/assets/videos/magic.mp4&quot; rel=&quot;nofollow noreferrer&quot;&gt;&amp;quot;magi{c =&amp;gt; t}&amp;quot;&lt;/a&gt; is fine.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2023-12-03T20:11:11.620" LastActivityDate="2023-12-03T20:11:11.620" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="13698" PostTypeId="1" AcceptedAnswerId="17469" CreationDate="2015-07-03T22:59:13.053" Score="2" ViewCount="68" Body="&lt;p&gt;The function eshell-print has some weird behavior, as it only seems to work when called as a part of an eshell process. All other times it throws the error &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;wrong type arguments: arrayp, nil&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Try to execute this function inside the scratch buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  (eshell)&#xA;  (eshell-print &quot;Hello world&quot;))&#xA;&#xA;(test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't run, even without an init file. If you try this, however, it works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;   (eshell)&#xA;   (eshell-return-to-prompt)&#xA;   (insert &quot;test&quot;)&#xA;   (eshell-send-input))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why it exhibits this behavior?&lt;/p&gt;&#xA;" OwnerUserId="6831" LastActivityDate="2015-10-18T13:41:27.133" Title="Eshell-print only works when called from eshell" Tags="|elisp|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13699" PostTypeId="1" AcceptedAnswerId="13774" CreationDate="2015-07-04T00:39:46.640" Score="4" ViewCount="74" Body="&lt;pre&gt;&lt;code&gt;(defhydra windows (global-map &quot;C-c w&quot; :post flash-active-buffer)&#xA;  &quot;window moving&quot;&#xA;  (&quot;o&quot; other-window &quot;other&quot;))&#xA;&#xA;(make-face 'flash-active-buffer-face)&#xA;(set-face-attribute 'flash-active-buffer-face nil&#xA;                    :background &quot;red&quot;&#xA;                    :foreground &quot;black&quot;)&#xA;(defun flash-active-buffer ()&#xA;  (interactive)&#xA;  (run-at-time &quot;250 millisec&quot; nil&#xA;               (lambda (remap-cookie)&#xA;                 (face-remap-remove-relative remap-cookie))&#xA;               (face-remap-add-relative 'default 'flash-active-buffer-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above works as you'd expect: when the hydra exits, the final window flashes.  What I'd like is to flash the window as the focus moves about the frame.  However, instead of flashing the window, it will leave all &lt;em&gt;other&lt;/em&gt; windows with the flash-color (in this case, completely red).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get each window to flash as expected when using &lt;code&gt;:pre&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2015-07-04T18:51:19.637" LastActivityDate="2015-07-07T14:31:21.073" Title="Why does this function work with :post but not :pre?" Tags="|hydra|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13700" PostTypeId="1" AcceptedAnswerId="13703" CreationDate="2015-07-04T02:02:41.280" Score="4" ViewCount="192" Body="&lt;p&gt;The previous version of Magit had a remote update command to replicate &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;git remote update&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the replacement command?&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-07-04T06:22:47.473" Title="What happened to magit-remote-update in version 2.1" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13701" PostTypeId="1" CreationDate="2015-07-04T03:01:16.130" Score="3" ViewCount="1654" Body="&lt;p&gt;Haskell mode doesn't seem to be resolving the modules in emacs when I use the &lt;a href=&quot;https://github.com/commercialhaskell/stack&quot; rel=&quot;nofollow&quot;&gt;stack&lt;/a&gt; command to build my project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a file that I have to edit to tell haskell-mode where to find the packages that stack installs from stackage?&lt;/p&gt;&#xA;" OwnerUserId="7115" LastActivityDate="2017-12-16T08:18:04.340" Title="haskell-mode emacs not finding modules when using stack" Tags="|haskell-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13702" PostTypeId="1" AcceptedAnswerId="14257" CreationDate="2015-07-04T04:15:20.707" Score="8" ViewCount="567" Body="&lt;p&gt;For some reason, fuzzy matching is not working in &lt;code&gt;helm-recentf&lt;/code&gt; for me (though it is working everywhere else).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following settings in my .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq helm-recentf-fuzzy-match t&#xA;      helm-buffers-fuzzy-matching t&#xA;      helm-completion-in-region-fuzzy-match t&#xA;      helm-mode-fuzzy-match t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume that there is some overlap with the functionality of these settings, but I don't see why any of them should mess up &lt;code&gt;helm-recentf-fuzzy-match&lt;/code&gt;. Also, I have tried setting only &lt;code&gt;helm-recentf-fuzzy-match&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; and removed the other settings, and still no good. Also, when I check the value for &lt;code&gt;helm-recentf-fuzzy-match&lt;/code&gt; this is what I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-recentf-fuzzy-match is a variable defined in `helm-files.el'.&#xA;Its value is t&#xA;Original value was nil&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I experiencing a bug, or is there something I need to configure/have configured wrong? Thank you!&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update and details:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;strong&gt;Emacs 24.5&lt;/strong&gt; and &lt;strong&gt;Helm 20150704.1247&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried loading up emacs without my init, and only turning on helm mode with fuzzy matching for recentf, and it still doesn't work. On top of that, if I use &lt;code&gt;helm-mini&lt;/code&gt; I have fuzzy matching in the &lt;code&gt;Buffers&lt;/code&gt; section, but not the &lt;code&gt;Recentf&lt;/code&gt; section...&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-07-05T03:56:52.317" LastActivityDate="2015-07-26T19:00:15.763" Title="Why is helm-recentf not fuzzy?" Tags="|init-file|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13703" PostTypeId="2" ParentId="13700" CreationDate="2015-07-04T06:22:47.473" Score="7" Body="&lt;p&gt;It is now called &lt;code&gt;magit-fetch-all&lt;/code&gt;, and can be invoked by &lt;code&gt;f a&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-07-04T06:22:47.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13704" PostTypeId="1" CreationDate="2015-07-04T13:20:56.120" Score="5" ViewCount="3551" Body="&lt;p&gt;By &lt;code&gt;M-backspace&lt;/code&gt; (or by &lt;code&gt;M-x backward-kill-word&lt;/code&gt;), I can remove the word before the cursor. Is there a built-in equivalent of this command for copying instead of deleting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously one can do &lt;code&gt;M-x backward-kill-word&lt;/code&gt; then &lt;code&gt;M-x yank&lt;/code&gt; (or &lt;code&gt;M-x undo&lt;/code&gt;), but I am wondering if there is a better solution (aside from not to be so quick, the inconvenience is that it first changes the status of the buffer).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-07-04T18:50:34.353" LastActivityDate="2015-07-05T21:41:41.647" Title="A quick way to copy the word before the cursor" Tags="|copy-paste|words|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13705" PostTypeId="1" AcceptedAnswerId="13792" CreationDate="2015-07-04T13:26:57.380" Score="12" ViewCount="838" Body="&lt;p&gt;I need to call a function and perform a cleanup &lt;strong&gt;only&lt;/strong&gt; if the function fails, and then relaunch the error.  Here is the pseudo-code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case err&#xA;    (call-function)&#xA;  (error&#xA;   (cleanup)&#xA;   ;; how do I raise `err`?&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="50" LastEditDate="2015-07-04T18:46:19.070" LastActivityDate="2015-07-08T04:26:48.347" Title="Rethrowing an error in Emacs Lisp" Tags="|error-handling|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13706" PostTypeId="2" ParentId="13704" CreationDate="2015-07-04T14:10:17.907" Score="1" Body="&lt;p&gt;Emacs doesn't have a native way to copy words, but you can always write a function and and bind a key to that using examples from &lt;a href=&quot;https://emacswiki.org/emacs/CopyWithoutSelection&quot; rel=&quot;nofollow&quot;&gt;https://emacswiki.org/emacs/CopyWithoutSelection&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-point (symbol &amp;amp;optional arg)&#xA;      &quot;get the point&quot;&#xA;      (funcall symbol arg)&#xA;      (point)&#xA;    )&#xA;&#xA;(defun copy-backward-word ()&#xA; &quot;copy word before point&quot;&#xA;  (interactive &quot;&quot;)&#xA;  (save-excursion&#xA;   (let ((end (point))&#xA;     (beg (get-point 'backward-word 1)))&#xA;     (copy-region-as-kill beg end)))&#xA;  )&#xA;&#xA;(global-set-key (kbd &quot;C-c !&quot;) 'copy-backward-word) ;; Adapt this.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Marking a word though is easy: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M- -1 M-x mark-word&lt;/code&gt; or assuming default bindings &lt;code&gt;M- -1 M-@&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-07-04T14:55:42.840" LastActivityDate="2015-07-04T14:55:42.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13707" PostTypeId="2" ParentId="13704" CreationDate="2015-07-04T14:27:57.203" Score="3" Body="&lt;p&gt;&lt;code&gt;C-u - 1 M-x mark-word&lt;/code&gt; will give &lt;code&gt;-1&lt;/code&gt; as an argument to mark-word, thus marking the previous word. After that, &lt;code&gt;M-w&lt;/code&gt; will copy it to the kill ring without actually deleting it, making it available to paste elsewhere.&lt;/p&gt;&#xA;" OwnerUserId="756" LastEditorUserId="756" LastEditDate="2015-07-04T14:45:37.073" LastActivityDate="2015-07-04T14:45:37.073" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13708" PostTypeId="1" AcceptedAnswerId="13710" CreationDate="2015-07-04T14:39:40.177" Score="3" ViewCount="208" Body="&lt;p&gt;My goal is to replace all literal sub-strings in a given string. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun translate (str)&#xA;    (concat (mapcar (lambda(cons)&#xA;              (replace-in-string (car cons) (cdr cons) str))&#xA;            '((&quot;ä&quot; &quot;ae&quot;)&#xA;              (&quot;ö&quot; &quot;oe&quot;)&#xA;              (&quot;ü&quot; &quot;ue&quot;)&#xA;              (&quot;ß&quot; &quot;ss&quot;)))))&#xA;  )&#xA;&#xA;  (defun replace-in-string (what with in)&#xA;    (replace-regexp-in-string (regexp-quote what) with in nil 'literal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;translate&lt;/code&gt; should replace all ä's by ae's etc. but it doesn't. Can you please tell me what is wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://stackoverflow.com/questions/17325713/looking-for-a-replace-in-string-function-in-elisp&quot;&gt;this discussion&lt;/a&gt; for &lt;code&gt;replace-in-string&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8804" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-07-05T12:38:11.570" Title="Replace all literal substrings from a list in a string" Tags="|replace|string|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13709" PostTypeId="2" ParentId="13704" CreationDate="2015-07-04T14:51:05.317" Score="6" Body="&lt;p&gt;&lt;code&gt;C-u -1 M-@ M-w&lt;/code&gt; or define a new command yourself, something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun backward-copy-word ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (copy-region-as-kill (point) (progn (backward-word) (point)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-07-04T15:16:59.883" LastActivityDate="2015-07-04T15:16:59.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13710" PostTypeId="2" ParentId="13708" CreationDate="2015-07-04T15:12:31.323" Score="1" Body="&lt;pre&gt;&lt;code&gt;(defun translate (str)&#xA;  (dolist (cons '((&quot;ä&quot; . &quot;ae&quot;)&#xA;                  (&quot;ö&quot; . &quot;oe&quot;)&#xA;                  (&quot;ü&quot; . &quot;ue&quot;)&#xA;                  (&quot;ß&quot; . &quot;ss&quot;)) str)&#xA;    (setq str (replace-in-string (car cons) (cdr cons) str))))&#xA;&#xA;;; Try it&#xA;(translate &quot;ä's =&amp;gt; ß's&quot;)&#xA;;; =&amp;gt; &quot;ae's =&amp;gt; ss's&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-07-04T15:12:31.323" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13711" PostTypeId="2" ParentId="13705" CreationDate="2015-07-04T15:37:18.163" Score="16" Body="&lt;p&gt;You're looking for &lt;code&gt;signal&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(condition-case err&#xA;    (call-function)&#xA;  (error&#xA;   (cleanup)&#xA;   (signal (car err) (cdr err)))) ; reraise `err'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-07-04T15:46:24.370" LastActivityDate="2015-07-04T15:46:24.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13712" PostTypeId="1" CreationDate="2015-07-04T15:45:56.057" Score="1" ViewCount="1049" Body="&lt;p&gt;I am trying to use org-mode to make a list of files to read, with links to pdfs and write the notes corresponding to it in one file. &#xA;Using &lt;a href=&quot;https://github.com/JayDugger/.emacs.d/tree/master/el-get/org-fstree&quot; rel=&quot;nofollow&quot;&gt;org-fstree&lt;/a&gt;, I can get list of all links as headlines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_FSTREE: ~/path/to/folder &#xA;&#xA;and pressing C-c C-c. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This list can be updated if files are added and removed by C-c C-c again. &#xA;However the problem is that this removes all the notes written. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to update this list while keeping all the annotations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or any other package or method to get list of all files with their annotations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I also tried org-annotate-file.el but that doesnt seem to work either.)&lt;/p&gt;&#xA;" OwnerUserId="2517" LastEditorUserId="2517" LastEditDate="2015-07-04T16:13:27.523" LastActivityDate="2015-07-09T14:21:05.447" Title="How to create list of links to files in a folder and annotate them using org-mode?" Tags="|org-mode|hyperlinks|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13713" PostTypeId="1" AcceptedAnswerId="13795" CreationDate="2015-07-04T18:16:58.847" Score="6" ViewCount="848" Body="&lt;p&gt;I have this setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ido-everywhere t)&#xA;(ido-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Well, of course there is more, but I believe that this is relevant portion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some time ago I wanted to have IDO for &lt;code&gt;dired-do-copy&lt;/code&gt; and &lt;code&gt;dired-do-rename&lt;/code&gt;&#xA;and someone on IRC &lt;code&gt;#emacs&lt;/code&gt; channel told me to add this to my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'dired-do-copy   'ido nil) ; use ido there&#xA;(put 'dired-do-rename 'ido nil) ; ^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;…it worked!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I would like to do the opposite: I need to completely disable IDO for&#xA;&lt;code&gt;dired-create-directory&lt;/code&gt;, because it doesn't make any sense there (but&#xA;&lt;code&gt;ido-everywhere&lt;/code&gt; activates it there).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I have some other stuff like &lt;code&gt;ido-ubiquitous&lt;/code&gt;, and &lt;code&gt;ido-hacks&lt;/code&gt;,&#xA;but I don't know if I should try to mess with these packages to do what I&#xA;want to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: how to disable IDO for &lt;code&gt;dired-create-directory&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attention of future readers&lt;/strong&gt;: @Drew's answer doesn't work, although it has been upvoted by people who didn't care to try it (including me). There are better (and more general) ways to do it, see below.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-08T13:15:24.313" LastActivityDate="2020-12-01T12:09:52.220" Title="How to disable IDO in ‘dired-create-directory’" Tags="|dired|ido|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13714" PostTypeId="2" ParentId="13712" CreationDate="2015-07-04T18:38:11.210" Score="1" Body="&lt;p&gt;Not too sure just what you mean by a &lt;em&gt;list of all files with their annotations&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can certainly create a &lt;em&gt;bookmark&lt;/em&gt; to a list of files (e.g. a Dired buffer, which can itself list any set of arbitrary files, from anywhere).  And you can &lt;em&gt;annotate&lt;/em&gt; a bookmark. (You can also bookmark individual files, of course, which means that you can annotate them individually.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then the annotation is in &lt;em&gt;Org mode&lt;/em&gt;, by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then it is easier to create a Dired buffer that lists arbitrary files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for some reason you don't want a Dired buffer, but just a list of file names with links to their files, you can use function &lt;code&gt;diredp-list-files&lt;/code&gt; (from &lt;em&gt;Dired+&lt;/em&gt;) to create it.  If you use &lt;em&gt;Bookmark+&lt;/em&gt; then you can bookmark that buffer.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-04T18:38:11.210" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13715" PostTypeId="1" AcceptedAnswerId="13734" CreationDate="2015-07-04T19:42:24.627" Score="13" ViewCount="2259" Body="&lt;p&gt;I've replaced &lt;code&gt;doc-view&lt;/code&gt; mode with &lt;code&gt;pdf-tools&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it's easy to set a mark on a page with the mouse, how do you do it with the keyboard?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The readme mentions the feature.&#xA;&quot;* Mark a region and kill the text from the PDF.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I've gotten is marking the whole page with &lt;code&gt;M-x pdf-view-mark-whole-page&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6682" LastActivityDate="2015-07-05T23:05:33.783" Title="mark text with keyboard in PDFView (pdf-tools) mode" Tags="|pdf|mark|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13716" PostTypeId="2" ParentId="13708" CreationDate="2015-07-04T21:18:35.717" Score="2" Body="&lt;pre&gt;&lt;code&gt;(defun translate (str alist)&#xA;  (replace-regexp-in-string&#xA;   (regexp-opt (mapcar 'car alist))&#xA;   (lambda (match)&#xA;     (cdr (assoc match alist)))&#xA;   str))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-07-04T21:18:35.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13717" PostTypeId="1" CreationDate="2015-07-04T21:58:58.857" Score="2" ViewCount="3473" Body="&lt;p&gt;I am trying to use Jabber to connect to Google Hangouts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My configuration looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq jabber-account-list '((&quot;[myusername]@gmail.com&quot;&#xA;                             (:network-server . &quot;talk.google.com&quot;)&#xA;                             (:connection-type . ssl))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I invoke &lt;code&gt;jabber-connect-all&lt;/code&gt; and type in my password, I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[myusername]@gmail.com: connection lost: `exited abnormally with code 1'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-07-05T22:01:05.443" Title="Cannot connect to Hangouts with Jabber" Tags="|jabber|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13719" PostTypeId="2" ParentId="7595" CreationDate="2015-07-04T23:04:51.350" Score="21" Body="&lt;p&gt;I now use &lt;code&gt;helm-ag&lt;/code&gt; to find all instances of the function name (searches in all files, incl. subdirs, not just in open buffers), and then I use &lt;code&gt;C-c C-e&lt;/code&gt; to enter a buffer that lists all the matches and there I change the function name. When I am done I press &lt;code&gt;C-c C-c (helm-ag--edit-commit)&lt;/code&gt; to store the changes to all the opened files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might sound confusing but please see &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/ShingoFukuyama/helm-swoop&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you grok it you will cry tears of joy that such wonderful functionality exists.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="11172" LastEditDate="2016-09-30T14:21:52.717" LastActivityDate="2016-09-30T14:21:52.717" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13720" PostTypeId="2" ParentId="13708" CreationDate="2015-07-04T23:45:43.060" Score="2" Body="&lt;p&gt;This was written late at night and requires more substantial testing, but it passes simple tests:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'strie)&#xA;&#xA;(defun my/translate (input substitutes)&#xA;  (let ((trie&#xA;         (cl-loop with trie = (strie-new)&#xA;                  for (prefix . replacement) in substitutes do&#xA;                  (strie-add trie prefix replacement)&#xA;                  finally (cl-return trie))))&#xA;    (cl-labels ((%child (trie s from to)&#xA;                        (strie-get-child trie (substring-no-properties s from to))))&#xA;      (with-output-to-string&#xA;        (cl-loop with i = 0 while (&amp;lt; i (length input)) do&#xA;                 (let ((match &#xA;                        (cl-loop with backtrack = nil&#xA;                                 for j from i below (length input)&#xA;                                 for child = (%child trie input j (1+ j))&#xA;                                 then (%child child input j (1+ j))&#xA;                                 do&#xA;                                 (cl-destructuring-bind (has-value value next)&#xA;                                     (or child '(nil nil nil))&#xA;                                   (when has-value&#xA;                                     (push (cons (substring-no-properties input i (1+ j)) value)&#xA;                                           backtrack))&#xA;                                   (unless next (cl-return (car backtrack))))&#xA;                                 finally (cl-return (car backtrack)))))&#xA;                   (if match&#xA;                       (progn&#xA;                         (princ (cdr match))&#xA;                         (cl-incf i (length (car match))))&#xA;                     (princ (substring-no-properties input i (1+ i)))&#xA;                     (cl-incf i))))))))&#xA;&#xA;(my/translate &quot;abcd-abc-ab-a&quot; '((&quot;abcd&quot; . &quot;1&quot;) (&quot;abc&quot; . &quot;2&quot;) (&quot;ab&quot; . &quot;3&quot;) (&quot;a&quot; . &quot;4&quot;)))&#xA;&#xA;&quot;1-2-3-4&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function will replace the longest possible match.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-04T23:45:43.060" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13721" PostTypeId="1" AcceptedAnswerId="13722" CreationDate="2015-07-04T23:52:20.020" Score="3" ViewCount="1824" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file I have the following line in &lt;code&gt;custom-set-variables&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(initial-buffer-choice &quot;~/Programming/C++/&amp;lt;some project I'm working on&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works great. However, I use emacs to edit lots of other files too. Before I inserted the above line in &lt;code&gt;custom-set-variables&lt;/code&gt;, I could specify the file I intended to edit from the command line. For example, when I intended to edit a file called &lt;code&gt;text_file.txt&lt;/code&gt;, I could type this command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs text_file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And emacs would startup with &lt;code&gt;text_file.txt&lt;/code&gt; as the selected buffer. Now that I've specified &lt;code&gt;initial-buffer-choice&lt;/code&gt;, regardless of what I say after &lt;code&gt;emacs&lt;/code&gt;, emacs will always open the file specified in &lt;code&gt;custom-set-variables&lt;/code&gt;, and &lt;em&gt;not&lt;/em&gt; the file specified at command line. For example, the command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs text_file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;now opens &lt;code&gt;~/Programming/C++/&amp;lt;some project I'm working on&amp;gt;&lt;/code&gt; instead of &lt;code&gt;text_file.txt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I over ride &lt;code&gt;initial-buffer-choice&lt;/code&gt; so when I do specify which file to open, that file will open?&lt;/p&gt;&#xA;" OwnerDisplayName="user8810" LastEditorUserId="105" LastEditDate="2015-07-05T00:06:26.177" LastActivityDate="2020-02-25T00:19:25.410" Title="How can I override initial-buffer-choice if I specify a filename at command line?" Tags="|init-file|customize|start-up|command-line-arguments|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13722" PostTypeId="2" ParentId="13721" CreationDate="2015-07-05T00:16:12.840" Score="1" Body="&lt;p&gt;What happens after Emacs opens to your choice of &lt;code&gt;initial-buffer-choice&lt;/code&gt;?  If you then use &lt;code&gt;C-x b&lt;/code&gt; do you see the file you specified on the command line as an available buffer to choose from?  And is it perhaps even the default (try &lt;code&gt;M-n&lt;/code&gt; to see if it gets pulled immediately to the minibuffer)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, then it sounds like Emacs is doing what you told it to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Visit the file you gave it on the command line.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Show the initial buffer that you chose.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And it's not hard to use &lt;code&gt;C-x b&lt;/code&gt;.  If the file in question comes up as the default buffer to switch to, things are easier still.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that is not what you see then this sounds like a bug to me. If you can repro the behavior starting from &lt;code&gt;emacs -Q&lt;/code&gt; (with any other specific switches and settings specified as part of the recipe), then consider filing a bug report: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note too that you can try setting &lt;code&gt;initial-buffer-choice&lt;/code&gt; to a &lt;em&gt;function&lt;/em&gt; that picks up a command-line file argument and uses that as the buffer to show.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-05T00:16:12.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13723" PostTypeId="1" CreationDate="2015-07-05T01:44:49.727" Score="1" ViewCount="437" Body="&lt;p&gt;I recently installed Graphviz and Cogre to make UML diagrams in Emacs. Though when I run cogre-uml-quick-class with the Class name, it says &quot;Layout engine failed. You need to install Graphviz&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is I have installed Graphviz and it is working properly, I have tried making sample graphs and compiling them in graphviz dot mode and I have graphviz-dot-mode.el in my load path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added this to my .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/cedet/srecode&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/cedet/cogre&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/graphviz-dot-mode-20150525.1000&quot;)&#xA;&#xA;(load-file &quot;~/.emacs.d/elpa/graphviz-dot-mode-20150525.1000/graphviz-dot-mode.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.4 on Windows 8.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cogre - &lt;a href=&quot;http://cedet.sourceforge.net/cogre.shtml&quot; rel=&quot;nofollow&quot;&gt;http://cedet.sourceforge.net/cogre.shtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Graphviz - &lt;a href=&quot;http://www.graphviz.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.graphviz.org/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8667" LastEditorUserId="8667" LastEditDate="2015-07-05T21:43:32.660" LastActivityDate="2015-07-05T21:43:32.660" Title="Cogre (CEDET) can't find Graphviz" Tags="|cedet|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13724" PostTypeId="1" CreationDate="2015-07-05T12:07:43.167" Score="7" ViewCount="3436" Body="&lt;p&gt;Of course I already know about &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/politza/pdf-tools&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am on Emacs 24.5.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not convinced that doc-view is using mudraw/mupdf for pdf files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'doc-view)&#xA;(print doc-view-pdfdraw-program)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;outputs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;mudraw&quot;&#xA;&quot;mudraw&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the following screenshot says otherwise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cJFnC.png&quot; alt=&quot;emacs doc-view vs zathura with mupdf&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs using doc-view on the left, zathura with mupdf backend on the right. Same pdf file, zoomed by hand to approximately the same level. The pdf is &lt;a href=&quot;http://projecteuclid.org/euclid.pjm/1102986512&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, in the sentence starting with &quot;For instance&quot; for example, the superscript p, and the subscript n are much clearer in zathura. In doc-view, the n in particular is barely readable, if at all, even at this level of zoom.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am obviously missing something, but not sure what.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq doc-view-pdf-&amp;gt;png-converter-invocation&#xA;      'doc-view-pdf-&amp;gt;png-converter-invocation-mupdf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13164&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13164&lt;/a&gt; does not seem to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;official documentation&lt;/a&gt; does not say much. Searching for answers comes up with that mupdf should be automatically used if it exists. I am on archlinux and have the official &lt;code&gt;ghostscript&lt;/code&gt; and &lt;code&gt;mupdf&lt;/code&gt; packages installed. The strange thing is &lt;code&gt;(print doc-view-pdfdraw-program)&lt;/code&gt; still outputs &lt;code&gt;&quot;mudraw&quot;&lt;/code&gt; even after I uninstall the official &lt;code&gt;mupdf&lt;/code&gt; package (and after restarting emacs), although this is likely irrelevant.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you the reader is successfully using mudraw/mupdf with doc-view, then perhaps you might want to download that pdf (and install zathura temporarily) and test out the quality you see in each program. If you see the same or similar thing as my screenshot, perhaps there is no problem here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps the mupdf being used by zathura &lt;em&gt;is&lt;/em&gt; actually different than the original one/the one doc-view uses. If I recall correctly, zathura uses its own slightly patched version of mupdf. However, my understanding was that zathura slightly patches it so that it works better with zathura itself, not necessarily patching the rendering parts themselves. &lt;a href=&quot;https://emacs.stackexchange.com/questions/5702/emacs-got-frozen-when-open-pdf-file#comment8658_5713&quot;&gt;This comment&lt;/a&gt; also seems to suggest that there should be very little, if any, differences between the rendering qualities (and speeds) between doc-view using mudraw/mupdf and zathura with mupdf backend.&lt;/p&gt;&#xA;" OwnerUserId="8693" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-07-05T13:16:17.503" Title="Make doc-view use mupdf for pdf files" Tags="|pdf|docview|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13725" PostTypeId="2" ParentId="13708" CreationDate="2015-07-05T12:16:51.397" Score="2" Body="&lt;p&gt;Conclusion so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;xuchunyang's &lt;code&gt;translate&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun translate (str alist)&#xA;  (dolist (cons alist str)&#xA;    (setq str (replace-in-string (car cons) (cdr cons) str))))&#xA;&#xA;(translate &quot;a b c&quot; '((&quot;a&quot; . &quot;b&quot;) (&quot;b&quot; . &quot;c&quot;) (&quot;c&quot; . &quot;d&quot;)))&#xA;&quot;d d d&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We could call this the &lt;em&gt;intrusive&lt;/em&gt; version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;politza's &lt;code&gt;translate&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun translate (str alist)&#xA;  (replace-regexp-in-string&#xA;   (regexp-opt (mapcar 'car alist))&#xA;   (lambda (match) (cdr (assoc match alist))) str))&#xA;&#xA;(translate &quot;a b c&quot; '((&quot;a&quot; . &quot;b&quot;) (&quot;b&quot; . &quot;c&quot;) (&quot;c&quot; . &quot;d&quot;)))&#xA;&quot;b c d&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We could call this the &lt;em&gt;non-intrusive&lt;/em&gt; version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;wxvxw's version is not included, mostly because I haven't installed trie. But it sounds as if his idea scales better (speed) in case of large/complex translation maps.&lt;/p&gt;&#xA;" OwnerUserId="8804" LastEditorUserId="8804" LastEditDate="2015-07-05T12:38:11.570" LastActivityDate="2015-07-05T12:38:11.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13726" PostTypeId="2" ParentId="13724" CreationDate="2015-07-05T13:08:24.140" Score="10" Body="&lt;p&gt;The default resolution is probably around 90 dpi.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'doc-view)&#xA;(setq doc-view-resolution 144)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Or set higher as you need.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may need to run &lt;code&gt;doc-view-clear-cache&lt;/code&gt; first for the change to be respected.&lt;/p&gt;&#xA;" OwnerUserId="8693" LastEditorUserId="8693" LastEditDate="2015-07-05T13:16:17.503" LastActivityDate="2015-07-05T13:16:17.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13727" PostTypeId="1" AcceptedAnswerId="13747" CreationDate="2015-07-05T14:11:18.750" Score="7" ViewCount="118" Body="&lt;p&gt;When performing &lt;code&gt;search/isearch&lt;/code&gt; in a text, sometimes it would be desirable to see a few lines after the highlighted searched string, it other words to avoid that the highlighted word to be at the  bottom of the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if we have the following text in a buffer, try to search the last word that you are able to see. For me it is the word &lt;em&gt;principles&lt;/em&gt; (as I have maximized the frame). The highlighted word (in my situation the word &lt;em&gt;principles&lt;/em&gt;) is at the bottom of the screen. I would like to see always  few lines (if possible) after the word &lt;em&gt;principles&lt;/em&gt; after searching.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Surrounded&#xA;occasional &#xA;pianoforte &#xA;alteration &#xA;unaffected &#xA;impossible &#xA;Perceived &#xA;knowledge &#xA;certainly &#xA;Although &#xA;moreover &#xA;mistaken &#xA;kindness &#xA;horrible &#xA;distance &#xA;marriage &#xA;country &#xA;demesne &#xA;Bachelor &#xA;domestic &#xA;extended &#xA;doubtful &#xA;Greatly &#xA;Improved &#xA;provided &#xA;Dwelling &#xA;speedily &#xA;ignorant &#xA;steepest &#xA;Admiration &#xA;instrument &#xA;affronting &#xA;invitation &#xA;reasonably &#xA;ecstatic &#xA;wondered &#xA;disposal &#xA;curiosity  &#xA;shameless &#xA;explained.&#xA;sincerity &#xA;extremity &#xA;additions &#xA;principles&#xA;Carriage &#xA;Remainder &#xA;household &#xA;direction &#xA;zealously &#xA;Sufficient &#xA;motionless&#xA;compliment &#xA;stimulated &#xA;assistance&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="50" LastEditDate="2015-07-05T18:48:10.293" LastActivityDate="2015-07-06T17:31:42.197" Title="When searching, how to always ensure that a few lines after the highlighted word are visible?" Tags="|search|isearch|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13728" PostTypeId="1" CreationDate="2015-07-05T20:13:53.127" Score="6" ViewCount="1965" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/13717/cannot-connect-to-hangouts-with-jabber&quot;&gt;This question&lt;/a&gt; asks how to connect to Google Hangouts with Jabber specifically, but I want to un-XY it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google has dropped support for XMPP and switched to &lt;a href=&quot;https://developers.google.com/+/hangouts/api/&quot; rel=&quot;noreferrer&quot;&gt;a proprietary protocol&lt;/a&gt;. Is there an existing package or combination of packages that allows Emacs to communicate through this protocol?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2024-03-25T00:00:55.223" Title="Chatting on Hangouts with Emacs" Tags="|integration|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13729" PostTypeId="1" AcceptedAnswerId="13730" CreationDate="2015-07-05T20:34:45.287" Score="29" ViewCount="3631" Body="&lt;p&gt;If you create a new directory, its files won't show up with &lt;strong&gt;magit-status&lt;/strong&gt;, only the new directory is in the list of &lt;em&gt;Untracked items&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have to &lt;strong&gt;magit-stage-item&lt;/strong&gt; the new directory and then remove unwanted files from the stage area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to choose which files to stage from a new directory?&lt;/p&gt;&#xA;" OwnerUserId="8563" LastEditorUserId="8563" LastEditDate="2015-07-05T20:47:51.577" LastActivityDate="2017-06-21T15:23:26.720" Title="Choose files to stage of a new directory with magit" Tags="|magit|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13730" PostTypeId="2" ParentId="13729" CreationDate="2015-07-05T21:01:06.967" Score="39" Body="&lt;p&gt;Run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git config status.showUntrackedFiles all&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or if you want to enable this in all repositories:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git config --global status.showUntrackedFiles all&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and refresh the status buffer. Initially you will still only see directories which contain untracked files, not the files themselves. But these directory sections can now be expanded using &lt;kbd&gt;TAB&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possible disadvantage of using &lt;code&gt;status.showUntrackedFiles all&lt;/code&gt; is &lt;a href=&quot;https://git-scm.com/docs/git-config#_variables&quot; rel=&quot;noreferrer&quot;&gt;a chance of slow performance&lt;/a&gt;, when using Git directly - Magit actually counteracts that.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-06-21T15:23:26.720" LastActivityDate="2017-06-21T15:23:26.720" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13731" PostTypeId="2" ParentId="13704" CreationDate="2015-07-05T21:41:41.647" Score="2" Body="&lt;p&gt;Assuming you use &lt;a href=&quot;http://melpa.org/#/expand-region&quot; rel=&quot;nofollow&quot;&gt;expand-region&lt;/a&gt;, when point is after a word you can just:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Press its binding (I use &lt;kbd&gt;M-SPC&lt;/kbd&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;M-w&lt;/kbd&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This also works if point is before or within the word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also repeat step 1 to mark semantically bigger chunks of text.&lt;/p&gt;&#xA;" OwnerUserId="849" LastActivityDate="2015-07-05T21:41:41.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13732" PostTypeId="2" ParentId="13717" CreationDate="2015-07-05T22:01:05.443" Score="1" Body="&lt;p&gt;You probably need to use &lt;code&gt;starttls&lt;/code&gt; instead. I use it and it works for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq jabber-account-list '((&quot;USERNAME@gmail.com/emacs&quot;&#xA;                             (:password . &quot;.....&quot;)&#xA;                             (:network-server . &quot;talk.google.com&quot;)&#xA;                             (:connection-type . starttls)&#xA;                             )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also had to go into my account settings and set up a special password for jabber, but that's because I use 2-factor authentication with Google. When you use 2-factor authentication, your regular password does not work for connecting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this won't let you do group chats (and obviously not calls), but regular chatting should work.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-07-05T22:01:05.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13733" PostTypeId="2" ParentId="13727" CreationDate="2015-07-05T22:58:59.247" Score="2" Body="&lt;p&gt;&lt;code&gt;M-x apropos-variable RET isearch.*\(hook\|function\) RET&lt;/code&gt; leads you to &lt;code&gt;isearch-update-post-hook&lt;/code&gt;, which seems to be what you're looking for. So ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'isearch-update-post-hook&#xA;          (lambda ()&#xA;            (when (&amp;gt; (length isearch-string) 0)&#xA;              ;;or whatever&#xA;              (recenter)))&#xA;          nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-07-05T22:58:59.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13734" PostTypeId="2" ParentId="13715" CreationDate="2015-07-05T23:05:33.783" Score="10" Body="&lt;p&gt;That would require some notion of a cursor, which is currently not implemented.  So marking by keyboard is not available (except the whole page).&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-07-05T23:05:33.783" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13735" PostTypeId="1" AcceptedAnswerId="13743" CreationDate="2015-07-06T05:14:14.827" Score="2" ViewCount="54" Body="&lt;p&gt;In notepad++, I could search a folder, and then click the match line to display the matched line of the corresponding buffer. How to do this in emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I can do now is to press &quot;ENTER&quot; on the matched line. But that moves the cursor to the other window with the matched data. But I don't want to move the cursor. Is this doable? Or anyway to click the matched line?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="115" LastEditDate="2015-07-06T13:23:38.533" LastActivityDate="2015-07-06T13:35:02.547" Title="In egrep, how to click a matched line and let it show the matched line in another buffer without moving the cursor" Tags="|compilation|rgrep|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13736" PostTypeId="1" CreationDate="2015-07-06T05:25:26.613" Score="4" ViewCount="2381" Body="&lt;p&gt;Did anyone use undo tree in spacemacs? I configured it in spacemacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-undo-tree-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it doens't work. how to let it work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows the error message of &#xA;&quot;unrecognized entry in undo list undo-tree-canary&quot;&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="6697" LastEditDate="2015-07-06T05:30:46.843" LastActivityDate="2016-01-25T10:53:52.653" Title="undo tree in spacemacs" Tags="|spacemacs|undo|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13737" PostTypeId="1" AcceptedAnswerId="13744" CreationDate="2015-07-06T07:39:01.603" Score="2" ViewCount="433" Body="&lt;p&gt;Since upgrading to Emacs 24.5 my init file does not load.  Starting with the &lt;code&gt;--debug-init&lt;/code&gt; option shows that &lt;code&gt;tramp-default-method-alist&lt;/code&gt; seems to be unbound:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable tramp-default-method-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I can find nothing in the online manual that suggests that this variable has been renamed or deprecated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact code in &lt;code&gt;init.el&lt;/code&gt; that is causing the error is as follows (except for the server name inside the first set of double quotes):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-default-method-alist&#xA;     '((regexp-quote &quot;foo.com&quot;) &quot;ssh&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My intent, if it isn't clear, is to set SSH as the TRAMP method for all servers &lt;code&gt;a.foo.com&lt;/code&gt;, &lt;code&gt;b.foo.com&lt;/code&gt;, etc.  (These are remote machines I have to connect to every day for my work; if I don't set &lt;code&gt;tramp-default-method-alist&lt;/code&gt; and don't specify &lt;code&gt;ssh&lt;/code&gt; explicitly in the string passed to &lt;code&gt;find-file&lt;/code&gt;, TRAMP defaults to &lt;code&gt;scp&lt;/code&gt; which is much slower than SSH on these servers for some reason.)&lt;/p&gt;&#xA;" OwnerUserId="2374" LastActivityDate="2015-07-06T13:36:56.447" Title="tramp-default-method-alist unbound at startup?" Tags="|init-file|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13738" PostTypeId="1" AcceptedAnswerId="13761" CreationDate="2015-07-06T08:04:58.700" Score="3" ViewCount="247" Body="&lt;p&gt;When using commands like &lt;code&gt;helm-in-buffer-headings&lt;/code&gt;, it would be much more readable to see output styled (and ideally even indented) like it is in the original document. Is there a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2015-07-07T03:26:46.643" Title="How do I get org-mode heading faces in helm" Tags="|org-mode|helm|faces|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13739" PostTypeId="2" ParentId="13738" CreationDate="2015-07-06T10:29:10.747" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/worf&quot; rel=&quot;nofollow noreferrer&quot;&gt;worf-goto&lt;/a&gt; can do this, with fontified and indented headings, as well as named blocks:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://oremacs.com/download/worf-goto.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I actually prefer the more generic and flexible&#xA;&lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;swiper&lt;/a&gt;, see&#xA;&lt;a href=&quot;https://oremacs.com/download/org-mode-swiper.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;screenshot&lt;/a&gt;, since&#xA;it goes through the whole buffer, not just the headings. With the&#xA;right query, there's only a few more matches then when looking at just&#xA;the headings.  But it works for everything, so if the thing that you&#xA;are looking for isn't in a heading, you can see that immediately.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.810" LastActivityDate="2015-07-06T10:29:10.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13740" PostTypeId="1" AcceptedAnswerId="13741" CreationDate="2015-07-06T11:34:14.763" Score="4" ViewCount="250" Body="&lt;p&gt;Is there a built-in boolean variable to determine if the cursor is at the end or the beginning of the line?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-07-06T11:42:05.850" Title="Is there a variable which determines if the cursor is at the end or the beginning of the line" Tags="|line-break|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13741" PostTypeId="2" ParentId="13740" CreationDate="2015-07-06T11:42:05.850" Score="6" Body="&lt;p&gt;You want the functions &lt;code&gt;bolp&lt;/code&gt; and &lt;code&gt;eolp&lt;/code&gt; for beginning and end, respectively.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-06T11:42:05.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13742" PostTypeId="2" ParentId="13656" CreationDate="2015-07-06T12:16:34.060" Score="2" Body="&lt;p&gt;This seems to do what you have asked. By contrast if there is already extra white spaces, it keeps them as before.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (defun yank-and-adjust-whitespace ()&#xA;  (interactive)&#xA;  (if (equal (char-after) ?\s)&#xA;      (progn&#xA;        (insert &quot; &quot;)&#xA;        (yank))&#xA;    (if (eolp) (if (bolp) (yank)&#xA;        (if (equal (char-before) ?\s)&#xA;            (yank)&#xA;          (insert &quot; &quot;)&#xA;          (yank)))&#xA;      (yank)&#xA;      (insert &quot; &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Like the answer of Eric Bailey you can associate the below shortcut.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;\C-y&quot; 'yank-and-adjust-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;eolp/bolp&lt;/code&gt; was borrowed from &lt;a href=&quot;https://emacs.stackexchange.com/a/13741/&quot;&gt;https://emacs.stackexchange.com/a/13741/&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-07-06T13:32:46.613" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13743" PostTypeId="2" ParentId="13735" CreationDate="2015-07-06T13:35:02.547" Score="1" Body="&lt;p&gt;You can make the process of reviewing the grep matches smoother by using the emacs way of interacting with the &lt;code&gt;*Compilation*&lt;/code&gt; family of buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution does not specifically solve your question on how to show the matched line &lt;em&gt;without moving the cursor&lt;/em&gt; but it helps you navigate the &lt;em&gt;grep&lt;/em&gt; results as probably intended in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Run grep using &lt;code&gt;M-x grep&lt;/code&gt;. For the sake of example, let's say you are running &lt;em&gt;grep&lt;/em&gt; in your &lt;code&gt;~/.emacs.d/&lt;/code&gt; and you enter the grep arguments as &lt;code&gt;require *.el&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Now here are few default bindings and commands that will help you navigate the results in a convenient manner &lt;strong&gt;while the point is in the actual file buffer on the matched line&lt;/strong&gt;:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x next-error&lt;/code&gt; to navigate to the next grep result. The default bindings are &lt;code&gt;M-g M-n&lt;/code&gt; or &lt;code&gt;C-x `&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x previous-error&lt;/code&gt; to navigate to the previous grep result. The default binding is &lt;code&gt;M-g M-p&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x first-error&lt;/code&gt; to navigate to the first grep result.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do not be confused by the term 'error' in the functions above. It is a generic term used in *Compilation* buffers.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-07-06T13:35:02.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13744" PostTypeId="2" ParentId="13737" CreationDate="2015-07-06T13:36:56.447" Score="5" Body="&lt;p&gt;I would recommend &lt;code&gt;(require 'tramp)&lt;/code&gt; in your &lt;code&gt;init.el&lt;/code&gt;, just prior the lines you have shown.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-07-06T13:36:56.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13745" PostTypeId="2" ParentId="10717" CreationDate="2015-07-06T14:27:17.710" Score="3" Body="&lt;p&gt;@Tyler suggested that Helm could be simply disabled for &lt;code&gt;reftex-citation&lt;/code&gt;. After a bit of digging, I found that this can be done by modifying the &lt;code&gt;helm-completing-read-handlers-alist&lt;/code&gt; variable. I would recommend reading the documentation on it (using &lt;code&gt;C-h v helm-completing-read-handlers-alist&lt;/code&gt;), but adding this line to you &lt;code&gt;init.el&lt;/code&gt; file will do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'helm-mode '(add-to-list &#xA;    'helm-completing-read-handlers-alist '(reftex-citation . nil) )&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this line included, &lt;code&gt;reftex-citation&lt;/code&gt; should run without deferring to &lt;code&gt;helm&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="8486" LastEditorUserId="8486" LastEditDate="2015-07-06T14:32:24.933" LastActivityDate="2015-07-06T14:32:24.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13746" PostTypeId="2" ParentId="13636" CreationDate="2015-07-06T16:28:26.387" Score="1" Body="&lt;p&gt;Just add this to your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'magit-popup-mode-hook&#xA;          (lambda ()&#xA;             (evil-local-mode 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That will disable Evil just for that mode.&lt;/p&gt;&#xA;" OwnerUserId="8820" LastActivityDate="2015-07-06T16:28:26.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13747" PostTypeId="2" ParentId="13727" CreationDate="2015-07-06T16:39:55.420" Score="5" Body="&lt;pre&gt;&lt;code&gt;(setq scroll-margin 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works everywhere, not just during &lt;code&gt;isearch&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Scrolling.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;scroll-margin&lt;/code&gt;&lt;/a&gt;. &lt;em&gt;Default: 0. Number of lines of margin at the top and bottom of a window.&#xA;Recenter the window whenever point gets within this many lines&#xA;of the top or bottom of the window.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="8821" LastEditorUserId="8821" LastEditDate="2015-07-06T17:31:42.197" LastActivityDate="2015-07-06T17:31:42.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13748" PostTypeId="1" CreationDate="2015-07-06T17:13:09.767" Score="-1" ViewCount="84" Body="&lt;p&gt;I'm working on a couple of XML-format major modes, both of which are derived modes based on nXML, and I cannot get Emacs to display the mode names -- either in the minibuffer or in the buffer-list pop-up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything I've read suggests that setting the mode name should work with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode fontfile-ttx-mode nxml-mode &quot;FontTools TTX&quot;&#xA;  &quot;Major mode for editing FontTools TTX files.&quot;&#xA;;; [... eliding other simple stuff ...]&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the minibuffer still shows (nXML Valid) ....  In addition, the buffer menu pop-up labels buffers using this mode as 'SGML'. I also saw a suggestion to add an explicit name line, a la:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setq mode-name &quot;FontTools TTX&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that changes nothing.  The TTX example is just one; I would like both of my nXML-derived modes to be labeled correctly (ie, not lumped together as SGML) so that the user can easily distinguish between them.  And, of course, I just want to figure out what the problem is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These approaches work fine with modes derived from fundamental mode; is something else going on just for an nXML-derived mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8790" LastActivityDate="2015-10-04T19:54:06.317" Title="How to specify the mode-name displayed in the buffer pop-up list?" Tags="|major-mode|nxml|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13749" PostTypeId="2" ParentId="13748" CreationDate="2015-07-06T18:14:15.477" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The question is not clear.  I think perhaps you mean &quot;mode-line&quot; when you say &quot;minibuffer&quot;.  If so, please edit the question to make it clear.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Evaluating the code you presented, and then using it by &lt;code&gt;M-x fontfile-ttx-mode&lt;/code&gt;, I do not see a problem with the major-mode lighter in the mode line.  It says &lt;code&gt;FontTools TTX&lt;/code&gt;.  And that is the value of variable &lt;code&gt;mode-name&lt;/code&gt; - there is no need to set it separately. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It's also not clear what you mean by &quot;the buffer-list pop-up&quot; and &quot;the buffer pop-up list&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I suspect that you are not telling us everything.  Please clarify the question, or it risks being closed as unclear.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-06T18:14:15.477" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13750" PostTypeId="1" AcceptedAnswerId="13783" CreationDate="2015-07-06T19:34:12.570" Score="3" ViewCount="556" Body="&lt;p&gt;I want to run IPython in emacs for all the emacsy goodness I get, but I'm having a problem getting the buffer to automatically truncate (it gets slow quickly printing large dataframes and such).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be nice to have my &lt;code&gt;run on save&lt;/code&gt; test runners in emacs, but for that I would need the window to be automatically cropped at say 1000 lines. How do I do that?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2015-07-06T19:52:27.320" LastActivityDate="2015-07-07T20:01:40.237" Title="How do I automatically truncate a growing buffer?" Tags="|buffers|window|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13751" PostTypeId="2" ParentId="13713" CreationDate="2015-07-06T20:12:32.600" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice dired-create-directory (around inhibit-ido activate)&#xA;  &quot;Turn off Ido mode for the duration, then turn it on.&quot;&#xA;  (unwind-protect&#xA;       (progn (ido-everywhere -1) ad-do-it)&#xA;    (ido-everywhere 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you aren't sure you always want &lt;code&gt;ido-everywhere&lt;/code&gt; mode turned on at the end, then you can do this instead - it keeps it on or off, as it was before using &lt;code&gt;dired-create-directory&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice dired-create-directory (around inhibit-ido activate)&#xA;  &quot;Inhibit Ido for the duration.&quot;&#xA;  (let ((orig-ido-everywhere  ido-everywhere))&#xA;    (unwind-protect&#xA;        (progn (ido-everywhere -1) ad-do-it)&#xA;      (when orig-ido-everywhere (ido-everywhere 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-06T20:26:42.677" LastActivityDate="2015-07-06T20:26:42.677" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13752" PostTypeId="1" AcceptedAnswerId="13756" CreationDate="2015-07-06T21:32:45.813" Score="0" ViewCount="95" Body="&lt;p&gt;I have been noticing two rather &quot;strange&quot; text elements in Emacs which occur when I copy text. I am certain they signify something/have a special formatting purpose, but I am unable to find anything on the web. The first one is a blue dash and the second one a purple box. Since images are more illuminating here, I have created a screenshot:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/kOEpS.png&quot; alt=&quot;bizarre text elements&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please forgive me my terrible editing skills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know whether it is possible to find all of these elements (they are recurring) by way of search/replace-string to eliminate them effectively? Otherwiese I cannot include them in LaTeX documents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best&lt;/p&gt;&#xA;" OwnerUserId="8824" LastActivityDate="2015-07-06T22:33:27.867" Title="Unusual character elements" Tags="|terminal-emacs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13753" PostTypeId="1" AcceptedAnswerId="13769" CreationDate="2015-07-06T21:37:26.777" Score="7" ViewCount="686" Body="&lt;p&gt;Is there a way to insert relevant entries from the ChangeLog into the Magit commit message? I'm thinking of how the built-in Emacs VC's C-c C-a (log-edit-insert-changelog) command works.&lt;/p&gt;&#xA;" OwnerUserId="8639" LastActivityDate="2015-07-07T09:07:57.767" Title="Insert ChangeLog entries in commit message?" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13754" PostTypeId="2" ParentId="12823" CreationDate="2015-07-06T21:45:37.693" Score="1" Body="&lt;p&gt;I don't think this is possible from within Emacs.  The problem is that as soon as you click in the frame, the window manager selects that frame. Emacs thus sees it immediately as the selected frame.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your own test code shows this.  No advising of either &lt;code&gt;mouse-drag-region&lt;/code&gt; or &lt;code&gt;mouse-set-point&lt;/code&gt; (or any other Emacs function) will make any difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Perhaps there is something you can do at the X11 level - dunno.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-06T21:45:37.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13755" PostTypeId="2" ParentId="13752" CreationDate="2015-07-06T21:47:29.863" Score="0" Body="&lt;p&gt;You can figure out what a character is by placing the point on that character and doing &lt;code&gt;M-x describe-character&lt;/code&gt; or &lt;code&gt;C-u C-x =&lt;/code&gt; (default binding).&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-07-06T21:47:29.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13756" PostTypeId="2" ParentId="13752" CreationDate="2015-07-06T22:33:27.867" Score="0" Body="&lt;p&gt;@kaushalmodi gave a good answer for finding out what those characters (or even what those display artifacts) are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that indicates that they are indeed characters (and not just display artifacts), then you can use command &lt;code&gt;query-replace&lt;/code&gt; or &lt;code&gt;replace-string&lt;/code&gt; to replace them: just copy the character that you want to replace (select it, then use &lt;code&gt;M-w&lt;/code&gt;), and paste (use &lt;code&gt;C-y&lt;/code&gt;) to the first prompt of the search-and-replace function.  Paste or type the character that you want to replace it with to the second prompt (for the replacement text).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the character is, say, a Unicode em-dash character (Unicode code point U+2014), then you might want to replace it with an ordinary hyphen character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the character is, say, an em dash, then when you put the cursor in front of it and hit &lt;code&gt;C-u C-x =&lt;/code&gt; you will see something like this near the bottom of buffer &lt;code&gt;*Help*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Character code properties: customize what to show&#xA;  name: EM DASH&#xA;  general-category: Pd (Punctuation, Dash)&#xA;  decomposition: (8212) ('—')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-06T22:33:27.867" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13757" PostTypeId="1" AcceptedAnswerId="13759" CreationDate="2015-07-06T22:42:16.703" Score="7" ViewCount="1626" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get a visual indicator distinguishing between the end of the buffer and the bottom of the window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use case: I've got a buffer with some blank lines at the bottom.  However, the bottom of the &lt;em&gt;window&lt;/em&gt; beyond the blank lines is also, well, blank.  I'd like to be able to tell, visually, where the buffer ends/blank lines stop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vim does this with &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/syntax.html#hl-NonText&quot; rel=&quot;noreferrer&quot;&gt;non-text characters&lt;/a&gt; at the bottom of a window (ie, the tildes) to indicate that there is nothing in the buffer (such as of blank lines) in that space, as in the screenshot below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TZwCN.jpg&quot; alt=&quot;Vim tildes&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one get the analog of this Vim feature in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; @glucas's answer looks correct, but I'd love to see an answer that does not use the fringe, as I set mine to nil to save screen space on a small laptop screen.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-07-07T10:43:34.487" LastActivityDate="2015-07-08T04:23:55.557" Title="Distinguish between blank lines at end of buffer and bottom of window?" Tags="|faces|display|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13758" PostTypeId="1" AcceptedAnswerId="14048" CreationDate="2015-07-06T23:33:05.210" Score="5" ViewCount="550" Body="&lt;p&gt;I want to tell epa to encrypt for &lt;em&gt;two&lt;/em&gt; of my public keys. (stored in two different places). I have this at the top of the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode:org; epa-file-encrypt-to: (&quot;arthur@ul___dt.com&quot;) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which causes it to select the first &lt;em&gt;one&lt;/em&gt; key for that email. If i run &lt;code&gt;epa-file-select-keys&lt;/code&gt; I can choose the two keys I want, though only for that session. I would prefer it remember this decision in the file so I don't have to remember to do this each time on each new computer this file is opened on.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How can I specify two keys by key-id on that line?&lt;/li&gt;&#xA;&lt;li&gt;What is the &lt;b&gt;actual syntax of the strings in the epa-file-encrypt-to&lt;/b&gt; variable? Is it defined somewhere? How are specific keys selected from this string&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;PS: these keys have the same user-id string and I'd prefer not to have to change that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PPS: there is also a revoked key with the same email that it needs to not choose. I have tried on emacs 24.3.1 and emacs 25-snapshot&lt;/p&gt;&#xA;" OwnerUserId="8827" LastEditorUserId="8827" LastEditDate="2015-07-13T22:16:24.587" LastActivityDate="2020-12-02T23:25:54.913" Title="EPA (EasyPG Assistant): How to encrypt for *two* of my own keys? OR How are key-ids used to select keys" Tags="|gpg|epa|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13759" PostTypeId="2" ParentId="13757" CreationDate="2015-07-06T23:53:40.770" Score="8" Body="&lt;p&gt;You can customize &lt;code&gt;indicate-empty-lines&lt;/code&gt; to enable a fringe marker on lines after the end of the file, or call &lt;code&gt;toggle-indicate-empty-lines&lt;/code&gt; to turn it on and off interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a package on MELPA that replaces the default fringe indicator with a ~ for a look that is closer to what you get with vi. See &lt;code&gt;vi-tilde-fringe&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Updated&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative approach would be to use whitespace mode to make line breaks visible. Try &lt;code&gt;whitespace-newline-mode&lt;/code&gt;, possibly tweaking the &lt;code&gt;whitespace-newline&lt;/code&gt; face. Visually this approach is busier then what vi does since you're marking all lines in the buffer &lt;em&gt;except&lt;/em&gt; the empty lines after the content, but it achieves a similar result. (It may also be possible to configure whitespace mode or a custom derived mode to only highlight empty lines at the end of the buffer content.)&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-07-07T15:55:14.837" LastActivityDate="2015-07-07T15:55:14.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13761" PostTypeId="2" ParentId="13738" CreationDate="2015-07-07T03:26:46.643" Score="0" Body="&lt;p&gt;Update your emacs packages and it should work!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I'm not sure exactly what did it, but I just updated a number of packages, including &lt;code&gt;helm&lt;/code&gt; and &lt;code&gt;org&lt;/code&gt;, and now headings are colored and formatted in a very helpful way (same font face as an org buffer). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current versions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;helm&lt;/code&gt;: 20150706.633&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org&lt;/code&gt;: 20150706&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you know the exact cause, feel free to edit this answer, or write a new one and I'll accept it instead. But regardless I hope this is helpful for those who face the same problem.&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2015-07-07T03:26:46.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13762" PostTypeId="2" ParentId="13443" CreationDate="2015-07-07T03:43:03.157" Score="0" Body="&lt;p&gt;I am not sure why there is a difference between your single-line comment and multi-line comment examples, but my assumption is that it is not a bug - at least the &quot;E302 expected 2 blank lines, found 0&quot; part shouldn't be. If there is a bug, it is likely that the E302 should show up in both cases, rather than just the multiline version. Flake8 is meant to help you get &lt;a href=&quot;https://www.python.org/dev/peps/pep-0008/&quot; rel=&quot;nofollow&quot;&gt;PEP8&lt;/a&gt; compliant, and PEP8 stipulates that you should &lt;a href=&quot;https://www.python.org/dev/peps/pep-0008/#blank-lines&quot; rel=&quot;nofollow&quot;&gt;&quot;(s)urround top-level function and class definitions with two blank lines&quot;.&lt;/a&gt; So this is why you are seeing the message you are seeing in the multi-line comment case. Try your second example as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# comment comment comment comment comment comment comment comment&#xA;# comment comment&#xA;&#xA;&#xA;class Foo(object):&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or better yet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;&#xA;comment comment comment comment comment comment comment comment&#xA;comment comment&#xA;&quot;&quot;&quot;&#xA;&#xA;&#xA;class Foo(object):&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I assume you won't get the message.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-07-07T03:43:03.157" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13763" PostTypeId="1" AcceptedAnswerId="13770" CreationDate="2015-07-07T06:28:32.943" Score="6" ViewCount="1269" Body="&lt;p&gt;With evil-mode, I found myself pressing escape very often, but it's a bit far to reach. Also, it seems semantic wise, keyboard-quit is similar to evil-force-normal-state, so I would like to use C-g for both of them with the following conditional logic that &#xA;Only when cursor is a buffer with evil-mode's insert state, then C-g should execute evil-force-normal-state, other it should execute its normal binding of keyboard-quit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that there might be a sub-key-map for evil with insert state? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have ready example, I'd appreciate your sharing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime, I'll check the possibility of customizing the key-binding with evil's input state. I'm studying &lt;a href=&quot;https://emacs.stackexchange.com/questions/10856/how-do-i-set-up-key-bindings-for-modes-in-a-specific-evil-state&quot;&gt;this link&lt;/a&gt; now:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following, but it didn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'insert evil-insert-state-map (kbd &quot;C-g&quot;) 'evil-normal-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'insert evil-insert-state-map (kbd &quot;C-g&quot;) 'evil-force-normal-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;C-g still executes keyboard-quit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that I can use key-chord to execute evil-force-normal-state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define evil-normal-state-map &quot;,,&quot; 'evil-force-normal-state)&#xA;(key-chord-define evil-visual-state-map &quot;,,&quot; 'evil-change-to-previous-state)&#xA;(key-chord-define evil-insert-state-map &quot;,,&quot; 'evil-normal-state)&#xA;(key-chord-define evil-replace-state-map &quot;,,&quot; 'evil-normal-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks, &lt;/p&gt;&#xA;" OwnerUserId="6845" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-07-13T09:46:38.270" Title="How can I make C-g run both evil-force-normal-state and keyboard-quit?" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13764" PostTypeId="1" AcceptedAnswerId="13768" CreationDate="2015-07-07T06:52:59.363" Score="2" ViewCount="316" Body="&lt;p&gt;magit-diff displays a buffer, which lists all files, which differ between the two revisions one is looking at. In v1.4 it was possible to type 'e' on each of these lines or inside the diff part to call magit-ediff for this file. Somehow this functionality seems to have disappeared in v2.1. Is there any way to resurrect this?&lt;/p&gt;&#xA;" OwnerUserId="2415" LastActivityDate="2015-07-07T18:49:41.507" Title="ediff from within magit-diff lost in v2.1" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13765" PostTypeId="1" AcceptedAnswerId="13766" CreationDate="2015-07-07T07:28:50.210" Score="2" ViewCount="538" Body="&lt;p&gt;In &lt;code&gt;python.el&lt;/code&gt; there is a command &lt;code&gt;(python-shell-switch-to-shell)&lt;/code&gt; that opens an ipython shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem is, it first asks me where to start the REPL and then whether to make a dedicated process. I always answer &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;. Is there a way to send these signals to emacs automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know there are other workarounds, but modifying the &lt;code&gt;python layer&lt;/code&gt; in spacemacs is probably too much of a bother.)&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2015-07-07T07:41:52.203" Title="Automatically pressing enter and y in emacs when prompted for input" Tags="|python|keystrokes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13766" PostTypeId="2" ParentId="13765" CreationDate="2015-07-07T07:41:52.203" Score="2" Body="&lt;p&gt;I don't get this behavior when I tried running this, but a simple thing to try is &lt;code&gt;C-x (&lt;/code&gt; or &lt;code&gt;kmacro-start-macro&lt;/code&gt;. Then enter the three commands, &lt;code&gt;(python-shell-switch-to-shell)&lt;/code&gt; &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt;, and &lt;code&gt;y&lt;/code&gt; and finish up with &lt;code&gt;C-x )&lt;/code&gt; or &lt;code&gt;kmacro-end-macro&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the future you can run &lt;code&gt;C-x e&lt;/code&gt; to redo that key sequence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all that works, then you may want ot go one step further and &lt;code&gt;M-x name-last-kbd-macro&lt;/code&gt; will assign a name it, and write it out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Keyboard-Macro.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Keyboard-Macro.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5163" LastActivityDate="2015-07-07T07:41:52.203" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13767" PostTypeId="2" ParentId="6083" CreationDate="2015-07-07T08:22:49.287" Score="76" Body="&lt;p&gt;You can split hunks with Magit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of just leaving the cursor inside the hunk, select the lines you want to stage from the hunk and press &lt;strong&gt;s&lt;/strong&gt;.&#xA;Only the selected part of the hunk will be staged, whereas the rest of the hunk still sits in the unstaged area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That way you splitted it into two.&#xA;I think you can use the same mechanism for moving parts of hunks into the stash.&#xA;When using &lt;strong&gt;k&lt;/strong&gt; you will just purge part of hunk.&lt;/p&gt;&#xA;" OwnerUserId="8828" LastActivityDate="2015-07-07T08:22:49.287" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13768" PostTypeId="2" ParentId="13764" CreationDate="2015-07-07T08:50:35.920" Score="3" Body="&lt;p&gt;&lt;em&gt;At the time this question was asked, dwimming did not work inside &lt;code&gt;magit-diff-mode&lt;/code&gt; buffers. The problem wasn't in Magit's Ediff code, all the necessary bits were there, but the low-level function &lt;code&gt;magit-diff-type&lt;/code&gt;, which is also used by a lot of other code, was a bit lazy inside &lt;code&gt;magit-diff-mode&lt;/code&gt; buffers and just said &lt;code&gt;undefined&lt;/code&gt;. Anyway...&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can initiate an Ediff session from within a &lt;code&gt;magit-diff-mode&lt;/code&gt; buffer now. &lt;code&gt;magit-ediff-dwim&lt;/code&gt; should be able to determine what Ediff variant should be used. It detects when to use a staging session and when to use a compare session. If point is on a file, then it will a create a session for that file.  Otherwise it will ask for a file (unfortunately all files will be offered as completion candidates, not just those that were modified in the range).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If that doesn't match your experience, then please let me know.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-07T18:49:41.507" LastActivityDate="2015-07-07T18:49:41.507" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="13769" PostTypeId="2" ParentId="13753" CreationDate="2015-07-07T09:07:57.767" Score="7" Body="&lt;p&gt;Yes, but it's not very good. While you are writing a commit message, switch to the diff buffer and then press &lt;kbd&gt;C&lt;/kbd&gt; on a hunk whose changes you want to describe. Then repeat for all such hunks... I said it wasn't very good.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-07-07T09:07:57.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13770" PostTypeId="2" ParentId="13763" CreationDate="2015-07-07T10:39:39.367" Score="6" Body="&lt;p&gt;If you'd like a command that detects your evil state and behaves contextually, you can use an &lt;code&gt;if&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun quit-it ()&#xA;  &quot;If in evil insert state, force normal state, else run&#xA;`keyboard-quit'.&quot;&#xA;  (interactive)&#xA;  (if (and evil-mode (eq evil-state 'insert))&#xA;      (evil-force-normal-state)&#xA;    (keyboard-quit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, you may want to be able to do that when you get into some of the other evil keymaps, and there's no particular harm that I can see to forcing normal state elsewhere, so you could probably say:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun evil-keyboard-quit ()&#xA;  &quot;Keyboard quit and force normal state.&quot;&#xA;  (interactive)&#xA;  (and evil-mode (evil-force-normal-state))&#xA;  (keyboard-quit))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now go ahead and bind it in the relevant maps:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map   (kbd &quot;C-g&quot;) #'evil-keyboard-quit) &#xA;(define-key evil-motion-state-map   (kbd &quot;C-g&quot;) #'evil-keyboard-quit) &#xA;(define-key evil-insert-state-map   (kbd &quot;C-g&quot;) #'evil-keyboard-quit) &#xA;(define-key evil-window-map         (kbd &quot;C-g&quot;) #'evil-keyboard-quit) &#xA;(define-key evil-operator-state-map (kbd &quot;C-g&quot;) #'evil-keyboard-quit) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-07-13T09:46:38.270" LastActivityDate="2015-07-13T09:46:38.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13771" PostTypeId="2" ParentId="13757" CreationDate="2015-07-07T12:27:53.263" Score="4" Body="&lt;p&gt;Someone wrote a package that manages an overlay spanning the area after the end of the file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jmickelin/vim-empty-lines-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jmickelin/vim-empty-lines-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind though that while this solution behaves more correctly and works in terminals as well, it will necessarily be less performant and more buggy than the fringe indicator one.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-07-07T12:33:06.177" LastActivityDate="2015-07-07T12:33:06.177" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13772" PostTypeId="1" AcceptedAnswerId="13776" CreationDate="2015-07-07T14:16:20.103" Score="10" ViewCount="1308" Body="&lt;p&gt;When calling &lt;code&gt;magit-push-current&lt;/code&gt; with &lt;code&gt;P P&lt;/code&gt; from the status buffer, &lt;code&gt;Magit 2.1.0&lt;/code&gt; asks me where to push the branch on the first time, when upstream is not set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can it let automatically generate the name as it used to do before?&lt;/p&gt;&#xA;" OwnerUserId="8833" LastEditorUserId="306" LastEditDate="2015-08-31T23:46:10.550" LastActivityDate="2017-02-22T15:54:40.690" Title="How to prevent Magit from asking where to push a branch?" Tags="|magit|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13773" PostTypeId="2" ParentId="13757" CreationDate="2015-07-07T14:26:45.270" Score="4" Body="&lt;p&gt;I've written a package, &lt;a href=&quot;https://github.com/Lindydancer/char-font-lock&quot; rel=&quot;nofollow noreferrer&quot;&gt;char-font-lock&lt;/a&gt;, that (among else) highlight empty lines at the end of a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also highlights the last line (in case it doesn't end with a newline), space at the end of lines, tab characters, and non-ascii characters. You can cherry pick which of the things you would like to highlight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/B7LRo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-07-08T04:23:55.557" LastActivityDate="2015-07-08T04:23:55.557" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13774" PostTypeId="2" ParentId="13699" CreationDate="2015-07-07T14:31:21.073" Score="2" Body="&lt;p&gt;To highlight after each switch, even when the hydra hasn't exited yet, you can use this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defhydra windows (global-map &quot;C-c w&quot;&#xA;                   :after-exit flash-active-buffer)&#xA;  &quot;window moving&quot;&#xA;  (&quot;o&quot; other-window &quot;other&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another approach, which I think is actually better, since it's more straight forward:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defhydra windows (global-map &quot;C-c w&quot;)&#xA;  &quot;window moving&quot;&#xA;  (&quot;o&quot;&#xA;   (progn&#xA;     (other-window 1)&#xA;     (flash-active-buffer)) &quot;other&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A lot of similar info is summarized on the &lt;code&gt;internals&lt;/code&gt; wiki page, &lt;a href=&quot;https://github.com/abo-abo/hydra/wiki/internals#after-exit&quot; rel=&quot;nofollow&quot;&gt;:after-exit&lt;/a&gt; is there as well.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-07T14:31:21.073" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13775" PostTypeId="1" CreationDate="2015-07-07T15:30:22.117" Score="1" ViewCount="48" Body="&lt;p&gt;There are commands which take multiple inputs. My question is about the possibility of defining a new command which take all the inputs of another command at one time (separated by commas).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an explicit example, after activating calendar (by &lt;code&gt;M-x calendar&lt;/code&gt;), if one executes the command &lt;code&gt;M-x calendar-goto-date&lt;/code&gt;, then it asks the &lt;code&gt;year&lt;/code&gt; (put 2017), then the &lt;code&gt;Month name&lt;/code&gt; (put July), then the &lt;code&gt;day&lt;/code&gt; (put 7). It would be nice to give these inputs at one time like &lt;code&gt;2017,July,7&lt;/code&gt;. This is just an example, the question also arises in other situations.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-07-07T15:55:50.790" LastActivityDate="2015-07-07T15:55:50.790" Title="How to give all inputs of a multiple inputs command at one time" Tags="|inputs|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13776" PostTypeId="2" ParentId="13772" CreationDate="2015-07-07T15:44:01.287" Score="8" Body="&lt;p&gt;&lt;em&gt;Update: The &quot;push branch&quot; mentioned below has been implemented by now.See the &lt;a href=&quot;https://magit.vc/manual/magit/Branching.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation about branching&lt;/a&gt; for more information.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to set the upstream branch once. Once you have done that &lt;kbd&gt;P P&lt;/kbd&gt; pushes to that &lt;em&gt;and&lt;/em&gt; you will get lists of unpulled and unpushed changes in the status buffer (provided there are any).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various ways to set the upstream branch. You could use the &lt;code&gt;--set-upstream&lt;/code&gt; switch from the push popup: &lt;kbd&gt;P -u P&lt;/kbd&gt;. Or use the command which sets the upstream and does nothing else: &lt;kbd&gt;b u&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also Magit now automatically sets the upstream branch when creating a new branch, provided the &quot;starting point&quot; is a branch name. This works for local and remote &quot;upstreams&quot;. But note that if you pick a local branch as the starting point, then that won't help you with pushing. Pushing from the current repository to the current repository obviously doesn't make sense, and is disallowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when the &quot;upstream&quot; branch is in fact another local branch, then &lt;kbd&gt;P P&lt;/kbd&gt; behaves as if no upstream branch were configured, and behaves exactly like &lt;kbd&gt;P e&lt;/kbd&gt;. The same is the case if no upstream is configured at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This due to a limitation in Git: one can only associate &lt;em&gt;one&lt;/em&gt; other branch with some branch, and that branch is then called the &quot;upstream branch&quot;. It would be better if there were at least an &quot;upstream&quot; and a &quot;publish&quot; branch. I intend to implement that in Magit eventually. See issue &lt;a href=&quot;https://github.com/magit/magit/issues/1485&quot; rel=&quot;nofollow noreferrer&quot;&gt;#1485&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to be able to push with just &lt;kbd&gt;P P&lt;/kbd&gt; then the &quot;upstream&quot; branch has to be e.g. &quot;origin/master&quot;, not &quot;master&quot;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am considering adding a push variant which always runs just &lt;code&gt;git push&lt;/code&gt; without any arguments. What that does would then depend exclusively on Git configuration.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-02-22T15:54:40.690" LastActivityDate="2017-02-22T15:54:40.690" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13777" PostTypeId="1" CreationDate="2015-07-07T16:35:08.563" Score="14" ViewCount="172" Body="&lt;p&gt;From time to time I happen to &lt;code&gt;M-! some_command&lt;/code&gt; just to find that the command runs longer than I expected and keeps my emacs frozen for long seconds. So I glaze at my frozen emacs and kick myself for not using &lt;code&gt;M-&amp;amp; some_command&lt;/code&gt; and promise myself to use &lt;code&gt;M-&amp;amp;&lt;/code&gt; next time. But &lt;code&gt;M-!&lt;/code&gt; is in my muscle memory for decades…&#xA;And of course there is &lt;code&gt;Ctrl-G&lt;/code&gt;, but there are cases when breaking command and re-running it is not preferable (mayhaps it may break sth, mayhaps would be costly to rerun…).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar mistake in shell konsole is trivial to correct, &lt;code&gt;Ctrl-Z&lt;/code&gt;, &lt;code&gt;bg&lt;/code&gt; and job is running in the background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does there exist some similar trick in emacs -  a way to turn currently running foreground (synchronous) command into backgroundized (asynchronous) one? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: in case it is impossible for &lt;em&gt;default&lt;/em&gt; &lt;code&gt;M-!&lt;/code&gt;, I am open to suggestions of how to rebind &lt;code&gt;M-!&lt;/code&gt; into something else (what would be functionally equivalent apart from this trick).&lt;/p&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-07-23T17:23:06.360" Title="Turning active M-! into M-&amp; (a'ka emacs equiv to bash Ctrl-Z)" Tags="|commands|process|async|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13778" PostTypeId="1" AcceptedAnswerId="13811" CreationDate="2015-07-07T17:17:53.720" Score="4" ViewCount="110" Body="&lt;p&gt;I'm trying to implement a tokenizer for Haskell, it has a bit involved token structure that can be seen in code here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/ghc/ghc/blob/master/compiler/basicTypes/Lexeme.hs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/ghc/ghc/blob/master/compiler/basicTypes/Lexeme.hs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In regexp-like terms it would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(LowercaseLetter|OtherLetter|_)(UppercaseLetter|LowercaseLetter|OtherLetter|TitlecaseLetter|DecimalNumber|OtherNumber|'|_)*ModifierLetter*#*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In human terms: a non-uppercase letter or underscore, followed by any numbers of letters, numbers, underscores, apostrophes followed by any number of modifier letters followed by any number of hashes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I write a regexp in emacs lisp that uses Unicode General Categories as indicated above?&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="5213" LastEditDate="2015-07-08T06:42:40.807" LastActivityDate="2015-07-08T19:24:48.370" Title="Regexp by Unicode General Category" Tags="|regular-expressions|unicode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13779" PostTypeId="1" CreationDate="2015-07-07T18:35:37.153" Score="3" ViewCount="272" Body="&lt;p&gt;I noticed that successive versions of packages have been accumulating in my ~/.emacs.d/elpa folder, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;drwxr-xr-x   3 joon users 4,0K 20 avril 15:49 auto-complete-20150408.1132&#xA;drwxr-xr-x   3 joon users 4,0K 16 juin  17:14 auto-complete-20150615.34&#xA;drwxr-xr-x   3 joon users 4,0K  1 juil. 18:00 auto-complete-20150618.1949&#xA;drwxr-xr-x   2 joon users 4,0K 31 mai   21:53 avy-20150530.111&#xA;drwxr-xr-x   2 joon users 4,0K  4 juin  16:42 avy-20150603.919&#xA;drwxr-xr-x   2 joon users 4,0K 12 juin  17:07 avy-20150608.404&#xA;drwxr-xr-x   2 joon users 4,0K 16 juin  17:14 avy-20150615.1048&#xA;drwxr-xr-x   2 joon users 4,0K  1 juil. 18:00 avy-20150701.532&#xA;drwxr-xr-x   2 joon users 4,0K  7 juil. 19:53 avy-20150707.811&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this normal? Is there a quick way to get rid of old versions ?&lt;/p&gt;&#xA;" OwnerUserId="526" LastActivityDate="2015-07-07T20:25:30.633" Title="Successive versions of packages accumulating in the ~/.emacs.d/elpa folder" Tags="|package|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13780" PostTypeId="1" AcceptedAnswerId="13781" CreationDate="2015-07-07T19:00:50.400" Score="2" ViewCount="1275" Body="&lt;p&gt;I built a new version of GDB and it works properly from terminal. Now I want it to be executed when I run M-x gdb from emacs.&lt;/p&gt;&#xA;" OwnerUserId="8698" LastActivityDate="2015-07-07T19:35:32.343" Title="Using different gdb in emacs" Tags="|gdb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13781" PostTypeId="2" ParentId="13780" CreationDate="2015-07-07T19:35:32.343" Score="3" Body="&lt;p&gt;When you &lt;code&gt;M-x gdb&lt;/code&gt;, Emacs will present you with a command-line in the minibuffer, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Run gdb (like this): gdb -i=mi something&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can edit this to supply a path to &lt;code&gt;gdb&lt;/code&gt;, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/my/install/bin/gdb -i=mi something&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-07-07T19:35:32.343" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13782" PostTypeId="1" AcceptedAnswerId="13786" CreationDate="2015-07-07T19:44:59.210" Score="4" ViewCount="332" Body="&lt;p&gt;I have an &lt;code&gt;org-mode&lt;/code&gt; table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|----+----+----+----+----+----+-----+-----+-----|&#xA;| 40 | 40 | 30 | 20 | 50 | 50 | 100 | 100 | 200 |&#xA;|----+----+----+----+----+----+-----+-----+-----|&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|    |    |    |    |    |    |     |     |     |&#xA;|----+----+----+----+----+----+-----+-----+-----|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to fill in the empty cells each with a random integer between &lt;code&gt;0&lt;/code&gt; and the top number of each column. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm very new to &lt;code&gt;emacs&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt; but really excited about learning!&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2015-07-07T20:29:55.920" Title="Is it possible to insert random numbers in an org table?" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13783" PostTypeId="2" ParentId="13750" CreationDate="2015-07-07T20:01:40.237" Score="4" Body="&lt;p&gt;You need to add the function &lt;code&gt;comint-truncate-buffer&lt;/code&gt; to the hook &lt;code&gt;comint-output-filter-functions&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'comint-output-filter-functions #'comint-truncate-buffer)&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, the buffer will be truncated at 1024 lines. To change it to 1000 you will need to change the variable &lt;code&gt;comint-buffer-maximum-size&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comint-buffer-maximum-size 1000)&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should work for all major modes that derive from &lt;code&gt;comint-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-07-07T20:01:40.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13784" PostTypeId="2" ParentId="13772" CreationDate="2015-07-07T20:09:27.977" Score="3" Body="&lt;p&gt;I use the following advice which automatically enables &lt;code&gt;--set-upstream&lt;/code&gt; when the current branch doesn't have an upstream yet:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun magit-push-arguments-maybe-upstream (magit-push-popup-fun &amp;amp;rest args)&#xA;  &quot;Enable --set-upstream switch if there isn't a current upstream.&quot;&#xA;  (let ((magit-push-arguments&#xA;         (if (magit-get-remote) magit-push-arguments&#xA;           (cons &quot;--set-upstream&quot; magit-push-arguments))))&#xA;    (apply magit-push-popup-fun args)))&#xA;(advice-add 'magit-push-popup :around #'magit-push-arguments-maybe-upstream)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Combined with ido completion this allows pushing a new branch with &lt;kbd&gt;P P RET&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; NOTE: requires ido-completing-read+&#xA;(setq magit-completing-read-function #'magit-ido-completing-read)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-07-08T07:51:24.287" LastActivityDate="2015-07-08T07:51:24.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13785" PostTypeId="2" ParentId="13779" CreationDate="2015-07-07T20:25:30.633" Score="3" Body="&lt;p&gt;That is unusual at least.  Normally package.el asks you whether to delete old versions after upgrade, meaning that you'd have made a conscious decision to keep them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, you can remove old versions explicitly with &lt;code&gt;M-x list-packages&lt;/code&gt;, then &lt;code&gt;~&lt;/code&gt; to mar obsolete packages for deletion and eventually &lt;code&gt;x&lt;/code&gt; to perform this action.  That should delete all old versions of your installed packages.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-07-07T20:25:30.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13786" PostTypeId="2" ParentId="13782" CreationDate="2015-07-07T20:29:55.920" Score="7" Body="&lt;p&gt;The following formula will do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$&amp;lt;..@&amp;gt;$&amp;gt;=random(@1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This means: all rows 2 onwards, and all columns, get a random number in the range of the first row.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Results will be integers. If you want real numbers, do &lt;code&gt;random(@1 * 1.0)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-07-07T20:29:55.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13787" PostTypeId="1" AcceptedAnswerId="13794" CreationDate="2015-07-07T20:37:32.193" Score="4" ViewCount="428" Body="&lt;p&gt;I can get single hop ssh to work just fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ cd /ssh:cpatti@wak-prod-jump1:~&#xA;/ssh:cpatti@wak-prod-jump1:/home/jumpboxaccess_emergency $ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I try multi-hop, I get command not found every time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd /ssh:cpatti@wak-prod-jump1|ssh:root@wak-prod-knife:~&#xA;ssh:root@wak-prod-knife:~: command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm running emacs 25.0.50.1 on OSX Yosemite in case that matters.&lt;/p&gt;&#xA;" OwnerUserId="8834" LastActivityDate="2015-07-08T08:13:56.913" Title="Having trouble getting eshell remote shell multi-hop to work" Tags="|tramp|eshell|ssh|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13788" PostTypeId="1" AcceptedAnswerId="13789" CreationDate="2015-07-08T01:56:40.503" Score="5" ViewCount="676" Body="&lt;p&gt;I recently updated magit from melpa. It seems that it requires Emacs 24.4. Since I had 24.3, I've also updated Emacs to 24.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do M-x magit-status and choose the directory with .git, it asks me if I want to create repository in that directory. I say no, and nothing happens. It seems that magit thinks that the directory isn't a git repository. If I say yes, it produces wrong number of arguments error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I waited for the next magit update, this issue still hasn't fixed for me. Should I go back to a stable version?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M-x magit-version says&#xA;Magit 20150707.1446, Git 1.7.10.4, Emacs 24.5.1&lt;/p&gt;&#xA;" OwnerUserId="8837" LastActivityDate="2015-12-02T21:05:31.740" Title="magit tries to create new repository when I do magit-status in a repository" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13789" PostTypeId="2" ParentId="13788" CreationDate="2015-07-08T03:01:53.333" Score="3" Body="&lt;p&gt;That problem is symptomatic of using Magit 2.x with an old Git version (certainly with Git 1.7).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll need to upgrade Git (at present version 1.9.4 or later is &lt;a href=&quot;http://magit.vc/manual/magit/I-am-using-a-Git-release-older-than-v194.html&quot; rel=&quot;nofollow&quot;&gt;required&lt;/a&gt;), or else &lt;a href=&quot;http://magit.vc/elpa/v1/&quot; rel=&quot;nofollow&quot;&gt;downgrade Magit&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://magit.vc/manual/magit/Updating-from-an-older-release.html&quot; rel=&quot;nofollow&quot;&gt;Updating from an older release&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also note that starting with the 2.1.0 release, Magit requires at least Emacs 24.4 and Git 1.9.4. You should make sure you have at least these releases installed before updating Magit. And if you connect to remote hosts using Tramp, then you should also make sure to install a recent enough Git version on these hosts. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-12-02T21:05:31.740" LastActivityDate="2015-12-02T21:05:31.740" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13790" PostTypeId="1" CreationDate="2015-07-08T04:04:53.920" Score="2" ViewCount="55" Body="&lt;p&gt;I have two &lt;code&gt;org&lt;/code&gt; tables&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: contact_info&#xA;| Name       |  ID | E-Mail          |&#xA;|------------+-----+-----------------|&#xA;| Washington | 001 | george@usa.pres |&#xA;| Adams      | 002 | john@usa.pres   |&#xA;| Jefferson  | 003 | thomas@usa.pres |&#xA;| Madison    | 004 | james@usa.pres  |&#xA;&#xA;#+TBLNAME: ages&#xA;| Name | Age |&#xA;|------+-----|&#xA;|      |     |&#xA;|------+-----|&#xA;| Mean |   0 |&#xA;#+TBLFM: @&amp;gt;$2=vmean(@&amp;lt;&amp;lt;$2..@&amp;gt;&amp;gt;$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like the first column of &lt;code&gt;ages&lt;/code&gt; to synchronize with the first column of &lt;code&gt;contact_info&lt;/code&gt;. In other words, I would like &lt;code&gt;ages&lt;/code&gt; to look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: ages&#xA;| Name       | Age |&#xA;|------------+-----|&#xA;| Washington |     |&#xA;| Adams      |     |&#xA;| Jefferson  |     |&#xA;| Madison    |     |&#xA;|------------+-----|&#xA;| Mean       |   0 |&#xA;#+TBLFM: @&amp;gt;$2=vmean(@&amp;lt;&amp;lt;$2..@&amp;gt;&amp;gt;$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Furthermore, if I change &lt;code&gt;contact_info&lt;/code&gt; to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: contact_info&#xA;| Name       |  ID | E-Mail          |&#xA;|------------+-----+-----------------|&#xA;| Washington | 001 | george@usa.pres |&#xA;| Adams      | 002 | john@usa.pres   |&#xA;| Madison    | 004 | james@usa.pres  |&#xA;| Monroe     | 005 | james1@usa.pres |&#xA;| Adams      | 006 | john1@usa.pres  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I would like &lt;code&gt;ages&lt;/code&gt; to update to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: ages&#xA;| Name       | Age |&#xA;|------------+-----|&#xA;| Washington |     |&#xA;| Adams      |     |&#xA;| Madison    |     |&#xA;| Monroe     |     |&#xA;| Adams      |     |&#xA;|------------+-----|&#xA;| Mean       |   0 |&#xA;#+TBLFM: @&amp;gt;$2=vmean(@&amp;lt;&amp;lt;$2..@&amp;gt;&amp;gt;$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this sort of thing possible?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2015-07-08T04:04:53.920" Title="Can an org table automatically syncronize with another org table?" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13791" PostTypeId="1" AcceptedAnswerId="28599" CreationDate="2015-07-08T04:04:59.467" Score="2" ViewCount="609" Body="&lt;p&gt;I just configured my emacs to display PDFs using doc view. But the problem is that the display flickers continuously. It seems that doc view is constantly refreshing the frame leading to an unpleasant display. How do I stop it from doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I haven't done any customization to doc view in my .emacs yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 24.4 on Windows 8.1 64 bit.&lt;/p&gt;&#xA;" OwnerUserId="8667" LastEditorUserId="8667" LastEditDate="2015-07-17T06:37:04.237" LastActivityDate="2016-11-11T10:23:22.157" Title="PDF doc view flickers continously" Tags="|pdf|docview|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13792" PostTypeId="2" ParentId="13705" CreationDate="2015-07-08T04:26:48.347" Score="12" Body="&lt;p&gt;BTW, an alternative option can be something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((error t))&#xA;  (unwind-protect&#xA;      (prog1 (call-function)&#xA;        (setq error nil))&#xA;    (when error (cleanup))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advantage is that you avoid catching&amp;amp;rethrowing the error, which means for example that the debugger will show you the right backtrace (the one that corresponds to the actual source of the error, rather than the one that corresponds to you re-throwing someone else's error).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another differences is that &lt;code&gt;cleanup&lt;/code&gt; will be called not only upon error but also if the code is interrupted by a &lt;code&gt;C-g&lt;/code&gt; or a call to &lt;code&gt;throw&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-07-08T04:26:48.347" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13793" PostTypeId="1" AcceptedAnswerId="13839" CreationDate="2015-07-08T07:42:17.277" Score="12" ViewCount="1268" Body="&lt;p&gt;I have been using Bernt Hansen's org-mode setup (&lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot; rel=&quot;noreferrer&quot;&gt;http://doc.norang.ca/org-mode.html&lt;/a&gt; - modified slightly to my needs) for some time and I came up with a question that I cannot solve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to add a colunn to my clock table report showing the percentage of each group of activities. The attached is an example of a typical clock table report. I would like to add a column next to &lt;code&gt;Time&lt;/code&gt; showing the percentage of time spent in nonValueAdded.org (i.e., 16.59=100*(1:13/7:20)), service.org, teaching.org.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading &lt;a href=&quot;https://emacs.stackexchange.com/questions/12839/use-formula-in-agenda-clockreport-to-convert-time&quot;&gt;Use formula in agenda clockreport to convert time? (pomodoro count in Agenda)&lt;/a&gt;, I tried adding &lt;code&gt;:formula &quot;$4=(%CLOCKSUM/%CLOCKSUM_T)*(100);t&quot;&lt;/code&gt; as below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-clockreport-parameter-plist&#xA;  (quote (:link t :maxlevel 5 :fileskip0 t :compact t :narrow 80 :formula &quot;$4=(%CLOCKSUM/%CLOCKSUM_T)*(100);t&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it was not successful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Yi6f9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8839" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-07-09T15:08:05.283" Title="How to add a column in org-mode agenda clockreport to show percentage of time for each group of activities?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13794" PostTypeId="2" ParentId="13787" CreationDate="2015-07-08T08:13:56.913" Score="4" Body="&lt;p&gt;The pipe &lt;code&gt;|&lt;/code&gt; is special to the shell, try quoting the whole filename.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-07-08T08:13:56.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13795" PostTypeId="2" ParentId="13713" CreationDate="2015-07-08T08:59:12.453" Score="2" Body="&lt;p&gt;OK, if we have to resort to advising, here is how I would do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mk-anti-ido-advice (func &amp;amp;rest args)&#xA;  &quot;Temporarily disable IDO and call function FUNC with arguments ARGS.&quot;&#xA;  (interactive)&#xA;  (let ((read-file-name-function #'read-file-name-default))&#xA;    (if (called-interactively-p 'any)&#xA;        (call-interactively func)&#xA;      (apply func args))))&#xA;&#xA;(defun mk-disable-ido (command)&#xA;  &quot;Disable IDO when command COMMAND is called.&quot;&#xA;  (advice-add command :around #'mk-anti-ido-advice))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;…and then we can just:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mk-disable-ido 'dired-create-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to @npostavs comment about let-binding of &lt;code&gt;read-file-name-function&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-08T12:06:01.670" LastActivityDate="2015-07-08T12:06:01.670" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13796" PostTypeId="1" CreationDate="2015-07-08T09:15:02.907" Score="2" ViewCount="64" Body="&lt;p&gt;I'm writing a &lt;a href=&quot;https://github.com/davidshepherd7/electric-operator&quot; rel=&quot;nofollow&quot;&gt;minor mode&lt;/a&gt; to handle automatic spacing of operator characters, but I'm having some trouble with C/C++. The problem is that I can't figure out how to tell in general whether a &lt;code&gt;*&lt;/code&gt; is a multiplication or a pointer type. Similarly for &lt;code&gt;&amp;amp;&lt;/code&gt;, and &lt;code&gt;&amp;lt;&lt;/code&gt;/&lt;code&gt;&amp;gt;&lt;/code&gt; in C++ .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've currently got some basic hacks to detect the built in types (&lt;code&gt;int&lt;/code&gt;, &lt;code&gt;char&lt;/code&gt;, etc.) and to detect types ending in &lt;code&gt;_t&lt;/code&gt;. I've also found the &lt;code&gt;c-guess-basic-syntax&lt;/code&gt; function which can tell me when point is in a function header so I can handle function argument and return types. However I can't find any way to detect when point is in a normal variable declaration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible without implementing a C compiler?&lt;/p&gt;&#xA;" OwnerUserId="237" LastActivityDate="2015-07-08T09:15:02.907" Title="Is it possible to detect C/C++/Java variable declarations.?" Tags="|cc-mode|syntax-table|parsing|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13797" PostTypeId="1" AcceptedAnswerId="13802" CreationDate="2015-07-08T11:29:01.393" Score="15" ViewCount="6068" Body="&lt;p&gt;I am using tramp via ssh to access remote files. For text files, this is working really well, but whenever I want to copy larger remote files to my local machine, tramp uses its slow inline method (encoding the file with gzip). This is much slower than using an external method like for example scp. How do I make emacs use scp when transfering large files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relevant information:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I use an ~/.ssh/config file to access the remote machine. The alias for that machine is hehi09 in the following. The access is password-less&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Messages in &lt;em&gt;message&lt;/em&gt; buffer when transferring: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Copying /ssh:hehi09:/home/christian/big_file.dat to /home/christian/big_file.dat'...&#xA;Tramp: Inserting `/ssh:hehi09:/home/christian/big_file.dat'...&#xA;Tramp: Encoding remote file `/ssh:hehi09:/home/christian/big_file.dat' with `(gzip &amp;lt;%s | base64)'...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Values of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;tramp-copy-size-limit's value is 10240  (much smaller than tested file size)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;tramp-default-method's value is &quot;scp&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;$ scp hehi09:/home/christian/big_file.dat ~/&lt;/code&gt; works as expected from the command line and is much faster than the transfer in emacs&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any ideas why emacs is not using scp to copy large files? Any help is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="8752" LastEditorUserId="6682" LastEditDate="2023-11-06T19:59:09.497" LastActivityDate="2023-11-06T19:59:09.497" Title="Tramp/Dired transfers files inline over ssh instead of using scp externaly" Tags="|dired|tramp|ssh|performance|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13798" PostTypeId="1" CreationDate="2015-07-08T11:39:38.207" Score="5" ViewCount="1941" Body="&lt;p&gt;I am able to read gmail in gnus, but, after several hours of trying, am still not able to send gmail via gnus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have searched extensively here and elsewhere, and have tried many configurations, including ports 465 and 587. I am using a &lt;code&gt;~/.authinfo&lt;/code&gt; file with application-specific passwords, currently with &lt;a href=&quot;https://emacs.stackexchange.com/a/12204/5345&quot;&gt;this&lt;/a&gt; configuration. I have &lt;code&gt;gnutls-cli&lt;/code&gt; installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to send gmail, Emacs reports &quot;Sending via mail...&quot; and then appears to hang/wait for a long time. After a while, focus returns to the draft email. The &quot;trace of SMTP session to smtp.gmail.com&quot; is empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Current configuration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/.authinfo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine imap.gmail.com login username@gmail.com password ApplicationSpecificPassword port imaps&#xA;machine smtp.gmail.com login username@gmail.com password ApplicationSpecificPassword port 465  ; have tried 587&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/.profile&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export EMAIL=&quot;username@gmail.com&quot;&#xA;export NAME=&quot;My Name&quot;&#xA;export SMTPSERVER=&quot;smtp.gmail.com&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/.gnus&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-select-method&#xA;  '(nnimap &quot;gmail&quot;&#xA;           (nnimap-address &quot;imap.gmail.com&quot;)&#xA;           (nnimap-server-port &quot;imaps&quot;)&#xA;           (nnimap-stream ssl)))&#xA;&#xA;(setq&#xA; send-mail-function 'smtpmail-send-it&#xA; message-send-mail-function 'smtpmail-send-it&#xA; user-mail-address &quot;username@gmail.com&quot;&#xA; smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; 465 nil nil)) ; tried 587&#xA; smtpmail-auth-credentials (expand-file-name &quot;~/.authinfo&quot;)&#xA; smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-service 465 ; tried 587&#xA; smtpmail-debug-info t ; where is this output?&#xA; starttls-extra-arguments nil&#xA; starttls-gnutls-program &quot;/usr/bin/gnutls-cli&quot; ; executable, correct path&#xA; starttls-extra-arguments nil&#xA; starttls-use-gnutls t&#xA; smtpmail-local-domain &quot;my.dotted.ip.address&quot;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-08-12T12:35:26.030" Title="Sending smtp gmail via gnus" Tags="|gnus|smtpmail|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13799" PostTypeId="1" CreationDate="2015-07-08T13:45:51.277" Score="3" ViewCount="816" Body="&lt;p&gt;The gnus Summary Buffer can be refreshed/updated to &lt;a href=&quot;https://stackoverflow.com/a/11995930/580010&quot;&gt;show&lt;/a&gt; new articles with &lt;code&gt;/ N&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can the buffer be refreshed/updated to remove messages deleted with &lt;code&gt;B DEL&lt;/code&gt;? These remain after issuing &lt;code&gt;B DEL&lt;/code&gt; and &lt;code&gt;/ N&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-11-29T16:18:45.190" Title="Refresh/Update gnus Summary Buffer" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13800" PostTypeId="1" AcceptedAnswerId="13803" CreationDate="2015-07-08T13:53:43.293" Score="1" ViewCount="103" Body="&lt;p&gt;I'm trying to write a function for complete in minibuffer with history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Terminal equivalent of &lt;code&gt;&quot;\e[5~&quot;: history-search-backward&lt;/code&gt; in &lt;code&gt;~/.inputrc&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the below function I can get the last command that start with the prefix in the minibuffer. I want to validate this candidate or search the next candidate.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun history-search-forward ()&#xA;  (interactive)&#xA;  (setq prefix (minibuffer-contents))&#xA;  (loop for elt in extended-command-history&#xA;        do&#xA;        ;; history starts with word-at-point&#xA;        (and (string-match (rx-to-string `(: bos ,prefix) t)&#xA;                           elt)&#xA;             (progn&#xA;               (delete-region (point) (line-beginning-position))&#xA;               (insert elt)&#xA;               ;; here a want to launch the command if &amp;lt;Enter&amp;gt;&#xA;               ;; or continue looping if &amp;lt;prior&amp;gt;&#xA;               (return)))))&#xA;(define-key minibuffer-local-completion-map (kbd &quot;&amp;lt;prior&amp;gt;&quot;) 'history-search-forward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I wait for user input at that point in the loop?&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="675" LastEditDate="2016-07-13T19:51:27.537" LastActivityDate="2016-07-13T19:51:27.537" Title="Is it possible to wait for user in a loop?" Tags="|completion|minibuffer|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13801" PostTypeId="1" AcceptedAnswerId="13835" CreationDate="2015-07-08T14:15:21.533" Score="9" ViewCount="1662" Body="&lt;p&gt;I want to use Emacs to write prose (specifically, fiction).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have used Scrivener and Ulysses in the past but I am not happy with them.  I want to try Emacs, but don't know how to replicate the workflow I am used to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;writeroom-mode&lt;/code&gt; to get a distraction-free environment, but it's just one piece of the puzzle.&#xA;I like the way Ulysses and Scrivener allow you to focus on a chunk of text, and I'd like to know how to replicate this functionality.  I would like &lt;code&gt;org-mode&lt;/code&gt; or another outliner to allow me to focus on a piece of text and hide the rest.  Ideally, I'd like to have a sidebar (like Ulysses), in which I can arrange pieces of text manually, like in this screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TExWr.png&quot; alt=&quot;ulysses&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS I have read the &lt;a href=&quot;http://therandymon.com/papers/emacs-for-writers.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Emacs for Writers PDF&lt;/a&gt; but it doesn't address the need to organize and structure your text.&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="253" LastEditDate="2015-07-09T10:48:21.023" LastActivityDate="2015-07-09T11:20:53.403" Title="How do I outline/hide/show text when writing prose?" Tags="|text-editing|writing|" AnswerCount="3" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="13802" PostTypeId="2" ParentId="13797" CreationDate="2015-07-08T14:30:58.300" Score="24" Body="&lt;p&gt;When you are saying &quot;I am using tramp via ssh&quot; I suppose you open a file like &lt;code&gt;/ssh:host:/path/to/file&lt;/code&gt;. This is supposed to use always the ssh method. If you want to use the scp method, you shall use &lt;code&gt;/scp:host:/path/to/file&lt;/code&gt;. This uses automatically ssh for short files, and scp for large files. If you trust the default method set in &lt;code&gt;tramp-default-method&lt;/code&gt;, you could use the shorter &lt;code&gt;/host:/path/to/file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastEditorUserId="2427" LastEditDate="2015-07-08T14:38:02.340" LastActivityDate="2015-07-08T14:38:02.340" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13803" PostTypeId="2" ParentId="13800" CreationDate="2015-07-08T14:58:35.150" Score="0" Body="&lt;p&gt;You can do that with the new generator.el library in Emacs-25 (i.e. you can just stop the computation at that point with &lt;code&gt;yield&lt;/code&gt; and go back to it later).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, you're going to have to break out of the loop after inserting the element you want, and arrange to keep enough information in buffer-local variables that next time &lt;code&gt;prior&lt;/code&gt; is used, your loop can know where to pick up the search.  The normal way to keep this info is to store the current position in &lt;code&gt;minibuffer-history-position&lt;/code&gt;, this way it'll interact correctly with other history search commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I'm not sure in which way your command differs from the predefined &lt;code&gt;previous-complete-history-element&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-07-08T14:58:35.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13804" PostTypeId="2" ParentId="13800" CreationDate="2015-07-08T15:27:17.563" Score="0" Body="&lt;p&gt;If I understood you correctly, you're trying to search through a command's history without returning from the command.  This can be done with &lt;code&gt;enable-recursive-minibuffers&lt;/code&gt; and an extra &lt;code&gt;completing-read&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, &lt;code&gt;ivy-mode&lt;/code&gt;, available as part of the &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow&quot;&gt;swiper&lt;/a&gt; package implements this for every command that uses &lt;code&gt;completing-read&lt;/code&gt;. The binding to search through the history is &lt;kbd&gt;C-r&lt;/kbd&gt;. As you exit your history search with e.g. &lt;kbd&gt;C-m&lt;/kbd&gt; the history element will be inserted into the minibuffer. Then you can exit once more with &lt;kbd&gt;C-m&lt;/kbd&gt; to execute the initial command with the history element.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-08T15:27:17.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13805" PostTypeId="1" AcceptedAnswerId="14034" CreationDate="2015-07-08T15:45:46.197" Score="10" ViewCount="1715" Body="&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; While I'm still learning the ropes of Babel, I've read about the &lt;code&gt;system-type&lt;/code&gt;, &lt;code&gt;emacs-version&lt;/code&gt;, and &lt;code&gt;window-system&lt;/code&gt; variables, which sound like they contain all the information I need to get the behavior I've described here. In fact, I could just wrap OS-specific code in conditionals when needed in code blocks. I'm wondering if this is the best way to go about this, however.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm using Babel to write literate configuration files for Emacs. I would like my config files to work on all of the platforms I frequently use (so basically various Linux distros and Macs), and part of this involves having settings that depend on the system (e.g., the default font I use on my Mac is different than the one I use on Linux Mint).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I'm sure I've seen ways to recognize whether or not I'm on a Mac using elisp (and hence could wrap any system-specific settings in some kind of conditional based on this), I'm wondering if Org/Babel has some way to detect the type of system I'm on which would enable me to write different code blocks for different systems. Better yet, can this also be done for different versions of Emacs? I'm envisioning code that would look something like the following (with platform and header names being contrived examples)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Platform: LinuxMint&#xA;#+Emacs: GNU Emacs&#xA;#+EmacsVersion: 24+&#xA;#+BEGIN_SOURCE EMACS-LISP&#xA;    [Some configuration for Linux Mint and GNU Emacs 24+]&#xA;#+END_SOURCE&#xA;&#xA;#+Platform: LinuxMint&#xA;#+Emacs: GNU Emacs&#xA;#+EmacsVersion: 22.1&#xA;#+BEGIN_SOURCE EMACS-LISP&#xA;    [Some other configuration for Linux Mint and GNU Emacs 22.1]&#xA;#+END_SOURCE&#xA;&#xA;#+Platform: Mac&#xA;#+Emacs: Aquamacs&#xA;#+EmacsVersion: 24+&#xA;#+BEGIN_SOURCE EMACS-LISP&#xA;    [Some other configuration for Mac and Emacs 24+]&#xA;#+END_SOURCE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The big fish to fry is the platform, since the version of emacs and the emacsen I use can probably be inferred from this in most situations. I should mention that the platform could be coarser than what I suggest above. (I really just need to know if I'm on a Linux, Windows, or Mac distribution.) Also, if these aren't built-in features, how would I go about creating code-block headers like these?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I suppose it might also be more likely to look something like the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SOURCE EMACS-LISP :os Linux :emacs GNU :emacs-version 24+&#xA;    [Some configuration for Linux and GNU Emacs 24+]&#xA;#+END_SOURCE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I imagine this can be found somewhere in the documentation if it exists but I couldn't seem to find a comprehensive list of headers for code blocks. Thanks for any help you can provide!&lt;/p&gt;&#xA;" OwnerUserId="8643" LastEditorUserId="8643" LastEditDate="2015-07-14T21:37:00.390" LastActivityDate="2015-07-17T20:58:08.367" Title="Can Org Babel conditionally tangle code blocks based on system-type?" Tags="|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13806" PostTypeId="1" CreationDate="2015-07-08T16:11:04.457" Score="5" ViewCount="1349" Body="&lt;p&gt;I would like to write in markdown mode for example and then have a sidebar that shows me a table of contents of the buffer I am currently in.&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="253" LastEditDate="2015-07-08T16:56:08.073" LastActivityDate="2015-07-08T16:56:08.073" Title="How do I get a TOC sidebar of my current buffer?" Tags="|text-editing|markdown|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13807" PostTypeId="1" AcceptedAnswerId="13812" CreationDate="2015-07-08T16:37:55.150" Score="2" ViewCount="122" Body="&lt;p&gt;I'm running into an odd case for rebinding keys, and I'm not sure of the solution. Basically, I want to replace a bunch of keybindings and move the original definition for each to a different key. Here's what I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc (lambda (map)&#xA;          (define-key map &quot;K&quot; (lookup-key map &quot;k&quot;))&#xA;          (define-key map &quot;k&quot; #'&amp;lt;my new command for &quot;k&quot;&amp;gt;)&#xA;        (list &amp;lt;a bunch of mode maps&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The bad part is &lt;code&gt;lookup-key&lt;/code&gt;: it will work fine on the first evaluation, but if I re-evaluate it will rebind &quot;K&quot; to my new binding for &quot;k&quot;. So, my question is, is there a way to look up the &lt;strong&gt;original&lt;/strong&gt; binding for a keymap? (Basically, I think I'm looking for the equivalent of &lt;code&gt;noremap&lt;/code&gt; in vim.)&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2015-07-08T20:45:37.633" Title="Access original keybinding for a mode after re-definition" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13808" PostTypeId="2" ParentId="13806" CreationDate="2015-07-08T16:53:04.970" Score="3" Body="&lt;p&gt;You can get that, more or less, with &lt;code&gt;M-x speedbar&lt;/code&gt;.  It displays the files in the current directory, and lets you expand the files to see a table of contents.  (For source code, it shows a list of functions.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you need to tell Speedbar to show contents for Markdown files, by customizing &lt;code&gt;speedbar-supported-extension-expressions&lt;/code&gt; and adding the file extension you use for Markdown files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, Speedbar hides files not matching &lt;code&gt;speedbar-supported-extension-expressions&lt;/code&gt; entirely.  You can set &lt;code&gt;speedbar-show-unknown-files&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; to make it show them in the list, even though it doesn't display an outline for them.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-07-08T16:53:04.970" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13809" PostTypeId="1" AcceptedAnswerId="13818" CreationDate="2015-07-08T17:00:39.110" Score="11" ViewCount="3482" Body="&lt;p&gt;Scenario: I'm in zsh and I want to edit a long shell command in an already open instance of Emacs. I've set &lt;code&gt;$VISUAL&lt;/code&gt;to &lt;code&gt;emacsclient -n -c&lt;/code&gt;. When I run &lt;code&gt;C-x C-e&lt;/code&gt; from zsh, a new Emacs frame opens, populated with contents of the zsh line. After editing and saving the buffer, I hit &lt;code&gt;C-x k&lt;/code&gt;, and buffer closes. The zsh line &lt;em&gt;remains unchanged&lt;/em&gt;. Why isn't zsh recognizing the changes made in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.5.1, zsh 5.0.8, Mac OS X 10.10.4&lt;/p&gt;&#xA;" OwnerUserId="2342" LastEditorUserId="25" LastEditDate="2015-07-08T21:40:09.163" LastActivityDate="2015-07-08T21:40:09.163" Title="How do I use emacsclient as EDITOR or VISUAL?" Tags="|emacsclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13811" PostTypeId="2" ParentId="13778" CreationDate="2015-07-08T19:24:48.370" Score="1" Body="&lt;p&gt;While a regexp based solution seems to be out of the question, you could write your own little matcher, using &lt;code&gt;(get-char-code-property char 'general-category)&lt;/code&gt; and comparing it's result to the various &lt;code&gt;Lx&lt;/code&gt; and &lt;code&gt;Nx&lt;/code&gt; categories.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2015-07-08T19:24:48.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13812" PostTypeId="2" ParentId="13807" CreationDate="2015-07-08T19:46:25.123" Score="2" Body="&lt;p&gt;I believe you need to maintain your own data structure of modified keys and their original key bindings. So at the time you define the new binding, you also store the current binding somewhere. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is how &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot; rel=&quot;nofollow&quot;&gt;bind-key&lt;/a&gt; (part of &lt;code&gt;use-package&lt;/code&gt;) implements its  &lt;code&gt;describe-personal-keybindings&lt;/code&gt; command, which shows you all the bindings you have created along with their original bindings.   &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-07-08T19:46:25.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13813" PostTypeId="2" ParentId="13801" CreationDate="2015-07-08T19:50:06.653" Score="1" Body="&lt;p&gt;This answer is not exhaustive, but I cannot post this in the comments because it has an image. May the table of contents you are talking about look something like below?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/DzPXu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another ad hoc way to have an outline is to run &lt;kbd&gt;M-s o&lt;/kbd&gt;&lt;code&gt;^\s-*\*&lt;/code&gt; (which is equivalent to &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;occur&lt;/code&gt;). Even though this isn't a proper outline, more often than not, I find this to be an adequate solution for the problem of locating and navigating sections of the document.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-07-08T20:51:36.227" LastActivityDate="2015-07-08T20:51:36.227" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13814" PostTypeId="1" AcceptedAnswerId="13829" CreationDate="2015-07-08T20:14:28.223" Score="1" ViewCount="288" Body="&#xA;&#xA;&lt;h2&gt;My setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs GUI (version 24.4.51.1 (x86_64-w64-mingw32) &#xA;                       &lt;a href=&quot;https://bitbucket.org/Haroogan/emacs-for-windows/&quot; rel=&quot;nofollow&quot;&gt;compiled from Harroogan Emacs.&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Package &lt;a href=&quot;http://www.emacswiki.org/emacs/KeyChord&quot; rel=&quot;nofollow&quot;&gt;key-chord.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Package Evil-mode&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I use the Evil mode. I tried to solve my issue with the maintainer (Frank Fischer is a hero, for maintaining an awesome package) in the past: &lt;a href=&quot;https://bitbucket.org/lyro/evil/issues/505/proper-error-handling-in-case-of-custom&quot; rel=&quot;nofollow&quot;&gt;https://bitbucket.org/lyro/evil/issues/505/proper-error-handling-in-case-of-custom&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically, I don't like the idea behind the package &lt;code&gt;key-chord&lt;/code&gt;, because you need to press your keys simultaneously, instead rolling or typing. It will hurt your fingers in the long term, and it's not comfortable (with typing, you're rolling with your fingers). I tried to solve it with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq key-chord-two-keys-delay 0.4)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, when typing fast, it would be workable. But if I want to jump to awindow with keys on the home-row of the keyboard, I could configure it with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(key-chord-define-global &quot;fj&quot; 'evil-window-down)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, when you want to go to another window down, you're just typing &lt;code&gt;fj&lt;/code&gt;, and you * jumps * into another window. Okay. But when you want to find the charachter &lt;code&gt;j&lt;/code&gt;? Just press &lt;code&gt;f&lt;/code&gt;, then wait 600 miliseconds, then press &lt;code&gt;j&lt;/code&gt;. Simple.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is where the problem arises. When you want to go down one line, the &lt;code&gt;j&lt;/code&gt; key in Evil becomes terribly slow (because of the key-delay). So I'm wondering if there a package exists, that does  looks only to the first character, instead all the characters in the key-binding? Any suggestion? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-07-09T21:30:32.527" Title="Does a key-chord that looks to the first character, exists?" Tags="|key-bindings|keymap|evil|key-chord-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13815" PostTypeId="1" AcceptedAnswerId="13890" CreationDate="2015-07-08T20:39:37.130" Score="2" ViewCount="136" Body="&lt;p&gt;Sadly I am stuck using Emacs version 21.4 in a work environment.  Despite this I would very much like to be able to use rgrep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either the version of Emacs 21.4 I have has been stripped down, or rgrep doesn't ship with rgrep.  I have transferred the grep.el from a 24.5 system.  When I try to byte-compile grep.el and it's require dependencies I get the following error in macroexp.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid read syntax ((&quot;. in wrong context&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't find any syntax errors in macroexp.el ( and would be very surprised to find any) so I'm wondering if this is a version (in)compatibility issue which I can overcome with some simple edits?&lt;/p&gt;&#xA;" OwnerUserId="5297" LastEditorUserId="5297" LastEditDate="2015-07-08T20:46:56.893" LastActivityDate="2015-07-10T21:43:00.463" Title="rgrep in version 21.4?" Tags="|rgrep|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="13816" PostTypeId="2" ParentId="13807" CreationDate="2015-07-08T20:45:37.633" Score="3" Body="&lt;p&gt;There is no such thing as &quot;the original binding&quot;. But you can save the binding at any point, including just after starting an Emacs session. That might be &quot;original&quot; enough for you; dunno. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yes, as @glucas points out, functions such as &lt;code&gt;define-key&lt;/code&gt; act like assignments (e.g., like &lt;code&gt;setq&lt;/code&gt;). If you want to later revert to some previous value then you will need to have saved that value and then reassign to it later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note too that if you know the command currently bound to a key (finding it using &lt;code&gt;lookup-key&lt;/code&gt; or in some other way), you can use &lt;code&gt;(define-key [remap ORIG-COMMAND] 'NEW-COMMAND)&lt;/code&gt; to remap &lt;strong&gt;all&lt;/strong&gt; keys bound to that &lt;code&gt;ORIG-COMMAND&lt;/code&gt; to your &lt;code&gt;NEW-COMMAND&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can later restore &lt;strong&gt;all&lt;/strong&gt; of those keys to their original bindings to &lt;code&gt;ORIG-COMMAND&lt;/code&gt; by simply using &lt;code&gt;(define-key [remap ORIG-COMMAND] nil)&lt;/code&gt;, that is, by making that remapping undefined (binding a key to &lt;code&gt;nil&lt;/code&gt; makes it undefined).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-08T20:45:37.633" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13817" PostTypeId="1" AcceptedAnswerId="13826" CreationDate="2015-07-08T21:18:15.667" Score="2" ViewCount="385" Body="&lt;p&gt;I have an &lt;code&gt;org&lt;/code&gt; table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|        |        | P1 | P2 | P3 | P4 | Q1 | Q2 |  E1 |  E2 |   F |&#xA;|--------+--------+----+----+----+----+----+----+-----+-----+-----|&#xA;|        | Totals | 20 | 40 | 35 | 20 | 50 | 45 | 100 | 100 | 200 |&#xA;|--------+--------+----+----+----+----+----+----+-----+-----+-----|&#xA;| John   |        | 18 | 18 | 15 |  0 | 45 | 22 |  45 |  97 | 112 |&#xA;| Paul   |        |  4 | 12 |  4 |  8 | 10 | 14 |  31 |  58 | 158 |&#xA;| George |        | 15 | 34 | 32 | 16 | 46 | 12 |  94 |  46 | 141 |&#xA;| Ringo  |        | 20 | 17 | 25 |  1 | 49 | 16 |  61 |  52 | 129 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to fill in the column &lt;code&gt;Totals&lt;/code&gt; with a weighted sum of the other columns. The weighted sum should have a formula&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Totals = w*(P1+P2+P3+P4)+x*(Q1+Q2)+y*(E1+E2)+z*(F)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;w&lt;/code&gt;, &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt;, and &lt;code&gt;z&lt;/code&gt; are defined constants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This specific formula is easy to write down. My problem is that I'd like the formula to respond when I add columns to the table. So my formula should really be something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Totals = w*(sum of cols marked &quot;P&quot;)+x*(sum of cols marked &quot;Q&quot;)&#xA;         +y*(sum of cols marked &quot;E&quot;)+z*(sum of cols marked &quot;F&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus when my table is changed to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|        |        | P1 | P2 | P3 | P4 | P5 | Q1 | Q2 |  E1 |  E2 |  E3 |   F |&#xA;|--------+--------+----+----+----+----+----+----+----+-----+-----+-----+-----|&#xA;|        | Totals | 20 | 40 | 35 | 20 | 40 | 50 | 45 | 100 | 100 | 100 | 200 |&#xA;|--------+--------+----+----+----+----+----+----+----+-----+-----+-----+-----|&#xA;| John   |        | 18 | 18 | 15 |  0 | 40 | 45 | 22 |  45 |  97 |  65 | 112 |&#xA;| Paul   |        |  4 | 12 |  4 |  8 | 33 | 10 | 14 |  31 |  58 |  45 | 158 |&#xA;| George |        | 15 | 34 | 32 | 16 | 24 | 46 | 12 |  94 |  46 |  78 | 141 |&#xA;| Ringo  |        | 20 | 17 | 25 |  1 | 38 | 49 | 16 |  61 |  52 |  65 | 129 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My formula should become&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Totals = w*(P1+P2+P3+P4+P5)+x*(Q1+Q2)+y*(E1+E2+E3)+z*(F)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-07-08T21:30:21.540" LastActivityDate="2015-07-09T18:50:16.457" Title="Can columns of an org table be grouped to conveniently work with data?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13818" PostTypeId="2" ParentId="13809" CreationDate="2015-07-08T21:38:10.093" Score="14" Body="&lt;p&gt;Set &lt;code&gt;VISUAL&lt;/code&gt; to &lt;code&gt;emacsclient -c&lt;/code&gt; (or some other variation without &lt;code&gt;-n&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option &lt;code&gt;-n&lt;/code&gt; causes &lt;code&gt;emacsclient&lt;/code&gt; to return as soon as it's contacted the running Emacs instance to tell it to edit the file. The program calling the editor (here, zsh, but this applies equally to any other program that invokes &lt;code&gt;$VISUAL&lt;/code&gt;) knows that you've finished editing because the program that it invoked has exited, which, with &lt;code&gt;-n&lt;/code&gt;, happens essentially immediately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to arrange for the program invoked through &lt;code&gt;VISUAL&lt;/code&gt; to exit when you've finished editing, i.e. when you close the buffer in Emacs. That's exactly what &lt;code&gt;emacsclient&lt;/code&gt; without &lt;code&gt;-n&lt;/code&gt; does: it contacts the running Emacs instance to tell it to open the file, then sits around until Emacs replies to tell emacsclient that the editing session is finished. The normal way to finish an editing session is to press &lt;code&gt;C-x #&lt;/code&gt; (&lt;code&gt;server-edit&lt;/code&gt;). This notifies emacsclient and closes the buffer, as well as the frame when it was opened by &lt;code&gt;emacsclient -c&lt;/code&gt;. Closing the buffer also notifies the emacsclient process that the session is finished, but you get a warning prompt (“Buffer … still has clients, kill it?”), which you can disable by overriding the function &lt;code&gt;server-kill-buffer-query-function&lt;/code&gt; (RMS thinks it's dangerous). In a frame opened by &lt;code&gt;emacsclient -c&lt;/code&gt;, pressing &lt;code&gt;C-x C-c&lt;/code&gt; (&lt;code&gt;save-buffers-kill-terminal&lt;/code&gt;) saves the file, closes it and closes the frame.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-07-08T21:38:10.093" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13819" PostTypeId="1" AcceptedAnswerId="18331" CreationDate="2015-07-08T22:17:34.883" Score="5" ViewCount="771" Body="&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-mime.html&quot; rel=&quot;nofollow&quot;&gt;org-mime page&lt;/a&gt; describes how to use &lt;code&gt;org-mime-html-hook&lt;/code&gt; to style HTML email by inserting inline CSS. I used this method to successfully change the styling of my body paragraphs by targeting &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mime-html-hook&#xA;      (lambda ()&#xA;        (org-mime-change-element-style&#xA;         &quot;p&quot; &quot;font-family: Georgia,serif;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I tried the same method to target ordered lists, unordered lists, and DONE headings, it had no effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mime-html-hook&#xA;      (lambda ()&#xA;        (org-mime-change-element-style&#xA;         &quot;ul.org-ul li&quot;&#xA;         &quot;font-family: Georgia,serif;&quot;))) &#xA;&#xA;(add-hook 'org-mime-html-hook&#xA;      (lambda ()&#xA;        (org-mime-change-element-style&#xA;         &quot;ol.org-ol li&quot;&#xA;         &quot;font-family: Georgia,serif;&quot;))) &#xA;&#xA;(add-hook 'org-mime-html-hook&#xA;      (lambda ()&#xA;        (org-mime-change-element-style&#xA;         &quot;.done&quot;&#xA;         &quot;color:#00bb00&quot;))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The CSS styles were not reflected in the &lt;code&gt;org-mime&lt;/code&gt; HTMLized buffer at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eventually I was able to address the ordered and unordered lists by targeting the &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; tag directly...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mime-html-hook&#xA;      (lambda ()&#xA;        (org-mime-change-element-style&#xA;         &quot;li&quot;&#xA;         &quot;font-family: Georgia,serif;&quot;))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but doing so also stripped the formatting from my &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's going on here! And how can I style these other elements using &lt;code&gt;org-mime&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-07-09T15:47:03.063" LastActivityDate="2018-01-30T11:30:31.113" Title="how to use CSS to change styling of elements in org-mime emails?" Tags="|org-mode|regular-expressions|email|css|org-mime|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13820" PostTypeId="1" AcceptedAnswerId="13828" CreationDate="2015-07-08T22:55:46.050" Score="57" ViewCount="15846" Body="&lt;p&gt;In Org-mode I can surround text with &lt;code&gt;=&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt; to place text in &lt;em&gt;inline&lt;/em&gt; verbatim or code mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this fails if the text has quotes, and I couldn't find an explanation or workaround in &lt;a href=&quot;http://orgmode.org/manual/Emphasis-and-monospace.html&quot; rel=&quot;noreferrer&quot;&gt;the documentation&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;=hello=&lt;/code&gt; Renders as verbatim&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;~hello~&lt;/code&gt; Renders as code&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;=hello'=&lt;/code&gt; Fails to render as verbatim&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;~hello'~&lt;/code&gt; Fails to render as code&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The only solution that I found so far is inserting invisible characters, e.g. typing &lt;code&gt;C-x 8 &amp;lt;RET&amp;gt; 200b &amp;lt;RET&amp;gt;&lt;/code&gt;, as explained in &lt;a href=&quot;https://stackoverflow.com/questions/28331541/orgmode-inlining-verbatim-material&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this (is it a bug?) and how can I avoid this problem without inserting invisible characters?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-10-16T01:26:31.190" Title="Inline verbatim and code with quotes in Org-mode" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13821" PostTypeId="2" ParentId="13801" CreationDate="2015-07-08T23:08:58.793" Score="11" Body="&lt;p&gt;I think this is a great question. I'm sure there are tons of super helpful modes that fiction writers don't know they need. I happened upon palimpsest-mode by accident, but now I couldn't live without it. I'd love to see what packages other fiction writers find useful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some that I use every day:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/danielsz/Palimpsest&quot;&gt;palimpsest-mode&lt;/a&gt;. Sends selected text to the bottom of the file. I use it probably 20 times an hour.  &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://jblevins.org/projects/deft/&quot;&gt;Deft&lt;/a&gt;. Incremental search of text files in a directory, similar to @ttscoff's &lt;a href=&quot;http://brettterpstra.com/projects/nvalt/&quot;&gt;nvALT&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/rnkn/olivetti&quot;&gt;Olivetti&lt;/a&gt;. Make the text area smaller and nicer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/rnkn/fountain-mode&quot;&gt;Fountain&lt;/a&gt;. If you're a screenwriter.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot;&gt;Helm-swoop&lt;/a&gt; for finding things quickly.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/yuutayamada/auto-capitalize-el&quot;&gt;Auto-capitalize&lt;/a&gt;. No need to write capital letters yourself.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/lolownia/org-pomodoro&quot;&gt;Org-pomodoro&lt;/a&gt; to keep yourself on track.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/bnbeckwith/wc-mode&quot;&gt;wc-mode&lt;/a&gt; to count words if you need to.&lt;/li&gt;&#xA;&lt;li&gt;And most of all, &lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot;&gt;org-mode&lt;/a&gt; to outline. My trick is that I write notes to myself (e.g. &quot;this section needs a better intro&quot;) using org-mode comments, so they don't get included when I export. Oh, and use the command &lt;code&gt;org-narrow-to-subtree&lt;/code&gt; to focus just on the section you're working on.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-07-08T23:27:28.850" LastActivityDate="2015-07-08T23:27:28.850" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13822" PostTypeId="1" AcceptedAnswerId="13831" CreationDate="2015-07-08T23:39:18.057" Score="4" ViewCount="1119" Body="&lt;p&gt;I frequently diff against the &quot;master&quot; branch, and would like it to be easier in magit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, I can do one of these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;y&lt;/code&gt;, then scroll to &lt;code&gt;master&lt;/code&gt;, then hit &lt;code&gt;d d RET&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;l l&lt;/code&gt;, then scroll to the commit, then &lt;code&gt;d r RET&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;d r master RET&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;maybe other ways&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What I'd like is something simpler, where I can hit say &lt;code&gt;d m&lt;/code&gt; and it would show the diff against &lt;code&gt;master&lt;/code&gt; (or even better, against the result of &lt;code&gt;git merge-base master HEAD&lt;/code&gt;). How can I achieve that?&lt;/p&gt;&#xA;" OwnerUserId="862" LastEditorUserId="862" LastEditDate="2015-07-09T00:39:12.357" LastActivityDate="2018-02-28T03:37:21.173" Title="Set default branch (or revision) to diff against, in magit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13823" PostTypeId="1" AcceptedAnswerId="17004" CreationDate="2015-07-08T23:55:48.293" Score="3" ViewCount="1918" Body="&lt;p&gt;I was wondering how I can make Flycheck check the modules imported in a python file - to check if function used from a module is correct or not. Is there another mode which is able to do that for me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import utils&#xA;str = utils.chk(&quot;is this right?&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make flycheck(or any other checker) check if the imported file utils contains a function called chk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently using python-mode on Emacs 24.4 with pylint and flake8 as checkers for Flycheck on Windows 8.1 64 bit. I also have semantic installed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can that help me in anyway?&lt;/p&gt;&#xA;" OwnerUserId="8667" LastEditorUserId="591" LastEditDate="2018-10-03T23:56:46.627" LastActivityDate="2018-10-03T23:56:46.627" Title="Flycheck- check python module import" Tags="|python|flycheck|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="13824" PostTypeId="1" AcceptedAnswerId="13825" CreationDate="2015-07-09T00:40:23.777" Score="7" ViewCount="3274" Body="&lt;p&gt;I'm using a &lt;code&gt;solarized-light&lt;/code&gt; theme, it is great. As you may notice, there are several packages provide the solarized theme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  color-theme        20080305.34   installed             install color themes&#xA;  color-theme-san... 20150704.1855 installed             A version of Ethan Schoonover's Solarized themes&#xA;  color-theme-sol... 20150619.1734 installed             Solarized themes for Emacs&#xA;  solarized-theme    20150706.1028 installed             The Solarized color theme, ported to Emacs.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a result, I forgot which package I used. Here is the line that I activated it in the &lt;code&gt;init&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'solarized-light t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;describe-theme&lt;/code&gt;, it just let me specify a theme name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How to get the package name of the theme I'm using?&lt;/li&gt;&#xA;&lt;li&gt;How to get the list of current installed package? (&lt;code&gt;list-packages&lt;/code&gt; list all package both available and installed.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3872" LastActivityDate="2015-07-09T02:33:46.453" Title="How to get the package name of current using theme?" Tags="|package|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13825" PostTypeId="2" ParentId="13824" CreationDate="2015-07-09T02:17:01.703" Score="5" Body="&lt;h2&gt;Long answer for question 1:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There are two types of color themes. One built for the old &lt;code&gt;color-theme&lt;/code&gt; package which is no longer necessary for recent versions of emacs, and themes made for the new &lt;code&gt;deftheme&lt;/code&gt; system which is built into emacs and is part of &lt;code&gt;custom&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;load-theme&lt;/code&gt; is part of the built in theme system. If you use the built in system (and you should), you load and enable themes with &lt;code&gt;load-theme&lt;/code&gt; and &lt;code&gt;enable-theme&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Themes made for the old &lt;code&gt;color-theme&lt;/code&gt; package generally start with the &lt;code&gt;color-theme-&lt;/code&gt; prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using &lt;code&gt;load-theme&lt;/code&gt; then you are using the &lt;code&gt;solarized-theme&lt;/code&gt; package, not the &lt;code&gt;color-theme-solarized&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend you uninstall &lt;code&gt;color-theme&lt;/code&gt; and all &lt;code&gt;color-theme-*&lt;/code&gt; packages as they are using an outdated system of theming that won't play nice with the modern &lt;code&gt;deftheme&lt;/code&gt; themes and by the looks of it you aren't actually using them anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also important to note that there is no limit to how many themes can be enabled at once, when you use &lt;code&gt;load-theme&lt;/code&gt; or &lt;code&gt;enable-theme&lt;/code&gt; to enable a theme it does not disable the other themes. If you want to disable a previously enabled theme you use &lt;code&gt;disable-theme&lt;/code&gt; which will prompt you for one of the enabled themes when run &lt;code&gt;interactively&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to know what themes are enabled currently. You can look at the value of the variable &lt;code&gt;custom-enabled-themes&lt;/code&gt;. Once you know what theme's you are using, you can use &lt;code&gt;describe-theme&lt;/code&gt; to get a link to the file where the theme is located.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Short answer for question 2:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;An easy way to get a list of installed packages is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar 'car package-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not aware of an easy built in way to filter the package list buffer to only installed items, but you could copy the contents of the package list buffer to another buffer then use &lt;code&gt;delete-non-matching-lines&lt;/code&gt; with a regexp of &lt;code&gt;[0-9] *installed&lt;/code&gt; to filter the data manually.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-07-09T02:33:46.453" LastActivityDate="2015-07-09T02:33:46.453" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13826" PostTypeId="2" ParentId="13817" CreationDate="2015-07-09T02:59:05.747" Score="4" Body="&lt;p&gt;I have an answer using elisp formulas:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :results none&#xA;  (defun jj/factor (code)&#xA;    (let ((prefix (string-to-char code)))&#xA;      (cond ((eq prefix ?P) 0.1)&#xA;            ((eq prefix ?Q) 0.2)&#xA;            ((eq prefix ?E) 0.3)&#xA;            ((eq prefix ?F) 0.4)&#xA;            (t 1.0))))&#xA;&#xA;  (defun jj/factorlist (codelist)&#xA;    (mapcar 'jj/factor codelist))&#xA;&#xA;  (defun jj/dotproduct (a b)&#xA;    (apply '+ (mapcar* '* (jj/factorlist a) (mapcar 'string-to-number b))))&#xA;#+end_src&#xA;&#xA;&#xA;|        |        | P1 | P2 | P3 | P4 | Q1 | Q2 | E1  | E2  | F   |&#xA;|--------+--------+----+----+----+----+----+----+-----+-----+-----|&#xA;|        | Totals | 20 | 40 | 35 | 20 | 50 | 45 | 100 | 100 | 200 |&#xA;|--------+--------+----+----+----+----+----+----+-----+-----+-----|&#xA;| John   |        | 18 | 18 | 15 | 0  | 45 | 22 | 45  | 97  | 112 |&#xA;| Paul   |        | 4  | 12 | 4  | 8  | 10 | 14 | 31  | 58  | 158 |&#xA;| George |        | 15 | 34 | 32 | 16 | 46 | 12 | 94  | 46  | 141 |&#xA;| Ringo  |        | 20 | 17 | 25 | 1  | 49 | 16 | 61  | 52  | 129 |&#xA;#+TBLFM: @3$2..@&amp;gt;$2='(jj/dotproduct (list @1$3..@1$&amp;gt;) (list $3..$&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You have to evaluate the source block once (by hitting &lt;code&gt;C-c C-c&lt;/code&gt; over it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;jj/factor&lt;/code&gt; function assigns a numeric factor given the a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second function, &lt;code&gt;jj/factorlist&lt;/code&gt; gets a list of factors from a list of strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last function, &lt;code&gt;jj/dotproduct&lt;/code&gt;, will sum all products as you intended.&lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="53" LastEditDate="2015-07-09T18:50:16.457" LastActivityDate="2015-07-09T18:50:16.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13827" PostTypeId="2" ParentId="13820" CreationDate="2015-07-09T04:28:52.070" Score="8" Body="&lt;p&gt;You can remove the quote characters from &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt; as described by @Malabarba in this &lt;a href=&quot;http://endlessparentheses.com/applying-markup-to-strings-in-org-mode.html&quot;&gt;blog post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relevant code from that post:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; This HAS to come before (require 'org)&#xA;(setq org-emphasis-regexp-components&#xA;      '(&quot;     ('\&quot;{“”&quot;&#xA;        &quot;-   .,!?;''“”\&quot;)}/\\“”&quot;&#xA;        &quot;    \r\n,&quot;&#xA;        &quot;.&quot;&#xA;        1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the doc string for &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt;: by default the quote characters are considered:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;border  -  The chars &lt;em&gt;forbidden&lt;/em&gt; as border characters.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-07-09T04:28:52.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13828" PostTypeId="2" ParentId="13820" CreationDate="2015-07-09T06:49:09.887" Score="66" Body="&lt;p&gt;First of all: This is Emacs. &lt;strong&gt;It's not a bug, it's a setting!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, @glucas is correct in saying that &lt;strong&gt;you need to modify &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt;&lt;/strong&gt; to get what you want. However, I'd like to suggest two modifications to his (@Malabarba's) code and provide a bit more context:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You don't need to copy the entire value of &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt; to your init-file to modify a single component. For your use case the following is sufficient:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar (nthcdr 2 org-emphasis-regexp-components) &quot; \t\r\n,\&quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You don't &lt;em&gt;have to&lt;/em&gt; modify &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt; before loading &lt;code&gt;org-mode&lt;/code&gt; via &lt;code&gt;(require 'org)&lt;/code&gt;. Just add the following line after your modifications:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;More context&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In case you want to customize other aspects of how emphasis markup works in &lt;code&gt;org-mode&lt;/code&gt;, know this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt; is a list with five entries.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The first entry controls which characters are allowed to &lt;em&gt;immediately precede&lt;/em&gt; markup characters. If you want to be able to have something like &lt;code&gt;why=hello=&lt;/code&gt; render correctly, you'll need to modify this entry.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar org-emphasis-regexp-components &quot;...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The second entry controls which characters are allowed to &lt;em&gt;immediately follow&lt;/em&gt; markup characters. If you want to be able to have something like &lt;code&gt;=hello=there&lt;/code&gt; render correctly, you'll need to modify this entry.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar (nthcdr 1 org-emphasis-regexp-components) &quot;...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The third entry specifies the characters that are &lt;em&gt;not&lt;/em&gt; allowed as &lt;em&gt;border characters&lt;/em&gt;, i.e., characters that immediately follow an opening markup character or  precede a closing markup character. You'll need to modify this to make things like &lt;code&gt;='hello'=&lt;/code&gt; render correctly.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar (nthcdr 2 org-emphasis-regexp-components) &quot;...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The fourth entry lists characters that are allowed in the body of your marked up string, i.e., characters that appear &lt;em&gt;between&lt;/em&gt; the border characters. You'll rarely need to modify this; by default, &lt;em&gt;any&lt;/em&gt; character is allowed as a body character.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar (nthcdr 3 org-emphasis-regexp-components) &quot;...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The fifth entry specifies how many newlines are allowed inside a marked up expression. By default, &lt;code&gt;org-mode&lt;/code&gt; allows a single newline. So if you want to be able to add markup to text that spans more than two consecutive lines, you'll need to modify this entry.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcar (nthcdr 4 org-emphasis-regexp-components) N)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... where &lt;code&gt;N&lt;/code&gt; is the number of newlines you want to allow.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Related posts&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;People seem to run into this issue fairly frequently. Aside from the &lt;a href=&quot;https://stackoverflow.com/q/28331541/1199226&quot;&gt;post you mentioned&lt;/a&gt;, there are at least two more questions on StackOverflow that deal with very similar issues:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/q/24169333/1199226&quot;&gt;How can I emphasize or verbatim quote a comma in org mode?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/q/1218238/1199226&quot;&gt;How to make part of a word bold in org-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="504" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-07-09T12:25:19.973" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="13829" PostTypeId="2" ParentId="13814" CreationDate="2015-07-09T07:55:50.177" Score="2" Body="&lt;p&gt;Thanks to Kaushalmodi for the reference, the package &lt;a href=&quot;https://github.com/vlevit/key-seq.el&quot; rel=&quot;nofollow&quot;&gt;key-seq&lt;/a&gt; solved my question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set it up as following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-seq-define evil-normal-state-map &quot;fl&quot; 'evil-window-right)&#xA;(key-seq-define evil-normal-state-map &quot;fh&quot; 'evil-window-left)&#xA;(key-seq-define evil-normal-state-map &quot;fj&quot; 'evil-window-down)&#xA;(key-seq-define evil-normal-state-map &quot;fk&quot; 'evil-window-up)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which solved my issue. If you want to find the character &lt;code&gt;j&lt;/code&gt; or &lt;code&gt;l&lt;/code&gt; for example, just press f and then wait 400 milliseconds, then you press the character &lt;code&gt;j&lt;/code&gt; for example. Or you can switch to windows when you're typing normally.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-07-09T21:30:32.527" LastActivityDate="2015-07-09T21:30:32.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13830" PostTypeId="1" AcceptedAnswerId="13833" CreationDate="2015-07-09T08:11:42.480" Score="3" ViewCount="171" Body="&lt;p&gt;Magit's &lt;code&gt;magit-interactive-rebase&lt;/code&gt; function handles the Git interactive rebase very well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there's one action it seems to be missing. According to &lt;code&gt;git-rebase(1)&lt;/code&gt;, the four actions during interactive rebase are &lt;code&gt;--continue&lt;/code&gt;, &lt;code&gt;--skip&lt;/code&gt;, &lt;code&gt;--abort&lt;/code&gt;, &lt;code&gt;--edit-todo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That last one doesn't appear to be available in Magit. How can I tell Magit to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Present the rebase todo document again, for editing. Then&lt;/li&gt;&#xA;&lt;li&gt;Continue on, obeying the edited rebase todo document.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2506" LastActivityDate="2015-07-09T09:58:24.190" Title="What Magit command allows re-editing the todo list, during a rebase?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13831" PostTypeId="2" ParentId="13822" CreationDate="2015-07-09T08:30:43.073" Score="8" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;or even better, against the result of &lt;code&gt;git merge-base master HEAD&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That would be &lt;code&gt;master...HEAD&lt;/code&gt; (see &lt;a href=&quot;https://stackoverflow.com/questions/7251477/what-are-the-differences-between-double-dot-and-triple-dot-in-git-dif&quot;&gt;https://stackoverflow.com/questions/7251477/what-are-the-differences-between-double-dot-and-triple-dot-in-git-dif&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Actually what I think I want is the diff between that &quot;common ancestor&quot; commit, and the current working tree (or staging area) rather than the committed HEAD.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For that you can use &lt;code&gt;magit-diff-working-tree&lt;/code&gt; (or &lt;code&gt;magit-diff-staged&lt;/code&gt;) with &lt;code&gt;magit-git-string&lt;/code&gt; to get the merge-base.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun magit-diff-master (&amp;amp;optional args)&#xA;  &quot;Show diff range master...HEAD&quot;&#xA;  (interactive (list (magit-diff-arguments)))&#xA;  (magit-diff &quot;master...HEAD&quot; args))&#xA;&#xA;(defun magit-diff-mbase (&amp;amp;optional args)&#xA;  &quot;Show diff of $(git merge-base master HEAD) to working tree.&quot;&#xA;  (interactive (list (magit-diff-arguments)))&#xA;  (magit-diff-working-tree&#xA;   (magit-git-string &quot;merge-base&quot; &quot;master&quot; &quot;HEAD&quot;) args))&#xA;&#xA;(magit-define-popup-action 'magit-diff-popup&#xA;  ?m &quot;Diff merge-base master&quot; 'magit-diff-mbase)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="18641" LastEditDate="2018-02-28T03:37:21.173" LastActivityDate="2018-02-28T03:37:21.173" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13832" PostTypeId="1" CreationDate="2015-07-09T09:39:36.040" Score="4" ViewCount="1952" Body="&lt;p&gt;I use org-mode for time tracking and can calculate the overall time with C-c C-x d. Is there a good way to show total time spent over several org-mode files (I tend to have separate projects in separate files)?&lt;/p&gt;&#xA;" OwnerUserId="2400" LastActivityDate="2016-03-07T14:36:53.930" Title="Is there a good way to see accumulated time over several org files using org-mode time tracking?" Tags="|org-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13833" PostTypeId="2" ParentId="13830" CreationDate="2015-07-09T09:58:24.190" Score="3" Body="&lt;p&gt;&lt;em&gt;First update to &lt;code&gt;2.1.0&lt;/code&gt; which was released a little while ago and brings many improvements in this area. Then...&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rebase sequences are initiated and continued using the rebase popup on &lt;kbd&gt;r&lt;/kbd&gt;. Depending on whether a sequence is already in progress or not, the popup offers different commands. When a rebase is in progress, then &quot;edit&quot; is one of these commands.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-07-09T09:58:24.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13834" PostTypeId="2" ParentId="13832" CreationDate="2015-07-09T09:59:58.040" Score="5" Body="&lt;p&gt;In the agenda, hit &lt;code&gt;R&lt;/code&gt; to add a &quot;clock report&quot; at the bottom, which summarises time spent on tasks by the org file they're in, as well as shows the total time.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-07-09T09:59:58.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13835" PostTypeId="2" ParentId="13801" CreationDate="2015-07-09T10:10:08.820" Score="6" Body="&lt;p&gt;Here is what I take to be your goal:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The ability to focus on a particular chunk of text while getting the rest of it out of your way,&lt;/li&gt;&#xA;&lt;li&gt;The ability to move big chunks of text around quickly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This solution uses only out-of-the-box Emacs functionality:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;narrowing&lt;/li&gt;&#xA;&lt;li&gt;split windows&lt;/li&gt;&#xA;&lt;li&gt;indirect buffers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;First of all, if you write your document in &lt;code&gt;org-mode&lt;/code&gt; (or any mode that makes use of Emacs' &lt;code&gt;outline&lt;/code&gt; facilities), you'll be able to structure your document with headings, sub-headings, etc., and then hide or show the bodies of those elements.  For prose, you may find it helpful to be very elemental: a header for a chapter, a sub-header for a section, a sub-sub-header for a subsection, all the way down to a sub-sub-...-header for each individual paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, even though &lt;code&gt;org-mode&lt;/code&gt; will allow you to hide the bodies of your headers and focus only on the body in front of you, it will leave the section headers on the screen.  You may or may not find that distracting.  If you do, you can &lt;code&gt;narrow&lt;/code&gt; the buffer just to that header (making all of the rest of the headers disappear temporarily from view) and then &lt;code&gt;widen&lt;/code&gt; again when you want to see the other text again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, to get an easy outline view and the ability to move text around quickly, you can use a combination of split windows and indirect buffers.  Make your Emacs frame wide enough to accommodate two windows (see &lt;a href=&quot;https://emacs.stackexchange.com/questions/13583/whats-the-difference-between-a-buffer-a-file-a-window-and-a-frame/13584#13584&quot;&gt;this post&lt;/a&gt; for frame/window terminology).  Do &lt;code&gt;M-x split-window-horizontally&lt;/code&gt; to get two windows side-by-side in your frame.  In the window that has your document, do &lt;code&gt;M-x clone-indirect-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you have two linked copies of the same document in two different buffers.  Put them in your two windows.  Although they will both contain identical text, you can make them look different in the two windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One very useful way to use this facility is to have a main editing window in which you actually enter and edit your prose, and use the other window as your outline view: hide the bodies to show only the headers in a given section/subsection/whatever to give yourself an overview of the document's structure.  You can then move chunks around quickly -- if you're using &lt;code&gt;org-mode&lt;/code&gt;, &lt;code&gt;M-&amp;lt;up&amp;gt;&lt;/code&gt; and &lt;code&gt;M-&amp;lt;down&amp;gt;&lt;/code&gt; run &lt;code&gt;org-metaup&lt;/code&gt; and &lt;code&gt;org-metadown&lt;/code&gt;, respectively, which, in this context, will move subtrees (a header and everything below it) up or down in the document.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-07-09T11:20:53.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13836" PostTypeId="1" AcceptedAnswerId="13845" CreationDate="2015-07-09T13:09:55.093" Score="6" ViewCount="441" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I abbreviate the version control information in the mode line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buffers visiting a file under version control display branch information in the mode line as &lt;code&gt;VCtype-branch&lt;/code&gt;.  That's fine, but my mode line is already quite cluttered, so I'd like to abbreviate that information if possible.  I can always use short branch names, but I'm wondering if I can at least shorten the &lt;code&gt;VCtype&lt;/code&gt; information (eg, &lt;code&gt;Git-mybranch&lt;/code&gt; =&gt; &lt;code&gt;G-mybranch&lt;/code&gt;).  How would I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS My understanding (which could be wrong) is that &lt;a href=&quot;http://www.emacswiki.org/emacs/DiminishedModes&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;diminish&lt;/code&gt;&lt;/a&gt; would not be relevant in this situation.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-09T17:23:39.193" Title="How to abbreviate version control information in the mode line?" Tags="|mode-line|version-control|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13838" PostTypeId="2" ParentId="13819" CreationDate="2015-07-09T13:24:16.437" Score="2" Body="&lt;p&gt;It's probably easier to insert your own stylesheet in the head of your HTML mail instead of replacing the default settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook&#xA; 'org-mime-html-hook&#xA; (lambda () (insert (concat &quot;&amp;lt;head&amp;gt;\n&amp;lt;style&amp;gt;\n&quot;&#xA;                       (with-temp-buffer&#xA;                         (insert-file-contents&#xA;                          (expand-file-name &quot;~/orgmode/org-mime.css&quot;))&#xA;                         (buffer-string)) &quot;&amp;lt;/style&amp;gt;\n&amp;lt;/head&amp;gt;\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2015-07-09T13:24:16.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13839" PostTypeId="2" ParentId="13793" CreationDate="2015-07-09T13:46:13.903" Score="6" Body="&lt;p&gt;The formula is quite simple ;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-clockreport-parameter-plist&#xA;      (quote (:link t :maxlevel 5 :fileskip0 t :compact t :narrow 80 :formula %)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2015-07-09T15:08:05.283" LastActivityDate="2015-07-09T15:08:05.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13841" PostTypeId="2" ParentId="13712" CreationDate="2015-07-09T14:21:05.447" Score="0" Body="&lt;p&gt;You might want to look at &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-mac-link.html&quot; rel=&quot;nofollow&quot;&gt;org-mac-link&lt;/a&gt;, which can pull links to a specific page in a PDF in &lt;a href=&quot;http://skim-app.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Skim PDF&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-07-09T14:21:05.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13842" PostTypeId="1" AcceptedAnswerId="13874" CreationDate="2015-07-09T15:52:24.887" Score="3" ViewCount="619" Body="&lt;p&gt;I'd like to customize the mode line with my own faces, depending on&#xA;whether a particular window is selected or not. Let's say I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq-default mode-line-format&#xA;              '((:eval (propertize&#xA;                        (format-mode-line&#xA;                         mode-line-buffer-identification)&#xA;                        'face (if nil&#xA;                                  'mode-line&#xA;                                'mode-line-inactive)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to put instead of &lt;code&gt;nil&lt;/code&gt; a predicate that checks if the&#xA;current window is selected. How could I do that?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-14T12:28:23.463" Title="How to get the window for mode-line-format?" Tags="|mode-line|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13843" PostTypeId="2" ParentId="13817" CreationDate="2015-07-09T16:03:39.917" Score="3" Body="&lt;p&gt;You can &lt;a href=&quot;http://orgmode.org/manual/Column-groups.html#Column-groups&quot; rel=&quot;nofollow&quot;&gt;group columns for output formatting&lt;/a&gt; only, but you can't then refer to them like you can with row groups (&lt;code&gt;@I..II&lt;/code&gt; etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do though is &lt;a href=&quot;http://orgmode.org/manual/Advanced-features.html#Advanced-features&quot; rel=&quot;nofollow&quot;&gt;give columns names&lt;/a&gt; and refer to them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| $ |    |    |    | x=2   |&#xA;| ! | p1 |    | pn |       |&#xA;|   | P1 | P2 | P3 | Total |&#xA;|---+----+----+----+-------|&#xA;|   | 1  |  2 | 3  | 12    |&#xA;#+TBLFM: @4$5=vsum($p1..$pn)*$x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to add a &lt;code&gt;p4&lt;/code&gt; column by putting the point in &lt;code&gt;Total&lt;/code&gt; and pressing &lt;code&gt;M-S-right&lt;/code&gt; you will have to manually move the &lt;code&gt;pn&lt;/code&gt; label from the &lt;code&gt;p3&lt;/code&gt; to the &lt;code&gt;p4&lt;/code&gt; column, so it is not quite as convenient as the &lt;code&gt;@I&lt;/code&gt; syntax for rows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you can store your constants in the table using a row marked &lt;code&gt;$&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8856" LastEditorUserId="8856" LastEditDate="2015-07-09T16:19:13.120" LastActivityDate="2015-07-09T16:19:13.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13845" PostTypeId="2" ParentId="13836" CreationDate="2015-07-09T16:49:36.910" Score="8" Body="&#xA;&#xA;&lt;p&gt;Here is a piece of advice that shortens &lt;code&gt;Git&lt;/code&gt; to &lt;code&gt;G&lt;/code&gt;, while leaving mode line strings for other version control systems unchanged:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-shorten-vc-mode-line (string)&#xA;  (cond&#xA;   ((string-prefix-p &quot;Git&quot; string)&#xA;    (concat &quot;G&quot; (substring string 3)))&#xA;   (t&#xA;    string)))&#xA;&#xA;(advice-add 'vc-git-mode-line-string :filter-return 'my-shorten-vc-mode-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It uses the new advice facility introduced in Emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On earlier Emacs versions, you need to use &lt;code&gt;defadvice&lt;/code&gt; to define an &lt;code&gt;around&lt;/code&gt; advice that modifies &lt;code&gt;ad-return-value&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice vc-git-mode-line-string (around shorten compile activate)&#xA;  (let ((string ad-do-it))&#xA;    (when (string-prefix-p &quot;Git&quot; string)&#xA;      (setq ad-return-value (concat &quot;G&quot; (substring string 3))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastEditorUserId="115" LastEditDate="2015-07-09T17:23:39.193" LastActivityDate="2015-07-09T17:23:39.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13846" PostTypeId="1" AcceptedAnswerId="13848" CreationDate="2015-07-09T17:02:48.373" Score="3" ViewCount="163" Body="&lt;p&gt;is it possible to define key bindings at one place in an init file? something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key-bindings&#xA;    '((&quot;C-x M-f&quot; 'fly)&#xA;      (&quot;C-x M-k&quot; 'run)&#xA;       ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8858" LastActivityDate="2015-07-09T18:58:42.757" Title="Defining key binding at one place" Tags="|key-bindings|init-file|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13847" PostTypeId="2" ParentId="13846" CreationDate="2015-07-09T17:13:18.000" Score="4" Body="&lt;p&gt;Yes, of course.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun define-key-bindings (bindings &amp;amp;optional keymap)&#xA;  (unless keymap (setq keymap  global-map))&#xA;  (dolist (bdg  bindings)&#xA;    (define-key keymap (kbd (car bdg)) (cadr bdg))))&#xA;&#xA;(define-key-bindings '((&quot;C-x M-f&quot; fly) (&quot;C-x M-k&quot; run)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Drop the quote marks before the command names - not needed.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-09T17:13:18.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13848" PostTypeId="2" ParentId="13846" CreationDate="2015-07-09T18:32:50.727" Score="5" Body="&#xA;&#xA;&lt;p&gt;If you are open to installing a package, give &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; (also available on Melpa) a try, which comes with the &lt;code&gt;bind-key.el&lt;/code&gt; library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;use-package&lt;/code&gt; installed, you can do something like below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-keys&#xA;  :map MINOR-MODE-MAP ; if this line is removed, bindings happen in `global-map'&#xA;                      ; else they happen in MINOR-MODE-MAP&#xA;  (&quot;C-x M-f&quot; . fly)&#xA;  (&quot;C-x M-k&quot; . run))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are more variants of &lt;code&gt;bind-keys&lt;/code&gt; like &lt;code&gt;bind-key&lt;/code&gt;, &lt;code&gt;bind-keys*&lt;/code&gt;, &lt;code&gt;bind-key*&lt;/code&gt; and even &lt;code&gt;unbind-key&lt;/code&gt;. Check out the documentation in the header of &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;bind-key.el&lt;/code&gt;&lt;/a&gt; to learn more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The added benefit of using &lt;code&gt;bind-keys&lt;/code&gt; (and family) is that you can see a summary of all your personal keybindings currently in effect using &lt;code&gt;M-x describe-personal-keybindings&lt;/code&gt;. That will also tell you if you've overridden a pre-bound key using &lt;code&gt;bind-keys&lt;/code&gt; (and family).&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-09T18:58:42.757" LastActivityDate="2015-07-09T18:58:42.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13850" PostTypeId="2" ParentId="7250" CreationDate="2015-07-09T19:06:25.303" Score="1" Body="&lt;p&gt;I am using the following two functions with different timestamp formats. &#xA;The number of digits to be used in year ie 2015 or 15 and hours, minutes, seconds etc can also be specified. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun now ()&#xA;  &quot;Insert string for the current time formatted like '2:34 PM' or 1507121460&quot;&#xA;  (interactive)                 ; permit invocation in minibuffer&#xA;  ;;(insert (format-time-string &quot;%D %-I:%M %p&quot;)))&#xA;  ;;(insert (format-time-string &quot;%02y%02m%02d%02H%02M%02S&quot;)))&#xA;  (insert (format-time-string &quot;%02y%02m%02d%02H%02M&quot;)))&#xA;&#xA;(defun today ()&#xA;  &quot;Insert string for today's date nicely formatted in American style,&#xA;  e.g. Sunday, September 17, 2000 or standard 17-09-2000.&quot;&#xA;  (interactive)       ; permit invocation in minibuffer&#xA;  ;;(insert (format-time-string &quot;%A, %B %e, %Y&quot;)))&#xA;  (insert (format-time-string &quot;%d-%m-%y&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2517" LastActivityDate="2015-07-09T19:06:25.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13851" PostTypeId="2" ParentId="13595" CreationDate="2015-07-09T19:46:52.103" Score="1" Body="&lt;p&gt;If you mean via Org's &lt;a href=&quot;http://orgmode.org/manual/Extracting-source-code.html&quot; rel=&quot;nofollow&quot;&gt;tangle features&lt;/a&gt; then yes, it lets you tangle out arbitrary files, and will even syntax highlight them if you have the proper major-modes installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, &lt;a href=&quot;http://fort.kickass.systems:10082/cgit/personal/rrix/pub/fsem.git/tree/fsem.org&quot; rel=&quot;nofollow&quot;&gt;my dotfiles repo&lt;/a&gt; contains a single Org file that tangles out to all of my configurations and looks darn nice when exported.&lt;/p&gt;&#xA;" OwnerUserId="8861" LastActivityDate="2015-07-09T19:46:52.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13852" PostTypeId="2" ParentId="13832" CreationDate="2015-07-09T19:57:31.807" Score="1" Body="&lt;p&gt;Along with the Agenda's clockreport, you can drop &lt;a href=&quot;http://orgmode.org/manual/The-clock-table.html&quot; rel=&quot;nofollow&quot;&gt;inline clocktables&lt;/a&gt; in to your Org files, which is nice if you're looking for something more static than what an Agenda will generate.&lt;/p&gt;&#xA;" OwnerUserId="8861" LastActivityDate="2015-07-09T19:57:31.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13853" PostTypeId="1" AcceptedAnswerId="13854" CreationDate="2015-07-09T20:09:20.417" Score="4" ViewCount="1475" Body="&lt;p&gt;The function &lt;code&gt;org-toggle-heading&lt;/code&gt; is quite handy to convert existing text into an org heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pay rent&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* pay rent&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;org-insert-heading&lt;/code&gt; has an analogous &lt;code&gt;org-insert-todo-heading&lt;/code&gt;, but I don't see the function &lt;code&gt;org-toggle-todo-heading&lt;/code&gt; as a counterpart to &lt;code&gt;org-toggle-heading&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Desired output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO pay rent&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a function to convert existing text into org todo heading?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-07-09T20:58:00.987" LastActivityDate="2015-07-10T14:14:06.427" Title="how to org-toggle-todo-heading?" Tags="|org-mode|todo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13854" PostTypeId="2" ParentId="13853" CreationDate="2015-07-09T20:22:33.410" Score="6" Body="&lt;h1&gt;My preferred implementation&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This alternative solution will &lt;em&gt;not&lt;/em&gt; act as a toggle, but it will directly convert &lt;code&gt;Heading&lt;/code&gt; to &lt;code&gt;* TODO Heading&lt;/code&gt; on hitting &lt;code&gt;C-c C-t&lt;/code&gt; (The Shift bindings will not work here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this approach is that you do not need to remember a new function or binding just for this special plain text to TODO conversion; the &lt;code&gt;C-c C-t&lt;/code&gt; default binding for &lt;code&gt;org-todo&lt;/code&gt; will work in DWIM fashion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, both of the below conversions happen when using the same &lt;code&gt;C-c C-t&lt;/code&gt; binding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Heading▮   -- (C-c C-t)--&amp;gt; * TODO Heading▮&#xA;* Heading▮ -- (C-c C-t)--&amp;gt; * TODO Heading▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/org-first-convert-to-heading (orig-fun &amp;amp;rest args)&#xA;  (let ((is-heading))&#xA;    (save-excursion&#xA;      (forward-line 0)&#xA;      (when (looking-at &quot;^\\*&quot;)&#xA;        (setq is-heading t)))&#xA;    (unless is-heading&#xA;      (org-toggle-heading))&#xA;    (apply orig-fun args)))&#xA;(advice-add 'org-todo :around #'modi/org-first-convert-to-heading)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;You need to be using emacs 24.4+ for the above advice system to work.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Toggle current line between a non-heading and &lt;code&gt;TODO&lt;/code&gt; heading&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Below function will work on a non-empty line as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the line contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Heading▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x my/org-toggle-heading-and-todo&lt;/code&gt; will convert that to,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Heading▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling that function again will convert it back to,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Heading▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Defining &lt;code&gt;my/org-toggle-heading-and-todo&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-toggle-heading-and-todo ()&#xA;  &quot;Toggles the current line between a non-heading and TODO heading.&quot;&#xA;  (interactive)&#xA;  (let ((is-heading))&#xA;    (save-excursion&#xA;      (forward-line 0)&#xA;      (when (looking-at &quot;^\\*&quot;) &#xA;        (setq is-heading t)))&#xA;    (if is-heading &#xA;        (progn&#xA;          (org-todo 'none) ; remove TODO&#xA;          (org-toggle-heading)) ; remove heading&#xA;      (progn&#xA;        (org-toggle-heading) ; convert to heading&#xA;        (org-todo 'nextset))))) ; add TODO&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Cycle only the &lt;code&gt;TODO&lt;/code&gt; states&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;While the point is anywhere on the heading&lt;/strong&gt;, &lt;code&gt;S-right&lt;/code&gt;/&lt;code&gt;S-left&lt;/code&gt; will cycle through all the &lt;code&gt;TODO&lt;/code&gt; states. &lt;em&gt;This works even if &lt;code&gt;shift-select-mode&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;. The key is to have the point/cursor on the heading.&lt;/em&gt; I also noticed that the &lt;code&gt;org-treat-S-cursor-todo-selection-as-state-change&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt; by default (and that's why the shift bindings for changing &lt;code&gt;TODO&lt;/code&gt; states work).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below, the point is on the heading&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After pressing &lt;code&gt;S-right&lt;/code&gt;, I get,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Heading▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After pressing &lt;code&gt;S-left&lt;/code&gt;, I once again get,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/TODO-basics.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;My org version as of writing this is 8.2.10.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-10T14:14:06.427" LastActivityDate="2015-07-10T14:14:06.427" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="13855" PostTypeId="1" AcceptedAnswerId="13860" CreationDate="2015-07-09T20:35:18.380" Score="10" ViewCount="1885" Body="&lt;p&gt;I would like to append some information (that changes over time) to the mode line &lt;strong&gt;format&lt;/strong&gt; and then use it in the title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thought being is that once a minute I would set the frame-title-format to be that of the mode-line-format + pomodoro count.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something along the lines of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun runOnceAMinute ()&#xA;   (setq frame-title-format (concat mode-line-format my/PomodoroCount))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I can't quite figure out how. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;I would need to update the string that I append. E.g the pomodoro-count would increment after each pomodoro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt;&lt;br&gt;&#xA;I got it to work by editing &lt;code&gt;mode-line-format&lt;/code&gt; variable and using the eval construct:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;%e&quot; ......... &quot;[Pomodorors: &quot; (:eval (number-to-string my/pomCount)) &quot;]&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is not Drew's original answer, but Drew mentioned it in his comment.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="5350" LastEditDate="2015-07-13T22:23:58.090" LastActivityDate="2019-11-29T09:34:45.913" Title="How to append string that get's updated to mode line?" Tags="|mode-line|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13856" PostTypeId="5" CreationDate="2015-07-09T20:36:14.837" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-09T20:36:14.837" LastActivityDate="2015-07-09T20:36:14.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13857" PostTypeId="4" CreationDate="2015-07-09T20:36:14.837" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-09T20:36:14.837" LastActivityDate="2015-07-09T20:36:14.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13858" PostTypeId="1" AcceptedAnswerId="14443" CreationDate="2015-07-09T21:17:03.797" Score="4" ViewCount="456" Body="&lt;p&gt;When start a command asynchronously, using (start-process ...), the output is added to the buffer 3-5 times more slowly than if I had used (async-shell-command ...). I don't have any output filters, I need start process because I need to be notified when the process exits. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue seems to have been raised here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html//emacs-devel/2008-07/msg01436.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lists.gnu.org/archive/html//emacs-devel/2008-07/msg01436.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but apparently it was never resolved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is causing the significant slowdown in output (basically I just want to dump all the output to a buffer and be notified when that is done). Are there output filters running even though I haven't specified any? Is this a matter of increasing some buffer size?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: There's a related question here and an apparent patch available. &#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/10573/size-of-process-output-sent-to-filter-functions&quot;&gt;Size of process output sent to filter functions&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-08-03T23:06:25.627" Title="start-process output processed too slowly" Tags="|process|async|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13859" PostTypeId="1" AcceptedAnswerId="13953" CreationDate="2015-07-09T21:46:36.560" Score="1" ViewCount="636" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  Is there a publicly available plugin/modification for the &lt;code&gt;speedbar.el&lt;/code&gt; library to mark/unmark and essentially implement &lt;code&gt;speebar-get-marked-files&lt;/code&gt; similar to &lt;code&gt;dired-mode&lt;/code&gt;'s &lt;code&gt;dired-get-marked-files&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If such a feature does not yet exist, then this thread can be used to create that new feature and combine it with the power of &lt;code&gt;dired-do-create-files&lt;/code&gt; and &lt;code&gt;dired-create-files&lt;/code&gt; for file management capabilities -- i.e., copy, rename, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following screenshot demonstrates the concept using &lt;code&gt;dired-mode&lt;/code&gt; and &lt;code&gt;dired+&lt;/code&gt; to the right, the middle is a custom creation modifying &lt;code&gt;ztree&lt;/code&gt;, and the left is a slightly modified version of speedbar.  The goal will be to create a plugin/modification that works out-of-the-box with a generic/stock version of speedbar.&#xA;&lt;img src=&quot;https://www.lawlist.com/images/speedbar.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.823" LastActivityDate="2016-11-17T03:49:48.347" Title="speedbar -- mark/unmark directories/files -- `speedbar-get-marked-files`" Tags="|dired|speedbar|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13860" PostTypeId="2" ParentId="13855" CreationDate="2015-07-09T21:48:14.383" Score="7" Body="&lt;p&gt;Append it to &lt;code&gt;global-mode-string&lt;/code&gt;.  If your mode-line format string to append is &lt;code&gt;my-string&lt;/code&gt; then:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq global-mode-string&#xA;      (cond ((consp global-mode-string)&#xA;             (add-to-list 'global-mode-string my-string 'APPEND))&#xA;            ((not global-mode-string)&#xA;             (list my-string))&#xA;            ((stringp global-mode-string)&#xA;             (list global-mode-string my-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[If you instead wanted to &lt;em&gt;pre&lt;/em&gt;pend it to &lt;code&gt;global-mode-string&lt;/code&gt; then you would remove the &lt;code&gt;'APPEND&lt;/code&gt; optional argument and reverse the order of the last list: &lt;code&gt;(list my-string global-mode-string)&lt;/code&gt;.]&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-09T21:48:14.383" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13861" PostTypeId="1" AcceptedAnswerId="13896" CreationDate="2015-07-09T22:09:24.607" Score="0" ViewCount="1606" Body="&lt;p&gt;Often I &lt;code&gt;ssh&lt;/code&gt; onto a remote machine from &lt;code&gt;ansi-term&lt;/code&gt; and wish to open various files in Emacs. As I see it, there are two options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs -nw filename&lt;/code&gt; - hiding the terminal, opening the file in the current buffer and generally creating all sorts of havoc with the key-bindings&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs filename&lt;/code&gt; - opening in new window&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd like to use &lt;code&gt;emacs filename&lt;/code&gt; to open the file in a separate buffer in the current window. I'm wondering if such a function exists, or if it might be easily written. Between &lt;code&gt;ansi-term&lt;/code&gt; and &lt;code&gt;tramp&lt;/code&gt;, the machinery seems to be there.&lt;/p&gt;&#xA;" OwnerUserId="8854" LastActivityDate="2015-07-14T22:34:49.007" Title="Combining ssh through 'term' with 'tramp' to open file in buffer" Tags="|buffers|tramp|ansi-term|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13862" PostTypeId="2" ParentId="13858" CreationDate="2015-07-09T22:25:50.967" Score="1" Body="&lt;p&gt;Emacs is much slower than a plain text terminal to display a buffer. This is why&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(start-process &quot;catxdisp&quot; (current-buffer) &quot;time&quot; &quot;cat&quot; (expand-file-name &quot;src/xdisp.c&quot; source-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;takes much more time than e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t; -*-&#xA;(let ((buf (get-buffer-create &quot;catxdisp&quot;)))&#xA;  (set-process-sentinel&#xA;   (start-process &quot;catxdisp&quot; buf &quot;time&quot; &quot;cat&quot; (expand-file-name &quot;src/xdisp.c&quot; source-directory))&#xA;   (lambda (_ _)&#xA;     (display-buffer buf))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(the process sentinel is a way to display the buffer only when the process has finished.) On my system the former (which displays the output continuously) takes about 11 seconds while the latter (which only displays the buffer with the output once it's all done) takes about 2 seconds.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-07-09T22:25:50.967" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13863" PostTypeId="2" ParentId="13832" CreationDate="2015-07-09T23:00:50.930" Score="2" Body="&lt;p&gt;You can create a &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html&quot; rel=&quot;nofollow&quot;&gt;custom agenda command&lt;/a&gt; to assemble arbitrary tasks from various files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then have a couple of ways of showing the clocking information:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A &lt;a href=&quot;https://emacs.stackexchange.com/questions/9738/org-agenda-todo-effort-rollup&quot;&gt;custom org-agenda-prefix-format&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Switching to &lt;a href=&quot;http://orgmode.org/manual/Column-view.html#Column-view&quot; rel=&quot;nofollow&quot;&gt;column-view&lt;/a&gt; and using a format something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-columns-default-format&#xA;      &quot;%TODO %70ITEM(Task) %8Effort(Effort){:} %8CLOCKSUM{:} %8CLOCKSUM_T(Today){:} %CLOSED&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8863" LastActivityDate="2015-07-09T23:00:50.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13864" PostTypeId="2" ParentId="13360" CreationDate="2015-07-09T23:27:19.323" Score="1" Body="&lt;p&gt;You could use &lt;a href=&quot;https://emacs.stackexchange.com/search?q=org-agenda-prefix-format&quot;&gt;&lt;code&gt;org-agenda-prefix-format&lt;/code&gt;&lt;/a&gt; with a call to &lt;code&gt;org-habit-build-graph&lt;/code&gt; and related functions.&lt;/p&gt;&#xA;" OwnerUserId="8864" LastActivityDate="2015-07-09T23:27:19.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13865" PostTypeId="1" AcceptedAnswerId="13872" CreationDate="2015-07-10T00:00:05.497" Score="1" ViewCount="951" Body="&lt;p&gt;I am using orgmode and after I put my files under git I see some lines that appear next to lines that have changed. They are red, green or blue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to disable this but have no idea how they are called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/V1wZ7.png&quot; alt=&quot;https://i.stack.imgur.com/V1wZ7.png&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="654" LastEditDate="2015-07-10T12:49:45.967" LastActivityDate="2015-07-10T14:24:54.200" Title="How do I disable the colored marks that appear next to changed lines when using git?" Tags="|git|prelude|fringe|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="13866" PostTypeId="1" AcceptedAnswerId="13867" CreationDate="2015-07-10T00:59:48.397" Score="4" ViewCount="101" Body="&lt;p&gt;&lt;strong&gt;General question&lt;/strong&gt;: two packages have the same name for a certain function. When both packages are installed, which one has the priority to execute that particular function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Particular situation&lt;/strong&gt;: I am talking about two packages &lt;code&gt;goto-last-change&lt;/code&gt; and &lt;code&gt;goto-chg&lt;/code&gt;. The function &lt;code&gt;goto-last-change&lt;/code&gt; is present in both packages.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-07-10T01:09:42.797" LastActivityDate="2015-07-10T02:54:05.493" Title="Priority of the executation of two functions with the same name from two different packages" Tags="|package|functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13867" PostTypeId="2" ParentId="13866" CreationDate="2015-07-10T02:42:51.437" Score="6" Body="&lt;p&gt;There are no namespaces in Emacs, all functions are global, therefore the function in the package that was last loaded will override the definition of the other package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When package A is loaded and defines function &lt;code&gt;foo&lt;/code&gt;, and then package B is loaded and also defines function &lt;code&gt;foo&lt;/code&gt;, the &lt;code&gt;foo&lt;/code&gt; function from package A is totally gone. &lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-07-10T02:54:05.493" LastActivityDate="2015-07-10T02:54:05.493" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13868" PostTypeId="1" CreationDate="2015-07-10T03:11:30.063" Score="9" ViewCount="1858" Body="&lt;p&gt;When there's an error in one of my init files, I get a vague message like this when I launch Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading /Users/im/.emacs.d/init.elc:&#xA;(wrong-type-argument listp helm-find-files-actions)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't tell me which of my many configuration files contains the error, or which line. Searching my files doesn't help because, guess what, the function &lt;code&gt;helm-find-files-actions&lt;/code&gt; doesn't actually appear in any of my init files. To track down the offending line of code, I have to do &lt;code&gt;$ emacs --debug-init&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there no way to get Emacs to automatically tell me where the offending line is without having to quit and run &lt;code&gt;$ emacs --debug-init&lt;/code&gt;? I know I can bisect + eval the files manually but that's even slower. It would be so much better if, when there's an error in one of my init files, Emacs could:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;tell me which init file&lt;/li&gt;&#xA;&lt;li&gt;tell me the line number that contains the error&lt;/li&gt;&#xA;&lt;li&gt;ideally, open that init file and take me to the offending line&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is this possible with Emacs, or am I living in a fantasy world?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-07-15T02:03:52.633" Title="how to get Emacs to locate the error in my init file without relaunching?" Tags="|elisp|init-file|debugging|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13869" PostTypeId="1" AcceptedAnswerId="13897" CreationDate="2015-07-10T06:29:01.707" Score="10" ViewCount="820" Body="&lt;p&gt;I often limit or unlimit the evaluation of specific code blocks in org-mode babel using &lt;a href=&quot;http://orgmode.org/manual/eval.html#eval&quot;&gt;&lt;code&gt;:eval&lt;/code&gt;&lt;/a&gt; header argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value scalar :eval no&#xA;(+ 1 1)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I toggle the code blocks between &lt;code&gt;:eval no&lt;/code&gt; and &lt;code&gt;:eval n&lt;/code&gt; (or delete &lt;code&gt;:eval no&lt;/code&gt; completely) by hand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+PROPERTY: eval no&lt;/code&gt; is convenient, but is not suited for each code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any better ways to toggle the &lt;code&gt;:eval&lt;/code&gt; status handy, like below?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-t     (org-todo)&#xA;Rotate the TODO state of the current item among&#xA;(unmarked) -&amp;gt; TODO -&amp;gt; DONE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="115" LastEditDate="2015-07-10T18:18:10.063" LastActivityDate="2024-01-08T11:11:56.427" Title="How to toggle Org-mode source code block &quot;:eval no&quot; status" Tags="|org-mode|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13870" PostTypeId="2" ParentId="13426" CreationDate="2015-07-10T08:19:19.990" Score="6" Body="&lt;p&gt;Based on advised from Mosè Giordano on the &lt;a href=&quot;http://www.mail-archive.com/auctex@gnu.org/msg05928.html&quot; rel=&quot;noreferrer&quot;&gt;AUCTeX mailing list&lt;/a&gt; I've found that putting the below snippet from AUCTeX Manual in my &lt;code&gt;.emacs.d&lt;/code&gt; fixes the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq TeX-parse-self t) ; Enable parse on load.&#xA;(setq TeX-auto-save t) ; Enable parse on save.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the intended behavior, see thread on &lt;a href=&quot;http://www.mail-archive.com/auctex@gnu.org/msg05928.html&quot; rel=&quot;noreferrer&quot;&gt;AUCTeX mailing list&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8658" LastActivityDate="2015-07-10T08:19:19.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13871" PostTypeId="1" CreationDate="2015-07-10T10:48:35.013" Score="1" ViewCount="38" Body="&lt;p&gt;I have a hook in my &lt;code&gt;.emacs&lt;/code&gt; file that activates ECB when prog-mode entered:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook 'ecb-activate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open the first file that starts a &lt;code&gt;prog-mode&lt;/code&gt;, it seems to cause &lt;code&gt;find-file&lt;/code&gt;* to open the file, but then 'bury' it below all the other buffers. By this I mean that it opens the file, so that I can find it in the list of buffers, but it doesn't switch to that buffer, as I would expect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I comment out the line above, it behaves as it should (opens the file and switches to its buffer). Also, once ECB is activated, opening new files behaves as it should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how do I stop it from doing that, so that when I open a file, I get that file's buffer? Am I using ECB wrong, i.e. are you not meant to activate it in the mode hooks? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;*I am also running &lt;code&gt;ido-mode&lt;/code&gt;, so maybe it's not actually calling &lt;code&gt;find-file&lt;/code&gt;,  I get very confused with what's actually going on under the hood. &lt;/p&gt;&#xA;" OwnerUserId="5150" LastActivityDate="2015-07-10T10:48:35.013" Title="find-file opens file but buries its buffer when ECB is activated" Tags="|init-file|buffers|find-file|prog-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13872" PostTypeId="2" ParentId="13865" CreationDate="2015-07-10T14:07:34.687" Score="5" Body="&lt;p&gt;The highlighting is performed by &lt;code&gt;diff-hl-mode&lt;/code&gt; from the &lt;a href=&quot;https://github.com/dgutov/diff-hl&quot; rel=&quot;noreferrer&quot;&gt;diff-hl&lt;/a&gt; package, and can be toggled with &lt;code&gt;M-x diff-hl-mode&lt;/code&gt;, or unconditionally disabled by passing a negative argument (&lt;code&gt;M-- M-x diff-hl-mode&lt;/code&gt; interactively, &lt;code&gt;(diff-hl-mode -1)&lt;/code&gt; from lisp) &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minor-Modes.html&quot; rel=&quot;noreferrer&quot;&gt;like most minor modes&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;To find out yourself which minor mode is causing the effect you could use &lt;kbd&gt;f1 m&lt;/kbd&gt; (&lt;code&gt;describe-mode&lt;/code&gt;) and look in the help buffer to see what minor modes are active, along with the major mode -- those will likely give you a clue as to what is causing the bitmap images to be displayed in the left fringe.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/ShingoFukuyama/manage-minor-mode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;manage-minor-mode&lt;/code&gt;&lt;/a&gt; package could also be helpful to debug cases like these.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-10T14:24:54.200" CommentCount="2" CommunityOwnedDate="2015-07-10T14:24:54.200" ContentLicense="CC BY-SA 3.0" />
  <row Id="13873" PostTypeId="1" CreationDate="2015-07-10T14:11:59.927" Score="2" ViewCount="45" Body="&lt;p&gt;I have several ORG files which I wish to export to HTML or ODT from emacs. These files have specific numbering. However when I export them the numbers are automatically adjusted. For example in the file I would have the following numbers:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;ויאמר = ordered.&lt;/li&gt;&#xA;&lt;li&gt;ילדים - the object of ויביאם (verse 3).&lt;/li&gt;&#xA;&lt;li&gt;לחסד ולרחמים - ל in both instances marks a second object.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After export, these numbers appears as 1. 2. 3. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change this?&lt;/p&gt;&#xA;" OwnerUserId="8753" LastActivityDate="2015-07-10T14:11:59.927" Title="Exporting a file from ORG MODE automatically changes my numbering" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ClosedDate="2015-07-17T11:16:03.817" ContentLicense="CC BY-SA 3.0" />
  <row Id="13874" PostTypeId="2" ParentId="13842" CreationDate="2015-07-10T14:18:19.973" Score="4" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-selwin nil)&#xA;&#xA;(defun foo (windows)&#xA;  (when (not (minibuffer-window-active-p (frame-selected-window)))&#xA;    (setq my-selwin (selected-window))))&#xA;&#xA;(add-function :before pre-redisplay-function #'foo)&#xA;&#xA;(setq-default mode-line-format&#xA;              '((:eval (propertize&#xA;                        (format-mode-line&#xA;                         mode-line-buffer-identification)&#xA;                        'face (if (eq my-selwin (get-buffer-window))&#xA;                                  'lazy-highlight&#xA;                                'highlight)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe that the problem with the simple test &lt;code&gt;(eq (selected-window) (get-buffer-window))&lt;/code&gt; (my first answer, since deleted) is that redisplay runs through some or all of the windows in turn, selecting each one.  My answer here remembers the window that was selected when redisplay starts, and compares with that. Not very elegant, but it seems to work (you need at least Emacs 24.4 for it, however.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, I've added a tiny library, &lt;a href=&quot;http://www.emacswiki.org/emacs/download/modeline-win.el&quot; rel=&quot;nofollow&quot;&gt;modeline-win.el&lt;/a&gt;, which does this: highlights the buffer id in the mode line for the selected window.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="2094" LastEditDate="2015-07-14T12:28:23.463" LastActivityDate="2015-07-14T12:28:23.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13875" PostTypeId="2" ParentId="13868" CreationDate="2015-07-10T14:55:37.083" Score="1" Body="&lt;p&gt;You could simply load your init file up in a buffer and C-x C-e to evaluate each s-expression and figure out which one blows up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that's not ideal but if you're dead set against restarting it's what I'd do.&lt;/p&gt;&#xA;" OwnerUserId="8834" LastActivityDate="2015-07-10T14:55:37.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13876" PostTypeId="1" AcceptedAnswerId="13904" CreationDate="2015-07-10T15:32:08.303" Score="7" ViewCount="1158" Body="&lt;p&gt;I'm moving to emacs from shell/Vim and I'm very used to seeing the branch I'm working in when I'm at the project level.  Is there any way to get the Git branch name to display in the dired buffer mode line for my projects?&lt;/p&gt;&#xA;" OwnerUserId="8834" LastActivityDate="2021-02-04T17:09:45.997" Title="Is there a way for magit to display the branch in the dired buffer mode line for a given directory?" Tags="|dired|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13877" PostTypeId="2" ParentId="13861" CreationDate="2015-07-10T15:46:54.803" Score="0" Body="&lt;p&gt;You can always open a remote file in your local Emacs, it doesn't depend on ansi-term. Just do &lt;code&gt;C-x C-f /ssh:host:path-to-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-07-10T15:46:54.803" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13878" PostTypeId="1" AcceptedAnswerId="13914" CreationDate="2015-07-10T15:48:35.433" Score="11" ViewCount="5279" Body="&lt;p&gt;How do you track down errors reported during the export process?  I am writing an Org document and exporting it to PDF. (I do not know LaTeX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was getting the following error: &lt;code&gt;org-latex-compile: PDF file ./myfile.pdf wasn't produced: [undefined control sequence] [package error] Runaway argument&lt;/code&gt;. By trial and error, I narrowed it down to this section of the document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Prefix key&#xA;  * ~M-p~ (currently unassigned)&#xA;  * ~H-c~ (currently unassigned)&#xA;  * ~H-;~ (currently unassigned)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After much web searching, I discovered that a limitation of LaTeX is that verbatim text cannot be used in a subheading.  The LaTeX generated from the above snippet included lines like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\subsubsection{\verb~M-p~ (currently unassigned)}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Changing the subheadings to an unordered list fixed the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Prefix key&#xA;  - ~M-p~ (currently unassigned)&#xA;  - ~H-c~ (currently unassigned)&#xA;  - ~H-;~ (currently unassigned)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because those generated lines looked more like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\item \verb~M-p~ (currently unassigned)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now, finally, here is my question:&lt;/strong&gt; Is there a better way of tracking down, diagnosing, and solving such errors than my trial-and-error-plus-web-search (short of, say, spending a few weeks learning LaTeX)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, my file produces a seemingly-fine PDF... but the export process does issue an error message: &lt;code&gt;Process completed with errors: [package error]&lt;/code&gt;.  I have no idea whether this is serious, whether it has affected my PDF output in a way that I haven't noticed yet, or if it's trivial and should be ignored. Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="321" LastActivityDate="2018-12-02T20:04:43.850" Title="Tracking down Org LaTeX export errors" Tags="|org-export|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13879" PostTypeId="1" AcceptedAnswerId="13880" CreationDate="2015-07-10T16:21:14.287" Score="3" ViewCount="1664" Body="&lt;p&gt;I am using Emacs to write a long thesis in LaTeX. I have no regrets, so far (about the Emacs/LaTeX combination, that is). One of the last things I need to do before I can submit the darn thing is to compile a list of abbreviations. Of course, I should have kept tabs on the abbrevs I have used, but I haven't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, is there some way to employ the power of Emacs to find abbreviations, ideally even to have them displayed in a separate buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, this is a good use-case for regular expressions. Abbreviations could be defined as at least three consecutive upper case letters delimited by whitespace. My regex skills are very limited, though. I tried to search (isearch.el) for &lt;code&gt;\b[A-Z]{2,4}\b&lt;/code&gt;, but all I got was &lt;code&gt;Failing regexp Isearch&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong? Maybe someone has already written a useful script for this purpose. (Couldn't find anything on (M)ELPA.)&lt;/p&gt;&#xA;" OwnerUserId="8454" LastActivityDate="2015-07-10T17:48:20.760" Title="How to find (and list) abbreviations in a buffer?" Tags="|regular-expressions|writing|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13880" PostTypeId="2" ParentId="13879" CreationDate="2015-07-10T17:41:30.457" Score="4" Body="&lt;p&gt;Here's a couple of functions that will do what you want (make sure to &lt;code&gt;(require 'cl-lib)&lt;/code&gt; first).  They will gather all the abbreviations of 3 capital letters or more, along with the point location that you first used them.  They will then create a new buffer &lt;code&gt;*Abbreviations*&lt;/code&gt; that will list them and their locations.  (Despite the uncreative function names, they have nothing to do with Emacs' &lt;code&gt;abbrev&lt;/code&gt; facility.)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, evaluate these two functions and then &lt;code&gt;M-x display-abbrevs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun gather-abbrevs ()&#xA;  &quot;Gather all abbreviations (3 or more capital letters) in the&#xA;buffer.  Return an alist of all of them and the point location of&#xA;their initial use.&quot;&#xA;  (let (case-fold-search abbrevs)&#xA;    (save-restriction&#xA;      (save-excursion&#xA;        (widen)&#xA;        (goto-char (point-min))&#xA;        (while (re-search-forward &quot;\\b[A-Z]\\{3,\\}\\b&quot; nil t)&#xA;          (push (list (match-string 0)&#xA;                      (- (point) (length (match-string 0))))&#xA;                abbrevs))&#xA;        (nreverse (cl-delete-duplicates abbrevs&#xA;                                        :key  #'car&#xA;                                        :test #'equal))))))&#xA;&#xA;(defun display-abbrevs ()&#xA;  &quot;Gather all abbreviations (3 or more capital letters) in the&#xA;current buffer.  Display them and their initial point locations&#xA;in the *Abbreviations* buffer.&quot;&#xA;  (interactive)&#xA;  (let ((buf (buffer-name))&#xA;        (new (get-buffer-create &quot;*Abbreviations*&quot;))&#xA;        (abs (gather-abbrevs)))&#xA;    (with-current-buffer new&#xA;      (delete-region (point-min) (point-max))&#xA;      (insert (concat &quot;Abbreviations in the &amp;lt;&quot; buf &quot;&amp;gt; buffer\n\n&quot;))&#xA;      (insert &quot;Abbrev.\t\tLocation\n&quot;)&#xA;      (cl-dolist (a abs)&#xA;        (insert (concat (car a) &quot;\t\t&quot;&#xA;                        (number-to-string (cadr a)) &quot;\n&quot;)))&#xA;      (pop-to-buffer new))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I've only tested them very briefly, so there may be bugs.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-10T17:41:30.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13881" PostTypeId="2" ParentId="13879" CreationDate="2015-07-10T17:48:20.760" Score="6" Body="&lt;p&gt;If you are comfortable with occur, then try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x occur RET \b[A-Z]\{2,4\}\b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can play with 2,4 values to adjust to your needs, perhaps different values for different parts of your thesis. Results are shown in a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since occur is available on default installations of Emacs, you don't have to add new libraries or dependencies.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-07-10T17:48:20.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13882" PostTypeId="2" ParentId="13599" CreationDate="2015-07-10T17:51:00.823" Score="1" Body="&lt;p&gt;Based on the conversation in the comments to the question and suggestion by &lt;strong&gt;@Drew&lt;/strong&gt;, below solution should work for you.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(register-file-header-action &quot;Version[ \t]*: &quot; 'my-update-version-count)&#xA;&#xA;(defun my-update-version-count ()&#xA;  (let* ((v-str  (delete-and-forget-line))&#xA;         ;; `version-to-list' will also check if the version string is valid&#xA;         (v-list (version-to-list v-str)) &#xA;         (v-major (nth 0 v-list))&#xA;         (v-minor (nth 1 v-list)))&#xA;    (insert (format &quot;%0d.%0d&quot; v-major (1+ v-minor)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tested it out on this minimum working example file below with a 'header' and repeatedly calling &lt;code&gt;M-x update-file-header&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// -----------------------------------------------------------------------------&#xA;// Version     : 0.0&#xA;// -----------------------------------------------------------------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-07-10T17:51:00.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13883" PostTypeId="2" ParentId="13868" CreationDate="2015-07-10T18:16:04.883" Score="2" Body="&lt;p&gt;Simple answer: Just open your init.el file and do a &lt;code&gt;M-x eval-buffer&lt;/code&gt;. I do this all the time to debug init files&lt;/p&gt;&#xA;" OwnerUserId="8766" LastActivityDate="2015-07-10T18:16:04.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13884" PostTypeId="1" CreationDate="2015-07-10T19:40:50.397" Score="4" ViewCount="522" Body="&lt;p&gt;At the bottom of the screen when emacs is open there is a strip of purple, meaning that emacs in terminal isnt maximizing to the full size that the terminal window allows and thus the background from the terminal is showing. I know this is nit-picky but my OCD is driving me crazy. Anyway to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would post an image but I don't have enough stack karma points yet.&lt;/p&gt;&#xA;" OwnerUserId="8870" LastActivityDate="2015-07-10T20:08:57.837" Title="Emacs theme not covering up the entire terminal window. The Ubuntu purple terminal background is showing on the edges" Tags="|themes|term|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13885" PostTypeId="1" AcceptedAnswerId="14467" CreationDate="2015-07-10T20:06:52.973" Score="2" ViewCount="462" Body="&lt;p&gt;I recently installed an Ubuntu VM, and I'm working on getting all set up. I've run into a small issue, in that my configuration now takes nearly 30 seconds to start up, where it used to be nearly instant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've narrowed the issue down to the &lt;code&gt;(require 'ess-site)&lt;/code&gt; line in my configuration, but I haven't figured out how to speed it up or replace it. I need to load &lt;code&gt;ess&lt;/code&gt; there so that I can do my next customization, which is &lt;code&gt;(ess-toggle-underscore nil)&lt;/code&gt;. Without the &lt;code&gt;require&lt;/code&gt;, I get errors on that next line. Do I just have to deal with the slow startup time, or is there something I can do to speed this up?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-08-04T21:54:53.190" Title="ESS startup is very slow" Tags="|init-file|ess|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13886" PostTypeId="1" AcceptedAnswerId="13892" CreationDate="2015-07-10T20:08:47.213" Score="13" ViewCount="3269" Body="&lt;p&gt;And what can they be used for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(interactive &quot;p&quot;)&lt;/code&gt; takes a numerical argument from the &lt;code&gt;universal argument&lt;/code&gt; right? And the universal argument is just an int either way, so what does capital &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt; do?&lt;/p&gt;&#xA;" OwnerUserId="8653" LastEditorUserId="105" LastEditDate="2017-12-24T16:09:23.983" LastActivityDate="2017-12-24T16:09:23.983" Title="What is a raw prefix argument? (capital P in interactive)" Tags="|interactive|prefix-argument|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13887" PostTypeId="2" ParentId="13884" CreationDate="2015-07-10T20:08:57.837" Score="7" Body="&lt;p&gt;The Emacs manual says you can set the option &lt;code&gt;frame-resize-pixelwise&lt;/code&gt; to non-nil to allow frame sizes by pixel.  Normally the frame dimensions (not counting the menu bar, tool bar, etc) are integer multiples of &lt;code&gt;frame-char-height&lt;/code&gt; in height and &lt;code&gt;frame-char-width&lt;/code&gt; in width.  The manual notes that you need to set this variable to non-nil in your init file so that it interacts properly with you window manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your &lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt; file, add this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-resize-pixelwise t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to enable pixel resizing rather than char height/width resizing.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;User Option: frame-resize-pixelwise&lt;/strong&gt;  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If this option is nil, a frame’s size is usually rounded to a multiple of the current values of that frame’s frame-char-height and frame-char-width. If this is non-nil, no rounding occurs, hence frame sizes can increase/decrease by one pixel.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Setting this causes the next resize operation to pass the corresponding size hints to the window manager. This means that this variable should be set only in a user’s initial file; applications should never bind it temporarily.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The precise meaning of a value of nil for this option depends on the toolkit used. Dragging the frame border with the mouse is usually done character-wise. Calling set-frame-size (see below) with arguments that do not specify the frame size as an integer multiple of its character size, however, may: be ignored, cause a rounding (GTK+), or be accepted (Lucid, Motif, MS-Windows).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With some window managers you may have to set this to non-nil in order to make a frame appear truly “maximized” or “fullscreen”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="38" LastActivityDate="2015-07-10T20:08:57.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13888" PostTypeId="2" ParentId="13886" CreationDate="2015-07-10T20:32:06.447" Score="10" Body="&#xA;&#xA;&lt;p&gt;When raw prefix &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html&quot;&gt;&lt;em&gt;Interactive Code&lt;/em&gt;&lt;/a&gt; &lt;code&gt;&quot;P&quot;&lt;/code&gt; is used, the argument is passed on as it is whereas &lt;code&gt;&quot;p&quot;&lt;/code&gt; converts the arg to a number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After evaluating the below elisp, try out &lt;code&gt;C-u M-x my/fn-with-num-arg&lt;/code&gt; and then &lt;code&gt;C-u M-x my/fn-with-raw-arg&lt;/code&gt; to see the difference because &lt;code&gt;C-u&lt;/code&gt; passes a list argument &lt;code&gt;(4)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/debug-fn (arg)&#xA;  (let ((msg))&#xA;    (if (numberp arg)&#xA;        (setq msg (format &quot;Argument is number %s. &quot; (pp arg)))&#xA;      (setq msg &quot;Argument is not a number. &quot;))&#xA;    (if (listp arg)&#xA;        (setq msg (concat msg (format &quot;Arg is %s.&quot; (pp arg))))&#xA;      (setq msg (concat msg &quot;Argument is not a list.&quot;)))&#xA;    (message msg)))&#xA;&#xA;(defun my/fn-with-num-arg (arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (my/debug-fn arg))&#xA;;; Result of C-u M-x my/fn-with-num-arg :&#xA;;; Argument is number 4. Argument is not a list.&#xA;&#xA;(defun my/fn-with-raw-arg (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (my/debug-fn arg))&#xA;;; Result of C-u M-x my/fn-with-raw-arg :&#xA;;; Argument is not a number. Arg is (4)&#xA;;; .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also the argument defaults to &lt;code&gt;1&lt;/code&gt; for numerical argument (&lt;code&gt;&quot;p&quot;&lt;/code&gt;) but defaults to &lt;code&gt;nil&lt;/code&gt; or &lt;code&gt;()&lt;/code&gt; for raw argument (&lt;code&gt;&quot;P&quot;&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;My few cents: At times, the deciding factor for whether to use &lt;code&gt;&quot;p&quot;&lt;/code&gt; or &lt;code&gt;&quot;P&quot;&lt;/code&gt; is whether you want the default argument to be &lt;code&gt;1&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Result of M-x my/fn-with-num-arg :&#xA;;; Argument is number 1. Argument is not a list.&#xA;&#xA;;; Result of M-x my/fn-with-raw-arg :&#xA;;; Argument is not a number. Arg is nil.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-10T20:45:00.667" LastActivityDate="2015-07-10T20:45:00.667" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13889" PostTypeId="2" ParentId="13886" CreationDate="2015-07-10T20:58:01.977" Score="7" Body="&lt;p&gt;Just to add a bit more detail to @kaushalmodi's answer (and useful test case):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The raw argument lets you distinguish between arguments provided with &lt;code&gt;universal-argument&lt;/code&gt; and &lt;code&gt;digit-argument&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a numeric prefix arg there is no way to distinguish the universal argument &lt;code&gt;C-u&lt;/code&gt; from a prefix arg of 4 (i.e. &lt;code&gt;C-4&lt;/code&gt;). With the raw argument these are different: &lt;code&gt;(4)&lt;/code&gt; vs &lt;code&gt;4&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same applies with &lt;code&gt;negative-argument&lt;/code&gt;. As a raw argument you can distinguish between &lt;code&gt;C--&lt;/code&gt; and &lt;code&gt;C-- 1&lt;/code&gt;: the first will give you &lt;code&gt;-&lt;/code&gt; while the second &lt;code&gt;-1&lt;/code&gt;. When converted to a numeric argument they will both be &lt;code&gt;-1&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the benefit of using a raw argument is it gives you more possible values. You can write commands that behave differently depending on how the argument is specified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, take a look at the doc string for &lt;code&gt;yank&lt;/code&gt;. This command treats &lt;code&gt;C-u&lt;/code&gt; and &lt;code&gt;C-4&lt;/code&gt; differently:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With just C-u as argument, put point at beginning, and mark at end.&#xA;  With argument N, reinsert the Nth most recent kill.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-07-10T21:08:23.457" LastActivityDate="2015-07-10T21:08:23.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13890" PostTypeId="2" ParentId="13815" CreationDate="2015-07-10T21:43:00.463" Score="1" Body="&lt;p&gt;Well, while waiting for an answer I simply implemented a simple version of rgrep functionality myself.  I was hoping to find a way to re-use the existing rgrep.el functionality but couldn't get it to work.  not sure if that is a Emacs 21 version incompatibility or some thing else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took the simple route and invoked &quot;find -exec grep&quot;, inserting results into a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't been able to transfer grep-mode.el either, so that's missing but I implemented (for me) the key bit I needed which was click-and-jump-to-location.&lt;/p&gt;&#xA;" OwnerUserId="5297" LastActivityDate="2015-07-10T21:43:00.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13891" PostTypeId="2" ParentId="13861" CreationDate="2015-07-10T21:49:28.820" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;... open file in a new Emacs buffer, but in the same window. The effect would be the same as using C-x C-f /ssh:host:path-to-file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Have you tried tramp through the command line? Say you normally invoke a local file as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs /path/to/local/file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then to invoke a remote file, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(find-file &quot;/ssh:user@remote.host.com:/path/to/remote.file&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The effect would be the same as using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f /ssh:user@remote.host.com:/path/to/remote.file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;inside Emacs.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The progression would be: a) ansi-term b) ssh remote_machine c) emacs file &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;then why not run emacs through the ssh command like so?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh remote_machine 'emacs /path/to/file'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-07-10T22:25:02.437" LastActivityDate="2015-07-10T22:25:02.437" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13892" PostTypeId="2" ParentId="13886" CreationDate="2015-07-10T22:35:20.717" Score="11" Body="&lt;p&gt;Hard to believe that people described this here without also giving you links to Emacs's own descriptions of this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot;&gt;Arguments&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html&quot;&gt;Prefix Command Arguments&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&quot;Ask Emacs!&quot;:&lt;/em&gt;&lt;/strong&gt; &lt;code&gt;C-h i&lt;/code&gt;, choose a manual, &lt;code&gt;i prefix argument RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell, though this is said well enough by other answers here, and is described in detail in the manual:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;&quot;raw&quot;&lt;/strong&gt; prefix arg provides Lisp values of different kinds, and in particular it distinguishes &lt;em&gt;whether or not the user actually used&lt;/em&gt; a prefix argument (of any kind). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using it, a program can distinguish whether the user used one of {&lt;code&gt;-&lt;/code&gt;, &lt;code&gt;M--&lt;/code&gt;, &lt;code&gt;C--&lt;/code&gt;} or one of {&lt;code&gt;M-- 1&lt;/code&gt;,  &lt;code&gt;C-- 1&lt;/code&gt;, &lt;code&gt;C-u -1&lt;/code&gt;} (both of which have the same numeric prefix value of &lt;code&gt;-1&lt;/code&gt;), and distinguish whether s?he used &lt;code&gt;C-u C-u&lt;/code&gt; or one of {&lt;code&gt;M-16&lt;/code&gt;, &lt;code&gt;C-16&lt;/code&gt;, &lt;code&gt;C-u 16&lt;/code&gt;} (both of which have numeric value 16) - among lots of other distinctions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the most important such distinction is &lt;code&gt;nil&lt;/code&gt; vs non-&lt;code&gt;nil&lt;/code&gt;: many commands act differently depending on whether the user uses a prefix arg.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;&quot;numeric&quot;&lt;/strong&gt; prefix arg is really just the value that function &lt;code&gt;prefix-numeric-value&lt;/code&gt; returns when applied to the raw prefix arg.  IOW, it is best thought of as a mapping from the actual raw user interaction to an integer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It cannot tell you whether the user actually used a prefix argument, because the default of no prefix argument maps to the integer 1, just as does the use of &lt;code&gt;C-u 1&lt;/code&gt;, &lt;code&gt;M-1&lt;/code&gt;, or &lt;code&gt;C-1&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-10T22:44:03.280" LastActivityDate="2015-07-10T22:44:03.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13893" PostTypeId="1" AcceptedAnswerId="13895" CreationDate="2015-07-10T23:51:53.997" Score="2" ViewCount="132" Body="&lt;p&gt;@Juancho gave a great answer to a &lt;a href=&quot;https://emacs.stackexchange.com/questions/13817/can-columns-of-an-org-table-be-grouped-to-conveniently-work-with-data/13843#13843&quot;&gt;question I asked a few days ago&lt;/a&gt;. My question is about how to modify his elisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an &lt;code&gt;org&lt;/code&gt; table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :results none&#xA;  (defun jj/factor (code)&#xA;      (cond ((eq (string-to-char code) ?P) .05)&#xA;            (t 0)))&#xA;&#xA;  (defun jj/factorlist (codelist)&#xA;    (mapcar 'jj/factor codelist))&#xA;&#xA;  (defun jj/dotproduct (a b)&#xA;    (apply '+ (mapcar* '* (jj/factorlist a) (mapcar 'string-to-number b))))&#xA;#+end_src&#xA;&#xA;&#xA;|        |        |   P1 |   P2 |   Q1 |   Q2 |   E1 |   E2 |    F |&#xA;|--------+--------+------+------+------+------+------+------+------|&#xA;|        | Totals |   20 |   40 |   50 |   45 |  100 |  100 |  200 |&#xA;|--------+--------+------+------+------+------+------+------+------|&#xA;| John   |   0.10 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |&#xA;| Paul   |   1.00 |   10 |   10 |   10 |   10 |   10 |   10 |   10 |&#xA;| George |  10.00 |  100 |  100 |  100 |  100 |  100 |  100 |  100 |&#xA;| Ringo  | 100.00 | 1000 | 1000 | 1000 | 1000 | 1000 | 1000 | 1000 |&#xA;#+TBLFM: @3$2..@&amp;gt;$2='(jj/dotproduct (list @1$3..@1$&amp;gt;) (list $3..$&amp;gt;));%.2f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;jj/dotproduct&lt;/code&gt; takes the entries in the columns marked &lt;code&gt;P&lt;/code&gt;, multiplies them by &lt;code&gt;.05&lt;/code&gt;, and adds them up in the column marked &lt;code&gt;Totals&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I'd like to modify &lt;code&gt;jj/dotproduct&lt;/code&gt; so it takes another input &lt;code&gt;x&lt;/code&gt; where &lt;code&gt;x&lt;/code&gt; any letter. This would allow me to sum the columns marked &lt;code&gt;Q&lt;/code&gt;, &lt;code&gt;E&lt;/code&gt;, and &lt;code&gt;F&lt;/code&gt; separately. I've tried modifying it as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :results none&#xA;  (defun jj/factor (code x)&#xA;      (cond ((eq (string-to-char code) (string-to-char x)) .05)&#xA;            (t 0)))&#xA;&#xA;  (defun jj/factorlist (codelist x)&#xA;    (mapcar 'jj/factor codelist x))&#xA;&#xA;  (defun jj/dotproduct (x a b)&#xA;    (apply '+ (mapcar* '* (jj/factorlist a x) (mapcar 'string-to-number b))))&#xA;#+end_src&#xA;&#xA;&#xA;|        |        |   P1 |   P2 |   Q1 |   Q2 |   E1 |   E2 |    F |&#xA;|--------+--------+------+------+------+------+------+------+------|&#xA;|        | Totals |   20 |   40 |   50 |   45 |  100 |  100 |  200 |&#xA;|--------+--------+------+------+------+------+------+------+------|&#xA;| John   |   0.00 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |&#xA;| Paul   |   0.00 |   10 |   10 |   10 |   10 |   10 |   10 |   10 |&#xA;| George |   0.00 |  100 |  100 |  100 |  100 |  100 |  100 |  100 |&#xA;| Ringo  |   0.00 | 1000 | 1000 | 1000 | 1000 | 1000 | 1000 | 1000 |&#xA;#+TBLFM: @3$2..@&amp;gt;$2='(jj/dotproduct &quot;P&quot; (list @1$3..@1$&amp;gt;) (list $3..$&amp;gt;));%.2f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This, however, gives the wrong output. Any ideas what I've done wrong and how I can fix my code?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-07-11T01:58:53.903" Title="Why is my elisp function not accepting a second parameter?" Tags="|org-mode|elisp|org-table|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13894" PostTypeId="2" ParentId="13842" CreationDate="2015-07-11T01:26:35.267" Score="0" Body="&lt;p&gt;The way &lt;code&gt;powerline&lt;/code&gt; does it is pretty simple and I've never seen an issue with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the appropriate code from powerline which you can easily adapt to your own purposes.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar powerline-selected-window (frame-selected-window))&#xA;(defun powerline-set-selected-window ()&#xA;  &quot;sets the variable `powerline-selected-window` appropriately&quot;&#xA;  (when (not (minibuffer-window-active-p (frame-selected-window)))&#xA;    (setq powerline-selected-window (frame-selected-window))))&#xA;&#xA;(add-hook 'window-configuration-change-hook 'powerline-set-selected-window)&#xA;(add-hook 'focus-in-hook 'powerline-set-selected-window)&#xA;(add-hook 'focus-out-hook 'powerline-set-selected-window)&#xA;&#xA;(defadvice select-window (after powerline-select-window activate)&#xA;  &quot;makes powerline aware of window changes&quot;&#xA;  (powerline-set-selected-window))&#xA;&#xA;;;;###autoload (autoload 'powerline-selected-window-active &quot;powerline&quot;)&#xA;(defun powerline-selected-window-active ()&#xA;  &quot;Return whether the current window is active.&quot;&#xA;  (eq powerline-selected-window (selected-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-07-11T01:26:35.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13895" PostTypeId="2" ParentId="13893" CreationDate="2015-07-11T01:58:53.903" Score="3" Body="&lt;p&gt;As per my comment, you're trying to pass more arguments to &lt;code&gt;mapcar&lt;/code&gt; than it takes. You must only pass it a function and a sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An elegant way to solve your problem is to use &lt;code&gt;apply-partially&lt;/code&gt; to obtain the function you need. Note that we need &lt;code&gt;x&lt;/code&gt; to be the first argument to &lt;code&gt;jj/factor&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jj/factor (x code)&#xA;  (cond ((eq (string-to-char code) (string-to-char x)) .05)&#xA;        (t 0)))&#xA;&#xA;(defun jj/factorlist (codelist x)&#xA;  (mapcar (apply-partially 'jj/factor x) codelist))&#xA;&#xA;(defun jj/dotproduct (x a b)&#xA;  (apply '+ (mapcar* '* (jj/factorlist a x) (mapcar 'string-to-number b))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-07-11T01:58:53.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13896" PostTypeId="2" ParentId="13861" CreationDate="2015-07-11T03:25:40.937" Score="0" Body="&lt;p&gt;&lt;code&gt;M-x shell&lt;/code&gt; and &lt;code&gt;eshell&lt;/code&gt; can possibly be made to do this entirely in elisp? They don't seem to do so by default, but it might be worth digging a bit if you're keen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ansi-term&lt;/code&gt; is a bit of a hybrid case, but it seems that some &lt;a href=&quot;http://www.emacswiki.org/emacs/AnsiTermHints#RemoteDirectoryTracking&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;PROMPT_COMMAND&lt;/code&gt; trickery&lt;/a&gt; can be used with an external command to get a similar result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this for remote shells &lt;em&gt;in general&lt;/em&gt; (regardless of Emacs) -- I believe you'll need some external support for invoking emacsclient back on your local machine with the appropriate tramp path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's &lt;a href=&quot;https://stackoverflow.com/a/5155500/324105&quot;&gt;my old suggestion for doing that&lt;/a&gt;, and that then led me to notice a variety of other solutions from other folks. Ryan Barrett lists several along with his own solution in his &lt;a href=&quot;http://snarfed.org/emacsclient_in_tramp_remote_shells&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacsclient in TRAMP remote shells&lt;/a&gt; blog post. Harold Abnabit then elaborates on Ryan's approach in &lt;a href=&quot;http://blog.habnab.it/blog/2013/06/25/emacsclient-and-tramp/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacsclient and TRAMP&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(n.b. I have not tested any of these solutions myself)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-07-14T22:34:49.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13897" PostTypeId="2" ParentId="13869" CreationDate="2015-07-11T03:45:20.020" Score="8" Body="&lt;p&gt;I've come up with a relatively nice solution, which relies on the &lt;code&gt;org-in-block-p&lt;/code&gt; function, which I'd recommend taking a look. Add the following code to you &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (defun org-toggle-src-eval-no ()&#xA;      &amp;quot;Will toggle ':eval no' on the src block begin line&amp;quot;&#xA;&#xA;      (defun in-src-block-p ()&#xA;        &amp;quot;Returns t when the point is inside a source code block&amp;quot;&#xA;        (string= &amp;quot;src&amp;quot; (org-in-block-p '(&amp;quot;src&amp;quot;))))&#xA;    &#xA;      (defun beginning-src ()&#xA;        &amp;quot;Find the beginning of the src block&amp;quot;&#xA;        (let ((case-fold-search t)) (search-backward &amp;quot;#+BEGIN_SRC&amp;quot;)))&#xA;    &#xA;      (defun toggle-eval-no ()&#xA;        &amp;quot;Handles the toggling of ' :eval no'&amp;quot;&#xA;         (save-excursion&#xA;          (end-of-line)&#xA;          (let ((case-fold-search t)) (search-backward &amp;quot;#+BEGIN_SRC&amp;quot;)&#xA;           (if (search-forward &amp;quot; :eval no&amp;quot; (line-end-position) &amp;quot;f&amp;quot;)&#xA;               (replace-match &amp;quot;&amp;quot;)&#xA;             (insert &amp;quot; :eval no&amp;quot;)&#xA;             ))))&#xA;    &#xA;      (if (in-src-block-p) (toggle-eval-no)))&#xA;&#xA;    (defun add-org-toggle-src-key ()&#xA;      (local-set-key (kbd &amp;quot;C-c t&amp;quot;) (lambda () (interactive) (org-toggle-src-eval-no))))&#xA;&#xA;    (add-hook 'org-mode-hook 'add-org-toggle-src-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This defines the function &lt;code&gt;org-toggle-src-eval-no&lt;/code&gt; and it should do exactly what you want; anytime you're inside a code block, it will toggle the presence of &lt;code&gt;:eval no&lt;/code&gt;. I have bound it to &lt;code&gt;C-c t&lt;/code&gt;, but feel free to map it to whatever you'd like. Happy org-ing.&lt;/p&gt;&#xA;" OwnerUserId="8486" LastEditorUserId="17538" LastEditDate="2024-01-08T11:11:56.427" LastActivityDate="2024-01-08T11:11:56.427" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="13898" PostTypeId="1" AcceptedAnswerId="13900" CreationDate="2015-07-11T04:57:43.327" Score="0" ViewCount="73" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  Is there a way to create one cache that consists of one cons cell and two hash tables?  If so, how, please.  If not, what is the best way to handle this scenario?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working on a new feature for speedbar that creates a cache for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;nth 0&lt;/strong&gt;:  a &lt;em&gt;cons cell&lt;/em&gt; -- i.e., &lt;code&gt;(cons speedbar-shown-directories (buffer-string))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;nth 1&lt;/strong&gt;:  a hash table [use line number to find absolute file name]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;nth 2&lt;/strong&gt;:  a hash table [use absolute file name to find line number].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cache is &lt;code&gt;speedbar-full-text-cache&lt;/code&gt;.  I thought it would be handy to create a list of three elements -- the regular &lt;em&gt;last open directory is saved in its entirety for ultra-fast switching&lt;/em&gt; for the first element (i.e., nth 0), and then I wanted to add two hash tables.  So the thought was to create something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP 1&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq speedbar-full-text-cache&#xA;  (list (cons speedbar-shown-directories (buffer-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP 2&lt;/strong&gt;:  Try to append two hash tables.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq speedbar-full-text-cache&#xA;  (append speedbar-full-text-cache&#xA;    speedbar-line-to-node-table speedbar-node-to-line-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;RESULT&lt;/strong&gt;:  &lt;em&gt;Debugger entered--Lisp error: (wrong-type-argument sequencep #s(hash-table size 97 test eql rehash-size 1.5 rehash-threshold 0.8 data . . .&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="50" LastEditDate="2015-07-11T23:10:33.027" LastActivityDate="2015-07-11T23:10:33.027" Title="&quot;Lisp error&quot; when trying to append hash tables to a list" Tags="|hash-tables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13899" PostTypeId="1" AcceptedAnswerId="13912" CreationDate="2015-07-11T05:02:10.393" Score="3" ViewCount="2883" Body="&lt;p&gt;I can connect with Slack through &lt;code&gt;jabber&lt;/code&gt; and chat with individual users, but I can't join channels. There are some instructions &lt;a href=&quot;https://dbcorp.slack.com/account/gateways&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, but I don't know which &lt;code&gt;jabber&lt;/code&gt; commands to use. I've tried &lt;code&gt;jabber-muc-join&lt;/code&gt; and &lt;code&gt;jabber-groupchat-join&lt;/code&gt;, but neither of those seem to work. I use &lt;code&gt;conference.name.xmpp.slack.com&lt;/code&gt; for the server name.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2018-10-09T13:24:36.147" Title="Connecting to Slack channels with Jabber" Tags="|jabber|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13900" PostTypeId="2" ParentId="13898" CreationDate="2015-07-11T05:02:19.843" Score="2" Body="&lt;p&gt;You question seems too broad.  For the part of it that is specific, it seems unclear.  Is this really all you are asking for?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq speedbar-full-text-cache&#xA;      (list (cons speedbar-shown-directories (buffer-string))&#xA;            speedbar-line-to-node-table&#xA;            speedbar-node-to-line-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please pose as specific a question as you can, as opposed to &quot;what is the best way to handle this scenario?&quot; (for a vague scenario).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-11T05:02:19.843" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13901" PostTypeId="2" ParentId="12552" CreationDate="2015-07-11T08:20:06.707" Score="5" Body="&lt;p&gt;The &lt;code&gt;# binding:&lt;/code&gt; header &lt;a href=&quot;http://capitaomorte.github.io/yasnippet/snippet-development.html#sec-2-6&quot; rel=&quot;nofollow&quot;&gt;documented in the manual&lt;/a&gt; is the official method to do this. It's implemented using &lt;code&gt;emulation-mode-map-alists&lt;/code&gt; which means it will override any other major or minor mode keybindings, except for packages which also use &lt;code&gt;emulation-mode-map-alists&lt;/code&gt;, typically emulation packages like Evil.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I noticed it will work when you're in insert mode of Evil.  When you're currently in normal mode, the keybinding will do nothing. -- I would like to bind it to the key &lt;code&gt;gl&lt;/code&gt; with keychord.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could use something like:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun exand-yasnippet-foobar ()&#xA;  &quot;Expand the yasnippet named `foobar'.&quot;&#xA;  (interactive)&#xA;  (yas-expand-snippet (yas-lookup-snippet &quot;foobar&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then bind &lt;code&gt;expand-yasnippet-foobar&lt;/code&gt; to some key in whatever keymap you like. Make sure your snippet includes a &lt;code&gt;# name: foobar&lt;/code&gt; header.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;yas-lookup-snippet&lt;/code&gt; was &lt;a href=&quot;https://github.com/capitaomorte/yasnippet/commit/e8934ce816ac0f6fdfce06b7e3fabb1fe6bf1190&quot; rel=&quot;nofollow&quot;&gt;added&lt;/a&gt; to yasnippet on August 3rd, 2015. For older versions it can be defined as&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yas-lookup-snippet (name &amp;amp;optional _mode noerror)&#xA;  (let* ((yas-choose-tables-first nil)  ; avoid prompts&#xA;         (yas-choose-keys-first nil)&#xA;         (snippet (cl-find name (yas--all-templates&#xA;                                 (yas--get-snippet-tables))&#xA;                           :key #'yas--template-name :test #'string=)))&#xA;    (cond&#xA;     (snippet (yas--template-content snippet))&#xA;     (noerror nil)&#xA;     (t (error &quot;No snippet named: %s&quot; NAME)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-08-03T19:41:08.003" LastActivityDate="2015-08-03T19:41:08.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13902" PostTypeId="1" AcceptedAnswerId="13905" CreationDate="2015-07-11T09:49:40.097" Score="6" ViewCount="185" Body="&#xA;&#xA;&lt;p&gt;I am trying to include support for smartparens in a major-mode package. I want that if a user is using smartparens, then he will get additional pair definitions, and if he isn't, he will not notice anything different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that, I am using instructions of the form:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(declare-function sp-with-modes &quot;ext:smartparens.el&quot; t t)&#xA;(declare-function sp-local-pair &quot;ext:smartparens.el&quot; t t)&#xA;&#xA;(eval-after-load 'smartparens&#xA;  '(sp-with-modes '(test-mode)&#xA;     (sp-local-pair &quot;&amp;lt;&quot; &quot;&amp;gt;&quot;&#xA;                    :actions '(insert wrap autoskip))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine if the file is not byte-compiled, or if it is byte-compiled by an emacs with smartparens loaded, or with emacs 24.3. However, with 24.5 (and probably with 24.4, though I cannot easily test it at the moment), and if it is compiled in a vanilla emacs (for example with &lt;code&gt;cask build&lt;/code&gt;), it gives an error, stating that the argument &lt;code&gt;(insert wrap autoskip)&lt;/code&gt; is not one of the keywords admissible by &lt;code&gt;sp-local-pair&lt;/code&gt; (&lt;code&gt;:actions&lt;/code&gt;...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remove the call to &lt;code&gt;sp-with-modes&lt;/code&gt;, and I replace the definition with&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(sp-local-pair 'test-mode &quot;&amp;lt;&quot; &quot;&amp;gt;&quot;&#xA;               :actions '(insert wrap autoskip))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then it works fine. The macro &lt;code&gt;sp-with-modes&lt;/code&gt; is supposed to loop over its argument (a list), inserting each element as first argument to everything in the body, I suspect that it confuses the byte-compiler at some point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to include this kind of &quot;maybe evaluation&quot; in a byte-compiled file, without confusing the byte-compiler? For example, is it possible to tell the compiler &quot;do not compile this form&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or what would be the idiomatic way of achieving this kind of third-party support in a package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that the question involves &lt;code&gt;smartparens&lt;/code&gt; because that's where I noticed the problem, but I suspect that it may happen with a lot of other packages.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The rest of the question is a MWE. I assumes that your regular emacs configuration has &lt;code&gt;smartparens&lt;/code&gt; installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;File &lt;code&gt;~/.emacs.d/tests/test.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(declare-function sp-with-modes &quot;ext:smartparens.el&quot; t t)&#xA;(declare-function sp-local-pair &quot;ext:smartparens.el&quot; t t)&#xA;&#xA;(eval-after-load 'smartparens&#xA;  '(sp-with-modes '(test-mode)&#xA;     (sp-local-pair &quot;&amp;lt;&quot; &quot;&amp;gt;&quot;&#xA;                    :actions '(insert wrap autoskip))))&#xA;&#xA;(define-derived-mode test-mode&#xA;  fundamental-mode &quot;Test&quot; &quot;Test mode&quot;)&#xA;&#xA;(provide 'test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;File &lt;code&gt;~/.emacs.d/tests/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;&#xA;(package-initialize)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/tests/&quot;)&#xA;(require 'test)&#xA;&#xA;(require 'smartparens)&#xA;(smartparens-global-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;emacs -Q&lt;/code&gt; and evaluate &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(byte-compile-file &quot;~/.emacs.d/tests/test.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then run &lt;code&gt;emacs -Q --load &quot;~/.emacs.d/tests/init.el&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2015-07-11T11:52:22.600" LastActivityDate="2015-07-11T14:56:09.697" Title="Byte-compiling a file against a package that may or may not be here" Tags="|emacs24.4|byte-compilation|package-development|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13903" PostTypeId="2" ParentId="13898" CreationDate="2015-07-11T09:50:09.623" Score="4" Body="&lt;p&gt;&lt;code&gt;append&lt;/code&gt; wants sequences and you gave it a cons cell and two hash tables, which is why you get an error. If you want to appends sequences, give it sequences : &lt;code&gt;(append (list (cons ...)) (list hashtable1 hashtable2))&lt;/code&gt; will do what you expected. But now of course it's easier and more efficient to just write &lt;code&gt;(list (cons ...) hashtable1 hashtable2)&lt;/code&gt; as suggested in Drew's answer.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-07-11T09:50:09.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13904" PostTypeId="2" ParentId="13876" CreationDate="2015-07-11T11:55:13.960" Score="4" Body="&lt;p&gt;No it doesn't. Maybe &lt;a href=&quot;https://github.com/syohex/emacs-dired-k&quot; rel=&quot;nofollow noreferrer&quot;&gt;dired-k&lt;/a&gt; can do it, or some other Git related package.&lt;/p&gt;&#xA;&lt;p&gt;But neither Magit nor VC show this information in Dired buffers. By the way, while Magit uses its own &lt;a href=&quot;https://github.com/magit/magit/blob/74f792728ef5ffa56fbd51f180bba2ae31620bc7/lisp/magit-mode.el#L694&quot; rel=&quot;nofollow noreferrer&quot;&gt;code&lt;/a&gt; to update the information displayed in the mode-line of file-visiting buffers, it does so by updating the variable &lt;code&gt;vc-display-status&lt;/code&gt; the same way VC would. VC's implementation does many other costly things in its respective function, and because Magit updates the mode-line much more often, it needed an optimized implementation.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;If you want to implement this yourself, then look at the linked function and then adapt it for Dired buffers. Then you would have to loop over all buffers to find Dired buffers (similar to what is being done in &lt;code&gt;magit-revert-buffers&lt;/code&gt; but much less complicated). Finally to hook this into Magit advice &lt;code&gt;magit-revert-buffers&lt;/code&gt; to call your function. (I can also add a hook for that, but only once there actually exists code that could use that.)&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2021-02-04T17:09:45.997" LastActivityDate="2021-02-04T17:09:45.997" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="13905" PostTypeId="2" ParentId="13902" CreationDate="2015-07-11T12:11:17.770" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to include this kind of &quot;maybe evaluation&quot; in a byte-compiled file, without confusing the byte-compiler? For example, is it possible to tell the compiler &quot;do not compile this form&quot;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, you can quote it and then eval it: &lt;code&gt;(eval '(sp-whatever ...))&lt;/code&gt;. This will not be seen by the compiler and will only be expanded at runtime.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Or what would be the idiomatic way of achieving this kind of third-party support in a package?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs has no dedicated support for optional dependencies ATM. If this would be useful to you, please file a bug. This sort of thing only gets implemented after people ask for it.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-07-11T12:11:17.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13906" PostTypeId="1" AcceptedAnswerId="13947" CreationDate="2015-07-11T12:21:20.120" Score="1" ViewCount="1546" Body="&lt;p&gt;While yas-snippet itself loads, the snippets do not. I tried loading them manually and using the following in my init, but neither loads any snippets. What could be the issue?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'yasnippet)&#xA;(setq yas-snippet-dirs&#xA;      '(&quot;~/.emacs.d/snippets&quot;                 ;; personal snippets&#xA;        ))&#xA;(yas-global-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Removing &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs&#xA;      '(&quot;~/.emacs.d/snippets&quot;                 ;; personal snippets&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fixed the problem.&lt;/p&gt;&#xA;" OwnerUserId="6877" LastEditorUserId="91" LastEditDate="2015-07-12T23:30:19.197" LastActivityDate="2015-07-13T18:27:54.047" Title="yas-snippets not loading" Tags="|yasnippet|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13908" PostTypeId="2" ParentId="13625" CreationDate="2015-07-11T13:08:17.090" Score="4" Body="&lt;p&gt;For my own purposes I have also added a little helper to &lt;a href=&quot;https://github.com/tarsius/magit-rockstar&quot; rel=&quot;nofollow&quot;&gt;magit-rockstar&lt;/a&gt;: &lt;a href=&quot;https://github.com/tarsius/magit-rockstar/blob/cbf91692f223dc78e79ad736567d52a057baaff9/magit-rockstar.el#L122&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;magit-branch-pull-request&lt;/code&gt;&lt;/a&gt;. But note that everything in that library is provided as-is (i.e. instead of blogging about snippets, I stuff them into this library). From the library commentary:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also included are tools that are either only useful for people working on Magit itself and/or that aren't ready to be added to Magit yet.  These tools might change at any time, without prior notice or way to appeal.  This is a staging ground.  It's okay if things ain't perfect, or if they only do what &lt;em&gt;I currently&lt;/em&gt; need but not what you (or I) think they should (eventually) be doing instead.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Of course &lt;a href=&quot;https://github.com/sigma/magit-gh-pulls&quot; rel=&quot;nofollow&quot;&gt;magit-gh-pulls&lt;/a&gt; is another, more complete, alternative, but I intend to eventually replace that with something even more feature-full directly in Magit. Until I get there, &lt;code&gt;magit-branch-pull-requests&lt;/code&gt; provides the basic feature that I need. While &lt;code&gt;magit-gh-pulls&lt;/code&gt; does a few things in ways that I don't think are optimal. (Most importantly, it brings in dependencies I would like to avoid (in particular &lt;a href=&quot;https://github.com/sigma/gh.el&quot; rel=&quot;nofollow&quot;&gt;gh.el&lt;/a&gt; which has been accumulating issues)).&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-11T13:27:33.553" LastActivityDate="2015-07-11T13:27:33.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13909" PostTypeId="2" ParentId="13902" CreationDate="2015-07-11T14:27:17.603" Score="4" Body="&lt;p&gt;To add to what @Malabarba said, I think the problem here is that smartparens should provide an API that does not rely on a macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;normal&quot; way this works with usual packages is that the major mode can just do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (boundp 'smartparens-thingies)&#xA;  (push mythingies smartparens-thingies))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or even&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq smartparens-extra-thingies mythingies)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I think it's likely [beware: I know next to nothing about smartparens] that rather then using &lt;code&gt;eval-after-load&lt;/code&gt; and &lt;code&gt;sp-with-modes&lt;/code&gt; you can just call &lt;code&gt;sp-local-pair&lt;/code&gt; from the major mode function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode test-mode parent-mode &quot;doc&quot;&#xA;  ...&#xA;  (when (fboundp 'sp-local-pair)&#xA;    (sp-local-pair &quot;&amp;lt;&quot; &quot;&amp;gt;&quot; :actions '(insert wrap autoskip)))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will solve your problem since it doesn't use a macro that's only available when smartparens is installed.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-07-11T14:56:09.697" LastActivityDate="2015-07-11T14:56:09.697" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13910" PostTypeId="1" CreationDate="2015-07-11T14:34:31.043" Score="1" ViewCount="259" Body="&lt;p&gt;I'm running emacs 25.0.50.1 on Mac OS X 10.10.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use image magick, do I need to rebuild this version of emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy solution? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All best, &lt;/p&gt;&#xA;" OwnerUserId="8872" LastActivityDate="2015-07-14T01:50:49.533" Title="Imagemagick? Rebuild necessary?" Tags="|images|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13911" PostTypeId="1" CreationDate="2015-07-11T17:03:42.177" Score="5" ViewCount="1223" Body="&lt;p&gt;flycheck-mode creates temporary files in the current directory. That is annoying. How can I disable/set the default place for these temporary files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use javascript eslint syntax checker for react jsx files.&lt;/p&gt;&#xA;" OwnerUserId="8873" LastActivityDate="2016-02-25T16:24:08.937" Title="How to set temporary file directory for flycheck eslint (outside of current directory)" Tags="|files|flycheck|javascript|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13912" PostTypeId="2" ParentId="13899" CreationDate="2015-07-11T18:19:03.330" Score="4" Body="&lt;p&gt;The Slack XMPP server doesn't provide correct information about chat rooms in response to an information discovery query.  Could you try the following function and see if &lt;code&gt;M-x jabber-join-slack-room&lt;/code&gt; lets you join the room?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jabber-join-slack-room (jc group nickname)&#xA;  (interactive&#xA;   (let ((account (jabber-read-account))&#xA;         (group (jabber-read-jid-completing &quot;group: &quot;)))&#xA;     (list account group (jabber-muc-read-my-nickname account group))))&#xA;  ;; The Slack server does not return a proper disco result:&#xA;  ;;&#xA;  ;; 1. The disco response has no 'from' attribute.  It should be&#xA;  ;; copied from the 'to' attribute of the request, so that the client&#xA;  ;; can correlate the request and the response.&#xA;  ;;&#xA;  ;; 2. The response doesn't contain an identity of &quot;conference&quot;,&#xA;  ;; which jabber.el looks for to confirm that this is in fact a&#xA;  ;; conference room.  (It would be confusing to try to &quot;join&quot; one of&#xA;  ;; your contacts.)&#xA;  ;;&#xA;  ;; 3. The disco response doesn't contain the feature&#xA;  ;; &quot;muc_passwordprotected&quot;, so jabber.el doesn't know that it needs&#xA;  ;; to provide a password.&#xA;  ;;&#xA;  ;; Therefore, let's seed the correct information into the disco&#xA;  ;; cache before joining the room.&#xA;  (jabber-disco-got-info&#xA;   jc `(iq ((type . &quot;result&quot;)&#xA;             (from . ,group)&#xA;             (id . &quot;emacs-iq-21272.27175.175195&quot;)&#xA;             (xmlns . &quot;jabber:client&quot;)&#xA;             (to . ,(jabber-connection-jid jc)))&#xA;            (query ((xmlns . &quot;http://jabber.org/protocol/disco#info&quot;))&#xA;                   (identity ((category . &quot;conference&quot;) (type . &quot;text&quot;)))&#xA;                   (feature ((var . &quot;http://jabber.org/protocol/muc&quot;)))&#xA;                   (feature ((var . &quot;muc_passwordprotected&quot;)))))&#xA;   (list nil))&#xA;  (jabber-muc-join jc group nickname t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I brought these issues to the attention of the Slack team in March 2014.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-07-11T18:19:03.330" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13913" PostTypeId="1" CreationDate="2015-07-11T23:09:20.927" Score="2" ViewCount="384" Body="&lt;p&gt;I'd like to export headings with particular names/tags, with a particular set of export options, to particular file locations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to do this all via elisp, so that I can have it part of a larger script which then pushes the changes to server. Also there will be multiple sets of overlapping documents/headings exported in different ways, so having all the settings in separate elisp scripts using project-alists allows more flexibility then adding annotations to the files or headings themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a concrete example, I might want to output &lt;code&gt;a.org::*h&lt;/code&gt; to &lt;code&gt;foo.html&lt;/code&gt; and &lt;code&gt;b.org&lt;/code&gt; to &lt;code&gt;bar.html&lt;/code&gt;, with a set of publish settings. &lt;code&gt;foo.html&lt;/code&gt; in this case should only contain the contents of the &lt;code&gt;h&lt;/code&gt; heading, with child headings of &lt;code&gt;h&lt;/code&gt; exported as top level headings in &lt;code&gt;foo.html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way I can see how to do this is to hackily pre-process with a script that copies over parts I want into a new directory (into files with those specific names) and then publishing from there. I'm not sure how to do that in a way that doesn't have unexpected side effects, and am curious if there is a better way? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An ideal solution would enable me to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Specify headings to export, and corresponding output file names.&lt;/li&gt;&#xA;&lt;li&gt;Use project-alist so that I can describe other export settings and combine these export &quot;projects&quot; as needed.&lt;/li&gt;&#xA;&lt;li&gt;Ensure links worked, even as headings are transformed into separate files.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8234" LastEditorUserId="8234" LastEditDate="2015-07-22T18:23:36.140" LastActivityDate="2015-07-22T18:23:36.140" Title="How can I export particular org files/headings with export settings to specified filenames?" Tags="|org-mode|elisp|org-export|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13914" PostTypeId="2" ParentId="13878" CreationDate="2015-07-12T05:07:03.550" Score="8" Body="&lt;p&gt;As @wvxvw suggested in the comments, looking at the &lt;code&gt;*Org PDF LaTeX Output*&lt;/code&gt; buffer is the place to check on the errors. With some basic familiarity with LaTeX, you should be able to track down relatively simple errors like these (which in my experience almost always come from the &lt;code&gt;\verb&lt;/code&gt; command.  However, it would seem that you won't be able to directly trace the error back to the original Org file.&lt;/p&gt;&#xA;" OwnerUserId="8486" LastActivityDate="2015-07-12T05:07:03.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13916" PostTypeId="1" AcceptedAnswerId="13918" CreationDate="2015-07-12T08:18:27.293" Score="4" ViewCount="345" Body="&lt;p&gt;When you hit &lt;code&gt;Tab&lt;/code&gt;  in &lt;code&gt;M-x&lt;/code&gt; for auto completion, the buffer comes up with options as well as a hollow  box cursor. Is that really required? I don't find it intuitive because I can't actually navigate in that buffer anyway and I usually hide all non selected window cursors using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq cursor-in-non-selected-windows nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8796" LastActivityDate="2015-07-12T13:22:53.383" Title="How to disable the hollow box cursor in auto completion buffer?" Tags="|cursor|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13917" PostTypeId="1" AcceptedAnswerId="13919" CreationDate="2015-07-12T08:54:14.507" Score="0" ViewCount="195" Body="&lt;p&gt;I use blank-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want the newlines to be displayed how can I turn it off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also long lines are shown in dark background how can I turn that off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact I only want to display trailing whitespace, that gives me error on eslint.&lt;/p&gt;&#xA;" OwnerUserId="8873" LastEditorUserId="8873" LastEditDate="2015-07-12T09:29:57.570" LastActivityDate="2015-07-12T14:56:42.113" Title="How to customize visualization blank mode" Tags="|formatting|whitespace|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13918" PostTypeId="2" ParentId="13916" CreationDate="2015-07-12T13:22:53.383" Score="4" Body="&lt;p&gt;Using &lt;code&gt;cursor-in-non-selected-windows&lt;/code&gt; is the correct approach, but you can set its value locally in the completions buffer instead of globally so it doesn't affect all your other buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tab completion buffer is running the &lt;code&gt;completions-list-mode&lt;/code&gt; major-mode so you can add a hook to &lt;code&gt;completions-list-mode-hook&lt;/code&gt; to set the value locally like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun no-non-selected-cursor ()&#xA;  &quot;Set ‘cursor-in-non-selected-windows’ to nil locally in the current buffer.&quot;&#xA;  (setq-local cursor-in-non-selected-windows nil))&#xA;&#xA;(add-hook 'completion-list-mode-hook 'no-non-selected-cursor)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-07-12T13:22:53.383" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13919" PostTypeId="2" ParentId="13917" CreationDate="2015-07-12T14:56:42.113" Score="3" Body="&lt;p&gt;Why not use the built-in replacement called &lt;code&gt;whitespace-mode&lt;/code&gt;, instead of using an out-dated library from EmacsWiki that says:  &quot;&lt;em&gt;It runs on Emacs 21, 22 and 23.  &lt;strong&gt;Note&lt;/strong&gt;: This package was replaced by WhiteSpace&lt;/em&gt;&quot; ?  That being said, you can remove &lt;code&gt;newline&lt;/code&gt; from the list of &lt;code&gt;blank-chars&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq blank-chars&#xA;  '(tabs spaces trailing lines space-before-tab indentation empty space-after-tab))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-07-12T14:56:42.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13920" PostTypeId="1" CreationDate="2015-07-12T16:10:46.443" Score="5" ViewCount="1330" Body="&lt;p&gt;SQL mode has some cool stuff set up for indenting with aligned keywords and such. Normally, I'd think it was cool. The problem is that at my new job, the people who wrote our mountains of sql did not have this set up, and just indented sql 4 spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could bully them all into switching to emacs, but that's more of a long term project. In the short term, I want to make emacs indent sql in the stupid way lesser editors do it: 4 spaces, more or less ignorant of context. How would I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A so-so solution is to create a mode hook with &lt;code&gt;(setq indent-line-function 'tab-to-tab-stop)&lt;/code&gt;. Unfortunately, this interacts badly with &lt;code&gt;indent-tabs-mode nil&lt;/code&gt; and the lack of a customized backspace function. What i'd really like is something straightforward that would allow bounce-indent within a few levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I no longer actually need this. I've just started indenting my own SQL correctly, and everyone else seems to appreciate it.&lt;/p&gt;&#xA;" OwnerUserId="8293" LastEditorUserId="8293" LastEditDate="2015-09-11T23:07:31.273" LastActivityDate="2015-09-11T23:07:31.273" Title="How to indent SQL code just 4 spaces, without alignment &amp;c?" Tags="|indentation|sql-mode|sql|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13921" PostTypeId="2" ParentId="13920" CreationDate="2015-07-12T16:49:23.700" Score="0" Body="&lt;p&gt;You might want to take a look at &lt;a href=&quot;https://stackoverflow.com/a/10439239/3672986&quot; title=&quot;Tabs to Spaces&quot;&gt;this&lt;/a&gt; SO response for reference, which details how to switch emacs to defaulting to spaces instead of tabs and how to get tab to insert spaces in multiples of 4. Specifically for SQL mode, you should include this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Use the regular major mode hook to add a buffer-local hack-local-variables-hook&#xA;(add-hook 'sql-mode-hook 'my-sql-mode-hook)&#xA;(defun my-sql-mode-hook ()&#xA;  (add-hook 'hack-local-variables-hook&#xA;            (lambda () (setq indent-tabs-mode nil) (setq tab-width 4) )))&#xA;            nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The real meat of the code is inside the &lt;code&gt;lambda&lt;/code&gt; function and relies on setting the local variables &lt;code&gt;indent-tabs-mode&lt;/code&gt; and &lt;code&gt;tab-width&lt;/code&gt;. Including this in you &lt;code&gt;init.el&lt;/code&gt; will cause &lt;code&gt;sql-mode&lt;/code&gt; to use tabs instead of spaces and make the tab width 4 spaces.&lt;/p&gt;&#xA;" OwnerUserId="8486" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-07-12T17:38:09.713" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13922" PostTypeId="1" AcceptedAnswerId="13925" CreationDate="2015-07-12T17:17:29.157" Score="1" ViewCount="222" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How to programmatically increment several numeric keys of a hash-table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working on a modificion of speedbar to support the concept of &lt;code&gt;speedbar-get-marked-files&lt;/code&gt; -- &lt;a href=&quot;https://emacs.stackexchange.com/q/13859/2287&quot;&gt;speedbar -- mark/unmark directories/files -- `speedbar-get-marked-files`&lt;/a&gt;  I have setup a hash-table that consists of buffer line numbers for the keys, and the values are absolute filenames or directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When clicking on a &lt;code&gt;+&lt;/code&gt; sign to expand directories, speedbar inserts additional files and directories underneath the expanded node.  It is at this point that the hash-table needs to be modified, since &lt;code&gt;puthash&lt;/code&gt; replaces existing entries.  Programmatically, I already know how many new lines will be inserted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A buffer contains 9 lines (in this case all directories), with a corresponding hash-table.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1  &quot;/usr/&quot;&#xA;2  &quot;/usr/bin&quot;&#xA;3  &quot;/usr/include&quot;&#xA;4  &quot;/usr/lib&quot;&#xA;5  &quot;/usr/libexec&quot;&#xA;6  &quot;/usr/local&quot;&#xA;7  &quot;/usr/man&quot;&#xA;8  &quot;/usr/sbin&quot;&#xA;9  &quot;/usr/share&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We click on the expandable directory &lt;code&gt;/usr/lib&lt;/code&gt; and programmatically we know that 8 new directories and 27 new files will be inserted.  Therefore, a total of 35 new lines will be added underneath line 4 -- the previous hash-table entries of 5, 6, 7, 8 and 9 all need to be renumbered by adding 35 to each one.  The new hash-table should become:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1  &quot;/usr/&quot;&#xA;2  &quot;/usr/bin&quot;&#xA;3  &quot;/usr/include&quot;&#xA;4  &quot;/usr/lib&quot;&#xA;40  &quot;/usr/libexec&quot;&#xA;41  &quot;/usr/local&quot;&#xA;42  &quot;/usr/man&quot;&#xA;43  &quot;/usr/sbin&quot;&#xA;44  &quot;/usr/share&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-07-13T07:48:07.903" Title="How to increment several numeric keys of a hash-table" Tags="|hash-tables|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13923" PostTypeId="2" ParentId="13922" CreationDate="2015-07-12T18:22:09.393" Score="0" Body="&lt;pre&gt;&lt;code&gt;(let* ((current-line (line-number-at-pos))&#xA;       (increment 35)&#xA;       (copied-line-to-node-table (copy-hash-table speedbar-line-to-node-table))&#xA;       (copied-node-to-line-table (copy-hash-table speedbar-node-to-line-table)))&#xA;  (maphash&#xA;    (lambda (line filename)&#xA;      (when (&amp;gt; line current-line)&#xA;        (puthash (+ line increment) filename speedbar-line-to-node-table)))&#xA;    copied-line-to-node-table)&#xA;  (maphash&#xA;    (lambda (filename line)&#xA;      (when (&amp;gt; line current-line)&#xA;        (puthash filename (+ line increment) speedbar-node-to-line-table)))&#xA;    copied-node-to-line-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-07-12T20:16:02.467" LastActivityDate="2015-07-12T20:16:02.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13924" PostTypeId="2" ParentId="13922" CreationDate="2015-07-12T18:30:01.620" Score="3" Body="&lt;p&gt;As npostavs said, it would probably make more sense to use another datastructure, perhaps a B-tree or some other kind of tree, where you wouldn't need to do massive insert / remove operations.  Below, however, is a simple example of how one can go about doing this while still using a hash-table:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((example (make-hash-table))&#xA;      (offset 5)&#xA;      (increment 3))&#xA;  (cl-loop for i below 10 do (puthash i (format &quot;value: %d&quot; i) example))&#xA;  (cl-loop for k being the hash-keys of example using (hash-values v) do&#xA;           (message &quot;before %s =&amp;gt; %s&quot; k v))&#xA;  (cl-loop for (k . v) in&#xA;           (cl-loop for k being the hash-keys of example using (hash-values v)&#xA;                    when (&amp;gt; k offset) do&#xA;                    (remhash k example)&#xA;                    and collect (cons k v))&#xA;           do (puthash (+ k increment) v example))&#xA;  (cl-loop for k being the hash-keys of example using (hash-values v) do&#xA;           (message &quot;after %s =&amp;gt; %s&quot; k v)))&#xA;&#xA;;; before 0 =&amp;gt; value: 0&#xA;;; before 1 =&amp;gt; value: 1&#xA;;; before 2 =&amp;gt; value: 2&#xA;;; before 3 =&amp;gt; value: 3&#xA;;; before 4 =&amp;gt; value: 4&#xA;;; before 5 =&amp;gt; value: 5&#xA;;; before 6 =&amp;gt; value: 6&#xA;;; before 7 =&amp;gt; value: 7&#xA;;; before 8 =&amp;gt; value: 8&#xA;;; before 9 =&amp;gt; value: 9&#xA;&#xA;;; after 0 =&amp;gt; value: 0&#xA;;; after 1 =&amp;gt; value: 1&#xA;;; after 2 =&amp;gt; value: 2&#xA;;; after 3 =&amp;gt; value: 3&#xA;;; after 4 =&amp;gt; value: 4&#xA;;; after 5 =&amp;gt; value: 5&#xA;;; after 12 =&amp;gt; value: 9&#xA;;; after 11 =&amp;gt; value: 8&#xA;;; after 10 =&amp;gt; value: 7&#xA;;; after 9 =&amp;gt; value: 6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note that there's a caveat: if you increase the key in the same loop, you may accidentally overwrite the value with higher key value. &lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-07-12T18:43:56.557" LastActivityDate="2015-07-12T18:43:56.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13925" PostTypeId="2" ParentId="13922" CreationDate="2015-07-12T18:34:30.120" Score="1" Body="&lt;p&gt;If you know the top index, and you know that the indices are consecutive it might be more efficient to loop over those specific indices:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((table #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 data&#xA;                           (1 &quot;/usr/&quot; 2 &quot;/usr/bin&quot; 3 &quot;/usr/include&quot; 4 &quot;/usr/lib&quot; 5 &quot;/usr/libexec&quot;&#xA;                              6 &quot;/usr/local&quot; 7 &quot;/usr/man&quot; 8 &quot;/usr/sbin&quot; 9 &quot;/usr/share&quot;)))&#xA;      (lo 5)&#xA;      (hi 9)&#xA;      (inc 35))&#xA;  (if (cl-plusp inc)&#xA;      (cl-loop for i from hi downto lo&#xA;               do (puthash (+ i inc) (gethash i table) table))&#xA;    (cl-loop for i from lo upto hi&#xA;             do (puthash (+ i inc) (gethash i table) table))))&#xA; ;; assuming 5..34 are set later&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-07-13T07:48:07.903" LastActivityDate="2015-07-13T07:48:07.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13926" PostTypeId="1" AcceptedAnswerId="13928" CreationDate="2015-07-12T19:27:52.710" Score="8" ViewCount="503" Body="&lt;p&gt;Is there a way to fold a region in org-mode? (Not the whole file, and not an individual item, but a region containing multiple items.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often I want to collapse only a portion of an &lt;code&gt;org&lt;/code&gt; file, say folding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA;** a1&#xA;** a2&#xA;* b&#xA;** b1&#xA;** b2&#xA;** b3&#xA;* c&#xA;** c1&#xA;** c2&#xA;* d&#xA;** d1&#xA;** d2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA;** a1&#xA;** a2&#xA;* b ...&#xA;* c ...&#xA;* d&#xA;** d1&#xA;** d2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know in this particular example I could simply fold the whole file using &lt;code&gt;org-cycle&lt;/code&gt;, then expand &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;d&lt;/code&gt; individually, but imagine there are hundreds of items and I want to fold a dozen contiguous items contained in an active region while leaving the rest of the items in the file expanded.&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2015-07-12T21:44:41.313" LastActivityDate="2015-07-12T22:15:37.977" Title="Fold region of org file" Tags="|org-mode|region|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13927" PostTypeId="1" AcceptedAnswerId="16394" CreationDate="2015-07-12T21:02:57.330" Score="21" ViewCount="2371" Body="&lt;p&gt;Some programs like firefox have buttons that when clicked open a file manager for browsing files. How do I make it to open in emacs with dired mode on Debian Linux?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="12504" LastEditDate="2018-08-29T06:27:06.200" LastActivityDate="2018-08-29T06:27:06.200" Title="How to set emacs as the default file manager?" Tags="|dired|linux|integration|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="13928" PostTypeId="2" ParentId="13926" CreationDate="2015-07-12T21:49:11.100" Score="7" Body="&lt;p&gt;This seems to do what you want :&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-hide-subtrees-in-region (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (save-restriction&#xA;    (narrow-to-region beg end)&#xA;    (outline-hide-sublevels 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: I first gave a wrong solution, which I keep here as it is also interesting IMO (but doesn't answer the question)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;outline-hide-region-body&lt;/code&gt; seems to be exactly what you want, but for some reason it is not interactive. We could add an interactive spec to it, but let's just define &lt;code&gt;org-hide-subtrees-in-region&lt;/code&gt; as :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-hide-subtrees-in-region (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (outline-hide-region-body beg end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-07-12T22:15:37.977" LastActivityDate="2015-07-12T22:15:37.977" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13929" PostTypeId="1" AcceptedAnswerId="13932" CreationDate="2015-07-13T02:19:56.433" Score="8" ViewCount="1142" Body="&lt;p&gt;I understand what autoload does for functions (register file to load when&#xA;such function is called or its documentation string is retrieved). However,&#xA;it's not clear how to use autoload facility in conjunction with variables&#xA;and macros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What happens when package has parameter, implemented as a variable that&#xA;user can set, but it's not autoloaded? Should such variables be&#xA;autoloaded? If not, it turns out that such variables do not exist, Lisp&#xA;environment knows nothing about them, including their default values,&#xA;until some autoloaded function from the package is used (typically after&#xA;loading of configuration files), then if user sets them in his/her&#xA;configuration file, it's like setting non-existing variable. If value of&#xA;the variable is a non-empty list and user uses &lt;code&gt;push&lt;/code&gt; or &lt;code&gt;add-to-list&lt;/code&gt; to&#xA;change its value, what exactly happens? Are default values lost?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What happens when a macro is autoloaded? When should we autoload a macro?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-13T06:20:17.557" LastActivityDate="2015-07-13T15:32:51.670" Title="Autoloads and variables" Tags="|elisp|elisp-macros|variables|autoload|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13930" PostTypeId="1" AcceptedAnswerId="13944" CreationDate="2015-07-13T03:05:39.950" Score="5" ViewCount="1484" Body="&#xA;&#xA;&lt;p&gt;I would like that when I open a file of certain type (say &lt;code&gt;*.abc&lt;/code&gt;)&#xA;certain function (say &lt;code&gt;my-function&lt;/code&gt;) automatically executes at the&#xA;opening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;. The function is a buffer-dependent function and should run at the buffer containing the file&#xA;  &lt;code&gt;*.abc&lt;/code&gt;, i.e., it should run after loading the file&#xA;  &lt;code&gt;.abc&lt;/code&gt; not before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function I would like to execute is&#xA;  &lt;code&gt;shr-render-buffer&lt;/code&gt; (but it may arise for other functions). It&#xA;  renders html codes. Note that the file may have an arbitrary suffix&#xA;  not just &lt;code&gt;.html&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the hints in the answer of Mark an using the links in my comment&#xA;below it, I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempt 1:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'shr)&#xA;(add-hook 'find-file-hook 'my-function)&#xA;(defun my-function ()&#xA;  (when (and (stringp buffer-file-name)&#xA;             (string-match &quot;\\.html\\'&quot; buffer-file-name))&#xA;             '(shr-render-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Attempt 2:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'shr)&#xA;(add-to-list 'auto-mode-alist&#xA;             '(&quot;\\.abc\\'&quot; . (lambda ()&#xA;                              '(shr-render-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Attempt 3:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'shr)&#xA;(add-hook 'find-file-hook 'my-function)&#xA;(defun my-function ()&#xA;  (when (string= (file-name-extension buffer-file-name) &quot;abc&quot;)&#xA;    '(shr-render-buffer)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then after the suggetion of Lidydancer, I tried to define a major mode for&#xA;&lt;code&gt;.abc&lt;/code&gt; types. For simplicity I considered them as &lt;code&gt;html-mode&lt;/code&gt; and I&#xA;used the following (already provided by one of the answers in the&#xA;below links):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempt 4:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'shr)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.abc\\'&quot; . html-mode))&#xA;(add-hook 'html-mode-hook 'shr-render-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All my attempts were unsuccessful.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="115" LastEditDate="2015-07-13T16:57:34.787" LastActivityDate="2015-07-13T16:57:34.787" Title="Executing a function when opening a file of certain type" Tags="|elisp|hooks|files|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13931" PostTypeId="2" ParentId="13930" CreationDate="2015-07-13T03:31:33.540" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;find-file-hook&lt;/code&gt;. From doc-string:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List of functions to be called after a buffer is loaded from a file.&#xA;  The buffer's local variables (if any) will have been processed before the&#xA;  functions are called.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thus, you can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'find-file-hook #'your-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;your-function&lt;/code&gt; your should test if &lt;code&gt;buffer-file-name&lt;/code&gt; has the extension you target. Then you can execute some code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There may be better solution I don't know of.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-13T03:31:33.540" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13932" PostTypeId="2" ParentId="13929" CreationDate="2015-07-13T07:02:25.600" Score="5" Body="&lt;p&gt;Autoloading only applies to the function value slot of a symbol. In particular, there is no such thing as autoloading a variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is probably bad form for a package to contain variables for user customization whose default value is a nonempty list, precisely because it becomes difficult to customize the variable in that case. Worse, if the default value were to change, the customized value should probably change too, yet the user won't be aware of it. If some package does have such variables, it may be best to alter it after the package has loaded, using &lt;code&gt;eval-after-load&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most customization variables will have a default value of &lt;code&gt;nil&lt;/code&gt;, in which case you just set them using &lt;code&gt;setq&lt;/code&gt; in your init file (or use the customization interface). Assuming the package uses &lt;code&gt;defvar&lt;/code&gt; or &lt;code&gt;defcustom&lt;/code&gt; to set the variable, as it should, it will not override your setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Autoloading macros: Set the fifth argument of &lt;code&gt;autoload&lt;/code&gt; to achieve this. Like functions, this should be done if it's likely that you wish to use the macro without loading the package first – either explicitly, or implicitly by first invoking other autoloaded symbols from the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Addendum:&lt;/strong&gt; As the OP pointed out in the comments, a magical &lt;code&gt;;;;###autoload&lt;/code&gt; comment will also copy a &lt;code&gt;defvar&lt;/code&gt; (indeed, any elisp form) to the autoload file. See the &lt;em&gt;Autoload&lt;/em&gt; section in the elisp manual for details.&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2015-07-13T15:32:51.670" LastActivityDate="2015-07-13T15:32:51.670" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="13933" PostTypeId="1" AcceptedAnswerId="13936" CreationDate="2015-07-13T08:37:41.850" Score="3" ViewCount="270" Body="&lt;p&gt;Is there a way to cycle through \( x=1 \), \[ x=1\] and &#xA;\begin{equation}&#xA;x=1&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in any latex package? I find this function practical but I didn't know how to implement using elisp or maybe someone has already done that?&lt;/p&gt;&#xA;" OwnerUserId="6602" LastEditorUserId="6602" LastEditDate="2015-07-13T10:25:50.250" LastActivityDate="2015-07-15T06:30:32.653" Title="cycling through latex math mode and equation" Tags="|elisp|latex|auctex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13934" PostTypeId="1" AcceptedAnswerId="13939" CreationDate="2015-07-13T10:54:53.027" Score="2" ViewCount="281" Body="&lt;p&gt;I am trying to update the fairly old taskpaper major mode for Emacs found &lt;a href=&quot;https://github.com/jedthehumanoid/taskpaper.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to simply include the current date, whenever I mark a task as done. The line should then read:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;- Task @done(2015-07-13)&lt;/code&gt; instead of just &lt;code&gt;- Task @done&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="8888" LastActivityDate="2015-07-13T15:39:24.310" Title="Updating taskpaper major mode to add date to @done tasks" Tags="|major-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13935" PostTypeId="1" CreationDate="2015-07-13T11:28:50.093" Score="1" ViewCount="117" Body="&lt;p&gt;In my current Emacs configuration, when ECB is active and I &lt;code&gt;find-file&lt;/code&gt; in a non-existing directory, I keep getting interrupted to answer the following question in the echo-area:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;File /tmp/new-foo/bar.txt is read-only on disk.  Make buffer read-only, too? (y or n) n&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to keep Emacs from interrupting me to type &lt;code&gt;y&lt;/code&gt;/&lt;code&gt;n&lt;/code&gt; whenever I open a new buffer. Sadly I can't find the ECB option that controls this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the customisation option that controls this annoying behaviour?&lt;/p&gt;&#xA;" OwnerDisplayName="user66" LastActivityDate="2015-07-13T11:28:50.093" Title="ECB Never ask to make buffer read-only" Tags="|find-file|echo-area|read-only-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13936" PostTypeId="2" ParentId="13933" CreationDate="2015-07-13T14:43:28.453" Score="2" Body="&lt;p&gt;This function will do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun cycle-texmath () &#xA;&#xA;  (if (texmathp)&#xA;    (save-excursion&#xA;      (setq env (car texmathp-why))&#xA;      (if (string= env &quot;equation&quot;) (progn &#xA;        (search-backward &quot;\\begin{equation}&quot;) (replace-match &quot;\\[&quot; t t)&#xA;        (search-forward &quot;\\end{equation}&quot;) (replace-match &quot;\\]&quot; t t)))&#xA;      (if (string= env &quot;\\[&quot;) (progn &#xA;        (search-backward &quot;\\[&quot;) (replace-match &quot;\\(&quot; t t)&#xA;        (search-forward &quot;\\]&quot;) (replace-match &quot;\\)&quot; t t)))&#xA;      (if (string= env &quot;\\(&quot;) (progn &#xA;        (search-backward &quot;\\(&quot;) (replace-match &quot;\\begin{equation}&quot; t t)&#xA;        (search-forward &quot;\\)&quot;) (replace-match &quot;\\end{equation}&quot; t t)))&#xA;  )))&#xA;&#xA;(eval-after-load &quot;latex&quot;&#xA;   '(progn&#xA;     (define-key LaTeX-mode-map (kbd &quot;C-c t&quot;) (lambda () (interactive) (cycle-texmath)))&#xA;     ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It relies on the &lt;code&gt;texmathp&lt;/code&gt; and &lt;code&gt;texmathp-why&lt;/code&gt; functions which are built into &lt;code&gt;AucTeX&lt;/code&gt; to determine if the point is within a math mode and which indicators are used to invoke it. I've bound it to &lt;code&gt;C-c t&lt;/code&gt;, but feel free to replace that with whatever you'd like.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;EDIT:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;After posing this as &lt;a href=&quot;https://emacs.stackexchange.com/questions/13988/change-escape-behavior-when-inside-latex-equations&quot;&gt;another question&lt;/a&gt; to handle the edge case of being within a &lt;code&gt;text{}&lt;/code&gt; environment, the updated version of the code is here:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun cycle-texmath ()&#xA;  (save-excursion&#xA;    (while (member (TeX-current-macro) '(&quot;text&quot;))&#xA;      (backward-char))&#xA;    (when (texmathp)&#xA;      (let ((env (car texmathp-why)))&#xA;        (cond&#xA;         ((string= env &quot;equation&quot;)&#xA;          (search-backward &quot;\\begin{equation}&quot;)&#xA;          (replace-match &quot;\\[&quot; t t)&#xA;          (search-forward &quot;\\end{equation}&quot;)&#xA;          (replace-match &quot;\\]&quot; t t))&#xA;         ((string= env &quot;\\[&quot;)&#xA;          (search-backward &quot;\\[&quot;)&#xA;          (replace-match &quot;\\(&quot; t t)&#xA;          (search-forward &quot;\\]&quot;)&#xA;          (replace-match &quot;\\)&quot; t t))&#xA;         ((string= env &quot;\\(&quot;)&#xA;          (search-backward &quot;\\(&quot;)&#xA;          (replace-match &quot;\\begin{equation}&quot; t t)&#xA;          (search-forward &quot;\\)&quot;)&#xA;          (replace-match &quot;\\end{equation}&quot; t t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8486" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-07-15T06:30:32.653" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13937" PostTypeId="1" AcceptedAnswerId="13940" CreationDate="2015-07-13T15:03:40.083" Score="0" ViewCount="139" Body="&lt;p&gt;I know how to do a normal search and replace ,but say for instance that I want to replace all numbers in a buffer that starts with a 0 and the second number is a generic number, how do I match that pattern? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that I want to remove all numbers that begins with a zero followed by some other number. &lt;/p&gt;&#xA;" OwnerUserId="8508" LastEditorUserId="115" LastEditDate="2015-07-14T14:32:16.170" LastActivityDate="2015-07-14T14:32:16.170" Title="How to search and replace a number starting with 0?" Tags="|search|editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13938" PostTypeId="1" CreationDate="2015-07-13T15:13:42.300" Score="1" ViewCount="246" Body="&lt;p&gt;I am trying to write a snipped mode for writing subscripts in LaTeX:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: sub&#xA;# key: _&#xA;# --&#xA;_{\text{$1}}$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I type just &lt;code&gt;_ + TAB&lt;/code&gt; it expands correctly  as expencted. But if there is a character before &lt;code&gt;_&lt;/code&gt;, it doesn't expand at all. However this is the case where I need it. For example &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;x_ + TAB&lt;/code&gt; should expand to  &lt;code&gt;x_{\text{}}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is not possible in &lt;code&gt;yasnipped&lt;/code&gt;, what would be the best way to get exactly this in emacs?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2015-07-13T18:50:09.863" LastActivityDate="2015-07-13T18:50:09.863" Title="Yasnipped expand also after character" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13939" PostTypeId="2" ParentId="13934" CreationDate="2015-07-13T15:17:33.860" Score="0" Body="&#xA;&#xA;&lt;p&gt;How about changing line 124 from &lt;code&gt;(insert &quot; @done&quot;)&lt;/code&gt; to this instead?:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[The example assumes that the original poster has a current version of Emacs that already has &lt;code&gt;(require 'org)&lt;/code&gt; somewhere built-in.  If not, then add that statement to the &lt;code&gt;.emacs&lt;/code&gt; file.  The example is a modified excerpt from the built-in function &lt;code&gt;org-insert-time-stamp&lt;/code&gt;.]&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((inactive t)&#xA;       (with-hm t)&#xA;       (fmt (funcall (if with-hm 'cdr 'car) org-time-stamp-formats)))&#xA;  (when inactive (setq fmt (concat &quot;[&quot; (substring fmt 1 -1) &quot;]&quot;)))&#xA;  (insert &quot; @done&quot; (format-time-string fmt (current-time))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the original poster prefers that the time-stamp be active, then change &lt;code&gt;(inactive t)&lt;/code&gt; to &lt;code&gt;(inactive nil)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the original poster does not want hours/minutes, then change &lt;code&gt;(with-hm t)&lt;/code&gt; to &lt;code&gt;(with-hm nil)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="115" LastEditDate="2015-07-13T15:39:24.310" LastActivityDate="2015-07-13T15:39:24.310" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13940" PostTypeId="2" ParentId="13937" CreationDate="2015-07-13T15:17:55.783" Score="3" Body="&lt;p&gt;Here is how you can remove all numbers starting with &lt;code&gt;0&lt;/code&gt; using &lt;code&gt;query-replace-regexp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-%&lt;/code&gt; (default binding for &lt;code&gt;query-replace-regexp&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\b0[0-9]+ RET&lt;/code&gt;*&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Now each &lt;code&gt;SPACE&lt;/code&gt; key hit will replace one match (Hit &lt;code&gt;!&lt;/code&gt; to replace all matches). &lt;strong&gt;Hit &lt;code&gt;?&lt;/code&gt; to learn about more &lt;code&gt;query-replace&lt;/code&gt; bindings.&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;* &lt;strong&gt;Learn more about the elisp regular expressions from the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html&quot; rel=&quot;nofollow&quot;&gt;Regular Expressions&lt;/a&gt; section in Emacs manual.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-07-13T15:17:55.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13941" PostTypeId="1" AcceptedAnswerId="13942" CreationDate="2015-07-13T15:23:48.127" Score="13" ViewCount="5302" Body="&lt;p&gt;I have been using eclipse for a little while now and I did find some shortcuts highly useful, in particular the ability to move a rectangular selection of lines up and down using Alt+Up/Down. I have been looking around for this functionality in emacs. So far I have found the following script:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun move-text-internal (arg)&#xA;   (cond&#xA;    ((and mark-active transient-mark-mode)&#xA;     (if (&amp;gt; (point) (mark))&#xA;            (exchange-point-and-mark))&#xA;     (let ((column (current-column))&#xA;              (text (delete-and-extract-region (point) (mark))))&#xA;       (forward-line arg)&#xA;       (move-to-column column t)&#xA;       (set-mark (point))&#xA;       (insert text)&#xA;       (exchange-point-and-mark)&#xA;       (setq deactivate-mark nil)))&#xA;    (t&#xA;     (beginning-of-line)&#xA;     (when (or (&amp;gt; arg 0) (not (bobp)))&#xA;       (forward-line)&#xA;       (when (or (&amp;lt; arg 0) (not (eobp)))&#xA;            (transpose-lines arg))&#xA;       (forward-line -1)))))&#xA;&#xA;(defun move-text-down (arg)&#xA;   &quot;Move region (transient-mark-mode active) or current line&#xA;  arg lines down.&quot;&#xA;   (interactive &quot;*p&quot;)&#xA;   (move-text-internal arg))&#xA;&#xA;(defun move-text-up (arg)&#xA;   &quot;Move region (transient-mark-mode active) or current line&#xA;  arg lines up.&quot;&#xA;   (interactive &quot;*p&quot;)&#xA;   (move-text-internal (- arg)))&#xA;&#xA;(global-set-key [\M-up] 'move-text-up)&#xA;(global-set-key [\M-down] 'move-text-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does work except for the fact that this moves the &lt;em&gt;selection&lt;/em&gt;. I would rather move all lines (including trailing newline) included in the selection instead. Is there a way to realize this as well? &lt;/p&gt;&#xA;" OwnerUserId="8891" LastActivityDate="2017-07-20T16:51:03.913" Title="Move selected lines up and down" Tags="|elisp|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13942" PostTypeId="2" ParentId="13941" CreationDate="2015-07-13T15:37:42.397" Score="18" Body="&lt;h2&gt;&lt;code&gt;drag-stuff&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Check out the &lt;a href=&quot;https://github.com/rejeep/drag-stuff.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;drag-stuff&lt;/code&gt;&lt;/a&gt; package (also available on Melpa).&lt;/p&gt;&#xA;&lt;p&gt;You can then select a region and use &lt;code&gt;drag-stuff-up&lt;/code&gt;/&lt;code&gt;drag-stuff-down&lt;/code&gt; to move that region up/down.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Alternative behavior when dragging lines&lt;/h2&gt;&#xA;&lt;p&gt;By default, the &lt;code&gt;drag-stuff&lt;/code&gt; commands will also drag the line the &lt;code&gt;point&lt;/code&gt; is on (even if the point is on the very first column). If you want to select, let's say 2 whole lines by doing &lt;code&gt;C-a C-SPC C-n C-n&lt;/code&gt;, the selection will look something like this&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; line 1&#xA;▯line 2&#xA; line 3&#xA;▮line 4 &#xA; line 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that here I intend to move just lines 2 and 3, &lt;strong&gt;not line 4&lt;/strong&gt;. But &lt;code&gt;drag-stuff&lt;/code&gt; will move that 3rd line as well by default.&lt;/p&gt;&#xA;&lt;p&gt;That was &lt;em&gt;my pet-peeve&lt;/em&gt; (and probably doesn't apply to anyone else) and so I &lt;a href=&quot;https://github.com/rejeep/drag-stuff.el/issues/4&quot; rel=&quot;noreferrer&quot;&gt;requested the package dev for a solution&lt;/a&gt;. Here's a &lt;em&gt;hack&lt;/em&gt; you can put in your emacs config after requiring &lt;code&gt;drag-stuff&lt;/code&gt; if you do not want this default behavior. The hack will not move the current line IF the point is on column 0 (first column).&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-drag-stuff.el&#xA;;; https://github.com/rejeep/drag-stuff.el/issues/4&#xA;(defvar modi/drag-stuff--point-adjusted nil)&#xA;(defvar modi/drag-stuff--point-mark-exchanged nil)&#xA;&#xA;(defun modi/drag-stuff--adj-pt-pre-drag ()&#xA;  &amp;quot;If a region is selected AND the `point' is in the first column, move&#xA;back the point by one char so that it ends up on the previous line. If the&#xA;point is above the mark, exchange the point and mark temporarily.&amp;quot;&#xA;  (when (region-active-p)&#xA;    (when (&amp;lt; (point) (mark)) ; selection is done starting from bottom to up&#xA;      (exchange-point-and-mark)&#xA;      (setq modi/drag-stuff--point-mark-exchanged t))&#xA;    (if (zerop (current-column))&#xA;        (progn&#xA;          (backward-char 1)&#xA;          (setq modi/drag-stuff--point-adjusted t))&#xA;      ;; If point did not end up being on the first column after the&#xA;      ;; point/mark exchange, revert that exchange.&#xA;      (when modi/drag-stuff--point-mark-exchanged&#xA;        (exchange-point-and-mark) ; restore the original point and mark loc&#xA;        (setq modi/drag-stuff--point-mark-exchanged nil)))))&#xA;&#xA;(defun modi/drag-stuff--rst-pt-post-drag ()&#xA;  &amp;quot;Restore the `point' to where it was by forwarding it by one char after&#xA;the vertical drag is done.&amp;quot;&#xA;  (when modi/drag-stuff--point-adjusted&#xA;    (forward-char 1)&#xA;    (setq modi/drag-stuff--point-adjusted nil))&#xA;  (when modi/drag-stuff--point-mark-exchanged&#xA;    (exchange-point-and-mark) ; restore the original point and mark loc&#xA;    (setq modi/drag-stuff--point-mark-exchanged nil)))&#xA;&#xA;(add-hook 'drag-stuff-before-drag-hook #'modi/drag-stuff--adj-pt-pre-drag)&#xA;(add-hook 'drag-stuff-after-drag-hook  #'modi/drag-stuff--rst-pt-post-drag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Demonstration of how dragging lines works before and after the above hack&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Before hack&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; line 1                                      line 1&#xA;▯line 2                                      line 5&#xA; line 3    --(M-x drag-stuff-down)--&amp;gt;       ▯line 2   MOVED LINE&#xA;▮line 4                                      line 3   MOVED LINE&#xA; line 5                                     ▮line 4   MOVED LINE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;After hack&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; line 1                                      line 1&#xA;▯line 2                                      line 4&#xA; line 3    --(M-x drag-stuff-down)--&amp;gt;       ▯line 2   MOVED LINE&#xA;▮line 4                                      line 3   MOVED LINE&#xA; line 5                                     ▮line 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Keybindings&lt;/h2&gt;&#xA;&lt;p&gt;To achieve the eclipse-like behavior just add appropriate key bindings:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &amp;quot;M-&amp;lt;up&amp;gt;&amp;quot;)   #'drag-stuff-up)&#xA;(global-set-key (kbd &amp;quot;M-&amp;lt;down&amp;gt;&amp;quot;) #'drag-stuff-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-24T19:31:43.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13943" PostTypeId="2" ParentId="13938" CreationDate="2015-07-13T16:23:30.817" Score="1" Body="&lt;p&gt;Your approach is slightly incorrect, imho. Yasnippet expands &lt;em&gt;symbols&lt;/em&gt;, that is, frankly speaking, something surrounded with white space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How about this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: sub&#xA;# key: sub&#xA;# --&#xA;${1:symbol}_\{\text\{${2:subscript}\}\}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words, you're trying to append something to separate symbol, while you could use any short symbol just to insert necessary template and then fill it out -- works just as well.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Of course if you really-really want to do it your way, it's possible:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;write around advice for &lt;code&gt;yas-expand&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;see if word immediately before point ends with a &lt;code&gt;_&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;magically find your snippet and manually feed it to internal functions of Yasnippet, trigger snippet expansion;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if word before point is not magic, call real &lt;code&gt;yas-exapand&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;now it should work, but you want to use conventional approach at this point (or you're ready to invent another template system for Emacs, that &lt;em&gt;does it right for you&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-13T17:09:50.767" LastActivityDate="2015-07-13T17:09:50.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13944" PostTypeId="2" ParentId="13930" CreationDate="2015-07-13T16:56:24.437" Score="3" Body="&lt;p&gt;Your attempt 1 is almost correct. Your attempt 3 will also work with the same fixes I have done below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the two things that needed to be fixed:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You do not quote the function you are calling. If you want to call function &lt;code&gt;FN&lt;/code&gt;, you simply do &lt;code&gt;(FN)&lt;/code&gt;. When you do &lt;code&gt;'(FN)&lt;/code&gt; it simply is a list with one element: the symbol &lt;code&gt;FN&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You were missing a mandatory argument that &lt;code&gt;shr-render-buffer&lt;/code&gt; needed; you need to specify which buffer you want that function to act upon.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's something I quickly tried out and works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'shr)&#xA;(add-hook 'find-file-hook #'my-function)&#xA;(defun my-function ()&#xA;  (when (and (stringp buffer-file-name)&#xA;             (string-match &quot;\\.html\\'&quot; buffer-file-name))&#xA;    (shr-render-buffer (current-buffer)))) ; FIXED line &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-07-13T16:56:24.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13945" PostTypeId="2" ParentId="13941" CreationDate="2015-07-13T17:44:52.137" Score="1" Body="&lt;p&gt;Here's a way to do this using keyboard macros:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x (&lt;/kbd&gt; start recording the macro.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-a&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;C-p&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;C-w&lt;/kbd&gt;&lt;kbd&gt;C-p&lt;/kbd&gt;&lt;kbd&gt;C-y&lt;/kbd&gt; cut a line and paste it one line earlier in the buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x )&lt;/kbd&gt; finish recording the macro.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x e&lt;/kbd&gt; will move the line up as many times as you press it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-13T17:44:52.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13946" PostTypeId="1" AcceptedAnswerId="14009" CreationDate="2015-07-13T18:13:33.543" Score="1" ViewCount="483" Body="&lt;p&gt;I want to use imenu in &lt;code&gt;matlab-mode&lt;/code&gt; in emacs. So I add something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq imenu-generic-expression&#xA;      '((&quot;Function&quot;&#xA;         &quot;\\(function\\)[\n\t ]*\\[?[ ,_A-Za-z0-9]+\\]?[\n\t ]*=[\n\t ]*\\([_A-Za-z0-9]+\\)&quot; 2)&#xA;        (&quot;Anonymous Function&quot;&#xA;         &quot;\\([_A-Za-z0-9]+\\)[\n\t ]*=[\n\t ]*@[\n\t ]*([, _A-Za-z0-9]+)&quot; 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in a function for &lt;code&gt;matlab-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The matlab function definitions are something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function y = func1 (x)&#xA;end&#xA;&#xA;function [y, z] = func2 (a, b, c)&#xA;end&#xA;&#xA;func3 = @(x) sin(x) + cos(x);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above config results in something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function / func1&#xA;Function / func2&#xA;Anonymous Funtion / 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after the &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; or &lt;code&gt;ido-imenu&lt;/code&gt; commands are launched.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is why the regular expression for anonymous function did not capture the function name &lt;code&gt;fun3&lt;/code&gt; as expected but &lt;code&gt;3&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2015-07-16T05:40:19.547" Title="Problem in writing regular expression for imenu-generic-expression" Tags="|regular-expressions|imenu|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13947" PostTypeId="2" ParentId="13906" CreationDate="2015-07-13T18:27:54.047" Score="0" Body="&lt;p&gt;Removing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs&#xA;      '(&quot;~/.emacs.d/snippets&quot;                 ;; personal snippets&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fixed the problem.&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-07-13T18:27:54.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13948" PostTypeId="1" AcceptedAnswerId="13949" CreationDate="2015-07-13T19:19:08.937" Score="1" ViewCount="130" Body="&#xA;&#xA;&lt;p&gt;As I'm running out of easy key bindings I'm trying to overload &lt;em&gt;C-SPC&lt;/em&gt; to either call set-mark-command or er/expand-region depending on if I have moved since I set the mark. However the two functions take slight different prefix constructs &quot;P&quot; vs &quot;p&quot;. How can I declare a function that wraps the two functions and passes the right sort of prefix to them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-mark-or-expand-dwim (arg)&#xA;  &quot;Set the mark or if mark already set call expand-region.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if (and mark-active&#xA;           (eq (point) (mark)))&#xA;      (er/expand-region arg)&#xA;    (set-mark-command arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT TO EXPLAIN ANSWER&lt;/strong&gt;: I accepted my own answer as that solved the question as-posed however using &lt;em&gt;call-interactively&lt;/em&gt; is the solution I ended up using in my own &lt;a href=&quot;https://github.com/stsquad/my-emacs-stuff/commit/91970d0e4ced2a5a2f03524d8643690d292ca3e1&quot; rel=&quot;nofollow&quot;&gt;init file&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2015-07-16T14:19:44.080" LastActivityDate="2015-07-16T14:42:01.143" Title="Obtain the raw prefix arg and its numeric value, and pass them to different commands" Tags="|prefix-argument|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13949" PostTypeId="2" ParentId="13948" CreationDate="2015-07-13T19:50:40.567" Score="1" Body="&#xA;&#xA;&lt;p&gt;So (interactive &quot;P&quot;) provides the function with the raw prefix which can be converted into the other types. So in my case I did the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-mark-or-expand-dwim (arg)&#xA;  &quot;Set the mark or if mark already set call expand-region.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if (or (use-region-p)&#xA;          (and mark-active&#xA;               (eq (point) (mark))))&#xA;      (er/expand-region (prefix-numeric-value arg))&#xA;    (set-mark-command arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;(prefix-numeric-value arg)&lt;/code&gt; converts from raw to what an &lt;code&gt;(interactive &quot;p&quot;)&lt;/code&gt; function would get. The addition of the &lt;code&gt;(use-region-p)&lt;/code&gt; clause is a allows me to keep repeating the er/expand-region call.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-07-13T19:50:40.567" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13950" PostTypeId="1" CreationDate="2015-07-13T19:58:02.847" Score="0" ViewCount="47" Body="&lt;p&gt;I am running emacs inside tmux within iterm2 on OSX. For some reason these key bindings do not work properly&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-S-n&#xA;C-=&#xA;C-+&#xA;C-;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And some others too that are similar.&#xA;All of these work when running within X.&#xA;Any ideas why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd hate to revert &lt;code&gt;C-=&lt;/code&gt; to &lt;code&gt;C-c =&lt;/code&gt; in terminal mode.&lt;/p&gt;&#xA;" OwnerUserId="8326" LastActivityDate="2015-07-13T19:58:02.847" Title="C-S-n and C-= not working in emacs if running within terminal" Tags="|key-bindings|terminal-emacs|gui-emacs|" AnswerCount="0" CommentCount="2" ClosedDate="2015-07-14T03:52:08.293" ContentLicense="CC BY-SA 3.0" />
  <row Id="13951" PostTypeId="1" CreationDate="2015-07-13T20:04:15.097" Score="2" ViewCount="792" Body="&lt;p&gt;I use org mode to write notebooks for my research. I often put equation on line of their own, using &lt;code&gt;M-o M-s&lt;/code&gt; to center the equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I have an equation like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|a+b| ≤ |a| + |b|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the leading &lt;code&gt;|&lt;/code&gt; character makes org enter in tabular mode. How can I disable this effect ?&lt;/p&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2015-09-13T14:40:52.033" Title="Disable table mode in org mode" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13952" PostTypeId="2" ParentId="13948" CreationDate="2015-07-13T20:18:41.610" Score="3" Body="&#xA;&#xA;&lt;p&gt;Try the below snippet.. it uses &lt;code&gt;call-interactively&lt;/code&gt;. So the arguments to the wrapper function will be passed on to the inner functions and then the &lt;code&gt;interactive&lt;/code&gt; forms in those functions should do their job.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-mark-or-expand-dwim ()&#xA;  &quot;Set the mark or if mark already set call expand-region.&quot;&#xA;  (interactive)&#xA;  (if (or (use-region-p)&#xA;          (and mark-active&#xA;               (eq (point) (mark))))&#xA;      (call-interactively #'er/expand-region)&#xA;    (call-interactively #'set-mark-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-16T14:42:01.143" LastActivityDate="2015-07-16T14:42:01.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13953" PostTypeId="2" ParentId="13859" CreationDate="2015-07-13T20:24:23.420" Score="1" Body="&lt;p&gt;This is a working concept draft that presently only supports all files/directories being displayed in the directory tree.  To add support for hiding files/directories, the increment calculations would need to be adjusted so that the hash-tables get modified accordingly.  It is possible to obviate the need for hash-tables by examining text-properties on various lines of the buffer, however, this answer contemplates using the former method.  This answer reassigns the keyboard shortcuts for &lt;code&gt;M&lt;/code&gt; and &lt;code&gt;U&lt;/code&gt; -- anyone who is interested in tinkering with this draft can restore the original bindings and choose new bindings for &lt;code&gt;speedbar-mark-all&lt;/code&gt; and &lt;code&gt;speedbar-unmark-all&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inasmuch as this author uses a custom version of speedbar that eliminates &lt;code&gt;dframe&lt;/code&gt; library usage, this is probably about as far as this author will be taking this particular working concept draft.  Anyone who is interested in taking this draft to the next level of functionality is encouraged to do so by creating an alternative answer so everyone else can benefit from those improvements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PART 1 OF 2 -- about 30,000 characters&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'speedbar)&#xA;(require 'dired-aux)&#xA;&#xA;(setq speedbar-directory-unshown-regexp &quot;^$&quot;) ;; show everything&#xA;(setq speedbar-show-unknown-files t)&#xA;&#xA;(setq speedbar-initial-expansion-mode-alist '(&#xA;    (&quot;buffers&quot;&#xA;      speedbar-buffer-easymenu-definition&#xA;      speedbar-buffers-key-map&#xA;      speedbar-buffer-buttons)&#xA;    (&quot;quick buffers&quot;&#xA;      speedbar-buffer-easymenu-definition&#xA;      speedbar-buffers-key-map&#xA;      speedbar-buffer-buttons-temp)&#xA;    (&quot;files&quot;&#xA;    ;; removed `speedbar-directory-buttons' from the files alist; and,&#xA;    ;; incorporated certain portions into `speedbar-default-directory-list'.&#xA;      speedbar-easymenu-definition-special&#xA;      speedbar-file-key-map&#xA;      speedbar-default-directory-list)))&#xA;&#xA;(define-key speedbar-file-key-map &quot;c&quot; 'dired-do-copy)&#xA;(define-key speedbar-file-key-map &quot;C&quot; 'speedbar-item-copy)&#xA;(define-key speedbar-file-key-map &quot;d&quot; 'speedbar-delete-file)&#xA;(define-key speedbar-file-key-map &quot;D&quot; 'speedbar-item-delete)&#xA;(define-key speedbar-file-key-map &quot;m&quot; 'speedbar-mark)&#xA;(define-key speedbar-file-key-map &quot;M&quot; 'speedbar-mark-all)&#xA;;; (define-key speedbar-file-key-map &quot;M&quot; 'speedbar-create-directory)&#xA;(define-key speedbar-file-key-map &quot;p&quot; 'speedbar-path)&#xA;(define-key speedbar-file-key-map &quot;r&quot; 'dired-do-rename)&#xA;(define-key speedbar-file-key-map &quot;R&quot; 'speedbar-item-rename)&#xA;(define-key speedbar-file-key-map &quot;u&quot; 'speedbar-unmark)&#xA;(define-key speedbar-file-key-map &quot;U&quot; 'speedbar-unmark-all)&#xA;;; (define-key speedbar-file-key-map &quot;U&quot; 'speedbar-up-directory)&#xA;(define-key speedbar-file-key-map [up] 'speedbar-previous-line)&#xA;(define-key speedbar-file-key-map [down] 'speedbar-next-line)&#xA;(define-key speedbar-file-key-map [C-up] 'speedbar-up-directory)&#xA;&#xA;(defvar speedbar-line-to-node-table nil&#xA;  &quot;Hash table used to find absolute filename based on line number.&quot;)&#xA;&#xA;(defvar speedbar-node-to-line-table nil&#xA;  &quot;Hash table used to find line number based on absolute filename.&quot;)&#xA;&#xA;(defvar speedbar-node-regexp&#xA;  &quot;^\\([0-9]+:\\s-*[[&amp;lt;{][+-\?][]&amp;gt;}]\s\\)\\(.*\\)$&quot;&#xA;  &quot;A regexp where the second group is the filename or directory.&quot;)&#xA;&#xA;(defun speedbar-node-of-line (line)&#xA;&quot;Find absolute filename based on line number.&quot;&#xA;  (gethash line speedbar-line-to-node-table))&#xA;&#xA;(defun speedbar-line-of-node (node)&#xA;&quot;Find line number based on absolute filename.&quot;&#xA;  (gethash node speedbar-node-to-line-table))&#xA;&#xA;(defface speedbar-marked-face&#xA;  '((t (:background &quot;purple&quot; :foreground &quot;green&quot;)))&#xA;&quot;Face for `speedbar-marked-face'.&quot;&#xA;  :group 'speedbar)&#xA;&#xA;(defun speedbar-cursor-align ()&#xA;  (unless (= (point-at-bol) (point-min))&#xA;    (goto-char (point-at-bol))&#xA;    (re-search-forward&#xA;      &quot;^\\([0-9]+\\):\\s-*[[&amp;lt;{][+-\?][]&amp;gt;}]\s\\|^[0-9:\s&amp;gt;]+&quot;&#xA;      (point-at-eol) t)))&#xA;&#xA;(defun speedbar-next-line ()&#xA;(interactive &quot;^&quot;)&#xA;  (let ((inhibit-point-motion-hooks t))&#xA;    (next-line 1)&#xA;    (speedbar-cursor-align)))&#xA;&#xA;(defun speedbar-previous-line ()&#xA;(interactive &quot;^&quot;)&#xA;  (let ((inhibit-point-motion-hooks t))&#xA;    (unless (= (line-number-at-pos) 1)&#xA;      (previous-line 1)&#xA;      (speedbar-cursor-align))))&#xA;&#xA;(defun speedbar-path ()&#xA;(interactive)&#xA;  (let ((path (speedbar-node-of-line (line-number-at-pos))))&#xA;    (when path&#xA;      (kill-new path)&#xA;      (message &quot;%s&quot; path))))&#xA;&#xA;(defun speedbar-mark (&amp;amp;optional absolute-filename)&#xA;(interactive)&#xA;  (if&#xA;      (and&#xA;        (region-active-p)&#xA;        (null absolute-filename))&#xA;    (speedbar-mark-all)&#xA;    (let* (&#xA;        beg&#xA;        end&#xA;        (current-node (speedbar-node-of-line (line-number-at-pos)))&#xA;        (line-of-absolute-filename&#xA;          (when absolute-filename&#xA;            (speedbar-line-of-node absolute-filename))) )&#xA;      (unless (equal current-node default-directory)&#xA;        (save-excursion&#xA;          (when&#xA;              (and&#xA;                absolute-filename&#xA;                line-of-absolute-filename&#xA;                (not (equal current-node absolute-filename)))&#xA;            (goto-line line-of-absolute-filename))&#xA;          (unless (eq (point) (point-at-eol))&#xA;            (goto-char (point-at-eol)))&#xA;          (when (looking-back speedbar-node-regexp)&#xA;            (setq beg (match-beginning 2))&#xA;            (setq end (point-at-eol))&#xA;            (unless (memq 'speedbar-marked-face&#xA;                 (mapcar (function (lambda (ovr)&#xA;                  (overlay-get ovr 'face))) (overlays-in beg end)))&#xA;              (overlay-put (make-overlay beg end)&#xA;                'face 'speedbar-marked-face))))))))&#xA;&#xA;(defun speedbar-unmark ()&#xA;(interactive)&#xA;  (let* (&#xA;      (beg (point-at-bol))&#xA;      (end (point-at-eol))&#xA;      (current-node (speedbar-node-of-line (line-number-at-pos))) )&#xA;    (unless (equal current-node default-directory)&#xA;      (save-excursion&#xA;        (unless (eq (point) end)&#xA;          (goto-char end))&#xA;        (re-search-backward speedbar-node-regexp beg t)&#xA;        (setq beg (point)))&#xA;      (remove-overlays beg end 'face 'speedbar-marked-face))))&#xA;&#xA;(defun speedbar-mark-all ()&#xA;(interactive)&#xA;  (let* (&#xA;      (opoint (point))&#xA;      (current-node (speedbar-node-of-line (line-number-at-pos)))&#xA;      (speedbar-active-region (region-active-p))&#xA;      (region-beg (when speedbar-active-region (region-beginning)))&#xA;      (region-end (when speedbar-active-region (region-end))) )&#xA;    (save-excursion&#xA;      (catch 'done&#xA;          (if speedbar-active-region&#xA;            (goto-char region-end)&#xA;            (goto-char (point-max)))&#xA;        (while t&#xA;          (setq current-node (speedbar-node-of-line (line-number-at-pos)))&#xA;          (speedbar-mark current-node)&#xA;          (re-search-backward &quot;\n&quot; nil t)&#xA;          (when&#xA;              (or&#xA;                (and speedbar-active-region (&amp;lt;= (point) region-beg))&#xA;                (equal current-node default-directory))&#xA;            (throw 'done nil))))))&#xA;    (setq mark-active nil))&#xA;&#xA;(defun speedbar-unmark-all ()&#xA;(interactive)&#xA;  (remove-overlays nil nil))&#xA;&#xA;(defun speedbar-get-marked-files ()&#xA;  (let* (&#xA;      beg&#xA;      end&#xA;      current-node&#xA;      marked-list&#xA;      (point-min (point-min)) )&#xA;    (save-excursion&#xA;      (goto-char (point-max))&#xA;      (catch 'done&#xA;        (while t&#xA;          (setq end (point-at-eol))&#xA;          (setq current-node (speedbar-node-of-line (line-number-at-pos)))&#xA;          (unless (eq (point) end)&#xA;            (goto-char end))&#xA;          (when (looking-back speedbar-node-regexp)&#xA;            (setq beg (match-beginning 2))&#xA;            (when&#xA;              (memq 'speedbar-marked-face&#xA;                (mapcar (function (lambda (ovr)&#xA;                  (overlay-get ovr 'face))) (overlays-in beg end)))&#xA;              (push current-node marked-list)))&#xA;          (when (equal current-node default-directory)&#xA;            (throw 'done nil))&#xA;          (re-search-backward &quot;\n&quot; point-min t))))&#xA;      (when&#xA;          (and&#xA;            (not (eq this-command 'speedbar-refresh))&#xA;            (null marked-list))&#xA;        (push (speedbar-node-of-line (line-number-at-pos)) marked-list)&#xA;        (delete-dups (delq nil marked-list)))&#xA;    marked-list))&#xA;&#xA;(defun speedbar-delete-file (&amp;amp;optional file recursive trash)&#xA;(interactive)&#xA;  (let* (&#xA;      (trashing t)&#xA;      (trash (if trash trash t))&#xA;      (recursive (if recursive recursive 'always))&#xA;      (files (if file file (speedbar-get-marked-files)))&#xA;      (arg (length files)) )&#xA;    (when&#xA;        (dired-mark-pop-up ;; returns t if yes or nil if no.&#xA;           &quot; *Deletions*&quot; 'delete files dired-deletion-confirmer&#xA;           (format &quot;%s %s &quot;&#xA;             (if trashing &quot;Trash&quot; &quot;Delete&quot;)&#xA;             (dired-mark-prompt arg files)))&#xA;      (if (listp files)&#xA;        (mapcar&#xA;          (lambda (x)&#xA;            (dired-delete-file x recursive trash))&#xA;          files)&#xA;        (dired-delete-file files recursive trash))&#xA;      (speedbar-refresh) )))&#xA;&#xA;(defun speedbar-insert-generic-list (level lst expand-fun find-fun)&#xA;  &quot;At LEVEL, insert a generic multi-level alist LST.&#xA;Associations with lists get {+} tags (to expand into more nodes) and&#xA;those with positions just get a &amp;gt; as the indicator.  {+} buttons will&#xA;have the function EXPAND-FUN and the token is the cdr list.  The token&#xA;name will have the function FIND-FUN and not token.&quot;&#xA;  ;; Remove imenu rescan button&#xA;  (when (string= (car (car lst)) &quot;*Rescan*&quot;)&#xA;      (setq lst (cdr lst)))&#xA;  ;; Get, and set up variables that define how we treat these tags.&#xA;  (let* (&#xA;      expand-button&#xA;      tag-button&#xA;      (f&#xA;        (save-excursion&#xA;          (forward-line -1)&#xA;          (or&#xA;            (speedbar-line-file)&#xA;            (speedbar-line-directory)))) )&#xA;    (save-excursion&#xA;      (when (get-file-buffer f)&#xA;        (set-buffer (get-file-buffer f)))&#xA;      (setq expand-button speedbar-generic-list-group-expand-button-type&#xA;        tag-button speedbar-generic-list-tag-button-type))&#xA;     ;; Adjust the list.&#xA;    (setq lst (speedbar-create-tag-hierarchy lst))&#xA;    (let* (&#xA;        (current-line (1- (line-number-at-pos)))&#xA;        (increment (length lst))&#xA;        (copied-line-to-node-table&#xA;        (copy-hash-table speedbar-line-to-node-table))&#xA;        (copied-node-to-line-table&#xA;          (copy-hash-table speedbar-node-to-line-table)) )&#xA;      (maphash&#xA;        (lambda (line filename)&#xA;          (when (&amp;gt; line current-line)&#xA;            (puthash (+ line increment) filename speedbar-line-to-node-table)))&#xA;        copied-line-to-node-table)&#xA;      (maphash&#xA;        (lambda (filename line)&#xA;          (when (&amp;gt; line current-line)&#xA;            (puthash filename (+ line increment) speedbar-node-to-line-table)))&#xA;        copied-node-to-line-table))&#xA;      ;; insert the parts&#xA;      (while lst&#xA;        (cond ((null (car-safe lst)) nil)  ;this would be a separator&#xA;       ((speedbar-generic-list-tag-p (car lst))&#xA;        (speedbar-make-tag-line tag-button&#xA;              nil nil nil ;no expand button data&#xA;              (car (car lst)) ;button name&#xA;              find-fun ;function&#xA;              (cdr (car lst)) ;token is position&#xA;              'speedbar-tag-face&#xA;              (1+ level)))&#xA;       ((speedbar-generic-list-positioned-group-p (car lst))&#xA;        (speedbar-make-tag-line expand-button&#xA;              ?+ expand-fun (cdr (cdr (car lst)))&#xA;              (car (car lst)) ;button name&#xA;              find-fun ;function&#xA;              (car (cdr (car lst))) ;token is posn&#xA;              'speedbar-tag-face&#xA;              (1+ level)))&#xA;       ((speedbar-generic-list-group-p (car lst))&#xA;        (speedbar-make-tag-line expand-button&#xA;              ?+ expand-fun (cdr (car lst))&#xA;              (car (car lst)) ;button name&#xA;              nil nil 'speedbar-tag-face&#xA;              (1+ level)))&#xA;       (t (message &quot;speedbar-insert-generic-list: malformed list!&quot;)))&#xA;       (setq lst (cdr lst)))))&#xA;&#xA;(defun speedbar-delete-subblock (indent)&#xA;  &quot;Delete text from point to indentation level INDENT or greater.&#xA;Handles end-of-sublist smartly.&quot;&#xA;  (speedbar-with-writable&#xA;    (let* (&#xA;        start&#xA;        end-line&#xA;        increment&#xA;        copied-line-to-node-table&#xA;        copied-node-to-line-table&#xA;        (beg-line (line-number-at-pos)))&#xA;      (save-excursion&#xA;        (end-of-line)&#xA;        (forward-char 1)&#xA;        (setq start (point))&#xA;        (while&#xA;            (and&#xA;              (looking-at &quot;^\\([0-9]+\\):&quot;)&#xA;              (&amp;gt; (string-to-number (match-string 1)) indent)&#xA;              (not (eobp)))&#xA;          (setq end-line (line-number-at-pos))&#xA;          (remhash end-line speedbar-line-to-node-table)&#xA;          (remhash (speedbar-node-of-line end-line) speedbar-node-to-line-table)&#xA;          (forward-line 1)&#xA;          (unless (eobp)&#xA;            (beginning-of-line)))&#xA;        (setq increment (- end-line beg-line))&#xA;        (setq copied-line-to-node-table&#xA;          (copy-hash-table speedbar-line-to-node-table))&#xA;        (setq copied-node-to-line-table&#xA;          (copy-hash-table speedbar-node-to-line-table))&#xA;        (delete-region start (point))&#xA;        (maphash&#xA;          (lambda (line filename)&#xA;            (when (&amp;gt; line beg-line)&#xA;              (puthash (- line increment) filename speedbar-line-to-node-table)&#xA;              (remhash line speedbar-line-to-node-table)))&#xA;          copied-line-to-node-table)&#xA;        (maphash&#xA;          (lambda (filename line)&#xA;            (when (&amp;gt; line beg-line)&#xA;              (puthash filename (- line increment) speedbar-node-to-line-table)&#xA;              (remhash filename speedbar-node-to-line-table)))&#xA;          copied-node-to-line-table)))))&#xA;&#xA;(defun speedbar-default-directory-list (directory index)&#xA;&quot;Insert files for DIRECTORY with level INDEX at point.&#xA;This function is used by `speedbar-update-directory-contents' and `speedbar-dired'.&quot;&#xA;  ;; previously a separate function -- `speedbar-insert-files-at-point'.&#xA;  (let* (&#xA;      (files (speedbar-file-lists directory))&#xA;      (dirs (car files))&#xA;      (lst (car (cdr files))) )&#xA;    (cond&#xA;      ((= (buffer-size) 0)&#xA;        (setq default-directory directory)&#xA;        (setq speedbar-line-to-node-table (make-hash-table))&#xA;        (setq speedbar-node-to-line-table (make-hash-table :test 'equal))&#xA;        (puthash 1 directory speedbar-line-to-node-table)&#xA;        (puthash directory 1 speedbar-node-to-line-table)&#xA;        (let (&#xA;            path&#xA;            (displayme (expand-file-name directory))&#xA;            (p (point)) )&#xA;          (insert displayme &quot;\n&quot;)&#xA;          (save-excursion&#xA;            (goto-char p)&#xA;            (speedbar-make-button p (1+ p)&#xA;              'speedbar-directory-face&#xA;              'speedbar-highlight-face&#xA;              'speedbar-directory-buttons-follow &quot;/&quot;)&#xA;            (put-text-property p (1+ p) 'help-echo &quot;\&quot;/\&quot;&quot;)&#xA;            (while (re-search-forward &quot;\\([^/\\]+\\)[/\\]&quot; nil t)&#xA;              (setq path&#xA;                (if&#xA;                    (and&#xA;                      (= (match-beginning 1) p)&#xA;                      (not (char-equal (char-after (+ p 1)) ?:)))&#xA;                  (expand-file-name &quot;~/&quot;)  ;the tilde&#xA;                  (buffer-substring-no-properties p (match-end 0))))&#xA;              (speedbar-make-button (match-beginning 1) (match-end 1)&#xA;                 'speedbar-directory-face&#xA;                 'speedbar-highlight-face&#xA;                 'speedbar-directory-buttons-follow path)&#xA;              (put-text-property (match-beginning 1) (match-end 1)&#xA;                'help-echo path)))))&#xA;      (t&#xA;        (let* (&#xA;            (current-line (1- (line-number-at-pos)))&#xA;            (increment (+ (length dirs) (length lst)))&#xA;            (copied-line-to-node-table&#xA;              (copy-hash-table speedbar-line-to-node-table))&#xA;            (copied-node-to-line-table&#xA;              (copy-hash-table speedbar-node-to-line-table)) )&#xA;          (maphash&#xA;            (lambda (line filename)&#xA;              (when (&amp;gt; line current-line)&#xA;                (puthash (+ line increment) filename speedbar-line-to-node-table)))&#xA;            copied-line-to-node-table)&#xA;          (maphash&#xA;            (lambda (filename line)&#xA;              (when (&amp;gt; line current-line)&#xA;                (puthash filename (+ line increment) speedbar-node-to-line-table)))&#xA;            copied-node-to-line-table))))&#xA;    (while dirs&#xA;      (puthash (line-number-at-pos (point))&#xA;        (expand-file-name (car dirs)) speedbar-line-to-node-table)&#xA;      (puthash (expand-file-name (car dirs)) (line-number-at-pos (point))&#xA;        speedbar-node-to-line-table)&#xA;      (speedbar-make-tag-line 'angle ?+ 'speedbar-dired (car dirs)&#xA;        (car dirs) 'speedbar-dir-follow nil 'speedbar-directory-face index)&#xA;      (setq dirs (cdr dirs)))&#xA;    (let ((case-fold-search t))&#xA;      (while lst&#xA;        (let* (&#xA;            (known (string-match speedbar-file-regexp (car lst)))&#xA;            (expchar (if known ?+ ??))&#xA;            (fn (if known 'speedbar-tag-file nil)) )&#xA;          (when (or speedbar-show-unknown-files (/= expchar ??))&#xA;            (puthash (line-number-at-pos (point))&#xA;              (expand-file-name (car lst)) speedbar-line-to-node-table)&#xA;            (puthash (expand-file-name (car lst))&#xA;              (line-number-at-pos (point)) speedbar-node-to-line-table)&#xA;            (speedbar-make-tag-line 'bracket expchar fn (car lst)&#xA;              (car lst) 'speedbar-find-file nil 'speedbar-file-face index)))&#xA;        (setq lst (cdr lst)))))&#xA;  (speedbar-reset-scanners)&#xA;  (if (= index 0)&#xA;      (let ((sf (cdr (reverse speedbar-shown-directories))))&#xA;  (setq speedbar-shown-directories&#xA;        (list (expand-file-name default-directory)))&#xA;  ;; Expand them all as we find them.&#xA;  (while sf&#xA;    (if (speedbar-goto-this-file (car sf))&#xA;        (progn&#xA;    (beginning-of-line)&#xA;    (if (looking-at &quot;[0-9]+:[ ]*&amp;lt;&quot;)&#xA;        (progn&#xA;          (goto-char (match-end 0))&#xA;          (speedbar-do-function-pointer)))))&#xA;    (setq sf (cdr sf))))))&#xA;&#xA;(defun speedbar-update-directory-contents ()&#xA;  &quot;Update the contents of the speedbar buffer based on the current directory.&quot;&#xA;    (let* (&#xA;        (cbd (expand-file-name default-directory))&#xA;        cbd-parent&#xA;        (funclst (speedbar-initial-expansion-list))&#xA;        (cache speedbar-full-text-cache)&#xA;        ;; disable stealth during update&#xA;        ;; (speedbar-stealthy-function-list nil)&#xA;        (use-cache nil)&#xA;        (expand-local nil)&#xA;        ;; Because there is a bug I can't find just yet&#xA;        (inhibit-quit nil) )&#xA;      (set-buffer speedbar-buffer)&#xA;      ;; If we are updating contents to where we are, then this is&#xA;      ;; really a request to update existing contents, so we must be&#xA;      ;; careful with our text cache!&#xA;      (if (member cbd speedbar-shown-directories)&#xA;    (progn&#xA;      (setq cache nil)&#xA;      ;; If the current directory is not the last element in the dir&#xA;      ;; list, then we ALSO need to zap the list of expanded directories&#xA;      (if (/= (length (member cbd speedbar-shown-directories)) 1)&#xA;    (setq speedbar-shown-directories (list cbd))))&#xA;  ;; Build cbd-parent, and see if THAT is in the current shown&#xA;  ;; directories.  First, go through pains to get the parent directory&#xA;  (if (and speedbar-smart-directory-expand-flag&#xA;     (save-match-data&#xA;       (setq cbd-parent cbd)&#xA;       (if (string-match &quot;[/\\]$&quot; cbd-parent)&#xA;           (setq cbd-parent (substring cbd-parent 0&#xA;               (match-beginning 0))))&#xA;       (setq cbd-parent (file-name-directory cbd-parent)))&#xA;     (member cbd-parent speedbar-shown-directories))&#xA;      (setq expand-local t)&#xA;    ;; If this directory is NOT in the current list of available&#xA;    ;; directories, then use the cache, and set the cache to our new&#xA;    ;; value.  Make sure to unhighlight the current file, or if we&#xA;    ;; come back to this directory, it might be a different file&#xA;    ;; and then we get a mess!&#xA;    (if (&amp;gt; (point-max) 1)&#xA;        (progn&#xA;    (speedbar-clear-current-file)&#xA;    (setq speedbar-full-text-cache (cons speedbar-shown-directories (buffer-string)))))&#xA;    ;; Check if our new directory is in the list of directories&#xA;    ;; shown in the text-cache&#xA;    (if (member cbd (car cache))&#xA;        (setq speedbar-shown-directories (car cache)&#xA;        use-cache t)&#xA;      ;; default the shown directories to this list...&#xA;      (setq speedbar-shown-directories (list cbd)))))&#xA;      (if (not expand-local) (setq speedbar-last-selected-file nil))&#xA;      (speedbar-with-writable&#xA;        (if (and expand-local&#xA;           ;; Find this directory as a speedbar node.&#xA;           (speedbar-directory-line cbd))&#xA;            ;; Open it.&#xA;            (speedbar-expand-line)&#xA;          (let* ((window (get-buffer-window speedbar-buffer 0))&#xA;           (p (window-point window))&#xA;           (start (window-start window)))&#xA;            (erase-buffer)&#xA;            (remove-overlays)&#xA;            (cond&#xA;              (use-cache&#xA;                (setq default-directory&#xA;                   (nth (1- (length speedbar-shown-directories))&#xA;                     speedbar-shown-directories))&#xA;                (insert (cdr cache)))&#xA;              (t&#xA;                 (dolist (func funclst)&#xA;                   ;; func = `speedbar-default-directory-list' ******&#xA;                   (funcall func cbd 0))))&#xA;            (goto-char (point-min))&#xA;            (set-window-point window p)&#xA;            (set-window-start window start)&#xA;            (speedbar-reconfigure-keymaps)&#xA;            (when (not speedbar-stealthy-update-recurse)&#xA;              (let* (&#xA;                  (l (speedbar-initial-stealthy-functions))&#xA;                  (speedbar-stealthy-update-recurse t))&#xA;                (unwind-protect&#xA;                  (while (and l (funcall (car l)))&#xA;                    (setq l (cdr l))) ))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-17T03:49:48.347" LastActivityDate="2016-11-17T03:49:48.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13954" PostTypeId="2" ParentId="13859" CreationDate="2015-07-13T20:27:13.567" Score="0" Body="&lt;p&gt;&lt;strong&gt;PART 2 OF 2 -- a continuation of part 1 of 2 due to character limits&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; modification of function from built-in library `dired-aux.el`&#xA;(defun dired-do-create-files (op-symbol file-creator operation arg&#xA;  &amp;amp;optional marker-char op1 how-to)&#xA;  (or op1 (setq op1 operation))&#xA;  (let* (&#xA;      skip-overwrite-confirmation&#xA;      (max-mini-window-height 0.25)&#xA;      (fn-list&#xA;        (cond&#xA;          ((eq major-mode 'dired-mode)&#xA;            (dired-get-marked-files nil arg))&#xA;          ((eq major-mode 'speedbar-mode)&#xA;            (speedbar-get-marked-files))) )&#xA;      (rfn-list (mapcar (function dired-make-relative) fn-list))&#xA;      (dired-one-file  ; fluid variable inside dired-create-files&#xA;        (and (consp fn-list) (null (cdr fn-list)) (car fn-list)))&#xA;      (target-dir&#xA;        (cond&#xA;          (dired-one-file&#xA;            (cond&#xA;              ((eq major-mode 'dired-mode)&#xA;                (dired-get-file-for-visit))&#xA;              ((eq major-mode 'speedbar-mode)&#xA;                (speedbar-node-of-line (line-number-at-pos)))))&#xA;          (t  ;; directory of multiple files&#xA;            (cond&#xA;              ((eq major-mode 'dired-mode)&#xA;                (dired-dwim-target-directory))&#xA;              ((eq major-mode 'speedbar-mode)&#xA;                (let ((tentative-target (car fn-list)))&#xA;                  (cond&#xA;                    ((file-directory-p tentative-target)&#xA;                      tentative-target)&#xA;                    ((not (file-directory-p tentative-target))&#xA;                      (directory-file-name&#xA;                        (file-name-directory tentative-target))))))))))&#xA;      (default (and dired-one-file&#xA;              (expand-file-name (file-name-nondirectory (car fn-list))&#xA;              target-dir)) )&#xA;      (defaults (dired-dwim-target-defaults fn-list target-dir))&#xA;      (target (expand-file-name ; fluid variable inside dired-create-files&#xA;        (minibuffer-with-setup-hook (lambda ()&#xA;          (set (make-local-variable 'minibuffer-default-add-function) nil)&#xA;          (setq minibuffer-default defaults))&#xA;          (dired-mark-read-file-name&#xA;             (concat (if dired-one-file op1 operation) &quot; %s to:  &quot;)&#xA;             target-dir op-symbol arg rfn-list default))))&#xA;      (unmodified-initial-target target)&#xA;      (into-dir (cond ((null how-to)&#xA;        (if (and (memq system-type '(ms-dos windows-nt cygwin))&#xA;           (eq op-symbol 'move)&#xA;           dired-one-file&#xA;           (string= (downcase&#xA;               (expand-file-name (car fn-list)))&#xA;              (downcase&#xA;               (expand-file-name target)))&#xA;           (not (string=&#xA;           (file-name-nondirectory (car fn-list))&#xA;           (file-name-nondirectory target))))&#xA;            nil&#xA;          (file-directory-p target)))&#xA;       ((eq how-to t) nil)&#xA;       (t (funcall how-to target)))) )&#xA;    (if (and (consp into-dir) (functionp (car into-dir)))&#xA;        (apply (car into-dir) operation rfn-list fn-list target (cdr into-dir))&#xA;      (or into-dir (setq target (directory-file-name target)))&#xA;      ;; create new directories if they do not exist.&#xA;      (when&#xA;          (and&#xA;            (not (file-directory-p (file-name-directory target)))&#xA;            (file-exists-p (directory-file-name (file-name-directory target))))&#xA;        (let ((debug-on-quit nil))&#xA;          (signal 'quit `(&#xA;            &quot;A file with the same name as the proposed directory already exists.&quot;))))&#xA;      (when&#xA;          (and&#xA;            (not (file-exists-p (directory-file-name (expand-file-name target))))&#xA;            (or&#xA;              (and&#xA;                (null dired-one-file)&#xA;                (not (string-match &quot;\\(.*\\)\\(/$\\)&quot; unmodified-initial-target)))&#xA;              (not (file-directory-p (file-name-directory target)))&#xA;              (string-match &quot;\\(.*\\)\\(/$\\)&quot; unmodified-initial-target)) )&#xA;        (let* (&#xA;            new&#xA;            list-of-directories&#xA;            list-of-shortened-directories&#xA;            string-of-directories-a&#xA;            string-of-directories-b&#xA;            (max-mini-window-height 3)&#xA;            (expanded (directory-file-name (expand-file-name target)))&#xA;            (try expanded) )&#xA;          ;; Find the topmost nonexistent parent dir (variable `new')&#xA;          (while (and try (not (file-exists-p try)) (not (equal new try)))&#xA;            (push try list-of-directories)&#xA;            (setq new try&#xA;            try (directory-file-name (file-name-directory try))))&#xA;          (setq list-of-shortened-directories&#xA;              (mapcar&#xA;                (lambda (x) (concat &quot;...&quot; (car (cdr (split-string x try)))))&#xA;                list-of-directories))&#xA;          (setq string-of-directories-a&#xA;            (combine-and-quote-strings list-of-shortened-directories))&#xA;          (setq string-of-directories-b (combine-and-quote-strings&#xA;            (delete (car (last list-of-shortened-directories))&#xA;              list-of-shortened-directories)))&#xA;          (if&#xA;              (and&#xA;                ;; not trailing forward slash&#xA;                (not (string-match &quot;\\(.*\\)\\(/$\\)&quot; unmodified-initial-target))&#xA;                ;; just one file&#xA;                dired-one-file&#xA;                ;; that one file exists&#xA;                (file-exists-p dired-one-file)&#xA;                ;; that one file is not a directory&#xA;                (not (file-directory-p dired-one-file)))&#xA;            (if (y-or-n-p&#xA;                  (format &quot;Is `%s` a directory?&quot; (car (last list-of-directories))))&#xA;              (progn&#xA;                (or (y-or-n-p (format &quot;@ `%s`, create:  %s&quot; try string-of-directories-a))&#xA;                    (let ((debug-on-quit nil))&#xA;                      (signal 'quit `(&quot;You have exited the function.&quot;))))&#xA;                (make-directory expanded t)&#xA;                (setq into-dir t))&#xA;              (if (equal (file-name-directory target)&#xA;                (file-name-directory dired-one-file))&#xA;                (setq new nil)&#xA;                (or (y-or-n-p&#xA;                      (format &quot;@ `%s`, create:  %s&quot; try string-of-directories-b))&#xA;                    (let ((debug-on-quit nil))&#xA;                      (signal 'quit `(&quot;You have exited the function.&quot;))))&#xA;                (make-directory (car (split-string&#xA;                  (car (last list-of-directories))&#xA;                  (concat &quot;/&quot; (file-name-nondirectory target)))) t)&#xA;                (setq target (file-name-directory target))&#xA;                (setq into-dir t) ))&#xA;            (or (y-or-n-p (format &quot;@ `%s`, create:  %s&quot; try string-of-directories-a))&#xA;                (let ((debug-on-quit nil))&#xA;                  (signal 'quit `(&quot;You have exited the function.&quot;))))&#xA;            (make-directory expanded t)&#xA;            ;; e.g., copying several marked directories to a new directory&#xA;            (setq into-dir t))&#xA;          (when new&#xA;            (dired-add-file new)&#xA;            (dired-move-to-filename))&#xA;          (setq skip-overwrite-confirmation t) ))&#xA;      (dired-create-files file-creator operation fn-list&#xA;        (if into-dir      ; target is a directory&#xA;          (function (lambda (from)&#xA;            (expand-file-name (file-name-nondirectory from) target)))&#xA;          (function (lambda (_from) target)))&#xA;       marker-char skip-overwrite-confirmation ))))&#xA;&#xA;;; modification of function from built-in library `dired-aux.el`&#xA;(defun dired-create-files (file-creator operation fn-list name-constructor&#xA;          &amp;amp;optional marker-char skip-overwrite-confirmation)&#xA;  (let (dired-create-files-failures failures&#xA;  skipped (success-count 0) (total (length fn-list)))&#xA;    (let (to overwrite-query overwrite-backup-query)&#xA;      (dolist (from fn-list)&#xA;        (setq to (funcall name-constructor from))&#xA;        (if (equal to from)&#xA;            (progn&#xA;              (setq to nil)&#xA;              (dired-log &quot;Cannot %s to same file: %s\n&quot;&#xA;                         (downcase operation) from)))&#xA;        (if (not to)&#xA;            (setq skipped (cons (dired-make-relative from) skipped))&#xA;          (let* ((overwrite (file-exists-p to))&#xA;                 (dired-overwrite-confirmed ; for dired-handle-overwrite&#xA;                  (and overwrite (not skip-overwrite-confirmation)&#xA;                       (let ((help-form '(format &quot;\&#xA;Type SPC or `y' to overwrite file `%s',&#xA;DEL or `n' to skip to next,&#xA;ESC or `q' to not overwrite any of the remaining files,&#xA;`!' to overwrite all remaining files with no more questions.&quot; to)))&#xA;                         (dired-query 'overwrite-query&#xA;                                      &quot;Overwrite `%s'?&quot; to))))&#xA;                 ;; must determine if FROM is marked before file-creator&#xA;                 ;; gets a chance to delete it (in case of a move).&#xA;                 (actual-marker-char&#xA;                  (cond  ((integerp marker-char) marker-char)&#xA;                         (marker-char (dired-file-marker from)) ; slow&#xA;                         (t nil))))&#xA;            (let ((destname (file-name-directory to)))&#xA;              (when (and (file-directory-p from)&#xA;                         (file-directory-p to)&#xA;                         (eq file-creator 'dired-copy-file))&#xA;                (setq to destname))&#xA;        ;; If DESTNAME is a subdirectory of FROM, not a symlink,&#xA;        ;; and the method in use is copying, signal an error.&#xA;        (and (eq t (car (file-attributes destname)))&#xA;       (eq file-creator 'dired-copy-file)&#xA;       (file-in-directory-p destname from)&#xA;       (error &quot;Cannot copy `%s' into its subdirectory `%s'&quot;&#xA;        from to)))&#xA;            (condition-case err&#xA;                (progn&#xA;                  (funcall file-creator from to dired-overwrite-confirmed)&#xA;                  (if overwrite&#xA;                      ;; If we get here, file-creator hasn't been aborted&#xA;                      ;; and the old entry (if any) has to be deleted&#xA;                      ;; before adding the new entry.&#xA;                      (dired-remove-file to))&#xA;                  (setq success-count (1+ success-count))&#xA;                  (message &quot;%s: %d of %d&quot; operation success-count total)&#xA;                  (dired-add-file to actual-marker-char))&#xA;              (file-error    ; FILE-CREATOR aborted&#xA;               (progn&#xA;                 (push (dired-make-relative from)&#xA;                       failures)&#xA;                 (dired-log &quot;%s `%s' to `%s' failed:\n%s\n&quot;&#xA;                            operation from to err))))))))&#xA;    (cond&#xA;     (dired-create-files-failures&#xA;      (setq failures (nconc failures dired-create-files-failures))&#xA;      (dired-log-summary&#xA;       (format &quot;%s failed for %d file%s in %d requests&quot;&#xA;    operation (length failures)&#xA;    (dired-plural-s (length failures))&#xA;    total)&#xA;       failures))&#xA;     (failures&#xA;      (dired-log-summary&#xA;       (format &quot;%s failed for %d of %d file%s&quot;&#xA;    operation (length failures)&#xA;    total (dired-plural-s total))&#xA;       failures))&#xA;     (skipped&#xA;      (dired-log-summary&#xA;       (format &quot;%s: %d of %d file%s skipped&quot;&#xA;    operation (length skipped) total&#xA;    (dired-plural-s total))&#xA;       skipped))&#xA;     (t&#xA;      (message &quot;%s: %s file%s&quot;&#xA;         operation success-count (dired-plural-s success-count)))))&#xA;  (cond&#xA;    ((eq major-mode 'dired-mode)&#xA;      (dired-move-to-filename)&#xA;      (run-hooks 'dired-mode-hook))&#xA;    ((eq major-mode 'speedbar-mode)&#xA;      (speedbar-refresh))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-07-13T20:37:55.043" LastActivityDate="2015-07-13T20:37:55.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13955" PostTypeId="2" ParentId="13951" CreationDate="2015-07-13T20:28:00.527" Score="0" Body="&lt;p&gt;Have you tried setting &lt;code&gt;org-enable-table-editor&lt;/code&gt; to nil (using &lt;code&gt;(setq org-enable-table-editor nil)&lt;/code&gt;)? This should do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code (added to you &lt;code&gt;init.el&lt;/code&gt;) should make the change permanent:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook 'my-org-mode-hook)&#xA;(defun my-org-mode-hook ()&#xA;  (add-hook 'hack-local-variables-hook&#xA;            (lambda () (setq org-enable-table-editor nil)  )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8486" LastActivityDate="2015-07-13T20:28:00.527" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="13957" PostTypeId="2" ParentId="1020" CreationDate="2015-07-13T22:29:30.620" Score="48" Body="&lt;p&gt;In &lt;a href=&quot;https://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal/989#989&quot;&gt;Shift+Up isn&amp;#39;t recognized by Emacs in a terminal&lt;/a&gt; I explain how terminals translate most function keys into escape sequences, because the interface between applications and terminals transmits characters (or rather bytes), not keys. Only a few modifier+character combinations have their own character:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt; plus a letter or one of &lt;code&gt;@[\]^_&lt;/code&gt; turns into bytes 0–31 (ASCII &lt;a href=&quot;https://en.wikipedia.org/wiki/Control_character&quot; rel=&quot;noreferrer&quot;&gt;control characters&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Often &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;?&lt;/kbd&gt; turns into byte 127 and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Space&lt;/kbd&gt; is equivalent to &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;@&lt;/kbd&gt; (byte 0).&lt;/li&gt;&#xA;&lt;li&gt;Some function keys are equivalent to control characters: &lt;kbd&gt;Tab&lt;/kbd&gt; = &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt;, &lt;kbd&gt;Return&lt;/kbd&gt; = &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;M&lt;/kbd&gt;, &lt;kbd&gt;Esc&lt;/kbd&gt; = &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;[&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;And &lt;kbd&gt;Backspace&lt;/kbd&gt; = &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;H&lt;/kbd&gt; or &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;?&lt;/kbd&gt; depending on the configuration. &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;?&lt;/kbd&gt; is more convenient for Emacs, since &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;H&lt;/kbd&gt; is help.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;Meta&lt;/kbd&gt;+&lt;kbd&gt;&lt;em&gt;character&lt;/em&gt;&lt;/kbd&gt; is sent as &lt;kbd&gt;Esc&lt;/kbd&gt; followed by &lt;em&gt;character&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So what about other combinations such as &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;;&lt;/kbd&gt; or &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;&lt;em&gt;letter&lt;/em&gt;&lt;/kbd&gt;? Since there's no corresponding character, the terminal has to either reuse a character or send an escape sequence. Many terminals ignore modifiers when there's no corresponding character, so you end up with &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;;&lt;/kbd&gt; sending &lt;code&gt;;&lt;/code&gt;, &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;&lt;em&gt;letter&lt;/em&gt;&lt;/kbd&gt; equivalent to &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;&lt;em&gt;letter&lt;/em&gt;&lt;/kbd&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Terminal vendors kept doing the simple thing for a long time. There was no standard for escape sequences, which was self-perpetuating — terminal vendors don't implement it, applications don't support it, users don't expect it. Some terminal emulators can be configured to send arbitrary escape sequences, so if yours can, you can configure it and declare the escape sequences to Emacs (more on this later).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lately, the situation is changing, because there have been two proposals to standardize on escape sequences. One is &lt;a href=&quot;http://www.leonerd.org.uk/hacks/fixterms/&quot; rel=&quot;noreferrer&quot;&gt;LeoNerd's libtermkey&lt;/a&gt; with the syntax &lt;code&gt;ESC [ &lt;em&gt;codepoint&lt;/em&gt; ; &lt;em&gt;modifier&lt;/em&gt; u&lt;/code&gt;. Another is &lt;a href=&quot;http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Alt-and-Meta-Keys&quot; rel=&quot;noreferrer&quot;&gt;Thomas Dickey's xterm&lt;/a&gt; with the syntax &lt;code&gt;ESC [ 2 7 ; &lt;em&gt;modifier&lt;/em&gt; ; &lt;em&gt;codepoint&lt;/em&gt; ~&lt;/code&gt;. Current versions of xterm (≥216) can be configured for either syntax by setting the &lt;code&gt;formatOtherKeys&lt;/code&gt; resource; the feature must be activated by setting the &lt;code&gt;modifyOtherKeys&lt;/code&gt; to a nonzero value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your terminal emulator doesn't support these syntaxes but can be configured, pick either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Emacs 24.4, Emacs automatically turns on the &lt;code&gt;modifyOtherKeys&lt;/code&gt; feature when it detects that the terminal is xterm version ≥216. Emacs's detection of escape sequences to encode keys works through the variable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-local_002dfunction_002dkey_002dmap&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;local-function-key-map&lt;/code&gt;&lt;/a&gt;. As of Emacs 24.4, not all escape sequences are supported. You can use the following code in your init file to complete the job.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; xterm with the resource ?.VT100.modifyOtherKeys: 1&#xA;;; GNU Emacs &amp;gt;=24.4 sets xterm in this mode and define&#xA;;; some of the escape sequences but not all of them.&#xA;(defun character-apply-modifiers (c &amp;amp;rest modifiers)&#xA;  &quot;Apply modifiers to the character C.&#xA;MODIFIERS must be a list of symbols amongst (meta control shift).&#xA;Return an event vector.&quot;&#xA;  (if (memq 'control modifiers) (setq c (if (or (and (&amp;lt;= ?@ c) (&amp;lt;= c ?_))&#xA;                                                (and (&amp;lt;= ?a c) (&amp;lt;= c ?z)))&#xA;                                            (logand c ?\x1f)&#xA;                                          (logior (lsh 1 26) c))))&#xA;  (if (memq 'meta modifiers) (setq c (logior (lsh 1 27) c)))&#xA;  (if (memq 'shift modifiers) (setq c (logior (lsh 1 25) c)))&#xA;  (vector c))&#xA;(defun my-eval-after-load-xterm ()&#xA;  (when (and (boundp 'xterm-extra-capabilities) (boundp 'xterm-function-map))&#xA;    (let ((c 32))&#xA;      (while (&amp;lt;= c 126)&#xA;        (mapc (lambda (x)&#xA;                (define-key xterm-function-map (format (car x) c)&#xA;                  (apply 'character-apply-modifiers c (cdr x))))&#xA;              '(;; with ?.VT100.formatOtherKeys: 0&#xA;                (&quot;\e\[27;3;%d~&quot; meta)&#xA;                (&quot;\e\[27;5;%d~&quot; control)&#xA;                (&quot;\e\[27;6;%d~&quot; control shift)&#xA;                (&quot;\e\[27;7;%d~&quot; control meta)&#xA;                (&quot;\e\[27;8;%d~&quot; control meta shift)&#xA;                ;; with ?.VT100.formatOtherKeys: 1&#xA;                (&quot;\e\[%d;3u&quot; meta)&#xA;                (&quot;\e\[%d;5u&quot; control)&#xA;                (&quot;\e\[%d;6u&quot; control shift)&#xA;                (&quot;\e\[%d;7u&quot; control meta)&#xA;                (&quot;\e\[%d;8u&quot; control meta shift)))&#xA;        (setq c (1+ c))))))&#xA;(eval-after-load &quot;xterm&quot; '(my-eval-after-load-xterm))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the &lt;code&gt;TERM&lt;/code&gt; environment variable isn't set to &lt;code&gt;xterm&lt;/code&gt; or a variant such as &lt;code&gt;xterm-256color&lt;/code&gt;, Emacs won't activate those sequences. If Emacs already has support for your value of &lt;code&gt;TERM&lt;/code&gt;, you can add support by defining a function similar to the one above, to be executed after &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Terminal_002dSpecific.html#Terminal_002dSpecific&quot; rel=&quot;noreferrer&quot;&gt;loading the Lisp file whose name is the value of &lt;code&gt;TERM&lt;/code&gt;&lt;/a&gt;. If Emacs has no such support, you can add it by creating a subdirectory called &lt;code&gt;term&lt;/code&gt; somewhere in your &lt;code&gt;load-path&lt;/code&gt;, and creating a Lisp file called &lt;code&gt;term/$TERM.el&lt;/code&gt; where &lt;code&gt;$TERM&lt;/code&gt; is the value of &lt;code&gt;TERM&lt;/code&gt;, defining a function called &lt;code&gt;terminal-init-$TERM&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I write, it seems that few terminal emulators other than xterm have adopted these escape sequences. On OSX, you can configure &lt;a href=&quot;https://iterm2.com/documentation-preferences.html&quot; rel=&quot;noreferrer&quot;&gt;iTerm2&lt;/a&gt; by selecting an escape sequence for each key combination, one by one.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="306" LastEditDate="2019-10-11T16:10:58.960" LastActivityDate="2019-10-11T16:10:58.960" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="13958" PostTypeId="1" AcceptedAnswerId="14446" CreationDate="2015-07-13T22:39:07.350" Score="0" ViewCount="709" Body="&lt;p&gt;Normally, thanks to the power of Evil, I can use the Vim &lt;code&gt;gg&lt;/code&gt; command to go to the beginning of a buffer. When browsing &lt;code&gt;info&lt;/code&gt;, however, typing &lt;code&gt;g&lt;/code&gt; brings up a &quot;Go to node: &quot; prompt. I don't even know what this prompt means. How can I circumvent this and run my &lt;code&gt;gg&lt;/code&gt;? Or is there a better way I am supposed to return to the beginning of an &lt;code&gt;info&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastActivityDate="2015-08-04T03:01:15.170" Title="How do I use the Evil-mode gg command in info?" Tags="|evil|info|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13960" PostTypeId="5" CreationDate="2015-07-14T02:55:53.193" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-14T02:55:53.193" LastActivityDate="2015-07-14T02:55:53.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13961" PostTypeId="4" CreationDate="2015-07-14T02:55:53.193" Score="0" Body="Questions involving saving parts of Emacs' state to disk" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-07-14T09:20:13.793" LastActivityDate="2015-07-14T09:20:13.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13962" PostTypeId="1" AcceptedAnswerId="13974" CreationDate="2015-07-14T05:27:36.117" Score="9" ViewCount="1768" Body="&lt;p&gt;Sometimes the habit is just temporarily inapplicable. For example you set a habit to clean your house once a day, however say you're out for vacation for 2 weeks, obviously you can't clean your house then, resulting in a false break. In some habit-tracking apps there's an option to &quot;skip&quot; certain days in the chain. Is there a way to achieve that in &lt;code&gt;org-habit&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-07-14T12:53:59.277" Title="org-habit: Any way to mark &quot;skip&quot; for this day?" Tags="|org-mode|org-habit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13963" PostTypeId="2" ParentId="13927" CreationDate="2015-07-14T05:37:55.370" Score="-4" Body="&lt;p&gt;You can use Ranger. However you can configure xmonad for use emacs a windows default when you start session&lt;/p&gt;&#xA;" OwnerUserId="8904" LastActivityDate="2015-07-14T05:37:55.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13965" PostTypeId="1" AcceptedAnswerId="18467" CreationDate="2015-07-14T06:21:36.180" Score="3" ViewCount="480" Body="&lt;p&gt;When install &lt;code&gt;auctex&lt;/code&gt; from the Package manager using GNU Archive, I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;forward-sexp: Scan error: &quot;Unbalanced parentheses&quot;, 18984, 38451&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This always happens to me when I install it using the package manager. If I instead install it &lt;a href=&quot;https://emacs.stackexchange.com/a/10048/904&quot;&gt;manually&lt;/a&gt; then everything works. Is there a way to solve the above error ?&lt;/p&gt;&#xA;" OwnerUserId="904" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-11-28T19:34:10.693" Title="Installing Auctex from Package Manager: Scan error" Tags="|package|latex|auctex|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13966" PostTypeId="2" ParentId="13962" CreationDate="2015-07-14T06:35:58.450" Score="5" Body="&lt;p&gt;You might use a sequence of states that includes &quot;SKIP&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, at the top of my .org file I have&lt;br&gt;&#xA;&lt;code&gt;#+TODO:        TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@) SKIP(s@)&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can use &lt;code&gt;C-c C-t s&lt;/code&gt; from within the .org file, or &lt;code&gt;t s&lt;/code&gt; from the agenda view to &quot;skip&quot; the occurrence of the habit, advancing it to the next scheduled date.  Note that the &lt;code&gt;@&lt;/code&gt; sign in the state descriptor allows you to enter a comment for why you skipped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://orgmode.org/guide/Using-TODO-states.html&quot; rel=&quot;noreferrer&quot;&gt;Using TODO states&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/guide/Tracking-TODO-state-changes.html&quot; rel=&quot;noreferrer&quot;&gt;Tracking TODO state changes&lt;/a&gt; in the org mode guide.&lt;/p&gt;&#xA;" OwnerUserId="8273" LastActivityDate="2015-07-14T06:35:58.450" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13967" PostTypeId="1" AcceptedAnswerId="13968" CreationDate="2015-07-14T07:21:44.383" Score="5" ViewCount="780" Body="&lt;p&gt;I know I can press Enter to show the commit diff, but&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;that's too slow for browsing&lt;/li&gt;&#xA;&lt;li&gt;it steals focus from the log window&lt;/li&gt;&#xA;&lt;li&gt;there's a lot of visual change in the frame with the diff window opening and closing&lt;/li&gt;&#xA;&lt;li&gt;It's a lot of keystrokes to move from one commit's diff to the next&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Can I program magit to a gitk kind of style that always shows the commit msg, changed files and diff of the currently selected commit?&lt;/p&gt;&#xA;" OwnerUserId="8906" LastActivityDate="2015-07-16T12:38:43.630" Title="Can I have a window showing the diff or diffstat of the selected commit in the log window?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13968" PostTypeId="2" ParentId="13967" CreationDate="2015-07-14T08:30:50.563" Score="1" Body="&lt;p&gt;Just navigate the log window with &lt;kbd&gt;n&lt;/kbd&gt; and &lt;kbd&gt;p&lt;/kbd&gt;. The diff window will auto-popup and auto-update.  There's currently a bug that prevents scrolling by holding &lt;kbd&gt;n&lt;/kbd&gt;. It's possible to use the previous Magit version to avoid this bug.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-14T08:30:50.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13969" PostTypeId="1" AcceptedAnswerId="14001" CreationDate="2015-07-14T08:41:04.957" Score="0" ViewCount="392" Body="&lt;p&gt;Now auto-complete show list of values, used in other files, not in current, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Om2FO.png&quot; alt=&quot;Wrong autocomplete lines&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PXPyp.png&quot; alt=&quot;js2-mode&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use latest versions of all packages from MELPA, and my &lt;strong&gt;.emacs&lt;/strong&gt; contain this strings for set settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-auto-complete-mode t)&#xA;(add-hook 'python-mode-hook 'jedi:setup)&#xA;(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)&#xA;(setq jedi:complete-on-dot t)&#xA;(setq ac-auto-start 1)&#xA;;; More for tern, js2 and other...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do'not change settings for &lt;strong&gt;auto-complete&lt;/strong&gt; with &lt;strong&gt;sustomize&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to remove unmatched values from auto-completion list?&lt;/p&gt;&#xA;" OwnerUserId="6919" LastActivityDate="2015-07-15T07:21:40.193" Title="How to remove unmatched auto-complete results?" Tags="|auto-complete-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13970" PostTypeId="1" AcceptedAnswerId="13975" CreationDate="2015-07-14T10:13:16.697" Score="24" ViewCount="1727" Body="&lt;p&gt;I have a bit of a slow pinky. As my other fingers get faster and&#xA;faster at typing, my pinky just can't keep up. This frequently leads me to type sentences whose first word starts with two uppercase&#xA;letters. Here's a short example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;THere's nothing in there. DEfinitely not a body.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usually what I do is hit &lt;code&gt;M-b M-c&lt;/code&gt; (assuming I spot it immediately),&#xA;but I'm getting a little tired of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I have Emacs fix this automatically for me?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, I'd like Emacs to detect when I type a word that starts with&#xA;two uppercase letters followed by at least one lowercase letter, and&#xA;fix that automatically.&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="675" LastEditDate="2015-07-14T15:39:03.453" LastActivityDate="2020-04-27T00:11:59.487" Title="Fixing DOuble CApitals as I type" Tags="|text-editing|text|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13971" PostTypeId="1" CreationDate="2015-07-14T10:29:56.177" Score="5" ViewCount="498" Body="&lt;p&gt;I've been using &lt;a href=&quot;https://stackoverflow.com/a/17761144/788700&quot;&gt;https://stackoverflow.com/a/17761144/788700&lt;/a&gt; to get multiple major modes in rst-mode. It has been working in Emacs 24.3. However as emacs develops the same code gradually stops working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's emacs-24.3:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2DFN5.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as I go from rst-mode chunk to py-mode chunk emacs switches the major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs-24.5 it doesn't work automatically anymore, but one can make emacs to switch mode locally by issuing new line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/R8oDT.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(same behaviour in emacs-24.4)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs-25.0.5 it doesn't work at all:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HGuuq.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;only syntax highlighting works, but modes doesn't switch as I go from one chunk to another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's minimal configuration which reproduces the issue:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/.emacs.d/misc/nxhtml/autostart.el&quot;)&#xA;(require 'mumamo)&#xA;(require 'mumamo-fun)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://dl.dropbox.com/u/61989972/misc/.emacs.d-with-nxhtml.zip&quot; rel=&quot;nofollow noreferrer&quot;&gt;.emacs.d.zip&lt;/a&gt; (which contains only nxhtml + defuns from &lt;a href=&quot;https://stackoverflow.com/a/17761144/788700&quot;&gt;https://stackoverflow.com/a/17761144/788700&lt;/a&gt; in &lt;code&gt;mumamo-fun.el&lt;/code&gt;. nxhtml mode site went offline, and author doesn't seem to be present in the Internet)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="719" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-07T16:59:17.157" Title="nxhtml mode support" Tags="|major-mode|emacs24.4|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13972" PostTypeId="2" ParentId="13969" CreationDate="2015-07-14T10:59:45.153" Score="0" Body="&lt;pre&gt;&lt;code&gt;customize-group auto-complete&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Toggling &lt;strong&gt;Ac User Comphist&lt;/strong&gt; to &lt;strong&gt;nil&lt;/strong&gt;, saving and restart EMACS solve my problem.&lt;/p&gt;&#xA;" OwnerUserId="6919" LastActivityDate="2015-07-14T10:59:45.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13973" PostTypeId="2" ParentId="13971" CreationDate="2015-07-14T11:19:24.927" Score="4" Body="&lt;p&gt;I am the author of nXhtml. Unfortunately I do not have time to fix this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone want to try to fix it I would be glad to answer questions and support the effort though.&lt;/p&gt;&#xA;" OwnerUserId="417" LastActivityDate="2015-07-14T11:19:24.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13974" PostTypeId="2" ParentId="13962" CreationDate="2015-07-14T12:35:44.750" Score="10" Body="&lt;p&gt;You can just reschedule the item (with e.g. &lt;code&gt;C-c C-s&lt;/code&gt;) to the day you get home and want to start cleaning again.  The item won't show up again until that new scheduled date and then the consistency chart will then show that the item is not due on the intervening dates (i.e. they are coloured blue):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2B8se.png&quot; alt=&quot;Sample output&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO clean house&#xA;   SCHEDULED: &amp;lt;2015-07-14 Sat .+4d/6d&amp;gt;&#xA;   :LOGBOOK:  &#xA;   - CLOSING NOTE [2015-07-01 Wed 14:29]&#xA;   - CLOSING NOTE [2015-06-30 Tue 14:29]&#xA;   - CLOSING NOTE [2015-06-15 Mon 14:29]&#xA;   - CLOSING NOTE [2015-06-10 Wed 14:29]&#xA;   - CLOSING NOTE [2015-06-02 Tue 14:29]&#xA;   - CLOSING NOTE [2015-05-29 Fri 14:29]&#xA;   :END:      &#xA;   :PROPERTIES:&#xA;   :STYLE:    habit&#xA;   :LAST_REPEAT: [2015-07-01 Wed 14:29]&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-07-14T12:53:59.277" LastActivityDate="2015-07-14T12:53:59.277" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="13975" PostTypeId="2" ParentId="13970" CreationDate="2015-07-14T13:31:58.640" Score="21" Body="&lt;p&gt;Here's a function that will convert DOuble CApitals to Single Capitals.  I'd originally suggested adding it to &lt;code&gt;post-self-insert-hook&lt;/code&gt;, but below is an option for a glorified minor mode so that you only add to that hook when you really want it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dcaps-to-scaps ()&#xA;  &quot;Convert word in DOuble CApitals to Single Capitals.&quot;&#xA;  (interactive)&#xA;  (and (= ?w (char-syntax (char-before)))&#xA;       (save-excursion&#xA;         (let ((end (point)))&#xA;           (and (if (called-interactively-p)&#xA;                    (skip-syntax-backward &quot;w&quot;)&#xA;                  (= -3 (skip-syntax-backward &quot;w&quot;)))&#xA;                (let (case-fold-search)&#xA;                  (looking-at &quot;\\b[[:upper:]]\\{2\\}[[:lower:]]&quot;))&#xA;                (capitalize-region (point) end))))))&#xA;(add-hook 'post-self-insert-hook #'dcaps-to-scaps nil 'local)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the minor mode definition:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode dubcaps-mode&#xA;  &quot;Toggle `dubcaps-mode'.  Converts words in DOuble CApitals to&#xA;Single Capitals as you type.&quot;&#xA;  :init-value nil&#xA;  :lighter (&quot; DC&quot;)&#xA;  (if dubcaps-mode&#xA;      (add-hook 'post-self-insert-hook #'dcaps-to-scaps nil 'local)&#xA;    (remove-hook 'post-self-insert-hook #'dcaps-to-scaps 'local)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For what it's worth, using this version:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;is simple: just turn it on/off manually or in a mode hook;&lt;/li&gt;&#xA;&lt;li&gt;requires no changes to key bindings, so you're not losing any other functionality.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Even when you add it to &lt;code&gt;post-self-insert-hook&lt;/code&gt;, the overhead is almost non-existent, at least according to some simple benchmarking.  On my machine, here's what I get with 10,000 repetitions each of a ludicrously simple form and the &lt;code&gt;dcaps-to-scaps&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark-run-compiled 10000 (+ 1 1))          ; =&amp;gt; .001 to .003 -ish&#xA;(benchmark-run-compiled 10000 (dcaps-to-scaps)) ; =&amp;gt; .003 to .006 -ish&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, yes, it's slower than adding 1 + 1, but in absolute terms you'll never notice.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="15749" LastEditDate="2020-04-27T00:11:59.487" LastActivityDate="2020-04-27T00:11:59.487" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="13976" PostTypeId="2" ParentId="13970" CreationDate="2015-07-14T14:30:19.993" Score="8" Body="&#xA;&#xA;&lt;p&gt;My preference is to simply create a new function that does what the usual &lt;code&gt;self-insert-command&lt;/code&gt; would do plus &lt;strong&gt;more&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are few reasons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Finer control on which major modes should have this auto-correcting capability. For this use case, it could be text-only modes like &lt;code&gt;org-mode&lt;/code&gt;, &lt;code&gt;text-mode&lt;/code&gt;, etc.&lt;/li&gt;&#xA;&lt;li&gt;For the type of correction requested in the question, user would typically hit &lt;code&gt;SPC&lt;/code&gt; or &lt;code&gt;RET&lt;/code&gt; or &lt;code&gt;.&lt;/code&gt; key after the word. So using something like &lt;code&gt;post-self-insert-hook&lt;/code&gt; might be an overkill, and we would do that extra processing each time we hit any key.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So the below proposed solution binds this function with just the &lt;code&gt;SPC&lt;/code&gt; key in &lt;code&gt;org-mode-map&lt;/code&gt; (ignoring the corner case where the word could be the last word in a line). If needed, the user can bind similar wrapper functions to more keys.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun space-plus-more ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (backward-word 1)&#xA;    (let ((case-fold-search))&#xA;      (when (looking-at-p &quot;[A-Z]\\{2\\}.*?[a-z]+.*?\\b&quot;)&#xA;        (capitalize-word 1))))&#xA;  (self-insert-command 1))&#xA;&#xA;(define-key org-mode-map (kbd &quot;&amp;lt;SPC&amp;gt;&quot;) #'space-plus-more)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is an interesting elisp exercise :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I personally wouldn't want to bind this to &lt;code&gt;RET&lt;/code&gt; as then I would lose the default bindings in &lt;code&gt;org-mode&lt;/code&gt; and probably other major modes too.&lt;/em&gt; But it was interesting to learn about &lt;code&gt;elt&lt;/code&gt; and &lt;code&gt;this-command-keys-vector&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/fix-double-caps ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (backward-word 1)&#xA;    (let ((case-fold-search))&#xA;      (when (looking-at-p &quot;[A-Z]\\{2\\}.*?[a-z]+.*?\\b&quot;)&#xA;        (capitalize-word 1))))&#xA;  (if (eq 13 (elt (this-command-keys-vector) 0)) ; detect RET&#xA;      (newline)&#xA;    (self-insert-command 1)))&#xA;&#xA;(let ((maps-list (list org-mode-map&#xA;                       text-mode-map))&#xA;      (keys-list (list &quot;&amp;lt;SPC&amp;gt;&quot; &quot;&amp;lt;RET&amp;gt;&quot; &quot;.&quot;)))&#xA;  (dolist (map maps-list)&#xA;    (dolist (key keys-list)&#xA;      (define-key map (kbd key) #'my/fix-double-caps))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-14T15:08:50.773" LastActivityDate="2015-07-14T15:08:50.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13977" PostTypeId="1" AcceptedAnswerId="13978" CreationDate="2015-07-14T15:16:52.960" Score="4" ViewCount="651" Body="&lt;p&gt;I have my org files kept synchronized via rsync with various devices. These buffers are usually open in any running emacs instances due to agenda and capture. I want emacs to re-read these files from disk when something arrives via rsync. I know that &lt;code&gt;auto-revert-mode&lt;/code&gt; handles this, but I want to enable it solely for files under my org directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="3945" LastActivityDate="2015-07-14T15:47:45.727" Title="How to enable auto-revert-mode for files under a certain directory" Tags="|auto-revert-mode|directory-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13978" PostTypeId="2" ParentId="13977" CreationDate="2015-07-14T15:47:45.727" Score="9" Body="&lt;p&gt;Funny: it looks like you choose a tag that directly answers your question (&amp;quot;&lt;code&gt;directory-local-variables&lt;/code&gt;&amp;quot;)&lt;/p&gt;&#xA;&lt;p&gt;The best way to accomplish this is by placing a &lt;code&gt;.dir-locals.el&lt;/code&gt; file in your org directory and using it to enable &lt;code&gt;auto-revert-mode&lt;/code&gt;. Specifically, the file should look contain this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((eval . (auto-revert-mode 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you want only &lt;code&gt;org&lt;/code&gt; files to auto-revert, change &lt;code&gt;nil&lt;/code&gt; to &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;From &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Sometimes, you may wish to define the same set of local variables to all the files in a certain directory and its subdirectories, such as the directory tree of a large software project. This can be accomplished with directory-local variables.&lt;/p&gt;&#xA;&lt;p&gt;The usual way to define directory-local variables is to put a file named .dir-locals.el in a directory. Whenever Emacs visits any file in that directory or any of its subdirectories, it will apply the directory-local variables specified in .dir-locals.el, as though they had been defined as file-local variables for that file&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Please see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;the manual page&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-14T15:47:45.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13979" PostTypeId="2" ParentId="13970" CreationDate="2015-07-14T16:24:13.200" Score="0" Body="&lt;p&gt;Maybe this answer does not provide solution that you're expecting&#xA;(interactive correction of words as you type), I would like to share my ways&#xA;to fight such problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, I don't like things that silently change my text (capitalize,&#xA;etc., what if you want to type the word &lt;code&gt;IBuffer&lt;/code&gt;, I think such &quot;corrector&quot;&#xA;is a wrong way), so I advise two things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, try to enable feature &quot;Sticky Keys&quot;. It may seem weird at first but I&#xA;use it all the time. This feature is available on OS/desktop environment&#xA;level, it's not Emacs stuff. When this thing is enabled you first press&#xA;&lt;kbd&gt;⇧ Shift&lt;/kbd&gt; and then you press another key you want to&#xA;capitalize. This way your problem cannot even arise, only one letter is&#xA;capitalized in this sequential approach! It also reduces work your hands&#xA;need to do holding the &lt;kbd&gt;⇧ Shift&lt;/kbd&gt; key. I think it's easier to type&#xA;now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, now you still can use &lt;kbd&gt;⇧ Shift&lt;/kbd&gt; key normally (holding it)&#xA;when your think it's necessary, but I would like to propose you an Emacs&#xA;package called &lt;a href=&quot;https://github.com/mrkkrp/fix-word&quot; rel=&quot;nofollow&quot;&gt;Fix Word&lt;/a&gt;. Even if you don't like&#xA;&quot;Sticky Keys&quot;, you can correct words into their proper forms easily, and you&#xA;can correct several words in a row without useless movements of the&#xA;cursor. Give it a try, I use it all the time. (It's still difficult to correct things if you entered several words and the word you need to capitalize is somewhere in the middle.)&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-14T18:51:41.017" LastActivityDate="2015-07-14T18:51:41.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13980" PostTypeId="1" CreationDate="2015-07-14T17:34:55.110" Score="1" ViewCount="978" Body="&lt;p&gt;I just upgraded to a new bleeding edge version of Emacs in OS X:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --HEAD --use-git-head --with-cocoa &#xA;--with-gnutls --with-rsvg --with-imagemagick&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand that this version is not stable and that I shouldn't expect it to wok without any problems. Still, my experience so far has been relatively positive installing from &lt;code&gt;HEAD&lt;/code&gt; directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason, after today's update, I now run into this warning when I start Emacs. I am hoping to debug this problem using &lt;code&gt;setq debug-on-message&lt;/code&gt; as suggested in many threads without luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried adding  &lt;code&gt;(setq debug-on-message &quot;Warning (bytecomp)&quot;)&lt;/code&gt;&#xA;or &lt;code&gt;(setq debug-on-message &quot;Warning \(bytecomp\)&quot;)&lt;/code&gt; at the beginning of my &lt;code&gt;.emacs&lt;/code&gt; file and starting Emacs with &lt;code&gt;emacs --debug-init&lt;/code&gt;, but I don't see any trace either in the &lt;code&gt;Compile-Log&lt;/code&gt; or the &lt;code&gt;Messages&lt;/code&gt; log.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried re-compiling all packages from scratch, as explained in &lt;a href=&quot;https://stackoverflow.com/a/24735377/1732769&quot;&gt;this answer&lt;/a&gt;, i.e. doing &lt;code&gt;M-: (byte-recompile-directory package-user-dir nil 'force)&lt;/code&gt;, but the problem persists. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I effectively debug this type of warning?&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-07-14T22:19:36.407" Title="Debugging a &quot;Warning (bytecomp): reference to free variable&quot; message" Tags="|package|debugging|warning|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13981" PostTypeId="1" AcceptedAnswerId="13986" CreationDate="2015-07-14T19:01:03.420" Score="5" ViewCount="544" Body="&lt;p&gt;I've been using &lt;a href=&quot;https://github.com/gkos/emacs-pastebin&quot; rel=&quot;noreferrer&quot;&gt;emacs-pastebin&lt;/a&gt; but all my pastebins wind up as plain text. Is there a way to set emacs-pastebin so that pastebins are set to LISP format by default?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better yet, is there a pastebin site that can disentangle Emacs discussions and highlight syntax correctly in lines based on SRC tags like the following, including both the code snippet and the non-lisp commentary?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* org-toggle-todo-heading &#xA;Here's what I have so far. See if it works for you. &#xA;&#xA;#+BEGIN_SRC emacs-lisp &#xA;(defun org-toggle-todo-heading ()&#xA;&quot;Toggles the current line between a non-heading and TODO heading.&quot;&#xA;(interactive)&#xA;(let ((is-heading))&#xA;(save-excursion&#xA;(forward-line 0)&#xA;(when (looking-at &quot;^\\*&quot;) &#xA;(setq is-heading t)))&#xA;(if is-heading &#xA;    (progn&#xA;      (org-todo 'none) ; remove TODO&#xA;      (org-toggle-heading)) ; remove heading&#xA;  (progn&#xA;    (org-toggle-heading) ; convert to heading&#xA;    (org-todo 'nextset))))) ; add TODO  #+END_SRC&#xA;#+END_SRC&#xA;&#xA;I have it bound to M-S-8. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And of course, I want be able to post regions/buffers to the site from within Emacs. &lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-07-14T19:06:31.250" LastActivityDate="2015-07-20T17:40:21.387" Title="Emacs interface to a pastebin site that supports org-mode-style syntax highlighting?" Tags="|org-mode|syntax-highlighting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13983" PostTypeId="1" CreationDate="2015-07-14T19:56:03.247" Score="1" ViewCount="501" Body="&lt;p&gt;I want to specify a different font from my default font for runic characters in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried both:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font &quot;fontset-default&quot; '(#16a0 . #16ff) &quot;Junicode:Regular&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font &quot;fontset-default&quot; 'runic &quot;Junicode:Regular&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and neither seemed to work.  The first reports:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (invalid-read-syntax &quot;#&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the latter seems to silently fail.&lt;/p&gt;&#xA;" OwnerUserId="891" LastEditorUserId="253" LastEditDate="2015-07-14T20:02:42.650" LastActivityDate="2015-08-14T00:32:27.120" Title="Specify a fallback font for runic characters in Emacs?" Tags="|fonts|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13984" PostTypeId="2" ParentId="13981" CreationDate="2015-07-14T20:49:36.833" Score="3" Body="&lt;p&gt;I can't help with the org mode styling (I've never seen any pastebin that does that, but it sounds like an awesome feature).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of my favorite pastebins has a nice emacs package that takes care of pasting with the correct language and syntax highlighting(based on major mode, I believe) &lt;a href=&quot;https://www.refheap.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.refheap.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a bonus the pastebin supports &quot;private&quot; pastes and so does the emacs package!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package is available on melpa: &lt;a href=&quot;http://melpa.org/#/refheap&quot; rel=&quot;nofollow&quot;&gt;http://melpa.org/#/refheap&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2535" LastActivityDate="2015-07-14T20:49:36.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13985" PostTypeId="1" AcceptedAnswerId="14016" CreationDate="2015-07-14T20:58:38.983" Score="35" ViewCount="8940" Body="&lt;p&gt;I just upgraded to magit 2.1.0. (And also to emacs 25.0.50 and git 2.3.1.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Previously, in the &lt;code&gt;*magit*&lt;/code&gt; buffer I could:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select a hunk in the Unstaged area.&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;kbd&gt;v&lt;/kbd&gt; and answer yes to reverse it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This was handy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now in magit 2.1.0 it gives an error: &lt;code&gt;&quot;Cannot reverse unstaged changes&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Taking a hint from the error message, I discovered I can still do this, albeit in a somewhat &quot;backwards&quot; way with more steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;s&lt;/kbd&gt;tage the hunk. (Feels backwards; moving it closer to committed state.)&lt;/li&gt;&#xA;&lt;li&gt;Nav down and select it in the Staged area.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;v&lt;/kbd&gt;, answer yes.&lt;/li&gt;&#xA;&lt;li&gt;However the hunk is still Staged, so finally I have to &lt;kbd&gt;u&lt;/kbd&gt;nstage the hunk.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is this a bug, or, is it intentional and/or I'm being dense? If the latter, can you help me understand?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;UPDATE: After thoroughly RTFinfo-ing, I see that there are two commands:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;magit-reverse&lt;/code&gt; Reverse the change at point in the working tree.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;k&lt;/kbd&gt; &lt;code&gt;magit-discard&lt;/code&gt; Remove the change at point from the working tree.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It seems that &lt;kbd&gt;k&lt;/kbd&gt; &lt;code&gt;magit-discard&lt;/code&gt; does what I was used to &lt;kbd&gt;v&lt;/kbd&gt; doing before. It does work on an unstaged hunk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So practically I just need to retrain my muscle memory to use &lt;kbd&gt;k&lt;/kbd&gt;.  I could post that as a self-answer.  But I guess I'm still curious about the rationale, because I imagine understanding it will help me understand magit better overall.&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="849" LastEditDate="2015-07-14T21:58:23.400" LastActivityDate="2015-07-16T12:41:22.637" Title="Reverse a hunk in Magit 2.1.0" Tags="|magit|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="13986" PostTypeId="2" ParentId="13981" CreationDate="2015-07-14T21:03:46.460" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Better yet, is there a pastebin site that can disentangle Emacs discussions and highlight syntax correctly in lines based on SRC tags like the following, including both the code snippet and the non-lisp commentary?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is a &quot;&lt;a href=&quot;https://github.com/defunkt/gist.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;gist mode&lt;/a&gt;&quot; you can install from &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_package_system.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt; that can do that--Github and Gist both support Org-mode files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you have that repo, you can &lt;code&gt;M-x package-list-packages&lt;/code&gt;, install &quot;&lt;code&gt;gist&lt;/code&gt;&quot;, and then upload whatever buffer, region, or have-at-you that you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say I have this nifty little Org file I wrote that I wish to send to someome:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/E0qTL.png&quot; alt=&quot;&quot; title=&quot;A neat Org file&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see at the bottom, I am about to send this buffer with &lt;code&gt;M-x gist-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will then ask for a Github username and password, then spit out a link of the Gist's URL:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/zSpb7.png&quot; alt=&quot;&quot; title=&quot;At least... That&amp;#39;s the gist of it.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/Archenoth/9858e98cacee396d0d97&quot; rel=&quot;nofollow noreferrer&quot;&gt;This is the result&lt;/a&gt;:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/4DhDi.png&quot; alt=&quot;&quot; title=&quot;Ignore the 4chan. You do not see the 4chan.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can send this link in an E-Mail, IRC, or wherever I've been meaning to send the Org. (Or just keep it around for posterity.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Gist support allows for modifying Gists you posted, creating Gists from buffers or regions, as well as working with public or private posts.&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2015-07-20T17:40:21.387" LastActivityDate="2015-07-20T17:40:21.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="13987" PostTypeId="2" ParentId="13983" CreationDate="2015-07-14T22:21:05.797" Score="1" Body="&lt;p&gt;One solution I found which seems to work is just to install the Emacs &lt;code&gt;unicode-fonts&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/rolandwalker/unicode-fonts&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rolandwalker/unicode-fonts&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="891" LastActivityDate="2015-07-14T22:21:05.797" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13988" PostTypeId="1" AcceptedAnswerId="13991" CreationDate="2015-07-14T22:39:14.287" Score="1" ViewCount="76" Body="&lt;p&gt;I recently &lt;a href=&quot;https://emacs.stackexchange.com/questions/13933/cycling-through-latex-math-mode-and-equation/13936#13936&quot; title=&quot;Cycle between math delimiters&quot;&gt;wrote a function&lt;/a&gt; which could cycle through LaTeX math delimiters. It relies on the &lt;code&gt;texmathp&lt;/code&gt; function, built into AucTeX, which will return &lt;code&gt;t&lt;/code&gt; if the point is inside an equation region. In addition, I use the &lt;code&gt;texmathp-why&lt;/code&gt; function in order to determine what the math environment is (which was important to answering the posed question).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it was pointed out by the asker that the function does not work when the point is inside &lt;code&gt;\text{}&lt;/code&gt; inside the equation (which I assume is intentional behavior within AucTeX). Is there a simple way to avoid this escape, or should I write a work around in the function to account for this?&lt;/p&gt;&#xA;" OwnerUserId="8486" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-07-15T00:17:55.367" Title="Change escape behavior when inside LaTeX equations" Tags="|latex|auctex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13989" PostTypeId="1" CreationDate="2015-07-14T22:55:06.203" Score="3" ViewCount="884" Body="&lt;p&gt;so I've learned that emacs cannot handle multi-line strings very well, for example printing big data structures in inferior python shell (invoked with run-python) is dangerous and usually ends with massive slowdown of whole emacs or crash. To bypass this, I print datastructures by elements and I ran into this odd behaviour:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in [('a', 'b') for j in range(150000)]:&#xA;    print(i)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No lines involved here, still emacs behaves like they were: massive slowdown, usually crash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code is ok (why??):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in [(1, 2) for j in range(150000):&#xA;    print(i)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW: I run emacs with -q, I've tried using alternative python shells (ipython) and I tried buffer-disable-undo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for help, I really love the idea of having python shell in emacs and I've invested many hours into research about this, but without any results.&lt;/p&gt;&#xA;" OwnerUserId="8918" LastActivityDate="2015-09-14T17:37:02.913" Title="Inferior Python shell slow/crash on long lines" Tags="|python|shell|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13990" PostTypeId="1" AcceptedAnswerId="14022" CreationDate="2015-07-14T22:59:06.077" Score="0" ViewCount="232" Body="&lt;p&gt;I am trying to view XML files in Emacs, but I am not seeing any font highlighting.  The entire document appears as white on black (which is my default font).  The following note appears on the &lt;a href=&quot;http://www.emacswiki.org/emacs/NxmlMode&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki page for nXML&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; the colorization (font-lock) won’t work if you change the emacs&#xA;  colors.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But there is no additional explanation.  I verified that if I start emacs as &lt;code&gt;emacs -Q somefile.xml&lt;/code&gt;, I will in fact get font-lock highlighting that works how I would expect.  That is, the element tags are displayed in a different color from the element text.  Why does font-lock seem to go away when I apply a custom theme?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2015-07-16T17:53:46.160" LastActivityDate="2015-07-16T17:53:46.160" Title="Using font-lock with custom faces in nXML mode" Tags="|font-lock|nxml|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13991" PostTypeId="2" ParentId="13988" CreationDate="2015-07-14T23:50:35.797" Score="2" Body="&lt;p&gt;I think adding the line &lt;code&gt;(while (member (TeX-current-macro) '(&quot;text&quot;)) (backward-char))&lt;/code&gt; to your code does the job:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun cycle-texmath ()&#xA;(save-excursion (progn&#xA;(while (member (TeX-current-macro) '(&quot;text&quot;)) (backward-char))&#xA;(if (texmathp) (progn&#xA;      (setq env (car texmathp-why))&#xA;      (if (string= env &quot;equation&quot;) (progn &#xA;        (search-backward &quot;\\begin{equation}&quot;) (replace-match &quot;\\[&quot; t t)&#xA;        (search-forward &quot;\\end{equation}&quot;) (replace-match &quot;\\]&quot; t t)))&#xA;      (if (string= env &quot;\\[&quot;) (progn &#xA;        (search-backward &quot;\\[&quot;) (replace-match &quot;\\(&quot; t t)&#xA;        (search-forward &quot;\\]&quot;) (replace-match &quot;\\)&quot; t t)))&#xA;      (if (string= env &quot;\\(&quot;) (progn &#xA;        (search-backward &quot;\\(&quot;) (replace-match &quot;\\begin{equation}&quot; t t)&#xA;        (search-forward &quot;\\)&quot;) (replace-match &quot;\\end{equation}&quot; t t)))&#xA;  )))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="8486" LastEditDate="2015-07-15T00:17:55.367" LastActivityDate="2015-07-15T00:17:55.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13992" PostTypeId="1" AcceptedAnswerId="13994" CreationDate="2015-07-15T00:05:06.330" Score="1" ViewCount="291" Body="&lt;p&gt;Somehow I got into the situation where my section headings in ReST mode are rendered in one shade of gray for the foreground and another, nearly identical shade of gray for the background.  This makes the section headings almost completely unreadable to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I am a simple user with a rather simple question: How can I customize the colors for ReST mode to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the output of my &lt;code&gt;version&lt;/code&gt; command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.21) of 2013-10-25 on allspice, modified by Debian&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3950" LastActivityDate="2015-07-15T00:54:31.753" Title="How can I customize the colors used for reStructuredText?" Tags="|colors|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13993" PostTypeId="1" AcceptedAnswerId="13996" CreationDate="2015-07-15T00:54:28.507" Score="6" ViewCount="472" Body="&lt;p&gt;This question is inspired by &lt;a href=&quot;https://emacs.stackexchange.com/a/7831/&quot;&gt;https://emacs.stackexchange.com/a/7831/&lt;/a&gt; and the below settings borrowed from that answer :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/emacs-backups&quot;))&#xA;      version-control 'numbered&#xA;      make-backup-files t&#xA;      delete-old-versions 'never)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am wondering if it would be possible that emacs keeps an unlimited backups of a list of files defined by the user and for other files to behave like its usual backup system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The motivation is that it would be desirable that Emacs keeps several backups of a list of some important files (defined by the user), like &lt;code&gt;~/.emacs&lt;/code&gt; &lt;code&gt;/path/to/my_important_file.txt&lt;/code&gt;, (1) by creating a numbered version control of them, like the above code (2) never deletes the old versions and (3) for other files, Emacs keeps its standard backup system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added:&lt;/strong&gt;&#xA;Based on the answer provided by Drew (suggesting to use local variables and the version-control variable) we can add this at the end of the files that we would like to keep an unlimited number of backups of them (for making the changes permanent, after reopening the file we can answer the question about applying the values of the these variables by &lt;code&gt;!&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; version-control: t&#xA;;; make-backup-files: t&#xA;;; delete-old-versions: never&#xA;;; End: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For keeping the last &lt;code&gt;N&lt;/code&gt; backups of a file we should add this at the end of that file&#xA;(for example for N=50):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; version-control: t&#xA;;; make-backup-files: t&#xA;;; delete-old-versions: t&#xA;;; kept-new-versions: 50&#xA;;; kept-old-versions: 0&#xA;;; End: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-07-15T07:29:53.817" Title="version control using the usual backup system of Emacs" Tags="|version-control|backup|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="13994" PostTypeId="2" ParentId="13992" CreationDate="2015-07-15T00:54:31.753" Score="3" Body="&lt;p&gt;Put the cursor on one of those section headings, and hit &lt;code&gt;C-u C-x =&lt;/code&gt;. Emacs will tell you, near the bottom of buffer &lt;code&gt;*Help*&lt;/code&gt;, what face(s) is/are used for the highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use &lt;code&gt;M-x customize-face&lt;/code&gt; to specify each face (there might be only one that you need to change), and then tweak the definition as you like. Use the action menu to set your changes for the current session or save them also for future sessions.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-15T00:54:31.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13995" PostTypeId="1" CreationDate="2015-07-15T01:13:15.180" Score="0" ViewCount="238" Body="&lt;p&gt;I'm trying to write fancy split that puts any message with &quot;[foobar]&quot; in the subject into a specific folder but nothing seems to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nnimap-split-fancy '(|(&quot;subject&quot; &quot;\\[foobar\\]&quot; &quot;INBOX.foobar&quot;)&#xA;                          (...)) &#xA;                          &quot;default&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it still ends up in the &quot;default&quot; mailbox. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I change the regexp to just &quot;foobar&quot; it works (but then it matches other messages I don't want included). I think it's something to do with the escaping of the brackets. I've tried a couple of different of variations of escaping but there's something I'm missing. Or maybe I'm not fancy enough.&lt;/p&gt;&#xA;" OwnerUserId="567" LastActivityDate="2015-12-17T01:24:55.083" Title="Fancy splitting in gnus based on subject of message" Tags="|gnus|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="13996" PostTypeId="2" ParentId="13993" CreationDate="2015-07-15T01:42:38.763" Score="7" Body="&lt;p&gt;Here are two alternative answers, which both come from reading the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Names.html&quot;&gt;Backup Names&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Set variable &lt;code&gt;version-control&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, and then create a numbered backup for each of your &quot;important&quot; files (only). Files that already have numbered backups will continue to get them. Other files will not get numbered backups.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;[S]et &lt;code&gt;version-control&lt;/code&gt; locally in an individual buffer to control the making of backups for&#xA;  that buffer's file (*note &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Locals.html&quot;&gt;Locals&lt;/a&gt;).  You can have Emacs set&#xA;  &lt;code&gt;version-control&lt;/code&gt; locally whenever you visit a given file (*note &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html&quot;&gt;File&#xA;  Variables&lt;/a&gt;).&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This means that you use a file-local value of variable &lt;code&gt;version-control&lt;/code&gt; for particular files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How did I find node &lt;code&gt;Backup Names&lt;/code&gt; in the first place? &lt;code&gt;C-h r&lt;/code&gt; to visit the Emacs manual, then I hit &lt;code&gt;i&lt;/code&gt; for the index and typed &lt;code&gt;backup&lt;/code&gt; and hit &lt;code&gt;TAB&lt;/code&gt;. I picked the first completion candidate, &lt;code&gt;backup file&lt;/code&gt;, which put me in node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Backup.html&quot;&gt;Backup&lt;/a&gt;. And that node told me:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At your option, Emacs can keep either a single backup for each file,&#xA;  or make a series of numbered backup files for each file that you edit.&#xA;  *Note &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Names.html&quot;&gt;Backup Names&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then I clicked that link.  (&lt;em&gt;Ask Emacs!&lt;/em&gt;)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-15T01:48:24.380" LastActivityDate="2015-07-15T01:48:24.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13997" PostTypeId="2" ParentId="13868" CreationDate="2015-07-15T02:03:52.633" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I know I can bisect + eval the files manually but that's even slower.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Wrong!&lt;/em&gt; So I will ignore the &quot;&lt;em&gt;without relaunching&lt;/em&gt;&quot; part of your question title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is common and classic, as is the solution: &lt;strong&gt;&lt;em&gt;binary search&lt;/em&gt;&lt;/strong&gt;. If turning on &lt;code&gt;debug-on-error&lt;/code&gt; and using option &lt;code&gt;--debug-init&lt;/code&gt; doesn't help, then do this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bisect your init file recursively, to locate the tiny bit of it that is responsible for the problem.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's all. Binary search is very quick, powerful, and simple. People too often avoid it, thinking that they can think their way through the problem quicker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To bisect your init file recursively:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Comment out half of it. You can use &lt;code&gt;M-x comment-region&lt;/code&gt; to comment out the region of selected text. (You can uncomment the region using &lt;code&gt;C-u&lt;/code&gt; with the same command. (For convenience, you can bind &lt;code&gt;comment-region&lt;/code&gt; to a key.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Start Emacs. Did you see the same problem? If yes, then the problem is not caused by the part you commented out. If no, then it is.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For the problematic part: Comment out the other part and half of the problematic part.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Repeat #2 and #3, over and over.  It doesn't take long: 1/2, 3/4, 7/8, 15/16, 31/32, 63/64, 127/128, 255/256, 511/512, 1023/1024,...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't matter how big your init file is or how much other code it loads (if the problem is in other code then repeat the same process on that file, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If fact, the bigger the pile of code you are trying to search, the more binary search helps you.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-15T02:03:52.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="13998" PostTypeId="2" ParentId="13985" CreationDate="2015-07-15T02:26:55.800" Score="12" Body="&lt;p&gt;It looks like I had accidentally learned that &lt;kbd&gt;v&lt;/kbd&gt;, bound to &lt;code&gt;magit-revert-item&lt;/code&gt;, did used to do a &lt;code&gt;magit-discard-item&lt;/code&gt; in this special case of unstaged hunks. See the &lt;code&gt;&amp;lt;=== HERE ===&lt;/code&gt; comment I put below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun magit-revert-item ()&#xA;  &quot;Revert the item at point.&#xA;The change introduced by the item is reversed in the current&#xA;working tree.&quot;&#xA;  (interactive)&#xA;  (magit-section-action revert (info)&#xA;    ([* unstaged] (magit-discard-item))  ;; &amp;lt;=== HERE ===&#xA;    (commit (when (or (not magit-revert-item-confirm)&#xA;                      (yes-or-no-p &quot;Revert this commit? &quot;))&#xA;              (magit-revert-commit info)))&#xA;    (diff   (when (or (not magit-revert-item-confirm)&#xA;                      (yes-or-no-p &quot;Revert this diff? &quot;))&#xA;              (magit-apply-diff-item it &quot;--reverse&quot;)))&#xA;    (hunk   (when (or (not magit-revert-item-confirm)&#xA;                      (yes-or-no-p &quot;Revert this hunk? &quot;))&#xA;              (magit-apply-hunk-item it &quot;--reverse&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://github.com/magit/magit/blob/1.4.2/magit.el#L4866-L4881&quot;&gt;1.4.2 code&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now that doesn't happen:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun magit-reverse (&amp;amp;rest args)&#xA;  &quot;Reverse the change at point in the working tree.&quot;&#xA;  (interactive (and current-prefix-arg (list &quot;--3way&quot;)))&#xA;  (--when-let (magit-current-section)&#xA;    (pcase (list (magit-diff-type) (magit-diff-scope))&#xA;      (`(untracked ,_) (user-error &quot;Cannot reverse untracked changes&quot;))&#xA;      (`(unstaged  ,_) (user-error &quot;Cannot reverse unstaged changes&quot;))&#xA;      (`(,_      list) (magit-reverse-files (magit-section-children it) args))&#xA;      (`(,_     files) (magit-reverse-files (magit-region-sections) args))&#xA;      (`(,_      file) (magit-reverse-files (list it) args))&#xA;      (_               (magit-reverse-apply it args)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://github.com/magit/magit/blob/master/lisp/magit-apply.el#L391-L401&quot;&gt;master&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;However &lt;kbd&gt;k&lt;/kbd&gt; is bound directly to &lt;code&gt;magit-discard-item&lt;/code&gt;. I should have learned to use that in the first place. That worked before 2.1.0, and still works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion, magit 2.1.0 has been significantly redesigned. It's inevitable that some weird corner cases might not have survived. And, I would agree, don't need to have survived. I'll relearn the key.&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="849" LastEditDate="2015-07-15T02:35:37.643" LastActivityDate="2015-07-15T02:35:37.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="13999" PostTypeId="1" CreationDate="2015-07-15T03:14:48.217" Score="10" ViewCount="189" Body="&lt;p&gt;I would like to perform &lt;a href=&quot;https://en.wikipedia.org/wiki/Significance_arithmetic&quot;&gt;significance arithmetic&lt;/a&gt; in &lt;code&gt;calc-mode&lt;/code&gt;. For example, I want &lt;code&gt;5000&lt;/code&gt; to have one significant figure, and &lt;code&gt;5.0e3&lt;/code&gt; to have two significant figures. Calculations should preserve significant figures according to the rules of significance arithmetic. How can I accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-07-15T03:14:48.217" Title="Significance arithmetic in calc" Tags="|calc|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14000" PostTypeId="1" AcceptedAnswerId="14004" CreationDate="2015-07-15T06:19:52.020" Score="4" ViewCount="1789" Body="&lt;p&gt;I have bound &lt;code&gt;&quot;C-;&quot;&lt;/code&gt; to &lt;code&gt;'other-window&lt;/code&gt; in my config like so.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-;&quot;) 'other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run emacs outside of a terminal, this keybinding works as I would expect. Inside Iterm2 and OS X terminal, however, emacs does not appear to distinguish it from &lt;code&gt;&quot;;&quot;&lt;/code&gt;. I can use the keybinding itself, however, by activating god-mode. I'm wondering if this is some limitation/&quot;feature&quot; of terminal emulators in general.&lt;/p&gt;&#xA;" OwnerUserId="8921" LastActivityDate="2015-07-15T08:48:27.760" Title="Why doesn't &quot;C-;&quot; &quot;C-,&quot;, or &quot;C-.&quot; work in a terminal emulator? (OS X Terminal, Iterm2)" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ClosedDate="2015-07-15T13:17:39.557" ContentLicense="CC BY-SA 3.0" />
  <row Id="14001" PostTypeId="2" ParentId="13969" CreationDate="2015-07-15T07:21:40.193" Score="1" Body="&lt;p&gt;You need to exclude some extra auto-complete sources in python-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (add-hook 'python-mode-hook&#xA;             (lambda ()&#xA;               (delq 'ac-source-dictionary ac-sources)&#xA;               (delq 'ac-source-abbrev ac-sources)&#xA;               (delq 'ac-source-words-in-same-mode-buffers ac-sources)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope this help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Djangoliv&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-07-15T07:21:40.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14002" PostTypeId="1" AcceptedAnswerId="14003" CreationDate="2015-07-15T08:16:02.223" Score="5" ViewCount="431" Body="&lt;p&gt;I'm having problems to replace a URL inside a HTML tag with &lt;code&gt;replace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the original string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;img src=&quot;http://localhost/~user/foo.bar/place/foo_bar.jpg&quot; ... attr=&quot;...&quot; /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what I want it looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;img src=&quot;&amp;lt;?php echo foo() . '/place/foo_bar.jpg'; ?&amp;gt;&quot; ... attr=&quot;...&quot; /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The pattern that I'm using to match until now (which is matching too much):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\(http://localhost/~user/foo\.bar\)\(.+\)\(&quot;\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the replacing pattern:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php foo() . '\2'; ?&amp;gt;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this is what I'm getting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;img src=&quot;&amp;lt;?php echo foo() . '/place/foo_bar.jpg&quot; ... attr=&quot;...'; ?&amp;gt;&quot; /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought the first group would match the base url, the second group would match the rest of the url until the double quote and the third group would match the double quote itself. But I think there is some misconception in my mind (and also in my regex) that the second group is matching until the last attribute within the html tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what is this misconception?&lt;/p&gt;&#xA;" OwnerUserId="8922" LastEditorUserId="8922" LastEditDate="2015-07-15T08:21:12.490" LastActivityDate="2015-07-15T08:22:34.703" Title="replace-regexp: pattern is matching too much" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14003" PostTypeId="2" ParentId="14002" CreationDate="2015-07-15T08:22:34.703" Score="6" Body="&lt;p&gt;Look at this code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(replace-regexp-in-string&#xA; &quot;\\(http://localhost/~user/foo\.bar\\)\\(.+?\\)\&quot;&quot;&#xA; &quot;&amp;lt;?php foo() . '\\2'; ?&amp;gt;\&quot;&quot;&#xA; &quot;&amp;lt;img src=\&quot;http://localhost/~user/foo.bar/place/foo_bar.jpg\&quot; ... attr=\&quot;...\&quot; /&amp;gt;&quot;)&#xA;;; =&amp;gt; &quot;&amp;lt;img src=\&quot;&amp;lt;?php foo() . '/place/foo_bar.jpg'; ?&amp;gt;\&quot; ... attr=\&quot;...\&quot; /&amp;gt;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The thing that you're missing is &lt;code&gt;.+?&lt;/code&gt; instead of &lt;code&gt;.+&lt;/code&gt;, which makes the regexp non-greedy.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-15T08:22:34.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14004" PostTypeId="2" ParentId="14000" CreationDate="2015-07-15T08:42:45.617" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I'm wondering if this is some limitation/&quot;feature&quot; of terminal emulators in general.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your terminal emulator does not send those sequences to Emacs because it is faithfully emulating something which was not capable of sending such sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is accurately reflecting the sequence that it actually received.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/11118511&quot;&gt;https://stackoverflow.com/a/11118511&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/24963704&quot;&gt;https://stackoverflow.com/a/24963704&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-07-15T08:48:27.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14005" PostTypeId="1" CreationDate="2015-07-15T19:30:20.143" Score="4" ViewCount="971" Body="&lt;p&gt;I have an odd intermittent problem with Emacs disappearing from view.  I haven't quite figured out the trigger for this.  It doesn't happen often and I can't reproduce it on purpose. Sometimes it happens when losing focus, sometimes while navigating the menu bar, sometimes seemingly random.  I'm hoping someone else has seen this and can shed some light on what is going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean by &quot;disappearing&quot; is just that, the frame is no longer drawn and cannot be raised into view.  The task bar still indicates an Emacs instance and I can interact with that to minimize/maximize it.  When the click into the task bar should maximize/raise the frame, the window manager does change to indicate that there is something in the desktop, but nothing is shown.  Occasionally I can see the contents of the Emacs frame flash on screen before disappearing again.  When I click the task bar again to minimize the window manager changes to reflect an empty desktop again.  The only way I've found to fix this is to kill the emacs process and start it back up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hesitant to blame this on the window manager because I can put other things onto that desktop and interact with them normally.  Even other Emacs frames continue to behave normally.  I've also never observed the behavior with anything but Emacs frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs 24.4 (gtk3 toolkit) compiled from source w/ gcc 5.1.0  (&lt;a href=&quot;https://github.com/cwebster2/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;.emacs&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Awesome WM 3.4.15&lt;/li&gt;&#xA;&lt;li&gt;Xorg 7.4 w/ nvidia-drivers 352.21  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I run X across three displays at 5760x1080. The Emacs frame that disappears is generally running maximized on the primary display (the center monitor). The WM is set to floating windows on the desktop that the Emacs frame is on so it shouldn't be some odd interaction from the WM tiling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any ideas what might be causing this?  Has anyone seen this themselves?  One second the Emacs frame is in view, then it is just gone, never to reappear.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Some additional details:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the window is invisible, &lt;code&gt;wmctrl&lt;/code&gt; reports its resolution as 1918x1059 which is full screen (minus window decoration and taskbar).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also just discovered the invisible window (Emacs frame) can still be interacted with.  If I load up another emacsclient somewhere else and then unminimize the invisible window, position the mouse so it would have focus and type I see the text on the buffer I have open elsewhere.  Clearly X11 keyboard events are being sent to the window and it is seen as having focus by X.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the disappearing frame is part an emacsclient GUI frame, I can still connect to the server (started as &lt;code&gt;emacs --daemon&lt;/code&gt;) and access all of the buffers and interact with the invisible frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As this is likely a bug in emacs, I have &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21775&quot; rel=&quot;nofollow&quot;&gt;filed a bug report&lt;/a&gt; and should a solution be found through that channel, I'll post an answer here.&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="38" LastEditDate="2015-10-29T01:52:20.417" LastActivityDate="2023-09-27T19:00:34.543" Title="Emacs frame disappearing" Tags="|frames|emacs24.4|linux|x11|" AnswerCount="0" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="14006" PostTypeId="1" CreationDate="2015-07-15T21:58:23.160" Score="0" ViewCount="1181" Body="&lt;p&gt;I need to see the space characters but I can't set it for the life of me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went to customize the &lt;code&gt;Whitespace Display Mapping&lt;/code&gt; and this is what I found. Notice that the mapping for the space is set to be &quot;.&quot;. It doens't work of course:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;INS DEL Character Mapping:&#xA;            Char Kind: Value Menu Space&#xA;            Char:  &#xA;            Vector List:&#xA;            INS DEL :&#xA;                        Vector Characters:&#xA;                        INS DEL Char: .&#xA;                        INS&#xA;            INS&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I even included this into .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq whitespace-display-mappings '((space-mark 32 [46])&#xA;       (newline-mark 10 [36 10]) (tab-mark 9 [187&#xA;      9] [92 9])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe someone know what is the problem here? I just want the whitespace overlay to show the &quot; &quot; character as a &quot;.&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time and help in advance.&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="630" LastEditDate="2016-02-29T14:43:31.870" LastActivityDate="2016-06-28T17:02:14.733" Title="whitespace-mode doesn't show the space characters" Tags="|init-file|customize|whitespace|whitespace-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14007" PostTypeId="1" CreationDate="2015-07-16T00:03:00.847" Score="3" ViewCount="676" Body="&lt;p&gt;&lt;code&gt;company-mode&lt;/code&gt; is awesome. It even works in Eshell. However, when I'm &lt;code&gt;cd&lt;/code&gt;d into another host, company mode makes Eshell unusable because it's always hanigng waiting for TRAMP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can enable &lt;code&gt;company-mode&lt;/code&gt; in Eshell, but only when the current directory is local?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-01-13T06:18:07.023" Title="Disable company in eshell when using TRAMP" Tags="|company-mode|tramp|eshell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14008" PostTypeId="1" AcceptedAnswerId="14012" CreationDate="2015-07-16T03:20:26.890" Score="10" ViewCount="1294" Body="&lt;p&gt;I use &lt;code&gt;evil&lt;/code&gt;. Normally, when I commit, I'd like to immediately start typing, but &lt;code&gt;evil&lt;/code&gt; starts the buffer in &lt;code&gt;evil-normal-state&lt;/code&gt;. I used to set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-set-initial-state #'git-commit-mode 'insert)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that no longer works, as Magit uses &lt;code&gt;text-mode&lt;/code&gt; for its commit buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I have Magit commits default to &lt;code&gt;evil-insert-state&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-03-10T16:06:37.580" Title="Default Magit commit state in Evil" Tags="|magit|evil|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14009" PostTypeId="2" ParentId="13946" CreationDate="2015-07-16T05:40:19.547" Score="0" Body="&lt;p&gt;I don't know why it happens, but imenu seems to match the regexp in a non-greedy manner, so it matched &lt;code&gt;3&lt;/code&gt; rather than &lt;code&gt;func3&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you change the regexp to the following, it will match &lt;code&gt;func3&lt;/code&gt;. The difference is the &lt;code&gt;\\_&amp;lt;&lt;/code&gt; in front of the regexp matching the variable name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq imenu-generic-expression&#xA;  '((&quot;Function&quot;&#xA;     &quot;\\(function\\)[\n\t ]*\\[?[ ,_A-Za-z0-9]+\\]?[\n\t ]*=[\n\t ]*\\([_A-Za-z0-9]+\\)&quot; 2)&#xA;    (&quot;Anonymous Function&quot;&#xA;     &quot;\\_&amp;lt;\\([_A-Za-z0-9]+\\)[\n\t ]*=[\n\t ]*@[\n\t ]*([, _A-Za-z0-9]+)&quot; 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-07-16T05:40:19.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14010" PostTypeId="1" CreationDate="2015-07-16T07:18:55.637" Score="2" ViewCount="198" Body="&lt;p&gt;I have an issue with Aquamacs. When press something like &lt;code&gt;C-c a t&lt;/code&gt; (= org-todo-list in org-mode) the minibuffer shows an error message that there is no keybinding for &lt;code&gt;^C A&lt;/code&gt;, despite &lt;code&gt;Shift&lt;/code&gt; is neither pressed nor locked. I tried this with various other keybindings, yet to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="8928" LastActivityDate="2015-07-16T15:04:29.410" Title="When using keybindings a capital letter is assumed by Aquamacs" Tags="|osx|aquamacs|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14011" PostTypeId="2" ParentId="3955" CreationDate="2015-07-16T08:06:45.773" Score="10" Body="&lt;p&gt;If you set &lt;code&gt;LaTeX-includegraphics-read-file&lt;/code&gt; to &lt;code&gt;LaTeX-includegraphics-read-file-relative&lt;/code&gt;, autocompletion with &lt;a href=&quot;https://emacs-helm.github.io/helm/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm&lt;/code&gt;&lt;/a&gt; provides this feature:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vyhF0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vyhF0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Setting up AUCTeX&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can either customize &lt;code&gt;LaTeX-includegraphics-read-file&lt;/code&gt; (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-variable&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;LaTeX-includegraphics-read-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;) and select the &lt;code&gt;relative&lt;/code&gt; option or add the following to your init file:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Installing and setting up &lt;code&gt;helm&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can install &lt;code&gt;helm&lt;/code&gt; from Melpa repository, &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; are the instructions on how to add it.  When you're done, issue &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;list-packages&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, go to the &lt;code&gt;helm&lt;/code&gt; entry and hit &lt;kbd&gt;i&lt;/kbd&gt; &lt;kbd&gt;x&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you need to setup &lt;code&gt;helm&lt;/code&gt;.  &lt;a href=&quot;https://tuhdo.github.io/helm-intro.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is a good starting tutorial.  You can choose between a minimal configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'helm-config)&#xA;(helm-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and an extended configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'helm)&#xA;(require 'helm-config)&#xA;&#xA;;; The default &quot;C-x c&quot; is quite close to &quot;C-x C-c&quot;, which quits Emacs.&#xA;;; Changed to &quot;C-c h&quot;. Note: We must set &quot;C-c h&quot; globally, because we&#xA;;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.&#xA;(global-set-key (kbd &quot;C-c h&quot;) 'helm-command-prefix)&#xA;(global-unset-key (kbd &quot;C-x c&quot;))&#xA;(global-set-key (kbd &quot;M-x&quot;) 'helm-M-x) ; This was not present in the suggested extended config&#xA;&#xA;(define-key helm-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'helm-execute-persistent-action) ; rebind tab to run persistent action&#xA;(define-key helm-map (kbd &quot;C-i&quot;) 'helm-execute-persistent-action) ; make TAB works in terminal&#xA;(define-key helm-map (kbd &quot;C-z&quot;)  'helm-select-action) ; list actions using C-z&#xA;&#xA;(when (executable-find &quot;curl&quot;)&#xA;  (setq helm-google-suggest-use-curl-p t))&#xA;&#xA;(setq helm-split-window-in-side-p           t ; open helm buffer inside current window, not occupy whole other window&#xA;      helm-move-to-line-cycle-in-source     t ; move to end or beginning of source when reaching top or bottom of source.&#xA;      helm-ff-search-library-in-sexp        t ; search for library in `require' and `declare-function' sexp.&#xA;      helm-scroll-amount                    8 ; scroll 8 lines other window using M-&amp;lt;next&amp;gt;/M-&amp;lt;prior&amp;gt;&#xA;      helm-ff-file-name-history-use-recentf t)&#xA;&#xA;(helm-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please, be aware of the &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#emacscompletionvshelm&quot; rel=&quot;nofollow noreferrer&quot;&gt;differences between Emacs default completion and &lt;code&gt;helm&lt;/code&gt;'s one&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Start using the new feature&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Restart Emacs and you'll be ready.  In an LaTeX buffer, issue &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;includegraphics&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; (note you can exploit &lt;code&gt;helm&lt;/code&gt; autocompletion) and select the picture you want to include.  In order to see the preview, as shown at the beginning, press twice the keybinding associated to &lt;code&gt;helm-execute-persistent-action&lt;/code&gt; (&lt;kbd&gt;C-z&lt;/kbd&gt; by default, or &lt;kbd&gt;TAB&lt;/kbd&gt; in the above extended configuration) or move up and down in the file list with &lt;kbd&gt;C-up&lt;/kbd&gt; and &lt;kbd&gt;C-down&lt;/kbd&gt; (see &lt;a href=&quot;https://emacs.stackexchange.com/a/2463/620&quot;&gt;this answer&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-04T14:25:24.360" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14012" PostTypeId="2" ParentId="14008" CreationDate="2015-07-16T08:45:25.117" Score="12" Body="&lt;p&gt;Here's a workaround:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'with-editor-mode-hook 'evil-insert-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why the initial state system was chosen as it either means you have a huge whitelist of states or do &lt;a href=&quot;https://github.com/wasamasa/dotemacs/blob/master/init.org#initial-state&quot;&gt;lookup of derived modes&lt;/a&gt;, the hooks system is a much more natural fit for Evil &lt;a href=&quot;https://bitbucket.org/lyro/evil/issues/497/regarding-initial-states&quot;&gt;IMO&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-16T08:45:25.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14013" PostTypeId="1" AcceptedAnswerId="14014" CreationDate="2015-07-16T09:35:16.380" Score="5" ViewCount="2568" Body="&lt;p&gt;For example, we can open a new buffer with &lt;code&gt;C-x b &amp;lt;new-buffer-name&amp;gt;&lt;/code&gt;, and by default, this new buffer opens in &lt;code&gt;fundamental-mode&lt;/code&gt;, which is not very useful to me. I would like to change this to open all new buffers in &lt;code&gt;org-mode&lt;/code&gt;. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="105" LastEditDate="2016-11-12T03:13:56.617" LastActivityDate="2021-10-28T11:39:09.993" Title="Change the default mode used when opening a new buffer" Tags="|buffers|major-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14014" PostTypeId="2" ParentId="14013" CreationDate="2015-07-16T10:51:03.823" Score="8" Body="&lt;p&gt;You have to customize the &lt;code&gt;major-mode&lt;/code&gt; variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Major-Modes.html&quot; rel=&quot;noreferrer&quot;&gt;(see also the emacs manual)&lt;/a&gt;. &lt;code&gt;C-h v&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol for current buffer's major mode.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The default value (normally `fundamental-mode') affects new buffers.&#xA;   A value of nil means to use the current buffer's major mode, provided&#xA;   it is not marked as &quot;special&quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can do this with &lt;code&gt;M-x customize-variable major-mode&lt;/code&gt; or with something like &lt;code&gt;(setq-default major-mode 'org-mode)&lt;/code&gt; somewhere in your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;code&gt;initial-major-mode&lt;/code&gt; for the &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="437" LastEditorUserId="437" LastEditDate="2015-07-16T10:57:29.740" LastActivityDate="2015-07-16T10:57:29.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14015" PostTypeId="2" ParentId="13967" CreationDate="2015-07-16T12:10:11.923" Score="1" Body="&lt;p&gt;When moving inside the log buffer using &lt;kbd&gt;n&lt;/kbd&gt; and &lt;kbd&gt;p&lt;/kbd&gt;, then the revision buffer is automatically updates to show the commit at point. This can be controlled using the option &lt;code&gt;magit-diff-auto-show&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until a little while ago that did not work well when &lt;em&gt;holding&lt;/em&gt; down one of these keys, because that caused the revision buffer to be updated for each commit moved over in the log buffer. I just pushed a kludge for that, which works by delaying updating the revision buffer. You might want to customize the new option &lt;code&gt;magit-diff-auto-show-delay&lt;/code&gt; in order to fine-tune the delay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can configure &lt;code&gt;magit-diff-auto-show&lt;/code&gt; to &lt;em&gt;not&lt;/em&gt; automatically update the revision buffer. If you do so you can still display the commit at point in the revision buffer by pressing either &lt;kbd&gt;RET&lt;/kbd&gt; or &lt;kbd&gt;SPC&lt;/kbd&gt;. The former makes the revision buffer the current buffer, the latter does not.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-16T12:38:43.630" LastActivityDate="2015-07-16T12:38:43.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14016" PostTypeId="2" ParentId="13985" CreationDate="2015-07-16T12:22:27.357" Score="28" Body="&lt;p&gt;Magit implements five &quot;apply variants&quot; &lt;a href=&quot;http://magit.vc/manual/magit/Applying.html&quot;&gt;described in the manual&lt;/a&gt;: stage, unstage, &quot;regular apply&quot;, discard, and reverse. The first three should be pretty obvious to most Git users. The latter two do not exist in the Git &lt;em&gt;porcelain&lt;/em&gt; (in Magit they are implemented using Git &lt;em&gt;plumbing&lt;/em&gt; commands and Emacs Lisp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These two variants are described like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Discard. On a staged change, remove it from the working tree and the index. On an unstaged change, remove it from the working tree only. &lt;/li&gt;&#xA;  &lt;li&gt;Reverse. Reverse a change in the working tree. Both committed and staged changes can be reversed. Unstaged changes cannot be reversed. Discard them instead.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;These two variants do very different things, so neither of these variants should fall back to the other variant in cases where itself cannot be used. Keeping the old behavior (of falling back from reverse to discard in some contexts) might have been more convenient in the short run, but in the long run it prevents users from really trying to understand what these two variants are for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Discard&lt;/em&gt; is much more dangerous than &lt;em&gt;reverse&lt;/em&gt;. The former &quot;throws away uncommitted changes&quot; (these changes are lost, they are not anywhere anymore), while the latter actually &quot;creates changes&quot;, by taking an older change and doing the opposite in the worktree (the old change is &lt;em&gt;not&lt;/em&gt; lost, it is still in a commit or the index).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Falling back from &quot;creating&quot; to &quot;deleting&quot; is very dangerous, so Magit doesn't do that anymore.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also note by using the new &lt;a href=&quot;http://magit.vc/manual/magit/Wip-Modes.html&quot;&gt;wip modes&lt;/a&gt; you can protect yourself from losing changes due to an accidental discard.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-07-16T12:41:22.637" LastActivityDate="2015-07-16T12:41:22.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14017" PostTypeId="1" AcceptedAnswerId="14042" CreationDate="2015-07-16T12:58:50.617" Score="4" ViewCount="1860" Body="&lt;p&gt;I switched to a new linter and on big files it causes flycheck to disable because it reports too many errors. I don't believe this is an issue with the linter as when I check the output in the terminal it seems to be legitimate flags. How can I increase the number of errors thrown by the linter before flycheck disables?&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-07-17T08:12:15.283" Title="Warning (flycheck): Syntax checker javascript-eslint reported too many errors (494) and is disable" Tags="|flycheck|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14019" PostTypeId="1" CreationDate="2015-07-16T13:26:57.347" Score="0" ViewCount="66" Body="&lt;p&gt;I'm trying to figure out why emacs is capturing C-; as C-_. I checked it using log-commands but also in a completely clean configuration I can open a file and it says &quot;No further undo information&quot; when I press it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using an abnt2 layout keyboard. Maybe that's it? How do I fix it?&lt;/p&gt;&#xA;" OwnerUserId="8932" LastActivityDate="2015-07-16T13:26:57.347" Title="Why is my C-; being captured as C-_? How to fix it?" Tags="|key-bindings|" AnswerCount="0" CommentCount="5" ClosedDate="2018-12-07T17:54:06.563" ContentLicense="CC BY-SA 3.0" />
  <row Id="14020" PostTypeId="2" ParentId="14010" CreationDate="2015-07-16T14:12:04.447" Score="1" Body="&#xA;&#xA;&lt;p&gt;The key binding is not set-up by default, it is a just a recommendation from &lt;code&gt;org-mode&lt;/code&gt;.  You need to add something like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init file, or &lt;code&gt;Preferences.el&lt;/code&gt; for Aquamacs.  In my init file I have&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key &quot;\C-cl&quot; 'org-store-link)&#xA;(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA;(global-set-key &quot;\C-cb&quot; 'org-iswitchb)&#xA;(global-set-key &quot;\C-cc&quot; 'org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Part of the reason for this is that &lt;code&gt;C-c&lt;/code&gt; sequences are meant to be reserved for user defined short cuts.  Without these definitions you can always type for example &lt;code&gt;M-x org-agenda&lt;/code&gt; to run the agenda command.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="115" LastEditDate="2015-07-16T15:04:29.410" LastActivityDate="2015-07-16T15:04:29.410" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14021" PostTypeId="1" AcceptedAnswerId="14070" CreationDate="2015-07-16T16:14:15.640" Score="2" ViewCount="465" Body="&lt;p&gt;I am trying to convert markdown to html and then use impatient-mode to display it live on browser on the fly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Impatient mode uses &lt;code&gt;after-change-hook&lt;/code&gt; to detect changes in html. I am using &lt;code&gt;after-change-hook&lt;/code&gt; to detect changes in markdown buffer.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Buffer changes made while executing the &lt;code&gt;after-change-functions&lt;/code&gt;&#xA;  don't call any before-change or after-change functions.&#xA;  That's because &lt;code&gt;inhibit-modification-hooks&lt;/code&gt; is temporarily set non-nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As documentation says it won't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can use timer to update every second but I am looking for a better solution.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2015-07-16T18:15:26.710" LastActivityDate="2015-07-18T13:57:16.433" Title="How to chain after-change-hook functions?" Tags="|buffers|hooks|markdown|buffer-modified|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14022" PostTypeId="2" ParentId="13990" CreationDate="2015-07-16T16:23:58.273" Score="0" Body="&lt;p&gt;I found out that the issue was that the nxml faces were inheriting from faces that were not defined in my theme (more accurately, they inherited from the default face) .  For example, the face &lt;code&gt;nxml-local-element-face&lt;/code&gt; inherits from &lt;code&gt;font-lock-function-name-face&lt;/code&gt;, which is set to blue by default, but in my color theme it was set to white.  So font-lock was working all along, I just couldn't tell because everything was displaying in the default face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the comment on EmacsWiki which I referred to in the question was just a red herring.  Customize the face &lt;code&gt;nxml-element-local-name&lt;/code&gt; and &lt;code&gt;nxml-text&lt;/code&gt; and font-lock should work just fine, even if you are using a custom theme.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2015-07-16T16:23:58.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14023" PostTypeId="2" ParentId="13989" CreationDate="2015-07-16T16:24:52.140" Score="2" Body="&lt;p&gt;A little bit of guesswork here, but I've found that turning off font-locking makes printing large output &lt;em&gt;much&lt;/em&gt; faster. On my system printing speed is tolerable with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-enable-font-lock nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and intolerably slow otherwise. Note that the python process needs to be restarted for this to take effect.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2015-07-16T16:24:52.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14024" PostTypeId="1" AcceptedAnswerId="14032" CreationDate="2015-07-16T16:28:12.760" Score="4" ViewCount="2257" Body="&lt;p&gt;I have created quite a few stashes and I wanted to drop all of them at once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From terminal I could have done &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git stash clear&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I couldn't find a way to do it from magit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried selecting all stashes and drop, but that didn't work.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-17T20:23:40.913" Title="Magit - How to drop all stashes at once?" Tags="|magit|git|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14025" PostTypeId="1" AcceptedAnswerId="14061" CreationDate="2015-07-16T16:39:44.703" Score="6" ViewCount="837" Body="&lt;p&gt;I'm trying to set the title of my emacs to how much work I've done in total. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get the time I've logged today programatically. (like when you open agenda and press 'R'). How do I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:  &lt;a href=&quot;https://emacs.stackexchange.com/questions/1035/how-can-i-see-total-time-today-on-all-projects-in-the-modeline&quot;&gt;(as per this link)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot; Today's total: %s &quot; (org-minutes-to-clocksum-string (org-clock-sum-today)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that returns 0:00 &lt;/p&gt;&#xA;" OwnerUserId="5350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-07-18T00:12:26.483" Title="how to get today's total logged time programatically?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14027" PostTypeId="1" CreationDate="2015-07-16T17:22:54.610" Score="2" ViewCount="200" Body="&lt;p&gt;I am using Aquamacs. I have used &lt;a href=&quot;https://pqrs.org/osx/karabiner/seil.html.en&quot; rel=&quot;nofollow&quot;&gt;Seil&lt;/a&gt; to change my caps lock key to emit key code 110. I would like to bind that code to super/hyper/another modifier so that I can create more key combinations. How can I do that? &lt;/p&gt;&#xA;" OwnerUserId="8934" LastEditorUserId="8934" LastEditDate="2015-07-16T18:07:36.713" LastActivityDate="2015-07-16T18:07:36.713" Title="How to bind a keycode to hyper key in Aquamacs" Tags="|key-bindings|keymap|keystrokes|aquamacs|prefix-keys|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14029" PostTypeId="1" AcceptedAnswerId="14885" CreationDate="2015-07-16T17:58:19.397" Score="3" ViewCount="1220" Body="&lt;p&gt;I've bound cmd-P in emacs to some function. It is working in emacs when I start the cocoa version but I can't make it work in console mode when running in iterm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made iTerm2 ignore the keystroke in Preferences-&gt;Profile-&gt;Default-&gt;Keys and it is no longer user by iTerm but looks like emacs in console is ignoring command key completely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to use console mode emacs in OsX using command as super?&lt;/p&gt;&#xA;" OwnerUserId="5247" LastEditorUserId="105" LastEditDate="2015-07-16T18:13:12.577" LastActivityDate="2015-08-20T00:48:37.807" Title="Making command act as super in iTerm2" Tags="|key-bindings|osx|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14030" PostTypeId="2" ParentId="14024" CreationDate="2015-07-16T18:15:43.593" Score="0" Body="&lt;p&gt;After browsing source code, I just wrote a function and it works fine&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun magit-stash-clear ()&#xA;  &quot;Magit - drop all stashes.&quot;&#xA;  (interactive)&#xA;  (magit-run-git &quot;stash&quot; &quot;clear&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-07-16T18:40:34.857" LastActivityDate="2015-07-16T18:40:34.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14031" PostTypeId="1" AcceptedAnswerId="14064" CreationDate="2015-07-16T18:21:25.993" Score="7" ViewCount="820" Body="&lt;p&gt;I have the feeling that Emacs Lisp macros are written in some different way than Common Lisp macros. This can't be true, but where is all the &lt;code&gt;gensym&lt;/code&gt; things? Recently I was writing a macro and I needed to avoid capturing a lexical variable, so I started searching for &lt;code&gt;gensym&lt;/code&gt; function. There is no such function! How can a Lisp that has macros don't have &lt;code&gt;gensym&lt;/code&gt;? Maybe it's handled differently in Emacs Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found &lt;code&gt;gensym&lt;/code&gt; in &lt;code&gt;cl-lib&lt;/code&gt;, that's already something. But what I really need is &lt;code&gt;with-gensyms&lt;/code&gt;. Do you know where can I find such a macro (third party package is fine if it's in ELPA or MELPA, although it should be built in Emacs by now, I think).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm ready to write these eight lines myself, but this sort of thing shouldn't be rewritten every time, IMHO.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: to make it clear: I'm searching for a way to get this once and for all, that's a library that contains it that I can depend upon. If you think it's OK to rewrite it everywhere every time developer needs it -- that's your point of view. If you vote to close the question simply because there is no such library and&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lisp hackers generally do what is practical for them, such as writing a small utility macro and leaving it at that&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;-- I think &lt;em&gt;your&lt;/em&gt; reasoning is fallacious. Lisp hackers generally don't like to redo something simply because &lt;em&gt;that's how people do it&lt;/em&gt;. They create what they need and then use it everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are quite a few different libraries that make life easier, and they often do &lt;em&gt;more trivial&lt;/em&gt; things. Yet when I ask for something that's useful but missing I get this typical answer &quot;well, don't you know, just copy paste it from Goggle because it isn't there&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course close this question, but IMHO it's normal question asking for certain tool that Emacs Lisp developer might find useful in some cases. If you don't know decent solution, that doesn't mean that the question is bad.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-17T19:55:00.993" LastActivityDate="2015-07-18T06:20:54.887" Title="Name of Emacs Lisp library that provides `with-gensyms' classic macro" Tags="|elisp|elisp-macros|" AnswerCount="3" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="14032" PostTypeId="2" ParentId="14024" CreationDate="2015-07-16T19:17:53.370" Score="4" Body="&lt;p&gt;This assumes that you are using Magit v2.1 or greater, and it very much sounds like you are using an older version. So start by updating Magit.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to drop more than one stash at a time, select all the stashes using the region and press &lt;kbd&gt;k&lt;/kbd&gt;. It will ask you if you want to &quot;drop N stashes?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to drop them all is by putting your cursor on the Stashes header and pressing &lt;kbd&gt;k&lt;/kbd&gt;. (If you want to delete &lt;em&gt;all&lt;/em&gt; stashes, then you should use this method, because it is more efficient than the other, which drops each stash individually.)&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="306" LastEditDate="2015-07-17T20:23:40.913" LastActivityDate="2015-07-17T20:23:40.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14033" PostTypeId="2" ParentId="14031" CreationDate="2015-07-16T19:59:38.473" Score="1" Body="&lt;p&gt;Your question appears to be only &quot;Where can I find &lt;code&gt;with-gensyms&lt;/code&gt;?&quot; If so, it should probably be closed, and in any case you seem to now have the answer, from Google. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the Emacs-Lisp way of doing things, the answer is &lt;strong&gt;&lt;code&gt;make-symbol&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in fact, &lt;code&gt;org-with-gensyms&lt;/code&gt;, which you mention, just uses &lt;code&gt;make-symbol&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro org-with-gensyms (symbols &amp;amp;rest body)&#xA;  `(let ,(mapcar (lambda (s)&#xA;                   `(,s (make-symbol (concat &quot;--&quot; (symbol-name ',s))))) symbols)&#xA;     ,@body))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-16T19:59:38.473" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14034" PostTypeId="2" ParentId="13805" CreationDate="2015-07-16T21:55:26.260" Score="12" Body="&lt;p&gt;I'm not sure how you could extract these to custom headers, but you can put raw ELISP in your header arguments. So, to conditionally tangle, you can simply put a check in your &lt;code&gt;:tangle&lt;/code&gt; argument like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle (when (eq system-type 'gnu/linux) &quot;yes&quot;)&#xA; (princ &quot;I DO THINGS! (But only on Linux.)&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the file gets tangled and the the ELISP expression &quot;&lt;code&gt;(eq system-type 'gnu/linux)&lt;/code&gt;&quot; is true, it will return &quot;&lt;code&gt;&quot;yes&quot;&lt;/code&gt;&quot;, which will tangle to the default file name for that language block. You can put a filename in there as well if you prefer it. If the condition returns &lt;code&gt;nil&lt;/code&gt;, the block does not get tangled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other system-types you can play around with are &quot;&lt;code&gt;windows-nt&lt;/code&gt;&quot; for some Windows OSes and &quot;&lt;code&gt;darwin&lt;/code&gt;&quot; for Mac OSX. Other system information (Including &quot;&lt;code&gt;emacs-version&lt;/code&gt;&quot; like you mentioned) can be fetched using the variables described on &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_determine_OS_version.html&quot; rel=&quot;noreferrer&quot;&gt;this page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If these header arguments become unwieldy, you can possibly have a section in your &lt;code&gt;.emacs&lt;/code&gt; where you define a few functions that only return a filename for specific system types. That way you simply need a single function call in your &lt;code&gt;:tangle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;While I'm still learning the ropes of Babel, I've read about the system-type, emacs-version, and window-system variables, which sound like they contain all the information I need to get the behavior I've described here. In fact, I could just wrap OS-specific code in conditionals when needed in code blocks. I'm wondering if this is the best way to go about this, however.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When it comes to your own config file, whatever is most comfortable for you is the best option... But there are other ways to approach your problem, for example, another possibility is to have something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA; ((eq system-type 'gnu-linux)&#xA;  (load &quot;linux.el&quot;))&#xA; ((eq system-type 'darwin)&#xA;  (load &quot;mac.el&quot;))&#xA; ((eq system-type 'windows-nt)&#xA;  (load &quot;windows.el&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...at the top of your &lt;code&gt;.org&lt;/code&gt; file, and have each platform-specific block have a tangle argument that points to their respective file... Like &quot;&lt;code&gt;:tangle windows.el&lt;/code&gt;&quot; for a piece of Windows-specific code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possible strategy is to create multiple &lt;code&gt;.org&lt;/code&gt; files for different systems, and to &lt;code&gt;(org-babel-load-file ...)&lt;/code&gt; the one for your system using the above variables in a &lt;code&gt;(cond ...)&lt;/code&gt; block like the one above. This way you can avoid any tangling logic altogether.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another possibility would be to only write platform-independent code in your Emacs config--and to keep system-specific tweaks in your &lt;code&gt;.emacs&lt;/code&gt;. (This is the way I do it.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I imagine this can be found somewhere in the documentation if it exists but I couldn't seem to find a comprehensive list of headers for code blocks. Thanks for any help you can provide!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There are header arguments in the Emacs info files. You can get there with &quot;&lt;code&gt;C-h i&lt;/code&gt;, &lt;code&gt;&quot;mOrg Mode&quot;&lt;/code&gt;, and then&lt;code&gt;&quot;mSpecific header arguments&quot;&lt;/code&gt;&quot;. It is also online &lt;a href=&quot;http://orgmode.org/manual/Specific-header-arguments.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also language specific header arguments and other information &lt;a href=&quot;http://orgmode.org/manual/Using-header-arguments.html#Using-header-arguments&quot; rel=&quot;noreferrer&quot;&gt;here.&lt;/a&gt;. (Which is also in the Info files.)&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2015-07-17T20:58:08.367" LastActivityDate="2015-07-17T20:58:08.367" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14035" PostTypeId="1" AcceptedAnswerId="14038" CreationDate="2015-07-16T23:53:35.950" Score="3" ViewCount="1840" Body="&lt;p&gt;Let's face it, the scroll bars for the graphical emacs are both ugly and, if you're sufficiently experienced, entirely unnecessary. Here's a picture of terminal emacs (which uses the &lt;code&gt;|&lt;/code&gt; character to separate horizontally aligned buffers) adjacent to the graphical emacs on OS X (which *&lt;em&gt;shudder&lt;/em&gt;* uses scroll bars:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/x4N1k.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is this: how can I get the graphical emacs to look more like the terminal emacs and eliminate the scroll bars? I don't need it to look exactly the same, but something closer than what I've got now would be rather nice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, I should also point out that simply using &lt;code&gt;(scroll-bar-mode -1)&lt;/code&gt; leaves me with an empty space where the scroll bar used to be, which I don't like. I still like to be able to see where one buffer ends and the other begins.&lt;/p&gt;&#xA;" OwnerUserId="8486" LastEditorUserId="253" LastEditDate="2015-09-28T14:13:36.153" LastActivityDate="2017-01-16T15:19:33.023" Title="Replace ugly scroll-bar with vertical line characters" Tags="|window|scroll-bars|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14036" PostTypeId="1" CreationDate="2015-07-17T00:55:06.867" Score="2" ViewCount="168" Body="&lt;p&gt;Running &lt;code&gt;M-x calendar&lt;/code&gt; shows three months calendar of Gregorian&#xA;calendar like below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KuqWo.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has also other calendars (Chinese, Hebrew, Julian, Mayan,&#xA;... ). How to show the three month calendar of these calendars like&#xA;Gregorian?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example for the &lt;code&gt;French year&lt;/code&gt; (just for example) I mean an output like below (which I created it by hand): Emacs know the names of Months of French year, I only written the abbreviation of the days of the week. Actually when the point is at today (e.g. 17 July 2015), running &lt;code&gt;M-x calendar-french-print-date&lt;/code&gt; gives &lt;code&gt;French Revolutionary date: 29 Messidor an 223 de la Révolution&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hJx1C.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; actually the month Messidor has only 30 days based on Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-07-17T02:01:49.183" LastActivityDate="2015-07-17T02:01:49.183" Title="How to show the three months calendar of non-Gregorian calendars?" Tags="|calendar|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14037" PostTypeId="2" ParentId="14035" CreationDate="2015-07-17T01:14:53.380" Score="4" Body="&lt;p&gt;Turn off scroll bars and customize option &lt;strong&gt;&lt;code&gt;default-frame-alist&lt;/code&gt;&lt;/strong&gt; to specify whatever you want for parameter&lt;code&gt;right-divider-width&lt;/code&gt; (and perhaps parameter &lt;code&gt;bottom-divider-width&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-17T01:14:53.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14038" PostTypeId="2" ParentId="14035" CreationDate="2015-07-17T01:35:00.383" Score="0" Body="&lt;p&gt;As it would turn out, my theme (the &lt;code&gt;spolsky-theme&lt;/code&gt; from the &lt;code&gt;sublime-themes&lt;/code&gt; package) made this vertical line disappear when the scroll bar was disabled. By changing to another theme (from the &lt;code&gt;color-theme-solarized&lt;/code&gt; package), the vertical bar reappears. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem solved.&lt;/p&gt;&#xA;" OwnerUserId="8486" LastActivityDate="2015-07-17T01:35:00.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14039" PostTypeId="1" AcceptedAnswerId="14053" CreationDate="2015-07-17T05:45:06.947" Score="2" ViewCount="288" Body="&lt;p&gt;I'm having an annoying problem with the indentation of lists when editing documents in rst-mode. This happens in Emacs 24 (even when starting with &lt;code&gt;-q&lt;/code&gt;), but not in Emacs 23.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if my document is (where &lt;code&gt;|&lt;/code&gt; indicates the cursor position)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* List Item|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I then enter &lt;code&gt;RET + &quot;* Bla&quot; + RET&lt;/code&gt;, I am getting this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* List Item&#xA;  * Bla&#xA;  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and after another &lt;code&gt;&quot;* Foo&quot; + RET&lt;/code&gt;, I am getting this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* List Item&#xA;  * Bla&#xA;* Foo&#xA;|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Surprisingly enough, I could not find any bug reports related to this. Is there anything wrong with my system? What is happening here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs 23 the final output is as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* List Item&#xA;* Bla&#xA;* Foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8357" LastActivityDate="2015-07-17T18:58:21.947" Title="List indentation problem in rst-mode" Tags="|indentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14040" PostTypeId="1" CreationDate="2015-07-17T06:19:50.973" Score="0" ViewCount="326" Body="&lt;p&gt;If I have a virtual machine, and I ssh into that machine, then start emacs: (so at this point I am  looking at my terminal emulator, which is showing the command line version of emacs on the other machine)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is it possible to get the things which need some visual-ness (such as the autocomplete popup menu or multiple cursors etc.)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2015-09-16T04:14:07.620" Title="Can I get the auto complete window when ssh'd into a server running emacs?" Tags="|eshell|ssh|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14041" PostTypeId="2" ParentId="14031" CreationDate="2015-07-17T07:01:00.363" Score="3" Body="&lt;p&gt;In my personal libraries, I also prefer to maintain a connection with Common Lisp idioms and syntax as much as possible, to avoid context switching. Of course, if I would develop public libraries I would try to avoid it. Common Lisp perspective seems not favoured by main Emacs developers, although I know a few representative ones that do favour &lt;code&gt;cl-lib&lt;/code&gt; parlance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, I use &lt;a href=&quot;https://github.com/dimitri/el-get&quot; rel=&quot;nofollow&quot;&gt;el-get&lt;/a&gt; to manage the external packages. &lt;code&gt;el-get&lt;/code&gt; allows to fecth directly from EmacsWiki. I have this in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(el-get-bundle macro-utils)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which nicely allows one to use &lt;code&gt;with-gensyms&lt;/code&gt;, as you asked, and also &lt;code&gt;once-only&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro double (x)&#xA;  (once-only (x)&#xA;    `(+ ,x ,x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="249" LastEditorUserId="10" LastEditDate="2015-07-17T09:08:43.727" LastActivityDate="2015-07-17T09:08:43.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14042" PostTypeId="2" ParentId="14017" CreationDate="2015-07-17T08:12:15.283" Score="8" Body="&lt;p&gt;From &lt;a href=&quot;http://www.flycheck.org/manual/latest/Reporting-results.html#Reporting-results&quot;&gt;Reporting results&lt;/a&gt; in the Flycheck manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To avoid flooding a buffer with excessive reports, Flycheck discards any reports and disables the corresponding syntax checker subsequently, if the total number of reported errors of any level exceeds the value of &lt;code&gt;flycheck-checker-error-threshold&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And then, from the docstring of this variable:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;flycheck-checker-error-threshold is a variable defined in ‘flycheck.el’.&#xA;  Its value is 400&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This variable may be risky if used as a file-local variable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Maximum errors allowed per syntax checker.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The value of this variable is either an integer denoting the&#xA;  maximum number of errors per syntax checker and buffer, or nil to&#xA;  not limit the errors reported from a syntax checker.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If this variable is a number and a syntax checker reports more&#xA;  errors than the value of this variable, its errors are not&#xA;  discarded, and not highlighted in the buffer or available in the&#xA;  error list.  The affected syntax checker is also disabled for&#xA;  future syntax checks of the buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Be aware, though, that this limit is there for a reason:  An excessive amount of errors renders error navigation and the error list almost useless, and causes a noticeable lag during highlighting and parsing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flycheck is really trying to tell you here, that on-the-fly syntax checking doesn't make much sense for files that report over 400 errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speaking as the Flycheck maintainer, I would really recommend you to leave the limit as is, and instead change the configuration of the linter that you use to disable lints that that cause many errors.  You can't reasonably handle 400 errors anyway, so there's no use in leaving aggressive linters enabled.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-07-17T08:12:15.283" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14043" PostTypeId="1" AcceptedAnswerId="19839" CreationDate="2015-07-17T08:21:52.863" Score="11" ViewCount="1965" Body="&lt;p&gt;I would like to build a very minimal variant of Emacs trunk for unit-testing my Emacs Lisp package.  The build needs no GUI, no image support, etc.  It should should essentially just be a minimal Emacs Lisp interpreter with the core Emacs Lisp libraries, and it should build &lt;strong&gt;fast&lt;/strong&gt;, ideally in less than five minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I'm passing &lt;code&gt;--with-x-toolkit=no --without-x --without-all&lt;/code&gt; to &lt;code&gt;./configure&lt;/code&gt;.  After it has finished, it tells me that all Emacs features are disabled, but unfortunately the build still takes almost &lt;strong&gt;ten minutes&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that it might be impossible to get Emacs build faster, but what makes me wonder is that with the &lt;em&gt;very same flags&lt;/em&gt; Emacs 24.5 builds in just about &lt;strong&gt;two minutes&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the reason for this gross difference, and can I get Emacs trunk to build as fast as Emacs 24.5?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, in a related question, how to I get Emacs to build quietly?  Currently almost 80% of my unit test output is Emacs building.  Ideally, I'd like to have &lt;code&gt;make install&lt;/code&gt; printing no output at all.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-01-26T05:31:00.590" Title="Build a minimal Emacs 25 for unit testing" Tags="|build|emacs24|emacs-snapshot|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14044" PostTypeId="2" ParentId="14040" CreationDate="2015-07-17T09:01:40.137" Score="0" Body="&lt;p&gt;Yes.  Most of the Emacs UI can be represented in textual terminals.  Images, squiggly lines and advanced display engine features (like pixel-perfect positioning) don't work though.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-17T09:01:40.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14045" PostTypeId="2" ParentId="14040" CreationDate="2015-07-17T09:01:55.403" Score="1" Body="&lt;p&gt;Maybe you give Tramp a try? Then you could work on the virtual machine, using your local Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-07-17T09:01:55.403" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14047" PostTypeId="2" ParentId="8121" CreationDate="2015-07-17T09:28:57.477" Score="2" Body="&lt;p&gt;You might be interested in &lt;a href=&quot;https://github.com/davidshepherd7/electric-operator&quot; rel=&quot;nofollow&quot;&gt;electric-operator&lt;/a&gt;, it's a fairly general minor mode for adding spacing around operators (mostly for programming modes, but it works in text modes as well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't look at what you typed after the operator though, so it can't currently handle the &quot;add a space only if I didn't already type one&quot; part of your question.&lt;/p&gt;&#xA;" OwnerUserId="237" LastActivityDate="2015-07-17T09:28:57.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14048" PostTypeId="2" ParentId="13758" CreationDate="2015-07-17T09:48:06.953" Score="6" Body="&lt;pre&gt;&lt;code&gt;# -*- mode:org; epa-file-encrypt-to: (&amp;quot;arthur@ul___dt.com&amp;quot; &amp;quot;foo@bar.baz&amp;quot;) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When a mail address is associated to several keys switch to the key ids.  E.g. a call to &lt;code&gt;epa-file-select-keys&lt;/code&gt; reveals key ids.  The header line with fake key ids looks like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode:org; epa-file-encrypt-to: (&amp;quot;12345678ABCDEF00&amp;quot; &amp;quot;12345678ABCDEF01&amp;quot;) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I have not found a syntax-definition for variable epa-file-encrypt-to.  I guess it's supposed to be a list containing identifiers for keys as they can be understood by the gpg program.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastEditorUserId="8943" LastEditDate="2020-12-02T23:25:54.913" LastActivityDate="2020-12-02T23:25:54.913" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="14049" PostTypeId="1" AcceptedAnswerId="14052" CreationDate="2015-07-17T09:53:58.520" Score="12" ViewCount="7980" Body="&lt;p&gt;I often do some testing implementation with hardcoded values which I later want to change. Like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ref = open('specific-file-name')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which I would like to change into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ref = open(fname)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm used to vim and there I can type &lt;code&gt;ci(fname&lt;/code&gt; assuming that point is inside the brackets. (&lt;code&gt;ci(&lt;/code&gt; stands for replace inner brackets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve something like 'replace inner ' in emacs? &lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="115" LastEditDate="2015-07-17T13:11:45.630" LastActivityDate="2017-08-28T10:24:23.317" Title="Replace text inside various delimiters (eg: brackets, quotes)" Tags="|text-editing|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14050" PostTypeId="2" ParentId="14049" CreationDate="2015-07-17T10:32:56.210" Score="5" Body="&lt;h2&gt;With a region&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To do this with a region, starting from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ref = open(|'specific-file-name');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;press &lt;kbd&gt;C-SPC C-b C-M-n C-b C-w&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Faster way&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Starting from the point before paren, just like in Vim:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ref = open|('specific-file-name');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-M-k&lt;/kbd&gt; (&lt;code&gt;kill-sexp&lt;/code&gt;) will result in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ref = open|;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you have &lt;code&gt;electric-pair-mode&lt;/code&gt; on, you can re-insert &lt;code&gt;()&lt;/code&gt; with only &lt;kbd&gt;(&lt;/kbd&gt;.&#xA;So the full key sequence is &lt;kbd&gt;C-M-k (&lt;/kbd&gt; - not much longer than &lt;kbd&gt;ci(&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-17T10:32:56.210" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14051" PostTypeId="2" ParentId="14049" CreationDate="2015-07-17T10:44:50.890" Score="1" Body="&lt;p&gt;&lt;code&gt;evil&lt;/code&gt; emulates most of Vim, and it does text objects out of the box.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, with &lt;code&gt;evil&lt;/code&gt; activated and using the default key bindings, &lt;code&gt;ci(&lt;/code&gt; will do exactly what you're asking: change what's inside the enclosing parentheses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely, &lt;code&gt;ci(&lt;/code&gt; will chain &lt;code&gt;evil-change&lt;/code&gt; to &lt;code&gt;evil-inner-paren&lt;/code&gt;.  You can also create your own arbitrary text objects as you like.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-17T10:44:50.890" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14052" PostTypeId="2" ParentId="14049" CreationDate="2015-07-17T13:08:40.577" Score="13" Body="&lt;h2&gt;Using &lt;code&gt;expand-region&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;I would recommend installing the &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;expand-region&lt;/code&gt;&lt;/a&gt; package (available on Melpa too). It would be useful for editing situations mentioned in your example and lot more.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;expand-region&lt;/code&gt; is intelligent. Based on the major mode, it will try to figure out what you are trying to select. I don't know from which language you have the example snippet so I will use your example code snippet and slightly modify it for Python (remove ;). So my below explanation is with the below code snippet in a &lt;code&gt;python-mode&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-py prettyprint-override&quot;&gt;&lt;code&gt;ref = open('specific-file-name') &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;If point is next to a single quote&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;The black vertical rectangles below indicate how the cursor will look.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# point on left of left quote, the cursor is hiding the quote under it&#xA;ref = open(▮specific-file-name') &#xA;&#xA;# point on left of right parenthesis, the cursor is hiding the parenthesis under it       &#xA;ref = open('specific-file-name'▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In either case, when you do &lt;code&gt;M-x er/expand-region&lt;/code&gt;, &lt;code&gt;'specific-file-name'&lt;/code&gt; will get selected and you can then hit &lt;code&gt;DEL&lt;/code&gt; (or backspace) to delete the selection.&lt;/p&gt;&#xA;&lt;p&gt;If you have &lt;code&gt;delete-selection-mode&lt;/code&gt; enabled (I like to have that enabled personally), you can start typing away after doing the selection and that will overwrite the selection.&lt;/p&gt;&#xA;&lt;p&gt;Of course, if you use &lt;code&gt;er/expand-region&lt;/code&gt; a lot, you would bind it to a short key binding. I like to bind it to &lt;code&gt;C-\&lt;/code&gt;. So with point next to a single quote: &lt;strong&gt;&lt;code&gt;C-\fname&lt;/code&gt;&lt;/strong&gt; will give me &lt;code&gt;ref = open(fname);&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/3mZg2.gif&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;If point is somewhere inside the quotes&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Using &lt;code&gt;expand-region&lt;/code&gt;, the point does not need to be near the quotes. But in this case, you will need just few more (usually one or two more) key strokes.&lt;/p&gt;&#xA;&lt;p&gt;Let's say the cursor position is as below now:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# cursor shown below is hiding the i character under it&#xA;ref = open('specif▮c-file-name')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Using the same binding as I used above:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First time I hit &lt;code&gt;C-\&lt;/code&gt; will select &lt;code&gt;specific&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now I just need to hit &lt;code&gt;\&lt;/code&gt; to expand the selection (&lt;code&gt;expand-region&lt;/code&gt; feature). That will select &lt;code&gt;specific-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;If you had bound &lt;code&gt;er/expand-region&lt;/code&gt; to &lt;code&gt;C-=&lt;/code&gt;, hitting &lt;code&gt;=&lt;/code&gt; again will do the incremental expansion. Read its documentation on how to binding keys for incremental expansion/contraction of selection.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hitting &lt;code&gt;\&lt;/code&gt; once more will select &lt;code&gt;'specific-file-name'&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now you proceed with hitting &lt;code&gt;DEL&lt;/code&gt; to delete the selection and then type &lt;code&gt;fname&lt;/code&gt;. &lt;em&gt;If &lt;code&gt;delete-selection-mode&lt;/code&gt; is enabled, you can skip the &lt;code&gt;DEL&lt;/code&gt; stroke.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In summary, with &lt;code&gt;delete-selection-mode&lt;/code&gt; enabled, the key strokes look like: &lt;strong&gt;&lt;code&gt;C-\\\fname&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Hmlu0.gif&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Using &lt;code&gt;change-inner&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;I also came across &lt;a href=&quot;https://github.com/magnars/change-inner.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;change-inner&lt;/code&gt;&lt;/a&gt; package by the &lt;code&gt;expand-region&lt;/code&gt; author &lt;a href=&quot;https://github.com/magnars&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;magnars&lt;/strong&gt;&lt;/a&gt; (which uses &lt;code&gt;expand-region&lt;/code&gt; as back-end) to do exactly what the Vim &lt;code&gt;ci&lt;/code&gt; does (and also &lt;em&gt;change outer&lt;/em&gt;).&lt;/p&gt;&#xA;&lt;p&gt;From the package README:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;change-inner&lt;/code&gt; gives you vim's &lt;code&gt;ci&lt;/code&gt; command, building on &lt;code&gt;expand-region&lt;/code&gt;. It is most easily explained by example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;function test() {&#xA;  return &amp;quot;semantic kill&amp;quot;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With point after the word &lt;em&gt;semantic&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;change-inner &amp;quot;&lt;/code&gt; would kill the contents of the string&lt;br /&gt;&#xA;&lt;code&gt;change-outer &amp;quot;&lt;/code&gt; would kill the entire string&lt;br /&gt;&#xA;&lt;code&gt;change-inner {&lt;/code&gt; would kill the return-statement&lt;br /&gt;&#xA;&lt;code&gt;change-outer {&lt;/code&gt; would kill the entire block&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-17T13:18:16.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14053" PostTypeId="2" ParentId="14039" CreationDate="2015-07-17T18:58:21.947" Score="4" Body="&lt;p&gt;The effect you are seeing are, most likely, caused by &lt;code&gt;electric-indent-mode&lt;/code&gt;, a new mode which is active by default in Emacs 24.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I said &quot;most likely&quot; since I'm not seeing the same indentation as you describe. In my system, running Emacs 24.5, the line after a bullet is always indented.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, to disable this for &lt;code&gt;rst-mode&lt;/code&gt;, you can place the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-rst-mode-hook ()&#xA;  (electric-indent-local-mode -1))&#xA;(add-hook 'rst-mode-hook #'my-rst-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To disable this for all modes, you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(electric-indent-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this minor mode does not follow the normal minor mode naming convention of using &lt;code&gt;xyz-mode&lt;/code&gt; and &lt;code&gt;zxy-global-mode&lt;/code&gt;. Instead, &lt;code&gt;electric-indent-local-mode&lt;/code&gt; is the buffer local mode and &lt;code&gt;electric-indent-mode&lt;/code&gt; is the &lt;em&gt;global&lt;/em&gt; mode.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-07-17T18:58:21.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14054" PostTypeId="1" CreationDate="2015-07-17T19:37:00.553" Score="2" ViewCount="534" Body="&lt;p&gt;I am trying out &lt;a href=&quot;http://orgmode.org/manual/Orgstruct-mode.html&quot; rel=&quot;nofollow&quot;&gt;orgstruct-mode&lt;/a&gt; with &lt;code&gt;python-mode&lt;/code&gt; (but I've also tried &lt;code&gt;go-mode&lt;/code&gt; with the same result). If I enable &lt;code&gt;orgstruct-mode&lt;/code&gt; and press &lt;kbd&gt;S-TAB&lt;/kbd&gt; I get the error &lt;em&gt;S- must prefix a single character, not ISO-leftTAB&lt;/em&gt;. I would have expected this to cycle the visibility of all the functions in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I put the point on a &lt;code&gt;def foo&lt;/code&gt; function and do &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;org-cycle&lt;/code&gt; the the function is correctly folded and unfolded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Checking the binding of &lt;kbd&gt;S-TAB&lt;/kbd&gt; in the python buffer, it is: &lt;code&gt;&amp;lt;S-iso-lefttab&amp;gt; runs the command orgstruct-hijacker-org-shifttab-2&lt;/code&gt;, who's doc mentions: &lt;em&gt;In Structure, run &lt;code&gt;org-shifttab&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;org-shifttab&lt;/code&gt; it correctly folds up all the functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried updating all my packages (including &lt;code&gt;org&lt;/code&gt; from melpa), and I've tried running &lt;code&gt;emacs -q&lt;/code&gt; - same result. Emacs 24.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug or am I doing something stupid? Does anyone use orgstruct in a prog-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a backtrce:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;S- must prefix a single character, not iso-leftTAB&quot;)&#xA;  signal(error (&quot;S- must prefix a single character, not iso-leftTAB&quot;))&#xA;  error(&quot;%s must prefix a single character, not %s&quot; &quot;S-&quot; &quot;iso-leftTAB&quot;)&#xA;  edmacro-parse-keys(&quot;S-iso-leftTAB&quot; nil)&#xA;  read-kbd-macro(&quot;S-iso-leftTAB&quot;)&#xA;  (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key)))))&#xA;  (progn (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key))))))&#xA;  (if rep (progn (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key)))))))&#xA;  (when rep (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key))))))&#xA;  (while --dolist-tail-- (setq rep (car --dolist-tail--)) (when rep (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key)))))) (when (key-binding key) (throw (quote exit) (key-binding key))) (setq --dolist-tail-- (cdr --dolist-tail--)))&#xA;  (let ((--dolist-tail-- (quote (nil (&quot;&amp;lt;\\([^&amp;gt;]*\\)tab&amp;gt;&quot; . &quot;\\1TAB&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)return&amp;gt;&quot; . &quot;\\1RET&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)escape&amp;gt;&quot; . &quot;\\1ESC&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)delete&amp;gt;&quot; . &quot;\\1DEL&quot;)))) rep) (while --dolist-tail-- (setq rep (car --dolist-tail--)) (when rep (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key)))))) (when (key-binding key) (throw (quote exit) (key-binding key))) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq rep nil) nil)&#xA;  (catch (quote --cl-block-nil--) (let ((--dolist-tail-- (quote (nil (&quot;&amp;lt;\\([^&amp;gt;]*\\)tab&amp;gt;&quot; . &quot;\\1TAB&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)return&amp;gt;&quot; . &quot;\\1RET&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)escape&amp;gt;&quot; . &quot;\\1ESC&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)delete&amp;gt;&quot; . &quot;\\1DEL&quot;)))) rep) (while --dolist-tail-- (setq rep (car --dolist-tail--)) (when rep (setq key (read-kbd-macro (let (...) (replace-regexp-in-string ... ... ...))))) (when (key-binding key) (throw (quote exit) (key-binding key))) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq rep nil) nil))&#xA;  (cl--block-wrapper (catch (quote --cl-block-nil--) (let ((--dolist-tail-- (quote (nil (&quot;&amp;lt;\\([^&amp;gt;]*\\)tab&amp;gt;&quot; . &quot;\\1TAB&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)return&amp;gt;&quot; . &quot;\\1RET&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)escape&amp;gt;&quot; . &quot;\\1ESC&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)delete&amp;gt;&quot; . &quot;\\1DEL&quot;)))) rep) (while --dolist-tail-- (setq rep (car --dolist-tail--)) (when rep (setq key (read-kbd-macro (let ... ...)))) (when (key-binding key) (throw (quote exit) (key-binding key))) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq rep nil) nil)))&#xA;  (cl-block nil (let ((--dolist-tail-- (quote (nil (&quot;&amp;lt;\\([^&amp;gt;]*\\)tab&amp;gt;&quot; . &quot;\\1TAB&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)return&amp;gt;&quot; . &quot;\\1RET&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)escape&amp;gt;&quot; . &quot;\\1ESC&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)delete&amp;gt;&quot; . &quot;\\1DEL&quot;)))) rep) (while --dolist-tail-- (setq rep (car --dolist-tail--)) (when rep (setq key (read-kbd-macro (let (...) (replace-regexp-in-string ... ... ...))))) (when (key-binding key) (throw (quote exit) (key-binding key))) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq rep nil) nil))&#xA;  (dolist (rep (quote (nil (&quot;&amp;lt;\\([^&amp;gt;]*\\)tab&amp;gt;&quot; . &quot;\\1TAB&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)return&amp;gt;&quot; . &quot;\\1RET&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)escape&amp;gt;&quot; . &quot;\\1ESC&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)delete&amp;gt;&quot; . &quot;\\1DEL&quot;))) nil) (when rep (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key)))))) (when (key-binding key) (throw (quote exit) (key-binding key))))&#xA;  (catch (quote exit) (dolist (rep (quote (nil (&quot;&amp;lt;\\([^&amp;gt;]*\\)tab&amp;gt;&quot; . &quot;\\1TAB&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)return&amp;gt;&quot; . &quot;\\1RET&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)escape&amp;gt;&quot; . &quot;\\1ESC&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)delete&amp;gt;&quot; . &quot;\\1DEL&quot;))) nil) (when rep (setq key (read-kbd-macro (let ((case-fold-search)) (replace-regexp-in-string (car rep) (cdr rep) (key-description key)))))) (when (key-binding key) (throw (quote exit) (key-binding key)))))&#xA;  (let ((key [S-iso-lefttab])) (catch (quote exit) (dolist (rep (quote (nil (&quot;&amp;lt;\\([^&amp;gt;]*\\)tab&amp;gt;&quot; . &quot;\\1TAB&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)return&amp;gt;&quot; . &quot;\\1RET&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)escape&amp;gt;&quot; . &quot;\\1ESC&quot;) (&quot;&amp;lt;\\([^&amp;gt;]*\\)delete&amp;gt;&quot; . &quot;\\1DEL&quot;))) nil) (when rep (setq key (read-kbd-macro (let (...) (replace-regexp-in-string ... ... ...))))) (when (key-binding key) (throw (quote exit) (key-binding key))))))&#xA;  (let* ((orgstruct-mode) (binding (let ((key [S-iso-lefttab])) (catch (quote exit) (dolist (rep (quote ...) nil) (when rep (setq key ...)) (when (key-binding key) (throw ... ...))))))) (if (keymapp binding) (org-set-transient-map binding) (let ((func (or binding (unless disable (quote orgstruct-error))))) (when func (call-interactively func)))))&#xA;  (if fallback (let* ((orgstruct-mode) (binding (let ((key [S-iso-lefttab])) (catch (quote exit) (dolist (rep ... nil) (when rep ...) (when ... ...)))))) (if (keymapp binding) (org-set-transient-map binding) (let ((func (or binding (unless disable ...)))) (when func (call-interactively func))))) (org-run-like-in-org-mode (lambda nil (interactive) (let* ((org-heading-regexp (concat &quot;^&quot; orgstruct-heading-prefix-regexp &quot;\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[        ]*$&quot;)) (org-outline-regexp (concat orgstruct-heading-prefix-regexp &quot;\\*+ &quot;)) (org-outline-regexp-bol (concat &quot;^&quot; org-outline-regexp)) (outline-regexp org-outline-regexp) (outline-heading-end-regexp &quot;\n&quot;) (outline-level (quote org-outline-level)) (outline-heading-alist)) (call-interactively (quote org-shifttab))))))&#xA;  (let* ((disable nil) (fallback (or disable (not (let* ((org-heading-regexp ...) (org-outline-regexp ...) (org-outline-regexp-bol ...) (outline-regexp org-outline-regexp) (outline-heading-end-regexp &quot;\n&quot;) (outline-level ...) (outline-heading-alist)) (org-context-p (quote headline) (quote item) nil)))))) (if fallback (let* ((orgstruct-mode) (binding (let ((key [S-iso-lefttab])) (catch (quote exit) (dolist ... ... ...))))) (if (keymapp binding) (org-set-transient-map binding) (let ((func (or binding ...))) (when func (call-interactively func))))) (org-run-like-in-org-mode (lambda nil (interactive) (let* ((org-heading-regexp (concat &quot;^&quot; orgstruct-heading-prefix-regexp &quot;\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[     ]*$&quot;)) (org-outline-regexp (concat orgstruct-heading-prefix-regexp &quot;\\*+ &quot;)) (org-outline-regexp-bol (concat &quot;^&quot; org-outline-regexp)) (outline-regexp org-outline-regexp) (outline-heading-end-regexp &quot;\n&quot;) (outline-level (quote org-outline-level)) (outline-heading-alist)) (call-interactively (quote org-shifttab)))))))&#xA;  orgstruct-hijacker-org-shifttab-2(1)&#xA;  call-interactively(orgstruct-hijacker-org-shifttab-2 nil nil)&#xA;  command-execute(orgstruct-hijacker-org-shifttab-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8947" LastEditorUserId="8947" LastEditDate="2015-07-17T19:49:16.333" LastActivityDate="2015-07-17T19:49:16.333" Title="orgstruct-mode error: S- must prefix a single character, not ISO-leftTAB" Tags="|org-mode|outline|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14055" PostTypeId="1" CreationDate="2015-07-17T21:04:59.653" Score="7" ViewCount="1297" Body="&lt;p&gt;I want to use emacsclient to open files from Thunar in Linux Mint 17 xfce.&#xA;I have tried right-click+&quot;open with other application&quot;+&quot;emacsclient -c&quot;, but this does nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried writing a custom emacsclient.desktop launcher.&#xA;Emacs daemon is running and works when emacsclient is invoked from the terminal. Also, using just &quot;emacs&quot; as the preferred program works.&#xA;Can this be done in Thunar?&lt;/p&gt;&#xA;" OwnerUserId="8949" LastActivityDate="2015-09-16T09:14:08.380" Title="How to open a file with emacsclient from Thunar?" Tags="|emacsclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14056" PostTypeId="1" AcceptedAnswerId="14057" CreationDate="2015-07-17T21:17:29.063" Score="1" ViewCount="1605" Body="&lt;p&gt;How do I set up Hunspell so that I can add new UTF-8 words (e.g. &quot;Rúdi&quot;) to my user local dictionary? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a function that allows me to add new words to my local dictionary. It works for adding new words that don't contain UTF-8 characters. But if a word contains a UTF-8 character, Flyspell doesn't remember that the newly added word is correctly spelled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(executable-find &quot;hunspell&quot;) &#xA;(setq-default ispell-program-name &quot;hunspell&quot;)&#xA;(setq ispell-really-hunspell t) &#xA;(setq flyspell-default-dictionary &quot;en_US&quot;)&#xA;&#xA;(setq ispell-dictionary &quot;en_US&quot;)&#xA;(setq ispell-program-name &quot;/usr/local/bin/hunspell&quot;)&#xA;(setenv &quot;DICTIONARY&quot; &quot;en_US&quot;)&#xA;&#xA;&#xA;(setq ispell-program-name &quot;hunspell&quot;)&#xA;(eval-after-load &quot;ispell&quot;&#xA;  '(progn (defun ispell-get-coding-system () 'utf-8)))&#xA;&#xA;(setq ispell-local-dictionary-alist '((&quot;en_US&quot; &quot;[[:alpha:]]&quot; &quot;[^[:alpha:]]&quot; &quot;[']&quot; nil nil nil utf-8))) &#xA;&#xA;(setq ispell-extra-args '(&quot;-d en_US&quot;))&#xA;&#xA;(flyspell-mode-on)&#xA;&#xA;(defun add-word-to-personal-dictionary ()&#xA;  (interactive)&#xA;  (let ((current-location (point))&#xA;        (word (flyspell-get-word)))&#xA;    (when (consp word)&#xA;      (flyspell-do-correct 'save nil (car word) current-location (cadr word) (caddr word) current-location))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it matters, I'm running Hunspell 1.3.3 on OSX Yosemite.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorDisplayName="user227" LastEditDate="2015-09-11T07:30:49.540" LastActivityDate="2015-11-10T07:52:57.107" Title="how to add new UTF-8 words to Hunspell's user custom dictionary?" Tags="|ispell|flyspell|utf-8|hunspell|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14057" PostTypeId="2" ParentId="14056" CreationDate="2015-07-17T21:23:55.860" Score="0" Body="&lt;p&gt;Solved. The problem was that in my dictionary file, en_US.aff, the first line incorrectly said &lt;code&gt;SET UTF8&lt;/code&gt;. I corrected it to read &lt;code&gt;SET UTF-8&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-07-17T21:23:55.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14058" PostTypeId="1" CreationDate="2015-07-17T23:08:11.517" Score="3" ViewCount="532" Body="&#xA;&#xA;&lt;h2&gt;My setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs GUI (version 24.4.51.1 (x86_64-w64-mingw32) &#xA;                       &lt;a href=&quot;https://bitbucket.org/Haroogan/emacs-for-windows/&quot; rel=&quot;nofollow&quot;&gt;compiled from Harroogan Emacs.&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I would like to type a word in PHP-mode, and it will automatically expand to a proper word. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I would like to type &lt;code&gt;$session&lt;/code&gt; and he will expand it to &lt;code&gt;$_SESSION&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When reading the &lt;a href=&quot;http://www.emacswiki.org/emacs/AbbrevMode&quot; rel=&quot;nofollow&quot;&gt;manual about Abbrev mode&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;Type the word you want to use as expansion, and then type ‘C-x a g’ and the abbreviation for it. Example:&#xA;&#xA;    t h e C-x a g t e h RET&#xA;&#xA;Unfortunately, if you wanted to abbreviate Read The Fine Manual with RTFM, you couldn’t just type C-x a g after “Read the Fine Manual&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I put the cursor behind the word &lt;code&gt;$_SESSION&lt;/code&gt;, then &lt;code&gt;C-x a g&lt;/code&gt; and type $session. But I notice it will only expand &lt;code&gt;session&lt;/code&gt; to &lt;code&gt;SESSION&lt;/code&gt; without the underhyphen or the dollar variable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm looking in the &lt;code&gt;.abbrev_defs&lt;/code&gt; with &lt;code&gt;M-x edit-abbrevs&lt;/code&gt;, then the following is mentioned: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-abbrev-table)&#xA;&#xA;&quot;session&quot;    0    &quot;SESSION&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I try to change it to&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;&quot;session&quot;      2    &quot;$_SESSION&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And save it with &lt;code&gt;M-x write-abbrev-file&lt;/code&gt;, it didn't help. Maybe the abbrev uses regexp (?), thuis excluding the dollar sign. Any another suggestion?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-09-12T12:20:20.130" Title="How to use abbrev for words with dollar-sign ($) as prefix?" Tags="|abbrev|dabbrev|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14059" PostTypeId="1" AcceptedAnswerId="14062" CreationDate="2015-07-17T23:36:46.507" Score="4" ViewCount="1413" Body="&lt;p&gt;I don't know what change in my configuration caused this, but scratch buffer always starts in &lt;code&gt;fundamental-mode&lt;/code&gt;. I would like to have &lt;code&gt;emacs-lisp-mode&lt;/code&gt; in the scratch buffer. I tried to do&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq initial-major-mode 'emacs-lisp-mode) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it didn't help. How can I investigate the cause of this?&lt;/p&gt;&#xA;" OwnerUserId="8951" LastEditorUserId="105" LastEditDate="2016-11-12T03:13:35.893" LastActivityDate="2016-11-12T03:13:35.893" Title="Scratch always starts in fundamental mode" Tags="|init-file|major-mode|scratch-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14061" PostTypeId="2" ParentId="14025" CreationDate="2015-07-17T23:59:55.120" Score="4" Body="&lt;p&gt;&lt;code&gt;org-clock-sum-today&lt;/code&gt; only gets clock data from the buffer that Emacs is currently visiting, &lt;code&gt;(set-buffer &quot;test.org&quot;)&lt;/code&gt; in the linked example.  I came up with this based on &lt;code&gt;org-dblock-write:clocktable&lt;/code&gt; in &lt;code&gt;org-clock&lt;/code&gt;, maybe it will work for you?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eqyiel-org-clock-sum-today ()&#xA;  &quot;Visit each file in `org-agenda-files' and return the total time of today's&#xA;clocked tasks in minutes.&quot;&#xA;  (let ((files (org-agenda-files))&#xA;        (total 0))&#xA;    (org-agenda-prepare-buffers files)&#xA;    (dolist (file files)&#xA;      (with-current-buffer (find-buffer-visiting file)&#xA;        (setq total (+ total (org-clock-sum-today)))))&#xA;    total))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8884" LastEditorUserId="8884" LastEditDate="2015-07-18T00:12:26.483" LastActivityDate="2015-07-18T00:12:26.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14062" PostTypeId="2" ParentId="14059" CreationDate="2015-07-18T01:30:55.567" Score="7" Body="&lt;p&gt;Check the value of option &lt;code&gt;initial-major-mode&lt;/code&gt;: &lt;code&gt;M-x customize-option RET initial-major-mode RET&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Its default value is &lt;code&gt;lisp-interaction-mode&lt;/code&gt;, which puts &lt;code&gt;*scratch*&lt;/code&gt; in that mode.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;C-h v initial-major-mode&lt;/code&gt; tells you this:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Major mode command symbol to use for the initial &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So remove the customization that changed its value from the default value. In buffer &lt;code&gt;*Customize Option: Initial Major Mode*&lt;/code&gt;, click the &lt;code&gt;State&lt;/code&gt; button and choose the menu item that reverts the option to its standard value.&lt;/p&gt;&#xA;&lt;p&gt;You say that you tried just using &lt;code&gt;setq&lt;/code&gt; to change the value, presumably in your init file.  Using Customize instead, and reverting to the default value, instead of setting and saving the standard value, might help.&lt;/p&gt;&#xA;&lt;p&gt;Beyond that, it is possible that something in your init file is changing the value of the option later on. To find it, recursively bisect your init file (by commenting out 1/2, then 3/4, 7/8, 15/16,...) until you find the tiny part that causes the problem. If it's not obvious then how to fix it, report what you found here.  You can comment out a region of your init file by selecting it and using command &lt;code&gt;comment-region&lt;/code&gt;.  With &lt;code&gt;C-u&lt;/code&gt; the command uncomments the region.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-18T01:37:06.103" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14063" PostTypeId="1" CreationDate="2015-07-18T02:04:30.233" Score="2" ViewCount="382" Body="&lt;p&gt;I am new to gnu Emacs and have a question.  I created an M file to run in Matlab and I got it working fine.  My question is, is there a way to compile my code in the Emacs editor or test out my program?  I tried the to use the &quot;make&quot; command and it gave me this error: Compilation exited abnormally with code.  Thank you in advance for your help.&lt;/p&gt;&#xA;" OwnerUserId="8953" LastActivityDate="2015-12-12T14:42:25.273" Title="Compile Matlab Code" Tags="|compilation|programming|matlab|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14064" PostTypeId="2" ParentId="14031" CreationDate="2015-07-18T06:20:54.887" Score="6" Body="&lt;p&gt;Take a look at &lt;a href=&quot;https://github.com/mrkkrp/mmt&quot;&gt;Missing Macro Tools&lt;/a&gt;. It's available on MELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package provides the following classics:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;mmt-gensym&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;mmt-make-gensym-list&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;mmt-with-gensyms&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;mmt-with-unique-names&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;mmt-once-only&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-18T06:20:54.887" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14065" PostTypeId="2" ParentId="14055" CreationDate="2015-07-18T08:24:49.403" Score="10" Body="&lt;p&gt;Thunar implements Freedesktop's &lt;a href=&quot;http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html&quot; rel=&quot;noreferrer&quot;&gt;desktop entry specification&lt;/a&gt;, so a &lt;code&gt;.desktop&lt;/code&gt; entry is the answer you are looking for.  Try saving this to &lt;code&gt;$XDG_DATA_HOME/applications/emacs.desktop&lt;/code&gt; or &lt;code&gt;$HOME/.local/share/applications/emacs.desktop&lt;/code&gt; &lt;a href=&quot;http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables&quot; rel=&quot;noreferrer&quot;&gt;if you don't have that set&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Desktop Entry]&#xA;Name=Emacs&#xA;GenericName=Text Editor&#xA;Comment=Edit text&#xA;MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;&#xA;Exec=emacsclient -c -a &quot;&quot; %F&#xA;Icon=emacs&#xA;Type=Application&#xA;Terminal=false&#xA;Categories=Development;TextEditor;&#xA;StartupWMClass=Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will take precedence over any &lt;code&gt;emacs.desktop&lt;/code&gt; in &lt;code&gt;/usr/share/applications&lt;/code&gt;.  You may need to logout and and login again before it works, but now when you select Emacs from &quot;open with&quot; it will either attach to the running daemon, or start one and attach if it was not already running.&lt;/p&gt;&#xA;" OwnerUserId="8884" LastActivityDate="2015-07-18T08:24:49.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14066" PostTypeId="2" ParentId="147" CreationDate="2015-07-18T09:22:13.117" Score="22" Body="&lt;p&gt;After much suffering because of various bugs &lt;code&gt;fill-column-indicator&lt;/code&gt; introduces, I eliminated it from my config for good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I currently use is built-in Emacs functionality to highlight lines that are too long. This even looks better, I wouldn't enable &lt;code&gt;fill-column-indicator&lt;/code&gt; now even if it were bug-free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a start you may grab my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default&#xA; whitespace-line-column 80&#xA; whitespace-style       '(face lines-tail))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then enable it where you want. I use it only in programming context:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook #'whitespace-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-18T09:22:13.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14067" PostTypeId="2" ParentId="265" CreationDate="2015-07-18T10:01:56.880" Score="6" Body="&lt;p&gt;There is &lt;a href=&quot;https://github.com/vifon/focus-autosave-mode.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;focus-autosave-mode&lt;/code&gt;&lt;/a&gt; now. It's available via MELPA. Why not give it a chance to do the hacking for you‽&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-18T10:01:56.880" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14068" PostTypeId="1" CreationDate="2015-07-18T10:12:37.183" Score="3" ViewCount="1240" Body="&lt;p&gt;For a given document (buffer), I would like use left double quotation mark &lt;code&gt;“&lt;/code&gt; (U+201C) and right double quotation mark &lt;code&gt;”&lt;/code&gt; (U+201D) instead of the ordinary double quote &lt;code&gt;&quot;&lt;/code&gt; (U+0022). I want to surround strings and sentences with these, and I want to do it as effortless as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I post my first attempt as an answer below, since it works somehow..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a recommended approach? I am looking for feedback and alternatives.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-07-18T16:51:03.333" Title="Insert left and right double quotation marks instead of ordinary quotation mark" Tags="|formatting|insert|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14069" PostTypeId="2" ParentId="14068" CreationDate="2015-07-18T10:12:37.183" Score="0" Body="&lt;p&gt;The following seems to work somehow. When pressing &lt;code&gt;&quot;&lt;/code&gt; the function determines which of the two types it should insert.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Insert quotes “ and ”&#xA;(defun my-insert-quote ()&#xA;  (interactive)&#xA;  (let ((char (preceding-char)))&#xA;    (if (or (char-equal char 0)&#xA;            (char-equal char ?\s)&#xA;            (char-equal char ?\n)&#xA;            (char-equal char ?\t))&#xA;        (insert &quot;“&quot;)&#xA;      (insert &quot;”&quot;))))&#xA;&#xA;(global-set-key (kbd &quot;\&quot;&quot;) #'my-insert-quote)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-07-18T10:12:37.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14070" PostTypeId="2" ParentId="14021" CreationDate="2015-07-18T13:57:16.433" Score="1" Body="&lt;p&gt;As politza mentioned &lt;code&gt;let&lt;/code&gt; binding of &lt;code&gt;inhibit-modification-hooks&lt;/code&gt; to nil worked well.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((inhibit-modification-hooks nil))&#xA;   (my-custom-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-18T13:57:16.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14071" PostTypeId="2" ParentId="14068" CreationDate="2015-07-18T14:21:46.790" Score="1" Body="&lt;p&gt;As an option, Emacs 25 has &lt;code&gt;electric-quote-mode&lt;/code&gt;. See documentation for the function for more information. In short, it replaces ``something'' with “something” on the fly.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I don't use this, I have my own hacks to insert any character I want in 5 key stokes or so, including ◊≡∫∑«» any symbols and quotes. For quotes it even has wrapping functionality and other nifty tricks. This is not distributed as a package and I don't know if you're interested in such a solution.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-18T14:21:46.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14072" PostTypeId="1" AcceptedAnswerId="14074" CreationDate="2015-07-18T16:47:13.590" Score="4" ViewCount="627" Body="&lt;p&gt;Say, we've entered the following in the normal ipython shell.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [1]: 1+1&#xA;Out[1]: 2&#xA;&#xA;In [2]: 1+2&#xA;Out[2]: 3&#xA;&#xA;In [3]: 2+4&#xA;Out[3]: 6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I now enter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [4]: 1+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and press the &lt;code&gt;up&lt;/code&gt; arrow key, ipython will offer &lt;code&gt;+1&lt;/code&gt; and &lt;code&gt;+2&lt;/code&gt;, i.e. I can skip over &lt;code&gt;2+4&lt;/code&gt;. How do I replicate this behaviour using Emacs' ipython shell (IPy mode).&lt;/p&gt;&#xA;" OwnerUserId="8930" LastEditorUserId="5187" LastEditDate="2015-07-18T19:04:45.840" LastActivityDate="2015-07-18T19:04:45.840" Title="Replicate ipython history behaviour in Emacs" Tags="|python|comint|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14073" PostTypeId="2" ParentId="14068" CreationDate="2015-07-18T16:51:03.333" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/jorgenschaefer/typoel&quot; rel=&quot;nofollow&quot;&gt;Typoel&lt;/a&gt; will insert the appropriate quotes for you. From its README.md:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;“He said, ‘leave me alone,’ and closed the door.”&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;  &#xA;  &lt;p&gt;All quotation marks in this sentence were added by hitting the &quot; key &#xA;  exactly once each. typo.el guessed the correct glyphs to use from &#xA;  context. If it gets it wrong, you can just repeat hitting the &quot; key&#xA;  until you get the quotation mark you wanted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8930" LastActivityDate="2015-07-18T16:51:03.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14074" PostTypeId="2" ParentId="14072" CreationDate="2015-07-18T17:51:08.780" Score="2" Body="&lt;p&gt;Not sure which &lt;code&gt;ipy mode&lt;/code&gt;, You are referring. I use &lt;code&gt;ipython&lt;/code&gt; shell which comes with elpy. It also has the same problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;kbd&gt;up&lt;/kbd&gt; arrow (or &lt;kbd&gt;M-p&lt;/kbd&gt;) are bind to &lt;code&gt;(comint-previous-input ARG)&lt;/code&gt;. So no matter what You have at cursor, it just shows the previous input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another function called &lt;code&gt;(comint-previous-matching-input-from-input N)&lt;/code&gt; which basically gives the previous matching input for the input at cursor. It is bind to &lt;kbd&gt;C-c M-p&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if type something and press  &lt;kbd&gt;C-c M-p&lt;/kbd&gt; it takes to previous match.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-18T17:51:08.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14076" PostTypeId="1" AcceptedAnswerId="20845" CreationDate="2015-07-18T19:51:03.500" Score="6" ViewCount="1443" Body="&lt;p&gt;I'm switching from vim and so far everything is going smoothly. One thing I'm sorely missing is &lt;a href=&quot;http://kien.github.io/ctrlp.vim/&quot; rel=&quot;noreferrer&quot;&gt;ctrlp&lt;/a&gt;'s functionality for opening the selected file in a horizontal split with &lt;kbd&gt;C-x&lt;/kbd&gt; or vertical split with &lt;kbd&gt;C-v&lt;/kbd&gt;. What's more, I was able to select multiple files with &lt;kbd&gt;C-z&lt;/kbd&gt; and then use one of the aforementioned bindings to open them &lt;em&gt;all&lt;/em&gt; in horizontal or vertical splits. It really defined my flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to make it clearer, I would trigger ctrlp with &lt;kbd&gt;,f&lt;/kbd&gt;, type a short pattern, highlight the appropriate file, then press &lt;kbd&gt;C-x&lt;/kbd&gt; to open it in a new horizontal split window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've scoured helm's documentation for something relevant to this but the only thing I found was some hint that it may be possible to select multiple files and do &lt;em&gt;something&lt;/em&gt; with them, but I'm not sure if one of those actions could be opening the file(s) in a split. I imagine it would be something relevant to &lt;code&gt;helm-find-files&lt;/code&gt; and the other similar commands, since those deal with files and not just general narrowing like &lt;code&gt;helm-M-x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually I just need to open a single file in a horizontal split, so if the &quot;mark multiple for opening in their own splits&quot; functionality is missing I won't mind too much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it seems like I'm expected to first create the split, switch to the new window, &lt;em&gt;then&lt;/em&gt; run helm so that the opened file populates that window. This is &lt;em&gt;much&lt;/em&gt; slower for me in an environment that already feels slower to operate to me compared to vim, though I've been making progress on other fronts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way at all that this may be possible? In the worst case, would it be possible to hack this on using the 'advice' functionality that I've heard about? I'd prefer not to hack on helm's source itself if possible, since I don't want to deal with the maintenance burden of doing that. If helm isn't capable of doing this, is there another package that offers similar narrowing functionality for finding files and buffers that does support this?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="105" LastEditDate="2015-07-18T22:48:14.807" LastActivityDate="2016-03-08T20:16:33.933" Title="open helm selection in horizontal split" Tags="|helm|helm-for-files|window-splitting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14077" PostTypeId="1" CreationDate="2015-07-18T23:48:37.723" Score="3" ViewCount="392" Body="&lt;p&gt;I start &lt;code&gt;emacsclient&lt;/code&gt; with &lt;code&gt;emacsclient -a 'emacs-server-start' -nw --socket-name=$TTY&lt;/code&gt;, where &lt;code&gt;emacs-server-start&lt;/code&gt; is a script that runs &lt;code&gt;emacs --daemon=&quot;$TTY&quot;&lt;/code&gt; (I use &lt;code&gt;$TTY&lt;/code&gt; to get a different client for each terminal instance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works well, when I edit a file like &lt;code&gt;e file&lt;/code&gt; (here &lt;code&gt;e&lt;/code&gt; is an alias to the above &lt;code&gt;emacsclient&lt;/code&gt; command), it edits the file. However, sometimes, if I then close emacs (&lt;code&gt;C-x C-c&lt;/code&gt;) and try to edit the same file again with &lt;code&gt;e file&lt;/code&gt;, emacs starts and immediately closes. I have to start emacsclient without the file in the command line argument and navigate to it with &lt;code&gt;C-x C-f&lt;/code&gt; or &lt;code&gt;C-x b&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I know how to reproduce this. I believe what is happening is that sometimes I will have a buffer open with a file that gets modified on disk (by being edited by another emacs session, or more commonly, by being checkout on disk). The file will have no edits, so won't be seen by emacs as being in need of saving. Hence &lt;code&gt;C-x C-c&lt;/code&gt; won't prompt. However, for whatever reason, this keeps the buffer from being killed when this happens. Perhaps the &quot;do you want to revert this buffer&quot; prompt is canceling it somehow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming my deductions are correct, how can I tell &lt;code&gt;server-save-buffers-kill-terminal&lt;/code&gt; to always kill buffers that don't need saving, regardless of whether or not they have changed on disk?&lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="118" LastEditDate="2015-09-29T17:34:46.050" LastActivityDate="2015-09-29T17:34:46.050" Title="emacsclient doesn't start when visiting a file that is already open" Tags="|emacsclient|terminal-emacs|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14079" PostTypeId="1" CreationDate="2015-07-19T09:16:57.580" Score="12" ViewCount="4622" Body="&lt;p&gt;What's the best way to get the recently opened files in helm. Without helm I just did &lt;code&gt;C-c C-f&lt;/code&gt; and then &lt;code&gt;arrow up&lt;/code&gt; to get the  last opened file. And with &lt;code&gt;M-r&lt;/code&gt; I was  able to to a regexp search through recently opened files. Both doesn't work with helm anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-ff-file-name-history-use-recentf t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;.emacs&lt;/code&gt; file, but it doesn't seem to have any effect.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2015-07-19T09:41:43.687" LastActivityDate="2019-04-16T13:57:29.600" Title="How to see recently opened files in helm" Tags="|helm|history|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14080" PostTypeId="2" ParentId="14079" CreationDate="2015-07-19T09:29:11.823" Score="15" Body="&lt;p&gt;Indeed, if &lt;code&gt;helm-ff-file-name-history-use-recentf&lt;/code&gt; set to true, &lt;code&gt;helm-find-files&lt;/code&gt; is supposed to use &lt;code&gt;recentf-list&lt;/code&gt; instead of &lt;code&gt;file-name-history&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable the recenf minor mode, I have those lines in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; keep a list of recently opened files                                                                      &#xA; (recentf-mode 1)&#xA; (setq-default recent-save-file &quot;~/.emacs.d/recentf&quot;)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What about &lt;code&gt;M-x helm-recentf&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;helm-recentf is an interactive autoloaded Lisp function in&lt;br&gt;&#xA;  `helm-files.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(helm-recentf)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Preconfigured &lt;code&gt;helm&lt;/code&gt; for &lt;code&gt;recentf&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You may also be interested by &lt;a href=&quot;http://www.emacswiki.org/emacs/RecentFiles&quot; rel=&quot;noreferrer&quot;&gt;recent files&lt;/a&gt; within Emacs.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-07-20T13:57:40.250" LastActivityDate="2015-07-20T13:57:40.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14081" PostTypeId="2" ParentId="14058" CreationDate="2015-07-19T09:30:48.500" Score="4" Body="&lt;p&gt;when you define a abbrev table, you can add a property to specify regex on what chars to look for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'xah-elisp-abbrev-table&#xA;  '(&#xA;    (&quot;d&quot; &quot;(defun f▮ ()\n  \&quot;DOCSTRING\&quot;\n  (interactive)\n  (let (VAR)\n\n  ))&quot; nil :system t)&#xA;    (&quot;i&quot; &quot;(insert ▮)&quot; nil :system t)&#xA;    (&quot;l&quot; &quot;(let (x▮)\n x\n)&quot; nil :system t)&#xA;    (&quot;m&quot; &quot;(message \&quot;%s▮\&quot; ARGS)&quot; nil :system t)&#xA;    (&quot;p&quot; &quot;(point)&quot; nil :system t)&#xA;    (&quot;s&quot; &quot;(setq ▮ VAL)&quot; nil :system t)&#xA;    (&quot;w&quot; &quot;(when ▮)&quot; nil :system t)&#xA;    )&#xA;&#xA;  &quot;abbrev table for `xah-elisp-mode'&quot;&#xA;  :regexp &quot;\\([_-0-9A-Za-z]+\\)&quot;&#xA;  :case-fixed t&#xA;  :enable-function 'xah-elisp-abbrev-enable-function&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above is taken from a mode. I haven't tried this with normal abbrev, but am pretty sure you can do so. See a example here: &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_abbrev_mode.html&quot; rel=&quot;nofollow&quot;&gt;http://ergoemacs.org/emacs/emacs_abbrev_mode.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2015-07-19T09:30:48.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14082" PostTypeId="1" CreationDate="2015-07-19T10:05:47.077" Score="5" ViewCount="4767" Body="&lt;p&gt;Say, I typed &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [1]: def foo(a, b):&#xA;...:     return a+b&#xA;...: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the normal, non-emacs ipython shell. Pressing the &lt;code&gt;up&lt;/code&gt; arrow key afterwards, allows me to get the complete multi-line input back which I then can edit.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [2]: def foo(a, b):&#xA;    return a+b_&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;_&lt;/code&gt; represents the cursor. Can I replicate this behaviour in Emacs's ipython shell?&lt;/p&gt;&#xA;" OwnerUserId="8930" LastActivityDate="2018-03-02T09:43:39.883" Title="multi line inputs in ipython" Tags="|python|comint|ipython|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14083" PostTypeId="1" AcceptedAnswerId="14107" CreationDate="2015-07-19T10:47:15.637" Score="5" ViewCount="1298" Body="&lt;p&gt;Do you know how to export an Artist-mode drawing using the Org-mode export feature? &lt;/p&gt;&#xA;" OwnerUserId="7199" LastEditorUserId="2039" LastEditDate="2015-07-20T22:39:01.620" LastActivityDate="2015-07-20T22:39:01.620" Title="Exporting &quot;Artist-mode&quot; drawing to PDF through Org-mode" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14084" PostTypeId="1" AcceptedAnswerId="14085" CreationDate="2015-07-19T14:44:50.483" Score="7" ViewCount="572" Body="&lt;p&gt;&lt;code&gt;compile&lt;/code&gt; can execute command line, show you result, indicate exit code in mode line and more. How do you get exit code of the executed command from Lisp? Documentation of the function is silent about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to read descriptions of various variables that start with &lt;code&gt;compilation-&lt;/code&gt; prefix. No luck. Anyway, exit code is displayed in mode line, so it should be available. Looks like long digging into source code can help here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you can save me and future readers time? What is the official (if this word can be used here) way to get exit code?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-19T16:10:45.063" Title="How to get exit code of command supplied to `compile' function?" Tags="|elisp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14085" PostTypeId="2" ParentId="14084" CreationDate="2015-07-19T16:10:45.063" Score="9" Body="&lt;p&gt;There is no variable set to the last error code.  Such a thing can be emulated though by setting &lt;code&gt;compilation-exit-message-function&lt;/code&gt; to something custom:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar compilation-exit-message-function nil &quot;\&#xA;If non-nil, called when a compilation process dies to return a status message.&#xA;This should be a function of three arguments: process status, exit status,&#xA;and exit message; it returns a cons (MESSAGE . MODELINE) of the strings to&#xA;write into the compilation buffer, and to put in its mode line.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the given information it's trivial to write some code to achieve what you're after:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-compilation-exit-code nil)&#xA;(defun my-compilation-exit-message-function (status_ code message)&#xA;  (setq my-compilation-exit-code code)&#xA;  (cons message code))&#xA;&#xA;(setq compilation-exit-message-function 'my-compilation-exit-message-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-19T16:10:45.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14086" PostTypeId="1" CreationDate="2015-07-19T16:14:47.083" Score="3" ViewCount="2082" Body="&lt;p&gt;I've tried both of the following formulas:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=vsum($4..$&amp;gt;)&#xA;=vsum(@0$4..@0$&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems like either of these should work.&lt;/p&gt;&#xA;" OwnerUserId="8961" LastActivityDate="2015-08-19T05:45:32.700" Title="Sum to end of row in Org Mode Spreadsheet" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14088" PostTypeId="1" CreationDate="2015-07-19T21:39:30.980" Score="0" ViewCount="185" Body="&lt;p&gt;I really enjoy my emacs config (the &lt;code&gt;autocomplete&lt;/code&gt; and indentation settings, the use of things like &lt;code&gt;jedi&lt;/code&gt; and &lt;code&gt;tern&lt;/code&gt; etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time I use emacs at home on my personal macbook pro laptop but I am wondering if there is a way I could make my system more portable.  I already store my &lt;code&gt;.emacs.d&lt;/code&gt; on github, but my dream is that I could go to any computer in the world and somehow recreate my experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is strange because even when I have cloned my repo into a remote machine and ssh'd into that remote machine, most things are completely different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beginning with the theme, my understanding is that this has something to do with the way the host (computer I am on) terminal is setup.  For instance it might not support colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, should autocomplete drop downs like those for tern and jedi still work when I am ssh'd in?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would very much appreciate any suggestions on how I could best recreate my emacs experience on a remote machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2016-05-09T06:56:46.610" Title="How can I get the same emacs experience on any computer?" Tags="|init-file|remote|config|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14090" PostTypeId="1" CreationDate="2015-07-20T00:22:20.700" Score="1" ViewCount="384" Body="&lt;p&gt;I'd like to specify a heading (using either link or agenda syntax) and export just that heading as a file, using elisp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not trying to do this - since this specifies the file to export to in the file itself: &lt;a href=&quot;https://emacs.stackexchange.com/questions/2259/how-to-export-top-level-headings-of-org-mode-buffer-to-separate-files&quot;&gt;How to export top-level headings of org-mode buffer to separate files?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it might involve specific input to &lt;code&gt;org-export-as&lt;/code&gt;? (a function in &lt;code&gt;ox.el&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="8234" LastEditorUserId="8234" LastEditDate="2015-07-20T08:48:34.703" LastActivityDate="2015-07-20T08:48:34.703" Title="Export a particular org heading with elisp?" Tags="|org-mode|elisp|org-export|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14091" PostTypeId="1" AcceptedAnswerId="14092" CreationDate="2015-07-20T00:34:21.290" Score="3" ViewCount="1004" Body="&lt;p&gt;We have a number of clauses (condition body) which we want to give to &lt;code&gt;cond&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond (condition1 body1)&#xA;      (condition2 body2)&#xA;      (condition3 body3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But imagine that the clauses were first generated via &lt;code&gt;mapcar&lt;/code&gt;, which gave the following list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((condition1 body1)&#xA; (condition2 body2)    &#xA; (condition3 body3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say that the above list is the content of variable &lt;code&gt;clauses&lt;/code&gt;.&#xA;Now, we would like to pass it to &lt;code&gt;cond&lt;/code&gt;, but if we do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(cond ,clauses)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond ((condition1 body1)&#xA;       (condition2 body2)&#xA;       (condition3 body3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which does not work, instead of: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond (condition1 body1)&#xA;      (condition2 body2)&#xA;      (condition3 body3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way around this problem ?&lt;/p&gt;&#xA;" OwnerUserId="526" LastActivityDate="2015-07-20T02:10:18.317" Title="How to give a list to cond?" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14092" PostTypeId="2" ParentId="14091" CreationDate="2015-07-20T02:10:18.317" Score="6" Body="&lt;p&gt;You want to &lt;em&gt;splice&lt;/em&gt; the list into the new form:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;`(cond ,@clauses)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Backquote&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can also &quot;splice&quot; an evaluated value into the resulting list,&#xA;  using the special marker &lt;code&gt;,@&lt;/code&gt;.  The elements of the spliced list become&#xA;  elements at the same level as the other elements of the resulting list.&#xA;  The equivalent code without using &lt;code&gt;`&lt;/code&gt; is often unreadable.  Here are&#xA;  some examples:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;     (setq some-list '(2 3))&#xA;          ⇒ (2 3)&#xA;     (cons 1 (append some-list '(4) some-list))&#xA;          ⇒ (1 2 3 4 2 3)&#xA;     `(1 ,@some-list 4 ,@some-list)&#xA;          ⇒ (1 2 3 4 2 3)&#xA;&#xA;     (setq list '(hack foo bar))&#xA;          ⇒ (hack foo bar)&#xA;     (cons 'use&#xA;       (cons 'the&#xA;         (cons 'words (append (cdr list) '(as elements)))))&#xA;          ⇒ (use the words foo bar as elements)&#xA;     `(use the words ,@(cdr list) as elements)&#xA;          ⇒ (use the words foo bar as elements)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-07-20T02:10:18.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14093" PostTypeId="2" ParentId="14086" CreationDate="2015-07-20T05:34:42.913" Score="4" Body="&lt;pre&gt;&lt;code&gt;|    |   |   |  4 |  5 |  6 |  7 |  8 |&#xA;|    |   |   |  8 | 10 | 12 | 14 | 16 |&#xA;|----+---+---+----+----+----+----+----|&#xA;| 60 |   |   | 12 | 15 | 18 | 21 | 24 |&#xA;#+TBLFM: @3$1=vsum(@2$4..@2$&amp;gt;)&#xA;#+TBLFM: @3$1=vsum($4..$&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the table I tested with. If you switch formulas (move the one in the second row to the first row) and re-evaluate, you will get 90, which seems to imply that unless you specify the row, &lt;code&gt;vsum&lt;/code&gt; will result in the sum of the last row.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-20T05:34:42.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14094" PostTypeId="2" ParentId="14058" CreationDate="2015-07-20T05:56:54.513" Score="0" Body="&lt;p&gt;Get the following entry in abbrev-file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;ds&quot; &quot;$_session&quot; nil 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Expands as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunatly this only works with my tweaked abbrev add facility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See ar-abbrev-extensions.el at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/andreas-roehler/werkstatt&quot; rel=&quot;nofollow&quot;&gt;https://github.com/andreas-roehler/werkstatt&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-07-20T05:56:54.513" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14095" PostTypeId="2" ParentId="14063" CreationDate="2015-07-20T06:33:26.413" Score="1" Body="&lt;p&gt;I don't use MATLAB, but this sounded like a problem I had when first starting to use emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did you originally try &lt;code&gt;M-x compile&lt;/code&gt; to compile your code? That will run the shell command specified by the next input. The default is &lt;code&gt;make&lt;/code&gt;,  which is used for c programming. Here's the documentation: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation.html#Compilation&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation.html#Compilation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, you want to use the command line program that compiles your MATLAB code. (Is it &lt;a href=&quot;http://www-rohan.sdsu.edu/doc/matlab/toolbox/compiler/mcc.html&quot; rel=&quot;nofollow&quot;&gt;mcc&lt;/a&gt;?). So the input after &lt;code&gt;M-x compile&lt;/code&gt; should be something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mcc [-options] mfile1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What ever the command, it needs to be in your path variable.&lt;/p&gt;&#xA;" OwnerUserId="6831" LastActivityDate="2015-07-20T06:33:26.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14096" PostTypeId="5" CreationDate="2015-07-20T06:38:39.490" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;Spacemacs&lt;/a&gt; is an Emacs layer focused on modal editing via Evil mode, mnemonics and easy configuration, and the space bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be &lt;a href=&quot;https://github.com/syl20bnr/spacemacs#install&quot; rel=&quot;nofollow&quot;&gt;installed by cloning a GitHub repository&lt;/a&gt;, and &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org&quot; rel=&quot;nofollow&quot;&gt;more extensive documentation is on GitHub as well&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8967" LastEditorUserId="8967" LastEditDate="2015-07-21T00:16:37.667" LastActivityDate="2015-07-21T00:16:37.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14097" PostTypeId="4" CreationDate="2015-07-20T06:38:39.490" Score="0" Body="Spacemacs is an Emacs layer focused on modal editing via Evil mode, mnemonics and easy configuration, and the space bar.  Use this tag if your question relates to Spacemacs-specific functionality." OwnerUserId="11169" LastEditorUserId="11169" LastEditDate="2016-05-28T14:05:37.247" LastActivityDate="2016-05-28T14:05:37.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14098" PostTypeId="1" AcceptedAnswerId="14099" CreationDate="2015-07-20T08:53:47.120" Score="2" ViewCount="170" Body="&lt;pre&gt;&lt;code&gt;(define-key mode map symbol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Normally what you see a quoted value (which means literally that value).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;i&quot; 'evil-insert-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That means when the key is pressed, it actually looks up for that value as a variable and then execute it, a bit like what &lt;code&gt;getattr(Object, 'string')&lt;/code&gt; does in Python. The subtle distinction is that 'string' is literally that value however &lt;code&gt;getattr&lt;/code&gt; returns the function object with that name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I can perfectly replace this with an interactive lambda.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;i&quot; &#xA;  (lambda () (interactive) (message &quot;%s&quot; major-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How is it possible that a &lt;code&gt;'value&lt;/code&gt; (which I think is a bit like &lt;code&gt;string&lt;/code&gt; in Python) can be replaced with a function object. Is it that &lt;code&gt;(interactive)&lt;/code&gt; is doing something special? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please explain why there is an equivalence between 'string and the lambda in this case is it because the &lt;code&gt;define-key&lt;/code&gt; knows to handle both these datatype appropriately?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYKI: I bumped into this problem because I wanted to conditionally bind some key depending on the major-mode.&lt;/p&gt;&#xA;" OwnerUserId="8796" LastEditorUserId="8796" LastEditDate="2015-07-21T11:26:19.573" LastActivityDate="2015-07-21T11:26:19.573" Title="What datatype is accepted by the last argument of the define-key function?" Tags="|elisp|key-bindings|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14099" PostTypeId="2" ParentId="14098" CreationDate="2015-07-20T10:12:29.433" Score="3" Body="&lt;p&gt;If you give the argument &lt;code&gt;'foo&lt;/code&gt; (or equivalently &lt;code&gt;(quote foo)&lt;/code&gt;), it evaluates to the symbol &lt;code&gt;foo&lt;/code&gt;. When you later use the key, emacs will look up the function definition of that symbol and use it. If you instead use &lt;code&gt;(lambda (...) (interactive) ...)&lt;/code&gt; as argument, it evaluates to an interactive function, i.e. a command, which will be used as is.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-07-20T10:12:29.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14100" PostTypeId="2" ParentId="14098" CreationDate="2015-07-20T10:15:50.827" Score="3" Body="&lt;p&gt;I have slightly different doc-string, it's called &lt;code&gt;DEF&lt;/code&gt; there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key KEYMAP KEY DEF)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then it's explained:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;DEF&lt;/code&gt; is anything that can be a key's definition:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;nil&lt;/code&gt; (means key is undefined in this keymap),&lt;/li&gt;&#xA;&lt;li&gt;a command (a Lisp function suitable for interactive calling),&lt;/li&gt;&#xA;&lt;li&gt;a string (treated as a keyboard macro),&lt;/li&gt;&#xA;&lt;li&gt;a keymap (to define a prefix key),&lt;/li&gt;&#xA;&lt;li&gt;a symbol (when the key is looked up, the symbol will stand for its&#xA;function definition, which should at that time be one of the above,&#xA;or another symbol whose function definition is used, etc.),&lt;/li&gt;&#xA;&lt;li&gt;a cons &lt;code&gt;(STRING . DEFN)&lt;/code&gt;, meaning that &lt;code&gt;DEFN&lt;/code&gt; is the definition&#xA;(&lt;code&gt;DEFN&lt;/code&gt; should be a valid definition in its own right),&lt;/li&gt;&#xA;&lt;li&gt;or a cons &lt;code&gt;(MAP . CHAR)&lt;/code&gt;, meaning use definition of &lt;code&gt;CHAR&lt;/code&gt; in keymap &lt;code&gt;MAP&lt;/code&gt;,&lt;/li&gt;&#xA;&lt;li&gt;or an extended menu item definition.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Lisp is granddaddy of dynamic languages like Python, where variables don't have type, they just &quot;point&quot; to some object that can be everything. So typically functions can interpret different types of arguments differently and many functions take everything that &quot;makes sense&quot; as arguments. (So, functions frequently test type of arguments, this is different in Python, where such testing is not idiomatic, because Python thinks in terms of &quot;interfaces&quot;, not types.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs Lisp, you have two types of functions, simple functions and commands. Commands must have &lt;code&gt;interactive&lt;/code&gt; declaration. This tells Emacs how to get values of arguments when command is called interactively (by user). So it perfectly makes sense that your keybinding should be associated with &lt;em&gt;command&lt;/em&gt;, not just a function.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-20T10:22:37.697" LastActivityDate="2015-07-20T10:22:37.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14101" PostTypeId="2" ParentId="8013" CreationDate="2015-07-20T11:33:11.747" Score="0" Body="&lt;p&gt;With emacs 25, changed the function in your .bashrc with this one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [ &quot;$TERM&quot; = &quot;eterm-color&quot; ]; then&#xA;   function eterm-set-cwd {&#xA;         $@&#xA;    echo -e &quot;\033AnSiTc&quot; $(pwd)&#xA;   }&#xA;   # set hostname, user, and cwd&#xA;   function eterm-reset {&#xA;      echo -e &quot;\033AnSiTu&quot; $(whoami)&#xA;      echo -e &quot;\033AnSiTc&quot; $(pwd)&#xA;      echo -e &quot;\033AnSiTh&quot; $(hostname)&#xA;   }&#xA;   for temp in cd pushd popd; do&#xA;      alias $temp=&quot;eterm-set-cwd $temp&quot;&#xA;   done&#xA;   # set hostname, user, and cwd now&#xA;   eterm-reset&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;source: &lt;a href=&quot;https://gist.github.com/mkhattab/1739578&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/mkhattab/1739578&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-09-01T09:35:29.277" LastActivityDate="2015-09-01T09:35:29.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14102" PostTypeId="1" AcceptedAnswerId="14103" CreationDate="2015-07-20T13:46:41.230" Score="3" ViewCount="398" Body="&lt;p&gt;When I call commands such as &lt;code&gt;helm-apropos&lt;/code&gt; and custom Org agendas there is often a noticeable delay between the key sequence and the results presented. How can I speed up these commands to respond instantly to being called? I'm most interested in methods that can be applied to any Emacs commands, but optimizations for &lt;code&gt;helm&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt; would also be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note - I am not asking about Emacs startup time. I would be happy for my Emacs startup to take 10x longer if I could make all Emacs commands instant.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="105" LastEditDate="2015-07-20T14:34:30.583" LastActivityDate="2015-07-21T07:30:31.253" Title="How can I speed up individual commands?" Tags="|org-mode|helm|commands|optimization|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14103" PostTypeId="2" ParentId="14102" CreationDate="2015-07-20T14:11:37.767" Score="7" Body="&lt;p&gt;&lt;code&gt;helm-apropos&lt;/code&gt; is indeed pretty slow. I think it comes from joining 5&#xA;very large lists:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;helm-apropos-function-list&#xA;;; =&amp;gt;&#xA;;; (helm-def-source--emacs-commands&#xA;;;  helm-def-source--emacs-functions&#xA;;;  helm-def-source--eieio-classes&#xA;;;  helm-def-source--eieio-generic&#xA;;;  helm-def-source--emacs-variables&#xA;;;  helm-def-source--emacs-faces&#xA;;;  helm-def-source--helm-attributes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can speed it up by generating one huge list right off the bat:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-fast-apropos ()&#xA;      (interactive)&#xA;      (helm :sources&#xA;            '((name . &quot;apropos: &quot;)&#xA;              (candidates .&#xA;               (lambda ()&#xA;                 (all-completions &quot;&quot; obarray&#xA;                                  (lambda (x)&#xA;                                    (or&#xA;                                     ;; commands&#xA;                                     (commandp x)&#xA;                                     ;; functions&#xA;                                     (fboundp x)&#xA;                                     ;; EIEIO class&#xA;                                     (class-p x)&#xA;                                     ;; EIEIO generic&#xA;                                     (generic-p x)&#xA;                                     ;; variable&#xA;                                     (and (boundp x) (not (keywordp x))))))))&#xA;              (action . (lambda (x)&#xA;                        (setq x (intern x))&#xA;                        (cond ((boundp x)&#xA;                               (describe-variable x))&#xA;                              ((fboundp x)&#xA;                               (describe-function x))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also just had a quick look at the &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow&quot;&gt;ivy&lt;/a&gt; equivalent of the above,&#xA;I think it's around 0.2s faster:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun ivy-apropos ()&#xA;  (interactive)&#xA;  (ivy-read &quot;apropos: &quot;&#xA;            (all-completions &quot;&quot; obarray&#xA;                             (lambda (x)&#xA;                               (or&#xA;                                ;; commands&#xA;                                (commandp x)&#xA;                                ;; functions&#xA;                                (fboundp x)&#xA;                                ;; EIEIO class&#xA;                                (class-p x)&#xA;                                ;; EIEIO generic&#xA;                                (generic-p x)&#xA;                                ;; variable&#xA;                                (and (boundp x) (not (keywordp x))))))&#xA;            :keymap counsel-describe-map&#xA;            :preselect (counsel-symbol-at-point)&#xA;            :action (lambda (x)&#xA;                      (setq x (intern x))&#xA;                      (cond ((boundp x)&#xA;                             (describe-variable x))&#xA;                            ((fboundp x)&#xA;                             (describe-function x))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Edit: typical approach for caching&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Very simple: store the whole collection into a variable, and hope that it doesn't need to be recomputed;&#xA;recompute manually when needed (usually, when new packages are loaded):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defvar helm-fast-apropos-cache nil)&#xA;(defun helm-update-apropos-cache ()&#xA;  (interactive)&#xA;  (setq helm-fast-apropos-cache&#xA;        (all-completions &quot;&quot; obarray&#xA;                         (lambda (x)&#xA;                           (or&#xA;                            ;; commands&#xA;                            (commandp x)&#xA;                            ;; functions&#xA;                            (fboundp x)&#xA;                            ;; EIEIO class&#xA;                            (class-p x)&#xA;                            ;; EIEIO generic&#xA;                            (generic-p x)&#xA;                            ;; variable&#xA;                            (and (boundp x) (not (keywordp x))))))))&#xA;&#xA;(defun helm-fast-apropos ()&#xA;  (interactive)&#xA;  (helm :sources&#xA;        (quote ((name . &quot;apropos: &quot;)&#xA;                (candidates .&#xA;                            (lambda ()&#xA;                              (or helm-fast-apropos-cache&#xA;                                  (helm-update-apropos-cache))))&#xA;                (action . (lambda (x)&#xA;                            (setq x (intern x))&#xA;                            (cond ((boundp x)&#xA;                                   (describe-variable x))&#xA;                                  ((fboundp x)&#xA;                                   (describe-function x)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This approach saves only fraction of a second in this case, so it might not be worth it.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-07-21T07:30:31.253" LastActivityDate="2015-07-21T07:30:31.253" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14104" PostTypeId="2" ParentId="14079" CreationDate="2015-07-20T15:30:31.137" Score="14" Body="&lt;p&gt;Perhaps this isn't quite what you're looking for, but I really like using &lt;code&gt;helm-mini&lt;/code&gt;, which includes a small browser for recent open files (by calling &lt;code&gt;helm-recentf&lt;/code&gt; as Nsukami suggests you use).  Here is an example, taken from &lt;a href=&quot;http://tuhdo.github.io/helm-intro.html#sec-7&quot; rel=&quot;noreferrer&quot;&gt;this amazing post on helm&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vdrKF.gif&quot; alt=&quot;helm-mini&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not only does it show all of your open buffers, but it's my most convenient way to view recently opened files. I'd recommend giving it a try!&lt;/p&gt;&#xA;" OwnerUserId="8486" LastActivityDate="2015-07-20T15:30:31.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14105" PostTypeId="1" AcceptedAnswerId="14106" CreationDate="2015-07-20T15:43:54.940" Score="7" ViewCount="715" Body="&lt;p&gt;I often do something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C-x b foobarbaz RET&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to get a new buffer for taking notes, etc. I'd love for emacs to just snapshot and dump all open buffers to disk occasionally. There's lots of documentation out there for improving auto-save and backup functionality but those all relate to buffers that are currently visiting a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like emacs to periodically snapshot/save ALL buffers to disk. This will surely cause some noisey 'output' buffers to get written to disk, but who cares? Disk space is cheap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything built in to do this? Right now if my computer (or emacs) crashes, I often lose lots of notes that I've taken in various buffers.&lt;/p&gt;&#xA;" OwnerUserId="8970" LastActivityDate="2015-07-20T23:01:03.890" Title="Auto-save buffers that aren't visiting files" Tags="|auto-save|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14106" PostTypeId="2" ParentId="14105" CreationDate="2015-07-20T16:13:16.837" Score="7" Body="&lt;p&gt;This does not answer your question as posed, so feel free to ignore or downvote.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I doubt that you really want Emacs to save &lt;strong&gt;all&lt;/strong&gt; buffers to disk, including all of the internal, normally invisible buffers.  Why would you want that?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It's not about the disk space.  It's about the noise.  Do you really want to dig stuff out of a directory where your important files might be mixed in with such stuff? Or do you want to fish for the occasional pearl in a temp directory (whose purpose is to stash noise)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Buffers that have names like &lt;code&gt;*...*&lt;/code&gt; (not starting with a space char) are typically output-only (e.g., &lt;code&gt;*info*&lt;/code&gt;) or for temporary interaction (e.g. &lt;code&gt;*scratch*&lt;/code&gt;).  For such buffers, my recommendation would be to leave things as they are.  You can always save any such buffer on demand, using &lt;code&gt;C-x C-w&lt;/code&gt;, if you really need to.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Which brings me to what I suspect is your real use case: &quot;&lt;em&gt;buffer[s] for taking notes, etc.&lt;/em&gt;&quot;.  The answer here is to use &lt;code&gt;C-x C-f&lt;/code&gt; instead of &lt;code&gt;C-x b&lt;/code&gt;.  IOW, yes, visit them as file buffers.  If you never save the buffer there is no file created - &lt;em&gt;except an autosave file&lt;/em&gt;, which is probably just what you want and need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you visit a buffer as a file buffer, you automatically control which major mode is used by default (using &lt;code&gt;auto-mode-alist&lt;/code&gt;).  This is just as important for note-taking as it is for programming code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, I would suggest that if you use &lt;code&gt;*scratch*&lt;/code&gt; for temporary Lisp interaction, you might reconsider.  Many users (including me) have found that it helps to instead use &lt;code&gt;C-x C-f foo.el&lt;/code&gt; (or whatever other &lt;code&gt;*.el&lt;/code&gt; file name).  One reason is that you get autosave files for free (and backup files, if you save the buffer). Another reason is that you get Emacs-Lisp mode instead of Lisp interaction mode. A third reason is that yes, you might well want to save your &quot;temporary&quot; work.  And as you say, disk space is cheap.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What about #4 conflicting with what I said in #1? You don't want to mix files of temporary scribbles with important files, and you don't want to fish the occasional pearl out of a directory of temp files. The answer here is that it's up to you to organize things so that this effect is minimized.  Working with such scratch files in a particular directory can help, as can using a naming convention (esp. a prefix) that helps you distinguish such files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing that can help: &lt;strong&gt;Dired&lt;/strong&gt;.  You can use &lt;code&gt;~&lt;/code&gt; and &lt;code&gt;#&lt;/code&gt; to mark backup and autosave files for deletion (then &lt;code&gt;x&lt;/code&gt; to delete them).  And if you use a naming convention for your presumably temporary, scratch files then you can use &lt;code&gt;%&lt;/code&gt; or similar to mark all of them for deletion. You can even execute a function periodically to clean out such files.  And you can easily rename any that you really want to keep longer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my advice is to perhaps reconsider how you're interacting with such temporary, note-taking buffers. Consider using file buffers, which get autosaved.  In sum, use &lt;code&gt;C-x C-f foobarbaz.txt RET&lt;/code&gt; (or &lt;code&gt;.el&lt;/code&gt; or whatever) instead of &lt;code&gt;C-x b foobarbaz RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-20T23:01:03.890" LastActivityDate="2015-07-20T23:01:03.890" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14107" PostTypeId="2" ParentId="14083" CreationDate="2015-07-20T17:23:38.780" Score="6" Body="&lt;p&gt;You can use &quot;&lt;a href=&quot;http://orgmode.org/manual/Literal-examples.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;example blocks&lt;/a&gt;&quot; to do this... Example blocks are small pieces of document that are outputted literally in monospaced text, regardless of export mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can create these easily by typing &quot;&lt;code&gt;&amp;lt;e&lt;/code&gt;&quot; in an Org mode buffer and then hitting &lt;code&gt;[Tab]&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ojehW.png&quot; alt=&quot;&quot; title=&quot;Poof!&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you put your cursor in the block and hit &lt;code&gt;C-c '&lt;/code&gt;, you can get into a dedicated buffer to edit the contents of the block. In here you can &lt;code&gt;M-x artist-mode&lt;/code&gt; and draw something. I'm not much of an artist, but you should see a buffer like so:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/waPnE.png&quot; alt=&quot;&quot; title=&quot;I am truly the Vincent Van Gogh of our time.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;C-c '&lt;/code&gt; again when you are done and your buffer should now have your art in it:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/EusSr.png&quot; alt=&quot;&quot; title=&quot;It is the BEGIN_EXAMPLE of a masterpiece!&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add some header arguments to set up your LaTeX export:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/vnszo.png&quot; alt=&quot;&quot; title=&quot;LaTeX knowledge not required -- Just Google.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-e&lt;/code&gt; to export like you usually would.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/8Zp3h.png&quot; alt=&quot;&quot; title=&quot;Time to find a publisher! We&amp;#39;re makin&amp;#39; history here.&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And voila! You have a PDF you can donate to your local art museum to capture the hearts of your many dedicated fans and bring tears to critics' faces!&#xA;&lt;img src=&quot;https://i.stack.imgur.com/dN2FY.png&quot; alt=&quot;&quot; title=&quot;I&amp;#39;m not sure if I can handle this level of skill.&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2015-07-20T20:44:10.267" LastActivityDate="2015-07-20T20:44:10.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14108" PostTypeId="1" AcceptedAnswerId="14109" CreationDate="2015-07-20T17:55:46.527" Score="3" ViewCount="941" Body="&lt;p&gt;I want to go through SICP.&#xA;I installed Geiser and Chiken scheme&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set the scheme interpreter to be chiken&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq scheme-program-name &quot;C:/Program Files\ (x86)/Chicken Scheme/bin/csi.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I run &lt;code&gt;M-x geiser&lt;/code&gt; and choose &lt;code&gt;chicken&lt;/code&gt; in the &lt;code&gt;Start Geiser for scheme implementation:&lt;/code&gt; menu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A new window with a new buffer is opened. The buffer is called &lt;code&gt;* Chiken REPL *&lt;/code&gt;. &#xA;But the buffer is empty. No promp no nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when I do &lt;code&gt;M-x run-scheme&lt;/code&gt; it tells me &lt;code&gt;Spawning child process: invalid argument&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me please, how do I setup emacs, geiser, a scheme interpreter to run on windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help in advance.&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="8306" LastEditDate="2015-07-20T18:03:10.263" LastActivityDate="2015-07-20T18:23:16.180" Title="emacs, geiser, chiken scheme on windows setup help" Tags="|window|repl|scheme|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14109" PostTypeId="2" ParentId="14108" CreationDate="2015-07-20T18:16:18.793" Score="5" Body="&lt;p&gt;At a guess, your path to the Scheme implementation may be incorrect. Why do you think you need a backslash there? What do you want to quote/escape with it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, go to &lt;code&gt;*scratch*&lt;/code&gt; buffer and evaluate your path. You will see that it may be a bit surprising:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;C:/Program Files\ (x86)/Chicken Scheme/bin/csi.exe&quot; &#xA;⇒&#xA;&quot;C:/Program Files(x86)/Chicken Scheme/bin/csi.exe&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Escaped space &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-for-Strings.html&quot; rel=&quot;noreferrer&quot;&gt;is ignored in Emacs Lisp strings&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't remember now what it's called on Windows, but try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;C:/Program Files (x86)/Chicken Scheme/bin/csi.exe&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-20T18:23:16.180" LastActivityDate="2015-07-20T18:23:16.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14110" PostTypeId="1" CreationDate="2015-07-20T18:28:25.320" Score="5" ViewCount="2207" Body="&lt;p&gt;How do I set org-mode to use racket instead of Guile?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use emacs,org-mode and racket to go through the SICP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can start Geiser, choosing &lt;code&gt;Racket&lt;/code&gt; in the &lt;code&gt;Start Geiser for scheme implementation&lt;/code&gt; menu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I execute &lt;code&gt;C-c C-c&lt;/code&gt; on a src block in an org file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC&#xA; (print &quot;hello world&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it tells me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unable to start REPL:&#xA;Searching for program: no such file or directory, guile.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So again, how do I set org-mode to use racket instead of Guile?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your kind help and time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also enable scheme in org mode and set the scheme program to be Racket&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq scheme-program-name &quot;C:/Program\ Files/Racket/Racket.exe&quot;)&#xA; (org-babel-do-load-languages&#xA;      'org-babel-load-languages&#xA;      '((emacs-lisp . nil)&#xA;        (scheme . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8306" LastActivityDate="2015-08-19T18:56:56.497" Title="How do I set org-mode to use racket instead of Guile?" Tags="|org-mode|org-babel|scheme|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14111" PostTypeId="2" ParentId="14110" CreationDate="2015-07-20T18:37:38.013" Score="2" Body="&lt;p&gt;You leave these two lines in you .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'scheme-mode-hook 'geiser-mode)&#xA;(setq geiser-default-implementation 'racket)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8306" LastActivityDate="2015-07-20T18:37:38.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14112" PostTypeId="1" AcceptedAnswerId="14120" CreationDate="2015-07-20T20:40:47.250" Score="1" ViewCount="182" Body="&lt;p&gt;I seem to have inconsistent behavior with &lt;code&gt;magit-insert-remote-header&lt;/code&gt;. On some repositories I get a remote header, which I can navigate to and use &lt;code&gt;P-p&lt;/code&gt; to push commits to the remote, where other repositories I don't have a remote header, but can still push to remote using &lt;code&gt;P-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have deleted and re-added remotes using Magit, and doing this does not cause the header to appear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that the repos that &lt;em&gt;do&lt;/em&gt; have headers have remotes that were not added using Magit, but I could be mistaken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following in my &lt;code&gt;custom-set-variables&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(magit-status-headers-hook&#xA;   (quote&#xA;    (magit-insert-repo-header magit-insert-remote-header magit-insert-head-header magit-insert-upstream-header magit-insert-tags-header)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which gives me the &quot;repo&quot; and &quot;head&quot; headers (I don't use the other ones besides &quot;remote&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any guidance would be appreciated. I expect it's something simple I'm overlooking.&lt;/p&gt;&#xA;" OwnerUserId="8972" LastActivityDate="2015-07-20T23:21:28.487" Title="Magit: remote header not showing in magit-status" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14113" PostTypeId="1" CreationDate="2015-07-20T20:44:06.497" Score="2" ViewCount="608" Body="&lt;p&gt;By &lt;code&gt;preview-latex&lt;/code&gt; on can render latex formulae inside a &lt;code&gt;tex&lt;/code&gt; buffer. The package &lt;code&gt;px&lt;/code&gt; package renders latex formular inside an arbitrary buffer (see &lt;a href=&quot;https://emacs.stackexchange.com/a/219/&quot;&gt;https://emacs.stackexchange.com/a/219/&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar question: How to render latex expressions (not necessarily formulae) inside buffer? For example to render something like &lt;code&gt;\textbf{some text...}&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-20T12:17:01.990" Title="How to render latex expressions (not necessarily formula) inside buffer?" Tags="|latex|preview-latex|previewing|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14114" PostTypeId="1" AcceptedAnswerId="14117" CreationDate="2015-07-20T21:36:55.597" Score="0" ViewCount="54" Body="&lt;p&gt;So in ediff I can press &lt;code&gt;m&lt;/code&gt; to widen the frame but if I quit before pressing it again to restore to the original size, then the frame stays that size. I'd like to automate this so that if I forgot to press &lt;code&gt;m&lt;/code&gt; before quitting ediff, it will &quot;press&quot; &lt;code&gt;m&lt;/code&gt; for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found some elisp that claims to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ediff-cleanup-hook&#xA;  (lambda () (if ediff-wide-display-p 'ediff-toggle-wide-display)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it doesn't seem to be having any effect. Can this be done after all?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2015-07-20T22:21:13.110" Title="auto-unwiden ediff frame on quit" Tags="|hooks|ediff|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14115" PostTypeId="1" AcceptedAnswerId="14116" CreationDate="2015-07-20T22:09:15.050" Score="3" ViewCount="674" Body="&lt;p&gt;On the following setup:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Emacs 24.4.1 (i586-pc-linux-gnu, GTK+ Version 3.14.5) of 2015-03-07 on binet, modified by Debian&lt;/li&gt;&#xA;&lt;li&gt;Evil version 1.1.6&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I enter &lt;code&gt;M-x calendar&lt;/code&gt;, I find that several of the keybindings listed in the manual don't work. For example, instead of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Scroll-Calendar.html#Scroll-Calendar&quot; rel=&quot;nofollow&quot;&gt;scrolling forward by 3 months&lt;/a&gt;, &lt;code&gt;C-v&lt;/code&gt; instead enters Visual Block Mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without uninstalling evil-mode, by which means can I prevent the default keybindings being intercepted, so that they will function as described in the Emacs manual.&lt;/p&gt;&#xA;" OwnerDisplayName="user8341" LastActivityDate="2015-07-20T22:18:32.270" Title="Disable evil-mode in calendar" Tags="|init-file|evil|calendar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14116" PostTypeId="2" ParentId="14115" CreationDate="2015-07-20T22:18:32.270" Score="4" Body="&lt;p&gt;&lt;code&gt;(evil-set-initial-state 'calendar-mode 'emacs)&lt;/code&gt; should do what you want.&lt;/p&gt;&#xA;" OwnerUserId="8973" LastActivityDate="2015-07-20T22:18:32.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14117" PostTypeId="2" ParentId="14114" CreationDate="2015-07-20T22:21:13.110" Score="0" Body="&lt;p&gt;kovrik on IRC provided me with something that works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-toggle-ediff-wide-display ()&#xA;  &quot;Turn off wide-display mode (if was enabled) before quitting ediff.&quot;&#xA;  (when ediff-wide-display-p&#xA;    (ediff-toggle-wide-display)))&#xA;&#xA;(add-hook 'ediff-cleanup-hook 'my-toggle-ediff-wide-display)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm new to elisp, can someone tell me why this works and not what I had? I imagine it has to do with &lt;code&gt;ediff-wide-display-p&lt;/code&gt; having a different value when I use it in a lambda, or something to do with a buffer local variable or whatever.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2015-07-20T22:21:13.110" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14118" PostTypeId="1" AcceptedAnswerId="14119" CreationDate="2015-07-20T22:43:12.623" Score="5" ViewCount="624" Body="&lt;p&gt;When I try to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x 8 l&quot;) (lambda () (insert &quot;λ&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It just doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: commandp (lambda nil (insert &quot;λ&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know a decent way to do this?&lt;/p&gt;&#xA;" OwnerUserId="8725" LastActivityDate="2015-07-21T23:47:44.853" Title="Bind `C-x 8 l` to typing lambda (λ)" Tags="|key-bindings|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14119" PostTypeId="2" ParentId="14118" CreationDate="2015-07-20T22:53:11.973" Score="10" Body="&lt;p&gt;Keys can only be bound to &lt;em&gt;commands&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A command is (usually) a function which contains an &lt;code&gt;interactive&lt;/code&gt; form. This form must be included even if your function takes no arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x 8 l&quot;) (lambda () (interactive) (insert &quot;λ&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In addition, &lt;em&gt;keyboard macros&lt;/em&gt; are also commands, and can therefore similarly be bound to keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;λ&quot;&lt;/code&gt; is a valid keyboard macro for inserting a lambda character, and so (as per Dan's comment above) the following also works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x 8 l&quot;) &quot;λ&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Defining Commands&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/3555/454&quot;&gt;What is the difference between a function and a command?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-07-21T23:47:44.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14120" PostTypeId="2" ParentId="14112" CreationDate="2015-07-20T23:21:28.487" Score="1" Body="&lt;p&gt;The remote header is only known when we know for sure which one should be shown. I.e. when the current branch tracks a remote branch.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It might make sense to fall back to some other remote, likely &quot;origin&quot;. And maybe if there is no such remote to some random remote (in practice the first in alphabetic order).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun magit-insert-remote-header ()&#xA;  &quot;Insert a header line about the remote of the current branch.&quot;&#xA;  (-when-let (remote (or (magit-get-remote)&#xA;                         (let ((remotes (magit-list-remotes)))&#xA;                           (or (car (member &quot;origin&quot; remotes))&#xA;                               (car remotes)))))&#xA;    (magit-insert-section (remote remote)&#xA;      (magit-insert&#xA;       (concat (format &quot;%-10s&quot; &quot;Remote: &quot;)&#xA;               (propertize remote 'face 'magit-branch-remote) &quot; &quot;&#xA;               (magit-get &quot;remote&quot; remote &quot;url&quot;) &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In fact I have just added that.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-07-20T23:21:28.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14121" PostTypeId="2" ParentId="13328" CreationDate="2015-07-21T02:33:42.943" Score="3" Body="&lt;p&gt;First Thanks @Tobias for the answer which solved my problem. But after more test, I just found that still has small issue about the solution if use &lt;code&gt;expand-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if your environment variable is just string instead of real file name or directory (like ${USER}), the &lt;code&gt;expand-file-name&lt;/code&gt; would add some directory before that and that may not what your want. So you have to know what's the variable would look like before you code it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this problem, I just write a simple function which only apply &lt;code&gt;expand-file-name&lt;/code&gt; if the result of &lt;code&gt;subsitute-in-file-name&lt;/code&gt; start with &lt;code&gt;~&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ec-expand-env (str)&#xA;  &quot;Expand the environment variables in the STR.&quot;&#xA;  (let ((expanded-str (substitute-in-file-name str)))&#xA;    (if (string-prefix-p &quot;~&quot; expanded-str)&#xA;        (expand-file-name expanded-str)&#xA;      expanded-str)&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-07-21T02:33:42.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14122" PostTypeId="1" AcceptedAnswerId="14126" CreationDate="2015-07-21T05:29:55.507" Score="2" ViewCount="232" Body="&lt;p&gt;I'm using emacs on Windows and this is long bothered me. All other apps correctly ignore all listed in global .gitignore, but in emacs they are untracked/unregistered and pollute the status window.&lt;/p&gt;&#xA;" OwnerUserId="8977" LastActivityDate="2015-07-21T21:36:54.047" Title="Both VC and Magit cannot see global .gitignore" Tags="|magit|git|vc|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14123" PostTypeId="1" AcceptedAnswerId="14124" CreationDate="2015-07-21T07:54:03.123" Score="0" ViewCount="406" Body="&lt;p&gt;Perhaps this is more of a homebrew question, but I imagine someone here knows the answer. What is the best way to have two versions of emacs on OS X with homebrew? I need to be able to quickly switch between emacs 24 and 25 in order to properly test some packages I maintain, but it seems that switching between the two forces a full rebuild of emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figure I must be doing something wrong. So, what's the proper way to have two versions that I can quickly switch between? Is there some homebrew incantation that lets me unlink/link versions that are already built?&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="105" LastEditDate="2015-08-12T14:26:00.657" LastActivityDate="2015-08-12T14:26:00.657" Title="Running multiple emacs versions with homebrew" Tags="|emacs24|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14124" PostTypeId="2" ParentId="14123" CreationDate="2015-07-21T08:11:31.497" Score="1" Body="&lt;p&gt;Homebrew doesn't let you install multiple versions side-by-side.  You can however use the binaries from &lt;a href=&quot;http://emacsformacosx.com/builds&quot; rel=&quot;nofollow&quot;&gt;Emacs for Mac OS X&lt;/a&gt; to quickly switch between different Emacs versions.  I frequently use these builds to debug problems on older Emacs versions, or to bisect issues on Emacs 25.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-07-21T08:11:31.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14125" PostTypeId="1" AcceptedAnswerId="14141" CreationDate="2015-07-21T08:25:10.940" Score="6" ViewCount="870" Body="&lt;p&gt;&lt;code&gt;display-buffer-reuse-frames&lt;/code&gt; tells Emacs to re-use frames for displaying buffers.   However, as of 24.3 this variable is obsolete (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;display-buffer-reuse-frames is a variable defined in &lt;code&gt;window.el&lt;/code&gt;. &lt;br&gt;&#xA;  Its value is t &lt;br&gt;&#xA;  Original value was nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;This variable is obsolete since 24.3;&#xA;    use a &lt;code&gt;reusable-frames&lt;/code&gt; alist entry in &lt;code&gt;display-buffer-alist&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: &lt;br&gt;&#xA;  Non-nil means &lt;code&gt;display-buffer&lt;/code&gt; should reuse frames.&#xA;  If the buffer in question is already displayed in a frame, raise&#xA;  that frame.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I understand that I am supposed to replace that variable with &lt;code&gt;display-buffer-alist&lt;/code&gt;.  I'm familiar with the latter, and use it at many different places in my configuration, but nonetheless this docstring is a mystery to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What entry &lt;em&gt;exactly&lt;/em&gt; do I need to add to &lt;code&gt;display-buffer-alist&lt;/code&gt; to replicate this variable?  IOW, what entry do I need to add to &lt;code&gt;display-buffer-alist&lt;/code&gt; to make Emacs reuse frames for &lt;strong&gt;all buffers&lt;/strong&gt;, while still using the &lt;strong&gt;default display actions&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And please, dear Emacs developers, write less hand-wavy docstrings for obsolete options…&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-07-21T14:59:10.310" LastActivityDate="2015-07-22T16:09:18.470" Title="Replacing display-buffer-reuse-frames" Tags="|buffers|frames|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14126" PostTypeId="2" ParentId="14122" CreationDate="2015-07-21T08:29:10.153" Score="2" Body="&lt;p&gt;It turned out Emacs's &lt;code&gt;HOME&lt;/code&gt; and Git's were different. I've added the &lt;code&gt;HOME&lt;/code&gt; environment variable and moved my &lt;code&gt;.emacs&lt;/code&gt; there. All works fine now. Thanks @YoungFrog, you made me think about my &lt;code&gt;HOME&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8977" LastEditorUserId="25" LastEditDate="2015-07-21T21:36:54.047" LastActivityDate="2015-07-21T21:36:54.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14129" PostTypeId="1" AcceptedAnswerId="14133" CreationDate="2015-07-21T11:51:43.337" Score="9" ViewCount="593" Body="&lt;p&gt;When I'm in the middle of a looooong string, like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq Emacs-beta &quot;Which keyboard shortcut to use for navigating out of a string&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I skip out of it, just before the first &lt;code&gt;&quot;&lt;/code&gt; (after Emacs-beta) with a shortcut?&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2016-08-16T16:54:30.017" LastActivityDate="2016-08-16T16:54:30.017" Title="Which keyboard shortcut to use for navigating out of a string" Tags="|key-bindings|string|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14131" PostTypeId="2" ParentId="14129" CreationDate="2015-07-21T11:57:47.513" Score="3" Body="&lt;p&gt;It's doable like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun exit-string-backwards ()&#xA;  (interactive)&#xA;  (goto-char (nth 8 (syntax-ppss))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy-mode&lt;/a&gt;, pressing&#xA;&lt;kbd&gt;[&lt;/kbd&gt; will bring you to the start of the containing list, exiting any string.  Once you're at the start of the list, you can reach other parts easily, for example, to get to the end of &lt;code&gt;Emacs-beta&lt;/code&gt; press &lt;kbd&gt;2m&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-21T11:57:47.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14132" PostTypeId="1" CreationDate="2015-07-21T12:04:49.617" Score="4" ViewCount="2138" Body="&lt;p&gt;Edit: Answered my own question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past, when working with Emacs, C and etags, I was able to do &lt;code&gt;M-.&lt;/code&gt; and find a function definition. But I could also do &lt;code&gt;M-,&lt;/code&gt; and find all calls of that function. Very convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've recently started programming C with Emacs again. I've built a TAGS file with &lt;code&gt;etags&lt;/code&gt;. I can use &lt;code&gt;M-.&lt;/code&gt; but I can't use &lt;code&gt;M-,&lt;/code&gt;. When I look into the TAGS file, I see that there are only lines for the function definitions. There is no information where all the calls to that function are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my suspicion is that I should build the TAGS file differently. But I've read the man-page for &lt;code&gt;etags&lt;/code&gt;, and I can't find any options that might do what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing I could imagine is that the company where I worked in the past had a modified version of &lt;code&gt;etags&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We had a coding convention that function-calls should always have a space between name and open-bracket. E.g. &lt;code&gt;int my_function (int x){&lt;/code&gt; and calls should never have a space there. E.g. &lt;code&gt;x = my_function(1);&lt;/code&gt;. Could this be it ? Or is that unrelated ? &lt;/p&gt;&#xA;" OwnerUserId="8978" LastEditorUserId="8978" LastEditDate="2015-07-21T18:12:01.847" LastActivityDate="2015-07-21T18:12:01.847" Title="How to search for function calls, not just function definitions, with etags?" Tags="|search|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14133" PostTypeId="2" ParentId="14129" CreationDate="2015-07-21T13:05:09.477" Score="12" Body="&lt;h1&gt;Emacs 25 or newer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You want &lt;code&gt;C-M-u&lt;/code&gt; which runs the command &lt;code&gt;backward-up-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Move backward out of one level of parentheses.&#xA;  &lt;strong&gt;This command will also work on other parentheses-like expressions&#xA;  defined by the current language mode.&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;If ESCAPE-STRINGS is non-nil (as it is&#xA;  interactively), move out of enclosing strings as well.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-07-21T15:10:41.020" LastActivityDate="2015-07-21T15:10:41.020" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14134" PostTypeId="2" ParentId="14118" CreationDate="2015-07-21T14:01:24.227" Score="4" Body="&lt;p&gt;&#xA;You can also easily expand the &lt;code&gt;C-x 8&lt;/code&gt; bindings in this fashion:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'iso-transl)&#xA;;; Add custom bindings to &quot;C-x 8&quot; map&#xA;(dolist (binding '((&quot;l&quot; . [?λ]) ; greek small letter lambda&#xA;                   ))&#xA;  (define-key iso-transl-ctl-x-8-map (kbd (car binding)) (cdr binding)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you need to add more bindings, you simply add them to that alist.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/472062d743dbb553fc659367666590597cf74cb3/setup-files/setup-editing.el#L637-L668&quot; rel=&quot;nofollow&quot;&gt;how I use it&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'iso-transl)&#xA;;; Add custom bindings to &quot;C-x 8&quot; map&#xA;(dolist (binding '(;; &amp;gt;&#xA;                   (&quot;&amp;gt;&quot;       . nil) ; First unbind &quot;&amp;gt;&quot; from the map&#xA;                   (&quot;&amp;gt;=&quot;      . [?≥]) ; greater than or equal to&#xA;                   (&quot;&amp;gt;&amp;gt;&quot;      . [?≫]) ; much greater than&#xA;                   (&quot;&amp;gt;\&quot;&quot;     . [?»]) ; right-pointing double angle quotation mark&#xA;                   (&quot;&amp;gt;'&quot;      . [?›]) ; single right-pointing angle quotation mark&#xA;                   (&quot;&amp;gt;h&quot;      . [?☛]) ; black right pointing index&#xA;                   ;; &amp;lt;&#xA;                   (&quot;&amp;lt;&quot;       . nil) ; First unbind &quot;&amp;lt;&quot; from the map&#xA;                   (&quot;&amp;lt;=&quot;      . [?≤]) ; less than or equal to&#xA;                   (&quot;&amp;lt;&amp;lt;&quot;      . [?≪]) ; much less than&#xA;                   (&quot;&amp;lt;\&quot;&quot;     . [?«]) ; left-pointing double angle quotation mark&#xA;                   (&quot;&amp;lt;'&quot;      . [?‹]) ; single left-pointing angle quotation mark&#xA;                   (&quot;&amp;lt;h&quot;      . [?☚]) ; black left pointing index&#xA;                   ;; &quot;&#xA;                   (&quot;\&quot;`&quot;     . [?“]) ; left double quotation mark&#xA;                   (&quot;\&quot;'&quot;     . [?”]) ; right double quotation mark&#xA;                   ;; arrows&#xA;                   (&quot;&amp;lt;right&amp;gt;&quot; . [?→]) ; rightwards arrow&#xA;                   (&quot;&amp;lt;left&amp;gt;&quot;  . [?←]) ; leftwards arrow&#xA;                   (&quot;&amp;lt;up&amp;gt;&quot;    . [?↑]) ; upwards arrow&#xA;                   (&quot;&amp;lt;down&amp;gt;&quot;  . [?↓]) ; downwards arrow&#xA;                   ;; misc&#xA;                   (&quot;r&quot;       . [?▯]) ; white vertical rectangle&#xA;                   (&quot;R&quot;       . [?▮]) ; black vertical rectangle&#xA;                   (&quot;*r&quot;      . [?₹]) ; indian rupee sign&#xA;                   (&quot;1/3&quot;     . [?⅓]) ; fraction one third&#xA;                   (&quot;0&quot;       . [?​]) ; zero width space&#xA;                   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-07-21T14:01:24.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14135" PostTypeId="2" ParentId="14129" CreationDate="2015-07-21T14:18:55.820" Score="0" Body="&lt;p&gt;Here's one more way (which I tend to use more) just for variety. The solution is not specific to strings but it works for this use case too.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Install &lt;a href=&quot;https://github.com/doitian/iy-go-to-char&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;iy-go-to-char&lt;/code&gt;&lt;/a&gt; (also available on Melpa).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bind &lt;code&gt;iy-go-to-char-backward&lt;/code&gt; and &lt;code&gt;iy-go-to-char&lt;/code&gt; to your preferred bindings. &lt;em&gt;For the sake of this explanation, let's say you bound &lt;code&gt;iy-go-to-char-backward&lt;/code&gt; to &lt;code&gt;C-c C-,&lt;/code&gt;and &lt;code&gt;iy-go-to-char&lt;/code&gt; to &lt;code&gt;C-c C-.&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now if you are inside the string, you would call &lt;code&gt;iy-go-to-char-backward&lt;/code&gt; and type &lt;code&gt;&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That would look like &lt;code&gt;C-c C-, &amp;quot;&lt;/code&gt;. If you have &lt;code&gt;iy-go-to-char-continue-when-repeating&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt; (default), pressing &lt;code&gt;&amp;quot;&lt;/code&gt; once again will take you to a &lt;code&gt;&amp;quot;&lt;/code&gt; char occurrence before that, and so on.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are inside the string, and if you now want to go to the end of the string, you would call &lt;code&gt;iy-go-to-char&lt;/code&gt; and type &lt;code&gt;&amp;quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That would look like &lt;code&gt;C-c C-. &amp;quot;&lt;/code&gt;. If you have &lt;code&gt;iy-go-to-char-continue-when-repeating&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt; (default), pressing &lt;code&gt;&amp;quot;&lt;/code&gt; once again will take you to the next &lt;code&gt;&amp;quot;&lt;/code&gt; char occurrence.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-21T14:18:55.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14136" PostTypeId="1" CreationDate="2015-07-21T14:21:17.453" Score="0" ViewCount="134" Body="&lt;p&gt;Projectile, as of versions marmalade-0.10.0 and melpa-20150720.515, seems to have lost access to the &lt;code&gt;it&lt;/code&gt; variable. I think that &lt;code&gt;dash&lt;/code&gt; may have changed the variable's scope. How can I work around this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install &lt;code&gt;marmalade-0.10.0&lt;/code&gt; or &lt;code&gt;melpa-20150720.515&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Invoke &lt;code&gt;projectile-find-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-07-21T14:21:17.453" Title="Projectile void variable `it`" Tags="|projectile|dash.el|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14137" PostTypeId="1" CreationDate="2015-07-21T14:38:56.197" Score="2" ViewCount="281" Body="&lt;p&gt;I want to have a single line in a long-word wrapped line highlighted. The default setting of hl-line seems to highlight the whole wrapped line as shown below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Yyayl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which setting do I have to change to highlight only the line in which the cursor is located in a longer wrapped line? In the screenshot this would be the first line of the text.&lt;/p&gt;&#xA;" OwnerUserId="8982" LastEditorUserId="105" LastEditDate="2020-04-23T01:31:57.030" LastActivityDate="2020-04-23T01:31:57.030" Title="Highlight a single visual line within a physical line" Tags="|highlighting|visual-line-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="14139" PostTypeId="2" ParentId="2594" CreationDate="2015-07-21T14:58:52.027" Score="1" Body="&lt;p&gt;As the &lt;a href=&quot;https://emacs.stackexchange.com/a/7506/8516&quot;&gt;existing&lt;/a&gt; answer leaves out how to compile with &lt;code&gt;m17n&lt;/code&gt; support, I add this to answer that. In my system &lt;code&gt;m17n&lt;/code&gt; is not used and &lt;code&gt;otf&lt;/code&gt; is also not used. To build with &lt;code&gt;m17n&lt;/code&gt; support, install libraries needed for &lt;code&gt;m17n&lt;/code&gt; and also for &lt;code&gt;otf&lt;/code&gt;. Then Emacs will be compiled with both of them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know why compiling with &lt;code&gt;m17n&lt;/code&gt; requires &lt;code&gt;otf&lt;/code&gt; but this works :)&lt;/p&gt;&#xA;" OwnerUserId="8516" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-07-21T14:58:52.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14140" PostTypeId="1" CreationDate="2015-07-21T15:16:15.120" Score="0" ViewCount="124" Body="&lt;p&gt;Iedit-mode can narrow the edit to a region, I am using &lt;code&gt;evil-mode&lt;/code&gt;, &lt;code&gt;evil-visual-line&lt;/code&gt; select region by whole lines, after narrowing the point is at the end of last line, is it possible to fix this jumping and make it stay at the symbol's column? I have tried the following:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice iedit-mode (around iedit-around)&#xA;&amp;quot;fix cursor position&amp;quot;&#xA;(save-excursion ad-do-it))&#xA;(ad-activate 'iedit-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2022-05-26T14:27:19.537" LastActivityDate="2022-05-26T14:27:19.537" Title="restore cursor position iedit mode after narrowing with evil visul line" Tags="|evil|motion|advice|iedit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="14141" PostTypeId="2" ParentId="14125" CreationDate="2015-07-21T15:29:28.167" Score="6" Body="&lt;p&gt;&lt;code&gt;display-buffer&lt;/code&gt; merges the various alists. Something like this should apply &lt;code&gt;reuse-frames&lt;/code&gt; to all buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'display-buffer-alist&#xA;             '(&quot;.&quot; nil (reusable-frames . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively use &lt;code&gt;display-buffer-overriding-action&lt;/code&gt; or even &lt;code&gt;display-buffer-function&lt;/code&gt; (as a wrapper), if feasible.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="-1" LastEditDate="2015-07-22T16:09:18.470" LastActivityDate="2015-07-22T16:09:18.470" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14142" PostTypeId="1" CreationDate="2015-07-21T16:33:11.403" Score="4" ViewCount="1817" Body="&lt;p&gt;I want correct indentation with my C++ code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following piece of code indents properly. It nicely indents the access label and the member declaration independently.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Test : public Base {&#xA; public:&#xA;  int a;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However if I add a final keyword, the &lt;code&gt;public&lt;/code&gt; won't indent half-ways anymore.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Test final : public Base {&#xA;public:&#xA;  int a;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I go check with &lt;code&gt;C-c C-s&lt;/code&gt;, in the first case the line with &lt;code&gt;public&lt;/code&gt; returns &lt;code&gt;((inclass 1011) (access-label 1011))&lt;/code&gt;. But for the second case it returns &lt;code&gt;((label 1011))&lt;/code&gt;. Looks like &lt;code&gt;c++-mode&lt;/code&gt; is not able to detect that the second case is also a class definition, not a function definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if I have to do something to &lt;code&gt;c++-mode&lt;/code&gt; for it to support C++11 syntax.&lt;/p&gt;&#xA;" OwnerUserId="8346" LastActivityDate="2015-07-21T16:33:11.403" Title="Support C++11 syntax in c++-mode" Tags="|c++|cc-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14144" PostTypeId="2" ParentId="12145" CreationDate="2015-07-21T17:36:25.523" Score="2" Body="&lt;p&gt;Adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-path (cl-delete-if-not #'file-name-absolute-p load-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;.emacs.el&lt;/code&gt; fixed this problem for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem manifests itself unless I pass the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Initial-Options.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;--no-site-lisp&lt;/code&gt;&lt;/a&gt; option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I filed a &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21104&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-07-21T17:36:25.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14145" PostTypeId="1" AcceptedAnswerId="14151" CreationDate="2015-07-21T17:38:59.540" Score="1" ViewCount="1670" Body="&lt;p&gt;I want to use &lt;code&gt;mac-ports&lt;/code&gt; python instead of default Apple. When I exec &lt;code&gt;run-python&lt;/code&gt; I get the default python. I could not find any reference under &lt;code&gt;customize-group&lt;/code&gt;and &lt;code&gt;customize-variable&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="5202" LastEditorUserId="2274" LastEditDate="2015-07-21T22:31:41.463" LastActivityDate="2015-07-21T22:48:21.440" Title="How to customize run-python function?" Tags="|python|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14146" PostTypeId="2" ParentId="14132" CreationDate="2015-07-21T18:10:57.167" Score="4" Body="&lt;p&gt;I think I found the answer to my own question.&lt;br&gt;&#xA;We were probably using GNU's idutils.&lt;br&gt;&#xA;&lt;a href=&quot;http://www.gnu.org/software/idutils/manual/idutils.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/idutils/manual/idutils.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This package allows you to use mkid to make an ID file, just like etags makes a TAGS file. Then you can use the gid utility to search for functions. All I now need to do is install mkid and gid, and try to remember how I can integrate the gid command in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this question might be useful in the future for others. &lt;/p&gt;&#xA;" OwnerUserId="8978" LastActivityDate="2015-07-21T18:10:57.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14147" PostTypeId="1" AcceptedAnswerId="14156" CreationDate="2015-07-21T18:39:58.693" Score="1" ViewCount="364" Body="&lt;p&gt;I just installed &lt;code&gt;python-mode&lt;/code&gt; using melpa and therefore I must be on the latest version. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.emacs&lt;/code&gt; init file consists only of the following lines : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'python-mode &quot;python-mode&quot; &quot;Python Mode.&quot; t)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.py\\'&quot; . python-mode))&#xA;(add-to-list 'interpreter-mode-alist '(&quot;python&quot; . python-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I try to execute a program that runs fine in the terminal, but when I hit &lt;code&gt;C-c C-c&lt;/code&gt;, ie. &lt;code&gt;py-execute-buffer&lt;/code&gt;, there's the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;py-choose-shell-by-path: Wrong number of arguments: #[nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;followed by a trail of gibberish:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IB9OY.png&quot; alt=&quot;Gibberish&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;py-shell&lt;/code&gt; will result in the similar error message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs v24.5&#xA;OS X Yosemite 10.10.4&lt;/p&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2015-07-22T06:40:37.120" Title="Commands in Python-Mode not working (py-shell and C-c C-c)" Tags="|python|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14148" PostTypeId="1" CreationDate="2015-07-21T18:50:08.767" Score="3" ViewCount="389" Body="&lt;p&gt;I'm still a little confused about ERT. Is it for running regression tests of your elisp code or for running regression tests of other code too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example would I run my JUnit tests under ERT, and ERT would display the results, jump to the failures, and rerun specific tests?&lt;/p&gt;&#xA;" OwnerUserId="8984" LastActivityDate="2015-07-21T19:01:58.817" Title="What is ERT for?" Tags="|ert|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14149" PostTypeId="2" ParentId="14148" CreationDate="2015-07-21T19:01:58.817" Score="6" Body="&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;info&lt;/code&gt; -&gt; &lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(ert)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ERT is a tool for automated testing in Emacs Lisp.  Its main features&#xA;  are facilities for defining tests, running them and reporting the&#xA;  results, and for debugging test failures interactively.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;ERT is similar to tools for other environments such as JUnit, but has&#xA;  unique features that take advantage of the dynamic and interactive&#xA;  nature of Emacs.  Despite its name, it works well both for test-driven&#xA;  development (see&#xA;  `&lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Test-driven_development&lt;/a&gt;') and for&#xA;  traditional software development methods.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Reading info pages is a very useful Emacs skill. It's wise to learn it.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-21T19:01:58.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14150" PostTypeId="2" ParentId="14137" CreationDate="2015-07-21T19:25:17.540" Score="3" Body="&lt;p&gt;I've had this in my init.el for a while:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun highlight-visual-line ()&#xA;  (save-excursion&#xA;    (cons (progn (beginning-of-visual-line) (point))&#xA;          (progn (end-of-visual-line) (point)))))&#xA;&#xA;(setq hl-line-range-function 'highlight-visual-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is assuming you use &lt;code&gt;(global-hl-line-mode 1)&lt;/code&gt; to achieve that highlighting. I probably posted this as an answer either in this forum, or in SO section for Emacs questions, but cannot find it at the moment.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-21T19:25:17.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14151" PostTypeId="2" ParentId="14145" CreationDate="2015-07-21T22:32:43.327" Score="3" Body="&lt;p&gt;The variable you want is &lt;code&gt;python-shell-interpreter&lt;/code&gt;.  You can set it with &lt;code&gt;(setq python-shell-interpreter &quot;/path/to/python&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-07-21T22:32:43.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14152" PostTypeId="2" ParentId="14145" CreationDate="2015-07-21T22:48:21.440" Score="2" Body="&lt;p&gt;Also, if you want to set the Python interpreter on-the-fly, you can do &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;run-python&lt;/kbd&gt;, which will prompt for the interpreter to use:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;run-python&lt;/code&gt; is an interactive autoloaded compiled Lisp function in&#xA;  &lt;code&gt;python.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-python &amp;amp;optional CMD DEDICATED SHOW)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Run an inferior Python process.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Argument &lt;code&gt;CMD&lt;/code&gt; defaults to &lt;code&gt;python-shell-calculate-command&lt;/code&gt; return&#xA;  value.  &lt;strong&gt;When called interactively with &lt;code&gt;prefix-arg&lt;/code&gt;, it allows&#xA;  the user to edit such value&lt;/strong&gt; and choose whether the interpreter&#xA;  should be &lt;code&gt;DEDICATED&lt;/code&gt; for the current buffer.  When numeric prefix&#xA;  arg is other than 0 or 4 do not &lt;code&gt;SHOW&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For a given buffer and same values of &lt;code&gt;DEDICATED&lt;/code&gt;, if a process is&#xA;  already running for it, it will do nothing.  This means that if&#xA;  the current buffer is using a global process, the user is still&#xA;  able to switch it to use a dedicated one.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Runs the hook &lt;code&gt;inferior-python-mode-hook&lt;/code&gt; after&#xA;  &lt;code&gt;comint-mode-hook&lt;/code&gt; is run.  (Type &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;m&lt;/kbd&gt; in the&#xA;  process buffer for a list of commands.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-07-21T22:48:21.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14153" PostTypeId="1" AcceptedAnswerId="14445" CreationDate="2015-07-21T23:21:31.203" Score="9" ViewCount="1515" Body="&lt;p&gt;The source block what I want to evaluate (src2) need to source a file which should be the tangle result of another source block (src1). How could it make the tangle to file automatically everything time I evaluate the source block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;src1: should be tangle to file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+begin_src tcl :tangle /tmp/compile_lib.tcl&#xA;  &amp;lt;some tcl code&amp;gt;&#xA;+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;src2: would be evaluated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+begin_src sh&#xA;   vivado -mode batch -source /tmp/compile_lib.tcl    # source the file tangled from &amp;lt;src1&amp;gt;&#xA;+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2017-08-17T21:52:40.240" Title="How to automatically tangle another source block to file when evaluate a source block in org-mode?" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14154" PostTypeId="1" AcceptedAnswerId="14164" CreationDate="2015-07-22T02:43:04.553" Score="1" ViewCount="1115" Body="&lt;p&gt;I want to use evil mode with &lt;a href=&quot;https://github.com/leoliu/ggtags&quot; rel=&quot;nofollow&quot;&gt;ggtags&lt;/a&gt; but evil mode keeps taking some of the bindings such as &lt;code&gt;M-.&lt;/code&gt;. I'm new to emacs and I'm interested in learning what's going on. At first I tried explicitly setting the load order by using a lambda like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook&#xA;          '(lambda ()&#xA;             (evil-local-mode)&#xA;&#xA;             (when (derived-mode-p 'c-mode 'c++-mode 'java-mode 'rust-mode)&#xA;               (ggtags-mode 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then saw &lt;code&gt;evil-overriding-maps&lt;/code&gt; and &lt;code&gt;evil-intercept-maps&lt;/code&gt; but using them seemed to have no effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'evil-overriding-maps '(ggtags-mode-map . nil) t)&#xA;(add-to-list 'evil-intercept-maps '(ggtags-mode-map . nil) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I realize that I could just explicitly bind to &lt;code&gt;'ggtags-find-tag-dwim&lt;/code&gt; in one of the evil maps, but like I said I'm learning emacs and I'm wondering what's going on here and more importantly if there's a way to make it work without redoing all of the bindings that got clobbered. I figured using &lt;code&gt;evil-overriding-maps&lt;/code&gt; should do the trick but it doesn't seem to be. I did check the value of the variable with &lt;code&gt;C-h v&lt;/code&gt; and it did get added to that list.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2015-07-22T14:29:42.573" Title="evil mode with ggtags" Tags="|evil|gtags|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14155" PostTypeId="1" AcceptedAnswerId="14158" CreationDate="2015-07-22T04:58:15.767" Score="0" ViewCount="75" Body="&lt;p&gt;Prompt can be deleted when I do a run-scheme but not in run-python. Is there a way to make it standard i.e not to delete the prompts? I checked the comint-mode manual but couldn't find anything that controlled this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any advantages using comint over ansi-term? I am thinking if I should stick with ansi-term because the default behaviour is better. Only problem I have is to sync with my source code in a correct way (other than hacks like copy paste the clipboard etc)&lt;/p&gt;&#xA;" OwnerUserId="8796" LastEditorUserId="8796" LastEditDate="2015-07-22T05:04:00.500" LastActivityDate="2015-07-22T08:26:18.283" Title="Prompt can be be deleted in run-scheme but not in run-python?" Tags="|shell|comint|scheme|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14156" PostTypeId="2" ParentId="14147" CreationDate="2015-07-22T06:19:39.163" Score="2" Body="&lt;p&gt;When encountering a bug, please report it to the maintainer, as you will be not the only one affected  and it should get fixed for all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of python-mode.el:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://code.launchpad.net/python-mode&quot; rel=&quot;nofollow&quot;&gt;https://code.launchpad.net/python-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This time done:&#xA;&lt;a href=&quot;https://bugs.launchpad.net/python-mode/+bug/1476933&quot; rel=&quot;nofollow&quot;&gt;https://bugs.launchpad.net/python-mode/+bug/1476933&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After looking into &lt;code&gt;py-choose-shell-by-path&lt;/code&gt;: the lexical-let might have caused the error. Please check out current trunk, should be fixed.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2015-07-22T06:40:37.120" LastActivityDate="2015-07-22T06:40:37.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14157" PostTypeId="2" ParentId="14154" CreationDate="2015-07-22T08:17:59.447" Score="2" Body="&lt;p&gt;&lt;code&gt;M-.&lt;/code&gt; is looked up in &lt;a href=&quot;https://emacs.stackexchange.com/a/654/10&quot;&gt;loads of keymaps&lt;/a&gt; and a possible command to use is found in &lt;code&gt;evil-normal-state-map&lt;/code&gt;.  The easiest way around this is unbinding it there to allow Emacs to continue looking it up in other possible keymaps:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-maps&#xA;  '(define-key evil-normal-state-map (kbd &quot;M-.&quot;) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-07-22T11:46:03.873" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14158" PostTypeId="2" ParentId="14155" CreationDate="2015-07-22T08:26:18.283" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I can't reproduce this in &lt;code&gt;emacs -Q&lt;/code&gt;, the prompts can be deleted for both Scheme and Python buffers.  Customizing &lt;code&gt;comint-prompt-read-only&lt;/code&gt; gives me a read-only prompt for both again.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;ansi-term&lt;/code&gt; is much slower as it emulates a full terminal, should behave correctly and is less Emacs-like (captures more keys, harder to customize).  &lt;code&gt;comint&lt;/code&gt;-derived modes on the other hand are more light-weight, have their basic behaviour in common and can be customized to have extra features you need.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-22T08:26:18.283" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14159" PostTypeId="1" AcceptedAnswerId="14176" CreationDate="2015-07-22T08:55:12.057" Score="6" ViewCount="2282" Body="&lt;p&gt;Why do &lt;code&gt;(shell-command-to-string &quot;echo $PATH&quot;)&lt;/code&gt; and &lt;code&gt;echo $PATH&lt;/code&gt; in &lt;code&gt;eshell&lt;/code&gt; differ from &lt;code&gt;echo $PATH&lt;/code&gt; from &lt;code&gt;ansi-term&lt;/code&gt; and &lt;code&gt;gnome terminal&lt;/code&gt; in Ubuntu?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some paths are missing from &lt;code&gt;(shell-command-to-string &quot;echo $PATH&quot;)&lt;/code&gt; and &lt;code&gt;echo $PATH&lt;/code&gt; in &lt;code&gt;eshell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs apparently does not read &lt;code&gt;.bashrc&lt;/code&gt; nor &lt;code&gt;.bash_profile&lt;/code&gt; nor &lt;code&gt;.profile&lt;/code&gt;. Thus, paths added to &lt;code&gt;$PATH&lt;/code&gt; using &lt;code&gt;export PATH=&quot;&amp;lt;some_path&amp;gt;:$PATH&quot;&lt;/code&gt; in any of above files are not visible to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior is same when I connect to &lt;code&gt;emacsclient&lt;/code&gt; from terminal.&#xA;I'm using &lt;code&gt;emacs --deamon&lt;/code&gt; on startup.&lt;/p&gt;&#xA;" OwnerUserId="6551" LastEditorUserId="7045" LastEditDate="2015-07-22T23:08:30.387" LastActivityDate="2015-07-22T23:08:30.387" Title="Why Emacs overrides my PATH when it runs bash?" Tags="|shell|eshell|shell-command|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14160" PostTypeId="2" ParentId="14113" CreationDate="2015-07-22T11:24:54.150" Score="1" Body="&lt;p&gt;Putting &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tex-fold) &#xA;(add-hook 'LaTeX-mode-hook 'TeX-fold-mode) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in .emacs then &lt;code&gt;M-x TeX-fold-buffer&lt;/code&gt; (or the shortcut &lt;code&gt;C-c C-o C-b&lt;/code&gt;) can do what I was looking for. &lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-07-22T11:24:54.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14161" PostTypeId="1" AcceptedAnswerId="14194" CreationDate="2015-07-22T12:24:39.233" Score="2" ViewCount="1822" Body="&lt;p&gt;I am trying &lt;code&gt;python-sympy&lt;/code&gt; on Emacs using the the python shell. Problem arise when I try to display unicode characters. This is what I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; from sympy import *&#xA;&amp;gt;&amp;gt;&amp;gt; x = symbols('x')&#xA;&amp;gt;&amp;gt;&amp;gt; init_printing(use_unicode=True)&#xA;&amp;gt;&amp;gt;&amp;gt; solve(x**2 -2, x)&#xA;Traceback (most recent call last):&#xA;    File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;    File &quot;/Library/Python/2.7/site-packages/sympy-0.7.7.dev-py2.7.egg/sympy/interactive/printing.py&quot;, line 30, in _displayhook&#xA;      print(stringify_func(arg))&#xA;  UnicodeEncodeError: 'ascii' codec can't encode character u'\u221a' in position 2: ordinal not in range(128)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way of displaying unicode (I did not tried &lt;code&gt;ein-package&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="5202" LastActivityDate="2016-01-14T01:32:12.453" Title="How to get displayed unicode in python shell" Tags="|python|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14162" PostTypeId="1" CreationDate="2015-07-22T12:28:16.607" Score="4" ViewCount="508" Body="&lt;p&gt;I use &lt;code&gt;C-c C-e&lt;/code&gt; -&gt; &lt;code&gt;#&lt;/code&gt; -&gt; &lt;code&gt;default&lt;/code&gt; to insert the default template for &lt;code&gt;org-export&lt;/code&gt;. But some of the value of the options are not what I want. How could I modify the default template (change values or add more options)?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="184" LastEditDate="2015-07-22T13:44:56.523" LastActivityDate="2015-07-22T13:44:56.523" Title="How to update org-mode default template?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14163" PostTypeId="1" AcceptedAnswerId="14165" CreationDate="2015-07-22T13:39:30.717" Score="5" ViewCount="972" Body="&lt;p&gt;For example, I have created a keybinding for Emacs mini-buffer, that will receive the &lt;code&gt;[f9]&lt;/code&gt;-key as a confirmation (usually the &lt;code&gt;RET&lt;/code&gt;-key). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define-key minibuffer-local-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'exit-minibuffer)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use Evil mode, so would like to make a keybinding to &lt;code&gt;RET&lt;/code&gt; in the Evil command buffer (after when you're pressing &lt;code&gt;:&lt;/code&gt;). So that he will interpret the [f9]-key as an Enter/confirmation key. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When looking up in the documentation of Evil, I notice there are 6 state maps defined, but none of them applies on the command line, while in Vim you could map the keybindings on the command line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any solution on this?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-07-22T14:31:11.460" Title="How create keybindings for Evil command line?" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14164" PostTypeId="2" ParentId="14154" CreationDate="2015-07-22T14:29:42.573" Score="1" Body="&lt;p&gt;Similar questions have been asked so many times. Basically you want other minor-mode's keybindings take priority. No one can answer this question better than EVIL developer himself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; @see https://bitbucket.org/lyro/evil/issue/511/let-certain-minor-modes-key-bindings&#xA;(eval-after-load 'ggtags&#xA;  '(progn&#xA;     (evil-make-overriding-map ggtags-mode-map 'normal)&#xA;     ;; force update evil keymaps after ggtags-mode loaded&#xA;     (add-hook 'ggtags-mode-hook #'evil-normalize-keymaps)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-07-22T14:29:42.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14165" PostTypeId="2" ParentId="14163" CreationDate="2015-07-22T14:31:11.460" Score="5" Body="&lt;p&gt;That's pretty interesting.  Evil does actually provide &lt;code&gt;evil-ex-map&lt;/code&gt;, but it's for entering ex commands that are immediately executed without terminating them with &lt;code&gt;RET&lt;/code&gt;.  So I've looked a bit at the guts of &lt;code&gt;evil-ex&lt;/code&gt; to find out why &lt;code&gt;minibuffer-local-map&lt;/code&gt; isn't doing anything useful here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(minibuffer-with-setup-hook&#xA;    #'evil-ex-setup&#xA;  (setq result&#xA;        (read-from-minibuffer&#xA;         &quot;:&quot;&#xA;         (or initial-input&#xA;             (and evil-ex-previous-command&#xA;                  (format &quot;(default: %s) &quot; evil-ex-previous-command)))&#xA;         evil-ex-completion-map&#xA;         nil&#xA;         'evil-ex-history&#xA;         evil-ex-previous-command&#xA;         t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That third argument to &lt;code&gt;read-from-minibuffer&lt;/code&gt; is the keymap used &lt;em&gt;instead&lt;/em&gt; of &lt;code&gt;minibuffer-local-map&lt;/code&gt; for tasks like terminating input. In other words, customize &lt;code&gt;evil-ex-completion-map&lt;/code&gt; and you should be good to go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (eval-after-load 'evil-vars&#xA;   '(define-key evil-ex-completion-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'exit-minibuffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-22T14:31:11.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14166" PostTypeId="1" AcceptedAnswerId="14173" CreationDate="2015-07-22T14:39:08.120" Score="1" ViewCount="335" Body="&lt;p&gt;When running a command in the &lt;code&gt;*terminal*&lt;/code&gt; in emacs, I always have the command I executed repeated twice with some extra text before the output of the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo &quot;test&quot;&#xA;2;echo1;echotest&#xA;$ cd ~/a_path&#xA;2;cd1;cd&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea why this might be happening? I'm using &lt;a href=&quot;https://github.com/skwp/dotfiles&quot; rel=&quot;nofollow&quot;&gt;yadr&lt;/a&gt; for my zsh configuration (I'm trying out emacs from vim) and &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;spacemacs&lt;/a&gt; for emacs.&lt;/p&gt;&#xA;" OwnerUserId="8989" LastActivityDate="2015-07-22T20:16:51.870" Title="Extra output after every command running zsh in terminal" Tags="|term|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14167" PostTypeId="1" AcceptedAnswerId="14168" CreationDate="2015-07-22T15:34:20.947" Score="3" ViewCount="1110" Body="&lt;p&gt;I have a bash script which Sweaves .Rnw files into pdf's. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sweave_to_pdf ~/Foo.Rnw&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am wanting to write a emacs function to invoke this script on the current buffer. So far I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sweave_to_pdf ()&#xA;  &quot;sweave_to_pdf function&quot;&#xA;(interactive)&#xA;(shell-command&#xA;&quot;~/Scripts/Shell/sweave_to_pdf.sh&quot; (buffer-file-name (window-buffer (minibuffer-selected-window))))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems the file name and path of the buffer is not being passed to the shell script as a line argument. Any ideas how I could achieve this?&lt;/p&gt;&#xA;" OwnerUserId="8853" LastActivityDate="2017-06-29T02:33:52.113" Title="Shell Command with bash script and arguements" Tags="|shell-command|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14168" PostTypeId="2" ParentId="14167" CreationDate="2015-07-22T15:46:05.413" Score="2" Body="&lt;p&gt;The invocation needs to be a single string as the second and third argument refer to the output and error buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sweave-to-pdf ()&#xA;  &quot;sweave_to_pdf function&quot;&#xA;  (interactive)&#xA;  (shell-command (format &quot;%s %s&quot; &quot;~/Scripts/Shell/sweave_to_pdf.sh&quot;&#xA;                         buffer-file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-22T15:46:05.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14169" PostTypeId="1" CreationDate="2015-07-22T17:30:41.123" Score="2" ViewCount="319" Body="&lt;p&gt;Is there a way to select words respecting the case... camelCase, snakeCase... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.: i have a word &quot;trullyAwesomeFunction&quot; and cursor is on &quot;w&quot;, is there an Emacs function I could use that would select &quot;Awesome&quot; and then if used again select &quot;trully&quot; and then &quot;Function&quot;. and deselect them similarly? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say this function bound to &lt;code&gt;&amp;lt;C-up&amp;gt;&lt;/code&gt; I'm gonna have to press &lt;code&gt;&amp;lt;C-up&amp;gt;&lt;/code&gt; 3 times to select the entire word. And if it's snake case like: &quot;trully_awesome_function&quot; it would work the similar way.&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="105" LastEditDate="2019-02-11T17:38:49.593" LastActivityDate="2019-02-11T17:38:49.593" Title="Is there a case aware way to select words?" Tags="|key-bindings|words|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14170" PostTypeId="2" ParentId="14169" CreationDate="2015-07-22T17:41:20.350" Score="5" Body="&lt;p&gt;Take a look at &lt;code&gt;subword-mode&lt;/code&gt; (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/MixedCase-Words.html#MixedCase-Words&quot;&gt;manual&lt;/a&gt;), a built-in minor mode that makes standard movement and editing commands treat capital letters in camelCaseWords as word boundaries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you could enable &lt;code&gt;subword-mode&lt;/code&gt; and then use the standard &lt;code&gt;mark-word&lt;/code&gt; command (&lt;code&gt;M-@&lt;/code&gt;) to mark the fragments of &quot;trulyAwesomeFunction&quot; one at a time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With snake_case, the underscore is already treated as a word boundary by default. In fact there is another minor mode -- &lt;code&gt;superword-mode&lt;/code&gt; -- that can be enabled if you want the standard word commands to not treat _ as a boundary. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-07-22T17:47:35.100" LastActivityDate="2015-07-22T17:47:35.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14171" PostTypeId="1" AcceptedAnswerId="14172" CreationDate="2015-07-22T19:33:08.063" Score="5" ViewCount="898" Body="&lt;p&gt;When viewing the commit log, can I select a commit and checkout that commit as the head of a new branch?&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-07-22T20:06:07.867" Title="How to create a new branch from old commit using magit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14172" PostTypeId="2" ParentId="14171" CreationDate="2015-07-22T20:06:07.867" Score="8" Body="&lt;p&gt;In a magit-log buffer, place your cursor over the commit you want to branch from and run &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;magit-branch-and-checkout&lt;/code&gt;&lt;kbd&gt;enter&lt;/kbd&gt;. You'll be prompted for a branch name, then for a starting point, the default starting point will be the branch under your cursor so you can just hit &lt;kbd&gt;enter&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-07-22T20:06:07.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14173" PostTypeId="2" ParentId="14166" CreationDate="2015-07-22T20:16:51.870" Score="2" Body="&lt;p&gt;This appears to be your &lt;code&gt;zsh&lt;/code&gt; config attempting to set the terminal title. It's common for shells to set the terminal title to the currently running command so you can identify when the command has completed. Emacs does not recognize the escape sequences used to set the terminal title (indeed, they are not standard and vary from terminal to terminal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I rolled my own &lt;code&gt;zsh&lt;/code&gt; &lt;a href=&quot;https://github.com/PythonNut/zsh-config/blob/dev/modules/21_title.zsh&quot; rel=&quot;nofollow&quot;&gt;title engine&lt;/a&gt;, I ran into this. You can binary search your &lt;code&gt;zsh&lt;/code&gt; config, and wrap the title bits in this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ -z ${EMACS+1} ]]; then&#xA;  # title stuff here&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, of course, you can remove them completely. &lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-07-22T20:16:51.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14174" PostTypeId="1" AcceptedAnswerId="14175" CreationDate="2015-07-22T20:52:19.963" Score="3" ViewCount="90" Body="&lt;p&gt;It is pleasure to ask you about something I cannot solve myself. I am working with big text files with many similar lines. The format of the files is defined and I want to replace repetitively some characters appearing in some columns of the files. For example I would like to substitute in a file similar to this below, when the last number 3.0e-4 is, from the 5th to the 7th character by aaa, in this case yyy will be substitute by aaa:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ASDEFxxx          3.0E+12ERT          SAA      1.0e-4&#xA;ASEEFyyy          4.0E+12EDT          ABA      3.0e-4&#xA;ASAEFzzz          5.0E+12ERF          ADA      2.0e-4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this example I would like to use replace regexp to replace in this case only the second line. The result should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ASDEFxxx          3.0E+12ERT          SAA      1.0e-4&#xA;ASEEFaaa          4.0E+12EDT          ABA      3.0e-4&#xA;ASAEFzzz          5.0E+12ERF          ADA      2.0e-4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are many lines in the file to be substituted...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody write the command with replace regexp to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks and regards,&#xA;Manuel&lt;/p&gt;&#xA;" OwnerUserId="8995" LastEditorUserId="654" LastEditDate="2015-07-22T20:57:41.573" LastActivityDate="2015-07-22T21:15:13.500" Title="Processing of text" Tags="|replace|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14175" PostTypeId="2" ParentId="14174" CreationDate="2015-07-22T21:15:13.500" Score="7" Body="&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;h&lt;/kbd&gt; &lt;kbd&gt;C-M-%&lt;/kbd&gt; &lt;code&gt;\(.\{5\}\).\{3\}\(.*3.0e-4\)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;\1aaa\2&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dissection:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;h&lt;/kbd&gt; select the whole file&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-M-%&lt;/kbd&gt; run &lt;code&gt;query-replace-regexp&lt;/code&gt; (you may want &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;replace-regexp&lt;/code&gt; instead)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\(.\{5\}\)&lt;/code&gt; capture 5 characters into the group &lt;code&gt;\1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;.\{3\}&lt;/code&gt; match three characters (will discard)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\(.*3.0e-4\)&lt;/code&gt; match the rest of the line, ensuring &lt;code&gt;3.0e-4&lt;/code&gt; and capture in &lt;code&gt;\2&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-07-22T21:15:13.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14176" PostTypeId="2" ParentId="14159" CreationDate="2015-07-22T22:05:58.597" Score="7" Body="&lt;p&gt;As Gilles mentioned in the comment above, emacs does not read the local env settings unless specifically asked to. The easiest way to keep variables in shell terminals inside and outside Emacs is to use a package, such as the Steve Purcell's package &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once installed, this package ensures each time you start a shell in emacs, it reads the necessary local settings with this command in init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(exec-path-from-shell-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I usually put this before invoking package repository commands in the init.el file so external dependencies, if any, are made available without causing missing command errors.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-07-22T22:05:58.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14177" PostTypeId="2" ParentId="12938" CreationDate="2015-07-22T22:30:09.897" Score="4" Body="&lt;p&gt;Since you ask for &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(different for different files, and defined in the file itself)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;then, try this &lt;a href=&quot;https://emacs.stackexchange.com/a/13035/7045&quot;&gt;solution&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-07-22T22:30:09.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14178" PostTypeId="2" ParentId="3863" CreationDate="2015-07-23T00:07:30.657" Score="2" Body="&lt;p&gt;One option is to publish the org-mode files to HTML and browse the HTML versions from the mobile device.  I have my org-mode files stored in DropBox and set up as a project using &lt;a href=&quot;http://orgmode.org/guide/Publishing.html&quot; rel=&quot;nofollow&quot;&gt;org-publish-project-alist&lt;/a&gt;, and I use &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;org-publish-all&lt;/code&gt; to export them all to HTML files.  I customized the HTML slightly to improve the mobile view.  On my mobile device, I use the DropBox application to browse to the HTML version of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This setup works fine.  I do have to remember to publish after making edits, and I plan eventually to write a hook that does this automatically.  The biggest drawback is that it doesn't allow editing on the mobile device.  Also, the mobile version is usable but a dedicated mobile application would be nicer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The HTML customization I use for mobile display goes into &lt;code&gt;org-html-head-extra&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1&quot;&amp;gt;&#xA;&amp;lt;style type=&quot;text/css&quot;&amp;gt;&#xA;  h2 { font-size: 1em; }&#xA;  h1 { font-size: 1.2em; }&#xA;  body { font-family: Calibri; }&#xA;&amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8997" LastActivityDate="2015-07-23T00:07:30.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14179" PostTypeId="1" AcceptedAnswerId="14180" CreationDate="2015-07-23T02:56:54.267" Score="1" ViewCount="635" Body="&lt;p&gt;Only when &lt;code&gt;rust-mode&lt;/code&gt; is enabled, what is the best way to insert a newline after a press on the &lt;code&gt;;&lt;/code&gt; key? This is what I have actually:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-rust-lang-mode-config ()&#xA;   (local-set-key (kbd &quot;;&quot;) (lambda () (interactive) (insert &quot;;&quot;)(newline-and-indent))))&#xA;(add-hook 'rust-mode-hook 'my-rust-lang-mode-config) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-07-23T04:10:35.903" Title="Add newline after a semicolon keypress" Tags="|key-bindings|rust|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14180" PostTypeId="2" ParentId="14179" CreationDate="2015-07-23T03:09:25.147" Score="3" Body="&lt;p&gt;The &quot;&lt;em&gt;best&lt;/em&gt;&quot; way?  Dunno.  Define your criteria for &quot;best&quot;.  Looks OK to me, FWIW.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would probably just do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key 'rust-mode-map &quot;;&quot; (lambda () ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That assumes the mode map is &lt;code&gt;rust-mode-map&lt;/code&gt;.  Oh, and I would also probably name the command, instead of using an anonymous function -- makes it easier to work with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it probably doesn't make a lot of difference how you create the key binding.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-23T03:30:29.987" LastActivityDate="2015-07-23T03:30:29.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14181" PostTypeId="2" ParentId="14179" CreationDate="2015-07-23T04:10:35.903" Score="2" Body="&lt;p&gt;An even shorter way:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key 'rust-mode-map &quot;;&quot; (kbd &quot;C-q ; RET&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-07-23T04:10:35.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14182" PostTypeId="1" AcceptedAnswerId="14186" CreationDate="2015-07-23T06:48:10.703" Score="0" ViewCount="529" Body="&lt;p&gt;I have list of words to capitalize automatically&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-capital-words '(&quot;Foo&quot; &quot;bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have one more function which adds word at point to this list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun add-to-capital-words ()&#xA;  &quot;Add words&quot;&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when ever i add words, they will be saved only for that session. When i restart emacs they will be gone. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i save those values permanently in config, so that they will be updated on multiple systems also?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-23T10:52:49.817" Title="How to permanently save modified variable in emacs config?" Tags="|init-file|variables|" AnswerCount="3" CommentCount="1" ClosedDate="2015-07-23T16:45:31.157" ContentLicense="CC BY-SA 3.0" />
  <row Id="14183" PostTypeId="1" CreationDate="2015-07-23T06:55:45.823" Score="2" ViewCount="174" Body="&lt;p&gt;After initialising pallet for my package managment I forgot to add the requisite line to my init.el :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having now added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(pallet-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To my init.el is there a way to diagnose which (if any) packages are not under pallet and cask's control?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="459" LastEditorUserId="5187" LastEditDate="2015-07-23T07:11:20.957" LastActivityDate="2016-02-21T11:56:30.237" Title="Finding packages not managed by pallet" Tags="|package|cask|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14184" PostTypeId="2" ParentId="14182" CreationDate="2015-07-23T09:47:16.360" Score="1" Body="&lt;p&gt;So it seems you need some kind of serialization. Take a look at &lt;a href=&quot;https://github.com/tarsius/save-sexp&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;save-sexp&lt;/code&gt;&lt;/a&gt; package, &lt;a href=&quot;http://melpa.org/#/save-sexp&quot; rel=&quot;nofollow&quot;&gt;available via MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-23T09:47:16.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14185" PostTypeId="2" ParentId="14182" CreationDate="2015-07-23T10:33:07.297" Score="0" Body="&lt;p&gt;Install package &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET save-sexp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whenever a variable is modified, save in a seperate file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-capital-words '(&quot;Foo&quot; &quot;bar&quot;))&#xA;(save-sexp-save-setq &quot;~/.emacs.d/variables.el&quot; 'auto-capital-words)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To load the variables &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;&quot;~/.emacs.d/variables.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-23T10:33:07.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14186" PostTypeId="2" ParentId="14182" CreationDate="2015-07-23T10:52:49.817" Score="2" Body="&lt;p&gt;Emacs can do this by default, with its &lt;code&gt;savehist&lt;/code&gt; library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/a/7711/454&quot;&gt;https://emacs.stackexchange.com/a/7711/454&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-07-23T10:52:49.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14187" PostTypeId="1" AcceptedAnswerId="14188" CreationDate="2015-07-23T11:07:42.773" Score="6" ViewCount="1578" Body="&lt;p&gt;As I understand, Emacs doesn't really support multi-threading. Because of&#xA;this I've chosen to run some operation (it can take a while) with &lt;code&gt;compile&lt;/code&gt;&#xA;function. This is asynchronous and all in all it seemed like a good solution&#xA;at first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I need to wait until compilation ends and perform other actions (again&#xA;they should not freeze Emacs, so they will be probably new &lt;code&gt;compile&lt;/code&gt; calls)&#xA;once it's finished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, it would be good if there were &lt;code&gt;after-compilation-hook&lt;/code&gt; or something&#xA;like that, because &lt;code&gt;compilation-exit-message-function&lt;/code&gt; doesn't work, as it's&#xA;called when compilation is not formally finished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way I can perform actions after compilation process (I'm&#xA;referring to process created by &lt;code&gt;compile&lt;/code&gt;)? Please note that I cannot&#xA;concatenate all commands into one big command and feed it to &lt;code&gt;compile&lt;/code&gt; at&#xA;once because the commands are not known in advance.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-23T11:10:30.890" Title="Run code right after compilation" Tags="|elisp|hooks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14188" PostTypeId="2" ParentId="14187" CreationDate="2015-07-23T11:10:30.890" Score="12" Body="&lt;p&gt;Try using &lt;code&gt;compilation-finish-functions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-compilation-finish-function (buffer desc)&#xA;  (message &quot;Buffer %s: %s&quot; buffer desc))&#xA;(add-hook 'compilation-finish-functions 'my-compilation-finish-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-23T11:10:30.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14190" PostTypeId="1" CreationDate="2015-07-23T12:17:09.790" Score="2" ViewCount="377" Body="&lt;p&gt;OSX Yosemite 10.10.4, emacs installed via &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;brew install emacs-mac&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.4.0, Carbon Version 157 AppKit 1348.17) of 2015-07-20 on Rainers-MacBook-Pro.local&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to start emacs as a daemon but I get the following error when starting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;02:12:24 ~$ emacs --daemon&#xA;Loading /Users/rainerkrug/.emacs.d/emacs.el (source)...&#xA;Loading quail/latin-pre...&#xA;Loading quail/latin-pre...done&#xA;&#xA;&#xA;Loading package uniquify...&#xA;Configuring package uniquify...&#xA;Configuring package uniquify...done&#xA;Loading package uniquify...done&#xA;Loading package exec-path-from-shell...&#xA;Configuring package exec-path-from-shell...&#xA;Configuring package exec-path-from-shell...done (0.242s)&#xA;Loading package exec-path-from-shell...done (0.245s)&#xA;Loading package epa...&#xA;Configuring package epa...&#xA;Configuring package epa...done&#xA;Loading package epa...done&#xA;`epa-file' already enabled&#xA;Loading package highlight-parentheses...&#xA;Configuring package highlight-parentheses...&#xA;Configuring package highlight-parentheses...done&#xA;Loading package highlight-parentheses...done&#xA;Loading package autopair...&#xA;Configuring package autopair...&#xA;Configuring package autopair...done&#xA;Loading package autopair...done&#xA;Try library `outorg-export' for automated export to all Org&#xA;       backends:&#xA;https://github.com/jleechpe/outorg-export&#xA;.emacs.d/.cask/24.5.1/elpa/sr-speedbar-20141004.532/sr-speedbar.elc:Warning:&#xA;    reference to free variable `helm-alive-p'&#xA;Loading package sos...&#xA;Loading package sos...done&#xA;Loading package dired-details...&#xA;Loading package dired-details...done&#xA;Loading package pdf-tools...&#xA;Loading package pdf-tools...done (0.224s)&#xA;Loading package imenu-anywhere...&#xA;Loading package imenu-anywhere...done&#xA;&#xA;Backtrace:&#xA;0   emacs                               0x00000001000c2a4a emacs_backtrace + 87&#xA;1   emacs                               0x00000001000a7e3d terminate_due_to_signal + 97&#xA;2   emacs                               0x00000001000c3455 tcsetpgrp_without_stopping + 0&#xA;3   emacs                               0x00000001000c28f3 maybe_fatal_sig + 0&#xA;4   libsystem_platform.dylib            0x00007fff95c1ff1a _sigtramp + 26&#xA;5   ???                                 0x0000000000000000 0x0 + 0&#xA;6   libdispatch.dylib                   0x00007fff98658cfc _dispatch_mach_msg_send + 1690&#xA;7   libdispatch.dylib                   0x00007fff986585e4 dispatch_mach_send + 326&#xA;8   libxpc.dylib                        0x00007fff91d7c3b8 xpc_connection_send_message_with_reply + 114&#xA;9   CoreFoundation                      0x00007fff94395b6f __80-[CFPrefsSearchListSource generationCountFromListOfSources:count:allowFetching:]_block_invoke_2 + 143&#xA;10  CoreFoundation                      0x00007fff943c655b _CFPrefsWithDaemonConnection + 331&#xA;11  CoreFoundation                      0x00007fff94395ac6 __80-[CFPrefsSearchListSource generationCountFromListOfSources:count:allowFetching:]_block_invoke + 150&#xA;12  CoreFoundation                      0x00007fff943959d2 -[CFPrefsSearchListSource generationCountFromListOfSources:count:allowFetching:] + 258&#xA;13  CoreFoundation                      0x00007fff94251ea5 -[CFPrefsSearchListSource alreadylocked_copyDictionary] + 133&#xA;14  CoreFoundation                      0x00007fff9424cdba -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] + 42&#xA;15  CoreFoundation                      0x00007fff943c711c ___CFPreferencesCopyAppValueWithContainer_block_invoke + 60&#xA;16  CoreFoundation                      0x00007fff94394979 +[CFPrefsSearchListSource withSearchListForIdentifier:container:perform:] + 729&#xA;17  CoreFoundation                      0x00007fff943c7097 _CFPreferencesCopyAppValueWithContainer + 183&#xA;18  emacs                               0x000000010016d069 Fmac_get_preference + 386&#xA;19  emacs                               0x0000000100117da9 Ffuncall + 1075&#xA;20  emacs                               0x000000010014a8ae exec_byte_code + 2147&#xA;21  emacs                               0x00000001001187da funcall_lambda + 750&#xA;22  emacs                               0x0000000100117bc9 Ffuncall + 595&#xA;23  emacs                               0x000000010014a8ae exec_byte_code + 2147&#xA;24  emacs                               0x0000000100114c0b eval_sub + 1688&#xA;25  emacs                               0x0000000100115419 Fdefvar + 101&#xA;26  emacs                               0x0000000100114a0c eval_sub + 1177&#xA;27  emacs                               0x00000001001342d4 readevalloop + 1446&#xA;28  emacs                               0x0000000100133045 Fload + 2062&#xA;29  emacs                               0x000000010011f713 Frequire + 524&#xA;30  emacs                               0x0000000100117d85 Ffuncall + 1039&#xA;31  emacs                               0x000000010014a8ae exec_byte_code + 2147&#xA;32  emacs                               0x0000000100114c0b eval_sub + 1688&#xA;33  emacs                               0x00000001001342d4 readevalloop + 1446&#xA;34  emacs                               0x0000000100133045 Fload + 2062&#xA;35  emacs                               0x000000010011f713 Frequire + 524&#xA;36  emacs                               0x0000000100114c0b eval_sub + 1688&#xA;37  emacs                               0x000000010011646f internal_lisp_condition_case + 543&#xA;38  emacs                               0x000000010014b6d9 exec_byte_code + 5774&#xA;39  emacs                               0x00000001001187da funcall_lambda + 750&#xA;40  emacs                               0x0000000100117bc9 Ffuncall + 595&#xA;...&#xA;Error: server did not start correctly&#xA;02:12:41 ~$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When using &lt;code&gt;emacs -Q --daemon&lt;/code&gt; the daemon starts without problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestrions how I can find out what is causing the error, without having to disect my emacs.el file?&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2015-07-23T13:34:48.760" Title="Crash when starting daemon but not when starting normal" Tags="|init-file|emacsclient|emacs-daemon|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14191" PostTypeId="2" ParentId="14190" CreationDate="2015-07-23T13:34:48.760" Score="4" Body="&lt;p&gt;Bisecting the emacs.el init file by inserting &lt;code&gt;(error &quot;Done)&lt;/code&gt; to quit the init file at that location, I was able to quickly find the offending call, in my case &lt;code&gt;(org-mobile-pull)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2015-07-23T13:34:48.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14192" PostTypeId="2" ParentId="14183" CreationDate="2015-07-23T15:34:03.367" Score="1" Body="&lt;p&gt;My understanding of the way pallet works is that it looks at your currently installed list of packages and writes out the Cask file accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, it's not as if in the intervening time any package installs or removals won't be tracked, since when pallet is initialized it says &quot;What packages are installed NOW&quot;.&lt;/p&gt;&#xA;" OwnerUserId="8834" LastActivityDate="2015-07-23T15:34:03.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14193" PostTypeId="2" ParentId="13323" CreationDate="2015-07-23T16:01:53.207" Score="1" Body="&lt;p&gt;You should try two twings:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open Terminal and type &lt;code&gt;surfraw -elvi&lt;/code&gt;. If you get &lt;code&gt;GLOBAL ELVI:&lt;/code&gt; and nothing else go to next step&lt;/li&gt;&#xA;&lt;li&gt;Install &lt;code&gt;gnu-sed&lt;/code&gt; from &lt;code&gt;Mac-Ports&lt;/code&gt;. And relink the new &lt;code&gt;gnu-sed&lt;/code&gt; with the old one (I think it's located on /usr/bin/sed/)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5202" LastActivityDate="2015-07-23T16:01:53.207" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14194" PostTypeId="2" ParentId="14161" CreationDate="2015-07-23T16:38:16.737" Score="2" Body="&lt;p&gt;I found the answer in &lt;a href=&quot;https://apple.stackexchange.com/questions/135522/iterm2-unicode-and-sympy&quot;&gt;this&lt;/a&gt; StackExchange answer.  Basically, you need to be sure that the &lt;code&gt;PYTHONIOENCODING&lt;/code&gt; environment variable is set to &lt;code&gt;utf-8&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To try this out in your running emacs you can do M-x setenv and answer the prompts accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, this isn't actually an emacs specific problem at all.  I saw the same problem and the same solution worked in iTerm2.&lt;/p&gt;&#xA;" OwnerUserId="8834" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:30.630" LastActivityDate="2015-07-23T16:38:16.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14195" PostTypeId="1" AcceptedAnswerId="14204" CreationDate="2015-07-23T17:08:55.553" Score="18" ViewCount="4778" Body="&lt;p&gt;This is a follow-up on the comments on &lt;a href=&quot;https://emacs.stackexchange.com/a/13975/2429&quot;&gt;this answer&lt;/a&gt;. The following bits of code seem to be equivalent:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(and a b)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(when a b)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course &lt;code&gt;and&lt;/code&gt; lets you put more conditions: &lt;code&gt;(and a b c d)&lt;/code&gt; means &lt;code&gt;(when (and a b c) d)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to use &lt;code&gt;when&lt;/code&gt; only to express branching. Are there actual differences? Is it better to use one or the other?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have Emacs' C source at hand; &lt;code&gt;and&lt;/code&gt; is a C function; &lt;code&gt;when&lt;/code&gt; is a macro that expands to &lt;code&gt;if&lt;/code&gt;, which itself is a C function.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="105" LastEditDate="2023-12-07T20:13:24.917" LastActivityDate="2023-12-07T20:13:24.917" Title="&quot;and&quot; vs &quot;when&quot; for conditionals" Tags="|elisp-macros|conditionals|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14196" PostTypeId="2" ParentId="13777" CreationDate="2015-07-23T17:23:06.360" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Does there exist some similar trick in emacs - a way to turn currently running foreground (synchronous) command into backgroundized (asynchronous) one? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I suspect no such trick exists. The problem is that the synchronous shell command (which is really &lt;code&gt;call-process-region&lt;/code&gt;) blocks the emacs event loop. The only way to break it is to kill the process with a USR1 or USR2 signal or do &lt;kbd&gt;C-g&lt;/kbd&gt;. (There may be other ways, but that's what I do).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means there's nothing you can do because you don't have a way to invoke the trick, as Emacs does not process input while the event loop is stalled.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;One thing you &lt;em&gt;can&lt;/em&gt; do is simply swap the keys:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;M-!&quot;) #'async-shell-command)&#xA;(global-set-key (kbd &quot;M-&amp;amp;&quot;) #'shell-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-07-23T17:23:06.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14197" PostTypeId="1" AcceptedAnswerId="14201" CreationDate="2015-07-23T17:23:15.583" Score="34" ViewCount="23112" Body="&lt;p&gt;I have a file with xml all on one line. Does the functionality already exist to reformat this buffer to be somewhat user-readable?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2021-06-17T13:49:56.067" Title="How to prettify/format an XML buffer?" Tags="|formatting|nxml|xml|" AnswerCount="6" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14198" PostTypeId="2" ParentId="14195" CreationDate="2015-07-23T17:24:45.770" Score="6" Body="&#xA;&#xA;&lt;p&gt;Let me start off by saying that &lt;code&gt;(and a b)&lt;/code&gt; and &lt;code&gt;(when a b)&lt;/code&gt; in your example do the same thing: First &lt;code&gt;a&lt;/code&gt; is evaluated. &lt;code&gt;b&lt;/code&gt; is evaluated if &lt;code&gt;a&lt;/code&gt; is &lt;em&gt;true&lt;/em&gt;&lt;sup&gt;#&lt;/sup&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But&lt;/strong&gt; &lt;code&gt;and&lt;/code&gt; and &lt;code&gt;when&lt;/code&gt; are used for different things.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You would use &lt;code&gt;(and a b)&lt;/code&gt; to return &lt;em&gt;true&lt;/em&gt;&lt;sup&gt;#&lt;/sup&gt; if BOTH &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; are &lt;em&gt;true&lt;/em&gt;&lt;sup&gt;#&lt;/sup&gt; (or non-nil); and &lt;code&gt;nil&lt;/code&gt; otherwise. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You would use &lt;code&gt;(when a b)&lt;/code&gt; or to be more correct,  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when a&#xA;   ;; do something like b&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when you want the &quot;b&quot; code to execute if and only if &lt;code&gt;a&lt;/code&gt; is &lt;em&gt;true&lt;/em&gt;&lt;sup&gt;#&lt;/sup&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an example where you use &lt;code&gt;when&lt;/code&gt; and &lt;code&gt;and&lt;/code&gt; together:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (and a b)&#xA;   (do-c))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Above, the function &lt;code&gt;do-c&lt;/code&gt; is called ONLY if BOTH &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; are &lt;em&gt;true&lt;/em&gt;&lt;sup&gt;#&lt;/sup&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;References for study&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Conditionals.html&quot; rel=&quot;noreferrer&quot;&gt;Elisp - Conditionals&lt;/a&gt; &lt;em&gt;(look for the &lt;code&gt;when&lt;/code&gt; section in here)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Combining-Conditions.html&quot; rel=&quot;noreferrer&quot;&gt;Elisp - Combining Conditions&lt;/a&gt; &lt;em&gt;(look for the &lt;code&gt;and&lt;/code&gt; section in here)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;# &lt;strong&gt;All references to &lt;em&gt;true&lt;/em&gt; refer to the Boolean TRUE.&lt;/strong&gt;&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-23T17:46:04.433" LastActivityDate="2015-07-23T17:46:04.433" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14199" PostTypeId="1" CreationDate="2015-07-23T18:11:10.417" Score="40" ViewCount="10957" Body="&#xA;&#xA;&lt;p&gt;Emacs Lisp does not have syntactical support for non-nil defaults of optional parameters. What is the recommended idiom for supplying these parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify my point, here is one overly explicit way of doing so.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun command (a &amp;amp;optional supplied-b)&#xA;  (let ((b (or supplied-b default-b)))&#xA;    (command-body a b)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What, if anything, is the recommended style?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="115" LastEditDate="2015-07-23T18:25:24.767" LastActivityDate="2017-03-19T18:22:19.190" Title="Optional parameter defaults" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14200" PostTypeId="1" AcceptedAnswerId="36411" CreationDate="2015-07-23T18:38:24.453" Score="4" ViewCount="169" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Change-Hooks.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual §31.28&lt;/a&gt; says this about &lt;code&gt;before-change-functions&lt;/code&gt; and &lt;code&gt;after-change-functions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;These hook variables let you arrange to take notice of all changes in all buffers (or in a particular buffer, if you make them buffer-local).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That sounds like exactly what I need to monitor the status of the &lt;code&gt;*Messages*&lt;/code&gt; buffer, but there is a note in the manual that says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Output of messages into the &lt;code&gt;*Messages*&lt;/code&gt; buffer does not call these functions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the significance of this message, and how can I set up functions that run every time the &lt;code&gt;*Messages*&lt;/code&gt; buffer is modified?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="15748" LastEditDate="2017-10-25T21:23:54.573" LastActivityDate="2017-10-26T00:45:54.710" Title="Hook that fires when `*Messages*` is updated" Tags="|hooks|message|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14201" PostTypeId="2" ParentId="14197" CreationDate="2015-07-23T18:49:27.840" Score="37" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Does the functionality already exist to reformat this buffer to be somewhat user-readable?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Of course, and you have plenty of options. I'd probably feed it to an external program using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x h C-u M-| xmllint --format - RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This program comes with &lt;a href=&quot;http://www.xmlsoft.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;libxml2&lt;/code&gt;&lt;/a&gt;. You could also use &lt;a href=&quot;http://tidy.sourceforge.net/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;tidy&lt;/code&gt;&lt;/a&gt;. Here's a list of commandline xml formatting tools: &lt;a href=&quot;https://stackoverflow.com/questions/16090869/how-to-pretty-print-xml-from-the-command-line&quot;&gt;https://stackoverflow.com/questions/16090869/how-to-pretty-print-xml-from-the-command-line&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also do a search and replace and then indent:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-% &amp;gt; &amp;lt; RET &amp;gt; C-q C-j &amp;lt; RET ! C-M-\&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neat trick: you can copy and paste the above string into &lt;code&gt;M-:&lt;/code&gt; (&lt;code&gt;eval-expression&lt;/code&gt;) like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(execute-kbd-macro (kbd &quot;M-% &amp;gt; &amp;lt; RET &amp;gt; C-q C-j &amp;lt; RET ! C-M-\\&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-07-23T18:54:29.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14202" PostTypeId="2" ParentId="14199" CreationDate="2015-07-23T18:52:47.660" Score="31" Body="&lt;p&gt;You can use &lt;code&gt;cl-defun&lt;/code&gt;, which lets you specify a default value for optional arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-defun command (a &amp;amp;optional (b default-b))&#xA;  (command-body a b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The default value, in this case &lt;code&gt;default-b&lt;/code&gt;, will be evaluated every time the function is called.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-07-23T18:52:47.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14203" PostTypeId="2" ParentId="14199" CreationDate="2015-07-23T19:59:33.380" Score="37" Body="&lt;p&gt;Unless you use Common Lisp extensions as suggested by @legoscia, you need to check if the optional argument was specified. Note that you don't really need to use &lt;code&gt;let&lt;/code&gt; here. This seems more idiomatic to me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun command (a &amp;amp;optional b)&#xA;  (or b (setq b default))&#xA;  (command-body a b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As suggested in the comments, using &lt;code&gt;unless&lt;/code&gt; may be preferable to &lt;code&gt;or&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun command (a &amp;amp;optional b)&#xA;  (unless b (setq b default))&#xA;  (command-body a b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also from the comments: the more pure functional style would be to use &lt;code&gt;let&lt;/code&gt;, as in the original question, but you don't need separate variable names:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-command (a &amp;amp;optional b)&#xA;  (let ((b (or b default)))&#xA;    (command-body a b)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, if the optional parameter is only needed once you should just do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-command (a &amp;amp;optional b)&#xA;    (command-body a (or b default)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-19T18:22:19.190" LastActivityDate="2017-03-19T18:22:19.190" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14204" PostTypeId="2" ParentId="14195" CreationDate="2015-07-23T21:02:52.620" Score="20" Body="&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; &lt;code&gt;when&lt;/code&gt; is about side effects, &lt;code&gt;and&lt;/code&gt; is for pure boolean expressions.&lt;/p&gt;&#xA;&lt;p&gt;As you've noticed, &lt;code&gt;and&lt;/code&gt; and &lt;code&gt;when&lt;/code&gt; differ only in syntax, but are otherwise entirely equivalent.&lt;/p&gt;&#xA;&lt;p&gt;The syntactic difference is quite important, though: &lt;code&gt;when&lt;/code&gt; wraps an implicit &lt;code&gt;progn&lt;/code&gt; around all but the first argument forms.  &lt;code&gt;progn&lt;/code&gt; is an inherently imperative feature:  It evaluates all but the very last body form for their side effects only, discarding whatever value they returned.&lt;/p&gt;&#xA;&lt;p&gt;As such, &lt;code&gt;when&lt;/code&gt; is an imperative form as well: It's main purpose is to wrap side-effecting forms, because only the value of the very last form actually matters for the body.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;and&lt;/code&gt; on the other hand is a pure function, whose main purpose is to look at the return values of the given argument forms:  Unless you explicitly wrap &lt;code&gt;progn&lt;/code&gt; around any of its arguments, the value of every argument form is important, and no value is ever ignored.&lt;/p&gt;&#xA;&lt;p&gt;Hence, the real difference between &lt;code&gt;and&lt;/code&gt; and &lt;code&gt;when&lt;/code&gt; is stylistic:  You use &lt;code&gt;and&lt;/code&gt; for pure boolean expressions, and &lt;code&gt;when&lt;/code&gt; to put a guard around side-effecting forms.&lt;/p&gt;&#xA;&lt;p&gt;Hence, these are bad style:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;;; `when' used for a pure boolean expression&#xA;(let ((use-buffer (when (buffer-live-p buffer)&#xA;                    (file-exists-p (buffer-file-name buffer)))))&#xA;  ...)&#xA;&#xA;;; `and' used as guard around a side-effecting form&#xA;(and (buffer-file-name buffer) (write-region nil nil (buffer-file-name buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And these are good:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(let ((use-buffer (and (buffer-live-p buffer)&#xA;                       (file-exists-p (buffer-file-name buffer)))))&#xA;  ...)&#xA;&#xA;(when (buffer-file-name buffer)&#xA; (write-region nil nil (buffer-file-name buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;I know that some people disagree about this, and happily use &lt;code&gt;and&lt;/code&gt; to guard side-effects, but I think that this is really bad style.  We have these different forms for a reason:  Syntax &lt;em&gt;matters&lt;/em&gt;.  If it didn't, we'd all only ever use &lt;code&gt;if&lt;/code&gt;, which is the only conditional form you really need in Emacs Lisp semantically.  All other boolean and conditional forms can be written in terms of &lt;code&gt;if&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="306" LastEditorDisplayName="user227" LastEditDate="2020-07-27T20:29:37.177" LastActivityDate="2020-07-27T20:29:37.177" CommentCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="14205" PostTypeId="1" AcceptedAnswerId="14370" CreationDate="2015-07-24T01:27:35.117" Score="0" ViewCount="128" Body="&lt;p&gt;I'm new to emacs and I'm trying to figure out some theme behavior that is confusing me. I'm trying to figure out why the second call doesn't take effect in this theme. Note that this is obviously a contrived, reduced case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(deftheme test-theme&#xA;  &quot;testing override behavior&quot;)&#xA;&#xA;(custom-theme-set-faces&#xA; 'test-theme&#xA; `(default ((t (:foreground &quot;#ff0000&quot;))))&#xA; )&#xA;&#xA;(custom-theme-set-faces&#xA; 'test-theme&#xA; `(default ((t (:foreground &quot;#00ff00&quot;))))&#xA; )&#xA;&#xA;(provide-theme 'test-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this theme, I would've imagined that the second call to &lt;code&gt;custom-theme-set-faces&lt;/code&gt; would take effect so that the default foreground would be green, but it's red instead (the first call). I load it in my init.el with &lt;code&gt;(load-theme 'testing t)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I find weird is that if I then go to the buffer for the theme and &lt;code&gt;eval-buffer&lt;/code&gt;, it does seem to take effect, with the text being green. It seems like at emacs startup with &lt;code&gt;load-theme&lt;/code&gt; it doesn't work, perhaps it doesn't allow redefining the same spec or something. Even afterward doing &lt;code&gt;M-x load-theme&lt;/code&gt; on it has the same unintended effect. Only if I go to the buffer of the theme and &lt;code&gt;M-x eval-buffer&lt;/code&gt; does it take effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Merging the calls into one has the same effect. It doesn't work, the text is red not green:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(deftheme test-theme&#xA;  &quot;testing override behavior&quot;)&#xA;&#xA;(custom-theme-set-faces&#xA; 'test-theme&#xA; `(default ((t (:foreground &quot;#ff0000&quot;))))&#xA; `(default ((t (:foreground &quot;#00ff00&quot;))))&#xA; )&#xA;&#xA;(provide-theme 'testing)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried looking at the code for this and other related functions as well as documentation but I can't seem to figure out what causes this, or what is going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing which I imagine is similar to the fact that &lt;code&gt;eval-buffer&lt;/code&gt; makes it work is that if I put the same &lt;code&gt;custom-theme-set-faces&lt;/code&gt; call in my &lt;code&gt;init.el&lt;/code&gt;, it works as intended, that is, the default font face shows up green:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-theme-set-faces&#xA; 'test-theme&#xA; `(default ((t (:foreground &quot;#ff0000&quot;))))&#xA; `(default ((t (:foreground &quot;#00ff00&quot;))))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I think it has something to do with the way that theme files are loaded or something. Does anyone have any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: If in &lt;code&gt;ielm&lt;/code&gt; I do &lt;code&gt;(get 'test-theme 'theme-settings)&lt;/code&gt; I see the duplicate entries. The weird thing is that if I then enter a combined call as in the last code example, it only shows a single entry: the last one, as I would expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt;: I think this stems from the fact that &lt;code&gt;custom-theme-set-faces&lt;/code&gt; and &lt;code&gt;load-theme&lt;/code&gt; both use different ways of 'enabling' a face spec.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="8941" LastEditDate="2015-07-24T02:21:50.980" LastActivityDate="2015-07-31T02:33:39.463" Title="redefine theme spec" Tags="|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14206" PostTypeId="1" CreationDate="2015-07-24T03:28:56.260" Score="2" ViewCount="4808" Body="&lt;p&gt;I'm wondering what is the key to toggle line comment in python, because &lt;kbd&gt;M&lt;/kbd&gt;-&lt;kbd&gt;;&lt;/kbd&gt; is not working, although it's the line toggle command mentioned in the docs, despite that it's working with block comments when text is selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S: well I could use &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt; and put a &lt;kbd&gt;#&lt;/kbd&gt; or remove it but I'd like to find out about comment toggle.&lt;/p&gt;&#xA;" OwnerUserId="8368" LastActivityDate="2015-07-24T17:50:25.390" Title="key to toggle line comment in python" Tags="|python|comment|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14207" PostTypeId="1" CreationDate="2015-07-24T03:35:48.607" Score="0" ViewCount="226" Body="&lt;p&gt;iTerm2 has the ability to use &quot;old-school&quot; (non-Lion) style fullscreen. Emacs can do this too: &lt;code&gt;(setq ns-use-native-fullscreen nil)&lt;/code&gt;. iTerm2, however, allows you to keep the native OSX menu bar (the one that's glued to the top of the screen) visible while in this fullscreen mode. To be as explicit as possible, this configuration differs from a simply maximized iTerm2 because the title bar of the window (the one with the red, yellow, and green buttons) is not there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this setup be replicated in Emacs? I'm using the homebrew version of Emacs, but open to other solutions.&lt;/p&gt;&#xA;" OwnerUserId="9006" LastActivityDate="2015-07-24T03:35:48.607" Title="iTerm2 style fullscreen on OSX" Tags="|osx|frames|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14208" PostTypeId="1" CreationDate="2015-07-24T07:26:33.047" Score="10" ViewCount="2694" Body="&lt;p&gt;This question in inspired by &lt;a href=&quot;https://stackoverflow.com/q/605785/&quot;&gt;https://stackoverflow.com/q/605785/&lt;/a&gt;.&#xA;By &lt;code&gt;M-x describe-function &amp;lt;TAB&amp;gt;&lt;/code&gt; I can get a list of all&#xA;interactive or nonintractive functions available in the current state&#xA;of emacs.&#xA;If an specific mode is activated (e.g. latex-mode) we get a longer&#xA;list, as the functions available in latex-mode are also listed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to obtain a list of all functions exclusively available in an&#xA;specific mode (e.g. latex-mode)? In other words excluding all other&#xA;functions not provided by that mode. Like in the above link providing a short description of the functions would also be handy.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-07-25T01:46:31.703" Title="How to obtain a list of all functions exclusively provided by a certain major mode" Tags="|major-mode|functions|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14209" PostTypeId="2" ParentId="3330" CreationDate="2015-07-24T08:59:36.017" Score="5" Body="&lt;p&gt;I would like to ask you: “Do you really want to kill it?”. Indeed, killing a&#xA;buffer is such a common thing in Emacs world, but once killed, buffer is&#xA;gone, and as your question demonstrates, it's not always desirable.&lt;/p&gt;&#xA;&lt;p&gt;However we can choose another way, so that you never need to restore killed&#xA;buffer — just prefer burying to killing. Take a look at&#xA;&lt;a href=&quot;https://github.com/mrkkrp/kill-or-bury-alive&quot; rel=&quot;noreferrer&quot;&gt;Kill or Bury Alive&lt;/a&gt; package,&#xA;it's &lt;a href=&quot;http://melpa.org/#/kill-or-bury-alive&quot; rel=&quot;noreferrer&quot;&gt;available via MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;From description of the package:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Have you ever killed some buffer that you might want to leave alive?&#xA;Motivation for killing is usually “get out of my way for now”, and killing&#xA;may be not the best choice in many cases unless your RAM is very-very&#xA;limited. This package allows to teach Emacs which buffers we want to kill&#xA;and which ones we prefer to bury alive.&lt;/p&gt;&#xA;&lt;p&gt;When we really want to kill a buffer, it turns out that not all buffers&#xA;would like to die the same way. The package allows to specify &lt;em&gt;how&lt;/em&gt; to&#xA;kill various kinds of buffers. This may be especially useful when you're&#xA;working with some buffer that has an associated process, for example.&lt;/p&gt;&#xA;&lt;p&gt;But sometimes you may want to get rid of most buffers and bring Emacs to&#xA;some more or less virgin state. You probably don't want to kill scratch&#xA;buffer and maybe ERC-related buffers too. You can specify which buffers to&#xA;purge.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-24T08:59:36.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14211" PostTypeId="2" ParentId="14206" CreationDate="2015-07-24T10:27:34.353" Score="4" Body="&lt;p&gt;I don't know which version of Emacs you're using, but there is (will be) &lt;kbd&gt;C-x C-;&lt;/kbd&gt; in Emacs 25, it runs &lt;code&gt;comment-line&lt;/code&gt; that seem to have the behavior you want.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-24T10:27:34.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14212" PostTypeId="1" AcceptedAnswerId="14259" CreationDate="2015-07-24T10:34:02.230" Score="1" ViewCount="2260" Body="&lt;p&gt;I am trying to modify a buffer written by &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html#Saving-Emacs-Sessions&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;desktop-save&lt;/code&gt;&lt;/a&gt; to a file. The file is named &lt;code&gt;.emacs.desktop&lt;/code&gt; and I am trying to modify it from a Perl script. It turns out that it is saved in &lt;code&gt;emacs-mule&lt;/code&gt; encoding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;M-x list-coding-systems&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;U -- utf-8 (alias: mule-utf-8)&#xA;  UTF-8 (no signature (BOM))&#xA;M -- emacs-mule&#xA;  Emacs 21 internal format used in buffer and string.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to read the file in Perl as &lt;code&gt;UTF-8&lt;/code&gt;, how can this be done?&#xA;(I would prefer a solution that does not depend on a running Emacs server)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(An example: &lt;code&gt;emacs-mule&lt;/code&gt; saves the letter &lt;code&gt;æ&lt;/code&gt; as two bytes &lt;code&gt;0x81 0xe6&lt;/code&gt;, ISO Latin 1 saves it as a single byte &lt;code&gt;0xe6&lt;/code&gt;, whereas UTF-8 saves it as two bytes &lt;code&gt;0xc3 0xa6&lt;/code&gt;.. )&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2015-07-24T11:23:47.143" LastActivityDate="2015-08-25T21:02:24.183" Title="How to convert a MULE encoded file to UTF-8?" Tags="|character-encoding|unicode|perl|utf-8|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14213" PostTypeId="2" ParentId="14140" CreationDate="2015-07-24T10:34:36.993" Score="1" Body="&lt;p&gt;Solution 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you use evil, check &lt;code&gt;evil-mark-replace&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;selected the region, then &lt;code&gt;evilmr-tag-selected-region&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;move the cursor over the string to replace and &lt;code&gt;evilmr-replace-in-tagged-region&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Solution 2 (without evil):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;select a region and &lt;code&gt;my-iedit-restrict-selected-region&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-iedit-restrict-selected-region ()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;    (iedit-restrict-region (region-beginning) (region-end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suggest using solution 1 because it's much simpler and reliable.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-07-26T03:44:05.513" LastActivityDate="2015-07-26T03:44:05.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14214" PostTypeId="2" ParentId="14208" CreationDate="2015-07-24T12:19:33.147" Score="1" Body="&lt;p&gt;I've just added this functionality to&#xA;&lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt;.  The new command,&#xA;&lt;code&gt;lispy-goto-elisp-commands&lt;/code&gt;, is bound to &lt;kbd&gt;oge&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The generic &lt;kbd&gt;g&lt;/kbd&gt; (&lt;code&gt;lispy-goto&lt;/code&gt;) gives a list of all tags,&#xA;highlighting commands with a different face, while&#xA;&lt;code&gt;lispy-goto-elisp-commands&lt;/code&gt; only gives the command tags.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Code listing&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun lispy-goto-elisp-commands (&amp;amp;optional arg)&#xA;  &quot;Jump to Elisp commands within current file.&#xA;When ARG is non-nil, force a reparse.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (deactivate-mark)&#xA;  (let ((lispy-force-reparse arg))&#xA;    (lispy--fetch-tags (list (buffer-file-name)))&#xA;    (let ((struct (gethash (buffer-file-name) lispy-db)))&#xA;      (lispy--select-candidate&#xA;       (mapcar #'lispy--format-tag-line&#xA;               (delq nil&#xA;                     (cl-mapcar&#xA;                      (lambda (tag pretty-tag)&#xA;                        (when (semantic-tag-get-attribute tag :user-visible-flag)&#xA;                          pretty-tag))&#xA;                      (lispy-dbfile-plain-tags struct)&#xA;                      (lispy-dbfile-tags struct))))&#xA;       #'lispy--action-jump))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is just to show that CEDET's semantic is used to obtain the list&#xA;of tags; &lt;code&gt;(semantic-tag-get-attribute tag :user-visible-flag)&lt;/code&gt; is used&#xA;to determine if the tag is a command or not.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How to use&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Navigate to the file that contains the code. This can be done with&#xA;&lt;kbd&gt;f1 f&lt;/kbd&gt;. I like to use&#xA;&lt;a href=&quot;http://oremacs.com/2015/06/08/describe-variable-tip/&quot; rel=&quot;nofollow&quot;&gt;counsel-describe-function&lt;/a&gt;&#xA;instead, since pressing &lt;kbd&gt;C-.&lt;/kbd&gt; there omits having to go&#xA;through &lt;code&gt;*Help*&lt;/code&gt; buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Make point special (move it before open paren, or activate region) and press &lt;kbd&gt;oge&lt;/kbd&gt;.&#xA;It's also possible to just use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;lispy-goto-elisp-commands&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-24T12:19:33.147" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14215" PostTypeId="1" AcceptedAnswerId="14223" CreationDate="2015-07-24T14:45:40.930" Score="10" ViewCount="2265" Body="&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I would like to create user interface in form of &lt;em&gt;popup menu&lt;/em&gt;, &lt;em&gt;popup menu&#xA;similar to that used in Magit&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Features&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Definition of Popup&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Popup&lt;/em&gt; in context of this question means little temporary window that&#xA;contains collection of menu items so that user can select one and only one&#xA;of these items.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Position on the Screen&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The popup is allowed to appear in any part of the screen, but it's desirable&#xA;that it should be quite obvious and thus it should appear beside currently&#xA;active window.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Contents of Popup Buffer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Items should be displayed in form of pretty table. &lt;em&gt;Pretty&lt;/em&gt; is context of&#xA;the question means visually appealing, this effect can be most easily&#xA;achieved by putting menu items into straight rows, see&#xA;&lt;code&gt;complete--insert-string&lt;/code&gt; for example. This paragraph serves for additional&#xA;clarification, you can do it in your own way, this won't render your answer&#xA;incorrect.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Selection of Menu Item&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The selection is expected to be performed by a single key-pressing or,&#xA;optionally with a mouse (although it's not that important so answers&#xA;containing propositions that don't support mouse are legal). If you propose&#xA;solution that supports mouse, please note that user should be able to select&#xA;a menu item in an intuitive way, that is, by left-button clicking on desired&#xA;choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N.B. mouse can be used in many ways and alternative ways to indicate&#xA;a choice are also welcomed.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Elimination of Popup&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Once user has selected a menu item in a way described above, the buffer and&#xA;thus its window should be eliminated from view as well as killed. The window&#xA;that has been active before invocation of the popup menu should get focus&#xA;(that is, become active) again.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Returned Value and Arguments&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Preferably, this consequence of actions should result in a Lisp object&#xA;returned. The Lisp object can be either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;nil&lt;/code&gt; — this indicates that user has aborted the popup menu either by&#xA;pressing &lt;kbd&gt;C-g&lt;/kbd&gt; or in some other way †.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;string&lt;/code&gt; — string (it's allowed to use a symbol) should be &lt;code&gt;string-equal&lt;/code&gt;&#xA;to one of the strings supplied to the popup menu as collection of actual&#xA;items.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Alternative ways to let the rest of program know user's choice, or,&#xA;possibly, its absence, are acceptable. However, if it's not clear how else&#xA;it can be performed I ask all answerers improvise and don't ask me for&#xA;further clarification of this aspect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is all for returned value. As for input parameters, they should at&#xA;least include collection of strings which represent possible choices (that&#xA;is, menu items).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Acceptable Answers&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Expected answer can be of the following forms:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Sufficient code snippet that allows educated reader to write function like&#xA;that described above; it's not expected or necessary to write entire&#xA;working function. However, to avoid uncertainty (can considerable parts of&#xA;code be omitted?), I should note that missing parts of the snippet should&#xA;be described in textual component of answer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A link to existing library that implements similar functionality. To avoid&#xA;uncertainty, I should note that &lt;em&gt;similar&lt;/em&gt; in our case means that the&#xA;library can be used to create &lt;em&gt;popup&lt;/em&gt; (see definition above) that has at&#xA;least 2 or 3 features described above. If proposed library is different to&#xA;the point where the previously stated condition cannot be met, each such&#xA;case will be judged independently and will be always upvoted if OP deems&#xA;it useful.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Description of built-in Emacs functions or third-party ones that can be&#xA;used to implement any feature described in section «Features», see&#xA;above. To avoid uncertainty, please state clearly how your answer can be&#xA;useful for future readers who want to implement &lt;em&gt;popup&lt;/em&gt;, &lt;em&gt;popup menu&#xA;similar to that used in Magit&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;† Alternative ways to abort the popup menu may include the following (but&#xA;not limited to these):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;clicking outside of popup menu window;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;killing of buffer containing the popup without making a choice.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="105" LastEditDate="2017-04-20T14:41:31.937" LastActivityDate="2023-06-11T01:20:33.987" Title="How to Implement Popup Menu Similar to That Used in Magit" Tags="|magit|popup|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14216" PostTypeId="1" CreationDate="2015-07-24T15:05:58.280" Score="1" ViewCount="241" Body="&lt;p&gt;I'm using org-babel blocks to generate a Graphiz diagram for a presentation. Normally the output goes to a file which is what I want. However if the file is empty something went wrong. Is there an easy way to see stderr/stdout of the program, preferably separate from the file output?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-07-24T15:05:58.280" Title="Debugging org-babel snippets" Tags="|org-babel|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14217" PostTypeId="2" ParentId="14208" CreationDate="2015-07-24T15:27:56.777" Score="2" Body="&lt;p&gt;Perhaps, this code will have some educational effect:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-all-extensions (file-name)&#xA;  (let ((go-on t) next)&#xA;    (while go-on&#xA;      (setq next (file-name-sans-extension file-name))&#xA;      (setq go-on (not (string= next file-name))&#xA;            file-name next))&#xA;    next))&#xA;&#xA;(defun function-symbols-of (library)&#xA;  (let ((origin (remove-all-extensions&#xA;                 (find-library-name&#xA;                  (if (stringp library) library&#xA;                    (symbol-name library)))))&#xA;        (result))&#xA;    (mapatoms (lambda (sym)&#xA;                (when (and (symbol-function sym)&#xA;                           (symbol-file sym)&#xA;                           (string= (remove-all-extensions (symbol-file sym))&#xA;                                    origin))&#xA;                  (push sym result))))&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;The problem&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Due to non-deterministic nature of code parsing and loading several issues need to be addressed:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When is the function defined in a file? Functions can be defined conditionally, and predicting whether a condition will favor function definition or not is equivalent to solving the halting problem. To illustrate this, suppose this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (&amp;gt; (random 100) 50)&#xA;   (defun foo ())&#xA;   (defun bar ()))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;It is not generally possible to tell, whether a lisp form defined a function before (successfully) evaluating the form. This is, again, equivalent to halting problem, so, not solvable in general.&lt;/li&gt;&#xA;&lt;li&gt;There are some common special cases such as aliasing and advising, which (a) create duplicates, (b) may misguide you as to the source file which declared the function.&lt;/li&gt;&#xA;&lt;li&gt;Large fraction of functions are declared in C code (not necessarily accessible), which isn't really divided into libraries in the same sense that Emacs Lisp code is.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All this said, you probably want to look into &lt;code&gt;find-func.el&lt;/code&gt; for inspiration, to get the general idea of the layout and the problems related to locating the source code for Emacs Lisp functions.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-07-24T20:05:23.067" LastActivityDate="2015-07-24T20:05:23.067" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14219" PostTypeId="2" ParentId="14208" CreationDate="2015-07-24T17:28:40.937" Score="2" Body="&lt;p&gt;What does it mean for a mode to provide a function?  You say &quot;&lt;em&gt;a list of all functions exclusively available in an specific mode&lt;/em&gt;&quot; and &quot;&lt;em&gt;excluding all other functions not provided by that mode&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like you are &lt;strong&gt;confusing a mode with the library that defines it&lt;/strong&gt;. A library provides/defines functions. A mode generally does not do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to get a list of all of the functions defined in a given &lt;em&gt;library&lt;/em&gt;, then see @wvxvw's answer, for a start. You can also try matching the library prefix against function names - that is often pertinent, but it is by no means definitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, you want to get a list of all of the &lt;em&gt;functions that might be pertinent to a given mode&lt;/em&gt;, e.g., functions that can be used only, or are most useful, when that mode is turned on, then I'm afraid you will need to examine the library where the mode is defined. And you might even need to examine some other libraries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A given library typically defines more than just some things that are pertinent to a given mode. And a given mode can very well make use of things that are defined in different libraries, and in some cases things that make sense only for that given mode or a set of modes that includes it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, as currently posed, your question is not very clear. You might help yourself to better answers by clarifying it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-24T17:28:40.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14220" PostTypeId="2" ParentId="14206" CreationDate="2015-07-24T17:47:13.317" Score="0" Body="&lt;p&gt;From &lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun comment-region-lines (beg end &amp;amp;optional arg)&#xA;  &quot;Like `comment-region' (which see), but comment or uncomment whole lines.&quot;&#xA;  (interactive &quot;*r\nP&quot;)&#xA;  (when (&amp;gt; beg end) (setq beg  (prog1 end (setq end  beg))))&#xA;  (let ((bol  (save-excursion (goto-char beg) (line-beginning-position)))&#xA;        (eol  (save-excursion (goto-char end) (if (bolp) (point) (line-end-position)))))&#xA;    (comment-region bol eol arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I bind it to &lt;code&gt;C-x C-;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-24T17:47:13.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14221" PostTypeId="2" ParentId="14206" CreationDate="2015-07-24T17:50:25.390" Score="0" Body="&lt;p&gt;;; The following code (select-current-line) is due to Xah Lee, see  &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2010-12/msg01183.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lists.gnu.org/archive/html/help-gnu-emacs/2010-12/msg01183.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun select-current-line ()&#xA;  &quot;Select the current line&quot;&#xA;  (interactive)&#xA; (beginning-of-line) ; move to end of line&#xA;  (set-mark (line-end-position)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we can define the following function  (which uses the idea from  &lt;a href=&quot;https://stackoverflow.com/a/9697222/&quot;&gt;https://stackoverflow.com/a/9697222/&lt;/a&gt; due to Gerstmann but it is not identical to that answer).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comment-or-uncomment-line-or-region ()&#xA;  &quot;comment-or-uncomment-line-or-region&quot;&#xA;  (interactive)&#xA;(save-excursion (if (region-active-p) (comment-dwim nil)&#xA;  (select-current-line) (comment-dwim nil)&#xA;  )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can define a shortcut for it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (eval-after-load &quot;python&quot;&#xA;'(define-key python-mode-map (kbd &quot;M-;&quot;) #'comment-or-uncomment-line-or-region))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-07-24T17:50:25.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14222" PostTypeId="1" AcceptedAnswerId="14227" CreationDate="2015-07-24T17:54:41.150" Score="9" ViewCount="1189" Body="&lt;p&gt;Sometimes, when I scroll up in eshell, point leaves the command prompt line to stay in the visible area. When I then enter a command, I don't enter the command at the prompt, but rater insert the text somewhere into the output of previously called commands. This is pretty annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make sure that eshell returns point to the command prompt when I enter a char, just like in other shells?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;/edit: Here is a screencast of the situation. I type &lt;code&gt;ls&lt;/code&gt;, then I scroll up to review the output, then decide that I want to do a &lt;code&gt;cd ..&lt;/code&gt;, but because it just inserts the command at point, it turns out to be garbage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rP1Gv.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rP1Gv.gif&quot; alt=&quot;eshell-scroll-point&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7004" LastEditorUserId="7004" LastEditDate="2015-07-26T20:09:16.247" LastActivityDate="2015-07-26T20:09:16.247" Title="Eshell: Go to prompt line on key press" Tags="|eshell|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14223" PostTypeId="2" ParentId="14215" CreationDate="2015-07-24T18:17:32.767" Score="10" Body="&lt;p&gt;&lt;code&gt;magit-popup&lt;/code&gt; has it's &lt;a href=&quot;http://magit.vc/manual/magit-popup&quot; rel=&quot;noreferrer&quot;&gt;own manual&lt;/a&gt;! But unless you actually want to set arguments in the popup which are then passed to the invoked action, you are probably better off using &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;hydra&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that I don't intend to further develop &lt;code&gt;magit-popup&lt;/code&gt;. Instead I will write a similar package from scratch. There's just to much accidental complexity in the current implementation. (But that doesn't mean that &lt;code&gt;magit-popup&lt;/code&gt; will simply vanish. It likely won't see many new features, but if the current implementation does what you want, then why not use it?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or since you too want to do it &quot;from scratch&quot;, have a look at &lt;code&gt;read-char-choice&lt;/code&gt; and go from there. To implement the visual part have a look at &lt;code&gt;lv&lt;/code&gt; which is part of the hydra repository.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-09-02T21:53:57.133" LastActivityDate="2015-09-02T21:53:57.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14224" PostTypeId="2" ParentId="14222" CreationDate="2015-07-24T20:39:01.813" Score="0" Body="&lt;p&gt;I think what you are looking for is the Plan 9 Smart Shell behavior in Emacs. Mickey Peterson covered it in his recent book &lt;em&gt;Mastering Emacs&lt;/em&gt;, which involves adding these to your init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'eshell)&#xA;(require 'em-smart)&#xA;(setq eshell-where-to-jump 'begin)&#xA;(setq eshell-review-quick-commands nil)&#xA;(setq eshell-smart-space-goes-to-end t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-07-24T20:39:01.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14225" PostTypeId="2" ParentId="14215" CreationDate="2015-07-24T21:01:15.610" Score="1" Body="&lt;p&gt;You might also be interested in looking at the package &lt;code&gt;makey&lt;/code&gt;. It is intended to provide similar functionality as &lt;code&gt;magit-popup&lt;/code&gt;, and it is a fork of the predecessor of &lt;code&gt;magit-popup&lt;/code&gt; (&lt;code&gt;magit-key-mode&lt;/code&gt;, mentionned in the comment) from when it was not yet a package available separately from &lt;code&gt;magit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me also mention &lt;code&gt;discover&lt;/code&gt; : that is an example of how to use &lt;code&gt;makey&lt;/code&gt; (and also its raison d'être). That package is meant to help newcomers discover emacs bindings.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.masteringemacs.org/article/discoverel-discover-emacs-context-menus&quot; rel=&quot;nofollow&quot;&gt;https://www.masteringemacs.org/article/discoverel-discover-emacs-context-menus&lt;/a&gt; : description of &lt;code&gt;makey&lt;/code&gt; and &lt;code&gt;discover&lt;/code&gt; by its author.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/magit/magit/issues/1716&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magit/magit/issues/1716&lt;/a&gt; : this is (apparently) when &lt;code&gt;magit-popup&lt;/code&gt; was made into its own package.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-09-07T07:26:36.603" LastActivityDate="2015-09-07T07:26:36.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14226" PostTypeId="2" ParentId="14208" CreationDate="2015-07-25T01:46:31.703" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/nonsequitur/smex/blob/master/smex.el#L421&quot; rel=&quot;nofollow&quot;&gt;smex&lt;/a&gt; package has code to list all commands of a package. You could adapt this code to get all functions.&lt;/p&gt;&#xA;" OwnerUserId="8951" LastActivityDate="2015-07-25T01:46:31.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14227" PostTypeId="2" ParentId="14222" CreationDate="2015-07-25T04:43:37.837" Score="5" Body="&lt;pre&gt;&lt;code&gt;(setq eshell-scroll-to-bottom-on-input t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should do what you want.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-07-25T04:43:37.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14228" PostTypeId="1" AcceptedAnswerId="14249" CreationDate="2015-07-25T09:08:48.967" Score="0" ViewCount="246" Body="&lt;h1&gt;The problem:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Before installing YASnippet changing themes was instantaneous, now it YASnippet reloads itself in someway making changes take a few seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this functionality necessary? Can I turn it off?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way around it?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Context:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I have this as part of my evil mode config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Evil Mode Switcher&#xA;(defun toggle-evil-mode ()&#xA;  (interactive)&#xA;  (if (not evil-mode)&#xA;      (progn&#xA;        (evil-mode 1)&#xA;        (enable-theme 'ample))&#xA;    (progn&#xA;      (evil-mode 0)&#xA;      (enable-theme 'ample-flat))))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;C-escape&amp;gt;&quot;) 'toggle-evil-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It allows me to switch in and out of evil mode with C-escape.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While doing though it toggles to a darker theme, this makes it easier to recognise whether I am in it or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It used to work well, but now that I have YASnippet installed it takes too long.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Updated: Stack trace&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Here is a slightly truncated stacktrace, by using debug-on-entry. From this it appears that yas is adding custom items to the theme, do they need to be updated though?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--entering a function:&#xA;* yas-reload-all()&#xA;  yas--global-mode-reload-with-jit-maybe()&#xA;  run-hooks(yas-global-mode-hook yas-global-mode-on-hook)&#xA;  yas-global-mode(1)&#xA;  custom-set-minor-mode(yas-global-mode t)&#xA;  custom-theme-recalc-variable(yas-global-mode)&#xA;  enable-theme(user)&#xA;  enable-theme(ample)&#xA;  toggle-evil-mode()&#xA;  call-interactively(toggle-evil-mode nil nil)&#xA;  command-execute(toggle-evil-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8716" LastEditorUserId="8716" LastEditDate="2015-07-26T09:00:56.360" LastActivityDate="2015-07-26T11:18:18.087" Title="Why does a theme change cause reloading - YASnippet" Tags="|themes|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14229" PostTypeId="1" AcceptedAnswerId="14436" CreationDate="2015-07-25T09:17:15.570" Score="2" ViewCount="396" Body="&lt;p&gt;I am looking for a way to write proper &lt;a href=&quot;https://en.wikipedia.org/wiki/Quotation_mark&quot; rel=&quot;nofollow&quot;&gt;Czech quotation marks&lt;/a&gt;, e.g., „…“ ‚…‘ »…« ›…‹, in some text modes. I found &lt;code&gt;typo.el&lt;/code&gt; and &lt;code&gt;typopunct.el&lt;/code&gt;. But it seems I would have to make some modifications to either of them if I wanted Czech quotation marks. Is there any other package that would be useful to achieve this beside the two?&lt;/p&gt;&#xA;" OwnerUserId="968" LastActivityDate="2015-08-03T20:30:56.097" Title="writing proper Czech quotation marks" Tags="|quote|typography|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14231" PostTypeId="1" CreationDate="2015-07-25T10:32:24.270" Score="4" ViewCount="631" Body="&lt;p&gt;I would like to write a function which&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;on the first execution behaves like the regular &lt;code&gt;kill-ring-save&lt;/code&gt; if some region is selected&lt;/li&gt;&#xA;&lt;li&gt;on the first execution copies the current word if no region is selected,&lt;/li&gt;&#xA;&lt;li&gt;on the second execution copies the current line&lt;/li&gt;&#xA;&lt;li&gt;on the third execution copies the current paragraph&lt;/li&gt;&#xA;&lt;li&gt;on the fourth execution and so on copies the whole current buffer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Eventually I would like to remap &lt;code&gt;kill-ring-save&lt;/code&gt; to this new function.&#xA;So far I have written this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun modified-kill-ring-save () (interactive)&#xA;    (if (region-active-p) (kill-ring-save (region-beginning) (region-end)) &#xA;(if (not  (equal last-command 'modified-kill-ring-save))&#xA; (progn (select-current-word) (kill-ring-save (region-beginning) (region-end)) ) &#xA; (progn (select-current-line) (kill-ring-save (region-beginning) (region-end))  )   )  )   &#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which does 1, 2 and 3. But I am not able to go further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above code I have used the following functions from &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_examples.html&quot; rel=&quot;nofollow&quot;&gt;http://ergoemacs.org/emacs/elisp_examples.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun select-current-line ()&#xA;  &quot;Select the current line&quot;&#xA;  (interactive)&#xA; (beginning-of-line) ; move to end of line&#xA;  (set-mark (line-end-position)))&#xA;&#xA;(defun select-current-word ()&#xA;&quot;Select the word under cursor.&#xA;“word” here is considered any alphanumeric sequence with “_” or “-”.&quot;&#xA; (interactive)&#xA; (let (pt)&#xA;   (skip-chars-backward &quot;-_A-Za-z0-9&quot;)&#xA;   (setq pt (point))&#xA;   (skip-chars-forward &quot;-_A-Za-z0-9&quot;)&#xA;   (set-mark pt)&#xA; ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-07-25T16:07:51.737" LastActivityDate="2015-07-25T16:07:51.737" Title="Modification of kill-ring-save to copy current word/line/whole buffer/ if no region is selected" Tags="|kill-ring|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14232" PostTypeId="1" CreationDate="2015-07-25T10:57:12.813" Score="4" ViewCount="1203" Body="&lt;p&gt;I cannot launch the emacs daemon anymore. I do not know what triggered this.&#xA;When entering &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q --daemon -v&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get only the following and nothing happen.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning: due to a long standing Gtk+ bug&#xA;http://bugzilla.gnome.org/show_bug.cgi?id=85715&#xA;Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.&#xA;Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.&#xA;Starting Emacs daemon.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Starting &lt;code&gt;emacsclient -c&lt;/code&gt; returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; $ emacsclient -c&#xA;emacsclient: can't find socket; have you started the server?&#xA;To start the server in Emacs, type &quot;M-x server-start&quot;.&#xA;emacsclient: No socket or alternate editor.  Please use:&#xA;&#xA;    --socket-name&#xA;    --server-file      (or environment variable EMACS_SERVER_FILE)&#xA;    --alternate-editor (or environment variable ALTERNATE_EDITOR)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to update emacs without success. Do you know what is going on? How can I solve this?&lt;/p&gt;&#xA;" OwnerUserId="6760" LastEditorUserId="23" LastEditDate="2016-10-19T19:06:36.440" LastActivityDate="2016-10-19T19:06:36.440" Title="Starting emacs in daemon mode freezes, emacsclient is not able find a socket" Tags="|daemon|crash|emacs-daemon|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14233" PostTypeId="2" ParentId="14231" CreationDate="2015-07-25T13:19:56.373" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;noreferrer&quot;&gt;expand-region&lt;/a&gt; or &lt;a href=&quot;https://github.com/leoliu/easy-kill&quot; rel=&quot;noreferrer&quot;&gt;easy-kill&lt;/a&gt; or &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;noreferrer&quot;&gt;hydra&lt;/a&gt; might provide better idea on how to do one thing continuously, but here is a silly command which tries to do exactly what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-kill-ring-save--counter)&#xA;&#xA;(defun my-kill-ring-save ()&#xA;  (interactive)&#xA;  (if (eq last-command this-command)&#xA;      (cl-incf my-kill-ring-save--counter)&#xA;    (setq my-kill-ring-save--counter 1))&#xA;  (cond ((eq my-kill-ring-save--counter 1)&#xA;         (if (use-region-p)&#xA;             (kill-ring-save (region-beginning) (region-end))&#xA;           (kill-new (current-word))))&#xA;        ((eq my-kill-ring-save--counter 2)&#xA;         (kill-ring-save (line-beginning-position) (line-end-position)))&#xA;        ((eq my-kill-ring-save--counter 3)&#xA;         (let (page-beginning-pos page-end-pos)&#xA;           (save-excursion              ; I am not really sure about them nowadays&#xA;             (save-restriction&#xA;               (forward-page)&#xA;               (setq page-end-pos (point))&#xA;               (forward-page -1)&#xA;               (setq page-beginning-pos (point))))&#xA;           (kill-ring-save page-beginning-pos page-end-pos)))&#xA;        ((eq my-kill-ring-save--counter 4)&#xA;         (kill-new (buffer-string)))))&#xA;&#xA;;; For testing&#xA;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt;&quot;) #'my-kill-ring-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-07-25T13:19:56.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14234" PostTypeId="1" CreationDate="2015-07-25T16:33:24.257" Score="7" ViewCount="436" Body="&lt;p&gt;I'm writing a musical in collaboration with a composer. We're using&#xA;org-mode, but neither of us is an expert. I'm using #+SRC blocks for&#xA;occasional Lilypond code and #+VERSE blocks for lyrics, viz:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** SCENE II&#xA;&#xA;description, dialogue, etc. description, dialogue, etc. description,&#xA;dialogue, etc. description, dialogue, etc. description, dialogue, etc.&#xA;&#xA;#+NAME: song-name&#xA;#+BEGIN_VERSE&#xA; la la la&#xA; la la la&#xA;#+END_VERSE&#xA;&#xA;#+NAME: song-name-melody&#xA;#+BEGIN_SRC lilypond :file song-name-melody.pdf&#xA;&amp;lt;&amp;lt; {&#xA;  /key d /major&#xA;  /time 3/4&#xA;  a4 a a |&#xA;  a4 a a |&#xA; }&#xA;&#xA;/addlyrics {&#xA;la la la |&#xA;la la la |&#xA; }&#xA;&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&#xA;more description, dialogue, etc. description, dialogue, etc.&#xA;dialogue, etc. description, dialogue, etc. description, dialogue.&#xA;&#xA;** SCENE III&#xA;etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like my collaborator to be able to easily view just the lyrics, or just the Lilypond code. My first thought was to use TAGS or PROPERTIES, but because these blocks aren't headlines that doesn't seem possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could this kind of narrowing (if that's the right term) be easily achieved?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="105" LastEditDate="2015-12-19T21:56:46.323" LastActivityDate="2016-04-26T20:05:22.277" Title="Org tags, Org properties, or ? for SRC and VERSE blocks" Tags="|org-mode|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14235" PostTypeId="1" CreationDate="2015-07-25T18:49:44.937" Score="4" ViewCount="296" Body="&lt;p&gt;Assume that we have a function which can be defined either interactive or non-interactive. When we define it as interactive, we can use it as a command by invoking &lt;code&gt;M-x&lt;/code&gt; so we have more freedom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering what are the situations where defining a function as non-interactive has some advantages over the interactive method.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-07-25T19:00:30.140" LastActivityDate="2015-07-27T06:19:02.263" Title="What are the situations where defining a function as non-interactive is better than interactive?" Tags="|functions|interactive|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14236" PostTypeId="2" ParentId="14235" CreationDate="2015-07-25T19:09:52.713" Score="8" Body="&lt;p&gt;While it is entirely subjective, I would suggest only making functions interactive if you actually expect them to be called that way. Many functions are intended to be used as building blocks rather than end-user commands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be simpler to define a non-interactive function. While these factors are important for any function, they are particularly important for interactive commands:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is it fully documented? &lt;/li&gt;&#xA;&lt;li&gt;If it takes arguments, does it provide helpful prompts and defaults?&lt;/li&gt;&#xA;&lt;li&gt;Does it have a meaningful / unique  name? Consider that commands are often picked from a list of completion candidates.&lt;/li&gt;&#xA;&lt;li&gt;How does it handle prefix arguments?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Also note that non-interactive functions can always be called with &lt;code&gt;M-:&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-07-25T19:09:52.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14237" PostTypeId="1" CreationDate="2015-07-25T19:12:33.000" Score="4" ViewCount="3312" Body="&lt;p&gt;I want to write a scheme program in an org file. I want to be able to execute the &lt;code&gt;#+SRC&lt;/code&gt; blcoks and see the result in &lt;code&gt;#+RESULT:&lt;/code&gt; block. However, when I execute the &lt;code&gt;#+SRC_BEGIN/END&lt;/code&gt; I get no output. Instead I get a guile REPL and that's it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the config I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq geiser-default-implementation 'guile)&#xA;&#xA;&#xA;(org-babel-do-load-languages&#xA;'org-babel-load-languages&#xA;'((scheme . t)&#xA; (emacs-lisp . t)&#xA; (ruby . t)&#xA; (R . t)&#xA; (python . t)&#xA; (C . t)&#xA; (sh . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's an interesting detail. When I execute this code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SRC_BEGIN&#xA;(write &quot;hello&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get this output in the org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;[blank here]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And another buffer with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=&amp;gt; #&amp;lt;unspecified&amp;gt;&#xA;&#xA;&#xA;&quot;hello world&quot;;; -*- geiser-scheme-implementation: guile -*-&#xA;(write &quot;hello world&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the following program produces no output at all, not even the empty &lt;code&gt;#+RESULT:&lt;/code&gt; block,  except for a new guile REPL with nothing loaded into it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the program (from SICP):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME rules&#xA;#+BEGIN_SRC scheme :tangle yes :noweb yes&#xA;(define (deriv exp var)&#xA;  (cond ((constant? exp var) 0 )&#xA;        ((same-var? exp var) 1)&#xA;        ((sum? exp)&#xA;         (make-sum (deriv (A1 exp) var)&#xA;                   (deriv (A2 exp) var)))&#xA;        ((product? exp) &#xA;         (make-sum (make-product (M1 exp)&#xA;                                 (deriv (M2 exp) var))&#xA;                   (make-product (deriv (M1 exp) var)&#xA;                                 (M2 exp)))))) &#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC scheme :tangle yes :noweb yes&#xA;&#xA;(define atom?&#xA;  (lambda (x)&#xA;    (and (not (pair? x)) (not (null? x)))))&#xA;&#xA;&#xA;(define (constant? exp var)&#xA;  (and (atom? exp)&#xA;       (not (eq? exp var))))&#xA;&#xA;&#xA;(define (same-var? exp var)&#xA;  (and (atom? exp)&#xA;       (eq? exp var)))&#xA;&#xA;&#xA;(define (sum? exp)&#xA;  (and (not (atom? exp))&#xA;       (eq? (car exp) '+)))&#xA;&#xA;&#xA;(define (make-sum a1 a2)&#xA;  (list '+ a1 a2))&#xA;&#xA;&#xA;(define A1 cadr) ;;TODO rewrite these as lambda expressions (lambada (x) (car (cdr x)). something like that.&#xA;&#xA;&#xA;(define A2 caddr) &#xA;&#xA;&#xA;(define (product? exp)&#xA;  (and (not (atom? exp))&#xA;       (eq? (car exp) '*)))&#xA;&#xA;&#xA;(define (make-product m1 m2)&#xA;  (list '* m1 m2))&#xA;&#xA;&#xA;(define M1 cadr)&#xA;&#xA;&#xA;(define M2 caddr)&#xA;&#xA;&#xA;(define foo '(+ (* a (* x x))&#xA;               (* (* b x)&#xA;                  c)))&#xA;&#xA;&#xA;&amp;lt;&amp;lt;rules&amp;gt;&amp;gt;&#xA;&#xA;&#xA;(deriv foo 'x)&#xA;&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone tell me why the program isnt executed and instead a guile REPL is opened for some reason?&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="8306" LastEditDate="2015-07-25T19:30:09.387" LastActivityDate="2015-10-25T07:34:45.977" Title="executing scheme in org-mode babel" Tags="|org-mode|org-babel|scheme|literate-programming|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14238" PostTypeId="2" ParentId="2171" CreationDate="2015-07-25T19:47:12.653" Score="15" Body="&lt;p&gt;I write novels using Emacs, and have developed a workflow over time based on certain unique advantages of it. (Example: &lt;a href=&quot;https://www.hmhco.com/shop/books/The-Trap/9780547824086&quot;&gt;My most recent book&lt;/a&gt; was conceived, composed, and edited with Emacs.) That said, it is not a road without difficulties.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Org-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode is the reason I began using Emacs. Being able to fold and&#xA;unfold sections of a ~50K-words manuscript is invaluable. I&#xA;previously used the program &lt;a href=&quot;https://www.literatureandlatte.com/scrivener.php&quot;&gt;Scrivener&lt;/a&gt; but became disenchanted&#xA;with its bloat and unplain-text &lt;code&gt;.scriv&lt;/code&gt; files. Org-mode also has&#xA;the ability to move chapters (&lt;code&gt;trees&lt;/code&gt; and &lt;code&gt;subtrees&lt;/code&gt;) around easily&#xA;(with &lt;code&gt;M-arrow_key&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Text Manipulation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to emacs' plethora of text-finding, slicing, and pasting&#xA;utilities (&lt;code&gt;C-s&lt;/code&gt;, &lt;code&gt;M-y&lt;/code&gt;, etc. etc.) I use &lt;a href=&quot;https://github.com/chrisdone/god-mode&quot;&gt;god mode&lt;/a&gt; and&#xA;&lt;a href=&quot;https://github.com/abo-abo/avy&quot;&gt;avy mode&lt;/a&gt; to find my way around a buffer. The modal editing&#xA;enabled by the former helps with my arthritis. The latter is an&#xA;extremely fast way of navigating onscreen with just a few&#xA;keystrokes (usually on the home row).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Flyspell&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a perfectly adequate spell checker that benefits me every&#xA;day.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Magit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently began using &lt;a href=&quot;https://git-scm.com/&quot;&gt;Git&lt;/a&gt; via &lt;a href=&quot;https://bitbucket.org/&quot;&gt;Bitbucket&lt;/a&gt; to manage my work with&#xA;version control. I'm a beginner, but there are tremendous advantages,&#xA;and &lt;a href=&quot;https://github.com/magit/magit&quot;&gt;Magit&lt;/a&gt; is an excellent interface to that system. Though &lt;code&gt;Git&lt;/code&gt;&#xA;isn't exactly optimized for novel writing, it works well enough.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;TODO and COMMENT &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode has the ability to define jobs to do. With a large MS there&#xA;might be 40 or more things I need to remember, from small to large.&#xA;These can be identified and even ranked with &lt;a href=&quot;http://orgmode.org/manual/TODO-Items.html#TODO-Items&quot;&gt;TODO keywords&lt;/a&gt;.&#xA;Also, various notes and ideas headlines can be prefaced with&#xA;&lt;code&gt;COMMENT&lt;/code&gt;, which won't export when I send the file to &lt;code&gt;.odt&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Split window&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often work on a file with a split window, showing two locations in&#xA;a story. I frequently compare one location with another. For a long&#xA;while I did this with &lt;code&gt;split-window-right&lt;/code&gt; (&lt;code&gt;C-x 3&lt;/code&gt;), but I've&#xA;recently switched to &lt;code&gt;clone-indirect-buffer-other-window&lt;/code&gt; (&lt;code&gt;C-x 4&#xA;c&lt;/code&gt;). The advantage here is that if I change the folding state of&#xA;window A, it does not change the folding state of window B.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One Disadvantage&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Literary publishing runs on MSWord. It is &lt;em&gt;possible&lt;/em&gt; to get from&#xA;&lt;code&gt;.org&lt;/code&gt; to &lt;code&gt;.doc&lt;/code&gt; but not, for me, easy. I presently use Emacs'&#xA;&lt;code&gt;org-export&lt;/code&gt; to port files to &lt;code&gt;.odt&lt;/code&gt;, which I edit with&#xA;&lt;a href=&quot;https://www.libreoffice.org/&quot;&gt;Libreoffice&lt;/a&gt;. I manually, or with macros, achieve the formatting&#xA;necessary for the larger publishing world as I know it, then save the&#xA;file to &lt;code&gt;.doc&lt;/code&gt; The formatting is not complex, but it is required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The editorial process involves considerable back and forth, which means&#xA;that I serially export to Libreoffice and re-import to Emacs. On the&#xA;Emacs end, macros can retrieve the asterisks for my&#xA;headlines and straighten Word's smartquotes. I presently have no good&#xA;solution for italics. Sometimes I introduce errors. If Emacs wasn't&#xA;such an amazing text editing environment, I wouldn't suffer through&#xA;this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mickey Petersen has an excellent blog post describing &lt;a href=&quot;https://www.masteringemacs.org/article/how-to-write-a-book-in-emacs&quot;&gt;his own&#xA;workflow&lt;/a&gt; for his book &lt;em&gt;Mastering Emacs,&lt;/em&gt; which makes&#xA;use of &lt;code&gt;diff&lt;/code&gt; buffers to sort changes and comments (beyond my ken at&#xA;present), and also requires his literary editor/publisher to look at&#xA;plain-text files (which I've gotten pushback on, when I've tried it).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is the most effective tool I've found for writing and editing novels. There are also many&#xA;modes that might be of use to writers of other kinds of prose (such as&#xA;&lt;a href=&quot;https://github.com/punchagan/org2blog&quot;&gt;org2blog&lt;/a&gt; for composing and posting Wordpress blogs and&#xA;&lt;a href=&quot;https://www.gnu.org/software/auctex/&quot;&gt;AUCTeX&lt;/a&gt; for writing LaTeX files).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd love to see a future where the link between &lt;code&gt;.txt&lt;/code&gt; and &lt;code&gt;.doc&lt;/code&gt; was&#xA;smoother for the kind of writing I do. This would include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;setting Emacs to use double spacing or single spacing when requested&lt;/li&gt;&#xA;&lt;li&gt;inserting manual page breaks (for instance, after a title page)&lt;/li&gt;&#xA;&lt;li&gt;italics that don't fail around some punctuation marks&lt;/li&gt;&#xA;&lt;li&gt;creating simple, right-justified headers on all pages but the title&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are workarounds (&lt;a href=&quot;http://thewanderingcoder.com/2015/03/emacs-org-mode-styling-non-smart-quotes-zero-width-space-and-tex-input-method/&quot;&gt;here&lt;/a&gt; is a blog post by Sean Miller about&#xA;getting Emacs to consistently show italics that include punctuation, which encourages use of a zero-width space), and certainly things I don't yet know how to do as someone coming from the literary rather than the programming side of the text-editing world.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Awhile ago I chanced upon a newsgroup post by rms titled &quot;Emacs as word processor&quot;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;25 years ago I hoped we would extend Emacs to do WYSIWG word&#xA;  processing.  That is why we added text properties and variable width&#xA;  fonts.  However, more features are still needed to achieve this.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Could people please start working on the features that are needed?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'd love to see a future where I could do all of my literary work in Emacs without ever having to launch another editor. I'm not there now, but nonetheless am happy overall, because the amazing utility of this editor is more than worth the extra work on the export end.&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-07-25T20:44:08.237" LastActivityDate="2015-07-25T20:44:08.237" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14239" PostTypeId="2" ParentId="14235" CreationDate="2015-07-25T20:15:59.150" Score="7" Body="&lt;p&gt;Others have mentioned some reasons for not making a given function into a command. Here is another: user discovery and access to commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you ever manipulate or access commands interactively by name (e.g. &lt;code&gt;M-x&lt;/code&gt;, &lt;code&gt;C-h a&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Or if you ever manipulate them by program, then you typically want them distinguished from other functions.  But you might argue that this case is a side effect of the existing separation into two camps.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example of why you might not want the two to be confused: Try &lt;code&gt;C-u C-h a&lt;/code&gt; &lt;code&gt;^save RET&lt;/code&gt;.  About half of the functions listed are commands.  If all of them were commands then they would all be candidates when you did &lt;code&gt;M-x save TAB&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-25T20:15:59.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14240" PostTypeId="2" ParentId="14129" CreationDate="2015-07-26T02:45:12.740" Score="1" Body="&lt;p&gt;This is actually a very interesting Emacs Lisp programming question. We can keep forward-char or backward-char until we found the character under cursor is not part of the string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the font face to decide whether the character is inside the string. This is a great trick I learned from flyspell. In theory it's not perfect, but in real world it &lt;strong&gt;works with almost any programming language's major modes on Emacs23, Emacs24, Emacs25&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the complete code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun font-face-is-similar (f1 f2)&#xA;  (let (rlt)&#xA;    ;; (message &quot;f1=%s f2=%s&quot; f1 f2)&#xA;    ;; in emacs-lisp-mode, the '^' from &quot;^abde&quot; has list of faces:&#xA;    ;;   (font-lock-negation-char-face font-lock-string-face)&#xA;    (if (listp f1) (setq f1 (nth 1 f1)))&#xA;    (if (listp f2) (setq f2 (nth 1 f2)))&#xA;&#xA;    (if (eq f1 f2) (setq rlt t)&#xA;      ;; C++ comment has different font face for limit and content&#xA;      ;; f1 or f2 could be a function object because of rainbow mode&#xA;      (if (and (string-match &quot;-comment-&quot; (format &quot;%s&quot; f1)) (string-match &quot;-comment-&quot; (format &quot;%s&quot; f2)))&#xA;          (setq rlt t)))&#xA;    rlt))&#xA;&#xA;(defun goto-edge-by-comparing-font-face (&amp;amp;optional step)&#xA;&quot;Goto either the begin or end of string/comment/whatever.&#xA;If step is -1, go backward.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((cf (get-text-property (point) 'face))&#xA;        (p (point))&#xA;        rlt&#xA;        found&#xA;        end)&#xA;    (unless step (setq step 1)) ;default value&#xA;    (setq end (if (&amp;gt; step 0) (point-max) (point-min)))&#xA;    (while (and (not found) (not (= end p)))&#xA;      (if (not (font-face-is-similar (get-text-property p 'face) cf))&#xA;          (setq found t)&#xA;        (setq p (+ p step))))&#xA;    (if found (setq rlt (- p step))&#xA;      (setq rlt p))&#xA;    ;; (message &quot;rlt=%s found=%s&quot; rlt found)&#xA;    (goto-char rlt)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(goto-edge-by-comparing-font-face 1)&lt;/code&gt; go to the right edge, &lt;code&gt;(goto-edge-by-comparing-font-face -1)&lt;/code&gt; go to the left edge&lt;/li&gt;&#xA;&lt;li&gt;it's not dependent on any specific major-mode, you can use it anywhere in any language&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;backward-up-list&lt;/code&gt; is not very reliable from user's point of view because it's designed as a generic command based on &lt;code&gt;scan-sexps&lt;/code&gt;. For example, for code &lt;code&gt;if (true) { return 'hello world'; }&lt;/code&gt; in js2-mode, it will move the focus to the &lt;code&gt;{&lt;/code&gt; character instead of the first single quote character. For code &lt;code&gt;printf(&quot;hello world&quot;)&lt;/code&gt; in c++-mode, it won't work. I tested with Emacs 24.5&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-08-13T02:18:42.463" LastActivityDate="2015-08-13T02:18:42.463" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14241" PostTypeId="1" CreationDate="2015-07-26T03:04:12.490" Score="0" ViewCount="133" Body="&lt;p&gt;New to Python in Emacs. Whenever I try to do an eval-buffer on this server, I get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;IOError: [Errno 2] No such file or directory: '/tmp/py8168HeX'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;IOError: [Errno 2] No such file or directory: '/tmp/py81686TR'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the buffer does not evaluate. The same happens when I try to evaluate a region. I therefore can't use python interactively in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;;;;;;;&#xA;;; python&#xA;;;;;;;;;;&#xA;&#xA;;; Emacs for Python, taken from&#xA;;; https://github.com/gabrielelanaro/emacs-for-python/&#xA;&#xA;(load-file &quot;~/.emacs.d/emacs-for-python/epy-init.el&quot;)&#xA;&#xA;(setq skeleton-pair nil)  ;; parentheses&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/emacs-for-python/&quot;) ;; tell where to load the various files&#xA;(require 'epy-setup)      ;; It will setup other loads, it is required!&#xA;(require 'epy-python)     ;; If you want the python facilities [optional]&#xA;(require 'epy-completion) ;; If you want the autocompletion settings [optional]&#xA;(require 'epy-editing)    ;; For configurations related to editing [optional]&#xA;;;(require 'epy-bindings)   ;; For my suggested keybindings [optional]&#xA;(require 'epy-nose)       ;; For nose integration&#xA;&#xA;&#xA;;; send current line&#xA;(add-hook 'python-mode-hook&#xA;      'my-python-send-statement)&#xA;(defun my-python-send-statement ()&#xA;  (interactive)&#xA;  (local-set-key [C-return] 'my-python-send-statement)&#xA;  (end-of-line)&#xA;  (set-mark (line-beginning-position))&#xA;  (call-interactively 'python-shell-send-region))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9014" LastActivityDate="2015-07-26T03:04:12.490" Title="Python IOError whenever I eval a buffer or region" Tags="|python|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14242" PostTypeId="1" AcceptedAnswerId="14244" CreationDate="2015-07-26T04:20:10.747" Score="2" ViewCount="687" Body="&lt;p&gt;I'm new to Emacs and think I ran into some macro expansion problems. There's a function &lt;code&gt;solarized-with-color-variables&lt;/code&gt; which is a macro that creates local variables using &lt;code&gt;let*&lt;/code&gt; and then expands the macro body parameter inside the &lt;code&gt;let*&lt;/code&gt; body so that it has access to these variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At one point I need to &lt;code&gt;setq&lt;/code&gt; a variable to a value consisting of a list, the first element of which should take on the value of one of these variables, &lt;code&gt;green&lt;/code&gt;. Normally I did this like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq some-var `(,green box))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it seems that after switching to using &lt;code&gt;use-package.el&lt;/code&gt;'s &lt;code&gt;use-package&lt;/code&gt; macro, it seems like I'm in multiple layers of macros now, such that the above now expands one more time to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq some-var (green box))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, it attempts to call &lt;code&gt;green&lt;/code&gt; as a function, which it's not; it's a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to go about fixing this, or how I should proceed. My guess is that I have to basically wrap it in another layer of quotes so that the extra expansion leaves it as is, but being new to Emacs Lisp I'm not really sure how to do this. I tried a couple variations of &lt;code&gt;quote&lt;/code&gt; and &lt;code&gt;list&lt;/code&gt; to no avail.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; use-package is a macro&#xA;(use-package solarized-theme&#xA;  :ensure t&#xA;  :config&#xA;  (load-theme 'solarized-light t)&#xA;&#xA;  ;; solarized-with-color-variables is a macro&#xA;  (solarized-with-color-variables 'light&#xA;    (custom-theme-set-faces&#xA;     'solarized-light&#xA;     `(show-paren-match ((,class (:foreground unspecified&#xA;                                  :background ,base02&#xA;                                  :weight normal)))))&#xA;&#xA;    ;; I wanted to use with-eval-after-load but that's also a macro&#xA;    (eval-after-load 'evil&#xA;      (progn&#xA;        (setq some-var `(,green box))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I've come to realize that it is the &lt;code&gt;eval-after-load&lt;/code&gt; function I'm using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(solarized-with-color-variables 'light&#xA;    (setq evil-emacs-state-cursor `(,red box)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works. But if I put that inside of &lt;code&gt;eval-after-load&lt;/code&gt; or vice versa, it breaks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil&#xA;    (solarized-with-color-variables 'light&#xA;        (setq evil-emacs-state-cursor `(,red box))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It says that the value of &lt;code&gt;red&lt;/code&gt;, &quot;#blah&quot;, is not a valid function. I imagine that it's expanding macros twice, once for &lt;code&gt;solarized-with-color-variables&lt;/code&gt; so that it yields:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-emacs-state-cursor '(&quot;#blah&quot; box))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then again (?):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-emacs-state-cursor (&quot;#blah&quot; box))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when attempting to evaluate it it tries to use &lt;code&gt;&quot;#blah&quot;&lt;/code&gt; as a function, which it's not. Using the code from my own answer actually is giving me problems too, I guess it's not exactly the same as the value I set manually which is &lt;code&gt;'(&quot;#blah&quot; box)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq some-var `(list ,green 'box))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="2609" LastEditDate="2015-07-26T10:15:04.613" LastActivityDate="2015-07-26T10:15:04.613" Title="How to quote for multiple levels of macro expansion" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14244" PostTypeId="2" ParentId="14242" CreationDate="2015-07-26T05:29:46.297" Score="5" Body="&#xA;&#xA;&lt;p&gt;What should work is to drop the &lt;code&gt;eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package solarized-theme&#xA;  :ensure t&#xA;  :config&#xA;  ...&#xA;  ;; solarized-with-color-variables is a macro&#xA;  (solarized-with-color-variables 'light&#xA;    ...&#xA;    (setq some-var `(,green box))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It says that the value of red, &quot;#blah&quot;, is not a valid function. I imagine that it's expanding macros twice, once for solarized-with-color-variables so that it yields:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's calling green as a function but not because of nested macros, rather, it's because &lt;code&gt;eval-after-load&lt;/code&gt; is a &lt;strong&gt;function&lt;/strong&gt;, and functions have their arguments evaluated before they are called, so when you call&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'evil&#xA;  (progn&#xA;    (setq some-var `(,green box))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It firsts evaluates the &lt;code&gt;progn&lt;/code&gt; which sets &lt;code&gt;some-var&lt;/code&gt; to the list &lt;code&gt;(&quot;#859900&quot; box)&lt;/code&gt; and returns that value (because &lt;code&gt;setq&lt;/code&gt; returns the value it sets). The 2nd argument to &lt;code&gt;eval-after-load&lt;/code&gt; is supposed to be a form to evaluate, so after &lt;code&gt;evil&lt;/code&gt; is loaded it tries to evaluate &lt;code&gt;(&quot;#859900&quot; box)&lt;/code&gt; as a form, i.e. call the first element as a function, which of course fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually you should quote the form you pass to &lt;code&gt;eval-after-load&lt;/code&gt;, but in this case that would block &lt;code&gt;green&lt;/code&gt; from being substituted, because would be gone when the evaluation happens. &lt;em&gt;If&lt;/em&gt; you have set &lt;code&gt;lexical-binding: t&lt;/code&gt; at the top of your init file, you can use lambda instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'evil&#xA;  (lambda ()&#xA;    (setq some-var `(,green box))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the same as using &lt;code&gt;with-eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'evil&#xA;  (setq some-var `(,green box)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't use lexical binding, you can sort of fake it by constructing the list to be evaluated:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'evil&#xA;  `(setq some-var '(,green box)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But since you don't usually need to delay &lt;code&gt;setq&lt;/code&gt;ing variables, dropping the after-load stuff entirely is simplest for this particular case.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-07-26T07:53:12.647" LastActivityDate="2015-07-26T07:53:12.647" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14245" PostTypeId="1" CreationDate="2015-07-26T06:09:56.663" Score="7" ViewCount="1148" Body="&lt;p&gt;I am trying to read the &lt;code&gt;man&lt;/code&gt; pages in color. So far I have been using &lt;code&gt;eshell&lt;/code&gt; and just typing &lt;code&gt;man &amp;lt;program&amp;gt;&lt;/code&gt; However this does not use color to highlight the options etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read that &lt;code&gt;M-x woman&lt;/code&gt; mode will render the &lt;code&gt;man&lt;/code&gt; pages in color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However not only does this fail to render the pages in color, usually it does not work at all or it shows the pages not in color (which is what the &lt;code&gt;M-x man&lt;/code&gt; command does).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to render the man pages in color?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="2755" LastEditDate="2016-11-26T22:27:11.867" LastActivityDate="2016-11-26T22:27:11.867" Title="Is there a way to view the man pages in color in emacs?" Tags="|eshell|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14246" PostTypeId="1" CreationDate="2015-07-26T06:17:09.667" Score="5" ViewCount="1611" Body="&lt;p&gt;I can't believe there is no way in Emacs to easily and reliably ignore the mouse but my google fu seems not good enough to find how to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By easily and reliably I mean to disable the device, not unbind the mouse events (which is not reliable as any modes can rebind them).&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2015-07-27T02:14:17.083" LastActivityDate="2016-06-18T23:02:33.363" Title="Is it possible to disable the support for the mouse in GUI?" Tags="|mouse|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14247" PostTypeId="1" CreationDate="2015-07-26T06:50:27.523" Score="2" ViewCount="128" Body="&lt;p&gt;I am using &lt;code&gt;org-journal-mode&lt;/code&gt;. I have created &lt;code&gt;.dir-locals.el&lt;/code&gt; in my &lt;code&gt;~/Documents/journal&lt;/code&gt; directory and it gets correctly applied if I open a file the usual way. However, if I hit the &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-j&lt;/kbd&gt; to add a new entry and the entry is in a new day, the opened buffer does not have the modifications I apply through &lt;code&gt;.dir-locals.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I make it recognize and process &lt;code&gt;.dir-locals.el&lt;/code&gt; for new day journal entry buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.dir-locals.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;  (fill-column . 79)&#xA;  (indent-tabs-mode)&#xA;  (show-trailing-whitespace . t)&#xA;  (whitespace-style face trailing lines-tail space-before-tab indentation empty)&#xA;  (whitespace-newline . t))&#xA; (org-journal-mode&#xA;  (typo-language . &quot;Czech&quot;)&#xA;  (typo-mode . t)&#xA;  (ispell-local-dictionary . &quot;czech&quot;)&#xA;  (flyspell-mode . t)&#xA;  (whitespace-action warn-read-only auto-cleanup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="968" LastActivityDate="2015-07-26T06:50:27.523" Title="org-journal-mode new entry ignores .dir-locals.el" Tags="|org-mode|directory-local-variables|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14248" PostTypeId="1" AcceptedAnswerId="14250" CreationDate="2015-07-26T10:36:02.090" Score="8" ViewCount="953" Body="&lt;p&gt;For example, I want to use a library that requires I am on org-mode version 8 or above. I don't know what version of org-mode I have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;M-x version&lt;/code&gt; only gives me the emacs version. Is there a command where I can get the org-mode version?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: As @Drew mentioned in the comments, I am searching for the version of a &lt;em&gt;package&lt;/em&gt;, not a &lt;em&gt;mode&lt;/em&gt;. In this example, I want to get the version of the org-mode &lt;em&gt;package&lt;/em&gt;, not the version of org-mode itself.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-07-27T06:25:11.367" LastActivityDate="2021-12-28T10:27:38.543" Title="How can I find which version of a particular mode I am using?" Tags="|version-compatibilty|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14249" PostTypeId="2" ParentId="14228" CreationDate="2015-07-26T11:18:18.087" Score="0" Body="&#xA;&#xA;&lt;p&gt;It looks like &lt;code&gt;yas-global-mode&lt;/code&gt; became part of your &lt;code&gt;user&lt;/code&gt; theme (perhaps because you set it via the customize interface? (the docstring of &lt;code&gt;custom-set-variables&lt;/code&gt; says &quot;These settings are registered as theme `user'.&quot;)). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible workaround could be to let-bind &lt;code&gt;yas-global-mode-hook&lt;/code&gt; in &lt;code&gt;toggle-evil-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Evil Mode Switcher&#xA;(defun toggle-evil-mode ()&#xA;  (interactive)&#xA;  (let ((yas-global-mode-hook nil)) ; don't reload snippets&#xA;    (if (not evil-mode)&#xA;        (progn&#xA;          (evil-mode 1)&#xA;          (enable-theme 'ample))&#xA;      (progn&#xA;        (evil-mode 0)&#xA;        (enable-theme 'ample-flat)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another possibility might be to remove &lt;code&gt;yas-global-mode&lt;/code&gt; from your custom settings, and just call &lt;code&gt;(yas-global-mode +1)&lt;/code&gt; in your init file directly.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-07-26T11:18:18.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14250" PostTypeId="2" ParentId="14248" CreationDate="2015-07-26T11:20:20.253" Score="14" Body="&lt;p&gt;You can use &lt;kbd&gt;C-h P&lt;/kbd&gt; (&lt;code&gt;describe-package&lt;/code&gt;). After entering a package name, the attributes (including version) of the package will be listed in the &lt;code&gt;*Help*&lt;/code&gt; buffer. Besides, you can also view the version of a package from Package Menu (&lt;kbd&gt;M-x list-packages&lt;/kbd&gt;).&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-07-26T11:20:20.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14251" PostTypeId="1" AcceptedAnswerId="14262" CreationDate="2015-07-26T12:15:00.550" Score="0" ViewCount="346" Body="&lt;p&gt;In &lt;code&gt;ansi-term&lt;/code&gt; buffer, I try to run a command with &lt;code&gt;C-u&lt;/code&gt; through &lt;code&gt;helm-M-x&lt;/code&gt;. But it seems doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the key sequence I have tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`C-x M-x &amp;lt;type the cmd&amp;gt; C-u &amp;lt;RET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it seems the command does not run the way it should with &lt;code&gt;C-u&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-08-26T04:15:39.943" Title="How to pass `C-u` to `helm-M-x` in `ansi-term` buffer?" Tags="|helm|ansi-term|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14252" PostTypeId="2" ParentId="14251" CreationDate="2015-07-26T13:24:39.957" Score="0" Body="&lt;p&gt;&lt;code&gt;C-x M-x&lt;/code&gt; runs the &lt;code&gt;execute-extended-command&lt;/code&gt; command (the built-in &lt;code&gt;M-x&lt;/code&gt;), not &lt;code&gt;helm-M-x&lt;/code&gt;.  With &lt;code&gt;helm-mode&lt;/code&gt; enabled, &lt;code&gt;execute-extended-command&lt;/code&gt; looks like &lt;code&gt;helm-M-x&lt;/code&gt;, but they are very different, the latter provides much more features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define a key, for example &lt;code&gt;M-x&lt;/code&gt; (&lt;code&gt;C-x M-x&lt;/code&gt; will not work, I don't know why), for &lt;code&gt;helm-M-x&lt;/code&gt; in &lt;code&gt;term-mode&lt;/code&gt;, something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'term-mode-hook&#xA;          (lambda ()&#xA;            (define-key term-raw-map (kbd &quot;M-x&quot;) #'helm-M-x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so now &lt;code&gt;M-x some-command C-u RET&lt;/code&gt; should work.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-07-26T13:49:24.743" LastActivityDate="2015-07-26T13:49:24.743" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14253" PostTypeId="1" AcceptedAnswerId="17293" CreationDate="2015-07-26T13:39:41.753" Score="1" ViewCount="740" Body="&lt;p&gt;I have &lt;code&gt;(setq helm-always-two-windows t)&lt;/code&gt;. When invoking a helm buffer i.e &lt;code&gt;helm-find-files&lt;/code&gt; or &lt;code&gt;helm-mini&lt;/code&gt; with 2 vertical splits helm deletes the other window in preperation to perform a possible persistent action in the currently selected window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to stop helm deleting the other window and preserve the 2 vertical splits when the helm buffer is opened?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ido-mode along with ido-vertical-mode seems to have the exact behaviour I'm after with vertical splits as it has no need to accommodate a persistent action.&lt;/p&gt;&#xA;" OwnerUserId="6713" LastEditorUserId="6713" LastEditDate="2015-07-26T13:45:38.403" LastActivityDate="2015-10-11T04:08:12.657" Title="How to stop helm deleting vertical split when opening helm buffer?" Tags="|helm|buffers|window|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14254" PostTypeId="1" CreationDate="2015-07-26T14:26:00.770" Score="10" ViewCount="2876" Body="&lt;p&gt;I'm using org-babel to do litterate programming and I find it very convenient. I am able to execute shell commands on remote hosts, and local database commands with the postgres client. To open a file as postgres user, it would look for example like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f /sshx:user@remotehost|sudo:postgres@remotehost:/tmp/testfile&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To do so on Emacs 24.5.1, I needed to add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;(add-to-list 'tramp-default-proxies-alist&#xA;             '(nil &quot;\\`postgres\\'&quot; &quot;/ssh:%h:&quot;))&#xA;(add-to-list 'tramp-default-proxies-alist&#xA;             '((regexp-quote (system-name)) nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far, I have failed to understand how one could execute a postgresql (or mysql if you so choose) command on a remote server. The database &lt;strong&gt;server is not accessible directly&lt;/strong&gt; over the network, I have to ssh into the remote host, su as the postgres user and then I'm able to execute commands through the psql client.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could one use such a command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sql :engine postgresql :ExtraParametersIfNeeded&#xA;SELECT * from pg_database&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On a remote host? I know the :dir switch, but have so far only been able to use it for shell scripts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="424" LastActivityDate="2018-03-03T01:34:00.783" Title="org-babel and remote sql commands" Tags="|org-mode|org-babel|sql|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14255" PostTypeId="1" AcceptedAnswerId="14258" CreationDate="2015-07-26T15:31:58.703" Score="1" ViewCount="1161" Body="&lt;p&gt;Somebody in my team has checked in a file with MS-DOS line endings into the git repo. with vi's binary mode, &lt;code&gt;vi -b hello.py&lt;/code&gt;, i can see lines ending with ctrl character - &lt;code&gt;^M&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs, whitespace-mode, the same characters are shown with &lt;code&gt;$&lt;/code&gt; sign. I infer, emacs has changed &lt;code&gt;^M&lt;/code&gt;/&lt;code&gt;$&lt;/code&gt; chars uniformly to &lt;code&gt;$&lt;/code&gt; chars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i restrict emacs from converting windows line feed into unix line feed and rather show the line feed chars - &lt;code&gt;^M&lt;/code&gt; in its original form and not as &lt;code&gt;$&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to figure out, if git local repo can be configured to do this windows to unix line feed mapping, rather than emacs doing it.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-07-26T20:10:46.810" Title="Emacs whitespace mode doesn't show ^M characters" Tags="|newlines|whitespace-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14256" PostTypeId="1" AcceptedAnswerId="14260" CreationDate="2015-07-26T15:49:10.453" Score="4" ViewCount="316" Body="&lt;p&gt;Some Lisp programmers advocate keeping code mainly into one file, following the concepts of &lt;a href=&quot;https://www.youtube.com/watch?v=Av0PQDVTP4A&quot; rel=&quot;nofollow&quot;&gt;Literate Programming in the Large&lt;/a&gt;, (note: the video is more about the method than Axiom, an open source computer algebra system written mostly in Lisp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a tendency to split a long elisp file into related files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some believe this may be a matter of personal opinion. Doing some research, it seems, at least in Lisp, such issue is also a matter of proper coding style and proper code management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quite a few experienced Lisp programmers spent considerable time about this subject. There are whole books and online documents that speaks about style (for example, Molly Miller's &quot;LISP: Style and Design&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering what approach in managing code is advisable when dealing with large elisp (and lisp) files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on on that, which special tools (ie, unique to elisp programming) does Emacs offer to navigate either a long elisp file, or a collection of related lisp files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am especially interested in less widely know tools.  For example, there is code out there to help &lt;a href=&quot;http://www.davep.org/emacs/unbind.el&quot; rel=&quot;nofollow&quot;&gt;unbinding things&lt;/a&gt; or &lt;a href=&quot;http://www.davep.org/emacs/nukneval.el&quot; rel=&quot;nofollow&quot;&gt;nuke and reevaluate an elisp buffer&lt;/a&gt;. It seems that kind of tools could be quite useful, but they would probably not make much sense for very large files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus question: Is there a criteria, like grouping into logical units, or other quantifiable values (like: LOC, number of functions, etc) that can help in deciding? &lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="249" LastEditDate="2015-07-31T15:16:17.603" LastActivityDate="2015-07-31T15:16:17.603" Title="When to split long elisp files to separate files?" Tags="|elisp|coding-conventions|" AnswerCount="1" CommentCount="3" ClosedDate="2015-07-27T21:22:43.833" ContentLicense="CC BY-SA 3.0" />
  <row Id="14257" PostTypeId="2" ParentId="13702" CreationDate="2015-07-26T19:00:15.763" Score="7" Body="&lt;p&gt;I had the same problem as you: looking at the source for the variable definition it looks like the form he is using to declare it is not valid in Emacs 24 any more:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom helm-recentf-fuzzy-match nil&#xA;&quot;Enable fuzzy matching in `helm-source-recentf' when non--nil.&quot;&#xA;  :group 'helm-files&#xA;  :type 'boolean&#xA;  :set (lambda (var val)&#xA;     (set var val)&#xA;     (setq helm-source-recentf&#xA;           (helm-make-source &quot;Recentf&quot; 'helm-recentf-source&#xA;             :fuzzy-match helm-recentf-fuzzy-match))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Specifically the &lt;code&gt;:set&lt;/code&gt; keyword doesn't seem to be valid so the lambda that redefines the source is never called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To workaround this I just redeclared the source manually in my &lt;code&gt;init.el&lt;/code&gt; file and it worked fine.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; helm-recentf-fuzzy-match var is broken: redeclare it manually&#xA;(setq helm-source-recentf &#xA;  (helm-make-source &quot;Recentf&quot; 'helm-recentf-source&#xA;    :fuzzy-match t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8746" LastActivityDate="2015-07-26T19:00:15.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14258" PostTypeId="2" ParentId="14255" CreationDate="2015-07-26T20:10:46.810" Score="2" Body="&lt;p&gt;First, &lt;code&gt;^M&lt;/code&gt; is the carriage-return character, not the linefeed char (that one is &lt;code&gt;^J&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one answer for this part of your question: How to &#xA;&lt;em&gt;show the line feed chars - ^M in its original form and not as $&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;By default, &lt;code&gt;^M&lt;/code&gt; characters should be highlighted using face &lt;code&gt;escape-glyph&lt;/code&gt;.  Are you sure this is what you are seeing?  Try customizing that face (&lt;code&gt;M-x customize-face&lt;/code&gt;) to something more noticeable than the default coloring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not see &lt;code&gt;escape-glyph&lt;/code&gt; highlighting with your Emacs setup, try starting from &lt;code&gt;emacs -Q&lt;/code&gt; (no init file).  Now do you see this highlighting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, then recursively bisect your init file, to see which part of it introduces the problem. You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment out a selection of text, and &lt;code&gt;C-u&lt;/code&gt; with that command to uncomment a selection.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also try using library &lt;a href=&quot;http://www.emacswiki.org/highlight-chars.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/a&gt;, which gives you more options for highlighting characters (any characters).  &lt;a href=&quot;http://www.emacswiki.org/ShowWhiteSpace#HighlightChars&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is more info about this library.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For the line-end conversion part of your question, have a look at the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Text-and-Binary.html&quot; rel=&quot;nofollow&quot;&gt;Text and Binary&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone else can speak to how you might use GIT to perform the conversion automatically.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-26T20:10:46.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14259" PostTypeId="2" ParentId="14212" CreationDate="2015-07-26T20:15:50.673" Score="0" Body="&lt;p&gt;Here is the solution I ended up with: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Assume an Emacs server with name &lt;code&gt;my_server&lt;/code&gt; is up and running.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Convert &lt;code&gt;emacs-mule&lt;/code&gt; to &lt;code&gt;utf-8&lt;/code&gt; by calling &lt;code&gt;emacsclient&lt;/code&gt; from the Perl script:    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s my_server -e '(my-convert-mule-utf8 \&quot;.emacs.desktop\&quot;)' &amp;gt;/dev/null 2&amp;gt;&amp;amp;1`&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;my-convert-mule-utf8&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-convert-mule-utf8 (fn)&#xA;  (let*  ((temp-fn (concat fn &quot;.utf8&quot;))&#xA;         (coding-system-for-write 'utf-8))&#xA;    (with-temp-file temp-fn&#xA;      (insert-file-contents fn)&#xA;      (when (re-search-forward &quot;coding: \\(emacs-mule\\);&quot; (line-end-position) t)&#xA;        (replace-match &quot;utf-8&quot; nil t nil 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;To convert &lt;code&gt;utf-8&lt;/code&gt; to &lt;code&gt;emacs-mule&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s my_server -e '(my-convert-utf8-mule \&quot;.emacs.desktop\&quot;)' &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;my-convert-utf8-mule&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-convert-utf8-mule (fn)&#xA;  (let* ((temp-fn (concat fn &quot;.utf8&quot;))&#xA;         (coding-system-for-write 'emacs-mule))&#xA;    (with-temp-file fn&#xA;      (insert-file-contents temp-fn)&#xA;      (when (re-search-forward &quot;coding: \\(utf-8\\);&quot; (line-end-position) t)&#xA;        (replace-match &quot;emacs-mule&quot; nil t nil 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2015-07-26T20:15:50.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14260" PostTypeId="2" ParentId="14256" CreationDate="2015-07-26T21:36:18.220" Score="8" Body="&lt;p&gt;There are various coding standards which enforce certain maximal length. One popular example would be to say that a function shouldn't span more than one screen. Obviously, there are different screens (we aren't talking about terminals from the middle of the previous century), but the rationale here is also obvious: scrolling doesn't aid reading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'd stop much sooner. According to various researches, we are able to hold somewhere between 4 and 7 things in our immediate memory at once. This would make an ideal paragraph of text have four to seven sentences. Similarly, an ideal function would have four to seven statements in it, so that when reading it, you wouldn't need to re-read just to recall what other &quot;stuff&quot; there was. This value also varies with experience you have with reading code, similarly to how when children learn to read, they distinguish smaller chunks of text (syllables, or even single characters), but need special effort to distinguish larger features, programmers, who read more code can parse the structure easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another metric is to ask yourself whether the purpose of the function is properly defined. Isn't this function doing more than one thing? Try to imagine scenarios, where a part of the function may be used alone, without having to use the remaining part. If such a scenario is easy to imagine, it's time to split the function in two.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Obviously, none of this gives a numeric estimate, yet it certainly may be used against your opponents at code review time ;)&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-26T21:36:18.220" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14262" PostTypeId="2" ParentId="14251" CreationDate="2015-07-27T02:53:58.443" Score="0" Body="&lt;p&gt;Today, I just try to use &lt;code&gt;C-c C-h k&lt;/code&gt; to find out what's the keybinding for &lt;code&gt;ansi-term&lt;/code&gt; mode. But when I just type &lt;code&gt;C-c C-h&lt;/code&gt;, it pops up the &lt;code&gt;*help*&lt;/code&gt; buffer and luckily shows the keybinding for &lt;code&gt;helm-M-x&lt;/code&gt; which is bind to &lt;code&gt;C-c c M-x&lt;/code&gt; or &lt;code&gt;C-x c M-x&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What that extra &lt;code&gt;c&lt;/code&gt; key stroke, the &lt;code&gt;C-u&lt;/code&gt; is passed to &lt;code&gt;helm-M-x&lt;/code&gt; properly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the solution for me is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`C-c c M-x &amp;lt;cmd supports C-u&amp;gt; C-u`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`C-x c M-x &amp;lt;cmd supports C-u&amp;gt; C-u`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't figure out how the keys are binding in that way. Hope it also works for anyone else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMO: The keybinding of &lt;code&gt;term.el&lt;/code&gt; is a little bit chaos.&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-07-27T02:53:58.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14263" PostTypeId="1" AcceptedAnswerId="14281" CreationDate="2015-07-27T04:40:52.867" Score="9" ViewCount="6909" Body="&lt;p&gt;When I do &lt;code&gt;M-x package-install RET magit&lt;/code&gt; it installs the latest version of magit which is &lt;code&gt;2.1.0&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to install &lt;code&gt;magit 1.4.2&lt;/code&gt;. I don't want to do it manually by downloading and loading package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I am downloading a python package, I can specify version number while installing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pip install django==1.8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I do something like that and install &lt;code&gt;magit=1.4.2&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="563" LastEditDate="2015-07-27T08:19:29.263" LastActivityDate="2022-05-12T08:58:22.133" Title="How to install a specific version of package?" Tags="|package|magit|package-repositories|install|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14264" PostTypeId="2" ParentId="14248" CreationDate="2015-07-27T04:47:16.327" Score="3" Body="&lt;p&gt;Packages aside, note that &lt;code&gt;M-x find-library&lt;/code&gt; will take you to the source code for a given library name. Assuming the author has assigned a version, you will typically find that information specified in the comments at the top of the file.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-07-27T04:47:16.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14265" PostTypeId="2" ParentId="14237" CreationDate="2015-07-27T05:37:24.737" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;But what I really want, is org-mode to tangle it behind the scenes a print the result of the execution into this file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For that you need the :results directive as shown below. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BEGIN_SRC scheme :tangle yes :noweb yes :results output&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See babel &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/intro.html#source-code-execution&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; for details of whether to use &lt;strong&gt;value&lt;/strong&gt; instead of &lt;strong&gt;output&lt;/strong&gt; in the :results directive. Value is good if want only the last statement's output.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-07-27T05:37:24.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14266" PostTypeId="2" ParentId="14215" CreationDate="2015-07-27T05:53:42.343" Score="1" Body="&lt;p&gt;After some research I've found an idiom that can be used to create a window&#xA;at the bottom (or indeed anywhere) of currently active window. This itself&#xA;has effect of temporary, auxiliary window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((buffer (get-buffer-create &quot;*Name of Buffer*&quot;)))&#xA;  (with-current-buffer buffer&#xA;    (with-current-buffer-window&#xA;     ;; buffer or name&#xA;     buffer&#xA;     ;; action (for `display-buffer')&#xA;     (cons 'display-buffer-below-selected&#xA;           '((window-height . fit-window-to-buffer)&#xA;             (preserve-size . (nil . t))))&#xA;     ;; quit-function&#xA;     (lambda (window _value)&#xA;       (with-selected-window window&#xA;         (unwind-protect&#xA;             ;; code that gets user input&#xA;           (when (window-live-p window)&#xA;             (quit-restore-window window 'kill)))))&#xA;     ;; Here we generate the popup buffer.&#xA;     (setq cursor-type nil)&#xA;     ;; …&#xA;     )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can play a bit with &lt;code&gt;action&lt;/code&gt; argument of &lt;code&gt;with-current-buffer-window&lt;/code&gt; if&#xA;you want the popup to appear in different part of the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quit function is described in doc-string of &lt;code&gt;with-current-buffer-window&lt;/code&gt;, it&#xA;can be used to get input from user. As @tarsius suggested,&#xA;&lt;code&gt;read-char-choice&lt;/code&gt; is a good candidate for experimenting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The popup buffer itself can be generated just like any other buffer. I'm&#xA;still thinking of buttons there, because user could use his mouse to select&#xA;an item in the popup menu, not just keyboard. However, this requires&#xA;additional effort if you want to do it well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your popup is a bit ad-hoc and you won't need it more than once, you can&#xA;get away with this solution. Also, take a look at&#xA;&lt;code&gt;completion--insert-strings&lt;/code&gt;. I found it quite useful as an example of how to&#xA;generate pretty rows of menu items, you can even use it unaltered if you&#xA;don't need something special.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-27T10:29:33.603" LastActivityDate="2015-07-27T10:29:33.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14267" PostTypeId="2" ParentId="14235" CreationDate="2015-07-27T06:19:02.263" Score="4" Body="&lt;p&gt;When you're writing Emacs Lisp code, or indeed any sort of code, one of the most important things is to divide your work clearly, so users and programmers both can see role of every function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interactive functions or commands are supposed to be invoked by user directly. They allow to use functionality you want to provide. You should not declare interactive functions that are not supposed to be user interface of your package, this is confusing and not only because of &quot;contamination&quot; of list of available commands in &lt;kbd&gt;M-x&lt;/kbd&gt; for example, but on design level, which is more important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, you could ask why Emacs Lisp programmers use this sort of convention: &lt;code&gt;&amp;lt;package-name&amp;gt;-&amp;lt;symbol&amp;gt;&lt;/code&gt; for public functions and &lt;code&gt;&amp;lt;package-name&amp;gt;--&amp;lt;symbol&amp;gt;&lt;/code&gt; for auxiliary, internal ones. Again, this helps to divide your program and make clearer purpose of every element.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-27T06:19:02.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14268" PostTypeId="2" ParentId="14254" CreationDate="2015-07-27T11:46:35.693" Score="2" Body="&lt;p&gt;I'm not an org user, so I can answer only from the Tramp point of view. The Tramp settings you have shown above are not needed (&lt;code&gt;add-to-list&lt;/code&gt; forms), since you are using ad-hoc multi-hops in your file name. So I assume a simple &lt;code&gt;:dir &quot;/sshx:user@remotehost|sudo:postgres@remotehost:/path/to/dir&quot;&lt;/code&gt; should do the job.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-07-27T11:46:35.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14269" PostTypeId="1" AcceptedAnswerId="14270" CreationDate="2015-07-27T12:39:52.283" Score="19" ViewCount="1590" Body="&lt;p&gt;How to detect if the point is within a comment area?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-07-27T13:14:34.943" LastActivityDate="2020-11-29T11:23:34.347" Title="How to detect if the point is within a comment area?" Tags="|comment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14270" PostTypeId="2" ParentId="14269" CreationDate="2015-07-27T12:42:41.043" Score="20" Body="&lt;p&gt;Check the fourth&lt;sup&gt;*&lt;/sup&gt; value in the list returned by &lt;code&gt;syntax-ppss&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nth 4 (syntax-ppss))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's &lt;code&gt;nil&lt;/code&gt; if point is outside any comment, &lt;code&gt;t&lt;/code&gt; if inside a non-nestable comment, or an integer (the nesting depth) if inside a nestable comment.  See the docstring for &lt;code&gt;parse-partial-sexp&lt;/code&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;*&lt;/sup&gt; Zero-based.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this doesn't work with Org-mode, you should use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun in-comment-p ()&#xA;  &quot;Testy if cursor/point in a commented line?&quot;&#xA;  (save-excursion&#xA;        (if (derived-mode-p 'org-mode)&#xA;                (save-match-data (beginning-of-line) (looking-at &quot;^[ \t]*#&quot;))&#xA;          (nth 4 (syntax-ppss)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastEditorUserId="794" LastEditDate="2019-03-11T17:39:38.483" LastActivityDate="2019-03-11T17:39:38.483" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="14271" PostTypeId="1" CreationDate="2015-07-27T13:28:17.647" Score="0" ViewCount="85" Body="&lt;p&gt;I would like to perform some commands after I open a file in helm. For instance, call &lt;code&gt;imenu&lt;/code&gt; to get a list of headings of opened org-mode buffer. But for some buffers, like &lt;code&gt;message&lt;/code&gt;, it is not necessary to do that. So if here, the major-mode name or the file name of current selection in helm can be obtained, it will be much easy to call conditional subsequent commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun call-imenu-after-helm () &#xA;    (interactive)&#xA;    (helm-for-files)&#xA;    (when &quot;a condition to say this buffer is a org file&quot;&#xA;       (helm-imenu)&#xA;       (org-show-entry)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I asked help in github and google plus, but it seems like that the function has not been implemented in helm for now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone get some good ideas to do this?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2274" LastEditDate="2015-07-28T23:51:19.873" LastActivityDate="2015-07-28T23:51:19.873" Title="How can I get the major-mode name of buffer at the cursor in Helm" Tags="|helm|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14272" PostTypeId="1" AcceptedAnswerId="14273" CreationDate="2015-07-27T13:42:55.110" Score="3" ViewCount="1772" Body="&lt;p&gt;I am thinking about mimicking Outlook interface on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let say I am planning my week, and I see that on Tuesday next week I don't see any todo there. So, I move the cursor to the date and hit some keyboard shortcut. Then I will be able to add a todo task to the date. The task will be saved in a preconfigured file (i.e. todo.org). How do I do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;calendar&lt;/code&gt; view I can see that I can add a diary entry to date. But I need more customization.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastActivityDate="2015-07-27T13:59:12.353" Title="Insert tasks at agenda/calendar view" Tags="|org-mode|org-agenda|calendar|todo|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14273" PostTypeId="2" ParentId="14272" CreationDate="2015-07-27T13:59:12.353" Score="3" Body="&lt;p&gt;For agenda view, I found out &lt;code&gt;Capture with cursor date&lt;/code&gt; &lt;kbd&gt;k&lt;/kbd&gt; does what I want after setting &lt;code&gt;(setq org-default-notes-file &quot;~/todo.org&quot;)&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not that visual compared to Outlook calendar, but good enough for me.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastActivityDate="2015-07-27T13:59:12.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14274" PostTypeId="1" AcceptedAnswerId="14275" CreationDate="2015-07-27T14:31:42.103" Score="6" ViewCount="2558" Body="&lt;p&gt;I would like to change the shape of the cursor to something like the following image:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4OnVl.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4OnVl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a bit taller and thicker than the default one.  How do I do that?&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="253" LastEditDate="2015-07-27T14:38:19.207" LastActivityDate="2023-11-01T02:08:43.727" Title="How do you change the text cursor height and thickness?" Tags="|themes|customize|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14275" PostTypeId="2" ParentId="14274" CreationDate="2015-07-27T14:34:04.313" Score="4" Body="&lt;p&gt;You can customize the value of &lt;code&gt;cursor-type&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Cursor to use when this buffer is in the selected window.&#xA;  Values are interpreted as follows:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;t&lt;/code&gt;        use the cursor specified for the frame&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;nil&lt;/code&gt;          don't display a cursor&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;box&lt;/code&gt;          display a filled box cursor&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;hollow&lt;/code&gt;   display a hollow box cursor&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;bar&lt;/code&gt;          display a vertical bar cursor with default width&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(bar . WIDTH)&lt;/code&gt;    display a vertical bar cursor with width WIDTH&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;hbar&lt;/code&gt;         display a horizontal bar cursor with default height&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(hbar . HEIGHT)&lt;/code&gt; display a horizontal bar cursor with height HEIGHT&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;ANYTHING ELSE      display a hollow box cursor&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It looks like you want something like &lt;code&gt;(setf cursor-type 'bar)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-27T14:34:04.313" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14276" PostTypeId="1" CreationDate="2015-07-27T15:24:20.277" Score="1" ViewCount="716" Body="&lt;p&gt;I got the &lt;a href=&quot;https://github.com/rudolfochrist/interleave&quot; rel=&quot;nofollow&quot;&gt;interleave&lt;/a&gt; package up and running and started using it. Now I try to &lt;code&gt;M-x interleave&lt;/code&gt; a new document from the org file and it tries to open the document in new file Fundamental mode buffer instead of the pdf that exists on path with DocView.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same happens when I do &lt;code&gt;M-x interleave--open-notes-file-for-pdf&lt;/code&gt; on an already open pdf in DocView, when the org file of the same basename exists with the &lt;code&gt;#+INTERLEAVE_PDF: ./basename&lt;/code&gt; already present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my old interleaved documents (for which I wrote the header) still work both ways. And I can create an org file (that ends up creating the same header as if I would write it) from an open pdf by &lt;code&gt;M-x interleave--open-notes-file-for-pdf&lt;/code&gt; with &lt;code&gt;interleave-org-notes-dir-list&lt;/code&gt; set to only &lt;code&gt;.&lt;/code&gt; or, puzzlingly an &lt;code&gt;i&lt;/code&gt; (for insert entry for this page into notes) even when the pdf buffer only reports being in DocView mode. After that it behaves as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone have any ideas on how different behaviors like this could exist simultaneously? I thought that the interleaved information was contained in the org file only.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="9019" LastEditDate="2015-07-28T17:24:35.697" LastActivityDate="2015-07-28T17:24:35.697" Title="Interleave.el opens pdf in Fundamental" Tags="|org-mode|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14277" PostTypeId="2" ParentId="14215" CreationDate="2015-07-27T16:27:37.217" Score="1" Body="&lt;p&gt;Here is a 3rd-party solution, using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Your code pops up a window with the candidates arranged neatly as a&#xA;menu.  For how, see below.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You prefix each menu item with a unique character.  E.g.,&#xA;a, b, c... or 1, 2, 3...  The user hits the char to choose the item.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You bind a few variables around a call to &lt;code&gt;completing-read&lt;/code&gt;.&#xA;You pass it a list of your menu items.  You optionally specify one&#xA;of the items to be the default, chosen if the user just hits &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable bindings tell &lt;code&gt;completing-read&lt;/code&gt; to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Show each menu item on a separate row&lt;/li&gt;&#xA;&lt;li&gt;Show the menu immediately&lt;/li&gt;&#xA;&lt;li&gt;Update it immediately when a user hits a key&lt;/li&gt;&#xA;&lt;li&gt;Return immediately, if the user input matches only one item&lt;/li&gt;&#xA;&lt;li&gt;Show the default choice in the prompt.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can make the menu items as fancy as you want (not shown).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;faces&lt;/li&gt;&#xA;&lt;li&gt;images&lt;/li&gt;&#xA;&lt;li&gt;annotations&lt;/li&gt;&#xA;&lt;li&gt;multiple lines per item&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;mouse-3&lt;/code&gt; popup menu, to do anything with the item&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-menu '((&quot;a: Alpha It&quot;   . alpha-action)&#xA;                  (&quot;b: Beta It&quot;    . beta-action)&#xA;                  (&quot;c: Gamma It&quot;   . gamma-action)&#xA;                  (&quot;d: Delta It&quot;   . delta-action)&#xA;                  (&quot;e: Epsilon It&quot; . epsilon-action)&#xA;                  (&quot;f: Zeta It&quot;    . zeta-action)&#xA;                  (&quot;g: Eta It&quot;     . eta-action)&#xA;                  (&quot;h: Theta It&quot;   . theta-action)&#xA;                  (&quot;i: Iota It&quot;    . iota-action)&#xA;                  (&quot;j: Kappa It&quot;   . kappa-action)&#xA;                  (&quot;k: Lambda It&quot;  . lambda-action)))&#xA;&#xA;(defun my-popup ()&#xA;  &quot;Pop up my menu.&#xA;User can hit just the first char of a menu item to choose it.&#xA;Or s?he can click it with `mouse-1' or `mouse-2' to select it.&#xA;Or s?he can hit RET immediately to select the default item.&quot;&#xA;  (interactive)&#xA;  (let* ((icicle-Completions-max-columns               1)&#xA;         (icicle-show-Completions-initially-flag       t)&#xA;         (icicle-incremental-completion-delay          0.01)&#xA;         (icicle-top-level-when-sole-completion-flag   t)&#xA;         (icicle-top-level-when-sole-completion-delay  0.01)&#xA;         (icicle-default-value                         t)&#xA;         (icicle-show-Completions-help-flag            nil)&#xA;         (choice  (completing-read &quot;Choose: &quot; my-menu nil t nil nil&#xA;                                   &quot;b: Beta It&quot;)) ; The default item.&#xA;         (action  (cdr (assoc choice my-menu))))&#xA;&#xA;    ;; Here, you would invoke the ACTION: (funcall action).&#xA;    ;; This message just shows which ACTION would be invoked.&#xA;    (message &quot;ACTION chosen: %S&quot; action) (sit-for 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also create truly &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multiple-Choice_Menus&quot; rel=&quot;nofollow&quot;&gt;multiple-choice&#xA;menus&lt;/a&gt;,&#xA;that is, menus where a user can choose multiple items at the same&#xA;time (choose a subset of the possible choices).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-27T16:32:03.210" LastActivityDate="2015-07-27T16:32:03.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14278" PostTypeId="1" AcceptedAnswerId="14280" CreationDate="2015-07-27T16:33:29.360" Score="0" ViewCount="396" Body="&lt;p&gt;I would like to do 2 things: first mirror a field and replace spaces with &quot;-&quot;. If nothing is typed in the field, junto to the mirror. The code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; \begin{theorem}[$1]&#xA; \label{thm-${1:$( ???? )}}&#xA; $0&#xA; \end{theorem}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4052" LastEditorUserId="2413" LastEditDate="2015-07-28T04:15:35.947" LastActivityDate="2015-08-04T13:22:25.147" Title="Mirror with character replacement in yasnippet" Tags="|yasnippet|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14280" PostTypeId="2" ParentId="14278" CreationDate="2015-07-27T17:12:27.917" Score="0" Body="&lt;p&gt;I'm not sure I fully understand the question, this will mirror your first field replacing spaces with &lt;code&gt;-&lt;/code&gt; character:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: theorem&#xA;# key: theorem&#xA;# --&#xA;\begin\{theorem\}[$1]&#xA;\label\{thm-${1:$(replace-regexp-in-string &quot;[[:space:]]&quot; &quot;-&quot; yas-text)}\}&#xA;$0&#xA;\end\{theorem\}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;P.S. I would also downcase the whole thing, just because it looks better, but to do this you would need to define auxiliary function in your config or this may get cumbersome.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-07-27T17:12:27.917" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14281" PostTypeId="2" ParentId="14263" CreationDate="2015-07-27T22:08:54.797" Score="13" Body="&lt;p&gt;You can't install a previous version of a package in our current infrastructure.  Even though Emacs’ built-in package manager now supports multiple versions of a package in recent releases, no popular package archive (i.e. MELPA Stable and Marmalade) actually keeps a backlog of previous releases.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs didn't support this for a long time, and now that it does, the demand for this feature seems to be rather low—as it is generally for versioned releases, considering that MELPA Stable is far less popular than MELPA itself.  Notably, none has yet volunteered to work on a backlog of releases for MELPA Stable, and consequently there's little incentive for the maintainers to implement it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll have to download, build and install the package yourself.  &lt;a href=&quot;https://github.com/quelpa/quelpa&quot;&gt;QUELPA&lt;/a&gt; with a custom recipe for Magit will probably help here.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-07-27T22:08:54.797" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14282" PostTypeId="1" AcceptedAnswerId="14283" CreationDate="2015-07-27T23:13:03.087" Score="20" ViewCount="4787" Body="&lt;p&gt;The splash screen is useful in the beginning, but now I want something more useful: I want to have list of recently opened files presented when starting emacs if there is no predefined file to open. Even better, if it can be the &lt;code&gt;helm-recentf&lt;/code&gt; window (I use &lt;code&gt;helm&lt;/code&gt; package)&lt;/p&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="262" LastEditDate="2018-05-17T14:47:13.773" LastActivityDate="2019-06-29T12:58:27.353" Title="replace splash screen with list of recentf" Tags="|start-up|recentf|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="14283" PostTypeId="2" ParentId="14282" CreationDate="2015-07-27T23:19:06.507" Score="11" Body="&lt;p&gt;Manomagically :D, after posting the question I got the working solution by removing one single quote below in my &lt;code&gt;.emacs&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-buffer-choice '(helm-recentf)) ;; Does not work&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-buffer-choice (helm-recentf)) ;; Works!!!&#xA;;; I still haven't tried doing with the built-in recentf only&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-buffer-choice 'helm-recentf) ;; Works!!!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It still doesn't work with the solution above actually. I got the file open but emacs switches to &lt;code&gt;scratch&lt;/code&gt; buffer right afterward. I have to jump to the buffer of the file I want. So still need more help on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some wrestling with &lt;code&gt;elisp&lt;/code&gt;, I got this one really works now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'recentf) ;; Provided for the whole picture&#xA;(require 'helm)&#xA;(require 'helm-config)&#xA;&#xA;(defun startwithrecentf()&#xA; (buffer-name (find-file (car (helm-recentf))))&#xA;  )&#xA;(setq initial-buffer-choice (startwithrecentf)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is more compact. It also roughly handle the case emacs is called with additional arguments, i.e &lt;code&gt;emacs somefile&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'recentf) ;; Provided for the whole picture&#xA;(require 'helm)&#xA;(require 'helm-config)&#xA;(if (&amp;lt; (length command-line-args) 2) &#xA;(setq initial-buffer-choice (car (helm-recentf)))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="18514" LastEditDate="2019-06-29T12:58:27.353" LastActivityDate="2019-06-29T12:58:27.353" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="14284" PostTypeId="2" ParentId="13254" CreationDate="2015-07-28T02:49:28.497" Score="3" Body="&lt;p&gt;kaushalmodi's answer is almost perfect, but it doesn't solve the problem at hand.&#xA;I suggest you to run gtags on each project directory say ~/projects/{a,b}&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~/projects/a &#xA;gtags&#xA;cd ../b&#xA;gtags&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the trick is t use the GTAGSLIBPATH variable as shown in Global &lt;a href=&quot;https://www.gnu.org/software/global/globaldoc_toc.html#ENVIRONMENT-4&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; so you can use global -T &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;global -T &amp;lt;function_symbol&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should see global references to both repositories, if so you can proceed to set this variable in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the GTAGSLIBPATH variable is not enough for ggtags to show the definition in both modules; you need to force the '-T' option in global. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To force the '-T' option you have to set the environment variable GTAGSTHROUGH to any value (such as true) directly in emacs or as part of the environment when you launch it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; You can set this in your .emacs&#xA;(setenv &quot;GTAGSTHROUGH&quot; &quot;true&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you should be able to see the definitions from both projects using ggtags&lt;/p&gt;&#xA;" OwnerUserId="8289" LastActivityDate="2015-07-28T02:49:28.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14285" PostTypeId="1" AcceptedAnswerId="14295" CreationDate="2015-07-28T06:51:36.583" Score="6" ViewCount="451" Body="&lt;p&gt;Is it possible to perform a &lt;code&gt;search/isearch&lt;/code&gt; just in comment regions of the text?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-07-29T02:08:06.750" Title="How to search/isearch just comments?" Tags="|search|isearch|comment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14286" PostTypeId="1" CreationDate="2015-07-28T07:31:21.333" Score="1" ViewCount="207" Body="&lt;p&gt;I have multiple sources in helm like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-sources '(helm-source-buffers-list&#xA;                                  helm-source-recentf&#xA;                                  helm-source-dired-recent-dirs&#xA;                                  helm-source-emacs-commands-history&#xA;                                  helm-source-emacs-commands&#xA;                                  helm-chrome-source&#xA;                                  hgs/helm-c-source-stars&#xA;                                  hgs/helm-c-source-repos&#xA;                                  helm-source-buffer-not-found&#xA;                                  hgs/helm-c-source-search))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I  can goto next source using &lt;code&gt;C-o&lt;/code&gt;. But when I reach to the last source, &lt;code&gt;C-o&lt;/code&gt; doesn't go to first source. I  have to kill helm session and start a new one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make &lt;code&gt;C-o&lt;/code&gt; to cycle through all sources?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-28T07:59:14.783" Title="How to cycle through helm sources?" Tags="|helm|cycling|helm-sources|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14287" PostTypeId="1" AcceptedAnswerId="14304" CreationDate="2015-07-28T07:37:05.723" Score="13" ViewCount="7773" Body="&lt;p&gt;For example, I have the following bunch of characters (HTML): &lt;a href=&quot;http://pastebin.com/pwTPp8wd&quot; rel=&quot;noreferrer&quot;&gt;http://pastebin.com/pwTPp8wd&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought everyone stumbled it upon a processed file, especially when someone would speed up the processing of large HTML/Javascript/whatever file. Then there must be a way to automate the indentation, without applying manual. However, I couldn't find anything about force indentation on a optimized file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-07-29T07:48:44.793" LastActivityDate="2017-09-27T12:49:07.173" Title="How prettify (newlines and indentation) an optimized HTML/JS file?" Tags="|indentation|formatting|html|javascript|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14289" PostTypeId="1" CreationDate="2015-07-28T08:16:26.313" Score="5" ViewCount="391" Body="&lt;p&gt;When composing/sending messages, I would like to automatically upload large attachments to my owncloud server, similar to what the Thunderbird AddOn &lt;a href=&quot;https://addons.mozilla.org/de/thunderbird/addon/owncloud-for-filelink/&quot; rel=&quot;noreferrer&quot;&gt;https://addons.mozilla.org/de/thunderbird/addon/owncloud-for-filelink/&lt;/a&gt; does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware that probably this functionality doesn't exist yet, but is anybody aware of any building blocks I could use in implementing such a package?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2019-12-31T14:00:40.160" Title="Upload large email attachments to owncloud in mu4e" Tags="|mu4e|attachment|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14290" PostTypeId="1" AcceptedAnswerId="17190" CreationDate="2015-07-28T08:30:28.563" Score="7" ViewCount="2521" Body="&lt;p&gt;I can &lt;code&gt;M-x projectile-mode&lt;/code&gt; (I get this and other projectile commands in the completion list) but it fails with&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Autoloading failed to define function projectile-mode&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Projectile is an installed package, according to &lt;code&gt;package-list-packages&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;projectile         20150724.1312 installed&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(And I can use &lt;code&gt;C-h f&lt;/code&gt; to search for the function and to open the &lt;code&gt;projectile.el&lt;/code&gt; file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I add &lt;code&gt;(require 'projectile)&lt;/code&gt; to my &lt;code&gt;init.el&lt;/code&gt;, startup fails with&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;error: Required feature `projectile' was not provided&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.5 on OSX installed via Homebrew, using the Emacs Live (git rev 170bddd, 2015-07-18) setup.&#xA;Here is &lt;a href=&quot;https://github.com/jakubholynet/dotfiles/tree/80e6e1154d0318b353569250f242d9f15ad8b230/.live-packs/jholy-pack&quot; rel=&quot;noreferrer&quot;&gt;my Emacs config&lt;/a&gt; (as an Emacs Live pack).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="9025" LastEditorUserId="9025" LastEditDate="2015-07-28T09:03:28.673" LastActivityDate="2015-10-07T11:42:27.550" Title="Projectile installed but &quot;Autoloading failed to define function projectile-mode&quot;" Tags="|init-file|projectile|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14292" PostTypeId="2" ParentId="12397" CreationDate="2015-07-28T08:58:45.877" Score="3" Body="&lt;p&gt;No, You can't use a remote virtual environment with emacs with elpy as of now.&lt;/p&gt;&#xA;&lt;p&gt;Here is jorgenschaefer the author of elpy) comments on this&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I'm afraid that won't work. Tramp does a lot of magic with Emacs internals to do what it does, but it breaks in interesting ways if you try to tweak it too far. Elpy does that, because it runs so many different processes and needs to communicate with them in various ways.&lt;/p&gt;&#xA;&lt;p&gt;So, sorry, elpy does not work with tramp. I can highly recommend not using tramp but use sshfs instead for remote file editing. Or, even better, edit locally and use fab/git to deploy to your VM.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Check this thread for more details &lt;a href=&quot;https://github.com/jorgenschaefer/pyvenv/issues/26&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jorgenschaefer/pyvenv/issues/26&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-28T08:58:45.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14293" PostTypeId="2" ParentId="14215" CreationDate="2015-07-28T11:30:29.133" Score="7" Body="&lt;p&gt;Hydras are pretty simple to write:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defhydra hydra-launcher (:color blue :columns 2)&#xA;   &amp;quot;Launch&amp;quot;&#xA;   (&amp;quot;h&amp;quot; man &amp;quot;man&amp;quot;)&#xA;   (&amp;quot;r&amp;quot; (browse-url &amp;quot;http://www.reddit.com/r/emacs/&amp;quot;) &amp;quot;reddit&amp;quot;)&#xA;   (&amp;quot;w&amp;quot; (browse-url &amp;quot;http://www.emacswiki.org/&amp;quot;) &amp;quot;emacswiki&amp;quot;)&#xA;   (&amp;quot;s&amp;quot; shell &amp;quot;shell&amp;quot;)&#xA;   (&amp;quot;q&amp;quot; nil &amp;quot;cancel&amp;quot;))&#xA;&#xA;(global-set-key (kbd &amp;quot;C-c r&amp;quot;) 'hydra-launcher/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Hydra is a keyboard-centric interface, and in its basic form, it's not&#xA;harder than &lt;code&gt;easy-menu-define&lt;/code&gt; (built-in).  And it's quite extensible&#xA;if you want to make it do more complex things.&lt;/p&gt;&#xA;&lt;p&gt;Just look at this twittering interface, the bottom window is a custom Hydra, not much harder to write than the one above:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/D9RNO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/D9RNO.png&quot; alt=&quot;hydra-twittering.png&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code for this is available on &lt;a href=&quot;https://github.com/abo-abo/hydra/wiki/Twittering&quot; rel=&quot;nofollow noreferrer&quot;&gt;the wiki&lt;/a&gt;, along with a lot more examples.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="14920" LastEditDate="2021-01-04T00:48:58.220" LastActivityDate="2021-01-04T00:48:58.220" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="14295" PostTypeId="2" ParentId="14285" CreationDate="2015-07-28T13:50:12.847" Score="4" Body="&lt;p&gt;Yes. Use library &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt;, specifically file &lt;a href=&quot;http://www.emacswiki.org/emacs/download/isearch-prop.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it says &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus#isearchp-thing&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can search the text of THINGS of various kind (sexps, lists, defuns, lines, pages, sentences, filenames, strings, &lt;strong&gt;&lt;em&gt;comments&lt;/em&gt;&lt;/strong&gt;, xml/html elements, symbols,…), using command &lt;code&gt;isearchp-thing&lt;/code&gt;. This is equivalent to using command &lt;code&gt;isearchp-thing-define-contexts&lt;/code&gt;, which marks such zones with a text property, and then using &lt;code&gt;isearchp-property-forward&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can hide or show code comments during Isearch, using &lt;code&gt;M-;&lt;/code&gt; (command &lt;code&gt;isearchp-toggle-hiding-comments&lt;/code&gt;). You can toggle ignoring comments during Isearch, using &lt;code&gt;C-M-;&lt;/code&gt; (command &lt;code&gt;isearchp-toggle-ignoring-comments&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And the doc string of command &lt;code&gt;isearchp-thing&lt;/code&gt; says this, which is pertinent for searching comments:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If user option &lt;code&gt;isearchp-ignore-comments-flag&lt;/code&gt; is nil then include&#xA;  THINGs located within comments.  Non-nil (the default value) means to&#xA;  ignore things inside comments for searching.  In particular, this&#xA;  means that &lt;em&gt;for &lt;code&gt;comment&lt;/code&gt; as THING search contexts, be sure to turn off&#xA;  ignoring of comments&lt;/em&gt;.  You can toggle whether comments are ignored&#xA;  using &lt;code&gt;C-M-;&lt;/code&gt; during Isearch, but to see the effect you will need to&#xA;  invoke Isearch again.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE after your comment that you got an infinite loop:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cause of the looping is &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9300&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Emacs bug #9300&lt;/em&gt;&lt;/a&gt;, which still has not been fixed.  I thought it would be fixed by Emacs 24, so I had a test in the code that does the right thing if the Emacs version is 24 or later, and otherwise does the workaround thing. Unfortunately, if you use the bugged vanilla Emacs version of function &lt;code&gt;bounds-of-thing-at-point&lt;/code&gt; then you can have only the workaround, which is less than ideal. Anyway, the latest version of &lt;code&gt;isearch-prop.el&lt;/code&gt; treats all Emacs versions as bugged, giving you the workaround.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right thing to do is, as suggested in the &lt;code&gt;isearch-prop.el&lt;/code&gt; file header, to use library &lt;a href=&quot;http://www.emacswiki.org/emacs/ThingAtPointPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Thing At Point +&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/thingatpt%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;thingatpt+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;). It does not have the bug, and it gives you better thing-at-point behavior all around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Library &lt;code&gt;isearch-prop.el&lt;/code&gt; does not strictly require library &lt;code&gt;thingatpt+.el&lt;/code&gt;, but I highly recommend using both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It took me a while to re-debug this, as I had forgotten about the Emacs bug, and the fact that the code made the assumption that the bug would be fixed by Emacs 24. I don't usually do that kind of thing, but as the bug report points out the needed (and trivial) fix, I figured that it would soon be fixed.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-07-29T02:08:06.750" LastActivityDate="2015-07-29T02:08:06.750" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14296" PostTypeId="2" ParentId="14285" CreationDate="2015-07-28T14:20:13.917" Score="1" Body="&lt;p&gt;Using a library with this feature as @Drew suggested is probably the best way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise -- depending on the comment syntax -- you might be able to use &lt;code&gt;isearch-forward-regex&lt;/code&gt; and search using a regular expression that includes leading comment characters. For example in lisp you could do a regex search for &lt;code&gt;;.*foo&lt;/code&gt; to find lines that include &quot;foo&quot; in a comment. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-07-28T14:20:13.917" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14297" PostTypeId="1" AcceptedAnswerId="14307" CreationDate="2015-07-28T14:21:16.940" Score="20" ViewCount="14524" Body="&lt;p&gt;How do I completely disable all auto-indentation in Emacs?  I need to disable it at least for Fundamental mode, but I'm fine with it being disabled globally for the current session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Please read the rest of this question before declaring it a duplicate.&lt;/em&gt;  All the other answers I've found are for much more targeted disabling of indentation.  I really want to completely disable all auto-indentation for the whole session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;code&gt;electric-layout-mode&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Details&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes I like to compose large Git commit messages with my Windows ASCII text editor.  These messages frequently have bullet lists, code blocks, or other things where the precise formatting in my source document is meaningful.  My codebase is on Linux, and I connect to the box using a text-only SSH client.  When Git enters Emacs for editing the commit message, I want to be able to copy the source commit message to the Windows clipboard then paste it using Windows paste commands.  From the perspective of Emacs, I'm typing what was found in the Windows text file.  Unfortunately, when Emacs sees indented lines, it adds its own auto-indentation, so I get this huge triangle of whitespace along the left edge of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.3.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Workaround&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current workaround is to transfer my Windows text file to a filesystem that's mounted by my Linux host, load the file into Emacs, then use kill and yank to transfer the content.  This is a bit clunky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example block of text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a&#xA;&#xA;  - b&#xA;    c&#xA;    d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is how it appears when I paste that into Emacs-under-ssh via MSWin paste:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a&#xA;&#xA;  - b&#xA;      c&#xA;          d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I press &lt;code&gt;C-h l&lt;/code&gt; after doing the paste, here is what I see.  Note that the newlines are input using &lt;code&gt;C-j&lt;/code&gt;, not &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a C-j C-j SPC SPC - SPC b C-j SPC SPC SPC SPC c C-j&#xA;SPC SPC SPC SPC d C-j C-h l&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8464" LastEditorUserId="8464" LastEditDate="2016-10-11T18:23:32.223" LastActivityDate="2016-10-11T20:10:40.657" Title="Completely disable all auto-indentation" Tags="|indentation|clipboard|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14298" PostTypeId="1" CreationDate="2015-07-28T14:24:04.610" Score="1" ViewCount="591" Body="&lt;p&gt;I am installing emacs from source on Ubuntu machine. &lt;code&gt;make install&lt;/code&gt; successfully installed it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when I start emacs it is showing this warning&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning: Cannot convert string &quot;-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*&quot; to type FontStruct&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and emacs fonts looks like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Y4tum.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Y4tum.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is not as good as previous fonts&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jxvMo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jxvMo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to fix this?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2023-06-16T22:14:09.927" LastActivityDate="2023-06-16T22:14:09.927" Title="Installation Warning: Cannot convert string" Tags="|install|build|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14299" PostTypeId="2" ParentId="9720" CreationDate="2015-07-28T15:00:06.087" Score="4" Body="&lt;p&gt;I followed this guide:&#xA;&lt;a href=&quot;https://oleksandrmanzyuk.wordpress.com/2011/10/23/a-persistent-command-history-in-emacs/&quot; rel=&quot;nofollow&quot;&gt;https://oleksandrmanzyuk.wordpress.com/2011/10/23/a-persistent-command-history-in-emacs/&lt;/a&gt;&#xA;and also took hint of a comment in the similar SO-question you mentioned (which advised using the LOCAL argument of add-hook, but see note below!). So this seems to work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comint-write-history-on-exit (process event)&#xA;  &quot;Write comint history of PROCESS when EVENT happened to a file specified in buffer local var 'comint-input-ring-file-name' (defined in turn-on-comint-history).&quot;&#xA;  (comint-write-input-ring)&#xA;  (let ((buf (process-buffer process)))&#xA;    (when (buffer-live-p buf)&#xA;      (with-current-buffer buf&#xA;        (insert (format &quot;\nProcess %s %s&quot; process event))))))&#xA;&#xA;(defun turn-on-comint-history ()&#xA;  &quot;Setup comint history.&#xA;&#xA;When comint process started set buffer local var&#xA;'comint-input-ring-file-name', so that a file name is specified to write&#xA;and read from comint history.&#xA;&#xA;That 'comint-input-ring-file-name' is buffer local is determined by the&#xA;4th argument to 'add-hook' below.  And localness is important, because&#xA;otherwise 'comint-write-input-ring' will find mentioned var nil.&quot;&#xA;&#xA;  (let ((process (get-buffer-process (current-buffer))))&#xA;    (when process&#xA;      (setq comint-input-ring-file-name&#xA;            (format &quot;~/.emacs.d/inferior-%s-history&quot;&#xA;                    (process-name process)))&#xA;      (comint-read-input-ring)&#xA;      (set-process-sentinel process&#xA;                            #'comint-write-history-on-exit))))&#xA;&#xA;(add-hook 'inf-gf-mode-hook 'turn-on-comint-history nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The history will be saved calling 'comint-send-eof' (usually C-c C-d). (Using 'kill-this-buffer' will not save the history.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE regarding localness: I'm not really sure what happened today, but I had to run add-hook without LOCAL argument to get it working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'inf-gf-mode-hook 'turn-on-comint-history nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9031" LastEditorUserId="9031" LastEditDate="2015-07-29T07:36:04.623" LastActivityDate="2015-07-29T07:36:04.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14300" PostTypeId="2" ParentId="13336" CreationDate="2015-07-28T15:45:34.203" Score="5" Body="&lt;p&gt;Old question, but I may as well explain why &lt;code&gt;cdr&lt;/code&gt; acts the way it does in case someone Googles the question later...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cdr&lt;/code&gt; acts this way because lists in Lisps like Elisp are not quite lists like how you would imagine them, they are actually made up of things called &lt;a href=&quot;https://en.wikipedia.org/wiki/Cons&quot; rel=&quot;nofollow&quot;&gt;cons cells&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, when you make a list, it isn't a simple collection of items, one after another--it's actually just a chain of tiny lists, each only capable of holding two values. These pairs are the &quot;cons cells&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In each pair, the first value holds the value of the list at that point, and the second holds either &quot;&lt;code&gt;nil&lt;/code&gt;&quot; (End of the list), or a reference to another cons cell (The next item in the list).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (list 1)&#xA;(1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is the same as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (cons 1 nil)&#xA;(1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (list 1 4)&#xA;(1 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is the same as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (cons 1 (cons 4 nil))&#xA;(1 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and so forth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, what &lt;a href=&quot;https://en.wikipedia.org/wiki/CAR_and_CDR&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt;&lt;/a&gt; do is take the first and second values of these cons cells.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, looking at your list when expanded to cons cells (That's &lt;code&gt;(cons 1 (cons 4 nil))&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (car (cons 1 (cons 4 nil)))&#xA;1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because the first value of the outer &lt;code&gt;cons&lt;/code&gt; is &quot;&lt;code&gt;1&lt;/code&gt;&quot;, and:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (cdr (cons 1 (cons 4 nil)))&#xA;(4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because the second value of the outer &lt;code&gt;cons&lt;/code&gt; is &quot;&lt;code&gt;(cons 4 nil)&lt;/code&gt;&quot; and:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (cons 4 nil)&#xA;(4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is possible for a &lt;code&gt;cdr&lt;/code&gt; to hold something other than &lt;code&gt;nil&lt;/code&gt; or a reference to another cons cell, but these are not the same type of list, but rather a &quot;dotted pair&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (cons 1 4)&#xA;(1 . 4)&#xA;ELISP&amp;gt; (car (cons 1 4))&#xA;1&#xA;ELISP&amp;gt; (cdr (cons 1 4))&#xA;4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hopefully this clears some things up..!&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2015-07-28T20:07:48.673" LastActivityDate="2015-07-28T20:07:48.673" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14301" PostTypeId="1" AcceptedAnswerId="14302" CreationDate="2015-07-28T16:49:15.933" Score="2" ViewCount="350" Body="&lt;p&gt;I use org UTF8 character substitution all the time, for example to go from &lt;code&gt;\beta&lt;/code&gt; to &lt;code&gt;β&lt;/code&gt; (enabled with the &lt;code&gt;org-pretty-entities&lt;/code&gt; variable). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However some standard symbols are missing and I'd like to add them manually. For example, I'd like to map &lt;code&gt;\|&lt;/code&gt; to &lt;code&gt;‖&lt;/code&gt;. How can I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;http://orgmode.org/worg/org-symbols.html&quot; rel=&quot;nofollow&quot;&gt;Org Symbols Table&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2015-07-28T17:10:15.770" Title="How can I extend org symbols table?" Tags="|org-mode|utf-8|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14302" PostTypeId="2" ParentId="14301" CreationDate="2015-07-28T17:10:15.770" Score="1" Body="&lt;p&gt;&lt;code&gt;M-x customize-group RET org-entities&lt;/code&gt;, then fill the form under &lt;code&gt;Org Entities User&lt;/code&gt;. The &lt;code&gt;name&lt;/code&gt; field is the one which will enable the transformation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set &lt;code&gt;name: Norm&lt;/code&gt; so that &lt;code&gt;\Norm&lt;/code&gt; transforms to &lt;code&gt;‖&lt;/code&gt;. I couldn't get it to work for &lt;code&gt;\|&lt;/code&gt; however. &lt;/p&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2015-07-28T17:10:15.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14304" PostTypeId="2" ParentId="14287" CreationDate="2015-07-28T18:46:04.853" Score="23" Body="&lt;p&gt;You can use the built-in &lt;code&gt;sgml-mode&lt;/code&gt; for this.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x sgml-mode&lt;/code&gt; - Enable the &lt;code&gt;sgml-mode&lt;/code&gt; major mode so that &lt;code&gt;sgml-pretty-print&lt;/code&gt; command auto-loads.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x h&lt;/code&gt; - Select the whole buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x sgml-pretty-print&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To save space, below is only a part of the formatted text that I get on doing the above on your sample text in the question:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;table border=&quot;4px&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;c31 c42&quot;&amp;gt;&#xA;  &amp;lt;tbody&amp;gt;&#xA;    &amp;lt;tr class=&quot;c4&quot;&amp;gt;&#xA;      &amp;lt;td class=&quot;c33&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&amp;gt;&#xA;        &amp;lt;p class=&quot;c6&quot;&amp;gt;&#xA;          &amp;lt;span class=&quot;c12 c11&quot;&amp;gt;Veld&#xA;          &amp;lt;/span&amp;gt;&#xA;        &amp;lt;/p&amp;gt;&#xA;      &amp;lt;/td&amp;gt;&#xA;      &amp;lt;td class=&quot;c35&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&amp;gt;&#xA;        &amp;lt;p class=&quot;c7&quot;&amp;gt;&#xA;          &amp;lt;span class=&quot;c12 c11&quot;&amp;gt;Waarde(n)&#xA;          &amp;lt;/span&amp;gt;&#xA;        &amp;lt;/p&amp;gt;&#xA;      &amp;lt;/td&amp;gt;&#xA;      &amp;lt;td class=&quot;c26&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&amp;gt;&#xA;        &amp;lt;p class=&quot;c19&quot;&amp;gt;&#xA;          &amp;lt;span class=&quot;c12 c11&quot;&amp;gt;Null&#xA;          &amp;lt;/span&amp;gt;&#xA;        &amp;lt;/p&amp;gt;&#xA;      &amp;lt;/td&amp;gt;&#xA;      &amp;lt;td class=&quot;c18&quot; colspan=&quot;1&quot; rowspan=&quot;1&quot;&amp;gt;&#xA;        &amp;lt;p class=&quot;c6 c38&quot;&amp;gt;&#xA;          &amp;lt;span class=&quot;c12 c11&quot;&amp;gt;Validatie&#xA;          &amp;lt;/span&amp;gt;&#xA;        &amp;lt;/p&amp;gt;&#xA;      &amp;lt;/td&amp;gt;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/q/137043/1219634&quot;&gt;[&lt;strong&gt;Source&lt;/strong&gt;]&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-07-28T18:46:04.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14306" PostTypeId="1" CreationDate="2015-07-28T20:40:45.210" Score="5" ViewCount="1548" Body="&lt;p&gt;Say I have a list of names with ids, in JSON:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((json-object-type 'plist))&#xA;  (setq mylist (json-read-from-string &quot;[{\&quot;name\&quot;: \&quot;Adam\&quot;, \&quot;id\&quot;: \&quot;1\&quot;},&#xA;                                        {\&quot;name\&quot;: \&quot;Eve\&quot;, \&quot;id\&quot;: \&quot;2\&quot;}]&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to find out Adam's id.  How do I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently trying&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (person  mylist)&#xA;  (when (equal &quot;Adam&quot; (plist-get person :name))&#xA;    (setq person_id (plist-get person :id)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this raises &lt;em&gt;setq: Wrong type argument: listp, [(:id &quot;1&quot; :name &quot;Adam&quot;) (:id &quot;2&quot; :name &quot;Eve&quot;)]&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2016-01-24T22:42:25.600" Title="How to iterate over JSON list and select one element" Tags="|json|list|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14307" PostTypeId="2" ParentId="14297" CreationDate="2015-07-28T21:21:18.803" Score="24" Body="&lt;h2&gt;Emacs ≤24.3&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Pressing RET doesn't indent by default (except in some programming modes, for which you need to check mode-specific configuration, e.g. “electric” settings). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unix terminals normally paste a carriage return character when the clipboard contents contains a newline (represented by the line feed character). In Emacs, a carriage return looks like the &lt;code&gt;RET&lt;/code&gt; key (in fact, &lt;code&gt;RET&lt;/code&gt; &lt;em&gt;is&lt;/em&gt; the carriage return character), while a line feed looks like (is) &lt;code&gt;C-j&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in your case, pasting a newline results in a &lt;code&gt;C-j&lt;/code&gt;, which in Emacs is bound to the command &lt;code&gt;newline-and-indent&lt;/code&gt;. As the name indicates, this command indents. I don't know if PuTTY has a setting you can change. If you want to fix the problem on the Emacs end, there's an easy workaround which I think you won't mind: bind &lt;code&gt;C-j&lt;/code&gt; to &lt;code&gt;newline&lt;/code&gt; (same as &lt;code&gt;RET&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-j&quot; 'newline)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Emacs ≥24.4&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In Emacs 24.4, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indent-Convenience.html#index-Electric-Indent-mode&quot;&gt;Electric Indent mode&lt;/a&gt; is switched on by default. It's a global minor mode, so you can turn it off everywhere by calling &lt;code&gt;(electric-indent-mode 0)&lt;/code&gt; and you can toggle it interactively with &lt;code&gt;M-x electric-indent-mode RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find this information in the manual, or by looking at the documentation of the command invoked by pressing &lt;kbd&gt;Return&lt;/kbd&gt; (press &lt;code&gt;C-h k RET&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can turn it on in a specific buffer with &lt;code&gt;electric-indent-local-mode&lt;/code&gt;. Some programming modes (especially third-party ones) may have their own automatic indentation features that don't follow the settings of Electric Indent mode.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-07-29T14:18:36.150" LastActivityDate="2015-07-29T14:18:36.150" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14308" PostTypeId="2" ParentId="14306" CreationDate="2015-07-28T21:27:17.607" Score="0" Body="&lt;p&gt;Working with vectors is a tad bothersome as only the most basic operations have been implemented.  Here's a handcoded loop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((json-object-type 'plist)&#xA;       (vector (json-read-from-string &quot;[{\&quot;name\&quot;: \&quot;Adam\&quot;, \&quot;id\&quot;: \&quot;1\&quot;},&#xA;                                        {\&quot;name\&quot;: \&quot;Eve\&quot;, \&quot;id\&quot;: \&quot;2\&quot;}]&quot;))&#xA;       (i 0)&#xA;       value)&#xA;  (while (and (&amp;lt; i (length vector)) (not value))&#xA;    (let ((person (aref vector i)))&#xA;      (when (string= (plist-get person :name) &quot;Adam&quot;)&#xA;        (setq value (plist-get person :id))))&#xA;    (setq i (1+ i)))&#xA;  value)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-28T21:27:17.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14309" PostTypeId="1" AcceptedAnswerId="14315" CreationDate="2015-07-28T23:14:53.590" Score="7" ViewCount="2833" Body="&lt;p&gt;For any jump to a new buffer(for example from the ack buffer or godef-jump) point is left at the very bottom of the window. Is there a global configuration to &lt;strong&gt;automatically&lt;/strong&gt; center &lt;em&gt;occur&lt;/em&gt; and similar buffers without wrapping every conceivable function that jumps point very far away?&lt;/p&gt;&#xA;" OwnerUserId="99" LastEditorUserId="315" LastEditDate="2022-06-14T15:57:28.593" LastActivityDate="2022-06-14T15:57:28.593" Title="Is there a setting to automatically center the text after any jump?" Tags="|navigation|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="14310" PostTypeId="1" AcceptedAnswerId="14313" CreationDate="2015-07-29T00:23:58.080" Score="3" ViewCount="2432" Body="&lt;p&gt;The following function searches buffer text for string &lt;code&gt;STR&lt;/code&gt;, in the same way as &lt;code&gt;search-forward&lt;/code&gt;. How to modify it in order that it selects the text found?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-search-forward (str)&#xA;  (interactive &quot;smy-search-forward: &quot;)&#xA;  (re-search-forward str nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-08-10T02:02:46.643" LastActivityDate="2015-08-10T22:37:32.473" Title="How to select text found by `re-search-forward`?" Tags="|elisp|search|region|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14311" PostTypeId="2" ParentId="7761" CreationDate="2015-07-29T00:43:17.007" Score="3" Body="&lt;p&gt;The answer below tells you how to use Command as a second, redundant Meta key, which is pointless. As far as I know, it's not possible to use Command as a distinct modifier key in Terminal/iTerm---say, by mapping Command it to the Hyper key, for instance---the way you can with GUI Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-07-29T00:43:17.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14312" PostTypeId="1" AcceptedAnswerId="14694" CreationDate="2015-07-29T01:52:08.267" Score="2" ViewCount="501" Body="&lt;p&gt;Alright I apologize if this has been asked, but I cannot seem to find this problem through searching. I am trying to figure out how to work on code in Emacs and when I come back open it again to edit the code. I was working with Emacs in the REPL learning Common Lisp and I used the &quot;save as&quot; feature and saved my work. I come to it this morning and try to open it to finish up on it and when I load the file it opens either as read only or it &quot;kills&quot; the REPL and doesn't let me use the functions that I coded originally. When the file is loaded I can't compile it to use in the REPL and it seems to not want to work in the REPL when I try to copy.. I am new to Emacs and I am needing some help figuring out what I did wrong so I don't do this again. Til now I have only coded a few lines and just been starting from scratch and copying what is loaded in the file and completing my exercises, but that limits productivity. I am spending more time trying to figure out how to use Emacs than I am learning Common Lisp. I am not sure what I did wrong, but if there are any Emacs gurus out there that could help me out I would greatly appreciate it! Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="9035" LastActivityDate="2015-09-11T19:49:24.640" Title="How do I edit code in REPL after saving it in Emacs?" Tags="|emacs24.4|emacs-lisp-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14313" PostTypeId="2" ParentId="14310" CreationDate="2015-07-29T01:52:42.583" Score="9" Body="&lt;p&gt;One way to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-search-forward (str)&#xA;  (interactive &quot;smy-search-forward: &quot;)&#xA;  (when (re-search-forward str nil t)&#xA;    (setf&#xA;     (point) (match-beginning 0)&#xA;     (mark) (match-end 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="621" LastEditDate="2015-08-10T22:37:32.473" LastActivityDate="2015-08-10T22:37:32.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14314" PostTypeId="2" ParentId="14310" CreationDate="2015-07-29T02:20:49.913" Score="2" Body="&lt;p&gt;@PythonNut provided a good answer. Another answer is that if you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; (e.g., for other, more important reasons) then you have a user option and commands that let you select the last target occurrence (set the region around it):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Option &lt;code&gt;isearchp-set-region-flag&lt;/code&gt; -– Non-&lt;code&gt;nil&lt;/code&gt; means automatically set the region around the last search target.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Command &lt;code&gt;isearchp-toggle-set-region&lt;/code&gt;, bound to &lt;code&gt;C-SPC&lt;/code&gt; during Isearch -– toggle &lt;code&gt;isearchp-set-region-flag&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Command &lt;code&gt;set-region-around-search-target&lt;/code&gt; -– manually set the region around the last search target.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So if you set the option to non-&lt;code&gt;nil&lt;/code&gt; then Isearch selects the last search hit automatically, by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether the option is &lt;code&gt;nil&lt;/code&gt; or non-&lt;code&gt;nil&lt;/code&gt;, you can cause Isearch to select that search hit by using &lt;code&gt;C-SPC&lt;/code&gt; before exiting Isearch, if needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you do not, in one of these ways, cause Isearch to automatically select the last search hit, you can nevertheless select it after exiting Isearch, by using command &lt;code&gt;set-region-around-search-target&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-29T02:20:49.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14315" PostTypeId="2" ParentId="14309" CreationDate="2015-07-29T02:22:17.217" Score="10" Body="&lt;p&gt;Use &lt;code&gt;C-l&lt;/code&gt; or the command (function) bound to it, &lt;code&gt;recenter-top-bottom&lt;/code&gt;.  Hit it repeatedly up to 3 times, to cycle among different vertical positions for the cursor. See the full doc for the command for more possibilities:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;C-l&lt;/code&gt; runs the command &lt;code&gt;recenter-top-bottom&lt;/code&gt; (found in &lt;code&gt;global-map&lt;/code&gt;), which&#xA;is an interactive compiled Lisp function in &lt;code&gt;window.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;It is bound to &lt;code&gt;C-l&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;(recenter-top-bottom &amp;amp;optional ARG)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Move current buffer line to the specified window line.&#xA;With no prefix argument, successive calls place point according&#xA;to the cycling order defined by &lt;code&gt;recenter-positions&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A prefix argument is handled like &lt;code&gt;recenter&lt;/code&gt;:&#xA;With numeric prefix &lt;code&gt;ARG&lt;/code&gt;, move current line to window-line &lt;code&gt;ARG&lt;/code&gt;.&#xA;&lt;strong&gt;With plain &lt;code&gt;C-u&lt;/code&gt;, move current line to window center.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2022-06-06T00:49:29.270" LastActivityDate="2022-06-06T00:49:29.270" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="14316" PostTypeId="1" AcceptedAnswerId="14332" CreationDate="2015-07-29T03:53:25.537" Score="2" ViewCount="606" Body="&lt;p&gt;In my Org Agenda all text except for priorities use the &quot;default&quot; face. Until recently I would see colourful text for say, todo status. I was playing around with custom themes, so I may have broken something. However I can't seem to undo this change, even after reverting all changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make the Org Agenda use the correct faces instead of just using &quot;default&quot;?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-07-29T15:31:24.633" Title="Org Agenda faces do not appear after applying themes" Tags="|org-mode|faces|themes|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14317" PostTypeId="2" ParentId="14309" CreationDate="2015-07-29T04:22:24.677" Score="5" Body="&lt;p&gt;There are two commands that can help out here. One is mentioned by Drew in a previous answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;recenter-top-bottom&lt;/code&gt;, which is bound to &lt;code&gt;C-l&lt;/code&gt; by default, keeps point at the same position in the text file, but scrolls the window with the text file to move that position to the center, top and then bottom of the file. This is often useful when point is near the bottom of a file, but want to see context around point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there's another function that is relevant here. &lt;code&gt;M-r&lt;/code&gt;, or &lt;code&gt;move-to-window-line-top-bottom&lt;/code&gt;, holds the text in the buffer where it is, but moves point to the middle, top, and bottom of the visible area. This is useful when you want to &lt;em&gt;move&lt;/em&gt; point somewhere else in the visible area.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-07-29T04:22:24.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14318" PostTypeId="1" CreationDate="2015-07-29T07:08:48.757" Score="4" ViewCount="199" Body="&lt;p&gt;Is there an easy way to search for other occurences of a selected rectangle, regardless of the column at which the pattern starts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, when searching for the 4x2 text block in lines 1+2 in the sample below, it would result in two matches: one for lines 4+5, one for lines 7+8&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 qwer&#xA;2 asdf&#xA;3&#xA;4   qwer&#xA;5   asdf&#xA;6&#xA;7     qwer&#xA;8     asdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3951" LastActivityDate="2015-08-29T04:45:37.407" Title="Find rectangular selection" Tags="|search|rectangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14319" PostTypeId="1" AcceptedAnswerId="14324" CreationDate="2015-07-29T09:20:03.703" Score="5" ViewCount="621" Body="&lt;p&gt;My .emacs file contains multiple file names as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/.emacs.d/others/keymaps.el&quot;)&#xA;(load &quot;~/.emacs.d/others/py.el&quot;)&#xA;(load &quot;~/.emacs.d/others/web.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way any library, gives way for me to keep the cursor in the middle of file path and jump straight to the file content on pressing a shortcut.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(load &quot;~/.emacs.d/others&lt;/code&gt;!!(cursor here)&lt;code&gt;/py.el&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the line cursor is in the middle of a file path, it must switch buffer to &lt;code&gt;~/.emacs.d/others/py.el&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2016-11-12T03:12:55.673" LastActivityDate="2016-11-12T03:12:55.673" Title="Switch buffer to the file path in current cursor position" Tags="|files|find-file|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14320" PostTypeId="1" CreationDate="2015-07-29T10:11:38.230" Score="4" ViewCount="2545" Body="&lt;p&gt;I am generating a slideshow using org-reveal, and have links to other web-pages.  During the presentaion (conducted from the browser), I would like clicking on these links to result in opening the link in a new browser tab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the docu, but couldn't find anything.  Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="8576" LastEditDate="2015-07-29T10:28:48.593" LastActivityDate="2019-04-11T13:22:59.510" Title="org mode links: open in new tab" Tags="|org-mode|org-export|" AnswerCount="4" CommentCount="5" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14321" PostTypeId="2" ParentId="14318" CreationDate="2015-07-29T10:21:43.680" Score="1" Body="&lt;p&gt;I didn't find any easy way to do what you want, but make a &lt;code&gt;my-rectangle-forward-search&lt;/code&gt; command myself, I am not sure what can I do when find a matching rectangle, so I just use &lt;code&gt;message-box&lt;/code&gt; to indicate start/end poing and content of the found rectangle.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'subr-x)                       ; Require Emacs 24.4+&#xA;&#xA;(defun my-rectangle-equal (start1 end1 start2 end2)&#xA;  &quot;Return t if two rectangle have identical contents.&quot;&#xA;  (when-let ((r1-lines (extract-rectangle start1 end1))&#xA;             (r2-lines (extract-rectangle start2 end2))&#xA;             (r1-line-number (length r1-lines) )&#xA;             (r2-line-number (length r2-lines) ))&#xA;    (when (and (= r1-line-number r2-line-number)&#xA;               (&amp;gt; r1-line-number 0))&#xA;      (setq counter 0)&#xA;      (catch 'my--break&#xA;        (while (&amp;lt; counter r1-line-number)&#xA;          (unless (string-equal (elt r1-lines counter)&#xA;                                (elt r2-lines counter))&#xA;            (throw 'my--break nil))&#xA;          (setq counter (1+ counter)))&#xA;        t))))&#xA;&#xA;(defun my-rectangle-dialog (start end)&#xA;  (interactive &quot;r&quot;)&#xA;  (message-box (format&#xA;                &quot;The content in [%d, %d] rectangle is: \n%s&quot;&#xA;                start end&#xA;                (mapconcat #'identity (extract-rectangle start end) &quot;\n&quot;))))&#xA;&#xA;(defun my-rectangle-forward-search (start end)&#xA;  &quot;Search forward from point for the region-rectangle.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (when-let ((lines (extract-rectangle start end))&#xA;             (line-number (length lines))&#xA;             (first-line (car lines)))&#xA;    (save-excursion&#xA;      (deactivate-mark)     &#xA;      (let (-start -end)&#xA;        ;; (goto-char end)&#xA;        (while (re-search-forward first-line nil 'noerror)&#xA;          (setq -start (- (point) (length first-line)))&#xA;          (line-move-visual (1- line-number))&#xA;          (setq -end (point))&#xA;          ;; Do something on rectangle just find&#xA;          (my-rectangle-dialog -start -end))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-07-30T04:00:42.837" LastActivityDate="2015-07-30T04:00:42.837" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14322" PostTypeId="1" AcceptedAnswerId="14335" CreationDate="2015-07-29T11:29:20.723" Score="2" ViewCount="2067" Body="&lt;p&gt;I am trying to remap &lt;code&gt;C-c&lt;/code&gt;, &lt;code&gt;C-x&lt;/code&gt;, &lt;code&gt;C-v&lt;/code&gt; (windows editing shortcuts for copy, cut, paste) using these 3 lines of elisp code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c&quot;) 'kill-ring-save)&#xA;(global-set-key (kbd &quot;C-x&quot;) 'kill-region)&#xA;(global-set-key (kbd &quot;C-v&quot;) 'yank)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;kill-region&lt;/code&gt; and &lt;code&gt;yank&lt;/code&gt; works well whereas the &lt;code&gt;C-c&lt;/code&gt; binding does not.&#xA;Can &lt;code&gt;C-c&lt;/code&gt; be rebound? I prefer to set the keybindings myself instead of using &lt;code&gt;cua-mode&lt;/code&gt; so that i can have finer control over it.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="253" LastEditDate="2015-07-29T16:41:43.730" LastActivityDate="2015-07-29T16:41:43.730" Title="Ctrl-C keybinding is having no effect" Tags="|key-bindings|cua-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14323" PostTypeId="2" ParentId="14322" CreationDate="2015-07-29T11:41:36.537" Score="2" Body="&lt;p&gt;If you want more traditional key bindings better activate &lt;code&gt;cua-mode&lt;/code&gt;. If you want to remap them manually, you will eventually get more problems than benefits, because key bindings like &lt;kbd&gt;C-c&lt;/kbd&gt; are in fact prefixes for a lot of other key bindings, and not only built-in ones. So, if you remap these, you will need to &lt;em&gt;remap a lot of stuff&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an advice, don't do it. Learn Emacs way, or use Vi emulation (I'm not familiar with it, but I guess it's the only widely-used alternative). I myself don't use most standard key-bindings and I don't use vi-emulation either. You could end up with situation like this, but first ask yourself if you really want it and why.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-07-29T11:48:08.717" LastActivityDate="2015-07-29T11:48:08.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14324" PostTypeId="2" ParentId="14319" CreationDate="2015-07-29T12:08:06.597" Score="3" Body="&#xA;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun visit-file-at-point ()&#xA;  &quot;Visit file at point if it exists.&quot;&#xA;  (interactive)&#xA;  (let ((file (ffap-guess-file-name-at-point)))&#xA;    (when file&#xA;      (find-file file))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't mind one additional key-stoke, you can use built-in&#xA;&lt;code&gt;find-file-at-point&lt;/code&gt; command too.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="115" LastEditDate="2015-07-29T13:13:15.020" LastActivityDate="2015-07-29T13:13:15.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14325" PostTypeId="1" AcceptedAnswerId="14326" CreationDate="2015-07-29T12:32:50.570" Score="4" ViewCount="855" Body="&lt;p&gt;I'd like to use the same custom keybindings when I'm using Windows and a Mac.  In particular, I'd like to use the modifier key that is closest to the space bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have set up Emacs on a Mac, and many of my bindings are set to &lt;code&gt;cmd-1&lt;/code&gt; (&lt;code&gt;s-1&lt;/code&gt;) because it's closest to the space bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Windows, the closest key to the space bar is &lt;code&gt;alt&lt;/code&gt; (&lt;code&gt;M-1&lt;/code&gt;), so all my bindings are mapped to the &lt;code&gt;windows&lt;/code&gt; key, which is harder to press.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I set up my bindings so that the key closest to the spacebar is the one Emacs uses across the two systems?&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="253" LastEditDate="2015-07-29T12:51:21.750" LastActivityDate="2015-07-29T12:51:21.750" Title="How do I use the same keybindings on Windows and Mac?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14326" PostTypeId="2" ParentId="14325" CreationDate="2015-07-29T12:45:29.047" Score="2" Body="&lt;p&gt;I'm not sure I completely follow what you're trying to do.  However, I take it to mean that you'd like the keys at analogous physical positions on a keyboard work the same (in a &quot;DWIM&quot; sense) when you're on your PC and your Mac.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think Emacs enables you to choose how to interpret the different modifier keys on a Windows system (someone correct me if I'm wrong), but the Mac version of Emacs has the nifty ability to interpret your &lt;kbd&gt;command&lt;/kbd&gt;, &lt;kbd&gt;control&lt;/kbd&gt;, and &lt;kbd&gt;option&lt;/kbd&gt; keys as you like (see the bottom tip on &lt;a href=&quot;http://emacsformacosx.com/tips&quot; rel=&quot;nofollow&quot;&gt;emacsforosx&lt;/a&gt; for more information).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, one option would be to bind your keys to the Windows key (which I believe is interpreted as &lt;kbd&gt;super&lt;/kbd&gt;?) as you've done on your Windows machine, and then tell Emacs to interpret the &lt;kbd&gt;command&lt;/kbd&gt; key as &lt;kbd&gt;super&lt;/kbd&gt; on your Mac:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (eq system-type 'darwin)&#xA;  (setq ns-command-modifier 'super&#xA;        ns-option-modifier  'meta))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This example also tells Emacs to use your &lt;kbd&gt;option&lt;/kbd&gt; key as the &lt;kbd&gt;meta&lt;/kbd&gt; key, as you'd be crippled without it.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-29T12:45:29.047" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14327" PostTypeId="2" ParentId="14319" CreationDate="2015-07-29T13:12:43.733" Score="6" Body="&lt;h2&gt;For &lt;code&gt;ido&lt;/code&gt; users&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add the below to your config and then &lt;code&gt;C-x C-f&lt;/code&gt; (which should be executing &lt;code&gt;ido-find-file&lt;/code&gt; automatically with &lt;code&gt;ido-mode&lt;/code&gt; enabled) on such file paths will open those files directly.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ido-use-filename-at-point 'guess)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;For &lt;code&gt;ivy&lt;/code&gt;/&lt;a href=&quot;https://github.com/abo-abo/swiper/blob/master/counsel.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;counsel&lt;/code&gt;&lt;/a&gt; users&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add the below to your config and then &lt;code&gt;M-x counsel-find-file&lt;/code&gt; (which you can conveniently bind to &lt;code&gt;C-x C-f&lt;/code&gt;)  on such file paths will open those files directly.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq counsel-find-file-at-point t)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-29T13:23:44.843" LastActivityDate="2015-07-29T13:23:44.843" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14328" PostTypeId="1" CreationDate="2015-07-29T13:19:10.143" Score="5" ViewCount="163" Body="&lt;p&gt;When exporting the documentation (HTML or PDF) for a literate program that uses noweb references in blocks, how can I get the output to actually hyperlink the &lt;code&gt;&amp;lt;&amp;lt;noweb_snippet_name&amp;gt;&amp;gt;&lt;/code&gt; line (in the parent source code block) to the block named “&lt;code&gt;noweb_snippet_name&lt;/code&gt;”?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, better yet, how can I make that noweb reference link to an arbitrary part of the exported document?  The child block might not be exported, so I would want the reference to link to the discussion of the snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC klingon-lisp :noweb tangle :exports code&#xA;...&#xA;&amp;lt;&amp;lt;declare_variables&amp;gt;&amp;gt;&#xA;&amp;lt;&amp;lt;conquer_worlds&amp;gt;&amp;gt;&#xA;&amp;lt;&amp;lt;declare_victory&amp;gt;&amp;gt;&#xA;...&#xA;#+END_SRC&#xA;&#xA;...&#xA;... /much later in the org file/&#xA;* Global variables&#xA;Blah blah discussion of variables, blah blah...&#xA;| Variable name | Description |&#xA;&#xA;#+NAME: declare_variables&#xA;#+BEGIN_SRC klingon-lisp :exports none&#xA;(defvar yuQ nil&#xA;  &quot;yuQmey chargh tetlh.&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, the main program source block is exported, to document the structure of the program.  The subsidiary block &lt;code&gt;declare_variables&lt;/code&gt; does not need to be included in the export, since the text describes the variables and lists them in a table.  Ideally, &lt;code&gt;&amp;lt;&amp;lt;declare_variables&amp;gt;&amp;gt;&lt;/code&gt; in the exported main program block would link to the &lt;code&gt;* Global variables&lt;/code&gt; header.  But I could live with it linking to the &lt;code&gt;declare_variables&lt;/code&gt; source block, and having to export that as well.&lt;/p&gt;&#xA;" OwnerUserId="321" LastEditorUserId="321" LastEditDate="2015-07-29T19:05:10.380" LastActivityDate="2015-07-29T19:05:10.380" Title="How to link from parent source block to child block (included via &lt;&lt;noweb&gt;&gt;)?" Tags="|org-mode|org-export|literate-programming|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14329" PostTypeId="2" ParentId="14319" CreationDate="2015-07-29T13:30:12.627" Score="1" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then &lt;strong&gt;&lt;code&gt;M-.&lt;/code&gt;&lt;/strong&gt; &lt;em&gt;always&lt;/em&gt; &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Inserting_Text_from_Cursor&quot; rel=&quot;nofollow&quot;&gt;yanks the thing at point&lt;/a&gt; into the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just one use case of that, where you yank the file name at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One key to remember (or not -- &lt;code&gt;M-?&lt;/code&gt; provides help).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-07-29T13:30:12.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14330" PostTypeId="2" ParentId="14312" CreationDate="2015-07-29T14:04:42.383" Score="1" Body="&lt;p&gt;There are two other methods of interacting with Common Lisp, besides SLIME. Although they both use SLIME as a back end.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Org mode&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To make org-babel understand CL, you need to add this to your config (after you've configured SLIME):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(require 'ob-lisp)&#xA;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((lisp . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's an example Org content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* CL is a LISP-2&#xA;So you need to quote the ='+= function.&#xA;#+begin_src lisp&#xA;(mapcar '+ '(1 2 3) '(1 2 3))&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| 2 | 4 | 6 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you navigate to a source block, you can edit it with &lt;kbd&gt;C-c '&lt;/kbd&gt; in its native &lt;code&gt;lisp-mode&lt;/code&gt;.&#xA;You can evaluate it with &lt;kbd&gt;C-c C-c&lt;/kbd&gt;, once SLIME was started.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;lispy&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can install &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt; from the&#xA;package manager.  Then open e.g. &lt;code&gt;test.lisp&lt;/code&gt; file, navigate to an open&#xA;or close paren and press &lt;kbd&gt;e&lt;/kbd&gt;.  If SLIME isn't running yet, it&#xA;will automatically start and evaluate the current expression.  The&#xA;result will be shown in the Echo Area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you'd like to see the result in the buffer, press &lt;kbd&gt;E&lt;/kbd&gt;&#xA;instead of &lt;kbd&gt;e&lt;/kbd&gt;.  You can also insert the result as a comment&#xA;by pressing &lt;kbd&gt;2e&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of pressing &lt;kbd&gt;e&lt;/kbd&gt; as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;copying the expression from source buffer to the kill ring&lt;/li&gt;&#xA;&lt;li&gt;switching to the SLIME REPL&lt;/li&gt;&#xA;&lt;li&gt;inserting the expression&lt;/li&gt;&#xA;&lt;li&gt;switching back to the source buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-29T14:04:42.383" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14331" PostTypeId="1" AcceptedAnswerId="14357" CreationDate="2015-07-29T14:12:40.507" Score="2" ViewCount="1129" Body="&lt;p&gt;Magit is unable to commit anything is giving the following message &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1 c:/cygwin64/bin/git.exe … commit -- Waiting for Emacs...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;em&gt;ERROR&lt;/em&gt;: Wrong type argument: arrayp, nilerror: There was a problem with the editor '&quot;c:/Program Files&#xA;  (x86)/Emacs/emacs-24.5/bin/emacsclient.exe&quot;'. Please supply the&#xA;  message using either -m or -F option.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How do I pass the -m and -F option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;platform - Windows 8&#xA;Emacs - 24.5.1&#xA;installed magit from package manager. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to use cygwin with emacs, having set that, cygwin didnt see the windows git properly - hence I installed git for cygwin. Probably that's causing some issue? In my &lt;em&gt;exec-path&lt;/em&gt; I have the path of cygwin-git. I am new to magit so help would be appriciated and also let me know if I can provide with more information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT : Both the git installation work properly - I tried some test commit from and cygwin and cmdprompt and I am able to commit normally.&lt;/p&gt;&#xA;" OwnerUserId="8944" LastEditorUserId="8944" LastEditDate="2015-07-30T09:25:06.337" LastActivityDate="2017-04-13T00:11:35.563" Title="Magit - Unable to commit" Tags="|magit|git|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14332" PostTypeId="2" ParentId="14316" CreationDate="2015-07-29T15:31:24.633" Score="4" Body="&lt;p&gt;&lt;code&gt;org-agenda-mode&lt;/code&gt; relies on setting &lt;code&gt;text-properties&lt;/code&gt; for the faces that are used in the &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer.  When &lt;code&gt;org-agenda-mode&lt;/code&gt; is enabled in the &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer, the following snippet is used to prevent &lt;code&gt;font-lock-mode&lt;/code&gt; from being enabled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Keep global-font-lock-mode from turning on font-lock-mode&#xA;(org-set-local 'font-lock-global-modes (list 'not major-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs does not do well when a marriage is attempted between &lt;code&gt;font-lock-mode&lt;/code&gt; and &lt;code&gt;text-properties&lt;/code&gt; to colorize text within a buffer.  It is &lt;em&gt;possible&lt;/em&gt; to some degree (with a lot of work), but probably is not recommended (nor worth the effort, in the opinion of this author).  Thus, it is usually best to choose one or the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this particular case, the original poster indicated that &lt;code&gt;font-lock-mode&lt;/code&gt; was enabled by using &lt;code&gt;rainbow-mode&lt;/code&gt;.  Disabling &lt;code&gt;rainbow-mode&lt;/code&gt; thus resolved the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overlays play well with both &lt;code&gt;font-lock&lt;/code&gt; and &lt;code&gt;text-properties&lt;/code&gt;.  So perhaps the original poster could find a minor-mode that does not use &lt;code&gt;font-lock&lt;/code&gt; to achieve the desired visual effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to create a custom &lt;code&gt;org-agenda-mode&lt;/code&gt; that uses &lt;code&gt;font-lock&lt;/code&gt; instead of &lt;code&gt;text-properties&lt;/code&gt; [which is what this particular author has done], but that entails a lot of work and is ultimately a custom setup tailored to the needs of an individual user.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-07-29T15:31:24.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14333" PostTypeId="1" AcceptedAnswerId="14334" CreationDate="2015-07-29T15:48:37.917" Score="4" ViewCount="1217" Body="&lt;p&gt;I use the brilliant answer from my &lt;a href=&quot;https://stackoverflow.com/questions/22849281/on-emacs-for-osx-how-to-keep-kill-ring-and-clipboard-separate/&quot;&gt;previous question&lt;/a&gt; to copy selected regions of text from Emacs onto my system pasteboard (i.e. the OSX clipboard). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But some functions (e.g. gist-buffer) push output (e.g. a URL) onto the Emacs kill ring, and I'd like to be able to access that text from other OSX apps. (Without having to do yank, highlight region, then &lt;code&gt;pbcopy&lt;/code&gt; like I currently do.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: How can I push text directly from the Emacs kill-ring to the OSX pasteboard?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2019-08-16T07:20:37.763" Title="how to push kill-ring contents onto system pasteboard (clipboard)?" Tags="|copy-paste|kill-ring|clipboard|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14334" PostTypeId="2" ParentId="14333" CreationDate="2015-07-29T16:18:22.170" Score="4" Body="&lt;p&gt;The function &lt;code&gt;x-select-text&lt;/code&gt; can be used to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Select TEXT, a string, according to the window system.&#xA;&#xA;On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the&#xA;clipboard.  If `x-select-enable-primary' is non-nil, put TEXT in&#xA;the primary selection.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So we need to set&lt;code&gt;x-select-enable-clipboard&lt;/code&gt; to a non-nil value (e.g., &lt;code&gt;t&lt;/code&gt;). &#xA;On Linux machines, it's set to &lt;code&gt;t&lt;/code&gt; by default, so you may or may not need to do this.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq x-select-enable-clipboard t)&#xA;&#xA;(defun copy-current-kill-to-clipboard ()&#xA;  (interactive)&#xA;  (x-select-text (current-kill 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't have an OSX machine to test on -- only Linux --, but this should all work the same on OSX.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="115" LastEditDate="2015-07-31T14:56:12.847" LastActivityDate="2015-07-31T14:56:12.847" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14335" PostTypeId="2" ParentId="14322" CreationDate="2015-07-29T16:34:56.163" Score="3" Body="&lt;p&gt;As others have suggested, you'd be wise to avoid overwriting some of the most common keychord prefixes with your own keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a stylized example of what's going to happen.  Let's say we have a keychord prefix of &lt;code&gt;C-c a&lt;/code&gt; that allows you to send messages to yourself based on what key comes next:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c aa&quot;) (lambda () (interactive) (message &quot;You pressed a&quot;)))&#xA;(global-set-key (kbd &quot;C-c ab&quot;) (lambda () (interactive) (message &quot;You pressed b&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, when you press &lt;code&gt;C-c aa&lt;/code&gt;, Emacs politely tells you that &quot;You pressed a&quot;, and when you press &lt;code&gt;C-c ab&lt;/code&gt;, it informs you that &quot;You pressed b&quot;.  Such functionality!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, let's now say you clobber your prefix by assigning it directly to a command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c a&quot;) (lambda () (interactive) (message &quot;I've clobbered your other bindings!&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, you can no longer get to &lt;code&gt;C-c aa&lt;/code&gt; to have Emacs tell you that &quot;You pressed a&quot;, because the new binding short-circuits the whole affair at &lt;code&gt;C-c a&lt;/code&gt; and tells you that &quot;I've clobbered your other bindings!&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, to make matters worse, &lt;code&gt;C-c&lt;/code&gt; and &lt;code&gt;C-x&lt;/code&gt; are two of the most common prefixes in Emacs, so if you hijack them, you'll have to rebind a very large chunk of the Emacs defaults.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Out of the box, &lt;code&gt;C-x&lt;/code&gt; has its own keymaps (in the plural!): &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Keys.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ctl-x-map&lt;/code&gt;, &lt;code&gt;ctl-x-4-map&lt;/code&gt;, and &lt;code&gt;ctl-x-5-map&lt;/code&gt;&lt;/a&gt;.  Further, a great many modes bind &lt;code&gt;C-c ...&lt;/code&gt; to their core commands.  &lt;code&gt;C-c C-c&lt;/code&gt;, for example, is the conventional way for modes to say &quot;do that main thing I do.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words: if you really want common user interface keybindings, just use &lt;code&gt;cua-mode&lt;/code&gt;.  The &quot;finer control&quot; you can get by hand-binding the keys will turn out to mean a massive rebinding undertaking on your part: yes, it will be finer control, but it's probably not worth your time.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-07-29T16:34:56.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14336" PostTypeId="1" AcceptedAnswerId="14390" CreationDate="2015-07-29T17:21:34.190" Score="1" ViewCount="196" Body="&lt;p&gt;When doing a &lt;code&gt;yank&lt;/code&gt; after an &lt;code&gt;isearch-forward/backward&lt;/code&gt;, the most natural thing that one wishes to happen is to isearch the string provided by that yank. How to realize this? &lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-07-31T22:37:06.470" Title="Yanking after `isearch-forward/backward`" Tags="|isearch|yank|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14337" PostTypeId="1" CreationDate="2015-07-29T18:31:42.590" Score="2" ViewCount="125" Body="&lt;p&gt;I installed column-marker.el. I like the highlighting style better than fci-mode. Unfortunately, column-marker does not highlight bits of the window where the actual line is not 80 chars or more (or whatever its set to). Can this be fixed, so that there's a continuous highlighted strip at column 80? I saw that this issue used to exist in fci-mode, but was fixed. I didn't investigate carefully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose it's possible to configure fci-mode to display like column-marker, but I haven't investigated this carefully either.&lt;/p&gt;&#xA;" OwnerUserId="8293" LastActivityDate="2020-01-26T00:01:45.210" Title="column-marker skips blank lines; how to fix?" Tags="|highlighting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14338" PostTypeId="1" CreationDate="2015-07-29T18:46:52.223" Score="0" ViewCount="869" Body="&lt;p&gt;I just wrote the following checker for syntax-checking Vala code using &lt;code&gt;valac&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-def-option-var flycheck-vala-packages nil vala-valac&#xA;  &quot;A list of additional pakages for valac.&#xA;&#xA;The value of this variable is a list of strings, where each string is what would get passed to valac's --pkg option.&quot;&#xA;  :type '(repeat (file :tag &quot;Include package&quot;))&#xA;  :safe #'flycheck-string-list-p&#xA;  :package-version '(flycheck . &quot;0.20&quot;))&#xA;&#xA;(flycheck-def-option-var flycheck-vala-enable-experimental-non-null nil vala-valac&#xA;  &quot;Whether to enable strict non-null checking for valac.&#xA;&#xA;When non-nil, enable strict null checks as by --enable-experimental-non-null.&quot;&#xA;  :type 'boolean&#xA;  :safe #'booleanp&#xA;  :package-version '(flycheck . &quot;0.20&quot;))&#xA;&#xA;(flycheck-define-checker vala-valac&#xA;  &quot;A Vala syntax checker using valac.&quot;&#xA;  :command (&quot;valac&quot;&#xA;            &quot;-c -o&quot; null-device&#xA;            (option-flag &quot;--enable-experimental-non-null&quot; flycheck-vala-enable-experimental-non-null)           &#xA;            (option-list &quot;--pkg&quot; flycheck-vala-packages)&#xA;            source)&#xA;  :error-patterns ((error line-start &#xA;                          (file-name)&#xA;                          &quot;:&quot; line &quot;.&quot; column &quot;-&quot; line &quot;.&quot; column &quot;: error&quot; (message) line-end)&#xA;                   (warning line-start&#xA;                        (file-name)&#xA;                        &quot;:&quot; line &quot;.&quot; column &quot;-&quot; line &quot;.&quot; column &quot;: warning: &quot; (message) line-end))&#xA;  :modes vala-mode)&#xA;&#xA;(add-to-list 'flycheck-checkers 'vala-valac)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I try to use it, I get the following two errors; the first on loading my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: flycheck-checker-get&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this one when I try to use the checker on a Vala file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Suspicious state from syntax checker vala-valac: Checker vala-valac returned non-zero exit code 1, but no errors from output: Unknown option -c -o&#xA;Run '/usr/bin/valac --help' to see a full list of available command line options.&#xA;&#xA;Checker definition probably flawed.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure about why this is happening, especially the first one. The second error is clearly due to argument order, but according to the &lt;a href=&quot;http://linux.die.net/man/1/valac&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;valac&lt;/code&gt; manpage&lt;/a&gt;, both &lt;code&gt;-c&lt;/code&gt; and &lt;code&gt;-o&lt;/code&gt; are valid flags.&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2015-07-29T19:21:55.300" Title="Something not right with this Flycheck checker - unclear why" Tags="|syntax-highlighting|flycheck|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14339" PostTypeId="1" AcceptedAnswerId="14344" CreationDate="2015-07-29T19:13:43.740" Score="4" ViewCount="638" Body="&lt;p&gt;Org capture is a great tool for capturing notes and task when doing other things inside Emacs. The captured item is stored in a specified file for later review, and the point jumps back to the file it was in when you got the idea. Practical. However, I am also using capture to make tasks when working deliberately in my task file. In this case it would be much more handy if the task template saved the new task at point whichever file I am in, and not to a predefined capture file. After the task is produced I would like point to stay in the headerline of this new task. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a capture template I use for producing task items:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates '((&#xA;         &quot;t&quot;                                            ; key&#xA;         &quot;Todo&quot;                                         ; description&#xA;         entry                                          ; type&#xA;         (file+headline &quot;C:/.../privat.org&quot; &quot;tasks&quot;)    ; target&#xA;         &quot;* TODO [#B] %^{Todo} \nSCHEDULED: %t \n\n%?&quot;  ; template&#xA;         :prepend t                                     ; properties&#xA;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It stores the produced task to the file &lt;code&gt;&quot;C:/.../privat.org&quot;&lt;/code&gt; under the heading &lt;code&gt;&quot;tasks&quot;&lt;/code&gt;, and the &lt;code&gt;&quot;prepend&quot;&lt;/code&gt; property makes the new task to be placed as the first subheading under &quot;task&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make the new task be stored at point in whatever file I work in?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="10" LastEditDate="2015-07-29T19:54:00.727" LastActivityDate="2015-07-30T00:05:21.473" Title="How to make a capture task template that stores a new task at point in the file I am in?" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14340" PostTypeId="2" ParentId="14338" CreationDate="2015-07-29T19:21:55.300" Score="1" Body="&lt;p&gt;It's easy to forget that not all calls of a shell command involve shelling out.  In case a process is called the proper way, a list of all of its arguments must be passed.  Therefore it should be sufficient to change that list to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;valac&quot;&#xA;        &quot;-c&quot; &quot;-o&quot; null-device&#xA;        (option-flag &quot;--enable-experimental-non-null&quot; flycheck-vala-enable-experimental-non-null)&#xA;        (option-list &quot;--pkg&quot; flycheck-vala-packages)&#xA;        source)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for the other issue, this is probably due to not all (if any) functionality of Flycheck being loaded while loading up your Emacs setup.  An easy fix for this is wrapping your code in an &lt;code&gt;eval-after-load&lt;/code&gt; or &lt;code&gt;with-eval-after-load&lt;/code&gt; (for Emacs versions greater or equal to 24.4), alternatively you can use &lt;code&gt;(require 'flycheck)&lt;/code&gt; after &lt;code&gt;(package-initialize)&lt;/code&gt; was run (which can either happen explicitly in your init file or implicitly after your init file was loaded for use with &lt;code&gt;after-init-hook&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-07-29T19:21:55.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14341" PostTypeId="2" ParentId="14320" CreationDate="2015-07-29T21:36:15.520" Score="5" Body="&lt;p&gt;The below works for both html and reveal exports:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* External Links&#xA;=[[LINK][LINK NAME]]=&#xA;** Open link in the same tab&#xA;#+BEGIN_SRC text&#xA;Check out the org mode manual on [[http://orgmode.org/manual/Hyperlinks.html]&#xA;[Hyperlinks]].&#xA;&#xA;/(Left clicking the link will open the link in the same tab.)/&#xA;#+END_SRC&#xA;Check out the org mode manual on [[http://orgmode.org/manual/Hyperlinks.html][Hyperlinks]].&#xA;&#xA;/(Left clicking the link will open the link in the same tab.)/&#xA;** Open link in a new tab&#xA;#+BEGIN_SRC text&#xA;#+ATTR_HTML: :target _blank&#xA;Check out the org mode manual on [[http://orgmode.org/manual/Hyperlinks.html]&#xA;[Hyperlinks]] in a new tab.&#xA;&#xA;/(Left clicking the link will open the link in a new tab.)/&#xA;#+END_SRC&#xA;#+ATTR_HTML: :target _blank&#xA;Check out the org mode manual on [[http://orgmode.org/manual/Hyperlinks.html][Hyperlinks]] in a new tab.&#xA;&#xA;/(Left clicking the link will open the link in a new tab.)/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;HTML Export&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/x971i.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/x971i.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-29T21:41:43.700" LastActivityDate="2015-07-29T21:41:43.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14342" PostTypeId="1" AcceptedAnswerId="21013" CreationDate="2015-07-29T22:13:36.920" Score="9" ViewCount="1680" Body="&lt;p&gt;I am having a bit of trouble with code blocks that produce org tables to be later consumed by other code blocks. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: upper_air&#xA;#+BEGIN_SRC clojure :results output raw&#xA;  (clojure.pprint/print-table table)&#xA;#+END_SRC &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will produce&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS: upper_air&#xA;|      :m | :degree | :meter/second |      :degC | :millibar |&#xA;|---------+---------+---------------+------------+-----------|&#xA;|  1545.0 |   175.0 |         12.36 |  15.400001 |     850.0 |&#xA;|  3162.0 |   265.0 |          6.69 |        4.8 |     700.0 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but what I would really like is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: upper_air&#xA;|      :m | :degree | :meter/second |      :degC | :millibar |&#xA;|---------+---------+---------------+------------+-----------|&#xA;|  1545.0 |   175.0 |         12.36 |  15.400001 |     850.0 |&#xA;|  3162.0 |   265.0 |          6.69 |        4.8 |     700.0 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(note &lt;code&gt;#+RESULTS&lt;/code&gt; vs. &lt;code&gt;#+TBLNAME&lt;/code&gt;) so that subsequently I can do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ipython :session  :var data=upper_air&#xA;import numpy as np&#xA;&#xA;arr = np.array(data)&#xA;p = arr[:,4]&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the &lt;code&gt;#+RESULTS&lt;/code&gt; result, the second code block will interpret the &lt;code&gt;data&lt;/code&gt;&#xA;argument as a string instead of a data table and I will not be able to extract&#xA;the data in a straightforward way. I could convert the ASCII data to a Python data structure 'manually', but I would prefer org handle it for me :-) Is there a way for either the first code block to output a &lt;code&gt;#+TBLNAME&lt;/code&gt; instead of &lt;code&gt;#+RESULTS&lt;/code&gt;? Alternatively, can the second code block coerce the argument as an&#xA;org table instead of a string?&lt;/p&gt;&#xA;" OwnerUserId="8424" LastActivityDate="2016-05-16T04:23:06.807" Title="Code blocks that produce org tables to be later consumed by other code blocks" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14343" PostTypeId="1" CreationDate="2015-07-29T22:56:43.210" Score="0" ViewCount="169" Body="&lt;p&gt;I have made a tags search to filter out todo's created today:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands'(&#xA;    (&quot;d&quot; &quot;todo's made today&quot; tags &quot;TODO=\&quot;TODO\&quot;+Created=\&quot;&amp;lt;today&amp;gt;\&quot;&quot; (&#xA;    (org-agenda-sorting-strategy '(scheduled-up))&#xA;    (org-agenda-overriding-header &quot;TODO's created today&quot;)&#xA;    ))&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My todo's contains a created timestamp as a property:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTY:&#xA;:Created: [2015-07-30 on 21:33]&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;hence, the timestamp contains both date and time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my tags search do not find tasks created today unless I change the todo's timestamp format to contain date only, like in [2015-07-30 on].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the tags search format to find today's timestamps when these contain both data end time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any helpful suggestions : )&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="2274" LastEditDate="2015-07-30T00:07:40.100" LastActivityDate="2015-07-30T00:07:40.100" Title="How can I make tags-search able to find created timestamps containing both date and time?" Tags="|org-mode|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14344" PostTypeId="2" ParentId="14339" CreationDate="2015-07-30T00:05:21.473" Score="6" Body="&lt;p&gt;From the &lt;code&gt;org-capture&lt;/code&gt; help:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When called with a ‘C-0’ (zero) prefix, insert a template at point.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;C-0 C-c c&lt;/code&gt; does what want (assuming &lt;code&gt;C-c c&lt;/code&gt; is bound to &lt;code&gt;org-capture&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-07-30T00:05:21.473" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14345" PostTypeId="2" ParentId="3863" CreationDate="2015-07-30T00:26:57.477" Score="14" Body="&lt;p&gt;I have been using &lt;a href=&quot;http://www.orgzly.com/&quot;&gt;Orgzly&lt;/a&gt; to view org files on Android.  It displays them nicely and you can do basic editing (setting todo states, schedules, deadlines and tags).  There is also some basic support &lt;code&gt;org-agenda&lt;/code&gt; like searches.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-07-30T00:26:57.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14346" PostTypeId="2" ParentId="13460" CreationDate="2015-07-30T00:52:50.987" Score="1" Body="&lt;p&gt;Here's what I came up with, building on @glucas's idea to use &lt;code&gt;defadvice&lt;/code&gt;. This code works, but I'm just starting to learn Lisp (and programming) so feel free to suggest improvements to my code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice capitalize-word (after capitalize-word-advice activate)&#xA;&quot;After capitalizing the new first word in a sentence, downcase the next word, since that next word is no longer the first word in the sentence.&quot; &#xA;(unless &#xA;  (or&#xA;   (looking-at &quot; I\\b&quot;) ; never downcase the word &quot;I&quot; &#xA;   (looking-at (sentence-end))&#xA;   (looking-at &quot;[ ]*$&quot;) ; hopefully this means &quot;zero or more whitespaces, then end of line&quot;&#xA;   (looking-at (user-full-name))&#xA;   )&#xA; (downcase-word 1))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also created a companion function to re-capitalize the first word of the next already existing sentence if you wind up typing an entire sentence with a period at the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun smart-period ()&#xA;&quot;When you type a period, capitalize the first word of the next sentence.&quot;&#xA;(interactive)&#xA;(insert &quot;.&quot;) &#xA;(save-excursion&#xA;(unless (looking-at &quot;[ ]*$&quot;) ; zero or more whitespaces, then line break&#xA;(capitalize-unless-org-heading))&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And since I didn't know how to concatenate looking-at regexps, I created an exception for org-mode headings in a separate function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun capitalize-unless-org-heading ()&#xA;(interactive)&#xA;(unless (looking-at org-complex-heading-regexp)&#xA;(capitalize-word 1)&#xA;)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-07-30T02:25:38.880" LastActivityDate="2015-07-30T02:25:38.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14347" PostTypeId="1" AcceptedAnswerId="14355" CreationDate="2015-07-30T08:19:22.830" Score="16" ViewCount="3162" Body="&lt;p&gt;Given split windows like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|------|-------|&#xA;|1     |2      |&#xA;|      |       |&#xA;|------|-------|&#xA;|3     |4      |&#xA;|      |       |&#xA;|------|-------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are two options to collaps the split windows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;delete-other-windows (Ctrl-x 1)&lt;/li&gt;&#xA;&lt;li&gt;delete-window (Ctrl-x 0)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: is there a way to control how they collapse?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For example, how can I collapse like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|------|-------|&#xA;|1             |&#xA;|              |&#xA;|------|-------|&#xA;|3     |4      |&#xA;|      |       |&#xA;|------|-------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|------|-------|&#xA;|2             |&#xA;|              |&#xA;|------|-------|&#xA;|3     |4      |&#xA;|      |       |&#xA;|------|-------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|------|-------|&#xA;|1     |2      |&#xA;|      |       |&#xA;|      |-------|&#xA;|      |4      |&#xA;|      |       |&#xA;|------|-------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, or this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|------|-------|&#xA;|3     |2      |&#xA;|      |       |&#xA;|      |-------|&#xA;|      |4      |&#xA;|      |       |&#xA;|------|-------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-07-30T09:19:11.013" LastActivityDate="2022-09-15T01:19:15.137" Title="Collapse split windows" Tags="|window-splitting|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14348" PostTypeId="5" CreationDate="2015-07-30T08:30:05.583" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-30T08:30:05.583" LastActivityDate="2015-07-30T08:30:05.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14349" PostTypeId="4" CreationDate="2015-07-30T08:30:05.583" Score="0" Body="DocView mode is a major mode for viewing DVI, PostScript (PS), PDF, OpenDocument, and Microsoft Office documents. It provides features such as slicing, zooming, and searching inside documents. It works by converting the document to a set of images using the gs (GhostScript) or mudraw/pdfdraw (MuPDF) commands and other external tools, and displaying those images." OwnerUserId="8488" LastEditorUserId="8488" LastEditDate="2015-07-30T12:45:45.487" LastActivityDate="2015-07-30T12:45:45.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14350" PostTypeId="1" AcceptedAnswerId="14377" CreationDate="2015-07-30T09:37:12.257" Score="1" ViewCount="131" Body="&lt;p&gt;I have this function in config&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun launch-separate-emacs-under-x ()&#xA;  (interactive)&#xA;  (call-process &quot;sh&quot; nil nil nil &quot;-c&quot; &quot;emacs &amp;amp;&quot;))&#xA;&#xA;(defun restart-emacs ()&#xA;  (interactive)&#xA;  (add-hook 'kill-emacs-hook&#xA;            (if (display-graphic-p)&#xA;                #'launch-separate-emacs-under-x&#xA;              #'launch-separate-emacs-in-terminal)&#xA;            t)&#xA;  (kill-emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general if i execute any command say &lt;code&gt;package-install&lt;/code&gt; it will be added to command history. But when I execute above function using &lt;code&gt;M-x&lt;/code&gt;, it is not getting added into commands history. How to make emacs to add this command to history?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="253" LastEditDate="2015-07-30T16:58:38.563" LastActivityDate="2015-07-31T13:51:51.210" Title="How to push this command in to history?" Tags="|commands|history|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14352" PostTypeId="2" ParentId="14347" CreationDate="2015-07-30T11:54:43.963" Score="10" Body="&lt;p&gt;The function &lt;code&gt;delete-window&lt;/code&gt; has an optional argument WINDOW.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;window-in-direction&lt;/code&gt; has a mandatory argument of DIRECTION and optional arguments for WINDOW IGNORE SIGN WRAP MIN.  To learn more about these arguments by reading the doc-string, a user may type &lt;code&gt;M-x describe-function RET window-in-direction RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following four functions could be used to control the direction a window is deleted.  A user may wish to assign keyboard shortcuts.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-window-above ()&#xA;&quot;Delete window in direction 'above.&quot;&#xA;(interactive)&#xA;  (delete-window (window-in-direction 'above)))&#xA;&#xA;(defun delete-window-below ()&#xA;&quot;Delete window in direction 'below.&quot;&#xA;(interactive)&#xA;  (delete-window (window-in-direction 'below)))&#xA;&#xA;(defun delete-window-left ()&#xA;&quot;Delete window in direction 'left.&quot;&#xA;(interactive)&#xA;  (delete-window (window-in-direction 'left)))&#xA;&#xA;(defun delete-window-right ()&#xA;&quot;Delete window in direction 'right.&quot;&#xA;(interactive)&#xA;  (delete-window (window-in-direction 'right)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-07-30T12:12:49.763" LastActivityDate="2015-07-30T12:12:49.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14353" PostTypeId="1" AcceptedAnswerId="14418" CreationDate="2015-07-30T11:57:29.553" Score="4" ViewCount="437" Body="&lt;p&gt;I have the following setup for using comments: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define evil-normal-state-map &quot;cc&quot; 'comment-dwim-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine. I can type &lt;kbd&gt;cc&lt;/kbd&gt; to comment it out or comment out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Web-mode works with an another function, because the comment syntax are differrent for languages like javascript or HTML. So I set up following keybinding for only web-mode in my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'normal web-mode-map&#xA;  (kbd &quot;cc&quot;) 'web-mode-comment-or-uncomment&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But with the setup above I cannot use other Evil keybindings like &lt;kbd&gt;cw&lt;/kbd&gt; or &lt;kbd&gt;ctf&lt;/kbd&gt; anymore, because the keybinding above disabled them. Any suggestion for a way to use keychord in the &lt;code&gt;evil-define-key&lt;/code&gt;, but for web-mode only? So that I can use another keys with operator &lt;kbd&gt;c&lt;/kbd&gt; again, in web-mode only. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-08-03T04:09:07.203" Title="Evil - how to set up keychords for Web-mode only?" Tags="|key-bindings|keymap|evil|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14354" PostTypeId="1" AcceptedAnswerId="14376" CreationDate="2015-07-30T12:07:29.357" Score="18" ViewCount="3264" Body="&lt;p&gt;I am debugging why emacs crashes when using a function from a package&lt;sup&gt;1&lt;/sup&gt;. The aim of this debug process is to get useful data to submit using &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get help on how to debug emacs crashes, I have already looked at &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Crashing.html&quot; rel=&quot;noreferrer&quot;&gt;Emacs Manual - Crashing&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/After-a-Crash.html&quot; rel=&quot;noreferrer&quot;&gt;Emacs Manual - After a Crash&lt;/a&gt;, but they did not help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/After-a-Crash.html&quot; rel=&quot;noreferrer&quot;&gt;After A Crash&lt;/a&gt; manual refers to &lt;code&gt;emacs-buffer.gdb&lt;/code&gt; but I have no idea how to use it. While asking google for help, I came across &lt;a href=&quot;https://emacs.stackexchange.com/q/4213/115&quot;&gt;this emacs.SE&lt;/a&gt; question, and I recompiled emacs using the &lt;code&gt;-ggdb3&lt;/code&gt; flags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no prior experience using &lt;code&gt;gdb&lt;/code&gt; and so I tried few failed attempts to use the &lt;code&gt;emacs-buffer.gbd&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I tried:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;gdb -x /path/to/emacs-buffer.gdb&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;gdb&lt;/code&gt; -&gt; &lt;code&gt;file /path/to/emacs-buffer.gdb&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;gdb&lt;/code&gt; -&gt; &lt;code&gt;source /path/to/emacs-buffer.gdb&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;source /path/to/emacs-buffer.gdb&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;On a side note, emacs compiled with the &lt;code&gt;-ggdb3&lt;/code&gt; flag takes about 10 seconds longer to load; earlier it was 5-6 seconds, now about 16-17 seconds. I know the exact seconds because of a code that calculates that in my init. Is this increase in startup time expected?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Footnote 1: emacs crashes consistently when &lt;code&gt;undo-tree&lt;/code&gt; tries to restore the undo history for a particular .org file (which I cannot share publicly). I have &lt;code&gt;(setq undo-tree-auto-save-history t)&lt;/code&gt;. &lt;em&gt;This crash happens only on the emacs git master, not on emacs 24.5.&lt;/em&gt; On emacs 24.5, &lt;code&gt;undo-tree&lt;/code&gt; throws an error stating that it's unable to load the undo history (even through the undo history file exists), but at least the emacs session does not crash on that version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2017-09-21T23:54:03.543" LastActivityDate="2017-09-21T23:54:03.543" Title="How do I debug an emacs crash?" Tags="|debugging|gdb|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14355" PostTypeId="2" ParentId="14347" CreationDate="2015-07-30T12:19:31.590" Score="13" Body="&lt;p&gt;Try &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot;&gt;ace-window&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you bind it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;M-p&quot; 'ace-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can switch to window 2 by pressing &lt;kbd&gt;M-p 2&lt;/kbd&gt;.  Also, you&#xA;can delete window 2 by pressing &lt;kbd&gt;M-p x2&lt;/kbd&gt;: this will bring you&#xA;into your first example.  Other examples follow by just changing the&#xA;final key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other modifiers present:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;x&lt;/kbd&gt; to delete&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;m&lt;/kbd&gt; to swap&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;v&lt;/kbd&gt; to split vertically&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;b&lt;/kbd&gt; to split horizontally&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;i&lt;/kbd&gt; to delete other windows than the selected one&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;o&lt;/kbd&gt; to delete other windows than the current one&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;kbd&gt;n&lt;/kbd&gt; to switch to the last window&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The last two modifiers actually require no further input, while the&#xA;others always prompt you for a window to act upon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modifiers are customizable via &lt;code&gt;aw-dispatch-alist&lt;/code&gt;.&#xA;The window keys (which are 1/2/3/4... by default) are customizable via &lt;code&gt;aw-keys&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the setting that I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-07-30T12:19:31.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14356" PostTypeId="1" CreationDate="2015-07-30T12:44:27.827" Score="1" ViewCount="516" Body="&lt;p&gt;I am using the column view on my org agendas, and I want one of the columns to show the timestamp for when the task was finilize (set to &quot;DONE&quot; state). I tried the following column headings&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+COLUMNS: %DONE&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;#+COLUMNS: %CLOSED&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but neither of them worked. I have not found any special properties for the DONE time (althought I thought CLOSED was exactly that), so I have tried the column heading &lt;code&gt;#+COLUMNS: %TIMESTAMP_IA&lt;/code&gt;. However, this will show all type of inactive timestamps, not only timestamps for DONE. Another approach would be to include the timestamp for &quot;DONE&quot; as a property of the task, though I have no idea of how to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So,&lt;br&gt;&#xA;1) how can I include a timestamp for DONE as a column in column view?&lt;br&gt;&#xA;2) how to make a timestamp for DONA a property of a task?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for all helpfull suggestions :)&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2017-09-19T19:15:12.590" Title="How can I make column view show a column with the timestamp for when a task was DONE?" Tags="|org-agenda|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14357" PostTypeId="2" ParentId="14331" CreationDate="2015-07-30T14:35:00.863" Score="0" Body="&lt;p&gt;Posted multiple times because I thought github repo was &lt;em&gt;only&lt;/em&gt; for feature request and also tried the chat but there was no activity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway the problem seem to be proper initialization and setup of cygwin on windows. I tried the setup suggested by &lt;em&gt;benquike&lt;/em&gt; in &lt;a href=&quot;https://github.com/magit/magit/issues/1318&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magit/magit/issues/1318&lt;/a&gt; -- Restating it here. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Download cygwin-mount.el( For links go the link above or replace the @ with : http@//emacswiki.org/emacs/cygwin-mount.el) to&#xA;  somewhere&lt;/li&gt;&#xA;  &lt;li&gt;download setup-cygwin.el(&lt;a href=&quot;http://www.emacswiki.org/emacs/setup-cygwin.el&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/setup-cygwin.el&lt;/a&gt;) to&#xA;  somewhere&lt;/li&gt;&#xA;  &lt;li&gt;in your init.el(or .emacs),add the following&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;where you placed cygwin-mount.el and setup-cygwin.el&quot;)&#xA;(require 'setup-cygwin)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Only problem seem to be that you cannot place the .el files mentioned above in your .emacs.d folder but instead place it in a subdirectory. (As with the new version of Emacs they are &quot;discouraging&quot; that)&lt;/p&gt;&#xA;" OwnerUserId="8944" LastActivityDate="2015-07-30T14:35:00.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14358" PostTypeId="1" CreationDate="2015-07-30T14:59:51.010" Score="6" ViewCount="759" Body="&lt;p&gt;When i press &lt;code&gt;)&lt;/code&gt; in Vim it jumps to the next sentence.  In &lt;code&gt;evil&lt;/code&gt;, however, &lt;code&gt;)&lt;/code&gt; (&lt;code&gt;evil-forward-sentence&lt;/code&gt;) at the beginning of the following paragraph takes you to the paragraph's end, while in Vim it jumps to &quot;Donec a diam&quot;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is this a bug or a config error on my side?&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="253" LastEditDate="2015-07-30T15:08:00.293" LastActivityDate="2015-07-30T15:25:06.680" Title="How do I jump to the next sentence in evil?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14359" PostTypeId="2" ParentId="14358" CreationDate="2015-07-30T15:05:18.390" Score="7" Body="&lt;p&gt;The problem is a configuration &quot;error&quot;: the paragraph you pasted has&#xA;sentences separated by a single space, and your setup is probably&#xA;expecting sentences to be separated by two spaces.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest solution is to &lt;code&gt;(setq sentence-end-double-space nil)&lt;/code&gt;.  As the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Sentences.html&quot; rel=&quot;noreferrer&quot;&gt;manual on&#xA;&quot;Sentences&quot;&lt;/a&gt;&#xA;notes, though, doing so is not without drawbacks:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you want to use just one space between sentences, you can set the variable sentence-end-double-space to nil to make the sentence commands stop for single spaces. However, this has a drawback: there is no way to distinguish between periods that end sentences and those that indicate abbreviations. For convenient and reliable editing, we therefore recommend you follow the two-space convention.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-07-30T15:25:06.680" LastActivityDate="2015-07-30T15:25:06.680" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14360" PostTypeId="1" CreationDate="2015-07-30T18:22:25.553" Score="6" ViewCount="485" Body="&lt;p&gt;It looks like firefox has a remote debugging protocol, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://wiki.mozilla.org/Remote_Debugging_Protocol&quot; rel=&quot;noreferrer&quot;&gt;https://wiki.mozilla.org/Remote_Debugging_Protocol&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of any tools that would allow emacs to make a connection and to allow debugging from within emacs? Maybe I should file a feature request to port their protocol to a swank/slime protocol?&lt;/p&gt;&#xA;" OwnerUserId="2846" LastActivityDate="2017-03-27T03:42:02.890" Title="Firefox debugging repl in emacs?" Tags="|slime|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14362" PostTypeId="1" AcceptedAnswerId="14365" CreationDate="2015-07-30T20:56:35.693" Score="7" ViewCount="2608" Body="&lt;p&gt;I'm trying to test for whether a string contains a positive integer (1, 2, 3, ...).  By &quot;string contains&quot; I mean the string is only numbers (e.g. &quot;1&quot;, &quot;12&quot;, &quot;123&quot; but &lt;strong&gt;not&lt;/strong&gt; &quot;0&quot;, &quot;1.1&quot;, &quot;1a&quot;, &quot;a1&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first thought was to test the type and check if it is an integer but first I need to convert to numeric.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(typep (string-to-number &quot;23K&quot;) 'integer)&#xA;;; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work because &lt;code&gt;string-to-number&lt;/code&gt; ignores any trailing characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I thought I'd use regular expressions to test that every character is in &lt;code&gt;[0-9]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(equal (nth 0 (re-seq &quot;[0-9]+&quot; &quot;23K&quot;)) &quot;23K&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;re-seq&lt;/code&gt; is taken from &lt;a href=&quot;https://emacs.stackexchange.com/questions/7148/get-all-regexp-matches-in-buffer-as-a-list&quot;&gt;this post&lt;/a&gt; and searches for every occurrence of the regular expression (first arg) in the second arg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining that with a test for the number being greater than 0 I end up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(and (equal (nth 0 (re-seq &quot;[0-9]+&quot; &quot;23K&quot;)) &quot;23K&quot;) &#xA;     (&amp;gt; (string-to-number &quot;23K&quot;) 0) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty new to lisp programming so I'm wondering if there is a simpler way to do this.&lt;/p&gt;&#xA;" OwnerUserId="6863" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-07-31T13:47:32.907" Title="Simple way to test if string contains positive integer" Tags="|elisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14363" PostTypeId="2" ParentId="14362" CreationDate="2015-07-30T21:08:26.570" Score="8" Body="&lt;p&gt;In &lt;code&gt;cl&lt;/code&gt; package there's &lt;code&gt;cl-parse-integer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-parse-integer &quot;23K&quot;) ; errors&#xA;(cl-parse-integer &quot;23K&quot; :junk-allowed t)&#xA;23&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-07-30T21:08:26.570" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14365" PostTypeId="2" ParentId="14362" CreationDate="2015-07-30T21:16:35.767" Score="8" Body="&lt;p&gt;You can use a regular expression to recognize positive integers written in decimal expansion: they are the strings that consist only of decimal digits, where at least one of the digits is nonzero.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;\\`[0-9]*[1-9][0-9]*\\'&quot; my-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows leading zeros (e.g. &lt;code&gt;&quot;0123&quot;&lt;/code&gt;); if you don't want that, insist that a nonzero digit comes first.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;\\`[1-9][0-9]*\\'&quot; my-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use regular expressions for other things in the same piece of code, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Saving-Match-Data.html#Saving-Match-Data&quot;&gt;save the match data&lt;/a&gt; around your test.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-match-data&#xA;  (string-match &quot;\\`[0-9]*[1-9][0-9]*\\'&quot; my-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that if you try to convert the string to an integer with &lt;code&gt;string-to-int&lt;/code&gt;, Emacs may make a floating point approximation if the integer is too large. With &lt;code&gt;parse-integer&lt;/code&gt;, you'll get an integer but with wraparound at 2&lt;sup&gt;&lt;em&gt;N&lt;/em&gt;&lt;/sup&gt; where &lt;em&gt;N&lt;/em&gt; is the number of bits in an integer in your version of Emacs.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-07-30T21:20:07.217" LastActivityDate="2015-07-30T21:20:07.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14366" PostTypeId="1" CreationDate="2015-07-30T22:02:07.757" Score="3" ViewCount="434" Body="&lt;p&gt;I want to implement behavior similar to mine vim config, where all basic info was below the main frame, like modes, position in file, changes, but above the frame is list of all buffers, with separated by color active buffer for active window. Is it possible to do somehow? thx. Can you suggest some plugins or scripts implementing similar behavior?&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="105" LastEditDate="2015-07-30T22:45:17.237" LastActivityDate="2018-11-02T16:00:48.943" Title="How to make persistent buffer list above frame like in vim powerline" Tags="|buffers|vim-emulation|powerline|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14367" PostTypeId="1" AcceptedAnswerId="14381" CreationDate="2015-07-30T22:41:13.313" Score="4" ViewCount="1779" Body="&lt;p&gt;I am writing a simple package for myself to try and learn some elisp - and to begin extending Emacs for my own personal workflow. This function processes the current buffer contents with a command line utility and pipes the output into a temporary buffer. This is what I have so far, and it processes the buffer as desired&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun doStuff ()&#xA;  (interactive)&#xA;  (with-output-to-temp-buffer &quot;*stuffed*&quot;&#xA;    (shell-command&#xA;     (..cli stuff here...)&#xA;     (pop-to-buffer &quot;*stuffed*&quot;)&#xA;     ))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I'm looking for is a way to replace the contents of the &lt;em&gt;current&lt;/em&gt; buffer, in such a way that if I press &quot;q&quot; it will revert to the original buffer contents. Can anyone give me some pointers on how I might go about that?&lt;/p&gt;&#xA;" OwnerUserId="8990" LastActivityDate="2015-07-31T15:23:39.553" Title="Create a &quot;dismissable&quot; buffer" Tags="|buffers|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14368" PostTypeId="1" CreationDate="2015-07-31T00:19:41.723" Score="0" ViewCount="165" Body="&lt;p&gt;&lt;em&gt;In what follows, I use the terms &quot;warning&quot; and &quot;reminder&quot; synonymously.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, I would like Org to visually warn me of upcoming appointments, at the following times:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;15 minutes in advance;&lt;/li&gt;&#xA;&lt;li&gt;1 hour in advance;&lt;/li&gt;&#xA;&lt;li&gt;3 hours in advance; and&lt;/li&gt;&#xA;&lt;li&gt;24 hours in advance.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would also like to be able to manually override this default, for certain appointments, specifying instead a different sequence of reminders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;N.B. &lt;a href=&quot;https://emacs.stackexchange.com/q/7380/8341&quot;&gt;This question&lt;/a&gt; is similar. However, my question differs in some significant respects, which is why I think this is not a duplicate question:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;That question specifically asks about setting warning intervals for &lt;code&gt;appt&lt;/code&gt; rather than for &lt;code&gt;Org mode&lt;/code&gt;. While it's true that the answer to my question&lt;/em&gt; might &lt;em&gt;involve invoking &lt;code&gt;appt&lt;/code&gt;, it also might not.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;My question asks about setting reminders that occur more than just a few minutes in advance.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;My question asks about manually overriding the default intervals.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user8341" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-07-31T01:12:02.300" Title="Set default timing for reminders/warnings, without identical intervals" Tags="|org-mode|appt|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14369" PostTypeId="1" AcceptedAnswerId="14371" CreationDate="2015-07-31T01:00:05.447" Score="1" ViewCount="277" Body="&lt;p&gt;It looks a quite magic that the web-mode could mix with php mode.&#xA;A major mode could contain another major mode. This seems amazing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.php\\'&quot; . php-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.blade\\.php\\'&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I have a file named &quot;portal.blade.php&quot;,  how does web-mode recognize the internal php code?&lt;/p&gt;&#xA;" OwnerUserId="9057" LastEditorUserId="9057" LastEditDate="2015-07-31T02:17:18.123" LastActivityDate="2015-07-31T18:53:13.070" Title="How does web-mode recognize the php code or html code" Tags="|web-mode|php-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14370" PostTypeId="2" ParentId="14205" CreationDate="2015-07-31T02:33:39.463" Score="0" Body="&lt;p&gt;It is indeed due to the way that &lt;code&gt;load-theme&lt;/code&gt; works, which is unlike the way &lt;code&gt;custom-theme-set-faces&lt;/code&gt; works. I worked around this by &lt;a href=&quot;https://github.com/bbatsov/solarized-emacs/pull/198&quot; rel=&quot;nofollow&quot;&gt;creating a macro&lt;/a&gt; for the theme I use to make it usable with &lt;code&gt;custom-theme-set-faces&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2015-07-31T02:33:39.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14371" PostTypeId="2" ParentId="14369" CreationDate="2015-07-31T02:55:25.463" Score="2" Body="&lt;p&gt;I'm no expert in this, but taking a quick look at the code I say it's regular expressions. Web-mode seems to use regexes to search for &lt;code&gt;&amp;lt;?|&amp;lt;?php&lt;/code&gt; tags, then it knows what comes further is php code. The same goes for html, asp, javascript and other languages. I think you should look at the code yourself (&lt;code&gt;M-x describe-function web-mode&lt;/code&gt;). And if you're really interested, you could try writing a simple major mode to better understand how major modes work, then you should be able to know better what web-mode does under the hood.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-07-31T18:53:13.070" LastActivityDate="2015-07-31T18:53:13.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14372" PostTypeId="1" AcceptedAnswerId="14373" CreationDate="2015-07-31T04:08:13.593" Score="1" ViewCount="108" Body="&lt;p&gt;Why doesn't this regexp work when I do &lt;code&gt;C-M-%&lt;/code&gt;? I need to replace exactly these strings:&#xA;&lt;code&gt;\text{vars}(\vp) -&amp;gt; |\vp|&lt;/code&gt;&#xA;&lt;code&gt;\text{vars}(\vp') -&amp;gt; |\vp|&lt;/code&gt;&#xA;I don't have anything else of the form &lt;code&gt;\text{vars}*&lt;/code&gt;, so I used&#xA;&lt;code&gt;\\text{vars}(\([:ascii:]+\)) -&amp;gt; |\1|&lt;/code&gt; and got &lt;code&gt;Replaced 0 occurrences&lt;/code&gt;. What's wrong?&lt;/p&gt;&#xA;" OwnerUserId="5376" LastActivityDate="2015-07-31T06:03:46.850" Title="Regexp \\text{vars}(\([:ascii:]+\)) -&gt; |\1| doesn't work" Tags="|regular-expressions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14373" PostTypeId="2" ParentId="14372" CreationDate="2015-07-31T05:48:08.783" Score="5" Body="&lt;p&gt;&lt;em&gt;Character classes&lt;/em&gt; need to be used within a &lt;em&gt;character alternative&lt;/em&gt;. i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[:ascii:]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you just have &lt;code&gt;[:ascii:]&lt;/code&gt; then you're saying &quot;any one of &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;s&lt;/code&gt;, &lt;code&gt;c&lt;/code&gt;, or &lt;code&gt;i&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's probably not quite what you want either, though -- &lt;code&gt;)&lt;/code&gt; is an ascii character, after all, so (depending on your input) you run the risk of the closing paren getting swallowed in the &lt;code&gt;[[:ascii:]]+&lt;/code&gt; pattern. (e.g. if there was a subsequent closing paren on the same line.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you simply want to match everything until the first closing parenthesis, you would use a &lt;em&gt;non-greedy&lt;/em&gt; operator, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(\([[:ascii:]]+?\))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or if you know that it's safe to grab &lt;em&gt;whatever&lt;/em&gt; is between the parens, you could more simply write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(\(.+?\))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or perhaps you want &lt;code&gt;(\([^']+?\)'?)&lt;/code&gt; ? (I've become a little unsure of the criteria after re-reading the question... if you want to replace only the &lt;em&gt;exact&lt;/em&gt; two strings you've indicated, a non-regexp replace probably makes more sense...)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-07-31T06:03:46.850" LastActivityDate="2015-07-31T06:03:46.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14374" PostTypeId="1" AcceptedAnswerId="17037" CreationDate="2015-07-31T09:13:00.903" Score="4" ViewCount="229" Body="&lt;p&gt;As far as I remember, verbose log in Magit 1.x was on &lt;code&gt;lL&lt;/code&gt;. However, in Magit 2 &lt;code&gt;lL&lt;/code&gt; does something different altogether. I know it is possible to activate verbosity by toggling &lt;code&gt;--stat&lt;/code&gt; or &lt;code&gt;--patch&lt;/code&gt; options. However, that's not quite what I need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to generate verbose log, but without any diff details?&lt;/p&gt;&#xA;" OwnerDisplayName="user8782" LastActivityDate="2015-10-01T00:04:38.883" Title="Verbose log in Magit" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14375" PostTypeId="1" CreationDate="2015-07-31T09:28:03.020" Score="1" ViewCount="90" Body="&lt;p&gt;In emacs is there a function that I can invoke to add a docstring template based on the current major mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm working on javascript, insert a javascript docstring template &quot;here&quot;, like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;/**&#xA; * Docstring&#xA; * &#xA; */&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm working on python, insert a python docstring template &quot;here&quot;, like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;&quot;&quot;Docstring&quot;&quot;&quot;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5485" LastActivityDate="2015-07-31T09:28:03.020" Title="Is there an existing function to add docstrings, relevant to the current major mode?" Tags="|major-mode|doc-strings|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14376" PostTypeId="2" ParentId="14354" CreationDate="2015-07-31T09:58:34.667" Score="15" Body="&lt;p&gt;The easiest way to debug an Emacs crash is to start Emacs under &lt;code&gt;gdb&lt;/code&gt;, and then do whatever thing it is that reproduces the crash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you're building your Emacs from source, you should pass &lt;code&gt;CFLAGS=&quot;-O0 -g3&quot;&lt;/code&gt; to the &lt;code&gt;./configure&lt;/code&gt; script. This makes the C compiler turn off optimisations (which can make things confusing while debugging) and activates maximum debug information in the executable.  Run &lt;code&gt;make&lt;/code&gt; to build Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, start &lt;code&gt;gdb&lt;/code&gt; from within the &lt;code&gt;src&lt;/code&gt; directory of your Emacs tree:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cd ~/my-emacs-tree/src&#xA;$ gdb ./emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On OSX, you'll want to pass &lt;code&gt;--with-ns&lt;/code&gt; to the &lt;code&gt;./configure&lt;/code&gt; script and start gdb on the Emacs inside the created application:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cd ~/my-emacs-tree&#xA;$ make install&#xA;$ cd src&#xA;$ gdb nextstep/Emacs.app/Contents/MacOS/Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason to start from the &lt;code&gt;src&lt;/code&gt; directory is that there is a &lt;code&gt;.gdbinit&lt;/code&gt; file that sets up useful GDB function definitions for debugging Emacs.  If that file was loaded, you should see something like this when starting &lt;code&gt;gdb&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DISPLAY = /private/tmp/com.apple.launchd.cNjhIdtUNd/org.macosforge.xquartz:0&#xA;TERM = xterm-256color&#xA;Breakpoint 1 at 0x1000ca444: file ../../src/emacs.c, line 353.&#xA;Breakpoint 2 at 0x1000e7e34: file ../../src/sysdep.c, line 926.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;r&lt;/code&gt; to start Emacs.  You can pass extra arguments on the same line, e.g. &lt;code&gt;r --debug-init&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then try to make Emacs crash.  If it crashes, you should see a note about it in &lt;code&gt;gdb&lt;/code&gt;, and you'll be left at the &lt;code&gt;(gdb)&lt;/code&gt; prompt again.  If Emacs doesn't crash, but freezes, you can hit &lt;code&gt;C-z&lt;/code&gt; in the terminal where you're running &lt;code&gt;gdb&lt;/code&gt; to get back to the prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once at the prompt, type &lt;code&gt;bt&lt;/code&gt; to get a backtrace. As a bonus, if the Emacs &lt;code&gt;.gdbinit&lt;/code&gt; file was correctly loaded, you'll see a Lisp backtrace after the C backtrace.  Both backtraces are very useful things to include in &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There is much more information, including how to examine the state of variables etc, in the &lt;code&gt;etc/DEBUG&lt;/code&gt; file in the Emacs tree.  You can open it by typing &lt;code&gt;C-h C-d&lt;/code&gt; inside Emacs, or you can &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/DEBUG&quot;&gt;read it online&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="11" LastEditDate="2015-07-31T13:28:02.617" LastActivityDate="2015-07-31T13:28:02.617" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14377" PostTypeId="2" ParentId="14350" CreationDate="2015-07-31T13:32:47.810" Score="3" Body="&lt;p&gt;The command won't be placed into your command history until after it is run, and since the command kills emacs, that never happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can counter this by killing emacs only after the command has ran and the call stack clears by running &lt;code&gt;kill-emacs&lt;/code&gt; on a 0 second timer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The call to &lt;code&gt;(kill-emacs)&lt;/code&gt; would then be replaced with this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(run-with-timer 0 nil (lambda () (kill-emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-07-31T13:32:47.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14378" PostTypeId="1" CreationDate="2015-07-31T13:35:44.940" Score="1" ViewCount="27" Body="&lt;p&gt;How can i copy the absolute path of the current open buffer to the system clipboard &lt;code&gt;(i.e. ctrl + shift + v) and not (ctrl + y)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many solutions available for such copy, &lt;a href=&quot;http://emacsredux.com/blog/2013/03/27/copy-filename-to-the-clipboard/&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/questions/3669511/the-function-to-show-current-files-full-path-in-mini-buffer&quot;&gt;2&lt;/a&gt; but all of them doesn't work outside the emacs application.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-07-31T13:51:29.290" Title="Copy buffer absolute file path to the system clipboard" Tags="|kill-ring|" AnswerCount="0" CommentCount="4" ClosedDate="2015-07-31T15:28:12.840" ContentLicense="CC BY-SA 3.0" />
  <row Id="14380" PostTypeId="2" ParentId="14350" CreationDate="2015-07-31T13:51:51.210" Score="1" Body="&lt;p&gt;An alternate solution is to move &lt;code&gt;kill-emacs&lt;/code&gt; to seperate function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun stop-emacs ()&#xA;  (kill-emacs))&#xA;&#xA;(defun restart-emacs ()&#xA;  (interactive)&#xA;  (add-hook 'kill-emacs-hook&#xA;            (if (display-graphic-p)&#xA;                #'launch-separate-emacs-under-x&#xA;              #'launch-separate-emacs-in-terminal)&#xA;            t)&#xA;  (stop-emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-07-31T13:51:51.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14381" PostTypeId="2" ParentId="14367" CreationDate="2015-07-31T15:18:04.450" Score="3" Body="&#xA;&#xA;&lt;p&gt;Here is a variation of your implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-do-stuff ()&#xA;  (interactive)&#xA;  (let ((cmd &quot;your cmd here&quot;)&#xA;        (temp-buf-name &quot;*stuffed*&quot;))&#xA;    ;; Create a buffer `temp-buf-name' and run the shell command in it&#xA;    (get-buffer-create temp-buf-name)&#xA;    (let ((message-log-max nil)) ; Don't clutter *Messages* buffer (optional)&#xA;      (shell-command cmd temp-buf-name))&#xA;    ;; Switch to the `temp-buf-name' buffer&#xA;    (switch-to-buffer-other-window temp-buf-name)&#xA;    ;; Set its major mode to `special-mode'&#xA;    (special-mode) ; a read-only major mode&#xA;    ;; As you are now in the `temp-buf-name' buffer, you can do the below:&#xA;    ;; - hit `q' to quit the current window *without* killing `temp-buf-name'&#xA;    ;; - hit `C-u q' to quit the current window *and* kill `temp-buf-name'&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;special-mode-map&lt;/code&gt; default bindings are defined in &lt;code&gt;simple.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar special-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (suppress-keymap map)&#xA;    (define-key map &quot;q&quot; 'quit-window)&#xA;    (define-key map &quot; &quot; 'scroll-up-command)&#xA;    (define-key map [?\S-\ ] 'scroll-down-command)&#xA;    (define-key map &quot;\C-?&quot; 'scroll-down-command)&#xA;    (define-key map &quot;?&quot; 'describe-mode)&#xA;    (define-key map &quot;h&quot; 'describe-mode)&#xA;    (define-key map &quot;&amp;gt;&quot; 'end-of-buffer)&#xA;    (define-key map &quot;&amp;lt;&quot; 'beginning-of-buffer)&#xA;    (define-key map &quot;g&quot; 'revert-buffer)&#xA;    map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-07-31T15:23:39.553" LastActivityDate="2015-07-31T15:23:39.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14382" PostTypeId="1" AcceptedAnswerId="14397" CreationDate="2015-07-31T15:42:49.577" Score="6" ViewCount="1263" Body="&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/questions/13724/make-doc-view-use-mupdf-for-pdf-files&quot;&gt;this solution&lt;/a&gt; for changing the resolution in DocView.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see anything like this for pdf-tools. How can I increase the resolution like &lt;code&gt;doc-view-resolution&lt;/code&gt; variable would?&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-08-01T16:41:42.633" Title="Changing resolution in pdf-tools PDFView" Tags="|pdf|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14383" PostTypeId="1" CreationDate="2015-07-31T03:38:06.083" Score="1" ViewCount="33" Body="&lt;p&gt;I have some elisp code in my ~/.emacs which sets a variable for the default font:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((myfont &quot;Ubuntu Mono-13&quot;))&#xA;  (unless (member myfont (font-family-list))&#xA;    (setq myfont &quot;DejaVu Sans Mono-13&quot;))&#xA;  (add-to-list 'default-frame-list '(font . myfont))&#xA;  (set-face-attribute 'default nil :font myfont))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;however I'm having a hard time constructing the string which is the last parameter of the call to (add-to-list) such that the variable 'myfont' is evaluated. Instead of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(font . myfont)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to send:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(font . &quot;Ubuntu Mono-13&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(font . &quot;DejaVu Sans Mono-13&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried various things with (car), (cdr), and (concat) to no avail.&lt;/p&gt;&#xA;" OwnerUserId="12079" OwnerDisplayName="nrvale0" LastActivityDate="2015-07-31T19:17:07.557" Title="String composition in elisp" Tags="|fonts|" AnswerCount="0" CommentCount="2" ClosedDate="2015-08-01T16:39:24.770" ContentLicense="CC BY-SA 3.0" />
  <row Id="14384" PostTypeId="1" CreationDate="2015-07-31T19:43:27.380" Score="6" ViewCount="1407" Body="&lt;p&gt;&lt;code&gt;C-j&lt;/code&gt; used to newline-and-indent, now it doesn't indent anymore, but &lt;code&gt;RET&lt;/code&gt; does. Now since I upgraded to Emacs 24 they are swapped. Is there any way to revert this?&lt;/p&gt;&#xA;" OwnerUserId="9062" LastActivityDate="2015-07-31T21:19:30.663" Title="How to make C-j and return behave like they did pre Emacs 24" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ClosedDate="2019-01-14T07:08:11.843" ContentLicense="CC BY-SA 3.0" />
  <row Id="14385" PostTypeId="1" CreationDate="2015-07-31T19:52:05.523" Score="2" ViewCount="166" Body="&lt;p&gt;When I insert the character &lt;code&gt;ل&lt;/code&gt; (the Arabic letter Lam) followed by &lt;code&gt;ا&lt;/code&gt; (the Arabic letter Alef) the result would be &lt;code&gt;لا&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other text editors when I have the word &lt;code&gt;لا&lt;/code&gt; I can mark (select) each of its characters, for example in the current box that I write this message (in Mozilla Firefox) I can mark (select) &lt;code&gt;ل&lt;/code&gt; in the word &lt;code&gt;لا&lt;/code&gt; as shown in the following image &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2SeEI.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2SeEI.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can also mark (select ) &lt;code&gt;ا&lt;/code&gt; in the word &lt;code&gt;لا&lt;/code&gt; as shown in the below image &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/O3YeR.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O3YeR.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in Emacs I am not able to mark (select) the letters &lt;code&gt;ل&lt;/code&gt; and &lt;code&gt;ا&lt;/code&gt; in the word &lt;code&gt;لا&lt;/code&gt; individually. In fact for a reason that I do not understand the word &lt;code&gt;لا&lt;/code&gt; is considered as an entire block (like a character but not exactly) and either both letters are selected or no letter is selected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if this is a bug or an intentional behavior and if there is way which allows to select these letters individually like in many other editors.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-02T15:54:26.657" LastActivityDate="2015-08-02T15:54:26.657" Title="Composition of the Arabic letters Lam and Alef in Emacs" Tags="|microsoft-windows|characters|bidirectional-support|" AnswerCount="0" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="14386" PostTypeId="1" CreationDate="2015-07-31T20:07:16.297" Score="5" ViewCount="415" Body="&lt;p&gt;I'm not sure how to describe this. In vimdiff I remember that if one of the buffers had added a line, the other buffer showed lines at that same vertical location to show where they were added. I found a picture that shows what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.ytimg.com/vi/hb5RVnOda2o/maxresdefault.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.ytimg.com/vi/hb5RVnOda2o/maxresdefault.jpg&quot; alt=&quot;vimdiff&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, in ediff the space is not taken up on the left buffer, instead there's a single character highlighted in that buffer as shown below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/f5nKL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/f5nKL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Above picture is cropped from &lt;a href=&quot;https://i.stack.imgur.com/yISBA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps I'll get used to this way of showing things, but in any case I'm curious if it's possible to configure ediff to show things like vimdiff does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: To anyone who's interested, it seems there's a package that emulates this now: &lt;a href=&quot;https://github.com/justbur/emacs-vdiff&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/justbur/emacs-vdiff&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="8941" LastEditDate="2020-03-19T20:59:37.847" LastActivityDate="2020-03-19T20:59:37.847" Title="ediff show empty lines" Tags="|ediff|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="14387" PostTypeId="1" AcceptedAnswerId="14389" CreationDate="2015-07-31T20:39:09.720" Score="1" ViewCount="280" Body="&lt;p&gt;I have a remote server I log in to from the command line using either:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh 'GROUP\user'@host.edu &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh GROUP\\user@host.edu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it works fine; I've even set up my SSH keys. But I can't figure out how to get this to work with tramp, as the &quot;\&quot; gets sanitized. I've tried using quotes and/or escape slashes, but those don't make it through either. Any solutions? &lt;/p&gt;&#xA;" OwnerUserId="8389" LastActivityDate="2018-03-10T22:29:09.780" Title="Tramp remote login with a \ qualified username (escape problems)" Tags="|tramp|ssh|remote|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14388" PostTypeId="2" ParentId="14384" CreationDate="2015-07-31T21:19:30.663" Score="3" Body="&lt;p&gt;You can simply bind the keys to the functions you want, by adding this code to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-j&quot;) #'newline-and-indent)&#xA;(global-set-key (kbd &quot;&amp;lt;return&amp;gt;&quot;) #'newline)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might want a different function for &lt;code&gt;return&lt;/code&gt;, depending on your desired behavior.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-07-31T21:19:30.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14389" PostTypeId="2" ParentId="14387" CreationDate="2015-07-31T21:55:35.120" Score="1" Body="&lt;p&gt;I found the solution by using ssh_config, which allows you to bypass all concern about escaping; you just enter your login name in your ~/.ssh/config file and tramp will respect it. I posted full details here: &lt;a href=&quot;http://www.toryanderson.com/tech/escaped-log-ins-tramp&quot; rel=&quot;nofollow&quot;&gt;http://www.toryanderson.com/tech/escaped-log-ins-tramp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8389" LastActivityDate="2015-07-31T21:55:35.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14390" PostTypeId="2" ParentId="14336" CreationDate="2015-07-31T22:37:06.470" Score="2" Body="&lt;p&gt;You say:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;Recently I have installed the packages isearch+ when I remove the line &lt;code&gt;(require 'isearch+)&lt;/code&gt; from my init file, the problem is solved.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;@kaushalmodi said:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Search for what &lt;code&gt;C-y&lt;/code&gt; is bound to in the &lt;code&gt;isearch-mode-map&lt;/code&gt; by isearch+.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Check that package's documentation in its header; by design you need to hit &lt;code&gt;C-y C-y&lt;/code&gt; to do the usual yank:&lt;/p&gt;&#xA;&lt;p&gt;;; &lt;code&gt;C-y C-y&lt;/code&gt; &lt;code&gt;isearch-yank-kill&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;By default, &lt;code&gt;C-y&lt;/code&gt; is a prefix key in &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt;. There are multiple yank commands, all bound to keys on prefix &lt;code&gt;C-y&lt;/code&gt;. &lt;code&gt;C-y C-y&lt;/code&gt; is bound by default to &lt;code&gt;isearch-yank-kill&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can of course bind any key you like (in &lt;code&gt;isearch-mode-map&lt;/code&gt;) to any Isearch command, including to &lt;code&gt;isearch-yank-kill&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key isearch-mode-map (kbd &amp;quot;WHATEVER&amp;quot;) 'isearch-yank-kill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;FYI -- You can not only get this info from the &lt;a href=&quot;http://www.emacswiki.org/emacs/download/isearch%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;isearch+.el&lt;/strong&gt;&lt;/a&gt; library file header, as @kaushalmodi pointed out. You can also use &lt;code&gt;C-s C-h&lt;/code&gt; to see all bindings in the Isearch-mode keymap. And if you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/help-fns%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;help-fns+.el&lt;/strong&gt;&lt;/a&gt; then you can also use &lt;code&gt;C-h M-k isearch-mode-map&lt;/code&gt; to see a human-readable description of all of the keys and their commands.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-07-31T22:37:06.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14391" PostTypeId="1" CreationDate="2015-07-31T23:29:21.487" Score="1" ViewCount="334" Body="&lt;p&gt;About 2 weeks ago my package.el broken and I am not able to install/remove/update packages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flow: M-x package-list-packages, I mark package for installation or deletion (I or D appears next to package name), press 'r', in minibuffer Connection host: elpa/melpa/org appears and then the last repository in my package-archives hangs there, I or D dissapears from package name and nothing happens, package is not installed/removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Package-related stuff in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried basically anything, emacs -Q, google, ask in freenode #emacs, no help. Only similar thing I found was this 3 years old issue &lt;a href=&quot;https://github.com/dimitri/el-get/issues/698&quot; rel=&quot;nofollow&quot;&gt;https://github.com/dimitri/el-get/issues/698&lt;/a&gt; which kinda seems like whats happening to me, but no mouse movement helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW: I can install packages with package-install without any problem and my package-archives is correct.&lt;/p&gt;&#xA;" OwnerUserId="8918" LastActivityDate="2015-08-01T06:45:07.917" Title="My package.el is broken" Tags="|package|package-repositories|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14392" PostTypeId="1" AcceptedAnswerId="14393" CreationDate="2015-08-01T00:30:50.983" Score="9" ViewCount="1566" Body="&lt;p&gt;I want to write a function (or use an existing one) that will take any string and produce a correctly escaped Regex that matches only that string. What is the fastest and simplest way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-02T14:53:45.327" Title="Regex match literal string" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14393" PostTypeId="2" ParentId="14392" CreationDate="2015-08-01T00:38:53.583" Score="9" Body="&lt;p&gt;You are looking for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Functions.html#Regexp-Functions&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;regexp-quote&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function returns a regular expression whose only exact match is string. Using this regular expression in looking-at will succeed only if the next characters in the buffer are string; using it in a search function will succeed if the text being searched contains string.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This allows you to request an exact string match or search when calling a function that wants a regular expression. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2015-08-02T14:53:45.327" LastActivityDate="2015-08-02T14:53:45.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14394" PostTypeId="1" AcceptedAnswerId="18430" CreationDate="2015-08-01T04:45:22.007" Score="6" ViewCount="677" Body="&lt;p&gt;Is there a way to show the results of a Source Block horizontally, or equivalently to transpose an org-table?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :results table&#xA;c('a','b','c')&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| a |&#xA;| b |&#xA;| c |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have discovered I can fix this by returning a list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :results table&#xA;as.list(c('a','b','c'))&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| a | b | c |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it would be preferable if I could do it without changing the source code.&lt;/p&gt;&#xA;" OwnerUserId="9066" LastActivityDate="2015-12-19T17:17:19.270" Title="Display org-mode src R results horizontally" Tags="|org-mode|org-babel|org-table|r|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14395" PostTypeId="2" ParentId="14391" CreationDate="2015-08-01T06:45:07.917" Score="1" Body="&lt;p&gt;If I were you, I would backup my .emacs and move it. Then re-open Emacs and try to install a package. If that succeeds, then I would methodically reinstate bits of my .emacs until I find the culprit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/yurrriq/dotfiles/tree/emacs&quot; rel=&quot;nofollow&quot;&gt;My config&lt;/a&gt; is (increasingly) organized into files separated by package/area of concern. That way, it's MUCH easier to isolate and resolve issues like yours. &lt;a href=&quot;https://github.com/purcell/emacs.d&quot; rel=&quot;nofollow&quot;&gt;Steve Purcell's .emacs.d&lt;/a&gt; is a great resource for organizational style and tricks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a &quot;clean&quot; Emacs (without your current .emacs) is still unable to install a package, then I would reinstall Emacs entirely as clearly you've got bigger issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="8797" LastActivityDate="2015-08-01T06:45:07.917" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14396" PostTypeId="2" ParentId="14394" CreationDate="2015-08-01T11:29:24.937" Score="6" Body="&lt;p&gt;There is a function called &lt;code&gt;org-table-transpose-table-at-point&lt;/code&gt; which can be used to transpose table at cursor.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastActivityDate="2015-08-01T11:29:24.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14397" PostTypeId="2" ParentId="14382" CreationDate="2015-08-01T14:24:22.313" Score="1" Body="&lt;p&gt;It is not possible to change resolution in pdf-tools. As far as I know in poppler all PDF objects are vector-based, i.e. can be, and are, rendered arbitrary large.&lt;/p&gt;&#xA;" OwnerUserId="5202" LastEditorUserId="5202" LastEditDate="2015-08-01T16:41:42.633" LastActivityDate="2015-08-01T16:41:42.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14398" PostTypeId="1" CreationDate="2015-08-01T14:57:30.180" Score="1" ViewCount="134" Body="&lt;p&gt;Org mode provides a variable called &lt;code&gt;org-entities&lt;/code&gt; that contain replacements for latex symbols like &lt;code&gt;\alpha, \beta&lt;/code&gt; etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org also provides a minor called &lt;code&gt;orgtbl-mode&lt;/code&gt; which allows text that starts with a &lt;code&gt;|&lt;/code&gt; in arbitrary major modes to be interpreted as an org table and then I can do calculations and alignment. I have found this to be a very useful feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However &lt;code&gt;orgtbl&lt;/code&gt;doesn't seem to use &lt;code&gt;org-entities&lt;/code&gt; when I am using it while documenting some math heavy python code. For example I have a function with some detailed logic that I need to program and it would be helpful to get the same kind of feedback while writing my code's documentation that I get in a org buffer. Please let me know how I can achieve this effect. Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a small table fragment that orgmode renders automatically that contains some &quot;business logic&quot; that I need to code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name      | Symm      | Remarks               |&#xA;| \equiv    | \check    | x = y                 |&#xA;| \neg      |           | x \cap y = \phi \land x \cup y = D |&#xA;| \perp     | \check    | (else)                |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6589" LastEditorUserId="6589" LastEditDate="2015-08-01T18:26:18.047" LastActivityDate="2015-08-01T18:26:18.047" Title="How to make orgtbl-mode use org-entities in other major modes?" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14399" PostTypeId="1" CreationDate="2015-08-01T19:19:44.513" Score="3" ViewCount="1468" Body="&lt;p&gt;Is there a solution to highlight current line and column where the cursor is now?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;a href=&quot;http://www.emacswiki.org/emacs/CrosshairHighlighting&quot; rel=&quot;nofollow&quot;&gt;this plugin&lt;/a&gt;, but then emacs motion are lagging like hell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to highlight the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-hl-line-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9070" LastActivityDate="2023-12-15T08:06:10.713" Title="Highlight current line and column" Tags="|cursor|highlighting|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="14400" PostTypeId="1" CreationDate="2015-08-01T19:24:55.610" Score="0" ViewCount="237" Body="&lt;p&gt;Is there a solution to create and manage window/buffer tabs on a single one-line tabs bar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;a href=&quot;http://wikemacs.org/wiki/Elscreen&quot; rel=&quot;nofollow&quot;&gt;Elscreen&lt;/a&gt;, but it creates an annoying bars all over the buffers.&lt;/p&gt;&#xA;" OwnerUserId="9070" LastEditorUserId="105" LastEditDate="2015-08-01T19:57:43.130" LastActivityDate="2015-08-01T19:57:43.130" Title="Tabs bar (for accessing windows/buffers) as a single, one-line bar" Tags="|window|elscreen|tabbar|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14401" PostTypeId="1" CreationDate="2015-08-01T19:30:44.800" Score="0" ViewCount="126" Body="&lt;p&gt;Is there a solution to have last visited buffers in a single one-line bar?&#xA;That I can see my last, lets say, five buffers all the time and press &lt;code&gt;M-1&lt;/code&gt;, &lt;code&gt;M-2&lt;/code&gt;, .. to switch to them fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacswiki.org/emacs/TabBarMode&quot; rel=&quot;nofollow&quot;&gt;The TabBarMode plugin&lt;/a&gt; is something I tried, but it spawns the bar in every buffer, and do not sort buffers in the necessary order.&lt;/p&gt;&#xA;" OwnerUserId="9070" LastActivityDate="2015-08-01T19:30:44.800" Title="Recent buffers bar" Tags="|buffers|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14402" PostTypeId="1" CreationDate="2015-08-01T20:19:32.913" Score="0" ViewCount="89" Body="&lt;p&gt;I'm pretty new to emacs (was using Vim), primarily using it for Ruby on Rails projects. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At my free time, I like to write some C code for STM32 micro-controllers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike RoR project, C project for STM32 contains a lot of external dependencies (includes) outside of project's folder, and there is as good reference documentation, so I have to read source codes a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I would like to do &lt;code&gt;C-c p h&lt;/code&gt; and find any random file including external dependencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand, that this task is more complex, than just writing &lt;code&gt;t&lt;/code&gt; some variable, but I can't even realize, where can I start the research. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another problem, that I don't want to hardcode dependencies list into my &lt;code&gt;~/.emacs.d&lt;/code&gt;, it should be project-specific settings.&lt;/p&gt;&#xA;" OwnerUserId="9071" LastActivityDate="2015-08-01T20:19:32.913" Title="Make Helm Projectile to show external sources" Tags="|helm|projectile|cc-mode|c|project|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14403" PostTypeId="1" CreationDate="2015-08-01T20:44:44.523" Score="7" ViewCount="4251" Body="&lt;p&gt;I'm using Emacs to write code samples that I later want to be able to paste into a MS-Word document, preserving the syntax highlighting. I understand that in order to do this I need to copy the text in either RTF or HTML format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm just killing from Emacs into &lt;a href=&quot;http://www.tohtml.com&quot;&gt;http://www.tohtml.com&lt;/a&gt; and then copying from there and pasting into Word. It strikes me that someone, somewhere has probably written some Lisp to make this process at least a couple of keystrokes shorter, but I can't seem to find any existing solution or anything in the docs that suggests this is even possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm keen to know if there is a ready made solution I can include in my config or if anyone has any pointers about how I could write something to achieve this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm fairly new to Emacs, loving it, but my e-Lisp is currently very basic. &lt;/p&gt;&#xA;" OwnerUserId="9073" LastActivityDate="2019-03-19T15:39:58.370" Title="How can I copy syntax highlighted code as RTF or HTML?" Tags="|copy-paste|kill-ring|yank|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14405" PostTypeId="2" ParentId="14403" CreationDate="2015-08-01T21:36:35.727" Score="6" Body="&lt;p&gt;The &lt;code&gt;htmlize&lt;/code&gt; package can do this.  Install it with &lt;code&gt;M-x package-install htmlize&lt;/code&gt; and you get access to the commands &lt;code&gt;htmlize-region&lt;/code&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(htmlize-region BEG END)&lt;/p&gt;&#xA;&lt;p&gt;Convert the region to HTML, preserving colors and decorations.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;and &lt;code&gt;htmlize-region-for-paste&lt;/code&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(htmlize-region-for-paste BEG END)&lt;/p&gt;&#xA;&lt;p&gt;Htmlize the region and return just the HTML as a string.&#xA;This forces the ‘inline-css’ style and only returns the HTML body,&#xA;but without the BODY tag.  This should make it useful for inserting&#xA;the text to another HTML buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-01T21:36:35.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14406" PostTypeId="2" ParentId="14403" CreationDate="2015-08-01T21:56:09.880" Score="6" Body="&lt;p&gt;The package &lt;a href=&quot;https://github.com/Lindydancer/highlight2clipboard&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Lindydancer/highlight2clipboard&lt;/a&gt; does exactly what you asked for. It use &lt;code&gt;htmlize&lt;/code&gt; to create a HTML version of the text which it adds as an alternative paste text. (&lt;em&gt;Note:&lt;/em&gt; This is a non-trivial operation which requires interfacing with the clipboard. This is operating system specific, currently OS X and MS-Windows are supported.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When pasting into applications like MS-Word, the syntax highlighting is retained.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-08-07T16:02:41.687" LastActivityDate="2015-08-07T16:02:41.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14407" PostTypeId="1" AcceptedAnswerId="14408" CreationDate="2015-08-02T11:03:19.500" Score="2" ViewCount="1344" Body="&lt;p&gt;One can find &lt;a href=&quot;http://emacswiki.org/emacs/DuplicateLines&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; various ways to remove all duplicate lines in Emacs by preserving the first occurrence. Also &lt;a href=&quot;http://emacsredux.com/blog/2014/03/01/a-peek-at-emacs-24-dot-4-delete-duplicate-lines/&quot; rel=&quot;nofollow&quot;&gt;Emacs 24.4 introduces the command &lt;code&gt;delete-duplicate-lines&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if there is a similar way to to delete all duplicate words by preserving the first occurrence of each words.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-02T11:08:38.857" LastActivityDate="2015-08-02T16:07:23.250" Title="How to remove the duplicate words in Emacs?" Tags="|elisp|words|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14408" PostTypeId="2" ParentId="14407" CreationDate="2015-08-02T16:07:23.250" Score="3" Body="&lt;p&gt;The following command (minimally-tested) will collect all of the words in the buffer and display the unique ones (ignoring case) in a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun show-unique-words (&amp;amp;optional alphabetical)&#xA;  &quot;Collect all of the unique words in the current buffer and&#xA;display them in a new buffer.  With prefix, alphabetize the&#xA;list.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((buf (buffer-name))&#xA;        (new (get-buffer-create &quot;*Unique Words*&quot;))&#xA;        (txt (delete-dups (mapcar #'downcase&#xA;                                  (split-string (buffer-string)&#xA;                                                nil nil&#xA;                                                &quot;[^[:alnum:]]+&quot;)))))&#xA;    (with-current-buffer new&#xA;      (delete-region (point-min) (point-max))&#xA;      (insert (format &quot;%d unique words in the &amp;lt;%s&amp;gt; buffer:\n\n&quot;&#xA;                      (length txt) buf))&#xA;      (cl-dolist (word (if alphabetical (sort txt #'string&amp;lt;) txt))&#xA;        (insert (concat word &quot;\n&quot;))))&#xA;    (pop-to-buffer new)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-02T16:07:23.250" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14409" PostTypeId="2" ParentId="12858" CreationDate="2015-08-02T19:04:13.343" Score="1" Body="&#xA;&#xA;&lt;p&gt;The following mostly works, though &lt;code&gt;C-SPC&lt;/code&gt; (&lt;code&gt;set-mark-command&lt;/code&gt;) no longer activates the region. Probably you won't care if you like shift-selecting because &lt;code&gt;set-mark-command&lt;/code&gt; doesn't really mesh conceptually with shift-selection anyway. Otherwise you can add a check for it with &lt;code&gt;(eq this-command 'set-mark-command)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun simulate-shift-selection ()&#xA;  (unless (and mark-active&#xA;               (eq (car-safe transient-mark-mode) 'only))&#xA;    (setq transient-mark-mode&#xA;          (cons 'only&#xA;                (unless (eq transient-mark-mode 'lambda)&#xA;                  transient-mark-mode)))&#xA;    ;;(push-mark nil nil t)&#xA;    ))&#xA;&#xA;(add-hook 'activate-mark-hook #'simulate-shift-selection)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-08-02T19:04:13.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14410" PostTypeId="2" ParentId="14278" CreationDate="2015-08-02T20:00:24.170" Score="0" Body="&lt;p&gt;Here is how I ended up doing. We can define a function as below and load it in emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun string-for-latex-labels (string)&#xA;  &quot;format automatic labels for latex environment to use with snippet&quot;&#xA;  (setq string  (replace-regexp-in-string &quot;[[:punct:]]&quot; &quot;-&quot; string))&#xA;  (setq string  (replace-regexp-in-string &quot;[[:space:]]&quot; &quot;-&quot; string))&#xA;  (setq string  (replace-regexp-in-string &quot;-+&quot; &quot;-&quot; string))&#xA;  (setq string  (replace-regexp-in-string &quot;^-&quot; &quot;&quot; string))&#xA;  (setq string  (replace-regexp-in-string &quot;-$&quot; &quot;&quot; string))&#xA;  (setq string  (downcase string))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then we can just define a snippet as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: theorem&#xA;# key: theorem&#xA;# --&#xA;\begin\{theorem\}[$1]&#xA;\label{thm-${2:${1:$(string-for-latex-labels yas-text)}}}&#xA;$0&#xA;\end\{theorem\}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4052" LastEditorUserId="4052" LastEditDate="2015-08-04T13:22:25.147" LastActivityDate="2015-08-04T13:22:25.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14411" PostTypeId="1" AcceptedAnswerId="14412" CreationDate="2015-08-02T21:43:13.623" Score="1" ViewCount="126" Body="&lt;p&gt;I'm trying to write some buffer switching function (which in itself may be a fool's errand, but I digress...) - and it looks a little like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun swk--quit-buffer (original-buffer)&#xA;  (switch-to-buffer (original-buffer))&#xA;  (kill-buffer &quot;*tmp*&quot;)&#xA;  (local-unset-key &quot;q&quot;))&#xA;&#xA;(defun swk-switcheroo ()&#xA;  (interactive)&#xA;  (let ((temp-buf-name &quot;*tmp*&quot;)&#xA;        (current-buffer-name (buffer-name)))&#xA;    (get-buffer-create temp-buf-name)&#xA;    (switch-to-buffer temp-buf-name)&#xA;    (local-set-key &quot;q&quot; (lambda ()&#xA;                         (interactive)&#xA;                         (swk--quit-buffer current-buffer-name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My aim is to be able to temporarily bind &quot;q&quot; to this window, to simulate special-mode's &quot;quittable&quot; buffer. Sure enough, the &quot;q&quot; key works once, but I get the message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's value as variable is void current-buffer-name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ideally, I want to replace the current buffer with the result of invoking swk-switcheroo - and then reinstate the original buffer when the user presses &quot;q&quot;.&lt;/p&gt;&#xA;" OwnerUserId="8990" LastEditorUserId="50" LastEditDate="2015-08-03T18:59:46.070" LastActivityDate="2015-08-03T18:59:46.070" Title="Cannot assign current buffer name in let statement" Tags="|buffers|variables|lexical-scoping|let-binding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14412" PostTypeId="2" ParentId="14411" CreationDate="2015-08-02T22:07:28.630" Score="4" Body="&lt;p&gt;You're tripping over dynamic binding (as opposed to lexical binding).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &lt;code&gt;current-buffer-name&lt;/code&gt; is unbound at the point that your (lambda) function is executed. The &lt;code&gt;let&lt;/code&gt; expression only binds it during the function's &lt;em&gt;definition&lt;/em&gt; -- there's no closure to capture that value for subsequent evaluation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One simple workaround is to use backquoting like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;`(lambda ()&#xA;   (interactive)&#xA;   (swk--quit-buffer ',current-buffer-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="25" LastEditDate="2015-08-03T08:14:51.533" LastActivityDate="2015-08-03T08:14:51.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14413" PostTypeId="1" CreationDate="2015-08-02T23:40:31.737" Score="7" ViewCount="9837" Body="&lt;p&gt;I want to be able to output nicely formatted math code. So I decided to learn latex and maxima (and use all that in org-mode).&lt;/p&gt;&#xA;&lt;p&gt;That's when I came across this tutorial &lt;a href=&quot;http://maxima.sourceforge.net/contrib/maxiplot/maxiplot_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://maxima.sourceforge.net/contrib/maxiplot/maxiplot_en.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;And there, I found this program in section 3.2.1:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;\usepackage{amsmath}&#xA;\usepackage[amsmath]{maxiplot}&#xA;\[   %Math mode begin&#xA;\begin{maxima}&#xA;f: x/(x^3-3*x+2),     /* Integrating it */&#xA;tex('integrate(f,x)), /* will show its integral... */&#xA;print(&amp;quot;=&amp;quot;),&#xA;tex(integrate(f,x)),  /* ...and the result */&#xA;print(&amp;quot;+K&amp;quot;)&#xA;\end{maxima}&#xA;\]   %Math mode end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I tried to execute it, in an org-buffer, by pressing &lt;code&gt;C-c C-x \&lt;/code&gt;. But I see no results. The polynomial &lt;code&gt;f: x/(x^3-3*x+2)&lt;/code&gt; gets pretty-printed and that's all. But there's not output like anything in the PDF file; a nice integral and so on.&lt;/p&gt;&#xA;&lt;p&gt;I tried &lt;code&gt;C-c C-x C-l&lt;/code&gt; too and the image is blank.&lt;/p&gt;&#xA;&lt;p&gt;Can anyone tell me, how do I show the output of this latex/maxima program in the org-buffer?&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="17852" LastEditDate="2022-01-24T15:01:36.820" LastActivityDate="2022-01-25T21:20:54.773" Title="How to embed latex in org-mode" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="14415" PostTypeId="2" ParentId="14413" CreationDate="2015-08-03T00:43:54.153" Score="8" Body="&lt;p&gt;&lt;code&gt;\usepackage&lt;/code&gt; commands go in the latex preamble, not the document body. You can add these commands with:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER_EXTRA: \usepackage...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then you would add your LaTeX code inside of:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LATEX&#xA;\begin{maxima}&#xA;f: x/(x^3-3*x+2),     /* Integrating it */&#xA;tex('integrate(f,x)), /* will show its integral... */&#xA;print(&amp;quot;=&amp;quot;),&#xA;tex(integrate(f,x)),  /* ...and the result */&#xA;print(&amp;quot;+K&amp;quot;)&#xA;\end{maxima}&#xA;#+END_LATEX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;blocks.&lt;/p&gt;&#xA;&lt;p&gt;The above would only work when exported to PDF, not in Emacs buffers.&lt;/p&gt;&#xA;&lt;p&gt;EDIT: In more recent versions of Org mode (Org mode 9.0 or later) the syntax for export blocks has been changed: instead of &lt;code&gt;#+BEGIN_LATEX ... #+END_LATEX&lt;/code&gt;, you now have to say &lt;code&gt;#+BEGIN_EXPORT latex ... #+END_EXPORT&lt;/code&gt;. See &lt;a href=&quot;https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/etc/ORG-NEWS#n2665&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/etc/ORG-NEWS#n2665&lt;/a&gt; - although note that the line number is going to be obsolete as soon as the next release appears: it might be safer to search for &lt;code&gt;BEGIN_EXPORT&lt;/code&gt; on that page instead. Alternatively, you can (and should) take a look at the &lt;code&gt;ORG-NEWS&lt;/code&gt; file that is locally available, probably under &lt;code&gt;/usr/share/emacs&lt;/code&gt; or &lt;code&gt;/usr/local/share/emacs&lt;/code&gt;, assuming you use the Org mode that is distributed with Emacs. If you install your own, you presumably know where and can therefore find the &lt;code&gt;etc/ORG-NEWS&lt;/code&gt; file whereever you installed Org mode.&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="14825" LastEditDate="2022-01-25T21:20:54.773" LastActivityDate="2022-01-25T21:20:54.773" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="14416" PostTypeId="1" AcceptedAnswerId="16639" CreationDate="2015-08-03T00:44:32.710" Score="2" ViewCount="210" Body="&lt;p&gt;Newbie Emacs org question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wanted to export my tasks into a CSV reading spreadsheet program. How would one do that? If it is in the manual, could please point me to it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;* A&#xA;** A1&#xA;   CLOCK: [2015-08-01 Sat 19:33]--[2015-08-01 Sat 19:33] =&gt;  0:00&#xA;* B&#xA;* C&#xA;** Ok something about C&#xA;   CLOCK: [2015-08-01 Sat 19:35]--[2015-08-01 Sat 19:36] =&gt;  0:01&#xA;&#xA;#+BEGIN: clocktable :maxlevel 2 :scope subtree&#xA;#+CAPTION: Clock summary at [2015-08-01 Sat 19:36]&#xA;| Headline                   | Time   |      |&#xA;|----------------------------+--------+------|&#xA;| *Total time*               | *0:01* |      |&#xA;|----------------------------+--------+------|&#xA;| \emsp Ok something about C |        | 0:01 |&#xA;#+END:&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="9079" LastActivityDate="2015-09-15T19:32:14.027" Title="how to convert emacs org outline with clock entries to csv file" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14417" PostTypeId="1" AcceptedAnswerId="14451" CreationDate="2015-08-03T00:59:59.130" Score="5" ViewCount="1101" Body="&lt;p&gt;If I have the following file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3&#xA;'''&#xA;bla.py&#xA;&#xA;Does this and&#xA;that_&#xA;'''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;..and call &lt;code&gt;fill-paragraph&lt;/code&gt; with the cusor at &lt;code&gt;_&lt;/code&gt;, then it acts on the entire docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3&#xA;'''bla.py&#xA;&#xA;Does this and that_&#xA;&#xA;'''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than just the second paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make it act on just the current paragraph, so that the result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python3&#xA;'''&#xA;bla.py&#xA;&#xA;Does this and that_    &#xA;'''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I know that I can select the second paragraph and then call &lt;code&gt;fill-paragraph&lt;/code&gt; on the region, but I'd like it to work automatically on the current paragraph, not the current comment).&lt;/p&gt;&#xA;" OwnerUserId="8357" LastEditorUserId="8357" LastEditDate="2015-08-03T16:50:51.487" LastActivityDate="2015-08-04T17:21:12.333" Title="Make fill-paragraph in python-mode work on paragraph, not whole string" Tags="|python|fill-paragraph|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14418" PostTypeId="2" ParentId="14353" CreationDate="2015-08-03T04:09:07.203" Score="3" Body="&lt;p&gt;Dan is correct, binding &lt;code&gt;(kbd &quot;cc&quot;)&lt;/code&gt; will clobber your &lt;code&gt;evil-change&lt;/code&gt; binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to solve this is to look at the source of &lt;code&gt;key-chord-define&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;###autoload&#xA;(defun key-chord-define (keymap keys command)&#xA;  &quot;Define in KEYMAP, a key-chord of the two keys in KEYS starting a COMMAND. &#xA;KEYS can be a string or a vector of two elements. Currently only elements&#xA;that corresponds to ascii codes in the range 32 to 126 can be used.&#xA;COMMAND can be an interactive function, a string, or nil.&#xA;If COMMAND is nil, the key-chord is removed.&quot;&#xA;  (if (/= 2 (length keys))&#xA;      (error &quot;Key-chord keys must have two elements&quot;))&#xA;  ;; Exotic chars in a string are &amp;gt;255 but define-key wants 128..255 for those&#xA;  (let ((key1 (logand 255 (aref keys 0)))&#xA;        (key2 (logand 255 (aref keys 1))))&#xA;    (if (eq key1 key2)&#xA;      (define-key keymap (vector 'key-chord key1 key2) command)&#xA;      ;; else&#xA;      (define-key keymap (vector 'key-chord key1 key2) command)&#xA;      (define-key keymap (vector 'key-chord key2 key1) command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So aha! It's clear that &lt;code&gt;key-chord-define&lt;/code&gt; simply binds a special &lt;code&gt;key-chord&lt;/code&gt; prefix. It also does some math for fancy chars, but we can bypass that since &lt;code&gt;c&lt;/code&gt; is not one of them (ASCII code point &lt;code&gt;99&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to do what you want is then:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-define-key 'normal web-mode-map&#xA;  (vector 'key-chord 99 99) #'web-mode-comment-or-uncomment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, there is one more optimization you can use, leveraging a slightly more advanced feature of &lt;code&gt;kbd&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-define-key 'normal web-mode-map&#xA;  (kbd &quot;&amp;lt;key-chord&amp;gt; cc&quot;) #'web-mode-comment-or-uncomment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-03T04:09:07.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14419" PostTypeId="1" CreationDate="2015-08-03T04:48:03.923" Score="0" ViewCount="71" Body="&lt;p&gt;I'm opening the very same file with Emacs-24.5 and with Emacs-23.1.  But the latter shows me what seems to be an older version of this file!  Might this be a bug of in Emacs-23.1?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I updated the question with images showing the file (opened with &lt;code&gt;C-x C-f&lt;/code&gt;) content and the respective output of &lt;code&gt;(buffer-file-name)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PXCzE.jpg&quot; alt=&quot;The image show that there are different contents for the same file&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/v5IrE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/v5IrE.png&quot; alt=&quot;buffer-file-name&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-08-06T06:18:29.857" LastActivityDate="2015-08-06T06:18:29.857" Title="Why do I get a different file content when I'm opening it with different Emacs versions on Windows7" Tags="|find-file|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14420" PostTypeId="1" AcceptedAnswerId="15023" CreationDate="2015-08-03T07:06:46.910" Score="4" ViewCount="643" Body="&lt;p&gt;Emacs is telling me that a certain character only takes up 1 column, even though it clearly takes up two? Is there a way I can fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vIw4o.png&quot; alt=&quot;incorrect char width&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that I'm doing some calculations in order to &quot;right-align&quot; part of my mode-line. I do this by getting the &lt;code&gt;window-total-width&lt;/code&gt; and subtracting from it the &lt;code&gt;(string-width left-part)&lt;/code&gt;, then appropriately padding based on this. This works great until I show a multi-column character like this. I purposefully made my math involve the amount of columns the string takes, but as shown above, this shows up incorrectly.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2019-04-16T18:19:48.523" Title="how can I fix incorrect character width?" Tags="|mode-line|characters|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14421" PostTypeId="2" ParentId="12858" CreationDate="2015-08-03T07:58:11.060" Score="2" Body="&lt;p&gt;This is the code I've ended up using on Emacs ≥23. The end result is: if the mark isn't active on a shifted motion command, set it at the cursor's original location and activate it; if the mark is active on a non-shifted motion command, deactivate it; commands without &lt;code&gt;interactive &quot;^&quot;&lt;/code&gt; don't affect the mark unless it's part of their normal job.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice handle-shift-selection&#xA;  (around handle-shift-selection-better-integration activate)&#xA;  (cond&#xA;   ((not shift-select-mode)) ;; do nothing if shift-select-mode is off&#xA;   ((eq (car-safe transient-mark-mode) 'only)&#xA;    ;; If the original mechanism is in progress, use it&#xA;    ad-do-it)&#xA;   ((and mark-active&#xA;         (not this-command-keys-shift-translated)&#xA;         (or (symbolp last-command-event)&#xA;             (eq (car-safe transient-mark-mode) 'only)))&#xA;    ;; On a non-shifted event, deactivate the mark either if it had been set&#xA;    ;; by a shift-selection command or if the event was a cursor key or&#xA;    ;; other function key.&#xA;    (deactivate-mark))&#xA;   ((and (not mark-active)&#xA;         this-command-keys-shift-translated)&#xA;    ;; On a shifted event, set the mark to the current location and activate&#xA;    ;; it..&#xA;    (push-mark nil t t))&#xA;   ;; Note that we never set the mark to the current location if it was&#xA;   ;; already active..&#xA;   ))&#xA;(setq shift-select-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-08-03T07:58:11.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14422" PostTypeId="1" CreationDate="2015-08-03T08:11:19.270" Score="1" ViewCount="247" Body="&lt;p&gt;I have a setup in which I keep my .org files in a git repo, with one fork in my laptop and other in my office computer (whose filesystem I can access remotely always). I recently set up MobileOrg in my phone (to work with my laptop) and am loving it. I am using Dropbox for synchronization. I would like to also be able to pull/push from my phone from my work computer. What is the best way of setting this up?&#xA;I would normally just use the same Dropbox folder in my work computer and link the corresponding org folder. However, I am worried about conflicts when later merging, pulling, pushing between the original forks, after MobileOrg has changed both. Will git and MobileOrg be able to graciously handle these?&lt;/p&gt;&#xA;" OwnerUserId="8659" LastActivityDate="2015-08-03T08:11:19.270" Title="Syncing org files under version control and MobileOrg" Tags="|org-mode|git|mobileorg|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14423" PostTypeId="1" CreationDate="2015-08-03T08:27:05.680" Score="5" ViewCount="501" Body="&lt;p&gt;I'm trying to install and configure the &lt;code&gt;ggtags&lt;/code&gt; package. Primarily, I use it for a ruby on rails projects (&lt;code&gt;enh-ruby-mode&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can generate ctags including all vendor's files for my project with the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I configure &lt;code&gt;ggtags&lt;/code&gt; package to achieve the same thing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use OS X, with installed &lt;code&gt;exuberant-ctags&lt;/code&gt; and &lt;code&gt;pygments&lt;/code&gt; plugins. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think, I need to add some settings to &lt;code&gt;~/.globalrc&lt;/code&gt; or to the project root's &lt;code&gt;gtags.conf&lt;/code&gt;, but I don't know the settings.&lt;/p&gt;&#xA;" OwnerUserId="9071" LastEditorUserId="50" LastEditDate="2015-08-03T18:56:55.490" LastActivityDate="2020-02-01T02:02:20.287" Title="Include vendor's tags for ruby-mode and ggtags" Tags="|ruby-mode|ctags|gtags|enh-ruby-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14424" PostTypeId="1" CreationDate="2015-08-03T08:31:03.200" Score="0" ViewCount="240" Body="&lt;p&gt;I am using &lt;a href=&quot;https://github.com/jonathanchu/emacs/blob/master/vendor/tree-mode.el&quot; rel=&quot;nofollow&quot;&gt;tree-mode&lt;/a&gt; to see the folder contents in a tree like design.&#xA;It is working awesome. I would like to customize the enter key  behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1)  key press on a file node must show the file's contents in preview mode. Pressing enter shows the preview but the cursor is as well taken to the new window which is not desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)  key press on directory nodes must expand/toggle the folder to show its contents in a sub-tree and not open the next window in dir-mode&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="50" LastEditDate="2015-08-03T18:47:31.827" LastActivityDate="2015-08-03T18:47:31.827" Title="tree-mode, view selected file preview in right side window" Tags="|key-bindings|directories|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14425" PostTypeId="1" AcceptedAnswerId="14441" CreationDate="2015-08-03T11:37:38.250" Score="2" ViewCount="733" Body="&lt;p&gt;Hello everybody it is quite easy question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using org-mobile so it synchronize my android agenda with org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;org-deadline&lt;/code&gt; (&lt;code&gt;C-c C-d&lt;/code&gt;) and I choose today,&#xA;the format will look like this: &lt;code&gt;DEADLINE: &amp;lt;2015-08-03 Pzt&amp;gt;&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want it to make all deadlines always be at 10 am instead, like this: &lt;code&gt;DEADLINE: &amp;lt;2015-08-03 Pzt 10:00&amp;gt;&lt;/code&gt;.&#xA;I would also like the same behaviour with &lt;code&gt;org-schedule&lt;/code&gt; (&lt;code&gt;C-c C-s&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can achieve this?&lt;/p&gt;&#xA;" OwnerUserId="8426" LastEditorUserId="253" LastEditDate="2015-12-22T00:44:45.360" LastActivityDate="2015-12-27T19:01:02.460" Title="Default hour of day when setting Deadline or Scheduled in org-mode" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14426" PostTypeId="1" CreationDate="2015-08-03T12:29:05.420" Score="1" ViewCount="660" Body="&lt;p&gt;Somehow my left mouse click does not work on links anymore. I can put the cursor, hit Return and get a link opened. But a mouse click gives this on the &quot;Message&quot; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call-interactively: Wrong number of arguments: (1 . 1), 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am clueless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional Info&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem occurs with emacs 24.4 and 24.5 (current running). Setting run &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt; and click on a link gave me this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2)&#xA;  mouse-drag-region(1419 1456)&#xA;  call-interactively(mouse-drag-region nil nil)&#xA;  command-execute(mouse-drag-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hitting &lt;code&gt;q&lt;/code&gt; on back-trace buffer gives inconsistent result so I don't know what to paste here.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="8937" LastEditDate="2015-08-03T13:05:20.803" LastActivityDate="2015-08-03T21:24:41.290" Title="Mouse click on links does not work" Tags="|mouse|hyperlinks|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14427" PostTypeId="1" CreationDate="2015-08-03T13:40:51.753" Score="11" ViewCount="1548" Body="&lt;p&gt;I'm looking for a simple way to make emacs remember of declared variable in a single function in C/C++. By &quot;simple&quot;, I mean without any external package, just with some elisp lines in configuration files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My default Emacs configuration colors variables names in yellow on declaration, but let them white on use.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;char toto; // 'char' is green, 'toto' is yellow&#xA;&#xA;toto = 42; // 'toto' is white&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to make every &quot;toto&quot; of the same function/scope colored in yellow as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've already looked on &lt;a href=&quot;https://emacs.stackexchange.com/questions/474/using-emacs-as-a-full-featured-c-c-ide&quot;&gt;this question&lt;/a&gt; but I would like something simpler. I also tried to do something with &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;font-lock mode&lt;/a&gt;, but I didn't succeed to make something adaptable to variable names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already have an idea for C++ class member names (using a name pattern), so I just want a local variable match here.&lt;/p&gt;&#xA;" OwnerUserId="7003" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-09-01T12:42:53.910" Title="Color declared variables" Tags="|font-lock|colors|c++|variables|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14428" PostTypeId="2" ParentId="14426" CreationDate="2015-08-03T15:30:29.027" Score="2" Body="&lt;p&gt;I hope this is not to send a bad signal. I will answer my own question once more. The comments are very helpful in guiding me, however I have to use both my 'knowledge' of my setup, my laziness, and the good suggestions to come up with the following solution.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;At first I thought bisecting as @Drew suggested is a tedious task. So I do &lt;code&gt;M-x package-install RET bug-hunter&lt;/code&gt; to do the bisection for me. &lt;code&gt;bug-hunter&lt;/code&gt; did not give back any problematic lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x bug-hunter-init-file RET e&#xA;Doing some initial tests...&#xA;Test failed.&#xA;No errors signaled after loading the entire file. If you're&#xA;looking for something that's not an error, you need to provide an&#xA;assertion. See this link for some examples:&#xA;https://github.com/Bruce-Connor/elisp-bug-hunter&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I checked out the assertion part on github, but then I don't know what assertion to put for the problematic function &lt;code&gt;mouse-drag-region&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It seems to be a dead end. But the function name &lt;code&gt;*-region&lt;/code&gt; reminds me of some cool function I copied from &lt;a href=&quot;http://emacswiki.org/emacs/WholeLineOrRegion&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki&lt;/a&gt; some time ago:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(do-all-symbols (symbol)&#xA;  (when (and (commandp symbol t)&#xA;             (string-match-p &quot;-region$\\|kill-ring-save&quot; (symbol-name symbol)))&#xA;    (put symbol 'interactive-form&#xA;         '(interactive&#xA;           (if (use-region-p)&#xA;               (list (region-beginning) (region-end))&#xA;             (list (line-beginning-position) (line-beginning-position 2)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I opened my &lt;code&gt;.emacs&lt;/code&gt; in one instace and start comment that function out. I open another emacs instance and test links. Oh my gosh, it works.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The next question is how to fix the function. There several alternative for the functions on EmacsWiki (i.e. This one: &lt;a href=&quot;http://emacswiki.org/emacs/CopyingWholeLines&quot; rel=&quot;nofollow&quot;&gt;http://emacswiki.org/emacs/CopyingWholeLines&lt;/a&gt;). By the way, I find EmacsWiki in many cases confusing because it shows all editing of a page, so it is hard to see which one really works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &#xA;Following is the fix for both functions on the EmacsWiki that caused me losing some hair. Hope I can find out how/when to edit that EmacsWiki page. For now, here are the fixed functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;************************************************************&#xA;;; Smart copy and paste lines/regions&#xA;;; Use `my-kill-ring-save` by uncommenting it if you only want to handle&#xA;;; cut and copy the whole line without selecting it explicitly.&#xA;;; the `do-all-symbols` loop applies the same approach to all functions&#xA;;; that deal with regions. &#xA;;;&#xA;;;  (defun my-kill-ring-save (beg end &amp;amp;optional flash)&#xA;;;       (interactive (if (use-region-p)&#xA;;;                        (list (region-beginning) (region-end) nil)&#xA;;;                      (list (line-beginning-position 1)&#xA;;;                            (line-beginning-position 2) 'flash)))&#xA;;;       (kill-ring-save beg end)&#xA;;;       (when flash&#xA;;;         (save-excursion&#xA;;;           (if (equal (current-column) 0)&#xA;;;               (goto-char end)&#xA;;;             (goto-char beg))&#xA;;;           (sit-for blink-matching-delay))))&#xA;;; (global-set-key [remap kill-ring-save] 'my-kill-ring-save)&#xA;;; Don't quite understand this code below&#xA;(do-all-symbols (symbol)&#xA;      (when (and (commandp symbol t)&#xA;                 (string-match-p &quot;-region$\\|kill-ring-save&quot; (symbol-name symbol))&#xA;         (not (string-match-p &quot;mouse&quot; (symbol-name symbol))))&#xA;        (put symbol 'interactive-form&#xA;             '(interactive&#xA;               (if (use-region-p)&#xA;                   (list (region-beginning) (region-end))&#xA;                 (list (line-beginning-position) (line-beginning-position 2)))))))&#xA;;;;;************************************************************&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="8937" LastEditDate="2015-08-03T21:24:41.290" LastActivityDate="2015-08-03T21:24:41.290" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14431" PostTypeId="2" ParentId="13294" CreationDate="2015-08-03T19:46:33.820" Score="2" Body="&lt;p&gt;You can simulate &lt;kbd&gt;æ&lt;/kbd&gt; as a modifier using &lt;code&gt;key-chord&lt;/code&gt;. I don't have an &lt;kbd&gt;æ&lt;/kbd&gt; key, so I'll demonstrate with &lt;kbd&gt;q&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(key-chord-mode +1)&#xA;(dolist (key (number-sequence 0 255))&#xA;  (lexical-let ((key-saved key))&#xA;    (key-chord-define-global (vector ?q key)&#xA;      (lambda ()&#xA;        (interactive)&#xA;        (avy-goto-char key-saved)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you plan on always holding &lt;kbd&gt;æ&lt;/kbd&gt; first, you may be interested in this variant:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(key-chord-mode +1)&#xA;(dolist (key (number-sequence 0 255))&#xA;  (lexical-let ((key-saved key))&#xA;    (global-define-key (vector 'key-chord ?q key)&#xA;      (lambda ()&#xA;        (interactive)&#xA;        (avy-goto-char key-saved)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-03T23:15:47.807" LastActivityDate="2015-08-03T23:15:47.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14432" PostTypeId="1" CreationDate="2015-08-03T19:48:42.563" Score="5" ViewCount="518" Body="&lt;p&gt;Is it possible to open EIN notebook as file, so it automatically takes care of starting &lt;code&gt;ipython notebook&lt;/code&gt; server? &lt;/p&gt;&#xA;" OwnerUserId="6848" LastActivityDate="2023-05-30T15:00:56.450" Title="Initialize ipython notebook server from .ipynb file" Tags="|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14435" PostTypeId="2" ParentId="13675" CreationDate="2015-08-03T20:13:17.173" Score="0" Body="&lt;p&gt;There is a wonderful function named &lt;code&gt;delete-blank-lines&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun paste-after-line ()&#xA;  (interactive)&#xA;  (move-end-of-line nil)&#xA;  (newline-and-indent)&#xA;  (yank)&#xA;  (delete-blank-lines))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-03T20:13:17.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14436" PostTypeId="2" ParentId="14229" CreationDate="2015-08-03T20:30:56.097" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;@wilx could you possibly write a short answer to your own question, so this won't haunt the &quot;Unanswered questions&quot; list forever?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;OK. I have checked out both of the packages and I have modified both and added Czech quotation marks to them (&lt;a href=&quot;https://github.com/wilx/typopunct/blob/master/typopunct.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;typopunct-mode&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://github.com/wilx/typoel&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;typo-mode&lt;/code&gt;&lt;/a&gt;). My modification of &lt;code&gt;typo-mode&lt;/code&gt; is already &lt;a href=&quot;https://github.com/jorgenschaefer/typoel/pull/6&quot; rel=&quot;nofollow&quot;&gt;merged to upstream&lt;/a&gt;. I am now using &lt;code&gt;typo-mode&lt;/code&gt; as it seems overall more useful. Both were easy to merge. (Also, it turned out that German quotation marks are the same as Czech quotation marks.)&lt;/p&gt;&#xA;" OwnerUserId="968" LastActivityDate="2015-08-03T20:30:56.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14438" PostTypeId="1" AcceptedAnswerId="14440" CreationDate="2015-08-03T21:31:54.850" Score="20" ViewCount="8659" Body="&lt;p&gt;I want to delete trailing whitespace on save for every mode except &lt;code&gt;org-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt;, I have the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'before-save-hook 'delete-trailing-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use the &lt;code&gt;use-package&lt;/code&gt; macro, and I tried adding &lt;code&gt;(remove-hook 'before-save-hook 'delete-trailing-whitespace)&lt;/code&gt; to my &lt;code&gt;:config&lt;/code&gt; block, but that removes the hook globally. How can I remove it specifically for &lt;code&gt;org-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-08-03T21:34:43.747" Title="Remove hooks for specific modes" Tags="|hooks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14439" PostTypeId="1" AcceptedAnswerId="20163" CreationDate="2015-08-03T21:33:13.217" Score="5" ViewCount="1477" Body="&lt;p&gt;Most programming languages use CamelCase &#xA;(&quot;anIdentifier&quot;) naming conventions &#xA;for identifiers. With Evil, you could navigate inside those identifiers using Evil &#xA;built-in motions is the &lt;code&gt;[count]f{char}&lt;/code&gt; motion, i.e. f&lt;code&gt;{uppercase-char}&lt;/code&gt; or f_, &#xA;respectively. But I would like to have this easier. I noticed there are many plugins available for Vim, which enables you to move camelCase-wise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These packages defines motions ,w ,b and ,e (similar to w b e), which do &#xA;not move word-wise (forward/backward), but Camel-wise; i.e. to word boundaries &#xA;and uppercase letters. Outside of &quot;words&quot; (e.g. in non-keyword &#xA;characters like // or ;), the new motions move just like the regular motions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with the CamelCase plugin the cursor (&lt;code&gt;[]&lt;/code&gt;) is on the following sentence:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[]AnotherExampleOfFoobar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I type &lt;kbd&gt;dw&lt;/kbd&gt;, it will change to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[]ExampleOfFoobar.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I googled around for an alternative package for Evil, I found no alternative package for CamelCase motion. It deletes the whole &lt;code&gt;AnotherExampleOfFoobar&lt;/code&gt;, instead deleting &lt;code&gt;Another&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess there is a missing feature, that I need to implement it in some way. So have anyone any suggestion to start with it? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-08-04T11:03:16.050" LastActivityDate="2019-01-28T07:33:38.353" Title="Evil package/alternative for motion through CamelCase words?" Tags="|evil|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14440" PostTypeId="2" ParentId="14438" CreationDate="2015-08-03T21:34:43.747" Score="25" Body="&lt;p&gt;I don't have any experience with the &lt;code&gt;use-package&lt;/code&gt; macro, but in principle, you could use the third argument to &lt;code&gt;remove-hook&lt;/code&gt; which tells it to remove the function only from the local hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(remove-hook 'before-save-hook 'delete-trailing-whitespace t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the docstring for reference:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(remove-hook HOOK FUNCTION &amp;amp;optional LOCAL)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Remove from the value of HOOK the function FUNCTION.&#xA;  HOOK should be a symbol, and FUNCTION may be any valid function.  If&#xA;  FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the&#xA;  list of hooks to run in HOOK, then nothing is done.  See &lt;code&gt;add-hook&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;The optional third argument, LOCAL, if non-nil, says to modify&#xA;  the hook's buffer-local value rather than its default value.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-03T21:34:43.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14441" PostTypeId="2" ParentId="14425" CreationDate="2015-08-03T21:47:08.363" Score="1" Body="&lt;p&gt;&lt;code&gt;org-deadline&lt;/code&gt; works by calling &lt;code&gt;org-add-planning-info&lt;/code&gt;, with &lt;code&gt;org-deadline&lt;/code&gt;'s input (&lt;code&gt;nil&lt;/code&gt; if you call it with &lt;code&gt;C-c C-d&lt;/code&gt;) and gets a default time from &lt;code&gt;org-parse-time-string&lt;/code&gt;, which is hard-coded to today at 00:00.  So there is no variable we can easily change to set the default time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This default time is then passed to &lt;code&gt;org-read-date&lt;/code&gt; which gets the user input and &lt;em&gt;does&lt;/em&gt; take an argument letting us set our own default time.  Thus, we can advise &lt;code&gt;org-deadline&lt;/code&gt; to call a different version of &lt;code&gt;org-read-date&lt;/code&gt; whose default time is some value we set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defvar org-deadline-default-time &quot;10:00&quot;&#xA;  &quot;The default time for deadlines.&quot;)&#xA;&#xA;&#xA;(defun advise-deadline-default-time (deadline-func arg &amp;amp;optional time)&#xA;  (let ((old-time (symbol-function #'org-read-date)))&#xA;    (cl-letf (((symbol-function #'org-read-date)&#xA;               #'(lambda (&amp;amp;optional a b c d default-time f g)&#xA;                   (let ((default-time (or default-time&#xA;                                           org-deadline-default-time)))&#xA;                     (apply old-time a b c d f default-time g)&#xA;                     ))))&#xA;      (apply deadline-func arg time)&#xA;    )))&#xA;&#xA;(advice-add #'org-deadline :around #'advise-deadline-default-time)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-08-05T01:14:12.857" LastActivityDate="2015-08-05T01:14:12.857" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14442" PostTypeId="1" CreationDate="2015-08-03T22:53:45.217" Score="2" ViewCount="1744" Body="&lt;p&gt;Every time I press c-x c-c to exit Emacs, it shows &quot;End of file during parsing&quot; in the minibuffer.  I cursorily examined my .emacs and did not find any mismatching parenthesis. Any idea what's the best route to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;: I confirmed that .emacs does not have mismatching parentheses with check-parens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit 2&lt;/em&gt;: About &lt;code&gt;kill-emacs-hook&lt;/code&gt;, I found it is related to keyfreq.  After commenting out the following from .emacs, the issue is resolved.  But I don't understand why it suddenly stops working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; keyfreq&#xA;;; https://github.com/dacap/keyfreq&#xA;&#xA;;(require 'keyfreq)&#xA;;(keyfreq-mode 1)&#xA;;(keyfreq-autosave-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8396" LastEditorUserId="8396" LastEditDate="2015-08-04T04:30:40.517" LastActivityDate="2015-08-04T04:30:40.517" Title="Can't exit Emacs with error &quot;End of file during parsing&quot;" Tags="|debugging|error-handling|" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="14443" PostTypeId="2" ParentId="13858" CreationDate="2015-08-03T23:06:25.627" Score="0" Body="&lt;p&gt;I was actually having an unrelated problem with video drivers, causing the machine's performance in general to crawl to a halt. Although the start process is slightly slower, it is probably not 3-5x slower as I originally stated. So I do not think this is a major issue, it was probably confusion.&lt;/p&gt;&#xA;" OwnerUserId="2846" LastActivityDate="2015-08-03T23:06:25.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14444" PostTypeId="1" CreationDate="2015-08-04T01:12:59.950" Score="8" ViewCount="355" Body="&lt;p&gt;If there a way to read the output of a subprocess line by line, or at least to get it in small batches? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a subprocess doing work in the background, and printing a line every time it completes a task. There are many such small tasks, so I would like to show a progress indicator; unfortunately, my filter function receives output in batches of 10 to 20 lines, which makes the progress display much more jittery than it really is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run that same process as a &lt;code&gt;compile&lt;/code&gt; process, the output is displayed smoothly; I can't figure the trick that &lt;code&gt;compilation-mode&lt;/code&gt; uses to achieve this.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-02-02T04:48:31.957" Title="Read process output line by line" Tags="|comint|subprocess|compilation-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14445" PostTypeId="2" ParentId="14153" CreationDate="2015-08-04T01:49:32.053" Score="3" Body="&lt;p&gt;After look around, I work out a workaround to do it by set a dummy variable for the &lt;code&gt;src2&lt;/code&gt; block to tangle the &lt;code&gt;src1&lt;/code&gt; block. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution:&#xA;    1. First, you have to name the &lt;code&gt;src1&lt;/code&gt; block to make it easy be located.&#xA;    2. Create a dummy variable to use elisp to tangle &lt;code&gt;src1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example Code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: my_hello&#xA;#+BEGIN_SRC emacs-lisp :tangle /tmp/hello.el&#xA;  (message &quot;Hello&quot;)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC sh :var DUMMY=(progn (org-babel-goto-named-src-block &quot;my_hello&quot;) (org-babel-tangle '(4))) :results output&#xA;  cat /tmp/hello.el&#xA;  rm -f /tmp/hello.el&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: (message &quot;Hello&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This solution solve my problem for now. But it has a lot of limitations, such as it can only tangle the block in the same org-mode file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope some would work out a better way to do it.&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="4102" LastEditDate="2015-08-04T01:59:26.913" LastActivityDate="2015-08-04T01:59:26.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14446" PostTypeId="2" ParentId="13958" CreationDate="2015-08-04T03:01:15.170" Score="2" Body="&lt;p&gt;You can simply delete the &lt;kbd&gt;g&lt;/kbd&gt; binding to let the evil one shine through:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key Info-mode-map &quot;g&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-04T03:01:15.170" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14447" PostTypeId="2" ParentId="13186" CreationDate="2015-08-04T03:10:26.217" Score="3" Body="&lt;p&gt;You could achieve this with advice:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-evil-quit (old-fun &amp;amp;rest args)&#xA;  (if (eq major-mode 'lisp-interaction-mode)&#xA;    (message &quot;hi!&quot;)&#xA;    (apply old-fun args)))&#xA;&#xA;(advice-add #'evil-quit :around #'my-evil-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try this in your &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-04T03:10:26.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14448" PostTypeId="1" CreationDate="2015-08-04T03:59:02.317" Score="1" ViewCount="1223" Body="&lt;p&gt;I use &lt;code&gt;helm-multi-occur&lt;/code&gt; to search for a pattern in all open buffers. Search results are displayed line by line in the buffer &lt;code&gt;*helm multi occur*&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When i press enter after selecting an item, it enters a newline instead of taking me to the source code, where that pattern is located.&lt;/p&gt;&#xA;&lt;p&gt;Screenshot is,&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zTJz8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zTJz8.png&quot; alt=&quot;helm&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here pressing enter on the green bar adds more and more blank lines, but i would like to switch the buffer to &lt;code&gt;buttopane.js-ln#86&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-04T04:24:19.250" Title="helm-multi-occur, navigate through the search occurrences" Tags="|helm|occur|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14449" PostTypeId="2" ParentId="14448" CreationDate="2015-08-04T04:24:19.250" Score="3" Body="&lt;p&gt;If you want another way to do this, you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;.  A non-negative prefix arg with command &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-occur&lt;/code&gt;&lt;/a&gt; (&lt;code&gt;C-c '&lt;/code&gt;) searches multiple buffers line by line (like &lt;code&gt;occur&lt;/code&gt;, &lt;code&gt;moccur&lt;/code&gt;, and &lt;code&gt;grep&lt;/code&gt;).  If you hit &lt;code&gt;C-!&lt;/code&gt; at the prompt that asks which buffers then all buffers are searched.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-9 C-c ' C-! RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, &lt;code&gt;C-9&lt;/code&gt; says search multiple buffers. &lt;code&gt;C-c '&lt;/code&gt; is &lt;code&gt;icicle-occur&lt;/code&gt;, which is a line-by-line search, like &lt;code&gt;grep&lt;/code&gt;.  &lt;code&gt;C-!&lt;/code&gt; says choose all candidates (the candidates are the existing buffers).  &lt;code&gt;RET&lt;/code&gt; ends choosing buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you type whatever search patterns you want.  The search hits are shown in popup buffer &lt;code&gt;*Completions*&lt;/code&gt;.  Change your minibuffer input and the matching hits change.  Use &lt;code&gt;S-SPC&lt;/code&gt; to lock in one pattern and add an additional pattern to match.  You can use &lt;code&gt;down&lt;/code&gt; to cycle among candidates or continue to narrow the choices.  You can cycle showing the matches in context in the buffers, using &lt;code&gt;C-down&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each search candidate is a buffer line followed by the buffer name.  You can match both if you like.  Matching can be using any number of search patterns (separated using &lt;code&gt;S-SPC&lt;/code&gt;), and each pattern can be a regexp (or other kinds of patterns).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-04T04:24:19.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14450" PostTypeId="1" CreationDate="2015-08-04T07:47:34.743" Score="3" ViewCount="2219" Body="&lt;p&gt;Presently, I'm testing for windows like this in my startup for Emacs v23.1.1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(if (eq system-type 'windows-nt)&#xA;    (load-library &quot;visual-basic-mode&quot;))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is true for both Windows 7 and Windows XP and I do not have &lt;code&gt;visual-basic-mode&lt;/code&gt; on my windows XP machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to add a condition to detect that it is XP and not load the file?  Alternatively, can I pass arguments to load-library so that it is not an error if not found?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update: I tried adding &lt;code&gt;t&lt;/code&gt; as the second argument to &lt;code&gt;load-library&lt;/code&gt; and get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;byte-code: Wrong number of arguments:&#xA;  #[(library) &quot;Á!&quot; [library load] 2 729706&#xA;        (list (completing-read &quot;Load library: &quot;&#xA;                               (apply-partially (quote locate-file-completion-table)&#xA;                                                load-path (get-load-suffixes))))], 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update: Trying to use the system version does not eval:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function pcase)&#xA;  (pcase (and (eq system-type ...) (w32-version))&#xA;     (\` (5 0 \,_) (quote windows-2k))&#xA;     (\` (5 \, ... \,_) (quote windows-xp))&#xA;     (\` (6 0 \,_) (quote windows-vista))&#xA;     (\` (6 1 \,_) (load-library &quot;visual-basic-mode&quot;) (quote windows-7))&#xA;     (\` (6 2 \,_) (quote windows-8))&#xA;     (\` (6 3 \,_) (quote windows-8\.1)))&#xA;  eval-region(42066 42335 t (lambda (ignore) (goto-char 42335)&#xA;                              (quote (pcase ... ... ... ... ... ...&#xA;                                            ...))))  ; Reading at buffer position 42223&#xA;  apply(eval-region (42066 42335 t (lambda (ignore) (goto-char 42335) (quote ...))))&#xA;  eval-defun-2()&#xA;  eval-defun(nil)&#xA;  call-interactively(eval-defun t nil)&#xA;  execute-extended-command(nil)&#xA;  call-interactively(execute-extended-command nil nil)&#xA;  recursive-edit()&#xA;  byte-code(&quot;Æ  @Ç=!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nor compile:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: Wrong number of arguments: #[(structure) &quot;\301!A\207&quot;&#xA;            [structure backquote-process] 2 1716431], 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I note that the value of (w32-version) on Windows XP for me is: &lt;code&gt;(5 1 2600)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2414" LastEditorUserId="2414" LastEditDate="2015-08-04T16:45:45.513" LastActivityDate="2015-08-04T19:50:30.500" Title="How to detect Windows XP vs Windows 7 in startup file?" Tags="|microsoft-windows|start-up|system-environment|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14451" PostTypeId="2" ParentId="14417" CreationDate="2015-08-04T08:07:16.907" Score="5" Body="&lt;p&gt;Python Mode provides its own &lt;code&gt;fill-paragraph-function&lt;/code&gt;, called &lt;code&gt;python-fill-paragraph&lt;/code&gt;.  This function implements extensive formatting of code beyond just wrapping paragraphs.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Change the filling style&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Notably, it formats docstrings according to &lt;code&gt;python-fill-docstring-style&lt;/code&gt;, whose default value is &lt;code&gt;pep-257&lt;/code&gt;, that is, formatting docstrings according to PEP 257 where the first sentence is one the same line with the opening quotes and a blank line is inserted before the closing quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your example shows a different docstring style.  Change &lt;code&gt;python-fill-docstring-style&lt;/code&gt; to &lt;code&gt;django&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-fill-docstring-style 'django)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is the style used in your example.  Python Mode will still fill the entire docstring, but preserve your style of writing docstrings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the setting I’d recommend.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Really fill the paragraph only&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can tell Python Mode to fill only the current paragraph when in a comment, by customizing &lt;code&gt;python-fill-string-function&lt;/code&gt;.  This is the filling function that Python Mode uses when inside a string.  The following setting makes Python Mode use the default filling behaviour in docstrings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-fill-string-function (lambda (&amp;amp;optional justify region)&#xA;                                    (let ((fill-paragraph-function nil))&#xA;                                      (fill-paragraph justify region))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-08-04T08:07:16.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14452" PostTypeId="2" ParentId="14450" CreationDate="2015-08-04T08:55:17.393" Score="4" Body="&lt;p&gt;Since this seems like a configuration based not on OS version so much as a particular machine's program installation, I think it would be better to conditionalize based on the &lt;em&gt;system-name&lt;/em&gt; variable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the record, you can pass &lt;em&gt;t&lt;/em&gt; as the 2nd argument to load, which will not signal an error if the listed file or library is not found. &lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2015-08-04T08:55:17.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14453" PostTypeId="1" AcceptedAnswerId="14506" CreationDate="2015-08-04T09:57:18.397" Score="9" ViewCount="977" Body="&lt;p&gt;I noticed that when I copy thing outside of Emacs, the thing does not appear to kill ring immediately except I yank it to Emacs. If I copy twice, only the last copy can be got by yank. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes, I would like to push the copys from system clipboards to kill ring once I do the copy. After that, I can select what I need in the kill ring to paste in Emacs. So How can I achieve that the copys can be pushed into kill ring many times?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am on Windows 7.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-08-06T09:52:12.140" LastActivityDate="2015-08-06T09:52:12.140" Title="How to push system clipboards to kill ring contents at real-time when I copy outside emacs?" Tags="|yank|kill-ring|clipboard|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14454" PostTypeId="2" ParentId="14453" CreationDate="2015-08-04T11:02:43.600" Score="3" Body="&lt;p&gt;I'm not sure that it is possible to have copied text appear in your kill-ring immediately after copying, unless there is some way to run a hook on copy. This would obviously depend on your operating system/environment, but I did want to mention that you might want to try setting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq save-interprogram-paste-before-kill t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will at least preserve copied text from the operating system when something is copied from within emacs.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h v save-interprogram-paste-before-kill&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Save clipboard strings into kill ring before replacing them.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When one selects something in another program to paste it into Emacs,&#xA;  but kills something in Emacs before actually pasting it,&#xA;  this selection is gone unless this variable is non-nil,&#xA;  in which case the other program's selection is saved in the &lt;code&gt;kill-ring&lt;/code&gt;&#xA;  before the Emacs kill and one can still paste it using &lt;code&gt;C-y M-y&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2564" LastEditorUserId="115" LastEditDate="2015-08-04T12:36:28.007" LastActivityDate="2015-08-04T12:36:28.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14455" PostTypeId="1" CreationDate="2015-08-04T12:03:14.457" Score="7" ViewCount="9296" Body="&lt;p&gt;When I try to export a &lt;code&gt;.org&lt;/code&gt; or &lt;code&gt;.tex&lt;/code&gt; file to pdf with the command &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt;, I get the following error in &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Processing LaTeX file ./test.tex...&#xA;org-latex-compile: PDF file ./test.pdf wasn't produced: [LaTeX error]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I couldn't find anymore debug info. I already tried to install &lt;code&gt;texlive-core&lt;/code&gt; and &lt;code&gt;texlive-bin&lt;/code&gt; package from archlinux repo, but it didn't help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: After digging further into the problem, I saw that org runs the command &lt;code&gt;pdflatex file.tex&lt;/code&gt;, and it returned it couldn't find the file &lt;code&gt;utf8x.def&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="253" LastEditDate="2015-08-14T14:04:37.313" LastActivityDate="2017-03-07T13:52:34.193" Title="Exporting org to pdf: LaTeXerror" Tags="|org-mode|latex|org-export|pdf|" AnswerCount="1" CommentCount="11" ClosedDate="2015-08-16T15:12:28.207" ContentLicense="CC BY-SA 3.0" />
  <row Id="14456" PostTypeId="2" ParentId="14450" CreationDate="2015-08-04T12:39:54.090" Score="4" Body="&#xA;&#xA;&lt;p&gt;For your particular case, I think @InHarmsWay's answer is the best. But for the general case, you can use &lt;code&gt;w32-version&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(pcase (and (eq system-type 'windows-nt)&#xA;            (w32-version))&#xA;  (`(5 0 ,_) 'windows-2k)&#xA;  (`(5 ,(or 1 2) ,_) 'windows-xp)&#xA;  (`(6 0 ,_) 'windows-vista)&#xA;  (`(6 1 ,_) 'windows-7)&#xA;  (`(6 2 ,_) 'windows-8)&#xA;  (`(6 3 ,_) 'windows-8.1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More complete mappings from internal version numbers to Windows editions are at &lt;a href=&quot;https://msdn.microsoft.com/en-ca/library/windows/desktop/ms724832%28v=vs.85%29.aspx&quot; rel=&quot;nofollow&quot;&gt;https://msdn.microsoft.com/en-ca/library/windows/desktop/ms724832%28v=vs.85%29.aspx&lt;/a&gt; (only goes back to 2k) and &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pcase&lt;/code&gt; was introduced in 24.1, for older Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((version (and (eq system-type 'windows-nt)&#xA;                    (w32-version))))&#xA;  (cond&#xA;   ((and (version-list-&amp;lt;= '(5 1) version)&#xA;         (version-list-&amp;lt; version '(5 3)))&#xA;    'windows-xp)&#xA;   ((and (version-list-&amp;lt;= '(6 1) version)&#xA;         (version-list-&amp;lt; version '(6 2)))&#xA;    'windows-7)&#xA;   ((and (version-list-&amp;lt;= '(6 3) version)&#xA;         (version-list-&amp;lt; version '(6 4)))&#xA;    'windows-8.1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-08-04T19:50:30.500" LastActivityDate="2015-08-04T19:50:30.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14458" PostTypeId="2" ParentId="14455" CreationDate="2015-08-04T12:53:03.563" Score="2" Body="&lt;p&gt;Installing the package &lt;code&gt;texlive-latex-extra&lt;/code&gt;, that contains the &lt;code&gt;utf8x.def&lt;/code&gt; file, fixed this issue for me.&#xA;So for Debian based machines &lt;code&gt;sudo apt-get install texlive-latex-extra&lt;/code&gt; should do it.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="1979" LastEditDate="2017-03-07T13:52:34.193" LastActivityDate="2017-03-07T13:52:34.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14459" PostTypeId="1" CreationDate="2015-08-04T16:25:52.780" Score="2" ViewCount="140" Body="&lt;p&gt;In my emacs org mode, I created a new customized emphasis marker (added to Org Emphasis Alist) with the caracter &quot;¡&quot; associated with the font-lock-face &quot;hi-pink&quot; (I use the solarized theme).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works fine to highlight text displayed within emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try to export my org file into a latex or a html file, I get an error message: &quot;unknown marker&quot;. It seems that the new marker is not recognized for exporting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get the new emphasis marker exported to html, latex or other backend formats (lets say, as a source code text)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, is it possible at least to tell org mode to ignore the new customized emphasis mark, in order to accomplish the export process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your help!&#xA;(congratulations for this website!!)&lt;/p&gt;&#xA;" OwnerUserId="9099" LastActivityDate="2015-08-04T16:25:52.780" Title="Org mode: exporting new customized emphasis markers" Tags="|org-mode|org-export|org-emphasis|" AnswerCount="0" CommentCount="0" ClosedDate="2015-08-17T11:34:56.733" ContentLicense="CC BY-SA 3.0" />
  <row Id="14460" PostTypeId="1" AcceptedAnswerId="14461" CreationDate="2015-08-04T16:59:35.417" Score="7" ViewCount="1327" Body="&lt;p&gt;Can someone explain all the differences in the various lisp modes (inferior, superior, slime, cider)?  Which came first?  Which are extra packages?  What should one use?  &lt;/p&gt;&#xA;" OwnerUserId="9087" LastEditorUserId="253" LastEditDate="2015-08-04T17:17:50.607" LastActivityDate="2015-08-04T20:17:31.357" Title="Inferior Lisp Mode vs Superior Lisp Mode" Tags="|major-mode|repl|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14461" PostTypeId="2" ParentId="14460" CreationDate="2015-08-04T17:10:28.280" Score="12" Body="&lt;p&gt;When you run a process inside Emacs, that process is &quot;inferior&quot; (i.e. a subprocess).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IELM &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;ielm&lt;/kbd&gt; is the builtin Inferior Emacs Lisp Mode. It's relatively featureless, but can definitely come in handy. (Esp. for learning Elisp)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://common-lisp.net/project/slime/&quot; rel=&quot;noreferrer&quot;&gt;SLIME&lt;/a&gt;, the Superior Lisp Interaction Mode for Emacs, is mostly a joke on the whole &quot;inferior&quot; process name. SLIME is used primarily for Common Lisp (although it can be used with other lisps to varying degrees via extensions). It boasts a large variety of &quot;superior&quot; functions, including debugging, interactive REPLs, and various IDE like functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/clojure-emacs/cider&quot; rel=&quot;noreferrer&quot;&gt;CIDER&lt;/a&gt;, the Clojure Interactive Development Environment that Rocks for Emacs, is something like SLIME but for Clojure. (Clojure itself being a rather curious lisp that needs some extra work to interface with)&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-04T20:17:31.357" LastActivityDate="2015-08-04T20:17:31.357" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14462" PostTypeId="2" ParentId="14417" CreationDate="2015-08-04T17:21:12.333" Score="1" Body="&lt;p&gt;I found that another solution is to set &lt;code&gt;python-fill-docstring-style&lt;/code&gt;  to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this includes the triple quotes in the reformatting, so when reformatting the last paragraph in a docstring, the triple quotes end up on the same line.&lt;/p&gt;&#xA;" OwnerUserId="8357" LastActivityDate="2015-08-04T17:21:12.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14463" PostTypeId="1" AcceptedAnswerId="21211" CreationDate="2015-08-04T18:41:10.960" Score="37" ViewCount="8996" Body="&lt;p&gt;I've got a file &lt;code&gt;foo.txt&lt;/code&gt; in branch &lt;code&gt;A&lt;/code&gt;, and I want to check out &lt;code&gt;foo.txt&lt;/code&gt; from branch &lt;code&gt;B&lt;/code&gt; into the index.  On the command line, I would do this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ git checkout B -- foo.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to be able to do this in magit by going to log, finding the commit I'm interested in (e.g &lt;code&gt;l o B&lt;/code&gt;),  finding &lt;code&gt;foo.txt&lt;/code&gt;, and running some command, but I can't figure out how to do it.  &lt;/p&gt;&#xA;" OwnerUserId="9101" LastActivityDate="2021-12-21T06:32:18.990" Title="How do I checkout a file from another commit in Magit" Tags="|magit|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14464" PostTypeId="2" ParentId="14463" CreationDate="2015-08-04T20:31:58.497" Score="3" Body="&lt;p&gt;I'm not aware of a builtin way to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you're on branch A, another approach would be to diff branch&#xA;B (&lt;code&gt;d r ..B&lt;/code&gt;), and then move point to the file you're interested in.&#xA;Pressing &lt;code&gt;a&lt;/code&gt; will apply those changes to the working tree (rather than&#xA;the index).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a command in my configuration to reset or checkout a file from&#xA;a revision, but, in its current state, it doesn't fit exactly what&#xA;you're asking for because it won't offer a good revision default when&#xA;in Magit Revision mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun km/magit-reset-file (rev file &amp;amp;optional checkout)&#xA;  &quot;Reset FILE from revision REV.&#xA;&#xA;If prefix argument CHECKOUT is non-nil, checkout FILE from REV&#xA;instead.&#xA;&#xA;\(git reset REV -- FILE)&#xA;\(git checkout REV -- FILE)&quot;&#xA;  (interactive&#xA;   (let ((rev (magit-read-branch-or-commit &quot;Revision&quot;)))&#xA;     (list rev (magit-read-file-from-rev rev &quot;File&quot;) current-prefix-arg)))&#xA;  (magit-with-toplevel&#xA;    (magit-run-git (if checkout &quot;checkout&quot; &quot;reset&quot;)&#xA;                   rev &quot;--&quot; file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-08-04T20:31:58.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14465" PostTypeId="2" ParentId="14453" CreationDate="2015-08-04T20:38:50.333" Score="5" Body="&lt;p&gt;TL;DR: you can use &lt;code&gt;clipmon&lt;/code&gt; available on MELPA, and turn on &lt;code&gt;clipmon-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: the details below apply to X servers, but the package should work on any platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How does the clipboard work ?&lt;/strong&gt;&#xA;Clipboard is implemented as an asynchronous process. When you copy from an application, it becomes the &quot;clipboard owner&quot; but doesn't actually put the copied data anywhere. When you paste into an application, it requests the data from the current &quot;clipboard owner&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;http://www.jwz.org/doc/x-cut-and-paste.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.jwz.org/doc/x-cut-and-paste.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to get the content of the clipboard&lt;/strong&gt; &#xA;As I understand it, the &quot;reliable&quot; way to see if there's new data in the clipboard is to periodically poll the X server to check what's there. For emacs, the package clipmon (&lt;a href=&quot;https://github.com/bburns/clipmon&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/bburns/clipmon&lt;/a&gt;) does that. Every two seconds by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excerpt from the README :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It also adds changes to the system clipboard to the kill ring, making&#xA;  Emacs into a clipboard manager for text - you can then use a package&#xA;  like browse-kill-ring or helm-ring to view and manage your clipboard&#xA;  history.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Please note that I didn't actually try this package, but it certainly looks like a solution.)&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-08-05T05:59:00.903" LastActivityDate="2015-08-05T05:59:00.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14466" PostTypeId="1" AcceptedAnswerId="14476" CreationDate="2015-08-04T21:17:50.890" Score="7" ViewCount="9561" Body="&lt;p&gt;This question is inspired by &lt;a href=&quot;https://emacs.stackexchange.com/a/5947/&quot;&gt;https://emacs.stackexchange.com/a/5947/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that I have a function like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun do-some-actions () ()&#xA;(..put a copy of the current file in a specific folder...)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I would like that the above function to be run after saving files. The following hook can do the job:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-save-hook 'do-some-actions)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in this way Emacs runs the function &lt;code&gt;do-some-action&lt;/code&gt; even for the files which have not been manually saved. For instance when I install the packages via Melpa, Emacs itself saves some files with the name &lt;code&gt;package_name-autoloads.el&lt;/code&gt; in the directory &lt;code&gt;~/.emacs.d/elpa/package_name/&lt;/code&gt; and even though these files have not been saved manually, the function &lt;code&gt;do-some-actions&lt;/code&gt; is executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is about the possibility to prevent Emacs to this after-save-hook when the file has not been saved manually.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-11T23:18:21.390" Title="How to run an `after-save-hook` only when the buffer has been saved manually" Tags="|hooks|saving|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14467" PostTypeId="2" ParentId="13885" CreationDate="2015-08-04T21:54:53.190" Score="2" Body="&lt;p&gt;Rather than using &lt;code&gt;require&lt;/code&gt; in the init file, I've switched to &lt;code&gt;eval-after-load&lt;/code&gt; for most things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So where the line before read:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ess-site)&#xA;(ess-toggle-underscore nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I now have&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'ess-site '(ess-toggle-underscore nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-08-04T21:54:53.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14468" PostTypeId="1" CreationDate="2015-08-04T23:09:40.903" Score="4" ViewCount="572" Body="&lt;p&gt;Is there a way I can find what file handles emacs has open, and close these references? Or even better, find where they are being open?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is keeping handles to a large number of files (a leak) that I don't have corresponding buffers to. My standard method of closing a buffer has been using the &lt;code&gt;kill-buffer&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Context:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I am having a reoccurring issue, where after a day or two of being open I can no longer do any file operations in emacs, due to a &quot;Too many open files&quot; error when creating a pipe. I am on OSX 10.10.4, Emacs 25.0.50 installed with homebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample of emacs' open files according to Activity Monitor (double click on emacs and select &quot;Open Files and Ports&quot;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status&#xA;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Dropbox/org&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript/status&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript&#xA;/Users/Ash/Documents/workspace/roboclub/Federation-Place/web/site/src/javascript&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are actually many more files open, but you can see that they are being repeated. (Also these are folders, not sure why that is).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The following are my file limits:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ulimit -n&#xA;4096&#xA;$ sysctl -a | grep files&#xA;kern.maxfiles: 20480&#xA;kern.maxfilesperproc: 10240&#xA;kern.num_files: 4496&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And my open files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ lsof | awk '{print $1 &quot;-&quot; $2}' | sort | uniq -c | sort -nr | head -10&#xA; 728 Google-345&#xA; 508 Google-551&#xA; 430 Mail-353&#xA; 418 Skype-12098&#xA; 356 Dock-361&#xA; 350 Emacs-8847&#xA; 207 Dropbox-637&#xA; 176 Google-22455&#xA; 176 Google-21229&#xA; 165 Google-26072&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs is the only program having issues, yet doesn't seem to have a comparatively high file count.&lt;/p&gt;&#xA;" OwnerUserId="9066" LastEditorUserId="9066" LastEditDate="2015-08-16T06:34:58.917" LastActivityDate="2015-08-16T06:34:58.917" Title="Debugging open file handles in emacs" Tags="|files|debugging|performance|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14469" PostTypeId="2" ParentId="14468" CreationDate="2015-08-05T00:32:38.430" Score="2" Body="&lt;p&gt;This error is probably related to OS restrictions on max open files and unrelated to Emacs. You can check what processes are running under Emacs with this command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x list-processes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The most common tool to see which file is opened by which process/program, use &lt;strong&gt;lsof&lt;/strong&gt; tool at the system command prompt (outside Emacs):  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;lsof +f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the +f shows only filesystem entries (files and directories) and not all network pipes too. In any case, to fix the max open files, you will have to play with a few settings. Start with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sysctl -A | grep maxfiles&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and increase the values for&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;kern.maxfiles = 12288&#xA;kern.maxfilesperproc = 10240&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;by editing (as sudo) this file &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/etc/launchd.conf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this line with suitable values (instead of 64K shown below)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;limit maxfiles 65536 65536&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then reboot OS X (logging off alone won't be enough for launchd settings). Fine tuning the max capacities is an art and is greatly dependent on what all things your installed programs are doing on your machine on your behalf!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OS X has a &lt;a href=&quot;https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/sysctl.8.html&quot; rel=&quot;nofollow&quot;&gt;manpage for sysctl&lt;/a&gt; with lots more details.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-08-05T00:32:38.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14470" PostTypeId="1" AcceptedAnswerId="14471" CreationDate="2015-08-05T00:36:50.047" Score="8" ViewCount="4555" Body="&lt;p&gt;Is it considered better to use TRAMP to access remote files on a local copy of Emacs, or to ssh into the remote server and access the files using a remote copy of Emacs in the ssh session?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some of the considerations involved in making this decision?&lt;/p&gt;&#xA;" OwnerUserId="9014" LastActivityDate="2019-11-28T13:11:03.740" Title="TRAMP vs ssh to remote emacs" Tags="|tramp|ssh|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14471" PostTypeId="2" ParentId="14470" CreationDate="2015-08-05T01:19:47.673" Score="12" Body="&lt;p&gt;Since TRAMP uses ssh by default, the real question you are asking is if you should use local or remote emacs to edit remote files. Right? &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is it considered better to use ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is no better, just that use cases differ for both local and remote editing. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What are some of the considerations involved in making this decision?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you normally work with a variety of servers as part of your workflow, then use local Emacs with TRAMP. On the other hand, if you access remote server from a variety of clients, laptops, locations, or devices, then ssh into the server might be more convenient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The size of the edits and any compilation needs also need to be taken into consideration. You can avoid large file downloads and uploads by using ssh. You probably cannot avoid this, say if you are editing in languages that are not natively supported by the server, but you have the tools locally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all your tools are local to your laptop, then using TRAMP makes sense. But if your servers mandate compilation on that machine (for security reasons), then ssh might be more appropriate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, if your emacs usage is not dependent on mouse and other input devices (for multiple languages), then ssh is the way to go as it is optimized for keyboard interaction. Otherwise local Emacs with the full GUI interface is what you'd want. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-08-05T01:19:47.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14472" PostTypeId="2" ParentId="314" CreationDate="2015-08-05T02:11:01.527" Score="0" Body="&lt;h2&gt;In org-mode version &lt;strong&gt;8.3+&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The minimal working example in the question generates the List of Tables fine without duplication of the table captions when the table is split across pages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The hack suggested in the above answer is required only for org-mode versions 8.2 or lower.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-08-05T02:11:01.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14473" PostTypeId="2" ParentId="14470" CreationDate="2015-08-05T02:12:50.233" Score="7" Body="&lt;p&gt;I agree with Emacs User: Neither approach is objectively &quot;better&quot;. If you don't have any obvious compelling reason to go with one or the other, then it's really just a subjective balance between performance and convenience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need only occasional access to any given server, the ease of using TRAMP ought to trump a low-to-moderate performance hit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you will be making moderate-to-heavy use of Emacs with a given server, then running Emacs on the remote server is a more obvious consideration (but by no means a necessity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use TRAMP to start with. If you have no issues with performance, then that's likely the best and simplest solution. If the performance hit bothers you, try running it remotely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll also need to decide whether to run GUI Emacs or not. Remote GUI Emacs brings its own performance issues (I do use it when running Emacs inside a locally-hosted VM, but not otherwise). If you usually use GUI Emacs and you'd need to use terminal Emacs remotely, that's obviously another trade-off to consider.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use whatever feels best to you.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-08-05T02:12:50.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14474" PostTypeId="1" AcceptedAnswerId="14475" CreationDate="2015-08-05T04:20:11.613" Score="2" ViewCount="134" Body="&lt;p&gt;&lt;code&gt;Ctrl-s&lt;/code&gt;, &lt;code&gt;isearch-forward&lt;/code&gt; is not appealing to me and so, i wrote a wrapper around it to search from the beginning of the buffer always.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sk-isearch-forward (original)&#xA;  (interactive &quot;sEnter search string:  &quot;)&#xA;  (save-excursion&#xA;    (beginning-of-buffer)&#xA;    (isearch-forward original)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, i am seeing two issues:::&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &lt;code&gt;M-x sk-isearch-forward&lt;/code&gt; goes to the beginning of the buffer but never returns to the original cursor position. &lt;code&gt;save-excursion&lt;/code&gt; is added to take care of this but it is failing me&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) it is not highlighting any of the matching words in the current buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is &lt;code&gt;isearch-forward&lt;/code&gt; not the right function for this job? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I always search for a word, no regexes and the search, i prefer to start from the beginning. How can i do this?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-08-05T12:52:10.980" Title="Customize isearch to start from buffer start" Tags="|isearch|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14475" PostTypeId="2" ParentId="14474" CreationDate="2015-08-05T05:13:48.350" Score="3" Body="&lt;p&gt;Just remove the argument, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun sk-isearch-forward () &#xA;  (interactive)&#xA;  (save-excursion &#xA;    (goto-char (point-min))&#xA;    (isearch-forward)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="160" LastEditDate="2015-08-05T12:52:10.980" LastActivityDate="2015-08-05T12:52:10.980" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14476" PostTypeId="2" ParentId="14466" CreationDate="2015-08-05T07:20:05.410" Score="8" Body="&lt;p&gt;Firstly you need to define what &quot;saved manually&quot; actually means. It could cover multiple commands, to my mind. &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;apropos-command&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;save\|write&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; probably includes all the typical cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you know which commands you're interested in, you could simply test the &lt;code&gt;this-command&lt;/code&gt; variable in your hook function, to see whether its value is a member of your list of &quot;saved manually&quot; commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-after-save-actions ()&#xA;  &quot;Used in `after-save-hook'.&quot;&#xA;  (when (memq this-command '(save-buffer save-some-buffers))&#xA;    ;; put a copy of the current file in a specific folder...&#xA;    ))&#xA;&#xA;(add-hook 'after-save-hook 'my-after-save-actions)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-08-05T07:20:05.410" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14477" PostTypeId="1" AcceptedAnswerId="14478" CreationDate="2015-08-05T09:58:05.680" Score="1" ViewCount="53" Body="&lt;p&gt;I'm using the following to create a new buffer &quot;untitled&quot; with the keyboard map &lt;code&gt;C-n&lt;/code&gt;. This works fine for a new buffer but additional buffers of the same name where &lt;code&gt;&amp;lt;num&amp;gt;&lt;/code&gt; gets applied seem to inherit the Fundamental major mode rather than Text. Why is this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq major-mode 'text-mode)&#xA;&#xA;(defun new-buffer-by-name (arg)&#xA;   &quot;Creates a new buffer by name&quot;&#xA;   (generate-new-buffer arg)&#xA;   (set-buffer-major-mode (get-buffer arg))&#xA;   (switch-to-buffer arg))&#xA;&#xA;(global-set-key (kbd &quot;C-n&quot;)&#xA;   (lambda () (interactive)&#xA;      (new-buffer-by-name &quot;untitled&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9103" LastActivityDate="2015-08-05T10:52:00.580" Title="New buffers of the same name don't inherit default major mode?" Tags="|major-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14478" PostTypeId="2" ParentId="14477" CreationDate="2015-08-05T10:22:33.207" Score="1" Body="&lt;p&gt;Looking at &lt;code&gt;C-h v major-mode&lt;/code&gt;, you'll see:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Automatically becomes buffer-local when set.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To set the default value (and not only a buffer-local value), use &lt;code&gt;(setq-default major-mode 'text-mode)&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, you create a new buffer with &lt;code&gt;generate-new-buffer&lt;/code&gt; but don't actually run &lt;code&gt;set-buffer-major-mode&lt;/code&gt; on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, I suggest to make &lt;code&gt;new-buffer-by-name&lt;/code&gt; itself an interactive function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code then becomes :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default major-mode 'text-mode)&#xA;&#xA;(defun new-buffer-by-name (bufname)&#xA;  &quot;Creates a new buffer by name&quot;&#xA;  (interactive (list &quot;untitled&quot;))&#xA;  (let ((newbuf (generate-new-buffer bufname)))&#xA;    (set-buffer-major-mode newbuf)&#xA;    (switch-to-buffer newbuf)))&#xA;&#xA;(global-set-key (kbd &quot;C-n&quot;) #'new-buffer-by-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-08-05T10:52:00.580" LastActivityDate="2015-08-05T10:52:00.580" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14479" PostTypeId="1" CreationDate="2015-08-05T10:50:05.020" Score="2" ViewCount="266" Body="&lt;p&gt;I'm relatively new to Emacs and org-journal and I'm wondering if I'm doing something wrong or if this is the intended behaviour of org-journal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When creating a journal entry with C-c C-j the current window is split. Entering data works, but I somehow expected to go back to the window configuration before when finishing the entry like in org-mode (C-c c and C-c C-c). Currently the split remains and when doing another C-c C-j the journal file opens in the other split. So in the end I'm toggling between two splits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: testing this on Emacs 24.5.1 on Windows, using org-journal 1.9.6&lt;/p&gt;&#xA;" OwnerUserId="8313" LastEditorUserId="8313" LastEditDate="2015-08-05T10:57:28.150" LastActivityDate="2016-01-05T12:25:55.847" Title="org-journal UI behaviour" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14481" PostTypeId="2" ParentId="13694" CreationDate="2015-08-05T12:56:42.383" Score="0" Body="&lt;p&gt;I eventually got this working by going into iTerm2 preferences and adding a new global shortcut key binding where I entered as Keyboard Shortcut &lt;code&gt;^⌥-&lt;/code&gt;, chose Action &lt;code&gt;Send Escape Sequence&lt;/code&gt; and just typed &lt;code&gt;-&lt;/code&gt; in the Esc+ field. That seems to do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks @Gilles and @PythonNut for their help :)&lt;/p&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2015-08-05T12:56:42.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14482" PostTypeId="1" CreationDate="2015-08-05T13:22:47.340" Score="0" ViewCount="114" Body="&lt;p&gt;I use this code snippet taken from some forum to complete the file path at point on pressing, &lt;code&gt;C-M-/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-expand-file-name-at-point ()&#xA;  &quot;Use hippie-expand to expand the filename&quot;&#xA;  (interactive)&#xA;  (let ((hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name)))&#xA;    (call-interactively 'hippie-expand)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works good most of the time. On occassions, i use bash environment variables like &lt;code&gt;$WS_HOME, $PROJ&lt;/code&gt; inside my shell scripts to keep the path concise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way &lt;code&gt;hippie-file-name-complete&lt;/code&gt; can understand the environment variables, that contain file paths and list out possible completions from there?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2015-08-05T13:53:06.853" LastActivityDate="2015-08-05T13:53:06.853" Title="hippie - complete file name with shell environment variables" Tags="|hippie-expand|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14483" PostTypeId="1" CreationDate="2015-08-05T13:41:40.910" Score="27" ViewCount="2823" Body="&lt;p&gt;In Magit log buffer commits (one per line) are shown with relative date. This is nice for recent commits, but makes little sense for older changes. In particular, this makes it annoyingly hard to relate commit dates to specific date, e.g. to find answer to question &quot;which change might have broken the release on 3rd of April?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to somehow change the way commit dates are shown? I only found &lt;code&gt;magit-duration-spec&lt;/code&gt;, but that's not exactly what I need.&lt;/p&gt;&#xA;" OwnerDisplayName="user8782" LastActivityDate="2018-04-04T06:03:33.980" Title="Magit log dates" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14484" PostTypeId="1" CreationDate="2015-08-05T15:25:44.420" Score="15" ViewCount="2941" Body="&lt;p&gt;I'm modifying some elisp code from linum.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables '(linum-format 'dynamic))&#xA;(defadvice linum-update-window (around linum-dynamic activate)&#xA;   (let* ((w (length (number-to-string&#xA;      (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (concat &quot; %&quot; (number-to-string w) &quot;d &quot;)))&#xA;            ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was able to fix a bug where the indentation was off-by-one by modifying &lt;code&gt;(count-lines (point-min) (point-max))&lt;/code&gt; to &lt;code&gt;(+ (count-lines (point-min) (point-max)) 1)&lt;/code&gt;. That was easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I want to modify it so that the minimum width is 2 by adding an if-conditional where &lt;code&gt;(concat &quot; %&quot; (number-to-string w) &quot;2d &quot;)&lt;/code&gt; if the line number count is &amp;lt; 10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be easy! Add one conditional and copy/paste the concat. Piece of cake, right? I mean, I know what I'm &lt;em&gt;supposed&lt;/em&gt; to do but I rarely touch elisp and I'm always daunted when I have to modify anything with lots of parenthesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;correct&quot; style, from what I understand, is to structure the code based on indentation and wrap the trailing parenthesis at the end of a line rather than on its own. Coming from other 'C' style languages, I struggle with both reading and writing code in this way. So my question is: what am I doing wrong? How am I supposed to edit elisp and navigate around the code such that I don't have to sit there and count every parenthesis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I work with something in elisp that gets too deep I have to shut my door, pull the blinds, and start positioning the parenthesis K&amp;amp;R-style so that I can not only read but modify the darn thing without freaking out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously I'm doing this all wrong. How can I touch elisp like this without fear?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that my question is how to navigate and edit elisp not as a question on style. I am using the following as a style guide already:&#xA;&lt;a href=&quot;https://github.com/bbatsov/emacs-lisp-style-guide&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/bbatsov/emacs-lisp-style-guide&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updates:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to properly format elisp before embarassing yourself on emacs.stackexchange:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mark your elisp and perform &lt;code&gt;M-x indent-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Problem Solution:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For those wanting to know how to perform a right-justify for linum with a minimum width of two, here is the solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice linum-update-window (around linum-dynamic activate)&#xA;  (let* ((w (length (number-to-string&#xA;                     (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (if (&amp;gt; w 1)&#xA;                           (concat &quot; %&quot; (number-to-string w) &quot;d &quot;)&#xA;                         &quot; %2d &quot;)))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9103" LastEditorUserId="9103" LastEditDate="2015-08-27T05:59:42.423" LastActivityDate="2015-08-27T11:37:09.953" Title="How to edit elisp without getting lost in the parentheses" Tags="|elisp|editing|programming|" AnswerCount="9" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14485" PostTypeId="1" AcceptedAnswerId="14619" CreationDate="2015-08-05T16:04:24.093" Score="8" ViewCount="463" Body="&lt;p&gt;&lt;code&gt;dj&lt;/code&gt; in vim deletes the current line as well as the next. It's a bit idiosyncratic (in that it doesn't really make sense as a motion) but I've come to rely on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In evil, however, &lt;code&gt;dj&lt;/code&gt; deletes only the current line. How can I remap it so that it has vim's behaviour?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried a few methods and all don't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-two-lines ()&#xA;  (interactive)&#xA;  (kill-whole-line)&#xA;  (kill-whole-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;using &lt;code&gt;key-chord.el&lt;/code&gt;: &lt;code&gt;(key-chord-define evil-normal-state-map &quot;dj&quot; 'delete-two-lines)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;trying to remap the &lt;code&gt;j&lt;/code&gt; motion in evil to jump two lines (&lt;code&gt;(evil-line-move 2)&lt;/code&gt;). This works but affects every use of &lt;code&gt;j&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;dd&lt;/code&gt; is a linewise shortcut; it's not special-cased, so I can't hook into it (why is evil so elegant...)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(define-key evil-mode-normal-map (kbd &quot;dj&quot;) 'delete-two-lines)&lt;/code&gt;: &lt;code&gt;d&lt;/code&gt; isn't a prefix key, and this seems like it would interfere with evil's &lt;code&gt;d&lt;/code&gt; mapping anyway&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm at my wit's end. Help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9109" LastActivityDate="2016-02-27T15:13:03.060" Title="Making `dj` delete two lines in evil mode" Tags="|evil|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14486" PostTypeId="2" ParentId="14484" CreationDate="2015-08-05T16:08:12.477" Score="6" Body="&lt;p&gt;A good way to edit LISP is by manipulating the AST, instead of the&#xA;individual characters or lines. I've been doing that with my package&#xA;&lt;a href=&quot;https://github.com/abo-abo/lispy&quot;&gt;lispy&lt;/a&gt; that I started 2 years ago.&#xA;I think that it can actually take quite a bit of practice to learn how&#xA;to do this well, but even using just the basics should already help&#xA;you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can explain how I would go about making this change:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Step 1&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The starting position is usually to have the point before the top-level sexp. Here, &lt;code&gt;|&lt;/code&gt; is the point.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;|(defadvice linum-update-window (around linum-dynamic activate)&#xA;   (let* ((w (length (number-to-string&#xA;      (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (concat &quot; %&quot; (number-to-string w) &quot;d &quot;)))&#xA;            ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll want to have the code properly indented, so press &lt;kbd&gt;i&lt;/kbd&gt; once. It will re-indent it nicely.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Step 2&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You'll want to mark &lt;code&gt;&quot;d &quot;&lt;/code&gt; with a region, since a manipulate-able&#xA;object in &lt;code&gt;lispy&lt;/code&gt; is either a list, which doesn't need to be marked,&#xA;or a sequence of symbols or/and lists which needs to be marked with a&#xA;region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press &lt;kbd&gt;at&lt;/kbd&gt; to do so. The &lt;kbd&gt;a&lt;/kbd&gt; command allows to mark&#xA;any single symbol within the parent list, and &lt;kbd&gt;t&lt;/kbd&gt; is the&#xA;index of this particular symbol.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Step 3&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;To wrap the current region with &lt;code&gt;()&lt;/code&gt;, press &lt;kbd&gt;(&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;C-f&lt;/kbd&gt; to move forward one char and insert &lt;code&gt;if&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;(&lt;/kbd&gt; again to insert &lt;code&gt;()&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Insert &lt;code&gt;&amp;gt; w 10&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-f C-m&lt;/kbd&gt; to move the string to a new line.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Step 4&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To clone the string:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Mark the symbol-or-string-at-point with &lt;kbd&gt;M-m&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;c&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you want to deactivate the region in a fancy way and put the point at the very start of the string,&#xA;you can press &lt;kbd&gt;idm&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;i&lt;/kbd&gt; will select the inner contents of the string.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;d&lt;/kbd&gt; will swap point and mark.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;m&lt;/kbd&gt; will deactivate the region&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Or you could do &lt;kbd&gt;m C-b C-b C-b&lt;/kbd&gt; in this case, or &lt;kbd&gt;C-g C-b&#xA;C-b C-b&lt;/kbd&gt;. I think &lt;kbd&gt;idm&lt;/kbd&gt; is better, since it's the same&#xA;regardless of the length of the string. I think &lt;kbd&gt;C-x C-x C-f C-g&lt;/kbd&gt;&#xA;would also work regardless of the string length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, insert &lt;code&gt;2&lt;/code&gt; to obtain the end code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defadvice linum-update-window (around linum-dynamic activate)&#xA;  (let* ((w (length (number-to-string&#xA;                     (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (concat &quot; %&quot; (number-to-string w) (if (&amp;gt; w 10)&#xA;                                                             &quot;2|d &quot;&#xA;                                                           &quot;d &quot;))))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Summary&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The full sequence was: &lt;kbd&gt;at( C-f&lt;/kbd&gt;, &lt;code&gt;if&lt;/code&gt;, &lt;kbd&gt;(&lt;/kbd&gt;, &lt;code&gt;&amp;gt; w 10&lt;/code&gt;, &lt;kbd&gt;C-f C-m M-m cidm&lt;/kbd&gt;, &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you count out the code insertion, the only keys not related to AST manipulation were two &lt;kbd&gt;C-f&lt;/kbd&gt; and one &lt;kbd&gt;C-m&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-08-05T16:08:12.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14487" PostTypeId="2" ParentId="14484" CreationDate="2015-08-05T16:18:41.223" Score="6" Body="&lt;p&gt;You'll get used to it over time, but of course there's lots you can do to help speed it up:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Indentation&lt;/h1&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;There's a method to this madness. In lisp you can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(a-fun (another-fun (magic-macro 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suppose that &lt;code&gt;1&lt;/code&gt; is really a large expression, and you want to indent it on its own line.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(a-fun (another-fun (magic-macro &#xA;  1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is misleading. &lt;code&gt;1&lt;/code&gt; is indented only one slot, even though it's an entire three levels of nesting higher! Better put it by its parent.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(a-fun (another-fun (magic-macro &#xA;                      1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If we use this scheme on your own code, we get this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-variables '(linum-format 'dynamic))&#xA;(defadvice linum-update-window (around linum-dynamic activate)&#xA;  (let* ((w (length (number-to-string&#xA;                      (+ (count-lines (point-min) (point-max)) 1))))       &#xA;          (linum-format &#xA;            (concat &quot; %&quot; (number-to-string w) &quot;d &quot;)))&#xA;     ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the strong correlation between indentation and the level of nesting. Lines with a greater level of nesting are always indented more than lines with less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This alone will help a lot. You can easily see the &quot;shape&quot; of the code, and most other languages have trained you to associate indentation with blocks and blocks with some form of nesting (either explicit or implied).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an exercise, I've removed the nonessential parentheses from the code. You should be able to both read the code and supply the missing parentheses, given basic knowledge of Elisp (namely, what things are functions and values, and the structure of &lt;code&gt;let*&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;custom-set-variables '(linum-format 'dynamic)&#xA;defadvice linum-update-window (around linum-dynamic activate)&#xA;  let* w length number-to-string&#xA;                  + &#xA;                    count-lines (point-min) (point-max) &#xA;                    1       &#xA;         linum-format &#xA;           concat &quot; %&quot; (number-to-string w) &quot;d &quot;&#xA;     ad-do-it&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-05T16:18:41.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14488" PostTypeId="2" ParentId="14484" CreationDate="2015-08-05T17:27:05.047" Score="12" Body="&lt;p&gt;There are a number of add-on packages that might help, such as paredit, smartparens, and lispy. These packages make it easier to navigate and manipulate lisp code so that you can think in s-expressions and let the editor worry about balancing parens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs also has lots of built-in commands for dealing with sexps and lists that are worth learning and may help you get more used to the structure of lisp code. These are generally bound with a &lt;code&gt;C-M-&lt;/code&gt; prefix, such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-f&lt;/code&gt;/&lt;code&gt;C-M-b&lt;/code&gt; to move forward/backward by sexp&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-n&lt;/code&gt;/&lt;code&gt;C-M-p&lt;/code&gt; to move forward/backward by list&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-u&lt;/code&gt;/&lt;code&gt;C-M-d&lt;/code&gt; to move up/down one level&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-t&lt;/code&gt; to swap the two sexps around point&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-k&lt;/code&gt; to kill a sexp&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-SPC&lt;/code&gt; to mark a sexp&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-q&lt;/code&gt; to re-indent a sexp&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The example code you provided might be clearer if you fix the indentation: put point at the beginning of the &lt;code&gt;(defadvice...&lt;/code&gt; and hit &lt;code&gt;C-M-q&lt;/code&gt; to re-indent the entire expression. To replace the &lt;code&gt;(concat...&lt;/code&gt; I would start by putting point at the start of that sexp and hitting &lt;code&gt;C-M-o&lt;/code&gt; to split the line while preserving the indentation. Then add your &lt;code&gt;(if...&lt;/code&gt;, and use the commands above to jump to the end of a list to add another closing paren, back to the beginning to re-indent, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also want to turn on &lt;code&gt;show-paren-mode&lt;/code&gt;, which will highlight the corresponding paren when point is at the start or end of a list. You may prefer to highlight the whole expression rather than the matching paren, so try customizing &lt;code&gt;show-paren-style&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Tyler mentioned in the comments on another answer, you should take a look at the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Parentheses.html&quot;&gt;manual&lt;/a&gt; to learn more about these and related commands.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-08-05T17:52:16.763" LastActivityDate="2015-08-05T17:52:16.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14489" PostTypeId="2" ParentId="14484" CreationDate="2015-08-05T17:42:20.990" Score="2" Body="&lt;p&gt;For basic help with indentation, use TAB and &quot;C-M-q&quot; (&lt;code&gt;indent-pp-sexp&lt;/code&gt;); binding &quot;C-m&quot; to &lt;code&gt;newline-and-indent&lt;/code&gt; will save you having to press TAB after a newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can navigate by sexp with &quot;C-M-left/right/up/down/home/end&quot;, which is very useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're worried about maintaining parenthesis balance, use something like &lt;a href=&quot;https://github.com/Fuco1/smartparens/&quot; rel=&quot;nofollow&quot;&gt;smartparens&lt;/a&gt; (it's a bit more forgiving that &lt;a href=&quot;http://www.emacswiki.org/emacs/ParEdit&quot; rel=&quot;nofollow&quot;&gt;paredit&lt;/a&gt;, which can initially feel like wearing a straitjacket). It also comes with lots of bindings for navigating and editing at the sexp level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, for highlighting parens, start by turning the option on (Options menu-&gt;Highlight matching parentheses, or &lt;code&gt;show-paren-mode&lt;/code&gt;.) You can also use one of the packages mentioned by lawlist in his comment, like &quot;highlight-parenthesis&quot; or &quot;rainbow-delimiters&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2290" LastActivityDate="2015-08-05T17:42:20.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14490" PostTypeId="2" ParentId="14484" CreationDate="2015-08-05T18:06:46.693" Score="5" Body="&lt;p&gt;I'm including this as a different answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes, indentation will fail you. Your recourse then, is to use something like &lt;a href=&quot;https://github.com/Fanael/rainbow-delimiters&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;rainbow-delimiters&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SjLuR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SjLuR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes the nesting level of any paren explicit and easily scanned. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one pretty big problem though: the parens are ludicrously distracting. There's a balance of emphasis here. &lt;code&gt;rainbow-delimiters&lt;/code&gt; will normally put a &lt;em&gt;lot&lt;/em&gt; of emphasis on the parens at the expense of the rest of your code! But if you tone the rainbow faces down, they become progressively harder to scan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can find one set of faces that balances this well, then by all means use it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, one solution (the one that makes me cackle with glee), is to have two sets of faces, and switch between them on the fly. When you're doing other stuff, the faces are dilute and fade into the background:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/MLjPC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MLjPC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when you put the point &lt;em&gt;on&lt;/em&gt; a paren, it punches the parens so you can see the nesting levels:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DQkLD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DQkLD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is the code to do that:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar rainbow-delimiters-switch nil&#xA;  &quot;t if rainbow-delimiters are currently punched&quot;)&#xA;(defvar rainbow-delimiters-face-cookies nil&#xA;  &quot;a list of face-remap-add-relative cookies to reset&quot;)&#xA;&#xA;(make-variable-buffer-local 'rainbow-delimiters-switch)&#xA;(make-variable-buffer-local 'rainbow-delimiters-face-cookies)&#xA;&#xA;(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)&#xA;(add-hook 'text-mode-hook #'rainbow-delimiters-mode)&#xA;&#xA;(with-eval-after-load 'rainbow-delimiters&#xA;  (set-face-foreground 'rainbow-delimiters-depth-1-face &quot;#889899&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-2-face &quot;#9b7b6b&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-3-face &quot;#7b88a5&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-4-face &quot;#889899&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-5-face &quot;#839564&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-6-face &quot;#6391aa&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-7-face &quot;#9d748f&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-8-face &quot;#7b88a5&quot;)&#xA;  (set-face-foreground 'rainbow-delimiters-depth-9-face &quot;#659896&quot;)&#xA;&#xA;  (defun rainbow-delimiters-focus-on ()&#xA;    &quot;Punch the rainbow-delimiters&quot;&#xA;    (setq rainbow-delimiters-face-cookies&#xA;      (list&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-1-face&#xA;          '((:foreground &quot;#3B9399&quot;) rainbow-delimiters-depth-1-face))&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-2-face&#xA;          '((:foreground &quot;#9B471D&quot;) rainbow-delimiters-depth-2-face))&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-3-face&#xA;          '((:foreground &quot;#284FA5&quot;) rainbow-delimiters-depth-3-face))&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-4-face&#xA;          '((:foreground &quot;#3B9399&quot;) rainbow-delimiters-depth-4-face))&#xA;            (face-remap-add-relative 'rainbow-delimiters-depth-5-face&#xA;          '((:foreground &quot;#679519&quot;) rainbow-delimiters-depth-5-face))&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-6-face&#xA;          '((:foreground &quot;#0E73AA&quot;) rainbow-delimiters-depth-6-face))&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-7-face&#xA;          '((:foreground &quot;#9D2574&quot;) rainbow-delimiters-depth-7-face))&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-8-face&#xA;          '((:foreground &quot;#284FA5&quot;) rainbow-delimiters-depth-8-face))&#xA;        (face-remap-add-relative 'rainbow-delimiters-depth-9-face&#xA;          '((:foreground &quot;#199893&quot;) rainbow-delimiters-depth-9-face)))&#xA;      rainbow-delimiters-switch t))&#xA;&#xA;  (defun rainbow-delimiters-focus-off ()&#xA;    &quot;Reset the rainbow-delimiters faces&quot;&#xA;    (mapc #'face-remap-remove-relative rainbow-delimiters-face-cookies)&#xA;    (setq rainbow-delimiters-switch nil))&#xA;&#xA;  (defun rainbow-delimiters-focus-on-maybe ()&#xA;    &quot;Punch the rainbow-delimiters if the point is on a paren&quot;&#xA;    (when (looking-at &quot;[][(){}]&quot;)&#xA;      (unless (or rainbow-delimiters-switch (minibufferp))&#xA;        (rainbow-delimiters-focus-on))))&#xA;&#xA;  (defun rainbow-delimiters-focus-off-maybe ()&#xA;    &quot;Reset the rainbow-delimiters if the point is not on a paren&quot;&#xA;    (unless (looking-at &quot;[][(){}]&quot;)&#xA;      (when rainbow-delimiters-switch&#xA;        (rainbow-delimiters-focus-off))))&#xA;&#xA;  (run-with-idle-timer 0.6 t 'rainbow-delimiters-focus-on-maybe)&#xA;  (run-with-idle-timer 0.1 t 'rainbow-delimiters-focus-off-maybe))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-05T18:06:46.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14491" PostTypeId="1" AcceptedAnswerId="14495" CreationDate="2015-08-05T18:20:51.413" Score="3" ViewCount="2108" Body="&lt;p&gt;I know by &lt;code&gt;M-x set-background-color&lt;/code&gt; or &lt;code&gt;M-x set-foreground-color&lt;/code&gt; one can change the background/foreground of the the entire buffer. Of course this color change only persists in the current session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the same way how can one change the background/foreground color of some characters/words? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if in a buffer I have something like below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Mhf5S.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Mhf5S.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to change the background/foreground color of some characters like below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nwwr6.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nwwr6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I would like that this color change to be persistent in the current session unless I delete these colorful character.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-05T21:07:44.663" LastActivityDate="2015-08-05T21:16:25.793" Title="How to change the background/foreground color of some characters/words?" Tags="|colors|characters|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14492" PostTypeId="2" ParentId="14484" CreationDate="2015-08-05T18:29:38.890" Score="2" Body="&lt;p&gt;As an addition to what others have given as answers, here are my 2 cents:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The automatic indentation provided by &lt;code&gt;emacs-lisp-mode&lt;/code&gt; is essential.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;blink-matching-paren&lt;/code&gt; is on (non-&lt;code&gt;nil&lt;/code&gt;) by default.  Leave it so.&lt;/li&gt;&#xA;&lt;li&gt;I use &lt;code&gt;show-paren-mode&lt;/code&gt;, to highlight the left paren corresponding to the right paren before the cursor.&lt;/li&gt;&#xA;&lt;li&gt;I temporarily delete and retype the right paren before the cursor, if I want to see better where the matching left paren is.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I do &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; use electric pairing or rainbow anything or any other such &quot;help&quot;.  To me those are a bother, not an aid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, &lt;code&gt;electric-pair-mode&lt;/code&gt; is, to me, an inconvenient bother.  But some people love it.  And I imagine that it might be helpful in some other pairing contexts besides Lisp parentheses (I imagine so, but I'm not convinced for such use cases either).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will find what works best for you.  The main things I want to say are: (1) automatic indentation is your friend, as is some way to spot the left paren that matches the right paren before point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, seeing what automatic indentation does for you teaches you immediately that you never again want to put right parens on a line by themselves.  That style of coding, which is ubiquitous in other languages, is just noisy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides the automatic indentation you get with &lt;code&gt;RET&lt;/code&gt; and &lt;code&gt;TAB&lt;/code&gt;, get comfortable using &lt;code&gt;C-M-q&lt;/code&gt;.  (Use &lt;code&gt;C-h k&lt;/code&gt; in &lt;code&gt;emacs-lisp-mode&lt;/code&gt; to find out what these keys do.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-05T18:29:38.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14493" PostTypeId="1" CreationDate="2015-08-05T19:21:49.567" Score="1" ViewCount="61" Body="&lt;p&gt;I found that when I press the tab key, the command I have bound to &lt;kbd&gt;C-i&lt;/kbd&gt; gets run (somewhat unsurprisingly). I would like to keep this command bound to &lt;kbd&gt;C-i&lt;/kbd&gt; but run a different one when pressing the tab key. I have found that I can do this within a keymap by defining &lt;code&gt;(kbd &amp;lt;tab&amp;gt;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/a/654/6761&quot;&gt;this&lt;/a&gt; Emacs.SE post, I found which keymap is responsible for it and that there is a global binding for tab. The keymap doesn't have &lt;code&gt;(kbd &amp;lt;tab&amp;gt;)&lt;/code&gt; bound, but it's translated instead of falling through to the global binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get it to fall through?&lt;/p&gt;&#xA;" OwnerUserId="6761" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-08-05T19:21:49.567" Title="Force keymap to ignore (kbd &lt;tab&gt;) and [tab] even though TAB is defined" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14494" PostTypeId="2" ParentId="14493" CreationDate="2015-08-05T19:21:49.567" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/9631/what-is-the-difference-between-tab-and-tab/9634#comment14342_9634&quot;&gt;This&lt;/a&gt; comment provides a solution: bind the global &lt;code&gt;(kbd &quot;TAB&quot;)&lt;/code&gt; and &lt;code&gt;(kbd &quot;&amp;lt;tab&amp;gt;&quot;)&lt;/code&gt; to different things and Emacs will stop translating the keybinding.&lt;/p&gt;&#xA;" OwnerUserId="6761" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-08-05T19:21:49.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14495" PostTypeId="2" ParentId="14491" CreationDate="2015-08-05T19:39:16.677" Score="2" Body="&lt;p&gt;It's not very clear what you are asking, IMO.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various ways to highlight a particular character (e.g. everywhere in the region or in a buffer).  Library &lt;a href=&quot;http://www.emacswiki.org/emacs/ShowWhiteSpace#HighlightChars&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/a&gt; provides one approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Likewise, there are various ways to highlight a word (e.g. everywhere in the region or in a buffer).  Library &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;Highlight&lt;/a&gt; provides one approach.  Ordinary font-lock and hi-lock provides another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you also asking about &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary#PermanentHighlighting&quot; rel=&quot;nofollow&quot;&gt;persistence of such highlighting&lt;/a&gt; past the current session?  If so, that too is possible.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-05T19:39:16.677" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14497" PostTypeId="2" ParentId="443" CreationDate="2015-08-05T20:45:36.413" Score="2" Body="&lt;p&gt;One way of improving this that I have used (at times) for several years is to display sentences with line breaks as flowing after each other by &lt;em&gt;folding&lt;/em&gt; the line breaks using the facilities of &lt;code&gt;tex-fold&lt;/code&gt; (a part of AUCTeX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&#xA;Mauris pellentesque fringilla justo, quis dapibus velit tincidunt quis?&#xA;Quisque varius ligula arcu, ut imperdiet risus maximus nec.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is folded to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit⁎ Mauris pellentesque fringilla justo, quis dapibus velit tincidunt quis❓  Quisque varius ligula arcu, ut imperdiet risus maximus nec⁎&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've recently put this together as a minor mode in a package. Perhaps someone else will also find this useful:&#xA;&lt;a href=&quot;https://github.com/andersjohansson/tex-fold-linebreaks&quot; rel=&quot;nofollow&quot;&gt;https://github.com/andersjohansson/tex-fold-linebreaks&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9111" LastActivityDate="2015-08-05T20:45:36.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14498" PostTypeId="2" ParentId="14491" CreationDate="2015-08-05T21:16:25.793" Score="2" Body="&lt;p&gt;This demonstration defines a highlighting color and commands which use anonymous faces to highlight a character or word.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-hl-color &quot;#ff00ff&quot;)&#xA;&#xA;(defun my-hl-thing (boundaries)&#xA;  (put-text-property (car boundaries) (cdr boundaries)&#xA;                     'font-lock-face `(:background ,my-hl-color)))&#xA;&#xA;(defun my-hl-character ()&#xA;  (interactive)&#xA;  (my-hl-thing (cons (point) (1+ (point)))))&#xA;&#xA;(defun my-hl-word ()&#xA;  (interactive)&#xA;  (my-hl-thing (bounds-of-thing-at-point 'word)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-08-05T21:16:25.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14499" PostTypeId="1" CreationDate="2015-08-06T00:02:40.267" Score="1" ViewCount="78" Body="&lt;p&gt;My code style for braced languages like C/C++/Java is to use no braces when the statement is a single line. One of my biggest pet peeves is that every IDE I've ever used will not smartly un-indent after this single statement if there is no brace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to use three spaces for my personal style with some other styles using more. I hate having to tap on the backspace key so many times when I do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone seen anything like this for emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already use a custom indentation function which I hope can be expanded to include this feature:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-indentation-width 3&#xA;  &quot;The number of spaces I prefer for line indentation.&quot;)&#xA;&#xA;(defun my-enter ()&#xA;   &quot;Inserts a newline and indents to align with previous line&quot;&#xA;   (interactive)&#xA;   (newline)&#xA;   (unless (looking-back &quot;\\`\n*&quot;)&#xA;      (indent-relative-maybe)))&#xA;&#xA;(defun my-indentation-setup ()&#xA;  &quot;Binds RETURN to the function 'my-enter'&quot;&#xA;  (local-set-key &quot;\r&quot; 'my-enter)&#xA;&#xA;(add-hook 'text-mode-hook 'my-indentation-setup)&#xA;(add-hook 'c++-mode-hook 'my-indentation-setup)&#xA;(add-hook 'c-mode-hook 'my-indentation-setup)&#xA;(add-hook 'java-mode-hook 'my-indentation-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9103" LastEditorUserId="9103" LastEditDate="2015-08-06T00:08:33.763" LastActivityDate="2015-08-06T00:08:33.763" Title="Is there an electric-indent for single-line statements in braced languages?" Tags="|indentation|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14500" PostTypeId="1" AcceptedAnswerId="14502" CreationDate="2015-08-06T00:23:24.440" Score="2" ViewCount="926" Body="&lt;p&gt;My finger tends to linger on the Ctrl key and I happen to hit C-RET quite often. I also use cua-mode which binds this to &lt;code&gt;cua-clear-rectangle-mark&lt;/code&gt;. I don't want C-RET bound to anything while in this mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't seem to unbind it though. I've tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-RET&quot;))&#xA;(global-unset-key (kbd &quot;&amp;lt;C-return&amp;gt;&quot;))&#xA;(global-unset-key [(control return)])&#xA;(define-key global-map (kbd &quot;C-RET&quot;) 'ignore)&#xA;(define-key global-map (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) 'ignore)&#xA;(define-key global-map [(control return)] 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried the following in my .inputrc with no success:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\C-RET&quot;: &quot;\n&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There also doesn't seem to be a cua-mode-map:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Doesn't work&#xA;(define-key cua-mode-map &quot;C-RET&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9103" LastEditorUserId="9103" LastEditDate="2015-08-06T00:51:40.593" LastActivityDate="2015-08-06T01:34:12.347" Title="Unbind C-RET in emacs?" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14502" PostTypeId="2" ParentId="14500" CreationDate="2015-08-06T01:14:04.643" Score="1" Body="&lt;p&gt;In Emacs 25, if you run &lt;code&gt;C-h k C-RET&lt;/code&gt; it will tell you that &lt;code&gt;C-RET&lt;/code&gt; is bound in &lt;code&gt;cua-global-keymap&lt;/code&gt;, so that's where we unset it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key cua-global-keymap [C-return] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems to be set in the same keymap in 24.4 as well.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-08-06T01:34:12.347" LastActivityDate="2015-08-06T01:34:12.347" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14503" PostTypeId="2" ParentId="14444" CreationDate="2015-08-06T02:26:36.227" Score="1" Body="&lt;p&gt;The only thing I know of for this is setting &lt;code&gt;process-adaptive-read-buffering&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; before starting the process.  I don't know whether this will help with your situation or not.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-08-06T02:26:36.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14505" PostTypeId="1" AcceptedAnswerId="14508" CreationDate="2015-08-06T05:21:27.247" Score="2" ViewCount="1132" Body="&lt;p&gt;I currently have a very basic setup for CEDET:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/popup&quot;)&#xA;(require 'popup)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/auto-complete&quot;)&#xA;(require 'auto-complete)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(define-key ac-mode-map (kbd &quot;C-SPC&quot;) 'auto-complete)&#xA;&#xA;(semantic-mode 1)&#xA;(defun my:add-semantic-to-autocomplete() &#xA;  (add-to-list 'ac-sources 'ac-source-semantic)&#xA;)&#xA;(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)&#xA;(global-ede-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's working but the output for C++ is far less than desired. For example, take the following class:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Rectangle {&#xA;   int width;&#xA;   int height;&#xA;public:&#xA;   void set_values (int,int);&#xA;   int area (void);&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output from the auto-completion popup is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set_values m&#xA;width      m&#xA;area       m&#xA;height     m&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I wait a second over each entry it will provide the method signature or property type. But I want to know this information immediately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following will display something more useful but it doesn't appear in a popup: &lt;code&gt;semantic-ia-show-variants&lt;/code&gt;. The format is also difficult to read for large classes when glancing at auto-completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like is an Eclipse-esque popup with nicely formatted variants. I found a screenshot of CEDET providing this kind of behavior here:&#xA;&lt;a href=&quot;http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/u0gIh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/u0gIh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't figure out how to make it do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure CEDET to give me some real meaty completions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I understand from the following links:&#xA;&lt;a href=&quot;http://sourceforge.net/p/cedet/mailman/message/30023381&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://sourceforge.net/p/cedet/mailman/message/30023381&lt;/a&gt;&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/12957786/autocompletion-from-the-keyboard-in-emacs-cedet-semantic?answertab=active#tab-top&quot;&gt;https://stackoverflow.com/questions/12957786/autocompletion-from-the-keyboard-in-emacs-cedet-semantic?answertab=active#tab-top&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems as though there is a discrepancy between the available information and the current release. Another possibility that I'm considering is that there is a discrepancy between the latest development HEAD and the version bundled with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that older versions had an auto-completion popup built-in as something called &quot;senator&quot; which is where the &quot;-menu&quot; functions came from; this would also explain why the popup screenshots I've found are both old and have a distinctly different visual style. The old menu functionality from what I can tell has been removed and that the recommended method is to combine CEDET with auto-complete, which is what I'm doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The information is provided by &lt;code&gt;semantic-ia-complete-symbol&lt;/code&gt; (thanks djangoliv) but &lt;code&gt;semantic-ia-complete-symbol-menu&lt;/code&gt;, part of senator, is no more. So the question now is how to get this information linked in with auto-complete.&lt;/p&gt;&#xA;" OwnerUserId="9103" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-08-07T00:05:04.867" Title="How to make CEDET auto-completion more detailed?" Tags="|cedet|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14506" PostTypeId="2" ParentId="14453" CreationDate="2015-08-06T09:30:57.587" Score="2" Body="&lt;p&gt;Finally I figured out a clumsy solution, which referred to the concept of &lt;code&gt;clipmon&lt;/code&gt;. But very simple with one line's code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-at-time 0 3 (lambda () (interactive) (current-kill 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The kill ring will be synchronized every 3 seconds with system clipboard. Of course you can alter the interval to a even smaller value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: The reason why I need this functionality is that I want to define a command that can be invoked with arguments of what I copied exteriorly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the responses from @kaushalmodi and @YoungFrog.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-08-06T09:51:31.637" LastActivityDate="2015-08-06T09:51:31.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14508" PostTypeId="2" ParentId="14505" CreationDate="2015-08-06T10:25:12.127" Score="1" Body="&lt;p&gt;The completion used in the screenshot is provide by semantic-ia-complete-symbol-menu function, but I doesn't know how to replace the default completion method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW you can map the method on C-TAB for example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-&amp;lt;tab&amp;gt;&quot;) 'semantic-ia-complete-symbol-menu)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope this Help&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-08-06T12:07:29.993" LastActivityDate="2015-08-06T12:07:29.993" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14509" PostTypeId="1" AcceptedAnswerId="14511" CreationDate="2015-08-06T11:21:00.610" Score="19" ViewCount="4195" Body="&lt;p&gt;I have &lt;code&gt;C-x C-k&lt;/code&gt; bound to &lt;code&gt;kill-this-buffer&lt;/code&gt;. But when I enter into a buffer which is running a process like Python or MySQL, if I do &lt;code&gt;C-x C-k&lt;/code&gt; it asks &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Buffer &quot;*Python*&quot; has a running process; kill it (y or n)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I kill process buffers without confirmation?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-08-06T15:43:02.593" LastActivityDate="2022-02-16T22:57:20.617" Title="Kill process buffer without confirmation?" Tags="|buffers|process|kill-buffer|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14510" PostTypeId="2" ParentId="14505" CreationDate="2015-08-06T11:23:25.463" Score="0" Body="&lt;p&gt;Check out the &lt;code&gt;moo-complete&lt;/code&gt; command from &lt;a href=&quot;https://github.com/abo-abo/function-args&quot; rel=&quot;nofollow&quot;&gt;function-args&lt;/a&gt; package.&#xA;It should do exactly what you ask (and it uses CEDET, so zero extra setup):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://camo.githubusercontent.com/20e539f72b35d93bd8b015409c77e9ebf21f5561/68747470733a2f2f7261772e6769746875622e636f6d2f61626f2d61626f2f66756e6374696f6e2d617267732f6d61737465722f646f632f73637265656e73686f742d362e706e67&quot; alt=&quot;demo.png&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-08-06T11:23:25.463" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14511" PostTypeId="2" ParentId="14509" CreationDate="2015-08-06T11:28:49.380" Score="17" Body="&lt;p&gt;Remove the corresponding function from the relevant variable :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq kill-buffer-query-functions (delq 'process-kill-buffer-query-function kill-buffer-query-functions))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How did I find this ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;kill-this-buffer&lt;/code&gt; uses &lt;code&gt;kill-buffer&lt;/code&gt; internally, which references the variable &lt;code&gt;kill-buffer-query-functions&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-06T11:28:49.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14512" PostTypeId="2" ParentId="9835" CreationDate="2015-08-06T11:49:00.253" Score="10" Body="&lt;p&gt;This can be solved by modifying company-transformers with the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push (apply-partially #'cl-remove-if&#xA;                      (lambda (c)&#xA;                        (or (string-match-p &quot;[^\x00-\x7F]+&quot; c)&#xA;                            (string-match-p &quot;[0-9]+&quot; c)&#xA;                            (if (equal major-mode &quot;org&quot;)&#xA;                                (&amp;gt;= (length c) 15)))))&#xA;             company-transformers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this code:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;remove those non-ANSII candidates. &lt;/li&gt;&#xA;&lt;li&gt;remove any completion containing numbers.&lt;/li&gt;&#xA;&lt;li&gt;remove any candidate which is longer than 15 in org-mode.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All kinds of things can be customized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-08-06T12:10:09.863" LastActivityDate="2015-08-06T12:10:09.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14513" PostTypeId="2" ParentId="7779" CreationDate="2015-08-06T11:52:32.750" Score="0" Body="&lt;p&gt;This bug has been fixed in org-mode 8.3.1. &lt;/p&gt;&#xA;" OwnerUserId="2437" LastActivityDate="2015-08-06T11:52:32.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14514" PostTypeId="1" AcceptedAnswerId="14690" CreationDate="2015-08-06T11:56:54.183" Score="12" ViewCount="2419" Body="&lt;p&gt;To attach one file when in message-mode (e.g. when posting from Gnus), one does &lt;code&gt;C-c C-a&lt;/code&gt;. What's the recommended way for attaching multiple files ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Repeating &lt;code&gt;C-c C-a&lt;/code&gt; can become tiresome after a while, because it asks three questions everytime.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-13T22:47:04.697" Title="How to attach multiple files in `message-mode`?" Tags="|gnus|message|message-mode|attachment|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14515" PostTypeId="1" AcceptedAnswerId="14635" CreationDate="2015-08-06T12:41:50.133" Score="9" ViewCount="740" Body="&lt;p&gt;I typeset my manuscript in org-mode with &lt;code&gt;visual-line-mode&lt;/code&gt; turned on. Physically one of my paragraphs is just a line which is soft-wrapped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, when I tried to git diff (magit) to see what I have changed, all of this line (paragraph) is marked to be changed. I could not find out which part of this paragraph have been changed simply. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there should be some solutions regrading this issue, but I could not find any answer from website. Can anyone share your good solution?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2274" LastEditDate="2015-08-15T23:19:46.667" LastActivityDate="2015-08-15T23:19:46.667" Title="How to well deal with the git diff with compatible to visual-line-mode?" Tags="|magit|git|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14516" PostTypeId="2" ParentId="14484" CreationDate="2015-08-06T14:36:42.410" Score="4" Body="&lt;p&gt;If you indent your code, then you really need to indent it properly. Lisp developers have expectations what properly indented should look like. This does not mean the code looks all the same. There are still different ways to format code.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how long should a line be?&lt;/li&gt;&#xA;&lt;li&gt;how to distribute a function/macro call over lines?&lt;/li&gt;&#xA;&lt;li&gt;how many spaces of indentation should there be?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice linum-update-window (around linum-dynamic activate)&#xA;   (let* ((w (length (number-to-string&#xA;      (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (concat &quot; %&quot; (number-to-string w) &quot;d &quot;)))&#xA;            ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect that indentation shows containment in some way. But not in your code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default your code might be indented like this. Other answers described how you can do that with the help of Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice linum-update-window (around linum-dynamic activate)&#xA;  (let* ((w (length (number-to-string&#xA;                     (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (concat &quot; %&quot; (number-to-string w) &quot;d &quot;)))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect that the &lt;code&gt;let&lt;/code&gt; bound variables start on the same vertical column. I would also expect that the &lt;em&gt;body&lt;/em&gt; of the &lt;code&gt;let&lt;/code&gt; is less indented. We learn how a &lt;code&gt;let&lt;/code&gt; should be indented. Once you train that a bit, it's a visual pattern that's easy to recognize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main visual building blocks in the code are the &lt;code&gt;defadvice&lt;/code&gt;, &lt;code&gt;let*&lt;/code&gt; and a bunch of function calls. The &lt;code&gt;def&lt;/code&gt; in the name tells me that it is a definition followed by a name, an argument list and a body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus I like to see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;defadvice name arglist&#xA;  body&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;let*&lt;/code&gt; would be:  &lt;code&gt;let*&lt;/code&gt;, a list of bindings and a body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus I like to see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let*  list of bindings&#xA;  body&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More detailed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let*   binding1&#xA;       binding2&#xA;       binding3&#xA;  body&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a function call I like to see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FUNCTIONNAME ARG1 ARG2 ARG3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FUNCTIONNAME ARG1&#xA;             ARG2&#xA;             ARG3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FUNCTIONNAME&#xA;  ARG1&#xA;  ARG2&#xA;  ARG3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which one gets used depends on how long the arguments are. We don't want to make lines too long and each arg on its own line allows us to have more structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you need to write your code using those patterns and you need to make sure that the reader can easily identify those patterns in your code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parentheses should directly enclose their constructs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sin 10)&#xA;&#xA;(sin&#xA;  10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Avoid whitespace examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(  sin 10  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&#xA;   sin&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sin 10&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Lisp, the parentheses have no language syntactic function, they are a part of the syntax of the list data structure (s-expressions). Thus we write lists and format the lists. For formatting the list contents we use knowledge about the Lisp programming language. A &lt;code&gt;let&lt;/code&gt; expression should be formatted different than a function call. Still both are lists and the parentheses should directly enclose the lists. There are some examples where it makes sense to have a single parenthesis on a line, but use that rarely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the parentheses to support you finding the expression boundaries. Let them help you to move from list to list, to edit lists, to cut&amp;amp;copy lists, to replace lists, to indent/format lists, select lists,...&lt;/p&gt;&#xA;" OwnerUserId="9120" LastEditorUserId="9120" LastEditDate="2015-08-06T18:06:05.573" LastActivityDate="2015-08-06T18:06:05.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14517" PostTypeId="1" AcceptedAnswerId="14520" CreationDate="2015-08-06T14:39:58.263" Score="1" ViewCount="242" Body="&lt;p&gt;If you want to use &lt;code&gt;require&lt;/code&gt;, you can only use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'foo)&#xA;(require 'bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But you can't do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'foo&#xA;         'bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would it not be more easier and faster if &lt;code&gt;require&lt;/code&gt; accepts the argument structure in the same way as &lt;code&gt;setq&lt;/code&gt; does:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq foo t&#xA;        bar t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="50" LastEditDate="2015-08-06T16:00:24.013" LastActivityDate="2015-08-06T16:00:24.013" Title="Why is require different from setq in multiple arguments?" Tags="|elisp|" AnswerCount="3" CommentCount="13" ClosedDate="2015-08-06T15:22:38.440" ContentLicense="CC BY-SA 3.0" />
  <row Id="14518" PostTypeId="2" ParentId="14517" CreationDate="2015-08-06T14:50:56.390" Score="4" Body="&lt;p&gt;&lt;code&gt;require&lt;/code&gt; already accepts additional arguments.  In particular, you can do a &quot;soft&quot; require this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'foo nil t) ; No error raised if library foo is not available&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nothing special would be gained by letting you do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'foo  nil nil&#xA;         'bar  nil nil&#xA;         'toto nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You can easily write your own macro to do what you request, however.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-06T14:50:56.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14519" PostTypeId="2" ParentId="14517" CreationDate="2015-08-06T14:52:08.813" Score="3" Body="&lt;p&gt;That might be more convenient in the simple case of just listing a bunch of features to load. Note however that &lt;code&gt;require&lt;/code&gt; can take some optional arguments:&lt;/p&gt;&#xA;&lt;p&gt;From the doc string (with some stuff elided):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(require FEATURE &amp;amp;optional FILENAME NOERROR)&lt;/p&gt;&#xA;&lt;p&gt;If feature FEATURE is not loaded, load it from FILENAME...If FILENAME&#xA;is omitted, the printname of FEATURE is used as the file name... If&#xA;the optional third argument NOERROR is non-nil, then return nil if the&#xA;file is not found instead of signaling an error...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-06T14:52:08.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14520" PostTypeId="2" ParentId="14517" CreationDate="2015-08-06T14:58:40.933" Score="1" Body="&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/dolist.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dolist&lt;/code&gt;&lt;/a&gt; to avoid repetitive code if you like.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(dolist (pkg '(pkg1 pkg2 pkg3))&#xA;  (require pkg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Above will be equivalent to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'pkg1)&#xA;(require 'pkg2)&#xA;(require 'pkg3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advantage is that you can also specify the identical arguments you might need to pass to a bunch of &lt;code&gt;require&lt;/code&gt;s:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(dolist (pkg '(pkg1 pkg2 pkg3))&#xA;  (require pkg nil :noerror))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-08-06T14:58:40.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14521" PostTypeId="1" AcceptedAnswerId="14524" CreationDate="2015-08-06T17:31:43.130" Score="3" ViewCount="670" Body="&lt;p&gt;In Vim, &lt;code&gt;Ctrl-A&lt;/code&gt; can be used in Insert-mode to &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/insert.html#ins-special-keys&quot; rel=&quot;nofollow&quot;&gt;insert previously inserted text&lt;/a&gt;, much as the &quot;dot&quot; (&lt;code&gt;.&lt;/code&gt;) command can be used in Normal-mode. For context and a demonstration, watch from &lt;a href=&quot;https://youtu.be/3TX3kV3TICU?t=2m25s&quot; rel=&quot;nofollow&quot;&gt;~2m25s&amp;nbsp;-&amp;nbsp;5m08s&lt;/a&gt; in George Brocklehurst's ThoughtBot talk, &quot;Let Vim Do the Typing&quot;, or read the excerpt I've transcribed below.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is a special register&#xA;  called &quot;dot&quot;. The &quot;dot&quot; register contains whatever the last text you&#xA;  inserted was, the last time you were in Insert-mode. The last time&#xA;  I was in Insert-mode, I inserted &quot;Hello&amp;lt;space&amp;gt;world&amp;lt;newline&amp;gt;&quot;, so if I&#xA;  go back into Insert-mode and I hit &lt;code&gt;Ctrl-R&lt;/code&gt;, and then I hit &lt;code&gt;.&lt;/code&gt;, I&#xA;  reinsert that entire thing. &lt;strong&gt;But even cooler, if I just hit &lt;code&gt;Ctrl-A&lt;/code&gt;,&#xA;  Vim just does that for me.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is: how can I obtain this functionality in Evil mode?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the default settings, entering &lt;code&gt;C-a&lt;/code&gt; while in the Insert state of Evil mode just moves my cursor to the beginning of the line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried adding&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-insert-state-map &quot;\C-a&quot; 'evil-repeat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my .emacs file after the call to Evil, but this does not behave quite as expected: on the first invocation after entering the Insert state, it inserts whatever character was previously used to enter the Insert state (e.g. &lt;code&gt;i&lt;/code&gt; or &lt;code&gt;I&lt;/code&gt; or &lt;code&gt;o&lt;/code&gt; or suchlike), and then inserts the expected text. On subsequent invocations, it does not appear to do anything.&lt;/p&gt;&#xA;" OwnerDisplayName="user8341" LastEditorDisplayName="user8341" LastEditDate="2015-08-06T23:26:27.467" LastActivityDate="2023-03-03T20:56:34.040" Title="Insert mode: make C-a insert previously inserted text" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14522" PostTypeId="1" AcceptedAnswerId="14799" CreationDate="2015-08-06T17:39:27.483" Score="3" ViewCount="199" Body="&lt;p&gt;&lt;strong&gt;Qestion&lt;/strong&gt;:&#xA;Is there a way to make eshell/rm (especially) either display a completion buffer even for few files or remove the . and .. entries for eshell/rm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt; (and some ranting):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I learned the hard way that in &lt;code&gt;eshell/ls&lt;/code&gt; and &lt;code&gt;eshell/rm&lt;/code&gt; tab completes differently.&#xA;While eshell/ls has the behavior I expect(sortof) eshell/rm has a rater &quot;disturbing&quot; querk...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;lets say you have &lt;code&gt;~/Download/this_dir/somefile.txt&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You go to &lt;code&gt;$ ls ~/Download/this_dir/&lt;/code&gt; and tab complete &lt;code&gt;ls&lt;/code&gt; will complete to the file. &#xA;However, if you do the same with &lt;code&gt;rm&lt;/code&gt; it will cycle through the following outputs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ rm ~/Download/this_dir/somefile.txt&#xA;$ rm ~/Download/this_dir/./&#xA;$ rm ~/Download/this_dir/../&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;notice the last entry points to the parent directory (ouch). &#xA;I (may be to my own fault) if I expect only one file in this directory press tab a number of times just to make sure I am at the top which made me cycle to the parent directory entry, which is hard to see if the filepath/name is long and hit enter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional Investigation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realized that the TAB key is bound to pcomplete which is discussed &lt;a href=&quot;https://masteringemacs.org/article/pcomplete-context-sensitive-completion-emacs&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; but I haven't found the exact thing to help me.&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2015-08-17T18:28:53.527" LastActivityDate="2015-08-17T18:28:53.527" Title="How do I change behaviour of eshell/rm (rm in eshell) tab completion?" Tags="|completion|eshell|builtin|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14523" PostTypeId="1" CreationDate="2015-08-06T17:47:46.410" Score="1" ViewCount="77" Body="&lt;p&gt;I have the following code in my init files for auto saving the desktop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;(setq desktop-dirname             (concat user-emacs-directory &quot;tmp/&quot;)&#xA;      desktop-base-file-name      &quot;emacs-desktop&quot;&#xA;      desktop-base-lock-name      &quot;lock&quot;&#xA;      desktop-path                (list desktop-dirname)&#xA;      desktop-save                t&#xA;      desktop-load-locked-desktop nil)&#xA;(add-to-list 'desktop-globals-to-save 'file-name-history)&#xA;(add-to-list 'desktop-modes-not-to-save 'dired-mode)&#xA;(add-to-list 'desktop-modes-not-to-save 'Info-mode)&#xA;(add-to-list 'desktop-modes-not-to-save 'info-lookup-mode)&#xA;(add-to-list 'desktop-modes-not-to-save 'fundamental-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when by some mistake I open another session of Emacs (by running &lt;code&gt;emacs24&lt;/code&gt; and not &lt;code&gt;emacsclient&lt;/code&gt;), and I want to close it, Emacs prompts me for a place to save the destop file: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Directory of desktop file: ~/&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The problem is that there is no way to abort and simply tell this Emacs session to end (I have to kill the task by force from the terminal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to avoid this behavior, say by instructing the new session not to bug me with the desktop file?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="50" LastEditDate="2015-08-06T23:21:02.933" LastActivityDate="2015-08-06T23:21:02.933" Title="Aborting desktop save without aborting Emacs close" Tags="|desktop|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14524" PostTypeId="2" ParentId="14521" CreationDate="2015-08-06T18:27:48.533" Score="3" Body="&lt;p&gt;&lt;code&gt;evil-repeat&lt;/code&gt; does something else, it repeats the last &lt;em&gt;command&lt;/em&gt;, not&#xA;insertion.  Here's an approach actually going for what you've&#xA;described &lt;code&gt;C-a&lt;/code&gt; to do.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-evil-paste-last-insertion ()&#xA;  (interactive)&#xA;  (evil-paste-from-register ?.))&#xA;&#xA;(eval-after-load 'evil-maps&#xA;  '(define-key evil-insert-state-map (kbd &quot;C-a&quot;) 'my-evil-paste-last-insertion))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;edit: &lt;a href=&quot;https://bitbucket.org/lyro/evil/commits/ee2a750b7381&quot; rel=&quot;nofollow&quot;&gt;It's part of Evil now&lt;/a&gt;!&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-08-09T10:46:31.213" LastActivityDate="2015-08-09T10:46:31.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14525" PostTypeId="1" AcceptedAnswerId="14529" CreationDate="2015-08-06T18:28:18.783" Score="15" ViewCount="2896" Body="&lt;p&gt;In Emacs, one can use asterisks * to achieve bold font, for example, *&lt;strong&gt;bold&lt;/strong&gt;*. My question is can I make the asterisks invisible? i.e. &lt;strong&gt;bold&lt;/strong&gt; instead of *&lt;strong&gt;bold&lt;/strong&gt;*.&#xA;Same question for strike through, italics, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this should be achievable. As an example, one can set the org-indent asterisks the same color of the background, so it becomes invisible: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline one&#xA;** Headline two&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;vs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline one&#xA; * Headline two&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can still move the caret over to see the asterisks there, which is nice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to my question, I don't know if or how to do the same thing for the markups in text formatting.&lt;/p&gt;&#xA;" OwnerUserId="5204" LastEditorUserId="5204" LastEditDate="2015-08-07T21:30:55.037" LastActivityDate="2015-08-07T21:30:55.037" Title="Make org-mode markup symbols invisible?" Tags="|org-mode|font-lock|formatting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14527" PostTypeId="1" CreationDate="2015-08-06T18:52:34.293" Score="1" ViewCount="874" Body="&lt;p&gt;Switching to &lt;code&gt;*Messages*&lt;/code&gt; causes evil-leader keys not to be used and &lt;code&gt;:q&lt;/code&gt; tries to quit the whole emacs instance from this buffer, but not other buffers.  Also the &lt;code&gt;C-w c&lt;/code&gt; (to close pane) doesn't work because it's the last buffer instance.  I end up having to kill the buffer then switch or load a blank file and switch, or use &lt;code&gt;C-x b&lt;/code&gt; to switch buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few other buffers have weird behavior like that. Any ideas on how to make it more efficient so I don't have to remember which buffer/mode I'm in?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference my .emacs for leader:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-mode 1)&#xA;(global-evil-leader-mode)&#xA;(evil-leader/set-key&#xA;  &quot;n&quot; 'neotree-toggle&#xA;  &quot;t&quot; 'elscreen-create&#xA;  &quot;h&quot; 'elscreen-previous&#xA;  &quot;l&quot; 'elscreen-next&#xA;  &quot;p&quot; 'projectile-find-file&#xA;  &quot;b&quot; 'switch-to-buffer&#xA;  &quot;x&quot; 'elscreen-kill&#xA;  &quot;k&quot; 'kill-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9087" LastEditorUserId="9087" LastEditDate="2015-08-06T19:52:38.183" LastActivityDate="2015-08-06T19:52:38.183" Title="Some buffers don't allow evil mode commands" Tags="|buffers|evil|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14528" PostTypeId="1" CreationDate="2015-08-06T18:53:52.820" Score="3" ViewCount="734" Body="&lt;p&gt;I'm seeing interesting behavior when I try to copy text between other applications and emacs on arch linux, when using evil-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I have a region selected in emacs, and then click to focus chrome, the region selected is my clipboards contents. I actually only want my region copy'd to my clipboard when I yank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also whenever I copy text in chrome, and then focus my emacs window, If I already have a region selected in emacs, that region is now what &lt;code&gt;evil-paste-after&lt;/code&gt; produces. I expect my copied text from chrome to be pasted, not the region I happen to have selected.&#xA;If I have no visually selected region in emacs, then then my next &lt;code&gt;evil-paste-after&lt;/code&gt; is actually my copy from chrome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen others remark about &lt;code&gt;mouse-drag-copy-region&lt;/code&gt; and have the line&#xA;&lt;code&gt;(setq mouse-drag-copy-region nil)&lt;/code&gt; set in my config. This setting seemingly works for me when I'm not using evil-mode. But with evil-mode enabled, my mouse selections end up copying to the clipboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe &lt;a href=&quot;https://emacs.stackexchange.com/questions/2624/how-to-disable-copy-on-selection-with-evil-mode-mac-24-4&quot;&gt;this answer&lt;/a&gt; may solve my issue if I can alter it to be for my platform, instead of OSX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These questions also may be related &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/17127009/how-to-disable-emacs-evil-selection-auto-copies-to-clipboard/23254728#23254728&quot;&gt;How to disable emacs evil selection auto copies to clipboard&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/9344/pasting-in-evil-mode-when-theres-an-active-selection-copies-the-selection&quot;&gt;Pasting in evil-mode when there&amp;#39;s an active selection copies the selection&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4090" LastEditorUserId="4090" LastEditDate="2015-08-06T21:05:30.790" LastActivityDate="2015-08-06T21:05:30.790" Title="disabling evil auto copying of selection to clipboard on frame focus" Tags="|evil|clipboard|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14529" PostTypeId="2" ParentId="14525" CreationDate="2015-08-06T19:02:59.747" Score="21" Body="&lt;p&gt;If your question is specifically about org-mode and its emphasis markup: try customizing &lt;code&gt;org-hide-emphasis-markers&lt;/code&gt;. You can set that to &lt;code&gt;t&lt;/code&gt; to hide the markers around words in bold, italics, etc. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-08-06T19:02:59.747" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14530" PostTypeId="1" CreationDate="2015-08-06T19:15:37.430" Score="1" ViewCount="173" Body="&lt;p&gt;Emacs is my weapon of choice for documenting code, not least because of its great support for formatting comments. However, there is one thing that is slowing me down in scala-mode2. When I have a line that starts with an &lt;code&gt;@param&lt;/code&gt; annotation the &lt;code&gt;fill-paragraph&lt;/code&gt; function does not wrap the line. If I remove the &lt;code&gt;@&lt;/code&gt; from the &lt;code&gt;@param&lt;/code&gt; then the &lt;code&gt;fill-paragraph&lt;/code&gt; works. So I find myself writing some docs about a parameter, removing the &lt;code&gt;@&lt;/code&gt; from &lt;code&gt;@param&lt;/code&gt;, running &lt;code&gt;fill-paragraph&lt;/code&gt;, and then adding the &lt;code&gt;@&lt;/code&gt; back in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA; * param without the leading @ character fill-paragraph is happy to&#xA; * wrap this line.&#xA; * &#xA; * @param with the leading @ character fill-paragraph is refuses to wrap this line.&#xA; */&#xA;class BlahBlah&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only Scala customization variable I have set is &lt;code&gt;(scala-indent:use-javadoc-style t)&lt;/code&gt;. The issue persists when set to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 24.5.1 with the latest scala-mode2 from the public repos (20150617.2350) -- just upgraded from a 201407 version that had the same problem.&lt;/p&gt;&#xA;" OwnerUserId="9090" LastActivityDate="2015-08-06T19:15:37.430" Title="How to get fill-paragraph in a scala multi-line comment to wrap?" Tags="|fill-paragraph|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14531" PostTypeId="1" CreationDate="2015-08-06T19:52:46.193" Score="0" ViewCount="763" Body="&lt;p&gt;When I'm in a shell and I change buffers, if I switch back to the shell buffer, the cursor has moved back a character and I can't start typing new shell commands until I hit &lt;code&gt;-&amp;gt;&lt;/code&gt; first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens even with: &lt;code&gt;(setq evil-move-cursor-back nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using evil. This doesn't happen when with &lt;code&gt;emacs -Q&lt;/code&gt; or in spacemacs, so there must be something wrong with my config, but I don't know what to look for that might be causing it.&lt;/p&gt;&#xA;" OwnerUserId="5504" LastActivityDate="2015-08-06T21:35:01.313" Title="In shell, eshell and comint-modes, the cursor moves back one chacacter when I switch buffers" Tags="|evil|shell|eshell|comint|cursor|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14532" PostTypeId="2" ParentId="14531" CreationDate="2015-08-06T20:27:45.910" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;there must be something wrong with my config, but I don't know what to look for that might be causing it.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So that's your &lt;strong&gt;question&lt;/strong&gt;, in fact: How do I find how my init file caused a problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;answer&lt;/strong&gt; is to use the usual &lt;em&gt;binary search&lt;/em&gt; (&lt;em&gt;O(logN)&lt;/em&gt;): &lt;strong&gt;Recursively bisect&lt;/strong&gt; your init file until you find what introduces the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this by commenting out 1/2 of the file, then 3/4, 7/8,... You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment-out selected text, and the same command with &lt;code&gt;C-u&lt;/code&gt; to uncomment it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-06T20:27:45.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14533" PostTypeId="2" ParentId="14531" CreationDate="2015-08-06T21:03:18.130" Score="2" Body="&lt;p&gt;It was easier to find than I thought.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was the culprit &lt;code&gt;(hiwin-activate)&lt;/code&gt; from &lt;a href=&quot;https://github.com/tomoya/hiwin-mode&quot; rel=&quot;nofollow&quot;&gt;hiwin-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I opened this issue: &lt;a href=&quot;https://github.com/yoshida-mediba/hiwin-mode/issues/7&quot; rel=&quot;nofollow&quot;&gt;https://github.com/yoshida-mediba/hiwin-mode/issues/7&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;UPDATE&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I switched to &lt;a href=&quot;https://github.com/mina86/auto-dim-other-buffers.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mina86/auto-dim-other-buffers.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5504" LastEditorUserId="5504" LastEditDate="2015-08-06T21:35:01.313" LastActivityDate="2015-08-06T21:35:01.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14534" PostTypeId="1" AcceptedAnswerId="14600" CreationDate="2015-08-06T21:44:02.767" Score="0" ViewCount="185" Body="&lt;p&gt;When I relaunched emacs after updating some packages, I had an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-already-exists &quot;File already exists &quot;/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/list-utils-20140508.1341/list-utils-pkg.el&quot;)&#xA;  write-region(&quot;(define-package \&quot;list-utils\&quot; \&quot;20140508.1341\&quot; \&quot;List-manipulation utility functions\&quot; (quote nil))\n&quot; nil &quot;/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/list-utils-20140508.1341/list-utils-pkg.el&quot; nil nil nil excl)&#xA;  package-unpack-single(&quot;list-utils&quot; &quot;20140508.1341&quot; &quot;List-manipulation utility functions&quot; nil)&#xA;  package-download-single(list-utils &quot;20140508.1341&quot; &quot;List-manipulation utility functions&quot; nil)&#xA;  package-download-transaction((ucs-utils list-utils pcache persistent-soft font-utils unicode-fonts))&#xA;  package-install(unicode-fonts)&#xA;  ergoemacs-component-struct--ensure(unicode-fonts)&#xA;  ergoemacs-component-struct--apply-inits()&#xA;  run-hooks(ergoemacs-mode-startup-hook)&#xA;  ergoemacs-mode(1)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/linevich/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 524&#xA;  load-with-code-conversion(&quot;/home/linevich/.emacs.d/init.el&quot; &quot;/home/linevich/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/linevich/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to remove this file, and had the next one traceback:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-already-exists &quot;Файл вже існує&quot; &quot;/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/pcache-20150125.1653/pcache-pkg.el&quot;)&#xA;  write-region(&quot;(define-package \&quot;pcache\&quot; \&quot;20150125.1653\&quot; \&quot;persistent caching for Emacs\&quot; (quote ((eieio \&quot;1.3\&quot;))))\n&quot; nil &quot;/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/pcache-20150125.1653/pcache-pkg.el&quot; nil nil nil excl)&#xA;  package-unpack-single(&quot;pcache&quot; &quot;20150125.1653&quot; &quot;persistent caching for Emacs&quot; ((eieio (1 3))))&#xA;  package-download-single(pcache &quot;20150125.1653&quot; &quot;persistent caching for Emacs&quot; ((eieio (1 3))))&#xA;  package-download-transaction((ucs-utils list-utils pcache persistent-soft font-utils unicode-fonts))&#xA;  package-install(unicode-fonts)&#xA;  ergoemacs-component-struct--ensure(unicode-fonts)&#xA;  ergoemacs-component-struct--apply-inits()&#xA;  run-hooks(ergoemacs-mode-startup-hook)&#xA;  ergoemacs-mode(1)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/linevich/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 524&#xA;  load-with-code-conversion(&quot;/home/linevich/.emacs.d/init.el&quot; &quot;/home/linevich/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/linevich/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I removed this file too, I had the same error as at the beginning &quot;list-utils-pkg.el&quot; exists.&lt;br&gt;&#xA;How to fix this?&lt;br&gt;&#xA;My config is messy, but I think that the problematic package is ergoemacs which tries to install some packages.&lt;br&gt;&#xA;&lt;a href=&quot;https://bitbucket.org/snippets/linevich/894n4&quot; rel=&quot;nofollow&quot;&gt;Config here&lt;/a&gt;.&lt;br&gt;&#xA;P.S Sorry for my English :)&lt;/p&gt;&#xA;" OwnerUserId="2759" LastEditorUserId="11923" LastEditDate="2016-05-19T21:07:10.870" LastActivityDate="2016-05-19T21:07:10.870" Title="Errors after update: &quot;File already exists error list-utils-pkg.el&quot;" Tags="|init-file|files|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14535" PostTypeId="1" AcceptedAnswerId="59295" CreationDate="2015-08-06T22:47:37.433" Score="9" ViewCount="2321" Body="&lt;p&gt;I'd like use &lt;code&gt;org-refile&lt;/code&gt; and select the heading with helm with an interface like &lt;code&gt;helm-org-in-buffer-headings&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can use &lt;code&gt;helm-org-in-buffer-headings&lt;/code&gt; to do this using &lt;code&gt;f2&lt;/code&gt;, but is there a way to have &lt;code&gt;org-refile&lt;/code&gt; do specifically this?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2020-06-27T03:15:39.647" Title="How can I use helm with org-refile?" Tags="|org-mode|helm|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14536" PostTypeId="1" AcceptedAnswerId="14540" CreationDate="2015-08-06T23:01:59.390" Score="5" ViewCount="502" Body="&lt;p&gt;To copy the character at point usually I do &lt;code&gt;Shift-&amp;lt;right&amp;gt; M-w&lt;/code&gt;. I am wondering what are the alternative ways to do this action using only the Emacs standard keybindings (maybe with minimal keystrokes but this is not very important). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specially when working with unicode characters, it is easier to copy-paste them rather than insert them directly, this is maybe a reason why a convenient shortcut for copying a character would be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps an inconvenience with &lt;code&gt;Shift-&amp;lt;right&amp;gt; M-w&lt;/code&gt; is that the fours keys involving in this action are a little far away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course one can define a personal shortcut for this, but I am looking for a standard shortcut.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: It appears that in vim mode &lt;code&gt;vy&lt;/code&gt; can do this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I appears that the short answer to my question is &lt;code&gt;no&lt;/code&gt;. &#xA;For this reason I accepted the answer given by &lt;code&gt;Emacs User&lt;/code&gt;.&#xA;An alternative solution is the following: We can exploit the fact that the shortcut &lt;code&gt;Meta-w&lt;/code&gt;  bounds to nothing if a region is selected. Hence we can use the ordinary &lt;code&gt;Meta-w&lt;/code&gt; to copy the character with the following settings The first function was suggested by &lt;code&gt;lawlist&lt;/code&gt;.&#xA;This is the best alternative way I found without introducing an extra shortcut.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-copy-region-as-kill ()&#xA;  (interactive) (copy-region-as-kill (point) (1+ (point))))&#xA;&#xA;(defun my-copy-character () (interactive)&#xA;       (if (region-active-p) (kill-ring-save (region-beginning) (region-end))&#xA;     (my-copy-region-as-kill)))&#xA;&#xA;(global-set-key (kbd &quot;M-w&quot;) 'my-copy-character)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-12-27T07:44:03.910" LastActivityDate="2016-12-27T07:44:03.910" Title="Alternative shortcuts to copy the character" Tags="|key-bindings|copy-paste|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14537" PostTypeId="1" CreationDate="2015-08-07T01:23:52.813" Score="4" ViewCount="1494" Body="&lt;p&gt;From what I understand, I should be able to get mouse scrolling to work in emacs nox mode with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'mouse)&#xA;(xterm-mouse-mode t)&#xA;(mouse-wheel-mode t)&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;wheel-up&amp;gt;&quot;) '(lambda () (interactive) (scroll-up 1)))&#xA;(global-set-key (kbd &quot;&amp;lt;wheel-down&amp;gt;&quot;) '(lambda () (interactive) (scroll-down 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But for some reason I'm not getting the  or  signals. Instead I get this from &lt;code&gt;C-h k&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wheel up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mintty - ESC [ M ` X 1-&#xA;xterm  - ESC [ M ` ] &amp;amp;-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Wheel down:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mintty - ESC [ M a r --&#xA;xterm  - ESC [ M a J /-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I scroll down more than once I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;down-mouse-66-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;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.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally I'd used &lt;code&gt;Ctrl-v&lt;/code&gt; in bash for something like this but obviously it just scrolls the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;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?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what to do with this.&lt;/p&gt;&#xA;" OwnerUserId="9103" LastActivityDate="2024-03-24T07:05:35.673" Title="Terminal Emacs not receiving &lt;wheel-up&gt; or &lt;wheel-down&gt;?" Tags="|scrolling|mouse|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14538" PostTypeId="1" CreationDate="2015-08-07T02:33:50.687" Score="3" ViewCount="2029" Body="&lt;p&gt;I am newbie here, need some help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After upgrade magit to v2.1.0 this morning, i found some short keys are different from the early version. What bothers me is this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when I use some short key(for example 'b'), it shows the option windows, in early version, i just type another short key in the option window to do the action (like checkout branch). But now in v2.1.0 i find i can't do it anymore. As I use evil-mode for vim operation, the option windows is in evil-mode, and i only can use magit short key after i enter the insert mode of evil-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tells me how to disable evil-mode in the whole magit?&lt;/p&gt;&#xA;" OwnerUserId="8691" LastEditorUserId="10" LastEditDate="2015-08-07T09:06:52.663" LastActivityDate="2015-08-07T09:14:10.303" Title="Disable evil-mode in magit" Tags="|magit|evil|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14540" PostTypeId="2" ParentId="14536" CreationDate="2015-08-07T03:24:57.407" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;but I am looking for a standard shortcut&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm afraid there's not one for such a purpose, but you can adapt standard ways. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;get it into kill-ring and then re-use as shown by lawlist above&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've used C-/ as my shortcut key. This is useful for only the last character. What if you frequently use a handful of unicode characters? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can saves to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Registers.html#Text-Registers&quot; rel=&quot;nofollow&quot;&gt;registers&lt;/a&gt; beforehand for all the unicode characters you want and then restore from registers as needed. This can be very fast and convenient if you especially need to use multiple machines and don't have much time for configuration.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-08-07T03:24:57.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14542" PostTypeId="2" ParentId="14538" CreationDate="2015-08-07T08:04:00.097" Score="0" Body="&lt;p&gt;You can do something like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-change-major-mode-hook&#xA;            '(lambda () &#xA;               (evil-mode (if (or (equal major-mode 'magit-log-mode) (equal major-mode 'magit-popup-mode) (equal major-mode 'magit-status-mode)(equal major-mode 'magit-mode)) 0 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But magit is a set of major mode and it will not work every where. For example the commit window is in text-mode so you need to add text-mode&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-change-major-mode-hook&#xA;                '(lambda () &#xA;                   (evil-mode (if (or (equal major-mode 'text-mode) (equal major-mode 'magit-log-mode) (equal major-mode 'magit-popup-mode) (equal major-mode 'magit-status-mode)(equal major-mode 'magit-mode)) 0 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now text-mode is not in evil-mode so...&#xA;Maybe the good solution is &lt;a href=&quot;https://github.com/tarleb/evil-rebellion&quot; rel=&quot;nofollow&quot;&gt;https://github.com/tarleb/evil-rebellion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-08-07T08:04:00.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14543" PostTypeId="1" AcceptedAnswerId="14547" CreationDate="2015-08-07T08:52:02.090" Score="1" ViewCount="246" Body="&lt;p&gt;I'm trying to figure out why magit is saying this. I created and checked out a branch &lt;code&gt;array-of-tables&lt;/code&gt; from &lt;code&gt;master&lt;/code&gt;, made a commit, then pushed it (using push current and choosing to push to origin/array-of-tables). I see on github &lt;a href=&quot;https://github.com/blaenk/toml-mode.el/commit/c43187cf6cbae22cc3ee0ff0a839be5ec203bb9c&quot; rel=&quot;nofollow noreferrer&quot;&gt;that it was pushed&lt;/a&gt;, so why is magit saying it's unpushed? I tried pressing &lt;code&gt;g&lt;/code&gt; to refresh it, even quitting and going back into magit-status. I imagine I'm just interpreting this incorrectly, or I did something wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7ieqg.png&quot; alt=&quot;magit&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2015-12-30T23:29:01.527" Title="why does magit say I haven't pushed the commit?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14544" PostTypeId="2" ParentId="14538" CreationDate="2015-08-07T09:06:30.117" Score="7" Body="&lt;p&gt;Evil has the concept of &lt;em&gt;states&lt;/em&gt; (just like modes in Vim).  Customize the initial state of Magit buffers to not be &lt;code&gt;normal&lt;/code&gt; anymore:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-core&#xA;  '(evil-set-initial-state 'magit-popup-mode 'emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, upgrade your Evil installation because this got added to their whitelist of initial states :)&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-08-07T09:14:10.303" LastActivityDate="2015-08-07T09:14:10.303" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14545" PostTypeId="1" CreationDate="2015-08-07T09:38:26.847" Score="1" ViewCount="68" Body="&lt;p&gt;I like the way &lt;code&gt;org-capture&lt;/code&gt; works, it promotes a buffer for selecting&#xA;predefined templates. I am trying to do something similar for setting&#xA;variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have three HTML themes, one for office, one general&#xA;use, and one for journal. I am trying to define a&#xA;&lt;code&gt;choose-html-themes()&lt;/code&gt; function which has similar behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I defined a list of options, &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq html-themes-list &#xA;  '((Office . &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; ..... &quot; )&#xA;    (General . &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; ..... &quot;)&#xA;    (Journal . &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; ..... &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call &lt;code&gt;choose-html-themes&lt;/code&gt; function, then type &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;o&quot; to set the /entry/ variable to &quot;Office&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;g&quot; to &quot;General&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;j&quot; to &quot;Journal&quot;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then it will look up the list using &lt;em&gt;entry&lt;/em&gt; as key, and set&#xA;the &lt;em&gt;org-html-head&lt;/em&gt; variable to the returning value, something like &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq org-html-head (assoc entry html-themes-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wonder how to popup a buffer, and capture keyboard input from that buffer?&lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="105" LastEditDate="2015-08-10T01:58:20.077" LastActivityDate="2015-08-10T01:58:20.077" Title="Mimic org-capture for seting variables" Tags="|elisp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14546" PostTypeId="1" CreationDate="2015-08-07T09:41:35.907" Score="0" ViewCount="26" Body="&lt;p&gt;Fairly often after doing some editing I will notice the cursor flickering.  It blinks a little with an interval between blinks of around a couple of seconds -- but the intervals seem semi-random.  It does not appear to be an intentional blink.  It happens many times per day but I don't yet know much about what packages or other context it depends on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moving the cursor often (not always) seems to cure the problem temporarily, then it reappears again a little later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do others have this problem?  Does anybody know anything about the cause?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will try to narrow down this question over time.  Here's what I know:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;With flymake-cursor-20130822.1032, if I move point to somewhere with an error, the problem reliably appears.  However, disabling flymake does not cure the problem.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-08-07T09:41:35.907" Title="Flickering cursor" Tags="|cursor|" AnswerCount="0" CommentCount="2" ClosedDate="2015-08-07T22:44:44.490" ContentLicense="CC BY-SA 3.0" />
  <row Id="14547" PostTypeId="2" ParentId="14543" CreationDate="2015-08-07T10:12:05.833" Score="5" Body="&lt;p&gt;I think this is a git issue. Your local branch is not tracking &lt;code&gt;origin/array-of-tables&lt;/code&gt;, it's tracking &lt;code&gt;origin/master&lt;/code&gt;. Depending on what you actually want, you can ask git to track the other branch (You can use &lt;code&gt;b u&lt;/code&gt;) or update &lt;code&gt;origin/master&lt;/code&gt; (e.g. by pushing to it).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-07T10:12:05.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14549" PostTypeId="2" ParentId="13823" CreationDate="2015-08-07T10:18:00.913" Score="0" Body="&lt;p&gt;You can use pylint with flymake.&#xA;&lt;a href=&quot;http://docs.pylint.org/ide-integration&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://docs.pylint.org/ide-integration&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&#xA;I use emacs 24.5 with this configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (autoload 'flymake-mode &quot;flymake&quot; nil t)&#xA;               (eval-after-load &quot;flymake&quot;&#xA;                 '(progn &#xA;                    (require 'flymake-cursor)&#xA;                    (defun flymake-pylint-init ()&#xA;                      (let* ((temp-file (flymake-init-create-temp-buffer-copy&#xA;                                         'flymake-create-temp-inplace))&#xA;                             (local-file (file-relative-name temp-file (file-name-directory buffer-file-name))))&#xA;                        (list &quot;epylint&quot; (list local-file))))&#xA;                    (add-to-list 'flymake-allowed-file-name-masks '(&quot;\\.py\\'&quot; flymake-pylint-init))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here a screenshot of the control:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ZfAzI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZfAzI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-08-07T12:20:17.387" LastActivityDate="2015-08-07T12:20:17.387" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14550" PostTypeId="1" AcceptedAnswerId="23978" CreationDate="2015-08-07T11:11:45.463" Score="1" ViewCount="3153" Body="&lt;p&gt;I know I can create a .clang-format file, and use this per project, but what I'd really like is a way to set the default clang-format style to one of the available formats, so I can experiment with various styles across various projects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would think something like setting a clang-format-style variable to &quot;llvm&quot; or &quot;mozilla&quot;.   Is soemthing like this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, can I do a key binding that calls clang-format-region specifying the formatting style?&lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="8576" LastEditDate="2015-08-07T11:21:09.160" LastActivityDate="2017-02-10T18:55:23.553" Title="customize the clang format" Tags="|format|clang|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14551" PostTypeId="1" AcceptedAnswerId="14554" CreationDate="2015-08-07T12:19:17.437" Score="16" ViewCount="7747" Body="&lt;p&gt;Seems there are several hooks about actions on Emacs initialization. However I'm not sure what their differences are, and a brief Googling yields little information. Is it like &lt;code&gt;emacs-startup-hook&lt;/code&gt; is executed instantly after Emacs is fired up, but it doesn't necessarily wait for initialization to finish?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-08-07T15:44:39.427" Title="What's the difference between after-init-hook and emacs-startup-hook" Tags="|hooks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14552" PostTypeId="2" ParentId="14537" CreationDate="2015-08-07T12:41:07.287" Score="0" Body="&lt;p&gt;You might use input-decode-map (or function-key-map).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map &quot;\033[M'X1-&quot; (kbd &quot;&amp;lt;wheel-up&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my linux environment, I could bind normal keybind like C-M-g.&#xA;But, not sure about mouse wheel.&#xA;(FYI my configuration: &lt;a href=&quot;https://github.com/yuutayamada/xterm-keybinder-el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/yuutayamada/xterm-keybinder-el&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="8530" LastEditorUserId="454" LastEditDate="2017-03-30T08:40:24.323" LastActivityDate="2017-03-30T08:40:24.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14553" PostTypeId="1" AcceptedAnswerId="14555" CreationDate="2015-08-07T12:44:24.870" Score="1" ViewCount="1119" Body="&lt;p&gt;When I change something in a function, I need to move to the last parenthese of a function, and do &lt;kbd&gt;C-x C-e&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought it would be nice if I can devise a keybinding to evaluate the function, while I'm in the middle of the function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I came up with the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun evaluate-sentence () &#xA;  (interactive)&#xA;  (evil-set-marker ?8)&#xA;  (sp-end-of-sexp)&#xA;  (eval-last-sexp)&#xA;  (evil-goto-mark ?8))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The number 8 is just abritrary. You need to have Evil and Smartparens. &#xA;It sets the mark on the current position of the pointer, then go to the outer parenthese, eval it, and go back to the marked position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to pass the correct arguments for &lt;code&gt;eval-last-sexp&lt;/code&gt;. When looking up the documentation for &lt;kbd&gt;C-x C-e&lt;/kbd&gt;, it says the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-e runs the command eval-last-sexp (found in global-map), which&#xA;is an interactive compiled Lisp function in&#xA;‘a:/Dropbox/Emacs/share/emacs/25.0.50/lisp/progmodes/elisp-mode.el’.&#xA;&#xA;It is bound to &amp;lt;menu-bar&amp;gt; &amp;lt;emacs-lisp&amp;gt; &amp;lt;eval-sexp&amp;gt;, C-x C-e.&#xA;&#xA;(eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)&#xA;&#xA;Evaluate sexp before point; print value in the echo area.&#xA;Interactively, with prefix argument, print output into current buffer.&#xA;&#xA;Normally, this function truncates long output according to the value&#xA;of the variables ‘eval-expression-print-length’ and&#xA;‘eval-expression-print-level’.  With a prefix argument of zero,&#xA;however, there is no such truncation.  Such a prefix argument&#xA;also causes integers to be printed in several additional formats&#xA;(octal, hexadecimal, and character).&#xA;&#xA;If ‘eval-expression-debug-on-error’ is non-nil, which is the default,&#xA;this command arranges for all errors to enter the debugger.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what the argument &lt;code&gt;EVAL-LAST-SEXP-ARG-INTERNAL&lt;/code&gt; actually says. When I do an aprpos search with &lt;kbd&gt;C-h a&lt;/kbd&gt;, he found nothing about what the argument &lt;code&gt;EVAL-LAST-SEXP-ARG-INTERNAL&lt;/code&gt; really means. I would love to solve this myself, instead calling for help. But I'm out of ideas...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other suggestion? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-08-07T12:55:36.103" Title="How call the eval-sexp function with the right argument?" Tags="|functions|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14554" PostTypeId="2" ParentId="14551" CreationDate="2015-08-07T12:54:24.550" Score="22" Body="&lt;p&gt;See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html#Startup-Summary&quot;&gt;Startup Summary&lt;/a&gt; section of the Emacs Lisp manual for a detailed description of the things that happen when you start Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;emacs-startup-hook&lt;/code&gt; runs later than the &lt;code&gt;after-init-hook&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One key difference is that there may be command-line options processed after the &lt;code&gt;after-init-hook&lt;/code&gt; and before the &lt;code&gt;emacs-startup-hook&lt;/code&gt;. (Command-line options are handled in multiple phases, with some being processed right away and some after init files have been loaded.)&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-08-07T15:44:39.427" LastActivityDate="2015-08-07T15:44:39.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14555" PostTypeId="2" ParentId="14553" CreationDate="2015-08-07T12:55:36.103" Score="3" Body="&lt;p&gt;Since what you want is to get a similar effect to what would happen if you had called &lt;code&gt;eval-last-sexp&lt;/code&gt; yourself, the easiest is to call it as &lt;code&gt;(call-interactively 'eval-last-sexp)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if you really want to know what the argument should be, look at the interactive declaration in the code of &lt;code&gt;eval-last-sexp&lt;/code&gt; (as well as the docstring of &lt;code&gt;interactive&lt;/code&gt;). Then you can use the same interactive spec in your own function, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun evaluate-sentence (arg) &#xA;  (interactive &quot;P&quot;)&#xA;  (evil-set-marker ?8)&#xA;  (sp-end-of-sexp)&#xA;  (eval-last-sexp arg)&#xA;  (evil-goto-mark ?8))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-07T12:55:36.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14556" PostTypeId="1" AcceptedAnswerId="14557" CreationDate="2015-08-07T13:22:08.107" Score="16" ViewCount="3926" Body="&lt;p&gt;I'm using &lt;code&gt;spacemacs&lt;/code&gt; to edit Python code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type an opening parentheses, the closing parentheses is automatically inserted for me and the cursor is put in the middle for further typing.  But: once I am done typing inside the parentheses, I need a quick way of jumping  out of them and landing after the closing parenthesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, I switch to  normal state, move the cursor one unit (when I'm on the character just before the closing parenthesis), and then re-enter insert state with &lt;code&gt;a&lt;/code&gt;.  How can I do this more efficiently?&lt;/p&gt;&#xA;" OwnerUserId="9128" LastEditorUserId="253" LastEditDate="2015-08-07T14:58:30.550" LastActivityDate="2019-03-29T20:34:54.400" Title="How do I jump out of enclosing parentheses?" Tags="|evil|spacemacs|smartparens|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14557" PostTypeId="2" ParentId="14556" CreationDate="2015-08-07T14:54:47.753" Score="13" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot;&gt;&lt;code&gt;smartparens-mode&lt;/code&gt;&lt;/a&gt;, the function &lt;code&gt;sp-up-sexp&lt;/code&gt; will move you out of a set of parentheses (bind to your key of choice):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Move forward out of one level of parentheses.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Examples:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(foo |(bar baz) quux blab) -&amp;gt; (foo (bar baz) quux blab)|&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(foo (bar |baz) quux blab) -&amp;gt; (foo (bar baz) quux blab)| ;; 2&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(foo bar |baz              -&amp;gt; (foo bar baz)| ;; re-indent the expression&#xA;  ​   )&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(foo  |(bar baz)           -&amp;gt; (foo)| (bar baz) ;; close unbalanced expr.&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To reiterate a simple version of the docstring examples, with the following text and &lt;code&gt;|&lt;/code&gt; as the cursor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hey, I'm| in the parentheses) and I'm outside them&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x sp-up-sexp&lt;/code&gt; (or whatever you bind that function to for convenience) will take you to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hey, I'm in the parentheses)| and I'm outside them&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also note that, if the cursor is &lt;em&gt;on&lt;/em&gt; the closing parenthesis, you can just type that parenthesis and &lt;code&gt;smartparens&lt;/code&gt; will interpret it to mean &quot;move past this parenthesis&quot; rather than &quot;insert another parenthesis.&quot;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-08-07T15:00:53.193" LastActivityDate="2015-08-07T15:00:53.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14559" PostTypeId="1" CreationDate="2015-08-07T16:18:33.523" Score="0" ViewCount="16" Body="&lt;p&gt;I set auto save to nil after discovering this, but they keep popping up. Does anyone know what could be causing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not the typical #filename#, it's making a dotfile .#&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2015-08-07T16:18:33.523" Title="Auto save is disabled but emacs is making files in the format .#file-name" Tags="|files|auto-save|" AnswerCount="0" CommentCount="6" ClosedDate="2015-08-07T16:24:28.367" ContentLicense="CC BY-SA 3.0" />
  <row Id="14560" PostTypeId="2" ParentId="14403" CreationDate="2015-08-07T16:31:57.017" Score="2" Body="&#xA;&#xA;&lt;p&gt;I have this custom elisp function which I use to convert a selected region or the whole buffer to syntax fontified HTML.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar modi/htmlize-output-directory&#xA;  (let ((dir (concat temporary-file-directory&#xA;                     (getenv &quot;USER&quot;) &quot;/.htmlize/&quot;))) ; must end with /&#xA;    (make-directory dir :parents)&#xA;    dir)&#xA;  &quot;Output directory for files exported by `modi/htmlize-region-to-file'.&quot;)&#xA;&#xA;(defvar modi/htmlize-css-file (concat user-emacs-directory&#xA;                                      &quot;misc/css/leuven_theme.css&quot;)&#xA;  &quot;CSS file to be embedded in the html file created using the&#xA;             `modi/htmlize-region-to-file' function.&quot;)&#xA;&#xA;(defun modi/htmlize-region-to-file (option)&#xA;  &quot;Export the selected region to an html file. If a region is not&#xA;selected, export the whole buffer.&#xA;&#xA;The output file is saved to `modi/htmlize-output-directory' and its fontification&#xA;is done using `modi/htmlize-css-file'.&#xA;&#xA;If OPTION is non-nil (for example, using `\\[universal-argument]' prefix), copy&#xA;the output file name to kill ring.&#xA;If OPTION is \\='(16) (using `\\[universal-argument] \\[universal-argument]' prefix),&#xA;do the above and also open the html file in the default browser.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((org-html-htmlize-output-type 'css)&#xA;        (org-html-htmlize-font-prefix &quot;org-&quot;)&#xA;        (fname (concat modi/htmlize-output-directory&#xA;                       (if (buffer-file-name)&#xA;                           (file-name-nondirectory (buffer-file-name))&#xA;                         &quot;temp&quot;)&#xA;                       &quot;.html&quot;))&#xA;        start end html-string)&#xA;    (if (use-region-p)&#xA;        (progn&#xA;          (setq start (region-beginning))&#xA;          (setq end (region-end)))&#xA;      (progn&#xA;        (setq start (point-min))&#xA;        (setq end (point-max))))&#xA;    (setq html-string (org-html-htmlize-region-for-paste start end))&#xA;    (with-temp-buffer&#xA;      ;; Insert the `modi/htmlize-css-file' contents in the temp buffer&#xA;      (insert-file-contents modi/htmlize-css-file nil nil nil :replace)&#xA;      ;; Go to the beginning of the buffer and insert comments and&#xA;      ;; opening tags for `html', `head' and `style'. These are&#xA;      ;; inserted *above* the earlier inserted css code.&#xA;      (goto-char (point-min))&#xA;      (insert (concat &quot;&amp;lt;!-- This file is generated using the &quot;&#xA;                      &quot;`modi/htmlize-region-to-file' function\n&quot;&#xA;                      &quot;from https://github.com/kaushalmodi/.emacs.d/&quot;&#xA;                      &quot;blob/master/setup-files/setup-org.el --&amp;gt;\n&quot;))&#xA;      (insert &quot;&amp;lt;html&amp;gt;\n&amp;lt;head&amp;gt;\n&amp;lt;style media=\&quot;screen\&quot; type=\&quot;text/css\&quot;&amp;gt;\n&quot;)&#xA;      ;; Go to the end of the buffer (end of the css code) and&#xA;      ;; insert the closing tags for `style' and `head' and opening&#xA;      ;; tag for `body'.&#xA;      (goto-char (point-max))&#xA;      (insert &quot;&amp;lt;/style&amp;gt;\n&amp;lt;/head&amp;gt;\n&amp;lt;body&amp;gt;\n&quot;)&#xA;      ;; Insert the HTML for fontified text in `html-string'.&#xA;      (insert html-string)&#xA;      ;; Close the `body' and `html' tags.&#xA;      (insert &quot;&amp;lt;/body&amp;gt;\n&amp;lt;/html&amp;gt;\n&quot;)&#xA;      (write-file fname)&#xA;      (when option&#xA;        (kill-new fname)&#xA;        (when (= 16 (car option))&#xA;          (browse-url-of-file fname))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are few points about the &lt;code&gt;modi/htmlize-region-to-file&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the region is selected, only that region will be exported to an HTML file in &lt;code&gt;modi/htmlize-output-directory&lt;/code&gt; directory.&lt;/li&gt;&#xA;&lt;li&gt;If no region is selected, the whole buffer will be exported.&lt;/li&gt;&#xA;&lt;li&gt;It requires &lt;code&gt;ox-html&lt;/code&gt; (&lt;code&gt;org-mode&lt;/code&gt; HTML exporter) as it uses &lt;code&gt;org-html-htmlize-region-for-paste&lt;/code&gt; function which uses the &lt;code&gt;htmlize&lt;/code&gt; package behind the scenes and also allows customizing how to associate CSS with the HTML code for fontification.&lt;/li&gt;&#xA;&lt;li&gt;It is able to fontify code based on the css file specified by &lt;code&gt;modi/htmlize-css-file&lt;/code&gt; variable. To use this function right-away you can save this custom &lt;a href=&quot;https://github.com/fniessen/emacs-leuven-theme&quot; rel=&quot;nofollow noreferrer&quot;&gt;leuven theme&lt;/a&gt; based &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/master/misc/css/leuven_theme.css&quot; rel=&quot;nofollow noreferrer&quot;&gt;css file&lt;/a&gt; somewhere and set this variable to that file path. If you use that css file, the exported code will always have the Leuven theme &lt;strong&gt;regardless of your emacs theme&lt;/strong&gt; (which was my sole purpose for writing this function). &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I would recommend installing the &lt;a href=&quot;https://github.com/fgallina/region-bindings-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;region-bindings-mode&lt;/code&gt;&lt;/a&gt; package. With that installed, you simply select the region you want to export and hit &lt;kbd&gt;H&lt;/kbd&gt;... Voila! Your code will be saved to an HTML file in &lt;code&gt;modi/htmlize-output-directory&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'region-bindings-mode&#xA;    (define-key region-bindings-mode-map (kbd &quot;H&quot;) #'modi/htmlize-region-to-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you do &lt;code&gt;C-u H&lt;/code&gt;, it will export the code and copy the output file name to the kill-ring.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;If you do &lt;code&gt;C-u C-u H&lt;/code&gt; instead, it will do the above and also open the HTML file it in your default browser using the &lt;code&gt;browse-url-of-file&lt;/code&gt; function.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Below is what I got in my web browser when I did &lt;code&gt;C-u C-u H&lt;/code&gt; on part of the above code:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://i.stack.imgur.com/x8LFr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/x8LFr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE:&lt;/strong&gt; I need to save the HTML to a file. Saving the HTML annotated code just to the clipboard will not work for me because I &lt;a href=&quot;https://stackoverflow.com/q/30673236/1219634&quot;&gt;don't know&lt;/a&gt; how to convert html code in clipboard directly to rendered html when pasting in Outlook/Word.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-04-25T17:27:16.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14561" PostTypeId="1" AcceptedAnswerId="14562" CreationDate="2015-08-07T16:43:37.737" Score="1" ViewCount="54" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How to store/reuse &lt;strong&gt;the evaluated result&lt;/strong&gt; of an element of the &lt;code&gt;mode-line-format&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am implementing a system within the &lt;code&gt;mode-line-format&lt;/code&gt; that is similar to how &lt;code&gt;flyspell.el&lt;/code&gt; handles &lt;code&gt;deplacement-commands&lt;/code&gt; -- i.e., if &lt;code&gt;this-command&lt;/code&gt; is &lt;code&gt;eq&lt;/code&gt; to &lt;code&gt;last-command&lt;/code&gt; and &lt;code&gt;this-command&lt;/code&gt; is a &lt;code&gt;member&lt;/code&gt; of the list of &lt;code&gt;deplacement-commands&lt;/code&gt;, then skip the time-costly function(s).  I am storing the values for &lt;code&gt;this-command&lt;/code&gt; and &lt;code&gt;last-command&lt;/code&gt; in variables by way of the &lt;code&gt;pre-command-hook&lt;/code&gt;, because those values could not reliably be used otherwise at the time the &lt;code&gt;mode-line-format&lt;/code&gt; is evaluated during &lt;code&gt;redisplay&lt;/code&gt; -- i.e., &lt;code&gt;this-command&lt;/code&gt; and &lt;code&gt;last-command&lt;/code&gt; have short life expetencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code was developed in a related thread for alphabetizing the &lt;code&gt;minor-mode-alist&lt;/code&gt;:  &lt;a href=&quot;https://emacs.stackexchange.com/questions/13491/sort-minor-mode-alist-alphabetically-in-the-mode-line-using-lighter&quot;&gt;Sort minor-mode-alist alphabetically (in the mode-line) using :lighter&lt;/a&gt;  However, it is &lt;strong&gt;too slow&lt;/strong&gt; for rapid-fire repetitive commands such as &lt;code&gt;previous-line&lt;/code&gt;, &lt;code&gt;next-line&lt;/code&gt;, &lt;code&gt;left-char&lt;/code&gt; and &lt;code&gt;right-char&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &quot;&lt;code&gt;this-command&lt;/code&gt; is &lt;code&gt;eq&lt;/code&gt; to &lt;code&gt;last-command&lt;/code&gt; and &lt;code&gt;this-command&lt;/code&gt; is a &lt;code&gt;member&lt;/code&gt; of the list of &lt;code&gt;deplacement-commands&lt;/code&gt;&quot;, I would like to use the previous stored value for the alphabetized &lt;code&gt;minor-mode-alist&lt;/code&gt;.  In other words, I do not want Emacs to recalculate the value -- I would like the old value to appear in the &lt;code&gt;mode-line-format&lt;/code&gt; so that it &lt;em&gt;costs nothing in terms of time&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(defmacro non-empty-name-p (name)       ; Error if NAME is neither nil nor a string.&#xA;  &quot;NAME if non-nil and not \&quot;\&quot;, else nil.&quot;&#xA;  `(and ,name (not (string= &quot;&quot; ,name)) ,name))&#xA;&#xA;(setq mode-line-format '(&#xA;  (:eval&#xA;    (let* (&#xA;        (copied-list&#xA;          (delq nil&#xA;            (mapcar&#xA;              (lambda (x)&#xA;                (when&#xA;                    (or&#xA;                      (and&#xA;                        (symbolp (cadr x))&#xA;                        (non-empty-name-p (symbol-value (cadr x))))&#xA;                      (stringp (cadr x)))&#xA;                  x))&#xA;              (copy-list minor-mode-alist))))&#xA;        (sorted-list&#xA;          (sort&#xA;            copied-list&#xA;            (lambda (x y)&#xA;              (let* (&#xA;                  (xname (cadr x))&#xA;                  (yname (cadr y)) )&#xA;                (when (symbolp xname) (setq xname (symbol-value xname)))&#xA;                (when (symbolp yname) (setq yname (symbol-value yname)))&#xA;                (when (and (stringp xname) (non-empty-name-p xname)&#xA;                           (stringp yname) (non-empty-name-p yname))&#xA;                  (when (eq ?\s (aref xname 0))&#xA;                    (setq xname (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; xname)))&#xA;                  (when (eq ?\s (aref yname 0))&#xA;                    (setq yname (replace-regexp-in-string &quot;^\s&quot; &quot;&quot; yname)))&#xA;                  (string&amp;lt; xname yname)))))) )&#xA;      (list&#xA;    `(:propertize (&quot;&quot; mode-name)&#xA;      help-echo &quot;Major mode help message.&quot;&#xA;      face '(:foreground &quot;red&quot;)&#xA;      mouse-face '(:foreground &quot;blue&quot;)&#xA;      local-map ,mode-line-major-mode-keymap)&#xA;    `(:propertize (&quot;&quot; ,sorted-list)&#xA;      face '(:foreground &quot;purple&quot;)&#xA;      mouse-face '(:foreground &quot;blue&quot;)&#xA;      help-echo &quot;Minor mode help message.&quot;&#xA;      local-map ,mode-line-minor-mode-keymap))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-08-07T17:04:56.743" Title="Store/reuse value of element to `mode-line-format`" Tags="|mode-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14562" PostTypeId="2" ParentId="14561" CreationDate="2015-08-07T17:04:56.743" Score="1" Body="&lt;p&gt;I think you're looking for the &lt;code&gt;format-mode-line&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. you could do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:eval&#xA; (if &amp;lt;reuse&amp;gt;&#xA;     my-local-var&#xA;   (setq-local my-local-var&#xA;      (format-mode-line&#xA;       `(:propertize ...)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-07T17:04:56.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14563" PostTypeId="1" AcceptedAnswerId="14613" CreationDate="2015-08-07T17:19:02.513" Score="21" ViewCount="3954" Body="&lt;p&gt;Some code editors such as eclipse automatically form neat blocks when you start typing a multi-line comment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SGkNr.gif&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SGkNr.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some package or another way to do this in emacs too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; To clarify: I do &lt;em&gt;not&lt;/em&gt; want a key-combination that inserts a comment block. I want a comment block to be automatically created when I press &lt;code&gt;RET&lt;/code&gt; after &lt;code&gt;/*&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7004" LastEditorUserId="25" LastEditDate="2015-08-07T21:55:24.120" LastActivityDate="2015-08-10T18:07:53.393" Title="How to automatically create neat C comment blocks while typing?" Tags="|comment|editing|c|development|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14564" PostTypeId="1" CreationDate="2015-08-07T17:30:21.703" Score="1" ViewCount="198" Body="&lt;p&gt;So I am entering source code into org documents by using source code blocks such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC C++&#xA;  #include &amp;lt;iostream&amp;gt;&#xA;&#xA;  using namespace std;&#xA;&#xA;  int main() {&#xA;      cout &amp;lt;&amp;lt; &quot;Hello World&quot; &amp;lt;&amp;lt; endl;&#xA;      return 0;&#xA;  }&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that the language tag is 'C++'.  When I use uppercase 'C', there is no syntax highlighting but C-c C-c will allow me to evaluate the code block properly.  However, if I try to edit the block by doing C-c ' then I get the error &quot;No such language mode: C++-mode&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I switch the language tag to 'c++', then I get syntax highlighting and I am able to use C-c ' to edit the source block but then if I try C-c C-c to evaluate the source block I get the error &quot;No org-babel-execute function for c++!&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked in the ob-c.el and org-src.el source code and I think I have found where I could fix it.  Although I don't want to depart from the official source I wanted to see if I was on the right track.  Unfortunately, I can't figure out how to load those changes once I have made them, or maybe it is that the change didn't do what I thought =)  All I did was modify the code in the emacs/lisp directory and delete the .elc version of the file in the hopes that it would get re-compiled the next time emacs started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a true bug or am I missing something?  This is version 24.3.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9132" LastActivityDate="2015-08-07T17:56:22.740" Title="Why is there a case sensitivity problem with org mode source block tags?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14566" PostTypeId="2" ParentId="14564" CreationDate="2015-08-07T17:56:22.740" Score="2" Body="&lt;p&gt;Looking a bit more closely in the ob-c.el code and it looks like it will also respond to 'cpp' which also works for org-src.el. So using the 'cpp' tag gives syntax highlighting and source execution.&lt;/p&gt;&#xA;" OwnerUserId="9132" LastActivityDate="2015-08-07T17:56:22.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14567" PostTypeId="1" CreationDate="2015-08-07T18:33:18.353" Score="3" ViewCount="554" Body="&lt;p&gt;This is pretty simple, I'm trying to find (or build) a hook that fires when files are visited &lt;em&gt;and&lt;/em&gt; selected (i.e. immediately displayed).&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Background&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I'm writing a UI centric entry for &lt;code&gt;find-file-hook&lt;/code&gt;, but it turns out that &lt;code&gt;find-file-hook&lt;/code&gt; is fired for all sorts of things that I don't need:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Semantic assets which are loaded when semantic starts&lt;/li&gt;&#xA;&lt;li&gt;Files opened in the background for my on-the-fly diffing program&lt;/li&gt;&#xA;&lt;li&gt;Probably other stuff, that's all I could think of off the top of my head&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Most of this is done by way of &lt;code&gt;find-file-noselect&lt;/code&gt;, which associates a buffer with a file, but does not &lt;code&gt;switch-to-buffer&lt;/code&gt; on the newly created buffer like &lt;code&gt;find-file&lt;/code&gt; does. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like my hook to execute only when the current buffer changes.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-07T23:37:48.293" LastActivityDate="2015-08-11T00:25:52.253" Title="find-file-hook but only if file is selected" Tags="|hooks|find-file|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14569" PostTypeId="1" AcceptedAnswerId="14570" CreationDate="2015-08-07T19:50:32.357" Score="2" ViewCount="252" Body="&lt;p&gt;I have my &lt;code&gt;ido-ignore-directories&lt;/code&gt; set to the standard value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;\\`CVS/&quot; &quot;\\`\\.\\./&quot; &quot;\\`\\./&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The third regexp, &lt;code&gt;&quot;\`\./&quot;&lt;/code&gt; should ignore the current directory, as near as I can tell. However, it doesn't:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Find file read only: ~/{. | Desktop/ | Documents/ | ...}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it matters, I have &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-f&lt;/kbd&gt; bound to &lt;code&gt;ido-find-file-read-only&lt;/code&gt;. This is with emacs 24.3.1. How do I fix it?&lt;/p&gt;&#xA;" OwnerUserId="9121" LastActivityDate="2015-08-10T20:24:58.587" Title="Why does ido-find-file still show . when ido-ignore-directories seems to exclude it?" Tags="|ido|ido-find-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14570" PostTypeId="2" ParentId="14569" CreationDate="2015-08-07T22:29:09.990" Score="3" Body="&lt;p&gt;Drew's comment inspired me to look closer at ido's settings. Turns out there's an &lt;code&gt;ido-show-dot-for-dired&lt;/code&gt; setting that will &lt;em&gt;always&lt;/em&gt; put &lt;code&gt;.&lt;/code&gt; as the first element in the completion list so you can quickly do a dired on the directory. I, unbeknownst to me, had that set to &lt;code&gt;t&lt;/code&gt; instead of &lt;code&gt;nil&lt;/code&gt;. This is what I get for starting with someone else's &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="9121" LastEditorUserId="9121" LastEditDate="2015-08-10T20:24:58.587" LastActivityDate="2015-08-10T20:24:58.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14571" PostTypeId="1" CreationDate="2015-08-07T23:01:00.750" Score="1" ViewCount="1634" Body="&lt;p&gt;I find the question mark fringe markers for flycheck warnings slightly distracting.  Is there a way to hide them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to keep the error fringe markers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;M-x customize-face &amp;lt;RET&amp;gt; flycheck-fringe-warning &amp;lt;RET&amp;gt;&lt;/code&gt;, unchecking all the attributes, and setting the state to 'Save for future sessions'.  That had no effect I observed.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2015-08-12T20:34:50.293" LastActivityDate="2022-07-05T17:06:51.297" Title="How to disable flycheck fringe markers for warnings?" Tags="|flycheck|warning|fringe|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14572" PostTypeId="1" CreationDate="2015-08-08T02:34:21.997" Score="6" ViewCount="1118" Body="&lt;p&gt;I want to write a function to help me add/update or delete a custom property in my org-mode's entries. But I'm not really sure where to start, are there org functions that can help me manipulating this data or I &lt;strong&gt;have&lt;/strong&gt; to parse an entry by myself?&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="253" LastEditDate="2015-08-14T14:04:17.790" LastActivityDate="2015-08-14T14:04:17.790" Title="How do I programmatic add, delete and update org-mode properties from entries?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14573" PostTypeId="2" ParentId="14572" CreationDate="2015-08-08T04:27:26.777" Score="9" Body="&lt;p&gt;The function &lt;code&gt;org-entry-put&lt;/code&gt; does this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-entry-put is a compiled Lisp function in `org.el'.&#xA;&#xA;(org-entry-put POM PROPERTY VALUE)&#xA;&#xA;Set PROPERTY to VALUE for entry at point-or-marker POM.&#xA;If the value is `nil', it is converted to the empty string.&#xA;If it is not a string, an error is raised.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll have to either move point to the position of the entry you want to modify, or somehow get its point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information on the POM argument, you may want to read &lt;a href=&quot;https://stackoverflow.com/questions/13340846/pom-point-or-marker-in-org-mode&quot;&gt;this other answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-08-08T04:27:26.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14574" PostTypeId="1" CreationDate="2015-08-08T05:46:01.633" Score="11" ViewCount="647" Body="&lt;p&gt;I have a couple packages now, and in the PackageRequires section I would like to put all the packages I require in it, put it seems like it requires the name and version.  Where do you determine the version number?  For example I have (cl-lib &quot;0.5&quot;), but whats the best way to determine the minimum version I can use?  I can see the current version, but what is the best way to determine the min value needed?  Also, some packages required don't have a version specified in their file.  In those cases, what is recommended?&lt;/p&gt;&#xA;" OwnerUserId="9133" LastEditorUserId="50" LastEditDate="2015-08-08T12:42:38.407" LastActivityDate="2015-08-10T01:51:36.553" Title="How to determine the package version to require in your package?" Tags="|elisp|package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14575" PostTypeId="2" ParentId="13291" CreationDate="2015-08-08T09:08:43.627" Score="5" Body="&lt;p&gt;try to add this code in &lt;code&gt;init.el&lt;/code&gt; and restart the daemon:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'frame)&#xA;(defun set-cursor-hook (frame)&#xA;(modify-frame-parameters&#xA;  frame (list (cons 'cursor-color &quot;DeepSkyBlue&quot;))))&#xA;&#xA;(add-hook 'after-make-frame-functions 'set-cursor-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="965" LastActivityDate="2015-08-08T09:08:43.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14576" PostTypeId="2" ParentId="14567" CreationDate="2015-08-08T09:15:58.570" Score="2" Body="&lt;p&gt;At the point where &lt;code&gt;find-file-hook&lt;/code&gt; is called the buffer is not yet displayed in either case, and you don't know yet whether it's going to be shown in a window or not.  You could hook into &lt;code&gt;window-configuration-change-hook&lt;/code&gt;, but that in turn does not tell you whether the buffer was selected immediately in &lt;code&gt;find-file&lt;/code&gt;, or at some arbitrary later point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your best chance to work around these issues is a multi-step process: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In your &lt;code&gt;find-file-hook&lt;/code&gt;, remember the value of &lt;code&gt;this-command&lt;/code&gt; in a buffer-local variable, and add a local &lt;code&gt;window-configuration-change-hook&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;In that hook, check whether the buffer has a window with &lt;code&gt;(get-buffer-window)&lt;/code&gt;.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If it does, and &lt;code&gt;this-command&lt;/code&gt; is still the same as you remembered, there's a good chance that finding the file and showing the buffer came from the same command, i.e. &lt;code&gt;find-file&lt;/code&gt; or some variants thereof, and you can start your UI.  If &lt;code&gt;this-command&lt;/code&gt; has changed without the buffer having a window, however, it was obviously not &lt;code&gt;find-file&lt;/code&gt;, and you can remove your hook from &lt;code&gt;window-configuration-change-hook&lt;/code&gt; without starting your UI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is complicated, for sure, but it's the only way I can think of to work around broken packages which abuse &lt;code&gt;find-file-noselect&lt;/code&gt; to load internal assets and data files.  You &lt;a href=&quot;https://emacs.stackexchange.com/questions/2868/whats-wrong-with-find-file-noselect&quot;&gt;should never do that&lt;/a&gt;.  If you care, please report these issues to developers whenever you spot them.  &lt;code&gt;find-file&lt;/code&gt; is only for interactive use.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-08-08T09:15:58.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14577" PostTypeId="2" ParentId="14574" CreationDate="2015-08-08T09:23:21.990" Score="7" Body="&lt;p&gt;Use the version for which you wrote the package.  That's the safest baseline you can get, unless you explicitly check every function you use.  From there on, you can only hope that the maintainers of that package never silently break backwards compatibility…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for packages which don't even have any version number, I'd not use them at all.  If the maintainer doesn't even bother for proper versioning, how can you trust them with anything else?&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-08-08T09:23:21.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14578" PostTypeId="1" CreationDate="2015-08-08T10:05:44.070" Score="12" ViewCount="177" Body="&lt;p&gt;I have both &lt;code&gt;.el&lt;/code&gt; and the byte compiled version (&lt;code&gt;.elc&lt;/code&gt;) of an elisp file. Accidentally I delete the &lt;code&gt;.el&lt;/code&gt; file. Can I retrieve the &lt;code&gt;.el&lt;/code&gt; file from its &lt;code&gt;.elc&lt;/code&gt; version? Is an &lt;code&gt;.elc&lt;/code&gt; file without its &lt;code&gt;.el&lt;/code&gt; file functional?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-08-11T13:18:18.863" Title="byte compiled version of elisp files" Tags="|byte-compilation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14579" PostTypeId="1" AcceptedAnswerId="14586" CreationDate="2015-08-08T10:10:45.907" Score="3" ViewCount="957" Body="&lt;p&gt;Suppose I have this text, where &lt;code&gt;|&lt;/code&gt; is point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;This is the te|xt.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to put the word &lt;code&gt;text&lt;/code&gt; in bold, so I use Org keybindings and do &lt;code&gt;C-c C-x C-f&lt;/code&gt; and pick &lt;code&gt;*&lt;/code&gt;. This is what happens:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;This is the te *|* xt.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to have the markers surround the symbol where point is? Like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;This is the *text*|.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know &lt;code&gt;org-emphasize&lt;/code&gt; works on the active region, but it would be quicker if it was done automatically on the symbol where point is.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2015-08-08T13:34:31.180" LastActivityDate="2015-08-08T15:23:22.073" Title="Org-mode emphasis markers: surround symbol" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14580" PostTypeId="1" CreationDate="2015-08-08T12:00:32.803" Score="1" ViewCount="115" Body="&lt;p&gt;When I start to press keychord binding, after first char it flashes me an error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;symbols value as variable is void: eldoc-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my chord definition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(key-chord-define-global &quot;ss&quot; 'other-window)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed key-chords via melpa with cask, I'm using emacs-nox 24.5.1. Any help will be appreciated, thx.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2015-08-08T19:55:47.630" Title="key-chord gives error when pressing chord" Tags="|key-chord-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14581" PostTypeId="2" ParentId="14578" CreationDate="2015-08-08T12:32:03.000" Score="12" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I have both .el and the byte compiled version (.elc) of an elisp file. Accidentally I delete the .el file. Can I retrieve the .el file from its .elc version? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In practice, no. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory you could use the elc file to produce an el file with human readable definitions. However, this probably wouldn't look the same as the original file you deleted, due to macros and compiler optimizations, and even then I'm not aware of any libraries that do that. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is an .elc file without its .el file functional?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, Emacs is happy to load a &lt;code&gt;.elc&lt;/code&gt; file entirely by itself. No &lt;code&gt;.el&lt;/code&gt; file is necessary at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, even when you do have both in the same directory, Emacs will usually load the elc anyway. &lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-08-11T13:18:18.863" LastActivityDate="2015-08-11T13:18:18.863" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14582" PostTypeId="1" CreationDate="2015-08-08T13:21:04.287" Score="7" ViewCount="219" Body="&lt;p&gt;I normally use indirect buffers while I edit python code in python-mode, I create them by running &lt;code&gt;clone-indirect-buffer-other-window&lt;/code&gt;. While the syntax highlighting of the main buffer looks just fine, sometimes it is wrong in the indirect one. Specifically, it seems like some closing quotes are ignored adn so big chunks of my code are coloured as if they were part of long literal string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not found references of this elsewhere, and have not clue why it could be happening. Does anybody know why this is and/or how to solve it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;https://emacs.stackexchange.com/questions/2510/how-can-i-prevent-python-mode-from-occasionally-highlighting-everything-as-strin&quot;&gt;question&lt;/a&gt; could be related, be he does not mention indirect buffers (I only have this problem with those), and also my indirect buffer do &lt;strong&gt;not&lt;/strong&gt; refresh to proper syntax highlighting even if a wait several minutes.&lt;/p&gt;&#xA;" OwnerUserId="8659" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2022-09-27T23:07:20.913" Title="Syntax highlighting fails on clone-indirect-buffer-other-window" Tags="|python|syntax-highlighting|indirect-buffers|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14583" PostTypeId="1" CreationDate="2015-08-08T13:47:33.553" Score="0" ViewCount="105" Body="&lt;p&gt;I'm trying to use auto-complete to match in the &lt;em&gt;middle&lt;/em&gt; of a string (after the characters &lt;code&gt;::&lt;/code&gt;). I'd like to typing &lt;code&gt;a&lt;/code&gt; then hit tab and have the list of candidates appear 'in full' e.g. &lt;code&gt;fruit::apples&lt;/code&gt;, &lt;code&gt;others::apples&lt;/code&gt;, &lt;code&gt;veg::asparagus&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I'm approaching this using an alist:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq l1 '((&quot;apples&quot;  &quot;fruit::apples&quot;)&#xA;       (&quot;apples&quot;  &quot;other::apples&quot;)&#xA;       (&quot;bananas&quot;  &quot;fruit::bananas&quot;)&#xA;       (&quot;asparagus&quot;  &quot;veg::asparagus&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The completions are matched to the &lt;code&gt;car&lt;/code&gt; of each element in &lt;code&gt;l1&lt;/code&gt; but return the &lt;code&gt;cdr&lt;/code&gt;. The 'prefix' part always ends with &lt;code&gt;::&lt;/code&gt; and I would prefer to avoid using alternatives such as &lt;code&gt;fruit-apples&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a function which prompts in the minibuffer and can display a list of candidates in another window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun f1 () &quot;&#xA;Replaces text at point with completion, including the appropriate prefix&quot;&#xA;       (interactive)&#xA;       ;; ac1 = all completions&#xA;       ;; lc1 = list of completions&#xA;       (let ((tap1 (thing-at-point 'symbol))&#xA;         ac1&#xA;         (lc1 ())&#xA;         (resize-mini-windows t)&#xA;         (p1 (point))&#xA;         elem1 r1)&#xA;     (when (not tap1) (set 'tap1 &quot;&quot;))&#xA;     (set 'ac1 (all-completions tap1 l1))&#xA;     (mapc (lambda (elem1)&#xA;         (when (member (car elem1) ac1)&#xA;           (push (cdr elem1) lc1)))&#xA;           l1)&#xA;     (set  'lc1 (mapcar (lambda (x) (print (car x))) lc1))&#xA;     (set 'elem1 (concat &quot;Complete &quot; tap1 &quot; (TAB for selection) : &quot;))&#xA;     (set 'r1 (completing-read elem1 lc1))&#xA;     (delete-region (- p1 (length tap1)) p1)&#xA;     (insert r1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that if I call &lt;code&gt;f1&lt;/code&gt; when at text that says &lt;code&gt;a&lt;/code&gt; I can replace it as desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, is there any way to adapt &lt;a href=&quot;http://emacswiki.org/emacs/AutoComplete&quot; rel=&quot;nofollow&quot;&gt;auto-complete&lt;/a&gt; to behave like this? I've been going through the source files and can't figure out where I should replace the usual list of &lt;code&gt;(all-completions STRING COLLECTION)&lt;/code&gt; with the list which includes the prefixes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simpler way to do this? Should I be looking at &lt;a href=&quot;http://company-mode.github.io/&quot; rel=&quot;nofollow&quot;&gt;company-mode&lt;/a&gt; instead?&lt;/p&gt;&#xA;" OwnerUserId="5369" LastEditorUserId="5369" LastEditDate="2015-08-10T14:50:48.010" LastActivityDate="2015-08-10T14:50:48.010" Title="Complete using match in middle of string - work with pop-up list?" Tags="|completion|company-mode|auto-complete-mode|completing-read|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14584" PostTypeId="2" ParentId="14583" CreationDate="2015-08-08T14:22:04.007" Score="1" Body="&lt;p&gt;Even with vanilla Emacs you can do this, just by using &lt;code&gt;completing-read&lt;/code&gt; and looking up the car in &lt;code&gt;I1&lt;/code&gt;. If the cars are unique then &lt;code&gt;assoc&lt;/code&gt; is all you need.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cadr (assoc (completing-read &quot;Choose: &quot; I1) I1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-08T14:22:04.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14585" PostTypeId="2" ParentId="14579" CreationDate="2015-08-08T14:32:51.957" Score="3" Body="&lt;p&gt;I use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bold-region-or-point ()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (progn&#xA;        (goto-char (region-end))&#xA;        (insert &quot;*&quot;)&#xA;        (goto-char (region-beginning))&#xA;        (insert &quot;*&quot;))&#xA;    (insert &quot;**&quot;)&#xA;    (backward-char)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bind it to a convenient key like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;s-b&quot;) 'bold-region-or-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2015-08-08T14:32:51.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14586" PostTypeId="2" ParentId="14579" CreationDate="2015-08-08T15:23:22.073" Score="2" Body="&lt;p&gt;You just need a function that marks the current word when the region isn't already active:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-emphasize-dwim (&amp;amp;optional char)&#xA;  (interactive)&#xA;  (unless (region-active-p)&#xA;    (backward-word)&#xA;    (mark-word))&#xA;  (org-emphasize char))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can rebind the keys to call this instead of the normal &lt;code&gt;org-emphasize&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map [remap org-emphasize] #'org-emphasize-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-08-08T15:23:22.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14587" PostTypeId="1" AcceptedAnswerId="14609" CreationDate="2015-08-08T15:40:26.227" Score="13" ViewCount="284" Body="&lt;p&gt;Lately I was impressed by the new/improved things that are included with Emacs 25. Then I started thinking about the entire process behind it. I would like to share my thoughts with you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keeping it up with the latest requests, many bug fixes, maintaining, extending the Emacs core/dev and whatever, it must be a hell of work, no doubt about that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I check out what many changes and improvements are implemented in Emacs 25, many development hours must be spent on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It requires pretty big coordination. It's like there must be a large company behind all these changes to push Emacs further.&#xA;But it's not a profitable thing, it's all free software and GPL-licensed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it's from the volunteers who are willing to spend their time to push Emacs further, next to their regular job. That requires some sort of coordination. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I checked the mailing lists of &lt;code&gt;Emacs-dev&lt;/code&gt;, it seems there is not much coordination, not many people are participating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And forgive me, I personally consider mailing lists a thing from the 90s. Nowadays you have more pretty alternatives, like GitHub issues tracker and regular communities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look around on the web, you have the regular blogs (Endless Parentheses, Sacha Chua, Redux, OrEmacs, etc.) and Emacs communities (like this Emacs Exchange, and - presumably the largest community -  reddit.com/r/emacs) and collections like emacs.zeef.com and wikiemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But not a spot for development of new releases of Emacs, which requires many people and coordination. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhere I got a feeling like this is all underground, where new versions of Emacs are being secretly developed... funny thought. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This all makes me to wonder if I'm missing sort of big hotspot on the web, where all the magic happens?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorDisplayName="user8748" LastEditDate="2017-05-04T19:48:20.540" LastActivityDate="2017-05-04T19:48:20.540" Title="Am I missing some spot, where the coordination/development of new Emacs versions happens?" Tags="|emacs-development|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14588" PostTypeId="2" ParentId="14580" CreationDate="2015-08-08T17:00:46.403" Score="2" Body="&lt;p&gt;Something might have changed recently..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the offending code in key-chord-mode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(when eldoc-mode&#xA;                (eldoc-pre-command-refresh-echo-area))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can work around it my requireing eldoc in your init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'eldoc)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What needs to be fixed in key-chord is to check if the variable &lt;code&gt;eldoc-mode&lt;/code&gt; is defined before checking it's value.&lt;/p&gt;&#xA;" OwnerUserId="9137" LastActivityDate="2015-08-08T17:00:46.403" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14589" PostTypeId="1" AcceptedAnswerId="14590" CreationDate="2015-08-08T17:34:47.170" Score="17" ViewCount="3696" Body="&lt;p&gt;I have the following wrapped text, especially when you use a lot of windows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Tkzxv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Tkzxv.png&quot; alt=&quot;Wrapped lines in Emacs&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'm wondering if the indentation of wrapped text could be changed like in Vim:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zIjbc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zIjbc.png&quot; alt=&quot;Indentation of wrapped lines in Vim&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;When figuring out, it seems the &lt;a href=&quot;http://emacswiki.org/emacs/AutoFillMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;AutoFillMode&lt;/a&gt; is responsible for this. I was hoping this might be improved in Emacs 25. After upgraded to a compiled binary of Emacs 25, I see the same behaviour.&lt;/p&gt;&#xA;&lt;p&gt;So I'm wondering if I could solve this in an another way?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="17507" LastEditDate="2021-02-07T16:22:39.993" LastActivityDate="2021-02-07T16:22:39.993" Title="Correct indentation for wrapped lines" Tags="|indentation|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="14590" PostTypeId="2" ParentId="14589" CreationDate="2015-08-08T18:30:02.863" Score="17" Body="&lt;p&gt;After &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;package-install&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;adaptive-wrap&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;     &#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default adaptive-wrap-extra-indent 2)&#xA;(add-hook 'visual-line-mode-hook #'adaptive-wrap-prefix-mode)&#xA;(global-visual-line-mode +1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2017-12-01T23:03:54.823" LastActivityDate="2017-12-01T23:03:54.823" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="14591" PostTypeId="2" ParentId="14587" CreationDate="2015-08-08T18:33:16.820" Score="10" Body="&lt;p&gt;No, you are not missing anything, except the Emacs bugs mailing list: &lt;code&gt;bug-gnu-emacs@gnu.org&lt;/code&gt; (which uses &lt;code&gt;debbugs.gnu.org&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And there is a git repository for the Emacs source code -- that is what is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discussion is on &lt;code&gt;emacs-devel@gnu.org&lt;/code&gt; and &lt;code&gt;bug-gnu-emacs@gnu.org&lt;/code&gt;. Some code is exposed and discussed there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But code development takes place by individuals (you, for example). An individual can commit changes to the repository, if s?he has the necessary access/privileges, or s?he can submit a patch to one of the mailing lists and ask someone else to apply it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; you can attach a patch to your bug report, if you have a fix you would like to propose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;magic&quot; happens through individual development and comments/discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW: Common Lisp, which is a humongous language and quite complex, was &lt;em&gt;entirely&lt;/em&gt; defined (and prototyped) using email, back in the late 1970s and early 1980s.  That was before the World Wide Web, when the Internet was an infant.  Those defining the language were located in various spots throughout the world, mainly in research labs. Magic, indeed.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-08T18:38:37.123" LastActivityDate="2015-08-08T18:38:37.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14592" PostTypeId="1" AcceptedAnswerId="14608" CreationDate="2015-08-08T18:35:57.487" Score="2" ViewCount="414" Body="&lt;p&gt;I frequently use file-local variables, but after writing some minor modes I find the need to implement mode-based behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I want to define a variable &lt;code&gt;errors-list-regexp&lt;/code&gt; that varies depending on the major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first approach was to ask major modes to define such a variable by using a symbol-name convention, by prefixing the major mode name onto the variable name. Then, I would construct the appropriate symbol name, check whether it is bound and if so obtain its value (for example, &lt;code&gt;java-mode-errors-list-regexp&lt;/code&gt; or &quot;python-mode-errors-lisp-regexp&quot;)&#xA;But this is a bit cumbersome:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* (&#xA;       (sym (intern (concat (symbol-name major-mode) &quot;-errors-list-regexp&quot;)))&#xA;       (errors-list-regexp (and (boundp sym) (symbol-value sym)))&#xA;       )&#xA;  ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another solution might be to turn the variable into a (mode . value) alist, but this also is too cumbersome.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* (&#xA;       (errors-list-regexp-value (cdr (assoc major-mode errors-list-regexp)))&#xA;       )&#xA;  ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My current approach is to make &lt;code&gt;errors-list-regexp&lt;/code&gt; buffer local, and to add a major-mode-hook (say, to java-mode-hook or python-mode-hook) that sets the appropriate mode-specific value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm mostly satisfied with the latter solution but, is there a better way? Is this idiomatic?&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2015-08-09T01:41:08.927" LastActivityDate="2015-08-09T15:43:45.600" Title="Mode local variables" Tags="|minor-mode|file-local-variables|symbols|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14593" PostTypeId="1" CreationDate="2015-08-08T18:40:48.320" Score="13" ViewCount="2960" Body="&lt;p&gt;Is there an elisp refactoring tool that can rename local variables and function arguments? I would like to be able to turn:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-func (s r)&#xA;  ...&#xA;  (use s .. r))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-func (string replacement)&#xA;  ...&#xA;  (use string .. replacement))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;using a method that knows how to find variable references. I'm okay if it is not super-hygenic.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorDisplayName="user12563" LastEditDate="2019-04-28T09:35:38.870" LastActivityDate="2019-05-05T16:45:02.867" Title="Rename local variable refactoring" Tags="|elisp|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="14595" PostTypeId="1" CreationDate="2015-08-08T19:08:41.810" Score="4" ViewCount="57" Body="&lt;p&gt;I would like to determine if the current directory/file is ignored by &lt;code&gt;.gitignore&lt;/code&gt; with &lt;code&gt;vc&lt;/code&gt;. In this case, only &lt;code&gt;git&lt;/code&gt; matters, but of course a general solution would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-08T19:18:40.470" LastActivityDate="2024-04-04T18:03:10.290" Title="Determine if a directory is .gitignored with vc" Tags="|vc|vc-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14596" PostTypeId="2" ParentId="14580" CreationDate="2015-08-08T19:55:47.630" Score="1" Body="&lt;p&gt;Is &lt;code&gt;ss&lt;/code&gt; bounded to &lt;code&gt;other-window&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there is a hook inside other-window function, that hooks up with eldoc-mode? If so, you need to initialize eldoc-mode first. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-08-08T19:55:47.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14597" PostTypeId="1" AcceptedAnswerId="14599" CreationDate="2015-08-08T20:09:27.160" Score="7" ViewCount="32503" Body="&lt;p&gt;Often I need to use regular expressions to match strings across multiple lines. In python and other languages, it's possible to ask that &lt;a href=&quot;https://docs.python.org/3.1/library/re.html#re.S&quot; rel=&quot;noreferrer&quot;&gt;dots match newlines&lt;/a&gt; (as opposed to the default behavior). Is it possible to do this using the default regexp utilities without hacking the source?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can use a negated character class, which will consume newlines if the newline is not in the class, but this is too limited since what I really want is to just match any character at all.&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="50" LastEditDate="2015-08-08T20:40:20.420" LastActivityDate="2022-08-15T22:17:22.110" Title="How to make a dot match a newline" Tags="|regular-expressions|newlines|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14598" PostTypeId="2" ParentId="14597" CreationDate="2015-08-08T20:17:56.070" Score="4" Body="&lt;p&gt;Actually, I just noticed I can do this with &lt;code&gt;\(.\|[\n]\)*&lt;/code&gt;. For example, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[code] $ sudo wpa_supplicant -B -i wlan0 -Dwext -c universitywpa &#xA;Successfully initialized wpa_supplicant&#xA;ioctl[SIOCSIWENCODEEXT]: Invalid argument&#xA;ioctl[SIOCSIWENCODEEXT]: Invalid argument&#xA;[/code]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn &#xA;  (re-search-forward &quot;[[]code]\\(\\(.\\|[\n]\\)*?\\)[[]/code]&quot; )&#xA;  (match-string 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &quot; $ sudo wpa_supplicant -B -i wlan0 -Dwext -c universitywpa &#xA;&#xA;Successfully initialized wpa_supplicant&#xA;ioctl[SIOCSIWENCODEEXT]: Invalid argument&#xA;ioctl[SIOCSIWENCODEEXT]: Invalid argument&#xA;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A shorthand for this would be nicer, though, something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((re-dot-match-all t))&#xA;      (re-search-forward &quot;[[]code]\\(.*?\\)[[]/code]&quot; )&#xA;&#xA;(match-string 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similar to the &lt;code&gt;case-fold-search&lt;/code&gt; use. Or a named character class:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(re-search-forward &quot;[[]code]\\([[:any:]]*?\\)[[]/code]&quot; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2015-08-08T23:33:38.687" LastActivityDate="2015-08-08T23:33:38.687" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14599" PostTypeId="2" ParentId="14597" CreationDate="2015-08-08T20:42:17.253" Score="6" Body="&lt;p&gt;While erjoalgo's answer is correct, according to the &lt;a href=&quot;http://www.emacswiki.org/emacs/MultilineRegexp&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki Mutliline Regex&lt;/a&gt; page, it is not the most efficient answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To match any number of characters, use this: &lt;code&gt;.*&lt;/code&gt; – the problem is that &lt;code&gt;.&lt;/code&gt; matches any character except newline. What many people propose next works, but is inefficient if you assume that newlines are not that common in your text: &lt;code&gt;&quot;\\(.\\|\n\\)&quot;&lt;/code&gt;. Better match multiple lines instead: &lt;code&gt;&quot;\\(.*\n?\\)*&quot;&lt;/code&gt;. The newline is optional so that the expression can end in the middle of a line. Better yet: &lt;code&gt;&quot;[\0-\377[:nonascii:]]*&quot;&lt;/code&gt; avoids “Stack overflow in regexp matcher” for huge texts, e.g., &gt; 34k.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9121" LastEditorUserId="454" LastEditDate="2015-08-09T10:00:59.080" LastActivityDate="2015-08-09T10:00:59.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14600" PostTypeId="2" ParentId="14534" CreationDate="2015-08-08T21:00:17.383" Score="0" Body="&lt;p&gt;I found the &lt;a href=&quot;https://github.com/ergoemacs/ergoemacs-mode/issues/350&quot; rel=&quot;nofollow&quot;&gt;solution on GitHub&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This seems like a package management issue.&#xA;  I would delete the elpa versions of ergoemacs-mode and list-utils and then use the stable melpa repository. This require updating your config to:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(add-to-list 'package-archives&#xA;         ;'(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;)&#xA;             '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;)&#xA;         '(&quot;marmalade&quot; .&quot;http://marmalade-repo.org/packages/&quot;)&#xA;         )&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Then re-downloading the stable ergoemacs-mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2759" LastEditorUserId="2759" LastEditDate="2015-08-17T13:40:40.060" LastActivityDate="2015-08-17T13:40:40.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14602" PostTypeId="2" ParentId="13074" CreationDate="2015-08-08T21:42:33.720" Score="3" Body="&lt;p&gt;I couldn't reproduce the crash, instead my development emacs just froze. However, it froze &lt;em&gt;exactly&lt;/em&gt; when you said yours crashed, so I'll assume the problem is the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an infinite loop (i.e. bug) in &lt;a href=&quot;https://github.com/fxbois/web-mode/blob/master/web-mode.el#L7082&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;web-mode-markup-indentation-origin&lt;/code&gt;&lt;/a&gt;. Here's is the basic run-down on what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have the following loop: (stripped of the code that doesn't matter)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while continue&#xA;  (forward-line -1)&#xA;  (back-to-indentation)&#xA;  (setq continue &#xA;    (not (bobp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your template has a &lt;strong&gt;leading space on the first line.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means Emacs will back up to the first line, then:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Try to backup another line (no-op)&lt;/li&gt;&#xA;&lt;li&gt;Go &lt;code&gt;back-to-indentation&lt;/code&gt; (i.e. after the first space)&lt;/li&gt;&#xA;&lt;li&gt;Check if it's at the beginning of the buffer. (it's not, &lt;code&gt;point = 2&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are other termination conditions in the loop, but they never apply. This is pretty tricky since it's tied to whitespace, which part of why it's so hard to track down. (How many files do you know that &lt;em&gt;start&lt;/em&gt; with whitespace?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like you already have a bug open, so I've not opened one.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-08T22:23:22.307" LastActivityDate="2015-08-08T22:23:22.307" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14603" PostTypeId="1" CreationDate="2015-08-09T10:32:10.473" Score="4" ViewCount="509" Body="&lt;p&gt;When I'm editing a markdown-mode document with a list like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;* bar&#xA;  * baz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and my cursor is at the very end of the &lt;code&gt;baz&lt;/code&gt; line, and I press &lt;code&gt;RET&lt;/code&gt; (which is bound to &lt;code&gt;markdown-enter-key&lt;/code&gt;) then the &lt;code&gt;baz&lt;/code&gt; line gets dedented so the file looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;* bar&#xA;* baz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what I would like is for the indentation to behave like most programming modes, i.e. keep &lt;code&gt;baz&lt;/code&gt; where it was, and on the newline align my cursor with the &lt;code&gt;baz&lt;/code&gt; bullet point so I can start typing another bullet point at that level, e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;* bar&#xA;  * baz&#xA;  * &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I configure my emacs to do this?&lt;/p&gt;&#xA;" OwnerUserId="8565" LastActivityDate="2015-09-10T08:22:30.047" Title="How to preserve list indentation after RET in markdown-mode?" Tags="|indentation|markdown|markdown-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14604" PostTypeId="1" AcceptedAnswerId="14605" CreationDate="2015-08-09T12:34:41.293" Score="3" ViewCount="2770" Body="&lt;p&gt;Each line in my file has a character &lt;code&gt;;&lt;/code&gt; followed by information that I want to delete. What is the best way to do it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I like phat beatsies; but Mark does not like them&#xA;I also like dogsies;  irrelavant information&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should become &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I like phat beatsies&#xA;I also like dogsies&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9141" LastEditorUserId="253" LastEditDate="2015-08-09T13:02:40.953" LastActivityDate="2015-08-09T15:13:37.137" Title="How can I kill a line after a certain character?" Tags="|regular-expressions|text-editing|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14605" PostTypeId="2" ParentId="14604" CreationDate="2015-08-09T13:01:46.207" Score="8" Body="&lt;p&gt;You can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html&quot;&gt;&lt;code&gt;replace-regexp&lt;/code&gt;&lt;/a&gt; with the short &lt;a href=&quot;http://www.emacswiki.org/emacs/RegularExpression&quot;&gt;regular expression&lt;/a&gt; &lt;code&gt;;.*&lt;/code&gt;, which, in this context, means &quot;semi-colon and everything after it on the rest of the line&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, put your cursor before the point at which you want to start removing the text (alternately, highlight the region you want to use).  Do &lt;code&gt;M-x replace-regexp&lt;/code&gt;.  It will prompt you for the text to be replaced, so enter &lt;code&gt;;.*&lt;/code&gt;.  It will then prompt you for the text to replace it with.  You want to remove it, so just hit enter, which is effectively telling it to replace the text with nothing.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-09T13:01:46.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14606" PostTypeId="1" AcceptedAnswerId="14702" CreationDate="2015-08-09T15:08:47.837" Score="1" ViewCount="859" Body="&lt;p&gt;I use evil-mode (from spacemacs) and I get a strange behaviour which I'm not sure if it is right or a bug. If I delete words (with &lt;code&gt;dw&lt;/code&gt;, i think it calls &lt;code&gt;evil-delete&lt;/code&gt;), it works until I arrive at the last word in the line, after that it starts to delete the last remaining character in the same line (backwards delete one char). Maybe the problem is the way auto-fill-mode is splitting the lines in a paragraph. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make &lt;code&gt;dw&lt;/code&gt; delete words in the following line once it reached the last word in a line?&lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2015-08-13T01:38:27.770" Title="How to delete word in next line with evil-mode?" Tags="|evil|text-editing|spacemacs|deletion|auto-fill-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14607" PostTypeId="2" ParentId="14604" CreationDate="2015-08-09T15:13:37.137" Score="1" Body="&lt;p&gt;Aside from the straightforward solution proposed by Dan which works in this and other situations, you can use the below function which kills every line from a certain character (the function asks a character or a string as input and it does this action from the cursor until the end of buffer).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-line-from-certain-character-or-string (str) (interactive &quot;skill line from the character/string: &quot;)&#xA;(save-excursion (while (re-search-forward str nil t)&#xA;        (backward-char)(kill-line)&#xA;)  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-08-09T15:13:37.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14608" PostTypeId="2" ParentId="14592" CreationDate="2015-08-09T15:43:45.600" Score="2" Body="&lt;p&gt;Yes, make the variable buffer-local, and turn the mode on in a given buffer, to use it. Your code can of course test whether the mode is on in a given buffer.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-09T15:43:45.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14609" PostTypeId="2" ParentId="14587" CreationDate="2015-08-09T17:53:36.120" Score="13" Body="&lt;p&gt;While I second other's comments here about places to go for interaction and coordination, there is another unique aspect to Emacs development. For its size, innovation, and coordination, it is a relatively quiet endeavor. Not much noise about itself. Major releases trigger a few dozen extra emails. Even for lengthy threads, the retorts are terse. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compare that to comparable projects that seem to generate so much noise that I routinely unsubscribe to the lists around major events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This economy of communication reflects on the maturity of ideas and the freedom to develop any idea worthy of implementing. Unwanted features wither away silently while new ideas (even if you call it evil mode) gets an entry in the changelog.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the blogs you mention, they serve an important role in not just educating but also working through competing ideas and piggy-backing ideas. For example, ace-jump revived many ideas of jumping to other parts of the buffer, other buffers, other files, remote searching and so on. For example, ack, avy, ivy, anzu, counsel, swiper, swoop, etc., are all being refined right now and are frequent topics of discussion on google+ meet up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subscribing to planet emacs rss feed will probably cover most active blogs. The rss is relatively terse except for an occasional repeat of the same news item by somebody else. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You won't find developer emails about sub-features on Emacs developer's list but perhaps in their own project-specific mailing list. The largest of these project-specific lists is of course org-mode. What may have been hundreds on that list is probably reduced to a single announcement in emacs change log.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of an all-encompassing developer email list, usenet group, irc channel, website, git hub location, blog location, or a social media page, we have a truly distributed and diversity of interaction where no single platform takes over. It may be partly due to the fact that emacs development has been going on a lot longer than any of these communication platforms, but it is also partly due to a deliberate choice to not restrict to a single mode of communication. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the whole, it is not the case that there is not enough coordination. As a developer you take as little or as much input you desire. Emacs's development model lends itself to a relatively noise-free (and frictionless) collaboration. I think that's a good thing. I hope you do too.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-08-10T14:56:17.447" LastActivityDate="2015-08-10T14:56:17.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14611" PostTypeId="2" ParentId="13291" CreationDate="2015-08-09T19:12:41.793" Score="2" Body="&lt;p&gt;In addition to zarkone's answer, there's a variable that controls whether Emacs should infer X resources: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Resources.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;inhibit-x-resources&lt;/code&gt;&lt;/a&gt;. Setting it to &lt;code&gt;t&lt;/code&gt; would disallow Emacs to use any X resources, relying on its own colors.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2015-08-09T19:12:41.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14612" PostTypeId="1" AcceptedAnswerId="14624" CreationDate="2015-08-09T21:44:28.380" Score="1" ViewCount="182" Body="&lt;p&gt;This defines the Helm-source for &lt;code&gt;Emacs commands history&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar helm-source-emacs-commands-history&#xA;    (helm-build-sync-source &quot;Emacs commands history&quot;&#xA;    :candidates (lambda ()&#xA;                    (let ((cmds))&#xA;                    (dolist (elem extended-command-history)&#xA;                        (push (intern elem) cmds))&#xA;                    cmds))&#xA;    :coerce #'intern-soft&#xA;    :action #'command-execute)&#xA;    &quot;Emacs commands history&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this source you get the latest commands that you called with &lt;code&gt;M-x&lt;/code&gt;. I would have a function, that calls the latest command that I called with &lt;code&gt;M-x&lt;/code&gt; earlier. I read the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/List-Elements.html&quot; rel=&quot;nofollow&quot;&gt;documentation about list elements&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function: car cons-cell&#xA;This function returns the value referred to by the first slot of the cons cell cons-cell. In other words, it returns the CAR of cons-cell.&#xA;&#xA;As a special case, if cons-cell is nil, this function returns nil. Therefore, any list is a valid argument. An error is signaled if the argument is not a cons cell or nil.&#xA;&#xA;(car '(a b c))&#xA;    ⇒ a&#xA;(car '())&#xA;    ⇒ nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I assume I need to replace the &lt;code&gt;push&lt;/code&gt; with &lt;code&gt;car&lt;/code&gt;, and return the result.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (elem extended-command-history)&#xA;(car (intern elem))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I got the error message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered -- Lisp error (wrong-type-argument listp Info-next)&#xA;(Info-Next)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;Info-Next&lt;/code&gt; was indeed the latest command that I called with &lt;code&gt;M-x&lt;/code&gt;.  However, I don't understand the error. Another way to get the latest called function. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foobar ()&#xA;    (interactive)&#xA;    (call-interactively (intern (car extended-command-history))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After calling &lt;code&gt;foobar&lt;/code&gt;, I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;funcall-interactively: Lisp nesting exceeds `max-lisp-eval-depth'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestion to get the latest command? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-08-10T12:43:48.437" LastActivityDate="2015-08-10T15:10:55.787" Title="Getting latest command from function, but function exceeds &quot;max-lisp-eval-depth&quot;" Tags="|functions|prefix-argument|" AnswerCount="2" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="14613" PostTypeId="2" ParentId="14563" CreationDate="2015-08-09T23:07:59.243" Score="9" Body="&lt;p&gt;The below code works fine from my brief testing in a &lt;code&gt;c-mode&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;After typing &lt;code&gt;/*&lt;/code&gt;, hit &lt;code&gt;M-j&lt;/code&gt;, the default binding for &lt;code&gt;indent-new-comment-line&lt;/code&gt; (and the default binding for &lt;code&gt;c-indent-new-comment-line&lt;/code&gt; in &lt;code&gt;c-mode&lt;/code&gt;). If it is the first comment line the closing closing characters &lt;code&gt;*/&lt;/code&gt; will be auto-inserted.&lt;/li&gt;&#xA;&lt;li&gt;Hitting &lt;code&gt;M-j&lt;/code&gt; more times with insert more comment lines with the &lt;code&gt;*&lt;/code&gt; prefix. This is the in-built behavior of &lt;code&gt;c-indent-new-comment-line&lt;/code&gt;/&lt;code&gt;indent-new-comment-line&lt;/code&gt; functions. Check out the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Multi_002dLine-Comments.html&quot; rel=&quot;noreferrer&quot;&gt;Multiple lines of comments&lt;/a&gt; documentation.&lt;/li&gt;&#xA;&lt;li&gt;An extra nugget in the below code ensures that there is at least one space between the &lt;code&gt;*&lt;/code&gt; on each comment line and the comment.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-prettify-c-block-comment (orig-fun &amp;amp;rest args)&#xA;  (let* ((first-comment-line (looking-back &quot;/\\*\\s-*.*&quot;))&#xA;         (star-col-num (when first-comment-line&#xA;                         (save-excursion&#xA;                           (re-search-backward &quot;/\\*&quot;)&#xA;                           (1+ (current-column))))))&#xA;    (apply orig-fun args)&#xA;    (when first-comment-line&#xA;      (save-excursion&#xA;        (newline)&#xA;        (dotimes (cnt star-col-num)&#xA;          (insert &quot; &quot;))&#xA;        (move-to-column star-col-num)&#xA;        (insert &quot;*/&quot;))&#xA;      (move-to-column star-col-num) ; comment this line if using bsd style&#xA;      (insert &quot;*&quot;) ; comment this line if using bsd style&#xA;     ))&#xA;  ;; Ensure one space between the asterisk and the comment&#xA;  (when (not (looking-back &quot; &quot;))&#xA;    (insert &quot; &quot;)))&#xA;(advice-add 'c-indent-new-comment-line :around #'my-prettify-c-block-comment)&#xA;;; (advice-remove 'c-indent-new-comment-line #'my-prettify-c-block-comment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For instance, after evaluating the above code, I get the below on typing: &lt;code&gt;/*&lt;/code&gt; &lt;code&gt;M-j&lt;/code&gt; &lt;code&gt;First comment line&lt;/code&gt; &lt;code&gt;M-j&lt;/code&gt; &lt;code&gt;Second comment line&lt;/code&gt;. &lt;em&gt;The ▮ indicates the cursor location at the end of typing.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;/*&#xA; * First comment line&#xA; * Second comment line▮&#xA; */ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Testing offset comment block ..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With cursor after the semicolon, typing: &lt;code&gt;/*&lt;/code&gt; &lt;code&gt;M-j&lt;/code&gt; &lt;code&gt;Test offset comment&lt;/code&gt; gives the below. &lt;em&gt;The ▮ indicates the cursor location at the end of typing.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#include&amp;lt;stdio.h&amp;gt;&#xA;main() {&#xA;  printf(&quot;Hello World&quot;); /*&#xA;                          * Test offset comment▮  &#xA;                          */                                 &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-08-10T18:07:53.393" LastActivityDate="2015-08-10T18:07:53.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14614" PostTypeId="2" ParentId="14574" CreationDate="2015-08-10T01:51:36.553" Score="1" Body="&lt;p&gt;My recommendation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Start with the functions, variables, macros, etc. that your code actually uses. If it uses something that was introduced in a given version of Emacs or of the function's source library, then start with that as your minimum version.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The version of the function that you use might not correspond to the original version of the function, when it was first introduced. Perhaps more arguments were added. Check whether that matters for your particular use of it. If not then you can ignore this. If yes, then that find the oldest source version that supports what your code expects.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Test.&lt;/strong&gt; Get a copy of whatever version of the library you claim you support as a minimum, and try it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sometimes minor changes have been made to a function, and your code does not fundamentally need a newer version. But it might need to be adapted, to support more than one version (if that's what you want).  You might need to test whether the function exists (&lt;code&gt;fboundp&lt;/code&gt;) or has the right signature/calling sequence. For the latter, &lt;code&gt;subr-arity&lt;/code&gt; can help with built-ins, but you might need to use &lt;code&gt;condition-case&lt;/code&gt; for Lisp functions (calling with the expanded number of args, and handling a wrong-number-of-args error by calling with fewer args).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-10T01:51:36.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14615" PostTypeId="2" ParentId="14545" CreationDate="2015-08-10T01:55:48.883" Score="1" Body="&lt;p&gt;Use &lt;code&gt;completing-read&lt;/code&gt;.  See &lt;code&gt;C-h f completing-read&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((user-input  (completing-read &quot;Theme: &quot; html-themes-list nil t))&#xA;       (theme-link  (cdr (assoc user-input html-themes-list))))&#xA;  (DO-SOMETHING-WITH theme-link))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-10T01:55:48.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14616" PostTypeId="1" AcceptedAnswerId="14617" CreationDate="2015-08-10T03:33:52.713" Score="2" ViewCount="1833" Body="&lt;p&gt;I like vim's tabcomplete feature - filename completion for its dropdown choices. Like this vi popdown,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VKVyW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VKVyW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;hippie-expand&lt;/code&gt; with functions, &lt;code&gt;try-complete-file-name-partially try-complete-file-name&lt;/code&gt;. It shows one option at a time not all the options with a drop-down. It consumes lot of time, calling &lt;code&gt;hippie-expand&lt;/code&gt; for each and every wrong completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any elisp library that has filepath autocompletion with dropdowns?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="10" LastEditDate="2015-08-10T06:09:59.383" LastActivityDate="2018-01-11T08:45:03.300" Title="File name autocomplete with dropdown" Tags="|company-mode|auto-complete-mode|abbrev|hippie-expand|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14617" PostTypeId="2" ParentId="14616" CreationDate="2015-08-10T05:53:57.103" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/company-mode/company-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-mode&lt;/a&gt; has a &lt;a href=&quot;https://github.com/company-mode/company-mode/blob/master/company-files.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;files backend&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RdxzG.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-08-10T05:53:57.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14618" PostTypeId="1" AcceptedAnswerId="18611" CreationDate="2015-08-10T07:22:31.263" Score="9" ViewCount="1022" Body="&lt;p&gt;I have a multi-monitor setup, in which a specific monitor has a dedicated Emacs frame in full screen which shows compiler errors (from Compilation Mode or SBT Mode).  I'd like to preserve the setup automatically, even if I click on an error location in that frame.  Specifically, if the dedicated “error” frame is selected, &lt;code&gt;display-buffer&lt;/code&gt; should show an buffer in the “main frame” where I do my editing.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The “main frame” is the one on my primary monitor, which stands in the center of my desk.  It's also the “official” primary monitor as per global display settings in the OS X system configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make sure that buffers are shown at the right place, I need to find out whether a certain frame is on the primary display or not.  Is that possible, and if so, how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A platform independent approach would be great, but if that is not possible, a solution for OS X is also fine.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2023-04-10T04:57:59.177" Title="Determine whether a frame is shown on primary display" Tags="|frames|display|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14619" PostTypeId="2" ParentId="14485" CreationDate="2015-08-10T10:04:48.683" Score="3" Body="&lt;p&gt;Should have used &lt;code&gt;(define-key evil-normal-state-map &quot;j&quot; 'evil-next-visual-line)&lt;/code&gt; to remap it instead of &lt;code&gt;evil-motion-state-map&lt;/code&gt;. Works now.&lt;/p&gt;&#xA;" OwnerUserId="9109" LastActivityDate="2015-08-10T10:04:48.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14620" PostTypeId="1" AcceptedAnswerId="14664" CreationDate="2015-08-10T12:30:08.777" Score="1" ViewCount="190" Body="&lt;p&gt;I have a dictionary key-values dict.tsv file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;key1 value1&#xA;key2 value2&#xA;key3 value3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And my text.txt file has this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;blah blah asdf saf key2 asd blah key1&#xA;blah key1&#xA;blah key2&#xA;blah key3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;blah blah asdf saf key2/value2 asd blah key1/vaue1&#xA;blah key1/value1&#xA;blah key2/value2&#xA;blah key3/value3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I imagine a function working like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;lookup-and-replace-with-an-association-list&lt;/code&gt; works like this&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x lookup-and-replace-with-an-association-list RET&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Input path to &lt;code&gt;dict.tsv&lt;/code&gt; and use the whole file content for lookup and replace. Or if no file provided, select the content from current highlighted region.  &lt;/li&gt;&#xA;&lt;li&gt;(internally) Parse the content to a association list &lt;code&gt;dict.list&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Input key regex pattern. If no pattern given, take all the keys in the &lt;code&gt;dict.list&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Input replace pattern with value. In my case: &lt;code&gt;keyX/valueX&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Optional, maybe a interactive confirmation yes, no or do-all would be nice.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="8937" LastEditDate="2015-08-10T13:37:45.007" LastActivityDate="2015-08-11T19:09:51.060" Title="search keys and replace by values in another file?" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14621" PostTypeId="1" AcceptedAnswerId="14717" CreationDate="2015-08-10T12:54:19.273" Score="0" ViewCount="1038" Body="&lt;p&gt;How can I make this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [ ] check&#xA;- [x] box&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;render checkboxes, like in GFM? I think the output is something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;input type=&quot;checkbox&quot; disabled&amp;gt; check&#xA;&amp;lt;input type=&quot;checkbox&quot; disabled checked&amp;gt; box&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to use org-mode. I know there is gfm-mode, and I saw this &lt;a href=&quot;https://gist.github.com/fredRos/0e3a845de95ec654538f&quot; rel=&quot;nofollow&quot;&gt;Gist&lt;/a&gt;, which shows how to use pandoc to also get GFM-style markdown. However, none of them seems to support checkboxes, unless I am doing something wrong.&lt;/p&gt;&#xA;" OwnerUserId="8594" LastActivityDate="2015-08-13T11:35:11.300" Title="Have markdown-mode render checkboxes as in GFM" Tags="|markdown|markdown-mode|gfm-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14622" PostTypeId="1" CreationDate="2015-08-10T13:29:05.483" Score="8" ViewCount="1228" Body="&lt;p&gt;I'm trying to replace SourceTree with Magit and one of the features i can't understand how to reproduce in Emacs is to make it show me remote commits on the graph. In source tree that looks this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Sx1CD.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Sx1CD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to reproduce in Magit?&lt;/p&gt;&#xA;" OwnerUserId="2361" LastActivityDate="2015-08-10T15:58:31.957" Title="Show unpulled remote commits in magit" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14623" PostTypeId="2" ParentId="14612" CreationDate="2015-08-10T13:33:59.593" Score="0" Body="&lt;p&gt;After some asking and research, the error funcall-interactively: Lisp nesting exceeds max-lisp-eval-depth is quite reasonable. The last command will be foobar since it is interactive. Use use &lt;code&gt;cadr&lt;/code&gt; instead of &lt;code&gt;car&lt;/code&gt; in foobar.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-08-10T13:40:56.413" LastActivityDate="2015-08-10T13:40:56.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14624" PostTypeId="2" ParentId="14612" CreationDate="2015-08-10T15:10:55.787" Score="2" Body="&lt;p&gt;Let's explain the different code bits of your question (I'm reusing some of what I said in my comments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we find in the helm source definition is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((cmds))&#xA;  (dolist (elem extended-command-history)&#xA;    (push (intern elem) cmds))&#xA;  cmds)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This builds a list of symbols. Each element of &lt;code&gt;extended-command-history&lt;/code&gt; is a string which is transformed into a symbol via &lt;code&gt;intern&lt;/code&gt; and pushed to the list &lt;code&gt;cmds&lt;/code&gt;. Once done, &lt;code&gt;cmds&lt;/code&gt; is returned. Btw, another, more concise but not more efficient, way of doing this is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nreverse (mapcar 'intern extended-command-history))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now what you want is to run the first element of &lt;code&gt;extended-command-history&lt;/code&gt; and run it as a command. So a first naive approach would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foobar ()&#xA;  (interactive)&#xA;  (call-interactively (intern (car extended-command-history))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you do &lt;code&gt;M-x foobar RET&lt;/code&gt; this will end up running &lt;code&gt;foobar&lt;/code&gt; (because &lt;code&gt;M-x&lt;/code&gt; pushes &lt;code&gt;foobar&lt;/code&gt; to &lt;code&gt;extended-command-history&lt;/code&gt; before calling it), hence the error you mentionned :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;funcall-interactively: Lisp nesting exceeds `max-lisp-eval-depth'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To avoid this problem, one can run the first element of &lt;code&gt;extended-command-history&lt;/code&gt; that is different from the current command. Here's some code to do this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foobar ()&#xA;  (interactive)&#xA;  (let ((history extended-command-history)&#xA;        cmd)&#xA;    ;; remove any occurence of this-command at the head of `history'.&#xA;    (while (string= this-command (setq cmd (pop history))))&#xA;    (message &quot;Running cmd: %s&quot; cmd)&#xA;    (call-interactively (intern cmd))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you mentionned, we could also run the &lt;code&gt;cadr&lt;/code&gt; of &lt;code&gt;extended-command-history&lt;/code&gt;, but it would be off by one in the case &lt;code&gt;foobar&lt;/code&gt; is not ran via &lt;code&gt;M-x&lt;/code&gt; but via some key binding (because in this case, it won't get added to the head of &lt;code&gt;extended-command-history&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-10T15:10:55.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14625" PostTypeId="1" CreationDate="2015-08-10T15:50:43.053" Score="3" ViewCount="1685" Body="&lt;p&gt;I'm trying to set up &lt;a href=&quot;http://www.emacswiki.org/emacs/NotMuch&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;notmuch&lt;/code&gt;&lt;/a&gt; for sending and receiving my Gmail email, and I think &lt;code&gt;notmuch&lt;/code&gt; uses &lt;code&gt;message-mode&lt;/code&gt; for its reply function. I tried setting &lt;code&gt;message-citation-line-function&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, but replying still quotes the entire message with a &lt;code&gt;&amp;gt;&lt;/code&gt; prefix on each line. But that didn't work. How do I set it so that when I reply to a message, the sender's original message doesn't get quoted at all, in standard Gmail style?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="15748" LastEditDate="2017-07-26T19:27:18.660" LastActivityDate="2017-07-26T19:27:18.660" Title="How to control quoting of original message when replying?" Tags="|email|message-mode|notmuch|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14626" PostTypeId="2" ParentId="14622" CreationDate="2015-08-10T15:58:31.957" Score="10" Body="&lt;p&gt;Sure. Hit &lt;code&gt;f a&lt;/code&gt;, which will run &lt;code&gt;git fetch --all&lt;/code&gt;, it it will show you all the unpulled commits. You can then hit &lt;code&gt;RET&lt;/code&gt; on a commit to bring up a detailed view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, after running &lt;code&gt;git fetch --all&lt;/code&gt; in a terminal, &lt;code&gt;git status&lt;/code&gt; will also tell you something like: &quot;Your branch is behind 'origin/master' by 82 commits, and can be fast-forwarded.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LyWsn.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LyWsn.png&quot; alt=&quot;Magit unpulled commits&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-08-10T15:58:31.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14627" PostTypeId="1" AcceptedAnswerId="14663" CreationDate="2015-08-10T16:50:45.260" Score="7" ViewCount="366" Body="&lt;p&gt;As I understand from the manual (last paragraphs of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Hash.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Hash.html&lt;/a&gt;) and the question &lt;a href=&quot;https://stackoverflow.com/questions/11745097/&quot;&gt;https://stackoverflow.com/questions/11745097/&lt;/a&gt; on stackoverflow, one can save a printed version of a hashtable on the disc in order to load it for later use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example the printed version of a hashtable created by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ht (make-hash-table :test 'equal))&#xA;(puthash &quot;orange&quot; 1 ht)&#xA;(puthash &quot;apple&quot; 2 ht)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data (&quot;orange&quot; 1 &quot;apple&quot; 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this printed version already the best format (for speed consideration) that Emacs can use ?&#xA;Is there an special procedure to re-format (to byte-compile, to change) the above printed format to a better format (maybe only machine-readable) in order that Emacs loads this hashtable faster.&#xA;If the answer is affirmative what are the ways to do it.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-08-11T18:40:39.530" Title="How to speed up the loading of large hashtables?" Tags="|hash-tables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14628" PostTypeId="2" ParentId="14627" CreationDate="2015-08-10T19:50:42.647" Score="5" Body="&lt;p&gt;You're going to have to hash and insert every value no matter what, and unless you're dealing with enormous hash tables, the time spent shouldn't really matter. However, if your tables are large, then you should use the &lt;code&gt;:size&lt;/code&gt; parameter to &lt;code&gt;make-hash-table&lt;/code&gt; so no reallocations have to occur. When a hash table reaches the threshold, having to reallocate a new place in memory to put the values and rehashing all the current entries will be a big performance loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know you are about to insert 1 million entries into a hash table, use &lt;code&gt;(make-hash-table :size 1000000)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following benchmark:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(benchmark 10&#xA;           '(let ((ht (make-hash-table :size 1000000)))&#xA;              (dotimes (n 1000000) (puthash n (1+ n) ht))&#xA;              ht))&#xA;&quot;Elapsed time: 4.156233s (2.087411s in 10 GCs)&quot;&#xA;&#xA;&#xA;(benchmark 10&#xA;           '(let ((ht (make-hash-table)))&#xA;              (dotimes (n 1000000) (puthash n (1+ n) ht))&#xA;              ht))&#xA;&quot;Elapsed time: 10.276816s (7.713422s in 41 GCs)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also define your own test and hash function for hash tables. If you know your keys are going to be in a specific set, you could potentially write faster equallity and hashing functions that exploit that. See: &lt;code&gt;define-hash-table-test&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-08-10T19:50:42.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14629" PostTypeId="1" AcceptedAnswerId="14630" CreationDate="2015-08-10T22:19:52.197" Score="5" ViewCount="4088" Body="&lt;p&gt;I am just starting to use Org-Mode as a getting things done application and having some trouble with the Line Spacing (not sure if that is the correct term) between entries.  For instance see below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TestPrimaryLevel1&#xA;&#xA;** TODO Testing Spacing Level2 &#xA;&#xA;*** Data associated with Testing Spacing Level3&#xA;&#xA;*** More data associated with Testing Spacing Level3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is an extra carriage return between each of the entries that I do not want to be there.  How can I default it to not adding that extra carriage return?&lt;/p&gt;&#xA;" OwnerUserId="9155" LastEditorUserId="675" LastEditDate="2015-08-10T23:06:27.540" LastActivityDate="2015-08-11T00:05:58.803" Title="Org-Mode Level Line Spacing" Tags="|org-mode|todo|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14630" PostTypeId="2" ParentId="14629" CreationDate="2015-08-10T22:54:09.437" Score="10" Body="&lt;p&gt;You can customize &lt;code&gt;org-blank-before-new-entry&lt;/code&gt;.  See &lt;code&gt;C-h v org-blank-before-new-entry&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-08-10T22:54:09.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14631" PostTypeId="2" ParentId="14629" CreationDate="2015-08-11T00:05:58.803" Score="2" Body="&lt;p&gt;You can customize the blank lines when collapsed with the following option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-cycle-separator-lines 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-08-11T00:05:58.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14632" PostTypeId="2" ParentId="14578" CreationDate="2015-08-11T00:15:27.513" Score="3" Body="&lt;p&gt;Check for a &lt;code&gt;*.el~&lt;/code&gt; file - there may be an Emacs backup of your missing &lt;code&gt;*.el&lt;/code&gt; file (which some tools will hide from you in their UI, so use something like &lt;code&gt;ls -a&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="9156" LastActivityDate="2015-08-11T00:15:27.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14633" PostTypeId="2" ParentId="14567" CreationDate="2015-08-11T00:25:52.253" Score="-2" Body="&lt;pre&gt;&lt;code&gt;(advice-add 'find-file :after&#xA;            (lambda (&amp;amp;rest _args)&#xA;              (message &quot;Called after `find-file' but not `find-file-no-select'&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9156" LastActivityDate="2015-08-11T00:25:52.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14634" PostTypeId="1" CreationDate="2015-08-11T01:02:48.047" Score="0" ViewCount="163" Body="&lt;p&gt;The default indentation style in emacs for a multi-line list is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;longFunctionName(arg1, arg2, arg3,&#xA;                 arg4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the final argument snaps to the starting position of the first argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I adjust this default indentation style (ie. what do I put in my .emacs) to make the second line snap to some increment of tabbing? I want the final result to look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;longFunctionName(arg1, arg2, arg3,&#xA;    arg4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9157" LastActivityDate="2015-08-11T19:35:52.290" Title="How Do I Adjust Indentation Style For Multi-Line Lists?" Tags="|indentation|default|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14635" PostTypeId="2" ParentId="14515" CreationDate="2015-08-11T01:54:32.233" Score="12" Body="&lt;p&gt;You can customize/set &lt;a href=&quot;http://magit.vc/manual/magit/Diff-options.html#index-magit_002ddiff_002drefine_002dhunk&quot;&gt;&lt;code&gt;magit-diff-refine-hunk&lt;/code&gt;&lt;/a&gt; to highlight word changes. &lt;code&gt;magit-diff-toggle-refine-hunk&lt;/code&gt;, bound to &lt;code&gt;D t&lt;/code&gt;, can be used to change it on the fly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;magit-diff-refine-hunk is a variable defined in `magit-diff.el'.&#xA;&#xA;Whether to show word-granularity differences within diff hunks.&#xA;&#xA;nil    never show fine differences.&#xA;t      show fine differences for the selected diff hunk only.&#xA;`all'  show fine differences for all displayed diff hunks.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2015-08-11T12:43:38.350" LastActivityDate="2015-08-11T12:43:38.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14636" PostTypeId="1" AcceptedAnswerId="14637" CreationDate="2015-08-11T02:04:05.253" Score="2" ViewCount="302" Body="&lt;p&gt;I try to comments 1.4K+ lines in a C++ function by using &lt;code&gt;M-;&lt;/code&gt; or rectangle insert string &lt;code&gt;//&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wait for several minutes, Emacs still no respond. I have to kill Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, how could I locate what cause the Emacs use 100% CPU and looks like do nothing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs: 25.0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OS: Ubuntu 14.04&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="25" LastEditDate="2016-04-21T09:55:16.197" LastActivityDate="2016-04-21T09:55:16.197" Title="How to debug slow respond or halt?" Tags="|quitting|" AnswerCount="1" CommentCount="2" ClosedDate="2016-04-21T09:55:23.507" ContentLicense="CC BY-SA 3.0" />
  <row Id="14637" PostTypeId="2" ParentId="14636" CreationDate="2015-08-11T02:29:16.823" Score="4" Body="&lt;p&gt;Little-known trick... You can send an interrupting debug signal to Emacs with &lt;code&gt;kill&lt;/code&gt;/&lt;code&gt;killall&lt;/code&gt;/&lt;code&gt;pkill&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pkill -USR2 emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When sent to Emacs, the &lt;code&gt;USR2&lt;/code&gt; kill signal will interrupt whatever Emacs is doing and drop you to a debugger. From there, you can likely tell what is causing the hang from the stack trace.&lt;/p&gt;&#xA;" OwnerUserId="2039" LastActivityDate="2015-08-11T02:29:16.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14638" PostTypeId="1" CreationDate="2015-08-11T03:27:35.680" Score="13" ViewCount="1003" Body="&lt;p&gt;I'm using hl-mode as a minor mode for deft. How do I make the highlighted line change color (e.g. to gray) when the deft window isn't the current window, and then back to the default highlight color when the deft window becomes the current window again?&lt;/p&gt;&#xA;" OwnerUserId="9159" LastActivityDate="2021-04-30T12:54:52.140" Title="Change highlight color when window isn't in focus?" Tags="|window|highlighting|focus|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14639" PostTypeId="2" ParentId="14616" CreationDate="2015-08-11T03:28:16.473" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow&quot;&gt;auto-complete&lt;/a&gt; also has this feature, via its built-in &lt;em&gt;(ac-source-filename)&lt;/em&gt; backend.  In addition, for c/c++, there is &lt;em&gt;auto-complete-c-headers&lt;/em&gt;, see &lt;a href=&quot;https://github.com/mooz/auto-complete-c-headers&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mooz/auto-complete-c-headers&lt;/a&gt;. Here is a screenshot of the latter: &#xA;&lt;img src=&quot;https://camo.githubusercontent.com/a6e8984abe042bf108559b2f8509b6101ffcfd91/68747470733a2f2f7261772e6769746875622e636f6d2f6d6f6f7a2f6175746f2d636f6d706c6574652d632d686561646572732f696d616765732f73637265656e73686f742e706e67&quot; alt=&quot;drop-down-for-c-headers&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2015-08-11T03:28:16.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14640" PostTypeId="1" AcceptedAnswerId="14644" CreationDate="2015-08-11T06:42:47.307" Score="9" ViewCount="711" Body="&lt;p&gt;Is their a way to hide comment whatever the language used? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like if I'm in cpp mode all &lt;code&gt;/* ... */&lt;/code&gt; should be hide and if I'm on LaTeX mode, all &lt;code&gt;% ...&lt;/code&gt; will be hide.&lt;/p&gt;&#xA;" OwnerUserId="9160" LastEditorUserId="105" LastEditDate="2015-08-11T13:03:48.667" LastActivityDate="2019-04-30T05:27:06.400" Title="Hide comment in current buffer" Tags="|elisp|comment|visibility|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14641" PostTypeId="2" ParentId="12895" CreationDate="2015-08-11T07:56:52.963" Score="4" Body="&lt;p&gt;Please following the steps below&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Please update to the current Alchemist version 1.4.0&lt;/li&gt;&#xA;&lt;li&gt;Read the section about the requirements on the &lt;a href=&quot;https://github.com/tonini/alchemist.el#requirements&quot; rel=&quot;nofollow&quot;&gt;README&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you then have still problems, please call me on the #elixir IRC channel, nickname is tonini&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the report and asking&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="2269" LastActivityDate="2015-08-11T07:56:52.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14642" PostTypeId="2" ParentId="14603" CreationDate="2015-08-11T08:00:22.403" Score="1" Body="&lt;p&gt;I made a new command for your request, the idea is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;when the point is outside a list, just insert a newline as usual&lt;/li&gt;&#xA;&lt;li&gt;when the point is inside a list&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if the current list is empty, delete it and insert a newline&lt;/li&gt;&#xA;&lt;li&gt;otherwise, insert a new list item&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun markdown-enter-key-dwim ()&#xA;  (interactive)&#xA;  (require 'subr-x)                     ; Needs Emacs 24.4&#xA;  (if-let ((bounds (markdown-cur-list-item-bounds))&#xA;           (beg (car bounds)) (end (cadr bounds))&#xA;           (text (buffer-substring beg end)))&#xA;      (if (and (&amp;gt;= (length text) 2)&#xA;               (string-blank-p&#xA;                (substring text 2)))&#xA;          (progn&#xA;            ;; Delete current blank list&#xA;            (kill-region beg end)&#xA;            ;; Insert RET&#xA;            (markdown-enter-key))&#xA;        ;; Create a new list&#xA;        (call-interactively #'markdown-insert-list-item))&#xA;    ;; Not within a list environment&#xA;    (markdown-enter-key)))&#xA;&#xA;(require 'markdown-mode)&#xA;(define-key markdown-mode-map2 (kbd &quot;RET&quot;) #'markdown-enter-key-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notes, &lt;code&gt;markdown-enter-key-dwim&lt;/code&gt; is not well-tested (probably too aggressive) and needs future work. The built-in &lt;kbd&gt;M-RET&lt;/kbd&gt; (&lt;code&gt;markdown-insert-list-item&lt;/code&gt;) is still handy enough for me, maybe you can just use it as well.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-08-11T08:00:22.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14643" PostTypeId="1" CreationDate="2015-08-11T08:09:35.800" Score="12" ViewCount="7432" Body="&lt;p&gt;I'm new to emacs and programming in general so please bear with me. I'm trying to use emacs as my C/C++ IDE, and I noticed that in CC mode the variables/functions seemed to be highlighted only during declaration. My question is &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is it possible to highlight variables, and functions on an entire cpp file&lt;/li&gt;&#xA;&lt;li&gt;If possible, what needs to be added to the .emacs file &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="9048" LastEditorUserId="105" LastEditDate="2015-12-19T21:53:36.910" LastActivityDate="2018-03-13T21:30:16.660" Title="How to get semantic syntax highlighting on emacs for C/C++ code" Tags="|syntax-highlighting|c++|semantic-mode|c|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14644" PostTypeId="2" ParentId="14640" CreationDate="2015-08-11T08:19:03.520" Score="9" Body="&lt;p&gt;The package &lt;a href=&quot;http://www.emacswiki.org/emacs/hide-comnt.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;hide-comnt&lt;/a&gt; available from Melpa (now marmalade) can do it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x hide/show-comments-toggle&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2019-04-30T05:27:06.400" LastActivityDate="2019-04-30T05:27:06.400" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="14645" PostTypeId="2" ParentId="14571" CreationDate="2015-08-11T09:05:05.230" Score="2" Body="&lt;pre&gt;&lt;code&gt;(setq flycheck-indication-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.flycheck.org/en/latest/user/error-reports.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Relevant docs here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="19526" LastEditorDisplayName="user227" LastEditDate="2022-07-05T17:06:51.297" LastActivityDate="2022-07-05T17:06:51.297" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="14647" PostTypeId="1" CreationDate="2015-08-11T09:47:47.813" Score="2" ViewCount="1540" Body="&lt;p&gt;I want to run a short python simulation in org-mode and use the results later&#xA;on in my continuous text. Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python&#xA;a = 5 + 5&#xA;#+end_src&#xA;&#xA;The result of the calculation is &amp;lt;&amp;lt;value in a&amp;gt;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which should export to the following latex code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The result of the calculation is 10.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="536" LastActivityDate="2017-02-16T09:05:36.447" Title="Use code variable in org-mode continuous text" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14648" PostTypeId="1" AcceptedAnswerId="14650" CreationDate="2015-08-11T10:16:04.307" Score="2" ViewCount="1697" Body="&lt;p&gt;I'm trying to get several plugins all playing nicely: yasnippet, company-mode and ENSIME.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of &lt;a href=&quot;https://emacs.stackexchange.com/questions/7908&quot;&gt;How to make yasnippet and company work nicer?&lt;/a&gt; but I was thinking about another, simpler, approach: can I just disable company-mode's TAB altogether?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;RET&lt;/code&gt; to expand completions and I very rarely want to use &lt;code&gt;TAB&lt;/code&gt; to select the maximum common matching expression.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-08-11T17:50:55.783" Title="disable TAB in company-mode" Tags="|key-bindings|company-mode|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14649" PostTypeId="1" CreationDate="2015-08-11T14:24:43.147" Score="1" ViewCount="448" Body="&lt;p&gt;I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'json-mode 'flymake-json-load)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my .emacs file, but it has no effect. I have to do &lt;code&gt;M-x flymake-json-load&lt;/code&gt; whenever I visit a &lt;code&gt;.json&lt;/code&gt; file. Why doesn't it work?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2015-08-11T20:35:08.027" Title="json-mode hook not being run" Tags="|hooks|json|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14650" PostTypeId="2" ParentId="14648" CreationDate="2015-08-11T14:27:02.340" Score="4" Body="&lt;p&gt;Use &lt;code&gt;C-h M-k&lt;/code&gt; (&lt;code&gt;describe-keymap&lt;/code&gt;) from &lt;a href=&quot;http://www.emacswiki.org/emacs/HelpPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/a&gt; to find out what command &lt;code&gt;company-mode-map&lt;/code&gt; (or whatever the mode's keymap is called) binds to &lt;code&gt;TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then do &lt;code&gt;(define-key company-mode-map THE-COMMAND nil)&lt;/code&gt;, where &lt;code&gt;THE-COMMAND&lt;/code&gt; is that command, to unbind it. (Or use another key sequence in place of &lt;code&gt;nil&lt;/code&gt;, to bind it to a different key.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;UPDATE by @fommil:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll find that the following will then unbind &lt;code&gt;TAB&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key company-active-map 'company-complete-common nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-11T17:50:55.783" LastActivityDate="2015-08-11T17:50:55.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14651" PostTypeId="2" ParentId="14649" CreationDate="2015-08-11T14:43:47.797" Score="3" Body="&lt;p&gt;&lt;code&gt;add-hook&lt;/code&gt; does not take a mode symbol as its first parameter; it takes a symbol for a hook variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replace &lt;code&gt;'json-mode&lt;/code&gt; with &lt;code&gt;'json-mode-hook&lt;/code&gt; and you'll be all set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the differences between the symbols. One is a variable used to store a list of functions to run when entering &lt;code&gt;json-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;json-mode-hook is a variable defined in ‘json-mode.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Hook run after entering JSON mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and the other is a function used to enter &lt;code&gt;json-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;json-mode is an interactive autoloaded compiled Lisp function in&#xA;  ‘json-mode.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Parent mode: ‘javascript-mode’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Major mode for editing JSON files&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="160" LastEditorUserId="105" LastEditDate="2015-08-11T20:35:08.027" LastActivityDate="2015-08-11T20:35:08.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14652" PostTypeId="1" CreationDate="2015-08-11T15:51:10.343" Score="7" ViewCount="2638" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I attach multiple files to an outbound email with a minimum amount of fuss?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;mu4e&lt;/code&gt; (which reuses &lt;code&gt;message-mode&lt;/code&gt;, if that helps) to work with email.  I often need to send emails with multiple attachments.  &lt;code&gt;mu4e&lt;/code&gt; uses &lt;code&gt;mml-attach-file&lt;/code&gt; to handle attachments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far so good.  However: it's an unpleasant task to use multiple attachments.  &lt;code&gt;mml-attach-file&lt;/code&gt; prompts for each file anew, which is time-consuming when the file is buried deep in a subtree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is almost always the case that, when I need to attach multiple files, they are all in the same directory.  In this situation, &lt;strong&gt;how can I convince &lt;code&gt;mml-attach-file&lt;/code&gt; to detect an attachment in the existing message buffer and, if it finds one, use that attachment's directory as the default for the next file I attempt to attach?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: If one digs into the source code, &lt;code&gt;mml-attach-file&lt;/code&gt; relies on &lt;code&gt;mml-minibuffer-read-file&lt;/code&gt;, which in turn uses either &lt;code&gt;mml-default-directory&lt;/code&gt; or &lt;code&gt;default-directory&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I'm aware of &lt;a href=&quot;https://emacs.stackexchange.com/questions/14514/how-to-attach-multiple-files-in-message-mode&quot;&gt;How to attach multiple files in &lt;code&gt;message-mode&lt;/code&gt;&lt;/a&gt;, but there's no answer there.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2021-05-19T15:36:32.563" Title="attach multiple files from the same directory to an email message?" Tags="|email|mu4e|message-mode|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14653" PostTypeId="5" CreationDate="2015-08-11T15:55:19.360" Score="0" Body="" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-08-11T15:55:19.360" LastActivityDate="2015-08-11T15:55:19.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14654" PostTypeId="4" CreationDate="2015-08-11T15:55:19.360" Score="0" Body="Email-related questions across the different clients (gnus, mu4e, rmail, etc.)" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-08-11T15:55:19.360" LastActivityDate="2015-08-11T15:55:19.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14655" PostTypeId="5" CreationDate="2015-08-11T15:56:25.043" Score="0" Body="" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-08-11T15:56:25.043" LastActivityDate="2015-08-11T15:56:25.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14656" PostTypeId="4" CreationDate="2015-08-11T15:56:25.043" Score="0" Body="Mode for composing email and other forms of messages.  Used by gnus and mu4e." OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-08-11T15:56:25.043" LastActivityDate="2015-08-11T15:56:25.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14657" PostTypeId="1" CreationDate="2015-08-11T16:22:22.390" Score="2" ViewCount="107" Body="&lt;p&gt;I am trying to make the case to my employer that updating from Emacs 24.3 to Emacs 24.5 is the right thing to do.  The (understandable) justification for sticking with version 24.3 is that it is supported and configured by the OS vendor (CentOS), and as such, it will receive security updates, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My argument is that once 24.4 was released, 24.3 reached the end of its support, and all future updates would be updates to the latest version.  I found the following paragraph in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq/Latest-version-of-Emacs.html&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs FAQ&lt;/a&gt;, but I'm not sure that it clearly supports or refutes this claim.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A version number with two components (e.g., ‘22.1’) indicates a released version; three components indicate a development version (e.g., ‘23.0.50’ is what will eventually become ‘23.1’). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question then is this: &lt;strong&gt;Will Emacs 24.3 ever receive security updates in the future&lt;/strong&gt;? (or updates of any kind for that matter.)&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="253" LastEditDate="2015-08-11T18:15:28.120" LastActivityDate="2015-08-11T19:16:38.113" Title="Will there be security updates to Emacs 24.3?" Tags="|security|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14658" PostTypeId="2" ParentId="14638" CreationDate="2015-08-11T16:51:22.613" Score="5" Body="&lt;p&gt;I've implemented this for &lt;code&gt;hl-line-mode&lt;/code&gt; using the &lt;code&gt;buffer-list-update-hook&lt;/code&gt;. &#xA;Here's the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defface hl-line-inactive&#xA;  '((t nil))&#xA;  &quot;Inactive variant of `hl-line'.&quot;&#xA;  :group 'hl-line)&#xA;&#xA;(defun hl-line-update-face (window)&#xA;  &quot;Update the `hl-line' face in WINDOW to indicate whether the window is selected.&quot;&#xA;  (with-current-buffer (window-buffer window)&#xA;    (when hl-line-mode&#xA;      (if (eq (current-buffer) (window-buffer (selected-window)))&#xA;          (face-remap-reset-base 'hl-line)&#xA;        (face-remap-set-base 'hl-line (face-all-attributes 'hl-line-inactive))))))&#xA;&#xA;(add-hook 'buffer-list-update-hook (lambda () (walk-windows #'hl-line-update-face nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What this code is doing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Define a new face &lt;code&gt;hl-line-inactive&lt;/code&gt; to be used in inactive windows. You can use &lt;code&gt;M-x customize-face&lt;/code&gt; to modify the attributes of this face to your taste. &lt;/li&gt;&#xA;&lt;li&gt;Define a function to temporarily remap the highlighting face in inactive windows. A window is considered inactive if it is not displaying the same buffer as the currently selected window.&lt;/li&gt;&#xA;&lt;li&gt;Add a hook to &lt;code&gt;buffer-list-update-hook&lt;/code&gt; that calls &lt;code&gt;hl-line-update-face&lt;/code&gt; for all the visible windows. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Old answer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code above (which I'm using in my own &lt;code&gt;init&lt;/code&gt; file) is much simpler than what I originally posted. Thanks @Drew for the suggestion to use &lt;code&gt;walk-windows&lt;/code&gt;. I also read more about face remapping (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&quot; rel=&quot;nofollow&quot;&gt;Face Remapping&lt;/a&gt; in the Emacs Lisp Manual) and realized I could remove a lot of the code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For posterity, here's what I originally posted:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Define a face for the inactive highlight line.&#xA;(defface hl-line-inactive&#xA;  '((t nil))&#xA;  &quot;Inactive variant of `hl-line'.&quot;&#xA;  :group 'local)&#xA;&#xA;(defun toggle-active-window-highlighting ()&#xA;  &quot;Update the `hl-line' face in any visible buffers to indicate which window is active.&quot;&#xA;  (let ((dups))&#xA;    (mapc&#xA;     (lambda (frame)&#xA;       (mapc&#xA;        (lambda (window)&#xA;          (with-current-buffer (window-buffer window)&#xA;            (when hl-line-mode&#xA;              (make-local-variable 'face-remapping-alist)&#xA;              (let ((inactive (rassoc '(hl-line-inactive) face-remapping-alist)))&#xA;                (if (eq window (selected-window))&#xA;                    (progn&#xA;                      (setq dups (get-buffer-window-list nil nil 'visible))&#xA;                      (setq face-remapping-alist (delq inactive face-remapping-alist)))&#xA;                  (unless (or inactive (memq window dups))&#xA;                    (add-to-list 'face-remapping-alist '(hl-line hl-line-inactive))))))))&#xA;        (window-list frame)))&#xA;     (visible-frame-list))))&#xA;&#xA;(add-hook 'buffer-list-update-hook #'toggle-active-window-highlighting)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-08-13T21:02:05.423" LastActivityDate="2015-08-13T21:02:05.423" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14659" PostTypeId="1" CreationDate="2015-08-11T17:01:20.037" Score="1" ViewCount="683" Body="&lt;p&gt;Say we have a CSV in a buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo,bar,hello&#xA;1,234,95&#xA;8923,901,145&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are there any native Emacs or Markdown-mode built-ins in Emacs that can be used to convert it to a Markdown table? It looks like the syntax is quite different:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Tables        | Are           | Cool  |&#xA;| ------------- |:-------------:| -----:|&#xA;| col 3 is      | right-aligned | $1600 |&#xA;| col 2 is      | centered      |   $12 |&#xA;| zebra stripes | are neat      |    $1 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6" LastActivityDate="2020-03-02T08:11:48.020" Title="CSV to Markdown table" Tags="|elisp-macros|formatting|markdown|csv|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14660" PostTypeId="1" AcceptedAnswerId="14667" CreationDate="2015-08-11T17:36:09.703" Score="1" ViewCount="1777" Body="&lt;p&gt;I have code for defining org capture like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates '(((&#xA;         &quot;t&quot;               ; key&#xA;         &quot;Todo&quot;            ; description&#xA;         entry             ; type&#xA;         (file+headline &quot;C:/Users/myname/Dropbox/Privat/org/abc.org&quot; &quot;todo&quot;); target&#xA;         &quot;* TODO [#B] %^{Todo} \n From: %a\n\n%?&quot;  ; template&#xA;         :prepend t        ; properties&#xA;     )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code sends the generated TODO item into the org file &lt;code&gt;abc.org&lt;/code&gt;, located at &lt;code&gt;C:/Users/myname/Dropbox/Privat/org/&lt;/code&gt;, the target. If I want to change the location of the target to e.g. &lt;code&gt;C:/Users/myname/org/&lt;/code&gt;, I could either do this by changing the path description inside the capture code, or better, define a path variable outside capture, telling where org file is located, and using this inside the target description like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(file+headline &quot;myPathVariable/abc.org&quot; &quot;todo&quot;); target&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;myPathVariable = &quot;C:/Users/myname/org&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I define such a path variable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for all help : )&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="10" LastEditDate="2015-08-11T17:38:32.083" LastActivityDate="2015-08-11T19:39:49.420" Title="Org mode: how to define a path variable to my org file directory?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14661" PostTypeId="2" ParentId="14657" CreationDate="2015-08-11T17:56:20.777" Score="1" Body="&lt;p&gt;Dunno the official answer.  For that you had better ask &lt;strong&gt;&lt;code&gt;emacs-devel@gnu.org&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is no.  Emacs 24.3 will not be updated for ordinary, non-security reasons, at least.  Of that I'm pretty sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But security fixes &lt;em&gt;are&lt;/em&gt; taken very seriously.  Whether they are backported, and if so how far, I don't know.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-11T17:56:20.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14662" PostTypeId="1" CreationDate="2015-08-11T18:36:10.610" Score="1" ViewCount="135" Body="&lt;p&gt;The option &lt;code&gt;org-src-fontify-natively&lt;/code&gt; doesn't care about some multi-line comments. See:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/U8dFv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/U8dFv.png&quot; alt=&quot;org multi-line comments&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;As shown in the picture above, the html comment isn't highlighted correctly. I tried hacking through the code and I see that &lt;code&gt;html-mode&lt;/code&gt; seems use to the function &lt;code&gt;syntax-propertize-rules&lt;/code&gt; to propertize the comment, while &lt;code&gt;c-mode&lt;/code&gt; seems to use only the syntax-table. I think this is so because the syntax-table can't handle the &lt;code&gt;&amp;lt;!--&lt;/code&gt; kind of comment.&lt;/p&gt;&#xA;&lt;p&gt;So how can I customize &lt;code&gt;html-mode&lt;/code&gt; to make the comments highlighted by &lt;code&gt;org-mode&lt;/code&gt;, or customize &lt;code&gt;orb-mode&lt;/code&gt; to not ignore them?&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-14T14:04:03.573" Title="org src fontify won't highlight some multiline comments" Tags="|org-mode|org-babel|faces|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14663" PostTypeId="2" ParentId="14627" CreationDate="2015-08-11T18:40:39.530" Score="3" Body="&lt;p&gt;Yes, it is the best format (for speed consideration).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-11T18:40:39.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14664" PostTypeId="2" ParentId="14620" CreationDate="2015-08-11T19:09:51.060" Score="2" Body="&lt;p&gt;Here's something that seems to do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/multy-key-replace (keys target)&#xA;  (interactive &quot;fFile to read the keys from: &#xA;fFile to replace: &quot;)&#xA;  (let ((repbuffer (get-buffer-create &quot;*Replacements*&quot;)))&#xA;    (with-temp-buffer&#xA;      (insert-file-contents keys)&#xA;      (let ((replacements (make-hash-table :test 'equal)))&#xA;        (while (re-search-forward &quot;^\\([^ ]+\\) \\([^ ]+\\)$&quot; nil t)&#xA;          (setf (gethash (match-string 1) replacements)&#xA;                (match-string 2)))&#xA;        (with-current-buffer repbuffer&#xA;          (erase-buffer)&#xA;          (insert-file-contents target)&#xA;          (maphash&#xA;           (lambda (key value)&#xA;             (goto-char (point-min))&#xA;             (replace-string key (format &quot;%s/%s&quot; key value)))&#xA;           replacements))))&#xA;    (pop-to-buffer repbuffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-08-11T19:09:51.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14665" PostTypeId="2" ParentId="14657" CreationDate="2015-08-11T19:16:38.113" Score="2" Body="&lt;p&gt;I don't think that Emacs has any policy or process for these situations, considering how messy and arbitrary it's versioning is.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that does not matter, because the &lt;em&gt;OS vendor&lt;/em&gt; guarantees updates for the particular version of Emacs it includes in its repositories. If there's a security issue the OS vendor will take care of patching this Emacs version even if Emacs itself does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, you can always build your own Emacs manually.  Compiling Emacs is not hard.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-08-11T19:16:38.113" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14666" PostTypeId="2" ParentId="14634" CreationDate="2015-08-11T19:35:52.290" Score="1" Body="&lt;p&gt;Solved. Looks like the relevant attribute I was looking for was &lt;code&gt;arglist-cont-nonempty&lt;/code&gt;. Added this to my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; adjust open list indentation&#xA;(add-hook 'java-mode-hook&#xA;          (lambda ()&#xA;            (c-set-offset 'arglist-cont-nonempty 8)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9157" LastActivityDate="2015-08-11T19:35:52.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14667" PostTypeId="2" ParentId="14660" CreationDate="2015-08-11T19:39:49.420" Score="4" Body="&lt;p&gt;Are you already familar with the built-in &lt;code&gt;org-directory&lt;/code&gt; variable?&#xA;This is the default directory for org files, and will be used as the&#xA;base directory for capture templates that specify a relative path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could just use &lt;code&gt;(file+headline &quot;abc.org&quot; &quot;todo&quot;)&lt;/code&gt; and set&#xA;&lt;code&gt;org-directory&lt;/code&gt; as appropriate.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-08-11T19:39:49.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14668" PostTypeId="1" CreationDate="2015-08-11T19:50:13.977" Score="2" ViewCount="134" Body="&lt;p&gt;I'm using a lot of artist-mode at the moment but I find cancelling the current op very fiddly. Apparently when drawing a polyline you can use mouse-3 but this isn't very helpful when you just have keys. What's the correct way to finish the current drawing operation?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2015-08-11T19:50:13.977" Title="How do I finish a line in artist-mode without a mouse?" Tags="|artist-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14669" PostTypeId="1" AcceptedAnswerId="14672" CreationDate="2015-08-11T20:06:02.250" Score="3" ViewCount="212" Body="&lt;p&gt;Every time when I call &lt;code&gt;M-x projectile-regenate-tags&lt;/code&gt; I get bothered with the message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tags file a:/foobar/TAGS has changed, read new contents? (y or n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is quite cumbersome. Especially when I wanted to add the command to a &lt;code&gt;after-save-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I was thinking about a defadvice, or command to press y in the minbuffer that I could do in a function same with &lt;code&gt;(projectile-regenate-tags)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea in order to do so? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-08-11T20:53:47.473" LastActivityDate="2016-08-18T07:29:11.883" Title="Sort of autoreply for specific messages in minibuffer" Tags="|functions|advice|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14670" PostTypeId="1" AcceptedAnswerId="14675" CreationDate="2015-08-11T20:53:12.983" Score="3" ViewCount="908" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL&#xA;&lt;a href=&quot;https://bitbucket.org/Haroogan/emacs-for-windows/&quot; rel=&quot;nofollow&quot;&gt;Compiled from Harroogan Emacs.&lt;/a&gt;&#xA;Windows 7 x64 bit.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.emacswiki.org/emacs/SavePlace&quot; rel=&quot;nofollow&quot;&gt;package saveplace&lt;/a&gt; remembers where your cursor/point was when you leaves the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you visit the same file again, the point goes to the last place where it was when you previously visited the same file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After upgrading to Emacs 25.0.50, I couldn't get it working. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Reproduce:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The empty dot-emacs configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Emacs.el&#xA;(require 'package)&#xA;(package-initialize)&#xA;(require 'saveplace)&#xA;(setq-default save-place t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I start the Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I open a file, edit somewhere, save it while the point is still on that place. Then I close Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And start Emacs again. Open same file again, but the cursor is on row 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With minimal configuration, I couldn't it get working.&#xA;This happened after upgrading from Emacs 24.5 to Emacs 25.0.5 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my first assumption is saveplace seems to be broken on Emacs 25. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2015-08-11T21:25:43.757" LastActivityDate="2015-08-12T04:04:42.747" Title="Saveplace (remembers your cursor position) not working anymore with Emacs 25?" Tags="|saveplace|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14672" PostTypeId="2" ParentId="14669" CreationDate="2015-08-11T21:02:38.133" Score="6" Body="&lt;p&gt;The &lt;code&gt;tags-revert-without-query&lt;/code&gt; variable is the generic mechanism for skipping this prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check whether setting that directly circumvents the problem. If so, you could &lt;code&gt;let&lt;/code&gt;-bind it in a wrapper around the function you're calling to get that behaviour for this scenario only.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-08-11T21:02:38.133" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14673" PostTypeId="1" AcceptedAnswerId="17937" CreationDate="2015-08-11T21:31:51.433" Score="9" ViewCount="2077" Body="&lt;p&gt;I need to generate text files with the following name format:&#xA;&lt;code&gt;YYYYY-MM-DD--hh-mm-ss.org&lt;/code&gt;. How can I use the capture funtionality for this? That is, instead of making one entry per capture in a single file, the function should make one single file per capture, and hopefully with all the possibilities within the capture mechanism.&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="253" LastEditDate="2015-11-07T23:35:14.487" LastActivityDate="2015-11-09T15:29:24.517" Title="Emacs: function to make a file with date/time as filename, and a shortcut for it" Tags="|org-mode|org-capture|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14675" PostTypeId="2" ParentId="14670" CreationDate="2015-08-12T03:32:13.453" Score="8" Body="&lt;p&gt;&lt;code&gt;save-place&lt;/code&gt; is now controlled by &lt;code&gt;save-place-mode&lt;/code&gt;:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;save-place-mode&lt;/code&gt; is an interactive autoloaded compiled Lisp function in&#xA;  &lt;code&gt;saveplace.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-place-mode &amp;amp;optional ARG)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Non-nil means automatically save place in each file. This means when you visit a file, point goes to the last place where it was when you previously visited the same file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As opposed to:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;save-place&lt;/code&gt; is a variable defined in ‘saveplace.el’. Its value is t&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Automatically becomes buffer-local when set.&lt;/li&gt;&#xA;  &lt;li&gt;This variable is an alias for &lt;code&gt;save-place-mode&lt;/code&gt;.&lt;/li&gt;&#xA;  &lt;li&gt;&lt;strong&gt;This variable is obsolete since 25.1;&lt;/strong&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;strong&gt;use &lt;code&gt;save-place-mode&lt;/code&gt; instead.&lt;/strong&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Non-nil if Save-Place mode is enabled.&#xA;  See the command &lt;code&gt;save-place-mode&lt;/code&gt; for a description of this minor mode.&#xA;  Setting this variable directly does not take effect;&#xA;  either customize it (see the info node &lt;code&gt;Easy Customization&lt;/code&gt;)&#xA;  or call the function &lt;code&gt;save-place-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I use this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (fboundp #'save-place-mode)&#xA;  (save-place-mode +1)&#xA;  (setq-default save-place t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-12T04:04:42.747" LastActivityDate="2015-08-12T04:04:42.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14676" PostTypeId="2" ParentId="14669" CreationDate="2015-08-12T03:47:36.503" Score="1" Body="&lt;p&gt;Here's a way to do that generically for any function (even if it has no convenient variable)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun y-or-n-p-test ()&#xA;  (message (if (y-or-n-p &quot;is this true?&quot;)&#xA;             &quot;yes!&quot;&#xA;             &quot;no!&quot;)))&#xA;&#xA;(defun auto-yes (old-fun &amp;amp;rest args)&#xA;  (cl-letf (((symbol-function 'y-or-n-p) (lambda (prompt) t))&#xA;             ((symbol-function 'yes-or-no-p) (lambda (prompt) t)))&#xA;    (apply old-fun args)))&#xA;&#xA;(defun auto-no (old-fun &amp;amp;rest args)&#xA;  (cl-letf (((symbol-function 'y-or-n-p) (lambda (prompt) nil))&#xA;             ((symbol-function 'yes-or-no-p) (lambda (prompt) nil)))&#xA;    (apply old-fun args)))&#xA;&#xA;(advice-add #'y-or-n-p-test :around #'auto-yes)&#xA;&#xA;;; just testing&#xA;(y-or-n-p-test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-08-16T15:06:21.433" LastActivityDate="2016-08-16T15:06:21.433" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14677" PostTypeId="1" AcceptedAnswerId="14709" CreationDate="2015-08-12T04:25:46.757" Score="4" ViewCount="1896" Body="&lt;p&gt;I'm just getting started with mu4e after using Gnus for about a year. The sending of mail seems similar between the two, but mu4e hangs when I try to send mail and finally fails with the error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;network-stream-open-starttls: Failed connect: connection timed out&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my .emacs.d:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; * mu4e&#xA;(require 'mu4e)&#xA;(setq mail-user-agent 'mu4e-user-agent)&#xA;&#xA;(setq mu4e-maildir &quot;/home/steven/mail/&quot;)&#xA;&#xA;(setq mu4e-sent-folder   &quot;/sent&quot;)&#xA;(setq mu4e-drafts-folder &quot;/drafts&quot;)&#xA;(setq mu4e-trash-folder  &quot;/trash&quot;)&#xA;&#xA;(setq   mu4e-maildir-shortcuts&#xA;'((&quot;/archive&quot;     . ?a)&#xA;  (&quot;/inbox&quot;       . ?i)&#xA;  (&quot;/sent&quot;        . ?s)))&#xA;&#xA;;; smtp mail settings&#xA;(setq message-send-mail-function 'smtpmail-send-it)&#xA;(setq smtpmail-smtp-server &quot;example.server.com&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there anything here that would foul sending a message? If not, where might I look next for the cause of this behavior, or what experiment might I run to deduce the problem?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-08-12T17:48:03.623" LastActivityDate="2015-08-13T09:24:47.583" Title="mu4e hangs on sending mail" Tags="|mu4e|smtpmail|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14678" PostTypeId="2" ParentId="3421" CreationDate="2015-08-12T04:31:48.833" Score="2" Body="&lt;p&gt;A minimimal but often helpful possibility - when you just want to peek the other function - is setting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq scroll-preserve-screen-position t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which brings you back to your exact starting cursor position when switching between &lt;kbd&gt;C-v&lt;/kbd&gt; and &lt;kbd&gt;M-v&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-08-12T04:37:00.900" LastActivityDate="2015-08-12T04:37:00.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14680" PostTypeId="2" ParentId="14652" CreationDate="2015-08-12T05:39:36.083" Score="13" Body="&lt;p&gt;I can only suggest a solution for &lt;code&gt;gnus&lt;/code&gt; and &lt;code&gt;dired&lt;/code&gt; but it is at least easier as &lt;strong&gt;lawlist&lt;/strong&gt; suggested. Open the directory in &lt;code&gt;dired&lt;/code&gt; with &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;4&lt;/kbd&gt; &lt;kbd&gt;d&lt;/kbd&gt; and type &lt;code&gt;M-x turn-on-gnus-dired-mode&lt;/code&gt;. Then mark the required files and type &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;C-a&lt;/kbd&gt;. That's it and the files can be attached to an already opened or a new message buffer (I'm not sure if this works for other MUAs as well)!&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-08-12T15:49:04.260" LastActivityDate="2015-08-12T15:49:04.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14681" PostTypeId="1" CreationDate="2015-08-12T07:18:42.003" Score="29" ViewCount="6486" Body="&lt;p&gt;recently I am using table to do some statistics, and I want the first column of the table to indicate the row number, as this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   |  | title|&#xA;   |--| -----|&#xA;   | 1| A    |&#xA;   | 2| B    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want the number of first column grow automatically after creating a new row. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there good suggestions about it?&lt;/p&gt;&#xA;" OwnerUserId="8691" LastActivityDate="2015-09-15T22:02:56.853" Title="org mode table row number grow automatically?" Tags="|org-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14682" PostTypeId="1" CreationDate="2015-08-12T09:31:12.013" Score="2" ViewCount="2141" Body="&lt;p&gt;I use the following script to install Emacs 25 on Ubuntu, &#xA;&lt;code&gt;&#xA;sudo add-apt-repository -y ppa:ubuntu-elisp&#xA;sudo apt-get update&#xA;sudo apt-get install emacs-snapshot&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start the &lt;code&gt;emacs-snapshot&lt;/code&gt; program I get this error message &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;Debugger entered--Lisp error: (void-variable seq)&#xA;  byte-code(&quot;\302\303\304\305#\210\302\303\306\307#\210\310\311!\2037&#xA;  require(seq)&#xA;  byte-code(&quot;\300\301!\210\300\302!\207&quot; [require cl-lib seq] 2)&#xA;  require(cl-extra)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows the &lt;code&gt;seq&lt;/code&gt; package is missing, but I can't find it using the &lt;code&gt;package-list-packages&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to fix this or is there another way to install Emacs 25 on Ubuntu? &lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="9121" LastEditDate="2015-08-13T00:40:34.813" LastActivityDate="2015-08-13T00:40:34.813" Title="emacs-snapshot - seq package missing" Tags="|package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14683" PostTypeId="2" ParentId="14682" CreationDate="2015-08-12T10:59:26.097" Score="8" Body="&lt;p&gt;Looks like you've written&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require seq)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'seq)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-08-12T10:59:26.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14684" PostTypeId="1" AcceptedAnswerId="14800" CreationDate="2015-08-12T11:19:33.750" Score="6" ViewCount="1793" Body="&lt;p&gt;I am planning to insert screenshot in org-capture buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a function that can create a screenshot image in a &lt;code&gt;images&lt;/code&gt; subdirectory of current directory. However, since the org-capture buffer is an indirect buffer, the &lt;code&gt;buffer-file-name&lt;/code&gt; result is nil, it can not create the subdirectory directly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I get the original buffer path in org-template, save the screenshot in the &lt;code&gt;images&lt;/code&gt;, and insert it to the org-capture buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, I can just finalize the org-capture buffer, go to the save place, and call screenshot function there. But it is kind of cumbersome, which i do not like very much. Please give me some hint if you have some idea. Thanks very much.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastActivityDate="2015-08-17T08:00:01.137" Title="Capturing screenshot in org-capture buffer" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14685" PostTypeId="1" AcceptedAnswerId="14686" CreationDate="2015-08-12T12:23:20.927" Score="0" ViewCount="1172" Body="&lt;p&gt;With the package &lt;code&gt;projectile&lt;/code&gt;, I use &lt;code&gt;projectile-regenate-tags&lt;/code&gt;. At the name already says, it regenates the TAGS-table of the current project on the project root.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works likke a charm. However, I noticed not all files are included, the files with &lt;code&gt;.inc&lt;/code&gt;-extension. I would make it so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good command for this could be the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ctags -f TAGS -e -R --langmap=php:+.inc.foo.bar --list-maps=php&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like that &lt;code&gt;projectile-regenate-tags&lt;/code&gt; use these parameters. When looking up the source code of &lt;code&gt;projectile-regenate-tags&lt;/code&gt;, I found the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-regenerate-tags ()&#xA;&quot;Regenerate the project's [e|g]tags.&quot;&#xA;(interactive)&#xA;(if (boundp 'ggtags-mode)&#xA;    (progn&#xA;        (let* ((ggtags-project-root (projectile-project-root))&#xA;            (default-directory ggtags-project-root))&#xA;        (ggtags-ensure-project)&#xA;        (ggtags-update-tags t)))&#xA;    (let* ((project-root (projectile-project-root))&#xA;        (tags-exclude (projectile-tags-exclude-patterns))&#xA;        (default-directory project-root)&#xA;        (tags-file (expand-file-name projectile-tags-file-name))&#xA;        (command (format projectile-tags-command tags-file tags-exclude))&#xA;        shell-output exit-code)&#xA;    (with-temp-buffer&#xA;        (setq exit-code&#xA;            (call-process-shell-command command nil (current-buffer))&#xA;            shell-output (projectile-trim-string&#xA;                            (buffer-substring (point-min) (point-max)))))&#xA;    (unless (zerop exit-code)&#xA;        (error shell-output))&#xA;    (visit-tags-table tags-file))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Aha, then look up what &lt;code&gt;projectile-tags-command&lt;/code&gt; consists of. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom projectile-tags-command &quot;ctags -Re -f \&quot;%s\&quot; %s&quot;&#xA;&quot;The command Projectile's going to use to generate a TAGS file.&quot;&#xA;:group 'projectile&#xA;:type 'string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So in my &lt;code&gt;init.el&lt;/code&gt;, I setted the variable &lt;code&gt;projectile-tags-command&lt;/code&gt; to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-tags-command &quot;ctags -Re -f \&quot;%s\&quot; %s --langmap=php:+.inc.foo.bar --list-maps=php&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluated it, and calling &lt;code&gt;projectile-regenate-tags&lt;/code&gt;, I still don't get any relevant files with the extension &lt;code&gt;.inc&lt;/code&gt;.&#xA;I still don`t get any relevant files. So perhaps I'm wrong somehwere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any good suggestion?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-08-12T13:08:06.933" Title="How pass arguments for ctags / projectile-regenate-tags?" Tags="|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14686" PostTypeId="2" ParentId="14685" CreationDate="2015-08-12T12:57:18.453" Score="1" Body="&lt;p&gt;You only want &lt;code&gt;--langmap=php:+.inc&lt;/code&gt; and without the &lt;code&gt;--list-maps=php&lt;/code&gt; argument. &lt;a href=&quot;https://stackoverflow.com/a/31953773/324105&quot;&gt;That example&lt;/a&gt; (which I've just updated for maximum clarity) was just to show the effect of the &lt;code&gt;--langmap&lt;/code&gt; argument, and wouldn't actually &lt;em&gt;generate&lt;/em&gt; a TAGS file.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-08-12T13:08:06.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14687" PostTypeId="1" CreationDate="2015-08-12T14:03:48.293" Score="6" ViewCount="561" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: how can I automate inbox zero with my &lt;code&gt;org-mode&lt;/code&gt; agenda by getting linked, deadlined reminders to emails that need a reply?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get a lot of email, and try to stay at&#xA;&lt;a href=&quot;http://whatis.techtarget.com/definition/inbox-zero&quot; rel=&quot;noreferrer&quot;&gt;inbox zero&lt;/a&gt;, but I don't always want to reply to an email&#xA;immediately upon reading it.  I do, however, want to remind myself&#xA;that I need to reply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping to automate this recurring use pattern, described here in excruciating detail:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;open up inbox (using &lt;code&gt;mu4e&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;mark an email for reply with &lt;code&gt;org-store-link&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;refile that message to All Mail (or wherever; it's a gmail account)&lt;/li&gt;&#xA;&lt;li&gt;go to my main agenda file (call it &lt;code&gt;agenda.org&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;go to the &lt;code&gt;* EMAIL&lt;/code&gt; section&lt;/li&gt;&#xA;&lt;li&gt;use &lt;code&gt;org-insert-link&lt;/code&gt; to create a new entry &lt;code&gt;** Respond to XXXX&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;set a deadline for later in the day (or tomorrow, or whenever)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The end product is a series of entries in the &lt;code&gt;EMAIL&lt;/code&gt; section,&#xA;each linked to a specific email that needs a reply, and each with&#xA;a defined deadline so that it will show up in my agenda view to&#xA;remind me.  I'm just not sure how to automate the whole thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Does something like this already exist and I just don't know about&#xA;it?  If not, how would one implement it?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I'm loosely aware of&#xA;&lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e/Actions.html#Actions&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;mu4e&lt;/code&gt; actions&lt;/a&gt;,&#xA;which I expect would be the starting point, but it's also&#xA;package-specific and wouldn't apply to, say, &lt;code&gt;gnus&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-12T18:38:59.223" Title="Automating inbox zero with the org agenda?" Tags="|org-mode|email|mu4e|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14688" PostTypeId="1" AcceptedAnswerId="17303" CreationDate="2015-08-12T14:23:04.737" Score="6" ViewCount="2745" Body="&lt;p&gt;I'm trying to figure out how to insert a resize command inside a table environment in org-mode that exports to latex,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my minimal example of raw latex source vs org-mode tables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_CLASS: article&#xA;#+LATEX_HEADER: \usepackage{graphicx}&#xA;&#xA;&#xA;#+begin_src latex :exports results :results latex&#xA;\begin{table}&#xA;  \caption{a table that scales to the linewidth}&#xA;  \centering&#xA;  \resizebox{\linewidth}{!}{%&#xA;  \begin{tabular}{ll}&#xA;    A &amp;amp; 1\\&#xA;    B &amp;amp; 2\\&#xA;  \end{tabular}}&#xA;  \label{tab:scaled}&#xA;\end{table}&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make org-mode tables with a &lt;code&gt;\resizebox{\linewidth}{!}{% }&lt;/code&gt; command so that the same result is achieved for the table below? (Or alternatively something else that gives the same result).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_CLASS: article&#xA;#+LATEX_HEADER: \usepackage{graphicx}&#xA;#+CAPTION: a table that does not scale to the linewidth&#xA;#+LABEL: tab:uncaled&#xA;| A | 1 |&#xA;| B | 2 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My attempt based on the &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot; rel=&quot;noreferrer&quot;&gt;LaTeX-specific-attributes&lt;/a&gt; from org-mode manual&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_CLASS: article&#xA;#+LATEX_HEADER: \usepackage{graphicx}&#xA;#+CAPTION: a table that does not scale to the linewidth&#xA;#+ATTR_LATEX: :math-prefix \resizebox{\linewidth}{!}{% :math-suffix }&#xA;| A | 1 |&#xA;| B | 2 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However the things I've tried has not worked. In the answer provided to the question on &lt;a href=&quot;https://tex.stackexchange.com/questions/163246/resize-a-tabular-object-to-textwidth&quot;&gt;tex.stackechange&lt;/a&gt; another alternative is presented, which requires insertion of another environment between table and tabular. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_CLASS: article&#xA;#+LATEX_HEADER: \usepackage{graphicx}&#xA;#+LATEX_HEADER: \usepackage{adjustbox}    &#xA;#+begin_src latex :exports results :results latex&#xA;\begin{table}&#xA;  \caption{a table that scales to the linewidth}&#xA;  \centering&#xA;  \begin{adjustbox}{width=\textwidth}&#xA;    \begin{tabular}{ll}&#xA;      A &amp;amp; 1\\&#xA;      B &amp;amp; 2\\&#xA;    \end{tabular}&#xA;  \end{adjustbox}&#xA;  \label{tab:scaled}&#xA;\end{table}&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2015-08-12T22:42:32.450" LastActivityDate="2021-05-04T12:39:12.960" Title="How do I insert resizebox code in org-mode tables when exporting to latex?" Tags="|org-mode|latex|org-export|org-table|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14689" PostTypeId="1" AcceptedAnswerId="14691" CreationDate="2015-08-12T14:32:59.663" Score="2" ViewCount="4526" Body="&lt;p&gt;Recently, I have tried setting up a JS development environment and part of that process has been configuring company-mode for autocompletion duties - but I'm having some issues triggering auto completion. First - here's the file I use to configure company mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package yasnippet&#xA;  :ensure t&#xA;  :diminish yas-minor-mode&#xA;  :config&#xA;  (setq yas-snippet-dirs (append yas-snippet-dirs&#xA;                                 '(&quot;~/.emacs.d/snippets/&quot;)))&#xA;  (yas-global-mode 1))&#xA;&#xA;&#xA;(use-package company&#xA;  :ensure t&#xA;  :diminish company-mode&#xA;  :config&#xA;  (add-to-list 'company-backends 'company-elisp)&#xA;  (add-to-list 'company-backends 'company-yasnippet)&#xA;  (add-to-list 'company-backends 'company-dabbrev)&#xA;  (add-to-list 'company-backends 'company-dabbrev-code)&#xA;  (add-to-list 'company-backends 'company-etags)&#xA;  (setq company-auto-complete nil&#xA;        company-tooltip-flip-when-above t&#xA;        company-minimum-prefix-length 2&#xA;        company-tooltip-limit 10&#xA;        company-idle-delay 0.5)&#xA;  (global-company-mode 1))&#xA;;;  (add-hook 'prog-mode-hook 'company-mode))&#xA;&#xA;(use-package helm-company&#xA;  :ensure t&#xA;  :config&#xA;  (progn&#xA;    (define-key company-mode-map (kbd &quot;C-:&quot;) 'helm-company)&#xA;    (define-key company-active-map (kbd &quot;C-:&quot;) 'helm-company)))&#xA;&#xA;(use-package company-tern&#xA;  :ensure t&#xA;  :init&#xA;  (add-to-list 'company-backends 'company-tern))&#xA;&#xA;&#xA;(use-package tern&#xA;  :ensure t&#xA;  :defer t&#xA;  :diminish tern-mode&#xA;  :config&#xA;  (progn&#xA;    (add-hook 'js2-mode-hook 'tern-mode)))&#xA;&#xA;(provide 'init-autocompletion)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, let's say I'm working in a...Coffeescript file - and it has something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo = &#xA;  addTwo: (a) -&amp;gt;&#xA;    a + 2&#xA;  addThree: (a) -&amp;gt;&#xA;    a + 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then later on in that file I start typing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo.a...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would hope that company would kick in and offer addTwo/Three as candidates - but I got nada!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran company-diag - and I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs 24.5.1 (x86_64-apple-darwin14.4.0) of 2015-07-13 on MFT-A018.local&#xA;Company 0.9.0-cvs&#xA;&#xA;company-backends: (company-tern company-etags company-dabbrev-code company-yasnippet company-elisp company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf&#xA;              (company-dabbrev-code company-gtags company-etags company-keywords)&#xA;              company-oddmuse company-files company-dabbrev)&#xA;&#xA;Used backend: company-etag&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and a whole bunch of completion candidates - none of which are foo.addTwo/Three&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can anyone offer any advice on how to get company-mode working?&lt;/p&gt;&#xA;" OwnerUserId="8990" LastActivityDate="2015-08-12T22:04:07.800" Title="company mode does not start backends?" Tags="|company-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14690" PostTypeId="2" ParentId="14514" CreationDate="2015-08-12T15:43:11.263" Score="20" Body="&lt;p&gt;Open the directory in &lt;code&gt;dired&lt;/code&gt; with &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;4&lt;/kbd&gt; &lt;kbd&gt;d&lt;/kbd&gt; and type &lt;code&gt;M-x turn-on-gnus-dired-mode&lt;/code&gt;. Then mark the required files with &lt;kbd&gt;m&lt;/kbd&gt; (or whatever) and type &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;C-a&lt;/kbd&gt;. The files can now be attached to an already opened message buffer or assigned to a new one.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2015-08-12T15:43:11.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14691" PostTypeId="2" ParentId="14689" CreationDate="2015-08-12T17:32:25.183" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;company-backends&lt;/code&gt; is a variable defined in &lt;code&gt;company.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  The list of active back-ends (completion engines).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Only one back-end is used at a time.&lt;/strong&gt;  The choice depends on the order of&#xA;  the items in this list, and on the values they return in response to the&#xA;  ‘prefix’ command (see below).  &lt;strong&gt;But a back-end can also be a &quot;grouped&quot;&#xA;  one (see below).&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Grouped back-ends:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;An element of &lt;code&gt;company-backends&lt;/code&gt; can also itself be a list of back-ends,&#xA;  then it's considered to be a &quot;grouped&quot; back-end.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When possible, commands taking a candidate as an argument are dispatched to&#xA;  the back-end it came from.  In other cases, the first non-nil value among&#xA;  all the back-ends is returned.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The latter is the case for the &lt;code&gt;prefix&lt;/code&gt; command.  But if the group contains&#xA;  the keyword &lt;code&gt;:with&lt;/code&gt;, the back-ends after it are ignored for this command.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The completions from back-ends in a group are merged (but only from those&#xA;  that return the same &lt;code&gt;prefix&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Tl;DR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason, &lt;code&gt;company-etags&lt;/code&gt; thinks it's handling completion for the current buffer. Since it comes earlier in the list than &lt;code&gt;company-dabbrev-code&lt;/code&gt;, it gets priority.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to handle this is to use mode-hooks to force the backend list to match what you'd like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way is to throw a set of backends into a group. Members of a group do not block each other, so as long as &lt;code&gt;company-dabbrev-code&lt;/code&gt; is in the first group it will always be active. This has its drawbacks too (performance, for example), and you will have to weigh between the two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use a sort of hybrid combination of the two. Unfortunately, my setup uses a lot of macro magic so it doesn't really make sense on its own. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Here's a solution for CoffeeScript:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'coffee-mode&#xA;  (lambda ()&#xA;    (setq company-backends '(company-dabbrev-code))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-12T22:04:07.800" LastActivityDate="2015-08-12T22:04:07.800" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14692" PostTypeId="2" ParentId="14687" CreationDate="2015-08-12T18:38:59.223" Score="5" Body="&lt;p&gt;Turns out that it's pretty straightforward to put this function together, although there's a bunch of housekeeping to keep the buffers tidy.  The following command words with &lt;code&gt;mu4e&lt;/code&gt; in both its &lt;code&gt;headers&lt;/code&gt; and &lt;code&gt;view&lt;/code&gt; modes.  It's minimally tested at this point, but seems to be working in the main.  Note that it hard codes a few things such as the section heading and the specific file.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mu4e-msg-to-agenda (arg)&#xA;  &quot;Refile a message and add a entry in the agenda file with a&#xA;deadline.  Default deadline is today.  With one prefix, deadline&#xA;is tomorrow.  With two prefixes, select the deadline.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((file (car org-agenda-files))&#xA;        (sec  &quot;^* EMAIL\\s-*$&quot;)&#xA;        (msg  (mu4e-message-at-point)))&#xA;    (when msg&#xA;      ;; put the message in the agenda&#xA;      (with-current-buffer (find-file-noselect file)&#xA;        (save-excursion&#xA;          ;; find header section&#xA;          (goto-char (point-min))&#xA;          (when (re-search-forward sec nil t)&#xA;            (let ((org-M-RET-may-split-line)&#xA;                  (lev (org-outline-level))&#xA;                  (folded-p (invisible-p (point-at-eol))))&#xA;              ;; place the subheader&#xA;              (when folded-p (show-branches))    ; unfold if necessary&#xA;              (org-end-of-meta-data-and-drawers) ; skip property drawer&#xA;              (org-insert-todo-heading 1)        ; insert a todo heading&#xA;              (when (= (org-outline-level) lev)  ; demote if necessary&#xA;                (org-do-demote))&#xA;              ;; insert message and add deadline&#xA;              (insert (concat &quot;respond to &quot;&#xA;                              &quot;[[mu4e:msgid:&quot;&#xA;                              (plist-get msg :message-id) &quot;][&quot;&#xA;                              (caar (plist-get msg :from)) &quot;]] &quot;))&#xA;              (org-deadline nil&#xA;                            (cond ((= arg 1) (format-time-string &quot;%Y-%m-%d&quot;))&#xA;                                  ((= arg 4) &quot;+1d&quot;)))&#xA;              ;; refold as necessary&#xA;              (if folded-p&#xA;                  (progn&#xA;                    (org-up-heading-safe)&#xA;                    (hide-subtree))&#xA;                (hide-entry))))))&#xA;      ;; refile the message and update&#xA;      (cond ((eq major-mode 'mu4e-view-mode)&#xA;             (mu4e-view-mark-for-refile))&#xA;            ((eq major-mode 'mu4e-headers-mode)&#xA;             (mu4e-headers-mark-for-refile)))&#xA;      (message &quot;Refiled and added to the agenda for %s&quot;&#xA;               (cond ((= arg 1) &quot;today&quot;)&#xA;                     ((= arg 4) &quot;tomorrow&quot;)&#xA;                     (t         &quot;later&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-12T18:38:59.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14693" PostTypeId="1" CreationDate="2015-08-12T19:14:29.330" Score="2" ViewCount="677" Body="&lt;p&gt;In Evil mode, in the Normal state, with the &lt;code&gt;evil-search-module&lt;/code&gt; variable set to &lt;code&gt;Evil interactive search&lt;/code&gt;, I would like to use some kind of auto-completion functionality like &lt;code&gt;Ctrl+n&lt;/code&gt; or &lt;code&gt;Ctrl+p&lt;/code&gt; so that I don't have to type the full string I am searching for. For example, if I wanted to turn the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo bar grue&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo bar zork&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Type &lt;code&gt;:s/g&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;Ctrl+n&lt;/code&gt; (or some other concise key/combo).&lt;/li&gt;&#xA;&lt;li&gt;See the command prompt change to &lt;code&gt;:s/grue&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;/zork&amp;lt;RET&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The steps I've given above fail at step 2. At that point, instead of using the next match, Evil outputs the error message, &quot;No later matching history item&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried using the suggestions given as answers &lt;a href=&quot;https://stackoverflow.com/q/19730567/82216&quot;&gt;here&lt;/a&gt;, but these do not work either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Hitting &lt;code&gt;Ctrl+f&lt;/code&gt; while in the middle of entering a substitution command simply causes Emacs to output the message &quot;End of buffer&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;code&gt;q:is/g&amp;lt;Ctrl+n&amp;gt;&lt;/code&gt; causes Emacs to output the error message &quot;No dynamic expansion for `s/g' found&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What can I do to overcome or work around this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update: see &lt;a href=&quot;https://bitbucket.org/lyro/evil/issues/166/some-key-bindings-are-missing-in-command#comment-20876335&quot; rel=&quot;nofollow noreferrer&quot;&gt;Evil bug #166&lt;/a&gt;, which refers to this issue.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user8341" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-08-21T14:53:10.470" Title="Search/substition completion in Evil mode" Tags="|evil|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14694" PostTypeId="2" ParentId="14312" CreationDate="2015-08-12T19:32:18.957" Score="0" Body="&lt;p&gt;I figured out what I wasn't doing. So to save my source code I have to create a file via C-x C-f and then input the source code into that buffer. Then when I come back to emacs I can  open the file and edit the code. At least this worked for me. Thanks for the input. &lt;/p&gt;&#xA;" OwnerUserId="9035" LastActivityDate="2015-08-12T19:32:18.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14695" PostTypeId="1" AcceptedAnswerId="14696" CreationDate="2015-08-12T20:18:53.757" Score="3" ViewCount="261" Body="&lt;p&gt;I am analysing text with respect to its argument structure (conclusion supported by reasons, each supported by evidence). During this analysis it would have been very usefull to have each sentence numbered, for easy reference. Hence, I need a function that EITHER inserts an number at the start of each sentence, with the number surrounded by brackets or symbols clearly distinguishing it from the rest of the text, OR insert the sentence number(s) for each text line in the margin of the text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea of how I could number the sentences in a text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any suggestions or tips!&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="105" LastEditDate="2015-08-12T21:38:52.880" LastActivityDate="2015-08-13T13:27:15.360" Title="How can Emacs number the sentences in a text?" Tags="|sentences|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14696" PostTypeId="2" ParentId="14695" CreationDate="2015-08-12T21:33:54.563" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Know that you can move forward and backward over sentences using &lt;code&gt;M-e&lt;/code&gt; and &lt;code&gt;M-a&lt;/code&gt;. And there are other sentence operations. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Sentences.html&quot; rel=&quot;nofollow&quot;&gt;Sentences&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can write a command that inserts increasing numbers before sentences. Iterate over the text using function &lt;code&gt;backward-sentence&lt;/code&gt;, starting at the end of the buffer. For example:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun foo-backward (beg end)&#xA;      &quot;Number sentences in buffer or active region, from end, starting with 1.&quot;&#xA;      (interactive (if (use-region-p)&#xA;                       (list (region-beginning) (region-end))&#xA;                     (list (point-min) (point-max))))&#xA;      (let ((ii  0)&#xA;            ins)&#xA;        (save-excursion&#xA;          (goto-char end)&#xA;          (while (&amp;gt; (point) beg)&#xA;            (backward-sentence)&#xA;            (insert (setq ins  (format &quot;[%d] &quot; (setq ii  (1+ ii)))))&#xA;            (search-backward ins nil t)))))&#xA;&#xA;    (defun foo-forward (beg end)&#xA;      &quot;Number sentences in buffer or active region, starting with 1.&quot;&#xA;      (interactive (if (use-region-p)&#xA;                       (list (region-beginning) (region-end))&#xA;                     (list (point-min) (point-max))))&#xA;      (let ((ii  0)&#xA;            ins)&#xA;        (save-excursion&#xA;          (goto-char beg)&#xA;          (while (&amp;lt; (point) end)&#xA;            (forward-sentence)&#xA;            (backward-sentence)&#xA;            (insert (setq ins  (format &quot;[%d] &quot; (setq ii  (1+ ii)))))&#xA;            (forward-sentence)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Not sure whether this will help with what you really need for your sentence analysis, but if you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow&quot;&gt;multi-command&lt;/a&gt; &lt;code&gt;icicle-sentence&lt;/code&gt; (bound to &lt;code&gt;M-s M-s s&lt;/code&gt;) to search the text within sentences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, search contexts are individual sentences -- other text is ignored. You can easily navigate among sentences, narrow the set of sentences you look at by typing a pattern to match, etc. Use &lt;code&gt;C-down&lt;/code&gt; to cycle among the matching sentences (or all sentences, if your minibuffer input is empty).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-13T13:27:15.360" LastActivityDate="2015-08-13T13:27:15.360" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="14697" PostTypeId="1" CreationDate="2015-08-12T22:53:31.987" Score="1" ViewCount="1039" Body="&lt;p&gt;How should one indent text in &lt;code&gt;org-mode&lt;/code&gt; with &lt;code&gt;org-indent-mode&lt;/code&gt; disabled?&#xA;I expect something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;  Some text.&#xA;  - item 1&#xA;  - item 2&#xA;&#xA;** B&#xA;   More text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT:&lt;/em&gt; This seems to depend on the variable &lt;code&gt;org-adapt-indentation&lt;/code&gt;. I have it set to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Incorrect indentation of babel output&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;But then this output of the evaluation below (using org-babel) is incorrectly indented:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline showing result indentation&#xA;&#xA;  Some text aligned with the headline.&#xA;  Evaluate lisp expression ~(require 'ob-python)~ and then run the code&#xA;  block below.&#xA;&#xA;  #+BEGIN_SRC python :results output&#xA;    for i in range(10):&#xA;        print(str(i))&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS:&#xA;  #+begin_example&#xA;  0&#xA;  1&#xA;  2&#xA;  3&#xA;  4&#xA;  5&#xA;  6&#xA;  7&#xA;  8&#xA;  9&#xA;#+end_example&#xA;&#xA;  After running the output on the previous line is incorrectly indented.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do can I use org-mode in such a way that evaluated output (more than 10 lines long) is correctly indented?&#xA;I suspect there is an option to fix this or, if not, this may be a bug but my experience with emacs and &lt;code&gt;org-mode&lt;/code&gt; is limited.&#xA;I used emacs 24.5.1 with the -q option and an empty home directory just to make sure it is not a misconfiguration.&lt;/p&gt;&#xA;" OwnerUserId="9180" LastEditorUserId="9180" LastEditDate="2015-08-13T16:13:10.933" LastActivityDate="2015-08-13T16:13:10.933" Title="Indentation of source block result" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14698" PostTypeId="1" AcceptedAnswerId="14700" CreationDate="2015-08-12T23:11:20.870" Score="0" ViewCount="1391" Body="&lt;p&gt;I am trying out &lt;code&gt;evil mode&lt;/code&gt;, and I want to rebind something to four arrows so I can move conveniently up-down-left-right when I am in &lt;code&gt;insert state&lt;/code&gt;. In other words, which functions in emacs/evil that I can call to make the cursor move like pressing the arrows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not use the arrows to move in insert state, how do you move?&lt;/p&gt;&#xA;" OwnerUserId="8937" LastActivityDate="2015-08-13T00:59:34.317" Title="evil mode: how to move cursor in insert state?" Tags="|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14700" PostTypeId="2" ParentId="14698" CreationDate="2015-08-13T00:59:34.317" Score="0" Body="&lt;p&gt;To find what command is bound to &lt;kbd&gt;key&lt;/kbd&gt;, simply do &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;k&lt;/kbd&gt; &lt;kbd&gt;key&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;k&lt;/kbd&gt; &lt;kbd&gt;&amp;lt;left&amp;gt;&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;kbd&gt;&amp;lt;left&amp;gt;&lt;/kbd&gt; runs the command &lt;code&gt;left-char&lt;/code&gt; (found in &lt;code&gt;global-map&lt;/code&gt;), which is an&#xA;  interactive compiled Lisp function in &lt;code&gt;bindings.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;kbd&gt;&amp;lt;left&amp;gt;&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(left-char &amp;amp;optional N)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Move point &lt;code&gt;N&lt;/code&gt; characters to the left (to the right if &lt;code&gt;N&lt;/code&gt; is negative).&#xA;  On reaching beginning or end of buffer, stop and signal error.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;visual-order-cursor-movement&lt;/code&gt; is non-nil, this always moves&#xA;  to the left on display, wherever that is in the buffer.&#xA;  Otherwise, depending on the bidirectional context, this may move&#xA;  one position either backward or forward in the buffer.  This is&#xA;  in contrast with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;forward-char&lt;/kbd&gt; and &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;backward-char&lt;/kbd&gt;, which&#xA;  see.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Try this for the other arrow keys.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-13T00:59:34.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14701" PostTypeId="1" AcceptedAnswerId="14707" CreationDate="2015-08-13T01:21:19.390" Score="1" ViewCount="79" Body="&lt;p&gt;I try to use &lt;code&gt;alert&lt;/code&gt; and copy the example from &lt;a href=&quot;https://github.com/jwiegley/alert&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; as below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;scratch&lt;/em&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'alert)&#xA;&#xA;;; This is the most basic form usage&#xA;(alert &quot;This is an alert&quot;)&#xA;&#xA;;; You can adjust the severity for more important messages&#xA;(alert &quot;This is an alert&quot; :severity 'high)&#xA;&#xA;;; Or decrease it for purely informative ones&#xA;(alert &quot;This is an alert&quot; :severity 'trivial)&#xA;&#xA;;; Alerts can have optional titles.  Otherwise, the title is the&#xA;;; buffer-name of the (current-buffer) where the alert originated.&#xA;(alert &quot;This is an alert&quot; :title &quot;My Alert&quot;)&#xA;&#xA;;; Further, alerts can have categories.  This allows users to&#xA;;; selectively filter on them.&#xA;(alert &quot;This is an alert&quot; :title &quot;My Alert&quot; :category 'debug)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;eval-buffer&lt;/code&gt;, it seems nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what should I expect after evaluate the &lt;code&gt;alert&lt;/code&gt; function?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-08-13T07:55:39.663" Title="What's the expect outcome for `alert`?" Tags="|elisp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14702" PostTypeId="2" ParentId="14606" CreationDate="2015-08-13T01:38:27.770" Score="4" Body="&lt;p&gt;This is expected Vim behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to fix this is to just switch to &lt;kbd&gt;d&lt;/kbd&gt; &lt;kbd&gt;e&lt;/kbd&gt; instead of &lt;kbd&gt;d&lt;/kbd&gt; &lt;kbd&gt;w&lt;/kbd&gt; when you get to the EOL (which I recommend), or you can make that switch automatic:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nadvice/evil-forward-word-begin (old-fun &amp;amp;rest args)&#xA;  (if (looking-at &quot;[[:space:]]*$&quot;)&#xA;    (progn&#xA;      (apply #'evil-forward-word-end args)&#xA;      ;; fix off-by-one&#xA;      (evil-forward-char))&#xA;    (apply old-fun args)))&#xA;&#xA;(advice-add #'evil-forward-word-begin :around #'nadvice/evil-forward-word-begin)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-13T01:38:27.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14703" PostTypeId="1" AcceptedAnswerId="14705" CreationDate="2015-08-13T02:30:21.907" Score="0" ViewCount="265" Body="&lt;p&gt;I wrote this custom function to copy the entire line, if no mark is set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sk-copy-ops (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (if mark-active&#xA;  (kill-ring-save beg end)&#xA;  (kill-ring-save (line-beginning-position) (line-end-position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am seeing two issues,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) It copies from the current point and not from the beginning of the line&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) And when i keep my point on the last but one line in the above code and do &lt;code&gt;M-x sk-copy-ops&lt;/code&gt;, it copies from the &lt;code&gt;Point&lt;/code&gt; to the end of the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are &lt;code&gt;line-beginning/end-position&lt;/code&gt; not the right indicators of the begin/end of lines in buffer?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2015-08-13T04:29:45.743" Title="Copy current line if there is no active region" Tags="|kill-ring|" AnswerCount="2" CommentCount="3" ClosedDate="2015-08-13T12:07:03.500" ContentLicense="CC BY-SA 3.0" />
  <row Id="14704" PostTypeId="2" ParentId="14703" CreationDate="2015-08-13T03:58:13.530" Score="1" Body="&lt;p&gt;One way is to leverage &lt;a href=&quot;https://github.com/purcell/whole-line-or-region&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;whole-line-or-region&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This minor mode allows functions to operate on the current line if they would normally operate on a region and region is currently undefined.&lt;/p&gt;&#xA;&lt;p&gt;The primary use for this is to kill (cut) the current line if no region is defined, and kill-region is invoked.  It basically saves you the effort of going to the begining of the line, selecting the text up to the end of the line, and killing.  Similarly, when yanking, it's smart enough to know that the string to be yanked was killed as a whole line, and it should be yanked as one, too. So you don't need to position yourself at the start of the line before yanking.  If region &lt;em&gt;is&lt;/em&gt; defined, though, all functions act as normal.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Then, you can do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun whole-line-or-region-kill-region (prefix)&#xA;  &amp;quot;Kill region or PREFIX whole lines.&amp;quot;&#xA;  (interactive &amp;quot;*p&amp;quot;)&#xA;  (whole-line-or-region-call-with-region 'kill-region prefix t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;whole-line-or-region&lt;/code&gt; can be a bit tricky to integrate with some other big Emacs modes. (e.g. &lt;code&gt;cua&lt;/code&gt; and &lt;code&gt;evil&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-13T03:58:13.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14705" PostTypeId="2" ParentId="14703" CreationDate="2015-08-13T04:29:45.743" Score="1" Body="&lt;p&gt;I don't see either problem with your code -- it works for me.  Try again, starting with &lt;code&gt;emacs -Q&lt;/code&gt;, and be sure you are calling your command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a minor improvement would be to use &lt;code&gt;(use-region-p)&lt;/code&gt; instead of just &lt;code&gt;mark-active&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-13T04:29:45.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14706" PostTypeId="1" AcceptedAnswerId="30032" CreationDate="2015-08-13T07:07:56.113" Score="7" ViewCount="2685" Body="&lt;p&gt;Whenever a buffer is saved, a message is displayed in minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wrote foo.bar&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I use &lt;a href=&quot;https://github.com/ChillarAnand/real-auto-save&quot; rel=&quot;noreferrer&quot;&gt;real-auto-save&lt;/a&gt; to save modified buffers every 5 seconds. Due to this minibuffer is getting spammed. Sometimes, when I am looking at useful info(like signature,  errors or something else), this message overrides it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to disable printing this message in minibuffer? &lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2021-09-22T05:27:32.473" Title="Suppress message in minibuffer when a buffer is saved?" Tags="|minibuffer|echo-area|message|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14707" PostTypeId="2" ParentId="14701" CreationDate="2015-08-13T07:55:39.663" Score="1" Body="&lt;p&gt;Maybe the messages are in the *Messages* buffer. You can go to it with &lt;code&gt;C-x b *Messages*&lt;/code&gt; or simply with a left-click on the minibuffer.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-08-13T07:55:39.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14708" PostTypeId="1" AcceptedAnswerId="14828" CreationDate="2015-08-13T09:09:14.657" Score="6" ViewCount="1551" Body="&lt;p&gt;I am seeing some slowness in my init file loading:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ time emacs --debug-init -eval '(kill-emacs)' -Q&#xA;&#xA;real    0m0.672s&#xA;user    0m0.338s&#xA;sys     0m0.057s&#xA;&#xA;$ time emacs --debug-init --eval '(kill-emacs)'&#xA;&#xA;real    4m17.821s&#xA;user    0m2.769s&#xA;sys     0m0.226s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These 4mins of loading is reproducible. Actually looks like a timeout. It happens when I do &lt;code&gt;(require 'magit)&lt;/code&gt;. But I don't think it's related to magit because &lt;code&gt;(require 'helm-gtags)&lt;/code&gt; causes the same slowness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However &lt;code&gt;--debug-init&lt;/code&gt; is not activated when I press C-g during the time emacs is unresponsive. Obviously is not activated either after the load finishes because there's no error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering how I can understand where the slowness comes from. I guess a backtrace at the point of slowness would be nice. Maybe some tracing facility?&lt;/p&gt;&#xA;" OwnerUserId="9183" LastActivityDate="2017-02-15T08:37:39.120" Title="Debugging slowness in init file (not hostname related)" Tags="|init-file|debugging|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14709" PostTypeId="2" ParentId="14677" CreationDate="2015-08-13T09:24:47.583" Score="3" Body="&lt;p&gt;Apart from the variables listed in your question, have a look at &lt;code&gt;smtpmail-smtp-service&lt;/code&gt;, which specifies the port number that the SMTP server is reachable at.  The default value of this variable is 25, but nowadays many SMTP servers use port 587 instead.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;The SMTP protocol is used for two different use cases:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;mail servers relaying a message in the direction of its ultimate destination (usually to the mail server of the recipient, but sometimes passing through a chain of intermediate servers), and&lt;/li&gt;&#xA;&lt;li&gt;mail clients submitting a message to their local mail server for delivery.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Those two use cases often have different requirements (for mail servers, check that they are allowed to relay messages for the sender address; for mail clients, require encryption and authentication), and so requiring mail clients to use port 587 instead of port 25 could help in making that distinction.  This is described in much more detail in &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc6409&quot; rel=&quot;nofollow noreferrer&quot;&gt;RFC 6409&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="-1" LastEditDate="2021-10-07T07:34:52.683" LastActivityDate="2015-08-13T09:24:47.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14710" PostTypeId="2" ParentId="14708" CreationDate="2015-08-13T09:55:39.663" Score="-6" Body="&lt;p&gt;4 mins is too long. I use Emacs23 on netbook (eeepc 701) with 250 packages installed, and the startup time is no more than 20 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't need bisect. The root cause is so obvious. It's simply your using of &lt;code&gt;require&lt;/code&gt; everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;don't use &lt;code&gt;(require)&lt;/code&gt;, use &lt;code&gt;(autoload)&lt;/code&gt;, check &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html&lt;/a&gt; to understand why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and check &lt;a href=&quot;https://github.com/purcell/emacs.d&quot; rel=&quot;nofollow&quot;&gt;https://github.com/purcell/emacs.d&lt;/a&gt; for sample setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, you can use &lt;a href=&quot;https://github.com/juergenhoetzel/profile-dotemacs/blob/master/profile-dotemacs.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/juergenhoetzel/profile-dotemacs/blob/master/profile-dotemacs.el&lt;/a&gt; to measure the startup time.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-08-13T09:55:39.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14711" PostTypeId="1" CreationDate="2015-08-13T10:03:04.877" Score="1" ViewCount="474" Body="&lt;p&gt;I'm using emacs on windows, output of &quot;emacs-version&quot; outputs  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I added the missing libxml2.dll, (downloaded from &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;nofollow&quot;&gt;ezwinports&lt;/a&gt;) in the emacs path to quiet emacs whining about the missing dlls. Trying to open websites results in three outcomes &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;1.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Opening TLS connection with `openssl s_client -connect www.wikipedia.org:443 -no_ssl2 -ign_eof'...failed  &#xA;Opening TLS connection to `www.wikipedia.org'...failed&#xA;error in process filter: url-http: Could not create connection to www.wikipedia.org:443&#xA;error in process filter: Could not create connection to www.wikipedia.org:443&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the website refuses to open &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;2.&lt;/em&gt;&lt;/strong&gt; &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error in process sentinel: Invalid date: Mon, 06 Mar 2130 20:55:03 GMT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;website doesn't open, after some googling I dug up a &lt;a href=&quot;https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-02/msg00176.html&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt; with apparently the same bug which seem to have been patched in emacs 24.4 version&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;3.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to connect to the websites, hyperlinks are alive, but the buttons (i.e. google search and etc) not working &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Added missing dll's to run eww in emacs &lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;Can't access most websites with the exception of google news &lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;Buttons in websites like google (search) is not working &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What other variables need to be tweaked to get eww running correctly? or is this normal?  &lt;/p&gt;&#xA;" OwnerUserId="9048" LastActivityDate="2015-08-13T10:03:04.877" Title="What variables are needed in init file in order to run eww in emacs 24.5.1 for windows?" Tags="|init-file|microsoft-windows|eww|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14712" PostTypeId="2" ParentId="14514" CreationDate="2015-08-13T10:17:40.290" Score="-1" Body="&lt;p&gt;Attach a file in Emacs is basically just insert a chunk of string containing file paths, you can use yasnippet to create chunks for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;in shell, use find/ls to create the files list to attach&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;use cli clip tool (putclip on cygwin, pbpaste on Mac, xsel/xclip on linux) to transfer the files list to the yasnippet&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-08-13T22:47:04.697" LastActivityDate="2015-08-13T22:47:04.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14714" PostTypeId="2" ParentId="14484" CreationDate="2015-08-13T10:35:03.643" Score="1" Body="&lt;p&gt;I noticed some people already mentioned rainbow-delimiters, that's also my favorite mode when editing lisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually I love parentheses, the best thing about Lisp is those parentheses, it's fun to dealing with them if you know howto:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;install evil-mode and its plugin evil-surround, so you can edit parentheses easily, for example, press &lt;code&gt;ci(&lt;/code&gt; will remove everything inside &lt;code&gt;()&lt;/code&gt;, &lt;code&gt;va(&lt;/code&gt; will select the thing wrapped by &quot;()&quot; and the &quot;()&quot; themselves. and you can press &lt;code&gt;%&lt;/code&gt; to jump between the matched parentheses&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;use flycheck or flymake, unmatched parentheses will be underlined in real time&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-08-13T10:35:03.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14715" PostTypeId="2" ParentId="2720" CreationDate="2015-08-13T10:55:11.290" Score="0" Body="&lt;p&gt;&quot;Emacs is a text editor which allows for easy text transformation from one format to another format. It has 10,000 text editing functions built-in.&quot;&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-08-13T10:55:11.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14716" PostTypeId="2" ParentId="14269" CreationDate="2015-08-13T11:09:34.920" Score="9" Body="&lt;p&gt;use the font-face, this is the trick I learned from flyspell.&lt;/p&gt;&#xA;&lt;p&gt;I tried &lt;code&gt;syntax-ppss&lt;/code&gt; two years ago, it does not work for two reason:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;not work on edge of comment (comment limit), for example, for comment like &lt;code&gt;// this is comment&lt;/code&gt; in c++-mode, if you place the cursor over the &lt;code&gt;/&lt;/code&gt; character, the result of &lt;code&gt;(nth 4 (syntax-ppss))&lt;/code&gt; is nil.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;not work at all in major-mode like web-mode&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Here is code I copied from flyspell:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun evilnc--in-comment-p (&amp;amp;optional pos)&#xA;  &amp;quot;Test if character at POS is comment.  If POS is nil, character at `(point)' is tested&amp;quot;&#xA;  (interactive)&#xA;  (unless pos (setq pos (point)))&#xA;  (let* ((fontfaces (get-text-property pos 'face)))&#xA;    (when (not (listp fontfaces))&#xA;      (setf fontfaces (list fontfaces)))&#xA;    (or (member 'font-lock-comment-face fontfaces)&#xA;        (member 'font-lock-comment-delimiter-face fontfaces))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Please note the code could be extended to support new major modes by fuzz matching font face.&lt;/p&gt;&#xA;&lt;p&gt;I've used this trick for about three years without failure. Besides, considering flyspell is widely used for so long, I could claim this method is reliable.&lt;/p&gt;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/questions/14129/which-keyboard-shortcut-to-use-for-navigating-out-of-a-string&quot;&gt;Which keyboard shortcut to use for navigating out of a string&lt;/a&gt; for similar question.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="117" LastEditDate="2020-11-29T11:23:34.347" LastActivityDate="2020-11-29T11:23:34.347" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="14717" PostTypeId="2" ParentId="14621" CreationDate="2015-08-13T11:35:11.300" Score="0" Body="&lt;p&gt;I got it to work with &lt;a href=&quot;https://pythonhosted.org/Markdown/&quot; rel=&quot;nofollow&quot;&gt;Python Markdown&lt;/a&gt; and &lt;a href=&quot;https://github.com/FND/markdown-checklist&quot; rel=&quot;nofollow&quot;&gt;Markdown Checklist&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;markdown_py -x toc -x markdown_checklist.extension -x smarty foobar.md &amp;gt; foobar.html&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8594" LastActivityDate="2015-08-13T11:35:11.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14718" PostTypeId="1" AcceptedAnswerId="14726" CreationDate="2015-08-13T12:40:43.437" Score="3" ViewCount="376" Body="&lt;p&gt;The KOMA-script bundle contains a package called &lt;code&gt;scrjura&lt;/code&gt; and I'm using it to draft contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command for the standard section in contracts is &lt;code&gt;\Clause{title=&amp;lt;title heading&amp;gt;}&lt;/code&gt;. Basically, I'd like to get an extra kind of section:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the package &lt;code&gt;scrjura&lt;/code&gt; is loaded in the preamble, I'd like to call this command the same way than other section commands: &lt;code&gt;C-c C-s&lt;/code&gt;, the prompt of Emacs asks &quot;Level: (default section)&quot; and then select which one I'd like to use (section, Clause, subsection, ...) and then get the question &quot;Title:&quot;, I type the title of the clause, the prompt of Emacs changes to &quot;Label:&quot;, and if I choose &quot;Clause&quot; as level, the whole label prompt should be &quot;Label: CLA:title-heading&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The desired output in my *.tex-file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\Clause{title=title heading}&#xA;\label{CLA:title-heading}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I set this up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even better: if the text &quot;title heading&quot; contains a comma (&quot;,&quot;), the whole of title heading needs extra brackets: &lt;code&gt;\Clause{title={title, and foo}}&lt;/code&gt;. But this would be the cherry upon the chocolate, if you can say that in English.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;MWE for a contract with a fairly recent scrjura:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass[pagesize, english, fontsize=12pt, parskip=half]{scrartcl}&#xA;\usepackage[T1]{fontenc}\usepackage[utf8]{inputenc}&#xA;\usepackage{babel, scrjura, xspace}&#xA;&#xA;&#xA;\title{Sicherheitsbestellung}&#xA;\subtitle{gag}&#xA;\date{}&#xA;&#xA;\begin{document}&#xA;\maketitle&#xA;&#xA;\begin{contract}&#xA;\Clause{title=first title heading}&#xA;&#xA;Some text. &#xA;&#xA;&#xA;\Clause{title={second title, heading}}&#xA;&#xA;And so on.&#xA;&#xA;We get numbers here after two runs.&#xA;&#xA;\end{contract}&#xA;&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2334" LastEditorUserId="14190" LastEditDate="2020-01-08T16:00:34.720" LastActivityDate="2020-01-08T16:00:34.720" Title="Add a custom section to AUCTeX's section commands?" Tags="|auctex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="14720" PostTypeId="1" CreationDate="2015-08-13T13:38:57.657" Score="2" ViewCount="189" Body="&lt;p&gt;I would like to make the &lt;em&gt;bitmapped&lt;/em&gt; font &lt;a href=&quot;http://terminus-font.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Terminus&lt;/a&gt; the default font in all my &quot;graphic&quot;&lt;sup&gt;1&lt;/sup&gt; Emacs sessions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Terminus is bitmapped, I want to use it only in one of its &quot;native&quot; sizes, and I want to make sure that the font is &lt;em&gt;never anti-aliased&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have something similar to the following in my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil&#xA;                    :family &quot;Terminus&quot;&#xA;                    :height some-height&#xA;                    :weight 'normal&#xA;                    :width 'normal)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm having a hard time figuring out what values to give to the &lt;code&gt;:height&lt;/code&gt; parameter (IOW, what values the variable &lt;code&gt;some-height&lt;/code&gt; in the snippet above may assume) in order to specify Terminus' native sizes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I'd like to know if there's some Emacs configuration that ensures that this font never gets anti-aliased.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In more detail, according to &lt;a href=&quot;https://packages.debian.org/jessie/xfonts-terminus&quot; rel=&quot;nofollow&quot;&gt;the documentation for the Terminus font installed on my system&lt;/a&gt;, its native sizes should be&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;6x12, 8x14, 8x16, 10x20, 11x22, 12x24, 14x28 and 16x32&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the &lt;code&gt;xfontsel&lt;/code&gt; utility reports the following values for the installed Terminus font's &lt;code&gt;ptSz&lt;/code&gt; parameter:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;120, 140, 160, 200, 220, 240, 280, 320&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;These values are all 10 times the second integer in the sizes cited earlier, which is encouraging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, they don't seem to be quite what Emacs wants as the value for the &lt;code&gt;:height&lt;/code&gt; parameter in the &lt;code&gt;set-face-attribute&lt;/code&gt; call shown above.  For example, &lt;em&gt;I see no difference at all between the text resulting from values 280 and 320 for&lt;/em&gt; &lt;code&gt;some-height&lt;/code&gt;&lt;sup&gt;2&lt;/sup&gt;.  In fact when both &lt;code&gt;:height&lt;/code&gt; (Emacs) and &lt;code&gt;ptSz&lt;/code&gt; (&lt;code&gt;xfontsel&lt;/code&gt;) are set to 320, their text displays match closely when compared side-by-side, but when I perform the same comparison using 280 instead of 320, the text as displayed by Emacs looks distinctly larger than that displayed by &lt;code&gt;xfontsel&lt;/code&gt;.  IOW, setting &lt;code&gt;:height&lt;/code&gt; to 280 in Emacs is decidedly not analogous to setting &lt;code&gt;ptSz&lt;/code&gt; to 280 in &lt;code&gt;xfontsel&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a quick way to determine the values of the&lt;/strong&gt; &lt;code&gt;:height&lt;/code&gt; &lt;strong&gt;parameter that&lt;/strong&gt; &lt;code&gt;set-face-attribute&lt;/code&gt; &lt;strong&gt;will faithfully match to the native sizes listed above?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also, the fact that Emacs seems to accept just about any positive integer for the &lt;code&gt;:height&lt;/code&gt; parameter (which, obviously, cannot all correspond to distinct native font sizes) makes me wonder if for some settings of &lt;code&gt;:height&lt;/code&gt; the font may be getting anti-aliased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there some way to tell Emacs never to anti-alias this font?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;1&lt;/sup&gt; By &quot;graphic&quot; I mean those sessions for which the expression &lt;code&gt;(window-system)&lt;/code&gt; evaluates to non-&lt;code&gt;nil&lt;/code&gt;.&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;2&lt;/sup&gt; When viewed with &lt;code&gt;xfontsel&lt;/code&gt; these two are clearly different.  In fact, not just the sizes of the letters are different, but also their geometries, as one would expect from two neighboring sizes of a bitmapped font.  Furthermore, if I set &lt;code&gt;some-height&lt;/code&gt; to 1, and evaluate the expression above, the text indeed becomes considerably smaller.  These observations at least rule out some trivial explanations for my inability to see any difference between the characters resulting from the settings 280 and 320 for &lt;code&gt;some-height&lt;/code&gt;.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2015-08-13T13:38:57.657" Title="On using bitmapped fonts" Tags="|faces|fonts|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14721" PostTypeId="1" AcceptedAnswerId="14728" CreationDate="2015-08-13T14:11:24.430" Score="5" ViewCount="102" Body="&lt;p&gt;I'm writing a package that provides some Python functionality. I want to use &lt;code&gt;python-rx&lt;/code&gt;, which is part of Emacs' python.el.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'python))&#xA;&#xA;(defun python-foo-starts-defun-p ()&#xA;  &quot;Return non-nil if the current statement opens a defun.&quot;&#xA;  (save-excursion&#xA;    (python-nav-beginning-of-statement)&#xA;    (looking-at (python-rx defun))))&#xA;&#xA;(provide 'python-foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this gives me byte compilation errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;the function `python-nav-beginning-of-statement' might not be defined at runtime.&#xA;&#xA;the function `python-rx' is not known to be defined.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This error is correct: when I run my code in a fresh Emacs, I do get an error about &lt;code&gt;python-rx&lt;/code&gt;. However, I can open python.el and run &lt;code&gt;M-x eval-buffer&lt;/code&gt; and then my code works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this is because &lt;code&gt;python-rx&lt;/code&gt; is wrapped in an &lt;code&gt;eval-when-compile&lt;/code&gt; in python.el. How can I use it in my code?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2015-08-26T21:02:34.210" LastActivityDate="2015-08-26T21:02:34.210" Title="How do I depend on macros from other packages?" Tags="|python|elisp-macros|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14722" PostTypeId="1" CreationDate="2015-08-13T14:18:39.513" Score="2" ViewCount="67" Body="&lt;p&gt;I have &lt;code&gt;(toggle-frame-maximized)&lt;/code&gt; in my init file. If I enable the &lt;code&gt;ospl-mode&lt;/code&gt; (btw very handy mode) given in the answer &lt;a href=&quot;https://emacs.stackexchange.com/a/473/&quot;&gt;https://emacs.stackexchange.com/a/473/&lt;/a&gt;, then I minimize the frame, Emacs (GNU Emacs 24.5.1) get frozen. Any idea why this happens? I also checked this with &lt;code&gt;emacs -Q&lt;/code&gt; the same happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1:&lt;/strong&gt; The OS is windows, for minimizing I click on the middle icon of the bar of emacs window (see the image below)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XvkFq.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XvkFq.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; It seems that I have localized the problem a little more, if I do the following steps Emacs get frozen (unresponsive), I am wondering if other people can test the following steps to see what happens for them.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start with &lt;code&gt;emacs -Q&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Eval &lt;code&gt;(toggle-frame-maximized)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then Eval all of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(visual-line-mode 1)&#xA;    (setq right-margin-width (- (window-body-width)  fill-column))&#xA;    (set-window-buffer (selected-window) (current-buffer))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Click on the icon which looks like a &lt;code&gt;double overlapping squares&lt;/code&gt; (see the above image, the icon between &lt;code&gt;-&lt;/code&gt; and &lt;code&gt;X&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-08-13T21:42:44.687" Title="A possible incompatibility between `toggle-frame-maximized` and a mode using `visual-line-mode`" Tags="|init-file|microsoft-windows|debugging|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14723" PostTypeId="1" CreationDate="2015-08-13T14:38:34.940" Score="2" ViewCount="185" Body="&lt;p&gt;I'm making a major mode for json (which has no comments), and using SMIE for 'free' indenting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've currently got a half-baked grammar called &lt;code&gt;json-grammar&lt;/code&gt;, and no &lt;code&gt;rules-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, I'm invoking &lt;code&gt;smie-setup&lt;/code&gt; as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(smie-setup json-grammar (lambda (method arg) ()))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, in a few places I'm calling &lt;code&gt;smie-indent-line&lt;/code&gt;, and when I do, &lt;code&gt;smie-indent-line&lt;/code&gt; eventually calls &lt;code&gt;comment-normalize-vars&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function asks for a value &lt;code&gt;comment syntax&lt;/code&gt;, and insists on having some value. Given that I want to use &lt;code&gt;SMIE&lt;/code&gt; for indentation, how can I avoid this problem? &lt;/p&gt;&#xA;" OwnerUserId="503" LastActivityDate="2016-01-11T15:30:14.953" Title="Using SMIE for language without comment syntax" Tags="|syntax|smie|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14724" PostTypeId="1" CreationDate="2015-08-13T15:13:43.750" Score="4" ViewCount="2132" Body="&lt;p&gt;During my daily work I want to prevent parent tasks to be visible in my daily agenda views. This is very practical during daily work, since a parent task cannot be &quot;done&quot;, only be a placeholder for its sibling tasks. However, during my GTD weekly review of my tasks I would like to have a separate agende view showing all parent tasks, to be able to get an overview of their sibling tasks and their status.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the following code to make task dependencies possible and to prevent showing parent tasks.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-enforce-todo-dependencies t)&#xA;(setq org-agenda-dim-blocked-tasks 'invisible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I use the code above, how can I make an agenda view that show only my parent tasks? What is lacking in the agenda view code below?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '(&#xA;        (&quot;p&quot; &quot;parent tasks&quot; tags &amp;lt; ...missing code... &amp;gt; (&#xA;        (org-agenda-overriding-header &quot;Parent tasks&quot;)&#xA;           ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or what changes do I have to make in my code to be able to BOTH not showing parent tasks in some views, AND to show them in other views?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not want to manually tag the parent views with &quot;PROJECT&quot;, since this is extra work that can easily be forgotten, and thereby clutter my daily and weekly agenda views.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any help !&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="10" LastEditDate="2015-08-13T15:24:20.203" LastActivityDate="2015-08-16T15:40:05.807" Title="Emacs org mode: How to make agenda views of blocked parent tasks?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14725" PostTypeId="1" CreationDate="2015-08-13T15:47:20.693" Score="1" ViewCount="148" Body="&lt;p&gt;I understand and work around the limitation of session mode python code blocks. But why is it like this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible that this could be fixed so that people don't have to adjust their usage patterns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing is output e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session py1 :results output raw&#xA;  d = 0&#xA;  for a in range(3):&#xA;      pass&#xA;&#xA;  print &quot;oh yeah&quot;&#xA;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;&#xA;... ... &amp;gt;&amp;gt;&amp;gt; oh yeah&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All the ellipses and prompts are quite annoying.&#xA;I understand that this is not a trivial matter but session mode is so powerful and I want to see it be as good as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please explain the reason for these blemishes?&lt;/p&gt;&#xA;" OwnerUserId="9019" LastActivityDate="2015-08-13T15:47:20.693" Title="Org-mode - What internals make python session mode so picky with blank lines?" Tags="|org-mode|python|org-babel|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14726" PostTypeId="2" ParentId="14718" CreationDate="2015-08-13T16:21:28.310" Score="3" Body="&lt;p&gt;The best way to add support for a LaTeX package is to create a style file, see &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Hacking-the-Parser&quot; rel=&quot;nofollow&quot;&gt;Automatic Extraction of New Things&lt;/a&gt; section of the AUCTeX manual.  In this case creating the new style file doesn't suffice, you have also to add some code to your init file in order to support the new &lt;code&gt;\Clause&lt;/code&gt; macro.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Style file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Create a file named &lt;code&gt;scrjura.el&lt;/code&gt; in one of the directories listed in &lt;code&gt;TeX-style-private&lt;/code&gt; (on GNU/Linux systems by default it's &lt;code&gt;~/.emacs.d/auctex/style&lt;/code&gt;).  The content of the file is the following&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(TeX-add-style-hook&#xA; &quot;scrjura&quot;&#xA; (lambda ()&#xA;   (LaTeX-section-list-add-locally '((&quot;Clause&quot; 3)&#xA;                     (&quot;subsection&quot; 4)&#xA;                     (&quot;subsubsection&quot; 5)&#xA;                     (&quot;paragraph&quot; 6)&#xA;                     (&quot;subparagraph&quot; 7)))&#xA;   (TeX-run-style-hooks&#xA;    &quot;scrkbase&quot;&#xA;    &quot;tocbasic&quot;))&#xA; LaTeX-dialect)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this file you essentially add the &lt;code&gt;Clause&lt;/code&gt; sectioning macro to &lt;code&gt;LaTeX-section-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Init file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add also the following lines to your init file.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Add &quot;CLA&quot; label prefix for &quot;Clause&quot; macro&#xA;(eval-after-load &quot;latex&quot;  ; for plain AUCTeX&#xA;  '(add-to-list 'LaTeX-section-label '(&quot;Clause&quot; . &quot;CLA:&quot;)))&#xA;(eval-after-load &quot;reftex-vars&quot;  ; for RefTeX&#xA;  '(add-to-list 'reftex-label-alist '(&quot;Clause&quot; 115 &quot;CLA:&quot; nil nil nil)))&#xA;&#xA;&#xA;(defun LaTeX-section-section ()&#xA;  &quot;Hook to insert LaTeX section command into the file.&#xA;Insert this hook into `LaTeX-section-hook' after those hooks that set&#xA;the `name', `title', and `toc' variables, but before those hooks that&#xA;assume that the section is already inserted.&quot;&#xA;  ;; insert a new line if the current line and the previous line are&#xA;  ;; not empty (except for whitespace), with one exception: do not&#xA;  ;; insert a new line if the previous (or current, sigh) line starts&#xA;  ;; an environment (i.e., starts with `[optional whitespace]\begin')&#xA;  (unless (save-excursion&#xA;        (re-search-backward&#xA;         (concat &quot;^\\s-*\n\\s-*\\=\\|^\\s-*&quot; (regexp-quote TeX-esc)&#xA;             &quot;begin&quot;)&#xA;         (line-beginning-position 0) t))&#xA;    (LaTeX-newline))&#xA;  (insert TeX-esc name)&#xA;  (cond ((null toc))&#xA;    ((zerop (length toc))&#xA;     (insert LaTeX-optop)&#xA;     (set-marker done-mark (point))&#xA;     (insert LaTeX-optcl))&#xA;    (t&#xA;     (insert LaTeX-optop toc LaTeX-optcl)))&#xA;  (insert TeX-grop)&#xA;  (if (zerop (length title))&#xA;      (set-marker done-mark (point)))&#xA;  (if (equal name &quot;Clause&quot;)&#xA;      (insert &quot;title=&quot;))&#xA;  (insert title TeX-grcl)&#xA;  (LaTeX-newline)&#xA;  ;; If RefTeX is available, tell it that we've just made a new section&#xA;  (and (fboundp 'reftex-notice-new-section)&#xA;       (reftex-notice-new-section)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've slightly redefined &lt;code&gt;LaTeX-section-section&lt;/code&gt; to support &lt;code&gt;\Clause&lt;/code&gt;, there is no need to write a new function from scratch (as I suggested previously in comments).&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-08-13T18:01:03.220" LastActivityDate="2015-08-13T18:01:03.220" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14727" PostTypeId="2" ParentId="2720" CreationDate="2015-08-13T16:45:24.073" Score="2" Body="&lt;p&gt;The best way to explain anything to a non-expert is through giving examples. So the best way to explain what Emacs is is all about to a civilian is to give examples of use cases they can understand and relate to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually start by saying something like this: Emacs is an old-school text-editor from the 70s that was invented before Microsoft Word and all the modern word-processing apps. The reason it's so cool is that it's programmable. It has a programming environment built into it, which means you can write and edit with it the same way you would with Microsoft Word. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since Emacs is programmable, you can literally program it to do anything. And since it's programmable, you can integrate Emacs with anything else on your computer, including your browser, your email, your contacts, your calendar, Twitter, Evernote, and any other programming languages you use. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everyone who uses Emacs programs it to do different things based on what they need. So a web developer who uses Emacs might program it to do __ and __. A scientist or academic might program it to do statistical analyses with R and...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case, since I'm a writer, I've programmed Emacs to do things that help me with research, writing, and editing, including:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;when I'm doing research and I copy and paste text from the web, automatically format it as a block quote, and automatically copy the name of the page, the URL, and the date and create a bibliography entry&lt;/li&gt;&#xA;&lt;li&gt;search and replace text phrases across multiple files in a directory&lt;/li&gt;&#xA;&lt;li&gt;when I write something, to automatically export to a nicely formatted web page, and, from the same source document, automatically export it to a nicely formatted PDF file, automatically generating a cover page and table of contents&lt;/li&gt;&#xA;&lt;li&gt;help me keep track of my todo lists, appointments, and deadlines&lt;/li&gt;&#xA;&lt;li&gt;help me brainstorm ideas and create mind maps&lt;/li&gt;&#xA;&lt;li&gt;automatically send emails to people, and automate certain kinds of email replies&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I generally conclude by saying something like: Basically if there's anything you do on a regular basis as part of your workflow, Emacs can be programmed to do it automatically. So basically it's a tool for programming your text editor to do whatever you want.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-08-13T17:11:24.077" LastActivityDate="2015-08-13T17:11:24.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14728" PostTypeId="2" ParentId="14721" CreationDate="2015-08-13T17:30:21.490" Score="5" Body="&lt;p&gt;Firstly, that &lt;code&gt;eval-when-compile&lt;/code&gt; method works fine for macros. It is a perfectly good way to use macros (not functions) from another package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems you report are two different things.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the function python-nav-beginning-of-statement' might not be defined at runtime.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is happening because &lt;code&gt;python-nav-beginning-of-statement&lt;/code&gt; is a&#xA;function, not a macro. Unlike macros (which are expanded at&#xA;compile-time), functions have to be available at runtime. So that&#xA;&lt;code&gt;eval-when-compile&lt;/code&gt; doesn't work here. You need to use a plain&#xA;&lt;code&gt;(require 'python)&lt;/code&gt; to make sure that this function is available.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the function `python-rx' is not known to be defined.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is a different warning. This is saying that &lt;code&gt;python-rx&lt;/code&gt; wasn't found &lt;em&gt;at all&lt;/em&gt;.&#xA;The current stable Emacs (version 24.5) does not have this macro available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically, the macro is there in the file, but it's defined in such a way that makes it unavailable for other files to use.&#xA;This has been fixed on the development snapshots (futurely Emacs 25).&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-08-13T21:24:11.720" LastActivityDate="2015-08-13T21:24:11.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14730" PostTypeId="1" AcceptedAnswerId="14731" CreationDate="2015-08-13T18:17:40.797" Score="0" ViewCount="152" Body="&lt;p&gt;The following macro...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro compile-time-eval (&amp;amp;rest body)&#xA;    (eval (cons 'progn body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...allows for compile-time metaprogramming like this (a small contrived example) :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(compile-time-eval&#xA; `(defun join-dirs (a b)&#xA;    (concat a&#xA;            ,(if (eq system-type 'windows-nt)&#xA;                 &quot;\\&quot;&#xA;               &quot;/&quot;)&#xA;            b)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is something like &lt;code&gt;compile-time-eval&lt;/code&gt; part of the standard library? (&lt;code&gt;eval-when-compile&lt;/code&gt; comes close, but it quotes the result.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what's the recommended way to implement this example?&lt;/p&gt;&#xA;" OwnerUserId="339" LastEditorUserId="454" LastEditDate="2016-06-22T03:18:29.950" LastActivityDate="2016-06-22T03:18:29.950" Title="Stdlib support for compile-time metaprogramming?" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14731" PostTypeId="2" ParentId="14730" CreationDate="2015-08-13T18:52:08.707" Score="7" Body="&lt;p&gt;Macros do not evaluate to a result, they evaluate to an &lt;em&gt;expansion&lt;/em&gt;, which is a form that substitutes the macro at the place where it's written, the &lt;em&gt;expansion site&lt;/em&gt;. The expansion itself is not evaluated by the compiler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, you normally don't try to generate function definitions completely.  Rather you'd write a macro to performs whatever expansion you'd like to have, and simply use that macro within a function body, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro my/path-separator ()&#xA;  (if (eq system-type 'windows-nt) &quot;\\&quot; &quot;/&quot;))&#xA;&#xA;(defun join-dirs (a b)&#xA;  (concat a (my/path-separator) b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in this specific example, you should not use macros at all.  Emacs' byte code is not actually OS- or architecture-specific, and thus you must not generate system-specific code during expansion.  In other words, the path separator is not a compile time constant, it's a load time constant and should be computed at load time rather than at compile time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally you should only use macros for &lt;em&gt;syntax&lt;/em&gt;, but &lt;strong&gt;never&lt;/strong&gt; for semantics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And actually you'd just use &lt;code&gt;(expand-file-name &quot;b&quot; &quot;a&quot;)&lt;/code&gt; here :)&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-08-14T07:03:43.857" LastActivityDate="2015-08-14T07:03:43.857" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14732" PostTypeId="2" ParentId="14722" CreationDate="2015-08-13T21:16:42.863" Score="1" Body="&lt;p&gt;Your recipe seems simple enough to report this as a bug: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;. Be sure to keep the info that that command provides automatically in the report buffer, especially the Emacs version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, following that recipe I do not see the problem on MS Windows (Windows 7).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I typed all of that into &lt;code&gt;*scratch*&lt;/code&gt; and then evaluated the first sexp. I selected the other sexps and did &lt;code&gt;M-x eval-region&lt;/code&gt;. I minimized the window-mgr window using the window-mgr &lt;code&gt;-&lt;/code&gt; button in the frame title bar. I had no problem restoring the window and using it normally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm guessing that this is either related to your particular Emacs version (e.g. build) or platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please do report the bug, if it is reproducible for you.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-13T21:16:42.863" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14733" PostTypeId="1" CreationDate="2015-08-13T21:23:14.337" Score="0" ViewCount="198" Body="&lt;p&gt;we use web-mode (freemarker engine) to edit source files that contain freemarker directives and a lot of SQL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Editing in web-mode (freemarker engine) works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be very helpful if we could switch syntax highlighting from web-mode (freemarker) to SQL for open buffers.&#xA;Is that possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meikel&lt;/p&gt;&#xA;" OwnerUserId="9189" LastActivityDate="2018-10-27T17:00:30.973" Title="Switch syntax highlighting of open buffer from web-mode (freemarker) to sql" Tags="|syntax|web-mode|highlighting|sql|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14734" PostTypeId="2" ParentId="14724" CreationDate="2015-08-13T21:30:04.300" Score="1" Body="&lt;p&gt;If parent tasks are exactly those that are blocked, then you can define a &lt;code&gt;org-agenda-skip-function&lt;/code&gt; to omit anything that isn't blocked.  You can use the  options block  to temporarily change variables related to blocking (for example &lt;code&gt;org-enforce-todo-checkbox-dependencies&lt;/code&gt;) to things aren't block spuriously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Skip functions will be called with the point at each heading the agenda checks and are expected to return either &lt;code&gt;nil&lt;/code&gt; (when the entry should &lt;strong&gt;not&lt;/strong&gt; be skipped) or the location of the next heading the agenda should check (often the next entry, but you could skip entire subtrees here).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a function that just checks each entry for blocking with &lt;code&gt;org-entry-blocked-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-agenda-skip-if-not-blocked ()&#xA;  (let ((next-headline (save-excursion&#xA;                         (or (outline-next-heading) (point-max)))))&#xA;    (if (not (org-entry-blocked-p)) next-headline)))&#xA;&#xA;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;B&quot; &quot;Blocked entries&quot; alltodo &quot;&quot;&#xA;               ((org-agenda-skip-function '(org-agenda-skip-if-not-blocked))&#xA;                (org-enforce-todo-checkbox-dependencies nil))&#xA;               ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there is some more complex rule for identifying parent tasks, then take a look at &lt;code&gt;org-stuck-projects&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-08-16T15:40:05.807" LastActivityDate="2015-08-16T15:40:05.807" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14735" PostTypeId="2" ParentId="14721" CreationDate="2015-08-13T21:51:54.460" Score="2" Body="&lt;p&gt;Regarding those warnings &lt;em&gt;in general&lt;/em&gt; (Malabarba's answer covers your specific question nicely)...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you &lt;em&gt;know&lt;/em&gt; that a &quot;Warning: the function X is not known to be defined.&quot; warning is unnecessary, you can use &lt;code&gt;declare-function&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Declaring Functions&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;declare-function&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, you want to read:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Compiler Errors&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-08-13T22:11:28.573" LastActivityDate="2015-08-13T22:11:28.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14736" PostTypeId="2" ParentId="14733" CreationDate="2015-08-13T22:19:25.413" Score="1" Body="&lt;p&gt;I found a solution.&#xA;I added &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'sql-mode-hook 'sql-highlight-postgres-keywords) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my .emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can change between modes by M-x sql-mode and M-x web-mode.&lt;/p&gt;&#xA;" OwnerUserId="9189" LastActivityDate="2015-08-13T22:19:25.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14737" PostTypeId="1" CreationDate="2015-08-13T22:50:19.413" Score="1" ViewCount="55" Body="&lt;p&gt;we edit freemarker template engine files with web-mode.&#xA;The files also contain a lot of SQL.&#xA;I added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun my-web-mode-hook ()&#xA;    &quot;Hooks for Web mode.&quot;&#xA;    (setq web-mode-enable-sql-detection t)&#xA;    )&#xA;    (add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to .emacs file, but don't geht syntax highlighting for the SQL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to highlight freemarker as well as SQL-Code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any suggestion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meikel&lt;/p&gt;&#xA;" OwnerUserId="9189" LastActivityDate="2015-08-13T22:50:19.413" Title="web-mode sql detection doesn't activate syntax highlighting" Tags="|syntax-highlighting|web-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14738" PostTypeId="2" ParentId="13983" CreationDate="2015-08-14T00:32:27.120" Score="3" Body="&lt;p&gt;You were almost there (note the &lt;code&gt;#x&lt;/code&gt; instead of &lt;code&gt;#&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font &quot;fontset-default&quot; '(#x16a0 . #x16ff) &quot;Junicode:Regular&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-08-14T00:32:27.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14739" PostTypeId="1" AcceptedAnswerId="14744" CreationDate="2015-08-14T00:38:32.843" Score="4" ViewCount="146" Body="&lt;p&gt;I have multiple overlays with &lt;code&gt;'help-echo&lt;/code&gt; strings covering the same region. &#xA;Can I make Emacs show all these strings in the mouseover tooltip? By default it only shows the one coming from the highest priority overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The context is FlyCheck: a checker reports errors and warnings for the same position in the buffer, and the tooltip for that position only mentions the errors.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2015-08-14T01:50:32.093" LastActivityDate="2015-08-14T04:19:19.660" Title="Concatenate multiple 'help-echo strings" Tags="|flycheck|overlays|tooltip|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14740" PostTypeId="1" CreationDate="2015-08-14T01:04:04.523" Score="7" ViewCount="2866" Body="&lt;p&gt;Beloved org-mode can be configured so that different headings (aka, entry titles) display with different colors depending on their nesting level, and so that they only show the final markup character instead of the whole string of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure emacs so markdown mode also renders like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I notice markdown-mode lets you fold to show only headings, but they are all rendered in the same color, and littered with # characters.&lt;/p&gt;&#xA;" OwnerUserId="9190" LastEditorUserId="105" LastEditDate="2015-08-14T01:30:23.850" LastActivityDate="2023-02-03T04:02:25.347" Title="How to configure markdown-mode to render headings like org-mode?" Tags="|org-mode|markdown-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14741" PostTypeId="2" ParentId="14739" CreationDate="2015-08-14T01:34:39.897" Score="1" Body="&lt;p&gt;No, not unless you run some code that combines the overlays, e.g., replacing some with one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, get the &lt;code&gt;help-echo&lt;/code&gt; property from whichever you like, and add the text in it to the &lt;code&gt;help-echo&lt;/code&gt; property of whichever overlay has the highest priority. Or create an overlay with a higher priority than the others, and whose &lt;code&gt;help-echo&lt;/code&gt; property has all of the text that you want, derived from the property on the other overlays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overlay priorities are designed to let you mask one overlay by another. That masking includes their &lt;code&gt;help-echo&lt;/code&gt; strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(But it might be that if you describe your exact context in more detail there is another solution.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-14T01:34:39.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14742" PostTypeId="1" CreationDate="2015-08-14T03:25:25.587" Score="2" ViewCount="57" Body="&lt;p&gt;I use &lt;code&gt;shopt -s autocd&lt;/code&gt; in the bash shell. It allows me to just type in the directory name and cd there. Is there some equivalent in eshell?&lt;/p&gt;&#xA;" OwnerDisplayName="user6590" LastActivityDate="2015-08-14T03:29:35.217" Title="Equivalent of `shopt -s autocd` in eshell" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14743" PostTypeId="2" ParentId="14742" CreationDate="2015-08-14T03:29:35.217" Score="7" Body="&lt;p&gt;I hate to break this to you, but it's the built-in default behavior. :)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Welcome to the Emacs shell&#xA;&#xA;~/.emacs.d $ /&#xA;/ $ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-14T03:29:35.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14744" PostTypeId="2" ParentId="14739" CreationDate="2015-08-14T04:19:19.660" Score="5" Body="&lt;p&gt;The &lt;code&gt;help-echo&lt;/code&gt; property can be a function that returns the actual string to display, so you could add an additional overlay with higher priority with a special &lt;code&gt;help-echo&lt;/code&gt; property which will compute the union/concatenation of all the help-echo properties it covers.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-14T04:19:19.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14745" PostTypeId="2" ParentId="14723" CreationDate="2015-08-14T04:24:35.377" Score="1" Body="&lt;p&gt;You'll probably want to use dummy comment settings.  E.g. &lt;code&gt;&quot;#&quot;&lt;/code&gt; for &lt;code&gt;comment-start&lt;/code&gt; and &lt;code&gt;&quot;\\`.\\`&quot;&lt;/code&gt; for &lt;code&gt;comment-start-skip&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="5296" LastEditDate="2016-01-11T15:30:14.953" LastActivityDate="2016-01-11T15:30:14.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14746" PostTypeId="1" CreationDate="2015-08-14T08:52:17.553" Score="1" ViewCount="76" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Dewdrops/powerline&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; is what I am trying to install but I keep running into no 'powerline-themes'. I have only started using Emacs yesterday, so can someone please point out what is going on behind the scenes and why is it failing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="9193" LastActivityDate="2015-08-14T19:32:38.190" Title="Install repo fork using el-get" Tags="|package-repositories|powerline|" AnswerCount="1" CommentCount="3" ClosedDate="2015-08-16T09:35:04.247" ContentLicense="CC BY-SA 3.0" />
  <row Id="14747" PostTypeId="1" CreationDate="2015-08-14T10:47:07.330" Score="10" ViewCount="9188" Body="&lt;p&gt;I am reading SICP recently to learn lisp programming. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an example in the book to make a high level function &lt;strong&gt;&lt;em&gt;sum&lt;/em&gt;&lt;/strong&gt; as below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define (sum term a next b)&#xA;   ...&#xA;   (term a)&#xA;   ...&#xA;   (next a)&#xA;   ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this function, &lt;strong&gt;term&lt;/strong&gt; and &lt;strong&gt;next&lt;/strong&gt; are functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to write the same function in elisp like this. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun sum (term a next b)&#xA;    ....&#xA;    (funcall term a)&#xA;    ...&#xA;    (func next a)&#xA;    ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I define some test functions to test sum&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun inc-test (x) (+ x 1))&#xA;&#xA; sum inc-test 1 inc-test 10 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it show errors like this: &lt;strong&gt;&lt;em&gt;Invalid function: inc-test&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I am new to elisp, can anyone call tell me how to fix it?&#xA;very appreciate&lt;/p&gt;&#xA;" OwnerUserId="8691" LastEditorUserId="8691" LastEditDate="2015-08-14T10:51:40.160" LastActivityDate="2018-01-15T20:15:05.077" Title="How to pass function as argument in elisp" Tags="|elisp|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14748" PostTypeId="1" AcceptedAnswerId="14749" CreationDate="2015-08-14T13:37:03.207" Score="7" ViewCount="2086" Body="&lt;p&gt;&lt;kbd&gt;C-c C-x C-v&lt;/kbd&gt; calls &lt;code&gt;org-toggle-inline-images&lt;/code&gt; function.  With prefix key it passes some arguments to this function (don't know which one). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I map the function with arguments to the &lt;kbd&gt;F12&lt;/kbd&gt; button so it does the same as &lt;kbd&gt;C-u C-c C-x C-v&lt;/kbd&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="4005" LastEditorUserId="2274" LastEditDate="2015-08-14T21:51:16.367" LastActivityDate="2015-08-14T21:51:16.367" Title="How to bind a command with a C-u prefix to a different key?" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14749" PostTypeId="2" ParentId="14748" CreationDate="2015-08-14T13:42:45.367" Score="11" Body="&lt;p&gt;&lt;code&gt;C-u&lt;/code&gt; is the universal prefix argument. It is often used for commands that only have two states (with and without an argument), though it can also be interpreted as a numeric prefix (4). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, looking at the source code for &lt;code&gt;org-toggle-inline-images&lt;/code&gt; I see that it only checks whether the argument is set so the specific value you pass does not matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define a function that calls &lt;code&gt;(org-toggle-inline-images t)&lt;/code&gt;. To do it with a lambda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map  (kbd &quot;&amp;lt;f12&amp;gt;&quot;)&#xA;    (lambda () (interactive) (org-toggle-inline-images t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This binds F12 in org-mode, leaving the global binding in place for other modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more on key bindings, this is a good read: &lt;a href=&quot;https://www.masteringemacs.org/article/mastering-key-bindings-emacs&quot;&gt;Mastering Key Bindings in Emacs&lt;/a&gt;. And of course there are lots of details in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Keymaps.html&quot;&gt;Emacs Lisp manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-08-14T13:51:58.540" LastActivityDate="2015-08-14T13:51:58.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14750" PostTypeId="1" CreationDate="2015-08-14T14:01:39.960" Score="3" ViewCount="1199" Body="&lt;p&gt;I use evil-mode and evil-leader, and I have the &lt;code&gt;&amp;lt;SPC&amp;gt;s&lt;/code&gt; keybinding to save the buffer. But when I edit a src code block in org-mode (with &lt;code&gt;C-'&lt;/code&gt;), I want &lt;code&gt;&amp;lt;SPC&amp;gt;s&lt;/code&gt; to run &lt;code&gt;org-edit-src-save&lt;/code&gt; instead of &lt;code&gt;save-buffer&lt;/code&gt;. Some things I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; I think this one has no effect because `set-key-for-mode`&#xA;;; probably only works with major-modes.&#xA;(evil-leader/set-key-for-mode 'org-src-mode &quot;s&quot; 'org-edit-src-save)&#xA;&#xA;&#xA;;; This one works, but makes the binding global.&#xA;(defun my/org-src-conf () &#xA; (make-local-variable 'evil-leader--default-map)&#xA; (make-local-variable 'evil-leader--mode-maps)&#xA; (evil-leader/set-key &quot;s&quot; 'org-edit-src-save))&#xA;&#xA;(add-hook 'org-src-mode-hook 'my/org-src-conf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this local binding for evil-leader?&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2018-02-22T12:31:45.997" Title="how to make evil-leader local in org-src-mode?" Tags="|org-mode|key-bindings|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14751" PostTypeId="2" ParentId="14746" CreationDate="2015-08-14T14:42:58.650" Score="1" Body="&lt;p&gt;You have to create an el-get recipe. You can create a directory to save your custom recipes and tell el-get about it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'el-get-recipe-path &quot;~/.emacs.d/el-get-recipes&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then create the recipe for your repo:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:name powerline-themes&#xA;       :website &quot;http://github.com/Dewdrops/powerline&quot;&#xA;       :description &quot;My powerline themes fork&quot;&#xA;&#xA;       :type github&#xA;       :pkgname &quot;Dewdrops/powerline&quot;&#xA;       :features powerline-themes&#xA;       :depends powerline)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and save in your &lt;code&gt;~/.emacs.d/el-get-recipes&lt;/code&gt; with the name &lt;code&gt;powerline-themes.rcp&lt;/code&gt;. Now your custom recipe should be available in &lt;code&gt;el-get-install&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not using el-get and I couldn't test the recipe above, so you might have to change some value in there.&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-08-14T19:32:38.190" LastActivityDate="2015-08-14T19:32:38.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14752" PostTypeId="2" ParentId="14748" CreationDate="2015-08-14T15:01:47.180" Score="3" Body="&lt;p&gt;The answer &lt;em&gt;in general&lt;/em&gt; is to look at the code defining the command. In particular (but not necessarily only) the &lt;code&gt;interactive&lt;/code&gt; spec.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you look for is what the function does with a prefix arg. And then you define a command that does the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, the prefix arg is used to define some value that is then passed in the code to another function.  You then need only call that other function, passing it the argument that would have been provided via the prefix arg in the original command.  IOW, you can typically use the same code, just passing a value in place of the value that would be determined from the prefix arg.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-14T15:01:47.180" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14753" PostTypeId="1" AcceptedAnswerId="14784" CreationDate="2015-08-14T15:09:28.653" Score="8" ViewCount="1009" Body="&lt;p&gt;Is it possible to load &lt;code&gt;.dir-locals.el&lt;/code&gt; file without prompting me, but also without adding values I am configuring in that file to my &lt;code&gt;init.el&lt;/code&gt; in &lt;code&gt;custom-set-variables&lt;/code&gt;? The reason I want it is that that file contains some sensitive data and I have a habit to share my &lt;code&gt;init.el&lt;/code&gt;, so I want it to just load. I understand that in general &lt;code&gt;.dir-locals.el&lt;/code&gt; might contain inappropriate code that I should not evaluate. So I was thinking that probably there is something like whitelist of &lt;code&gt;.dir-locals.el&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general what I want to achieve is to have 'project'-wide emacs configurations file that is loaded without any additional hassle. So if it's not possible with &lt;code&gt;.dir-locals.el&lt;/code&gt; - I am open to other solutions :D&lt;/p&gt;&#xA;" OwnerUserId="5161" LastEditorUserId="2642" LastEditDate="2015-08-14T16:57:47.707" LastActivityDate="2018-02-15T21:10:18.387" Title="White list of .dir-locals.el" Tags="|directory-local-variables|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14754" PostTypeId="1" CreationDate="2015-08-14T15:54:18.330" Score="2" ViewCount="475" Body="&lt;p&gt;I have a persistent problem with some jit-lock-function somewhere whenever I compile. I'm actually invoking the visual studio compiler, and I assume some of the output is somehow abhorrent to emacs. I updated to a newer version of emacs today because I found that there was an error in cc-fonts.el that would cause trouble, but even with that fix I still see this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;Error during redisplay: (jit-lock-function 80427) signaled (wrong-type-argument stringp nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't seem to be causing any trouble, and it's not worth any more of my time to fix it. Can I get the messages buffer to stop showing it to me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: It's worth noting that it's many variations on this message that are being displayed, so the function number (80427 in my example) changes on almost every line. That means I end up with hundreds of these messages filling up my messages buffer, pushing out any meaningful information.&lt;/p&gt;&#xA;" OwnerUserId="8254" LastEditorUserId="8254" LastEditDate="2015-08-14T19:51:44.500" LastActivityDate="2015-08-14T19:51:44.500" Title="Is there a way to suppress errors in the *Messages* buffer?" Tags="|font-lock|message|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14755" PostTypeId="1" AcceptedAnswerId="14759" CreationDate="2015-08-14T19:33:32.677" Score="14" ViewCount="5330" Body="&lt;p&gt;I'd like to use the &lt;code&gt;ESC&lt;/code&gt; key instead of &lt;code&gt;C-g&lt;/code&gt; for &lt;code&gt;keyboard-quit&lt;/code&gt;. My naïve approach to just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;ESC&quot;) 'keyboard-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does not work. &lt;code&gt;ESC&lt;/code&gt; is still a prefix key and pressing it does not call &lt;code&gt;keyboard-quit&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7004" LastActivityDate="2019-08-26T13:21:02.710" Title="How to remove bindings to the ESC prefix key" Tags="|key-bindings|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14756" PostTypeId="2" ParentId="13128" CreationDate="2015-08-14T19:59:51.620" Score="4" Body="&lt;p&gt;I improved @Lindydancer's answer in the following ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Inlined the &lt;code&gt;sh-script-extra-font-lock-is-in-double-quoted-string&lt;/code&gt; function, as it was only used once&lt;/li&gt;&#xA;&lt;li&gt;Escaping the variable works.&lt;/li&gt;&#xA;&lt;li&gt;Numeric variables (&lt;code&gt;$10&lt;/code&gt;, &lt;code&gt;$1&lt;/code&gt;, etc) are highlighted.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Break for code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sh-script-extra-font-lock-match-var-in-double-quoted-string (limit)&#xA;  &quot;Search for variables in double-quoted strings.&quot;&#xA;  (let (res)&#xA;    (while&#xA;        (and (setq res (progn (if (eq (get-byte) ?$) (backward-char))&#xA;                              (re-search-forward&#xA;                               &quot;[^\\]\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\|[[:digit:]]+\\)&quot;&#xA;                               limit t)))&#xA;             (not (eq (nth 3 (syntax-ppss)) ?\&quot;)))) res))&#xA;&#xA;(defvar sh-script-extra-font-lock-keywords&#xA;  '((sh-script-extra-font-lock-match-var-in-double-quoted-string&#xA;     (2 font-lock-variable-name-face prepend))))&#xA;&#xA;(defun sh-script-extra-font-lock-activate ()&#xA;  (interactive)&#xA;  (font-lock-add-keywords nil sh-script-extra-font-lock-keywords)&#xA;  (if (fboundp 'font-lock-flush)&#xA;      (font-lock-flush)&#xA;    (when font-lock-mode (with-no-warnings (font-lock-fontify-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8725" LastEditorUserId="8725" LastEditDate="2015-08-15T22:46:40.860" LastActivityDate="2015-08-15T22:46:40.860" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14757" PostTypeId="2" ParentId="14755" CreationDate="2015-08-14T20:14:28.457" Score="9" Body="&lt;p&gt;My advice would be to leave &lt;code&gt;ESC&lt;/code&gt; alone, because it is a special key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, Emacs uses &lt;code&gt;ESC&lt;/code&gt; (ASCII 27) as the &lt;code&gt;meta-prefix-key&lt;/code&gt;. From the Elisp Manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;‘esc-map’ is the global keymap for the  prefix key.  Thus, the&#xA;       global definitions of all meta characters are actually found here.&#xA;       This map is also the function definition of ‘ESC-prefix’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Instead, meta characters are regarded for purposes of key lookup as&#xA;  sequences of two characters, the first of which is ESC (or whatever is&#xA;  currently the value of ‘meta-prefix-char’).  Thus, the key ‘M-a’ is&#xA;  internally represented as ‘ESC a’, and its global binding is found at&#xA;  the slot for ‘a’ in ‘esc-map’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So to use ESC for something else you would need to set &lt;code&gt;meta-pefix-key&lt;/code&gt; to something else, and also bind some other key to &lt;code&gt;ESC-prefix&lt;/code&gt;. There may be other changes required as well -- I've never tried this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more on &lt;code&gt;meta-prefix-char&lt;/code&gt;, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Functions-for-Key-Lookup.html&quot;&gt;Functions for Key Lookup&lt;/a&gt; in the Elisp manual.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-08-14T20:14:28.457" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14758" PostTypeId="1" AcceptedAnswerId="14776" CreationDate="2015-08-14T23:09:10.730" Score="13" ViewCount="5891" Body="&lt;p&gt;On Emacs (Mac) I have saved a desktop which opens two .org files (one of this has an image - jpg) and whenever I open up Emacs, I have to always type &lt;code&gt;y&lt;/code&gt; to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;display /route/to/image/Logo.jpg? (y or n)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make &lt;code&gt;y&lt;/code&gt; the default? &lt;em&gt;Haven't found a way to do it, so here I am.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="9196" LastEditorUserId="2274" LastEditDate="2015-08-15T16:10:50.550" LastActivityDate="2015-08-15T17:12:11.527" Title="In org-mode, how to always display inline images at Emac's startup?" Tags="|org-mode|images|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14759" PostTypeId="2" ParentId="14755" CreationDate="2015-08-14T23:32:37.360" Score="12" Body="&lt;p&gt;You can do &lt;code&gt;(define-key key-translation-map (kbd &quot;ESC&quot;) (kbd &quot;C-g&quot;))&lt;/code&gt;. I did the same a long time ago and had no problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; to improve the answer according to the comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to keep the &lt;code&gt;ESC&lt;/code&gt; key functionality, you can do &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;C-&amp;lt;escape&amp;gt;&quot;) (kbd &quot;ESC&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing to note is that if Emacs hangs you still have to use the &lt;code&gt;C-g&lt;/code&gt; key for some reason, but that happens rarely.&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-08-15T10:35:05.793" LastActivityDate="2015-08-15T10:35:05.793" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14760" PostTypeId="1" AcceptedAnswerId="14765" CreationDate="2015-08-15T00:09:02.510" Score="2" ViewCount="2648" Body="&lt;p&gt;I am looking to create some customized settings for a specific file. I think I want to add a hook for that file, or something that will create a few settings when that file loads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have a file &quot;really-long-lines.org&quot;, where every time I open it, I run &lt;code&gt;M-x toggle-truncate-lines&lt;/code&gt;. By default, I have all files under &lt;code&gt;org-mode&lt;/code&gt; open with &lt;code&gt;(toggle-truncate-lines 0)&lt;/code&gt; set. But for this one file, I want it to be set to &lt;code&gt;(toggle-truncate-lines 1)&lt;/code&gt;. My first approach would be to create a mode for this one file, &lt;code&gt;really-long-lines-mode&lt;/code&gt;, and run something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'really-long-lines-mode&#xA;          (lambda()&#xA;            (toggle-truncate-lines 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But is there a way to add a hook for a specific file? Or whatever solution works best.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-08-15T08:42:07.783" Title="Add hook for specific files" Tags="|org-mode|hooks|files|file-local-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14761" PostTypeId="2" ParentId="14760" CreationDate="2015-08-15T00:22:49.323" Score="5" Body="&lt;p&gt;A simple answer is to use the &lt;code&gt;eval&lt;/code&gt; pseudo-variable in a file-local variables block. See the following answer on S.O. for details:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/4356877/324105&quot;&gt;https://stackoverflow.com/a/4356877/324105&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-08-15T00:22:49.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14762" PostTypeId="1" CreationDate="2015-08-15T02:48:14.297" Score="3" ViewCount="230" Body="&lt;p&gt;I want a keyboard macro that does something like this:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Call &lt;code&gt;org-refile&lt;/code&gt;  &lt;/li&gt;&#xA;&lt;li&gt;Insert two characters(In this case &lt;code&gt;''&lt;/code&gt;)  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So whenever I invoke the keyboard macro, it lets me enter some other text, but saves me the fact of entering &lt;code&gt;''&lt;/code&gt; every time I use it.&#xA;The problem is that I try to stop recording the keyboard macro after entering those 2 characters, but helm doesn't allow me to do it. Then, if I try to edit the keyboard macro to something like this: (I've remapped org-refile to F7)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'interesting-name&#xA;   [f7 ?\' ?\'])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I think it adds a &lt;code&gt;RET&lt;/code&gt; at the end, because it doesn't allow me to enter text, and refiles the subtree to the first result in the helm minibuffer.&#xA;I hope there's a way to do this, maybe it's a simple fix and I don't get it, thanks for reading.&lt;/p&gt;&#xA;" OwnerUserId="8471" LastEditorUserId="105" LastEditDate="2015-08-15T05:02:16.733" LastActivityDate="2016-04-13T03:57:28.097" Title="How can I enter some text in a keyboard macro that uses helm mode?" Tags="|helm|keyboard-macros|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14763" PostTypeId="1" CreationDate="2015-08-15T04:59:20.217" Score="23" ViewCount="3304" Body="&lt;p&gt;My orgmode was recently updated to the recent 8.3, and I found that I can't export my &lt;a href=&quot;https://raw.githubusercontent.com/john2x/emacs.d/master/init.org&quot;&gt;init.org&lt;/a&gt; file as HTML any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm getting the following output in &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-babel-exp process emacs-lisp at line 34...&#xA;org-babel-exp process emacs-lisp at line 44...&#xA;org-babel-exp process emacs-lisp at line 51...&#xA;... hundreds of lines like these ...&#xA;apply: Wrong type argument: listp, #(&quot;John's Emacs Config&quot; 0 19 (:parent (#0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that's it's having trouble parsing some of the headers. I tried removing the &lt;code&gt;TITLE&lt;/code&gt; and &lt;code&gt;AUTHOR&lt;/code&gt; headers and it was able to export.&lt;/p&gt;&#xA;" OwnerUserId="251" LastActivityDate="2016-07-26T16:40:08.610" Title="Exporting org file breaks when upgrading to orgmode 8.3" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14765" PostTypeId="2" ParentId="14760" CreationDate="2015-08-15T07:44:15.617" Score="2" Body="&lt;p&gt;I usually do it by adding a commented heading to a file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- truncate-lines:1 -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this can also be done as file-name specific hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun really-long-lines.org_file_hook ()&#xA;  (when (string= (file-name-nondirectory (buffer-file-name)) &quot;really-long-lines.org&quot;)&#xA;    (toggle-truncate-lines 1)&#xA;    )&#xA;)&#xA;&#xA;(add-hook 'find-file-hook 'really-long-lines.org_file_hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-08-15T08:42:07.783" LastActivityDate="2015-08-15T08:42:07.783" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14766" PostTypeId="1" CreationDate="2015-08-15T12:36:58.890" Score="4" ViewCount="1397" Body="&lt;p&gt;When I try to generate a &lt;code&gt;TAGS&lt;/code&gt; file, emacs executes &lt;code&gt;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ctags&lt;/code&gt;, which causes problems because it is not compatible with the settings emacs uses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured out how to work around the issue by modifying &lt;code&gt;exec-path&lt;/code&gt;, but I'm still confused about why it found that path in the first place. The Xcode path was not part of &lt;code&gt;exec-path&lt;/code&gt; prior to my modification. The Xcode path is not included in $PATH at any time that I'm aware of. As far as I can tell there aren't any symlinks involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs 24.5 on Mac OS 10.10.3. &lt;/p&gt;&#xA;" OwnerUserId="3909" LastActivityDate="2024-04-03T07:00:50.160" Title="Why does Emacs.app (on Mac OS X) find the ctags executable inside Xcode.app?" Tags="|osx|path|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14767" PostTypeId="2" ParentId="14753" CreationDate="2015-08-15T14:12:43.443" Score="3" Body="&lt;p&gt;If you write configuration to your &lt;code&gt;init.el&lt;/code&gt; file manually, then you could add the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-file &quot;~/.emacs.d/custom.el&quot;)&#xA;(load custom-file t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when emacs encounters a &lt;code&gt;.dir-locals.el&lt;/code&gt; with iffy options Emacs will save your choice into this &lt;code&gt;custom.el&lt;/code&gt; file, leaving you free to share your &lt;code&gt;init.el&lt;/code&gt; file publicly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you like to use Emacs' Customize interface for all your configuration, I don't think this will work for you.&lt;/p&gt;&#xA;" OwnerUserId="9202" LastActivityDate="2015-08-15T14:12:43.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14768" PostTypeId="5" CreationDate="2015-08-15T14:51:03.157" Score="0" Body="&lt;p&gt;Use this tag if your question directly relates to Emacs autosave behavior.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2015-08-15T15:14:09.167" LastActivityDate="2015-08-15T15:14:09.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14769" PostTypeId="4" CreationDate="2015-08-15T14:51:03.157" Score="0" Body="The generic concept of automatically saving information to the disk or to a remote server, triggered by a timer or any other event inside of Emacs. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2015-08-15T16:07:16.353" LastActivityDate="2015-08-15T16:07:16.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14770" PostTypeId="5" CreationDate="2015-08-15T14:52:54.940" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Isearch.html#Basic-Isearch&quot; rel=&quot;nofollow noreferrer&quot;&gt;Basic Isearch&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Isearch-Minibuffer.html#Isearch-Minibuffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Searching the Minibuffer&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-and-Matching.html#Searching-and-Matching&quot; rel=&quot;nofollow noreferrer&quot;&gt;Searching and Matching&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-24T16:27:50.113" LastActivityDate="2017-02-24T16:27:50.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14771" PostTypeId="4" CreationDate="2015-08-15T14:52:54.940" Score="0" Body="is the incremental search facility that highlights matching text as characters are typed. isearch-forward and isearch-backward  support searching characters, strings, and regexp. " OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-24T16:27:43.783" LastActivityDate="2017-02-24T16:27:43.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14772" PostTypeId="5" CreationDate="2015-08-15T14:55:30.930" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-08-15T14:55:30.930" LastActivityDate="2015-08-15T14:55:30.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14773" PostTypeId="4" CreationDate="2015-08-15T14:55:30.930" Score="0" Body="for Emacs and GNU/Linux operating system-specific issues about compiling, installing, configuring, running, editing, and debugging." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-02-23T19:50:06.680" LastActivityDate="2017-02-23T19:50:06.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14774" PostTypeId="1" AcceptedAnswerId="14779" CreationDate="2015-08-15T15:17:06.703" Score="5" ViewCount="374" Body="&lt;p&gt;I have a project, Tufte CSS, that I hand-write in HTML. I want to use smart quotes (aka fancy quotes or curved quotes) in the &lt;em&gt;text&lt;/em&gt; of that document, but dumb quotes (aka straight quotes) in the &lt;em&gt;HTML tags&lt;/em&gt; of that document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I achieve this? I currently use web-mode and &lt;a href=&quot;http://www.emacswiki.org/emacs/typopunct.el&quot; rel=&quot;nofollow&quot;&gt;typopunct.el&lt;/a&gt;, but the latter automatically inserts smart quotes everywhere, including around HTML attributes, which it thereby causes not to function.&lt;/p&gt;&#xA;" OwnerUserId="2277" LastEditorUserId="2277" LastEditDate="2015-08-15T18:29:07.307" LastActivityDate="2015-08-18T08:52:45.333" Title="How can I automatically use curved quotes in text, but straight quotes in HTML tags?" Tags="|typography|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14775" PostTypeId="1" CreationDate="2015-08-15T16:50:59.090" Score="4" ViewCount="758" Body="&lt;p&gt;When visually selecting rectangles with &lt;kbd&gt;C-v&lt;/kbd&gt; in &lt;code&gt;evil&lt;/code&gt;, the point is not allowed to pass the end of line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in contrast with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;rectangle-mark-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cua-rectangle-mark-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both of which allow the point to pass the EOL. (Although &lt;code&gt;evil&lt;/code&gt;s behavior is correct &lt;code&gt;vim&lt;/code&gt; emulation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can bring this functionality to evil?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2018-08-07T23:01:15.883" Title="evil rectangles with point past EOL" Tags="|evil|rectangle|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14776" PostTypeId="2" ParentId="14758" CreationDate="2015-08-15T17:12:11.527" Score="20" Body="&lt;p&gt;The variable &lt;code&gt;org-startup-with-inline-images&lt;/code&gt; can be set globally with the following in the &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt; file [the default value is &lt;code&gt;nil&lt;/code&gt;] -- &lt;em&gt;Non-nil means show inline images when loading a new Org file.&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq org-startup-with-inline-images t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;, it can be set locally as described in the doc-string:  &lt;em&gt;This can also be configured on a per-file basis by adding one of the following lines anywhere in the buffer:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: inlineimages&#xA;#+STARTUP: noinlineimages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a link to the manual on this subject:  &lt;a href=&quot;http://orgmode.org/manual/In_002dbuffer-settings.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/In_002dbuffer-settings.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-08-15T17:12:11.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14777" PostTypeId="1" CreationDate="2015-08-15T17:42:19.783" Score="7" ViewCount="727" Body="&lt;p&gt;How can I set up an org habit that repeats 10 days after completion, but only shows up on the agenda if the next instance is less than 6 days away?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An equivalent way of expressing the same thing: a habit that repeats every 10 days, but does not show up until 4 days after the last completion.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2015-11-18T02:59:23.883" LastActivityDate="2015-11-19T12:16:39.223" Title="Only show an org habit on the agenda a few days into the future" Tags="|org-mode|org-agenda|org-habit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14778" PostTypeId="2" ParentId="14774" CreationDate="2015-08-15T17:43:55.510" Score="0" Body="&lt;p&gt;You can try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-html-quote ()&#xA;  (interactive)&#xA;&#xA;  (save-restriction&#xA;    (save-excursion&#xA;&#xA;      (let (backward-nearest-&amp;lt; backward-nearest-&amp;gt;)&#xA;&#xA;        (save-excursion&#xA;          (search-backward &quot;&amp;lt;&quot;)&#xA;          (setq backward-nearest-&amp;lt; (point)))&#xA;&#xA;        (save-excursion&#xA;          (search-backward &quot;&amp;gt;&quot;)&#xA;          (setq backward-nearest-&amp;gt; (point)))&#xA;&#xA;        (if (&amp;gt; backward-nearest-&amp;lt; backward-nearest-&amp;gt;)&#xA;            (insert &quot;\&quot;\&quot;&quot;)&#xA;          (insert &quot;“”&quot;))))&#xA;&#xA;    (forward-char)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To bind it to quote char of &lt;code&gt;html-mode-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key html-mode-map (kbd &quot;\&quot;&quot;) 'insert-html-quote)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="161" LastEditDate="2015-08-18T08:52:45.333" LastActivityDate="2015-08-18T08:52:45.333" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14779" PostTypeId="2" ParentId="14774" CreationDate="2015-08-15T18:54:04.107" Score="3" Body="&lt;p&gt;It turns out, this is a solved problem. Typopunct is already able to use curvy quotes in text and straight quotes inside tags for a variety of modes. I happen to edit HTML in a mode typopunct doesn't cover out of the box, but that's no problem. See &lt;code&gt;typopunct-mode.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom typopunct-mode-exeptions-alist&#xA;  '((sgml-mode . typopunct-point-in-xml-tag-p)&#xA;    (nxml-mode . typopunct-point-in-xml-tag-p)&#xA;    (html-mode . typopunct-point-in-xml-tag-p))&#xA;  &quot;Alist for mode specific expections.&#xA;&#xA;This alist specifies major mode specific expectional cases when the&#xA;function `typopunct-insert-quotation-mark' should *not* insert&#xA;typographical quotation marks.&#xA;&#xA;Each element is a pair of a major mode (a symbol) and a predicate&#xA;function that should return non nil, when&#xA;`typopunct-insert-quotation-mark' should insert an ASCII `\&quot;'.&quot;&#xA;  :group 'typopunct&#xA;  :type '(alist :key-type symbol :value-type function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Great! Typopunct already has a function to check if it's inside an XML-style angle-bracket tag, and is configured to not insert smart quotes if that's the case while in certain modes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of html-mode, I use web-mode. So, I added the following to my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'typopunct-mode-exeptions-alist &#xA;             '(web-mode . typopunct-point-in-xml-tag-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and everything is right in the world. Remember, kids: it's just elisp, and most of the time the problem you're having is a problem someone else has had before.&lt;/p&gt;&#xA;" OwnerUserId="2277" LastActivityDate="2015-08-15T18:54:04.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14780" PostTypeId="1" CreationDate="2015-08-15T19:24:52.770" Score="-2" ViewCount="2303" Body="&lt;p&gt;It's probably a very basic question, but I am having a hard time finding an answer to it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to make emacs look for a makefile somewhere in the parent directories&#xA;and use it for compilation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun desperately-compile ()&#xA;  &quot;Traveling up the path, find a Makefile and `compile'.&quot;&#xA;  (interactive)&#xA;  (when (locate-dominating-file default-directory &quot;Makefile&quot;)&#xA;  (with-temp-buffer&#xA;    (cd (locate-dominating-file default-directory &quot;Makefile&quot;))&#xA;    (compile &quot;make -k&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and put it in my .emacs file, but I can't figure out how to call it.&#xA;replacing the compile command doesn't seem to work and I'm not sure how to bind a key to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be best to call that function using &quot;M-x compile&quot; or &quot;M-x desperate-compile&quot;, but I am open for suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks. &lt;/p&gt;&#xA;" OwnerUserId="9205" LastEditorUserId="105" LastEditDate="2015-08-15T21:20:22.217" LastActivityDate="2015-08-16T15:09:29.303" Title="how to bind a function defined in my .emacs to a key/other command" Tags="|key-bindings|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14781" PostTypeId="1" AcceptedAnswerId="16419" CreationDate="2015-08-15T20:43:13.517" Score="31" ViewCount="7532" Body="&lt;h1&gt;Code folding in Emacs&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Sometimes I want to fold a block of text. In Vim you have easy folding without fuzz. Without to add any special characters like &quot;markers&quot; or specific regex like &lt;code&gt;{{{&lt;/code&gt;. I would like to select a region and fold it, without messing with the structure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When looking around, it seems there were already questions about code folding in Emacs. Someone said that there was &quot;no perfect solution&quot;. For example, I created a clip of simple codefolding in Vim:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Vim plain folding&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gqPwB.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gqPwB.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;+ Fairly simple, select a region and fold it.&lt;br&gt;&#xA;+ It's persistent. When you kill the buffer/close Vim. And reopen the file, the folds are still there.&lt;br&gt;&#xA;+ You get a highlight bar, to easily see what's folded.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many other folding configurations for Vim. I'm happy with Emacs, but this is one thing that I miss. Other alternatives that I tried, for example HideShow:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;HideShow&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LC52x.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LC52x.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evil's alternative with &lt;code&gt;hide-show minor mode&lt;/code&gt;. I found it unusable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;- I'm not able to select a region and folding it. It folds on code blocks.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;- There's no higlihgting bar or something, to attend you it's folded. You could easily miss it.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;- It's not persistent. If you reopen the file, the folds are gone.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another package, &lt;a href=&quot;https://github.com/magnars/fold-this.elttps://github.com/magnars/fold-this.el&quot; rel=&quot;noreferrer&quot;&gt;Fold this&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Fold this&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/q37ns.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/q37ns.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;- It's a pretty alternative. However, it mess with the indentation, because the text under the fold gets placed next to the fold... (?).&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;- It's able to just visually select the region and fold it. But it breaks the indendation, so the overview gets messed up. Not very handy.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;- There is no higlihgting bar or something, to attend you it's folded. You could easily miss it.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What's the issue?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I would like to replicate how Vim does folding. But when I searched around, it seems it's very hard to do that in Emacs. So I wonder if there something in emacs or its architecture that makes it difficult to replicate this? What are the limits? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="10" LastEditDate="2015-08-15T21:38:08.680" LastActivityDate="2021-03-05T20:28:15.293" Title="How can I replicate Vim's code folding?" Tags="|code-folding|" AnswerCount="3" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="14782" PostTypeId="2" ParentId="14780" CreationDate="2015-08-15T21:20:03.433" Score="3" Body="&lt;p&gt;Your question: &quot;&lt;em&gt;I'm not sure how to bind a key to it&lt;/em&gt;&quot;, IOW, how do you bind a command to a key?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What did you try?  Did you look in the Emacs manual for how to bind a command to a key?  For example: &lt;code&gt;C-h r&lt;/code&gt; to get to the Emacs manual, then &lt;code&gt;i bind TAB&lt;/code&gt; and choose &lt;code&gt;binding-keys&lt;/code&gt;, to get to node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rebinding.html&quot; rel=&quot;nofollow&quot;&gt;Rebinding&lt;/a&gt;. It helps us help you if you tell us what you have already tried.  If you tried using some code to bind the key, show that code, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, here's an example of how to bind command &lt;code&gt;desperately-compile&lt;/code&gt; to key &lt;code&gt;C-o&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-o&quot;) 'desperately-compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to see whether your command actually gets invoked when you hit the key you think you've bound to it, try &lt;code&gt;M-x debug-on-entry RET desperately-compile RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the command is bound to your key then when you hit your key the debugger will open.  Use &lt;code&gt;M-x cancel-debug-on-entry RET&lt;/code&gt; to cancel this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can alternatively add a call to function &lt;code&gt;message&lt;/code&gt; at the beginning of your command code. But as you said that you &quot;found&quot; that code somewhere maybe you don't want to fiddle with it yet.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, this is an answer to your question, which is &lt;strong&gt;how to bind a key to a command&lt;/strong&gt;.  As to whether your command &quot;works&quot;, and if not, why not: please post that as a separate question.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Suggestion: Read some of the Emacs manual. Or follow the Emacs tutorial. You will be glad to have some introductory understanding of things.  And if you are going to be writing Lisp code then check out the manual &lt;code&gt;Emacs Lisp Intro&lt;/code&gt;, which you can get to by &lt;code&gt;C-h i&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-16T15:09:29.303" LastActivityDate="2015-08-16T15:09:29.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14783" PostTypeId="1" CreationDate="2015-08-16T09:55:24.743" Score="2" ViewCount="119" Body="&lt;p&gt;I use org mode and its capture functionality for capturing notes and tasks on the go. My capture code looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates '((&#xA;     &quot;n&quot;                                ; key&#xA;     &quot;Make a note in p.abc.org &quot;        ; description&#xA;     entry                              ; type&#xA;     (file+headline &quot;p.abc.org&quot; &quot;logg&quot;) ; target&#xA;     &quot;* %^{Note} :NOTE:          \n%?&quot;  ; template&#xA;     :prepend t                         ; properties&#xA;     :empty-lines 1                     ; properties )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This produces a note headline with the tagg &quot;NOTE&quot; if I call the function with &lt;code&gt;C-c c n&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem arises if I want to use a taggs starting with a &quot;%&quot; sign. Hence, if I change the template line above to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;* %^{Note} :%NOTE:          \n%?&quot;  ; template&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following error message: &lt;code&gt;&quot;Capture abort: (void-variable v-N)&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I change the code to make capture accept &lt;code&gt;%&lt;/code&gt; signs in the beginning of tags?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any help :)&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="10" LastEditDate="2015-08-16T11:32:48.833" LastActivityDate="2015-08-16T11:32:48.833" Title="How can I make Org mode's capture functionality accept tags starting with '%'?" Tags="|org-capture|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14784" PostTypeId="2" ParentId="14753" CreationDate="2015-08-16T10:37:56.783" Score="5" Body="&lt;p&gt;I added this to my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun recursive-load-dir-settings (currentfile)&#xA;  (let ((lds-dir (locate-dominating-file currentfile &quot;settings.el&quot;)))&#xA;  (when lds-dir&#xA;      (progn&#xA;        (load-file (concat lds-dir &quot;settings.el&quot;))&#xA;        (recursive-load-dir-settings (file-truename(concat lds-dir &quot;..&quot;)))))))&#xA;&#xA;(defun load-dir-settings()&#xA;  (interactive)&#xA;  (when buffer-file-name&#xA;    (recursive-load-dir-settings buffer-file-name)))&#xA;&#xA;(add-hook 'find-file-hook 'load-dir-settings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This loads the file &lt;code&gt;settings.el&lt;/code&gt; in the current file's directory. It then continues searching for &lt;code&gt;settings.el&lt;/code&gt; upwards in the directory tree, until no more such files can be found (just like .dir-locals.el).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This loads and runs the settings files without a security prompt&lt;/strong&gt;, so you need to be sure that you are the only one who can put such files in the directory tree. If you still want the prompt, it could of course be added without using the &lt;em&gt;customize&lt;/em&gt; mechanic, so your &lt;code&gt;init.el&lt;/code&gt; could stay clean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example for &lt;code&gt;settings.el&lt;/code&gt; might look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-local-variable 'my-pw)&#xA;(setq my-pw &quot;passw0rd A&quot;)&#xA;(message &quot;Loaded super-secret password for project A&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7004" LastActivityDate="2015-08-16T10:37:56.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14785" PostTypeId="1" CreationDate="2015-08-16T11:30:16.083" Score="4" ViewCount="1264" Body="&lt;p&gt;I've got auto-complete package working for functions for *.R files, but now I'm struggling with auto-complete for file paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've bound the &quot;TAB&quot; key to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;TAB&quot;) 'ac-complete-filename)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it does work after &quot;/&quot; symbol as suggested &lt;a href=&quot;http://auto-complete.org/doc/manual.html#ac-source-filename&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. However it works only on new line. As in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it does not work from within a function such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;read.table(&quot;/...&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Placing pointer after &quot;/&quot; when anything precedes it does not do anything.&#xA;Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing binding to ess-mode instead of global fixed it. Why? No idea...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ess-mode-map (kbd &quot;TAB&quot;) 'ac-complete-filename)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9210" LastEditorUserId="9210" LastEditDate="2015-08-16T12:17:48.233" LastActivityDate="2017-01-13T14:09:49.170" Title="Auto-complete file path on ESS R-mode" Tags="|auto-complete-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14786" PostTypeId="5" CreationDate="2015-08-16T14:02:21.303" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/IPython&quot; rel=&quot;nofollow&quot;&gt;IPython&lt;/a&gt; provides an architecture for interactive computing with &lt;a href=&quot;/questions/tagged/python&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;python&amp;#39;&quot; rel=&quot;tag&quot;&gt;python&lt;/a&gt; featuring:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Interactive shells (terminal and &lt;a href=&quot;http://ipython.org/ipython-doc/stable/interactive/qtconsole.html&quot; rel=&quot;nofollow&quot;&gt;Qt-based&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;A browser-based &lt;a href=&quot;http://ipython.org/notebook.html&quot; rel=&quot;nofollow&quot;&gt;notebook&lt;/a&gt; with support for code, text, mathematical expressions, inline plots and other rich media.&lt;/li&gt;&#xA;&lt;li&gt;Support for interactive data visualization and use of &lt;a href=&quot;http://ipython.org/ipython-doc/stable/interactive/reference.html#gui-event-loop-support&quot; rel=&quot;nofollow&quot;&gt;GUI toolkits&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Flexible, &lt;a href=&quot;http://ipython.org/ipython-doc/stable/interactive/reference.html#embedding-ipython&quot; rel=&quot;nofollow&quot;&gt;embeddable&lt;/a&gt; interpreters to load into your own projects.&lt;/li&gt;&#xA;&lt;li&gt;Easy to use, high performance tools for &lt;a href=&quot;http://ipython.org/ipython-doc/stable/parallel/parallel_intro.html&quot; rel=&quot;nofollow&quot;&gt;parallel computing&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is available for both python-2.x and python-3.x.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ipython.org/&quot; rel=&quot;nofollow&quot;&gt;Homepage&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/ipython/ipython&quot; rel=&quot;nofollow&quot;&gt;Development site (GitHub)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://nbviewer.ipython.org/&quot; rel=&quot;nofollow&quot;&gt;Gallery of IPython notebooks&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2015-08-16T15:51:24.727" LastActivityDate="2015-08-16T15:51:24.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14787" PostTypeId="4" CreationDate="2015-08-16T14:02:21.303" Score="0" Body="IPython is an interactive shell for Python." OwnerUserId="45" LastEditorUserId="105" LastEditDate="2015-08-16T15:21:31.993" LastActivityDate="2015-08-16T15:21:31.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14788" PostTypeId="1" AcceptedAnswerId="14789" CreationDate="2015-08-16T15:36:16.037" Score="2" ViewCount="1739" Body="&lt;p&gt;I want to be able to refile tasks and todos not only between different headings within a singel org file, but between headings in several org files. To accomplish this I use the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-refile-targets '(&#xA;   (nil :maxlevel . 2)             ; refile to headings in the current buffer&#xA;   (org-agenda-files :maxlevel .2) ; refile to any of these files&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when trying to refile a task with the key  &lt;code&gt;C-c C-w&lt;/code&gt; I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;Wrong type argument: numberp, (0.2)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is wrong with my code? or is something else lacking?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="8348" LastEditDate="2015-08-16T20:18:51.457" LastActivityDate="2015-08-16T20:18:51.457" Title="Org mode: refile to other files does not work" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14789" PostTypeId="2" ParentId="14788" CreationDate="2015-08-16T15:37:25.953" Score="5" Body="&lt;p&gt;You probably need a space between the &lt;code&gt;.&lt;/code&gt; and the &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-08-16T15:37:25.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14790" PostTypeId="1" AcceptedAnswerId="14829" CreationDate="2015-08-16T16:33:24.253" Score="2" ViewCount="825" Body="&lt;p&gt;I use the following capture code for making notes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates '((&#xA;     &quot;n&quot;                                         ; key&#xA;     &quot;Add a note to abc.org file &quot;               ; description &#xA;     entry                                       ; type&#xA;     (file+headline &quot;p.abc.org&quot; &quot;logg&quot;)          ; target&#xA;     &quot;* %^{Logg}  :NOTE: %(org-set-tags)  \n%?&quot;  ; template&#xA;     :prepend t                                  ; properties&#xA;     :empty-lines 1                              ; propertiesc&#xA;     )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The template line consists of two sources of tags to the note. (1) I want all notes to be tagged with &quot;:NOTE:&quot;, therefor this tag is written directly into the target line. (2) in addition I want to chose tags from my tags list by means of the function &lt;code&gt;org-set-tags&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I chose the tag &lt;code&gt;:FAMILY:&lt;/code&gt; from my tagg list, the note heading end up looking like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Note about something :NOTE: :FAMILY:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case only :FAMILY: is behaving as a tag (shown in bold in the headline). How can I change the target line so that the heading line will look like this: ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Note about something :NOTE:FAMILY:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the two tags are collected into the single group :NOTE:FAMILY: and both function as tags? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not help to remove the space between &lt;code&gt;:NOTE:&lt;/code&gt; and &lt;code&gt;%(org-set-tags)&lt;/code&gt; in the target file, because the org-set-tags function insert spaces befor entering the tags you chose from you tags list.&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="2274" LastEditDate="2015-08-18T01:10:26.953" LastActivityDate="2015-08-18T11:03:09.083" Title="How to group together tags in a headlines made by org-capture?" Tags="|org-mode|org-capture|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14792" PostTypeId="1" AcceptedAnswerId="14793" CreationDate="2015-08-16T17:24:50.047" Score="2" ViewCount="323" Body="&lt;p&gt;Assume that I have defined a function like below with some keybinding (e.g.&lt;code&gt;M-p&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo () (interactive)&#xA;(insert &quot;something very long&quot;) )&#xA;&#xA;&#xA;(global-set-key [(meta p)] 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I hit &lt;code&gt;M-p&lt;/code&gt; while the cursor is at the main buffer, of course the text &lt;code&gt;something very long&lt;/code&gt; is inserted. But when the cursor is at mini-buffer by hitting &lt;code&gt;M-p&lt;/code&gt; the text &lt;code&gt;foo&lt;/code&gt; is inserted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to redefine this function in such a way to work in both main buffer and mini-buffer?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-16T17:28:42.653" LastActivityDate="2015-08-16T18:22:06.240" Title="How to use the inserting commands/functions in the mini-buffer?" Tags="|minibuffer|insert|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14793" PostTypeId="2" ParentId="14792" CreationDate="2015-08-16T18:22:06.240" Score="4" Body="&lt;p&gt;The reason it doesn't work is: (a) the minibuffer has its own local keymap, (b) &lt;code&gt;M-p&lt;/code&gt; is bound in that local map to a different command, and (c) a local keymap takes precedence over the global keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To have your command work for &lt;code&gt;M-p&lt;/code&gt; in the minibuffer, you need to bind it to &lt;code&gt;M-p&lt;/code&gt; in one or more of the minibuffer keymaps.  It is probably sufficient to bind it in keymap &lt;code&gt;minibuffer-local-map&lt;/code&gt;, where it will be inherited by the other minibuffer keymaps:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key minibuffer-local-map (kbd &quot;M-p&quot;) 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html&quot; rel=&quot;nofollow&quot;&gt;Text from Minibuffer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-16T18:22:06.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14794" PostTypeId="2" ParentId="14681" CreationDate="2015-08-16T22:01:22.947" Score="34" Body="&lt;p&gt;Press S-ENTER in the first column after having put in '1' or another number and it will auto-increment in a new row. Not quite as clever as a formula, but is easier (for me) to remember.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2015-08-16T22:01:22.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14795" PostTypeId="2" ParentId="14762" CreationDate="2015-08-16T23:46:31.940" Score="1" Body="&lt;p&gt;Here's a non-interactive way to do it:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun auto-org-refile-helper ()&#xA;  (insert &quot;''&quot;)&#xA;  (remove-hook 'post-command-hook #'helm-helm-commands-helper))&#xA;&#xA;(defun auto-org-refile ()&#xA;  (interactive)&#xA;  (add-hook 'post-command-hook #'helm-helm-commands-helper)&#xA;  (call-interactively #'org-refile))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd love to see a less hacky method, but I doubt you will find one that works interactively.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-08-16T23:54:13.890" LastActivityDate="2015-08-16T23:54:13.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14796" PostTypeId="2" ParentId="2387" CreationDate="2015-08-17T02:24:59.157" Score="1" Body="&lt;pre&gt;&lt;code&gt;(setq browse-url-generic-program&#xA;      (cond&#xA;       ((eq window-system 'mac) &quot;open&quot;) ; mac&#xA;       ((or (eq system-type 'gnu/linux) (eq system-type 'linux)) ; linux&#xA;        (executable-find &quot;firefox&quot;))&#xA;       ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-08-17T02:24:59.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14797" PostTypeId="2" ParentId="14040" CreationDate="2015-08-17T02:37:32.537" Score="0" Body="&lt;p&gt;company-mode implemented the popup UI in shell. You can use company-mode instead if you are seeking an auto-complete alternative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested in elisp coding, check company-tooltip-xxxx in company.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all you want is a simple popup working in shell, check &lt;a href=&quot;https://github.com/auto-complete/popup-el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/auto-complete/popup-el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-08-17T02:37:32.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14798" PostTypeId="2" ParentId="14766" CreationDate="2015-08-17T03:04:01.643" Score="0" Body="&lt;p&gt;By default, Emacs will install a command line program &lt;code&gt;etags&lt;/code&gt; which could be used by manually running cli &lt;code&gt;find -name *.c | etags -&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Create-Tags-Table.html#Create-Tags-Table&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Create-Tags-Table.html#Create-Tags-Table&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it has nothing to do with Emacs in this case. It's XCode installer who changed the link destination of &quot;/usr/bin/ctags&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution 1:&#xA;Change the link back by &lt;code&gt;sudo ln -s /where-the-ctags-exists/ctags /usr/bin/ctags&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution 2:&#xA;Modify the environment variable PATH instead. Insert below code into ~/.bash_profile,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;export path=/where-the-ctags-exists:$PATH&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-06-12T11:45:29.090" LastActivityDate="2016-06-12T11:45:29.090" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14799" PostTypeId="2" ParentId="14522" CreationDate="2015-08-17T04:18:17.710" Score="2" Body="&lt;p&gt;The following analysis/example applies to *nix operating systems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eshell/rm&lt;/code&gt; and &lt;code&gt;eshell/ls&lt;/code&gt; are &lt;code&gt;elisp&lt;/code&gt; implementations of &lt;code&gt;rm&lt;/code&gt; and &lt;code&gt;ls&lt;/code&gt;.  They do &lt;em&gt;not&lt;/em&gt; control the functionality of completions within &lt;code&gt;eshell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;pcomplete/rm&lt;/code&gt; within &lt;code&gt;pcmpl-unix.el&lt;/code&gt; uses &lt;code&gt;pcomplete-all-entries&lt;/code&gt; instead of &lt;code&gt;pcomplete-entries&lt;/code&gt;.  The difference is that the former let-binds as &lt;code&gt;nil&lt;/code&gt; the variables &lt;code&gt;pcomplete-file-ignore&lt;/code&gt; and &lt;code&gt;pcomplete-dir-ignore&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the user loads the module &lt;code&gt;em-cmpl&lt;/code&gt;, then &lt;code&gt;pcomplete-file-ignore&lt;/code&gt; is set &lt;em&gt;locally&lt;/em&gt; to the value of &lt;code&gt;eshell-cmpl-file-ignore&lt;/code&gt; and &lt;code&gt;pcomplete-dir-ignore&lt;/code&gt; is set &lt;em&gt;locally&lt;/em&gt; to the value of &lt;code&gt;eshell-cmpl-dir-ignore&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the original poster has not specified whether the library/module &lt;code&gt;em-cmpl&lt;/code&gt; has been loaded, the following example simply hard-codes the value for &lt;code&gt;pcomplete-file-ignore&lt;/code&gt; and &lt;code&gt;pcomplete-dir-ignore&lt;/code&gt;.  As alluded to above, we want to be able to take advantage of the variables to ignore files and directores -- so we use &lt;code&gt;pcomplete-entries&lt;/code&gt; &lt;em&gt;instead of&lt;/em&gt; &lt;code&gt;pcomplete-all-entries&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'pcmpl-unix)&#xA;&#xA;(defun pcomplete/rm ()&#xA;  &quot;Completion for `rm'.&quot;&#xA;  (let* (&#xA;      (pcomplete-file-ignore nil)&#xA;      (pcomplete-dir-ignore &quot;^../$\\|^./$&quot;)&#xA;      (pcomplete-help &quot;(fileutils)rm invocation&quot;))&#xA;    (pcomplete-opt &quot;dfirRv&quot;)&#xA;    (while (pcomplete-here (pcomplete-entries) nil 'expand-file-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-08-17T05:00:54.070" LastActivityDate="2015-08-17T05:00:54.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14800" PostTypeId="2" ParentId="14684" CreationDate="2015-08-17T07:31:10.983" Score="3" Body="&lt;p&gt;I modified the screenshot function to adapt to take a screenshot in &lt;code&gt;Org-capture&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-insert-clipboard (&amp;amp;optional caption)&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((image-dir&#xA;      (if (not (buffer-file-name))&#xA;          (let ((buffer-name (replace-regexp-in-string &quot;CAPTURE-[0-9-]*&quot; &quot;&quot; (buffer-name))))&#xA;        (concat (file-name-directory (buffer-file-name (get-file-buffer buffer-name))) &quot;images&quot;))&#xA;        &quot;images&quot;)))&#xA;    (unless (file-exists-p image-dir)&#xA;      (make-directory image-dir))&#xA;    (let* ((image-file (concat image-dir &quot;/&quot; (format-time-string &quot;%Y%m%d_%H%M%S&quot;) &quot;.png&quot;))&#xA;       (exit-status &#xA;        (call-process&quot;convert&quot; nil nil nil &#xA;             &quot;clipboard:&quot; image-file)))&#xA;      (if caption&#xA;      (insert (format &quot;#+CAPTION: %s label:fig:%s\n&quot; (read-input &quot;Caption: &quot;) (read-input &quot;label: &quot;))))&#xA;      (org-insert-link nil (concat&quot;file:&quot;image-file) &quot;&quot;)&#xA;      (org-display-inline-images))))&#xA;&#xA;(bind-key &quot;C-S-y&quot; 'org-insert-clipboard)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-08-17T08:00:01.137" LastActivityDate="2015-08-17T08:00:01.137" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14801" PostTypeId="1" AcceptedAnswerId="14806" CreationDate="2015-08-17T09:05:34.363" Score="9" ViewCount="1211" Body="&lt;p&gt;I'm using GNUS to read my emails. Is there some way to make it automatically&#xA;check my mail box and report new mails somehow? Maybe some package exists to&#xA;do this sort of thing?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-08-17T11:47:03.663" Title="How to make Emacs check my email and report new mail" Tags="|gnus|email|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14802" PostTypeId="1" AcceptedAnswerId="14803" CreationDate="2015-08-17T10:10:59.983" Score="17" ViewCount="961" Body="&lt;p&gt;If I'm working in a directory with its own &lt;code&gt;TAGS&lt;/code&gt; file, and then I move to another directory, with its own &lt;code&gt;TAGS&lt;/code&gt; file, I always get asked this question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Keep current list of tags tables also? (y or n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I never want to bring the list of tags tables with me between directories, so I'd like to default the answer to this question to &lt;code&gt;n&lt;/code&gt;, how can I do that?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2015-08-17T10:13:34.327" Title="Never &quot;Keep current list of tags tables also&quot;" Tags="|ctags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14803" PostTypeId="2" ParentId="14802" CreationDate="2015-08-17T10:13:34.327" Score="22" Body="&lt;p&gt;aha!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tags-add-tables nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;seems to do the trick&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2015-08-17T10:13:34.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14804" PostTypeId="1" AcceptedAnswerId="14805" CreationDate="2015-08-17T11:20:53.643" Score="0" ViewCount="189" Body="&lt;p&gt;I'm trying to write some Emacs Lisp. But I stumble on one thing. &#xA;The code is structured as following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;    (interactive)&#xA;    (if (yes-or-no-p &quot;Do you want to call the function bar?&quot;)&#xA;        (progn &#xA;            'bar&#xA;            ))&#xA;            )&#xA;&#xA;&#xA;(defun bar (string)&#xA;  (interactive &quot;sType your input here? &quot;)&#xA;  (message string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Okay, when the user confirms the question, the function bar will be called. But nothing happens when I press &lt;kbd&gt;y&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When reading the Elisp cookbooks and tutorials, they all says that &lt;code&gt;yes-or-no-p&lt;/code&gt; functions returns a true when the user confirmed it.&#xA;And the &lt;code&gt;if&lt;/code&gt; is structured as following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;COND THEN ELSE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the second argument should be calling since &lt;code&gt;yes-or-no-p&lt;/code&gt; evaluates to true. Since this seems not the case, I'm missing something?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-08-17T11:24:35.320" Title="How call a function, when the user confirms the question?" Tags="|elisp|functions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14805" PostTypeId="2" ParentId="14804" CreationDate="2015-08-17T11:24:35.320" Score="2" Body="&lt;p&gt;To call &lt;code&gt;bar&lt;/code&gt;, use &lt;code&gt;(bar &quot;string&quot;)&lt;/code&gt; or &lt;code&gt;(call-interactively 'bar)&lt;/code&gt; depending on how you want to specify the argument of &lt;code&gt;bar&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-17T11:24:35.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14806" PostTypeId="2" ParentId="14801" CreationDate="2015-08-17T11:47:03.663" Score="8" Body="&lt;p&gt;You'll want to look at &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Daemons.html&quot;&gt;Gnus Demon&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;gnus-demon.el&lt;/code&gt; you'll probably want &lt;code&gt;gnus-demon-scan-mail&lt;/code&gt; or &lt;code&gt;gnus-demon-add-scanmail&lt;/code&gt; [Defaults to 120, 60: Scan every 2 hours if idle for 1 hour].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is probably closer to the standard 5-minute scan on phones/applications:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-demon-add-handler 'gnus-demon-scan-mail 5 t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EmacsWiki has a comparison of &lt;a href=&quot;http://www.emacswiki.org/emacs/GnusNotificationComparison&quot;&gt;Gnus Notifications&lt;/a&gt;, some are for modeline alerts to new email, some are for desktop notifications.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-08-17T11:47:03.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14807" PostTypeId="1" AcceptedAnswerId="14815" CreationDate="2015-08-17T11:57:03.690" Score="0" ViewCount="104" Body="&lt;p&gt;I use &lt;code&gt;ergoemacs&lt;/code&gt; package from MELPA. I've added the following lines from&#xA;official manual to my configuration file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ergoemacs-theme nil)&#xA;(setq ergoemacs-keyboard-layout &quot;us&quot;)&#xA;(require 'ergoemacs-mode)&#xA;(ergoemacs-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can work without problems all day, or every minute see the message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Start ergoemacs command loop&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which blocks Emacs (&lt;kbd&gt;C-g&lt;/kbd&gt; has no effect and other keyboard&#xA;shortcuts too, the only shortcut that works is&#xA;&lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;F4&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs built from source, version 24.5.1&lt;/li&gt;&#xA;&lt;li&gt;OS — Ubuntu 12.04.3&lt;/li&gt;&#xA;&lt;li&gt;Desktop environment — Cinnamon&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How to fix the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My latest .emacs &lt;a href=&quot;http://pastebin.com/2AdBpPFt&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6919" LastEditorUserId="2487" LastEditDate="2015-08-17T15:47:13.507" LastActivityDate="2015-08-17T19:36:31.463" Title="&quot;Start ergoemacs command loop&quot; is blocking Emacs" Tags="|ergoemacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14808" PostTypeId="1" AcceptedAnswerId="14809" CreationDate="2015-08-17T12:20:12.500" Score="0" ViewCount="105" Body="&lt;p&gt;A typical line in a &lt;code&gt;TAGS&lt;/code&gt; file looks like this (note use of special characters &lt;code&gt;^?&lt;/code&gt; and &lt;code&gt;^A&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar copyright-owner user-full-name^?copyright-owner^A213,7296&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and a &lt;code&gt;find-tag-regexp&lt;/code&gt; will search the entire line. But I want to restrict my searches to just the 2nd column, i.e. &lt;code&gt;copyright-owner&lt;/code&gt;. In particular, for this example I want to avoid false positives for searches of &lt;code&gt;user-full-name&lt;/code&gt; from finding this entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I restrict &lt;code&gt;find-tag-regexp&lt;/code&gt; to just the matching part of the line and not the whole line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Format defined in more detail here &lt;a href=&quot;https://en.wikipedia.org/wiki/Ctags#Etags_2&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Ctags#Etags_2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="5142" LastEditDate="2015-08-17T12:36:45.520" LastActivityDate="2015-12-16T07:32:23.407" Title="How to restrict find-tag-regexp to search only the symbol part of TAGS" Tags="|ctags|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14809" PostTypeId="2" ParentId="14808" CreationDate="2015-08-17T12:53:55.727" Score="0" Body="&lt;p&gt;ouch, it looks like &lt;code&gt;find-tag&lt;/code&gt; explicitly only searches the first column and never looks at the tag itself. That's nasty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;etags-tags-completion-table&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; This monster regexp matches an etags tag line.&#xA;  ;;   \1 is the string to match;&#xA;  ;;   \2 is not interesting;&#xA;  ;;   \3 is the guessed tag name; XXX guess should be better eg DEFUN&#xA;  ;;   \4 is not interesting;&#xA;  ;;   \5 is the explicitly-specified tag name.&#xA;  ;;   \6 is the line to start searching at;&#xA;  ;;   \7 is the char to start searching at.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To bypass this issue entirely, I now use etags-select.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="5142" LastEditDate="2015-12-16T07:32:23.407" LastActivityDate="2015-12-16T07:32:23.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14811" PostTypeId="1" CreationDate="2015-08-17T15:15:12.073" Score="8" ViewCount="6448" Body="&lt;p&gt;Using emacs 24, when I try to use the &lt;a href=&quot;https://github.com/jaypei/emacs-neotree&quot; rel=&quot;noreferrer&quot;&gt;Neotree&lt;/a&gt; package I am having issues with modifying the fixed-width of the window. I believe I have found the responsible chunk of lisp, but changing the value doesn't seem to help on reload. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom neo-window-width 25&#xA;  &quot;*Specifies the width of the NeoTree window.&quot;&#xA;  :type 'integer&#xA;  :group 'neotree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9217" LastEditorUserId="105" LastEditDate="2015-08-17T15:49:13.793" LastActivityDate="2019-09-06T10:52:22.720" Title="How can I adjust the fixed-width of a Neotree buffer?" Tags="|window|osx|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14812" PostTypeId="1" CreationDate="2015-08-17T15:19:13.793" Score="0" ViewCount="969" Body="&lt;p&gt;Since an emacs upgrade I made a long time ago (or was it when I changed my laptop, or when I changed my Ubuntu release? I can't remember), emacs keeps opening new windows whenever I click into a file link in grep-mode (for example). Before, I had this behavior:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have a window open (window 0)&lt;/li&gt;&#xA;&lt;li&gt;I run a grep command&lt;/li&gt;&#xA;&lt;li&gt;I get a new window, with the grep result (window 1)&lt;/li&gt;&#xA;&lt;li&gt;I select any line in the grep result, and a new buffer is opened in window 0&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Which is what I want: maximum two windows opened, and I get to see around 30 lines per window. Now, instead, I get:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have a window open (window 0)&lt;/li&gt;&#xA;&lt;li&gt;I run a grep command&lt;/li&gt;&#xA;&lt;li&gt;I get a new window, with the grep result (window 1)&lt;/li&gt;&#xA;&lt;li&gt;I select any line in the grep result, a new buffer is opened in a &lt;em&gt;new window&lt;/em&gt; (window 3). The windows have 30, 15, and 15 lines.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So now I have 3 windows instead of 2, with too few lines. This happens again, until a maximum of 4 open windows. To keep my windows at a minimum height, I need to keep on manually closing windows, which is very annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess this has to do with the minimum height of the window, and how many lines the frame has, but I am unable to find the exact settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell emacs to open at most 2 windows in the active frame?&lt;/p&gt;&#xA;" OwnerUserId="9216" LastEditorUserId="105" LastEditDate="2016-11-12T02:49:06.710" LastActivityDate="2016-11-12T02:49:06.710" Title="Avoid creating a new window" Tags="|window|frames|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14813" PostTypeId="2" ParentId="798" CreationDate="2015-08-17T18:57:16.833" Score="2" Body="&lt;p&gt;One more option using QuickTime player (it works on OSX, I don't know on Windows). Requisites are: &lt;code&gt;ffmpeg&lt;/code&gt; and &lt;code&gt;gifsicle&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Open QuickTime and start File -&gt; New Screen Recording&lt;/li&gt;&#xA;&lt;li&gt;When finish File -&gt; Export -&gt; As Movie with option &lt;strong&gt;full quality&lt;/strong&gt; &lt;/li&gt;&#xA;&lt;li&gt;Now convert your screen cast with this command:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;ffmpeg -i yourscreen.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 &amp;gt; out.gif&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5202" LastActivityDate="2015-08-17T18:57:16.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14814" PostTypeId="2" ParentId="13248" CreationDate="2015-08-17T19:28:02.123" Score="2" Body="&lt;p&gt;I wrote &lt;code&gt;EmacsPortable.App&lt;/code&gt;, and I must say that having a portable that works under every variant of Linux is quite daunting. The current script actually compiles the linux executables under each system.  I would say keep the configuration mobile and hope that the Linux variant you use is compatible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would have to compile everything statically, including &lt;code&gt;libstdc&lt;/code&gt; and &lt;code&gt;glibc&lt;/code&gt;.  Some aren't compatible with certain architectures, and have different options enabled on many distros so the static executables are difficult to build portably.  I'm not saying its impossible, it just something I haven't figured out how to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://sagargv.blogspot.com/2014/09/on-building-portable-linux-binaries.html&quot; rel=&quot;nofollow&quot;&gt;this blog post&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="9222" LastEditorUserId="253" LastEditDate="2015-08-19T10:58:41.217" LastActivityDate="2015-08-19T10:58:41.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14815" PostTypeId="2" ParentId="14807" CreationDate="2015-08-17T19:36:31.463" Score="2" Body="&lt;p&gt;The problem was fixed.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The comments above are asking why ergoemacs-mode reimpliments the command loop.  The bug states what the ergoemacs-mode command loop does.  It also shows how to turn it off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as low-quality code, I'm unsure what @Mark means by that.  However, there are a suite of tests to make sure the functionality is preserved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do see the arbitrary nature of the 20 cut-off.  I personally don't use this function and agree this is arbitrary. I have updated the master code base to remove this.  I should probably look at some of the legacy code and make sure it makes sense.&lt;/p&gt;&#xA;" OwnerUserId="9222" LastActivityDate="2015-08-17T19:36:31.463" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14816" PostTypeId="2" ParentId="13248" CreationDate="2015-08-17T19:45:26.067" Score="0" Body="&lt;p&gt;Portability entails many things, speed, size, ease of installation, compatibility, and such come to mind first. Tweaking standard emacs into portability is one approach. Another is to use an alternate like &lt;a href=&quot;https://www.gnu.org/software/zile/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Zile&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;GNU Zile is a text editor development kit, so that you can (relatively) quickly develop your own ideal text editor without reinventing the wheel for many of the common algorithms and data-structures needed to do so.&lt;/p&gt;&#xA;&lt;p&gt;...implements a subset of Emacs with identical function and variable names, continuing the spirit of the earlier Zile editor implemented in C.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Zile is a single file of about 250 kilobytes and running in a terminal takes no more than 684 kilobytes of memory.&lt;/p&gt;&#xA;&lt;p&gt;Zile's speed is of course unmatched by any other editor.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-17T19:45:26.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14817" PostTypeId="1" AcceptedAnswerId="69927" CreationDate="2015-08-17T20:22:05.747" Score="9" ViewCount="1971" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: how can I control where the &lt;code&gt;org&lt;/code&gt; todo keywords buffer appears?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Entering a &lt;code&gt;todo&lt;/code&gt; keyword with &lt;code&gt;C-c C-t&lt;/code&gt; (&lt;code&gt;org-todo&lt;/code&gt;) opens a new&#xA;buffer with the keyword options and then closes it again after I&#xA;select one.  So far, so good.  However, it takes over another&#xA;window to do so, which is less good, especially since it really&#xA;only needs to display a line or two with the keywords.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, with the following layout, hitting &lt;code&gt;C-c C-t&lt;/code&gt; while in the left&#xA;window (&lt;code&gt;some-org-buffer&lt;/code&gt;) will open &lt;code&gt;*Org todo*&lt;/code&gt; in the right&#xA;window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------------------+---------------------+&#xA;|                     |                     |&#xA;|                     |                     |&#xA;|                     |                     |&#xA;|                     |                     |&#xA;|   some-org-buffer   |  some-other-buffer  |&#xA;|                     |                     |&#xA;|                     |                     |&#xA;|                     |                     |&#xA;|                     |                     |&#xA;+---------------------+---------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, I would like to have a small window pop up as a vertical&#xA;split, as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------------------+---------------------+&#xA;|                     |                     |&#xA;|                     |                     |&#xA;|   some-org-buffer   |  some-other-buffer  |&#xA;|                     |                     |&#xA;|                     |                     |&#xA;+---------------------+                     |&#xA;|                     |                     |&#xA;|     *Org todo*      |                     |&#xA;|                     |                     |&#xA;+---------------------+---------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Cribbing from&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/a/724/253&quot;&gt;this answer&lt;/a&gt;, I wrote a&#xA;function to put in the &lt;code&gt;display-buffer-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-todo-position (buffer alist)&#xA;  (let ((win (car (cl-delete-if-not&#xA;                   (lambda (window)&#xA;                     (with-current-buffer (window-buffer window)&#xA;                       (memq major-mode&#xA;                             '(org-mode org-agenda-mode))))&#xA;                   (window-list)))))&#xA;    (when win&#xA;      (let ((new (split-window win -5 'below)))&#xA;        (set-window-buffer new buffer)&#xA;        new))))&#xA;&#xA;(add-to-list 'display-buffer-alist&#xA;             (list &quot; \\*Org todo\\*&quot; #'dan-org-todo-position))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, that fails to work.  Sigh.  &lt;em&gt;What have I done wrong with&#xA;the &lt;code&gt;display-buffer-alist&lt;/code&gt;?&lt;/em&gt;  More to the point, &lt;strong&gt;how do I get my&#xA;&lt;code&gt;todo&lt;/code&gt; keyword buffer to pop up where I want it?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2021-12-28T20:04:31.073" Title="How to control where the org todo keywords buffer displays?" Tags="|org-mode|elisp|display-buffer-alist|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14818" PostTypeId="2" ParentId="14817" CreationDate="2015-08-17T20:37:16.853" Score="3" Body="&lt;p&gt;Sigh.  I found a &quot;solution,&quot; but it's an ugly one that requires&#xA;overwriting an existing &lt;code&gt;org&lt;/code&gt; function.  I would prefer one that&#xA;does not require modifying the &lt;code&gt;org&lt;/code&gt; source code, but am putting&#xA;the results of my archaeological dig here in case anyone else can&#xA;use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I've noticed in the past with other &lt;code&gt;org&lt;/code&gt; functions,&#xA;&lt;code&gt;org-mode&lt;/code&gt; is rather opinionated about how it handles windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buried deep in the source code of &lt;code&gt;org-todo&lt;/code&gt; is a call to the&#xA;function &lt;code&gt;org-fast-todo-selection&lt;/code&gt;.  That function, in turn, calls&#xA;&lt;code&gt;org-switch-to-buffer-other-window&lt;/code&gt;, whose docstring reads, in part:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Switch to buffer in a second window on the current frame.&#xA;  In particular, &lt;strong&gt;do not allow pop-up frames&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Uh oh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay, I'll bite: let's look at&#xA;&lt;code&gt;org-switch-to-buffer-other-window&lt;/code&gt;.  It uses the &lt;code&gt;org-no-popups&lt;/code&gt;&#xA;macro.  Its docstring reads, in part:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppress popup windows.&#xA;  &lt;strong&gt;Let-bind some variables to nil&lt;/strong&gt; around BODY...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It turns out that &lt;code&gt;display-buffer-alist&lt;/code&gt; is one of the variables&#xA;&lt;code&gt;let&lt;/code&gt;-bound to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;em&gt;Head explodes.&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, we can get it &lt;em&gt;not&lt;/em&gt; to ignore the&#xA;&lt;code&gt;display-buffer-alist&lt;/code&gt; by editing &lt;code&gt;org-fast-todo-selection&lt;/code&gt; and&#xA;replacing the &lt;code&gt;org-switch-to-buffer-other-window&lt;/code&gt; line with plain&#xA;old &lt;code&gt;switch-to-buffer-other-window&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-fast-todo-selection ()&#xA;  &quot;Fast TODO keyword selection with single keys.&#xA;Returns the new TODO keyword, or nil if no state change should occur.&quot;&#xA;  (let* ((fulltable org-todo-key-alist)&#xA;     (done-keywords org-done-keywords) ;; needed for the faces.&#xA;     (maxlen (apply 'max (mapcar&#xA;                  (lambda (x)&#xA;                (if (stringp (car x)) (string-width (car x)) 0))&#xA;                  fulltable)))&#xA;     (expert nil)&#xA;     (fwidth (+ maxlen 3 1 3))&#xA;     (ncol (/ (- (window-width) 4) fwidth))&#xA;     tg cnt e c tbl&#xA;     groups ingroup)&#xA;    (save-excursion&#xA;      (save-window-excursion&#xA;    (if expert&#xA;        (set-buffer (get-buffer-create &quot; *Org todo*&quot;))&#xA;      ;; (org-switch-to-buffer-other-window (get-buffer-create &quot; *Org todo*&quot;)))&#xA;      (switch-to-buffer-other-window (get-buffer-create &quot; *Org todo*&quot;)))&#xA;    (erase-buffer)&#xA;    (org-set-local 'org-done-keywords done-keywords)&#xA;    (setq tbl fulltable cnt 0)&#xA;    (while (setq e (pop tbl))&#xA;      (cond&#xA;       ((equal e '(:startgroup))&#xA;        (push '() groups) (setq ingroup t)&#xA;        (when (not (= cnt 0))&#xA;          (setq cnt 0)&#xA;          (insert &quot;\n&quot;))&#xA;        (insert &quot;{ &quot;))&#xA;       ((equal e '(:endgroup))&#xA;        (setq ingroup nil cnt 0)&#xA;        (insert &quot;}\n&quot;))&#xA;       ((equal e '(:newline))&#xA;        (when (not (= cnt 0))&#xA;          (setq cnt 0)&#xA;          (insert &quot;\n&quot;)&#xA;          (setq e (car tbl))&#xA;          (while (equal (car tbl) '(:newline))&#xA;        (insert &quot;\n&quot;)&#xA;        (setq tbl (cdr tbl)))))&#xA;       (t&#xA;        (setq tg (car e) c (cdr e))&#xA;        (if ingroup (push tg (car groups)))&#xA;        (setq tg (org-add-props tg nil 'face&#xA;                    (org-get-todo-face tg)))&#xA;        (if (and (= cnt 0) (not ingroup)) (insert &quot;  &quot;))&#xA;        (insert &quot;[&quot; c &quot;] &quot; tg (make-string&#xA;                   (- fwidth 4 (length tg)) ?\ ))&#xA;        (when (= (setq cnt (1+ cnt)) ncol)&#xA;          (insert &quot;\n&quot;)&#xA;          (if ingroup (insert &quot;  &quot;))&#xA;          (setq cnt 0)))))&#xA;    (insert &quot;\n&quot;)&#xA;    (goto-char (point-min))&#xA;    (if (not expert) (org-fit-window-to-buffer))&#xA;    (message &quot;[a-z..]:Set [SPC]:clear&quot;)&#xA;    (setq c (let ((inhibit-quit t)) (read-char-exclusive)))&#xA;    (cond&#xA;     ((or (= c ?\C-g)&#xA;          (and (= c ?q) (not (rassoc c fulltable))))&#xA;      (setq quit-flag t))&#xA;     ((= c ?\ ) nil)&#xA;     ((setq e (rassoc c fulltable) tg (car e))&#xA;      tg)&#xA;     (t (setq quit-flag t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-17T20:37:16.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14819" PostTypeId="1" CreationDate="2015-08-17T21:49:24.920" Score="3" ViewCount="79" Body="&lt;p&gt;I'm using M-x compile to check for compilation errors and it's great. However, I'm wondering if I can get the actual error message to begin on its own line. For some reason the file path shows up as the absolute file path, which is unnecessary IMO (is it possible to change that?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes it so that the error message starts very late in the line and wraps around. I think wrap-around is inevitable with long error messages, but it'd make things much easier to read for me if it would just start on its own line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LJhzZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LJhzZ.png&quot; alt=&quot;emacs error message&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, I'm wondering if I could change this to something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cargo build&#xA;   Compiling diecast v0.0.1 (file:///home/blaenk/code/rust/diecast/diecast)&#xA;/home/blaenk/code/rust/diecast/diecast/src/job/manager.rs:309:53: 309:64&#xA;error: type mismatch resolving `&amp;lt;collections::vec_deque::VecDeque&amp;lt;eventual::future::Future&amp;lt;bind::Bind, Box&amp;lt;std::error::Error + Send + Sync&amp;gt;&amp;gt;&amp;gt; as core::iter::IntoIterator&amp;gt;::Item == bind::Bind`:&#xA; expected struct `eventual::future::Future`,&#xA;    found struct `bind::Bind` [E0271]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="8941" LastEditDate="2015-10-18T19:39:07.600" LastActivityDate="2015-10-18T19:39:07.600" Title="show error message on its own line?" Tags="|compilation-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14820" PostTypeId="1" AcceptedAnswerId="14840" CreationDate="2015-08-17T22:05:12.087" Score="4" ViewCount="311" Body="&lt;p&gt;I configure &lt;code&gt;indent-tabs-mode&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; so that tab characters are used for indentation by default. AUCTeX apparently changes the value of &lt;code&gt;indent-tabs-mode&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; and uses some other system for handling leading indentation, and there are many customization variables in the groups &quot;TeX Indentation&quot; and &quot;LaTeX Indentation&quot;. As far as I've found so far, these variables only allow you to change the number of space characters used for indentation. How can I configure AUCTeX to use tab characters for indentation?&lt;/p&gt;&#xA;" OwnerUserId="6852" LastActivityDate="2015-08-18T18:18:26.920" Title="How can I configure AUCTeX to use tab characters for leading indentation?" Tags="|indentation|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14821" PostTypeId="2" ParentId="14790" CreationDate="2015-08-18T01:15:18.953" Score="1" Body="&lt;p&gt;Instead of using &lt;code&gt;%(org-set-tags)&lt;/code&gt; in the template, use &lt;code&gt;%^g&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-08-18T01:15:18.953" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14822" PostTypeId="1" CreationDate="2015-08-18T02:28:17.167" Score="6" ViewCount="1402" Body="&lt;p&gt;I want to set a different font for &lt;code&gt;org-mode&lt;/code&gt; contents. Strangely, setting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'(org-level-1 ((t (:inherit variable-pitch))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;has the effect on headers as intended. However, setting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'(org-default ((t (:inherit variable-pitch))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;does not impact the text on normal &lt;code&gt;org-mode&lt;/code&gt; text. They're still fixed-width font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;describe-face&lt;/code&gt; on those text, it just says &lt;code&gt;default&lt;/code&gt; instead of &lt;code&gt;org-default&lt;/code&gt;. Not sure if that's the normal behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I manually set font for normal &lt;code&gt;org-mode&lt;/code&gt; content text?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2017-01-17T21:28:34.713" Title="org-default face not having effect" Tags="|org-mode|faces|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14823" PostTypeId="1" AcceptedAnswerId="14825" CreationDate="2015-08-18T02:37:23.110" Score="9" ViewCount="1446" Body="&lt;p&gt;I run Emacs on Mac OSX, I'm trying to switch from &lt;a href=&quot;http://emacsformacosx.com&quot; rel=&quot;noreferrer&quot;&gt;Emacs for Mac OSX&lt;/a&gt; to &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot; rel=&quot;noreferrer&quot;&gt;Emacs Mac Port&lt;/a&gt;. I'm having some trouble with my keybindings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I'm trying to bind command-h to &lt;code&gt;replace-string&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mac-command-modifier 'super)&#xA;(define-key key-minor-mode-map (kbd &quot;s-h&quot;) 'replace-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This didn't work. So I tried binding it as hyper:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-hyper-key &quot;h&quot; 'replace-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that didn't work either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing other keybindings does seem to work (&lt;code&gt;s-o&lt;/code&gt;, &lt;code&gt;s-p&lt;/code&gt;, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may be related: &lt;a href=&quot;https://emacs.stackexchange.com/questions/12998/how-to-bind-hide-others-to-a-key-m-s-h-in-railwaycat-emacs-mac-port&quot;&gt;How to bind &amp;quot;Hide Others&amp;quot; to a key &amp;quot;M-s-h&amp;quot; in railwaycat/emacs-mac-port?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;command-h for &lt;code&gt;replace-string&lt;/code&gt; works on Emacs for Mac OSX, but on Emacs Mac Port, it just hides/minimizes the application window. Do keybindings work differently in Emacs Mac Port than they do on Emacs for Mac OSX? Are some keybindings hardcoded in to Emacs Mac Port, and if so, how can I override them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Looks like others are having the same issue. &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port/issues/78&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/railwaycat/emacs-mac-port/issues/78&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-06-01T04:17:19.737" Title="how to disable command-h hide in Emacs Mac Port (railwaycat)?" Tags="|key-bindings|osx|emacs-mac-port|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14824" PostTypeId="1" AcceptedAnswerId="14886" CreationDate="2015-08-18T03:26:21.173" Score="10" ViewCount="2653" Body="&lt;p&gt;I use &lt;code&gt;variable-pitch-mode&lt;/code&gt; with &lt;code&gt;org&lt;/code&gt; buffers. Normally I set &lt;code&gt;org-block&lt;/code&gt; to &lt;code&gt;fixed-pitch&lt;/code&gt; and the code between &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; and &lt;code&gt;#+END_SRC&lt;/code&gt; are properly rendered as fixed width fonts, also with proper syntax highlighting. However starting from last week, for some reason, although the code block font still had proper syntax highlighting, the face became the same as the &lt;code&gt;variable-pitch-face&lt;/code&gt; as normal org-mode texts. I update my packages periodically and I think an update in &lt;code&gt;org-mode&lt;/code&gt; caused the issue but I'm not sure what happened.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turns out this is actually related to &lt;code&gt;org-block-background&lt;/code&gt; face, which has been removed in org version 8.3.1 in commit &lt;code&gt;f8b42e8&lt;/code&gt;, thus the bug. Not sure if there's a solution yet. &lt;a href=&quot;https://stackoverflow.com/questions/26290924/fontify-r-code-blocks-in-org-mode-8&quot;&gt;https://stackoverflow.com/questions/26290924/fontify-r-code-blocks-in-org-mode-8&lt;/a&gt; &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00510.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00510.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently just locking my org-mode version to the older one.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The newest org-mode release, version 9.0.0, apparently lets &lt;code&gt;src-blocks&lt;/code&gt; inherit &lt;code&gt;org-block&lt;/code&gt; face, while the &lt;code&gt;org-block-background&lt;/code&gt; face becomes obsolete. So now just by setting &lt;code&gt;org-block&lt;/code&gt; face you should be able to have fixed-width fonts for all codes.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="7097" LastEditDate="2016-11-05T02:06:33.783" LastActivityDate="2016-11-05T02:06:33.783" Title="org-block-background font not having effect" Tags="|org-mode|faces|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14825" PostTypeId="2" ParentId="14823" CreationDate="2015-08-18T04:52:44.963" Score="18" Body="&lt;p&gt;I found the answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs Mac Port, &lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;h&lt;/kbd&gt; bypasses any Emacs keybindings and instead sends a &quot;pass command to system&quot; message to Mac OSX, which then hides the entire application. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a vestige of behavior from the old Carbon Emacs. To disable it, use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mac-pass-command-to-system nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://newsgroups.derkeiler.com/Archive/Comp/comp.emacs/2005-11/msg00091.html&quot; rel=&quot;noreferrer&quot;&gt;http://newsgroups.derkeiler.com/Archive/Comp/comp.emacs/2005-11/msg00091.html&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://comp.emacs.xemacs.narkive.com/dBRWEljn/apple-carbon-emacs-disable-cmd-h-hide&quot; rel=&quot;noreferrer&quot;&gt;http://comp.emacs.xemacs.narkive.com/dBRWEljn/apple-carbon-emacs-disable-cmd-h-hide&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2017-06-01T04:17:19.737" LastActivityDate="2017-06-01T04:17:19.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14826" PostTypeId="1" CreationDate="2015-08-18T08:12:37.870" Score="3" ViewCount="873" Body="&lt;p&gt;When running emacs maximized on my new screen, a black shadow at the bottom, that for normal viewing angles is just a few pixels wide, interfers with the readability of the minibuffer / echo area. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to add some margin at the bottom of the minibuffer / echo area? This would act as a workaround to the problem.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Source of the Issue (cannot be solved)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;My new (glossy) LCD/LED TV shows a pronounced black shadow at the bottom of the screen whose change as I look from a lower or higher angle -- it vanishes when I look vertically at the bottom edge -- makes it look as if there is a visible border behind the plane of the pixels. My guess is that this is caused by a significant (looks like some mm) distance between pixel plane and backlight plane. The same effect appears for my office screens but is much weaker there as they are smaller and matte, so I never noticed it until explicitly looking for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this I conclude that it is (1) an unavoidable property of all (non-IPS?) LCD screens (2) normally not noticable unless abusing a TV as large computer monitor. Therefore I consider the hardware-issue unsolvable and need a workaround.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zJQMR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zJQMR.png&quot; alt=&quot;An attempt to illustrate the problem&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FeHJw.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FeHJw.jpg&quot; alt=&quot;ScreenPhoto&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2308" LastEditorUserId="2308" LastEditDate="2015-08-18T22:42:52.633" LastActivityDate="2015-09-05T13:37:17.620" Title="Add bottom margin to minibuffer / echo area?" Tags="|minibuffer|echo-area|customization|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14827" PostTypeId="2" ParentId="12997" CreationDate="2015-08-18T09:03:35.610" Score="33" Body="&lt;p&gt;All information you need is included in &lt;code&gt;C-h f add-function&lt;/code&gt; which&#xA;describes the underlying mechanism of &lt;code&gt;advice-add&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The new advice system basically acts like replacing the current&#xA;definition of a function by the function described in the table in&#xA;&lt;code&gt;C-h f add-function&lt;/code&gt;, depending on your choice of the &lt;code&gt;WHERE&lt;/code&gt;&#xA;argument, only cleaner for the sake of tracking what behaviour has&#xA;been defined in what source file.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;An example with the &lt;code&gt;:around&lt;/code&gt; option&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The most general case is the &lt;code&gt;:around&lt;/code&gt; option, so I give an example&#xA;for that. (It is probably better to use dedicated &lt;code&gt;WHERE&lt;/code&gt; parameters&#xA;when possible, but you can replace every other by an equivalent&#xA;&lt;code&gt;:around&lt;/code&gt; function).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as an example, lets say you want to debug some use of &lt;code&gt;find-file&lt;/code&gt;&#xA;and want to &lt;code&gt;print&lt;/code&gt; its argument list every time it is called. You&#xA;could write&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-find-file-advice-print-arguments (old-function &amp;amp;rest arguments)&#xA;  &quot;Print the argument list every time the advised function is called.&quot;&#xA;  (print arguments)&#xA;  (apply old-function arguments))&#xA;&#xA;(advice-add #'find-file :around #'my-find-file-advice-print-arguments)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this new implementation, everything the advice needs is passed as&#xA;argument. &lt;code&gt;ad-get-args&lt;/code&gt; becomes unnecessary, because the arguments are&#xA;passed to the advice function as normal function arguments (for&#xA;&lt;code&gt;WHERE&lt;/code&gt; arguments for which it makes sense). &lt;code&gt;ad-do-it&lt;/code&gt; becomes&#xA;unnecessary as &lt;code&gt;:around&lt;/code&gt; advice gets as arguments the function and the&#xA;arguments, so &lt;code&gt;(ad-do-it)&lt;/code&gt; is replaced by the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply old-function arguments)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or when you have named the arguments &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall old-function first-arg second-arg)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is cleaner as there are no magic forms involved. Modifying the&#xA;arguments simply happens by passing modified values to &lt;code&gt;OLD-FUNCTION&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Other &lt;code&gt;WHERE&lt;/code&gt; values&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The docstring of &lt;code&gt;add-function&lt;/code&gt; contains a table of all advice places (or &quot;combinators&quot;),&#xA;and what they are equivalent to, and explains the functionality in&#xA;terms of a &lt;code&gt;lambda&lt;/code&gt; behaving equivalent to the advised function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`:before'       (lambda (&amp;amp;rest r) (apply FUNCTION r) (apply OLDFUN r))&#xA;`:after'        (lambda (&amp;amp;rest r) (prog1 (apply OLDFUN r) (apply FUNCTION r)))&#xA;`:around'       (lambda (&amp;amp;rest r) (apply FUNCTION OLDFUN r))&#xA;`:override'     (lambda (&amp;amp;rest r) (apply FUNCTION r))&#xA;`:before-while' (lambda (&amp;amp;rest r) (and (apply FUNCTION r) (apply OLDFUN r)))&#xA;`:before-until' (lambda (&amp;amp;rest r) (or  (apply FUNCTION r) (apply OLDFUN r)))&#xA;`:after-while'  (lambda (&amp;amp;rest r) (and (apply OLDFUN r) (apply FUNCTION r)))&#xA;`:after-until'  (lambda (&amp;amp;rest r) (or  (apply OLDFUN r) (apply FUNCTION r)))&#xA;`:filter-args'  (lambda (&amp;amp;rest r) (apply OLDFUN (funcall FUNCTION r)))&#xA;`:filter-return'(lambda (&amp;amp;rest r) (funcall FUNCTION (apply OLDFUN r)))&#xA;&#xA;(cited from `C-h f add-function')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where FUNCTION is the advice function and OLDFUN the function where&#xA;the advice is added. Don't try to understand all of them at once, just&#xA;select a &lt;code&gt;WHERE&lt;/code&gt; symbol that sounds fitting and try to understand that&#xA;one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or just use &lt;code&gt;:around&lt;/code&gt;. As far as I can tell the only advantage of&#xA;using specialized &lt;code&gt;WHERE&lt;/code&gt;s over &lt;code&gt;:around&lt;/code&gt; for everything is that you&#xA;get a bit more information from looking up &lt;code&gt;C-h f ADVISED-FUNCTION&lt;/code&gt;&#xA;prior to reading the docstring of the advice. Unless you plan to&#xA;publish the code containing the advice it probably doesn't matter.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Named advice functions&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I recommend using named functions as advice since it provides many&#xA;advantages (some of them also apply to using named functions for hooks): &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It shows up in &lt;code&gt;C-h f find-file&lt;/code&gt; as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:around advice: `my-find-file-advice-print-arguments'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;linking to the definition of the advice function, which as usual&#xA;contains a link to the file where it was defined . If the advice&#xA;had been defined as a &lt;code&gt;lambda&lt;/code&gt; form directly in the &lt;code&gt;advice-add&lt;/code&gt;&#xA;form the docstring would be shown inline (a mess for long&#xA;docstrings?) and nothing would indicate where it was defined. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can remove the advice with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-remove #'find-file #'my-find-file-advice-print-arguments)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can update the definition of the advice without rerunning&#xA;&lt;code&gt;advice-add&lt;/code&gt; or risking to keep the old version active (as running&#xA;&lt;code&gt;advice-add&lt;/code&gt; with a changed &lt;code&gt;lambda&lt;/code&gt; will be recognized as new&#xA;advice, not as an update to the old one). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Side remark&lt;/em&gt; The &lt;code&gt;#'function&lt;/code&gt; notation is basically equivalent to&#xA; &lt;code&gt;'function&lt;/code&gt;, except that it help the byte compiler identify symbols&#xA; as function names and thus to identify missing functions (e.g. due to&#xA; typos).&lt;/p&gt;&#xA;" OwnerUserId="2308" LastEditorUserId="2162" LastEditDate="2016-04-01T21:02:26.790" LastActivityDate="2016-04-01T21:02:26.790" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14828" PostTypeId="2" ParentId="14708" CreationDate="2015-08-18T10:22:45.960" Score="7" Body="&lt;p&gt;Thanks to @kmicu for the comment to my post. His answer was correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a recent TRAMP issue and worked around by adding&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tramp-ssh-controlmaster-options &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the beginning of my &lt;code&gt;.emacs&lt;/code&gt; file. This &lt;a href=&quot;http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-03/msg00389.html&quot;&gt;email thread&lt;/a&gt; provides the necessary context. &lt;/p&gt;&#xA;" OwnerUserId="9183" LastActivityDate="2015-08-18T10:22:45.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14829" PostTypeId="2" ParentId="14790" CreationDate="2015-08-18T11:03:09.083" Score="2" Body="&lt;p&gt;&lt;code&gt;org-set-tags&lt;/code&gt; won't recognize :NOTE: as a tag, because the heading doesn't exist yet. the following should do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;      `((&quot;n&quot;&#xA;         &quot;Add a note to abc.org file &quot;&#xA;         entry&#xA;         (file+headline &quot;p.abc.org&quot; &quot;logg&quot;)&#xA;         ,(concat &quot;* %^{Logg} &quot;&#xA;                  &quot;%(flet ((org-get-tags-string () \&quot;:NOTE:\&quot;)) (org-set-tags))&quot;&#xA;                  &quot; :NOTE:\n%?&quot;)&#xA;         :prepend t&#xA;         :empty-lines 1&#xA;         )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2015-08-18T11:03:09.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14830" PostTypeId="1" AcceptedAnswerId="14832" CreationDate="2015-08-18T11:51:21.613" Score="9" ViewCount="1807" Body="&lt;p&gt;When you type closing parenthesis (or maybe it works for other paired&#xA;symbols too), and opening parenthesis is not visible on the screen, Emacs&#xA;“jumps” to opening parenthesis to show you where it is. This is very handy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to make period for which opening parenthesis is shown&#xA;shorter (say, half a second). This shouldn't be hard, but the problem is that I don't know what&#xA;this functionality is called, so I cannot search Emacs variables/functions.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="253" LastEditDate="2015-08-18T12:15:25.517" LastActivityDate="2015-08-19T09:09:13.470" Title="How to show matching parenthesis faster?" Tags="|balanced-parentheses|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14831" PostTypeId="2" ParentId="14830" CreationDate="2015-08-18T12:01:49.973" Score="5" Body="&lt;p&gt;Emacs comes with the package &lt;code&gt;show-paren-mode&lt;/code&gt;. Instead of temporarily blinking the corresponding parenthesis when one is written, the parenthesis corresponding to the one under the cursor is highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also other packages with some additional bells and whistles. I prefer &lt;a href=&quot;http://www.emacswiki.org/emacs/mic-paren.el&quot; rel=&quot;nofollow&quot;&gt;mic-paren&lt;/a&gt;. This package is faster and it can highlight both forward and backward at the same time, should the cursor be between parentheses like &lt;code&gt;)(&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-08-19T09:09:13.470" LastActivityDate="2015-08-19T09:09:13.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14832" PostTypeId="2" ParentId="14830" CreationDate="2015-08-18T12:02:26.043" Score="5" Body="&lt;p&gt;I think you want to adjust the parameters for &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Blinking.html&quot;&gt;Blinking Parentheses&lt;/a&gt;.  In particular, you can adjust &lt;code&gt;blink-matching-delay&lt;/code&gt;, which:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This variable specifies the number of seconds to keep indicating the matching parenthesis. A fraction of a second often gives good results, but the default is 1, which works on all systems. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-18T12:02:26.043" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14833" PostTypeId="1" AcceptedAnswerId="14835" CreationDate="2015-08-18T13:45:35.690" Score="6" ViewCount="2527" Body="&lt;p&gt;I have something like below (from the &lt;a href=&quot;https://emacs.stackexchange.com/a/3882/&quot;&gt;answer&lt;/a&gt;) in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'my-latex-hook)&#xA;&#xA;(defun my-latex-hook ()&#xA;  (require 'tex-site)&#xA;  (define-key LaTeX-mode-map &quot;-&quot; (lambda () (interactive) (insert &quot;_&quot;)))&#xA;  (define-key LaTeX-mode-map &quot;_&quot; (lambda () (interactive) (insert &quot;-&quot;)))&#xA;  (define-key LaTeX-mode-map &quot;6&quot; (lambda () (interactive) (insert &quot;^&quot;)))&#xA;  (define-key LaTeX-mode-map &quot;^&quot; (lambda () (interactive) (insert &quot;6&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I byte-compile the init file, there is a message: &lt;code&gt;Warning: reference to free variable LaTeX-mode-map&lt;/code&gt;.  The function works without problem in LaTeX-mode. Should one take this message serious? Is there a better way to write the above function in order to prevent this warning? &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2020-01-18T07:12:25.427" Title="Debugging &quot;Warning: Reference to free variable&quot;" Tags="|variables|byte-compilation|warning|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14834" PostTypeId="2" ParentId="14833" CreationDate="2015-08-18T14:22:44.243" Score="4" Body="&lt;p&gt;If you're going for a single file init, you can add this declare:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar LaTeX-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you have multiple files, like I do, just require &lt;code&gt;tex-site&lt;/code&gt; at top level, see &lt;a href=&quot;https://github.com/abo-abo/oremacs/blob/github/oleh/modes/ora-latex.el&quot; rel=&quot;nofollow&quot;&gt;ora-latex.el&lt;/a&gt;.  What I do is load this always:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'my-latex-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But then &lt;code&gt;my-latex-hook&lt;/code&gt; is an autoloaded function in &lt;code&gt;ora-latex.el&lt;/code&gt;. So the whole file isn't loaded until necessary.  The &lt;code&gt;my-latex-hook&lt;/code&gt; function is usually empty, unless I need to enable some minor modes or set mode-local vars. The &lt;code&gt;define-key&lt;/code&gt; statements are run only once instead of each time a new tex file is opened, which isn't a big deal but it's nice to have.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-08-18T14:22:44.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14835" PostTypeId="2" ParentId="14833" CreationDate="2015-08-18T14:29:11.823" Score="3" Body="&lt;p&gt;What you are doing is safe, because when your hook is executed LaTeX is&#xA;already loaded and &lt;code&gt;LaTeX-mode-map&lt;/code&gt; is defined. Byte compiler cannot know&#xA;that because when it compiles your file LaTeX mode is not loaded and thus&#xA;symbol &lt;code&gt;LaTeX-mode-map&lt;/code&gt; considered free variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from the technique you use, you can use &lt;code&gt;eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'my-file&#xA;  ;; use functions from ‘my-file’ without fear&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want to see the warning you can load file that contains&#xA;&lt;code&gt;LaTeX-mode-map&lt;/code&gt; only when you byte-compile your file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'my-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will not slow down Emacs on startup since &lt;code&gt;my-file&lt;/code&gt; will be loaded only&#xA;when your file is going to be compiled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many people will argue that you shouldn't compile your configuration files,&#xA;though.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-08-18T14:29:11.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14836" PostTypeId="2" ParentId="12269" CreationDate="2015-08-18T15:01:13.457" Score="3" Body="&lt;p&gt;You can also probably&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default electric-pair-inhibit-predicate&#xA;              (lambda (c)&#xA;                (if (looking-at &quot;[ \n\t]&quot;)&#xA;                    (electric-pair-default-inhibit c)&#xA;                    t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Seems a bit more correct in light of the actual question asked.&lt;/p&gt;&#xA;" OwnerUserId="2478" LastActivityDate="2015-08-18T15:01:13.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14837" PostTypeId="1" AcceptedAnswerId="15142" CreationDate="2015-08-18T15:14:53.300" Score="8" ViewCount="1132" Body="&lt;p&gt;I've seen this question a lot. But none of the replies fixed my issue: the minor mode stays on in others modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I have tried:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package stickyfunc-enhance&#xA;  :config&#xA;  ;; (add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)&#xA;  ;; (defun turn-on-semantic () (semantic-mode 1) (require 'stickyfunc-enhance))&#xA;  ;; (add-hook 'python-mode-hook 'turn-on-semantic)&#xA;  (add-hook 'python-mode-hook&#xA;            (lambda ()&#xA;              (add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)&#xA;              (semantic-mode 1)&#xA;              (require 'stickyfunc-enhance))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My issue with those 2 approaches is that &lt;code&gt;semantic-mode&lt;/code&gt; will stay on in all major modes once I visited a Python buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I turn off &lt;code&gt;semantic-mode&lt;/code&gt; in all other modes? Do I have to manually turn it off on &lt;code&gt;prog-mode-hook&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Trying kaushalmodi's solution:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package stickyfunc-enhance&#xA;  :init&#xA;  (add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)&#xA;  :config&#xA;  (defun me/enable-semantic-maybe ()&#xA;    &quot;Maybe enable `semantic-mode'.&quot;&#xA;    (if (derived-mode-p 'python-mode)&#xA;        (lambda ()&#xA;          (semantic-mode 1)&#xA;          (require 'stickyfunc-enhance))&#xA;      (semantic-mode -1)))&#xA;  (add-hook 'change-major-mode-hook #'me/enable-semantic-maybe))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yields me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;Making python-shell-interpreter local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!&#xA;Making python-shell-interpreter-args local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2015-08-18T16:38:20.540" LastActivityDate="2015-08-28T12:34:34.613" Title="How to activate semantic-mode for specific major modes only?" Tags="|hooks|major-mode|minor-mode|semantic-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14838" PostTypeId="1" CreationDate="2015-08-18T15:56:00.497" Score="2" ViewCount="216" Body="&lt;p&gt;I use emacs 24.4 with auto-complete1.5.0 and bundled version of CEDET2.0 (I've also tried with latest CEDET by downloading and loading cedet-devel-load.el). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have qt4 sources installed and semantic in my ac-sources. &#xA;I want it to parse and auto-complete my sources. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following Alex's Ott tuto I put this in my init.el :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'semantic/sb)&#xA;(require 'semantic/ia)&#xA;(require 'semantic/bovine/gcc)&#xA;(require 'semantic/bovine/c)&#xA;&#xA;(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-local-symbol-highlight-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-decoration-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode)&#xA;&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;/usr/include/qt4&quot; . c++-mode))&#xA;(semantic-add-system-include &quot;/usr/include/qt4&quot; 'c++-mode)&#xA;(semantic-add-system-include &quot;/usr/include/qt4/QtGui&quot; 'c++-mode)&#xA;(semantic-add-system-include &quot;/usr/include/qt4/Qt&quot; 'c++-mode)&#xA;&#xA;;(add-to-list 'semantic-lex-c-preprocessor-symbol-file &quot;/usr/include/qt4/Qt/qconfig.h&quot;)&#xA;;(add-to-list 'semantic-lex-c-preprocessor-symbol-file &quot;/usr/include/qt4/Qt/qconfig-dist.h&quot;)&#xA;&#xA;&#xA;(semantic-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But there's nothing to do, I don't get any completions !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- Edit --&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some search I think the problem is that semantic doesn't parse qt sources as it should; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for example, I have :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;QSystemTrayIcon&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I try to complete &quot;QSyst&quot;... I have only one possible completion : QSystemTrayIconPrivate&#xA;So I opened /usr/include/qt4/QtGui/qsystemtrayicon.h to see what's in this file and there is the definition of QSystemTrayIcon class:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Q_GUI_EXPORT QSystemTrayIcon : public QObject&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the definition of QSystemTrayIconPrivate :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class QSystemTrayIconPrivate;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know what this Q_GUI_EXPORT means, I have never seen such construction of class; with root powers, I modified the header to :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class QSystemTrayIcon : public QObject&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then forced semantic to reparse and the completion works for this class now !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I deduce Semantic doesn't understand how qt creates classes,&#xA;it's the same for other such as QApplication, and so on...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to manually edit all qt sources.&#xA;So, is there a way to hack Semantic source code so it can understand this kind of class construction ?&lt;/p&gt;&#xA;" OwnerUserId="9228" LastEditorUserId="9228" LastEditDate="2015-08-22T14:22:34.027" LastActivityDate="2015-08-22T14:22:34.027" Title="Getting autocompletion for qt4 with CEDET" Tags="|emacs24.4|cedet|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14839" PostTypeId="2" ParentId="14837" CreationDate="2015-08-18T16:03:20.377" Score="2" Body="&#xA;&#xA;&lt;p&gt;Looking at the source code in &lt;code&gt;semantic.el&lt;/code&gt;, it looks like &lt;code&gt;semantic-mode&lt;/code&gt; is a &lt;strong&gt;global&lt;/strong&gt; minor mode. So once activated, it will be activated in all the buffers; and once deactivated, it will be deactivated in all.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can probably have something like below that enables semantic mode only when you open a specific mode buffer (&lt;em&gt;but I am not sure how well it will behave when you have buffers open with different major modes&lt;/em&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/enable-semantic-mode-maybe ()&#xA;  (if (derived-mode-p 'python-mode)&#xA;      (semantic-mode 1)&#xA;    (semantic-mode -1)))&#xA;(add-hook 'change-major-mode-hook #'my/enable-semantic-mode-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;semantic.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode semantic-mode&#xA;  &quot;Toggle parser features (Semantic mode).&#xA;With a prefix argument ARG, enable Semantic mode if ARG is&#xA;positive, and disable it otherwise.  If called from Lisp, enable&#xA;Semantic mode if ARG is omitted or nil.&#xA;&#xA;;; -- snip --     &#xA;&#xA;\\{semantic-mode-map}&quot;&#xA;  :global t ; &amp;lt;-- GLOBAL MODE&#xA;&#xA;;; -- snip --&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-08-18T16:03:20.377" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14840" PostTypeId="2" ParentId="14820" CreationDate="2015-08-18T18:18:26.920" Score="2" Body="&lt;p&gt;AUCTeX doesn't use tabs at all for indentation.  This is done by changing two variables: &lt;code&gt;indent-tabs-mode&lt;/code&gt; and &lt;code&gt;indent-line-function&lt;/code&gt;.  Thus, in order to get tabs back you can restore the default values of these variables (&lt;code&gt;t&lt;/code&gt; for for the former and &lt;code&gt;indent-line-function&lt;/code&gt; for the latter).  You can do this in your init file with a hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA;          (lambda ()&#xA;            (setq indent-tabs-mode t&#xA;                  indent-line-function 'indent-relative)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-08-18T18:18:26.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14841" PostTypeId="1" CreationDate="2015-08-18T22:38:14.087" Score="1" ViewCount="642" Body="&lt;h3&gt;Situation&lt;/h3&gt;&#xA;&lt;p&gt;First, I hope you will not mind my poor English. When you're working with websites/webapplications, there is a good chance that you will work with HTML/CSS files. When editing such files in buffers, I save it every time and reload the browser to view my changes (I have a multimonitor setup),&#xA;which can be quite cumbersome.&lt;/p&gt;&#xA;&lt;p&gt;It would be awesome when the changes in the buffer you're editing are sent to your web browser as you type. Instantly see the results of editing your HTML without even bothering to save.&#xA;For that, you have &lt;a href=&quot;https://github.com/skeeto/impatient-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Impatient mode&lt;/a&gt;. And there is a &lt;a href=&quot;https://www.youtube.com/watch?v=QV6XVyXjBO8&amp;amp;feature=youtu.be&quot; rel=&quot;nofollow noreferrer&quot;&gt;demo of it&lt;/a&gt;. I appreciate the work that's done, but it's not a perfect solution.&lt;/p&gt;&#xA;&lt;p&gt;For example, I'm editing webpages within a sort of intranet environment.&#xA;That's makes it complicated. I will illustrate it with some examples.&lt;/p&gt;&#xA;&lt;h3&gt;Example 1&lt;/h3&gt;&#xA;&lt;p&gt;The HTML-page &lt;code&gt;foo.html&lt;/code&gt; is nested inside another HTML page called &lt;code&gt;bar.html&lt;/code&gt;.&#xA;The &lt;code&gt;bar.html&lt;/code&gt; contains CSS and layout-rules, which will be also applied on the nested html-pages inside &lt;code&gt;bar.html&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When I I'm editing the page &lt;code&gt;foo.html&lt;/code&gt;, the HTTP server from &lt;code&gt;impatient-mode&lt;/code&gt; will serve live &lt;code&gt;foo.html&lt;/code&gt; inside browser. But I see only a bleak HTML-page without any markup/styling and the structure is not quite right. The styling and definitons of structure are defined in the file &lt;code&gt;bar.html&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h3&gt;Example 2&lt;/h3&gt;&#xA;&lt;p&gt;On our intranet, we have a template engine, like &lt;a href=&quot;https://mustache.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mustache solution&lt;/a&gt;. For example, we have some PHP-code:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;  $foo = &amp;quot;bar&amp;quot;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then in your HTML-page the template engine is parsing the values from the backend to the frontend.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;b&amp;gt;{{foo}}&amp;lt;/b&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With that, you will usually see in your browser:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;bar&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;But with the &lt;code&gt;impatient-mode&lt;/code&gt;, you see in your interactive HTML-page:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;{{foo}}&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Instead of &lt;strong&gt;bar&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This is because &lt;code&gt;impatient-mode&lt;/code&gt;and &lt;code&gt;http-server&lt;/code&gt; will be hosting their own page, and doesn't have any notion about the backend/template engine or anything. It's mainly useful for hosting stand-alone pages.&lt;/p&gt;&#xA;&lt;p&gt;I would love to have real interactive editing that works like a charm. So I guess I need to develop a package for it.&lt;/p&gt;&#xA;&lt;h1&gt;Possible structure for new package&lt;/h1&gt;&#xA;&lt;p&gt;We run a &lt;a href=&quot;http://emacswiki.org/emacs/HttpServer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs HTTP server&lt;/a&gt; which will run locally on the port 8080 of the localhost.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HEcWh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HEcWh.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;So in the HTML page, you need to include a little javascript snippet.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Pseudocode:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;script&amp;gt;&#xA;    Hey Javscript engine inside browser, do polling to output of http://localhost:8080/&#xA;&amp;lt;/script&amp;gt;&#xA;&#xA;&amp;lt;html&amp;gt;&#xA;    &amp;lt;div&amp;gt; &#xA;        Your regular HTML page. &#xA;    &amp;lt;/div&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Ok, imagine a situation. You're editing some text on line 24 inside a buffer. Then we need a hook that indicates that the user leaves a row. If so, pass the edited row from Emacs buffer to the Emacs HTTP server.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3Q2eH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3Q2eH.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;But that's brings us to a new problem. What if the user creates a new line inside buffer, or creates a new line in the middle of of a line? Then Javscript will replace the wrong line.&lt;/p&gt;&#xA;&lt;p&gt;It could be also a problem when the HTML page is nested into another HTML-page, as illustrated in &lt;code&gt;example 1&lt;/code&gt;&#xA;Then you're editing a 30 lines HTML page in the Emacs buffer. But in the browser, the whole source code counts more than 100 lines.&lt;/p&gt;&#xA;&lt;p&gt;Another solution is to replace all the content of HTML-page with the new values of the buffer. But this is not desirable, because in large HTML-files, there is enormous load  for Emacs/ Emacs HTTP server to pass the whole buffer every second, and for the Browser javascript engine to replace all the lines in the current tab.&#xA;The interactive environment would not be so responsive, and very lagged. So this is not a good basis to develop a package.&lt;/p&gt;&#xA;&lt;p&gt;I'm thinking about another ways to have a good workflow.&#xA;But I'm still struggling with connecting the dots, but that's what we programmers are supposed to do, right?&lt;/p&gt;&#xA;&lt;p&gt;Any another suggestion for connecting the dots would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-18T23:37:48.953" Title="Suggestions for a well-thought structure, for instant results inside browser from buffers" Tags="|package-development|web-browser|interactive-development|http|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14842" PostTypeId="2" ParentId="13995" CreationDate="2015-08-18T23:49:49.760" Score="1" Body="&lt;p&gt;Finally figured this out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Had to use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nnimap-split-fancy '(|(&quot;subject&quot; &quot;\\[foobar]&quot; &quot;INBOX.foobar&quot;)&#xA;                      (...)) &#xA;                      &quot;default&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="567" LastActivityDate="2015-08-18T23:49:49.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14843" PostTypeId="2" ParentId="14826" CreationDate="2015-08-19T00:01:51.250" Score="0" Body="&lt;p&gt;OK, try this.  You can change the value of the (buffer-local) variable &lt;code&gt;line-spacing&lt;/code&gt;.  To exaggerate, I chose 2 character heights extra.  See &lt;code&gt;C-h v line-spacing&lt;/code&gt; -- you can specify pixels to add or a decimal multiple of char heights to add.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'minibuffer-setup-hook (lambda () (setq line-spacing 2.0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, that doesn't seem to work.  It seems that &lt;code&gt;line-spacing&lt;/code&gt; affects only the text between lines -- it adds the extra space &lt;em&gt;after&lt;/em&gt; each line.  You can make it add space above the line also, but apparently only by putting text property &lt;code&gt;line-spacing&lt;/code&gt; on a newline char.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-19T00:35:00.123" LastActivityDate="2015-08-19T00:35:00.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14844" PostTypeId="1" CreationDate="2015-08-19T01:16:26.167" Score="2" ViewCount="74" Body="&lt;p&gt;I'm trying to use Mobileorg in android. Mobileorg syncs well with my Dropbox. The org files staged are captured well by mobileorg. However I'm having trouble searching for tasks based on tags. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Providing only tag name (ex: Project1) or with colons (:Project1:), the search tells me no results found.&lt;/p&gt;&#xA;" OwnerUserId="8683" LastActivityDate="2015-08-19T01:16:26.167" Title="Search tasks by tags in Mobileorg Android" Tags="|org-mode|org-export|mobileorg|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14845" PostTypeId="2" ParentId="10773" CreationDate="2015-08-19T05:48:44.203" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/quelpa/quelpa&quot; rel=&quot;nofollow&quot;&gt;https://github.com/quelpa/quelpa&lt;/a&gt; uses recipes in MELPA's format to build your desired packages from source and installs them using the built-in Emacs package manager&lt;/p&gt;&#xA;" OwnerUserId="2064" LastActivityDate="2015-08-19T05:48:44.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14846" PostTypeId="1" CreationDate="2015-08-19T06:23:48.720" Score="9" ViewCount="1487" Body="&lt;p&gt;I want to use emacs auto-save feature with tramp, but only for file that I don't open using sudo. My current configuration, based on the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/tramp/Auto_002dsave-and-Backup.html&quot;&gt;tramp documentation&lt;/a&gt;, looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;;;;;; BAKUCP ;;;;;;;;&#xA;;; Backup remote files locally to stop autosave pain&#xA;(setq tramp-backup-directory &quot;~/.emacs-backup&quot;)&#xA;(unless (file-directory-p tramp-backup-directory)&#xA;  (make-directory tramp-backup-directory))&#xA;(if (file-accessible-directory-p tramp-backup-directory)&#xA;    (setq tramp-auto-save-directory tramp-backup-directory)&#xA;  (error &quot;Cannot write to ~/.emacs-backup&quot;))&#xA;;; Don't backup su and sudo files&#xA;(setq backup-enable-predicate&#xA;      (lambda (name)&#xA;        (and (normal-backup-enable-predicate name)&#xA;             (not&#xA;              (let ((method (file-remote-p name 'method)))&#xA;                (when (stringp method)&#xA;                  (member method '(&quot;su&quot; &quot;sudo&quot;))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is forbidding creating remote backups of files edited as superuser but auto-saved files are still created on my local machine. Is there any way to disable that without disabling auto-save at all?&lt;/p&gt;&#xA;" OwnerUserId="9088" LastActivityDate="2015-11-17T09:13:11.067" Title="How to disable auto-save in emacs only for files opened as root" Tags="|tramp|auto-save|sudo|root|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14848" PostTypeId="2" ParentId="14846" CreationDate="2015-08-19T08:28:46.437" Score="2" Body="&lt;p&gt;Backup and auto-save are different operations, controlled by different variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to discard auto-save for files opened as root, you might change the buffer-local variable &lt;code&gt;auto-save-file-name-transforms&lt;/code&gt;. Something like this (untested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook&#xA; 'find-file-hook&#xA; (lambda ()&#xA;   (when (and (stringp buffer-file-name)&#xA;          (string-equal (file-remote-p buffer-file-name 'user) &quot;root&quot;))&#xA;     (setq buffer-auto-save-file-name nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-08-19T08:28:46.437" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14849" PostTypeId="1" AcceptedAnswerId="14871" CreationDate="2015-08-19T10:16:18.837" Score="3" ViewCount="72" Body="&lt;p&gt;How do you execute multiple actions on a single org-link?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode has &lt;a href=&quot;http://orgmode.org/org.html#External-links&quot; rel=&quot;nofollow&quot;&gt;links that can initiate actions&lt;/a&gt;, such as &lt;code&gt;elisp:&lt;/code&gt; and&#xA;  &lt;code&gt;shell:&lt;/code&gt;. It would be nice to initiate several such actions on&#xA;  following a single link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just creating a shell-file containing the tasks is possible, but&#xA;  seems inelegant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this best done?&lt;/p&gt;&#xA;" OwnerUserId="8431" LastActivityDate="2015-08-19T19:21:03.883" Title="org hyperlink multiple actions" Tags="|org-mode|shell|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14850" PostTypeId="2" ParentId="14708" CreationDate="2015-08-19T10:47:32.543" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; and set &lt;code&gt;use-package-verbose&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, you can see the load times for packages that take longer than 0.1s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, you cannot &lt;a href=&quot;https://github.com/jwiegley/use-package/issues/182&quot; rel=&quot;nofollow&quot;&gt;loop over a list of packages&lt;/a&gt; to use them.&lt;/p&gt;&#xA;" OwnerUserId="9161" LastActivityDate="2015-08-19T10:47:32.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14851" PostTypeId="2" ParentId="13048" CreationDate="2015-08-19T11:08:26.143" Score="1" Body="&lt;p&gt;You might want to have a look at &lt;a href=&quot;https://github.com/Malabarba/paradox&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;paradox&lt;/code&gt;&lt;/a&gt;. It's not another package manager, but a neater front end for &lt;code&gt;package.el&lt;/code&gt;. For example, when you update packages, it asks whether you want to install them and delete the old ones in one step. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use it, you probably want to set &lt;code&gt;paradox-execute-asynchronously&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in your init file.&lt;/p&gt;&#xA;" OwnerUserId="9161" LastActivityDate="2015-08-19T11:08:26.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14852" PostTypeId="1" CreationDate="2015-08-19T12:21:30.520" Score="12" ViewCount="3393" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: can I put divider lines in my &lt;code&gt;org&lt;/code&gt; agenda view?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My agenda buffer can get a little busy when I have a lot of things due.  This busyness has the counterproductive effect of making me avoid looking at my agenda because it freaks me out.  I'm looking for a way to make it visually less daunting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I'd like is to be able to put divider lines (eg, just a line of dashes) in between agenda items that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;have a deadline today,&lt;/li&gt;&#xA;&lt;li&gt;are past their deadline (overdue X days), and&lt;/li&gt;&#xA;&lt;li&gt;have an upcoming deadline (due in X days).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is it possible to put divider lines in the agenda view?  If yes, how would I do that?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2023-09-16T08:43:05.197" Title="Divider lines in org agenda?" Tags="|org-mode|org-agenda|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14853" PostTypeId="1" CreationDate="2015-08-19T13:04:56.057" Score="3" ViewCount="687" Body="&lt;p&gt;When I visit usenet or gmane group for the first time I want to see only recent articles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to mark articles as read based on their publication date?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="9416" LastEditDate="2015-10-19T09:03:55.840" LastActivityDate="2016-02-16T16:02:15.283" Title="Gnus: mark all articles older than X-month as read" Tags="|gnus|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14854" PostTypeId="1" AcceptedAnswerId="14865" CreationDate="2015-08-19T13:19:31.973" Score="0" ViewCount="1624" Body="&lt;p&gt;In my package I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom foobar-on-exit t&#xA;&quot;Boolean variable, enabled by default.&quot;&#xA;:type 'boolean&#xA;:group 'foobar)&#xA;&#xA;(if foobar-on-exit &#xA;    (add-hook 'kill-emacs-hook 'some-message))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I get a message when I close Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then in my init.el I set the value of &lt;code&gt;foobar-on-exit&lt;/code&gt; on &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foobar-on-exit 'nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After evaluating or restarting, I still got the message while the variable &lt;code&gt;foobar-on-exit&lt;/code&gt; is still false.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So somewhere I went wrong. Any hint? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-08-19T15:09:48.620" Title="How does a boolean variable work in Emacs lisp?" Tags="|elisp|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14856" PostTypeId="1" AcceptedAnswerId="15143" CreationDate="2015-08-19T13:27:27.987" Score="3" ViewCount="436" Body="&lt;p&gt;I'm trying to activate &lt;code&gt;semantic-mode&lt;/code&gt; for Python buffers &lt;strong&gt;only&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package stickyfunc-enhance&#xA;  :init&#xA;  (require 'stickyfunc-enhance)&#xA;  (add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)&#xA;  :config&#xA;  (defun me/enable-semantic-maybe ()&#xA;    &quot;Maybe enable `semantic-mode'.&quot;&#xA;    (if (derived-mode-p 'python-mode)&#xA;        (semantic-mode 1)&#xA;      (semantic-mode -1)))&#xA;  (add-hook 'change-major-mode-hook #'me/enable-semantic-maybe))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;Making python-shell-interpreter local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!&#xA;Making python-shell-interpreter-args local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2015-09-27T15:20:51.573" Title="Can't have semantic-mode turned on for Python buffers only" Tags="|python|semantic-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14857" PostTypeId="1" CreationDate="2015-08-19T13:45:08.567" Score="2" ViewCount="1372" Body="&lt;p&gt;I am looking for a way to access the value of &lt;code&gt;%HOMEPATH%&lt;/code&gt; under Windows (or more generally, any environment variable of the form &lt;code&gt;%name%&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The use case is to have a consistent &lt;code&gt;init.el&lt;/code&gt; across multiple operating systems. In Linux and OS X, &lt;code&gt;(expand-file-name &quot;~&quot;)&lt;/code&gt; always gives the home folder, but the same command under Windows it returns &lt;code&gt;%HOMEPATH%/AppData/Roaming&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="117" LastActivityDate="2015-08-19T13:52:56.057" Title="Accessing Windows environment variables in elisp" Tags="|system-environment|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14858" PostTypeId="1" AcceptedAnswerId="14861" CreationDate="2015-08-19T13:52:52.310" Score="38" ViewCount="13210" Body="&lt;p&gt;How to check if a string &lt;code&gt;s1&lt;/code&gt; is a substring of another string &lt;code&gt;s2&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example &lt;code&gt;(test-substring &quot;f t&quot; &quot;df tj&quot;)  --&amp;gt; t&lt;/code&gt;,&#xA;&lt;code&gt;(test-substring &quot;ft&quot; &quot;df tj&quot;)  --&amp;gt; nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2023-10-20T13:15:46.297" Title="How to check in elisp if a string is a substring of another string?" Tags="|elisp|string|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14859" PostTypeId="2" ParentId="14857" CreationDate="2015-08-19T13:52:56.057" Score="3" Body="&lt;p&gt;I found the answer to my own question; the relevant command is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(substitute-in-file-name &quot;$HOMEPATH&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information can be found in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Expansion.html#File-Name-Expansion&quot; rel=&quot;nofollow&quot;&gt;official documentation here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The solution provided by @legoscia above also works.)&lt;/p&gt;&#xA;" OwnerUserId="117" LastActivityDate="2015-08-19T13:52:56.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14860" PostTypeId="2" ParentId="14858" CreationDate="2015-08-19T13:57:43.523" Score="26" Body="&lt;p&gt;&lt;code&gt;cl-search&lt;/code&gt; can do that (and also returns the index of the substring, if found):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (cl-search &quot;f t&quot; &quot;df tj&quot;)&#xA;1 (#o1, #x1, ?\C-a)&#xA;ELISP&amp;gt; (cl-search &quot;ft&quot; &quot;df tj&quot;)&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-08-19T13:57:43.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14861" PostTypeId="2" ParentId="14858" CreationDate="2015-08-19T14:00:46.190" Score="53" Body="&lt;p&gt;The standard Emacs Lisp approach is regular expression matching:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match-p (regexp-quote needle) haystack)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-08-19T14:00:46.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14862" PostTypeId="1" CreationDate="2015-08-19T14:06:31.863" Score="2" ViewCount="141" Body="&lt;p&gt;Helm has inbuilt function &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt;. When this function is called, it shows all candidates including &lt;code&gt;variables&lt;/code&gt;, &lt;code&gt;dependencies&lt;/code&gt; e.t.c.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mostly use it only for &lt;code&gt;functions&lt;/code&gt; and &lt;code&gt;classes&lt;/code&gt;. I want to remove all other candidates and include only &lt;code&gt;functions&lt;/code&gt; &amp;amp; &lt;code&gt;classes&lt;/code&gt; in it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked source code of &lt;code&gt;helm-semantic-or-imenu&lt;/code&gt; to modify &lt;code&gt;helm sources&lt;/code&gt; but that looks quite complicated for me. Any help on removing selected candidates from source is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-08-19T14:06:31.863" Title="How to remove unwanted candidates from helm-semantic-or-imenu?" Tags="|helm|semantic-mode|imenu|helm-sources|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14863" PostTypeId="1" CreationDate="2015-08-19T14:21:16.697" Score="7" ViewCount="1494" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Plists-and-Alists.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Plists-and-Alists.html&lt;/a&gt; gives some supposed differences between plists and alists. Basically it comes down to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Alists can be used as stacks, where values are updated by adding a cons cell, allowing to restore previous values by deleting the topmost cons cell.&lt;/li&gt;&#xA;&lt;li&gt;Plists are faster for storing information about symbols because they are typically short compared to storing everything (for all symbols) in a single alist. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The first point makes sense. While the implementation of &lt;code&gt;plist-get&lt;/code&gt; allows using plists in such a stack-like manner, by adding new values with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push VALUE PLIST)&#xA;(push KEY PLIST)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;removing such a pair would be more involved compared to alists where one can just write &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ALIST (delete (assq KEY ALIST) ALIST))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;though even that could be changed by defining a function for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second point however seems incorrect too me, as the same advantage would apply for alists, if there was a &lt;code&gt;symbol-alist&lt;/code&gt; function instead of &lt;code&gt;symbol-plist&lt;/code&gt;. Additionally, in my experience plists are typically a bit slower than alists of the same size. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence I was wondering why emacs uses both conventions for storing key-value pairs, when using one would suffice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Clarification&lt;/strong&gt; Since it was raised in the comments: It seems largely a historical issue (emacs lisp was able to do both well, so people did both), but I'd still be interested in whether there was some rationale in the development of emacs to include builtin functions for handling both. Of course my view may be strongly colored by the &lt;a href=&quot;https://www.python.org/dev/peps/pep-0020/&quot; rel=&quot;noreferrer&quot;&gt;Zen of Python (13th line)&lt;/a&gt; here to even raise the question.&lt;/p&gt;&#xA;" OwnerUserId="2308" LastEditorUserId="28946" LastEditDate="2021-04-30T10:47:15.070" LastActivityDate="2021-04-30T10:47:15.070" Title="Why does emacs use both property lists and association lists?" Tags="|association-lists|property-lists|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="14864" PostTypeId="2" ParentId="14853" CreationDate="2015-08-19T14:32:15.450" Score="2" Body="&lt;p&gt;I've found the temporary solution:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;mark group as read with &lt;kbd&gt;c&lt;/kbd&gt; (which is bound to&#xA;&lt;code&gt;gnus-topic-catchup-articles&lt;/code&gt;) in &lt;code&gt;*Group*&lt;/code&gt; buffer while point is placed&#xA;on group of interest&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;enter the group (press &lt;kbd&gt;RET&lt;/kbd&gt; or specify how many latest articles&#xA;should be displayed using numeric argument, e.g. &lt;kbd&gt;C-u 1 2 3 RET&lt;/kbd&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;load as many articles as you want using something like &lt;kbd&gt;/ o 123&#xA;RET&lt;/kbd&gt; (this runs &lt;code&gt;gnus-summary-insert-old-articles&lt;/code&gt;) and repeat it&#xA;until you're satisfied with publication date of oldest loaded article&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;mark every article as unread with &lt;kbd&gt;M-u&lt;/kbd&gt;&#xA;(&lt;code&gt;gnus-summary-clear-mark-forward&lt;/code&gt;) or mark all articles with &lt;kbd&gt;M P&#xA;a&lt;/kbd&gt; (&lt;code&gt;gnus-uu-mark-all&lt;/code&gt;) and apply command to each article &lt;kbd&gt;M-&amp;amp;&#xA;M-u&lt;/kbd&gt; (&lt;code&gt;gnus-summary-universal-argument&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am not satisfied with this solution. Better solution would be to simply&#xA;specify how many months of history I want to fetch.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="2487" LastEditDate="2015-08-19T20:49:57.980" LastActivityDate="2015-08-19T20:49:57.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14865" PostTypeId="2" ParentId="14854" CreationDate="2015-08-19T15:09:48.620" Score="2" Body="&lt;p&gt;I believe this is an order-of-evaluation problem. Since the &lt;code&gt;defcustom&lt;/code&gt; and the &lt;code&gt;if&lt;/code&gt; are both in the package, and the &lt;code&gt;setq&lt;/code&gt; is in the init file (presumably some time after the loading of the package), when the package gets loaded (via &lt;code&gt;autoload&lt;/code&gt; or otherwise), &lt;code&gt;foobar-on-exit&lt;/code&gt; will be set to &lt;code&gt;t&lt;/code&gt;, then the &lt;code&gt;if&lt;/code&gt; form will be evaluated and &lt;code&gt;some-message&lt;/code&gt; will get added to &lt;code&gt;kill-emacs-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct sequence of events is &lt;code&gt;defcustom&lt;/code&gt;, &lt;code&gt;setq&lt;/code&gt;, &lt;code&gt;if&lt;/code&gt;. The only way to do that presently is to have both the &lt;code&gt;setq&lt;/code&gt; and the &lt;code&gt;if&lt;/code&gt; in your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to leave the &lt;code&gt;if&lt;/code&gt; in the package, then it needs to be in a function that gets added to &lt;code&gt;kill-emacs-hook&lt;/code&gt;, that way the current value of &lt;code&gt;foobar-on-exit&lt;/code&gt; will always be used when emacs is killed.&lt;/p&gt;&#xA;" OwnerUserId="9121" LastActivityDate="2015-08-19T15:09:48.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14868" PostTypeId="2" ParentId="14824" CreationDate="2015-08-19T18:00:38.823" Score="2" Body="&lt;p&gt;I'm not sure when it changed, but I'm seeing it too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;C-u C-x =&lt;/code&gt; within such a block I can see it actually has the face &lt;code&gt;org-block-background&lt;/code&gt; now, rather than &lt;code&gt;org-block&lt;/code&gt;. Customising that face to inherit from &lt;code&gt;fixed-pitch&lt;/code&gt; works for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tested as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'org-block-background nil :inherit 'fixed-pitch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to preserve any existing inheritance on that face you could do the following (adapted from the original here: &lt;a href=&quot;https://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables/16819449#16819449&quot;&gt;https://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables/16819449#16819449&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-adjoin-to-list-or-symbol (element list-or-symbol)&#xA;    (let ((list (if (not (listp list-or-symbol))&#xA;                    (list list-or-symbol)&#xA;                  list-or-symbol)))&#xA;      (require 'cl-lib)&#xA;      (cl-adjoin element list)))&#xA;&#xA;(set-face-attribute 'org-block-background nil :inherit&#xA;            (my-adjoin-to-list-or-symbol&#xA;             'fixed-pitch&#xA;             (face-attribute 'org-block-background :inherit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="737" LastEditorUserId="737" LastEditDate="2015-08-19T18:13:11.310" LastActivityDate="2015-08-19T18:13:11.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14869" PostTypeId="2" ParentId="14852" CreationDate="2015-08-19T18:22:33.173" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;org-agenda-block-separator&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The separator between blocks in the agenda.&#xA;  If this is a string, it will be used as the separator, with a newline added.&#xA;  If it is a character, it will be repeated to fill the window width.&#xA;  If nil the separator is disabled.  In &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; this&#xA;  addresses the separator between the current and the previous block.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;org-agenda-compact-blocks&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Non-nil means make the block agenda more compact.&#xA;  This is done globally by leaving out lines like the agenda span&#xA;  name and week number or the separator lines.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9234" LastActivityDate="2015-08-19T18:22:33.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14870" PostTypeId="1" CreationDate="2015-08-19T18:46:15.683" Score="3" ViewCount="1013" Body="&lt;p&gt;The possibility within Org mode to organize tasks hierarchically makes it suited for managing projects. Hence the the overal project goal (&quot;build a new house&quot;) can be the parent task with many subtasks (children task). During my weekly review I would like to make an agenda view that only shows me tasks that has subtasks. Is that possible? Or even more general, can I make an agenda view that only shows tasks of a certain hierarchical depth?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="2274" LastEditDate="2015-08-19T23:28:06.007" LastActivityDate="2016-06-19T02:42:54.407" Title="How can I use agenda view to find all task containing subtasks?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14871" PostTypeId="2" ParentId="14849" CreationDate="2015-08-19T19:21:03.883" Score="3" Body="&lt;p&gt;You can separate shell commands with a &lt;code&gt;;&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[shell:whoami%3B%20id][Two commands]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The link you type in would be &lt;code&gt;shell:whoami; id&lt;/code&gt; (it's stored in the document with special characters encoded).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, for Emacs Lisp, the link you type in might be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;elisp:(progn (message &quot;Hello&quot;) (message &quot;World!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9235" LastActivityDate="2015-08-19T19:21:03.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14872" PostTypeId="1" AcceptedAnswerId="14873" CreationDate="2015-08-19T19:32:51.670" Score="2" ViewCount="561" Body="&lt;p&gt;I use fixed tags for tasks and notes. These are tags either represent different physical places where I do my tasks (e.g. &lt;code&gt;@home&lt;/code&gt; or &lt;code&gt;@errands&lt;/code&gt;), or represent different areas of responsibility for me (e.g. &lt;code&gt;%FAMILY&lt;/code&gt;, &lt;code&gt;%HOME&lt;/code&gt;, &lt;code&gt;%CAR&lt;/code&gt;). I define these tags by mean of &lt;code&gt;org-tag-alist&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, these tags are of little relevance when I want to tag my journal entries, which are mainly reflections of political, philosophical and ethical nature. Can I have another tag list for journal entries, or could I get a tag list to chose from which only consists of tags already used within the journal.org file? The %^g and %^G tools gives me all tasks used in my journal.org file AS WELL as those defined by &lt;code&gt;org-tag-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="2487" LastEditDate="2015-08-19T20:50:05.903" LastActivityDate="2019-02-13T18:05:21.197" Title="Can I have separate tags lists for journal and todo/notes?" Tags="|org-mode|org-tags|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14873" PostTypeId="2" ParentId="14872" CreationDate="2015-08-19T19:53:00.667" Score="2" Body="&lt;p&gt;Refer to the Org manual section on &lt;a href=&quot;http://orgmode.org/manual/Setting-tags.html&quot; rel=&quot;nofollow&quot;&gt;Settings tags&lt;/a&gt;. It sounds like you have multiple org files, so you can specify a set of tags per file using the &lt;code&gt;#+TAGS:&lt;/code&gt; option line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a defined set of tags in all files except your journal, you can use &lt;code&gt;org-tag-alist&lt;/code&gt; but put an empty TAGS option in the journal file. Then you can use dynamic tags and &lt;code&gt;%^g&lt;/code&gt; in that one file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted in the comments, using an empty &lt;code&gt;#TAGS+:&lt;/code&gt; line to prevent the &lt;code&gt;org-tag-alist&lt;/code&gt; from being used in a specific file does not seem to work, despite being described in the manual. I'll investigate a bit more and file a bug.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-08-19T20:51:49.953" LastActivityDate="2015-08-19T20:51:49.953" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14875" PostTypeId="1" CreationDate="2015-08-19T20:24:13.883" Score="1" ViewCount="427" Body="&lt;p&gt;I run Emacs on Mac OSX, I'm trying to switch from &lt;a href=&quot;http://emacsformacosx.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs for Mac OSX&lt;/a&gt; to &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Mac Port&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;a href=&quot;http://notmuchmail.org/emacstips/&quot; rel=&quot;nofollow noreferrer&quot;&gt;notmuch&lt;/a&gt; for email. It works perfectly on &lt;a href=&quot;http://emacsformacosx.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs for Mac OSX&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But on Emacs Mac Port, it's prohibitively slow. Also, the message list is messed up, double spaced and with strange boxes: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UgVsQ.png&quot; alt=&quot;display irregularities&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the exact same configuration as I do with Emacs for Mac OSX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's causing these problems, and how do I fix them? &lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="9161" LastEditDate="2015-08-21T12:57:20.917" LastActivityDate="2015-08-21T12:57:20.917" Title="notmuch-mode very slow in emacs-mac-port (railwaycat)" Tags="|osx|notmuch|emacs-mac-port|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14876" PostTypeId="1" CreationDate="2015-08-19T20:58:25.760" Score="5" ViewCount="537" Body="&lt;p&gt;I have &lt;code&gt;shell-mode&lt;/code&gt; set up to work with ANSI colors. In older versions of Emacs, this extended to the prompt but now it doesn't and the prompt remains uncolored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;PS1&lt;/code&gt; is set with ANSI color codes which work when it's printed out but don't work in the actual prompt itself:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lVUxz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lVUxz.png&quot; alt=&quot;PS1 set with color.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried following the advice from &lt;a href=&quot;https://stackoverflow.com/questions/25819034/colors-in-emacs-shell-prompt&quot;&gt;an old StackOverflow&lt;/a&gt; answer and setting the &lt;code&gt;comint-highlight-prompt&lt;/code&gt; face to not inherit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'comint-highlight-prompt nil&#xA;                    :inherit nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This made the prompt the same color as normal text, still ignoring ANSI codes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cNrBJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cNrBJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like versions of &lt;a href=&quot;http://www.opensource.apple.com/source/emacs/emacs-51/emacs/lisp/comint.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;comint.el&lt;/a&gt; had a custom-set variable &lt;code&gt;comint-highlight-prompt&lt;/code&gt; which could be set to &lt;code&gt;nil&lt;/code&gt;, but the variable doesn't seem to exist on my version of Emacs. (Actually, I'm not sure exactly where that file came from, but I found it on a Google search :).)&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-05-23T19:45:40.737" Title="How can I make ANSI color codes inside the prompt show up in shell-mode?" Tags="|shell-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14877" PostTypeId="2" ParentId="14876" CreationDate="2015-08-19T21:07:34.847" Score="1" Body="&lt;p&gt;After a bit more searching, I found that this is a &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20084&quot; rel=&quot;nofollow noreferrer&quot;&gt;known bug&lt;/a&gt; (bug#20084). It looks like a fix has been pushed to master and should be available in Emacs 25:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I've now pushed my patch (which, I hope, is a proper fix) to master.&lt;/p&gt;&#xA;&lt;p&gt;…&lt;/p&gt;&#xA;&lt;p&gt;This change is only in the master branch&#xA;and has not been back-ported to emacs-24.  So, presumably, 25.1 will be&#xA;the first release where this works.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="17" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-19T21:07:34.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14878" PostTypeId="1" CreationDate="2015-08-19T21:30:11.383" Score="6" ViewCount="997" Body="&lt;p&gt;Is there a better way to write the below code with less redundancy?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA;((firstFunction str1) (secondFunction str1))&#xA;((firstFunction str2) (secondFunction str2))&#xA;((firstFunction str3) (secondFunction str3))&#xA;((firstFunction str4) (secondFunction str4))&#xA;((firstFunction str5) (secondFunction str5))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-11-10T12:45:37.620" Title="`cond` with less redundancy" Tags="|elisp|conditionals|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14879" PostTypeId="2" ParentId="14878" CreationDate="2015-08-19T21:51:39.240" Score="8" Body="&lt;p&gt;Wouldn't a loop do it?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-dolist (str (list str1 str2 str3 ...))&#xA;  (when (first-function str)&#xA;    (cl-return (second-function str))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-08-19T21:51:39.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14880" PostTypeId="2" ParentId="14878" CreationDate="2015-08-19T22:31:34.240" Score="8" Body="&lt;p&gt;Another way using &lt;code&gt;dash.el&lt;/code&gt;. You could also do this with &lt;code&gt;cl-lib&lt;/code&gt; functions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(-when-let (found (-find 'firstFunction (list str1 str2 str3 str3)))&#xA;  (secondFunction found))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, if you know at least one condition will always match:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(secondFunction (-find 'firstFunction (list str1 str2 str3 str3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-08-19T22:31:34.240" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14881" PostTypeId="2" ParentId="14878" CreationDate="2015-08-19T23:07:27.797" Score="10" Body="&lt;p&gt;Traditional Emacs Lisp &quot;in my time we didn't have that new-fangled CL stuff&quot; style:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(catch 'foo&#xA;    (dolist (str (list str1 str2 str3 str4))&#xA;       (if (firstFunction str)&#xA;           (throw 'foo (secondFunction str))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Traditional Emacs Lisp &quot;when I was at MIT...&quot; style:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(catch 'foo&#xA;    (mapc #'(lambda (str)&#xA;              (if (firstFunction str)&#xA;                  (throw 'foo (secondFunction str))))&#xA;        (list str1 str2 str3 str4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Traditional Emacs Lisp &quot;and now get off my lawn&quot; style:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((list (list str1 str2 str4)))&#xA;   (catch 'foo&#xA;       (while list&#xA;           (let ((str (pop list)))&#xA;               (if (firstFunction str)&#xA;                   (throw 'foo (secondFunction str)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2015-08-19T23:15:04.553" LastActivityDate="2015-08-19T23:15:04.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14882" PostTypeId="1" AcceptedAnswerId="29978" CreationDate="2015-08-19T23:28:54.747" Score="4" ViewCount="447" Body="&lt;p&gt;I just found out about the function &lt;code&gt;pop-tag-mark&lt;/code&gt; (&lt;code&gt;M-*&lt;/code&gt; by default) to go back after a &lt;code&gt;find-tag&lt;/code&gt; (or in this case after a &lt;code&gt;racer-find-definition&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Occasionally I would like to go &quot;forward&quot; again after going back with &lt;code&gt;pop-tag-mark&lt;/code&gt;. Is this possible in an easy way, or would I have to write a bunch of ELisp to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically what I want is something similar to Back/Forward in your web browser.&lt;/p&gt;&#xA;" OwnerUserId="450" LastActivityDate="2017-01-12T14:37:56.450" Title="Opposite of pop-tag-mark" Tags="|ctags|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14883" PostTypeId="2" ParentId="14852" CreationDate="2015-08-19T23:52:20.683" Score="0" Body="&lt;p&gt;You can have multiple blocks in an agenda view, each with its own search by just concatenating several custom commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;D&quot; &quot;Deadlines&quot;&#xA;         ((tags-todo &quot;DEADLINE=\&quot;&amp;lt;today&amp;gt;\&quot;&quot;&#xA;                     ((org-agenda-overriding-header &quot;Due Today&quot;))&#xA;                     )&#xA;          (tags-todo &quot;DEADLINE&amp;lt;\&quot;&amp;lt;today&amp;gt;\&quot;&quot;&#xA;                     ((org-agenda-overriding-header &quot;You're Late&quot;)))&#xA;          (tags-todo &quot;+DEADLINE&amp;lt;\&quot;&amp;lt;+5d&amp;gt;\&quot;+DEADLINE&amp;gt;\&quot;&amp;lt;today&amp;gt;\&quot;&quot;&#xA;                     ((org-agenda-overriding-header &quot;Better get on it&quot;)))&#xA;         ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also place a list of options at the end that will apply to all the blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This disadvantage is that each block is computed separately so this takes 3 times as long to generate as a single agenda&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-08-19T23:52:20.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14884" PostTypeId="2" ParentId="14870" CreationDate="2015-08-20T00:12:16.997" Score="0" Body="&lt;p&gt;The &lt;code&gt;LEVEL&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/manual/Matching-tags-and-properties.html&quot; rel=&quot;nofollow&quot;&gt;special property&lt;/a&gt; tells you the depth of an entry.  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In addition to the Special properties, one other “property” can also be used. LEVEL represents the level of an entry.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example a search &lt;code&gt;LEVEL&amp;gt;1&lt;/code&gt; will match any entry with more than one leading star.  I don't see any straightforward way to match entries having children.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-08-20T20:53:30.097" LastActivityDate="2015-08-20T20:53:30.097" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14885" PostTypeId="2" ParentId="14029" CreationDate="2015-08-20T00:48:37.807" Score="3" Body="&lt;p&gt;Unfortunately, this cannot be done in either iTerm2 or Terminal,  due to limitations in the terminal interface. You can bind Command to meta, but if you want a setup that allows you to use option for meta and Command for super, you have to use GUI Emacs. &lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-08-20T00:48:37.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14886" PostTypeId="2" ParentId="14824" CreationDate="2015-08-20T04:36:09.093" Score="8" Body="&lt;p&gt;Turns out this is actually related to org-block-background face, which has been removed in org version 8.3.1 in commit &lt;code&gt;f8b42e8&lt;/code&gt;, thus the bug. The rationale seems to be&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it causes a bug with &lt;code&gt;ps&lt;/code&gt; export&lt;/li&gt;&#xA;&lt;li&gt;it's inefficient&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Maybe in the future there will be an alternative, but not yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/26290924/fontify-r-code-blocks-in-org-mode-8&quot;&gt;https://stackoverflow.com/questions/26290924/fontify-r-code-blocks-in-org-mode-8&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00510.html&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00510.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently it seems the only way to get the old behavior back is to manually reverse the changes introduced in commit &lt;code&gt;f8b42e8&lt;/code&gt;. You can see the commit here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f8b42e8&quot;&gt;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f8b42e8&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff --git a/lisp/org-faces.el b/lisp/org-faces.el&#xA;index e693dab..83453e8 100644&#xA;--- a/lisp/org-faces.el&#xA;+++ b/lisp/org-faces.el&#xA;@@ -537,9 +537,6 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword.&quot;&#xA;   :group 'org-faces&#xA;   :version &quot;22.1&quot;)&#xA;&#xA;-(defface org-block-background '((t ()))&#xA;-  &quot;Face used for the source block background.&quot;)&#xA;-&#xA; (org-copy-face 'org-meta-line 'org-block-begin-line&#xA;   &quot;Face used for the line delimiting the begin of source blocks.&quot;)&#xA;&#xA;diff --git a/lisp/org.el b/lisp/org.el&#xA;index a153151..7e30061 100644&#xA;--- a/lisp/org.el&#xA;+++ b/lisp/org.el&#xA;@@ -5930,15 +5930,7 @@ by a #.&quot;&#xA;          (cond&#xA;           ((and lang (not (string= lang &quot;&quot;)) org-src-fontify-natively)&#xA;        (org-src-font-lock-fontify-block lang block-start block-end)&#xA;-       ;; remove old background overlays&#xA;-       (mapc (lambda (ov)&#xA;-           (if (eq (overlay-get ov 'face) 'org-block-background)&#xA;-               (delete-overlay ov)))&#xA;-             (overlays-at (/ (+ beg1 block-end) 2)))&#xA;-       ;; add a background overlay&#xA;-       (setq ovl (make-overlay beg1 block-end))&#xA;-                (overlay-put ovl 'face 'org-block-background)&#xA;-                (overlay-put ovl 'evaporate t)) ; make it go away when empty&#xA;+       (add-text-properties beg1 block-end '(src-block t)))&#xA;           (quoting&#xA;        (add-text-properties beg1 (min (point-max) (1+ end1))&#xA;                     '(face org-block))) ; end of source block&#xA;@@ -21828,9 +21820,7 @@ and end of string.&quot;&#xA; When INSIDE is non-nil, don't consider we are within a src block&#xA; when point is at #+BEGIN_SRC or #+END_SRC.&quot;&#xA;   (let ((case-fold-search t) ov)&#xA;-    (or (and (setq ov (overlays-at (point)))&#xA;-        (memq 'org-block-background&#xA;-          (overlay-properties (car ov))))&#xA;+    (or (and (eq (get-char-property (point) 'src-block) t))&#xA;    (and (not inside)&#xA;         (save-match-data&#xA;           (save-excursion&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-08-20T04:36:09.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14887" PostTypeId="1" AcceptedAnswerId="14899" CreationDate="2015-08-20T04:47:08.623" Score="5" ViewCount="4734" Body="&lt;p&gt;I'm writing a major mode for a language that uses &lt;code&gt;(* ... *)&lt;/code&gt; as comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to match multi-line comments. e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(*&#xA;foo&#xA;bar&#xA;*)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was initially doing &lt;code&gt;&quot;(\\*.*\\*)&quot;&lt;/code&gt;, however, &lt;code&gt;.&lt;/code&gt; doesn't match newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then tried what the wiki on &lt;a href=&quot;http://www.emacswiki.org/emacs/MultilineRegexp&quot;&gt;multi-line regex&lt;/a&gt; said: &lt;code&gt;&quot;(\\*[\0-\377[:nonascii:]]*\\*)&quot;&lt;/code&gt;. However, this leads to matching that I wasn't expecting. For instance, if I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(* comment 1*)&#xA;code block 1&#xA;&#xA;(* comment 2*)&#xA;code block 2&#xA;&#xA;(* comment 3*)&#xA;code block 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It highlights everything from &lt;code&gt;comment 1&lt;/code&gt; to &lt;code&gt;comment 3&lt;/code&gt; as a big comment, including &lt;code&gt;code block 1&lt;/code&gt; and &lt;code&gt;code block 2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get it to match &lt;code&gt;(*&lt;/code&gt; to the first closing &lt;code&gt;*)&lt;/code&gt; rather than the last one?&lt;/p&gt;&#xA;" OwnerUserId="9241" LastActivityDate="2015-08-20T14:02:15.007" Title="Matching multiline comments in regex" Tags="|regular-expressions|comment|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14888" PostTypeId="2" ParentId="14878" CreationDate="2015-08-20T05:03:21.720" Score="4" Body="&lt;p&gt;Just for fun...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall (lambda (f l) (funcall f l f))&#xA;         (lambda (l f) (if l (if (firstFunction (car l))&#xA;                                 (secondFunction (car l))&#xA;                                 (funcall f (cdr l) f))))&#xA;         (list str1 str2 str3 str4 str5))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, without lambda tricks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun superCond (l) (if l (if (firstFunction (car l))&#xA;                               (secondFunction (car l))&#xA;                               (superCond (cdr l)))))&#xA;(superCond (list str1 str2 str3 str4 str5))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun superCond (l f1 f2)&#xA;  (if l&#xA;    (if (funcall f1 (car l))&#xA;        (funcall f2 (car l))&#xA;        (superCond (cdr l) f1 f2))))&#xA;(superCond (list str1 str2 str3 str4 str5) #'firstFunction #'secondFunction)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6862" LastEditorUserId="2223" LastEditDate="2015-11-08T14:34:50.700" LastActivityDate="2015-11-08T14:34:50.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14889" PostTypeId="1" AcceptedAnswerId="14896" CreationDate="2015-08-20T05:04:14.877" Score="4" ViewCount="200" Body="&lt;p&gt;If I open a second instance of emacs accidentally (which happens more often than I am willing to admit) and then close it, &lt;code&gt;gnuclient&lt;/code&gt; starts responding with the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnuclient: Connection refused&#xA;gnuclient: unable to connect to local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to fix this without closing the original instance of emacs and then reopening it?  Sometimes this is very disruptive, and I've grown quite dependent upon &lt;code&gt;gnuclient&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps I should be using &lt;code&gt;emacsclient&lt;/code&gt; instead?  I see that it continues sending files to the original instance (on which the server was started) and is not affected by the start of a second instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps &lt;code&gt;emacsclient&lt;/code&gt; should be my default editor rather than &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3950" LastActivityDate="2015-08-20T09:56:00.463" Title="How to 'fix' gnuclient after opening a second instance of emacs?" Tags="|emacsclient|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14890" PostTypeId="1" CreationDate="2015-08-20T05:32:42.387" Score="3" ViewCount="1265" Body="&lt;p&gt;Is anyone else using an Emacs 24.x build on OS/X 10.10 with light colors on a dark background? I'm seeing the text rendered unusually thick and bold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same font (Inconsolata) with the same colors and same text on Sublime Text and Terminal.app is rendered much thinner. (Conversely it seems quite thick on iTerm 2 too).  Dark text on a light background seems to render just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is with straight Gnu Emacs and the Emacs-mac variant both installed via Homebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround I'm using the Source Code Pro &quot;extra light&quot; variant which looks okay, but would prefer to use Inconsolata. Are there compile-time options or font attributes I can set to influence the rendering (antialising I'd guess) of text?&lt;/p&gt;&#xA;" OwnerUserId="9242" LastActivityDate="2015-11-20T18:32:58.973" Title="Antialising of light text on dark too heavy (OS/X 10.10)" Tags="|osx|fonts|emacs24.4|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14891" PostTypeId="2" ParentId="14878" CreationDate="2015-08-20T05:42:35.077" Score="1" Body="&lt;p&gt;One more. Make sure to have &lt;code&gt;pp-macroexpand-last-sexp&lt;/code&gt; at hand.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cl-macrolet ((find-and-use-str (ff sf &amp;amp;rest strs)&#xA;                                (cons 'cond&#xA;                                      (mapcar (lambda (str)&#xA;                                                `((,ff ,str) (,sf ,str)))&#xA;                                              strs))))&#xA;  (find-and-use-str firstFunc secondFunc &quot;foo&quot; &quot;bar&quot; &quot;baz&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that the elements of &lt;code&gt;strs&lt;/code&gt; will be evaluated twice. In the example, it's ok because they're constant (strings).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-20T05:42:35.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14892" PostTypeId="1" CreationDate="2015-08-20T06:42:37.297" Score="2" ViewCount="365" Body="&lt;p&gt;I opened re-builder and changed its syntax to &quot;rx&quot;. My target buffer has plenty of digits and (rx (and &quot;4&quot;)) highlights a lot of 4s, however, (rx (and digit)) is apparently valid but matches nothing on the same target buffer! So far I only got string literals to match.&lt;/p&gt;&#xA;" OwnerUserId="9243" LastActivityDate="2015-08-20T07:25:46.283" Title="How to use re-builder with rx special forms?" Tags="|rx|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14893" PostTypeId="1" AcceptedAnswerId="14895" CreationDate="2015-08-20T07:16:13.523" Score="20" ViewCount="3449" Body="&lt;p&gt;It seems that the various methods of calendar integration have not been working well. The &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-google-sync.html&quot;&gt;tutorial on worg&lt;/a&gt; is outdated and the function is now called &lt;code&gt;org-icalender-export-to-ics&lt;/code&gt;. However running this function on an &lt;code&gt;.org&lt;/code&gt; file gives me an &lt;code&gt;.ics&lt;/code&gt; file which does not have any entry:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BEGIN:VCALENDAR&#xA;VERSION:2.0&#xA;X-WR-CALNAME:Personal&#xA;PRODID:-//Xiang Ji//Emacs with Org mode//EN&#xA;X-WR-TIMEZONE:HKT&#xA;X-WR-CALDESC:&#xA;CALSCALE:GREGORIAN&#xA;END:VCALENDAR&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I used to use &lt;code&gt;mobileorg&lt;/code&gt; to directly sync with Google Calendar on Android. However the project has long been out of maintenance and recently I haven't been able to sync any of my org files with &lt;code&gt;mobileorg&lt;/code&gt; at all, with various undecipherable errors occuring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I need is to sync those entries with &lt;code&gt;SCHEDULED&lt;/code&gt; and &lt;code&gt;DEADLINE&lt;/code&gt; to my calendar so that I can also check on them when I'm on my cellphone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/2mg1q0/syncing_between_orgmode_and_google_calendar/&quot;&gt;a similar question&lt;/a&gt; on Reddit but none of the solutions mentioned there have been able to achieve this end.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="7097" LastEditDate="2015-08-25T10:39:46.600" LastActivityDate="2018-08-24T20:21:45.950" Title="Org-mode Integration with Google Calendar?" Tags="|org-mode|org-export|calendar|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14894" PostTypeId="2" ParentId="14892" CreationDate="2015-08-20T07:25:46.283" Score="1" Body="&lt;p&gt;Apparently '(and digit) works. '() is what shows up if one loads re-builder with the syntax already set to &quot;rx&quot;. There are some comments in the re-builder.el.gz.&lt;/p&gt;&#xA;" OwnerUserId="9243" LastActivityDate="2015-08-20T07:25:46.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14895" PostTypeId="2" ParentId="14893" CreationDate="2015-08-20T09:24:07.127" Score="9" Body="&lt;p&gt;Turns out the reason why the exported &lt;code&gt;ics&lt;/code&gt; files was empty was because I didn't customize the variables related to ical export. I had to run &lt;code&gt;customize-group&lt;/code&gt; on &lt;code&gt;org-export-icalender&lt;/code&gt; and change quite a few parameters. I changed &lt;code&gt;org-icalendar-use-scheduled&lt;/code&gt;, &lt;code&gt;org-icalendar-use-deadline&lt;/code&gt;, &lt;code&gt;org-icalendar-include-body&lt;/code&gt; &lt;code&gt;org-icalendar-timezone&lt;/code&gt;, &lt;code&gt;org-icalendar-store-UID&lt;/code&gt;. It seems that Google Calendar would only recognize type &lt;code&gt;VEVENT&lt;/code&gt; in &lt;code&gt;ics&lt;/code&gt; files. &lt;code&gt;VTODO&lt;/code&gt; will not get recognized, so I had to make sure that the export generates &lt;code&gt;VEVENT&lt;/code&gt; from &lt;code&gt;SCHEDULED&lt;/code&gt; and &lt;code&gt;DEADLINE&lt;/code&gt; entries. I'd say the default options were a bit not user-friendly though. And those customizations seem to not be mentioned in the worg guide.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-08-20T09:24:07.127" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14896" PostTypeId="2" ParentId="14889" CreationDate="2015-08-20T09:56:00.463" Score="1" Body="&lt;p&gt;You should use &lt;code&gt;emacsclient&lt;/code&gt;. As far as I know it's now preferred way to&#xA;edit files with already running Emacs instance rather than open new instance&#xA;of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I myself use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Start Emacs server.&#xA;&#xA;(require 'server)&#xA;&#xA;(unless (server-running-p)&#xA;  (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, when server is not already running (i.e. you started first Emacs&#xA;instance) it's started. When you accidentally start second Emacs instance&#xA;&lt;code&gt;server-running-p&lt;/code&gt; is evaluated to &lt;code&gt;t&lt;/code&gt; and &lt;code&gt;server-start&lt;/code&gt; is not called. So,&#xA;it's safe to start more Emacsen without the fear to break something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once this is running, you should use &lt;code&gt;emacsclient&lt;/code&gt; program to edit&#xA;files. This will open them in “server” Emacs instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to have this alias in shell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#&#xA;# ~/.bashrc&#xA;#&#xA;&#xA;# …&#xA;&#xA;export EDITOR='emacsclient'&#xA;alias e='emacsclient'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now I usually use EShell from Emacs itself, where I have another alias:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias e find-file $1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, I don't need to use &lt;code&gt;emacsclient&lt;/code&gt; often. It's still useful in some&#xA;cases, though. For example I'm typing this in Emacs, in temporary markdown&#xA;file created by “It's All Text” Firefox plugin that uses &lt;code&gt;emacsclient&lt;/code&gt; to&#xA;tell Emacs that I want to edit the file.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-08-20T09:56:00.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14897" PostTypeId="2" ParentId="14875" CreationDate="2015-08-20T10:31:22.107" Score="1" Body="&lt;p&gt;The square boxes are caused by the use of SVG images in &lt;code&gt;notmuch-tag-formats&lt;/code&gt;. Why SVG images don't work correctly in emacs-mac-port I don't know. You could modify &lt;code&gt;notmuch-tag-formats&lt;/code&gt; to avoid their use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't explain the slowdown, which I don't see.&lt;/p&gt;&#xA;" OwnerUserId="9246" LastActivityDate="2015-08-20T10:31:22.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14898" PostTypeId="1" CreationDate="2015-08-20T10:58:02.310" Score="1" ViewCount="3387" Body="&lt;p&gt;I'm having trouble getting flycheck to use the .eslintrc file in the root of the current project, and I'm struggling to find any documentation that will tell me how to configure it to use the appropriate file. This setup was derived from &lt;a href=&quot;http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html&quot; rel=&quot;nofollow&quot;&gt;this blogpost&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package flycheck&#xA;  :ensure t&#xA;  :diminish flycheck-mode&#xA;  :config&#xA;  (global-flycheck-mode)&#xA;&#xA;  (setq-default flycheck-temp-prefix &quot;.&quot;)&#xA;  ;; disable jshint since we prefer eslint checking&#xA;  (setq-default flycheck-disabled-checkers&#xA;                (append flycheck-disabled-checkers&#xA;                        '(javascript-jshint)))&#xA;&#xA;  (setq flycheck-checkers '(javascript-eslint))&#xA;  ;; use eslint with web-mode for jsx files&#xA;  (flycheck-add-mode 'javascript-eslint 'web-mode)&#xA;  (flycheck-add-mode 'javascript-eslint 'js2-mode)&#xA;  (flycheck-add-mode 'javascript-eslint 'js-mode)&#xA;  ;; disable json-jsonlist checking for json files&#xA;  (setq-default flycheck-disabled-checkers&#xA;                (append flycheck-disabled-checkers&#xA;                        '(json-jsonlist)))&#xA;  )&#xA;&#xA;(provide 'init-flycheck)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;do i have to configure my local eslint installation, the javascript-eslint package, or flycheck?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i've also tried using M-x customize-group, but even though I specify the file i.e ~/.eslintrc (yaml) it doesn't apply the rules from config. is there anyway of seeing if it has found the file?&lt;/p&gt;&#xA;" OwnerUserId="8990" LastEditorUserId="8990" LastEditDate="2015-08-20T11:31:00.983" LastActivityDate="2015-11-27T10:55:28.340" Title="Flycheck with eslint doesn't use ~/.eslintrc" Tags="|flycheck|javascript|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14899" PostTypeId="2" ParentId="14887" CreationDate="2015-08-20T12:08:26.900" Score="7" Body="&lt;p&gt;You will have to change the wildcard match to a non-greedy version (&lt;code&gt;+?&lt;/code&gt;,&lt;code&gt;??&lt;/code&gt;,&lt;code&gt;*?&lt;/code&gt;).  Ref: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html&quot;&gt;Emacs Manual: Regexp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(\\*[\0-\377[:nonascii:]]*?\\*)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That tells it to find the shortest full match, rather than the longest.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-08-20T12:08:26.900" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14900" PostTypeId="1" CreationDate="2015-08-20T13:12:06.627" Score="5" ViewCount="305" Body="&lt;p&gt;When I run built-in magit commands, they output to the magit-process buffer. How can I do the same with a custom magit command that generates shell output?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-08-20T14:15:44.157" Title="Output to magit-process" Tags="|magit|shell|shell-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14901" PostTypeId="2" ParentId="14887" CreationDate="2015-08-20T14:02:15.007" Score="3" Body="&lt;p&gt;See Jonathan's answer for the easy solution.  The hard solution would look something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(\*\(?:[^*]\|\*+[^)*]\)*\*+)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-20T14:02:15.007" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14902" PostTypeId="2" ParentId="14900" CreationDate="2015-08-20T14:15:44.157" Score="6" Body="&lt;p&gt;You can run one-off commands using the &lt;code&gt;magit-run-popup&lt;/code&gt; bound to &lt;code&gt;!&lt;/code&gt;.&#xA;For example, &lt;code&gt;!!ls-files&lt;/code&gt; will run &lt;code&gt;git ls-files&lt;/code&gt; in the top-level&#xA;directory of the repo and output the results to the Magit process&#xA;buffer for that repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For writing your own commands, you can use one of&#xA;&lt;a href=&quot;http://magit.vc/manual/magit/Calling-Git.html#Calling-Git&quot;&gt;Magit's functions for calling Git&lt;/a&gt;,&#xA;picking the variant depending on the type of Git command and whether&#xA;you are calling it for a return value or for a side-effect.  The &lt;code&gt;!!&lt;/code&gt;&#xA;command from above ends up calling &lt;code&gt;(magit-run-git-async &quot;ls-files&quot;)&lt;/code&gt; in the top-level directory of the repo.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-08-20T14:15:44.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14903" PostTypeId="1" AcceptedAnswerId="14904" CreationDate="2015-08-20T17:40:35.537" Score="21" ViewCount="2020" Body="&lt;p&gt;Suppose I have &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq a 1 b 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I elegantly swap the values of &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; without using a temporary variable?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-21T08:53:50.740" Title="Swap two variables in Elisp" Tags="|elisp|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14904" PostTypeId="2" ParentId="14903" CreationDate="2015-08-20T17:50:42.743" Score="19" Body="&lt;p&gt;If memory serves me well and you're willing to use &lt;code&gt;cl-lib&lt;/code&gt; then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-rotatef a b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this is Common Lisp way of solving the problem.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-08-20T17:50:42.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14905" PostTypeId="1" AcceptedAnswerId="14907" CreationDate="2015-08-20T18:08:02.707" Score="1" ViewCount="138" Body="&lt;p&gt;I have experimented with emacs' various shells (&lt;code&gt;term&lt;/code&gt; in combination with &lt;code&gt;compilation-mode&lt;/code&gt; in particular), and have had performance problems.  For that reason I still use a separate terminal (e.g. gnome-terminal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main use case is to run a test suite (python) and then click through stack frames in tracebacks in the test run output (using &lt;code&gt;compilation-mode&lt;/code&gt;) to have emacs visit the corresponding source files.  My current use of gnome-terminal leaves me manually jumping to buffers and lines in the tracebacks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to do that that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does not use &lt;code&gt;term&lt;/code&gt;, &lt;code&gt;shell&lt;/code&gt;, or &lt;code&gt;eterm&lt;/code&gt; etc.&lt;/li&gt;&#xA;&lt;li&gt;Does not noticeably slow down emacs&lt;/li&gt;&#xA;&lt;li&gt;Is in good emacs taste (perhaps, just as an example: works well with existing python or compile-run-debug support built into emacs)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2015-08-20T18:17:54.540" LastActivityDate="2016-07-19T13:10:41.940" Title="Compile-run-navigate traceback without term mode" Tags="|term|compilation-mode|testing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14906" PostTypeId="2" ParentId="14903" CreationDate="2015-08-20T18:30:00.667" Score="21" Body="&lt;p&gt;This is the elegant idiom I use ;-).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq a  (prog1 b (setq b  a)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="2642" LastEditDate="2015-08-20T18:31:20.340" LastActivityDate="2015-08-20T18:31:20.340" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14907" PostTypeId="2" ParentId="14905" CreationDate="2015-08-20T18:39:43.597" Score="0" Body="&lt;p&gt;&lt;code&gt;M-x compile&lt;/code&gt; does exactly what is needed here.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-08-20T18:39:43.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14908" PostTypeId="1" AcceptedAnswerId="14916" CreationDate="2015-08-20T19:10:11.703" Score="6" ViewCount="1492" Body="&lt;p&gt;I'm interested in trying out the features of the &lt;code&gt;htmlize.el&lt;/code&gt; package that I read about &lt;a href=&quot;http://www.emacswiki.org/emacs/Htmlize&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. The article does not explain how I can import it into emacs. What is the best way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-08-20T21:35:48.840" LastActivityDate="2015-08-21T15:30:47.793" Title="What is the standard way to install an elisp package?" Tags="|use-package|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14909" PostTypeId="1" AcceptedAnswerId="14913" CreationDate="2015-08-20T19:25:43.577" Score="25" ViewCount="5853" Body="&lt;p&gt;From the moment when I started using Flyspell, it always was painful to&#xA;use. I rarely check entire buffer for misspelled words, usually I type and&#xA;once I see underlined word I want to correct it instantly and continue&#xA;typing. This is simply because I fear to forget to correct the word later&#xA;and because when I start comprehensive checking of buffer, iSpell gives too&#xA;many false positives. So, almost always I correct words as soon as possible&#xA;while I type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is built-in functions I know about and reasons why they are not&#xA;efficient (for me):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;flyspell-correct-word&lt;/code&gt; — This is bound to mouse click. Forget it, I'm not&#xA;going to use mouse.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;flyspell-correct-word-before-point&lt;/code&gt; — I used it for some time. It has two&#xA;downsides:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;By default it shows GUI menu that is difficult to operate without mouse&#xA;and it's really cumbersome when you have list of corrections with more&#xA;than 10 items.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It doesn't work for word &lt;em&gt;long&lt;/em&gt; before point. I type fast and when I&#xA;spot misspelled word I typically have one or two words between the&#xA;misspelled word and point. I need to move point, correct word, return&#xA;back. Oh.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;flyspell-auto-correct-word&lt;/code&gt; — See point 2 ↑ plus it doesn't work well&#xA;when you have long list of completions (because of cycling).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I use Flyspell efficiently, with keyboard, being able to&#xA;choose from list of completions without cycling, and with ability to correct&#xA;even more or less distant words?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Acceptable answers include packages that help to navigate to previous&#xA;misspelled word, correct it and get back or something like that as well as&#xA;little snippets, possibly from your own configuration file, since I believe&#xA;other people figured out their ways to efficiently interact with Flyspell.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2021-03-31T09:41:47.540" Title="How to use Flyspell to efficiently correct previous word?" Tags="|flyspell|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14912" PostTypeId="2" ParentId="14909" CreationDate="2015-08-20T19:37:05.913" Score="8" Body="&#xA;&#xA;&lt;p&gt;I'm pretty sure other people will come up with different solutions that will&#xA;be useful for future readers. However, here is how I currently handle this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think &lt;code&gt;flyspell-correct-word-before-point&lt;/code&gt; is a good place to start,&#xA;because it at least can be invoked with key pressing and it displays menu of&#xA;possible corrections. To fix the menu I've written package&#xA;&lt;a href=&quot;https://github.com/mrkkrp/ace-popup-menu&quot; rel=&quot;noreferrer&quot;&gt;Ace Popup Menu&lt;/a&gt; that uses&#xA;&lt;a href=&quot;https://github.com/abo-abo/avy&quot; rel=&quot;noreferrer&quot;&gt;Avy&lt;/a&gt; as backend. This replaces GUI popup&#xA;menu that &lt;code&gt;flyspell-correct-word-before-point&lt;/code&gt; uses (the function is called&#xA;&lt;code&gt;x-popup-menu&lt;/code&gt;) with textual popup menu that presents labeled menu items:&#xA;one or two key strokes and you're done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve second problem (inability to correct words “at distance”) I've&#xA;written this helper:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun flyspell-correct-previous (&amp;amp;optional words)&#xA;  &quot;Correct word before point, reach distant words.&#xA;&#xA;WORDS words at maximum are traversed backward until misspelled&#xA;word is found.  If it's not found, give up.  If argument WORDS is&#xA;not specified, traverse 12 words by default.&#xA;&#xA;Return T if misspelled word is found and NIL otherwise.  Never&#xA;move point.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((Δ (- (point-max) (point)))&#xA;         (counter (string-to-number (or words &quot;12&quot;)))&#xA;         (result&#xA;          (catch 'result&#xA;            (while (&amp;gt;= counter 0)&#xA;              (when (cl-some #'flyspell-overlay-p&#xA;                             (overlays-at (point)))&#xA;                (flyspell-correct-word-before-point)&#xA;                (throw 'result t))&#xA;              (backward-word 1)&#xA;              (setq counter (1- counter))&#xA;              nil))))&#xA;    (goto-char (- (point-max) Δ))&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="115" LastEditDate="2015-08-20T21:48:50.520" LastActivityDate="2015-08-20T21:48:50.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14913" PostTypeId="2" ParentId="14909" CreationDate="2015-08-20T20:03:50.243" Score="21" Body="&lt;p&gt;The inbuilt &lt;code&gt;flyspell-auto-correct-previous-word&lt;/code&gt; works like a charm for me. I have bound it to &lt;kbd&gt;F12&lt;/kbd&gt; and I haven't looked back. It has consistently correctly words for me not matter how many words back the incorrect word was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the function documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;flyspell-auto-correct-previous-word is an interactive compiled Lisp&#xA;function in `flyspell.el'.&#xA;&#xA;(flyspell-auto-correct-previous-word POSITION)&#xA;&#xA;For more information check the manuals.&#xA;&#xA;Auto correct the first misspelled word that occurs before point.&#xA;But don't look beyond what's visible on the screen.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In addition, if the first time autocorrect did not give you the right word, keep on hitting your bound key (&lt;kbd&gt;F12&lt;/kbd&gt; in my case) to cycle through all options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-spell.el&quot;&gt;[My spell check config]&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-08-20T20:23:31.600" LastActivityDate="2015-08-20T20:23:31.600" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14914" PostTypeId="2" ParentId="14693" CreationDate="2015-08-20T20:06:25.767" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;q/&lt;/code&gt; or &lt;code&gt;q:&lt;/code&gt;, then you'll be able to complete using cross buffer completion with auto-complete or company, if you have them configured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To configure company for that, you need to add the backends &lt;code&gt;company-dabbrev-code&lt;/code&gt; and/or &lt;code&gt;company-dabbrev&lt;/code&gt; to &lt;code&gt;company-backends&lt;/code&gt;. Then invoking company-complete should bring the completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rIt20.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rIt20.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-08-20T20:13:08.853" LastActivityDate="2015-08-20T20:13:08.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14915" PostTypeId="2" ParentId="14908" CreationDate="2015-08-20T20:20:07.277" Score="4" Body="&lt;p&gt;People sometimes overemphasize the use of &lt;code&gt;package.el&lt;/code&gt;, IMO.  Certainly, you can use it to download and install a library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can also just download it (however), put its name in your &lt;code&gt;load-path&lt;/code&gt;, and then &lt;code&gt;require&lt;/code&gt; it.  Especially for a one-file library, this is hardly difficult to do.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'load-path &quot;DIRECTORY WHERE htmlize.el[c] IS&quot;)&#xA;(require 'htmlize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is one &quot;standard&quot;, and straightforward, way to &quot;import&quot; a library.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-20T20:20:07.277" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14916" PostTypeId="2" ParentId="14908" CreationDate="2015-08-20T20:59:45.160" Score="12" Body="&lt;p&gt;You can use the package manager to install a package and keep it up to date. &lt;code&gt;htmlize&lt;/code&gt; isn't in the default archive, but you can easily add new ones (Marmalade and MELPA are the two most popular):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'package-archives&#xA;             '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you have the repositories set up, &lt;code&gt;M-x package-install htmlize&lt;/code&gt; will install the package, &lt;code&gt;M-x list-packages&lt;/code&gt; will list the available packages (and let you get updates on installed packages).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2487" LastEditDate="2015-08-21T15:30:47.793" LastActivityDate="2015-08-21T15:30:47.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14917" PostTypeId="2" ParentId="14909" CreationDate="2015-08-20T21:33:30.410" Score="7" Body="&#xA;&lt;p&gt;With &lt;a href=&quot;https://github.com/pronobis/helm-flyspell&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm-flyspell&lt;/a&gt; you can choose from the list of corrections efficiently. I use the following code to jump to the errors and correct them with it, it saves the position of the point to the &lt;code&gt;mark-ring&lt;/code&gt; so you can jump back to the position where you started or corrected words previously:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun flyspell-goto-previous-error (arg)&#xA;  &amp;quot;Go to arg previous spelling error.&amp;quot;&#xA;  (interactive &amp;quot;p&amp;quot;)&#xA;  (while (not (= 0 arg))&#xA;    (let ((pos (point))&#xA;          (min (point-min)))&#xA;      (if (and (eq (current-buffer) flyspell-old-buffer-error)&#xA;               (eq pos flyspell-old-pos-error))&#xA;          (progn&#xA;            (if (= flyspell-old-pos-error min)&#xA;                ;; goto end of buffer&#xA;                (progn&#xA;                  (message &amp;quot;Restarting from end of buffer&amp;quot;)&#xA;                  (goto-char (point-max)))&#xA;              (backward-word 1))&#xA;            (setq pos (point))))&#xA;      ;; seek the previous error&#xA;      (while (and (&amp;gt; pos min)&#xA;                  (let ((ovs (overlays-at pos))&#xA;                        (r '()))&#xA;                    (while (and (not r) (consp ovs))&#xA;                      (if (flyspell-overlay-p (car ovs))&#xA;                          (setq r t)&#xA;                        (setq ovs (cdr ovs))))&#xA;                    (not r)))&#xA;        (backward-word 1)&#xA;        (setq pos (point)))&#xA;      ;; save the current location for next invocation&#xA;      (setq arg (1- arg))&#xA;      (setq flyspell-old-pos-error pos)&#xA;      (setq flyspell-old-buffer-error (current-buffer))&#xA;      (goto-char pos)&#xA;      (if (= pos min)&#xA;          (progn&#xA;            (message &amp;quot;No more miss-spelled word!&amp;quot;)&#xA;            (setq arg 0))))))&#xA;      &#xA;&#xA;(defun check-previous-spelling-error ()&#xA;  &amp;quot;Jump to previous spelling error and correct it&amp;quot;&#xA;  (interactive)&#xA;  (push-mark-no-activate)&#xA;  (flyspell-goto-previous-error 1)&#xA;  (call-interactively 'helm-flyspell-correct))&#xA;&#xA;(defun check-next-spelling-error ()&#xA;  &amp;quot;Jump to next spelling error and correct it&amp;quot;&#xA;  (interactive)&#xA;  (push-mark-no-activate)&#xA;  (flyspell-goto-next-error)&#xA;  (call-interactively 'helm-flyspell-correct))&#xA;&#xA;(defun push-mark-no-activate ()&#xA;  &amp;quot;Pushes `point' to `mark-ring' and does not activate the region&#xA; Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled&amp;quot;&#xA;  (interactive)&#xA;  (push-mark (point) t nil)&#xA;  (message &amp;quot;Pushed mark to ring&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="2051" LastEditDate="2021-03-31T09:41:47.540" LastActivityDate="2021-03-31T09:41:47.540" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="14918" PostTypeId="5" CreationDate="2015-08-20T21:57:07.670" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-08-20T21:57:07.670" LastActivityDate="2015-08-20T21:57:07.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14919" PostTypeId="4" CreationDate="2015-08-20T21:57:07.670" Score="0" Body="For questions regarding the speedbar, a special frame for conveniently navigating in or operating on another frame. " OwnerUserId="45" LastEditorUserId="45" LastEditDate="2015-08-21T11:58:46.550" LastActivityDate="2015-08-21T11:58:46.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14920" PostTypeId="1" AcceptedAnswerId="14922" CreationDate="2015-08-20T23:36:22.780" Score="8" ViewCount="203" Body="&lt;p&gt;How to determine the line number of the first visible line of a window?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-08-20T23:54:49.543" Title="How to determine the line number of the first visible line of a window?" Tags="|window|line-numbers|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14922" PostTypeId="2" ParentId="14920" CreationDate="2015-08-20T23:54:49.543" Score="8" Body="&lt;p&gt;If the user is &lt;em&gt;not&lt;/em&gt; getting the line number multiple times each command loop for various positions, then using &lt;code&gt;line-number-at-pos&lt;/code&gt; is sufficient -- it will get a line number even if &lt;code&gt;point&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; visible:  &lt;code&gt;(line-number-at-pos (window-start))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the user &lt;em&gt;is&lt;/em&gt; getting the line number multiple times each command loop for various positions, then it can be much faster to move to &lt;em&gt;point&lt;/em&gt; and tap into the power of the C-source code: &lt;code&gt;(save-excursion (goto-char (window-start)) (format-mode-line &quot;%l&quot;))&lt;/code&gt; -- see: &lt;a href=&quot;https://emacs.stackexchange.com/q/3821/2287&quot;&gt;A faster method to obtain `line-number-at-pos` in large buffers&lt;/a&gt;  The string can be converted to a number with &lt;code&gt;string-to-number&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some important exceptions to calculating &lt;code&gt;window-start&lt;/code&gt; prior to &lt;code&gt;redisplay&lt;/code&gt;, but that is beyond the scope of this question/answer:  &lt;a href=&quot;https://emacs.stackexchange.com/a/10768/2287&quot;&gt;https://emacs.stackexchange.com/a/10768/2287&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-08-20T23:54:49.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14923" PostTypeId="1" AcceptedAnswerId="14945" CreationDate="2015-08-21T00:30:24.597" Score="23" ViewCount="11827" Body="&lt;p&gt;This is similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/12336/org-export-to-latex-and-html-references&quot;&gt;Org export to latex and HTML references&lt;/a&gt;, but for equations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to use LaTeX math snippets in my org-files, as in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* The Quadratic Equation&#xA;The roots of $ax^2 + bx + c$ are given by&#xA;\begin{equation}&#xA;\label{eq:1}&#xA;x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}&#xA;\end{equation}&#xA;&#xA;According to Equation \ref{eq:1}, ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export to LaTeX, the &lt;code&gt;\ref{eq:1}&lt;/code&gt; correctly turns into a hyper link to the equation. But I want to achieve the following additional behavior:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Inside the org file, I can click the text &lt;code&gt;\ref{eq:1}&lt;/code&gt; (the text doesn't have to be &lt;code&gt;\ref{eq:1}&lt;/code&gt;, I just want a hyperlink) and be taken to to the equation. This functionality is present for headers, as in &lt;code&gt;[[The Quadratic Equation]]&lt;/code&gt; becomes clickable in Org mode.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When I export to HTML, I want to the references to be kept (actually, the label (1) doesn't even show up in HTML export).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there a way to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="117" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2019-04-03T16:39:41.423" Title="Label and reference LaTeX equations in org-mode" Tags="|org-mode|latex|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14924" PostTypeId="1" CreationDate="2015-08-21T00:35:17.220" Score="2" ViewCount="778" Body="&lt;p&gt;The relative line number style in url below would be very useful for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/14781/how-can-i-replicate-vims-code-folding&quot;&gt;How can I replicate Vim&amp;#39;s code folding?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This package shows the number of current position, not just 0.&#xA;Both sides of the current line shows relative numbers as usual.&#xA;I like it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I modify downloaded relative line numer package or is there any package which already supports this function?&lt;/p&gt;&#xA;" OwnerUserId="9255" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-08-21T13:37:18.183" Title="What's the name of this relative line number package?" Tags="|line-numbers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14925" PostTypeId="1" CreationDate="2015-08-21T02:04:28.300" Score="1" ViewCount="437" Body="&lt;p&gt;Issuing &lt;code&gt;M-x load-theme&lt;/code&gt; gives me the option &lt;code&gt;solarized&lt;/code&gt;. However, issuing &lt;code&gt;solarized&lt;/code&gt; gives the message &lt;code&gt;Undefined Custom theme solarized&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas why I'm getting this error?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-04-18T21:47:44.333" Title="Why isn't emacs displaying my theme?" Tags="|themes|" AnswerCount="1" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14926" PostTypeId="2" ParentId="14924" CreationDate="2015-08-21T03:15:17.403" Score="3" Body="&lt;p&gt;I think those screenshots are actually of &lt;code&gt;vim&lt;/code&gt;, in which case all you need to do is &lt;code&gt;:set rnu&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For emacs, you're looking for &lt;a href=&quot;https://github.com/coldnew/linum-relative&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;linum-relative&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have various hacks you might be interested, which makes the emulation of &lt;code&gt;rnu&lt;/code&gt; closer:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'linum&#xA;  (set-face-background 'linum nil)&#xA;&#xA;  (require 'linum-relative)&#xA;&#xA;  ;; truncate current line to four digits&#xA;  (defun linum-relative (line-number)&#xA;    (let* ((diff1 (abs (- line-number linum-relative-last-pos)))&#xA;            (diff (if (minusp diff1)&#xA;                    diff1&#xA;                    (+ diff1 linum-relative-plusp-offset)))&#xA;            (current-p (= diff linum-relative-plusp-offset))&#xA;            (current-symbol (if (and linum-relative-current-symbol current-p)&#xA;                              (if (string= &quot;&quot; linum-relative-current-symbol)&#xA;                                (number-to-string (% line-number 1000))&#xA;                                linum-relative-current-symbol)&#xA;                              (number-to-string diff)))&#xA;            (face (if current-p 'linum-relative-current-face 'linum)))&#xA;      (propertize (format linum-relative-format current-symbol) 'face face)))&#xA;&#xA;&#xA;  (setq&#xA;    linum-relative-current-symbol &quot;&quot;&#xA;    linum-relative-format &quot;%3s &quot;&#xA;    linum-delay t)&#xA;&#xA;  (set-face-attribute 'linum-relative-current-face nil&#xA;    :weight 'extra-bold&#xA;    :foreground nil&#xA;    :background nil&#xA;    :inherit '(hl-line default)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-21T03:15:17.403" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14927" PostTypeId="2" ParentId="14898" CreationDate="2015-08-21T06:48:37.677" Score="0" Body="&lt;p&gt;Try adding this line in your conf&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq flycheck-eslintrc &quot;~/.eslintrc&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To verify just do &lt;code&gt;C-h v flycheck-eslintrc&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-08-21T06:48:37.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14928" PostTypeId="2" ParentId="14903" CreationDate="2015-08-21T08:53:50.740" Score="6" Body="&lt;p&gt;If it's integers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq a (logxor a b))&#xA;(setq b (logxor a b))&#xA;(setq a (logxor a b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;:)&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-08-21T08:53:50.740" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14929" PostTypeId="1" CreationDate="2015-08-21T09:34:14.650" Score="0" ViewCount="665" Body="&lt;p&gt;In the terminal, &lt;code&gt;(set-cursor-color &quot;red&quot;)&lt;/code&gt; has no effect, so the only way I can distinguish insert from normal mode under evil-mode is through the &lt;code&gt;&amp;lt;N&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;I&amp;gt;&lt;/code&gt; on the modeline. Is there a way to set the cursor colour even in text terminals? (I use sakura with &lt;code&gt;TERM=xterm-256color&lt;/code&gt; if that matters.)&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2015-11-20T15:16:37.240" Title="How do I set cursor colours per evil-state in the (non-GUI) text terminal?" Tags="|evil|terminal-emacs|colors|cursor|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14930" PostTypeId="2" ParentId="14929" CreationDate="2015-08-21T09:34:14.650" Score="1" Body="&lt;p&gt;Here's a hack that seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun evil-set-cursor-including-terminal (orig-fn specs)&#xA;  (if (display-graphic-p)&#xA;      (funcall orig-fn specs)&#xA;    (when (= (display-color-cells) 256) ; otherwise messes up tmux under xfce4-terminal&#xA;      (pcase specs&#xA;        ((and (or `(,colour) `(,colour . ,shape))&#xA;              (guard (stringp colour)))&#xA;         (send-string-to-terminal (concat &quot;\033]12;&quot; colour &quot;\007&quot;)))))))&#xA;(advice-add #'evil-set-cursor :around #'evil-set-cursor-including-terminal)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The exception is replace-state, which doesn't seem to change back to the normal colour (so I have to insert/visual and exit to get back normal colour).&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="730" LastEditDate="2015-08-22T12:59:15.090" LastActivityDate="2015-08-22T12:59:15.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14931" PostTypeId="1" AcceptedAnswerId="14934" CreationDate="2015-08-21T09:36:32.327" Score="2" ViewCount="2662" Body="&lt;p&gt;I moved &lt;code&gt;.emacs.d&lt;/code&gt; folder from home directory to a folder called &lt;code&gt;dot_files&lt;/code&gt; so that it will be easy to sync various dot files. From there I have linked it to home so that emacs can load that configuration files. But when I start emacs, it is throwing this warning and not loading it.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Warning (initialization): Unable to create user-emacs-directory' (~/.emacs.d/).&lt;/p&gt;&#xA;&lt;p&gt;Any data that would normally be written there may be lost!&lt;/p&gt;&#xA;&lt;p&gt;If you never want to see this message again,&#xA;customize the variable `user-emacs-directory-warning'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;How can I link emacs config so that it works normally?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-11-03T23:19:21.753" Title="Unable to link emacs.d directory" Tags="|init-file|start-up|config|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14932" PostTypeId="1" AcceptedAnswerId="14933" CreationDate="2015-08-21T11:58:25.553" Score="5" ViewCount="582" Body="&lt;p&gt;Whenever I'm using &lt;code&gt;M-x rgrep&lt;/code&gt; to search inside my project arborescence, the interactive prompts suggest the following default arguments for the function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Search for (default: &amp;lt;current word&amp;gt;)&lt;/code&gt; (OK, always what I want)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Search for &amp;lt;current word&amp;gt; in files (default: *.&amp;lt;extension of the current file&amp;gt;)&lt;/code&gt; (mostly OK, not always what I want but I can live with that)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Base directory: &amp;lt;current directory&amp;gt;&lt;/code&gt; (not OK, I never want it to use the current directory)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like the first proposed argument, but I'd like to change the second one, and especially the third one, to use other defaults (such as &quot;parent directory&quot; instead of &quot;current directory&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I modify &lt;code&gt;rgrep&lt;/code&gt; so that (1) either it remains interactive, but proposes different default values, or (2) it becomes non-interactive, but uses the word currently under the cursor as first argument?&lt;/p&gt;&#xA;" OwnerUserId="9259" LastActivityDate="2018-12-11T14:47:40.403" Title="Default base directory in rgrep" Tags="|interactive|rgrep|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14933" PostTypeId="2" ParentId="14932" CreationDate="2015-08-21T12:24:59.290" Score="1" Body="&lt;h2&gt;Fully interactive method&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;One way to do that consists in calling &lt;code&gt;rgrep&lt;/code&gt; interactively in a tweaked context so that deduced defaults correspond to what you want.&#xA;For example, let &lt;code&gt;rgrep&lt;/code&gt; believe you called it from a file named &quot;foo.cxx&quot; in the parent directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this is that you keep the intelligence &lt;code&gt;rgrep&lt;/code&gt; puts in default parameters deduction (to pursue the example, you not only have &quot;&lt;em&gt;*.cxx&lt;/em&gt;&quot; as a files pattern, but also &quot;&lt;em&gt;*.cc&lt;/em&gt;&quot;, &quot;&lt;em&gt;*.cpp&lt;/em&gt;&quot; &amp;amp; co).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The disadvantage of such a method is that changing &lt;code&gt;buffer-file-name&lt;/code&gt; and &lt;code&gt;default-directory&lt;/code&gt; could have unintended side effects (but I didn't see any in this example).&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-rgrep ()&#xA;  (interactive)&#xA;  (let ((buffer-file-name &quot;foo.cxx&quot;)&#xA;        (default-directory (file-name-directory default-directory)))&#xA;    (call-interactively #'rgrep)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Semi-interactive method&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can also devise a command that interactively allows you to manage the pattern part and non-interactively sets values for other arguments. It then non-interactively calls &lt;code&gt;rgrep&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-rgrep (&amp;amp;optional confirm)&#xA;  (interactive &quot;P&quot;)&#xA;  (rgrep (grep-read-regexp)&#xA;         &quot;*.cxx&quot;&#xA;         (file-name-directory default-directory)&#xA;         confirm))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-08-21T14:00:34.717" LastActivityDate="2015-08-21T14:00:34.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14934" PostTypeId="2" ParentId="14931" CreationDate="2015-08-21T13:55:44.407" Score="5" Body="&lt;p&gt;Symlinks usually work fine in this scenario, so that's unlikely to be a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should check the file and directory permissions.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-08-21T13:55:44.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14935" PostTypeId="1" CreationDate="2015-08-21T14:04:41.307" Score="5" ViewCount="2095" Body="&lt;p&gt;How do i check if two regions have identical content?  Is it possible to do so while ignoring language-specific whitespace?&lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="253" LastEditDate="2015-08-21T14:34:43.690" LastActivityDate="2016-01-28T02:46:22.010" Title="How do I check if two regions have identical content?" Tags="|diff|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14937" PostTypeId="1" CreationDate="2015-08-21T16:10:32.947" Score="4" ViewCount="197" Body="&#xA;&#xA;&lt;p&gt;I was trying to add a custom functionality when using &lt;code&gt;C-u&lt;/code&gt; before the &quot;copying&quot; command or &lt;code&gt;kill-ring-save&lt;/code&gt;. So I jumped into the source code (pasted below for convenience) to examine what it originally does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;For brevity I will use the default binding &lt;code&gt;M-w&lt;/code&gt; instead of &lt;code&gt;M-x kill-ring-save&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It happens that doing &lt;code&gt;C-u M-w&lt;/code&gt; sets the optional argument REGION to non-nil. From the function docstring, that would not just copy the text between BEG and END but also copy the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did not understand that and so I tried out &lt;code&gt;C-u M-w&lt;/code&gt;. But I saw no difference between &lt;code&gt;M-w&lt;/code&gt; and &lt;code&gt;C-u M-w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can someone please provide a way in which I can distinguish the behavior between the two?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;On closer inspection, I realized that actually &lt;code&gt;C-u M-w&lt;/code&gt; and &lt;code&gt;M-w&lt;/code&gt; will do the exact same thing.. because &lt;code&gt;(prefix-numeric-value current-prefix-arg)&lt;/code&gt; will return &lt;code&gt;1&lt;/code&gt; if no prefix arg is used, and will return &lt;code&gt;4&lt;/code&gt; if &lt;code&gt;C-u&lt;/code&gt; is used. In either case the REGION variable will be set to &lt;code&gt;non-nil&lt;/code&gt; and the &lt;code&gt;region-extract-function&lt;/code&gt; will be used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the core question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;When does the REGION argument not get set to a non-nil value?&lt;/strong&gt; &lt;em&gt;Wouldn't &lt;code&gt;prefix-numeric-value&lt;/code&gt; ALWAYS return something non-nil?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Source code of &lt;code&gt;kill-ring-save&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kill-ring-save (beg end &amp;amp;optional region)&#xA;  &quot;Save the region as if killed, but don't kill it.&#xA;In Transient Mark mode, deactivate the mark.&#xA;If `interprogram-cut-function' is non-nil, also save the text for a window&#xA;system cut and paste.&#xA;&#xA;If you want to append the killed line to the last killed text,&#xA;use \\[append-next-kill] before \\[kill-ring-save].&#xA;&#xA;The optional argument REGION if non-nil, indicates that we're not just copying&#xA;some text between BEG and END, but we're copying the region.&#xA;&#xA;This command is similar to `copy-region-as-kill', except that it gives&#xA;visual feedback indicating the extent of the region being copied.&quot;&#xA;  ;; Pass mark first, then point, because the order matters when&#xA;  ;; calling `kill-append'.&#xA;  (interactive (list (mark) (point)&#xA;             (prefix-numeric-value current-prefix-arg)))&#xA;  (copy-region-as-kill beg end region)&#xA;  ;; This use of called-interactively-p is correct because the code it&#xA;  ;; controls just gives the user visual feedback.&#xA;  (if (called-interactively-p 'interactive)&#xA;      (indicate-copied-region)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2016-08-15T01:24:19.107" LastActivityDate="2016-08-15T01:24:19.107" Title="What is the distinction between copying text between a region BEG/END, and copying a region?" Tags="|kill-ring|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14938" PostTypeId="1" AcceptedAnswerId="15014" CreationDate="2015-08-21T18:46:27.213" Score="4" ViewCount="402" Body="&lt;p&gt;I often edit articles in web-mode (using PHP). Is there some way of fontifying HTML entities (like &lt;code&gt;&amp;amp;#8211;&lt;/code&gt;, &lt;code&gt;&amp;amp;eacute;&lt;/code&gt;, and so on)? I'd like them to be a lighter color so that they're easier to see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried changing the font-lock settings, but the font-lock code in &lt;code&gt;web-mode.el&lt;/code&gt; is confusing to me since it deals with lots of different web-mode flavors. (I only really care about the PHP mode, if that makes things easier.) I've  tried the following, to no avail:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'web-mode-html-font-lock-keywords&#xA;             '(&quot;\\&amp;amp;#x?[0-9a-fA-F][0-9a-fA-F]*;?&quot; . font-lock-comment-face))&#xA;&#xA;(add-to-list 'web-mode-php-font-lock-keywords&#xA;             '(&quot;\\&amp;amp;#x?[0-9a-fA-F][0-9a-fA-F]*;?&quot; . font-lock-comment-face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a feeling I'm just not fiddling with the right variable, but I'm not sure  how to find out which one &lt;em&gt;is&lt;/em&gt; right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to @fxbois, it's now super easy: in your config, just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-enable-html-entities-fontification t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and customize the face &lt;code&gt;web-mode-html-entity-face&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-08-30T19:16:10.807" LastActivityDate="2019-11-29T18:22:52.580" Title="Highlight HTML entities in Web mode" Tags="|font-lock|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14939" PostTypeId="2" ParentId="971" CreationDate="2015-08-21T20:06:40.903" Score="2" Body="&lt;p&gt;By request, here's my implementation of &lt;code&gt;function-argspec&lt;/code&gt; and &lt;code&gt;function-arity&lt;/code&gt;. I used &lt;a href=&quot;https://emacs.stackexchange.com/a/973&quot;&gt;Jordon Biondo's original solution&lt;/a&gt; for Emacs 24 bytecode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA; ;; XEmacs&#xA; ((fboundp 'compiled-function-arglist)&#xA;  (defalias 'emacsen-compiled-function-arglist 'compiled-function-arglist))&#xA; ;; GNU Emacs&#xA; (t&#xA;  (defun emacsen-make-up-number-arglist (start end tail)&#xA;    (while (&amp;lt; start end)&#xA;      (setq end (1- end))&#xA;      (setq tail (cons (intern (format &quot;a%d&quot; end)) tail)))&#xA;    tail)&#xA;  (defun emacsen-compiled-function-arglist (func)&#xA;    (let ((a (aref func 0)))&#xA;      (if (integerp a)&#xA;          ;; An integer encoding the arity. Encountered in Emacs 24.3.&#xA;          ;; https://emacs.stackexchange.com/questions/971/argspec-or-arity-of-a-bytecode-function-in-emacs-24/973#973&#xA;          (let ((arglist (if (zerop (logand a 128))&#xA;                             nil&#xA;                           '(&amp;amp;rest rest)))&#xA;                (mandatory (logand a 127))&#xA;                (nonrest (lsh a -8)))&#xA;            (if (&amp;gt; nonrest mandatory)&#xA;                (setq arglist (cons '&amp;amp;optional (emacsen-make-up-number-arglist mandatory nonrest arglist))))&#xA;            (emacsen-make-up-number-arglist 0 mandatory arglist))&#xA;        ;; Otherwise: this is the arglist. The only format I've seen up to GNU 23.&#xA;        a)))))&#xA;&#xA;(defun function-argspec (func)&#xA;  &quot;Return a function's argument list.&#xA;For byte-compiled functions in Emacs &amp;gt;=24, some information may be lost as the&#xA;byte compiler sometimes erases argument names. In this case, fake argument names&#xA;are reconstructed.&quot;&#xA;  (if (symbolp func) (setq func (indirect-function func)))&#xA;  (cond&#xA;   ((subrp func)&#xA;    (let ((docstring (documentation func)))&#xA;      (save-match-data&#xA;        (if (string-match &quot;\n.*\\'&quot; docstring)&#xA;            (let ((form (read (match-string 0 docstring))))&#xA;              (cdr form))&#xA;          nil))))&#xA;   ((byte-code-function-p func)&#xA;    (emacsen-compiled-function-arglist func))&#xA;   ((and (consp func)&#xA;         (eq (car func) 'lambda)&#xA;         (consp (cdr func)))&#xA;    (car (cdr func)))&#xA;   ((and (consp func)&#xA;         (eq (car func) 'closure)&#xA;         (consp (cdr func))&#xA;         (consp (cdr (cdr func))))&#xA;    (car (cdr (cdr func))))&#xA;   (t (signal 'wrong-type-argument&#xA;              (list 'functionp func)))))&#xA;&#xA;(defun function-arity (func)&#xA;  &quot;Return a function's arity as (MIN . MAX).&#xA;Return minimum and maximum number of args allowed for SUBR.&#xA;The returned value is a pair (MIN . MAX).  MIN is the minimum number&#xA;of args.  MAX is the maximum number or the symbol `many', for a&#xA;function with `&amp;amp;rest' args, or `unevalled' for a special form.&#xA;&#xA;This function is like `subr-arity', but also works with user-defined&#xA;and byte-code functions. Symbols are dereferenced through&#xA;`indirect-function'.&quot;&#xA;  ;; TODO: keyword support&#xA;  (if (symbolp func) (setq func (indirect-function func)))&#xA;  (cond&#xA;   ((subrp func)&#xA;    (subr-arity func))&#xA;   (t&#xA;    (let ((mandatory 0) (optional 0) (rest nil)&#xA;          (where 'mandatory))&#xA;      (when (and (consp func) (eq 'macro (car func)))&#xA;        (setq func (cdr func))&#xA;        (setq rest 'unevalled))&#xA;      (let ((argspec (function-argspec func)))&#xA;        (dolist (arg argspec)&#xA;          (cond&#xA;           ((eq arg '&amp;amp;optional) (setq where 'optional))&#xA;           ((eq arg '&amp;amp;rest) (unless rest (setq rest 'many)))&#xA;           (t (set where (+ (symbol-value where) 1)))))&#xA;        (cons mandatory (or rest (+ mandatory optional))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-08-21T20:06:40.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14940" PostTypeId="1" AcceptedAnswerId="15054" CreationDate="2015-08-21T21:45:34.783" Score="21" ViewCount="5178" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL&#xA;&lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Compiled from EmacsW64.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Package Evil, using the latest version of Evil from MELPA&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows 7 x64 bit.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Tested with empty Emacs configuration with only Evil enabled.&#xA;I copy some text from Windows application. Then I paste it into Emacs inside &lt;code&gt;normal mode&lt;/code&gt; with &lt;kbd&gt;p&lt;/kbd&gt;. I see the text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I switch to the Windows application, select another text, copy it.&#xA;Switch back to Emacs, visually select the text, and paste inside &lt;code&gt;visual mode&lt;/code&gt;. But the text inside the region will not be replaced with the text from the Windows clipboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not with the default Vim. How could I configure it, that the visually text gets replaced by the latest copy action, in this case the Windows clipboard? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="16543" LastEditDate="2020-02-08T16:25:56.613" LastActivityDate="2020-02-08T16:25:56.613" Title="evil-mode visual selection copies text to clipboard automatically" Tags="|evil|copy-paste|yank|clipboard|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="14941" PostTypeId="1" AcceptedAnswerId="14942" CreationDate="2015-08-21T21:53:48.403" Score="2" ViewCount="85" Body="&lt;p&gt;I have an &lt;code&gt;org&lt;/code&gt; document &lt;code&gt;~/foo.org&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: testing htmlize&#xA;#+Date: &amp;lt;2015-08-21 Fri&amp;gt;&#xA;&#xA;* Hello world&#xA;&#xA;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Donec hendrerit&#xA;tempor tellus.  Donec pretium posuere tellus.  Proin quam nisl, tincidunt et,&#xA;mattis eget, convallis nec, purus.  Cum sociis natoque penatibus et magnis dis&#xA;parturient montes, nascetur ridiculus mus.  Nulla posuere.  Donec vitae dolor.&#xA;Nullam tristique diam non turpis.  Cras placerat accumsan nulla.  Nullam rutrum.&#xA;Nam vestibulum accumsan nisl.&#xA;&#xA;** Subsection&#xA;&#xA;Mauris ac felis vel velit tristique imperdiet.  &#xA;&#xA;| this   | is   | a      | table  |&#xA;|--------+------+--------+--------|&#xA;| albeit | not  | very   | useful |&#xA;| john   | paul | george | ringo  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Issuing &lt;code&gt;M-x htmlize-file &amp;lt;ret&amp;gt; ~/foo.org &amp;lt;ret&amp;gt;&lt;/code&gt; writes an &lt;code&gt;html&lt;/code&gt; file &lt;code&gt;~/foo.org.html&lt;/code&gt; whose output looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: testing htmlize&#xA;#+Date: &amp;lt;2015-08-21 Fri&amp;gt;&#xA;&#xA;* Hello world...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It appears that &lt;code&gt;htmlize&lt;/code&gt; reads &lt;code&gt;~/foo.org&lt;/code&gt; in its collapsed form. Is it possible to get &lt;code&gt;htmlize&lt;/code&gt; to read &lt;code&gt;~/foo.org&lt;/code&gt; in its entirety?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently issuing &lt;code&gt;M-x htmlize-buffer&lt;/code&gt; followed by &lt;code&gt;C-x C-w&lt;/code&gt; to write the complete &lt;code&gt;html&lt;/code&gt; file but I'd like to do this with only one command.&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2015-08-22T10:43:52.887" Title="Can htmlize un-collapse an org document?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14942" PostTypeId="2" ParentId="14941" CreationDate="2015-08-21T22:15:51.723" Score="2" Body="&lt;p&gt;Set the &lt;code&gt;org-startup-folded&lt;/code&gt; variable to something like &lt;code&gt;'showall&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-startup-folded 'showall)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can either change the value of this variable gloabally as above or set it in a &lt;code&gt;let&lt;/code&gt; binding in a wrapper function that you write to do &lt;code&gt;htmlize-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can even choose to set the value of this variable local to the org file by using &lt;code&gt;#+STARTUP:&lt;/code&gt; keyword.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On doing &lt;code&gt;C-h v org-startup-folded&lt;/code&gt;, you get help on what values you can set it to and how to set it using &lt;code&gt;#+STARTUP:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-startup-folded is a variable defined in `org.el'.&#xA;Its value is t&#xA;&#xA;Documentation:&#xA;Non-nil means entering Org-mode will switch to OVERVIEW.&#xA;This can also be configured on a per-file basis by adding one of&#xA;the following lines anywhere in the buffer:&#xA;&#xA;   #+STARTUP: fold              (or `overview', this is equivalent)&#xA;   #+STARTUP: nofold            (or `showall', this is equivalent)&#xA;   #+STARTUP: content&#xA;   #+STARTUP: showeverything&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-08-21T22:15:51.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14943" PostTypeId="1" AcceptedAnswerId="14944" CreationDate="2015-08-21T23:11:33.133" Score="7" ViewCount="6237" Body="&lt;p&gt;The key &quot;RET&quot; is bound to &lt;code&gt;'newline&lt;/code&gt; in many modes in Emacs as described in &lt;code&gt;M-x describe-binding&lt;/code&gt;. But in the minubuffer,&#xA;they are different (try to send the command &lt;code&gt;newline&lt;/code&gt; to the minibuffer). &#xA;So this question arises: In the minibuffer, to what function the physical &quot;RET&quot; key is bound.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-08-22T13:51:17.533" Title="Difference between the physical &quot;RET&quot; key and the command 'newline in the minibuffer" Tags="|key-bindings|minibuffer|newlines|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14944" PostTypeId="2" ParentId="14943" CreationDate="2015-08-22T00:21:06.467" Score="14" Body="&lt;p&gt;You are confusing a few things, here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, &lt;code&gt;RET&lt;/code&gt; is not a physical (keyboard) key. It is a logical key -- the Emacs way of writing what your physical &lt;kbd&gt;Return&lt;/kbd&gt; or &lt;kbd&gt;Enter&lt;/kbd&gt; key typically sends to Emacs: a Control-M character (which Emacs also writes as &lt;code&gt;C-m&lt;/code&gt;, when describing the &lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;m&lt;/kbd&gt; key sequence).  And if your physical &lt;kbd&gt;Return&lt;/kbd&gt; or &lt;kbd&gt;Enter&lt;/kbd&gt; key sends something else, then Emacs writes that as the pseudo-function key &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;.  And Emacs automatically maps &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt; to &lt;code&gt;RET&lt;/code&gt;, unless &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt; is itself bound to a different command than &lt;code&gt;RET&lt;/code&gt;. (Note that the ASCII control character Control-M is also called a carriage return character, and &lt;code&gt;C-m&lt;/code&gt; is essentially another way of writing &lt;code&gt;RET&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, the minibuffer uses its own keymaps. And in those &lt;code&gt;RET&lt;/code&gt; is generally bound to a different command than it is outside the minibuffer.  Similarly, &lt;code&gt;C-j&lt;/code&gt; is bound to a different command that it is outside the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Control J is the ASCII control character for a newline -- the newline character. So in some Emacs modes &lt;code&gt;C-j&lt;/code&gt; inserts a newline character (sometimes written &lt;code&gt;\n&lt;/code&gt;). This is a convention -- nothing forces a correspondence between the key sequence &lt;code&gt;C-j&lt;/code&gt; and insertion of a newline (i.e., Control J) character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;C-j&lt;/code&gt; does not do this in the minibuffer, not by default anyway. In the minibuffer, both &lt;code&gt;RET&lt;/code&gt; and &lt;code&gt;C-j&lt;/code&gt; terminate your minibuffer input and accept (read) it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, your question is presumably what command &lt;code&gt;RET&lt;/code&gt; is bound to in the minibuffer (by default). It can depend on which minibuffer keymap is currently active.  But you can find out what it is bound to by examining the minibuffer keymaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see the keys bound in a given minibuffer keymap, load library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/help-fns%2b.el&quot;&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/a&gt; and use &lt;code&gt;M-k&lt;/code&gt;. When it asks you for a keymap variable, type one of the minibuffer keymap variable names.  The names all start with &lt;code&gt;minibuffer-local-&lt;/code&gt;, so you can type that and hit &lt;code&gt;TAB&lt;/code&gt; for completion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main (base) keymap is &lt;code&gt;minibuffer-local-map&lt;/code&gt;. The other maps generally inherit its key bindings and supplement them with other bindings.  In &lt;code&gt;minibuffer-local-map&lt;/code&gt;, &lt;code&gt;RET&lt;/code&gt; is bound by default to &lt;code&gt;exit-minibuffer&lt;/code&gt;. But in &lt;code&gt;minibuffer-local-must-match-map&lt;/code&gt;, &lt;code&gt;RET&lt;/code&gt; is bound by default to &lt;code&gt;minibuffer-complete-and-exit&lt;/code&gt;. You get the idea.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-22T00:21:06.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14945" PostTypeId="2" ParentId="14923" CreationDate="2015-08-22T00:31:56.523" Score="27" Body="&lt;p&gt;I had to run some test, but I managed to run a small file that exports correctly to both latex and HTML, I tested only in org 8.2.10, but it should work on other versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is actually the same as in &lt;a href=&quot;https://emacs.stackexchange.com/questions/12336/org-export-to-latex-and-html-references&quot;&gt;Org export to latex and HTML references&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I have a small example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*  This is a latex experiment&#xA;so with the text...&#xA;#+NAME: code:1&#xA;#+BEGIN_SRC shell-script&#xA;echo hello world &#xA;#+END_SRC&#xA;[[code:1]] is a reference to src block&#xA;&#xA;#+NAME: eqn:1&#xA;\begin{equation}&#xA;    f(x) =  \sum\limits_0^\infty(f^{(n)}(x)|_{x=0} \cdot x)&#xA;\end{equation}&#xA;&#xA;And this is an equation [[eqn:1]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8289" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-08-22T00:31:56.523" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14946" PostTypeId="1" AcceptedAnswerId="15017" CreationDate="2015-08-22T02:39:21.090" Score="11" ViewCount="4882" Body="&lt;p&gt;Does anyone know of a javascript editing mode that supports the &lt;a href=&quot;https://github.com/lukehoban/es6features#readme&quot;&gt;es6 syntax additions&lt;/a&gt; (arrow functions, extends, imports, generators, etc.)? I've done some quick searching but it looks like so far everyone just uses &lt;code&gt;js2-mode&lt;/code&gt; and ignores the syntax errors.&lt;/p&gt;&#xA;" OwnerUserId="8699" LastActivityDate="2015-08-24T20:48:18.693" Title="Javascript mode compatible with es6" Tags="|major-mode|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14947" PostTypeId="1" AcceptedAnswerId="14954" CreationDate="2015-08-22T06:21:20.960" Score="5" ViewCount="1397" Body="&lt;p&gt;I have a directory &lt;code&gt;~/foo&lt;/code&gt; that contains several &lt;code&gt;org&lt;/code&gt; files. I'd like to use &lt;code&gt;htmlize&lt;/code&gt; to convert each &lt;code&gt;org&lt;/code&gt; file into an &lt;code&gt;html&lt;/code&gt; file. Ideally this would be done with a shell script. Is there a way to make a shell script use &lt;code&gt;htmlize&lt;/code&gt; to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="105" LastEditDate="2021-01-24T18:26:52.073" LastActivityDate="2021-01-24T18:26:52.073" Title="Can emacs commands be called from a shell script?" Tags="|shell|commands|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14948" PostTypeId="1" AcceptedAnswerId="15154" CreationDate="2015-08-22T06:45:41.880" Score="5" ViewCount="8190" Body="&lt;p&gt;Here are my steps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- Switch to Shell &lt;code&gt;C-c C-z&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tG7AL.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tG7AL.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- Click enter to accept&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qVnkx.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qVnkx.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3- Eval-Buffer &lt;code&gt;C-c C-c&lt;/code&gt; to run the script&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/G8ui4.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/G8ui4.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just got the following message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;sent: #!/usr/bin/env python...&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;Eval-File&lt;/code&gt; works fine. It's just &lt;code&gt;Eval-Buffer&lt;/code&gt; what doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have I miss anything?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've just noticed that before running the script I get the following line printed in my messages buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Can't guess python-indent-offset, using defaults: 4&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is very strange because &lt;code&gt;C-h-v python-indent-offset&lt;/code&gt; shows me that it's already set to 4 spaces...&lt;/p&gt;&#xA;" OwnerUserId="6546" LastEditorUserId="6546" LastEditDate="2015-08-29T05:26:32.070" LastActivityDate="2020-02-25T04:10:59.420" Title="Python-mode: Eval-Buffer [C-c C-c] doesn't run my script" Tags="|python|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14949" PostTypeId="2" ParentId="14947" CreationDate="2015-08-22T07:28:37.970" Score="8" Body="&lt;p&gt;You can run &lt;code&gt;emacs --batch f htmlize-my-org --kill&lt;/code&gt; where &lt;code&gt;htmlize-my-org&lt;/code&gt; is a function you've written that runs htmlize on those files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also pass files on the command line, e.g. &lt;code&gt;emacs --batch --insert ~/foo/file1.org -f htmlize-my-org --kill&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a more complete example, here's a way to run &lt;code&gt;M-x delete-trailing-whitespace&lt;/code&gt; on all files in a dir:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ for file in ~/fixme/*; do &#xA;      emacs -Q --batch --insert &quot;${file}&quot; -f delete-trailing-whitespace \&#xA;        --eval &quot;(write-file \&quot;${file}.fixed\&quot;)&quot; --kill&#xA;  done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;man emacs&lt;/code&gt; (search for &quot;batch&quot;) for more info.&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2015-08-22T07:28:37.970" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14950" PostTypeId="1" AcceptedAnswerId="17997" CreationDate="2015-08-22T08:46:25.750" Score="4" ViewCount="326" Body="&lt;p&gt;Sometimes when I try to run &lt;code&gt;recover-this-file&lt;/code&gt; I get an error &lt;code&gt;Invalid coding system: auto-save-coding&lt;/code&gt; which prevents the file from being recovered. I had to manually find the autosave file and copy contents. Strangely it doesn't happen to all of my &lt;code&gt;recover-this-file&lt;/code&gt; attempts and I'm not sure what's the cause of it. Also I could recover files with UTF-8 characters so I don't think non-ASCII characters are really the cause either.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2016-05-09T14:03:49.477" Title="Invalid coding system: auto-save-coding when trying to recover auto-save files" Tags="|character-encoding|auto-save|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14952" PostTypeId="1" CreationDate="2015-08-22T11:10:15.930" Score="14" ViewCount="16002" Body="&lt;p&gt;I have my hunspell dictionaries at &lt;code&gt;C:\hunspell\&lt;/code&gt;. It contains &lt;code&gt;.dic&lt;/code&gt; and &lt;code&gt;.aff&lt;/code&gt; files for three languages: &lt;code&gt;en_GB&lt;/code&gt;, &lt;code&gt;en_US&lt;/code&gt;, and &lt;code&gt;nb_NO&lt;/code&gt;. The descriptions I find on the web about how to make hunspell work in Emacs make me confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the minimum code I need in my init file to be able to use these three hunspell dictionaries in Emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried the following code suggested by one web site:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'exec-path &quot;C:/hunspell/bin/&quot;)&#xA;(setq ispell-program-name (locate-file &quot;hunspell&quot;&#xA;                       exec-path exec-suffixes 'file-executable-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when wanting to change dictionary by &lt;code&gt;M-x ispell-change-dictionary&lt;/code&gt;, I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ispell-phaf: No matching entry for nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="2487" LastEditDate="2015-08-22T11:55:10.360" LastActivityDate="2023-07-28T00:28:53.707" Title="How do I set up hunspell on a Windows PC?" Tags="|microsoft-windows|hunspell|" AnswerCount="6" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14953" PostTypeId="2" ParentId="14952" CreationDate="2015-08-22T11:58:27.820" Score="0" Body="&lt;p&gt;This is just a guess, but maybe you need to tell which language you would&#xA;like to use as the “default”:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ispell-dictionary &quot;en&quot;) ; default dictionary&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Default value of &lt;code&gt;ispell-dictionary&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, so may be this is the cause&#xA;of your problem.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-08-22T11:58:27.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14954" PostTypeId="2" ParentId="14947" CreationDate="2015-08-22T12:07:44.757" Score="6" Body="&lt;p&gt;You can use the following emacs lisp code saved in htmlize-script.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/path/to/htmlize/&quot;)&#xA;(require 'htmlize)&#xA;&#xA;&#xA;(defun htmlize-files-in-dir (dir)&#xA;  (htmlize-many-files (directory-files dir t &quot;.org$&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then use the following command from a script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q -nw --eval &quot;(progn (load-file \&quot;/path/to/htmlize-script.el\&quot;) (htmlize-files-in-dir \&quot;$1\&quot;))&quot; --kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Call the script with &lt;code&gt;scriptname /path/to/org/files&lt;/code&gt;.&#xA;This will shortly show up the textual frame as was pointed out in the comments of the answer of unhammer, if you want to avoid that you can run emacs as a server and use the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &quot;(progn (load-file \&quot;/path/to/htmlize-script.el\&quot;) (htmlize-files-in-dir \&quot;$1\&quot;))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-08-22T12:32:32.277" LastActivityDate="2015-08-22T12:32:32.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14955" PostTypeId="1" CreationDate="2015-08-22T13:27:14.617" Score="3" ViewCount="887" Body="&lt;p&gt;When I type the first few letters of some C/C++ keywords, company does't respond until I execute &lt;code&gt;company-keywords&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I make company auto complete C/C++ keywords while I type?&lt;/p&gt;&#xA;" OwnerUserId="9268" LastEditorUserId="105" LastEditDate="2015-08-22T15:40:04.480" LastActivityDate="2016-07-29T14:00:08.433" Title="My company package can't auto-complete the keywords of C/C++" Tags="|completion|company-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14956" PostTypeId="2" ParentId="14943" CreationDate="2015-08-22T13:51:17.533" Score="3" Body="&lt;p&gt;To see what command a key is bound to at any point, use the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Key-Help.html#Key-Help&quot; rel=&quot;nofollow noreferrer&quot;&gt;key help&lt;/a&gt; commands. Type &lt;code&gt;C-h c RET&lt;/code&gt; to see what RET is bound to. In a minibuffer, that's &lt;code&gt;minibuffer-complete-and-exit&lt;/code&gt;. Because a minibuffer is active, the message will only appear for a brief time; switch to the &lt;code&gt;*Messages*&lt;/code&gt; buffer if you haven't had time to read it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full message you'll see is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;RET (translated from &amp;lt;return&amp;gt;) runs the command minibuffer-complete-and-exit&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/a/14944&quot;&gt;Drew's answer&lt;/a&gt; for a throughout explanation of the bit about “RET (translated from &amp;lt;return&amp;gt;)”.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to issue the &lt;code&gt;newline&lt;/code&gt; command, you can look for a binding to it: type &lt;code&gt;C-h w newline RET&lt;/code&gt;. You'll be told that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;newline is not on any key&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the only way to run the &lt;code&gt;newline&lt;/code&gt; command would be to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/M_002dx.html#M_002dx&quot; rel=&quot;nofollow noreferrer&quot;&gt;execute it by name&lt;/a&gt;: &lt;code&gt;M-x newline RET&lt;/code&gt;. But this requires a second minibuffer to type the command name, and by default Emacs won't let you do that, because having multiple active minibuffers can get confusing. Set the variable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-Edit.html#index-enable_002drecursive_002dminibuffers&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;enable-recursive-minibuffers&lt;/code&gt;&lt;/a&gt; to allow it (&lt;code&gt;(setq enable-recursive-minibuffers t)&lt;/code&gt; in your init file, or &lt;code&gt;M-x set-variable RET enable-recursive-minibuffers RET t RET&lt;/code&gt; to enable it for this session).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to insert a newline in a minibuffer, use the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Inserting-Text.html#index-quoted_002dinsert&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;quoted-insert&lt;/code&gt;&lt;/a&gt; command. But you need to type &lt;code&gt;C-q C-j&lt;/code&gt;, not &lt;code&gt;C-q RET&lt;/code&gt;, because a &lt;a href=&quot;https://en.wikipedia.org/wiki/Newline&quot; rel=&quot;nofollow noreferrer&quot;&gt;newline&lt;/a&gt; in Emacs (like in most of the computer world today) is a line feed character, which is what &lt;code&gt;C-j&lt;/code&gt; is, rather than a carriage return character, which is what &lt;code&gt;RET&lt;/code&gt; (an alias for &lt;code&gt;C-m&lt;/code&gt;) is.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-08-22T13:51:17.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14957" PostTypeId="2" ParentId="14955" CreationDate="2015-08-22T14:03:44.947" Score="2" Body="&lt;p&gt;There is two variables you can configure to make company behave the way you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-minimum-prefix-length 1)&#xA;(setq company-idle-delay 0.1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will make company start the completion 0.1 second after you type the first character. You can play with those until you have what you need&lt;/p&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-08-22T16:27:06.050" LastActivityDate="2015-08-22T16:27:06.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14958" PostTypeId="2" ParentId="12605" CreationDate="2015-08-22T14:21:57.813" Score="2" Body="&lt;p&gt;Your initial idea to merely remap &lt;code&gt;dd&lt;/code&gt; has another subtle issue.  As you surely know &lt;code&gt;Vd&lt;/code&gt; is basically the same as &lt;code&gt;dd&lt;/code&gt; (in a sense that it operates on a whole line), so it should also exhibit the same desired behavior somehow (i.e. use &lt;code&gt;haskell-interactive-mode-kill-whole-line&lt;/code&gt; as a back end).  I hope it's clear that this also applies to an infinite set of other possibilities: &lt;code&gt;10dd&lt;/code&gt;, &lt;code&gt;Vjjjd&lt;/code&gt;, and etc.  Hence, we are going to define our own &lt;code&gt;haskell-delete&lt;/code&gt; operator (thanks to the Evil framework facilities):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-operator haskell-delete&#xA;    (beg end type register yank-handler)&#xA;  &quot;Delete text from BEG to END with TYPE.&#xA;Save in REGISTER or in the kill-ring with YANK-HANDLER.&quot;&#xA;  (interactive &quot;&amp;lt;R&amp;gt;&amp;lt;x&amp;gt;&amp;lt;y&amp;gt;&quot;)&#xA;  (if (eq type 'line)&#xA;      (progn&#xA;        (unless register&#xA;          (let ((text (filter-buffer-substring beg end)))&#xA;            (unless (string-match-p &quot;\n&quot; text)&#xA;              (evil-set-register ?- text))))&#xA;        (let ((evil-was-yanked-without-register nil))&#xA;          (evil-yank beg end type register yank-handler))&#xA;        (dotimes (var (count-lines beg end))&#xA;          (haskell-interactive-mode-kill-whole-line)))&#xA;    (evil-delete beg end type register yank-handler))&#xA;  (when (and (evil-called-interactively-p)&#xA;             (eq type 'line))&#xA;    (evil-first-non-blank)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And now simply remap &lt;code&gt;d&lt;/code&gt; in &lt;code&gt;haskell-interactive-mode-map&lt;/code&gt; specific to the Normal state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'normal haskell-interactive-mode-map&#xA;  (kbd &quot;d&quot;) #'haskell-delete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please, let me know if you encounter any issues, so that we could jointly fix them.&lt;/p&gt;&#xA;" OwnerUserId="2454" LastActivityDate="2015-08-22T14:21:57.813" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14960" PostTypeId="1" CreationDate="2015-08-22T17:12:11.583" Score="2" ViewCount="511" Body="&lt;p&gt;&lt;code&gt;realgud&lt;/code&gt; seems to want to guess the path of the second argument of the command supplied to &lt;code&gt;M-x pdb&lt;/code&gt; (or &lt;code&gt;M-x realgud:pdb&lt;/code&gt;).  When I'm visiting a buffer in /some/path/foo.py, without realgud:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(hiding the long docker command here -- the ... should be understood to mean the rest of the middle of that long command)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x pdb&#xA;Run pdb (like this): docker run ... some_test&#xA;# Command supplied is run&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with realgud:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x pdb&#xA;Run pdb (like this): docker run ... some_test&#xA;# Output:&#xA;Current directory: /some/path/&#xA;Command: docker /some/path/run ... some_test&#xA;docker: '/some/path/run' is not a docker command.&#xA;See 'docker --help'.&#xA;&#xA;Process pdb exited abnormally with code 127&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That of course immediately fails, because &lt;code&gt;run&lt;/code&gt; here is not the path of some program, but an argument to &lt;code&gt;docker&lt;/code&gt;.  Why does realgud think it knows this, and how can I prevent it from doing that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;realgud:trepan2 doesn't suffer from this problem, and neither does plain old &lt;code&gt;M-x pdb&lt;/code&gt; when realgud is not installed, so it seems it's not fundamantal.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2017-03-09T02:17:06.547" Title="How to prevent realgud:pdb with arbitrary command absolutizing paths" Tags="|python|realgud|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14961" PostTypeId="2" ParentId="14925" CreationDate="2015-08-22T17:15:01.053" Score="1" Body="&lt;p&gt;When you write a theme, you need to make sure everything is named correctly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your theme file must end with the postfix (or should I say suffix?) &lt;code&gt;-theme&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Your &lt;code&gt;deftheme&lt;/code&gt;, &lt;code&gt;provide-theme&lt;/code&gt;, and &lt;code&gt;custom-theme-set-faces&lt;/code&gt; must &lt;strong&gt;not&lt;/strong&gt; have the theme postfix &lt;code&gt;-theme&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if all of those are really needed, but I always do like this so I don't have this undefined error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, and don't forget to add your theme dir to the &lt;code&gt;custom-theme-load-path&lt;/code&gt; list&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-08-22T17:15:01.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14962" PostTypeId="1" CreationDate="2015-08-22T17:20:40.757" Score="3" ViewCount="79" Body="&lt;p&gt;I have emacs set up to indent Python code like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo(&#xA;    bar, baz&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That works fine.  However, that style in a particular program I'm working on very often means I find myself with text like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_very_long_python_function_call(an_extremely_long_name_here, and_another_one_right_here)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At which point I'd like to be able to ask emacs to reformat that line, or sexp if you like (the one at &lt;code&gt;point&lt;/code&gt;, let's say), like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_very_long_python_function_call(&#xA;    an_extremely_long_name_here, and_another_one_right_here&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or possibly like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_very_long_python_function_call(&#xA;    an_extremely_long_name_here,&#xA;    and_another_one_right_here&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do that?  Just using regular editing keys I find it a bit of a chore.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2015-12-18T09:13:38.620" Title="Indent parenthesized Python expression" Tags="|indentation|python|balanced-parentheses|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14964" PostTypeId="1" AcceptedAnswerId="14967" CreationDate="2015-08-22T19:32:44.840" Score="2" ViewCount="760" Body="&lt;p&gt;What is a good, clean  to deal with paths in emacs lisp?&#xA;Common lisp has pathnames, Python has os.path. But I always seem to end up reinventing the wheel and resorting to manual regexes for simple path operations like getting a path basename, dirname, or joining paths together in a sane way. &lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2015-08-22T21:25:26.663" LastActivityDate="2015-08-22T21:25:26.663" Title="Appropriate way to deal with file-names and file-name components (&quot;paths&quot;) in emacs lisp?" Tags="|files|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14965" PostTypeId="2" ParentId="14964" CreationDate="2015-08-22T19:51:15.430" Score="-2" Body="&lt;p&gt;elisp has the list &lt;code&gt;load-path&lt;/code&gt;. When you want to add a new path to the scope, just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;my/new/path&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, supose you have a file.el in that directory. In the end of the file, put the line &lt;code&gt;(provide 'file)&lt;/code&gt;, and then you can require it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also require files in subfolders of your load-path, if they are provided as such, with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'subfolder/file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-08-22T19:51:15.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14966" PostTypeId="2" ParentId="14964" CreationDate="2015-08-22T20:16:53.240" Score="4" Body="&lt;p&gt;What you are, I think, calling &quot;paths&quot; Emacs and Emacs Lisp call &quot;&lt;em&gt;absolute&lt;/em&gt;&quot; file or directory names. In Emacs language, a &lt;em&gt;&quot;path&quot;&lt;/em&gt; is a list of absolute directory names, as used, for example, in the environment variable &lt;code&gt;PATH&lt;/code&gt; and Emacs variables &lt;code&gt;exec-path&lt;/code&gt; etc. (And yes, Common Lisp refers to these as &quot;paths&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wrt the question of getting parts of a file name, combining them, etc., see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Names.html&quot; rel=&quot;nofollow&quot;&gt;File Names&lt;/a&gt; and its subnodes, such as &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Components.html&quot; rel=&quot;nofollow&quot;&gt;File Name Components&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond that, your question is very general (and risks being closed as too broad). Please consider posing a specific question -- something that you want to do with file names or file-name components. Your question is OK as asking for general info about Emacs file-name functions, but a specific how-to question would also be useful.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-22T20:22:50.053" LastActivityDate="2015-08-22T20:22:50.053" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14967" PostTypeId="2" ParentId="14964" CreationDate="2015-08-22T20:19:21.913" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/rejeep/f.el&quot; rel=&quot;nofollow&quot;&gt;f.el&lt;/a&gt; package is a collection of prefixed functions wrapping existing functions as referenced in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Names.html&quot; rel=&quot;nofollow&quot;&gt;File Names&lt;/a&gt; and comes with a few of its own.  I've found it useful to study its code for figuring out which built-in functions to use, but you can use it like a regular library as well.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-08-22T20:19:21.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14968" PostTypeId="1" CreationDate="2015-08-22T20:57:14.023" Score="3" ViewCount="746" Body="&lt;p&gt;When the point is not at the beginning of a word/sexp, &lt;code&gt;backward-word / backward-sexp&lt;/code&gt; places the cursor at the beginning of that word/sexp. If the point is already at the beginning of a word/sexp, this is of course not the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to go to the beginning of the current word/sexp regardless of the point position? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1&lt;/strong&gt;: By current sexp, I mean the smallest sexp containing the point, for example if the cursor is at &lt;code&gt;o&lt;/code&gt; in the expression &lt;code&gt;(end-of-line)&lt;/code&gt;, the current sexp would be &lt;code&gt;end-of-line&lt;/code&gt;. If the cursor is at &lt;code&gt;(&lt;/code&gt;, the current sexp would be the whole &lt;code&gt;(end-of-line)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;:&#xA; Another reformulation of this question: &lt;em&gt;how to detect if the point is at the beginning of the current word/sexp?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-22T22:02:51.870" LastActivityDate="2015-08-22T22:02:51.870" Title="How to go to the beginning of a word/sexp?" Tags="|navigation|words|sexp|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14969" PostTypeId="1" AcceptedAnswerId="47720" CreationDate="2015-08-22T21:17:53.883" Score="0" ViewCount="151" Body="&lt;p&gt;&lt;code&gt;M-x pdb&lt;/code&gt; is great while debugging.  When the python process exits though, often there is a traceback left behind in the &lt;code&gt;gud&lt;/code&gt; buffer that I'd like to view using &lt;code&gt;compilation-mode&lt;/code&gt; so I can use &lt;code&gt;next-error&lt;/code&gt; to step through the stack frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can always &lt;code&gt;M-x compilation-mode&lt;/code&gt; on python exit.  Can I have emacs automatically do that for me?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2019-02-09T14:55:59.003" Title="After `M-x pdb` switch to `compilation-mode` automatically?" Tags="|python|debugging|compilation-mode|gud|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14970" PostTypeId="1" AcceptedAnswerId="14972" CreationDate="2015-08-22T22:01:00.637" Score="4" ViewCount="530" Body="&lt;p&gt;Recently I've done a lot of work cleaning up some HTML files that were generated by LibreOffice.  It made me &lt;em&gt;really&lt;/em&gt; wish for a way to edit the document structure, à la &lt;code&gt;paredit-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for some reason LibreOffice rendered one particular ordered list like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;ol&amp;gt;&#xA;  &amp;lt;li&amp;gt;...&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ol&amp;gt;&#xA;&amp;lt;ol start=&quot;2&quot;&amp;gt;&#xA;  &amp;lt;li&amp;gt;...&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ol&amp;gt;&#xA;&amp;lt;ol start=&quot;3&quot;&amp;gt;&#xA;  &amp;lt;li&amp;gt;...&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ol&amp;gt;&#xA;&amp;lt;!-- etc --&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would have loved a way to put the point somewhere in the first &lt;code&gt;ol&lt;/code&gt; and issue a command analogous to &lt;code&gt;paredit-forward-slurp-sexp&lt;/code&gt; to pull the content of the second list into the first, and then repeat for all the remaining lists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As another example, I also needed to insert some breaks in a set of nested &lt;code&gt;div&lt;/code&gt;s:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;foo&quot;&amp;gt;&#xA;  &amp;lt;div class=&quot;bar&quot;&amp;gt;&#xA;    ...&#xA;    &amp;lt;-- point is here&#xA;  &amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wished I could issue a command analogous to &lt;code&gt;paredit-split-sexp&lt;/code&gt; twice to get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;foo&quot;&amp;gt;&#xA;  &amp;lt;div class=&quot;bar&quot;&amp;gt;&#xA;    ...&#xA;  &amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;-- point is here&#xA;&amp;lt;div class=&quot;foo&quot;&amp;gt;&#xA;  &amp;lt;div class=&quot;bar&quot;&amp;gt;&#xA;  &amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does such a thing exist?&lt;/p&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2015-08-22T23:07:22.530" Title="Editing HTML structurally" Tags="|html|paredit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14971" PostTypeId="1" CreationDate="2015-08-22T22:31:52.120" Score="12" ViewCount="2003" Body="&lt;p&gt;When writing LaTeX using &lt;code&gt;latex-mode&lt;/code&gt;, I often want to write &quot;half-open intervals&quot; in my text.  For instance, &lt;code&gt;[0,1)&lt;/code&gt;, which refers to the set of all numbers &lt;code&gt;x&lt;/code&gt; with &lt;code&gt;0 &amp;lt;= x &amp;lt; 1&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, these &quot;unbalanced delimiters&quot; seem to confuse the indentation parser, causing following text to be indented inappropriately, usually drifting to the right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example document.  The text below is the result after doing &lt;code&gt;C-x h M-x indent-region&lt;/code&gt;.  The correct behavior would be to have all of both paragraphs indented by 0 spaces.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\begin{document}&#xA;&#xA;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam volutpat&#xA;at dui et mattis. Here is a half open interval $[0,1)$.  Proin&#xA;  fringilla lectus nec mi tincidunt aliquet. Vestibulum fermentum eu&#xA;  neque id egestas. Here is another $[1,2)$.  Nullam et lectus&#xA;    convallis, placerat neque non, vehicula nisi.  Fusce imperdiet&#xA;    dignissim ante, eget fringilla nisi.&#xA;&#xA;    Integer fermentum nunc eget purus molestie commodo. Integer&#xA;    tristique tincidunt odio, vel rutrum diam commodo quis. Fusce a&#xA;    aliquet quam. Cras suscipit est et nisl sollicitudin&#xA;    iaculis. Aliquam erat volutpat. Phasellus sapien arcu, aliquet ut&#xA;    hendrerit in, lobortis nec ante.&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently I am working around this with an ugly hack: I define a LaTeX macro that expands to nothing, and write the &quot;matching&quot; delimiters inside an invocation of this macro.  This gets the indenter back in sync.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\newcommand{\ugh}[1]{}&#xA;\begin{document}&#xA;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam volutpat&#xA;at dui et mattis. Here is a half open interval $[0,1)$.  Proin&#xA;  fringilla lectus nec mi tincidunt aliquet. Vestibulum fermentum eu&#xA;  neque id egestas. \ugh{(]} Now on the next line we are back in sync.&#xA;Nullam et lectus convallis, placerat neque non, vehicula nisi.  Fusce&#xA;imperdiet dignissim ante, eget fringilla nisi.&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this is really unpleasant.  Is there a better solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.4.1.&lt;/p&gt;&#xA;" OwnerUserId="9275" LastEditorUserId="620" LastEditDate="2015-09-12T18:00:38.357" LastActivityDate="2022-08-12T08:18:51.910" Title="How can I write [0,1) in LaTeX mode without breaking indentation?" Tags="|indentation|latex|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14972" PostTypeId="2" ParentId="14970" CreationDate="2015-08-22T23:07:22.530" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/magnars/tagedit&quot; rel=&quot;noreferrer&quot;&gt;Tagedit&lt;/a&gt; is what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the README:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;tagedit-forward-slurp-tag moves the next sibling into this tag.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;tagedit-forward-barf-tag moves the last child out of this tag.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;tagedit-raise-tag replaces the parent tag with this tag.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;tagedit-splice-tag replaces the parent tag with its contents.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;tagedit-join-tags combines two tags into one, prompting for tagname if they differ.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;tagedit-split-tag splits a tag into two.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;tagedit-convolute-tags switches the parents of the current tag, along with previous siblings.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;tagedit-kill kills to the end of the line, while preserving the structure.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-08-22T23:07:22.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14973" PostTypeId="1" AcceptedAnswerId="14993" CreationDate="2015-08-22T23:47:24.237" Score="1" ViewCount="374" Body="&lt;p&gt;I'm not from a vim background so I remap a lot of the evil commands and keys to fit my needs. I know you can use &lt;code&gt;evil-repeat&lt;/code&gt; but I like the following better to quickly kill a few lines: &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun evil-delete-or-repeat-delete-line ()&#xA;  (interactive)&#xA;  (if (or (eq last-command this-command)&#xA;          (eq last-command 'evil-line))&#xA;      (progn&#xA;        (setq this-command 'evil-line)&#xA;        (call-interactively 'evil-repeat)&#xA;        (kill-new (concat (cadr kill-ring) (car kill-ring))))&#xA;    (call-interactively 'evil-delete)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function repeats deleting lines if I press the &lt;code&gt;evil-delete&lt;/code&gt; key multiple times and also preserves the &lt;code&gt;evil-delete&lt;/code&gt; functionality. It appends every subsequent kills to the kill ring, too. This works with the following binding:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;x&quot;) 'evil-delete-or-repeat-delete-line) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to have something similar for &lt;code&gt;evil-yank&lt;/code&gt;. For this the cursor should move to the next line after every call. I tried but couldn't get it to work. Can anyone help me?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="2642" LastEditDate="2015-08-24T03:54:40.453" LastActivityDate="2015-08-24T03:54:40.453" Title="How to &quot;auto&quot; repeat evil-yank?" Tags="|key-bindings|evil|text-editing|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14974" PostTypeId="1" AcceptedAnswerId="14976" CreationDate="2015-08-23T00:36:21.043" Score="1" ViewCount="97" Body="&lt;p&gt;When I do reverse incremental search, the cursor is placed at the beginning of a match for my search, and stays there as I type further characters that match. With forward search, on the other hand, the cursor moves forward as I continue to type matching letters. Is there a way to do a forward search that behaves like backward search in this respect? (To place the cursor at the beginning of a match, I first do a forward search, then do a reverse search. I'd like to avoid this, if possible.)&lt;/p&gt;&#xA;" OwnerUserId="9276" LastEditorUserId="9276" LastEditDate="2015-08-23T00:44:09.947" LastActivityDate="2015-08-23T00:53:00.133" Title="Making forward search behave (a bit) like backward search" Tags="|isearch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14976" PostTypeId="2" ParentId="14974" CreationDate="2015-08-23T00:53:00.133" Score="0" Body="&lt;p&gt;I have the this in my init taken from the emacswiki to solve this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-goto-match-beginning ()&#xA;  (when (and isearch-forward isearch-other-end)&#xA;    (goto-char isearch-other-end)))&#xA;&#xA;(add-hook 'isearch-mode-end-hook 'my-goto-match-beginning)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you leave the search, the point will jump to the beginning automatically.&lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-08-23T00:53:00.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14977" PostTypeId="1" AcceptedAnswerId="14980" CreationDate="2015-08-23T01:16:43.893" Score="7" ViewCount="1228" Body="&lt;p&gt;So as far as I understand it you create association lists that look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((rose . red)&#xA; (violet . violet)&#xA; (chrysanthemum . who-knows))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is, what do you do if you want &lt;code&gt;rose&lt;/code&gt;, &lt;code&gt;violet&lt;/code&gt;, etc., to be evaluated before they're put into the alist? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for normal lists you can do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list 1 2 3 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(1 2 3 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do you replicate this functionality? I'm new to elisp and Emacs, so please forgive any errors or misnomers.&lt;/p&gt;&#xA;" OwnerDisplayName="user9278" LastActivityDate="2015-08-23T03:09:37.447" Title="Creating an association list with element evaluation" Tags="|elisp|" AnswerCount="2" CommentCount="0" ClosedDate="2015-08-23T13:38:51.187" ContentLicense="CC BY-SA 3.0" />
  <row Id="14978" PostTypeId="2" ParentId="14977" CreationDate="2015-08-23T01:35:28.273" Score="3" Body="&lt;p&gt;An alist is just a list.  So, you can use all the normal list-constructing functions like &lt;code&gt;cons&lt;/code&gt; or &lt;code&gt;list&lt;/code&gt;.  Or, if you want to write one that looks like a constant, you can use backquote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`((,(rose) . red)&#xA;  (,(violet) . violet))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will evaluate &lt;code&gt;rose&lt;/code&gt; and &lt;code&gt;violet&lt;/code&gt; at construction time and substitute the results.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-08-23T01:35:28.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14979" PostTypeId="1" AcceptedAnswerId="14981" CreationDate="2015-08-23T01:42:12.040" Score="2" ViewCount="326" Body="&lt;p&gt;As I've read, eshell commands are just wrappers around actual elisp expressions. If true, everything I do in eshell I could do in an elisp REPL, right? Is it therefore possible to see what actual elisp is being invoked when we type in an eshell command? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I ask is that I want to use org-mode's Babel. You can put elisp code in blocks and get results inserted after the block just fine. This is also true for regular shell (sh), but there is no way I know of running eshell commands as Babel &quot;code blocks.&quot; So I'd like to have the actual elisp, which org-mode Babel handles in blocks well.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2015-08-23T12:48:14.200" Title="Access to the elisp &quot;commands&quot; behind eshell commands?" Tags="|elisp|eshell|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14980" PostTypeId="2" ParentId="14977" CreationDate="2015-08-23T03:09:37.447" Score="5" Body="&lt;p&gt;Here you go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list (cons rose red)&#xA;      (cons violet violet)&#xA;      (cons chrysanthemum who-knows))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;each flower should be bound to a value.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-08-23T03:09:37.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14981" PostTypeId="2" ParentId="14979" CreationDate="2015-08-23T06:29:57.527" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is it therefore possible to see what actual elisp is being invoked...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. They are all located in the eshell folder under Resources/elisp in the Emacs app folder. See screenshot of files on my computer. &lt;a href=&quot;https://i.stack.imgur.com/B4FGD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/B4FGD.png&quot; alt=&quot;screenshot of that list on my local computer&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So I'd like to have the actual elisp...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Open any of those files to see the actual elisp code. For example, ls command with its normal switches is implemented in em-ls.el file by John Wiegley and its core uses expand-file-name function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to find which lisp file provides what shell command? Open eshell prompt and then type, say you want to know where kill is in elisp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;which kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will tell you that &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eshell/kill is a compiled Lisp function in `esh-proc.el'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What other commands are available in eshell?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;see the [manual][2]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;there is no way I know of running eshell commands as Babel &quot;code blocks.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There are no special eshell commands &lt;em&gt;per se&lt;/em&gt;. Eshell mimics standard unix shell commands using existing lisp functions. You can invoke those same functions in org-babel lisp blocks without any mediating functions implemented in eshell. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-08-23T06:37:25.990" LastActivityDate="2015-08-23T06:37:25.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14982" PostTypeId="2" ParentId="14979" CreationDate="2015-08-23T12:32:07.393" Score="2" Body="&lt;p&gt;e.g.: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-function&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;eshell/ls&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like having &lt;code&gt;find-function&lt;/code&gt; bound to &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;C-f&lt;/kbd&gt; as a variant on the standard &lt;code&gt;describe-function&lt;/code&gt; binding (via which you can also indirectly get to the code, FYI).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eshell/goto (name)&#xA;  &quot;Visit the source code for the specified eshell command.&quot;&#xA;  (let ((func (eshell-find-alias-function name)))&#xA;    (if func&#xA;        (find-function func)&#xA;      (error &quot;%s is not an elisp function&quot; name))))&#xA;&#xA;$ goto ls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to know what's implemented in elisp and what isn't, you could just ask Emacs to complete on &lt;code&gt;eshell/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.: &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; &lt;code&gt;eshell/&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-08-23T12:48:14.200" LastActivityDate="2015-08-23T12:48:14.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14983" PostTypeId="2" ParentId="14971" CreationDate="2015-08-23T13:33:29.007" Score="3" Body="&lt;p&gt;The indentation function &lt;code&gt;latex-indent&lt;/code&gt; of &lt;code&gt;latex-mode&lt;/code&gt; sets the syntax-table to &lt;code&gt;tex-latex-indent-syntax-table&lt;/code&gt; and calls &lt;code&gt;latex-find-indent&lt;/code&gt; which in turn calls &lt;code&gt;latex-backward-sexp-1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The syntax of &lt;code&gt;?\(&lt;/code&gt; and &lt;code&gt;?\)&lt;/code&gt; is set to &lt;code&gt;&quot;.&quot;&lt;/code&gt; which stands for &quot;punctuation&quot;. So it is no longer a delimiter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, expressions like &lt;code&gt;[0,1)&lt;/code&gt; result into a &lt;code&gt;scan-error&lt;/code&gt; in &lt;code&gt;latex-backward-sexp-1&lt;/code&gt; which leads to the unexpected behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can avoid this by adding the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;tex-mode&quot;&#xA;    '(progn (modify-syntax-entry ?\( &quot;()&quot; tex-latex-indent-syntax-table)&#xA;             (modify-syntax-entry ?\) &quot;)(&quot; tex-latex-indent-syntax-table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, I do not know the negative consequences of this setting since I use &lt;code&gt;auctex&lt;/code&gt;.&#xA;So, expect the worst;-).&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="1982" LastEditDate="2016-03-23T09:45:34.883" LastActivityDate="2016-03-23T09:45:34.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14984" PostTypeId="1" AcceptedAnswerId="15008" CreationDate="2015-08-23T14:18:57.997" Score="3" ViewCount="896" Body="&lt;p&gt;I just setup powerline for the first time and there's this whitish transparent background overtop all of the arrows. Is there anyway to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IEvnD.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, while we're at it, just a general question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does the 2.24 in the mode line mean?&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2018-08-06T01:58:47.283" Title="Emacs powerline inconsistent colors behind arrows" Tags="|themes|mode-line|powerline|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14985" PostTypeId="1" AcceptedAnswerId="14991" CreationDate="2015-08-23T14:32:53.103" Score="6" ViewCount="300" Body="&lt;p&gt;I've added my own &lt;code&gt;.c&lt;/code&gt; file to Emacs &lt;code&gt;/src&lt;/code&gt; directory as well as the following lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs.o: ... file.c file.h&#xA;file.o: file.c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;deps.mk&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get &lt;code&gt;file.o&lt;/code&gt; generated, but it is not linked when generating Emacs executable (at least that's what I see when I check presence of my function). Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, what actions should I undertake to add my &lt;code&gt;.c&lt;/code&gt; file to Emacs executable?&lt;/p&gt;&#xA;" OwnerUserId="2133" LastEditorUserId="2133" LastEditDate="2015-08-23T17:09:54.527" LastActivityDate="2015-08-28T06:27:00.483" Title="How to add a new .c file to Emacs source code" Tags="|compilation|c|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14986" PostTypeId="1" CreationDate="2015-08-23T16:49:16.367" Score="0" ViewCount="423" Body="&lt;p&gt;&lt;code&gt;(progn (sleep-for 5) (x-focus-frame nil))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;focuses the Emacs frame, but also makes it the &quot;key window&quot; (ie, when you type, the keypresses gets sent to this window, which may or may not be the frontmost window).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;since &lt;code&gt;&quot;x-focus-frame is a built-in function in C source d&quot;&lt;/code&gt;, I don't know where to look for related functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The motivation is that I want one of my Emacs frames to always be on top, so I can keep an eye on the terminal output, while still being able to type into whatever application I'm currently using (e.g. the browser).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Objective-C's &lt;code&gt;orderFront&lt;/code&gt; would work, if this behavior were exposed (&lt;a href=&quot;https://stackoverflow.com/questions/4859974/make-nswindow-front-but-not-in-focus&quot;&gt;https://stackoverflow.com/questions/4859974/make-nswindow-front-but-not-in-focus&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;also, if this is impossible, how hard you think it would be to expose this functionality for the next release? For portability, I think (some?) Linux have the same concept (&quot;key window&quot; versus &quot;frontmost window&quot;); I don't know about MS Windows.&lt;/p&gt;&#xA;" OwnerUserId="2239" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-08-23T18:15:45.387" Title="OS X: make Emacs frame the frontmost window-manager window, but not the &quot;key window&quot;" Tags="|osx|frames|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14987" PostTypeId="2" ParentId="9530" CreationDate="2015-08-23T18:23:40.760" Score="8" Body="&lt;p&gt;After reading Dan's answer and your solution based on it, I put this together.  It opens a new, narrow, read-only clone to the left of the current buffer, and it binds &lt;code&gt;&amp;lt;mouse-1&amp;gt;&lt;/code&gt; and &lt;code&gt;RET&lt;/code&gt; locally in the clone to jump to that position in the base buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/open-tree-view ()&#xA;  &quot;Open a clone of the current buffer to the left, resize it to 30 columns, and bind &amp;lt;mouse-1&amp;gt; to jump to the same position in the base buffer.&quot;&#xA;  (interactive)&#xA;  (let ((new-buffer-name (concat &quot;&amp;lt;tree&amp;gt;&quot; (buffer-name))))&#xA;    ;; Create tree buffer&#xA;    (split-window-right 30)&#xA;    (if (get-buffer new-buffer-name)&#xA;        (switch-to-buffer new-buffer-name)  ; Use existing tree buffer&#xA;      ;; Make new tree buffer&#xA;      (progn  (clone-indirect-buffer new-buffer-name nil t)&#xA;              (switch-to-buffer new-buffer-name)&#xA;              (read-only-mode)&#xA;              (hide-body)&#xA;              (toggle-truncate-lines)&#xA;&#xA;              ;; Do this twice in case the point is in a hidden line&#xA;              (dotimes (_ 2 (forward-line 0)))&#xA;&#xA;              ;; Map keys&#xA;              (use-local-map (copy-keymap outline-mode-map))&#xA;              (local-set-key (kbd &quot;q&quot;) 'delete-window)&#xA;              (mapc (lambda (key) (local-set-key (kbd key) 'my/jump-to-point-and-show))&#xA;                    '(&quot;&amp;lt;mouse-1&amp;gt;&quot; &quot;RET&quot;))))))&#xA;&#xA;(defun my/jump-to-point-and-show ()&#xA;  &quot;Switch to a cloned buffer's base buffer and move point to the cursor position in the clone.&quot;&#xA;  (interactive)&#xA;  (let ((buf (buffer-base-buffer)))&#xA;    (unless buf&#xA;      (error &quot;You need to be in a cloned buffer!&quot;))&#xA;    (let ((pos (point))&#xA;          (win (car (get-buffer-window-list buf))))&#xA;      (if win&#xA;          (select-window win)&#xA;        (other-window 1)&#xA;        (switch-to-buffer buf))&#xA;      (goto-char pos)&#xA;      (when (invisible-p (point))&#xA;        (show-branches)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will work with &lt;code&gt;outline-mode&lt;/code&gt; and &lt;code&gt;outline-minor-mode&lt;/code&gt;, as well as modes that build on them, such as &lt;code&gt;org-mode&lt;/code&gt;.  I found &lt;a href=&quot;http://www.emacswiki.org/emacs/KeyBindingDiscussion&quot; rel=&quot;noreferrer&quot;&gt;some info&lt;/a&gt; about getting the local key maps, but I don't know how to choose which one to copy.  There's also &lt;a href=&quot;http://www.emacswiki.org/emacs/BufferLocalKeys&quot; rel=&quot;noreferrer&quot;&gt;this page&lt;/a&gt; which has a function to automatically make buffer-specific minor modes for setting buffer-local keys, but that seems out-of-scope for this issue.&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastEditorDisplayName="user3871" LastEditDate="2015-11-19T02:50:42.880" LastActivityDate="2015-11-19T02:50:42.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14988" PostTypeId="1" AcceptedAnswerId="14989" CreationDate="2015-08-23T18:28:47.110" Score="2" ViewCount="554" Body="&lt;p&gt;I am trying to write a function that prints the name of the current buffer to the file in the current buffer in its first line. For example, if the file is called &quot;test.el&quot;, when invoking such function, the result should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test.el&#xA;; rest of file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I am stuck with the following non-working function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-heading ()&#xA;  &quot;Write the name of the present file on the first line.&quot;&#xA;  (append-to-file (point-min)   ; start: beginning of buffer&#xA;                  200           ; end: I don't know when to stop&#xA;                  (buffer-name) ; filename&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Moreover, in the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Writing-to-Files.html&quot; rel=&quot;nofollow&quot;&gt;manual page&lt;/a&gt; for the function &lt;code&gt;append-to-file&lt;/code&gt;, it is written:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Don’t use these functions [&lt;code&gt;append-to-file&lt;/code&gt;and &lt;code&gt;write-region&lt;/code&gt;] to write to files that are being visited; that could cause confusion in the mechanisms for visiting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, how can I write a function that appends text to the beginning of my current file?&lt;/p&gt;&#xA;" OwnerUserId="2360" LastEditorUserId="105" LastEditDate="2016-11-12T03:11:43.127" LastActivityDate="2016-11-12T03:11:43.127" Title="How do I insert the buffer's name at the beginning of the buffer?" Tags="|insert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14989" PostTypeId="2" ParentId="14988" CreationDate="2015-08-23T18:33:51.007" Score="7" Body="&lt;p&gt;The &lt;code&gt;insert&lt;/code&gt; function will do what you want.  Below is a simple function that takes care of some housekeeping and inserts the buffer's name at the beginning of the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun do-my-thing ()&#xA;  &quot;Insert the name of the buffer at the beginning of the buffer.&quot;&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (widen)&#xA;      (goto-char (point-min))&#xA;      (insert (concat (buffer-name) &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-23T18:33:51.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14990" PostTypeId="2" ParentId="14870" CreationDate="2015-08-23T19:59:26.480" Score="3" Body="&lt;p&gt;There are two ways that I know of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Create a &lt;code&gt;PROJECT&lt;/code&gt; to-do keyword, and set the top-level project headlines to this keyword.  Then you can make a custom agenda view that shows all &lt;code&gt;PROJECT&lt;/code&gt; items.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You'll need to write a custom agenda function that skips headlines you don't want to see.  I can't write this for you, but here are some really good resources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/leoc/org-helpers.el/blob/master/org-helpers.el&quot; rel=&quot;nofollow&quot;&gt;org-helpers.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/fniessen/emacs-leuven/blob/master/org-custom-agenda-views.el&quot; rel=&quot;nofollow&quot;&gt;org-custom-agenda-views.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://headhole.org/organisation/2012/08/22/org-mode-gtd-and-the-pomodoro-technique/&quot; rel=&quot;nofollow&quot;&gt;&quot;Org-mode, GTD, and the Pomodoro technique&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2015-08-23T19:59:26.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14991" PostTypeId="2" ParentId="14985" CreationDate="2015-08-23T20:57:55.047" Score="3" Body="&lt;p&gt;Quoting deps.mk:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## This file is included in src/Makefile if AUTO_DEPEND=no.\&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it's kind of a fallback file only used to give dependencies to make sure compilation ordering is right.  You want to look in &lt;code&gt;src/Makefile.in&lt;/code&gt; instead where you should have no difficulty finding the variable that contains all the .o files we need.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-23T20:57:55.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14992" PostTypeId="1" CreationDate="2015-08-23T21:05:19.563" Score="10" ViewCount="194" Body="&lt;p&gt;I have seen all of the following for defining a keyboard binding.  All of these work (at least on MS Windows). I don't know if there is another way to do the same thing.&lt;br&gt;&#xA;I am wondering if there is a standard or recommended way to define a keyboard binding and if it is recommended to avoid some of these.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\M-r&quot; 'some-command)&#xA;(global-set-key [(meta r)] 'some-command)&#xA;(global-set-key [?\M-r] 'some-command)&#xA;(global-set-key (kbd &quot;M-r&quot;) 'some-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-23T21:41:51.873" LastActivityDate="2015-08-24T13:45:15.553" Title="Is there a standard/recommended syntax for defining a keyboard binding?" Tags="|key-bindings|syntax|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14993" PostTypeId="2" ParentId="14973" CreationDate="2015-08-23T21:56:13.297" Score="0" Body="&lt;p&gt;I tried again and now it works:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun evil-copy-or-repeat-copy-line ()&#xA;  (interactive)&#xA;  (if (or (eq last-command this-command)&#xA;          (eq last-command 'evil-line))&#xA;      (progn&#xA;        (forward-line 1)&#xA;        (setq this-command 'evil-line)&#xA;        (call-interactively 'evil-repeat)&#xA;        (kill-new (concat (cadr kill-ring) (car kill-ring))))&#xA;    (call-interactively 'evil-yank)))&#xA;&#xA;(define-key evil-normal-state-map (kbd &quot;w&quot;) 'evil-copy-or-repeat-copy-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="2642" LastEditDate="2015-08-24T03:54:28.567" LastActivityDate="2015-08-24T03:54:28.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14994" PostTypeId="1" CreationDate="2015-08-24T01:06:20.230" Score="4" ViewCount="147" Body="&lt;p&gt;I have a command that I would like to bind to multiple key sequences differing only in the final decimal digit (e.g. &lt;code&gt;C-. 0&lt;/code&gt;, &lt;code&gt;C-. 1&lt;/code&gt;, ..., &lt;code&gt;C-. 9&lt;/code&gt;).  The command needs to determine that final digit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prefer not to have 10 distinct bindings, each passing a distinct argument to a shared implementation.  So I am wondering whether emacs keeps around the event sequence that triggers a command.  Surely the self-insert-command has such a capability (though of course it is written in C).&lt;/p&gt;&#xA;" OwnerUserId="443" LastEditorUserId="105" LastEditDate="2015-08-24T04:30:14.583" LastActivityDate="2015-08-24T13:47:44.603" Title="Can a command determine the event sequence that invoked it?" Tags="|key-bindings|commands|event-sequence|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14995" PostTypeId="2" ParentId="14994" CreationDate="2015-08-24T03:27:46.493" Score="7" Body="&lt;p&gt;&lt;code&gt;C-h f this-command-keys&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;this-command-keys is a built-in function in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(this-command-keys)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For more information check the manuals.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return the key sequence that invoked this command.&#xA;  However, if the command has called &lt;code&gt;read-key-sequence&lt;/code&gt;, it returns&#xA;  the last key sequence that has been read.&#xA;  The value is a string or a vector.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See also &lt;code&gt;this-command-keys-vector&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Command-Loop-Info.html&quot;&gt;Command Loop Info&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-24T03:27:46.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14996" PostTypeId="2" ParentId="14992" CreationDate="2015-08-24T04:21:24.490" Score="6" Body="&lt;p&gt;There is no single standard way, because there are different use cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are writing such code manually, in your init file for example, then you might prefer the &lt;code&gt;(kbd ...)&lt;/code&gt; format, because the argument to &lt;code&gt;kbd&lt;/code&gt; uses the same notation that Emacs uses when it communicates with you about key bindings (in &lt;code&gt;*Help*&lt;/code&gt;, for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you are creating bindings using Emacs Lisp, then you might prefer the vector notation, in particular &lt;code&gt;[(meta r)]&lt;/code&gt; etc., as it is quite a bit easier to manage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some people consider the simple string approach to be archaic, but it is handy when the key is simple: &lt;code&gt;&quot;a&quot;&lt;/code&gt; is simpler and at least as readable as &lt;code&gt;(kbd &quot;a&quot;)&lt;/code&gt;.  But simple strings are harder to read/use when it comes to modifier keys etc.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-24T04:21:24.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14998" PostTypeId="1" CreationDate="2015-08-24T07:07:43.187" Score="6" ViewCount="237" Body="&lt;p&gt;I have a list in an &lt;code&gt;org&lt;/code&gt; document that is rather long&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- alpha a&#xA;- beta b&#xA;- gamma&#xA;- delta d&#xA;- epsilon e&#xA;- zeta z&#xA;- eta&#xA;- theta&#xA;- iota&#xA;- kappa&#xA;- lambda&#xA;- mu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like a function that redistributes this block of text into &lt;code&gt;n&lt;/code&gt; columns where &lt;code&gt;n&lt;/code&gt; is specified by me. So issuing &lt;code&gt;M-x desired-function &amp;lt;ret&amp;gt; 2 &amp;lt;ret&amp;gt;&lt;/code&gt; would return something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- alpha a    - eta&#xA;- beta b     - theta&#xA;- gamma      - iota&#xA;- delta d    - kappa&#xA;- epsilon e  - lambda&#xA;- zeta z     - mu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and issuing &lt;code&gt;M-x desired-function &amp;lt;ret&amp;gt; 3 &amp;lt;ret&amp;gt;&lt;/code&gt; would return something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- alpha a  - epsilon e  - iota&#xA;- beta b   - zeta z     - kappa&#xA;- gamma    - eta        - lambda&#xA;- delta d  - theta      - mu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Such a function would probably break the functionality of the list in the &lt;code&gt;org&lt;/code&gt; document but that wouldn't really bother me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this exist in emacs?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-08-27T20:25:24.620" LastActivityDate="2015-08-27T20:25:24.620" Title="Function to redistribute list into columns" Tags="|elisp|elisp-macros|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14999" PostTypeId="2" ParentId="14948" CreationDate="2015-08-24T07:54:42.910" Score="1" Body="&lt;p&gt;I use this function for that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shell-compile ()&#xA;      (interactive)&#xA;      (shell-command (concat &quot;python &quot; (buffer-file-name)))&#xA;      (if (&amp;lt;= (* 2 (window-height)) (frame-height))&#xA;          (enlarge-window 20)&#xA;        (/ (frame-height) 2)))&#xA;    (add-hook 'python-mode-hook&#xA;              '(lambda ()&#xA;                 (define-key (kbd &quot;C-c C-c&quot;) 'shell-compile python-mode-map)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-08-24T07:54:42.910" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15000" PostTypeId="2" ParentId="14998" CreationDate="2015-08-24T08:30:26.757" Score="3" Body="&lt;p&gt;Here's something quick I could think of:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-partition-list (n)&#xA;  (interactive &quot;nColumns: &quot;)&#xA;  (let* ((struct (org-list-struct))&#xA;         (prevs (org-list-prevs-alist struct))&#xA;         (start (org-list-get-list-begin (point-at-bol) struct prevs))&#xA;         (end (org-list-get-list-end (point-at-bol) struct prevs))&#xA;         (table &#xA;          (orgtbl-to-orgtbl&#xA;           (cl-loop with chunk = nil&#xA;                    for item in&#xA;                    (cl-loop for item in struct&#xA;                             collect (org-trim&#xA;                                      (buffer-substring-no-properties&#xA;                                       (+ (cl-first item)&#xA;                                          (cl-second item)&#xA;                                          (length (cl-third item)))&#xA;                                       (car (last item)))))&#xA;                    for i from 1&#xA;                    if (zerop (mod i n))&#xA;                    collect (nreverse (cons item chunk)) into result&#xA;                    and do (setf chunk nil)&#xA;                    else do (push item chunk) end&#xA;                    finally (cl-return&#xA;                             (if (/= 0 (mod i n))&#xA;                                 (append result (list chunk))&#xA;                               result)))&#xA;           nil)))&#xA;    (delete-region start end)&#xA;    (insert table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One thing to keep in mind is that Org lists can contain many other Org elements, most of which will make this function output something unpredictable / not really usable.  This will only work in trivial cases, when lists contain plain text, one line per entry.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-08-24T10:13:54.753" LastActivityDate="2015-08-24T10:13:54.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15001" PostTypeId="1" AcceptedAnswerId="15067" CreationDate="2015-08-24T10:07:00.383" Score="2" ViewCount="4424" Body="&lt;p&gt;From time to time my Emacs doesn't load my &lt;code&gt;init&lt;/code&gt; file at startup and gives me the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Cannot open load file, no such file or directory, session&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;File error: Cannot open load file, no such file or directory, session&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The Problem turns out to be this code in my customization file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ....&#xA; '(session-use-package t nil (session))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is a variable from the &lt;code&gt;session&lt;/code&gt; package which saves my history in Emacs.&#xA;I have to delete this line and everything works again. Why is this added to my customization file and how can I avoid this annoying error? How could I investigate myself which event triggers this setting in my customization file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;:&#xA;The part of my &lt;code&gt;init&lt;/code&gt; which loads the package looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package session&#xA;:ensure t&#xA;:init&#xA;(add-hook 'after-init-hook 'session-initialize))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-08-24T23:18:20.527" LastActivityDate="2015-08-26T17:02:37.863" Title="What is causing this error: &quot;Cannot open load file, no such file or directory, session&quot;?" Tags="|session|custom|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15002" PostTypeId="2" ParentId="14992" CreationDate="2015-08-24T13:45:15.553" Score="6" Body="&lt;pre&gt;&lt;code&gt;(global-set-key [?\M-r] 'some-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is the &quot;native&quot; way.  All others are built on top of this one, basically.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-24T13:45:15.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15003" PostTypeId="2" ParentId="14994" CreationDate="2015-08-24T13:47:44.603" Score="1" Body="&lt;p&gt;&lt;code&gt;self-insert-command&lt;/code&gt; is indeed written in C but could just as well be written in Elisp (it's just a result of historical evolution).  The variable it uses to figure out which key was pressed is &lt;code&gt;last-command-event&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-24T13:47:44.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15005" PostTypeId="1" AcceptedAnswerId="15006" CreationDate="2015-08-24T14:11:03.837" Score="0" ViewCount="718" Body="&lt;p&gt;I am trying to match a regex using this code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(search-backward-regexp &quot;\n[\t\n ]*?\n&quot; nil &quot;NOERROR&quot; 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;search-backward-regexp documenation says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Set point to the beginning of the match, and return point.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I set point to end of match?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-08-25T10:43:37.737" Title="How to go to end of match using search-backward-regexp?" Tags="|regular-expressions|search|point|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15006" PostTypeId="2" ParentId="15005" CreationDate="2015-08-24T14:19:45.987" Score="3" Body="&lt;p&gt;After running the search, go to &lt;code&gt;match-end&lt;/code&gt;. (Included fix from Dan's answer)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (search-backward-regexp &quot;\n[\t\n ]*\n&quot; nil 'noerror)&#xA;  (goto-char (match-end 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the docstring of &lt;code&gt;search-backward-regexp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;See also the functions &lt;code&gt;match-beginning&lt;/code&gt;, &lt;code&gt;match-end&lt;/code&gt;, &lt;code&gt;match-string&lt;/code&gt;, and &lt;code&gt;replace-match&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2015-08-25T10:43:37.737" LastActivityDate="2015-08-25T10:43:37.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15007" PostTypeId="2" ParentId="15005" CreationDate="2015-08-24T14:28:09.187" Score="2" Body="&lt;p&gt;This is a minor modification to @Malabarba's answer.  It only goes to &lt;code&gt;match-end&lt;/code&gt; if your search succeeds.  Otherwise, the &lt;code&gt;goto-char&lt;/code&gt; will send you off to wherever you had a successful match on a prior regexp search (whether you initiated it, or some other function used it under the hood), which could lead to astonishing jumps.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (search-backward-regexp &quot;\n[\t\n ]*\n&quot; nil 'noerror)&#xA;  (goto-char (match-end 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Probably best to wrap this in a function.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-24T14:28:09.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15008" PostTypeId="2" ParentId="14984" CreationDate="2015-08-24T14:31:18.643" Score="5" Body="&lt;p&gt;is it possible you're running on a Mac? Then add this to your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ns-use-srgb-colorspace nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See this Github issue for further context: &lt;a href=&quot;https://github.com/milkypostman/powerline/issues/54&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/milkypostman/powerline/issues/54&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8300" LastActivityDate="2015-08-24T14:31:18.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15009" PostTypeId="1" AcceptedAnswerId="15012" CreationDate="2015-08-24T15:37:45.400" Score="10" ViewCount="1488" Body="&lt;p&gt;Is there a best, most future-proof method of setting emacs on OS X to delete files to the trash?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the instructions &lt;a href=&quot;http://www.emacswiki.org/emacs/SystemTrash&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq delete-by-moving-to-trash t)&#xA;&#xA;(defun system-move-file-to-trash (file)&#xA;  &quot;Use \&quot;trash\&quot; to move FILE to the system trash.&#xA;When using Homebrew, install it using \&quot;brew install trash\&quot;.&quot;&#xA;  (call-process (executable-find &quot;trash&quot;)&#xA;    nil 0 nil&#xA;        file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but they don't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Trashing...&#xA;(wrong-type-argument stringp nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, it feels wrong to have to install a separate program in order for Emacs to be able to trash files. Furthermore, I won't remember to install the &quot;trash&quot; program the next time I do a clean OS X install.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: I added this to my .emacs and removed the call to &lt;code&gt;trash&lt;/code&gt; and it seems to work. I wonder why Emacs on OSX defaults to the FreeDesktop &lt;code&gt;~/.local/share/Trash&lt;/code&gt; location.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq trash-directory &quot;~/.Trash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2240" LastEditorUserId="2240" LastEditDate="2015-08-24T15:42:52.423" LastActivityDate="2021-07-19T18:30:26.327" Title="Delete files to Trash on OS X" Tags="|osx|deletion|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15010" PostTypeId="1" CreationDate="2015-08-24T18:01:48.833" Score="2" ViewCount="237" Body="&lt;p&gt;I am trying to customize export behavior for emacs org-mode.  A task I am getting stuck on is &lt;em&gt;obtaining the element hierarchy for a given location in the document&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using emacs 24.5.1 with org-mode 8.2.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found the function &quot;org-export-get-genealogy&quot;, which is supposed to return the hierarchy of an element in org-mode 8.2, but I cannot figure out how to initialize the environment correctly for it to work.  Specifically, it seems like you need to initialize the parse tree for the buffer before you can invoke org-export-get-genealogy, and I cannot figure out how to do this correctly.  I am fairly new to emacs lisp, and am not very familiar with the ways dynamic scope is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my current code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq *myvar* (org-element-parse-buffer)) ;how can I link this to the next line?&#xA;(org-export-get-genealogy (org-element-at-point))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org-export-get-genealogy invoked as above always returns nil.  How can I change the code so that org-export-get-genealogy returns the hierarchy for the element?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9287" LastEditorUserId="105" LastEditDate="2017-02-08T00:28:43.567" LastActivityDate="2017-02-08T00:28:43.567" Title="org-mode how to obtain header hierarchy for current position" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15011" PostTypeId="2" ParentId="3866" CreationDate="2015-08-24T18:13:12.080" Score="0" Body="&lt;p&gt;No, file notifications are not yet supported on Mac OS X, as detailed in the other answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd guess that one reason for that is that on earlier OS X versions, notifications were limited to telling you that something had changed in a certain directory; it wouldn't tell you &lt;em&gt;what&lt;/em&gt; in that directory had changed.  Given that limitation, the API on the Emacs Lisp level would be rather inconsistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;File-level notifications were introduced in 10.7 (Lion).  &lt;a href=&quot;https://stackoverflow.com/q/1772209/113848&quot;&gt;This question&lt;/a&gt; contains more details.  As I understand it, it should now be possible to implement this functionality for Emacs on OS X.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-08-24T18:13:12.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15012" PostTypeId="2" ParentId="15009" CreationDate="2015-08-24T18:27:02.377" Score="9" Body="&lt;p&gt;The following is required:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq delete-by-moving-to-trash t)&#xA;(setq trash-directory &quot;~/.Trash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;move-file-to-trash&lt;/code&gt; has three tests:  &lt;strong&gt;(1)&lt;/strong&gt; whether &lt;code&gt;trash-directory&lt;/code&gt; is defined; &lt;strong&gt;(2)&lt;/strong&gt; whether &lt;code&gt;(fboundp 'system-move-file-to-trash)&lt;/code&gt;; and, &lt;strong&gt;(3)&lt;/strong&gt; &lt;code&gt;(t . . .&lt;/code&gt; the &lt;em&gt;catch-all&lt;/em&gt; that uses &lt;code&gt;~/.local/share...&lt;/code&gt;  The &lt;em&gt;second&lt;/em&gt; test always fails on OSX 10.6.8 when built with the standard option of &lt;code&gt;--with-ns&lt;/code&gt;.  I don't have access at the moment to other versions of OSX.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-08-24T18:27:02.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15013" PostTypeId="2" ParentId="15009" CreationDate="2015-08-24T18:32:03.930" Score="4" Body="&lt;p&gt;Define the function &lt;code&gt;system-move-file-to-trash&lt;/code&gt; in this way should be enough:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun system-move-file-to-trash (file)&#xA;  (call-process &quot;trash&quot; nil nil nil file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if you don't have &lt;code&gt;trash&lt;/code&gt; installed, Emacs will tell you. then, don't set the variable &lt;code&gt;trash-directory&lt;/code&gt; since &lt;code&gt;trash&lt;/code&gt; does that for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About Emacs's trash behavior:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;move-file-to-trash is an interactive compiled Lisp function in ‘files.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(move-file-to-trash FILENAME)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move the file (or directory) named FILENAME to the trash. When&#xA;  ‘delete-by-moving-to-trash’ is non-nil, this function is called by&#xA;  ‘delete-file’ and ‘delete-directory’ instead of deleting files&#xA;  outright.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the function ‘system-move-file-to-trash’ is defined, call it  with&#xA;  FILENAME as an argument. Otherwise, if ‘trash-directory’ is non-nil,&#xA;  move FILENAME to that  directory. Otherwise, trash FILENAME using the&#xA;  freedesktop.org conventions,  like the GNOME, KDE and XFCE desktop&#xA;  environments.  Emacs only  moves files to &quot;home trash&quot;, ignoring&#xA;  per-volume trashcans.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I guess &lt;code&gt;(setq trash-directory &quot;~/.Trash&quot;)&lt;/code&gt; is not working: Finder will not be able to recover these files since it (at least) doesn't know where these files come from.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-08-24T18:32:03.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15014" PostTypeId="2" ParentId="14938" CreationDate="2015-08-24T19:04:53.020" Score="2" Body="&lt;p&gt;&lt;code&gt;web-mode&lt;/code&gt; does not currently support this feature.  Could you post a feature request on the git repo, please? I'll have to modify some of &lt;code&gt;web-mode.el&lt;/code&gt; to handle this.&lt;/p&gt;&#xA;" OwnerUserId="197" LastEditorUserId="253" LastEditDate="2015-08-24T19:28:41.207" LastActivityDate="2015-08-24T19:28:41.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15015" PostTypeId="1" CreationDate="2015-08-24T20:04:15.373" Score="2" ViewCount="1276" Body="&lt;p&gt;So there is &lt;code&gt;ido-completing-read&lt;/code&gt; that seems perfect to assign to &lt;code&gt;completing-read-function&lt;/code&gt;. There is no customization interface though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is the user supposed to enable &lt;code&gt;ido-completing-read&lt;/code&gt; for all completing reads?&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="253" LastEditDate="2015-08-24T20:44:23.320" LastActivityDate="2015-08-25T07:48:04.467" Title="How to enable ido-completing-read correctly" Tags="|customize|ido|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15016" PostTypeId="1" CreationDate="2015-08-24T20:17:11.683" Score="1" ViewCount="1139" Body="&lt;p&gt;I would like all my dates in org-mode to be displayed like &lt;code&gt;&amp;lt;Mon 24-Aug 2015&amp;gt;&lt;/code&gt;. I found a piece of code that addresses the problem&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default org-display-custom-times t)&#xA;(setq org-time-stamp-custom-formats '(&quot;&amp;lt;%b %e, %Y&amp;gt;&quot; . &quot;&amp;lt;%b %e, %Y %H:%M&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I'm not sure how to edit it to fit my needs. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="1979" LastEditDate="2019-12-26T14:20:23.233" LastActivityDate="2023-02-02T02:02:25.260" Title="How can I set custom date formats in org mode?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="15017" PostTypeId="2" ParentId="14946" CreationDate="2015-08-24T20:48:18.693" Score="6" Body="&lt;p&gt;If you don't mind installing some npm modules it looks like eslint+flycheck could do the trick like described &lt;a href=&quot;http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="714" LastActivityDate="2015-08-24T20:48:18.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15018" PostTypeId="2" ParentId="15015" CreationDate="2015-08-24T20:59:58.773" Score="1" Body="&lt;p&gt;Basic setup is just:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq&#xA; ido-create-new-buffer    'always&#xA; ido-enable-flex-matching t&#xA; ido-everywhere           t)&#xA;&#xA;(ido-mode 1) ; ido for switch-buffer and find-file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, to use it everywhere install &lt;code&gt;ido-ubiquitous&lt;/code&gt; and activate it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(ido-ubiquitous-mode 1) ; use IDO everywhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ido-vertical&lt;/code&gt; is highly recommended:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ido-vertical-define-keys 'C-n-and-C-p-only)&#xA;&#xA;(ido-vertical-mode 1) ; display IDO vertically&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Don't forget about &lt;a href=&quot;https://github.com/nonsequitur/smex&quot; rel=&quot;nofollow&quot;&gt;Smex&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-08-25T07:48:04.467" LastActivityDate="2015-08-25T07:48:04.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15019" PostTypeId="2" ParentId="15015" CreationDate="2015-08-24T21:00:35.437" Score="2" Body="&lt;p&gt;Seems that convetions is to provide a customization per each package separatelly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Org Mode: &lt;code&gt;(setq org-completion-use-ido t)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Magit: &lt;code&gt;(setq magit-completing-read-function 'magit-ido-completing-read)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Gnus: &lt;code&gt;(setq gnus-completing-read-function 'gnus-ido-completing-read)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Or use &lt;a href=&quot;https://github.com/DarwinAwardWinner/ido-ubiquitous&quot; rel=&quot;nofollow&quot;&gt;https://github.com/DarwinAwardWinner/ido-ubiquitous&lt;/a&gt; that tries to do the correct thing always.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastActivityDate="2015-08-24T21:00:35.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15020" PostTypeId="1" AcceptedAnswerId="15153" CreationDate="2015-08-24T22:11:37.670" Score="1" ViewCount="144" Body="&lt;p&gt;I'm doing &lt;code&gt;M-x eww&lt;/code&gt; with Emacs-24.5 -Q on Debian 8, for example with the address &quot;&lt;a href=&quot;http://google.com&quot; rel=&quot;nofollow&quot;&gt;http://google.com&lt;/a&gt;&quot; (or just &quot;google.com&quot;).  And receive the error message in the subject line, in other words: I can't use eww at all for internet addresses, what the heck is going on?&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-08-25T09:38:42.797" LastActivityDate="2015-08-30T11:22:19.820" Title="eww: error in process sentinel: url-cookie-generate-header-lines: Wrong type argument: listp, \.\.\" Tags="|eww|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15021" PostTypeId="2" ParentId="14923" CreationDate="2015-08-25T00:22:27.863" Score="4" Body="&lt;p&gt;Actually, it seems that Org mode 8.3.1 has built-in support for what the question is asking; &lt;code&gt;label&lt;/code&gt; and &lt;code&gt;ref&lt;/code&gt; work out of the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This requires one to update Org mode through the package manager; afterwards, stick &lt;code&gt;(package-initialize)&lt;/code&gt; near the top of the initialization file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT.&lt;/strong&gt; This does not allow you to click the &lt;code&gt;\ref{...}&lt;/code&gt; and go to the label. For that, please see the accepted answer above, or use &lt;a href=&quot;https://github.com/jkitchin/org-ref&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-ref&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="117" LastEditorUserId="117" LastEditDate="2015-09-03T02:02:31.340" LastActivityDate="2015-09-03T02:02:31.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15022" PostTypeId="1" AcceptedAnswerId="15031" CreationDate="2015-08-25T01:02:37.893" Score="9" ViewCount="345" Body="&lt;p&gt;Since I find myself writing a lot of matrices and tables, I'm looking for a way to align numbers nicely in Emacs (similar to the align package in vim). I found that there is align-regexp, but I couldn't get it to work the way I wanted. Is there a way to align numbers at their decimals --- and if there are no decimals align in front of the other decimals. It would also be nice to be able to align at 'thousands'-separators and align complex numbers. Preferably with two whitespaces in-between numbers for readability. Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A = [-15 9 33.34;...&#xA;1.0 0.99 1+3i;...&#xA;13,000 2 11 ];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Desired output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A = [   -15     9     33.34 ;...&#xA;          1.0  -0.99   1+3i ;...&#xA;     13,000     2     11    ];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, to make it a bit easier (without 'thousands'-separator and complex numbers):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A = [-15 9 33.34;...&#xA;1.0 0.99 1;...&#xA;13000 2 11 ];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Desired output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A = [  -15     9      33.34 ; ...&#xA;         1.0   0.99    1    ; ...&#xA;     13000     2      11    ];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="9292" LastEditorUserId="9292" LastEditDate="2015-08-25T20:21:19.300" LastActivityDate="2015-08-25T20:21:19.300" Title="Emacs align matrices" Tags="|align|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15023" PostTypeId="2" ParentId="14420" CreationDate="2015-08-25T02:17:59.247" Score="2" Body="&lt;p&gt;syohex &lt;a href=&quot;https://github.com/syohex/emacs-fontawesome/issues/4#issuecomment-134437085&quot; rel=&quot;nofollow&quot;&gt;helped me out&lt;/a&gt; and pointed me to some code that adjusts the character widths of certain character codes. I adapted it to fit what I'm doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun blaenk/set-char-widths (alist)&#xA;    (while (char-table-parent char-width-table)&#xA;      (setq char-width-table (char-table-parent char-width-table)))&#xA;    (dolist (pair alist)&#xA;      (let ((width (car pair))&#xA;            (chars (cdr pair))&#xA;            (table (make-char-table nil)))&#xA;        (dolist (char chars)&#xA;          (set-char-table-range table char width))&#xA;        (optimize-char-table table)&#xA;        (set-char-table-parent table char-width-table)&#xA;        (setq char-width-table table))))&#xA;&#xA;&#xA;  ;; argument is an alist of width and list of RANGEs,&#xA;  ;; which is the same as the RANGE that set-char-table-range accepts&#xA;  (blaenk/set-char-widths&#xA;   `((2 . (,(string-to-char (fontawesome &quot;cloud&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2015-08-25T02:17:59.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15024" PostTypeId="2" ParentId="12998" CreationDate="2015-08-25T02:35:02.827" Score="1" Body="&lt;p&gt;Try this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mac-pass-command-to-system nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-08-25T02:35:02.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15025" PostTypeId="1" AcceptedAnswerId="15036" CreationDate="2015-08-25T04:45:31.237" Score="2" ViewCount="397" Body="&lt;p&gt;I would like to highlight lines with a certain pattern whenever the file is opened. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically when &lt;code&gt;Journal.org&lt;/code&gt; is opened I want to run commands like &lt;code&gt;M-s h l&lt;/code&gt; to highlight a set of patterns and assign them background colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the simplest way to go about doing this (without writing a lot of custom elisp code)? &lt;/p&gt;&#xA;" OwnerUserId="2059" LastEditorUserId="105" LastEditDate="2017-02-08T00:28:32.100" LastActivityDate="2023-10-22T12:27:30.067" Title="Highlighting automatically on file open" Tags="|hooks|files|highlighting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15026" PostTypeId="2" ParentId="15025" CreationDate="2015-08-25T05:11:58.493" Score="2" Body="&lt;p&gt;This is a classic case where elisp can help you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-highlight ()&#xA;  (if (string-equal &quot;Journal.org&quot;&#xA;                    (file-name-nondirectory buffer-file-name))&#xA;      (highlight-lines-matching-regexp &quot;foo&quot; 'hi-yellow)))&#xA;&#xA;(add-hook 'find-file-hook #'my-highlight)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="838" LastActivityDate="2015-08-25T05:11:58.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15027" PostTypeId="1" AcceptedAnswerId="15028" CreationDate="2015-08-25T07:12:13.313" Score="5" ViewCount="1660" Body="&lt;p&gt;Like in NERDTREE for vim, is there a way to list certain file types to be ignored (not displayed) by neotree ? for instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*.cs.meta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9294" LastActivityDate="2016-09-02T16:32:12.710" Title="Neotree ignore list?" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15028" PostTypeId="2" ParentId="15027" CreationDate="2015-08-25T07:25:57.163" Score="10" Body="&lt;p&gt;Customize the variable &lt;code&gt;neo-hidden-regexp-list&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc-string is very short:  &lt;em&gt;&quot;The regexp list matching hidden files.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default is &lt;code&gt;'(&quot;^\\.&quot; &quot;\\.pyc$&quot; &quot;~$&quot; &quot;^#.*#$&quot; &quot;\\.elc$&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modify the list as follows in your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq neo-hidden-regexp-list '(&quot;^\\.&quot; &quot;\\.cs\\.meta$&quot; &quot;\\.pyc$&quot; &quot;~$&quot; &quot;^#.*#$&quot; &quot;\\.elc$&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-08-25T07:25:57.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15029" PostTypeId="1" CreationDate="2015-08-25T08:26:44.697" Score="3" ViewCount="686" Body="&lt;p&gt;It is possible and relatively easy to create a new major mode, deriving from c-mode, and just add two dashes '--' to work as comments too?&#xA;I have checked many resources, but couldn't find anything similar. I tried some approaches, but I'm pretty novice with emacs-lisp programming, and c-mode seemed overwhelming for my knowledge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="6957" LastEditDate="2016-06-08T11:24:01.517" LastActivityDate="2021-09-25T20:59:24.233" Title="Create new major mode from cc-mode that allows comments with two dashes" Tags="|major-mode|cc-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15030" PostTypeId="2" ParentId="15029" CreationDate="2015-08-25T08:39:35.197" Score="3" Body="&lt;p&gt;I asked this question in &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_syntax_coloring.html&quot; rel=&quot;nofollow&quot;&gt;Xah Lee emacs blog entry&lt;/a&gt;, and he gave me these suggestions:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;i think it can be done, without much trouble. Read the elisp chapter&#xA;  on syntax table. basically, add the -- to the syntax table as comment.&#xA;  Note: syntax table is hard to work with, especially when specifying&#xA;  comment chars. Also, by default it only supports a few. I'm not sure&#xA;  you can have&#xA;  -- // /* */ all together. See my tutorial about comment linked on this page. But, if it can be done, then that's all you need to do. But if&#xA;  it cannot be done, you can still do so by trying to add the syntax for&#xA;  comment as text properties. (you'll need to learn about text&#xA;  properties)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I went through the elisp syntax table chapter, that I found pretty hard to grasp, and through &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_comment_handling.html&quot; rel=&quot;nofollow&quot;&gt;Xah Lee comments tutorial&lt;/a&gt; and tried these lines, just like his lines for regular // c++ style comment.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (define-derived-mode my-mode c-mode&#xA;      &quot;my mode&quot;&#xA;      (modify-syntax-entry ?- &quot;. 12b&quot; c-mode-syntax-table)&#xA;      (modify-syntax-entry ?\n &quot;&amp;gt; b&quot; c-mode-syntax-table)&#xA;      )&#xA;    (provide 'my-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that this was enough for what I needed.&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2015-08-25T08:39:35.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15031" PostTypeId="2" ParentId="15022" CreationDate="2015-08-25T11:06:52.227" Score="5" Body="&lt;p&gt;This took me quite a bit more time than I originally estimated, and the code is a bit too long to post it all here, so I posted it to Patebin: &lt;a href=&quot;http://pastebin.com/Cw82x11i&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/Cw82x11i&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not entirely complete though and it can use some more work, so if anyone will have suggestions or contributions, I might re-arrange this as a Git repository somewhere / repost this to Emacs wiki.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Few important points:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;No attempt has been made to cater for matrices with delimiters other than spaces.&lt;/li&gt;&#xA;&lt;li&gt;I didn't try to parse complex numbers either.&lt;/li&gt;&#xA;&lt;li&gt;The treatment of non-numerical entries is different than the one in your example (to be honest, I wouldn't really know how to parse it in exactly the way you want.  My guess is that the semicolon is the Matlab / Octave row delimiter, but if I try to make it more generic, it's really hard to wrap my head around it.  Also, my guess is that the ellipsis is the Matlab / Octave way of telling the interpreter that the statement continues on the next line, but, again, trying to make this more generic would be really hard.  Instead, I'm just treating whatever non-numeric value I encounter as if it was a whole number.&lt;/li&gt;&#xA;&lt;li&gt;Finally, I had to give up the &lt;code&gt;align-regexp&lt;/code&gt; because it was too complicated to try to make it align exactly using the rule you seem to have in mind.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's what it would look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; before&#xA;A = [-15 9 33.34;...&#xA;1.0 0.99 1;...&#xA;13000 2 11 ];&#xA;&#xA;;; after&#xA;A = [  -15   9    33.34 ;... &#xA;         1.0 0.99  1    ;... &#xA;     13000   2    11         ];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS. You can adjust the space between the columns by changing the value of the &lt;code&gt;spacer&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK, I've also made a little refinement to the code where it can now ask for the string to fill in between the columns.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/string-to-number (line re)&#xA;  (let ((matched (string-match re line)))&#xA;    (if matched&#xA;        (list (match-string 0 line)&#xA;              (substring line (length (match-string 0 line))))&#xA;      (list nil line))))&#xA;&#xA;(defun my/string-to-double (line)&#xA;  (my/string-to-number&#xA;   line&#xA;   &quot;\\s-*[+-]?[0-9]+\\(?:\\.[0-9]+\\(?:[eE][+-]?[0-9]+\\)?\\)?&quot;))&#xA;&#xA;(defun my/string-to-int (line)&#xA;  (my/string-to-number line &quot;\\s-*[+-]?[0-9]+&quot;))&#xA;&#xA;(defun my/vector-transpose (vec)&#xA;  (cl-coerce&#xA;   (cl-loop for i below (length (aref vec 0))&#xA;            collect (cl-coerce &#xA;                     (cl-loop for j below (length vec)&#xA;                              collect (aref (aref vec j) i))&#xA;                     'vector))&#xA;   'vector))&#xA;&#xA;(defun my/align-metric (col num-parser)&#xA;  (cl-loop with max-left = 0&#xA;           with max-right = 0&#xA;           with decimal = 0&#xA;           for cell across col&#xA;           for nump = (car (funcall num-parser cell))&#xA;           for has-decimals = (cl-position ?\. cell) do&#xA;           (if nump&#xA;               (if has-decimals&#xA;                   (progn&#xA;                     (setf decimal 1)&#xA;                     (when (&amp;gt; has-decimals max-left)&#xA;                       (setf max-left has-decimals))&#xA;                     (when (&amp;gt; (1- (- (length cell) has-decimals))&#xA;                              max-right)&#xA;                       (setf max-right (1- (- (length cell) has-decimals)))))&#xA;                 (when (&amp;gt; (length cell) max-left)&#xA;                   (setf max-left (length cell))))&#xA;             (when (&amp;gt; (length cell) max-left)&#xA;               (setf max-left (length cell))))&#xA;           finally (cl-return (list max-left decimal max-right))))&#xA;&#xA;(defun my/print-matrix (rows metrics num-parser prefix spacer)&#xA;  (cl-loop with first-line = t&#xA;           for i upfrom 0&#xA;           for row across rows do&#xA;           (unless first-line (insert prefix))&#xA;           (setf first-line nil)&#xA;           (cl-loop with first-row = t&#xA;                    for cell across row&#xA;                    for metric in metrics&#xA;                    for has-decimals =&#xA;                    (and (cl-position ?\. cell)&#xA;                         (car (funcall num-parser cell)))&#xA;                    do&#xA;                    (unless first-row (insert spacer))&#xA;                    (setf first-row nil)&#xA;                    (cl-destructuring-bind (left decimal right) metric&#xA;                      (if has-decimals&#xA;                          (cl-destructuring-bind (whole fraction)&#xA;                              (split-string cell &quot;\\.&quot;)&#xA;                            (insert (make-string (- left (length whole)) ?\ )&#xA;                                    whole&#xA;                                    &quot;.&quot;&#xA;                                    fraction&#xA;                                    (make-string (- right (length fraction)) ?\ )))&#xA;                        (insert (make-string (- left (length cell)) ?\ )&#xA;                                cell&#xA;                                (make-string (1+ right) ?\ )))))&#xA;           (unless (= i (1- (length rows)))&#xA;             (insert &quot;\n&quot;))))&#xA;&#xA;(defun my/read-rows (beg end)&#xA;  (cl-coerce&#xA;   (cl-loop for line in (split-string&#xA;                         (buffer-substring-no-properties beg end) &quot;\n&quot;)&#xA;            collect&#xA;            (cl-coerce&#xA;             (nreverse&#xA;              (cl-loop with result = nil&#xA;                       with remaining = line do&#xA;                       (cl-destructuring-bind (num remainder)&#xA;                           (funcall num-parser remaining)&#xA;                         (if num&#xA;                             (progn&#xA;                               (push (org-trim num) result)&#xA;                               (setf remaining remainder))&#xA;                           (push (org-trim remaining) result)&#xA;                           (cl-return result)))))&#xA;             'vector))&#xA;   'vector))&#xA;&#xA;(defvar my/parsers '((:double . my/string-to-double)&#xA;                     (:int . my/string-to-int)))&#xA;&#xA;(defun my/align-matrix (parser &amp;amp;optional spacer)&#xA;  (interactive&#xA;   (let ((sym (intern&#xA;               (completing-read&#xA;                &quot;Parse numbers using: &quot;&#xA;                (mapcar 'car my/parsers)&#xA;                nil nil nil t &quot;:double&quot;)))&#xA;         (spacer (if current-prefix-arg&#xA;                     (read-string &quot;Interleave with: &quot;)&#xA;                   &quot; &quot;)))&#xA;     (list sym spacer)))&#xA;  (unless spacer (setf spacer &quot; &quot;))&#xA;  (let ((num-parser&#xA;         (or (cdr (assoc parser my/parsers))&#xA;             (and (functionp parser) parser)&#xA;             'my/string-to-double))&#xA;        beg end)&#xA;    (if (region-active-p)&#xA;        (setf beg (region-beginning)&#xA;              end (region-end))&#xA;      (setf end (1- (search-forward-regexp &quot;\\s)&quot; nil t))&#xA;            beg (1+ (progn (backward-sexp) (point)))))&#xA;    (goto-char beg)&#xA;    (let* ((prefix (make-string (current-column) ?\ ))&#xA;           (rows (my/read-rows beg end))&#xA;           (cols (my/vector-transpose rows))&#xA;           (metrics&#xA;            (cl-loop for col across cols&#xA;                     collect (my/align-metric col num-parser))))&#xA;      (delete-region beg end)&#xA;      (my/print-matrix rows metrics num-parser prefix spacer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-08-25T16:13:30.730" LastActivityDate="2015-08-25T16:13:30.730" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15032" PostTypeId="1" AcceptedAnswerId="15035" CreationDate="2015-08-25T13:18:36.390" Score="6" ViewCount="758" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mGM9H.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mGM9H.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If i select first option it will become&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;l.remove&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But as the completion candidate is function type, how can i make it to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;l.remove()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that i don't have to manually type parens?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-08-25T13:35:00.360" LastActivityDate="2015-08-28T17:31:12.590" Title="Insert parens while completing functions in company mode" Tags="|python|company-mode|balanced-parentheses|automation|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15033" PostTypeId="1" AcceptedAnswerId="15040" CreationDate="2015-08-25T13:42:04.390" Score="4" ViewCount="4676" Body="&lt;p&gt;How do I mark the current line and then move the cursor to the beginning of the next line?  I'd like it to behave like Sublime Text's &lt;kbd&gt;Ctrl-L&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="446" LastEditorUserId="253" LastEditDate="2015-08-25T13:55:29.380" LastActivityDate="2017-07-20T16:48:27.060" Title="How to mark current line and move cursor to next line?" Tags="|mark|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15034" PostTypeId="2" ParentId="14935" CreationDate="2015-08-25T13:49:47.963" Score="4" Body="&lt;p&gt;Interactively, I do this one of a few ways, depending on the scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, if the regions are small -- e.g., lately I've been comparing some test output with the expected results, and both are just a single line -- I just edit so the lines are next to each other and compare visually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another &quot;low tech&quot; solution is to use isearch.  If both regions are visible at the same time, I use &lt;code&gt;C-s&lt;/code&gt; at the start of one region, then repeatedly use &lt;code&gt;C-w&lt;/code&gt; to pick up characters from the region.  Then I watch the highlighting of the other region -- when it stops I have found the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For larger regions, I use &lt;code&gt;compare-windows&lt;/code&gt;.  This has a way to ignore whitespace.  If the regions are in the same buffer, just split windows and move point in each window to the start of one of the regions before beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand if you wanted to do this programmatically, I think the basic idea is to use &lt;code&gt;buffer-substring&lt;/code&gt; and then &lt;code&gt;equal&lt;/code&gt; (or &lt;code&gt;string=&lt;/code&gt;) to compare.  I am not sure how you would ignore &quot;language-specific whitespace&quot;, but I suppose one way would be to rewrite each string into a canonical form before comparing; for example by running a regular expression over them to strip such whitespace.&lt;/p&gt;&#xA;" OwnerUserId="822" LastActivityDate="2015-08-25T13:49:47.963" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15035" PostTypeId="2" ParentId="15032" CreationDate="2015-08-25T13:54:01.007" Score="4" Body="&lt;p&gt;I'm not very familiar with the innards of Company, but here's how to do it with Ivy (you can re-use some code for Company as well, if you know how):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun counsel-jedi ()&#xA;  &quot;Python completion at point.&quot;&#xA;  (interactive)&#xA;  (let ((bnd (bounds-of-thing-at-point 'symbol)))&#xA;    (if bnd&#xA;        (progn&#xA;          (setq counsel-completion-beg (car bnd))&#xA;          (setq counsel-completion-end (cdr bnd)))&#xA;      (setq counsel-completion-beg nil)&#xA;      (setq counsel-completion-end nil)))&#xA;  (deferred:sync!&#xA;   (jedi:complete-request))&#xA;  (ivy-read &quot;Symbol name: &quot; (jedi:ac-direct-matches)&#xA;            :action #'counsel--py-action))&#xA;&#xA;(defun counsel--py-action (symbol)&#xA;  &quot;Insert SYMBOL, erasing the previous one.&quot;&#xA;  (when (stringp symbol)&#xA;    (when counsel-completion-beg&#xA;      (delete-region&#xA;       counsel-completion-beg&#xA;       counsel-completion-end))&#xA;    (setq counsel-completion-beg&#xA;          (move-marker (make-marker) (point)))&#xA;    (insert symbol)&#xA;    (setq counsel-completion-end&#xA;          (move-marker (make-marker) (point)))&#xA;    (when (equal (get-text-property 0 'symbol symbol) &quot;f&quot;)&#xA;      (insert &quot;()&quot;)&#xA;      (backward-char 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-08-25T13:54:01.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15036" PostTypeId="2" ParentId="15025" CreationDate="2015-08-25T13:54:07.347" Score="2" Body="&lt;p&gt;The &lt;code&gt;hi-lock&lt;/code&gt; package has support for saving patterns to a file and re-applying them.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use the standard hi-lock commands to highlight what you are interested in. For example, use &lt;code&gt;M-s h l&lt;/code&gt; to highlight lines matching some pattern.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;M-s h w&lt;/code&gt; (&lt;code&gt;hi-lock-write-interactive-patterns&lt;/code&gt;) to save the current highlight patterns to the file as a special comment line. &lt;/li&gt;&#xA;&lt;li&gt;Enable &lt;code&gt;hi-lock-mode&lt;/code&gt; or &lt;code&gt;global-hi-lock-mode&lt;/code&gt;. For example, if you're only using highlighting in org files you could enable hi-lock mode in an org-mode hook.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The next time you visit that file and hi-lock is enabled, you will be prompted whether you want to highlight the found patterns. You can customize &lt;code&gt;hi-lock-file-patterns-policy&lt;/code&gt; if you don't want to be prompted.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-08-25T13:54:07.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15038" PostTypeId="1" AcceptedAnswerId="15039" CreationDate="2015-08-25T14:07:25.993" Score="1" ViewCount="236" Body="&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt;, I want to make an agenda view showing all notes tagged with &quot;NOTE&quot; &lt;strong&gt;or&lt;/strong&gt; &quot;LOGG&quot;. The following code does not produce the result I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '((&quot;o&quot; &quot;NOTES&quot; tags &quot;+NOTE+LOGG&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code will sort out all notes tagged with both &lt;code&gt;NOTE&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; &lt;code&gt;LOGG&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change my code to filter out notes containing either &lt;code&gt;NOTE&lt;/code&gt; &lt;strong&gt;or&lt;/strong&gt; &lt;code&gt;LOGG&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="2274" LastEditDate="2015-08-25T14:12:31.140" LastActivityDate="2015-08-25T14:17:42.160" Title="Org agenda view: how to express OR when filtering tags?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15039" PostTypeId="2" ParentId="15038" CreationDate="2015-08-25T14:17:42.160" Score="4" Body="&lt;p&gt;The OR operator is &quot;|&quot;.  Searching for &lt;code&gt;NOTE|LOGG&lt;/code&gt; will find entries with the &lt;code&gt;NOTE&lt;/code&gt; tag OR the &lt;code&gt;LOGG&lt;/code&gt; tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a list of all the available options on the &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/advanced-searching.html&quot; rel=&quot;nofollow&quot;&gt;advanced searching&lt;/a&gt; page of the manual.  The basic operations are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| or &#xA;&amp;amp; and &#xA;+ include matches &#xA;- exclude matches &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OR always comes &lt;em&gt;last&lt;/em&gt; in the order of operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regular expression searches are also possible using &lt;code&gt;{}&lt;/code&gt;.  A search for &lt;code&gt;+{NOTE\\|LOGG}&lt;/code&gt; will also find entries with &lt;code&gt;NOTE&lt;/code&gt; OR &lt;code&gt;LOGG&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-08-25T14:17:42.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15040" PostTypeId="2" ParentId="15033" CreationDate="2015-08-25T14:24:58.227" Score="6" Body="&lt;p&gt;Below works with brief testing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If no region is selected to begin with, the current line will be selected and the cursor will move to the next line (default, if no prefix arg is used).&lt;/li&gt;&#xA;&lt;li&gt;If a region is already selected, all this command will do is move the cursor to the next line (default, if no prefix arg is used).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With that functionality, hitting &lt;code&gt;C-l&lt;/code&gt; once will select only the current line. But hitting &lt;code&gt;C-l&lt;/code&gt; consecutive times will keep on adding consecutive lines to the selection.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/select-current-line-and-forward-line (arg)&#xA;  &quot;Select the current line and move the cursor by ARG lines IF&#xA;no region is selected.&#xA;&#xA;If a region is already selected when calling this command, only move&#xA;the cursor by ARG lines.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (when (not (use-region-p))&#xA;    (forward-line 0)&#xA;    (set-mark-command nil))&#xA;  (forward-line arg))&#xA;;; Note that I would not recommend binding this command to `C-l'.&#xA;;; From my personal experience, the default binding to `C-l' to&#xA;;; `recenter-top-bottom' is very useful.&#xA;(global-set-key (kbd &quot;C-l&quot;) #'my/select-current-line-and-forward-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'd like to add that I personally prefer simply doing &lt;code&gt;C-a C-SPC&lt;/code&gt; followed by &lt;code&gt;C-n&lt;/code&gt; or &lt;code&gt;C-p&lt;/code&gt; or &lt;code&gt;M-{&lt;/code&gt; or &lt;code&gt;M-}&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-a C-SPC&lt;/code&gt; will take the cursor to the beginning of the line and set the mark. &lt;/li&gt;&#xA;&lt;li&gt;After that the selection will expand based on the navigation command you use. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Using this generic approach will give you much more flexibility on how you change your selection.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-08-25T14:37:30.897" LastActivityDate="2015-08-25T14:37:30.897" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15041" PostTypeId="1" CreationDate="2015-08-25T14:32:40.223" Score="1" ViewCount="176" Body="&lt;p&gt;As explained &lt;a href=&quot;http://emacswiki.org/emacs/ExecPath&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (append exec-path '(&quot;/sw/bin&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;one can append the directory name &lt;code&gt;/sw/bin&lt;/code&gt; to  &lt;code&gt;exec-path&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to append to &lt;code&gt;exec-path&lt;/code&gt; the absolute file names of all directories on &lt;em&gt;the local machine&lt;/em&gt; that match a certain regular expression? (for example to append (full) directory names that begin with some string to &lt;code&gt;exec-path&lt;/code&gt;)? &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-08-25T18:08:03.057" LastActivityDate="2015-08-25T18:08:03.057" Title="Append to exec-path the absolute file names of directories that match a regexp?" Tags="|directories|exec-path|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15043" PostTypeId="1" CreationDate="2015-08-25T16:15:42.653" Score="4" ViewCount="101" Body="&#xA;&#xA;&lt;p&gt;Is it possible to handle a SLIME/Swank error in Emacs Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I have a Lisp buffer with a syntax error in it. How can I do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(condition-case nil&#xA;        (slime-eval-buffer)&#xA;      (error (message &quot;Slime error&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To handle the SLIME error?&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-08-25T16:15:42.653" Title="Handle a SLIME/Swank error in Elisp" Tags="|elisp|slime|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15044" PostTypeId="2" ParentId="7331" CreationDate="2015-08-25T17:50:10.440" Score="1" Body="&lt;p&gt;The space between agenda blocks is controlled by &lt;code&gt;org-agenda-block-seperator&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The separator between blocks in the agenda.&#xA;  If this is a string, it will be used as the separator, with a newline added.&#xA;  If it is a character, it will be repeated to fill the window width.&#xA;  If nil the separator is disabled.  In ‘org-agenda-custom-commands’ this&#xA;  addresses the separator between the current and the previous block.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Setting it to &lt;code&gt;nil&lt;/code&gt; removes the separator entirely, leaving only &lt;code&gt;org-agenda-overriding-header&lt;/code&gt; between the blocks, which you can also leave as &lt;code&gt;nil&lt;/code&gt; instead of an empty string.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="201" LastEditDate="2015-08-26T09:14:30.853" LastActivityDate="2015-08-26T09:14:30.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15045" PostTypeId="2" ParentId="15041" CreationDate="2015-08-25T17:56:20.047" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Load library &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;`dired+.el&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use this command:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Change ROOT definition if you want a different Windows drive as root.&#xA;;; (Windows does not have a single root.)&#xA;(defun foo (regexp)&#xA;  &quot;Append the accessible directories that match REGEXP to `exec-path'.&#xA;You are prompted for the REGEXP.&quot;&#xA;  (interactive (list (read-regexp &quot;Regexp: &quot;)))&#xA;  (message &quot;Gathering directories...&quot;)&#xA;  (let* ((root         (if (eq system-type 'windows-nt) &quot;C:/&quot; &quot;/&quot;))&#xA;         (dirs-to-add  (diredp-directories-within&#xA;                         root&#xA;                         nil&#xA;                         (lambda (dir) (string-match-p regexp dir)))))&#xA;    (setq exec-path  (append exec-path dirs-to-add))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;FYI, this is &lt;code&gt;diredp-directories-within&lt;/code&gt;, but the definition of &lt;code&gt;diredp-files-within&lt;/code&gt; is too long to show here.  See &lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;`dired+.el&lt;/a&gt; for it.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun diredp-directories-within (&amp;amp;optional directory no-symlinks-p predicate)&#xA;  &quot;List of accessible directories within DIRECTORY.&#xA;Directories in `icicle-ignored-directories' are skipped, if you use&#xA;Icicles.  Otherwise, directories in `vc-directory-exclusion-list' are&#xA;skipped.&#xA;&#xA;Optional arg DIRECTORY defaults to the value of `default-directory'.&#xA;Non-nil optional arg NO-SYMLINKS-P means do not follow symbolic links.&#xA;Non-nil optional arg PREDICATE must be a function that accepts a&#xA; file-name argument.  Only directories that satisfy PREDICATE are&#xA; included in the result.&quot;&#xA;  (unless directory (setq directory  default-directory))&#xA;  (let ((dirs  (diredp-files-within (directory-files directory 'FULL diredp-re-no-dot)&#xA;                                    () no-symlinks-p 'INCLUDE-DIRS-P&#xA;                                    #'file-directory-p)))&#xA;    (if predicate (diredp-remove-if-not predicate dirs) dirs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;FYI2: See also &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21346&quot; rel=&quot;nofollow&quot;&gt;Emacs bug #21346&lt;/a&gt;, which I just reported.  It might affect the use of this command.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-08-25T18:01:20.790" LastActivityDate="2015-08-25T18:01:20.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15046" PostTypeId="1" CreationDate="2015-08-25T20:07:10.193" Score="4" ViewCount="428" Body="&lt;p&gt;When displaying the weekly agenda, can days be displayed side by side, the way they are displayed in Google Calendar's weekly view?&lt;/p&gt;&#xA;" OwnerUserId="3945" LastActivityDate="2015-08-25T20:07:10.193" Title="Can you configure the agenda weekly view to display horizontally?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15048" PostTypeId="2" ParentId="13107" CreationDate="2015-08-25T21:05:55.893" Score="7" Body="&lt;p&gt;I'm not so sure about replacing the &lt;em&gt;source&lt;/em&gt; with an image, but you can have inline images as results to source blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add the startup option &quot;&lt;code&gt;inlineimages&lt;/code&gt;&quot; to your buffer, any links in your buffer that point to local images it understands will be rendered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have a startup options block, it would just be a line at the top of your file that looks like: &lt;code&gt;#+STARTUP: inlineimages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only fixes half of your problem though...when you &lt;code&gt;C-c C-c&lt;/code&gt; a block that spits out an image, you will get a link rather than an inline image...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, you can fix this by adding the following to your Emacs config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-babel-after-execute-hook&#xA;          (lambda ()&#xA;            (when org-inline-image-overlays&#xA;              (org-redisplay-inline-images))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will allow you to see images inline when you first open the buffer, &lt;em&gt;and&lt;/em&gt; update them by evaluating the block source.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now, as for the whole source-replacing business:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to do this inside of your Org buffer, but in Org exports (To HTML, PDF, and so on...), if you don't want to show the source blocks that generate their results, you can add an &quot;&lt;code&gt;:exports results&lt;/code&gt;&quot; argument to the head of your code block. This will make it appear as though the source has been replaced with your image result.&lt;/p&gt;&#xA;" OwnerUserId="2039" LastActivityDate="2015-08-25T21:05:55.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15049" PostTypeId="1" AcceptedAnswerId="15052" CreationDate="2015-08-25T21:20:06.780" Score="2" ViewCount="225" Body="&lt;p&gt;I am not a fan of the way AUCTeX indent LaTeX code.  Some time ago I &lt;a href=&quot;https://stackoverflow.com/questions/21862391/prevent-auctex-indentation-with-fill-paragraph&quot;&gt;asked for help&lt;/a&gt; in disabling indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution provided there handles the large majority of my needs, but fails to prevent indentation of text inside brackets, such as for \footnote{text} or \textbf{something bold}.  More specifically, if I have some text like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is a paragraph which you should &#xA;pretend\footnote{some stuff} has much&#xA;longer lines.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then fill the paragraph, I often get something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is a paragraph which you &#xA;should pretend\footnote{some&#xA;  stuff} has much longer&#xA;lines.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't like the way the contents of the \footnote command are indented.  Is there a simple way to disable this?&lt;/p&gt;&#xA;" OwnerUserId="3991" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-08-25T22:34:31.973" Title="AUCTeX: prevent indentation inside commands" Tags="|indentation|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15050" PostTypeId="1" CreationDate="2015-08-25T21:25:48.560" Score="2" ViewCount="139" Body="&lt;p&gt;In org-mode, how can I &quot;publish&quot; all of the top level headings in separate files. Publishing involves moving files while making the required transformation. The transformation is from org to html. There is a similar question talking about exporting &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/2259/how-to-export-top-level-headings-of-org-mode-buffer-to-separate-files&quot;&gt;How to export top-level headings of org-mode buffer to separate files?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That solution is great and it works for exporting to html, pdf, and latex. Differently, I would like to avoid the interactive part and use the above functionality as a &quot;publish&quot; function in emacs. I may be still interested in different formats, however, since publishing is a batch function, it would not make sense to stop and ask for user input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can be done? Any  help would be greatly appreciated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="9303" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-08-25T21:25:48.560" Title="Publishing top-level orgmode entiries in separate files automatically" Tags="|org-mode|org-export|org-publish|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15051" PostTypeId="1" AcceptedAnswerId="15053" CreationDate="2015-08-25T21:43:36.317" Score="2" ViewCount="404" Body="&lt;p&gt;I'm a recent convert to helm. helm-M-x displays commands and includes key-bindings in parens after the command name. helm-apropos displays commands and other things. I'd like it to display the key bindings for commands that have them the same way as helm-M-x does. &lt;/p&gt;&#xA;" OwnerUserId="7057" LastActivityDate="2015-08-26T09:31:15.527" Title="Can helm-apropos display the key bindings for commands the way helm-M-x does?" Tags="|key-bindings|helm|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15052" PostTypeId="2" ParentId="15049" CreationDate="2015-08-25T22:34:31.973" Score="4" Body="&lt;p&gt;Reading the manual often helps: this is controlled by &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#Indenting&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;TeX-brace-indent-level&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;User Option: &lt;code&gt;TeX-brace-indent-level&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Number of spaces to add to the indentation for each &lt;code&gt;{&lt;/code&gt; not matched by a &lt;code&gt;}&lt;/code&gt;. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Set it to 0 in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-brace-indent-level 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-08-25T22:34:31.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15053" PostTypeId="2" ParentId="15051" CreationDate="2015-08-25T23:03:50.837" Score="3" Body="&lt;p&gt;Welcome to helm, you will like it ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to do it is to just overwrite the original function which builds the source for the apropos command candidates with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-def-source--emacs-commands (&amp;amp;optional default)&#xA;  (helm-build-in-buffer-source &quot;Commands&quot;&#xA;    :init `(lambda ()&#xA;             (helm-apropos-init 'commandp ,default))&#xA;    :fuzzy-match helm-apropos-fuzzy-match&#xA;    :filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)&#xA;                                         'helm-apropos-default-sort-fn)&#xA;&#xA;    :candidate-transformer 'helm-M-x-transformer-1&#xA;    :nomark t&#xA;    :action '((&quot;Describe Function&quot; . helm-describe-function)&#xA;              (&quot;Find Function&quot; . helm-find-function)&#xA;              (&quot;Info lookup&quot; . helm-info-lookup-symbol))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The added part is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:candidate-transformer 'helm-M-x-transformer-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which adds the keybindings to the candidates list. Just load this function after you loaded helm in your init file.&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-08-26T09:31:15.527" LastActivityDate="2015-08-26T09:31:15.527" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15054" PostTypeId="2" ParentId="14940" CreationDate="2015-08-26T01:15:09.207" Score="30" Body="&lt;p&gt;There is no &lt;em&gt;bug&lt;/em&gt; here.  Since I was also annoyed with this behavior, I just read Evil code to find out why this is happening.  So, here is a straight copy/paste of the well-commented one-liner from my Emacs configuration that fixes this issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Imagine the following scenario.  One wants to paste some previously copied&#xA;;; (from application other than Emacs) text to the system's clipboard in place&#xA;;; of some contiguous block of text in a buffer.  Hence, one switches to&#xA;;; `evil-visual-state' and selects the corresponding block of text to be&#xA;;; replaced.  However, one either pastes some (previously killed) text from&#xA;;; `kill-ring' or (if `kill-ring' is empty) receives the error: &quot;Kill ring is&#xA;;; empty&quot;; see `evil-visual-paste' and `current-kill' respectively.  The&#xA;;; reason why `current-kill' does not return the desired text from the&#xA;;; system's clipboard is because `evil-visual-update-x-selection' is being run&#xA;;; by `evil-visual-pre-command' before `evil-visual-paste'.  That is&#xA;;; `x-select-text' is being run (by `evil-visual-update-x-selection') before&#xA;;; `evil-visual-paste'.  As a result, `x-select-text' copies the selected&#xA;;; block of text to the system's clipboard as long as&#xA;;; `x-select-enable-clipboard' is non-nil (and in this scenario we assume that&#xA;;; it is).  According to the documentation of `interprogram-paste-function',&#xA;;; it should not return the text from the system's clipboard if it was last&#xA;;; provided by Emacs (e.g. with `x-select-text').  Thus, one ends up with the&#xA;;; problem described above.  To solve it, simply make&#xA;;; `evil-visual-update-x-selection' do nothing:&#xA;;; (fset 'evil-visual-update-x-selection 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last sentence is the answer to the question of how to &quot;&lt;em&gt;configure it, that the visually text gets replaced by the latest copy action, in this case the Windows clipboard?&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;(fset 'evil-visual-update-x-selection 'ignore)&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enjoy.&lt;/p&gt;&#xA;" OwnerUserId="2454" LastEditorUserId="2679" LastEditDate="2016-02-16T01:56:27.473" LastActivityDate="2016-02-16T01:56:27.473" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15055" PostTypeId="2" ParentId="14863" CreationDate="2015-08-26T01:51:13.217" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Plists-and-Alists.html&quot; rel=&quot;nofollow&quot;&gt;Emacs Lisp Manual&lt;/a&gt; gives a good explanation. Here's a brief summary:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you are associating info with something that is already a Lisp function or variable, plists are faster because they're usually smaller and tied directly to the symbol. But the plist of a symbol is a global namespace, so different packages might conflict.&lt;/li&gt;&#xA;&lt;li&gt;If you are trying to have general purpose information, an alist works better since keys can be anything, you can use it as a stack, and because different packages can have their own alists.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Association lists (*note Association Lists::) are very similar to&#xA;  property lists.  In contrast to association lists, the order of the&#xA;  pairs in the property list is not significant, since the property&#xA;  names must be distinct.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Property lists are better than association lists for attaching&#xA;  information to various Lisp function names or variables.  If your&#xA;  program keeps all such information in one association list, it will&#xA;  typically need to search that entire list each time it checks for an&#xA;  association for a particular Lisp function name or variable, which&#xA;  could be slow.  By contrast, if you keep the same information in the&#xA;  property lists of the function names or variables themselves, each&#xA;  search will scan only the length of one property list, which is&#xA;  usually short.  This is why the documentation for a variable is&#xA;  recorded in a property named `variable-documentation'.  The byte&#xA;  compiler likewise uses properties to record those functions needing&#xA;  special treatment.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;However, association lists have their own advantages.  Depending on&#xA;  your application, it may be faster to add an association to the front&#xA;  of an association list than to update a property.  All properties for&#xA;  a symbol are stored in the same property list, so there is a&#xA;  possibility of a conflict between different uses of a property name. &#xA;  (For this reason, it is a good idea to choose property names that are&#xA;  probably unique, such as by beginning the property name with the&#xA;  program's usual name-prefix for variables and functions.)  An&#xA;  association list may be used like a stack where associations are&#xA;  pushed on the front of the list and later discarded; this is not&#xA;  possible with a property list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2467" LastActivityDate="2015-08-26T01:51:13.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15056" PostTypeId="1" CreationDate="2015-08-26T02:53:58.093" Score="3" ViewCount="102" Body="&lt;p&gt;In the Emacs Trunk build -- i.e., built &lt;code&gt;--with-ns&lt;/code&gt;, I have the following entries that get added automatically to my &lt;code&gt;load-path&lt;/code&gt; when launching &lt;strong&gt;without any user configuration&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;.&quot; &quot;./Applications&quot; &quot;./Applications (Parallels)&quot; &quot;./Desktop&quot; &quot;./Documents&quot;&#xA;&quot;./Downloads&quot; &quot;./Library&quot; &quot;./Movies&quot; &quot;./Music&quot; &quot;./Pictures&quot; &quot;./Public&quot; &quot;./Sites&quot; &quot;./Users&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've done some grepping, but haven't found an option to prevent the creation of those entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, Emacs is scanning my home directory for all folders and creating entries based on the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent the creation of those entries?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does &lt;em&gt;NOT&lt;/em&gt; happen when I launch:  &lt;strong&gt;Emacs -Q&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; (08/26/2015):  I have tracked down the bug and submitted a bug report -- &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21353&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21353&lt;/a&gt; -- which states in relevant part:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;default-directory&lt;/code&gt; is initially set to &lt;code&gt;&quot;.&quot;&lt;/code&gt;, which results in erroneous entries being added to the &lt;code&gt;load-path&lt;/code&gt; by &lt;code&gt;normal-top-level-add-subdirs-to-load-path&lt;/code&gt; within &lt;code&gt;.../site-lisp/subdirs.el&lt;/code&gt; when starting Emacs.  The erroneous entries look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;.&quot; &quot;./Applications&quot; &quot;./Applications (Parallels)&quot; &quot;./Desktop&quot; &quot;./Documents&quot;&#xA;&quot;./Downloads&quot; &quot;./Library&quot; &quot;./Movies&quot; &quot;./Music&quot; &quot;./Pictures&quot; &quot;./Public&quot; &quot;./Sites&quot; &quot;./Users&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I built Emacs Trunk from the directory &lt;code&gt;~/Desktop&lt;/code&gt;, in the event that has any relevance -- &lt;code&gt;/Users/HOME/Desktop/emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="25" LastEditDate="2016-03-07T23:51:12.660" LastActivityDate="2016-03-07T23:51:12.660" Title="Emacs Trunk: How to prevent creation of home directories in `load-path`" Tags="|start-up|load-path|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15057" PostTypeId="1" AcceptedAnswerId="15058" CreationDate="2015-08-26T03:24:06.477" Score="6" ViewCount="428" Body="&lt;p&gt;When I am on a long line, beyond the end of an adjacent line, if I move up or down to the other line the point will go to end of the line, naturally. Then when I move back to the longer line, it goes to the same position I was originally at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, if I reach the end of the buffer by pressing down on the last line, when I move up it moves to the column I was in (or the end of the line if the column is from another longer line) rather than the column of the end of the last line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does it know what column to move to? This is not goal-column, it is transient (based on the last column explicitly horizontally moved to) rather than permanent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to control this behavior programmatically, so I would like to know any relevant variables or functions.&lt;/p&gt;&#xA;" OwnerUserId="6862" LastActivityDate="2015-08-26T03:45:57.810" Title="How does previous-line/next-line &quot;know&quot; the column it should move to from the end of the line" Tags="|point|motion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15058" PostTypeId="2" ParentId="15057" CreationDate="2015-08-26T03:45:57.810" Score="7" Body="&lt;p&gt;&lt;code&gt;next-line&lt;/code&gt; and &lt;code&gt;previous-line&lt;/code&gt; are defined in &lt;code&gt;simple.el&lt;/code&gt;, and call &lt;code&gt;line-move&lt;/code&gt;. If you take a look at the definition of the function, you'll see that it (as well as &lt;code&gt;line-move-1&lt;/code&gt; and &lt;code&gt;line-move-visual&lt;/code&gt; which can be called from &lt;code&gt;line-move&lt;/code&gt;) maintain a variable called &lt;code&gt;temporary-goal-column&lt;/code&gt; which keeps track of what column point was in when you began line movement.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;temporary-goal-column is a variable defined in `simple.el'.&#xA;Its value is 1&#xA;&#xA;Documentation:&#xA;Current goal column for vertical motion.&#xA;It is the column where point was at the start of the current run&#xA;of vertical motion commands.&#xA;&#xA;When moving by visual lines via the function `line-move-visual', it is a cons&#xA;cell (COL . HSCROLL), where COL is the x-position, in pixels,&#xA;divided by the default column width, and HSCROLL is the number of&#xA;columns by which window is scrolled from left margin.&#xA;&#xA;When the `track-eol' feature is doing its job, the value is&#xA;`most-positive-fixnum'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2467" LastActivityDate="2015-08-26T03:45:57.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15059" PostTypeId="1" CreationDate="2015-08-26T09:15:05.787" Score="8" ViewCount="1298" Body="&lt;p&gt;Does anyone know any good Emacs package or solution for local bug/issue tracking?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2018-03-21T15:53:32.730" Title="Is it there any good package for Emacs to do bug/issue tracking locally?" Tags="|problem-tracking|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15061" PostTypeId="1" AcceptedAnswerId="15062" CreationDate="2015-08-26T13:21:00.393" Score="5" ViewCount="566" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: (how) can I use &lt;code&gt;occur&lt;/code&gt; to match a phrase that&#xA;stretches over multiple lines?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here's a line of text with the phrase &quot;kittens and puppies&quot;.&#xA;Here's an awkward alternative: the phrase &quot;kittens and&#xA;puppies&quot; stretches across two lines.&#xA;Here's a false positive: &quot;kittens and otters&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to identify all the locations in the buffer that contain&#xA;the phrase &quot;kittens and puppies&quot;.  If I use &lt;code&gt;occur&lt;/code&gt;, however, the&#xA;following two problems arise:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the phrase &quot;kittens and puppies&quot; matches only the first line,&#xA;and not the second/third where the phrase wraps over a line&#xA;break.&lt;/li&gt;&#xA;&lt;li&gt;the phrase &quot;kittens&quot; (or &quot;kittens and&quot;) also matches the false&#xA;positive on the last line.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How, if at all, can I use &lt;code&gt;occur&lt;/code&gt; to locate the relevant lines in&#xA;the buffer -- those that contain the entire phrase, or the&#xA;beginning of one that wraps across lines?  If &lt;code&gt;occur&lt;/code&gt; can't do it,&#xA;is there an &lt;code&gt;occur&lt;/code&gt;-like alternative that can?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="50" LastEditDate="2015-08-26T14:28:31.830" LastActivityDate="2015-08-26T14:28:31.830" Title="Can occur match phrases that stretch across multiple lines?" Tags="|regular-expressions|occur|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15062" PostTypeId="2" ParentId="15061" CreationDate="2015-08-26T13:44:34.903" Score="5" Body="&lt;p&gt;The easiest might be &lt;code&gt;(occur &quot;kittens[ &#xA;]and[ &#xA;]puppies&quot; nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use occur interactively, you can insert the actual newlines with &lt;code&gt;C-q C-j&lt;/code&gt;. If you use the above lisp snippet, you can replace the newlines by &lt;code&gt;\n&lt;/code&gt;:&#xA;&lt;code&gt;(occur &quot;kittens[ \n]and[ \n]puppies&quot; nil)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-08-26T13:44:34.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15063" PostTypeId="1" CreationDate="2015-08-26T14:47:45.783" Score="4" ViewCount="1097" Body="&lt;p&gt;I'm using &lt;code&gt;evil&lt;/code&gt; with this sample &lt;code&gt;org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* test0&#xA;  test1&#xA;  test2&#xA;&#xA;  test3&#xA;* test4&#xA;&#xA;    |test5&#xA;* test6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the cursor is on line &quot;test6&quot; and I press &lt;kbd&gt;{&lt;/kbd&gt; (&lt;code&gt;evil-backward-paragraph&lt;/code&gt;), Emacs places the cursor between lines &quot;test2&quot; and &quot;test3&quot;. Then, when I press &lt;kbd&gt;}&lt;/kbd&gt; (&lt;code&gt;evil-forward-paragraph&lt;/code&gt;), the cursor goes to &quot;test4&quot;.  That's not how it works in Vim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make next/prev paragraph keys place the cursor on the first empty line below/above current cursor position, like in Vim?&lt;/p&gt;&#xA;" OwnerUserId="4005" LastEditorUserId="9121" LastEditDate="2015-08-26T17:01:24.427" LastActivityDate="2017-09-20T21:23:05.773" Title="How to make evil paragraph movements work in org mode?" Tags="|org-mode|evil|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15064" PostTypeId="1" AcceptedAnswerId="15066" CreationDate="2015-08-26T16:29:19.240" Score="18" ViewCount="6896" Body="&lt;p&gt;Like most Emacs users I've customized a mode by changing the variables. What never occurred to me is the whole programming mentality behind having customizable this-and-that. I realized this when I started looking at some of the source code for eshell. I'm not an elisp programmer, but specifically &lt;code&gt;em-ls.el&lt;/code&gt; seems to use &lt;code&gt;defcustom&lt;/code&gt;, &lt;code&gt;defgroup&lt;/code&gt;, etc. This would seem to be a shadow-world of globally-defined variables that the elisp code uses. So one question would be, Is the use of &lt;code&gt;defcustom&lt;/code&gt; another way of doing (customizable) global variables?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone point me to lit on how to properly use (first understand) the whole idea behind &lt;code&gt;defcustom&lt;/code&gt;, when to use, why, when not? Maybe a beginner example for a elisp beginner.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="2274" LastEditDate="2015-08-27T03:09:48.867" LastActivityDate="2015-08-27T03:09:48.867" Title="How to properly use defcustom?" Tags="|elisp|defcustom|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15065" PostTypeId="1" AcceptedAnswerId="15087" CreationDate="2015-08-26T16:40:41.560" Score="12" ViewCount="2607" Body="&lt;p&gt;I would like to evaluate in org mode source code blocks in C++ containing &quot;cin&quot; instructions  but I can't find a way to have an interactive evaluation (with user input) during evaluation. Example of code :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC C++  :results output :export code :tangle myfile.cpp &#xA;#include &amp;lt;iostream&amp;gt;&#xA;using namespace std;&#xA;&#xA;int main()&#xA;{&#xA;int a;&#xA;cin&amp;gt;&amp;gt;a;&#xA;cout&amp;lt;&amp;lt;a+1;&#xA;}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have such an interactive evaluation or to simulate (by giving to the source code a fake input) ? &lt;/p&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2023-10-30T14:15:35.770" Title="Org Mode Babel - Interactive code block evaluation" Tags="|org-mode|org-babel|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15066" PostTypeId="2" ParentId="15064" CreationDate="2015-08-26T16:52:58.843" Score="27" Body="&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html#Easy-Customization&quot; rel=&quot;noreferrer&quot;&gt;customization system&lt;/a&gt; is a built-in feature of Emacs designed to solve precisely the problem you describe—programming may not be the ideal way for the average user to configure their editor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The primary entry point to the customization functionality is &lt;code&gt;M-x customize RET&lt;/code&gt; (or &lt;code&gt;Options &amp;gt; Customize Emacs &amp;gt; Top-level Customization Group&lt;/code&gt; from the menu). From there you'll see an interactive menu system for adjusting settings. This interface enforces that all settings are of the correct type (number, string, color, etc.), avoiding a major source of error encountered when users configure Emacs programmatically. If the user chooses to persist any changes they make through the UI, the settings are stored to a special section in the user's initialization file (read: &lt;code&gt;.emacs&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defcustom&lt;/code&gt; is wrapper around lower-level Emacs Lisp functionality like &lt;code&gt;defvar&lt;/code&gt; that both declares the variable &lt;em&gt;and&lt;/em&gt; makes it visible within the customization interface. It also allows the developer to provide extra metadata needed to display an appropriate interactive control—i.e. what type of value is stored in this variable? An arbitrary string? A number? A choice from a fixed set of options? etc. &lt;code&gt;defgroup&lt;/code&gt; is a grouping construct for these customizable options so that they can be arranged into a nice hierarchy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This functionality should be used any time a piece of data should be considered a configurable option for the user rather than an internal detail of the library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a simple example cribbed from a small library of mine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defgroup checkbox nil&#xA;  &quot;Quick manipulation of textual checkboxes.&quot;&#xA;  :group 'convenience)&#xA;&#xA;(defcustom checkbox-states '(&quot;[ ]&quot; &quot;[x]&quot;)&#xA;  &quot;Checkbox states to cycle between.&#xA;First item will be the state for new checkboxes.&quot;&#xA;  :group 'checkbox&#xA;  :type '(repeat string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;defgroup&lt;/code&gt; creates a new group within the Customization interface under the top-level &lt;code&gt;convenience&lt;/code&gt; item. I then needed a variable to store the possible checkbox states. I could have used &lt;code&gt;defvar&lt;/code&gt;, but since I want this to be easily customizable, I chose to use &lt;code&gt;defcustom&lt;/code&gt;. The &lt;code&gt;:group&lt;/code&gt; portion indicates that it belongs to the previously-defined group, and the &lt;code&gt;:type&lt;/code&gt; indicates that it is a sequence of strings. There's also a default value and a description. There are also additional facilities (not shown here) for transforming values entered by the user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I now run &lt;code&gt;M-x customize RET&lt;/code&gt; and navigate to &lt;code&gt;Convenience &amp;gt; Checkbox&lt;/code&gt;, I see the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qKMwU.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qKMwU.png&quot; alt=&quot;customization interface&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not the most beautiful interface in the world, but notice that it has interactive tools for customizing the value of &quot;Checkbox States&quot; (&lt;code&gt;checkbox-states&lt;/code&gt; internally). It shows the current string values along with &lt;code&gt;INS&lt;/code&gt; (insert) and &lt;code&gt;DEL&lt;/code&gt; (delete) buttons, and allows us to edit the string values in edit boxes. When we're done we can decide whether to apply our changes, revert them, or apply and save them for future sessions.&lt;/p&gt;&#xA;" OwnerUserId="812" LastEditorUserId="812" LastEditDate="2015-08-27T02:53:05.377" LastActivityDate="2015-08-27T02:53:05.377" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15067" PostTypeId="2" ParentId="15001" CreationDate="2015-08-26T17:02:37.863" Score="2" Body="&lt;p&gt;The problem seems to be that emacs tries to &lt;code&gt;require&lt;/code&gt; the &lt;code&gt;session&lt;/code&gt; package (as per the &lt;code&gt;REQUEST&lt;/code&gt; argument to &lt;code&gt;custom-set-variables&lt;/code&gt;), and fails (probably because it is not found in &lt;code&gt;load-path&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to make sure that your &lt;code&gt;load-path&lt;/code&gt; is correctly populated before you load your customization file. In particular, if &lt;code&gt;session&lt;/code&gt; is installed as an ELPA package, it means that &lt;code&gt;package-initialize&lt;/code&gt; must be called before the customization file is loaded.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-08-26T17:02:37.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15068" PostTypeId="2" ParentId="15064" CreationDate="2015-08-26T17:45:40.713" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is the use of defcustom another way of doing (customizable) global variables?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. Especially if you want users of your code to be able to change variables easily through the &lt;strong&gt;M-x customize&lt;/strong&gt; interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;defcustom&lt;/strong&gt; provides two important benefits to your users: documentation and type safety. Documentation is nice to have right there. Type safety allows one to specify what kinds of valid values your variables can take.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course &lt;strong&gt;defvar&lt;/strong&gt; is fine if all you'r doing is customizing for yourself and don't anticipate wider usage. However, some would say sticking with &lt;strong&gt;defcustom&lt;/strong&gt; through and through is a good habit to inculcate. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can anyone point me to lit on how to properly use...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/defcustom.html&quot; rel=&quot;noreferrer&quot;&gt;manual page for defcustom&lt;/a&gt; has further clarifications. &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Customization.html#Customization&quot; rel=&quot;noreferrer&quot;&gt;Customizations topic&lt;/a&gt; in the manual has complete details.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...when to use, why, when not?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I personally find defcustom less cumbersome during development as I don't have to deal with &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_defvar_problem.html&quot; rel=&quot;noreferrer&quot;&gt;reload problems&lt;/a&gt; with defvar and setq.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-08-26T17:45:40.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15069" PostTypeId="1" AcceptedAnswerId="15070" CreationDate="2015-08-26T18:21:00.680" Score="4" ViewCount="164" Body="&lt;p&gt;On a fresh install of emacs, I loaded my personal init files with all my custom lisp code. Then I changed one setting using the Customize interface and saved my changes. But in the &lt;code&gt;custom.el&lt;/code&gt; file, Customize saved not just that one change, but all non default states. So now I have a &lt;code&gt;custom.el&lt;/code&gt; file filled with information that's redundant with my own personal init file. This makes it tedious to look through my &lt;code&gt;custom.el&lt;/code&gt; file to see settings I've changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this default behavior? Is there any way to direct Customize to save only the changes I make through the Customize interface?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="9121" LastEditDate="2015-08-26T21:27:41.280" LastActivityDate="2015-08-26T21:27:41.280" Title="how to not save duplicate information in Customize?" Tags="|customize|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15070" PostTypeId="2" ParentId="15069" CreationDate="2015-08-26T19:12:54.663" Score="2" Body="&lt;p&gt;I have seen similar behavior when using &lt;code&gt;load-theme&lt;/code&gt;. I'm not yet sure if this is an Emacs bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behavior I see is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start Emacs, and customize one or more variables for the current session. I've tried this using &lt;code&gt;customize-set-variable&lt;/code&gt; in my init file, as well as using the Easy Customization interface and &lt;code&gt;Set for Current Session&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Load a theme.&lt;/li&gt;&#xA;&lt;li&gt;Customize another option and this time &lt;code&gt;Save for Future Sessions&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The result of this sequence is that all the options that I intended to be set only for the current session get written out to the custom file. The act of loading a theme somehow marks them to be saved. You can test this by loading your theme before making other customizations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strikes me as wrong, though I am not very familiar with the Emacs theme mechanism. I intend to verify this in a clean environment and file an Emacs bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK, I can reproduce this with a clean environment. Since this issue involves saving customizations you cannot test with &lt;code&gt;emacs -Q&lt;/code&gt; (which disables saving changes), so I tested by starting Emacs 24.4 with an empty user home directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-variable user-full-name&lt;/code&gt;; set some value; &lt;code&gt;Set for Current Session&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x load-theme deeper-blue&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-variable user-mail-address&lt;/code&gt;; set some value; &lt;code&gt;Save for Future Sessions&lt;/code&gt;. &#xA;This results in a new &lt;code&gt;.emacs&lt;/code&gt; file that includes both &lt;code&gt;user-full-name&lt;/code&gt; and &lt;code&gt;user-mail-address&lt;/code&gt;, even though the name should have only been set for the current session. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Submitted &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21355&quot; rel=&quot;nofollow&quot;&gt;bug #21355&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-08-26T21:08:53.930" LastActivityDate="2015-08-26T21:08:53.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15071" PostTypeId="1" CreationDate="2015-08-26T20:25:22.413" Score="3" ViewCount="146" Body="&lt;p&gt;To configure imenu in my major mode, I need to set &lt;code&gt;imenu-generic-expression&lt;/code&gt; to have regexps for functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is incorrectly detects things inside comments and strings that look like functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I prevent this? &lt;code&gt;imenu&lt;/code&gt; isn't confused by the following elisp, but I can't see what &lt;code&gt;emacs-lisp-mode&lt;/code&gt; is doing differently.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; imenu detects this.&#xA;(defun foo () (foo))&#xA;&#xA;;; imenu correctly ignores this, even though it's at&#xA;;; the beginning of the line.&#xA;&quot;&#xA;(defun bar () (bar))&#xA;&quot;&#xA;&#xA;;; imenu correctly ignores this.&#xA;;; (defun baz () (baz))&#xA;&#xA;;; imenu correctly detects this, even though it's not&#xA;;; at the beginning of the line.&#xA; (defun boz () (boz))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2015-08-26T21:01:20.320" LastActivityDate="2015-08-28T10:36:19.477" Title="How can I configure imenu to ignore comments?" Tags="|syntax|imenu|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15072" PostTypeId="1" AcceptedAnswerId="15075" CreationDate="2015-08-26T20:38:33.197" Score="1" ViewCount="269" Body="&lt;p&gt;I'm using emacs on the mac and helm-projectile is acting up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/BZaiS.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's still working for files in current dired buffer, but the find-files feature is throwing the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find: -perm /444: illegal mode string&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I recently installed &lt;a href=&quot;https://github.com/jonathanchu/emacs-powerline&quot; rel=&quot;nofollow noreferrer&quot;&gt;powerline&lt;/a&gt; and I'm wondering if it has anything to do with the mode line, but I'm not sure if that's the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone ever had this error before?&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2015-08-26T21:53:20.560" Title="Helm-Projectile find -perm /444 illegal mode string" Tags="|helm|mode-line|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15073" PostTypeId="1" CreationDate="2015-08-26T21:31:12.293" Score="3" ViewCount="748" Body="&lt;p&gt;Is it possible to &lt;em&gt;merge&lt;/em&gt; &lt;code&gt;find-function&lt;/code&gt; and &lt;code&gt;find-variable&lt;/code&gt; to a&#xA;single &lt;code&gt;find-function-or-variable&lt;/code&gt; to be able to search both functions and variables at the&#xA;same time and going to their definition in the same way as for &lt;code&gt;find-function&lt;/code&gt; and &lt;code&gt;find-variable&lt;/code&gt;? &#xA;(possibly with the ability to use &#xA;TAB completion like the original &lt;code&gt;find-function&lt;/code&gt; and &lt;code&gt;find-variable&lt;/code&gt; and choosing between two options when a function and a variable bear the same name as remarked by @lawlist).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-26T22:05:46.743" LastActivityDate="2015-08-26T22:27:19.587" Title="Finding the source file containing the definition of functions and variables" Tags="|documentation|source|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15075" PostTypeId="2" ParentId="15072" CreationDate="2015-08-26T21:53:20.560" Score="3" Body="&lt;p&gt;The option &lt;code&gt;-perm /444&lt;/code&gt; is specific to the GNU &lt;code&gt;find&lt;/code&gt; command, so it works on Linux but not on other Unix systems such as OSX. It looks for files that are readable by at least one user, which is pretty useless in practice since it's quite rare for a file not to be readable by anyone. &lt;code&gt;-readable&lt;/code&gt; (which matches files that are readable to you) would be useful, but it too is a GNU extension which is not available on OSX. If you find what's issuing it, just remove the &lt;code&gt;-perm /444&lt;/code&gt; bit altogether.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no &lt;code&gt;-perm /444&lt;/code&gt; in Helm or Projectile from Git. However there was a use of &lt;code&gt;-perm /444&lt;/code&gt; in Projectile for a few weeks in July 2015, in an attempt to fix &lt;a href=&quot;https://github.com/bbatsov/projectile/issues/695&quot; rel=&quot;nofollow&quot;&gt;issue #695&lt;/a&gt;. This is probably what you're seeing. It was &lt;a href=&quot;https://github.com/bbatsov/projectile/commit/aa1a44d7b9f71e3612da699d2ac4c89c16ebb3e6&quot; rel=&quot;nofollow&quot;&gt;introduced on 2015-07-28&lt;/a&gt; and &lt;a href=&quot;https://github.com/bbatsov/projectile/commit/926d6f7fafc8acab16b04de0b5b7b19f6062bfed&quot; rel=&quot;nofollow&quot;&gt;fixed on 2015-08-07&lt;/a&gt;, so just upgrading helm-projectile to the latest version on MELPA (currently 20150826.321) should work.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-08-26T21:53:20.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15076" PostTypeId="1" CreationDate="2015-08-26T21:55:11.610" Score="7" ViewCount="1483" Body="&lt;p&gt;Given something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| $1.10 |   |&#xA;| $2.20 |   |&#xA;| $3.30 |   |&#xA;|       |   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do you add the amounts with $-sign? &lt;code&gt;C-c +&lt;/code&gt; does not work for me.&lt;/p&gt;&#xA;" OwnerUserId="9316" LastEditorUserId="9316" LastEditDate="2015-08-26T22:05:20.247" LastActivityDate="2023-05-19T07:39:40.597" Title="How to add dollar amounts in org mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15077" PostTypeId="2" ParentId="15073" CreationDate="2015-08-26T22:27:19.587" Score="4" Body="&lt;p&gt;You can use &lt;kbd&gt;C-h o&lt;/kbd&gt; (&lt;code&gt;describe-symbol&lt;/code&gt;) on Emacs 25, here is the related NEWS info:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Changes in Emacs 25.1&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;** New doc command `describe-symbol'.  Works for functions, vars, faces, etc...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(It was originally called &lt;code&gt;describe-function-or-variable&lt;/code&gt; according to &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=824fc04b660631e7ff976a36b7f70f7c3d5fc181&quot; rel=&quot;nofollow noreferrer&quot;&gt;this commit&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variable and function with the same name can be showed at the same time, for example, &lt;code&gt;emacs-version&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JlYVO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JlYVO.png&quot; alt=&quot;e.g., query &amp;quot;emacs-version&amp;quot;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-08-26T22:27:19.587" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15078" PostTypeId="1" AcceptedAnswerId="15106" CreationDate="2015-08-27T00:04:16.923" Score="2" ViewCount="713" Body="&lt;p&gt;I'm using after-string overlays as in &lt;a href=&quot;https://emacs.stackexchange.com/questions/3030/temporary-text-in-window-location-with-no-text-to-propertize-overlay&quot;&gt;this question&lt;/a&gt; to put text on the right hand side of the buffer, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((overlay (make-overlay (point-max) (point-max) (current-buffer))))&#xA;  (overlay-put overlay 'intangible t)&#xA;  (overlay-put overlay 'before-string&#xA;               (concat&#xA;                (propertize &quot; &quot; 'display `(space :align-to (- right-fringe ,(1+ (length text)))))&#xA;                text))&#xA;  overlay))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works well, but if I position the cursor at the end of the buffer at insert characters, I insert past the overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Pr8nq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Pr8nq.png&quot; alt=&quot;I&amp;#39;m inserting past the overlay. Oh no!&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the image, the check mark is my overlay, and the &lt;code&gt;x&lt;/code&gt; after it is something I inserted by typing an &lt;code&gt;x&lt;/code&gt; after the word &lt;code&gt;Type&lt;/code&gt;, which was previously the last word in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I stop this from happening? I'd like the overlay to permanently sit past all the actual text in the buffer.&lt;/p&gt;&#xA;" OwnerUserId="9317" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-08-16T05:10:18.240" Title="Inserting before an after-string overlay" Tags="|overlays|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15079" PostTypeId="1" AcceptedAnswerId="15082" CreationDate="2015-08-27T00:13:14.943" Score="4" ViewCount="4240" Body="&lt;p&gt;The org-mode Worg site, &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-export-generic.html&quot; rel=&quot;nofollow&quot; title=&quot;org-export-generic&quot;&gt;org-export-generic&lt;/a&gt; , says that there is a wikipedia exporter. I tried to run it with &lt;code&gt;M-x org-export-generic&lt;/code&gt; but i'm getting a 'Cannot open load file:org-export-generic' error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to get my current .org file to export to a &lt;a href=&quot;https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all&quot; rel=&quot;nofollow&quot; title=&quot;Jira Wiki Markup&quot;&gt;Jira Wiki Markup&lt;/a&gt; using export so I can put it on a JIRA description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs24.3.1 on windows 7.&lt;/p&gt;&#xA;" OwnerUserId="9115" LastActivityDate="2019-03-14T10:02:20.677" Title="In org-mode, how do I export to JIRA wiki markup?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15080" PostTypeId="1" CreationDate="2015-08-27T00:22:24.317" Score="0" ViewCount="232" Body="&lt;p&gt;I want to write a mode for ledger. The first thing I want to do is to be able to insert date stamps. There is a very nice mode in Emacs called &lt;code&gt;calendar&lt;/code&gt;. I want to be able to select a date within it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I register a call-back or something that will be executed when the user has select a date (by pressing enter or any other way that calendar mode already uses).&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="105" LastEditDate="2019-01-15T20:29:58.760" LastActivityDate="2024-01-20T16:08:36.017" Title="how to detect selection in date mode?" Tags="|time-date|calendar|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="15081" PostTypeId="1" CreationDate="2015-08-27T00:27:12.210" Score="6" ViewCount="5491" Body="&lt;p&gt;I need to make a function that will choose an org mode file if emacs was called with no arguments, and basically go about its way otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun personaltodo ()&#xA;   (if (= 1 (length command-line-args))&#xA;      (find-file &quot;~/personalorg&quot;)&#xA;   )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works only if I'm calling emacs plainly. If I call it like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs testfile&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or through another program like Mutt, it doesn't open it and I'm forced to switch with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyone have any ideas? &lt;/p&gt;&#xA;" OwnerUserId="9315" LastEditorUserId="105" LastEditDate="2017-02-08T00:27:49.510" LastActivityDate="2017-02-08T00:27:49.510" Title="Programming of Initial-buffer-choice" Tags="|buffers|start-up|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15082" PostTypeId="2" ParentId="15079" CreationDate="2015-08-27T00:31:49.463" Score="4" Body="&lt;p&gt;The &lt;code&gt;org-contrib&lt;/code&gt; packages are not included with Emacs -- you would need to download an org distribution and add the contrib packages to your load-path as described in the &lt;a href=&quot;http://orgmode.org/manual/Installation.html#Installation&quot; rel=&quot;nofollow&quot;&gt;Installation section&lt;/a&gt; of the Org manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it looks like &lt;code&gt;org-export-generic&lt;/code&gt; was removed from org-contrib a few years ago. You could experiment with &lt;code&gt;ox-confluence&lt;/code&gt; (also part of org-contrib) as I believe the markup is the same for Confluence and Jira.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-08-27T00:31:49.463" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15084" PostTypeId="2" ParentId="15076" CreationDate="2015-08-27T06:55:07.007" Score="4" Body="&lt;p&gt;Short answer: in the form that you want to do it, it isn't possible.  Sigil (the dollar sign) is used in Org mode formulas for special purposes such as denoting a column or a name of a variable.  However, you could use the same units, but expressed differently.  For instance, you could use Calc to add currency units like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x * c&lt;/kbd&gt; - opens calculator.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;'&lt;/kbd&gt;&lt;code&gt;usd&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; - puts the word &lt;code&gt;usd&lt;/code&gt; on stack.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;u c&lt;/kbd&gt; &lt;em&gt;answer prompts&lt;/em&gt; - creates a new fundamental unit named &lt;code&gt;usd&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;u p&lt;/kbd&gt; saves units for future use.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;'&lt;/kbd&gt;&lt;code&gt;1.13 usd&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; - puts &lt;code&gt;1.13 usd&lt;/code&gt; on stack.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;u c&lt;/kbd&gt; creates new units, when prompted for units name answer with &lt;code&gt;eur&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;u p&lt;/kbd&gt; save units again.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could locate the Calc settings file (by examining &lt;kbd&gt;M-:&lt;/kbd&gt;&lt;code&gt;calc-settings-file&lt;/code&gt;, which is typically &lt;code&gt;~/.emacs.d/calc.el&lt;/code&gt;) and add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq math-additional-units '(&#xA;  (eur &quot;1.13 * usd&quot; &quot;Euro&quot;)&#xA;  (usd nil &quot;United States Dollar&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to this file.  (You will only need to do this once.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you can write something like this in your Org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 1.10 usd | 6.886 usd |&#xA;| 2.20 eur |           |&#xA;| 3.30 usd |           |&#xA;#+tblfm: @1$2=usimplify(vsum(@1$1..@3$1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-08-27T08:46:26.590" LastActivityDate="2015-08-27T08:46:26.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15085" PostTypeId="2" ParentId="15033" CreationDate="2015-08-27T07:04:08.313" Score="1" Body="&lt;p&gt;&lt;strong&gt;Shift Selection Mode&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the cursor is at the beginning of a line: &lt;kbd&gt;C-S-n&lt;/kbd&gt; or in another notation &lt;kbd&gt;C-N&lt;/kbd&gt;. &#xA;If not, please type: &lt;kbd&gt;C-a C-S-n&lt;/kbd&gt; (which is in my notation &lt;kbd&gt;C-aN&lt;/kbd&gt;, since you have to type the &lt;code&gt;&amp;lt;CTRL&amp;gt;&lt;/code&gt; key just once). By the way &lt;code&gt;shift-selection-mode&lt;/code&gt;is &lt;code&gt;t&lt;/code&gt; by default.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-08-27T08:28:17.820" LastActivityDate="2015-08-27T08:28:17.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15086" PostTypeId="1" AcceptedAnswerId="15107" CreationDate="2015-08-27T09:36:06.517" Score="0" ViewCount="90" Body="&lt;p&gt;In order to prevent NFS caching from leading to stale files, I need to preserve the inode of a file when Emacs saves it.  Normally, it does so anyway, but apparently not if backup files come into play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can test this easily by adding the following snippet to .emacs, forcing Emacs to create backups with every save:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun force-backup-of-buffer ()&#xA;  (setq buffer-backed-up nil))&#xA;(add-hook 'before-save-hook 'force-backup-of-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can one make Emacs save files &lt;em&gt;always&lt;/em&gt; in place?&lt;/p&gt;&#xA;" OwnerUserId="8794" LastActivityDate="2015-08-27T15:51:39.933" Title="How to save a file in place even with backups?" Tags="|files|backup|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15087" PostTypeId="2" ParentId="15065" CreationDate="2015-08-27T09:44:07.417" Score="9" Body="&lt;p&gt;Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src C++ :results output :cmdline &amp;lt; in.txt&#xA;#include &amp;lt;iostream&amp;gt;&#xA;int main(int argc, char *argv[]) {&#xA;  int a;&#xA;  std::cin &amp;gt;&amp;gt; a;&#xA;  std::cout &amp;lt;&amp;lt; a + 1;&#xA;  return 0;&#xA;}&#xA;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: 11&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Create a file &lt;code&gt;in.txt&lt;/code&gt; in the same directory as the Org file, with contents &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-08-27T09:44:07.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15088" PostTypeId="2" ParentId="14484" CreationDate="2015-08-27T11:18:11.673" Score="0" Body="&lt;p&gt;The difficulty here is that you want to add some code before and after a certain &lt;code&gt;sexp&lt;/code&gt;. In this situation the sexp is &lt;code&gt;(concat &quot; %&quot; (number-to-string w) &quot;d &quot;)&lt;/code&gt;. You want to insert the &lt;em&gt;if-statement&lt;/em&gt; &lt;code&gt;(if (&amp;gt; w 1)&lt;/code&gt; before it and the &lt;em&gt;else-statement&lt;/em&gt; &lt;code&gt;&quot; %2d &quot;)&lt;/code&gt; after it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A major part of the difficulty is to &lt;em&gt;isolate&lt;/em&gt; this &lt;code&gt;sexp&lt;/code&gt;, personally I use the below command for isolating a &lt;code&gt;sexp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isolate-sexp () (interactive)&#xA;       (save-excursion (forward-sexp) (if (not (eolp-almost))&#xA;               (split-line) nil)))&#xA;(defun eolp-almost () (interactive)&#xA;(save-excursion (while (equal (char-after) ? ) (forward-char 1))&#xA;        (if (eolp) t nil )      ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just put the cursor at the beginning of &lt;code&gt;(concat &quot; %&quot; (number-to-string w) &quot;d &quot;)&lt;/code&gt;, i.e., at the first &lt;code&gt;(&lt;/code&gt;, then apply the above &lt;code&gt;isolate-sexp&lt;/code&gt;.&#xA;You obtain&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice linum-update-window (around linum-dynamic activate)&#xA;   (let* ((w (length (number-to-string&#xA;      (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (concat &quot; %&quot; (number-to-string w) &quot;d &quot;)&#xA;                                  ))&#xA;            ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then add the appropriate code before and after this &lt;code&gt;sexp&lt;/code&gt;, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice linum-update-window (around linum-dynamic activate)&#xA;   (let* ((w (length (number-to-string&#xA;      (+ (count-lines (point-min) (point-max)) 1))))&#xA;         (linum-format (if (&amp;gt; w 1) (concat &quot; %&quot; (number-to-string w) &quot;d &quot;) &quot; %2d &quot;)&#xA;                                  ))&#xA;            ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And voila.&#xA;The obtained code in this way is perhaps not beautiful but the chance of getting lost is smaller.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-08-27T11:37:09.953" LastActivityDate="2015-08-27T11:37:09.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15089" PostTypeId="2" ParentId="15065" CreationDate="2015-08-27T12:35:20.393" Score="8" Body="&lt;p&gt;You can ask Emacs to get the interactive input instead using a named &lt;code&gt;elisp&lt;/code&gt; block. Then pass the collected value to the C++ souce block using the &lt;code&gt;:var c-variable=block-name&lt;/code&gt; syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: input_block&#xA;#+BEGIN_SRC elisp :export none :results none&#xA;(completing-read &quot;a=&quot; nil)&#xA;&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC C++  :results output :export code :tangle myfile.cpp :var input=input_block&#xA;  #include &amp;lt;stdlib.h&amp;gt;&#xA;  #include &amp;lt;iostream&amp;gt;&#xA;  using namespace std;&#xA;&#xA;  int main()&#xA;  {&#xA;  int a = atoi(input);&#xA;  cout&amp;lt;&amp;lt;a+1;&#xA;  }&#xA;#+END_SRC &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the outputs of source blocks are passed around as strings, so we have to convert it to an integer, hence the &lt;code&gt;atoi&lt;/code&gt; and the extra &lt;code&gt;#include&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-08-27T12:41:11.807" LastActivityDate="2015-08-27T12:41:11.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15090" PostTypeId="1" AcceptedAnswerId="15115" CreationDate="2015-08-27T12:39:51.947" Score="9" ViewCount="2102" Body="&lt;p&gt;I have the following problem with &lt;code&gt;recentf&lt;/code&gt;. If I open a file from commandline like &lt;code&gt;emacs myfile&lt;/code&gt; the file &lt;code&gt;myfile&lt;/code&gt; doesn't appear in the list of recently opened files (I also checked directly the file &lt;code&gt;.recentf&lt;/code&gt;). It doesn't matter if I change and save it or not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same problem if I kill emacs (&lt;code&gt;kill $(pgrep emacs)&lt;/code&gt;). Even if the file was opened via emacs &lt;code&gt;find-files&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I open a file via &lt;code&gt;find-files&lt;/code&gt; and close emacs properly it works also if I just visit the file without changing or saving anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to fix both issues?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make sure that the problem is not an interference effect with other packages I reduced my &lt;code&gt;.emacs&lt;/code&gt; file for test purposes to the follwing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*-Emacs-Lisp-*-&#xA;;; -*- coding:utf-8 -*-&#xA;&#xA;(require 'package)&#xA;&#xA;(package-initialize)&#xA;&#xA;(require 'recentf)&#xA;(recentf-mode 1)&#xA;&#xA;&#xA;;; Usually I use it via helm&#xA;;; From http://emacs.stackexchange.com/questions/14282/replace-splash-screen-with-list-of-recentf&#xA;;; (require 'helm)&#xA;;; (require 'helm-config)&#xA;&#xA;;; (if (&amp;lt; (length command-line-args) 2) &#xA;;; (setq initial-buffer-choice (car (helm-recentf)))&#xA;;; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My emacs version is 24.4.1. The OS is ubuntu vivid. As commandline I use zsh (with urxvt). &lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2015-08-27T15:49:10.733" LastActivityDate="2019-05-03T19:42:53.040" Title="Recentf doesn't remember all files" Tags="|debugging|recentf|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15091" PostTypeId="2" ParentId="15065" CreationDate="2015-08-27T12:52:51.057" Score="4" Body="&lt;p&gt;Thanks @abo-abo for your help. I have followed your suggestion which is right and even enhanced it a little to edit only my org file (and to create automatically the external input file). The idea is to create an external code block (here a bash script named build_input_file) which creates the data file and to call it automatically before evaluating the other block thanks to the&lt;code&gt;:var tmp=build_input_file&lt;/code&gt;.   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: build_input_file&#xA;#+BEGIN_SRC bash  :results none :exports none &#xA;echo &quot;10 12&quot; &amp;gt; in.txt&#xA;#+END_SRC&#xA;&#xA;#+name: my_function_with_cin&#xA;#+BEGIN_SRC C++  :results output :exports both  :var tmp=build_input_file :cmdline &amp;lt; in.txt&#xA;#include &amp;lt;iostream&amp;gt;&#xA;using namespace std;&#xA;&#xA;int main()&#xA;{&#xA; int a,b;&#xA; cin&amp;gt;&amp;gt;a&amp;gt;&amp;gt;b;&#xA; cout&amp;lt;&amp;lt;a&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;b;&#xA;}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9245" LastEditorUserId="9245" LastEditDate="2015-08-27T13:06:50.040" LastActivityDate="2015-08-27T13:06:50.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15092" PostTypeId="1" AcceptedAnswerId="15210" CreationDate="2015-08-27T13:16:16.090" Score="4" ViewCount="632" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL &lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;compiled from EmacsW64.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows 7 x64 Dutch version.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;When I'm evaluating the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format-time-string &quot;%B&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It gives me &quot;August&quot; as result. In the Dutch language, we have &quot;augustus&quot; (spelled in another way, and without any case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And my operating system is also in Dutch language. When I tried &lt;code&gt;(setq system-time-locale &quot;nl_NL&quot;)&lt;/code&gt; to no avail.&#xA;When I check the value of &lt;code&gt;current-language-environment&lt;/code&gt;, it gives me &lt;code&gt;UTF-8&lt;/code&gt; as value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another suggestions to get the days/months displayed in Dutch?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Update:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;things are getting weird. On the Windows with the Dutch language (my work pc), I get &quot;August&quot;. &#xA;On my home pc with Windows with the English language, I get &quot;augustus&quot;. And it's with the same Emacs configuration. So I guess it's not related to the operating system.  &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-08-29T17:58:41.527" LastActivityDate="2015-08-31T14:48:39.190" Title="Display months/days or timestamps in another language than English" Tags="|time-date|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15093" PostTypeId="1" AcceptedAnswerId="15098" CreationDate="2015-08-27T13:26:05.130" Score="5" ViewCount="2414" Body="&lt;p&gt;I have a set of functions that I'd like to put to menu bar for ease of access. For this, I need to create new menu item on menu bar. How can I achieve that?&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="253" LastEditDate="2015-08-27T13:41:17.477" LastActivityDate="2018-07-05T20:37:32.997" Title="How to add an item to the menu bar?" Tags="|menu-bar|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15094" PostTypeId="2" ParentId="15093" CreationDate="2015-08-27T13:26:05.130" Score="3" Body="&lt;h2&gt;Use &lt;code&gt;easy-menu&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Quoting &lt;a href=&quot;http://emacswiki.org/emacs/EasyMenu&quot; rel=&quot;nofollow&quot;&gt;Emacswiki&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EasyMenu (lisp/emacs-lisp/easymenu.el) is a package which allows you to write menu definitions which work under both, Emacs and XEmacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h2&gt;Usage&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The code below can serve as an example to easymenu:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar menuitem1&#xA;  [&quot;Set mark!&quot; (set-mark-command nil)]) ; Boring alias for C-SPC&#xA;&#xA;(defvar menuitem2&#xA;  [&quot;Show fireworks!&quot; (lambda () (interactive) (message-box &quot;Fun!&quot;))]) ; Making function interactive&#xA;&#xA;;;Menu with submenus.&#xA;(defvar menuitem3&#xA;  '(&quot;Submenu&quot; ; Note that list must be quoted, otherwise it would be treated as function.&#xA;    (&quot;SubSubmenu&quot;&#xA;     [&quot;This will do wonders&quot; (lambda () (interactive) (beep)) [:help &quot;Welcome to the banana&quot;]]&#xA;     [&quot;And this will do nothing&quot; (lambda () (interactive))])&#xA;    (&quot;SubSubmenu2&quot;&#xA;     [&quot;Boring alias&quot; (replace-string &quot; &quot; &quot; banana &quot;)])))&#xA;&#xA;(easy-menu-define test-menu nil &quot;Menu used as an example.&quot;&#xA;  `(&quot;Test menu&quot;&#xA;    ,menuitem1&#xA;    ,menuitem2&#xA;    ,menuitem3&#xA;    [&quot;Items can also be defined here&quot; (lambda () (interactive) (message-box &quot;It's simple!&quot;))]))&#xA;&#xA;;;; Insert menu after options menu, in global menu bar.&#xA;(define-key-after (lookup-key global-map [menu-bar])&#xA;  [mymenu] ; shortcut for our menu&#xA;  (cons &quot;Test menu&quot; test-menu) 'options) ; Our menu's name in cons.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="405" LastActivityDate="2015-08-27T13:26:05.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15095" PostTypeId="1" AcceptedAnswerId="15100" CreationDate="2015-08-27T13:40:39.810" Score="4" ViewCount="421" Body="&lt;p&gt;Event durations are pretty straight forward to denote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2015-08-27 Thu 14:30-21:00&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what about an event that extends past midnight?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2015-08-27 Thu 22:30-01:30&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does not do what I think it does. Additionally, giving the date/time prompt something like &lt;code&gt;21:00+4&lt;/code&gt; will result in a timestamp such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2015-08-27 Thu 21:00-25:00&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the correct way to denote such an event?&lt;/p&gt;&#xA;" OwnerUserId="3945" LastEditorUserId="3945" LastEditDate="2015-08-27T13:47:36.700" LastActivityDate="2015-08-27T14:32:08.297" Title="Org timestamp ranges that cross midnight" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15096" PostTypeId="1" AcceptedAnswerId="15104" CreationDate="2015-08-27T14:07:54.463" Score="17" ViewCount="855" Body="&lt;p&gt;I started coding a minor mode to provide some keybindings. My initial attempt had a typo:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode borked-mode&#xA;  &quot;A mode defined with a broken key binding&quot;&#xA;  nil nil&#xA;  '(([b] . 'previous-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had intended to use the &lt;code&gt;b&lt;/code&gt; key, and immediately realized that I should have used &lt;code&gt;&quot;b&quot;&lt;/code&gt; instead of &lt;code&gt;[b]&lt;/code&gt;. So I redefined the minor mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode borked-mode&#xA;  &quot;A mode defined with a broken key binding&quot;&#xA;  nil nil&#xA;  '((&quot;b&quot; . 'previous-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this didn't work. This set me off on a wild goose chase through all the various ways of binding keys (i.e., (kbd ...), [ ... ], etc). Finally I realized that simply re-evaluating the &lt;code&gt;(define-minor-mode ...)&lt;/code&gt; form was not changing anything, I was stuck with the original, broken key map. I then tried changing the keymap directly via &lt;code&gt;(define-key borked-mode-map ...)&lt;/code&gt; and still couldn't get the corrected keymap loaded. Finally I restarted Emacs, and my minor mode was correctly loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is:&lt;/strong&gt; how do you update a minor mode definition as you develop it? Is there any way to flush a broken definition, or do you have to restart emacs to clear away broken bits?&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="105" LastEditDate="2016-09-22T15:50:29.793" LastActivityDate="2020-03-28T21:13:11.547" Title="How do you update a minor mode definition as you develop it?" Tags="|minor-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15097" PostTypeId="1" AcceptedAnswerId="15099" CreationDate="2015-08-27T14:13:26.780" Score="5" ViewCount="5366" Body="&lt;p&gt;How do I run an arbitrary function upon starting up Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My specific problem: in &lt;code&gt;spacemacs&lt;/code&gt;, I have added the following to the config section of my &lt;code&gt;.spacemacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'evil-insert-state-exit-hook 'linum-relative-on)&#xA;(add-hook 'evil-insert-state-entry-hook 'linum-relative-off)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works well, but I've noticed that this config produces weird behaviour if I don't first execute &lt;code&gt;linum-relative-toggle&lt;/code&gt; immediately after opening &lt;code&gt;spacemacs&lt;/code&gt; and before editing a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get Emacs to automatically execute &lt;code&gt;linum-relative-toggle&lt;/code&gt; on start up?&lt;/p&gt;&#xA;" OwnerUserId="9294" LastEditorUserId="253" LastEditDate="2015-08-27T14:37:09.380" LastActivityDate="2015-08-27T14:37:09.380" Title="How do I run a function on start-up?" Tags="|init-file|spacemacs|linum-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15098" PostTypeId="2" ParentId="15093" CreationDate="2015-08-27T14:16:11.173" Score="7" Body="&lt;p&gt;So-called easy-menu is one way.  But it is not always easier than the &quot;hard way&quot;, and the &quot;hard way&quot; is &lt;em&gt;not&lt;/em&gt; hard. This is all you need to do:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Define a variable to hold your &lt;em&gt;menu keymap&lt;/em&gt;, e.g., &lt;code&gt;my-menu-bar-menu&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bind a menu key in some keymap (e.g. &lt;code&gt;global-map&lt;/code&gt;), which puts &lt;em&gt;your menu on the menu-bar&lt;/em&gt;: &lt;code&gt;(define-key global-map [menu-bar my-menu] (cons &quot;Mine&quot; my-menu-bar-menu))&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bind &lt;em&gt;menu-item keys&lt;/em&gt; in your menu keymap. E.g., &lt;code&gt;(define-key my-menu-bar-menu [my-cmd1] ...)&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-menu-bar-menu (make-sparse-keymap &quot;Mine&quot;))&#xA;(define-key global-map [menu-bar my-menu] (cons &quot;Mine&quot; my-menu-bar-menu))&#xA;&#xA;(define-key my-menu-bar-menu [my-cmd1]&#xA;  '(menu-item &quot;My Command 1&quot; my-cmd1 :help &quot;Do what my-cmd1 does&quot;))&#xA;(define-key my-menu-bar-menu [my-cmd2]&#xA;  '(menu-item &quot;My Command 2&quot; my-cmd2 :help &quot;Do what my-cmd2 does&quot;))&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="9995" LastEditDate="2017-06-07T19:40:58.700" LastActivityDate="2017-06-07T19:40:58.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15099" PostTypeId="2" ParentId="15097" CreationDate="2015-08-27T14:25:57.867" Score="4" Body="&lt;p&gt;Here are two basic options to run a function (in this case, &lt;code&gt;linum-relative-toggle&lt;/code&gt;) at start-up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple option: add &lt;code&gt;(linum-relative-toggle)&lt;/code&gt; to your &lt;code&gt;init&lt;/code&gt; file (probably at the end).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhat more involved option (may be necessary if the simple option doesn't help for some reason): use &lt;code&gt;(add-hook 'after-init-hook #'linum-relative-toggle)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;after-init-hook&lt;/code&gt;'s docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Normal hook run after initializing the Emacs session.&lt;/strong&gt;&#xA;  It is run after Emacs loads the init file, &lt;code&gt;default&lt;/code&gt; library, the&#xA;  abbrevs file, and additional Lisp packages (if any), and setting&#xA;  the value of &lt;code&gt;after-init-time&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-27T14:25:57.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15100" PostTypeId="2" ParentId="15095" CreationDate="2015-08-27T14:32:08.297" Score="6" Body="&lt;p&gt;Org-mode uses two date/timestamps with a &lt;code&gt;--&lt;/code&gt; to indicate a range. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2015-08-27 Thu&amp;gt;--&amp;lt;2015-08-28 Fri&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you call &lt;code&gt;org-time-stamp&lt;/code&gt; (&lt;code&gt;C-c .&lt;/code&gt;, or &lt;code&gt;C-c !&lt;/code&gt; for inactive timestamps) twice in a row it will automatically insert the dashes to indicate a range. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-08-27T14:32:08.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15101" PostTypeId="2" ParentId="15081" CreationDate="2015-08-27T14:47:08.767" Score="6" Body="&lt;p&gt;The &lt;code&gt;initial-buffer-choice&lt;/code&gt; mechanism in &lt;code&gt;startup.el&lt;/code&gt; makes some assumptions that may not fit your use case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a quick overview of how Emacs decides what buffer(s) to display at startup:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Command-line arguments are processed so that any files specified are opened in new buffers. These buffers are added to a list of displayable buffers.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;initial-buffer-choice&lt;/code&gt; is evaluated and the resulting buffer is pushed on to the displayable buffer list. If &lt;code&gt;initial-buffer-choice&lt;/code&gt; results in something other than a valid buffer, an error is thrown. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Once all the potentially displayable buffers are identified, Emacs picks which ones to show. If there is one, that's easy. If there are two or more the frame is split so you get two windows. If there are exactly two displayable buffers they are both shown; otherwise, the first one is chosen and a &lt;code&gt;*Buffer List*&lt;/code&gt; is shown in the other window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you've found, &lt;code&gt;initial-buffer-choice&lt;/code&gt; can be &lt;code&gt;t&lt;/code&gt; (meaning &lt;code&gt;*scratch*&lt;/code&gt;), a file name, or a function. If you use a function it must return a valid buffer or you'll get an error. In your code above you're returning &lt;code&gt;nil&lt;/code&gt; when there are command-line arguments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that even if you improved your custom function to always return a valid live buffer (e.g. by examining &lt;code&gt;(buffer-list)&lt;/code&gt; and picking one), it may not always behave as you want because of how Emacs splits the frame and picks two buffers -- your function can only add to the list of displayable buffers, it cannot replace it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the behavior you want (which seems like a reasonable feature request to me) would be to allow &lt;code&gt;initial-buffer-choice&lt;/code&gt; to return &lt;code&gt;nil&lt;/code&gt; as a way of indicating that no additional buffers should be added to the displayable buffers list and Emacs should show whatever it would have shown if &lt;code&gt;initial-buffer-choice&lt;/code&gt; had not been set at all. An even better enhancement might be to allow &lt;code&gt;initial-buffer-choice&lt;/code&gt; functions to access the current list of displayable buffers so they can choose to create some other buffer without having to re-examine the command-line arguments directly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks like this behavior is changing. From the 25.1 NEWS (as of 2015-10-05):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When Emacs is given a file as a command line argument and &lt;code&gt;initial-buffer-choice&lt;/code&gt; is non-nil, display both the file and &lt;code&gt;initial-buffer-choice&lt;/code&gt;.  When Emacs is given more than one file and &lt;code&gt;initial-buffer-choice&lt;/code&gt; is non-nil, show &lt;code&gt;initial-buffer-choice&lt;/code&gt; and *Buffer List*.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-10-13T18:23:06.953" LastActivityDate="2015-10-13T18:23:06.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15102" PostTypeId="1" AcceptedAnswerId="15103" CreationDate="2015-08-27T14:54:46.337" Score="1" ViewCount="155" Body="&lt;p&gt;When entering text I sometimes want the indented. Is there a way to avoid having to type blank characters up to the point where the first word on the previous line starts?&lt;/p&gt;&#xA;" OwnerUserId="2725" LastActivityDate="2015-12-25T17:46:09.573" Title="indent text up to the start of the first word of the previous line" Tags="|indentation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15103" PostTypeId="2" ParentId="15102" CreationDate="2015-08-27T15:08:24.283" Score="0" Body="&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Indentation-Commands.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual entry on indentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x indent-relative&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inserts whitespace at point, until point is aligned with the first non-whitespace character on the previous line (actually, the last non-blank line). If point is already farther right than that, runs tab-to-tab-stop instead—unless called with a numeric argument, in which case does nothing.&lt;/p&gt;&#xA;" OwnerUserId="2725" LastEditorUserId="35" LastEditDate="2015-08-27T15:50:54.430" LastActivityDate="2015-08-27T15:50:54.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15104" PostTypeId="2" ParentId="15096" CreationDate="2015-08-27T15:25:11.263" Score="14" Body="&lt;p&gt;The first time you evaluate your &lt;code&gt;define-minor-mode&lt;/code&gt; it defines a variable &lt;code&gt;borked-mode-map&lt;/code&gt; with the key bindings you specified. Once that symbol has been defined, however, re-evaluating your &lt;code&gt;define-minor-mode&lt;/code&gt; won't change it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could delete the various &lt;code&gt;borked-mode-xxx&lt;/code&gt; symbols using &lt;code&gt;unintern&lt;/code&gt; and then re-evaluate your code. Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unintern 'borked-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might be interested in expanding the &lt;code&gt;define-minor-mode&lt;/code&gt; macro to see what it is actually doing. Put point at the end and call &lt;code&gt;M-x pp-macroexpand-last-sexp&lt;/code&gt;. This will open a new buffer showing the expanded macro. There you'll see the &lt;code&gt;defvar&lt;/code&gt; calls used to set up your mode variables. If you read the help for &lt;code&gt;defvar&lt;/code&gt; you'll see that the initial value is only used if the symbol being defined is void -- once it exists, subsequent &lt;code&gt;defvar&lt;/code&gt; calls won't change its value. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-08-27T15:25:11.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15105" PostTypeId="2" ParentId="14898" CreationDate="2015-08-27T15:29:05.577" Score="1" Body="&lt;p&gt;The problem was that I had set the value of flycheck-temp-prefix to &quot;.&quot; - this was specifically to hide flycheck files from mocha. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The irony is that mocha sees dot files, and flycheck doesn't...&lt;/p&gt;&#xA;" OwnerUserId="8990" LastActivityDate="2015-08-27T15:29:05.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15106" PostTypeId="2" ParentId="15078" CreationDate="2015-08-27T15:49:13.623" Score="2" Body="&lt;p&gt;The simplest way is probably to use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((overlay (make-overlay (point-max) (point-max) nil t t)))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The additional &lt;code&gt;t t&lt;/code&gt; arguments will mark the overlays's boundaries as being &quot;insert-before&quot; rather than &quot;insert-after&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-27T15:49:13.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15107" PostTypeId="2" ParentId="15086" CreationDate="2015-08-27T15:51:39.933" Score="1" Body="&lt;p&gt;You might like to set &lt;code&gt;backup-by-copying&lt;/code&gt; for that.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-08-27T15:51:39.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15108" PostTypeId="2" ParentId="15096" CreationDate="2015-08-27T15:55:56.220" Score="15" Body="&lt;p&gt;I think the best answer I can give you is to stay away from the &quot;inline keybindings feature&quot; of &lt;code&gt;define-minor-mode&lt;/code&gt;.  Use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar borked-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map [b] 'previous-line)&#xA;    ...&#xA;    map))&#xA;&#xA;(define-minor-mode borked-mode&#xA;  &quot;A mode defined with a broken key binding&quot;&#xA;  :global nil&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead.  Then you can use &lt;code&gt;C-M-x&lt;/code&gt; to re-evaluate those definitions.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2020-01-15T02:48:47.677" LastActivityDate="2020-01-15T02:48:47.677" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="15109" PostTypeId="1" AcceptedAnswerId="18477" CreationDate="2015-08-27T16:23:55.667" Score="0" ViewCount="866" Body="&lt;p&gt;I want to show all entries with status WAIT along with their parent entries and hide everything else.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SEQ_TODO: TODO(t) WAIT(w) | DONE(d) PASS(p)&#xA;* Item&#xA;  Description.&#xA;** TODO Task 1&#xA;   Description.&#xA;** WAIT Task 2&#xA;   Description.&#xA;* Item&#xA;** WAIT Task 3&#xA;   Description.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I do &lt;code&gt;C-c / m TODO=&quot;WAIT&quot;&lt;/code&gt; I get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SEQ_TODO: TODO(t) WAIT(w) | DONE(d) PASS(p)&#xA;* Item...&#xA;** WAIT Task 2...&#xA;* Item&#xA;** WAIT Task 3...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see the entries are collapsed. How do I get an expanded view of the selected entries?&lt;/p&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2015-11-29T04:24:28.077" Title="How do I get an expanded sparse tree?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15110" PostTypeId="1" AcceptedAnswerId="15114" CreationDate="2015-08-27T17:19:42.340" Score="6" ViewCount="727" Body="&lt;p&gt;When deciding on which key binding I want for a specific command, it would be very nice to know if &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt;&lt;/em&gt; of my installed mode maps (global, major and minor) have already used this key binding for some command, and if so, what command.&lt;/p&gt;&#xA;&lt;p&gt;I have looked at &lt;a href=&quot;https://github.com/emacs-helm/helm-descbinds&quot; rel=&quot;nofollow noreferrer&quot;&gt;helm-descbinds&lt;/a&gt;, but it only searches in the currently active modes rather than all of them.&lt;/p&gt;&#xA;&lt;p&gt;Is there a way to search all of the modes, regardless if they are active?&lt;/p&gt;&#xA;" OwnerUserId="9314" LastEditorUserId="105" LastEditDate="2021-12-20T00:21:33.850" LastActivityDate="2021-12-20T00:21:33.850" Title="Searching all installed mode maps for a specific key binding" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="15111" PostTypeId="1" AcceptedAnswerId="15113" CreationDate="2015-08-27T17:48:44.140" Score="3" ViewCount="73" Body="&lt;p&gt;I don't isearch backwards frequently enough to justify giving it such a valuable keybinding, so I rebound &lt;code&gt;isearch-backward-regexp&lt;/code&gt; to &lt;code&gt;C-c r&lt;/code&gt; and I noticed that something strange started happening. Normally &lt;code&gt;isearch-backward-regexp&lt;/code&gt; will use the previous search string and jump to the previous match if you hit &lt;code&gt;C-r&lt;/code&gt; twice, but the search string in the minibuffer always cleared when you rebind &lt;code&gt;isearch-backward-regexp&lt;/code&gt; to a compound keybinding.&lt;/p&gt;&#xA;" OwnerUserId="8921" LastActivityDate="2015-08-27T19:11:25.700" Title="Repeated isearch when rebound to compound key" Tags="|isearch|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15112" PostTypeId="2" ParentId="15110" CreationDate="2015-08-27T17:51:23.313" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to search all of the modes, regardless if they are active?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One brute force method is to load all the common modes you normally use and then test for the key bindings for each mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One command that can get you started is to get a list of available modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x apropos-command -mode$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-08-27T17:51:23.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15113" PostTypeId="2" ParentId="15111" CreationDate="2015-08-27T19:11:25.700" Score="4" Body="&lt;p&gt;This is because normally when you repeat an isearch command it executes the &lt;code&gt;isearch-repeat-forward&lt;/code&gt; or &lt;code&gt;isearch-repeat-backward&lt;/code&gt; command to save your search string (you can find this out by doing &lt;code&gt;C-h k&lt;/code&gt; in the minibuffer). The following should fix this for your keybind:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key isearch-mode-map (kbd &quot;C-c r&quot;) 'isearch-repeat-backward)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9314" LastActivityDate="2015-08-27T19:11:25.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15114" PostTypeId="2" ParentId="15110" CreationDate="2015-08-27T19:30:37.363" Score="5" Body="&lt;p&gt;As mentioned by others, you can of course not look for bindings in maps that haven't been loaded yet (due to autoloading for example). There are however a few heuristics which can help you find known keymaps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;all known minor mode maps are stored in &lt;code&gt;minor-mode-map-alist&lt;/code&gt;, regardless of whether the minor mode is active or not;&lt;/li&gt;&#xA;&lt;li&gt;by convention, the vast majority of mode maps have names ending in &quot;-mode-map&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Following this latter heuristic, one can devise the following command, which looks for a given key binding in all keymaps found in the obarray with names ending in &quot;-mode-map&quot;. The results are displayed in a buffer.&lt;br/&gt;&#xA;Try loading as many packages as you can before you use it, so that more keymaps can be examined.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 's)&#xA;&#xA;(defun list-known-bindings (key)&#xA;  (interactive &quot;kList known bindings for key: &quot;)&#xA;  (with-current-buffer (get-buffer-create &quot;*known bindings*&quot;)&#xA;    (erase-buffer)&#xA;    (mapatoms (lambda (sym)&#xA;                (when (or (eq sym 'global-map)&#xA;                          (and (boundp sym)&#xA;                               (symbol-value sym)&#xA;                               (s-ends-with-p &quot;-mode-map&quot; (symbol-name sym))&#xA;                               (keymapp (symbol-value sym))))&#xA;                  (let ((binding (lookup-key (symbol-value sym) key t)))&#xA;                    (when (and binding&#xA;                               (not (numberp binding)))&#xA;                      (insert (format &quot;%-40s `%s'\n&quot;&#xA;                                      (format &quot;`%s'&quot; sym)&#xA;                                      (if (keymapp binding)&#xA;                                          &quot;KEYMAP&quot;&#xA;                                        binding))))))))&#xA;    (sort-lines nil (point-min) (point-max))&#xA;    (goto-char (point-min))&#xA;    (insert&#xA;     (format &quot;Known bindings for key: %s\n\n&quot; (key-description key))&#xA;     (format &quot;%-40s %s&quot; &quot;Map&quot; &quot;Binding\n&quot;)&#xA;     (s-repeat 40 &quot;-&quot;) &quot; &quot; (s-repeat 30 &quot;-&quot;) &quot;\n&quot;) &#xA;    (display-buffer (current-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-08-29T14:17:05.790" LastActivityDate="2015-08-29T14:17:05.790" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="15115" PostTypeId="2" ParentId="15090" CreationDate="2015-08-27T19:46:18.980" Score="15" Body="&lt;p&gt;When you open emacs, open several files and exit emacs using &lt;code&gt;C-x C-c&lt;/code&gt; (graceful exit), it will call the &lt;code&gt;recentf-save-list&lt;/code&gt; function which saves recently opened files to a file specified by &lt;code&gt;recentf-save-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand if you kill emacs using &lt;code&gt;kill&lt;/code&gt;, it is &lt;strong&gt;NOT&lt;/strong&gt; a graceful exit and there is no chance for emacs to save the files.  So they will not be there in recentf list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to save files at any point, you can call &lt;code&gt;recentf-save-list&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x recentf-save-list RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which saves recent files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to do this manually, you can add a timer which will do that for you every 5 minutes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-at-time (current-time) 300 'recentf-save-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add this to your config. So whenever you open emacs, it will call the function and every 5 minutes (or 300 seconds) it will go on calling that function.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="14920" LastEditDate="2019-05-03T19:42:53.040" LastActivityDate="2019-05-03T19:42:53.040" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="15116" PostTypeId="1" CreationDate="2015-08-27T20:57:17.603" Score="2" ViewCount="220" Body="&lt;p&gt;I wrote a little search function a long time ago, binded to ctrl-f.  It has been working perfectly until I tried Emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose of the function is to highlight (region) the found word.  Furthermore I have other functions that can select/look backward/forward for the same text.  This set of dunctions are pretty useful and I am use to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;: Any key I hit (right arrow for example) after searching with this function with v24.3.1 will automatically disable the region highlighting.  With v24.4 and above the region is still active and I need to disable it manually with ctrl-space before doing anything which is annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;: Any idea on what change concerning this behavior between those versions?  Is there a work around to have the old behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Function&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mp-search (string)&#xA;&quot;Search using search-forward instead of i-search, this search&#xA;cannot search whole word only&quot;&#xA;(interactive &quot;sSearch for : &quot;)&#xA;&#xA;; backup point&#xA;(setq mp_backup_point (point))&#xA;(set-mark nil)&#xA;&#xA;; search forward the selection if there is a selection&#xA;(if (search-forward string nil t)&#xA;&#xA;    (progn (set-mark (point))&#xA;           (backward-char (length string))&#xA;           (exchange-point-and-mark))&#xA;&#xA;    (progn (message &quot;Return at the file's beginning...&quot;)&#xA;           (goto-char 0)&#xA;           (if (search-forward string nil t)&#xA;           (progn (set-mark (point))&#xA;                  (backward-char (length string))&#xA;                  (exchange-point-and-mark))&#xA;           (progn (goto-char mp_backup_point)&#xA;                  (message &quot;Nothing was found...&quot;)))))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Binding&lt;/strong&gt;:&#xA;(global-set-key [(ctrl f)]              'mp-search)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Picture&lt;/strong&gt;:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/zstZW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zstZW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9328" LastEditorUserId="9328" LastEditDate="2016-10-22T21:24:08.387" LastActivityDate="2016-10-24T13:27:29.020" Title="What changed with Mark/Region behavior between GNU Emacs 24.3.1 and 24.5.1?" Tags="|search|region|mark|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15117" PostTypeId="1" CreationDate="2015-08-27T21:13:27.853" Score="9" ViewCount="3495" Body="&lt;p&gt;I have two windows open and split vertically (single frame):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) contains my work&lt;br&gt;&#xA;B) contains either dired or ibuffer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to navigate to a file/buffer in pane B and hit &quot;o&quot; have it open in pane A.  Is this possible?  Right now emacs is creating a new pane in the lower portion of pane A to open the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: according to user lawlist the above described behavior will happen when the frame is large.  This appears to be the case for me because now that I am at home (not on an external monitor, smaller frame) emacs is behaving as I desire.  The question now becomes: &lt;em&gt;can I prevent emacs from opening a new window when the current frame is large?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="9332" LastEditorUserId="9332" LastEditDate="2015-08-27T22:57:49.740" LastActivityDate="2018-05-21T17:35:40.517" Title="How to use &quot;o&quot; to open from dired/ibuffer into another frame" Tags="|frames|dired|ibuffer|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15118" PostTypeId="2" ParentId="15117" CreationDate="2015-08-27T21:54:55.530" Score="8" Body="&lt;p&gt;Here are four (4) sample custom &lt;code&gt;display-buffer&lt;/code&gt; family of functions that can be custom tailored to suit a user's particular needs -- &lt;strong&gt;above&lt;/strong&gt;; &lt;strong&gt;below&lt;/strong&gt;; &lt;strong&gt;left&lt;/strong&gt;; &lt;strong&gt;right&lt;/strong&gt; -- and here are four (4) &lt;code&gt;interactive&lt;/code&gt; functions to display the file or directory of the current line of a &lt;code&gt;dired-mode&lt;/code&gt; buffer.  There are only three conditions:  &lt;strong&gt;(a)&lt;/strong&gt; if there is already a window displaying the target buffer, then choose it; &lt;strong&gt;(b)&lt;/strong&gt; if there is a window in the direction desired that is available, then use it; &lt;strong&gt;(c)&lt;/strong&gt; the catch-all is to create a new window in the desired direction if the other conditions are not met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usage:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x dired-display-above&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x dired-display-below&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x dired-display-left&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x dired-display-right&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There so many key-bindings already built-in to &lt;code&gt;dired-mode&lt;/code&gt; and &lt;code&gt;dired+&lt;/code&gt;, that I dare not attempt to make up my own.  The user is free choose his/her own keyboard shortcuts, which is beyond the scope of this limited example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The user is free to add additional conditions to the sample &lt;code&gt;display-buffer&lt;/code&gt; family of functions to handle more situations -- e.g., more windows than just a couple.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-display-buffer-below (buffer alist)&#xA;&quot;Doc-string.&quot;&#xA;  (let (&#xA;      (window&#xA;        (cond&#xA;          ((get-buffer-window buffer (selected-frame)))&#xA;          ((window-in-direction 'below))&#xA;          (t&#xA;            (split-window (selected-window) nil 'below)))))&#xA;    (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)&#xA;    window))&#xA;&#xA;(defun my-display-buffer-above (buffer alist)&#xA;&quot;Doc-string.&quot;&#xA;  (let (&#xA;      (window&#xA;        (cond&#xA;          ((get-buffer-window buffer (selected-frame)))&#xA;          ((window-in-direction 'above))&#xA;          (t&#xA;            (split-window (selected-window) nil 'above)))))&#xA;    (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)&#xA;    window))&#xA;&#xA;(defun my-display-buffer-left (buffer alist)&#xA;&quot;Doc-string.&quot;&#xA;  (let (&#xA;      (window&#xA;        (cond&#xA;          ((get-buffer-window buffer (selected-frame)))&#xA;          ((window-in-direction 'left))&#xA;          (t&#xA;            (split-window (selected-window) nil 'left)))))&#xA;    (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)&#xA;    window))&#xA;&#xA;(defun my-display-buffer-right (buffer alist)&#xA;&quot;Doc-string.&quot;&#xA;  (let (&#xA;      (window&#xA;        (cond&#xA;          ((get-buffer-window buffer (selected-frame)))&#xA;          ((window-in-direction 'right))&#xA;          (t&#xA;            (split-window (selected-window) nil 'right)))))&#xA;    (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)&#xA;    window))&#xA;&#xA;(defun dired-display-above ()&#xA;&quot;Doc-string.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (file-or-dir (dired-get-file-for-visit))&#xA;      (buffer (find-file-noselect file-or-dir)))&#xA;    (my-display-buffer-above buffer nil)))&#xA;&#xA;(defun dired-display-below ()&#xA;&quot;Doc-string.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (file-or-dir (dired-get-file-for-visit))&#xA;      (buffer (find-file-noselect file-or-dir)))&#xA;    (my-display-buffer-below buffer nil)))&#xA;&#xA;(defun dired-display-left ()&#xA;&quot;Doc-string.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (file-or-dir (dired-get-file-for-visit))&#xA;      (buffer (find-file-noselect file-or-dir)))&#xA;    (my-display-buffer-left buffer nil)))&#xA;&#xA;(defun dired-display-right ()&#xA;&quot;Doc-string.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (file-or-dir (dired-get-file-for-visit))&#xA;      (buffer (find-file-noselect file-or-dir)))&#xA;    (my-display-buffer-right buffer nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT:  Here is a slightly more sophisticated / fun implementation of the above-concept, which gives the user the ability to use this &lt;em&gt;non-interactively&lt;/em&gt; or &lt;em&gt;interactively&lt;/em&gt;; e.g., &lt;code&gt;M-x dired-display-buffer&lt;/code&gt; -- where the user will be prompted to choose a directory if not hovering over a file in &lt;code&gt;dired-mode&lt;/code&gt;, and to choose a display direction (left, right, above, below).&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-display-buffer (buffer-or-name alist direction &amp;amp;optional size pixelwise)&#xA;&quot;BUFFER:  The buffer that will be displayed.&#xA;ALIST:  See the doc-string of `display-buffer' for more information.&#xA;DIRECTION:  Must use one of these symbols:  'left 'right 'below 'above&#xA;SIZE:  See the doc-string for `split-window'.&#xA;PIXELWISE:  See the doc-string for `split-window'.&#xA;There are three possibilities:&#xA;-  (1) If a window on the frame already displays the target buffer,&#xA;then just reuse the same window.&#xA;-  (2) If there is already a window in the specified direction in relation&#xA;to the selected window, then display the target buffer in said window.&#xA;-  (3) If there is no window in the specified direction, then create one&#xA;in that direction and display the target buffer in said window.&quot;&#xA;  (let* ((buffer&#xA;           (if (bufferp buffer-or-name)&#xA;             buffer-or-name&#xA;             (get-buffer buffer-or-name)))&#xA;         (window&#xA;           (cond&#xA;             ((get-buffer-window buffer (selected-frame)))&#xA;             ((window-in-direction direction))&#xA;             (t&#xA;               (split-window (selected-window) size direction pixelwise)))))&#xA;    (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)&#xA;    window))&#xA;&#xA;(defun dired-display-buffer (&amp;amp;optional direction alist)&#xA;&quot;Display a dired-mode buffer or a file underneath point in a dired-mode buffer.&quot;&#xA;(interactive)&#xA;  (let* ((file-or-dir (or (and (eq major-mode 'dired-mode) (dired-get-file-for-visit))&#xA;                               (read-directory-name &quot;Directory:  &quot;)))&#xA;         (buffer (find-file-noselect file-or-dir))&#xA;         (direction&#xA;           (if direction&#xA;             direction&#xA;             (let ((char (read-char-exclusive (concat&#xA;                      &quot;[&quot;&#xA;                      (propertize &quot;l&quot; 'face '(:foreground &quot;red&quot;))&#xA;                      &quot;]&quot;&#xA;                      (propertize &quot;eft&quot; 'face '(:foreground &quot;blue&quot;))&#xA;                      &quot; | [&quot;&#xA;                      (propertize &quot;r&quot; 'face '(:foreground &quot;red&quot;))&#xA;                      &quot;]&quot;&#xA;                      (propertize &quot;ight&quot; 'face '(:foreground &quot;blue&quot;))&#xA;                      &quot; | [&quot;&#xA;                      (propertize &quot;a&quot; 'face '(:foreground &quot;red&quot;))&#xA;                      &quot;]&quot;&#xA;                      (propertize &quot;bove&quot; 'face '(:foreground &quot;blue&quot;))&#xA;                      &quot; | [&quot;&#xA;                      (propertize &quot;b&quot; 'face '(:foreground &quot;red&quot;))&#xA;                      &quot;]&quot;&#xA;                      (propertize &quot;elow&quot; 'face '(:foreground &quot;blue&quot;))))))&#xA;                (cond&#xA;                  ((eq char ?l)&#xA;                    'left)&#xA;                  ((eq char ?r)&#xA;                    'right)&#xA;                  ((eq char ?a)&#xA;                    'above)&#xA;                  ((eq char ?b)&#xA;                    'below)&#xA;                  ;;; FIXME:  @lawlist may add a loop similar to `org-capture'&#xA;                  ;;; whereby a new `read-char-exclusive' will be initiated if&#xA;                  ;;; a user did not initially choose a valid option (l/r/a/b).&#xA;                  (t&#xA;                    (let ((debug-on-quit nil)&#xA;                          (msg (concat &quot;dired-display-buffer:  &quot;&#xA;                                       &quot;You did not select l/r/a/b &quot;&#xA;                                       &quot;-- exiting.&quot;)))&#xA;                      (signal 'quit `(,msg)))))))))&#xA;    (my-display-buffer buffer alist direction)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2018-05-21T17:35:40.517" LastActivityDate="2018-05-21T17:35:40.517" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="15119" PostTypeId="2" ParentId="15117" CreationDate="2015-08-27T22:33:28.843" Score="3" Body="&lt;p&gt;Your question is unclear, and so risks being closed. Do you have two frames or a single frame with two Emacs windows? Whatever they are, if there are two, is &lt;em&gt;each&lt;/em&gt; of them split vertically? And just what do you mean by &quot;split vertically&quot;? What do you mean by a &quot;pane&quot;? What do you mean by &quot;it&quot;, in &quot;have it open in pane A&quot;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A wild guess is that you have a single Emacs frame that is split into two Emacs windows, A and B, with window A above window B, window B is selected, and window B is showing a Dired buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;o&lt;/code&gt; is bound by default to &lt;code&gt;dired-find-file-other-window&lt;/code&gt;. If the above wild guess is correct then &lt;code&gt;o&lt;/code&gt; on a file name in B should open in A. This is what I see when starting Emacs without an init file: &lt;code&gt;emacs -Q&lt;/code&gt;. Do you not see that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is not the scenario, please describe clearly what you are doing, step by step, starting with &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-27T22:33:28.843" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15120" PostTypeId="1" CreationDate="2015-08-27T22:39:05.080" Score="5" ViewCount="17003" Body="&lt;p&gt;first i do this in a terminal: &lt;code&gt;$ git clone git://github.com/altercation/solarized.git&lt;/code&gt;, that creates a directory in my home called &quot;solarized&quot;, after that i add this 2 lines to my init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/emacs-color-theme-solarized&quot;)&lt;/code&gt;&#xA;&lt;code&gt;(load-theme 'color-theme-solarized.el t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so i created a directory emacs-color-theme-solarized in &quot;.emacs.d&quot; and i put there the code of the color-theme.., but when i &quot;byte-compile and load&quot;my init.el this message came in the mini-buffer: load-theme: Unable to find theme file for `color-theme-solarized.el'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what i did wrong?&lt;/p&gt;&#xA;" OwnerUserId="9195" LastEditorUserId="115" LastEditDate="2015-08-27T22:50:16.227" LastActivityDate="2019-05-24T10:57:47.367" Title="how do i install &quot;solarized-theme&quot;?" Tags="|init-file|themes|load-path|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15121" PostTypeId="2" ParentId="15120" CreationDate="2015-08-27T22:50:00.467" Score="9" Body="&lt;p&gt;&lt;code&gt;github.com/altercation/solarized.git&lt;/code&gt; is the repository for the Solarized theme for vim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For emacs, the repo is &lt;a href=&quot;https://github.com/bbatsov/solarized-emacs&quot;&gt;&lt;code&gt;https://github.com/bbatsov/solarized-emacs&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The recommended approach to install the theme is via the emacs-inbuilt package manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ensure that you have the below in your emacs setup (&lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; by default):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;&#xA;;; Add melpa package source when using package list&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;&#xA;;; Load emacs packages and activate them&#xA;;; This must come before configurations of installed packages.&#xA;;; Don't delete this line.&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Add above to your &lt;code&gt;init.el&lt;/code&gt; and restart emacs.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x package-install solarized-theme&lt;/code&gt; (from the &lt;a href=&quot;https://github.com/bbatsov/solarized-emacs#installation&quot;&gt;Installation instructions&lt;/a&gt; on the theme github page).&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x load-theme&lt;/code&gt; and pick one of the Solarized theme variants.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-08-27T22:50:00.467" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="15122" PostTypeId="2" ParentId="15120" CreationDate="2015-08-28T01:06:23.827" Score="2" Body="&lt;p&gt;The version that works best for me is on MELPA at &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://github.com/bbatsov/solarized-emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your packages install, you can install it through MELPA using this command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install solarized-theme&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you can't find solarized-theme, then make sure &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;nofollow&quot;&gt;MELPA is installed properly&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-08-28T01:06:23.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15123" PostTypeId="2" ParentId="15117" CreationDate="2015-08-28T01:16:13.143" Score="2" Body="&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;:  The following variables are &lt;strong&gt;global&lt;/strong&gt;, which means that they will affect other functions besides &lt;code&gt;dired-find-file-other-window&lt;/code&gt;.  The user may wish to &lt;em&gt;advice&lt;/em&gt; the function at issue so as not to &lt;em&gt;globally&lt;/em&gt; affect other functions.  [However, this author will leave that option to another forum participant.]  Alternatively, there is another answer that this author posted containing custom functions that can be used so as not to affect anything else.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;split-width-threshold&lt;/code&gt; has a doc-string which states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Minimum width for splitting windows sensibly.&#xA;If this is an integer, ‘split-window-sensibly’ may split a window&#xA;horizontally only if it has at least this many columns.  If this&#xA;is nil, ‘split-window-sensibly’ is not allowed to split a window&#xA;horizontally.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting the following in the &lt;code&gt;.emacs&lt;/code&gt; file will achieve the desired effect.  The user can also set the value to a higher number.  The default value is &lt;strong&gt;160&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq split-width-threshold nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a link to the relevant section in the manual:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Choice.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Choice.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also the related variable &lt;code&gt;split-height-threshold&lt;/code&gt;, which has a default value of &lt;strong&gt;80&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc-string states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Minimum height for splitting windows sensibly.&#xA;If this is an integer, `split-window-sensibly' may split a window&#xA;vertically only if it has at least this many lines.  If this is&#xA;nil, `split-window-sensibly' is not allowed to split a window&#xA;vertically.  If, however, a window is the only window on its&#xA;frame, `split-window-sensibly' may split it vertically&#xA;disregarding the value of this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-08-28T01:33:39.557" LastActivityDate="2015-08-28T01:33:39.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15124" PostTypeId="1" AcceptedAnswerId="15128" CreationDate="2015-08-28T01:53:28.113" Score="7" ViewCount="2858" Body="&lt;p&gt;As a beginner I understand that including cl-lib will allow me to use some code from Common Lisp. However, whenever I see this included in elisp code I wonder again, Should I really start with Common Lisp, then learn elisp? Is cl-lib giving elisp Common Lisp a common (or desirable) occurrence in best-practice elisp coding? I guess I'm looking also for &quot;best practice&quot; guidance here. But then &quot;best practice&quot; questions can be interpreted either way: as legitimate stackexchange-compliant question, or as a matter of opinion.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="405" LastEditDate="2015-08-30T22:43:14.037" LastActivityDate="2019-03-20T04:14:33.747" Title="Is using cl-lib crucial for writing good Emacs Lisp code?" Tags="|elisp|common-lisp|cl-lib|" AnswerCount="3" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="15125" PostTypeId="1" CreationDate="2015-08-28T06:15:50.560" Score="0" ViewCount="151" Body="&lt;p&gt;I found ESC-prefix and Control-X-prefix defined in keymap.c:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;initial_define_key (global_map, 033, &quot;ESC-prefix&quot;);&#xA;initial_define_key (global_map, Ctl ('X'), &quot;Control-X-prefix&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But no matter what I try I can't add a map for Super (Hyper) key.&lt;br&gt;&#xA;And this isn't working&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lisp_Object s_map;&#xA;...&#xA;s_map = Fmake_keymap (Qnil);&#xA;Fset (intern_c_string (&quot;s-map&quot;), s_map);&#xA;Ffset (intern_c_string (&quot;S-prefix&quot;), s_map);&#xA;...&#xA;initial_define_key (global_map, 0xffeb, &quot;S-prefix&quot;);  // tried many codes&#xA;...&#xA;initial_define_key (s_map, 'z', &quot;my-function&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nothing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s-z is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have a question what &lt;code&gt;#define Ctl(c) ((c)&amp;amp;037)&lt;/code&gt; does? Because 037 is no a key code of any Control (left or right).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you provide a working example of adding a key map to the source code?  &lt;/p&gt;&#xA;" OwnerUserId="2133" LastEditorUserId="105" LastEditDate="2015-08-31T15:00:40.657" LastActivityDate="2015-08-31T15:00:40.657" Title="How to add a key map in Emacs source code?" Tags="|keymap|c|source|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15126" PostTypeId="2" ParentId="14985" CreationDate="2015-08-28T06:27:00.483" Score="2" Body="&lt;p&gt;The problem was not in a build system but in Emacs itself.&lt;br&gt;&#xA;In order to have a function defined with &lt;code&gt;DEFUN&lt;/code&gt; available for a user you must not only define it but also write in your file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void&#xA;syms_of_filename (void)&#xA;{&#xA;  defsubr (&amp;amp;Sfunction_name);&#xA;  ...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and call this function from &lt;code&gt;emacs.c&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2133" LastActivityDate="2015-08-28T06:27:00.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15127" PostTypeId="1" CreationDate="2015-08-28T08:05:29.807" Score="2" ViewCount="109" Body="&lt;p&gt;When a portion of code is folded, error and warning indicators from Flycheck relative to this portion are not shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get Flycheck or HideShow to indicate that a folded portion of code contains errors/warnings ?&lt;/p&gt;&#xA;" OwnerUserId="9294" LastEditorUserId="105" LastEditDate="2015-08-31T15:00:16.117" LastActivityDate="2015-08-31T15:00:16.117" Title="How to get HideShow to indicate Flycheck Errors/Warnings inside a folded region?" Tags="|flycheck|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15128" PostTypeId="2" ParentId="15124" CreationDate="2015-08-28T08:23:14.520" Score="9" Body="&lt;p&gt;&lt;code&gt;Emacs lisp&lt;/code&gt; is a programming language designed to be used to provide Emacs extensions and to program Emacs. &lt;code&gt;Common Lisp&lt;/code&gt; is a programming language that was designed to be practical Lisp useful as production language. Therefore, Emacs Lisp is sometimes &quot;a bit strange&quot;(this may be an opinion), since you have to care about environment - Emacs - while Common Lisp is designed to  be useful and powerful. This makes it have some useful features that Emacs Lisp does not have. However, since they are based on the same Lisp ancestor, they both have similar syntax, and can be tied together, as shown in &lt;code&gt;cl&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't know Common Lisp, don't learn it now(unless you want to, then go on). Learn Emacs Lisp first, as it's perfectly capable of doing everything you want(it just may be a little harder without cl in some cases). When you need more power, or learn Common Lisp, you can start incorporating it in your code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note, that &lt;code&gt;Common Lisp&lt;/code&gt; is just an another language, a tool. There is no &quot;best practice&quot;, as nearly every programmer has his own definition of what &quot;best practice&quot; is. If you want to write good Emacs Lisp code, start reading some sources(e.g. Emacs source code files like &lt;code&gt;simple.el&lt;/code&gt; or some packages, like smartparens), and try to follow some of these guidelines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also read &lt;a href=&quot;http://people.ace.ed.ac.uk/staff/medward2/class/moz/cm/doc/contrib/lispstyle.html&quot; rel=&quot;noreferrer&quot;&gt;some style guides&lt;/a&gt;, although keep in mind that these aren't holy laws of coding style.&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2015-08-28T08:23:14.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15129" PostTypeId="1" AcceptedAnswerId="15131" CreationDate="2015-08-28T09:01:03.320" Score="7" ViewCount="720" Body="&lt;p&gt;I use MELPA already, this question is about the actual mechanics of installing a package.  My current process is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x&lt;/code&gt; package-list-packages&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s name-of-package&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s&lt;/code&gt; enough times to be on the actual name of the package, not just another instance of that word.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RET&lt;/code&gt; (this opens the package details in another buffer, so...)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x o&lt;/code&gt; Switch to the other buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;down down C-e left&lt;/code&gt; to place the cursor on the word &quot;Install&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;y RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'd like to think there's a less awkward way to do steps 4-8 (especially #5 and #6).  I know about &lt;code&gt;M-x package-install&lt;/code&gt; but I like to read the descriptions in the &lt;code&gt;*Packages*&lt;/code&gt; buffer.  Any tips?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="105" LastEditDate="2015-08-31T14:59:21.207" LastActivityDate="2015-08-31T14:59:21.207" Title="What's an easy way to install packages?" Tags="|init-file|package|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15130" PostTypeId="2" ParentId="14306" CreationDate="2015-08-28T09:04:23.310" Score="6" Body="&lt;p&gt;You can instruct &lt;code&gt;json-read-from-string&lt;/code&gt; to parse JSON arrays as elisp lists by let binding &lt;code&gt;json-array-type&lt;/code&gt; to list like so&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((json-object-type 'plist)&#xA;      (json-array-type 'list))&#xA;  (setq mylist (json-read-from-string &quot;[{\&quot;name\&quot;: \&quot;Adam\&quot;, \&quot;id\&quot;: \&quot;1\&quot;},&#xA;                                        {\&quot;name\&quot;: \&quot;Eve\&quot;, \&quot;id\&quot;: \&quot;2\&quot;}]&quot;)))                                 {\&quot;name\&quot;: \&quot;Eve\&quot;, \&quot;id\&quot;: \&quot;2\&quot;}]&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mylist&lt;/code&gt; now would be an elisp list which you manipulate/traverse using existing list functions.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="1985" LastEditDate="2016-01-24T22:42:25.600" LastActivityDate="2016-01-24T22:42:25.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15131" PostTypeId="2" ParentId="15129" CreationDate="2015-08-28T09:14:44.027" Score="12" Body="&lt;ol&gt;&#xA;&lt;li&gt;There's &lt;code&gt;package-install&lt;/code&gt; interactive command, which, as the name suggests, will install the package it will prompt you for.&lt;/li&gt;&#xA;&lt;li&gt;In case you don't know the name of the package exactly, you can still install one in less steps. In the buffer with available packages press &lt;kbd&gt;i&lt;/kbd&gt; on the package you want to install, and then &lt;kbd&gt;x&lt;/kbd&gt; to process all packages marked for install.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In general, you can discover what functions are available in any Emacs mode by pressing &lt;kbd&gt;C-h m&lt;/kbd&gt; (which will give you the description of the mode, typically with the most often used commands and keybindings), or &lt;kbd&gt;C-h b&lt;/kbd&gt; listing all available keybindings.  In the later case, searching the keybindings using the mode name may reveal more functionality.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-08-28T12:20:47.970" LastActivityDate="2015-08-28T12:20:47.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15132" PostTypeId="2" ParentId="15071" CreationDate="2015-08-28T09:57:35.860" Score="2" Body="&lt;p&gt;The interesting function here is &lt;code&gt;imenu--generic-function&lt;/code&gt; which by skips comments and string by &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/imenu.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n816&quot; rel=&quot;nofollow&quot;&gt;inspecting&lt;/a&gt; the value of &lt;code&gt;syntax-ppss&lt;/code&gt;. So it should have worked out of the box for you. Looking at the code it seems to &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/imenu.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n795&quot; rel=&quot;nofollow&quot;&gt;jumps&lt;/a&gt; to the start of the before checking for output of &lt;code&gt;syntax-ppss&lt;/code&gt;, I guess that is screwing up things for you (since it might move out the comment/string by moving to start of line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot suggest any workarounds since I am not aware of the major-mode you are taking about. &lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-08-28T10:36:19.477" LastActivityDate="2015-08-28T10:36:19.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15133" PostTypeId="1" CreationDate="2015-08-28T10:24:20.430" Score="2" ViewCount="253" Body="&lt;p&gt;When I do s-left-mouse-click, and select &quot;Change Buffer font...&quot;, I get a pretty display of sample text showing me what the various fonts look like.  I'd like to reproduce similar behavior in a buffer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to iterate over the values given by (font-family-list), print the name of the font-family, and a sample text with that family applied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got this far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (curfam (font-family-list))&#xA;  (print curfam (current-buffer))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which gives me the desired list of family names.  Now I'm looking into customizing faces, and I'm starting to think what I want to do is really kinda tricky.  Maybe that's why I only find what I'm looking for in a gtk box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I have some thoughts how to accomplish this, they seem pretty complicated -- creating a custom face for each family, setting those face properties, and setting the face for the current line somehow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my plan:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For each family, create a face, with correct font-family.&lt;/li&gt;&#xA;&lt;li&gt;Insert the desired text.&lt;/li&gt;&#xA;&lt;li&gt;Apply the face to the desired text.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here are my questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is this the right approach?  Is there a simpler way?&lt;/li&gt;&#xA;&lt;li&gt;How do I apply the face to the desired text.  Can I apply a face line by line, or do I have to make some kind of font lock mode?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="105" LastEditDate="2015-08-31T14:58:46.270" LastActivityDate="2015-08-31T14:58:46.270" Title="insert text with a particular font" Tags="|faces|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15134" PostTypeId="1" AcceptedAnswerId="15135" CreationDate="2015-08-28T10:33:46.177" Score="8" ViewCount="2307" Body="&lt;p&gt;I want to get contents of the current line(the line with cursor) for my function. What command allows me to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="105" LastEditDate="2015-08-31T14:57:51.520" LastActivityDate="2015-08-31T14:57:51.520" Title="How to get contents of current line?" Tags="|copy-paste|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15135" PostTypeId="2" ParentId="15134" CreationDate="2015-08-28T10:33:46.177" Score="17" Body="&lt;p&gt;Use &lt;code&gt;buffer-substring&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(buffer-substring (line-beginning-position) (line-end-position))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As &lt;a href=&quot;https://emacs.stackexchange.com/questions/15134/how-to-get-contents-of-current-line/15135#comment23450_15135&quot;&gt;Tobias&lt;/a&gt; noted, this also copies properties of text. If you want to avoid that, you might want to go with &lt;code&gt;buffer-substring-no-properties&lt;/code&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(buffer-substring-no-properties (line-beginning-position) (line-end-position))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="405" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-08-28T14:31:44.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15136" PostTypeId="2" ParentId="15134" CreationDate="2015-08-28T10:42:07.077" Score="14" Body="&lt;p&gt;Alternative to &lt;code&gt;buffer-substring&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(thing-at-point 'line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-08-28T10:42:07.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15137" PostTypeId="2" ParentId="15133" CreationDate="2015-08-28T10:45:27.440" Score="5" Body="&lt;p&gt;There is a simpler way (unless you're using XEmacs for whatever reason), propertizing the text you're going to insert with an anonymous face having the respective font-family, then inserting it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-font-preview ()&#xA;  (interactive)&#xA;  (let ((buffer-name &quot;*font families*&quot;))&#xA;    (with-current-buffer (get-buffer-create buffer-name)&#xA;      (erase-buffer)&#xA;      (dolist (font-family (font-family-list))&#xA;        (insert (propertize font-family 'face `(:family ,font-family))&#xA;                &quot;\n&quot;))&#xA;      (goto-char (point-min)))&#xA;    (pop-to-buffer-same-window buffer-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-08-28T17:08:46.337" LastActivityDate="2015-08-28T17:08:46.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15138" PostTypeId="1" AcceptedAnswerId="15141" CreationDate="2015-08-28T11:56:33.600" Score="12" ViewCount="1865" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: is there a way to have &lt;code&gt;hl-line-mode&lt;/code&gt; highlight the current line&#xA;  only in the selected window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have multiple windows showing buffers with &lt;code&gt;hl-line-mode&lt;/code&gt;&#xA;on, it is difficult to tell, at a glance, which window is&#xA;current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the variable &lt;code&gt;cursor-in-non-selected-windows&lt;/code&gt; set&#xA;to &lt;code&gt;nil&lt;/code&gt; to show the cursor only in the current window, but that&#xA;visual cue is swamped by the highlighted lines in the windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar setting to allow me to have &lt;code&gt;hl-line-mode&lt;/code&gt; show&#xA;the highlighted line only in the current window?  Even better, is&#xA;there a way to give the highlighted lines a different face when&#xA;they're in inactive windows (analogous to &lt;code&gt;mode-line-inactive&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: yes, I can look at the mode line to tell which window is&#xA;active, but doing so takes my eyes away from what I'm doing and&#xA;breaks my concentration.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="105" LastEditDate="2016-12-22T17:29:10.207" LastActivityDate="2016-12-22T17:29:10.207" Title="How to highlight current line only in selected window?" Tags="|highlighting|hl-line-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15139" PostTypeId="5" CreationDate="2015-08-28T12:10:20.730" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-08-28T12:10:20.730" LastActivityDate="2015-08-28T12:10:20.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15140" PostTypeId="4" CreationDate="2015-08-28T12:10:20.730" Score="0" Body="This tag refers to questions that focus on modifying and accessing lines." OwnerUserId="405" LastEditorUserId="405" LastEditDate="2015-08-28T15:28:41.887" LastActivityDate="2015-08-28T15:28:41.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15141" PostTypeId="2" ParentId="15138" CreationDate="2015-08-28T12:11:58.920" Score="10" Body="&lt;p&gt;You can set &lt;code&gt;hl-line-sticky-flag&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;hl-line-sticky-flag is a variable defined in &lt;code&gt;hl-line.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Non-nil means the HL-Line mode highlight appears in all windows.&#xA;  Otherwise Hl-Line mode will highlight only in the selected&#xA;  window.  Setting this variable takes effect the next time you use&#xA;  the command &lt;code&gt;hl-line-mode&lt;/code&gt; to turn Hl-Line mode on.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This variable has no effect in Global Highlight Line mode.&#xA;  For that, use &lt;code&gt;global-hl-line-sticky-flag&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2015-08-28T15:29:46.857" LastActivityDate="2015-08-28T15:29:46.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15142" PostTypeId="2" ParentId="14837" CreationDate="2015-08-28T12:29:28.367" Score="2" Body="&lt;p&gt;The best solution I have found to restrict semantic-mode to certain buffers only&#xA;is to set &lt;code&gt;semantic-inhibit-functions&lt;/code&gt;. For example you can add a function that&#xA;inhibits semantic in buffers not in python mode as follows&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-inhibit-semantic-p ()&#xA;  (not (equal major-mode 'python-mode)))&#xA;&#xA;(with-eval-after-load 'semantic&#xA;      (add-to-list 'semantic-inhibit-functions #'my-inhibit-semantic-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-08-28T12:34:34.613" LastActivityDate="2015-08-28T12:34:34.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15143" PostTypeId="2" ParentId="14856" CreationDate="2015-08-28T14:35:23.780" Score="2" Body="&lt;p&gt;You achieve that by customizing &lt;code&gt;semantic-inhibit-functions&lt;/code&gt;. From the documentation (&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;semantic-inhibit-functions&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List of functions to call with no arguments before Semantic is setup.&#xA;  If any of these functions returns non-nil, the current buffer is not&#xA;  setup to use Semantic.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-inhibit-semantic-p ()&#xA;  (not (equal major-mode 'python-mode)))&#xA;&#xA;(with-eval-after-load 'semantic&#xA;      (add-to-list 'semantic-inhibit-functions #'my-inhibit-semantic-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-08-28T14:35:23.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15144" PostTypeId="1" CreationDate="2015-08-28T16:54:26.887" Score="12" ViewCount="5033" Body="&lt;p&gt;I'm trying to open an emacsclient session from a remote host. I walked through the following steps on the &lt;a href=&quot;https://www.gnu.org/software/tramp/#Frequently-Asked-Questions&quot; rel=&quot;noreferrer&quot;&gt;tramp website&lt;/a&gt; How can I use TRAMP to connect to a remote Emacs session?. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll walk you through the step&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;on the remote host put in .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(setq server-host &quot;&amp;lt;IP ADDRESS of remoteHost&amp;gt;&quot;&#xA;      server-use-tcp t)&#xA;(server-start)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;start emacs session on remote host&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;copy the ~/emacs.d/server/server from remoteHost to localHost keep the same path. (localHost:~/emacs.d/server/server)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;on local host emacs shell &lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacsclient  /ssh:test@remoteHost:/tmp/test.py&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But got the following error on my localHost&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; emacsclient: can't find socket; have you started the server?&#xA;;; To start the server in Emacs, type &quot;M-x server-start&quot;.&#xA;;; emacsclient: connected to remote socket at `Remotehost`&#xA;;; emacsclient: connect: No route to host&#xA;;; emacsclient: No socket or alternate editor.  Please use:&#xA;&#xA;    ;; --socket-name&#xA;    ;; --server-file      (or environment variable EMACS_SERVER_FILE)&#xA;    ;; --alternate-editor (or environment variable ALTERNATE_EDITOR)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems to connect to remoteHost but cannot find a route. Similar questions have been ask on SO.  &lt;a href=&quot;https://stackoverflow.com/questions/2231902/originate-edit-of-remote-file-using-emacs-tramp-from-ssh-session&quot;&gt;Here&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/questions/12978424/replacing-sshscreeneditor-with-emacs&quot;&gt;here&lt;/a&gt;. There are also some nice code about copying directly the ~/.emacs.d/server/server from remoteHost to localHost &lt;a href=&quot;http://blog.habnab.it/blog/2013/06/25/emacsclient-and-tramp/&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help will be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&#xA;I have gathered some more information about the matter. It's seem that a number of people have attempted this task and some seems to have succeeded but I could find any solution to my specific problem.&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/12546722/using-emacs-server-and-emacsclient-on-other-machines-as-other-users?rq=1&quot;&gt;Using Emacs server and emacsclient on other machines as other users&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar questions have also been ask on emacs.stack.exchange like&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/371/how-do-i-use-emacsclient-to-connect-to-a-remote-emacs-instance/380#comment23497_380&quot;&gt;how-do-i-use-emacsclient-to-connect-to-a-remote-emacs-instance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update1&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an interesting post &lt;a href=&quot;https://stackoverflow.com/questions/4150078/how-can-i-launch-an-x-window-from-emacs-ess-when-running-r-on-a-server/4150257#4150257&quot;&gt;here&lt;/a&gt; forwarding graphics with ssh. It's easy to implement and  works pretty well if your connection is good enough but it does not make use of tramp.&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-08-03T08:17:54.490" Title="emacsclient to access remote emacs server" Tags="|emacsclient|tramp|daemon|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15145" PostTypeId="1" CreationDate="2015-08-28T17:20:00.590" Score="2" ViewCount="36" Body="&lt;p&gt;I'm trying to modify &lt;code&gt;key-chord.el&lt;/code&gt; so that you can have key-combination specific timeouts and I noticed that &lt;code&gt;key-chord&lt;/code&gt; uses heuristics to decide when two keys pressed sequentially in a kmacro are intended to form a key chord. I don't completely understand the heuristics yet, but it seems like a better approach would be to detect when the keychord is being executed inside a kmacro, delete the relevant keys from the kmacro, and insert a command in their place. I tried skimming the &lt;code&gt;kmacro.el&lt;/code&gt; source distributed with emacs and it's not clear to me how to insert an input event that's more complicated than a simple key press into a kmacro, or if only key presses are supported.&lt;/p&gt;&#xA;" OwnerUserId="8921" LastActivityDate="2015-08-28T17:20:00.590" Title="Can the kmacro internal format contain literal commands?" Tags="|keyboard-macros|key-chord-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15146" PostTypeId="2" ParentId="15032" CreationDate="2015-08-28T17:31:12.590" Score="1" Body="&lt;p&gt;It will tricky to do this generally since company itself does not care about semantics of completion candidates as such the method to detect the whether a symbol is a function would be backend specific. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add a hook to &lt;code&gt;company-completion-finished-hook&lt;/code&gt; which inspects the candidate inserted and adds the parens if needed. As an example the following code will work with company-jedi&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-setup-python-mode ()&#xA;  ;; Make sure we add to hook locally so that we do not mess up completion in other major-modes&#xA;  (add-hook 'company-completion-finished-hook #'my-company-insert-parens-function t))&#xA;&#xA;(defun my-company-insert-parens-function (candidate)&#xA;  ;; This part will be different for different backends&#xA;  (when (string= (plist-get (text-properties-at 0 candidate) :symbol) &quot;f&quot;)&#xA;    (insert &quot;()&quot;)&#xA;    (backward-char)))&#xA;&#xA;(add-hook 'python-mode #'my-setup-python-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-08-28T17:31:12.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15149" PostTypeId="1" CreationDate="2015-08-28T19:48:46.747" Score="1" ViewCount="63" Body="&lt;p&gt;For example, in js2-mode, when I type the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;console.log(&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the editor outputs this (assuming the &lt;code&gt;|&lt;/code&gt; is my cursor):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;console.log (|)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is there a space inserted between the function and the parenthesis? How can I disable this? I have explored the options under &lt;code&gt;M-x customize-group RET js2-mode&lt;/code&gt;, but I have not found any setting to disable this feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-08-28T19:48:46.747" Title="js2-mode: How to avoid automatically inserting space after a function call" Tags="|js2-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15150" PostTypeId="2" ParentId="12923" CreationDate="2015-08-28T20:48:21.647" Score="3" Body="&lt;p&gt;As far as I understand your question the &lt;code&gt;key-translation-map&lt;/code&gt; seems like a good soultion for your problem. For example if you would like to have &lt;code&gt;C-q&lt;/code&gt; acting like &lt;code&gt;C-a&lt;/code&gt; as in your example, you would define the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (define-key key-translation-map (kbd &quot;C-q&quot;) (kbd &quot;C-a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-08-28T20:48:21.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15151" PostTypeId="1" AcceptedAnswerId="15165" CreationDate="2015-08-28T22:05:56.133" Score="0" ViewCount="540" Body="&lt;p&gt;I just installed &lt;code&gt;emacs24&lt;/code&gt; on my &lt;code&gt;Ubuntu 14.04 LTS&lt;/code&gt; OS as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo apt-get install emacs24&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open emacs, I get the following errors (duplicate messages removed):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;eieio/eieio.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;eieio/eieio-base.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;ede/ede-source.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;srecode/srecode-dictionary.elc:Error: Forgot to expand macro eieio-&#xA;  object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;srecode/srecode-map.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;ede/ede-source.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;semantic/semantic-debug.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;semantic/bovine/bovine-debug.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;common/pulse.elc:Warning: &lt;code&gt;interactive-p' is an obsolete function (as of&#xA;      23.2); use&lt;/code&gt;called-interactively-p' instead.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;semantic/semanticdb.elc:Error: Forgot to expand macro eieio-object-p&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've Googled around, and I'm getting the impression that these errors likely have something to do with the version of CEDET I'm using.  There don't seem to be any canonical solutions to this problem yet on the internet -- and I can't find anything here on SE.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know anything about CEDET.  Searching for it with &lt;code&gt;apt-cache&lt;/code&gt; returns nothing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo apt-cache search cedet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can fix this with my current installation, using &lt;code&gt;apt-get&lt;/code&gt;?  If not, what exactly should I do?&lt;/p&gt;&#xA;" OwnerUserId="9345" LastEditorUserId="454" LastEditDate="2016-06-22T03:18:09.807" LastActivityDate="2016-06-22T03:18:09.807" Title="Forgot to expand macro" Tags="|elisp-macros|cedet|ubuntu|emacs24|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15152" PostTypeId="1" AcceptedAnswerId="15155" CreationDate="2015-08-29T01:39:03.750" Score="1" ViewCount="1201" Body="&lt;p&gt;As an elisp beginner I'm trying to grasp what the &quot;best practice&quot; data structure is. For example, I did the simple adding (C-x a, i, g) of things to my abbrev_defs and when I look I see this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'global-abbrev-table&#xA;  '(&#xA;    (&quot;crwdesc&quot; &quot;:PROPERTIES:&#xA;:SEMANTIC:&#xA;:DESC:&#xA;:END:&quot; nil 10)&#xA;    (&quot;propid&quot; &quot;:PROPERTIES:&#xA;:CUSTOM_ID:&#xA;:SEMANTIC:&#xA;:DESC:&#xA;:END: &quot; nil 0)&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also see org-element taking a &quot;lisp representation&quot; and turning it into org-mode output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results raw&#xA;(org-element-interpret-data&#xA; '(headline (:title &quot;One headline&quot; :level 1)&#xA;            (property-drawer nil ((node-property (:key &quot;property1&quot; :value &quot;value1&quot;))&#xA;                                  (node-property (:key &quot;property2&quot; :value &quot;value2&quot;))))&#xA;            (#(&quot;Some much longer content.&quot;))))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;* One headline&#xA;:PROPERTIES:&#xA;:property1: (org-clock-in (quote (16)))&#xA;:property2: value2&#xA;:END:&#xA;Some much longer content.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, the org-element-parse-buffer seems to produce a very elaborate AST which, again, is nested lists. Is this the main data structure when working with elisp? It would seem so -- almost duh! so since this is a lisp. But are there other data structures that are also used? I ask because other data storage and config files (XML, RDF, etc.) generally don't use nested lists. For example, does elisp ever favor the more typical config text layout of simple lines? Or is the mantra &quot;keep it lists?&quot; And I might as well ask about alists while I'm at it. When are they desirable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask all this because your typical tutorial might show you how to use alists, but they rarely talk about its real-world application, when to use it, when not to, or its importance to the language's eco-system.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="253" LastEditDate="2015-08-29T13:16:51.070" LastActivityDate="2015-08-29T13:25:54.457" Title="Most common data structure is a list?" Tags="|elisp|" AnswerCount="3" CommentCount="6" ClosedDate="2015-08-31T14:25:30.880" ContentLicense="CC BY-SA 3.0" />
  <row Id="15153" PostTypeId="2" ParentId="15020" CreationDate="2015-08-29T05:38:59.720" Score="2" Body="&lt;p&gt;Glenn Morris on the emacs.bugs mailing list pointed out a bug of emacs-24.5. One has to delete the cookie caching file saved in &lt;code&gt;url-cookie-file&lt;/code&gt; because it can became saved in an incorrect format. &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21370&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21370&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-08-30T11:22:19.820" LastActivityDate="2015-08-30T11:22:19.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15154" PostTypeId="2" ParentId="14948" CreationDate="2015-08-29T06:18:14.410" Score="7" Body="&lt;p&gt;You need to call eval-buffer with a prefix argument, &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-c C-c&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From documentation of &lt;code&gt;python-shell-send-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(python-shell-send-buffer &amp;amp;optional SEND-MAIN)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Send the entire buffer to inferior Python process. When optional&#xA;  argument SEND-MAIN is non-nil, allow execution of code inside blocks&#xA;  delimited by &quot;if __name__== '__main__':&quot;. When called interactively&#xA;  SEND-MAIN defaults to nil, unless it's called with prefix argument.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-08-29T06:18:14.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15155" PostTypeId="2" ParentId="15152" CreationDate="2015-08-29T08:21:01.253" Score="5" Body="&lt;p&gt;Modern Lisp dialects usually have something like arrays and hash-tables, as&#xA;any mature programming language does. These data structures allow to lookup&#xA;data by index and by key — two most obvious ways to retrieve data from&#xA;compound object.&lt;/p&gt;&#xA;&lt;p&gt;It turns out that lists can do all this stuff too. The only problem with&#xA;them that they are not so efficient. For example, associative list (alist)&#xA;or parameter list (plist) are not as efficient as hash tables due to their&#xA;implementations (you need to traverse their elements one by one until you&#xA;hit “right” element).&lt;/p&gt;&#xA;&lt;p&gt;Emacs Lisp is not most sophisticated Lisp dialect, it's rather&#xA;minimalistic. And tasks that Emacs Lisp needs to perform often don't need&#xA;performance of arrays (except for strings, they are arrays) or hash&#xA;tables. Thus we get situation where everything is usually represented as a&#xA;list.&lt;/p&gt;&#xA;&lt;p&gt;Here is what Richard Stallman says about data structures in Lisp in his&#xA;hilarious&#xA;&lt;a href=&quot;https://www.stallman.org/stallman-computing.html&quot; rel=&quot;noreferrer&quot;&gt;“How I do my computing”&lt;/a&gt;&#xA;thing:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The most powerful programming language is Lisp. If you don't know Lisp (or&#xA;its variant, Scheme), you don't know what it means for a programming&#xA;language to be powerful and elegant. Once you learn Lisp, you will see&#xA;what is lacking in most other languages.&lt;/p&gt;&#xA;&lt;p&gt;Unlike most languages today, which are focused on defining specialized&#xA;data types, Lisp provides a few data types which are general. Instead of&#xA;defining specific types, you build structures from these types. Thus,&#xA;rather than offering a way to define a list-of-this type and a&#xA;list-of-that type, Lisp has one type of lists which can hold any sort of&#xA;data.&lt;/p&gt;&#xA;&lt;p&gt;Where other languages allow you to define a function to search a&#xA;list-of-this, and sometimes a way to define a generic list-search function&#xA;that you can instantiate for list-of-this, Lisp makes it easy to write a&#xA;function that will search any list — and provides a range of such&#xA;functions.&lt;/p&gt;&#xA;&lt;p&gt;In addition, functions and expressions in Lisp are represented as data in&#xA;a way that makes it easy to operate on them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Although he underestimates merits of many modern programming languages (that&#xA;have already copied a lot of things from Lisp), he is right. However, there&#xA;are object oriented systems for Lisp (see CLOS in Common Lisp for example),&#xA;which may seem more modern for some, and yes, they are definitely&#xA;useful. Not sure if there is object system for Emacs Lisp, as I said it's&#xA;quite minimalistic.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-29T08:21:01.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15156" PostTypeId="2" ParentId="15152" CreationDate="2015-08-29T11:29:41.170" Score="0" Body="&lt;p&gt;There is no &quot;best practice data structure&quot;. It looks like you didn't do much programming, so let me get you into basics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data structures are abstractions that allow us to talk about some things on higher level. We have &quot;list&quot; or &quot;array&quot;, not bits. Each of data structres is laid out in some way that allows us to do some things easier or faster, and others are slower and harder(compare inserting element in the middle of the array, versus middle of the list).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, it does not really matter what language you are using, but rather what problem you are trying to solve - if you choose your data structures well, you will end up with readable and fast program that is scalable for larger data. If you pick them wrong, however, you might never solve your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some exceptions, of course. In C you have arrays out of the box, so you mostly use them(plus, they are convenient most of the time). In Lisp, you have lists, and since most of your programs won't benefit from 0.0001s speedup, you can use them just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to do simple stuff? Use lists, Lisp has many functions that make using lists easier. Have some large base of ordered pairs? You might want to use hash maps(or whatever they are called in your language). Something different? Choose data structure accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Programming responsibly and thinking before coding is the Best Programming Practice.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2015-08-29T11:29:41.170" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15157" PostTypeId="2" ParentId="15152" CreationDate="2015-08-29T13:25:54.457" Score="1" Body="&lt;p&gt;This answer is going to be a little more general, than is generally expected, but few things need clarification before giving a more specific answer.&lt;/p&gt;&#xA;&lt;h1&gt;What are data structures?&lt;/h1&gt;&#xA;&lt;p&gt;Data structures are mathematical models studied in graph theory, a subfield of combinatorics.  In mathematical jargon, a model is a particular way to present some axioms (a priori rules) of a system of axioms, typically using some mathematical objects described by the axioms.  The mathematical description is useful for us because we can use it to predict the time and space spent by an algorithm.  Another common description typically found in CS course books is to define them by saying that they are things which implement contracts established by abstract data types, which I find to be a taxonomically bad attempt at locating the subject.&lt;/p&gt;&#xA;&lt;h1&gt;Building blocks&lt;/h1&gt;&#xA;&lt;p&gt;Cons[tructor] cell is the minimal building block of a data structure.  It describes an arc with two vertices.  By continuing this analogy, an array is a cons cell with a fixed number of elements--equivalent to a &amp;quot;forest&amp;quot; in some sense, or to a vertex spanning multiple arcs to a number of other vertices.  Similarly, there are ways to describe other data structures, for example, a heap, is a binary tree with an added condition pertaining to the order of the nodes in the tree hierarchy.  Hashtable is a more complex data structure with multiple rules governing the distribution of nodes and the way of adding and removing them and so on.&lt;/p&gt;&#xA;&lt;h1&gt;Lists&lt;/h1&gt;&#xA;&lt;p&gt;Or, more generally cons cells are the fundamental data structure of any language, but some languages may choose not to expose them directly and instead provide more high-level data structures, possibly inside containers, combined with implementation of algorithms which operate on the data structure and so on.&lt;/p&gt;&#xA;&lt;h1&gt;Best practices&lt;/h1&gt;&#xA;&lt;p&gt;Simple programs benefit from simple solutions, but non-trivial programs will usually benefit from higher level of abstraction.  Lists are the fundamental building blocks, but a good deal of learning how to program is to learn to build abstractions.  So, it is typically best to create data structures which encapsulate lists, be it simple structs, or more complex ones like trees, hash-tables etc.&lt;/p&gt;&#xA;&lt;h1&gt;XML, RDF and C&lt;sup&gt;o&lt;/sup&gt;&lt;/h1&gt;&#xA;&lt;p&gt;XML and RDF are not data structures.  They are formats for representing data.  It is up to implementation to choose how to implement these formats, including what data structure should be used.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;&lt;em&gt;In conclusion&lt;/em&gt;&lt;/h1&gt;&#xA;&lt;p&gt;List (cons) is the most common data structure, and for a good reason.  But you shouldn't choose data structure based on popularity, instead you need to choose (or create) an abstraction that is the best solution to the problem at hand.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-29T13:25:54.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15159" PostTypeId="1" AcceptedAnswerId="15160" CreationDate="2015-08-29T16:15:36.983" Score="4" ViewCount="186" Body="&lt;p&gt;I know that &lt;kbd&gt;C-u&lt;/kbd&gt; sends the prefix &lt;code&gt;4&lt;/code&gt;. Is there any way to make &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;&amp;lt;key&amp;gt;&lt;/kbd&gt; a special case of a command, while still allowing &lt;kbd&gt;C-u&lt;/kbd&gt; &lt;kbd&gt;4&lt;/kbd&gt; &lt;kbd&gt;&amp;lt;key&amp;gt;&lt;/kbd&gt;? &lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-08-29T20:16:08.590" Title="Distinguish C-u &lt;key&gt; from C-u 4 &lt;key&gt;" Tags="|key-bindings|prefix-argument|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15160" PostTypeId="2" ParentId="15159" CreationDate="2015-08-29T16:25:03.890" Score="8" Body="&#xA;&#xA;&lt;p&gt;Sure.  Use the raw prefix argument instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-prefix-test (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (cond&#xA;   ((consp arg)   (message &quot;Prefix argument&quot;))&#xA;   ((numberp arg) (message &quot;Numeric argument&quot;))&#xA;   ((eq '- arg)   (message &quot;Negative argument&quot;))&#xA;   ((not arg)     (message &quot;No argument&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, &lt;code&gt;current-prefix-arg&lt;/code&gt; can be a list, a number, &lt;code&gt;-&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="115" LastEditDate="2015-08-29T20:16:08.590" LastActivityDate="2015-08-29T20:16:08.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15161" PostTypeId="1" CreationDate="2015-08-29T16:46:30.070" Score="1" ViewCount="24" Body="&lt;p&gt;I would like to rename a connected Jabber buffer. However, if I rename the buffer in the usual way, new messages coming in recreate the original one. How can I rename the buffer so that it remains connected to the Jabber session?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-08-29T16:46:30.070" Title="Rename Jabber buffer" Tags="|buffers|jabber|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15162" PostTypeId="1" CreationDate="2015-08-29T18:22:00.010" Score="1" ViewCount="395" Body="&lt;p&gt;I would like to see all first-level children of my level 1 headlines when I open an &lt;code&gt;org-mode&lt;/code&gt; file. I have assigned property values of &lt;code&gt;:VISIBILITY: children&lt;/code&gt; to all my level 1 headlines. When I open the file, why are the &lt;code&gt;:PROPERTIES:&lt;/code&gt; and other drawer name lines visible as well? When I use the command &lt;code&gt;show-children&lt;/code&gt; on a folded headline, I get the results I'm looking for (i.e., children visible and drawer names hidden). What is going on, and how can I hide the drawer names on startup (initial visibility)?&lt;/p&gt;&#xA;" OwnerUserId="5478" LastEditorUserId="5478" LastEditDate="2015-09-01T15:32:54.887" LastActivityDate="2015-09-01T15:32:54.887" Title="Headlines with &quot;children&quot; initial visibility reveals drawer names--why?" Tags="|org-mode|visibility|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15163" PostTypeId="1" AcceptedAnswerId="15214" CreationDate="2015-08-29T19:20:56.743" Score="1" ViewCount="287" Body="&lt;p&gt;I'm trying a new custom &lt;a href=&quot;https://github.com/mswift42/white-sand-theme&quot; rel=&quot;nofollow&quot;&gt;theme&lt;/a&gt;, but it only seems to be partly applied as the background isn't appearing. I'm very, very new to Emacs, so would appreciate advice on how to fix it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.9) of 2015-03-21 on kissel, modified by Debian. Ubuntu 15.04 Called from the GUI, not the terminal. I'm also using the most recent version of Emacs live&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;init.el&lt;/code&gt; is &lt;a href=&quot;http://pastie.org/10383997&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9354" LastEditorUserId="105" LastEditDate="2015-08-31T14:55:33.210" LastActivityDate="2015-08-31T17:08:38.097" Title="Custom theme applies only partly" Tags="|init-file|themes|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15164" PostTypeId="1" AcceptedAnswerId="15170" CreationDate="2015-08-29T21:11:42.280" Score="9" ViewCount="1663" Body="&lt;p&gt;I am using the octave major mode for editing my MATLAB code, since it is more convenient than the unsupported MATLAB packages for emacs on the internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One downside is whenever I try to auto-indent commented lines, the comment character is carried over to column 32, which makes indenting large blocks of code a bit of a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should note that I did &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comment-start &quot;%&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in order to use the percent sign as the default comment character. Nevertheless, I have the same problem when using &lt;code&gt;#&lt;/code&gt;. When I use &lt;code&gt;comment-region&lt;/code&gt;, it actually inserts &lt;code&gt;##&lt;/code&gt; at the beginning of the lines, and the lines with &lt;code&gt;##&lt;/code&gt; do not shoot off like the ones with &lt;code&gt;#&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same question has been asked couple of times as I have found on Google, like &lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=341759&quot; rel=&quot;noreferrer&quot;&gt;this one&lt;/a&gt;. But none of them helped me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to solve this problem so that lines starting with &lt;code&gt;%&lt;/code&gt; or &lt;code&gt;#&lt;/code&gt; are auto-indented in a correct manner without shooting off to column 32. I am using GNU Emacs 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="105" LastEditDate="2015-08-31T14:54:54.860" LastActivityDate="2015-08-31T14:54:54.860" Title="Commented lines shoot off to column 32 in octave-mode" Tags="|indentation|comment|matlab|octave|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15165" PostTypeId="2" ParentId="15151" CreationDate="2015-08-29T21:30:53.647" Score="1" Body="&lt;p&gt;Following the advice of @zck and @wvxvw, I opened emacs using the &lt;code&gt;-Q&lt;/code&gt; option, and this caused the errors not to appear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I concluded that the errors were raised within my &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside that file, I had the following lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;~/cedet-1.0pre7/common/cedet.el&quot;)&#xA;(global-ede-mode 1)&#xA;(semantic-load-enable-code-helpers)&#xA;(global-srecode-minor-mode 1)&#xA;&#xA;(add-to-list 'load-path &quot;~/matlab_el&quot;)&#xA;(require 'matlab-load)&#xA;(matlab-cedet-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Commenting out all of these removed all errors.  I'm sure this implies I've now lost functionality I'm used to having, but I'm not sure how much of it I really need.  As of now, this is the solution that works for me.&lt;/p&gt;&#xA;" OwnerUserId="9345" LastEditorUserId="9345" LastEditDate="2015-08-29T22:30:54.930" LastActivityDate="2015-08-29T22:30:54.930" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15166" PostTypeId="2" ParentId="15164" CreationDate="2015-08-30T06:02:35.097" Score="7" Body="&lt;p&gt;Try using more than one &lt;code&gt;%&lt;/code&gt; or &lt;code&gt;#&lt;/code&gt; in a row: &lt;code&gt;%%&lt;/code&gt; or &lt;code&gt;%%%&lt;/code&gt; etc.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, the number of consecutive comment chars determines the kind of comment and its behavior (e.g., with respect to indentation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html&quot; rel=&quot;noreferrer&quot;&gt;Comment Tips&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-30T06:02:35.097" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15167" PostTypeId="1" CreationDate="2015-08-30T07:15:39.340" Score="3" ViewCount="121" Body="&lt;p&gt;Is there a function built in that I can call (maybe via emacsclient) to start gnus with a particular server / group given a URI?&lt;/p&gt;&#xA;" OwnerUserId="6862" LastEditorUserId="6862" LastEditDate="2015-08-31T19:51:13.370" LastActivityDate="2015-08-31T19:51:13.370" Title="Using Emacs as an nntp/news URL handler" Tags="|gnus|url|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15168" PostTypeId="1" AcceptedAnswerId="15172" CreationDate="2015-08-30T10:39:59.767" Score="3" ViewCount="841" Body="&lt;p&gt;If I split a frame vertically, keep point in left split and press &lt;code&gt;M-x&lt;/code&gt;, minibuffer will be on bottom and &lt;code&gt;M-x&lt;/code&gt; will be in left corner like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/X5ppK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/X5ppK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is very convinient as I can 'see' what I am typing and helm sources without moving my head.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, If I keep point in right split, press &lt;code&gt;M-x&lt;/code&gt;, minibuffer will be on bottom and &lt;code&gt;M-x&lt;/code&gt; still will be in left corner like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/haMx3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/haMx3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;M-x&lt;/code&gt; starts from the middle, it would be very convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I position text in minibuffer w.r.t to split?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when window is split horizontally, how can I position minibuffer at the bottom of top slit? &lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2015-08-30T15:32:54.420" LastActivityDate="2015-08-30T15:32:54.420" Title="Show Helm candidates at left, immediately above minibuffer" Tags="|helm|minibuffer|window-splitting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15170" PostTypeId="2" ParentId="15164" CreationDate="2015-08-30T11:59:36.037" Score="9" Body="&lt;p&gt;I achieved what I wanted by overriding some definitions from the original major mode. In &lt;code&gt;/lisp/progmodes/octave.el&lt;/code&gt; (the file was zipped, I had to unzip it to view the source), I redefined &lt;code&gt;octave-indent-comment&lt;/code&gt; which originally goes like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun octave-indent-comment ()&#xA;  &quot;A function for `smie-indent-functions' (which see).&quot;&#xA;  (save-excursion&#xA;    (back-to-indentation)&#xA;    (cond&#xA;     ((octave-in-string-or-comment-p) nil)&#xA;     ((looking-at-p &quot;\\(\\s&amp;lt;\\)\\1\\{2,\\}&quot;)&#xA;      0)&#xA;     ;; Exclude %{, %} and %!.&#xA;     ((and (looking-at-p &quot;\\s&amp;lt;\\(?:[^{}!]\\|$\\)&quot;)&#xA;           (not (looking-at-p &quot;\\(\\s&amp;lt;\\)\\1&quot;)))&#xA;      (comment-choose-indent)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I removed the last bit and appended to &lt;code&gt;octave-mode-hook&lt;/code&gt; in my configuration like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq octave-mode-hook&#xA;      (lambda () (progn (setq octave-comment-char ?%)&#xA;                        (setq comment-start &quot;%&quot;)&#xA;                        (setq indent-tabs-mode t)&#xA;                        (setq comment-add 0)&#xA;                        (setq tab-width 2)&#xA;                        (setq tab-stop-list (number-sequence 2 200 2))&#xA;                        (setq octave-block-offset 2)&#xA;&#xA;                        (defun octave-indent-comment ()&#xA;                          &quot;A function for `smie-indent-functions' (which see).&quot;&#xA;                          (save-excursion&#xA;                            (back-to-indentation)&#xA;                            (cond&#xA;                             ((octave-in-string-or-comment-p) nil)&#xA;                             ((looking-at-p &quot;\\(\\s&amp;lt;\\)\\1\\{2,\\}&quot;) 0)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I guess removed all that functionality tied to different number of comment characters. Since that functionality was not desirable to me from the very beginning, I am pleased with this result. Now, the comment lines are always aligned with the preceding lines when I use &lt;code&gt;comment-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I guess it is useful to add &lt;a href=&quot;https://github.com/hos/emacs.d/blob/master/site-lisp/init-octave.el&quot; rel=&quot;noreferrer&quot;&gt;this link&lt;/a&gt; to my configuration, for the overrides I did to make &lt;code&gt;octave-mode&lt;/code&gt; behave more pleasantly while editing MATLAB code.&lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="47" LastEditDate="2015-08-30T12:09:46.497" LastActivityDate="2015-08-30T12:09:46.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15171" PostTypeId="2" ParentId="12947" CreationDate="2015-08-30T13:08:00.980" Score="6" Body="&lt;p&gt;You may use &lt;a href=&quot;https://godoc.org/golang.org/x/tools/cmd/goimports&quot; rel=&quot;nofollow noreferrer&quot;&gt;goimports&lt;/a&gt; utility and just replace &lt;code&gt;gofmt&lt;/code&gt; in go-mode with &lt;code&gt;goimports&lt;/code&gt;. Cite from goimports page shows how to integrate it with go-mode:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq gofmt-command &amp;quot;goimports&amp;quot;)&#xA;(add-to-list 'load-path &amp;quot;/home/you/somewhere/emacs/&amp;quot;)&#xA;(require 'go-mode-load)&#xA;(add-hook 'before-save-hook 'gofmt-before-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The recipe for use-package installer:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(use-package go-mode&#xA;:custom&#xA;(gofmt-command &amp;quot;goimports&amp;quot;)&#xA;:hook&#xA;(before-save-hook gofmt-before-save))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or if you have already worked go-mode then interactively&lt;/p&gt;&#xA;&lt;p&gt;M-x &lt;code&gt;customize-group&lt;/code&gt; go&lt;/p&gt;&#xA;&lt;p&gt;and set value of &lt;code&gt;Gofmt command&lt;/code&gt; to &lt;code&gt;gomimports&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2548" LastEditorUserId="2548" LastEditDate="2022-01-20T19:54:28.043" LastActivityDate="2022-01-20T19:54:28.043" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="15172" PostTypeId="2" ParentId="15168" CreationDate="2015-08-30T13:21:52.247" Score="4" Body="&lt;p&gt;What you want to achieve might be tricky (if not impossible) to achieve. But it seems that all you want is to keep the &lt;code&gt;helm-sources&lt;/code&gt; (the &lt;code&gt;helm&lt;/code&gt; window) and the minibuffer in same direction so that you can view them without have move your eyes around much. I think this can be achieved using on of the methods below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; Customize &lt;code&gt;helm&lt;/code&gt; so that the &quot;helm window&quot; is always in the bottom-left window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the minibuffer is always positioned at bottom-left of the screen, this would mean that you can view helm-sources and the minibuffer at once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can achieve that by writing a custom function to select the window to display the helm buffer. And set &lt;code&gt;helm-split-window-preferred-function&lt;/code&gt; to this function. I am providing one such function below&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; So that helm does not use current window to display the helm window&#xA;(setq helm-split-window-in-side-p nil)&#xA;&#xA;&#xA;(defun my-helm-split-window (window)&#xA;  (if (one-window-p t)&#xA;      ;; With just window helm does the right thing&#xA;      (split-window&#xA;       (selected-window) nil (if (eq helm-split-window-default-side 'other)&#xA;                                 'below helm-split-window-default-side))&#xA;&#xA;    ;; If there are multiple windows, select the bottom-left window&#xA;    (while (window-in-direction 'left)&#xA;      (select-window (window-in-direction 'left)))&#xA;    (while (window-in-direction 'below)&#xA;      (select-window (window-in-direction 'below)))&#xA;&#xA;    (selected-window)))&#xA;&#xA;(setq helm-split-window-preferred-function #'my-helm-split-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; Another solution is to echo the input to helm, in the header line&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way the input can be seen at the top of the &lt;code&gt;helm&lt;/code&gt; window irrespective of the position of the window&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To achieve this set &lt;code&gt;helm-echo-input-in-header-line&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. Additionally you can use some tips mentioned in &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3asbyn/new_and_very_useful_helm_feature_enter_search/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; reddit thread to show input only in the header&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-08-30T13:21:52.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15173" PostTypeId="1" CreationDate="2015-08-30T13:34:12.440" Score="0" ViewCount="126" Body="&lt;p&gt;I would like to change the definition of the paragraph in such a way that every line to be considered as a paragraph. As I understand from the documentation, one should change the variables &lt;code&gt;paragraph-start&lt;/code&gt; and &lt;code&gt;paragraph-separate&lt;/code&gt; for this purpose. I tried the following, but it doesn't work. (I have evaluated the following in the scratch buffer, but when using &lt;code&gt;forward-paragraph&lt;/code&gt;, the usual definition of the paragraph is used by &lt;code&gt;forward-paragraph&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq paragraph-start &quot;\n&quot;&#xA;       paragraph-separate &quot;\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2015-08-31T14:54:25.767" LastActivityDate="2015-08-31T14:54:25.767" Title="Changing the definition of the paragraph" Tags="|newlines|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15175" PostTypeId="2" ParentId="2355" CreationDate="2015-08-30T15:14:40.453" Score="5" Body="&lt;p&gt;Please try this code in your emacs config file to force web-mode indent. I &lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;noreferrer&quot;&gt;referred it&lt;/a&gt; from the web-mode home-page.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'web-mode)&#xA;(defun my-web-mode-hook ()&#xA;  &quot;Hooks for Web mode.&quot;&#xA;  (setq web-mode-markup-indent-offset 2)&#xA;)&#xA;(add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9360" LastActivityDate="2015-08-30T15:14:40.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15176" PostTypeId="1" CreationDate="2015-08-30T15:23:34.470" Score="0" ViewCount="120" Body="&lt;p&gt;I'm pretty new to emacs, so this might be a stupid question but&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have auto word wrap enabled like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default auto-fill-function 'do-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I try to use it in C files, It inserts a * before the wrapped line like a comment.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;blah blah blah over the line limit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;blah blah blah&#xA;*over the line limit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Weirdly enough, pressing enter on a comment does not add the star, which is disappointing.This does not happen in viml files (only in c and java files?)&lt;/p&gt;&#xA;" OwnerUserId="9361" LastActivityDate="2023-12-23T11:01:30.157" Title="Emacs adding comment char when using auto-fill-wrap" Tags="|auto-fill-mode|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15177" PostTypeId="1" AcceptedAnswerId="15178" CreationDate="2015-08-30T17:33:31.007" Score="10" ViewCount="2073" Body="&lt;p&gt;Just to clarify... For example, in this &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html&quot;&gt;doc&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A hook is a Lisp variable which holds a list of functions, to be&#xA;  called on some well-defined occasion. (This is called running the&#xA;  hook.) The individual functions in the list are called the hook&#xA;  functions of the hook. For example, the hook &lt;code&gt;kill-emacs-hook&lt;/code&gt; runs just&#xA;  before exiting Emacs...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think it's saying there is a variable (symbol) named &lt;code&gt;kill-emacs-hook&lt;/code&gt;that represents a list of a set of &quot;hook functions&quot; that will run when the &lt;code&gt;kill-emacs-hook&lt;/code&gt; is evaluated, thereby performing those functions. Correct? Then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook 'auto-fill-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is adding &lt;code&gt;auto-fill-mode&lt;/code&gt; to that list identified by &lt;code&gt;text-mode-hook&lt;/code&gt; in addition to what's already there. Good. Now &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/defcustom.html&quot;&gt;this&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom text-mode-hook nil&#xA;  &quot;Normal hook run when entering Text mode and many related modes.&quot;&#xA;  :type 'hook&#xA;  :options '(turn-on-auto-fill flyspell-mode)&#xA;  :group 'wp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where it seems we are either creating or altering the &lt;code&gt;text-mode-hook&lt;/code&gt;. I'm now confused as to the nature of hooks and their relationship with &lt;code&gt;defcustom&lt;/code&gt;. My logical choice is that this code is creating a variable &lt;code&gt;text-mode-hook&lt;/code&gt; which is of &quot;type&quot; (don't know what is meant by types in elisp) &lt;code&gt;hook&lt;/code&gt;. Is this, indeed, supposed to be the initial creation of the hook &lt;code&gt;text-mode-hook&lt;/code&gt;? If so, what's up with the &quot;options?&quot; Are those the supposed hook functions, or something else? &lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2015-08-30T17:53:11.307" Title="What is a hook?" Tags="|elisp|hooks|defcustom|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15178" PostTypeId="2" ParentId="15177" CreationDate="2015-08-30T17:53:11.307" Score="7" Body="&lt;p&gt;Your understanding of Emacs Lisp notion of hook is absolutely correct. Indeed,&#xA;“normal” hooks are just lists of functions (every function doesn't take&#xA;arguments, otherwise it's not usually called “hook” or “normal hook” in&#xA;Emacs Lisp).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Most of these variables have names ending with &lt;code&gt;-hook&lt;/code&gt;. They are normal&#xA;  hooks, run by means of &lt;code&gt;run-hooks&lt;/code&gt;. The value of such a hook is a list of&#xA;  functions; the functions are called with no arguments and their values are&#xA;  completely ignored. The recommended way to put a new function on such a&#xA;  hook is to call &lt;code&gt;add-hook&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The variables whose names end in &lt;code&gt;-functions&lt;/code&gt; are usually abnormal hooks&#xA;  (some old code may also use the deprecated &lt;code&gt;-hooks&lt;/code&gt; suffix); their values&#xA;  are lists of functions, but these functions are called in a special way&#xA;  (they are passed arguments, or their return values are used). The&#xA;  variables whose names end in &lt;code&gt;-function&lt;/code&gt; have single functions as their&#xA;  values.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Customization interface is a different thing. All the difference between&#xA;&lt;code&gt;defvar&lt;/code&gt; and &lt;code&gt;defcustom&lt;/code&gt; is that the latter allows user to edit the variable&#xA;via “customize” interface. This interface can facilitate editing of certain&#xA;types of data, so for example if you're saying that &lt;code&gt;:type&lt;/code&gt; of&#xA;&lt;code&gt;text-mode-hook&lt;/code&gt; is &lt;code&gt;hook&lt;/code&gt;, then customization interface &lt;em&gt;makes sure&lt;/em&gt; that&#xA;&lt;code&gt;text-mode-hook&lt;/code&gt; is always a list of functions. Furthermore, you can specify&#xA;which options are &lt;em&gt;recommended&lt;/em&gt; with &lt;code&gt;:options&lt;/code&gt; argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, your understanding is correct and &lt;code&gt;defcustom&lt;/code&gt; and its options are just a&#xA;way to instruct Emacs, so it can better assist user when he/she uses&#xA;“customize” interface.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-08-30T17:53:11.307" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15179" PostTypeId="1" AcceptedAnswerId="15180" CreationDate="2015-08-30T17:59:47.820" Score="2" ViewCount="1933" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL&#xA;&lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Compiled from EmacsW64.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Company, using the latest version of Company  from MELPA&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows 7 x64 bit.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Propably I'm missing something. I couldn't figure it out with Google. After reorganizing my &lt;code&gt;.emacs.d&lt;/code&gt;, I noticed I don't get any completion from buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I'm typing in the buffer &lt;code&gt;foobarsentence&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then start a new line below that, and typing &lt;code&gt;fooba&lt;/code&gt;, I expected to get company completion suggestion that shows &lt;code&gt;foobarsentecene&lt;/code&gt;, and I just need to press &lt;kbd&gt;tab&lt;/kbd&gt; or &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I see nothing. I couldn't find any company backend that's responsible for words-in-buffer completion. Anyone knows which company backend I mean? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-08-30T20:18:46.933" LastActivityDate="2015-08-30T20:18:46.933" Title="Company backend for words inside the buffer" Tags="|company-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15180" PostTypeId="2" ParentId="15179" CreationDate="2015-08-30T18:05:40.340" Score="2" Body="&lt;p&gt;That is &lt;code&gt;company-dabbrev&lt;/code&gt;, named after the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Dynamic-Abbrevs.html&quot; rel=&quot;nofollow&quot;&gt;dabbrev&lt;/a&gt; command bound to &lt;code&gt;M-/&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-08-30T18:05:40.340" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15181" PostTypeId="1" AcceptedAnswerId="15219" CreationDate="2015-08-30T19:29:47.267" Score="5" ViewCount="814" Body="&lt;p&gt;I try to define a custom coloring of the compilation buffer, but I can not get the highlight correctly.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'compilation-error-regexp-alist 'my-message)&#xA;(add-to-list 'compilation-error-regexp-alist-alist&#xA;  '(my-message&#xA;    &quot;^\\(\\(ERRR\\|CRIT\\|ALRT\\|EMRG\\)\\|\\(WARN\\|NTCE\\)\\|\\(INFO\\|DEBG\\)\\) .*\\[\\(\\([^ \n]+\\):\\([0-9]+\\)\\)\\]$&quot;&#xA;    6 7 nil (3 . 4) 5))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This correctly colors the hyperlink:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wfMHd.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wfMHd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can not get the beginning of the line right. I would like the tags &lt;code&gt;WARN&lt;/code&gt;, &lt;code&gt;INFO&lt;/code&gt;, &lt;code&gt;NTCE&lt;/code&gt;, &lt;code&gt;DEBG&lt;/code&gt; and &lt;code&gt;ERRR&lt;/code&gt; to have the same color as the hyperlink. But everything I tried did not work. I get either the error, that the match does not exists of the color for all lines is fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to color the beginning of the line in the same color like the hyperlink?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="221" LastEditDate="2015-09-01T06:03:52.630" LastActivityDate="2015-09-01T18:45:13.183" Title="How to highlight the compilation buffer?" Tags="|compilation-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15182" PostTypeId="1" CreationDate="2015-08-30T20:47:12.887" Score="3" ViewCount="1315" Body="&lt;p&gt;I'm reading about some concepts of Emacs Lisp. The lambda's seems interesting to me. After reading the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Simple-Lambda.html#Simple-Lambda&quot; rel=&quot;nofollow&quot;&gt;manuals&lt;/a&gt; about lambda's in Emacs Lisp, I decided to play with it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have this snippet: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-insert-arrow ()&#xA;    (interactive)&#xA;    (insert &quot;-&amp;gt;&quot;)) &#xA;&#xA;(evil-define-key 'insert php-mode map (kbd &quot;C-&amp;lt;next&amp;gt;&quot;) 'my-insert-arrow))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Okay, then I replace that function with a lambda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'insert php-mode map (kbd &quot;C-&amp;lt;next&amp;gt;&quot;) (lambda () (insert &quot;-&amp;gt;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I got the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;command-execute: Wrong type argument: commandp, (lambda nil (insert &quot;-&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems I applied the lambda in the wrong way. But I found no difference with the manuals, except that the lambda's in the tutorial examples contains arguments. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-08-30T21:07:05.283" LastActivityDate="2015-08-30T21:07:05.283" Title="Bind a key to a lambda: what am I doing wrong?" Tags="|elisp|" AnswerCount="0" CommentCount="11" ClosedDate="2015-08-30T23:02:24.320" ContentLicense="CC BY-SA 3.0" />
  <row Id="15183" PostTypeId="1" AcceptedAnswerId="15186" CreationDate="2015-08-30T22:53:58.973" Score="6" ViewCount="2330" Body="&lt;p&gt;I believe that there is a way to increase the debug level, but I don't recall how. Perhaps I am using the wrong terms, but web searches and looking on StackExchange are not providing me anything useful. Basically, I want my &lt;code&gt;*Messages*&lt;/code&gt; buffer to output more information about an error. How can I do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, can I set the debug log level to FINE or something similar?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-08-31T00:06:07.840" Title="how to increase the debugging message level" Tags="|debugging|message|logging|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15184" PostTypeId="1" AcceptedAnswerId="16703" CreationDate="2015-08-30T23:09:45.510" Score="2" ViewCount="603" Body="&lt;p&gt;I'm trying to test out a new font called Triplicate. When I try to use it each character is vary wide, like within a square, shown in &lt;a href=&quot;https://i.stack.imgur.com/4Kt1U.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;. Setting &lt;code&gt;variable-pitch-mode&lt;/code&gt; doesn't change anything. I've not seen this problem with other fonts, and it does not have such wide spacing outside of Emacs, like in Abiword. It also looks good in OS X with the same Emacs configuration. Changing the width setting to condensed/compressed/normal/supercondensed/etc doesn't change the width at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on Arch Linux, Emacs 25.4.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4Kt1U.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4Kt1U.jpg&quot; alt=&quot;Bad triplicate&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9366" LastEditorUserId="9366" LastEditDate="2015-08-31T00:19:45.377" LastActivityDate="2015-09-17T18:15:58.683" Title="Font spacing is very wide with Triplicate" Tags="|fonts|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15185" PostTypeId="1" CreationDate="2015-08-30T23:36:21.007" Score="7" ViewCount="1336" Body="&lt;p&gt;I have the following org-mode table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: columnview :hlines 1 :id global&#xA;| /Project/      | Mon | Tue | Wed |  Thu | Fri |  Sat | Sun | /Total/ |&#xA;|----------------+-----+-----+-----+------+-----+------+-----+---------|&#xA;| AnotherProduct |     |     |     |      |     | 2.50 |     |         |&#xA;| Prototype      |     |     |     | 3.50 |     |      |     |         |&#xA;|----------------+-----+-----+-----+------+-----+------+-----+---------|&#xA;| /Daily/        |     |     |     |      |     |      |     |         |&#xA;#+TBLFM: @I$9..@II$9=vsum($2..$8);%.2f;::@II$2..@III$9='(format &quot;%3.2f&quot; (apply '+ '(@I..@II)));N;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I get the error &lt;code&gt;can't assign to hline relative reference&lt;/code&gt; when I run &lt;code&gt;M-x org-table-recalculate&lt;/code&gt;. I looked over the &lt;a href=&quot;http://orgmode.org/manual/References.html&quot; rel=&quot;noreferrer&quot;&gt;org-mode references documentation&lt;/a&gt; and the &lt;a href=&quot;http://comments.gmane.org/gmane.emacs.orgmode/86960&quot; rel=&quot;noreferrer&quot;&gt;gmane.org forums&lt;/a&gt;, but I did not find any reasons as to why the hline relative references could not be assigned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This issue is related to the &lt;code&gt;timesheet&lt;/code&gt; package on MELPA. I have filed an issue here: &lt;a href=&quot;https://github.com/tmarble/timesheet.el/issues/3&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/tmarble/timesheet.el/issues/3&lt;/a&gt; but hopefully I have found the underlying problem, and hopefully it is reasonably fixable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some relevant info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Org-mode version 8.3.1 (8.3.1-87-g4ef2c0-elpa @ /home/luke/.emacs.d/elpa/org-20150824/)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;emacs-version: 24.5.1&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;ArchLinux OS: Linux 4.1.6-1-ARCH #1 SMP PREEMPT Mon Aug 17 08:52:28 CEST 2015 x86_64 GNU/Linux&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="5213" LastEditDate="2016-04-26T21:19:01.243" LastActivityDate="2016-04-26T21:19:01.243" Title="Can't assign to hline relative reference" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15186" PostTypeId="2" ParentId="15183" CreationDate="2015-08-31T00:06:07.840" Score="3" Body="&lt;p&gt;If you set variable &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; then Emacs will show you a detailed backtrace of what function calls led to the error.  (This affects only actual errors, not non-error messages, which are also logged to &lt;code&gt;*Messages*&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-31T00:06:07.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15187" PostTypeId="1" CreationDate="2015-08-31T00:43:45.303" Score="1" ViewCount="52" Body="&lt;p&gt;I have many lines that include external files in my main .org file. Sometimes I need to export the main file to pdf (and latex) without including the external files. So, I would like to know how to efficiently turn in and off lines that include external file that uses the #+INCLUDE: command in my main .org file.&lt;/p&gt;&#xA;" OwnerUserId="4052" LastActivityDate="2015-08-31T00:43:45.303" Title="How to turn in and off the #+INCLUDE on org-mode?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15188" PostTypeId="1" AcceptedAnswerId="15192" CreationDate="2015-08-31T00:44:08.043" Score="5" ViewCount="776" Body="&lt;p&gt;I am fairly new to customizing my emacs, so please be gentle.  I did try to find a solution for this, but all I found was a page on git where someone asked a similar question but (as far as I can tell) never received an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have both smartparens and web-mode installed and am trying to work in .html.erb files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue I am having is that whenever I type &lt;code&gt;&amp;lt;%space&lt;/code&gt; I end up with &lt;code&gt;&amp;lt;%  %&amp;gt;&amp;gt;&lt;/code&gt; (notice the extra angular bracket).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any suggestions for how to deal with this, and how I would go about it?  I don't really want to disable either of the packages.&lt;/p&gt;&#xA;" OwnerUserId="9344" LastEditorUserId="105" LastEditDate="2015-08-31T14:53:30.017" LastActivityDate="2015-08-31T14:53:30.017" Title="Smartparens and web-mode conflict to add extra angular bracket" Tags="|web-mode|smartparens|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15189" PostTypeId="1" AcceptedAnswerId="15190" CreationDate="2015-08-31T01:16:53.963" Score="4" ViewCount="1718" Body="&lt;p&gt;I'd rather not use &lt;code&gt;cl-lib&lt;/code&gt; and &lt;code&gt;cl&lt;/code&gt; at the same time. However, I really like using &lt;code&gt;lexical-let&lt;/code&gt; to specify the usage of lexical binding on a more granular level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any equivalent in &lt;code&gt;cl-lib&lt;/code&gt; or vanilla Emacs Lisp?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="105" LastEditDate="2015-08-31T04:54:27.233" LastActivityDate="2015-08-31T04:54:27.233" Title="Alternative to lexical-let" Tags="|elisp|lexical-scoping|cl-lib|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15190" PostTypeId="2" ParentId="15189" CreationDate="2015-08-31T02:05:00.283" Score="5" Body="&lt;p&gt;&lt;code&gt;cl&lt;/code&gt; and &lt;code&gt;cl-lib&lt;/code&gt; are not &quot;either or&quot;. The former requires the latter and defines &lt;code&gt;lexical-let&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want lexical bindings, you can turn them on using the variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;lexical-binding&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also set it on a per-file basis using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;file variables&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2015-08-31T03:22:25.087" LastActivityDate="2015-08-31T03:22:25.087" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15191" PostTypeId="2" ParentId="15189" CreationDate="2015-08-31T04:51:43.403" Score="5" Body="&lt;p&gt;Simply require library &lt;code&gt;cl&lt;/code&gt; at compile time, to get the use of its macros (and not get any runtime load). That is where macro &lt;code&gt;lexical-let&lt;/code&gt; is defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So all you need is this, to use &lt;code&gt;lexical-let&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'cl)) ;; lexical-let&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I put the stuff I use from the library in a comment like that, just to let me know what I'm using from it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, and &lt;code&gt;lexical-let&lt;/code&gt; works in all Emacs versions (at least Emacs 20 and later).  And yes, it lets you use dynamic binding by default and use lexical binding in a granular way, when you want it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;cl.el&lt;/code&gt; &lt;em&gt;is&lt;/em&gt; vanilla Emacs, BTW, not a 3rd-party library.  It is simply not preloaded.  It has the same status as something like Org mode or Calc or &lt;code&gt;dired-x.el&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-31T04:51:43.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15192" PostTypeId="2" ParentId="15188" CreationDate="2015-08-31T05:28:25.320" Score="7" Body="&lt;p&gt;You can turn off auto pairing for web mode and enable pairing for &lt;code&gt;&amp;lt;&lt;/code&gt; &amp;amp; &lt;code&gt;%&lt;/code&gt; in smartparens.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smartparens)&#xA;(sp-pair &quot;%&quot; &quot;%&quot; :wrap &quot;C-%&quot;)&#xA;(sp-pair &quot;&amp;lt;&quot; &quot;&amp;gt;&quot; :wrap &quot;C-&amp;gt;&quot;)&#xA;&#xA;(require 'web-mode)&#xA;(setq web-mode-enable-auto-pairing nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when you press &lt;code&gt;&amp;lt;%space&lt;/code&gt; you will get &lt;code&gt;&amp;lt;%  %&amp;gt;&lt;/code&gt; with both modes enabled.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-08-31T14:37:06.757" LastActivityDate="2015-08-31T14:37:06.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15193" PostTypeId="1" AcceptedAnswerId="15195" CreationDate="2015-08-31T05:33:18.797" Score="5" ViewCount="2003" Body="&lt;p&gt;&lt;em&gt;This may really be a basic emacs lisp question, but I'm just starting to learn some Clojure -- tiptoeing along the first steps of the newbie's path -- and don't know any elisp yet.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can one set Word Wrap mode to indent to the first character of the previous line?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Word-wrap visual line mode mode is good, but the indents are lost on wrap, making it harder to scan code by eye. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I'd want to indent up to a point, say, 30 characters max for example, to avoid overdoing it...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm guessing that to get this programmatically I'd need a conditional elisp statement in my emacs file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems many people would have done this. Or is there a reason not to? How can it be implemented?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="105" LastEditDate="2015-08-31T14:51:35.143" LastActivityDate="2015-08-31T23:23:44.417" Title="Word wrap that preserves indent from previous line" Tags="|indentation|wrapping|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15194" PostTypeId="2" ParentId="15124" CreationDate="2015-08-31T06:13:33.730" Score="8" Body="&lt;p&gt;Emacs Lisp doesn't really have &quot;Best Practices&quot;.  Judging from all the code I've read so far, people instead go for what is most convenient for them.  And given that Emacs Lisp and Common Lisp are reasonably close (both are of the Lisp-2 variety), it is no wonder either the older and unprefixed &lt;code&gt;cl.el&lt;/code&gt; or the newer and prefixed &lt;code&gt;cl-lib&lt;/code&gt; library are used when the built-in functions don't do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this isn't the only route you can go.  There's &lt;a href=&quot;https://github.com/magnars/dash.el&quot; rel=&quot;noreferrer&quot;&gt;dash.el&lt;/a&gt;, a more list-oriented library lending both names and idioms from Clojure.  I prefer using it these days as its list manipulation functions are richer and it comes with a bunch of goodies including &lt;code&gt;-let&lt;/code&gt; for destructuring and &lt;code&gt;-when-let&lt;/code&gt; for shortening the common &lt;code&gt;(let ((foo ...)) (when foo ...))&lt;/code&gt; idiom. Sometimes I add &lt;code&gt;cl-lib&lt;/code&gt; to the mix, like when I need &lt;code&gt;cl-loop&lt;/code&gt; for advanced loops or &lt;code&gt;cl-letf&lt;/code&gt; for dynamically binding functions.  Nothing wrong with mixing and matching these as you need or even inventing your library and using it.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-08-31T06:13:33.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15195" PostTypeId="2" ParentId="15193" CreationDate="2015-08-31T06:23:23.873" Score="4" Body="&lt;p&gt;&lt;code&gt;word-wrap&lt;/code&gt; is pretty special variable as it's a variable that controls how Emacs' display engine operates when showing a buffer in a window.  It is accompanied by &lt;code&gt;wrap-prefix&lt;/code&gt; which allows you to prepend space to a wrapped line for the entire buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq word-wrap t)&#xA;(setq wrap-prefix (make-string 30 ?\s))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is no convenient setting for the behaviour you've described to.  It could probably be implemented in the form of a minor mode that adds the &lt;code&gt;wrap-prefix&lt;/code&gt; text property with the desired value to each line after examining the indentation of the previous line though.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-08-31T06:23:23.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15196" PostTypeId="1" AcceptedAnswerId="16435" CreationDate="2015-08-31T06:44:39.473" Score="2" ViewCount="330" Body="&lt;p&gt;I have customized the &lt;code&gt;.emacs&lt;/code&gt; file a little to suit my taste, and it works fine when run in its own window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try to run it in my terminal using the command &lt;code&gt;emacs -nw&lt;/code&gt;, it throws up the following error in a split view, with the other view running emacs properly on the console, albeit without a few of my customizations.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/safiyat/.emacs':&#xA;&#xA;error: X windows are not in use or not initialized&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How is it possible to have an error free load of the init file on both X and the console?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="4025" LastActivityDate="2015-09-09T12:55:17.887" Title="How to make the init file compatible with X and console at the same time?" Tags="|init-file|shell|customize|linux|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15197" PostTypeId="1" AcceptedAnswerId="15200" CreationDate="2015-08-31T06:55:55.670" Score="6" ViewCount="1535" Body="&lt;p&gt;I am currently on &lt;code&gt;master&lt;/code&gt; branch and I have to create new branch called &lt;code&gt;test&lt;/code&gt; starting from master.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;b c&lt;/code&gt; in magit buffer, magit will prompt for starting point&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Create branch starting at (default master):&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How to prevent this and always use the current branch? &lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2015-08-31T14:50:47.573" LastActivityDate="2016-12-08T09:53:48.063" Title="Magit always use current branch to create new branch" Tags="|magit|git|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15198" PostTypeId="1" AcceptedAnswerId="15211" CreationDate="2015-08-31T07:03:59.067" Score="12" ViewCount="5515" Body="&lt;p&gt;To post &lt;a href=&quot;https://emacs.stackexchange.com/q/14509/5187&quot;&gt;this question&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/q/15197/5187&quot;&gt;this question&lt;/a&gt;, I had to copy the contents of minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to copy from minibuffer but it didn't worked. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across &lt;a href=&quot;https://groups.google.com/forum/#!topic/gnu.emacs.help/zFYN_Ife7lA&quot; rel=&quot;noreferrer&quot;&gt;this discussion&lt;/a&gt;  and checked &lt;code&gt;*Messages*&lt;/code&gt; buffer also. But minibuffer contents won't be there always. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to copy mini buffer contents? How?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am in a python process buffer and run &lt;code&gt;kill-this-buffer&lt;/code&gt;, emacs will show this message in minibuffer&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Buffer &quot;&lt;em&gt;Python&lt;/em&gt;&quot; has a running process; kill it (y or n)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I want to copy that text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In above example that message will be available in &lt;code&gt;*Messages*&lt;/code&gt; buffer,  but  if  am creating a new branch using magit &lt;code&gt;b c&lt;/code&gt;, it will prompt with message &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Create branch starting at (default master):&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which  will  &lt;strong&gt;NOT&lt;/strong&gt; be available in &lt;code&gt;*Messages*&lt;/code&gt;. I need to copy this text also.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-08-31T14:50:27.467" Title="How to copy minibuffer contents?" Tags="|minibuffer|echo-area|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15199" PostTypeId="1" CreationDate="2015-08-31T08:04:25.730" Score="3" ViewCount="714" Body="&lt;p&gt;I am using Emacs on Windows 8. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some processes when run through shell-command will request interactive input, notably commands like &lt;code&gt;git push&lt;/code&gt; (which will ask for user name and password). Sometimes I will accidentially run such commands synchronously (&lt;code&gt;shell-command&lt;/code&gt; without &lt;code&gt;&amp;amp;&lt;/code&gt;) and Emacs will just freeze. The same happened with some commands when I was using &lt;code&gt;bzr&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After freezing, it will become impossible to resolve the issue from within Emacs – &lt;code&gt;C-g&lt;/code&gt; and any other input is simply ignored – and I have to track down the executable in the task manager. This may be related to the password prompt of git, which even in Cygwin entirely ignores common signals (e.g. &lt;code&gt;C-c&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some fix for this behaviour? I can do  it for &lt;code&gt;git push&lt;/code&gt; specifically with some function-advice for &lt;code&gt;shell-command&lt;/code&gt;, but I'd rather find a general solution.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Workaround&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;For reference: My current solution is to add an advice to &lt;code&gt;shell-command&lt;/code&gt;, that adds the forgotten ampersand &lt;code&gt;&amp;amp;&lt;/code&gt;, detecting commands by regular expression.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add #'shell-command :filter-args #'shell-command-git-fix-advice)&#xA;(defun shell-command-git-fix-advice (args)&#xA;  (when (and&#xA;         (not (string-match-p &quot;&amp;amp;[ \t]*$&quot; (car args)))&#xA;         (string-match-p &quot;^git +push +&quot; (car args)))&#xA;    (setcar args (concat (car args) &quot;&amp;amp;&quot;)))&#xA;  args)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2308" LastEditorUserId="2308" LastEditDate="2018-10-22T07:28:35.413" LastActivityDate="2018-10-22T07:28:35.413" Title="Emacs on Windows: `shell-command` hangs when process wants input" Tags="|microsoft-windows|git|shell-command|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="15200" PostTypeId="2" ParentId="15197" CreationDate="2015-08-31T09:23:48.667" Score="5" Body="&lt;p&gt;The offered default &lt;em&gt;is&lt;/em&gt; the current branch, therefore there already is a key binding for creating a new branch starting at the current branch. But that binding is &lt;kbd&gt;b c RET&lt;/kbd&gt;, not &lt;kbd&gt;b c&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay that was a slight simplification. If and only if there is a branch at point (e.g. in a log or the references buffer) then that branch is offered as the default instead.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-11-09T00:00:40.930" LastActivityDate="2016-11-09T00:00:40.930" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15201" PostTypeId="2" ParentId="15185" CreationDate="2015-08-31T09:28:15.033" Score="5" Body="&lt;p&gt;When I change the formula to the one below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$9..@-1$9=vsum($2..$8);%.2f;::@&amp;gt;$2..@&amp;gt;$9='(format &quot;%3.2f&quot; (apply '+ '(@2..@-1)));N;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works! Basically, I had to find a workaround from using the hline relative references &lt;code&gt;I&lt;/code&gt; &lt;code&gt;II&lt;/code&gt; and &lt;code&gt;III&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just heard back from the org-mode team, and here is their response:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a known limitation: hline relative references are not allowed on the left hand side of a formula. The error message you get should be explicit.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After this clarification, the error message makes sense! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to re-introduce the hline references on the right side of my assignments would look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$9..@-1$9=vsum($2..$8);%.2f;::@&amp;gt;$2..@&amp;gt;$9='(format &quot;%3.2f&quot; (apply '+ '(@I..@II)));N;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-09-01T08:13:04.587" LastActivityDate="2015-09-01T08:13:04.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15202" PostTypeId="2" ParentId="14483" CreationDate="2015-08-31T10:43:59.783" Score="14" Body="&lt;p&gt;If you need to be sure about the author and/or commit date of a particular commit, then you can always just show that commit in a separate buffer by pressing &lt;kbd&gt;RET&lt;/kbd&gt; with point on that commit in the log.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But that's not very convenient if you have to do it a lot of course. I have started working on making this more flexible.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-08-31T10:43:59.783" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15205" PostTypeId="1" CreationDate="2015-08-31T12:45:08.643" Score="2" ViewCount="69" Body="&lt;p&gt;There is a cool new feature in Emacs 25: visual support for rectangular&#xA;selection. However, I would like to set its width to one pixel when it's&#xA;“logical” width is zero columns of text. By default it's a bit too bold. Is&#xA;it possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it would be cool if it didn't “shift” text on the right side of the&#xA;selection when its width is zero.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-08-31T17:29:17.757" Title="How to control width of rectangular selection in Emacs 25?" Tags="|rectangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15206" PostTypeId="1" AcceptedAnswerId="18938" CreationDate="2015-08-31T13:12:40.037" Score="0" ViewCount="168" Body="&lt;p&gt;I have a vagrant machine for my Rails project. I would like to integrate Emacs with rspec, currently done by hand on a terminal (inside the vagrant machine).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;rspec-verify-all&lt;/code&gt; Emacs will try to execute rspec from local shared directory (not from Vagrant obviously) and this does not work, as the Rails environment is not set locally on my computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question: how to run rspec in Vagrant environment?&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="105" LastEditDate="2015-08-31T14:52:26.057" LastActivityDate="2016-04-16T04:48:39.187" Title="Vagrant Integration in rspec-mode" Tags="|ruby-mode|ruby|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15207" PostTypeId="2" ParentId="15198" CreationDate="2015-08-31T13:36:54.670" Score="14" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;As others have indicated, and as was explained in the page you link to, &lt;em&gt;output&lt;/em&gt; messages to the &lt;em&gt;echo area&lt;/em&gt; are logged in buffer &lt;code&gt;*Messages*&lt;/code&gt;. Clicking in the echo area brings up &lt;code&gt;*Messages*&lt;/code&gt;, where you can copy text normally.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the &lt;em&gt;minibuffer&lt;/em&gt;, which is for &lt;em&gt;input&lt;/em&gt; (as opposed to the &lt;em&gt;echo area&lt;/em&gt;, which is in the same place, and which is for &lt;em&gt;output&lt;/em&gt;), if you use normal, vanilla Emacs then you can just copy (and yank) there normally.  IOW, &lt;strong&gt;you can edit text in the minibuffer&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;#2 is not true, however, if you use something like &lt;em&gt;Ido&lt;/em&gt; mode.  That co-opts the normal editing behavior of the minibuffer for its own purposes.  Keys that would normally edit text in the minibuffer do not, when you are in Ido mode.&lt;/p&gt;&#xA;&lt;p&gt;(FWIW, &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;noreferrer&quot;&gt;Icicles&lt;/a&gt; does not do this. It lets you edit minibuffer text normally, Even more so than vanilla Emacs, in fact, in that &lt;code&gt;SPC&lt;/code&gt;, &lt;code&gt;?&lt;/code&gt;, and newline (&lt;code&gt;C-j&lt;/code&gt;) characters self-insert normally. Of course, &lt;code&gt;TAB&lt;/code&gt; and &lt;code&gt;RET&lt;/code&gt; are not normal editing keys in the minibuffer.)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As @wvxwv mentioned in a comment to your question, the &lt;em&gt;prompt&lt;/em&gt; area of the minibuffer is generally &lt;em&gt;read-only&lt;/em&gt; text. But you can certainly copy it. Just back into it (e.g. using &lt;code&gt;C-b&lt;/code&gt; or the left-arrow key) and copy text from the prompt normally (e.g., &lt;code&gt;C-SPC&lt;/code&gt; move cursor with &lt;code&gt;C-f&lt;/code&gt;, &lt;code&gt;M-f&lt;/code&gt;, etc., followed by &lt;code&gt;M-w&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;And then you can yank it anywhere, including in the minibuffer input area (after the prompt).&lt;/p&gt;&#xA;&lt;p&gt;(The prompt area is read-only, and some cursor movement keys will not move into it, simply for convenience.  For example, &lt;code&gt;C-a&lt;/code&gt; takes you to the beginning of your input area, not to the beginning of the line, which would be within the prompt area.  This is the reason for mentioning &lt;code&gt;C-b&lt;/code&gt;, as it is one way that you &lt;em&gt;can&lt;/em&gt; move the cursor into the prompt area.)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-08-31T14:38:44.520" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15208" PostTypeId="1" AcceptedAnswerId="15213" CreationDate="2015-08-31T14:11:31.393" Score="9" ViewCount="1249" Body="&lt;p&gt;I am trying to use Tramp with &lt;code&gt;auto-revert-tail-mode&lt;/code&gt; to perform a tail of a remote log. Every time the log updates (which is often), the screen briefly jumps to the bottom of the file and then back to my current location in the file. Is there a way to prevent these frequent jumps? I simply want to be able to browse and search the most updated version of the file, but without being sent to the bottom of the file during every update. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there any way to quiet/silence the frequent updates in the status bar? &quot;Tramp inserting:...&quot; &quot;Tramp encoding:....&quot;&lt;/p&gt;&#xA;" OwnerUserId="9369" LastEditorUserId="105" LastEditDate="2015-08-31T14:52:09.030" LastActivityDate="2015-08-31T16:48:27.690" Title="Using Tramp for logs" Tags="|tramp|ssh|remote|auto-revert-mode|logging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15209" PostTypeId="1" AcceptedAnswerId="54568" CreationDate="2015-08-31T14:16:32.743" Score="1" ViewCount="793" Body="&lt;p&gt;I use evil and &lt;a href=&quot;https://github.com/krisajenkins/evil-tabs&quot; rel=&quot;nofollow&quot;&gt;evil-tabs&lt;/a&gt; with Emacs and am quite comfortable with my setup except a few times when I have multiple splits open in a tab, using &lt;code&gt;:q&lt;/code&gt; ends up closing all the splits in the window. In Vim it will close only the split I am currently in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this part of &lt;code&gt;evil-tabs.el&lt;/code&gt; is responsible:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-command evil-tab-sensitive-quit (&amp;amp;optional bang)&#xA;  :repeat nil&#xA;  (interactive &quot;&amp;lt;!&amp;gt;&quot;)&#xA;  (if (&amp;gt; (length (elscreen-get-screen-list)) 1)&#xA;    (elscreen-kill)&#xA;    (evil-quit bang)))&#xA;(evil-ex-define-cmd &quot;q[uit]&quot; 'evil-tab-sensitive-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried doing the following in my &lt;code&gt;.emacs&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; `:quit` ends up quitting more than I intended. So rebind that.&#xA;(evil-ex-define-cmd &quot;q[uit]&quot; 'kill-buffer-and-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-tabs&#xA;  ;; `:quit` ends up quitting more than I intended. So rebind that.&#xA;  '(evil-ex-define-cmd &quot;q[uit]&quot; 'kill-buffer-and-window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;:q&lt;/code&gt; again closes the whole tab. Any clues on how to change or debug this?&lt;/p&gt;&#xA;" OwnerUserId="9193" LastEditorUserId="9193" LastEditDate="2015-08-31T14:30:34.350" LastActivityDate="2019-12-28T21:54:56.157" Title="Redefine evil-ex-command" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15210" PostTypeId="2" ParentId="15092" CreationDate="2015-08-31T14:48:39.190" Score="2" Body="&lt;p&gt;Have you tried setting environment variable &lt;code&gt;LANG&lt;/code&gt; to your language? Similarly, variables &lt;code&gt;LC_TIME&lt;/code&gt; etc. - see the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/General-Variables.html&quot; rel=&quot;nofollow&quot;&gt;General Variables&lt;/a&gt;. That node also mentions MS Windows in particular: &lt;code&gt;Control Panel&lt;/code&gt; &gt; &lt;code&gt;Regional Settings&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Language-Environments.html&quot; rel=&quot;nofollow&quot;&gt;Language Environments&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this helps, it might help to know that I found these nodes (and more) by using &lt;code&gt;i&lt;/code&gt; in the Emacs manual. I typed &lt;code&gt;locale&lt;/code&gt; at the prompt. &lt;code&gt;TAB&lt;/code&gt; then shows you index entries that start with &lt;code&gt;locale&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Since I use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;, I use &lt;code&gt;S-TAB&lt;/code&gt; to see index entries that match &lt;code&gt;locale&lt;/code&gt; also as a substring, which picks up a couple more entries, such as &lt;code&gt;set-locale-environment&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-31T14:48:39.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15211" PostTypeId="2" ParentId="15198" CreationDate="2015-08-31T14:48:44.450" Score="5" Body="&lt;p&gt;You can select and copy the text of the prompt in the minibuffer (normally), if you move the point using any moving commands just one position after the prompt, and then &lt;kbd&gt;C-b&lt;/kbd&gt; to move the point over the right boundary of the prompt.  After you do it, you can use other navigation and selection commands on the prompt text.  This can be achieved normally by using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Fields.html#Fields&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;Fields&lt;/code&gt;&lt;/a&gt; BTW, it works the same way with the prompt of most shells run by Emacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also query for the contents of minibuffer programmatically (however it returns the entire history of the minibuffer, not just the visible text) by using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-Contents.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;minibuffer-contents-no-properties&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-08-31T14:48:44.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15212" PostTypeId="1" CreationDate="2015-08-31T16:09:19.043" Score="1" ViewCount="840" Body="&lt;p&gt;I am working on a local file and I will see these TRAMP messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for YYY@XXX.XXX.com using ssh...&#xA;Tramp: Sending command `exec ssh -l YYY  -o ControlPath=/var/folders/4c/5l5ydzjx1jqbjc3t60t41vpc0000gn/T/tramp.40799Yr1.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none XXX.XXX.com'&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Tramp: Sending password&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Tramp: Found remote shell prompt on `XXX.XXX.com'&#xA;Tramp: Opening connection for YYY@XXX.XXX.com using ssh...done&#xA;Making tags-file-name local to TAGS while let-bound!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is emacs automatically establishing a remote connection? &#xA;Why is it automatically building a TAGS file? &#xA;How can disable these two features?&#xA;Where are the references to the TAGS files stored, so one can edit it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At one point this froze emacs to the point C-g repeatedly did not help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My machine was disconnected from the network and was able to catch this new error which likely seems related, as I was not working on a remote file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Company: An error occurred in auto-begin&#xA;Company: Back-end (company-dabbrev-code company-gtags company-etags company-keywords) error &quot;Tramp failed to connect.  If this happens repeatedly, try&#xA;    `M-x tramp-cleanup-this-connection'&quot; with args (candidates CpF)&#xA;Company: An error occurred in auto-begin&#xA;Company: Back-end (company-dabbrev-code company-gtags company-etags company-keywords) error &quot;File /ssh:***@***.com/project/TAGS does not exist&quot; with args (candidates CpFq)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still don't know how to resolve the issue, but hopefully this will provide a clue.&lt;/p&gt;&#xA;" OwnerUserId="6877" LastEditorUserId="6877" LastEditDate="2015-09-08T16:10:49.223" LastActivityDate="2015-09-08T16:10:49.223" Title="Emacs hangs to due to looking for TAGS file on remote machine" Tags="|company-mode|tramp|ctags|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15213" PostTypeId="2" ParentId="15208" CreationDate="2015-08-31T16:48:27.690" Score="13" Body="&lt;p&gt;&lt;code&gt;auto-revert-tail-mode&lt;/code&gt; is great, but it has its limits. Therefore I prefer to use an asynchronous shell command. Open the remote directory in &lt;code&gt;dired&lt;/code&gt;, position the cursor to the file you want to watch, and apply &lt;code&gt;! tail -f * &amp;amp;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to suppress Tramp messages, decrease the verbosity. &lt;code&gt;(setq tramp-verbose 1)&lt;/code&gt; shall be sufficient.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-08-31T16:48:27.690" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15214" PostTypeId="2" ParentId="15163" CreationDate="2015-08-31T17:08:38.097" Score="0" Body="&lt;p&gt;Apparently some setting in your Emacs Live setup overrides the loaded theme's background-color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you are a new to Emacs, I heartily recommend that you start with an empty init file and go from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not because those starter kits are bad, some are in fact rather &lt;a href=&quot;https://github.com/purcell/emacs.d&quot; rel=&quot;nofollow&quot;&gt;beautiful&lt;/a&gt;, but it's much harder to troubleshoot problems in some big starter kit, than if you start with a clean init.el and gradually add stuff. If things stop working then, you know exactly what you did, and you can easily revert those changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without knowing for what you are using Emacs, a minimal emacs setup could look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An empty folder &lt;code&gt;~/.emacs.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This folder contains the file &lt;code&gt;init.el&lt;/code&gt; with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This enables the &lt;a href=&quot;http://melpa.org/#/&quot; rel=&quot;nofollow&quot;&gt;melpa&lt;/a&gt; package archive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you have access to ~2.500 packages, among them gems like magit, use-package, paredit, flycheck, company, expand-region, avy, ... .&lt;/p&gt;&#xA;" OwnerUserId="312" LastActivityDate="2015-08-31T17:08:38.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15215" PostTypeId="2" ParentId="15212" CreationDate="2015-08-31T17:09:23.633" Score="3" Body="&lt;p&gt;Please be more clear about exactly what you are doing wrt &quot;&lt;em&gt;working on a local file&lt;/em&gt;&quot;, so people can better help you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(From those messages, I don't think Emacs is building a TAGS file here, but it is using a TAGS file.)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use &lt;code&gt;recentf-mode&lt;/code&gt; then check your recent files.  If one of them is remote then that's probably your problem.  Remove it and make &lt;code&gt;recentf&lt;/code&gt; behave.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can prevent the saving of remote file names by recentf by customizing &lt;code&gt;recentf-exclude&lt;/code&gt;, so that it includes a remote host, for example.  You can also customize &lt;code&gt;recentf-keep&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some uses of file-name completion might include remote files or directories among the candidates to match, in which case Tramp can be accessed automatically.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Similarly, if you are somehow using a TAGS file, and if that file includes stuff from remote files, then that could explain what you are seeing.  Check any TAGS files you think you might be using.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Possibly some other code you are using is testing for a file's remoteness by actually accessing it, instead of using, say, &lt;code&gt;file-remote-p&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Again, give us more information and people might be able to help you more.  A step-by-step recipe to repro the problem, especially one that starts from &lt;code&gt;emacs -Q&lt;/code&gt; (no init file), is the best way to tell us what you are doing.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-31T17:09:23.633" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15216" PostTypeId="2" ParentId="15205" CreationDate="2015-08-31T17:29:17.757" Score="1" Body="&lt;p&gt;It seems as of now there is no (non-hacking) way to achieve what you want. Looking at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/rect.el#n808&quot; rel=&quot;nofollow&quot;&gt;source code&lt;/a&gt; an overlay with a space is added when the rectangle is of zero width.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-08-31T17:29:17.757" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15217" PostTypeId="1" AcceptedAnswerId="15235" CreationDate="2015-08-31T18:28:25.310" Score="0" ViewCount="2055" Body="&lt;p&gt;emacs version: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of&#xA;  2014-03-07 on lamiak, modified by Debian&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;M-x flycheck version: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Flycheck version: 0.25alpha (package: 20150821.47)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;M-x flycheck-verify-setup:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Syntax checkers for buffer file.c in c-mode:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c/c++-clang&lt;br&gt;&#xA;      - predicate:  nil&lt;br&gt;&#xA;      - executable: Not found  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c/c++-gcc&lt;br&gt;&#xA;      - predicate:  t&lt;br&gt;&#xA;      - executable: Found at /usr/bin/gcc  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c/c++-cppcheck&lt;br&gt;&#xA;      - predicate:  t&lt;br&gt;&#xA;      - executable: Found at /usr/bin/cppcheck  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Flycheck Mode is enabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;M-x flycheck-gcc-include &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[NO MATCH]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I enable flycheck-gcc-* commands to define inc dirs?&lt;/p&gt;&#xA;" OwnerUserId="9372" LastActivityDate="2015-09-01T12:47:51.857" Title="Emacs flycheck add include directory, no flycheck-gcc-*" Tags="|flycheck|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15218" PostTypeId="1" CreationDate="2015-08-31T18:29:10.093" Score="2" ViewCount="198" Body="&lt;p&gt;In Dired Query and Replace, can we substitute in the filename being visited? For example, I want to substitute &quot;solve&quot; in all *.mod files with the filename *.mod. &lt;/p&gt;&#xA;" OwnerUserId="9373" LastActivityDate="2015-08-31T19:58:10.390" Title="substitute in the filename" Tags="|regular-expressions|query-replace|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15219" PostTypeId="2" ParentId="15181" CreationDate="2015-08-31T18:56:46.570" Score="4" Body="&lt;p&gt;Adding some additional &lt;code&gt;HIGHLIGHT&lt;/code&gt; parameters to your list should do it. As stated in Emacs' documentation for the variable &lt;code&gt;compilation-error-regexp-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Additional &lt;code&gt;HIGHLIGHT&lt;/code&gt;s take the shape &lt;code&gt;(SUBMATCH FACE)&lt;/code&gt;, where&#xA;  &lt;code&gt;SUBMATCH&lt;/code&gt; is the number of a submatch and &lt;code&gt;FACE&lt;/code&gt; is an expression&#xA;  which evaluates to a face name (a symbol or string).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, it should reduce to something like the following:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'compilation-error-regexp-alist-alist&#xA;             '(my-message&#xA;               &quot;^\\(\\(ERRR\\|CRIT\\|ALRT\\|EMRG\\)\\|\\(WARN\\|NTCE\\)\\|\\(INFO\\|DEBG\\)\\) .*\\[\\(\\([^ \n]+\\):\\([0-9]+\\)\\)\\]$&quot;&#xA;               6 7 nil (3 . 4) 5&#xA;               (2 compilation-error-face)&#xA;               (3 compilation-warning-face)&#xA;               (4 compilation-info-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another, more verbose solution might be to define multiple regular expressions for your different levels, so that all groups always match.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'compilation-error-regexp-alist 'my-message-error)&#xA;(add-to-list 'compilation-error-regexp-alist 'my-message-warning)&#xA;(add-to-list 'compilation-error-regexp-alist 'my-message-info)&#xA;(add-to-list 'compilation-error-regexp-alist-alist&#xA;     '(my-message-error&#xA;       &quot;^\\(ERRR\\|CRIT\\|ALRT\\|EMRG\\) .*\\[\\(\\([^ \n]+\\):\\([0-9]+\\)\\)\\]$&quot;&#xA;       3 4 nil nil 2&#xA;       (1 compilation-error-face)))&#xA;(add-to-list 'compilation-error-regexp-alist-alist&#xA;     '(my-message-warning&#xA;       &quot;^\\(WARN\\|NTCE\\) .*\\[\\(\\([^ \n]+\\):\\([0-9]+\\)\\)\\]$&quot;&#xA;       3 4 nil 1 2&#xA;       (1 compilation-warning-face)))&#xA;(add-to-list 'compilation-error-regexp-alist-alist&#xA;     '(my-message-info&#xA;       &quot;^\\(INFO\\|DEBG\\) .*\\[\\(\\([^ \n]+\\):\\([0-9]+\\)\\)\\]$&quot;&#xA;       3 4 nil 0 2&#xA;       (1 compilation-info-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-09-01T18:45:13.183" LastActivityDate="2015-09-01T18:45:13.183" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15220" PostTypeId="2" ParentId="15218" CreationDate="2015-08-31T19:10:57.980" Score="1" Body="&lt;p&gt;You are probably asking for writable dired (wdired) feature. In any open dired buffer, make it writable with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then use search/replace as any normal buffer to substitute &quot;solve&quot; with whatever you want. Notice only the filenames are editable. Once you finish editing the filenames, you need to commit the changes with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or if you want to undo or cancel the changes, use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c ESC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-08-31T19:10:57.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15221" PostTypeId="2" ParentId="15193" CreationDate="2015-08-31T19:24:47.300" Score="10" Body="&lt;p&gt;I stumbled across an answer to this... &lt;a href=&quot;https://stackoverflow.com/questions/13559061/emacs-how-to-keep-the-indentation-level-of-a-very-long-wrapped-line&quot;&gt;on StackOverflow&lt;/a&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the package &lt;a href=&quot;http://elpa.gnu.org/packages/adaptive-wrap-0.4.el&quot; rel=&quot;noreferrer&quot;&gt;Adaptive-Wrap&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's pretty nice, there's an &quot;extra indent&quot; option you can use for the wrapped line, though no max indent (but seems like it could be added with just a line or two of code).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author of the Stack Overflow post, &lt;a href=&quot;https://stackoverflow.com/users/1225607/francesco&quot;&gt;Francesco&lt;/a&gt;, gives us the basic commands, and adds the snippet below to his &lt;code&gt;init.el&lt;/code&gt; file. I tried adding it to my &lt;code&gt;.emacs&lt;/code&gt; file. So far so good! At least in JavaScript and Clojure.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;After having installed the package, just run the following commands:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;code&gt;M-x visual-line-mode RET&lt;/code&gt; (to wrap long lines)&lt;/li&gt;&#xA;  &lt;li&gt;&lt;code&gt;M-x adaptive-wrap-prefix-mode RET&lt;/code&gt; (to make wrapped lines indent nicely)&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (fboundp 'adaptive-wrap-prefix-mode)&#xA;  (defun my-activate-adaptive-wrap-prefix-mode ()&#xA;    &quot;Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously.&quot;&#xA;    (adaptive-wrap-prefix-mode (if visual-line-mode 1 -1)))&#xA;  (add-hook 'visual-line-mode-hook 'my-activate-adaptive-wrap-prefix-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is more about it, comments etc., at &lt;a href=&quot;https://stackoverflow.com/questions/13559061/emacs-how-to-keep-the-indentation-level-of-a-very-long-wrapped-line&quot;&gt;the original post on Stack Overflow from 2012&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-08-31T23:23:44.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15223" PostTypeId="2" ParentId="15218" CreationDate="2015-08-31T19:58:10.390" Score="2" Body="&lt;p&gt;I'm guessing that what you want to do is this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Find all files whose names match &lt;code&gt;*.mod&lt;/code&gt; and whose contents contain the word &lt;code&gt;solve&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Replace the word &lt;code&gt;solve&lt;/code&gt; in each of those files with the name of the file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If so, one answer might be to use &lt;code&gt;Q&lt;/code&gt; in Dired, searching for &lt;code&gt;solve&lt;/code&gt;, and to use a replacement expression such as &lt;code&gt;\,(buffer-file-name)&lt;/code&gt;, to replace &lt;code&gt;solve&lt;/code&gt; with the name of the file currently visited (where the &lt;code&gt;solve&lt;/code&gt; occurrence is).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want, you can also issue a &lt;code&gt;find&lt;/code&gt; command using &lt;code&gt;find-dired.el&lt;/code&gt;, to open Dired with just the files that contain &lt;code&gt;solve&lt;/code&gt;.  And then use &lt;code&gt;Q&lt;/code&gt; on all of them (just mark them all, or use &lt;code&gt;C-u C-u Q&lt;/code&gt; with &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;Dired+&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-08-31T19:58:10.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15224" PostTypeId="1" AcceptedAnswerId="24079" CreationDate="2015-08-31T22:30:44.627" Score="4" ViewCount="815" Body="&lt;p&gt;I'm trying to run mutt in ansi-term in the GUI on OS X. The refresh rate is really slow for some reason, so when I try to navigate between emails the result is pretty much unreadable. Has anyone found a workaround for this / is there a dedicated emacs mutt front end? Also, apparently this problem is way old. &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/bk8pd/best_emacs_mail_client_for_a_mutt_user/&quot; rel=&quot;nofollow&quot;&gt;https://www.reddit.com/r/emacs/comments/bk8pd/best_emacs_mail_client_for_a_mutt_user/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="454" LastEditDate="2016-06-21T03:57:10.083" LastActivityDate="2016-06-26T21:41:35.900" Title="mutt (and others) in ansi-term - terrible refresh rate" Tags="|ansi-term|term|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15225" PostTypeId="2" ParentId="13772" CreationDate="2015-08-31T22:40:00.113" Score="0" Body="&lt;p&gt;I just create the new branch with &lt;code&gt;b c&lt;/code&gt; and then edit the &lt;code&gt;.git/config&lt;/code&gt; file to point to &lt;code&gt;origin/branch&lt;/code&gt; rather than monkeying around with all the magit 2 stuff, which doesn't seem to work anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[branch &quot;fix_something&quot;]&#xA;  remote = .&#xA;  merge = refs/heads/master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[branch &quot;fix_something&quot;]&#xA;  remote = origin&#xA;  merge = refs/heads/fix_something&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works, whereas I still haven't found a key combination in magit2 that accomplishes the same thing.  Trying to set the remote doesn't work because it doesn't exist on origin yet.&lt;/p&gt;&#xA;" OwnerUserId="8936" LastEditorUserId="8936" LastEditDate="2015-08-31T22:47:48.593" LastActivityDate="2015-08-31T22:47:48.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15226" PostTypeId="1" CreationDate="2015-08-31T23:33:08.710" Score="0" ViewCount="146" Body="&lt;p&gt;Here is the error when semantic by default add &lt;code&gt;wisent-python-default-setup&lt;/code&gt; into hook &lt;code&gt;python-mode-hook&lt;/code&gt;.&#xA;It's shown in minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Makeing python-shell-interpreter-args local to &lt;em&gt;Python Internal[ org-src-fontification:python-mode]&lt;/em&gt; while let-bound!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It happens when I open Org-buffer with Babel Python code block, and python source code file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found relative issue here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/jorgenschaefer/elpy/issues/531&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jorgenschaefer/elpy/issues/531&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then I try to remove this from hook by the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(remove-hook 'python-mode-hook 'wisent-python-default-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this does not work, after Emacs finished start, I check out &lt;code&gt;python-mode-hook&lt;/code&gt;, it's still over there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess maybe semantic is enabled after my upper &quot;removing it from hook&quot;. But I don't know when and where. (Maybe someone can tell me how to debug it)&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="5187" LastEditDate="2015-09-01T20:22:09.300" LastActivityDate="2015-09-01T20:22:09.300" Title="Can't disable semantic wisent-python-default-setup on python-mode-hook" Tags="|python|semantic-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15228" PostTypeId="1" AcceptedAnswerId="16315" CreationDate="2015-09-01T02:48:31.017" Score="10" ViewCount="4787" Body="&lt;p&gt;I'm exporting a simple org-table through LaTeX to PDF:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| a | b | c |&#xA;| 1 | 2 | 3 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After export with &lt;code&gt;C-c C-e l o&lt;/code&gt; the PDF contains a centered table, and I'd rather have it on the left (to be clear, I'm referring here to the &lt;em&gt;table as a whole&lt;/em&gt;, not the positioning of elements in individual cells).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not an expert at LaTeX. I've looked at &lt;code&gt;:float&lt;/code&gt; and &lt;code&gt;:placement&lt;/code&gt; in the Org manual &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot;&gt;here&lt;/a&gt; and haven't been able to affect the outcome. How could I accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2019-09-15T02:58:55.087" Title="org-mode table exports centered - change to left?" Tags="|org-export|org-table|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15229" PostTypeId="1" AcceptedAnswerId="15230" CreationDate="2015-09-01T03:16:45.820" Score="1" ViewCount="314" Body="&lt;p&gt;I'd like to run a function whenever the current directory in &lt;code&gt;eshell&lt;/code&gt; changes (like a &lt;code&gt;eshell-chdir-hook&lt;/code&gt;, but that doesn't exist). How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-09-01T03:56:36.447" Title="Eshell: run function when changing directory" Tags="|eshell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15230" PostTypeId="2" ParentId="15229" CreationDate="2015-09-01T03:56:36.447" Score="2" Body="&lt;p&gt;Well duh. The answer is to use &lt;code&gt;eshell-directory-change-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-09-01T03:56:36.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15231" PostTypeId="1" AcceptedAnswerId="17864" CreationDate="2015-09-01T04:37:06.990" Score="8" ViewCount="1193" Body="&lt;p&gt;I have a large org-mode file containing handouts for a class. Each handout is a separate toplevel subtree (*). At the top of my org file, I have options:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: author:nil email:nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is followed by various handouts subtrees:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Handout #1&#xA;** Some things about this handout&#xA;** Other things&#xA;&#xA;* Handout #2&#xA;** Some things&#xA;** More things&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On these individual handouts, I sometimes wish to override the &lt;code&gt;OPTIONS&lt;/code&gt; settings at the top when I export to PDF. In the &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot; rel=&quot;noreferrer&quot;&gt;export settings&lt;/a&gt; section of the org manual, it suggests you can set specific export settings for a subtree, viz:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Handout #1&#xA;#+EXPORT_OPTIONS: email:t&#xA;** Things&#xA;** More things&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried this, but it doesn't work as I'd like. Here, for instance, when I export the subtree for Handout #1 (&lt;code&gt;C-c C-e C-s l o&lt;/code&gt;) my email does appear at the top of the PDF, but then it also appears at the top of the Handout #2 PDF when I export the Handout #2 subtree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to set persistent &lt;code&gt;OPTIONS&lt;/code&gt; at the top of the file that can be turned on or off for a subtree without affecting other subtrees. How could this be done? If it can't be, is there an approach that would work similarly to what I'm searching for?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-09-12T01:53:10.227" LastActivityDate="2023-03-06T20:51:40.387" Title="org-mode: override buffer-local options in subtree export" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15233" PostTypeId="1" AcceptedAnswerId="15250" CreationDate="2015-09-01T11:56:59.843" Score="6" ViewCount="1235" Body="&lt;p&gt;I'm trying to hide the modeline whenever helm pops up. I have configure helm to always show up at the bottom.  It should look like this (two windows above the helm completion window):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZxrqK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZxrqK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Opposed of the regular way, where modelines from &lt;code&gt;*scratch*&lt;/code&gt; and &lt;code&gt;test.el&lt;/code&gt; buffer are shown like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pbM8M.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pbM8M.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to hide the modeline only in the bottom windows so if there are other windows above, their modeline should still be visible like this (three windows above the helm completion window):  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5NqlT.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5NqlT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written the following code to achieve this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-mode-line ()&#xA;  &quot;toggles the visibility of modeline in bottom windows&quot;&#xA;  (interactive)&#xA;  (dolist (current-window (window-list))&#xA;    (with-current-buffer (window-buffer current-window)&#xA;      (unless (window-in-direction 'below current-window)&#xA;        (setq mode-line-format &#xA;              (unless mode-line-format&#xA;                (default-value 'mode-line-format)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now this has to be called before helm is activated to make the modeline invisible and after helm was activated it has to be called again to make it visible again. So far the following code works for hiding it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'helm-before-initialize-hook 'helm-toggle-mode-line) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I couldn't find a way to make it visible again when the completion buffer is gone. This does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'helm-exit-minibuffer-hook 'toggle-mode-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this does not work, too:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'helm-cleanup-hook 'toggle-mode-line) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the proper way to achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following works if I select a command in the helm completion buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'helm-before-action-hook 'toggle-mode-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I still don't know how to make it visible again when I quit with &lt;code&gt;C-g&lt;/code&gt; or calling &lt;code&gt;helm-keyboard-quit&lt;/code&gt;. I tried this but it dosen't work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key helm-map (kbd &quot;C-q&quot;) 'my-helm-keyboard-quit)&#xA;&#xA;(defun my-helm-keyboard-quit ()&#xA;  (interactive)&#xA;  (helm-keyboard-quit)&#xA;  (message &quot;this and the line below is not called for some reason&quot;)&#xA;  (toggle-mode-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-01T22:37:54.107" LastActivityDate="2017-04-30T17:50:27.543" Title="Hide modeline in all bottom windows while helm is active?" Tags="|helm|mode-line|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15234" PostTypeId="1" AcceptedAnswerId="15236" CreationDate="2015-09-01T12:44:33.040" Score="5" ViewCount="225" Body="&lt;p&gt;How to detect if the point is at a closing delimiter? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in Elisp: &lt;code&gt;)&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;in LaTeX: &lt;code&gt;}&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2017-02-08T00:26:46.463" LastActivityDate="2017-02-08T00:26:46.463" Title="How to detect if the point is at a closing delimiter?" Tags="|regular-expressions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15235" PostTypeId="2" ParentId="15217" CreationDate="2015-09-01T12:47:51.857" Score="1" Body="&lt;p&gt;&lt;code&gt;flycheck-gcc-include-path&lt;/code&gt; is a &lt;em&gt;variable&lt;/em&gt;, not a command.  You can change it globally with &lt;code&gt;M-x customize-variable RET flycheck-gcc-include-path&lt;/code&gt;, or per file or directory with &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;File Variables&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables&quot; rel=&quot;nofollow&quot;&gt;Directory Variables&lt;/a&gt; respectively.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-09-01T12:47:51.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15236" PostTypeId="2" ParentId="15234" CreationDate="2015-09-01T12:49:19.197" Score="7" Body="&lt;p&gt;This simple code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(looking-at &quot;\\s)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-09-01T12:49:19.197" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15237" PostTypeId="2" ParentId="15234" CreationDate="2015-09-01T12:55:31.847" Score="4" Body="&lt;p&gt;In a &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsSyntaxTable&quot; rel=&quot;nofollow&quot;&gt;syntax table&lt;/a&gt;, closing delimiters are denoted by &lt;code&gt;)&lt;/code&gt;.  You can check the syntax of the character at point with the following predicate function, which will return true if the character is a closing delimiter:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun close-delimiter-p ()&#xA;  &quot;Is character at point a closing delimiter according to the&#xA;syntax table?&quot;&#xA;  (eq ?\) (char-syntax (char-after))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-09-01T13:47:42.530" LastActivityDate="2015-09-01T13:47:42.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15238" PostTypeId="1" AcceptedAnswerId="15239" CreationDate="2015-09-01T14:57:28.450" Score="1" ViewCount="94" Body="&lt;p&gt;I installed the json-mode package, then added this to my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'json-mode)&#xA;(add-hook 'json-mode-hook 'hs-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After opening a json file, I used Describe-variable on hs-minor-mode and found it was set to true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try to use any of the keybindings listed on &lt;a href=&quot;http://www.emacswiki.org/emacs/HideShow#toc2&quot; rel=&quot;nofollow&quot;&gt;Hide Show&lt;/a&gt; they don't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try C-c C-c for example, it says it is undefined.  If I try C-c ESC C-h as shown in the example, the help window opens.  How do I make this work.&lt;/p&gt;&#xA;" OwnerUserId="9344" LastActivityDate="2015-09-01T15:02:40.810" Title="hs-minor-mode keybindings are undefined or bring up help window" Tags="|json|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15239" PostTypeId="2" ParentId="15238" CreationDate="2015-09-01T15:02:40.810" Score="2" Body="&lt;p&gt;So I realized my mistake shortly after submitting my question, and rather than deleting it I thought I'd answer in case someone else ends up here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of the keybindings on the &lt;a href=&quot;http://www.emacswiki.org/emacs/HideShow&quot; rel=&quot;nofollow&quot;&gt;Hide Show&lt;/a&gt; page are written in the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-&amp;lt;something&amp;gt; @ C-&amp;lt;something&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I took the @ to simply be a delimiter between the two chained commands, but it turns out it's literally an @ sign (silly me...).  So to execute the toggle hide/show command ( &lt;code&gt;C-c @ C-c&lt;/code&gt; ), for example, you need to type &lt;code&gt;C-c&lt;/code&gt; followed by &lt;code&gt;@&lt;/code&gt; (holding the shift key of course) followed by &lt;code&gt;C-c&lt;/code&gt;.  D'oh...&lt;/p&gt;&#xA;" OwnerUserId="9344" LastActivityDate="2015-09-01T15:02:40.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15240" PostTypeId="1" CreationDate="2015-09-01T16:49:48.593" Score="6" ViewCount="203" Body="&lt;p&gt;I've just switched to “I-beam” cursor shape, it's set this way:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default&#xA; cursor-type '(bar . 1)&#xA; cursor-in-non-selected-windows nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I create additional cursors they are displayed as filled boxes&#xA;(while “main” cursor is displayed according to my settings). This doesn't&#xA;look good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to control appearance of additional cursors? Ideally, they&#xA;should mimic appearance of “main” cursor.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-01T16:49:48.593" Title="How to control appearance of extra cursors?" Tags="|multiple-cursors|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15241" PostTypeId="2" ParentId="15233" CreationDate="2015-09-01T17:24:34.603" Score="0" Body="&lt;p&gt;If you really want to hide helm's informative mode line, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; Don't use helm's own displaying mode line function&#xA;(fset 'helm-display-mode-line #'ignore)&#xA;&#xA;(add-hook 'helm-after-initialize-hook&#xA;          (defun hide-mode-line-in-helm-buffer ()&#xA;            &quot;Hide mode line in `helm-buffer'.&quot;&#xA;            (with-helm-buffer&#xA;              (setq-local mode-line-format nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, you might also want to hide minibuffer content when turning on &lt;code&gt;helm-echo-input-in-header-line&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq helm-echo-input-in-header-line t)&#xA;;;; Hide minibuffer contents when the above option is on.&#xA;(add-hook 'helm-minibuffer-set-up-hook&#xA;          #'helm-hide-minibuffer-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-09-01T17:24:34.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15242" PostTypeId="1" CreationDate="2015-09-01T17:56:18.377" Score="2" ViewCount="160" Body="&lt;p&gt;The relevant section in my .emacs file looks as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smartparens)&#xA;(smartparens-global-mode t)&#xA;(require 'smartparens-config)&#xA;;; for erb&#xA;(sp-pair &quot;%&quot; &quot;%&quot; :wrap &quot;C-%&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am often getting extra sets of quotes when typing the final quote in a pair rather than the final quote being overwritten, as expected and am trying to figure out what the cases this happens in are, and if there is a resolution.  I a big part of the problem is that the closing pair member is the same as the opening pair member.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;&quot;&amp;lt;any single character&amp;gt;&amp;lt;backspace&amp;gt;&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typing the first quote generates the second, but when typing the above sequence, I would expect for the final quote to be overwritten, as it does when you omit the &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; keystroke.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;&quot;&quot;&lt;/code&gt; Outputs: &lt;code&gt;&quot;&quot;&quot;&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure if there is a good, general solution to this, as there may be cases in which this behaviour is desired.  Feel free to edit this question with more examples. &lt;/p&gt;&#xA;" OwnerUserId="9344" LastActivityDate="2016-01-17T14:23:37.740" Title="Smartparens generates nested quotes instead of overwriting final quote if backspace used in between quotes" Tags="|smartparens|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15243" PostTypeId="2" ParentId="10516" CreationDate="2015-09-01T18:02:58.127" Score="2" Body="&lt;p&gt;Fira Mono v3.2 adjusted the font's line height, which has made it usable by me in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/mozilla/Fira/issues/67&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mozilla/Fira/issues/67&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9384" LastActivityDate="2015-09-01T18:02:58.127" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15244" PostTypeId="2" ParentId="12234" CreationDate="2015-09-01T20:04:21.003" Score="4" Body="&lt;p&gt;I'd agree it's an inconsistency (w.r.t. other programming modes); I ended up here searching for the same answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, I found the answer in the &lt;strong&gt;python.el&lt;/strong&gt; source code (version 0.24.2) which contains:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you prefer &lt;em&gt;cc-mode&lt;/em&gt;-like &lt;em&gt;forward-sexp&lt;/em&gt; movement, setting&#xA;  &lt;em&gt;forward-sexp-function&lt;/em&gt; to nil is enough, You can do that using&#xA;  the &lt;em&gt;python-mode-hook&lt;/em&gt;:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;        (lambda () (setq forward-sexp-function nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9385" LastActivityDate="2015-09-01T20:04:21.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15245" PostTypeId="1" AcceptedAnswerId="16415" CreationDate="2015-09-01T20:06:56.593" Score="2" ViewCount="486" Body="&lt;p&gt;I have a file &lt;code&gt;~/foo/contacts.csv&lt;/code&gt; whose first two columns look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Student ID,Student Name&#xA;firstID@foo.org,&quot;Lennon, John&quot;&#xA;secondID@foo.org,&quot;McCartney, Paul&quot;&#xA;thirdID@foo.org,&quot;Harrison, George&quot;&#xA;fourthID@foo.org,&quot;Starr, Ringo&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In actuality, the file has dozens of lines and several other columns. This file is updated every day (people are added and others are deleted).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to e-mail every person on this list using &lt;a href=&quot;http://www.emacswiki.org/emacs/mu4e&quot; rel=&quot;nofollow&quot;&gt;mu4e&lt;/a&gt;. Ideally this would be done so that each recipient cannot see the identities of the other receipts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does &lt;code&gt;mu4e&lt;/code&gt; have the capability to read my csv file so I can easily email the entire list under the pseudoname &lt;code&gt;My Class&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-09-03T07:13:56.963" LastActivityDate="2015-09-07T18:41:28.917" Title="Creating a contact group from a local file to use with mu4e" Tags="|email|mu4e|csv|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15246" PostTypeId="1" AcceptedAnswerId="15251" CreationDate="2015-09-01T20:18:37.767" Score="16" ViewCount="6311" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32)&#xA;of 2015-07-25 on KAEL&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;noreferrer&quot;&gt;Compiled from EmacsW64.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, using the latest version of  from MELPA&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows 7 x64 bit.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For example, I'm typing in the buffer foobarsentence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then start a new line below that, and typing fooba, I expected to get &lt;code&gt;foobarsentence&lt;/code&gt; suggested from the Company popup completion window. But there is no &lt;code&gt;foobarsentence&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found it out from another answer that I could use company-dabbrev`` for that, bound, &lt;kbd&gt;M-/&lt;/kbd&gt;. But I couldn't figure out how I could 'feed' the suggestions from &lt;code&gt;company-dabbrev&lt;/code&gt; into the popup-window. I made a screencast gif to made my question clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4urpE.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4urpE.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, &lt;kbd&gt;M-/&lt;/kbd&gt; calls &lt;code&gt;company-dabbrev&lt;/code&gt;. But I would like to see that suggested in the company completion popup. It surprised me this is not by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion in order to 'feed' the suggestions from &lt;code&gt;company-dabbrev&lt;/code&gt; to company popup window?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2021-10-11T01:10:17.657" Title="How add company-dabbrev to the Company completion popup?" Tags="|company-mode|abbrev|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15247" PostTypeId="1" AcceptedAnswerId="15265" CreationDate="2015-09-01T20:34:10.743" Score="11" ViewCount="654" Body="&lt;p&gt;As every Emacs'er will know, I'm currently suffering from my extensive dot-Emacs configuration. All my packages are within the containers of &lt;code&gt;use-package&lt;/code&gt;, and I bytecompiled all of my &lt;code&gt;.el&lt;/code&gt;-files.&#xA;Even with that, Emacs starts in 6.4 seconds, and then loads the rest of the packages (around 40 of them) afterwards. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking about another ways to solve the long startup time, then I noticed something. The default Emacs (without user configuration) uses many &lt;code&gt;.el&lt;/code&gt; libraries, which are included with every Emacs. They're located in &lt;code&gt;\shares\emacs\version number\lisp\&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even with many lisp files, it manages to get started in one second. When I was inspecting the files of many packages that are included with the default Emacs, I found nothing extraordinairy that could explain why Emacs manage to start within one second. Could anyone tell me how Emacs manages that, even with thousands &lt;code&gt;.el&lt;/code&gt;-files? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2017-02-08T00:26:10.257" LastActivityDate="2017-02-08T00:26:10.257" Title="How does Emacs manage to start instantaneously with many el-files?" Tags="|start-up|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15248" PostTypeId="2" ParentId="15247" CreationDate="2015-09-01T20:43:54.000" Score="10" Body="&lt;p&gt;Many of the included libraries are not loaded when you start up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some commands etc. are &lt;strong&gt;autoloaded&lt;/strong&gt;, which means that Emacs recognizes them and knows how to load them.  When you try to use a command that is autoloaded, Emacs then loads the library that defines it, if it has not yet been loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can create your own autoloads, whether for your own commands or commands in libraries you did not write.  See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html&quot;&gt;Autoload&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-01T20:44:53.690" LastActivityDate="2015-09-01T20:44:53.690" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15249" PostTypeId="2" ParentId="15233" CreationDate="2015-09-01T22:25:33.707" Score="1" Body="&lt;p&gt;The display has to be updated after the mode-line modification with &lt;code&gt;(redraw-display)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-mode-line ()&#xA;      &quot;toggles the visibility of modeline in bottom windows&quot;&#xA;      (interactive)&#xA;      (dolist (current-window (window-list))&#xA;        (with-current-buffer (window-buffer current-window)&#xA;          (unless (window-in-direction 'below current-window)&#xA;            (setq mode-line-format&#xA;                  (unless mode-line-format&#xA;                    (default-value 'mode-line-format))))))&#xA;      (redraw-display))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @xuchunyang has noted &lt;code&gt;my-helm-keyboard-quit&lt;/code&gt; does not work because everything is stopped before &lt;code&gt;toggle-mode-line&lt;/code&gt; is executed. To make it work after quitting helm I used the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-keyboard-quit-advice (orig-func &amp;amp;rest args)&#xA;  (interactive)&#xA;  (run-with-timer .03 nil 'toggle-mode-line)&#xA;  (apply orig-func args))&#xA;&#xA;&#xA;(advice-add 'helm-keyboard-quit :around #'helm-keyboard-quit-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-01T22:33:34.210" LastActivityDate="2015-09-01T22:33:34.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15250" PostTypeId="2" ParentId="15233" CreationDate="2015-09-01T23:43:44.907" Score="4" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; 1. Collect bottom buffers&#xA;(defvar bottom-buffers nil&#xA;  &quot;List of bottom buffers before helm session.&#xA;    Its element is a pair of `buffer-name' and `mode-line-format'.&quot;)&#xA;&#xA;(defun bottom-buffers-init ()&#xA;  (when bottom-buffers&#xA;    (bottom-buffers-show-mode-line))&#xA;  (setq bottom-buffers&#xA;        (cl-loop for w in (window-list)&#xA;                 when (window-at-side-p w 'bottom)&#xA;                 collect (with-current-buffer (window-buffer w)&#xA;                           (cons (buffer-name) mode-line-format)))))&#xA;&#xA;(add-hook 'helm-before-initialize-hook #'bottom-buffers-init)&#xA;&#xA;;; 2. Hide mode line&#xA;(defun bottom-buffers-hide-mode-line ()&#xA;  (mapc (lambda (elt)&#xA;          (with-current-buffer (car elt)&#xA;            (setq-local mode-line-format nil)))&#xA;        bottom-buffers))&#xA;&#xA;(add-hook 'helm-after-initialize-hook #'bottom-buffers-hide-mode-line)&#xA;&#xA;;; 3. Restore mode line&#xA;(defun bottom-buffers-show-mode-line ()&#xA;  (when bottom-buffers&#xA;    (mapc (lambda (elt)&#xA;            (with-current-buffer (car elt)&#xA;              (setq-local mode-line-format (cdr elt))))&#xA;          bottom-buffers)&#xA;    (setq bottom-buffers nil)))&#xA;&#xA;(add-hook 'helm-exit-minibuffer-hook #'bottom-buffers-show-mode-line)&#xA;&#xA;(defun helm-keyboard-quit-advice (orig-func &amp;amp;rest args)&#xA;  (bottom-buffers-show-mode-line)&#xA;  (apply orig-func args))&#xA;&#xA;(advice-add 'helm-keyboard-quit :around #'helm-keyboard-quit-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UO0KG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UO0KG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="-1" LastEditDate="2017-04-30T17:50:27.543" LastActivityDate="2017-04-30T17:50:27.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15251" PostTypeId="2" ParentId="15246" CreationDate="2015-09-02T02:51:26.313" Score="35" Body="&lt;p&gt;Here is how completion in company works (I am simplifying a bit; a more detailed description can be found in documentation of &lt;code&gt;company-backends&lt;/code&gt; &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;company-backends&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You have a list of backends (completion engines) which company should try to provide completion at point. Company tries each of these backends one after the another, and the first one that returns any candidates is used for completion; the rest of the backends are ignored. So by default, only one backend is used at a time.&lt;/p&gt;&#xA;&lt;p&gt;In your case (you seem in emacs-lisp-mode), emacs-lisp backend is returning candidates for completion, so &lt;code&gt;company-dabbrev&lt;/code&gt; is never used by company for completion; hence, you never get &lt;code&gt;foobarsentence&lt;/code&gt; in completion. So, you might want to change company-backends so that &lt;code&gt;company-dabbrev&lt;/code&gt; comes before &lt;code&gt;company-elisp&lt;/code&gt; (or &lt;code&gt;company-capf&lt;/code&gt; in recent emacsen). But I guess that is not what you want, since that would reverse the current situation and you will not get completions from emacs-lisp backend (in which case, read on).&lt;/p&gt;&#xA;&lt;p&gt;Company provides a way to merge completions from multiple sources using what it calls &lt;code&gt;grouped&lt;/code&gt; backends. Usually, the members of &lt;code&gt;company-backends&lt;/code&gt; are individual backends, but it can also be a list of backends; in which case, the completion from the backends are merged provided they return same &lt;code&gt;prefix&lt;/code&gt; or the text to be completed (please see documentation of &lt;code&gt;company-backends&lt;/code&gt; for detailed description).&lt;/p&gt;&#xA;&lt;p&gt;So, if you want to merge completions from &lt;code&gt;company-elisp&lt;/code&gt; (on recent emacsen &lt;code&gt;company-capf&lt;/code&gt; is used) and &lt;code&gt;company-dabbrev&lt;/code&gt;, simply do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'company-backends '(company-capf company-dabbrev))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Additionally, you can merge different backends using the &lt;code&gt;:with&lt;/code&gt; keyword&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'company-backends '(company-capf :with company-dabbrev))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is different from the previous example using a list of backends without &lt;code&gt;:with&lt;/code&gt;, since company will use only the backends before &lt;code&gt;:with&lt;/code&gt; for determining the &lt;code&gt;prefix&lt;/code&gt; (the text to be completed). This implies that the candidates from backends after &lt;code&gt;:with&lt;/code&gt; will be ignored by company, irrespective of whether the backends return a &lt;code&gt;prefix&lt;/code&gt; or no, if none of the backends before &lt;code&gt;:with&lt;/code&gt; return a &lt;code&gt;prefix&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You might want to set this locally in emacs-lisp buffer (I prefer doing so).&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="9652" LastEditDate="2021-10-11T01:10:17.657" LastActivityDate="2021-10-11T01:10:17.657" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="15252" PostTypeId="1" AcceptedAnswerId="15259" CreationDate="2015-09-02T02:53:24.317" Score="2" ViewCount="310" Body="&lt;p&gt;I'm looking for an org function to evaluate to the text of the current heading without full link text (just the descriptive form).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;*** Check out the new [[&lt;a href=&quot;https://www.google.com][Google]]&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com][Google]]&lt;/a&gt; logo!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;should&lt;/strong&gt; evaluate to &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Check out the new Google logo!&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;in contrast to the full heading with full link text (&lt;strong&gt;the undesired behavior&lt;/strong&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Check out the new [[&lt;a href=&quot;https://www.google.com][Google]]&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com][Google]]&lt;/a&gt; logo!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-heading-components&lt;/code&gt; for example returns the latter.  I'm looking for a DRY solution.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2016-06-22T20:35:36.633" LastActivityDate="2016-06-22T20:35:36.633" Title="Get org heading text with only descriptive link text?" Tags="|org-mode|header-line|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15253" PostTypeId="1" AcceptedAnswerId="15256" CreationDate="2015-09-02T03:42:24.333" Score="9" ViewCount="476" Body="&lt;p&gt;In a python file I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# python-shell-interpreter: &quot;python3&quot;&#xA;# python-shell-virtualenv-path: &quot;~/.virtualenvs/datascience&quot;&#xA;# leo-python-args-to-send: &quot;-f fqanalysis.txt&quot;&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a couple of days I want to use the python file without the specified virtualenv, so I would like to &lt;em&gt;comment out&lt;/em&gt; the line setting &lt;code&gt;python-shell-virtualenv-path&lt;/code&gt;, so that next time I open the python file in emacs &lt;code&gt;python-shell-virtualenv-path&lt;/code&gt; keeps its global value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# ;;python-shell-virtualenv-path: &quot;~/.virtualenvs/datascience&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## python-shell-virtualenv-path: &quot;~/.virtualenvs/datascience&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but on opening the python file I always get the error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File mode specification error: (error &quot;Malformed local variable line: ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I comment out the local variable line correctly?&lt;/p&gt;&#xA;" OwnerUserId="9387" LastActivityDate="2019-11-19T23:31:16.613" Title="How comment out a variable line in a local variable list" Tags="|comment|file-local-variables|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15254" PostTypeId="2" ParentId="5849" CreationDate="2015-09-02T04:20:27.023" Score="0" Body="&lt;p&gt;A classical trick is to use &lt;code&gt;(re-search-forward &quot;''\\([^']\\|'[^']\\)+, ''&quot;)&lt;/code&gt;. The group means &quot;no tick, or only one&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-09-02T04:20:27.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15255" PostTypeId="1" AcceptedAnswerId="28313" CreationDate="2015-09-02T05:11:38.630" Score="15" ViewCount="2279" Body="&lt;p&gt;How can I insert the file name of the active file buffer into a command?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I invoke a command that needs a file name, I am often doing so from a file buffer and want the name of that file &lt;em&gt;while typing&lt;/em&gt; the command into the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a hypothetical &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;…&lt;/kbd&gt; that I can type during forming a command line in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if, while the current buffer is a file named &lt;code&gt;Lorem Ipsum.txt&lt;/code&gt;, I type this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x grep RET 'foo' SPC C-x … RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;kbd&gt;grep&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt; presents a minibuffer prompting for the &lt;code&gt;grep&lt;/code&gt; command. In response, I've typed the regex pattern argument (&lt;kbd&gt;'foo'&lt;/kbd&gt;) and inserted the filename argument (&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;…&lt;/kbd&gt;). That minibuffer will end up as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;grep -nH -e 'foo' 'Lorem Ipsum.txt'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What existing command gets the current file buffer's file name like this? What is its default key binding?&lt;/p&gt;&#xA;" OwnerUserId="2506" LastEditorUserId="2609" LastEditDate="2015-09-02T06:50:21.900" LastActivityDate="2018-05-29T15:44:56.717" Title="Put the current file name in the minibuffer" Tags="|files|minibuffer|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15256" PostTypeId="2" ParentId="15253" CreationDate="2015-09-02T05:19:32.480" Score="8" Body="&lt;p&gt;Based on a quick check of &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Specifying File Variables&lt;/code&gt;, I'm reasonably sure that you can't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think your options are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Move the comment outside of the local variables block.&lt;/li&gt;&#xA;&lt;li&gt;Change the variable (e.g. give it a prefix like &lt;code&gt;DISABLED:&lt;/code&gt;) such that the value is simply assigned to a variable which nothing uses.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to have to approve a bunch of &lt;code&gt;DISABLED:foo&lt;/code&gt; variables for &lt;code&gt;safe-local-variable-values&lt;/code&gt;, you could adapt the approach to take advantage of the fact that successive entries clobber earlier ones if the same variable name is used.  Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# #: python-shell-interpreter: &quot;python3&quot;&#xA;# #: python-shell-virtualenv-path: &quot;~/.virtualenvs/datascience&quot;&#xA;# leo-python-args-to-send: &quot;-f fqanalysis.txt&quot;&#xA;# #: &amp;lt;comment&amp;gt;&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These still aren't comments, but it does mean you only have a &lt;em&gt;single&lt;/em&gt; local variable named &lt;code&gt;#&lt;/code&gt; (or &lt;code&gt;\#&lt;/code&gt; in this instance) with the value &lt;code&gt;&amp;lt;comment&amp;gt;&lt;/code&gt;, and Emacs won't query you about the earlier ones; so you could re-use this approach in other files and only end up with a single &lt;code&gt;safe-local-variable-values&lt;/code&gt; entry for all such 'commented' values, so long as that &lt;code&gt;#: &amp;lt;comment&amp;gt;&lt;/code&gt; entry always comes last.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(YMMV; this is only lightly tested, and is obviously a hack workaround.  Note also that you needn't use the actual comment character, as it's actually a variable name, so you can call it whatever you want, so long as it's not likely to conflict with any 'proper' variable name.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could ditch the need for a &lt;code&gt;#: &amp;lt;comment&amp;gt;&lt;/code&gt; entry but still avoid being asked questions if you added the following to your config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put '\# 'safe-local-variable (lambda (_) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which says &quot;ALL values for the variable &lt;code&gt;#&lt;/code&gt; are safe.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2019-11-19T23:31:16.613" LastActivityDate="2019-11-19T23:31:16.613" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="15257" PostTypeId="2" ParentId="15255" CreationDate="2015-09-02T05:54:01.170" Score="20" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What existing command gets the current file buffer's file name like this? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Unfortunately there is no ready made command for this, but we can make one as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun name-of-the-file ()&#xA;  &quot;Gets the name of the file the current buffer is based on.&quot;&#xA;  (interactive)&#xA;  (insert (buffer-file-name (window-buffer (minibuffer-selected-window)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The magic is in the &lt;strong&gt;minibuffer-selected-window&lt;/strong&gt; function; it does the right thing by picking the last buffer before the minibuffer was activated. Otherwise using just the &lt;strong&gt;buffer-file-name&lt;/strong&gt; won't get us the filename into the minibuffer. Interestingly, the same function can be used in a regular buffer or minibuffer to insert the file name. No special treatment is needed.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What is its default key binding?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is none, but you can pick a convenient one and assign it as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c f&quot;) 'name-of-the-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put the above lisp code lines in your init.el file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works in most trivial cases, but hard to predict what conflicts it might have with whatever modes you have active when invoking this function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if the buffer is not visiting a valid filename, such as the scratch buffer? Then this error is shown in the echo area:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;name-of-the-file: Wrong type argument: char-or-string-p, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Picking a valid buffer with a proper filename before invoking the shortcut will avoid such errors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several other solutions like the above, but they mainly differ in how they handle exceptions or overrides for any conflicts. For example, some employ mode-hooks to make this function available only in certain modes.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-09-02T06:41:49.373" LastActivityDate="2015-09-02T06:41:49.373" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15258" PostTypeId="1" AcceptedAnswerId="15263" CreationDate="2015-09-02T11:09:22.123" Score="1" ViewCount="120" Body="&lt;p&gt;&lt;strong&gt;TASK 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;C-h f goto-line&lt;/code&gt;(or any other function) it will open help buffer with clickable text like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/l6d4i.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/l6d4i.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I click this text, it will open that file in a new buffer and it will take to that definition. But the &lt;strong&gt;point will be on last line&lt;/strong&gt; like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QFGvx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QFGvx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TASK 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I call &lt;code&gt;(recenter 0)&lt;/code&gt;, it will place point in top line like this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hcvYq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hcvYq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I link both of these tasks, so that every time I click on a button it will place point on top line of buffer? I couldn't find any useful hooks to do these.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="253" LastEditDate="2015-09-10T13:22:19.317" LastActivityDate="2015-09-10T13:22:19.317" Title="Recenter buffer when clickable text is clicked?" Tags="|hooks|align|help|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15259" PostTypeId="2" ParentId="15252" CreationDate="2015-09-02T11:43:10.243" Score="1" Body="&lt;p&gt;I'm not sure about how generic this will be, but at least it looks short enough to try:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-strip-links (text)&#xA;  (replace-regexp-in-string&#xA;   org-any-link-re&#xA;   (lambda (match)&#xA;     (or (match-string 4 match) (match-string 2 match)))&#xA;   text))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that links are normally handled by backends in order to produce any kind of text, but I'm not exactly sure as to what makes links appear the way they do (and I'm doubtful the function may be reused to process strings).&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-09-02T11:43:10.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15260" PostTypeId="2" ParentId="15258" CreationDate="2015-09-02T11:55:57.773" Score="0" Body="&lt;p&gt;I think the problem is in your configuration. Maybe you have some lines for smooth scrolling in your .emacs... You can launch &lt;code&gt;emacs -q&lt;/code&gt; and try your scenario for testing.&#xA;For smooth scrolling you can do something like this:    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq scroll-margin 3)&#xA;(setq scroll-step 0)&#xA;(setq scroll-conservatively 10)&#xA;(setq scroll-preserve-screen-position t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-09-02T11:55:57.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15261" PostTypeId="2" ParentId="15252" CreationDate="2015-09-02T12:08:26.867" Score="1" Body="&lt;p&gt;I was hoping that &lt;code&gt;org-copy-visible&lt;/code&gt; but apparently it does only skips hidden subtrees. So here is an alternative version (inspired by &lt;code&gt;org-copy-visible&lt;/code&gt;'s code) which copies only visible text &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;(defun my-copy-only-visible-text ()&#xA;  (interactive)&#xA;  (kill-new (apply #'string (delq nil ; Last element is nil if region end corresponds to buffer end&#xA;                                  (cl-loop for point in (number-sequence (region-beginning) (region-end))&#xA;                                           unless (get-char-property point 'invisible)&#xA;                                           collect (char-after point))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-02T16:06:04.650" LastActivityDate="2015-09-02T16:06:04.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15262" PostTypeId="2" ParentId="13112" CreationDate="2015-09-02T12:31:35.810" Score="9" Body="&lt;p&gt;Okay, this was dumb ... I had an empty &lt;code&gt;Makefile&lt;/code&gt; sitting in my home directory. And because &lt;code&gt;Projectile Project Root Files Top Down Recurring&lt;/code&gt; tells Projectile to recognize a &lt;code&gt;Makefile&lt;/code&gt; as project root my home folder got picked up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just in case anybody has a similar problem in the future: If projectile picks up unwanted folders try to disable automatic project detection as a whole and see what happens. You can do that by using &lt;code&gt;M-x customize RET projectile RET&lt;/code&gt; and setting &lt;code&gt;Projectile Project Root Files Functions&lt;/code&gt; to an empty list. I figured out my problem after doing this &lt;strong&gt;and&lt;/strong&gt; manually deleting the incorrect projectile bookmark.&lt;/p&gt;&#xA;" OwnerUserId="542" LastActivityDate="2015-09-02T12:31:35.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15263" PostTypeId="2" ParentId="15258" CreationDate="2015-09-02T13:20:46.777" Score="3" Body="&lt;p&gt;After digging through source, I failed at finding any such hook. So as a final resort you can advice the function &lt;code&gt;help-button-action&lt;/code&gt; to recenter after jump.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-recenter-on-find-function (orig &amp;amp;rest args)&#xA;  (let ((result (apply orig args)))&#xA;    (when result&#xA;      (recenter))&#xA;    result))&#xA;&#xA;(advice-add 'help-button-action :around #'my-recenter-on-find-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The buttons in the help-buffer are &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/help-mode.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n193&quot; rel=&quot;nofollow&quot;&gt;defined&lt;/a&gt; using &lt;code&gt;define-button-type&lt;/code&gt;. While creating buttons one can attach additional properties to them, of these the property of interest to us is the &lt;code&gt;action&lt;/code&gt; property which is called whenever a button is hit. Additionally a button can inherit from other buttons (which basically means the default values from parent are inherited), in our case all the buttons in help buffer inherit from &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/help-mode.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n104&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;help-xref&lt;/code&gt;&lt;/a&gt; button which sets the &lt;code&gt;action&lt;/code&gt; property to &lt;code&gt;help-button-action&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All this is important because the buttons in help-buffer define the properties &lt;code&gt;help-function&lt;/code&gt; and &lt;code&gt;help-args&lt;/code&gt;, which are used by &lt;code&gt;help-button-action&lt;/code&gt; to jump to the definition. The interesting button here is &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/help-mode.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n193&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;help-function-def&lt;/code&gt;&lt;/a&gt;. We cannot advice the &lt;code&gt;help-function&lt;/code&gt; in this case since it is a lambda (and I am not sure there is any way to advice lambdas) so the only option left is advice &lt;code&gt;help-button-action&lt;/code&gt; &lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-02T15:40:52.857" LastActivityDate="2015-09-02T15:40:52.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15264" PostTypeId="1" CreationDate="2015-09-02T14:32:53.520" Score="3" ViewCount="445" Body="&lt;p&gt;I have worked around the problem by customizing org-src-preserve-indentation to true, but by default when I export my code snippets to pdf, My code winds up looking like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void foo()&#xA;{&#xA;^I//bla bla bla;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is kind of irritating.  Anyone know whats going on?  I am using xelatex for pdf generation (because of unicode in the sources), and minted for syntax highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a best way to get beatiful code formatting in my pdf?  Can I tell it to use clang-format from within xelatex?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Minumum Sample&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It took me a while to make a minimum sample, since the issue is configuration file, not the code snippet.  With the following as your .emacs, you should be able to reproduce the failure (you will need xelatex and the fontspec package of course).  I apologize that there's some unecessary noise form copy-pasting my custom-set-variables block, but it would have taken some effort for me to extract just the salient&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq-default c-basic-offset 4&#xA;                tab-width 4&#xA;                indent-tabs-mode t)&#xA;&#xA;  ;; ;; fontify code in code blocks&#xA;  (setq org-src-fontify-natively t)&#xA;  (setq org-latex-listings 'minted)&#xA;  ;; ;; Let the exporter use the -shell-escape option to let latex&#xA;  ;; ;; execute external programs.&#xA;  ;; ;; This obviously and can be dangerous to activate!&#xA;  (setq org-latex-pdf-process&#xA;        '(&quot;xelatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;))&#xA;&#xA;  (provide 'dotemacs)&#xA;  ;;; dotemacs.el ends here&#xA;  (custom-set-variables&#xA;   ;; custom-set-variables was added by Custom.&#xA;   ;; If you edit it by hand, you could mess it up, so be careful.&#xA;   ;; Your init file should contain only one such instance.&#xA;   ;; If there is more than one, they won't work right.&#xA;   '(org-latex-default-packages-alist&#xA;     (quote&#xA;      ((&quot;T1&quot; &quot;fontenc&quot; t)&#xA;       (&quot;&quot; &quot;fixltx2e&quot; nil)&#xA;       (&quot;&quot; &quot;graphicx&quot; t)&#xA;       (&quot;&quot; &quot;longtable&quot; nil)&#xA;       (&quot;&quot; &quot;float&quot; nil)&#xA;       (&quot;&quot; &quot;wrapfig&quot; nil)&#xA;       (&quot;&quot; &quot;rotating&quot; nil)&#xA;       (&quot;normalem&quot; &quot;ulem&quot; t)&#xA;       (&quot;&quot; &quot;amsmath&quot; t)&#xA;       (&quot;&quot; &quot;textcomp&quot; t)&#xA;       (&quot;&quot; &quot;marvosym&quot; t)&#xA;       (&quot;&quot; &quot;wasysym&quot; t)&#xA;       (&quot;&quot; &quot;amssymb&quot; t)&#xA;       (&quot;&quot; &quot;hyperref&quot; nil)&#xA;       &quot;\\tolerance=1000&quot;)))&#xA;   '(org-latex-packages-alist (quote ((&quot;&quot; &quot;fontspec&quot; t) (&quot;&quot; &quot;minted&quot; nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that, even a trivial (indented) code sample will produce the erroneous results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Foo&#xA;&#xA;    #+BEGIN_SRC C++&#xA;    void foo() &#xA;    {&#xA;        void bar = fb();&#xA;        std::cout &amp;lt;&amp;lt; &quot;fbar&quot; &amp;lt;&amp;lt; &quot;\n&quot;&#xA;    }&#xA;    #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(sorry, I don't know how to get an org src block to show up right on this sight).  Create an indented source code block to reproduce the error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which produces the following LaTeX:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   % Created 2015-09-02 Wed 23:17&#xA;   \documentclass[11pt]{article}&#xA;   \usepackage[T1]{fontenc}&#xA;   \usepackage{fixltx2e}&#xA;   \usepackage{graphicx}&#xA;   \usepackage{longtable}&#xA;   \usepackage{float}&#xA;   \usepackage{wrapfig}&#xA;   \usepackage{rotating}&#xA;   \usepackage[normalem]{ulem}&#xA;   \usepackage{amsmath}&#xA;   \usepackage{textcomp}&#xA;   \usepackage{marvosym}&#xA;   \usepackage{wasysym}&#xA;   \usepackage{amssymb}&#xA;   \usepackage{hyperref}&#xA;   \tolerance=1000&#xA;   \usepackage{fontspec}&#xA;   \usepackage{minted}&#xA;   \author{Glen Stark}&#xA;   \date{\today}&#xA;   \title{sample}&#xA;   \hypersetup{&#xA;     pdfkeywords={},&#xA;     pdfsubject={},&#xA;     pdfcreator={Emacs 24.5.1 (Org mode 8.2.10)}}&#xA;   \begin{document}&#xA;&#xA;   \maketitle&#xA;   \tableofcontents&#xA;&#xA;   \section{Foo}&#xA;   \label{sec-1}&#xA;&#xA;   \begin{minted}[]{c++}&#xA;   void foo()&#xA;   {&#xA;       void bar = fb();&#xA;       std::cout &amp;lt;&amp;lt; &quot;fbar&quot; &amp;lt;&amp;lt; &quot;\n&quot;&#xA;   }&#xA;   \end{minted}&#xA;   % Emacs 24.5.1 (Org mode 8.2.10)&#xA;   \end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The whitespace in the minted block is a tab.  Obviously xelatex is inserting something funny in place of the tabs.  Unfortunately my companies coding standards are tabs not spaces, so it would be inconvenient to change this (more inconvenient than my current workaround).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone know what the fix is?&lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="247" LastEditDate="2015-09-04T10:21:38.497" LastActivityDate="2017-10-08T22:21:14.657" Title="Org export to pdf inserts ^I for indentation in code" Tags="|org-mode|org-export|pdf|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15265" PostTypeId="2" ParentId="15247" CreationDate="2015-09-02T16:37:05.653" Score="10" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Could anyone tell me how Emacs manages that, even with thousands .el-files?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs &quot;manages&quot; that by not loading at startup thereby not holding up the loading of the core application. This in turn as the effect of returning keyboard control to the user faster. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when is it loaded? On first use of that function, mode, or feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doesn't it slow down? Yes, on first use. That's the trade-off. Do you want to slow-down at emacs startup time or on first use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it noticeable? Loading at startup time appears to take longer as other core libraries are also loaded. But on first use it feels faster as only that subset feature is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then why would anyone pick load on startup? Because some do not mind waiting to load all frequently used libraries on startup so once loaded all operations perform snappily thereafter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I choose? As Drew and others have pointed out in their responses to this very question, you can use autoload and similar tricks to control. But the most important consideration should be your usage pattern. If you happen to use emacs like vi, constantly opening and closing, yeah startup time becomes painfully obvious. But on the other hand, if you use emacs running all the time, startup time of 1 second or 1 minute won't be as noticeable or important enough to care.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/BatchMode&quot;&gt;batch mode&lt;/a&gt; or &lt;a href=&quot;https://www.gnu.org/software/zile/&quot;&gt;Zile&lt;/a&gt; for instant startup while testing, running, or otherwise using emacs like vi. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My preference is to load on startup so any errors are caught upfront. I prefer not to have to deal with any load errors while in the midst of a workday when I have countless buffers, modes, and compile states active along with several remote locations managed by TRAMP. Debugging autoload errors in such conditions is not very pleasant.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-02T16:37:05.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15266" PostTypeId="1" AcceptedAnswerId="17127" CreationDate="2015-09-02T18:36:10.777" Score="7" ViewCount="378" Body="&lt;p&gt;Is it possible to run &lt;code&gt;gnus&lt;/code&gt; or other things that tend to frequently block in a separate emacs instance and &quot;forward the buffers&quot; to the main emacs instance. I guess more generally I am wondering what kind of communication between emacs instances is possible.&lt;/p&gt;&#xA;" OwnerUserId="8921" LastActivityDate="2015-10-04T14:26:07.063" Title="View buffers managed by other emacs instance" Tags="|gnus|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15267" PostTypeId="2" ParentId="15245" CreationDate="2015-09-02T19:55:07.947" Score="1" Body="&lt;p&gt;AFAIK there is no built-in feature in &lt;code&gt;mu4e&lt;/code&gt; to achieve this.  However, &lt;code&gt;message-mode&lt;/code&gt; does support mail aliases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The procedure &lt;code&gt;(define-mail-abbrev NAME DEFINITION &amp;amp;optional FROM-MAILRC-FILE)&lt;/code&gt; could be used to define a name &quot;My Class&quot; that expands to the result of parsing the CSV file into a comma-separated list of strings.  When composing a message, type &quot;My Class&quot; and run &lt;code&gt;M-x expand-abbrev&lt;/code&gt; to expand the mail alias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The part that takes some effort is to parse the CSV file.  You also need to remember to do re-evaluate the procedure that creates the abbreviation from the result of parsing the CSV.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-09-02T19:55:07.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15268" PostTypeId="1" AcceptedAnswerId="16482" CreationDate="2015-09-02T20:10:26.373" Score="1" ViewCount="212" Body="&lt;p&gt;I'm not sure how to completely reproduce this.  It may be related to &lt;a href=&quot;https://emacs.stackexchange.com/questions/14077/emacsclient-doesnt-start-when-visiting-a-file-that-is-already-open&quot;&gt;this other question of mine&lt;/a&gt;. My hope is that someone else has seen this as well and knows what causes it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes when editing an emacs buffer, generally for a Python file, the buffer is out of date (usually because it has changed from git checkouts in other terminal tabs). So when I try to edit the buffer, it tells me that the file is out of date and if I want to edit it or revert it. I choose revert. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens then is that instead of reverting the file, it gets corrupted. In particular, it seems to insert chunks of the original file in the wrong place. For instance, the first 20 or so lines will be inserted twice. This error persists (but often with slightly different results) if I manually run &lt;code&gt;M-x revert-buffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, I always keep my files under revision control, so I can usually detect and fix these issues, but it's pretty annoying, and there is potential for it to screw me over pretty hard or even cause me to lose data. Any suggestions on what might be causing this are welcome. &lt;/p&gt;&#xA;" OwnerUserId="118" LastActivityDate="2015-09-09T21:51:34.087" Title="Get revert-buffer to stop corrupting my files" Tags="|revert-buffer|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="15269" PostTypeId="1" AcceptedAnswerId="16397" CreationDate="2015-09-02T20:16:34.347" Score="2" ViewCount="261" Body="&lt;p&gt;I've tried to create a tags table for my assembler project using:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;etags --language=none --regex=&quot;/[ \t]*\.\([^: \t]+\)/\1/i&quot; *.asm&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which does work to a degree, and indeed when I load the &lt;code&gt;TAGS&lt;/code&gt; file into Emacs, I see all the tags created just fine (from assembly labels).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem arises when I try and use &lt;code&gt;M-.&lt;/code&gt; to search for a specific tag. It only shows me a very small subset of the tags in the &lt;code&gt;*completions*&lt;/code&gt; buffer, despite all the tags seemingly present in the &lt;code&gt;TAGS&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of what I'm trying to match:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.t0 DCB 0&#xA;.t1 DCB 0&#xA;.t2 DCB 0&#xA;.t4 DCB 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet when I do &lt;code&gt;M-.&lt;/code&gt;, only the &lt;code&gt;t0&lt;/code&gt; tag will be listed in &lt;code&gt;*completions*&lt;/code&gt;. If I manually enter &lt;code&gt;t1&lt;/code&gt; it can jump straight to it!&lt;/p&gt;&#xA;" OwnerUserId="727" LastEditorUserId="727" LastEditDate="2015-09-04T22:09:32.707" LastActivityDate="2015-09-06T22:50:07.227" Title="Tags searching and completion" Tags="|completion|search|ctags|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15270" PostTypeId="1" AcceptedAnswerId="15272" CreationDate="2015-09-02T20:54:24.750" Score="63" ViewCount="22662" Body="&lt;p&gt;What is the Magit equivalent of &lt;code&gt;git add [--intent-to-add] &amp;lt;filename&amp;gt;&lt;/code&gt; for checking a newly created file into Git?&lt;/p&gt;&#xA;" OwnerUserId="8834" LastEditorUserId="16565" LastEditDate="2018-10-17T14:52:58.537" LastActivityDate="2018-10-17T14:52:58.537" Title="What's the Magit equivalent of 'git add'?" Tags="|magit|git|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="15271" PostTypeId="2" ParentId="15270" CreationDate="2015-09-02T20:58:16.470" Score="12" Body="&lt;p&gt;Start with &lt;code&gt;magit-status&lt;/code&gt;, then move to the file name under the &quot;Untracked files&quot; heading and hit &lt;code&gt;s&lt;/code&gt; to stage it.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-09-02T20:58:16.470" CommentCount="0" CommunityOwnedDate="2015-09-03T17:21:44.503" ContentLicense="CC BY-SA 3.0" />
  <row Id="15272" PostTypeId="2" ParentId="15270" CreationDate="2015-09-02T22:04:08.650" Score="66" Body="&lt;p&gt;To stage a change press &lt;kbd&gt;s&lt;/kbd&gt; with point on any &quot;stageable change&quot;. This includes files listed below &quot;Untracked files&quot; and &quot;Unstaged changes&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also expand the files below &quot;Unstaged files&quot; using &lt;kbd&gt;TAB&lt;/kbd&gt; (also works for many other sections) to see the hunks. You can then stage an individual hunk, again by pressing &lt;kbd&gt;s&lt;/kbd&gt; while point is inside it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can even stage just parts of a hunk using the region. To do that press &lt;kbd&gt;C-SPC&lt;/kbd&gt; to mark the beginning of the region and then &lt;kbd&gt;n&lt;/kbd&gt; a few times to move to where the region should end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to &lt;code&gt;git add --intent-to-add&lt;/code&gt;, use &lt;kbd&gt;C-u s&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also unstage, discard, reverse, and apply changes in a similar fashion. This is described in more detail in the manual. In particular see &lt;a href=&quot;http://magit.vc/manual/magit/Staging-and-unstaging.html&quot; rel=&quot;noreferrer&quot;&gt;Staging and unstaging&lt;/a&gt;, &lt;a href=&quot;http://magit.vc/manual/magit/Applying.html&quot; rel=&quot;noreferrer&quot;&gt;Applying&lt;/a&gt;, and &lt;a href=&quot;http://magit.vc/manual/magit/Sections.html&quot; rel=&quot;noreferrer&quot;&gt;Sections&lt;/a&gt;. Staging is also covered in &lt;a href=&quot;http://magit.vc/manual/magit/Getting-started.html&quot; rel=&quot;noreferrer&quot;&gt;Getting Started&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-06-21T15:21:33.073" LastActivityDate="2017-06-21T15:21:33.073" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15273" PostTypeId="1" AcceptedAnswerId="15274" CreationDate="2015-09-02T22:53:29.080" Score="2" ViewCount="221" Body="&lt;p&gt;It's time.  I've spent too long with too many pieces of elisp lying around in &lt;code&gt;site-lisp&lt;/code&gt;, outdated until I manually grab a new copy.  I am new to the ELPA/MELPA/&lt;code&gt;package.el&lt;/code&gt;/&lt;code&gt;el-get&lt;/code&gt; world, but have determined (okay, maybe 90% confident) from emacswiki and &lt;a href=&quot;https://emacs.stackexchange.com/q/268/2051&quot;&gt;this excellent question&lt;/a&gt; that MELPA is the way to go, but how, exactly do I do that?  There are some basic instructions for initial setup on the website, but it's not clear to me how I should migrate, and tell emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Which pieces to check on&lt;/li&gt;&#xA;&lt;li&gt;Where and how to store them&lt;/li&gt;&#xA;&lt;li&gt;What to do with my local copies&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2051" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-02T23:10:03.053" Title="Transitioning to MELPA" Tags="|package|package-repositories|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15274" PostTypeId="2" ParentId="15273" CreationDate="2015-09-02T23:04:57.907" Score="8" Body="&lt;h2&gt;Basic packages&lt;/h2&gt;&#xA;&lt;p&gt;The &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;noreferrer&quot;&gt;basic way&lt;/a&gt; to use packages^(1) is pretty simple:&lt;/p&gt;&#xA;&lt;p&gt;Add to your init file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&amp;quot;melpa&amp;quot; . &amp;quot;https://melpa.org/packages/&amp;quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&amp;quot;gnu&amp;quot; . &amp;quot;http://elpa.gnu.org/packages/&amp;quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then, run &lt;code&gt;M-x list-packages&lt;/code&gt; to get the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Menu.html#Package-Menu&quot; rel=&quot;noreferrer&quot;&gt;package menu&lt;/a&gt;. From this menu, you can search for packages, view descriptions, install, uninstall, and update packages. Press &lt;code&gt;i&lt;/code&gt; to mark a package for installation, &lt;code&gt;d&lt;/code&gt; for marking a package for uninstallation (deletion), or &lt;code&gt;U&lt;/code&gt; to mark all installed packages that can be upgraded for upgrading. Then, pressing &lt;code&gt;x&lt;/code&gt; will perform these actions.&lt;/p&gt;&#xA;&lt;h2&gt;Freedom from management&lt;/h2&gt;&#xA;&lt;p&gt;Using package installation will handle storing things for you; you don't have to worry about managing files or directories. Once you replace a locally-installed .el file with a package from a repository, you can get rid of the local file and the load instructions from your init file. You will need to keep any configuration of that package, however.&lt;/p&gt;&#xA;&lt;h2&gt;Advanced packages&lt;/h2&gt;&#xA;&lt;p&gt;Other methods include things like &lt;a href=&quot;http://cask.readthedocs.org/en/latest/&quot; rel=&quot;noreferrer&quot;&gt;Cask&lt;/a&gt;, which is a way of automating the management of installed packages. You have a file of packages you want installed, and you can have Cask do installations and upgrades automatically.&lt;/p&gt;&#xA;&lt;p&gt;[1] Note that this way of dealing with packages is not specific to MELPA -- it will work with the GNU ELPA repo, or Marmalade -- you just have to find the proper location to add to &lt;code&gt;'package-archives&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-09-02T23:10:03.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15275" PostTypeId="1" CreationDate="2015-09-03T02:00:44.350" Score="0" ViewCount="258" Body="&lt;p&gt;I am writing a mode that implements a persistent horizontal window (very similar to the &quot;persistence compile window&quot; in ECB).  While I did study the ECB code it is quite old and endeavored to work with even more ancient verions of emacs.  I am trying to write code the makes use of the many recent enhancements to emacs' windowing system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would appear that display-buffer-base-action is exactly the point in display-buffer's processing sequence to hook in my window management smarts.  I am able to classify newly created buffers base on buffer-name (e.g. &lt;em&gt;Completions&lt;/em&gt;) and on whether of not they are related to a live process (using comint-check-proc).  What I cannot do is classify a newly created buffer base on its ultimate major-mode.  This is because when display-buffer is called on a newly created buffer that buffer's major-mode has not yet been set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to &quot;peer into the future&quot; to determine what major-mode will later get established?&lt;/p&gt;&#xA;" OwnerUserId="443" LastEditorUserId="443" LastEditDate="2015-09-03T13:47:17.443" LastActivityDate="2015-09-03T13:47:17.443" Title="Is there a way for a display-buffer-base-action function to know the forthcoming major-mode?" Tags="|buffers|window|major-mode|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15276" PostTypeId="1" AcceptedAnswerId="15277" CreationDate="2015-09-03T02:19:32.040" Score="11" ViewCount="4499" Body="&lt;p&gt;I'm considering writing a major mode for editing Magic: the Gathering decks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of it seems pretty straightforward but I have one question. There are about 15 000 unique Magic cards available (cards with unique names that is). I would like to be able to complete against them by writing a completion-at-point-function. I've been looking for some simple, basic example of a capf function that just completes against a set of words to base my mode on but have failed to find anything so far. Do you know of any good example for this to get started? And do you believe it would be easy to get good performance or would I have to write my own data structure (I'm thinking like a Trie maybe).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously I'd need to find a way to sync with new cards etc and in the future maybe even be able to search for cards by other characteristics than just the card name but that can wait.&lt;/p&gt;&#xA;" OwnerUserId="450" LastActivityDate="2016-09-24T01:52:15.177" Title="How do I write a simple `completion-at-point-functions` function?" Tags="|completion|major-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15277" PostTypeId="2" ParentId="15276" CreationDate="2015-09-03T04:08:45.727" Score="22" Body="&lt;p&gt;&lt;strong&gt;Documentation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The API completion at point function can be found in the documentation of &lt;code&gt;completion-at-point-functions&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each function on this hook is called in turns without any argument and&#xA;  should return either nil to mean that it is not applicable at point,&#xA;  or a function of no argument to perform completion (discouraged), or a&#xA;  list of the form (START END COLLECTION . PROPS) where  START and END&#xA;  delimit the entity to complete and should include point, COLLECTION&#xA;  is the completion table to use to complete it, and PROPS is a property list &#xA;  for additional information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;start&lt;/code&gt;, &lt;code&gt;end&lt;/code&gt; and &lt;code&gt;props&lt;/code&gt; are obvious, but I think the format of &lt;code&gt;collection&lt;/code&gt; is not defined properly. For that you can see the documentation of &lt;code&gt;try-completion&lt;/code&gt; or &lt;code&gt;all-completions&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If COLLECTION is an alist, the keys (cars of elements) are the&#xA;  possible completions.  If an element is not a cons cell, then the&#xA;  element itself is the possible completion. If COLLECTION is a&#xA;  hash-table, all the keys that are strings or symbols are the possible&#xA;  completions. If COLLECTION is an obarray, the names of all symbols in&#xA;  the obarray are the possible completions.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;COLLECTION can also be a function to do the completion itself. It&#xA;  receives three arguments: the values STRING, PREDICATE and nil.&#xA;  Whatever it returns becomes the value of `try-completion'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a simple example of completion at point function which uses the words defined in &lt;code&gt;/etc/dictionaries-common/words&lt;/code&gt; to complete the words in the buffer&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar words (split-string (with-temp-buffer&#xA;                              (insert-file-contents-literally &quot;/etc/dictionaries-common/words&quot;)&#xA;                              (buffer-string))&#xA;                            &quot;\n&quot;))&#xA;&#xA;(defun words-completion-at-point ()&#xA;  (let ((bounds (bounds-of-thing-at-point 'word)))&#xA;    (when bounds&#xA;      (list (car bounds)&#xA;            (cdr bounds)&#xA;            words&#xA;            :exclusive 'no&#xA;            :company-docsig #'identity&#xA;            :company-doc-buffer (lambda (cand)&#xA;                                  (company-doc-buffer (format &quot;'%s' is defined in '/etc/dictionaries-common/words'&quot; cand)))&#xA;            :company-location (lambda (cand)&#xA;                                (with-current-buffer (find-file-noselect &quot;/etc/dictionaries-common/words&quot;)&#xA;                                  (goto-char (point-min))&#xA;                                  (cons (current-buffer) (search-forward cand nil t))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The completion function looks for word at point (the library &lt;code&gt;thingatpt&lt;/code&gt; is used to find the bounds of word) and completes it against the words in the &lt;code&gt;/etc/dictionaries-common/words&lt;/code&gt; file, the property &lt;code&gt;:exclusive&lt;/code&gt; is set to &lt;code&gt;no&lt;/code&gt; so that emacs can use other capf functions if our fails. Finally some additional properties are set to enhance the company-mode integration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The words file on my system had 99171 entries and emacs was able to complete them without any issues, so I guess 15000 entries should not be a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Integration with company-mode&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Company mode integrates very well with &lt;code&gt;completion-at-point-functions&lt;/code&gt; using the &lt;code&gt;company-capf&lt;/code&gt; backend, so it should work out of the box for you, but you can enhance the completions offered by company by returning additional &lt;code&gt;props&lt;/code&gt; in the result of capf function. The props currently supported are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:company-doc-buffer&lt;/code&gt; - Used by company to display metadata for current candidate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:company-docsig&lt;/code&gt; - Used by company to echo metadata about the candidate in the minibuffer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:company-location&lt;/code&gt; - Used by company to jump to the location of current candidate&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-03T04:08:45.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15278" PostTypeId="1" CreationDate="2015-09-03T05:47:46.000" Score="2" ViewCount="723" Body="&lt;p&gt;I send emails with &lt;kbd&gt;C-x m&lt;/kbd&gt; and AFAIK everything is configured&#xA;OK. However, recently I got this response when I wanted to send an email:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;smtpmail-send-it: Sending failed: 535 5.7.8 Error: authentication failed:&#xA;  Connection lost to authentication server in response to AUTH PLAIN &amp;lt;long&#xA;  hash here&amp;gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My second attempt resulted in (from &lt;code&gt;*Messages*&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sending via mail...&lt;br /&gt;&#xA;  Sending email&lt;br /&gt;&#xA;  Sending email done&lt;br /&gt;&#xA;  Sending...done&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why did it fail the first time?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Can I be sure that my email has been sent after all?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update: through experiments I've discovered the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This happens when title of email is written using Cyrillic script;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Email is delivered anyway on second attempt.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Seems it's sort of bug, but I will wait for additional clarification.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-09-03T07:53:17.950" LastActivityDate="2015-09-03T07:53:17.950" Title="Email sending failed" Tags="|email|smtpmail|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15279" PostTypeId="1" AcceptedAnswerId="15293" CreationDate="2015-09-03T06:55:21.017" Score="1" ViewCount="527" Body="&lt;p&gt;After updating my system my emacs windows have a resize grip in the bottom right corner. Is there a way to get rid of it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The grip does not appear on any other windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2015-09-03T16:56:31.840" Title="How can I disable the resize grip?" Tags="|window|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15280" PostTypeId="2" ParentId="15276" CreationDate="2015-09-03T08:36:02.200" Score="0" Body="&lt;p&gt;@Iqbal Ansari gave a great answer.&#xA;Here's a supplemental answer, hope it'll help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a implementation using emacs classic completion mechanism, 2009.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; this is your lang's keywords&#xA;(setq xyz-kwdList&#xA;      '(&quot;touch&quot;&#xA;       &quot;touch_start&quot;&#xA;       &quot;touch_end&quot;&#xA;       &quot;for&quot;&#xA;       &quot;foreach&quot;&#xA;       &quot;forall&quot;&#xA;       ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following is the code that does the completion.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xyz-complete-symbol ()&#xA;  &quot;Perform keyword completion on word before cursor.&quot;&#xA;  (interactive)&#xA;  (let ((posEnd (point))&#xA;        (meat (thing-at-point 'symbol))&#xA;        maxMatchResult)&#xA;&#xA;    ;; when nil, set it to empty string, so user can see all lang's keywords.&#xA;    ;; if not done, try-completion on nil result lisp error.&#xA;    (when (not meat) (setq meat &quot;&quot;))&#xA;    (setq maxMatchResult (try-completion meat xyz-kwdList))&#xA;&#xA;    (cond ((eq maxMatchResult t))&#xA;          ((null maxMatchResult)&#xA;           (message &quot;Can't find completion for “%s”&quot; meat)&#xA;           (ding))&#xA;          ((not (string= meat maxMatchResult))&#xA;           (delete-region (- posEnd (length meat)) posEnd)&#xA;           (insert maxMatchResult))&#xA;          (t (message &quot;Making completion list…&quot;)&#xA;             (with-output-to-temp-buffer &quot;*Completions*&quot;&#xA;               (display-completion-list &#xA;                (all-completions meat xyz-kwdList)&#xA;                meat))&#xA;             (message &quot;Making completion list…%s&quot; &quot;done&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Following's a implementation using ido-mode's interface. Much simpler.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun abc-complete-symbol ()&#xA;  &quot;Perform keyword completion on current symbol.&#xA;This uses `ido-mode' user interface for completion.&quot;&#xA;  (interactive)&#xA;  (let* (&#xA;         (bds (bounds-of-thing-at-point 'symbol))&#xA;         (p1 (car bds))&#xA;         (p2 (cdr bds))&#xA;         (current-sym&#xA;          (if  (or (null p1) (null p2) (equal p1 p2))&#xA;              &quot;&quot;&#xA;            (buffer-substring-no-properties p1 p2)))&#xA;         result-sym)&#xA;    (when (not current-sym) (setq current-sym &quot;&quot;))&#xA;    (setq result-sym&#xA;          (ido-completing-read &quot;&quot; xyz-kwdList nil nil current-sym ))&#xA;    (delete-region p1 p2)&#xA;    (insert result-sym)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll need to define xyz-kwdList as a list of your words.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-09-24T01:52:15.177" LastActivityDate="2016-09-24T01:52:15.177" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15281" PostTypeId="2" ParentId="10544" CreationDate="2015-09-03T09:38:48.180" Score="0" Body="&lt;p&gt;It might not be the &quot;Helm&quot; way, but I will argue that executing the first action with TAB instead of C-z is easier for my brain and hands. This is more evident when I want to traverse long directory structures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, I recommend rebinding C-z to Tab and viceversa. I have this in my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'helm-execute-persistent-action) ; rebind tab to do persistent action&#xA;(define-key helm-map (kbd &quot;C-i&quot;) 'helm-execute-persistent-action) ; make TAB works in terminal&#xA;(define-key helm-map (kbd &quot;C-z&quot;)  'helm-select-action) ; list actions using C-z&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9401" LastActivityDate="2015-09-03T09:38:48.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15283" PostTypeId="1" CreationDate="2015-09-03T10:31:25.870" Score="1" ViewCount="428" Body="&lt;p&gt;Since some time ago I've been having this message: &lt;code&gt;org-mode fontification error&lt;/code&gt; whenever I initialize &lt;code&gt;org-mode&lt;/code&gt; by opening an &lt;code&gt;org&lt;/code&gt; buffer. The initialization process will just get stuck and I have to press &lt;code&gt;C-g&lt;/code&gt; to get out of it. Strangely all seems to be working normally once I'm in &lt;code&gt;org-mode&lt;/code&gt;. All the source code blocks are fontified correctly with syntax highlighting, so I'm not sure what is the error referring to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was &lt;a href=&quot;https://emacs.stackexchange.com/questions/5461/fix-org-fontification-error&quot;&gt;a problem&lt;/a&gt; on this SE but the solution seems to not have solved the issue. Both the pre-installed &lt;code&gt;org&lt;/code&gt; and the newest &lt;code&gt;org&lt;/code&gt; induced the same error.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-09-03T10:31:25.870" Title="org-mode fontification error" Tags="|org-mode|faces|fonts|font-lock|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15285" PostTypeId="1" AcceptedAnswerId="15287" CreationDate="2015-09-03T14:19:13.890" Score="1" ViewCount="645" Body="&lt;p&gt;the following alias in the aliases file doesn't work in eshell 2.4.2, emacs 24.4.1&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;alias ff 'find-file $1' &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;error message as is is given below &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;find-file $1: command not found &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Any ideas what is going wrong?&lt;/p&gt;&#xA;" OwnerUserId="9404" LastActivityDate="2015-09-03T15:16:26.450" Title="eshell alias not working properly" Tags="|eshell|aliases|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15286" PostTypeId="2" ParentId="15270" CreationDate="2015-09-03T15:10:57.473" Score="12" Body="&lt;p&gt;If what you're looking for is a way to add/stage a file directly from its buffer: try the command &lt;code&gt;magit-stage-file&lt;/code&gt;. If you do that a lot you could bind it to a key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As others have already pointed out, the more common way to stage/add files is from the &lt;code&gt;magit-status&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-09-03T15:10:57.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15287" PostTypeId="2" ParentId="15285" CreationDate="2015-09-03T15:16:26.450" Score="3" Body="&lt;p&gt;You shouldn't quote name of command together with its argument. As written,&#xA;the code creates an alias for command named &lt;code&gt;find-file $1&lt;/code&gt; which doesn't&#xA;exist, of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to remove the quotes:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;alias ff find-file $1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-03T15:16:26.450" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15288" PostTypeId="1" AcceptedAnswerId="15290" CreationDate="2015-09-03T15:49:37.077" Score="5" ViewCount="1835" Body="&lt;p&gt;Been scouring the internet for a couple days now trying to figure out the solution to my question with no luck.  Hopefully someone here knows how to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently trying to set up my EMACS to be able to run a .bat file on my Windows 7 machine through the &quot;M-x shell&quot; command.  If I open up a shell and navigate to my directory and run BuildDTO.bat it works just fine.  I've also got an odd kind of solution that runs the command but only opens the output of the command in a buffer once it's finished running.  The code in my .emacs file is shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun compile ()&#xA;  &quot;Runs a quick compile on the code.  Note this is specific to this work environment.&quot;&#xA;  (interactive)&#xA;  (with-current-buffer&#xA;    (shell-command &quot;PATH_TO_BAT/BuildDTO.bat&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here I am binding the compile command to my &quot;M-m&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-m&quot;) 'compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My issue is that I want to maven going through the steps of compiling.  Going through &quot;M-x shell&quot; and running the DTO creates a nice scrolling buffer with the output of each step but the compile() function does not.  Any suggestions about how I could get this work?  I'm kind of new to EMACS so I apologize if this is a rather dumb question but I can't figure out the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="9406" LastActivityDate="2015-09-03T16:42:45.933" Title="Binding shell commands to hotkeys" Tags="|init-file|shell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15289" PostTypeId="1" AcceptedAnswerId="15296" CreationDate="2015-09-03T16:04:53.433" Score="7" ViewCount="537" Body="&lt;p&gt;&lt;code&gt;sort-fields&lt;/code&gt; and &lt;code&gt;sort-numeric-fields&lt;/code&gt; work great; but the field separator is whitespace. I would like to use a different delimiter (e.g.: [colon-char]).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want this feature because I find myself resorting the &lt;code&gt;passwd&lt;/code&gt; files records by UID via &lt;code&gt;vipw&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose I could start a shell and run something like &lt;code&gt;sort -n -t ':' -k3 /etc/passwd&lt;/code&gt; and replace; but that seems clumsy and &lt;code&gt;sort-numeric-fields&lt;/code&gt; is tantalizingly close to perfect.&lt;/p&gt;&#xA;" OwnerUserId="2350" LastActivityDate="2019-08-07T22:44:52.103" Title="Change field separator for sort-fields" Tags="|sorting|delimiters|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15290" PostTypeId="2" ParentId="15288" CreationDate="2015-09-03T16:10:14.600" Score="6" Body="&lt;p&gt;Emacs already has a command for doing what you want called &lt;code&gt;compile&lt;/code&gt;. So remove your custom function, restart emacs (this are needed to unload your definition of &lt;code&gt;compile&lt;/code&gt;) and then do &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;compile&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;PATH_TO_BAT/BuildDTO.bat&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of using &lt;code&gt;compile&lt;/code&gt; to run compilation is that it lists errors that occurred during compilation in form of clickable links which you can click to jump to directly to problematic file&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do this particular action frequently you can do one of the following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Set the &lt;code&gt;compile-command&lt;/code&gt; command on per directory basis using &lt;code&gt;Directory variables&lt;/code&gt;, see &lt;a href=&quot;https://emacs.stackexchange.com/a/706/247&quot;&gt;this&lt;/a&gt; for an example of this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Write a custom command, some thing like this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-compile ()&#xA;  (interactive)&#xA;  (compile &quot;PATH_TO_BAT/BuildDTO.bat&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-09-03T16:42:45.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15292" PostTypeId="2" ParentId="15288" CreationDate="2015-09-03T16:29:48.483" Score="3" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-compile ()&#xA;  (interactive)&#xA;  ;; Switch to `*shell*'&#xA;  (shell)&#xA;  ;; Goto last prompt, clear old input if any, and insert new one&#xA;  (goto-char (point-max))&#xA;  (comint-kill-input)&#xA;  (insert &quot;PATH_TO_BAT/BuildDTO.bat&quot;)&#xA;  ;; Execute&#xA;  (comint-send-input))&#xA;&#xA;(global-set-key (kbd &quot;M-m&quot;) 'my-compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-09-03T16:29:48.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15293" PostTypeId="2" ParentId="15279" CreationDate="2015-09-03T16:56:31.840" Score="1" Body="&lt;p&gt;Resize grip comes from your GTK theme and you need to disable it via GTK config or by not compiling Emacs with GTK toolkit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check your toolkit version with &lt;code&gt;M-x version&lt;/code&gt; (it should return message similar to &lt;em&gt;&quot;GNU Emacs 24.5.2 (x86_64-unknown-linux-gnu, &lt;strong&gt;GTK&lt;/strong&gt;+ Version &lt;strong&gt;2&lt;/strong&gt;.24.28&lt;/em&gt;…&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can set a GTK theme like e.g. &lt;em&gt;Numix&lt;/em&gt; which already handles your issue or adjust your current theme by adding following changes to &lt;code&gt;~/.gtkrc-2.0&lt;/code&gt; (if Emacs is compiled with GTK2):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;style &quot;default-style&quot;&#xA;{&#xA;  GtkWindow::resize-grip-height = 0&#xA;  GtkWindow::resize-grip-width = 0&#xA;}&#xA;class &quot;GtkWidget&quot; style &quot;default-style&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or to &lt;code&gt;~/.config/gtk-3.0/gtk.css&lt;/code&gt; (if Emacs is compiled with GTK3):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* {&#xA;    -GtkWindow-resize-grip-default: false;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Above examples are only presented as a guide; for details about adjusting GTK themes please consult your distro's documentation (or GTK documentation directly).&lt;/p&gt;&#xA;" OwnerUserId="220" LastActivityDate="2015-09-03T16:56:31.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15294" PostTypeId="1" CreationDate="2015-09-03T17:10:57.310" Score="8" ViewCount="1596" Body="&lt;p&gt;I can't seem to get completion when editing an org-babel source code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elpy and company-mode both appear to be enabled minor modes for the buffer, but no completion candidates appear as they do when I am editing a .py file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this have something to do with visiting a &quot;non-file&quot; buffer? Or am I misunderstanding something about how these things should be set up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin12.5.0, NS apple-appkit-1187.40)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Org-mode version 8.3.1 (release_8.3.1-196-ga395da)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Company version: 0.9.0-cvs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Elpy 1.9.0&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: To clarify, I am using C-c ' to open the org-babel block up in a dedicated &lt;em&gt;Org Src  [ python ]&lt;/em&gt; buffer. Within this buffer I was not getting the kind of autocompletion I expected, but this may have been a failure to understand the way autocompletion and company works. See my answer below.&lt;/p&gt;&#xA;" OwnerUserId="9409" LastEditorUserId="9409" LastEditDate="2015-09-04T04:17:50.863" LastActivityDate="2015-10-04T13:48:43.843" Title="Autocompletion using company in org src buffer?" Tags="|org-babel|company-mode|elpy|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15295" PostTypeId="1" AcceptedAnswerId="15300" CreationDate="2015-09-03T17:37:32.160" Score="5" ViewCount="919" Body="&lt;p&gt;I would like to use some python code with babel to output some computation result &lt;strong&gt;about the current org file&lt;/strong&gt;. As I'll be doing this quite often, I'd like ideally to have access to it's file name without hard-writing it's name in my code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :results output :exports results&#xA;with open(&quot;myself.org&quot;) as f:&#xA;    contents = f.read()&#xA;print &quot;Current org file line count: %d&quot; % len(contents.split(&quot;\n&quot;))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would want to get rid of the hard-writen &lt;code&gt;&quot;myself.org&quot;&lt;/code&gt;, which is supposed to point towards the current file name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any macro possibility in source code block that would insert the current org file's name in the some placeholder in this code block before evaluation ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there any way to add variables in python code scope to &lt;strong&gt;all code blocks&lt;/strong&gt; which would then allow access to the current file path at run time through variables or any other means ?&lt;/p&gt;&#xA;" OwnerUserId="9411" LastEditorUserId="9411" LastEditDate="2015-09-03T20:20:12.373" LastActivityDate="2015-09-04T05:39:12.977" Title="org-mode babel python code block to get current org file's location" Tags="|org-mode|python|literate-programming|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15296" PostTypeId="2" ParentId="15289" CreationDate="2015-09-03T18:11:21.977" Score="4" Body="&lt;p&gt;See the code for &lt;code&gt;sort-fields&lt;/code&gt;?  Have you tried substituting a regexp that matches your preferred separators for the hard-coded regexp in &lt;code&gt;sort-fields&lt;/code&gt;, which matches whitespace?  Untested whether just changing that regexp does the trick - but that would be the place to start, I think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This the &lt;code&gt;sort-fields&lt;/code&gt; code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun sort-fields (field beg end)&#xA;  &quot;...&quot;&#xA;  (interactive &quot;p\nr&quot;)&#xA;  (let ;; To make `end-of-line' and etc. to ignore fields.&#xA;      ((inhibit-field-text-motion t))&#xA;    (sort-fields-1 field beg end&#xA;           (function (lambda () (sort-skip-fields field) nil))&#xA;       (function (lambda () (skip-chars-forward &quot;^ \t\n&quot;))))))&#xA;                                             ;; ^^^^^^^^&#xA;                                             ;; CHANGE TO&#xA;                                             ;; MATCH YOUR SEPARATORS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, if such a change is sufficient then you might even consider requesting that Emacs Dev add an optional regexp arg that matches the separators.  To do that, use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-03T18:11:21.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15297" PostTypeId="2" ParentId="2797" CreationDate="2015-09-03T18:15:20.063" Score="10" Body="&lt;p&gt;I think the important part is &lt;code&gt;(package-initialize)&lt;/code&gt;. I'm not so sure you need the &lt;code&gt;package-enable-at-startup&lt;/code&gt; bit. So:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;(load-theme 'ample t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can also tell emacs to trust all your themes by default so you don't get prompted each time:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq custom-safe-themes t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The thing to keep in mind is that the order to everything is important. Depending on where in the file you're trying to load a theme, some of the above suggestions may or may not be necessary.&lt;/p&gt;&#xA;&lt;p&gt;I initialize packages and the MELPA repo at the very beginning of my &lt;code&gt;.emacs&lt;/code&gt; file which allows me to more easily reference MELPA loaded packages later in the file. I also set &lt;code&gt;custom-safe-themes&lt;/code&gt; so I don't have to worry about the fact that Custom is adding the trust info at the end of the file. Here's what I have:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(when (&amp;gt;= emacs-major-version 24)&#xA;  (require 'package)&#xA;  (package-initialize)&#xA;  (add-to-list 'package-archives&#xA;      '(&amp;quot;melpa&amp;quot; . &amp;quot;http://melpa.milkbox.net/packages/&amp;quot;) t)&#xA;)&#xA;(setq custom-safe-themes t)&#xA;&#xA;..later in the file..&#xA;&#xA;;; Load a nice theme if in GUI&#xA;(when (display-graphic-p)&#xA;  (load-theme 'ample t)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3949" LastEditorUserId="33634" LastEditDate="2021-05-01T03:30:18.720" LastActivityDate="2021-05-01T03:30:18.720" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="15298" PostTypeId="1" AcceptedAnswerId="16381" CreationDate="2015-09-03T18:58:56.760" Score="2" ViewCount="144" Body="&lt;p&gt;I'm using &lt;code&gt;file-notify-add-watch&lt;/code&gt; from &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/filenotify.el&quot; rel=&quot;nofollow&quot;&gt;filenotify.el&lt;/a&gt; to watch a dired directory so it can revert when a file is modified within the directory. This generally works, but I've noticed that it only works sometimes when renaming a file. Code is &lt;a href=&quot;https://github.com/cosmicexplorer/.emacs.d/blob/45ae1fbedd8424a48e3ae25937d4d1255a21ffa8/init-scripts/interface.el#L620&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I watch two directories (&lt;code&gt;~/&lt;/code&gt; and &lt;code&gt;~/readings&lt;/code&gt;, for example) and add a file &lt;code&gt;test.txt&lt;/code&gt; to &lt;code&gt;~/&lt;/code&gt;, filenotify catches that and reverts the buffer. When I run &lt;code&gt;mv test.txt readings&lt;/code&gt;, the event passed to the filenotify callback contains the sexp &lt;code&gt;'((&amp;lt;desc&amp;gt;) renamed &quot;~/readings/test.txt&quot; &quot;~/readings/test.txt&quot;)&lt;/code&gt;. When I move it back with &lt;code&gt;mv readings/test.txt .&lt;/code&gt; (while in &lt;code&gt;~/&lt;/code&gt;), the event passed to the callback is &lt;code&gt;'((&amp;lt;desc&amp;gt;) renamed &quot;~/test.txt&quot; &quot;~/test.txt&quot;)&lt;/code&gt;. So it seems to be passing not the previous and the new file, but just two of the new file's path. This could be a bug, but I'm not sure. For easier reading (&lt;code&gt;=&amp;gt;&lt;/code&gt; indicates the events passed to the callback within emacs):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo hey &amp;gt; test.txt&#xA;=&amp;gt; ((32) created &quot;~/test.txt&quot;)&#xA;=&amp;gt; ((32) changed &quot;~/test.txt&quot;)&#xA;$ mv test.txt readings&#xA;=&amp;gt; ((34) created &quot;~/readings/test.txt&quot;)&#xA;$ mv readings/test.txt .&#xA;=&amp;gt; ((32) renamed &quot;~/test.txt&quot; &quot;~/test.txt&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure this is a bug, but I wanted to make sure I wasn't using filenotify incorrectly. Adding the watch, I do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file-notify-add-watch&#xA;  (expand-file-name dired-directory)&#xA;  '(change attribute-change) #'my-callback)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which returns &lt;code&gt;32&lt;/code&gt; and &lt;code&gt;34&lt;/code&gt;, the two descriptors shown in the output above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug? Or is there some element of &lt;code&gt;file-notify-add-watch&lt;/code&gt; I'm using incorrectly? I would expect &lt;code&gt;mv &amp;lt;file&amp;gt; &amp;lt;folder&amp;gt;&lt;/code&gt; to create a &lt;code&gt;rename&lt;/code&gt; notification with both the previous and current version, but it's not doing that. I'm using emacs 25.0.50 on linux with &lt;code&gt;'inotify&lt;/code&gt; as a file notification library.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-09-04T10:00:46.150" LastActivityDate="2015-09-06T12:23:41.090" Title="file renaming not always caught by filenotify" Tags="|dired|files|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15299" PostTypeId="1" AcceptedAnswerId="16316" CreationDate="2015-09-03T19:21:09.807" Score="2" ViewCount="323" Body="&lt;p&gt;The way that I'm reloading the nrepl in Clojure seems too bulky. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I load a Clojure project and nrepl, I: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a keyboard macro to input and return something like &lt;code&gt;(use 'my-namespace.core :reload)&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Next I bind the keyboard macro to something else, usually &lt;code&gt;C-tab&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Finally, every time I switch into the nrepl, I execute &lt;code&gt;C-tab&lt;/code&gt;, and the repl reloads.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This seems like a lot of unnecessary work. I've looked around at getting the namespace programmatically, or with &lt;code&gt;C-c C-e&lt;/code&gt;, but nothing seems to fit quite right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't there an easier way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="247" LastEditDate="2015-09-04T03:23:17.660" LastActivityDate="2015-09-04T10:42:25.077" Title="Reloading Clojure nrepl automatically" Tags="|clojure|nrepl|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15300" PostTypeId="2" ParentId="15295" CreationDate="2015-09-03T19:21:51.577" Score="7" Body="&lt;p&gt;Please try a src block variable like: &lt;code&gt;:var fileName=(buffer-file-name)&lt;/code&gt; and then you have the current file name accessible in python in the variable named &lt;code&gt;fileName&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might set a property line in the begining of your file&#xA;&lt;code&gt;#+PROPERTY: header-args:python :var fileName=( buffer-file-name)&lt;/code&gt;&#xA;and you have the variable in ever python src block. Don't forget to initialise the line with &lt;kbd&gt;C-c C-c&lt;/kbd&gt;. Or reload the buffer into Emacs. &lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-09-04T05:39:12.977" LastActivityDate="2015-09-04T05:39:12.977" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15301" PostTypeId="1" CreationDate="2015-09-03T19:33:18.340" Score="4" ViewCount="108" Body="&lt;p&gt;This question is inspired by &lt;a href=&quot;https://stackoverflow.com/a/726942/&quot;&gt;https://stackoverflow.com/a/726942/&lt;/a&gt;. &#xA;I am wondering if it is possible to revert back a buffer to its state of x minutes ago.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-09-03T19:39:45.170" Title="Reverting back a buffer to what it was x minutes ago" Tags="|undo|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15302" PostTypeId="2" ParentId="15301" CreationDate="2015-09-03T19:39:16.167" Score="1" Body="&lt;p&gt;No, it isn't.  Emacs doesn't record timestamps when saving undo information.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-09-03T19:39:16.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15303" PostTypeId="1" AcceptedAnswerId="17195" CreationDate="2015-09-03T20:19:41.953" Score="3" ViewCount="1582" Body="&lt;p&gt;In emacs on Windows 8.1 I can't open a file if its full name contains Russian letters [and generally any non-ascii char]. For example, if I try to open &lt;code&gt;D:\ББББ\test.txt&lt;/code&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IBo5b.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IBo5b.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find a config which seems relevant:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-file-name-coding-system 'cp1251)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and also tried to set it to &lt;code&gt;utf-8&lt;/code&gt; -- but it doesn't help. I use same config as on linux where I never had problems like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using vanilla emacs 24.3 for windows and the issue is reproduced with &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using English version of Windows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;PS D:\&amp;gt; reg query &quot;hklm\system\controlset001\control\nls\language&quot; /v Installlanguage&#xA;&#xA;HKEY_LOCAL_MACHINE\system\controlset001\control\nls\language&#xA;    Installlanguage    REG_SZ    0409&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(code 0409 &lt;a href=&quot;https://stackoverflow.com/a/1610387/788700&quot;&gt;means it is English&lt;/a&gt;). However other programs, e.g. notepad++, can open the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 3&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Default code page is 437:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;C:\chcp&#xA;Active code page: 437&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it &lt;a href=&quot;https://en.wikipedia.org/wiki/Code_page_437&quot; rel=&quot;nofollow noreferrer&quot;&gt;doesn't have Russian chars&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 4&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Found &lt;a href=&quot;https://lists.gnu.org/archive/html/help-gnu-emacs/2004-08/msg00072.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;an old thread&lt;/a&gt; -- seems like the problem is still there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 5&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently one can't open file with unicode in its full name using emacsclient. I'm using the following workaround in order to open files with unicode in their names in an opened emacs: one can use a custom multi-commander command:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tk6Ad.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tk6Ad.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bind this to C-S-F4, and open dired in the respective folder, and browse to the file I want with dired. E.g. for d:\ББББ\test.txt I would open d:\ with C-S-F4 first, and browse to the test.txt with dired.&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-07T17:06:26.607" Title="Open Russian file names on windows?" Tags="|microsoft-windows|character-encoding|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="15304" PostTypeId="1" AcceptedAnswerId="16451" CreationDate="2015-09-03T20:21:56.843" Score="0" ViewCount="82" Body="&lt;p&gt;I added this to my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; Transparent Emacs   &#xA;  ;;(set-frame-parameter (selected-frame) 'alpha '(&amp;lt;active&amp;gt; [&amp;lt;inactive&amp;gt;]))&#xA;    (set-frame-parameter (selected-frame) 'alpha '(88 70))&#xA;    (add-to-list 'default-frame-alist '(alpha 88 70))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which make the background of emacs transparent. However when I removed this code from the init.el, the change persists. Why?&lt;/p&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-09-08T18:41:35.563" Title="Theme seems to be permanently changed" Tags="|themes|colors|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15305" PostTypeId="1" AcceptedAnswerId="15308" CreationDate="2015-09-03T20:26:32.193" Score="0" ViewCount="427" Body="&lt;p&gt;I want to execute evil-delete and then call a motion command. A simple example which does not work because evil waits for input after calling &lt;code&gt;evil-delete&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun does-not-work ()&#xA;  (call-interactively 'evil-delete)&#xA;  (call-interactively 'end-of-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command after &lt;code&gt;evil-delete&lt;/code&gt; is just in example. The real code I want to call expects additional input from the user. &lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-04T12:18:42.653" LastActivityDate="2015-09-04T12:18:42.653" Title="Call an evil-delete &gt; evil-motion operation from elisp?" Tags="|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15306" PostTypeId="1" AcceptedAnswerId="16322" CreationDate="2015-09-03T20:52:54.200" Score="9" ViewCount="2223" Body="&lt;p&gt;I'm using effort estimate with specification as &lt;code&gt;1d&lt;/code&gt; or &lt;code&gt;4:00&lt;/code&gt;, and these are correctly collected with the 8h a day in mind, but these are summed up the section hierarchy to count 24 hours a day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a very confusing &lt;code&gt;columnview&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+COLUMNS: %80ITEM(Tâche) %7Effort(Est){:}&#xA;#+BEGIN: columnview :maxlevel 2&#xA;| Tâche     |     Est |&#xA;|-----------+---------|&#xA;| * Group 1 |   16:00 |&#xA;| ** Task A |      1d |&#xA;| ** Task B |      1d |&#xA;| * Group 2 | 1d 0:00 |&#xA;| ** Task C |      1d |&#xA;| ** Task D |      2d |&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect that &lt;code&gt;1d + 2d&lt;/code&gt; would equal &lt;code&gt;3d&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I solve this ?&lt;/p&gt;&#xA;" OwnerUserId="9411" LastActivityDate="2018-10-11T11:30:31.350" Title="org-mode clock sum to count 8h a day and not 24" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15308" PostTypeId="2" ParentId="15305" CreationDate="2015-09-03T21:47:04.033" Score="3" Body="&lt;p&gt;First of all, if your goal is to translate something from a &lt;code&gt;.vimrc&lt;/code&gt;, it's as simple as &lt;code&gt;(define-key evil-normal-state-map (kbd ...) &quot;d$&quot;)&lt;/code&gt;.  If you want to write new commands to use from Evil, it's better to construct these from Emacs primitives and wrap them as needed with Evil macros.  But if you're just interested in how Evil works, then read on...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you've noticed already, if you're calling an operator like &lt;code&gt;evil-delete&lt;/code&gt; interactively, it will read in its arguments as specified by its &lt;code&gt;interactive&lt;/code&gt; spec.  Reading &lt;code&gt;evil-commands.el&lt;/code&gt; reveals that &lt;code&gt;evil-delete&lt;/code&gt; is defined with the &lt;code&gt;evil-define-operator&lt;/code&gt; macro which turns the rather unusual looking &lt;code&gt;&quot;&amp;lt;R&amp;gt;&amp;lt;x&amp;gt;&amp;lt;y&amp;gt;&quot;&lt;/code&gt; spec into something Emacs can deal with, a list evaluating to the desired values!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;evil-types.el&lt;/code&gt; has a listing of these codes.  &lt;code&gt;&amp;lt;x&amp;gt;&lt;/code&gt; is &lt;code&gt;evil-this-register&lt;/code&gt;, &lt;code&gt;&amp;lt;y&amp;gt;&lt;/code&gt; is &lt;code&gt;(evil-yank-handler)&lt;/code&gt;.  Since you haven't expressed interest in any of those (and the usage of &lt;code&gt;evil-delete&lt;/code&gt; as displayed by &lt;code&gt;F1 f evil-delete&lt;/code&gt; suggests they are optional anyways), let's take a closer look at &lt;code&gt;&amp;lt;R&amp;gt;&lt;/code&gt; which is using &lt;code&gt;(evil-operator-range t)&lt;/code&gt; to evaluate to a list looking like &lt;code&gt;(BEG END TYPE)&lt;/code&gt;.  &lt;code&gt;evil-operator-range&lt;/code&gt; reads in a motion, checks up on its properties (like, its type), then executes it to determine where the motion did begin and where it does end.  A motion in Evil is just an Emacs command taking point somewhere else after all...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, considering our type isn't &lt;code&gt;line&lt;/code&gt; or &lt;code&gt;block&lt;/code&gt; and &lt;code&gt;evil-delete&lt;/code&gt; doesn't care what other value it is, we'll go with &lt;code&gt;t&lt;/code&gt; for &lt;code&gt;TYPE&lt;/code&gt;. &lt;code&gt;BEG&lt;/code&gt; is going to be &lt;code&gt;(point)&lt;/code&gt; because we're deleting from where we are at, &lt;code&gt;END&lt;/code&gt; is set with &lt;code&gt;(move-end-of-line COUNT)&lt;/code&gt; in &lt;code&gt;evil-end-of-line&lt;/code&gt; and can be determined by wrapping it into &lt;code&gt;save-excursion&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-delete (point) (save-excursion (move-end-of-line 1) (point)) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can probably be simplified to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-delete (point) (line-end-position) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you don't need to do this with Evil (because you're writing a new command and don't actually need to repurpose it):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(delete-region (point) (line-end-position))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-09-03T21:47:04.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15309" PostTypeId="1" CreationDate="2015-09-04T00:39:18.173" Score="1" ViewCount="2293" Body="&lt;p&gt;I'd like to use the default prefix for &quot;time grids&quot; in org agenda, but set a custom prefix for other tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach could be to use a block agenda, with one block being just a time grid, and another block other just having non time-grid items. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to not have duplicate items in the block with the time grid, and the block with the custom prefix agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if there was a way to just get the default time-grid prefix when using a custom prefix for normal agenda items that would mean I wouldn't even need a block agenda. &lt;/p&gt;&#xA;" OwnerUserId="8234" LastEditorUserId="8234" LastEditDate="2015-09-06T20:59:07.430" LastActivityDate="2015-09-06T20:59:07.430" Title="Is there a way to show an agenda with just a time grid?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16309" PostTypeId="2" ParentId="15266" CreationDate="2015-09-04T05:12:46.827" Score="0" Body="&lt;p&gt;&lt;strong&gt;Emacsclient&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use instead of Emacs the Emacsclient. First you have to do a &lt;code&gt;(server-start)&lt;/code&gt; in your Emacs(en) and then run the client in its own frame with &lt;code&gt;emacsclient -c test.mac&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also distinguish different server files with the options &lt;code&gt;-f ServerFile&lt;/code&gt; (on Windows) or server names &lt;code&gt;-s ServerName&lt;/code&gt;. Please have a look at &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html&lt;/a&gt;.  To that end you have to set different server names for the different Emacsen: &lt;code&gt;(setq server-name &quot;Server1&quot;)&lt;/code&gt;, etc.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-09-04T08:37:43.490" LastActivityDate="2015-09-04T08:37:43.490" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16310" PostTypeId="1" CreationDate="2015-09-04T06:06:50.970" Score="4" ViewCount="698" Body="&lt;p&gt;I have a big org-mode file using tags and &lt;code&gt;TODO&lt;/code&gt; keywords and properties. I would like to display a summary of &quot;Effort&quot; estimates &lt;strong&gt;on&#xA;subsets&lt;/strong&gt; of the headings &lt;strong&gt;with sums as we go up in the section hierarchy&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Columnview is perfect for the summing part, except it lacks any means to filter headings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And clock table could display &lt;code&gt;Effort&lt;/code&gt; estimates (if listed in &lt;code&gt;:properties&lt;/code&gt;) and filter heading appropriately but won't sum &lt;code&gt;Effort&lt;/code&gt; estimate up along the heading hierarchy, and actually do not display any heading without CLOCK set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints on how I could achieve this ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I managed to do this thanks to org-babel and some external python code, but that's awfully complex.&lt;/p&gt;&#xA;" OwnerUserId="9411" LastEditorUserId="9411" LastEditDate="2015-09-07T06:58:38.773" LastActivityDate="2022-12-03T05:06:30.787" Title="How to limit exported column view to a filtered subset of your headings?" Tags="|org-mode|org-clock|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16311" PostTypeId="2" ParentId="9662" CreationDate="2015-09-04T06:26:12.677" Score="2" Body="&lt;p&gt;I finally figured out a pattern that worked by advising &lt;code&gt;ido-read-internal&lt;/code&gt; with an empty dynamic variable that would get set with a custom command bound to &lt;code&gt;ido-common-completion-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I published the idea as a package called &lt;a href=&quot;https://github.com/waymondo/ido-exit-target&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ido-exit-target&lt;/code&gt;&lt;/a&gt;, but here's the pattern that solves my question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (defvar ido-exit-target--target))&#xA;&#xA;(defun ido-exit-target-other-window ()&#xA;  &quot;Select the current `ido' item for `other-window'. It will create one if it doesn't exist.&quot;&#xA;  (interactive)&#xA;  (setq ido-exit-target--target 'other-window)&#xA;  (ido-exit-minibuffer))&#xA;&#xA;(defun ido-exit-target--switch-to-target (orig-fun &amp;amp;rest args)&#xA;  &quot;Advise `ido-read-internal' on where to view the chosen selection.&quot;&#xA;  (let* (ido-exit-target--target&#xA;         (res (apply orig-fun args)))&#xA;    (when (equal ido-exit-target--target 'other-window)&#xA;      (switch-to-buffer-other-window nil))&#xA;    res))&#xA;&#xA;(advice-add 'ido-read-internal :around #'ido-exit-target--switch-to-target)&#xA;&#xA;(define-key ido-common-completion-map (kbd &quot;&amp;lt;s-return&amp;gt;&quot;) #'ido-exit-target-other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="264" LastActivityDate="2015-09-04T06:26:12.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16313" PostTypeId="1" AcceptedAnswerId="16314" CreationDate="2015-09-04T09:09:04.593" Score="5" ViewCount="827" Body="&lt;p&gt;I use Emacs mostly to write R using &lt;a href=&quot;http://ess.r-project.org/&quot; rel=&quot;noreferrer&quot;&gt;ESS&lt;/a&gt;. I like a large font to reduce eye strain so the last line of my .emacs file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-default-font &quot;Inconsolata-20&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I open a file of R code, this appears as one would expect. However, additional frames opened with &lt;code&gt;C-x 5 2&lt;/code&gt; have a tiny font. Typically this happens when I eval the buffer and want to look at the resulting ESS/R session in a separate frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume there is something overiding the default font, but cannot find what it might be. Strangely, sometimes the default font is respected, but I cannot reproduce.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I force all new frames to honor the default font?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QOP96.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QOP96.png&quot; alt=&quot;Tiny text in ESS window&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8393" LastActivityDate="2021-12-20T18:15:32.987" Title="New frame does not respect default font" Tags="|fonts|ess|r|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16314" PostTypeId="2" ParentId="16313" CreationDate="2015-09-04T09:49:58.717" Score="9" Body="&lt;p&gt;&lt;code&gt;set-default-font&lt;/code&gt; by default sets the font for current frame only from the documentation &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;set-default-font&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; (emphasis mine)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(set-default-font FONT &amp;amp;optional KEEP-SIZE FRAMES)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This function is obsolete since 23.1; use `set-frame-font' instead.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Set the default font to FONT. When called interactively, prompt for&#xA;  the name of a font, and use that font on the selected frame.  When&#xA;  called from Lisp, FONT should be a font name (a string), a font&#xA;  object, font entity, or font spec.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If KEEP-SIZE is nil, keep the number of frame lines and columns fixed.&#xA;  If KEEP-SIZE is non-nil (or with a prefix argument), try to keep the&#xA;  current frame size fixed (in pixels) by adjusting the number of lines&#xA;  and columns.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If FRAMES is nil, apply the font to the selected frame only. If FRAMES&#xA;  is non-nil, it should be a list of frames to act upon, or t meaning&#xA;  all existing graphical frames. Also, &lt;strong&gt;if FRAMES is non-nil&lt;/strong&gt;, alter the&#xA;  user's Customization settings as though the font-related attributes of&#xA;  the `default' face had been &quot;set in this session&quot;, so that &lt;strong&gt;the font is&#xA;  applied to future frames.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the solution is to do&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-default-font &quot;Inconsolata-20&quot; nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also please note that this function is obsolete since emacs 23.1. Use &lt;code&gt;set-frame-font&lt;/code&gt; instead, the API is same &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional methods for setting font&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For sake of completeness I am mentioning additional methods for setting default font&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Customizing &lt;code&gt;default-frame-alist&lt;/code&gt;, mentioned by @Drew&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(font . &quot;Inconsolata-20&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Customizing the &lt;code&gt;default&lt;/code&gt; face, mentioned by @wasamasa, by doing something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-font 'default &quot;Inconsolata-20&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternately you can use the &lt;code&gt;customize&lt;/code&gt; interface, mentioned by @VitoshKa, &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-face&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;default&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-04T16:19:57.640" LastActivityDate="2015-09-04T16:19:57.640" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16315" PostTypeId="2" ParentId="15228" CreationDate="2015-09-04T10:18:12.347" Score="9" Body="&lt;p&gt;&lt;code&gt;#+ATTR_LaTeX: :center nil&lt;/code&gt; will cancel centering (by default LaTeX tables inherit alignment from the document)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how the table would be exported with default settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{center}&#xA;\begin{tabular}{rrr}&#xA;a &amp;amp; b &amp;amp; c\\&#xA;1 &amp;amp; 2 &amp;amp; 3\\&#xA;\end{tabular}&#xA;\end{center}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is how it would be exported without centering:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{tabular}{rrr}&#xA;a &amp;amp; b &amp;amp; c\\&#xA;1 &amp;amp; 2 &amp;amp; 3\\&#xA;\end{tabular}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you need to move it even further to the left, you could add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LaTeX&#xA;  \hspace{-3cm}&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before the table.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-09-04T10:18:12.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16316" PostTypeId="2" ParentId="15299" CreationDate="2015-09-04T10:42:25.077" Score="1" Body="&lt;p&gt;An easier way is to just load your current file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(define-key clojure-mode-map&#xA;    (kbd &quot;C-c C-l&quot;) 'cider-load-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's also possible to keep &lt;code&gt;(use 'my-namespace.core :reload)&lt;/code&gt; in your file, navigate there with &lt;code&gt;isearch&lt;/code&gt; and &lt;kbd&gt;C-c C-e&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I almost never use a REPL and evaluate either the whole buffer with &lt;kbd&gt;C-c C-l&lt;/kbd&gt; or single expressions with &lt;kbd&gt;e&lt;/kbd&gt; (via &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-09-04T10:42:25.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16317" PostTypeId="1" AcceptedAnswerId="16319" CreationDate="2015-09-04T10:43:34.283" Score="5" ViewCount="2070" Body="&lt;p&gt;I have an org-mode file in standard agenda format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Dentist&#xA;&amp;lt;2015-10-01&amp;gt;&#xA;* Put up shelves&#xA;&amp;lt;2015-10-05&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm just starting to use org-agenda but I still use just that single file a lot just as an regular org-mode fully-expanded tree, and it's handy to have it kept sorted in date order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I sort it by hand.  How can I get emacs to sort it by date?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2015-09-05T20:07:38.633" LastActivityDate="2015-09-05T20:07:38.633" Title="Sorting org-mode org-agenda file" Tags="|org-mode|org-agenda|sorting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16318" PostTypeId="1" AcceptedAnswerId="16325" CreationDate="2015-09-04T11:20:50.257" Score="2" ViewCount="664" Body="&lt;p&gt;If I drag and drop an image file (say &lt;code&gt;myfile&lt;/code&gt;) to emacs when running in auctex mode, emacs just shows the file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make emacs to insert &lt;code&gt;\includegraphics{myfile}&lt;/code&gt; instead of showing the picture?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it also possible to make emacs ask me for options such as &lt;code&gt;(TeX-insert-macro &quot;includegraphics&quot;)&lt;/code&gt; does?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2015-10-07T17:52:12.860" Title="Drag and drop images to auctex" Tags="|auctex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16319" PostTypeId="2" ParentId="16317" CreationDate="2015-09-04T11:28:42.047" Score="6" Body="&lt;p&gt;Just select the entire buffer and do &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;^&lt;/kbd&gt; (it runs the command &lt;code&gt;org-sort&lt;/code&gt;). It will prompt you for the &lt;code&gt;type&lt;/code&gt; of sorting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand different types of sorting see the documentation of &lt;code&gt;org-sort-entries&lt;/code&gt; (&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;org-sort-entries&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;). I am quoting it here for completeness&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sort entries on a certain level of an outline tree.&#xA;  If there is an active region, the entries in the region are sorted.&#xA;  Else, if the cursor is before the first entry, sort the top-level items.&#xA;  Else, the children of the entry at point are sorted.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Sorting can be alphabetically, numerically, by date/time as given by&#xA;  a time stamp, by a property, by priority order, or by a custom function.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The command prompts for the sorting type unless it has been given to the&#xA;  function through the SORTING-TYPE argument, which needs to be a character,&#xA;  (?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?o ?O ?r ?R ?f ?F ?k ?K).  Here is&#xA;  the precise meaning of each character:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a   Alphabetically, ignoring the TODO keyword and the priority, if any.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c   By creation time, which is assumed to be the first inactive time stamp&#xA;      at the beginning of a line.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;d   By deadline date/time.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;k   By clocking time.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;n   Numerically, by converting the beginning of the entry/item to a number.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;o   By order of TODO keywords.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;p   By priority according to the cookie.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;r   By the value of a property.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;s   By scheduled date/time.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;t   By date/time, either the first active time stamp in the entry, or, if&#xA;      none exist, by the first inactive one.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Capital letters will reverse the sort order.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-04T15:58:41.990" LastActivityDate="2015-09-04T15:58:41.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16320" PostTypeId="2" ParentId="15294" CreationDate="2015-09-04T12:06:04.310" Score="3" Body="&lt;p&gt;The problem is ultimately the result of misunderstanding how completion works with company mode. I temporarily solved it by adding an &lt;code&gt;import&lt;/code&gt; statement to the top of the org-babel block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, typing, say &lt;code&gt;sys.&lt;/code&gt; and awaiting the completion candidates that come with the &lt;code&gt;sys&lt;/code&gt; module proved fruitless. However, beginning that same org-babel block with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import sys&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;was helpful, because now, in the next line of that same *Org Src* block, I saw:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sys.api_version&#xA;    argv&#xA;    builtin_module_names&#xA;    .&#xA;    .&#xA;    .&#xA;    etc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after typing those first three characters, despite the fact that nothing had actually &lt;em&gt;really&lt;/em&gt; been &quot;imported.&quot; Apparently, the &lt;code&gt;import&lt;/code&gt; statement alone was sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, all is not well, because this kind of completion does not quite mirror that of, say, the python shell with company-mode enabled. There I simply type a module name like &lt;code&gt;matplotlib&lt;/code&gt; and I immediately get completions, with or without an &lt;code&gt;import matplotlib&lt;/code&gt; in that shell or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it becomes inconvenient to have to type &lt;code&gt;import foo&lt;/code&gt; at the top of &lt;strong&gt;every&lt;/strong&gt; babel block where I am interested in calling some method &lt;code&gt;bar&lt;/code&gt; in module &lt;code&gt;foo&lt;/code&gt;, I think a better answer would go beyond my crude solution, and may involve a deeper understanding of how &lt;code&gt;company-backends&lt;/code&gt; or something works.&lt;/p&gt;&#xA;" OwnerUserId="9409" LastEditorUserId="10" LastEditDate="2015-09-04T13:01:56.340" LastActivityDate="2015-09-04T13:01:56.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16322" PostTypeId="2" ParentId="15306" CreationDate="2015-09-04T12:34:47.747" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;org-time-clocksum-use-effort-durations&lt;/strong&gt; is a variable defined in &lt;code&gt;org.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Its value is &lt;strong&gt;nil&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When non-nil, M-x org-clock-display uses effort durations.&#xA;  E.g. by default, one day is considered to be a 8 hours effort,&#xA;  so a task that has been clocked for 16 hours will be displayed&#xA;  as during 2 days in the clock display or in the clocktable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See &lt;code&gt;org-effort-durations&lt;/code&gt; on how to set effort durations&#xA;  and &lt;code&gt;org-time-clocksum-format&lt;/code&gt; for more on time clock formats.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-time-clocksum-use-effort-durations t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9418" LastActivityDate="2015-09-04T12:34:47.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16323" PostTypeId="1" AcceptedAnswerId="17007" CreationDate="2015-09-04T12:49:16.140" Score="2" ViewCount="1237" Body="&lt;p&gt;I am using magit (2.2.2) with emacs 25.&#xA;magit is very good BUT I want the status dot in the modeline (like psvn does).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/b9p1G.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/b9p1G.png&quot; alt=&quot;p svn example&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to use &lt;a href=&quot;https://github.com/tsgates/git-emacs/blob/master/git-modeline.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tsgates/git-emacs/blob/master/git-modeline.el&lt;/a&gt; with this configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (autoload 'git--update-all-state-marks &quot;git-modeline&quot; nil t)&#xA;  (add-hook 'find-file-hook 'git-status-in-modeline)&#xA;  (defun git-status-in-modeline ()&#xA;    (if (and vc-mode (string-match &quot;^ Git&quot; (substring-no-properties vc-mode)))&#xA;        (git--update-all-state-marks)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open a file (under git) it doesn't work but if I do &lt;code&gt;(revert-buffer)&lt;/code&gt; it works. Why the second time but not the first ? Any Idea to progress ?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="306" LastEditDate="2015-09-05T11:29:43.387" LastActivityDate="2015-09-30T02:30:08.693" Title="magit with modeline status dot" Tags="|magit|mode-line|git|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16324" PostTypeId="1" CreationDate="2015-09-04T13:31:16.447" Score="0" ViewCount="983" Body="&lt;p&gt;If this is not a relevant place to post this, please let me know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My common workflow is Vim+Tmux. Mostly i do Clojure coding. Just yesterday i've downloaded and tried Spacemacs, out of curiosity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of Spacemacs's claims is that by using modal editing in Evil mode, it minimizes RSI risk (albeit on the Spacemacs home page it is said that there is no proven connection between Emacs key bindings and RSI). I realized though, that heavy use of Vim/Tmux also relies on the use of modifier keys, which most often in my case are Control-key combinations (navigating between Vim windows and Tmux prefix - &lt;code&gt;Ctrl-S&lt;/code&gt; in my case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So i thought that here is the best place to ask about RSI caused by heavy use of modifier keys (Emacs seems to be associated with it, namely the 'Emacs pinky' myth). Is it something scientifically proven? Were there any studies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there does exist a correlation, then does e.g. remapping &lt;code&gt;CapsLock&lt;/code&gt; to &lt;code&gt;Ctrl&lt;/code&gt; help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P. S. I do have &lt;code&gt;CapsLock&lt;/code&gt; mapped to &lt;code&gt;Ctrl&lt;/code&gt;. Moreover, in Vim i've remapped &lt;code&gt;Esc&lt;/code&gt; to &lt;code&gt;Tab&lt;/code&gt;, which is similarly convenient. And it more closely resembles original keyboard &lt;a href=&quot;https://en.wikipedia.org/wiki/Vi#/media/File:KB_Terminal_ADM3A.svg&quot; rel=&quot;nofollow noreferrer&quot;&gt;layout&lt;/a&gt; Bill Joy used when creating Vi. Maybe it was also used by Emacs users back then?&lt;/p&gt;&#xA;" OwnerUserId="9419" LastEditorUserId="105" LastEditDate="2019-12-26T23:26:58.433" LastActivityDate="2019-12-26T23:26:58.433" Title="Validity of RSI claims for Emacs users" Tags="|evil|spacemacs|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="16325" PostTypeId="2" ParentId="16318" CreationDate="2015-09-04T14:22:07.187" Score="1" Body="&lt;p&gt;AUCTeX doesn't have such feature builtin but you can use the code submitted to the AUCTeX' mailing list last year by Dieter Jurzitza: &lt;a href=&quot;https://lists.gnu.org/archive/html/auctex/2014-11/msg00007.html&quot; rel=&quot;nofollow&quot;&gt;https://lists.gnu.org/archive/html/auctex/2014-11/msg00007.html&lt;/a&gt;  (actually it was &lt;a href=&quot;https://lists.gnu.org/archive/html/auctex/2010-12/msg00010.html&quot; rel=&quot;nofollow&quot;&gt;originally proposed&lt;/a&gt; by Michal Sojka in 2010).  Once you have installed that code in your init file, you can activate this new minor mode in every LaTeX buffer with the following line to be inserted in your init file&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'AUCTeX-dnd-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the complete code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)&#xA;&#xA;(defcustom AUCTeX-dnd-format &quot;\\includegraphics[width=\\textwidth]{%s}&quot;&#xA;  &quot;What to insert, when a file is dropped on Emacs window. %s is&#xA;replaced by the actual file name. If the filename is located&#xA;under the directory of .tex document, only the part of the name&#xA;relative to that directory in used.&quot;&#xA;  :type 'string&#xA;  :group 'AUCTeX)&#xA;&#xA;&#xA;;; Modified version&#xA;(defun AUCTeX-dnd-includegraphics (uri action)&#xA;  &quot;Insert the text defined by `AUCTeX-dnd-format' when a file is&#xA;dropped on Emacs window.&quot;&#xA;  (let ((file (dnd-get-local-file-name uri t)))&#xA;    (when (and file (file-regular-p file))&#xA;      (if (string-match &quot;/my/texinputs/path/to/images&quot; file)&#xA;      (insert (format AUCTeX-dnd-format (file-name-nondirectory file)))&#xA;    (insert (format AUCTeX-dnd-format file))&#xA;    )&#xA;      )&#xA;    )&#xA;  )&#xA;&#xA;&#xA;(defcustom AUCTeX-dnd-protocol-alist&#xA;  '((&quot;^file:///&quot; . AUCTeX-dnd-includegraphics)&#xA;    (&quot;^file://&quot;  . dnd-open-file)&#xA;    (&quot;^file:&quot;    . AUCTeX-dnd-includegraphics))&#xA;  &quot;The functions to call when a drop in `mml-mode' is made.&#xA;See `dnd-protocol-alist' for more information.  When nil, behave&#xA;as in other buffers.&quot;&#xA;  :type '(choice (repeat (cons (regexp) (function)))&#xA;                 (const :tag &quot;Behave as in other buffers&quot; nil))&#xA;  :version &quot;22.1&quot; ;; Gnus 5.10.9&#xA;  :group 'AUCTeX)&#xA;&#xA;&#xA;(define-minor-mode AUCTeX-dnd-mode&#xA;  &quot;Minor mode to inser some text (\includegraphics by default)&#xA;when a file is dopped on Emacs window.&quot;&#xA;  :lighter &quot; DND&quot;&#xA;  (when (boundp 'dnd-protocol-alist)&#xA;    (if AUCTeX-dnd-mode&#xA;        (set (make-local-variable 'dnd-protocol-alist)&#xA;             (append AUCTeX-dnd-protocol-alist dnd-protocol-alist))&#xA;      (kill-local-variable 'dnd-protocol-alist))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastEditorUserId="2323" LastEditDate="2015-10-07T17:52:12.860" LastActivityDate="2015-10-07T17:52:12.860" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16326" PostTypeId="1" AcceptedAnswerId="16328" CreationDate="2015-09-04T15:31:59.893" Score="5" ViewCount="1174" Body="&lt;p&gt;When composing my weekly schedule, it feels somewhat jarring to have to switch to the agenda buffer in the other frame and rebuild, just to see how things align. Adding &lt;code&gt;org-agenda-redo&lt;/code&gt; to &lt;code&gt;after-save-hook&lt;/code&gt; doesn't seem to work. Having the hook call &lt;code&gt;(org-agenda-redo t)&lt;/code&gt;, which should rebuild ALL agenda buffers, doesn't seem to work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a sample of the code I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-agenda-redo-all ()&#xA;  &quot;Rebuild all agenda buffers&quot;&#xA;  (org-agenda-redo t))&#xA;&#xA;(add-hook 'org-mode-hook&#xA;          (lambda()&#xA;            (add-hook 'after-save-hook 'org-agenda-redo-all nil 'make-it-local)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;code&gt;*Messages*&lt;/code&gt; buffer, &lt;code&gt;org-agenda-redo&lt;/code&gt; appears to be called:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Saving file /home/mkaito/notes/agenda.org...&#xA;Wrote /home/mkaito/notes/agenda.org&#xA;Rebuilding agenda buffer...done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the agenda buffer in the other frame is not updated.&lt;/p&gt;&#xA;" OwnerUserId="3945" LastActivityDate="2015-09-04T16:44:00.170" Title="How to rebuild agenda buffers when saving an org-mode buffer?" Tags="|org-mode|hooks|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16327" PostTypeId="1" AcceptedAnswerId="16334" CreationDate="2015-09-04T15:33:17.490" Score="3" ViewCount="198" Body="&lt;p&gt;Is it possible to access a user-defined file-local variable during byte-compilation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, I am trying to get this code to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--- testfilelocals.el ---&#xA;;; -*- my-file-local: &quot;foo&quot; -*-&#xA;&#xA;(defun testfilelocals ()&#xA;  (eval-when-compile &#xA;    my-file-local))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which fails with a compiler error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;testfilelocals.el:5:5:Error: Symbol's value as variable is void: my-file-local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2308" LastActivityDate="2015-09-04T19:26:05.087" Title="byte compile file-local variables" Tags="|byte-compilation|file-local-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16328" PostTypeId="2" ParentId="16326" CreationDate="2015-09-04T16:44:00.170" Score="5" Body="&lt;p&gt;&lt;code&gt;org-agenda-redo&lt;/code&gt; does not rebuilt all agenda buffers rather it rebuilts all views in current buffer. From the documentation &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;org-agenda-redo&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-agenda-redo &amp;amp;optional ALL)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Rebuild possibly ALL agenda view(s) in the current buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You will need to manually loop through all agenda buffers and rebuild them. Below is one such command&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-redo-all-agenda-buffers ()&#xA;  (interactive)&#xA;  (dolist (buffer (buffer-list))&#xA;    (with-current-buffer buffer&#xA;      (when (derived-mode-p 'org-agenda-mode)&#xA;        (org-agenda-redo t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-04T16:44:00.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16330" PostTypeId="2" ParentId="16327" CreationDate="2015-09-04T18:10:24.880" Score="0" Body="&lt;p&gt;Maybe because you did not specify major mode where the variables are used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- mode: Lisp; my-file-local: &quot;foo&quot; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Most major modes &lt;a href=&quot;http://ftp.gnu.org/old-gnu/Manuals/emacs/html_node/emacs_486.html&quot; rel=&quot;nofollow&quot;&gt;reset all variables&lt;/a&gt; upon initialization.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-04T18:10:24.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16331" PostTypeId="1" AcceptedAnswerId="16342" CreationDate="2015-09-04T18:40:38.960" Score="1" ViewCount="266" Body="&lt;p&gt;My new emacs is scrolling minibuffer text so that I can't see simple stuff, like when emacs asks if I want to save changes to a file before exiting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing this both in a mac window or in Terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using emacs 25.0.50, built for mac using homebrew. Installed ember-mode and elpa for packages, but that's about it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Haven't found help via google or SO ... perhaps my search-fu is weak today. Any advice out there on how to debug / fix?&lt;/p&gt;&#xA;" OwnerUserId="9397" LastActivityDate="2015-09-04T21:16:13.913" Title="Why is my minibuffer scrolling and preventing me from seeing emacs asking me questions?" Tags="|minibuffer|terminal-emacs|scrolling|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16332" PostTypeId="1" AcceptedAnswerId="16333" CreationDate="2015-09-04T19:11:21.787" Score="7" ViewCount="713" Body="&lt;p&gt;I'm trying to see if all the values in a list are truthy. For some reason, &lt;code&gt;(apply #'and lst)&lt;/code&gt; errors with:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Invalid function: and&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This also happens when I try &lt;code&gt;(cl-reduce #'and lst)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;(apply #'max lst)&lt;/code&gt; seems to work fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, I'm using &lt;code&gt;(eval `(and ,@lst))&lt;/code&gt;, but that feels ugly.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="105" LastEditDate="2016-06-22T20:35:16.293" LastActivityDate="2016-06-22T20:35:16.293" Title="#'and is an invalid function?" Tags="|functions|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16333" PostTypeId="2" ParentId="16332" CreationDate="2015-09-04T19:19:17.230" Score="5" Body="&lt;p&gt;This really is only a partial answer (since I can't say why or really provide a workaround for it beyond what you already have).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per &lt;code&gt;C-h f and&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;and is a special form in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(and CONDITIONS...)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Eval args until one of them yields nil, then return nil. The remaining&#xA;  args are not evalled at all. If no arg yields nil, return the last&#xA;  arg's value.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[back]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So even though it behaves like a function it isn't one.  The same error gets generated by using a &lt;code&gt;macro&lt;/code&gt; in the place of &lt;code&gt;and&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="337" LastEditorUserId="10" LastEditDate="2015-09-04T20:11:00.493" LastActivityDate="2015-09-04T20:11:00.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16334" PostTypeId="2" ParentId="16327" CreationDate="2015-09-04T19:26:05.087" Score="2" Body="&lt;p&gt;Looking at the source code in &lt;code&gt;bytecomp.el&lt;/code&gt;, one can see that only safe file-local variables are read (see the relevant part of the file below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that if you declare your variable as safe for file-local use, it should be read when you compile your file. You can for example evaluate the following piece of code before you byte-compile the file:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(put 'my-file-local 'safe-local-variable 'stringp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For reference, here is the relevant part of &lt;code&gt;bytecomp.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((buffer-file-name filename)&#xA;      (dmm (default-value 'major-mode))&#xA;      ;; Ignore unsafe local variables.&#xA;      ;; We only care about a few of them for our purposes.&#xA;      (enable-local-variables :safe)&#xA;      (enable-local-eval nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-04T19:26:05.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16335" PostTypeId="1" AcceptedAnswerId="16337" CreationDate="2015-09-04T19:35:56.437" Score="6" ViewCount="4339" Body="&lt;p&gt;The typical workflow in other text editors is that you are presented with a blank window, to start typing into, and then when you exit the editor (or kill the buffer if applicable, close the window in some editors - in general any action that would normally prompt to save), if you have typed anything, it will prompt you to save modifications and prompt you for a filename if you answer yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to replicate this workflow in Emacs - i.e., have a buffer that does not have a filename (the buffer name would be something like *unsaved file*, I suppose), but prompts to save?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Creating a buffer by typing an arbitrary name after C-x b results in a buffer that won't prompt to save.&lt;/p&gt;&#xA;" OwnerUserId="6862" LastActivityDate="2015-09-05T07:45:22.353" Title="Create a buffer for a new file without naming the file" Tags="|buffers|" AnswerCount="5" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16336" PostTypeId="2" ParentId="16335" CreationDate="2015-09-04T20:25:36.737" Score="2" Body="&lt;p&gt;As far as I know, there is no standard way to have the behaviour you describe in stock Emacs. This is seen by many as a problem, and the Internet features some interesting discussions about the way new files/scratch buffers could/should be handled by Emacs (see for example &lt;a href=&quot;http://ergoemacs.org/emacs/modernization_scratch_buffer.html&quot; rel=&quot;nofollow&quot;&gt;Xah Lee's essay&lt;/a&gt; about the scratch buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;disclaimer:&lt;/strong&gt; what follows is self-advertisement!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have created my own package to deal with scratch buffers. Be forewarned that it is probably not ready for public consumption yet. Still, you can find it on &lt;a href=&quot;https://github.com/ffevotte/scratch.el&quot; rel=&quot;nofollow&quot;&gt;github&lt;/a&gt; if you want to give it a try.&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-09-04T20:48:39.187" LastActivityDate="2015-09-04T20:48:39.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16337" PostTypeId="2" ParentId="16335" CreationDate="2015-09-04T20:42:29.630" Score="6" Body="&lt;p&gt;You can create this yourself by using a new command to open &quot;New File&quot; buffers, and using a custom &lt;code&gt;kill-buffer-hook&lt;/code&gt; to ensure they get saved before you close them.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local is-new-file-buffer nil)&#xA;&#xA;(defun save-new-file-before-kill ()&#xA;  (when (and (not (buffer-file-name))&#xA;             is-new-file-buffer&#xA;             (yes-or-no-p &#xA;              &quot;New file has not been saved. Would you like to save before closing?&quot;))&#xA;    (call-interactively 'save-buffer)))&#xA;&#xA;(add-hook 'kill-buffer-hook 'save-new-file-before-kill)    &#xA;&#xA;(defun new-file (dir)&#xA;  (interactive &quot;DCreate New File In: &quot;)&#xA;  (let ((buffer (generate-new-buffer &quot;&amp;lt;Unsaved File&amp;gt;&quot;)))&#xA;    (switch-to-buffer buffer)&#xA;    (setq-local default-directory dir)&#xA;    (setq-local is-new-file-buffer t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using this, you can call &lt;code&gt;new-file&lt;/code&gt; to create a new unsaved buffer in a specified directory, then you can save it anytime you want. When you try to kill a unsaved buffer created with &lt;code&gt;new-file&lt;/code&gt; emacs will prompt you for a file name to save to before it kills the buffer.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-09-04T20:42:29.630" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16338" PostTypeId="2" ParentId="16335" CreationDate="2015-09-04T20:53:14.873" Score="4" Body="&lt;p&gt;Other editors are, well, wrong.  You don't want to do that.  Emacs is all about buffers, not files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is a duplicate of the question &lt;a href=&quot;https://stackoverflow.com/q/26979052/729907&quot;&gt;here&lt;/a&gt;.  And the answer is &lt;a href=&quot;https://stackoverflow.com/a/26979288/729907&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since it is not verboten (though it is discouraged) to post the same question here as a question on Stack Overflow, I'll summarize the message I posted &lt;a href=&quot;https://stackoverflow.com/a/26979288/729907&quot;&gt;there&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Give it a name.&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;Just don't save it.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not what you wanted to hear, but this is the Emacs way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-x C-f&lt;/code&gt;, giving the (to-be-file-visiting) buffer a name.  Edit the text.  Do not use &lt;code&gt;C-x C-s&lt;/code&gt; to save the buffer to the file (i.e., to disk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;End of story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to take the chance of accidentally hitting &lt;code&gt;C-x C-s&lt;/code&gt; and thus saving your edits, then use &lt;code&gt;C-x b&lt;/code&gt; instead of &lt;code&gt;C-x C-f&lt;/code&gt;. You are (even here) prompted for the buffer name.  Giving it a new name (not the name of an existing buffer) creates a new buffer.  In this case, if you use &lt;code&gt;C-x C-s&lt;/code&gt; then Emacs prompts you for the file location to save the buffer in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would you want to use &lt;code&gt;C-x C-f&lt;/code&gt; instead of &lt;code&gt;C-x b&lt;/code&gt;, if you might not want to save the buffer? Providing a file extension in the file name you give &lt;em&gt;automatically puts the buffer in the proper major mode&lt;/em&gt; (typically).  Otherwise (for &lt;code&gt;C-x b&lt;/code&gt;) you need to put the buffer in the mode you want.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-09-04T20:53:14.873" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16339" PostTypeId="2" ParentId="16335" CreationDate="2015-09-04T20:54:48.467" Score="1" Body="&lt;p&gt;Have you tried disabling ido-mode? The default emacs (without ido-mode) does not ask for a filename. C-x b, type any name for buffer, and off you go. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-04T20:54:48.467" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16340" PostTypeId="2" ParentId="16332" CreationDate="2015-09-04T21:02:20.933" Score="3" Body="&lt;p&gt;To add to and summarize what others have said:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(functionp 'and) ; ===&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;End of story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/What-Is-a-Function.html&quot; rel=&quot;nofollow&quot;&gt;What Is a Function&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can use the function &lt;code&gt;functionp&lt;/code&gt; to test if an object is a&#xA;  function:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;-- Function: functionp object&#xA;       This function returns &lt;code&gt;t&lt;/code&gt; if OBJECT is any kind of function, i.e.,&#xA;       can be passed to &lt;code&gt;funcall&lt;/code&gt;.  Note that &lt;code&gt;functionp&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt; for&#xA;       symbols that are function names, and returns ‘nil’ for special&#xA;       forms.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Man, I hate the new curly-quoting in the manuals.  Makes me replace each of them with &lt;code&gt;`&lt;/code&gt; after pasting from the manual here. Twice as much effort as when the manual (sanely) used &lt;code&gt;`...'&lt;/code&gt; instead of &lt;code&gt;‘...’&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-04T21:02:20.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16341" PostTypeId="2" ParentId="16331" CreationDate="2015-09-04T21:09:40.500" Score="0" Body="&lt;p&gt;Perhaps the scroll variable has been set. Unset it as following in your init.el file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq minibuffer-scroll-window nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is the default anyway. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-04T21:09:40.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16342" PostTypeId="2" ParentId="16331" CreationDate="2015-09-04T21:16:13.913" Score="1" Body="&lt;p&gt;Are you using a development snapshot of Emacs?  If so, perhaps you were hit by &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21403&quot; rel=&quot;nofollow&quot;&gt;Emacs bug #21403&lt;/a&gt;, which makes the prompt for &lt;code&gt;y-or-n-p&lt;/code&gt; invisible.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-04T21:16:13.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16343" PostTypeId="1" AcceptedAnswerId="16344" CreationDate="2015-09-04T22:07:40.040" Score="3" ViewCount="674" Body="&lt;p&gt;I work a lot with unix config files (i.e the files in &lt;em&gt;/etc&lt;/em&gt; in the various linux system) that have no extension. How can I set-up my .emacs file to load conf-unix-mode on those files?&lt;/p&gt;&#xA;" OwnerUserId="8478" LastEditorUserId="253" LastEditDate="2015-09-04T22:15:51.307" LastActivityDate="2015-09-04T22:15:51.307" Title="UNIX config files, load conf-unix-mode" Tags="|init-file|linux|config|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16344" PostTypeId="2" ParentId="16343" CreationDate="2015-09-04T22:15:15.587" Score="5" Body="&lt;p&gt;If you mean specifically &quot;all files in the &lt;code&gt;/etc/&lt;/code&gt; directory,&quot; you could add an absolute path to your &lt;code&gt;auto-mode-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;/etc/.*&quot; . conf-unix-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-09-04T22:15:15.587" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16346" PostTypeId="1" CreationDate="2015-09-05T02:39:18.563" Score="0" ViewCount="101" Body="&lt;p&gt;I'm having trouble stopping Emacs from loading all packages in my &lt;code&gt;default-directory&lt;/code&gt;. When I call &lt;code&gt;c-h v load-packages&lt;/code&gt; I get a listing of all subdirectories inside my elpa directory, which I want to avoid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following in my startup files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-enable-at-startup nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I do &lt;strong&gt;not&lt;/strong&gt; have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory user-emacs-directory))&#xA;  (normal-top-level-add-subdirs-to-load-path)&#xA;  ) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I have it commented, though).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In spite of that, I still get the following when I ask Emacs to show me the value of &lt;code&gt;load-path&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (&quot;/Users/nivaca/Dropbox/emacs/elpa/adaptive-wrap-0.5/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/async-20150818.1154/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/auctex-11.88.8/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/autopair-20140825.427/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/color-theme-20080305.34/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/dedicated-20090428.1231/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/dired+-20150830.1456/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/duplicate-thing-20120515.948/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/expand-region-20150902.558/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/flx-ido-20140821.2033/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/flx-20140921.739/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/flycheck-20150831.1343/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/highlight-parentheses-20150421.2328/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/hl-indent-20141227.1330/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/hl-line+-20150104.2222/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/hl-sentence-20140802.920/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/ido-hacks-20150331.1209/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/ido-ubiquitous-20150630.926/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/ido-completing-read+-20150630.926/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/indent-guide-20150713.2327/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/leuven-theme-20150818.556/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/lua-mode-20150804.2302/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/markdown-mode+-20120829.510/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/markdown-mode-20150904.656/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/mc-extras-20150218.234/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/move-text-20140307.1644/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/multi-term-20150220.1320/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/multiple-cursors-20150710.456/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/neotree-20150904.609/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/paradox-20150812.732/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/let-alist-1.0.4/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/pkg-info-20150517.443/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/epl-20150517.433/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/pretty-mode-20141207.1152/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/rainbow-delimiters-20150320.17/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/second-sel-20150105.46/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/seq-20150709.1040/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/smart-mode-line-20150803.338/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/rich-minority-20150305.516/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/smartparens-20150813.1451/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/dash-20150829.433/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/spinner-1.4/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/tabbar-20141109.143/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/undo-tree-20140509.522/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/use-package-20150817.2257/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/diminish-20091203.1012/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/bind-key-20150321.213/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/volatile-highlights-20141004.2240/&quot; &quot;/Users/nivaca/Dropbox/emacs/elpa/yasnippet-20150811.1222/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ultimately, the issue at hand is that I don't want Emacs to automatically load &lt;code&gt;AuCTeX&lt;/code&gt; (I have eliminated all references to it from my startup files, but it still keeps loading itself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to stop this?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even with no startup file (I removed my &lt;code&gt;.emacsd&lt;/code&gt; file) I get the same value for &lt;code&gt;load-path&lt;/code&gt;. This happens even if I start with &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2015-09-05T19:43:10.217" LastActivityDate="2015-09-05T19:43:10.217" Title="Stop Emacs from adding all subdirs to default-directory" Tags="|package|directories|start-up|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16347" PostTypeId="1" AcceptedAnswerId="16352" CreationDate="2015-09-05T03:37:19.670" Score="6" ViewCount="814" Body="&lt;p&gt;When editing a html file (in an Emacs buffer in HTML mode), I often review the file in my default browser (Firefox) by C-c C-v (ie, running browse-url-of-buffer). But every time I run C-c C-v, Firefox opens the file in a new tab so that after making several revisions, there are several tabs for the same file. But what I want is that Firefox reloads the file in the same tab, which is exactly what Safari does. Is there a way to make Firefox behave the way I want? The Emacs customization group `browse-url' does not seem to have an item for this. Neither can I find any suitable item in Firefox preferences (under General/Tabs). (I run Emacs 24.4 in Mac Yosemite, Firefox is 40.0.3.)&lt;/p&gt;&#xA;" OwnerUserId="9421" LastActivityDate="2015-09-05T08:34:12.273" Title="How to make browse-url-of-buffer load the same html file in the same tab in Firefox?" Tags="|html|web-browser|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16348" PostTypeId="1" AcceptedAnswerId="16349" CreationDate="2015-09-05T03:55:26.270" Score="2" ViewCount="124" Body="&lt;p&gt;I'm new to Emacs, and am trying to learn it for knitting LaTeX and R (using AUCTeX and ESS). In my ~/.emacs I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default TeX-newline-function 'reindent-then-newline-and-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which means that when I press RET AUCTeX applies the proper LaTeX indentation automatically for me. However, in an .Rnw file it seems that ESS overrides the TeX-newline. In an .Rnw file C-h m returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RET     TeX-newline&#xA;(that binding is currently shadowed by another mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and C-h k RET returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RET (translated from &amp;lt;return&amp;gt;) runs the command ess-noweb-newline,&#xA;which is an interactive compiled Lisp function in `ess-noweb-mode.el'.&#xA;&#xA;It is bound to RET.&#xA;&#xA;(ess-noweb-newline &amp;amp;optional ARG)&#xA;&#xA;A kludge to get round very odd behaviour of newline in quoted code.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically I only want ESS to override RET when the point is inside an R chunk (&amp;lt;&amp;lt;&gt;&gt; @) or the brackets of an \Sexpr{} expression. Seems to me that this should be the default behaviour, but is there any way to force it?&lt;/p&gt;&#xA;" OwnerUserId="9422" LastActivityDate="2015-09-05T05:03:38.857" Title="How to stop ESS overriding AUCTeX's TeX-newline in LaTeX parts of .Rnw?" Tags="|auctex|ess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16349" PostTypeId="2" ParentId="16348" CreationDate="2015-09-05T05:03:38.857" Score="1" Body="&lt;p&gt;I worked this one out, you need to use &lt;a href=&quot;https://github.com/vspinu/polymode&quot; rel=&quot;nofollow&quot;&gt;polymode&lt;/a&gt;. After installing polymode (I added the &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt; repository for that), you then set up whatever polymode bits you need in your ~/.emacs file. This is what I had to put for .Rnw support:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; enable polymode stuff&#xA;(require 'poly-R)&#xA;(require 'poly-markdown)&#xA;(require 'poly-noweb)&#xA;; add .Rnw filetype&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that you get everything working as it should be for LaTeX and R sections of the code. In .Rnw files RET works correctly, and syntax highlighting is more accurate too.&lt;/p&gt;&#xA;" OwnerUserId="9422" LastActivityDate="2015-09-05T05:03:38.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16350" PostTypeId="2" ParentId="16335" CreationDate="2015-09-05T07:33:31.777" Score="0" Body="&lt;p&gt;I tend to use &lt;a href=&quot;https://github.com/ieure/scratch-el&quot; rel=&quot;nofollow&quot;&gt;scratch.el&lt;/a&gt; when I need a disposable buffer (where &lt;em&gt;disposable&lt;/em&gt; means: a buffer I do not care to save in a file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(use-package scratch ; Mode-specific scratch buffers&#xA;  :ensure t&#xA;  :bind (&quot;C-c b s&quot; . scratch))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;scratch&lt;/code&gt; generates a mode-specific buffer. So, for instance, if I am editing an Org file, &lt;code&gt;scratch&lt;/code&gt; will visit a new buffer with Org-mode as its default major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can still save it in a file, if at all needed.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2015-09-05T07:45:22.353" LastActivityDate="2015-09-05T07:45:22.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16351" PostTypeId="2" ParentId="16332" CreationDate="2015-09-05T07:45:58.280" Score="1" Body="&lt;p&gt;&lt;strong&gt;What is a function?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand why this happens, we need to know what is a function. When evaluating the lisp form &lt;code&gt;(myfunc arg1 arg2 ...)&lt;/code&gt;, emacs first checks what &lt;code&gt;myfunc&lt;/code&gt; is. If it is a function, emacs evaluates all lisp forms &lt;code&gt;arg1&lt;/code&gt;, &lt;code&gt;arg2&lt;/code&gt;, etc. then calls the function &lt;code&gt;myfunc&lt;/code&gt; with the resulting lisp objects as arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As was noted, &lt;code&gt;and&lt;/code&gt; is not a function, it is a special form, thus it can evaluate its arguments as needed. As I gave in a comment earlier, the form &lt;code&gt;(and nil (drop 'bomb))&lt;/code&gt; is safe because &lt;code&gt;(drop 'bomb)&lt;/code&gt; is never evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, &lt;code&gt;(apply #'and (list nil (drop 'bomb)))&lt;/code&gt; is not safe, because &lt;code&gt;apply&lt;/code&gt; &lt;em&gt;is&lt;/em&gt; a function, so emacs first evaluates &lt;code&gt;#'and&lt;/code&gt; (the result is a symbol), then evaluates &lt;code&gt;(list nil (drop 'bomb))&lt;/code&gt;, which is again a function call, so you guess what happens next : &lt;code&gt;nil&lt;/code&gt; is evaluated, then &lt;code&gt;(drop 'bomb)&lt;/code&gt; is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why does &lt;code&gt;apply&lt;/code&gt; complain ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to use &lt;code&gt;apply&lt;/code&gt; on a special form (or a macro) doesn't make sense, because the special form can't possibly have its special behaviour, so it throws an error.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-09-05T07:45:58.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16352" PostTypeId="2" ParentId="16347" CreationDate="2015-09-05T08:25:24.977" Score="3" Body="&lt;p&gt;As far as I know the only solution is to adjust the settings in Firefox:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter &lt;code&gt;about:config&lt;/code&gt; in your address bar, confirm and search for &lt;code&gt;browser.link.open_newwindow.override.external&lt;/code&gt; and set it to &lt;code&gt;1&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that it should work like you want.&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-05T08:34:12.273" LastActivityDate="2015-09-05T08:34:12.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16353" PostTypeId="1" AcceptedAnswerId="16354" CreationDate="2015-09-05T08:41:08.577" Score="2" ViewCount="2891" Body="&lt;p&gt;I use org-mode mainly to write extensive notes, but I'm finding it difficult to &quot;justify&quot; while refactoring or making changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I have to make changes to the following text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;&#xA;  A line of nearly 80 characters that ends with newline character&#xA;  remaining part of the line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I've to add few words in first line (after heading), then the text will look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;&#xA;  A line of nearly 80 characters (plus some random stuff in brackets)&#xA;  that ends with newline character&#xA;  remaining part of the line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But ideally, I want something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;&#xA;  A line of nearly 80 characters (plus some random stuff in brackets)&#xA;  that ends with newline character remaining part of the line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there some way in which I can automate this &quot;justification&quot; using org-mode?&lt;/p&gt;&#xA;" OwnerUserId="6924" LastEditorUserId="6924" LastEditDate="2015-09-06T04:11:14.280" LastActivityDate="2016-10-04T22:53:21.227" Title="Aligning text in Org-mode after refactoring or making changes" Tags="|org-mode|align|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16354" PostTypeId="2" ParentId="16353" CreationDate="2015-09-05T09:43:11.943" Score="4" Body="&lt;p&gt;The requirement can be solved by using&lt;code&gt;M-q&lt;/code&gt; or &lt;code&gt;M-x fill-current-paragraph&lt;/code&gt;.&#xA;Refer &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Fill-Commands.html&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs Manual: Explicit Fill Commands&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6924" LastActivityDate="2015-09-05T09:43:11.943" CommentCount="1" CommunityOwnedDate="2015-09-05T09:43:11.943" ContentLicense="CC BY-SA 3.0" />
  <row Id="16355" PostTypeId="2" ParentId="16323" CreationDate="2015-09-05T11:24:56.297" Score="3" Body="&lt;p&gt;I can imagine two ways this could be implemented. (1) Process each buffer individually - get the state of the file, then update the mode-line. (2) Compile a list of buffers and their files, get the status of the files, loop over the buffers to update their mode-lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick look at the source indicates that this snippet does the latter. And the public function seems to be &lt;code&gt;git--update-all-state-marks&lt;/code&gt;, even though its name indicates otherwise (it uses the &quot;private&quot; prefix &lt;code&gt;git--&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you have this function to a hook which is run once &quot;when something changed in the repository&quot;, not to a hook which is run once per file/buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of Magit &lt;code&gt;magit-pre-refresh-hook&lt;/code&gt; should work. It is run after Magit did run a command and right before it refreshes the current Magit buffer. If the Magit command was invoked from a file-visiting buffer, then it is not run (but now that I think about it, I might change that). In any case you can always refresh the status dots by explicitly triggering an update by pressing &lt;kbd&gt;g&lt;/kbd&gt; in any Magit buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You might want to encourage the author to cleanup the code and to release this as a proper package in its own right. With documentation and everything.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-09-05T11:24:56.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16356" PostTypeId="2" ParentId="16310" CreationDate="2015-09-05T11:28:21.563" Score="1" Body="&lt;p&gt;You can use a &lt;code&gt;tags-todo&lt;/code&gt; query to select a subset of headings by tag, and &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; to show the effort with the headline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to work a little bit harder for the effort roll-up in parent headlines - here's one way to do it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/9738/org-agenda-todo-effort-rollup&quot;&gt;org-agenda todo effort rollup&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9425" LastActivityDate="2015-09-05T11:28:21.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16358" PostTypeId="2" ParentId="15309" CreationDate="2015-09-05T11:45:45.060" Score="3" Body="&lt;p&gt;You can set the prefix for different kinds of agenda view separately:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;org-agenda-prefix-format&lt;/strong&gt; is a variable defined in `org-agenda.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Its value is&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;((agenda . &quot; %i %-12:c%?-12t% s&quot;)&#xA;  (timeline . &quot;  % s&quot;)&#xA;  (todo . &quot; %i %-12:c&quot;)&#xA;  (tags . &quot; %i %-12:c&quot;)&#xA;  (search . &quot; %i %-12:c&quot;))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Format specifications for the prefix of items in the agenda views.&#xA;  An alist with five entries, each for the different agenda types.  The&#xA;  keys of the sublists are &lt;code&gt;agenda',&lt;/code&gt;timeline', &lt;code&gt;todo',&lt;/code&gt;search' and `tags'.&#xA;  The values are format strings.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But you are not limited to &lt;code&gt;setq&lt;/code&gt;'ing this. Custom agenda views let you set variables on a per-block basis. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; . &quot;My Custom Agendas&quot;)&#xA;        (&quot;co&quot; &quot;Agenda Overview&quot;&#xA;         ((agenda &quot;&quot;&#xA;                  ((org-agenda-overriding-header &quot;Today, Tomorrow (and Yesterday)&quot;)&#xA;                   (org-agenda-files (nconc (org-agenda-files) '(&quot;~/org/sunrise.org&quot;)))&#xA;                   (org-agenda-start-day &quot;-1d&quot;)&#xA;                   (org-agenda-span 3)&#xA;                   (org-agenda-start-on-weekday nil)&#xA;                   (org-agenda-show-all-dates t)&#xA;                   (org-agenda-use-time-grid t)))&#xA;          (tags-todo &quot;projectx&quot;&#xA;                  ((org-agenda-overriding-header &quot;\nProject Tasks&quot;)&#xA;                   (org-agenda-prefix-format &quot;%(my-project-agenda-prefix)&quot;))))&#xA;         ((org-agenda-compact-blocks nil)&#xA;          (org-agenda-block-separator nil)&#xA;          (org-agenda-show-all-dates nil)&#xA;          (org-agenda-repeating-timestamp-show-all t)&#xA;          (org-agenda-start-with-clock-report-mode nil)&#xA;          (org-agenda-use-time-grid nil)&#xA;          (org-agenda-prefix-format ((agenda . &quot; %i %-12:c%?-12t% s&quot;)&#xA;                                     (timeline . &quot;  % s&quot;)&#xA;                                     (todo . &quot; %i %-12:c&quot;)&#xA;                                     (tags . &quot; %i %-12:c&quot;)&#xA;                                     (search . &quot; %i %-12:c&quot;))))   ;; settings for both above blocks&#xA;         nil)                                                     ;; exports blocks to this file with C-c a e&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; at the bottom overrides the global setting for both blocks in this custom agenda view, and the &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; in the top block overrides &lt;em&gt;that&lt;/em&gt; for just this block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can switch on or off the time grid with &lt;code&gt;org-agenda-use-time-grid&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9426" LastActivityDate="2015-09-05T11:45:45.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16359" PostTypeId="1" AcceptedAnswerId="16386" CreationDate="2015-09-05T11:57:37.480" Score="5" ViewCount="79" Body="&lt;p&gt;I am writing a font-lock rule that calls a function to decide what&#xA;face to apply to a symbol. Here's a simplified version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;\\(?1:\\s_+\\)&quot;&#xA; (1 (the-function 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that this function needs to generate some data that is&#xA;just a little bit slow to compute. So, when jit-font-lock starts&#xA;calling this function for every symbol in the visible buffer, the lag&#xA;is noticeable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could &lt;code&gt;setq&lt;/code&gt; this “slightly-expensive” data to a variable,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq data-cache (generate-data))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then &lt;code&gt;the-function&lt;/code&gt; could just use &lt;code&gt;data-cache&lt;/code&gt; instead of calling&#xA;&lt;code&gt;generate-data&lt;/code&gt; every time. But then I would have to jump through some&#xA;non-trivial hoops to make sure that this cache is always properly&#xA;invalidated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Does the font-lock engine offer help in this regard? How can I make&#xA;sure it only runs &lt;code&gt;(generate-data)&lt;/code&gt; once per redisplay?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I would like to specify something like &lt;em&gt;“let-bind &lt;code&gt;data-cache&lt;/code&gt; to&#xA;the return value of &lt;code&gt;(generate-data)&lt;/code&gt;”&lt;/em&gt;. This way I would know that&#xA;this cache was never outdated.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-09-28T13:47:24.337" Title="Let-bind a variable while font-locking" Tags="|font-lock|optimization|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16360" PostTypeId="2" ParentId="14826" CreationDate="2015-09-05T13:37:17.620" Score="1" Body="&lt;p&gt;First calculate your frame width and add margin to minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun add-margin-to-mb ()&#xA;   (setq minibuffer-temporary-goal-position (* 2 (frame-width))))&#xA;(add-hook 'minibuffer-setup-hook 'add-margin-to-mb)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if you run &lt;code&gt;M-x&lt;/code&gt;, it will be like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YmENG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YmENG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-05T13:37:17.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16361" PostTypeId="1" AcceptedAnswerId="16363" CreationDate="2015-09-05T15:51:33.697" Score="1" ViewCount="1124" Body="&lt;p&gt;Like suggested in this question &lt;a href=&quot;https://emacs.stackexchange.com/questions/10167/how-to-automatically-run-inferior-process-when-loading-major-mode-for-the-first&quot;&gt;How to automatically run inferior process when loading major mode for the first time?&lt;/a&gt; I want to automatically run &lt;code&gt;run-python&lt;/code&gt; when entering python major mode. However,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook 'run-python)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;doesn't work and gives the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong number of arguments: (1 . 3), 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which argument is needed by &lt;code&gt;run-python&lt;/code&gt;? How to automatically start an inferior python interpreter when entering &lt;code&gt;python-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: After &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;toggle-debug-on-error&lt;/code&gt; the output gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 3) 0)&#xA;run-python()&#xA;run-hooks(change-major-mode-after-body-hook prog-mode-hook python-mode-hook)&#xA;apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook python-mode-hook))&#xA;run-mode-hooks(python-mode-hook)&#xA;python-mode()&#xA;call-interactively(python-mode record nil)&#xA;command-execute(python-mode record)&#xA;execute-extended-command(nil &quot;python-mode&quot;)&#xA;call-interactively(execute-extended-command nil nil)&#xA;command-execute(execute-extended-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2757" LastEditorUserId="2757" LastEditDate="2015-09-05T16:53:43.337" LastActivityDate="2015-09-06T13:12:55.597" Title="How to automatically run inferior process when loading major mode?" Tags="|init-file|python|shell|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16362" PostTypeId="1" AcceptedAnswerId="16364" CreationDate="2015-09-05T16:12:25.403" Score="6" ViewCount="765" Body="&lt;p&gt;I am thinking of binding C-x C-e to a single command, which does eval-last-sexp if there is no selection or eval-region if there is a selection. This is what I have tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/eval()&#xA;(interactive)&#xA;(if (region-active-p) (eval-region region-beginning region-end)&#xA;(eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)))&#xA;(global-set-key (kbd &quot;C-x C-e&quot;) 'my/eval)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-06-22T20:34:46.573" LastActivityDate="2016-06-22T20:34:46.573" Title="How to set a key binding conditional to evaluate a Lisp expression" Tags="|key-bindings|eval|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16363" PostTypeId="2" ParentId="16361" CreationDate="2015-09-05T17:12:05.617" Score="3" Body="&lt;p&gt;If you look at documentation of &lt;code&gt;run-python&lt;/code&gt;, &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;run-python&lt;/code&gt; you would notice that requires on parameter &lt;code&gt;cmd&lt;/code&gt;. When that command is called interactively emacs calculates that parameter (see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&quot; rel=&quot;nofollow&quot;&gt;Using interactive&lt;/a&gt; or &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;interactive&lt;/code&gt; to understand the mechanism). However when called from elisp, the &lt;code&gt;cmd&lt;/code&gt; need to be explicitly passed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are couple of ways to solve this -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Write a custom function which calls &lt;code&gt;run-python&lt;/code&gt; with proper arguments, something like following, and add it to &lt;code&gt;python-mode-hook&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-run-python ()&#xA;    (run-python (python-shell-parse-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After understanding your problems with the above approach I came up with the following function, hopefully this is what you are looking for&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-run-python ()&#xA;  (save-selected-window&#xA;    (switch-to-buffer-other-window (process-buffer (python-shell-get-or-create-process (python-shell-parse-command))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) Add the function &lt;code&gt;python-shell-switch-to-shell&lt;/code&gt; which does not expect any arguments, to &lt;code&gt;python-mode-hook&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-06T13:12:55.597" LastActivityDate="2015-09-06T13:12:55.597" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16364" PostTypeId="2" ParentId="16362" CreationDate="2015-09-05T17:38:53.530" Score="11" Body="&lt;p&gt;First of all, a few stylistic recommendations. (Style is important in&#xA;programming :-D) In Lisps, we use dashes as separators, so your function is&#xA;better called &lt;code&gt;my-eval&lt;/code&gt;, not &lt;code&gt;my/eval&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval()&#xA;(interactive)&#xA;(if (region-active-p) (eval-region region-beginning region-end)&#xA;(eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)))&#xA;(global-set-key (kbd &quot;C-x C-e&quot;) 'my-eval)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, Lisp code is bare syntax trees, so they have levels of nesting and&#xA;proper indentation is very important, it helps to see how expressions are&#xA;composed. Also, it's a good idea to have one empty line between top level&#xA;forms:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (eval-region region-beginning region-end)&#xA;    (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)))&#xA;&#xA;(global-set-key (kbd &quot;C-x C-e&quot;) 'my-eval)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Isn't it beautiful?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find out more about &lt;code&gt;region-beginning&lt;/code&gt; and &lt;code&gt;region-end&lt;/code&gt; with help of&#xA;built-in help system: type &lt;kbd&gt;C-h f region-beginning RET&lt;/kbd&gt;. Here we&#xA;see that this is a function, actually. You call this function and it returns&#xA;position of beginning of region. To call functions you place their names on&#xA;the first position in a form:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(function-name arg1 arg2 ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;region-beginning&lt;/code&gt; and &lt;code&gt;region-end&lt;/code&gt; don't take arguments we write:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (eval-region (region-beginning) (region-end))&#xA;    (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Great. Now we only need to fix &lt;code&gt;EVAL-LAST-SEXP-ARG-INTERNAL&lt;/code&gt;. As written&#xA;you're trying to use value that symbol &lt;code&gt;EVAL-LAST-SEXP-ARG-INTERNAL&lt;/code&gt; is bound&#xA;to, but chances are it's not bound to any value, so you will get an&#xA;error. You can read about first argument of &lt;code&gt;eval-last-sexp&lt;/code&gt; using the same&#xA;trick: &lt;kbd&gt;C-h f eval-last-sexp RET&lt;/kbd&gt;. Documentation tells us how the&#xA;argument is used, it's mainly used to handle various interactive details. We&#xA;can preserve these behavioral details in &lt;code&gt;my-eval&lt;/code&gt; this way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (eval-region (region-beginning) (region-end))&#xA;    (call-interactively #'eval-last-sexp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should do the trick. Note that when there is a region, &lt;code&gt;eval-region&lt;/code&gt;&#xA;won't print anything in the mini-buffer. If this is not the desired&#xA;behavior, supply the &lt;code&gt;print-flag&lt;/code&gt; argument:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (eval-region (region-beginning) (region-end) t)&#xA;    (call-interactively #'eval-last-sexp)))&#xA;&#xA;(global-set-key (kbd &quot;C-x C-e&quot;) #'my-eval)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-05T17:38:53.530" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="16365" PostTypeId="1" CreationDate="2015-09-05T18:39:26.873" Score="2" ViewCount="166" Body="&lt;p&gt;I have a  dired buffer with two files&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo.py&#xA;foo_bar.py&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now to rename &lt;code&gt;foo.py&lt;/code&gt; to &lt;code&gt;bar.py&lt;/code&gt;, if  i goto &lt;code&gt;foo.py&lt;/code&gt;,  press &lt;code&gt;R&lt;/code&gt; and type &lt;code&gt;bar.py&lt;/code&gt;, helm selection  will be like  this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/01V2q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/01V2q.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here helm is selecting  the top match  from the available file names.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i make helm to select the  user typed value as the default choice?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-05T18:39:26.873" Title="Helm - How to change default selection while renaming?" Tags="|helm|dired|helm-sources|helm-selection|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16366" PostTypeId="5" CreationDate="2015-09-05T18:48:37.207" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-09-05T18:48:37.207" LastActivityDate="2015-09-05T18:48:37.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16367" PostTypeId="4" CreationDate="2015-09-05T18:48:37.207" Score="0" Body="Helm sources will provide the input for the helm buffer.  Each source should have a name,  a list of candidates and an action that works on the selected candidate." OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-06T00:37:58.350" LastActivityDate="2015-09-06T00:37:58.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16368" PostTypeId="1" CreationDate="2015-09-05T21:55:28.373" Score="2" ViewCount="395" Body="&lt;p&gt;When using emacs, C-S-Backspace seems to only delete one char and not the whole line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Killing-by-Lines.html&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; I see the text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;C-S-backspace (kill-whole-line) kills a whole line including its&#xA;  newline, regardless of the position of point within the line. Note&#xA;  that many text terminals will prevent you from typing the key sequence&#xA;  C-S-backspace.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This might explain my problem, but does not give me a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Checking topics like &lt;a href=&quot;https://emacs.stackexchange.com/questions/7927/controlmeta-key-is-not-working&quot;&gt;this&lt;/a&gt; gives some explanation to possible Ubuntu based issues, but they seem to be GUI based. I'm using the Awesome window manager with the default configs. I don't see anything bound to those keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Ubuntu with Awesome WM. My terminal is XTerm. I'm using emacs 24.3.1.&lt;/p&gt;&#xA;" OwnerUserId="9429" LastEditorUserId="253" LastEditDate="2015-09-06T22:12:12.183" LastActivityDate="2015-09-06T22:12:12.183" Title="C-S-Backspace not working" Tags="|key-bindings|terminal-emacs|" AnswerCount="0" CommentCount="3" ClosedDate="2015-09-09T11:01:47.473" ContentLicense="CC BY-SA 3.0" />
  <row Id="16369" PostTypeId="2" ParentId="7890" CreationDate="2015-09-05T23:23:18.033" Score="0" Body="&lt;p&gt;I do a package-install org-plus-contrib manually, but then subsequently do use-package org. Finally, a subsequent M-x org-version indicates that the org provided by org-plus-contrib is indeed used and all is well.&lt;/p&gt;&#xA;" OwnerUserId="8353" LastActivityDate="2015-09-05T23:23:18.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16370" PostTypeId="1" AcceptedAnswerId="16373" CreationDate="2015-09-05T23:27:46.130" Score="1" ViewCount="26" Body="&lt;p&gt;I generally use &lt;code&gt;icicles&lt;/code&gt; to execute a large number of parallel actions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I find myself doing often is narrowing the number of candidates, and spamming &lt;kbd&gt;C-&amp;lt;next&amp;gt;&lt;/kbd&gt; to execute an action on all of the matching candidates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been through the docs, and I can't find a more efficient way to do it. Is there a more finger-friendly way to execute an action on all current candidates?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-09-06T04:51:58.143" Title="icicles execute action on all candidates" Tags="|icicles|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16371" PostTypeId="1" CreationDate="2015-09-05T23:56:26.887" Score="0" ViewCount="61" Body="&lt;p&gt;Context:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M-x org-version =&gt; Org-mode version 8.3.1 (8.3.1-95-g1dbb25-elpaplus @ /Users/username-here/elisp/elpa/org-plus-contrib-20150831/)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Executing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_R[:results value]{sin(0)} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yields:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{{{results(=0=)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Before I updated to this latest version of org-plus-contrib, i.e., when I was using org from git source, it yielded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=0=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Have others run into this (my google search didn't yield anthing)? Can you help me determine the issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="8353" LastActivityDate="2015-09-05T23:56:26.887" Title="Extraneous output of org-mode inline source block results in org" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16373" PostTypeId="2" ParentId="16370" CreationDate="2015-09-06T04:46:12.230" Score="0" Body="&lt;p&gt;Use &lt;code&gt;C-!&lt;/code&gt; to act on all candidates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;M-!&lt;/code&gt; is similar, but slightly different.  And &lt;code&gt;C-|&lt;/code&gt; and &lt;code&gt;M-|&lt;/code&gt; are parallel, but they perform an &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_More_About_Multi-Commands#AlternativeActions&quot; rel=&quot;nofollow&quot;&gt;alternative action&lt;/a&gt; on all candidates.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Choose_All_Candidates&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles - Choose All Completion Candidates&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is also explained at other locations in the doc (e.g. with examples).  See, for example, the intro section &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View&quot; rel=&quot;nofollow&quot;&gt;Icicles - A Nutshell View&lt;/a&gt; -- &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#SecondExampleMultiCompletion&quot; rel=&quot;nofollow&quot;&gt;this example&lt;/a&gt;, for instance.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-06T04:51:58.143" LastActivityDate="2015-09-06T04:51:58.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16374" PostTypeId="1" CreationDate="2015-09-06T09:35:45.767" Score="1" ViewCount="711" Body="&lt;p&gt;I run an emacs server on a remote server.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I access this server with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ssh user@server -Y 'emacsclient -c &amp;amp;'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;everything works fine until I close the client.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SSH session doesn't end,once I kill the SSH session,emacs server process die...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway to make emacs server process immortal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The server is  Raspbian on raspberrypi.&#xA;Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.5.2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with configure option &lt;code&gt;--with-x-toolkit=lucid&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="9432" LastEditorUserId="9432" LastEditDate="2015-09-07T02:05:08.467" LastActivityDate="2015-09-11T01:25:44.223" Title="access remote emacs server via ssh crashed" Tags="|ssh|server|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16375" PostTypeId="1" AcceptedAnswerId="16377" CreationDate="2015-09-06T10:19:19.637" Score="14" ViewCount="3022" Body="&lt;p&gt;Sometimes I need to set same value to multiple variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Python, I could do&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-python prettyprint-override&quot;&gt;&lt;code&gt;f_loc1 = f_loc2 = &quot;/foo/bar&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in elisp, I am writing&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq f_loc1 &quot;/foo/bar&quot; f_loc2 &quot;/foo/bar&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am wondering if there a way to achieve this using &lt;code&gt;&quot;/foo/bar&quot;&lt;/code&gt; only once?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2016-06-22T20:33:28.593" LastActivityDate="2016-06-22T20:33:28.593" Title="Assigning same value to multiple variables?" Tags="|variables|setq|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16377" PostTypeId="2" ParentId="16375" CreationDate="2015-09-06T10:36:09.330" Score="22" Body="&lt;p&gt;&lt;code&gt;setq&lt;/code&gt; returns the value, so you can just:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq f-loc1 (setq f-loc2 &quot;/foo/bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of if you don't want to rely on that, then use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq f-loc1 &quot;/foo/bar&quot; f-loc2 f-loc1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Personally I would avoid the latter and instead write:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq f-loc1 &quot;/foo/bar&quot;&#xA;      f-loc2 f-loc1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or even&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq f-loc1 &quot;/foo/bar&quot;)&#xA;(setq f-loc2 f-loc1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the very first approach I would only use in rather special circumstances where it actually &lt;em&gt;emphasis&lt;/em&gt; the intention, or when the alternative would be to use the second approach or else &lt;code&gt;progn&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;You can stop reading here if the above makes you happy. But I think this is a good opportunity to warn you and others not to abuse macros.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Finally, while it is tempting to write a macro like &lt;code&gt;setq-every&lt;/code&gt; &quot;because this is lisp and we can&quot;, I would strongly recommend against doing so. You gain very little by doing it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-every value a b)&#xA;   vs&#xA;(setq a (setq b value))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But at the same time you make it much harder for other readers to read the code and be sure what happens. &lt;code&gt;setq-every&lt;/code&gt; could be implemented in various ways and other users (including a future you) cannot know which one the author choose, just by looking at code that uses it. &lt;em&gt;[I originally made some examples here but those were considered sarcastic and a rant by someone.]&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can deal with that mental overhead every time you look at &lt;code&gt;setq-every&lt;/code&gt; or you can just live with a single extra character. (At least in the case where you have to set only two variables, but I cannot remember that I ever had to set more than two variables to the same value at once. If you have to do that, then there is probably something else wrong with your code.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand if you are truly going to use this macro more than maybe half a dozen times, then the additional indirection might be worth it. For example I use macros like &lt;code&gt;--when-let&lt;/code&gt; from the &lt;code&gt;dash.el&lt;/code&gt; library. That does make it harder for those who first come across it in my code, but overcoming that difficulty in understanding is worth it because it is used more than just a very few times and, at least in my opinion, it makes the code more readable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One could argue that the same applies to &lt;code&gt;setq-every&lt;/code&gt;, but I think that it is very unlikely that this particular macro would be used more than a few times. A good rule of thumb is that when the definition of the macro (including the doc-string) adds more code than the use of the macro removes, then the macro very likely is overkill (the reverse isn't necessarily true though).&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="675" LastEditDate="2016-03-17T00:53:58.170" LastActivityDate="2016-03-17T00:53:58.170" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16378" PostTypeId="1" AcceptedAnswerId="16422" CreationDate="2015-09-06T11:19:33.710" Score="0" ViewCount="81" Body="&lt;p&gt;I want to use the json.el included in 24.5, but cannot do that, because gnus includes an older version of json.el that is loaded before the one from 24.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When running &lt;code&gt;list-load-path-shadows&lt;/code&gt; I got this as one of the shadows:&#xA;&lt;code&gt;/usr/share/emacs/site-lisp/gnus/gnus-fallback-lib/json hides /usr/share/emacs/24.5/lisp/json&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I prevent the fallback json from being loaded?&lt;/p&gt;&#xA;" OwnerUserId="2523" LastActivityDate="2015-09-07T16:52:22.813" Title="How to load json.el included in emacs instead of fallback lib included in gnus" Tags="|gnus|load-path|json|site-lisp|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="16379" PostTypeId="2" ParentId="16375" CreationDate="2015-09-06T11:21:43.507" Score="13" Body="&lt;h2&gt;A macro to do what you want&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As an exercise of a sort:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro setq-every (value &amp;amp;rest vars)&#xA;  &quot;Set every variable from VARS to value VALUE.&quot;&#xA;  `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now try it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-every &quot;/foo/bar&quot; f-loc1 f-loc2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;How does it work&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Since people are curious how it works (according to comments), here is&#xA;an explanation. To really learn how to write macros pick a good Common Lisp&#xA;book (yes, Common Lisp, you will be able to do the same stuff in Emacs Lisp,&#xA;but Common Lisp is a bit more powerful and has better books, IMHO).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Macros operate on raw code. Macros don't evaluate their arguments (unlike&#xA;functions). So we have here unevaluated &lt;code&gt;value&lt;/code&gt; and collection of &lt;code&gt;vars&lt;/code&gt;,&#xA;which for our macro are just symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;progn&lt;/code&gt; groups several &lt;code&gt;setq&lt;/code&gt; forms into one. This thing:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapcar (lambda (x) (list 'setq x value)) vars)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just generates a list of &lt;code&gt;setq&lt;/code&gt; forms, using OP's example it will be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((setq f-loc1 &quot;/foo/bar&quot;) (setq f-loc2 &quot;/foo/bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You see, the form is &lt;em&gt;inside&lt;/em&gt; of backquote form and is prefixed with a comma&#xA;&lt;code&gt;,&lt;/code&gt;. Inside backquoted form everything is quoted as usually, but &lt;code&gt;,&lt;/code&gt;&#xA;“turns-on” evaluation temporarily, so entire &lt;code&gt;mapcar&lt;/code&gt; is evaluated at&#xA;macroexpansion time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally &lt;code&gt;@&lt;/code&gt; removes outer parenthesis from list with &lt;code&gt;setq&lt;/code&gt;s, so we get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (setq f-loc1 &quot;/foo/bar&quot;)&#xA;  (setq f-loc2 &quot;/foo/bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Macros can arbitrary transform your source code, isn't it great?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;A caveat&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is a small caveat, first argument will be evaluated several times,&#xA;because this macro essentially expands to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (setq f-loc1 &quot;/foo/bar&quot;)&#xA;  (setq f-loc2 &quot;/foo/bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You see, if you have a variable or string here it's OK, but if you write&#xA;something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-every (my-function-with-side-effects) f-loc1 f-loc2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then your function will be called more than once. This may be&#xA;undesirable. Here is how to fix it with help of &lt;code&gt;once-only&lt;/code&gt; (available in&#xA;&lt;a href=&quot;https://github.com/mrkkrp/mmt&quot;&gt;MMT package&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro setq-every (value &amp;amp;rest vars)&#xA;  &quot;Set every variable from VARS to value VALUE.&#xA;&#xA;VALUE is only evaluated once.&quot;&#xA;  (mmt-once-only (value)&#xA;    `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the problem is gone.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-09-08T07:41:56.993" LastActivityDate="2015-09-08T07:41:56.993" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="16380" PostTypeId="2" ParentId="16375" CreationDate="2015-09-06T12:06:29.857" Score="7" Body="&lt;p&gt;Since you can use and manipulate symbols in lisp, you could simply loop over a list of symbols and use &lt;code&gt;set&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (var '(foo bar baz)) (set var 10))&#xA;&#xA;(mapc (lambda (var) (set var 10)) '(foo bar baz))&#xA;&#xA;(loop for var in '(foo bar baz) do (set var 11))&#xA;&#xA;(--each '(foo bar baz) (set it 10))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="5187" LastEditDate="2015-09-06T13:55:21.277" LastActivityDate="2015-09-06T13:55:21.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16381" PostTypeId="2" ParentId="15298" CreationDate="2015-09-06T12:23:41.090" Score="1" Body="&lt;p&gt;There was a problem in renaming of files over directory boundaries. Should be fixed now in filenotify.el. Pls try a recent rebuild of Emacs 25.0.50.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-09-06T12:23:41.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16382" PostTypeId="1" AcceptedAnswerId="16387" CreationDate="2015-09-06T12:32:35.290" Score="9" ViewCount="2034" Body="&lt;p&gt;I'm looking for an emacs function that will delete all whitespace from the cursor position (including newlines) until the first non-whitespace character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if my cursor is positioned at the end of the first line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;main(arg1,&#xA;     arg2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The delete function would result in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;main(arg1,arg2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2516" LastActivityDate="2024-02-22T18:57:40.470" Title="How to delete all whitespace up to the first non-whitespace character?" Tags="|whitespace|deletion|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16383" PostTypeId="1" AcceptedAnswerId="16384" CreationDate="2015-09-06T12:59:09.370" Score="1" ViewCount="123" Body="&lt;p&gt;Consider a buffer as below. As explained in the documentation &lt;code&gt;.&lt;/code&gt; matches any character but newline. Also &lt;code&gt;\n&lt;/code&gt; matches newline. So evaluating &lt;code&gt;(re-search-forward &quot;a\(.\|\n\)*b&quot; nil t)&lt;/code&gt; should normally have a match in this document. But it does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(As explained in &lt;a href=&quot;https://emacs.stackexchange.com/a/9549/&quot;&gt;https://emacs.stackexchange.com/a/9549/&lt;/a&gt; when using regular expressions interactively, &lt;code&gt;a\(.\| C-q C-j \)&lt;/code&gt; seems to be fine in this situation).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a&#xA;b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-09-06T13:07:06.003" Title="How to non-interactively use regular expressions over more than one line?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16384" PostTypeId="2" ParentId="16383" CreationDate="2015-09-06T13:07:06.003" Score="4" Body="&lt;p&gt;You should escape your regexp string properly:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(re-search-forward &quot;a\\(.\\|\n\\)*b&quot; nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I place cursor at the beginning of buffer with given contents and&#xA;evaluate expression (via &lt;code&gt;eval-expression&lt;/code&gt;) I get answer &lt;code&gt;4&lt;/code&gt;. That's a&#xA;match.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-06T13:07:06.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16385" PostTypeId="2" ParentId="16382" CreationDate="2015-09-06T13:16:17.563" Score="4" Body="&lt;p&gt;I use this quite often:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun join-line* ()&#xA;  &quot;Join this line with the next line deleting extra white space.&quot;&#xA;  (interactive)&#xA;  (join-line t))&#xA;&#xA;(global-set-key (kbd &quot;M-j&quot;) #'join-line*) ;; just key binding I use…&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-06T13:16:17.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16386" PostTypeId="2" ParentId="16359" CreationDate="2015-09-06T14:14:53.217" Score="4" Body="&lt;p&gt;You could perhaps use font-lock's indirection mechanism, setting &lt;code&gt;font-lock-fontify-region-function&lt;/code&gt; to a function which let-binds &lt;code&gt;data-cache&lt;/code&gt; around the call to the prior value of &lt;code&gt;font-lock-fontify-region-function&lt;/code&gt;. Sort of like an around-advice, except the indirection mechanism allows you to do it in a cleaner way.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-06T14:14:53.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16387" PostTypeId="2" ParentId="16382" CreationDate="2015-09-06T14:31:03.447" Score="7" Body="&lt;p&gt;You might find the &lt;a href=&quot;https://github.com/nflath/hungry-delete&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;hungry-delete&lt;/code&gt;&lt;/a&gt; package useful. I personally bind &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;delete&lt;/kbd&gt; to delete whitespace after point, and &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;backspace&lt;/kbd&gt; to delete whitespace before point like so&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c &amp;lt;backspace&amp;gt;&quot;) 'hungry-delete-backward)&#xA;(global-set-key (kbd &quot;C-c &amp;lt;deletechar&amp;gt;&quot;) 'hungry-delete-forward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;update: as of 12.2018 function definitions changed hence:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c &amp;lt;backspace&amp;gt;&quot;) 'c-hungry-delete-backward)&#xA;(global-set-key (kbd &quot;C-c &amp;lt;deletechar&amp;gt;&quot;) 'c-hungry-delete-forward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="20282" LastEditDate="2018-12-28T06:22:47.537" LastActivityDate="2018-12-28T06:22:47.537" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16388" PostTypeId="1" AcceptedAnswerId="16395" CreationDate="2015-09-06T15:07:48.417" Score="6" ViewCount="61" Body="&lt;p&gt;How to check if a specific package is used by a LaTeX document.&#xA;For example in the below document (intentionally written in an ugly but technically correct format), the packages fontenc, inputenc, csquotes,&#xA;babel, libertine, amsmath, biblatex, filecontents, tikz are used but&#xA;lettrine, cleveref, tocloft are not used (because they are in a comment area).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;    \documentclass[ngerman]{article}&#xA;    \usepackage[T1]{fontenc, &#xA;    %babel,&#xA;    }&#xA;    %\usepackage{cleveref}&#xA;    \usepackage&#xA;[utf8&#xA;]&#xA;{inputenc}&#xA;    \usepackage{babel, csquotes&#xA;&#xA;    tikz, &#xA;               % lettrine&#xA;    amsmath,libertine&#xA;    }&#xA;&#xA;    \usepackage[backend=biber, style=authortitle]{biblatex} &#xA;    \usepackage&#xA;    {&#xA;    filecontents,&#xA;&#xA;    %tocloft}&#xA;    }&#xA;&#xA;&#xA;    \begin{document}&#xA;&#xA;    \end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-09-08T06:01:55.527" LastActivityDate="2015-09-08T06:01:55.527" Title="How to check with regular expressions or another way if some package is used in a LaTeX document?" Tags="|latex|auctex|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16389" PostTypeId="2" ParentId="16382" CreationDate="2015-09-06T15:39:06.940" Score="2" Body="&lt;p&gt;Yet another solution&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (delete-region (point)&#xA;                 (+ (save-excursion (skip-chars-forward &quot; \n&quot;))&#xA;                    (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="15748" LastEditDate="2018-12-28T11:23:11.777" LastActivityDate="2018-12-28T11:23:11.777" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16390" PostTypeId="1" AcceptedAnswerId="16403" CreationDate="2015-09-06T17:16:32.633" Score="3" ViewCount="110" Body="&lt;p&gt;I am going through emacs inbuilt &lt;code&gt;Elisp&lt;/code&gt; tutorial. By default emacs fontifies( changes color ) visited  links color like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/trNpN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/trNpN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This fontification lasts only for current session. If i restart emacs, all fontification will be lost. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How  can i make  emacs to remember visited  links even after  restarting emacs so that it will be much easier for me to resume where  i have stopped?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-07T05:03:30.567" Title="Remember visited links in manual" Tags="|hyperlinks|info|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16392" PostTypeId="1" CreationDate="2015-09-06T19:39:34.710" Score="9" ViewCount="5584" Body="&lt;p&gt;&lt;code&gt;C-u C-u C-c C-x C-l&lt;/code&gt; or &lt;code&gt;(org-toggle-prefix-fragment)&lt;/code&gt; with the double prefix argument used to toggle the display of LaTeX fragments across the whole buffer whether they were inside of &lt;code&gt;#+BEGIN_LaTeX&lt;/code&gt; blocks or not. Now that behavior seems to have changed, as only LaTeX snippets outside of blocks are rendered. This isn't that big of a deal since export works as expected. However, I did like the old behavior. Is there a variable I need to set to restore the previous behavior? Alternatively, I'd like to typeset the equation and then have it generate an image file which gets saved to the buffer and inserted inline in the same way as the babel source blocks allow. Is that possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below I give an example of how it works now:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hmNQl.png&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hmNQl.png&quot; alt=&quot;example&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2015-09-06T21:08:10.710" LastActivityDate="2016-12-30T08:50:52.393" Title="rendering latex code inside #+BEGIN_LaTeX ... #+END_LaTeX in org-mode 8.3.1" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16393" PostTypeId="1" AcceptedAnswerId="16411" CreationDate="2015-09-06T19:49:22.410" Score="4" ViewCount="60" Body="&lt;p&gt;Is there any way to forbid insertion of text before and after specific overlay? (I mean on the same line that displays overlay.) &lt;em&gt;Forbid&lt;/em&gt; means that either changes cancelled somehow or immediately reverted, or something like this. I'm ready to consider other options as well.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-09-06T19:54:25.127" LastActivityDate="2015-09-07T08:43:27.113" Title="Forbid inserting text before and after overlay" Tags="|overlays|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16394" PostTypeId="2" ParentId="13927" CreationDate="2015-09-06T20:48:39.790" Score="20" Body="&lt;p&gt;Dependent on your desktop environment the method to set a default application may differ.  That said, many desktop environments respect the associations in &lt;code&gt;~/.local/share/applications/mimeapps.list&lt;/code&gt;, where you can set up an association for the &lt;code&gt;application/x-directory&lt;/code&gt; and/or &lt;code&gt;inode/directory&lt;/code&gt; types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;mimeapps.list&lt;/code&gt; looks like this now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Default Applications]&#xA;application/x-directory=emacs-dired.desktop&#xA;inode/directory=emacs-dired.desktop&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the same directory I have a file called &lt;code&gt;emacs-dired.desktop&lt;/code&gt; with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Desktop Entry]&#xA;Encoding=UTF-8&#xA;Version=1.0&#xA;Type=Application&#xA;NoDisplay=true&#xA;Exec=emacsclient --eval '(dired &quot;%f&quot;)'&#xA;Name=Dired&#xA;Comment=Emacs Dired&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When my long-lived instance of Emacs runs a server (&lt;code&gt;M-x server-start&lt;/code&gt;) and I click on, say, the folder icon in the list of Downloads in Icecat a new &lt;code&gt;dired&lt;/code&gt; buffer is opened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This actually works for me now.  Thanks for asking the question --- otherwise I would not have set this up.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-09-06T20:48:39.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16395" PostTypeId="2" ParentId="16388" CreationDate="2015-09-06T21:26:26.817" Score="6" Body="&lt;p&gt;You should look into &lt;code&gt;TeX-active-styles&lt;/code&gt; variable.  For this document its value is&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(&quot;url&quot; &quot;ifthen&quot; &quot;logreq&quot; &quot;kvoptions&quot; &quot;keyval&quot; &quot;etoolbox&quot; &quot;biblatex&quot;&#xA; &quot;libertine&quot; &quot;amsopn&quot; &quot;amsbsy&quot; &quot;amstext&quot; &quot;amsmath&quot; &quot;tikz&quot; &quot;csquotes&quot;&#xA; &quot;ngerman&quot; &quot;babel&quot; &quot;&quot; &quot;fontenc&quot; &quot;art10&quot; &quot;article&quot; &quot;latex2e&quot; &quot;z&quot;&#xA; &quot;LATEX&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the function you should use is &lt;code&gt;member&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(member &quot;fontenc&quot; TeX-active-styles)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the same check you should do for classes (see also &lt;a href=&quot;https://emacs.stackexchange.com/q/12538/620&quot;&gt;this question&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, if you want to check whether a certain option has been passed to package there is &lt;code&gt;LaTeX-provided-package-options-member&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(LaTeX-provided-package-options-member &quot;fontenc&quot; &quot;T1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-09-06T21:32:24.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16396" PostTypeId="2" ParentId="16392" CreationDate="2015-09-06T21:31:45.990" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Now that behavior seems to have changed, as only LaTeX snippets outside of blocks are rendered.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Depends where the active point is. Here's the excerpt from the documentation for org-toggle-latex-fragment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;If the cursor is on a LaTeX fragment, create the image and overlay&#xA;it over the source code, if there is none.  Remove it otherwise.&#xA;If there is no fragment at point, display all fragments in the&#xA;current section.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;With prefix ARG, preview or clear image for all fragments in the&#xA;current subtree or in the whole buffer when used before the first&#xA;headline.  With a double prefix ARG C-u C-u preview or clear images&#xA;for all fragments in the buffer.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'd like to typeset the equation and then have it generate an image file which gets saved to the buffer and inserted inline in the same way as the babel source blocks allow. Is that possible?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, just enclose them org-babel blocks like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: hello-world&#xA;#+BEGIN_SRC latex :exports results :file test.png&#xA;\LaTeX&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second example in the LaTeX Source Code Blocks in Org Mode &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; shows how to embed latex generated graphics as png file in an org file.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-06T21:31:45.990" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16397" PostTypeId="2" ParentId="15269" CreationDate="2015-09-06T22:50:07.227" Score="2" Body="&lt;p&gt;Thank you. I've reproduced it in the current master and pushed a fix: &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=770db45d6769134aa3a853e2ff38089a1e8a3327&quot; rel=&quot;nofollow&quot;&gt;770db45d6769&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't build Emacs from Git, you can try applying this patch to your currently installed version.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2015-09-06T22:50:07.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16398" PostTypeId="1" AcceptedAnswerId="16407" CreationDate="2015-09-06T23:02:52.123" Score="16" ViewCount="2422" Body="&lt;p&gt;I want my emacs to automatically upgrade all packages under certain conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2018-03-13T03:22:39.217" Title="Noninteractively upgrade all packages" Tags="|package|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16399" PostTypeId="1" CreationDate="2015-09-07T00:38:21.727" Score="2" ViewCount="192" Body="&lt;p&gt;I think I know how to control automatic evaluation of code blocks with the &lt;code&gt;:exports&lt;/code&gt; keyword and with the &lt;code&gt;#+call:&lt;/code&gt; tag, but my blocks only leave &lt;code&gt;#+RESULTS:&lt;/code&gt; when I run them manually via &lt;code&gt;C-c C-c&lt;/code&gt;.  Is automatic code eval-on-export only for side effects?  Here is a MVE:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here's a source block that executes automatically (modulo security)&#xA;when we say ~M-x org-latex-export-to-pdf~&#xA;&#xA;#+name: square&#xA;#+header: :var x=0&#xA;#+begin_src python :exports code&#xA;  return x*x&#xA;#+end_src&#xA;&#xA;It seems to execute automatically because of the following&#xA;~#+call~ tag: if I remove the tag, the code doesn't execute&#xA;automatically any more:&#xA;&#xA;#+call: square(7)&#xA;&#xA;In any case, it only leaves a result in the emacs buffer under a&#xA;~#+RESULTS:~ tag if I run it manually via =C-c C-c=.  Why&#xA;doesn't it leave a result when it runs automatically?  Is automatic&#xA;running only for side effects?&#xA;&#xA;Here is a code block that runs automatically only if I say&#xA;~:exports both~ or ~:exports results~.&#xA;&#xA;#+name: ftw-python&#xA;#+begin_src python :exports both&#xA;  return 43&#xA;#+end_src&#xA;&#xA;It also doesn't leave a result unless I run it manually.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="596" LastEditorUserId="596" LastEditDate="2015-09-07T01:58:23.117" LastActivityDate="2015-09-07T01:58:23.117" Title="eval-on-export not leaving RESULTS in org-mode?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16400" PostTypeId="2" ParentId="16374" CreationDate="2015-09-07T02:29:06.423" Score="1" Body="&lt;p&gt;I have solved this problem.Thanks &lt;a href=&quot;https://emacs.stackexchange.com/users/7045/emacs-user&quot;&gt;Emacs User&lt;/a&gt;'s help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to manage emacs-server process with &lt;a href=&quot;http://byobu.co/&quot; rel=&quot;nofollow noreferrer&quot;&gt;byobu&lt;/a&gt;.Then the process die...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;start-stop-daemon -c $USER -d /$USERHOME --start --quiet --pidfile $PIDFILE --exec $EMACS -- &quot;--daemon&quot; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;see &lt;a href=&quot;http://www.emacswiki.org/emacs/EmacsAsDaemon&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsAsDaemon&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9432" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-07T02:29:06.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16401" PostTypeId="2" ParentId="16398" CreationDate="2015-09-07T03:57:17.050" Score="9" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/rranelli/auto-package-update.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;auto-package-update&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install it by &lt;code&gt;M-x package-install auto-update-package&lt;/code&gt;. It provides a function called &lt;code&gt;auto-package-update-now&lt;/code&gt;. You can write a simple &lt;code&gt;if&lt;/code&gt; condition and add that to your &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if your-condition&#xA;   (auto-package-update-now))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="3885" LastEditDate="2018-03-13T03:22:39.217" LastActivityDate="2018-03-13T03:22:39.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16402" PostTypeId="1" CreationDate="2015-09-07T03:57:21.433" Score="1" ViewCount="114" Body="&lt;p&gt;I asked this questions on &lt;a href=&quot;https://github.com/davidhalter/jedi/issues/623#issuecomment-138132983&quot; rel=&quot;nofollow&quot;&gt;Github&lt;/a&gt;&#xA;I have just switched form auto-complete mode to company mode, but the error message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (emacs): Unable to activate package jedi'. Required packageauto-complete-&gt;1.4' is unavailable&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;pops out. Do I have to install &quot;auto-complete&quot; (even I don't use it) to activate jedi?&lt;/p&gt;&#xA;" OwnerUserId="9281" LastActivityDate="2015-09-08T05:46:49.667" Title="Dependency of auto-complete" Tags="|package-repositories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16403" PostTypeId="2" ParentId="16390" CreationDate="2015-09-07T04:04:30.673" Score="7" Body="&lt;p&gt;The history of visited nodes is stored in the variable &lt;code&gt;Info-history-list&lt;/code&gt;. You will need to persist this variable across sessions. One way to do so it to use &lt;code&gt;desktop-mode&lt;/code&gt;. Desktop mode automatically persists the variables that are declared in &lt;code&gt;desktop-globals-to-save&lt;/code&gt;. So if you use &lt;code&gt;desktop-mode&lt;/code&gt; something like the following should doe the trick&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'desktop-globals-to-save 'Info-history-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you do not use desktop mode, you might have to write your own mechanism to persist the variable. Simplest would be write a function which runs on emacs exit (you can use the hook &lt;code&gt;kill-emacs-hook&lt;/code&gt; to run the function at exit) that serializes the variable to a file using something like &lt;code&gt;prin1-to-string&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will then require another function which runs on emacs startup (you can use &lt;code&gt;after-init-hook&lt;/code&gt; to run functions at startup) which reads the files and uses the function &lt;code&gt;read&lt;/code&gt; to deserialize the the stored variable back. Of course this a lot of work to save a variable so I guess you can just use &lt;code&gt;desktop-mode&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-07T05:03:30.567" LastActivityDate="2015-09-07T05:03:30.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16404" PostTypeId="2" ParentId="16402" CreationDate="2015-09-07T04:07:14.973" Score="2" Body="&lt;p&gt;You need to uninstall &lt;a href=&quot;https://github.com/tkf/emacs-jedi&quot; rel=&quot;nofollow&quot;&gt;jedi&lt;/a&gt; and install &lt;a href=&quot;https://github.com/syohex/emacs-company-jedi&quot; rel=&quot;nofollow&quot;&gt;company-jedi&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2015-09-07T04:07:14.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16405" PostTypeId="2" ParentId="16390" CreationDate="2015-09-07T04:18:18.437" Score="5" Body="&lt;p&gt;@Iqbal gives a great answer to your question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also consider using &lt;strong&gt;bookmarks&lt;/strong&gt; to record Info locations of interest, including a bookmark for where you left off (which you update at the next left-off place, by just setting it again).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is simple to do, and is exactly what you would do with a book or multiple books that you are reading.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-07T04:18:18.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16407" PostTypeId="2" ParentId="16398" CreationDate="2015-09-07T07:30:21.300" Score="12" Body="&lt;p&gt;I'm not sure this is what you want (I don't know what you mean by “under&#xA;certain conditions”), but here is a function I use to upgrade all packages&#xA;without showing &lt;code&gt;*Packages*&lt;/code&gt; buffer, which I find annoying when I just want to&#xA;upgrade packages.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun package-upgrade-all ()&#xA;  &quot;Upgrade all packages automatically without showing *Packages* buffer.&quot;&#xA;  (interactive)&#xA;  (package-refresh-contents)&#xA;  (let (upgrades)&#xA;    (cl-flet ((get-version (name where)&#xA;                (let ((pkg (cadr (assq name where))))&#xA;                  (when pkg&#xA;                    (package-desc-version pkg)))))&#xA;      (dolist (package (mapcar #'car package-alist))&#xA;        (let ((in-archive (get-version package package-archive-contents)))&#xA;          (when (and in-archive&#xA;                     (version-list-&amp;lt; (get-version package package-alist)&#xA;                                     in-archive))&#xA;            (push (cadr (assq package package-archive-contents))&#xA;                  upgrades)))))&#xA;    (if upgrades&#xA;        (when (yes-or-no-p&#xA;               (message &quot;Upgrade %d package%s (%s)? &quot;&#xA;                        (length upgrades)&#xA;                        (if (= (length upgrades) 1) &quot;&quot; &quot;s&quot;)&#xA;                        (mapconcat #'package-desc-full-name upgrades &quot;, &quot;)))&#xA;          (save-window-excursion&#xA;            (dolist (package-desc upgrades)&#xA;              (let ((old-package (cadr (assq (package-desc-name package-desc)&#xA;                                             package-alist))))&#xA;                (package-install package-desc)&#xA;                (package-delete  old-package)))))&#xA;      (message &quot;All packages are up to date&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is well-tried. It also prevents compilation buffers from popping up.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-07T07:30:21.300" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16408" PostTypeId="1" AcceptedAnswerId="16423" CreationDate="2015-09-07T07:31:32.413" Score="2" ViewCount="211" Body="&lt;p&gt;After having a problem with debugging a package I write, I finally tracked down the problem to the following: &lt;code&gt;auto-revert-mode&lt;/code&gt; is making &lt;code&gt;kill-buffer-hook&lt;/code&gt; buffer-local (which is fine by me). The  problem is that every library (auto-)loaded afterwards (while the buffer is still active) only &quot;sees&quot; the buffer-local binding, and any &lt;code&gt;add-hook&lt;/code&gt; only modifies the buffer-local binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few steps to reproduce the problem using only standard emacs libraries:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(find-file &quot;foo.el&quot;)&#xA;&#xA;kill-buffer-hook                  ; =&amp;gt; (uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;(default-value 'kill-buffer-hook) ; =&amp;gt; (uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;&#xA;&#xA;;; Turn on `auto-revert-mode': `kill-buffer-hook' becomes buffer-local&#xA;(auto-revert-mode)&#xA;&#xA;kill-buffer-hook                  ; =&amp;gt; (auto-revert-notify-rm-watch uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;(default-value 'kill-buffer-hook) ; =&amp;gt; (uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;&#xA;&#xA;;; Subsequently load a library which adds a `kill-buffer-hook'&#xA;;;   only the local binding is modified; no other buffer will ever see&#xA;;;   the hook installed by `tramp'&#xA;(require 'tramp)&#xA;&#xA;kill-buffer-hook                  ; =&amp;gt; (tramp-delete-temp-file-function auto-revert-notify-rm-watch uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;(default-value 'kill-buffer-hook) ; =&amp;gt; (uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;&#xA;&#xA;;; The same thing happens (unsurprisingly) for auto-loaded libraries&#xA;(browse-url &quot;emacs.stackexchange.com&quot;)&#xA;&#xA;kill-buffer-hook                  ; =&amp;gt; (browse-url-delete-temp-file tramp-delete-temp-file-function auto-revert-notify-rm-watch uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;(default-value 'kill-buffer-hook) ; =&amp;gt; (uniquify-kill-buffer-function vc-kill-buffer-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I guess my question is: is this normal and desired behaviour? Shouldn't all buffers see the hooks installed by subsequently loaded packages?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although the problem here is specifically caused by &lt;code&gt;auto-revert-mode&lt;/code&gt; and &lt;code&gt;kill-buffer-hook&lt;/code&gt;, I'm guessing this situation is fairly more general and could happen for a lot of libraries and hooks...&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="105" LastEditDate="2016-06-22T20:32:54.613" LastActivityDate="2016-06-22T20:32:54.613" Title="Buffer-local hook shadowing default value for subsequently loaded libraries" Tags="|hooks|buffer-local|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16409" PostTypeId="1" AcceptedAnswerId="16412" CreationDate="2015-09-07T08:26:29.993" Score="8" ViewCount="164" Body="&lt;p&gt;I want to add properties to text (make it &lt;code&gt;read-only&lt;/code&gt; temporarily) and I don't&#xA;want “modification-status” change. In general, how do I perform some&#xA;modifying action without Emacs noticing it?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-07T08:47:04.543" Title="How to perform a modifying action without modifying buffer?" Tags="|buffer-modified|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16411" PostTypeId="2" ParentId="16393" CreationDate="2015-09-07T08:33:01.933" Score="2" Body="&lt;p&gt;Indeed @Dan's advice helped me. My final solution is:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Mark all text beginning one character before overlay (that is including&#xA;newline before it) and ending where overlay ends as read-only:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-text-properties (1- beg) end '(read-only t))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now create overlay.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When it's time to remove overlay don't forget to remove &lt;code&gt;read-only&lt;/code&gt;&#xA;property as well:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((inhibit-read-only t))&#xA;  (remove-text-properties (1- beg) end '(read-only nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-09-07T08:43:27.113" LastActivityDate="2015-09-07T08:43:27.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16412" PostTypeId="2" ParentId="16409" CreationDate="2015-09-07T08:34:42.567" Score="10" Body="&lt;p&gt;There is a built-in macro for this, &lt;code&gt;with-silent-modifications&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its intended usecase is for making changes to text properties of a buffer as text properties are part of the text and changes to them would otherwise be reflected in the buffer modification status and trigger the respective hooks.  Despite there being rudimentary protection against more invasive changes of the text, you should ensure the body doesn't do anything weird:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If BODY performs real modifications to the buffer's text, other than cosmetic ones, undo data may become corrupted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-09-07T08:47:04.543" LastActivityDate="2015-09-07T08:47:04.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16415" PostTypeId="2" ParentId="15245" CreationDate="2015-09-07T09:16:24.643" Score="2" Body="&lt;p&gt;There are multiple ways you can achieve this. Reading your question I see two main requirements&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Parsing a csv file and getting the list of emails from it&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Sending out emails to the list of emails retrieved without recipients seeing other recipients email address&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For first requirement I would suggest you to use &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-pcsv&quot; rel=&quot;nofollow&quot;&gt;pcsv&lt;/a&gt;. Below is an example of of using the library&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'pcsv)&#xA;&#xA;(defun my-get-emails-from-csv (file &amp;amp;optional file-has-header-p)&#xA;  (let* ((csv (pcsv-parse-file file))&#xA;         ;; If csv file has header strip the first element of the list&#xA;         (emails (if file-has-header-p (cdr csv) csv)))&#xA;    ;; Go through the csv entries and format them for mu4e&#xA;    (mapcar (lambda (email) (format &quot;%s &amp;lt;%s&amp;gt;&quot;&#xA;                                    ;; Remove any , in names&#xA;                                    (replace-regexp-in-string &quot;,&quot; &quot;&quot; (cadr email))&#xA;                                    (car email)))&#xA;            emails)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above function will parse the given file and return a list of emails of the format &lt;code&gt;user &amp;lt;email&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this you can define an mail abbrev using &lt;code&gt;define-mail-abbrev&lt;/code&gt; like so&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-mail-abbrev &quot;MyClass&quot; (string-join (my-get-emails-from-csv &quot;&amp;lt;path-to-csv&amp;gt;&quot; t) &quot;, &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the second requirement you will have to use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Blind_carbon_copy&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;BCC&lt;/code&gt;&lt;/a&gt; header. Please also note that &lt;a href=&quot;https://en.wikipedia.org/wiki/Blind_carbon_copy#Visibility&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;most&lt;/strong&gt;&lt;/a&gt; (not all) email implementations hide the recipients so please research before using this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;mu4e&lt;/code&gt; while composing a message you can do &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;mail-bcc&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; this will add a &lt;code&gt;bcc&lt;/code&gt; header, you can type your alias &lt;code&gt;MyClass&lt;/code&gt; and hit &lt;kbd&gt;SPC&lt;/kbd&gt; and it will be expanded to the aliased entries. You might also want to add yourself to the &lt;code&gt;To:&lt;/code&gt; field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you have the basic building blocks, you can define custom commands that do what you want, one such example is below, it reads the path to a &lt;code&gt;csv&lt;/code&gt; file (it assumes file is in the format specified in your question) from the user and inserts the emails from the file in the &lt;code&gt;BCC&lt;/code&gt; field.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-mail-to-people-from-file (file)&#xA;  (interactive &quot;fRead emails from file: &quot;)&#xA;  (save-excursion&#xA;    (mail-bcc)&#xA;    ;; Read the emails from the CSV file and insert them&#xA;    (insert (string-join (my-get-emails-from-csv file t) &quot;, &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In case string-join is not defined in your emacs use following to define it&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(unless (fboundp 'string-join)&#xA;  (defun string-join (strings &amp;amp;optional separator)&#xA;    &quot;Join all STRINGS using SEPARATOR.&quot;&#xA;    (mapconcat 'identity strings separator)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-07T18:41:28.917" LastActivityDate="2015-09-07T18:41:28.917" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16416" PostTypeId="2" ParentId="14479" CreationDate="2015-09-07T10:03:51.533" Score="1" Body="&lt;p&gt;I'm the maintainer of org-journal. It is indeed intentional that org-journal opens the journal in a new window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the latest version of org-journal, I added an option to customize this behaviour, and optionally open the journal in the current window. Use &lt;code&gt;(setq org-journal-find-file 'find-file)&lt;/code&gt; to open journal files in the current window.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2015-09-07T10:03:51.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16417" PostTypeId="1" AcceptedAnswerId="16420" CreationDate="2015-09-07T12:05:28.680" Score="5" ViewCount="277" Body="&lt;p&gt;I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable implicit-layout-active)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When using a variable declared as dynamically bound:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(void-variable implicit-layout-active)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought I cannot get &lt;code&gt;void-variable&lt;/code&gt; issue for declared dynamically bound variables. Note that I do not use &lt;code&gt;makunbound&lt;/code&gt;. But I do use &lt;code&gt;lexical-binding: t&lt;/code&gt; for the module in question. What can this be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info here: &lt;a href=&quot;https://github.com/haskell/haskell-mode/issues/854&quot; rel=&quot;nofollow&quot;&gt;https://github.com/haskell/haskell-mode/issues/854&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-06-22T20:32:23.167" LastActivityDate="2016-06-22T20:32:23.167" Title="What are the conditions when a variable can be both dynamically bound and cause a void-variable issue?" Tags="|variables|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16418" PostTypeId="2" ParentId="16417" CreationDate="2015-09-07T12:23:26.707" Score="4" Body="&lt;p&gt;You are &lt;em&gt;not&lt;/em&gt; binding the variable dynamically. &lt;em&gt;Edit: A sorry, I see now that you actually have declared the variable to be dynamically bound. But I am keeping the part of the answer which assumes otherwise anyway, as it might help others.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;lexical-binding&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;, then &lt;code&gt;let&lt;/code&gt;, and other forms, bind variables lexically by default - that's what that setting does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However &lt;code&gt;let&lt;/code&gt; can bind some variables lexically and others dynamically. What it should do for a particular variable, it figures out by checking whether the variable has been defined, or at least declared to be defined. So add this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar implicit-layout-active nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You most certainly also want to add a package prefix to that symbol and maybe add a doc-string explaining that the variable is only intended to be let-bound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you already have such a definition, but get the above error anyway, then that is probably because you use the variable &lt;em&gt;before&lt;/em&gt; defining it. The order might also be wrong due to the use of outdated &lt;code&gt;*.elc&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of the above you have used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar implicit-layout-active)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I.e. you are declaring that the variable is defined, without actually making sure that there always is a binding. When you now evaluate some code which tries to get the value of the variable without it actually being bound dynamically, well then it is void.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-09-07T12:28:42.197" LastActivityDate="2015-09-07T12:28:42.197" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16419" PostTypeId="2" ParentId="14781" CreationDate="2015-09-07T12:57:56.547" Score="20" Body="&lt;p&gt;Try out &lt;a href=&quot;https://github.com/mrkkrp/vimish-fold&quot;&gt;&lt;code&gt;vimish-fold&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Features&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;batteries included: activate minor mode, bind a couple of commands and&#xA;everything will just work;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it works on regions you select;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it's persistent: when you close file your folds don't disappear;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;in addition to being persistent, it scales well, you can work on hundreds&#xA;of files with lots of folds without adverse effects;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it's obvious which parts of text are folded;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it doesn't break indentation or something;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it can refold just unfolded folds (oh, my);&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;for fans of &lt;a href=&quot;https://github.com/abo-abo/avy&quot;&gt;&lt;code&gt;avy&lt;/code&gt;&lt;/a&gt; package: you can use&#xA;&lt;code&gt;avy&lt;/code&gt; to fold text with minimal number of key strokes!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Usage&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Create binding for some of/all these functions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;vimish-fold&lt;/code&gt; — basic folding of selected region;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;vimish-fold-unfold&lt;/code&gt; — you don't really need to bind this, just use&#xA;&lt;kbd&gt;C-g&lt;/kbd&gt; when point is placed on header representing folded text;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;vimish-fold-unfold-all&lt;/code&gt; — nevertheless this may be useful;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;vimish-fold-refold&lt;/code&gt; — yes, you can fold it back;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;vimish-fold-avy&lt;/code&gt; — use &lt;code&gt;avy&lt;/code&gt; to fold your text!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can turn &lt;code&gt;vimish-fold-mode&lt;/code&gt; selectively for modes where you want to have&#xA;persistent folding, or simply activate it everywhere:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(vimish-fold-global-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-07T12:57:56.547" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="16420" PostTypeId="2" ParentId="16417" CreationDate="2015-09-07T16:26:02.303" Score="7" Body="&lt;p&gt;A special—a dynamically bound variable that is—variable can surely be void.  From &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Void-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;Void Variables&lt;/a&gt; (emphasis mine):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;We say that a variable is void if its symbol has an &lt;strong&gt;unassigned&lt;/strong&gt; value cell (see Symbol Components).&lt;/p&gt;&#xA;&lt;p&gt;Under Emacs Lisp’s default dynamic scoping rule (see Variable Scoping), the value cell stores the variable’s current (local or global) value. &lt;strong&gt;Note that an unassigned value cell is not the same as having nil in the value cell&lt;/strong&gt;. The symbol nil is a Lisp object and can be the value of a variable, just as any other object can be; but it is still a value. If a variable is void, trying to evaluate the variable signals a void-variable error, instead of returning a value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In other words, the scoping rules of a variable are &lt;em&gt;unrelated&lt;/em&gt; to whether it is actually bound or not.  &lt;code&gt;(defvar implicit-layout-active)&lt;/code&gt; declares the variable special, but it does &lt;em&gt;not&lt;/em&gt; assign a value.  The variable is still void.  See for yourself:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (defvar implicit-layout-active)&#xA;implicit-layout-active&#xA;ELISP&amp;gt; (special-variable-p 'implicit-layout-active)&#xA;t&#xA;ELISP&amp;gt; (boundp 'implicit-layout-active)&#xA;nil&#xA;ELISP&amp;gt; implicit-layout-active&#xA;*** Eval error ***  Symbol’s value as variable is void: implicit-layout-active&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You need to assign a value, either in the declaration or later, to make a variable special &lt;em&gt;and&lt;/em&gt; bound, i.e. non-void. Your code apparently does not do that.&lt;/p&gt;&#xA;&lt;p&gt;Specifically, you'd need to use &lt;code&gt;(defvar implicit-layout-active nil)&lt;/code&gt;. But at this point you should &lt;strong&gt;definitely use prefixed names&lt;/strong&gt;.  Declaring unprefixed global variables is &lt;em&gt;very bad&lt;/em&gt; style, and arguably somewhat rude towards other packages.  And generally, &lt;code&gt;haskell-indentation.el&lt;/code&gt; is not particularly friendly in this regard: It declares over a dozen of these.  Please, please, please, don't do that.  Sooner or later other Emacs package developers are going to hate you for this.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditorDisplayName="user227" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-09-09T06:01:00.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16421" PostTypeId="2" ParentId="16417" CreationDate="2015-09-07T16:34:20.250" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I thought I cannot get void-variable issue for declared dynamically bound&#xA;  variables.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your assumption is wrong. Dynamically bound (or “special” in other Lisps)&#xA;variables can be unbound. In fact if you declare it like (taken from&#xA;&lt;code&gt;haskell-indentation.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar implicit-layout-active) ;; is &quot;off-side&quot; rule active?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You are declaring variable &lt;code&gt;implicit-layout-active&lt;/code&gt; without setting its&#xA;value. We can read about it in doc-string:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;defvar is a special form in ‘C source code’.&lt;br&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(defvar SYMBOL &amp;amp;optional INITVALUE DOCSTRING)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;…&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The optional argument INITVALUE is evaluated, and used to set SYMBOL, only&#xA;  if SYMBOL's value is void.  If SYMBOL is buffer-local, its default value&#xA;  is what is set; buffer-local values are not affected.  &lt;strong&gt;If INITVALUE is&#xA;  missing, SYMBOL's value is not set.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This answers your question: you've defined a dynamic variable and have not&#xA;set its value. Obviously your code doesn't &lt;code&gt;let&lt;/code&gt; bind it in some case and&#xA;thus you get the error.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As for your comment that &lt;code&gt;(defvar implicit-layout-active)&lt;/code&gt; is the same as&#xA;&lt;code&gt;(defvar implicit-layout-active nil)&lt;/code&gt; — you should check better. A few&#xA;things to consider:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When your test suite evaluates &lt;code&gt;(require 'haskell-indentation)&lt;/code&gt; which&#xA;module does it load: where you supply default value or “older” byte&#xA;compiled version installed via package manager?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also note that &lt;code&gt;defvar&lt;/code&gt; only sets value if variable is currently unbound&#xA;(this is not actual issue in your case, just a word of caution).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Having said all this I can evaluate&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar implicit-layout-active nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the dynamic variable is bound:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(boundp implicit-layout-active) ⇒ t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I run your test case I get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;F haskell-indentation-check-23&#xA;    should not fail when seeing comments&#xA;    (ert-test-failed&#xA;     ((should&#xA;       (equal&#xA;        (cons&#xA;         (list ... ...)&#xA;         (haskell-indentation-find-indentations))&#xA;        current))&#xA;      :form&#xA;      (equal&#xA;       ((3 2))&#xA;       ((3 2)&#xA;        0))&#xA;      :value nil :explanation&#xA;      (proper-lists-of-different-length 1 2&#xA;                                        ((3 2))&#xA;                                        ((3 2)&#xA;                                         0)&#xA;                                        first-mismatch-at 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastEditorDisplayName="user227" LastEditDate="2015-09-08T08:24:20.310" LastActivityDate="2015-09-08T08:24:20.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16422" PostTypeId="2" ParentId="16378" CreationDate="2015-09-07T16:52:22.813" Score="1" Body="&lt;p&gt;You can re-add &lt;code&gt;/usr/share/emacs/24.5/lisp/&lt;/code&gt; to the start of the load-path by doing something like this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(push &quot;/usr/share/emacs/24.5/lisp&quot; load-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While this will work, this is system/installation dependent, I found one installation independent way to get path to &lt;code&gt;lisp&lt;/code&gt; &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n502&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;startup.el&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(expand-file-name &quot;../lisp&quot; data-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Combining these together the following should solve your issue&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(push (expand-file-name &quot;../lisp&quot; data-directory) load-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that this works because &lt;code&gt;gnus&lt;/code&gt; packaged with emacs is installed in &lt;code&gt;/usr/share/emacs/24.5/lisp/gnus&lt;/code&gt; directory had it been installed directory in &lt;code&gt;/usr/share/emacs/24.5/lisp&lt;/code&gt;, the above would have shadowed the package you installed from your package manager. &lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-07T16:52:22.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16423" PostTypeId="2" ParentId="16408" CreationDate="2015-09-07T17:35:27.077" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;kill-buffer-hook&lt;/code&gt; is not automatically buffer-local.  That it is, it does not automatically become buffer-local whenever its value is set.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;AFAICT, &lt;code&gt;auto-revert-mode&lt;/code&gt; does &lt;strong&gt;not&lt;/strong&gt; make &lt;code&gt;kill-buffer-hook&lt;/code&gt; be buffer-local.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Something else in your setup no doubt does make it buffer-local in some buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;kill-buffer-hook&lt;/code&gt;, although not buffer-local to start with, has the property that it &lt;strong&gt;if&lt;/strong&gt; it is ever made buffer local then it will be buffer-local &lt;strong&gt;permanently&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see this from &lt;code&gt;C-h v kill-buffer-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This variable's value is &lt;strong&gt;permanent if it is given a local binding&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Buffer_002dLocal.html&quot; rel=&quot;nofollow&quot;&gt;Creating Buffer-Local&lt;/a&gt;.  There you will see this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A buffer-local variable is “&lt;strong&gt;permanent&lt;/strong&gt;” if the variable name (a&#xA;  symbol) has a &lt;code&gt;permanent-local&lt;/code&gt; property that is non-&lt;code&gt;nil&lt;/code&gt;.  Such&#xA;  variables are unaffected by &lt;code&gt;kill-all-local-variables&lt;/code&gt;, and their local&#xA;  bindings are therefore not cleared by changing major modes.  Permanent&#xA;  locals are &lt;strong&gt;appropriate for data pertaining to where the file came from&#xA;  or how to save it&lt;/strong&gt;, rather than with how to edit the contents.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This means that when you use a different major mode the last local&#xA;binding is kept, which is exactly the behavior you reported.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want to change the buffer-local value then you will need to do so explicitly, using, for example &lt;code&gt;setq&lt;/code&gt;.  You can also change the default value of the variable, using &lt;code&gt;setq-default&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-07T17:35:27.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16424" PostTypeId="2" ParentId="13927" CreationDate="2015-09-07T19:16:07.563" Score="7" Body="&lt;p&gt;This is how to make emacs as default file manager in ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First we have to write a script which will act as our file manager.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python&#xA;import os&#xA;import sys&#xA;&#xA;&#xA;def main():&#xA;    if len(sys.argv) &amp;gt; 1:&#xA;        dirname =  sys.argv[1]&#xA;    else:&#xA;        dirname = '~'&#xA;    os.system('emacs --eval \'(dired &quot;{}&quot;)\'%'.format(dirname))&#xA;    # you can use emacsclient if you are running emacs server&#xA;&#xA;if __name__ == &quot;__main__&quot;:&#xA;    main()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Save this as &lt;code&gt;emacsfm&lt;/code&gt; in &lt;code&gt;/usr/bin/&lt;/code&gt;. Now in terminal instead of using &lt;code&gt;nautilus&lt;/code&gt; or &lt;code&gt;nautilus /foo/bar&lt;/code&gt;, we can use &lt;code&gt;emacsfm&lt;/code&gt;  or &lt;code&gt;emacsfm /foo/bar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we need to set this as default file manager. Install &lt;code&gt;exo-utils&lt;/code&gt; using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-get install exo-utils&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and run it &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;exo-preferred-applications&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It opens a new window. Go to &lt;strong&gt;Utilities&lt;/strong&gt; -&gt; &lt;strong&gt;File manager&lt;/strong&gt; -&gt; &lt;strong&gt;Other&lt;/strong&gt; and enter &lt;strong&gt;/usr/bin/emacsfm &quot;%s&quot;&lt;/strong&gt; in  it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can goto chrome downloads and if click &lt;code&gt;show in folder&lt;/code&gt; it will open emacs dired :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dxm6a.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dxm6a.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Reference: &lt;a href=&quot;https://help.ubuntu.com/community/DefaultFileManager&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://help.ubuntu.com/community/DefaultFileManager&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-08T18:09:42.993" LastActivityDate="2015-09-08T18:09:42.993" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16425" PostTypeId="2" ParentId="3280" CreationDate="2015-09-07T19:36:10.980" Score="8" Body="&lt;p&gt;I've created an emacs package that may help you with inserting org-mode links from the clipboard:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/rexim/org-cliplink&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-cliplink&lt;/code&gt;&lt;/a&gt; (also available via Melpa)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It makes an HTTP request to the URL from the clipboard and if the response contains HTML it tries to extract the title and inserts the org-mode link in this format: &lt;code&gt;[[URL][extracted-title]]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For example, after copying this question's &lt;a href=&quot;https://emacs.stackexchange.com/q/3280&quot;&gt;link&lt;/a&gt;, doing &lt;code&gt;M-x org-cliplink&lt;/code&gt; in an org-mode buffer will insert:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;[[https://emacs.stackexchange.com/q/3280][org mode - Orgmode insert link from clipboard? - Emacs Stack Exchange]]&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and the link will look hyperlinked as &lt;a href=&quot;https://emacs.stackexchange.com/q/3280&quot;&gt;org mode - Orgmode insert link from clipboard? - Emacs Stack Exchange&lt;/a&gt; in that buffer.&lt;/p&gt;&#xA;" OwnerUserId="9449" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-10-14T03:49:34.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16426" PostTypeId="1" CreationDate="2015-09-07T20:00:47.977" Score="1" ViewCount="780" Body="&lt;p&gt;I'm on Windows 7, 32-bit processor and I'm trying to set up emacs and AUCTeX with RefTeX. I've followed &lt;a href=&quot;http://www.latexbuch.de/install-latex-windows-7/#x1-140003.4&quot; rel=&quot;nofollow noreferrer&quot;&gt;Joachim Schlosser's english guide&lt;/a&gt; and &lt;a href=&quot;http://www.latexbuch.de/installieren/emacs-latex-windows-7-video/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Youtube tutorial&lt;/a&gt; in German (even if I don't understand German). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I open a &lt;code&gt;*.tex&lt;/code&gt; file, there are no &lt;strong&gt;Preview&lt;/strong&gt; or &lt;strong&gt;LaTeX&lt;/strong&gt; menus, instead a spartan &lt;strong&gt;TeX&lt;/strong&gt; menu that doesn't offer the possibility to customize AUCTeX. Can someone please help me get AUCTeX to work the &lt;em&gt;preview-latex&lt;/em&gt; feature that is supposed to display math expressions inside the buffer and not in a separate pdf program such as SumatraPDF? I've also downloaded the appropriate png.dll and zlib.dll (see guide above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nzqlb.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nzqlb.jpg&quot; alt=&quot;where&amp;#39;s the LaTeX menu? Or preview-latex sub-menu?&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm starting to doubt whether I got the right versions of emacs and AUCTeX for my OS. I've got &lt;code&gt;emacs-24.4-bin-i686-pc-mingw32.zip&lt;/code&gt; and &lt;code&gt;auctex-11.88-e24.4-msw.zip&lt;/code&gt;, are these the correct zip files? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my &lt;code&gt;.emacs&lt;/code&gt; file which I have created by copy-pasting blocks of code from different places in the net, since I don't know &lt;em&gt;elisp&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(server-start)&#xA;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)&#xA;(setq reftex-plug-into-AUCTeX t)&#xA;(setq-default ispell-program-name &quot;aspell&quot;)&#xA;&#xA;;;; AUCTeX&#xA;;; Customary Customization, p. 1 and 16 in the manual, and http://www.emacswiki.org/emacs/AUCTeX#toc2&#xA;(setq TeX-parse-self t); Enable parse on load.&#xA;(setq TeX-auto-save t); Enable parse on save.&#xA;(setq-default TeX-master nil)&#xA;&#xA;(setq TeX-PDF-mode t); PDF mode (rather than DVI-mode)&#xA;&#xA;(add-hook 'TeX-mode-hook 'flyspell-mode); Enable Flyspell mode for TeX modes such as AUCTeX. Highlights all misspelled words.&#xA;(add-hook 'emacs-lisp-mode-hook 'flyspell-prog-mode); Enable Flyspell program mode for emacs lisp mode, which highlights all misspelled words in comments and strings.&#xA;(setq ispell-dictionary &quot;english&quot;); Default dictionary. To change do M-x ispell-change-dictionary RET.&#xA;(add-hook 'TeX-mode-hook&#xA;          (lambda () (TeX-fold-mode 1))); Automatically activate TeX-fold-mode.&#xA;(setq LaTeX-babel-hyphen nil); Disable language-specific hyphen insertion.&#xA;&#xA;;; &quot; expands into csquotes macros (for this to work babel must be loaded after csquotes).&#xA;(setq LaTeX-csquotes-close-quote &quot;}&quot;&#xA;      LaTeX-csquotes-open-quote &quot;\\enquote{&quot;)&#xA;&#xA;;; LaTeX-math-mode http://www.gnu.org/s/auctex/manual/auctex/Mathematics.html&#xA;(add-hook 'TeX-mode-hook 'LaTeX-math-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9269" LastEditorUserId="9269" LastEditDate="2015-09-07T21:00:33.413" LastActivityDate="2015-09-08T08:47:27.580" Title="How to configure latest 32-bit emacs &amp; AUCTeX in Windows 7?" Tags="|auctex|microsoft-windows|preview-latex|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="16427" PostTypeId="1" AcceptedAnswerId="16430" CreationDate="2015-09-07T20:04:19.750" Score="4" ViewCount="398" Body="&lt;p&gt;In section 11.18 of the &lt;em&gt;GNU Emacs Manual&lt;/em&gt;, it's mentioned that buffers with a large number of lines &lt;code&gt;line-number-display-limit&lt;/code&gt; or with particularly long lines &lt;code&gt;line-number-display-limit-width&lt;/code&gt; might experience slow performance with line number calculation and so line number calculation is disabled by default. It seems to me that using a tree-like structure you could get logarithmic-time insertion and random access if every subtree kept track of the number of elements in it. What advantage is there in doing things the way emacs does?&lt;/p&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="8921" LastEditDate="2015-09-08T05:02:22.037" LastActivityDate="2015-09-08T05:02:22.037" Title="Why doesn't emacs store buffers internally as a tree (better random access, no line-number limitations)?" Tags="|emacs-internals|line-numbers|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16428" PostTypeId="1" CreationDate="2015-09-07T21:10:16.673" Score="3" ViewCount="251" Body="&lt;p&gt;I typed &quot;C-t d&quot; after marking files in Dired, or &quot;M-x image-dired&quot; followed by a directory name, to display thumbnails in a thumbnail buffer. After highlighting a thumbnail in the thumbnail buffer, I typed RET to display a sized version of highlighted image in another window (image-dired-display-image). The problem is that no matter what image is selected in the thumbnail buffer (either using the left/right arrow followed by RET, or using space/backspace, as instructed in the Emacs manual), the display-image window always displays the same image, which is the image opened first in this way in an Emacs session.&lt;/p&gt;&#xA;" OwnerUserId="9421" LastActivityDate="2015-09-09T04:22:08.467" Title="Problem with Image-Dired: image display does not follow point in the thumbnail buffer" Tags="|image-dired|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16430" PostTypeId="2" ParentId="16427" CreationDate="2015-09-07T22:36:38.563" Score="3" Body="&lt;p&gt;Personally, I doubt the buffer implementation can be blamed for every performance problem people encounter with buffers.  My specific problem with it did involve long lines that were slowing down redisplay, a known issue with a multitude of reasons behind it, including Bidi rendering, excessive movement of point crossing the problematic line and less than ideal font-lock.  I did plan on implementing a cache for line operations just to find out that such a cache does already exist.  After upgrading to Emacs 24.5, the issue was gone for me in Python REPL buffers, simply because font-lock was only applied for the input line and no more in the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tl;dr: There is no silver bullet.  Don't believe this is just a technical problem.  Do your own research, profile if you know how (&lt;code&gt;perf&lt;/code&gt; should be ideal, &lt;code&gt;gdb&lt;/code&gt; could work as well) and share your insights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15555&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15555&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3aprkn/linumrelative_slow/csetpji&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.reddit.com/r/emacs/comments/3aprkn/linumrelative_slow/csetpji&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/598/how-do-i-handle-files-with-extremely-long-lines#answer-603&quot;&gt;How do I prevent extremely long lines making Emacs slow?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/5545/how-to-prevent-slow-down-when-an-inferior-processes-generates-long-lines/5559#5559&quot;&gt;How to prevent slow-down when an inferior processes generates long lines?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-07T22:36:38.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16431" PostTypeId="1" AcceptedAnswerId="16432" CreationDate="2015-09-08T00:40:31.577" Score="1" ViewCount="1902" Body="&lt;p&gt;I've started using org-mode these past few days, and I've set up a few org-habits. I'm having trouble with the consistency graph and agenda mode however. Habit &lt;code&gt;TODO&lt;/code&gt;s only seem to show up for habits that are due today. How can I make the org agenda show habits further into the future?&lt;/p&gt;&#xA;" OwnerUserId="9451" LastActivityDate="2015-09-08T22:13:08.080" Title="Make the org-habit agenda display further into the future" Tags="|org-mode|org-agenda|org-habit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16432" PostTypeId="2" ParentId="16431" CreationDate="2015-09-08T01:23:10.773" Score="3" Body="&lt;p&gt;Set the variable &lt;code&gt;org-habit-show-habits-only-for-today&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-habit-show-habits-only-for-today is a variable defined in `org-habit.el'.&#xA;&#xA;Documentation:&#xA;If non-nil, only show habits on today's agenda, and not for future days.&#xA;Note that even when shown for future days, the graph is always&#xA;relative to the current effective date.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, your habits will show up on all times they are scheduled, including repetitions. They won't show up on dates in the past where you did them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want each habit to show up when it is next scheduled, but no further repetitions, set &lt;code&gt;org-agenda-repeating-timestamp-show-all&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-repeating-timestamp-show-all nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-09-08T22:13:08.080" LastActivityDate="2015-09-08T22:13:08.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16433" PostTypeId="1" AcceptedAnswerId="16436" CreationDate="2015-09-08T04:12:21.750" Score="5" ViewCount="371" Body="&lt;p&gt;I have a function that offers to do handy things. Right now, it's using &lt;code&gt;y-or-n-p&lt;/code&gt; to ask if it should take action. The problem is that &lt;code&gt;y-or-n-p&lt;/code&gt; blocks the command loop, which is inconvenient if you want to pass on the action. Instead, I'd like &lt;code&gt;y&lt;/code&gt; to execute the action, but let everything else through.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/y-or-n-p (prompt callback)&#xA;  (message prompt)&#xA;  (set-transient-map `(keymap (121 . ,callback))))&#xA;&#xA;(defun test-my/y-or-n-p ()&#xA;  (my/y-or-n-p &quot;message?&quot; (lambda () (interactive) (message &quot;message hi!&quot;))))&#xA;&#xA;;; this works&#xA;(test-my/y-or-n-p)&#xA;&#xA;;; this does not&#xA;(add-hook 'emacs-startup-hook #'test-my/y-or-n-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are two problems with my code:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The prompt in the echo area can be overwritten by other messages&lt;/li&gt;&#xA;&lt;li&gt;Doesn't seem to work in &lt;code&gt;emacs-startup-hook&lt;/code&gt; (and maybe other hooks)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what's wrong with it?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="105" LastEditDate="2016-06-22T20:31:15.760" LastActivityDate="2016-06-22T20:31:15.760" Title="non-blocking y-or-n-p" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16434" PostTypeId="1" AcceptedAnswerId="16437" CreationDate="2015-09-08T04:59:24.523" Score="0" ViewCount="247" Body="&lt;p&gt;I am new to the world of Emacs, so please forgive me if my question is too trivial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to use standard console keybindings for Emacs too, by editing the configuration file. A few of them are in Emacs already, but I wanted to added some more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to add keybindings for killing a part of the text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My entries:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [C-h] 'backward-delete-char)&#xA;(global-set-key [C-w] 'backward-kill-word)&#xA;(global-set-key [C-u] 'backward-kill-sentence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I couldn't get these to work. I searched online and tried to use &lt;a href=&quot;https://emacs.stackexchange.com/a/5488/4025&quot;&gt;this&lt;/a&gt;, adding the following lines before the above lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq help-char nil)          ; To enable C-h for 'backward-delete-char&#xA;(setq kill-region nil)        ; To enable C-w for 'backward-kill-word&#xA;(setq universal-argument nil) ; To enable C-u for 'backward-kill-sentence&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that didn't help either. What am I doing wrong? How can I get it to work?&lt;/p&gt;&#xA;" OwnerUserId="4025" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-06-09T06:10:06.010" Title="How to override default keybindings?" Tags="|key-bindings|init-file|kill-buffer|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16435" PostTypeId="2" ParentId="15196" CreationDate="2015-09-08T05:03:16.633" Score="4" Body="&lt;p&gt;Thanks to the help by &lt;a href=&quot;https://emacs.stackexchange.com/users/1982/youngfrog&quot;&gt;YoungFrog&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/users/10/wasamasa&quot;&gt;wasamasa&lt;/a&gt;, I came up with this that solved my problem.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (when (display-graphic-p)   ;; Return non-nil if emacs is running in a graphic display.&#xA;    (load-file (concat (file-name-as-directory cust-emacs-dir) &quot;loadpaths/fullscreen.el&quot;))&#xA;    (require 'fullscreen)&#xA;    (fullscreen))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4025" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-09T12:55:17.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16436" PostTypeId="2" ParentId="16433" CreationDate="2015-09-08T05:03:36.870" Score="9" Body="&lt;p&gt;Something like the following should work&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-lenient-y-or-n-p (prompt)&#xA;  (let ((query-replace-map (copy-keymap query-replace-map)))&#xA;    (define-key query-replace-map [t] 'skip)&#xA;    (y-or-n-p prompt)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you look at the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Yes_002dor_002dNo-Queries.html&quot;&gt;documentation&lt;/a&gt; of &lt;code&gt;y-or-n-p&lt;/code&gt;, it mentions that it looks up the &lt;code&gt;query-replace-map&lt;/code&gt; to decide which action to take for a given key. I am quoting it here for completeness (emphasis mine)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(...)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To be precise, &lt;strong&gt;this function translates user input into responses by&#xA;  consulting the bindings in &lt;code&gt;query-replace-map&lt;/code&gt;&lt;/strong&gt;; see the documentation&#xA;  of that variable for more information.  In this case, the useful&#xA;  bindings are &lt;code&gt;act&lt;/code&gt;, &lt;code&gt;skip&lt;/code&gt;, &lt;code&gt;recenter&lt;/code&gt;, &lt;code&gt;scroll-up&lt;/code&gt;, &lt;code&gt;scroll-down&lt;/code&gt;,&#xA;  and &lt;code&gt;quit&lt;/code&gt;. An &lt;code&gt;act&lt;/code&gt; response means yes, and &lt;strong&gt;a &lt;code&gt;skip&lt;/code&gt; response means&#xA;  no&lt;/strong&gt;. A &lt;code&gt;quit&lt;/code&gt; response means to invoke &lt;code&gt;keyboard-quit&lt;/code&gt;. If the user&#xA;  enters &lt;code&gt;recenter&lt;/code&gt;, &lt;code&gt;scroll-up&lt;/code&gt;, or &lt;code&gt;scroll-down&lt;/code&gt; responses, perform&#xA;  the requested window recentering or scrolling and ask again.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(...)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So basically if we can invoke &lt;code&gt;y-or-n-p&lt;/code&gt; with modified &lt;code&gt;query-replace-map&lt;/code&gt; which defines the binding &lt;code&gt;skip&lt;/code&gt; as the default we should get what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can achieve this by copying the &lt;code&gt;query-replace-map&lt;/code&gt; (so that global value is unchanged) and defining the binding &lt;code&gt;skip&lt;/code&gt; for all undefined keys. So how do we define a default binding in a keymap, for this see the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Key-Bindings.html&quot;&gt;documentation&lt;/a&gt; of &lt;code&gt;define-keymap&lt;/code&gt; (emphasis mine)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(...) KEY is a string or a vector of symbols and characters, representing a&#xA;  sequence of keystrokes and events.  Non-ASCII characters with codes&#xA;  above 127 (such as ISO Latin-1) can be represented by vectors. Two&#xA;  types of vector have special meanings:  [remap COMMAND] remaps any key&#xA;  binding for COMMAND.  &lt;strong&gt;[t] creates a default definition&lt;/strong&gt;, which applies&#xA;  to any event with no other definition in KEYMAP.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So binding &lt;code&gt;[t]&lt;/code&gt; to &lt;code&gt;skip&lt;/code&gt; in the copy of &lt;code&gt;query-replace-map&lt;/code&gt; should do the trick for us. Of course we let bind the new keymap around the call to &lt;code&gt;y-or-no-p&lt;/code&gt; so that the modified keymap is used instead of the global definition&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-08T05:03:36.870" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16437" PostTypeId="2" ParentId="16434" CreationDate="2015-09-08T05:38:56.357" Score="3" Body="&lt;p&gt;There are multiple ways to specify the key you want to bind. &lt;code&gt;[C-u]&lt;/code&gt; doesn't work; if you're &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html&quot; rel=&quot;nofollow&quot;&gt;supplying  a vector&lt;/a&gt;, you have to use it a little differently. From that link:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In the vector representation, each element of the vector represents an&#xA;  input event, in its Lisp form. See Input Events. For example, the&#xA;  vector [?\C-x ?l] represents the key sequence C-x l.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So this works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [?\C-u] 'backward-kill-sentence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternately, you can have a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Key-Bindings.html#Changing-Key-Bindings&quot; rel=&quot;nofollow&quot;&gt;vector containing lists&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [(control ?u)] 'backward-kill-sentence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I find that using &lt;code&gt;kbd&lt;/code&gt; makes things much easier to read. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-u&quot;) 'backward-kill-sentence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-09-08T05:46:18.530" LastActivityDate="2015-09-08T05:46:18.530" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16438" PostTypeId="2" ParentId="16402" CreationDate="2015-09-08T05:46:49.667" Score="0" Body="&lt;p&gt;Do not use Jedi. Use &lt;strong&gt;anaconda-mode&lt;/strong&gt;. Jedi not work with company-mode and work with errors in company-jedi (or I can't configure it).&lt;/p&gt;&#xA;" OwnerUserId="6919" LastActivityDate="2015-09-08T05:46:49.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16440" PostTypeId="1" CreationDate="2015-09-08T07:58:44.593" Score="2" ViewCount="602" Body="&lt;p&gt;In my &lt;code&gt;.profile&lt;/code&gt;-file I have a setting like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export TEXINPUTS=$TEXINPUTS:/home/myuser/projects/images//&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If I try to include an image by using &lt;code&gt;(TeX-insert-macro &quot;includegraphics&quot;)&lt;/code&gt;, auctex is in the directory where my current latex file is by default. However I want to be it by default in the directory &lt;code&gt;/home/myuser/projects/images/&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I include then an image from this dir it gives includes the whole path. But this isn't desired since I have set the &lt;code&gt;TEXINPUTS&lt;/code&gt; variable. So how can I change this such that it only inserts the filename and not the whole (relative) path?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&#xA;As suggested by @giordano, setting &lt;code&gt;LaTeX-includegraphics-read-file&lt;/code&gt; to &lt;code&gt;LaTeX-includegraphics-read-file-TeX&lt;/code&gt; should make it work. However in this case the solution in &lt;a href=&quot;https://emacs.stackexchange.com/a/14011/2323&quot;&gt;https://emacs.stackexchange.com/a/14011/2323&lt;/a&gt; doesn't work anymore. However I want both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;&#xA;Maybe one could create a custom helm source for inserting images, which is called when I want to insert an image via auctex (don't see how to bind this). Here is what I tried so far, but it doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-image-select ()&#xA;  (interactive)&#xA;  (helm :sources&#xA;      (helm-build-async-source &quot;helm-image-select&quot;&#xA;        :candidates-process&#xA;        (lambda ()&#xA;          (start-process &quot;find-images&quot; nil &quot;find&quot; &quot;/home/myuser/projects/images/&quot; &quot;-iname&quot; helm-pattern)) ;; doesn't seem to work, in particular no fuzzy search... should also take all path's from TEXINPUTS as base.&#xA;    :action '((&quot;insert-image&quot; . insert-image-action)&#xA;          )&#xA;    ))&#xA;  )&#xA;&#xA;(defun insert-image-action (candidate)&#xA;(insert (format &quot;%s&quot; (helm-get-selection))) ;; should return only the filename without the path&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As said above, I also don't know how to connect this to auctex (maybe alternatively, this could be executed if I expand a snipped for includegraphics).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another problem with the approach above shows up in the case I don't want to add a pictures from a path known by &lt;code&gt;$TEXINPUTS&lt;/code&gt;. In particular in this case the path has to be insert such that latex can find the image.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2017-09-06T20:22:01.943" LastActivityDate="2017-12-08T09:28:42.703" Title="Make \includegraphics and TEXINPUTS setting for images work together" Tags="|helm|auctex|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16441" PostTypeId="2" ParentId="16426" CreationDate="2015-09-08T08:47:27.580" Score="3" Body="&lt;p&gt;I followed @giordano's advice and made a clean install of &lt;code&gt;emacs-24.5-bin-i686-mingw32.zip&lt;/code&gt;. I basically still followed Schlosser's youtube tutorial, including the bit where he edits and installs the &lt;code&gt;*.reg&lt;/code&gt; file. This time, however, I got the &lt;code&gt;libpng16-16.dll&lt;/code&gt; and &lt;code&gt;zlib1.dll&lt;/code&gt; files from &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/filesa&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and I did NOT extract the AUCTeX zip file's content into emacs' path. I installed AUCTeX from &lt;em&gt;within&lt;/em&gt; emacs with &lt;code&gt;M-x package-install RET auctex RET&lt;/code&gt;. My &lt;code&gt;.emacs&lt;/code&gt; file is basically still the one above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I got everything ready (I already had a working TeXLive distribution, by the way), I tried compiling a &lt;code&gt;test.tex&lt;/code&gt; file with AUCTeX. At first I was still getting an error msg &quot;preview imgage not available&quot; but I had mistaken some code. After a few tries I got things right. The &lt;strong&gt;Preview&lt;/strong&gt; and &lt;strong&gt;LaTeX&lt;/strong&gt; menus are there, and I can see math preview &lt;em&gt;inside the buffer&lt;/em&gt;! See picture below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XOjc5.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XOjc5.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9269" LastActivityDate="2015-09-08T08:47:27.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16442" PostTypeId="1" AcceptedAnswerId="16446" CreationDate="2015-09-08T09:43:52.853" Score="5" ViewCount="2726" Body="&lt;p&gt;The text in my modeline fits exactly in the modeline, I would like to have some more padding above and below the text, couldn't find an option for it and don't know much about text properties in Emacs. How can I achieve that?  &lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-09-08T12:30:45.290" Title="Padding around modeline text?" Tags="|faces|mode-line|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16443" PostTypeId="2" ParentId="16442" CreationDate="2015-09-08T10:32:09.147" Score="5" Body="&lt;p&gt;A hacky solution could consist in adding a tall zero-width character at the beginning of your mode-line. Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(setq-default mode-line-format&#xA;              (cons (propertize &quot;\u200b&quot; 'display '((raise -0.5) (height 2))) mode-line-format))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-09-08T12:12:12.533" LastActivityDate="2015-09-08T12:12:12.533" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16444" PostTypeId="1" AcceptedAnswerId="16449" CreationDate="2015-09-08T11:01:24.083" Score="10" ViewCount="6420" Body="&lt;p&gt;What is a recomended way for making emacs as julia code editor? The things which I would like to have are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;autocomplete&lt;/li&gt;&#xA;&lt;li&gt;julia shell in emacs with abbility to send the code from buffer&lt;/li&gt;&#xA;&lt;li&gt;debugging&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6848" LastActivityDate="2020-03-25T18:20:51.607" Title="How do you configure emacs for julia?" Tags="|shell|debugging|auto-complete-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16445" PostTypeId="1" AcceptedAnswerId="16448" CreationDate="2015-09-08T11:04:19.513" Score="3" ViewCount="1065" Body="&lt;p&gt;Is there any option/extension in org mode to auto order certain lists?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: I would like to order by TODOs by priority or I would like to order by TODOs by state.&lt;/p&gt;&#xA;" OwnerUserId="6730" LastActivityDate="2015-09-08T13:34:17.950" Title="org mode auto order" Tags="|org-mode|todo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16446" PostTypeId="2" ParentId="16442" CreationDate="2015-09-08T12:21:33.447" Score="6" Body="&lt;p&gt;You can customize the &lt;code&gt;:box&lt;/code&gt; attribute of the &lt;code&gt;mode-line-face&lt;/code&gt;. From the documentation (&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;code&gt;set-face-attribute&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;`:box'&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;VALUE specifies whether characters in FACE should have a box drawn&#xA;  around them.  If VALUE is nil, explicitly don't draw boxes.  If VALUE&#xA;  is t, draw a box with lines of width 1 in the foreground color of the&#xA;  face.  If VALUE is a string, the string must be a color name, and the&#xA;  box is drawn in that color with a line width of 1.  Otherwise, VALUE&#xA;  must be a property list of the form `(:line-width WIDTH :color COLOR&#xA;  :style STYLE)'.  If a keyword/value pair is missing from the property&#xA;  list, a default value will be used for the value, as specified below. &#xA;  WIDTH specifies the width of the lines to draw; it defaults to 1.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So that following should give you the padding you want&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'mode-line nil&#xA;                    :box '(:line-width 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might also want to give a certain background to the box, you can do that by specifying the &lt;code&gt;:color&lt;/code&gt; property to the &lt;code&gt;:box&lt;/code&gt; property something like below&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'mode-line nil&#xA;                :box '(:line-width 6 :color &quot;gray20&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Credits: I got this trick from Amit Patel's &lt;a href=&quot;http://amitp.blogspot.in/2011/08/emacs-custom-mode-line.html&quot; rel=&quot;noreferrer&quot;&gt;blog&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-08T12:30:45.290" LastActivityDate="2015-09-08T12:30:45.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16448" PostTypeId="2" ParentId="16445" CreationDate="2015-09-08T13:34:17.950" Score="2" Body="&lt;p&gt;You can use the function &lt;code&gt;org-sort&lt;/code&gt;, which by default is mapped to &lt;code&gt;C-c ^&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sort same-level entries. When there is an active region, all entries in the region will be sorted. Otherwise the children of the current headline are sorted. The command prompts for the sorting method, which can be alphabetically, numerically, by time (first timestamp with active preferred, creation time, scheduled time, deadline time), by priority, by TODO keyword (in the sequence the keywords have been defined in the setup) or by the value of a property. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See this answer for multiple sorting levels: &lt;a href=&quot;https://emacs.stackexchange.com/questions/9585/org-how-to-sort-headings-by-todo-and-then-by-priority&quot;&gt;org: How to sort headings by TODO and then by priority?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-09-08T13:34:17.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16449" PostTypeId="2" ParentId="16444" CreationDate="2015-09-08T14:14:43.420" Score="6" Body="&lt;p&gt;The &lt;a href=&quot;http://ess.r-project.org/&quot; rel=&quot;noreferrer&quot;&gt;ESS&lt;/a&gt; development environment seems to &lt;a href=&quot;https://github.com/emacs-ess/ESS/wiki/Julia&quot; rel=&quot;noreferrer&quot;&gt;support julia out of the box&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the documentation, it supports most of the features you mentioned:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;completion&lt;/li&gt;&#xA;&lt;li&gt;code evaluation&lt;/li&gt;&#xA;&lt;li&gt;error navigation (there doesn't seem to be a full debugger yet, though)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-08T14:14:43.420" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16450" PostTypeId="1" AcceptedAnswerId="16467" CreationDate="2015-09-08T17:29:14.820" Score="2" ViewCount="1505" Body="&lt;p&gt;I switched from Sublime Text a little over a month ago and I prefer emacs, but something that I haven't been able to find are external packages that do more than just give you more than correct indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example these packages for sublime:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/timonwong/SublimeAStyleFormatter&quot; rel=&quot;nofollow&quot;&gt;Astyle Formatter&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/victorporof/Sublime-HTMLPrettify&quot; rel=&quot;nofollow&quot;&gt;HTML-CSS-JS Beautify&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://packagecontrol.io/packages/Python%20PEP8%20Autoformat&quot; rel=&quot;nofollow&quot;&gt;Auto PEP8 Format&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I haven't been able to find the equivalent for in emacs. Do any packages like this exist for emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If they don't, the interesting thing about some of these packages is that they work off running already installed nodejs modules, and I'm curious if I can somehow assign my own keybindings to manually run those nodejs programs.&lt;/p&gt;&#xA;" OwnerUserId="9130" LastEditorUserId="253" LastEditDate="2015-09-08T18:34:12.357" LastActivityDate="2015-09-09T05:48:34.283" Title="How to format code comprehensively, not just indent region, but apply correct coding style" Tags="|formatting|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16451" PostTypeId="2" ParentId="15304" CreationDate="2015-09-08T18:41:35.563" Score="0" Body="&lt;p&gt;I resolved the issue using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter (selected-frame) 'alpha '(100))&#xA;(add-to-list 'default-frame-alist '(alpha 100))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;alpha&lt;/code&gt; parameter specifies the opacity of the frame, the second argument specifies the opacity when not full screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of using the above transparency setting which will persist I added these to init.el and call with M-x when needed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun transparency-on ()&#xA;  (interactive)&#xA;  &quot;Sets the transparency of the frame window. 0=transparent/100=opaque&quot;&#xA;  (set-frame-parameter (selected-frame) 'alpha 70))&#xA;&#xA;(defun transparency-off ()&#xA;  (interactive)&#xA;  (set-frame-parameter (selected-frame) 'alpha 100))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6877" LastActivityDate="2015-09-08T18:41:35.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16452" PostTypeId="1" AcceptedAnswerId="16466" CreationDate="2015-09-08T18:56:03.453" Score="0" ViewCount="139" Body="&lt;p&gt;I'm working on a small function to recursively load my Emacs customizations.  In writing it, I noticed the argument of &lt;code&gt;load&lt;/code&gt;, &lt;code&gt;MUST-SUFFIX&lt;/code&gt;, requires the &lt;code&gt;FILE&lt;/code&gt; argument to not include a directory name to capitalize on the suffix &quot;autodetection&quot; behavior (I only want it to load based on &lt;code&gt;load-suffixes&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I'd try temporarily setting &lt;code&gt;load-path&lt;/code&gt;, since the description of &lt;code&gt;load&lt;/code&gt; also mentions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This function searches the directories in `load-path'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I tried setting &lt;code&gt;load-path&lt;/code&gt; in a &lt;code&gt;let&lt;/code&gt; to the current directory, it wouldn't load any of the files.  However, when I temporarily appended it to the beginning of load-path, it seemed to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering what the difference is.  Since I am making use of functions from &lt;code&gt;dash.el&lt;/code&gt; and &lt;code&gt;cl-lib&lt;/code&gt;, do these need to be in load-path?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I wrote (sorry it's a bit jumbled, I threw it together rather quickly, since my current solution for the same task much slower):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-load-recursive (directory)&#xA;  (let ((load-path (cons directory load-path))&#xA;        (dir-contents&#xA;         (-&amp;gt;&amp;gt; (directory-files directory nil nil 'nosort)&#xA;              (-remove&#xA;               (lambda (element)&#xA;                 (or (string-equal element &quot;.&quot;)&#xA;                     (string-equal element &quot;..&quot;))))&#xA;              (-separate&#xA;               (lambda (file)&#xA;                 (file-regular-p&#xA;                  (expand-file-name file directory)))))))&#xA;    (destructuring-bind (files dirs) dir-contents&#xA;      (nconc&#xA;       (delq&#xA;        nil&#xA;        (mapcar&#xA;         (lambda (file)&#xA;           (when (load file 'noerror 'nomessage nil 'mustsuffix)&#xA;             (expand-file-name file directory)))&#xA;         (delete-dups (mapcar 'file-name-base files))))&#xA;       (car&#xA;        (mapcar&#xA;        #'my-load-recursive&#xA;        (mapcar&#xA;         (lambda (dir)&#xA;           (expand-file-name dir directory))&#xA;         dirs)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user2267" LastActivityDate="2015-09-09T06:06:33.117" Title="Trouble understanding load/load-path relationship" Tags="|load-path|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16453" PostTypeId="2" ParentId="13927" CreationDate="2015-09-08T19:24:24.860" Score="4" Body="&lt;p&gt;Although the question is specifically for Linux I went and figured it out for Windows (since this prompted me to find how to do it for myself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly enough, you don't have to invoke Dired, simply pass a folder as the file.  This saves a lot of hassle on Windows since &lt;code&gt;%1&lt;/code&gt; will pass &lt;code&gt;c:\Users&lt;/code&gt; (for example) and break on &lt;code&gt;\U&lt;/code&gt; if included in the &lt;code&gt;eval&lt;/code&gt; statement, while passing it as a file will properly parse it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Windows Registry Editor Version 5.00&#xA;&#xA;[HKEY_CLASSES_ROOT\Drive\shell]&#xA;@=&quot;Dired&quot;&#xA;&#xA;[HKEY_CLASSES_ROOT\Drive\shell\Dired]&#xA;@=&quot;Open in Dired&quot;&#xA;&#xA;[HKEY_CLASSES_ROOT\Drive\shell\Dired\command]&#xA;@=&quot;\&quot;%path/to/emacsclientw%\&quot; %1&quot;&#xA;&#xA;[HKEY_CLASSES_ROOT\Directory\shell]&#xA;@=&quot;XYplorer&quot;&#xA;&#xA;[HKEY_CLASSES_ROOT\Directory\shell\Dired]&#xA;@=&quot;Open in XYplorer&quot;&#xA;&#xA;[HKEY_CLASSES_ROOT\Directory\shell\Dired\command]&#xA;@=&quot;\&quot;%path/to/emacsclientw%\&quot; %1&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;http://www.sevenforums.com/customization/152674-how-change-default-file-manager.html&quot; rel=&quot;nofollow&quot;&gt;Seven Forums - How to change the default File Manager&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-09-08T19:24:24.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16454" PostTypeId="1" CreationDate="2015-09-08T20:14:53.927" Score="3" ViewCount="150" Body="&lt;p&gt;Running MacOSX GUI emacs installed via homebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I open a regular text file that contains non-ASCII characters, Emacs immediately crashes. These files have no header lines specifying encoding or other settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Works fine in terminal-mode emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to understand the cause of the crash, not just make it go away. Emacs leaves no core file or other debris.&lt;/p&gt;&#xA;" OwnerUserId="62" LastActivityDate="2016-02-06T00:59:29.447" Title="Crash when opening a file with non-ascii characters - how to diagnose?" Tags="|osx|crash|utf-8|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16456" PostTypeId="1" AcceptedAnswerId="16457" CreationDate="2015-09-08T20:49:57.743" Score="2" ViewCount="433" Body="&lt;p&gt;I want emacs to always display new buffers in the current frame, but always taking the whole frame, rather than splitting it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have customized display-buffer-alist to the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(display-buffer-alist (quote ((&quot;.*&quot; display-buffer-same-window))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work in many cases (e.g. it works for C-x C-b) but not for all cases, most notably compile-goto-error, which still splits the frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at documentation and other questions, including the similar &lt;a href=&quot;https://emacs.stackexchange.com/questions/327/how-can-i-block-a-frame-from-being-split&quot;&gt;How can I block a frame from being split?&lt;/a&gt;, but I can't find a correct solution. In particular, that question uses display-buffer-reuse-window, while I'm pretty sure I want display-buffer-same-window, and also I want to have absolutely no exceptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version is 24.5&lt;/p&gt;&#xA;" OwnerUserId="9459" LastActivityDate="2018-08-28T00:30:32.640" Title="How can I force emacs to never split frames, in particular for compile-goto-error?" Tags="|window|frames|window-splitting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16457" PostTypeId="2" ParentId="16456" CreationDate="2015-09-08T22:00:00.073" Score="2" Body="&lt;p&gt;As @lawlist said in a comment, you can use dedicated windows. A simple way to do this is to customize &lt;strong&gt;&lt;code&gt;special-display-regexps&lt;/code&gt;&lt;/strong&gt; to the list &lt;code&gt;(.*)&lt;/code&gt;, that is, a list with a regexp that matches all buffer names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Do not be bothered about the fact that help about &lt;code&gt;special-display-regexps&lt;/code&gt; tells you that it is &quot;obsolete since 24.3&quot;.  It is super simple and works perfectly.    I'd be lost without it.  (Emacs tells you to just use the hypertrophied, steroidal &lt;code&gt;display-buffer-alist&lt;/code&gt; instead.  Good luck with that!)]&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-08T22:00:00.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16458" PostTypeId="2" ParentId="16454" CreationDate="2015-09-08T22:04:30.600" Score="1" Body="&lt;p&gt;Sounds like you might be bumping into &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21428&quot; rel=&quot;nofollow&quot;&gt;Emacs bug #21428&lt;/a&gt;: &lt;strong&gt;24.5; Crash of emacs on OS X, installed via homebrew cask&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's still being investigated.  If you follow the bug thread perhaps you can contribute to helping understand it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-08T22:04:30.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16459" PostTypeId="1" AcceptedAnswerId="16460" CreationDate="2015-09-08T23:47:26.153" Score="7" ViewCount="134" Body="&lt;p&gt;&lt;strong&gt;How can I configure Emacs to update a buffer's file association when the file is renamed externally?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Textmate, I can open a file &quot;foo.txt&quot;, use a different program to rename the file to &quot;bar.txt&quot;, and Textmate automatically notices that the file was renamed. The new filename is displayed in the Textmate's window title, and editing and saving the file writes the changes to &quot;bar.txt&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs, if I open a file &quot;foo.txt&quot; then use a different program to rename the file to &quot;bar.txt&quot;, Emacs' buffer is still associated with &quot;foo.txt&quot;. Editing and saving the file writes the file back to &quot;foo.txt&quot;, but I would like it to write the file to &quot;bar.txt&quot; (I would also like the buffer name to change to &quot;bar.txt&quot;, and for &lt;code&gt;revert-buffer&lt;/code&gt; to read the file from &quot;bar.txt&quot;).&lt;/p&gt;&#xA;" OwnerUserId="9461" LastActivityDate="2015-09-09T00:56:02.853" Title="Emacs handle when file renamed externally" Tags="|buffers|files|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16460" PostTypeId="2" ParentId="16459" CreationDate="2015-09-09T00:56:02.853" Score="1" Body="&lt;p&gt;If you want to implement this yourself, then I imagine you need to utilise the Notifications on File Changes functionality (provided that one of the requisite libraries is supported on your OS).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) File Notifications&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-09-09T00:56:02.853" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16462" PostTypeId="1" AcceptedAnswerId="17367" CreationDate="2015-09-09T03:40:34.330" Score="1" ViewCount="971" Body="&lt;p&gt;I have been trying to use &lt;a href=&quot;https://github.com/benma/visual-regexp-steroids.el/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;visual-regexp-steroids&lt;/code&gt;&lt;/a&gt; without luck (a thread on this package can be found &lt;a href=&quot;https://emacs.stackexchange.com/questions/69/how-can-i-test-and-use-a-perl-regular-expression-interactively&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;code&gt;vr/replace (C-c p)&lt;/code&gt;, I get a prompt in the minibuffer. I can enter regexps and Emacs shows interactively every match in the buffer. So far so good. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem comes when I click &lt;code&gt;RET&lt;/code&gt; and then enter another string (the one I want to replace my matches with). If I now do &lt;code&gt;RET&lt;/code&gt; (to do the actual replacements), I get the following message in the mini-buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Args out of range #&amp;lt;killed buffer&amp;gt;, 0, 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why? How can I debug the problem and get it to work?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Update: I have opened an issue in the GitHub repository &lt;a href=&quot;https://github.com/benma/visual-regexp-steroids.el/issues/13&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-14T12:41:49.850" Title="&quot;Args out of range&quot; error when replacing with visual-regexp-steroids" Tags="|regular-expressions|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16463" PostTypeId="1" CreationDate="2015-09-09T03:55:00.990" Score="9" ViewCount="956" Body="&lt;p&gt;I use go-dlv to debug Go programs. This package is very simple and relies on standard gud functionality (&lt;a href=&quot;https://github.com/benma/go-dlv.el/blob/master/go-dlv.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/benma/go-dlv.el/blob/master/go-dlv.el&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing that I found missing is highlighting of breakpoints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any easy way to customize GUD to enable this feature? If not I would appreciate any advice how to implement it. I am fairly new to customizing emacs and do not know where to start. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="9464" LastActivityDate="2015-09-09T03:55:00.990" Title="gud: highlight breakpoints with custom debugger" Tags="|gud|golang|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16464" PostTypeId="1" AcceptedAnswerId="16485" CreationDate="2015-09-09T04:05:53.123" Score="3" ViewCount="576" Body="&lt;p&gt;Whenever I use &lt;code&gt;emacsclient&lt;/code&gt;, I tend to use it without a file argument. This is because my emacs file finder is generally better than my shell file finder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, when &lt;code&gt;emacsclient&lt;/code&gt; is not given a file argument, neither &lt;code&gt;server-visit-hook&lt;/code&gt; nor &lt;code&gt;server-switch-hook&lt;/code&gt; are fired, and I'm left without crucial bits of server setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I work around this limitation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Added example code.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((my/evil-mode-line-face-cookies nil))&#xA;  (defun my/evil-set-mode-line-face (&amp;amp;rest args)&#xA;    (cl-destructuring-bind (bg-color fg-color)&#xA;        (pcase evil-state&#xA;          (`normal  '(&quot;white&quot; &quot;blue&quot;))&#xA;          (`emacs   '(&quot;white&quot; &quot;green&quot;))&#xA;          (`insert  '(&quot;black&quot; &quot;grey&quot;))&#xA;          (`visual  '(&quot;white&quot; &quot;cyan&quot;))&#xA;          (`replace '(&quot;white&quot; &quot;red&quot;))&#xA;          (other    '(&quot;grey&quot;  &quot;black&quot;)))&#xA;      (mapc #'face-remap-remove-relative my/evil-mode-line-face-cookies)&#xA;      (setq my/evil-mode-line-face-cookies&#xA;            (list (face-remap-add-relative&#xA;                   'mode-line&#xA;                   mode-line&#xA;                   `((:foreground ,fg-color :background ,bg-color)&#xA;                     mode-line))&#xA;&#xA;                  (face-remap-add-relative&#xA;                   'mode-line-buffer-id&#xA;                   mode-line-buffer-id&#xA;                   `((:foreground ,fg-color)&#xA;                     mode-line-buffer-id)))))))&#xA;&#xA;(add-hook 'post-command-hook #'my/evil-set-mode-line-face)&#xA;(add-hook 'after-make-frame-functions #'my/evil-set-mode-line-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-09-10T20:31:55.513" LastActivityDate="2015-09-10T20:31:55.513" Title="Emacs server init when called without file" Tags="|hooks|emacs-daemon|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16465" PostTypeId="2" ParentId="16428" CreationDate="2015-09-09T04:22:08.467" Score="1" Body="&lt;p&gt;Upgrading Emacs from 24.4 to 24.5 solves the problem, although I am not sure what is wrong with my built of Emacs 24.4. (I compiled both versions of Emacs from source on Mac OS X Yosemite.)&lt;/p&gt;&#xA;" OwnerUserId="9421" LastActivityDate="2015-09-09T04:22:08.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16466" PostTypeId="2" ParentId="16452" CreationDate="2015-09-09T05:26:38.583" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;When I tried setting &lt;code&gt;load-path&lt;/code&gt; in a &lt;code&gt;let&lt;/code&gt; to the current directory, it wouldn't load any of the files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Make sure that &lt;code&gt;load-path&lt;/code&gt; is still a &lt;em&gt;list&lt;/em&gt;, and not just a directory path &lt;em&gt;string&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((load-path (list &quot;/path/to/directory&quot;)))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and never this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((load-path &quot;/path/to/directory&quot;))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In addition, remember that libraries very commonly require (or otherwise load, potentially indirectly) other libraries, and as such, clobbering the &lt;code&gt;load-path&lt;/code&gt; completely is not necessarily a good idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Directories in &lt;code&gt;load-path&lt;/code&gt; are looked at in the order of the list, so &lt;code&gt;cons&lt;/code&gt;ing your directory to the front of the list (exactly as you ended up doing) will give that directory priority when Emacs looks for libraries, and is therefore going to be a more robust approach in general:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((load-path (cons &quot;/path/to/directory&quot; load-path)))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-09T06:06:33.117" LastActivityDate="2015-09-09T06:06:33.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16467" PostTypeId="2" ParentId="16450" CreationDate="2015-09-09T05:48:34.283" Score="4" Body="&lt;p&gt;For autoformatting code you can use these packages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;py-autopep8 &lt;/li&gt;&#xA;&lt;li&gt;py-isort&lt;/li&gt;&#xA;&lt;li&gt;web-beautify&lt;/li&gt;&#xA;&lt;li&gt;web-mode (optional)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Autoremove trailing whitespaces and indent regions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun format-current-buffer()&#xA;  (indent-region (point-min) (point-max)))&#xA;(defun untabify-current-buffer()&#xA;  (if (not indent-tabs-mode)&#xA;      (untabify (point-min) (point-max)))&#xA;  nil)&#xA;(add-to-list 'write-file-functions 'untabify-current-buffer)&#xA;(add-to-list 'write-file-functions 'delete-trailing-whitespace)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Autosorting python imports:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'before-save-hook 'py-isort-before-save)&#xA;(setq py-isort-options '(&quot;-sl&quot;)) ;; One module per line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Settings for web-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'web-mode-hook (lambda ()&#xA;                           (setq web-mode-markup-indent-offset 4)&#xA;                           (setq web-mode-css-indent-offset 4)&#xA;                           (setq web-mode-code-indent-offset 2)&#xA;                           (setq web-mode-indent-style 4)&#xA;                           (setq web-mode-enable-auto-pairing t)&#xA;                           (setq web-mode-enable-css-colorization t)&#xA;                           (setq web-mode-enable-current-element-highlight t)&#xA;                           (setq web-mode-enable-current-column-highlight t)&#xA;                           ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Auto-beautify buffer before save (js2-mode, web-mode, css-mode, you can add more), NodeJS and package &lt;strong&gt;js-beautify&lt;/strong&gt; required (&lt;code&gt;npm install -g js-beautify&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'js2-mode-hook (lambda ()(add-hook 'before-save-hook 'web-beautify-js-buffer t t)))&#xA;(add-hook 'web-mode-hook (lambda ()(add-hook 'before-save-hook 'web-beautify-html-buffer t t)))&#xA;(add-hook 'css-mode-hook (lambda ()(add-hook 'before-save-hook 'web-beautify-css-buffer t t)))&#xA;&#xA;(eval-after-load 'js2&#xA;  '(add-hook 'js2-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-js-buffer t t))))&#xA;&#xA;(eval-after-load 'js2-mode&#xA;  '(add-hook 'js2-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-js-buffer t t))))&#xA;&#xA;;; Or if you're using 'js-mode' (a.k.a 'javascript-mode')&#xA;(eval-after-load 'js&#xA;  '(add-hook 'js-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-js-buffer t t))))&#xA;&#xA;(eval-after-load 'json-mode&#xA;  '(add-hook 'json-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-js-buffer t t))))&#xA;&#xA;(eval-after-load 'sgml-mode&#xA;  '(add-hook 'html-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-html-buffer t t))))&#xA;&#xA;(eval-after-load 'css-mode&#xA;  '(add-hook 'css-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-css-buffer t t))))&#xA;&#xA;(eval-after-load 'web-mode&#xA;  '(add-hook 'web-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-html-buffer t t))))&#xA;&#xA;(eval-after-load 'html-mode&#xA;  '(add-hook 'html-mode-hook&#xA;             (lambda ()&#xA;               (add-hook 'before-save-hook 'web-beautify-html-buffer t t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Autopep8&lt;/strong&gt; (require &lt;strong&gt;autopep8&lt;/strong&gt; on system side, install or update with pip):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;P. S. &lt;a href=&quot;https://github.com/dunmaksim/.emacs&quot; rel=&quot;nofollow&quot;&gt;My .emacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6919" LastActivityDate="2015-09-09T05:48:34.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16468" PostTypeId="1" CreationDate="2015-09-09T06:51:43.220" Score="7" ViewCount="1531" Body="&lt;p&gt;At work, we have a policy which states that we have to use 4 spaces for indentation, and in my opinion it makes the code harder to read. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to indent with 4 spaces, but display it as 2 spaces?&lt;/p&gt;&#xA;" OwnerUserId="8260" LastEditorUserId="2642" LastEditDate="2015-09-09T17:46:34.643" LastActivityDate="2016-03-17T10:50:17.633" Title="Indent with 4 spaces, but display 2" Tags="|indentation|display|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16469" PostTypeId="1" AcceptedAnswerId="16470" CreationDate="2015-09-09T07:40:16.137" Score="120" ViewCount="39807" Body="&lt;p&gt;My recent Git merge has resulted in a large number of conflicts. My current approach is to search for the next occurence of '&amp;lt;&amp;lt;&amp;lt;' and then perform the merge by standard text editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: is there a way Emacs can support merging using the information availabe in Git about my version, their version and the base version of the file?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: This question has a different scope than &lt;a href=&quot;https://emacs.stackexchange.com/questions/5507&quot;&gt;this related question&lt;/a&gt;, since it is not limited to invoking ediff.&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2023-08-10T10:10:39.257" Title="How to merge Git conflicts in Emacs" Tags="|git|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16470" PostTypeId="2" ParentId="16469" CreationDate="2015-09-09T07:53:25.210" Score="132" Body="&lt;p&gt;You might want to try out &lt;code&gt;smerge-mode&lt;/code&gt; just open the conflicted file and do &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;smerge-mode&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. It will highlight all the conflicted regions. It also adds keybindings to easily resolve the conflicts, consult its documenation &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;smerge-mode&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; to know them.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Default prefix&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I find the default prefix for &lt;code&gt;smerge-mode&lt;/code&gt; &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;^&lt;/kbd&gt; cumbersome so I have changed it to  &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq smerge-command-prefix &amp;quot;\C-cv&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Important keybindings&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;For me the most important bindings are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;smerge-next&lt;/code&gt; bound to &lt;kbd&gt;smerge-command-prefix&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt; to move to next conflict.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;smerge-previous&lt;/code&gt; bound to &lt;kbd&gt;smerge-command-prefix&lt;/kbd&gt;&lt;kbd&gt;p&lt;/kbd&gt; to move to previous conflict.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;smerge-keep-current&lt;/code&gt; bound to &lt;kbd&gt;smerge-command-prefix&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt; to keep the version the cursor is on.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;smerge-keep-mine&lt;/code&gt; bound to &lt;kbd&gt;smerge-command-prefix&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt; to keep your changes.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;smerge-keep-other&lt;/code&gt; bound to &lt;kbd&gt;smerge-command-prefix&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; to keep other changes.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;smerge-ediff&lt;/code&gt; bound to &lt;kbd&gt;smerge-command-prefix&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt; to start an ediff session to merge the conflicts. This is same as &lt;code&gt;vc-resolve-conflicts&lt;/code&gt; (thanks @phils and @Malabarba for pointing this out).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Enabling smerge-mode automatically&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; &lt;em&gt;The following is relevant only on Emacs versions before &lt;code&gt;25.1&lt;/code&gt;, the following can cause problems on later versions, see &lt;a href=&quot;https://github.com/magit/magit/issues/3897&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/magit/magit/issues/3897&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Additionally you might be interested in automatically enabling &lt;code&gt;smerge-mode&lt;/code&gt; when visiting a file/buffer with conflict markers you can use something like the following to achieve this&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-enable-smerge-maybe ()&#xA;  (when (and buffer-file-name (vc-backend buffer-file-name))&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (when (re-search-forward &amp;quot;^&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; &amp;quot; nil t)&#xA;        (smerge-mode +1)))))&#xA;&#xA;(add-hook 'buffer-list-update-hook #'my-enable-smerge-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that I am using &lt;code&gt;buffer-list-update-hook&lt;/code&gt; and not &lt;code&gt;find-file-hook&lt;/code&gt; since most of the times I get conflicts in a buffer which is already open in emacs in which case &lt;code&gt;find-file-hook&lt;/code&gt; is of no help.&lt;/p&gt;&#xA;&lt;p&gt;Also check other methods mentioned in this &lt;a href=&quot;https://emacs.stackexchange.com/questions/5507/how-to-start-ediff-ing-a-file-that-has-git-conflict-markers-in-it&quot;&gt;answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="18414" LastEditDate="2022-03-08T19:43:46.417" LastActivityDate="2022-03-08T19:43:46.417" CommentCount="13" ContentLicense="CC BY-SA 4.0" />
  <row Id="16471" PostTypeId="2" ParentId="16469" CreationDate="2015-09-09T08:10:43.017" Score="53" Body="&lt;p&gt;Edit: since this answer got more upvotes than I expected, I expanded it a bit.&lt;/p&gt;&#xA;&lt;p&gt;To supplement the answer by @IqbalAnsari, you could also use &lt;code&gt;vc-resolve-conflicts&lt;/code&gt; (as mentioned by others, it is an alias to &lt;code&gt;smerge-ediff&lt;/code&gt;).  This will start the &lt;code&gt;ediff&lt;/code&gt; interface.  On the left will be the first merge parent, and the second merge parent on the right.  They are labelled on the modeline with &lt;code&gt;MINE&lt;/code&gt; and &lt;code&gt;OTHER&lt;/code&gt; respectively (Edit: In newer Emacs, these are now labelled as &lt;code&gt;UPPER=HEAD*&lt;/code&gt; and &lt;code&gt;LOWER=&amp;lt;sha&amp;gt;*&lt;/code&gt;).  The merged buffer is shown below (see screenshot).&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/I0GlN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/I0GlN.png&quot; alt=&quot;A screenshot of the ediff interface&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2&gt;Keybindings&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Navigate&lt;/strong&gt; through the conflicts with &lt;kbd&gt;n&lt;/kbd&gt; and &lt;kbd&gt;p&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Accept versions&lt;/strong&gt; with &lt;kbd&gt;a&lt;/kbd&gt; or &lt;kbd&gt;b&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Look at the ancestor&lt;/strong&gt; with &lt;kbd&gt;/&lt;/kbd&gt;!&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Quit&lt;/strong&gt; the ediff session with &lt;kbd&gt;q&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can also navigate to the merged buffer with &lt;code&gt;other-window&lt;/code&gt; and hand-edit in case resolving a conflict is more complicated than accepting a version.  When you are done, you can save the buffer and quit Emacs as usual.  For more help, just use &lt;kbd&gt;?&lt;/kbd&gt; during the &lt;code&gt;ediff&lt;/code&gt; session, there are a whole bunch of very useful commands in there.  I still don't know what half of them do!&lt;/p&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="2093" LastEditDate="2023-08-10T10:10:39.257" LastActivityDate="2023-08-10T10:10:39.257" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="16472" PostTypeId="1" AcceptedAnswerId="16476" CreationDate="2015-09-09T13:42:23.543" Score="2" ViewCount="1337" Body="&lt;p&gt;I'm using org-mode and the agenda for weekly planning, kind of like a calendar. Entries include things like &quot;sleeping 11pm to 6am&quot; and &quot;gym 3pm to 5pm&quot;, or even &quot;read dresden files 8pm to 9pm&quot;. I use regular active timestamps for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have to be somewhere 9am to 5pm every day except Sundays for the next 5 weeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things I've thought of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;code&gt;org-clone-subtree-with-time-shift&lt;/code&gt;, manually delete any Sundays, and put it all in its own subtree so I can archive it later. If the schedule changes, it's quite a bit of error prone editing work.&lt;/li&gt;&#xA;&lt;li&gt;Single headline with multiple (30) active timestamps. That way, at least I can use column editing to shift times around. Still a lot of noise, though.&lt;/li&gt;&#xA;&lt;li&gt;Put an entry with 6 repeating stamps (every day except Sunday) in its own file, remove from agenda files when done.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to keep past schedules for reference (i.e.: what was my schedule 23 days ago? How much time was I putting into the gym last month? Have I been scheduling enough reading time recently? And so on), so completely removing things from the agenda (such as temporary files in agenda-files) is not very useful to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you handle a situation like this in your agenda?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a reason org-mode doesn't support an &quot;end&quot; mark for repeating entries?&lt;/p&gt;&#xA;" OwnerUserId="3945" LastEditorUserId="3945" LastEditDate="2015-09-09T14:12:41.080" LastActivityDate="2015-09-09T15:14:57.813" Title="How to repeat an appointment within an interval" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16473" PostTypeId="1" CreationDate="2015-09-09T13:54:23.787" Score="3" ViewCount="393" Body="&lt;p&gt;When I call &lt;code&gt;gcalcli&lt;/code&gt; from the bash shell, I get the output described in the documentation. But when I run &lt;code&gt;M-x shell&lt;/code&gt; on emacs (24.3) and call &lt;code&gt;gcalcli&lt;/code&gt; from there, I get a lot of &lt;code&gt;^[&lt;/code&gt; characters. Compare screenshots from the shell and from emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Rce1D.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Rce1D.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/VUsg8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VUsg8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;init.el&lt;/code&gt; already contains the following lines, which are supposed to help with this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'comint-output-filter-functions&#xA;          'comint-output-ctrl-m)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't really have a problem with calling &lt;code&gt;gcalcli&lt;/code&gt; from the shell whenever I need it. I just want to understand why emacs uses non-printing characters here and how to suppress them if I want to.&lt;/p&gt;&#xA;" OwnerUserId="5454" LastActivityDate="2016-07-12T12:05:55.490" Title="emacs shell: remove all non-printable characters" Tags="|shell-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16474" PostTypeId="1" CreationDate="2015-09-09T14:15:12.777" Score="1" ViewCount="43" Body="&lt;p&gt;In dired, when you use &lt;code&gt;i&lt;/code&gt; to see the contents of subdirectories, it looks sort of like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/dir:&#xA;file1&#xA;subdir1&#xA;subdir2&#xA;&#xA;/dir/subdir1:&#xA;foo&#xA;bar&#xA;&#xA;/dir/subdir2:&#xA;baz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to make it look more like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/dir:&#xA;file1&#xA;subdir1&#xA;  foo&#xA;  bar&#xA;subdir2&#xA;  baz&#xA;  bam&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do that?&lt;/p&gt;&#xA;" OwnerUserId="5347" LastActivityDate="2015-09-09T14:15:12.777" Title="Inline directories in dired" Tags="|dired|" AnswerCount="0" CommentCount="0" ClosedDate="2015-09-09T14:18:36.130" ContentLicense="CC BY-SA 3.0" />
  <row Id="16476" PostTypeId="2" ParentId="16472" CreationDate="2015-09-09T15:14:57.813" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How would you handle a situation like this in your agenda?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-clone-subtree-wth-time-shift&lt;/code&gt; is indeed the most flexible of the options you have listed. From the documentation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;you can spell out a number of instances of a repeating task, and still retain the repeater to cover future instances of the task&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Setting N to 0, then, can be used to remove the repeater from a subtree&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;would be useful in your case when you have scheduled something but have not done it. For example, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How much time was I putting into the gym last month?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;because as we know scheduling in the calendar is one thing and actually keeping track of whether it was done (task logging) is another thing. Since you want to combine the two, you need a way to delete those entries that have been scheduled but not completed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;code&gt;org-clone-subtree-wth-time-shift&lt;/code&gt; seems like the best option.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-09T15:14:57.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16477" PostTypeId="1" AcceptedAnswerId="16478" CreationDate="2015-09-09T19:43:03.850" Score="10" ViewCount="3603" Body="&lt;p&gt;For the sake of tidiness, I'd like to group setq(s) under single, related banner.&#xA;Let's say I want to set the value of compilation-scroll-output in &quot;compilation&quot; unit like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package compilation&#xA;  :init&#xA;  (progn&#xA;    (setq compilation-scroll-output t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All I get is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Could not load compilation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How is it?&lt;/p&gt;&#xA;" OwnerUserId="9472" LastEditorUserId="9472" LastEditDate="2015-09-09T21:02:37.520" LastActivityDate="2015-09-09T21:15:06.887" Title="How to use use-package with built-in packages?" Tags="|use-package|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16478" PostTypeId="2" ParentId="16477" CreationDate="2015-09-09T19:47:58.090" Score="14" Body="&lt;p&gt;The package's name is &lt;code&gt;compile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below should work.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package compile&#xA;  :init&#xA;  (progn&#xA;    (setq compilation-scroll-output t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It would be worthwhile to note &lt;strong&gt;@JordonBiondo&lt;/strong&gt;'s comment on how to figure out a package's name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to know which package a variable belongs to, do &lt;code&gt;C-h v&lt;/code&gt; or &lt;code&gt;M-x describe-variable&lt;/code&gt; followed by the var name (for a function name, &lt;code&gt;C-h f&lt;/code&gt; or &lt;code&gt;M-x describe-function&lt;/code&gt;). From the *Help* window that pops up, navigate to the package's &lt;code&gt;.el&lt;/code&gt; file and see the &lt;code&gt;(provide ..)&lt;/code&gt; call to find out the package name.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-09-09T21:15:06.887" LastActivityDate="2015-09-09T21:15:06.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16479" PostTypeId="1" CreationDate="2015-09-09T20:26:55.597" Score="1" ViewCount="79" Body="&lt;p&gt;What would be a way to achieve the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* interface A&#xA;** sample files&#xA;1 file &quot;alpha&quot;&#xA;2 file &quot;beta&quot;&#xA;    TODO fix missing tag&#xA;3 file &quot;gamma&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;E.g. I am trying to associate a &lt;code&gt;TODO&lt;/code&gt; action with a specific list item as opposed to a heading. But it seems that only headings can be marked as &lt;code&gt;TODO&lt;/code&gt; in org-mode. Should I use a checkbox instead given that it's &lt;a href=&quot;http://orgmode.org/manual/Checkboxes.html&quot; rel=&quot;nofollow&quot;&gt;suggested&lt;/a&gt; that they really are lightweight TODOs?&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-09-09T20:26:55.597" Title="assigning TODO status to specific list items (not headings)" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16480" PostTypeId="1" AcceptedAnswerId="16481" CreationDate="2015-09-09T20:48:32.080" Score="4" ViewCount="60" Body="&lt;p&gt;I just encountered this behavior of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this doesn't&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require (make-symbol &quot;test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is that and can I workaround it somehow?&lt;/p&gt;&#xA;" OwnerUserId="9473" LastEditorUserId="105" LastEditDate="2016-06-22T20:30:07.183" LastActivityDate="2016-06-22T20:30:07.183" Title="Why requiring fails with dynamic symbols?" Tags="|symbols|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16481" PostTypeId="2" ParentId="16480" CreationDate="2015-09-09T20:52:38.373" Score="4" Body="&lt;p&gt;OK, it looks like the symbol needs to be &quot;interned&quot;. &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require (intern &quot;test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9473" LastEditorUserId="247" LastEditDate="2015-09-11T01:54:20.910" LastActivityDate="2015-09-11T01:54:20.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16482" PostTypeId="2" ParentId="15268" CreationDate="2015-09-09T21:51:34.087" Score="3" Body="&lt;p&gt;It seems that this problem is caused by a &lt;a href=&quot;https://github.com/tkf/emacs-jedi/issues/234&quot; rel=&quot;nofollow&quot;&gt;bug&lt;/a&gt; of &lt;a href=&quot;https://github.com/tkf/emacs-jedi&quot; rel=&quot;nofollow&quot;&gt;emacs-jedi&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid it,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Upgrade emacs-jedi to the latest version (newer than 736300f).&lt;/li&gt;&#xA;&lt;li&gt;Set &lt;code&gt;jedi:install-imenu&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; (the default value is &lt;code&gt;nil&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Something is wrong with &lt;code&gt;jedi:after-change-handler&lt;/code&gt;.&#xA;But I do not fully understand why the problem occurs.&#xA;It is related to asynchronous programming and is hard to debug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even in the latest version (cf4689e), the problem still occurs if &lt;code&gt;jedi:install-imenu&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt;.&#xA;Essentially, the bug is not fixed yet.&lt;/p&gt;&#xA;" OwnerUserId="9471" LastActivityDate="2015-09-09T21:51:34.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16483" PostTypeId="1" CreationDate="2015-09-09T23:55:56.713" Score="2" ViewCount="93" Body="&lt;p&gt;I'm trying to export a heading as a block construct.&#xA;Something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* heading&#xA;  Content&#xA;* Another Heading&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gets exported to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{heading}&#xA;Content&#xA;\end{heading}&#xA;\section{Another Heading}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using something like a tag &lt;code&gt;:block:&lt;/code&gt; or a &lt;code&gt;:export: block&lt;/code&gt; property for the heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now using this answer for &lt;a href=&quot;https://emacs.stackexchange.com/questions/9492/is-it-possible-to-export-content-of-subtrees-without-their-headings&quot;&gt;is-it-possible-to-export-content-of-subtrees-without-their-headings&lt;/a&gt; for some of my document which touches on a similar modification which leads me to believe it should be possible.&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2015-09-12T09:25:08.543" LastActivityDate="2015-09-12T09:25:08.543" Title="Is it possible in org-mode to export a * heading to a \begin{heading} \end{heading} block construct?" Tags="|org-mode|latex|org-export|tex|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16484" PostTypeId="1" AcceptedAnswerId="16486" CreationDate="2015-09-10T00:25:56.853" Score="2" ViewCount="566" Body="&lt;p&gt;I have fuzzy matching in &lt;code&gt;helm-apropos&lt;/code&gt; with &lt;code&gt;helm-apropos-fuzzy-match&lt;/code&gt; set to true. I would like to get fuzzy matching for &lt;code&gt;descibe-function&lt;/code&gt; and &lt;code&gt;describe-variable&lt;/code&gt; and the like, too. How can I enable it for these?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-09-10T16:14:54.220" Title="How to get fuzzy matching with helm in describe-*?" Tags="|helm|fuzzy-search|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16485" PostTypeId="2" ParentId="16464" CreationDate="2015-09-10T00:51:29.620" Score="3" Body="&lt;p&gt;&lt;code&gt;after-make-frame-functions&lt;/code&gt; is what I use in these situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example, adapted from &lt;a href=&quot;https://stackoverflow.com/a/5066313/324105&quot;&gt;https://stackoverflow.com/a/5066313/324105&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-frame-behaviours (&amp;amp;optional frame)&#xA;  &quot;Make frame- and/or terminal-local changes.&quot;&#xA;  (with-selected-frame (or frame (selected-frame))&#xA;    ;; do things...&#xA;    ))&#xA;;; Evaluate immediately (for non-daemon emacs), and also&#xA;;; upon frame creation (for new terminals via emacsclient).&#xA;(my-frame-behaviours)&#xA;(add-hook 'after-make-frame-functions 'my-frame-behaviours)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-09-10T06:34:46.127" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16486" PostTypeId="2" ParentId="16484" CreationDate="2015-09-10T00:55:47.043" Score="2" Body="&lt;p&gt;Setting &lt;code&gt;helm-mode-fuzzy-match&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; should do the work. These two just don't have separate options, let the helm maintainer know, if you think it is worth to have.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-09-10T00:55:47.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16487" PostTypeId="1" CreationDate="2015-09-10T00:59:33.703" Score="2" ViewCount="202" Body="&lt;p&gt;I'm working on a textobject based on &lt;code&gt;ffap-guesser&lt;/code&gt;. I'd like for &lt;kbd&gt;yif&lt;/kbd&gt; to yank the &lt;code&gt;file-at-point&lt;/code&gt;. This works great, except when there is no literal file at point, and &lt;code&gt;ffap&lt;/code&gt; is doing some of it's more creative guessing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example. Running &lt;code&gt;ffap-guesser&lt;/code&gt; on&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'config-company)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yields &lt;code&gt;&quot;/home/pythonnut/.emacs.d/modules/config-company.el&quot;&lt;/code&gt;. Ideally, &lt;kbd&gt;yif&lt;/kbd&gt; would yank that string instead of what's in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mostly care about yanking, but obviously it would be cool if this worked for other operators. (Deleting, for example, would delete the range that &lt;code&gt;ffap-guesser&lt;/code&gt; used to guess?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be done reasonably?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-12-09T18:25:33.573" Title="Evil virtual textobjects" Tags="|evil|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16488" PostTypeId="1" AcceptedAnswerId="16524" CreationDate="2015-09-10T01:35:08.023" Score="1" ViewCount="273" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.org.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;This&lt;/a&gt; page about ob-lilypond has an example of PDF output of &lt;a href=&quot;https://raw.githubusercontent.com/mjago/ob-lilypond/master/examples/basic-mode/pdf-example/pdf-example.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; org file. The PDF looks great--small sheet music snippets under explanatory text. The whole thing fits on 2 pages. However, when I grab this org file and &lt;code&gt;C-c C-e l o&lt;/code&gt; on my own system, the output PDF is 15 pages. Each paragraph of text and each small musical illustration are on their own page, over many inches of whitespace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if this is significant, but I'll mention too that my system asks for a y/n input from me regarding the export of each individual block of Lilypond code during export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The org-exporter had some complaints:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Overfull \vbox (75.24173pt too high) has occurred while \output is active&#xA;[2 &amp;lt;./ionian-eps-converted-to.pdf&amp;gt;]&#xA;&amp;lt;dorian-eps-converted-to.pdf, id=29, 541.02126pt x 814.04124pt&amp;gt;&#xA;&amp;lt;use dorian-eps-converted-to.pdf&amp;gt; [3]&#xA;Overfull \vbox (36.67224pt too high) has occurred while \output is active&#xA;[4 &amp;lt;./dorian-eps-converted-to.pdf&amp;gt;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I wonder if this has something to do with Lilypond being determined to print its version number at the bottom of each block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TM5KW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TM5KW.png&quot; alt=&quot;lilypond eps output&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here's the beginning of the exporter's TeX file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[11pt]{article}&#xA;\usepackage[utf8]{inputenc}&#xA;\usepackage[T1]{fontenc}&#xA;\usepackage{fixltx2e}&#xA;\usepackage{graphicx}&#xA;\usepackage{grffile}&#xA;\usepackage{longtable}&#xA;\usepackage{wrapfig}&#xA;\usepackage{rotating}&#xA;\usepackage[normalem]{ulem}&#xA;\usepackage{amsmath}&#xA;\usepackage{textcomp}&#xA;\usepackage{amssymb}&#xA;\usepackage{capt-of}&#xA;\usepackage{hyperref}&#xA;\usepackage[cm]{fullpage}&#xA;\author{Steven Arntson}&#xA;\date{}&#xA;\title{Modes in the Key of C}&#xA;\hypersetup{&#xA; pdfauthor={Steven Arntson},&#xA; pdftitle={Modes in the Key of C},&#xA; pdfkeywords={},&#xA; pdfsubject={},&#xA; pdfcreator={Emacs 24.5.1 (Org mode 8.3.1)}, &#xA; pdflang={English}}&#xA;\begin{document}&#xA;&#xA;\maketitle&#xA;\section*{Ionian Mode}&#xA;\label{sec:orgheadline1}&#xA;Lorem ipsum dolor sit amet, consectetur adipiscing elit...&#xA;\linebreak&#xA;\includegraphics[width=.9\linewidth]{ionian.eps}&#xA;&#xA;\section*{Dorian Mode}&#xA;\label{sec:orgheadline2}&#xA;Lorem ipsum dolor sit amet, consectetur adipiscing elit ...&#xA;\linebreak&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What might cause this?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-09-10T18:42:01.397" LastActivityDate="2015-09-11T07:38:37.043" Title="Why is my output of this org doc with lilypond code different than shown?" Tags="|org-export|org-babel|lilypond|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16489" PostTypeId="1" CreationDate="2015-09-10T01:55:12.777" Score="11" ViewCount="3142" Body="&lt;p&gt;I have always found TRAMP to be crazy slow (5+ secs to fetch a directory listing) so I've avoided it for years. Time to figure out what is going on. I'm always connecting via ssh, using declarations in ~/.ssh/config. The connections are fine, I've survived buy running remote emacs sessions in a terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured out how to turn on tramp debugging but not sure how to read the output. It appears that there might be a delay before tramp starts doing anything? Perhaps tramp is conflicting with some other mode?&lt;/p&gt;&#xA;" OwnerUserId="62" LastEditorUserId="6682" LastEditDate="2023-11-06T19:59:39.010" LastActivityDate="2023-11-06T19:59:39.010" Title="TRAMP is unbearably slow (OSX, ssh)" Tags="|osx|tramp|ssh|performance|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16490" PostTypeId="1" AcceptedAnswerId="16495" CreationDate="2015-09-10T02:14:49.570" Score="14" ViewCount="962" Body="&lt;p&gt;I'd like to temporarily override a function in a piece of code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take, for example, the following:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nadvice/load-quiet (args)&#xA;  (cl-destructuring-bind&#xA;      (file &amp;amp;optional noerror nomessage nosuffix must-suffix)&#xA;      args&#xA;    (list file noerror t nosuffix must-suffix)))&#xA;&#xA;(defun nadvice/idle-require-quiet (old-fun &amp;amp;rest args)&#xA;    (advice-add 'load :filter-args #'nadvice/load-quiet)&#xA;    (apply old-fun args)&#xA;    (advice-remove #'load #'nadvice/load-quiet))&#xA;&#xA;(advice-add 'idle-require-load-next :around #'nadvice/idle-require-quiet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;What doesn't work:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This. It would be much cleaner if I could avoid manually enabling and disabling the advice and trust the single-threaded nature of Emacs to take care of things.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cl-letf&lt;/code&gt; won't let me reference the origional function, so I can't implement things that &lt;code&gt;:filter-args&lt;/code&gt; would normally do.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cl-flet&lt;/code&gt; can't override functions in other functions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/nicferrier/emacs-noflet&quot;&gt;&lt;code&gt;noflet&lt;/code&gt;&lt;/a&gt; is an external package, which I'd like to avoid. (Also does much more than I need)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="105" LastEditDate="2016-06-22T20:29:33.540" LastActivityDate="2016-06-22T20:29:33.540" Title="Emacs let-bound advice" Tags="|advice|let-binding|local-functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16492" PostTypeId="1" AcceptedAnswerId="16493" CreationDate="2015-09-10T05:38:55.273" Score="16" ViewCount="4188" Body="&lt;p&gt;While working on a document in emacs I often find myself opening a new buffer, doing something in org-mode, copying the org-mode content, and pasting it into my document. I used to create a new org-mode document every time I needed to do this. Now I have a file &lt;code&gt;~/.scratch.org&lt;/code&gt; where I keep my this work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to create an &lt;code&gt;*org-scratch*&lt;/code&gt; buffer that behaved analogously to the &lt;code&gt;*scratch*&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2019-02-07T20:59:27.770" Title="Is it possible to create an org-mode *scratch* buffer?" Tags="|org-mode|scratch-buffer|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16493" PostTypeId="2" ParentId="16492" CreationDate="2015-09-10T05:46:47.267" Score="16" Body="&lt;p&gt;The initial major-mode for the &lt;code&gt;*Scratch*&lt;/code&gt; buffer is controlled by the variable &lt;code&gt;initial-major-mode&lt;/code&gt; -- the value needs to be a symbol (which in layman's terms means put a single quote in front of the major-mode name):  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Auto-Major-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Auto-Major-Mode.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq initial-major-mode 'org-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  Based on a comment of the original poster, here is a sample function to create non-file-visiting buffers in sequential order with the major-mode of &lt;code&gt;org-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-scratch-buffer ()&#xA;&quot;Create a new scratch buffer -- \*hello-world\*&quot;&#xA;(interactive)&#xA;  (let ((n 0)&#xA;        bufname buffer)&#xA;    (catch 'done&#xA;      (while t&#xA;        (setq bufname (concat &quot;*hello-world&quot;&#xA;          (if (= n 0) &quot;&quot; (int-to-string n))&#xA;            &quot;*&quot;))&#xA;        (setq n (1+ n))&#xA;        (when (not (get-buffer bufname))&#xA;          (setq buffer (get-buffer-create bufname))&#xA;          (with-current-buffer buffer&#xA;            (org-mode))&#xA;          ;; When called non-interactively, the `t` targets the other window (if it exists).&#xA;          (throw 'done (display-buffer buffer t))) ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2019-02-07T20:59:27.770" LastActivityDate="2019-02-07T20:59:27.770" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="16494" PostTypeId="2" ParentId="16492" CreationDate="2015-09-10T06:27:47.480" Score="10" Body="&lt;p&gt;There's an extension called &lt;a href=&quot;https://github.com/ieure/scratch-el&quot;&gt;&lt;code&gt;scratch&lt;/code&gt;&lt;/a&gt;, which allows creating mode-specific scratch buffers. It is available from MELPA, so you should be able to install it easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this package installed, when you are in an &lt;code&gt;org-mode&lt;/code&gt; buffer, you can run &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;scratch&lt;/code&gt; to get a scratch buffer in &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you give a prefix argument, you get the opportunity to choose the mode (instead of selecting the currently active major mode).&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-10T06:27:47.480" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16495" PostTypeId="2" ParentId="16490" CreationDate="2015-09-10T06:49:13.413" Score="18" Body="&lt;p&gt;Couldn't you use &lt;code&gt;(cl-)letf&lt;/code&gt; while referencing the original function yourself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Original function&#xA;(defun my-fun (arg)&#xA;  (message &quot;my-fun (%s)&quot; arg))&#xA;&#xA;&#xA;;; Standard call&#xA;(my-fun &quot;arg&quot;) ;; =&amp;gt; my-fun (arg)&#xA;&#xA;&#xA;;; Temporary overriding (more or less like an around advice)&#xA;(let ((orig-fun (symbol-function 'my-fun)))&#xA;  (letf (((symbol-function 'my-fun)&#xA;          (lambda (arg)&#xA;            ;; filter arguments&#xA;            (funcall orig-fun (concat &quot;modified-&quot; arg)))))&#xA;    (my-fun &quot;arg&quot;)))&#xA;;; =&amp;gt; my-fun (modified-arg)&#xA;&#xA;&#xA;;; The overriding was only temporary&#xA;(my-fun &quot;arg&quot;) ;; =&amp;gt; my-fun (arg)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can also wrap this in a macro if you plan to reuse it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-advice (args &amp;amp;rest body)&#xA;  (declare (indent 1))&#xA;  (let ((fun-name (car args))&#xA;        (advice   (cadr args))&#xA;        (orig-sym (make-symbol &quot;orig&quot;)))&#xA;    `(cl-letf* ((,orig-sym  (symbol-function ',fun-name))&#xA;                ((symbol-function ',fun-name)&#xA;                 (lambda (&amp;amp;rest args)&#xA;                   (apply ,advice ,orig-sym args))))&#xA;       ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The example above can then be rewritten like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-fun (arg)&#xA;  (message &quot;my-fun (%s)&quot; arg))&#xA;&#xA;&#xA;(my-fun &quot;my-arg&quot;)&#xA;&#xA;(with-advice (my-fun&#xA;              (lambda (orig-fun arg)&#xA;                (funcall orig-fun (concat &quot;modified-&quot; arg))))&#xA;  (my-fun &quot;my-arg&quot;))&#xA;&#xA;(my-fun &quot;my-arg&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-09-10T19:00:46.143" LastActivityDate="2015-09-10T19:00:46.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16496" PostTypeId="1" CreationDate="2015-09-10T07:57:29.303" Score="0" ViewCount="88" Body="&lt;p&gt;When lots of application running, emacs doesn't start. Icon appears on dock but application doesn't show up. If I quit some apps and retry to start emacs, it works flawlessly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the any chance to avoid this problem except quitting other apps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use standard emacs 25.0.50.&lt;/p&gt;&#xA;" OwnerUserId="6730" LastActivityDate="2015-09-10T07:57:29.303" Title="Starting Emacs on OSX stuck" Tags="|osx|start-up|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16497" PostTypeId="1" AcceptedAnswerId="16499" CreationDate="2015-09-10T08:22:38.880" Score="58" ViewCount="33025" Body="&lt;p&gt;I am using the helm-projectile setup from prelude and it has been a huge improvement to my workflow. The only remaining issue are auto-generated files (e.g. generated by CMake) which show up during helm-grep and similar operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: is there a way to exclude files in the projects folder tree from Projectile?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="9481" LastEditDate="2015-09-10T14:10:21.857" LastActivityDate="2021-03-05T07:13:40.670" Title="How to exclude files from Projectile?" Tags="|projectile|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16498" PostTypeId="2" ParentId="16497" CreationDate="2015-09-10T08:58:10.587" Score="31" Body="&lt;p&gt;Yes, in your &lt;code&gt;.projectile&lt;/code&gt; file, on each line specify similar to:&#xA;each line looks like: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- /path/to/somefile&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each line contains one file path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://projectile.readthedocs.io/en/latest/projects/#ignoring-files&quot; rel=&quot;noreferrer&quot;&gt;official documentation on ignoring files&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8266" LastEditorUserId="15744" LastEditDate="2019-04-12T14:06:52.080" LastActivityDate="2019-04-12T14:06:52.080" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16499" PostTypeId="2" ParentId="16497" CreationDate="2015-09-10T09:11:50.107" Score="50" Body="&lt;p&gt;Looking at projectile it seems to offer four customizations for ignoring&#xA;files/directories globally. I am listing each of them below, with their&#xA;documentation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;projectile-globally-ignored-files&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A list of files globally ignored by projectile.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;projectile-globally-ignored-directories&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A list of directories globally ignored by projectile.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;projectile-globally-ignored-file-suffixes&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A list of file suffixes globally ignored by projectile.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;projectile-globally-ignored-modes&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A list of regular expressions for major modes ignored by projectile.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If a buffer is using a given major mode, projectile will ignore&#xA;  it for functions working with buffers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Please note that these are global options so for example a directory in&#xA;&lt;code&gt;projectile-globally-ignored-directories&lt;/code&gt; will be ignored irrespective of the&#xA;project you are working with. To ignore a file/directory for a particular&#xA;project you can add a &lt;code&gt;.projectile&lt;/code&gt; file to the project's root and add&#xA;the paths to ignore prefixed with &lt;code&gt;-&lt;/code&gt; to it like following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-/CMake&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the documentation of &lt;code&gt;projectile-parse-dirconfig-file&lt;/code&gt; (or &lt;a href=&quot;https://github.com/bbatsov/projectile/blob/master/doc/usage.md#ignoring-files&quot; rel=&quot;noreferrer&quot;&gt;projectile's docs&lt;/a&gt;) for more info&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Parse project ignore file and return directories to ignore and keep.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The return value will be a cons, the car being the list of&#xA;  directories to keep, and the cdr being the list of files or&#xA;  directories to ignore.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Strings &lt;strong&gt;starting with +&lt;/strong&gt; will be added to the list of &#xA;  &lt;strong&gt;directories&#xA;  to keep&lt;/strong&gt;, and strings &lt;strong&gt;starting with -&lt;/strong&gt; will be added to the list of&#xA;  &lt;strong&gt;directories to ignore&lt;/strong&gt;.  For backward compatibility, &lt;strong&gt;without a&lt;/strong&gt;&#xA;  &lt;strong&gt;prefix&lt;/strong&gt; the string will be &lt;strong&gt;assumed to be an ignore string&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="247" LastEditorUserId="15469" LastEditDate="2017-05-30T12:54:04.500" LastActivityDate="2017-05-30T12:54:04.500" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16500" PostTypeId="1" CreationDate="2015-09-10T09:34:07.930" Score="1" ViewCount="518" Body="&lt;p&gt;Since the build of org mode of the end of august (now I use elpa/org-20150907), the M-RET does not start a new entry, and gives the error &quot;Symbol's value as variable is void: org-planning-line-re&quot;. Strangely enough, M-SHIFT-RET still gives a new TODO entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently on aquamacs emacs on OSX El Capitan public beta, but I do not think it is a system issue. In fact, if I go back to the aquamacs-bundled version of org (8.2.10, I do not know of which date, but I presume late 2014) M-RET works again perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone else having the same issue?&lt;/p&gt;&#xA;" OwnerUserId="9477" LastActivityDate="2015-10-20T02:41:15.077" Title="Org mode M-RET not working with new builds" Tags="|org-mode|version-control|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16502" PostTypeId="1" CreationDate="2015-09-10T10:33:32.383" Score="1" ViewCount="92" Body="&lt;p&gt;If I run &lt;code&gt;C-c C-m href&lt;/code&gt; in auctex, it asks me which url to use. However if I want to link to a local file, it should let me choose the file but it doesn't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this? Would be ok to bind this for example to &lt;code&gt;C-u C-c C-m href&lt;/code&gt; or something like that.&lt;/p&gt;&#xA;" OwnerUserId="9480" LastActivityDate="2015-09-10T11:09:23.210" Title="Auctex: Make it open a file chooser when inserting a href command" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16503" PostTypeId="1" AcceptedAnswerId="16505" CreationDate="2015-09-10T10:36:01.997" Score="1" ViewCount="976" Body="&lt;p&gt;If i have a writable buffer, i can use this to insert hyperlink.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'button)&#xA;(insert-button &quot;foo&quot; 'action (lambda (x) (find-file &quot;~/test.py&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But i have to add &lt;code&gt;clickable text&lt;/code&gt; property to a piece of text in read only buffer. I am trying this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-text-properties&#xA; 1&#xA; 50&#xA; '(lambda (x) (find-file &quot;~/test.py&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it is throwing this error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Odd length text property list&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestion to solve this?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="253" LastEditDate="2015-09-10T13:21:46.960" LastActivityDate="2015-09-10T13:21:46.960" Title="Add clickable text in read only buffer?" Tags="|text-properties|hyperlinks|read-only-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16504" PostTypeId="2" ParentId="16502" CreationDate="2015-09-10T11:09:23.210" Score="2" Body="&lt;p&gt;In order to override current definition of &lt;code&gt;href&lt;/code&gt; completion, add the following code to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;hyperref&quot;&#xA;  '(TeX-add-symbols&#xA;    '(&quot;href&quot; [ (TeX-arg-key-val LaTeX-hyperref-href-options) ]&#xA;      (TeX-arg-file &quot;URL&quot;) &quot;Text&quot; ignore)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-09-10T11:09:23.210" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16505" PostTypeId="2" ParentId="16503" CreationDate="2015-09-10T11:29:25.147" Score="4" Body="&lt;p&gt;The reason for the error is that you did not use the correct format to add a text property.&lt;/p&gt;&#xA;&lt;p&gt;quote from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Function: add-text-properties start end props &amp;amp;optional object&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The argument props specifies which properties to add. It should have the form of a property list (see Property Lists): a list whose elements include the property names followed alternately by the corresponding values.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;However, for your specific problem, emacs has a different command:&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Making-Buttons.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs lisp manual excerpt&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The following functions add a button using an overlay (see Overlays) to hold the button properties:&#xA;&lt;strong&gt;Function: make-button beg end &amp;amp;rest properties&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;This makes a button from beg to end in the current buffer, and returns it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;If you insist on doing it via text properties, see above link for&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Function: make-text-button beg end &amp;amp;rest properties&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Example code for specific problem:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(make-button 1 50 'action (lambda(x) (find-file &amp;quot;~/test.py&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9481" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-09-10T12:27:57.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16506" PostTypeId="2" ParentId="16464" CreationDate="2015-09-10T15:45:03.297" Score="0" Body="&lt;p&gt;Another, possibly more hacky, solution:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/server-init (&amp;amp;rest args)&#xA;  (message &quot;Initializing the server!&quot;))&#xA;(advice-add 'server-execute :after #'my/server-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-09-10T15:45:03.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16507" PostTypeId="2" ParentId="16487" CreationDate="2015-09-10T16:04:19.097" Score="1" Body="&lt;p&gt;If I remember right, you sometimes use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, then anytime you are in the minibuffer, you can use &lt;strong&gt;&lt;code&gt;M-.&lt;/code&gt;&lt;/strong&gt; to insert text from the buffer, at point, or in fact text derived from that text. Page &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Inserting_Text_from_Cursor&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Inserting Text from Cursor&lt;/strong&gt;&lt;/a&gt; of the &lt;strong&gt;Icicles&lt;/strong&gt; doc describes this feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behavior of &lt;code&gt;M-.&lt;/code&gt; is governed by user options &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-thing-at-point-functions&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-thing-at-point-functions&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;icicle-default-thing-insertion&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, if library &lt;code&gt;ffap.el&lt;/code&gt; is loaded then option &lt;code&gt;icicle-thing-at-point-functions&lt;/code&gt; includes &lt;strong&gt;&lt;code&gt;ffap-guesser&lt;/code&gt;&lt;/strong&gt; as one of its text-grabbing functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that you can use &lt;code&gt;M-.&lt;/code&gt; to grab &lt;code&gt;/home/pythonnut/.emacs.d/modules/config-company.el&lt;/code&gt; into the minibuffer when the cursor is on the library name &lt;code&gt;config-company&lt;/code&gt; in the buffer text &lt;code&gt;(require 'config-company)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize &lt;code&gt;icicle-thing-at-point-functions&lt;/code&gt; to move the position of &lt;code&gt;ffap-guesser&lt;/code&gt; sooner or later in the list of text-grabbing functions that are used when you use &lt;code&gt;M-.&lt;/code&gt; repeatedly.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated after your comment -&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So are you asking for a command that copies to the  &lt;code&gt;kill-ring&lt;/code&gt; what &lt;code&gt;ffap-guesser&lt;/code&gt; returns at point?  If so, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ffap-guesser-copy (&amp;amp;optional msgp)&#xA;  &quot;...&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((text  (kill-new (ffap-guesser))))&#xA;    (when msgp (message &quot;Copied `%s to kill ring&quot; text))))&#xA;&#xA;(global-set-key &quot;\C-o&quot; 'ffap-guesser-copy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-10T16:22:34.070" LastActivityDate="2015-09-10T16:22:34.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16508" PostTypeId="2" ParentId="16484" CreationDate="2015-09-10T16:14:54.220" Score="1" Body="&lt;p&gt;If you are not limited to Helm for this, and you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;, then &lt;em&gt;every&lt;/em&gt; command, not just &lt;code&gt;describe-function&lt;/code&gt; and &lt;code&gt;describe-variable&lt;/code&gt;, can use fuzzy matching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To toggle fuzzy matching on, just use &lt;code&gt;C-(&lt;/code&gt; or &lt;code&gt;M-(&lt;/code&gt; from the minibuffer, depending on which type of fuzzy matching you want.  Icicles has many types of fuzzy matching, and these keys cycle among matching/completion methods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Completion_Methods_and_Styles&quot; rel=&quot;nofollow&quot;&gt;Icicles -Completion Methods and Styles&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-10T16:14:54.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16509" PostTypeId="1" CreationDate="2015-09-10T16:15:00.340" Score="2" ViewCount="211" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; What is the simplest way to insert text &lt;em&gt;without moving the cursor&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a command, say &lt;code&gt;insert-right-of-point&lt;/code&gt;, that does just that already? I did not find one and gave up after several &lt;code&gt;C-h a&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My best solution at the moment is to define the command with some &lt;code&gt;(save-excursion (apply 'insert args))&lt;/code&gt; but there are probably better ways (better = faster, or more robust, or more elegant, or ... Have your pick).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS.&lt;/strong&gt; For people who ask &lt;em&gt;&quot;what do you need that for?!&quot;&lt;/em&gt;: I have a program that insert things in a buffer but the natural way of computing what to insert produces several bits of text in succession, and it produces the last bits first.&lt;/p&gt;&#xA;" OwnerUserId="1992" LastEditorUserId="1992" LastEditDate="2015-09-10T16:38:35.983" LastActivityDate="2015-09-10T16:38:35.983" Title="Insert to the right of cursor" Tags="|cursor|insert|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16511" PostTypeId="1" AcceptedAnswerId="16512" CreationDate="2015-09-10T20:02:25.747" Score="11" ViewCount="4510" Body="&lt;p&gt;My drawers don't seem to collapse with TAB. I've even tried the &lt;a href=&quot;http://orgmode.org/manual/Drawers.html#Drawers&quot; rel=&quot;noreferrer&quot;&gt;canonical example&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* This is a headline&#xA;  Still outside the drawer&#xA;  :DRAWERNAME:&#xA;  This is inside the drawer.&#xA;  :END:&#xA;  After the drawer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I place the cursor on the line &lt;code&gt;:DRAWERNAME:&lt;/code&gt; and hit &lt;code&gt;TAB&lt;/code&gt; nothing happens:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bzxbt.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bzxbt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when I place the cursor on the headline and press &lt;code&gt;TAB&lt;/code&gt; repeatedly, I cycle through the following two states:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DDJCQ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DDJCQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... and:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wbikP.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wbikP.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words the entire headline appears collapsed but the drawer itself is never collapsed.&lt;/p&gt;&#xA;" OwnerUserId="4003" LastEditorUserId="253" LastEditDate="2015-09-10T20:13:44.927" LastActivityDate="2015-09-11T14:46:58.240" Title="How can I get a custom org drawer to open/close?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16512" PostTypeId="2" ParentId="16511" CreationDate="2015-09-10T20:10:35.140" Score="8" Body="&lt;p&gt;You need to tell &lt;code&gt;org&lt;/code&gt; about any custom drawer names you want to use by customizing &lt;code&gt;org-drawers&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;org-drawers&lt;/code&gt; is a variable defined in &lt;code&gt;org.el&lt;/code&gt;.&#xA;  Its value is (&quot;PROPERTIES&quot; &quot;CLOCK&quot; &quot;LOGBOOK&quot; &quot;RESULTS&quot;)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Names of drawers.  Drawers are not opened by cycling on the headline above.&#xA;  Drawers only open with a TAB on the drawer line itself.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(blah blah blah)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The drawer &quot;PROPERTIES&quot; is special for capturing properties through&#xA;  the property API.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;With the default, the &lt;code&gt;:PROPERTIES:&lt;/code&gt; drawer will toggle, but the drawer &lt;code&gt;:DRAWERNAME:&lt;/code&gt; will not.  However, you can &lt;code&gt;(add-to-list 'org-drawers &quot;DRAWERNAME&quot;)&lt;/code&gt;, restart &lt;code&gt;org-mode&lt;/code&gt; (&lt;code&gt;M-x org-mode&lt;/code&gt;), and it will recognize the latter as well.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-09-10T20:10:35.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16513" PostTypeId="2" ParentId="13920" CreationDate="2015-09-10T22:48:22.947" Score="1" Body="&lt;p&gt;I'm not sure I understand exactly what you mean by &quot;bounce-indent within a few levels&quot;. Would something like the following suit you?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works more or less like in python: the first time you indent, you go 4 columns further than the previous line. If you keep pressing &lt;kbd&gt;TAB&lt;/kbd&gt;, you decrease the indentation level until you hit the first column (at which point you cycle back to the most indented level)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-indent ()&#xA;  (let ((last-indent (if (&amp;gt; (line-number-at-pos) 1)&#xA;                         (save-excursion&#xA;                           (previous-line)&#xA;                           (back-to-indentation)&#xA;                           (current-column))&#xA;                       0)))&#xA;    (save-excursion&#xA;      (back-to-indentation)&#xA;      (if (and (eq last-command this-command)&#xA;               (&amp;gt; (point) (line-beginning-position)))&#xA;          (delete-region (max (line-beginning-position) (- (point) 4)) (point))&#xA;        (while (&amp;lt; (current-column) (+ 4 last-indent))&#xA;          (insert &quot; &quot;))))&#xA;    (if (&amp;lt; (point) (save-excursion (back-to-indentation) (point)))&#xA;        (back-to-indentation))))&#xA;&#xA;&#xA;(defun my-sql-mode-hook ()&#xA;  (setq indent-line-function 'my-indent))&#xA;&#xA;(add-hook 'sql-mode-hook 'my-sql-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-10T22:48:22.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16514" PostTypeId="2" ParentId="16374" CreationDate="2015-09-11T01:25:44.223" Score="0" Body="&lt;p&gt;Since you didn't mention the OS of the server, look into launchd-type facility that keeps a process running between resets and crashes.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-11T01:25:44.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16515" PostTypeId="2" ParentId="12246" CreationDate="2015-09-11T01:40:48.117" Score="-3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I was rather looking for an option inside Emacs itself, so that I can keep the key bindings that I have gotten used to when using other apps. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In Emacs, when invoking the key chord, try switching the order of the two keys &lt;code&gt;M-&amp;lt;SPC&amp;gt;&lt;/code&gt; that make up the chord. In this case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M&lt;/kbd&gt; followed by &lt;kbd&gt;SPC&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;SPC&lt;/kbd&gt; followed by &lt;kbd&gt;M&lt;/kbd&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One will bypass the local search, spotlight, or other keyboard triggers and emacs can then pick it up.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-11T01:40:48.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16516" PostTypeId="1" AcceptedAnswerId="16518" CreationDate="2015-09-11T02:32:51.957" Score="4" ViewCount="247" Body="&lt;p&gt;I would like to create my own &lt;code&gt;startup.el&lt;/code&gt;, and it seems that &lt;code&gt;loadup.el&lt;/code&gt; is what causes &lt;code&gt;startup&lt;/code&gt; to do its thing -- i.e., &lt;code&gt;(load &quot;startup&quot;)&lt;/code&gt;.  I see that an option for starting Emacs is &lt;code&gt;-nl&lt;/code&gt; or &lt;code&gt;--no-loadup&lt;/code&gt;; however, neither of those have any affect on OSX.  Is &lt;code&gt;loadup.el&lt;/code&gt; perhaps hard-coded into the executable such that a startup option to the contrary has no effect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/absolute/path/to/Emacs -nl&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/absolute/path/to/Emacs --no-loadup&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using OSX, and have a very recent version of Emacs Trunk built from the master branch.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-11-16T04:37:33.690" Title="Is `loadup.el` hard-coded, such that `-nl` (aka --no-loadup) is futile?" Tags="|start-up|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16517" PostTypeId="1" AcceptedAnswerId="16520" CreationDate="2015-09-11T02:47:44.487" Score="3" ViewCount="1597" Body="&lt;p&gt;I'm trying to export subtrees using &lt;code&gt;#+PROPERTY: EXPORT_FILE_NAME filename&lt;/code&gt; as described in the Org manual at bottom &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot; rel=&quot;nofollow&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a test file called &lt;code&gt;test.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* This Is A Test&#xA;  #+PROPERTY: EXPORT_FILE_NAME export-test&#xA;  here is some content&#xA;* This Is Another Test&#xA;  #+PROPERTY: EXPORT_FILE_NAME another-export-test&#xA;  here is some more content.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I put point on either &lt;code&gt;* heading&lt;/code&gt; and export with &lt;code&gt;C-c C-e C-s l o&lt;/code&gt; the resulting PDF file has the correct content, but is not called &quot;export-test&quot; or &quot;another-export-test&quot; but instead &quot;test.pdf&quot;. I'm a beginner at this, and can't fathom what I'm doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org 8.3.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.5.1&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-09-12T01:49:01.137" LastActivityDate="2018-06-06T21:55:44.517" Title="org-export subtree to filename.pdf with EXPORT_FILE_NAME fails" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16518" PostTypeId="2" ParentId="16516" CreationDate="2015-09-11T03:07:25.667" Score="5" Body="&lt;p&gt;Correct; this option is not relevant to the fully-built &lt;code&gt;emacs&lt;/code&gt; executable, because that library (and the many others it pulls in with it) are pre-loaded in that executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can, if you so wish, create your own custom executable by modifying the sources before the dumping process occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to:&lt;br&gt;&#xA;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Building Emacs&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-11T03:12:30.650" LastActivityDate="2015-09-11T03:12:30.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16519" PostTypeId="1" AcceptedAnswerId="16522" CreationDate="2015-09-11T03:17:58.440" Score="1" ViewCount="76" Body="&lt;p&gt;I'm trying to define a new sort function in &lt;code&gt;icicles&lt;/code&gt; that sorts by &lt;code&gt;flx&lt;/code&gt; score.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun icicle-flx-score-greater-p (s1 s2)&#xA;  (message &quot;Testing testing!&quot;)&#xA;  (&amp;gt;&#xA;   (car (flx-score s1 icicle-current-input))&#xA;   (car (flx-score s2 icicle-current-input))))&#xA;&#xA;(icicle-define-sort-command &quot;by flx score&quot;&#xA;                            ;; icicle-dirs-last-p&#xA;                            icicle-flx-score-greater-p&#xA;                            &quot;Sort completions by flx score.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, trying to use this sort function results in:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Inappropriate sort order - reverting to UNSORTED&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The funny thing, though, is that &lt;code&gt;Testing testing!&lt;/code&gt; is never printed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong here?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-09-11T03:59:12.813" LastActivityDate="2015-09-20T18:49:21.027" Title="Icicles custom sort function is inappropriate?" Tags="|icicles|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16520" PostTypeId="2" ParentId="16517" CreationDate="2015-09-11T04:38:26.180" Score="9" Body="&lt;p&gt;Please try it with property drawers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* This Is A Test &#xA;:PROPERTIES:&#xA;:EXPORT_FILE_NAME: export-test&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then put the cursor on this headline and export explicitly only above tree with &lt;code&gt;C-c C-e C-s l o&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2018-06-06T21:55:44.517" LastActivityDate="2018-06-06T21:55:44.517" CommentCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="16521" PostTypeId="2" ParentId="15247" CreationDate="2015-09-11T05:02:33.460" Score="10" Body="&lt;p&gt;In addition to the other answers (which explain how the majority of libraries are actually only loaded on demand), there is also the matter of the &lt;em&gt;pre-loading&lt;/em&gt; of many core elisp libraries within the &lt;code&gt;emacs&lt;/code&gt; executable itself, which provides an illusion of it loading a lot of things incredibly quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is achieved by running a so-called &quot;bare&quot; version of Emacs (which is what was actually compiled, and which &lt;em&gt;is&lt;/em&gt; fully-functional, but contains only the elisp interpreter and other core functionality written in C), and telling that to load all the elisp libraries which ought to be pre-loaded, before finally &quot;dumping&quot; out the actual &lt;code&gt;emacs&lt;/code&gt; binary with those libraries built in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mechanism is detailed in the elisp manual:&lt;br&gt;&#xA;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Building Emacs&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have compiled Emacs yourself then you can experiment with this process, and can even dump alternative versions of the final executable if you wish (not generally recommended, but the facility is there).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The compiled &lt;code&gt;temacs&lt;/code&gt; binary can be found in the &lt;code&gt;src&lt;/code&gt; directory, and you can compare the difference in start times by running each version like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ time ./temacs -l loadup --batch&#xA;$ time ./emacs --batch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On my system the former takes ~4 seconds (during which 111 elisp libraries are loaded), while the latter takes ~0.02 seconds.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-11T05:31:42.213" LastActivityDate="2015-09-11T05:31:42.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16522" PostTypeId="2" ParentId="16519" CreationDate="2015-09-11T05:27:55.097" Score="3" Body="&lt;p&gt;Here is a corrected version of your predicate definition:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun icicle-flx-score-greater-p (s1 s2)&#xA;  &quot;Return non-nil if S1 scores higher than S2 using `flx-score`.&quot;&#xA;  ;; (message &quot;Testing testing!&quot;)&#xA;  (let* ((input   (if (icicle-file-name-input-p)&#xA;                      (file-name-nondirectory icicle-current-input)&#xA;                    icicle-current-input))&#xA;         (score1  (flx-score s1 input))&#xA;         (score2  (flx-score s2 input)))&#xA;    (and score1  score2  (&amp;gt; (car score1) (car score2)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem you had was that &lt;code&gt;flx-score&lt;/code&gt; can return &lt;code&gt;nil&lt;/code&gt; instead of a cons, in which case an error is raised by predicate &lt;code&gt;&amp;gt;&lt;/code&gt;.  Icicles handles the error by turning off sorting.  And because the error is handled, you do not see the output from the call to &lt;code&gt;message&lt;/code&gt; (it appears, but you don't see it -- you can see this by using the debugger).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other thing you need here (no error, but otherwise you won't get the comparison behavior you expect) is that for file-name completion you want to compare not the full input string, which typically is an absolute file name (it includes the directory), but just the nondirectory part of the input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've left my original answer, below, for more information.  To find the problem (above) I downloaded &lt;a href=&quot;https://github.com/lewang/flx/raw/master/flx.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;flx.el&lt;/code&gt;&lt;/a&gt; and used the debugger.  (It would probably have been enough to look at the code defining &lt;code&gt;flx-score&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Next time, you might want to provide a link to the code that defines the function you use -- in this case, &lt;code&gt;flx-score&lt;/code&gt; in &lt;a href=&quot;https://github.com/lewang/flx/raw/master/flx.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;flx.el&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI -- I've now added a similar sort order to Icicles.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;That error message means that the current sort order you've chosen is inappropriate for the kind of completion being performed by the current command.  A few commands inhibit sorting altogether, but typically the error means that the sort function is inappropriate for the type of candidates being compared.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The problem could also be as simple as having too many completion candidates to sort. Option &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-sorting-max-candidates&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-sorting-max-candidates&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; controls this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To simplify things, at least for testing, turn off &lt;code&gt;icomplete-mode&lt;/code&gt; if you have it turned on.  (You can use &lt;code&gt;C-M-#&lt;/code&gt; during completion to toggle it.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If at any point the value of &lt;code&gt;icicle-sort-comparer&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, that's your problem -- that tells Icicles not to sort candidates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You need to load &lt;code&gt;icicles-mac.el&lt;/code&gt;, to have macro &lt;code&gt;icicle-define-sort-command&lt;/code&gt; available.  But I assume you did that, or you would have mentioned a problem in that regard.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As the doc string of that macro says, its argument &lt;code&gt;COMPARISON-FUNCTION&lt;/code&gt; must compare two &lt;strong&gt;strings&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;COMPARISON-FN is a function that compares two strings, returning&#xA;  non-nil if and only if the first string sorts before the second.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Perhaps that is the problem here.  Is the predicate you pass as &lt;code&gt;COMPARISON-FUNCTION&lt;/code&gt; expecting string arguments?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are sorted are completion candidates, which are strings.  See the &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; doc, page &lt;em&gt;Sorting Candidates and Removing Duplicates&lt;/em&gt;, section &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Sorting_Candidates#DefiningNewSortOrders&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Defining New Sort Orders&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That says this about &lt;code&gt;COMPARISON-FUNCTION&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The second argument is the actual function used for sorting. It can be any function, including a lambda expression. The function takes &lt;em&gt;two string arguments&lt;/em&gt; and returns non-&lt;code&gt;nil&lt;/code&gt; if and only if the first string sorts before (is “less than”) the second.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For examples of using macro &lt;code&gt;icicle-define-sort-command&lt;/code&gt;, see file &lt;strong&gt;&lt;code&gt;icicles-mcmd.el&lt;/code&gt;&lt;/strong&gt;.  For examples of &lt;code&gt;COMPARISON-FUNCTION&lt;/code&gt;, see file &lt;strong&gt;&lt;code&gt;icicles-fn.el&lt;/code&gt;&lt;/strong&gt; (look for section &lt;code&gt;Icicles Functions - Sort Functions&lt;/code&gt; in that file). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, in case it is appropriate for your context (dunno), &lt;code&gt;icicles-fn.el&lt;/code&gt; contains examples of comparison functions, such as &lt;code&gt;icicle-2nd-part-string-less-p&lt;/code&gt;, that compare two &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi-Completions&quot; rel=&quot;nofollow&quot;&gt;multi-completion&lt;/a&gt; candidates, that is, multi-part completion candidates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the problem is not so simple as the data that &lt;code&gt;flx-score&lt;/code&gt; is returning, then you will need to look closer at what your sort predicate does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code that raises the error you see is in function &lt;code&gt;icicle-reversible-sort&lt;/code&gt;.  It essentially invokes the function that is the current value of variable &lt;code&gt;icicle-sort-comparer&lt;/code&gt; (or if that value is a cons then it uses function &lt;code&gt;icicle-multi-sort&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try &lt;code&gt;M-x debug-on-entry icicle-reversible-sort&lt;/code&gt;, but that will plunge you in the debugger a lot -- be prepared to evaluate &lt;code&gt;(cancel-debug-on-entry)&lt;/code&gt; easily, to cancel this.  You can also try debugging your sort predicate, &lt;code&gt;icicle-flx-score-greater-p&lt;/code&gt;. Probably the problem will be apparent from the first look you have of what it is doing with two completion-candidate string args. Again, you can try &lt;code&gt;debug-on-entry&lt;/code&gt; to see what it is doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's possible that the origin of the problem is the set of completion candidates, i.e., upstream of sorting.  You can also start there, by using &lt;code&gt;M-x debug-on-entry icicle-display-Completions&lt;/code&gt;.  (Before using the debugger, be sure to load the source files (&lt;strong&gt;&lt;code&gt;*.el&lt;/code&gt;&lt;/strong&gt;, not &lt;code&gt;*.elc&lt;/code&gt;).)  If the candidates look OK to you, then move a bit downstream, to &lt;code&gt;icicle-maybe-sort-maybe-truncate&lt;/code&gt;, which is the function that invokes &lt;code&gt;icicle-reversible-sort&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-20T18:49:21.027" LastActivityDate="2015-09-20T18:49:21.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16524" PostTypeId="2" ParentId="16488" CreationDate="2015-09-11T07:38:37.043" Score="3" Body="&lt;p&gt;After some investigation it appears that the culprit was lilypond appending version text to the end of the EPS document it generated, which was afterwards embedded in the PDF.  The solution was to add a line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\header{ tagline=&quot;&quot; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to lilypond source blocks.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-09-11T07:38:37.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16525" PostTypeId="1" AcceptedAnswerId="16533" CreationDate="2015-09-11T07:45:43.823" Score="2" ViewCount="124" Body="&lt;p&gt;I have a buffer &lt;code&gt;foo.el&lt;/code&gt; with some invalid code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If i run &lt;code&gt;M-x eval-buffer&lt;/code&gt;, with debug on, it show this in backtrace buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function bar)&#xA;  (bar)&#xA;  eval-buffer()  ; Reading at buffer position 49&#xA;  call-interactively(eval-buffer nil nil)&#xA;  command-execute(eval-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am trying to hyperlink&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to origial location which is &lt;code&gt;foo.el&lt;/code&gt; at some position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what i have done so far.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hyperlink-error-location ()&#xA;  &quot;Hyperlink errors in backtrace.&quot;&#xA;  (interactive)&#xA;  (when (search-forward-regexp &quot;Reading at buffer position &quot; nil 'noerror)&#xA;    (goto-char (match-end 0))&#xA;    (let ((num (symbol-at-point)))&#xA;      (forward-line -1)&#xA;      (make-button (line-beginning-position) (line-end-position)&#xA;                   'action (lambda (x) &#xA;                             (find-file &quot;/path/to/file&quot;)&#xA;                             (goto-char num))))))&#xA;&#xA;(add-hook 'debugger-mode-hook 'hyperlink-error-location)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However i need original buffer name &lt;code&gt;foo.el&lt;/code&gt; in backtrace buffer. How can  i get it?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-11T12:08:16.960" Title="Get actual buffer name from backtrace buffer?" Tags="|debugging|edebug|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16527" PostTypeId="2" ParentId="16525" CreationDate="2015-09-11T09:07:34.520" Score="0" Body="&lt;p&gt;Thanks to @Iqbal Ansari comment, i have added 1 second delay to hyperlinking and its working fine.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hyperlink-error-location ()&#xA;  &quot;Hyperlink errors in backtrace.&quot;&#xA;  (interactive)&#xA;  (when (search-forward-regexp &quot;Reading at buffer position &quot; nil 'noerror)&#xA;    (goto-char (match-end 0))&#xA;    (let ((num (symbol-at-point)))&#xA;      (forward-line -1)&#xA;      (make-button (line-beginning-position) (line-end-position)&#xA;                   'action (lambda (x)&#xA;                             (find-file (buffer-file-name debugger-old-buffer))&#xA;                             (goto-char num))))))&#xA;&#xA;(defun debugger-timer ()&#xA;  &quot;Timer to activate hyperlink-error-location&quot;&#xA;  (setq debugger-timer&#xA;        (run-at-time&#xA;         (time-add (current-time) (seconds-to-time 1))&#xA;         nil 'hyperlink-error-location)))&#xA;&#xA;(add-hook 'debugger-mode-hook 'debugger-timer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-11T09:07:34.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16528" PostTypeId="1" AcceptedAnswerId="16529" CreationDate="2015-09-11T09:29:07.490" Score="1" ViewCount="138" Body="&lt;p&gt;Does it work for a job title or is it used for academic titles?&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-09-11T14:04:16.267" LastActivityDate="2015-09-11T14:04:16.267" Title="What is the bbdb3 field &quot;affix&quot; used for?" Tags="|bbdb|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16529" PostTypeId="2" ParentId="16528" CreationDate="2015-09-11T09:51:53.013" Score="2" Body="&lt;p&gt;Apparently it does not have a well defined meaning, from the &lt;a href=&quot;http://sourceforge.net/p/bbdb/mailman/message/31729494/&quot; rel=&quot;nofollow&quot;&gt;bbdb mailing list&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So far, the affix field in BBDB 3 &lt;strong&gt;does not have a detailed meaning&lt;/strong&gt;.&#xA;  Its value is a list of strings.  So I guess it can stand for all kinds&#xA;  of prefixes, suffixes, academic titles, and what else.  But depending&#xA;  on a user's cultural background, the details may vary quite a bit what&#xA;  he or she wants to store in this field and I don't know whether it&#xA;  would make much sense if BBDB tried to establish some universal rules&#xA;  here.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-11T09:51:53.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16530" PostTypeId="1" CreationDate="2015-09-11T10:19:34.077" Score="1" ViewCount="283" Body="&lt;p&gt;I am using latest Helm from MELPA on Emacs &lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-11&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I issue &lt;code&gt;sql-connect&lt;/code&gt; I see this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://cloud.githubusercontent.com/assets/8199224/9812239/339f2a24-587c-11e5-961b-b7463b6667f8.png&quot; alt=&quot;2015-09-11-115647_672x177_scrot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only connection I have saved (in custom.el) is the second one, &lt;code&gt;boccaperta&lt;/code&gt;. First time I select &lt;code&gt;boccaperta&lt;/code&gt; from that list this is the error I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (setting-constant nil)&#xA;  (let ((nil (quote nil))) (sql-product-interactive (quote postgres) (quote nil)))&#xA;  eval((let ((nil (quote nil))) (sql-product-interactive (quote postgres) (quote nil))))&#xA;  sql-connect(&quot;boccaperta&quot; nil)&#xA;  funcall-interactively(sql-connect &quot;boccaperta&quot; nil)&#xA;  call-interactively(sql-connect nil nil)&#xA;  command-execute(sql-connect)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It only happens the first time I select &lt;code&gt;boccaperta&lt;/code&gt;. If I try again, I can connect to my DB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also happens with Helm disabled, by the way. And it happens with &lt;code&gt;emacs -Q&lt;/code&gt; as well.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2015-09-11T10:19:34.077" Title="sql-connect: (setting-constant nil)" Tags="|sql-interactive-mode|sql|sql-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16531" PostTypeId="1" CreationDate="2015-09-11T11:38:11.043" Score="2" ViewCount="346" Body="&lt;p&gt;I'd like to use &lt;code&gt;[[:symbol:]]+&lt;/code&gt; in a regular expression but this does not exist in Emacs, see ad-hoc section in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Char-Classes.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;the manual&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q1:&lt;/strong&gt; what is the rationale behind this? I'm always happy to understand the design decisions that gave us the beautiful beast that is emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q2:&lt;/strong&gt; is there something that works like &lt;code&gt;[:symbol:]&lt;/code&gt; would? At the moment I use ugly handmade regexes like &lt;code&gt;[[:word:]_+=]&lt;/code&gt;, listing just a few specific symbols that I know will occur in my application.&lt;/p&gt;&#xA;" OwnerUserId="1992" LastActivityDate="2015-09-11T13:05:56.907" Title="Why do we have [:word:] but not [:symbol:]?" Tags="|regular-expressions|syntax-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16532" PostTypeId="2" ParentId="16531" CreationDate="2015-09-11T12:00:41.813" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Q2:&lt;/strong&gt; is there something that works like &lt;code&gt;[:symbol:]&lt;/code&gt; would? At the moment I use ugly handmade regexes like &lt;code&gt;[[:word:]_+=]&lt;/code&gt;, listing just a few specific symbols that I know will occur in my application.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could use the special &lt;code&gt;\s&lt;/code&gt; syntax which references characters with a specific &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table&quot; rel=&quot;nofollow&quot;&gt;syntax class&lt;/a&gt; in a regular expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, &lt;code&gt;w&lt;/code&gt; is the syntax class of word constituents, and &lt;code&gt;_&lt;/code&gt; is the syntax class of additional symbol constituents. Which means that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\\(\\sw\\|\\s_\\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;matches any symbol constituent.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-11T12:00:41.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16533" PostTypeId="2" ParentId="16525" CreationDate="2015-09-11T12:08:16.960" Score="2" Body="&lt;p&gt;You can use the variable &lt;code&gt;debugger-old-buffer&lt;/code&gt; to get the buffer where the debugger was entered.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-11T12:08:16.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16534" PostTypeId="2" ParentId="16528" CreationDate="2015-09-11T12:31:06.787" Score="2" Body="&lt;p&gt;&lt;strong&gt;Application&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The affix field looks like the following: The affix entry &lt;code&gt;Dr.&lt;/code&gt;is put behind the name (separated by a comma) and before the slash &lt;code&gt;-&lt;/code&gt; before the organisation entry.  I guess the reason it was called &quot;affix&quot; is that depending on the culture, entries - for example for academic titles - can be written as prefixes or suffixes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pV5Wu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pV5Wu.png&quot; alt=&quot;bbdb3 affix example&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-09-11T12:39:20.073" LastActivityDate="2015-09-11T12:39:20.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16535" PostTypeId="1" CreationDate="2015-09-11T12:54:43.890" Score="1" ViewCount="162" Body="&lt;p&gt;I'm using &lt;a href=&quot;http://wikemacs.org/wiki/Edit_with_Emacs&quot; rel=&quot;nofollow&quot;&gt;Edit with Emacs&lt;/a&gt; to edit Stack Overflow and Stack Exchange sites.&lt;br&gt;&#xA;Currently I'm doing it with this message ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I click on the button under the text area of Chrome browser, I get a new file opened on Emacs.&#xA;Current file is named &lt;code&gt;emacs.stackexchange.com/questions/ask&lt;/code&gt;.&#xA;When I press save the file: &lt;code&gt;C-x C-s&lt;/code&gt;, the text gets updated in the browser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the file saved somewhere in the filesystem, so I can recover it locally, just in case I kill the current buffer?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2015-09-11T14:28:31.447" Title="Does &quot;Edit with Emacs&quot; saves a local file of current edit buffer?" Tags="|editing|web-browser|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16536" PostTypeId="2" ParentId="16531" CreationDate="2015-09-11T13:05:56.907" Score="2" Body="&lt;p&gt;I can't enlighten you on Q1 either. You could always propose it as an addition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach to Q2 is to match the &lt;em&gt;entire&lt;/em&gt; symbol by obtaining the text between a pair of symbol-beginning and symbol-end assertions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\_&amp;lt;\\(.+?\\)\\_&amp;gt;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-09-11T13:05:56.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16537" PostTypeId="1" AcceptedAnswerId="16538" CreationDate="2015-09-11T13:06:18.340" Score="3" ViewCount="224" Body="&lt;p&gt;I'm using &lt;a href=&quot;http://wikemacs.org/wiki/Edit_with_Emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Edit with Emacs&lt;/a&gt; to edit Stack Overflow and Stack Exchange sites.&lt;br&gt;&#xA;Currently I'm doing it with this message ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I click on the button under the text area of Chrome browser, I get a new file opened on Emacs.&#xA;Current file is named &lt;code&gt;emacs.stackexchange.com/questions/ask&lt;/code&gt;, which is opened in &lt;em&gt;Text mode&lt;/em&gt;.&#xA;I change it to &lt;em&gt;Markdown mode&lt;/em&gt;, that makes it more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I press save the file: &lt;code&gt;C-x C-s&lt;/code&gt;, the text gets updated in the browser.&lt;br&gt;&#xA;Check &lt;a href=&quot;https://emacs.stackexchange.com/questions/16535/does-edit-with-emacs-saves-a-local-file-of-current-edit-buffer&quot;&gt;this question&lt;/a&gt; regarding if file is saved locally or not.&lt;br&gt;&#xA;But the mode is changed back to &lt;em&gt;Text mode&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to open the buffer in &lt;em&gt;Markdown mode&lt;/em&gt;?&#xA;Is it possible to avoid the change in the mode, when saving the buffer?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-11T13:17:31.127" Title="Set &quot;Edit with Emacs&quot; major mode to markdown-mode" Tags="|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16538" PostTypeId="2" ParentId="16537" CreationDate="2015-09-11T13:14:27.310" Score="5" Body="&lt;p&gt;Browsing through the &lt;a href=&quot;https://github.com/stsquad/emacs_chrome/blob/master/servers/edit-server.el#L52&quot; rel=&quot;noreferrer&quot;&gt;source code of &lt;code&gt;edit-server&lt;/code&gt;&lt;/a&gt; reveals that you can either customize &lt;code&gt;edit-server-url-major-mode-alist&lt;/code&gt; or set the mode in &lt;code&gt;edit-server-start-hook&lt;/code&gt;.  Here's the example from the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Buffers are edited in `text-mode' by default; to use a different&#xA;;; major mode, change `edit-server-default-major-mode' or customize&#xA;;; `edit-server-url-major-mode-alist' to specify major modes based&#xA;;; on the remote URL:&#xA;;;&#xA;;; (setq edit-server-url-major-mode-alist&#xA;;;       '((&quot;github\\.com&quot; . markdown-mode)))&#xA;;;&#xA;;; Alternatively, set the mode in `edit-server-start-hook'. For&#xA;;; example:&#xA;;;&#xA;;; (add-hook 'edit-server-start-hook&#xA;;;           (lambda ()&#xA;;;             (when (string-match &quot;github.com&quot; (buffer-name))&#xA;;;               (markdown-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-09-11T13:14:27.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16539" PostTypeId="2" ParentId="16535" CreationDate="2015-09-11T13:17:58.917" Score="4" Body="&lt;p&gt;Looking at the code it does not seem  that edit server save the contents to a file. However it does provide a hook &lt;code&gt;edit-server-done-hook&lt;/code&gt; which running every time you do &lt;code&gt;edit-server-save&lt;/code&gt; (&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt;) or &lt;code&gt;edit-server-done&lt;/code&gt; (&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;) you might add a function to the hook to save the current contents to a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A not-so-well-tested example is given below&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-edit-with-emacs-backups-dir (locate-user-emacs-file &quot;edit-with-emacs-saves&quot;))&#xA;&#xA;(unless (file-exists-p my-edit-with-emacs-backups-dir)&#xA;  (make-directory my-edit-with-emacs-backups-dir))&#xA;&#xA;(defun my-backup-edit-with-emacs-contents ()&#xA;  (let ((backup-directory-alist (list (cons &quot;.&quot; my-edit-with-emacs-backups-dir))))&#xA;    (save-excursion&#xA;      (write-region nil nil (car (find-backup-file-name (buffer-name))) nil 0))))&#xA;&#xA;(add-hook 'edit-server-done-hook #'my-backup-edit-with-emacs-contents)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the above the you &lt;code&gt;edit-with-buffer&lt;/code&gt; contents will be backed up in &lt;code&gt;~/.emacs.d/edit-with-emacs-saves&lt;/code&gt; directory whenever you do &lt;code&gt;edit-server-save&lt;/code&gt; (&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt;) or &lt;code&gt;edit-server-done&lt;/code&gt; (&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;)&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-11T14:28:31.447" LastActivityDate="2015-09-11T14:28:31.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16540" PostTypeId="2" ParentId="16511" CreationDate="2015-09-11T14:46:58.240" Score="14" Body="&lt;p&gt;As of org-mode version &lt;a href=&quot;http://orgmode.org/Changes.html#orgheadline22&quot;&gt;8.3&lt;/a&gt; this Just Works without needing to set anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before you had to tell org-mode the names of your custom drawers (as per @Dan's answer) to make the work.  The &lt;code&gt;org-drawers&lt;/code&gt; variable and &lt;code&gt;#+DRAWERS&lt;/code&gt; keyword are now obsolete.  &lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-09-11T14:46:58.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16541" PostTypeId="1" AcceptedAnswerId="16544" CreationDate="2015-09-11T17:08:51.550" Score="3" ViewCount="306" Body="&lt;p&gt;If i run &lt;code&gt;M-x package-list-packages&lt;/code&gt;, it will list all packages with description like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1r8Z3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1r8Z3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If i run &lt;code&gt;M-x package-install&lt;/code&gt;, it shows only package names like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PnIvR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PnIvR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i get package description along with package name?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-11T18:21:20.747" LastActivityDate="2015-09-12T15:01:41.840" Title="Show package description along with package name?" Tags="|package|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16542" PostTypeId="2" ParentId="413" CreationDate="2015-09-11T17:09:29.157" Score="11" Body="&lt;p&gt;You can invoke &lt;code&gt;dired&lt;/code&gt; with an argument, ie. &lt;kbd&gt;C-u C-x d&lt;/kbd&gt; and after prompting for the directory it will also let you modify the switches passed to &lt;code&gt;ls&lt;/code&gt;. Add &lt;code&gt;R&lt;/code&gt; and &lt;code&gt;dired&lt;/code&gt; will recursively list all sub-directories, each in it's own section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you only want to see the contents of some sub-directories, press &lt;kbd&gt;i&lt;/kbd&gt; when the point is on a directory name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use the &lt;code&gt;find-dired&lt;/code&gt; command, with or without switches. Instead of showing sub-directories in their own section it prints the full path of each file. You can toggle showing file details with &lt;kbd&gt;(&lt;/kbd&gt; so that the long paths fit horizontally on screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are all built-in.&lt;/p&gt;&#xA;" OwnerUserId="9495" LastEditorUserId="105" LastEditDate="2018-01-11T22:51:44.883" LastActivityDate="2018-01-11T22:51:44.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16543" PostTypeId="2" ParentId="413" CreationDate="2015-09-11T17:25:42.903" Score="4" Body="&lt;p&gt;There is also &lt;a href=&quot;https://github.com/fourier/ztree&quot; rel=&quot;nofollow&quot;&gt;ztree&lt;/a&gt;. I use it when I need to take a look at directory structure, although usually I use vanilla Dired for all other things.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-11T17:25:42.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16544" PostTypeId="2" ParentId="16541" CreationDate="2015-09-11T18:12:14.437" Score="3" Body="&lt;p&gt;If you have &lt;code&gt;helm&lt;/code&gt; installed, you can use this function.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-package-install-init ()&#xA; (let ((packages (append (mapcar 'car package-alist)&#xA;                         (mapcar 'car package-archive-contents)&#xA;                         (mapcar 'car package--builtins))))&#xA;   (mapcar (lambda (pkg)&#xA;             (let* ((desc (or&#xA;                           (if (package-desc-p pkg) pkg)&#xA;                           (cadr (assq pkg package-alist))&#xA;                           (let ((built-in (assq pkg package--builtins)))&#xA;                             (if built-in&#xA;                                 (package--from-builtin built-in)&#xA;                               (cadr (assq pkg package-archive-contents))))))&#xA;                    (summary (if desc (package-desc-summary desc) &quot;&quot;)))&#xA;               (cons (format &quot;%-24s %s&quot; pkg summary) (symbol-name pkg))))&#xA;           packages)))&#xA;&#xA;(defun my-package-install ()&#xA; (interactive)&#xA; (package-install&#xA;  (helm&#xA;   :sources&#xA;   (helm-build-sync-source &quot;Install Package&quot;&#xA;     :candidates #'my-package-install-init&#xA;     :candidate-number-limit 9999&#xA;      :coerce #'intern))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a screen shot of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rEre9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rEre9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="5187" LastEditDate="2015-09-11T18:25:07.563" LastActivityDate="2015-09-11T18:25:07.563" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16545" PostTypeId="1" AcceptedAnswerId="16599" CreationDate="2015-09-11T18:56:52.837" Score="6" ViewCount="1840" Body="&lt;p&gt;I want to make names of major modes shorter. No longer than three characters. Is there any packages that do something like that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's better to shorten mode names in automatic fashion, so one doesn't need to constantly manage this thing manually. I'm ready to consider any principle of shortening. Most trivial would be to use abbreviations, so &lt;code&gt;emacs-lisp-mode&lt;/code&gt; would become &lt;code&gt;el&lt;/code&gt;, for example. &lt;code&gt;interactive-haskell-mode&lt;/code&gt; would become &lt;code&gt;ih&lt;/code&gt;. Not bad at all for a start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like Unicode characters like Greek letters and other stuff to be mode names, currently I use sort of hack to “rename” modes, but maybe there is full featured package to do it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Clarification: the question is about mode names (values of variable &lt;code&gt;mode-name&lt;/code&gt; usually), they are displayed in mode line. I want to make major mode “lighters” shorter.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="105" LastEditDate="2015-09-11T20:03:10.403" LastActivityDate="2021-05-28T03:16:46.537" Title="Make names of major modes shorter in the mode-line" Tags="|major-mode|mode-line|" AnswerCount="4" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16546" PostTypeId="1" AcceptedAnswerId="16558" CreationDate="2015-09-11T19:43:18.537" Score="3" ViewCount="1347" Body="&lt;p&gt;I'd like to configure magit so that when I decide to commit my changes I'm shown not only the buffer to edit commit message and the diff of changes but also the magit-process buffer. Is there a way of doing that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would help me with my git repos where I have pre-commit hooks defined that return some useful info but don't block the commit.&lt;/p&gt;&#xA;" OwnerUserId="213" LastActivityDate="2015-09-12T14:26:33.617" Title="Magit show git hook output" Tags="|magit|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16547" PostTypeId="2" ParentId="16545" CreationDate="2015-09-11T19:45:26.117" Score="4" Body="&lt;p&gt;If you just want to always trim the mode name to a particular length, then how about this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom mode-name-max-length 8&#xA;  &quot;The number of characters after which a major mode name will be&#xA;  truncated in the modeline.&quot;)&#xA;&#xA;(defun truncate-mode-name ()&#xA;  (setq mode-name (truncate-string-to-width mode-name mode-name-max-length nil nil 't)))&#xA;&#xA;(add-hook 'after-change-major-mode-hook #'truncate-mode-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Updated to use &lt;code&gt;truncate-string-to-width&lt;/code&gt; with ELLIPSIS argument per the comments -- thanks!)&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-09-11T20:29:13.763" LastActivityDate="2015-09-11T20:29:13.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16548" PostTypeId="1" AcceptedAnswerId="16705" CreationDate="2015-09-11T20:01:30.883" Score="0" ViewCount="487" Body="&lt;p&gt;Since a recent update from the org-mode repository, if I turn on &lt;code&gt;org-indent-mode&lt;/code&gt;, all lines show up indented with stars rather than spaces.  Here's an example of how it looks:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cOQhO.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cOQhO.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the file without indenting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vdojh.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vdojh.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.4.1 on Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know what may be causing this? &lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="2728" LastEditDate="2015-09-11T20:46:16.517" LastActivityDate="2020-12-16T19:43:22.293" Title="extraneous stars when using org-indent-mode" Tags="|org-mode|indentation|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16549" PostTypeId="2" ParentId="16545" CreationDate="2015-09-11T20:22:34.030" Score="0" Body="&lt;p&gt;You can also just get rid of the major mode lighter in the mode-line altogether.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just take the code defining &lt;code&gt;mode-line-modes&lt;/code&gt; from &lt;code&gt;bindings.el&lt;/code&gt;, and comment-out or remove these lines, to try it out:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;`(:propertize (&quot;&quot; mode-name)&#xA;              help-echo &quot;Major mode\n\&#xA;mouse-1: Display major mode menu\n\&#xA;mouse-2: Show help for major mode\n\&#xA;mouse-3: Toggle minor modes&quot;&#xA;              mouse-face mode-line-highlight&#xA;              local-map ,mode-line-major-mode-keymap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar mode-line-modes&#xA;  (let ((recursive-edit-help-echo &quot;Recursive edit, type C-M-c to get out&quot;))&#xA;    (list (propertize &quot;%[&quot; 'help-echo recursive-edit-help-echo)&#xA;          &quot;(&quot;&#xA;;;;           `(:propertize (&quot;&quot; mode-name)&#xA;;;;                         help-echo &quot;Major mode\n\&#xA;;;; mouse-1: Display major mode menu\n\&#xA;;;; mouse-2: Show help for major mode\n\&#xA;;;; mouse-3: Toggle minor modes&quot;&#xA;;;;                         mouse-face mode-line-highlight&#xA;;;;                         local-map ,mode-line-major-mode-keymap)&#xA;          '(&quot;&quot; mode-line-process)&#xA;          `(:propertize (&quot;&quot; minor-mode-alist)&#xA;                        mouse-face mode-line-highlight&#xA;                        help-echo &quot;Minor mode\n\&#xA;mouse-1: Display minor mode menu\n\&#xA;mouse-2: Show help for minor mode\n\&#xA;mouse-3: Toggle minor modes&quot;&#xA;                        local-map ,mode-line-minor-mode-keymap)&#xA;          (propertize &quot;%n&quot; 'help-echo &quot;mouse-2: Remove narrowing from buffer&quot;&#xA;                      'mouse-face 'mode-line-highlight&#xA;                      'local-map (make-mode-line-mouse-map&#xA;                                  'mouse-2 #'mode-line-widen))&#xA;          &quot;)&quot;&#xA;          (propertize &quot;%]&quot; 'help-echo recursive-edit-help-echo)&#xA;          &quot; &quot;))&#xA;  &quot;Mode line construct for displaying major and minor modes.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-11T20:22:34.030" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16550" PostTypeId="1" AcceptedAnswerId="34910" CreationDate="2015-09-11T22:13:47.530" Score="2" ViewCount="200" Body="&lt;h2&gt;Use case&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I run my Emacs config on many machines. Most do not have a Racket installed, and I'd rather not have my Racket related packages installed by default. However, I would like to be able to edit Racket code if I need to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This is just an example, I'm interested in doing this for a large number of modes, possibly all of the avalible major modes I can find.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can tell Emacs to autoload a package from the package repository? &lt;code&gt;racket-mode&lt;/code&gt; won't be installed by default, but if I ever edit a &lt;code&gt;*.rkt&lt;/code&gt; file, the config will download, install, load, and run &lt;code&gt;racket-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure I can do this with ugly hacks (just shadow the functions with a helper)? Is there a cleaner way to do it?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-09-11T23:43:43.377" LastActivityDate="2017-08-15T19:48:04.447" Title="Autoload function or mode from ELPA" Tags="|package|package-repositories|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16551" PostTypeId="1" AcceptedAnswerId="16561" CreationDate="2015-09-11T22:24:52.580" Score="9" ViewCount="5617" Body="&lt;p&gt;Weekly, I try to make sure that there are no TODOs I want to have scheduled that I've missed. So I look through the list of all TODO entries (&lt;code&gt;C-c a t&lt;/code&gt;). This is great; it shows only open TODOs, so I don't have to waste time skipping past all the stuff I've already done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But really, I don't want the list of all TODOs; If something is scheduled, or recurring, I don't want to see it in this list. I'd rather only see things that I could be missing, and I'm not missing something scheduled tomorrow that repeats every two days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can run &lt;a href=&quot;http://orgmode.org/manual/Filtering_002flimiting-agenda-items.html#index-org_002dagenda_002dfilter_002dby_002dtag-1196&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-agenda-filter-by-tag&lt;/code&gt;&lt;/a&gt; with &lt;code&gt;/&lt;/code&gt;, but either it can't filter by scheduled/recurring status, or I'm not sure of the way to use it that way. Given that the list of tags that show up when you press &lt;code&gt;TAB&lt;/code&gt; doesn't include anything like &quot;unscheduled&quot;, I'd bet this isn't the tool I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there are two possible solutions. While I'd prefer the first, having the second is also a possible solution for this problem.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I view all unscheduled open TODOs?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I view all open TODOs (scheduled or not) that are not recurring?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-11-17T14:12:19.803" Title="How do I view all org-mode TODOs that are not recurring, or not scheduled?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16552" PostTypeId="2" ParentId="16550" CreationDate="2015-09-12T01:09:17.687" Score="2" Body="&lt;p&gt;&lt;em&gt;(deleted mention of &lt;code&gt;use-package&lt;/code&gt;; apparently that was a red herring)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to roll your own approach, then the existing &lt;code&gt;auto-mode-alist&lt;/code&gt; and &lt;code&gt;autoload&lt;/code&gt; facilities should suffice as a basis. You could make autoload declarations for all the modes in question (either before package initialisation, or else only conditionally declaring the autoload, in order to avoid your autoloads clobbering real ones from installed packages). Each of your custom mode functions could then fetch &amp;amp; install the appropriate package from ELPA, load it (at which point the mode function definition would get clobbered by the real one), and finally call that actual mode function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe don't even bother with autoloads. I see that Prelude's approach just tests &lt;code&gt;package-installed-p&lt;/code&gt;, which seems a sensible condition. A basic approach might be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-autoelpa-loader (mode pkg args)&#xA;  &quot;Install PKG and then call MODE with ARGS.&quot;&#xA;  (package-refresh-contents) ;; could be an annoying default&#xA;  (package-install pkg)&#xA;  (require pkg)&#xA;  (apply mode args))&#xA;&#xA;(defmacro my-autoelpa-mode (mode auto-mode-forms &amp;amp;optional pkg)&#xA;  &quot;Arrange for MODE to be installed from ELPA on demand.&#xA;&#xA;AUTO-MODE-FORMS will be added to `auto-mode-alist'.&quot;&#xA;  `(progn&#xA;     ;; Specify auto-mode-alist entries regardless&#xA;     (mapc (lambda (form) (add-to-list 'auto-mode-alist form))&#xA;           ',auto-mode-forms)&#xA;     ;; Conditionally define a MODE which installs PKG first.&#xA;     (unless (package-installed-p ',(or pkg mode))&#xA;       (defun ,mode (&amp;amp;rest args)&#xA;         &quot;ELPA package installed on demand.&quot;&#xA;         (interactive)&#xA;         (my-autoelpa-loader ',mode ',(or pkg mode) args)))))&#xA;&#xA;;; Don't process autoelpa declarations until after init, to make&#xA;;; sure that packages have already been initialised.&#xA;(add-hook 'after-init-hook 'my-autoelpa-declarations)&#xA;(defun my-autoelpa-declarations ()&#xA;  (unless (fboundp 'package-installed-p)&#xA;    (package-initialize))&#xA;  ;; sequence of mode/package declarations...&#xA;  (my-autoelpa-mode js2-mode ((&quot;\\.js&quot; . js2-mode)))&#xA;  ;; ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-12T05:22:23.733" LastActivityDate="2015-09-12T05:22:23.733" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16553" PostTypeId="2" ParentId="16550" CreationDate="2015-09-12T01:54:36.063" Score="2" Body="&lt;p&gt;Emacs prelude has its own mechanism for doing it, you can get some inspiration from there. The &lt;a href=&quot;https://github.com/bbatsov/prelude/blob/5b0c51d0edcaaf19b7bbf4335cab1a500c6cfa3f/core/prelude-packages.el#L119-L191&quot; rel=&quot;nofollow&quot;&gt;relevant code&lt;/a&gt; can be found in &lt;code&gt;core/prelude-packages.el&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-12T01:54:36.063" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16554" PostTypeId="2" ParentId="12364" CreationDate="2015-09-12T02:13:37.993" Score="1" Body="&lt;p&gt;Install the &lt;a href=&quot;https://github.com/Malabarba/org-agenda-property&quot; rel=&quot;nofollow&quot;&gt;org-agenda-property package&lt;/a&gt; and add &lt;code&gt;DEADLINE&lt;/code&gt; as a property that is shows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ie, assuming you have MELPA set up, run &lt;code&gt;M-x package-install&lt;/code&gt;, enter &lt;code&gt;org-agenda-property&lt;/code&gt;, then &lt;code&gt;M-x org-agenda-property-customize&lt;/code&gt; and change the &lt;code&gt;Org Agenda Property List&lt;/code&gt; to contain &lt;code&gt;DEADLINE&lt;/code&gt; instead of location. Save and refresh your agendas!&lt;/p&gt;&#xA;" OwnerUserId="9499" LastActivityDate="2015-09-12T02:13:37.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16556" PostTypeId="2" ParentId="13186" CreationDate="2015-09-12T02:22:44.483" Score="4" Body="&lt;p&gt;Of course the solution you proposed (along with what @PythonNut provided) does its job for this particular case.  However, what if you ever wanted to not just modify behavior of some already existing Ex commands (like you do with advice now), but rather add &lt;em&gt;mode-specific&lt;/em&gt; (mode-local) Ex commands (written by you or coming from some package or whatever)?  Then clearly, your solution has no go, but here is what can be done instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'evil-ex)&#xA;&#xA;(defun evil-ex-define-cmd-local&#xA;    (cmd function)&#xA;  &quot;Locally binds the function FUNCTION to the command CMD.&quot;&#xA;  (unless (local-variable-p 'evil-ex-commands)&#xA;    (setq-local evil-ex-commands (copy-alist evil-ex-commands)))&#xA;  (evil-ex-define-cmd cmd function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&lt;br&gt;&#xA;  I will continue with the solution to your problem as an example, but, once again, keep in mind that you can use it to define any &lt;em&gt;local&lt;/em&gt; Ex command anywhere.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, I don't know whether you have tried to update &lt;code&gt;git-commit-mode&lt;/code&gt; ever since, but there is no &lt;code&gt;git-commit-mode&lt;/code&gt; anymore [&lt;a href=&quot;http://magit.vc/manual/magit.html#Updating-from-an-older-release&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;].  Its replacement, &lt;code&gt;git-commit&lt;/code&gt;, is now based on &lt;code&gt;with-editor&lt;/code&gt;.  Thus, what was previously &lt;code&gt;git-commit-commit&lt;/code&gt; is now more general &lt;code&gt;with-editor-finish&lt;/code&gt;, while what was previously &lt;code&gt;git-commit-abort&lt;/code&gt; is now more general &lt;code&gt;with-editor-cancel&lt;/code&gt;.  As a result, your customization of &lt;code&gt;with-editor&lt;/code&gt; could be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun with-editor-evil-setup ()&#xA;  (evil-ex-define-cmd-local &quot;wq&quot;        #'with-editor-finish)&#xA;  (evil-ex-define-cmd-local &quot;bd[elete]&quot; #'with-editor-cancel))&#xA;&#xA;(add-hook 'with-editor-mode-hook #'with-editor-evil-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically, &lt;code&gt;evil-ex-define-cmd-local&lt;/code&gt; gives you a generic approach to &lt;em&gt;locally&lt;/em&gt; customize &lt;code&gt;evil-ex-commands&lt;/code&gt; for any buffer (or mode).  Hope this helps.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;&lt;br&gt;&#xA;  I extensively use the above myself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For the sake of completeness, let me show you what I have, for example, for &lt;code&gt;git-commit&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun git-commit-evil-setup ()&#xA;  (evil-ex-define-cmd-local &quot;signoff&quot;   #'git-commit-signoff)&#xA;  (evil-ex-define-cmd-local &quot;ack&quot;       #'git-commit-ack)&#xA;  (evil-ex-define-cmd-local &quot;test&quot;      #'git-commit-test)&#xA;  (evil-ex-define-cmd-local &quot;review&quot;    #'git-commit-review)&#xA;  (evil-ex-define-cmd-local &quot;cc&quot;        #'git-commit-cc)&#xA;  (evil-ex-define-cmd-local &quot;reported&quot;  #'git-commit-reported)&#xA;  (evil-ex-define-cmd-local &quot;suggested&quot; #'git-commit-suggested)&#xA;  (evil-ex-define-cmd-local &quot;ms[ave]&quot;   #'git-commit-save-message)&#xA;  (evil-ex-define-cmd-local &quot;mn[ext]&quot;   #'git-commit-next-message)&#xA;  (evil-ex-define-cmd-local &quot;mp[rev]&quot;   #'git-commit-prev-message)&#xA;&#xA;  (evil-ex-define-cmd-local &quot;c[ommit]&quot;  #'with-editor-finish)&#xA;  (evil-ex-define-cmd-local &quot;a[bort]&quot;   #'with-editor-cancel))&#xA;&#xA;(add-hook 'git-commit-setup-hook #'git-commit-evil-setup)&#xA;(add-hook 'git-commit-setup-hook #'evil-insert-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2454" LastEditorUserId="2454" LastEditDate="2015-09-12T15:12:01.517" LastActivityDate="2015-09-12T15:12:01.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16557" PostTypeId="1" CreationDate="2015-09-12T04:42:08.080" Score="2" ViewCount="751" Body="&lt;p&gt;I'm using Emacs 24.3.1 on Ubuntu 14.04 with AUCTex for LaTeX editing. The command C-c C-c allows me to easily compile the document with pdflatex. However, the second time I'm running C-c C-c, instead doc-view is launched (showing the resulting pdf).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't fit with my workflow. I use a different pdf viewer, and sometimes need to compile the document twice to get citations right etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I disable doc-view so that C-c C-c always executes pdflatex?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the solutions suggested here&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/8095/how-to-disable-docview-as-default-command-in-auctex?rq=1&quot;&gt;How to disable DocView as default command in AUCTeX?&lt;/a&gt;&#xA;but had no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution didn't work either&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/7970/how-to-modify-default-command-for-tex-command-master-ie-c-c-c-c&quot;&gt;how to modify default command for TeX-command-master (ie, C-c C-c)?&lt;/a&gt;&#xA;since I don't seem to have a TeX-command-master command installed (not available on M-x). C-c must be mapped to something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT (Solved):&#xA;It turns out my problem was caused by me using Emacs latex mode rather than AUCTeX. After making sure AUCTeX is installed, it's invoked with LaTeX-mode, in contrast to Emacs latex mode that is invoked with latex-mode. The answer here &lt;a href=&quot;https://emacs.stackexchange.com/questions/7970/how-to-modify-default-command-for-tex-command-master-ie-c-c-c-c&quot;&gt;how to modify default command for TeX-command-master (ie, C-c C-c)?&lt;/a&gt; now solves my problem.&lt;/p&gt;&#xA;" OwnerUserId="9502" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-09-16T01:46:50.027" Title="How to disable doc-view in AUCTex" Tags="|latex|auctex|docview|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16558" PostTypeId="2" ParentId="16546" CreationDate="2015-09-12T08:58:12.110" Score="1" Body="&lt;p&gt;I managed to solve this by using those settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq magit-diff-auto-show nil) ;; This should be the defult IMHO&#xA;(add-hook 'server-switch-hook 'magit-process)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only problem I got left is that the focus ends in my process buffer and it's not easy (using &lt;code&gt;switch-to-buffer&lt;/code&gt; or &lt;code&gt;other-window&lt;/code&gt;) to get back to commit message in the hook, as it's messing with the emacs-client that's being used here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still this is good enough for me as now I see the output of &lt;em&gt;pre-commit hook&lt;/em&gt; when editing the message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following Iqbal's comment I changed my solution to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq magit-diff-auto-show nil)&#xA;(add-hook 'git-commit-mode-hook (lambda () (save-selected-window (magit-process))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works as a charm!&lt;/p&gt;&#xA;" OwnerUserId="213" LastEditorUserId="213" LastEditDate="2015-09-12T14:26:33.617" LastActivityDate="2015-09-12T14:26:33.617" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16559" PostTypeId="2" ParentId="16541" CreationDate="2015-09-12T15:01:41.840" Score="3" Body="&lt;p&gt;As suggested in the comments by @xuchunyang, you can try &lt;code&gt;helm-list-elisp-packages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that you might at first be confused: if your system is not fully up-to-date, &lt;code&gt;helm-list-elisp-packages&lt;/code&gt; will open with a filtered view showing only upgradeable packages (and this bypasses the documented behaviour that the initial filter is determined by &lt;code&gt;helm-el-package-initial-filter&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can press &lt;kbd&gt;M-A&lt;/kbd&gt; to switch to the unfiltered view. (And, as always, press &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt; to see the mode help explaining other key bindings).&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-12T15:01:41.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16560" PostTypeId="1" AcceptedAnswerId="16875" CreationDate="2015-09-12T15:08:57.537" Score="3" ViewCount="599" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://www.elastic.co/products/logstash&quot; rel=&quot;nofollow&quot;&gt;logstash&lt;/a&gt; and its configuration file (documented &lt;a href=&quot;https://www.elastic.co/guide/en/logstash/current/configuration.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;input {&#xA;  file {&#xA;    path =&amp;gt; &quot;/some/path/to/file&quot;&#xA;    option =&amp;gt; 1&#xA;  }&#xA;}&#xA;filter {&#xA;  if [var] == &quot;string&quot; {&#xA;    action {&#xA;      array_option =&amp;gt; [ &quot;val1&quot;, &quot;val2&quot;, &quot;val3&quot; ]&#xA;      object_option =&amp;gt; {&#xA;        str_option =&amp;gt; &quot;string&quot;&#xA;      }&#xA;    }&#xA;  }&#xA;}&#xA;# this is a comment&#xA;output {&#xA;  stdout&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a helpful emacs mode that works well with files like this. The &lt;code&gt;conf-mode&lt;/code&gt; does good highlighting, but I can't get it to indent properly. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="9507" LastActivityDate="2016-02-11T03:00:32.743" Title="Which mode is best for a special configuration file, specifically logstash" Tags="|major-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16561" PostTypeId="2" ParentId="16551" CreationDate="2015-09-12T16:16:01.067" Score="13" Body="&lt;p&gt;You can create a custom agenda view which sets &lt;a href=&quot;http://orgmode.org/manual/Special-agenda-views.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-agenda-skip-function&lt;/code&gt;&lt;/a&gt; using &lt;code&gt;org-agenda-skip-entry-if&lt;/code&gt;. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; . &quot;My Custom Agendas&quot;)&#xA;        (&quot;cu&quot; &quot;Unscheduled TODO&quot;&#xA;         ((todo &quot;&quot;&#xA;                ((org-agenda-overriding-header &quot;\nUnscheduled TODO&quot;)&#xA;                 (org-agenda-skip-function '(org-agenda-skip-entry-if 'timestamp)))))&#xA;         nil&#xA;         nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9508" LastActivityDate="2015-09-12T16:16:01.067" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="16562" PostTypeId="2" ParentId="16548" CreationDate="2015-09-12T16:31:11.977" Score="1" Body="&lt;p&gt;A theme tweak may fix the problem: you can adapt the following .emacs excerpt code for your case: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((class '((class color))))    &#xA;     (custom-theme-set-faces&#xA;     'leuven&#xA;     `(org-hide ((,class (:foreground &quot;#000000&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My theme is &lt;code&gt;leuven&lt;/code&gt;. I tried to change the color &lt;code&gt;#000000&lt;/code&gt; which changed the color oh the &quot;hidden&quot; stars.&lt;/p&gt;&#xA;" OwnerUserId="9245" LastEditorUserId="9245" LastEditDate="2015-09-12T17:23:03.877" LastActivityDate="2015-09-12T17:23:03.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16564" PostTypeId="2" ParentId="14971" CreationDate="2015-09-12T17:01:37.990" Score="9" Body="&lt;p&gt;Not an Emacs solution, but my LaTeX code writes such intervals as &lt;code&gt;\halfopen{0}{1}&lt;/code&gt;, where&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\newcommand\halfopen[2]{\ensuremath{[#1,#2)}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This convention pushes the balancing issue to a place where it's unlikely to cause problems.  And it's searchable :-)&lt;/p&gt;&#xA;" OwnerUserId="9343" LastEditorUserId="620" LastEditDate="2015-09-12T17:59:17.987" LastActivityDate="2015-09-12T17:59:17.987" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16565" PostTypeId="1" AcceptedAnswerId="16569" CreationDate="2015-09-12T17:02:59.470" Score="2" ViewCount="234" Body="&lt;p&gt;I would like to quickly append a note to the currently clocked in task - something like a capture. I don't believe there is anything out of the box to do this, but it seems it must be possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how?&lt;/p&gt;&#xA;" OwnerUserId="5463" LastActivityDate="2015-09-13T00:33:11.687" Title="How can I append a note to the current currently clocked in task" Tags="|org-mode|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16566" PostTypeId="1" CreationDate="2015-09-12T18:38:18.707" Score="1" ViewCount="64" Body="&lt;p&gt;In graphical emacs on OS X, &lt;code&gt;(read-event)&lt;/code&gt; in the scratch buffer produces &lt;code&gt;left&lt;/code&gt;, however in iterm2 (which I configured to send &lt;code&gt;esc-*&lt;/code&gt; for arrow keys), I get something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read-event)&#xA;27&#xA;OD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I press the left arrow. Configuring iterm2 to use esc for arrow keys works well with the other programs I use and I am reluctant to change it. Is there another function I can use instead of read-event that will pick up the entire arrow key?&lt;/p&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="105" LastEditDate="2016-06-22T20:28:45.463" LastActivityDate="2016-06-22T20:28:45.463" Title="read-event read entire arrow key instead of escape" Tags="|key-bindings|keystrokes|events|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16567" PostTypeId="1" CreationDate="2015-09-12T20:03:59.923" Score="9" ViewCount="1399" Body="&lt;p&gt;I have a problem with emacs started as daemon using Systemd. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every shutdown/reboot if I don't stop emacs daemon service manually, the history of recent opened files in current session is lost. &#xA;I think this is because of the Systemd that can't properly kill Emacs when in a shutdown state. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My recentf config in init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package recentf&#xA;    :config (progn (setq recentf-auto-cleanup 'never&#xA;                         recentf-max-menu-items 50&#xA;                         recentf-max-saved-items 400&#xA;                         recentf-save-file&#xA;                         (expand-file-name &quot;temp/.recentf&quot; user-emacs-directory))&#xA;                   (recentf-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Systemd emacs service config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Unit]&#xA;Description=Emacs: the extensible, self-documenting text editor&#xA;&#xA;[Service]&#xA;Type=forking&#xA;ExecStart=/usr/bin/emacs --daemon&#xA;ExecStop=/usr/bin/emacsclient --eval &quot;(kill-emacs)&quot;&#xA;&#xA;Restart=always&#xA;User=%i&#xA;#WorkingDirectory=%h&#xA;&#xA;[Install]&#xA;WantedBy=multi-user.target&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2230" LastActivityDate="2020-09-20T01:39:34.267" Title="Emacs can't save history of recent visited files opened in current session before shutdown" Tags="|emacsclient|linux|recentf|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16568" PostTypeId="2" ParentId="9585" CreationDate="2015-09-12T21:43:54.570" Score="4" Body="&lt;p&gt;Add the following to your file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ARCHIVE: :: * Completed.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And shuffling becomes &lt;a href=&quot;http://orgmode.org/guide/Archiving.html&quot; rel=&quot;nofollow&quot;&gt;archiving&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than sort the entries, how about a sorted view?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;cx&quot; &quot;TODOs sorted by state, priority, effort&quot;&#xA;         todo &quot;*&quot;&#xA;         ((org-agenda-overriding-header &quot;\nTODOs sorted by state, priority, effort&quot;)&#xA;          (org-agenda-sorting-strategy '(todo-state-down priority-down effort-up))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Restrict it to the current file with &lt;code&gt;&amp;lt;&lt;/code&gt;. You can mark DONE and archive from the sorted view.&lt;/p&gt;&#xA;" OwnerUserId="9509" LastActivityDate="2015-09-12T21:43:54.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16569" PostTypeId="2" ParentId="16565" CreationDate="2015-09-12T22:41:14.867" Score="3" Body="&lt;p&gt;A capture template can have a target of &lt;code&gt;clock&lt;/code&gt;, which will file to the entry being clocked.  Here's an example template that stores a note in a plain list item.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-capture-templates&#xA;             '(&quot;C&quot; &quot;to clocked&quot; item&#xA;               (clock)&#xA;             &quot;- %?&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="91" LastEditDate="2015-09-13T00:33:11.687" LastActivityDate="2015-09-13T00:33:11.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16570" PostTypeId="1" AcceptedAnswerId="16572" CreationDate="2015-09-12T23:59:27.570" Score="0" ViewCount="75" Body="&lt;p&gt;I have a file &lt;code&gt;~/documents/foo.org&lt;/code&gt; which looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: data&#xA;|                  |                  |        | p01a | p01b | p02 | p03 |&#xA;|------------------+------------------+--------+------+------+-----+-----|&#xA;| e-mail           | name             |  total |    5 |    5 |  10 |  25 |&#xA;|------------------+------------------+--------+------+------+-----+-----|&#xA;| gh01@beatles.edu | Harrison, George | 80.00% |    5 |    4 |   7 |  20 |&#xA;| jl01@beatles.edu | Lennon, John     | 75.56% |    5 |    3 |   5 |  21 |&#xA;| pm01@beatles.edu | McCartney, Paul  | 86.67% |    5 |    5 |   6 |  23 |&#xA;| rs01@beatles.edu | Starr, Ringo     | 82.22% |    5 |    4 |   6 |  22 |&#xA;#+TBLFM: @3$3..@&amp;gt;$3=100*vsum($4..$&amp;gt;)/vsum(@2$4..@2$&amp;gt;);%.2f%%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to write a program that takes the information in this table and generates new &lt;code&gt;org&lt;/code&gt; files organizing each person's data separately. For example, the first new file should be &lt;code&gt;~/documents/individual-reports/harrison-gh01.org&lt;/code&gt; and should look something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: George Harrison&#xA;#+Email: gh01@beatles.edu&#xA;#+Date: &amp;lt;2015-09-12 Sat&amp;gt;&#xA;&#xA;* Exam Results&#xA;&#xA;|               | score | possible |&#xA;|---------------+-------+----------|&#xA;| problem 1 (a) |     5 |        5 |&#xA;| problem 1 (b) |     4 |        5 |&#xA;| problem 2     |     7 |       10 |&#xA;| problem 3     |    20 |       25 |&#xA;|---------------+-------+----------|&#xA;| total         |    36 |       45 |&#xA;#+TBLFM: @&amp;gt;$2..@&amp;gt;$&amp;gt;=vsum(@2..@&amp;gt;&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I imagine this is possible using an elisp snippet but I'm not really sure how to get started. Does anyone know how to start something like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, I'm not necessarily looking for a full solution. I'm mainly looking for commands to get me started.&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="105" LastEditDate="2016-06-22T20:28:09.057" LastActivityDate="2016-06-22T20:28:09.057" Title="Can a code snippet scan an org file to generate multiple new org files?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16571" PostTypeId="1" CreationDate="2015-09-13T01:17:57.517" Score="1" ViewCount="849" Body="&lt;p&gt;I'd like to delay the display of some of my scheduled tasks until the day of. But for other scheduled tasks, I'd like them to display a couple days in advance as per default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the manual: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you want to delay the display of this task in the agenda, use &lt;code&gt;SCHEDULED: &amp;lt;2004-12-25 Sat -2d&amp;gt;&lt;/code&gt;: the task is still scheduled on the 25th but will appear two days later. In case the task contains a repeater, the delay is considered to affect all occurrences; if you want the delay to only affect the first scheduled occurrence of the task, use &lt;code&gt;--2d&lt;/code&gt; instead. See &lt;code&gt;org-scheduled-delay-days&lt;/code&gt; and &lt;code&gt;org-agenda-skip-scheduled-delay-if-deadline&lt;/code&gt; for details on how to control this globally or per agenda. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So that's a way to delay the display of tasks in the agenda until two days AFTER the scheduled task. But I want certain tasks to display the day they occur but not before. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;SCHEDULED: &amp;lt;2015-09-13 Sun -0d&amp;gt;&lt;/code&gt; but that didn't work... how do I ask Emacs to delay the display of certain scheduled tasks, specifying on a per-task basis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: Here's what my org-agenda looks like:   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://cdn.pbrd.co/images/GFPTFEF.png&quot; alt=&quot;agenda&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are the contents of my org-mode file (or see the actual org file &lt;a href=&quot;http://incandescentman.github.io/org-agenda-test-file.org&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* dailies - week of &amp;lt;2015-09-14 Mon&amp;gt; &#xA;*** COMMITTED &amp;lt;2015-09-16 Wed&amp;gt; [0%]&#xA;***** TODO meditate &#xA;        SCHEDULED: &amp;lt;2015-09-16 Wed&amp;gt; &#xA;***** TODO morning pages &#xA;      SCHEDULED: &amp;lt;2015-09-16 Wed&amp;gt; &#xA;&#xA;*** COMMITTED &amp;lt;2015-09-17 Thu&amp;gt; [0%]&#xA;***** TODO wake up 8:30am&#xA;      SCHEDULED: &amp;lt;2015-09-17 Thu 8:30am&amp;gt;&#xA;***** TODO blue light therapy&#xA;      SCHEDULED: &amp;lt;2015-09-17 Thu 8:31am&amp;gt;&#xA;***** TODO meditate &#xA;      SCHEDULED: &amp;lt;2015-09-17 Thu&amp;gt; &#xA;***** TODO morning pages &#xA;      SCHEDULED: &amp;lt;2015-09-17 Thu&amp;gt;&#xA;***** TODO lights out by 12:30am&#xA;      SCHEDULED: &amp;lt;2015-09-17 Thu 11:59pm&amp;gt; &#xA;&#xA;*** COMMITTED &amp;lt;2015-09-18 Fri&amp;gt; [0%]&#xA;***** TODO wake up 8:30am&#xA;      SCHEDULED: &amp;lt;2015-09-18 Fri 8:30am&amp;gt;&#xA;***** TODO blue light therapy&#xA;      SCHEDULED: &amp;lt;2015-09-18 Fri 8:31am&amp;gt;&#xA;***** TODO meditate &#xA;      SCHEDULED: &amp;lt;2015-09-18 Fri&amp;gt; &#xA;***** TODO morning pages &#xA;      SCHEDULED: &amp;lt;2015-09-18 Fri&amp;gt;&#xA;***** TODO lights out by 12:30am&#xA;      SCHEDULED: &amp;lt;2015-09-18 Fri 11:59pm&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, results of &lt;code&gt;C-h v RET org-scheduled-delay-days&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-scheduled-delay-days is a variable defined in `org.el'.&#xA;Its value is 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords&#xA;  '(&#xA;    (sequence &quot;TODO&quot; &quot;STARTED&quot; &quot;|&quot; &quot;DONE! :-)&quot;)&#xA;    (sequence &quot;MISSED&quot; &quot;|&quot; &quot;DONE! :-)&quot;)&#xA;    (sequence &quot;COMMITTED&quot; &quot;RESULTS&quot; &quot;|&quot;)&#xA;(sequence &quot;WAITING&quot; &quot;DAILIES&quot; &quot;WEEKLIES&quot; &quot;MONTHLIES&quot; &quot;QUARTERLIES&quot; &quot;YEARLIES&quot; &quot;GOALS&quot; &quot;SOMEDAY&quot; &quot;|&quot;) &#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong and how do I fix it?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-09-16T17:39:39.850" LastActivityDate="2015-09-16T17:39:39.850" Title="in org-mode, how to delay the display of SOME scheduled tasks until the day of?" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16572" PostTypeId="2" ParentId="16570" CreationDate="2015-09-13T10:32:34.050" Score="1" Body="&lt;p&gt;This should do roughly what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: students&#xA;|                  |                  |        | p01a | p01b | p02 | p03 |&#xA;|------------------+------------------+--------+------+------+-----+-----|&#xA;| e-mail           | name             |  total |    5 |    5 |  10 |  25 |&#xA;|------------------+------------------+--------+------+------+-----+-----|&#xA;| gh01@beatles.edu | Harrison, George | 80.00% |    5 |    4 |   7 |  20 |&#xA;| jl01@beatles.edu | Lennon, John     | 75.56% |    5 |    3 |   5 |  21 |&#xA;| pm01@beatles.edu | McCartney, Paul  | 86.67% |    5 |    5 |   6 |  23 |&#xA;| rs01@beatles.edu | Starr, Ringo     | 82.22% |    5 |    4 |   6 |  22 |&#xA;#+TBLFM: @3$3..@&amp;gt;$3=100*vsum($4..$&amp;gt;)/vsum(@2$4..@2$&amp;gt;);%.2f%%&#xA;&#xA;#+BEGIN_SRC emacs-lisp :var students=students :results none&#xA;    ;; This is a way to prevent Org from prepending commas to the lines&#xA;    ;; starting with Org markup&#xA;    (defvar my/student-grades-template&#xA;      (mapconcat&#xA;       'identity&#xA;       '(&quot;#+Title: %s&quot;&#xA;         &quot;#+Email: %s&quot;&#xA;         &quot;#+Date: &amp;lt;%s&amp;gt;&quot;&#xA;         &quot;&quot;&#xA;         &quot;* Exam Results&quot;&#xA;         &quot;&quot;&#xA;         &quot;|               | score | possible |&quot;&#xA;         &quot;|---------------+-------+----------|&quot;&#xA;         &quot;| problem 1 (a) |     %s |        5 |&quot;&#xA;         &quot;| problem 1 (b) |     %s |        5 |&quot;&#xA;         &quot;| problem 2     |     %s |       10 |&quot;&#xA;         &quot;| problem 3     |    %s |       25 |&quot;&#xA;         &quot;|---------------+-------+----------|&quot;&#xA;         &quot;| total         |       |          |&quot;&#xA;         &quot;#+TBLFM: @&amp;gt;$2..@&amp;gt;$&amp;gt;=vsum(@2..@&amp;gt;&amp;gt;)&quot;)&#xA;       &quot;\n&quot;))&#xA;&#xA;    (defun my/gen-student-report (student-row dest)&#xA;      (let ((today (format-time-string &quot;%Y-%m-%d %a&quot;)))&#xA;        (cl-destructuring-bind (e-mail name _ p01a p01b p02 p03) student-row&#xA;          (with-temp-file (format &quot;%s/%s.org&quot; dest (car (split-string name &quot;\\W+&quot;)))&#xA;            (erase-buffer)&#xA;            (insert (format my/student-grades-template name e-mail today p01a p01b p02 p03))&#xA;            (org-table-TBLFM-begin)&#xA;            (orgtbl-ctrl-c-ctrl-c '(4))))))&#xA;&#xA;    (defun my/gen-reports (students)&#xA;      (let ((dest &quot;./reports/&quot;) &#xA;            (students (cddr students)))&#xA;        (unless (file-exists-p dest)&#xA;          (make-directory dest))&#xA;        (cl-mapcar 'my/gen-student-report&#xA;                   students (make-list (length students) dest))))&#xA;&#xA;    (my/gen-reports students)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it may be also possible to make it more generic by replacing the template by a procedure using a special Org file as a template.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-09-13T10:32:34.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16574" PostTypeId="1" CreationDate="2015-09-13T11:15:44.247" Score="3" ViewCount="451" Body="&lt;p&gt;I am new to Emacs. I like how I can easily navigate to a file via &lt;code&gt;helm-mode-find-file&lt;/code&gt; in &lt;code&gt;helm&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is there any way to combine any variant of this (&lt;code&gt;helm&lt;/code&gt; or otherwise) with &lt;code&gt;evil&lt;/code&gt;'s &lt;code&gt;ex&lt;/code&gt; commands (eg, &lt;code&gt;:e&lt;/code&gt;, &lt;code&gt;:sp&lt;/code&gt;, etc.)?&lt;/em&gt;  Or do I really have to type the full path by hand every time I am trying to open a file from the hard disk?&lt;/p&gt;&#xA;" OwnerUserId="9512" LastEditorUserId="253" LastEditDate="2015-09-13T11:21:29.107" LastActivityDate="2015-09-13T11:21:29.107" Title="Quickly navigate path with evil-mode's ex commands?" Tags="|helm|evil|find-file|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16575" PostTypeId="1" CreationDate="2015-09-13T11:52:14.477" Score="2" ViewCount="78" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: how can I get the last time I built the &lt;code&gt;org&lt;/code&gt; agenda buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've set an idle timer to rebuild my &lt;code&gt;org&lt;/code&gt; agenda buffer every &lt;em&gt;x&lt;/em&gt; minutes.  It works fine, but it's inefficient to rebuild if the agenda files have not been modified since the last rebuild.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can get the last modification time of, say, the first agenda file with &lt;code&gt;(nth 5 (file-attributes (car org-agenda-files)))&lt;/code&gt; and compare it to some hypothetical &lt;code&gt;last-agenda-rebuild&lt;/code&gt; variable with &lt;code&gt;time-less-p&lt;/code&gt;.  However, I don't know where to look for the last rebuild time (or if it's even stored anywhere).&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-01-11T17:11:04.957" Title="Query org agenda build time?" Tags="|org-mode|org-agenda|time-date|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16576" PostTypeId="1" CreationDate="2015-09-13T13:43:05.913" Score="0" ViewCount="168" Body="&lt;p&gt;I use both &lt;strong&gt;web-mode&lt;/strong&gt; and &lt;strong&gt;racket-mode&lt;/strong&gt; often. I am also using Pollen, a Racket language for processing text. Pollen uses compound file extensions like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pynchon.html.pm&#xA;stephenson.css.pp&#xA;wallace.html.pmd&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The relevant extensions are &lt;code&gt;pm&lt;/code&gt;, &lt;code&gt;pmd&lt;/code&gt; and &lt;code&gt;pp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;web-mode&lt;/strong&gt; grabs onto these file extensions due the &lt;code&gt;css&lt;/code&gt; and &lt;code&gt;html&lt;/code&gt; portions on the extension. I would like it to stop doing that. I would like these files to be opened in &lt;strong&gt;racket-mode&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I have tried so far in my &lt;code&gt;default.el&lt;/code&gt; file (I am using &lt;strong&gt;prelude&lt;/strong&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; web-mode&#xA;(require 'web-mode)&#xA;(defun my-web-mode-hook ()&#xA;  &quot;Hooks for Web mode.&quot;&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.p[mp]\\'&quot; ignore t))&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.pmd\\'&quot; ignore t)))&#xA;(add-hook 'web-mode-hook 'my-web-mode-hook)&#xA;&#xA;;; racket-mode&#xA;(require 'racket-mode)&#xA;(defun racket-mode-hook ()&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.p[mp]\\'&quot; . racket-mode))&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.pmd\\'&quot; . racket-mode)))&#xA;&#xA;(add-hook 'racket-mode-hook 'racket-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately my pollen files with an &lt;code&gt;html&lt;/code&gt; extension (ex: &lt;code&gt;pynchon.html.pm&lt;/code&gt;) still open in &lt;strong&gt;html-mode&lt;/strong&gt; and my pollen files with a &lt;code&gt;pp&lt;/code&gt; extension open in &lt;strong&gt;puppet-mode&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8487" LastActivityDate="2015-09-14T03:20:08.400" Title="Get web-mode to ignore file extension and racket-mode to honor it" Tags="|web-mode|prelude|config|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16577" PostTypeId="2" ParentId="16576" CreationDate="2015-09-13T13:53:45.433" Score="1" Body="&lt;p&gt;Welp, managed to solved it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I removed the relevant lines from &lt;code&gt;my-web-mode-hook&lt;/code&gt; and added the following outside of the &lt;code&gt;racket-mode-hook&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.p[pmd]+\\'&quot; . racket-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My files are now opening in &lt;strong&gt;racket-mode&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8487" LastActivityDate="2015-09-13T13:53:45.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16578" PostTypeId="2" ParentId="13951" CreationDate="2015-09-13T14:40:52.033" Score="5" Body="&lt;p&gt;You could use a &lt;a href=&quot;http://orgmode.org/manual/Literal-examples.html#Literal-examples&quot; rel=&quot;noreferrer&quot;&gt;literal example&lt;/a&gt;. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is my important equation:&#xA;#+BEGIN_EXAMPLE&#xA;|a+b| ≤ |a| + |b|&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A shorthand using a colon following one or more spaces also works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is my important equation:&#xA;   : |a+b| ≤ |a| + |b|&#xA;Isn't it nice.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Literal examples are usually written in monospace and indented when exported.&lt;/p&gt;&#xA;" OwnerDisplayName="user9514" LastActivityDate="2015-09-13T14:40:52.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16579" PostTypeId="2" ParentId="16575" CreationDate="2015-09-13T14:53:51.380" Score="1" Body="&lt;p&gt;Idle timer uses &lt;code&gt;current-idle-time&lt;/code&gt;  to run. So, you can't  get last time when it was activate. But you can save the time when it was active.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-build-agenda ()&#xA;  (set last-build-time (current-time-string)&#xA;   ;; build agenda)&#xA;&#xA;(setq org-build-timer&#xA;      (run-with-idle-timer 5 t 'org-build-agenda))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-13T14:53:51.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16580" PostTypeId="1" CreationDate="2015-09-13T18:58:49.737" Score="8" ViewCount="1139" Body="&lt;p&gt;I am using emacs 24.5 under Linux Gentoo, and I would like to adjust the vertical scroll bar width, as I notice it became much larger than it was in a recent revision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to do this in my &quot;.emacs&quot; file ?&#xA;I tried to manually set variable scroll-bar-width, but emacs reports it does not know this variable (although I came across it while reading the documentation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, I could live without the scroll bar after all (more text space is always fine with me).&lt;/p&gt;&#xA;" OwnerUserId="9517" LastActivityDate="2015-10-13T21:57:54.817" Title="Controlling the width of the vertical scroll bar" Tags="|init-file|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16581" PostTypeId="1" AcceptedAnswerId="16584" CreationDate="2015-09-13T19:11:34.850" Score="7" ViewCount="1297" Body="&lt;p&gt;I need to use Tramp to connect to a server that has 2-factor authentication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I log in from the command line or from  I get a message asking me to press 1 (and hit enter) which then sends a popup message to my phone asking me to approve the log in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't figure out how to get Tramp to let me interact with the command prompt after it tries to connect. I get a buffer that says &quot;Passcode or option (1-1):&quot; but I can't figure out how to enter a value to have Tramp send back to the server.&lt;/p&gt;&#xA;" OwnerUserId="9518" LastActivityDate="2015-09-14T01:26:54.240" Title="Tramp with 2-factor authentication" Tags="|tramp|ssh|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16582" PostTypeId="1" CreationDate="2015-09-13T19:18:58.827" Score="0" ViewCount="52" Body="&lt;p&gt;I have headers at the top of the file that look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+TITLE: A Good Explanation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That looks like all the examples I can find browsing various web pages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I go to export in either LaTeX or HTML I see an error about &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type arguement: listp, #(&quot;A Good Explanation&quot; 0 24 (:parent (#0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet headers for &lt;code&gt;LATEX_CLASS:&lt;/code&gt; work as expected.  In fact the headers that don't work are grey and the ones that do, like LATEX_CLASS are colored reddish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I put in headers for Title, Author, Email etc?&lt;/p&gt;&#xA;" OwnerUserId="6929" LastEditorUserId="25" LastEditDate="2015-09-13T21:22:32.010" LastActivityDate="2015-09-13T21:22:32.010" Title="Org Mode Headers Won't Export" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16583" PostTypeId="2" ParentId="16580" CreationDate="2015-09-13T21:20:51.400" Score="4" Body="&lt;p&gt;Probably depends on your Emacs (e.g. toolkit or not). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On MS Windows, I control it using frame parameter &lt;code&gt;scroll-bar-width&lt;/code&gt; (see also &lt;code&gt;scroll-bar-height&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Layout-Parameters.html&quot; rel=&quot;nofollow&quot;&gt;Layout Parameters&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-13T21:20:51.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16584" PostTypeId="2" ParentId="16581" CreationDate="2015-09-13T23:54:48.307" Score="9" Body="&lt;p&gt;You'll have to customize the &lt;code&gt;tramp-password-prompt-regexp&lt;/code&gt; variable with the second prompt to finish the 2-factor authentication. The &lt;a href=&quot;http://www.gnu.org/software/tramp/#Remote-shell-setup&quot;&gt;remote shell setup&lt;/a&gt; part of the manual has a simple example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not a new feature but an old feature that you adapt to the second prompt of the 2-factor authentication. This same facility was used in days of yore for entering some secret date or random number or mother's maiden name.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-09-14T01:26:54.240" LastActivityDate="2015-09-14T01:26:54.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16585" PostTypeId="1" AcceptedAnswerId="16594" CreationDate="2015-09-14T00:19:58.583" Score="1" ViewCount="543" Body="&lt;p&gt;With my actual configuration, an &lt;code&gt;enum&lt;/code&gt; definition looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;enum    Toto&#xA;    {&#xA;        foo,&#xA;        bar&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Spaces are by packs of 4 instead of 2 because I set 4 as default indentation space for C/C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to align brackets with &lt;code&gt;enum&lt;/code&gt; keyword WITHOUT reducing space between them and enum list, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;enum    Toto&#xA;{&#xA;    foo,&#xA;    bar&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I already done a similar thing by totally canceling &lt;code&gt;namespace&lt;/code&gt; indentation, with the following Elisp line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(c-set-offset 'innamespace 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I don't know if something similar is possible for &lt;code&gt;enum&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7003" LastEditorUserId="105" LastEditDate="2016-06-22T20:27:54.760" LastActivityDate="2016-06-22T20:27:54.760" Title="How to reduce enum definition indentation?" Tags="|indentation|c++|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16586" PostTypeId="1" AcceptedAnswerId="16627" CreationDate="2015-09-14T00:41:52.983" Score="3" ViewCount="546" Body="&lt;p&gt;I have a text like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;testStatus['id'] = elt.$.id^^''&amp;amp;&amp;amp;&amp;amp;&amp;amp;&#xA;testStatus$$['suite_id'] = &quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;^^&lt;/code&gt; is my cursor position. When I press &lt;code&gt;M-f&lt;/code&gt;, it uses &lt;code&gt;forward-word&lt;/code&gt; and end up in the place &lt;code&gt;$$&lt;/code&gt; in line number two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I force &lt;code&gt;M-f&lt;/code&gt; to treat newline characters as a word seperator and just stop at the end of line number one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works fine, when the last part of line one has some alphabets.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;testStatus['id'] = elt.$.id^^''&amp;amp;&amp;amp;&amp;amp;&amp;amp;abcd$$&#xA;testStatus['suite_id'] = &quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;^^&lt;/code&gt; is my initial cursor position and &lt;code&gt;$$&lt;/code&gt; is my new cursor position.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5187" LastEditDate="2015-09-15T13:01:13.000" LastActivityDate="2015-10-07T19:50:59.580" Title="Make forward-word not to jump over newline character" Tags="|navigation|words|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16587" PostTypeId="1" AcceptedAnswerId="16602" CreationDate="2015-09-14T00:49:19.090" Score="3" ViewCount="2259" Body="&lt;p&gt;I have some org files that I generated from a program I wrote. My program is not intelligent enough to parse the tables in these files &quot;correctly&quot;. For example, one of my org files may look like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: hello world&#xA;&#xA;* section 1&#xA;&#xA;here is an unaligned table&#xA;&#xA;|this |is | my |&#xA;| first| unaligned| table |&#xA;&#xA;* section 2&#xA;&#xA;here are two more unaligned tables&#xA;&#xA;| this | is |my |&#xA;|second| unaligned |     table|&#xA;&#xA;|yet|another| unaligned|&#xA;|table| to |alter|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to automatically align all the tables in these files from the command line. Thus running such a command on my above file would yield &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: hello world&#xA;&#xA;* section 1&#xA;&#xA;here is an unaligned table&#xA;&#xA;| this  | is        | my    |&#xA;| first | unaligned | table |&#xA;&#xA;* section 2&#xA;&#xA;here are two more unaligned tables&#xA;&#xA;| this   | is        | my    |&#xA;| second | unaligned | table |&#xA;&#xA;| yet   | another | unaligned |&#xA;| table | to      | alter     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does such a command exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware that setting &lt;code&gt;org-startup-align-all-tables&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; will automatically align every table upon visiting the file but I'd like to align the tables without actually opening the file.&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-09-14T01:41:09.597" LastActivityDate="2016-04-28T13:53:12.983" Title="Can I align all the tables in an org file from the command line?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16588" PostTypeId="1" AcceptedAnswerId="16592" CreationDate="2015-09-14T01:32:31.610" Score="3" ViewCount="633" Body="&lt;p&gt;Is there a way to use auto-indentation in Emacs without creating indentation on empty lines? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an example from C, if I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (true)&#xA;{&#xA;   printf(&quot;word&quot;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then insert a newline after the opening brace&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (true)&#xA;{&#xA;&amp;gt;&amp;gt;&amp;gt;&#xA;   printf(&quot;word&quot;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then a new line is created and if auto-indention is enabled then extra space is also added, here represented by the symbol &gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I commit this code using a VCS, I DO NOT want the extra space from the empty line to be included, but I DO want the newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an auto-indentation system for Emacs which will only add extra space to the buffer if I type a character after creating a newline? Or else is there a different scheme that could accomplish my goal of avoiding adding spaces on empty lines?&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2015-09-14T21:54:10.673" LastActivityDate="2015-09-14T21:54:10.673" Title="Auto-indent without creating indentation in empty lines" Tags="|indentation|text-editing|version-control|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16589" PostTypeId="2" ParentId="16587" CreationDate="2015-09-14T01:49:02.223" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Does such a command exist? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, but you can easily mimic in a variety of ways. The easiest approach seems an adaptation of org-mode's built-in &lt;a href=&quot;http://orgmode.org/manual/Column-width-and-alignment.html#Column-width-and-alignment&quot; rel=&quot;nofollow&quot;&gt;column alignment overrides&lt;/a&gt; &lt;code&gt;&amp;lt;10&amp;gt;&lt;/code&gt; at the top of each column. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;8&amp;gt;    |    &amp;lt;11&amp;gt;   |   &amp;lt;12&amp;gt;    |&#xA;| this   | is        | my        |&#xA;| second | unaligned | table     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;your second table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;8&amp;gt;    |    &amp;lt;11&amp;gt;   |   &amp;lt;12&amp;gt;    |&#xA;| yet    | another   | unaligned |&#xA;| table  | to        | alter     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;&amp;lt;8&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;11&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;12&amp;gt;&lt;/code&gt; are arbitrary column widths that you specify for each column of each table, overriding the automatic alignment. This will have the effect of aligning all the columns and the tables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can confirm I've used this feature extensively while dumping to html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addendum: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To print in orgmode, you must invoke the export to text feature:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-e t a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are &lt;a href=&quot;http://orgmode.org/org.html#ASCII_002fLatin_002d1_002fUTF_002d8-export&quot; rel=&quot;nofollow&quot;&gt;other options&lt;/a&gt; to save to file, save to a new buffer, etc. If you want to export from the command line, use one like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs foo.org --batch -f org-ascii-export-to-ascii --kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The manual has more details about &lt;a href=&quot;http://orgmode.org/org.html#Batch-execution&quot; rel=&quot;nofollow&quot;&gt;batch execution&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-09-14T03:42:46.933" LastActivityDate="2015-09-14T03:42:46.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16590" PostTypeId="2" ParentId="2286" CreationDate="2015-09-14T01:49:55.133" Score="7" Body="&lt;p&gt;The time you spend optimizing your startup time will likely be greater than all the extra time you would have otherwise waited for Emacs to start up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I make 25 &lt;code&gt;require&lt;/code&gt; calls in my init file so that Flycheck can find spelling errors in my code. My startup time is...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ time emacs --eval '(save-buffers-kill-terminal)'&#xA;&#xA;real    0m2.776s&#xA;user    0m2.305s&#xA;sys     0m0.148s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, on my system, &lt;code&gt;time emacs -Q --eval '(save-buffers-kill-terminal)'&lt;/code&gt; has a &lt;code&gt;real&lt;/code&gt; of &lt;code&gt;0m0.404s&lt;/code&gt;. The theoretical maximum amount of time I can save is 2.3 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that I spend an hour making all matter of optimizations to my init file. (I won't count the additional 15-30 minutes spent on a later date trying to figure out why my changes weren't taking effect due to my init file being byte-compiled.) (I also won't count the time that Flycheck would have saved me in the debugger if I hadn't removed the &lt;code&gt;require&lt;/code&gt; calls.) There are 3600 seconds in an hour, so if I managed to save the whole 2.3 seconds, my investment in time would only pay off after 1565 startups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming I restarted Emacs 3 times a day, every day, it would take a year and half for that investment to pay off. If I left the same Emacs instance running for days at a time (as I often do), I'd probably only restart 2-5 times a week, in which case it would take 6 to 15 years for that investment to pay off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm being generous, because you are likely to spend more than an hour optimizing your startup, and you probably won't save the maximum theoretical number of seconds.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2015-09-14T01:49:55.133" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16591" PostTypeId="2" ParentId="16576" CreationDate="2015-09-14T03:20:08.400" Score="0" Body="&lt;p&gt;We can, in addition to just making sure that your racket files open up properly, make sure that files that end in &lt;code&gt;.html.anythingelse&lt;/code&gt; also don't open up in html mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default regexp that determines whether a file is opened in &lt;code&gt;html-mode&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, a filename that contains &lt;code&gt;.html&lt;/code&gt; (or &lt;code&gt;.shtml&lt;/code&gt;, or &lt;code&gt;.xhtml&lt;/code&gt;) followed by either nothing, or a single period, then some more stuff. But really, we want to make sure the filename &lt;em&gt;ends&lt;/em&gt; with &lt;code&gt;.html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let's do that. But first, remove the old one from the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;(setq auto-mode-alist&#xA;      (cl-remove-if (lambda (ele)&#xA;                      (equal ele&#xA;                             '(&quot;\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'&quot;&#xA;                               . html-mode)))&#xA;                    auto-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And now we can add a new regex matcher that makes sure we're matching at the &lt;em&gt;end&lt;/em&gt; of the name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.[sx]?html?$&quot; . html-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And now, if you try to open &lt;code&gt;whatever.html&lt;/code&gt;, it'll open in HTML mode as before, but if you try to open &lt;code&gt;whatever.html.pm&lt;/code&gt;, it'll open in racket-mode.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-09-14T03:20:08.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16592" PostTypeId="2" ParentId="16588" CreationDate="2015-09-14T03:57:54.357" Score="6" Body="&lt;p&gt;Perhaps an even better idea is to use &lt;a href=&quot;https://github.com/lewang/ws-butler&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ws-butler&lt;/code&gt;&lt;/a&gt;, a mode that unobtrusively trims the relevant trailing whitespace whenever the buffer is saved (be it from auto-indentation or some other source). Even better, it tracks your changes, and only cleans up the lines you touch, which is handy for editing with other people who aren't so tidy under VC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;package-install&lt;/kbd&gt; &lt;kbd&gt;ws-butler&lt;/kbd&gt; (you do have MELPA or Marmalade, right?)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(ws-butler-global-mode +1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And away you go...&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="315" LastEditDate="2015-09-14T11:59:27.420" LastActivityDate="2015-09-14T11:59:27.420" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16593" PostTypeId="1" AcceptedAnswerId="16631" CreationDate="2015-09-14T05:30:50.283" Score="0" ViewCount="120" Body="&lt;p&gt;I'd like to write a command so that for a particular record (found for example with &lt;code&gt;(bbdb-search (bbdb-records) regexp)&lt;/code&gt;) I'm able to extract just the name part of it (or e. g. the mail part, or any part of the xfields). How would you lisp this?&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="105" LastEditDate="2016-06-22T20:27:37.680" LastActivityDate="2016-06-22T20:27:37.680" Title="How can I access certain field information of a BBDB3 record?" Tags="|bbdb|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16594" PostTypeId="2" ParentId="16585" CreationDate="2015-09-14T07:05:24.483" Score="3" Body="&lt;p&gt;You can adopt the same kind of solution as for your namespace definition, except you should use the &lt;code&gt;brace-list-open&lt;/code&gt; identifier.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(c-set-offset 'brace-list-open 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After this setup, your code indents like this (with 2-space indentation):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c++ prettyprint-override&quot;&gt;&lt;code&gt;enum Toto&#xA;{&#xA;  foo,&#xA;  bar&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; You can find the correct indentation identifier using &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/ccmode/Syntactic-Analysis.html#Syntactic-Analysis&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;c-show-syntactic-information&lt;/code&gt;&lt;/a&gt;) on any line of a C++ buffer. It will perform the syntactic analysis of the line and display the results. For example, when used in the &lt;code&gt;{&lt;/code&gt; line above, it will highlight the first character of &lt;code&gt;enum&lt;/code&gt;, and indicate in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Syntactic analysis: ((brace-list-open 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Judging by the identifier name (&lt;code&gt;brace-list-open&lt;/code&gt;), it might well be used for syntactic constructs other than &lt;code&gt;enum&lt;/code&gt;. So you should expect side-effects.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-14T07:05:24.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16595" PostTypeId="2" ParentId="2286" CreationDate="2015-09-14T07:21:33.703" Score="8" Body="&lt;p&gt;Something that recently popped up on &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3kqt6e/2_easy_little_known_steps_to_speed_up_emacs_start/&quot; rel=&quot;noreferrer&quot;&gt;emacs reddit&lt;/a&gt;: decrease the number of garbage collection invocations by putting this near the beginning of your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq gc-cons-threshold 50000000)&#xA;&#xA;(add-hook 'emacs-startup-hook 'my/set-gc-threshold)&#xA;(defun my/set-gc-threshold ()&#xA;  &quot;Reset `gc-cons-threshold' to its default value.&quot;&#xA;  (setq gc-cons-threshold 800000))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the example above, the GC is invoked every ~50MB (instead of the default of ~800kb), which seems sensible on a modern system with plenty of RAM.&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-09-15T14:35:32.263" LastActivityDate="2015-09-15T14:35:32.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16596" PostTypeId="1" CreationDate="2015-09-14T08:32:19.760" Score="2" ViewCount="186" Body="&lt;p&gt;I've been using the &lt;code&gt;dired-do-search&lt;/code&gt; for a long time to find regexp&#xA;matches in marked files in a directory.  If there were more matches, you&#xA;could resume the search and find the next match with &lt;code&gt;M-,&lt;/code&gt; but it&#xA;stopped working for me somewhere around the 24.4 or 24.5 release.&#xA;Currently I'm on 25.0.50.2 and when I do &lt;code&gt;M-,&lt;/code&gt; after the first match is&#xA;found, I'm getting &lt;code&gt;xref-pop-marker-stack: Marker stack is empty&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody help me fix it?  Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6663" LastEditorUserId="10" LastEditDate="2015-09-14T08:33:00.347" LastActivityDate="2015-09-14T14:37:28.170" Title="`dired-do-search` not resuming search" Tags="|dired|search|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16598" PostTypeId="2" ParentId="3669" CreationDate="2015-09-14T11:33:30.040" Score="4" Body="&lt;p&gt;The reason of this problem can be using of the &lt;code&gt;recentf&lt;/code&gt; mode. You need to disable cleaning up unavailable files using following command in your ~/.emacs (or ~/.emacs.d/init.el if you are using it):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq recentf-auto-cleanup 'never)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9523" LastActivityDate="2015-09-14T11:33:30.040" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16599" PostTypeId="2" ParentId="16545" CreationDate="2015-09-14T11:47:09.167" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/mrkkrp/cyphejor&quot; rel=&quot;noreferrer&quot;&gt;Cyphejor&lt;/a&gt; can handle this. Here is how&#xA;it works (copied from &lt;code&gt;README.md&lt;/code&gt; file):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First you need to set value of variable &lt;code&gt;cyphejor-rules&lt;/code&gt;. This variable&#xA;contains rules that the package uses to generate new names for major modes&#xA;from their symbol names (values of &lt;code&gt;major-mode&lt;/code&gt; variable).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Value of &lt;code&gt;cyphejor-rules&lt;/code&gt; should be a list. Every element of the list must&#xA;be either a list:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(string replacement &amp;amp;rest parameters)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;string&lt;/code&gt; is a “word” in major mode symbol name, &lt;code&gt;replacement&lt;/code&gt; is&#xA;another string to be used instead, &lt;code&gt;parameters&lt;/code&gt; is a list that may be empty&#xA;but may have the following keywords in it as well:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;:prefix&lt;/code&gt; — put it in the beginning of result string&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;:postfix&lt;/code&gt; — put it in the end of result string&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Apart from elements of the form described above the following keywords are&#xA;allowed (they influence the algorithm in general):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;:downcase&lt;/code&gt; — replace words that are not specified explicitly&#xA;with their first letter downcased&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;:upcase&lt;/code&gt; — replace words that are not specified explicitely with their&#xA;first letter upcased&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If nothing is specified, use word unchanged separating it from other words&#xA;with spaces if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of setup:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq&#xA; cyphejor-rules&#xA; '(:upcase&#xA;   (&quot;bookmark&quot;    &quot;→&quot;)&#xA;   (&quot;buffer&quot;      &quot;β&quot;)&#xA;   (&quot;diff&quot;        &quot;Δ&quot;)&#xA;   (&quot;dired&quot;       &quot;δ&quot;)&#xA;   (&quot;emacs&quot;       &quot;ε&quot;)&#xA;   (&quot;fundamental&quot; &quot;Ⓕ&quot;)&#xA;   (&quot;inferior&quot;    &quot;i&quot; :prefix)&#xA;   (&quot;interaction&quot; &quot;i&quot; :prefix)&#xA;   (&quot;interactive&quot; &quot;i&quot; :prefix)&#xA;   (&quot;lisp&quot;        &quot;λ&quot; :postfix)&#xA;   (&quot;menu&quot;        &quot;▤&quot; :postfix)&#xA;   (&quot;mode&quot;        &quot;&quot;)&#xA;   (&quot;package&quot;     &quot;↓&quot;)&#xA;   (&quot;python&quot;      &quot;π&quot;)&#xA;   (&quot;shell&quot;       &quot;sh&quot; :postfix)&#xA;   (&quot;text&quot;        &quot;ξ&quot;)&#xA;   (&quot;wdired&quot;      &quot;↯δ&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, just enable &lt;code&gt;cyphejor-mode&lt;/code&gt; in your configuration file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cyphejor-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-14T11:47:09.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16600" PostTypeId="2" ParentId="15063" CreationDate="2015-09-14T14:10:03.707" Score="1" Body="&lt;p&gt;Add these to the &lt;code&gt;org-mode&lt;/code&gt; hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq paragraph-start &quot;\\|[     ]*$&quot;)&#xA;(setq paragraph-separate &quot;[     ]*$&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that these character classes, the contents of &lt;code&gt;[]&lt;/code&gt;, contain one space and one literal tab, which may not render correctly in your browser)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the paragraph boundaries definitions from text-mode.  So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda ()&#xA;                           (setq paragraph-start &quot;\\|[  ]*$&quot;&#xA;                                 paragraph-separate &quot;[  ]*$&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of a &lt;code&gt;lambda&lt;/code&gt;, you could wrap it in a named function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-hook ()&#xA;  (setq paragraph-start &quot;\\|[    ]*$&quot;&#xA;        paragraph-separate &quot;[     ]*$&quot;))&#xA;(add-hook 'org-mode-hook #'my-org-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8300" LastEditorUserId="17007" LastEditDate="2017-09-20T21:23:05.773" LastActivityDate="2017-09-20T21:23:05.773" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16602" PostTypeId="2" ParentId="16587" CreationDate="2015-09-14T14:27:16.053" Score="2" Body="&lt;p&gt;It seems that there is no command to do what you want, but in emacs we can have our way&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have wrote a small shell script based on the tangle &lt;a href=&quot;http://orgmode.org/org.html#Batch-execution&quot; rel=&quot;nofollow&quot;&gt;example&lt;/a&gt;  in the emacs manual&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;# -*- mode: shell-script -*-&#xA;#&#xA;# tangle files with org-mode&#xA;#&#xA;DIR=`pwd`&#xA;FILES=&quot;&quot;&#xA;&#xA;# wrap each argument in the code required to call tangle on it&#xA;for i in $@; do&#xA;FILES=&quot;$FILES \&quot;$i\&quot;&quot;&#xA;done&#xA;&#xA;emacs -Q --batch \&#xA;--eval &quot;(progn&#xA;     (require 'org)(require 'org-table)&#xA;     (mapc (lambda (file)&#xA;            (find-file (expand-file-name file \&quot;$DIR\&quot;))&#xA;            (org-table-map-tables 'org-table-align)&#xA;            (write-file file nil)&#xA;            (kill-buffer)) '($FILES)))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Be aware that the script overwrites the original file&lt;/p&gt;&#xA;" OwnerUserId="8289" LastActivityDate="2015-09-14T14:27:16.053" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16603" PostTypeId="2" ParentId="16596" CreationDate="2015-09-14T14:37:28.170" Score="1" Body="&lt;p&gt;Sounds like a bug.  If you see this behavior when you start Emacs without an init file (emacs -Q), then consider reporting the problem: M-x report-emacs-bug. If you do not see it from emacs -Q, then recursively bisect your init file to locate the problem it introduces.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-14T14:37:28.170" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16604" PostTypeId="2" ParentId="3912" CreationDate="2015-09-14T14:46:55.327" Score="11" Body="&lt;p&gt;Some themes change faces for no good reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you are using &lt;code&gt;Solarized&lt;/code&gt; theme add code below before loading it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq solarized-use-variable-pitch nil&#xA;      solarized-scale-org-headlines nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6596" LastActivityDate="2015-09-14T14:46:55.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16605" PostTypeId="1" AcceptedAnswerId="16606" CreationDate="2015-09-14T14:47:31.993" Score="7" ViewCount="2990" Body="&lt;p&gt;I have just started using Melpa, and I installed the first package. The package though goes to the folder &lt;/p&gt;&#xA;&#xA;&lt;p&gt;~/Library/Preferences/Aquamacs Emacs/Pakcages/elpa/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I would prefer if it went to my .emacs.d/packages folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do that or is it not advisable for some reason? If not advisable, is there a way to ensure that if I use another computer that I still have that package installed so that the configurations are the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I put on my .emacs file to get Melpa working as per &lt;a href=&quot;https://emacs.stackexchange.com/a/15274/9416&quot;&gt;this answer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Package installation - MELPA&#xA;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9416" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-09-14T14:58:16.123" Title="How can I change the installation folder for Melpa packages?" Tags="|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16606" PostTypeId="2" ParentId="16605" CreationDate="2015-09-14T14:58:16.123" Score="12" Body="&lt;p&gt;You want to change the variable &lt;code&gt;package-user-dir&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-user-dir &quot;~/.emacs.d/packages&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Change this setting before calling &lt;code&gt;(package-initialize)&lt;/code&gt; or anything involving loading or installing packages, but after &lt;code&gt;(require 'package)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How I found this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;a href=&quot;https://github.com/emacs-helm/helm&quot;&gt;Helm&lt;/a&gt;, which makes it easy to search through Emacs's functions and variables. I called &lt;code&gt;describe-variable&lt;/code&gt; with &lt;code&gt;C-h v&lt;/code&gt; and searched for &lt;code&gt;package dir&lt;/code&gt;, and the variable came up. Without Helm, I would use the command &lt;code&gt;apropos-variable&lt;/code&gt; and search for the same thing.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-09-14T14:58:16.123" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16608" PostTypeId="1" CreationDate="2015-09-14T15:21:56.060" Score="0" ViewCount="206" Body="&lt;p&gt;How do I get Emacs to always remember the last compile-command? My compile-command (cc) in Emacs 24 settings is pure vanilla, no bells and whistles. I only changed the cc string itself (&quot;python build.py&quot;), and I sometimes type a different cc by hand and run it. But then Emacs tries to be helpful and remember a cc based on different buffers, it seems quite randomly. For example I change directory in dired and I get a compile command that is completely unrelated to what I am trying to do. Is there a way to disable compile-command helpfulness feature so it only remembers the last one? BTW, I usually get the last cc, but sometimes the feature freaks out.&lt;/p&gt;&#xA;" OwnerUserId="9526" LastEditorDisplayName="user227" LastEditDate="2015-09-14T19:14:56.633" LastActivityDate="2015-09-14T19:14:56.633" Title="Always remember last compile-command?" Tags="|compilation|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16609" PostTypeId="2" ParentId="13466" CreationDate="2015-09-14T16:27:48.467" Score="2" Body="&lt;p&gt;To restrict iedit to a region, first you need to activate iedit-mode, then select a region and call iedit-mode again:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x iedit-mode&lt;/code&gt; to enter iedit-mode as you normally would.&lt;/li&gt;&#xA;&lt;li&gt;Select the region you want.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x iedit-mode&lt;/code&gt; again to restrict iedit to the selected region.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;iedit-toggle-selection&lt;/code&gt; can be used to unselect the occurence at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In spacemacs, use &lt;code&gt;SPC s e&lt;/code&gt; instead of &lt;code&gt;M-x iedit-mode&lt;/code&gt;.&lt;br&gt;&#xA;Technical note: &lt;code&gt;SPC s e&lt;/code&gt; calls &lt;code&gt;evil-iedit-state/iedit-mode&lt;/code&gt;, which in turn calls &lt;code&gt;iedit-mode&lt;/code&gt; - this is done for integration with evil)&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-09-14T16:27:48.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16610" PostTypeId="1" CreationDate="2015-09-14T16:56:43.803" Score="6" ViewCount="3936" Body="&lt;p&gt;Org agenda shows tasks only on the scheduled date, not when those tasks were actually one. There are two cases that I see here:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;1. Tasks not done on day scheduled&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If a task is scheduled for Sunday, but marked DONE on Monday, the task will be shown in the agenda (as DONE) for Sunday. This task -- if put into a file listed in &lt;code&gt;org-agenda-files&lt;/code&gt; -- will show the behavior:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;* DONE this shows up in agenda on Sunday, but not Monday.&#xA;CLOSED: [2015-09-14 Mon 12:22] SCHEDULED: &amp;lt;2015-09-13 Sun&amp;gt;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;2. Recurring tasks that have ever been done&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A recurring task shows up (as TODO) on the date it's scheduled on and any dates it will recur on. But it won't show up (as DONE) on dates it was DONE on. This task shows the behavior:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;* TODO this task shows up on Monday, and every day after, but not the Sunday it was done on.&#xA;SCHEDULED: &amp;lt;2015-09-14 Mon +1d&amp;gt;&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2015-09-13 Sun 23:59]&#xA;:PROPERTIES:&#xA;:LAST_REPEAT: [2015-09-13 Sun 12:26]&#xA;:END:&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;hr /&gt;&#xA;&#xA;&lt;p&gt;I think these two things are the same behavior -- show tasks as DONE on days they were done on, nevermind when they were scheduled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could possibly make a custom view that contains, for a given set of dates, all tasks scheduled for those dates, and all tasks done on those dates, but that would basically be a reimplementation of org agenda. I'd also lose out on all the features built around the agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The org documentation seems to hint that this is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Repeated-tasks.html&quot; rel=&quot;noreferrer&quot;&gt;not customizable&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As a consequence of shifting the base date [by marking a repeating&#xA;  task done], this entry will no longer be visible in the agenda when&#xA;  checking past dates, but all future instances will be visible.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-09-15T22:04:43.343" LastActivityDate="2016-10-17T06:52:52.873" Title="In org mode, how do I make DONE tasks show up each time they've been DONE?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16611" PostTypeId="1" CreationDate="2015-09-14T18:32:43.813" Score="6" ViewCount="1466" Body="&lt;p&gt;Could someone explain in a very general sense how EMMS is intended to be used?  I am a refugee from the world of GUI music players and perhaps my mind has been warped by that.  But I haven't been able to understand from the official documentation the basic idea of what functions to call at what time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am generally pretty Emacs-literate, and have installed EMMS.  I've managed to get tracks playing by a kind of process of trial and error.  I've even managed to fumble my way to creating a playlist and saving it.  But I haven't figured out how to re-load it later and use it again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that the playlist is the central abstraction in EMMS, and I gather that your whole library is basically a playlist (?) but I'm not sure where to go from there, or how to use it on a &quot;day-to-day&quot; basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have, for example, a playlist that I've saved, it seems like maybe the idea is that I have to first do &lt;code&gt;emms-playlist-new&lt;/code&gt; to create an empty buffer to hold the saved playlist, then I have to be in that buffer and do &lt;code&gt;emms-insert-m3u-playlist&lt;/code&gt; (or similar, depending on the type of the playlist) and then I can use the playlist -- though the lines are just the file names, not track name, artist name, etc.  Is this really the way EMMS is intended to be used, or am I missing something that makes it simpler?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help....&lt;/p&gt;&#xA;" OwnerUserId="9528" LastActivityDate="2022-08-08T17:17:06.763" Title="How do you actually use EMMS?" Tags="|emms|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16612" PostTypeId="1" AcceptedAnswerId="16653" CreationDate="2015-09-14T19:43:40.270" Score="2" ViewCount="325" Body="&lt;p&gt;with &lt;code&gt;(ido-switch-buffer)&lt;/code&gt;, when I type &lt;code&gt;stuff&lt;/code&gt;, &lt;code&gt;&quot;*magit: stuff*&quot;&lt;/code&gt; comes before &lt;code&gt;Stuff.txt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the sorting seems to be done by recency, rather than the buffer name. more generally, a custom sort function would be nice. &lt;/p&gt;&#xA;" OwnerUserId="2239" LastEditorUserId="2239" LastEditDate="2015-09-14T20:44:33.130" LastActivityDate="2020-04-09T10:10:47.553" Title="How to put buffers named with an asterisk at the end of ido's selection list?" Tags="|ido|sorting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16613" PostTypeId="2" ParentId="10745" CreationDate="2015-09-14T20:43:05.007" Score="0" Body="&lt;p&gt;I will consider this as a system-specific issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I saw this issue on RHEL 5. But I don't see this anymore on RHEL 6.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the emacs built from the git master branch today, &lt;code&gt;M-x emacs-version&lt;/code&gt; returns,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2015-09-14&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;lsb_release -a&lt;/code&gt; returns,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;LSB Version:    :base-4.0-amd64:base-4.0-ia32:base-4.0-noarch:core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch&lt;br&gt;&#xA;  Distributor ID: RedHatEnterpriseWorkstation&lt;br&gt;&#xA;  Description:    Red Hat Enterprise Linux Workstation release 6.6 (Santiago)&lt;br&gt;&#xA;  Release:        6.6&lt;br&gt;&#xA;  Codename:       Santiago&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-09-14T20:43:05.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16614" PostTypeId="1" AcceptedAnswerId="16643" CreationDate="2015-09-14T23:49:32.980" Score="3" ViewCount="1439" Body="&lt;p&gt;I'm asking for several tips to make editing lisp like languages in evil mode better. In particular there is one feature that I would really like but couldn't manage to get it to work. For example given the following code (cursor is indicated by |):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(line| of code&#xA;    (other line of code))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to delete the whole expression with dd (which normally would delete only the line I'm in). Basically I would like to operate on expressions rather then on lines for all the evil commands that are working on lines normally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &#xA;For anyone interested &lt;a href=&quot;https://github.com/luxbock/evil-cleverparens&quot; rel=&quot;nofollow&quot;&gt;evil-cleverparens&lt;/a&gt; looks interesting, too and it has a list of other similar packages at the end of the README.&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-16T17:51:30.363" LastActivityDate="2015-09-16T17:51:30.363" Title="Make evil-mode more lisp friendly?" Tags="|evil|text-editing|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16615" PostTypeId="2" ParentId="16612" CreationDate="2015-09-15T00:14:22.300" Score="1" Body="&lt;p&gt;If you want just for ido locally and not across tramp listings, then try this function that was &lt;a href=&quot;http://www.emacswiki.org/emacs/InteractivelyDoThings&quot; rel=&quot;nofollow&quot;&gt;originally made&lt;/a&gt; for buffers with @ in names and I modified for * in names:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ido-sort-on-stars-to-end ()&#xA;    (message ido-current-directory)&#xA;    (setq ido-temp-list&#xA;        (sort ido-temp-list&#xA;            (lambda (a b)&#xA;              if (not (or (char-equal (string-to-char a) ?*) (char-equal (string-to-char b) ?*)))&#xA;            (time-less-p&#xA;             (sixth (file-attributes (concat ido-current-directory b))&#xA;                    (sixth (file-attributes (concat ido-current-directory a)))))&#xA;             nil)))&#xA;                  (ido-to-end&#xA;                   (delq nil (mapcar&#xA;                              (lambda (x) (and (string-match-p &quot;^\\..&quot; x) x))&#xA;                              ido-temp-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-15T00:14:22.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16616" PostTypeId="2" ParentId="14763" CreationDate="2015-09-15T01:29:00.967" Score="25" Body="&lt;p&gt;The full sequence of steps that worked for me:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;From the command line:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Run emacs without loading the init file: &lt;code&gt;emacs -q&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;In emacs:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;run &lt;code&gt;C-u M-x org-reload&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;package-list-packages&lt;/code&gt; to uninstall &lt;code&gt;org&lt;/code&gt;: select it then &lt;code&gt;d x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;package-list-packages&lt;/code&gt; to reinstall &lt;code&gt;org&lt;/code&gt;: select it then &lt;code&gt;i x&lt;/code&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After restarting emacs, everything worked. &lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2015-09-15T01:29:00.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16617" PostTypeId="1" CreationDate="2015-09-15T03:52:06.573" Score="4" ViewCount="1273" Body="&lt;p&gt;I'm running a &lt;code&gt;(start-process)&lt;/code&gt; which spits out terminal escape codes into a buffer and it looks ugly. Is there a mode that will interpret these codes into colors? Something similar to whatever &lt;code&gt;ansi-term&lt;/code&gt; does?&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="25" LastEditDate="2017-06-03T21:27:33.013" LastActivityDate="2017-06-03T22:26:19.407" Title="Interpret terminal escape codes in generic process output" Tags="|ansi-term|subprocess|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16619" PostTypeId="2" ParentId="16614" CreationDate="2015-09-15T04:17:04.877" Score="3" Body="&lt;p&gt;Not exactly what you want, but this is what I use:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; textobject for the sexp immediately before/after point&#xA;(defun my/evil-next-thing (count &amp;amp;optional beg end type inclusive)&#xA;  (ignore-errors&#xA;    (save-excursion&#xA;      (call-interactively 'sp-select-next-thing count)&#xA;      (if (&amp;gt; (point) (mark))&#xA;          (exchange-point-and-mark))&#xA;      ;; check, it doesn't make sense to take the &quot;inside&quot; of a symbol&#xA;      (if (or inclusive&#xA;              (not (and&#xA;                    (string-match&#xA;                     (string (char-after (point)))&#xA;                     &quot;[^[:punct:]([{]&quot;)&#xA;                    (string-match&#xA;                     (string (char-before (mark)))&#xA;                     &quot;[^[:punct:])\]}]&quot;))))&#xA;          (evil-range (point) (mark))&#xA;        (evil-range (1+ (point)) (1- (mark)))))))&#xA;&#xA;(evil-define-text-object evil-a-next-thing (count &amp;amp;optional beg end type)&#xA;  &quot;Select the range defined by sp-select-next-thing.&quot;&#xA;  (my/evil-next-thing count beg end type t))&#xA;(evil-define-text-object evil-i-next-thing (count &amp;amp;optional beg end type)&#xA;  &quot;Select the range defined by sp-select-next-thing.&quot;&#xA;  (my/evil-next-thing count beg end type))&#xA;&#xA;(define-key evil-outer-text-objects-map &quot;n&quot; #'evil-a-next-thing)&#xA;(define-key evil-inner-text-objects-map &quot;n&quot; #'evil-i-next-thing)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: This requires the &lt;code&gt;smartparens&lt;/code&gt; package.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To delete your expression, you would use &lt;kbd&gt;0dan&lt;/kbd&gt;, which is admittedly a bit longer, but it's a far less intrusive modification to &lt;code&gt;evil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-09-15T04:17:04.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16620" PostTypeId="1" CreationDate="2015-09-15T04:19:48.443" Score="0" ViewCount="68" Body="&lt;p&gt;I'd like to add another system to set the major modes of file visiting buffers. To do so, I need to know if any of the existing major mode setting systems know how to set the mode, and do my thing only when they do not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell if Emacs already knows how to set the mode for a given buffer?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-09-15T04:19:48.443" Title="Determine if emacs knows the mode for a file" Tags="|major-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16621" PostTypeId="2" ParentId="16614" CreationDate="2015-09-15T06:41:23.140" Score="2" Body="&lt;p&gt;&lt;code&gt;di(&lt;/code&gt; or &lt;code&gt;da(&lt;/code&gt; that's not lisp specific stuff, just vim/evil text objects. &lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-09-15T06:41:23.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16622" PostTypeId="1" AcceptedAnswerId="16645" CreationDate="2015-09-15T09:23:49.757" Score="2" ViewCount="2594" Body="&lt;p&gt;I am trying to delete all HTML style comments from my current buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a solution in &quot;&lt;a href=&quot;https://emacs.stackexchange.com/questions/5441/function-to-delete-all-comments-from-a-buffer-without-moving-them-to-kill-ring&quot;&gt;Function to delete all comments from a buffer, without moving them to kill ring&lt;/a&gt;&quot;, but since it is more than two lines, &lt;code&gt;M-x eval-expression&lt;/code&gt; does not work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I evaluate a multiline elisp expression?&lt;/p&gt;&#xA;" OwnerUserId="8629" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-06-22T20:27:21.180" Title="How do I eval a multiple line elisp expression inside the current buffer?" Tags="|eval-expression|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16623" PostTypeId="1" CreationDate="2015-09-15T10:22:48.727" Score="2" ViewCount="719" Body="&lt;p&gt;&lt;strong&gt;Context&lt;/strong&gt; When exporting Org-Mode documents to LaTeX it is possible to specifcy additional LaTeX header commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_HEADER: \subtitle{This is a subtitle}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using org-publish it is possible to specify some more advanced exporting options.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-publish-project-alist&#xA;  '(&#xA;    (&quot;text&quot;&#xA;     :base-directory &quot;~/somedir&quot;&#xA;     :base-extension &quot;org&quot;&#xA;     :publishing-directory &quot;~/somedir&quot;&#xA;     :preparation-function somepreparationfunction&#xA;     :completion-function  somecompletionfunction&#xA;     :publishing-function org-latex-publish-to-pdf&#xA;     :include (&quot;somedocument.org&quot;)&#xA;     :exclude &quot;\\.org$&quot;&#xA;     :latex-class &quot;scrartcl&quot;&#xA;     :headline-levels 5&#xA;     :with-toc nil&#xA;     :select-tags (&quot;Text&quot;)&#xA;     )&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I can see it's usually possible to specify each options either in the Org-Mode document or in the &lt;code&gt;org-publish-project-alist&lt;/code&gt; data structure. But &lt;code&gt;:latex-header&lt;/code&gt; does not seem to be recognized altough it is specified in &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=lisp/ox-latex.el;hb=HEAD&quot; rel=&quot;nofollow&quot;&gt;lisp/ox-latex.el (HEAD)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; How do I specify additional LaTeX header commands in the &lt;code&gt;org-publish-project-alist&lt;/code&gt;, i.e. being able to specify them seperately in the case of multiple publishing projects for the same document?&lt;/p&gt;&#xA;" OwnerUserId="6890" LastActivityDate="2015-09-22T18:41:52.410" Title="org-publish-project-alist: :latex-header" Tags="|org-mode|org-export|org-publish|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16624" PostTypeId="2" ParentId="16622" CreationDate="2015-09-15T10:24:42.180" Score="4" Body="&lt;p&gt;I guess you mean &lt;kbd&gt;M-x eval-expression&lt;/kbd&gt;, because &lt;code&gt;eval&lt;/code&gt; is not&#xA;interactive function (command).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;define temporary function in &lt;code&gt;*scratch*&lt;/code&gt; and then call it or&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;write everything you need in &lt;code&gt;*scratch*&lt;/code&gt;, kill it and yank into minibuffer&#xA;of &lt;code&gt;eval-expression&lt;/code&gt; or&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;use &lt;kbd&gt;C-q C-j&lt;/kbd&gt; to insert new lines in minibuffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-15T10:24:42.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16625" PostTypeId="2" ParentId="16622" CreationDate="2015-09-15T10:27:05.707" Score="1" Body="&lt;p&gt;I'm not sure if I understand your question correctly but if you just want to have a command to delete the comments you can take the code from your referenced answer and wrap it in a function like this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-comments ()&#xA;  (interactive)&#xA;  (save-excursion &#xA;    (goto-char (point-min))&#xA;    (let (kill-ring)&#xA;      (comment-kill (count-lines (point-min) (point-max))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;(interactive)&lt;/code&gt; expression makes this function a command which means you can call it from &lt;code&gt;M-x&lt;/code&gt; or use a keybinding for it. The &lt;code&gt;save-excursion&lt;/code&gt; will restore the position of the point after the function is evaluated. If you want to use that command more then once you can add it to your &lt;code&gt;init&lt;/code&gt; file and if you want a keybdinding for it you would add something like the following to the &lt;code&gt;init&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x #&quot;) 'delete-comments)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you just have a temproary use for this you can put the function in your &lt;code&gt;*scratch*&lt;/code&gt; buffer and &lt;code&gt;M-x eval-buffer&lt;/code&gt; after that go to your html buffer and call &lt;code&gt;M-x delete-comments&lt;/code&gt;. Hope that helps. &lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-15T10:39:29.197" LastActivityDate="2015-09-15T10:39:29.197" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16626" PostTypeId="2" ParentId="16611" CreationDate="2015-09-15T10:46:16.897" Score="2" Body="&lt;p&gt;As for track name etc, you'll want to require &lt;code&gt;emms-info&lt;/code&gt; and one or more of the &lt;code&gt;emms-info-*&lt;/code&gt; modules (&lt;code&gt;emms-info-mp3info&lt;/code&gt;, &lt;code&gt;emms-info-ogginfo&lt;/code&gt; etc), and also make sure that the corresponding command line tools are installed (see if you can run &lt;code&gt;mp3info&lt;/code&gt; in the terminal). Then add &lt;code&gt;emms-info-initialize-track&lt;/code&gt; to &lt;code&gt;emms-track-initialize-functions&lt;/code&gt;. (The setup function &lt;code&gt;emms-standard&lt;/code&gt; attempts to do all of this for you.)&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-09-15T10:46:16.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16627" PostTypeId="2" ParentId="16586" CreationDate="2015-09-15T12:14:32.823" Score="3" Body="&#xA;&#xA;&lt;p&gt;Look before you leap!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can write a custom function which will look for non word characters followed by a new line before next word. On such condition go to end of line other wise run normal word forward.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-forward-word ()&#xA;  (interactive)&#xA;  (if (looking-at &quot;\\W+\n&quot;)&#xA;      (when (search-forward-regexp &quot;\n&quot; nil 'noerror)&#xA;        (goto-char (match-beginning 0)))&#xA;    (forward-word)))&#xA;&#xA;(global-set-key (kbd &quot;M-f&quot;) 'my-forward-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be simplified futher using &lt;code&gt;forward-sexp&lt;/code&gt; as mentioned by @Name&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-forward-word ()&#xA;  (interactive)&#xA;  (if (looking-at &quot;\\W+\n&quot;)&#xA;      (forward-sexp)&#xA;    (forward-word)))&#xA;&#xA;(global-set-key (kbd &quot;M-f&quot;) 'my-forward-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="115" LastEditDate="2015-10-07T13:03:57.353" LastActivityDate="2015-10-07T13:03:57.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16630" PostTypeId="2" ParentId="16622" CreationDate="2015-09-15T14:51:53.667" Score="2" Body="&lt;p&gt;&lt;code&gt;M-x eval-expression&lt;/code&gt;, aka &lt;code&gt;M-:&lt;/code&gt; evaluates a multiline expression just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And besides pasting a multiline sexp into the minibuffer, you can insert a newline char there using &lt;code&gt;C-q C-j&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-15T14:51:53.667" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16631" PostTypeId="2" ParentId="16593" CreationDate="2015-09-15T16:13:56.553" Score="0" Body="&lt;p&gt;There are accessor functions in bbdb3 for extracting certain part of the record:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bbdb-record-name record)&#xA;(bbdb-record-firstname record)&#xA;(bbdb-record-lastname record)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They are defined in bbdb.el&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-09-16T07:40:53.243" LastActivityDate="2015-09-16T07:40:53.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16632" PostTypeId="1" AcceptedAnswerId="16635" CreationDate="2015-09-15T16:56:41.967" Score="4" ViewCount="734" Body="&lt;p&gt;I set this in helm&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-split-window-in-side-p nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This forces helm to use selected window for helm session like this(When point is in right split, helm buffer popped in left split only).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/haMx3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/haMx3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when I use &lt;code&gt;swiper-helm&lt;/code&gt;, it doesn't honor this. It will open helm session in different split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make swiper-helm and all other packages which use helm as frontend (like helm-recent-dirs, helm-github-stars), to use custom helm config?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="2264" LastEditDate="2016-02-22T19:44:39.930" LastActivityDate="2016-02-22T19:44:39.930" Title="How to make swiper-helm to use helm layout?" Tags="|helm|helm-selection|swiper|swiper-helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16633" PostTypeId="5" CreationDate="2015-09-15T16:59:26.190" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/swiper-helm&quot; rel=&quot;nofollow&quot;&gt;https://github.com/abo-abo/swiper-helm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-15T18:02:16.067" LastActivityDate="2015-09-15T18:02:16.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16634" PostTypeId="4" CreationDate="2015-09-15T16:59:26.190" Score="0" Body="Helm version of swiper. Swiper package for GNU Emacs that gives you an overview as you search for a regex." OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-15T20:05:31.903" LastActivityDate="2015-09-15T20:05:31.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16635" PostTypeId="2" ParentId="16632" CreationDate="2015-09-15T17:13:43.947" Score="3" Body="&lt;p&gt;You need to customize &lt;code&gt;swiper-helm-display-function&lt;/code&gt;.  In &lt;code&gt;swiper-helm&lt;/code&gt;, &lt;code&gt;helm-display-function&lt;/code&gt; is let-bound to &lt;code&gt;swiper-helm-display-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should be as simple as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq swiper-helm-display-function 'helm-default-display-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for other commands that you asked about, it's likely that they bind &lt;code&gt;helm-display-function&lt;/code&gt; as well.  Just examine their code and change the corresponding defcustom.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-09-15T17:13:43.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16636" PostTypeId="2" ParentId="2347" CreationDate="2015-09-15T17:27:43.620" Score="1" Body="&lt;p&gt;Since you want to do it with minimal key strokes, you can use David Andersson's excellent &lt;a href=&quot;http://www.emacswiki.org/emacs/key-chord.el&quot; rel=&quot;nofollow&quot;&gt;key-chord&lt;/a&gt; package. A &quot;key chord&quot; is two keys pressed simultaneously,&#xA;or a single key pressed twice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can bind any key chords to those functions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'key-chord)&#xA;(key-chord-mode 1)&#xA;(key-chord-define-global &quot;dd&quot;  'kill-whole-line)&#xA;(key-chord-define-global &quot;cc&quot;  'yank-whole-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-15T17:27:43.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16637" PostTypeId="1" CreationDate="2015-09-15T17:47:39.503" Score="40" ViewCount="27456" Body="&lt;p&gt;When setting up my emacs for a new work environment, I am unable to get the elpy configuration to correctly use python 3. I have installed all of the required packages in &lt;code&gt;/usr/local/bin&lt;/code&gt; and have installed them using python3. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, when I run elpy-config I am getting the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Virtualenv........: None&#xA;RPC Python........: 2.7.6 (/usr/bin/python)&#xA;Interactive Python: python (/usr/bin/python)&#xA;Emacs.............: 24.5.1&#xA;Elpy..............: 1.9.0&#xA;Jedi..............: 0.9.0&#xA;Rope..............: Not found (0.10.2 available)&#xA;Importmagic.......: 0.1.3&#xA;Autopep8..........: 0.1.3&#xA;Syntax checker....: Not found (pyflakes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to have RPC Python be ipython3 and the same for the interactive. For the purposes of this question, assume my .emacs file is blank. &lt;/p&gt;&#xA;" OwnerUserId="9537" LastEditorUserId="12534" LastEditDate="2018-08-01T14:18:32.210" LastActivityDate="2019-10-13T14:02:51.163" Title="How to set up elpy to use python3?" Tags="|python|osx|ipython|elpy|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="16638" PostTypeId="2" ParentId="16637" CreationDate="2015-09-15T18:09:24.020" Score="28" Body="&lt;p&gt;You can conffigure &lt;code&gt;elpy-rpc-python-command&lt;/code&gt;. If you want Python3 you can set it like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq elpy-rpc-python-command &quot;python3&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create python3 virtualenv using virtualenvwrapper from terminal&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ mkvirtualenv test -p /usr/bin/python3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then install required packages&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ pip install rope jedi importmagic autopep8 flake8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now go to emacs, activate virtualenv and run &lt;code&gt;M-x elpy-config&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x pyvenv-workon test&#xA;M-x elpy-config&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to have &lt;code&gt;ipython&lt;/code&gt; as your REPL, you can put this function in you config&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(elpy-use-ipython)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(elpy-use-ipython &quot;python3&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: &lt;code&gt;elpy-use-ipython&lt;/code&gt; is deprecated. Use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;IPY_TEST_SIMPLE_PROMPT&quot; &quot;1&quot;)&#xA;(setq python-shell-interpreter &quot;ipython3&quot;&#xA;      python-shell-interpreter-args &quot;-i&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;code&gt;ipython&lt;/code&gt; based on your version.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2018-06-02T10:53:23.360" LastActivityDate="2018-06-02T10:53:23.360" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="16639" PostTypeId="2" ParentId="14416" CreationDate="2015-09-15T19:32:14.027" Score="2" Body="&lt;p&gt;Not sure if this is really what you want but I wrote a keyboard macro that will turn a line like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   CLOCK: [2015-08-01 Sat 19:33]--[2015-08-01 Sat 19:33] =&amp;gt;  0:00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2015-08-01 Sat 19:33,2015-08-01 Sat 19:33,0:00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use it, eval this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq last-kbd-macro&#xA;   [?\C-a ?\M-z ?\[ ?\C-s ?\] ?\C-r ?\C-m ?\M-z ?\[ ?, ?\C-s ?\] ?\C-r ?\C-m ?\C-u ?\C-d ?\M-  ?\C-? ?, ?\C-n ?\C-a])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;M-:&lt;/code&gt; is the key to eval) and then run the macro with &lt;code&gt;C-x e&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a more verbose breakdown of the macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-a         ;; move-beginning-of-line&#xA;M-z         ;; zap-to-char&#xA;[           ;; self-insert-command&#xA;C-s         ;; isearch-forward&#xA;]           ;; self-insert-command&#xA;C-r         ;; isearch-backward&#xA;RET         ;; help-follow&#xA;M-z         ;; zap-to-char&#xA;[           ;; self-insert-command&#xA;,           ;; self-insert-command&#xA;C-s         ;; isearch-forward&#xA;]           ;; self-insert-command&#xA;C-r         ;; isearch-backward&#xA;RET         ;; help-follow&#xA;C-u C-d         ;; delete-char&#xA;M-SPC           ;; just-one-space&#xA;DEL         ;; scroll-down-command&#xA;,           ;; self-insert-command&#xA;C-n         ;; next-line&#xA;C-a         ;; move-beginning-of-line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user9514" LastActivityDate="2015-09-15T19:32:14.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16640" PostTypeId="1" AcceptedAnswerId="16883" CreationDate="2015-09-15T19:56:36.880" Score="30" ViewCount="13079" Body="&lt;p&gt;I have an org file with multiple tables &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat ~/foo.org&#xA;#+Title: hello world&#xA;&#xA;* section 1&#xA;&#xA;lorem ipsum&#xA;&#xA;#+TBLNAME: first-table&#xA;| i      | want | to    |&#xA;| export | this | table |&#xA;&#xA;#+TBLNAME: second-table&#xA;| this | table | is        |&#xA;| not  | as    | important |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This file is updated regularly. I have a perl script that parses the &lt;code&gt;csv&lt;/code&gt; file obtained from issuing &lt;code&gt;M-x org-table-export&lt;/code&gt; on &lt;code&gt;first-table&lt;/code&gt;. I would like to be able to export &lt;code&gt;first-table&lt;/code&gt; to csv from the command line so I don't have to do this manually every time. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2023-12-07T13:13:09.097" Title="Can I export a specific table in an org file to csv from the command line?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16641" PostTypeId="1" CreationDate="2015-09-15T20:03:28.833" Score="16" ViewCount="4551" Body="&lt;p&gt;What packages are available for modal editing in Emacs? What do you use and why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Let's try to post one package per answer. I propose mention advantages and&#xA; shortcomings of every package.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is my definition of modal editing (I couldn't find dedicated Wikipeadia&#xA;article):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Modal editing&lt;/em&gt; — style of text editing when user periodically switches&#xA;usually between “normal mode” when keys do not cause inserting of their&#xA;characters but perform various operations on text and “insert mode” when&#xA;keys insert corresponding characters. There may be more modes, of course.&#xA;Most modern editors are not modal. An example of modal text editor is Vi&#xA;(Vim).&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2710" LastEditDate="2017-12-09T15:44:09.457" LastActivityDate="2021-04-30T07:22:35.923" Title="What packages are available for modal editing?" Tags="|key-bindings|prefix-keys|" AnswerCount="9" CommentCount="2" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 3.0" />
  <row Id="16642" PostTypeId="2" ParentId="16641" CreationDate="2015-09-15T20:20:43.620" Score="13" Body="&lt;h1&gt;&lt;a href=&quot;https://bitbucket.org/lyro/evil/wiki/Home&quot;&gt;&lt;code&gt;evil&lt;/code&gt;&lt;/a&gt;, the &lt;em&gt;E&lt;/em&gt;xtensible &lt;em&gt;VI&lt;/em&gt; &lt;em&gt;L&lt;/em&gt;ayer for Emacs&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Questionable name aside, &lt;code&gt;evil&lt;/code&gt; is the current state-of-the art when it comes to &lt;code&gt;vim&lt;/code&gt; emulation in Emacs (and possibly anywhere else, for that matter). It supports a lot of features that other Vim emulation packages eschew, including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;vim&lt;/code&gt; textobjects&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;vim&lt;/code&gt; registers&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;vim&lt;/code&gt; keyboard macros&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ex&lt;/code&gt; commands&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Advantages&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Key compatibility with &lt;code&gt;vim&lt;/code&gt; means &lt;strong&gt;you don't lose your muscle memory when switching to systems without Emacs.&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Very mature and widely used (lots of community packages, for example)&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Many package for &lt;code&gt;vim&lt;/code&gt; have been ported to &lt;code&gt;evil&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;vim&lt;/code&gt; style grammar is modular and lends itself very well to user extension&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil&lt;/code&gt; itself is very extensible: make your own textobjects, operators, and motions!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Disadvantages&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Will probably require some fiddling to make it play nice with other packages&lt;/strong&gt; &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Fortunately, &lt;code&gt;evil&lt;/code&gt; makes the most common use-cases ridiculously easy.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil&lt;/code&gt; is a very complex system. Hacking on the evil core can become quite involved.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;vim&lt;/code&gt; keybindings are not necessarily ergonomically optimal. Sometimes, they can feel a little arbitrary when ported to a different system. &lt;/li&gt;&#xA;&lt;li&gt;Hosted on BitBucket (mercurial) make of this what you will. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-09-16T15:16:27.603" LastActivityDate="2015-09-16T15:16:27.603" CommentCount="7" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 3.0" />
  <row Id="16643" PostTypeId="2" ParentId="16614" CreationDate="2015-09-15T20:52:53.157" Score="2" Body="&lt;p&gt;Another potential solution is &lt;a href=&quot;https://github.com/expez/evil-smartparens&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;evil-smartparens&lt;/code&gt;&lt;/a&gt;, which works with &lt;code&gt;smartparens-strict-mode&lt;/code&gt; to ensure that the current file is always balanced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't behave exactly like you specify. For example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;dd&lt;/kbd&gt; (&lt;code&gt;|&lt;/code&gt; stands for the point) on this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let| ((foo 1.01))&#xA;  (frobnicate foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yields this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((foo 1.01))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, you may find that the defaults are well chosen in general, and perhaps they will work for you.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-09-15T20:52:53.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16644" PostTypeId="2" ParentId="16641" CreationDate="2015-09-15T21:19:29.583" Score="13" Body="&lt;p&gt;There is &lt;code&gt;god-mode&lt;/code&gt; (&lt;a href=&quot;https://github.com/chrisdone/god-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/chrisdone/god-mode&lt;/a&gt;), which uses standard Emacs key bindings but removes the need to hold down modifiers. When god-mode is enabled, &lt;code&gt;C-...&lt;/code&gt; bindings require no modifier and &lt;code&gt;M-...&lt;/code&gt; bindings use a prefix rather than a modifier.&lt;/p&gt;&#xA;&lt;p&gt;An example from the GitHub page:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Before: C-p C-k C-n M-^ ) C-j C-y M-r C-x z z M-2 M-g M-g C-x C-s&lt;/p&gt;&#xA;&lt;p&gt;After:    p   k   n g ^ )   j   y g r     . .   2   g   g   x   s&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="32139" LastEditDate="2021-04-30T07:22:35.923" LastActivityDate="2021-04-30T07:22:35.923" CommentCount="3" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 4.0" />
  <row Id="16645" PostTypeId="2" ParentId="16622" CreationDate="2015-09-15T21:25:54.493" Score="3" Body="&lt;p&gt;I assume that the code you want to run is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(goto-char (point-min))&#xA;(let (kill-ring)&#xA;  (comment-kill (count-lines (point-min) (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually, the problem is not that the Lisp code contains multiple &lt;em&gt;lines&lt;/em&gt; — that would work just fine — but that the Lisp code consists of multiple expressions that need to be executed in sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x eval-expression&lt;/code&gt; requires a single expression. If you want to evaluate two expressions successively, the simplest solution, cognitively speaking, is to call &lt;code&gt;M-x eval-expression&lt;/code&gt; twice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eval-expression RET (goto-char (point-min)) RET&#xA;M-x (let (kill-ring) (comment-kill (count-lines (point-min) (point-max)))) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since whitespace isn't significant in Lisp, you can put a space instead of the newline if you're typing the code. If you're copy-pasting, keeping the pasted newline is fine too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a Lisp perspective, the “right” solution would be to put the two expressions into a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Sequencing.html#index-implicit-progn&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;progn&lt;/code&gt; form&lt;/a&gt;. A &lt;code&gt;progn&lt;/code&gt; expression runs each expression in sequence (and returns the value of the last one).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eval-expression RET (progn (goto-char (point-min)) (let (kill-ring) (comment-kill (count-lines (point-min) (point-max))))) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this particular case, there are other solutions that are simpler but don't generalize:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Instead of running &lt;code&gt;(goto-char (point-min))&lt;/code&gt;, use key bindings to move to the beginning of the buffer (&lt;code&gt;C-home&lt;/code&gt; or &lt;code&gt;M-&amp;lt;&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since &lt;code&gt;let&lt;/code&gt; itself allows multiple expressions (&lt;code&gt;let&lt;/code&gt; is like &lt;code&gt;progn&lt;/code&gt;, but first binds some variables), you could write that code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let (kill-ring)&#xA;  (goto-char (point-min))&#xA;  (comment-kill (count-lines (point-min) (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another approach would be to copy the code into the buffer you want to modify, select it, run &lt;code&gt;M-x eval-region&lt;/code&gt;, and finally remove the code. That only works if the code you want to run wouldn't affect itself, and if the buffer is a normal, non-read-only text edition buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're going to use that code more than once, &lt;a href=&quot;https://emacs.stackexchange.com/a/16625&quot;&gt;make it a function and define it in your init file&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-09-15T21:25:54.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16646" PostTypeId="1" CreationDate="2015-09-15T21:37:25.063" Score="8" ViewCount="9428" Body="&lt;p&gt;Very much like &lt;a href=&quot;https://emacs.stackexchange.com/questions/5428/restart-emacs-from-within-emacs&quot;&gt;Restart emacs from within emacs&lt;/a&gt;, except I'd like to do this for an emacs daemon and client.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I'm interested in the terminal client, but of course being able to restart from the graphical client would be cool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: A quick glance at the Emacs source makes it look like stuffing a string to the STDIN of a terminal hosting a client cannot be done. :( Perhaps there's some other way?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-09-15T22:27:12.450" Title="Restart emacs daemon from within emacs" Tags="|terminal-emacs|emacs-daemon|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16647" PostTypeId="1" AcceptedAnswerId="16648" CreationDate="2015-09-15T22:21:06.870" Score="2" ViewCount="68" Body="&lt;p&gt;It seems that whenever I press &lt;code&gt;RET&lt;/code&gt; on my emacs init.el file comment lines that the previous line just randomly indents ~4 tabs. I only have a simple load path (nothing currently in there really except for load path and load org-mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nothing happens when I press &lt;code&gt;C-j&lt;/code&gt; in this position, only RET.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am on Mac OS X 10.10, iTerm 2 using &lt;code&gt;xterm-256color&lt;/code&gt; but I launch &lt;code&gt;emacs -nw&lt;/code&gt; with &lt;code&gt;TERM=xterm-16color&lt;/code&gt; because that is the only way that my colors work correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Gf8Ie.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Gf8Ie.png&quot; alt=&quot;Before RET&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/b3RAy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/b3RAy.png&quot; alt=&quot;After RET&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas of where I should be looking to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2015-09-15T23:06:51.227" Title="Previous Line Indenting on RET" Tags="|emacs24.4|terminal-emacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16648" PostTypeId="2" ParentId="16647" CreationDate="2015-09-15T22:28:10.930" Score="5" Body="&lt;p&gt;Use &lt;code&gt;;;&lt;/code&gt; (or more) instead of &lt;code&gt;;&lt;/code&gt; and this won't happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you're seeing is (in conjunction with &lt;code&gt;electric-indent-mode&lt;/code&gt;) expected behaviour, as by convention&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Comments that start with a single semicolon, ‘;’, should all be aligned to the same column on the right of the source code.  Such comments usually explain how the code on that line does its job.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Comment Tips&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;comment-column&lt;/code&gt; variable determines the level of indentation for this style of comment.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-15T23:06:51.227" LastActivityDate="2015-09-15T23:06:51.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16649" PostTypeId="1" CreationDate="2015-09-16T01:20:43.340" Score="3" ViewCount="109" Body="&lt;p&gt;I often use the command C-x C-q in dired (bound to dired-toggle-read-only) to rename files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use this to change only capitalisation (eg, Foo.bar to foo.bar) then I use C-c C-c to apply the changes (wdired-finish-edit), I get a warning saying &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;File /../../foo.bar already exists; rename to it anyway? (y or n)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I get that I couldn't create two files with the same name if the difference is just the capitalisation, but I believe this warning is not necessary if I am just renaming a file. I think WDired could be made aware of the fact that it is just renaming a file and not creating a new one with the same name. Is there a way to fix this so I don't get the warning if I am just renaming a file with dired-toggle-read-only?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am aware that I can use R on dired to rename a file, but I often change names in bulk, even using the rectangular selection to remove blocks of characters from many file names at once).&lt;/p&gt;&#xA;" OwnerUserId="9416" LastActivityDate="2015-09-16T01:20:43.340" Title="Warning in WDired when renaming files to change capitalisation" Tags="|dired|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16650" PostTypeId="1" AcceptedAnswerId="16655" CreationDate="2015-09-16T02:52:01.293" Score="1" ViewCount="1374" Body="&lt;p&gt;I am trying to use &lt;code&gt;org-mode&lt;/code&gt; for scheduling tasks with a time with no avail. Every time I set it the task is not repeated:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my task I use &lt;code&gt;C-c C-d&lt;/code&gt; and then type in &lt;code&gt;2015-09-15 9:00AM-11:00AM +1w&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is something with my formatting wrong or am I missing something bigger?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastEditorUserId="253" LastEditDate="2015-09-16T14:03:52.277" LastActivityDate="2019-07-05T16:16:24.517" Title="Recurring Tasks Org-mode" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16652" PostTypeId="1" AcceptedAnswerId="16734" CreationDate="2015-09-16T10:37:03.277" Score="4" ViewCount="1006" Body="&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- modes/mu4e/mu4e.org&#xA;      `-data/images/kk.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in file &lt;code&gt;mu4e.org&lt;/code&gt;, when insert link with &lt;code&gt;[C-c C-l]&lt;/code&gt;, the link&#xA;&lt;code&gt;file:../data/images/kk.png&lt;/code&gt; will auto expand to&#xA;&lt;code&gt;file:~/Org/Emacs/modes/data/images/kk.png&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2015-09-18T19:04:31.550" Title="Change the behavior of Org-mode auto expand relative path in link" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16653" PostTypeId="2" ParentId="16612" CreationDate="2015-09-16T11:45:17.980" Score="2" Body="&lt;p&gt;Here is what I use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dash)&#xA;(require 's)&#xA;&#xA;(add-hook 'ido-make-buffer-list-hook 'my/ido-stars-to-end)&#xA;(defun my/ido-stars-to-end ()&#xA;  &quot;Put \&quot;*starred*\&quot; buffers at the end of the ido candidates list.&quot;&#xA;  (ido-to-end (--filter (s-starts-with-p &quot;*&quot; it)&#xA;                        ido-temp-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: as mentioned in a comment, the code above will put all &quot;starred&quot; buffers at the end of the list, even the currently selected one if its name contains an asterisk. A slightly modified version avoiding that effect would be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dash)&#xA;(require 's)&#xA;&#xA;(add-hook 'ido-make-buffer-list-hook 'my/ido-stars-to-end)&#xA;(defun my/ido-stars-to-end ()&#xA;  &quot;Put \&quot;*starred*\&quot; buffers at the end of the ido candidates list.&quot;&#xA;  (ido-to-end (--filter (and (s-starts-with-p &quot;*&quot; it)&#xA;                             (not (equal it (buffer-name))))&#xA;                        ido-temp-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2020-04-09T10:10:47.553" LastActivityDate="2020-04-09T10:10:47.553" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="16654" PostTypeId="1" AcceptedAnswerId="16660" CreationDate="2015-09-16T12:23:55.357" Score="6" ViewCount="1737" Body="&lt;p&gt;I have installed nyan-mode and mode line looks like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rNMZw.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rNMZw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to move nyan cat to end of mode line and arrange all other items like column number, file name, modes to left side leaving empty space in middle. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i re arrange items in mode line?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2019-08-26T13:18:12.940" Title="How to re arrange things in mode line?" Tags="|mode-line|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16655" PostTypeId="2" ParentId="16650" CreationDate="2015-09-16T13:57:58.970" Score="4" Body="&lt;p&gt;I am using Emacs 24.3.1 and Org-mode version 7.9.3f.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;code&gt;C-c C-d&lt;/code&gt; (or &lt;code&gt;C-c C-s&lt;/code&gt;) and then typing in the mini-buffer a date and time period plus &quot;+1w&quot; (or &quot;++1w&quot;) will result in the repeater part being ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it didn't worked, I then go to the created DEADLINE or SCHEDULED and place the repeater:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEADLINE: &amp;lt;2015-09-15 9:00AM-11:00AM ++1w&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9549" LastActivityDate="2015-09-16T13:57:58.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16656" PostTypeId="1" CreationDate="2015-09-16T14:39:51.597" Score="5" ViewCount="1508" Body="&lt;p&gt;How do I debug remote python/twisted code from within Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I got with an internet search was &lt;a href=&quot;http://code.google.com/p/geben-on-emacs/&quot; rel=&quot;noreferrer&quot;&gt;Geben&lt;/a&gt;, if I understand correctly, but it has not been maintained for a few years now.&lt;/p&gt;&#xA;" OwnerUserId="9550" LastEditorUserId="253" LastEditDate="2015-09-16T14:43:04.530" LastActivityDate="2015-10-21T10:39:17.820" Title="Python remote debugging?" Tags="|python|debugging|remote|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16657" PostTypeId="2" ParentId="16641" CreationDate="2015-09-16T14:49:45.403" Score="6" Body="&lt;h1&gt;&lt;a href=&quot;https://github.com/jyp/boon&quot; rel=&quot;nofollow noreferrer&quot;&gt;Boon&lt;/a&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Boon is one of less-known packages for modal editing. It doesn't emulate Vi&#xA;(or Vim) but provides original layout optimized for Colemak keyboard layout.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Advantages and Design Principles&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Spacial allocation first, mnemonics second: the allocation of keys to&#xA;commands is based in priority on the locations of keys on the&#xA;keyboard. Whatever is printed on the key cap is a secondary concern.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Easy finger rolls: common combination should either be left/right hand&#xA;alternation or easy one-hand rolls.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use of home row and strong fingers for the most used commands&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Easy navigation: many commands are bound to navigation. This facilitates&#xA;moving around. Because movements double up as region-definitions, it makes&#xA;manipulation commands (operators) more powerful.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Disadvantages&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to re-learn how to interact with the editor since collection of&#xA;editing primitives and their placement on keyboard are quite unique.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="24181" LastEditDate="2019-11-20T13:14:54.367" LastActivityDate="2019-11-20T13:14:54.367" CommentCount="4" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 4.0" />
  <row Id="16658" PostTypeId="2" ParentId="16654" CreationDate="2015-09-16T15:00:28.383" Score="4" Body="&lt;p&gt;You can use the following code and adjust &lt;code&gt;mode-line-align-left&lt;/code&gt;, &lt;code&gt;mode-line-align-middle&lt;/code&gt; and &lt;code&gt;mode-line-align-right&lt;/code&gt; to your liking.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default mode-line-format&#xA;              (list&#xA;               mode-line-align-left&#xA;               '(:eval (mode-line-fill-center 'mode-line&#xA;                                              (reserve-left/middle)))&#xA;               mode-line-align-middle&#xA;               '(:eval&#xA;                 (mode-line-fill-right 'mode-line&#xA;                                       (reserve-middle/right)))&#xA;               mode-line-align-right&#xA;               ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the code you need to make this work. I don't know where I got this from, the filling functions are taken from powerline if I remember correctly.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mode-line-fill-right (face reserve)&#xA;  &quot;Return empty space using FACE and leaving RESERVE space on the right.&quot;&#xA;  (unless reserve&#xA;    (setq reserve 20))&#xA;  (when (and window-system (eq 'right (get-scroll-bar-mode)))&#xA;    (setq reserve (- reserve 3)))&#xA;  (propertize &quot; &quot;&#xA;              'display `((space :align-to (- (+ right right-fringe right-margin) ,reserve)))&#xA;              'face face))&#xA;&#xA;&#xA;(defun mode-line-fill-center (face reserve)&#xA;  &quot;Return empty space using FACE to the center of remaining space leaving RESERVE space on the right.&quot;&#xA;  (unless reserve&#xA;    (setq reserve 20))&#xA;  (when (and window-system (eq 'right (get-scroll-bar-mode)))&#xA;    (setq reserve (- reserve 3)))&#xA;  (propertize &quot; &quot;&#xA;              'display `((space :align-to (- (+ center (.5 . right-margin)) ,reserve&#xA;                                             (.5 . left-margin))))&#xA;              'face face))&#xA;&#xA;&#xA;&#xA;&#xA;(defconst RIGHT_PADDING 1)&#xA;&#xA;&#xA;(defun reserve-left/middle ()&#xA;  (/ (length (format-mode-line mode-line-align-middle)) 2))&#xA;&#xA;(defun reserve-middle/right ()&#xA;  (+ RIGHT_PADDING (length (format-mode-line mode-line-align-right))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To read more about the formatting rules of the mode line I recommend &lt;a href=&quot;http://www.lunaryorn.com/2014/07/26/make-your-emacs-mode-line-more-useful.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;[&lt;a href=&quot;https://web.archive.org/web/20150327044404/http://www.lunaryorn.com/2014/07/26/make-your-emacs-mode-line-more-useful.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;archive-link&lt;/a&gt;] blog post. Here is a short example how you might want to define &lt;code&gt;mode-line-align-left/middle/right&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-align-left&#xA;      '(&quot;&quot;&#xA;        &quot; &quot;&#xA;        (:propertize &quot;%+ &quot; face mode-line-buffer-id)&#xA;        (:propertize &quot;%b&quot; face mode-line-buffer-id)&#xA;        &quot; &quot;))&#xA;&#xA;(setq mode-line-align-middle&#xA;      '(&quot;&quot;&#xA;        (:propertize (:eval (symbol-name major-mode)) face font-lock-type-face)&#xA;        &quot; &quot;&#xA;        ))&#xA;&#xA;&#xA;(setq mode-line-align-right&#xA;      '(&quot;&quot;&#xA;        (:propertize (:eval (shorten-directory default-directory 30)) face font-lock-string-face)&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2019-08-26T13:18:12.940" LastActivityDate="2019-08-26T13:18:12.940" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="16659" PostTypeId="1" AcceptedAnswerId="16733" CreationDate="2015-09-16T15:01:36.667" Score="6" ViewCount="980" Body="&lt;p&gt;&lt;code&gt;highlight-regexp&lt;/code&gt; is pretty amazing, but when I run it manually by &lt;code&gt;M-x highlight-regexp RET f?o RET 'someface&lt;/code&gt; it only applies the highlight to the current buffer.  How can I apply a highlight to multiple buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly I would like to automatically highlight tabs in all files with a nasty face as I am allergic to them. Can I put something in my init.el to do that?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="50" LastEditDate="2015-09-18T19:36:45.673" LastActivityDate="2015-09-18T20:30:30.537" Title="highlight-regexp in multiple buffers" Tags="|regular-expressions|faces|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16660" PostTypeId="2" ParentId="16654" CreationDate="2015-09-16T15:10:19.480" Score="3" Body="&lt;p&gt;For customizations your describe you're going to have to write your own &lt;code&gt;mode-line-format&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should read the docs for the variable &lt;code&gt;mode-line-format&lt;/code&gt; to understand how to get the information you want into the mode-line. However, there is no left, center, and right justification support for mode-line information by default. You have to write your own by calculating the size of the current window and spacing things out with the right amount of whitespace such that it fills the whole window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most mode-line packages like powerline implement this in an exposed way that you can use if you want to rely on that package. Look at the provided formats that come with powerline and you should be able to deduce how to use powerline to have left, center, and right mode-line information using their api.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you'd like to do it yourself, here is a function that I use to space out items in my mode line to the left, right and center.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun jordon-fancy-mode-line-render (left center right &amp;amp;optional lpad rpad)&#xA;  &quot;Return a string the width of the current window with &#xA;LEFT, CENTER, and RIGHT spaced out accordingly, LPAD and RPAD,&#xA;can be used to add a number of spaces to the front and back of the string.&quot;&#xA;  (condition-case err&#xA;      (let* ((left (if lpad (concat (make-string lpad ?\s) left) left))&#xA;             (right (if rpad (concat right (make-string rpad ?\s)) right))&#xA;             (width (apply '+ (window-width) (let ((m (window-margins))) (list (or (car m) 0) (or (cdr m) 0)))))&#xA;             (total-length (+ (length left) (length center) (length right) 2)))&#xA;        (when (&amp;gt; total-length width) (setq left &quot;&quot; right &quot;&quot;))&#xA;        (let* ((left-space (/ (- width (length center)) 2))&#xA;               (right-space (- width left-space (length center)))&#xA;               (lspaces (max (- left-space (length left)) 1))&#xA;               (rspaces (max (- right-space (length right)) 1 0)))&#xA;          (concat left (make-string lspaces  ?\s)&#xA;                  center&#xA;                  (make-string rspaces ?\s)&#xA;                  right)))&#xA;    (error (format &quot;[%s]: (%s) (%s) (%s)&quot; err left center right))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this is my &lt;code&gt;mode-line-format&lt;/code&gt; which uses the function: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar jordon-mode-line-format&#xA;  '((:eval (jordon-fancy-mode-line-render&#xA;            (format-mode-line (format &quot; %s (%%l/%d) %%c &quot;&#xA;                                      (downcase (format-mode-line mode-name))&#xA;                                      (line-number-at-pos (point-max))))&#xA;            (concat (buffer-name)&#xA;                    (cond&#xA;                     ((not (buffer-file-name)) &quot; &quot;)&#xA;                     ((buffer-modified-p) &quot;*&quot;)&#xA;                     (t &quot; &quot;)))&#xA;            &quot; &quot; 1 3))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this example, I have the mode-name, and cursor position on the left, the buffer name in the middle, and nothing on the right. You could use that as a base to add in the info you need, and put the nyan cat on the left.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a basic mode-line-format that just has the mode-name on the left, buffer-name in the center, and the nyan-cat on the right.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar your-custom-mode-line-format&#xA;  '((:eval (jordon-fancy-mode-line-render&#xA;            (downcase (format-mode-line mode-name))&#xA;            (buffer-name)&#xA;            (nyan-create) &#xA;            1 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which looks like this:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/osF17.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/osF17.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-09-16T15:23:57.037" LastActivityDate="2015-09-16T15:23:57.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16661" PostTypeId="2" ParentId="16659" CreationDate="2015-09-16T15:24:15.417" Score="5" Body="&lt;p&gt;You can solve all your problems with help of built-in minor mode called&#xA;&lt;code&gt;whitespace-mode&lt;/code&gt;. This mode can be set up to highlight lines that are too&#xA;long as well as all sorts of normally “invisible” characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is basic setup that will highlight lines longer 80 characters and tabs:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq&#xA; whitespace-line-column 80&#xA; whitespace-style       '(face lines-tail tabs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To enable it you can use one of these methods:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(whitespace-mode 1)        ; enable locally&#xA;(global-whitespace-mode 1) ; enable everywhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To find out more about things the mode can highlight, see documentation of&#xA;&lt;code&gt;whitespace-style&lt;/code&gt; variable: &lt;kbd&gt;C-h v whitespace-style RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-16T15:24:15.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16662" PostTypeId="2" ParentId="16659" CreationDate="2015-09-16T15:34:28.413" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Highlight&lt;/strong&gt;&lt;/a&gt; (code: &lt;a href=&quot;http://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt;) to do what you want.  Command &lt;code&gt;hlt-highlight-regexp-region-in-buffers&lt;/code&gt; highlights matches for a regexp across a set of buffers.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/ShowWhiteSpace#HighlightChars&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Highlight Chars&lt;/strong&gt;&lt;/a&gt; (code: &lt;a href=&quot;http://www.emacswiki.org/emacs/download/highlight-chars.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/a&gt;) to highlight any character in a single buffer or all buffers.  Command &lt;code&gt;hc-toggle-highlight-tabs&lt;/code&gt;, for example, highlights &lt;code&gt;TAB&lt;/code&gt; characters using face &lt;code&gt;hc-tab&lt;/code&gt;, which you can of course customize.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-16T15:34:28.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16663" PostTypeId="1" AcceptedAnswerId="16665" CreationDate="2015-09-16T16:02:02.270" Score="1" ViewCount="89" Body="&lt;p&gt;In normal file managers like &lt;code&gt;nautilus&lt;/code&gt;, if i select an item and press &lt;kbd&gt;delete&lt;/kbd&gt; button, it will delete that item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i achieve the same in dired? When point is at file, pressing &lt;kbd&gt;delete&lt;/kbd&gt; button should delete that item?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-16T16:21:40.747" Title="Make delete button to delete file at point in dired?" Tags="|dired|deletion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16664" PostTypeId="2" ParentId="16663" CreationDate="2015-09-16T16:02:02.270" Score="0" Body="&lt;p&gt;We can write a simple function to delete file at point and then bind it to &lt;kbd&gt;delete&lt;/kbd&gt; button.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-current-item ()&#xA;  &quot;Delete file at point&quot;&#xA;  (interactive)&#xA;  (dired-flag-file-deletion 1)&#xA;  (dired-do-flagged-delete))&#xA;&#xA;(define-key dired-mode-map  [delete] 'delete-current-item)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-16T16:02:02.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16665" PostTypeId="2" ParentId="16663" CreationDate="2015-09-16T16:21:40.747" Score="2" Body="&lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then the &lt;code&gt;delete&lt;/code&gt; key is bound by default to to command &lt;code&gt;diredp-delete-this-file&lt;/code&gt;, which deletes the file named on the line of the cursor, after confirmation. (&lt;code&gt;C-k&lt;/code&gt; is bound to the same command.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the entire definition of the command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun diredp-delete-this-file ()       ; Bound to `C-k', `delete'&#xA;  &quot;In Dired, delete the file on the cursor line, upon confirmation.&quot;&#xA;  (interactive) (dired-do-delete 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-16T16:21:40.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16666" PostTypeId="2" ParentId="16641" CreationDate="2015-09-16T16:42:39.827" Score="6" Body="&lt;p&gt;Adding my own, thanks @Mark for encouragement.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;&lt;a href=&quot;http://ergoemacs.org/misc/ergoemacs_vi_mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Xah Fly Keys&lt;/a&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Designed from the ground up for emacs, with the goal of being the MOST efficient system, from years experience with ergoemacs-mode. Key choices are science based as much as possible, based on statistics of key frequency and key easy-to-press score. Most frequently used commands are mapped to the most easy-to-press keys. Other issues, such as grouping, and keybinding bigram, are also considered from 3 years of weekly experiment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interesting Points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;All C-x commands are done by sequence of 2 to 3 single keys. In xah-fly-keys, C-x is never necessary. M- is never necessary neither.&lt;/li&gt;&#xA;&lt;li&gt;Does not conflict with any GNU emacs's keys, because it does not bind Ctrl or Meta (except C-7, C-8, but not essential). You can have xah-fly-keys on in insert mode, and use GNU Emacs the way you normally do.&lt;/li&gt;&#xA;&lt;li&gt;Also considered what set of commands results in max editing efficiency. So, the package uses ~80 custom editing commands. (for example, copy will copy current line if there's no selection. One single command to toggle letter case, instead of GNU Emacs's ~6 variations of upper/lower/region/no-region.)&lt;/li&gt;&#xA;&lt;li&gt;The implementation is as simple as possible. No macro, no advice, no complex remapping of keys, only a couple hooks are used. (good or bad?!)&lt;/li&gt;&#xA;&lt;li&gt;Supports over 10 keyboard layouts, including: QWERTY, dvorak, colemak, colemak-mod-dh, qwerty-abnt, qwertz, azerty, programer-dvorak, workman, norman.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Disadvantages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Like learning vi for the first time, you'll need one month to adopt.&lt;/li&gt;&#xA;&lt;li&gt;Less well known than evil-mode.&lt;/li&gt;&#xA;&lt;li&gt;For major modes, you still need to use C-c. (so, you might use other packages such as god-mode or hydra to solve this problem.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm the author, so be warned that I may be unconsciously biased.&#xA;Feel free to comment or correct.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2020-03-31T15:18:03.873" LastActivityDate="2020-03-31T15:18:03.873" CommentCount="3" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 4.0" />
  <row Id="16667" PostTypeId="2" ParentId="16656" CreationDate="2015-09-16T16:49:12.410" Score="0" Body="&lt;p&gt;I do not write python code in Emacs, but I would try &lt;code&gt;pdb&lt;/code&gt; (Emacs built-in python debugger) on a remote python file.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-09-16T16:49:12.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16668" PostTypeId="1" AcceptedAnswerId="16677" CreationDate="2015-09-16T16:53:36.387" Score="2" ViewCount="519" Body="&lt;p&gt;elpy-mode internally uses this command to search for a &lt;code&gt;regexp&lt;/code&gt; in *.py files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq elpy-rgrep-file-pattern &quot;*.py&quot;)&#xA;&#xA;(rgrep regexp&#xA;       elpy-rgrep-file-pattern&#xA;       default-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However &lt;code&gt;elpy-rgrep-file-pattern&lt;/code&gt; is customisable. I want to include html files also while searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried the following patterns &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq elpy-rgrep-file-pattern &quot;*.py|*.html&quot;)&#xA;(setq elpy-rgrep-file-pattern &quot;*.py\|*.html&quot;)&#xA;(setq elpy-rgrep-file-pattern &quot;*.(py\|html)&quot;)&#xA;(setq elpy-rgrep-file-pattern &quot;py\|html&quot;)&#xA;(setq elpy-rgrep-file-pattern '((&quot;html&quot; . &quot;*.html&quot;) (&quot;py&quot; . &quot;*.py&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but nothing seems to work. How do I correctly specify file pattern to search *.py &amp;amp; *.html files?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-16T17:08:35.863" LastActivityDate="2021-06-16T18:44:12.463" Title="How to customize files pattern while using rgrep?" Tags="|regular-expressions|elpy|rgrep|" AnswerCount="2" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="16669" PostTypeId="5" CreationDate="2015-09-16T16:55:16.297" Score="0" Body="&lt;p&gt;Elpy is an  &lt;a href=&quot;/questions/tagged/emacs&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;emacs&amp;#39;&quot; rel=&quot;tag&quot;&gt;emacs&lt;/a&gt; package to bring powerful &lt;a href=&quot;/questions/tagged/python&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;python&amp;#39;&quot; rel=&quot;tag&quot;&gt;python&lt;/a&gt; editing to Emacs. It combines a number of other packages, written in Emacs &lt;a href=&quot;/questions/tagged/lisp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;lisp&amp;#39;&quot; rel=&quot;tag&quot;&gt;lisp&lt;/a&gt; as well as Python.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub Repository&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://elpy.readthedocs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Documentation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="14825" LastEditDate="2020-11-26T06:12:33.163" LastActivityDate="2020-11-26T06:12:33.163" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16670" PostTypeId="4" CreationDate="2015-09-16T16:55:16.297" Score="0" Body="Elpy is an Emacs package to bring powerful Python editing to Emacs. It combines a number of other packages, written in Emacs Lisp as well as Python." OwnerUserId="5187" LastEditorUserId="14825" LastEditDate="2020-11-29T11:42:23.713" LastActivityDate="2020-11-29T11:42:23.713" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16671" PostTypeId="1" AcceptedAnswerId="16769" CreationDate="2015-09-16T17:31:51.213" Score="3" ViewCount="70" Body="&lt;p&gt;I am trying to stage few hunks of a file using magit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My point is on first hunk like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PLoEC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PLoEC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if I press &lt;code&gt;s&lt;/code&gt; to stage this hunk, it will stage hunk and &lt;strong&gt;moves point back to file&lt;/strong&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IFFEw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IFFEw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to stage next hunk, again I have to &lt;strong&gt;move point to hunk&lt;/strong&gt; and press &lt;code&gt;s&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of this, if magit can retain point position, it will be much easier for me to stage hunks very easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remember correctly old magit versions (1.x) had this desired behavior? How can I get back that behavior?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="306" LastEditDate="2015-09-22T14:52:54.537" LastActivityDate="2015-09-22T14:52:54.537" Title="Retain point in magit while staging hunk by hunk?" Tags="|magit|point|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16672" PostTypeId="1" CreationDate="2015-09-16T18:56:36.720" Score="-1" ViewCount="638" Body="&lt;p&gt;My emacs is running on Window 7 and I have just installed yasnippet via &lt;code&gt;M-x package-list&lt;/code&gt; and added few lines to my &lt;em&gt;.emacs&lt;/em&gt; file because I read around the web that it needs to be initialized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried writing a simple yasnippet for LaTeX, calling it &quot;fraction&quot;, triggered by typing &lt;code&gt;fr&lt;/code&gt;+ &lt;kbd&gt;TAB&lt;/kbd&gt; and saved it in &lt;code&gt;~\.emacs.d\elpa\yasnippet-0.8.0\snippets\latex-mode&lt;/code&gt;. This is the code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: fraction&#xA;# key: fr&#xA;# --&#xA;\dfrac{$1}{$0}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since yasnippet was adding a newline everytime I triggered this snippet I modified the &lt;em&gt;.emacs&lt;/em&gt; file. This is how it looks now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; yasnippet&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/yasnippet-0.8.0&quot;)&#xA;(require 'yasnippet)&#xA;(setq yas-snippet-dirs '(&quot;~/.emacs.d/elpa/yasnippet-0.8.0/snippets&quot;))&#xA;(setq-default mode-require-final-newline nil)&#xA;(yas-global-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now however, everytime I type 'fr' it sure gives me &lt;code&gt;\dfrac{}{}&lt;/code&gt; but as soon as I write inside the first pair of curly braces, the same value appears in the second pair of braces (denominator) and pressing &lt;kbd&gt;TAB&lt;/kbd&gt; pushes the cursor out of the last '}'. What am I missing here? How can I fix this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My entire &lt;em&gt;.emacs&lt;/em&gt; file is below. I'm probably doing something wrong, please help me correct it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Schlosser's .emacs&#xA;(server-start)&#xA;(add-hook 'LaTeX-mode-hook 'turn-on-reftex)&#xA;(setq reftex-plug-into-AUCTeX t)&#xA;;(setq-default ispell-program-name &quot;aspell&quot;)&#xA;&#xA;&#xA;;;; Brent.Longborough's .emacs&#xA;(setq inhibit-splash-screen t); Disable splash screen&#xA;(setq visible-bell t); Flashes on error&#xA;(show-paren-mode 1); Matches parentheses and such in every mode&#xA;&#xA;&#xA;;;; AUCTeX&#xA;;; Customary Customization, p. 1 and 16 in the manual, and http://www.emacswiki.org/emacs/AUCTeX#toc2&#xA;(setq TeX-parse-self t); Enable parse on load.&#xA;(setq TeX-auto-save t); Enable parse on save.&#xA;(setq-default TeX-master nil)&#xA;&#xA;(setq TeX-PDF-mode t); PDF mode (rather than DVI-mode)&#xA;&#xA;;activate Flyspell, for all modes(?), not just TeX; from alienexp.blogspot.com&#xA;(add-to-list 'exec-path &quot;C:/Program Files/Aspell/bin/&quot;)&#xA;(setq ispell-program-name &quot;aspell&quot;)&#xA;(setq ispell-dictionary &quot;english&quot;) ;to change do M-x ispell-change-dictionary RET&#xA;&#xA;&#xA;(add-hook 'TeX-mode-hook 'flyspell-mode); Enable Flyspell mode for TeX modes such as AUCTeX. Highlights all misspelled words.&#xA;(add-hook 'emacs-lisp-mode-hook 'flyspell-prog-mode); Enable Flyspell program mode for emacs lisp mode, which highlights all misspelled words in comments and strings.&#xA;;(setq ispell-dictionary &quot;english&quot;); Default dictionary. To change do M-x ispell-change-dictionary RET.&#xA;(add-hook 'TeX-mode-hook&#xA;          (lambda () (TeX-fold-mode 1))); Automatically activate TeX-fold-mode.&#xA;(setq LaTeX-babel-hyphen nil); Disable language-specific hyphen insertion.&#xA;&#xA;;; &quot; expands into csquotes macros (for this to work babel must be loaded after csquotes).&#xA;(setq LaTeX-csquotes-close-quote &quot;}&quot;&#xA;      LaTeX-csquotes-open-quote &quot;\\enquote{&quot;)&#xA;&#xA;;from StackExchange question &quot;AUCTeX preview font size too small&quot;&#xA;(set-default 'preview-scale-function 1.1)&#xA;&#xA;;; LaTeX-math-mode http://www.gnu.org/s/auctex/manual/auctex/Mathematics.html&#xA;(add-hook 'TeX-mode-hook 'LaTeX-math-mode)&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(org-format-latex-options&#xA;   (quote&#xA;    (:foreground default :background default :scale 1.0 :html-foreground &quot;Black&quot; :html-background &quot;Transparent&quot; :html-scale 1.0 :matchers&#xA;         (&quot;begin&quot; &quot;$1&quot; &quot;$&quot; &quot;$$&quot; &quot;\\(&quot; &quot;\\[&quot;))))&#xA; '(org-startup-with-latex-preview t)&#xA; '(preview-default-document-pt 12)&#xA; '(show-paren-mode t)&#xA; '(transient-mark-mode (quote (only . t))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&#xA;;;; a key for tilde symbol&#xA;(global-set-key [f2] &quot;~&quot;)&#xA;;;; visual line word wrapping&#xA;(global-visual-line-mode t)&#xA;&#xA;&#xA;;; yasnippet&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/yasnippet-0.8.0&quot;)&#xA;(require 'yasnippet)&#xA;(setq yas-snippet-dirs '(&quot;~/.emacs.d/elpa/yasnippet-0.8.0/snippets&quot;))&#xA;(setq-default mode-require-final-newline nil)&#xA;(yas-global-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;2 Snapshots&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3jGEo.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3jGEo.jpg&quot; alt=&quot;Where the cursor was in the original line was&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/zdyId.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zdyId.jpg&quot; alt=&quot;cursor way down below!&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9269" LastEditorUserId="9269" LastEditDate="2015-09-16T21:04:18.347" LastActivityDate="2015-11-16T23:04:22.833" Title="yasnippet doesn't recognize $0 placeholder, why?" Tags="|yasnippet|newlines|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16673" PostTypeId="2" ParentId="16641" CreationDate="2015-09-16T19:20:47.063" Score="4" Body="&lt;p&gt;Ergoemacs also supports modal editing. It doesn't emulate vi, but uses Alt key for most frequently used commands. For example, moving cursor is Alt plus right hand inverted T. (On QWERTY it is &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;j&lt;/kbd&gt; for &lt;kbd&gt;left&lt;/kbd&gt;, &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;l&lt;/kbd&gt; for right, &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt; for &lt;kbd&gt;up&lt;/kbd&gt; and &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;k&lt;/kbd&gt; for &lt;kbd&gt;down&lt;/kbd&gt;). Deleting char or word is &lt;kbd&gt;Alt&lt;/kbd&gt; with left hand home-row keys. Key choices are based on command frequency and key's position for ease-of-press.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To start modal editing, the user can press &lt;kbd&gt;f6&lt;/kbd&gt;.  &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Once &lt;kbd&gt;f6&lt;/kbd&gt; was pressed, the most frequently used keys no longer require an alt key combination.  &lt;/li&gt;&#xA;&lt;li&gt;Therefore, on QWERTY, &lt;kbd&gt;j&lt;/kbd&gt; is &lt;kbd&gt;left&lt;/kbd&gt;, &lt;kbd&gt;j&lt;/kbd&gt; is &lt;kbd&gt;right&lt;/kbd&gt;, &lt;kbd&gt;i&lt;/kbd&gt; is &lt;kbd&gt;up&lt;/kbd&gt; and &lt;kbd&gt;k&lt;/kbd&gt; is down).  &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;The modal command mode is exited by pressing &lt;kbd&gt;return&lt;/kbd&gt;, &lt;kbd&gt;f6&lt;/kbd&gt; or &lt;kbd&gt;escape&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In addition to the traditional modal paradigm, there is a quasi modal paradigm that allows any &lt;code&gt;C-x&lt;/code&gt; or &lt;code&gt;C-c&lt;/code&gt; key combination to be reached without using any modifiers (like god-mode). &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The quasi-modal  is started with the QWERTY &lt;kbd&gt;apps&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt; for &lt;code&gt;C-c&lt;/code&gt; with the control key pressed down and the QWERTY &lt;kbd&gt;apps&lt;/kbd&gt; &lt;kbd&gt;d&lt;/kbd&gt; for &lt;code&gt;C-x&lt;/code&gt;.  &lt;/li&gt;&#xA;&lt;li&gt;While completing this key sequence the &lt;kbd&gt;apps&lt;/kbd&gt; key will change the type of modifiers that are assumed to be pressed down.  &lt;/li&gt;&#xA;&lt;li&gt;Once the command has been called, ergoemacs resumes the editing mode.&lt;/li&gt;&#xA;&lt;li&gt;During any key sequence you can also change the types of keys that are held down.  This is by simply pressing the &lt;kbd&gt;apps&lt;/kbd&gt; key again.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In addition to changing the command keys, ergoemacs-mode allows you to change things about the key sequence while typing it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can edit the prefix argument during the middle of a key sequence by pressing &lt;kbd&gt;f2&lt;/kbd&gt;.  &lt;/li&gt;&#xA;&lt;li&gt;Pressing &lt;kbd&gt;backspace&lt;/kbd&gt; takes back the last key pressed. &lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;Apps&lt;/kbd&gt; allows you to change the keys held down during any key sequence.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;ergoemacs-mode also attempts to respect anything the mode does to the fundamental keys.  For example, if org-mode defines a special key for &lt;code&gt;next-line&lt;/code&gt;, ergoemacs uses this command for &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;k&lt;/kbd&gt; when in org-mode.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Part of GNU Emacs, in ELPA.&lt;/li&gt;&#xA;&lt;li&gt;Supports “universal” Windows/Linux keys out of the box. e.g. Open (&lt;code&gt;C-o&lt;/code&gt;), Close (&lt;code&gt;C-w&lt;/code&gt;), Select all (&lt;code&gt;C-a&lt;/code&gt;), Copy (&lt;code&gt;C-c&lt;/code&gt;), Cut (&lt;code&gt;C-x&lt;/code&gt;), Paste (&lt;code&gt;C-v&lt;/code&gt;), etc.&lt;/li&gt;&#xA;&lt;li&gt;Fairly popular.&lt;/li&gt;&#xA;&lt;li&gt;Supports many layouts, including Qwerty, dvorak, colemak, bepo, and many other international layouts that adjust the keys to make sure they are on the home row (M-i in QWERTY would be M-u in colemak).&lt;/li&gt;&#xA;&lt;li&gt;Shows an image of your keyboard layout in emacs by describing the theme.&lt;/li&gt;&#xA;&lt;li&gt;Keys are customizable via a extension system, by creating a theme.&lt;/li&gt;&#xA;&lt;li&gt;You can setup any arbitrary modal keymap (not yet documented).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disadvantages:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Stable is slow on startup.  &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the unstable master, the first startup is slow (~5 seconds for minimal setup), (~20 seconds for my startup)&lt;/li&gt;&#xA;&lt;li&gt;The second second startup is much quicker (for my complex setup it is ~4 seconds). &lt;/li&gt;&#xA;&lt;li&gt;This is because ergoemacs-mode is changing and caching every active keymap in emacs. On second startup, these settings are saved.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Complex code.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/ergoemacs/ergoemacs-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/ergoemacs/ergoemacs-mode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9222" LastEditorUserId="9222" LastEditDate="2015-09-17T23:17:32.313" LastActivityDate="2015-09-17T23:17:32.313" CommentCount="0" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 3.0" />
  <row Id="16674" PostTypeId="1" CreationDate="2015-09-16T19:45:21.510" Score="2" ViewCount="575" Body="&lt;p&gt;I am starting up emacs and I cannot see aynthing in the minibuffer or display window until it starts up.  Is there a reason for this?&lt;/p&gt;&#xA;" OwnerUserId="9222" LastActivityDate="2016-10-12T23:54:04.457" Title="What causes emacs to not display the mini-buffer or window while starting up?" Tags="|init-file|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16675" PostTypeId="1" AcceptedAnswerId="16676" CreationDate="2015-09-16T20:09:47.863" Score="4" ViewCount="631" Body="&lt;p&gt;Let's say I have a Linux directory that looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-rw-r--r--  1 hooked se     0 Sep 16 16:02 a&#xA;-rw-r--r--  1 hooked se     0 Sep 16 16:02 b&#xA;-rw-r--r--  1 hooked se     0 Sep 16 16:02 c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I type &lt;code&gt;emacs *&lt;/code&gt; it opens all three files but it puts me in the middle of the buffer chain. For example when I run it, I start off at &lt;code&gt;c&lt;/code&gt; and NextBuffer takes me along the chain&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c -&amp;gt; b -&amp;gt; *Messages* -&amp;gt; *scratch* -&amp;gt; a -&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is really, really annoying. I'd like to open up emacs and have the order be any of the permutations&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c -&amp;gt; b -&amp;gt; a -&amp;gt; *Messages* -&amp;gt; *scratch* -&amp;gt; &#xA;b -&amp;gt; a -&amp;gt; c -&amp;gt; *Messages* -&amp;gt; *scratch* -&amp;gt; &#xA;a -&amp;gt; b -&amp;gt; c -&amp;gt; *Messages* -&amp;gt; *scratch* -&amp;gt; &#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can open up files along the &quot;start&quot; of the buffer list? I'm opening the files from a Bash CLI Ubuntu 14.04 if that makes a difference. &lt;/p&gt;&#xA;" OwnerUserId="9553" LastEditorUserId="115" LastEditDate="2015-09-16T20:35:50.703" LastActivityDate="2015-09-16T21:03:37.073" Title="Opening multiple files from the command lines puts the buffer order in the middle" Tags="|buffers|files|cycling|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16676" PostTypeId="2" ParentId="16675" CreationDate="2015-09-16T20:46:41.920" Score="5" Body="&lt;p&gt;Interesting problem. One solution which will give you the &lt;code&gt;c -&amp;gt; b -&amp;gt; a -&amp;gt; *Messages* -&amp;gt; *scratch*&lt;/code&gt; permutation is putting this in your &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;.emacs.d/init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bury-messages-and-scratch ()&#xA;  (mapcar #'bury-buffer '(&quot;*Messages*&quot; &quot;*scratch*&quot;)))&#xA;&#xA;(add-hook 'emacs-startup-hook #'bury-messages-and-scratch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;First, I defined a function which calls &lt;code&gt;mapcar&lt;/code&gt;. &lt;code&gt;mapcar&lt;/code&gt; will apply a function (in this case, &lt;code&gt;bury-buffer&lt;/code&gt;) to each element in the sequence provided. So what I wrote in one line is equivalent to these two: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bury-buffer &quot;*Messages*&quot;)&#xA;(bury-buffer &quot;*scratch*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;bury-buffer&lt;/code&gt; will put the specified buffer at the end of the list of all buffers. &lt;code&gt;next-buffer&lt;/code&gt; uses this list to cycle through buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to get Emacs to call this burying function each time it starts, the function needs to be attached to a hook. Specifically, the hook we want is &lt;code&gt;emacs-startup-hook&lt;/code&gt;. The documentation for this hook (which you can access using &lt;code&gt;C-h v emacs-startup-hook RET&lt;/code&gt;) states: &quot;Normal hook run after loading init files and handling the command line.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read about &lt;code&gt;mapcar&lt;/code&gt; or &lt;code&gt;bury-buffer&lt;/code&gt; or &lt;code&gt;add-hook&lt;/code&gt; using &lt;code&gt;C-h f &amp;lt;function-name&amp;gt; RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-09-16T21:03:37.073" LastActivityDate="2015-09-16T21:03:37.073" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16677" PostTypeId="2" ParentId="16668" CreationDate="2015-09-16T21:28:49.350" Score="4" Body="&lt;p&gt;&lt;code&gt;rgrep&lt;/code&gt; takes as its second argument file description in a format similar to &lt;a href=&quot;http://www.tldp.org/LDP/abs/html/globbingref.html&quot; rel=&quot;nofollow&quot;&gt;shell globbing&lt;/a&gt;, which also exists in other languages, for example, &lt;a href=&quot;https://docs.python.org/2/library/glob.html&quot; rel=&quot;nofollow&quot;&gt;in Python&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also a useful variable in Emacs related to &lt;code&gt;rgrep&lt;/code&gt;: &lt;code&gt;grep-files-aliases&lt;/code&gt;, which can be customized to alias various file groups, for instance&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push (cons &quot;pyml&quot; &quot;*.py *.htm *.html&quot;) grep-files-aliases)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will add an alias &lt;code&gt;pyml&lt;/code&gt; for files with extensions &lt;code&gt;py&lt;/code&gt;, &lt;code&gt;htm&lt;/code&gt; and &lt;code&gt;html&lt;/code&gt;.  After evaluating the code above, one should be able to execute:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;rgrep&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;search query&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;pyml&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; in order to search in files with the extensions aliased by &lt;code&gt;pyml&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-09-16T21:28:49.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16678" PostTypeId="2" ParentId="16641" CreationDate="2015-09-16T21:40:01.530" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/mrkkrp/modalka&quot; rel=&quot;nofollow&quot;&gt;Modalka&lt;/a&gt; must be the newest kid on the modal editing block. The github project seems to be all of 10 days old. I don't have enough usage time to comment or evaluate, but here's how it is described:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a building kit to help switch to modal editing in Emacs. Main goal of the package is making modal editing in Emacs as natural and native as possible. There is no hack, no corner cases, no emulation — just start edit modally the way you want.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The documentation also &lt;a href=&quot;https://github.com/mrkkrp/modalka#other-solutions&quot; rel=&quot;nofollow&quot;&gt;compares and contrasts&lt;/a&gt; Modalka with other common modal solutions, such &lt;code&gt;evil&lt;/code&gt;, &lt;code&gt;god-mode&lt;/code&gt;, &lt;code&gt;boon&lt;/code&gt;, etc.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-09-17T23:19:59.397" LastActivityDate="2015-09-17T23:19:59.397" CommentCount="0" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 3.0" />
  <row Id="16679" PostTypeId="2" ParentId="5698" CreationDate="2015-09-16T21:44:31.013" Score="3" Body="&lt;p&gt;Have a look at &lt;code&gt;buffer-display-table&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is used by &lt;code&gt;whitespace-mode&lt;/code&gt; and its &lt;code&gt;whitespace-display-mappings&lt;/code&gt; option (noting specifically the &lt;code&gt;space-mark&lt;/code&gt; values for the latter), so to begin with you should just play with those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect you can map a space to a codepoint which you can control?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit (Kirill)&lt;/em&gt;: This is a snippet that illustrates how this answers the question: it can be used to display spaces differently, which is what I wanted to do. It makes every space &lt;code&gt;#x20&lt;/code&gt;, which is very narrow in some proportional width fonts, be displayed as a different kind of space, for example as one of &lt;code&gt;#x2000..#x200a&lt;/code&gt;, which includes a choice of different space widths - &lt;a href=&quot;https://www.cs.tut.fi/~jkorpela/chars/spaces.html&quot; rel=&quot;nofollow&quot;&gt;https://www.cs.tut.fi/~jkorpela/chars/spaces.html&lt;/a&gt;. It also seems that the font that the new space gets displayed with can be correctly set with &lt;code&gt;set-fontset-font&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((tab (make-display-table))&#xA;        ;; try #x2000 .. #x200a, plus there are some other Unicode space characters&#xA;        (cp #x2002))&#xA;    (aset tab ?  (vector (make-glyph-code cp)))&#xA;    (setq-local buffer-display-table tab)&#xA;    ;; Compare different fonts' space widths:&#xA;    (set-fontset-font t (cons cp cp) (font-spec :family &quot;DejaVu Sans Mono&quot;))&#xA;    ;; (set-fontset-font t (cons cp cp) (font-spec :family &quot;Source Code Pro&quot;))&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="875" LastEditDate="2015-09-16T23:02:51.637" LastActivityDate="2015-09-16T23:02:51.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16680" PostTypeId="1" AcceptedAnswerId="16683" CreationDate="2015-09-16T22:23:14.773" Score="12" ViewCount="8860" Body="&lt;p&gt;I cannot find anything on being able to set &lt;code&gt;TODO&lt;/code&gt; tasks with &lt;code&gt;SCHEDULE&lt;/code&gt; to occur on multiple days of the week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I have &lt;code&gt;STAT&lt;/code&gt; class on &lt;code&gt;Mon&lt;/code&gt; &lt;code&gt;Wed&lt;/code&gt; and &lt;code&gt;Fri&lt;/code&gt; that I would like the event to repeat every week with a &lt;code&gt;+1w&lt;/code&gt; argument. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible or do I need to have 3 separate &lt;code&gt;STAT&lt;/code&gt; events, each with a &lt;code&gt;1w&lt;/code&gt; argument in &lt;code&gt;SCHEDULE&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2019-06-17T15:59:58.050" Title="Org-mode schedule 1 event for multiple days?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16681" PostTypeId="1" CreationDate="2015-09-16T22:26:17.493" Score="3" ViewCount="1462" Body="&lt;p&gt;I want to mimic the behaviour of vim's &lt;code&gt;do&lt;/code&gt; and &lt;code&gt;dp&lt;/code&gt; in ediff mode. These two commands stand for &quot;obtain diff&quot; and &quot;put diff&quot;. That is, if I'm on one difference in one buffer, pressing &lt;code&gt;do&lt;/code&gt; would copy the difference from the other buffer, while pressing &lt;code&gt;dp&lt;/code&gt; would copy the difference from the current buffer into the other buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, it seems to me that various &lt;code&gt;ediff-&lt;/code&gt; functions and variables do not work from within buffers, but only from ediff's control panel :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I'm using spacemacs, I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;ediff&quot;&#xA;'(progn&#xA;(evil-define-key 'normal ediff-mode-map &quot;do&quot; 'spacemacs//ediff-get-changes)&#xA;(evil-define-key 'normal ediff-mode-map &quot;dp&quot; 'spacemacs//ediff-put-changes)))&#xA;&#xA;(defun spacemacs//ediff-get-changes ()&#xA;&quot;This function gets changes from the other window into the current window.&quot;&#xA;(cond ((eq (current-buffer) ediff-buffer-A) 'ediff-copy-B-to-A)&#xA;      ((eq (current-buffer) ediff-buffer-B) 'ediff-copy-A-to-B))&#xA;)&#xA;&#xA;(defun spacemacs//ediff-put-changes ()&#xA;&quot;This function puts changes from the current window into the other window.&quot;&#xA;(cond ((eq (current-buffer) ediff-buffer-A) 'ediff-copy-A-to-B)&#xA;      ((eq (current-buffer) ediff-buffer-B) 'ediff-copy-B-to-A))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since I'm a complete emacs beginner, any pointers are more than appreciated, even just for vanilla Emacs. My goal is to execute one of these functions (&lt;code&gt;ediff-get-changes&lt;/code&gt;/&lt;code&gt;ediff-put-changes&lt;/code&gt;) from within a buffer, via a keybinding.&lt;/p&gt;&#xA;" OwnerUserId="8320" LastActivityDate="2018-10-12T05:30:11.357" Title="Execute an ediff command while in one of the buffers" Tags="|ediff|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16682" PostTypeId="1" CreationDate="2015-09-16T23:23:33.473" Score="0" ViewCount="637" Body="&lt;p&gt;I recently (finally) figured out how to get a monokai theme onto my emacs in the default Terminal app, but emacs still isn't filling up the entire window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a small, but noticeable color discrepancy on the corners.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make Emacs fill up the whole Terminal screen? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This occurs in both windowed and &quot;fullscreen&quot; mode. My resolution is 1440 x 900 (Macbook Air 2015 resolution). However, I do use multiple monitors frequently, so a general solution would be very much preferred. Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cCcX6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cCcX6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5451" LastEditorUserId="5451" LastEditDate="2015-09-17T00:19:04.733" LastActivityDate="2016-05-09T10:26:34.673" Title="Emacs in OSX Terminal.app not filling entire window" Tags="|themes|terminal-emacs|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="16683" PostTypeId="2" ParentId="16680" CreationDate="2015-09-17T00:48:44.957" Score="23" Body="&lt;p&gt;It seems that org-mode wants you to think of &lt;a href=&quot;http://orgmode.org/manual/Deadlines-and-scheduling.html#index-org_002dscheduled_002ddelay_002ddays-871&quot; rel=&quot;noreferrer&quot;&gt;meetings differently&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Scheduling an item in Org mode should not be understood in the same&#xA;  way that we understand scheduling a meeting. Setting a date for a&#xA;  meeting is just a simple appointment, you should mark this entry with&#xA;  a simple plain timestamp, to get this item shown on the date where it&#xA;  applies. This is a frequent misunderstanding by Org users. In Org&#xA;  mode, scheduling means setting a date when you want to start working&#xA;  on an action item.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I guess part of the point is that it doesn't really make sense to mark meetings as DONE. But I'm not really sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, that just changes the question to &quot;how do I specify in a 'simple plain timestamp' multiple recurring dates?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can use functions from the diary library, as such:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 100% chance of statistics today&#xA;SCHEDULED: &amp;lt;%%(or (diary-cyclic 7 8 31 2015) (diary-cyclic 7 9 2 2015) (diary-cyclic 7 9 4 2015))&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now it'll show up every Monday, Wednesday, and Friday starting 2015-08-31. You won't mark it as DONE; it'll just be &quot;scheduled&quot; for those days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in a comment, you can also just use regular timestamps with repeaters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 100% chance of statistics today&#xA;&amp;lt;2015-08-31 Mon +1w&amp;gt;&amp;lt;2015-09-02 Wed +1w&amp;gt;&amp;lt;2015-09-04 Fri +1w&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that if you just use &lt;code&gt;C-c .&lt;/code&gt; twice, org mode will think you're doing a date range. This will also work :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 100% chance of statistics today&#xA;SCHEDULED: &amp;lt;2015-08-31 Mon +1w&amp;gt;--&amp;lt;2015-09-02 Wed&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="18514" LastEditDate="2019-06-17T15:59:58.050" LastActivityDate="2019-06-17T15:59:58.050" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="16684" PostTypeId="1" AcceptedAnswerId="16686" CreationDate="2015-09-17T01:41:00.537" Score="2" ViewCount="731" Body="&lt;p&gt;Is there a way to change the location of the file &lt;code&gt;.emacs.bmk&lt;/code&gt;? I tried doing it but then my bookmarks would not be found. I could not find how to customise the location of this file (similar issue with .emacs.d). Now I have a symlink but I would rather declutter my home folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I just deleted a lot of my bookmarks from the list (using &lt;code&gt;C-x r l&lt;/code&gt; (bookmark-bmenu-list) then d for the bookmarks to delete, x to execute) and the bookmarks were deleted (I can't find them using &lt;code&gt;C-x r b&lt;/code&gt;) but they are all still in the file &lt;code&gt;.emacs.bmk&lt;/code&gt; . Why is that the case? How can I delete bookmarks and have them removed from .emacs.bmk?&lt;/p&gt;&#xA;" OwnerUserId="9416" LastActivityDate="2015-09-17T03:02:27.300" Title="Managing my bookmarks and the related file .emacs.bmk" Tags="|bookmarks|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16685" PostTypeId="2" ParentId="13086" CreationDate="2015-09-17T01:54:51.620" Score="1" Body="&lt;p&gt;Thanks to comments posted by legoscia, it is functioning!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mainly, I had to remove tls-program definition.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq tls-program '(&quot;c:/Progra~2/Git/bin/openssl.exe s_client -connect %h:%p -no_ssl2 -ign_eof -CAfile c:/full/path/to/ca-bundle.crt&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And make sure the OpenSSL DLL is present in the same directory as Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also noted that some OpenSSL distribution seems to have different signature, however, &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;nofollow&quot;&gt;the one provided through the link on the article&lt;/a&gt; worked.&lt;/p&gt;&#xA;" OwnerUserId="580" LastEditorUserId="580" LastEditDate="2015-10-09T01:11:20.497" LastActivityDate="2015-10-09T01:11:20.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16686" PostTypeId="2" ParentId="16684" CreationDate="2015-09-17T03:02:27.300" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Load the library: &lt;code&gt;M-x load-library RET bookmark RET&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize your bookmarks file using &lt;code&gt;M-x customize-option RET bookmark-default-file&lt;/code&gt;.  Completion is available for the option names, so type &lt;code&gt;bookm TAB&lt;/code&gt; to see the options concerning bookmarks, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After you delete bookmarks from your bookmark list, which is in memory, if you want those changes saved then you need to &lt;em&gt;save your bookmarks file&lt;/em&gt;.  In the bookmark display list (from &lt;code&gt;C-x r l&lt;/code&gt;), use &lt;code&gt;s&lt;/code&gt; to save. As usual in Emacs, you can use &lt;code&gt;C-h m&lt;/code&gt; in that buffer to see available keys/commands and other information about the mode.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For more information about bookmarks (as for other subjects), consult the Emacs manual: &lt;code&gt;C-h r&lt;/code&gt;. Then use &lt;code&gt;i&lt;/code&gt; to look topics up in the index (with completion). For example, &lt;code&gt;C-h r i bookmark RET&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For extra bookmark features, see library &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-17T03:02:27.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16687" PostTypeId="2" ParentId="16492" CreationDate="2015-09-17T08:04:10.877" Score="6" Body="&lt;p&gt;I think one simple way to achieve it is simply to run &lt;code&gt;M-x org-mode&lt;/code&gt; when you're in &lt;code&gt;*snatch*&lt;/code&gt; buffer, and thus enabling &lt;code&gt;org-mode&lt;/code&gt; directly. This can be applied to enabling any major mode.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-09-17T08:04:10.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16688" PostTypeId="1" CreationDate="2015-09-17T08:14:26.890" Score="20" ViewCount="7198" Body="&lt;p&gt;If I write something like &lt;code&gt;*shrug*&lt;/code&gt; in org mode, it will be automatically fontified as &lt;strong&gt;bold text&lt;/strong&gt;.  How can I prevent that, i.e. actually having &lt;code&gt;*shrug*&lt;/code&gt; appear verbatim when exported?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still want to be able to use bold fontification (without having to change the default star-syntax for bold text), and it should not matter to what file format my org file is exported, e.g. it should work for Markdown as well as HTML export.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is some &lt;strong&gt;important&lt;/strong&gt; stuff, that is why it is written in bold.  But for something else, I have no Idea *shrug*.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9481" LastEditorUserId="2093" LastEditDate="2015-09-20T13:34:58.230" LastActivityDate="2020-01-28T10:51:45.890" Title="How can I escape the * in org-mode to prevent bold fontification" Tags="|org-mode|" AnswerCount="4" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16689" PostTypeId="2" ParentId="16688" CreationDate="2015-09-17T08:58:06.457" Score="4" Body="&lt;p&gt;By verbatim, if you actually mean use some markup in the exported LaTeX, then you can just use &lt;code&gt;=*shrug*=&lt;/code&gt;.  However if you just want it to be exported as &lt;code&gt;*shrug*&lt;/code&gt;, and you want to do this all the time, I would recommend &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html#Advanced-configuration&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;filters&lt;/strong&gt;&lt;/a&gt;.  If however, you only need this for some instances of &lt;code&gt;*shrug*&lt;/code&gt;, you should use the alternative suggested by @wvxvw.  You could do this cleanly using &lt;a href=&quot;http://orgmode.org/manual/Macro-replacement.html#Macro-replacement&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;macros&lt;/strong&gt;&lt;/a&gt;.  Some examples follow.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Filters&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-bold (contents backend info)&#xA;  (when (org-export-derived-backend-p backend 'latex)&#xA;    (replace-regexp-in-string &quot;\\`\\\\textbf{\\(.+\\)}&quot;&#xA;                              &quot;\\\\ast{}\\1\\\\ast{}&quot; contents)))&#xA;&#xA;(add-to-list 'org-export-filter-bold-functions 'my-bold)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Essentially the above filter looks for the &lt;code&gt;\textbf{..}&lt;/code&gt; markup in the transcoded string, and replaces it with &lt;code&gt;\ast{}..\ast{}&lt;/code&gt;, without changing whatever was wrapped inside &lt;code&gt;{..}&lt;/code&gt;.  I have not tested the regular expression and the replacement string, so there could be mistakes, but you get the idea.  Similarly to cover other backends, one can include extra snippets like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (org-export-derived-backend-p backend 'html)&#xA;   (replace-regexp-in-string &quot;&amp;lt;b&amp;gt;\\(.+\\)&amp;lt;/b&amp;gt;&quot; &quot;\&amp;amp;#2a;\\1\&amp;amp;#2a;&quot; contents))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Same caveat holds for the regular expression above.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Macros&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Org source:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+macro: nobold @@latex:\ast{}$1\ast{}@@ @@html:&amp;amp;#2a;$1&amp;amp;#2a;@@&#xA;&#xA;This text is *bold* this is nobold{{{not}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;exports to LaTeX as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;This text is \textbf{bold} this is \ast{}not\ast{}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and to HTML as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;This text is &amp;lt;b&amp;gt;bold&amp;lt;/b&amp;gt; this is  &amp;amp;#2a;not&amp;amp;#2a;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can of course add as many backends as you wish to the macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt; as Kaushal points out in the comments, the export snippet for latex is optional in this case.  I however prefer to use them whenever bare latex is involved, since I find it rather difficult to keep track of the list of &lt;code&gt;org-entities&lt;/code&gt; and the specific rules behind identifying bare latex in Org source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the filter examples are untested,&lt;/li&gt;&#xA;&lt;li&gt;I don't know any &lt;code&gt;HTML&lt;/code&gt;, so there might be some mistakes in the respective bits.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="2093" LastEditDate="2020-01-28T10:51:45.890" LastActivityDate="2020-01-28T10:51:45.890" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="16690" PostTypeId="1" AcceptedAnswerId="16697" CreationDate="2015-09-17T09:08:57.327" Score="2" ViewCount="658" Body="&lt;p&gt;It seems development has been spread around over the years. The EmacsWiki still points to the manual on SourceForge but it seems very out of date. Configuration variables mentioned in the manual are no longer available in my MELPA installed package. Is there a more upto date version online?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2021-07-01T09:41:46.427" Title="Where is the canonical location for the BBDB manual?" Tags="|bbdb|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16691" PostTypeId="2" ParentId="16567" CreationDate="2015-09-17T10:32:35.233" Score="5" Body="&lt;p&gt;You can save recent files just before shutdown by calling &lt;code&gt;recentf-save-list&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x recentf-save-list RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This adds your recent files to recentf history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you dont want to do this manually, you can add a timer which will do that for you every 5 minutes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-at-time (current-time) 300 'recentf-save-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add this to your config. So whenever you open emacs, it will call the function and every 5 minutes(or 300 seconds) it will go on calling that function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://emacs.stackexchange.com/a/15115/5187&quot;&gt;https://emacs.stackexchange.com/a/15115/5187&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-09-17T10:32:35.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16692" PostTypeId="2" ParentId="13315" CreationDate="2015-09-17T11:20:35.547" Score="1" Body="&lt;p&gt;You can  use  this  snippet to add new  line to beginning of output from &lt;a href=&quot;http://emacswiki.org/emacs/SqlMode&quot; rel=&quot;nofollow&quot;&gt;emacswiki&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar sql-last-prompt-pos 1&#xA;  &quot;position of last prompt when added recording started&quot;)&#xA;(make-variable-buffer-local 'sql-last-prompt-pos)&#xA;(put 'sql-last-prompt-pos 'permanent-local t)&#xA;&#xA;(defun sql-add-newline-first (output)&#xA;  &quot;Add newline to beginning of OUTPUT for `comint-preoutput-filter-functions'&#xA;        This fixes up the display of queries sent to the inferior buffer&#xA;        programatically.&quot;&#xA;  (let ((begin-of-prompt&#xA;         (or (and comint-last-prompt-overlay&#xA;              ;; sometimes this overlay is not on prompt&#xA;              (save-excursion&#xA;                (goto-char (overlay-start comint-last-prompt-overlay))&#xA;                (looking-at-p comint-prompt-regexp)&#xA;                (point)))&#xA;             1)))&#xA;    (if (&amp;gt; begin-of-prompt sql-last-prompt-pos)&#xA;        (progn&#xA;          (setq sql-last-prompt-pos begin-of-prompt)&#xA;          (concat &quot;\n&quot; output))&#xA;      output)))&#xA;&#xA;(defun sqli-add-hooks ()&#xA;  &quot;Add hooks to `sql-interactive-mode-hook'.&quot;&#xA;  (add-hook 'comint-preoutput-filter-functions&#xA;            'sql-add-newline-first))&#xA;&#xA;(add-hook 'sql-interactive-mode-hook 'sqli-add-hooks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is another snippet that  solves your problem&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sql-add-newline-first (output)&#xA;   &quot;Add newline to beginning of OUTPUT for `comint-preoutput-filter-functions'&quot;&#xA;  (concat &quot;\n&quot; output))&#xA;&#xA;(defun sqli-add-hooks ()&#xA;  &quot;Add hooks to `sql-interactive-mode-hook'.&quot;&#xA;  (add-hook 'comint-preoutput-filter-functions&#xA;            'sql-add-newline-first))&#xA;&#xA;(add-hook 'sql-interactive-mode-hook 'sqli-add-hooks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are many other alternatives for  this implementation, you can pick any that suits your needs.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-10-08T06:41:55.917" LastActivityDate="2015-10-08T06:41:55.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16693" PostTypeId="1" AcceptedAnswerId="16699" CreationDate="2015-09-17T13:07:50.910" Score="11" ViewCount="3996" Body="&#xA;&#xA;&lt;p&gt;By design, the &lt;code&gt;fundamental-mode&lt;/code&gt; is bare bones as other major modes are supposed to derive from this one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the info page &lt;code&gt;(elisp) Major Modes&lt;/code&gt;, we have:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is the major mode command for Fundamental mode.  Unlike other&#xA;       mode commands, it does &lt;em&gt;not&lt;/em&gt; run any mode hooks (*note Major Mode&#xA;       Conventions::), since you are not supposed to customize this mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For that reason,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;We do not have a &lt;code&gt;fundamental-mode-hook&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Also &lt;code&gt;my-minor-mode&lt;/code&gt; does not get enabled ONLY in this major mode buffers inspite of having &lt;code&gt;(global-my-minor-mode 1)&lt;/code&gt; in my config.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Below would work but only if I manually typed &lt;code&gt;M-x fundamental-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-change-major-mode-hook #'my-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does not help in the below case where a &lt;code&gt;fundamental-mode&lt;/code&gt; buffer (*abcd*)  is created by default:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer (get-buffer-create &quot;*abcd*&quot;)&#xA;  (insert &quot;Hello world&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why I want to enable a minor mode in &lt;code&gt;fundamental-mode&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to keep my custom key bindings in my minor mode map. I have this minor mode enabled globally (but it does not get enabled only in &lt;code&gt;fundamental-mode&lt;/code&gt; buffers).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a use case that made this ask this question here. On doing &lt;code&gt;M-x esup&lt;/code&gt; (&lt;a href=&quot;https://github.com/jschaf/esup&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;esup&lt;/code&gt;&lt;/a&gt; package), it creates an &lt;code&gt;*esup-log*&lt;/code&gt; buffer with &lt;code&gt;fundamental-mode&lt;/code&gt; as its major mode. But each time I need to enable my minor mode manually in it to use my convenient bindings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to enable &lt;code&gt;my-minor-mode&lt;/code&gt; in a truly global fashion, &lt;code&gt;fundamental-mode&lt;/code&gt; or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my minor mode definition: &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/233317c242b58ba37e6a8ff0cf1133fb21e13318/elisp/modi-mode.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;modi-mode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on &lt;strong&gt;@npostavs'&lt;/strong&gt; comment, I reviewed what's different between my minor mode &lt;code&gt;modi-mode&lt;/code&gt; and &lt;code&gt;override-global-mode&lt;/code&gt; in &lt;code&gt;use-package/bind-key.el&lt;/code&gt;. And it turns out that the init value of my mode is &lt;code&gt;nil&lt;/code&gt; and that of &lt;code&gt;override-global-mode&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I change the init value of my mode to &lt;code&gt;t&lt;/code&gt;, it too gets enabled in the fundamental-mode buffers! But the act of &lt;code&gt;(global-modi-mode 1)&lt;/code&gt; does not end with the same result. Is that odd? Probably a bug? &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-09-17T15:17:11.960" LastActivityDate="2015-09-17T16:18:22.287" Title="Auto enable minor modes in fundamental-mode" Tags="|major-mode|minor-mode|" AnswerCount="3" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="16694" PostTypeId="1" AcceptedAnswerId="16695" CreationDate="2015-09-17T13:27:08.623" Score="2" ViewCount="727" Body="&lt;p&gt;I have written an interactive  function to connect to multiple mysql databases&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mysql-connect (name)&#xA;  &quot;Connect to a predefined MySQL connection.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (completing-read &quot;Connect to: &quot; sql-connection-alist&#xA;             nil t nil 'pyvenv-workon-history nil nil)))&#xA;  (when (not (or (equal name &quot;&quot;)&#xA;             (equal name nil)))&#xA;    (mysql-connect-preset name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;M-x mysql-connect&lt;/code&gt;, it  will prompt user to select available options. But I  want to invoke it via script.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I  run &lt;code&gt;(mysql-connect 'some-choice)&lt;/code&gt;  it will  work, but I dont want  that. I just want to invoke &lt;code&gt;mysql-connect&lt;/code&gt;  and let  user  to select choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How  can I just  invoke  that function?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-17T13:35:32.577" Title="How to programmatically invoke interactive function?" Tags="|interactive|sql-mode|" AnswerCount="1" CommentCount="2" ClosedDate="2015-09-17T13:36:33.140" ContentLicense="CC BY-SA 3.0" />
  <row Id="16695" PostTypeId="2" ParentId="16694" CreationDate="2015-09-17T13:35:32.577" Score="3" Body="&#xA;&#xA;&lt;p&gt;You need to use &lt;code&gt;call-interactively&lt;/code&gt; here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usage example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(call-interactively #'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can learn more about it by doing &lt;code&gt;C-h i g (elisp) Interactive Call&lt;/code&gt; and &lt;code&gt;C-h f call-interactively&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-09-17T13:35:32.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16696" PostTypeId="1" CreationDate="2015-09-17T14:08:46.543" Score="4" ViewCount="71" Body="&lt;p&gt;I am writing a small window navigation and manipulation package.  Windows are numbered very much like &lt;a href=&quot;http://www.emacswiki.org/emacs/WindowNumberingMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;WindowNumberingMode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make this concrete I have a series of commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;C-, 1&quot;   ; Move focus to (select) window #1&#xA;..        ; ..&#xA;&quot;C-, 9&quot;   ; Move focus to (select) window #9&#xA;&quot;C-, m 1&quot; ; Move current buffer and focus to window #1&#xA;..        ; ..&#xA;&quot;C-, m 9&quot; ; Move current buffer and focus to window #9&#xA;&quot;C-, x 1&quot; ; Exchange current buffer and focus with window #1&#xA;..        ; ..&#xA;&quot;C-, x 9&quot; ; Exchange current buffer and focus with window #9&#xA;..        ; ..&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At the time that I type &lt;code&gt;&quot;C-,&quot;&lt;/code&gt; I would like to offer visual prompts (similar to &lt;a href=&quot;https://github.com/dimitri/switch-window&quot; rel=&quot;nofollow noreferrer&quot;&gt;switch-window&lt;/a&gt;): &lt;img src=&quot;https://i.stack.imgur.com/bsOsz.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I do this and continue collecting the remainder of my key-sequence?  Do I need &lt;code&gt;&quot;C-,&quot;&lt;/code&gt; to switch to a new minor-mode?&lt;/p&gt;&#xA;" OwnerUserId="443" LastEditorUserId="14920" LastEditDate="2018-12-30T18:30:23.677" LastActivityDate="2018-12-30T18:30:23.677" Title="Can the prefix of a key-sequence have an effect?" Tags="|prefix-keys|" AnswerCount="0" CommentCount="16" ClosedDate="2016-04-12T13:22:56.300" ContentLicense="CC BY-SA 4.0" />
  <row Id="16697" PostTypeId="2" ParentId="16690" CreationDate="2015-09-17T14:48:35.417" Score="4" Body="&lt;p&gt;Manual for BBDBv2 → &lt;a href=&quot;http://obbdb.sourceforge.net/#manual&quot; rel=&quot;nofollow&quot;&gt;http://obbdb.sourceforge.net/#manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Manual for BBDBv3 → &lt;strong&gt;does not exist&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW here are some BBDBv3 resources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Discussion about (missing) BBDBv3 manual on official mailing list&lt;/strong&gt;: &lt;a href=&quot;https://www.mail-archive.com/bbdb-info%40lists.sourceforge.net/msg05487.html&quot; rel=&quot;nofollow&quot;&gt;https://www.mail-archive.com/bbdb-info%40lists.sourceforge.net/msg05487.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Official BBDBv3 project page: &lt;a href=&quot;https://savannah.nongnu.org/projects/bbdb/&quot; rel=&quot;nofollow&quot;&gt;https://savannah.nongnu.org/projects/bbdb/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Configuration example: &lt;a href=&quot;http://blog.petitepomme.net/post/28547901478/installing-and-configuring-bbdb-3&quot; rel=&quot;nofollow&quot;&gt;http://blog.petitepomme.net/post/28547901478/installing-and-configuring-bbdb-3&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Tool to synchronize BBDBv3 (and v2) with your Google Contacts, MS Outlook, CardDAV: &lt;a href=&quot;http://asynk.io/&quot; rel=&quot;nofollow&quot;&gt;http://asynk.io/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is my setup based on the latest code (because it adds support for mu4e) obtained with &lt;code&gt;git clone git://git.savannah.nongnu.org/bbdb.git&lt;/code&gt; (should be also available on MELPA):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package bbdb-loaddefs&#xA;  :commands bbdb&#xA;  :config&#xA;  (bbdb-initialize 'gnus&#xA;           ;;bbdb-insinuate-gnus adds bindings for the default&#xA;           ;;keys to Gnus and configures Gnus to notify the&#xA;           ;;BBDB when new messages are loaded. This&#xA;           ;;notification is required if the BBDB is to be&#xA;           ;;able to display BBDB entries for messages&#xA;           ;;displayed in Gnus.&#xA;&#xA;           'message&#xA;           ;; bbdb-insinuate-message adds a binding for M-TAB&#xA;           ;; to Message mode. This will enable completion of&#xA;           ;; addressees based on BBDB records.&#xA;&#xA;           'mu4e&#xA;           'anniv)&#xA;&#xA;  (bbdb-mua-auto-update-init 'gnus 'message 'mu4e)&#xA;&#xA;  ;; size of the bbdb popup&#xA;  (setq bbdb-mua-pop-up-window-size 1)&#xA;&#xA;  ;; how to handle new entries&#xA;  ;; (setq bbdb-mua-update-interactive-p '(query . create))&#xA;&#xA;  ;; look at every address; not only the first one&#xA;  ;; (setq bbdb-message-all-addresses t)&#xA;&#xA;  (setq bbdb-phone-style 'nil)&#xA;&#xA;  ;; http://www.emacs.uniyar.ac.ru/doc/em24h/emacs183.htm&#xA;  (use-package bbdb-gnus&#xA;    :config&#xA;    (setq bbdb/gnus-score-default 1000)&#xA;    (setq gnus-score-find-score-files-function&#xA;          '(gnus-score-find-bnews bbdb/gnus-score))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="220" LastActivityDate="2015-09-17T14:48:35.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16698" PostTypeId="2" ParentId="16688" CreationDate="2015-09-17T15:34:33.870" Score="-1" Body="&lt;p&gt;This is controlled by the variable org-emphasis-alist, and can be easily modified.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Put point over bold text, use command what-cursor-position &lt;kbd&gt; C-u C-x =&lt;/kbd&gt; to find the face, note that it has property &lt;code&gt;org-emphasis&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;customize-group&lt;/code&gt; and search for org-emphasis&lt;/li&gt;&#xA;&lt;li&gt;org-emphasis-alist should show up, with various options for marking text.&lt;/li&gt;&#xA;&lt;li&gt;Delete the entry corresponding to *&lt;/li&gt;&#xA;&lt;li&gt;Apply changes, and restart org-mode or emacs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-09-17T15:34:33.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16699" PostTypeId="2" ParentId="16693" CreationDate="2015-09-17T15:37:51.023" Score="5" Body="&#xA;&#xA;&lt;p&gt;The only way I can get a minor mode enabled by default in &lt;code&gt;fundamental-mode&lt;/code&gt; buffers is to set the &lt;em&gt;init value&lt;/em&gt; of that minor mode to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode my-minor-mode&#xA; &quot;My minor mode&quot;&#xA; :init-value t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that simply toggling ON a &lt;em&gt;globalized minor mode&lt;/em&gt; (see &lt;code&gt;C-h i g (elisp) Defining Minor Modes&lt;/code&gt;) with &lt;em&gt;init value&lt;/em&gt; &lt;code&gt;nil&lt;/code&gt; does not do the same thing. In this case, a &lt;code&gt;fundamental-mode&lt;/code&gt; buffer will be created with this minor mode disabled.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The above, of course, will work only if you control the minor mode source. For all other minor modes that come with different packages, if you'd like to enable a minor mode by default in &lt;code&gt;fundamental-mode&lt;/code&gt; buffers, you would need to do&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default the-minor-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-09-17T15:49:34.647" LastActivityDate="2015-09-17T15:49:34.647" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16700" PostTypeId="2" ParentId="16693" CreationDate="2015-09-17T15:40:57.267" Score="3" Body="&lt;p&gt;&lt;em&gt;Do not use&lt;/em&gt; &lt;code&gt;fundamental-mode&lt;/code&gt; -- at least not interactively.&#xA;You rarely want to be in &lt;code&gt;fundamental-mode&lt;/code&gt;. There is almost always something better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole point of &lt;code&gt;fundamental-mode&lt;/code&gt; is to &lt;strong&gt;not&lt;/strong&gt; have the usual major-mode handling (hooks etc.).&#xA;You can think of &lt;code&gt;fundamental-mode&lt;/code&gt; as kind of like an abstract class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If some package puts you in a buffer that is in &lt;code&gt;fundamental-mode&lt;/code&gt; then do what you need to do to prevent this -- use some other mode for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider &lt;em&gt;customizing&lt;/em&gt; &lt;strong&gt;&lt;code&gt;major-mode&lt;/code&gt;&lt;/strong&gt; so that it defaults to something other than &lt;code&gt;fundamental-mode&lt;/code&gt;.  (I use &lt;code&gt;indented-text-mode&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Formerly there was &lt;code&gt;default-major-mode&lt;/code&gt; for this, which I think was a bit clearer, but they decided to deprecate that (it still works, of course).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;default-major-mode is a variable defined in `C source code`.&#xA;Its value is indented-text-mode&#xA;&#xA;  This variable is obsolete since 23.2;&#xA;  use `major-mode' instead.&#xA;&#xA;Documentation:&#xA;Value of `major-mode` for new buffers.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-17T15:40:57.267" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="16701" PostTypeId="2" ParentId="16693" CreationDate="2015-09-17T16:18:22.287" Score="0" Body="&lt;p&gt;The function &lt;code&gt;get-buffer-create&lt;/code&gt; is defined in &lt;code&gt;buffer.c&lt;/code&gt;, and at the very end of that function it calls the &lt;code&gt;buffer-list-update-hook&lt;/code&gt;.  Such a hook could be used to run a custom function, but certain conditions may need to be added to prevent the custom function from firing at inopportune moments whenever that hook is called by other functions.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-09-17T16:18:22.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16702" PostTypeId="2" ParentId="16688" CreationDate="2015-09-17T17:00:26.807" Score="13" Body="&lt;h2&gt;Using the ZERO WIDTH SPACE unicode char&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can fail the bold emphasis parsing by adding a zero-width space character (indicated by [ZWS] in the below snippets) before the first asterisk or after the second asterisk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both of the below snippets exported fine to HTML in my testing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;[ZWS] &lt;em&gt;before&lt;/em&gt; the first asterisk&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is some *bold* test and this is ​[ZWS]*not bold*.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;[ZWS] &lt;em&gt;after&lt;/em&gt; the second asterisk&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is some *bold* test and this is *not bold*​[ZWS].&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can enter the ZERO WIDTH SPACE (unicode name) by doing &lt;code&gt;C-x 8&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;200b&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;br&gt;&#xA;&lt;em&gt;I use this very often, so &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/53c350b8bd6b8ba78087f3edd07366439fa455b6/setup-files/setup-unicode.el#L40&quot; rel=&quot;noreferrer&quot;&gt;I have bound this to &lt;code&gt;C-x 8 0&lt;/code&gt;&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As per the &lt;a href=&quot;http://www.mail-archive.com/emacs-orgmode@gnu.org/msg100527.html&quot; rel=&quot;noreferrer&quot;&gt;discussion on the emacs-org-mode mailing list&lt;/a&gt;, using non-ASCII characters for escaping is not recommended; instead &lt;code&gt;org-entities&lt;/code&gt; should be used if applicable. I too agreed with that and came up with &lt;a href=&quot;https://emacs.stackexchange.com/a/16746/115&quot;&gt;this another solution&lt;/a&gt; that makes inserting &lt;code&gt;org-entities&lt;/code&gt; really easy (&lt;code&gt;C-u *&lt;/code&gt; in this case).&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-11-02T23:32:15.293" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16703" PostTypeId="2" ParentId="15184" CreationDate="2015-09-17T18:15:58.683" Score="0" Body="&lt;p&gt;The font developer found the issue and released an update to the font that fixes this issue! &lt;/p&gt;&#xA;" OwnerUserId="9366" LastActivityDate="2015-09-17T18:15:58.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16704" PostTypeId="1" CreationDate="2015-09-17T20:38:16.277" Score="1" ViewCount="141" Body="&lt;p&gt;&lt;strong&gt;BACKGROUND:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have started to use emacs with a macbook and the first difficulty was that the meta keys are used for emacs things, where there would otherwise be used for special characters, such as: [, ], |, {, }, ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Not that it changes much, but just to mention it, my macbook has a German keyboard]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this I had defined my own functions for each special character, which lives in my .emacs file. For example, to insert a pipe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun nwm/open-curley-bracket ()&#xA;  &quot;A custom function to insert an opening curley bracket as the mac key-bind for it doesn't work within emacs.&quot;&#xA;  (interactive)&#xA;  (insert &quot;\{&quot;))&#xA;(global-set-key (kbd &quot;M-8&quot;) 'nwm/open-curley-bracket)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to use electric-pairs to auto-complete these special characters, meaning when I type &lt;code&gt;{&lt;/code&gt; I expect both braces to appear &lt;code&gt;{}&lt;/code&gt; with the cursor left between them.&#xA;The electric pairs mode works nicely for the special characters like normals brackets &lt;code&gt;()&lt;/code&gt; that I do not need to remap to my keyboard, however it doesn't work for my new keybound characters like the pipe above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried setting the required special characters with less convoluted methods, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;M-8&quot;) &quot;{&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... this still doesn't work for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know much about Lisp, so if anybody can interpret the colde bhind electric-pairs to find the cause of the problem, please do!&#xA;&lt;a href=&quot;http://www.emacswiki.org/emacs/ElectricPair&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/ElectricPair&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anybody got a work-around or a different solution?&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="9558" LastEditDate="2015-09-18T02:26:23.410" LastActivityDate="2015-09-21T01:28:16.700" Title="Using electric-pair on apple keyboards" Tags="|electric-pair-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16705" PostTypeId="2" ParentId="16548" CreationDate="2015-09-17T20:53:44.010" Score="2" Body="&lt;p&gt;I was able to fix this by setting the &lt;code&gt;org-indent&lt;/code&gt; font to have the same foreground and background color.  To do this, in my &lt;code&gt;custom-set-faces&lt;/code&gt;, I included the following line: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(org-indent ((t (:background &quot;#181818&quot; :foreground &quot;#181818&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-09-17T20:53:44.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16706" PostTypeId="2" ParentId="16704" CreationDate="2015-09-17T21:31:27.867" Score="1" Body="&lt;p&gt;Personally, I don't like the default way Emacs on OS X use the modifier keys. I have the following in my init file, it places meta on Cmd and restore Alt to the normal OS X behaviour to access special keys. This way it just work with &lt;code&gt;electric-pair-mode&lt;/code&gt; and you can drop all your special functions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (boundp 'ns-command-modifier)&#xA;    (setq ns-command-modifier 'meta))&#xA;&#xA;(if (boundp 'ns-option-modifier)&#xA;    (setq ns-option-modifier nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-09-17T21:31:27.867" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16707" PostTypeId="2" ParentId="16672" CreationDate="2015-09-17T22:03:55.987" Score="0" Body="&lt;p&gt;I changed my &lt;em&gt;.emacs&lt;/em&gt; file by copy/pasting some lines regarding this same problem from another post in stackexchange. Here's how it looks now.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; yasnippet&#xA; (add-to-list 'load-path &quot;~/.emacs.d/elpa/yasnippet-0.8.0&quot;)&#xA; (require 'yasnippet)&#xA; (setq yas-snippet-dirs '(&quot;~/.emacs.d/elpa/yasnippet-0.8.0/snippets&quot;))&#xA;;; (setq-default mode-require-final-newline nil) &#xA;(yas-global-mode 1)&#xA;(defun disable-final-newline () (interactive) (set (make-local-variable 'require-final-newline) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also added Andrea Crotti's YASnippets collection to my YASnippets path and tried to write some of my own. For example: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: si&#xA;# key: si&#xA;# --&#xA;\SI{${1:number}}{${2:units}}$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I reloaded all the snippets via the 'YASnippets' menu of LaTeX mode and now things are working fine. I'm not sure those lines fixed the problem because Org-mode still gives me trouble as reported in the pictures above. It seems as if the math preview-box is too big and can't fit the regular lines. I'm inclined to ask a new question on that matter but for now I managed to (temporarily) fix YASnippet's placeholder lining problem.&lt;/p&gt;&#xA;" OwnerUserId="9269" LastActivityDate="2015-09-17T22:03:55.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16708" PostTypeId="1" AcceptedAnswerId="16716" CreationDate="2015-09-17T22:25:58.400" Score="2" ViewCount="969" Body="&lt;p&gt;This &lt;code&gt;.emacs&lt;/code&gt; file is sufficient to reproduce the problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;(setq evil-want-C-u-scroll t)&#xA;(require 'evil)&#xA;(define-key evil-normal-state-map (kbd &quot;C-f&quot;) #'universal-argument)&#xA;(evil-mode +1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I am applying multiple consecutive universal arguments while in normal mode, &lt;code&gt;C-u&lt;/code&gt; is being treated as universal-argument (which is inappropriate). I can stack both &lt;code&gt;C-u&lt;/code&gt; and &lt;code&gt;C-f&lt;/code&gt; and get &lt;code&gt;C-f C-f C-u C-f C-f&lt;/code&gt; in my modeline. The semantics appear to be the same 4^[number of universal argument things], but I'd like to disable this unwanted behavior and use just &lt;code&gt;C-f&lt;/code&gt; for universal argument in normal mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it turns out what is actually happening is that after &lt;code&gt;C-f&lt;/code&gt; the &lt;code&gt;universal-argument-map&lt;/code&gt; is invoked and in that map the &lt;code&gt;C-u&lt;/code&gt; key is bound to &lt;code&gt;universal-argument&lt;/code&gt;. It looks like the purpose of this map and the related transient mode &lt;code&gt;universal-argument--mode&lt;/code&gt; is to enable digits and - to modify the universal argument after &lt;code&gt;C-u&lt;/code&gt; has been pressed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like any solution to this problem would involve defining a function similar to &lt;code&gt;universal-argument&lt;/code&gt; and binding &lt;code&gt;C-f&lt;/code&gt; to that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;wasamasa's suggestion works great, but this is what I've settled on so as to avoid modifying the behavior of evil-emacs-state (or when evil-mode is deactivated)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar normal-mode-universal-argument-map universal-argument-map&#xA;  &quot;swap C-f and C-u in universal-argument-map&quot;)&#xA;(define-key normal-mode-universal-argument-map (kbd &quot;C-u&quot;) nil)&#xA;(define-key normal-mode-universal-argument-map&#xA;  (kbd &quot;C-f&quot;) #'universal-argument-more) &#xA;&#xA;(defun normal-mode-universal-argument ()&#xA;  &quot;universal-argument with C-f and C-u swapped&quot;&#xA;  (let ((universal-argument-map normal-mode-universal-argument-map))&#xA;    (universal-argument)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="8921" LastEditDate="2015-09-18T07:13:53.977" LastActivityDate="2015-09-18T07:13:53.977" Title="Evil-mode remap universal-argument to C-f in normal-mode, without weird C-u behavior" Tags="|evil|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16709" PostTypeId="2" ParentId="16674" CreationDate="2015-09-17T23:32:12.283" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a reason for this?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, because it is busy starting emacs. However, it logs the most important messages in a buffer called &lt;code&gt;*Messages*&lt;/code&gt; and in the operating systems log or event viewer -- depending on your operating system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As others have commented above, after emacs has finishing starting up, look into the &lt;code&gt;*Messages*&lt;/code&gt; buffer or the system's log for any clues to what could be ailing. Post those messages here to help you narrow down the cause.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, look into starting emacs with --debug &lt;a href=&quot;http://ftp.gnu.org/old-gnu/Manuals/emacs-20.7/html_chapter/emacs_37.html&quot; rel=&quot;nofollow&quot;&gt;command line option&lt;/a&gt; to get more verbose error messages logged to both the screen (during startup) and to the &lt;code&gt;*Messages*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-17T23:32:12.283" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16710" PostTypeId="2" ParentId="16708" CreationDate="2015-09-18T01:37:56.107" Score="0" Body="&lt;p&gt;Try using &lt;code&gt;define-key&lt;/code&gt; instead of the variable approach&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;\C-u&quot; 'evil-scroll-up)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="2550" LastEditDate="2015-09-18T01:54:43.933" LastActivityDate="2015-09-18T01:54:43.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16711" PostTypeId="1" CreationDate="2015-09-18T02:23:22.670" Score="1" ViewCount="370" Body="&lt;p&gt;I'd like my maxima source blocks to return either valid latex that I can display in the org-buffer, or an image of the results (a la imaxima). Ideally, the pure latex solution would be best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example which I'd like to work.    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC maxima :results output raw&#xA;C: matrix([1, -1], [1, 1]);&#xA;V: matrix([\sigma[11], \sigma[12]], [\sigma[12], \sigma[22]]);&#xA;tex(C . V . transpose(C));&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;$$\pmatrix{\sigma_{22}-2\,\sigma_{12}+\sigma_{11}&amp;amp;\sigma_{11}-\sigma&#xA; _{22}\cr \sigma_{11}-\sigma_{22}&amp;amp;\sigma_{22}+2\,\sigma_{12}+\sigma_{&#xA; 11}\cr }$$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result doesn't render in my buffer.&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2015-09-18T02:29:45.543" LastActivityDate="2015-09-18T05:35:29.837" Title="Getting maxima source block to return and display latex equations" Tags="|org-babel|preview-latex|maxima|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16712" PostTypeId="1" CreationDate="2015-09-18T02:47:33.567" Score="1" ViewCount="419" Body="&lt;p&gt;I have YASnippet installed in emacs 24.5, which wasn't working and after a lot of different attempts at a fix, I now have the basics working, however - somewhere along the way - I have collected the following key bindings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't a question of altering the &lt;code&gt;TAB&lt;/code&gt;behaviour (I've seen a lot of threads on that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have yas-minor-mode enabled, I cannot type the letter 'c' at all.&#xA;Here is what is stored in my YASnippet minor mode keybindings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Key bindings:&#xA;key             binding&#xA;---             -------&#xA;&#xA;C-c         Prefix Command&#xA;TAB         yas-expand&#xA;c           Prefix Command     &amp;lt;---- *&#xA;&amp;lt;tab&amp;gt;       yas-expand&#xA;&#xA;c -         Prefix Command     &amp;lt;---- *&#xA;&#xA;C-c &amp;amp;       Prefix Command&#xA;C-c k       yas-expand&#xA;&#xA;c - c       Prefix Command     &amp;lt;---- *&#xA;&#xA;C-c &amp;amp; C-n   yas-new-snippet&#xA;C-c &amp;amp; C-s   yas-insert-snippet&#xA;C-c &amp;amp; C-v   yas-visit-snippet-file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I am no expert, but those I have marked look a little too funky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I remove them?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried recreating those bindings and setting them to &lt;code&gt;nil&lt;/code&gt; - no joy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is no fix, would deleting the package and reinstalling it solve the issue? I am not sure where those kaybindings are actually stored... ?&lt;/p&gt;&#xA;" OwnerUserId="9558" LastActivityDate="2015-09-18T02:47:33.567" Title="Remove strange keybindings from YASnippet" Tags="|key-bindings|yasnippet|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16713" PostTypeId="2" ParentId="16711" CreationDate="2015-09-18T05:35:29.837" Score="2" Body="&lt;p&gt;Based on the &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.html&quot; rel=&quot;nofollow&quot;&gt;babel's recommendation&lt;/a&gt; do you have this exports header someplace in the document?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+header: :exports none&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However for graphical rendering to file/displaying that file in-place, the manual recommends&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+header: :exports results&#xA;#+header: :results graphics&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The other thing to check is the scale variable &gt; 1 under &lt;code&gt;org-format-latex-options&lt;/code&gt;. Yet I still get &lt;code&gt;number-or-marker-p&lt;/code&gt; error every now and then.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-18T05:35:29.837" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16714" PostTypeId="5" CreationDate="2015-09-18T06:28:37.353" Score="0" Body="" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-09-18T06:28:37.353" LastActivityDate="2015-09-18T06:28:37.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16715" PostTypeId="4" CreationDate="2015-09-18T06:28:37.353" Score="0" Body="Maxima is a computer algebra system. It is typically edited in Emacs in maxima-mode, or interacted with in imaxima interactive sessions. It can be also used in Babel source blocks in Org mode." OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-09-18T06:28:37.353" LastActivityDate="2015-09-18T06:28:37.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16716" PostTypeId="2" ParentId="16708" CreationDate="2015-09-18T06:40:00.583" Score="3" Body="&lt;p&gt;Remap &lt;code&gt;C-u&lt;/code&gt; in both the global keymap and the transient one.  Don't forget to map the freed &lt;code&gt;C-u&lt;/code&gt; in both the global keymap and Evil's normal state keymap to something more useful and to poke a hole in Evil's normal state keymap for the universal argument to be picked up from the global keymap:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;C-f&quot;) 'universal-argument)&#xA;(define-key universal-argument-map (kbd &quot;C-u&quot;) nil)&#xA;(define-key universal-argument-map (kbd &quot;C-f&quot;) 'universal-argument-more)&#xA;(define-key global-map (kbd &quot;C-u&quot;) 'kill-whole-line)&#xA;(eval-after-load 'evil-maps&#xA;  '(progn&#xA;     (define-key evil-motion-state-map (kbd &quot;C-f&quot;) nil)&#xA;     (define-key evil-motion-state-map (kbd &quot;C-u&quot;) 'evil-scroll-up)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-09-18T06:40:00.583" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16717" PostTypeId="1" AcceptedAnswerId="16741" CreationDate="2015-09-18T09:59:33.313" Score="3" ViewCount="259" Body="&lt;p&gt;I use Aquamacs. &lt;code&gt;C-;&lt;/code&gt; is bound to &lt;code&gt;toggle-mac-option-modifier&lt;/code&gt;. When I use C-h k C-;, I get&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;^; runs the command toggle-mac-option-modifier, which is an&#xA;  interactive Lisp function in `emulate-mac-keyboard-mode.el'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I want to remove this keybinding so I can use elsewhere. I have tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-;&quot;))&#xA;(define-key toggle-mac-option-modifier [C-\;] nil)&#xA;(define-key emulate-mac-keyboard-mode [C-\;] nil)&#xA;(define-key emulate-mac-keyboard-mode [?\C-\;] nil)&#xA;(define-key emulate-mac-keyboard-mode [C-\;] nil)&#xA;(define-key emulate-mac-keyboard-mode [control-\;] nil)&#xA;(define-key emulate-mac-keyboard-mode-map [control-\;] nil)&#xA;(define-key emulate-mac-keyboard-mode [control \;] nil)&#xA;(define-key emulate-mac-keyboard-mode (kbd &quot;C-;&quot;) nil)&#xA;(define-key toggle-mac-keyboard-modifier (kbd &quot;C-;&quot;) nil)&#xA;(define-key toggle-mac-option-modifier &quot;C-;&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I keep getting the error that the &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;symbol's value as variable is void&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After much searching I found somewhere that maybe the value of the variable had not been initialised, so I tried those after&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'emulate-mac-keyboard-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the same result. I also tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'emulate-mac-keyboard-mode&#xA;  '(progn&#xA;     (define-key emulate-mac-keyboard-mode [C-\;] nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I unset this key?&lt;/p&gt;&#xA;" OwnerUserId="9416" LastEditorUserId="9416" LastEditDate="2015-09-18T10:28:45.680" LastActivityDate="2015-09-18T23:51:25.080" Title="Unset key &quot;C-;&quot; in Aquamacs, bound to toggle-mac-option-modifier" Tags="|key-bindings|aquamacs|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16718" PostTypeId="1" AcceptedAnswerId="16719" CreationDate="2015-09-18T11:49:10.207" Score="10" ViewCount="373" Body="&lt;p&gt;If I run &lt;code&gt;C-x C-c&lt;/code&gt; in emacs, it will close immediately. If I set &lt;code&gt;confirm-kill-emacs&lt;/code&gt; to &lt;code&gt;y-or-n-p&lt;/code&gt; it  will ask for confirmation before closing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;code&gt;y-or-n-p&lt;/code&gt;, I want to set some temporary timer for 3 seconds before closing emacs. So, if I press &lt;code&gt;C-x C-c&lt;/code&gt; it should show something like &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs will be shutdown in 3 seconds. Press &lt;strong&gt;C-g&lt;/strong&gt; to stop&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I don't do anything, it should shutdown emacs, but if I press &lt;code&gt;C-g&lt;/code&gt;, it should prevent shutting down.  How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="14920" LastEditDate="2019-04-08T21:08:14.313" LastActivityDate="2019-04-08T21:08:14.313" Title="How to set temporary halt after C-x C-c?" Tags="|quitting|timers|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16719" PostTypeId="2" ParentId="16718" CreationDate="2015-09-18T12:04:36.390" Score="13" Body="&lt;p&gt;You can roll your own predicate function that waits for 3 seconds and invariably returns non-nil (unless it is interrupted with &lt;kbd&gt;C-g&lt;/kbd&gt;):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq confirm-kill-emacs&#xA;      (lambda (&amp;amp;rest args)&#xA;        (interactive)&#xA;        (message &quot;Quitting in 3 seconds. Press `C-g' to stop.&quot;)&#xA;        (sleep-for 3)&#xA;        t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or a variant which will read any key:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq confirm-kill-emacs&#xA;      (lambda (&amp;amp;rest args)&#xA;        (interactive)&#xA;        (null (read-event &quot;Quitting in 3 seconds. Hit any key to stop.&quot;&#xA;                          nil 3))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-18T12:04:36.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16720" PostTypeId="1" CreationDate="2015-09-18T14:34:03.703" Score="6" ViewCount="1852" Body="&lt;p&gt;I recently upgraded my org-mode from 8.2 to 8.3. So far all works well, but I ran into the following problem: when creating a LaTeX Beamer presentation in org-mode I used to be able to do the following to get a block without a title:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;**                                  :B_block:&#xA;   :PROPERTIES:&#xA;   :BEAMER_env: block&#xA;   :END:&#xA;   Text in block without title&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With Org 8.3 I get the text &lt;code&gt;:B_block:&lt;/code&gt; as title of the block instead of not title at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a MWE:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: toc:nil&#xA;#+TITLE: A title&#xA;#+DATE: 2015-09-17&#xA;#+AUTHOR: The Presenter&#xA;&#xA;#+LATEX_CLASS: beamer&#xA;#+BEAMER_THEME: Madrid&#xA;&#xA;# The following line gives access to the C-c C-b key for headings&#xA;#+startup: beamer&#xA;&#xA;&#xA;* Introduction&#xA;** A block                              :B_block:&#xA;   :PROPERTIES:&#xA;   :BEAMER_env: block&#xA;   :END:&#xA;   Some text in the block.&#xA;**                                  :B_block:&#xA;   :PROPERTIES:&#xA;   :BEAMER_env: block&#xA;   :END:&#xA;   Text in block without title&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With Org 8.2 this gives the following slide:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ZNSXU.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZNSXU.png&quot; alt=&quot;What I used to get and what I like to have&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And Org 8.3 gives:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/mCTRv.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mCTRv.png&quot; alt=&quot;What I currently get&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't find anything related in the Changelog. Did I miss something or have I found a bug? Or have I made some practical use of a bug that has now been 'fixed' ;-)?&lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2017-10-13T07:06:25.757" Title="Org-mode 8.3: Beamer blocks without title no longer work?" Tags="|org-mode|org-export|beamer|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16721" PostTypeId="2" ParentId="16718" CreationDate="2015-09-18T15:04:22.167" Score="7" Body="&lt;p&gt;You can use &lt;code&gt;sit-for&lt;/code&gt; instead of using &lt;code&gt;sleep-for&lt;/code&gt; plus &lt;code&gt;t&lt;/code&gt;.&#xA;And the function need not be a command (&lt;code&gt;interactive&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;sit-for&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt; if it waited and &lt;code&gt;nil&lt;/code&gt; if the user interrupted the wait. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq confirm-kill-emacs&#xA;      (lambda (&amp;amp;rest _)&#xA;        (message &quot;Quit in 3 sec (`C-g' or other action cancels)&quot;)&#xA;        (sit-for 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-18T15:04:22.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16722" PostTypeId="2" ParentId="16720" CreationDate="2015-09-18T15:05:22.553" Score="3" Body="&lt;p&gt;I think it works ok if you remove the &lt;code&gt;:B_block:&lt;/code&gt; from your headlines.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Introduction&#xA;** A block                            &#xA;   :PROPERTIES:&#xA;   :BEAMER_env: block&#xA;   :END:&#xA;   Some text in the block.&#xA;** &#xA;:PROPERTIES:&#xA;:BEAMER_env: block&#xA;:END:&#xA;   Text in block without title&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;leads to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IOPe3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IOPe3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2015-09-18T15:05:22.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16723" PostTypeId="1" AcceptedAnswerId="16779" CreationDate="2015-09-18T15:11:38.090" Score="2" ViewCount="224" Body="&lt;p&gt;&lt;code&gt;kill-whole-line&lt;/code&gt; is quite useful as it completely deletes both content and whitespace unlike &lt;code&gt;kill-line&lt;/code&gt; which only deletes contents in line. But in &lt;code&gt;lisp-mode&lt;/code&gt;, it is necessary  to keep parens in tact and &lt;code&gt;kill-whole-line&lt;/code&gt; fails there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If point is in a buffer like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|(setq foo &quot;bar&quot;)&#xA;(setq foo1 &quot;bar1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if i kill line, it should become&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|(setq foo1 &quot;bar1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but not&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|    &#xA;(setq foo1 &quot;bar1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if point is in a buffer like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA; |(message &quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if i kill line, it should become&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA; |)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can i kill whole line and keep parens intact?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2016-06-22T20:26:49.010" LastActivityDate="2016-06-22T20:26:49.010" Title="Kill the next sexp and its surrounding whitespace" Tags="|kill-text|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16724" PostTypeId="2" ParentId="16704" CreationDate="2015-09-18T15:12:39.777" Score="1" Body="&lt;p&gt;&lt;code&gt;electric-pair-mode&lt;/code&gt; uses &lt;code&gt;post-self-insert-hook&lt;/code&gt; to do the pairing. Inserting a string into the buffer with &lt;code&gt;insert&lt;/code&gt; is not going to trigger the &lt;code&gt;post-self-insert-hook&lt;/code&gt; because you never ran &lt;code&gt;self-insert-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of using &lt;code&gt;insert&lt;/code&gt; use &lt;code&gt;execute-kbd-macro&lt;/code&gt; to treat the insertion as if you had pressed the key for a curly bracket.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-insert-lcurly ()&#xA;  (interactive)&#xA;  (execute-kbd-macro &quot;{&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depending on your major-mode, your syntax table might not recognize certain characters as bracket pairs. The syntax for the characters you want: (, {, [, etc need to be set accordingly. For things like pipe characters, you may want to modify the value of &lt;code&gt;electric-pair-pairs&lt;/code&gt; to include them in order the the mode to work.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-09-18T16:24:29.580" LastActivityDate="2015-09-18T16:24:29.580" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16725" PostTypeId="5" CreationDate="2015-09-18T15:14:32.820" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;https://github.com/abo-abo/lispy&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-18T15:30:40.910" LastActivityDate="2015-09-18T15:30:40.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16726" PostTypeId="4" CreationDate="2015-09-18T15:14:32.820" Score="0" Body="lispy - vi like paredit,  a popular method to navigate and edit LISP code in Emacs." OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-18T15:30:35.107" LastActivityDate="2015-09-18T15:30:35.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16727" PostTypeId="2" ParentId="16641" CreationDate="2015-09-18T15:32:37.677" Score="3" Body="&lt;p&gt;Another semi-modal option is Hydra:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow&quot;&gt;https://github.com/abo-abo/hydra&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the website&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine that you have bound C-c j and C-c k in your config. You want to call C-c j and C-c k in some (arbitrary) sequence. Hydra allows you to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Bind your functions in a way that pressing C-c jjkk3j5k is equivalent to pressing C-c j C-c j C-c k C-c k M-3 C-c j M-5 C-c k. Any key other than j or k exits this state.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Assign a custom hint to this group of functions, so that you know immediately after pressing C-c that you can follow up with j or k.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I haven't used it but it seems interesting.&lt;/p&gt;&#xA;" OwnerUserId="9222" LastActivityDate="2015-09-18T15:32:37.677" CommentCount="0" CommunityOwnedDate="2015-09-22T12:53:32.653" ContentLicense="CC BY-SA 3.0" />
  <row Id="16728" PostTypeId="1" AcceptedAnswerId="20830" CreationDate="2015-09-18T15:46:16.903" Score="7" ViewCount="1104" Body="&lt;p&gt;I am currently adding an &lt;code&gt;#+ATTR_LATEX&lt;/code&gt; before every image in my org-file to center it in the produced LaTeX beamer slides. That is slightly annoying and clutters up the document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to set an &lt;code&gt;#+ATTR_LATEX&lt;/code&gt; for all images or even just for the whole &lt;code&gt;.org&lt;/code&gt; file?&lt;/p&gt;&#xA;" OwnerUserId="5243" LastEditorUserId="253" LastEditDate="2016-03-08T00:28:48.123" LastActivityDate="2016-03-08T00:28:48.123" Title="Setting #+ATTR_LATEX for all images of a document" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16729" PostTypeId="1" AcceptedAnswerId="16732" CreationDate="2015-09-18T17:08:03.980" Score="4" ViewCount="1066" Body="&lt;p&gt;I want a yasnippet to insert an org-mode date and time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The date should be today's date, but the time should be fixed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far my snippet correctly inserts today's date, but not the time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: jdt &#xA;# key: jdt&#xA;# binding: direct-keybinding&#xA;# --&#xA;&#xA;* TODO meditate&#xA;  SCHEDULED: `(let ((x (org-insert-time-stamp (current-time)))))` &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get the time (8:30am) inside the timestamp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Desired output: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO meditate&#xA;  SCHEDULED: &amp;lt;2015-09-18 Fri 8:30am&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-09-18T19:17:19.417" LastActivityDate="2015-09-18T19:49:27.910" Title="in yasnippet, how to insert variable date with fixed time of day?" Tags="|org-mode|yasnippet|time-date|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16730" PostTypeId="1" AcceptedAnswerId="16737" CreationDate="2015-09-18T17:48:58.263" Score="11" ViewCount="1837" Body="&lt;p&gt;I've written several packages for GNU Emacs, but they are useless outside of my company's environment. I want to be able to share the packages with other developers from my company. I also want the packages to be easily discoverable via &lt;code&gt;package-list-packages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that private repository will solve my problems, but I can't find any manual on personal archives setup. As far as I understood, the Elisp info manual suggests plain directories and &lt;code&gt;package-upload-file&lt;/code&gt;, but I don't think it plays nicely with concurrent package updates. Are there any other options that are relatively easy to setup?&lt;/p&gt;&#xA;" OwnerUserId="9568" LastActivityDate="2017-05-22T03:55:41.250" Title="How to setup a private package repository?" Tags="|package-repositories|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16731" PostTypeId="1" AcceptedAnswerId="20631" CreationDate="2015-09-18T17:53:01.153" Score="1" ViewCount="239" Body="&lt;p&gt;in my &lt;code&gt;.emacs&lt;/code&gt; file I have: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; enable skeleton-pair insert globally&#xA;(setq skeleton-pair t)&#xA;;;(setq skeleton-pair-on-word t)&#xA;(global-set-key (kbd &quot;(&quot;) 'skeleton-pair-insert-maybe)&#xA;(global-set-key (kbd &quot;[&quot;) 'skeleton-pair-insert-maybe)&#xA;(global-set-key (kbd &quot;{&quot;) 'skeleton-pair-insert-maybe)&#xA;(global-set-key (kbd &quot;\&quot;&quot;) 'skeleton-pair-insert-maybe)&#xA;(global-set-key (kbd &quot;\'&quot;) 'skeleton-pair-insert-maybe)&#xA;(global-set-key (kbd &quot;\`&quot;) 'skeleton-pair-insert-maybe)&#xA;(global-set-key (kbd &quot;&amp;lt;&quot;) 'skeleton-pair-insert-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;extracted directly from here &lt;a href=&quot;http://www.emacswiki.org/emacs/ESSAutoParens&quot; rel=&quot;nofollow&quot;&gt;ESS autocomplete&lt;/a&gt;. Everything related to ESS is: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;=============================&#xA;;;R&#xA;;;==============================&#xA;;;Enable R&#xA;(add-to-list 'load-path &quot;~/ess-15.03-1/lisp/&quot;)&#xA;(load &quot;ess-site&quot;)&#xA;(setq ess-eval-visibly 'nil)&#xA;(setq ess-ask-for-ess-directory 'nil)&#xA;(add-hook 'ess-R-post-run-hook 'ess-execute-screen-options)&#xA;(define-key inferior-ess-mode-map &quot;\C-cw&quot; 'ess-execute-screen-options)&#xA;&#xA;(eval-after-load &quot;comint&quot;    &#xA;  '(progn&#xA;     (define-key comint-mode-map [up]&#xA;       'comint-previous-matching-input-from-input)&#xA;     (define-key comint-mode-map [down]&#xA;       'comint-next-matching-input-from-input)&#xA;     ;; also recommended for ESS use --&#xA;     (setq comint-scroll-to-bottom-on-output 'others)&#xA;     (setq comint-scroll-show-maximum-output t)&#xA;     ;; somewhat extreme, almost disabling writing in *R*, *shell* buffers above promp&#xA;     (setq comint-scroll-to-bottom-on-input 'this)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Auto-completion of the braces (or auto-closing them) will work with everything: &lt;code&gt;.py&lt;/code&gt; files, &lt;code&gt;.txt&lt;/code&gt; files, even when I am in the R console launched with ESS (&lt;code&gt;M-x R&lt;/code&gt;). However, it will not complete the curly braces when the file is and &lt;code&gt;R&lt;/code&gt; file (e.g. &lt;code&gt;foo.R&lt;/code&gt;). All other &lt;code&gt;skeleton-pair&lt;/code&gt; options work everywhere, the only one that does not is the curly braces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read &lt;a href=&quot;https://stat.ethz.ch/pipermail/ess-help/2010-May/006109.html%60&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; that some other people has problems with curly braces related with the definition of the &lt;code&gt;ess-electric-brace&lt;/code&gt; at &lt;code&gt;ess-mode.el&lt;/code&gt;. However, their problems are different than mine. It seems that they cannot close the braces. In my case, is simply that it will not auto-complete them, so I am not sure the solution will be the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that in &lt;code&gt;ess-mode.el&lt;/code&gt; there is a line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key map &quot;{&quot;          'ess-electric-brace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and there is not such a thing for &lt;code&gt;(&lt;/code&gt; or &lt;code&gt;[&lt;/code&gt; so I guess is related to that, but do not know how to change it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="4103" LastEditorUserId="4103" LastEditDate="2015-09-18T18:02:20.647" LastActivityDate="2016-02-27T19:23:00.487" Title="Emacs-ESS not closing curly braces within .R files" Tags="|init-file|ess|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16732" PostTypeId="2" ParentId="16729" CreationDate="2015-09-18T18:42:16.650" Score="9" Body="&lt;p&gt;You can use the &lt;code&gt;format-time-string&lt;/code&gt; function to format the time in different ways, for your example this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO meditate&#xA;  SCHEDULED: `(format-time-string &quot;&amp;lt;%Y-%m-%d %a 8:30am&amp;gt;&quot; (current-time))`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-18T19:49:27.910" LastActivityDate="2015-09-18T19:49:27.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16733" PostTypeId="2" ParentId="16659" CreationDate="2015-09-18T18:52:11.193" Score="8" Body="&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x ibuffer&lt;/code&gt; to show all open buffers.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;m&lt;/kbd&gt; to mark buffers of interest (or one of the other more interesting marking commands).  &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;E&lt;/kbd&gt; to evaluate a lisp form in each marked buffer, for example,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(highlight-regexp &quot;regexp-custard&quot; 'hi-yellow)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can save the patterns for a particular file with &lt;code&gt;hi-lock-write-interactive-patterns&lt;/code&gt; (Default binding: &lt;code&gt;M-s h w&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, if you &lt;em&gt;always&lt;/em&gt; want to highlight the same regexps across a range of files you could call &lt;code&gt;highlight-regexp&lt;/code&gt; from a mode hook or &lt;code&gt;find-file-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9569" LastEditorUserId="-1" LastEditDate="2015-09-18T20:30:30.537" LastActivityDate="2015-09-18T20:30:30.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16734" PostTypeId="2" ParentId="16652" CreationDate="2015-09-18T19:04:31.550" Score="4" Body="&lt;p&gt;The default value of &lt;code&gt;org-link-file-path-type&lt;/code&gt; is &lt;code&gt;adaptive&lt;/code&gt;, which means make relative links if the link is to the current directory below, otherwise fully qualify the link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can force it to always be relative like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-link-file-path-type 'relative)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can fully-qualify links on a link-by-link basis by passing one universal argument &lt;kbd&gt;C-u&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9571" LastActivityDate="2015-09-18T19:04:31.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16735" PostTypeId="1" CreationDate="2015-09-18T19:05:48.827" Score="7" ViewCount="4077" Body="&lt;p&gt;I usually use Spacemacs in maximized window, thus the date and time presented in mode line is a must.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that spacemacs uses powerline mode to mimic vim, the manuals of both spacemacs and powerline does not tell how to add new section to display additional info (in this case it is date and time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have attempted to comprehend the nyan cat code in color layer, but my elisp skill did not satisfy.&lt;/p&gt;&#xA;" OwnerUserId="9570" LastEditorUserId="591" LastEditDate="2018-06-10T09:37:05.543" LastActivityDate="2020-03-25T14:30:32.947" Title="how to add date and time into spacemacs' mode line" Tags="|spacemacs|powerline|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16736" PostTypeId="2" ParentId="3429" CreationDate="2015-09-18T20:31:55.287" Score="0" Body="&lt;p&gt;From the file deft.el, this works &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq deft-extensions '(&quot;txt&quot; &quot;tex&quot; &quot;org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2517" LastActivityDate="2015-09-18T20:31:55.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16737" PostTypeId="2" ParentId="16730" CreationDate="2015-09-18T20:51:18.763" Score="7" Body="&lt;p&gt;Melpa's source &lt;a href=&quot;https://github.com/milkypostman/melpa&quot; rel=&quot;noreferrer&quot;&gt;is available&lt;/a&gt;, so you could just clone and run that on a server configured to be accessible from only inside your office (and not the whole internet). Your developers would have to be able to access the server, and would have to add the archive to &lt;code&gt;package-archives&lt;/code&gt; the same way one does Melpa, Marmalade, or others. The packages would show up in &lt;code&gt;package-list-packages&lt;/code&gt;, and would be able to be installed and updated just like any other.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-09-18T22:07:02.183" LastActivityDate="2015-09-18T22:07:02.183" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16738" PostTypeId="1" AcceptedAnswerId="16739" CreationDate="2015-09-18T21:03:34.280" Score="1" ViewCount="187" Body="&lt;p&gt;&lt;strong&gt;A trivial Problem?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have somehow managed to set &lt;code&gt;c&lt;/code&gt;and a few other keys to prefix-commands, meaning they wait for a further input (like e.g. &lt;code&gt;C-x&lt;/code&gt; does) and so I cannot actually type the letter &lt;code&gt;c&lt;/code&gt; when &lt;code&gt;yas-minor-mode&lt;/code&gt; is enabled.&#xA;See here for more details:&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/16712/remove-strange-keybindings-from-yasnippet&quot;&gt;Remove strange keybindings from YASnippet&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like &lt;code&gt;yas-minor-mode&lt;/code&gt;, however, and so would like to remove these prefix keys so the normal character &lt;code&gt;c&lt;/code&gt; on my keyboard to actually insert a &lt;code&gt;c&lt;/code&gt; into emacs when in &lt;code&gt;yas-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had tried removing yas-minor-mode and reinstalling - no luck.&#xA;I tried to redfine the keys with things like &lt;code&gt;global-set-key&lt;/code&gt; - again no joy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is another similar looking questions, which made me think I could use the function &lt;code&gt;basic-event-type&lt;/code&gt; - but I now think it isn't correct - plus my version 24.5 emacs doesn'T even seem to have that function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/12326/how-can-i-convert-a-c-key-code-into-a-normal-key-code&quot;&gt;How can I convert a C-key code into a &amp;#39;normal&amp;#39; key code?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-09-18T21:39:26.533" Title="How are normal characters inserted into emacs?" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16739" PostTypeId="2" ParentId="16738" CreationDate="2015-09-18T21:38:00.180" Score="4" Body="&lt;p&gt;Just bind the key that corresponds to the character that you want to insert to &lt;code&gt;self-insert-command&lt;/code&gt;.  E.g., assuming that the variable holding the keymap you want is &lt;code&gt;yas-minor-mode-map&lt;/code&gt;, and if &lt;code&gt;c&lt;/code&gt; is the character: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key yas-minor-mode-map &quot;c&quot; 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or for the &lt;code&gt;global-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key  &quot;c&quot; 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-18T21:38:00.180" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16740" PostTypeId="1" AcceptedAnswerId="16752" CreationDate="2015-09-18T21:57:58.110" Score="3" ViewCount="125" Body="&lt;p&gt;Is it possible to encourage AUCTeX to indent specific environment contents deeper than other environments? My specific case is getting the following indentation for chorus:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\begin{song}&#xA;\begin{verse}&#xA;  Normal 2-spaces indentation&#xA;\end{verse}&#xA;\begin{chorus}&#xA;      Would be great to have it indented&#xA;      deeper.&#xA;\end{chorus}&#xA;\end{song}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried playing with &lt;code&gt;LaTeX-indent-environment-list&lt;/code&gt;. It works well to avoid indenation where inappropriate, the following &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'LaTeX-indent-environment-list '(&quot;song&quot;  (lambda() 0))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;nicely disabled indentation inside &lt;code&gt;song&lt;/code&gt;, but similar trick:. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt; (add-to-list 'LaTeX-indent-environment-list&#xA;     '(&quot;chorus&quot;  (lambda() (* 3 LaTeX-indent-level))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ends up closing such environment incorrectly:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\begin{verse}&#xA;  Normal 2-spaces indentation&#xA;\end{verse}&#xA;\begin{chorus}&#xA;      Would be great to have it indented&#xA;      deeper.&#xA;      \end{chorus}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any workaround?&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="620" LastEditDate="2015-09-19T16:30:03.807" LastActivityDate="2015-09-20T08:16:40.897" Title="Indenting specific environment deeper in AUCTeX" Tags="|indentation|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16741" PostTypeId="2" ParentId="16717" CreationDate="2015-09-18T23:51:25.080" Score="4" Body="&lt;p&gt;I've switched to the railwaycat/homebrew-emacsmacport so I can't test this easily but I used to do this on Aquamacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key osx-key-mode-map (kbd &quot;C-;&quot;) nil) ; was toggle-mac-option-modifier&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7057" LastActivityDate="2015-09-18T23:51:25.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16742" PostTypeId="1" AcceptedAnswerId="16743" CreationDate="2015-09-19T00:41:41.253" Score="0" ViewCount="1190" Body="&lt;p&gt;The instructions for installing yasnippet globally are set forth in the Github &lt;code&gt;README.mdown&lt;/code&gt; -- &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow&quot;&gt;https://github.com/capitaomorte/yasnippet&lt;/a&gt; -- and also in the comments at the top of &lt;code&gt;yasnippet.el&lt;/code&gt; library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer not to to use yasnippet globally, and would rather enable it on a buffer-local basis or only for specific major modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I install/setup yasnippet for buffer-local usage?&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-09-19T03:54:00.883" Title="How to install/setup yasnippet for buffer-local usage?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16743" PostTypeId="2" ParentId="16742" CreationDate="2015-09-19T00:41:41.253" Score="1" Body="&lt;p&gt;Download the latest stable public release of Emacs.  In my case, I downloaded Emacs for OSX (version 24.5.1) from:  &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;http://emacsformacosx.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start Emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install RET yasnippet RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add the following lines to the &lt;code&gt;.emacs&lt;/code&gt; file, save, restart Emacs:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;;; or, instead of using `package-initialize`, use the following:&#xA;;; (add-to-list 'load-path &quot;~/.emacs.d/elpa/yasnippet-0.8.0/&quot;)&#xA;&#xA;(require 'yasnippet)&#xA;&#xA;;; This is the default location as of September 18, 2015.  Add more as needed.&#xA;(setq yas-snippet-dirs '(&quot;~/.emacs.d/elpa/yasnippet-0.8.0/snippets&quot;))&#xA;&#xA;(yas-reload-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In any buffer containing the following major-modes that are supported out-of-the-box, type &lt;code&gt;M-x yas-minor-mode RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c-mode&#xA;c++-mode&#xA;cc-mode&#xA;;; There are no sample snippets in the folder out-of-the-box&#xA;;; cperl-mode&#xA;csharp-mode&#xA;css-mode&#xA;emacs-lisp-mode&#xA;erlang-mode&#xA;f90-mode&#xA;html-mode&#xA;latex-mode&#xA;markdown-mode&#xA;nxml-mode&#xA;objc-mode&#xA;perl-mode&#xA;python-mode&#xA;rst-mode&#xA;ruby-mode&#xA;scala-mode&#xA;snippet-mode&#xA;sql-mode&#xA;text-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If so desired, verify that everything went well by typing:  &lt;code&gt;M-x yas-describe-tables RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable &lt;code&gt;yas-minor-mode&lt;/code&gt; automatically for only certain major-modes, use hooks like the following example in the &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'text-mode-hook 'yas-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-09-19T03:54:00.883" LastActivityDate="2015-09-19T03:54:00.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16744" PostTypeId="1" AcceptedAnswerId="16745" CreationDate="2015-09-19T00:45:21.430" Score="1" ViewCount="216" Body="&lt;p&gt;Every time I open Magit status buffer I need to press &lt;code&gt;?&lt;/code&gt;. &#xA;How can I make it so it opens automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;doing this didn't help&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'magit-mode 'magit-dispatch-popup)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="8992" LastEditDate="2015-09-19T00:54:49.373" LastActivityDate="2021-02-23T10:20:28.377" Title="Magit help popup enabled by default" Tags="|magit|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16745" PostTypeId="2" ParentId="16744" CreationDate="2015-09-19T01:20:32.447" Score="5" Body="&lt;p&gt;There's no hook variable named &lt;code&gt;magit-mode&lt;/code&gt;. You were looking for &lt;code&gt;magit-mode-hook&lt;/code&gt; (mode hooks are always named &lt;code&gt;MODENAME-hook&lt;/code&gt;). That's not the solution here, though.&lt;/p&gt;&#xA;&lt;p&gt;I can only imagine this very quickly going from &amp;quot;I have to press &lt;kbd&gt;?&lt;/kbd&gt; every time to get the help&amp;quot; to &amp;quot;I have to press &lt;kbd&gt;q&lt;/kbd&gt; every time to dismiss the help&amp;quot;, however you can do what you've asked for by defining some after-advice for &lt;code&gt;magit-status&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice magit-status (after my-magit-status-dispatch-popup)&#xA;  (magit-dispatch-popup))&#xA;(ad-activate 'magit-status)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;n.b. That won't trigger for anything &lt;em&gt;other&lt;/em&gt; than calling &lt;code&gt;magit-status&lt;/code&gt;, so refreshing the status buffer (which calls &lt;code&gt;magit-refresh&lt;/code&gt;) won't do it (which I think is a good thing).&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Edit: In more recent versions of Magit the above code causes a byte-compilation warning (see comments), but you could use the following variation instead:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice magit-status (after my-magit-status-dispatch)&#xA;  (call-interactively 'magit-dispatch))&#xA;(ad-activate 'magit-status)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2021-02-23T10:20:28.377" LastActivityDate="2021-02-23T10:20:28.377" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="16746" PostTypeId="2" ParentId="16688" CreationDate="2015-09-19T06:26:55.840" Score="12" Body="&#xA;&#xA;&lt;p&gt;This answer is inspired after collective suggestions on the &lt;a href=&quot;http://www.mail-archive.com/emacs-orgmode@gnu.org/msg100527.html&quot; rel=&quot;noreferrer&quot;&gt;emacs-org-mode GNU list&lt;/a&gt; to use the &lt;code&gt;org-entity&lt;/code&gt; ( &lt;code&gt;C-h i g&lt;/code&gt; &lt;code&gt;(org) Special symbols&lt;/code&gt; ) &lt;code&gt;\ast{}&lt;/code&gt; instead of &lt;em&gt;zero width space&lt;/em&gt; characters (which I suggested in &lt;a href=&quot;https://emacs.stackexchange.com/a/16702/115&quot;&gt;my other answer here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a generic solution where the user does not need to remember the org entities for various symbols. It inserts the org entity (if available) when user does &lt;code&gt;C-u SYMBOL&lt;/code&gt;; &lt;strong&gt;works for &lt;code&gt;C-u *&lt;/code&gt;, &lt;code&gt;C-u /&lt;/code&gt;, &lt;code&gt;C-u =&lt;/code&gt;, etc.&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/org-entity-get-name (char)&#xA;  &quot;Return the entity name for CHAR. For example, return \&quot;ast\&quot; for *.&quot;&#xA;  (let ((ll (append org-entities-user&#xA;                    org-entities))&#xA;        e name utf8)&#xA;    (catch 'break&#xA;      (while ll&#xA;        (setq e (pop ll))&#xA;        (when (not (stringp e))&#xA;          (setq utf8 (nth 6 e))&#xA;          (when (string= char utf8)&#xA;            (setq name (car e))&#xA;            (throw 'break name)))))))&#xA;&#xA;(defun modi/org-insert-org-entity-maybe (&amp;amp;rest args)&#xA;  &quot;When the universal prefix C-u is used before entering any character,&#xA;    insert the character's `org-entity' name if available.&#xA;&#xA;    If C-u prefix is not used and if `org-entity' name is not available, the&#xA;    returned value `entity-name' will be nil.&quot;&#xA;  ;; It would be fine to use just (this-command-keys) instead of&#xA;  ;; (substring (this-command-keys) -1) below in emacs 25+.&#xA;  ;; But if the user pressed &quot;C-u *&quot;, then&#xA;  ;;  - in emacs 24.5, (this-command-keys) would return &quot;^U*&quot;, and&#xA;  ;;  - in emacs 25.x, (this-command-keys) would return &quot;*&quot;.&#xA;  ;; But in both versions, (substring (this-command-keys) -1) will return&#xA;  ;; &quot;*&quot;, which is what we want.&#xA;  ;; http://thread.gmane.org/gmane.emacs.orgmode/106974/focus=106996&#xA;  (let ((pressed-key (substring (this-command-keys) -1))&#xA;        entity-name)&#xA;    (when (and (listp args) (eq 4 (car args)))&#xA;      (setq entity-name (modi/org-entity-get-name pressed-key))&#xA;      (when entity-name&#xA;        (setq entity-name (concat &quot;\\&quot; entity-name &quot;{}&quot;))&#xA;        (insert entity-name)&#xA;        (message (concat &quot;Inserted `org-entity' &quot;&#xA;                         (propertize entity-name&#xA;                                     'face 'font-lock-function-name-face)&#xA;                         &quot; for the symbol &quot;&#xA;                         (propertize pressed-key&#xA;                                     'face 'font-lock-function-name-face)&#xA;                         &quot;.&quot;))))&#xA;    entity-name))&#xA;&#xA;;; Run `org-self-insert-command' only if `modi/org-insert-org-entity-maybe'&#xA;;; returns nil.&#xA;(advice-add 'org-self-insert-command :before-until #'modi/org-insert-org-entity-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So when the user types &lt;code&gt;C-u *&lt;/code&gt;, &lt;code&gt;\ast{}&lt;/code&gt; is inserted and the below message is displayed in the echo area,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Inserted ‘org-entity’ \ast{} for the symbol *.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If &lt;code&gt;org-pretty-entities&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt; above, the inserted &lt;code&gt;\ast{}&lt;/code&gt; will be &lt;strong&gt;displayed&lt;/strong&gt; as &lt;code&gt;*&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If an &lt;code&gt;org-entity&lt;/code&gt; does not exist for a character &lt;strong&gt;X&lt;/strong&gt; and if the user does &lt;code&gt;C-u&lt;/code&gt; &lt;strong&gt;X&lt;/strong&gt;, &lt;strong&gt;X&lt;/strong&gt; is simply inserted 4 times (as &lt;code&gt;C-u&lt;/code&gt; would usually do). &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-11T13:37:36.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16747" PostTypeId="1" AcceptedAnswerId="16755" CreationDate="2015-09-19T11:45:19.893" Score="2" ViewCount="149" Body="&lt;p&gt;I am writing a function to select a region (say 2 lines).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun select-some-region ()&#xA;  (interactive)&#xA;    (push-mark (point) nil t)&#xA;      (forward-line 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When point is in a buffer like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; |this is first&#xA; this is second&#xA; this is third&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;M-x select-some-region&lt;/code&gt; it will select two line and I press &lt;code&gt;C-g&lt;/code&gt; it will deselect the region but leaves point somewhere else like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; this is first&#xA; this is second&#xA; |this is third&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I leave point in actual position where it was before when &lt;code&gt;C-g&lt;/code&gt; is pressed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my actual &lt;code&gt;select-some-regions&lt;/code&gt;  function, I have to select few  lines before point and few lines after point.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-21T05:22:48.827" LastActivityDate="2015-09-21T09:29:10.280" Title="Leave point in original position when C-g is pressed?" Tags="|region|point|mark|quitting|" AnswerCount="5" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16748" PostTypeId="1" AcceptedAnswerId="17062" CreationDate="2015-09-19T13:02:36.090" Score="1" ViewCount="528" Body="&lt;p&gt;I am trying to export one repository stash to another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terminal I can do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git stash show -p &amp;gt; temp.patch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when in magit  buffer, if I run &lt;code&gt;z&lt;/code&gt; it is not showing any switch for &lt;code&gt;-p&lt;/code&gt; before or after &lt;code&gt;s&lt;/code&gt;. So, how can I export stash using  magit?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-10-01T18:36:54.043" Title="How to export stash using magit?" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16749" PostTypeId="1" AcceptedAnswerId="17574" CreationDate="2015-09-19T13:37:35.673" Score="2" ViewCount="5230" Body="&lt;p&gt;I've just installed emacs 24 on my Windows 7 32-bit OS. Usually, I activate Colemak keyboard layout and use it to do all sorts of typing (in browsers, spreadsheets or word processors). It works fine and has tilde (~) and backtick (`) on a key in the top left corner of the keyboard, between the &lt;kbd&gt;Esc&lt;/kbd&gt; key and the &lt;kbd&gt;Tab&lt;/kbd&gt;, at the left of key &lt;kbd&gt;1&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wJvjd.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wJvjd.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs, most of the Colemak keys are recognized but that key doesn't work. If I press it, emacs' cursor stops blinking and after 4-5 seconds types 'sssssssssss' or whatever alphabet key I pressed after that key. For now I've managed to get tilde to work by putting &lt;code&gt;(set global-key [f2] &quot;~&quot;)&lt;/code&gt; and was thinking of associating &lt;kbd&gt;F3&lt;/kbd&gt; with backtick, but I was wandering if there's a way to make emacs recognize that key. That way I would get backtick by pressing the ordinary key and tilde by pressing it in combination with &lt;kbd&gt;Shift&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;EDIT&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I have downloaded the Colemak layout from the official Colemak Forum that caters to all users, whether on Windows, Linux or Mac. A zip file can be downloaded from section &lt;strong&gt;&lt;a href=&quot;http://dl.dropbox.com/u/14504410/Keyboards/dreymar/pkl/PortableKeyboardLayout_DreymaR.zip&quot; rel=&quot;nofollow noreferrer&quot;&gt;[5.1 DOWNLOAD AND INSTALL]&lt;/a&gt;&lt;/strong&gt; of a thread titled &quot;&lt;a href=&quot;http://forum.colemak.com/viewtopic.php?id=1467&quot; rel=&quot;nofollow noreferrer&quot;&gt;DreymaR's Big Bag of Keyboard Tricks - PKL/Windows Edition!&lt;/a&gt;&quot;. The decompressed zip file has some folders and files inside, among them a &lt;em&gt;pkl.exe&lt;/em&gt;. I have placed a shortcut to this file, next to Windows' &quot;Start&quot; button and everytime I log into my OS I double click it and launch Colemak. The 2 most important files contained in the zip file are &lt;em&gt;pkl.ini&lt;/em&gt; and &lt;em&gt;layout.ini&lt;/em&gt;, the latter being inside &lt;strong&gt;layouts&lt;/strong&gt; &gt; &lt;strong&gt;colemak-eD_ISO&lt;/strong&gt; folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;pkl.ini&lt;/em&gt; allows one to set the locale or language of the keyboard by adding this line &lt;code&gt;layout = colemak-eD-Lat_ISO:Colemak[eD]-ISO-It&lt;/code&gt; and commenting out any other similar lines so they don't interfere. The &lt;em&gt;layout.ini&lt;/em&gt; allows you to customize certain keys. I, for instance, tweaked it to allow CapsLock to write capital letters just like it does in QWERTY. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are 2 &quot;Display help images&quot; that come with the colemak bundle. The first is Ordinary keyboard, the second one shows changes as &lt;kbd&gt;Shift&lt;/kbd&gt; is pressed. They resemble very much my keyboard layout. As it turns out, it's the top left corner key that doesn't get recognized by Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oYZtu.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oYZtu.jpg&quot; alt=&quot;colemak italian keyboard&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/OmGYd.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OmGYd.jpg&quot; alt=&quot;keyboard changes with Shift key pressed&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;EDIT 2&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The main reason why I need backtick to be recognized is so that I can use keyboard shortcuts in AUCTeX to get Greek alphabet. By default, to get the Greek letter alpha you can press backtick and &lt;kbd&gt;a&lt;/kbd&gt;. This spurs EMACS to immediately substitute 'a' with 'α'. That's the use behind my question. I tried to work-around this problem by adding this line in my &lt;em&gt;.emacs&lt;/em&gt; file: &lt;code&gt;(setq LaTeX-math-abbrev-prefix  &quot;'&quot;)&lt;/code&gt; but writing words such as &lt;em&gt;didn't&lt;/em&gt; or &lt;em&gt;ain't&lt;/em&gt; became problematic since EMACS kept substituting the single quote followed by letter 't' with Greek letter 'tau'.&lt;/p&gt;&#xA;" OwnerUserId="9269" LastEditorUserId="9269" LastEditDate="2015-10-02T12:05:01.697" LastActivityDate="2015-10-21T19:05:30.597" Title="How to set emacs to recognize backtick and tilde with a Colemak keyboard layout?" Tags="|key-bindings|keymap|microsoft-windows|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16750" PostTypeId="1" CreationDate="2015-09-19T13:53:14.460" Score="7" ViewCount="6637" Body="&lt;p&gt;In atom, C++ files are well colored unlike emacs cpp-mode. Emacs does not highlight references to member variables, function calls or member functions. They all are uncolored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The left is from emacs and the other is from atom:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KFSu3.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KFSu3.png&quot; alt=&quot;Syntax coloring in emacs&quot;&gt;&lt;/a&gt; &lt;a href=&quot;https://i.stack.imgur.com/VxhTv.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VxhTv.png&quot; alt=&quot;Syntax coloring in atom&quot;&gt;&lt;/a&gt;&#xA;See, emacs does not syntax-color for variables and functions apart from their declarations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs does not utilize a semantic syntax highlighting system, neither does atom. I think such highlighting can be easily added using regexp like in atom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Atom, for example, looks for parantheses to distinguish function calls from variables. Similarly it looks for a dot to distinguish member variables from the others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to add these coloring rules to emacs, however, I am just a beginner who does not know regexp and font-lock-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you help me with this issue?&lt;/p&gt;&#xA;" OwnerUserId="9574" LastEditorUserId="9574" LastEditDate="2015-09-19T14:58:53.740" LastActivityDate="2021-10-19T03:40:50.400" Title="Better syntax-higlighting for member variables and function calls in cpp-mode" Tags="|syntax-highlighting|c++|c|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16751" PostTypeId="1" CreationDate="2015-09-19T13:53:39.237" Score="0" ViewCount="775" Body="&lt;p&gt;After I start &lt;code&gt;imaxima&lt;/code&gt; and get a prompt, I try typing &lt;code&gt;1 + 1&lt;/code&gt; or any other expression and evaluate. Then I get the error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  enter code hereDebugger entered--Lisp error: (error &quot;Not enough arguments for format string&quot;)&#xA;  format(&quot;\\color[rgb]{%f,%f,%f}&quot;)&#xA;  apply(format &quot;\\color[rgb]{%f,%f,%f}&quot; nil)&#xA;  (concat (format &quot;\\begin{dmath}[number={%s}]\n&quot; label) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) str (format &quot;\\end{dmath}\n&quot;))&#xA;  (if label (concat (format &quot;\\begin{dmath}[number={%s}]\n&quot; label) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) str (format &quot;\\end{dmath}\n&quot;)) (concat (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) &quot;\\begin{math} \\displaystyle &quot; str (format &quot; \\end{math}\n&quot;)))&#xA;  (insert (format &quot;\\documentclass[%dpt,leqno]{article}\n&quot; imaxima-pt-size) &quot;\n% mylatex\n&quot; (format &quot;\\setlength{\\textwidth}{%dmm}\n&quot; (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat &quot;\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}&quot; &quot;\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n&quot;) &quot;&quot;) &quot;\\begin{document}\n&quot; (apply (quote format) &quot;\\pagecolor[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb (imaxima-get-bg-color))) &quot;\\pagestyle{empty}\n&quot; (format &quot;\\begin{%s}\n&quot; imaxima-fnt-size) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-label-color)) &quot;\\tt&quot; (if label (concat (format &quot;\\begin{dmath}[number={%s}]\n&quot; label) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) str (format &quot;\\end{dmath}\n&quot;)) (concat (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) &quot;\\begin{math} \\displaystyle &quot; str (format &quot; \\end{math}\n&quot;))) (format &quot;\\end{%s}\n&quot; imaxima-fnt-size) &quot;\\end{document}&quot;)&#xA;  (save-current-buffer (set-buffer temp-buffer) (insert (format &quot;\\documentclass[%dpt,leqno]{article}\n&quot; imaxima-pt-size) &quot;\n% mylatex\n&quot; (format &quot;\\setlength{\\textwidth}{%dmm}\n&quot; (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat &quot;\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}&quot; &quot;\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n&quot;) &quot;&quot;) &quot;\\begin{document}\n&quot; (apply (quote format) &quot;\\pagecolor[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb (imaxima-get-bg-color))) &quot;\\pagestyle{empty}\n&quot; (format &quot;\\begin{%s}\n&quot; imaxima-fnt-size) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-label-color)) &quot;\\tt&quot; (if label (concat (format &quot;\\begin{dmath}[number={%s}]\n&quot; label) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) str (format &quot;\\end{dmath}\n&quot;)) (concat (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) &quot;\\begin{math} \\displaystyle &quot; str (format &quot; \\end{math}\n&quot;))) (format &quot;\\end{%s}\n&quot; imaxima-fnt-size) &quot;\\end{document}&quot;))&#xA;  (prog1 (save-current-buffer (set-buffer temp-buffer) (insert (format &quot;\\documentclass[%dpt,leqno]{article}\n&quot; imaxima-pt-size) &quot;\n% mylatex\n&quot; (format &quot;\\setlength{\\textwidth}{%dmm}\n&quot; (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat &quot;\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}&quot; &quot;\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n&quot;) &quot;&quot;) &quot;\\begin{document}\n&quot; (apply (quote format) &quot;\\pagecolor[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb (imaxima-get-bg-color))) &quot;\\pagestyle{empty}\n&quot; (format &quot;\\begin{%s}\n&quot; imaxima-fnt-size) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-label-color)) &quot;\\tt&quot; (if label (concat (format &quot;\\begin{dmath}[number={%s}]\n&quot; label) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) str (format &quot;\\end{dmath}\n&quot;)) (concat (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) &quot;\\begin{math} \\displaystyle &quot; str (format &quot; \\end{math}\n&quot;))) (format &quot;\\end{%s}\n&quot; imaxima-fnt-size) &quot;\\end{document}&quot;)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0)))&#xA;  (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert (format &quot;\\documentclass[%dpt,leqno]{article}\n&quot; imaxima-pt-size) &quot;\n% mylatex\n&quot; (format &quot;\\setlength{\\textwidth}{%dmm}\n&quot; (round (/ (imaxima-get-window-width) imaxima-scale-factor))) (if linear (concat &quot;\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}&quot; &quot;\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n&quot;) &quot;&quot;) &quot;\\begin{document}\n&quot; (apply (quote format) &quot;\\pagecolor[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb (imaxima-get-bg-color))) &quot;\\pagestyle{empty}\n&quot; (format &quot;\\begin{%s}\n&quot; imaxima-fnt-size) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-label-color)) &quot;\\tt&quot; (if label (concat (format &quot;\\begin{dmath}[number={%s}]\n&quot; label) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) str (format &quot;\\end{dmath}\n&quot;)) (concat (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-equation-color)) &quot;\\begin{math} \\displaystyle &quot; str (format &quot; \\end{math}\n&quot;))) (format &quot;\\end{%s}\n&quot; imaxima-fnt-size) &quot;\\end{document}&quot;)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))&#xA;  (let ((temp-file filename) (temp-buffer (get-buffer-create (generate-new-buffer-name &quot; *temp file*&quot;)))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert (format &quot;\\documentclass[%dpt,leqno]{article}\n&quot; imaxima-pt-size) &quot;\n% mylatex\n&quot; (format &quot;\\setlength{\\textwidth}{%dmm}\n&quot; (round (/ ... imaxima-scale-factor))) (if linear (concat &quot;\\renewcommand{\\ifrac}[2]{\\left(#1\\right)/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracd}[2]{#1/\\left(#2\\right)}&quot; &quot;\\renewcommand{\\ifracn}[2]{\\left(#1\\right)/#2}&quot; &quot;\\renewcommand{\\isubscript}[2]{\\mathrm{subscript}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\iexpt}[2]{\\mathrm{expt}\\left(#1,#2\\right)}&quot; &quot;\\renewcommand{\\isqrt}[1]{\\left(#1\\right)^{1/2}}\n&quot;) &quot;&quot;) &quot;\\begin{document}\n&quot; (apply (quote format) &quot;\\pagecolor[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb (imaxima-get-bg-color))) &quot;\\pagestyle{empty}\n&quot; (format &quot;\\begin{%s}\n&quot; imaxima-fnt-size) (apply (quote format) &quot;\\color[rgb]{%f,%f,%f}&quot; (imaxima-color-to-rgb imaxima-label-color)) &quot;\\tt&quot; (if label (concat (format &quot;\\begin{dmath}[number={%s}]\n&quot; label) (apply ... &quot;\\color[rgb]{%f,%f,%f}&quot; ...) str (format &quot;\\end{dmath}\n&quot;)) (concat (apply ... &quot;\\color[rgb]{%f,%f,%f}&quot; ...) &quot;\\begin{math} \\displaystyle &quot; str (format &quot; \\end{math}\n&quot;))) (format &quot;\\end{%s}\n&quot; imaxima-fnt-size) &quot;\\end{document}&quot;)) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))&#xA;  imaxima-tex-to-dvi(&quot;2&quot; &quot;\\%o1&quot; &quot;/tmp/imaxima14593VaH/1.tex&quot;)&#xA;  (cond ((eql eps-or-latex (quote latex)) (if (string-match &quot;\\(\\([^]*\\)\\)&quot; str) (progn (setq label (match-string 2 str)) (setq str (replace-match &quot;&quot; t t str 1)))) (if no-label-p (setq label nil)) (imaxima-tex-to-dvi str label (concat filename &quot;.tex&quot;)) (imaxima-dvi-to-ps filename)) ((eql eps-or-latex (quote eps)) (copy-file str psfilename) (setq label nil)))&#xA;  (let* ((filename (expand-file-name (number-to-string (setq imaxima-file-counter (1+ imaxima-file-counter))) imaxima-tmp-subdir)) (psfilename (concat filename &quot;.ps&quot;)) (label &quot;*&quot;)) (cond ((eql eps-or-latex (quote latex)) (if (string-match &quot;\\(\\([^]*\\)\\)&quot; str) (progn (setq label (match-string 2 str)) (setq str (replace-match &quot;&quot; t t str 1)))) (if no-label-p (setq label nil)) (imaxima-tex-to-dvi str label (concat filename &quot;.tex&quot;)) (imaxima-dvi-to-ps filename)) ((eql eps-or-latex (quote eps)) (copy-file str psfilename) (setq label nil))) (if (not (file-exists-p psfilename)) (imaxima-latex-error str filename) (let* ((--cl-var-- (imaxima-extract-bb psfilename)) (bb (nth 0 --cl-var--)) (width (nth 1 --cl-var--)) (height (nth 2 --cl-var--))) (let ((ratio (/ (imaxima-get-window-width) (imaxima-bp-to-mm width)))) (if (&amp;lt; ratio 1.0) (progn (if (or ... ...) (let ... ...) (if imaxima-linearize-flag ...))))) (if (eq imaxima-image-type (quote postscript)) nil (imaxima-ps-to-image psfilename filename bb width height)) (cond (nil (if (eq system-type (quote windows-nt)) (progn (kill-process imaxima-gs-process) (imaxima-start-gs))) (xemacs-set-imagefile-properties filename imaxima-image-type str)) (t (propertize (concat &quot;(&quot; label &quot;) &quot; str) (quote display) (if (eq imaxima-image-type ...) (create-image psfilename ... nil :pt-width width :pt-height height :bounding-box bb :ascent ... :mask ...) (create-image filename imaxima-image-type nil :ascent ... :mask ...))))))))&#xA;  imaxima-make-image(&quot;\\%o12&quot; latex)&#xA;  (setq image (imaxima-make-image match (quote latex)))&#xA;  (concat output (setq image (imaxima-make-image match (quote latex))))&#xA;  (setq output (concat output (setq image (imaxima-make-image match (quote latex)))))&#xA;  (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image (imaxima-make-image match (quote latex))))) (if (null main-output) (setq main-output image)))&#xA;  (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image (imaxima-make-image match (quote latex))))) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))&#xA;  (cond ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((iprompt (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output iprompt)) (cond ((and continuation main-output) (funcall (car continuation) main-output)) ((and continuation (null main-output)) (funcall (car continuation) &quot;&quot;)))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image (imaxima-make-image match ...)))) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output (imaxima-make-image match (quote latex))))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output match))) (message &quot;Unexpected error encountered in imaxima-filter&quot;))))&#xA;  (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((iprompt (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output iprompt)) (cond ((and continuation main-output) (funcall ... main-output)) ((and continuation ...) (funcall ... &quot;&quot;)))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output)) image) (setq imaxima-output rest) (setq output (concat output (setq image ...))) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output (imaxima-make-image match ...)))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match (match-string 1 imaxima-output)) (rest (match-string 2 imaxima-output))) (setq imaxima-output rest) (setq output (concat output match))) (message &quot;Unexpected error encountered in imaxima-filter&quot;)))))&#xA;  (while (not (string= imaxima-output &quot;&quot;)) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((iprompt ...) (rest ...)) (setq imaxima-output rest) (setq output (concat output iprompt)) (cond (... ...) (... ...))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match ...) (rest ...) image) (setq imaxima-output rest) (setq output (concat output ...)) (if (null main-output) (setq main-output image))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match ...) (rest ...)) (setq imaxima-output rest) (setq output (concat output ...))) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ((match ...) (rest ...)) (setq imaxima-output rest) (setq output (concat output match))) (message &quot;Unexpected error encountered in imaxima-filter&quot;))))))&#xA;  (let ((lastchar (aref str (1- len))) (output &quot;&quot;)) (if (and (char-equal lastchar 10) (&amp;gt; len 1)) (progn (setq lastchar (aref str (- len 2))))) (message &quot;Processing Maxima output...&quot;) (while (not (string= imaxima-output &quot;&quot;)) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let (... ...) (setq imaxima-output rest) (setq output ...) (cond ... ...)) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let (... ... image) (setq imaxima-output rest) (setq output ...) (if ... ...)) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let (... ...) (setq imaxima-output rest) (setq output ...)) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))) (t (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let (... ...) (setq imaxima-output rest) (setq output ...)) (message &quot;Unexpected error encountered in imaxima-filter&quot;)))))) (message &quot;Processing Maxima output...done&quot;) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))&#xA;  (if (zerop len) (progn (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) &quot;&quot;)) (setq imaxima-output (concat imaxima-output str)) (let ((lastchar (aref str (1- len))) (output &quot;&quot;)) (if (and (char-equal lastchar 10) (&amp;gt; len 1)) (progn (setq lastchar (aref str (- len 2))))) (message &quot;Processing Maxima output...&quot;) (while (not (string= imaxima-output &quot;&quot;)) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ... ... ... ...) (setq imaxima-filter-running nil) (throw ... output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ... ... ... ...) (setq imaxima-filter-running nil) (throw ... output))) ((string= 1stchar &quot;&quot;) (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ... ... ...) (setq imaxima-filter-running nil) (throw ... output))) (t (if (string-match &quot;\\([^]*\\)\\(\\(.\\|\n\\)*\\)&quot; imaxima-output) (let ... ... ...) (message &quot;Unexpected error encountered in imaxima-filter&quot;)))))) (message &quot;Processing Maxima output...done&quot;) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output)))&#xA;  (let* ((len (length str)) main-output) (if (zerop len) (progn (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) &quot;&quot;)) (setq imaxima-output (concat imaxima-output str)) (let ((lastchar (aref str (1- len))) (output &quot;&quot;)) (if (and (char-equal lastchar 10) (&amp;gt; len 1)) (progn (setq lastchar (aref str (- len 2))))) (message &quot;Processing Maxima output...&quot;) (while (not (string= imaxima-output &quot;&quot;)) (let ((1stchar (substring imaxima-output 0 1))) (cond ((string= 1stchar &quot;&quot;) (if ... ... ... ...)) ((string= 1stchar &quot;&quot;) (if ... ... ... ...)) ((string= 1stchar &quot;&quot;) (if ... ... ... ...)) (t (if ... ... ...))))) (message &quot;Processing Maxima output...done&quot;) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output))))&#xA;  (catch (quote --cl-block-imaxima-filter--) (if imaxima-filter-running (progn (setq imaxima-output (concat imaxima-output str)) (debug-imaxima-filter &quot;reenter&quot;) (throw (quote --cl-block-imaxima-filter--) &quot;&quot;))) (setq imaxima-filter-running t) (debug-imaxima-filter str) (let* ((len (length str)) main-output) (if (zerop len) (progn (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) &quot;&quot;)) (setq imaxima-output (concat imaxima-output str)) (let ((lastchar (aref str (1- len))) (output &quot;&quot;)) (if (and (char-equal lastchar 10) (&amp;gt; len 1)) (progn (setq lastchar (aref str ...)))) (message &quot;Processing Maxima output...&quot;) (while (not (string= imaxima-output &quot;&quot;)) (let ((1stchar ...)) (cond (... ...) (... ...) (... ...) (t ...)))) (message &quot;Processing Maxima output...done&quot;) (setq imaxima-filter-running nil) (throw (quote --cl-block-imaxima-filter--) output)))))&#xA;  imaxima-filter(&quot;\n\\%o12\n(%i2) &quot;)&#xA;  comint-output-filter(#&amp;lt;process imaxima&amp;gt; &quot;\n\\%o12\n(%i2) &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I kill the buffer I see:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Process imaxima hangup&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It was working in the past, but I do remember encountering this error before. How might I resolve it?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2015-09-19T16:18:15.207" Title="*imaxima* error: &quot;Not enough arguments for format string&quot;" Tags="|maxima|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16752" PostTypeId="2" ParentId="16740" CreationDate="2015-09-19T15:30:15.317" Score="4" Body="&lt;p&gt;The function listed in &lt;code&gt;LaTeX-indent-environment-list&lt;/code&gt; should also cater for backindenting the &lt;code&gt;\end&lt;/code&gt;, see for example &lt;code&gt;LaTeX-indent-tabular&lt;/code&gt;.  Add the following code to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mg-LaTeX-indent-chorus ()&#xA;  (cl-destructuring-bind&#xA;   (beg-pos . beg-col)&#xA;   (LaTeX-env-beginning-pos-col)&#xA;   (cond ((looking-at &quot;\\\\end{chorus}&quot;)&#xA;      beg-col)&#xA;&#xA;     (t&#xA;      (+ (* 3 LaTeX-indent-level) beg-col)))))&#xA;&#xA;(defun mg-LaTeX-indent-song ()&#xA;  (save-excursion&#xA;    (LaTeX-find-matching-begin)&#xA;    (current-column)))&#xA;&#xA;(add-to-list 'LaTeX-indent-environment-list '(&quot;song&quot;   mg-LaTeX-indent-song))&#xA;(add-to-list 'LaTeX-indent-environment-list '(&quot;chorus&quot; mg-LaTeX-indent-chorus))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the following LaTeX code is correctly indented:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\begin{foo}&#xA;  \begin{song}&#xA;  \begin{verse}&#xA;    Normal 2-spaces indentation&#xA;  \end{verse}&#xA;  \begin{chorus}&#xA;        Would be great to have it indented&#xA;        deeper.&#xA;  \end{chorus}&#xA;  \end{song}&#xA;\end{foo}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-09-20T08:16:40.897" LastActivityDate="2015-09-20T08:16:40.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16753" PostTypeId="2" ParentId="16747" CreationDate="2015-09-19T15:45:07.313" Score="1" Body="&#xA;&#xA;&lt;p&gt;Can this help?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun select-some-region ()&#xA;  (interactive)&#xA;   (let ((this-point (point))) (forward-line 2)  (push-mark (point) nil t)&#xA;      (goto-char this-point) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="115" LastEditDate="2015-09-21T02:19:09.260" LastActivityDate="2015-09-21T02:19:09.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16754" PostTypeId="2" ParentId="16751" CreationDate="2015-09-19T16:18:15.207" Score="2" Body="&lt;p&gt;&lt;code&gt;format&lt;/code&gt; is being called with only one argument, the format string. But the format-string argument has three &lt;code&gt;%&lt;/code&gt; constructs, meaning that &lt;code&gt;format&lt;/code&gt; expects three additional arguments, whose values are to be used by those &lt;code&gt;%&lt;/code&gt; constructs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The offending code, which calls &lt;code&gt;format&lt;/code&gt; incorrectly, is apparently in function &lt;code&gt;imaxima-tex-to-dvi&lt;/code&gt; or in some function that it calls.  Check the source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;M-x debug-on-entry imaxima-tex-to-dvi&lt;/code&gt; and then step through the debugger using &lt;code&gt;d&lt;/code&gt;, to see exactly where the problem is.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-19T16:18:15.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16755" PostTypeId="2" ParentId="16747" CreationDate="2015-09-19T16:27:33.137" Score="1" Body="&#xA;&#xA;&lt;p&gt;After going through web-mode source code, i found this solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Store initial point in some  variable in function. Write a function which moves point to that location  when  &lt;code&gt;C-g&lt;/code&gt; is pressed. Now hook this function to &lt;code&gt;post-command-hook&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun select-some-region ()&#xA;  (interactive)&#xA;  (setq initial-pos (point))&#xA;  (push-mark (point) nil t)&#xA;  (forward-line 2))    &#xA;&#xA;(defun move-point ()&#xA;  (when (eq this-command 'keyboard-quit)&#xA;    (goto-char initial-pos)))&#xA;&#xA;(add-hook 'post-command-hook 'move-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="115" LastEditDate="2015-09-21T02:18:33.827" LastActivityDate="2015-09-21T02:18:33.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16756" PostTypeId="1" AcceptedAnswerId="16760" CreationDate="2015-09-19T16:35:59.667" Score="5" ViewCount="460" Body="&lt;p&gt;I look for compacting expression like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ( (val (complex-expr ...)) )&#xA;  (or (pred1 val) (pred2 val) ...(predN val)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead I like something:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply-some (complex-expr ...) '(pred1 pred2 ... predN))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2016-06-22T20:26:20.760" LastActivityDate="2016-06-22T20:26:20.760" Title="Is there a standard function that applies a list of predicates to a value until success?" Tags="|hooks|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16757" PostTypeId="2" ParentId="16756" CreationDate="2015-09-19T17:14:39.473" Score="1" Body="&lt;p&gt;I don't know of an existing function to do this, but it's simple enough to write in plain Elisp.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-predicate (val predicates)&#xA;  (when predicates&#xA;    (or (funcall (car predicates) val)&#xA;        (some-predicate val (cdr predicates)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns &lt;code&gt;t&lt;/code&gt; (the return value of the predicate that returns non-nil):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(some-predicate 1 '((lambda (val) (&amp;gt; val 2)) (lambda (val) (&amp;gt; val 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(some-predicate 1 '((lambda (val) (&amp;gt; val 2)) (lambda (val) (&amp;gt; val 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that because it uses recursion, it could blow the stack if you have a long list of predicates.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-09-19T17:14:39.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16758" PostTypeId="2" ParentId="16756" CreationDate="2015-09-19T17:55:59.503" Score="7" Body="&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;cl-some&lt;/code&gt; to apply a list of predicates to a value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cl-some (lambda (p) (funcall p &quot;some value&quot;))&#xA;         '(vectorp listp stringp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suppose you could wrap this in a function. Although I don't love this name, say:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun cl-emos (preds v)&#xA;  &quot;Are any PREDS true for V.&#xA;&#xA;This is the \&quot;opposite\&quot; of `cl-some', which sees if one pred is&#xA;true for any values.&quot;&#xA;  (cl-some (lambda (p) (funcall p v))&#xA;           preds))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example uses:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cl-emos '(vectorp listp stringp)&#xA;         &quot;string&quot;)&#xA;;; =&amp;gt; t&#xA;(cl-emos '(vectorp listp stringp)&#xA;         42)&#xA;;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note: Whatever you name it, of course you shouldn't prefix it with &lt;code&gt;cl-&lt;/code&gt;. I did that just to make the comparison clear with &lt;code&gt;cl-some&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Compared to &lt;code&gt;cl-some&lt;/code&gt;, I prefer the way that &lt;code&gt;ormap&lt;/code&gt; works in Scheme and Racket: It returns the truthy value, not just &lt;code&gt;t&lt;/code&gt; (even when the predicate only returns &lt;code&gt;t&lt;/code&gt;).  To do that, here, just replace &lt;code&gt;(funcall p v)&lt;/code&gt; with &lt;code&gt;(and (funcall p v) v)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun cl-emos (preds v)&#xA;  &quot;Are any PREDS true for V.&#xA;&#xA;This is the \&quot;opposite\&quot; of `cl-some', which sees if one pred is&#xA;true for any values.&quot;&#xA;  (cl-some (lambda (p) (and (funcall p v) v)) ;; &amp;lt;======&#xA;           preds))&#xA;&#xA;(cl-emos '(vectorp listp stringp)&#xA;         &quot;string&quot;)&#xA;;; =&amp;gt; &quot;string&quot;&#xA;(cl-emos '(vectorp listp stringp)&#xA;         42)&#xA;;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course now it's subtly different than using &lt;code&gt;cl-some&lt;/code&gt; with the same predicate(s). But it lets you return the expensive expression's evaluated result and bind it, which seems closer to the spirit of you question.&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="849" LastEditDate="2015-10-17T13:40:56.587" LastActivityDate="2015-10-17T13:40:56.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16759" PostTypeId="2" ParentId="653" CreationDate="2015-09-19T18:25:49.717" Score="3" Body="&lt;p&gt;What about:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-lookup-key (key)&#xA;  &amp;quot;Search for KEY in all known keymaps.&amp;quot;&#xA;  (mapatoms (lambda (ob) (when (and (boundp ob) (keymapp (symbol-value ob)))&#xA;                      (when (functionp (lookup-key (symbol-value ob) key))&#xA;                        (message &amp;quot;%S&amp;quot; ob))))&#xA;            obarray))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For example for &lt;code&gt;(my-lookup-key (kbd &amp;quot;C-c v v&amp;quot;))&lt;/code&gt; I get list in &lt;code&gt;*Message*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;global-map&#xA;term-pager-break-map&#xA;widget-global-map&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This approach is useful for searching sub-keymap which included into higher level keymap, for example output from:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(my-lookup-key (kbd &amp;quot;d&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;is &lt;code&gt;vc-prefix-map&lt;/code&gt; which is included into &lt;code&gt;global-map&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(eq (lookup-key global-map (kbd &amp;quot;C-x v&amp;quot;)) 'vc-prefix-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you modify filtering condition to include &lt;code&gt;keymapp&lt;/code&gt; - you will be able to search ever for prefixes:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-lookup-key-prefix (key)&#xA;  &amp;quot;Search for KEY as prefix in all known keymaps.&amp;quot;&#xA;  (mapatoms (lambda (ob) (when (and (boundp ob) (keymapp (symbol-value ob)))&#xA;                      (when (let ((m (lookup-key (symbol-value ob) key)))&#xA;                              (and m (or (symbolp m) (keymapp m))))&#xA;                        (message &amp;quot;%S&amp;quot; ob))))&#xA;            obarray))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So &lt;code&gt;rst-mode-map&lt;/code&gt; will be found on both:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(my-lookup-key-prefix (kbd &amp;quot;C-c C-t&amp;quot;))&#xA;(my-lookup-key-prefix (kbd &amp;quot;C-c C-t C-t&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2020-09-13T09:27:24.907" LastActivityDate="2020-09-13T09:27:24.907" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="16760" PostTypeId="2" ParentId="16756" CreationDate="2015-09-19T20:34:27.803" Score="6" Body="&lt;p&gt;If I understand your request OK, this is exactly what &lt;code&gt;run-hook-with-args-until-success&lt;/code&gt; does.  (There are also functions &lt;code&gt;run-hook-with-args-until-failure&lt;/code&gt; and &lt;code&gt;run-hook-with-args&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;run-hook-with-args-until-success is a built-in function in `C source&#xA;code'.&#xA;&#xA;(run-hook-with-args-until-success HOOK &amp;amp;rest ARGS)&#xA;&#xA;Run HOOK with the specified arguments ARGS.&#xA;HOOK should be a symbol, a hook variable.  The value of HOOK&#xA;may be nil, a function, or a list of functions.  Call each&#xA;function in order with arguments ARGS, stopping at the first&#xA;one that returns non-nil, and return that value.  Otherwise (if&#xA;all functions return nil, or if there are no functions to call),&#xA;return nil.&#xA;&#xA;Do not use ‘make-local-variable’ to make a hook variable buffer-local.&#xA;Instead, use ‘add-hook’ and specify t for the LOCAL argument.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Running-Hooks.html&quot;&gt;Running Hooks&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-19T20:34:27.803" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16761" PostTypeId="1" CreationDate="2015-09-19T20:44:40.307" Score="1" ViewCount="304" Body="&lt;p&gt;I frequently type camelCase variable names, and enjoy the features &lt;code&gt;subword-mode&lt;/code&gt; offers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/3931837/modifying-emacs-forward-word-backward-ward-behavior-to-be-like-in-vi-vim&quot;&gt;This&lt;/a&gt;, &lt;a href=&quot;https://stackoverflow.com/questions/1771102/changing-emacs-forward-word-behaviour&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/4271/stop-at-beginning-of-a-word-on-forward-word&quot;&gt;this&lt;/a&gt; reiterate the fact that the community desires vim-like functionality where they can choose whether to go to the end of the current word, or beginning of the next word. One can use &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;forward-to-word&lt;/code&gt; from the &lt;code&gt;misc&lt;/code&gt; package,  &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;viper-forward-word&lt;/code&gt; from &lt;code&gt;viper&lt;/code&gt;  or&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-forward-word-begin&lt;/code&gt; from &lt;code&gt;evil&lt;/code&gt; to achieve the same thing. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However using these mean that &lt;code&gt;subword-mode&lt;/code&gt; will be overridden. I am guessing that the only way to have both would be to implement a function like &lt;code&gt;subword-forward-to-word&lt;/code&gt; which combines the two functionalities. I lack the knowledge in elisp to do so, so I am asking for your help. How can this be done?&lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-09-19T21:54:19.097" Title="forward-to-word functionality with subword-mode" Tags="|navigation|subword-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16762" PostTypeId="2" ParentId="16747" CreationDate="2015-09-19T21:07:44.187" Score="1" Body="&lt;p&gt;The function &lt;code&gt;keyboard-quit&lt;/code&gt; is just a few lines of code in &lt;code&gt;simple.el&lt;/code&gt;, which can either be redefined or otherwise tweaked/modified to suit the user's needs.  The following answer uses &lt;code&gt;defacvice&lt;/code&gt;:  If beginning of the region is less than point, this means that the region was marked from left to right, so go to the beginning of the region.  If not, the region was marked from right to left, so go to the end of the region.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defadvice keyboard-quit (before keyboard-quit-before activate)&#xA;  (when (region-active-p)&#xA;    (let* (&#xA;        (pt (point))&#xA;        (beg (region-beginning))&#xA;        (end (region-end)) )&#xA;      (if (&amp;lt; beg pt)&#xA;        (goto-char beg)&#xA;        (goto-char end)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-09-20T05:08:59.577" LastActivityDate="2015-09-20T05:08:59.577" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16763" PostTypeId="1" CreationDate="2015-09-20T00:08:05.663" Score="2" ViewCount="211" Body="&lt;p&gt;What's the best way to simplify this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice synonyms (after synonyms-jump-to-window) &#xA;    (switch-to-buffer-other-window &quot;*Synonyms*&quot;))&#xA;&#xA;(defadvice synonyms-no-read (after synonyms-jump-to-window)&#xA;    (switch-to-buffer-other-window &quot;*Synonyms*&quot;))&#xA;&#xA;(ad-activate 'synonyms)&#xA;(ad-activate 'synonyms-no-read)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, but I don't like how code repeats with only minor difference,&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="105" LastEditDate="2016-06-22T20:25:55.243" LastActivityDate="2016-06-22T20:25:55.243" Title="advising two `synonyms.el` functions using `defadvice`" Tags="|advice|synonyms|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16764" PostTypeId="2" ParentId="16763" CreationDate="2015-09-20T01:23:25.373" Score="2" Body="&lt;p&gt;This is something the new advice system helps with.  Instead of using a &lt;code&gt;defadvice&lt;/code&gt; for each function you want to advise, define the &lt;code&gt;after&lt;/code&gt; function once and add it to multiple function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun switch-to-synonyms ()&#xA;  (switch-to-buffer-other-window &quot;*Synonyms*&quot;))&#xA;&#xA;(advice-add 'synonyms :after #'switch-to-synonyms)&#xA;(advice-add 'synonyms-no-read :after #'switch-to-synonyms)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can do basically the same thing in the old system, just make the body of each &lt;code&gt;defadvice&lt;/code&gt; &lt;code&gt;(switch-to-synonyms)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-09-20T01:23:25.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16765" PostTypeId="2" ParentId="16763" CreationDate="2015-09-20T02:05:13.773" Score="1" Body="&lt;p&gt;What you've done is fine. Those are two different functions, which happen to do similar things. So advising each of them the same way is fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But those functions themselves (in &lt;a href=&quot;http://www.emacswiki.org/emacs/download/synonyms.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;synonyms.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;) each call function &lt;code&gt;synonyms-lookup&lt;/code&gt; to display the results.  So you can just advise that single function instead (the same way you advised the two commands that call it).  That saves a little code repetition.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice synonyms-lookup (after synonyms-jump-to-window activate)&#xA;  (switch-to-buffer-other-window &quot;*Synonyms*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;FWIW, personally I make buffers whose names begin and end with &lt;strong&gt;&lt;code&gt;*&lt;/code&gt;&lt;/strong&gt; be &quot;&lt;em&gt;special-display&lt;/em&gt;&quot; buffers, which means that their windows are automatically dedicated, so the result here is always shown in a separate window.  I do that just by customizing option &lt;strong&gt;&lt;code&gt;special-display-regexps&lt;/code&gt;&lt;/strong&gt; to this value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(&quot;[ ]?[*][^*]+[*]&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-20T07:12:33.873" LastActivityDate="2015-09-20T07:12:33.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16766" PostTypeId="1" AcceptedAnswerId="16770" CreationDate="2015-09-20T03:31:10.510" Score="10" ViewCount="1504" Body="&lt;p&gt;I have a &lt;code&gt;emacs-lisp&lt;/code&gt; block in org-mode and when I try to edit it by press &lt;code&gt;C-c '&lt;/code&gt;, flycheck always report errors as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0     warning         The first line should be of the form: &quot;;;; package --- Summary&quot;... (emacs-lisp-checkdoc)&#xA;0     warning         You should have a section marked &quot;;;; Commentary:&quot;... (emacs-lisp-checkdoc)&#xA;1     warning         You should have a section marked &quot;;;; Code:&quot;... (emacs-lisp-checkdoc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How could I turn it off when edit it source block? &lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-09-20T13:49:37.573" Title="How to turn off `emacs-lisp-checkdoc` of flycheck when edit source block in org-mode file?" Tags="|org-mode|org-babel|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16767" PostTypeId="1" CreationDate="2015-09-20T08:09:26.570" Score="1" ViewCount="184" Body="&lt;p&gt;I had a custom key that I used extensively in Emacs for custom editing actions: &lt;code&gt;C-z&lt;/code&gt;. I decided to use evil mode (I came from vim originally so nothing too new) but I don't know how to rebind evil's &lt;code&gt;C-z&lt;/code&gt; to my &lt;code&gt;C-z&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I just wrap the &lt;code&gt;global-set-key&lt;/code&gt; calls that use &lt;code&gt;C-z&lt;/code&gt; in a function that just takes a char with &lt;code&gt;interactive&lt;/code&gt;? If I do that then I don't get the &lt;code&gt;F1 k C-z j g&lt;/code&gt; functionality that shows me what &lt;code&gt;C-z j g&lt;/code&gt; is bound to, which I use often (varying binds per mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could I force the evil mode normal map &lt;code&gt;C-z&lt;/code&gt; to use the global map &lt;code&gt;C-z&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8725" LastActivityDate="2015-11-19T09:47:14.207" Title="Evil mode - help with custom prefix key" Tags="|key-bindings|evil|keyboard-macros|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16769" PostTypeId="2" ParentId="16671" CreationDate="2015-09-20T08:51:00.497" Score="3" Body="&lt;p&gt;Magit should always do  that by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was a bug in &lt;code&gt;magit&lt;/code&gt; and it was fixed &lt;a href=&quot;https://github.com/magit/magit/commit/0c2d2af79b5e42b27de99c4e927a29b87b6932cb&quot; rel=&quot;nofollow&quot;&gt;in this commit&lt;/a&gt; by  @tarsius&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-20T08:51:00.497" CommentCount="0" CommunityOwnedDate="2015-09-20T08:51:00.497" ContentLicense="CC BY-SA 3.0" />
  <row Id="16770" PostTypeId="2" ParentId="16766" CreationDate="2015-09-20T10:16:59.583" Score="18" Body="&lt;h1&gt;tl;dr&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Disable the checker emacs-lisp-checkdoc with the &lt;code&gt;org-src-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun disable-fylcheck-in-org-src-block ()&#xA;  (setq-local flycheck-disabled-checkers '(emacs-lisp-checkdoc)))&#xA;&#xA;(add-hook 'org-src-mode-hook 'disable-fylcheck-in-org-src-block)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Detailed walkthrough how to find this information&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;First search for possible variables which change the behaviour of Flycheck. There are several ways to do this: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;M-x describe-variable&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If there are a lot of them then &lt;code&gt;M-x customize-group&lt;/code&gt; &lt;code&gt;&amp;lt;package&amp;gt;&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt; is always a good place to look up common candidates. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A third way would be to use &lt;code&gt;M-x apropos-documentation&lt;/code&gt; which searches the dosctrings of all symbols in Emacs. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Yet another way to find information would be to look up if there is an info page for the package. In case of Flycheck there is. &lt;code&gt;M-x info&lt;/code&gt;. Use &lt;code&gt;M-x Info-menu&lt;/code&gt; to jump to desired Info page and search around there.&lt;code&gt;M-x Info-index&lt;/code&gt; and &lt;code&gt;M-x Info-search&lt;/code&gt; are useful for this.      &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I would highly recommend to use a completion framework like helm, ido, icicles or any other because with enhanced minibuffer completion the methods above a far more convenient.&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case after some digging and trying out the methods above one may find:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;&amp;gt; Flycheck Disabled Checkers:&#xA;  Syntax checkers excluded from automatic selection. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ok now we know the variable we want to change. We only want to change it when editing source blocks in org-mode. If you check &lt;code&gt;M-x describe-mode&lt;/code&gt; and look for an enabled minor-mode that starts with org you will find:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;Org-Src minor mode (no indicator):&#xA;Minor mode for language major mode buffers generated by org.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Know that we know the mode we search for a hook for this mode. As almost always it is just a -hook appended to the mode name: &lt;code&gt;org-src-mode-hook&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time there are multiple methods in Emacs to do stuff. I hope this helps beginners, I know how I was lost in the beginning. Don't be intimidated, when you use the techniques above several times you don't think about it anymore. &lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-20T13:49:37.573" LastActivityDate="2015-09-20T13:49:37.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16771" PostTypeId="1" CreationDate="2015-09-20T11:05:59.057" Score="1" ViewCount="158" Body="&lt;p&gt;What is the argument count limit to a function call?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that &lt;code&gt;max-specpdl-size&lt;/code&gt; is related to answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This variable defines the limit on the total number of local variable&#xA;  bindings and ‘unwind-protect’ cleanups that are allowed before Emacs&#xA;  signals an error&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but I don't think that &lt;code&gt;defun&lt;/code&gt; makes local binding using &lt;code&gt;let&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try &lt;code&gt;(macroexpand-all '(defun my (x) (+ x 1))) C-u C-x e&lt;/code&gt; and get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defalias (quote my) (function (lambda (x) (+ x 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I check &lt;code&gt;eval.c&lt;/code&gt; for evaluator code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;apply_lambda (Lisp_Object fun, Lisp_Object args, ptrdiff_t count) {&#xA;  EMACS_INT numargs;&#xA;  register Lisp_Object *arg_vector;&#xA;&#xA;  numargs = XFASTINT (Flength (args));&#xA;  SAFE_ALLOCA_LISP (arg_vector, numargs);&#xA;  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which leads to &lt;code&gt;SAFE_ALLOCA_LISP&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#define SAFE_ALLOCA_LISP(buf, nelt)                            \&#xA;  do {                                                         \&#xA;    if ((nelt) &amp;lt;= lisp_word_count (sa_avail))                  \&#xA;      (buf) = AVAIL_ALLOCA ((nelt) * word_size);               \&#xA;    else if ((nelt) &amp;lt;= min (PTRDIFF_MAX, SIZE_MAX) / word_size) \&#xA;      {                                                        \&#xA;        Lisp_Object arg_;                                      \&#xA;        (buf) = xmalloc ((nelt) * word_size);                  \&#xA;        arg_ = make_save_memory (buf, nelt);                   \&#xA;        sa_must_free = true;                                   \&#xA;        record_unwind_protect (free_save_value, arg_);         \&#xA;      }                                                        \&#xA;    else                                                       \&#xA;      memory_full (SIZE_MAX);                                  \&#xA;  } while (false)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That piece is hard for me to understand… Rest of the code doesn't seem to&#xA;expose any restriction but I am unsure…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compare with Common Lisp constants: &lt;a href=&quot;http://clhs.lisp.se/Body/v_lamb_1.htm&quot; rel=&quot;nofollow&quot;&gt;LAMBDA-PARAMETERS-LIMIT&lt;/a&gt; and&#xA;&lt;a href=&quot;http://clhs.lisp.se/Body/v_call_a.htm&quot; rel=&quot;nofollow&quot;&gt;CALL-ARGUMENTS-LIMIT&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="2487" LastEditDate="2015-09-20T11:26:32.897" LastActivityDate="2015-09-20T15:16:54.537" Title="What is the argument count limit to a function call?" Tags="|elisp|emacs-internals|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16772" PostTypeId="1" CreationDate="2015-09-20T12:53:56.323" Score="1" ViewCount="196" Body="&lt;p&gt;Usually I use incremental searching to find what I'm looking for. Also, in general I write very small methods that easily fit in one screen. So before now I have had little use for any sort of code-folding mechanism, which is good because of &lt;a href=&quot;https://stackoverflow.com/questions/2399612/why-is-there-no-code-folding-in-emacs&quot;&gt;the general communal distaste for such things&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But one exception to this is with tests. Right now I use &lt;code&gt;rspec&lt;/code&gt; and I'm finding it frustrating to navigate the tests. A test file I'm working on has about 500 lines so far and is structured like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Rspec.describe SomeClass do&#xA;  let(:some_common_variable) { create :the_thing }&#xA;  context 'with foos' do&#xA;    it 'does a thing' do&#xA;      # ... ~10 lines of arrange -&amp;gt; act -&amp;gt; assert stuff&#xA;    end&#xA;  end&#xA;  context 'with bars' do&#xA;    it 'does a thing differently' do&#xA;      # ... ~10 lines of arrange -&amp;gt; act -&amp;gt; assert stuff&#xA;    end&#xA;  end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So as you can see this makes some common-sense coding styles (like short methods) impossible.  At the end of these tests I also have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        end&#xA;      end&#xA;    end&#xA;  end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which makes it pretty tricky to figure out which &quot;end&quot; I want to insert a new test after -- especially because the matching &lt;code&gt;do&lt;/code&gt; is not on the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is:&lt;/strong&gt; When I'm in the middle of some test, is there some way I can generate a breadcrumb that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Someclass / with foos / it does a thing&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Right now I'm using &lt;code&gt;M-x occur&lt;/code&gt; with a regex I wrote that includes things like &lt;code&gt;it&lt;/code&gt;, &lt;code&gt;context&lt;/code&gt;, &lt;code&gt;Rspec.describe&lt;/code&gt;, etc. to get an outline. Also, &lt;strong&gt;is there some code folding mode that makes it easy to quickly fold everything in an &quot;it&quot; block without folding everything else&lt;/strong&gt;, but also have the ability to fold everything else with a different command.&lt;/p&gt;&#xA;" OwnerUserId="8465" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-09-21T15:08:55.357" Title="Navigating rspec files" Tags="|navigation|code-folding|ruby-mode|breadcrumbs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16773" PostTypeId="1" CreationDate="2015-09-20T13:06:25.897" Score="1" ViewCount="465" Body="&lt;p&gt;By default, &lt;code&gt;S-tab&lt;/code&gt; cycles between &lt;code&gt;OVERVIEW&lt;/code&gt;, &lt;code&gt;CONTENTS&lt;/code&gt; and &lt;code&gt;SHOW ALL&lt;/code&gt; these three states.  But I want it to just cycle between &lt;code&gt;CONTENTS&lt;/code&gt; and &lt;code&gt;SHOW ALL&lt;/code&gt;.  How can I realize it?&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2015-09-20T16:40:32.413" Title="How to cycle between specified states in org mode?" Tags="|org-mode|cycling|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16774" PostTypeId="2" ParentId="16772" CreationDate="2015-09-20T14:17:51.763" Score="3" Body="&lt;p&gt;This solution doesn't address code folding, but does aim to address the issue of navigation and code context awareness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;imenu&lt;/code&gt;&lt;/a&gt; allows navigation of source files in all languages, including Ruby.  But &lt;code&gt;rspec&lt;/code&gt; doesn't support it out of the box.  You can add support for &lt;code&gt;imenu&lt;/code&gt; to rspec files with &lt;a href=&quot;https://github.com/pezra/rspec-mode&quot; rel=&quot;nofollow&quot;&gt;rspec mode&lt;/a&gt; (it's in melpa).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;imenu&lt;/code&gt; by itself is OK, but I highly recommend accessing it via &lt;code&gt;helm-imenu&lt;/code&gt; which is built into &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;helm&lt;/a&gt;.  That will give you not only an outline of all contexts/descriptions/specs, but provide incremental substring matching to quickly jump to any of them.  Helm is available in melpa as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll no doubt continue using &lt;code&gt;occur&lt;/code&gt; for more general cases, and I can again recommend using &lt;code&gt;helm-occur&lt;/code&gt;, which provides the interactivity of helm when using occur to find matches.&lt;/p&gt;&#xA;" OwnerUserId="618" LastActivityDate="2015-09-20T14:17:51.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16775" PostTypeId="2" ParentId="16773" CreationDate="2015-09-20T14:20:09.993" Score="2" Body="&lt;p&gt;I do not think this is straightforward.  You definitely need a custom function.  The docstring for org-cycle has the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;When this function is called with a prefix argument, rotate the entire&#xA;  buffer through 3 states (global cycling)&lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;&lt;p&gt;OVERVIEW: Show only top-level headlines.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;CONTENTS: Show all headlines of all levels, but no body text.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;SHOW ALL: Show everything.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;  &#xA;  &lt;p&gt;When called with two ‘C-u C-u’ prefixes, switch to the startup visibility,&#xA;  determined by the variable ‘org-startup-folded’, and by any VISIBILITY&#xA;  properties in the buffer.&#xA;  When called with three ‘C-u C-u C-u’ prefixed, show the entire buffer,&#xA;  including any drawers.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I suggest the following scheme:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You need to set an &lt;a href=&quot;http://orgmode.org/manual/Initial-visibility.html#Initial-visibility&quot; rel=&quot;nofollow&quot;&gt;initial visibility&lt;/a&gt;.  There are two ways to go about it, either set &lt;code&gt;org-startup-folded&lt;/code&gt; or put a &lt;code&gt;#+startup: content&lt;/code&gt; line somewhere in the buffer.&lt;/li&gt;&#xA;&lt;li&gt;Next you use a function like the following to cycle the buffer.  Calling the function below shows the default setting from step (1), providing a prefix argument shows everything, including drawers.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;   &lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun my-cycle (&amp;amp;optional arg)&#xA;        &quot;Cycle between CONTENTS and SHOW ALL&quot;&#xA;      (interactive &quot;P&quot;)&#xA;      (if (equal arg '(4))&#xA;          (show-all)&#xA;        (org-set-startup-visibility)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that overriding the default keybinding is very hard since Org does too many smart things under the hood.  It's very hard to make sure everything will keep working as expected if you fiddle with how &lt;code&gt;org-cycle&lt;/code&gt; behaves.&lt;/p&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="2093" LastEditDate="2015-09-20T16:40:32.413" LastActivityDate="2015-09-20T16:40:32.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16776" PostTypeId="2" ParentId="16771" CreationDate="2015-09-20T15:16:54.537" Score="1" Body="&lt;p&gt;I believe this is limited only by amount of available memory. I couldn't find any information about this sort of limitation in official manual, so it generally means that number of arguments an Emacs Lisp function can take is not limited on language level, otherwise it would be explicitly mentioned.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2015-09-20T15:16:54.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16777" PostTypeId="2" ParentId="16747" CreationDate="2015-09-20T23:45:31.060" Score="1" Body="&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-g&lt;/code&gt; does not move the point, so there's no “original position” to restore. If you want the &lt;code&gt;select-some-region&lt;/code&gt; function to preserve the point, write it in such a way that it does preserve the point. With the function in your question, you could invert the point and the mark.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun select-some-region ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (forward-line 2)&#xA;    (push-mark (point) nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, given your original function, you can easily return to the previous cursor position, since the mark is set there. Just press &lt;code&gt;C-1 C-SPC&lt;/code&gt; (&lt;code&gt;set-mark-command&lt;/code&gt; with the numeric argument 1).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="115" LastEditDate="2015-09-21T02:18:45.460" LastActivityDate="2015-09-21T02:18:45.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16778" PostTypeId="2" ParentId="16704" CreationDate="2015-09-21T01:28:16.700" Score="0" Body="&lt;p&gt;Emacs has a whole stack of translation mechanisms going from the keyboard events it receives from the operating systems to the commands that they trigger. If you want a keychord to insert a character, the global keymap is too high level. You want one of the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#Translation-Keymaps&quot; rel=&quot;nofollow noreferrer&quot;&gt;translation keymaps&lt;/a&gt;. If you want &lt;kbd&gt;Meta&lt;/kbd&gt;+&lt;kbd&gt;8&lt;/kbd&gt; to always be treated as a &lt;code&gt;{&lt;/code&gt; key, then declare the binding in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-key_002dtranslation_002dmap&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;key-translation-map&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map [(meta ?8)] &quot;{&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The fact that you expect &lt;code&gt;M-8&lt;/code&gt; to insert a character may indicate that your modifier setup is wrong, though. Normally, the keychord to insert &lt;code&gt;{&lt;/code&gt; would be &lt;kbd&gt;AltGr&lt;/kbd&gt;+&lt;kbd&gt;8&lt;/kbd&gt;; if Emacs sees your &lt;kbd&gt;AltGr&lt;/kbd&gt; key as Meta, you should probably &lt;a href=&quot;https://emacs.stackexchange.com/a/16706&quot;&gt;instruct it otherwise&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-09-21T01:28:16.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16779" PostTypeId="2" ParentId="16723" CreationDate="2015-09-21T02:05:42.517" Score="2" Body="&#xA;&#xA;&lt;p&gt;As &lt;strong&gt;@wvxvw&lt;/strong&gt; and &lt;strong&gt;@Drew&lt;/strong&gt; implied in the comments, I too believe that &lt;code&gt;kill-sexp&lt;/code&gt; (bound by default to &lt;code&gt;C-M-k&lt;/code&gt;) is a more appropriate command to use than &lt;code&gt;kill-whole-line&lt;/code&gt; for the use cases in your examples.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For your first example, I would either use &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-M-k&lt;/code&gt; followed by &lt;code&gt;C-k&lt;/code&gt; (to delete the empty line), or &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;kill-whole-line&lt;/code&gt; &lt;em&gt;(bound to a convenient key if I use it too often)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That would do the below,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;▮(setq foo &quot;bar&quot;)        -- C-M-k, C-k --&amp;gt;   (setq foo1 &quot;bar1&quot;) &#xA;(setq foo1 &quot;bar1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For your second example, just &lt;code&gt;C-M-k&lt;/code&gt; would suffice.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()            -- C-M-k --&amp;gt;        (defun foo ()  &#xA; ▮(message &quot;foo&quot;))                           ▮)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I like about &lt;code&gt;C-M-k&lt;/code&gt; is that it always &quot;does what I mean&quot; in situations like this,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()            -- C-M-k --&amp;gt;        (defun foo ()&#xA; ▮                                           ▮) &#xA;  ;; some comment 1  &#xA;  ;; some comment 2&#xA;  (message &quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that just that one single command removed the extra new line + comments before the sexp. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-09-21T02:16:18.540" LastActivityDate="2015-09-21T02:16:18.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16781" PostTypeId="1" CreationDate="2015-09-21T03:11:52.510" Score="4" ViewCount="1337" Body="&lt;p&gt;I have an org file with several dozen links to various webpages. I'd like to view and edit most of the urls in this file. Is there a convenient way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, does org-mode have a feature that allows me to view and edit all the links in my document in one place?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-09-21T03:26:01.593" LastActivityDate="2015-09-21T05:01:15.910" Title="Is there an easy way to edit all links in an org file?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16782" PostTypeId="2" ParentId="16781" CreationDate="2015-09-21T03:18:30.237" Score="9" Body="&lt;p&gt;It's all plain text, so just use a normal search-and-replace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;org-mode&lt;/code&gt; manages to suppress that somehow, just temporarily change the major mode. e.g. &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;fundamental-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, assuming you're on Emacs 24.1+, &lt;code&gt;occur-edit-mode&lt;/code&gt; will be a nice way to do that, as you'll see the plain text link syntax in the occur buffer, and only the lines you're interested in.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-s&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; &lt;code&gt;&amp;lt;regexp&amp;gt;&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; (for whatever pattern matches the links you want to edit)&lt;/li&gt;&#xA;&lt;li&gt;Switch to the &lt;code&gt;*Occur*&lt;/code&gt; buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;e&lt;/kbd&gt; (enter &lt;code&gt;occur-edit-mode&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Do any editing you need to do. Search and replace, etc. (n.b. You'll need to move point down off the first line of the occur buffer.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt; (confirm the changes and exit &lt;code&gt;occur-edit-mode&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Return to and save the original buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you aren't picky about which links you're searching for, you could run a command like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-links-occur ()&#xA;  &quot;Run `occur' for all `org-mode' links in the current buffer.&quot;&#xA;  (interactive)&#xA;  (occur org-any-link-re))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-21T05:01:15.910" LastActivityDate="2015-09-21T05:01:15.910" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16783" PostTypeId="1" CreationDate="2015-09-21T06:01:26.907" Score="0" ViewCount="65" Body="&lt;p&gt;I've a strange reftex-issue. When i insert a cite from a bib-file, emacs hangs up. I've tried this on two different machines: Windows 7 and on Mac OS X. (GNU Emacs 24.5.1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Insert a cite: Open emacs, the bibliography file is loaded with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq reftex-default-bibliography&#xA;    '(&quot;/Users/user/CloudStation/repositories_d/pandoc-templates/examples/socbib-pandoc.bib&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(the bib file exists and is accessible)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open a &lt;code&gt;.tex&lt;/code&gt; file and press &lt;code&gt;C-c [&lt;/code&gt; &lt;code&gt;^M&lt;/code&gt; and enter &lt;code&gt;b*&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now emacs shows the message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Scanning bibliography database socbib-pandoc.bib&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and HANGS UP. Why?&lt;/p&gt;&#xA;" OwnerUserId="9584" LastEditorUserId="5187" LastEditDate="2015-09-21T09:44:38.367" LastActivityDate="2015-10-24T06:52:09.070" Title="emacs reftex hangs up while Scanning bibliography database" Tags="|reftex-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16784" PostTypeId="2" ParentId="16747" CreationDate="2015-09-21T09:29:10.280" Score="1" Body="&lt;p&gt;As it was mentioned, &lt;code&gt;C-g&lt;/code&gt; does not move point by itself. You mentioned in a comment that the region you sets started before and ended after the current point position, hence you can not use the trick of keeping point where it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think one way of dealing with this problem is to push mark at current position before marking the region. Then you can recover the previous point position by hitting &lt;code&gt;C-u C-SPC&lt;/code&gt; twice. Example with &lt;code&gt;mark-paragraph&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/mark-paragraph ()&#xA;  (interactive)&#xA;  (push-mark nil t)&#xA;  (call-interactively 'mark-paragraph))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-09-21T09:29:10.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16785" PostTypeId="2" ParentId="16656" CreationDate="2015-09-21T09:39:13.120" Score="3" Body="&lt;p&gt;You can try qdb&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/quantopian/qdb&quot; rel=&quot;nofollow&quot;&gt;https://github.com/quantopian/qdb&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An emacs interface (qbd.el) is included:&#xA;&lt;a href=&quot;https://github.com/quantopian/qdb/tree/master/client/emacs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/quantopian/qdb/tree/master/client/emacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-09-21T09:39:13.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16786" PostTypeId="1" AcceptedAnswerId="16787" CreationDate="2015-09-21T10:00:37.617" Score="2" ViewCount="180" Body="&lt;p&gt;I am currently using songs package, which via some TeX trickery uses escaped brackets to mark chords (for example &lt;code&gt;\[G]&lt;/code&gt; is G-major, while &lt;code&gt;\[a]&lt;/code&gt; is a-minor). This causes problems with indentation, for example this is how the following snippet gets indented (every &lt;code&gt;\[&lt;/code&gt; introduces new indent level):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\begin{song}&#xA;  \begin{verse}&#xA;    \[G]This is \[D]some \[A]guitar song&#xA;          \[G]annotated with \[D]the chords&#xA;              to \[e]make playing ea\[H7]sier.&#xA;  \end{verse}&#xA;\end{song}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while of course I would like to get:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\begin{song}&#xA;  \begin{verse}&#xA;    \[G]This is \[D]some \[A]guitar song&#xA;    \[G]annotated with \[D]the chords&#xA;    to \[e]make playing ea\[H7]sier.&#xA;  \end{verse}&#xA;\end{song}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I managed to resolve this by removing bracket indentation completely:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq LaTeX-begin-regexp &quot;begin\\b&quot;)      ; Default is begin\\b\\|\\[&#xA;(setq LaTeX-end-regexp &quot;end\\b&quot;)          ; Default is end\\b\\|\\]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this impacts also my various other uses of &lt;code&gt;\[&lt;/code&gt;, including math…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the question is, whether it is possible to disable &lt;em&gt;indenting&lt;/em&gt; behaviour of bracket just inside specific environment (&lt;code&gt;song&lt;/code&gt;), while leaving it unchanged everywhere else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If impossible, what is the easiest/recommended way to change &lt;code&gt;LaTeX-begin-regex&lt;/code&gt; and &lt;code&gt;LaTeX-end-regexp&lt;/code&gt; just for specific files instead of customizing it globally?&lt;/p&gt;&#xA;" OwnerUserId="2404" LastEditorUserId="2404" LastEditDate="2015-09-21T10:05:38.733" LastActivityDate="2015-09-21T17:28:39.097" Title="Modifying AucTeX bracket indentation locally" Tags="|indentation|auctex|balanced-parentheses|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16787" PostTypeId="2" ParentId="16786" CreationDate="2015-09-21T12:23:00.037" Score="3" Body="&lt;p&gt;You can advise &lt;code&gt;LaTeX-indent-level-count&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defadvice LaTeX-indent-level-count&#xA;    (around advice-LaTeX-indent-level-count activate)&#xA;  (let ((LaTeX-begin-regexp&#xA;     (if (equal (LaTeX-current-environment) &quot;verse&quot;)&#xA;         &quot;begin\\b&quot;&#xA;       &quot;begin\\b\\|\\[&quot;))&#xA;    (LaTeX-end-regexp&#xA;     (if (equal (LaTeX-current-environment) &quot;verse&quot;)&#xA;         &quot;end\\b&quot;&#xA;       &quot;end\\b\\|\\]&quot;)))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set &lt;code&gt;LaTeX-begin-regexp&lt;/code&gt; to &lt;code&gt;&quot;begin\\b&quot;&lt;/code&gt; within &lt;code&gt;verse&lt;/code&gt; environment and to &lt;code&gt;&quot;begin\\b\\|\\[&quot;&lt;/code&gt; otherwise, the same for &lt;code&gt;LaTeX-end-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-09-21T12:23:00.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16788" PostTypeId="1" CreationDate="2015-09-21T12:45:40.713" Score="2" ViewCount="82" Body="&lt;p&gt;Can Emacs be used to browse a cpio archive?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to open a cpio file in Emacs in Ubuntu 15.04 (Vivid), but it simply shows me its content as is, not allowing to browse it as a directory of files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Actually, I wanted to browse the initrd.img, which is a compressed cpio archive.)&lt;/p&gt;&#xA;" OwnerUserId="5165" LastEditorUserId="5165" LastEditDate="2015-09-21T13:03:08.503" LastActivityDate="2015-10-21T13:39:19.077" Title="Can Emacs be used to browse a cpio archive?" Tags="|dired|archive-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16789" PostTypeId="2" ParentId="16788" CreationDate="2015-09-21T12:51:58.873" Score="1" Body="&lt;p&gt;Probably, a &lt;code&gt;cpio-mode&lt;/code&gt; is not yet among the standard set of modes. Cf.:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2015-04/msg00824.html&quot; rel=&quot;nofollow&quot;&gt;Re: Proposal: cpio-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;dated as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;From:   Stefan Monnier&#xA;Subject:    Re: Proposal: cpio-mode&#xA;Date:   Thu, 16 Apr 2015 16:42:45 -0400&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Stefan also suggests some code there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PS: For what it's worth, here's my earlier attempt at such a thing.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5165" LastEditorUserId="5165" LastEditDate="2015-09-21T13:04:29.277" LastActivityDate="2015-09-21T13:04:29.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16790" PostTypeId="1" AcceptedAnswerId="16791" CreationDate="2015-09-21T12:52:44.350" Score="5" ViewCount="1115" Body="&lt;p&gt;If i run &lt;code&gt;C-x 3&lt;/code&gt;, when emacs  starts  up it will split window and creates two windows of  &lt;strong&gt;equal size&lt;/strong&gt; like this&#xA;&lt;a href=&quot;https://i.stack.imgur.com/36yvs.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/36yvs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now i run  &lt;code&gt;C-x 3&lt;/code&gt; again it  will split current window  into two parts resulting  in this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bNQwC.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bNQwC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But whenver i  create a vertical split, i want to auto adjust width of each window to equal size like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qRMCd.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qRMCd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;How can  i achieve this?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-09-21T13:20:30.880" Title="Auto adjust window width based on number of windows?" Tags="|window|frames|window-splitting|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16791" PostTypeId="2" ParentId="16790" CreationDate="2015-09-21T13:18:43.660" Score="6" Body="&#xA;&#xA;&lt;p&gt;You can define your own command for this.  This allows you to use it when desired, but not change the default behavior of the original commands, keeping them useful individually if desired:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (defun my/split-window-evenly ()&#xA;    (interactive)&#xA;    (split-window-right)&#xA;    (balance-windows))&#xA;&#xA;(global-set-key &quot;\C-cb&quot; 'my/split-window-evenly)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6615" LastEditorUserId="115" LastEditDate="2015-09-21T13:20:30.880" LastActivityDate="2015-09-21T13:20:30.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16792" PostTypeId="1" AcceptedAnswerId="16793" CreationDate="2015-09-21T13:35:54.543" Score="18" ViewCount="5866" Body="&lt;p&gt;I just want to check if the  current line is empty or not (if it contains only whitespace, then I still consider it empty).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my initial version:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun strip-text-properties(txt)&#xA;  (set-text-properties 0 (length txt) nil txt)&#xA;  txt)&#xA;&#xA;(defun is-current-line-empty ()&#xA;  (interactive)&#xA;  (setq c-line (thing-at-point 'line))&#xA;  (string-match &quot;^\s*$&quot; (strip-text-properties c-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the easiest way to check if current line is empty?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="454" LastEditDate="2015-09-22T00:01:50.810" LastActivityDate="2022-03-14T00:50:01.467" Title="Easiest way to check if current line is &quot;empty&quot; (ignoring whitespace)?" Tags="|whitespace|" AnswerCount="7" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16793" PostTypeId="2" ParentId="16792" CreationDate="2015-09-21T13:42:46.457" Score="27" Body="&lt;p&gt;Would something like this be &amp;quot;easier&amp;quot;?&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun current-line-empty-p ()&#xA;  (save-excursion&#xA;    (beginning-of-line)&#xA;    (looking-at-p &amp;quot;[[:blank:]]*$&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastEditorUserId="2418" LastEditDate="2022-03-14T00:50:01.467" LastActivityDate="2022-03-14T00:50:01.467" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="16795" PostTypeId="2" ParentId="16792" CreationDate="2015-09-21T13:57:37.880" Score="5" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun blank-line-p (&amp;amp;optional pos)&#xA;  &quot;Returns `t' if line (optionally, line at POS) is empty or&#xA;composed only of whitespace.&quot;&#xA;  (save-excursion&#xA;    (goto-char (or pos (point)))&#xA;    (beginning-of-line)&#xA;    (= (point-at-eol)&#xA;       (progn (skip-syntax-forward &quot; &quot;) (point)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-09-21T13:57:37.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16796" PostTypeId="2" ParentId="16772" CreationDate="2015-09-21T15:02:17.723" Score="1" Body="&lt;p&gt;Use &lt;em&gt;bookmarks&lt;/em&gt; to identify and return to such positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can easily create and use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#AutonamedBookmarks&quot; rel=&quot;nofollow&quot;&gt;autonamed&lt;/a&gt; or &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#TemporaryBookmarks&quot; rel=&quot;nofollow&quot;&gt;temporary&lt;/a&gt; (i.e., non-persistent) bookmarks, and these can be automatically &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#HighlightingBookmarkLocations&quot; rel=&quot;nofollow&quot;&gt;highlighted&lt;/a&gt; in various ways (e.g., fringe marker or position or line), if you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just hit &lt;code&gt;C-x p RET&lt;/code&gt; to create an autonamed bookmark -- no need to provide a name.  A bookmark moves automatically as you update text, and an autonamed bookmark is automatically renamed to reflect the current position when you jump to it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-21T15:08:55.357" LastActivityDate="2015-09-21T15:08:55.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16797" PostTypeId="2" ParentId="16792" CreationDate="2015-09-21T15:22:09.070" Score="1" Body="&lt;p&gt;I suggest:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun blank-line-p ()&#xA;  (and (progn (skip-chars-backward &quot; &quot;) (bolp))&#xA;       (progn (skip-chars-forward &quot; &quot;) (eolp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that the &lt;code&gt;progn&lt;/code&gt;s are in fact unnecessary because the skip functions never return nil).  As Dan does in his answer, &lt;code&gt;skip-syntax-*&lt;/code&gt; could also be used instead.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2015-09-21T15:22:09.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16798" PostTypeId="1" CreationDate="2015-09-21T15:24:40.420" Score="4" ViewCount="435" Body="&lt;p&gt;Is it possible to convert column 2 to latex in org-table using a command?&#xA;It seems that the technology already exists with calc-embed but I don't know how to use it here. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  | G | 7*(-2:5)+5*(4:7)                | \frac{2}{35}  |&#xA;  | H | 1:3 + 1:6 + 5:12                | \frac{11}{12} |&#xA;  #+TBLFM: $3='(calc-eval $2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Desired input&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   | G | 7* \frac{-2}{5} + 5 * \frac{4}{7}      | \frac{2}{35}  |&#xA;   | H | \frac{1}{3}+ \frac{1}{6}+ \frac{5}{12} | \frac{11}{12} |&#xA;  #+TBLFM: $3='(calc-eval $2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&#xA;I forgot to mention just in case someone missed it, calc-embedded need to be activated, &lt;code&gt;calc-embedded-activate&lt;/code&gt; &lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="9340" LastEditDate="2015-09-21T17:20:00.807" LastActivityDate="2015-09-21T19:34:27.193" Title="converting emacs calc eqn to latex in org table" Tags="|org-mode|calc|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16799" PostTypeId="1" CreationDate="2015-09-21T15:47:52.857" Score="4" ViewCount="48" Body="&lt;p&gt;In a nutshell, the problem I'm having is that evaluating the expression&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read-char &quot;some prompt&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;sometimes&lt;/em&gt; fails to show the specified prompt (but works as expected otherwise).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, from my perspective, the problem shows up &lt;em&gt;completely&lt;/em&gt; randomly.  I'm sure it is not really random; it just looks this way to me, because I have &lt;em&gt;no idea&lt;/em&gt; of what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result of this complete unpredictability, I can't guarantee that the silly example below will reproduce the problem.  I show it only to describe the setting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((read-1-char (lambda () (string (read-char &quot;Type one char&quot; t)))))&#xA;    (let ((bar&#xA;           (cond ((equal arg '(4)) (funcall read-1-char))&#xA;                 (t (error &quot;foo: the C-u prefix is required&quot;)))))&#xA;     (message &quot;&amp;gt;%s&amp;lt;&quot; (prin1-to-string bar)))))&#xA;(global-set-key (kbd &quot;C-c M&quot;) 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;intended&lt;/em&gt; behavior of this code is that, if one types &lt;code&gt;C-u C-c M&lt;/code&gt;, the message &lt;code&gt;Type one char&lt;/code&gt; will appear in the minibuffer; if one then types, say, &lt;code&gt;x&lt;/code&gt;, the message &lt;code&gt;&amp;gt;&quot;x&quot;&amp;lt;&lt;/code&gt; will be displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some cases, however, after typing &lt;code&gt;C-u C-c M&lt;/code&gt;, instead of &lt;code&gt;Type one char&lt;/code&gt;, the &quot;message&quot; in the minibuffer is just &lt;code&gt;C-u C-c M-&lt;/code&gt;.  (The subsequent behavior remains the same; e.g., if the user then types &lt;code&gt;x&lt;/code&gt;, the message &lt;code&gt;&amp;gt;&quot;x&quot;&amp;lt;&lt;/code&gt; does get displayed.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorDisplayName="user8748" LastEditDate="2019-01-26T20:28:34.677" LastActivityDate="2019-01-26T20:28:34.677" Title="read-char behaving unpredictably" Tags="|prompt|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16800" PostTypeId="1" AcceptedAnswerId="16854" CreationDate="2015-09-21T16:45:38.800" Score="6" ViewCount="1646" Body="&lt;p&gt;From time to time I open a script or config file for which there is no major mode defined. When I invoke &lt;code&gt;comment-region&lt;/code&gt; within that buffer, Emacs will prompt me for the comment syntax, and save it as the buffer-local variable &lt;code&gt;comment-start&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can I enable syntax highlighting of comment lines in that buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the variable &lt;code&gt;comment-start&lt;/code&gt; has been set, what other steps do I need to take in order for &lt;code&gt;font-lock-mode&lt;/code&gt; to start highlighting my comment lines?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2018-04-22T05:53:11.317" Title="Syntax highlighting for comments in text mode" Tags="|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16802" PostTypeId="1" AcceptedAnswerId="18465" CreationDate="2015-09-21T17:26:48.200" Score="3" ViewCount="1384" Body="&lt;p&gt;I'm running GNU Emacs 24.5.4 on Mac OS X 10.10.5 in Terminal.app.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this (stock) setup, Emacs has a transparent background.  With a transparent background, the colors that Emacs uses to display text are auto-adjusted based on the color &lt;em&gt;underneath&lt;/em&gt; Emacs.  In my case, &quot;underneath Emacs&quot; is a Terminal.app window with an opaque black background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In the title I refer to the &quot;effective&quot; theme.  I'm using that to mean to the colors that Emacs actually uses to render text - as opposed to the &quot;specified&quot; theme, which is different in this case.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what the default theme looks like when no background color is specified in Emacs, and Emacs is running in a Terminal.app window with an opaque black background:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7bh4I.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7bh4I.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is the same setup - except with a black background specified in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vYZr2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vYZr2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While beauty is certainly in the eye of the beholder, I've gotten used to the colors in the top image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'd like to duplicate those colors in GUI Emacs.  But since GUI Emacs isn't a transparent window always running on top of something with a black background and hence having colors auto-adjusted, setting its background to black results in the coloring shown in the bottom screenshot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I duplicate the 'effective' colors used in the top screenshot so that they are used in GUI Emacs as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Here's a video demonstrating the text color adjustments happening in real-time vs. changes to the background color of Terminal.app: vimeo.com/139967912.  (I had to use an external camera since QuickTime Player's screen recording didn't work for this purpose.)&lt;/p&gt;&#xA;" OwnerUserId="9589" LastEditorUserId="9589" LastEditDate="2015-11-28T17:58:55.487" LastActivityDate="2015-11-28T17:58:55.487" Title="How do I duplicate the 'effective' theme colors resulting from using terminal Emacs with a transparent background?" Tags="|osx|themes|terminal-emacs|colors|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16803" PostTypeId="2" ParentId="16786" CreationDate="2015-09-21T17:28:39.097" Score="0" Body="&lt;p&gt;Slightly fixed function, to accomodate different wrapping environments&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defadvice LaTeX-indent-level-count&#xA;      (around advice-LaTeX-indent-level-count activate)&#xA;    (let* ((dont-indent-bracket (member (LaTeX-current-environment)&#xA;                                        '(&quot;song&quot; &quot;verse&quot; &quot;chorus&quot;)))&#xA;           (LaTeX-begin-regexp (if dont-indent-bracket&#xA;                                   &quot;begin\\b&quot;&#xA;                                 &quot;begin\\b\\|\\[&quot;))&#xA;           (LaTeX-end-regexp (if dont-indent-bracket&#xA;                                 &quot;end\\b&quot;&#xA;                               &quot;end\\b\\|\\]&quot;)))&#xA;      ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2404" LastActivityDate="2015-09-21T17:28:39.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16805" PostTypeId="1" AcceptedAnswerId="16821" CreationDate="2015-09-21T17:38:10.060" Score="3" ViewCount="1132" Body="&lt;p&gt;I've been in this catch-22 for a while now: I don't have time to learn Common Lisp first, &lt;em&gt;then&lt;/em&gt; elisp, but I don't want to learn elisp without understanding the basic capabilities of Lisp. People have said Paul Graham's &lt;em&gt;ANSI Lisp&lt;/em&gt; is a thorough CL tutorial. Is there a way (tutorial(s)) to learn elisp &lt;em&gt;and&lt;/em&gt; have a good grounding in the capabilities of Lisp in general? From just nosing around on the Internet, it seems elisp can cover nearly everything (at least from my novice buzzword understanding) that CL has to offer. Conversely, what I'm deathly afraid of is diving into elisp, getting reasonably good at it, but being totally blind to some of the really slick things CL can do.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2015-09-21T21:55:58.940" Title="Good elisp tutorial for thorough Lisp understanding?" Tags="|elisp|common-lisp|" AnswerCount="3" CommentCount="2" ClosedDate="2015-09-22T01:45:01.130" ContentLicense="CC BY-SA 3.0" />
  <row Id="16806" PostTypeId="1" AcceptedAnswerId="20332" CreationDate="2015-09-21T17:39:09.563" Score="4" ViewCount="152" Body="&lt;p&gt;I accidentally unbound a built-in function (a subr) from its usual symbol. Is there a generic way to recover it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I could save my buffers and my session, exit Emacs and start another instance. That is, if the function I lost wasn't needed to save and exit. What can I do if I lose some really fundamental function such as &lt;code&gt;write-region&lt;/code&gt; or &lt;code&gt;get-buffer&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="105" LastEditDate="2016-06-22T20:24:21.460" LastActivityDate="2016-06-22T20:24:21.460" Title="Recover a built-in function that I accidentally unbound" Tags="|functions|builtin|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16807" PostTypeId="1" CreationDate="2015-09-21T17:39:25.890" Score="3" ViewCount="34" Body="&lt;p&gt;Consider this toy example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;&#xA;  (replace-string &quot;a&quot; &quot;A&quot; nil (region-beginning) (region-end) nil)&#xA;  (replace-string &quot;r&quot; &quot;R&quot; nil (region-beginning) (region-end) nil)&#xA;)&#xA;&#xA;(global-set-key (kbd &quot;C-c F&quot;) 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;foo&lt;/code&gt; replaces all a's and r's with A's and R's, respectively.  If one wants to undo it, however, a single undo (&lt;code&gt;C-x u&lt;/code&gt;) isn't be enough; two are required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a way to define &lt;code&gt;foo&lt;/code&gt; such that only one &lt;code&gt;C-x u&lt;/code&gt; is enough to undo everything it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the code above is only an example, I'm looking for solutions that do not depend on the specifics of &lt;code&gt;replace-string&lt;/code&gt;.  IOW, the solution should work for any &lt;code&gt;foo&lt;/code&gt; of the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;&#xA;  ;;&#xA;  ;; body&#xA;  ;;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="882" LastActivityDate="2015-09-22T21:21:17.123" Title="How to define a function to be undoable with a single `C-x u`?" Tags="|elisp|" AnswerCount="0" CommentCount="0" ClosedDate="2015-09-22T21:26:54.743" ContentLicense="CC BY-SA 3.0" />
  <row Id="16808" PostTypeId="1" CreationDate="2015-09-21T17:45:02.600" Score="9" ViewCount="5332" Body="&lt;p&gt;I wonder how could I add the equivalent of side-notes (cues, thinking points indications, references) to a text in org mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tags work fine, but they seem to be limited to headlines. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could also divide the whole text in two fixed-size columns, (with a &lt;code&gt;|&amp;lt;140&amp;gt;|&amp;lt;20&amp;gt;|&lt;/code&gt; table). However, in this last case, the text would not flow adequately. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Footnotes also are a way of adding extra information, but they won't be side-notes anymore. That's why they call them footnotes, I suppose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other options do I have? Could I for example open two buffers and somehow &quot;tie&quot; the scrolling of both so that line n of buffer a, always appears at the side of line n of buffer b?&lt;/p&gt;&#xA;" OwnerUserId="9320" LastActivityDate="2015-09-27T20:03:33.060" Title="How can I add &quot;side-notes&quot; to a text file in org mode?" Tags="|org-mode|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16809" PostTypeId="1" CreationDate="2015-09-21T18:12:29.317" Score="10" ViewCount="2890" Body="&lt;p&gt;The advice feature allows modifying the behavior of a function globally. An advice definition can make calls to the original function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice foo&#xA;  (around foo-bar activate compile)&#xA;  &quot;Always set `qux' to t when running `foo'.&quot;&#xA;  (let ((qux t))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;cl&lt;/code&gt; package provides the &lt;code&gt;flet&lt;/code&gt; macro to override a function locally.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  &quot;global&quot;)&#xA;(flet ((foo ()&#xA;          &quot;local&quot;))&#xA;  (some-code-that-calls-foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That doesn't permit a reference to the original &lt;code&gt;foo&lt;/code&gt; function. What if the local override needs to call the original function?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  &quot;global&quot;)&#xA;(flet ((foo ()&#xA;          (concat (foo) &quot;+local&quot;)))&#xA;  ;; this will cause an infinite loop when (foo) is called&#xA;  (some-code-that-calls-foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This straightforward approach doesn't work, for good reason: &lt;code&gt;(foo)&lt;/code&gt; is a recursive call to the local definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a non-cumbersome way of locally overriding a function, that allows calling the original function from the override code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Application: monkey-patching some existing code, in a case where &lt;code&gt;foo&lt;/code&gt; should not be rebound globally, but the code needs to call the original. Here's the latest example I've been wanting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice TeX-master-file&#xA;  (around TeX-master-file-indirect-buffer activate compile)&#xA;  &quot;Support indirect buffers.&quot;&#xA;  (flet ((buffer-file-name (&amp;amp;optional buffer)&#xA;           (&amp;lt;global buffer-file-name&amp;gt; (buffer-base-buffer buffer))))&#xA;      ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wanted to rebind &lt;code&gt;buffer-file-name&lt;/code&gt; locally, and call the original &lt;code&gt;buffer-file-name&lt;/code&gt;. Ok, in this specific case, there's a workaround, which is to use the &lt;code&gt;buffer-file-name&lt;/code&gt; variable. But the point of my question here is the general technique. How can I bind a function (here &lt;code&gt;buffer-file-name&lt;/code&gt;) locally but call the global definition from my redefinition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for my &lt;code&gt;.emacs&lt;/code&gt;, which I keep working in Emacs 19.34, so solutions that require Emacs 24.4 are out. I do prefer solutions that cope with lexical binding cleanly though — but monkey-patching is inherently about dynamic binding.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="105" LastEditDate="2016-06-22T20:23:18.977" LastActivityDate="2016-06-22T20:23:18.977" Title="Override a function locally, but allow calls to the original function" Tags="|functions|advice|let-binding|local-functions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16810" PostTypeId="2" ParentId="16809" CreationDate="2015-09-21T18:12:29.317" Score="7" Body="&lt;p&gt;Store the original function (obtained with &lt;code&gt;symbol-function&lt;/code&gt;) in a local variable, and use &lt;code&gt;funcall&lt;/code&gt; to call the function object stored in that variable. Cumbersome, but it mostly works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice TeX-master-file&#xA;  (around TeX-master-file-indirect-buffer activate compile)&#xA;  &quot;Support indirect buffers.&quot;&#xA;  (let ((original-buffer-file-name (symbol-function 'buffer-file-name)))&#xA;    (flet ((buffer-file-name (&amp;amp;optional buffer)&#xA;             (funcall original-buffer-file-name (buffer-base-buffer buffer))))&#xA;        ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This &lt;em&gt;mostly&lt;/em&gt; works, in that it does what it's supposed to do, but it can break in rare circumstances. Since Emacs Lisp has no primitive way to define symbols' function slots locally (only variable slots, with &lt;code&gt;let&lt;/code&gt;), &lt;code&gt;flet&lt;/code&gt; sets the bindings and restores them through &lt;code&gt;unwind-protect&lt;/code&gt;. If the code dies because the call nesting exceeded &lt;code&gt;max-lisp-eval-depth&lt;/code&gt;, or if the binding is modified during the execution of this function (e.g. because you're debugging the advice), it's possible for the symbol's function slot not to be restored. &lt;a href=&quot;https://emacs.stackexchange.com/questions/16806/recover-a-built-in-function-that-i-accidentally-unbound/20332#20332&quot;&gt;You may want to take precautions against accidentally losing some functions.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another method is to store a copy of the function. This has the advantage that the original function is never lost.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'original-buffer-file-name (symbol-function 'buffer-file-name))&#xA;(defadvice TeX-master-file&#xA;  (around TeX-master-file-indirect-buffer activate compile)&#xA;  &quot;Support indirect buffers.&quot;&#xA;  (flet ((buffer-file-name (&amp;amp;optional buffer)&#xA;           (original-buffer-file-name (buffer-base-buffer buffer))))&#xA;      ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This would be fine in this specific case, because &lt;code&gt;buffer-file-name&lt;/code&gt; is a built-in function that's unlikely to be rebound, but would not track redefinitions of the global function (for example to add advice to &lt;em&gt;that&lt;/em&gt; function).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-15T18:19:31.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16811" PostTypeId="2" ParentId="16802" CreationDate="2015-09-21T18:22:22.500" Score="1" Body="&lt;p&gt;This isn't what you think it is.  Emacs has &lt;a href=&quot;http://emacshorrors.com/posts/come-in-and-find-out.html&quot; rel=&quot;nofollow&quot;&gt;hilariously terrible heuristics&lt;/a&gt; to determine whether your background in an uncustomized terminal session is dark or light.  What you see here is that it has detected your terminal emulator to come with a light background and is therefore using the light faces on a dark background.  In a GUI session the heuristics won't fail, so it's showing the dark faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for how to achieve this, feel free to patch &lt;code&gt;frame-set-background-mode&lt;/code&gt; or create your own theme that mirrors the aesthetics of this visual glitch...&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-09-21T18:28:51.623" LastActivityDate="2015-09-21T18:28:51.623" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16812" PostTypeId="2" ParentId="16805" CreationDate="2015-09-21T18:34:50.530" Score="6" Body="&lt;p&gt;Learn Emacs Lisp through the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/&quot; rel=&quot;noreferrer&quot;&gt;official tutorial&lt;/a&gt; and by customizing your Emacs environment. Being hands-on is a huge advantage when learning, and learning Emacs Lisp gives you the opportunity to apply your knowledge immediately to do useful things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main language difference is that Common Lisp has &lt;a href=&quot;https://en.wikipedia.org/wiki/Scope_(computer_science)#Lexical_scope_vs._dynamic_scope&quot; rel=&quot;noreferrer&quot;&gt;lexical scope&lt;/a&gt; by default, whereas Emacs only supports lexical scope (but only uses in libraries that explicitly request it) since version 24.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get an idea of what Emacs Lisp is missing, look at Emacs's &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;cl&lt;/code&gt; library&lt;/a&gt; (which is an official part of Emacs, but not loaded by default unless some package that you used requires it). The &lt;code&gt;cl&lt;/code&gt; library offers some extra library features from Common Lisp, in particular a richer set of list processing functions and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Generalized-Variables.html#Generalized-Variables&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;setf&lt;/code&gt;/&lt;code&gt;letf&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-09-21T18:34:50.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16813" PostTypeId="1" AcceptedAnswerId="16867" CreationDate="2015-09-21T18:36:36.333" Score="1" ViewCount="490" Body="&lt;p&gt;I have tried this, not working.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/evil-paste-pop ()&#xA;  (interactive)&#xA;    (if (eq last-command evil-paste-pop) (evil-paste-pop 1)&#xA;    (previous-line)))&#xA;(define-key evil-normal-state-map (kbd &quot;C-p&quot;) 'my/evil-paste-pop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-06-22T20:22:35.773" LastActivityDate="2016-06-22T20:22:35.773" Title="how to bind C-p to Evil paste pop only when last command is a paste operation" Tags="|evil|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16814" PostTypeId="2" ParentId="16805" CreationDate="2015-09-21T18:52:49.437" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;... what I'm deathly afraid of is diving into elisp, getting reasonably good at it, but being totally blind to some of the really slick things CL can do.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is no danger of that at all if one gets &quot;reasonably good&quot; at any dialect of lisp. Unlike other languages that may have caused blindness, lisp has always been known for opening minds.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-21T18:52:49.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16815" PostTypeId="1" CreationDate="2015-09-21T19:32:18.210" Score="2" ViewCount="521" Body="&lt;p&gt;I have a directory &lt;code&gt;~/foo/&lt;/code&gt; with hundreds of org documents among other types of files. I want to export each org file to ASCII. The only way I know how to do this is to follow the following procedure&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;open each file with emacs and issue &lt;code&gt;C-c C-e t a&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;answer &lt;code&gt;yes&lt;/code&gt; to the question &lt;code&gt;Evaluate this emacs-lisp code block on your system?&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Can this procedure be automated from the command line? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: with the help of @zck's answer, my script now looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;&#xA;for file in ~/foo/*.org; do&#xA;    emacs --batch -l ~/.emacs \&#xA;        --eval &quot;(require 'org)&quot; \&#xA;        --insert &quot;${file}&quot; \&#xA;        --eval &quot;(org-ascii-export-as-ascii nil nil nil nil '(:ascii-charset ascii))&quot; \&#xA;        --eval &quot;(write-file \&quot;${file}.report\&quot;)&quot; \&#xA;        --kill&#xA;done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does the job but... I have to answer &quot;yes&quot; to the question &lt;code&gt;Evaluate this emacs-lisp code block on your system?&lt;/code&gt; for each file. Is there a way to automatically answer &lt;code&gt;yes&lt;/code&gt; to this question?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-09-22T02:31:10.083" LastActivityDate="2015-09-22T02:31:10.083" Title="How can I export many org documents to ASCII?" Tags="|org-mode|org-export|batch-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16816" PostTypeId="2" ParentId="16798" CreationDate="2015-09-21T19:34:27.193" Score="2" Body="&lt;p&gt;Have the region &lt;code&gt;-2:5&lt;/code&gt; in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-0 C-x * e&lt;/code&gt; activates calc's embedded mode on that region.  Activate calc-latex-language by typing &lt;code&gt;d L&lt;/code&gt; if not already done.  The marked text has been replaced by &lt;code&gt;\frac{-2}{5}&lt;/code&gt;.  Key sequence &lt;code&gt;C-x * e&lt;/code&gt; deactivates embedded mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I think it's possible to write a command that checks for fractions like &lt;code&gt;-2:5&lt;/code&gt; in a column of an org-table and then applies calc's conversion as pointed out above.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2015-09-21T19:34:27.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16817" PostTypeId="2" ParentId="16792" CreationDate="2015-09-21T19:36:56.860" Score="2" Body="&lt;p&gt;Here is another simple solution for it, taken from &lt;code&gt;comment-dwim-2&lt;/code&gt; package&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun is-empty-line-p ()&#xA;  (string-match-p &amp;quot;^[[:blank:]]*$&amp;quot;&#xA;        (buffer-substring (line-beginning-position)&#xA;                          (line-end-position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="2418" LastEditDate="2021-01-10T05:52:01.740" LastActivityDate="2021-01-10T05:52:01.740" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16818" PostTypeId="1" AcceptedAnswerId="29397" CreationDate="2015-09-21T20:10:58.747" Score="11" ViewCount="1364" Body="&lt;p&gt;I am trying to set [Inconsolata-dz][1] as my default font to Emacs. Regular Inconsolata works fine, but the dz version is not working properly. Most functions I use keep throwing this error (followed all the instructions online on how to set Emacs font):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;set-face-attribute: Invalid font name: &quot;-*-Inconsolata-dz-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1&quot;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I finally got it to work by doing this in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-frame-alist '((font . &quot;Inconsolata-dz-13&quot;)))&#xA;(setq default-frame-alist '((font . &quot;Inconsolata-dz-13&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have this in &lt;code&gt;init.el&lt;/code&gt;, which was generated by &lt;code&gt;customize-faces&lt;/code&gt;, but it seems to change the font to Helvetica (unless overridden by the code above):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(custom-safe-themes&#xA;   (quote&#xA;    (&quot;e16a771a13a202ee6e276d06098bc77f008b73bbac4d526f160faa2d76c1dd0e&quot;&#xA;     &quot;d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879&quot;&#xA;     &quot;8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4&quot;&#xA;     default))))&#xA;&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(default ((t (:inherit nil :stipple nil :inverse-video nil&#xA;             :box nil :strike-through nil :overline nil&#xA;             :underline nil :slant normal&#xA;             :weight normal :height 140 :width normal&#xA;             :foundry &quot;nil&quot; :family &quot;Inconsolata-dz&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the issue with the first code above is that doing a &lt;code&gt;Ctrl+N&lt;/code&gt;, to create a new window will throw the same Invalid font name error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed Inconsolata and Inconsolata-dz the same way on my Mac. Just the regular, default way of installing fonts on OS X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what I'm doing wrong and how I can use Inconsolata-dz properly?&lt;/p&gt;&#xA;" OwnerUserId="5418" LastActivityDate="2016-12-19T00:24:40.087" Title="Cocoa Emacs 24.5 Font Issues (Inconsolata-dz)" Tags="|init-file|osx|faces|fonts|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16820" PostTypeId="2" ParentId="16815" CreationDate="2015-09-21T20:56:45.370" Score="1" Body="&lt;p&gt;The immediate problem is that you haven't imported org. This imports it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  emacs -Q --batch --eval &quot;(require 'org)&quot; \&#xA;    --insert &quot;${file}&quot; -f org-export-dispatch \&#xA;    --eval &quot;(write-file \&quot;${file}.report\&quot;)&quot; --kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it ends up prompting you with &lt;code&gt;Export command:&lt;/code&gt; This is because &lt;code&gt;org-export-dispatch&lt;/code&gt; calls &lt;code&gt;org-export--dispatch-ui&lt;/code&gt;, which calls &lt;code&gt;org-export--dispatch-action&lt;/code&gt;, which has the following docstring (emphasis added):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Read a character&lt;/strong&gt; from command input and act accordingly.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So if we call &lt;code&gt;org-export-dispatch&lt;/code&gt;, it's going to try to read from input. We need to find the function that ends up being called, and call that directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ASCII options displayed in the Org Export Dispatcher are created in ox-ascii.el in org. (I found this by grepping for &quot;As ASCII buffer&quot;). The function we want to call is &lt;code&gt;org-ascii-export-as-ascii&lt;/code&gt;, and it's called with five arguments. The last is a literal, and three of the other four are explained in &lt;code&gt;org-export-as&lt;/code&gt; -- we can set all of &lt;code&gt;SUBTREEP&lt;/code&gt;, &lt;code&gt;VISIBLE-ONLY&lt;/code&gt;, and &lt;code&gt;BODY-ONLY&lt;/code&gt; to nil. I'm assuming that we can also set the &lt;code&gt;ASYNC&lt;/code&gt; argument to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we end up with this long function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q --batch \&#xA;  --eval &quot;(require 'org)&quot; \&#xA;  --insert &quot;$FILE&quot; \&#xA;  --eval &quot;(org-ascii-export-as-ascii nil nil nil nil '(:ascii-charset ascii))&quot; \&#xA;  --eval &quot;(write-file \&quot;$FILE.report\&quot;)&quot; \&#xA;  --kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This exports the file as expected.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-09-21T20:56:45.370" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16821" PostTypeId="2" ParentId="16805" CreationDate="2015-09-21T21:55:58.940" Score="4" Body="&lt;h1&gt;TL;DR&lt;/h1&gt;&#xA;&lt;p&gt;Learn Scheme.&lt;/p&gt;&#xA;&lt;h1&gt;Long Version&lt;/h1&gt;&#xA;&lt;p&gt;I remember myself being in a similar situation some years ago.  First of all, I didn't understand the relation between Emacs Lisp and ANSI Common Lisp (sometimes also referred to as simply Common Lisp, or even more ambiguously, just Lisp).  I ended up learning Common Lisp and eventually writing something to help myself with Emacs.  This isn't ideal.  I'll try to put things in perspective.&lt;/p&gt;&#xA;&lt;p&gt;At first there was just Lisp, the general idea of what the language can do.  There used to be numerous slightly different dialects, but the one which later become the basis for the ANSI standard for Common Lisp was Mac Lisp.  This language had various problems and some bad solutions for these problems.  In particular, because many of its features were developed ad hoc, but also conceptually, macros were perceived evil, and especially so syntax macros.  There wasn't enough uniformity in the design of most commonly used functions (which later made it into the standard), for some there were two versions, like &lt;code&gt;nconc&lt;/code&gt; and &lt;code&gt;concat&lt;/code&gt;, but for others there were either only destructive versions or only non-destructive ones.  The concept of having two namespaces seemed superfluous.  Object system, which was starting to get momentum, wasn't built into the language.  Perhaps there was more: I wasn't yet around to know that.&lt;/p&gt;&#xA;&lt;p&gt;Scheme was meant to be a refinement and improvement on top of the good parts of what came to be associated with Lisp.  It didn't solve all problems, but it tidied up the language, removed some inconsistencies, offered a nice solution for syntax macros, it also introduced a concept of &lt;code&gt;call-with-current-continuation&lt;/code&gt; (which is somewhat similar to Python's &lt;code&gt;yield&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Then, ANSI standardized the remains of Mac Lisp as Common Lisp.  The problem with this Lisp dialect today is that it's unlikely that it will see any major language overhaul.  If one was to spend effort to make it better, one would end up with some variant of Scheme.  And this is what generally happens.  New dialects of Lisp, and the only one that is used for serious and somewhat popular programming today--Clojure is a descendent from Scheme.&lt;/p&gt;&#xA;&lt;p&gt;Now, where does Emacs Lisp fit into the picture?  Whatever my or your opinion on Common Lisp is, it is still a proper multi-purpose programming language, suitable for writing any program you can think of.  The same is true of Scheme and its family.  Emacs Lisp is a remarkably good language for something that was developed to serve one particular program.  It well may be the most elaborate and advanced embedded language there is, with huge ecosystem and being actively developed and improved.  It isn't however suitable for lots of programming needs.  Interfacing with programs outside Emacs, performance-critical code, graphical user interface to name a few.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Scheme may not have improved on every feature of &amp;quot;ancient&amp;quot; Lisps, but it is where the future of Lisps will eventually go.  If you are at a choice point, and you need to pick a language which will stay with you for many years, choose Scheme.  It is reasonably similar to Emacs Lisp so that you will be able to understand Emacs Lisp code and eventually to write your own, but it will also serve you in situations when Emacs Lisp is just not enough.  Also, once every year or so, there are talks about Guile Emacs (an Emacs version which replaces Emacs Lisp interpreter with Guile Scheme).  Who knows, maybe someday...&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-09-21T21:55:58.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16822" PostTypeId="1" CreationDate="2015-09-21T22:50:15.903" Score="3" ViewCount="2446" Body="&lt;p&gt;In org-mode long header line and multiple tags sometimes makes the overview unreadable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;My question is:&lt;/em&gt; Can I use the &lt;code&gt;TAGS&lt;/code&gt; property in the &lt;code&gt;PROPERTIES&lt;/code&gt; drawer to list tags as values rather then having them in the header line. Alternatively but less desirable assign multiple &lt;code&gt;custom_ids&lt;/code&gt; or equivalent, with a list of values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to hide the tags from the overview but still have them searchable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have tried:&#xA;I was naively thinking that the tags property could substitute the header line tags and to list tags here instead.&#xA;The result of using &lt;code&gt;C-c C-x p&lt;/code&gt; and trying to input TAGS value pair results in an error&#xA;&lt;code&gt;org-entry-put: The TAGS property cannot be set with&lt;/code&gt;org-entry-put'`.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Manually trying to input a TAGS entry with a value works but the tag is not searchable by the two methods I tried, &lt;code&gt;C-c /&lt;/code&gt; and &lt;code&gt;C-c \ p&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2015-09-23T13:49:52.710" LastActivityDate="2020-12-10T23:45:34.007" Title="How can I use the PROPERTIES drawer with a TAGS property and asign multiple values to it" Tags="|org-mode|header-line|org-tags|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16823" PostTypeId="2" ParentId="16822" CreationDate="2015-09-21T23:10:23.370" Score="4" Body="&lt;p&gt;After your comment below, I did some experimentation.  I am guessing, after you move all the tags to the &lt;code&gt;TAGS&lt;/code&gt; property, you are expecting to continue to use the normal tag related interfaces to continue working.  This does not look possible.  The tags are provided as properties in the &lt;a href=&quot;http://orgmode.org/manual/Using-the-property-API.html#Using-the-property-API&quot; rel=&quot;nofollow&quot;&gt;property API&lt;/a&gt;, but that does not mean they are like real properties.  They are a bit &quot;special&quot;.  In short: I do not think what you are looking for is possible.  That said, I believe there is a workaround that will get you half-way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could use a custom property, and use the &lt;code&gt;:prop+:&lt;/code&gt; syntax to &lt;a href=&quot;http://orgmode.org/manual/Property-syntax.html#Property-syntax&quot; rel=&quot;nofollow&quot;&gt;add to the property value&lt;/a&gt; to represent multiple tags.  It might get very clumsy if you have too many values for each headline.  You will of course lose all the normal tag related conveniencs, except for inheritance, which is still possible.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline&#xA;  :PROPERTIES:&#xA;  :MYTAGS: tag1&#xA;  :MYTAGS+: tag2&#xA;  :MYTAGS+: tag3&#xA;  :END:&#xA;  This headline has the tags: tag1, tag2, tag3&#xA;&#xA;** Sub-headline&#xA;   :PROPERTIES:&#xA;   :MYTAGS+: tag4&#xA;   :END:&#xA;   This one inherits all the above, and adds tag4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Essentially this way you will be using a custom property as a tag, just for yourself.  That said, I don't think this is worth it, if not having them on the headline is just a matter of aesthetics for you.  Tags are rather deep-seated in how Org works.  Many important functionality like: export, filtering, search, sparse tree uses it heavily.  You will have to miss out on all that.&lt;/p&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="2093" LastEditDate="2015-09-22T18:20:57.350" LastActivityDate="2015-09-22T18:20:57.350" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16824" PostTypeId="2" ParentId="16808" CreationDate="2015-09-22T00:38:46.160" Score="4" Body="&lt;p&gt;One thing you can do is bookmark locations, and add annotations to the bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then the bookmark &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#BookmarkAnnotations&quot; rel=&quot;nofollow&quot;&gt;annotations&lt;/a&gt; can themselves use Org Mode.  They can also be separate documents (which can even have their own bookmarks &amp;amp; annotations).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-22T00:38:46.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16825" PostTypeId="2" ParentId="16792" CreationDate="2015-09-22T00:57:34.857" Score="3" Body="&lt;p&gt;&lt;code&gt;current-indentation&lt;/code&gt; gives you the column following leading blanks, which can be compared against the column at the end of line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun blank-line-p ()&#xA;  (= (current-indentation)&#xA;     (- (line-end-position) (line-beginning-position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-09-22T00:57:34.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16826" PostTypeId="2" ParentId="16792" CreationDate="2015-09-22T03:48:39.763" Score="12" Body="&lt;p&gt;A simple method, close to what you have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun current-line-empty-p ()&#xA;  (string-match-p &quot;\\`\\s-*$&quot; (thing-at-point 'line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="25" LastEditDate="2019-09-10T20:17:16.900" LastActivityDate="2019-09-10T20:17:16.900" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="16827" PostTypeId="1" CreationDate="2015-09-22T04:13:11.193" Score="1" ViewCount="84" Body="&lt;p&gt;Today I tried to export an org table by issuing &lt;code&gt;M-x org-table-export &amp;lt;RET&amp;gt; table.csv &amp;lt;RET&amp;gt; &amp;lt;RET&amp;gt;&lt;/code&gt;. To my surprise, I received the error message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: org-export-create-backend&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe this is happening because of my recent upgrade to org-mode version 8.3.1 from version 7. Any ideas what is going wrong?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-09-22T06:34:45.653" LastActivityDate="2015-09-22T06:34:45.653" Title="Why are my org tables no longer exporting?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16828" PostTypeId="1" CreationDate="2015-09-22T06:00:57.977" Score="1" ViewCount="1348" Body="&lt;p&gt;Actually what happened was this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was looking for a good theme for my emacs. In the process I have changed many themes. I don't know which theme caused this but now my org-mode has different size text at each level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't like this. They look very uneven. Can you please tell me how to undo this?&lt;a href=&quot;https://i.stack.imgur.com/lBlXt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lBlXt.png&quot; alt=&quot;A screenshot of my org-mode text&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9592" LastActivityDate="2015-10-23T15:39:19.300" Title="My org-mode has different size text at different level" Tags="|org-mode|themes|text-properties|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="16829" PostTypeId="2" ParentId="16827" CreationDate="2015-09-22T06:15:58.933" Score="1" Body="&lt;p&gt;Elsewhere, you'd &lt;a href=&quot;https://emacs.stackexchange.com/questions/16815/how-can-i-export-many-org-documents-to-ascii#comment24887_16820&quot;&gt;mentioned&lt;/a&gt; you tried installing both the git and ELPA versions of Org.&lt;/p&gt;&#xA;&lt;p&gt;So that's most likely the problem. You might want to clean up and reinstall Org:&lt;/p&gt;&#xA;&lt;h2&gt;Cleanup&lt;/h2&gt;&#xA;&lt;h3&gt;1. Remove the git version of org&lt;/h3&gt;&#xA;&lt;p&gt;You can use &lt;a href=&quot;http://orgmode.org/worg/dev/org-build-system.html#outline-container-sec-3-7&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;make clean-install&lt;/code&gt;&lt;/a&gt; to remove an org installation from git. If you customized your install location, make sure to use the same settings.&lt;/p&gt;&#xA;&lt;h3&gt;2. Remove the ELPA version of Org.&lt;/h3&gt;&#xA;&lt;p&gt;In &lt;code&gt;list-packages&lt;/code&gt;, move point over the Org package, press &lt;code&gt;d&lt;/code&gt; to mark it for deletion, then press &lt;code&gt;x&lt;/code&gt; to execute the deletion.&lt;/p&gt;&#xA;&lt;h2&gt;Reinstall Org&lt;/h2&gt;&#xA;&lt;p&gt;Pick your favorite way of installing Org, and do that. Either the git version or ELPA version is fine, but the git version is more &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development&quot; rel=&quot;nofollow noreferrer&quot;&gt;bleeding-edge&lt;/a&gt;. You shouldn't need incredibly new Org for most things, but it will have slightly more features and bugfixes.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-09-22T06:15:58.933" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16830" PostTypeId="1" CreationDate="2015-09-22T07:10:06.913" Score="2" ViewCount="42" Body="&lt;p&gt;I recently upgraded &lt;code&gt;org-mode&lt;/code&gt; to version 8.3 from version 7.9.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In previous versions of org mode, the function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @&amp;lt;$&amp;lt;..@&amp;gt;$&amp;gt;=0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would place a 0 in every cell of a table. On my system, the output is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |   |   |   |   |&#xA;| 0 | 0 | 0 | 0 | 0 |&#xA;| 0 | 0 | 0 | 0 | 0 |&#xA;#+TBLFM: @&amp;lt;$&amp;lt;..@&amp;gt;$&amp;gt;=0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, the first row is skipped. What's going on?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I even have the unexpected&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |   |   |   |   |&#xA;| 0 | 0 | 0 | 0 | 0 |&#xA;| 0 | 0 | 0 | 0 | 0 |&#xA;#+TBLFM: @1$1..@3$5=0&#xA;&#xA;|   |   |   |   |   |&#xA;|   |   |   |   |   |&#xA;|   |   |   |   |   |&#xA;#+TBLFM: @1$1..@1$2=0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 0 |   |   |   |   |&#xA;|   |   |   |   |   |&#xA;|   |   |   |   |   |&#xA;#+TBLFM: @1$1=0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it appears that the first row is ignored if the region is a rectangle. Why? Is anyone else running 8.3 getting these same results?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-09-24T01:55:08.720" LastActivityDate="2015-09-24T01:55:08.720" Title="Why are my org-table formulas behaving like this after upgrading to version 8.3?" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16831" PostTypeId="1" AcceptedAnswerId="16852" CreationDate="2015-09-22T07:10:40.133" Score="16" ViewCount="4911" Body="&lt;p&gt;After recently learning about &lt;code&gt;use-package&lt;/code&gt; I decided to port my configuration to it but found myself reluctant to give up the convenience of using &lt;code&gt;package.el&lt;/code&gt; to install packages and keep them updated. I've found it a little tricky to combine &lt;code&gt;use-package&lt;/code&gt; and &lt;code&gt;package.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm generally interested in learning how people combine &lt;code&gt;use-package&lt;/code&gt; with the &lt;code&gt;package.el&lt;/code&gt; system, but for a more specific question, keep reading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I want:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;To have packages installed by the package manager so I can easily browse for packages and keep them updated through &lt;code&gt;list-packages&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;To configure and load packages exclusively through &lt;code&gt;use-package&lt;/code&gt;, so I can easily see in my init file exactly what I'm loading and how it is configured.&lt;/li&gt;&#xA;&lt;li&gt;Optionally, I'd like to also be able to install packages through &lt;code&gt;use-package&lt;/code&gt;'s &lt;code&gt;:ensure&lt;/code&gt; keyword.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If I'm understanding correctly I want very little of what &lt;code&gt;package-initialize&lt;/code&gt; does, basically only the way it sets up the &lt;code&gt;load-path&lt;/code&gt;. Currently I have this in my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;(let ((default-directory &quot;~/.emacs.d/elpa&quot;))&#xA;  (normal-top-level-add-subdirs-to-load-path))&#xA;(require 'use-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first, commented, line is so Emacs 25 doesn't helpfully add a &lt;code&gt;(package-initialize)&lt;/code&gt; to my init file. The bit with &lt;code&gt;normal-top-level-add-subdirs-to-load-path&lt;/code&gt; is an approximation to what &lt;code&gt;package-initialize&lt;/code&gt; would make the &lt;code&gt;load-path&lt;/code&gt;, an approximation that seems good enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to achieve my desires 1 and 2, but not 3. If I try to use &lt;code&gt;:ensure&lt;/code&gt;, I get an error message saying that &lt;code&gt;package.el&lt;/code&gt; is not initialized. Calling &lt;code&gt;package-initialize&lt;/code&gt; would fix that, but I wish to avoid that since a) I don't want all the myriad autoloads to be loaded (I prefer to use &lt;code&gt;use-package&lt;/code&gt; to create precisely the autoloads I need), and b) I want to be able to easily avoid loading certain installed packages whenever I want (which is easy to do with &lt;code&gt;use-package&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a recommendation for how to do this?&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2015-09-22T19:12:25.530" Title="Using package.el to install and update but use-package for loading and configuring" Tags="|package|use-package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16832" PostTypeId="2" ParentId="16831" CreationDate="2015-09-22T08:12:45.907" Score="17" Body="&lt;p&gt;With your current configuration, you've effectively &lt;em&gt;disabled&lt;/em&gt; package.el, as you don't initialise the package manager and prevent Emacs from automatically initialising it.  All you do in return is to add ELPA to the &lt;code&gt;load-path&lt;/code&gt;, but that's just a small subset of what package.el does.  I'm not sure why you do that, but it's not a setup that I'd recommend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, you'll not get package autoloads with your approach, which means that initially no commands from any package will be available.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, &lt;code&gt;M-x&lt;/code&gt; will only offer you built-in commands.  To add in commands from your packages you'd have to add explicit &lt;code&gt;:commands&lt;/code&gt; definitions to &lt;em&gt;all&lt;/em&gt; your &lt;code&gt;use-package&lt;/code&gt; declarations, which amounts to a &lt;strong&gt;lot&lt;/strong&gt; of maintenance effort—particularly for large packages such as Magit—for essentially zero gain—package.el gives you autoloads for free.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Combining &lt;code&gt;use-package&lt;/code&gt; with package.el is actually very simple—y entire setup is based on this combination—but it's much better to let package.el actually to its job.  Just initialise package.el at the very beginning of your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)   ; To prevent initialising twice&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://stable.melpa.org/packages/&quot;))&#xA;&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For convenience you may subsequently want to bootstrap &lt;code&gt;use-package&lt;/code&gt;, if it's not already installed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This let's you start an Emacs session on a fresh system, and your init.el will automatically install &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately you need to load &lt;code&gt;use-package&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'use-package))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can use &lt;code&gt;use-package&lt;/code&gt; to install and configure packages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package magit                      ; The one and only Git frontend&#xA;  :ensure t&#xA;  :bind ((&quot;C-c v c&quot; . magit-clone)&#xA;         (&quot;C-c v v&quot; . magit-status)&#xA;         (&quot;C-c v g&quot; . magit-blame)&#xA;         (&quot;C-c v l&quot; . magit-log-buffer-file)&#xA;         (&quot;C-c v p&quot; . magit-pull))&#xA;   :config (setq magit-save-repository-buffers 'dontask))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When Emacs now evaluates this form during startup, &lt;code&gt;use-package&lt;/code&gt; will check whether Magit is already installed, and automatically install it if necessary.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-09-22T08:12:45.907" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="16833" PostTypeId="2" ParentId="16808" CreationDate="2015-09-22T08:23:03.803" Score="1" Body="&lt;p&gt;I like Drew's answer.  For the sake of completeness, I should mention &lt;a href=&quot;http://orgmode.org/manual/Drawers.html#Drawers&quot; rel=&quot;nofollow&quot;&gt;notes&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want notes for each headline, but not be limited to one word tags, try writing timestamped notes stored in a property drawer next to the headline.  They can be anything in Org syntax.  You can conveniently enter them with &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-z&lt;/kbd&gt; on the headline.  You also have the option to export them by setting &lt;code&gt;org-export-with-drawers&lt;/code&gt;.  However, if you want notes at any random point in the document, Drew's answer seems like what you want.&lt;/p&gt;&#xA;" OwnerUserId="2093" LastActivityDate="2015-09-22T08:23:03.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16834" PostTypeId="1" AcceptedAnswerId="16836" CreationDate="2015-09-22T11:44:59.493" Score="28" ViewCount="8163" Body="&lt;p&gt;I am using Emacs 24.5.1 on OpenSUSE Tumbleweed, with Gnome 3.16, and the title of the GTK window with Emacs in it is always &lt;code&gt;emacs@hostname&lt;/code&gt;. How can I change it to the name of the current file I'm editing?&lt;/p&gt;&#xA;" OwnerUserId="9594" LastEditorUserId="105" LastEditDate="2022-04-18T14:16:19.637" LastActivityDate="2023-02-22T14:36:40.563" Title="How to change the frame title from `emacs@host` to visited file name" Tags="|frames|gtk3|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="16835" PostTypeId="1" AcceptedAnswerId="18917" CreationDate="2015-09-22T11:50:27.380" Score="3" ViewCount="1751" Body="&lt;p&gt;I use the version control system &lt;a href=&quot;http://fossil-scm.org&quot; rel=&quot;nofollow&quot;&gt;fossil&lt;/a&gt;. I'd like to view &lt;code&gt;fossil diff&lt;/code&gt;'s output side-by-side in Emacs. The output looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ fossil diff&#xA;Index: test1.txt&#xA;==================================================================&#xA;--- test1.txt&#xA;+++ test1.txt&#xA;@@ -1,1 +1,1 @@&#xA;-Old text&#xA;+New text&#xA;&#xA;Index: test2.txt&#xA;==================================================================&#xA;--- test2.txt&#xA;+++ test2.txt&#xA;@@ -1,1 +1,1 @@&#xA;-Old text 2&#xA;+New text 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to display this output side-by-side, perhaps with ediff?&lt;/p&gt;&#xA;" OwnerUserId="7004" LastActivityDate="2015-12-19T22:30:39.203" Title="Display diff output side-by-side" Tags="|ediff|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16836" PostTypeId="2" ParentId="16834" CreationDate="2015-09-22T12:17:29.393" Score="38" Body="&lt;p&gt;The file name as frame name&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (setq-default frame-title-format '(&amp;quot;%f&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The file name and the major mode as frame name (my conf)&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (setq-default frame-title-format '(&amp;quot;%f [&amp;quot; mode-name &amp;quot;]&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;See&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Variables Used in the Mode Line&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/_0025_002dConstructs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;%&lt;/code&gt;-Constructs in the Mode Line&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="13275" LastEditDate="2023-02-22T14:36:40.563" LastActivityDate="2023-02-22T14:36:40.563" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="16837" PostTypeId="1" AcceptedAnswerId="16857" CreationDate="2015-09-22T12:20:00.367" Score="1" ViewCount="299" Body="&lt;p&gt;&lt;code&gt;flyspell-auto-correct-previous-word&lt;/code&gt; is a great way to quickly correct mistakes in a buffer. I get a lot of false positives though, and I would like to quickly add them to my dictionary in an analogous way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make a command to do this? Confusingly, &lt;code&gt;flyspell-auto-correct-previous-pos&lt;/code&gt; is always &lt;code&gt;nil&lt;/code&gt; for me.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-09-23T19:56:16.467" Title="Add last mistake to dictionary with flyspell and ispell" Tags="|flyspell|ispell|spell-checking|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16838" PostTypeId="1" AcceptedAnswerId="16839" CreationDate="2015-09-22T12:21:55.960" Score="6" ViewCount="1407" Body="&lt;p&gt;&lt;code&gt;outline-show-all&lt;/code&gt; reveals the contents of all headers in &lt;code&gt;org-mode&lt;/code&gt;. How can I do the opposite? There's no &lt;code&gt;outline-hide-all&lt;/code&gt; command.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2022-08-13T10:12:36.203" Title="Hide all header contents in Org mode" Tags="|org-mode|outline-mode|outline|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16839" PostTypeId="2" ParentId="16838" CreationDate="2015-09-22T12:42:05.953" Score="5" Body="&lt;p&gt;You probably need &lt;code&gt;(hide-sublevels 1)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-09-22T12:42:05.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16840" PostTypeId="1" AcceptedAnswerId="16901" CreationDate="2015-09-22T13:20:34.383" Score="6" ViewCount="1416" Body="&lt;p&gt;I am running emacs in xterm with 'emacs -nw'. When examining diffs I find it hard to read text typed in yellow foreground and green background. How do I change it to eg. green/black or green/default combination?&#xA;Or is there simpler method to change color theme to something more suitable for xterm?&lt;/p&gt;&#xA;" OwnerUserId="9597" LastEditorUserId="2093" LastEditDate="2015-09-24T11:49:53.997" LastActivityDate="2016-12-31T15:43:35.813" Title="How to change green background in magit running in xterm" Tags="|magit|terminal-emacs|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16841" PostTypeId="1" AcceptedAnswerId="16906" CreationDate="2015-09-22T13:42:03.123" Score="0" ViewCount="516" Body="&lt;p&gt;Emacs 24.5.1 in cygwin x64, Windows 7, gpg (GnuPG) 2.0.21 (Gpg4win 2.2.0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visited file ~/somefile.gpg&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Got error &quot;Opening input file&quot; &quot;Can't decrypt&quot; &quot;Exit&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Opening input file&quot; &quot;Can't decrypt&quot; &quot;Exit&quot;)&#xA;  signal(file-error (&quot;Opening input file&quot; &quot;Can't decrypt&quot; &quot;Exit&quot;))&#xA;  epa-file--find-file-not-found-function()&#xA;  run-hook-with-args-until-success(epa-file--find-file-not-found-function)&#xA;  #[257 &quot;...&quot; [#&amp;lt;killed buffer&amp;gt; &quot;~/somefile.gpg&quot; (nil) file-exists-p file-readable-p kill-buffer signal file-error &quot;File is not readable&quot; run-hook-with-args-until-success find-file-not-found-functions t] 5 &quot;\n\n(fn IGNORED)&quot;]((file-error &quot;Opening input file&quot; &quot;Can't decrypt&quot; &quot;Exit&quot;))&#xA;  funcall(#[257 &quot;...&quot; [#&amp;lt;killed buffer&amp;gt; &quot;~/somefile.gpg&quot; (nil) file-exists-p file-readable-p kill-buffer signal file-error &quot;File is not readable&quot; run-hook-with-args-until-success find-file-not-found-functions t] 5 &quot;\n\n(fn IGNORED)&quot;] (file-error &quot;Opening input file&quot; &quot;Can't decrypt&quot; &quot;Exit&quot;))&#xA;  find-file-noselect-1(#&amp;lt;killed buffer&amp;gt; &quot;~/somefile.gpg&quot; nil nil &quot;~/somefile.gpg&quot; (10696049115278578 2661856658))&#xA;  find-file-noselect(&quot;~/somefile.gpg&quot; nil nil t)&#xA;  eval((find-file-noselect &quot;~/somefile.gpg&quot; nil nil t) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pastebin.com/MqcECqQG&quot; rel=&quot;nofollow&quot;&gt;.emacs&lt;/a&gt;, &lt;a href=&quot;http://pastebin.com/GEv4J8Mm&quot; rel=&quot;nofollow&quot;&gt;emacs.bat to launch&lt;/a&gt; just in case.&lt;/p&gt;&#xA;" OwnerUserId="9596" LastEditorUserId="9596" LastEditDate="2015-09-24T12:43:33.860" LastActivityDate="2015-09-24T12:45:07.793" Title="Emacs and Gpg4win Opening input file error" Tags="|microsoft-windows|pgp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16842" PostTypeId="2" ParentId="16756" CreationDate="2015-09-22T14:19:03.273" Score="0" Body="&lt;p&gt;With help from &lt;a href=&quot;https://stackoverflow.com/a/32690256/173149&quot;&gt;https://stackoverflow.com/a/32690256/173149&lt;/a&gt; there are another built-in into &lt;code&gt;cl-lib&lt;/code&gt; alternatives which also available in CL:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; analog for some.&#xA;(loop with value = (floor (* 10 (sin 9)))&#xA;      for pred in (list #'symbolp #'numberp)&#xA;      thereis (funcall pred value))&#xA;&#xA;;; analog for every.&#xA;(loop with value = (floor (* 10 (sin 9)))&#xA;      for pred in (list #'numberp #'plusp #'evenp)&#xA;      always (funcall pred value))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-09-22T14:19:03.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16843" PostTypeId="2" ParentId="16840" CreationDate="2015-09-22T14:49:09.217" Score="2" Body="&lt;p&gt;Use &lt;code&gt;M-x customize-group RET magit-faces RET&lt;/code&gt; to get a list of all the magit faces. All the faces whose names begin with &lt;code&gt;magit-diff-&lt;/code&gt; are relevant here, so you might have to change quite a few and it won't be easy to get a consistent result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual has a whole &lt;a href=&quot;http://magit.vc/manual/magit/Theming-Faces.html&quot; rel=&quot;nofollow&quot;&gt;node&lt;/a&gt; on the subject, but it isn't intended to give you some easy tricks that you could try. Instead it gives an introduction to the problem domain and mentions the relevant conventions and things to consider.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then again, if you only do this for your own use, you can probably get away with just increasing the contrast in &lt;code&gt;magit-diff-{added,removed,context}&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-09-24T12:03:05.680" LastActivityDate="2015-09-24T12:03:05.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16844" PostTypeId="1" CreationDate="2015-09-22T15:32:54.737" Score="1" ViewCount="204" Body="&lt;p&gt;I'm using helm-mode in emacs to open files. However, when I try to copy the path of a file (say &lt;code&gt;/home/user1/Documents/file1.txt&lt;/code&gt;) to paste it in terminal, I get a message saying &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;down-mouse-1&amp;gt; is undefined&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I defined the left-click and hold of mouse for copy in helm-mode?&lt;/p&gt;&#xA;" OwnerUserId="8683" LastActivityDate="2015-09-25T10:42:26.373" Title="How to set mouse left click and hold to copy in helm-mode" Tags="|helm|copy-paste|mouse|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16845" PostTypeId="1" AcceptedAnswerId="16860" CreationDate="2015-09-22T16:28:19.860" Score="10" ViewCount="1654" Body="&lt;p&gt;I love org-mode, but one of the things that has always bugged me is that, if the point is after a collapsed subtree's ellipsis, pressing &lt;code&gt;TAB&lt;/code&gt; doesn't expand it.  For example, if the point is here (represented by &lt;code&gt;|&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Grandiose Plans&#xA;** Save the world...|&#xA;** Colonize Mars...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and I press &lt;code&gt;TAB&lt;/code&gt;, nothing happens.  Instead, I have to put the point here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Grandiose Plans&#xA;** Save the world|...&#xA;** Colonize Mars...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and then I can expand the subtree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that using &lt;code&gt;C-e&lt;/code&gt; to move the cursor to the end of a heading doesn't fix this behavior, it just works around it.  For example, look at this tree:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Long level one heading foo bar baz fizz buzz|...&#xA;** Shorter level two heading...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The point is at the end of the first heading.  If I press the down arrow or &lt;code&gt;C-n&lt;/code&gt; to move down a line, the point will be here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Long level one heading foo bar baz fizz buzz...&#xA;** Shorter level two heading...|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and pressing &lt;code&gt;TAB&lt;/code&gt; will not expand the second-level heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to fix &lt;code&gt;TAB&lt;/code&gt; so that it will expand the heading anyway.  That way, instead of having to do &lt;code&gt;C-n C-e TAB&lt;/code&gt;, one can just do &lt;code&gt;C-n TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't been able to find out anything about fixing this behavior.  Am I missing something, or does some code need to be written?  Thanks.&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastEditorDisplayName="user3871" LastEditDate="2015-09-23T16:57:37.717" LastActivityDate="2018-09-07T15:49:36.700" Title="Expand org-mode subtree with point after ellipsis?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16846" PostTypeId="2" ParentId="13384" CreationDate="2015-09-22T16:33:54.870" Score="3" Body="&lt;p&gt;The normal way to do this within a session is to record the actions as a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html&quot; rel=&quot;nofollow&quot;&gt;keyboard macro&lt;/a&gt;, and then bind that macro to a key. You can also save the macro and binding to a file to use it across sessions. The details are provided in the Emacs manual.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-09-22T16:33:54.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16847" PostTypeId="1" AcceptedAnswerId="16884" CreationDate="2015-09-22T16:46:51.233" Score="1" ViewCount="416" Body="&lt;p&gt;I need to have automatic evaluation turned &lt;em&gt;on&lt;/em&gt; for elisp (or emacs-lisp) because I have huge documents that I export to PDF with batch scripts, and it's intolerable to have to go in and manually evaluate elisp blocks.  Here is an MVE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following org-babel file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp :exports both&#xA;(+ 1 41)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :exports both :results output&#xA;print 'only python, no lisp for y00'&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can evaluate either code block by placing point in them and typing &lt;code&gt;C-c C-c&lt;/code&gt;.  In each block, I get an interactive security question &lt;code&gt;Evaluate this (elisp / python) code block on your system?&lt;/code&gt;  Great, no problem.  Doing that for both, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp :exports both&#xA;(+ 1 41)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 42&#xA;&#xA;#+BEGIN_SRC python :exports both :results output&#xA;print 'only python, no lisp for y00'&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: only python, no lisp for y00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ok, I now remove the &lt;code&gt;#+RESULTS&lt;/code&gt; blocks and type &lt;code&gt;M-x org-babel-export-to-pdf&lt;/code&gt;.  I only get the security question for the python block, and not for the elisp block.  The PDF output only has the results for the python block and not for the elisp block.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks like some setting has auto-evaluation-on-export or some such turned off for elisp.  Changing the code type to emacs-lisp for the elisp block does not fix it. &lt;/p&gt;&#xA;" OwnerUserId="596" LastEditorUserId="596" LastEditDate="2015-09-22T16:57:41.393" LastActivityDate="2015-09-24T07:40:03.397" Title="Python blocks evaled; elisp blocks not: org-babel export to latex" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16848" PostTypeId="2" ParentId="16802" CreationDate="2015-09-22T16:56:19.487" Score="1" Body="&lt;p&gt;Did you ever wonder how Emacs finds out whether you are using a dark or light background? If you’ve themed it, it can just ask for the current definition of the default face, but if you didn’t do this yet, only GUI Emacs can answer this question truthfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what does Emacs do for the case of an uncustomized setup in a terminal? Simple, it has a hardcoded list of terminal emulators that use light backgrounds by default and does otherwise assume an unknown one uses a dark background!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Joke’s on you if you’re using any of these with a dark background and wonder why it’s looking so different…&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((frame-default-bg-mode (frame-terminal-default-bg-mode frame))&#xA;       (bg-color (frame-parameter frame 'background-color))&#xA;       (tty-type (tty-type frame))&#xA;       (default-bg-mode&#xA;         (if (or (window-system frame)&#xA;                 (and tty-type&#xA;                      (string-match &quot;^\\(xterm\\|\\rxvt\\|dtterm\\|eterm\\)&quot;&#xA;                                    tty-type)))&#xA;             'light&#xA;           'dark))&#xA;       (non-default-bg-mode (if (eq default-bg-mode 'light) 'dark 'light))&#xA;       (bg-mode&#xA;        (cond (frame-default-bg-mode)&#xA;              ((equal bg-color &quot;unspecified-fg&quot;) ; inverted colors&#xA;               non-default-bg-mode)&#xA;              ((not (color-values bg-color frame))&#xA;               default-bg-mode)&#xA;              ((&amp;gt;= (apply '+ (color-values bg-color frame))&#xA;                   ;; Just looking at the screen, colors whose&#xA;                   ;; values add up to .6 of the white total&#xA;                   ;; still look dark to me.&#xA;                   (* (apply '+ (color-values &quot;white&quot; frame)) .6))&#xA;               'light)&#xA;              (t 'dark)))&#xA;       (display-type&#xA;        (cond ((null (window-system frame))&#xA;               (if (tty-display-color-p frame) 'color 'mono))&#xA;              ((display-color-p frame)&#xA;               'color)&#xA;              ((x-display-grayscale-p frame)&#xA;               'grayscale)&#xA;              (t 'mono)))&#xA;       (old-bg-mode&#xA;        (frame-parameter frame 'background-mode))&#xA;       (old-display-type&#xA;        (frame-parameter frame 'display-type)))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://emacshorrors.com/posts/come-in-and-find-out.html&quot; rel=&quot;nofollow&quot;&gt;http://emacshorrors.com/posts/come-in-and-find-out.html&lt;/a&gt;. Licensed Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0).&lt;/p&gt;&#xA;" OwnerUserId="9589" LastActivityDate="2015-09-22T16:56:19.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16849" PostTypeId="2" ParentId="16844" CreationDate="2015-09-22T17:11:56.350" Score="2" Body="&lt;p&gt;If you don't insist on using mouse in Emacs, implementing your request using keyboard is straightforward.  For example, if you want to copy some filename while running the &lt;code&gt;helm-find-files&lt;/code&gt; command, customize &lt;code&gt;helm-find-files-actions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;helm-files&quot;&#xA;  (add-to-list 'helm-find-files-actions '(&quot;Copy filename&quot; . kill-new) :append)&#xA;  (setq helm-source-find-files (helm-make-source &quot;Find Files&quot; 'helm-source-ffiles)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then you can use the new action &quot;Copy filename&quot; from helm's action menu, that is, type &lt;kbd&gt;TAB&lt;/kbd&gt; (&lt;code&gt;helm-select-action&lt;/code&gt;) in a helm session.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you like, you can even assign a shortcut key (e.g., &lt;kbd&gt;C-c m&lt;/kbd&gt;) for it, so that you can invoke that action without switching to helm's action menu.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-ff-run-copy-filename ()&#xA;  (interactive)&#xA;  (with-helm-alive-p&#xA;    (helm-exit-and-execute-action 'kill-new)))&#xA;&#xA;(with-eval-after-load &quot;helm-files&quot;&#xA;  (define-key helm-find-files-map (kbd &quot;C-c m&quot;) #'helm-ff-run-copy-filename))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For other helm commands, customize corresponding action, for example, for &lt;code&gt;helm-recentf&lt;/code&gt; command, customize &lt;code&gt;helm-type-file-actions&lt;/code&gt; similarly.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-09-25T10:42:26.373" LastActivityDate="2015-09-25T10:42:26.373" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16850" PostTypeId="1" AcceptedAnswerId="35904" CreationDate="2015-09-22T17:12:48.860" Score="5" ViewCount="453" Body="&lt;p&gt;When I execute a source block, I'd like to get a timestamp on the &lt;code&gt;+RESULTS&lt;/code&gt; block so that I can remember when it was last executed. Is there a built-in option for this or do I need to go in and add a hook or a advise a function somewhere?&lt;/p&gt;&#xA;" OwnerUserId="62" LastActivityDate="2017-10-03T09:21:52.193" Title="Timestamp on babel-execute results block?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16852" PostTypeId="2" ParentId="16831" CreationDate="2015-09-22T19:12:25.530" Score="10" Body="&lt;p&gt;IIUC what you want to do is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the &lt;code&gt;t&lt;/code&gt; argument, which is the key to your happiness here since it will (or should, at least) initialize package.el without activating all the installed packages.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-09-22T19:12:25.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16853" PostTypeId="2" ParentId="16834" CreationDate="2015-09-22T20:48:05.017" Score="9" Body="&lt;p&gt;Make emacs' window title show path of the current file:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq-default frame-title-format&#xA;              '(:eval&#xA;                (format &amp;quot;%s@%s: %s %s&amp;quot;&#xA;                        (or (file-remote-p default-directory 'user)&#xA;                            user-real-login-name)&#xA;                        (or (file-remote-p default-directory 'host)&#xA;                            system-name)&#xA;                        (buffer-name)&#xA;                        (cond&#xA;                         (buffer-file-truename&#xA;                          (concat &amp;quot;(&amp;quot; buffer-file-truename &amp;quot;)&amp;quot;))&#xA;                         (dired-directory&#xA;                          (concat &amp;quot;{&amp;quot; dired-directory &amp;quot;}&amp;quot;))&#xA;                         (t&#xA;                          &amp;quot;[no file]&amp;quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2020-08-23T10:52:01.453" LastActivityDate="2020-08-23T10:52:01.453" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16854" PostTypeId="2" ParentId="16800" CreationDate="2015-09-22T21:11:18.420" Score="5" Body="&lt;p&gt;Works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comment-start &quot;#&quot;)&#xA;(font-lock-add-keywords nil '((&quot;#.+&quot; . font-lock-comment-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a more general solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-comment-char (char)&#xA;  &quot;Sets comment char for current buffer.&quot;&#xA;  (interactive &quot;sComment char: &quot;)&#xA;  (setq comment-start char)&#xA;  (font-lock-add-keywords nil `((,(concat comment-start &quot;.+&quot;) . font-lock-comment-face)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a more general solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode text-mode-with-hash-comments text-mode&#xA;  &quot;text-mode with # comments&quot;&#xA;&#xA;  (setq comment-start &quot;#&quot;)&#xA;  (font-lock-add-keywords nil '((&quot;#.+&quot; . font-lock-comment-face)))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2018-04-22T05:53:11.317" LastActivityDate="2018-04-22T05:53:11.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16855" PostTypeId="2" ParentId="16845" CreationDate="2015-09-22T21:14:58.503" Score="3" Body="&lt;p&gt;&lt;strong&gt;org-reveal&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you are to the right of the ellipses you might be (depending what the ellipses are hiding) in effect down in the hierarchy tree and not in the respective headline.  In this situation you could type&#xA; &lt;kbd&gt;C-u C-c C-r&lt;/kbd&gt; and the headline will be revealed (but you will end up with the cursor at another location). Or you have to change your cursor position first, as you have shown in your question (I would prefer a &lt;kbd&gt;C-a&lt;/kbd&gt; though). &lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-09-23T04:33:33.863" LastActivityDate="2015-09-23T04:33:33.863" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16857" PostTypeId="2" ParentId="16837" CreationDate="2015-09-22T21:43:28.043" Score="1" Body="&lt;p&gt;If I understand your question correctly this should solve it. The &lt;code&gt;add-false-postive&lt;/code&gt; command jumps back to the previous error, adds it to the dict, cleans up and jumps back.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun goto-previous-spelling-error ()&#xA;  &quot;Go to previous spelling error.&quot;&#xA;  (interactive)&#xA;  (push-mark (point) t nil)&#xA;  (let ((pos (point))&#xA;        (min (point-min)))&#xA;    (while (and (&amp;gt; pos min)&#xA;                (let ((ovs (overlays-at pos))&#xA;                      (r '()))&#xA;                  (while (and (not r) (consp ovs))&#xA;                    (if (flyspell-overlay-p (car ovs))&#xA;                        (setq r t)&#xA;                      (setq ovs (cdr ovs))))&#xA;                  (not r)))&#xA;      (backward-word 1)&#xA;      (setq pos (point)))&#xA;    (goto-char pos)))&#xA;&#xA;(defun add-false-postive ()&#xA;  &quot;Add previous false positive to dict&quot;&#xA;  (interactive)&#xA;  (goto-previous-spelling-error)&#xA;  (let* ((flyspell-info (flyspell-get-word))&#xA;         (word (car flyspell-info))&#xA;         (bounds (cdr flyspell-info)))&#xA;    (flyspell-do-correct 'save nil word (point) (car bounds) (cadr bounds) (point))&#xA;    (flyspell-delete-region-overlays (car bounds) (cadr bounds))&#xA;    (exchange-point-and-mark)&#xA;    (deactivate-mark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-23T19:56:16.467" LastActivityDate="2015-09-23T19:56:16.467" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16858" PostTypeId="1" CreationDate="2015-09-22T22:08:45.930" Score="3" ViewCount="2144" Body="&lt;p&gt;I want to use Emacs for programming in Clojure, Mathematica and for taking notes in class. I am using the Emacs configuration provided by &quot;Clojure for the Brave and Bold&quot;, which pretty heavily customizes Emacs for Clojure. I would like to have a different environment for Mathematica, and a vanilla environment for note taking?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I keep multiple profiles for Emacs?&lt;/p&gt;&#xA;" OwnerUserId="9604" LastActivityDate="2016-02-24T21:12:09.147" Title="different emacs configurations" Tags="|init-file|config|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16859" PostTypeId="1" AcceptedAnswerId="16863" CreationDate="2015-09-22T22:17:28.167" Score="3" ViewCount="102" Body="&lt;p&gt;I have an org document with two different-sized tables &lt;code&gt;table1&lt;/code&gt; and &lt;code&gt;table2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: table1&#xA;|   |   |   |   |   |   |   |&#xA;|---+---+---+---+---+---+---|&#xA;|   |   | x | x | x | x | x |&#xA;|   |   | x | x | x | x | x |&#xA;|   |   | x | x | x | x | x |&#xA;|   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |&#xA;#+TBLFM: @2$3..@4$7=x&#xA;&#xA;#+TBLNAME: table2&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|---+---+---+---+---+---+---+---+---+---|&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   | y | y | y | y | y |   |&#xA;|   |   |   |   | y | y | y | y | y |   |&#xA;|   |   |   |   | y | y | y | y | y |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;#+TBLFM: @6$5..@8$9=y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The region in &lt;code&gt;table1&lt;/code&gt; marked with &lt;code&gt;x&lt;/code&gt;'s and the region in &lt;code&gt;table2&lt;/code&gt; marked with &lt;code&gt;y&lt;/code&gt;'s are both arrays with three rows and four columns. I want to import the information in the indicated region of &lt;code&gt;table2&lt;/code&gt; into the indicated region of &lt;code&gt;table1&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading through the org documentation it appears that something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$3..@4$7='(identity remote(table2, &amp;lt;STUFF&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;might work, but I can't figure out what &lt;code&gt;&amp;lt;STUFF&amp;gt;&lt;/code&gt; should be. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2093" LastEditDate="2015-09-24T00:19:41.617" LastActivityDate="2015-09-24T00:19:41.617" Title="Can I import a rectangle from one org-table into another org-table?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16860" PostTypeId="2" ParentId="16845" CreationDate="2015-09-22T23:58:56.467" Score="4" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-special-ctrl-a/e t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;C-e&lt;/code&gt; moves to before the ellipses, not after.&lt;/p&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2015-09-22T23:58:56.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16861" PostTypeId="2" ParentId="16858" CreationDate="2015-09-23T00:16:42.787" Score="8" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I keep multiple profiles for Emacs?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In a single &lt;strong&gt;init&lt;/strong&gt; file. As others have suggested in the comments above, this is easily done in emacs without having multiple profiles. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A single init file can keep the settings for multiple &lt;strong&gt;modes&lt;/strong&gt;. Based on your question, those modes would be Clojure, Mathematica, and Text modes, and perhaps others in future. Depending on which file is currently being edited/active, those settings, configurations, keyboard shortcuts, etc., become active. In emacs terminology, grouping such behaviors is called &lt;strong&gt;modes&lt;/strong&gt;, of which there are &lt;strong&gt;major&lt;/strong&gt; and &lt;strong&gt;minor&lt;/strong&gt; kinds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The effect of this flexibility is that you don't have to restart emacs with different profiles. Nor do you have to run multiple emacs instances. This common misunderstanding comes from other editors, but not emacs. In emacs you switch from a clojure buffer, a mathematica buffer, and a text file without restarting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't have to go into intricacies of modes to just start using them to great benefit. The easiest approach is to load pre-prepared init files that contain those modes. One place to start is the &lt;a href=&quot;http://eschulte.github.io/emacs24-starter-kit/&quot; rel=&quot;noreferrer&quot;&gt;emacs starter kit&lt;/a&gt;. It comes with many modes ready for use and has an easy approach to customization for new emacs users.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-09-23T11:11:07.583" LastActivityDate="2015-09-23T11:11:07.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16863" PostTypeId="2" ParentId="16859" CreationDate="2015-09-23T07:39:09.990" Score="4" Body="&lt;p&gt;Here you go. The key was to recombine the rows back (for some reason when Org copies a rectangle area it flattens it).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: table1&#xA;|   |   |   |   |   |   |   |&#xA;|---+---+---+---+---+---+---|&#xA;|   |   |   |   |   |   |   |&#xA;|   |   | a | a | a | a | a |&#xA;|   |   | b | b | b | b | b |&#xA;|   |   | c | c | c | c | c |&#xA;|   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |&#xA;#+TBLFM: @3$3..@5$7=arrange(remote(table2, @6$5..@8$9), 5)_(@# - 2)_($# - 2)&#xA;&#xA;#+TBLNAME: table2&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|---+---+---+---+---+---+---+---+---+---|&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   | a | a | a | a | a |   |&#xA;|   |   |   |   | b | b | b | b | b |   |&#xA;|   |   |   |   | c | c | c | c | c |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |   |   |&#xA;#+TBLFM: @6$5..@6$9=a::@7$5..@7$9=b::@8$5..@8$9=c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-09-23T07:39:09.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16864" PostTypeId="1" CreationDate="2015-09-23T10:21:10.890" Score="7" ViewCount="3634" Body="&lt;p&gt;By default org mode seems to configure 8x11 as the paper type when I export to latex.  I always print to A4, so I would like all of my exports to specify a4 as the paper type -- e.g.: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[a4paper]{article}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I currently solve the problem by putting the following line in my file whenever I want to export, but that's pretty redundant:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_CLASS_OPTIONS: [a4paper]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I tell emacs to do this whenever I run latex export?&lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="2093" LastEditDate="2015-09-24T00:02:27.240" LastActivityDate="2021-06-18T08:59:13.217" Title="How do I configure class options for latex export in my .emacs?" Tags="|org-mode|latex|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16865" PostTypeId="1" CreationDate="2015-09-23T11:06:51.600" Score="3" ViewCount="424" Body="&lt;p&gt;For example, if I set a default frame font to Terminus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (version)&#xA;&quot;GNU Emacs 24.5.1 (i686-pc-mingw32)\n of 2015-04-11 on LEG570&quot;&#xA;&#xA;ELISP&amp;gt; (add-to-list 'default-frame-alist '(font . &quot;Terminus-10&quot;))&#xA;((font . &quot;Terminus-10&quot;)&#xA; (height . 45)&#xA; (vertical-scroll-bars . left))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then open a new frame, switch to &lt;code&gt;*scratch*&lt;/code&gt; buffer &amp;amp; type something in Ukrainian, Emacs suddenly uses Consolas font for the typed text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OAJvM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OAJvM.png&quot; alt=&quot;A screenshot of a Emacs *scratch* buffer&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I force Emacs to use Terminus font for Cyrillic characters too? (Terminus supports Cyrillic for sure, because I use it in the Cygwin terminal &amp;amp; it works fine there.)&lt;/p&gt;&#xA;" OwnerUserId="9611" LastActivityDate="2015-12-22T13:42:33.290" Title="Set the same font for different input languages in Windows" Tags="|microsoft-windows|fonts|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16866" PostTypeId="2" ParentId="16865" CreationDate="2015-09-23T11:59:19.643" Score="3" Body="&lt;p&gt;You should be able to use &lt;code&gt;set-fontset-font&lt;/code&gt; to force emacs to use a specified font for a given range of characters.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(set-fontset-font &quot;fontset-default&quot;&#xA;                  (cons (decode-char 'ucs #x0400)&#xA;                        (decode-char 'ucs #x052F))&#xA;                  (font-spec :size 10 :name &quot;Terminus&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More information about Font Sets can be found in the &lt;a href=&quot;http://www.emacswiki.org/emacs/FontSets&quot; rel=&quot;nofollow&quot;&gt;emacs wiki&lt;/a&gt;. The range of unicode characters above should correspond to the &quot;Cyrillic&quot; and &quot;Cyrillic Supplements&quot; unicode blocks, as listed in the relevant &lt;a href=&quot;https://en.wikipedia.org/wiki/Unicode_block&quot; rel=&quot;nofollow&quot;&gt;Wikipedia article&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-23T11:59:19.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16867" PostTypeId="2" ParentId="16813" CreationDate="2015-09-23T12:30:46.037" Score="1" Body="&lt;p&gt;The last-command should be evil-paste-after, and it has to be quoted. Here's the answer to set C-p to do previous-line if previous command is not evil-paste-after, this also works if you do evil-paste-unpop (C-n) in the middle. Previous-line is already binded to h, so perhaps C-p should bind to other command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/evil-paste-pop ()&#xA;  (interactive)&#xA;    (if (eq last-command 'evil-paste-after) (evil-paste-pop 1)&#xA;    (previous-line)))&#xA;(define-key evil-normal-state-map (kbd &quot;C-p&quot;) 'my/evil-paste-pop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastActivityDate="2015-09-23T12:30:46.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16868" PostTypeId="2" ParentId="2303" CreationDate="2015-09-23T12:41:18.820" Score="9" Body="&lt;p&gt;As someone who just had this problem, I found another solution: &lt;code&gt;auto-image-file-mode&lt;/code&gt;. What it does is automatically make sure the file is in image mode instead of binary, so enable both that and &lt;code&gt;auto-revert-mode&lt;/code&gt; and everything works as expected. Emacs 24.4.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://osdir.com/ml/bug-gnu-emacs-gnu/2014-01/msg01061.html&quot;&gt;http://osdir.com/ml/bug-gnu-emacs-gnu/2014-01/msg01061.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6568" LastActivityDate="2015-09-23T12:41:18.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16869" PostTypeId="1" AcceptedAnswerId="16872" CreationDate="2015-09-23T13:15:27.223" Score="3" ViewCount="283" Body="&lt;p&gt;In various programming modes, assuming I have a few lines of code like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo()&#xA;bar()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I want to turn it into a block (say, and if of some sort)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (something) {&#xA;  foo()&#xA;  bar()&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there, in general, a more clever way than :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;selecting the region&lt;/li&gt;&#xA;&lt;li&gt;yaking it&lt;/li&gt;&#xA;&lt;li&gt;typing the &lt;code&gt;if...&lt;/code&gt; line&lt;/li&gt;&#xA;&lt;li&gt;pasting the region&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm probably just missing the name of something (&quot;wrapping&quot; ?)&lt;/p&gt;&#xA;" OwnerUserId="6920" LastActivityDate="2015-09-23T14:18:30.347" Title="How to create a block from lines" Tags="|prog-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16870" PostTypeId="2" ParentId="16864" CreationDate="2015-09-23T13:49:49.723" Score="7" Body="&lt;p&gt;You need to configure the &lt;code&gt;org-latex-classes&lt;/code&gt; variable.&#xA;Usually something like the following does the trick:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'org-latex-classes&#xA;         '(&amp;quot;article&amp;quot; &amp;quot;\\documentclass[11pt,a4paper]{article}&amp;quot;&#xA;            (&amp;quot;\\section{%s}&amp;quot; . &amp;quot;\\section*{%s}&amp;quot;)&#xA;            (&amp;quot;\\subsection{%s}&amp;quot; . &amp;quot;\\subsection*{%s}&amp;quot;)&#xA;            (&amp;quot;\\subsubsection{%s}&amp;quot; . &amp;quot;\\subsubsection*{%s}&amp;quot;)&#xA;            (&amp;quot;\\paragraph{%s}&amp;quot; . &amp;quot;\\paragraph*{%s}&amp;quot;)&#xA;            (&amp;quot;\\subparagraph{%s}&amp;quot; . &amp;quot;\\subparagraph*{%s}&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;However, there already is a default class called &lt;code&gt;article&lt;/code&gt;.&#xA;Editing that entry in the list is not recommended.&lt;/p&gt;&#xA;&lt;p&gt;So I suggest creating your own, say &lt;code&gt;a4article&lt;/code&gt;, by replacing &lt;code&gt;&amp;quot;article&amp;quot;&lt;/code&gt; in the above example with &lt;code&gt;&amp;quot;a4article&amp;quot;&lt;/code&gt;.&#xA;You can find many other examples in my &lt;a href=&quot;https://github.com/suvayu/.emacs.d/blob/master/org-mode-config.el#L190&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs setup&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="30278" LastEditDate="2021-06-18T08:59:13.217" LastActivityDate="2021-06-18T08:59:13.217" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="16871" PostTypeId="2" ParentId="16869" CreationDate="2015-09-23T13:50:57.523" Score="2" Body="&lt;p&gt;I usually use &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt; for this. First, write in your &lt;code&gt;if&lt;/code&gt; statement, leaving the point where the pipe &lt;code&gt;|&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (condition) {|}&#xA;foo();&#xA;bar();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then call the function &lt;code&gt;sp-slurp-hybrid-sexp&lt;/code&gt; twice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (condition) {&#xA;    foo();&#xA;    bar();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Hybrid-S-expressions&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt; wiki page&lt;/a&gt; for more info on &quot;hybrid s-exps&quot;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-09-23T13:50:57.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16872" PostTypeId="2" ParentId="16869" CreationDate="2015-09-23T13:58:33.050" Score="2" Body="&lt;h1&gt;Using &lt;code&gt;yasnippet&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You did not mention what programming language major mode you are working in. So let me provide an example for &lt;code&gt;c-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;First time setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Install &lt;code&gt;yasnippet&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to install the &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;yasnippet&lt;/code&gt;&lt;/a&gt; package (also available from Melpa) to implement the below solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Check out &lt;a href=&quot;http://cupfullofcode.com/blog/2013/02/26/snippet-expansion-with-yasnippet/index.html&quot; rel=&quot;nofollow&quot;&gt;this wonderful introduction to yasnippet&lt;/a&gt;&lt;/em&gt; especially if you are a first time user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Create a snippet for &lt;code&gt;if&lt;/code&gt; condition for your major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;yasnippet&lt;/code&gt; picks up snippets saved in the &lt;code&gt;~/.emacs.d/snippets/&lt;/code&gt; directory. Within that directory, you would have a directory for each of the major modes for which you plan to use &lt;code&gt;yasnippet&lt;/code&gt;. So that directory would be &lt;code&gt;c-mode/&lt;/code&gt; in this case. Save the below code snippet as &lt;code&gt;~/.emacs.d/snippets/c-mode/if&lt;/code&gt; &lt;em&gt;file&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: if&#xA;# key: if&#xA;# expand-env: ((yas-indent-line 'auto) (yas-also-auto-indent-first-line t) (yas-wrap-around-region t))&#xA;# --&#xA;if (${1:some_condition}) {&#xA;  $0&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Take note of the &lt;code&gt;(yas-wrap-around-region t)&lt;/code&gt; portion in the &lt;code&gt;expand-env:&lt;/code&gt; line above. That is what will allow you to select a region and wrap it with the snippet expansion. The other options in that line are for auto-indentation convenience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Load your new snippet using &lt;code&gt;M-x yas-reload-all&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Using the snippet once everything is set&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Select the code which you want to wrap with &lt;code&gt;if&lt;/code&gt; condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose this is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;foo();&#xA;bar();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Insert your snippet&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x yas-insert-snippet&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select the &lt;code&gt;if&lt;/code&gt; snippet&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Result&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;if (some_condition) {&#xA;  foo();&#xA;  bar();&#xA; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-09-23T14:18:30.347" LastActivityDate="2015-09-23T14:18:30.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16873" PostTypeId="2" ParentId="16828" CreationDate="2015-09-23T14:42:12.403" Score="1" Body="&lt;p&gt;Actually the problem was with the current theme I am using which was solarized theme. This is the link to the theme &lt;a href=&quot;https://github.com/bbatsov/solarized-emacs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bbatsov/solarized-emacs&lt;/a&gt;. I figured out the problem by un-applying the theme through &lt;code&gt;customize-theme&lt;/code&gt;. If you are using the same theme you can solve this problem by including &lt;code&gt;(setq solarized-scale-org-headlines nil)&lt;/code&gt; in your &lt;code&gt;init&lt;/code&gt; file .&lt;/p&gt;&#xA;" OwnerUserId="9592" LastActivityDate="2015-09-23T14:42:12.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16874" PostTypeId="1" AcceptedAnswerId="16876" CreationDate="2015-09-23T15:09:53.247" Score="5" ViewCount="1882" Body="&lt;p&gt;&lt;code&gt;list-buffers&lt;/code&gt; gives a list of all buffers. But, I want only buffers where a specific minor mode (say &lt;code&gt;aggressive-indent-mode&lt;/code&gt;) mode is enabled. How can I filter them?  &lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2015-09-23T21:53:04.553" LastActivityDate="2016-12-11T21:53:02.063" Title="List all buffers with specific mode?" Tags="|buffers|minor-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16875" PostTypeId="2" ParentId="16560" CreationDate="2015-09-23T15:26:03.337" Score="1" Body="&lt;p&gt;Although &lt;code&gt;ruby-mode&lt;/code&gt; works pretty well, there were some problems. After trying several other modes, I found this &lt;a href=&quot;https://github.com/joshwnj/json-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;json-mode&lt;/code&gt;&lt;/a&gt; to work perfectly.&lt;/p&gt;&#xA;" OwnerUserId="9507" LastActivityDate="2015-09-23T15:26:03.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16876" PostTypeId="2" ParentId="16874" CreationDate="2015-09-23T15:31:11.137" Score="10" Body="&lt;p&gt;You can do this easily in &lt;code&gt;ibuffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an &lt;code&gt;ibuffer&lt;/code&gt; buffer, run &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;ibuffer-filter-by-predicate&lt;/code&gt; and it will prompt you for a form. For minor modes, just enter the minor mode name variable as the predicate and it will only show you buffers with that minor mode activated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;ibuffer-filter-by-predicate&lt;/code&gt; is bound to &lt;kbd&gt;/ e&lt;/kbd&gt; in &lt;code&gt;ibuffer-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also define your own ibuffer filters using &lt;code&gt;define-ibuffer-filter&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your use case this filter would work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It allows you to specify any minor or major mode and filters the buffers accordingly.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-ibuffer-filter any-mode                                                                                                        &#xA;   &quot;Toggle current view to buffers for which QUALIFIER is the active major mode or an active minor mode.&quot;                              &#xA;  (:description &quot;any-mode&quot;                                                                                                             &#xA;   :reader (let ((modes))                                                                                                              &#xA;             (mapatoms                                                                                                                 &#xA;              (lambda (sym)                                                                                                            &#xA;                (when (string-match-p &quot;^[^:].+-mode$&quot; (symbol-name sym))                                                               &#xA;                  (push (symbol-name sym) modes))))                                                                                    &#xA;             (intern (completing-read &quot;mode: &quot; modes nil t))))                                                                         &#xA;  (with-current-buffer buf                                                                                                             &#xA;    (or (ignore-errors (symbol-value qualifier))  (equal major-mode qualifier))))    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After evaluating the code above, the function &lt;code&gt;ibuffer-filter-by-any-mode&lt;/code&gt; will be available for your use.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-09-23T18:36:25.640" LastActivityDate="2015-09-23T18:36:25.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16877" PostTypeId="2" ParentId="16874" CreationDate="2015-09-23T15:47:58.547" Score="4" Body="&lt;p&gt;To do it programatically you can use &lt;code&gt;(get-buffers-with-minor-mode 'aggressive-indent-mode)&lt;/code&gt; using the following code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun get-buffers-with-minor-mode (minor-mode)&#xA;  &quot;Get a list of buffers in which minor-mode is active&quot;&#xA;  (interactive)&#xA;  (let ((minor-mode-buffers))&#xA;    (dolist (buf (buffer-list) minor-mode-buffers)&#xA;      (with-current-buffer buf&#xA;        (when (memq minor-mode (manage-minor-mode--active-list))&#xA;          (push buf minor-mode-buffers))))))&#xA;&#xA;&#xA;;; Taken from https://github.com/ShingoFukuyama/manage-minor-mode&#xA;(defun manage-minor-mode--active-list ()&#xA;  &quot;Get a list of which minor modes are enabled in the current buffer.&quot;&#xA;  (let ($list)&#xA;    (mapc (lambda ($mode)&#xA;            (condition-case nil&#xA;                (if (and (symbolp $mode) (symbol-value $mode))&#xA;                    (setq $list (cons $mode $list)))&#xA;              (error nil)))&#xA;          minor-mode-list)&#xA;    (sort $list 'string&amp;lt;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-09-23T16:36:08.207" LastActivityDate="2015-09-23T16:36:08.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16878" PostTypeId="1" AcceptedAnswerId="41004" CreationDate="2015-09-23T19:49:29.557" Score="6" ViewCount="1211" Body="&lt;p&gt;Whenever I start the terminal emacs and there is typeahead (i.e., I start typing before emacs starts), the escape code &lt;code&gt;0;95;0c&lt;/code&gt; gets inserted into the buffer. For example, if I run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sleep 3; emacs -Q test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and type &lt;code&gt;qwerty&lt;/code&gt; while the sleep is happening (&lt;code&gt;test&lt;/code&gt; is a new file), the buffer will open with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;qwerty0;95;0c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;*Messages*&lt;/code&gt; buffer says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;(New file)&#xA;M-[ &amp;gt; is undefined&#xA;Making completion list...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;$TERM&lt;/code&gt; is &lt;code&gt;xterm-256color&lt;/code&gt; and I am using iTerm2 on OS X 10.10.5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT: If I use Terminal.app instead of iTerm2, I get &lt;code&gt;1;2c&lt;/code&gt; in place of &lt;code&gt;0;95;0c&lt;/code&gt; and it opens a help buffer with &quot;Global bindings starting with M-[&quot;. Not sure what key sequence activates that.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I determine what this escape code is and make it not get inserted into my emacs buffers? &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="118" LastEditDate="2015-09-24T03:57:57.537" LastActivityDate="2018-04-12T23:57:20.613" Title="0;95;0c escape code is inserted with typeahead in terminal emacs" Tags="|terminal-emacs|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16879" PostTypeId="1" AcceptedAnswerId="16881" CreationDate="2015-09-23T20:48:53.733" Score="2" ViewCount="336" Body="&lt;p&gt;I have Git 2.5.3 installed and am using GNU Emacs 24.4.1 on Ubuntu. I just &lt;a href=&quot;http://magit.vc/manual/magit/Installing-from-an-Elpa-archive.html&quot; rel=&quot;nofollow&quot;&gt;installed Magit from MELPA&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(package-initialize)&#xA;(package-refresh-contents)&#xA;(package-install 'magit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I then try to use &lt;code&gt;M-x magit-version RET&lt;/code&gt; to try to make sure it installed properly, Emacs helpfully tells me&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x magit-version [No match]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I just type &lt;code&gt;M-x magit- RET&lt;/code&gt;, I'm presented with a long list of Magit operations like &lt;code&gt;magit-commit&lt;/code&gt;, &lt;code&gt;magit-diff&lt;/code&gt;, etc. Everything seems to be all there except &lt;code&gt;magit-version&lt;/code&gt;. How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastEditorUserId="115" LastEditDate="2015-09-23T21:10:01.563" LastActivityDate="2015-09-23T23:16:50.890" Title="Why isn't magit-version available?" Tags="|magit|autoload|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16880" PostTypeId="1" CreationDate="2015-09-23T21:00:36.240" Score="5" ViewCount="698" Body="&lt;p&gt;When i evaluate some source code blocks using C-c C-c sometimes i might have an error and the system hangs on me . The only way to exit at this point is by quitting emacs. Are there any solutions to this. A simple example using R would be &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Begin_src R&#xA;print (&quot;testing this command&quot;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if I run a C-c C-c in the current &lt;em&gt;R&lt;/em&gt; session it is waiting for me to complete the braces and therefore emacs hangs as it show 'executing R code block ... ' in the mini buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand this is mainly user error, but i would like to not have to interactively test every bit of code and also be able to break out of this as opposed to restarting.&lt;br&gt;&#xA;Any help/ insight will be much appreciated&#xA;Cheers&#xA;Ashok&lt;/p&gt;&#xA;" OwnerUserId="9614" LastEditorUserId="97" LastEditDate="2015-09-23T21:57:19.653" LastActivityDate="2015-09-23T21:57:19.653" Title="Stopping a runaway process using C-c C-c" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16881" PostTypeId="2" ParentId="16879" CreationDate="2015-09-23T21:02:01.947" Score="5" Body="&lt;p&gt;The function &lt;code&gt;magit-version&lt;/code&gt; is not autoloaded in &lt;code&gt;magit.el&lt;/code&gt;. If you look at the source, you will notice that that function definition is not preceded by &lt;code&gt;;;;###autoload&lt;/code&gt; &lt;em&gt;(as of Magit version 20150921.1712)&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you eval &lt;code&gt;magit.el&lt;/code&gt; file, you will see that &lt;code&gt;M-x magit-version&lt;/code&gt; would then be available.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How to get &lt;code&gt;M-x magit-version&lt;/code&gt; working?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There are a couple of ways to do that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Try doing &lt;code&gt;M-x magit-version&lt;/code&gt; only after the &lt;code&gt;magit&lt;/code&gt; package gets loaded. For instance, you can do that after you launch a common magit command like &lt;code&gt;M-x magit-status&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can add the below snippet to your emacs config if you use &lt;code&gt;M-x magit-version&lt;/code&gt; quite frequently before using any other magit command.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(autoload #'magit-version &quot;magit&quot; nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use &lt;code&gt;use-package&lt;/code&gt;, you can add &lt;code&gt;magit-version&lt;/code&gt; to the &lt;a href=&quot;https://github.com/jwiegley/use-package#the-basics&quot; rel=&quot;nofollow&quot;&gt;list of commands after the &lt;code&gt;:commands&lt;/code&gt; key&lt;/a&gt; of &lt;code&gt;(use-package magit ..)&lt;/code&gt; instead of the above &lt;code&gt;autoload&lt;/code&gt; statement (&lt;em&gt;as &lt;code&gt;use-package&lt;/code&gt; does the same thing under the hood&lt;/em&gt;). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Or you can open an issue on &lt;code&gt;magit&lt;/code&gt; github asking the developer if he sees fit autoloading this function.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Check out the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Autoload&lt;/strong&gt;&lt;/a&gt; chapter in Elisp Manual to learn more about autoloading.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="2093" LastEditDate="2015-09-23T23:16:50.890" LastActivityDate="2015-09-23T23:16:50.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16882" PostTypeId="1" AcceptedAnswerId="20469" CreationDate="2015-09-23T21:14:47.950" Score="2" ViewCount="146" Body="&lt;p&gt;I have been using ESC-&amp;lt; or Alt-&amp;lt; to jump to the beginning of the file. After I added ggtags for source navigation, normally it works. But after I press Alt-. to find the declaration/definition of some method/class/variable, &#xA; pressing ESC-&amp;lt; or Alt-&amp;lt; will instead navigate me back to the previous point from which I pressed Alt-. to navigate to the method or class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can still use Alt-g g 1 to go to the beginning of the file. But is there a way to still use ESC-&amp;lt; to go the beginning and assign different binding for ggtags to return to previous position?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sujan&lt;/p&gt;&#xA;" OwnerUserId="8698" LastActivityDate="2016-02-21T08:40:30.057" Title="ESC &lt; does not work when using ggtags to navigate source files" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16883" PostTypeId="2" ParentId="16640" CreationDate="2015-09-23T22:10:10.153" Score="33" Body="&lt;p&gt;You can look for the table by name, and use &lt;code&gt;org-table-export&lt;/code&gt; to export it.  You can put the function in a file, load it, and batch export.  Something like this maybe:&lt;/p&gt;&#xA;&lt;p&gt;setup.el:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;&#xA;(defun my-tbl-export (name)&#xA;  &amp;quot;Search for table named `NAME` and export.&amp;quot;&#xA;  (interactive &amp;quot;s&amp;quot;)&#xA;  (outline-show-all)&#xA;  (let ((case-fold-search t))&#xA;    (if (search-forward-regexp (concat &amp;quot;#\\+TBLNAME: +&amp;quot; name) nil t)&#xA;    (progn&#xA;      (next-line)&#xA;      (org-table-export (format &amp;quot;%s.csv&amp;quot; name) &amp;quot;orgtbl-to-csv&amp;quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then with your example file, you can batch export like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --batch foo.org -l setup.el --eval '(my-tbl-export &amp;quot;first-table&amp;quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;My search for the table is a bit crude, but it works.&lt;/p&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="8406" LastEditDate="2023-12-07T13:13:09.097" LastActivityDate="2023-12-07T13:13:09.097" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16884" PostTypeId="2" ParentId="16847" CreationDate="2015-09-23T22:25:58.553" Score="1" Body="&lt;p&gt;After some investigation it seems like the condition for being able to evaluate the code block by pressing &lt;kbd&gt;C-c C-c&lt;/kbd&gt; is that a function with the name &lt;code&gt;org-babel-execute:&amp;lt;type&amp;gt;&lt;/code&gt; where &lt;code&gt;&amp;lt;type&amp;gt;&lt;/code&gt; is the mode / language of the source block, be defined, while executing Babel source block during exporting will also look into the contents of &lt;code&gt;org-babel-load-languages&lt;/code&gt; to decide whether to execute it. This is apart from the header arguments, which instruct Babel to take certain action during export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the OP's case, evaluation via &lt;kbd&gt;C-c C-c&lt;/kbd&gt; works whether the header arguments specify language &lt;code&gt;elisp&lt;/code&gt; or &lt;code&gt;emacs-lisp&lt;/code&gt;, but evaluation via export only works if the header arguments specify language &lt;code&gt;emacs-lisp&lt;/code&gt;, which alone matches the language specified in &lt;code&gt;org-babel-load-languages&lt;/code&gt;.  &lt;code&gt;elisp&lt;/code&gt; is not recognized as a valid language for export purposes in &lt;code&gt;org-babel-load-languages&lt;/code&gt;; specifying it there results in an error.  &lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="596" LastEditDate="2015-09-24T07:40:03.397" LastActivityDate="2015-09-24T07:40:03.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16885" PostTypeId="2" ParentId="16859" CreationDate="2015-09-23T22:41:58.340" Score="3" Body="&lt;p&gt;To supplement &lt;a href=&quot;https://emacs.stackexchange.com/users/563/wvxvw&quot;&gt;wvxvw&lt;/a&gt;'s answer, you can also do this interactively by copying with &lt;code&gt;org-table-copy-region&lt;/code&gt; and pasting with &lt;code&gt;org-paste-rectangle&lt;/code&gt;.  I bind those two like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; table copy paste (C-c M-w is bound to `org-copy' by default)&#xA;(org-defkey org-mode-map (kbd &quot;C-c M-w&quot;) 'org-table-copy-region)&#xA;(org-defkey org-mode-map (kbd &quot;C-c M-y&quot;) 'org-table-paste-rectangle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-09-24T00:13:29.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16887" PostTypeId="1" CreationDate="2015-09-24T01:34:01.637" Score="0" ViewCount="148" Body="&lt;p&gt;Can someone help me with this snippet? I found it &lt;a href=&quot;https://gist.github.com/kiwanami/af52d0ca067ebde2b9f5&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: jsdoc comment&#xA;# key: doc&#xA;# --&#xA;/**&#xA;* $0&#xA;`(save-excursion &#xA;(let* ((pos-fun (re-search-forward &quot;\\&amp;lt;function\\s-*(\\([^)]*\\))&quot;))&#xA;        (argstr (and pos-fun (match-string 1)))&#xA;        (args (and pos-fun (split-string argstr &quot;,\\s-*&quot;))))&#xA;    (loop with params = nil&#xA;        for arg in args&#xA;        for nump = (string-match &quot;s$&quot; arg)&#xA;        for param = (if nump (format &quot; * @param {[]} %s - &quot; arg)&#xA;                        (format &quot; * @param {} %s - &quot; arg))&#xA;        do&#xA;        (if (&amp;lt; 0 (length arg))&#xA;            (push param params))&#xA;        finally return&#xA;        (mapconcat 'identity (reverse (cons &quot; * @return &quot; params)) &quot;\n&quot;))))`&#xA;*/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it creates this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA;* &#xA;[yas] elisp error: Search failed: &quot;\\&amp;lt;function\\s-*(\\([^)]*\\))&quot;&#xA;*/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm suspecting there's something wrong with the regex&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this snippet suppose to do? It creates js-doc comments as function headers in js2-mode. So code like &lt;code&gt;function foo(a, bs, c)&lt;/code&gt; should turn into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA;* @param {} a - &#xA;* @param {[]} bs - &#xA;* @param {} c - &#xA;* @return &#xA;*/&#xA;function foo(port, methods, host) {&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="8992" LastEditDate="2015-09-24T02:14:49.477" LastActivityDate="2015-09-24T02:14:49.477" Title="Need help with a snippet" Tags="|regular-expressions|yasnippet|spacemacs|js2-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16888" PostTypeId="2" ParentId="13451" CreationDate="2015-09-24T02:45:13.813" Score="5" Body="&#xA;&lt;h3&gt;Update (Oct 12 2015)&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Below &lt;code&gt;calc-yank&lt;/code&gt; implementation is now &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ec0d4d24fd11b5040de9f7657b486c3b1e743071&quot; rel=&quot;nofollow noreferrer&quot;&gt;added to emacs trunk&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;It will be available in the next stable emacs release.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;I reviewed the original definition of &lt;code&gt;calc-yank&lt;/code&gt; and the good thing is that it does not have any argument. So I added my own argument, &lt;code&gt;radix&lt;/code&gt;, and slightly modified how the let-bound var &lt;code&gt;thing&lt;/code&gt; is derived.&lt;/p&gt;&#xA;&lt;p&gt;By default, the below modified function will work the exact same as the original &lt;code&gt;calc-yank&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;But if you want to yank the value in the kill ring as a hexadecimal number, you will be able to now do so now by doing &lt;code&gt;C-u 6 C-y&lt;/code&gt; or &lt;code&gt;C-6 C-y&lt;/code&gt; or &lt;code&gt;M-6 C-y&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To test it, copy &lt;code&gt;1000&lt;/code&gt; to the kill-ring.&lt;/p&gt;&#xA;&lt;p&gt;Then,&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-2 C-y&lt;/code&gt; will paste &lt;code&gt;8&lt;/code&gt; (&lt;code&gt;2#1000&lt;/code&gt;),&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-8 C-y&lt;/code&gt; will paste &lt;code&gt;512&lt;/code&gt; (&lt;code&gt;8#1000&lt;/code&gt;),&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-0 C-y&lt;/code&gt; will paste &lt;code&gt;1000&lt;/code&gt; (&lt;code&gt;10#1000&lt;/code&gt;),&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-6 C-y&lt;/code&gt; will paste &lt;code&gt;4096&lt;/code&gt; (&lt;code&gt;16#1000&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;.. and &lt;code&gt;C-y&lt;/code&gt; will paste &lt;code&gt;1000&lt;/code&gt; (&lt;code&gt;1000&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun calc-yank (radix)&#xA;          &amp;quot;Yank a value into the Calculator buffer.&#xA;&#xA;Valid numeric prefixes for RADIX: 0, 2, 6, 8&#xA;No radix notation is prepended for any other numeric prefix.&#xA;&#xA;If RADIX is 2, prepend \&amp;quot;2#\&amp;quot;  - Binary.&#xA;If RADIX is 8, prepend \&amp;quot;8#\&amp;quot;  - Octal.&#xA;If RADIX is 0, prepend \&amp;quot;10#\&amp;quot; - Decimal.&#xA;If RADIX is 6, prepend \&amp;quot;16#\&amp;quot; - Hexadecimal.&#xA;&#xA;If RADIX is a non-nil list (created using \\[universal-argument]), the user&#xA;will be prompted to enter the radix in the minibuffer.&#xA;&#xA;If RADIX is nil or if the yanked string already has a calc radix prefix, the&#xA;yanked string will be passed on directly to the Calculator buffer without any&#xA;alteration.&amp;quot;&#xA;          (interactive &amp;quot;P&amp;quot;)&#xA;          (calc-wrapper&#xA;           (calc-pop-push-record-list&#xA;            0 &amp;quot;yank&amp;quot;&#xA;            (let* (radix-num&#xA;                   radix-notation&#xA;                   valid-num-regexp&#xA;                   (thing-raw&#xA;                    (if (fboundp 'current-kill)&#xA;                        (current-kill 0 t)&#xA;                      (car kill-ring-yank-pointer)))&#xA;                   (thing&#xA;                    (if (or (null radix)&#xA;                            ;; Match examples: -2#10, 10\n(10#10,01)&#xA;                            (string-match-p &amp;quot;^[-(]*[0-9]\\{1,2\\}#&amp;quot; thing-raw))&#xA;                        thing-raw&#xA;                      (progn&#xA;                        (if (listp radix)&#xA;                            (progn&#xA;                              (setq radix-num&#xA;                                    (read-number&#xA;                                     &amp;quot;Set radix for yanked content (2-36): &amp;quot;))&#xA;                              (when (not (and (integerp radix-num)&#xA;                                              (&amp;lt;= 2 radix-num)&#xA;                                              (&amp;gt;= 36 radix-num)))&#xA;                                (error (concat &amp;quot;The radix has to be an &amp;quot;&#xA;                                               &amp;quot;integer between 2 and 36.&amp;quot;))))&#xA;                          (setq radix-num&#xA;                                (cond ((eq radix 2) 2)&#xA;                                      ((eq radix 8) 8)&#xA;                                      ((eq radix 0) 10)&#xA;                                      ((eq radix 6) 16)&#xA;                                      (t (message&#xA;                                          (concat &amp;quot;No radix prepended &amp;quot;&#xA;                                                  &amp;quot;for invalid *numeric* &amp;quot;&#xA;                                                  &amp;quot;prefix %0d.&amp;quot;)&#xA;                                          radix)&#xA;                                         nil))))&#xA;                        (if radix-num&#xA;                            (progn&#xA;                              (setq radix-notation&#xA;                                    (concat (number-to-string radix-num) &amp;quot;#&amp;quot;))&#xA;                              (setq valid-num-regexp&#xA;                                    (cond&#xA;                                     ;; radix 2 to 10&#xA;                                     ((and (&amp;lt;= 2 radix-num)&#xA;                                           (&amp;gt;= 10 radix-num))&#xA;                                      (concat &amp;quot;[0-&amp;quot;&#xA;                                              (number-to-string (1- radix-num))&#xA;                                              &amp;quot;]+&amp;quot;))&#xA;                                     ;; radix 11&#xA;                                     ((= 11 radix-num) &amp;quot;[0-9aA]+&amp;quot;)&#xA;                                     ;; radix 12+&#xA;                                     (t&#xA;                                      (concat &amp;quot;[0-9&amp;quot;&#xA;                                              &amp;quot;a-&amp;quot; (format &amp;quot;%c&amp;quot; (+ 86 radix-num))&#xA;                                              &amp;quot;A-&amp;quot; (format &amp;quot;%c&amp;quot; (+ 54 radix-num))&#xA;                                              &amp;quot;]+&amp;quot;))))&#xA;                              ;; Ensure that the radix-notation is prefixed&#xA;                              ;; correctly even for multi-line yanks like below,&#xA;                              ;;   111&#xA;                              ;;   1111&#xA;                              (replace-regexp-in-string&#xA;                               valid-num-regexp&#xA;                               (concat radix-notation &amp;quot;\\&amp;amp;&amp;quot;)&#xA;                               thing-raw))&#xA;                          thing-raw)))))&#xA;              (if (eq (car-safe calc-last-kill) thing)&#xA;                  (cdr calc-last-kill)&#xA;                (if (stringp thing)&#xA;                    (let ((val (math-read-exprs (calc-clean-newlines thing))))&#xA;                      (if (eq (car-safe val) 'error)&#xA;                          (progn&#xA;                            (setq val (math-read-exprs thing))&#xA;                            (if (eq (car-safe val) 'error)&#xA;                                (error &amp;quot;Bad format in yanked data&amp;quot;)&#xA;                              val))&#xA;                        val))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-12T13:34:42.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16889" PostTypeId="1" AcceptedAnswerId="42237" CreationDate="2015-09-24T03:01:05.907" Score="8" ViewCount="4180" Body="&lt;p&gt;I have a test org-mode file as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: ':nil *:t -:nil ::nil &amp;lt;:nil H:3 \n:nil ^:{} arch:headline&#xA;#+OPTIONS: author:nil c:nil creator:nil d:(not &quot;LOGBOOK&quot;) date:t e:t&#xA;#+OPTIONS: email:nil f:t inline:t num:t p:nil pri:nil prop:nil stat:t&#xA;#+OPTIONS: tags:t tasks:t tex:t timestamp:t title:t toc:t todo:t |:t&#xA;#+LANGUAGE: en&#xA;#+SELECT_TAGS: export&#xA;#+EXCLUDE_TAGS: noexport&#xA;#+CREATOR: Emacs 25.0.50.1 (Org mode 8.3.1)&#xA;&#xA;* Indent and Newline Test&#xA;&#xA;  First line.&#xA;&#xA;  Second line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export it to pdf with `C-c C-e l p', it generate a pdf file looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;First line.&#xA;    Second line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what I expect is not indent on the second line and a newline between these two lines.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;First line.&#xA;&#xA;Second line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would anyone show me how could I achieve that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ugly solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After read the post mentioned by @wvxvw , I temporarily get a `very ugly' solution for it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to code my content in LaTeX syntax as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;First line.&#xA;\\&#xA;\\&#xA;Second line. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then it exports as what I expected. (But the org file looks really ugly)&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="4102" LastEditDate="2015-09-24T22:19:12.770" LastActivityDate="2018-06-27T02:22:49.960" Title="How to control newline and indent when export to LaTeX from org-mode file?" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16890" PostTypeId="1" AcceptedAnswerId="16899" CreationDate="2015-09-24T03:47:55.203" Score="4" ViewCount="131" Body="&lt;p&gt;Using benchmark-init, I see that helm files (helm-elisp, helm-mode, helm, etc.) are being required, but I don't have &quot;(require 'helm)&quot; or &quot;(require 'helm-config)&quot; or &quot;(helm-mode 1)&quot; anywhere in my init file. I'm using use-package, and all helm-related packages are deferred, including helm. Is there some direct way I can figure out where helm is being required from? I also want to find out where semantic is being required from.&lt;/p&gt;&#xA;" OwnerUserId="5278" LastEditorUserId="105" LastEditDate="2016-06-22T20:22:11.633" LastActivityDate="2016-06-22T20:22:11.633" Title="How to Find Out Where a File is Being Required?" Tags="|helm|require|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16891" PostTypeId="1" AcceptedAnswerId="16895" CreationDate="2015-09-24T04:38:16.423" Score="2" ViewCount="431" Body="&lt;p&gt;In aquamacs, the confirmation to delete files from dired is a y or n, and immediately on pressing one of them the file is deleted (no RET required after the y or n).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs, the confirmation is yes or no, so that I need to type the full yes or no plus RET afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to change emacs so that it behaves like aquamacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible at all?  I did a google search plus checked M-x customize-group RET dired RET and couldn't find anything that helped (I found stuff to get rid of the confirmation altogether, but that's not what I am after).&lt;/p&gt;&#xA;" OwnerUserId="9416" LastActivityDate="2015-09-24T06:20:12.737" Title="Changing confirmation style when deleting files in dired" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16892" PostTypeId="2" ParentId="16891" CreationDate="2015-09-24T04:46:18.397" Score="2" Body="&lt;p&gt;Here is the &lt;em&gt;dirty&lt;/em&gt; and &lt;em&gt;unsafe&lt;/em&gt; hack, which is used widely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'yes-or-no-p #'y-or-n-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-09-24T04:46:18.397" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16893" PostTypeId="2" ParentId="2445" CreationDate="2015-09-24T05:59:25.920" Score="0" Body="&lt;p&gt;The solution (accepted answer) by Drew of using Dired+ didn't work for me (it was messing with my dired buffers so that only folders/file names appeared, but not all the other info normally in dired buffer. It could be to do with one of my customisations). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then found another that worked way using &lt;a href=&quot;http://www.northbound-train.com/emacs/dired-single.el&quot; rel=&quot;nofollow&quot;&gt;dired-simple.el&lt;/a&gt; . After downloading the linked file and placing it in your load path, include this in your init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      (require 'dired-single)&#xA;&#xA;      (defun my-dired-init ()&#xA;        &quot;Bunch of stuff to run for dired, either immediately or when it's&#xA;         loaded.&quot;&#xA;        ;; &amp;lt;add other stuff here&amp;gt;&#xA;        (define-key dired-mode-map [return] 'dired-single-buffer)&#xA;        (define-key dired-mode-map [mouse-1] 'dired-single-buffer-mouse) &#xA;        (define-key dired-mode-map &quot;^&quot;&#xA;        (function&#xA;         (lambda nil (interactive) (dired-single-buffer &quot;..&quot;)))))&#xA;&#xA;      ;; if dired's already loaded, then the keymap will be bound&#xA;      (if (boundp 'dired-mode-map)&#xA;        ;; we're good to go; just add our bindings&#xA;        (my-dired-init)&#xA;        ;; it's not loaded yet, so add our bindings to the load-hook&#xA;        (add-hook 'dired-load-hook 'my-dired-init))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9416" LastActivityDate="2015-09-24T05:59:25.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16894" PostTypeId="2" ParentId="16783" CreationDate="2015-09-24T06:07:21.647" Score="1" Body="&lt;p&gt;The regular expression &lt;code&gt;b*&lt;/code&gt; matches the empty string, thus the search for matching entries in the bib file won't make any progress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have fixed that in emacs' master branch so it will be in 25.1. With that, you get an error when you try searching for bib entries with a regular expression which matches the empty string.&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2015-09-24T06:07:21.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16895" PostTypeId="2" ParentId="16891" CreationDate="2015-09-24T06:20:12.737" Score="5" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq dired-deletion-confirmer #'y-or-n-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;em&gt;recursive directory deletion&lt;/em&gt; hard-codes a &lt;code&gt;yes-or-no-p&lt;/code&gt; because it's a more dangerous action.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-09-24T06:20:12.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16896" PostTypeId="2" ParentId="5560" CreationDate="2015-09-24T06:27:05.800" Score="1" Body="&lt;p&gt;I created a more generic approach, which allows you to have deeper nesting. For example, I have a rich tree of notes and some folders have tasks.org file in it. This code will collect all of the fly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-org-agenda-files ()&#xA;  (require 'f)&#xA;  (require 's)&#xA;&#xA;  (setq org-agenda-files&#xA;    (f-entries org-directory&#xA;               (lambda (filename)&#xA;                 (s-ends-with-p &quot;/tasks.org&quot; filename))&#xA;               t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9617" LastActivityDate="2015-09-24T06:27:05.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16897" PostTypeId="1" CreationDate="2015-09-24T07:29:18.253" Score="1" ViewCount="807" Body="&lt;p&gt;There are many nice &lt;a href=&quot;https://vimeo.com/1168225?pg=embed&amp;amp;sec=1168225&quot; rel=&quot;nofollow noreferrer&quot;&gt;column editing&lt;/a&gt; features in CUA mode. After hitting &lt;kbd&gt;Ctrl+RETURN&lt;/kbd&gt;, binded to &lt;code&gt;cua-set-rectangle-mark&lt;/code&gt;, you get some help in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/A2mYq.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/A2mYq.jpg&quot; alt=&quot;Minibuffer shows several M- shortcuts&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't find the shortcut to cut/kill rectangle text, e.g.: I want to get rid of all &lt;strong&gt;hardly&lt;/strong&gt; stuff:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/z9RmN.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/z9RmN.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2015-10-08T15:16:22.210" Title="Kill rectangle with cua-mode support" Tags="|rectangle|cua-mode|kill-text|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16898" PostTypeId="2" ParentId="16897" CreationDate="2015-09-24T07:29:18.253" Score="1" Body="&lt;p&gt;This one is pretty straightforward, &lt;kbd&gt;M-k&lt;/kbd&gt; does it.&#xA;It is not listed in the mini-buffer help, and asking for help with &lt;kbd&gt;C-?&lt;/kbd&gt; does not show more help.&#xA;It can be found on &lt;a href=&quot;http://trey-jackson.blogspot.com.es/2008/10/emacs-tip-26-cua-mode-specifically.html&quot; rel=&quot;nofollow&quot;&gt;this link on rectangle editing with cua mode&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly, I can not find those comments on current &lt;code&gt;cua-rect.el&lt;/code&gt; code.&lt;br&gt;&#xA;But it is there: &lt;code&gt;(cua--rect-M/H-key ?k 'cua-cut-rectangle-as-text)&lt;/code&gt;.&lt;br&gt;&#xA;As long as it took me some time to find this key binding, I thought it could be useful to others.&lt;/p&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="6957" LastEditDate="2015-10-08T15:16:22.210" LastActivityDate="2015-10-08T15:16:22.210" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16899" PostTypeId="2" ParentId="16890" CreationDate="2015-09-24T07:52:21.373" Score="4" Body="&lt;p&gt;I don't know of any standard way of doing this. However, you can fairly simply advice &lt;code&gt;require&lt;/code&gt; so that it keeps trace of who calls it.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar my/require-tree nil)&#xA;(defun require--advice (orig-fun feature &amp;amp;rest args)&#xA;  (setq my/require-tree&#xA;    (append my/require-tree&#xA;        (list (let ((my/require-tree (list feature)))&#xA;            (apply orig-fun feature args)&#xA;            my/require-tree)))))&#xA;(advice-add 'require :around 'require--advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you put this at the beginning of your init file, you should at the end get something like this in the &lt;code&gt;my/require-tree&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;((org&#xA;  (calendar&#xA;   (cal-menu&#xA;    (calendar)))&#xA;  (find-func)&#xA;  (format-spec)&#xA;  (org-macs)&#xA;  (org-compat&#xA;   (org-macs))&#xA;  (ob-emacs-lisp&#xA;   (ob&#xA;    (org-macs)&#xA;    (org-compat)&#xA;    (ob-eval&#xA;     (org-macs))&#xA;    (ob-core&#xA;     (ob-eval)&#xA;     (org-macs)&#xA;     (org-compat))&#xA;    (ob-comint&#xA;     (ob-core)&#xA;     (org-compat)&#xA;     (comint))&#xA;    (ob-exp&#xA;     (ob-core))))&#xA;  ;;...&#xA;  )&#xA; (tramp&#xA;  ;;...&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; You can use &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt;&lt;code&gt;my/require-tree&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; to see the contents of the variable in a nicely formatted way.&lt;/p&gt;&#xA;" OwnerUserId="221" LastActivityDate="2015-09-24T07:52:21.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16901" PostTypeId="2" ParentId="16840" CreationDate="2015-09-24T08:56:49.700" Score="5" Body="&lt;p&gt;While @tarsius's answer gives the canonical answer, since the OP asks for a specific case and I have faced the same issue, I thought I share my resolution.  I use the following face definitions to make the diffs more readable in magit.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-faces&#xA; ;; other faces&#xA; '(magit-diff-added ((((type tty)) (:foreground &quot;green&quot;))))&#xA; '(magit-diff-added-highlight ((((type tty)) (:foreground &quot;LimeGreen&quot;))))&#xA; '(magit-diff-context-highlight ((((type tty)) (:foreground &quot;default&quot;))))&#xA; '(magit-diff-file-heading ((((type tty)) nil)))&#xA; '(magit-diff-removed ((((type tty)) (:foreground &quot;red&quot;))))&#xA; '(magit-diff-removed-highlight ((((type tty)) (:foreground &quot;IndianRed&quot;))))&#xA; '(magit-section-highlight ((((type tty)) nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Besides choosing more suitable colours, I also made sure I do not lose the highlighting feature offered by magit.  Please note though, these colours are most suitable when your terminal suports 256 colours (set &lt;code&gt;TERM=xterm-256color&lt;/code&gt;).  Although quick testing tells me it is probably still okay with old 8 colour terminals.  There is a caveat, I use a dark background, &lt;em&gt;à la&lt;/em&gt; &lt;code&gt;xterm -rv&lt;/code&gt;, so all the colours are tuned for a dark background.  Here is a screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/CtCUn.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CtCUn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2093" LastActivityDate="2015-09-24T08:56:49.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16902" PostTypeId="2" ParentId="16897" CreationDate="2015-09-24T09:54:11.067" Score="3" Body="&lt;p&gt;CUA's help on rectangles (and other things) is slightly hidden away.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-library&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;cua-base&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Search the commentary for the section on &quot;CUA rectangle support&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Which is not to suggest that library commentaries in general are &quot;hidden&quot; -- they're a crucial aspect of Emacs' documentation which all users should know how to access. It's just that in this particular case &lt;code&gt;cua-base&lt;/code&gt; is not necessarily the library you'd think to look in, given that the code in question lives in &lt;code&gt;cua-rect&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe in the circumstances it's useful to quote it here. This is from Emacs 24.5.1:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;CUA rectangle support&#xA;---------------------&#xA;Emacs's normal rectangle support is based on interpreting the region&#xA;between the mark and point as a &quot;virtual rectangle&quot;, and using a&#xA;completely separate set of &quot;rectangle commands&quot; [C-x r ...] on the&#xA;region to copy, kill, fill a.s.o. the virtual rectangle.&#xA;&#xA;cua-mode's superior rectangle support uses a true visual&#xA;representation of the selected rectangle, i.e. it highlights the&#xA;actual part of the buffer that is currently selected as part of the&#xA;rectangle.  Unlike emacs' traditional rectangle commands, the&#xA;selected rectangle always as straight left and right edges, even&#xA;when those are in the middle of a TAB character or beyond the end&#xA;of the current line.  And it does this without actually modifying&#xA;the buffer contents (it uses display overlays to visualize the&#xA;virtual dimensions of the rectangle).&#xA;&#xA;This means that cua-mode's rectangles are not limited to the actual&#xA;contents of the buffer, so if the cursor is currently at the end of a&#xA;short line, you can still extend the rectangle to include more columns&#xA;of longer lines in the same rectangle.  And you can also have the&#xA;left edge of a rectangle start in the middle of a TAB character.&#xA;Sounds strange? Try it!&#xA;&#xA;To start a rectangle, use [C-return] and extend it using the normal&#xA;movement keys (up, down, left, right, home, end, C-home,&#xA;C-end). Once the rectangle has the desired size, you can cut or&#xA;copy it using C-x and C-c (or C-w and M-w), and you can&#xA;subsequently insert it - as a rectangle - using C-v (or C-y).  So&#xA;the only new command you need to know to work with cua-mode&#xA;rectangles is C-return!&#xA;&#xA;Normally, when you paste a rectangle using C-v (C-y), each line of&#xA;the rectangle is inserted into the existing lines in the buffer.&#xA;If overwrite-mode is active when you paste a rectangle, it is&#xA;inserted as normal (multi-line) text.&#xA;&#xA;If you prefer the traditional rectangle marking (i.e. don't want&#xA;straight edges), [M-p] toggles this for the current rectangle,&#xA;or you can customize cua-virtual-rectangle-edges.&#xA;&#xA;And there's more: If you want to extend or reduce the size of the&#xA;rectangle in one of the other corners of the rectangle, just use&#xA;[return] to move the cursor to the &quot;next&quot; corner.  Or you can use&#xA;the [M-up], [M-down], [M-left], and [M-right] keys to move the&#xA;entire rectangle overlay (but not the contents) in the given&#xA;direction.&#xA;&#xA;[C-return] cancels the rectangle&#xA;[C-space] activates the region bounded by the rectangle&#xA;&#xA;If you type a normal (self-inserting) character when the rectangle is&#xA;active, the character is inserted on the &quot;current side&quot; of every line&#xA;of the rectangle.  The &quot;current side&quot; is the side on which the cursor&#xA;is currently located. If the rectangle is only 1 column wide,&#xA;insertion will be performed to the left when the cursor is at the&#xA;bottom of the rectangle.  So, for example, to comment out an entire&#xA;paragraph like this one, just place the cursor on the first character&#xA;of the first line, and enter the following:&#xA;    C-return M-} ; ; &amp;lt;space&amp;gt;  C-return&#xA;&#xA;cua-mode's rectangle support also includes all the normal rectangle&#xA;functions with easy access:&#xA;&#xA;[M-a] aligns all words at the left edge of the rectangle&#xA;[M-b] fills the rectangle with blanks (tabs and spaces)&#xA;[M-c] closes the rectangle by removing all blanks at the left edge&#xA;      of the rectangle&#xA;[M-f] fills the rectangle with a single character (prompt)&#xA;[M-i] increases the first number found on each line of the rectangle&#xA;      by the amount given by the numeric prefix argument (default 1)&#xA;      It recognizes 0x... as hexadecimal numbers&#xA;[M-k] kills the rectangle as normal multi-line text (for paste)&#xA;[M-l] downcases the rectangle&#xA;[M-m] copies the rectangle as normal multi-line text (for paste)&#xA;[M-n] fills each line of the rectangle with increasing numbers using&#xA;      a supplied format string (prompt)&#xA;[M-o] opens the rectangle by moving the highlighted text to the&#xA;      right of the rectangle and filling the rectangle with blanks.&#xA;[M-p] toggles virtual straight rectangle edges&#xA;[M-P] inserts tabs and spaces (padding) to make real straight edges&#xA;[M-q] performs text filling on the rectangle&#xA;[M-r] replaces REGEXP (prompt) by STRING (prompt) in rectangle&#xA;[M-R] reverse the lines in the rectangle&#xA;[M-s] fills each line of the rectangle with the same STRING (prompt)&#xA;[M-t] performs text fill of the rectangle with TEXT (prompt)&#xA;[M-u] upcases the rectangle&#xA;[M-|] runs shell command on rectangle&#xA;[M-'] restricts rectangle to lines with CHAR (prompt) at left column&#xA;[M-/] restricts rectangle to lines matching REGEXP (prompt)&#xA;[C-?] Shows a brief list of the above commands.&#xA;&#xA;[M-C-up] and [M-C-down] scrolls the lines INSIDE the rectangle up&#xA;and down; lines scrolled outside the top or bottom of the rectangle&#xA;are lost, but can be recovered using [C-z].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-24T10:03:18.680" LastActivityDate="2015-09-24T10:03:18.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16903" PostTypeId="1" CreationDate="2015-09-24T10:10:10.170" Score="4" ViewCount="713" Body="&lt;p&gt;I usually have my emacs frame something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|             |             |&#xA;| &amp;lt;window 1&amp;gt;  | &amp;lt;window 2&amp;gt;  |&#xA;|             |             |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open &lt;code&gt;neotree&lt;/code&gt;, it then looks like this (&lt;code&gt;N&lt;/code&gt; representing the &lt;code&gt;neotree&lt;/code&gt; window):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |             |         |&#xA;| N |     W1      |   W2    |&#xA;|   |             |         |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, when I close &lt;code&gt;neotree&lt;/code&gt;, the windows look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|                 |         |&#xA;|         W1      |   W2    |&#xA;|                 |         |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is aesthetically displeasing and brings window 2's width below 80 characters, so code lines wrap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can make &lt;code&gt;neotree-toggle&lt;/code&gt; reset the window sizes to their values in the first diagram?&lt;/p&gt;&#xA;" OwnerUserId="5347" LastActivityDate="2023-12-13T05:07:16.060" Title="Neotree window permanently resizes other windows" Tags="|window|window-splitting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16904" PostTypeId="2" ParentId="16903" CreationDate="2015-09-24T10:59:48.167" Score="0" Body="&lt;p&gt;Very strange. I don't have this problem.&#xA;Here my conf:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'neotree &quot;neotree&quot; &quot;&quot; t) &#xA;(setq neo-window-width 50) &#xA;(setq neo-persist-show nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use emacs 25 with the latest neotree.el&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-09-24T10:59:48.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16905" PostTypeId="1" CreationDate="2015-09-24T12:30:14.957" Score="1" ViewCount="284" Body="&lt;p&gt;I am running a command that produces a few thousand lines of output,&#xA;which I would like to store in a buffer. I want to run it in the&#xA;background and be alerted when it is finished. The problem is that it&#xA;typically takes of order 10 seconds to report back, when the command&#xA;itself takes a second or less to run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a trivial example. I set up my command to produce 2000 lines&#xA;of output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq bjm-cmd &quot;find /Users/bjm/ -ls | head -2000&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then use following to save the output to a string and write to a&#xA;buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (message &quot;shell-command-to-string&quot;)&#xA;  (message (format-time-string &quot;%c&quot; (current-time)))&#xA;  (with-temp-buffer (insert-string&#xA;                     (shell-command-to-string bjm-cmd)))&#xA;  (message (format-time-string &quot;%c&quot; (current-time))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works effectively instantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if I instead run the command asynchronously:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bjm-test-sentinel (process event)&#xA;  (if (string= event &quot;finished\n&quot;)&#xA;      (message &quot;finished&quot;)&#xA;    (message &quot;failed&quot;))&#xA;  (message (format-time-string &quot;%c&quot; (current-time))))&#xA;&#xA;(progn&#xA;  (message &quot;start-process-shell-command&quot;)&#xA;  (message (format-time-string &quot;%c&quot; (current-time)))&#xA;  (setq bjm-proc (start-process-shell-command &quot;dummy&quot; &quot;dummy&quot; bjm-cmd))&#xA;  (set-process-sentinel bjm-proc #'bjm-test-sentinel))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it takes about 15 seconds to complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I presume this is because the sentinel is parsing the output in some&#xA;way - right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My work around is to redirect the output of my command to a file and&#xA;then read the file into the buffer. i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq bjm-cmd &quot;find /Users/bjm/ -ls | head -2000 &amp;gt; /tmp/junk&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This runs quickly, but feels like a bit of a hack - is there a better&#xA;way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The context for this is that I am working on a package to call OS X&#xA;spotlight using the ivy and counsel libraries, but I think the&#xA;question is a generic one.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="105" LastEditDate="2016-06-22T20:21:52.100" LastActivityDate="2016-06-22T20:21:52.100" Title="How to avoid slow response by set-process-sentinel to process that produces many lines of output" Tags="|subprocess|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16906" PostTypeId="2" ParentId="16841" CreationDate="2015-09-24T12:35:06.533" Score="0" Body="&lt;p&gt;After a lot of research I found out that emacs + gpg4win does not work.&#xA;On one windows machine however I had working configuration. But it used cygwin's gnupg. So the solution is to install and use in PATH cygwin's gpg (Utils -&gt; gnupg).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To determine in emacs that you have good gpg use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sh-4.3$ which gpg&#xA;/usr/bin/gpg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More details on why it does not work. Following command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(start-process &quot;epg&quot; &quot;buffer-name&quot; &quot;gpg&quot; &quot;--no-tty&quot; &quot;--status-fd&quot; &quot;1&quot; &quot;--yes&quot; &quot;--command-fd&quot; &quot;0&quot; &quot;--output&quot; &quot;/cygdrive/c/Users/username/AppData/Local/Temp/epg-output4840pv2&quot; &quot;--symmetric&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gpg: can't create `/cygdrive/c/Users/pusheax/AppData/Local/Temp/epg-output4840pv2': No such file or directory&#xA;&#xA;[GNUPG:] FAILURE symencrypt 33587281&#xA;&#xA;gpg: symmetric encryption of `[stdin]' failed: No such file or directory&#xA;&#xA;&#xA;Process epg exited abnormally with code 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Following command with windows path works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(start-process &quot;epg&quot; &quot;pgpout&quot; &quot;gpg&quot; &quot;--no-tty&quot; &quot;--status-fd&quot; &quot;1&quot; &quot;--yes&quot; &quot;--command-fd&quot; &quot;0&quot; &quot;--output&quot; &quot;d:/epg-output&quot; &quot;--symmetric&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9596" LastEditorUserId="9596" LastEditDate="2015-09-24T12:45:07.793" LastActivityDate="2015-09-24T12:45:07.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16907" PostTypeId="1" CreationDate="2015-09-24T16:36:35.260" Score="14" ViewCount="4085" Body="&lt;p&gt;I am a beginner in org-mode (and Emacs, for that matter), but I thought that org-mode would be a good place/format to store my contacts. One thing I like to do is to add birthdays to contacts. I found &lt;a href=&quot;http://orgmode.org/worg/org-contrib/index.html&quot;&gt;org-contacts.el&lt;/a&gt;, which appears to have what I want: I add a person in contacts.org and add a birthday property.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Ficitive Person&#xA;:PROPERTIES:&#xA;:EMAIL: fp@example.com&#xA;:BIRTHDAY: 2000-09-24&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now in another file (agenda.org), I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Birthday&#xA;%%(org-contacts-anniversaries)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;code&gt;C-c a a&lt;/code&gt; (&lt;code&gt;M-x org-agenda-list&lt;/code&gt;), I see their birthday and how old they are, cool!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for some people I know their birthday, but not their age. Still I'd like to see that it is their birthday on my calendar, but when I enter a birthday in any other format, I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bad sexp at line 24 in [...]/org/agenda.org: (org-contacts-anniversaries)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a format for inserting birthdays without knowing the year?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like I said, I am an emacs noob, so if there is another better way than org-contacts (or org-mode, for that matter) I am happy to learn that way.&lt;/p&gt;&#xA;" OwnerUserId="9052" LastActivityDate="2016-08-19T13:10:56.540" Title="Birthday in org-contacts" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16908" PostTypeId="2" ParentId="16858" CreationDate="2015-09-24T23:06:57.300" Score="2" Body="&lt;p&gt;You could use as many &quot;configurations&quot; as you would like by wrapping your emacs commad to a script that would use different emacs directories (say .emacs.d.clojure .emacs.d.mathematica and .emacs.d.notes)&#xA;Assuming you are using a Unix type system your emacs incantation would be something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q -l .emacs.d.clojure/init.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another alternative is to use the user option from emacs command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to emphasize that this is not reccommended and very likely to fall in undefined behaviors. As others have pointed out you really should try to reconcile the settings for the different modes you want. Remember that emacs is all about flexibility to the user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you mentioned in your original post you are using an emacs configuration recommende by the book &quot;Clojure for the Brave and True&quot;, which is in the following git repository&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/flyingmachine/emacs-for-clojure&quot; rel=&quot;nofollow&quot;&gt;https://github.com/flyingmachine/emacs-for-clojure&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I skimmed through the code and most if not all the modifications are pretty standard and you should benefit from them on all editing modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please consider merging your configurations and use a single emacs instance&lt;/p&gt;&#xA;" OwnerUserId="8289" LastActivityDate="2015-09-24T23:06:57.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16909" PostTypeId="1" AcceptedAnswerId="16914" CreationDate="2015-09-24T23:07:25.863" Score="3" ViewCount="2521" Body="&lt;p&gt;There are some local file links existed randomly in my org-mode file. most of them are image links, like (file:images/samples.png) along with some other urls. What I want to do is that parse all these links from the file and store them in a lisp list for afterwards use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* headline1&#xA;  [[file:images/sample1.png][description1]]&#xA;* headline2&#xA;  [[file:images/sample2.png][description2]]&#xA;  [[http://www.google.com]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After parsing, a list of all file links should obtained.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list &quot;images/sample1.png&quot; &quot;images/sample1.png&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-09-25T00:44:59.677" LastActivityDate="2015-10-02T16:22:30.000" Title="How can I get all file links in one org-mode file?" Tags="|org-mode|hyperlinks|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16910" PostTypeId="2" ParentId="14935" CreationDate="2015-09-24T23:26:50.363" Score="4" Body="&lt;p&gt;(As previous mentioned in the comments by glucas), a heavyweight approach to comparing regions is provided by the excellent &lt;code&gt;ediff&lt;/code&gt; library:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;ediff-regions-linewise&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ediff-regions-wordwise&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These commands &quot;run Ediff on a pair of regions in specified buffers&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They prompt you first to specify which buffer(s) the regions come from, and then to mark and/or confirm the region to use in each of those buffers in turn, and then finally the ediff session is started to compare the two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously you'd only use this approach when the benefits of using ediff outweighed the more-cumbersome initialisation procedure.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-25T01:43:11.040" LastActivityDate="2015-09-25T01:43:11.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16911" PostTypeId="2" ParentId="16909" CreationDate="2015-09-24T23:54:02.327" Score="1" Body="&lt;p&gt;The built-in command for such searching is &lt;code&gt;org-occur&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-occur &lt;kbd&gt;RET&lt;/kbd&gt; file: &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;will return a org tree of file links in current buffer. See the org manual for options with this command and how you can customize the regex search.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-24T23:54:02.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16913" PostTypeId="1" AcceptedAnswerId="16931" CreationDate="2015-09-25T08:28:55.300" Score="1" ViewCount="391" Body="&lt;p&gt;I'm the maintainer of &lt;a href=&quot;https://github.com/skuro/puml-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;puml-mode&lt;/code&gt;&lt;/a&gt;, a major mode for editing &lt;a href=&quot;http://plantuml.com/&quot; rel=&quot;nofollow&quot;&gt;PlantUML&lt;/a&gt; files. It works by submitting the content of the current buffer to an external Java process, PlantUML, which then outputs an image to stdout. This image is then put in a newly created buffer to display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it correctly works for both SVG and ASCII art outputs, when I try to produce a PNG something goes wrong and the new buffer shows empty, with no error messages whatsoever. The weird thing is that when I &lt;code&gt;C-c C-c&lt;/code&gt; in the image buffer, I actually see the PNG as text, so the image is supposedly properly loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I manually open PNG files they correctly display as images.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the relevant part of the code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun puml-is-image-output-p ()&#xA;  &quot;Return true if the diagram output format is an image, false if it's text based.&quot;&#xA;  (not (equalp 'utxt&#xA;               (puml-output-type)))) ;; &amp;lt;&amp;lt; feature detection, either 'png 'svg or 'utxt&#xA;&#xA;(defun puml-preview-sentinel (ps event)&#xA;  &quot;For the PlantUML process (as PS) reacts on the termination event (as EVENT).&quot;&#xA;  (if (equal event &quot;finished\n&quot;)&#xA;      (progn&#xA;        (switch-to-buffer puml-preview-buffer)&#xA;        (when (and (display-images-p)&#xA;                   (puml-is-image-output-p))&#xA;          (image-mode)))&#xA;    (warn &quot;PUML Preview failed: %s&quot; event)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9628" LastEditorUserId="105" LastEditDate="2016-06-22T20:21:22.553" LastActivityDate="2016-06-22T20:21:22.553" Title="How to inject a PNG into a buffer in image-mode from a process output" Tags="|process|image-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16914" PostTypeId="2" ParentId="16909" CreationDate="2015-09-25T09:00:02.667" Score="6" Body="&lt;p&gt;Assuming the current buffer is an org-mode buffer,&#xA;the following code collects paths of file links in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-element-map (org-element-parse-buffer) 'link&#xA;  (lambda (link)&#xA;    (when (string= (org-element-property :type link) &quot;file&quot;)&#xA;      (org-element-property :path link))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In an org buffer, &lt;code&gt;(org-element-parse-buffer)&lt;/code&gt; returns the parse&#xA;tree of the current buffer.&#xA;And you can map over it with &lt;code&gt;org-element-map&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9471" LastActivityDate="2015-09-25T09:00:02.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16915" PostTypeId="1" CreationDate="2015-09-25T09:15:05.430" Score="2" ViewCount="202" Body="&lt;p&gt;In an Org document I type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call the /static/ method =something(/$with/, /$param/)=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and (thanks to &lt;code&gt;org-hide-emphasis-markers&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;) it appears as&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;call the &lt;em&gt;static&lt;/em&gt; method &lt;code&gt;something(&lt;em&gt;$with&lt;/em&gt;, &lt;em&gt;$param&lt;/em&gt;)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;both in graphic mode and &lt;code&gt;--no-window-system&lt;/code&gt; mode. Just what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then when I export it to HTML, results&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call the &amp;lt;i&amp;gt;static&amp;lt;/i&amp;gt; method &amp;lt;code&amp;gt;something(/$with/, /$param/)&amp;lt;/code&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I convince the exporter to italicize inside verbatim or code too?&lt;/p&gt;&#xA;" OwnerUserId="9247" LastActivityDate="2015-09-25T09:15:05.430" Title="Export italics inside verbatim or code" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16916" PostTypeId="2" ParentId="11044" CreationDate="2015-09-25T10:07:21.997" Score="0" Body="&lt;p&gt;Seems like I ran into a rather simple solution. Apparently, the &lt;code&gt;c-doc-comment-style&lt;/code&gt; variable should be initialized before any mode-hooks are allowed to run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, according to the documentation, setting this variable automatically makes it buffer-local, so it isn't necessary to set the variable inside the hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the solution boils down to moving the setter for &lt;code&gt;c-doc-comment-style&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cc-mode-common-hook ()&#xA;  &quot;Setup common utilities for all C-like modes.&quot;&#xA;  (face-remap-add-relative 'font-lock-doc-face&#xA;           :foreground (face-foreground font-lock-comment-face)))&#xA;&#xA;(setq c-doc-comment-style '((java-mode . javadoc)&#xA;                        (pike-mode . autodoc)&#xA;                        (c-mode    . javadoc)&#xA;                        (c++-mode  . javadoc)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2015-09-25T10:07:21.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16917" PostTypeId="1" CreationDate="2015-09-25T13:51:58.607" Score="2" ViewCount="508" Body="&lt;p&gt;In my org document, I have some urls that I would like to see exported plain-text, not as links. For example, if I have this in my org document,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://www.pharo.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;exporting to HTML will result in this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;a href=&quot;http://www.pharo.org/&quot;&amp;gt;http://www.pharo.org/&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I would like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://www.pharo.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org automatically recognizes external links even without using the link syntax:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Org also finds external links in the normal text and activates them as links.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2222" LastActivityDate="2019-05-07T12:23:27.227" Title="How to prevent org-mode from exporting external links" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16918" PostTypeId="2" ParentId="16750" CreationDate="2015-09-25T14:00:29.597" Score="6" Body="&lt;p&gt;this seems to answer the member function bit of your question&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'c++-mode&#xA; `((,(concat&#xA;   &quot;\\&amp;lt;[_a-zA-Z][_a-zA-Z0-9]*\\&amp;gt;&quot;       ; Object identifier&#xA;   &quot;\\s *&quot;                              ; Optional white space&#xA;   &quot;\\(?:\\.\\|-&amp;gt;\\)&quot;                   ; Member access&#xA;   &quot;\\s *&quot;                              ; Optional white space&#xA;   &quot;\\&amp;lt;\\([_a-zA-Z][_a-zA-Z0-9]*\\)\\&amp;gt;&quot; ; Member identifier&#xA;   &quot;\\s *&quot;                              ; Optional white space&#xA;   &quot;(&quot;)                                 ; Paren for method invocation&#xA;   1 'font-lock-function-name-face t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;source: &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/27eqwm/highlighting_c_member_function_calls/&quot;&gt;https://www.reddit.com/r/emacs/comments/27eqwm/highlighting_c_member_function_calls/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8930" LastActivityDate="2015-09-25T14:00:29.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16919" PostTypeId="1" CreationDate="2015-09-25T14:25:26.140" Score="7" ViewCount="2672" Body="&lt;p&gt;I am trying to get session to work, and I am especially keen on having my registers persistent between sessions. I installed the package sessions.el via Melpa (M-x list-packages) and I added this to my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'session)&#xA;(add-hook 'after-init-hook 'session-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I also added this as recommended in the session.el file (even though desktop is not enabled)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq desktop-globals-to-save '(desktop-missing-file-warning))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem to be working though. I tried saving my registers but they are not persistent across sessions. I tried changing the value of &lt;code&gt;session-globals-include&lt;/code&gt; via M-x customize-group RET session RET to include register. This is what emacs added to my .emacs file after the changes in custom&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(session-globals-include&#xA;   (quote&#xA;    ((kill-ring 10 nil)&#xA;     (session-file-alist 100 t)&#xA;     (file-name-history 200 nil)&#xA;     search-ring regexp-search-ring&#xA;     (register-alist 100 t))))&#xA; '(session-use-package t nil (session)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still, when I try to invoke a register using C-x r j r (the set register from the previous session), it says &quot;Register doesn't contain a buffer position or configuration&quot;. I am not even sure anything is being saved between sessions. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="9416" LastActivityDate="2017-01-10T23:38:03.400" Title="How can I get sessions.el to save my registers?" Tags="|session|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16920" PostTypeId="1" CreationDate="2015-09-25T14:27:19.443" Score="2" ViewCount="325" Body="&lt;p&gt;I would like to maintain a list of acronyms in my org-mode file. Should I just use &lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html&quot; rel=&quot;nofollow&quot;&gt;Description plain lists&lt;/a&gt; for that or is there a better way?&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-09-25T14:27:19.443" Title="Acronyms as description list" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16921" PostTypeId="1" CreationDate="2015-09-25T15:10:02.210" Score="9" ViewCount="2814" Body="&lt;p&gt;It would be nice to have a quick way to toggle a variable. Here's something that I have in mind.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call a &quot;toggle var&quot; function.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;completing-read&lt;/code&gt; should list only variables that have single values (not lists or alists). &lt;em&gt;I don't know if that can be done.&lt;/em&gt; It would be even better if it lists only the vars that have values as either &lt;code&gt;t&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt;. &lt;em&gt;Pretty sure this cannot be done.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;The function then sets the var value to &lt;code&gt;t&lt;/code&gt; if its current value is &lt;code&gt;nil&lt;/code&gt;, and vice-versa.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The question is if we already have an elisp function that does this. If not, and if people have dealt with this problem with their custom solution, would like to see how they do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bonus feature would be to make the &lt;code&gt;completing-read&lt;/code&gt; suggest the symbol under point (if present) for toggling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the &quot;toggle var&quot; fn is bound to &lt;code&gt;C-c ~&lt;/code&gt;, the usage will be as short as &lt;code&gt;C-c ~ RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My current procedure to toggle a var is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v VAR&lt;/code&gt;, get the current var value.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-: (setq VAR toggled-value)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-: (setq VAR (not VAR))&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am looking for a way to speed up this process (less typing).&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2016-06-22T20:20:46.443" LastActivityDate="2016-06-22T20:20:46.443" Title="Quick way to toggle a variable" Tags="|variables|boolean|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16923" PostTypeId="2" ParentId="16921" CreationDate="2015-09-25T15:25:51.917" Score="4" Body="&lt;p&gt;Here's a quick answer --&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-toggle-var (var)&#xA;  &quot;...&quot;&#xA;  (interactive&#xA;   (let* ((def  (variable-at-point))&#xA;          (def  (and def &#xA;                     (not (numberp def))&#xA;                     (memq (symbol-value def) '(nil t))&#xA;                     (symbol-name def))))&#xA;     (list&#xA;      (completing-read&#xA;       &quot;Toggle value of variable: &quot;&#xA;       obarray (lambda (c)&#xA;                 (unless (symbolp c) (setq c  (intern c)))&#xA;                 (and (boundp c)  (memq (symbol-value c) '(nil t))))&#xA;       'must-confirm nil 'variable-name-history def))))&#xA;  (let ((sym  (intern var)))&#xA;    (set sym (not (symbol-value sym)))&#xA;    (message &quot;`%s' is now `%s'&quot; var (symbol-value sym))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But if you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can just use command &lt;code&gt;icicle-toggle-option&lt;/code&gt; (with a negative prefix arg, if you want any variable, and not just a user option):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;icicle-toggle-option is an interactive compiled Lisp function in&#xA;`icicles-cmd1.el'.&#xA;&#xA;It is bound to menu-bar options icicles icicle-toggle-option.&#xA;&#xA;(icicle-toggle-option)&#xA;&#xA;Toggle option’s value.  This makes sense for binary (toggle) options.&#xA;By default, completion candidates are limited to user options that&#xA;have ‘boolean’ custom types.  However, there are many &quot;binary&quot; options&#xA;that allow other non-nil values than t.&#xA;&#xA;You can use a prefix argument to change the set of completion&#xA;candidates, as follows:&#xA;&#xA; - With a non-negative prefix arg, all user options are candidates.&#xA; - With a negative prefix arg, all variables are candidates.&#xA;&#xA;Read input, then act on it.&#xA;&#xA;Input-candidate completion and cycling are available.  While cycling,&#xA;these keys with prefix ‘C-’ are active:&#xA;&#xA;‘C-mouse-2’, ‘C-return’ - Act on current completion candidate only&#xA;‘C-down’, ‘C-wheel-down’ - Move to next completion candidate and act&#xA;‘C-up’, ‘C-wheel-up’ - Move to previous completion candidate and act&#xA;‘C-next’  - Move to next apropos-completion candidate and act&#xA;‘C-prior’ - Move to previous apropos-completion candidate and act&#xA;‘C-end’   - Move to next prefix-completion candidate and act&#xA;‘C-home’  - Move to previous prefix-completion candidate and act&#xA;‘C-!’     - Act on *all* candidates, successively (careful!)&#xA;&#xA;When candidate action and cycling are combined (e.g. ‘C-next’), user&#xA;option ‘icicle-act-before-cycle-flag’ determines which occurs first.&#xA;&#xA;With prefix ‘C-M-’ instead of ‘C-’, the same keys (‘C-M-mouse-2’,&#xA;‘C-M-RET’, ‘C-M-down’, and so on) provide help about candidates.&#xA;&#xA;Use ‘mouse-2’, ‘RET’, or ‘S-RET’ to finally choose a candidate, or&#xA;‘C-g’ to quit.&#xA;&#xA;This is an Icicles command - see command ‘icicle-mode’.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-25T19:57:38.367" LastActivityDate="2015-09-25T19:57:38.367" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16924" PostTypeId="2" ParentId="16921" CreationDate="2015-09-25T15:29:37.593" Score="2" Body="&lt;p&gt;Try &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy-setq&lt;/a&gt; to toggle variable at point or &lt;a href=&quot;https://github.com/abo-abo/oremacs/blob/github/oleh/auto.el&quot; rel=&quot;nofollow&quot;&gt;ora-custom-setq&lt;/a&gt; from my config to set a variable with completion:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun ora-custom-setq ()&#xA;  &quot;Set a custom variable, with completion.&quot;&#xA;  (interactive)&#xA;  (let ((sym (intern&#xA;              (ivy-read &quot;Variable: &quot;&#xA;                        (counsel-variable-list))))&#xA;        sym-type&#xA;        cands)&#xA;    (when (and (boundp sym)&#xA;               (setq sym-type (get sym 'custom-type)))&#xA;      (cond&#xA;        ((and (consp sym-type)&#xA;              (memq (car sym-type) '(choice radio)))&#xA;         (setq cands (mapcar #'lispy--setq-doconst (cdr sym-type))))&#xA;        ((eq sym-type 'boolean)&#xA;         (setq cands&#xA;               '((&quot;nil&quot; . nil) (&quot;t&quot; . t))))&#xA;        (t&#xA;         (error &quot;Unrecognized custom type&quot;)))&#xA;      (let ((res (ivy-read (format &quot;Set (%S): &quot; sym) cands)))&#xA;        (when res&#xA;          (setq res&#xA;                (if (assoc res cands)&#xA;                    (cdr (assoc res cands))&#xA;                  (read res)))&#xA;          (eval `(setq ,sym ,res)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-09-25T15:29:37.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16925" PostTypeId="2" ParentId="16921" CreationDate="2015-09-25T17:21:25.587" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-variable (variable)&#xA;  (interactive&#xA;   (let ((v (variable-at-point))&#xA;         val)&#xA;     (setq val (completing-read (if (symbolp v)&#xA;                                    (format&#xA;                                     &quot;Toggle variable (default %s (= %s)): &quot; v (symbol-value v))&#xA;                                  &quot;Toggle variable: &quot;)&#xA;                                obarray&#xA;                                'boundp&#xA;                                t nil nil&#xA;                                (if (symbolp v) (symbol-name v))))&#xA;     (list (if (equal val &quot;&quot;)&#xA;               v (intern val)))))&#xA;  (set variable (not (symbol-value variable)))&#xA;  (message &quot;%s toggled (= %s)&quot; variable (symbol-value variable)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you have helm installed, you can use the command &lt;code&gt;helm-apropos&lt;/code&gt;, it&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;provide completion interface for all variables&lt;/li&gt;&#xA;&lt;li&gt;can per-select the variable at point if any&lt;/li&gt;&#xA;&lt;li&gt;provide action to change the variable's value (you need to insert new value in the Minibuffer)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;the advantage is you can look up the doc-string of variable and change its value within a &lt;code&gt;helm-apropos&lt;/code&gt; session.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-10-10T16:08:36.110" LastActivityDate="2015-10-10T16:08:36.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16926" PostTypeId="2" ParentId="4137" CreationDate="2015-09-25T17:29:23.297" Score="1" Body="&lt;p&gt;Did you, by any chance, change the mode of the buffer you opened with &lt;code&gt;C-c '&lt;/code&gt;? That's Emacs bug #19887: &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2015-02/msg00617.html&quot; rel=&quot;nofollow&quot;&gt;discussion&lt;/a&gt;, and is supposed to have been fixed in February 2015.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you run into this problem again and are stuck with the editing buffer that doesn't want to close, @wvxvw's suggestion will let you close it.&lt;/p&gt;&#xA;" OwnerUserId="2290" LastActivityDate="2015-09-25T17:29:23.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16927" PostTypeId="1" AcceptedAnswerId="16949" CreationDate="2015-09-26T03:14:50.707" Score="4" ViewCount="125" Body="&lt;p&gt;In most contexts, like Firefox of MS Office, if I have text that says, &quot;It’s my birthday&quot; (where the apostrophe has Unicode decimal code 8217) and I search for &quot;It's my birthday&quot; (with a simple apostrophe, decimal code 39) the search matches despite the fact that the two apostrophes are different Unicode characters. However, in Emacs text-mode, the two don't match. Is there a way I can get Emacs's search to consider the two apostrophes the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org&lt;/code&gt; on OS X Yosemite 10.10.5. I'm using a graphic display.&lt;/p&gt;&#xA;" OwnerUserId="8665" LastEditorUserId="8665" LastEditDate="2015-09-27T16:22:30.600" LastActivityDate="2015-09-27T16:23:36.327" Title="Getting Emacs to recognize analogous Unicode characters as equivalent when searching" Tags="|search|unicode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16928" PostTypeId="2" ParentId="16808" CreationDate="2015-09-26T04:20:26.943" Score="3" Body="&lt;p&gt;You might find &lt;a href=&quot;http://orgmode.org/manual/Comment-lines.html&quot; rel=&quot;nofollow&quot;&gt;comment lines&lt;/a&gt; useful.  They will be set apart from the rest of the content and not exported.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lines starting with zero or more whitespace characters followed by one ‘#’ and a whitespace are treated as comments and, as such, are not&#xA;  exported.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Likewise, regions surrounded by ‘#+BEGIN_COMMENT’ ... ‘#+END_COMMENT’&#xA;  are not exported.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Finally, a ‘COMMENT’ keyword at the beginning of an entry, but after&#xA;  any other keyword or priority cookie, comments out the entire subtree.&#xA;  In this case, the subtree is not exported and no code block within it&#xA;  is executed either1. The command below helps changing the comment&#xA;  status of a headline.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;C-c ;&#xA;      Toggle the ‘COMMENT’ keyword at the beginning of an entry.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2015-09-26T04:20:26.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16929" PostTypeId="1" AcceptedAnswerId="16930" CreationDate="2015-09-26T04:35:55.850" Score="19" ViewCount="26336" Body="&lt;p&gt;I love using Emacs and I want to have the latest version of Emacs always. But on my Ubuntu machine Emacs won't be upgraded automatically during the regular software updates. Even when I run &lt;code&gt;sudo apt-get upgrade emacs&lt;/code&gt; it says I have the latest Emacs while I don't. I see I am using 24.4 version of Emacs while the latest one is 24.5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have searched for ways to upgrade Emacs to the latest version but I couldn't find any. Can you please tell me how to do that?&lt;/p&gt;&#xA;" OwnerUserId="9592" LastActivityDate="2022-09-28T21:44:33.720" Title="How can I have the latest version of emacs always" Tags="|install|upgrade|" AnswerCount="8" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16930" PostTypeId="2" ParentId="16929" CreationDate="2015-09-26T04:43:49.127" Score="5" Body="&lt;p&gt;Follow these &lt;a href=&quot;http://ubuntuhandbook.org/index.php/2014/10/emacs-24-4-released-install-in-ubuntu-14-04/&quot; rel=&quot;noreferrer&quot;&gt;directions for Ubuntu&lt;/a&gt; substituting 24.5 in the download step 5 and subsequent steps.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-09-26T04:43:49.127" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16931" PostTypeId="2" ParentId="16913" CreationDate="2015-09-26T06:29:12.767" Score="2" Body="&lt;p&gt;Let bound &lt;code&gt;coding-system-for-read&lt;/code&gt; to &lt;code&gt;raw-text&lt;/code&gt; or &lt;code&gt;no-conversion&lt;/code&gt; in function starting the process for getting png data. This will instruct emacs to treat the process output as raw bytes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at your code in github it seems the &lt;code&gt;puml-preview&lt;/code&gt; starts the &lt;code&gt;planetuml&lt;/code&gt; process, change its definition as follows&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun puml-preview ()&#xA;  &quot;Preview diagram.&quot;&#xA;  (interactive)&#xA;  (let ((b (get-buffer puml-preview-buffer)))&#xA;    (when b&#xA;      (kill-buffer b)))&#xA;  (let ((process-connection-type nil)&#xA;        (buf (get-buffer-create puml-preview-buffer))&#xA;        (coding-system-for-read 'raw-text))&#xA;    (let ((ps (start-process &quot;PUML&quot; buf&#xA;                             &quot;java&quot; &quot;-jar&quot; (shell-quote-argument puml-plantuml-jar-path)&#xA;                             (puml-output-type-opt) &quot;-p&quot;)))&#xA;      (process-send-region ps (point-min) (point-max))&#xA;      (process-send-eof ps)&#xA;      (set-process-sentinel ps 'puml-preview-sentinel))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-26T06:29:12.767" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16932" PostTypeId="2" ParentId="16929" CreationDate="2015-09-26T10:32:56.123" Score="13" Body="&lt;p&gt;With &lt;a href=&quot;http://gnu.org/s/guix&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Guix&lt;/a&gt; you can easily reuse the package definition for Emacs with a later tarball.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;guix build emacs --with-source=http://some/emacs/tarball.tar.xz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Emacs 27.2 is available via Guix, so you'd just need to run &lt;code&gt;guix install emacs&lt;/code&gt; to install the latest stable version.&lt;/p&gt;&#xA;&lt;p&gt;You can install emacs 28.0 with &lt;code&gt;guix install emacs-next&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Even if Guix did not offer the latest version you cloud easily create a package variant, such as this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(define-public my/emacs&#xA;  (package (inherit emacs)&#xA;    (name &amp;quot;custom-emacs&amp;quot;)&#xA;    (version &amp;quot;25.7&amp;quot;)&#xA;    (source (origin&#xA;              (method url-fetch)&#xA;              (uri (string-append &amp;quot;mirror://gnu/emacs/emacs-&amp;quot;&#xA;                                  version &amp;quot;.tar.xz&amp;quot;))&#xA;              (sha256&#xA;               (base32&#xA;                &amp;quot;0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx&amp;quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can use Guix as a package manager on top of Ubuntu or any other GNU system.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2021-08-18T10:31:22.947" LastActivityDate="2021-08-18T10:31:22.947" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="16933" PostTypeId="1" AcceptedAnswerId="16952" CreationDate="2015-09-26T13:33:22.080" Score="1" ViewCount="1150" Body="&lt;p&gt;When I am working on a file in my application in emacs/elpy, I always have to jump back into my main file buffer and do &lt;code&gt;C-u C-c C-c&lt;/code&gt; (i.e. ) in order to run and debug it in the python shell. This is rather time consuming, so I was wondering, how can I define a corresponding &lt;code&gt;C-u C-c C-c&lt;/code&gt; binding but which always runs my defined main file?&lt;/p&gt;&#xA;" OwnerUserId="9638" LastActivityDate="2015-09-28T08:29:50.680" Title="Define main file to always be run on C-c C-c in emacs elpy" Tags="|python|elpy|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16935" PostTypeId="1" AcceptedAnswerId="16937" CreationDate="2015-09-26T16:11:25.693" Score="12" ViewCount="4407" Body="&lt;p&gt;The &lt;code&gt;smartparens-mode&lt;/code&gt; doesn't suit my style of editing.  If I attempt to disable it globally in spacemacs, however, the mode is re-enabled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(smartparens-global-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I disable smartparens-mode?&lt;/p&gt;&#xA;" OwnerUserId="2516" LastActivityDate="2023-01-27T08:57:47.053" Title="Disable smartparens in spacemacs" Tags="|spacemacs|smartparens|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16936" PostTypeId="2" ParentId="16935" CreationDate="2015-09-26T16:11:25.693" Score="1" Body="&lt;p&gt;Add entry/exit hooks for evil insert mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Defeat smartparens-mode in evil mode&#xA;(add-hook 'evil-insert-state-entry-hook 'turn-off-smartparens-mode)&#xA;(add-hook 'evil-insert-state-exit-hook 'turn-on-smartparens-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In spacemacs hybrid mode, apply to the evil-hybrid-state hooks:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Alternative way to defeat smartparens-mode in hybrid mode&#xA;(add-hook 'evil-hybrid-state-entry-hook 'turn-off-smartparens-mode)&#xA;(add-hook 'evil-hybrid-state-exit-hook 'turn-on-smartparens-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2516" LastActivityDate="2015-09-26T16:11:25.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16937" PostTypeId="2" ParentId="16935" CreationDate="2015-09-26T18:10:47.883" Score="15" Body="&lt;p&gt;You can add &lt;code&gt;smartparens&lt;/code&gt; to the &lt;code&gt;dotspacemacs-excluded-packages&lt;/code&gt; list of your dotfile.&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2015-09-26T18:10:47.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16938" PostTypeId="1" CreationDate="2015-09-26T18:41:07.973" Score="0" ViewCount="122" Body="&lt;p&gt;Just discovered &lt;code&gt;scss-mode&lt;/code&gt; and it's concomitant compile-on-save (very cool). However, I keep getting errors because &lt;code&gt;sass&lt;/code&gt; it is not reading &lt;code&gt;../config.rb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can find no variables in &lt;code&gt;scss-mode&lt;/code&gt; nor params for &lt;code&gt;sass&lt;/code&gt; (i.e.: &lt;code&gt;scss-sass-options&lt;/code&gt;) which would feed in the config path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one convince &lt;code&gt;sass&lt;/code&gt; to read &lt;code&gt;config.rb&lt;/code&gt; under compilation?&lt;/p&gt;&#xA;" OwnerUserId="2350" LastEditorUserId="2350" LastEditDate="2015-09-27T14:15:54.887" LastActivityDate="2015-09-27T14:15:54.887" Title="scss-mode compile not reading config.rb" Tags="|major-mode|config|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16939" PostTypeId="1" AcceptedAnswerId="16998" CreationDate="2015-09-26T19:01:05.173" Score="4" ViewCount="1734" Body="&lt;p&gt;The org-export to beamer gives the following error when the first lines include title and author info. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Presentation Title &#xA;#+AUTHOR: Name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;Wrong type argument: listp, #(&quot;Name&quot; 0 4(:parent (#0)))&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have used this format many times and don't know why this error is occurring now. Has there been a change in org-export engine? &#xA;I have reinstalled org-mode(Version 8.3.1) and tried other ways of specifying author and title as in following answers &lt;a href=&quot;https://stackoverflow.com/questions/26760125/org-mode-beamer-how-to-create-a-short-title-author-date&quot;&gt;link1&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BIND: org-latex-title-command &quot;\\title{De leerplandoelstellingen}\n\\date[mei 2014]{9 mei 2014}\n\\maketitle&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and adding the following to the init file as suggested &lt;a href=&quot;https://github.com/fniessen/refcard-org-beamer&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;ox-latex&quot;&#xA;&#xA;  ;; update the list of LaTeX classes and associated header (encoding, etc.)&#xA;  ;; and structure&#xA;  '(add-to-list 'org-latex-classes&#xA;                `(&quot;beamer&quot;&#xA;                  ,(concat &quot;\\documentclass[presentation]{beamer}\n&quot;&#xA;                           &quot;[DEFAULT-PACKAGES]&quot;&#xA;                           &quot;[PACKAGES]&quot;&#xA;                           &quot;[EXTRA]\n&quot;)&#xA;                  (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;                  (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;                  (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any solutions? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2517" LastActivityDate="2015-09-29T17:46:07.000" Title="How to get title and author in org mode export to beamer presentation?" Tags="|org-mode|org-export|beamer|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16941" PostTypeId="2" ParentId="7429" CreationDate="2015-09-26T23:19:27.457" Score="5" Body="&lt;p&gt;deprecated's answer is very good, but it didn't quite work for me.  I'm currently on Emacs 24.4 and org 8.2.4, and advising &lt;code&gt;org-indent-initialize&lt;/code&gt; didn't do anything.  I had to redefine the function with the changed indent character, and that worked.  Maybe when I upgrade to Emacs 24.5 and org 8.3 the advising will work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I also had to make a few other adjustments, because I use different size variable-width fonts for different heading levels, which means that a level-1 heading's &lt;code&gt;*&lt;/code&gt; is not the same width as a level-2's, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I also had to do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set the faces &lt;code&gt;org-hide&lt;/code&gt; (used to indent headline lines) and &lt;code&gt;org-indent&lt;/code&gt; (used to indent non-headline lines) to make sure they use the same font at the same size.&lt;/li&gt;&#xA;&lt;li&gt;Set the variable &lt;code&gt;org-indent-boundary-character&lt;/code&gt; to &lt;code&gt;*&lt;/code&gt; instead of the default &lt;code&gt;&lt;/code&gt; (a space).  This is the character that is inserted after the indentation characters but before the content.  I'm not sure if changing this is a necessity, but it seems to help consistency.  It might depend on the font you're using, sizes, etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Doing those things in addition to making the change to &lt;code&gt;org-indent-initialize&lt;/code&gt; as deprecated provided seems to have done it.  I end up with a buffer looking like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZAaDT.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZAaDT.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that, as the headline level goes down, the indentation doesn't line up perfectly with the heading text.  I think that's because of using smaller fonts for lower-level headings, and I don't think there's an easy way to fix that.  It might be possible to do something with text-properties like &lt;code&gt;line-prefix&lt;/code&gt; and &lt;code&gt;wrap-prefix&lt;/code&gt;, because those can be set to images and special characters, but that would probably be complicated and slow.  If you use the same font size for all heading levels, this probably won't be an issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, this is probably good enough.  :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.  As requested, here are my &lt;code&gt;org-level&lt;/code&gt; faces.  These are copied from &lt;code&gt;custom-set-faces&lt;/code&gt;, but if you don't use &lt;code&gt;customize&lt;/code&gt; you can set them outside of it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(org-level-1 ((t (:inherit variable-pitch :foreground &quot;#cb4b16&quot; :weight bold :height 1.3))))&#xA; '(org-level-2 ((t (:inherit variable-pitch :foreground &quot;#859900&quot; :weight bold :height 1.2))))&#xA; '(org-level-3 ((t (:inherit variable-pitch :foreground &quot;#268bd2&quot; :weight bold :height 1.15))))&#xA; '(org-level-4 ((t (:inherit variable-pitch :foreground &quot;#b58900&quot; :weight bold :height 1.1))))&#xA; '(org-level-5 ((t (:inherit variable-pitch :foreground &quot;#2aa198&quot; :weight bold))))&#xA; '(org-level-6 ((t (:inherit variable-pitch :foreground &quot;#6c71c4&quot; :weight bold))))&#xA; '(org-level-7 ((t (:inherit variable-pitch :foreground &quot;#d33682&quot; :weight bold))))&#xA; '(org-level-8 ((t (:inherit variable-pitch :foreground &quot;#dc322f&quot; :weight bold))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user3871" LastEditorDisplayName="user3871" LastEditDate="2015-09-27T07:00:37.170" LastActivityDate="2015-09-27T07:00:37.170" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16942" PostTypeId="1" CreationDate="2015-09-26T23:40:52.073" Score="6" ViewCount="164" Body="&lt;p&gt;Emacs' indentation of Emacs lisp code is really great, except for one thing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst one-to-ten '(one two three&#xA;                           four five six seven&#xA;                           eight nine ten))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this actually the preferred way to indent this block? As opposed to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst one-to-ten '(one two three&#xA;                       four five six seven&#xA;                       eight nine ten))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I find it especially confusing when compared to the default for alists:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst one-to-ten '((one . 1) (two . 2) (three . 3)&#xA;                       (four . 4) (five . 5) (six . 6) (seven . 7)&#xA;                       (eight . 8) (nine . 9) (ten . 10)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a reason for this behaviour? I could possibly understand it for back-quoted lists, as it would yield better indentation for macros, but what about lists?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-09-27T09:00:33.650" Title="Indentation of list constants" Tags="|indentation|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16943" PostTypeId="2" ParentId="8242" CreationDate="2015-09-26T23:50:27.147" Score="6" Body="&lt;p&gt;I've been a happy user of filladapt-mode for a long time, which handles this sort of thing really nicely. For info, see&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacswiki.org/emacs/FillAdapt&quot; rel=&quot;noreferrer&quot;&gt;http://emacswiki.org/emacs/FillAdapt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that page:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Filladapt by KyleJones enhances Emacs’ fill functions by guessing a&#xA;  fill prefix, such as a comment sequence in program code, and handling&#xA;  bullet points like “1.” or “*”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example, it could turn this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Pretend I'm a really super long line.&#xA;* And the window's narrow.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Pretend I'm a really super&#xA;  long line.&#xA;* And the window's narrow.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6594" LastEditorUserId="6594" LastEditDate="2015-10-01T01:28:09.947" LastActivityDate="2015-10-01T01:28:09.947" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16944" PostTypeId="1" CreationDate="2015-09-27T03:34:06.477" Score="3" ViewCount="108" Body="&lt;p&gt;I have an account on GNUSocial, and I want to be able to control it from Emacs. However, I haven't found a way to do so yet. I can control my Twitter just fine through twittering-mode, and was wondering if it could be extended to control my GNU Social also. If not, is there a way I can control my GNU Social account through Emacs?&lt;/p&gt;&#xA;" OwnerUserId="561" LastEditorDisplayName="user227" LastEditDate="2015-09-27T13:05:17.170" LastActivityDate="2015-09-27T13:05:17.170" Title="Can twittering-mode be used with GNU Social, and if so, how? If not, any alternatives?" Tags="|major-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16945" PostTypeId="2" ParentId="16942" CreationDate="2015-09-27T09:00:33.650" Score="2" Body="&lt;p&gt;Here are the settings I'm using to fix the indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq lisp-indent-function 'common-lisp-indent-function)&#xA;(eval-after-load 'cl-indent&#xA;  `(progn&#xA;     (put 'cl-flet 'common-lisp-indent-function&#xA;          (get 'flet 'common-lisp-indent-function))&#xA;     (put 'cl-labels 'common-lisp-indent-function&#xA;          (get 'labels 'common-lisp-indent-function))&#xA;     (put 'if 'common-lisp-indent-function 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to fix the Elisp indentation at one point, but it was too convoluted and I gave up.  But the settings above have worked fine for years.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-09-27T09:00:33.650" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16946" PostTypeId="2" ParentId="16933" CreationDate="2015-09-27T12:15:58.173" Score="0" Body="&lt;p&gt;I guess, in your project only one file has &lt;code&gt;main&lt;/code&gt; and no matter in which file you are currently, pressing &lt;code&gt;C-u C-c C-c&lt;/code&gt; should execute that file's main.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elpy cannot find which file has main function. So you can set path to that main file and define new function which does what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my/main-file &quot;/path/to/main/file.py&quot;)&#xA;&#xA;(defun my/special-send-region-or-buffer (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (if arg&#xA;     (with-current-buffer (get-file-buffer my/main-file)&#xA;        (elpy-shell-send-region-or-buffer arg))&#xA;    (elpy-shell-send-region-or-buffer)))&#xA;&#xA;(define-key elpy-mode-map (kbd &quot;C-c C-c&quot;) 'my/special-send-region-or-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add this to your config.  Now if you run &lt;code&gt;C-c C-c&lt;/code&gt; it will act like normal function. But with prefix argument, it will send that particular file with main function.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2015-09-28T08:29:50.680" LastActivityDate="2015-09-28T08:29:50.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16948" PostTypeId="1" AcceptedAnswerId="16964" CreationDate="2015-09-27T14:50:53.240" Score="6" ViewCount="4255" Body="&lt;p&gt;After googling and being recommended &lt;code&gt;projectile&lt;/code&gt; as project navigation, I ended up trying that. I'm now frustrated by the lack of tutorials and/or explanations on how it works, so I was hoping somebody here knew how to handle it. Here is my current problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0LB23.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0LB23.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't understand how to use the &lt;code&gt;.projectile&lt;/code&gt; file. Now, it works in my other project, but here is just completely fails to ignore files. I've tried &lt;code&gt;C-c p i&lt;/code&gt; to clear countless times. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does projectile work, and why doesn't the file actually ignore those files? And as a sidenote, could anyone recommend anything more reliable than projectile, if this is just how unreliable it is?&lt;/p&gt;&#xA;" OwnerUserId="9649" LastEditorUserId="115" LastEditDate="2015-09-28T21:11:54.880" LastActivityDate="2020-01-19T09:05:14.617" Title="Ignoring files in Projectile" Tags="|projectile|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16949" PostTypeId="2" ParentId="16927" CreationDate="2015-09-27T16:23:36.327" Score="0" Body="&lt;p&gt;Based on Drew's comment I believe the answer is that the feature I'm seeking is available in Emacs 25 (which has yet to be released as of 2015-09-27), but I'm using Emacs 24.&lt;/p&gt;&#xA;" OwnerUserId="8665" LastActivityDate="2015-09-27T16:23:36.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16950" PostTypeId="2" ParentId="16929" CreationDate="2015-09-27T16:59:39.243" Score="4" Body="&lt;p&gt;For Ubuntu distributions, you can install the &lt;a href=&quot;https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa&quot; rel=&quot;nofollow&quot;&gt;ubuntu-elisp&lt;/a&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Personal_Package_Archive&quot; rel=&quot;nofollow&quot;&gt;PPA&lt;/a&gt;.  Currently it contains Emacs 25.0.50.2, from 2015-09-19.  This is not the latest &lt;strong&gt;stable&lt;/strong&gt; version, but I've found it to work well enough.  To install:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo apt-add-repository ppa:ubuntu-elisp/ppa&#xA;$ sudo apt-get update&#xA;$ sudo apt-get install emacs-snapshot&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then run Emacs as &lt;code&gt;emacs-snapshot&lt;/code&gt; instead of &lt;code&gt;emacs&lt;/code&gt;.  This way you can have both bleeding-edge and stable version simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;New updates will be pulled down through Ubuntu's normal update process. &lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-09-27T16:59:39.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16951" PostTypeId="2" ParentId="16808" CreationDate="2015-09-27T20:03:33.060" Score="0" Body="&lt;p&gt;How about using &lt;a href=&quot;https://stackoverflow.com/a/12345313&quot;&gt;inlinetasks&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you set &lt;code&gt;org-export-with-inlinetasks&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; then they serve exclusively as side notes to the document author.&lt;/p&gt;&#xA;" OwnerUserId="9651" LastActivityDate="2015-09-27T20:03:33.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16952" PostTypeId="2" ParentId="16933" CreationDate="2015-09-27T20:47:34.813" Score="0" Body="&lt;p&gt;By modifying ChillarAnands code, I eventually got a function and a keybinding working to do what I want. Now I can edit any python file, run &lt;code&gt;C-c C-c&lt;/code&gt; and the main file will be sent to the shell. This way I don't have to keep jumping back to the main file all the time just to run the program. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my/main-file &quot;/path/to/main/file.py&quot;)&#xA;(defun my/special-send-region-or-buffer (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (if (get-file-buffer my/main-file) () (find-file my/main-file))&#xA;  (with-current-buffer (get-file-buffer my/main-file)&#xA;    (elpy-shell-send-region-or-buffer arg))&#xA;  )&#xA;&#xA;(define-key elpy-mode-map (kbd &quot;C-c C-c&quot;) 'my/special-send-region-or-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I want to run the &lt;code&gt;__name__ == '__main__'&lt;/code&gt; part of the program I just run as usual &lt;code&gt;C-u C-c C-c&lt;/code&gt; (that's what &lt;code&gt;&amp;amp;optional arg&lt;/code&gt; takes care of).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am horrible with Emacs lisp, so this function has probably got some flaws. Critique is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9638" LastEditorUserId="9638" LastEditDate="2015-09-28T07:39:32.447" LastActivityDate="2015-09-28T07:39:32.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16953" PostTypeId="1" AcceptedAnswerId="16954" CreationDate="2015-09-27T22:57:28.763" Score="4" ViewCount="1457" Body="&lt;p&gt;How can I replace dired with something like deer?  Any time emacs wants to browse a directory with &lt;code&gt;C-x d&lt;/code&gt; or from a link on the homescreen (from projectile or something), I want to open it in ranger or deer instead of dired.  Is that possible?&lt;/p&gt;&#xA;" OwnerUserId="9590" LastActivityDate="2018-10-16T08:32:43.580" Title="How I can change the default directory handler from dired to deer or ranger?" Tags="|dired|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16954" PostTypeId="2" ParentId="16953" CreationDate="2015-09-27T23:25:22.547" Score="6" Body="&lt;p&gt;See the &lt;code&gt;find-directory-functions&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default (in most cases) it results in &lt;code&gt;dired-noselect&lt;/code&gt; being used. You would add a function which used the thing you want to use instead, making sure it has priority over the dired entry (if not replacing it entirely; depending on your exact intentions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your function will be called (by &lt;code&gt;find-file-noselect&lt;/code&gt;) with a parameter of the directory path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the specific dired bindings like &lt;code&gt;C-x d&lt;/code&gt;, you would want to remap them to your preferred commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [remap dired] 'my-dired-replacement)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-09-27T23:25:22.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16955" PostTypeId="2" ParentId="16929" CreationDate="2015-09-27T23:37:05.067" Score="6" Body="&lt;p&gt;Compiling from source is an option, of course (which may or may not be obvious to you).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're willing to invest in learning how to do that, you'll be able to compile and use virtually any version of Emacs you're interested in (whether that's the latest stable release; one of the &quot;pretest&quot; builds for the next release; or the latest code from the source repository).&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-09-27T23:37:05.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16956" PostTypeId="1" AcceptedAnswerId="16958" CreationDate="2015-09-28T01:57:29.527" Score="1" ViewCount="1380" Body="&lt;p&gt;I have a small square &lt;em&gt;orgmode spreadsheet&lt;/em&gt; with some data in it and 2 extra columns to the right with some formulas, like average and sum.&#xA;I want to add some new columns in the middle of my spreadsheet in order to input more data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Is there a way to update all formulas automatically in order to include the new columns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt; =vsum($2..$12) and I'm adding two new columns, so I want the formula to be updated to =vsum($2..$14); since there are many formulas, I want them all to be updated automatically&lt;/p&gt;&#xA;" OwnerUserId="9515" LastEditorUserId="105" LastEditDate="2015-09-28T05:09:31.933" LastActivityDate="2018-07-15T11:41:29.723" Title="Orgmode Spreadsheet: update formula when adding new column" Tags="|org-table|formula|spreadsheet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16958" PostTypeId="2" ParentId="16956" CreationDate="2015-09-28T05:10:45.503" Score="2" Body="&lt;p&gt;Basically every table manipulating function is updating formulas. For example : &lt;kbd&gt;M-S-right&lt;/kbd&gt; includes a new column (before the cursor) updating formulas to the new number of columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-u C-c *&lt;/kbd&gt; is recalculating all your formulas in the spreadsheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also a &lt;kbd&gt;C-c C-c&lt;/kbd&gt; on a &lt;code&gt;#+tblfm:&lt;/code&gt; line is (re)applying all the formulas in the table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more advanced stuff, like automatically recalculating please have a look at the &lt;a href=&quot;http://orgmode.org/manual/Advanced-features.html#Advanced-features%20manual&quot; rel=&quot;nofollow noreferrer&quot;&gt;org manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2018-07-15T11:41:29.723" LastActivityDate="2018-07-15T11:41:29.723" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="16959" PostTypeId="1" AcceptedAnswerId="16960" CreationDate="2015-09-28T13:01:13.213" Score="5" ViewCount="254" Body="&lt;p&gt;I want my minibuffer prompt to be in bigger font, so I've added this to my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-minibuffer-setup ()&#xA;  (set (make-local-variable 'face-remapping-alist)&#xA;       '((default :height 1.5))))&#xA;&#xA;(add-hook 'minibuffer-setup-hook 'my-minibuffer-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/D0dRb.png&quot; width=&quot;500&quot; /&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I press &lt;kbd&gt;C-s&lt;/kbd&gt;, the font size is the default 1 for some reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make the i-search prompt also in larger size?&lt;/p&gt;&#xA;" OwnerUserId="2332" LastEditorUserId="2332" LastEditDate="2015-09-28T13:45:47.737" LastActivityDate="2015-09-29T07:02:14.690" Title="I-search prompt font" Tags="|faces|minibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16960" PostTypeId="2" ParentId="16959" CreationDate="2015-09-28T13:20:25.067" Score="8" Body="&lt;p&gt;This is because &lt;code&gt;isearch&lt;/code&gt; does not use the minibuffer to read input from the user, rather it simply updates the echo area with the characters entered during &lt;code&gt;isearch&lt;/code&gt;. Please note that the minibuffer and the echo area are &lt;strong&gt;different&lt;/strong&gt;. From the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/The-Echo-Area.html&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs Manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The echo area is used for displaying error messages (see Errors), for&#xA;  messages made with the message primitive, and for echoing keystrokes.&#xA;  It is not the same as the minibuffer, despite the fact that the&#xA;  minibuffer appears (when active) in the same place on the screen as&#xA;  the echo area.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As such &lt;code&gt;minibuffer-setup-hook&lt;/code&gt; is never executed during &lt;code&gt;isearch&lt;/code&gt; since the minibuffer is never setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this specific case, &lt;code&gt;isearch-mode&lt;/code&gt; &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/isearch.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n924&quot; rel=&quot;nofollow&quot;&gt;sets&lt;/a&gt; &lt;code&gt;overriding-terminal-map&lt;/code&gt; to &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/isearch.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n973&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;isearch-mode-map&lt;/code&gt;&lt;/a&gt; which binds all characters from in ascii range 32 to 255 to &lt;code&gt;isearch-printing-char&lt;/code&gt; which updates the isearch prompt by echoing the new prompt. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you follow the calls, you will find that &lt;code&gt;isearch-update&lt;/code&gt; is used to update the prompt which &lt;code&gt;isearch-message-function&lt;/code&gt; (if defined) to update the prompt otherwise it falls back to &lt;code&gt;isearch-message&lt;/code&gt;. So a solution might be to set &lt;code&gt;isearch-message-function&lt;/code&gt; to a custom function which calls &lt;code&gt;message&lt;/code&gt; with a propertized string with &lt;code&gt;face&lt;/code&gt; property set to custom face with desired height.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following implements the idea mentioned in the previous paragraph, most of it is copied directly from the function &lt;code&gt;isearch-message&lt;/code&gt; except for the last part where the string passed to message is propertized to have a larger height.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-isearch-message (&amp;amp;optional c-q-hack ellipsis)&#xA;  ;; Generate and print the message string.&#xA;  (let ((cursor-in-echo-area ellipsis)&#xA;        (m isearch-message)&#xA;        (fail-pos (isearch-fail-pos t)))&#xA;    ;; Highlight failed part&#xA;    (when fail-pos&#xA;      (setq m (copy-sequence m))&#xA;      (add-text-properties fail-pos (length m) '(face isearch-fail) m)&#xA;      ;; Highlight failed trailing whitespace&#xA;      (when (string-match &quot; +$&quot; m)&#xA;        (add-text-properties (match-beginning 0) (match-end 0)&#xA;                             '(face trailing-whitespace) m)))&#xA;    (setq m (concat&#xA;             (isearch-message-prefix ellipsis isearch-nonincremental)&#xA;             m&#xA;             (isearch-message-suffix c-q-hack)))&#xA;    (if c-q-hack m (let ((message-log-max nil)) (message &quot;%s&quot; (propertize m 'face  '(:inherit default :height 1.5)))))))&#xA;&#xA;(setq isearch-message-function #'my-isearch-message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-09-29T07:02:14.690" LastActivityDate="2015-09-29T07:02:14.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16961" PostTypeId="1" AcceptedAnswerId="16991" CreationDate="2015-09-28T13:22:19.707" Score="10" ViewCount="5287" Body="&lt;p&gt;I can resize the emacs frame to whatever size by mouse, is there a way that the frame size be set in init.el by pixels? Or anything similar in the window manager?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="253" LastEditDate="2015-09-28T14:13:48.833" LastActivityDate="2019-12-23T21:56:29.523" Title="How to set emacs frame size by pixels" Tags="|frames|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16962" PostTypeId="2" ParentId="16359" CreationDate="2015-09-28T13:47:24.337" Score="0" Body="&lt;p&gt;Elisp has closures now. Something like this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t -*-    &#xA;(let ((list (let (cache)&#xA;              (list (lambda ()&#xA;                      (unless cache&#xA;                        (message &quot;setting cache&quot;)&#xA;                        (setq cache 42))&#xA;                      cache)&#xA;                    (lambda ()&#xA;                      (message &quot;invalidating cache&quot;)&#xA;                      (setq cache nil))))))&#xA;  (fset 'do-stuff (car list))&#xA;  (fset 'invalidate-cache (cadr list)))&#xA;&#xA;(add-hook 'post-command-hook #'invalidate-cache)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9659" LastActivityDate="2015-09-28T13:47:24.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16963" PostTypeId="1" AcceptedAnswerId="16965" CreationDate="2015-09-28T16:38:05.070" Score="1" ViewCount="472" Body="&lt;p&gt;Below is my attempt at adapting &quot;erlang&quot; syntax checker (from flycheck.el) for my needs. It tries to use &lt;strong&gt;GNU make for compilation&lt;/strong&gt; instead of erlc. Apart from that nothing is changed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-define-checker erlang&#xA;  &quot;An Erlang syntax checker using the Erlang interpreter.&#xA;See URL `http://www.erlang.org/'.&quot;&#xA;  :command (&quot;make -C &quot; (eval (projectile-project-root)))&#xA;  :error-patterns&#xA;  ((warning line-start (file-name) &quot;:&quot; line &quot;: Warning:&quot; (message) line-end)&#xA;   (error line-start (file-name) &quot;:&quot; line &quot;: &quot; (message) line-end))&#xA;  :modes erlang-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Attempt to load it using flycheck-select-checker (C-c ! s) fails with following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Syntax checker in buffer test.erl in erlang-mode:&#xA;&#xA;  erlang&#xA;    - major mode: `erlang-mode' supported&#xA;    - predicate:  nil&#xA;    - executable: Not found&#xA;&#xA;Flycheck cannot use this syntax checker for this buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I debug this beast?&lt;/p&gt;&#xA;" OwnerUserId="9663" LastActivityDate="2015-09-29T06:32:21.270" Title="Flycheck.erl checker that uses functions from projectile" Tags="|projectile|debugging|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16964" PostTypeId="2" ParentId="16948" CreationDate="2015-09-28T18:31:57.980" Score="5" Body="&lt;p&gt;To ignore files matching a pattern, such as files with a specific extension, you need to include a wildcard in the pattern. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*.swp&#xA;-*.meta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are some examples of this on the project page in Github, in the &lt;a href=&quot;https://github.com/bbatsov/projectile/blob/master/doc/projects.md#ignoring-files&quot; rel=&quot;nofollow noreferrer&quot;&gt;section on &quot;Ignoring Files&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've used Projectile daily for a while and in my experience it has always been very stable. Of course, as with any Emacs package you'll need to decide what best fits your work flow; and you may need to tweak configurations to suit your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the comments, note that file ignore patterns are only working when using native indexing. This may be a bug when using alien indexing. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="20795" LastEditDate="2020-01-19T09:05:14.617" LastActivityDate="2020-01-19T09:05:14.617" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="16965" PostTypeId="2" ParentId="16963" CreationDate="2015-09-28T19:09:47.427" Score="1" Body="&lt;p&gt;Everything except the command looks fine to me.  A command is defined as a list of all arguments/options as items, therefore this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-define-checker erlang&#xA;  &quot;An Erlang syntax checker using the Erlang interpreter.&#xA;See URL `http://www.erlang.org/'.&quot;&#xA;  :command (&quot;make&quot; &quot;-C&quot; (eval (projectile-project-root)))&#xA;  :error-patterns&#xA;  ((warning line-start (file-name) &quot;:&quot; line &quot;: Warning:&quot; (message) line-end)&#xA;   (error line-start (file-name) &quot;:&quot; line &quot;: &quot; (message) line-end))&#xA;  :modes erlang-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-09-29T06:32:21.270" LastActivityDate="2015-09-29T06:32:21.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16966" PostTypeId="1" AcceptedAnswerId="16967" CreationDate="2015-09-28T20:29:47.217" Score="0" ViewCount="142" Body="&lt;p&gt;I have a long file.f90 with several subroutines. Sometimes I'm editing some subroutine and I forgot where I'm (I mean the name of the subroutine that I'm editing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder what subroutine I am, I mean, where the cursor is (obviously, without move the cursor until the beginning to the subroutine to see its name). Is it possible?&lt;/p&gt;&#xA;" OwnerUserId="9666" LastActivityDate="2015-09-28T20:52:40.337" Title="Emacs and fortran 90. In which subroutine am I?" Tags="|emacsclient|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16967" PostTypeId="2" ParentId="16966" CreationDate="2015-09-28T20:52:40.337" Score="3" Body="&lt;p&gt;You could enable the global minor mode &lt;code&gt;which-function-mode&lt;/code&gt;, which should be supported in &lt;code&gt;f90-mode&lt;/code&gt; and &lt;code&gt;fortran-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Which Function mode is a global minor mode.  When enabled, the&#xA;  current function name is continuously displayed in the mode line,&#xA;  in certain major modes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Enable it by running &lt;code&gt;M-x which-function-mode&lt;/code&gt; or by adding &lt;code&gt;(which-function-mode 1)&lt;/code&gt; to your &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-09-28T20:52:40.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16968" PostTypeId="2" ParentId="15144" CreationDate="2015-09-28T22:20:31.283" Score="11" Body="&lt;p&gt;I think one of the things unclear from the FAQ is the necessity that &lt;strong&gt;both&lt;/strong&gt; server and client be resolveable from each other.  You can see &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2009-09/msg00082.html&quot; rel=&quot;noreferrer&quot;&gt;this thread&lt;/a&gt; from 2009.  Eventually, back then I did get it to work, but now I do see the same as the OP.  This is what I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;setup.el:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'server)&#xA;&#xA;(setq server-name &quot;sx-test&quot;       ; name of the server&#xA;      server-host &quot;192.168.2.198&quot; ; server ip&#xA;      server-use-tcp t)&#xA;&#xA;(server-start)                    ; comment out when using --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I started the server like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q -l setup.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will give you an Emacs window though.  If you do not want that, comment out the &lt;code&gt;(server-start)&lt;/code&gt; line, and start Emacs like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q -l setup.el --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now on the remote machine, I copied the cookie as instructed in the FAQ, and attempted to start the client like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -f ~/.emacs.d/server/sx-test /ssh:user@192.168.2.200:/path/to/foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;192.168.2.200 is the ip of the remote client.  This is why both-way name resolution is necessary.  Essentially, &lt;code&gt;/ssh:user@192.168.2.200:/path/to/foo&lt;/code&gt; is the tramp path you would give to server to edit remotely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see a failure just like the OP.  I ran &lt;code&gt;emacsclient&lt;/code&gt; under gdb, and traced back the problem to a failure in connecting to the socket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lib-src/emacsclient.c#n974&quot; rel=&quot;noreferrer&quot;&gt;emacsclient.c&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;  /* Set up the socket.  */&#xA;  if (connect (s, (struct sockaddr *) &amp;amp;server, sizeof server) &amp;lt; 0) /* &amp;lt;-- fails here */&#xA;    {&#xA;#ifdef WINDOWSNT&#xA;      if(!(w32_window_app () &amp;amp;&amp;amp; alternate_editor))&#xA;#endif&#xA;      sock_err_message (&quot;connect&quot;);&#xA;      return INVALID_SOCKET;&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then ran it under &lt;code&gt;strace&lt;/code&gt;, and see the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;write(1, &quot;emacsclient: connected to remote&quot;..., 57emacsclient: connected to remote socket at 192.168.2.198&#xA;) = 57&#xA;socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3&#xA;connect(3, {sa_family=AF_INET, sin_port=htons(40266), sin_addr=inet_addr(&quot;192.168.2.198&quot;)}, 16) = -1 EHOSTUNREACH (No route to host)&#xA;write(2, &quot;emacsclient: connect: No route t&quot;..., 39emacsclient: connect: No route to host&#xA;) = 39&#xA;write(2, &quot;emacsclient: error accessing ser&quot;..., 80emacsclient: error accessing server file &quot;/home/jallad/.emacs.d/server/sx-test&quot;&#xA;) = 80&#xA;exit_group(1)                           = ?&#xA;+++ exited with 1 +++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At this point I'm not sure what is going wrong, as I can ping and ssh into the server.&lt;/p&gt;&#xA;" OwnerUserId="2093" LastEditorUserId="2093" LastEditDate="2016-08-03T08:17:54.490" LastActivityDate="2016-08-03T08:17:54.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16969" PostTypeId="1" CreationDate="2015-09-28T23:33:57.550" Score="4" ViewCount="837" Body="&lt;p&gt;In one of my windows I've opened &quot;output.png&quot; and I would like emacs to automatically reload it if it has changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to do this for all PNG files which are currently open, but only PNG files. How to I do this?&lt;/p&gt;&#xA;" OwnerUserId="9653" LastActivityDate="2018-09-13T05:01:02.990" Title="Automatic reload of images" Tags="|images|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16970" PostTypeId="1" AcceptedAnswerId="17136" CreationDate="2015-09-29T01:14:06.723" Score="5" ViewCount="190" Body="&lt;p&gt;I often find myself in the situation of needing to open a bunch of files at the same time and run through them all and do something (search/replace, verify something or other, etc.). In vim, I'd do this by populating the arglist (blog post on &lt;a href=&quot;http://vimcasts.org/episodes/meet-the-arglist/&quot;&gt;VimCasts&lt;/a&gt; for people who aren't familiar).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's essentially a subset of the buffer list that maintains its order. Vim provides commands for navigating through this list; once the list is populated, you can step through it with &lt;code&gt;:next&lt;/code&gt; and do the edits. Vim tells you when you've hit the end of the list, and if you try to quit before you've edited them all it will gripe at you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to get Emacs to emulate this feature?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-17T13:41:42.267" Title="Is there an Emacs equivalent to Vim's arglist?" Tags="|package|emacsclient|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16971" PostTypeId="1" AcceptedAnswerId="17040" CreationDate="2015-09-29T01:19:28.020" Score="10" ViewCount="4282" Body="&lt;p&gt;I took the plunge today and started out on my quest to build the most recent Emacs master branch developer build -- aka Emacs Trunk -- for MS-Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found an old blog and went through the procedure, only to be met with an error message telling me that particular method was no longer supported.  The error message referred me to read:  &lt;code&gt;.../emacs/nt/INSTALL&lt;/code&gt;.  Well, that is all fine and dandy if the infrastructure for building Emacs has already been installed/configured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sure would be handy if there were a step 1, 2, 3 that describes what tools are needed and how to go about installing/configuring them with a specific eye towards building Emacs on MS-Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the event that anyone would like to prepare a detailed write-up, please feel free to post an answer.  If not, I will write one up myself once I figure out how to do it.  I was met with additional road-blocks and have submitted a bug report in the interim -- I do not yet know whether it is me, or perhaps a bug:  &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21582&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21582&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think more people would be inclined to build their own Emacs if there were a &quot;cheat-sheet&quot; that could be used by beginning programmers or hobbyists such as myself (who are not programmers by trade).&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-01-01T16:54:20.737" Title="How to build Emacs master branch (aka trunk) on MS-Windows" Tags="|microsoft-windows|build|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16972" PostTypeId="2" ParentId="751" CreationDate="2015-09-29T01:26:27.517" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;Go to the end* of what you want selected.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-S-b&lt;/code&gt; or &lt;code&gt;M-S-b&lt;/code&gt; to select backwards until you get a portion&#xA;selected. You can use shift left arrow as well.&lt;/li&gt;&#xA;&lt;li&gt;Then press &lt;code&gt;C-&amp;gt;&lt;/code&gt; (press shift if the key &lt;code&gt;&amp;gt;&lt;/code&gt; is on top of your keyboard's key) until you get more than one item selected.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;*It is important to select backwards or the first selection will place the cursor in the wrong position.&lt;/p&gt;&#xA;" OwnerUserId="9644" LastEditorUserId="9644" LastEditDate="2017-02-06T01:42:06.377" LastActivityDate="2017-02-06T01:42:06.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16973" PostTypeId="1" AcceptedAnswerId="16976" CreationDate="2015-09-29T03:00:09.003" Score="8" ViewCount="184" Body="&#xA;&#xA;&lt;p&gt;I have the below elisp code in my emacs config which disables my touchpad, so it won't annoy me when writing. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; disable touchpad when on emacs&#xA;&#xA;(defun turn-off-mouse (&amp;amp;optional frame)&#xA;  (interactive)&#xA;  (call-process-shell-command &quot;xinput --disable bcm5974&quot;&#xA;                              nil &quot;*Shell command output*&quot; t))&#xA;&#xA;(defun turn-on-mouse (&amp;amp;optional frame)&#xA;  (interactive)&#xA;  (call-process-shell-command &quot;xinput --enable bcm5974&quot;&#xA;                              nil &quot;*Shell command output*&quot; t))&#xA;&#xA;(add-hook 'focus-in-hook #'turn-off-mouse)&#xA;(add-hook 'focus-out-hook #'turn-on-mouse)&#xA;(add-hook 'delete-frame-functions #'turn-on-mouse)&#xA;&#xA;(provide 'setup-xinput)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine; the problem is only when quitting Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I quit Emacs while on Emacs, it keeps my touchpad disabled. So I need to open a new Terminal with the keyboard, and run &lt;code&gt;xinput --enable bcm5974&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any workaround for this? How could I quit Emacs and when quitting re-enabling my touchpad?&lt;/p&gt;&#xA;" OwnerUserId="9669" LastEditorUserId="105" LastEditDate="2016-06-22T20:19:51.677" LastActivityDate="2016-06-22T20:19:51.677" Title="Quitting Emacs and re-enabeling touchpad" Tags="|hooks|exit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16974" PostTypeId="1" AcceptedAnswerId="16975" CreationDate="2015-09-29T03:07:51.403" Score="4" ViewCount="567" Body="&lt;p&gt;The &lt;code&gt;whitespace-mode&lt;/code&gt; has a default mapping from whitespace characters to printable characters:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;U+0020 → U+00B7 “·”&lt;/li&gt;&#xA;&lt;li&gt;U+0009 → U+00BB “»”&lt;/li&gt;&#xA;&lt;li&gt;U+000A → U+0024 “$”&lt;/li&gt;&#xA;&lt;li&gt;etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I change which printable characters are used for each whitespace character? For example, to show “⇒” or “¶”.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="2506" LastActivityDate="2015-09-29T03:31:05.530" Title="Whitespace-mode characters: customise mapping of printable character representations" Tags="|whitespace-mode|buffer-display-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16975" PostTypeId="2" ParentId="16974" CreationDate="2015-09-29T03:25:24.817" Score="4" Body="&lt;p&gt;Customize option &lt;code&gt;whitespace-display-mappings&lt;/code&gt;.  That's what it's for.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-option whitespace-display-mappings RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The doc gives you details (below), but just look at the Customize buffer and things will be even clearer.  You can use &lt;code&gt;C-u C-x =&lt;/code&gt; with the cursor before a given character, to see its Unicode code point.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h v whitespace-display-mappings RET&#xA;&#xA;Specify an alist of mappings for displaying characters.&#xA;&#xA;Each element has the following form:&#xA;&#xA;   (KIND CHAR VECTOR...)&#xA;&#xA;Where:&#xA;&#xA;KIND    is the kind of character.&#xA;        It can be one of the following symbols:&#xA;&#xA;        tab-mark    for TAB character&#xA;&#xA;        space-mark  for SPACE or HARD SPACE character&#xA;&#xA;        newline-mark    for NEWLINE character&#xA;&#xA;CHAR    is the character to be mapped.&#xA;&#xA;VECTOR  is a vector of characters to be displayed in place of CHAR.&#xA;        The first display vector that can be displayed is used;&#xA;        if no display vector for a mapping can be displayed, then&#xA;        that character is displayed unmodified.&#xA;&#xA;The NEWLINE character is displayed using the face given by&#xA;`whitespace-newline' variable.&#xA;&#xA;Used when `whitespace-style' includes `tab-mark', `space-mark' or&#xA;`newline-mark'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-29T03:31:05.530" LastActivityDate="2015-09-29T03:31:05.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16976" PostTypeId="2" ParentId="16973" CreationDate="2015-09-29T04:04:14.277" Score="11" Body="&lt;p&gt;You can use &lt;code&gt;kill-emacs-hook&lt;/code&gt; which is run when emacs is quit 'normally'. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hook run when &lt;code&gt;kill-emacs&lt;/code&gt; is called. Since &lt;code&gt;kill-emacs&lt;/code&gt; may be&#xA;  invoked when the terminal is disconnected (or in other similar&#xA;  situations), functions placed on this hook should not expect to be&#xA;  able to interact with the user.  To ask for confirmation, see&#xA;  &lt;code&gt;kill-emacs-query-functions&lt;/code&gt; instead.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Just add &lt;code&gt;turn-on-mouse&lt;/code&gt; to &lt;code&gt;kill-emacs-hook&lt;/code&gt; like so&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'kill-emacs-hook #'turn-on-mouse)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="11" LastEditDate="2015-09-29T14:50:51.653" LastActivityDate="2015-09-29T14:50:51.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16977" PostTypeId="1" CreationDate="2015-09-29T04:30:33.093" Score="2" ViewCount="1301" Body="&lt;p&gt;How can I setup &lt;code&gt;emacs&lt;/code&gt; to evaluate maxima code from a buffer in &lt;code&gt;maxima-mode&lt;/code&gt; in the &lt;code&gt;*imaxima*&lt;/code&gt; buffer rather than the default &lt;code&gt;*maxima*&lt;/code&gt; one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I can copy and paste the code between buffers, I'm afraid of crashing emacs since my natural use of emacs makes extensive use of frames. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq imaxima-use-maxima-mode-flag t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;following &lt;a href=&quot;https://www.ma.utexas.edu/pipermail/maxima/2009/017685.html&quot; rel=&quot;nofollow&quot;&gt;this email thread&lt;/a&gt; but that only made &lt;code&gt;(imaxima)&lt;/code&gt; start a normal &lt;code&gt;*maxima*&lt;/code&gt; repl.&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2016-02-21T21:36:11.220" Title="How to combine maxima-mode with *imaxima*?" Tags="|comint|maxima|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16978" PostTypeId="2" ParentId="3964" CreationDate="2015-09-29T07:08:10.347" Score="1" Body="&lt;p&gt;In addition to what @erikstokes has mentioned, this feature is also useful to me in the following scenario:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a todo list for things to be done today. I also track scheduled tasks and routines with &quot;SCHEDULED&quot;. Every day, I check both lists in a single agenda view to determine what to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The agenda, however, get cluttered when I put my project plan into the org file because, during project/feature plan, I set SCHEDULED and DEADLINE for each sub-task. Those dates are only part of feature plan, I do not need reminders for them as I just tackle them one after another.So, to keep the agenda view &quot;clean&quot;, I may make use of this feature:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set a delay time for the SCHEDULED attribute, &quot;SCHEDULED: &amp;lt;2015-09-24 Thu -1m&gt;&quot; for example, so that the project tasks will not show up until one month after the scheduled date, but at that time they should already be marked DONE and hence do not show up.&lt;/p&gt;&#xA;" OwnerUserId="9670" LastEditorUserId="9670" LastEditDate="2015-10-08T07:25:29.343" LastActivityDate="2015-10-08T07:25:29.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16979" PostTypeId="1" AcceptedAnswerId="16980" CreationDate="2015-09-29T09:46:28.793" Score="2" ViewCount="192" Body="&lt;p&gt;I have several file level properties (like #+OPTIONS: toc:nil&#xA;) always defined at begin of all my org files. I wonder whether it is possible to make a org template so that all org files I create in emacs will have these properties added automatically?﻿&lt;/p&gt;&#xA;" OwnerUserId="9570" LastActivityDate="2015-09-29T10:44:58.450" Title="how to - org file with file level properties automatically added" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16980" PostTypeId="2" ParentId="16979" CreationDate="2015-09-29T10:44:58.450" Score="2" Body="&lt;p&gt;You could use &lt;code&gt;auto-insert-mode&lt;/code&gt; for that.  Add the following to your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auto-insert-mode 1)&#xA;(add-to-list 'auto-insert-alist '(org-mode nil &quot;#+OPTIONS: toc:nil\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-09-29T10:44:58.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16981" PostTypeId="1" CreationDate="2015-09-29T10:52:50.960" Score="1" ViewCount="780" Body="&lt;p&gt;It's possible to ask completion to not suggest files with particular file extensions, by:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq completion-ignored-extensions&#xA;      (append completion-ignored-extensions&#xA;              (quote&#xA;               (&quot;.o&quot; &quot;.aux&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I'm not able to determine how to pattern-match on regular expressions &lt;em&gt;before&lt;/em&gt; the &quot;.&quot; and not just after it. For example, I don't want files that end with &quot;_flymake.hs&quot; to be suggested by completion modes. How could I accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="9671" LastEditorUserId="105" LastEditDate="2015-09-29T15:24:36.840" LastActivityDate="2015-09-29T15:29:56.103" Title="How to get completion to ignore filename extensions" Tags="|completion|filenames|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16982" PostTypeId="2" ParentId="14706" CreationDate="2015-09-29T11:03:15.027" Score="7" Body="&lt;p&gt;As was pointed out by @phils the &quot;Wrote file&quot; comes from &lt;code&gt;write-region&lt;/code&gt;. If you don't use the &lt;code&gt;inhibit-message&lt;/code&gt; variable introduced in Emacs 25, you could replace the original &lt;code&gt;write-region&lt;/code&gt; with a function that sets &lt;code&gt;VISIT&lt;/code&gt; to neither t nor nil nor a string. As the docstring of &lt;code&gt;write-region&lt;/code&gt; tells us, this will avoid displaying the message. In the following example the &lt;code&gt;write-region&lt;/code&gt; is replaced temporarily using &lt;code&gt;cl-letf&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(fset 'original-write-region (symbol-function 'write-region))&#xA;(defun silent-write-region (start end filename &amp;amp;optional append&#xA;                                  visit lockname mustbenew)&#xA;  &quot;Suppress the \&quot;Wrote file\&quot; message in `write-region'.&quot;&#xA;  (original-write-region start end filename append 'nomsg lockname mustbenew))&#xA;&#xA;(cl-letf (((symbol-function 'write-region)&#xA;           #'silent-write-region))&#xA;  (save-buffer (current-buffer))&#xA;  ;; take care of mtime changes&#xA;  (set-visited-file-modtime)&#xA;  (set-buffer-modified-p nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2015-09-29T16:39:54.387" LastActivityDate="2015-09-29T16:39:54.387" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16983" PostTypeId="1" AcceptedAnswerId="17094" CreationDate="2015-09-29T11:11:51.277" Score="15" ViewCount="2876" Body="&lt;p&gt;I often forget either to clock out of a task, or to clock a different activity in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, I was working on a (clocked) task right now, then my manager walked in and we embarked on a discussion which lasted a good 40 minutes... So not negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to go about this? I would like - if possible - to subtract the time of this discussion from the main task I was working on, and add it to a new activity.&lt;/p&gt;&#xA;" OwnerUserId="9642" LastEditorUserId="253" LastEditDate="2015-09-29T11:54:03.950" LastActivityDate="2021-07-16T17:02:20.903" Title="How to manipulate clock times (org-mode)" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16984" PostTypeId="2" ParentId="16929" CreationDate="2015-09-29T12:12:18.870" Score="-2" Body="&lt;p&gt;Upgrading to the latest Emacs asap is NOT always a good idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Emacs 24.4 has a bug that will make &lt;code&gt;M-x&lt;/code&gt; fail if evil-mode is used (&lt;a href=&quot;https://bitbucket.org/lyro/evil/issues/437/m-x-is-undefined-in-emacs-244&quot; rel=&quot;nofollow&quot;&gt;https://bitbucket.org/lyro/evil/issues/437/m-x-is-undefined-in-emacs-244&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience, it's better to wait 6 months to give third party plugins some buffer time to fix the compatibility issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, if you don't care about the above issue. Here are the easiest way to install from source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install Emacs into your HOME directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mkdir -p ~/myemacs24.5; ./configure --prefix=~/myemacs/24.5 --without-gtk --without-gtk3 --without-aqua --without-x --without-xpm --without-png --without-gif --without-alsa --without-tiff --without-jpeg --without-aqua --without-rsvg --without-xft --without-xaw3d --without-xim --without-xpm --without-dbus --without-makeinfo --with-x-toolkit=no --without-sound --without-sync-input --without-pop;make;make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Install Emacs into default directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --without-gtk --without-gtk3 --without-aqua --without-x --without-xpm --without-png --without-gif --without-alsa --without-tiff --without-jpeg --without-aqua --without-rsvg --without-xft --without-xaw3d --without-xim --without-xpm --without-dbus --without-makeinfo --with-x-toolkit=no --without-sound --without-sync-input --without-pop;make;sudo make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm 100% sure my way will &lt;strong&gt;always&lt;/strong&gt; work because I've been using this way on Ubuntu/Mint/Debian/Centos/Gentoo/ArchLinux for 4 years without any issue.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2015-10-02T00:57:28.497" LastActivityDate="2015-10-02T00:57:28.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16985" PostTypeId="2" ParentId="16983" CreationDate="2015-09-29T13:39:02.983" Score="4" Body="&lt;p&gt;One way to manipulate the time is to clock out, go to the clock entry, and change it with Shift-up and Shift-down.  If point is on the minutes, it will change by 5 minutes for each key press, and if point is on the hours, it will change by one hour for each key press.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-09-29T13:39:02.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16986" PostTypeId="2" ParentId="16981" CreationDate="2015-09-29T13:52:55.010" Score="1" Body="&lt;p&gt;The dot is not special in &lt;code&gt;completion-ignored-extensions&lt;/code&gt;, so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push &quot;_flymake.hs&quot; completion-ignored-extensions)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should do the job.  If it doesn't, then I'd guess that it's either because &lt;code&gt;completion-ignored-extensions&lt;/code&gt; is not used (or used incorrectly) by the completion system you're using, or because all the candidates would be eliminated by &lt;code&gt;completion-ignored-extensions&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-09-29T13:52:55.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16987" PostTypeId="1" CreationDate="2015-09-29T13:56:14.340" Score="0" ViewCount="4123" Body="&lt;p&gt;The logical way should be C-u D to delete selected files permanently. How can we do that?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastActivityDate="2024-03-20T17:47:33.807" Title="How to delete file permanently in dired" Tags="|dired|files|" AnswerCount="2" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="16988" PostTypeId="2" ParentId="16987" CreationDate="2015-09-29T15:12:37.090" Score="2" Body="&lt;p&gt;&lt;code&gt;C-u D&lt;/code&gt; deletes the next 4 files (or moves them to the trash bin, if &lt;code&gt;delete-by-moving-to-trash&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to delete files permanently, then set &lt;code&gt;delete-by-moving-to-trash&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.  Then using &lt;code&gt;D&lt;/code&gt; deletes the next &lt;em&gt;N&lt;/em&gt; files (default 1), and &lt;code&gt;d&lt;/code&gt; flags them for deletion by &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-29T15:12:37.090" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16989" PostTypeId="1" AcceptedAnswerId="17019" CreationDate="2015-09-29T15:20:52.087" Score="0" ViewCount="145" Body="&lt;p&gt;I use the package &lt;code&gt;vimish-fold&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package contains, for example, two functions, called as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function 1&#xA;Function 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a new commit to the package &lt;code&gt;vimish-fold&lt;/code&gt; on Github, which will add the new function 3. But the changes are not reflected yet in MELPA. &#xA;I wanted to try it out, so I upgrade it manually. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made the mistake of changing the contents of the package manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I copied the new code from Github, pasted the new code over the old code in the &lt;code&gt;.el&lt;/code&gt;-file in the same package. And in the same package, I bytecompiled manually the &lt;code&gt;.el&lt;/code&gt;-file in the same directory. So the &lt;code&gt;.elc&lt;/code&gt;-file is also updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After restarting Emacs, I don't see the &lt;code&gt;function 3&lt;/code&gt; appearing when calling the commands lists with &lt;kbd&gt;M-x&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, I deleted the package &lt;code&gt;vimish-fold&lt;/code&gt; in &lt;code&gt;package.el&lt;/code&gt; and reinstalled it. I waited until the update for &lt;code&gt;vimish-fold&lt;/code&gt; appeared in MELPA, and update it with &lt;code&gt;package.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the same Emacs session, the new features of &lt;code&gt;vimish-fold&lt;/code&gt; works fine, like &lt;code&gt;function 3&lt;/code&gt;. But when I restarted Emacs, I see the new commands when I do &lt;kbd&gt;M-x&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function 1&#xA;Function 2&#xA;Function 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I call the &lt;code&gt;function 3&lt;/code&gt;, I get the message &lt;code&gt;&quot;Autoloading failed to define function function 3&quot;&lt;/code&gt; But the &lt;code&gt;function 1&lt;/code&gt; and &lt;code&gt;function 2&lt;/code&gt; works fine, except the new &lt;code&gt;function 3&lt;/code&gt;. So I guess somewhere the old package is still active. Then I remove the package &lt;code&gt;vimish-fold&lt;/code&gt; in &lt;code&gt;package.el&lt;/code&gt;, and reinstall it. In the same Emacs session the &lt;code&gt;function 3&lt;/code&gt; works again. But when I restarted Emacs, &lt;code&gt;Function 3&lt;/code&gt; is visible in the list of all commands, but I get the same error when I call the &lt;code&gt;function 3&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it seems the right package is enabled, but I get the autoloading fail error again. Note this is after deleting and reinstall the same package with the MELPA package manager/paradox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems &lt;a href=&quot;https://emacs.stackexchange.com/questions/14290/projectile-installed-but-autoloading-failed-to-define-function-projectile-mode&quot;&gt;the others also struggled with the same issue. Without any succes&lt;/a&gt;. When I do a grep, I can't find any other same package as &lt;code&gt;vimish-fold&lt;/code&gt;. Notice that I use Windows, and I have my &lt;code&gt;.emacs.d&lt;/code&gt; in my PATH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion in order to solve it?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-09-30T10:16:09.290" Title="Ghost code in Emacs configuration, how to find it?" Tags="|autoload|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16990" PostTypeId="2" ParentId="10055" CreationDate="2015-09-29T15:27:04.350" Score="2" Body="&lt;p&gt;You could put this in &lt;code&gt;dotspacemacs/config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-linum-mode)&#xA;(with-eval-after-load 'linum&#xA;  (linum-relative-toggle))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The relative number line will be by default.&lt;/p&gt;&#xA;" OwnerUserId="9673" LastEditorUserId="105" LastEditDate="2015-09-29T15:37:03.803" LastActivityDate="2015-09-29T15:37:03.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16991" PostTypeId="2" ParentId="16961" CreationDate="2015-09-29T15:29:46.577" Score="14" Body="&lt;p&gt;I have a screen with resolution of 1024X600, but i set the display to 1024X724, here is my solution.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-resize-pixelwise t)&#xA;(set-frame-position (selected-frame) 0 0)&#xA;(set-frame-size (selected-frame) 1024 600 t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastActivityDate="2015-09-29T15:29:46.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16992" PostTypeId="2" ParentId="16981" CreationDate="2015-09-29T15:29:56.103" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does your completion system/mode even support &lt;strong&gt;regexp&lt;/strong&gt; matching? Vanilla Emacs completion does not, out of the box.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At any rate, the patterns in &lt;code&gt;completion-ignored-extensions&lt;/code&gt; are not regexps.  They are not even filename glob patterns.  They are literal text that file names must match at their ends.  In particular, the &lt;code&gt;.&lt;/code&gt; is not special, but matches a literal &lt;code&gt;.&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Adding &lt;code&gt;&quot;_flymake.hs&quot;&lt;/code&gt; to &lt;code&gt;completion-ignored-extensions&lt;/code&gt; &lt;em&gt;should&lt;/em&gt; make completion ignore file names that end in that literal suffix.  E.g., file name &lt;code&gt;&quot;foo_flymake.hs&quot;&lt;/code&gt; should be ignored (not available as a completion candidates). Is this not what you see?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Provide a recipe to reproduce your problem, given knowledge of #1-3, above.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-29T15:29:56.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16993" PostTypeId="1" CreationDate="2015-09-29T16:06:55.403" Score="3" ViewCount="248" Body="&lt;p&gt;In Common Lisp, there is&#xA;&lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Body/f_cons_1.htm&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;constantly&lt;/code&gt;&lt;/a&gt;&#xA;function, which creates new function without side-effects that takes any&#xA;number of arguments and always returns specified value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason &lt;code&gt;cl-lib&lt;/code&gt; doesn't provide &lt;code&gt;cl-constantly&lt;/code&gt;, so I guess it&#xA;should exist in pure Emacs Lisp under different name. Do you know that name?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Please don't post answers showing how to achieve effect of &lt;code&gt;constantly&lt;/code&gt; manually (and how to define such function), since it's absolutely trivial. This question about name of already existing function. If there is no such function, a comment about the fact will do. I've sent a bug report asking to add the function.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="105" LastEditDate="2016-06-22T20:19:29.643" LastActivityDate="2016-06-22T20:19:29.643" Title="Where is cl-constantly and what to use instead?" Tags="|cl-lib|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16994" PostTypeId="2" ParentId="16993" CreationDate="2015-09-29T16:24:47.817" Score="1" Body="&lt;p&gt;There is no predefined Emacs-Lisp function for this, as far as I know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a definition - the same as is shown in the &lt;a href=&quot;http://clhs.lisp.se/Body/f_cons_1.htm&quot; rel=&quot;nofollow&quot;&gt;Common Lisp standard&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun constantly (object)&#xA;  (lambda (&amp;amp;rest arguments) object))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You need to have &lt;code&gt;lexical-binding&lt;/code&gt; turned on (non-&lt;code&gt;nil&lt;/code&gt;) for that definition. If you have it turned off (&lt;code&gt;nil&lt;/code&gt;) then you can use this definition instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun constantly (object)&#xA;  `(lambda (&amp;amp;rest arguments) ',object))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-09-29T16:24:47.817" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16995" PostTypeId="1" AcceptedAnswerId="16999" CreationDate="2015-09-29T16:33:17.330" Score="8" ViewCount="748" Body="&lt;p&gt;I am very used to typing in a shell something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient **/Threshold.java&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;Threshold.java&lt;/code&gt; is a file deeply nested in a directory and I just want to&#xA;open it by name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try the same thing in eshell, I get (ec is an alias for &lt;code&gt;find-file&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ec **/Threshold.java&#xA;Wrong type argument: stringp, (&quot;src/main/java/org/elasticsearch/shield/admin/Threshold.java&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get this working in eshell?&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="25" LastEditDate="2015-09-29T21:18:58.983" LastActivityDate="2017-07-04T06:36:42.293" Title="How to open files in eshell with wildcards" Tags="|eshell|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16996" PostTypeId="2" ParentId="16989" CreationDate="2015-09-29T16:52:23.370" Score="0" Body="&lt;p&gt;To install a package from a package file (in your case, that is &lt;code&gt;vimish-fold.el&lt;/code&gt;) with &lt;code&gt;package.el&lt;/code&gt;, you can use &lt;code&gt;package-install-from-buffer&lt;/code&gt; or &lt;code&gt;package-install-file&lt;/code&gt;. It will byte-compile elisp code AND create an autoload file correspondingly. Thus, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I bytecompiled manually the .el-file in the same directory. So the .elc-file is also updated.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is not enough, then it will happen:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;After restarting Emacs, I don't see the function 3 appearing when calling the commands lists with M-x.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;While using &lt;code&gt;pakckage.el&lt;/code&gt;, for safety, you usually need to keep only one specific version and can activate only one specific version, so remove duplicate package of different versions if you have. and don't install package again manually, that is, put &lt;code&gt;vimish-fold.el&lt;/code&gt; into somewhere of your &lt;code&gt;load-path&lt;/code&gt; by yourself.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I don't understand your other questions.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-09-29T16:52:23.370" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16997" PostTypeId="2" ParentId="16995" CreationDate="2015-09-29T16:58:27.200" Score="4" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mapcar #'find-file **/Threshold.java&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This only works if &lt;code&gt;**/Threshold.java&lt;/code&gt; expands to exactly one file. Otherwise, the second file will be opened through a relative path, but based on the directory of the first file instead of the directory where the command was executed.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-09-29T16:58:27.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16998" PostTypeId="2" ParentId="16939" CreationDate="2015-09-29T17:46:07.000" Score="3" Body="&lt;p&gt;So it looks like mixed Org installation is to blame. It appears that &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#mixed-install&quot; rel=&quot;nofollow&quot;&gt;Org FAQ&lt;/a&gt; has something to say on this subject:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;Is my Orgmode installation mixed?&lt;/h1&gt;&#xA;  &#xA;  &lt;p&gt;Emacs is distributed with a version of Orgmode bundled with it. A common problem among users who install a newer version of Orgmode separately is a mixed install where Emacs loads some files from the bundled and the rest from the latest version. This can lead to unending troubles in the future. With a recent installation of Org mode &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;org-version&lt;/code&gt; will indicate if the installation is mixed.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With somewhat older Org mode installations, the procedure is more involved and indeterminate. An easy first step is to look at the output of &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;org-version&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;Good&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org-mode version 7.8.11 (release_7.8.11-448-g1737d3 @ /path/to/org-mode/lisp/)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Bad&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org-mode version 6.33x (release_7.8.11.409.ga3778)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;A second step is to go through the output of &lt;code&gt;list-load-path-shadows&lt;/code&gt; line-by-line to get hints to what in your configuration is causing the issue. Among the most common reasons is Orgmode gets loaded before the load-path variable is updated to include the installation directory of the latest Orgmode. To avoid issues like this, it is recommended that the load path is updated very early on in your init file.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note: The formatting of the version information, as shown in the examples above, will be different for older Org mode releases, e.g. Org-mode version 7.8.02.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-09-29T17:46:07.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16999" PostTypeId="2" ParentId="16995" CreationDate="2015-09-29T17:49:06.190" Score="8" Body="&lt;pre&gt;&lt;code&gt;(defun eshell/my-find-file (pattern)&#xA;  (mapc #'find-file (mapcar #'expand-file-name pattern)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then use &lt;code&gt;my-find-file **/Threshold.java&lt;/code&gt; from Eshell, if you also want &lt;code&gt;my-find-file&lt;/code&gt; to support non-glob pattern (for example, &lt;code&gt;my-find-file Threshold.java&lt;/code&gt;), try following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eshell/my-find-file (pattern)&#xA;  (if (stringp pattern)&#xA;      (find-file pattern)&#xA;    (mapc #'find-file (mapcar #'expand-file-name pattern))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-09-29T17:49:06.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17000" PostTypeId="2" ParentId="16993" CreationDate="2015-09-29T17:57:39.477" Score="0" Body="&lt;p&gt;You can usually avoid the use of &lt;code&gt;constantly&lt;/code&gt; by writing the equivalent lambda-term inline.  For example, in Common Lisp you could generate a list of 42s of the same length as a given list with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar (constantly 42) '(1 2 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs Lisp, you can do just the same with an explicit lambda-term:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar #'(lambda (_) 42) '(1 2 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Barely longer, and much clearer in my opinion.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-09-29T17:57:39.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17002" PostTypeId="1" CreationDate="2015-09-29T20:35:17.887" Score="3" ViewCount="317" Body="&lt;p&gt;I just started to get into using emacs org-mode, and was wondering if this is possible. I put the scheduled in brackets in the title as I am not specifically interested only in timestamps which are &quot;scheduled&quot; in an org-mode sense, but was hoping this would work with any timestamp. I imagine that I include something like the following in my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-log-note-headings '((state . &quot;%s %t for %Q&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;%Q&lt;/code&gt; should represent the day the task was actually scheduled, but have no idea what I would have to use here (and if this is possible at all). In the org file I would then have a entry like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO My task&#xA;  Next occurrence:&#xA;  &amp;lt;2015-10-02 Fri +1d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which should when changing the state to DONE change to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO My task&#xA;  - &quot;DONE&quot; [2015-09-30] for &amp;lt;2015-10-02 Fri&amp;gt;&#xA;    Notes on this...&#xA;  Next occurrence: &#xA;  &amp;lt;2015-10-03 Sat +1d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An alternative I would also be happy with would be to have a function that shifts a recurring time stamp once by its rule (so in this case by one day) and inserts the corresponding note at the beginning so which would simply change the first example to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO My task&#xA;  - &amp;lt;2015-10-02&amp;gt; ...&#xA;  Next occurrence:&#xA;  &amp;lt;2015-10-03 Sat +1d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but here I have no idea how to start... Any suggestions appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;Ok, based on this: &lt;a href=&quot;https://emacs.stackexchange.com/questions/9433/how-to-make-org-prompt-for-a-timestamp-when-changing-state-of-a-todo&quot;&gt;How to make org prompt for a timestamp, when changing state of a TODO?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I achieved a behaviour close to what I was looking for, using two functions &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-todo-with-deadline (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (cl-letf* ((my-current-time (org-get-deadline-time nil))&#xA;            ((symbol-function #'org-current-effective-time)&#xA;             #'(lambda () my-current-time)))&#xA;    (org-todo arg)&#xA;    )) &#xA;&#xA;(defun org-todo-with-schedule (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (cl-letf* ((my-current-time (org-get-scheduled-time nil))&#xA;            ((symbol-function #'org-current-effective-time)&#xA;             #'(lambda () my-current-time)))&#xA;    (org-todo arg)&#xA;    )) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at least this works for SCHEDULED and DEADLINE marked entries, respectively. The downside is that it is not possible anymore to include the date when the state is changed (because this is temporally overwritten here) and it does not work with plain timestamps. &lt;/p&gt;&#xA;" OwnerUserId="9674" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-12-22T00:45:26.623" Title="Add actual (scheduled) date in log for state change in org-mode" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17003" PostTypeId="2" ParentId="16993" CreationDate="2015-09-29T22:15:07.707" Score="7" Body="&#xA;&#xA;&lt;p&gt;There is no &lt;code&gt;constantly&lt;/code&gt; equivalent in Emacs (except &lt;code&gt;ignore&lt;/code&gt; is like &lt;code&gt;(constantly nil)&lt;/code&gt;), but dash provides one called &lt;a href=&quot;https://github.com/magnars/dash.el#-const-c&quot;&gt;&lt;code&gt;-const&lt;/code&gt;&lt;/a&gt; as part of the &lt;code&gt;dash-functional&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h3&gt;-const &lt;code&gt;(c)&lt;/code&gt;&lt;/h3&gt;&#xA;  &#xA;  &lt;p&gt;Return a function that returns &lt;code&gt;c&lt;/code&gt; ignoring any additional arguments.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In types: a -&gt; b -&gt; a&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(funcall (-const 2) 1 3 &quot;foo&quot;) ;; =&amp;gt; 2&#xA;(-map (-const 1) '(&quot;a&quot; &quot;b&quot; &quot;c&quot; &quot;d&quot;)) ;; =&amp;gt; '(1 1 1 1) &#xA;(-sum (-map (-const 1) '(&quot;a&quot; &quot;b&quot; &quot;c&quot; &quot;d&quot;))) ;; =&amp;gt; 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-09-29T22:15:07.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17004" PostTypeId="2" ParentId="13823" CreationDate="2015-09-29T23:30:19.417" Score="0" Body="&lt;p&gt;The reason for this occurrence was quite simple. I assumed that both flake8 and pylint were running together but in reality only flake8 was running as the flycheck's syntax checker. I changed it to python-pylint and now it works as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this, just type &lt;code&gt;M-x flycheck-select-checker&lt;/code&gt; and enter &lt;code&gt;python-pylint&lt;/code&gt; (make sure you install pylint for flycheck from melpa first)&lt;/p&gt;&#xA;" OwnerUserId="8667" LastActivityDate="2015-09-29T23:30:19.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17005" PostTypeId="1" AcceptedAnswerId="17006" CreationDate="2015-09-30T00:50:29.780" Score="2" ViewCount="817" Body="&lt;p&gt;Whenever I kill an ansi-term buffer I have to confirm due to the fact of:&#xA;&quot;ansi-term has a running process; kill it ?&quot;, (even if nothing is running btw).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I have Emacs killing the term without requiring this confirmation regardless of active processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="9675" LastActivityDate="2015-09-30T01:42:28.990" Title="Killing ansi-term says: &quot;... has a running process&quot;" Tags="|ansi-term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17006" PostTypeId="2" ParentId="17005" CreationDate="2015-09-30T01:42:28.990" Score="5" Body="&lt;p&gt;Try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-no-process-query-on-exit ()&#xA;  (let ((proc (get-buffer-process (current-buffer))))&#xA;    (when (processp proc)&#xA;      (set-process-query-on-exit-flag proc nil))))&#xA;&#xA;(add-hook 'term-exec-hook 'set-no-process-query-on-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2015-09-30T01:42:28.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17007" PostTypeId="2" ParentId="16323" CreationDate="2015-09-30T02:30:08.693" Score="3" Body="&lt;p&gt;The code &lt;code&gt;git-status-in-modeline&lt;/code&gt; assumes &lt;code&gt;vc&lt;/code&gt; has already been activated in the buffer it is working in. The issue was that the function was added to the start of &lt;code&gt;find-file-hook&lt;/code&gt;, as such it was run before &lt;code&gt;vc-find-file-hook&lt;/code&gt; (function which sets up &lt;code&gt;vc-mode&lt;/code&gt; for a file) had any chance of setting up &lt;code&gt;vc-mode&lt;/code&gt; in the file. Appending &lt;code&gt;git-status-in-modeline&lt;/code&gt; (so that it runs after &lt;code&gt;vc-find-file-hook&lt;/code&gt;) solves the problem&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'find-file-hook 'git-status-in-modeline t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-09-30T02:30:08.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17008" PostTypeId="1" CreationDate="2015-09-30T02:36:03.307" Score="2" ViewCount="232" Body="&lt;p&gt;There are many wonderful markup languages.  For example here are some of their file extensions: nroff, md, tex, org, info, rtf, ps, html, etc. etc.  We love them all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most cases I visit these files with no intention of editing their content.  I'd prefer to see them rendered by the tools that handle them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question -  Is there a lovely solution for this.  For example, something that wraps advice around the existing modes for each of these (possibly using pandoc?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm slowly puzzling out how to add entries to auto-mode-alist.  This is tedious and feels quite bogus.  Some of these entries are just odd - for example (add-to-list 'auto-mode-alist '(&quot;\\.info\\'&quot; . Info-on-current-buffer)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example your view of this question is rendered markdown, if you want to see it raw you can, but that's a rare desire.  For example most markup formats are displayed rendered in github, if you want the source you can hit the raw button.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question, desire?, is has somebody already assembled an library that enhances some or all the major modes for markup languages to default to a more human oriented view?&lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="2014" LastEditDate="2023-03-04T10:42:29.923" LastActivityDate="2023-03-04T10:42:29.923" Title="Raw v.s. Rendered - how to modify the mode for various markup languages so they render nicely, rather than as source" Tags="|markdown|info|markup|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="17009" PostTypeId="2" ParentId="17008" CreationDate="2015-09-30T04:49:37.290" Score="2" Body="&lt;p&gt;Partly for the purposes of clarification, and partly because it's built-in (to Emacs 24+) and therefore a trivial example, my impression is that you're after something roughly along these lines?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-html-render-current-buffer ()&#xA;  &quot;Render HTML in current buffer using `shr-render-buffer'.&quot;&#xA;  (require 'shr)&#xA;  (shr-render-buffer (current-buffer)))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.html\\'&quot; . my-html-render-current-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can you elaborate on the question/requirement with reference to this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Actually, I realise now that your Info line was already an example of what you were after. (I originally mistook that as a comment on existing &lt;code&gt;auto-mode-alist&lt;/code&gt; entries.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.info\\'&quot; . Info-on-current-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-09-30T05:09:12.433" LastActivityDate="2015-09-30T05:09:12.433" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17010" PostTypeId="1" AcceptedAnswerId="17015" CreationDate="2015-09-30T04:51:23.397" Score="2" ViewCount="1335" Body="&lt;p&gt;I'm a emacs beginner, hope this not a stupid question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the issue: when I open a html file that contains php block, every html thing got correct syntax highlight, but the php block. The web-mode version is 12.2.10, and emacs is 24.5.1. And when I open a php file contains html codes, everything works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is my web-mode configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'web-mode)&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.phtml\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.tpl\\.php\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.[agj]sp\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.as[cp]x\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.erb\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.mustache\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.djhtml\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.html?\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.html$&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.php\\'&quot; . web-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.php$&quot; . web-mode))&#xA;&#xA;(setq web-mode-engines-alist&#xA;      '((&quot;php&quot;    . &quot;\\.phtml\\'&quot;)&#xA;        (&quot;blade&quot;  . &quot;\\.blade\\.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Z01kS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Z01kS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What else should I do to make this right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="9678" LastEditorUserId="10" LastEditDate="2015-09-30T06:52:01.353" LastActivityDate="2016-05-26T15:51:11.480" Title="In web-mode PHP block in HTML file doesn't syntax highlight" Tags="|web-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17011" PostTypeId="1" AcceptedAnswerId="17013" CreationDate="2015-09-30T05:42:36.100" Score="1" ViewCount="411" Body="&lt;p&gt;I'm currently using org-mode to organize my init files — specifically, working off a fork of &lt;a href=&quot;http://eschulte.github.com/emacs24-starter-kit/&quot; rel=&quot;nofollow&quot;&gt;emacs24-starter-kit&lt;/a&gt;. Recently, I had come across the idea of using org-tables to organize some of my things — I've had great success in configuring &lt;code&gt;package-archive&lt;/code&gt;, &lt;code&gt;package-pinned-packages&lt;/code&gt; and even &lt;code&gt;pretty-symbols-alist&lt;/code&gt; for &lt;code&gt;elisp-mode&lt;/code&gt; and &lt;code&gt;lisp-interaction-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've hit a snag, though, in trying to create a list of packages that &lt;em&gt;must&lt;/em&gt; be installed on every instance of emacs I use, on all machines I have emacs installed. The code looks like this on org-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME:package-settings&#xA;| name               | repository   |&#xA;|--------------------+--------------|&#xA;| dired+             | MELPA        |&#xA;| form-feed          | MELPA-stable |&#xA;| org-bullets        | MELPA-stable |&#xA;| org-plus-contrib   | org          |&#xA;| powerline          | MELPA-stable |&#xA;| rainbow-delimiters | MELPA-stable |&#xA;| yasnippet          | MELPA-stable |&#xA;| color-theme        | MELPA        |&#xA;&#xA;#+begin_src emacs-lisp :var name=package-settings[,0] repository=package-settings[,1]&#xA;  (when (require 'package nil 'noerror)&#xA;    (progn&#xA;      (require 'cl)&#xA;      (setq package-pinned-packages (pairlis name repository))&#xA;      (setq *pkg-to-install&#xA;            (let (result)&#xA;              (dolist (entry name result)&#xA;                (setq result (append result (list (make-symbol entry)))))))&#xA;      (dolist (pkg *pkg-to-install)&#xA;        (when (not (package-installed-p pkg))&#xA;          (package-install pkg)))&#xA;      (package-initialize))) ; and reinitialize again&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I do this, I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;package-compute-transaction: Package `dired+-' is unavailable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;code&gt;C-x C-e&lt;/code&gt; on the affected sexp (i.e. &lt;code&gt;(dolist pkg...&lt;/code&gt;) gets me this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Package `dired+-' is unavailable&quot;)&#xA;  signal(error (&quot;Package `dired+-' is unavailable&quot;))&#xA;  error(&quot;Package `%s-%s' is unavailable&quot; dired+ &quot;&quot;)&#xA;  package-compute-transaction(nil ((dired+)))&#xA;  package-install(dired+)&#xA;  (progn (package-install pkg))&#xA;  (if (not (package-installed-p pkg)) (progn (package-install pkg)))&#xA;  (while --dolist-tail-- (setq pkg (car --dolist-tail--)) (if (not  (package-installed-p pkg)) (progn (package-install pkg))) (setq --dolist-tail-- (cdr --dolist-tail--)))&#xA;  (let ((--dolist-tail-- *pkg-to-install) pkg) (while --dolist-tail-- (setq pkg (car --dolist-tail--)) (if (not (package-installed-p pkg)) (progn (package-install pkg))) (setq --dolist-tail-- (cdr --dolist-tail--))))&#xA;  eval((let ((--dolist-tail-- *pkg-to-install) pkg) (while --dolist-tail-- (setq pkg (car --dolist-tail--)) (if (not (package-installed-p pkg)) (progn (package-install pkg))) (setq --dolist-tail-- (cdr --dolist-tail--)))) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I honestly don't know what could be wrong here. I managed to finangle the fact that &lt;code&gt;org-babel&lt;/code&gt; exports the vars as &lt;code&gt;(let ((name (quote (&quot;dired+&quot; &quot;form-feed&quot; ...)))...)...)&lt;/code&gt; by using &lt;code&gt;make-symbol&lt;/code&gt;, but I've hit the limit in terms of my (admittedly still rather sketchy at places) understanding of elisp.&lt;/p&gt;&#xA;" OwnerUserId="5509" LastActivityDate="2015-09-30T06:37:49.450" Title="org-babel, org-table and package-install: “Package `dired+-' is unavailable" Tags="|package|org-babel|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17013" PostTypeId="2" ParentId="17011" CreationDate="2015-09-30T06:37:49.450" Score="2" Body="&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :var name=package-settings[,0] repository=package-settings[,1]&#xA;  (require 'package)&#xA;  (require 'cl-lib)&#xA;&#xA;  (setq package-pinned-packages (cl-pairlis name repository))&#xA;&#xA;  (let ((pkgs (mapcar #'intern name)))&#xA;    (mapc (lambda (pkg)&#xA;            (unless (package-installed-p pkg)&#xA;              (unless (assoc pkg package-archive-contents)&#xA;                (package-refresh-contents))&#xA;              (package-install pkg)))&#xA;          pkgs))&#xA;&#xA;  (package-initialize)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-09-30T06:37:49.450" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17014" PostTypeId="1" CreationDate="2015-09-30T06:38:58.450" Score="0" ViewCount="464" Body="&lt;p&gt;All I want to do is enable &lt;code&gt;tern-mode&lt;/code&gt;, when I enter &lt;code&gt;js-mode&lt;/code&gt;.  I know that a hook called &lt;code&gt;js-mode&lt;/code&gt; is run when I open a javascript file but for some reason &lt;code&gt;tern-mode&lt;/code&gt; is not enabled.  In my init.el file I have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'js2-mode-hook (lambda () ('tern-mode)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'js2-mode-hook (lambda () (tern-mode t)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as well as both of those with &lt;code&gt;js-mode-hook&lt;/code&gt; (This was mostly for fun though because it makes no difference, see the comments)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'js-mode-hook 'tern-mode)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this does't work.  However, &lt;code&gt;tern-mode&lt;/code&gt; does not get enabled when I enter &lt;code&gt;js2-mode&lt;/code&gt;.  To enable it, each time I have to press &lt;code&gt;M-x tern-mode&lt;/code&gt;, then it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything I am doing wrong here?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="205" LastEditDate="2015-09-30T15:36:44.947" LastActivityDate="2016-09-04T15:00:48.347" Title="How do I enable a mode, when another mode runs?" Tags="|hooks|major-mode|minor-mode|tern|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17015" PostTypeId="2" ParentId="17010" CreationDate="2015-09-30T08:08:18.313" Score="5" Body="&lt;p&gt;You should add &lt;code&gt;(setq web-mode-engines-alist '((&quot;php&quot; . &quot;\\.html\\'&quot;)))&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt;. Indeed, web-mode.el can not guess the template engine with such a generic extension. You can find more informations about &lt;code&gt;web-mode-engines-alist&lt;/code&gt; on &lt;a href=&quot;http://web-mode.org&quot; rel=&quot;noreferrer&quot;&gt;http://web-mode.org&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="197" LastActivityDate="2015-09-30T08:08:18.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17016" PostTypeId="1" AcceptedAnswerId="17679" CreationDate="2015-09-30T08:59:18.500" Score="2" ViewCount="565" Body="&lt;p&gt;Here an org-mode tree&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TEST &#xA; * SUB1&#xA;  * SUB11&#xA;   * SUB111&#xA;   * SUB112&#xA;  * SUB12&#xA; * SUB2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the tree is partially fold you can have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TEST &#xA; * SUB1&#xA;  * SUB11&#xA;  * SUB12&#xA; * SUB2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a command for (un)folding SUB1 without unfolding SUB11 (like org-cycle) with tab on SUB1 ?&#xA;an org-fold-unfold-this-subtree function ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-10-27T15:42:08.090" Title="Close sub-heading in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17017" PostTypeId="1" CreationDate="2015-09-30T09:35:56.613" Score="0" ViewCount="139" Body="&lt;p&gt;I have emacs 24.5.1 on Xubuntu 14.04. I want to install the latest version of the &lt;code&gt;org&lt;/code&gt; package available in GNU ELPA (20150929). Following the &lt;a href=&quot;http://orgmode.org/manual/Installation.html#Installation&quot; rel=&quot;nofollow&quot;&gt;advice&lt;/a&gt; on org-mode website, I launch emacs with the &lt;code&gt;-q&lt;/code&gt; option: &lt;code&gt;$ emacs -q&lt;/code&gt;. Then, I do &lt;code&gt;M-x list-packages&lt;/code&gt; and install &lt;code&gt;org&lt;/code&gt;. By default, it ends up being installed in &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in my &lt;code&gt;~/.emacs&lt;/code&gt;, I have &lt;code&gt;(setq package-user-dir &quot;~/.emacs.d/lisp/&quot;)&lt;/code&gt;. Therefore, with &lt;code&gt;emacs -q&lt;/code&gt;, how can I change the value of this variable?&lt;/p&gt;&#xA;" OwnerUserId="9680" LastActivityDate="2015-09-30T09:35:56.613" Title="get/set package user-dir before installing org-mode" Tags="|org-mode|package|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17018" PostTypeId="1" CreationDate="2015-09-30T09:46:04.003" Score="1" ViewCount="47" Body="&lt;p&gt;I am using Auctex+SumatraPDF on Windows now. I have set them working well, except a small annoying thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every time I do the inverse search from SumatraPDF to Emacs, a Windows command window show up and disappear soon. I've already used --no-wait option in SumatraPDF, but still I can't get rid of the black window completely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything I can do to remove it completely, though it is not a big deal.&lt;/p&gt;&#xA;" OwnerUserId="9681" LastActivityDate="2015-09-30T09:46:04.003" Title="Auctex+sumatraPDF on Windows inverse search. want to remove the CMD windows" Tags="|auctex|pdf|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17019" PostTypeId="2" ParentId="16989" CreationDate="2015-09-30T10:16:09.290" Score="0" Body="&lt;p&gt;This issue of &quot;Autoloading failed to define function&quot; is solved now. Try &lt;code&gt;M-x list-load-path-shadows&lt;/code&gt; to get a clue which packages are conflicting. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-09-30T10:16:09.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17021" PostTypeId="2" ParentId="751" CreationDate="2015-09-30T11:59:09.480" Score="8" Body="&lt;p&gt;I'd like to add some extras that I sometimes use with &lt;code&gt;multiple-cursors&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found the following to be useful:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;iy-go-to-char&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Sometimes, you find yourself needing to move to the next &lt;code&gt;#&lt;/code&gt; or the next &lt;code&gt;,&lt;/code&gt; or some specific delimiter. This is especially handy when you need to move across different numbers of words for each cursor.&#xA;It provides the functions &lt;code&gt;iy-go-to-char&lt;/code&gt; and &lt;code&gt;iy-go-to-char-backward&lt;/code&gt;, which you can bind and use nicely.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;expand-region&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is really useful for similar reason to &lt;code&gt;iy&lt;/code&gt; - when you've got slightly different lines under each cursor, and you maybe want to select the quoted string under the point or similar.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;custom stuff&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;These are things that are just elisp in my config, but I find useful. Probably not written by me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Prompt for input&lt;/strong&gt;&lt;br&gt;&#xA;I got this one from Magnars in response to a request for putting a different string under each cursor. The code is simple, but binding it to something and using for multiple cursors is a handy way to insert slightly different stuff in each place.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun prompt-for-insert ()&#xA;  (interactive)&#xA;  (insert (read-string &quot;Insert: &quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Increment number at point&lt;/strong&gt;&lt;br&gt;&#xA;This either came from SO, or emacswiki. Not sure which.&#xA;It's pretty useful on its own, and also when used in combination with &lt;code&gt;mc/insert-numbers&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-increment-number-decimal (&amp;amp;optional arg)&#xA;  &quot;Increment the number forward from point by 'arg'.&quot;&#xA;  (interactive &quot;p*&quot;)&#xA;  (save-excursion&#xA;    (save-match-data&#xA;      (let (inc-by field-width answer)&#xA;        (setq inc-by (if arg arg 1))&#xA;        (skip-chars-backward &quot;0123456789&quot;)&#xA;        (when (re-search-forward &quot;[0-9]+&quot; nil t)&#xA;          (setq field-width (- (match-end 0) (match-beginning 0)))&#xA;          (setq answer (+ (string-to-number (match-string 0) 10) inc-by))&#xA;          (when (&amp;lt; answer 0)&#xA;            (setq answer (+ (expt 10 field-width) answer)))&#xA;          (replace-match (format (concat &quot;%0&quot; (int-to-string field-width) &quot;d&quot;)&#xA;                                 answer)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;eval-and-replace&lt;/strong&gt;&lt;br&gt;&#xA;This is super powerful, and enables some really useful bits 'n' pieces. It evaluates whatever sexp is behind the cursor, and inserts the result of evaluating it.&lt;br&gt;&#xA;Combine it with &lt;code&gt;multiple-cursors-numbers&lt;/code&gt; to e.g. insert powers of two, or a series that goes &lt;code&gt;0 1 2 0 1 2 0 1 2&lt;/code&gt; across each line or something. (I've done both of these usefully)&#xA;Or use it with &lt;code&gt;s.el&lt;/code&gt; to write out those tedious java config with default things. You write out each &lt;code&gt;CONFIG_VALUE_VARIABLE&lt;/code&gt;, then transform that into &lt;code&gt;CONFIG_VALUE_VARIABLE = &quot;configValueVariable&quot;&lt;/code&gt; by running &lt;code&gt;s-camel-case&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eval-and-replace ()&#xA;  (interactive)&#xA;  (let ((value (eval (preceding-sexp))))&#xA;    (kill-sexp -1)&#xA;    (insert (format &quot;%s&quot; value))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="503" LastActivityDate="2015-09-30T11:59:09.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17022" PostTypeId="1" CreationDate="2015-09-30T13:34:20.107" Score="2" ViewCount="368" Body="&lt;p&gt;I'd like to transform:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;function arg(a,b,c){}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;function arg( a, b, c ){}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this or set it as part of &lt;em&gt;c style&lt;/em&gt; auto indentation? So it will happen when editing JavaScript, C++, etc?&lt;/p&gt;&#xA;" OwnerUserId="9683" LastEditorUserId="25" LastEditDate="2015-11-30T21:29:52.407" LastActivityDate="2015-11-30T21:29:52.407" Title="Added spaces between function arguments" Tags="|indentation|cc-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17023" PostTypeId="2" ParentId="17022" CreationDate="2015-09-30T14:06:59.547" Score="0" Body="&lt;p&gt;If &lt;a href=&quot;http://astyle.sourceforge.net/astyle.html#_Bracket_Style_Options&quot; rel=&quot;nofollow noreferrer&quot;&gt;Artistic Style (astyle)&lt;/a&gt; is installed outside emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun astyle-this-buffer (pmin pmax)&#xA;  (interactive &quot;r&quot;)&#xA;  (shell-command-on-region pmin pmax&#xA;                           &quot;astyle --pad-oper --pad-paren-in&quot; ;; add options here...&#xA;                           (current-buffer) t &#xA;                           (get-buffer-create &quot;*Astyle Errors*&quot;) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Reference&lt;/em&gt;&lt;br&gt;&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/801983/how-do-i-use-astyle-within-emacs&quot;&gt;https://stackoverflow.com/questions/801983/how-do-i-use-astyle-within-emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On OSX I installed astyle with &lt;code&gt;brew install astyle&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9683" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-09-30T14:06:59.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17024" PostTypeId="1" CreationDate="2015-09-30T15:15:41.133" Score="0" ViewCount="108" Body="&lt;p&gt;When I command eval-region to a highlighted area, I would like to quickly change to another buffer with &lt;code&gt;C-x b&lt;/code&gt; to see the result. However, the first part of this key combination cuts the selected code, even when another shortcut &lt;code&gt;M-x&lt;/code&gt; does the same thing. Is there a way to disable the keybinding for &lt;code&gt;C-x&lt;/code&gt; wihtout losing the associated functionality of &lt;code&gt;C-x b&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="9687" LastEditorUserId="3972" LastEditDate="2016-03-14T21:32:57.147" LastActivityDate="2016-03-14T21:32:57.147" Title="Ergoemacs cuts selected region when I try to change buffer" Tags="|key-bindings|ergoemacs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17025" PostTypeId="2" ParentId="17024" CreationDate="2015-09-30T15:35:09.543" Score="-1" Body="&lt;p&gt;Maybe you have CUA-mode enable so you can do:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(setq cua-enable-cua-keys nil)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-09-30T15:35:09.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17026" PostTypeId="2" ParentId="17024" CreationDate="2015-09-30T15:50:50.440" Score="1" Body="&lt;p&gt;Ergoemacs binds &lt;code&gt;C-x&lt;/code&gt; to &lt;code&gt;kill-region&lt;/code&gt; by default.  You can free &lt;code&gt;C-x&lt;/code&gt; and &lt;code&gt;C-c&lt;/code&gt; by evaluating:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ergoemacs-handle-ctl-c-or-ctl-x 'only-C-c-and-C-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could tweak &lt;code&gt;ergoemacs-ctl-c-or-ctl-x-delay&lt;/code&gt;.  &lt;code&gt;C-c&lt;/code&gt; and &lt;code&gt;C-x&lt;/code&gt; work like the default Emacs keybindings only if you press another key within the specified delay (which is set to 0.2 seconds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information can be found here:&#xA;&lt;a href=&quot;http://ergoemacs.github.io/cua-conflict.html&quot; rel=&quot;nofollow&quot;&gt;http://ergoemacs.github.io/cua-conflict.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-09-30T15:50:50.440" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17027" PostTypeId="1" CreationDate="2015-09-30T16:02:50.727" Score="0" ViewCount="239" Body="&lt;p&gt;The output of certain commands in multiple major modes (&lt;strong&gt;term-mode&lt;/strong&gt;, &lt;strong&gt;ansi-term&lt;/strong&gt;, &lt;strong&gt;shell&lt;/strong&gt;, &lt;strong&gt;eshell&lt;/strong&gt;) is incorrectly spaced (see images). This occurs for numerous commands and does not occur in other emulators (such as &lt;strong&gt;xterm&lt;/strong&gt;) or a &lt;strong&gt;tty&lt;/strong&gt;. It even happens when I've launched Emacs &lt;em&gt;without&lt;/em&gt; loading an init file (using the -q flag). Does anyone know what might be causing this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I've also tried adding colors to &lt;code&gt;less&lt;/code&gt; (through &lt;a href=&quot;https://wiki.archlinux.org/index.php/Man_page#Colored_man_pages&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;bash&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/a/1257467/3491710&quot;&gt;&lt;code&gt;zsh&lt;/code&gt;&lt;/a&gt;) to no avail within &lt;strong&gt;Emacs&lt;/strong&gt; but it works perfectly within &lt;strong&gt;xterm&lt;/strong&gt;. I believe this is the same issue but hopefully it'll help someone help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4qa24.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4qa24.png&quot; alt=&quot;Odd spacing of Emacs output&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NFPd2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NFPd2.png&quot; alt=&quot;Usual spacing for comparison&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user9688" LastEditorUserId="-1" LastEditorDisplayName="user9688" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-10-03T22:21:43.977" Title="Incorrect Line Spacing in (term-mode, ansi-term, eshell, shell) Output" Tags="|shell|eshell|ansi-term|line-spacing|term|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17028" PostTypeId="1" CreationDate="2015-09-30T16:03:24.937" Score="0" ViewCount="769" Body="&lt;p&gt;Below's a &lt;a href=&quot;http://sscce.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SSCCE&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a dead simple org-mode document and I hit &lt;code&gt;C-c C-e&lt;/code&gt; to access the export dispatcher. Sure enough I can see the options and am prompted with the message &lt;code&gt;Export buffer:&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yGAST.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yGAST.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After hitting &lt;code&gt;h&lt;/code&gt; (for &quot;export as HTML&quot;) I see the below message in my Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's value as variable is void: f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;.. as shown below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZbihH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZbihH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The debug trace is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/g199p.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/g199p.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same debug trace as plain text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable f)                                                                                                                                                                                                                                  &#xA;(setq org-hide-emphasis-markers f)                                                                                                                                                                                                                                             &#xA;my-org-mode-hook()                                                                                                                                                                                                                                                             &#xA;run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook)                                                                                                                                                                                    &#xA;apply(run-hooks (change-major-mode-after-body-hook text-mode-hook outline-mode-hook org-mode-hook))                                                                                                                                                                            &#xA;run-mode-hooks(org-mode-hook)                                                                                                                                                                                                                                                  &#xA;org-mode()                                                                                                                                                                                                                                                                     &#xA;org-export-preprocess-string(#(&quot;* heading 1\n  blah blah blah ...\n*   heading 2\n  blah blah blah ...\n&quot; 0 2 (fontified t face org-level-1) 2 11 (fontified t face org-level-1) 11 33 (fontified t) 33 35 (fontified t face org-level-1) 35 44 (fontified t face org-level-1) 4$&#xA;org-export-as-html(nil)                                                                                                                                                                                                                                                        &#xA;call-interactively(org-export-as-html)                                                                                                                                                                                                                                         &#xA;org-export(nil)                                                                                                                                                                                                                                                                &#xA;call-interactively(org-export nil nil)     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;org-version&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And my &lt;code&gt;emacs-version&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4003" LastEditorUserId="4003" LastEditDate="2015-09-30T19:35:09.273" LastActivityDate="2015-10-30T21:37:18.793" Title="can't export from org-mode to HTML" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17029" PostTypeId="1" CreationDate="2015-09-30T17:38:59.527" Score="1" ViewCount="657" Body="&lt;p&gt;I've recently switched from emacs to spacemacs (develop branch), and I'm still getting used to the new defaults. I added &lt;code&gt;smartparens&lt;/code&gt; to my &lt;code&gt;excluded-packages&lt;/code&gt; in my config file, because I don't like parenthesis matching. Ususally, I open and close parentheses myself, and then &lt;code&gt;C-b&lt;/code&gt; to move between the parens and type. But once I turned off &lt;code&gt;smartparens&lt;/code&gt;, if I move between parens that I opened and closed, it will sometimes delete the close paren that I typed. In particular, this happens when I am in a function or for loop, or something else with a close curly brace. I'll type &lt;code&gt;someFunctionCall()&lt;/code&gt; within a &lt;code&gt;for{}&lt;/code&gt;, and as I'm filling in the arguments to the function call, the &lt;code&gt;)&lt;/code&gt; will disappear and the &lt;code&gt;}&lt;/code&gt; will turn red, like it's upset that I'm trying to close the &lt;code&gt;(&lt;/code&gt; with the wrong bracket type. How do I stop this behavior? I've attached my &lt;code&gt;.spacemacs&lt;/code&gt; as a gist for reference. I've seen this happen in ESS and C-mode so I don't think it's mode specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/esander91/d9fad132988965b6d015&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/esander91/d9fad132988965b6d015&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9689" LastEditorUserId="9689" LastEditDate="2015-09-30T19:22:20.653" LastActivityDate="2015-09-30T19:22:20.653" Title="How can I make Spacemacs stop deleting my parentheses?" Tags="|spacemacs|balanced-parentheses|smartparens|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17030" PostTypeId="1" AcceptedAnswerId="17106" CreationDate="2015-09-30T18:15:58.650" Score="-1" ViewCount="118" Body="&#xA;&#xA;&lt;h2&gt;Situation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I use the package &lt;a href=&quot;https://github.com/mrkkrp/vimish-fold/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;vimish-fold&lt;/code&gt;&lt;/a&gt;. This package uses overlays, to detect the current state of the fold. I would like to create folds (hence the new function &lt;code&gt;foobar&lt;/code&gt;), when there is no fold detected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I decided to modify the &lt;code&gt;vimish-fold-toggle&lt;/code&gt; function. The original function: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vimish-fold-toggle ()&#xA;&quot;Toggle fold at point.&quot;&#xA;(interactive)&#xA;(dolist (overlay (overlays-at (point)))&#xA;    (let ((type (overlay-get overlay 'type)))&#xA;    (when (eq type 'vimish-fold--folded)&#xA;        (vimish-fold-unfold))&#xA;    (when (eq type 'vimish-fold--unfolded)&#xA;        (vimish-fold-refold)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To modify it, that will create a fold (calling `foobar) when there is no fold overlay under the point found :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vimish-fold-toggle ()&#xA;&quot;Toggle fold at point.&quot;&#xA;(interactive)&#xA;(dolist (overlay (overlays-at (point)))&#xA;    (let ((type (overlay-get overlay 'type)))&#xA;    (when (eq type 'vimish-fold--folded)&#xA;        (vimish-fold-unfold))&#xA;    (when (eq type 'vimish-fold--unfolded)&#xA;        (vimish-fold-refold))&#xA;&#xA;&#xA;  ;; The added code &#xA;  (if (eq type 'vimish-fold--unfolded)&#xA;      (message &quot;nothing&quot;)&#xA;    (if (eq type 'vimish-fold--folded)&#xA;        (message &quot;nothing&quot;)&#xA;      (foobar)))&#xA;  )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The if-statements checks if the type is &lt;code&gt;vimish-fold--unfolded and&lt;/code&gt;vimish-fold--folded are &lt;code&gt;nil&lt;/code&gt;, then &lt;code&gt;foobar&lt;/code&gt; will be called. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It seems the function &lt;code&gt;foobar&lt;/code&gt; is never called, when the point is not positioned on a fold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems there are no overlays at all in my case and thus body of the loop dolist is never executed. I got the suggestion to extract all existing overlays then remove all those that do not satisfy &lt;code&gt;vimish-fold--vimish-overlay-p&lt;/code&gt;. Result collection will contain all existing folds. Then I could test if it's empty or not. If it's empty, then I could call the function &lt;code&gt;foobar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems I have not enough understanding what the overlay actually is, since there is also no overlay on the text fields without fold.I looked &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Overlays.html&quot; rel=&quot;nofollow&quot;&gt;into the documentation of Emacs about overlays&lt;/a&gt;, but I couldn't find any relevant section how to detect if there is no overlay under the current pointer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if anyone know how I could detect if the point is not located on a fold overlay, then I could call &lt;code&gt;foobar&lt;/code&gt; instead? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-10-03T13:26:43.523" LastActivityDate="2015-10-03T18:31:04.867" Title="How add a condition, to detect if there is no overlay?" Tags="|overlays|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17031" PostTypeId="1" AcceptedAnswerId="17032" CreationDate="2015-09-30T18:40:18.247" Score="1" ViewCount="95" Body="&lt;p&gt;I would like to have an interface in &lt;code&gt;customize&lt;/code&gt; for a package I'm writing.  Whenever I set the values it should update an &lt;em&gt;external config file&lt;/em&gt;, too. So the values should be saved in the emacs custom file and in an additonal external file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &lt;em&gt;external file&lt;/em&gt; the values set by the user have to be transformed to a slightly different format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In turn when the &lt;em&gt;external file&lt;/em&gt; was manipulated manually the customization interface should reflect this changes and load the current values of this external file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible and if so can anyone give me some pointers how I could approach this? &lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="105" LastEditDate="2015-09-30T18:52:19.787" LastActivityDate="2015-09-30T22:10:27.103" Title="How to sync customize interface with external config file?" Tags="|customize|defcustom|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17032" PostTypeId="2" ParentId="17031" CreationDate="2015-09-30T18:48:32.210" Score="2" Body="&lt;p&gt;Yes.  See the doc for &lt;code&gt;defcustom&lt;/code&gt;. What you want, in particular, is &lt;code&gt;:set&lt;/code&gt;, which you specify as a function that does two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Sets the value.  Just use the standard function for this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Does whatever else you want to do -- in this case, mirror the new setting, transforming it first, in your external file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can do those two things in either order, i.e., whichever order is most useful for you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:set&#xA;  VALUE should be a function to set the value of the symbol&#xA;  when using the Customize user interface.  It takes two arguments,&#xA;  the symbol to set and the value to give it.  The function should&#xA;  not modify its value argument destructively.  The default choice&#xA;  of function is `set-default'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;code&gt;:initialize&lt;/code&gt;, if you need to do something special when initializing the value.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:initialize&#xA;  VALUE should be a function used to initialize the&#xA;  variable.  It takes two arguments, the symbol and value&#xA;  given in the `defcustom' call.  The default is&#xA;  `custom-initialize-reset'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more information, see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Variable-Definitions.html&quot; rel=&quot;nofollow&quot;&gt;Variable Definitions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update to respond to your comment --&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;:initialize&lt;/code&gt; to initialize the variable without the &lt;code&gt;:set&lt;/code&gt; function being called.  It sounds like that's what your workaround is trying to accomplish.  Again, see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Variable-Definitions.html&quot; rel=&quot;nofollow&quot;&gt;Variable Definitions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example.  You will not see &lt;code&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;/code&gt; in buffer &lt;em&gt;Messages&lt;/em&gt; when the value is initialized (e.g., when the file with the &lt;code&gt;defcustom&lt;/code&gt; is loaded).  You will see it each time you use Customize to set the value.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom titi 42&#xA; &quot;jjjjjjjjjj&quot;&#xA;  :type 'integer&#xA;  :initialize (lambda (sym defs)&#xA;                (custom-initialize-default sym defs))&#xA;  :set (lambda (sym defs)&#xA;         (custom-set-default sym defs)&#xA;         (message &quot;@@@@@@@@@@@@@@@@@@@@@@@@@@&quot;)(sleep-for 4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-09-30T22:10:27.103" LastActivityDate="2015-09-30T22:10:27.103" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17033" PostTypeId="1" AcceptedAnswerId="17036" CreationDate="2015-09-30T19:07:36.953" Score="4" ViewCount="661" Body="&lt;p&gt;I use one daemon per project (so that when I open the client, they don't share buffers). I'd like to get a list of all the daemons that are running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried using &lt;code&gt;lsof -c emacs | grep &quot;TYPE=STREAM&quot;&lt;/code&gt; but that doesn't narrow it down sufficiently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to go about it?&lt;/p&gt;&#xA;" OwnerUserId="9690" LastActivityDate="2015-09-30T21:42:39.147" Title="How to get a list of all the daemons running?" Tags="|daemon|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17034" PostTypeId="2" ParentId="17028" CreationDate="2015-09-30T20:58:31.210" Score="-1" Body="&lt;p&gt;Use nil to fix error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-hide-emphasis-markers nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/nil-and-t.html&quot; rel=&quot;nofollow&quot;&gt;nil or empty list are interpreted as false&lt;/a&gt;. Any other value is true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_142.html&quot; rel=&quot;nofollow&quot;&gt;More details on symbols&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you have never given a symbol any value as a global variable, we&#xA;  say that that symbol's global value is void. In other words, the&#xA;  symbol's value cell does not have any Lisp object in it. If you try to&#xA;  evaluate the symbol, you get a void-variable error rather than a&#xA;  value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9596" LastEditorUserId="9596" LastEditDate="2015-09-30T21:07:02.363" LastActivityDate="2015-09-30T21:07:02.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17035" PostTypeId="2" ParentId="14006" CreationDate="2015-09-30T21:34:43.903" Score="1" Body="&lt;p&gt;Your settings work. Make sure that you don't have grayish window background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AeNPD.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AeNPD.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9596" LastActivityDate="2015-09-30T21:34:43.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17036" PostTypeId="2" ParentId="17033" CreationDate="2015-09-30T21:42:39.147" Score="4" Body="&lt;p&gt;By default, on a Unix-like platform, the sockets are located in a directory called &lt;code&gt;/tmp/emacs1234&lt;/code&gt; where &lt;code&gt;/tmp&lt;/code&gt; is the value of the environment variable &lt;code&gt;TMPDIR&lt;/code&gt; (defaulting to &lt;code&gt;/tmp&lt;/code&gt;) and &lt;code&gt;1234&lt;/code&gt; is your user ID. So to list daemon sockets, assuming you aren't passing any argument to &lt;code&gt;emacsclient&lt;/code&gt; other than the daemon name, just list the contents of that directory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls &quot;${TMPDIR-/tmp}/emacs$(id -u)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On many systems you can get away with just&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls /tmp/emacs$UID&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-09-30T21:42:39.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17037" PostTypeId="2" ParentId="14374" CreationDate="2015-09-30T22:23:10.030" Score="2" Body="&lt;p&gt;I have just added a new argument to the log popup which allows showing additional information about each commit without also showing the diff or diffstat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The argument is named &lt;code&gt;++header&lt;/code&gt; and it behaves &lt;em&gt;mostly&lt;/em&gt; like git-log's &lt;code&gt;--format&lt;/code&gt; argument. When that switch is enabled, then the format specified by the new option &lt;code&gt;magit-log-revision-headers-format&lt;/code&gt; gets combined with a constant format used internally. The result is then used as &lt;code&gt;--format&lt;/code&gt;s value. That's why I am using another argument, which git does not actually understand and indicate that by naming it &lt;code&gt;++header&lt;/code&gt; instead of &lt;code&gt;--header&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-10-01T00:04:38.883" LastActivityDate="2015-10-01T00:04:38.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17038" PostTypeId="2" ParentId="2404" CreationDate="2015-10-01T03:25:29.550" Score="5" Body="&lt;p&gt;&lt;strong&gt;Yes&lt;/strong&gt;, org-mode can be &lt;em&gt;coerced&lt;/em&gt; into exporting nested &lt;code&gt;&amp;lt;blockquote&amp;gt;&lt;/code&gt; elements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1.  Create &lt;em&gt;inner quote&lt;/em&gt; inside &lt;code&gt;org&lt;/code&gt; code block. Add &lt;code&gt;:results html&lt;/code&gt; header to code block.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        #+NAME: inner-quote-org&#xA;        #+BEGIN_SRC org  :results html replace &#xA;&#xA;           ,#+BEGIN_QUOTE&#xA;           hey hey&#xA;           ,#+END_QUOTE&#xA;&#xA;        #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2.  Create &lt;em&gt;outer quote&lt;/em&gt; inside &lt;code&gt;org&lt;/code&gt; code block and put a language specific variable, e.g. ruby syntax, as place holder for &lt;em&gt;inner quote&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        #+NAME: outer-quote-org&#xA;        #+BEGIN_SRC org :results html replace&#xA;&#xA;        ,#+BEGIN_QUOTE&#xA;        hey ho&#xA;        #{inner_quote}&#xA;        ho ho&#xA;        ,#+END_QUOTE&#xA;&#xA;        #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3.  Create new code block, e.g. ruby, with a matching&lt;code&gt;:var&lt;/code&gt; header, e.g &lt;code&gt;:var inner_quote=&quot;Hello World!&quot;&lt;/code&gt;. Then add &lt;code&gt;:noweb yes&lt;/code&gt; header to insert &lt;em&gt;outer quote&lt;/em&gt; block. Add &lt;code&gt;:results&lt;/code&gt; header so output will rendered as &lt;code&gt;html&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        #+NAME: nested-quotes-html &#xA;        #+BEGIN_SRC ruby :var inner_quote=&quot;Hello World!&quot; :results html replace &#xA;          output = &amp;lt;&amp;lt;-ORGSRC&#xA;          &amp;lt;&amp;lt;outer-quote-org()&amp;gt;&amp;gt;&#xA;          ORGSRC&#xA;        #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Finished code blocks should look similar to example below:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        #+NAME: inner-quote-org&#xA;        #+BEGIN_SRC org  :results html replace &#xA;&#xA;           ,#+BEGIN_QUOTE&#xA;           hey hey&#xA;           ,#+END_QUOTE&#xA;&#xA;        #+END_SRC&#xA;&#xA;        #+NAME: outer-quote-org&#xA;        #+BEGIN_SRC org :results html replace&#xA;&#xA;        ,#+BEGIN_QUOTE&#xA;        hey ho&#xA;        #{inner_quote}&#xA;        ho ho&#xA;        ,#+END_QUOTE&#xA;&#xA;        #+END_SRC&#xA;&#xA;        #+NAME: nested-quotes-html &#xA;        #+BEGIN_SRC ruby :var inner_quote=&quot;Hello World!&quot; :results html replace &#xA;          output = &amp;lt;&amp;lt;-ORGSRC&#xA;          &amp;lt;&amp;lt;outer-quote-org()&amp;gt;&amp;gt;&#xA;          ORGSRC&#xA;        #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To export nested &lt;code&gt;&amp;lt;blockquote&amp;gt;&lt;/code&gt; as HTML, use &lt;code&gt;#+CALL:&lt;/code&gt; with &lt;code&gt;:results html&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        #+CALL: nested-quotes-html(inner_quote=inner-quote-org()) :results html replace&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notice:&lt;/strong&gt; &lt;code&gt;inner_quote=inner-quote-org()&lt;/code&gt; is how we dynamically set value of &lt;em&gt;inner quote&lt;/em&gt; &lt;strong&gt;after&lt;/strong&gt; &lt;em&gt;outer quote&lt;/em&gt; was rendered as &lt;code&gt;html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Result exported as HTML using &lt;code&gt;C-c&lt;/code&gt; &lt;code&gt;C-e&lt;/code&gt; &lt;code&gt;h H&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        &amp;lt;blockquote&amp;gt;&#xA;        &amp;lt;p&amp;gt;&#xA;        hey ho&#xA;        &amp;lt;blockquote&amp;gt;&#xA;        &amp;lt;p&amp;gt;&#xA;        hey hey&#xA;        &amp;lt;/p&amp;gt;&#xA;        &amp;lt;/blockquote&amp;gt;&#xA;&#xA;        ho ho&#xA;        &amp;lt;/p&amp;gt;&#xA;        &amp;lt;/blockquote&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use a similar technique to create dynamic nested code templates using &lt;code&gt;org&lt;/code&gt; code blocks that send output to a &lt;code&gt;drawer&lt;/code&gt;. It works really well but I'm always looking for a better method.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Code tested using&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;Org-mode version 8.3.1 (8.3.1-87-g4ef2c0-elpa)&lt;/code&gt; &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2015-10-01T03:48:16.523" LastActivityDate="2015-10-01T03:48:16.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17039" PostTypeId="1" CreationDate="2015-10-01T03:56:44.393" Score="0" ViewCount="144" Body="&lt;p&gt;I'm trying to align &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 4000 1 2                 4000  1     2    &#xA;  11 1 44          =&amp;gt;     11    1     44   &#xA;  1  0000 999             1     0000  999  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as described at &lt;a href=&quot;http://emacswiki.org/emacs/AlignCommands&quot; rel=&quot;nofollow&quot;&gt;http://emacswiki.org/emacs/AlignCommands&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, typing in &lt;code&gt;C-u M-x align-regexp&lt;/code&gt;, and accepting all defaults, makes no modifications - my emacs minibuffer is just stuck on &lt;code&gt;Repeat throughout line? (y or n) y&lt;/code&gt; and I need to press &lt;code&gt;C-g&lt;/code&gt;. Am I using the command incorrectly or is there something wrong with my emacs (emacs version 22.1.1)&lt;/p&gt;&#xA;" OwnerUserId="9693" LastActivityDate="2015-10-01T03:56:44.393" Title="Simple align-regexp example" Tags="|align|" AnswerCount="0" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17040" PostTypeId="2" ParentId="16971" CreationDate="2015-10-01T04:55:17.423" Score="10" Body="&lt;p&gt;It is recommended that users read the entire &lt;code&gt;../emacs/nt/INSTALL&lt;/code&gt; contained within the Emacs source code.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quick Start -- 5 Easy Steps&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer was tested on WindowsXP--SP3.  The installation paths will need to be adjusted based on the individual preferences of the user.  In this example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The desktop is:  &lt;code&gt;C:\Documents and Settings\lawlist\Desktop&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;git&lt;/code&gt; installation is:  &lt;code&gt;C:\git&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;MinGW&lt;/code&gt; installation is:  &lt;code&gt;C:\mingw&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The git download location of Emacs master branch is: &lt;code&gt;C:\Documents and Settings\lawlist\Desktop\emacs&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The target for Emacs installation is:  &lt;code&gt;C:\Documents and Settings\lawlist\Desktop\trunk&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step Number 1&lt;/strong&gt;:  Install &lt;code&gt;git&lt;/code&gt; and be sure to select &quot;checkout as-is, commit as-is&quot; during installation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://git-scm.com/download/win&quot; rel=&quot;noreferrer&quot;&gt;https://git-scm.com/download/win&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Git-2.5.3-32-bit.exe&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run the installer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard installation directory is &lt;code&gt;C:\Program Files\Git&lt;/code&gt;, but I chose instead:  &lt;code&gt;c:\git&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select components:  default is okay, but I chose nothing instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select start menu folder:  default is okay, bit I chose not to create a folder instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjusting your PATH environment:  default is okay:  Use Git from Bash only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; For this next section, pay close attention to the non-default setting -- see Emacs bug #21582.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Configure the line ending conversions:  Emacs requires a non-default setting of &quot;checkout as-is, commit as-is&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Configuring the terminal emulator to use with Git Bash:  default is okay:  Use MinTTY (the default terminal of MSys2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Configuring experimental performance tweaks:  I chose NOT to &quot;Enable file system caching&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finish [view release notes if so desired]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE:  &lt;code&gt;autogen.sh&lt;/code&gt; (and perhaps some third-party programs) require the &lt;code&gt;git&lt;/code&gt; PATH to be set so that the executable(s) can be called without using the absolute path.  The author of this answer has a personal preference for using absolute paths and not modifying the PATH; however, most people seem to prefer modifying the PATH for current and future sessions.  On Windows XP, for example, the PATH can be set within Control Panel / System Properties / Advanced tab / Environmental Variables button, and there appears to be two (2) views/opinions regarding whether a user should set the User Variables or the System Variables -- paths are separated by semicolons without spaces.  This answer simply sets the PATH for the duration of the session using &lt;code&gt;export&lt;/code&gt; set forth hereinbelow. The Emacs &lt;code&gt;autogen.sh&lt;/code&gt; looks for the &lt;code&gt;git&lt;/code&gt; command on the PATH and complains if it cannot be found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step Number 2&lt;/strong&gt;:  Install &lt;code&gt;MinGW&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mingw.org/wiki/Getting_Started&quot; rel=&quot;noreferrer&quot;&gt;http://www.mingw.org/wiki/Getting_Started&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;mingw-get-setup.exe&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\mingw\bin\mingw-get install mingw32-base&#xA;&#xA;c:\mingw\bin\mingw-get install msys-base&#xA;&#xA;c:\mingw\bin\mingw-get install autoconf&#xA;&#xA;c:\mingw\bin\mingw-get install automake&#xA;&#xA;c:\mingw\bin\mingw-get install msys-coreutils&#xA;&#xA;c:\mingw\bin\mingw-get remove mingw32-libiconv&#xA;&#xA;c:\mingw\bin\mingw-get install &quot;libiconv=1.13.1-1&quot;&#xA;&#xA;c:\mingw\msys\1.0\msys.bat&#xA;&#xA;mount c:/mingw /mingw&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step Number 3&lt;/strong&gt;:  Download the following &lt;code&gt;ezwinports&lt;/code&gt; zipped packages and extract to the root &lt;code&gt;mingw&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;noreferrer&quot;&gt;https://sourceforge.net/projects/ezwinports/files/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; unzip all of the following ezwinports packages into &lt;code&gt;c:/mingw&lt;/code&gt;, overwriting any duplicates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cairo-1.12.16-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;gdk-pixbuf-2.30.2-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;giflib-5.1.0-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;glib-2.38.2-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;gnutls-3.3.11-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;jpeg-v9a-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;libpng-1.6.12-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;librsvg-2.40.1-2-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;libtasn1-4.2-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;libxml2-2.7.8-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;libXpm-3.5.11-2-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nettle-2.7.1-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;p11-kit-0.9-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pixman-0.32.4-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pkg-config-0.28-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tiff-4.0.3-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;zlib-1.2.8-2-w32-bin.zip&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step Number 4&lt;/strong&gt;:  Download the latest Emacs master branch source files using a &lt;code&gt;git-bash&lt;/code&gt; shell.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\git\git-bash.exe&#xA;&#xA;cd /c/docume~1/lawlist/desktop/&#xA;&#xA;git clone -b master git://git.sv.gnu.org/emacs.git&#xA;&#xA;exit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step Number 5&lt;/strong&gt;:  Build the Emacs master branch and copy over the .dll files when done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; open generic Command Prompt&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\mingw\msys\1.0\msys.bat&#xA;&#xA;export PATH=$PATH:/c/git/bin&#xA;&#xA;cd /c/docume~1/lawlist/desktop/emacs&#xA;&#xA;./autogen.sh&#xA;&#xA;./configure --prefix=/c/docume~1/lawlist/desktop/trunk&#xA;&#xA;make&#xA;&#xA;make install&#xA;&#xA;;; copy the following files to the `/bin` directory where `emacs.exe` is located.&#xA;&#xA;cp /c/mingw/bin/libXpm-noX4.dll /c/docume~1/lawlist/desktop/trunk/bin/libXpm-noX4.dll&#xA;&#xA;cp /c/mingw/bin/libpng16-16.dll /c/docume~1/lawlist/desktop/trunk/bin/libpng16-16.dll&#xA;&#xA;cp /c/mingw/bin/libtiff-5.dll /c/docume~1/lawlist/desktop/trunk/bin/libtiff-5.dll&#xA;&#xA;cp /c/mingw/bin/libjpeg-9.dll /c/docume~1/lawlist/desktop/trunk/bin/libjpeg-9.dll&#xA;&#xA;cp /c/mingw/bin/libgif-7.dll /c/docume~1/lawlist/desktop/trunk/bin/libgif-7.dll&#xA;&#xA;cp /c/mingw/bin/librsvg-2-2.dll /c/docume~1/lawlist/desktop/trunk/bin/librsvg-2-2.dll&#xA;&#xA;cp /c/mingw/bin/libgdk_pixbuf-2.0-0.dll /c/docume~1/lawlist/desktop/trunk/bin/libgdk_pixbuf-2.0-0.dll&#xA;&#xA;cp /c/mingw/bin/libglib-2.0-0.dll /c/docume~1/lawlist/desktop/trunk/bin/libglib-2.0-0.dll&#xA;&#xA;cp /c/mingw/bin/libgobject-2.0-0.dll /c/docume~1/lawlist/desktop/trunk/bin/libgobject-2.0-0.dll&#xA;&#xA;cp /c/mingw/bin/libxml2-2.dll /c/docume~1/lawlist/desktop/trunk/bin/libxml2-2.dll&#xA;&#xA;cp /c/mingw/bin/zlib1.dll /c/docume~1/lawlist/desktop/trunk/bin/zlib1.dll&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unzip the entire contents of &lt;code&gt;gnutls-3.3.11-w32-bin.zip&lt;/code&gt; to &lt;code&gt;C:\Documents and Settings\lawlist\Desktop\trunk&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MANUAL INSTALLATION&lt;/strong&gt; -- MinGW / MSYS / EZwinports&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For those adventurous souls who are interested in doing a manual installation of MinGW/MSYS/EZwinports, the following are the files used by this author on Windows XP to create a successful 32-bit build with the following configuration options enabled by default.  The setup and configuration will vary depending upon the individual users personal preferences, and is beyond the scope of this answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Configured for 'i686-pc-mingw32'.&#xA;Where should the build process find the source code?    .&#xA;What compiler should emacs be built with?               gcc -std=gnu99  -g3 -O 2 -gdwarf-2&#xA;Should Emacs use the GNU version of malloc?             no&#xA;  (The GNU allocators don't work with this system configuration.)&#xA;Should Emacs use a relocating allocator for buffers?    no&#xA;Should Emacs use mmap(2) for buffer allocation?         yes&#xA;What window system should Emacs use?                    w32&#xA;What toolkit should Emacs use?                          none&#xA;Where do we find X Windows header files?                NONE&#xA;Where do we find X Windows libraries?                   NONE&#xA;Does Emacs use -lXaw3d?                                 no&#xA;Does Emacs use -lXpm?                                   yes&#xA;Does Emacs use -ljpeg?                                  yes&#xA;Does Emacs use -ltiff?                                  yes&#xA;Does Emacs use a gif library?                           yes&#xA;Does Emacs use a png library?                           yes&#xA;Does Emacs use -lrsvg-2?                                yes&#xA;Does Emacs use cairo?                                   no&#xA;Does Emacs use imagemagick?                             no&#xA;Does Emacs support sound?                               yes&#xA;Does Emacs use -lgpm?                                   no&#xA;Does Emacs use -ldbus?                                  no&#xA;Does Emacs use -lgconf?                                 no&#xA;Does Emacs use GSettings?                               no&#xA;Does Emacs use a file notification library?             yes (w32)&#xA;Does Emacs use access control lists?                    yes&#xA;Does Emacs use -lselinux?                               no&#xA;Does Emacs use -lgnutls?                                yes&#xA;Does Emacs use -lxml2?                                  yes&#xA;Does Emacs use -lfreetype?                              no&#xA;Does Emacs use -lm17n-flt?                              no&#xA;Does Emacs use -lotf?                                   no&#xA;Does Emacs use -lxft?                                   no&#xA;Does Emacs directly use zlib?                           yes&#xA;Does Emacs use toolkit scroll bars?                     yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EZWINPORTS&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cairo-1.12.16-w32-bin.zip&#xA;gdk-pixbuf-2.30.2-w32-bin.zip&#xA;giflib-5.1.0-w32-bin.zip&#xA;glib-2.38.2-w32-bin.zip&#xA;gnutls-3.3.11-w32-bin.zip&#xA;jpeg-v9a-w32-bin.zip&#xA;libXpm-3.5.11-2-w32-bin.zip&#xA;libpng-1.6.12-w32-bin.zip&#xA;librsvg-2.40.1-2-w32-bin.zip&#xA;libtasn1-4.2-w32-bin.zip&#xA;libxml2-2.7.8-w32-bin.zip&#xA;nettle-2.7.1-w32-bin.zip&#xA;p11-kit-0.9-w32-bin.zip&#xA;pixman-0.32.4-w32-bin.zip&#xA;pkg-config-0.28-w32-bin.zip&#xA;tiff-4.0.3-w32-bin.zip&#xA;zlib-1.2.8-2-w32-bin.zip&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MINGW&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;autoconf-10-1-mingw32-bin.tar.lzma&#xA;autoconf-10-1-mingw32-lic.tar.lzma&#xA;autoconf2.1-2.13-4-mingw32-bin.tar.lzma&#xA;autoconf2.5-2.68-1-mingw32-bin.tar.lzma&#xA;automake-4-1-mingw32-bin.tar.lzma&#xA;automake-4-1-mingw32-lic.tar.lzma&#xA;automake1.10-1.10.2-1-mingw32-bin.tar.lzma&#xA;automake1.11-1.11.1-1-mingw32-bin.tar.lzma&#xA;automake1.4-1.4p6-1-mingw32-bin.tar.lzma&#xA;automake1.5-1.5-1-mingw32-bin.tar.lzma&#xA;automake1.6-1.6.3-1-mingw32-bin.tar.lzma&#xA;automake1.7-1.7.9-1-mingw32-bin.tar.lzma&#xA;automake1.8-1.8.5-1-mingw32-bin.tar.lzma&#xA;automake1.9-1.9.6-3-mingw32-bin.tar.lzma&#xA;binutils-2.25.1-1-mingw32-bin.tar.xz&#xA;gcc-core-4.8.1-4-mingw32-bin.tar.lzma&#xA;gcc-core-4.8.1-4-mingw32-dev.tar.lzma&#xA;gcc-core-4.8.1-4-mingw32-dll.tar.lzma&#xA;gcc-core-4.8.1-4-mingw32-lic.tar.lzma&#xA;gdb-7.6.1-1-mingw32-bin.tar.lzma&#xA;gmp-5.1.2-1-mingw32-dll.tar.lzma&#xA;libcharset-1.13.1-1-mingw32-dll-1.tar.lzma&#xA;libiconv-1.13.1-1-mingw32-bin.tar.lzma&#xA;libiconv-1.13.1-1-mingw32-dev.tar.lzma&#xA;libiconv-1.13.1-1-mingw32-dll-2.tar.lzma&#xA;libiconv-1.13.1-1-mingw32-doc.tar.lzma&#xA;libiconv-1.13.1-1-mingw32-lic.tar.lzma&#xA;libintl-0.17-1-mingw32-dll-8.tar.lzma&#xA;libmpc-1.0.2-mingw32-dll-3.tar.xz&#xA;make-3.82.90-2-mingw32-cvs-20120902-bin.tar.lzma&#xA;mingwrt-3.21.1-mingw32-dev.tar.xz&#xA;mingwrt-3.21.1-mingw32-dll.tar.xz&#xA;mpfr-3.1.2-2-mingw32-dll.tar.lzma&#xA;pthreads-w32-2.9.1-1-mingw32-dll.tar.lzma&#xA;w32api-3.17-2-mingw32-dev.tar.lzma&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MSYS&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash-3.1.23-1-msys-1.0.18-bin.tar.xz&#xA;bzip2-1.0.6-1-msys-1.0.17-bin.tar.lzma&#xA;coreutils-5.97-3-msys-1.0.13-bin.tar.lzma&#xA;coreutils-5.97-3-msys-1.0.13-doc.tar.lzma&#xA;coreutils-5.97-3-msys-1.0.13-ext.tar.lzma&#xA;coreutils-5.97-3-msys-1.0.13-lang.tar.lzma&#xA;coreutils-5.97-3-msys-1.0.13-lic.tar.lzma&#xA;diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin.tar.lzma&#xA;dos2unix-7.2.3-1-msys-1.0.18-bin.tar.lzma&#xA;file-5.04-1-msys-1.0.13-bin.tar.lzma&#xA;findutils-4.4.2-2-msys-1.0.13-bin.tar.lzma&#xA;gawk-3.1.7-2-msys-1.0.13-bin.tar.lzma&#xA;grep-2.5.4-2-msys-1.0.13-bin.tar.lzma&#xA;gzip-1.3.12-2-msys-1.0.13-bin.tar.lzma&#xA;less-436-2-msys-1.0.13-bin.tar.lzma&#xA;libbz2-1.0.6-1-msys-1.0.17-dll-1.tar.lzma&#xA;libcrypt-1.1_1-3-msys-1.0.13-dll-0.tar.lzma&#xA;libexpat-2.0.1-1-msys-1.0.13-dll-1.tar.lzma&#xA;libgdbm-1.8.3-3-msys-1.0.13-dll-3.tar.lzma&#xA;libiconv-1.14-1-msys-1.0.17-dll-2.tar.lzma&#xA;libintl-0.18.1.1-1-msys-1.0.17-dll-8.tar.lzma&#xA;liblzma-5.0.3-1-msys-1.0.17-dll-5.tar.lzma&#xA;libmagic-5.04-1-msys-1.0.13-dll-1.tar.lzma&#xA;libregex-1.20090805-2-msys-1.0.13-dll-1.tar.lzma&#xA;libtermcap-0.20050421_1-2-msys-1.0.13-dll-0.tar.lzma&#xA;libxml2-2.7.6-1-msys-1.0.13-dll-2.tar.lzma&#xA;m4-1.4.16-2-msys-1.0.17-bin.tar.lzma&#xA;make-3.81-3-msys-1.0.13-bin.tar.lzma&#xA;msysCORE-1.0.18-1-msys-1.0.18-bin.tar.lzma&#xA;msysCORE-1.0.18-1-msys-1.0.18-doc.tar.lzma&#xA;msysCORE-1.0.18-1-msys-1.0.18-ext.tar.lzma&#xA;msysCORE-1.0.18-1-msys-1.0.18-lic.tar.lzma&#xA;perl-5.8.8-1-msys-1.0.17-bin.tar.lzma&#xA;sed-4.2.1-2-msys-1.0.13-bin.tar.lzma&#xA;tar-1.23-1-msys-1.0.13-bin.tar.lzma&#xA;termcap-0.20050421_1-2-msys-1.0.13-bin.tar.lzma&#xA;texinfo-4.13a-2-msys-1.0.13-bin.tar.lzma&#xA;xz-5.0.3-1-msys-1.0.17-bin.tar.lzma&#xA;zlib-1.2.7-1-msys-1.0.17-dll.tar.lzma&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-10-09T23:02:31.147" LastActivityDate="2015-10-09T23:02:31.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17041" PostTypeId="1" CreationDate="2015-10-01T05:04:39.713" Score="3" ViewCount="115" Body="&lt;p&gt;I have linum mode and whitespace mode enabled.  This works great except that I want padding in linum mode (which uses a space) and so, instead of there being a space (or a different colored space as I would really like), there is a kind of annoying little dot.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/hifC0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hifC0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Is there a way to fix this (see photo):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My linum lines from init.el are attached.  Thanks!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;61·(defun·linum-format-func·(line)                                                                                                                            &#xA;162···(concat                                                                                                                                                  &#xA;163····(propertize·(format·linum-format-fmt·line)·'face·'linum)                                                                                                &#xA;164····(propertize·&quot;·&quot;·'face·'mode-line)))                                                                                                                     &#xA;165·                                                                                                                                                           &#xA;166·(unless·window-system                                                                                                                                      &#xA;167···(setq·linum-format·'linum-format-func))                                                                                                                  &#xA;168·                                                                                                                                                           &#xA;169·(add-hook·'linum-before-numbering-hook·'my-linum-get-format-string)                                                                                        &#xA;170·                                                                                                                                                           &#xA;171·(defun·my-linum-get-format-string·()                                                                                                                       &#xA;172···(let*·((width·(length·(number-to-string                                                                                                                  &#xA;173··························(count-lines·(point-min)·(point-max)))))                                                                                          &#xA;174··········(format·(concat·&quot;%&quot;·(number-to-string·width)·&quot;d&quot;)))                                                                                               &#xA;175·····(setq·my-linum-format-string·format)))                                                                                                                 &#xA;176·                                                                                                                                                           &#xA;177·(setq·linum-format·&quot;%d·&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2015-10-01T05:04:39.713" Title="How to hide the extra period in linum mode when you have whitespace mode enabled?" Tags="|themes|whitespace|linum-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17044" PostTypeId="1" AcceptedAnswerId="17050" CreationDate="2015-10-01T09:04:27.453" Score="5" ViewCount="873" Body="&lt;p&gt;I am creating a yasnippet to create org-mode link  with content like:&#xA;&lt;code&gt;[[$1:value-read-from-clipboard][$0]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish the $1 read value from clipboard (the use-case is: I copy the URL from chrome browser and use this yasnippet to automatically attach the URL string into a link in org file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using evil-mode, so the clipboard value is saved in &quot;* register.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question is: &#xA;1.how to read clipboard value in yasnippet, perhaps by elisp code? &#xA;2.I am open to any better solution to achieve this use-case.&lt;/p&gt;&#xA;" OwnerUserId="9570" LastEditorUserId="253" LastEditDate="2015-10-01T13:14:52.800" LastActivityDate="2024-01-03T00:32:26.120" Title="read clipboard into yasnippet" Tags="|yasnippet|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17045" PostTypeId="1" AcceptedAnswerId="17122" CreationDate="2015-10-01T09:05:20.620" Score="-1" ViewCount="17" Body="&lt;p&gt;I'm writing a package where I need to store some data and restore it in the next session. I don't want to create a file for it so my idea is to save it with &lt;code&gt;customize-save-variable&lt;/code&gt;. This works great but it shouldn't show up in the customize-inteface. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to hide entries? If not can I make them unmodifiable? &lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-10-04T10:06:32.507" Title="Hide some entries in the customize interface? Or prevent the user from setting them?" Tags="|saving|defcustom|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17046" PostTypeId="1" AcceptedAnswerId="17047" CreationDate="2015-10-01T09:13:16.837" Score="0" ViewCount="59" Body="&lt;p&gt;My text is written in paragraphs that are split into lines, which makes it difficult to search for strings that might be spanned across several lines. For instance, given the following text&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is an example&#xA;of a text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when searching for the string &quot;example of&quot; in an unmodified emacs version it finds no occurrences. However, if I add the following customization, which was suggested in &lt;a href=&quot;https://emacs.stackexchange.com/questions/10582/search-for-string-ignoring-new-lines&quot;&gt;another post on the emacs stack exchange&lt;/a&gt;, the search works as desired:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq isearch-lax-whitespace t)&#xA;(setq isearch-regexp-lax-whitespace t)&#xA;(setq search-whitespace-regexp &quot;[ \t\r\n]+&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is how to configure the query-replace operation (M-%) so that it will behave as my modified search operation, i.e., be able to find and replace strings, while ignoring white spaces.&lt;/p&gt;&#xA;" OwnerUserId="9694" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-01T09:43:57.153" Title="query replace ingonring new lines" Tags="|whitespace|query-replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17047" PostTypeId="2" ParentId="17046" CreationDate="2015-10-01T09:43:57.153" Score="0" Body="&lt;p&gt;Ask Emacs. &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt;&lt;kbd&gt;M-%&lt;/kbd&gt; tells you the answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If &lt;code&gt;replace-lax-whitespace&lt;/code&gt; is non-nil, a space or spaces in the string&#xA;  to be replaced will match a sequence of whitespace chars defined by the&#xA;  regexp in &lt;code&gt;search-whitespace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-10-01T09:43:57.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17048" PostTypeId="1" AcceptedAnswerId="17055" CreationDate="2015-10-01T10:13:41.690" Score="4" ViewCount="5565" Body="&lt;p&gt;Instead of adding &lt;code&gt;.org&lt;/code&gt; files using &lt;code&gt;C-c [&lt;/code&gt; I would like to add a directory to my &lt;code&gt;.emacs&lt;/code&gt; file, as I read it is done &lt;a href=&quot;http://doc.norang.ca/org-mode.html#AgendaSetup&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only have one directory at the moment, so this is the line I put into my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files (quote (&quot;~/Documents/Org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This path should be pointing to a directory I have, named &quot;Org&quot;, where I have a few &lt;code&gt;.org&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I call the Agenda with &lt;code&gt;C-c a&lt;/code&gt; and subsequently try to gather all &lt;code&gt;TODO&lt;/code&gt; items with key &lt;code&gt;t&lt;/code&gt;, I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Non-existent agenda file ~/Documents/Org. [R]emove from list or [A]bort?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I notice that there is a full stop mark in the message, which is not intended. Also, it looks like &lt;code&gt;emacs&lt;/code&gt; is really asking for a file, not a directory.&lt;/p&gt;&#xA;" OwnerUserId="9642" LastEditorUserId="9642" LastEditDate="2015-10-01T14:41:50.233" LastActivityDate="2015-10-01T14:41:50.233" Title="How to add a directory to the org-agenda-files" Tags="|org-agenda|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17049" PostTypeId="1" AcceptedAnswerId="17068" CreationDate="2015-10-01T10:20:52.433" Score="0" ViewCount="335" Body="&lt;p&gt;I have this in my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar dropbox-d &quot;C:/Dropbox&quot;)&#xA;(defvar dropbox-emacs-d (expand-file-name &quot;emacs&quot; dropbox-d))&#xA;(org-babel-load-file (expand-file-name &quot;config.org&quot; dropbox-emacs-d))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In config.org I have, among other things:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(use-package perspective :load-path &quot;packages/perspective&quot;&#xA;  :bind-keymap (&quot;C-ä&quot; . perspective-map)&#xA;  :config&#xA;  (persp-mode))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When config.org is converted to config.el, config.el contains this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package perspective :load-path &quot;packages/perspective&quot;&#xA;  :bind-keymap (&quot;C-Ã¤&quot; . perspective-map)&#xA;  :config&#xA;  (persp-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why this character conversion happen? Both init.el and config.org are saved in utf-8 format. I have also tried adding the code below before loading config.org, and I have tried it with both the org-mode version shipped with emacs and the latest org-mode version.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq locale-coding-system 'utf-8)&#xA;(set-terminal-coding-system 'utf-8)&#xA;(set-keyboard-coding-system 'utf-8)&#xA;(set-selection-coding-system 'utf-8)&#xA;(setq default-buffer-file-coding-system 'utf-8)&#xA;(prefer-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="9695" LastEditDate="2015-10-02T10:43:13.767" LastActivityDate="2015-10-02T10:52:05.823" Title="How to make org-babel-load-file use umlauts (åäö) correctly?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17050" PostTypeId="2" ParentId="17044" CreationDate="2015-10-01T11:05:23.440" Score="6" Body="&lt;p&gt;You can use backticks to run elisp code in snippets. Here's a full example snippet which works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: yank&#xA;# key: yank&#xA;# --&#xA;[[${1:`(current-kill 0)`}][$0]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="9695" LastEditDate="2015-10-05T06:44:55.117" LastActivityDate="2015-10-05T06:44:55.117" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17051" PostTypeId="1" CreationDate="2015-10-01T13:06:36.433" Score="8" ViewCount="2574" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how does one move a project out of the &lt;code&gt;org&lt;/code&gt; archive and back into its original spot in the agenda file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; has facilities to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/org.html#Archiving&quot; rel=&quot;noreferrer&quot;&gt;archive projects&lt;/a&gt;.  Every once in a while, however, I need to retrieve something from the archive and put it back in the agenda file in which it was originally located.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do this infrequently enough that it's not a big problem to move the entry from archive to agenda file manually, but I'm wondering if there's an automated way to do so.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-10-01T13:06:36.433" Title="Move item from org archive back into org agenda file?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17052" PostTypeId="1" AcceptedAnswerId="18896" CreationDate="2015-10-01T13:19:57.967" Score="6" ViewCount="1222" Body="&lt;p&gt;In Org mode: How can I move point (up) to the current heading (or the first line under the heading)?&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="5345" LastEditDate="2016-01-25T16:09:00.853" LastActivityDate="2016-01-25T16:09:00.853" Title="Move point to current org heading" Tags="|org-mode|outline-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17053" PostTypeId="1" CreationDate="2015-10-01T13:42:15.053" Score="1" ViewCount="252" Body="&lt;p&gt;Currently when I press TAB it uses this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;,-&gt; FOLDED -&gt; CHILDREN -&gt; SUBTREE --.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like it to behave like other outliners. If I press TAB once it should open the children. It I press TAB again it should close it. Even if there is a SUBTREE.&lt;/p&gt;&#xA;" OwnerUserId="8844" LastActivityDate="2015-10-01T13:42:15.053" Title="How do I change the visibility cycling in orgmode?" Tags="|org-mode|visibility|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17054" PostTypeId="2" ParentId="17052" CreationDate="2015-10-01T13:45:55.583" Score="7" Body="&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; is built on top of &lt;code&gt;outline-mode&lt;/code&gt;, so you can use all the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Motion.html#Outline-Motion&quot; rel=&quot;noreferrer&quot;&gt;outline navigation commands&lt;/a&gt;.  The one most relevant to your question will be &lt;code&gt;outline-previous-visible-heading&lt;/code&gt;.  You should probably find a comfortable keybinding if you plan to use it a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there is also a non-interactive &lt;code&gt;org-back-to-heading&lt;/code&gt; that you could wrap in a command, if you like.  Docstring says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(org-back-to-heading &amp;amp;optional INVISIBLE-OK)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Call &lt;code&gt;outline-back-to-heading&lt;/code&gt;, but provide a better error message.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-10-01T13:59:23.803" LastActivityDate="2015-10-01T13:59:23.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17055" PostTypeId="2" ParentId="17048" CreationDate="2015-10-01T14:41:09.277" Score="5" Body="&lt;p&gt;The reason &lt;code&gt;emacs&lt;/code&gt; was complaining is because - indeed - there is no file in the specified directory .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working under Windows, I mistakenly took &lt;code&gt;~&lt;/code&gt; for my home directory. This is &lt;strong&gt;not&lt;/strong&gt; the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When meaningful directories are specified as entries in the org-agenda-files variable, &lt;code&gt;emacs&lt;/code&gt; matches its contents towards the variable &lt;code&gt;org-agenda-file-regexp&lt;/code&gt; in the &lt;code&gt;org.el&lt;/code&gt; file, actually allowing for a much finer customization (for instance nested structures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the mechanism works just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;code&gt;org.el&lt;/code&gt; file&lt;/p&gt;&#xA;" OwnerUserId="9642" LastActivityDate="2015-10-01T14:41:09.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17056" PostTypeId="1" AcceptedAnswerId="17059" CreationDate="2015-10-01T14:49:53.973" Score="14" ViewCount="792" Body="&lt;p&gt;I'm interested in learning how the term &quot;yank&quot; got its name. I'm also interested in why Emacs &quot;yank&quot; differs from vi/vim &quot;yank&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;https://vi.stackexchange.com/questions/4945/what-is-the-origin-of-the-term-yank&quot;&gt;dual question about Vi&lt;/a&gt;, also &lt;a href=&quot;https://unix.stackexchange.com/questions/209660/why-is-the-vi-editors-copy-command-called-yank&quot;&gt;on Unix &amp;amp; Linux&lt;/a&gt;; &lt;/p&gt;&#xA;" OwnerUserId="9698" LastEditorUserId="-1" LastEditDate="2017-04-13T12:51:57.437" LastActivityDate="2021-09-10T11:06:34.270" Title="What is the origin of the term &quot;yank&quot;?" Tags="|yank|history|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17057" PostTypeId="1" CreationDate="2015-10-01T15:56:26.377" Score="2" ViewCount="333" Body="&lt;p&gt;The title pretty much says it all.  I'm looking for something similar to &lt;code&gt;M-f&lt;/code&gt; and &lt;code&gt;M-b&lt;/code&gt; to move right or left column-wise in an &lt;code&gt;org-mode&lt;/code&gt; table.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="253" LastEditDate="2015-10-01T16:09:32.327" LastActivityDate="2019-05-15T01:01:33.253" Title="How to move by columns in an org table?" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17058" PostTypeId="1" AcceptedAnswerId="17097" CreationDate="2015-10-01T16:10:16.157" Score="1" ViewCount="308" Body="&lt;p&gt;I have configured helm to hide the minibuffer and show the input in the header line following &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3asbyn/new_and_very_useful_helm_feature_enter_search/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; instructions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relevant code is this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-hide-minibuffer-maybe ()&#xA;  (when (with-helm-buffer helm-echo-input-in-header-line)&#xA;    (let ((ov (make-overlay (point-min) (point-max) nil nil t)))&#xA;      (overlay-put ov 'window (selected-window))&#xA;      (overlay-put ov 'face (let ((bg-color (face-background 'default nil)))&#xA;                              `(:background ,bg-color :foreground ,bg-color)))&#xA;      (setq-local cursor-type nil))))&#xA;&#xA;(add-hook 'helm-minibuffer-set-up-hook 'helm-hide-minibuffer-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the cursor-type to be of type 'bar but setting this in the code above just yields an additional cursor with type 'bar in the minibuffer. The cursor in the helm header line is still a 'box. How to solve this? &lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-10-03T11:46:55.507" Title="Change cursor-type in helm-header-line?" Tags="|helm|cursor|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17059" PostTypeId="2" ParentId="17056" CreationDate="2015-10-01T16:27:46.877" Score="8" Body="&lt;p&gt;&quot;Yank&quot; is just English. You are &quot;pulling&quot; some text into the current buffer at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the more common term &quot;paste&quot; (no, it is not quite the same thing) is no clearer in this regard. There is no glue involved.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note too that the verb &quot;copy&quot; has two meanings that can confuse its use. One of them means to make an invisible copy, which can later be used to make a visible copy. The other means to duplicate. When you &quot;copy&quot; text but you do not paste it you do the first of these. When you &quot;copy&quot; a file you do the second.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-01T16:27:46.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17061" PostTypeId="1" CreationDate="2015-10-01T18:36:51.807" Score="6" ViewCount="563" Body="&lt;p&gt;I cannot seem to get correctly exported smart single quotes in Org 8.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a minimal &lt;code&gt;test.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: ':t&#xA;#+LANGUAGE: en&#xA;&#xA;This is 'within single quotes'.  This is &quot;within double quotes&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;emacs -Q&lt;/code&gt;, &lt;code&gt;org-version&lt;/code&gt; reports 8.2.10.  The output when exporting to UTF-8 text is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is ‘within single quotes’.  This is “within double quotes”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and the output when exporting to LaTeX is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is `within single quotes'.  This is ``within double quotes''.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what I would expect.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I load the most recent version of org-mode (starting from &lt;code&gt;emacs -Q&lt;/code&gt;, typing &lt;code&gt;M-x package-initialize RET&lt;/code&gt;, and &lt;code&gt;M-x load-library RET org RET&lt;/code&gt;), then &lt;code&gt;org-version&lt;/code&gt; reports &lt;code&gt;8.3.2&lt;/code&gt;, and the output no longer correctly translates single quotes.  In UTF-8 text, the result is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is ’within single quotes’.  This is “within double quotes”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and in LaTeX, the result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is 'within single quotes'.  This is ``within double quotes''.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there anything non-obvious going on with smart quote export in the newer version of Org, or is this simply a bug which I should report?&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastActivityDate="2015-10-01T18:36:51.807" Title="Is exporting of smart (single) quotes broken in Org 8.3?" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17062" PostTypeId="2" ParentId="16748" CreationDate="2015-10-01T18:36:54.043" Score="2" Body="&lt;p&gt;I have added a wrapper for &lt;code&gt;git stash show -p &amp;lt;stash&amp;gt; &amp;gt; patch&lt;/code&gt;. It's available from the stash popup now (&lt;kbd&gt;z f&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But note that a stash commit consists of two or three commits, and that one of these commits is a merge commit. What this command does, is to save the diff for &lt;code&gt;stash@{N}^..stash@{N}&lt;/code&gt; to a file. The intermediate index (&lt;code&gt;stash@{N}^2&lt;/code&gt;) is lost, and if the work tree commit does not only &quot;adds&quot; additional changes, but instead further &quot;changes&quot; the changes in the index commit, then those changes in the index are completely lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the comments it was suggested that it should be possible to apply the individual commits that make up the stash as presented in the stash buffer, but that wasn't the case because the wrong section type was used. I have changed the section type to &lt;code&gt;commit&lt;/code&gt;, but that doesn't make it possible to create a patch from the worktree commit, because that is a merge commit and no patches can be created from merge commits.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-10-01T18:36:54.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17063" PostTypeId="1" AcceptedAnswerId="17065" CreationDate="2015-10-01T19:51:40.857" Score="21" ViewCount="5407" Body="&lt;p&gt;RStudio provides a one-button way for produce PDF file from LaTeX+R source with Knitr. It looks great for doing reproducible research. And I am trying to configure my Emacs for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;at left buffer LaTeX+R code in Knitr way;&lt;/li&gt;&#xA;&lt;li&gt;at right buffer PDF output preview;&lt;/li&gt;&#xA;&lt;li&gt;one key combination for compiling.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If it is possible: how should I setup this, please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ESS works fine, but I don't know how to set up Knitr-way and one-button-for-compiling.)&lt;/p&gt;&#xA;" OwnerUserId="9686" LastEditorUserId="9686" LastEditDate="2015-10-01T20:30:58.360" LastActivityDate="2019-03-13T17:25:01.003" Title="how to setup Knitr workflow in Emacs?" Tags="|latex|ess|r|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17064" PostTypeId="1" CreationDate="2015-10-01T20:33:09.993" Score="17" ViewCount="805" Body="&lt;p&gt;In general, I dislike frames. Right now, I'm using&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ediff-window-setup-function #'ediff-setup-windows-plain)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To ensure that &lt;code&gt;ediff&lt;/code&gt; does not create a frame when it starts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, certain commands, like &lt;code&gt;ediff-show-registry&lt;/code&gt; still open up new frames. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can completely disable the creation of frames in &lt;code&gt;ediff&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2019-04-12T15:48:43.060" Title="Never create frame in ediff" Tags="|frames|ediff|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17065" PostTypeId="2" ParentId="17063" CreationDate="2015-10-01T21:20:18.367" Score="15" Body="&lt;h1&gt;UPDATE&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As of ESS 19.04, the &lt;code&gt;ess-noweb&lt;/code&gt; and &lt;code&gt;ess-swv&lt;/code&gt; libraries are obsolete:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Libraries for literate data analysis are obsolete and not loaded by&#xA;   default.  This includes 'ess-noweb', 'ess-swv', and related&#xA;   functionality like 'Rnw-mode'.  Users are encouraged to switch to&#xA;   one of several other packages that deal with these modes.  For&#xA;   example, polymode &lt;a href=&quot;https://github.com/polymode/poly-R/&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/polymode/poly-R/&lt;/a&gt;,&#xA;   &lt;a href=&quot;https://polymode.github.io/&quot; rel=&quot;noreferrer&quot;&gt;https://polymode.github.io/&lt;/a&gt;, or markdown-mode with edit-indirect&#xA;   &lt;a href=&quot;https://jblevins.org/projects/markdown-mode&quot; rel=&quot;noreferrer&quot;&gt;https://jblevins.org/projects/markdown-mode&lt;/a&gt;.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Consequently, my original answer (below) no longer applies. The features these libraries used to provide are now provided by polymode, and the configuration is simpler. To get minimal support, all you need is to install the &lt;code&gt;ess&lt;/code&gt;, &lt;code&gt;polymode&lt;/code&gt; and &lt;code&gt;poly-R&lt;/code&gt; packages (from MELPA, or from source if that's how you roll).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's it! Now if you open a &lt;code&gt;Rnw&lt;/code&gt; file, you should see the &lt;code&gt;PM-Rnw&lt;/code&gt; flag in the modeline, and there will be a &lt;code&gt;Polymode&lt;/code&gt; menu at the top. You can weave your file into a &lt;code&gt;.tex&lt;/code&gt; file via &lt;code&gt;M-n w&lt;/code&gt; (or the polymode menu), and export it to &lt;code&gt;.pdf&lt;/code&gt; via &lt;code&gt;M-n e&lt;/code&gt; (or the menu). You'll be prompted for an exporter the first time you do this; I just picked &lt;code&gt;knitr&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: exporting (&lt;code&gt;M-n e&lt;/code&gt;) automatically runs your code, generates the pdf and displays it, all in one go. I wasn't able to get that &quot;one-click&quot; behaviour with the old version described below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The generated files will have the word &lt;code&gt;-woven&lt;/code&gt; and &lt;code&gt;-exported&lt;/code&gt; appended. If you don't like this, you can customize the options &lt;code&gt;polymode-weaver-output-file-format&lt;/code&gt; and &lt;code&gt;polymode-exporter-output-file-format&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process is similar for RMarkdown files (&lt;code&gt;.Rmd&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full details are provided in the &lt;a href=&quot;https://polymode.github.io/&quot; rel=&quot;noreferrer&quot;&gt;polymode manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Original Answer (obsolete after ESS 19.04)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Three variables need to be set:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;ess-swv-pdflatex-commands&lt;/code&gt;, in customization group &lt;code&gt;ess-sweave&lt;/code&gt; needs to have &quot;pdflatex&quot; as the first command. i.e., it should look something like: &lt;code&gt;(&quot;pdflatex&quot; &quot;texi2pdf&quot; &quot;make&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ess-swv-processor&lt;/code&gt;, in customization group &lt;code&gt;ess-R&lt;/code&gt;, should be the value &lt;code&gt;&quot;knitr&quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ess-pdf-viewer-pref&lt;/code&gt; in the customization group &lt;code&gt;ess&lt;/code&gt; to &lt;code&gt;&quot;emacsclient&quot;&lt;/code&gt;. This assumes you are running the emacs server, or emacs is running in --daemon mode. You should also be using &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;pdf-tools&lt;/a&gt; if at all possible, as it is far preferable to the built-in Emacs pdf viewer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I use a hook to add two keybindings for calling BibTeX and texi2pdf:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ess-noweb-mode-hook 'my-noweb-hook)&#xA;&#xA;(defun my-noweb-hook ()&#xA;  (define-key ess-noweb-mode-prefix-map &quot;b&quot;&#xA;    #'(lambda () (interactive) (TeX-command &quot;BibTeX&quot; 'TeX-master-file)))&#xA;  (define-key ess-noweb-mode-prefix-map &quot;P&quot;&#xA;    #'(lambda () (interactive)&#xA;        (ess-swv-PDF &quot;texi2pdf&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once this is done, &lt;code&gt;M-n s&lt;/code&gt; will knit your document, &lt;code&gt;M-n b&lt;/code&gt; will bibtex it, and &lt;code&gt;M-n P&lt;/code&gt; will process it with pdflatex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there's no simple way for Emacs to know when knitting is completed, so you can't set this up to knit &amp;amp; latex in one step; you have to manually trigger pdflatex &lt;em&gt;after&lt;/em&gt; you've seen the knitting has finished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the multiple steps here - Rnw -&gt; Latex -&gt; PDF, I don't think you can get Synctex to keep your pdf and Rnw files to scroll together, but I'd be thrilled to be proved wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for window arrangement, I can never get them to stay where I want them. So to compensate I have become quite adept at shuffling windows and buffers as I need them ;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yihui posted a &lt;a href=&quot;http://yihui.name/knitr/demo/editors/&quot; rel=&quot;noreferrer&quot;&gt;short video&lt;/a&gt; on the knitr site demonstrating some of this.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2019-03-12T18:20:53.413" LastActivityDate="2019-03-12T18:20:53.413" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="17066" PostTypeId="2" ParentId="17056" CreationDate="2015-10-01T21:45:41.003" Score="2" Body="&lt;p&gt;&lt;strong&gt;Yank&lt;/strong&gt;'s meaning comes from English language's action verbs similar to jerk, pull, draw, force, etc. It is a more active verb than copy, paste, and other modern synonyms GUIs use. Please refer to other other responses to this question for its semantic history.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one important functional history of &lt;strong&gt;yank&lt;/strong&gt; that many modern uses of copy-and-paste ignore or oblivious to. It is the selective integration with the operating system's clipboard. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;y&lt;/kbd&gt; is the default &lt;strong&gt;yank&lt;/strong&gt; command that normally retrieves the most recent entry from the *kill** ring. However on GUIs, emacs &lt;strong&gt;yank&lt;/strong&gt;s from the system clipboard if there happens to be a more recent entry than on the application &lt;strong&gt;kill&lt;/strong&gt; ring. &lt;strong&gt;Yank&lt;/strong&gt; also plays nice with primary and secondary selections in GUIs like X-Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is this level of selective integration that sets &lt;strong&gt;yank&lt;/strong&gt; in emacs apart from other cut-copy-paste operations in other apps. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-10-01T21:45:41.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17067" PostTypeId="2" ParentId="5849" CreationDate="2015-10-02T06:14:57.473" Score="4" Body="&lt;p&gt;Non-greedy &lt;code&gt;*?&lt;/code&gt; or &lt;code&gt;+?&lt;/code&gt; postfix operators are what I usually use in these situations. In Emacs read syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;''\\(.*?\\)''&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will match anything enclosed in &lt;code&gt;''&lt;/code&gt; which does not &lt;em&gt;contain&lt;/em&gt; &lt;code&gt;''&lt;/code&gt; (because if it contained it, there would be a shorter (less-greedy) match).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b.: &lt;code&gt;.&lt;/code&gt; does not match newlines in Emacs regexps. To also allow for newlines between the quotes, you could use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;''\\(\\(?:.\\|\n\\)*?\\)''&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In either case, &lt;code&gt;\1&lt;/code&gt; is grouping the contents between the &lt;code&gt;''&lt;/code&gt; quotes.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-10-02T06:21:25.353" LastActivityDate="2015-10-02T06:21:25.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17068" PostTypeId="2" ParentId="17049" CreationDate="2015-10-02T10:04:52.343" Score="1" Body="&lt;p&gt;Not sure if I should post this as an answer or not, but anyway here it goes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding &lt;code&gt;(prefer-coding-system 'utf-8)&lt;/code&gt; before calling &lt;code&gt;org-babel-load-file&lt;/code&gt; was actually the solution. The problem was that &lt;code&gt;org-babel-load-file&lt;/code&gt; doesn't convert the .org-file unless there has been changes to the .org-file. Thus the previous version of the converted .el-file (in my case config.el) was run, and this version already had the bad characters written to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I only made changes to my init.el while tinkering with this problem, config.org wasn't modified. By removing config.el (or making a change in config.org), a new version of config.el was generated, and &lt;code&gt;(prefer-coding-system 'utf-8)&lt;/code&gt; made sure that the ÅÄÖ characters worked.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="9695" LastEditDate="2015-10-02T10:52:05.823" LastActivityDate="2015-10-02T10:52:05.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17070" PostTypeId="1" CreationDate="2015-10-02T14:36:14.803" Score="4" ViewCount="1882" Body="&lt;p&gt;I have a &lt;code&gt;src/example/foo.clj&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ns example.foo)&#xA;&#xA;(defn my-fn []&#xA;  (println &quot;Hello, world!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can open it in Emacs and spin up a REPL using &lt;code&gt;C-c M-j&lt;/code&gt; and play with it. I don't want to type long namespace names, so I alias the ones I need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (require '[example.foo :as foo])&#xA;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far so good. Everything works fine at this point.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (foo/my-fn)&#xA;; Hello, world!&#xA;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I try to use a function that doesn't exist, I get a &lt;code&gt;CompilerException&lt;/code&gt; as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (foo/my-function)&#xA;; CompilerException java.lang.RuntimeException: No such var: foo/my-function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, since obviously &lt;code&gt;foo&lt;/code&gt; still needs a lot of work, I'm actively making changes to it. I decide to rename one of my functions to something more descriptive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;src/example/foo.clj&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ns example.foo)&#xA;&#xA;(defn greet-world []&#xA;  (println &quot;Hello, world!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then save the file and reload it using &lt;code&gt;C-c C-x&lt;/code&gt;, and that's where everything seems to break. If I try to call the function using its old name, I get an &lt;code&gt;IllegalStateException&lt;/code&gt; instead of a &lt;code&gt;CompilerException&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (foo/my-fn)&#xA;; IllegalStateException Attempting to call unbound fn: #'example.foo/my-fn&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if I use its new name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (foo/greet-world)&#xA;; CompilerException java.lang.RuntimeException: No such var: foo/greet-world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So now my alias namespace is completely useless. I can, however, call the function using its full name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (example.foo/greet-world)&#xA;; Hello, world!&#xA;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But of course, if I try to run &lt;code&gt;require&lt;/code&gt; again, I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user&amp;gt; (require '[example.foo :as foo])&#xA;; IllegalStateException Alias foo already exists in namespace user, aliasing example.foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, how can I actually reload a namespace without restarting my entire REPL?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastActivityDate="2015-10-02T14:36:14.803" Title="How can I properly reload my code from the REPL?" Tags="|clojure|cider|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17071" PostTypeId="1" AcceptedAnswerId="17075" CreationDate="2015-10-02T15:51:42.190" Score="3" ViewCount="70" Body="&lt;p&gt;I seem to remember a package mentioned once, that you would activate in Emacs, and then other people could follow what happens in almost real time in your Emacs by accessing a URL with a web-browser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't for the life of me find the name of this package.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2015-10-02T18:07:14.580" LastActivityDate="2015-10-02T18:07:14.580" Title="Which package to share editing, in real-time, over http?" Tags="|remote|http|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17072" PostTypeId="1" AcceptedAnswerId="17082" CreationDate="2015-10-02T16:09:15.833" Score="6" ViewCount="1130" Body="&lt;p&gt;Very similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/12871/open-file-in-new-window-after-searching-it-with-helm&quot;&gt;this question&lt;/a&gt;. I'm using helm-projectile to find files. My Emacs frame is divided in three vertical column windows. In one of the windows I have an open file from the project I'm working on, so I invoke helm-projectile and I can find other project files. However if I open the file, it opens in the current window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to do is very similar to finding the file with helm and then &lt;code&gt;C-c o&lt;/code&gt; to open it in another window, but I would like to tell Emacs which window I want to open the file in, maybe similar to how ace-window allows you to choose the window to jump to if your current frame is split in more than 2 windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be done?&lt;/p&gt;&#xA;" OwnerUserId="631" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2021-05-17T15:50:52.203" Title="Open file in a specific window" Tags="|helm|window|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17073" PostTypeId="2" ParentId="13185" CreationDate="2015-10-02T16:14:00.710" Score="2" Body="&lt;p&gt;I have this in my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map [(shift backspace)] 'backward-delete-whitespace)&#xA;(define-key global-map [(shift delete)] 'forward-delete-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to make shift+backspace / shift+delete kill all whitespace.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And just in case someone would need these functions, here they are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun backward-delete-whitespace ()&#xA;  (interactive)&#xA;  (let ((p (point)))&#xA;    (re-search-backward &quot;[^ \t\n]+&quot; nil t)&#xA;    (forward-char)&#xA;    (delete-region p (point))))&#xA;&#xA;(defun forward-delete-whitespace ()&#xA;  (interactive)&#xA;  (re-search-forward &quot;[ \t\n]+&quot; nil t)&#xA;  (replace-match &quot;&quot; nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="46" LastActivityDate="2015-10-02T16:14:00.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17074" PostTypeId="2" ParentId="16909" CreationDate="2015-10-02T16:22:30.000" Score="1" Body="&lt;p&gt;To expand on the answer by @sho.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun jlp/org-link-info (link)&#xA;  (let ((path (org-element-property :path link))&#xA;        (type (org-element-property :type link))&#xA;        (desc (substring-no-properties (nth 2 link))))&#xA;    (list type path desc)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(org-element-map (org-element-parse-buffer) 'link 'jlp/org-link-info)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will return a list of all links in the buffer of format&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(list&#xA;  (list link-type link-path link-description))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then filter by link type &lt;code&gt;file&lt;/code&gt;,&lt;code&gt;fuzzy&lt;/code&gt;,&lt;code&gt;elisp&lt;/code&gt;,etc using &lt;code&gt;nth 0&lt;/code&gt;, pull all the links (for example to open in bulk) using &lt;code&gt;nth 1&lt;/code&gt; and the descriptions &lt;code&gt;nth 2&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-10-02T16:22:30.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17075" PostTypeId="2" ParentId="17071" CreationDate="2015-10-02T16:24:29.837" Score="3" Body="&lt;p&gt;You might be thinking about &lt;code&gt;impatient-mode&lt;/code&gt;, which is available in MELPA, and also &lt;a href=&quot;https://github.com/netguy204/imp.el&quot; rel=&quot;nofollow&quot;&gt;on GitHub&lt;/a&gt;.  I haven't tried it myself, but according to &lt;a href=&quot;http://sachachua.com/blog/2015/02/emacs-peer-peer-coaching-easier-use-impatient-mode-share-buffer/&quot; rel=&quot;nofollow&quot;&gt;Sacha Chua's blog post&lt;/a&gt; about it it seems to be easy to use:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Install the &lt;code&gt;impatient-mode&lt;/code&gt; package.&lt;/li&gt;&#xA;  &lt;li&gt;Call &lt;code&gt;M-x httpd-start&lt;/code&gt;.&lt;/li&gt;&#xA;  &lt;li&gt;Configure the firewall to allow incoming connections.&lt;/li&gt;&#xA;  &lt;li&gt;Put the selected buffer into &lt;code&gt;impatient-mode&lt;/code&gt;.&lt;/li&gt;&#xA;  &lt;li&gt;Share the link with my IP address (form: &lt;code&gt;http://my.ip.ad.dress:8080/imp/&lt;/code&gt;)&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-10-02T16:24:29.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17077" PostTypeId="1" AcceptedAnswerId="17080" CreationDate="2015-10-02T17:30:15.367" Score="3" ViewCount="1298" Body="&lt;p&gt;When I call Dired with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;Dired&lt;/code&gt;, I got the IDO window with the file structure and when I press Enter, he goes to Dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I disable IDO in Emacs, and I do &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;Dired&lt;/code&gt; again, I got the &lt;code&gt;Helm-dired-mode&lt;/code&gt;. When I confirm the current directory path, the Dired open anyways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to skip IDO/Helm directly when I want to open Dired? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2017-07-31T11:22:43.920" Title="How can I skip Helm/IDO when I want to open Dired?" Tags="|helm|dired|ido|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17078" PostTypeId="2" ParentId="17077" CreationDate="2015-10-02T17:57:23.510" Score="2" Body="&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then press &lt;kbd&gt;C-x C-j&lt;/kbd&gt; to open &lt;code&gt;dired&lt;/code&gt; in the current directory.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-10-02T17:57:23.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17079" PostTypeId="2" ParentId="17077" CreationDate="2015-10-02T18:40:58.563" Score="4" Body="&lt;p&gt;If you want to disable helm completion for some specific command when &lt;code&gt;helm-mode&lt;/code&gt; is on, you can modify the user option &lt;code&gt;helm-completing-read-handlers-alist&lt;/code&gt;, for example, for you request&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'helm-completing-read-handlers-alist&#xA;             '(dired . nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can read its docstring to learn how it works.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-02T18:40:58.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17080" PostTypeId="2" ParentId="17077" CreationDate="2015-10-02T18:53:57.763" Score="4" Body="&lt;p&gt;Thanks for all the answers. After inspecting it further, I found the option &lt;code&gt;dired-jump&lt;/code&gt; which does the same as &lt;code&gt;dired&lt;/code&gt; but without the IDO/Helm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The docstring tells the following &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Jump to Dired buffer corresponding to current buffer.&#xA;If in a file, Dired the current directory and move to file's line.&#xA;If in Dired already, pop up a level and goto old directory's line.&#xA;In case the proper Dired file line cannot be found, refresh the dired&#xA;buffer and try again.&#xA;When OTHER-WINDOW is non-nil, jump to Dired buffer in other window.&#xA;Interactively with prefix argument, read FILE-NAME and&#xA;move to its line in dired.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help anyway! :)&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-02T18:53:57.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17081" PostTypeId="1" AcceptedAnswerId="17083" CreationDate="2015-10-02T19:51:39.333" Score="8" ViewCount="80" Body="&lt;p&gt;The command &lt;code&gt;C-l&lt;/code&gt; scrolls the current line to center, top, bottom. Is there an analogous command that scrolls the current &lt;em&gt;column&lt;/em&gt; to center, left, and right?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2015-10-02T21:44:30.790" LastActivityDate="2015-10-02T21:44:30.790" Title="Is there a column equivalent of `C-l`?" Tags="|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17082" PostTypeId="2" ParentId="17072" CreationDate="2015-10-02T20:15:12.440" Score="6" Body="&lt;p&gt;Allowing user to custom action is a great feature of helm, for example, to use &lt;code&gt;ace-window&lt;/code&gt; to select a window for buffer to switch, all you need to do is implement it as an action:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-buffer-ace-window (buffer)&#xA;  &amp;quot;Use ‘ace-window’ to select a window to display BUFFER.&amp;quot;&#xA;  (ace-select-window)&#xA;  (switch-to-buffer buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;then use this action:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'helm-type-buffer-actions&#xA;             '(&amp;quot;Switch to buffer in Ace window ‘C-c C-e'&amp;quot; . helm-buffer-ace-window)&#xA;             :append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now, you should be able to use this new action from all helm sources which use &lt;code&gt;helm-type-buffer-actions&lt;/code&gt; such as in &lt;kbd&gt;C-c p b&lt;/kbd&gt; (&lt;code&gt;helm-projectile-switch-to-buffer&lt;/code&gt;) and &lt;code&gt;helm-buffers-list&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;(Optional) Set up Key Binding for Action&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;You already can invoke the above action &lt;code&gt;helm-buffer-ace-window&lt;/code&gt; from helm's Action Menu, if you like, it is also possible to assign a key binding for it, for example,  &lt;kbd&gt;C-c C-e&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;p&gt;Firstly, wrap that action with a interactive command:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-buffer-run-ace-window ()&#xA;  (interactive)&#xA;  (with-helm-alive-p&#xA;    (helm-exit-and-execute-action 'helm-buffer-ace-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Secondly, bind &lt;kbd&gt;C-c C-e&lt;/kbd&gt; to the command:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-key helm-buffer-map (kbd &amp;quot;C-c C-e&amp;quot;) #'helm-buffer-run-ace-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;The rest of code for Files:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-find-ace-window (file)&#xA;  &amp;quot;Use ‘ace-window' to select a window to display FILE.&amp;quot;&#xA;  (ace-select-window)&#xA;  (find-file file))&#xA;&#xA;(add-to-list 'helm-find-files-actions&#xA;             '(&amp;quot;Find File in Ace window&amp;quot; . helm-find-ace-window)&#xA;             :append)&#xA;&#xA;(defun helm-file-run-ace-window ()&#xA;  (interactive)&#xA;  (with-helm-alive-p&#xA;    (helm-exit-and-execute-action 'helm-find-ace-window)))&#xA;&#xA;;;; For `helm-find-files'&#xA;(define-key helm-find-files-map (kbd &amp;quot;C-c C-e&amp;quot;) #'helm-file-run-ace-window)&#xA;&#xA;;; For file commands in `helm-projectile'&#xA;;; NOTE: You have to restart Emacs to make following work since helm-projectile&#xA;;; can't recompute at-run-time, this is bad, it also has other issues, so I&#xA;;; don't use this package.&#xA;(define-key helm-projectile-find-file-map (kbd &amp;quot;C-c C-e&amp;quot;) #'helm-file-run-ace-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2021-05-17T15:50:52.203" LastActivityDate="2021-05-17T15:50:52.203" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="17083" PostTypeId="2" ParentId="17081" CreationDate="2015-10-02T20:55:08.717" Score="4" Body="&lt;p&gt;There doesn't seem to be one built-in, however, there is something similar: &lt;kbd&gt;M-g TAB&lt;/kbd&gt; - this will ask you for the column to move to.  You can use the function below (bind it to some key you like) to do exactly what you ask:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/goto-midline ()&#xA;  (interactive)&#xA;  (goto-char&#xA;   (+ (point)&#xA;      (save-excursion&#xA;        (/ (- (progn&#xA;                (move-end-of-line 1) (point))&#xA;              (progn&#xA;                (move-beginning-of-line 0) (point)))&#xA;           2)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-10-02T20:55:08.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17084" PostTypeId="1" CreationDate="2015-10-02T23:08:49.970" Score="0" ViewCount="130" Body="&lt;p&gt;I have followed the instructions &lt;a href=&quot;https://www.gnu.org/software/auctex/download-for-windows.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, in a nutshell:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;download/unpack AUCTeX in a directory for installation&lt;/li&gt;&#xA;&lt;li&gt;download install cygwin&lt;/li&gt;&#xA;&lt;li&gt;download/install Emacs (that was already done)&lt;/li&gt;&#xA;&lt;li&gt;download/install MikTeX (or any other TeX system)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From a cygwin shell I then ran:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --prefix=&quot;C:\Program Files (x86)\Emacs&quot; --with-texmf-dir=&quot;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am not 100% sure about the location of the TeX installation, however the error I get is the following:   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;checking for make... no&#xA;configure: error: make not found, aborting!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so i looks like &lt;code&gt;configure&lt;/code&gt; does not find the &lt;code&gt;make&lt;/code&gt; program. Indeed, I can't find it on the computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints on what I am doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="9642" LastActivityDate="2015-10-02T23:08:49.970" Title="AUCTeX installation error in Windows" Tags="|auctex|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17085" PostTypeId="1" AcceptedAnswerId="17086" CreationDate="2015-10-03T00:03:42.230" Score="4" ViewCount="766" Body="&lt;p&gt;When I reposition the cursor in &lt;strong&gt;term-mode&lt;/strong&gt; or &lt;strong&gt;ansi-term&lt;/strong&gt; with &lt;em&gt;M-left&lt;/em&gt; or &lt;em&gt;M-right&lt;/em&gt;, it always returns to its original position (see animation below). Is this behavior standard? Is there a way to change it so that it behaves as it would in other buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Khrd2.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Khrd2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user9688" LastEditorDisplayName="user9688" LastEditDate="2015-10-03T00:25:12.053" LastActivityDate="2015-10-03T01:01:06.907" Title="Undesirable Cursor Jump After Movement with M-left or M-right in Term-Mode" Tags="|cursor|ansi-term|term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17086" PostTypeId="2" ParentId="17085" CreationDate="2015-10-03T00:42:28.753" Score="3" Body="&lt;p&gt;The problem here is that Emacs is moving the cursor position in the buffer, but no input is being sent to the process running in the terminal, meaning that the apparent state does not match the actual state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be reported as a &lt;code&gt;term-char-mode&lt;/code&gt; bug, but you can fix it by binding the Ctrl- and Meta-modified left and right cursor keys in &lt;code&gt;term-raw-map&lt;/code&gt; to send the same escape codes that are sent when you type &lt;code&gt;M-b&lt;/code&gt; and &lt;code&gt;M-f&lt;/code&gt;, which is pretty analogous to the behaviour you'd expect from those bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tangentially I also have some safety net code to try to prevent any scenario where one of the &lt;code&gt;kill&lt;/code&gt; or &lt;code&gt;yank&lt;/code&gt; commands is executed in &lt;code&gt;term-char-mode&lt;/code&gt;, because that would cause a similarly broken/confusing state; so I've included that code here for good measure.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;term&quot;&#xA;  '(progn&#xA;     ;; Fix forward/backward word when (term-in-char-mode).&#xA;     (define-key term-raw-map (kbd &quot;&amp;lt;C-left&amp;gt;&quot;)&#xA;       (lambda () (interactive) (term-send-raw-string &quot;\eb&quot;)))&#xA;     (define-key term-raw-map (kbd &quot;&amp;lt;M-left&amp;gt;&quot;)&#xA;       (lambda () (interactive) (term-send-raw-string &quot;\eb&quot;)))&#xA;     (define-key term-raw-map (kbd &quot;&amp;lt;C-right&amp;gt;&quot;)&#xA;       (lambda () (interactive) (term-send-raw-string &quot;\ef&quot;)))&#xA;     (define-key term-raw-map (kbd &quot;&amp;lt;M-right&amp;gt;&quot;)&#xA;       (lambda () (interactive) (term-send-raw-string &quot;\ef&quot;)))&#xA;     ;; Disable killing and yanking in char mode (term-raw-map).&#xA;     (mapc&#xA;      (lambda (func)&#xA;        (eval `(define-key term-raw-map [remap ,func]&#xA;                 (lambda () (interactive) (ding)))))&#xA;      '(backward-kill-paragraph&#xA;        backward-kill-sentence backward-kill-sexp backward-kill-word&#xA;        bookmark-kill-line kill-backward-chars kill-backward-up-list&#xA;        kill-forward-chars kill-line kill-paragraph kill-rectangle&#xA;        kill-region kill-sentence kill-sexp kill-visual-line&#xA;        kill-whole-line kill-word subword-backward-kill subword-kill&#xA;        yank yank-pop yank-rectangle))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-10-03T01:01:06.907" LastActivityDate="2015-10-03T01:01:06.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17088" PostTypeId="1" AcceptedAnswerId="17090" CreationDate="2015-10-03T01:12:27.793" Score="1" ViewCount="109" Body="&lt;p&gt;Recently my TAB key started acting very strange. At the left end of the line it indents my code normally, which it should also do if I hit TAB anywhere in the line. But now, if I'm in the middle of the line it tries to do a TAGS search. I don't have a tags file and I don't want one, thank you very much. &#xA;I'm using Prelude and believe it has to do with Projectile, which I've never used. When I ask emacs what the keybinding of the TAB key is with &lt;code&gt;C-h k&lt;/code&gt;, it lies and says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;It is bound to TAB.&#xA;&#xA;(indent-for-tab-command &amp;amp;optional ARG)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I saw this last week I disabled Projectile mode and that helped but now it doesn't seem to help. &#xA;How can I find out what's binding this key and get rid of it? &lt;/p&gt;&#xA;" OwnerUserId="9712" LastActivityDate="2015-10-03T02:40:35.797" Title="How do I get rid of unwanted binding of the TAB key?" Tags="|key-bindings|projectile|prelude|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17089" PostTypeId="2" ParentId="7482" CreationDate="2015-10-03T02:29:59.420" Score="12" Body="&lt;p&gt;What you want can be achieved cleanly using hook provided by ediff (which if read the documentation seem to be provided for this exact purpose), advices are not needed. The relevant hooks are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &lt;code&gt;ediff-quit-hook&lt;/code&gt;, from the documentation&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hooks to run in the Ediff control buffer after finishing Ediff.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;2) &lt;code&gt;ediff-before-setup-hook&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hooks to run before Ediff begins to set up windows and buffers. This&#xA;  hook can be used to save the previous window config, which can be&#xA;  restored on ediff-quit or ediff-suspend.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The approach is similar to @abo-abo's approach. We save the window configuration before ediff is setup using the &lt;code&gt;ediff-before-setup-hook&lt;/code&gt; and restore the stored window configuration in &lt;code&gt;ediff-quit-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-ediff-last-windows nil)&#xA;&#xA;(defun my-store-pre-ediff-winconfig ()&#xA;  (setq my-ediff-last-windows (current-window-configuration)))&#xA;&#xA;(defun my-restore-pre-ediff-winconfig ()&#xA;  (set-window-configuration my-ediff-last-windows))&#xA;&#xA;(add-hook 'ediff-before-setup-hook #'my-store-pre-ediff-winconfig)&#xA;(add-hook 'ediff-quit-hook #'my-restore-pre-ediff-winconfig)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-10-03T02:29:59.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17090" PostTypeId="2" ParentId="17088" CreationDate="2015-10-03T02:40:35.797" Score="1" Body="&lt;p&gt;&lt;code&gt;indent-for-tab-command&lt;/code&gt; is a dispatcher for other functions. &lt;code&gt;TAB&lt;/code&gt; can still be bound to that and not do what you were expecting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you read the help, it tells you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The function called to actually indent the line or insert a tab&#xA;  is given by the variable &lt;code&gt;indent-line-function&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(assuming no active region or prefix argument, as also covered in the help.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without looking at the value of that variable, you (and we) can't know what's actually happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's still a mystery, then figure out which tags function is being called, trigger the debugger on that (using &lt;code&gt;M-x debug-on-entry&lt;/code&gt;), and take a look at the stack trace when it gets called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;M-x cancel-debug-on-entry&lt;/code&gt; once you no longer need it.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-10-03T02:40:35.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17091" PostTypeId="1" AcceptedAnswerId="17093" CreationDate="2015-10-03T03:53:51.027" Score="9" ViewCount="1320" Body="&lt;p&gt;Is it possible for a code-block in one org file to include a noweb reference to a code-block in another org file?&lt;/p&gt;&#xA;" OwnerUserId="9713" LastActivityDate="2015-11-02T16:33:04.363" Title="Including code-block in a another file" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17093" PostTypeId="2" ParentId="17091" CreationDate="2015-10-03T09:20:57.923" Score="10" Body="&lt;p&gt;In the case of dereferencing noweb references for export the include feature of Org does the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example (see the Org mode info pages for the fullest-disk code):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh&#xA;&amp;lt;&amp;lt;fullest-disk&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;#+INCLUDE: &quot;path to the org file defining fullest-disk&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;AFAICS the include feature does not work for tangling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For getting a tangle one could concatenate the files.  E.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cat my-code-blocks-lib.org main.org &amp;gt; tangle-me.org&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then tangle file &lt;code&gt;tangle-me.org&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also note the &lt;strong&gt;library of babel&lt;/strong&gt; aka &lt;strong&gt;lob&lt;/strong&gt;.  You can ingest a file into the lob which means that its source code blocks are available in every Org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. have a file chilllib.org:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: chill&#xA;#+BEGIN_SRC shell&#xA;echo chill...&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then ingest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x org-babel-lob-ingest chilllib.org&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and use e.g. the following block in some Org file for execution or tangling&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC shell :tangle yes :noweb yes :shebang #!/bin/sh&#xA;&amp;lt;&amp;lt;chill&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8943" LastEditorUserId="8943" LastEditDate="2015-10-03T16:12:03.000" LastActivityDate="2015-10-03T16:12:03.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17094" PostTypeId="2" ParentId="16983" CreationDate="2015-10-03T10:49:49.100" Score="16" Body="&lt;p&gt;If you use &lt;code&gt;M-S-Up&lt;/code&gt; and &lt;code&gt;M-S-Down&lt;/code&gt; on the CLOCK line of a task then, in addition to adjusting that clock time, it will also adjust the clock entry of the previously clocked-in task.&lt;/p&gt;&#xA;&lt;p&gt;Practically what this means is that, in your scenario, if you clock into your new task 40 minutes late, just adjust its start clocking time back 40 minutes with &lt;code&gt;M-S-Down&lt;/code&gt; and it will also adjust the end time of the previous task so there's no overlap.&lt;/p&gt;&#xA;&lt;p&gt;I use this all the time for exactly the scenario you describe.&lt;/p&gt;&#xA;" OwnerUserId="737" LastEditorUserId="737" LastEditDate="2021-07-16T17:02:20.903" LastActivityDate="2021-07-16T17:02:20.903" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="17095" PostTypeId="1" AcceptedAnswerId="17096" CreationDate="2015-10-03T10:50:34.810" Score="5" ViewCount="346" Body="&lt;p&gt;I started to use Dired. The movie files will be opened by another external application (VLC) with the help of the package &lt;a href=&quot;https://www.emacswiki.org/emacs/OpenWith&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;openwith&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So I would like to supress the confirmation &lt;code&gt;File foobar.avi is too large, really open? (y or n)&lt;/code&gt; for movie files.&lt;/p&gt;&#xA;&lt;p&gt;When exploring this feature, I found the variable &lt;code&gt;large-file-warning-thresold&lt;/code&gt;, the docstring is:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;The variable is large-file-warning-threshold. Documentation:&#xA;&#xA;large-file-warning-threshold is a variable defined in `files.el'.&#xA;Its value is 10000000&#xA;&#xA;Documentation:&#xA;Maximum size of file above which a confirmation is requested.&#xA;When nil, never request confirmation.&#xA;&#xA;You can customize this variable.&#xA;&#xA;This variable was introduced, or its default value was changed, in&#xA;version 22.1 of Emacs.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So I would like to disable this thresold for only specific extensions like &lt;code&gt;.mp4&lt;/code&gt; or &lt;code&gt;.mkv&lt;/code&gt;, but don't change it for another extensions.&lt;/p&gt;&#xA;&lt;p&gt;By reading the source, look at the function to open files: C-h k C-x C-f (or C-h f find-file RET). Click on files.el to browse the source file (you must have the Lisp sources installed). Don't read the code — it's pretty big — but search for parts of the message in that file. You'll find&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun abort-if-file-too-large (size op-type filename)&#xA;  &amp;quot;If file SIZE larger than `large-file-warning-threshold', allow user to abort.&#xA;OP-TYPE specifies the file operation being performed (for message to user).&amp;quot;&#xA;  (when (and large-file-warning-threshold size&#xA;             (&amp;gt; size large-file-warning-threshold)&#xA;             (not (y-or-n-p&#xA;                   (format &amp;quot;File %s is large (%dMB), really %s? &amp;quot;&#xA;                           (file-name-nondirectory filename)&#xA;                           (/ size 1048576) op-type))))&#xA;    (error &amp;quot;Aborted&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The message is only displayed when some conditions are met. The first condition is large-file-warning-threshold (interpreted as a boolean), i.e. large-file-warning-threshold must be non-nil. So you can disable the message by setting that variable to nil. (You can confirm that it's a global variable by looking at its definition in the same file — it's a customizable item, and the documentation explains how it's used if you aren't familiar enough with Lisp and only figured out that the variable mattered in some way.)&lt;/p&gt;&#xA;&lt;p&gt;So I would add the condition for &lt;code&gt;.mp4&lt;/code&gt; and &lt;code&gt;.mkv4&lt;/code&gt; files.&lt;/p&gt;&#xA;&lt;p&gt;Any idea how I could achieve that, without fiddling with the source code for Dired? I could use &lt;code&gt;defadvice&lt;/code&gt;, but it's currently unclear to me how I could apply extra conditional for confirmation messages.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="13275" LastEditDate="2021-02-02T13:13:37.650" LastActivityDate="2021-02-02T13:13:37.650" Title="How supress Dired confirmation of large file for specific extensions?" Tags="|dired|openwith|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="17096" PostTypeId="2" ParentId="17095" CreationDate="2015-10-03T11:36:06.937" Score="7" Body="&lt;p&gt;You're on the right track. This should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-ok-large-file-types&#xA;  (rx &quot;.&quot; (or &quot;mp4&quot; &quot;mkv&quot;) string-end)&#xA;  &quot;Regexp matching filenames which are definitely ok to visit,&#xA;even when the file is larger than `large-file-warning-threshold'.&quot;)&#xA;&#xA;(defadvice abort-if-file-too-large (around my-check-ok-large-file-types)&#xA;  &quot;If FILENAME matches `my-ok-large-file-types', do not abort.&quot;&#xA;  (unless (string-match-p my-ok-large-file-types (ad-get-arg 2))&#xA;    ad-do-it))&#xA;(ad-activate 'abort-if-file-too-large)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-10-03T11:36:06.937" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17097" PostTypeId="2" ParentId="17058" CreationDate="2015-10-03T11:46:55.507" Score="0" Body="&lt;p&gt;It turns out that changing the appearance of the cursor to a bar is not possible [&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/1198&quot; rel=&quot;nofollow&quot;&gt;reference&lt;/a&gt;]. If one really don't want a box an underline is possible instead. For this change the relevant part in&lt;code&gt;helm--set-header-line&lt;/code&gt; function to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-text-property&#xA; ;; Increment pos to handle the space before prompt (i.e `pref').&#xA; (1+ pos) (+ 2 pos)&#xA; 'face 'underline header-line-format)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-10-03T11:46:55.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17098" PostTypeId="1" AcceptedAnswerId="17099" CreationDate="2015-10-03T14:16:15.243" Score="9" ViewCount="715" Body="&lt;p&gt;I have some basic questions about elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often see something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward &quot;something&quot; nil 'noerror)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And sometimes I see something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward &quot;something&quot; nil :noerror)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the difference and should I prefer one form over the other?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand everything but the empty list evaluates to true in a boolean context. But how comes the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the searchterm &quot;something&quot; does not exist in the buffer the point jumps to the end of the buffer when &lt;code&gt;'noerror&lt;/code&gt; is used instead of &lt;code&gt;t&lt;/code&gt;. When &lt;code&gt;t&lt;/code&gt; is used the point stays where it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward &quot;something&quot; nil 'noerror);; 1.Evaluate this&#xA;&#xA;;; end of buffer 2.point jumps here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Second case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward &quot;something&quot; nil t);; 1.Evaluate this, 2. Point stays here&#xA;&#xA;;; end of buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="105" LastEditDate="2016-06-22T20:19:04.267" LastActivityDate="2023-02-25T07:22:08.127" Title="Understanding elisp idiom(boolean values vs. quoted arguments)?" Tags="|boolean|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17099" PostTypeId="2" ParentId="17098" CreationDate="2015-10-03T14:24:59.603" Score="13" Body="&lt;p&gt;Boolean values in elisp work as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;nil&lt;/code&gt; and &lt;code&gt;()&lt;/code&gt; (which, as you've observed, are the same thing) are false&lt;/li&gt;&#xA;&lt;li&gt;Absolutely anything else is true.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;t&lt;/code&gt; symbol exists as a 'pure' value of true (when there's no benefit to using another value), but most functions will try to return something which might be otherwise useful, whenever possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) nil and t&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it comes to using keyword arguments or other symbols as a non-&lt;code&gt;nil&lt;/code&gt; value when the code &lt;em&gt;only&lt;/em&gt; cares about &lt;code&gt;nil&lt;/code&gt; or non-&lt;code&gt;nil&lt;/code&gt;, it's really just a matter of personal preference. There's no difference in terms of execution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I once &lt;a href=&quot;https://stackoverflow.com/a/7791820/324105&quot;&gt;asked the same thing&lt;/a&gt;, and was informed that the keyword argument approach is a more Common Lisp-ish method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I've settled on using keyword arguments myself, partly for the syntax highlighting, and partly because it better differentiates them from variable and function symbols.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your specific example, the function &lt;em&gt;does&lt;/em&gt; differentiate between various non-&lt;code&gt;nil&lt;/code&gt; values, and that behaviour is covered by its docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Optional third argument, if &lt;code&gt;t&lt;/code&gt;, means if fail just return &lt;code&gt;nil&lt;/code&gt; (no error).&#xA;    If not &lt;code&gt;nil&lt;/code&gt; and not &lt;code&gt;t&lt;/code&gt;, move to limit of search and return &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In general you'll notice that docstrings tend to refer to &quot;non-nil&quot; rather than &quot;true&quot; or &quot;t&quot;. If you do see &quot;t&quot; then there's a fair chance that it's a special case.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-04T07:19:48.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17101" PostTypeId="1" AcceptedAnswerId="17103" CreationDate="2015-10-03T14:30:52.727" Score="6" ViewCount="518" Body="&lt;p&gt;In Dired, you can mark files each for each and do something with it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there is any way to allow visual selection of files in Dired, so you can mark every line inside the visual region? Then there is no need to mark every file again and again. I found nothing in Emacs communities about this. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-03T17:22:11.300" Title="How visually select files in Dired, in order to mark it at once?" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17102" PostTypeId="2" ParentId="10606" CreationDate="2015-10-03T14:54:10.480" Score="0" Body="&lt;p&gt;You might want to check out emacs-eclim which recently added debugging support, using gud, allowing the user to debug remote processes and junit tests alike. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The elisp code making this possible for eclim may at the very least be a good starting point to achieve what you want: &lt;a href=&quot;https://github.com/senny/emacs-eclim/blob/master/eclim-debug.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/senny/emacs-eclim/blob/master/eclim-debug.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9721" LastActivityDate="2015-10-03T14:54:10.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17103" PostTypeId="2" ParentId="17101" CreationDate="2015-10-03T15:18:34.340" Score="5" Body="&lt;p&gt;Start a selection with &lt;code&gt;C-SPC&lt;/code&gt;, move point to the end of the selection, then hit &lt;code&gt;m&lt;/code&gt; to mark all the lines.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-03T15:18:34.340" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17104" PostTypeId="2" ParentId="17101" CreationDate="2015-10-03T15:32:36.123" Score="2" Body="&lt;p&gt;Yes, when the region is active, &lt;strong&gt;&lt;code&gt;m&lt;/code&gt;&lt;/strong&gt; marks all of the files selected by it. You can then act on the marked files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it can often be easier to use the &lt;em&gt;mouse&lt;/em&gt; to select the files, and then use it to act on those selected. If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then you can do this.  You can do more with the files, besides just marking them.  &lt;code&gt;mouse-3&lt;/code&gt; gives you a &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus#RegionToActOnFiles&quot; rel=&quot;nofollow noreferrer&quot;&gt;popup menu&lt;/a&gt; for acting on the files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5Qfmh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5Qfmh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If no region is active, then &lt;code&gt;mouse-3&lt;/code&gt; shows a menu for acting on just the file where you clicked &lt;code&gt;mouse-3&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you also use library &lt;a href=&quot;http://www.emacswiki.org/emacs/Mouse3&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;mouse3.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; (the code is &lt;a href=&quot;http://www.emacswiki.org/emacs/download/mouse3.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;) then you can optionally use its popup menu, which is specially adapted for Dired, rather than the simpler menu shown above. Here is a screenshot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XHpAf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XHpAf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-03T17:22:11.300" LastActivityDate="2015-10-03T17:22:11.300" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17105" PostTypeId="2" ParentId="17098" CreationDate="2015-10-03T15:57:47.407" Score="16" Body="&lt;p&gt;Some historical reference is due.&lt;/p&gt;&#xA;&lt;p&gt;Emacs Lisp borrows many things from Common Lisp, but the similarity is only surface deep.  Colon symbol in Common Lisp is a namespace qualifier.  Canonical symbol names have two parts: the name of the package and the name of the symbol in that package, so, for example, &lt;code&gt;cl-user:apropos&lt;/code&gt; is a symbol defined in package &lt;code&gt;cl-user&lt;/code&gt;.  There is also a special keyword package automatically imported by Common Lisp when it is started.  This package is used to communicate between other packages (so that if packages need to send symbolical information to each other, they wouldn't fight over who has to declare it).  As you might have guessed, symbols in that package are written with the leading colon.&lt;/p&gt;&#xA;&lt;p&gt;Emacs Lisp doesn't have a concept of packages, but the colon is still special in that it instructs the reader to interpret the expression as self-evaluating symbol (i.e. it is a variable whose value is that variable itself).  There are several such built-in self-evaluating symbols: &lt;code&gt;t&lt;/code&gt; and &lt;code&gt;nil&lt;/code&gt; are examples I'll write about later.&lt;/p&gt;&#xA;&lt;p&gt;The apostrophe is also borrowed from Common Lisp, where it is a standard reader macro (i.e. it is a code that the Lisp interpreter executes while reading in the source of the program).  It expands as follows: &lt;code&gt;'x -&amp;gt; (quote x)&lt;/code&gt;, where &lt;code&gt;(quote ...)&lt;/code&gt; is a special form which prevents the Lisp interpreter from evaluating the contents of the expression inside.  Emacs Lisp has three built-in reader macros: &lt;code&gt;'&lt;/code&gt;, &lt;code&gt;`&lt;/code&gt; and &lt;code&gt;#'&lt;/code&gt;, but you cannot add your own.  The first two expand to &lt;code&gt;(quote ...)&lt;/code&gt;, however the second allows special syntax for building the unevaluated expression.  &lt;code&gt;#'&lt;/code&gt; expands to the &lt;code&gt;(function ...)&lt;/code&gt; form, which instructs the interpreter that the value must be looked up in the function namespace.&lt;/p&gt;&#xA;&lt;p&gt;Symbols in Emacs Lisp must evaluate to some value (similar to variables in other languages) otherwise it is an error.  However, you may prevent evaluation by using the quote form.&lt;/p&gt;&#xA;&lt;p&gt;Finally, the difference between:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward &amp;quot;something&amp;quot; nil 'noerror)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(search-forward &amp;quot;something&amp;quot; nil :noerror)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Is that in the first case you called &lt;code&gt;search-forward&lt;/code&gt; with a symbol with no value, for which only the name is known, and in the second case you've called this function with a symbol whose value is this symbol itself.  It so happens that this function doesn't care about which one you use.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Types are an important programming tool for automatic verification of programs.  Emacs Lisp type system is similar to Common Lisp in that its &lt;a href=&quot;https://en.wikipedia.org/wiki/Top_type&quot; rel=&quot;nofollow noreferrer&quot;&gt;universal type&lt;/a&gt; (written as &lt;code&gt;t&lt;/code&gt;) is the type from which all other types are derived.  On the other hand, &lt;code&gt;nil&lt;/code&gt; is the type from which no type is derived (the complement of &lt;code&gt;t&lt;/code&gt;).  This is unlike many popular programming languages, which may not have a concept of universal type, or have a distinct Boolean type.&lt;/p&gt;&#xA;&lt;p&gt;Yet again, unfortunately, Emacs Lisp didn't copy this part precisely from Common Lisp, and the &lt;code&gt;type-of&lt;/code&gt; function gives confusing results for &lt;code&gt;t&lt;/code&gt; and &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Emacs Lisp:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(type-of t) ; symbol&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Common Lisp&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(type-of t) ; BOOLEAN&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Common Lisp extension of Emacs Lisp has a function &lt;code&gt;cl-typep&lt;/code&gt; which might, however, help understand the relationship.  So, for example&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(cl-typep 'noerror t) ; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;i.e. whatever &lt;code&gt;'noerror&lt;/code&gt; is it is of type &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="13275" LastEditDate="2023-02-25T07:22:08.127" LastActivityDate="2023-02-25T07:22:08.127" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17106" PostTypeId="2" ParentId="17030" CreationDate="2015-10-03T18:31:04.867" Score="1" Body="&#xA;&#xA;&lt;p&gt;So I'm not sure I understood your question but were you trying to do this?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun vimish-fold-toggle ()&#xA;  &quot;Toggle fold at point.&quot;&#xA;  (interactive)&#xA;  (let ((there-is-a-fold-at-point nil))&#xA;    (dolist (overlay (overlays-at (point)))&#xA;      (let ((type (overlay-get overlay 'type)))&#xA;        (when (eq type 'vimish-fold--folded)&#xA;          (vimish-fold-unfold)&#xA;          (setq there-is-a-fold-at-point t))&#xA;        (when (eq type 'vimish-fold--unfolded)&#xA;          (vimish-fold-refold)&#xA;          (setq there-is-a-fold-at-point t))))&#xA;    (unless there-is-a-fold-at-point&#xA;      (foobar))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-10-03T18:31:04.867" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17108" PostTypeId="1" AcceptedAnswerId="17110" CreationDate="2015-10-03T19:25:32.787" Score="1" ViewCount="43" Body="&lt;p&gt;The theme I'm using on emacs (zenburn) makes JDEE custom syntax coloring very hard to read. I'd like JDEE to obey the color theme I've already chosen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to prevent a mode from changing the syntax coloring?&lt;/p&gt;&#xA;" OwnerUserId="2804" LastActivityDate="2015-10-03T21:21:28.360" Title="How can a mode be prevented from changing syntax coloring?" Tags="|themes|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17109" PostTypeId="2" ParentId="2722" CreationDate="2015-10-03T20:05:33.557" Score="3" Body="&lt;p&gt;I succeeded to use a Unicode char U+2008 PUNCTUATION SPACE to split the time style:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-listing-switches (purecopy (concat &amp;quot;-AhFlv --group-directories-first --time-style=+%d/%m/%y&amp;quot; (string ?\u2008) &amp;quot;%R&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Although I don't know whether it has any implication on &lt;code&gt;dired&lt;/code&gt;. Note, that you &lt;strong&gt;must&lt;/strong&gt; also add this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq directory-listing-before-filename-regexp&#xA;      (purecopy (concat &amp;quot;\\([0-2][0-9]:[0-5][0-9] \\)\\|&amp;quot;&#xA;                        directory-listing-before-filename-regexp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to prevent a “No file on this line” error.&lt;/p&gt;&#xA;&lt;p&gt;Tested with 24.5.1 and 25.0.50.1 on Arch Linux.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fvAcj.png&quot; alt=&quot;screenshot&quot; title=&quot;screenshot&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="2477" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-04T19:38:50.243" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="17110" PostTypeId="2" ParentId="17108" CreationDate="2015-10-03T21:21:28.360" Score="0" Body="&lt;p&gt;Does the theme itself make use of font-lock? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, then just turn off &lt;code&gt;font-lock-mode&lt;/code&gt; in the mode (JDEE mode or whatever). &lt;code&gt;font-lock-mode&lt;/code&gt; is buffer-local.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-03T21:21:28.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17111" PostTypeId="1" CreationDate="2015-10-03T21:59:10.773" Score="1" ViewCount="1565" Body="&lt;p&gt;After struggling with &lt;code&gt;AUCTeX&lt;/code&gt; installation under Windows, I was suggested &lt;a href=&quot;https://emacs.stackexchange.com/questions/17084/auctex-installation-error-in-windows&quot;&gt;here&lt;/a&gt; to use &lt;code&gt;ELPA&lt;/code&gt; and its automatic process to install the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following this, everything went fine and I can now read, process, and export to pdf a &lt;code&gt;.tex&lt;/code&gt; source within &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I have available the &lt;code&gt;dvipng&lt;/code&gt; program and I can successufully reproduce the steps described &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-preview.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; in the section &lt;strong&gt;dvipng setup&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is the &lt;code&gt;latex-preview&lt;/code&gt; mechanism which I cannot get to work. Different things happen in &lt;code&gt;org-mode&lt;/code&gt; and &lt;code&gt;AUCTeX&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;AUCTeX&lt;/strong&gt; : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After finding a &lt;code&gt;.tex&lt;/code&gt; file, &lt;code&gt;Preview&lt;/code&gt;, &lt;code&gt;LaTeX&lt;/code&gt; and the rest of menus are available, and as said the process of generating a &lt;code&gt;dvi&lt;/code&gt; and &lt;code&gt;pdf&lt;/code&gt; flows without issues. However, the &lt;code&gt;preview on&lt;/code&gt; toggle does not work correctly. I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;LaTeX: preview-image-type setting 'png unsupported by this Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I looked up the specific error string and got &lt;a href=&quot;http://cseweb.ucsd.edu/~s1pan/install_auctex.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, where it is suggested to change the output format from &lt;code&gt;png&lt;/code&gt; to &lt;code&gt;pnm&lt;/code&gt; in the &lt;code&gt;preview-latex.el&lt;/code&gt; file. However, I cannot find this file!!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;org-mode&lt;/strong&gt; :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I insert a &lt;code&gt;LaTeX&lt;/code&gt; fragment into an &lt;code&gt;org&lt;/code&gt; file (an equation), then with &lt;code&gt;C-c C-x C-l&lt;/code&gt; I should have a preview of the output overlayed inline, but I do not see any change in the buffer. Still, I get no error message even if the variable &lt;code&gt;org-format-latex-signal-error&lt;/code&gt; is set to &lt;code&gt;non-nil&lt;/code&gt; (which should signal an error in image snippet creation). All I see in the &lt;code&gt;minibuffer&lt;/code&gt; is the message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Creating image...done. Use `C-c C-c` to remove images.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made the &lt;code&gt;AUCTeX&lt;/code&gt; preview work...it involved downloading of dll and correction of launching command for - basically - &lt;code&gt;ghostview&lt;/code&gt;. There are few steps involved, so I plan to write about them as soon as I have a minute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; preview does not work as of yet, it just shows a white image so I'll have to investigate that.&lt;/p&gt;&#xA;" OwnerUserId="9642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-04T18:06:10.627" Title="latex-preview in AUCTeX and org-mode" Tags="|auctex|preview-latex|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17112" PostTypeId="1" AcceptedAnswerId="17134" CreationDate="2015-10-03T22:20:41.937" Score="3" ViewCount="1158" Body="&lt;p&gt;I have the following setup, created through a function I've defined &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/2jltrn/i_want_to_save_a_window_configuration_which/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;optional title&quot;&gt;in this reddit post&lt;/a&gt;, which states in relevant part:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun hd/weekly-review ()&#xA;  &quot;Organize a series of windows for weekly reviews&quot;&#xA;  ;; Define Keyboard Macro to narrow to weekly review checklist&#xA;  (fset 'hd-km/narrow-weekly-review-list&#xA;   [?\M-&amp;lt; ?\C-s ?w ?e ?e ?k ?l ?y return ?\C-x ?n ?s])&#xA;&#xA;  (interactive)&#xA;  (delete-other-windows)&#xA;&#xA;  ;; Start with org-agenda&#xA;  (org-agenda nil &quot;R&quot;)&#xA;  (set-window-dedicated-p (selected-window) 1)&#xA;  (delete-other-windows)&#xA;&#xA;  ;; Create a window for follow-mode (and blank it out with *scratch* so it's less distracting)&#xA;  (split-window-horizontally)&#xA;  (display-buffer &quot;*scratch*&quot; t)&#xA;&#xA;  ;; Create the third window for the maintenance.org&#xA;  (other-window 1)&#xA;  (split-window-vertically (floor (* 0.78 (window-height))))&#xA;  (other-window 1)&#xA;  (find-file &quot;~/org-docs/org-system/maintenance.org&quot;)&#xA;  (set-window-dedicated-p (selected-window) 1)&#xA;  (execute-kbd-macro (symbol-function 'hd-km/narrow-weekly-review-list))&#xA;  (show-all)&#xA;  (other-window -2)&#xA;&#xA;  ;; Add to registers config for quick switch back within this session&#xA;  (window-configuration-to-register ?w))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To summarise, two windows are dedicated to buffers, and one is left undedicated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-------------------------------------------------&#xA;|                 |                             |&#xA;|                 |      2a: agenda 'follow'    |&#xA;|                 |        (not dedicated)      |&#xA;|                 |                             |&#xA;|  1a: org-agenda |-----------------------------|&#xA;|   (dedicated)   |                             |&#xA;|                 |                             |&#xA;|                 |   2b: reference .org file   |&#xA;|                 |          (dedicated)        |&#xA;|                 |                             |&#xA;|                 |                             |&#xA;-------------------------------------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I perform an action in 2a which creates a pop-up window (e.g. C-c C-t on a org file heading which brings up &lt;em&gt;org todo&lt;/em&gt;), emacs creates a new frame to display the contents of the pop-up (which steals focus &amp;amp; remains even after the action associated with the pop-up is completed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After alot of reading it seems that this problem could be avoided by adding a custom entry to &lt;code&gt;display-buffer-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;a href=&quot;https://emacs.stackexchange.com/questions/14817/how-to-control-where-the-org-todo-keywords-buffer-displays&quot;&gt;this post suggests that approach will not work&lt;/a&gt; since emacs essentially ignores &lt;code&gt;display-buffer-alist&lt;/code&gt; for the org todo keywords buffer. The solution proposed is to amend the buffer switching functionality of &lt;code&gt;org-fast-todo-selection&lt;/code&gt;. Whilst the change is trivial, I'm reluctant to do so for forwards compatibility reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to achieve what I want here?&lt;/p&gt;&#xA;" OwnerUserId="9725" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-10-05T23:50:03.513" Title="Prevent *org todo* pop-up window from displaying in new frame (dedicated window scenario)" Tags="|org-mode|buffers|window|frames|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17113" PostTypeId="1" AcceptedAnswerId="17117" CreationDate="2015-10-03T22:44:28.660" Score="0" ViewCount="85" Body="&lt;p&gt;When I open an image in Emacs, there is a message constantly showing in the minibuffer: &quot;&lt;code&gt;Type C-c C-c to view the image as text.&lt;/code&gt;&quot; which I cleary don't want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When switching between images, the message is constanting asking for my attention, which bothers me. &#xA;So I need to figure out how I could supress this message only. I tried alternatives like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((inhibit-message t))&#xA;(message &quot;Type C-c C-c to view the image as text.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or message-surpression.el, without any result at all. The message is still popping in my minibuffer when I open an image, and I couldn't figure out which function is calling that message. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-04T03:20:16.507" Title="How supress a specific message from image/image+?" Tags="|images|image-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17114" PostTypeId="1" AcceptedAnswerId="17116" CreationDate="2015-10-03T22:59:00.543" Score="0" ViewCount="1113" Body="&lt;p&gt;Solved: See my answer below. It seems like emacs can't always see what you can see in the terminal. The package mentioned in my answer below solved this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to make LaTeXPreviewPane work on osx (Yosemite). When I try to use the pdf preview it never finishes loading, I see this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error running timer `latex-preview-pane-update': (file-error &quot;Searching for program&quot; &quot;no such file or directory&quot; &quot;pdflatex&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/LaTeXPreviewPane&quot; rel=&quot;nofollow&quot;&gt;These are the requirements:&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1: A installed copy of Emacs 24+ with a working packages system&#xA;2: The command pdflatex on your PATH&#xA;3: Access to the MELPA package repository&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know I have 1 and 3 and have tried to make sure pdflatex should be in my &quot;PATH&quot; as described below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested the command pdflatex via the terminal, and it worked. It is expandable in the terminal, using bash. However I thought I may have to make sure it might still not be in the &quot;PATH&quot; so I found out where the pdflatex binary I installed via macports is, and added it to the .bashrc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which pdflatex&#xA;/opt/local/bin/pdflatex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then added this path to my &lt;code&gt;.bashrc&lt;/code&gt; file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PATH=$PATH:/opt/local/bin/pdflatex &#xA;export PATH&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It still does not work, I'm thinking the problem could be that emacs does not see everything bash sees and that I may need to put a symlink to the binary somewhere, but I'm not sure. I'd really appreciate some advice on how to solve this.&lt;/p&gt;&#xA;" OwnerUserId="6973" LastEditorUserId="6973" LastEditDate="2015-10-04T14:54:31.653" LastActivityDate="2015-10-04T14:54:31.653" Title="How can I add the pdflatex binary to my path to make it visible to emacs, specifically LaTeXPreviewPane?" Tags="|latex|osx|emacs24.4|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17115" PostTypeId="1" AcceptedAnswerId="17118" CreationDate="2015-10-03T23:27:54.263" Score="3" ViewCount="2076" Body="&lt;p&gt;In Windows (the command prompt) when you hit TAB to complete a file name, you get a full file name, and can cycle through the completions by hitting TAB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any ready way to get emacs to do this, instead of (or additional to) displaying the completions for mouse choice in a buffer?&lt;/p&gt;&#xA;" OwnerUserId="2333" LastEditorUserId="2333" LastEditDate="2015-10-03T23:34:01.073" LastActivityDate="2015-10-05T18:20:54.673" Title="Is there a way to make emacs fully complete a filename and cycle through the completions by hitting tab?" Tags="|completion|find-file|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17116" PostTypeId="2" ParentId="17114" CreationDate="2015-10-04T00:05:00.637" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://melpa.org/#/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;The melpa package&lt;/a&gt; &lt;code&gt;exec-path-from-shell&lt;/code&gt; solved my problem. I simply installed it and added what it mentioned in the instructions (see the link) to my &lt;code&gt;.emacs&lt;/code&gt; and that was it!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  On OS X (and perhaps elsewhere) the $PATH environment variable and&#xA;`exec-path' used by a windowed Emacs instance will usually be the&#xA;system-wide default path, rather than that seen in a terminal&#xA;window.&#xA;&#xA;This library allows the user to set Emacs' `exec-path' and $PATH&#xA;from the shell path, so that `shell-command', `compile' and the&#xA;like work as expected.&#xA;&#xA;It also allows other environment variables to be retrieved from the&#xA;shell, so that Emacs will see the same values you get in a terminal.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6973" LastActivityDate="2015-10-04T00:05:00.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17117" PostTypeId="2" ParentId="17113" CreationDate="2015-10-04T00:31:18.663" Score="1" Body="&lt;p&gt;The function in question is &lt;code&gt;image-mode&lt;/code&gt;, and this seems to do what you want (if a little inelegantly):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/image-unwanted-message-p (msg &amp;amp;rest objects)&#xA;  &quot;Return non-nil if MSG is unwanted.&#xA;For these purposes, a MSG is unwanted if (after formatting) it is&#xA;exactly the string \&quot;Type C-c C-c to view the image as text.\&quot;.&quot;&#xA;  (let ((msg (apply #'format (cons msg objects))))&#xA;    (string-equal msg &quot;Type C-c C-c to view the image as text.&quot;)))&#xA;&#xA;(defun my/image-suppress-messages (fn)&#xA;  &quot;Suppress unwanted `message' calls in FN.&quot;&#xA;  (my/with-advice&#xA;      ((#'message :before-until #'my/image-unwanted-message-p))&#xA;    (funcall fn)))&#xA;&#xA;(advice-add #'image-mode :around #'my/image-suppress-messages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here &lt;code&gt;my/with-advice&lt;/code&gt; is this macro that I wrote for a previous problem; it's proven to be very handy for a lot of different tasks.  I'm using it here because I'm a little leery about applying permanent advice to something as ubiquitous as &lt;code&gt;message&lt;/code&gt;, even if that advice doesn't do anything most of the time.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my/with-advice (adlist &amp;amp;rest body)&#xA;  &quot;Execute BODY with temporary advice in ADLIST.&#xA;&#xA;Each element of ADLIST should be a list of the form&#xA;  (SYMBOL WHERE FUNCTION [PROPS])&#xA;suitable for passing to `advice-add'.  The BODY is wrapped in an&#xA;`unwind-protect' form, so the advice will be removed even in the&#xA;event of an error or nonlocal exit.&quot;&#xA;  (declare (debug ((&amp;amp;rest (&amp;amp;rest form)) body))&#xA;           (indent 1))&#xA;  `(progn&#xA;     ,@(mapcar (lambda (adform)&#xA;                 (cons 'advice-add adform))&#xA;               adlist)&#xA;     (unwind-protect (progn ,@body)&#xA;       ,@(mapcar (lambda (adform)&#xA;                   `(advice-remove ,(car adform) ,(nth 2 adform)))&#xA;                 adlist))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the manual cautions &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Named-Functions.html#Advising-Named-Functions&quot; rel=&quot;nofollow&quot;&gt;not to advise primitives&lt;/a&gt; (including &lt;code&gt;message&lt;/code&gt;), but I think it's okay here because (1) all the calls we want to suppress are from lisp anyway; (2) any extraneous calls should pass through transparently; and (3) the advice machinery can't be calling &lt;code&gt;message&lt;/code&gt; here, because you'd be getting messages about it.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="675" LastEditDate="2015-10-04T03:20:16.507" LastActivityDate="2015-10-04T03:20:16.507" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17118" PostTypeId="2" ParentId="17115" CreationDate="2015-10-04T06:35:07.463" Score="5" Body="&lt;p&gt;Not sure what you mean by a full file name.  Do you mean that you want to see absolute file names as completion candidates, instead of relative names? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Based on your use of the &lt;code&gt;find-file&lt;/code&gt; tag, I'm assuming that you mean completion when using a file-finding command (e.g. &lt;code&gt;C-x C-f&lt;/code&gt;), and not completion when in a shell buffer.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In vanilla Emacs, if you set option &lt;code&gt;completion-cycle-threshold&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; then repeating &lt;code&gt;TAB&lt;/code&gt; cycles through the completion candidates (in a predefined order, and in one direction only).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;noreferrer&quot;&gt;Icicles&lt;/a&gt;, you can cycle among candidates in different sort orders and both directions. And if you like, you can complete against absolute file names (&quot;full&quot; names).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_File-Name_Input&quot; rel=&quot;noreferrer&quot;&gt;This page&lt;/a&gt; provides more information about Icicles file-name completion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Other completion packages also let you cycle among file names. No doubt someone else will post more information about those.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-04T06:35:07.463" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17119" PostTypeId="2" ParentId="17115" CreationDate="2015-10-04T07:44:29.527" Score="0" Body="&lt;p&gt;&lt;code&gt;hippie-expand&lt;/code&gt; facilitates completion commands using any arbitrary set of criteria:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defalias 'my-complete-file-name&#xA;  (make-hippie-expand-function '(try-complete-file-name))&#xA;  &quot;A variant of `hippie-expand' which completes only file names.&quot;)&#xA;&#xA;(global-set-key (kbd &quot;C-c f&quot;) 'my-complete-file-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As with &lt;code&gt;hippie-expand&lt;/code&gt; in general, you just repeat the binding (or &lt;code&gt;repeat&lt;/code&gt; it with &lt;code&gt;C-x z z z...&lt;/code&gt; *) to cycle through all the possible completions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) Although that's more awkward if you use this in the minibuffer on account of &lt;code&gt;repeat&lt;/code&gt; echoing a message, so an easy-to-type binding may be preferable.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-10-04T07:49:55.310" LastActivityDate="2015-10-04T07:49:55.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17120" PostTypeId="2" ParentId="2568" CreationDate="2015-10-04T08:10:34.813" Score="1" Body="&lt;p&gt;Override the language switching of operating system and use MULE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs, press &lt;code&gt;C-\&lt;/code&gt;. It asks for an input method. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;greek&lt;/code&gt; and then switch languages with &lt;code&gt;C-\&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9727" LastEditorUserId="25" LastEditDate="2015-10-04T13:41:26.963" LastActivityDate="2015-10-04T13:41:26.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17121" PostTypeId="2" ParentId="13329" CreationDate="2015-10-04T08:59:54.257" Score="11" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/senny/emacs-eclim&quot;&gt;Emacs/eclim&lt;/a&gt; has been my primary Java IDE for the last couple of years and would say it works fairy well, even with large code bases (my current emacs/eclim workspace has more than 4000 Java files). It's true that emacs-eclim requires the file to be saved before making its call to &lt;code&gt;eclimd&lt;/code&gt;, but it's not that big of a problem IMO. The editing experience is still good and the debugger (using &lt;code&gt;gud&lt;/code&gt;) is ok.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you resent all solutions based on Eclipse, I would recommend &lt;a href=&quot;http://www.emacswiki.org/emacs/MalabarMode&quot;&gt;Malabar mode&lt;/a&gt;. I've used that for a couple of years too (before I switched to emacs-eclim) and it has some nice features, top of which is that it works out of the box with any Maven project. If you use Maven, &lt;code&gt;malabar-mode&lt;/code&gt; will instantly give you auto completion and code navigation (among other things). With malabar, I used &lt;a href=&quot;http://jdibug.googlecode.com/svn/trunk/jdibug.html&quot;&gt;jdibug&lt;/a&gt; for debugging remote Java processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The oldest Java package for Emacs, &lt;a href=&quot;http://emacswiki.org/emacs/JavaDevelopmentEnvironment&quot;&gt;JDEE&lt;/a&gt;, might also be worth checking out. Here, you'll find lots of IDE features implemented in pure elisp (or accompanying Java programs launched via &lt;code&gt;bsh&lt;/code&gt;), but last time I used it, it was pretty dated. I may be mistaken, but last time I checked, JDEE was best suited for Java &amp;lt;= 1.4 and the debugger that worked the best with it was &lt;code&gt;jdb&lt;/code&gt; (the others were too slow).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, regardless of which Java package you choose, I'd also throw in &lt;a href=&quot;http://www.emacswiki.org/emacs/Projectile&quot;&gt;Projectile&lt;/a&gt; for lots of project related goodness.&lt;/p&gt;&#xA;" OwnerUserId="9721" LastEditorUserId="25" LastEditDate="2015-10-04T13:40:53.987" LastActivityDate="2015-10-04T13:40:53.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17122" PostTypeId="2" ParentId="17045" CreationDate="2015-10-04T10:06:32.507" Score="2" Body="&lt;p&gt;It is not the right way to do this. As stated in the comments customize is for customizing so it isn't a good idea to abuse it to store session information. &lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-10-04T10:06:32.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17124" PostTypeId="1" AcceptedAnswerId="17734" CreationDate="2015-10-04T12:56:02.780" Score="5" ViewCount="732" Body="&lt;p&gt;Instead of memorizing all of my passwords, I use a password manager to store them for me. Currently, since I use Magit for most Git purposes, I need to go through several steps in order to push:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;P&lt;/code&gt; &lt;code&gt;P&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-g&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x term&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;git push&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Copy my password from my password manager&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-j&lt;/code&gt; &lt;code&gt;C-y&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And then afterward, I seem to have a still-running process from Magit's failed push, in addition to the Term mode buffer I created, to deal with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a less laborious way to enter my password when pushing with Magit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: ... oh. Well, this is embarrassing. You can apparently just hit &lt;code&gt;C-y&lt;/code&gt; directly when Magit asks for your password. I thought I tried that before, but apparently not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it seems that passwords entered this way are not stored in Git's credential cache, so I now need to enter my password every time I push. Is this a bug?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastEditorUserId="8900" LastEditDate="2015-10-05T01:25:50.410" LastActivityDate="2015-10-29T20:00:49.750" Title="How can I paste my password when pushing?" Tags="|magit|copy-paste|passwords|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17125" PostTypeId="1" CreationDate="2015-10-04T13:34:06.343" Score="3" ViewCount="547" Body="&lt;p&gt;I would like to know how to see habit items like normal items. Along the time-grid in their place and not at the bottom of the day. Maybe it's on the sorting algorithm ? Or there is a variable that I can customize?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9729" LastEditorUserId="9729" LastEditDate="2015-10-04T15:55:38.923" LastActivityDate="2016-08-29T23:37:20.757" Title="How to see habit items along the timegrid like normal items?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17127" PostTypeId="2" ParentId="15266" CreationDate="2015-10-04T14:01:35.373" Score="4" Body="&lt;p&gt;Make sure that each Emacs instance runs a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html&quot; rel=&quot;nofollow&quot;&gt;daemon&lt;/a&gt; with a unique name. Set the variable &lt;code&gt;server-start&lt;/code&gt; to choose the server name, for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon &amp;amp;          # Normal instance with the default server name (&quot;server&quot;)&#xA;emacs --daemon=gnus &amp;amp;     # Instance for GNUS only&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From one instance, you can execute code in another instance with the function &lt;code&gt;server-eval-at&lt;/code&gt;. The value of the expression is returned to the local instance. It needs to be a value that can be read back: integers, strings, lists and other “transparent” data structures are ok, but you can transfer buffers, frames, etc. this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this facility to tell another instance to open a frame, to list the buffer names in another instance, etc. Note that if the other instance is busy, your code will block until it replies to the daemon.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(server-eval-at &quot;gnus&quot; `(frame-parameter&#xA;                          (make-frame-on-display ,(frame-parameter (selected-frame) 'display))&#xA;                          window-id))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There isn't much code out there that uses this facility: most Emacs users run a single instance. So whatever you want to do, you'd probably have to do some coding work.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2015-10-04T14:26:07.063" LastActivityDate="2015-10-04T14:26:07.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17128" PostTypeId="2" ParentId="17125" CreationDate="2015-10-04T15:55:14.037" Score="4" Body="&lt;p&gt;Solved. For having habits placed along the timegrid and not in the end you have to modify the sorting strategy taking the habit-down part.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-sorting-strategy&#xA;  '((agenda time-up priority-down category-keep)&#xA;    (todo   priority-down category-keep)&#xA;    (tags   priority-down category-keep)&#xA;    (search category-keep)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way it works.&lt;/p&gt;&#xA;" OwnerUserId="9729" LastActivityDate="2015-10-04T15:55:14.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17129" PostTypeId="1" CreationDate="2015-10-04T17:15:48.580" Score="4" ViewCount="76" Body="&lt;p&gt;I consider to start using emacs for IRC, SQL, Shell and maybe twitter and Feed reading. But than I wonder how power users of emacs deal with emacs being single threaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if I have one long-running task, like updating melpa packages, I can not switch to IRC, because emacs is blocked, isn't it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And by the way: Emacs is one global beast. In programming I try to encapsulate functionality and shield one component from unintentionally breaking the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is configured as one piece and I already experienced how one minor mode interacts terribly with another one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it best practice to have different emacs processes and configurations for different tasks like IRC, email, etc?&lt;/p&gt;&#xA;" OwnerUserId="9731" LastEditorUserId="105" LastEditDate="2015-10-04T17:19:26.587" LastActivityDate="2015-10-04T22:34:40.297" Title="avoid emacs to lock down or crash when used for many tasks" Tags="|performance|emacs-internals|async|irc|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17130" PostTypeId="1" CreationDate="2015-10-04T17:56:47.823" Score="4" ViewCount="1636" Body="&lt;p&gt;I have a list of triplets (3-tuple) like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hank   01.09.1999  Syracuse&#xA;Betty  10.30.1987  Sacramento&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the &quot;key&quot; should be the first column, the person's name. What is a good elisp data structure way to represent this data? I know alist and hash are key-value oriented, here I have three objects. I want to read a text file with the raw (tab delimited) data and write it to a file in the elisp data structure. As a beginner, I'm thinking&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((Hank (01.09.1999 . Syracuse)) (Betty (10.30.1987 . Sacramento)) ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where I cons the birth date and the birth city, then cons to dotted pair to the name, but is there a better way? I guess there is no &quot;dotted triplet&quot; i.e., &lt;code&gt;(a . b . c)&lt;/code&gt;? In general, I could use some examples of live elisp code where code and data are blended together, too.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2015-10-05T16:27:20.890" Title="Data structure for triplet, 3-tuple?" Tags="|elisp|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17131" PostTypeId="2" ParentId="17130" CreationDate="2015-10-04T18:28:55.150" Score="6" Body="&lt;p&gt;A list might work best. There's no such thing as a dotted triplet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also possible to use &lt;code&gt;defstruct&lt;/code&gt;, if you like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(cl-defstruct tuple&#xA;  name&#xA;  date&#xA;  city)&#xA;(setq x (make-tuple&#xA;         :name &quot;Hank&quot;&#xA;         :date &quot;01.09.1999&quot;&#xA;         :city &quot;Syracuse&quot;))&#xA;;; =&amp;gt;&#xA;;; [cl-struct-tuple&#xA;;;  &quot;Hank&quot;&#xA;;;  &quot;01.09.1999&quot;&#xA;;;  &quot;Syracuse&quot;]&#xA;(tuple-name x)&#xA;;; =&amp;gt; &quot;Hank&quot;&#xA;(tuple-date x)&#xA;;; =&amp;gt; &quot;01.09.1999&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-10-04T18:28:55.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17132" PostTypeId="2" ParentId="17130" CreationDate="2015-10-04T18:29:18.977" Score="9" Body="&lt;p&gt;I'd suggest using a &lt;code&gt;cl-struct&lt;/code&gt;.  Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(cl-defstruct record name date city)&#xA;&#xA;(make-record :name &quot;Hank&quot; :date &quot;01.09.1999&quot; :city &quot;Syracuse&quot;)&#xA;;; [cl-struct-record &quot;Hank&quot; &quot;01.09.1999&quot; &quot;Syracuse&quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are some reasons to prefer structs to all kinds of lists.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;since the number of fields is known in advance, you can take advantage of using arrays as underlying data-structure, this makes field access time minimal, as compared to lists.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cl-defstruct&lt;/code&gt; also creates special functions for working with structs, using these allows you to make your code independent of data layout.  In the future, if you wanted to add a new field to the struct, or to remove one, you wouldn't need to modify the code which doesn't work with the field which shouldn't be affected by the change.&lt;/li&gt;&#xA;&lt;li&gt;You can add documentation to the struct and its fields.&lt;/li&gt;&#xA;&lt;li&gt;Structs can be used with EIEIO (the Elisp Object system), meaning you can specialize methods on structs (you get type-checking free).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-10-04T18:29:18.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17133" PostTypeId="2" ParentId="14817" CreationDate="2015-10-04T20:28:19.667" Score="3" Body="&lt;p&gt;I recently &lt;a href=&quot;https://stackoverflow.com/a/32509408/5030424&quot;&gt;figured out how to make Org-mode capture in a new frame&lt;/a&gt;.  Modifying that code to use your function is pretty straightforward.  Here's how I'd do it:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-todo-window-advice (orig-fn)&#xA;  &quot;Advice to fix window placement in `org-fast-todo-selection'.&quot;&#xA;  (let  ((override '(&quot;\\*Org todo\\*&quot; dan-org-todo-position)))&#xA;    (add-to-list 'display-buffer-alist override)&#xA;    (my/with-advice&#xA;        ((#'org-switch-to-buffer-other-window :override #'pop-to-buffer))&#xA;      (unwind-protect (funcall orig-fn)&#xA;        (setq display-buffer-alist&#xA;              (delete override display-buffer-alist))))))&#xA;&#xA;(advice-add #'org-fast-todo-selection :around #'my/org-todo-window-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For completeness' sake, here's the definition of the &lt;code&gt;my/with-advice&lt;/code&gt; macro from the other answer:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro my/with-advice (adlist &amp;amp;rest body)&#xA;  &quot;Execute BODY with temporary advice in ADLIST.&#xA;&#xA;Each element of ADLIST should be a list of the form&#xA;  (SYMBOL WHERE FUNCTION [PROPS])&#xA;suitable for passing to `advice-add'.  The BODY is wrapped in an&#xA;`unwind-protect' form, so the advice will be removed even in the&#xA;event of an error or nonlocal exit.&quot;&#xA;  (declare (debug ((&amp;amp;rest (&amp;amp;rest form)) body))&#xA;           (indent 1))&#xA;  `(progn&#xA;     ,@(mapcar (lambda (adform)&#xA;                 (cons 'advice-add adform))&#xA;               adlist)&#xA;     (unwind-protect (progn ,@body)&#xA;       ,@(mapcar (lambda (adform)&#xA;                   `(advice-remove ,(car adform) ,(nth 2 adform)))&#xA;                 adlist))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-04T20:28:19.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17134" PostTypeId="2" ParentId="17112" CreationDate="2015-10-04T20:43:36.227" Score="2" Body="&lt;p&gt;I just posted &lt;a href=&quot;https://emacs.stackexchange.com/a/17133/8647&quot;&gt;an answer&lt;/a&gt; to the question you linked to that advises &lt;code&gt;org-fast-todo-selection&lt;/code&gt;.  Depending on exactly what behavior you want to achieve, you may be able to modify that code to do what you want (or even take it as-is).&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-10-04T20:43:36.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17135" PostTypeId="2" ParentId="17129" CreationDate="2015-10-04T21:16:58.200" Score="1" Body="&lt;p&gt;Entirely up to you, really. I don't think there is any agreed &quot;best practice&quot; here. Your concerns are perfectly valid, so it's certainly not unreasonable to isolate distinct use-cases as separate Emacs instances (especially if you are less-willing to restart some of them than others). If you're happy with how you can switch between them, I'd suggest you probably have little reason &lt;em&gt;not&lt;/em&gt; to do it.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-10-04T21:16:58.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17136" PostTypeId="2" ParentId="16970" CreationDate="2015-10-04T21:45:56.767" Score="2" Body="&#xA;&#xA;&lt;p&gt;Disclaimer: I didn't have time to learn all about the Vim arglist feature, so I don't know if this is really in the full spirit of what it does and what you want. But forging ahead anyway:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Based on the assumption that people keep Emacs running (as opposed to frequently starting and exiting it) it would be nice to have an Emacs command that asks you for the pathnames (as opposed to supplying them as command-line arguments to Emacs).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs has a compilation mode that can find pathnames/positions in a buffer, and visit them using &lt;code&gt;next-error&lt;/code&gt; and &lt;code&gt;previous-error&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Given that, the question is how to get the &quot;arglist&quot; into some buffer, and enable the compilation &quot;machinery&quot; for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is one way to do it, which is closest to how you would supply command-line arguments, for example as &lt;code&gt;a.txt b.txt *.c ../foo.*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/vim-arglist ()&#xA;  &quot;Easily visit a group of files.&#xA;&#xA;Prompts you to enter one or more pathnames, each of which can use&#xA;wildcards. Puts the actual, expanded pathnames one per line in a&#xA;*files* buffer with `compilation-minor-mode' enabled. Reminds you&#xA;to use `next-error' and `previous-error' to visit the files.&quot;&#xA;  (interactive)&#xA;  (let* ((prompt (format &quot;Files (%s): &quot; default-directory))&#xA;         (wildcards (split-string (read-from-minibuffer prompt)))&#xA;         (filess (mapcar (lambda (x) (file-expand-wildcards x t))&#xA;                         wildcards))&#xA;         (files (apply #'append filess))&#xA;         (buffer-name &quot;*files*&quot;))&#xA;    (when (get-buffer buffer-name)&#xA;      (kill-buffer buffer-name))&#xA;    (with-current-buffer (get-buffer-create buffer-name)&#xA;      (compilation-setup t)&#xA;      (insert &quot;Files:\n&quot;)&#xA;      (dolist (file files) (insert file) (insert &quot;:1:0\n&quot;)))&#xA;    (message &quot;Use next-error and previous-error to move among the files&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You may also want to check out the &lt;code&gt;rgrep&lt;/code&gt; command. Its &lt;code&gt;*grep*&lt;/code&gt; results buffer also supports the compilation mode style of navigating using &lt;code&gt;next-error&lt;/code&gt; etc. The catch is what to supply as the search pattern -- because you really want just one &quot;match&quot; per file. If all the files have some unique line of boilerplate like a copyright or a language element, you could use that; otherwise I don't know.&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="849" LastEditDate="2015-10-17T13:41:42.267" LastActivityDate="2015-10-17T13:41:42.267" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17137" PostTypeId="1" AcceptedAnswerId="17154" CreationDate="2015-10-04T22:07:33.383" Score="3" ViewCount="3146" Body="&lt;p&gt;I just installed the seti-theme from MELPA and no errors occurred. Than I ran M-x load-theme and after a few questions nothing would hapen and emacs would throw the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/matthias/.emacs':&#xA;&#xA;error: Unable to find theme file for `seti'&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After I did the same a &lt;em&gt;second time in a session&lt;/em&gt; the theme would appear without any errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to add the theme to my .emacs( &lt;a href=&quot;http://pastebin.com/Gk7gH3dT&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/Gk7gH3dT&lt;/a&gt; ) with:&#xA;(load-theme 'seti), which doesn't work either. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Debugger entered--Lisp error: (error &quot;Unable to find theme file for `seti'&quot;)&#xA;  signal(error (&quot;Unable to find theme file for `seti'&quot;))&#xA;  error(&quot;Unable to find theme file for `%s'&quot; seti)&#xA;  load-theme(seti)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/matthias/.emacs&quot; nil t)  ; Reading at buffer position 113&#xA;  load-with-code-conversion(&quot;/home/matthias/.emacs&quot; &quot;/home/matthias/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 &quot;\205\262   \306=\203\307\310Q\202; \311=\204\307\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB\321\202;\316\322\323\322\211#\210\322=\203a\324\325\326\307\327Q!\&quot;\323\322\211#\210\322=\203`\210\203\243\330!\331\232\203\243\332!\211\333P\334!\203}\211\202\210\334!\203\207\202\210\314\262\203\241\335\&quot;\203\237\336\337#\210\340\341!\210\266\f?\205\260\314\323\342\322\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; (initialization &quot;`_emacs' init file is deprecated, please use `.emacs'&quot;) &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7 &quot;\n\n(fn)&quot;]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The theme I had installed manually works fine.&lt;/p&gt;&#xA;" OwnerUserId="9653" LastActivityDate="2021-09-14T13:36:38.200" Title="Emacs won't load theme installed from MELPA" Tags="|init-file|themes|package-repositories|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17138" PostTypeId="2" ParentId="17129" CreationDate="2015-10-04T22:34:40.297" Score="0" Body="&lt;p&gt;You have a valid concern, but that does not mean there are no work-arounds. I'll list those here. But first, let me say that being able to edit, compile, and reload sections of the editor while parts of it is running is considered great convenience by expert users and developers of emacs alike. That kind of instant fixability is why emacs turns into a lifelong addiction.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...one long-running task, like updating melpa packages...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thankfully Artur Malabarba solved that problem through his &lt;a href=&quot;https://github.com/Malabarba/paradox&quot; rel=&quot;nofollow&quot;&gt;paradox&lt;/a&gt; package system, which has modernized updating so you don't have to wait for one long-running task to complete before switching to IRC. Check it out.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...shield one component from unintentionally breaking the other.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs has something called modes feature that provides for isolation of components, granular functionality, and unmatched stability. Users, be they new or experienced, can isolate functionalities to specific modes of operation. So you can use a shortcut key such as M-n in both IRC and Paradox-Packages buffers to go to the next line. M-n looks and behaves the same in seemingly different buffers, but the actual command M-n executes in each buffer is different. Shielding happens when the command for IRC is not executed in some other buffer. Yet there is an integration: a similarity, a continuity of functionality that persists across modes. This is what gives emacs its ease of use, glue, familiarity. This is where the benefits of emacs quickly accrue.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs is one global beast.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Assuming you are talking about the initialization files, sure you can store all customizations in big file -- only if you want it that way. Many also load multiple init files. For example, look at &lt;a href=&quot;https://github.com/technomancy/emacs-starter-kit/&quot; rel=&quot;nofollow&quot;&gt;Emacs Starter Kit&lt;/a&gt; that distributes functionality across many files. This is purely a matter of style and convenience and not something emacs imposes. As others have said here, you choose how complex you want to get. Emacs will not hold you back.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...is it best practice to have different emacs processes...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. The best practice is to use whatever is comfortable. For example, some packages, such Paradox mentioned above, start another emacs process in the background without the user learning async tricks. New users can benefit from such behind-the-scenes improvements with no additional tweaking of the init files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How you incorporate emacs into your workflow is entirely up to you. You can make the beast tap dance to any global tune.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-10-04T22:34:40.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17139" PostTypeId="2" ParentId="17130" CreationDate="2015-10-05T05:22:37.850" Score="5" Body="&lt;p&gt;What data structure you use &lt;strong&gt;depends&lt;/strong&gt; on how you will be using it, in particular, &lt;strong&gt;how you will be accessing and setting its parts&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have no special needs in this regard, consider starting with an alist. In that case, there is typically no reason to prefer an element such as &lt;code&gt;(Hank (0.1.09.1999 . Syracuse))&lt;/code&gt; to an element such as &lt;code&gt;(Hank 0.1.09.1999 . Syracuse)&lt;/code&gt; (or even just &lt;code&gt;(Hank 0.1.09.1999 Syracuse)&lt;/code&gt;. All of these associate the key &lt;code&gt;Hank&lt;/code&gt; with &lt;code&gt;0.1.09.1999&lt;/code&gt; and &lt;code&gt;Syracuse&lt;/code&gt;, but in different ways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not already, become familiar with how to access elements of a list (a cons, really), starting with &lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt;, but including also &lt;code&gt;nth&lt;/code&gt; and &lt;code&gt;nthcdr&lt;/code&gt;. (An alist is just a list whose elements are conses.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you know how to grab the content you want from an alist element, and you know how to get the alist element you want, you can consider, for convenience and readability, writing accessor macros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if your alist elements look like &lt;code&gt;(Hank 0.1.09.1999 Syracuse)&lt;/code&gt; then here are some accessor macros:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro name (triplet)&#xA;  `(car ,triplet))&#xA;&#xA;(defmacro date (triplet)&#xA;  `(cadr ,triplet))&#xA;&#xA;(defmacro location (triplet)&#xA;  `(car (cddr ,triplet)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you get this kind of thing (and much more) if you use &lt;code&gt;defstruct&lt;/code&gt;. But note too that an alist can have multiple entries that have the same key (e.g. multiple entries with key &lt;code&gt;Hank&lt;/code&gt;) -- this is undefined for &lt;code&gt;defstruct&lt;/code&gt; (in some implementations it &lt;a href=&quot;http://www.lispworks.com/documentation/lw70/CLHS/Issues/iss119_w.htm&quot; rel=&quot;nofollow&quot;&gt;raises an error&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For most purposes (e.g. access by &lt;code&gt;assq&lt;/code&gt; or &lt;code&gt;assoc&lt;/code&gt;), the first matching entry shadows the others. But you can, if you want, create and use alists that have entries with identical keys but different values, and this can be useful, depending on the application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Really, to repeat, what kind of structure you use depends on how you use it, including how easily you want to be able to add, delete, or modify entries, whether the structure needs to be ordered. (Think of the differences in use between vectors, lists, and hash tables, for instance.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-05T16:27:20.890" LastActivityDate="2015-10-05T16:27:20.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17140" PostTypeId="1" CreationDate="2015-10-05T06:00:45.953" Score="0" ViewCount="716" Body="&lt;p&gt;I specified the font using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil :font &quot;Inziu Iosevka SC&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The expected result is (in notepad.exe):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/G9tco.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/G9tco.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the result in Emacs is actually:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xB7Hl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xB7Hl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only &lt;code&gt;举&lt;/code&gt;, &lt;code&gt;头&lt;/code&gt; and &lt;code&gt;乡&lt;/code&gt; are displayed as specified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result of &lt;code&gt;describe-char&lt;/code&gt; on the correctly rendered char &lt;code&gt;举&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&#xA;             position: 374 of 386 (97%), column: 0&#xA;            character: 举 (displayed as 举) (codepoint 20030, #o47076, #x4e3e)&#xA;    preferred charset: chinese-gbk (GBK Chinese simplified.)&#xA;code point in charset: 0xBED9&#xA;               script: han&#xA;               syntax: w    which means: word&#xA;             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, |:line breakable&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #xE4 #xB8 #xBE&#xA;            file code: #xBE #xD9 (encoded by coding system chinese-gbk-dos)&#xA;              display: by this font (glyph code)&#xA;    uniscribe:-outline-Inziu Iosevka SC-normal-normal-normal-mono-19-*-*-*-c-*-iso10646-1 (#x2493)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: CJK IDEOGRAPH-4E3E&#xA;  general-category: Lo (Letter, Other)&#xA;  decomposition: (20030) ('举')&#xA;&#xA;There are text properties here:&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result of &lt;code&gt;descirbe-char&lt;/code&gt; on wrongly rendered char &lt;code&gt;床&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&#xA;             position: 360 of 386 (93%), column: 0&#xA;            character: 床 (displayed as 床) (codepoint 24202, #o57212, #x5e8a)&#xA;    preferred charset: chinese-gbk (GBK Chinese simplified.)&#xA;code point in charset: 0xB4B2&#xA;               script: han&#xA;               syntax: w    which means: word&#xA;             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #xE5 #xBA #x8A&#xA;            file code: #xB4 #xB2 (encoded by coding system chinese-gbk-dos)&#xA;              display: by this font (glyph code)&#xA;    uniscribe:-outline-BatangChe-normal-normal-normal-mono-19-*-*-*-c-*-gb2312.1980-0 (#x82AA)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: CJK IDEOGRAPH-5E8A&#xA;  general-category: Lo (Letter, Other)&#xA;  decomposition: (24202) ('床')&#xA;&#xA;There are text properties here:&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, how to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2015-10-05T17:54:43.693" Title="Why are some Chinese characters not displayed using the specified font?" Tags="|fonts|character-encoding|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17141" PostTypeId="1" AcceptedAnswerId="17143" CreationDate="2015-10-05T06:13:06.657" Score="19" ViewCount="2705" Body="&lt;p&gt;I have a face, created this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface test-face&#xA;  '((t . (:height 2.0)))&#xA;  &quot;A face for testing.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to insert some text with that face. But these ways insert the text without the face:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert (propertize &quot;text to insert&quot; 'face 'test-face))&#xA;&#xA;(let ((current-string &quot;text to insert&quot;))&#xA;  (put-text-property 1 (length current-string) 'face 'test-face)&#xA;  (insert current-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And even inserting the text first, then going back to put the face on it isn't working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (insert &quot;text to insert&quot;)&#xA;  (add-text-properties&#xA;   (save-excursion&#xA;     (backward-word 3)&#xA;     (point))&#xA;   (point)&#xA;   '(face test-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem isn't the definition of the face, because if I go to customize it, it's already showing up with height twice as big. Even so, inlining the face also doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert (propertize &quot;to insert&quot; 'face '(:height 2.0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how can I put in some text with the specific face? I know I can use an overlay, but that seems like overkill because it's more verbose, requires the text to be inserted first (so we have to find out the size and position of the text to be overlaid) and requires making more garbage to be collected.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-10-05T09:51:02.273" Title="How do I insert text with a specific face?" Tags="|faces|insert|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17142" PostTypeId="1" CreationDate="2015-10-05T08:23:09.767" Score="0" ViewCount="86" Body="&lt;p&gt;In web-mode, when it comes to HTML file, press M-; will comment the selected region very well. But in PHP file, it does not work correctly, the following is the screenshot:&lt;a href=&quot;https://i.stack.imgur.com/PpTL7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PpTL7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any more config work should be done?&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="9678" LastActivityDate="2015-10-05T08:23:09.767" Title="web-mode comment function doesn't work well in php codes" Tags="|web-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17143" PostTypeId="2" ParentId="17141" CreationDate="2015-10-05T09:51:02.273" Score="23" Body="&lt;p&gt;There are some problem with the code:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;put-text-property&lt;/code&gt; is applied to an object. In this case your string. You need to pass it as as the last parameter.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;put-text-property&lt;/code&gt; starts counting at zero.&lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;font-lock-mode&lt;/code&gt; is enabled, it will strip any text of the &lt;code&gt;face&lt;/code&gt; property.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following piece of code works, if font-lock mode is disabled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((current-string &quot;text to insert&quot;))&#xA;  (put-text-property 0 (length current-string) 'face 'font-lock-warning-face&#xA;                     current-string)&#xA;  (insert current-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to use this with font-lock enabled, you can set the property &lt;code&gt;font-lock-face&lt;/code&gt; instead. It has the same effect but isn't affected by &lt;code&gt;font-lock&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-10-05T09:51:02.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17144" PostTypeId="1" CreationDate="2015-10-05T10:01:21.817" Score="9" ViewCount="1534" Body="&lt;p&gt;I tried &lt;code&gt;M-x po-mode&lt;/code&gt;, but it is not installed. I have tried to find a &lt;code&gt;gettext&lt;/code&gt; or &lt;code&gt;po-mode&lt;/code&gt; package under &lt;code&gt;M-x list-packages&lt;/code&gt; as well as &lt;code&gt;M-x package-install&lt;/code&gt;, but I couldn't find either. I have gettext and relevant libraries, as shown here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[my-pc]/home/lucas$ whereis gettext&#xA;gettext: /usr/bin/gettext /usr/bin/gettext.sh /usr/lib/gettext /usr/share/gettext /usr/share/man/man1/gettext.1.gz /usr/share/man/man3/gettext.3.gz /usr/share/info/gettext.info.gz&#xA;[my-pc]/home/lucas$ whereis poedit&#xA;poedit: /usr/bin/poedit /usr/lib/poedit /usr/share/poedit /usr/share/man/man1/poedit.1.gz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have reviewed the &lt;a href=&quot;http://www.emacswiki.org/emacs/PoMode&quot; rel=&quot;noreferrer&quot;&gt;emacs PO mode docs&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Installation.html#Installation&quot; rel=&quot;noreferrer&quot;&gt;relevant install instructions&lt;/a&gt;, but I still cannot find a way to install po-mode on emacs. Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is more system info, if interested:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[my-pc]/home/lucas$ uname -a&#xA;Linux my-pc 4.2.2-1-ARCH #1 SMP PREEMPT Tue Sep 29 22:21:33 CEST 2015 x86_64 GNU/Linux&#xA;'M-x version'&#xA;GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6) of 2015-09-09 on foutrelis&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like the elisp files should be installed with the gettext package on my OS, but I don't think my installation includes them. I searched &lt;code&gt;/usr/share/gettext&lt;/code&gt; but did not find anything:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[my-pc]/home/lucas$ tree /usr/share/gettext/ | grep emacs&#xA;    ├── po-emacs-x.css&#xA;    ├── po-emacs-xterm16.css&#xA;    ├── po-emacs-xterm256.css&#xA;    ├── po-emacs-xterm.css&#xA;[my-pc]/home/lucas$ tree /usr/share/gettext/&#xA;├── ABOUT-NLS&#xA;├── archive.dir.tar.xz&#xA;├── config.rpath&#xA;├── gettext.h&#xA;├── intl&#xA;│   ├── bindtextdom.c&#xA;│   ├── config.charset&#xA;│   ├── COPYING.LIB&#xA;│   ├── dcgettext.c&#xA;│   ├── dcigettext.c&#xA;│   ├── dcngettext.c&#xA;│   ├── dgettext.c&#xA;│   ├── dngettext.c&#xA;│   ├── eval-plural.h&#xA;│   ├── explodename.c&#xA;│   ├── export.h&#xA;│   ├── finddomain.c&#xA;│   ├── gettext.c&#xA;│   ├── gettextP.h&#xA;│   ├── gmo.h&#xA;│   ├── hash-string.c&#xA;│   ├── hash-string.h&#xA;│   ├── intl-compat.c&#xA;│   ├── intl-exports.c&#xA;│   ├── l10nflist.c&#xA;│   ├── langprefs.c&#xA;│   ├── libgnuintl.in.h&#xA;│   ├── libintl.rc&#xA;│   ├── loadinfo.h&#xA;│   ├── loadmsgcat.c&#xA;│   ├── localcharset.c&#xA;│   ├── localcharset.h&#xA;│   ├── locale.alias&#xA;│   ├── localealias.c&#xA;│   ├── localename.c&#xA;│   ├── lock.c&#xA;│   ├── lock.h&#xA;│   ├── log.c&#xA;│   ├── Makefile.in&#xA;│   ├── ngettext.c&#xA;│   ├── os2compat.c&#xA;│   ├── os2compat.h&#xA;│   ├── osdep.c&#xA;│   ├── plural.c&#xA;│   ├── plural-exp.c&#xA;│   ├── plural-exp.h&#xA;│   ├── plural.y&#xA;│   ├── printf-args.c&#xA;│   ├── printf-args.h&#xA;│   ├── printf.c&#xA;│   ├── printf-parse.c&#xA;│   ├── printf-parse.h&#xA;│   ├── ref-add.sin&#xA;│   ├── ref-del.sin&#xA;│   ├── relocatable.c&#xA;│   ├── relocatable.h&#xA;│   ├── setlocale.c&#xA;│   ├── textdomain.c&#xA;│   ├── threadlib.c&#xA;│   ├── tsearch.c&#xA;│   ├── tsearch.h&#xA;│   ├── vasnprintf.c&#xA;│   ├── vasnprintf.h&#xA;│   ├── vasnwprintf.h&#xA;│   ├── verify.h&#xA;│   ├── VERSION&#xA;│   ├── version.c&#xA;│   ├── wprintf-parse.h&#xA;│   ├── xsize.c&#xA;│   └── xsize.h&#xA;├── javaversion.class&#xA;├── msgunfmt.tcl&#xA;├── po&#xA;│   ├── boldquot.sed&#xA;│   ├── en@boldquot.header&#xA;│   ├── en@quot.header&#xA;│   ├── insert-header.sin&#xA;│   ├── Makefile.in.in&#xA;│   ├── Makevars.template&#xA;│   ├── quot.sed&#xA;│   ├── remove-potcdate.sin&#xA;│   └── Rules-quot&#xA;├── projects&#xA;│   ├── GNOME&#xA;│   │   ├── team-address&#xA;│   │   ├── teams.html&#xA;│   │   ├── teams.url&#xA;│   │   └── trigger&#xA;│   ├── index&#xA;│   ├── KDE&#xA;│   │   ├── team-address&#xA;│   │   ├── teams.html&#xA;│   │   ├── teams.url&#xA;│   │   └── trigger&#xA;│   ├── team-address&#xA;│   └── TP&#xA;│       ├── team-address&#xA;│       ├── teams.html&#xA;│       ├── teams.url&#xA;│       └── trigger&#xA;└── styles&#xA;    ├── po-default.css&#xA;    ├── po-emacs-x.css&#xA;    ├── po-emacs-xterm16.css&#xA;    ├── po-emacs-xterm256.css&#xA;    ├── po-emacs-xterm.css&#xA;    └── po-vim.css&#xA;&#xA;7 directories, 100 files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It also seems like the archlinux gettext package does not include any elisp files, shown here: &lt;a href=&quot;https://www.archlinux.org/packages/core/x86_64/gettext/&quot; rel=&quot;noreferrer&quot;&gt;https://www.archlinux.org/packages/core/x86_64/gettext/&lt;/a&gt; (file list is at the bottom) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the meantime, I may just manually install the source elsewhere.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-10-05T19:47:24.480" LastActivityDate="2021-04-23T17:11:49.807" Title="How to install po-mode?" Tags="|translation|" AnswerCount="6" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17145" PostTypeId="1" CreationDate="2015-10-05T10:32:33.420" Score="3" ViewCount="328" Body="&lt;p&gt;I'm trying to use different terminals on Emacs.&#xA;The one I'm currently trying is &lt;code&gt;term&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I execute a &lt;code&gt;ps&lt;/code&gt; command and &lt;code&gt;grep&lt;/code&gt; its output on Emacs, I don't get the same result as in &lt;code&gt;gnome-terminal&lt;/code&gt;, &lt;code&gt;xterm&lt;/code&gt;, etc...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I get on Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;etomort@elx306b6vv:~$ ps -ef | grep juniper&#xA;etomort  28860 28781  0 11:41 pts/2    00:00:00 grep --color=auto juniper&#xA;etomort@elx306b6vv:~$ ps -ef | grep 13109&#xA;etomort  13109     1  0 09:51 ?        00:00:04 /usr/lib/jvm/java-7-oracle/jre/bin/java -classpath /usr/lib/jvm/java-7-oracle/jre/lib/plugin.jar:/home/etomo&#xA;etomort  28876 28781  0 11:41 pts/2    00:00:00 grep --color=auto 13109&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bear in mind that &lt;em&gt;greping&lt;/em&gt; by process id does not either include juniper on its output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this is what I get on &lt;code&gt;gnome-terminal&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;etomort@elx306b6vv:~$ ps -ef | grep juniper&#xA;etomort  13109     1  0 09:51 ?        00:00:04 /usr/lib/jvm/java-7-oracle/jre/bin/java -classpath /usr/lib/jvm/java-7-oracle/jre/lib/plugin.jar:/home/etomort/.juniper_networks/tncc.jar net.juniper.tnc.NARPlatform.linux.LinuxHttpNAR log_level 2 postRetries 6 ivehost www.myvpn.org Parameter0 interval=0;process_timeout=5;failurl=;cert_md5=1a2b3c4d5e6f7g8h9i0j1a2b3c4d5e6f7g8h9i0j;hash_key=1a2b3c4d5e6f7g8h9i0j1a2b3c4d5e6f7g8h9i0j;id=1a2b3c4d5e6f7g8h9i0j1a2b3c4d5e6f7g8h9i0j;logging=0 locale en home_dir /home/etomort user_agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0&#xA;etomort  28775 22252  0 11:40 pts/11   00:00:00 grep --color=auto juniper&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems that &lt;strong&gt;Emacs term&lt;/strong&gt; loses characters somewhere between the &lt;code&gt;ps&lt;/code&gt; and the pipe before the &lt;code&gt;grep&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; I'll check in &lt;em&gt;Meta Stack Exchange&lt;/em&gt; how to present better the output of &lt;code&gt;ps&lt;/code&gt;, since I would prefer them truncated.&lt;/p&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="6957" LastEditDate="2015-10-06T19:41:28.020" LastActivityDate="2015-10-06T23:03:00.480" Title="Emacs term loses characters when using ps and grep" Tags="|term|grep|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17146" PostTypeId="2" ParentId="17144" CreationDate="2015-10-05T11:02:14.637" Score="4" Body="&lt;p&gt;You can get the file here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/andialbrecht/emacs-config/blob/master/vendor/po-mode.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/andialbrecht/emacs-config/blob/master/vendor/po-mode.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then put the file in your load-path (like ~/.emacs.d/) and add &lt;code&gt;(require 'po-mode)&lt;/code&gt; in your .emacs.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-10-05T11:02:14.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17147" PostTypeId="2" ParentId="17144" CreationDate="2015-10-05T12:29:30.677" Score="5" Body="&lt;p&gt;&lt;code&gt;po-mode&lt;/code&gt; should come with your installed gettext lib. In &lt;code&gt;/path/to/gettext/share/emacs/site-lisp/&lt;/code&gt; you should find the po-mode files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the location to your load path and autoload the &lt;code&gt;po-mode&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how I have mine setup for a specific gettext version installed from brew:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/usr/local/Cellar/gettext/0.19.5.1/share/emacs/site-lisp/&quot;)&#xA;(autoload &quot;po-mode&quot; &quot;po-mode&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively setup with &lt;code&gt;use-package&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package po-mode&#xA;  :load-path &quot;/usr/local/Cellar/gettext/0.19.5.1/share/emacs/site-lisp/&quot;&#xA;  :commands (po-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-10-05T12:29:30.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17148" PostTypeId="1" AcceptedAnswerId="17168" CreationDate="2015-10-05T13:04:21.470" Score="4" ViewCount="802" Body="&lt;p&gt;I am using &lt;code&gt;web-mode&lt;/code&gt; to fold/unfold code. When I fold code, kill buffer and re open  it, code folding  disappears. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to  preserve code folding even after killing  and  reopening buffer?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-10-06T13:03:04.417" Title="How to preserve code folding in emacs?" Tags="|web-mode|code-folding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17149" PostTypeId="2" ParentId="17130" CreationDate="2015-10-05T14:24:13.660" Score="1" Body="&lt;p&gt;If you have a lot of key/value pairs, a hash table is an option to consider (if not so many, an alist is fine).  If you like, you can use mini-alists or mini-plists as the hash table's values:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((hash (make-hash-table :test #'equal)))&#xA;  ;; examples of adding a text-based key and value combination&#xA;  (puthash &quot;Hank&quot;  (list &quot;01.09.1999&quot; &quot;Syracuse&quot;) hash)&#xA;  (puthash &quot;Betty&quot; '((:bday &quot;10.30.1987&quot;) (:city &quot;Sacramento&quot;)) hash)&#xA;  (puthash &quot;Tom&quot;  '(:bday &quot;01.02.2000&quot; :city &quot;Chicago&quot;) hash)&#xA;  ;; examples of retrieving a value&#xA;  (car (gethash &quot;Hank&quot; hash))                  ; =&amp;gt; &quot;01.09.1999&quot;&#xA;  (assoc :bday (gethash &quot;Betty&quot; hash))         ; =&amp;gt; (:bday &quot;10.30.1987&quot;)&#xA;  (cadr (assoc :bday (gethash &quot;Betty&quot; hash)))  ; =&amp;gt; &quot;10.30.1987&quot; &#xA;  (plist-get (gethash &quot;Tom&quot; hash) :city))      ; =&amp;gt; &quot;Chicago&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-10-05T14:30:53.077" LastActivityDate="2015-10-05T14:30:53.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17150" PostTypeId="1" AcceptedAnswerId="17151" CreationDate="2015-10-05T14:37:46.157" Score="0" ViewCount="800" Body="&lt;h2&gt;Situation&lt;/h2&gt;&#xA;&lt;p&gt;I would like to have a function, that when called, creates a new file/buffer in a specific directory, indepent of the current directory.&#xA;But with the same file name as the current file that the buffer is visiting.&lt;/p&gt;&#xA;&lt;p&gt;So I created the following:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun change-to-foobar-directory ()&#xA;    (interactive)&#xA;    (setq buffer-temp-name (buffer-name))&#xA;    (kill-this-buffer)&#xA;    (find-file (concat &amp;quot;C:\\foobar\\&amp;quot; buffer-temp-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This works great.&lt;/p&gt;&#xA;&lt;p&gt;When I have the buffer &lt;code&gt;foobar.el&lt;/code&gt; in directory &lt;code&gt;C:\another-dir&lt;/code&gt;, and I call &lt;code&gt;change-to-foobar-directory&lt;/code&gt;, then I get the buffer&#xA;&lt;code&gt;C:\foobar\foobar.el&lt;/code&gt;. The difference is that I'm editing a buffer in another directory (&lt;code&gt;C:\foobar&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;h2&gt;Problem&lt;/h2&gt;&#xA;&lt;p&gt;This solution works great so far. When I add that function to a hook, for example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook 'change-to-foobar-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And when I'm in the file &lt;code&gt;another-file.c&lt;/code&gt;, I create a new buffer &lt;code&gt;foobar.el&lt;/code&gt; with the Evil command &lt;code&gt;:e foobar.el&lt;/code&gt; (which stands for edit the file foobar.el in the same directory of buffer, even when the file doesn't exist yet, then a new buffer will be created).&lt;/p&gt;&#xA;&lt;p&gt;Because the &lt;code&gt;emacs.lisp-mode&lt;/code&gt; gets activated, the function &lt;code&gt;change-to-foobar-directory&lt;/code&gt; should be called.&lt;/p&gt;&#xA;&lt;p&gt;But I get the same file &lt;code&gt;another-file.c&lt;/code&gt; instead editing the file/buffer &lt;code&gt;C:\foobar\foorbar.el&lt;/code&gt;. So it seems with the hook, &lt;code&gt;change-to-foobar-directory&lt;/code&gt; will not work properly. I'm not sure what caused this. When I call that command interactively, it will work properly.&lt;/p&gt;&#xA;&lt;p&gt;Any idea what caused this?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-08T20:47:52.570" Title="Why is this function not working properly, when added to a hook?" Tags="|hooks|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17151" PostTypeId="2" ParentId="17150" CreationDate="2015-10-05T15:21:06.477" Score="7" Body="&lt;p&gt;Dunno what Evil might change in the picture (try without Evil, to see if there is a difference).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you are interested in the buffer name of a buffer visiting a file then what you should use is &lt;code&gt;buffer-file-name&lt;/code&gt;, not just &lt;code&gt;buffer-name&lt;/code&gt;. Specifically, &lt;code&gt;(file-name-nondirectory (buffer-file-name))&lt;/code&gt;, if you want only the non-dir part. (&lt;code&gt;buffer-name&lt;/code&gt; is for any buffer; &lt;code&gt;buffer-file-name&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; if the buffer is not visiting a file. This lets you conditionally &lt;em&gt;not&lt;/em&gt; try to, for example, use the name of a non-file buffer as a file name.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, do not use &lt;code&gt;concat&lt;/code&gt; for file names. Instead, use &lt;code&gt;expand-file-name&lt;/code&gt; with the directory you want to use as the second arg: &lt;code&gt;(expand-file-name buffer-temp-name &quot;C:/foobar/&quot;)&lt;/code&gt; (and no need to use MS Windows directory separators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, use &lt;code&gt;let&lt;/code&gt; to bind the relative file name, instead of just &lt;code&gt;setq&lt;/code&gt; (unless, for some reason, you have a global variable of that name and you want to change its value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you want to kill the buffer and then find a file to replace it, just use &lt;strong&gt;&lt;code&gt;find-alternate-file&lt;/code&gt;&lt;/strong&gt;. This will take care of the problem you are experiencing, and that @nanny and @Stefan have pointed to.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun change-to-foobar-directory ()&#xA;  (interactive)&#xA;  &quot;...&quot;&#xA;  (let* ((filebuf               (buffer-file-name))&#xA;         (relname               (and filebuf  (file-name-nondirectory filebuf)))&#xA;         (emacs-lisp-mode-hook  ()))&#xA;    (when filebuf&#xA;     (find-alternate-file (expand-file-name relname &quot;C:/foobar/&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Suggestion:&lt;/em&gt; Spend a little time with the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Names.html&quot; rel=&quot;nofollow&quot;&gt;File Names&lt;/a&gt; and its subnodes. You'll appreciate it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-08T20:47:52.570" LastActivityDate="2015-10-08T20:47:52.570" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="17152" PostTypeId="2" ParentId="17150" CreationDate="2015-10-05T15:23:00.127" Score="2" Body="&lt;p&gt;Hooks get called as the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html&quot; rel=&quot;nofollow&quot;&gt;last step in a mode's initialization&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And when I'm in the file another-file.c, I create a new buffer foobar.el&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you create that buffer, &lt;code&gt;foobar.el&lt;/code&gt;, &lt;code&gt;emacs-lisp-mode&lt;/code&gt; gets enabled in the buffer, and then its hooks are run. One of its hooks is your function &lt;code&gt;change-to-foobar-directory&lt;/code&gt;. Your function calls &lt;code&gt;kill-this-buffer&lt;/code&gt;. But what's &lt;code&gt;this-buffer&lt;/code&gt; at this time? &lt;code&gt;foobar.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function is working perfectly fine, it simply has a logical error. Instead, try: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun change-to-foobar-directory ()&#xA;    (interactive)&#xA;    (setq buffer-temp-name (buffer-name))&#xA;    (kill-buffer (other-buffer))&#xA;    (find-file (concat &quot;C:\\foobar\\&quot; buffer-temp-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or see Drew's answer for a better alternative.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-10-05T15:23:00.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17153" PostTypeId="2" ParentId="17150" CreationDate="2015-10-05T15:31:37.517" Score="5" Body="&lt;p&gt;In your problematic case, when you're visiting foobar.el, Emacs does the following &lt;em&gt;in this order&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;fetch foobar.el into a new buffer.&lt;/li&gt;&#xA;&lt;li&gt;initialize the major mode (including running the hooks).&lt;/li&gt;&#xA;&lt;li&gt;display the buffer in the selected window.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So your hook will kill the foobar.el buffer, create a new foobar.el buffer at the new location.  At this point, you should get an &quot;infinite-recursion error&quot; here since that &lt;code&gt;find-file&lt;/code&gt; will also run the &lt;code&gt;emacs-lisp-mode-hook&lt;/code&gt;.  If you somehow avoid that error, then you bump into another error which is that right after your hook has finished, the third step (&quot;display the buffer in the selected window&quot;) may cause yet more grief (either signalling an error because that buffer has been killed in the mean time, or displaying some other buffer in its stead).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-10-05T15:31:37.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17154" PostTypeId="2" ParentId="17137" CreationDate="2015-10-05T16:44:46.413" Score="3" Body="&lt;p&gt;This worked:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (&amp;gt;= emacs-major-version 24)&#xA;  (require 'package)&#xA;  (add-to-list&#xA;   'package-archives&#xA;   '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;   t)&#xA;  (package-initialize)&#xA;;; set theme&#xA;(load-theme 'seti t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In combination with the steps explained here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/2112/115&quot;&gt;Why does load-theme reset the custom-theme-load-path?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and what is written in the comments below.&lt;/p&gt;&#xA;" OwnerUserId="9653" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-05T20:55:06.037" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17155" PostTypeId="1" AcceptedAnswerId="17156" CreationDate="2015-10-05T17:04:26.623" Score="11" ViewCount="1776" Body="&lt;p&gt;My embarrassingly easy question is the following:&lt;/p&gt;&#xA;&lt;p&gt;Why does the following code works:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'request)&#xA;&#xA;(defun geocoder ()&#xA;  (request&#xA;   &amp;quot;http://rpc.geocoder.us/service/csv&amp;quot;&#xA;   ;;; **Hardcoded parameter!**&#xA;   :params '((&amp;quot;address&amp;quot; . &amp;quot;1600 Pennsylvania Ave, Washington DC&amp;quot;))&#xA;   :parser 'buffer-string&#xA;   :success (function*&#xA;             (lambda (&amp;amp;key data &amp;amp;allow-other-keys)&#xA;                (when data&#xA;                (with-current-buffer (get-buffer-create &amp;quot;*request demo*&amp;quot;)&#xA;                  (erase-buffer)&#xA;                  (insert data)&#xA;                  (pop-to-buffer (current-buffer))))))&#xA;   :error&#xA;   (function* (lambda (&amp;amp;key error-thrown &amp;amp;allow-other-keys&amp;amp;rest _)&#xA;                (message &amp;quot;Got error: %S&amp;quot; error-thrown)))&#xA;   ))&#xA;&#xA;(geocoder)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;While this one doesn't?&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;&#xA;(require 'request)&#xA;&#xA;(defun geocoder (address) ;; adding a parameter!&#xA;  (request&#xA;   &amp;quot;http://rpc.geocoder.us/service/csv&amp;quot;&#xA;   :params '((&amp;quot;address&amp;quot; . address))&#xA;   :parser 'buffer-string&#xA;   :success (function*&#xA;             (lambda (&amp;amp;key data &amp;amp;allow-other-keys)&#xA;                (when data&#xA;                (with-current-buffer (get-buffer-create &amp;quot;*request demo*&amp;quot;)&#xA;                  (erase-buffer)&#xA;                  (insert data)&#xA;                  (pop-to-buffer (current-buffer))))))&#xA;   :error&#xA;   (function* (lambda (&amp;amp;key error-thrown &amp;amp;allow-other-keys&amp;amp;rest _)&#xA;                (message &amp;quot;Got error: %S&amp;quot; error-thrown)))&#xA;   ))&#xA;&#xA;;;; Now with parameter!&#xA;(geocoder &amp;quot;1600 Pennsylvania Ave, Washington DC&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;How should I send a parameter to request?&lt;/p&gt;&#xA;" OwnerUserId="9733" LastEditorUserId="105" LastEditDate="2024-01-31T16:30:49.717" LastActivityDate="2024-01-31T16:30:49.717" Title="Simple request.el usage" Tags="|eval|backquote|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17156" PostTypeId="2" ParentId="17155" CreationDate="2015-10-05T17:40:36.120" Score="14" Body="&lt;p&gt;This is because &lt;code&gt;'((&quot;address&quot; . address))&lt;/code&gt; is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;quoted&lt;/em&gt;&lt;/a&gt; (i.e. prefixed by the &lt;code&gt;'&lt;/code&gt; operator), which means that what is inside does not get evaluated. The &lt;code&gt;request&lt;/code&gt; function thus gets called with an argument which is the unevaluated &lt;code&gt;address&lt;/code&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Symbols.html#Symbols&quot; rel=&quot;noreferrer&quot;&gt;symbol&lt;/a&gt; (whereas in your first implementation, the &lt;code&gt;request&lt;/code&gt; function gets a string litteral, which doesn't need to be evaluated first).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can fix this in 2 ways: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html#Backquote&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;quasi-quoting&lt;/em&gt;&lt;/a&gt; the argument, which allows you to get mostly the same behaviour but to specify parts which still need to be evaluated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`((&quot;address&quot; . ,address))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the single quote (&lt;code&gt;'&lt;/code&gt;) has been replaced by a backquote (&lt;code&gt;&amp;grave;&lt;/code&gt;), and a special marker &lt;code&gt;,&lt;/code&gt; was added before &lt;code&gt;address&lt;/code&gt; to indicate that it should be evaluated and substituted with its value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; (as per @JordonBiondo's comment) &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Building-Lists.html#Building-Lists&quot; rel=&quot;noreferrer&quot;&gt;building the structure&lt;/a&gt; explicitly using primitives such as &lt;code&gt;list&lt;/code&gt; or &lt;code&gt;cons&lt;/code&gt;. In your case, this would be done like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list (cons &quot;address&quot; address))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where, again, &lt;code&gt;&quot;address&quot;&lt;/code&gt; is a string literal (which evaluates to itself), and &lt;code&gt;address&lt;/code&gt; gets evaluated since it is the argument in a function call.&lt;/p&gt;&#xA;" OwnerUserId="221" LastEditorUserId="221" LastEditDate="2015-10-12T07:07:19.647" LastActivityDate="2015-10-12T07:07:19.647" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17157" PostTypeId="2" ParentId="17140" CreationDate="2015-10-05T17:54:43.693" Score="1" Body="&lt;p&gt;Well, I'm not an expert, but can share you my configuration about Chinese font.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (dolist (charset '(kana han symbol cjk-misc bopomofo))&#xA;&#xA;            (set-fontset-font (frame-parameter nil 'font)&#xA;&#xA;                               charset&#xA;&#xA;                              (font-spec :family &quot;FangSong&quot; :size 15)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try this in your .emacs, see if any better.&lt;/p&gt;&#xA;" OwnerUserId="9678" LastActivityDate="2015-10-05T17:54:43.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17158" PostTypeId="2" ParentId="17115" CreationDate="2015-10-05T18:20:54.673" Score="1" Body="&lt;p&gt;&lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;ido-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=lsgPNVIMkIE&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=lsgPNVIMkIE&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not exactly the desired behaviour, but quite close.&lt;/p&gt;&#xA;" OwnerUserId="9733" LastActivityDate="2015-10-05T18:20:54.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17159" PostTypeId="1" AcceptedAnswerId="17160" CreationDate="2015-10-05T21:19:05.027" Score="5" ViewCount="814" Body="&lt;p&gt;When writing code in &lt;code&gt;python-mode&lt;/code&gt; my preference would be to include underscores within a word boundary, so &lt;code&gt;variable_with_underscores&lt;/code&gt; is treated as a single word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I limit my word preference only to &lt;code&gt;python-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2516" LastEditorUserId="253" LastEditDate="2015-10-05T21:42:17.553" LastActivityDate="2018-02-03T00:05:42.853" Title="How to keep underscores in Python within a word boundary?" Tags="|python|syntax|syntax-table|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17160" PostTypeId="2" ParentId="17159" CreationDate="2015-10-05T21:19:05.027" Score="7" Body="&lt;p&gt;Add a hook to modify the &lt;code&gt;python-mode-syntax-table&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Keep underscores within a word boundary&#xA;(add-hook 'python-mode-hook&#xA;          (lambda () (modify-syntax-entry ?_ &quot;w&quot; python-mode-syntax-table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2516" LastEditorUserId="15748" LastEditDate="2018-02-03T00:05:42.853" LastActivityDate="2018-02-03T00:05:42.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17161" PostTypeId="2" ParentId="17144" CreationDate="2015-10-05T21:43:49.257" Score="1" Body="&lt;p&gt;All answers here are correct, and they all helped me find the root of the problem. But the following solution is the only thing that solved my issue, which was actually caused by the Archlinux gettext package:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out, this was an issue with the gettext package in ArchLinux. With lots of help from Earnestly, I was able to resolve this issue with the following PKGBUILD file (written by Earnestly):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pkgdesc='po-mode for emacs from gettext'&#xA;arch=('i686' 'x86_64')&#xA;url=&quot;http://www.gnu.org/software/gettext/&quot;&#xA;license=('GPL')&#xA;&#xA;depends=('emacs')&#xA;&#xA;source=(ftp://ftp.gnu.org/pub/gnu/gettext/gettext-&quot;$pkgver&quot;.tar.gz{,.sig})&#xA;&#xA;validpgpkeys=('462225C3B46F34879FC8496CD605848ED7E69871') # Daiki Ueno&#xA;sha1sums=('4d236852bd8d63e14d09eb6fc1f4da20a99f568b'&#xA;          'SKIP')&#xA;&#xA;build() {&#xA;    cd gettext-&quot;$pkgver&quot;/gettext-tools/misc&#xA;    emacs -Q --batch -f batch-byte-compile *.el&#xA;}&#xA;&#xA;package() {&#xA;    cd gettext-&quot;$pkgver&quot;/gettext-tools/misc&#xA;    install -Dm644 *.el *.elc -t &quot;$pkgdir&quot;/usr/share/emacs/site-lisp&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That should do the trick. Now I have an &lt;code&gt;emacs-po-mode&lt;/code&gt; package!&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-10-05T21:50:27.100" LastActivityDate="2015-10-05T21:50:27.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17162" PostTypeId="2" ParentId="17159" CreationDate="2015-10-05T23:41:37.517" Score="5" Body="&lt;p&gt;It's bird, it's a plane, it's &lt;code&gt;superword-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Superword mode is a buffer-local minor mode.  Enabling it changes&#xA;  the definition of words such that symbols characters are treated&#xA;  as parts of words: e.g., in ‘superword-mode’,&#xA;  &quot;this_is_a_symbol&quot; counts as one word.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's a minor mode, so you can set it in a hook the normal way: &lt;code&gt;(add-hook 'python-mode-hook #'superword-mode)&lt;/code&gt;.  &lt;code&gt;superword-mode&lt;/code&gt; has only existed since 24.4, so you'll need to hack the syntax table by hand in older versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find it very convenient to bind this to a key so I can easily toggle it.  It's the sort thing I want sometimes, but not others.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-10-08T03:03:20.047" LastActivityDate="2015-10-08T03:03:20.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17163" PostTypeId="2" ParentId="17112" CreationDate="2015-10-05T23:50:03.513" Score="1" Body="&lt;p&gt;Aaron's solution provided the answer, which I then modified as suggested to fit my purposes. For anyone interested in the modification see below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;; Macro which creates advice 'template'&#xA;(defmacro my/with-advice (adlist &amp;amp;rest body)&#xA;  &quot;Execute BODY with temporary advice in ADLIST.&#xA;&#xA;Each element of ADLIST should be a list of the form&#xA;  (SYMBOL WHERE FUNCTION [PROPS])&#xA;suitable for passing to `advice-add'.  The BODY is wrapped in an&#xA;`unwind-protect' form, so the advice will be removed even in the&#xA;event of an error or nonlocal exit.&quot;&#xA;  (declare (debug ((&amp;amp;rest (&amp;amp;rest form)) body))&#xA;           (indent 1))&#xA;  `(progn&#xA;     ,@(mapcar (lambda (adform)&#xA;                 (cons 'advice-add adform))&#xA;               adlist)&#xA;     (unwind-protect (progn ,@body)&#xA;       ,@(mapcar (lambda (adform)&#xA;                   `(advice-remove ,(car adform) ,(nth 2 adform)))&#xA;                 adlist))))&#xA;&#xA;;;Function which replaces org-switch-to-buffer-other-window with emacs' original switch-to-buffer-other-window&#xA;(defun hd/org-todo-same-window (orig-fn)&#xA;  &quot;Advice to fix window placement in `org-fast-todo-selection'.&quot;&#xA;  (let  ((override&#xA;      '(&quot;\\*Org todo\\*|\\*Org Note\\*&quot;&#xA;        (display-buffer-use-some-window)&#xA;        (inhibit-same-window . nil)))) ;locally sets variable &quot;override&quot; as key-value pair for display-buffer-alist entry&#xA;    (add-to-list 'display-buffer-alist override) ;adds the contents of the above defined variable to display-buffer-alist&#xA;    (my/with-advice&#xA;        ((#'org-switch-to-buffer-other-window :override #'switch-to-buffer-other-window))&#xA;      (unwind-protect (funcall orig-fn)&#xA;        (setq display-buffer-alist&#xA;              (delete override display-buffer-alist))))))&#xA;&#xA;; Injecting the relevant advice into the org-fast-todo-selection function&#xA;(advice-add #'org-fast-todo-selection :around #'hd/org-todo-same-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9725" LastActivityDate="2015-10-05T23:50:03.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17164" PostTypeId="1" CreationDate="2015-10-06T04:33:11.080" Score="9" ViewCount="5576" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KZaf2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KZaf2.png&quot; alt=&quot;Comparison of emacs -nw vs emacs with GUI&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the left: emacs in console mode. On the right: emacs with GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running 24.5.1 on Arch linux. Both my console and emacs have the font set to Inconsolata 12. What can I do to make the emacs with GUI fonts look &quot;smoother&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[ETA more detail:]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried making a &lt;code&gt;/etc/fonts/local.conf&lt;/code&gt; file which &lt;a href=&quot;https://wiki.archlinux.org/index.php/Font_configuration#Anti-aliasing&quot; rel=&quot;nofollow noreferrer&quot;&gt;specified anti-aliasing&lt;/a&gt;. It made no difference. (I'm not using Infinality.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://stackoverflow.com/a/22711440/54056&quot;&gt;this answer&lt;/a&gt; I should find out the GNOME settings and make a &lt;code&gt;.Xresources&lt;/code&gt; file that emacs would use. But I didn't have any luck there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From gnome-tweak-tool I had:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hinting: medium&lt;/li&gt;&#xA;&lt;li&gt;Antialiasing: Grayscale&lt;/li&gt;&#xA;&lt;li&gt;Scaling Factor: 1.0&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I couldn't figure out what &quot;Antialiasing Grayscale&quot; is equivalent to in Xresources-speak...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ xrdb -query | grep Xft&#xA;Xft.dpi:    96&#xA;Xft.antialias:  1&#xA;Xft.hinting:    1&#xA;Xft.hintstyle:  hintmedium&#xA;Xft.rgba:   none&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what was there before I made a &lt;code&gt;.Xresources&lt;/code&gt; file and it seems basically correct? I tried changing &lt;code&gt;Xft.rgba&lt;/code&gt; to &lt;code&gt;rgb&lt;/code&gt; but I couldn't appreciate any difference.&lt;/p&gt;&#xA;" OwnerUserId="9741" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2024-01-21T22:58:06.897" Title="How to improve emacs font rendering" Tags="|fonts|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17165" PostTypeId="1" AcceptedAnswerId="17167" CreationDate="2015-10-06T09:14:30.767" Score="7" ViewCount="1849" Body="&lt;p&gt;I understand that #+STARTUP: property can control the fold/unfold setting in &lt;strong&gt;file level&lt;/strong&gt; when the org file is loaded. But I need it be more granular. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if it is possible to set it in node level? for example, *node1 has all subitems unfolded, and *node2, *node3 have all subitems folded?&lt;/p&gt;&#xA;" OwnerUserId="9570" LastEditorUserId="262" LastEditDate="2015-10-06T21:22:27.990" LastActivityDate="2015-11-15T04:04:27.497" Title="Select which nodes are folded in org mode files when opened" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17166" PostTypeId="2" ParentId="17165" CreationDate="2015-10-06T09:26:25.193" Score="4" Body="&lt;p&gt;Yes, it is possible. You can set a &lt;code&gt;VISIBILITY&lt;/code&gt; property for that node separately, for example, use &lt;code&gt;M-x org-set-property VISIBILITY ...&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-06T09:26:25.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17167" PostTypeId="2" ParentId="17165" CreationDate="2015-10-06T12:45:20.297" Score="12" Body="&lt;p&gt;xuchunyang is right. Just to complete the answer, you can set the &lt;code&gt;VISIBILITY&lt;/code&gt; property to &lt;code&gt;children&lt;/code&gt; for the node to develop such as in the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; * Node to be unfolded&#xA; :PROPERTIES:&#xA; :VISIBILITY: children&#xA; :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2015-10-06T12:45:20.297" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17168" PostTypeId="2" ParentId="17148" CreationDate="2015-10-06T13:03:04.417" Score="4" Body="&lt;p&gt;I've tried &lt;a href=&quot;https://github.com/mrkkrp/vimish-fold&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vimish fold&lt;/a&gt;, and it seems to do what you ask.  Below is my setup for the keybindings:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'vimish-fold)&#xA;(vimish-fold-global-mode 1)&#xA;;; this registers a region for future folding/unfolding&#xA;(global-set-key (kbd &quot;C-c v&quot;) #'vimish-fold)&#xA;;; this unregisters the region under point from folding/unfolding&#xA;(global-set-key (kbd &quot;C-c d&quot;) #'vimish-fold-delete)&#xA;;; this is the actual fold/unfold command&#xA;(global-set-key (kbd &quot;C-c t&quot;) #'vimish-fold-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think &lt;a href=&quot;https://emacs.stackexchange.com/users/2487/mark&quot;&gt;Mark&lt;/a&gt; is the author of this mode, so, maybe he'll chime in and write something about it too.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-10-06T13:03:04.417" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17169" PostTypeId="1" AcceptedAnswerId="17175" CreationDate="2015-10-06T13:04:41.267" Score="4" ViewCount="974" Body="&lt;p&gt;When I run &lt;code&gt;M-x helm-buffers-list&lt;/code&gt; it shows list of buffers in the order of their last visit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9q7Af.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9q7Af.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I open quite  a few dired buffers, when &lt;code&gt;helm-buffers-list&lt;/code&gt; is invoked, dired buffers are occupying lots of visible space. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i move all dired buffers to bottom and have other files at top? &lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="105" LastEditDate="2015-10-06T14:00:57.420" LastActivityDate="2015-10-06T15:33:05.720" Title="Change order of buffers in Helm buffers list?" Tags="|helm|buffers|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17170" PostTypeId="1" AcceptedAnswerId="17176" CreationDate="2015-10-06T13:18:35.230" Score="7" ViewCount="4085" Body="&lt;p&gt;Chrome browser has an excellent extension called &lt;a href=&quot;https://chrome.google.com/webstore/detail/auto-copy/bijpdibkloghppkbmhcklkogpjaenfkg?hl=en&quot; rel=&quot;noreferrer&quot;&gt;autocopy&lt;/a&gt;, which copies text whenever some text is selected/highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To copy a region in emacs, I have to select the region and then press &lt;code&gt;M-w&lt;/code&gt; to copy it. But whenever I select a region, I want the region to be copied automatically. How can I achieve that in emacs?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="115" LastEditDate="2015-10-06T16:59:30.743" LastActivityDate="2015-10-06T16:59:30.743" Title="How to auto copy when a region is selected?" Tags="|copy-paste|region|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17171" PostTypeId="2" ParentId="17170" CreationDate="2015-10-06T13:33:04.493" Score="9" Body="&lt;p&gt;If you just need this behavior for mouse selections, you can use the built-in setting &lt;code&gt;mouse-drag-copy-region&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mouse-drag-copy-region t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If non-nil, copy to kill-ring upon mouse adjustments of the region.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-10-06T13:33:04.493" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17172" PostTypeId="1" AcceptedAnswerId="17173" CreationDate="2015-10-06T14:30:22.767" Score="1" ViewCount="1068" Body="&lt;p&gt;It looks pretty usefull to see where the buffer ends. For example, with help of black dashes column, like at this screenshot (look at left grey-colored border). How to implement this solution in my &lt;em&gt;.emacs&lt;/em&gt; file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://3.bp.blogspot.com/-Qm_vnCJc3sc/Tslj_wC_jII/AAAAAAAAD1A/lyX-MfaBoEI/s1600/Screenshot--home-hitman-org-mygtd.org_archive.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9686" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.853" LastActivityDate="2015-10-06T19:16:34.320" Title="how to make end of buffer visible?" Tags="|buffers|" AnswerCount="3" CommentCount="0" ClosedDate="2015-10-07T03:41:41.813" ContentLicense="CC BY-SA 3.0" />
  <row Id="17173" PostTypeId="2" ParentId="17172" CreationDate="2015-10-06T14:35:37.213" Score="6" Body="&lt;pre&gt;&lt;code&gt;(setq-default indicate-empty-lines t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or &lt;code&gt;M-x toggle-indicate-empty-lines&lt;/code&gt; to turn it on and off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only works with a GUI because it uses the fringe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read more:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Indicators.html&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Indicators.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-10-06T14:35:37.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17174" PostTypeId="2" ParentId="17172" CreationDate="2015-10-06T14:42:03.850" Score="4" Body="&lt;p&gt;I've written a package, &lt;a href=&quot;https://github.com/Lindydancer/char-font-lock&quot; rel=&quot;nofollow noreferrer&quot;&gt;char-font-lock&lt;/a&gt;, that (among else) highlight empty lines at the end of a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also highlights the last line (in case it doesn't end with a newline), space at the end of lines, tab characters, and non-ascii characters. You can cherry pick which of the things you would like to highlight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/B7LRo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-10-06T14:42:03.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17175" PostTypeId="2" ParentId="17169" CreationDate="2015-10-06T15:33:05.720" Score="6" Body="&lt;p&gt;&lt;code&gt;helm-buffers-sort-transformer&lt;/code&gt; is used to sort buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun sort-dired-buffers (buffers)&#xA;  &quot;Sort BUFFERS by moving all Dired buffers to the end.&quot;&#xA;  (let (dired-buffers other-buffers)&#xA;    (dolist (buf buffers)&#xA;      (if (with-current-buffer buf&#xA;            (eq major-mode 'dired-mode))&#xA;          (push buf dired-buffers)&#xA;        (push buf other-buffers)))&#xA;    (nreverse (append dired-buffers other-buffers))))&#xA;&#xA;(defun helm-buffers-sort-dired-buffers (orig-fun &amp;amp;rest args)&#xA;  (sort-dired-buffers (apply orig-fun args)))&#xA;&#xA;(advice-add 'helm-buffers-sort-transformer :around #'helm-buffers-sort-dired-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-06T15:33:05.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17176" PostTypeId="2" ParentId="17170" CreationDate="2015-10-06T16:12:10.020" Score="8" Body="&lt;p&gt;The selection can be copied automatically if the OS supports &lt;em&gt;primary selection&lt;/em&gt; by setting the below variable.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq x-select-enable-primary t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h v x-select-enable-primary&lt;/code&gt;, you get,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil means cutting and pasting uses the primary selection&#xA;  The existence of a primary selection depends on the underlying GUI you use.&#xA;  E.g. it doesn't exist under MS-Windows.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To learn even more, visit the relevant info node by doing &lt;code&gt;C-h i g (emacs) Primary Selection&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another variable setting that goes in tandem with the above is to set the &lt;code&gt;x-select-enable-clipboard&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. Doing that allows you to yank the contents copied from other X11 applications into emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq x-select-enable-clipboard t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When emacs 25.1 is released (supposedly the next stable version after 24.5), the &lt;code&gt;x-select-enable-primary&lt;/code&gt; variable name will be deprecated and &lt;code&gt;select-enable-primary&lt;/code&gt; must be used instead (removal of that &lt;code&gt;x-&lt;/code&gt; prefix). Similarly &lt;code&gt;x-select-enable-clipboard&lt;/code&gt; will be deprecated in favor of &lt;code&gt;select-enable-clipboard&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-10-06T16:17:33.357" LastActivityDate="2015-10-06T16:17:33.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17178" PostTypeId="2" ParentId="17172" CreationDate="2015-10-06T19:16:34.320" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/WhiteSpace&quot; rel=&quot;nofollow noreferrer&quot;&gt;Not everyone is happy with it&lt;/a&gt;, but &lt;a href=&quot;http://www.emacswiki.org/emacs/WhiteSpace&quot; rel=&quot;nofollow noreferrer&quot;&gt;whitespace-mode&lt;/a&gt; is included with Emacs since version 23.  It does a good job of showing the end of a file and any extra blank lines, along with showing the ends of lines and distinguishing tabs from spaces.  The faces used are of course configurable--I keep the colors bright because I only use the mode occasionally. Here is an example of editing XML with whitespace-mode enabled in conjunction with &lt;a href=&quot;http://www.emacswiki.org/emacs/LineNumbers&quot; rel=&quot;nofollow noreferrer&quot;&gt;linum-mode&lt;/a&gt; (which produced the line numbers in the fringe), giving a very vi-ish look to the window:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Oj37L.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Oj37L.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2374" LastActivityDate="2015-10-06T19:16:34.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17179" PostTypeId="2" ParentId="13163" CreationDate="2015-10-06T19:52:10.037" Score="0" Body="&lt;p&gt;Use cider-connect instead of cider-jack-in&lt;/p&gt;&#xA;" OwnerUserId="9749" LastActivityDate="2015-10-06T19:52:10.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17180" PostTypeId="2" ParentId="17145" CreationDate="2015-10-06T20:18:31.717" Score="2" Body="&lt;p&gt;I think the Emacs shell is telling &lt;code&gt;ps&lt;/code&gt; what the column width is, and that causes &lt;code&gt;ps&lt;/code&gt; to truncate its output. You can explicitly set the output width to unlimited by setting the &lt;code&gt;-w&lt;/code&gt; argument twice: &lt;code&gt;ps -ef -w -w&lt;/code&gt;. This overrides whatever settings Emacs is setting in shell mode.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-10-06T20:18:31.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17181" PostTypeId="2" ParentId="17145" CreationDate="2015-10-06T23:03:00.480" Score="2" Body="&lt;p&gt;As correctly guessed by &lt;a href=&quot;https://emacs.stackexchange.com/a/17180&quot;&gt;Tyler&lt;/a&gt;, what's happening is that &lt;code&gt;ps&lt;/code&gt; is truncating the output to the width of the terminal when it's running in Emacs Term, but not when it's running elsewhere. You can see that in the line where you grep for &lt;code&gt;13109&lt;/code&gt;. Note that it's &lt;code&gt;ps&lt;/code&gt; doing the truncation, not the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this happens is that Term sets the &lt;code&gt;COLUMNS&lt;/code&gt; environment variable to the window width. Most other terminals do not do this. Your shell probably sets the &lt;code&gt;COLUMNS&lt;/code&gt; variable, but as an shell variable only, not as an environment variable (i.e. it isn't exported). Compare:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo $COLUMNS&#xA;env | grep COLUMNS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in Term and in other terminals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;ps&lt;/code&gt; command uses the &lt;code&gt;COLUMNS&lt;/code&gt; variable to determine the width of its output, even when its output isn't going to the terminal. On Linux and *BSD (including OSX), you can pass the &lt;code&gt;w&lt;/code&gt; option twice to tell &lt;code&gt;ps&lt;/code&gt; not to truncate lines. If &lt;code&gt;COLUMNS&lt;/code&gt; is not in the environment, most &lt;code&gt;ps&lt;/code&gt; implementations (including Linux) don't truncate the output if it isn't going to the terminal.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ps -efww | grep juniper&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;unset COLUMNS&#xA;ps -ef | grep juniper&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or alternatively&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ps $(pgrep -f juniper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-06T23:03:00.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17182" PostTypeId="1" AcceptedAnswerId="17217" CreationDate="2015-10-06T23:44:53.303" Score="1" ViewCount="139" Body="&lt;p&gt;On one computer I use, my emacs will always run commands in my home directory, rather than the directory of the currently open file (i.e. &lt;code&gt;default-directory&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A standalone reproduction is executing the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;/tmp/&quot;)) (compile &quot;pwd&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the computer in question, it prints the path to my home, not &lt;code&gt;/tmp&lt;/code&gt; as it does on all other computers-with-emacs I have access to. (The same thing happens with &lt;code&gt;M-!&lt;/code&gt;/&lt;code&gt;M-x shell-command&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently installed 24.5 into my user folder (the global install is 23.4), and installed Emacs Prelude but the behaviour described above happened/happens in all configurations (it certainly happened before I made any modifications) and happens if I run &lt;code&gt;emacs -Q&lt;/code&gt; (for both 24.5 and 23.4) to avoid reading my configurations (as lawlist asks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there's no obvious problem/fix, is there a good way to start to debug a problem like this?&lt;/p&gt;&#xA;" OwnerUserId="9752" LastEditorUserId="9752" LastEditDate="2015-10-07T07:10:34.433" LastActivityDate="2015-10-08T07:22:18.470" Title="M-x compile and shell-command ignore default-directory" Tags="|shell-command|compilation-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17183" PostTypeId="1" CreationDate="2015-10-07T02:29:11.290" Score="16" ViewCount="682" Body="&lt;p&gt;I would like some plugin which colors html tags with a corresponding color based on which tag they match. For example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;div&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/div&amp;gt;&lt;/code&gt; would be highlighted the same color while &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt; would be highlighted the same color, but differently than the div tags. It wouldn't be based off of what type of tag it is, just what depth it is.&lt;/p&gt;&#xA;" OwnerUserId="9754" LastEditorUserId="105" LastEditDate="2016-08-15T01:03:51.013" LastActivityDate="2024-03-30T11:00:45.143" Title="Is there a plugin that does color HTML matching tags like rainbow delimiters?" Tags="|html|highlighting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17184" PostTypeId="1" AcceptedAnswerId="17186" CreationDate="2015-10-07T03:27:53.230" Score="0" ViewCount="70" Body="&lt;p&gt;I am getting very inconsistent behavior with &lt;code&gt;js-mode&lt;/code&gt; and &lt;code&gt;js2-mode&lt;/code&gt; hooks and I am not sure why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have three &quot;hooks&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'js2-mode-hook (lambda () (setq mode-name &quot;Zono-mode&quot;))) &#xA;(add-hook 'js2-mode-hook (lambda () (tern-mode t)))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason these &lt;strong&gt;do&lt;/strong&gt; work on my Mac but do not work on my Fedora Linux system, and I am wondering if anyone can offer a reason as to why this would happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To further the strangeness, the very similar &lt;code&gt;(add-hook 'js-mode-hook (lambda () (ac-js2-mode t)))&lt;/code&gt; does work on both machines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice would be much appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of the libaries have been installed, and, when opening a file that ends in &lt;code&gt;.js&lt;/code&gt; I do enter &lt;code&gt;js2-mode&lt;/code&gt; (it just seems none of the hooks are run)&#xA;The only possible difference I see is on my Fedora machine Emacs is 24.5.1 and on my Mac it is Emacs 24.4.1. but I looked and this should make no difference (in fact the newer versions should help make sure hooks are run)&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="7047" LastEditDate="2015-10-07T03:41:49.507" LastActivityDate="2015-11-06T03:53:46.803" Title="Why do my js2-mode hooks work on Mac but not Fedora Linux?" Tags="|init-file|hooks|js2-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17185" PostTypeId="1" AcceptedAnswerId="17207" CreationDate="2015-10-07T03:40:22.673" Score="1" ViewCount="424" Body="&lt;p&gt;Or: How to put face changes in a defun?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use AUCTeX to edit my LaTeX files and I like the way AUCTeX displays the sub- and superscripts (not only in formulas).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not only it shifts the sub- or superscripted text up or down, it also scales it down a bit (probably to still fit in the line). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's great, because it makes the text more clearly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it breaks the idea of the monospaced font. So, while working in any way with the rectangular features, the problem occurs, that the same column isn't displayed at the same visual position, which is a bit annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A short demonstration: All cells are filled with the same amount of chars:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\begin{tabular}{cc}&#xA;$f^{oo}$ &amp;amp; $b_{ar}$ \\ &#xA;(f|{oo}) &amp;amp; (b|{ar}) \\&#xA;\end{tabular}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but won't displayed this way in AUCTeX (per default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I thought, I could write a function to turn the sub- and superscript feature on and off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As described at &lt;a href=&quot;https://stackoverflow.com/questions/9534239/emacs-auctex-latex-syntax-prevents-monospaced-font&quot;&gt;Emacs AucTex Latex syntax prevents monospaced font&lt;/a&gt; one can give emacs permanent rules, by putting this in your init.el:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq font-latex-script-display (quote (nil))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which prevents the shifting, and:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-faces&#xA; '(font-latex-subscript-face ((t nil)))&#xA; '(font-latex-superscript-face ((t nil)))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which turns off the scaling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I tried things like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-LaTeX-rectangular-edit-ready-mode ()&#xA;  (interactive)&#xA;  (if (equal truncate-lines nil)&#xA;      (progn&#xA;    (setq-default font-latex-subscript-face '(:height 80)) ; doesn't work&#xA;    (set-face-font font-latex-superscript-face '(:height 80)) ; also doesn't work &#xA;    (setq font-latex-superscript-face ((t nil))) ; also doesn't work &#xA;    (setq truncate-lines t)&#xA;    (message &quot;LaTeX-rectangular-edit-ready-mode has been switched on&quot;)&#xA;    )&#xA;    (progn&#xA;      (normal-mode)&#xA;      (setq truncate-lines nil)&#xA;      (message &quot;LaTeX-rectangular-edit-ready-mode has been switched off&quot;)&#xA;      )&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;without any success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current workaround:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-LaTeX-rectangular-edit-ready-mode ()&#xA;  (interactive)&#xA;  (if (equal truncate-lines nil)&#xA;      (progn&#xA;    (text-mode)&#xA;    (setq truncate-lines t)&#xA;    (message &quot;LaTeX-rectangular-edit-ready-mode has been switched on&quot;)&#xA;    )&#xA;    (progn&#xA;      (normal-mode)&#xA;      (setq truncate-lines nil)&#xA;      (message &quot;LaTeX-rectangular-edit-ready-mode has been switched off&quot;)&#xA;      )&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is hopefully just a miserable intermediate result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I achieve toggling face changes?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution (not only intermediate?)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As giordano mentioned, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Attribute-Functions.html#index-set_002dface_002dattribute&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;set-face-attribute&lt;/code&gt;&lt;/a&gt; helps us adjusting the height of the sub- and superscripted text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We complete the defun with &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Fontification-of-math.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;font-latex-script-display&lt;/code&gt;&lt;/a&gt;. At first, I thought, we have to restart the major-mode after using font-latex-script-display, but all we need is a &lt;code&gt;font-lock-fontify-buffer&lt;/code&gt; call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said, I need this function mostly for manipulating text rectangularly, so that's why I toggle &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Line-Truncation.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;truncate-lines&lt;/code&gt;&lt;/a&gt; (I use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;visual-line-mode&lt;/code&gt;&lt;/a&gt;). To make the function perfect, we add &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Recentering.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;recenter&lt;/code&gt;&lt;/a&gt;, because by toggling truncate-lines  the cursor appears in a different place, &lt;code&gt;recenter&lt;/code&gt; helps us finding the cursor, so we get finally:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-LaTeX-rectangular-edit-ready-mode ()&#xA;  (interactive)&#xA;  (if (equal truncate-lines nil)&#xA;      (progn&#xA;    (set-face-attribute 'font-latex-subscript-face nil :height 1.0)&#xA;    (set-face-attribute 'font-latex-superscript-face nil :height 1.0)&#xA;    (setq font-latex-script-display (quote (nil)))&#xA;    (font-lock-fontify-buffer)&#xA;    (setq truncate-lines t)&#xA;    (recenter)&#xA;    (message &quot;LaTeX-rectangular-edit-ready-mode has been switched on&quot;))&#xA;    (progn&#xA;      (set-face-attribute 'font-latex-subscript-face nil :height 0.8)&#xA;      (set-face-attribute 'font-latex-superscript-face nil :height 0.8)&#xA;      (setq font-latex-script-display (quote ((raise -0.3) raise 0.3)))&#xA;      (font-lock-fontify-buffer)&#xA;      (setq truncate-lines nil)&#xA;      (recenter)&#xA;      (message &quot;LaTeX-rectangular-edit-ready-mode has been switched off&quot;)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I'll bind to a fn key.&lt;/p&gt;&#xA;" OwnerUserId="9755" LastEditorUserId="9755" LastEditDate="2015-10-09T02:07:01.713" LastActivityDate="2015-10-09T02:07:01.713" Title="AUCTeX: toggle sub- and superscript-fontification" Tags="|auctex|faces|rectangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17186" PostTypeId="2" ParentId="17184" CreationDate="2015-10-07T03:49:09.687" Score="0" Body="&lt;p&gt;This was called because &lt;code&gt;ac-js2&lt;/code&gt; mode was being called and raising an error. Commenting it out fixed the problem.&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2015-10-07T03:49:09.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17187" PostTypeId="2" ParentId="251" CreationDate="2015-10-07T05:49:54.203" Score="2" Body="&lt;p&gt;This is a bug; it is fixed in trunk. The issue is caused by bad line height information on TeX fonts, which happen to be the ones that Emacs falls back to if it can't find a character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-05/msg00696.html&quot; rel=&quot;nofollow&quot;&gt;The bug thread on emacs-bug&lt;/a&gt; has a lot more info.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-10-07T05:49:54.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17188" PostTypeId="1" CreationDate="2015-10-07T08:03:27.243" Score="1" ViewCount="353" Body="&lt;p&gt;I understand that &lt;code&gt;find-file &quot;file path&quot;&lt;/code&gt; in .emacs can load the file automatically after emacs starts up.&#xA;However, I would like to have&lt;code&gt;org-agenda week&lt;/code&gt; &lt;code&gt;C-c a a&lt;/code&gt; open instead of a local file.&#xA;How can this be achieved by elisp?&lt;/p&gt;&#xA;" OwnerUserId="9570" LastActivityDate="2017-04-15T05:48:27.537" Title="open org-agenda weekly view window when emacs is loaded" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17189" PostTypeId="2" ParentId="17188" CreationDate="2015-10-07T08:34:39.313" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;(org-agenda-list)&lt;/code&gt; or &lt;code&gt;(execute-kbd-macro (kbd &quot;C-c a a&quot;))&lt;/code&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-startup-hook #'org-agenda-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-startup-hook&#xA;          (lambda () (execute-kbd-macro (kbd &quot;C-c a a&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-10-07T09:00:12.373" LastActivityDate="2015-10-07T09:00:12.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17190" PostTypeId="2" ParentId="14290" CreationDate="2015-10-07T11:42:27.550" Score="7" Body="&lt;p&gt;You got the error &quot;Autoloading failed to define function&quot; because multiple packages are apparently active in your load-path. Try &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;list-load-path-shadows&lt;/code&gt; to get a clue which packages are conflicting.&lt;/p&gt;&#xA;" OwnerUserId="7125" LastActivityDate="2015-10-07T11:42:27.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17191" PostTypeId="2" ParentId="16586" CreationDate="2015-10-07T12:25:18.133" Score="1" Body="&lt;p&gt;Oh , if you are using evil-mode you can just add this line to your &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default evil-cross-lines nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9760" LastEditorUserId="10" LastEditDate="2015-10-07T19:50:59.580" LastActivityDate="2015-10-07T19:50:59.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17192" PostTypeId="1" CreationDate="2015-10-07T13:47:46.980" Score="6" ViewCount="999" Body="&lt;p&gt;I am trying to work with Arabic and English texts in the same buffer. They don't have to be in the same paragraphs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A text like &lt;code&gt;والإكرام و نوافج&lt;/code&gt; is shown as separate letters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contrary to English, in Arabic, the letters should change the form depending on their position (beginning, middle or end). I see the individual: و ا ل إ ك رام و ن وا ف ج. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs recognizes that the Arabic text is left-to-right though. The backspace key deletes the last logical letter, that is,the letter to the right of the cursor.&lt;/p&gt;&#xA;" OwnerUserId="9761" LastActivityDate="2015-10-07T17:39:36.170" Title="Arabic in emacs shown as separate letters" Tags="|characters|right-to-left|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17193" PostTypeId="1" CreationDate="2015-10-07T16:03:18.033" Score="1" ViewCount="222" Body="&lt;p&gt;I use the &lt;a href=&quot;https://github.com/coldnew/linum-relative&quot; rel=&quot;nofollow&quot;&gt;linum-relative&lt;/a&gt; package to get line numbers relative to the cursor in the margin. The reason this is useful to me is I drive emacs with speech recognition, and the speech recognizer has a specialized more accurate mode for numbers than it does for general speech, so I try to navigate using commands based on numbers where possible. So with relative line numbers I can say &quot;up 5&quot; or &quot;down 29&quot; and know exactly where I will end up. Relative numbers are better than absolute because they are smaller and easier to say; if I'm in the middle of a big file and I want to go down 3 lines I don't want to say &quot;goto line three thousand four hundred and twenty six.&quot; I just want to say, &quot;down 3&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm trying to give helm a spin and I noticed that when I use helm-M-x the relative line numbers don't work. They appear, but always consider the first line of the buffer to be 0 regardless of where the cursor is. That is until you scroll down past the end of the window, then they move again but stay still after that until you go outside the window boundary again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway to get relative line numbers working with helm-M-x? I'm guessing that helm is listening directly to input events to drive the menu rather than really moving the cursor, but I haven't dug into the code.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-10-07T16:03:18.033" Title="helm-M-x and linum-relative" Tags="|helm|linum-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17194" PostTypeId="1" AcceptedAnswerId="17197" CreationDate="2015-10-07T16:10:44.590" Score="1" ViewCount="37" Body="&lt;p&gt;If I do &quot;ctrl-x ctrl-f /tmp/foo.html&quot; (where /tmp/foo.html doesn't exist), emacs prompts me for &quot;Document Title:&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I turn off this behavior (which I'm guessing is an html-mode hook of some sort).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if this question is too simple for this site.&lt;/p&gt;&#xA;" OwnerDisplayName="user9762" LastActivityDate="2015-10-07T16:31:46.273" Title="When opening &quot;/tmp/foo.html&quot;, don't prompt for Document Title" Tags="|hooks|html|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17195" PostTypeId="2" ParentId="15303" CreationDate="2015-10-07T16:15:43.350" Score="6" Body="&lt;p&gt;There is a new feature in Emacs from version 24.4 for using Unicode strings to access filenames in Windows. This allows using filenames containing characters that are not in the locale's 8-bit character set, which was previously impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://masteringemacs.org/article/whats-new-in-emacs-24-4&quot; rel=&quot;noreferrer&quot;&gt;http://masteringemacs.org/article/whats-new-in-emacs-24-4&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs on Windows 2000 and later can now access files and directories&#xA;  whose names cannot be encoded in the current system codepage.&#xA;  The new variable &lt;code&gt;w32-unicode-filenames&lt;/code&gt; controls this feature: if it&#xA;  is t, Emacs uses Unicode APIs to pass file names to system calls,&#xA;  which lifts the limitation of file names to the current locale.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is not supported, however, by &lt;code&gt;emacsclient&lt;/code&gt;, which simply uses the non-unicode &lt;code&gt;argv&lt;/code&gt; to read the list of filenames.&lt;/p&gt;&#xA;" OwnerUserId="6862" LastActivityDate="2015-10-07T16:15:43.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17196" PostTypeId="2" ParentId="17194" CreationDate="2015-10-07T16:27:20.693" Score="0" Body="&lt;p&gt;You may have &lt;code&gt;auto-insert-mode&lt;/code&gt; enabled. Try &lt;code&gt;M-x auto-insert-mode&lt;/code&gt; to toggle this minor mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When enabled, Emacs will insert a template based on the mode of the new file and prompt you to fill in fields of that template. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may be enabled by default. You can disable it permanently in your Emacs init file, or just use &lt;code&gt;M-x customize-option auto-insert-mode&lt;/code&gt; and disable it there. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-10-07T16:27:20.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17197" PostTypeId="2" ParentId="17194" CreationDate="2015-10-07T16:31:46.273" Score="0" Body="&lt;p&gt;&lt;code&gt;grep&lt;/code&gt; does not find a match for &lt;code&gt;Document Title&lt;/code&gt; in the Lisp source code delivered with GNU Emacs (including &lt;code&gt;autoinsert.el&lt;/code&gt;).  This behavior is perhaps provided by a 3rd-party library (or that prompt could be dynamically generated, or it could be in the C source code).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you see the same thing if you start Emacs using &lt;code&gt;emacs -Q&lt;/code&gt; (i.e., with no init file)? If not, recursively bisect your init file to find the culprit code. You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment or (with &lt;code&gt;C-u&lt;/code&gt;) uncomment a region of text in your init file. Comment out 1/2, then 3/4,, 7/8,... until you find the cause.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-07T16:31:46.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17198" PostTypeId="2" ParentId="13163" CreationDate="2015-10-07T16:41:49.800" Score="2" Body="&lt;p&gt;First follow these instructions &lt;a href=&quot;https://github.com/clojure-emacs/cider#using-boot&quot; rel=&quot;nofollow&quot;&gt;on the Readme&lt;/a&gt; so that boot knows about CIDER.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Boot users can configure the tool to include the middleware automatically in all of their projects using a &lt;code&gt;~/.boot/profile.boot&lt;/code&gt; file like so:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'boot.repl)&#xA;&#xA;(swap! boot.repl/*default-dependencies*&#xA;       concat '[[cider/cider-nrepl &quot;0.9.1&quot;]])&#xA;&#xA;(swap! boot.repl/*default-middleware*&#xA;       conj 'cider.nrepl/cider-middleware)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then just invoke &lt;code&gt;cider-jack-in&lt;/code&gt; on a project that contains a&#xA;&lt;code&gt;build.boot&lt;/code&gt; file. If this project also has a &lt;code&gt;project.clj&lt;/code&gt; file, CIDER&#xA;will ask you whether you want boot or lein.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-10-07T16:41:49.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17199" PostTypeId="1" AcceptedAnswerId="17202" CreationDate="2015-10-07T17:04:28.403" Score="4" ViewCount="327" Body="&lt;p&gt;I'm new to using ERT for testing my Elisp code, and I have a question that doesn't seem to be covered in the manual: according to best practices, where does one typically put the ERT tests? Do they go at the end of the elisp file that is to be tested, or should I put them in a separate file? I'm sure they'll work either way, but is one or the other preferred? &lt;/p&gt;&#xA;" OwnerUserId="2046" LastActivityDate="2015-10-07T18:21:24.577" Title="Where should my ERT tests go?" Tags="|ert|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17200" PostTypeId="2" ParentId="17199" CreationDate="2015-10-07T17:12:22.520" Score="4" Body="&lt;p&gt;Separate file, of course. The end users need not load it. In fact, if you distribute through MELPA, the tests won't be bundled.  The convention is to name the file &lt;code&gt;foo-test.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-10-07T17:12:22.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17201" PostTypeId="2" ParentId="17192" CreationDate="2015-10-07T17:39:36.170" Score="6" Body="&lt;p&gt;I found a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1st run &lt;code&gt;(print (font-family-list))&lt;/code&gt; and get a full list of all fonts. Pick an installed Arabic font. In my case it was &quot;&lt;code&gt;clearlyu arabic&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add this line to the .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(when window-system (set-fontset-font &quot;fontset-default&quot; '(#x600 . #x6ff) &quot;clearlyu arabic&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change the font name at the end to the name of the font you have installed.&lt;/p&gt;&#xA;" OwnerUserId="9761" LastActivityDate="2015-10-07T17:39:36.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17202" PostTypeId="2" ParentId="17199" CreationDate="2015-10-07T17:41:31.793" Score="6" Body="&lt;p&gt;I would place the tests in a &lt;code&gt;test&lt;/code&gt; directory and name it &lt;code&gt;thepackage-test.el&lt;/code&gt;. Alternatively, &lt;code&gt;thepackage-test-onething.el&lt;/code&gt; and &lt;code&gt;thepackage-test-anotherthing.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a test directory is especially useful if the tests require auxiliary files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another advantage is that it simplifies the MELPA recipe, as subdirectories aren't included by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an example of a package with relative complex tests, you can take a look at my font-lock rules for CMake: &lt;a href=&quot;https://github.com/Lindydancer/cmake-font-lock&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/Lindydancer/cmake-font-lock&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-10-07T18:21:24.577" LastActivityDate="2015-10-07T18:21:24.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17203" PostTypeId="1" CreationDate="2015-10-07T17:53:52.343" Score="0" ViewCount="209" Body="&lt;p&gt;When I use &lt;code&gt;smartparens-mode&lt;/code&gt; or &lt;code&gt;paredit-mode&lt;/code&gt; to shift parens around (e.g. &lt;code&gt;paredit-forward-slurp-sexp&lt;/code&gt;) the effected forms are not being indented appropriately. For example if I add a &lt;code&gt;let&lt;/code&gt; and then slurp the next sexp the paren is placed appropriately but the inner form is not auto-indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This used to work for me but for some reason it is not now. What are some possible config problems that would prevent the auto-indentation from happening? BTW, I'm using a slightly modified version of prelude.&lt;/p&gt;&#xA;" OwnerUserId="9764" LastActivityDate="2015-10-07T17:53:52.343" Title="lisp code not indenting after paredit slurping, etc" Tags="|smartparens|paredit|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17204" PostTypeId="1" CreationDate="2015-10-07T17:58:32.487" Score="2" ViewCount="52" Body="&#xA;&#xA;&lt;p&gt;The below settings in my &lt;code&gt;.emacs&lt;/code&gt; make emacs (24.3) save multiple back-ups.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq delete-old-versions t&#xA;      kept-new-versions 6&#xA;      kept-old-versions 2&#xA;      version-control t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I have little use for the newest 6 and oldest 2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to distribute the back-ups. For example, keep the last saved version each day, and keep 5 versions for the present day.&lt;/p&gt;&#xA;" OwnerUserId="9761" LastEditorUserId="115" LastEditDate="2015-10-07T18:21:11.143" LastActivityDate="2015-10-07T18:21:11.143" Title="Keeping multiple back-ups" Tags="|backup|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17205" PostTypeId="1" CreationDate="2015-10-07T18:06:36.447" Score="26" ViewCount="3145" Body="&lt;p&gt;&lt;strong&gt;TL;DR: What's a simple way to reliably say: use Consolas as the default font, FreeMono for the characters unsupported by Consolas, and Symbola for characters unsupported by both?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since my main programming font does not cover all the mathematical symbols I need, I initially set up font fallback as shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font t 'unicode (font-spec :name &quot;FreeMono&quot;) nil 'append)&#xA;(set-fontset-font t 'unicode (font-spec :name &quot;Symbola&quot;) nil 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this also changed the font for some of the character that my main font supports, so I changed it to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font t 'unicode (font-spec :name &quot;Consolas&quot;) nil)&#xA;(set-fontset-font t 'unicode (font-spec :name &quot;FreeMono&quot;) nil 'append)&#xA;(set-fontset-font t 'unicode (font-spec :name &quot;Symbola&quot;) nil 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If my understanding is correct, this should ensure that characters that Consolas cannot handle are handled by FreeMono, unless FreeMono doesn't have them, in which case they should be displayed using Symbola. It is also my understanding that &lt;code&gt;t&lt;/code&gt; does the same as &lt;code&gt;&quot;fontset-default&quot;&lt;/code&gt; above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, there were still cases where the right font wasn't selected; I found that changing to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font t 'unicode (font-spec :name &quot;Consolas&quot;) nil)&#xA;(set-fontset-font t 'unicode (font-spec :name &quot;FreeMono&quot;) nil 'append)&#xA;(set-fontset-font t 'unicode (font-spec :name &quot;Symbola&quot;) nil 'append)&#xA;(set-fontset-font &quot;fontset-startup&quot; 'unicode (font-spec :name &quot;Consolas&quot;) nil)&#xA;(set-fontset-font &quot;fontset-startup&quot; 'unicode (font-spec :name &quot;FreeMono&quot;) nil 'append)&#xA;(set-fontset-font &quot;fontset-startup&quot; 'unicode (font-spec :name &quot;Symbola&quot;) nil 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;worked better, but not always: changing the font size using  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil :height some-size)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;caused the fallbacks to be ignored, due to new fontsets being created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current solution is to do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font fontset 'unicode (font-spec :name &quot;Consolas&quot;) nil)&#xA;(set-fontset-font fontset 'unicode (font-spec :name &quot;FreeMono&quot;) nil 'append)&#xA;(set-fontset-font fontset 'unicode (font-spec :name &quot;Symbola&quot;) nil 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on each fontset (&lt;code&gt;fontset-list&lt;/code&gt;), after each font size change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What's the proper way to set font fallback?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: for testing purposes, here are a few math characters: &lt;code&gt;ℕ⧺×≠≥≤±¬∨∧∃∀λ⟿⟹⊥⊤⊢&lt;/code&gt;&lt;br&gt;&#xA;&lt;em&gt;References&lt;/em&gt;: Emacs manual on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Fontsets.html&quot;&gt;fontsets&lt;/a&gt; and on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Defining-Fontsets.html#Defining-Fontsets&quot;&gt;modifying fontsets&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2024-03-06T06:07:35.937" Title="How do I set up font fallback in a robust way?" Tags="|fonts|display|unicode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17206" PostTypeId="1" AcceptedAnswerId="18649" CreationDate="2015-10-07T18:21:17.627" Score="7" ViewCount="459" Body="&lt;p&gt;How can I ask Emacs to scale or truncate wide characters (resp. pad narrow characters), so that falling back to a variable-width font does not cause alignment to be broken? I'm thinking of cases like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abcdefg&#xA;a ⟿ g&#xA;abcdefg&#xA;&#xA;abcdefg&#xA;a  g&#xA;abcdefg&#xA;&#xA;abcdefg&#xA;a ∃∀∃ g&#xA;abcdefg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd just like Emacs to place all characters on a grid. If a character is wider than one cell, then I'd like it to take two cells. If wider than two, then three. Ideally, it would also be nice to force certain characters to fit in one cell, maybe by scaling the font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative, it would be pretty close if all characters were just consider to occupy on space, and spilled beyond their boundaries. I can do this by manually editing the font, of course, but it would be nice if Emacs did it itself (plus if all characters are considered to occupy one space column counts are always accurate.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VpyN6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VpyN6.png&quot; alt=&quot;All characters made to occupy exactly one cell&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2015-10-08T03:45:48.820" LastActivityDate="2015-12-06T23:21:51.140" Title="How can I prevent large characters from breaking alignment?" Tags="|fonts|display|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17207" PostTypeId="2" ParentId="17185" CreationDate="2015-10-07T20:47:55.623" Score="1" Body="&lt;p&gt;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Attribute-Functions.html#index-set_002dface_002dattribute&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;set-face-attribute&lt;/code&gt;&lt;/a&gt; in order to change a face on-the-fly, not &lt;code&gt;setq&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-LaTeX-rectangular-edit-ready-mode ()&#xA;  (interactive)&#xA;  (if (equal truncate-lines nil)&#xA;      (progn&#xA;    (set-face-attribute&#xA;     'font-latex-subscript-face nil&#xA;     :height 1.0)&#xA;    (set-face-attribute&#xA;     'font-latex-superscript-face nil&#xA;     :height 1.0)&#xA;    (setq truncate-lines t)&#xA;    (message &quot;LaTeX-rectangular-edit-ready-mode has been switched on&quot;))&#xA;    (progn&#xA;      (set-face-attribute&#xA;       'font-latex-subscript-face nil&#xA;       :height 0.8)&#xA;      (set-face-attribute&#xA;       'font-latex-superscript-face nil&#xA;       :height 0.8)&#xA;      (setq truncate-lines nil)&#xA;      (message &quot;LaTeX-rectangular-edit-ready-mode has been switched off&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-10-07T20:47:55.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17208" PostTypeId="1" AcceptedAnswerId="17215" CreationDate="2015-10-07T21:25:48.190" Score="5" ViewCount="243" Body="&lt;p&gt;Attempting to eval a babel source block that contains a &lt;code&gt;__future__&lt;/code&gt; import and also uses a &lt;code&gt;:var&lt;/code&gt; causes Python to spit out&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 2&#xA;SyntaxError: from __future__ imports must occur at the beginning of the file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Presumably babel is sticking the &lt;code&gt;:var&lt;/code&gt; definitions before the first line of my code. How can I prevent babel from doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimum failing example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: data&#xA;| Hi | 2 |&#xA;&#xA;#+BEGIN_SRC python :var data=data&#xA;  from __future__ import print_function&#xA;  print(*data)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9451" LastActivityDate="2015-10-08T04:09:31.497" Title="How do I import __future__ in org-mode babel" Tags="|org-mode|python|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17209" PostTypeId="1" CreationDate="2015-10-07T21:39:37.297" Score="6" ViewCount="963" Body="&lt;p&gt;How can I modify the default FILES pattern in rgrep for C++ mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For C mode the default is &lt;code&gt;*.[ch]&lt;/code&gt;. For C++, it is &lt;code&gt;*.cc *.cxx *.cpp *.C *.CC *.c++&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to change it to &lt;code&gt;*.cc *.[ch]xx *.[ch]pp *.[CHh] *.CC *.HH *.[ch]++&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9765" LastEditorUserId="25" LastEditDate="2015-10-07T22:23:12.720" LastActivityDate="2015-10-08T05:21:44.773" Title="rgrep default files pattern" Tags="|cc-mode|rgrep|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17210" PostTypeId="1" CreationDate="2015-10-07T21:46:02.893" Score="15" ViewCount="14846" Body="&lt;p&gt;I would like to put all of my auto-save files into a directory, say something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs-saves&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Based on what's written in the wiki, I came up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq backup-by-copying t      ; don't clobber symlinks&#xA;      backup-directory-alist '((&quot;.&quot; . &quot;~/.emacs-saves&quot;))    ; don't litter my fs tree&#xA;      delete-old-versions t&#xA;      kept-new-versions 6&#xA;      kept-old-versions 2&#xA;      version-control t)       ; use versioned backups&#xA;(setq auto-save-file-name-transforms&#xA;      `((&quot;.*&quot; &quot;~/.emacs-saves&quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now my autosaves are going in my home directory, which is actually kind of an improvement, but not what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain to me what I'm doing wrong, and how to correct it?  I'm also very interested in what this syntax means (It's an example from the wiki entry):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq auto-save-file-name-transforms&#xA;      `((&quot;.*&quot; ,temporary-file-directory t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's with the comma in &lt;code&gt;,temporary-file-directory&lt;/code&gt;?  &lt;/p&gt;&#xA;" OwnerUserId="8576" LastEditorUserId="18240" LastEditDate="2018-01-26T15:58:24.533" LastActivityDate="2018-01-27T17:02:02.403" Title="How to place all auto-save files in a directory" Tags="|init-file|auto-save|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17211" PostTypeId="1" AcceptedAnswerId="17213" CreationDate="2015-10-07T21:56:58.557" Score="0" ViewCount="47" Body="&lt;p&gt;When I increase the default font size (say, from Menlo 12 to 14), either by Options-&gt;Set Default Font or by &lt;code&gt;(set-face-attribute 'default nil :height 140)&lt;/code&gt;, the top of the buffer becomes hidden. The visible part of the buffer starts a few lines down (depending on font size) and the actual top is hidden above the top of the window. I can move the cursor up to the top of the buffer, but it disappears above the window. &lt;code&gt;M-x beginning-of-buffer&lt;/code&gt; doesn't help. If I lower the font size, it becomes visible again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.5 (9.0) on OS X Yosemite (10.10.5)&lt;/p&gt;&#xA;" OwnerUserId="9766" LastActivityDate="2015-10-07T22:16:50.540" Title="Top of buffer cut off with larger fonts" Tags="|fonts|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17212" PostTypeId="1" AcceptedAnswerId="17218" CreationDate="2015-10-07T21:57:46.073" Score="2" ViewCount="497" Body="&lt;p&gt;I have the following configuration for keychord:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define evil-normal-state-map &quot;fk&quot; 'evil-window-up)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the timing option, I'm still able to do some operations with the original &lt;code&gt;f&lt;/code&gt; function, like find character &lt;code&gt;k&lt;/code&gt; with &lt;kbd&gt;f&lt;/kbd&gt;, after waiting 0.4 seconds. If I do &lt;kbd&gt;fk&lt;/kbd&gt; inside 0.4 seconds, then he will go the adjacent window up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to bind the keysequence &lt;kbd&gt;f&lt;/kbd&gt; and &lt;kbd&gt;f9&lt;/kbd&gt; to do something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I configure this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define evil-normal-state-map &quot;f&amp;lt;f9&amp;gt;&quot; 'evil-window-up)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I get an error: &lt;code&gt;(error: &quot;Key-chord key must have two elements&quot;)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another suggestion, to let keychord accept these keys? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-08T09:30:29.520" Title="How define a function key in keychord/key-seq?" Tags="|key-chord-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17213" PostTypeId="2" ParentId="17211" CreationDate="2015-10-07T22:16:50.540" Score="1" Body="&lt;p&gt;Turns out this was due to a conflict with setting frame size:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist '(&#xA;               (width . 150)&#xA;               (height . 52) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9766" LastActivityDate="2015-10-07T22:16:50.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17214" PostTypeId="2" ParentId="17210" CreationDate="2015-10-08T01:27:11.720" Score="16" Body="&lt;p&gt;Put a slash at the end of your string. It's a directory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-save-file-name-transforms&#xA;  `((&quot;.*&quot; &quot;~/.emacs-saves/&quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The comma is used in the backquote notation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x 123)&#xA;(setq y `(my-x ,x))&#xA;(setq z (list 'my-x x)) ;; same as y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2015-10-08T01:27:11.720" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17215" PostTypeId="2" ParentId="17208" CreationDate="2015-10-08T04:09:31.497" Score="4" Body="&lt;p&gt;You can use the &lt;code&gt;prologue&lt;/code&gt; header argument.  Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: data&#xA;| Hi  | 2 |&#xA;| Bye | 3 |&#xA;&#xA;#+name: test-py27-with-print-function&#xA;#+header: :prologue &quot;from __future__ import print_function&quot;&#xA;#+BEGIN_SRC python :var data=data :results output list&#xA;  for row in data:&#xA;      print(*row)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: test-py27-with-print-function&#xA;: - Hi 2&#xA;: - Bye 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2015-10-08T04:09:31.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17216" PostTypeId="2" ParentId="17209" CreationDate="2015-10-08T05:21:44.773" Score="6" Body="&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-variable&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;grep-files-aliases&lt;/code&gt; and then use the interface to change the value of this variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could put:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf (cdr (assoc &quot;cc&quot; grep-files-aliases))&#xA;      (assoc &quot;cchh&quot; grep-files-aliases))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For future reference, you could have looked up the help for &lt;code&gt;rgrep&lt;/code&gt; (by typing &lt;kbd&gt;C-h f&lt;/kbd&gt;&lt;code&gt;rgrep&lt;/code&gt;) where it says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Recursively grep for REGEXP in FILES in directory tree rooted at DIR.&#xA;  The search is limited to file names matching shell pattern FILES.&#xA;  FILES may use abbreviations defined in &lt;code&gt;grep-files-aliases&lt;/code&gt;, e.g.&#xA;  entering &lt;code&gt;ch&lt;/code&gt; is equivalent to &lt;code&gt;*.[ch]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-10-08T05:21:44.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17217" PostTypeId="2" ParentId="17182" CreationDate="2015-10-08T07:22:18.470" Score="1" Body="&lt;p&gt;After experimenting with overriding &lt;code&gt;$HOME&lt;/code&gt; and tracking some things through with &lt;code&gt;bash -x&lt;/code&gt; as @Gilles suggested, I found my &lt;code&gt;~/.bash_profile&lt;/code&gt; included an isolated &lt;code&gt;cd&lt;/code&gt; command, meaning the shell emacs spawned to compile/run commands was always left in my home directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Annoying, and apparently my fault, although I have no idea how that &lt;code&gt;cd&lt;/code&gt; got there.)&lt;/p&gt;&#xA;" OwnerUserId="9752" LastActivityDate="2015-10-08T07:22:18.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17218" PostTypeId="2" ParentId="17212" CreationDate="2015-10-08T09:30:29.520" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/key-chord.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;key-chord&lt;/code&gt;&lt;/a&gt; does not support binding Function keys as a part of key chords. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is the information regarding that from the &quot;Limitations&quot; section in that package's documentation header. &lt;/p&gt;&#xA;&#xA; &#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Emacs will not call input-method-function for keys that have non numeric&#xA;;; codes or whos code is outside the range 32..126. Thus you cannot define&#xA;;; key chords involving function keys, control keys, or even your non-english&#xA;;; letters (on national keyboards) that otherwise are well positioned for&#xA;;; chording on your keyboard.&#xA;;; (I think chording left and right arrow keys would be useful, but cannot do.&#xA;;; I consider this a bug in Emacs. Input methods could happily return &#xA;;; unmodified *any* key they don't know about.)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-10-08T09:30:29.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17219" PostTypeId="1" AcceptedAnswerId="17220" CreationDate="2015-10-08T09:34:33.637" Score="2" ViewCount="331" Body="&lt;p&gt;I frequently re-search the terms previously searched by &lt;code&gt;isearch-forward&lt;/code&gt; in my current session. &#xA;Assume that I have searched &lt;code&gt;term1&lt;/code&gt;, &lt;code&gt;term2&lt;/code&gt;, ... during my previous I-searches. &#xA;When I do a new &lt;code&gt;isearch-forward&lt;/code&gt;, I would like to have a quick access to my previous search terms (say &lt;code&gt;term1&lt;/code&gt;, &lt;code&gt;term2&lt;/code&gt;, ... ), maybe to use them again. For this I have to switch to the minibuffer by putting the cursor in front of &lt;code&gt;I-search:&lt;/code&gt; then pressing &lt;code&gt;Up-Arrow&lt;/code&gt; &lt;code&gt;Down-Arrow&lt;/code&gt; to have the access to the previous search terms, then pressing &lt;code&gt;RET&lt;/code&gt; after selecting one of them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there the possibility to do this without switching to the minibuffer? I mean pressing &lt;code&gt;Up-Arrow&lt;/code&gt; &lt;code&gt;Down-Arrow&lt;/code&gt; just after calling &lt;code&gt;isearch-forward&lt;/code&gt; results in the access to previous search terms.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-10-08T09:45:35.140" Title="Quick access to the previous search terms after calling isearch-forward without switching to the minibuffer" Tags="|minibuffer|isearch|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17220" PostTypeId="2" ParentId="17219" CreationDate="2015-10-08T09:45:35.140" Score="7" Body="&lt;p&gt;With &lt;code&gt;C-s C-s&lt;/code&gt; you search the previous word. Then &lt;code&gt;M-p&lt;/code&gt; (and &lt;code&gt;M-n&lt;/code&gt;) for history.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-10-08T09:45:35.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17221" PostTypeId="1" CreationDate="2015-10-08T10:11:07.577" Score="2" ViewCount="365" Body="&lt;p&gt;How can I do a &lt;code&gt;svn revert &amp;lt;file&amp;gt;&lt;/code&gt; from &lt;a href=&quot;http://www.emacswiki.org/emacs/VersionControl&quot; rel=&quot;nofollow&quot;&gt;Emacs Version Control&lt;/a&gt;?&lt;br&gt;&#xA;I've read many parts of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Version-Control.html#Version-Control&quot; rel=&quot;nofollow&quot;&gt;the manual&lt;/a&gt;, but can't find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to do it over a file after opening it with &lt;code&gt;vc-directory&lt;/code&gt; &lt;kbd&gt;C-x v d&lt;/kbd&gt;, but any other way would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2015-10-08T12:14:02.823" Title="How to &quot;svn revert &lt;file&gt;&quot; with Emacs Version Control?" Tags="|version-control|vc|svn|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17222" PostTypeId="2" ParentId="17221" CreationDate="2015-10-08T10:15:03.067" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;M-x vc-revert&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or use this function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun revert-svn()&#xA;    (interactive)&#xA;    (vc-revert)&#xA;    (revert-buffer t t))&#xA;(global-set-key (kbd &quot;C-x v u&quot;) 'revert-svn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-10-08T10:15:03.067" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17223" PostTypeId="1" AcceptedAnswerId="17261" CreationDate="2015-10-08T10:18:57.507" Score="1" ViewCount="139" Body="&lt;p&gt;I would like to prepend a $ sign to the front of every non empty line in the export. Comments should be skipped if possible. Couldn't find an option for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an option? If not is there a quick way to achieve that with some elisp?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-10-08T10:29:30.707" LastActivityDate="2016-04-22T02:34:59.963" Title="Prepend string to lines in org source block export?" Tags="|org-export|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17225" PostTypeId="2" ParentId="17221" CreationDate="2015-10-08T12:14:02.823" Score="1" Body="&lt;p&gt;As @djangoliv has mentioned, &lt;code&gt;M-x vc-revert&lt;/code&gt; works (&lt;kbd&gt;C-x v u&lt;/kbd&gt; on Emacs 24.5.1).&lt;br&gt;&#xA;When doing it over a file on a &lt;code&gt;*vc-dir*&lt;/code&gt; buffer (opened by &lt;code&gt;vc-directory&lt;/code&gt; command), another buffer with the differences is opened and a prompt message appears in the mini-buffer to confirm it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just like this image:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/g9rCx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/g9rCx.png&quot; alt=&quot;vc-revert&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2015-10-08T12:14:02.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17226" PostTypeId="1" AcceptedAnswerId="17228" CreationDate="2015-10-08T13:33:45.970" Score="2" ViewCount="728" Body="&lt;p&gt;When I schedule an item, I want to get something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO Lift weights&#xA;   SCHEDULED: &amp;lt;2009-01-22 Thu +2d&amp;gt; &#xA;   - State &quot;DONE&quot;       [2009-01-16 Fri 23:14]&#xA;   - State &quot;DONE&quot;       [2009-01-14 Wed 17:25]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suppose the state update for something like &lt;code&gt;SCHEDULED: &amp;lt;2015-10-07 Tue&amp;gt;--&amp;lt;2015-10-17 Tue&amp;gt;&lt;/code&gt; would be the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The scheduling as such looks OK in the org-agenda (something like &lt;code&gt;myfile: (1/11): TODO Lift weights&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, how does the &quot;- State &quot;DONE&quot; ...&quot; part get inserted? What function or key-biding generate these lines (when the time comes)? How do I keep track of partial tasks?&lt;/p&gt;&#xA;" OwnerUserId="9320" LastEditorUserId="253" LastEditDate="2015-12-22T00:45:18.907" LastActivityDate="2015-12-22T00:45:18.907" Title="Working with SCHEDULED items (recurring task), org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17228" PostTypeId="2" ParentId="17226" CreationDate="2015-10-08T14:13:58.527" Score="2" Body="&lt;p&gt;The insertion of the &lt;code&gt;- State &quot;DONE&quot;...&lt;/code&gt; is mostly controlled by the variable &lt;code&gt;org-log-done&lt;/code&gt;, which causes org-mode to insert a timestamp when a entry is changed to a done state.  You can also control this per-state by adding a &lt;code&gt;(!)&lt;/code&gt; to the definition of the state in &lt;code&gt;org-todo-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether the note is appended to the entry of placed in the &lt;code&gt;LOGBOOK&lt;/code&gt; drawer is controlled by the &lt;code&gt;org-log-into-drawer&lt;/code&gt; variable or the &lt;code&gt;LOG_INTO_DRAWER&lt;/code&gt; property.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-10-08T14:13:58.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17230" PostTypeId="1" AcceptedAnswerId="17241" CreationDate="2015-10-08T15:57:57.383" Score="1" ViewCount="395" Body="&lt;p&gt;I'm using web-mode and yasnippet for coding PHP and HTML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use yasnippet in web-mode, will have to install php-mode, php-auto-yasnippets, emmet-mode and ac-emmet as suggested in web-mode.org. But I prefer to make it happen just with web-mode and yasnippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part of my web-mode configuration is like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice yas-expand-from-trigger-key (before web-mode-before-yas-expand activate)&#xA;        (run-hooks 'web-mode-cur-language-mode-hook))&#xA;&#xA;&#xA;(add-hook 'web-mode-cur-language-mode-hook&#xA;      '(lambda ()&#xA;         (let ((web-mode-cur-language&#xA;                (web-mode-language-at-pos)))&#xA;           (if (string= web-mode-cur-language &quot;php&quot;)&#xA;               (yas-activate-extra-mode 'php-mode)&#xA;             (yas-deactivate-extra-mode 'php-mode))&#xA;           (if (string= web-mode-cur-language &quot;html&quot;)&#xA;                (yas-activate-extra-mode 'html-mode)&#xA;              (yas-deactivate-extra-mode 'html-mode))&#xA;           )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And following is my yasnippet configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path (expand-file-name &quot;elpa/yasnippet&quot; user-emacs-directory))&#xA;&#xA;(require 'yasnippet)&#xA;&#xA;(yas-global-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works very well when edit php file in web-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then open a html file in emacs, input &quot;form&quot; then &quot;tab&quot;, everything works fine. But if input &quot;href&quot; then &quot;tab&quot;, nothing happened. It supposed to call the &quot;href&quot; snippet in nxml-mode as written in html-mode's .yas-parents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I make this right? I really don't want copy all those snippets from nxml-mode to html-mode.&lt;/p&gt;&#xA;" OwnerUserId="9678" LastActivityDate="2015-10-10T05:20:01.157" Title=".yas-parents have no effect with web-mode" Tags="|yasnippet|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17231" PostTypeId="1" CreationDate="2015-10-08T16:45:03.110" Score="3" ViewCount="102" Body="&lt;p&gt;In agenda view, how can I make a list of all tasks (more than 30 ongoing tasks) that are late?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That should included recurring scheduled tasks for the month, were I jumped a day. For example, had to do something 1,2,3,4, but did it 1,2,4. The list should keep track that some item was skipped.&lt;/p&gt;&#xA;" OwnerUserId="9774" LastEditorUserId="9774" LastEditDate="2015-10-08T17:31:25.853" LastActivityDate="2015-10-08T17:31:25.853" Title="How to view scheduled tasks or deadlines that are late" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17232" PostTypeId="1" AcceptedAnswerId="17236" CreationDate="2015-10-08T17:30:29.203" Score="4" ViewCount="535" Body="&#xA;&#xA;&lt;p&gt;The below dummy &lt;code&gt;foo&lt;/code&gt; describes how I need the &lt;code&gt;prefix&lt;/code&gt; variable setting to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like the &lt;code&gt;read-number&lt;/code&gt; prompt to show up only if the user entered &lt;code&gt;C-u&lt;/code&gt; as prefix. In all other cases, the prefix will be read as &lt;code&gt;(interactive &quot;p&quot;)&lt;/code&gt; would usually do.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (prefix)&#xA;  ;; (interactive &quot;p&quot;) ??&#xA;  ;; (interactive (list (read-number &quot;Num: &quot;))) ??&#xA;  ;; Only if `C-u' prefix is used, show the prompt for user entry&#xA;  ;; else set PREFIX to user entered numeric prefix using&#xA;  ;; the C-0/C-1 or M-0/M-1 style.&#xA;  (message &quot;prefix = %0d&quot; prefix))&#xA;;; Desired outcome&#xA;;;  C-0 M-x foo =&amp;gt; prefix = 0 (no prompt)&#xA;;;  M-6 M-x foo =&amp;gt; prefix = 6 (no prompt)&#xA;;;  C-u M-x foo =&amp;gt; Prompt appears =&amp;gt; User enters 7 =&amp;gt; prefix = 7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2017-12-24T16:08:52.877" LastActivityDate="2017-12-24T16:08:52.877" Title="How to initiate a prompt for user input based on the prefix argument?" Tags="|interactive|prefix-argument|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17233" PostTypeId="2" ParentId="17232" CreationDate="2015-10-08T18:23:22.257" Score="1" Body="&lt;p&gt;I'm not sure if this is the most elegant way but it does the job:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (prefix)&#xA;  (interactive &quot;P&quot;)&#xA;  (cond ((null prefix)&#xA;         (setq prefix 1))&#xA;        ((listp prefix)&#xA;         (setq prefix (read-number &quot;Num: &quot;))))&#xA;  (message &quot;prefix = %0d&quot; prefix))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The capital &quot;P&quot; in the interactive form means pass the prefix arg in it's raw form. This means it is nil without a prefix, a non empty list if you call it with &lt;code&gt;C-u&lt;/code&gt; (called universal-argument) or numeric if you call it with &lt;code&gt;C-1&lt;/code&gt;,&lt;code&gt;M-3&lt;/code&gt; and friends. &lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-10-08T18:23:22.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17234" PostTypeId="1" CreationDate="2015-10-08T18:58:36.907" Score="0" ViewCount="122" Body="&lt;p&gt;If you type &lt;code&gt;C-c C-k&lt;/code&gt; (to abort a capture process, for example), you get a &lt;code&gt;C-c C-v&lt;/code&gt; instead. It's like for this particular shortcut combo, Emacs interprets the hard key codes instead of the Dvorak layout on top (FYI: pressing &lt;code&gt;v&lt;/code&gt; on a standard keyboard produces the key &lt;code&gt;k&lt;/code&gt; with the Dvorak layout). I think the problem lies with Emacs since even the mini buffer shows it as &lt;code&gt;C-c C-v&lt;/code&gt;. At any other time, my &lt;code&gt;k&lt;/code&gt; key works just fine on its own (&lt;s&gt;including any other shortcut other than &lt;code&gt;C-c C-k&lt;/code&gt;&lt;/s&gt; &lt;code&gt;C-k&lt;/code&gt; generally trenslates to &lt;code&gt;C-v&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have any other Dvorak user encountered this problem? How did you fix this? I want to make sure I'm not the only one, because if I am, it is probably not a bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on Emacs 24.5.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: I just noticed an old piece of Autohotkey script that was mapping Ctrl+k to Ctrl-v. So the problem was Emacs unrelated.&lt;/p&gt;&#xA;" OwnerUserId="9775" LastEditorUserId="9775" LastEditDate="2015-10-08T21:13:47.197" LastActivityDate="2015-10-08T21:13:47.197" Title="SOLVED Emacs + Dvorak: C-c C-k bug" Tags="|keyboard-layout|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17235" PostTypeId="1" AcceptedAnswerId="17325" CreationDate="2015-10-08T20:52:13.113" Score="-2" ViewCount="322" Body="&lt;p&gt;How could I remap the keycombination &lt;code&gt;f&lt;/code&gt; and &lt;code&gt;&amp;lt;F9&amp;gt;&lt;/code&gt;, without affecting the other Evil operations? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have the following &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;f &amp;lt;f9&amp;gt;&quot;) 'foobar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I press &lt;kbd&gt;f&lt;/kbd&gt; and &lt;kbd&gt;F9&lt;/kbd&gt;, then &lt;code&gt;foobar&lt;/code&gt; will be called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, now I'm facing another problem. The &lt;kbd&gt;f&lt;/kbd&gt;-key is not functioning anymore for other Evil operations. It works only for &lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;f9&lt;/kbd&gt; and not for finding character &lt;code&gt;a&lt;/code&gt; with &lt;kbd&gt;fa&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the logic here. I understand why this issue has risen. But I'm struggling with the question how I could invent some workaround for this, and use the keycombination &lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;f9&lt;/kbd&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-10-09T16:29:40.380" LastActivityDate="2015-10-13T07:13:34.780" Title="How map a prefix key, but keep the other keys untouched?" Tags="|key-bindings|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17236" PostTypeId="2" ParentId="17232" CreationDate="2015-10-08T22:40:21.873" Score="6" Body="&lt;p&gt;Here's a more elegant way of doing it:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (arg)&#xA;  (interactive&#xA;   (list (if (consp current-prefix-arg)&#xA;             (read-number &quot;Number: &quot;)&#xA;           (prefix-numeric-value current-prefix-arg))))&#xA;  (message &quot;prefix = %0d&quot; arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;current-prefix-arg&lt;/code&gt; holds the value you'd get from &lt;code&gt;(interactive &quot;P&quot;)&lt;/code&gt;.  You can convert it to what &lt;code&gt;(interactive &quot;p&quot;)&lt;/code&gt; would return with &lt;code&gt;prefix-numeric-value&lt;/code&gt;.  Finally, the universal argument is represented as &lt;code&gt;(4)&lt;/code&gt;, &lt;code&gt;(16)&lt;/code&gt;, &lt;code&gt;(64)&lt;/code&gt;, etc., depending on the times you've hit &lt;code&gt;C-u&lt;/code&gt;.  It's tempting to use the &lt;code&gt;listp&lt;/code&gt; predicate to detect it, but that would return &lt;code&gt;t&lt;/code&gt; for no argument as &lt;code&gt;nil&lt;/code&gt; and &lt;code&gt;()&lt;/code&gt; are the same, so I'm using &lt;code&gt;consp&lt;/code&gt; instead to explicitly test whether we've got a cons cell there.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-08T22:40:21.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17237" PostTypeId="1" AcceptedAnswerId="17238" CreationDate="2015-10-09T00:24:00.697" Score="23" ViewCount="8119" Body="&lt;p&gt;In Emacs, where is ispell's personal dictionary stored?, the documentation &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Spelling.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Spelling.html&lt;/a&gt; says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Your personal dictionary is specified by the variable ispell-personal-dictionary. If that is nil, the spelling program looks for a personal dictionary in a default location.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But where is this default location?  In general, how to find out this?&lt;/p&gt;&#xA;" OwnerUserId="936" LastActivityDate="2015-10-09T01:08:22.560" Title="In Emacs, where is ispell's personal dictionary stored?" Tags="|ispell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17238" PostTypeId="2" ParentId="17237" CreationDate="2015-10-09T01:08:22.560" Score="28" Body="&lt;p&gt;&lt;code&gt;C-h v ispell-personal-dictionary&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;File name of your personal spelling dictionary, or nil.&#xA;If nil, the default personal dictionary, (\&quot;~/.ispell_DICTNAME\&quot; for ispell or&#xA;\&quot;~/.aspell.LANG.pws\&quot; for aspell) is used, where DICTNAME is the name of your&#xA;default dictionary and LANG the two letter language code.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="499" LastActivityDate="2015-10-09T01:08:22.560" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17239" PostTypeId="1" AcceptedAnswerId="17975" CreationDate="2015-10-09T02:00:45.003" Score="1" ViewCount="865" Body="&lt;p&gt;I'm new to the &lt;code&gt;#+INCLUDE&lt;/code&gt; command, and am using it to assemble a book of sheet music.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the top of the file I've placed a &lt;code&gt;#+LaTeX_HEADER&lt;/code&gt; to use the &lt;code&gt;\fancyhdr&lt;/code&gt; package for footers for all the pages in the book. After a few pages of text introduction, I insert sheet music:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: &quot;/home/me/music.ly&quot; src lilypond :file output.eps&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does kind of work, but there are about 4 pages of outputted sheet music, and only the first ends up in the exported PDF. Additionally, there is this collision between the sheet music and the footer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XGlij.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XGlij.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder, on the one hand, if it's possible to get &lt;code&gt;#+INCLUDE&lt;/code&gt; to include all of the pages of sheet music within the bounds of the margins of the page---and on the other hand if doing this with &lt;code&gt;Org&lt;/code&gt; might be less sensible than directly using &lt;code&gt;LaTeX&lt;/code&gt; or &lt;code&gt;Lilypond-book&lt;/code&gt;. I'm struggling to get my head around it all, and would appreciate any voices of experience.&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2015-11-10T10:40:17.830" Title="Org-export: LaTeX---&gt;PDF with multipage #+INCLUDE" Tags="|org-export|latex|lilypond|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17240" PostTypeId="1" CreationDate="2015-10-09T03:22:17.947" Score="2" ViewCount="420" Body="&lt;p&gt;Running org-ctrl-c-ctrl-c to evaluate a src block in an org file behaves strangely with windows. With a single window in the frame, it spawns a new window looking at the same buffer in a split and moves focus into the new window. When I have two or more windows open, eval-ing still moves focus to the furthest (last created) window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could be causing this, or how should I troubleshoot it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Env info:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin15.0.0, NS appkit-1404.00 Version 10.11 (Build 15A282)) of 2015-09-27&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode version 8.3.2 (8.3.2-10-g00dacd-elpaplus)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behaviour occurs with no other config on emacs -Q and loading only org-mode.&lt;/p&gt;&#xA;" OwnerUserId="2207" LastEditorUserId="2207" LastEditDate="2015-10-09T03:30:52.497" LastActivityDate="2015-10-09T03:30:52.497" Title="org-babel evaluation of code block always creates new window" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17241" PostTypeId="2" ParentId="17230" CreationDate="2015-10-09T03:35:59.250" Score="0" Body="&lt;p&gt;Code changes was made to yasnippet.el (with 1 addition and 2 deletions), to let it find parents for extra-modes too. Here is the link &lt;a href=&quot;https://github.com/npostavs/yasnippet/commit/603c2949b687c34adbfc8d151e01076995ff6392&quot; rel=&quot;nofollow&quot;&gt;fix #619&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Around line 744:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                     append (funcall dfs neighbour explored)))))&#xA; (remove-duplicates (if mode&#xA;                        (funcall dfs mode)&#xA;-                    (append yas--extra-modes&#xA;-                            (funcall dfs major-mode))))))&#xA;+                    (apply #'append (mapcar dfs (cons major-mode yas--extra-modes)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9678" LastEditorUserId="9678" LastEditDate="2015-10-10T05:20:01.157" LastActivityDate="2015-10-10T05:20:01.157" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17242" PostTypeId="1" CreationDate="2015-10-09T04:03:32.660" Score="5" ViewCount="152" Body="&lt;p&gt;I have a &lt;code&gt;Perl&lt;/code&gt; project (developed in Ubuntu 14.04) which cannot be built on &lt;code&gt;perl 5.18.2&lt;/code&gt;, but it works on &lt;code&gt;Perlbrew 5.22.0&lt;/code&gt;. I have tried to use &lt;code&gt;M-x perldb&lt;/code&gt; in &lt;code&gt;Emacs&lt;/code&gt; but it looks like &lt;code&gt;Emacs&lt;/code&gt; calls &lt;code&gt;Perl 5.18.2&lt;/code&gt; by default. Is there a way to choose &lt;code&gt;Perlbrew&lt;/code&gt; in &lt;code&gt;Emacs&lt;/code&gt; for debugging?&lt;/p&gt;&#xA;" OwnerUserId="9777" LastActivityDate="2016-09-14T09:29:53.653" Title="Is there any setting in Emacs to choose perlbrew over perl?" Tags="|debugging|perl|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17243" PostTypeId="2" ParentId="17242" CreationDate="2015-10-09T05:07:18.827" Score="1" Body="&lt;p&gt;You can customize the command run by perldb by changing &lt;code&gt;gud-perldb-command-name&lt;/code&gt;.  Its default value is set to &lt;code&gt;&quot;perl -d&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-10-09T05:07:18.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17244" PostTypeId="1" AcceptedAnswerId="18706" CreationDate="2015-10-09T05:28:12.477" Score="6" ViewCount="3266" Body="&lt;p&gt;It seems that all items in plain text unordered list have to contain descriptions, otherwise the HTML export is incorrect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- item1 :: item1 description bla bla bla&#xA;- item2&#xA;- item3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I export it to HTML, the result is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;item1&#xA;  item1 description bla bla bla&#xA;(no terms)&#xA;  item2&#xA;(no terms)&#xA;  item3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see that item2 and item3 are exported incorrectly as if the original test was &lt;code&gt;no terms :: item2&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="9570" LastEditorUserId="115" LastEditDate="2015-10-09T11:36:39.957" LastActivityDate="2015-12-12T20:35:45.257" Title="Org-mode list with a mix of unordered and description list items?" Tags="|org-mode|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17246" PostTypeId="1" AcceptedAnswerId="21033" CreationDate="2015-10-09T08:43:44.667" Score="1" ViewCount="153" Body="&lt;p&gt;I've the &lt;code&gt;delete-selection-mode&lt;/code&gt; enabled. In programming modes like Python and Lua, or in general modes like Fundamental or Text, when there's an active region, pressing &lt;code&gt;(&lt;/code&gt; rightly wraps the region with the parenthesis pair like &lt;code&gt;(&lt;/code&gt; &lt;em&gt;region&lt;/em&gt; &lt;code&gt;)&lt;/code&gt;. I understand that this behaviour is not special and the key &lt;code&gt;(&lt;/code&gt; is just bound to &lt;code&gt;self-insert-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I'm in CC mode the region is deleted and I see this &lt;code&gt;(|)&lt;/code&gt;, which is not the desired behaviour as there was an active region; this seems appropriate when there's no active region. Upon investigation I understand that disabling &lt;code&gt;delete-selection-mode&lt;/code&gt; fixes the situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In CC mode, giving &lt;code&gt;M-(&lt;/code&gt; does the job, however, I don't want to special case in my brain saying, for CC mode do &lt;code&gt;M-(&lt;/code&gt; and for every other mode do &lt;code&gt;(&lt;/code&gt;. I want a simple solution where I can just do &lt;code&gt;(&lt;/code&gt; and instead of deleting the selection, the active region should get wrapped.&lt;/p&gt;&#xA;" OwnerUserId="4106" LastEditorUserId="4106" LastEditDate="2015-10-14T09:30:36.257" LastActivityDate="2016-03-18T05:18:08.743" Title="delete-c-electric-paren deletes active region in CC mode with delete-selection-mode enabled" Tags="|region|cc-mode|balanced-parentheses|electric-pair-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17248" PostTypeId="2" ParentId="17244" CreationDate="2015-10-09T13:00:46.573" Score="2" Body="&lt;p&gt;If I understand your question, this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- item1 :: item1 description bla bla bla&#xA;- item2 ::&#xA;- item3 ::&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This produces:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;item1&lt;/strong&gt;&lt;br&gt;&#xA;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; item1 description bla bla bla&lt;br&gt;&#xA;&lt;strong&gt;item2&lt;/strong&gt;&lt;br&gt;&#xA;&lt;strong&gt;item3&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2015-10-09T13:08:05.383" LastActivityDate="2015-10-09T13:08:05.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17249" PostTypeId="1" CreationDate="2015-10-09T13:12:30.243" Score="9" ViewCount="3398" Body="&lt;p&gt;The terminal natively on Mac i.e. spawned through Spotlight or Launchpad, adopts the desired environment variables including the customization in &lt;code&gt;~/.bash_profile&lt;/code&gt;. But when I run Emacs (&lt;code&gt;Emacs.app&lt;/code&gt; taken from &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;noreferrer&quot;&gt;Emacs For Mac OS X&lt;/a&gt;) and spawn shell inside it (using either &lt;code&gt;shell&lt;/code&gt;, &lt;code&gt;eshell&lt;/code&gt; or &lt;code&gt;term&lt;/code&gt;), the shells doesn't adopt the same environment variables as mentioned earlier.&lt;/p&gt;&#xA;&lt;p&gt;I realize that the shell adopts its environment from the process that launches it and it is because of this that the values of shell's environment variable the same as those of Emac (e.g. &lt;code&gt;(getenv &amp;quot;PATH&amp;quot;)&lt;/code&gt;)&lt;/p&gt;&#xA;&lt;p&gt;Venturing inside the content of &lt;code&gt;Terminal.app&lt;/code&gt; and &lt;code&gt;Emacs.app&lt;/code&gt; did not get me lucky.&lt;/p&gt;&#xA;&lt;p&gt;How can I automatically get the same environment variable I get in &lt;code&gt;Terminal.app&lt;/code&gt; in the shell spawned inside Emacs? And I do not prefer launching Emacs from the terminal.&lt;/p&gt;&#xA;&lt;p&gt;&lt;sub&gt;&lt;sup&gt;(I realize that this is too MacOSX-ish and the answers could propose solutions/tweaks that are totally outside of Emacs. But the question concerns Emacs therefore I chose this site)&lt;/sup&gt;&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="8223" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-06-08T20:28:18.907" Title="How to make terminal/shell spawned inside Emacs running on a Mac inherit the environment variables of the native terminal?" Tags="|osx|shell|eshell|environment|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17251" PostTypeId="1" AcceptedAnswerId="17257" CreationDate="2015-10-09T15:56:41.680" Score="1" ViewCount="185" Body="&lt;p&gt;I thought function in elisp can't modify its argument, but it is not true when some special primitive functions such as &lt;code&gt;setcar&lt;/code&gt;/&lt;code&gt;setcdr&lt;/code&gt;/&lt;code&gt;delq&lt;/code&gt;/&lt;code&gt;delete&lt;/code&gt; (not including &lt;code&gt;setq&lt;/code&gt;) are called when defining new function in elisp, for example, in following the value of &lt;code&gt;x&lt;/code&gt; gets changed after calling &lt;code&gt;(foo x)&lt;/code&gt;, which is not unexpected and undesired to me.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (x) (setcdr x nil))&#xA;&#xA;(progn (setq x '(1 2))&#xA;       (foo x)&#xA;       x)&#xA;;; =&amp;gt; (1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know I can make a copy of &lt;code&gt;x&lt;/code&gt; before using &lt;code&gt;setcar&lt;/code&gt; to avoid the problem, is this the right way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, It also looks like it is impossible to write a &lt;code&gt;setcar&lt;/code&gt; implementation in elisp function.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It bothered me when I was writing &lt;code&gt;my-insert-nth&lt;/code&gt;, I had to make a copy of argument &lt;code&gt;list&lt;/code&gt; in function body since &lt;code&gt;list&lt;/code&gt;'s value should be changed, while I'm not quite sure.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-insert-nth (list element n)&#xA;  &quot;Insert ELEMENT at Nth of LIST.&quot;&#xA;  (if (&amp;lt;= n 0)&#xA;      (nconc (list element) list)&#xA;    (let ((len (length list)))&#xA;      (if (&amp;gt;= n len)&#xA;          (append list (list element))&#xA;        ;; FIXME: Why need another copy? Does `defun' already do that?&#xA;        (let ((new-list (copy-sequence list)))&#xA;          (setcdr (nthcdr (1- n) new-list) (cons element (nthcdr n new-list)))&#xA;          new-list)))))&#xA;&#xA;(let ((l '(a b c)))&#xA;  (list (my-insert-nth l 'beg 0)&#xA;        (my-insert-nth l 'mid 2)&#xA;        (my-insert-nth l 'end 3)))&#xA;;; =&amp;gt; ((beg a b c)&#xA;;;     (a b mid c)&#xA;;;     (a b c end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-10T07:15:03.320" Title="Why function which uses the setcdr modifies its argument? and how to avoid?" Tags="|elisp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17252" PostTypeId="1" AcceptedAnswerId="17275" CreationDate="2015-10-09T16:12:20.957" Score="2" ViewCount="936" Body="&lt;p&gt;I work with org-mode TODO lists not in org-agenda mode, but within the actual .org files, marking TODO headings DONE as I go. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE buy milk&#xA;* TODO fix car&#xA;* STARTED call mom&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want org to move point to the next TODO heading once I mark it as DONE. But not before, i.e. when I mark a TODO heading as STARTED, I want point to stay on that heading:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords&#xA;  '(&#xA;(sequence &quot;TODO&quot; &quot;STARTED&quot; &quot;|&quot; &quot;DONE&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get org to move point to next TODO heading upon state change to DONE?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-after-todo-state-change-hook&#xA;(lambda () (org-next-visible-heading 1)) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but it doesn't work because the hook is executed within a &lt;code&gt;save-excursion&lt;/code&gt; block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bb/next-heading (&amp;amp;rest args)&#xA;(org-next-visible-heading 1))&#xA;(advice-add 'org-todo :after 'bb/next-heading)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...which works, but triggers upon ANY state change. How do I make it so &lt;code&gt;org-next-visible-heading&lt;/code&gt; gets triggered ONLY when a TODO heading is marked DONE?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2015-10-09T17:50:07.533" LastActivityDate="2022-04-15T16:51:36.203" Title="in org-mode, how to move point to next TODO heading upon DONE state change?" Tags="|org-mode|hooks|todo|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17253" PostTypeId="1" AcceptedAnswerId="17255" CreationDate="2015-10-09T16:24:38.360" Score="6" ViewCount="1644" Body="&lt;p&gt;I'm new to emacs-lisp. I wrote a function that kills the buffer of my main work document work.org and opens specific project files. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun load-current-files ()&#xA;  (interactive)&#xA;  (kill-buffer &quot;work.org&quot;) &#xA;  (find-file &quot;~/file-1.txt&quot;)&#xA;  (find-file &quot;~/file-2.txt&quot;)&#xA;  (find-file &quot;~/file-3.txt&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function works perfectly when work.org is open. However, if I've already killed that buffer, the function, very naturally throws an error saying &lt;code&gt;Lisp error: (error &quot;No buffer named work.org&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That makes perfect sense. But how do I tell a defun to just keep chugging along even if it encounters an error? Can I wrap a command in an (ignore-errors) layer or something? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ignore-errors (kill-buffer &quot;work.org&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Something like that?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="306" LastEditDate="2015-10-14T02:01:41.847" LastActivityDate="2015-10-14T02:01:41.847" Title="how to direct an elisp defun to continue despite errors?" Tags="|elisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17254" PostTypeId="2" ParentId="12287" CreationDate="2015-10-09T16:30:46.933" Score="1" Body="&lt;pre&gt;&lt;code&gt;(key-chord-define evil-insert-state-map &quot;jk&quot; 'evil-normal-state) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Escape from insert mode &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need keychord for that, by the way. You can install it from your package manager.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-09T16:30:46.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17255" PostTypeId="2" ParentId="17253" CreationDate="2015-10-09T16:47:51.983" Score="7" Body="&lt;p&gt;Yes, you can use the macro &lt;code&gt;ignore-errors&lt;/code&gt;, it is a wrap of the special form &lt;code&gt;condition-case&lt;/code&gt;, use the latter if you want to handle that error.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;ELisp Ref: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html&quot; rel=&quot;noreferrer&quot;&gt;Writing Code to Handle Errors&lt;/a&gt; or &lt;code&gt;(info &quot;(elisp) Handling Errors&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-09T16:47:51.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17256" PostTypeId="1" AcceptedAnswerId="17260" CreationDate="2015-10-09T16:57:49.290" Score="5" ViewCount="2241" Body="&lt;p&gt;I want to use this theme: &lt;a href=&quot;https://github.com/jonnay/emagicians-starter-kit/blob/master/themes/org-beautify-theme.org&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/jonnay/emagicians-starter-kit/blob/master/themes/org-beautify-theme.org&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed it via &lt;code&gt;list-package&lt;/code&gt; successfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried loading it via &lt;code&gt;load-theme RET org-beautify RET&lt;/code&gt; but it says &lt;code&gt;Unable to find theme file for org-beautify&lt;/code&gt;. So I add &lt;code&gt;~\.emacs.d\elpa\org-beautify-theme-20150106.956&lt;/code&gt; to my &lt;code&gt;'custom-theme-load-path&lt;/code&gt; and do the &lt;code&gt;load-theme&lt;/code&gt; thing again, this time it says &lt;code&gt;Undefined custom theme&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I activate the theme?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seeing as someone marked my thread as a duplicate: my custom-theme-load-path does not reset after calling load-theme. You can see that after setting &lt;code&gt;custom-theme-load-path&lt;/code&gt; to the location of the file, calling &lt;code&gt;load-theme RET org-beautify RET&lt;/code&gt; does not give the response &lt;code&gt;Unable to find theme file...&lt;/code&gt; anymore. Instead, I get an error of a different sort (&quot;Undefined custom theme&quot;), which makes me think that I'm not installing it properly. Why can't I choose the theme from Options-&gt;Customize Emacs-&gt;Custom Themes in the first place after installing it with melpa?&lt;/p&gt;&#xA;" OwnerUserId="9775" LastEditorUserId="9775" LastEditDate="2015-10-09T17:53:37.553" LastActivityDate="2015-10-09T18:02:41.937" Title="How to use a theme installed with melpa?" Tags="|package-repositories|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17257" PostTypeId="2" ParentId="17251" CreationDate="2015-10-09T17:43:06.277" Score="3" Body="&lt;p&gt;When passing a list to a function, you pass that list, not a copy of it. If the function you are calling modify the list, the list is modified for anybody having that list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Technically, a list consists of cons pairs, and you pass the topmost cons pair to the function.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you write a lisp function, you have to choice to make it destructive or value based. However, if you make it destructive, you must document it very clearly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, however, you don't have to copy the entire list. Anything after the element you would like to set can refer to the tail of the original list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; the following code use &lt;code&gt;cl-subseq&lt;/code&gt; to copy the start of the list. It is destructively joined with the rest of the list using &lt;code&gt;nconc&lt;/code&gt;, this is fine since we're operating on a new list that no one else can have access to. Also, the &lt;code&gt;0&lt;/code&gt; case has been simplified, all you need to do is to add the new element to the front of the list using &lt;code&gt;cons&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-insert-nth (list element n)&#xA;  (if (&amp;lt;= n 0)&#xA;      (cons element list)&#xA;    (nconc (cl-subseq list 0 n)&#xA;           (cons element (nthcdr n list)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-10-10T07:15:03.320" LastActivityDate="2015-10-10T07:15:03.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17258" PostTypeId="1" AcceptedAnswerId="17281" CreationDate="2015-10-09T17:49:43.293" Score="3" ViewCount="188" Body="&lt;p&gt;I work with org-mode checkboxes, marking them as completed as I go. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO clean kitchen&#xA;- [X] sink&#xA;- [ ] stove&#xA;- [ ] floors&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want org to move point to the next checkbox when when it gets marked &lt;code&gt;- [X]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-toggle-checkbox :after 'org-next-item) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...which works when I do &lt;kbd&gt;C-c C-x C-b&lt;/kbd&gt;. But how do I make &lt;code&gt;org-next-item&lt;/code&gt; trigger automatically when point is on a checkbox and I do &lt;kbd&gt;C-c C-c&lt;/kbd&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-10-11T16:14:41.983" Title="in org-mode, how to move point to next checkbox when it's marked completed?" Tags="|org-mode|hooks|advice|todo|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17259" PostTypeId="1" AcceptedAnswerId="17264" CreationDate="2015-10-09T17:55:48.870" Score="1" ViewCount="346" Body="&lt;p&gt;Putting (org-journal-new-entry) in the init file doesn't work, neither does setting the scratch buffer mode to journal-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kurt Hesselbart's answer works only halfway if there already is an entry for the day, instead of adding a new one it opens the last. As the function description says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Giving the command a prefix arg will just open a today's file,&#xA;  without adding an entry&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However it didn't work at all without a prefix arg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Works not at all if there is no entry for the day already, starting emacs with the -debug-init option then gets the following backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;before first heading&quot;)&#xA;  signal(error (&quot;before first heading&quot;))&#xA;  error(&quot;before first heading&quot;)&#xA;  outline-back-to-heading(t)&#xA;  show-entry()&#xA;  org-journal-new-entry((22041 37049 594411 222000))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/anon/.emacs&quot; nil t)  ; Reading at buffer position 7751&#xA;  load-with-code-conversion(&quot;/home/anon/.emacs&quot; &quot;/home/anon/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;#[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9784" LastEditorUserId="9784" LastEditDate="2015-10-10T22:36:05.367" LastActivityDate="2015-10-13T02:10:24.660" Title="How do I automatically start a new journal entry at emacs start up)" Tags="|org-mode|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17260" PostTypeId="2" ParentId="17256" CreationDate="2015-10-09T18:02:41.937" Score="3" Body="&lt;p&gt;It looks like the author of the theme is using &lt;code&gt;org-babel&lt;/code&gt; to invoke the theme, rather than the &lt;code&gt;M-x load-theme&lt;/code&gt;.  The way that custom themes usually work is that there is a theme named &lt;code&gt;foo&lt;/code&gt; within a file called &lt;code&gt;foo-theme.el&lt;/code&gt;.  In the case of &lt;code&gt;org-beautify&lt;/code&gt;, the actual theme is called &lt;code&gt;org-beautify-theme&lt;/code&gt; when it should just be named &lt;code&gt;org-beautify&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two ways to fix this problem:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Within the file &lt;code&gt;org-beautify-theme.el&lt;/code&gt; there are three references in code to &lt;code&gt;org-beautify-theme&lt;/code&gt;.  Change all of those to &lt;code&gt;org-beautify&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Rename the file &lt;code&gt;org-beautify-theme.el&lt;/code&gt; to &lt;code&gt;org-beautify-theme-theme.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would recommend that you contact the author so that the problem gets fixed upstream.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2015-10-09T18:02:41.937" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17261" PostTypeId="2" ParentId="17223" CreationDate="2015-10-09T18:05:40.790" Score="1" Body="&lt;p&gt;After some elisp hacking, this seems to work:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-add-dollar-sign (text backend info)&#xA;  &quot;Add a dollar sign to the shell export blocks in html exports&quot;&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (with-temp-buffer&#xA;      (insert text)&#xA;      (goto-char (point-min))&#xA;      (search-forward &quot;&amp;lt;pre class=\&quot;src src-sh\&quot;&amp;gt;&quot;)&#xA;      (save-restriction&#xA;        (narrow-to-region (point)&#xA;                          (save-excursion&#xA;                            (search-forward &quot;&amp;lt;/pre&amp;gt;&quot;)&#xA;                            (goto-char (match-beginning 0))&#xA;                            (point)))&#xA;        (while (not (eobp))&#xA;          (unless (or (looking-at&#xA;                       (concat &quot;&amp;lt;span style=\&quot;color: &quot;&#xA;                               (face-attribute 'font-lock-comment-face :foreground)&#xA;                               &quot;;\&quot;&amp;gt;&quot;))&#xA;                      (looking-at &quot;[[:space:]]*$&quot;))&#xA;            (insert &quot;$ &quot;))&#xA;          (forward-line 1)))&#xA;      (buffer-string))))&#xA;&#xA;&#xA;&#xA;(require 'ox)&#xA;(add-to-list 'org-export-filter-src-block-functions&#xA;             'my-add-dollar-sign)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-10-10T10:06:39.510" LastActivityDate="2015-10-10T10:06:39.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17262" PostTypeId="1" AcceptedAnswerId="17276" CreationDate="2015-10-09T18:13:49.613" Score="2" ViewCount="526" Body="&lt;p&gt;I'm trying to use Helm with org-refile. It looks like everyting is working properly except one thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have the following tree in my org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Top level 1&#xA;** Example heading&#xA;* Top level 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to refile &quot;Example heading&quot; to a new node under &quot;Top level 2&quot;. Result should look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Top level 1&#xA;* Top level 2&#xA;** New node&#xA;*** Example heading&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I already setup org-mode so it creates new node without any issues. The problem is that Helm doesn't provide any completion, so every time I should type the whole string, then I need to add &quot;/New node&quot; and press Enter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use Control-Z which works fine when finding files, but not in org-refile. Is there a way to solve such issue?&lt;/p&gt;&#xA;" OwnerUserId="9785" LastActivityDate="2015-10-10T08:55:28.187" Title="How to use org-refile with helm to create a new node?" Tags="|org-mode|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17263" PostTypeId="2" ParentId="17258" CreationDate="2015-10-09T18:30:06.937" Score="2" Body="&lt;p&gt;The &lt;kbd&gt;C-c C-c&lt;/kbd&gt; behaviour on checklists is hard-coded deep inside &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt; in file org.el. This is independent from &lt;code&gt;org-toggle-checkbox&lt;/code&gt; in file org-list.el. So you'll probably have to modify &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that both functions end by calling &lt;code&gt;org-update-checkbox-count-maybe&lt;/code&gt;, so you could try advising that function instead. But beware that this last function is also called elsewhere.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-10-09T18:30:06.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17264" PostTypeId="2" ParentId="17259" CreationDate="2015-10-09T20:59:28.987" Score="2" Body="&lt;p&gt;The &lt;code&gt;org-journal-new-entry&lt;/code&gt; function has an obligatory and an optional argument. The first (and mandatory) argument tells the function whether or not to add a new entry, if there is already a journal file for this day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second (and optional) argument takes a value for inserting a specific time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If called interactively, the value of the mandatory argument is given as prefix argument. If not called interactively, the value of the obligatory argument should be &lt;code&gt;nil&lt;/code&gt; to be equivalent to be called without a prefix argument. Any &lt;code&gt;non-nil&lt;/code&gt; value is equivalent to called interactively with a prefix argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optional argument isn't necessary here, since it wasn't ask to insert a divergent time value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Deleting-Windows.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;delete-other-window&lt;/code&gt;&lt;/a&gt; helps to have the journal being the only window.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org-journal)&#xA;(org-journal-new-entry nil)&#xA;(delete-other-windows)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9755" LastEditorUserId="9755" LastEditDate="2015-10-13T02:10:24.660" LastActivityDate="2015-10-13T02:10:24.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17265" PostTypeId="1" AcceptedAnswerId="17286" CreationDate="2015-10-09T22:20:14.013" Score="3" ViewCount="3622" Body="&lt;p&gt;I am performing Nodejs development in emacs, but my environment seems incorrect. For example, when I run &lt;code&gt;ac-js2-jump-to-definition&lt;/code&gt;, I get &quot;no jump location found&quot; in the minibuffer. Also when I run 'tern-find-definition`, I get &quot;No definition found.&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I correctly jump to a Javascript definition in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample of code, where I am using the &quot;jump-to-definition&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In auth.js, I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;module.exports = function (options) {&#xA;  options = options || {}&#xA;  auth = {}&#xA;&#xA;  auth.someFunction = function () {&#xA;    return &quot;someFunction has been called&quot;&#xA;  }&#xA;&#xA;  return auth&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I call &lt;code&gt;auth&lt;/code&gt; from here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var auth = require('auth')()&#xA;auth.someFunction()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it does not work when I put the point over &lt;code&gt;someFunction()&lt;/code&gt; above and run &lt;code&gt;M-x ac-js2-jump-to-definition&lt;/code&gt; or &lt;code&gt;tern-find-definition&lt;/code&gt;. Also, when I run &lt;code&gt;js2-next-error&lt;/code&gt;, the &lt;code&gt;require&lt;/code&gt; function in &lt;code&gt;require('auth')()&lt;/code&gt; above is selected and gives the message &quot;Undeclared variable or function 'require'&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that my Javascript environment is incorrect, but I don't know what it is. Any suggestions would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my relevant configuration from my init script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; JAVASCRIPT-MODE&#xA;&#xA;;; js2-mode provides 4 level of syntax highlighting. They are * 0 or a negative value means none. * 1 adds basic syntax highlighting. * 2 adds highlighting of some Ecma built-in properties. * 3 adds highlighting of many Ecma built-in functions.&#xA;(setq js2-highlight-level 3)&#xA;&#xA;(add-hook 'js2-mode-hook&#xA;          (lambda ()&#xA;&#xA;            ;; allow window resizing via M-l and M-h&#xA;            (local-unset-key (kbd &quot;M-l&quot;))&#xA;            (local-unset-key (kbd &quot;M-h&quot;))&#xA;            (local-unset-key (kbd &quot;M-j&quot;))&#xA;&#xA;            (local-set-key (kbd &quot;C-j&quot;) 'ac-js2-jump-to-definition)&#xA;            (local-set-key (kbd &quot;C-c C-n&quot;) 'js2-next-error)&#xA;            (define-key js2-mode-map (kbd &quot;C-j&quot;) 'ac-js2-jump-to-definition)&#xA;            (linum-mode)&#xA;            (js2-reparse t)&#xA;            (ac-js2-mode)))&#xA;&#xA;(add-to-list 'interpreter-mode-alist '(&quot;node&quot; . js2-mode))&#xA;&#xA;(add-to-list 'auto-mode-alist&#xA;      '(&quot;\\.js$&quot; . js2-mode))&#xA;&#xA;(require 'js2-refactor)&#xA;(js2r-add-keybindings-with-prefix &quot;C-c C-m&quot;)&#xA;(add-hook 'js2-mode-hook #'js2-refactor-mode)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/tern/emacs/&quot;)&#xA;(autoload 'tern-mode &quot;tern.el&quot; nil t)&#xA;(add-hook 'js-mode-hook (lambda () (tern-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-10-10T04:19:25.583" LastActivityDate="2015-10-11T01:49:28.333" Title="Cannot jump to definition in js2-mode or Tern" Tags="|javascript|js2-mode|ide|tern|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17266" PostTypeId="1" AcceptedAnswerId="17271" CreationDate="2015-10-09T22:28:09.177" Score="7" ViewCount="1632" Body="&lt;p&gt;When editing Markdown files (.md, .mdwn, etc.) and Mediawiki files (.mw), I almost always need to have flyspell-mode loaded.  How to have that automatically happen via configuration?&lt;/p&gt;&#xA;" OwnerUserId="936" LastActivityDate="2017-06-11T14:17:27.870" Title="How to automatically load flyspell-mode when Markdown (.md, .mdwn) file is open?" Tags="|init-file|flyspell|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17267" PostTypeId="2" ParentId="14535" CreationDate="2015-10-09T22:38:33.993" Score="6" Body="&lt;p&gt;You'll need to set &lt;code&gt;org-outline-path-complete-in-steps&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. This makes &lt;code&gt;org-refile&lt;/code&gt; generate all possible paths when choosing where to refile to, rather than only the top level.&lt;/p&gt;&#xA;" OwnerUserId="9786" LastActivityDate="2015-10-09T22:38:33.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17268" PostTypeId="1" AcceptedAnswerId="17272" CreationDate="2015-10-09T23:08:47.637" Score="1" ViewCount="49" Body="&lt;p&gt;I am hoping to define an interactive function that I can invoke with &lt;code&gt;M-x &amp;lt;function-name&amp;gt;&lt;/code&gt; and that will:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Automatically grab the path to the file &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run the following code on it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;C-x C-f /sudo::/path/to/file&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In case it is not clear, the goal is to have this function (re-)open the file in &lt;code&gt;sudo&lt;/code&gt; mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I go about writing this function? Sorry if this is a bit elementary, I have just started to learn elisp.&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="105" LastEditDate="2017-12-24T16:08:33.013" LastActivityDate="2017-12-24T16:08:33.013" Title="Defining a function that takes as an input the current buffer's path" Tags="|files|functions|interactive|learning|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17269" PostTypeId="1" AcceptedAnswerId="17277" CreationDate="2015-10-09T23:15:33.333" Score="2" ViewCount="667" Body="&lt;p&gt;When you want to do something, you get sometimes a confirmation prompt in the minibuffer, with pressing yes or no to proceed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware that you could change this with typing &lt;kbd&gt;y&lt;/kbd&gt; instead &lt;code&gt;yes&lt;/code&gt; with the following setting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'yes-or-no-p 'y-or-n-p)  ;; Ask for y/n instead of yes/no&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if you could configure this in a way that he will accept &lt;kbd&gt;RET&lt;/kbd&gt; as &lt;code&gt;y&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-10T10:17:44.853" Title="How configure the confirmation minibuffer to use Enter, instead y?" Tags="|minibuffer|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17270" PostTypeId="1" AcceptedAnswerId="17362" CreationDate="2015-10-09T23:22:06.590" Score="17" ViewCount="734" Body="&lt;p&gt;I love &lt;code&gt;undo-tree&lt;/code&gt; (screenshot below). It provides an easy way for navigating through different versions of a file (top window) by letting the user move around the file's history tree in a separate window (bottom window) with simple keys such as &lt;code&gt;n&lt;/code&gt;, &lt;code&gt;p&lt;/code&gt; and &lt;code&gt;C-b&lt;/code&gt; and &lt;code&gt;C-f&lt;/code&gt; to  switch across descendants of the same parent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most notably, &lt;code&gt;undo-tree&lt;/code&gt; updates the buffer holding the file with the corresponding version based on the selection in the tree view, automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, &lt;code&gt;magit&lt;/code&gt; is phenomenal for git, and it would be amazing if it had a similar ability, i.e. letting users navigate a file's &lt;strong&gt;git&lt;/strong&gt; history interactively while simultaneously updating the buffer holding the file automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this at all possible with &lt;code&gt;magit&lt;/code&gt; today?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4vbd9.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4vbd9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2015-10-10T15:23:32.390" LastActivityDate="2015-10-14T01:44:35.773" Title="Combining magit with undo-tree for easy history navigation" Tags="|magit|history|undo-tree-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17271" PostTypeId="2" ParentId="17266" CreationDate="2015-10-09T23:30:48.263" Score="8" Body="&lt;p&gt;Put this in your .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'markdown-mode-hook 'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will enable flyspell-mode whenever markdown-mode is entered; i.e. when you open markdown files.&lt;/p&gt;&#xA;" OwnerUserId="9787" LastActivityDate="2015-10-09T23:30:48.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17272" PostTypeId="2" ParentId="17268" CreationDate="2015-10-09T23:54:53.297" Score="4" Body="&lt;p&gt;Do you want to visit (e.g., create) a file that has the same name as the buffer, even if the buffer is not visiting a file? If so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (file)&#xA;  (interactive&#xA;   (list (expand-file-name (or (buffer-file-name) (buffer-name)))))&#xA;  (require 'tramp)&#xA;  (find-file (concat &quot;/sudo::&quot; file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do you want to raise an error if the current buffer is not visiting a file?&#xA;If so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (file)&#xA;  (interactive&#xA;   (progn (unless (buffer-file-name) (error &quot;Not visiting a file&quot;))&#xA;          (list (expand-file-name (buffer-file-name)))))&#xA;  (require 'tramp)&#xA;  (find-file (concat &quot;/sudo::&quot; file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-09T23:54:53.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17273" PostTypeId="2" ParentId="17266" CreationDate="2015-10-10T05:15:39.353" Score="1" Body="&lt;p&gt;Base on Trebuchette's answer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'markdown-mode-hook 'flyspell-mode)&#xA;(add-hook 'mediawiki-mode-hook 'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But if you want to turn on &lt;code&gt;flyspell-mode&lt;/code&gt; while editing text files in various major-modes, you can just use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'text-mode-hook 'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this will works because &lt;code&gt;markdown-mode&lt;/code&gt; and &lt;code&gt;mediawiki-mode&lt;/code&gt; are base on &lt;code&gt;text-mode&lt;/code&gt;. Analogously, we use &lt;code&gt;prog-mode-hook&lt;/code&gt; to setup common programming environment.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-10T05:15:39.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17274" PostTypeId="1" CreationDate="2015-10-10T06:46:10.327" Score="0" ViewCount="522" Body="&lt;p&gt;I've entered into the fabulous world of Emacs about 2 weeks ago and I like it more and more, but at this point there are some mysterious point that make me freak a little because I don't want to mess up my Emacs.&#xA;It's about the package manager, I've installed auctex and the autocomplete mode for latex and now I want to try it's newest equivalent company.&#xA;So I've installed packages company, company-auctex and company-math but it seems that it's not enabled after installing and it's not the behaviour of the  manager I was waiting for, according to the GNU Emacs page on installing package.&#xA;So have I to add lines (which I am not familiar with yet) in .emacs for each package ?&#xA;Also, what is the &quot;packagename&quot;-autoloads.el file for ?&#xA;I guess it should do what I am asking for but it doesn't on my session, I can say it because when I type   \su like on the company-math Github page there are no completion...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for reading, I've said a lot ! And sorry if my English is not entirely correct.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="8426" LastEditDate="2015-10-11T02:51:54.563" LastActivityDate="2022-08-05T16:01:55.193" Title="Enable emacs package" Tags="|package|completion|company-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17275" PostTypeId="2" ParentId="17252" CreationDate="2015-10-10T08:18:43.290" Score="1" Body="&lt;p&gt;In your &lt;code&gt;bb/next-heading&lt;/code&gt; defun you could use either &lt;code&gt;(when (org-entry-is-done-p) (outline-next-visible-heading 1))&lt;/code&gt; that regards all &lt;code&gt;org-done-keywords&lt;/code&gt; or &lt;code&gt;(when (string= (org-get-todo-state) &amp;quot;DONE&amp;quot;) (outline-next-visible-heading 1))&lt;/code&gt; to be more restrictive.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun bb/next-heading (&amp;amp;optional arg)&#xA;  (when (org-entry-is-done-p) (outline-next-visible-heading 1)))&#xA;(advice-add 'org-todo :after 'bb/next-heading) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="26163" LastEditDate="2022-04-15T16:51:36.203" LastActivityDate="2022-04-15T16:51:36.203" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17276" PostTypeId="2" ParentId="17262" CreationDate="2015-10-10T08:55:28.187" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The problem is that Helm doesn't provide any completion, so every time I should type the whole string, then I need to add &quot;/New node&quot; and press Enter.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I understand correctly, you means when your input pattern includes &quot;/New node&quot;, for example, &quot;lev 2/New node&quot;, this won't work (which is expected), you should use &quot;Top level 2/New node&quot; as your input pattern before &lt;kbd&gt;RET&lt;/kbd&gt;, but you don't have to type &quot;Top level 2&quot; by yourself, just use &lt;kbd&gt;C-c C-y&lt;/kbd&gt; (&lt;code&gt;helm-yank-selection&lt;/code&gt;) to insert current selected candidate to do that for you, for example, for your case, all you need to do is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-c C-w&lt;/kbd&gt; lev 2 &lt;kbd&gt;C-c C-y&lt;/kbd&gt; /New Node &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-10T08:55:28.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17277" PostTypeId="2" ParentId="17269" CreationDate="2015-10-10T10:17:44.853" Score="3" Body="&lt;p&gt;As @phils commented simply redefining the key in &lt;code&gt;query-replace-map&lt;/code&gt; will effect other things as well. The following copies the key-map to avoid that:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun y-or-n-p-with-return (orig-func &amp;amp;rest args)&#xA;  (let ((query-replace-map (copy-keymap query-replace-map)))&#xA;    (define-key query-replace-map (kbd &quot;RET&quot;) 'act)&#xA;    (apply orig-func args)))        &#xA;&#xA;(advice-add 'y-or-n-p :around #'y-or-n-p-with-return)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-10-10T10:17:44.853" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17278" PostTypeId="1" CreationDate="2015-10-10T10:41:24.837" Score="5" ViewCount="769" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I use &lt;code&gt;truncate-lines&lt;/code&gt; in only part of a buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a general rule, I prefer &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Continuation-Lines.html#Continuation-Lines&quot; rel=&quot;noreferrer&quot;&gt;continuation&#xA;lines&lt;/a&gt;&#xA;to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Line-Truncation.html&quot; rel=&quot;noreferrer&quot;&gt;truncating&#xA;lines&lt;/a&gt;.&#xA;However, it would be nice to truncate only certain kinds of lines&#xA;in a given buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an ideal world, I would like to truncate headings in &lt;code&gt;org-mode&lt;/code&gt;&#xA;(and &lt;code&gt;outline-mode&lt;/code&gt; more generally) but not use &lt;code&gt;truncate-lines&lt;/code&gt;&#xA;in the entry bodies.  Is that possible with a minimum of fuss, or&#xA;would it require a major replumbing of the internals?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-01-09T20:34:06.890" Title="Truncate only certain lines and use continuation lines elsewhere?" Tags="|org-mode|display|outline-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17279" PostTypeId="2" ParentId="17278" CreationDate="2015-10-10T11:50:30.740" Score="0" Body="&lt;p&gt;Given that there is no special text property controlling the truncation behaviour of text, I doubt this is possible.  You could however work around by enabling truncation in an Org buffer and hard wrapping text under a heading, that way headings (and overly large tables) would show up as truncated, but the hard-wrapped text wouldn't.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-10T11:50:30.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17280" PostTypeId="1" CreationDate="2015-10-10T15:08:23.887" Score="1" ViewCount="2901" Body="&lt;p&gt;I used to use tmux with vim to write codes in C/C++. So I split the screen into two in tmux and then press F3 to &quot;make&quot; the file. And then I can press F4 to run the &quot;main&quot; file in the next subscreen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I have switched to emacs and am wondering if there is anyway to do the same.&lt;/p&gt;&#xA;" OwnerUserId="9794" LastActivityDate="2016-06-09T16:10:23.790" Title="How to set up hotkey for compiling c code and run the compiled file?" Tags="|c++|c|development|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17281" PostTypeId="2" ParentId="17258" CreationDate="2015-10-10T18:52:30.870" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/17263/8647&quot;&gt;Juancho's assessment&lt;/a&gt; is correct.  As it happens, I've been developing some tools for this kind of surgical advice.  I think this should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-checkbox-toggle-advice (orig-fn &amp;amp;rest args)&#xA;  &quot;Advice to move to next list item on checkbox toggle.&quot;&#xA;  (my/with-advice &#xA;      ((#'org-update-checkbox-count-maybe&#xA;        :after (lambda ()&#xA;                 (ignore-errors (org-next-item)))))&#xA;    (apply orig-fn args)))&#xA;&#xA;(advice-add #'org-ctrl-c-ctrl-c   :around #'my/org-checkbox-toggle-advice)&#xA;(advice-add #'org-toggle-checkbox :around #'my/org-checkbox-toggle-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The hard work here is being done by this macro:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my/with-advice (adlist &amp;amp;rest body)&#xA;  &quot;Execute BODY with temporary advice in ADLIST.&#xA;&#xA;Each element of ADLIST should be a list of the form&#xA;  (SYMBOL WHERE FUNCTION [PROPS])&#xA;suitable for passing to `advice-add'.  The BODY is wrapped in an&#xA;`unwind-protect' form, so the advice will be removed even in the&#xA;event of an error or nonlocal exit.&quot;&#xA;  (declare (debug ((&amp;amp;rest (&amp;amp;rest form)) body))&#xA;           (indent 1))&#xA;  `(progn&#xA;     ,@(mapcar (lambda (adform)&#xA;                 (cons 'advice-add adform))&#xA;               adlist)&#xA;     (unwind-protect (progn ,@body)&#xA;       ,@(mapcar (lambda (adform)&#xA;                   `(advice-remove ,(car adform) ,(nth 2 adform)))&#xA;                 adlist))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-11T16:14:41.983" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17282" PostTypeId="1" AcceptedAnswerId="17290" CreationDate="2015-10-10T20:17:31.300" Score="9" ViewCount="6261" Body="&lt;p&gt;Is there a way to make a logbook-like note without it always being stuck in a &lt;code&gt;:LOGBOOK&lt;/code&gt; drawer? For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [2015-09-02 Wed 18:03] \\&#xA;    * 12.3 Export settings             :om:htmlexport:&#xA;      - Up: Exporting&#xA;      - [[http://orgmode.org/manual/Export-settings.html][Export settings]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I like being able to just stick a timestamped observation anywhere with C-c C-z. Is there any way to turn off the automatic &lt;code&gt;:LOGBOOK&lt;/code&gt; drawer?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2021-03-24T07:51:02.077" Title="org mode logbook note entry without logbook drawer?" Tags="|org-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17283" PostTypeId="1" CreationDate="2015-10-10T20:18:50.487" Score="8" ViewCount="2034" Body="&lt;p&gt;I have a few symbols in &lt;a href=&quot;https://www.emacswiki.org/emacs/PrettySymbol&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;prettify-symbols-alist&lt;/code&gt;&lt;/a&gt; that improve the appearance of elisp code in my configuration file. I am migrating my configuration file from Elisp to Org-mode and I would like to keep the prettified symbols. Is this possible to achieve in Org mode 8.3?&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="12504" LastEditDate="2016-12-31T14:40:56.373" LastActivityDate="2021-09-16T15:20:40.457" Title="Is it possible to get prettified symbols in Org-mode source blocks?" Tags="|org-mode|prettify-symbols-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17284" PostTypeId="1" CreationDate="2015-10-10T20:44:13.960" Score="3" ViewCount="604" Body="&lt;p&gt;I am trying to add the verbatim character &lt;code&gt;~&lt;/code&gt; (tilde) as an electric-pair character in &lt;code&gt;org-mode&lt;/code&gt;. Here is my attempt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org&#xA; (modify-syntax-entry ?/ &quot;(/&quot; org-mode-syntax-table)&#xA; (modify-syntax-entry ?= &quot;(=&quot; org-mode-syntax-table)&#xA; (modify-syntax-entry ?~ &quot;(~&quot; org-mode-syntax-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works for the &lt;code&gt;/&lt;/code&gt; and &lt;code&gt;=&lt;/code&gt; characters, but not for &lt;code&gt;~&lt;/code&gt;. What do I need to do to add &lt;code&gt;~&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-10-14T10:59:55.173" Title="Adding tilde to electric pairs in org mode" Tags="|org-mode|syntax-table|electric-pair-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17285" PostTypeId="1" CreationDate="2015-10-11T00:04:48.530" Score="1" ViewCount="215" Body="&lt;p&gt;Some background, I have some code that sets a default compile command depending on the mode.  However, in some files, I've used the &lt;code&gt;add-file-local-variable-prop-line&lt;/code&gt; to create a more specific command, and this overwrites that.  I need to check if compile-command has been defined for the file, so I don't assign a default value when the file already has a &lt;code&gt;compile-command&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using &lt;code&gt;file-local-variables-alist&lt;/code&gt;, but it's value is nil, even when there are local variables. &lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-10-11T02:06:52.917" Title="How to check if a variable is a file local variable" Tags="|compilation|file-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17286" PostTypeId="2" ParentId="17265" CreationDate="2015-10-11T01:12:03.940" Score="5" Body="&lt;p&gt;Thanks to @Dmitry's comment above, I was able to resolve this issue by configuring the default plugins for Tern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;code&gt;tern&lt;/code&gt; file from the repo under &lt;code&gt;bin/tern&lt;/code&gt;, I edited the default plugins here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var defaultConfig = {&#xA;  libs: [],&#xA;  loadEagerly: false,&#xA;  plugins: {&quot;commonjs&quot;:{}, &quot;node&quot;:{}, &quot;requirejs&quot;:{}, &quot;node_resolve&quot;:{}},&#xA;  ecmaScript: true,&#xA;  ecmaVersion: 6,&#xA;  dependencyBudget: tern.defaultOptions.dependencyBudget&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where I changed the &lt;code&gt;plugins&lt;/code&gt; property from &lt;code&gt;plugins: {},&lt;/code&gt; to &lt;code&gt;plugins: {&quot;commonjs&quot;:{}, &quot;node&quot;:{}, &quot;requirejs&quot;:{}, &quot;node_resolve&quot;:{}},&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;tern-find-definition&lt;/code&gt; is working well! &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Furthermore, for the false-positive &lt;code&gt;require&lt;/code&gt; statement error, I was able to correct this by running &lt;code&gt;M-x customize group RET js2-mode&lt;/code&gt; and enabling &lt;code&gt;Js2 Include Node Externs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-10-11T01:49:28.333" LastActivityDate="2015-10-11T01:49:28.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17287" PostTypeId="1" CreationDate="2015-10-11T01:48:52.817" Score="1" ViewCount="218" Body="&lt;p&gt;I use gnus (by way of gwene.org) to read RSS feeds. However, for the first time I've ever seen, Emacs crashed when trying to open a feed, giving the following dump at the terminal:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;Fatal error 11: Segmentation fault&#xA;Backtrace:&#xA;emacs[0x5032b3]&#xA;emacs[0x4e99be]&#xA;emacs[0x50206e]&#xA;emacs[0x502293]&#xA;/usr/lib/libpthread.so.0(+0x10d60)[0x7f55c97b7d60]&#xA;/usr/lib/libOpenCL.so(+0x1a7c6a)[0x7f55b5be8c6a]&#xA;/usr/lib/libOpenCL.so(clGetDeviceInfo+0x8f0)[0x7f55b5bc4150]&#xA;/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x14c4a9)[0x7f55cb9fa4a9]&#xA;/usr/lib/libMagickCore-6.Q16HDRI.so.2(InitOpenCLEnv+0x7c)[0x7f55cb9fb3ec]&#xA;/usr/lib/libMagickCore-6.Q16HDRI.so.2(+0x445c0)[0x7f55cb8f25c0]&#xA;/usr/lib/libMagickCore-6.Q16HDRI.so.2(AccelerateCompositeImage+0x79)[0x7f55cb901839]&#xA;/usr/lib/libMagickCore-6.Q16HDRI.so.2(CompositeImageChannel+0x2aa)[0x7f55cb94060a]&#xA;/usr/lib/libMagickCore-6.Q16HDRI.so.2(MergeImageLayers+0x1e8)[0x7f55cb9ddbc8]&#xA;/usr/lib/libMagickWand-6.Q16HDRI.so.2(MagickMergeImageLayers+0x4a)[0x7f55cbe286ca]&#xA;emacs[0x5cd29c]&#xA;emacs[0x5d0b11]&#xA;emacs[0x5d0f4e]&#xA;emacs[0x55d18c]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;emacs[0x55cfab]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;emacs[0x55cfab]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;emacs[0x55cfab]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;emacs[0x55cfab]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;emacs[0x55cfab]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;emacs[0x55cfab]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;emacs[0x55cfab]&#xA;emacs[0x5927b3]&#xA;emacs[0x55cc0f]&#xA;...&#xA;Segmentation fault (core dumped)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could possibly be the case here?&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2017-02-07T06:45:29.100" Title="Emacs crashes when trying to read an RSS feed with gnus" Tags="|gnus|crash|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17288" PostTypeId="2" ParentId="17285" CreationDate="2015-10-11T02:06:52.917" Score="2" Body="&lt;p&gt;&lt;em&gt;Where&lt;/em&gt; are you trying to use &lt;code&gt;file-local-variables-alist&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/5147060/how-can-i-access-directory-local-variables-in-my-major-mode-hooks&quot;&gt;If you're using a mode hook, local variables haven't been processed yet.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;hack-local-variables-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-11T02:06:52.917" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17289" PostTypeId="1" AcceptedAnswerId="17291" CreationDate="2015-10-11T02:33:12.820" Score="3" ViewCount="1035" Body="&lt;p&gt;Got line-mode to work as for this: &lt;a href=&quot;https://emacs.stackexchange.com/questions/5690/in-term-mode-how-do-i-run-regular-emacs-commands/5691?noredirect=1#comment25688_5691&quot;&gt;in term-mode, how do I run regular emacs commands?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now how do I make it the default ?&lt;/p&gt;&#xA;" OwnerUserId="9654" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-10-11T03:14:03.873" Title="In term-mode how can I make line-mode the default" Tags="|term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17290" PostTypeId="2" ParentId="17282" CreationDate="2015-10-11T03:02:45.693" Score="15" Body="&lt;p&gt;Where &lt;code&gt;org-add-note&lt;/code&gt; sticks the note is controlled by &lt;code&gt;org-log-into-drawer&lt;/code&gt;.  If it's &lt;code&gt;nil&lt;/code&gt; your notes go into the body instead of the logbook drawer.  If you set &lt;code&gt;org-log-into-drawer&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; you may also want to set &lt;code&gt;org-log-state-notes-insert-after-drawers&lt;/code&gt; which will ensure that the notes go after &lt;code&gt;LOGBOOK&lt;/code&gt;  and &lt;code&gt;PROPERTIES&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been using this bit of advice to let me pick where notes go.  With a &lt;code&gt;C-u&lt;/code&gt; prefix they go in the body, otherwise they go into &lt;code&gt;LOGBOOK&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun with-no-drawer (func &amp;amp;rest args)&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((org-log-into-drawer (not (car args))))&#xA;    (funcall func)))&#xA;&#xA;(advice-add 'org-add-note :around #'with-no-drawer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-10-11T03:02:45.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17291" PostTypeId="2" ParentId="17289" CreationDate="2015-10-11T03:14:03.873" Score="7" Body="&lt;p&gt;Looking at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/term.el#n1364&quot; rel=&quot;noreferrer&quot;&gt;term.el&lt;/a&gt; it seems char mode is enabled right after running &lt;code&gt;term-mode&lt;/code&gt; (and hence &lt;code&gt;term-mode-hook&lt;/code&gt;) as such enabling &lt;code&gt;term-line-mode&lt;/code&gt; in &lt;code&gt;term-mode-hook&lt;/code&gt; would not work. The only option I can think of is advicing the function &lt;code&gt;term&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt;, like so&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-enable-term-line-mode (&amp;amp;rest ignored)&#xA;  (term-line-mode))&#xA;&#xA;(advice-add 'ansi-term :after #'my-enable-term-line-mode)&#xA;(advice-add 'term :after #'my-enable-term-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However you loose all the goodness of &lt;code&gt;term&lt;/code&gt; in line mode, if you are looking for line-mode behaviour I think you will be better served by &lt;code&gt;shell&lt;/code&gt; (&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;shell&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;) or even better &lt;code&gt;eshell&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-10-11T03:14:03.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17292" PostTypeId="2" ParentId="10141" CreationDate="2015-10-11T03:56:36.640" Score="4" Body="&lt;p&gt;So I finished this package: &lt;a href=&quot;https://gitlab.com/emacs-stuff/git-commit-insert-issue&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gitlab.com/emacs-stuff/git-commit-insert-issue&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/MMsIg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MMsIg.png&quot; alt=&quot;fetch the issue in the commit message&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's in MELPA, so to install it: &lt;code&gt;M-x package-install RET git-commit-insert-issue&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gives a minor mode and an interactive function to get issues. Github and Gitlab. Gitlab for private repos also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Thanks for the tips above and the review of melpa maintainers)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(there are good remarks &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3o7mkt/type_fixes_and_find_the_github_issue_in_the_helm/&quot; rel=&quot;nofollow noreferrer&quot;&gt;on reddit&lt;/a&gt; too)&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="739" LastEditDate="2017-03-15T10:16:38.910" LastActivityDate="2017-03-15T10:16:38.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17293" PostTypeId="2" ParentId="14253" CreationDate="2015-10-11T04:08:12.657" Score="1" Body="&lt;p&gt;Below is part of docstring of the user option &lt;code&gt;helm-always-two-windows&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When non--nil helm will use two windows in this frame.&#xA;  That is one window to display ‘helm-buffer’ and one to display&#xA;  ‘helm-current-buffer’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;(setq helm-always-two-windows t)&lt;/code&gt; won't do what you want.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a work-around by using &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow&quot;&gt;shackle&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq helm-display-function #'pop-to-buffer)&#xA;&#xA;(setq shackle-rules '((&quot;\\`\\*helm.*?\\*\\'&quot; :regexp t :align t :ratio 0.46)))&#xA;(shackle-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, the only downside that I know is helm's full-frame won't work anymore, e.g., &lt;code&gt;helm-top&lt;/code&gt; won't use full-frame.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-11T04:08:12.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17294" PostTypeId="1" AcceptedAnswerId="17295" CreationDate="2015-10-11T07:48:03.970" Score="1" ViewCount="315" Body="&lt;p&gt;When I attempt to autoload projectile like so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(autoload 'projectile-global-mode &quot;projectile&quot; &quot; t nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then open Emacs I cannot use &lt;code&gt;projectile-switch-project&lt;/code&gt; (Symbol's function definition is void: projectile-switch-project). However once entering a project and calling one of the other projectile commands I can then call &lt;code&gt;projectile-switch-project&lt;/code&gt; without any problems. From what I can gather from the error message and the behavior of the problem, it seems to me as if &lt;code&gt;projectile-switch-project&lt;/code&gt; isn't autoloaded. This error doesn't occur with any of the commands which further confirms my suspicions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In saying this I am no elisp expert so I would like to see if any of you have experienced this problem and found a way to solve this.&lt;/p&gt;&#xA;" OwnerUserId="8385" LastActivityDate="2015-10-11T09:06:01.797" Title="projectile-switch-project not working with autoload" Tags="|projectile|autoload|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17295" PostTypeId="2" ParentId="17294" CreationDate="2015-10-11T09:06:01.797" Score="0" Body="&lt;p&gt;To autoload the interactive command &lt;code&gt;projectile-switch-project&lt;/code&gt;, use something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(autoload #'projectile-switch-project &quot;projectile&quot; nil :interactive)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the fourth arg INTERACTIVE should be non-nil since you need to call &lt;code&gt;projectile-switch-project&lt;/code&gt; from &lt;kbd&gt;M-x&lt;/kbd&gt; (interactively).&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-11T09:06:01.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17296" PostTypeId="1" AcceptedAnswerId="17297" CreationDate="2015-10-11T10:59:34.337" Score="2" ViewCount="1377" Body="&lt;p&gt;I want to use &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow&quot;&gt;hydra&lt;/a&gt; (in Emacs 24.5.1 on Windows 10) to create a pop-up list of directories that I often use. Selecting one of the directories in the list, using a single key, should cause it to open in Dired. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the plan is that once the hydra menu is active hitting &quot;a&quot; will open in &lt;code&gt;&quot;g:/foo/bar/grob&quot;&lt;/code&gt; and hitting &quot;b&quot; will open &lt;code&gt;&quot;c:/longername/short/utilities/morestuff/utilities&quot;&lt;/code&gt; and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have run into difficulties with something I thought would have been obvious, namely opening a buffer in Dired. My idea was to have the hydra trigger the relevant Dired command, that I assumed would exist and look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dired-read-buffer &quot;c:/emacs&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I can see, there is no such command in the section in the GNU Emacs manual on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-Enter.html#Dired-Enter&quot; rel=&quot;nofollow&quot;&gt;invoking Dired&lt;/a&gt;. There is more than one way to interactively call Dired, but I want something more programmatic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I implement this?&lt;/p&gt;&#xA;" OwnerUserId="8393" LastActivityDate="2015-10-11T11:06:19.727" Title="How to open a given directory in Dired?" Tags="|dired|hydra|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17297" PostTypeId="2" ParentId="17296" CreationDate="2015-10-11T11:06:19.727" Score="6" Body="&lt;p&gt;You can pass the directory name to &lt;code&gt;dired&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defhydra hydra-dired (:exit t)&#xA;  &quot;dired&quot;&#xA;  (&quot;w&quot; (dired &quot;~/Downloads&quot;) &quot;Downloads&quot;)&#xA;  (&quot;d&quot; (dired &quot;~/Documents&quot;) &quot;Documents&quot;))&#xA;(global-set-key (kbd &quot;C-c C-d&quot;) 'hydra-dired/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-10-11T11:06:19.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17300" PostTypeId="1" CreationDate="2015-10-11T15:44:21.093" Score="3" ViewCount="164" Body="&lt;p&gt;My initialization file is organized in &lt;code&gt;org-mode&lt;/code&gt; with src snippets. Is there a way I can profile it to see which snippets take the most time to evaluate? When my initialization file was in Elisp, I was able to profile it with &lt;a href=&quot;http://www.emacswiki.org/emacs/ProfileDotEmacs&quot; rel=&quot;nofollow&quot;&gt;ProfileDotEmacs&lt;/a&gt;, but that doesn't work for me anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how I load the Org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-load-file &quot;path/to/main.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since the snippets are evaluated with Babel, maybe there's a way to tell Babel to output the execution time of each snippet?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-10-11T15:44:21.093" Title="Profiling org-mode init file" Tags="|org-mode|init-file|performance|profiler|benchmarking|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17302" PostTypeId="1" CreationDate="2015-10-11T16:13:53.840" Score="3" ViewCount="517" Body="&lt;p&gt;A lot of times we sleep after 12 o'clock, and some of the tasks that are done before we sleep will be counted as being done in the second day, which causes the repetition schedule to be a bit messed up. This is especially annoying for &lt;code&gt;org-habit&lt;/code&gt;, since it will then say there's a break in the middle of the habit chain and that you've actually done the task for the following day instead, which forces you to manually edit the timestamps in the affected tasks to get the counting right again. In the flashcard app &lt;a href=&quot;http://ankisrs.net&quot; rel=&quot;nofollow&quot;&gt;Anki&lt;/a&gt;, there is an option to treat cards finished certain hours past midnight as still being finished in the last day. I wonder if a similar functionality is available/can be configured in &lt;code&gt;org-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2018-12-16T01:02:35.547" Title="Is there a way to make org-mode count repetitive tasks done certain hours past midnight as done in the previous day?" Tags="|org-mode|org-habit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17303" PostTypeId="2" ParentId="14688" CreationDate="2015-10-11T17:11:04.063" Score="7" Body="&lt;p&gt;After some investigation i figured out a solution.&lt;/p&gt;&#xA;&lt;p&gt;Not sure why I didn't see it before or if table export changed in org-mode at some point.&lt;/p&gt;&#xA;&lt;p&gt;org-mode export tables default as&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;\begin{center}&#xA;\begin{tabular}{lr}&#xA;A &amp;amp; 1\\&#xA;B &amp;amp; 2\\&#xA;\end{tabular}&#xA;\end{center}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;if the caption and/or label is not specified.&#xA;Now a table environment can be added around the tabular environment with a caption and label.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_table&#xA;#+LATEX: \caption{Description of table.}&#xA;#+LATEX: \label{tab:my-table}&#xA;#+LATEX: \adjustbox{max width=\linewidth}{&#xA;#+ATTR_LATEX: :center nil&#xA;| A | 1 |&#xA;| B | 2 |&#xA;#+LATEX: }&#xA;#+end_table&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Notice the &lt;code&gt;attr_latex: :center nil&lt;/code&gt;.&#xA;The adjustbox does not play well with &lt;code&gt;\begin{center}...\end{center}&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The specific command I use here only shrinks the table, however any command can be inserted now.&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="32213" LastEditDate="2021-03-31T09:40:57.483" LastActivityDate="2021-03-31T09:40:57.483" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="17304" PostTypeId="1" CreationDate="2015-10-11T21:07:09.390" Score="2" ViewCount="362" Body="&lt;p&gt;I write my org-mode entries like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Some Event &amp;lt;2015-10-11 Sun 18:30-19:30&amp;gt;&#xA;&#xA;    Some description&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;icalendar export used to automatically use &quot;Some Event&quot; as the icalendar item's SUMMARY, but now (somewhere between versions 7 and 8.2.10) it uses all of &quot;Some Event &amp;lt;2015-10-11 Sun 18:30-19:30&gt;&quot; as the SUMMARY string, which is just wrong (it knows that last part is a date and uses it to create the icalendar .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way I have found to fix this is to create a SUMMARY property, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Some Event &amp;lt;2015-10-11 Sun 18:30-19:30&amp;gt;&#xA;    :PROPERTIES:&#xA;    :SUMMARY:  Some Event&#xA;    :END:&#xA;    Some description&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is, however, awful for maintenance, because now I have to write and/or edit &quot;Some Event&quot; in two places.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have the date automatically excluded from the summary?&lt;/p&gt;&#xA;" OwnerUserId="9807" LastActivityDate="2021-12-27T02:48:39.277" Title="How do I get org icalendar export to *not* include the date in the calendar item summary?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17305" PostTypeId="1" AcceptedAnswerId="17361" CreationDate="2015-10-11T22:03:56.553" Score="1" ViewCount="128" Body="&lt;p&gt;With the variable &lt;code&gt;org-link-search-must-match-exact-headline&lt;/code&gt; you can only choose between various search options but I would like to have the following behaviour:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First try to match against headlines only&lt;/li&gt;&#xA;&lt;li&gt;If the above fails fallback to searching the whole buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there an option for this, or how could I achieve that?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2016-10-08T06:13:35.160" Title="Org link search fallback, if no matching headlines?" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17306" PostTypeId="1" CreationDate="2015-10-12T04:04:25.337" Score="2" ViewCount="95" Body="&lt;p&gt;I want to type everything in lowercase, but have a command to turn the whole buffer into uppercase except for quoted strings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the command to tell emacs to ignore quoted strings? &lt;/p&gt;&#xA;" OwnerUserId="9808" LastEditorUserId="105" LastEditDate="2016-11-12T03:09:57.943" LastActivityDate="2016-11-12T03:09:57.943" Title="Upcase whole buffer but ignore quoted strings" Tags="|text-editing|string|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17309" PostTypeId="1" AcceptedAnswerId="17310" CreationDate="2015-10-12T07:29:43.860" Score="5" ViewCount="443" Body="&lt;p&gt;I'm looking into figuring out if it would be possible to display a random quote on the top of my agenda that changes daily or whenever I check out the &lt;code&gt;agenda&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a Quotes.org file that I capture to with &lt;code&gt;** QUOTE&lt;/code&gt; items.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anything like this be possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Works with the following code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun read-lines (filePath)&#xA;  (with-temp-buffer&#xA;    (insert-file-contents filePath)&#xA;    (split-string (buffer-string) &quot;\n&quot; t)))&#xA;(setq number-quotes (length (read-lines &quot;~/Documents/emacs/myFile.org&quot;)))&#xA;(setq org-agenda-custom-commands&#xA;      '((&quot;c&quot; &quot;Daily Quote &amp;amp; Agenda &amp;amp; TODOs&quot;&#xA;         ((insert (nth (random number-quotes) (read-lines &quot;~/Documents/emacs/myFile.org&quot;)))&#xA;          (agenda &quot;&quot; nil)&#xA;          (alltodo &quot;&quot; nil)&#xA;                  nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9540" LastEditorUserId="9540" LastEditDate="2015-12-26T07:15:51.277" LastActivityDate="2015-12-26T07:15:51.277" Title="Display Random String in Org-Mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17310" PostTypeId="2" ParentId="17309" CreationDate="2015-10-12T10:45:48.570" Score="7" Body="&lt;p&gt;You can define a custom agenda command in &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;, and add a special function to it.  The function should take one argument, a match string (which defaults to the empty string).  It can insert whatever text it wants to with &lt;code&gt;insert&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I tried this custom command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;n&quot; &quot;Agenda and all TODO's&quot;&#xA;         ((my-agenda-spook &quot;&quot; nil)&#xA;          (agenda &quot;&quot; nil)&#xA;          (alltodo &quot;&quot; nil)&#xA;        nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And defined &lt;code&gt;my-agenda-spook&lt;/code&gt; like this, ignoring the match argument:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-agenda-spook (&amp;amp;rest _ignore)&#xA;  (spook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then this appeared at the top of my agenda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Taiwan Security Council First responder FMS white noise Drug war&#xA;analyzer arrangements beanpole bluebird PSAC Afghanistan gorilla ASLET&#xA;Basque Separatists&#xA;&#xA;======================================================================================================================================&#xA;Week-agenda (W42):&#xA;Monday     12 October 2015 W42&#xA;...&#xA;&#xA;======================================================================================================================================&#xA;Global list of TODO items of type: ALL&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;spook&lt;/code&gt; is an ancient Emacs command that aims to feed NSA's keyword scanner.  I just chose it as an example of a function that inserts random strings; you might want to choose a different command for your agenda view.)&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="115" LastEditDate="2015-10-12T19:34:35.570" LastActivityDate="2015-10-12T19:34:35.570" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17312" PostTypeId="2" ParentId="17274" CreationDate="2015-10-12T11:39:38.737" Score="1" Body="&lt;p&gt;This is the bit of configuration I have that works. First, I added the following to my .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; puts my .emacs.d folder in emacs' load path&#xA;     (let ((base &quot;~/Dropbox/.emacs.d&quot;))&#xA;       (add-to-list 'load-path base)&#xA;       (dolist (f (directory-files base))&#xA;         (let ((name (concat base &quot;/&quot; f)))&#xA;           (when (and (file-directory-p name)&#xA;                      (not (equal f &quot;..&quot;))&#xA;                      (not (equal f &quot;.&quot;)))&#xA;             (add-to-list 'load-path name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I set up my package manager to install all new packages in the folder ~/Dropbox/.emacs.d/packages (which is in the load path as it is inside the .emacs.d folder I set up above)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; Package installation - MELPA . Use M-x list-packages&#xA; (require 'package) ;; You might already have this line&#xA; (add-to-list 'package-archives&#xA;              '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA; (when (&amp;lt; emacs-major-version 24)&#xA;;; ;; For important compatibility libraries like cl-lib&#xA;   (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA; (setq package-user-dir &quot;~/Dropbox/.emacs.d/packages&quot;)&#xA; (package-initialize) ;; You might already have this line&#xA; (put 'downcase-region 'disabled nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then all packages you install will go to your .emacs.d/packages folder. Then all you need to do when you install a new package is to look at the packagename.el file and see what is required to get it to work. For example, &lt;a href=&quot;https://github.com/alexeyr/company-auctex/blob/master/company-auctex.el&quot; rel=&quot;nofollow&quot;&gt;company-auctex&lt;/a&gt; (in the company-auctex.el file linked) says in the &quot;preamble&quot; the first bit of information commented out (with ;; before each line):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To use:&lt;br&gt;&#xA;  ;; (require 'company-auctex)&lt;br&gt;&#xA;  ;; (company-auctex-init)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you add those two lines to your .emacs after the two pieces of code above. You need to do this for each package you install. Some packages don't require anything and just work, but others need a few lines to initialise and others you will want to customize as well.&lt;/p&gt;&#xA;" OwnerUserId="9416" LastActivityDate="2015-10-12T11:39:38.737" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17314" PostTypeId="1" AcceptedAnswerId="17315" CreationDate="2015-10-12T12:21:47.173" Score="1" ViewCount="213" Body="&lt;p&gt;I want to focus/highlight part of text(marked or selected in some other way) as shown in the picture(selected texts stays as it was but other text is dimmed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe there is some way or some package to get such effect:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/OwC5w.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OwC5w.jpg&quot; alt=&quot;Highlighted text&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9812" LastEditorUserId="9812" LastEditDate="2015-10-12T15:39:54.980" LastActivityDate="2015-10-12T15:39:54.980" Title="Focus/highlight selected text among other" Tags="|highlighting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17315" PostTypeId="2" ParentId="17314" CreationDate="2015-10-12T13:18:37.520" Score="2" Body="&lt;p&gt;I think &lt;a href=&quot;https://github.com/larstvei/Focus&quot; rel=&quot;nofollow&quot;&gt;Focus&lt;/a&gt; is what you’re looking for.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Focus provides focus-mode that dims the text of surrounding sections,&#xA;  similar to iA Writer's Focus Mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can find it on MELPA, if you have it configured in your init file, via &lt;code&gt;M-x package-install focus&lt;/code&gt;. Once installed, you can enable it with &lt;code&gt;M-x focus-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2015-10-12T13:18:37.520" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17316" PostTypeId="1" AcceptedAnswerId="17412" CreationDate="2015-10-12T14:01:57.367" Score="10" ViewCount="1708" Body="&lt;p&gt;How to kill (C-x k) ediff's (A,B,C) buffers automatically on each &lt;code&gt;ediff-quit&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="9682" LastEditorUserId="306" LastEditDate="2015-10-14T01:57:13.673" LastActivityDate="2018-06-29T10:36:15.123" Title="How to kill ediff's buffers on quit?" Tags="|ediff|" AnswerCount="5" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17317" PostTypeId="2" ParentId="17316" CreationDate="2015-10-12T14:21:07.717" Score="0" Body="&lt;p&gt;You can try this hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (add-hook 'ediff-load-hook&#xA;            (lambda ()&#xA;              (add-hook 'ediff-before-setup-hook&#xA;                        (lambda ()&#xA;                          (setq ediff-before-file (buffer-file-name))&#xA;                          (setq ediff-saved-window-configuration (current-window-configuration))))&#xA;              (let ((restore-window-configuration&#xA;                     (lambda ()&#xA;                       (set-window-configuration ediff-saved-window-configuration))))&#xA;                (add-hook 'ediff-quit-hook restore-window-configuration 'append)&#xA;                (add-hook 'ediff-suspend-hook restore-window-configuration 'append))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="115" LastEditDate="2015-10-12T19:31:27.703" LastActivityDate="2015-10-12T19:31:27.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17318" PostTypeId="1" AcceptedAnswerId="73911" CreationDate="2015-10-12T15:49:17.320" Score="2" ViewCount="155" Body="&lt;p&gt;It's really handy to get stuff calculated in minibuffer using quick-calc (C-x * q) - I especially like that it automatically copies the result into buffer so it's just one C-y away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the questions is - can I get all this goodness via emacsclient? Just printing out the results of calculating some string would be nice but having it in clipboard as well - even better.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2022-10-03T00:56:07.923" Title="quick-calc via emacsclient" Tags="|calc|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17319" PostTypeId="1" CreationDate="2015-10-12T16:27:17.193" Score="4" ViewCount="456" Body="&lt;p&gt;I am editing a dead simple JSON file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;   &quot;foo&quot;: &quot;bar&quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's what I see:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OtClF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OtClF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing a &lt;code&gt;C-h m&lt;/code&gt; I see the following minor modes running alongside JSON mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption                    &#xA;Column-Number File-Name-Shadow Font-Lock Global-Font-Lock                                 &#xA;Global-Hl-Line Global-Linum Js2 Line-Number Linum Mouse-Wheel Openwith                    &#xA;Tool-Bar Tooltip Transient-Mark  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following problem is reported when the cursor is on &lt;code&gt;:&lt;/code&gt; character:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;missing ; before statement&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The entire &lt;code&gt;&quot;bar&quot;&lt;/code&gt; string value is also highlight red.&#xA;Is the problem related to &lt;code&gt;js-lint&lt;/code&gt; running alongside JSON?&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2022-01-09T05:02:09.543" Title="JSON major mode complaining about valid JSON file" Tags="|json|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17320" PostTypeId="1" CreationDate="2015-10-12T18:28:48.767" Score="3" ViewCount="171" Body="&lt;p&gt;I am using &lt;code&gt;auto-complete-mode&lt;/code&gt; with &lt;code&gt;ac-c-headers&lt;/code&gt; and whenever I type &lt;code&gt;std::&lt;/code&gt; There is a long (~30 seconds) pause, presumably while the candidates list is populated.  This happens every time, which suggests that there is no caching to speed things up for the next time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to avoid the pause after every time I type &lt;code&gt;std::&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Using the emacs profiler, I have now discovered that the pretty much all of the time is being spent in the functions &lt;code&gt;semantic-analyze-possible-completions&lt;/code&gt; and &lt;code&gt;semantic-analyze-current-context&lt;/code&gt;. This suggests that the real problem probably lies with semantic.  I have also learned that including anything from the Boost libraries causes a significant increase in the amount of time required for semantic to return possible completions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In case it makes a difference, I am using Emacs 24.5 on Linux)&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2015-10-21T20:18:52.693" LastActivityDate="2019-01-06T11:02:10.477" Title="Long pause after typing `std::` when using semantic with auto-complete" Tags="|auto-complete-mode|semantic-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17321" PostTypeId="1" AcceptedAnswerId="17326" CreationDate="2015-10-12T18:58:10.563" Score="7" ViewCount="1090" Body="&lt;p&gt;Is it possible to disable eager load-time macro expansion in emacs 24.3.1? For debugging purposes, I would like to expand macros lazily on each invocation at run-time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A working non-standard method to obtain lazy macro evaluation is to include a variable dummyVar (undefined at load-time, defined later at run-time), then an error message like &quot;Eager macro-expansion failure: (void-variable dummyVar)&quot; occurs at load-time and the macro is expanded at run-time. I did not find a lisp command to get this behaviour.&lt;/p&gt;&#xA;" OwnerUserId="9813" LastActivityDate="2015-10-14T13:52:19.193" Title="How to disable eager load-time macro expansion in emacs 24.3?" Tags="|elisp|elisp-macros|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17322" PostTypeId="2" ParentId="17316" CreationDate="2015-10-12T19:32:31.300" Score="0" Body="&lt;p&gt;This is what I am using to close the windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ediff-after-quit-hook-internal 'winner-undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="25" LastEditDate="2015-10-13T12:15:40.480" LastActivityDate="2015-10-13T12:15:40.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17323" PostTypeId="1" AcceptedAnswerId="17357" CreationDate="2015-10-12T19:58:47.540" Score="10" ViewCount="3273" Body="&lt;p&gt;Maybe this is weird, but I don't like how much my tags fill up the side of my org-agenda. This is especially true after I use &lt;code&gt;org-agenda-filter-by-tag&lt;/code&gt; to filter down to a specific tag. For example, once I've applied a filter to see only &lt;code&gt;WORK&lt;/code&gt; tasks, I'd like to not have the &lt;code&gt;WORK&lt;/code&gt; tag show in the agenda view. Is there a way to hide the &lt;code&gt;:WORK:&lt;/code&gt; text without hiding items with the &lt;code&gt;WORK&lt;/code&gt; tag?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2022-12-27T15:52:31.157" Title="Org-mode hide tags in agenda" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17324" PostTypeId="1" AcceptedAnswerId="17330" CreationDate="2015-10-12T20:44:03.080" Score="7" ViewCount="827" Body="&lt;p&gt;I'm using &lt;code&gt;show-paren-mode&lt;/code&gt; with expression highlighting, changing the background face to just a shade lighter than the default background. I like it a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that when I have a mark, the background face from the paren expression is overwriting the background face for the marked region so it looks odd and inconsistent, and it's difficult to visually tell what the whole region is, at a glance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to configure the region face to have a higher &quot;priority&quot; than the show-paren-match face?&lt;/p&gt;&#xA;" OwnerUserId="649" LastActivityDate="2015-10-13T07:27:40.170" Title="How to make the region face take priority over the `show-paren-mode` face?" Tags="|faces|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17325" PostTypeId="2" ParentId="17235" CreationDate="2015-10-12T20:50:49.573" Score="2" Body="&lt;p&gt;First of all, Vim and Emacs have different approaches to keymaps.  Keep in mind that the following sentences are merely observations I've made over time, I do neither know how they're actually implemented (yet), nor do I condemn either approach.  They do only serve to explain the expectations of the questioner and how these differ from reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Vim you're allowed to bind nearly any key sequence to a sequence of commands, even if these involve switches between Vim modes or insertion of text.  In case a key sequence is used on its own &lt;em&gt;and&lt;/em&gt; as prefix for other key sequences, Vim utilizes a timeout to decide whether to prefer the shorter key sequence.  This is done in a transparent manner, in fact quite a number of Vim users aren't aware of this feature unless they use it for the insert mode where delays are much more noticable (or customize the respective setting for it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs there is a sharp distinction between standalone keys and prefixes.  A key can be only bound to either of those.  There do exist a number of workarounds for this, including using hackery with timers (see &lt;code&gt;key-chord.el&lt;/code&gt;) and devising commands that can read in extra input on their own.  Evil makes use of the latter and on some occasions of the former as well (see its handling of the escape key).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former approach with &lt;code&gt;key-chord.el&lt;/code&gt; is reasonably popular, but &lt;a href=&quot;https://emacs.stackexchange.com/questions/17212/how-define-a-function-key-in-keychord-key-seq&quot;&gt;was tried by the author already&lt;/a&gt; and disregarded because &lt;code&gt;key-chord.el&lt;/code&gt; simply doesn't support function keys.  Given its implementation and limitations, it's about time for someone else to step up and create a more powerful package... Maybe some other day, I've only toyed around with &lt;a href=&quot;https://github.com/wasamasa/jammer&quot; rel=&quot;nofollow noreferrer&quot;&gt;rate-limiting keys&lt;/a&gt; so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leaves the other approach.  It's not ideal as it doesn't compose (all multiplexing must be defined manually and cannot be properly done by external packages at all), but good enough for customization:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-evil-find-char (arg char)&#xA;  (interactive (list (prefix-numeric-value current-prefix-arg) (read-key)))&#xA;  (cond&#xA;   ((characterp char)&#xA;    (evil-find-char arg char))&#xA;   ((eq char 'f9)&#xA;    (foobar))&#xA;   (t&#xA;    (user-error &quot;Unknown key combination&quot;))))&#xA;&#xA;(define-key evil-motion-state-map (kbd &quot;f&quot;) 'my-evil-find-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-13T07:13:34.780" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17326" PostTypeId="2" ParentId="17321" CreationDate="2015-10-12T22:08:36.963" Score="4" Body="&lt;p&gt;Here's something that does what you want, however, I doubt that that is what you really need.  This doesn't really help debugging, if anything, it makes debugging more complicated:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro lazy-macro (name args &amp;amp;rest body)&#xA;  (declare (indent defun))&#xA;  `(defun ,name ,args&#xA;     (eval '(progn ,@body))))&#xA;&#xA;(lazy-macro lazy-test (foo)&#xA;  (message &quot;%s&quot; foo))&#xA;&#xA;(lazy-test (list 1 2))&#xA;;; &quot;(1 2)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;'(progn ,@body)&lt;/code&gt; will by just a list at run-time, so, if you wanted to, you could inspect it / change it after the function is compiled.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-10-12T22:59:20.743" LastActivityDate="2015-10-12T22:59:20.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17327" PostTypeId="1" AcceptedAnswerId="17538" CreationDate="2015-10-12T22:43:23.203" Score="2" ViewCount="367" Body="&lt;p&gt;Currently my team (non-Emacs users) indent java like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-java prettyprint-override&quot;&gt;&lt;code&gt;public DiskThresholdDecider(Settings settings,&#xA;                            NodeSettingsService nodeSettingsService,&#xA;                            ClusterInfoService infoService,&#xA;                            Client client) {&#xA;    String lowWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK,&#xA;            &quot;85%&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are two different indentation settings for the same c-style offset, for example (&lt;code&gt;|&lt;/code&gt; denotes the cursor):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-java prettyprint-override&quot;&gt;&lt;code&gt;public DiskThresholdDecider(Settings settings,&#xA;                            |NodeSettingsService nodeSettingsService,&#xA;                            ClusterInfoService infoService,&#xA;                            Client client) {&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-s&lt;/code&gt; (c-show-syntactic-information) returns &lt;code&gt;(arglist-cont-nonempty ... ...)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a couple of lines down, on the method invocation, &lt;code&gt;C-c C-s&lt;/code&gt; also returns &lt;code&gt;(arglist-cont-nonempty ... ...)&lt;/code&gt; here:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-java prettyprint-override&quot;&gt;&lt;code&gt;    String lowWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK,&#xA;            |&quot;85%&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my configuration, I have this set up as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst intellij-java-style&#xA;  '((c-basic-offset . 4)&#xA;    (c-comment-only-line-offset . (0 . 0))&#xA;    (c-offsets-alist&#xA;     .&#xA;     ((inline-open . 0)&#xA;      (topmost-intro-cont    . +)&#xA;      (statement-block-intro . +)&#xA;      (knr-argdecl-intro     . +)&#xA;      (substatement-open     . +)&#xA;      (substatement-label    . +)&#xA;      (case-label            . +)&#xA;      (label                 . +)&#xA;      (statement-case-open   . +)&#xA;      (statement-cont        . ++)&#xA;      (arglist-intro         . 0)&#xA;      (arglist-cont-nonempty . ++) ;; &amp;lt;-- the actual setting&#xA;      (arglist-close         . --)&#xA;      (inexpr-class          . 0)&#xA;      (access-label          . 0)&#xA;      (inher-intro           . ++)&#xA;      (inher-cont            . ++)&#xA;      (brace-list-intro      . +)&#xA;      (func-decl-cont        . ++))))&#xA;  &quot;Elasticsearch's Intellij Java Programming Style&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is I need Emacs to treat class constructors as different indentation style than regular method invocations. This is so it will line up lines on the &lt;code&gt;(&lt;/code&gt; only for constructors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a function I can use to set for &lt;code&gt;arglist-cont-nonempty&lt;/code&gt; that will indent this correctly or a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="115" LastEditDate="2015-10-20T20:25:35.117" LastActivityDate="2015-10-20T20:25:35.117" Title="How to have c-offset style correctly detect a Java constructor and change indentation?" Tags="|indentation|java|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17328" PostTypeId="2" ParentId="13360" CreationDate="2015-10-12T23:01:19.783" Score="6" Body="&lt;p&gt;This seems to do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my/org-habit-show-graphs-everywhere nil&#xA;  &quot;If non-nil, show habit graphs in all types of agenda buffers.&#xA;&#xA;Normally, habits display consistency graphs only in&#xA;\&quot;agenda\&quot;-type agenda buffers, not in other types of agenda&#xA;buffers.  Set this variable to any non-nil variable to show&#xA;consistency graphs in all Org mode agendas.&quot;)&#xA;&#xA;(defun my/org-agenda-mark-habits ()&#xA;  &quot;Mark all habits in current agenda for graph display.&#xA;&#xA;This function enforces `my/org-habit-show-graphs-everywhere' by&#xA;marking all habits in the current agenda as such.  When run just&#xA;before `org-agenda-finalize' (such as by advice; unfortunately,&#xA;`org-agenda-finalize-hook' is run too late), this has the effect&#xA;of displaying consistency graphs for these habits.&#xA;&#xA;When `my/org-habit-show-graphs-everywhere' is nil, this function&#xA;has no effect.&quot;&#xA;  (when (and my/org-habit-show-graphs-everywhere&#xA;         (not (get-text-property (point) 'org-series)))&#xA;    (let ((cursor (point))&#xA;          item data) &#xA;      (while (setq cursor (next-single-property-change cursor 'org-marker))&#xA;        (setq item (get-text-property cursor 'org-marker))&#xA;        (when (and item (org-is-habit-p item)) &#xA;          (with-current-buffer (marker-buffer item)&#xA;            (setq data (org-habit-parse-todo item))) &#xA;          (put-text-property cursor&#xA;                             (next-single-property-change cursor 'org-marker)&#xA;                             'org-habit-p data))))))&#xA;&#xA;(advice-add #'org-agenda-finalize :before #'my/org-agenda-mark-habits)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To explain further, it appears that every agenda function calls&#xA;&lt;code&gt;org-agenda-finalize&lt;/code&gt; once the agenda buffer has been mostly&#xA;constructed, and this is the function which adds the habit graphs.&#xA;Moreover, it just adds the graph to every item which has the&#xA;&lt;code&gt;org-habit-p&lt;/code&gt; text property (which encodes the details the graph will&#xA;display).  So all we need to do is go through and tag the habits with&#xA;this information at some point prior to that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I chose to make this behavior depend on a variable because this&#xA;should allow you to set the variable in custom agenda commands, if you&#xA;want only some agendas to display habits.  I haven't tested that, but&#xA;there's no reason it shouldn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: My original solution had problems with block agendas.  It turns out that &lt;code&gt;org-agenda-finalize&lt;/code&gt; is called once for each block, and then once for the agenda as a whole.  When that final call happens, the agenda is read-only, so an error gets thrown if the agenda contains any habits.  Since all the work has already been done by that point, it makes no sense to scan the agenda again anyway, and I just added a check for the 'org-series property, which is added to the whole agenda after the per-block calls and before the final read-only call.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2015-10-13T17:48:07.563" LastActivityDate="2015-10-13T17:48:07.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17329" PostTypeId="2" ParentId="17321" CreationDate="2015-10-12T23:46:04.973" Score="5" Body="&lt;p&gt;Looking at the code (specifically the &lt;code&gt;readevalloop&lt;/code&gt; function in &lt;code&gt;lread.c&lt;/code&gt;) shows that the following prevents eager macroexpansion from being attempted:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(fmakunbound 'internal-macroexpand-for-load)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However it turns out that you can't actually put that in a library which causes other libraries to be loaded, as it makes the function unbound at a point &lt;em&gt;after&lt;/em&gt; it has been established to exist, and consequently Emacs attempts to call it later on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Zacharias' solution to this is to not unbind the function, but replace it with something which is effectively a no-op for this particular case: A function which returns the same form it is given, unmodified (i.e. something which Emacs thinks will perform macroexpansion, but which does no such thing).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun internal-macroexpand-for-load (form) form)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can disable eager macroexpansion within a temporary local scope as follows; which means you can keep it enabled in general (for the usual performance benefits), but perform individual library loads (or any other evaluations) without eager expansion for the specific things you're interested in:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;(cl-letf (((symbol-function 'internal-macroexpand-for-load) nil))&#xA;  (fmakunbound 'internal-macroexpand-for-load)&#xA;  (load &quot;YOUR-LIBRARY.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Obviously you need to be specific about &lt;code&gt;.el&lt;/code&gt; in this scenario.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. this one &lt;em&gt;does&lt;/em&gt; seem to work fine in general with that &lt;code&gt;fmakunbound&lt;/code&gt; call (and relatedly, while 24.3 complained if that call was absent, Emacs 24.5 was seemingly happy to equate a &lt;code&gt;symbol-function&lt;/code&gt; of &lt;code&gt;nil&lt;/code&gt; with an unbound function, and appeared to work as desired with no &lt;code&gt;fmakunbound&lt;/code&gt; call in the &lt;code&gt;cl-letf&lt;/code&gt; body).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You could, of course, use a function which returns its argument in this &lt;code&gt;cl-letf&lt;/code&gt; version as well. I think the code above is fine as-is, but if you ever encountered an issue with it, that would be a sensible alternative to try.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-10-14T09:50:47.043" LastActivityDate="2015-10-14T09:50:47.043" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17330" PostTypeId="2" ParentId="17324" CreationDate="2015-10-13T02:29:13.760" Score="12" Body="&lt;p&gt;Customize option &lt;code&gt;show-paren-priority&lt;/code&gt; to have a negative value, e.g., &lt;strong&gt;-50&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No, this is not documented anywhere.  Yes, a bug was filed about that.  No, the bug report was never responded to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Emacs bugs #&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20253&quot;&gt;20253&lt;/a&gt;, #&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15899&quot;&gt;15899&lt;/a&gt;, and #&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16192&quot;&gt;16192&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-13T02:29:13.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17331" PostTypeId="2" ParentId="12122" CreationDate="2015-10-13T04:51:16.407" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/rolandwalker/simpleclip&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rolandwalker/simpleclip&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it cover ALL the use cases on Mac/Linux/Windows/Cygwin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, for copy&amp;amp;paste, there are only two commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;simpleclip-get-contents&#xA;simpleclip-set-contents&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Feel free to assign short keys.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-10-13T04:51:16.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17332" PostTypeId="2" ParentId="17306" CreationDate="2015-10-13T04:56:57.850" Score="2" Body="&#xA;&lt;p&gt;Major modes have a syntax table that can define how strings are delimited. Is it a smart or a dumb idea to leverage that? Let's assume smart....&lt;/p&gt;&#xA;&lt;p&gt;Although I'm not confident of the code quality, here is a command that will work even in a major mode (like &lt;code&gt;text-mode&lt;/code&gt;) that doesn't define strings in its syntax table. The command will temporarily change the mode's syntax table to say that single and double quotes are string delimiters. If the major mode does define additional string delimiters, it will use those, too.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/upcase-non-strings ()&#xA;  &amp;quot;Uppercase all except strings.&#xA;&#xA;Ignores both single- and double-quoted strings. If the buffer's&#xA;current major mode defines other things to be strings, they will&#xA;be ignored, too.&amp;quot;&#xA;  (interactive)&#xA;  (let* ((old-syntax-table (syntax-table))&#xA;         (new-syntax-table (make-syntax-table old-syntax-table)))&#xA;    (modify-syntax-entry ?\&amp;quot; &amp;quot;\&amp;quot;   &amp;quot; new-syntax-table)&#xA;    (modify-syntax-entry ?\' &amp;quot;\&amp;quot;   &amp;quot; new-syntax-table)&#xA;    (with-syntax-table new-syntax-table&#xA;      (save-excursion&#xA;        (goto-char (point-min))&#xA;        (while (&amp;lt; (point) (point-max))&#xA;          (while (and (&amp;lt; (point) (point-max))&#xA;                      (nth 3 (syntax-ppss (point)))) ;in string&#xA;            (goto-char (1+ (point))))&#xA;          (let ((start (point)))&#xA;            (while (and (&amp;lt; (point) (point-max))&#xA;                        (not (nth 3 (syntax-ppss (point))))) ;not in string&#xA;              (goto-char (1+ (point))))&#xA;            (upcase-region start (point))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Why my caveat about code quality? Calling &lt;code&gt;syntax-ppss&lt;/code&gt; repeatedly on every character feels like it might be bad. Possibly there's a way to use &lt;code&gt;parse-partial-sexp&lt;/code&gt;, more efficiently, but I didn't immediately see how. I'm still going to look at that, but meanwhile I wanted to post this answer in case it was &amp;quot;good enough&amp;quot; for your purposes.&lt;/p&gt;&#xA;&lt;p&gt;Note: Although you could use &lt;code&gt;in-string-p&lt;/code&gt;, that seems to be deprecated starting in Emacs 25.1, with a message saying to use &lt;code&gt;(nth 3 (syntax-ppss pos))&lt;/code&gt; instead. So above, I did.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&lt;p&gt;I spent more time on this and figured out how to use &lt;code&gt;parse-partial-sexp&lt;/code&gt;. Although I don't know how much more efficient this is, it's certainly more concise:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/upcase-non-strings ()&#xA;  &amp;quot;Uppercase all except strings.&#xA;&#xA;Ignores both single- and double-quoted strings. If the buffer's&#xA;current major mode defines other things to be strings -- or&#xA;comments! -- they will be ignored, too.&amp;quot;&#xA;  (interactive)&#xA;  (let* ((old-syntax-table (syntax-table))&#xA;         (new-syntax-table (make-syntax-table old-syntax-table)))&#xA;    (modify-syntax-entry ?\&amp;quot; &amp;quot;\&amp;quot;   &amp;quot; new-syntax-table)&#xA;    (modify-syntax-entry ?\' &amp;quot;\&amp;quot;   &amp;quot; new-syntax-table)&#xA;    (with-syntax-table new-syntax-table&#xA;      (save-excursion&#xA;        (goto-char (point-min))&#xA;        (while (&amp;lt; (point) (point-max))&#xA;          (let ((beg (point)))&#xA;            ;; Supplying 'syntax-table for the optional STOP-COMMENT&#xA;            ;; arg causes the parse to stop at the beginning or end&#xA;            ;; of a comment or string.&#xA;            (parse-partial-sexp (point) (point-max) nil nil nil 'syntax-table)&#xA;            (upcase-region beg (point))&#xA;            (parse-partial-sexp (point) (point-max) nil nil nil 'syntax-table)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="849" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-13T15:37:14.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17333" PostTypeId="1" CreationDate="2015-10-13T07:16:34.550" Score="2" ViewCount="4067" Body="&lt;p&gt;in my &lt;code&gt;init.el&lt;/code&gt; file I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-linum-mode 1)&#xA;(add-hook 'term-mode-hook (lambda () (linum-mode))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I enter &lt;code&gt;ansi-term-mode&lt;/code&gt; linum mode is still on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ansi-term-mode-hook (lambda () (linum-mode))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'term-mode-hook (lambda () (linum-mode nil))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any idea how to turn off linum mode for ansi-term-mode only?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2023-01-10T09:06:11.617" Title="How to disable global Linum mode for certain mode?" Tags="|init-file|hooks|linum-mode|term|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17334" PostTypeId="2" ParentId="17333" CreationDate="2015-10-13T07:27:12.560" Score="1" Body="&lt;p&gt;Refer to the duplicate question on StackOverflow: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/6837511/automatically-disable-a-global-minor-mode-for-a-specific-major-mode&quot;&gt;automatically disable a global minor mode for a specific major mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This was converted to a comment when it's a perfectly sensible answer (seeing as how we can't close for duplication across SE sites), so this text is just to prevent that from happening...&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-13T07:27:12.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17335" PostTypeId="2" ParentId="17324" CreationDate="2015-10-13T07:27:40.170" Score="2" Body="&lt;p&gt;As I haven't found a reliable and documented way of altering the respective overlay priorities involved without introducing unwanted visual glitches, I've resorted to advising &lt;code&gt;show-paren-function&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice show-paren-function (around inhibit-in-region activate)&#xA;  (if (region-active-p)&#xA;      (progn&#xA;        (delete-overlay show-paren--overlay)&#xA;        (delete-overlay show-paren--overlay-1))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This merely disables any highlighting if the region happens to be active.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-13T07:27:40.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17336" PostTypeId="1" AcceptedAnswerId="17340" CreationDate="2015-10-13T09:01:00.160" Score="0" ViewCount="685" Body="&lt;p&gt;For:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-w3m-view-url ()&#xA;  (interactive)&#xA;  (browse-url (w3m-anchor)))&#xA;(eval-after-load 'w3m&#xA;  (define-key w3m-minor-mode-map (kbd &quot;RET&quot;) #'my-w3m-view-url))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when byte-compiled I get error on key binding &lt;code&gt;RET&lt;/code&gt; usage:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;my-w3m-view-url: Invalid function: w3m-anchor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This because &lt;code&gt;w3m-anchor&lt;/code&gt; isn't a function but become macro. I try to add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'w3m-util nil :no-error))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before lines that uses &lt;code&gt;w3m-anchor&lt;/code&gt;. But this doesn't help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I load &lt;code&gt;.emacs-my.elc&lt;/code&gt; file made by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q --batch --eval='(byte-compile-file &quot;~/.emacs.d/.emacs-my&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; As suggest @Iqbal Ansari I further debug issue. For some reason byte compiled file have function call instead of expanded macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ strings .emacs-my.elc | grep w3m-anchor&#xA;840:(defalias 'my-w3m-view-url #[nil &quot;\300\301 !\207&quot; [browse-url w3m-anchor] 2 nil nil])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Full &lt;code&gt;.emacs-my&lt;/code&gt; file source code is available at &lt;a href=&quot;https://sourceforge.net/u/gavenkoa/dot-emacs/ci/default/tree/.emacs-my&quot; rel=&quot;nofollow&quot;&gt;https://sourceforge.net/u/gavenkoa/dot-emacs/ci/default/tree/.emacs-my&lt;/a&gt; Corresponding installation steps are available at &lt;a href=&quot;https://sourceforge.net/u/gavenkoa/dot-emacs/ci/default/tree/Makefile&quot; rel=&quot;nofollow&quot;&gt;https://sourceforge.net/u/gavenkoa/dot-emacs/ci/default/tree/Makefile&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2015-10-13T09:36:33.527" LastActivityDate="2015-11-12T11:18:46.450" Title="Fix for &quot;Invalid function:&quot; error when external function become a macro" Tags="|elisp-macros|byte-compilation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17337" PostTypeId="1" AcceptedAnswerId="18127" CreationDate="2015-10-13T09:03:33.123" Score="0" ViewCount="100" Body="&lt;p&gt;In order to summarise my work for certain projects I use Org's clock tables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN: clocktable :maxlevel 2 :scope agenda-with-archives :block 2015-Q1 :tags &quot;ProjectA&quot;  :fileskip0&#xA; #+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This summarises the time spent in the first quarter of 2015. However, today I tried to do this for Q3 and it seems to (partially) fail. as you can see below it Org lists the entries of Q4:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 2 :scope agenda-with-archives :block 2015-Q3 :tags &quot;ProjectA&quot;  :fileskip0&#xA;#+CAPTION: Clock summary at [2015-10-13 di 10:51], for 4th quarter of 2015.&#xA;| File               | Headline             |   Time |      |&#xA;|--------------------+----------------------+--------+------|&#xA;|                    | ALL *Total time*     | *2:08* |      |&#xA;|--------------------+----------------------+--------+------|&#xA;| todo.org           | *File time*          | *1:34* |      |&#xA;|                    | Programming          |   0:36 |      |&#xA;|                    | \_  support forum    |        | 0:36 |&#xA;|                    | Courses              |   0:58 |      |&#xA;|                    | \_  school 2016      |        | 0:58 |&#xA;|--------------------+----------------------+--------+------|&#xA;| todo_ProjectA.org  | *File time*          | *0:34* |      |&#xA;|                    | Financial            |   0:21 |      |&#xA;|                    | \_  Progress reports |        | 0:21 |&#xA;|                    | WP4                  |   0:13 |      |&#xA;|                    | \_  User support     |        | 0:13 |&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Changing Q3 to Q2 or Q1 gives the same result. It looks like the calculation of quarters is broken.&#xA;I guess this may have to do with my upgrading Org-mode to 8.3 about a month ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did anyone experience this too or is it something with my setup? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[edit] I upgraded to org 20151005 from the package repo and the problem persists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[edit 2] Using Org 8.2.10 I get the correct result, so this indeed seems to be a bug.&lt;/p&gt;&#xA;" OwnerUserId="421" LastEditorUserId="421" LastEditDate="2015-10-14T19:47:51.283" LastActivityDate="2015-11-16T15:32:59.920" Title="Org clock quarterly report doesn't work anymore" Tags="|org-mode|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17338" PostTypeId="1" AcceptedAnswerId="17353" CreationDate="2015-10-13T09:10:58.537" Score="3" ViewCount="372" Body="&lt;p&gt;I wanted to add &lt;code&gt;~/.emacs.d/custom-info/&lt;/code&gt; to Info directories, where I’d link some locally installed programs’ documentation (like AsynK.io).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'Info-default-directory-list&#xA;  (expand-file-name &quot;./custom-info/&quot; user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The directory is added, as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Info-default-directory-list&#xA;(&quot;/home/m/.emacs.d/custom-info/&quot; &quot;/usr/share/info/&quot; &quot;/usr/share/info/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, there’s no AsynK entry in &lt;code&gt;C-h i&lt;/code&gt;, while:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% cat ~/.emacs.d/custom-info/asynk.info| grep -A2 'START-INFO-DIR-ENTRY'&#xA;START-INFO-DIR-ENTRY&#xA;* ASynk: (asynk).               Contacts synchronization.&#xA;END-INFO-DIR-ENTRY&#xA;%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="9817" LastActivityDate="2015-10-13T16:12:38.893" Title="Adding a custom directory to Info" Tags="|init-file|info|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17339" PostTypeId="2" ParentId="13314" CreationDate="2015-10-13T09:35:12.700" Score="0" Body="&lt;p&gt;[I don't have enough rep to comment]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Installing CLISP and poppler helped me - It didn't work at all before that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After having these installed (and restarting my machine), I managed to get install successfully (hooray!) - however only with a mixture of terminal and emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;nofollow&quot;&gt;instructions&lt;/a&gt; You can complete both stages (the compilation and the installation) either via the terminal or within Emacs...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had to specifically do the compilation in the terminal (to create the &lt;code&gt;pdf-tools-${VERSION}.tar&lt;/code&gt; file), but the installation then had to be done in Emacs i.e. using &lt;code&gt;M-x package-install-file RET pdf-tools-${VERSION}.tar RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not know how the two processes differ, but maybe this helps somebody else out.&lt;/p&gt;&#xA;" OwnerUserId="9558" LastActivityDate="2015-10-13T09:35:12.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17340" PostTypeId="2" ParentId="17336" CreationDate="2015-10-13T10:26:40.457" Score="0" Body="&lt;p&gt;Hm..., my error come from many parts after adaptation of install architecture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I introduce byte-compilation for speed reason, that effect macro expansion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I used &lt;code&gt;-Q&lt;/code&gt; option (to make compilation faster), which prevents built normal &lt;code&gt;load-path&lt;/code&gt; value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;(require 'w3m-util nil :no-error)&lt;/code&gt; style allow byte-compilation ever some packages doesn't preset at compile time. Changing code to &lt;code&gt;(require 'w3m-util)&lt;/code&gt; has shown me where I am wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as solution I strip &lt;code&gt;-Q&lt;/code&gt; from Emacs invocation during byte-compilation.&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2015-10-13T10:26:40.457" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17341" PostTypeId="2" ParentId="17284" CreationDate="2015-10-13T11:28:29.287" Score="5" Body="&lt;p&gt;The syntax of &lt;code&gt;~&lt;/code&gt; is changed by &lt;code&gt;org-mode&lt;/code&gt; itself: as part of the definition of the mode, the file &lt;code&gt;org.el&lt;/code&gt; contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?~ &quot;_&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;inside &lt;code&gt;(define-derived-mode org-mode...)&lt;/code&gt;.&#xA;Since the command &lt;code&gt;org-mode&lt;/code&gt; is not necessarily run at the time the file is loaded, you need to put your modification in to &lt;code&gt;org-mode-hook&lt;/code&gt; instead, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda ()  (modify-syntax-entry ?~ &quot;$~&quot; org-mode-syntax-table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so this run after the built-in syntax entry.  Your other definitions work, because &lt;code&gt;org&lt;/code&gt; does not set the syntax for the those characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, as &lt;code&gt;~&lt;/code&gt; is meant to match with itself, you should use the syntax class &lt;code&gt;$&lt;/code&gt; rather than &lt;code&gt;(&lt;/code&gt;.  The syntax class &lt;code&gt;(&lt;/code&gt; indicates that the given character is paired with a &lt;em&gt;different&lt;/em&gt; symbol.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-10-14T10:59:55.173" LastActivityDate="2015-10-14T10:59:55.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17342" PostTypeId="5" CreationDate="2015-10-13T11:40:55.337" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-10-13T11:40:55.337" LastActivityDate="2015-10-13T11:40:55.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17343" PostTypeId="4" CreationDate="2015-10-13T11:40:55.337" Score="0" Body="A set of dynamic variables that can affect the running processes." OwnerUserId="8431" LastEditorUserId="8431" LastEditDate="2015-10-14T18:56:28.863" LastActivityDate="2015-10-14T18:56:28.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17344" PostTypeId="1" AcceptedAnswerId="17345" CreationDate="2015-10-13T11:43:23.543" Score="0" ViewCount="233" Body="&lt;p&gt;In &lt;a href=&quot;https://emacs.stackexchange.com/questions/12803/can-emacs-close-open-latex-tags-automatically&quot;&gt;LaTeX-mode&lt;/a&gt;, there is &lt;code&gt;latex-close-block&lt;/code&gt;, bound to &lt;kbd&gt;C-c C-e&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a function to programmatically close an XML tag in nXML-mode?&lt;/p&gt;&#xA;" OwnerUserId="8431" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-13T11:43:23.543" Title="Keybinding/Function to Close Xml Tag" Tags="|nxml|xml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17345" PostTypeId="2" ParentId="17344" CreationDate="2015-10-13T11:43:23.543" Score="3" Body="&lt;p&gt;You can close an XML block in nXML-mode via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c /&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To find such functions, have a look at the mode's description, accessible via &lt;kbd&gt;C-h m&lt;/kbd&gt; when in nXML-mode. It says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;kbd&gt;C-c /&lt;/kbd&gt; finishes the current element by inserting an end-tag.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8431" LastActivityDate="2015-10-13T11:43:23.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17346" PostTypeId="1" AcceptedAnswerId="17349" CreationDate="2015-10-13T12:47:31.740" Score="5" ViewCount="859" Body="&lt;p&gt;&lt;code&gt;man emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--script file&#xA;    Run file as an Emacs Lisp script.&#xA;-l file, --load file&#xA;    Load the lisp code in the file file.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that &lt;code&gt;--load&lt;/code&gt; uses usual convention to boot from compiled file version firstly and &lt;code&gt;--script&lt;/code&gt; does not. But I am unsure...&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2015-10-13T15:28:23.973" Title="What is the difference between --load vs --script options?" Tags="|command-line-arguments|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17347" PostTypeId="1" AcceptedAnswerId="17350" CreationDate="2015-10-13T12:49:21.067" Score="9" ViewCount="3929" Body="&lt;p&gt;Common idiom to workaround macro expansion or resolve warning about undefined variables during byte-compilation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'cl-lib))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this &lt;code&gt;require ...&lt;/code&gt; compiled into &lt;code&gt;.elc&lt;/code&gt; file! I found that &lt;code&gt;cl-eval-when&lt;/code&gt; have proper semantic (according to name).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally we don't need for &lt;code&gt;require&lt;/code&gt; as site file and &lt;code&gt;package.el&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I want to byte-compile my &lt;code&gt;.emacs&lt;/code&gt; which uses some external macros, but silently pass through if there are no such package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-eval-when 'compile&#xA;  (condition-case err&#xA;      (require 'w3m-util)&#xA;    (error (byte-compile-warn &quot;Failed by: %S&quot; err))))&#xA;(w3m-util-DEPENDENT-CODE ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another way to do this is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ignore-error&#xA;   (require 'w3m-util)&#xA;   (w3m-util-DEPENDENT-CODE ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now we are not a top level form...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I properly fill that &lt;code&gt;eval-when-compile&lt;/code&gt; name do something that is not expected from its name?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2015-10-13T15:22:58.460" LastActivityDate="2016-04-01T16:33:58.093" Title="Why does `eval-when-compile` run at file load and byte-compiled to .elc?" Tags="|elisp|coding-conventions|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17348" PostTypeId="1" AcceptedAnswerId="18322" CreationDate="2015-10-13T14:20:32.740" Score="4" ViewCount="166" Body="&lt;p&gt;I am trying to come up with a template for &lt;a href=&quot;http://www.ctan.org/tex-archive/macros/latex/contrib/moderncv/&quot; rel=&quot;nofollow&quot;&gt;moderncv&lt;/a&gt; package. I would like to be able to render org-mode lists using &lt;code&gt;\cvitem&lt;/code&gt; for example.  Better yet, if I could choose the LaTeX command for rendering list items (there are several available in this package).  I know about &lt;code&gt;:environment&lt;/code&gt; and &lt;code&gt;:options&lt;/code&gt; but these don't really help.  I would really prefer to make this as much independent of the export back-end as possible, so that it would be less painful to export the same document as HTML if need be.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-11-23T14:52:17.910" Title="Use command other than \item to render lists in LaTeX export" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17349" PostTypeId="2" ParentId="17346" CreationDate="2015-10-13T15:00:57.890" Score="9" Body="&lt;p&gt;&lt;em&gt;See the documentation within emacs for more information.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;code&gt;--script FILE&lt;/code&gt; option runs emacs in &lt;strong&gt;batch&lt;/strong&gt; mode (See below to know more about this mode) and executes the code in the FILE.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This option &lt;strong&gt;implies&lt;/strong&gt; the &lt;code&gt;-q&lt;/code&gt; option.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;--load=FILE&lt;/code&gt; loads the FILE library using the &lt;code&gt;load&lt;/code&gt; function (and tries to find that library in &lt;code&gt;load-path&lt;/code&gt; if FILE is not an absolute path).&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This option does &lt;strong&gt;not imply&lt;/strong&gt; the &lt;code&gt;-q&lt;/code&gt; option.&lt;/li&gt;&#xA;&lt;li&gt;It is very common to use the &lt;code&gt;-l FILE&lt;/code&gt; option to see how a package/library works by itself without loading the user's emacs config. Example: &lt;code&gt;emacs -Q -l SOME-PACKAGE.el&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h i g (emacs) Initial Options&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;‘-batch’&#xA;‘--batch’&#xA;     Run Emacs in &quot;batch mode&quot;.  Batch mode is used for running programs&#xA;     written in Emacs Lisp from shell scripts, makefiles, and so on.  To&#xA;     invoke a Lisp program, use the ‘-batch’ option in conjunction with&#xA;     one or more of ‘-l’, ‘-f’ or ‘--eval’ (*note Action Arguments::).&#xA;     *Note Command Example::, for an example.&#xA;&#xA;     In batch mode, Emacs does not display the text being edited, and&#xA;     the standard terminal interrupt characters such as ‘C-z’ and ‘C-c’&#xA;     have their usual effect.  Emacs functions that normally print a&#xA;     message in the echo area will print to either the standard output&#xA;     stream (‘stdout’) or the standard error stream (‘stderr’) instead.&#xA;     (To be precise, functions like ‘prin1’, ‘princ’ and ‘print’ print&#xA;     to ‘stdout’, while ‘message’ and ‘error’ print to ‘stderr’.)&#xA;     Functions that normally read keyboard input from the minibuffer&#xA;     take their input from the terminal’s standard input stream&#xA;     (‘stdin’) instead.&#xA;&#xA;     ‘--batch’ implies ‘-q’ (do not load an initialization file), but&#xA;     ‘site-start.el’ is loaded nonetheless.  It also causes Emacs to&#xA;     exit after processing all the command options.  In addition, it&#xA;     disables auto-saving except in buffers for which auto-saving is&#xA;     explicitly requested, and when saving files it omits the ‘fsync’&#xA;     system call unless otherwise requested.&#xA;&#xA;‘--script FILE’&#xA;     Run Emacs in batch mode, like ‘--batch’, and then read and execute&#xA;     the Lisp code in FILE.&#xA;&#xA;     The normal use of this option is in executable script files that&#xA;     run Emacs.  They can start with this text on the first line&#xA;&#xA;          #!/usr/bin/emacs --script&#xA;&#xA;     which will invoke Emacs with ‘--script’ and supply the name of the&#xA;     script file as FILE.  Emacs Lisp then treats the ‘#!’ on this first&#xA;     line as a comment delimiter.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h i g (emacs) Action Arguments&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;‘-l FILE’&#xA;‘--load=FILE’&#xA;     Load a Lisp library named FILE with the function ‘load’.  If FILE&#xA;     is not an absolute file name, Emacs first looks for it in the&#xA;     current directory, then in the directories listed in ‘load-path’&#xA;     (*note Lisp Libraries::).&#xA;&#xA;     *Warning:* If previous command-line arguments have visited files,&#xA;     the current directory is the directory of the last file visited.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;How I found the above exact Info nodes?&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Open emacs Info manual (&lt;code&gt;C-h r&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Search (&lt;code&gt;s --script&lt;/code&gt; or &lt;code&gt;s --load&lt;/code&gt; for your examples).&lt;/li&gt;&#xA;&lt;li&gt;The exact node name gets copied when you hit &lt;code&gt;w&lt;/code&gt; in an Info node. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Do &lt;code&gt;C-h i h&lt;/code&gt; to learn more on using Info from within emacs.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-10-13T15:07:52.027" LastActivityDate="2015-10-13T15:07:52.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17350" PostTypeId="2" ParentId="17347" CreationDate="2015-10-13T15:21:08.217" Score="10" Body="&lt;p&gt;Did you ask Emacs what &lt;code&gt;eval-when-compile&lt;/code&gt; is supposed to do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f eval-when-compile&lt;/code&gt; tells you that it evaluates the arg also at load time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eval-when-compile is a Lisp macro in `byte-run.el'.&#xA;&#xA;(eval-when-compile &amp;amp;rest BODY)&#xA;&#xA;Like ‘progn’, but evaluates the body at compile time if you’re compiling.&#xA;Thus, the result of the body appears to the compiler as a quoted&#xA;constant.  In interpreted code, this is entirely equivalent to&#xA;‘progn’, except that the value of the expression may be (but is&#xA;not necessarily) computed at load time if eager macro expansion&#xA;is enabled.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It says that if interpreted it is like &lt;code&gt;progn&lt;/code&gt;.  And it explicitly repeats this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A function or macro name seldom reflects the behavior perfectly.  But in this case it sounds like you are looking for a different behavior, which might be called &lt;code&gt;eval-only-when-compile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-13T15:21:08.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17351" PostTypeId="2" ParentId="17346" CreationDate="2015-10-13T15:28:23.973" Score="3" Body="&lt;p&gt;&lt;code&gt;--script&lt;/code&gt; expands to load, see &lt;code&gt;lisp/startup.el&lt;/code&gt; in Emacs sources:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is used to handle -script.  It's not clear&#xA;;; we need to document it (it is totally internal).&#xA;((member argi '(&quot;-scriptload&quot;))&#xA; (let* ((file (command-line-normalize-file-name&#xA;               (or argval (pop command-line-args-left))))&#xA;        ;; Take file from default dir.&#xA;        (file-ex (expand-file-name file)))&#xA;   (load file-ex nil t t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it passes &lt;code&gt;t&lt;/code&gt; for &lt;code&gt;NOSUFFIX&lt;/code&gt;, and thus does not try to expand the file name by adding &lt;code&gt;.el&lt;/code&gt; or &lt;code&gt;.elc&lt;/code&gt; automatically, unlike &lt;code&gt;-load&lt;/code&gt; which tries to add the suffix.  Also unlike &lt;code&gt;-load&lt;/code&gt;, &lt;code&gt;--script&lt;/code&gt; never looks into &lt;code&gt;load-path&lt;/code&gt;: Relative file names are looked up in the current working directory.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, &lt;code&gt;--script&lt;/code&gt; loads the literal file name given as argument, whereas &lt;code&gt;-load&lt;/code&gt; loads a “library”, by consulting &lt;code&gt;load-path&lt;/code&gt; and adding file name suffixes as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code above says &lt;code&gt;-scriptload&lt;/code&gt;, but the main argument processing in &lt;code&gt;src/emacs.c&lt;/code&gt; converts &lt;code&gt;--script&lt;/code&gt; to &lt;code&gt;-scriptload&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (argmatch (argv, argc, &quot;-script&quot;, &quot;--script&quot;, 3, &amp;amp;junk, &amp;amp;skip_args))&#xA;  {&#xA;    noninteractive = 1; /* Set batch mode.  */&#xA;    /* Convert --script to -scriptload, un-skip it, and sort again&#xA;       so that it will be handled in proper sequence.  */&#xA;    /* FIXME broken for --script=FILE - is that supposed to work?  */&#xA;    argv[skip_args - 1] = (char *) &quot;-scriptload&quot;;&#xA;    skip_args -= 2;&#xA;    sort_args (argc, argv);&#xA;  }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see that's also where Emacs enables batch mode for &lt;code&gt;--script&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't ask me for the reason for this convoluted process of converting &lt;code&gt;--script&lt;/code&gt; to &lt;code&gt;-scriptload&lt;/code&gt;.  As with many Emacs internals I think it's better not to ask and not to know &lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-10-13T15:28:23.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17352" PostTypeId="1" CreationDate="2015-10-13T15:54:19.627" Score="5" ViewCount="124" Body="&lt;p&gt;I really like the TeX input method. It makes typing symbols a breeze, since years of LaTeX have worked the symbols into my muscle memory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, input methods have their quirks (like not working with &lt;code&gt;key-chord&lt;/code&gt;s), and I'd rather not leave it on all the time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like the &lt;code&gt;iso-transl&lt;/code&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;8&lt;/kbd&gt; map. It's handy because it's always there and very unintrusive. However, it has a rather small vocabulary of symbols, and I can never remember their keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can either &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;bind a command to &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;8&lt;/kbd&gt; &lt;kbd&gt;\&lt;/kbd&gt; that will prompt for a name from the &lt;code&gt;TeX&lt;/code&gt; input method and insert it, even if the &lt;code&gt;TeX&lt;/code&gt; input method is not active&lt;/li&gt;&#xA;&lt;li&gt;Temporarily enable the &lt;code&gt;TeX&lt;/code&gt; IM for one character only.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-10-13T16:05:58.287" LastActivityDate="2016-02-11T00:46:15.510" Title="Add TeX input method shortcuts to C-x 8 map" Tags="|input-method|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17353" PostTypeId="2" ParentId="17338" CreationDate="2015-10-13T16:12:38.893" Score="4" Body="&lt;p&gt;When you want to install an Info file in a custom directory, in addition to telling your Info Reader where that directory is, you need to create/update &lt;code&gt;dir&lt;/code&gt; file under that directory with &lt;code&gt;install-info&lt;/code&gt; program (see &lt;a href=&quot;http://www.gnu.org/software/texinfo/manual/texinfo/html_node/Installing-Dir-Entries.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to learn how to do it).&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-13T16:12:38.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17354" PostTypeId="2" ParentId="16961" CreationDate="2015-10-13T16:51:49.367" Score="9" Body="&lt;p&gt;As of October 13, 2015, Feature request #21415 has been incorporated into the master branch (aka Emacs trunk), such that frame creation may now include a pixel specification -- this includes items such as the &lt;code&gt;initial-frame-alist&lt;/code&gt;, &lt;code&gt;default-frame-alist&lt;/code&gt;, and the &lt;code&gt;make-frame&lt;/code&gt; function.  The git commit identification number is d4fe840df0b5fdb3aed538fae2ced143a471f60a.  It is built-in to the public release of Emacs 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of usage for the &lt;code&gt;width&lt;/code&gt; parameter:  &lt;code&gt;'(width . (text-pixels . 1900))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of usage for the &lt;code&gt;height&lt;/code&gt; parameter:  &lt;code&gt;'(height . (text-pixels . 1054))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example using &lt;code&gt;make-frame&lt;/code&gt; -- the font I have chosen is available on OSX 10.6.8 (substitute your own favorite font in the example accordingly):&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-example-make-frame ()&#xA;&quot;Doc-string.&quot;&#xA;(interactive)&#xA;  (make-frame '((name . &quot;HELLO-WORLD&quot;)&#xA;                (font . &quot;-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1&quot;)&#xA;                (top . 100)&#xA;                (left . 100)&#xA;                (left-fringe . 8)&#xA;                (right-fringe . 8)&#xA;                (vertical-scroll-bars . right)&#xA;                (cursor-color . &quot;yellow&quot;)&#xA;                (cursor-type . (bar . 1))&#xA;                (background-color . &quot;black&quot;)&#xA;                (foreground-color . &quot;white&quot;)&#xA;                (tool-bar-lines . 0)&#xA;                (menu-bar-lines . 0)&#xA;                (width . (text-pixels . 400))&#xA;                (height . (text-pixels . 400)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2019-12-23T21:56:29.523" LastActivityDate="2019-12-23T21:56:29.523" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="17355" PostTypeId="2" ParentId="17352" CreationDate="2015-10-13T21:49:46.797" Score="2" Body="&lt;p&gt;If I need to enter a symbol I use &lt;code&gt;C-\&lt;/code&gt; then enter &lt;code&gt;TeX&lt;/code&gt; as input mode. After that I can use &lt;code&gt;C-\&lt;/code&gt; to toggle between regular input and &quot;TeX-style&quot; input. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2015-10-13T21:49:46.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17356" PostTypeId="1" CreationDate="2015-10-13T21:54:41.630" Score="1" ViewCount="107" Body="&lt;p&gt;I seem to remember from several years ago, an alternative and better package and/or command to &quot;Time-stamp: &amp;lt;...&gt;&quot;.  I can't seem to find it now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use this in C code, not in the file header.&lt;/p&gt;&#xA;" OwnerUserId="9821" LastEditorUserId="105" LastEditDate="2015-10-14T00:23:09.187" LastActivityDate="2015-10-14T00:23:09.187" Title="Alternative to &quot;Time-stamp: &lt;...&gt;&quot;" Tags="|time-date|" AnswerCount="1" CommentCount="2" ClosedDate="2015-10-15T13:29:12.640" ContentLicense="CC BY-SA 3.0" />
  <row Id="17357" PostTypeId="2" ParentId="17323" CreationDate="2015-10-13T22:58:22.440" Score="14" Body="&lt;p&gt;The variable you want is &lt;code&gt;org-agenda-hide-tags-regexp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Regular expression used to filter away specific tags in agenda views.&#xA;  This means that these tags will be present, but not be shown in the agenda&#xA;  line.  Secondary filtering will still work on the hidden tags.&#xA;  Nil means don’t hide any tags.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A typical setting is &lt;code&gt;(setq org-agenda-hide-tags-regexp &quot;tag1\\|tag2\\|tags3&quot;)&lt;/code&gt; to hide &lt;code&gt;tag1&lt;/code&gt;, &lt;code&gt;tag2&lt;/code&gt; and &lt;code&gt;tag3&lt;/code&gt; in the agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often add &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-hide-tags-regexp&#xA;           (concat org-agenda-hide-tags-regexp &quot;\\|sometag&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to agenda searches for &quot;sometag&quot; since it is guaranteed to be on everything and I don't need to see it.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-10-15T21:29:32.027" LastActivityDate="2015-10-15T21:29:32.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17358" PostTypeId="2" ParentId="17356" CreationDate="2015-10-13T22:59:12.687" Score="0" Body="&lt;p&gt;I use the below custom command written to my taste. Try it out to see if it fits your use case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can modify the time-stamp format in the &lt;code&gt;let&lt;/code&gt;-bound &lt;code&gt;current-date-time-format&lt;/code&gt; variable to your liking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Key points on how this command behaves:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;By default, the time-stamp + user name is inserted.&lt;/li&gt;&#xA;&lt;li&gt;If the point is not in a comment or string, the comment characters are prefixed automatically.&lt;/li&gt;&#xA;&lt;li&gt;If the major-mode doesn't have comment characters defined, no prefix is inserted. &lt;/li&gt;&#xA;&lt;li&gt;If the point in inside a comment or string, and&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the point is  &lt;em&gt;immediately after&lt;/em&gt; the comment characters, no prefix is inserted.&lt;/li&gt;&#xA;&lt;li&gt;If the point is &lt;em&gt;not&lt;/em&gt; immediately after the comment characters, &lt;code&gt;--&lt;/code&gt; prefix is inserted.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Documentation in the below command's docstring further explains how the universal prefix arguments can be used to tweak the above default behavior.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/insert-time-stamp (option)&#xA;  &quot;Insert time-stamp with user name - DWIM.&#xA;&#xA;If the point is not in a comment or string,&#xA;  time-stamp + user name is inserted prefixed with `comment-start' characters.&#xA;&#xA;If the point is in a comment or string immediately after `comment-start' chars,&#xA;or if the buffer's major-mode has `comment-start' set to nil,&#xA;  time-stamp + user name is inserted without any prefix.&#xA;&#xA;If the point is in a comment or string, but *not* immediately after&#xA;`comment-start' chars,&#xA;  time-stamp + user name is inserted with `--' prefix.&#xA;&#xA;Additional control:&#xA;&#xA;        C-u -&amp;gt; Prefix (`comment-start' or `--') is not auto-inserted.&#xA;    C-u C-u -&amp;gt; User name is not inserted.&#xA;C-u C-u C-u -&amp;gt; All of the above.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((current-date-time-format &quot;%a %b %d %H:%M:%S %Z %Y&quot;)&#xA;        (no-prefix (or (= option 4) ; C-u or C-u C-u C-u&#xA;                       (= option 64)))&#xA;        (no-user-name (or (= option 16) ; C-u C-u or C-u C-u C-u&#xA;                          (= option 64))))&#xA;    ;; Insert a space if there is no space to the left of the current point&#xA;    ;; and it's not at the beginning of a line&#xA;    (when (and (not (looking-back &quot;^ *&quot;))&#xA;               (not (looking-back &quot; &quot;)))&#xA;      (insert &quot; &quot;))&#xA;    ;; Insert prefix only if `comment-start' is defined for the major mode&#xA;    (when (stringp comment-start)&#xA;      (if (or (nth 3 (syntax-ppss)) ; string&#xA;              (nth 4 (syntax-ppss))) ; comment&#xA;          ;; If the point is in a comment or string&#xA;          (progn&#xA;            ;; If the point is not immediately after `comment-start' chars&#xA;            ;; (followed by optional space)&#xA;            (when (and (not no-prefix)&#xA;                       (not (looking-back (concat comment-start &quot; *&quot;)))&#xA;                       (not (looking-back &quot;^ *&quot;)))&#xA;              (insert &quot;--&quot;)))&#xA;        ;; If the point is NOT in a comment or string&#xA;        (progn&#xA;          (when (not no-prefix)&#xA;            (insert comment-start)))))&#xA;    ;; Insert a space if there is no space to the left of the current point&#xA;    ;; and it's not at the beginning of a line&#xA;    (when (and (not (looking-back &quot;^ *&quot;))&#xA;               (not (looking-back &quot; &quot;)))&#xA;      (insert &quot; &quot;))&#xA;    (insert (format-time-string current-date-time-format (current-time)))&#xA;    (when (not no-user-name)&#xA;      (insert (concat &quot; - &quot; (getenv &quot;USER&quot;))))&#xA;    ;; Insert a space after the time stamp if not at the end of the line&#xA;    (when (not (looking-at &quot; *$&quot;))&#xA;      (insert &quot; &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-10-13T22:59:12.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17359" PostTypeId="1" AcceptedAnswerId="17379" CreationDate="2015-10-13T23:05:16.207" Score="7" ViewCount="2064" Body="&lt;p&gt;How can we invert the colors of the image when opening a pdf file in doc-view?&lt;/p&gt;&#xA;" OwnerUserId="9340" LastActivityDate="2015-12-01T11:58:42.920" Title="Doc-view change background to black" Tags="|docview|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17360" PostTypeId="2" ParentId="3427" CreationDate="2015-10-13T23:12:27.990" Score="0" Body="&lt;p&gt;You can do this if you use &lt;a href=&quot;https://github.com/jakemcc/lein-test-refresh&quot; rel=&quot;nofollow&quot;&gt;lein-test-refresh&lt;/a&gt; and &lt;code&gt;compile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a function that I use with it. I'm getting system notifications so I bury the buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun lein-test()&#xA;  (interactive)&#xA;  (compile &quot;lein test-refresh&quot;)&#xA;  (pop-to-buffer&#xA;   (get-buffer &quot;*compilation*&quot;))&#xA;  (rename-buffer &quot;*lein-test*&quot;)&#xA;  (delete-window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9823" LastEditorUserId="675" LastEditDate="2015-10-14T05:13:17.640" LastActivityDate="2015-10-14T05:13:17.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17361" PostTypeId="2" ParentId="17305" CreationDate="2015-10-13T23:20:14.607" Score="0" Body="&lt;p&gt;I have worked around it with the following for now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-link-search-must-match-exact-headline nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and replaced links to headlines with &lt;code&gt;[[*Headline name][Link name]]&lt;/code&gt; and links&#xA;to inline text with &lt;code&gt;[[In line text to search for][Link name]]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first will only match against headlines.&lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-10-13T23:20:14.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17362" PostTypeId="2" ParentId="17270" CreationDate="2015-10-14T00:55:20.720" Score="8" Body="&lt;p&gt;Magit recently gained support for something like this, but the feature is still a bit rough around the edges and has to be enabled explicitly.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;A similar feature has existed for a long time - when you move from one commit to another in a log buffer, and another window in the same frame is the repository's revision buffer, then that buffer is refreshed to show that commit instead of whatever commit it was previously showing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until very recently the revision buffer was created when you first moved from one commit to another. I have changed that behavior and now the revision buffer is only ever &lt;em&gt;updated&lt;/em&gt;. If no window in the same frame already displays that buffer, then moving around the log will no longer cause the buffer to be displayed in some new window or an existing window which previously displayed some other buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now you have to press &lt;kbd&gt;SPC&lt;/kbd&gt; once to display the revision buffer. Only then will it start being updated when you move around the log buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want the revision buffer to be updated, then do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(remove-hook 'magit-section-movement-hook&#xA;             'magit-log-maybe-update-revision-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If on the other hand you also want the revision buffer to be updated when moving around in the status buffer, then use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'magit-section-movement-hook&#xA;          'magit-status-maybe-update-revision-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It is now possible for a blob buffer to be automatically updated in a similar way. First add this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'magit-section-movement-hook&#xA;          'magit-log-maybe-update-blob-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And maybe also:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'magit-section-movement-hook&#xA;          'magit-status-maybe-update-blob-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, inside a log (or status) buffer press &lt;kbd&gt;RET&lt;/kbd&gt; to display or update the revision buffer, and to also switch to that buffer. Move to the file you are interested in and press &lt;kbd&gt;RET&lt;/kbd&gt; again. You are now in a &quot;blob-visiting&quot; buffer, which is similar to a file-visiting buffer, except that it does not visit the file in the working tree but the file as it was in some commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Switch back to the log (or status) buffer and move to another commit. The blob buffer is being updated.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note that displaying another blob, does not actually reuse the existing blob buffer. Instead it creates a new buffer which visits that blob and then displays that buffer in the window which previously displayed the other blob buffer. That other buffer is not being deleted, which unfortunately means that quite a few buffers can accumulate in a short period of time. Which would be one of those rough edges, I mentioned earlier. Pressing &lt;kbd&gt;q&lt;/kbd&gt; in a blob buffer does delete it, so you can clean up by going to the window which was used to display the various blob buffers and keep pressing &lt;kbd&gt;q&lt;/kbd&gt; until all the buffers have been deleted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally it is possible to navigate to the next or previous blob from within a blob buffer using &lt;kbd&gt;p&lt;/kbd&gt; and &lt;kbd&gt;n&lt;/kbd&gt;. I assume that in most cases you start with a recent blob and then move backward to older blobs using &lt;kbd&gt;p&lt;/kbd&gt;. If you do that and then want to move in the other direction, I recommend you use &lt;kbd&gt;q&lt;/kbd&gt; to kill the current buffer and thereby move to the &lt;em&gt;previous&lt;/em&gt; buffer i.e. the &lt;em&gt;next&lt;/em&gt; blob.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that you don't have to first visit a revision to be able to visit a blob. You could also use &lt;code&gt;M-x magit-find-file RET &amp;lt;revision&amp;gt; RET &amp;lt;file&amp;gt; RET&lt;/code&gt; directly, but I find that less convenient.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-10-14T01:44:35.773" LastActivityDate="2015-10-14T01:44:35.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17363" PostTypeId="1" CreationDate="2015-10-14T03:26:26.160" Score="0" ViewCount="157" Body="&lt;p&gt;I am using &lt;code&gt;desktop.el&lt;/code&gt; and I saved a few frame configurations in my registers. But when I jump to a saved register (&lt;code&gt;C-x r j&lt;/code&gt;), Emacs opens a new frame instead of applying that setting to the current frame. If the register is saved in that session then it works as I expect, ie, the frame configuration is applied to the current frame. I want Emacs to always apply the frame register to the current frame. Is that possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only variable I found that could be related is &lt;code&gt;desktop-restore-reuses-frames&lt;/code&gt; but that is set to t (ie, reuse frame), and a search with customize-apropos for register and frames did not give me anything I thought could help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/14125/replacing-display-buffer-reuse-frames&quot;&gt;This question&lt;/a&gt; and its answers could be a clue, but I couldn't figure out&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/8567644/347646&quot;&gt;This answer&lt;/a&gt; could also give a clue. The function jump-to-register has a prefix argument that deletes the other frames, but I couldn't figure out how to make this work (I tried &lt;code&gt;C-u C-x r j R&lt;/code&gt; and &lt;code&gt;C-u 0 C-x r j R&lt;/code&gt; and &lt;code&gt;C-u 1 C-x r j R&lt;/code&gt; but neither worked). I am not even sure this is what I want anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also looked into the library &lt;code&gt;frameset.el&lt;/code&gt; and checked the &lt;code&gt;helm-apropos&lt;/code&gt; for frameset but couldn't figure out how to do what I want. Help greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9416" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-10-14T03:26:26.160" Title="How can I apply a frame register (saved via desktop.el) to the current frame instead of opening a new frame?" Tags="|frames|desktop|registers|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17364" PostTypeId="2" ParentId="17246" CreationDate="2015-10-14T10:49:06.153" Score="1" Body="&lt;p&gt;This is a &lt;a href=&quot;http://sourceforge.net/p/cc-mode/mailman/message/34384301/&quot; rel=&quot;nofollow&quot;&gt;bug in CC mode&lt;/a&gt; which is already fixed in the master branch. Since you have an older stable build, you can replace your copies of the files&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/delsel.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;emacs-24.5/lisp/delsel.el&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/cc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;emacs-24.5/lisp/progmodes/cc-cmds.el&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;from git and compile them within Emacs with &lt;code&gt;M-x byte-compile-file&lt;/code&gt; or on terminal using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q -batch -f batch-byte-compile delsel.el progmodes/cc-cmds.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The respective &lt;code&gt;.elc&lt;/code&gt; files will be updated. Reload the &lt;code&gt;.elc&lt;/code&gt; files (&lt;code&gt;M-x load file&lt;/code&gt;) or restart Emacs. The issue would be fixed now.&lt;/p&gt;&#xA;" OwnerUserId="4106" LastEditorUserId="4106" LastEditDate="2015-10-14T10:56:00.627" LastActivityDate="2015-10-14T10:56:00.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17365" PostTypeId="1" CreationDate="2015-10-14T12:17:45.923" Score="11" ViewCount="3415" Body="&lt;p&gt;I have configured Org mode with a face attribute for priorities with these lines in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'org-priority nil&#xA;                    :foreground &quot;aquamarine1&quot;&#xA;                    :background &quot;black&quot;&#xA;                    :inherit font-lock-keyword-face&#xA;                    :inverse-video t&#xA;                    :box '(:line-width 2&#xA;                           :color &quot;orange&quot;&#xA;                           :style released-button))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'm wondering if there is a way to set different colors for priorities #A, #B &amp;amp; #C.&lt;/p&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="253" LastEditDate="2015-10-14T12:31:07.870" LastActivityDate="2016-04-15T06:39:07.117" Title="Colors for different priorities in Org mode" Tags="|org-mode|faces|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17366" PostTypeId="2" ParentId="17359" CreationDate="2015-10-14T12:27:36.987" Score="3" Body="&lt;p&gt;I use the following functions to reverse the colors in a PDF.  Note that it uses &lt;a href=&quot;http://www.imagemagick.org/script/index.php&quot; rel=&quot;nofollow&quot;&gt;ImageMagick&lt;/a&gt; under the hood and will not work without it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun define-doc-view-current-cache-dir ()&#xA;  ;; doc-view-current-cache-dir was renamed to doc-view--current-cache-dir in Emacs 24.5&#xA;  (or (fboundp 'doc-view-current-cache-dir)&#xA;      (defalias 'doc-view-current-cache-dir 'doc-view--current-cache-dir)))&#xA;(eval-after-load &quot;doc-view&quot; '(define-doc-view-current-cache-dir))&#xA;&#xA;(defun doc-view-reverse-colors ()&#xA;  &quot;Inverts document colors.\n&#xA;Requires an installation of ImageMagick (\&quot;convert\&quot;).&quot;&#xA;  (interactive)&#xA;  ;; error out when ImageMagick is not installed&#xA;  (if (/= 0 (call-process-shell-command &quot;convert -version&quot;))&#xA;      (error &quot;Reverse colors requires ImageMagick (convert)&quot;)&#xA;    (when (eq major-mode 'doc-view-mode)&#xA;      ;; assume current doc-view internals about cache-names&#xA;      (let ((file-name (expand-file-name (format &quot;page-%d.png&quot;&#xA;                                                 (doc-view-current-page))&#xA;                                         (doc-view-current-cache-dir))))&#xA;        (call-process-shell-command&#xA;         &quot;convert&quot; nil nil nil &quot;-negate&quot; file-name file-name)&#xA;        (clear-image-cache)&#xA;        (doc-view-goto-page (doc-view-current-page))))))&#xA;&#xA;(defun doc-view-reverse-colors-all-pages ()&#xA;  &quot;Inverts document colors on all pages.\n&#xA;Requires an installation of ImageMagick (\&quot;convert\&quot;).&quot;&#xA;  (interactive)&#xA;  ;; error out when ImageMagick is not installed&#xA;  (if (/= 0 (call-process-shell-command &quot;convert -version&quot;))&#xA;      (error &quot;Reverse colors requires ImageMagick (convert)&quot;)&#xA;    (when (eq major-mode 'doc-view-mode)&#xA;      ;; assume current doc-view internals about cache-names&#xA;      (let ((orig (doc-view-current-page))&#xA;            (page nil))&#xA;        (message &quot;Reversing video on all pages...&quot;)&#xA;        (dotimes (pnum (doc-view-last-page-number))&#xA;          (setq page (expand-file-name (format &quot;page-%d.png&quot; (1+ pnum))&#xA;                                       (doc-view-current-cache-dir)))&#xA;          (call-process-shell-command&#xA;           &quot;convert&quot; nil nil nil &quot;-negate&quot; page page))&#xA;        (clear-image-cache)&#xA;        (doc-view-goto-page orig)&#xA;        (message &quot;Done reversing video!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="10218" LastEditDate="2015-12-01T11:58:42.920" LastActivityDate="2015-12-01T11:58:42.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17367" PostTypeId="2" ParentId="16462" CreationDate="2015-10-14T12:41:49.850" Score="1" Body="&lt;p&gt;The problem was that my shell init file (&lt;code&gt;.zshenv&lt;/code&gt;  in my case, since I am using &lt;code&gt;zsh&lt;/code&gt;) was printing one line to &lt;code&gt;stdout&lt;/code&gt; every time I logged in, and this was confusing the parsing. Once I removed the &lt;code&gt;echo&lt;/code&gt; line, everything worked well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am leaving this as an answer here in case anyone else runs into the same problem.&lt;/p&gt;&#xA;" OwnerUserId="6" LastActivityDate="2015-10-14T12:41:49.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17368" PostTypeId="2" ParentId="17321" CreationDate="2015-10-14T13:52:19.193" Score="1" Body="&lt;p&gt;I think your macro is simply wrong.  You probably want something more like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro setq2 (infoString x y)&#xA;  `(progn&#xA;     (princ (format &quot;setq2 %s (setq %s %s)\n&quot; ,infoString ',x ',y))&#xA;     (setq ,x ,y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-10-14T13:52:19.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17369" PostTypeId="2" ParentId="17365" CreationDate="2015-10-14T14:29:09.480" Score="14" Body="&lt;p&gt;You can customize &lt;code&gt;org-priority-faces&lt;/code&gt; to give specific attributes for each priority.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h v org-priority-faces&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;br&gt;&#xA;  Faces for specific Priorities.&lt;br&gt;&#xA;  This is a list of cons cells, with priority character in the car&#xA;  and faces in the cdr.  The face can be a symbol, a color as&#xA;  as a string, or a property list of attributes, like&lt;br&gt;&#xA;      &lt;code&gt;(:foreground &quot;blue&quot; :weight bold :underline t)&lt;/code&gt;.&lt;br&gt;&#xA;  If it is a color string, the variable &lt;code&gt;org-faces-easy-properties&lt;/code&gt;&#xA;  determines if it is a foreground or a background color.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this is my current setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((65 :foreground &quot;red&quot; :background &quot;yellow&quot;)&#xA;  (66 :foreground &quot;black&quot; :background &quot;yellow&quot;)&#xA;  (67 . &quot;blue&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The numbers &lt;code&gt;65&lt;/code&gt;, etc. correspond to the priority letters (ASCII 65 for &lt;code&gt;A&lt;/code&gt;, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is most easily configured using the &lt;code&gt;customize-variable&lt;/code&gt; interface.&lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="53" LastEditDate="2015-10-15T15:36:34.620" LastActivityDate="2015-10-15T15:36:34.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17370" PostTypeId="1" AcceptedAnswerId="17374" CreationDate="2015-10-14T14:43:36.013" Score="2" ViewCount="686" Body="&lt;p&gt;I searched Google for &quot;emacs org subtree&quot; but couldn't find&#xA;any introductory information on this particular aspect&#xA;of org mode.&#xA;My questions are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What is it?&lt;/li&gt;&#xA;&lt;li&gt;How do I create one?&lt;/li&gt;&#xA;&lt;li&gt;If possible, can I use it as a todo list?&lt;/li&gt;&#xA;&lt;li&gt;Can I move up/down items using a single key?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9829" LastEditorUserId="2355" LastEditDate="2015-10-14T17:13:10.943" LastActivityDate="2015-10-14T17:13:10.943" Title="emacs: What is a subtree in org mode? and how do you create one" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17371" PostTypeId="1" AcceptedAnswerId="17373" CreationDate="2015-10-14T14:56:06.700" Score="1" ViewCount="64" Body="&lt;p&gt;I am trying to debug a c++ program using &lt;code&gt;M-x gdb&lt;/code&gt; but I get nothing but a &lt;code&gt;(gdb)&lt;/code&gt; prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;https://stackoverflow.com/questions/20662444/getting-gdb-to-work-with-emacs-24&quot;&gt;question&lt;/a&gt; has a comment which suggests to load the latest version of gdb-mi.el.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can you try download latest version of gdb-mi.el from github.com/mirrors/emacs/blob/master/lisp/progmodes/gdb-mi.el an try to load it?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Question: how can I load that version of &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/gdb-mi.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;gdb-mi.el&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-10-14T15:18:12.263" Title="How to load a new version of emacs module from a file?" Tags="|gdb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17372" PostTypeId="2" ParentId="14960" CreationDate="2015-10-14T15:14:19.157" Score="1" Body="&lt;p&gt;I'm not sure I fully understand, let alone can reproduce, your kind of specific situation. It is a more unusual way to invoke pdb. More context in what you are doing might be useful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the underlying elisp function you want to run is something like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(realgud:run-process &quot;pdb&quot; &quot;/usr/bin/pdb&quot; '(&quot;pdb&quot; &quot;foo&quot;) realgud:pdb-minibuffer-history)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first argument &quot;pdb&quot; sets how realgud sets up debugger settings to use in order to interpret subsequent interaction with the debugger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second argument &quot;/usr/bin/pdb&quot;, gives the specific debugger script to run. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 3rd argument &lt;code&gt;'(&quot;pdb&quot; &quot;foo&quot;)&lt;/code&gt; gives the command and arguments used to invoke the debugger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 4th argument &lt;code&gt;realgud:pdb-minibuf-history&lt;/code&gt; will store the invocation (if successful) in the history of pdb invocations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me explain a little bit about the motivation for &lt;em&gt;why&lt;/em&gt; realgud does what it does. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you run a debugger like pdb, realgud in contrast to gud, makes an attempt to sort the specific debugger options, e.g to pdb, from the debugged script options. In other words it parses what you type; undoubtedly that parsing is failing here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does it try to parse the full debugger command? In some cases the debugger options may get filtered or expanded upon. For example for &lt;em&gt;gdb&lt;/em&gt; we need to add option &lt;code&gt;--annotation-level=2&lt;/code&gt;; realgud would like to know the script name and short debugger name so that it can use that in creating the command buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you feel there is a problem with realgud, &lt;a href=&quot;https://github.com/rocky/emacs-dbgr/issues&quot; rel=&quot;nofollow&quot;&gt;open a github issue&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-10-15T14:41:05.843" LastActivityDate="2015-10-15T14:41:05.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17373" PostTypeId="2" ParentId="17371" CreationDate="2015-10-14T15:18:12.263" Score="1" Body="&lt;p&gt;After downloading that file, you can load it with &lt;code&gt;M-x load-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Apart from that, &lt;code&gt;M-x gdb&lt;/code&gt; usually just gives you a &lt;code&gt;(gdb)&lt;/code&gt; prompt to start with. You have to start your program by entering &lt;code&gt;r&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2015-10-14T15:18:12.263" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17374" PostTypeId="2" ParentId="17370" CreationDate="2015-10-14T15:32:55.580" Score="6" Body="&lt;p&gt;A subtree is a line that begins with more &lt;code&gt;*&lt;/code&gt; characters than some line above it. Its purpose is just to organize text, the way a paragraph or chapter might work. For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Tree&#xA;Some content&#xA;** SubTree&#xA;More content&#xA;*** SubSubTree&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can move trees, subtrees, and paragraphs with &lt;code&gt;M-&amp;lt;up&amp;gt;&lt;/code&gt; or &lt;code&gt;M-&amp;lt;down&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org doesn't have a &quot;todo list&quot;. It has TODO items, and it has lists. You would make your Tree (or SubTree) a TODO item but adding &lt;code&gt;TODO&lt;/code&gt; between the &lt;code&gt;*&lt;/code&gt; character(s) and the name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You make lists with &lt;code&gt;+&lt;/code&gt; or &lt;code&gt;-&lt;/code&gt;, and these can optionally have checkboxes attached:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+ List Item&#xA;+ Another Item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+ [ ] List item w/ checkbox (unchecked)&#xA;+ [X] List item w/ checked checkbox&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-10-14T15:32:55.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17375" PostTypeId="1" AcceptedAnswerId="17384" CreationDate="2015-10-14T16:04:46.043" Score="0" ViewCount="521" Body="&lt;p&gt;I can't figure out how to enable the gdb-gui. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of this:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/7EMLI.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7EMLI.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6)&#xA;Copyright (C) 2010 Free Software Foundation, Inc.&#xA;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&#xA;This is free software: you are free to change and redistribute it.&#xA;There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;&#xA;and &quot;show warranty&quot; for details.&#xA;This GDB was configured as &quot;x86_64-redhat-linux-gnu&quot;.&#xA;For bug reporting instructions, please see:&#xA;&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;...&#xA;Reading symbols from /home/beginner/test/build/unittests/alltest...done.&#xA;(gdb) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Question: how do I get the gdb GUI to work?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastEditorUserId="2076" LastEditDate="2015-10-15T05:29:08.717" LastActivityDate="2015-10-15T05:29:08.717" Title="How to get the gdb GUI to work?" Tags="|gdb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17376" PostTypeId="1" AcceptedAnswerId="17378" CreationDate="2015-10-14T16:28:12.920" Score="4" ViewCount="813" Body="&lt;p&gt;My &lt;code&gt;ace-jump-mode&lt;/code&gt; bindings don't seem to work when I'm editing in &lt;code&gt;org-mode&lt;/code&gt;.&#xA;This is how I define them in my &lt;a href=&quot;https://github.com/mperdikeas/environment/blob/master/.emacs&quot; rel=&quot;nofollow&quot;&gt;.emacs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (require 'ace-jump-mode)                                                                                                                                                            &#xA;    (define-key global-map (kbd &quot;C-c SPC&quot;) 'ace-jump-mode)                                                                                                                            &#xA;    (define-key global-map (kbd &quot;C-c C-c SPC&quot;) 'ace-jump-char-mode)                                                                                                                   &#xA;    (define-key global-map (kbd &quot;C-c C-c C-c SPC&quot;) 'ace-jump-line-mode)                                                                                                               &#xA;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, when editing in &lt;code&gt;org-mode&lt;/code&gt;, &lt;code&gt;C-c SPC&lt;/code&gt; gives on the mini-buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Not in table data field&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... with the other bindings also failing (in different ways). I would prefer to disable these bindings from the &lt;code&gt;org-mode&lt;/code&gt; commands they are bound to as I don't use them (for the time being at least).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not possible, is it possible to instead only define alternative bindings for the &lt;code&gt;ace-jump&lt;/code&gt; commands only when working in &lt;code&gt;org-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general what is the &quot;proper&quot; way of addressing such clashes?&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2016-05-23T16:38:42.203" Title="AceJump key bindings not working in org-mode" Tags="|org-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17378" PostTypeId="2" ParentId="17376" CreationDate="2015-10-14T16:56:34.523" Score="7" Body="&lt;p&gt;Global map keys get overridden by major-mode and minor-mode keymaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a couple of ways to solve the problem specific to your case:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Do not bind &lt;code&gt;ace-jump-mode&lt;/code&gt; to  &lt;code&gt;C-c SPC&lt;/code&gt;. Instead bind it to something else that does not clash like &lt;code&gt;C-c C-SPC&lt;/code&gt;.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Many might recommend using this approach.&lt;/strong&gt; &lt;em&gt;If you use &lt;code&gt;org-mode&lt;/code&gt; frequently, or might start using it frequently in future, you do not want your personal bindings clashing with the org-mode bindings :)&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As the &lt;code&gt;C-c SPC&lt;/code&gt; in &lt;code&gt;org-mode-map&lt;/code&gt; is overriding your binding in the &lt;code&gt;global-map&lt;/code&gt;, you can bind that particular key in &lt;code&gt;org-mode-map&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. See &lt;a href=&quot;https://emacs.stackexchange.com/a/353/115&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'org&#xA;    (define-key org-mode-map (kbd &quot;C-c SPC&quot;) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do not bind &lt;code&gt;ace-jump-mode&lt;/code&gt; in &lt;code&gt;global-map&lt;/code&gt; but &lt;a href=&quot;https://emacs.stackexchange.com/a/358/115&quot;&gt;in your own minor-mode map&lt;/a&gt; or using something like &lt;a href=&quot;https://emacs.stackexchange.com/a/360/115&quot;&gt;&lt;code&gt;use-package&lt;/code&gt; package's &lt;code&gt;bind-key*&lt;/code&gt; or &lt;code&gt;bind-keys*&lt;/code&gt; macro&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Above links are solutions to a prior question asked here on emacs.stackexchange,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/352/115&quot;&gt;&lt;strong&gt;How to override major mode bindings?&lt;/strong&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-10-14T17:10:24.277" CommentCount="0" CommunityOwnedDate="2015-10-14T16:56:34.523" ContentLicense="CC BY-SA 3.0" />
  <row Id="17379" PostTypeId="2" ParentId="17359" CreationDate="2015-10-14T17:24:00.050" Score="10" Body="&lt;h2&gt;&lt;code&gt;pdf-tools&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you decide to install &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;pdf-tools&lt;/code&gt;&lt;/a&gt; package (also available on Melpa) to view PDF files (instead of &lt;code&gt;doc-view-mode&lt;/code&gt;), you can view the PDF in &quot;midnight mode&quot; by using the default binding &lt;code&gt;C-c C-r m&lt;/code&gt; or by doing &lt;code&gt;M-x pdf-view-midnight-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default colors of this minor mode are,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Foreground color - &lt;a href=&quot;http://www.color-hex.com/color/839496&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;#839496&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Background color - &lt;a href=&quot;http://www.color-hex.com/color/002b36&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;#002b36&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But you can customize those by customizing the variable &lt;code&gt;pdf-view-midnight-colors&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h v pdf-view-midnight-colors&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Colors used when `pdf-view-midnight-minor-mode' is activated.&lt;br&gt;&#xA;  This should be a cons (FOREGROUND . BACKGROUND) of colors.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-10-14T17:24:00.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17380" PostTypeId="1" CreationDate="2015-10-14T17:41:06.750" Score="3" ViewCount="548" Body="&lt;p&gt;The preview-latex package behaves in the following manner: it shows you an image of a formula / section header / etc. When the cursor gets &quot;into&quot; the image it is automatically replaced by the latex code. Once you're done, the user is supposed to hit C-c C-p C-p to update the preview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like: instead of a manual process (hitting C-c C-p C-p), I would prefer that whenever I finish editing a formula, the images should be updated automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that possible? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Warning: I'm a novice emacs user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, I'm using Aquamacs 3.2 GNU Emacs 24.4.51.2 , but I'm pretty sure this applies to standard emacs as well.&lt;/p&gt;&#xA;" OwnerUserId="9830" LastEditorUserId="9830" LastEditDate="2015-10-14T18:07:59.593" LastActivityDate="2021-02-21T00:14:02.373" Title="Automization of preview-latex" Tags="|latex|preview-latex|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17382" PostTypeId="2" ParentId="7607" CreationDate="2015-10-14T19:27:03.027" Score="14" Body="&lt;p&gt;It seems you can use &lt;code&gt;#+OPTIONS: prop:t&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot; rel=&quot;noreferrer&quot;&gt;12.3 Export settings&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;prop&lt;/code&gt;:&#xA;  Toggle inclusion of property drawers, or list properties to include (&lt;code&gt;org-export-with-properties&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6807" LastActivityDate="2015-10-14T19:27:03.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17383" PostTypeId="1" CreationDate="2015-10-14T19:27:25.217" Score="9" ViewCount="1157" Body="&lt;p&gt;I've been trying to get nnmaildir to work along with mbsync (which syncs IMAP and Maildir mailboxes) and I just cannot get it to work with gnus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the following select method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nnmaildir &quot;calgary&quot;&#xA;           (directory &quot;~/mail/ucalgary&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can open the connection and the server browse buffer shows all the groups:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;K      0: Calendar&#xA;U      0: Inbox&#xA;K      0: Sent Items&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open the Inbox I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnus-select-newsgroup: Couldn't request group nnmaildir+calgary:Inbox: No such group: Inbox&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I look in &lt;code&gt;/home/crb/mail/ucalgary/Inbox/cur/&lt;/code&gt; there are a number of read and unread messages for example &lt;code&gt;1443481160.3793_16.Feddie,U=16:2,S&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice on how to fix this?&lt;/p&gt;&#xA;" OwnerUserId="9833" LastEditorUserId="15748" LastEditDate="2017-06-19T00:27:12.877" LastActivityDate="2024-03-14T20:06:55.823" Title="Issue with nnmaildir in gnus" Tags="|gnus|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17384" PostTypeId="2" ParentId="17375" CreationDate="2015-10-14T19:33:07.330" Score="3" Body="&lt;p&gt;Since I do not have enough reputation to comment, I will post this as an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/GDB-User-Interface-Layout.html#GDB-User-Interface-Layout&quot; rel=&quot;nofollow&quot;&gt;Emacs manual&lt;/a&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To toggle between the many windows layout and a simple layout with just the GUD interaction buffer and a source file, type M-x gdb-many-windows.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does this help you?&lt;/p&gt;&#xA;" OwnerUserId="2523" LastActivityDate="2015-10-14T19:33:07.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17385" PostTypeId="2" ParentId="17380" CreationDate="2015-10-14T20:17:08.120" Score="1" Body="&lt;p&gt;Here is my start of solution, it can be improved, see below.  Add the following code to your init file and restart Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mg-LaTeX-preview-formulae ()&#xA;  (and (eq major-mode 'latex-mode)&#xA;       (not (texmathp))&#xA;       (preview-section)))&#xA;&#xA;(add-hook 'LaTeX-mode-hook&#xA;      (lambda ()&#xA;        (setq mg-LaTeX-preview-formulae-timer&#xA;          (run-with-idle-timer 1 nil 'mg-LaTeX-preview-formulae))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this code, after 1 second of idle time (I mean: &lt;strong&gt;every time&lt;/strong&gt; you do nothing for 1 second, but you can change the time in the last line of the above code) it's run the preview of the current section (trying to be as conservative as possible).  Emacs can't really know which is the last equation you edited if you exit from it.  You could use &lt;code&gt;preview-at-point&lt;/code&gt; to preview the current equation you are in, but this is probably uncomfortable while you're writing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it is implemented above, I think this feature is really annoying while you write (but increasing the idle time can help), so you can run &lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(cancel-timer mg-LaTeX-preview-formulae-timer)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; in order to eliminate this for the current Emacs session, and remove the above code for the future sessions.  The problem is: how do you think you can tell Emacs you want to see the preview?&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2015-10-14T20:17:08.120" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17386" PostTypeId="1" AcceptedAnswerId="17389" CreationDate="2015-10-14T20:42:15.427" Score="4" ViewCount="772" Body="&lt;p&gt;When I install a new package, more often than not there are variables that I can set - to customise the package. I love customisations, which is why I use Emacs in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I installed the &lt;a href=&quot;https://github.com/xuchunyang/osx-dictionary.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;osx-dictionary&lt;/code&gt;&lt;/a&gt; package. In the sample configuration, there is a &lt;code&gt;setq&lt;/code&gt; statement:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq osx-dictionary-dictionary-choice &quot;Apple&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everyone recognises expresions such as these. This one uses the &lt;code&gt;Apple&lt;/code&gt; dictionary as standard for all dictionary queries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to change some settings for that package, e.g. to use more than one dictionary for the output. I could try a hack, entering a list of dictionaries in the place of &quot;Apple&quot;.&#xA;However, I am hoping that there is maybe a better way (than me &lt;em&gt;extremely inefficiently&lt;/em&gt; fumbling around with Lisp code), which finds the variable required within said package to do what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;C-h f&lt;/code&gt; and begin to type: &lt;code&gt;osx-dictio&lt;/code&gt;,  to display possible completions, I get the following list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Possible completions are:&#xA;osx-dictionary--get-buffer             osx-dictionary--goto-dictionary&#xA;osx-dictionary--list-dictionaries      osx-dictionary--region-or-word&#xA;osx-dictionary--search                 osx-dictionary--view-result&#xA;osx-dictionary-cli-find-or-recompile   osx-dictionary-mode&#xA;osx-dictionary-open-dictionary.app     osx-dictionary-quit&#xA;osx-dictionary-read-word               osx-dictionary-recompile&#xA;osx-dictionary-search-input            osx-dictionary-search-pointer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that is two per line, 7 lines, so 14 possibilities. These are not mentioned in the package description. If anyone can explain the major differences between those with &lt;code&gt;-&lt;/code&gt; and those with &lt;code&gt;--&lt;/code&gt; it might help me.&#xA;But that is not my point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to find definable variables within any given packages, so as to know how one can customise that package WITHOUT having to go and read through all the actual code? [That is namely a massive task for some packages... I don't want to know &lt;em&gt;how&lt;/em&gt; the package works, I just want to install it, optimise it for my needs and get on with my life!]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These customisations are the ones I would like to store in my .emacs file. therefore, the descriptions of what it does and what the possible input values are, e.g. boolean or otherwise, would also be great to have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologise if there is an easy answer that I have overlooked, but after searching around for too long, I have drawn a blank.&#xA;If this is the case, I shall accept the downvote and delete my question in embarrassment, post-haste!&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="105" LastEditDate="2015-10-14T23:14:40.227" LastActivityDate="2021-08-29T22:50:48.747" Title="Display all setq possibilities" Tags="|customize|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17387" PostTypeId="1" AcceptedAnswerId="17388" CreationDate="2015-10-14T21:46:38.660" Score="1" ViewCount="618" Body="&lt;p&gt;I have configured Emacs to open certain file types with external viewers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn                                                                     &#xA;    (require 'openwith)                                                    &#xA;    (openwith-mode t)                                                      &#xA;    (setq openwith-associations '((&quot;\\.pdf\\'&quot; &quot;evince&quot; (file))))          &#xA;    (setq openwith-associations '((&quot;\\.jpg\\'&quot; &quot;eog&quot; (file))))             &#xA;   (setq openwith-associations '((&quot;\\.png\\'&quot; &quot;eog&quot; (file))))             &#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While &lt;code&gt;eog&lt;/code&gt; file types are indeed opened with the &lt;code&gt;eog&lt;/code&gt; program, when I navigate to a &lt;code&gt;PDF&lt;/code&gt; file (with &lt;code&gt;C-x C-f&lt;/code&gt;) this is what I see:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8jOb6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8jOb6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, when I navigate to &lt;code&gt;png&lt;/code&gt; files they are opened in an external &lt;code&gt;eog&lt;/code&gt; viewer as intended.&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-10-14T22:34:42.970" Title="emacs not opening PDF files in external viewer" Tags="|openwith|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17388" PostTypeId="2" ParentId="17387" CreationDate="2015-10-14T22:34:42.970" Score="7" Body="&lt;p&gt;The original poster has defined &lt;code&gt;openwith-associations&lt;/code&gt; three (3) times in a row, each time differently.  The latest in time will prevail.  Instead, consider using the following &lt;em&gt;list&lt;/em&gt; format that includes everything:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq openwith-associations '(&#xA;  (&quot;\\.pdf\\'&quot; &quot;evince&quot; (file))&#xA;  (&quot;\\.\\(?:jp?g\\|png\\)\\'&quot; &quot;eog&quot; (file))&#xA;  (&quot;\\.mp3\\'&quot; &quot;xmms&quot; (file))&#xA;  (&quot;\\.\\(?:mpe?g\\|avi\\|wmv\\)\\'&quot; &quot;mplayer&quot; (&quot;-idx&quot; file)) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-10-14T22:34:42.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17389" PostTypeId="2" ParentId="17386" CreationDate="2015-10-14T23:13:12.407" Score="9" Body="&lt;p&gt;For best results and to avoid gotchas, &lt;em&gt;&lt;strong&gt;do not use &lt;code&gt;setq&lt;/code&gt; to set option values.&lt;/strong&gt;&lt;/em&gt;  Get in the habit of doing one of the following instead:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;M-x customize&lt;/code&gt;&lt;/strong&gt; &lt;em&gt;&lt;code&gt;OPTION&lt;/code&gt;&lt;/em&gt;, where &lt;em&gt;&lt;code&gt;OPTION&lt;/code&gt;&lt;/em&gt; is the option name. Change the value and save your change.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;custom-set-variables&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;customize-set-variable&lt;/code&gt;&lt;/strong&gt; in your &lt;strong&gt;&lt;code&gt;custom-file&lt;/code&gt;&lt;/strong&gt; (preferably) or in your init file (not as good, because it lets Customize mix the code it manages with your hand-coded code).&lt;/li&gt;&#xA;&lt;li&gt;If the option is the customizable variable for a minor mode, then call the minor-mode command to set it.  For example, turn off global minor mode &lt;code&gt;line-number-mode&lt;/code&gt; not be setting variable &lt;code&gt;line-number-mode&lt;/code&gt; directly but with this: &lt;code&gt;(line-number-mode 0)&lt;/code&gt;.  (See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Syntax.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Init Syntax&lt;/a&gt;.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;setq&lt;/code&gt; does not carry out any special initialization or update operations that might be necessary for the option.  Customize and its functions do that -- the &lt;strong&gt;necessary initialization and updating are triggered automatically&lt;/strong&gt; whenever you set the value using Customize.&lt;/p&gt;&#xA;&lt;p&gt;In addition, &lt;strong&gt;&lt;code&gt;setq&lt;/code&gt; does no type-checking&lt;/strong&gt; -- it ignores &lt;code&gt;:type&lt;/code&gt; as well as &lt;code&gt;:set&lt;/code&gt;, &lt;code&gt;:initialize&lt;/code&gt;, and all the rest of a &lt;code&gt;defcustom&lt;/code&gt; definition -- except for the variable value and doc string.&lt;/p&gt;&#xA;&lt;p&gt;The lack of type-checking is in fact the most common way for users to shoot themselves in the foot by using &lt;code&gt;setq&lt;/code&gt;, because the use of &lt;code&gt;:set&lt;/code&gt; and &lt;code&gt;:initialize&lt;/code&gt; (and other keywords) in &lt;code&gt;defcustom&lt;/code&gt;s is not so common.  It is fairly common for a user to write an Emacs help question asking what went wrong, where the answer is that s?he used &lt;code&gt;setq&lt;/code&gt; and assigned a value of a type that does not respect the type specified by the &lt;code&gt;defcustom&lt;/code&gt;.  Not the end of the world, but it can be quite puzzling when you pay no attention to what user options are all about.  They are not just &lt;code&gt;defvar&lt;/code&gt;s.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;To see all &lt;em&gt;loaded&lt;/em&gt; user options (or all that match an input pattern):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use &lt;code&gt;customize-apropos&lt;/code&gt; to customize them.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use &lt;code&gt;M-x set-variable TAB&lt;/code&gt; to see them.  And you can use it to set any of them, but like &lt;code&gt;setq&lt;/code&gt;, bypassing update triggers.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2021-08-29T22:50:48.747" LastActivityDate="2021-08-29T22:50:48.747" CommentCount="17" ContentLicense="CC BY-SA 4.0" />
  <row Id="17391" PostTypeId="1" AcceptedAnswerId="17407" CreationDate="2015-10-15T02:12:00.637" Score="2" ViewCount="318" Body="&lt;p&gt;I want a numbered list of instructions where one or more steps show commands to be typed in.   I use BEGIN_SRC blocks and when exported to LaTeX the numbering has started over.  Even using [@4] doesn't work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Instructions&#xA;To do the thing&#xA;1. Wax on&#xA;2. Wax off&#xA;3. From the cmd line&#xA;#+BEGIN_SRC bash&#xA;$&amp;gt; cd foo&#xA;$&amp;gt; bar --out results.txt&#xA;#+END_SRC&#xA;4. Lather&#xA;5. Rinse&#xA;6. Repeat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I have the list stay  continously numbered?&lt;/p&gt;&#xA;" OwnerUserId="6929" LastActivityDate="2015-10-15T17:07:33.160" Title="Org Numbered Lists Break with Src Block" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17392" PostTypeId="1" AcceptedAnswerId="17393" CreationDate="2015-10-15T02:56:40.880" Score="2" ViewCount="570" Body="&lt;p&gt;I remember reading about this function (it's part of Emacs) somewhere, but I can't for the life of me remember what it's called. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It takes a single argument &lt;code&gt;arg&lt;/code&gt; (not sure if there's any more optional args)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;By default it looks for &lt;code&gt;(expand-file-name arg &quot;~/&quot;)&lt;/code&gt; and returns the path if it exists.&lt;/li&gt;&#xA;&lt;li&gt;If not, it looks for &lt;code&gt;(expand-file-name arg user-emacs-directory)&lt;/code&gt; and returns the path if it exists.&lt;/li&gt;&#xA;&lt;li&gt;Otherwise, it creates the subdirectory in &lt;code&gt;user-emacs-directory&lt;/code&gt; and returns the path.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="105" LastEditDate="2022-09-18T17:41:05.877" LastActivityDate="2022-09-18T17:41:05.877" Title="Function that gets a subdirectory of user-emacs-directory" Tags="|directories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17393" PostTypeId="2" ParentId="17392" CreationDate="2015-10-15T03:11:52.683" Score="3" Body="&lt;p&gt;You are looking for &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-File-Names.html#Standard-File-Names&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;locate-user-emacs-file&lt;/code&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Check out the below example code that,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Creates &lt;code&gt;abc/&lt;/code&gt; sub-directory under &lt;code&gt;user-emacs-directory&lt;/code&gt; if &lt;code&gt;~/abc/&lt;/code&gt; doesn't already exist.&lt;/li&gt;&#xA;&lt;li&gt;Always returns the full directory path, whether it got created or not.&lt;/li&gt;&#xA;&lt;li&gt;Displays a message in the event the directory did not get created for some reason.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((dir (locate-user-emacs-file &quot;abc/&quot;)))&#xA;  (make-directory dir :parents)&#xA;  (when (not (file-directory-p dir))&#xA;    (message &quot;%s directory was not created.&quot; dir))&#xA;  dir) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-10-15T14:14:46.763" LastActivityDate="2015-10-15T14:14:46.763" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17394" PostTypeId="1" AcceptedAnswerId="17395" CreationDate="2015-10-15T05:51:31.793" Score="6" ViewCount="777" Body="&lt;p&gt;I'm using &lt;code&gt;start-process&lt;/code&gt; to run mplayer and when playing videos I get a ton of output to stderr from &quot;vdp_...&quot;. On the command line I usually just 2&gt;/dev/null but &lt;code&gt;start-process&lt;/code&gt; runs it directly without a shell. (I tried &lt;code&gt;start-process-shell-command&lt;/code&gt; but it simply does not work at all). &lt;code&gt;call-process&lt;/code&gt; lets you provide a list for separate stdout and stderr but it seems &lt;code&gt;start-process&lt;/code&gt; does not. I don't see an option to mplayer to inhibit the output. If only there were a way to do with &lt;code&gt;start-process&lt;/code&gt; what you can do with &lt;code&gt;call-process&lt;/code&gt;. Is there some way I'm not seeing to do this?&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="105" LastEditDate="2022-09-18T17:40:36.733" LastActivityDate="2022-09-18T17:40:36.733" Title="Discard stderr in start-process" Tags="|shell|process|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17395" PostTypeId="2" ParentId="17394" CreationDate="2015-10-15T10:35:09.787" Score="4" Body="&lt;p&gt;I know this is an emacs forum, but maybe the simplest thing to do is to write a simple shell script that filters &lt;em&gt;stderr&lt;/em&gt;. For example in file &lt;code&gt;nostderr.sh&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh &#xA;$@ 2&amp;gt;/dev/null&#xA;exit $? &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then run that in your &lt;code&gt;start-process&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-10-15T14:45:01.380" LastActivityDate="2015-10-15T14:45:01.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17396" PostTypeId="1" AcceptedAnswerId="70984" CreationDate="2015-10-15T11:43:32.380" Score="10" ViewCount="711" Body="&lt;p&gt;Yet &lt;a href=&quot;https://emacs.stackexchange.com/q/3083/184&quot;&gt;another&lt;/a&gt; &lt;a href=&quot;https://emacs.stackexchange.com/questions/16786/modifying-auctex-bracket-indentation-locally&quot;&gt;question&lt;/a&gt; about indentation in AUCTeX...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to indent content inside square brackets &lt;code&gt;[...]&lt;/code&gt;. It would be useful for tikz option lists, for example, or trees drawn using &lt;code&gt;forest&lt;/code&gt; or &lt;code&gt;qtree&lt;/code&gt;: both these packages use square brackets for their syntax, which makes it easy to scan in source code in an editor supporting paren-indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, AUCTeX only indents the content of environments and content between braces &lt;code&gt;{...}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;forest&lt;/code&gt; example is also a situation where cheating by adding braces around the content we want indented won't work, because braces will escape all content from being evaluated as a tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{forest}&#xA;&#xA;\begin{document}&#xA;&#xA;\begin{forest}&#xA;  [A&#xA;  [B]&#xA;  [C&#xA;  [D]&#xA;  [E]&#xA;  ]&#xA;  ]&#xA;\end{forest}&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which I would like indented as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{forest}&#xA;&#xA;\begin{document}&#xA;&#xA;\begin{forest}&#xA;  [A&#xA;    [B]&#xA;    [C&#xA;      [D]&#xA;      [E]&#xA;    ]&#xA;  ]&#xA;\end{forest}&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way?&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2022-03-17T15:20:41.550" Title="Indentation in square brackets" Tags="|indentation|auctex|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17397" PostTypeId="1" CreationDate="2015-10-15T12:57:13.480" Score="1" ViewCount="106" Body="&lt;p&gt;I try to do a shell command in frame-title-format.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-title-format&#xA;      (list (format &quot;%s&quot; (shell-command-to-string (concat &quot;ls -1 %f&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ls: cannot access filename: No such file or directory&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is shown up on the frame-title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it due to the white space?  How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ben&lt;/p&gt;&#xA;" OwnerUserId="9841" LastEditorUserId="306" LastEditDate="2015-10-15T13:50:51.630" LastActivityDate="2015-10-15T14:15:38.490" Title="Frame title using shell-command" Tags="|frames|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17398" PostTypeId="2" ParentId="17397" CreationDate="2015-10-15T13:35:44.310" Score="-1" Body="&lt;p&gt;The problem is that %f is ambigous&#xA;You can try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq frame-title-format (format &quot;%s&quot; (shell-command-to-string(concat &quot;ls -l &quot; (buffer-file-name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-10-15T13:44:42.160" LastActivityDate="2015-10-15T13:44:42.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17399" PostTypeId="1" CreationDate="2015-10-15T14:02:41.373" Score="4" ViewCount="68" Body="&lt;p&gt;I like using org-mode in my packages' Readme files, but I also like&#xA;writing instructions under the &lt;code&gt;;;; Commentary:&lt;/code&gt; header that goes in&#xA;the source file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I change some part of the documentation, the best way I've&#xA;found to keep those in sync is to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Edit the org file first.&lt;/li&gt;&#xA;&lt;li&gt;Export to a plain text utf-8 buffer, with the body-only option (&lt;code&gt;C-c e C-b t U&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Add &lt;code&gt;;;&lt;/code&gt; at the start of each line.&lt;/li&gt;&#xA;&lt;li&gt;Copy that over to the package file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I best automate this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can write the necessary elisp for adding &lt;code&gt;;;&lt;/code&gt; and copying to the&#xA;kill-ring, but I'm not familiar enough with the org-export machinery&#xA;to know what's The Right Way to do an automated export using a&#xA;specific recipe.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Bonus points if there's a command I can invoke from a &lt;code&gt;.el&lt;/code&gt; file which&#xA;automatically finds a &lt;code&gt;Readme.org&lt;/code&gt;, does the whole export, and uses it&#xA;to replace the file's &lt;code&gt;;;; Commentary:&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-10-15T14:02:41.373" Title="Org-export to lisp comments" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17400" PostTypeId="2" ParentId="17397" CreationDate="2015-10-15T14:15:38.490" Score="2" Body="&lt;p&gt;First drop the &lt;code&gt;format&lt;/code&gt; and &lt;code&gt;concat&lt;/code&gt;, they don't do anything here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;%s&quot; (shell-command-to-string (concat &quot;ls -1 %f&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is essentially the same as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string &quot;ls -1 %f&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;%f&lt;/code&gt; and other %-constructs are only meaningful at the time they are &lt;em&gt;used&lt;/em&gt; to actually generate the frame title from the value of &lt;code&gt;frame-title-format&lt;/code&gt;. But you are using &lt;code&gt;%f&lt;/code&gt; at the time the value of that variable is &lt;em&gt;set&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just because you set the value of &lt;code&gt;frame-title-format&lt;/code&gt; to the value returned by &lt;code&gt;(shell-command-to-string &quot;ls -1 %f&quot;)&lt;/code&gt; doesn't magically assign any special meaning to &lt;code&gt;%f&lt;/code&gt;. So essentially you do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ls -1 %f&#xA;ls: cannot access %f: No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You are calling &lt;code&gt;shell-command-to-string&lt;/code&gt; &lt;em&gt;once&lt;/em&gt;, when you set the value of &lt;code&gt;frame-title-format&lt;/code&gt;. But what you want to do is to add an element which causes &lt;code&gt;shell-command-to-string&lt;/code&gt; to be called &lt;em&gt;every time&lt;/em&gt; the value of &lt;code&gt;frame-title-format&lt;/code&gt; is &lt;em&gt;used&lt;/em&gt;, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-title-format&#xA;      '((:eval (shell-command-to-string &quot;echo -n 'hello frame'&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Moving on to the next issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we have seen above you cannot use &lt;code&gt;%f&lt;/code&gt; because it has no meaning to &lt;code&gt;ls&lt;/code&gt;. But this isn't quite right either:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-title-format&#xA;      '((:eval (shell-command-to-string&#xA;                (format &quot;ls -1 '%s'&quot; buffer-file-name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because only buffers that visit a file have a non-nil &lt;code&gt;buffer-file-name&lt;/code&gt;. So you would have to use something else for other buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-title-format&#xA;      '((:eval (if buffer-file-name&#xA;                   (shell-command-to-string&#xA;                    (format &quot;ls -1 '%s'&quot; buffer-file-name))&#xA;                 &quot;something else&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-10-15T14:15:38.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17401" PostTypeId="1" AcceptedAnswerId="17408" CreationDate="2015-10-15T14:33:11.230" Score="17" ViewCount="1392" Body="&lt;p&gt;A buddy and I are wanting to start writing emacs packages specific for use in our company.  (Trust me, nothing we write will be of much interest to anyone outside -- it's integration with internal tools.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We'd like to make package installation and maintenance as easy as possible and we think this means integration with &lt;code&gt;package.el&lt;/code&gt;.  What do we need to do to set up a repository for such use?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-12-10T06:37:13.713" Title="How can I set up an ELPA server?" Tags="|package-repositories|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17402" PostTypeId="1" AcceptedAnswerId="17406" CreationDate="2015-10-15T14:46:32.870" Score="2" ViewCount="491" Body="&lt;p&gt;When we open bookmarks panel we see the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Bookmark&#xA;- --------&#xA;  mark-1                         ~/work/file-1.txt&#xA;  mark-2                         ~/work/file-2.txt&#xA;  ...&#xA;  mark-n                         ~/work/file-n.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, to open n-th file I need to click &lt;code&gt;&amp;lt;Down&amp;gt;&lt;/code&gt; key n times, algorithm complexity O(n). Supposing, that n &amp;lt; 10, can we attach the keys from 0 to 9 to the appropriate bookmark? So it will look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Bookmark&#xA;- --------&#xA;0  mark-1                         ~/work/file-1.txt&#xA;1  mark-2                         ~/work/file-2.txt&#xA;  ...&#xA;9  mark-9                         ~/work/file-9.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the user clicks the key &lt;code&gt;&amp;lt;n&amp;gt;&lt;/code&gt;, the appropriate file is opened immediately. In this case the complexity becomes O(1) - the user needs to make 1 action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or widening the idea: the user can attach hotkeys to bookmarks, making the number of bookmarks pretty big:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Bookmark&#xA;- --------&#xA;0  mark-1                         ~/work/file-1.txt&#xA;1  mark-2                         ~/work/file-2.txt&#xA;a  mark-a                         ~/work/file-a.txt&#xA;b  mark-b                         ~/work/file-b.txt&#xA;  ...&#xA;z  mark-9                         ~/work/file-z.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2015-10-15T20:09:41.263" Title="Attaching hotkeys to bookmarks" Tags="|key-bindings|bookmarks|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17403" PostTypeId="2" ParentId="17402" CreationDate="2015-10-15T15:04:12.300" Score="0" Body="&lt;p&gt;Not really a direct answer but you can use register:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-register ?e '(file . &quot;~/.emacs&quot;))&#xA;(set-register ?b '(file . &quot;~/.bashrc&quot;))&#xA;(set-register ?c '(file . &quot;~/.emacs.d/lisp/custom.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then C-x r j give the list you wants&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-10-15T15:21:15.437" LastActivityDate="2015-10-15T15:21:15.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17404" PostTypeId="2" ParentId="17280" CreationDate="2015-10-15T15:09:16.953" Score="4" Body="&lt;p&gt;Here is a start. Add to your .emacs file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [f4] 'compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also enter the &quot;f4&quot; and &quot;compile&quot; interactively. Starting out with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x global-set-key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Compile is a generic for running any command in a separate buffer. The default command runs &quot;make&quot;, which may or not be what you want. You have an opportunity to change that and compile will remember what you last typed and keep a history of invocations you've given. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If what you always wanted to run &quot;foo&quot; with no questions asked, you could define a command and bind that instead of &quot;compile&quot; above to f4. The function definition would look like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun compile-run-remake ()&#xA;   &quot;Run `remake -x` in a compilation buffer.&quot;&#xA;   (interactive)&#xA;   (compile &quot;remake -x&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Going further you instead of hard-coding a command like &quot;remake -x&quot; you can pick that out from a constant or a customizable variable. &lt;/p&gt;&#xA;" OwnerUserId="5163" LastActivityDate="2015-10-15T15:09:16.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17405" PostTypeId="2" ParentId="17365" CreationDate="2015-10-15T15:35:44.627" Score="7" Body="&lt;p&gt;Here a example of customization&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-priority-faces '((?A . (:foreground &quot;red&quot; :weight 'bold))&#xA;                           (?B . (:foreground &quot;yellow&quot;))&#xA;                           (?C . (:foreground &quot;green&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2016-04-15T06:39:07.117" LastActivityDate="2016-04-15T06:39:07.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17406" PostTypeId="2" ParentId="17402" CreationDate="2015-10-15T15:51:35.163" Score="4" Body="&lt;p&gt;Are you interested in using only the &lt;code&gt;*Bookmark List*&lt;/code&gt; display to jump to bookmarks, or are you interested in jumping to them from any buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If the former&lt;/strong&gt;, you can bind the keys you want (&lt;code&gt;0&lt;/code&gt; to &lt;code&gt;9&lt;/code&gt; or whatever) in &lt;code&gt;bookmark-bmenu-mode-map&lt;/code&gt; to commands that jump to particular bookmarks or to, say, the &lt;em&gt;Nth&lt;/em&gt; next bookmark.  Or you can just define a command that jumps to the &lt;em&gt;Nth&lt;/em&gt; next bookmark, where you provide &lt;em&gt;N&lt;/em&gt; as the prefix arg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-jump-to-nth-bookmark (n)&#xA;  &quot;Jump to the Nth bookmark after point.&#xA;N is the numeric prefix argument.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (save-excursion&#xA;    (next-line n)&#xA;    (bookmark-jump (bookmark-bmenu-bookmark))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you just want a quick way to get to the line of a particular bookmark (so you can hit &lt;code&gt;RET&lt;/code&gt; there), then you can use &lt;code&gt;C-s&lt;/code&gt; (or any of the other, search-related quick-access commands provided by various libraries) or &lt;code&gt;SPC&lt;/code&gt; with a prefix arg &lt;em&gt;N&lt;/em&gt; to move down &lt;em&gt;N&lt;/em&gt; lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If the latter&lt;/strong&gt;, you can bind keys in the &lt;code&gt;global-map&lt;/code&gt; to commands that jump to specific bookmarks.  Or you can just use &lt;code&gt;bookmark-jump&lt;/code&gt; to jump to any bookmark, choosing the bookmark name using completion.  If all of your bookmark names have a common prefix such as &lt;code&gt;mark-&lt;/code&gt; (I would not recommend that, but that seems to be your case), then completion is as quick as &lt;code&gt;TAB&lt;/code&gt; &lt;em&gt;N&lt;/em&gt;, e.g., &lt;code&gt;TAB 3&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general command to jump to a bookmark is &lt;code&gt;bookmark-jump&lt;/code&gt;.  You can define your own command that jumps to a particular bookmark by passing &lt;code&gt;bookmark-jump&lt;/code&gt; that bookmark name:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-bmk-jump-to-mark-3 ()&#xA;  &quot;Jump to bookmark `mark-3'.&quot;&#xA;  (interactive)&#xA;  (bookmark-jump &quot;mark-3&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note: Library &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; offers many more possibilities for using bookmarks than does vanilla Emacs.&#xA;And as far as completion/narrowing for bookmark commands goes, no library offers as much as does &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt;.  In particular, it extends what &lt;strong&gt;Bookmark+&lt;/strong&gt; offers in many ways.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;BTW, your display of &lt;code&gt;*Bookmark List*&lt;/code&gt; is wrong, in showing your proposed keys in the &lt;code&gt;%&lt;/code&gt; column.  That column is used for marking bookmarks (so you can act on them). It does not indicate key bindings.  Or if you are proposing that it should show a key that jumps to the bookmark on that line, then you would need to rewrite the code that displays &lt;code&gt;*Bookmark List*&lt;/code&gt; accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More importantly, you would need to establish a convention of association of keys with bookmark names, such as the rudimentary one you show (key &lt;code&gt;3&lt;/code&gt; corresponds to bookmark name &lt;code&gt;mark-3&lt;/code&gt;). You could certainly do that for your own use, but it would not be something that would be useful for others, IMO.  Bookmarks take general names for a reason.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-15T16:14:30.317" LastActivityDate="2015-10-15T16:14:30.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17407" PostTypeId="2" ParentId="17391" CreationDate="2015-10-15T17:07:33.160" Score="2" Body="&lt;p&gt;As @Melioratus suggests, you need to indent item contents (including the source block) in order to keep the list in  place:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Instructions&#xA;To do the thing&#xA;  1. Wax on&#xA;  2. Wax off&#xA;  3. From the cmd line&#xA;     #+BEGIN_SRC bash&#xA;     $&amp;gt; cd foo&#xA;     $&amp;gt; bar --out results.txt&#xA;     #+END_SRC&#xA;  4. Lather&#xA;  5. Rinse&#xA;  6. Repeat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-10-15T17:07:33.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17408" PostTypeId="2" ParentId="17401" CreationDate="2015-10-15T17:56:24.157" Score="20" Body="&#xA;&#xA;&lt;p&gt;I set up a local package archive (Emacs 24.5) using &lt;code&gt;package.el&lt;/code&gt; by first creating two directories, &lt;code&gt;pkgs&lt;/code&gt; and &lt;code&gt;local&lt;/code&gt;. (The names don't matter.) The files comprising your packages go in &lt;code&gt;pkgs&lt;/code&gt;, and &lt;code&gt;local&lt;/code&gt; will end up holding your archive. If you want to make an archive available to others, you can expose &lt;code&gt;local&lt;/code&gt; using a web server, but the process is the same as building a local archive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put the following in my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;&#xA;(require 'package-x)&#xA;(defvar local-archive&#xA;  (expand-file-name &quot;local/&quot; user-emacs-directory)&#xA;  &quot;Location of the package archive.&quot;)&#xA;(setq package-archive-upload-base local-archive)&#xA;(add-to-list 'package-archives `(&quot;local&quot; . ,local-archive) t)&#xA;&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I put my archive in my &lt;code&gt;.emacs.d&lt;/code&gt; directory (hence the &lt;code&gt;user-emacs-directory&lt;/code&gt; in the &lt;code&gt;expand-file-name&lt;/code&gt; form) but you can put it anywhere you like. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once this is evaluated, execute &lt;code&gt;M-x package-upload-file&lt;/code&gt; and enter the file name of your package to be installed. This will generate a new package in &lt;code&gt;local&lt;/code&gt;. You will see three new files in there, &lt;code&gt;archive-contents&lt;/code&gt;, &lt;code&gt;yourpackagename-version.el&lt;/code&gt;, and &lt;code&gt;yourpackagename-readme.txt&lt;/code&gt;. Now you should be able to do &lt;code&gt;M-x package-list-packages&lt;/code&gt; and see your package listed. With luck, they'll be at the top marked &quot;new&quot;. You can install the package as usual, and you will see it show up in your &lt;code&gt;.emacs.d/elpa&lt;/code&gt; directory just like any other package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should work out of the box for Emacs 24. I'm not sure about earlier versions. Your users can access your package in the usual way by including &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;(add-to-list 'package-archives &#xA;  '(&quot;archive&quot; . &quot;http://yourdomain.com/path-to-local-dir/&quot;))&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in their &lt;code&gt;init.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For information on how to write a package, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Packaging.html#Packaging&quot;&gt;Preparing Lisp code for distribution&lt;/a&gt; in the GNU Emacs Lisp manual.&lt;/p&gt;&#xA;" OwnerUserId="9503" LastEditorUserId="115" LastEditDate="2015-10-15T19:33:08.427" LastActivityDate="2015-10-15T19:33:08.427" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17409" PostTypeId="1" CreationDate="2015-10-15T19:15:59.880" Score="3" ViewCount="517" Body="&lt;p&gt;I'm using the answer from &lt;a href=&quot;https://stackoverflow.com/questions/13559061/emacs-how-to-keep-the-indentation-level-of-a-very-long-wrapped-line&quot;&gt;https://stackoverflow.com/questions/13559061/emacs-how-to-keep-the-indentation-level-of-a-very-long-wrapped-line&lt;/a&gt; but can't make it do exactly what I want&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have this long line of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if some_condition:&#xA;then&#xA;    some very long long long long long long long line&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'visual-line-mode-hook 'adaptive-wrap-prefix-mode)&#xA;(visual-line-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it turns to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if some_condition:&#xA;then&#xA;    some very long long long long long&#xA;    long long line&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I would like this to turn to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if some_condition:&#xA;then&#xA;    some very long long long long long&#xA;    ... long long line&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq wrap-prefix &quot;... &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9845" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-15T19:15:59.880" Title="Line wrapping with prefix" Tags="|wrapping|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17410" PostTypeId="2" ParentId="9322" CreationDate="2015-10-15T20:09:23.097" Score="1" Body="&lt;p&gt;I use the following rebind of q in ediff. If any of the buffers are modified, it asks if they are to be saved, then it just quits. If no buffers are modified, it just quits.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'ediff-startup-hook&#xA;          (lambda ()&#xA;            (local-set-key (kbd&quot;q&quot;) 'my-ediff-quit)))&#xA;&#xA;(defun my-ediff-quit ()&#xA;  &quot;If any of the ediff buffers have been modified, ask if changes&#xA;should be saved. Then quit ediff normally, without asking for&#xA;confirmation&quot;&#xA;  (interactive)&#xA;  (ediff-barf-if-not-control-buffer)&#xA;  (let* ((buf-a ediff-buffer-A)&#xA;         (buf-b ediff-buffer-B)&#xA;         (buf-c ediff-buffer-C)&#xA;         (ctl-buf (current-buffer))&#xA;         (modified (remove-if-not 'buffer-modified-p&#xA;                                  (list buf-a buf-b buf-c))))&#xA;    (let ((save (if modified (yes-or-no-p &quot;Save changes?&quot;)nil)))&#xA;      (loop for buf in modified do&#xA;            (progn&#xA;              (set-buffer buf)&#xA;              (if save&#xA;                  (save-buffer)&#xA;                (set-buffer-modified-p nil))))&#xA;      (set-buffer ctl-buf)&#xA;      (ediff-really-quit nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3858" LastActivityDate="2015-10-15T20:09:23.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17411" PostTypeId="2" ParentId="17402" CreationDate="2015-10-15T20:09:41.263" Score="3" Body="&lt;p&gt;Just to highlight another approach from the comments: you can use a library such as &lt;code&gt;ace-jump&lt;/code&gt; or &lt;code&gt;avy&lt;/code&gt;. These libraries are not specific to bookmarks, but provide a general way to jump to a specific location in the visible window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with &lt;code&gt;avy&lt;/code&gt; you could use the command &lt;code&gt;avy-goto-line&lt;/code&gt;. When invoked this command adds a number or character (depending on configuration) to each visible line. You can use that prefix to jump directly to a specific line. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-10-15T20:09:41.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17412" PostTypeId="2" ParentId="17316" CreationDate="2015-10-15T20:40:59.190" Score="2" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-kill-ediff-buffers ()&#xA;  (kill-buffer ediff-buffer-A)&#xA;  (kill-buffer ediff-buffer-B)&#xA;  (kill-buffer ediff-buffer-C))&#xA;&#xA;(add-hook 'ediff-quit-hook 'my-kill-ediff-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this will always kill ediff-buffers, even if they weren't opened by ediff e.g. you called &lt;code&gt;ediff-buffers&lt;/code&gt; with some buffers you had open to start with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to you could also kill &lt;code&gt;*ediff-errors*&lt;/code&gt;, &lt;code&gt;*ediff-diff*&lt;/code&gt;, &lt;code&gt;*Ediff-Registry*&lt;/code&gt; and &lt;code&gt;*ediff-fine-diff*&lt;/code&gt; as well, but those generally don't bother me.&lt;/p&gt;&#xA;" OwnerUserId="3858" LastActivityDate="2015-10-15T20:40:59.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17413" PostTypeId="1" AcceptedAnswerId="17414" CreationDate="2015-10-15T21:10:34.397" Score="3" ViewCount="156" Body="&lt;p&gt;Trying to solve the &lt;a href=&quot;https://emacs.stackexchange.com/q/17402/2389&quot;&gt;problem of hotkeys for bookmarks&lt;/a&gt; I decided to create a primitive version first. I wanted to attach bookmarks to keys &lt;code&gt;&amp;lt;1&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;2&amp;gt;&lt;/code&gt;: when a certain key is pressed, I open the appropriate bookmark. But unfortunately the hook is not called when bookmarks list is opened. I have different functions bound to these keys:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 - bookmark-bmenu-1-window&lt;/li&gt;&#xA;&lt;li&gt;2 - bookmark-bmenu-2-window&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3&gt;Code&lt;/h3&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun jump-to-1th-bookmark ()&#xA;  (bookmark-jump &amp;quot;2015.txt&amp;quot;))&#xA;&#xA;(defun jump-to-2nd-bookmark ()&#xA;  (bookmark-jump &amp;quot;emd&amp;quot;))&#xA;&#xA;(defun my-bookmark-mode ()&#xA;      (local-set-key (kbd &amp;quot;1&amp;quot;) 'jump-to-1th-bookmark)&#xA;      (local-set-key (kbd &amp;quot;2&amp;quot;) 'jump-to-2nd-bookmark)&#xA;      )&#xA;&#xA;(add-hook 'bookmark-bmenu-mode 'my-bookmark-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;How can I bind my functions instead of default?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-16T17:41:22.483" Title="Can't establish a hook for bookmark-bmenu-mode" Tags="|key-bindings|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17414" PostTypeId="2" ParentId="17413" CreationDate="2015-10-15T23:01:10.227" Score="6" Body="&lt;p&gt;Just bind the keys in the keymap used by the mode of buffer &lt;code&gt;*Bookmark List*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what mode keymaps are for.  There is no need to use the mode hook.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;bookmark&quot;&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;1&quot;) 'jump-to-1th-bookmark)&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;2&quot;) 'jump-to-2nd-bookmark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="115" LastEditDate="2015-10-16T17:41:22.483" LastActivityDate="2015-10-16T17:41:22.483" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17415" PostTypeId="1" AcceptedAnswerId="17416" CreationDate="2015-10-15T23:16:47.553" Score="1" ViewCount="472" Body="&lt;p&gt;I have bound the &lt;code&gt;eval-region&lt;/code&gt; function to &lt;code&gt;H-x&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to use this to simply highlight selected code and evaluate - simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working in a Python script I have the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def test(this, that):&#xA;    output = this * that&#xA;    return output&#xA;&#xA;print test(2,4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I highlight it and press &lt;code&gt;H-x&lt;/code&gt;, I get the error message: &lt;strong&gt;&quot;Symbols' value as variable is void: def&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still having the same code highlighted, in the Python dropdown in the menu bar I click on &quot;eval region&quot; and I get the expected output (i.e. &lt;code&gt;8&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Void-Variables.html&quot; rel=&quot;nofollow&quot;&gt;an explanation&lt;/a&gt; of void variables, but I don't really understand it all - I just want &lt;code&gt;H-x&lt;/code&gt; to perform &lt;code&gt;eval-region&lt;/code&gt; as clicking on the menu-bar version does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know a fix, work-around or the required setup?&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="9558" LastEditDate="2015-10-16T13:33:27.630" LastActivityDate="2015-10-16T19:51:49.553" Title="Are keybindings mode-dependent? How can I customize this?" Tags="|key-bindings|functions|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17416" PostTypeId="2" ParentId="17415" CreationDate="2015-10-16T01:30:02.277" Score="7" Body="&lt;p&gt;What you want is to change what &lt;code&gt;H-x&lt;/code&gt; does when in &lt;code&gt;python-mode&lt;/code&gt; so that instead of running &lt;code&gt;eval-region&lt;/code&gt; (which only works on elisp) it calls &lt;code&gt;python-shell-send-region&lt;/code&gt;.  You can use &lt;code&gt;define-key&lt;/code&gt; to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'python&#xA;  (define-key python-mode-map (kbd &quot;H-x&quot;) #'python-shell-send-region))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="115" LastEditDate="2015-10-16T19:51:49.553" LastActivityDate="2015-10-16T19:51:49.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17417" PostTypeId="1" AcceptedAnswerId="17419" CreationDate="2015-10-16T02:34:59.943" Score="8" ViewCount="1840" Body="&lt;p&gt;I use eww to open an image from wikipedia:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://upload.wikimedia.org/wikipedia/commons/6/6a/The_Burning_of_the_Houses_of_Parliament.jpg&quot; rel=&quot;noreferrer&quot;&gt;https://upload.wikimedia.org/wikipedia/commons/6/6a/The_Burning_of_the_Houses_of_Parliament.jpg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I wanted to save it to my computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="9144" LastEditorUserId="105" LastEditDate="2015-10-16T05:31:35.427" LastActivityDate="2015-10-16T05:31:35.427" Title="How to save images from buffer?" Tags="|images|eww|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17418" PostTypeId="2" ParentId="13311" CreationDate="2015-10-16T03:28:18.230" Score="8" Body="&lt;p&gt;This can be done by creating a custom function that checks to see whether it's on an org-heading. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-blank-before-new-entry&#xA;      '((heading . always)&#xA;       (plain-list-item . nil)))&#xA;&#xA;(defun call-rebinding-org-blank-behaviour (fn)&#xA;  (let ((org-blank-before-new-entry&#xA;         (copy-tree org-blank-before-new-entry)))&#xA;    (when (org-at-heading-p)&#xA;      (rplacd (assoc 'heading org-blank-before-new-entry) nil))&#xA;    (call-interactively fn)))&#xA;&#xA;(defun smart-org-meta-return-dwim ()&#xA;  (interactive)&#xA;  (call-rebinding-org-blank-behaviour 'org-meta-return))&#xA;&#xA;(defun smart-org-insert-todo-heading-dwim ()&#xA;  (interactive)&#xA;  (call-rebinding-org-blank-behaviour 'org-insert-todo-heading))&#xA;&#xA;(define-key org-mode-map (kbd &quot;M-&amp;lt;return&amp;gt;&quot;) 'smart-org-meta-return-dwim) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-10-16T03:28:18.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17419" PostTypeId="2" ParentId="17417" CreationDate="2015-10-16T04:16:00.887" Score="5" Body="&lt;p&gt;As far as I can tell &lt;code&gt;*eww*&lt;/code&gt; buffers store image data in the &lt;code&gt;display&lt;/code&gt; text property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to save an image we need to get this property and save it to a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sketch of a solution.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-eww-save-image (filename)&#xA;  &quot;Save an image opened in an *eww* buffer to a file.&quot;&#xA;  (interactive &quot;G&quot;)&#xA;  (let ((image (get-text-property (point-min) 'display)))&#xA;    (with-temp-buffer&#xA;      (setq buffer-file-name filename)&#xA;      (insert&#xA;       (plist-get (if (eq (car image) 'image) (cdr image)) :data))&#xA;      (save-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code seems to work in the case I tested it on, but it has at least two flaws:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It cannot detect the file type or the file name, so you have to specify the file name with an extension.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;save-buffer&lt;/code&gt; calls hooks in &lt;code&gt;before-save-hooks&lt;/code&gt; and &lt;code&gt;after-save-hooks&lt;/code&gt;, which does not really make sense here.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you know how to improve this, please go right ahead.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2015-10-16T04:16:00.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17420" PostTypeId="1" AcceptedAnswerId="17421" CreationDate="2015-10-16T07:38:45.997" Score="6" ViewCount="1447" Body="&lt;p&gt;This code opens 1-st &amp;amp; 2-nd bookmarks when 1 &amp;amp; 2 keys are pressed on bookmarks page:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jump-to-n-th-bookmark (n)&#xA;  (let ((bookmarks (sort (bookmark-all-names) 'string&amp;lt;)))&#xA;    (bookmark-jump (nth n bookmarks))&#xA;    )&#xA;  )&#xA;&#xA;(defun jump-to-1th-bookmark ()&#xA;  (interactive)&#xA;  (jump-to-n-th-bookmark 0))&#xA;&#xA;(defun jump-to-2nd-bookmark ()&#xA;  (interactive)&#xA;  (jump-to-n-th-bookmark 1))&#xA;&#xA;(defun my-bookmark-mode ()&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;1&quot;) 'jump-to-1th-bookmark)&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;2&quot;) 'jump-to-2nd-bookmark))&#xA;&#xA;(add-hook 'bookmark-bmenu-mode-hook 'my-bookmark-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can we get rid of &lt;code&gt;jump-to-1th-bookmark&lt;/code&gt; and &lt;code&gt;jump-to-2nd-bookmark&lt;/code&gt; functions and have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-bookmark-mode ()&#xA;  ;pass a parameter together with function&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;1&quot;) 'jump-to-n-th-bookmark 0)&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;2&quot;) 'jump-to-n-th-bookmark 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2389" LastEditorUserId="105" LastEditDate="2022-09-18T17:40:14.757" LastActivityDate="2022-09-18T17:40:14.757" Title="How to pass a parameter together with function" Tags="|key-bindings|functions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17421" PostTypeId="2" ParentId="17420" CreationDate="2015-10-16T10:43:17.723" Score="7" Body="&#xA;&#xA;&lt;p&gt;Not out of the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, we can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/lambda.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;lambda&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key my-map my-key (lambda () (interactive) (jump... ...)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can even create a macro:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro defkey-arg (map key func &amp;amp;rest args)&#xA; `(define-key ,map ,key (lambda () (interactive) (,func ,@args))))&#xA;&#xA;(defkey-arg bookmark-bmenu-mode-map (kbd &quot;1&quot;) jump-to-n-th-bookmark 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: in your specific case it makes much more sense to make &lt;code&gt;jump-to-n-th-bookmark&lt;/code&gt; interactive:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jump-to-n-th-bookmark (n)&#xA;  (intractive &quot;p&quot;)&#xA;  (let ((bookmarks (sort (bookmark-all-names) 'string&amp;lt;)))&#xA;    (bookmark-jump (nth n bookmarks))))&#xA;(define-key bookmark-bmenu-mode-map (kbd &quot;j&quot;) 'jump-to-n-th-bookmark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;now you can jump to 3rd bookmark using &lt;kbd&gt;3 j&lt;/kbd&gt; (assuming that the &lt;code&gt;bookmark-bmenu-mode&lt;/code&gt; is derived from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;special-mode&lt;/code&gt;&lt;/a&gt; which binds digits to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;digit-argument&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="115" LastEditDate="2015-10-16T14:49:01.830" LastActivityDate="2015-10-16T14:49:01.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17422" PostTypeId="2" ParentId="17420" CreationDate="2015-10-16T12:31:08.363" Score="3" Body="&#xA;&#xA;&lt;p&gt;One approach is to check the last keyboard event, this way you can bind the same command to all numeric keys.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jump-to-n-th-bookmark (n)&#xA;  (interactive (list (- last-command-event ?0)))&#xA;  (let ((bookmarks (sort (bookmark-all-names) 'string&amp;lt;)))&#xA;  (bookmark-jump (nth n bookmarks))))&#xA;&#xA;(defun my-bookmark-mode ()&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;1&quot;) 'jump-to-n-th-bookmark)&#xA;  (define-key bookmark-bmenu-mode-map (kbd &quot;2&quot;) 'jump-to-n-th-bookmark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can still call &lt;code&gt;jump-to-n-th-bookmark&lt;/code&gt; with an explicit number, but when called interactively, it expects it be bound to a key sequence ending in a number key.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="115" LastEditDate="2015-10-16T14:49:19.567" LastActivityDate="2015-10-16T14:49:19.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17423" PostTypeId="1" CreationDate="2015-10-16T15:14:53.393" Score="2" ViewCount="123" Body="&lt;p&gt;I am using &quot;emacs 24.4.1; htmlfontify 0.21&quot; and try to htmlfontify a ansi-term buffer. But the style in the generated HTML file does not contain colors. This is how it looks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;span.term-bold-0004   { font-size: 105%;  text-decoration: none; }&#xA;span.term-bold-0004 a { font-size: 105%;  text-decoration: underline; }&#xA;span.term-bold-0006   { font-size: 105%;  text-decoration: none; }&#xA;span.term-bold-0006 a { font-size: 105%;  text-decoration: underline; }&#xA;span.term-bold-0003   { font-size: 105%;  text-decoration: none; }&#xA;span.term-bold-0003 a { font-size: 105%;  text-decoration: underline; }&#xA;span.term-bold-0007   { font-size: 105%;  text-decoration: none; }&#xA;span.term-bold-0007 a { font-size: 105%;  text-decoration: underline; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I htmlfontify a source file the CSS contains the colors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;span.function-name   { color: #0000ff;  font-family: Lucida Console;  font-stretch: semi-condensed;  font-weight: 500;  font-style: normal;  background: #ffffff;  font-size: 14pt;  text-decoration: none; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What do I have to do to get the colors from the ansi-term right?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2015-10-16T15:14:53.393" Title="How to htmlfontify an ansi-term buffer?" Tags="|ansi-term|htmlfontify|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17426" PostTypeId="2" ParentId="17415" CreationDate="2015-10-16T16:29:17.320" Score="0" Body="&lt;p&gt;The answer from @erikstokes is the correct one (hence why I have accepted it), however in order to get it to work in my init (.emacs) file, I had to define it first as a hook. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (define-key python-mode-map (kbd &quot;H-x&quot;)&#xA;                        'python-shell-send-region)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows it to load and then be called upon in python-mode, and doesn't require a python-mode to already be active (hence making in work from my one large init file. [I know it makes sense to break an init file up into sub-files, but I haven't got round to that yet]&lt;/p&gt;&#xA;" OwnerUserId="9558" LastActivityDate="2015-10-16T16:29:17.320" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17427" PostTypeId="1" CreationDate="2015-10-16T16:38:39.823" Score="2" ViewCount="243" Body="&lt;p&gt;Is it possible to include Babel header lines when publishing Org-mode files to HTML with &lt;code&gt;org-html-publish-to-html&lt;/code&gt;? I would like to have the org-mode keywords exported in addition to the code. Ideally I would like to have a choice of what keywords get published (e.g., &lt;code&gt;#+NAME:&lt;/code&gt;, &lt;code&gt;#+BEGIN_SRC&lt;/code&gt;, but not &lt;code&gt;#+RESULTS&lt;/code&gt;). For a bit of background, I have an org-mode file with multi-language code blocks. I would like to show the results from one code block are input into other code blocks. I see there are &lt;a href=&quot;http://orgmode.org/manual/Publishing-options.html&quot; rel=&quot;nofollow&quot;&gt;many options&lt;/a&gt;, but apart from &quot;todo&quot;, none reference keyword export.&lt;/p&gt;&#xA;" OwnerUserId="8424" LastActivityDate="2015-10-16T20:30:51.430" Title="Is it possible to include Babel header line when publishing Org-mode files to HTML?" Tags="|org-mode|org-babel|org-publish|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17428" PostTypeId="1" AcceptedAnswerId="17653" CreationDate="2015-10-16T19:21:05.987" Score="0" ViewCount="162" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32)&#xA;of 2015-07-25 on KAEL&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Compiled from EmacsW64.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Direx, using the latest version of Direx from MELPA&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows 7 x64 bit.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I would like to try the package &lt;a href=&quot;https://github.com/m2ym/direx-el&quot; rel=&quot;nofollow&quot;&gt;Direx&lt;/a&gt;, but the documentation is not very clear.When I installed Direx, I try to start it wih &lt;kbd&gt;M-x Direx:jump-to-directory&lt;/kbd&gt; but I get a unclear message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cl-call-next-method: cl-call-next-method only allowed inside primary and around methods&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When googling around, I found this &lt;a href=&quot;https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-06/msg00473.html&quot; rel=&quot;nofollow&quot;&gt;thread&lt;/a&gt; but it's difficult to understand how this error occured in a package. It's more related with common Lisp than the package itself, it seems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried again with the empty Emacs configuration (&lt;code&gt;emacs -q&lt;/code&gt;), I still  get the same message. It's unclear to me what I do need to solve this error, in order to get Direx working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Direx is downloaded more than 10.000 times ,but I don't know how I could call Direx. The commands for Direx seems obfuscated to me. Seems I am the only one with this bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-10-23T20:09:24.883" LastActivityDate="2015-10-25T21:41:33.963" Title="Direx not working, cl-call-next-method only inside primary and around methods" Tags="|common-lisp|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17429" PostTypeId="2" ParentId="17427" CreationDate="2015-10-16T20:07:25.990" Score="4" Body="&lt;h1&gt;Try This&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I use this method to create code examples to write &lt;strong&gt;How To Use &lt;code&gt;org-mode&lt;/code&gt;&lt;/strong&gt; documentation.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Wrap Code Blocks within a New &lt;code&gt;org&lt;/code&gt; Code Block&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-v&lt;/kbd&gt; &lt;kbd&gt;d&lt;/kbd&gt; to create empty &lt;code&gt;org&lt;/code&gt; code block then add &lt;code&gt;#+NAME:&lt;/code&gt; and  &lt;code&gt;:exports code&lt;/code&gt; headers to code block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: org-code-block-wrapper&#xA;#+begin_src org  :exports code &#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Edit &lt;code&gt;org&lt;/code&gt; block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Click inside new &lt;code&gt;org&lt;/code&gt; code block, add a blank line then use &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;'&lt;/kbd&gt; to begin editing.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Add new code blocks with headers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: echo-message&#xA;#+HEADER: :var MESSAGE=&quot;Hello from Shell Code Block!&quot;&#xA;#+begin_src sh&#xA;  echo $MESSAGE&#xA;#+end_src&#xA;&#xA;#+NAME: display-message&#xA;#+HEADER: :var message=&quot;Hello from Ruby Code Block!&quot;&#xA;#+begin_src ruby&#xA;  message&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;'&lt;/kbd&gt; to return to original buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-s&lt;/kbd&gt; to save.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When you're done, any &lt;code&gt;org-mode&lt;/code&gt; syntax will be escaped and ready for export.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: org-code-block-wrapper&#xA;#+begin_src org  :exports code&#xA;&#xA;  ,#+NAME: echo-message&#xA;  ,#+HEADER: :var MESSAGE=&quot;Hello from Shell Code Block!&quot;&#xA;  ,#+begin_src sh&#xA;    echo $MESSAGE&#xA;  ,#+end_src&#xA;&#xA;  ,#+NAME: display-message&#xA;  ,#+HEADER: :var message=&quot;Hello from Ruby Code Block!&quot;&#xA;  ,#+begin_src ruby&#xA;    message&#xA;  ,#+end_src&#xA;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When exported, the code blocks with headers should be displayed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: echo-message&#xA;#+HEADER: :var MESSAGE=&quot;Hello from Shell Code Block!&quot;&#xA;#+begin_src sh&#xA;  echo $MESSAGE&#xA;#+end_src&#xA;&#xA;#+NAME: display-message&#xA;#+HEADER: :var message=&quot;Hello from Ruby Code Block!&quot;&#xA;#+begin_src ruby&#xA;  message&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This method should work with most export formats including html. I wrote this answer in an org file then exported the answer as &lt;code&gt;markdown&lt;/code&gt; to post it to StackExchange.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h2&gt;How To Extract the Original Blocks from within the &lt;code&gt;org&lt;/code&gt; Block Wrapper.&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use add  &lt;code&gt;#+CALL:&lt;/code&gt; syntax with &lt;code&gt;:results drawer replace&lt;/code&gt;, then execute statement with &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will put the original blocks inside a &lt;code&gt;drawer&lt;/code&gt; where they executed with &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CALL: org-code-block-wrapper() :results drawer replace   :exports none &#xA;&#xA;#+RESULTS:&#xA;:RESULTS:&#xA;&#xA;#+NAME: echo-message&#xA;#+HEADER: :var MESSAGE=&quot;Hello from Shell Code Block!&quot;&#xA;#+begin_src sh&#xA;  echo $MESSAGE&#xA;#+end_src&#xA;&#xA;#+NAME: display-message&#xA;#+HEADER: :var message=&quot;Hello from Ruby Code Block!&quot;&#xA;#+begin_src ruby&#xA;  message&#xA;#+end_src&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code Tested with&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-unknown-cygwin, GTK+ Version 3.10.9)&lt;/code&gt;&lt;br&gt;&#xA;  &lt;code&gt;Org-Mode Version: 8.2.10&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2015-10-16T20:30:51.430" LastActivityDate="2015-10-16T20:30:51.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17430" PostTypeId="1" AcceptedAnswerId="17447" CreationDate="2015-10-16T20:55:46.807" Score="5" ViewCount="868" Body="&lt;p&gt;A long time ago I implemented &lt;code&gt;remove-key&lt;/code&gt; to completely undo the effect of &lt;code&gt;define-key&lt;/code&gt;, but when I just tried that implementation, it did not work reliably. How would you implement &lt;code&gt;remove-key&lt;/code&gt; so that for any given key this is true:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((map (make-sparse-keymap)))&#xA;  (define-key map KEY 'bound)&#xA;  (remove-key map KEY)&#xA;  map)&#xA;=&amp;gt; (keymap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It should also work for non-sparse keymaps. And when a sub-keymap is involved which becomes empty when the key is removed, then the sub-keymap should also be removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the documentation - now I only need an implementation :-)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-key (keymap key)&#xA;  &quot;In KEYMAP, remove key sequence KEY.&#xA;Make the event KEY truely undefined in KEYMAP by removing the&#xA;respective element of KEYMAP (or a sub-keymap) as opposed to&#xA;merely setting it's binding to nil.&#xA;&#xA;There are several ways in which a key can be \&quot;undefined\&quot;:&#xA;&#xA;   (keymap (65 . undefined) ; A&#xA;           (66))            ; B&#xA;&#xA;As far as key lookup is concerned A isn't undefined at all, it is&#xA;bound to the command `undefined' (which doesn't do anything but&#xA;make some noise).  This can be used to override lower-precedence&#xA;keymaps.&#xA;&#xA;B's binding is nil which doesn't constitute a definition but does&#xA;take precedence over a default binding or a binding in the parent&#xA;keymap.  On the other hand, a binding of nil does _not_ override&#xA;lower-precedence keymaps; thus, if the local map gives a binding&#xA;of nil, Emacs uses the binding from the global map.&#xA;&#xA;All other events are truly undefined in KEYMAP.&#xA;&#xA;Note that in a full keymap all characters without modifiers are&#xA;always bound to something, the closest these events can get to&#xA;being undefined is being bound to nil like B above.&quot;&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why do I want that? It has already been mentioned in the above doc-string, but here it is again, quoting &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Format-of-Keymaps.html&quot; rel=&quot;noreferrer&quot;&gt;(elisp)Format of Keymaps&lt;/a&gt; (emphasis mine).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;When the binding is &lt;code&gt;nil&lt;/code&gt;&lt;/strong&gt;, it doesn't constitute a definition but &lt;strong&gt;it&#xA;  does take precedence over a default binding or a binding in the parent&#xA;  keymap&lt;/strong&gt;.  On the other hand, a binding of &lt;code&gt;nil&lt;/code&gt; does &lt;em&gt;not&lt;/em&gt; override&#xA;  lower-precedence keymaps; thus, if the local map gives a binding of&#xA;  &lt;code&gt;nil&lt;/code&gt;, Emacs uses the binding from the global map.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key map KEY nil)&lt;/code&gt; does not remove the entry for &lt;code&gt;KEY&lt;/code&gt;, it just sets the binding to &lt;code&gt;nil&lt;/code&gt;, which &quot;doesn't constitute a definition&quot;, but which never-the-less can have an effect.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="105" LastEditDate="2022-09-18T17:39:25.250" LastActivityDate="2022-09-18T17:39:25.250" Title="How to implement remove-key to completely undo the effect of define-key" Tags="|key-bindings|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17431" PostTypeId="1" AcceptedAnswerId="17962" CreationDate="2015-10-16T21:08:51.520" Score="24" ViewCount="11811" Body="&lt;p&gt;I'm using one of the pre-defined custom themes that come bundled with Spacemacs (zenburn).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I modify specific portions of the theme, for example just change the font color used for comments ?&lt;/p&gt;&#xA;" OwnerUserId="9294" LastEditorUserId="9294" LastEditDate="2015-10-17T09:10:48.510" LastActivityDate="2019-03-11T17:40:25.767" Title="How do I change portions of a custom theme?" Tags="|themes|spacemacs|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17432" PostTypeId="1" CreationDate="2015-10-16T21:51:12.690" Score="8" ViewCount="1357" Body="&lt;p&gt;On a high res display, these latex fragments created by &lt;code&gt;C-c C-x C-l&lt;/code&gt; are noticeably blurry compared to the text. I gather that they are processed with imagemagick--how can I tweak it to output higher res images?&lt;/p&gt;&#xA;" OwnerUserId="2207" LastActivityDate="2015-10-16T22:31:28.010" Title="org-preview-latex-fragment in higher resolution" Tags="|org-mode|org-export|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17433" PostTypeId="2" ParentId="17386" CreationDate="2015-10-16T21:56:11.020" Score="4" Body="&lt;p&gt;If you want the exact analogue of &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;, that would be &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; (being the command &lt;code&gt;describe-variable&lt;/code&gt; as opposed to &lt;code&gt;describe-function&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. Type &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt; to see all of the &lt;kbd&gt;C-h&lt;/kbd&gt; bindings (there are a lot, and many of them won't seem useful now, but you should remind yourself what's there every now and again -- some of the &quot;not useful&quot; things may seem rather more useful with the benefit of experience...)&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;In addition:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;apropos-user-option&lt;/code&gt; describes all &lt;em&gt;user options&lt;/em&gt; matching a given pattern.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;apropos-variable&lt;/code&gt; does likewise for &lt;strong&gt;all&lt;/strong&gt; variables (whether or not they are user options).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The difference between a &lt;em&gt;user option&lt;/em&gt; and other variables is whether they are defined with &lt;code&gt;defcustom&lt;/code&gt; or just &lt;code&gt;defvar&lt;/code&gt;. Obviously the two have distinct intended purposes, but it's not &lt;em&gt;necessarily&lt;/em&gt; the case that the variables you may wish to configure will all be defined as user options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. Type &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; &lt;code&gt;apropos&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to see what other kinds of &lt;code&gt;apropos&lt;/code&gt; commands you can use to ask Emacs to tell you useful things. (&lt;code&gt;C-h a&lt;/code&gt; being the default binding for &lt;code&gt;apropos-command&lt;/code&gt; itself).&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;To access the &lt;code&gt;customize&lt;/code&gt; interface for a given library, you typically&lt;sup&gt;1&lt;/sup&gt; use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-group&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;LIBRARY&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; for the LIBRARY in question. That should give you access to all of the &lt;em&gt;user options&lt;/em&gt; of that library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; Some libraries &lt;em&gt;may&lt;/em&gt; divide their user options amongst various different customize groups -- it's really up to the library in question -- but if the library uses sensible (searchable) names for its variables then, between all the methods shown here, you should find everything on offer.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Note that in all cases above, the results are only for currently-loaded (or perhaps auto-loaded) libraries; so make sure that the features you wish to customize are already loaded before you start asking Emacs about the available options.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;And last (but definitely not least), in the manual see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Easy Customization&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Variables&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-10-16T23:50:47.703" LastActivityDate="2015-10-16T23:50:47.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17434" PostTypeId="2" ParentId="17432" CreationDate="2015-10-16T22:31:28.010" Score="4" Body="&lt;p&gt;The variable &lt;code&gt;org-format-latex-options&lt;/code&gt; (use &lt;code&gt;M-x customize-variable org-format-latex-options RET&lt;/code&gt; to customize) is a property list with parameters controlling creation of images for LaTeX fragments. In particular, the &lt;code&gt;:scale&lt;/code&gt; property controls image resolution. The default is &lt;code&gt;1.0&lt;/code&gt;; set to &lt;code&gt;2.0&lt;/code&gt; to double image resolution, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find an option like this one, try &lt;code&gt;M-x customize-group RET Org RET&lt;/code&gt; and look for variables and subgroups that match what you want to adjust. In this case, &lt;code&gt;org-format-latex-options&lt;/code&gt; is in the group &lt;code&gt;Org LaTeX&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Let me know if this works for you: my current machine does not have &lt;code&gt;dvipng&lt;/code&gt; and so I cannot test this solution myself.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2015-10-16T22:31:28.010" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17435" PostTypeId="2" ParentId="604" CreationDate="2015-10-16T23:23:30.197" Score="0" Body="&lt;p&gt;Emacs' &lt;code&gt;package.el&lt;/code&gt; &lt;em&gt;always&lt;/em&gt; downloads the highest versioned package it can find, and I don't know a way to stop it from doing so, in general. You can, however, specify which repository your package comes from, using the &lt;code&gt;package-pinned-packages&lt;/code&gt; variable, available through the customization menu for Emacs &gt;= 24.4. I use it to &quot;pin&quot; packages I use to MELPA Stable rather than MELPA, for example. If you don't, and you update, say, &lt;code&gt;zenburn-theme&lt;/code&gt;, you will always get &lt;code&gt;zenburn-theme&lt;/code&gt; version 20151003.2346 (or whatever version is most current) in MELPA rather than version 2.2 (today's most current) from MELPA Stable. (I have both archives in my &lt;code&gt;package-archives&lt;/code&gt; list.) This way I at least can make Emacs stick to something a package author has marked as a stable version, not the latest commit he or she has made to Github.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This helps with versioning to a small degree, but doesn't really answer your question, since you are trying to keep &lt;code&gt;package.el&lt;/code&gt; from downloading anything that will shadow your built-in package. Unfortunately, &lt;code&gt;package-pinned-packages&lt;/code&gt; will only let you specify a repository listed in &lt;code&gt;package-archives&lt;/code&gt;. Emacs' &quot;built-in&quot; package archive isn't listed there, at least on my Emacs 24.5, so that isn't an option for your situation. (Emacs maintainers: how about putting a &quot;built-in&quot; archive in there by default?) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You say you have a function for batch install of all packages, so presumably you don't mind writing a little lisp code. Emacs 24.5 (and maybe earlier) &lt;code&gt;package.el&lt;/code&gt; has a function &lt;code&gt;package-built-in-p&lt;/code&gt; which will let you test whether a package is built in or not. From the documentation,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Return true if PACKAGE is built-in to Emacs. Optional arg MIN-VERSION, &#xA;if non-nil, should be a version list specifying the minimum acceptable&#xA;version.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lets you specify a minimum acceptable version, but not a maximum acceptable version, or even (I wish) a particular version. You can use it to determine whether a package in your batch list is built-in or not, and exclude it from your list if it is. Or you could just exclude it from your list and uninstall the version you already have in your &lt;code&gt;elpa&lt;/code&gt; directory, as a previous poster suggested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could set up your own &lt;code&gt;local&lt;/code&gt; package archive, put your preferred version in there, and pin your package to &lt;code&gt;local&lt;/code&gt;. This way you get total control over the versioning. See &lt;a href=&quot;https://emacs.stackexchange.com/questions/17401/how-can-i-set-up-an-elpa-server/17408#17408&quot;&gt;How can I set up an Elpa server?&lt;/a&gt; for directions. Now that I think about it, this may be a good idea for many reasons...&lt;/p&gt;&#xA;" OwnerUserId="9503" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-10-16T23:23:30.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17436" PostTypeId="2" ParentId="14043" CreationDate="2015-10-16T23:52:13.803" Score="3" Body="&lt;p&gt;Here are various suggestions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;No elc files.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As stated below, compiling all of the lisp files accounts for at least 10% of the time. One way to disable that is to edit the &lt;em&gt;loaddefs&lt;/em&gt; target in file &lt;code&gt;lisp/Makefile&lt;/code&gt; and change that to: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    $(lisp)/loaddefs.el: $(LOADDEFS)&#xA;          true&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;No compiler optimization or debugger symbol tables&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Currently, I'm passing --with-x-toolkit=no --without-x --without-all to ./configure. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I was able to reduce C compilation time to 1/4 the time (from a little less than minute to 16 seconds) in the &lt;em&gt;src&lt;/em&gt; just changing the default compile flags. The default CFLAGS I got had been: &lt;code&gt;-g -O3&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So use instead &lt;code&gt;CFLAGS=''&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Don't run &lt;code&gt;make install&lt;/code&gt;, but just run the built emacs from inside the &lt;em&gt;src&lt;/em&gt; directory. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As stated below another 10% of the time is in building docs. Although I didn't time it, there is no doubt a lot of time copying files and compressing elisp files in &lt;code&gt;make install&lt;/code&gt;. So don't. If you want to redo the timing charts, run &lt;code&gt;remake --profile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above observations are based on below....&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;First step is to understand where the time is spent to figure out how to reduce it. Fortunately for something like Emacs, I recently wrote (or rather extended) a tool to help you find out. I added a &lt;code&gt;--profile&lt;/code&gt; option to &lt;a href=&quot;https://github.com/rocky/remake&quot; rel=&quot;nofollow&quot;&gt;remake&lt;/a&gt; (a fork of GNU make) which will tell you how much time is spent in specific targets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried that building a recent snapshot and yes it takes about 10 minutes. If you don't have remake installed, I have a &lt;a href=&quot;https://gist.github.com/rocky/e4a5dbcdf800b49c3783&quot; rel=&quot;nofollow&quot;&gt;gist of the profiling information&lt;/a&gt; you can use of my run. I use kcachegrind to display the information but there may be other tools out there for visualization tools. There is a png in the gist which is a screenshot of the run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to the details...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my run, about 20% of the time is spent in building lisp and info files which you don't really need to do. Actually a little more is spent in the lisp files than in the info files. You could probably change the Makefile to skip that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be interesting to compare with emacs 24. My guess is that the sizes of both of these has grown proportionally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is interest (which you can show by upvotes), I'll suggest specific hacks to the Makefile. However this by itself should be enough for someone motivated to work from. &lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-10-20T16:22:19.570" LastActivityDate="2015-10-20T16:22:19.570" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17437" PostTypeId="2" ParentId="16730" CreationDate="2015-10-16T23:59:57.407" Score="5" Body="&lt;p&gt;Sorry to answer late. I didn't see this until now, but I answered a similar question &lt;a href=&quot;https://emacs.stackexchange.com/questions/17401/how-can-i-set-up-an-elpa-server/17408?noredirect=1#comment25914_17408&quot;&gt;How do I set up an Elpa server?&lt;/a&gt; yesterday. Have a look there first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, it's really very easy to set up your own local package archive with Emacs' &lt;code&gt;package-x&lt;/code&gt; feature. My solution above is ten lines of lisp code. Setting up your own MELPA site is a lot of work in comparison. And asking your users to set up and use Quelpa is asking a lot from them. This way, they just use the standard Emacs way... as long as you do the work of setting up a web server to expose your package archive to them.&lt;/p&gt;&#xA;" OwnerUserId="9503" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-10-16T23:59:57.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17438" PostTypeId="1" CreationDate="2015-10-17T10:33:12.980" Score="3" ViewCount="524" Body="&lt;p&gt;I'm trying to install elm-mode using MELPA. When I try to install it I get an error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://melpa.org/packages/dash-20150829.433.el: Not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can install other things, bu not this.&lt;/p&gt;&#xA;" OwnerUserId="9859" LastActivityDate="2024-01-14T05:07:35.873" Title="Can't install elm-mode using MELPA" Tags="|package-repositories|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17439" PostTypeId="1" AcceptedAnswerId="17441" CreationDate="2015-10-17T13:45:27.913" Score="1" ViewCount="3481" Body="&lt;p&gt;Here is my current custom, but I don't know how to customize its face. And it&#xA;only shows branch name, no other status info.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA; (quote&#xA;  ((:eval&#xA;    (if vc-mode&#xA;        (progn&#xA;          (list&#xA;           (propertize &quot; ⭠&quot;&#xA;                       'face '(:foreground &quot;sky blue&quot;))&#xA;           ;; TODO: propertize this. set face height to 75&#xA;           `(vc-mode vc-mode)&#xA;           ))))&#xA;   )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope someone can give out a better solution.&#xA;Or at least tell me how to custom my upper status &lt;code&gt;(vc-mode vc-mode)&lt;/code&gt; face.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2017-05-12T18:20:22.453" Title="How to show git repo status info in mode-line" Tags="|mode-line|git|mode-line-format|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17440" PostTypeId="1" AcceptedAnswerId="17476" CreationDate="2015-10-17T13:59:26.733" Score="1" ViewCount="839" Body="&lt;p&gt;When I'm looking for documentation or information, I press &lt;kbd&gt;C-h&lt;/kbd&gt; and then &lt;kbd&gt;f&lt;/kbd&gt; or &lt;kbd&gt;k&lt;/kbd&gt; or anything else. Then a help window will pop up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if I could configure the help window, that he will pop up on the bottom, instead on right and with much smaller window?&#xA;Is there any property/variable to manage this behaviour? If this is not specificed for the help-mode, then I might develop a package for that.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-18T17:48:22.533" Title="Define the behaviour of help window?" Tags="|window|help|window-splitting|help-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17441" PostTypeId="2" ParentId="17439" CreationDate="2015-10-17T15:06:52.903" Score="5" Body="&lt;p&gt;In git, if you hover the mouse over the mode line portion which starts &quot;Git&quot;, you get more information such as the branch and update status.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks like you've asked about mode line customization before &lt;a href=&quot;https://emacs.stackexchange.com/questions/13652/how-to-customize-mode-line-format?rq=1&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/12840/how-to-show-org-clock-and-org-pomodoro-timer-in-mode-line&quot;&gt;here&lt;/a&gt;, so you should understand how to set values in the mode line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the status of the file, the function you want is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(vc-state (buffer-file-name (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And to get the branch: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(vc-working-revision (buffer-file-name (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-10-17T15:19:18.887" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17442" PostTypeId="2" ParentId="17430" CreationDate="2015-10-17T17:19:57.757" Score="2" Body="&lt;p&gt;You could start with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun remove-key (keymap key)&#xA;  (let ((binding (assq key keymap))&#xA;        (parentbinding (assq key (keymap-parent keymap))))&#xA;    (and binding&#xA;         (not (eq binding parentbinding)) ;Don't change the parent!&#xA;         (delq binding keymap))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will only work for a sparse &lt;code&gt;keymap&lt;/code&gt; and expects &lt;code&gt;key&lt;/code&gt; to be a single key, rather than a key sequence.  [ And it's guaranteed 100% untested, so even for that limited case it might not work.  ]&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-10-17T17:19:57.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17443" PostTypeId="1" CreationDate="2015-10-17T17:25:03.073" Score="0" ViewCount="163" Body="&lt;p&gt;I'm working through SICP and I'm getting tired of defining the square function for the thousandth time, so I'd like to load it (and some others) automatically when I start the repl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Geiser, but if you know how this works in any other REPL I'd switch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Of course there would have to be a way to start the repl without autoloading anything, in case one sets it up to autoload an infinite loop by mistake. But I usually only get these when I try to use a function, not when I define it.)&lt;/p&gt;&#xA;" OwnerUserId="9784" LastActivityDate="2015-10-17T17:25:03.073" Title="How to load defuns automatically at repl start up?" Tags="|repl|scheme|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17444" PostTypeId="1" AcceptedAnswerId="17492" CreationDate="2015-10-17T19:11:52.210" Score="0" ViewCount="91" Body="&lt;p&gt;I use the package &lt;code&gt;image-mode&lt;/code&gt; to view images in a directory. When go to the next image in the same directory, I use a function to go the next image in &lt;code&gt;image-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun find-next-image (&amp;amp;optional backward)&#xA;    &quot;Find the next file (by name) in the current directory.&#xA;With prefix arg, find the previous file.&quot;&#xA;    (interactive &quot;P&quot;)&#xA;    (when buffer-file-name&#xA;    (let* ((file (expand-file-name buffer-file-name))&#xA;            (files (cl-remove-if (lambda (file) (cl-first (file-attributes file)))&#xA;                                (sort (directory-files (file-name-directory file) t nil t) 'string&amp;lt;)))&#xA;            (pos (mod (+ (cl-position file files :test 'equal) (if backward -1 1))&#xA;                    (length files))))&#xA;        (find-file (nth pos files))))&#xA;    (kill-buffer (other-buffer (current-buffer) 1))&#xA;    ) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, sometimes Emacs crashes when he tries to load the next image which happens to be a &lt;code&gt;.gif&lt;/code&gt; image. This Emacs version doesn't have any gif library to handle it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I need to skip &lt;code&gt;.gif&lt;/code&gt;-images and go to the next image after the &lt;code&gt;.gif&lt;/code&gt; image anyway. When looking to the function, he increments the position of the current file with 1. I thinked about it how I could solve this, that in the case of a GIF-image, he will skip it and increment again. But I couldn't figure out how I could write it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE: see the solution below.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-10-19T10:18:23.083" LastActivityDate="2015-10-19T10:18:23.083" Title="How skip gif-images, when going to the next file?" Tags="|images|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="17446" PostTypeId="1" AcceptedAnswerId="17452" CreationDate="2015-10-17T19:31:18.367" Score="7" ViewCount="3303" Body="&lt;p&gt;Is there some mode where emacs fixes a small window with a list of opened buffers? This is what simpler editors have (kate,gedit,etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example from Kate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8c27L.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8c27L.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the left window there is a list of opened files. This is rather independent from the main editing window, while being connected. Some examples: I can maximize the whole set, it doesn't disappear if I split/unsplit the main editing windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Edited for clarity)&lt;/p&gt;&#xA;" OwnerUserId="9864" LastEditorUserId="9864" LastEditDate="2015-10-18T07:38:27.867" LastActivityDate="2015-12-11T00:39:37.070" Title="Permanent window with list of opened buffers" Tags="|window-splitting|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17447" PostTypeId="2" ParentId="17430" CreationDate="2015-10-17T19:56:27.030" Score="3" Body="&lt;p&gt;Eventually I came up with a solution that satisfies me and added it to my &lt;a href=&quot;https://github.com/tarsius/keymap-utils&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;keymap-utils&lt;/code&gt; package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kmu-remove-key (keymap key)&#xA;  &quot;In KEYMAP, remove key sequence KEY.&#xA;Make the event KEY truely undefined in KEYMAP by removing the&#xA;respective element of KEYMAP (or a sub-keymap) as opposed to&#xA;merely setting its binding to nil.&#xA;&#xA;There are several ways in which a key can be \&quot;undefined\&quot;:&#xA;&#xA;   (keymap (65 . undefined) ; A&#xA;           (66))            ; B&#xA;&#xA;As far as key lookup is concerned A isn't undefined at all, it is&#xA;bound to the command `undefined' (which doesn't do anything but&#xA;make some noise).  This can be used to override lower-precedence&#xA;keymaps.&#xA;&#xA;B's binding is nil which doesn't constitute a definition but does&#xA;take precedence over a default binding or a binding in the parent&#xA;keymap.  On the other hand, a binding of nil does _not_ override&#xA;lower-precedence keymaps; thus, if the local map gives a binding&#xA;of nil, Emacs uses the binding from the global map.&#xA;&#xA;All other events are truly undefined in KEYMAP.&#xA;&#xA;Note that in a full keymap all characters without modifiers are&#xA;always bound to something, the closest these events can get to&#xA;being undefined is being bound to nil like B above.&quot;&#xA;  (when (stringp key)&#xA;    (setq key (kmu-parse-key-description key t)))&#xA;  (define-key keymap key nil)&#xA;  (setq key (cl-mapcan (lambda (k)&#xA;                         (if (and (integerp k)&#xA;                                  (/= (logand k ?\M-\0) 0))&#xA;                             (list ?\e (- k ?\M-\0))&#xA;                           (list k)))&#xA;                       key))&#xA;  (if (= (length key) 1)&#xA;      (delete key keymap)&#xA;    (let* ((prefix (vconcat (butlast key)))&#xA;           (submap (lookup-key keymap prefix)))&#xA;      (when (and (not (eq submap 'ESC-prefix))&#xA;                 (= (length submap) 1))&#xA;        (delete (last key) submap)&#xA;        (kmu-remove-key keymap prefix)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The old answer because it discusses some details:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After looking at it again I realized that my existing implementation actually works quite well, but is very picky about the format of the KEY. It has to be a vector in the &quot;internal format&quot;, so &lt;code&gt;[?\C-i]&lt;/code&gt; would work but &lt;code&gt;[(control ?i)]&lt;/code&gt; would not. All elements have to be either integers or symbols.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-key (keymap key)&#xA;  (define-key keymap key nil)&#xA;  (setq key (cl-mapcan (lambda (k)&#xA;                         (if (and (integerp k)&#xA;                                  (/= (logand k ?\M-\^@) 0))&#xA;                             (list ?\e (- k ?\M-\^@))&#xA;                           (list k)))&#xA;                       key))&#xA;  (if (= (length key) 1)&#xA;      (delete key keymap)&#xA;    (let* ((prefix (vconcat (butlast key)))&#xA;           (submap (lookup-key keymap prefix)))&#xA;      (delete (last key) submap)&#xA;      (when (= (length submap) 1)&#xA;        (remove-key keymap prefix)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;?\M-\^@&lt;/code&gt; is Emacs' value for the meta key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make this function less picky about the format of the KEY, this might work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq key (if (stringp key)&#xA;              (edmacro-parse-keys key t)&#xA;            (edmacro-parse-keys (key-description key) t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first line &lt;code&gt;(define-key keymap key nil)&lt;/code&gt; should take care of the case where KEY is part of the full keymap's char-table, assuming this is correct:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that in a full keymap all characters without modifiers are&#xA;  always bound to something, the closest these events can get to&#xA;  being undefined is being bound to nil like B above.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That first line should also prevent the parent keymap from being modified, in the non-char-table case. I do not avoid doing that for a full keymap, because there is no &lt;code&gt;full-keymap-p&lt;/code&gt; predicate. Usually the first element of a full keymap is the char-table, but last I checked that was not actually enforced, a keymap also functions as a full keymap if a later element is a char-table. It just seemed wiser to do some potentially unnecessary work instead of risking getting it wrong.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2019-09-13T11:15:08.707" LastActivityDate="2019-09-13T11:15:08.707" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17448" PostTypeId="2" ParentId="17446" CreationDate="2015-10-17T20:01:25.030" Score="2" Body="&lt;p&gt;The command to open the list of buffers that you want is &lt;code&gt;list-buffers&lt;/code&gt;. It is bound to &lt;code&gt;C-x C-b&lt;/code&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this in your init file, or use &lt;code&gt;M-x customize-option RET special-display-buffer-names&lt;/code&gt; to customize the variable to include an entry for buffer &lt;code&gt;*Buffer List*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'special-display-buffer-names &quot;*Buffer List*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the buffer list will be in its own, dedicated frame.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-17T20:01:25.030" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17449" PostTypeId="1" CreationDate="2015-10-17T20:56:40.633" Score="5" ViewCount="436" Body="&lt;p&gt;Haskell has line comments starting with &lt;code&gt;--&lt;/code&gt; and multiline comments of the form &lt;code&gt;{- ... -}&lt;/code&gt;. I'd like to make auto-fill-mode work for both of those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently line comments are auto-filled correctly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-- abc abc abc abc abc abc abc abc abc abc abc abc abc &#xA;-- abc abc abc abc abc abc abc abc abc &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but multiline comments are not:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{- abc abc abc abc abc abc abc abc abc abc abc abc abc &#xA;{- abc abc abc abc abc abc abc abc abc &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it should be just with spaces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{- abc abc abc abc abc abc abc abc abc abc abc abc abc &#xA;   abc abc abc abc abc abc abc abc abc &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;current settings are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'comment-start) &quot;-- &quot;)&#xA;(set (make-local-variable 'comment-padding) 0)&#xA;(set (make-local-variable 'comment-start-skip) &quot;[-{]-[ \t]*&quot;)&#xA;(set (make-local-variable 'comment-end) &quot;&quot;)&#xA;(set (make-local-variable 'comment-end-skip) &quot;[ \t]*\\(-}\\|\\s&amp;gt;\\)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to set this up so that comment auto-fill works for both kinds of comments?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More about Haskell Mode: &lt;a href=&quot;https://github.com/haskell/haskell-mode&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/haskell/haskell-mode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2022-09-18T17:38:59.817" LastActivityDate="2022-09-18T17:38:59.817" Title="How to setup comment-start and comment-start-skip?" Tags="|comment|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17450" PostTypeId="1" AcceptedAnswerId="17451" CreationDate="2015-10-17T21:23:44.807" Score="1" ViewCount="3922" Body="&lt;p&gt;How do I make Emacs give me live feedback on my syntax?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like, after I finish typing a line of code, how can I make it so that Emacs tells me if that line isn't using correct syntax?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in Eclipse, it'll tell you before you compile when a line is not correct (in Java, at least). How can I mimic that behavior in Java, C, etc. for Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running Emacs 24 in Terminal by the way. Installed via HomeBrew on OSX.&lt;/p&gt;&#xA;" OwnerUserId="5451" LastEditorUserId="2274" LastEditDate="2015-10-17T23:30:29.040" LastActivityDate="2015-10-17T23:30:29.040" Title="Emacs Live Syntax/Error Highlighting" Tags="|syntax-highlighting|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17451" PostTypeId="2" ParentId="17450" CreationDate="2015-10-17T23:29:19.527" Score="2" Body="&lt;p&gt;Emacs has a built-in mode called &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Flymake.html&quot; rel=&quot;nofollow&quot;&gt;FlyMake&lt;/a&gt; that can do this, provided you have a properly configured &lt;code&gt;makefile&lt;/code&gt;.  Turn flymake on with &lt;code&gt;M-x flymake-mode&lt;/code&gt;.  It runs an external command (by default &lt;code&gt;make check-syntax&lt;/code&gt;) collects the errors and warnings and highlights the buffer appropriately.  It works pretty well for C and with some effort can be configured for other languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also an external package &lt;a href=&quot;https://github.com/flycheck/flycheck&quot; rel=&quot;nofollow&quot;&gt;Flycheck&lt;/a&gt; that you can install with &lt;code&gt;M-x package-install flycheck&lt;/code&gt;.  Turn it on with &lt;code&gt;M-x flycheck-mode&lt;/code&gt;.  With most languages it Just Works with no further configuration.  You may need to install some external tool (for example &lt;code&gt;pylint&lt;/code&gt; to check Python code).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-10-17T23:29:19.527" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17452" PostTypeId="2" ParentId="17446" CreationDate="2015-10-18T00:29:37.017" Score="8" Body="&lt;p&gt;&lt;kbd&gt;M-x speedbar&lt;/kbd&gt; and typing &lt;kbd&gt;b&lt;/kbd&gt; (buffer display mode).  This gives you a narrow dedicated frame with the required information. &lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2015-10-18T00:29:37.017" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17453" PostTypeId="1" AcceptedAnswerId="17455" CreationDate="2015-10-18T01:34:14.807" Score="0" ViewCount="320" Body="&lt;p&gt;In this function definition &lt;a href=&quot;https://github.com/bbatsov/projectile/blob/master/projectile.el#L2260-L2271&quot; rel=&quot;nofollow&quot;&gt;snippet&lt;/a&gt;, a call to &lt;code&gt;switch-project-action&lt;/code&gt; is done without any arguments. How does it switch to the correct project?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-switch-project-by-name (project-to-switch &amp;amp;optional arg)&#xA;  &quot;Switch to project by project name PROJECT-TO-SWITCH.&#xA;Invokes the command referenced by `projectile-switch-project-action' on switch.&#xA;With a prefix ARG invokes `projectile-commander' instead of&#xA;`projectile-switch-project-action.'&quot;&#xA;  (let* ((default-directory project-to-switch)&#xA;         (switch-project-action (if arg&#xA;                                    'projectile-commander&#xA;                                  projectile-switch-project-action)))&#xA;    (run-hooks 'projectile-before-switch-project-hook)&#xA;    (funcall switch-project-action)&#xA;    (run-hooks 'projectile-after-switch-project-hook)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="251" LastActivityDate="2015-10-18T02:10:42.640" Title="In projectile.el's source code, how does switch-project-action &quot;know&quot; which project to switch to?" Tags="|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17454" PostTypeId="1" CreationDate="2015-10-18T02:09:03.493" Score="4" ViewCount="444" Body="&lt;p&gt;I want to make it so that I have interactive functions that can only be called from buffers in a certain directory, like variables in &lt;code&gt;.dir-locals.el&lt;/code&gt;. Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say I'm writing a program that has configuration files. I'd like to be able to invoke &lt;code&gt;M-x new-conf&lt;/code&gt;, which will make a new conf file in the same directory as the buffer I invoke it in. However, I only want to be able to call it from buffers in a certain directory.&lt;/p&gt;&#xA;" OwnerUserId="9787" LastEditorUserId="9787" LastEditDate="2015-10-18T04:32:57.447" LastActivityDate="2015-10-19T21:58:44.750" Title="How can I make an interactive function be local to directories?" Tags="|interactive|directory-local-variables|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17455" PostTypeId="2" ParentId="17453" CreationDate="2015-10-18T02:10:42.640" Score="2" Body="&lt;p&gt;The current project is determined by the value of &lt;code&gt;default-directory&lt;/code&gt;, which is let-bound to &quot;switch&quot; projects before calling the action.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-10-18T02:10:42.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17456" PostTypeId="1" AcceptedAnswerId="17457" CreationDate="2015-10-18T05:09:04.213" Score="1" ViewCount="194" Body="&lt;p&gt;I'd like to create a hash table with data already in it. I know I can do so as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((my-table (make-hash-table)))&#xA;  (puthash 'k1 'v1 my-table)&#xA;  (puthash 'k2 'v2 my-table)&#xA;  (puthash 'k3 'v3 my-table)&#xA;  my-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But there's a lot of boilerplate here. Compare to creating the same table in, for example, Clojure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{'k1 'v1 'k2 'v2 'k3 'v3}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a more concise way to create a hash table with data in it?&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-10-18T05:09:04.213" Title="What's the most concise way to make a hash table with data in it?" Tags="|hash-tables|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17457" PostTypeId="2" ParentId="17456" CreationDate="2015-10-18T05:09:04.213" Score="4" Body="&lt;p&gt;You can use the printed representation for a hash table. From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Hash.html&quot; rel=&quot;nofollow&quot;&gt;Emacs documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can also create a new hash table using the printed representation&#xA;  for hash tables. The Lisp reader can read this printed representation,&#xA;  provided each element in the specified hash table has a valid read&#xA;  syntax (see Printed Representation). For instance, the following&#xA;  specifies a new hash table containing the keys key1 and key2 (both&#xA;  symbols) associated with val1 (a symbol) and 300 (a number)&#xA;  respectively.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#s(hash-table size 30 data (key1 val1 key2 300))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It goes on with a warning for certain data types:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that you cannot specify a hash table whose initial contents&#xA;  include objects that have no read syntax, such as buffers and frames.&#xA;  Such objects may be added to the hash table after it is created.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So we can create the same hash table as the question in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#s(hash-table data (k1 v1 k2 v2 k3 v3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any attributes not provided (that is, &lt;code&gt;size&lt;/code&gt;, &lt;code&gt;test&lt;/code&gt;, &lt;code&gt;rehash-size&lt;/code&gt;, and &lt;code&gt;rehash-threshold&lt;/code&gt;) are set to their default values.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-10-18T05:09:04.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17458" PostTypeId="1" CreationDate="2015-10-18T05:32:24.907" Score="0" ViewCount="610" Body="&lt;p&gt;I want to bind evil leader keys for  &lt;code&gt;org-edit-src-save&lt;/code&gt; and &lt;code&gt;org-edit-src-exit&lt;/code&gt; in &lt;code&gt;org-src-mode&lt;/code&gt;. And I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-leader/set-key-for-mode 'org-src-mode&#xA;  &quot;s&quot; 'org-edit-src-save&#xA;  &quot;'&quot; 'org-edit-src-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work.  What's wrong with my code?&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2016-08-22T10:34:41.240" Title="How to bind evil-leader keys for org-src-mode?" Tags="|org-mode|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17459" PostTypeId="1" CreationDate="2015-10-18T07:41:23.227" Score="2" ViewCount="1107" Body="&lt;p&gt;How to programmatically insert a text verbatim?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following function inserts &lt;code&gt;ocumentclass&lt;/code&gt; and not &lt;code&gt;\documentclass&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo () (interactive)&#xA;(insert &quot;\documentclass&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course one can use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun foo () (interactive)&#xA;    (insert &quot;\\documentclass&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to correctly insert &lt;code&gt;\documentclass&lt;/code&gt;. But I am wondering if there is a way to directly insert a text verbatim without modifying it at all (e.g. without changing its special characters).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2022-09-18T17:38:41.963" LastActivityDate="2022-09-18T17:38:41.963" Title="How to include a text verbatim in Emacs Lisp?" Tags="|string|insert|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17460" PostTypeId="1" AcceptedAnswerId="17461" CreationDate="2015-10-18T09:50:55.167" Score="2" ViewCount="678" Body="&lt;p&gt;If I open emacs and do a &lt;kbd&gt;C-c C-x C-k&lt;/kbd&gt; I get the message, &lt;code&gt;No active or recent clock task&lt;/code&gt;. In such a case, where I have not yet clocked a task since I started emacs, can I instead get &lt;code&gt;org-clock-goto&lt;/code&gt; to find the most recently clocked task from the files in my agenda list?&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-10-18T11:43:21.670" Title="Why can't 'org-clock-goto' find most recently clocked task in a fresh session?" Tags="|org-mode|org-clock|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17461" PostTypeId="2" ParentId="17460" CreationDate="2015-10-18T10:12:14.200" Score="2" Body="&lt;p&gt;Here is code to always save clock session info to file.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; To save the clock history across Emacs sessions, use&#xA;(if (file-exists-p org-clock-persist-file)&#xA;    ;; (setq org-clock-persist 'history)&#xA;    (org-clock-persistence-insinuate)&#xA;  (shell-command (concat &quot;touch &quot; org-clock-persist-file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2015-10-18T11:43:21.670" LastActivityDate="2015-10-18T11:43:21.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17462" PostTypeId="2" ParentId="3056" CreationDate="2015-10-18T10:21:54.577" Score="0" Body="&lt;p&gt;Emacs themes can be used in parallel (for example: smart-mode-line is doing this to provide theme that contain only mode line faces), so you can also define your own &quot;custom&quot; theme with and use it alongside the other themes. Load theme in sequence and the later will override the former.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2015-10-18T10:21:54.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17463" PostTypeId="1" AcceptedAnswerId="17762" CreationDate="2015-10-18T11:32:23.073" Score="2" ViewCount="1238" Body="&lt;p&gt;It seems that whitespace is no longer visible while editing files, since &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/pull/671&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; github issue.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I usually end up seeing the whitespace only after I have saved or even commited my files sometimes. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How can I see whitespace in spacemacs while editing, as was the case before ?  &lt;/li&gt;&#xA;&lt;li&gt;Are there any manual settings like &lt;code&gt;save-hooks&lt;/code&gt; which remove the whitespace automatically ?  &lt;/li&gt;&#xA;&lt;li&gt;Any other manner in which I should proceed to prevent the annoying whitespace to be commited?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6802" LastActivityDate="2015-12-27T05:21:37.290" Title="Whitespace issue in spacemacs" Tags="|spacemacs|whitespace|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17464" PostTypeId="2" ParentId="17454" CreationDate="2015-10-18T11:45:16.573" Score="5" Body="&lt;p&gt;So as per my earlier comment, Emacs doesn't really support what you're asking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would strongly recommend that you simply define a global command in the normal way, and make it behave appropriately based on the presence or not of a local variable (which could be directory-local). It can still be called from anywhere, but you would ensure that it never did something 'bad'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or come up with a key binding for your command -- it's &lt;em&gt;easy&lt;/em&gt; &lt;a href=&quot;https://stackoverflow.com/a/21493693/1219634&quot;&gt;&lt;sup&gt;[1]&lt;/sup&gt;&lt;/a&gt; &lt;a href=&quot;https://emacs.stackexchange.com/q/519/115&quot;&gt;&lt;sup&gt;[2]&lt;/sup&gt;&lt;/a&gt; to have key bindings which are only available in certain buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're really dead-set on the command not being available via &lt;code&gt;M-x&lt;/code&gt; then the following is the cleanest and most robust approach I can think of (but it's still an ugly hack).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my--real-command ()&#xA;  &quot;The real command; we'll leave this permanently defined.&quot;&#xA;  (interactive)&#xA;  (message &quot;Hello, world.&quot;))&#xA;&#xA;(defun my-pre-command-hook ()&#xA;  &quot;Define or undefine `my-command' based on `my-dir-local-flag'.&quot;&#xA;  (when (eq this-command 'execute-extended-command)&#xA;    (if (bound-and-true-p my-dir-local-flag)&#xA;        (defalias 'my-command 'my--real-command)&#xA;      (fmakunbound 'my-command))))&#xA;&#xA;(add-hook 'pre-command-hook 'my-pre-command-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-10-19T21:58:44.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17465" PostTypeId="1" AcceptedAnswerId="17484" CreationDate="2015-10-18T12:43:42.553" Score="4" ViewCount="1210" Body="&lt;p&gt;I &lt;em&gt;have&lt;/em&gt; run &lt;code&gt;M-x ansi-color-for-comint-mode-on&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when I use &lt;code&gt;/bin/ls --color=always&lt;/code&gt; (or &lt;code&gt;/bin/ls --color=auto&lt;/code&gt;) in a regular terminal, I do see colors in the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's only within Emacs' &lt;code&gt;shell-mode&lt;/code&gt; that these commands fail to produced colorized output.  (The variable &lt;code&gt;LS_COLORS&lt;/code&gt; is set to the empty string in all cases.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strangely enough, &lt;code&gt;grep --color=always&lt;/code&gt; does produce colorized output, even in &lt;code&gt;shell-mode&lt;/code&gt;.  The &lt;em&gt;echoed&lt;/em&gt; commands are are also colorized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0WBnF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0WBnF.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(NB: in the illustration above I passed the options &lt;code&gt;-1aF --color=always&lt;/code&gt; to &lt;code&gt;/bin/ls&lt;/code&gt;, but I get the same &quot;monochrome&quot; output with no flags, or with any combination of flags, and with any argument for the &lt;code&gt;--color&lt;/code&gt; option.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Is there anything else I need to do to get &lt;code&gt;/bin/ls&lt;/code&gt; to produce colorized output in &lt;code&gt;shell-mode&lt;/code&gt;?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;config&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ~/.emacs&#xA;&#xA;(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)&#xA;(require 'comint)&#xA;(set-face-attribute 'comint-highlight-prompt nil&#xA;                    :inherit nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# ~/.zshrc&#xA;LS_COLORS='';&#xA;export LS_COLORS&#xA;&#xA;PS1=$'%# '&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2015-10-18T16:27:09.820" LastActivityDate="2015-10-18T20:39:18.533" Title="/bin/ls --color=always fails to produce colorized output in shell-mode" Tags="|shell|colors|shell-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17466" PostTypeId="2" ParentId="17459" CreationDate="2015-10-18T12:51:52.420" Score="-3" Body="&lt;p&gt;Generally it is not possible, as elisp interprets all strings, and there doesn't seem to a way to prevent it doing so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However in this particular example it is possible -- as elisp interprets &lt;code&gt;\d&lt;/code&gt; as DEL char (ascii code: 127). So, assuming you string won't contain DEL chars by itself, one can search and replace it in emacs string representation. Generally it is possible to fight \a, \b, \d, \e, \f, \r, \v, \x cases:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kz0HA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kz0HA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(SE text field can't render this code without modifications)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this defun:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo () (interactive)&#xA;(insert (sheild-all-possible-letters &quot;\documentclass&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inserts &lt;code&gt;\documentclass&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a way to see how emacs sees the string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun how-emacs-sees-string (string)&#xA;  (interactive &quot;s&quot;)&#xA;&#xA;  (setq tempBuffer (generate-new-buffer-name &quot;temp&quot;))&#xA;  (switch-to-buffer tempBuffer)&#xA;  (insert string)&#xA;  )&#xA;&#xA;(how-emacs-sees-string &quot;&#xA;a: \a&#xA;b: \b&#xA;c: \c&#xA;d: \d&#xA;e: \e&#xA;f: \f&#xA;g: \g&#xA;h: \h&#xA;i: \i&#xA;j: \j&#xA;k: \k&#xA;l: \l&#xA;m: \m&#xA;n: \n&#xA;o: \o&#xA;p: \p&#xA;q: \q&#xA;r: \r&#xA;s: \s&#xA;t: \t&#xA;v: \v&#xA;w: \w&#xA;x: \x&#xA;y: \y&#xA;z: \z&#xA;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-10-18T12:51:52.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17467" PostTypeId="2" ParentId="14747" CreationDate="2015-10-18T13:15:03.783" Score="9" Body="&lt;p&gt;To recap what is in the comments, &lt;code&gt;funcall&lt;/code&gt; unquotes its argument (by just accessing the argument). And before that, we also need to make sure that we don't try to evaluate or access the value of the function name parameter that is passed in the call to the function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, an acceptable answer seems to be: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sum (term a next b)&#xA;    (funcall term a)&#xA;    (funcall next a))&#xA;&#xA;(defun inc-test (x) (+ x 1))&#xA;&#xA;(sum 'inc-test 1 'inc-test 10 )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or basically call with &lt;code&gt;'inc-test&lt;/code&gt; or &lt;code&gt;(quote inctest)&lt;/code&gt; rather than &lt;code&gt;inc-test&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2018-01-15T20:15:05.077" LastActivityDate="2018-01-15T20:15:05.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17468" PostTypeId="1" AcceptedAnswerId="17474" CreationDate="2015-10-18T13:32:02.717" Score="4" ViewCount="1145" Body="&lt;p&gt;How do I tell if more than one window is open programmatically? (I am looking for an elisp function/snippet or variable I can check)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I want to open a REPL in another other window if one exists, otherwise create a new window and open it there.)&lt;/p&gt;&#xA;" OwnerUserId="8653" LastEditorUserId="105" LastEditDate="2017-02-07T19:05:17.443" LastActivityDate="2020-10-10T19:50:18.053" Title="How to tell if more than one window is open?" Tags="|window|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17469" PostTypeId="2" ParentId="13698" CreationDate="2015-10-18T13:41:27.133" Score="0" Body="&lt;p&gt;Looking at the eshell code, I think that particular error is a bug. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, &lt;em&gt;eshell-print&lt;/em&gt;, needs is a place to send its output, and &lt;em&gt;eshell-commands&lt;/em&gt; is what gives a location to send output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So change the code to: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  (eshell)&#xA;  (eshell-commands (eshell-print &quot;Hello world&quot;)))&#xA;&#xA;(test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this will print &quot;Hello world&quot; inside the eshell buffer. &lt;/p&gt;&#xA;" OwnerUserId="5163" LastActivityDate="2015-10-18T13:41:27.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17470" PostTypeId="2" ParentId="17459" CreationDate="2015-10-18T13:53:56.530" Score="11" Body="&lt;p&gt;You may be misinterpreting what's going on. The &lt;code&gt;insert&lt;/code&gt; function inserts its argument verbatim. The problem is that the string you've included in your program is not &lt;code&gt;\documentclass&lt;/code&gt; but &lt;code&gt;␡ocumentclass&lt;/code&gt; where ␡ is ASCII character number 127 (which is unprintable).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;string literal&lt;/strong&gt; &quot;&lt;code&gt;\documentclass&quot;&lt;/code&gt; represents the &lt;strong&gt;string&lt;/strong&gt; &lt;code&gt;␡ocumentclass&lt;/code&gt;. Notice how &lt;em&gt;two&lt;/em&gt; things happen: the literal has additional quotes at the beginning and at the end, and backslash+character in the literal¹ is transformed into a single character in the string. Why? The quotes delimit the string literal, so that the computer knows that you meant to write a string and not whatever code the text could represent. At the very least, there needs to be a way to include a quote character in a string. Emacs Lisp, like most programming languages, uses the backslash to escape the next character: the string literal &lt;code&gt;&quot;foo\&quot;bar&quot;&lt;/code&gt; represents the string &lt;code&gt;foo&quot;bar&lt;/code&gt; — the second quote doesn't end the literal because it's preceded by a backslash. Backslash followed by a non-alphanumeric character always &lt;em&gt;quotes&lt;/em&gt; the next character: the backslash character is removed and the next character is included in the string. Backslash followed by some alphanumeric characters allows you to specify characters that it might not be easy to include in source code, such as control characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once again, this is happening when your code is parsed. If you write &lt;code&gt;&quot;\documentclass&quot;&lt;/code&gt;, there is no way to get back to what you typed, because it's stored in exactly the same way as if you'd typed &lt;code&gt;␡ocumentclass&lt;/code&gt;. If you write &lt;code&gt;&quot;\math&quot;&lt;/code&gt;, it's stored exactly in the same way as if you'd typed &lt;code&gt;&quot;math&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some languages have alternate syntaxes for string literals with a multi-character delimiter and no interpretation of anything but the end delimiter inside the string literal. Emacs Lisp doesn't, it keeps things simple. So just type &lt;code&gt;&quot;\\documentclass&quot;&lt;/code&gt; to get the string &lt;code&gt;\documentclass&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;¹ &lt;sub&gt; Sometimes backslash plus a sequence of characters. &lt;/sub&gt;  &lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-10-18T13:53:56.530" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17471" PostTypeId="2" ParentId="12509" CreationDate="2015-10-18T13:58:06.830" Score="7" Body="&lt;p&gt;To make clear the accepted answer in the comments: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-regexp ^([0-9]\{1,2\}) RET \exx\{ RET&#xA;                                           ^^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should be &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-regexp ^([0-9]\{1,2\}) RET \\exx{ RET&#xA;                                           ^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More generally, special symbols like &lt;code&gt;{&lt;/code&gt;, &lt;code&gt;|&lt;/code&gt;, &lt;code&gt;(&lt;/code&gt; that need to be escaped in the regular expression search string, do &lt;em&gt;not&lt;/em&gt; get escaped in the replacement string. Only '\' has to be. &lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="2237" LastEditDate="2015-10-20T11:40:12.133" LastActivityDate="2015-10-20T11:40:12.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17472" PostTypeId="2" ParentId="17468" CreationDate="2015-10-18T14:14:33.810" Score="1" Body="&lt;p&gt;This might work:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun more-than-one-window-p ()&#xA;  (cdr (window-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will return non-&lt;code&gt;nil&lt;/code&gt; value if there are more than one window (in selected frame).&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-10-18T17:00:18.563" LastActivityDate="2015-10-18T17:00:18.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17473" PostTypeId="2" ParentId="17468" CreationDate="2015-10-18T14:16:09.280" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;frame-first-window&lt;/code&gt; and &lt;code&gt;next-window&lt;/code&gt;, for example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(let ((first (frame-first-window)))&#xA;  (eq first (next-window first)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="306" LastEditDate="2020-10-10T19:50:18.053" LastActivityDate="2020-10-10T19:50:18.053" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="17474" PostTypeId="2" ParentId="17468" CreationDate="2015-10-18T15:02:14.950" Score="10" Body="&lt;p&gt;You can use the built-in function &lt;code&gt;one-window-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h S one-window-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; -- Function: one-window-p &amp;amp;optional no-mini all-frames&#xA;     This function returns ‘t’ if the selected window is the only live&#xA;     window, and ‘nil’ otherwise.&#xA;&#xA;     If the minibuffer window is active, it is normally considered (so&#xA;     that this function returns ‘nil’).  However, if the optional&#xA;     argument NO-MINI is non-‘nil’, the minibuffer window is ignored&#xA;     even if active.  The optional argument ALL-FRAMES has the same&#xA;     meaning as for ‘next-window’.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-18T15:02:14.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17475" PostTypeId="2" ParentId="16919" CreationDate="2015-10-18T16:37:12.053" Score="7" Body="&lt;p&gt;You can use Emacs's built-in package &lt;code&gt;desktop.el&lt;/code&gt; instead, it saves registers by default. To use it, put following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(desktop-save-mode)&#xA;;; prior to Emacs 24&#xA;(desktop-save-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can also use other packages, such as built-in package &lt;code&gt;savehist.el&lt;/code&gt;, as long as you can use it to keep value of the variable &lt;code&gt;register-alist&lt;/code&gt; across session.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-18T16:37:12.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17476" PostTypeId="2" ParentId="17440" CreationDate="2015-10-18T17:48:22.533" Score="1" Body="&lt;p&gt;As mentioned by @Krill in comments you can use &lt;code&gt;display-buffer-alist&lt;/code&gt; to control the display of buffers, for some explanation/examples look at the following questions&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/721/how-to-control-in-which-window-a-buffer-is-displayed/724#724&quot;&gt;How to control in which window a buffer is displayed?&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/5553/async-shell-process-buffer-always-clobbers-window-arrangement/5554#5554&quot;&gt;Async shell process buffer always clobbers window arrangement&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However that is a bit low level if all you want is to set the position of a buffer or specify it height. I know of two libraries that provide high level APIs for such customizations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &lt;a href=&quot;https://github.com/m2ym/popwin-el&quot; rel=&quot;nofollow noreferrer&quot;&gt;popwin-el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using popwin you could do the following to keep help-mode buffers at   bottom&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list popwin:special-display-config '(help-mode 0.5 :position below))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow noreferrer&quot;&gt;shackle&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To keep the help-mode buffers at bottom using shackle you can do the following&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'shackle-rules '(help-mode :align below))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-18T17:48:22.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17477" PostTypeId="2" ParentId="17376" CreationDate="2015-10-18T17:59:29.170" Score="1" Body="&#xA;&#xA;&lt;p&gt;@kaushalmodi has already mentioned some very good solutions for your problem. I wanted to mention another alternative that I &lt;a href=&quot;https://github.com/iqbalansari/dotEmacs/blob/master/config/org.org#dwim-binding-for-c-c-spc-in-org-mode&quot; rel=&quot;nofollow&quot;&gt;use&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do describe-key for &lt;code&gt;C-c SPC&lt;/code&gt; in org-mode (&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;), you will notice that it is bound to the command &lt;code&gt;org-table-blank-field&lt;/code&gt; which is relevant only when you are in org-mode tables, basically useless in most part of an org-mode document. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such we can define a DWIM command which checks if we are inside an org-mode table, in which case it runs &lt;code&gt;org-table-blank-field&lt;/code&gt; otherwise it delegates to whatever command &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt; is bound to globally and bound that command to &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt; in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like the following should work, if called with a prefix argument it unconditionally delegates to global binding for &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt; (&lt;code&gt;ace-jump-mode&lt;/code&gt; in your case)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-dwim-org-table-blank-field ()&#xA;  (interactive)&#xA;  (call-interactively (if (and (not current-prefix-arg)&#xA;                               (org-at-table-p))&#xA;                          #'org-table-blank-field&#xA;                        (global-key-binding (kbd &quot;C-c SPC&quot;)))))&#xA;&#xA;(with-eval-after-load 'org&#xA;  (org-defkey org-mode-map (kbd &quot;C-c SPC&quot;) #'my-dwim-org-table-blank-field))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The macro &lt;code&gt;with-eval-after-load&lt;/code&gt; was introduced in Emacs v24.4, for older versions use the following form&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;org&quot;&#xA;  '(org-defkey org-mode-map (kbd &quot;C-c SPC&quot;) #'my-dwim-org-table-blank-field))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastEditorUserId="115" LastEditDate="2015-10-19T12:22:30.293" LastActivityDate="2015-10-19T12:22:30.293" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17478" PostTypeId="1" AcceptedAnswerId="17507" CreationDate="2015-10-18T18:12:22.077" Score="2" ViewCount="153" Body="&lt;p&gt;How can I insert text so that the cursor stays in the same position while text I type is shifted to the left, overwriting existing text? For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   row_title: some words&#xA;   old_title: letters here&#xA;            ^&#xA;&#xA;   row_title: some words&#xA; newer_title: letters here&#xA;            ^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where the &lt;code&gt;^&lt;/code&gt; represents the position of the cursor.&lt;/p&gt;&#xA;" OwnerUserId="8957" LastActivityDate="2015-10-19T20:15:06.130" Title="Insert Text Leftwards in Overwrite Mode" Tags="|text-editing|insert|right-to-left|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17480" PostTypeId="1" AcceptedAnswerId="17485" CreationDate="2015-10-18T18:32:23.463" Score="7" ViewCount="1980" Body="&lt;p&gt;With this tree structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A.1&#xA;** A.2&#xA;** A.3&#xA;a3a3a3a3a3a3a3&#xA;* B&#xA;* C&#xA;** C.1&#xA;*** C.1.1&#xA;*** C.1.2&#xA;*** C.1.3&#xA;** C.2&#xA;** C.3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;… I can move &lt;code&gt;C.1&lt;/code&gt; (with its children) up and down with &lt;code&gt;M-↑&lt;/code&gt; and &lt;code&gt;M-↓&lt;/code&gt;. Easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;code&gt;M-S-↑&lt;/code&gt; and &lt;code&gt;M-S-↓&lt;/code&gt;, only the &lt;code&gt;C.1&lt;/code&gt; node is moved, without its children. Easy, too, however the Manual claims in &lt;a href=&quot;http://orgmode.org/manual/Structure-editing.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Structure-editing.html&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;M-S-&amp;lt;up&amp;gt;&lt;/code&gt;     &lt;code&gt;(org-move-subtree-up)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move subtree up (swap with previous subtree of same level).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;M-S-&amp;lt;down&amp;gt;&lt;/code&gt;     &lt;code&gt;(org-move-subtree-down)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move subtree down (swap with next subtree of same level).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;… so, really, it should be the other way round. Nevermind, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, using &lt;code&gt;M-S-↑↓&lt;/code&gt;, the &lt;code&gt;C.1&lt;/code&gt; node can be moved out of its parent, &lt;code&gt;C&lt;/code&gt;. When this happens, the &lt;code&gt;C.1&lt;/code&gt; node &lt;em&gt;always keeps&lt;/em&gt; its level (&lt;code&gt;**&lt;/code&gt; in this case), no matter where it ends up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, what I want to achieve is to move &lt;em&gt;the whole&lt;/em&gt; &lt;code&gt;C.1&lt;/code&gt; subtree, the whole branch with all the children, similarly, &lt;em&gt;out&lt;/em&gt; of &lt;code&gt;C&lt;/code&gt;, while keeping its &lt;code&gt;**&lt;/code&gt; level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could be done with &lt;code&gt;org-refile&lt;/code&gt; or killing the subtree &lt;code&gt;C-c C-x C-w&lt;/code&gt; and yanking it at some new point, however, nothing beats the &lt;code&gt;↓&lt;/code&gt; &lt;code&gt;↑&lt;/code&gt; experience (especially when I’ve got to move hundreds of such trees after importing my notes from Wunderlist).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Using GNU Emacs 25.0.50.1 and Org-mode version 8.3.2 (8.3.2-10-g00dacd-elpa).&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="9817" LastActivityDate="2021-11-25T05:14:45.143" Title="Move org-mode subtree to another subtree using arrows" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17481" PostTypeId="1" CreationDate="2015-10-18T19:14:35.793" Score="0" ViewCount="998" Body="&lt;p&gt;Emacs 24.5 (from &lt;a href=&quot;http://emacsformacosx.com&quot; rel=&quot;nofollow&quot;&gt;http://emacsformacosx.com&lt;/a&gt;), GNUS 5.13, OS X El Capitan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to post to a newsgroup or followup an existing post, I get the error &quot;Symbol's function definition is void: nil&quot; from GNUS.  Viewing works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what could be causing this?&lt;/p&gt;&#xA;" OwnerUserId="9871" LastActivityDate="2016-01-17T00:26:40.227" Title="Getting &quot;Symbol's function definition is void: nil&quot; when adding or following up in GNUS" Tags="|gnus|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17482" PostTypeId="1" AcceptedAnswerId="17483" CreationDate="2015-10-18T19:17:27.287" Score="2" ViewCount="851" Body="&lt;p&gt;In my init file I have a function that runs a &lt;code&gt;shell-command&lt;/code&gt; everytime I open emacs. I rarely need to look at the out put of this command, so having it pop up in the &lt;code&gt;*Shell Command Output*&lt;/code&gt; buffer every time I open emacs is unnecessary, and also means that I always have to take an extra step to get rid of that window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation for &lt;code&gt;shell-command&lt;/code&gt;, I have learned that I can provide an &lt;code&gt;OUTPUT-BUFFER&lt;/code&gt; argument and direct the output where I want it to go. Sending it to the &lt;code&gt;*Messages*&lt;/code&gt; buffer is almost the perfect solution for me, because it means I don't need to think about the output of the script, but if I do need to find it, I can find it in &lt;code&gt;*Messages*&lt;/code&gt;, which seems to be a logical place to look for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My only problem is that adding the &lt;code&gt;OUTPUT-BUFFER&lt;/code&gt; argument will make it so that whatever messages are in the &lt;code&gt;*Messages*&lt;/code&gt; buffer at the time the command is run will be replaced by the &lt;code&gt;shell-command&lt;/code&gt; output. I rarely look at the &lt;code&gt;*Messages*&lt;/code&gt; buffer unless I need to, but I want to make sure I don't remove anything important just in case. Is there any way for me to append the output of &lt;code&gt;shell-command&lt;/code&gt; to this buffer rather than replacing the buffer's contents? Any push in the right direction would be appreciated. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-10-18T20:19:53.213" Title="Append shell-command output to named buffer" Tags="|init-file|shell-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17483" PostTypeId="2" ParentId="17482" CreationDate="2015-10-18T20:19:53.213" Score="5" Body="&lt;p&gt;Here's one way to put the output of a command into the &lt;code&gt;*Messages*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-shell-command-to-message (command)&#xA;  &quot;Run a command in the shell and append its output to the *Messages* buffer.&quot;&#xA;  (message (shell-command-to-string command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that it also displays it at the bottom of the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To append the output of a command to a named buffer you could use a function like &lt;code&gt;my-shell-command-to-buffer&lt;/code&gt; below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-shell-command-to-buffer (command buffer-name)&#xA;  &quot;Run a `command' and append its output to buffer `buffer-name'.&quot;&#xA;  (with-current-buffer (get-buffer-create buffer-name)&#xA;    (goto-char (point-max))&#xA;    (insert (shell-command-to-string command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2015-10-18T20:19:53.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17484" PostTypeId="2" ParentId="17465" CreationDate="2015-10-18T20:39:18.533" Score="7" Body="&lt;p&gt;My Emacs (GNU Emacs 24.5.1) sets &lt;code&gt;TERM=dumb&lt;/code&gt; in &lt;code&gt;startup.el&lt;/code&gt; and my &lt;code&gt;ls&lt;/code&gt; from GNU coreutils 8.24 checks &lt;code&gt;TERM&lt;/code&gt; even with &lt;code&gt;--color=always&lt;/code&gt;. &lt;code&gt;dumb&lt;/code&gt; is not a terminal type recognized by &lt;code&gt;dircolors&lt;/code&gt; (the utility used by &lt;code&gt;ls&lt;/code&gt; to decide how to color the output), so running &lt;code&gt;TERM=ansi ls --color=always&lt;/code&gt; in a &lt;code&gt;*shell*&lt;/code&gt; buffer works as expected, while &lt;code&gt;ls --color=always&lt;/code&gt; does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I would recommend creating an alias similar to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias ls=&quot;TERM=ansi ls --color=always&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2015-10-18T20:39:18.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17485" PostTypeId="2" ParentId="17480" CreationDate="2015-10-18T20:53:32.050" Score="3" Body="&lt;h1&gt;Try This&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Using arrow keys to edit a nested tree structure can be confusing but is worth learning.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Place the cursor on &lt;code&gt;C.1&lt;/code&gt; line. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The cursor will remain on &lt;code&gt;C.1&lt;/code&gt; line unless otherwise noted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A.1&#xA;** A.2&#xA;** A.3&#xA;a3a3a3a3a3a3a3&#xA;* B&#xA;* C&#xA;** C.1&#xA;*** C.1.1&#xA;*** C.1.2&#xA;*** C.1.3&#xA;** C.2&#xA;** C.3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Move &lt;code&gt;C.1&lt;/code&gt; down to bottom of &lt;code&gt;C&lt;/code&gt; with by typing &lt;kbd&gt;M-↓&lt;/kbd&gt; repeatedly to preserve &lt;code&gt;C.2&lt;/code&gt; and &lt;code&gt;C.3&lt;/code&gt; branches. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Outline should look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A.1&#xA;** A.2&#xA;** A.3&#xA;a3a3a3a3a3a3a3&#xA;* B&#xA;* C&#xA;** C.2&#xA;** C.3&#xA;** C.1&#xA;*** C.1.1&#xA;*** C.1.2&#xA;*** C.1.3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Outdent entire &lt;code&gt;C.1&lt;/code&gt; subtree by typing  &lt;kbd&gt;M-S-←&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Outline should look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A.1&#xA;** A.2&#xA;** A.3&#xA;a3a3a3a3a3a3a3&#xA;* B&#xA;* C&#xA;** C.2&#xA;** C.3&#xA;* C.1&#xA;** C.1.1&#xA;** C.1.2&#xA;** C.1.3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Move &lt;code&gt;C.1&lt;/code&gt; subtree above &lt;code&gt;C&lt;/code&gt; subtree by typing  &lt;kbd&gt;M-↑&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Outline should look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A.1&#xA;** A.2&#xA;** A.3&#xA;a3a3a3a3a3a3a3&#xA;* B&#xA;* C.1&#xA;** C.1.1&#xA;** C.1.2&#xA;** C.1.3&#xA;* C&#xA;** C.2&#xA;** C.3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Indent &lt;code&gt;C.1&lt;/code&gt; subtree under another subtree, e.g. &lt;code&gt;B&lt;/code&gt;, by typing &lt;kbd&gt;M-S-→&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Outline should look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A.1&#xA;** A.2&#xA;** A.3&#xA;a3a3a3a3a3a3a3&#xA;* B&#xA;** C.1&#xA;*** C.1.1&#xA;*** C.1.2&#xA;*** C.1.3&#xA;* C&#xA;** C.2&#xA;** C.3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'll add some additional tips and examples to my answer soon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Tested using&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;org-version: 8.3.1&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2015-10-18T20:58:35.300" LastActivityDate="2015-10-18T20:58:35.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17486" PostTypeId="2" ParentId="17481" CreationDate="2015-10-18T22:33:13.097" Score="-1" Body="&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook (flyspell-mode 1))&#xA;(dolist (hook '(change-log-mode-hook log-edit-mode-hook))&#xA;  (add-hook hook (lambda () (flyspell-mode -1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;was the culprit.  Thanks for the help.&lt;/p&gt;&#xA;" OwnerUserId="9871" LastActivityDate="2015-10-18T22:33:13.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17487" PostTypeId="1" CreationDate="2015-10-19T02:20:02.170" Score="2" ViewCount="694" Body="&lt;p&gt;I'm trying to create a frame with the following params&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-frame `((name . &quot;Foo&quot;)&#xA;              (title . &quot;[%F] %b)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to try and create a frame with the title &lt;code&gt;[Foo] buffer_name&lt;/code&gt;. But it seems only the &lt;code&gt;name&lt;/code&gt; parameter is used and the frame title is only &lt;code&gt;Foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does &lt;code&gt;title&lt;/code&gt; param get ignored if &lt;code&gt;name&lt;/code&gt; is specified? The docs aren't very clear about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs for OS X.&lt;/p&gt;&#xA;" OwnerUserId="251" LastActivityDate="2017-06-10T23:18:14.150" Title="How to set set both frame title and name when creating a frame?" Tags="|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17489" PostTypeId="1" AcceptedAnswerId="17490" CreationDate="2015-10-19T07:48:16.757" Score="2" ViewCount="1046" Body="&lt;p&gt;When I type &lt;code&gt;c-c&lt;/code&gt; (type c twice) in staged files, it will commit all the staged files, however i only want to commit a single file of the staged files.&#xA;How to do it? Thx.&lt;/p&gt;&#xA;" OwnerUserId="6711" LastEditorUserId="6711" LastEditDate="2015-10-19T08:10:27.123" LastActivityDate="2015-10-19T10:12:32.103" Title="How to commit a single staged file in magit?" Tags="|magit|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17490" PostTypeId="2" ParentId="17489" CreationDate="2015-10-19T08:56:26.463" Score="5" Body="&lt;p&gt;You can't just commit a part of the index. The index/staging area is where your next commit is built. Asking to commit only part of it makes no sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to speculate that you've staged a bunch of changes, you don't want to unstage them all (because then you'd need to work through all the changes again to find and re-stage them), but you've realised you actually wanted to make multiple commits out of what you've staged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many ways you could achieve the end goal. A couple of fairly straightforward options are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Unstage the bit you wanted to commit, and then go ahead and commit the rest. Then stage and commit the thing you wanted to commit first. If you're unhappy with the commit order, re-order them afterwards in an interactive rebase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Using Magit's stashing facilities, stash the worktree (only), leaving you with no changes other than what is staged. Now unstage everything, and re-stage the thing you want to commit first (and commit it). Then re-stage all of the unstaged changes and finally apply the stash to get back to where you started (new commit excepted).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-10-19T10:12:32.103" LastActivityDate="2015-10-19T10:12:32.103" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17491" PostTypeId="2" ParentId="12597" CreationDate="2015-10-19T09:51:42.850" Score="1" Body="&lt;p&gt;You can do something like the below. It is just an example you might want to customize it according to your need. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'thingatpt)&#xA;&#xA;(defun my-search-at-point (event)&#xA;  (interactive &quot;e&quot;)&#xA;  (let ((position (event-start event)))&#xA;    (save-selected-window&#xA;      (select-window (posn-window position))&#xA;      (save-excursion&#xA;        (goto-char (posn-point position))&#xA;        (grep-compute-defaults)&#xA;        (rgrep (thing-at-point 'symbol)&#xA;               (if buffer-file-name (concat &quot;*.&quot; (file-name-extension buffer-file-name)) &quot;*&quot;)&#xA;               default-directory)))))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-2&amp;gt;&quot;) #'my-search-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We pass the argument &quot;e&quot; to &lt;code&gt;interactive&lt;/code&gt;, this tells Emacs that our command expects the mouse event as input. We require the mouse event since we want to search at word/symbol at the position of mouse click rather than where the cursor is currently. &lt;code&gt;event-start&lt;/code&gt;, &lt;code&gt;event-end&lt;/code&gt; can be used to get starting position or ending position of a mouse event (I am using &lt;code&gt;event-start&lt;/code&gt; since both starting and ending position of a single click event is the same).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;posn-window&lt;/code&gt; and &lt;code&gt;posn-point&lt;/code&gt; are used to get the window and the point of the mouse event. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Accessing-Mouse.html&quot; rel=&quot;nofollow&quot;&gt;Accessing Mouse&lt;/a&gt; for more information about these functions. Finally &lt;code&gt;thing-at-point&lt;/code&gt; is used to retrieve the symbol at point of mouse click, and the symbol is searched for recursively in the &lt;code&gt;default-directory&lt;/code&gt; using &lt;code&gt;rgrep&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="247" LastActivityDate="2015-10-19T09:51:42.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17492" PostTypeId="2" ParentId="17444" CreationDate="2015-10-19T10:17:35.930" Score="0" Body="&lt;p&gt;As @lawlist suggest, you can get the prebuilt version of Emacs master/trunk  which uses the gif support added to the bin directory where the emacs.exe is located: sourceforge.net/projects/emacs-bin/files/snapshots See also 64-bit -- with image support: sourceforge.net/projects/emacsbinw64/files/snapshot for Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With my configuration, I couldn't it get working, which leds me to suspect my configuration. The culprit turns out to be &lt;code&gt;image+&lt;/code&gt; and &lt;code&gt;imagex-sticky-maximize&lt;/code&gt;, which I disabled. Now Emacs don't crashes anymore.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-10-19T10:17:35.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17493" PostTypeId="1" CreationDate="2015-10-19T11:00:23.487" Score="1" ViewCount="206" Body="&lt;p&gt;I have customized the variable sh-indentation with 4, but in one file I would like to use a different value. So I defined a file variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: sh; sh-indentation: 2; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the result is not what I have expected. When I open the file the values are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sh-indentation is a variable defined in `sh-script.el'.&#xA;Its value is 2&#xA;Original value was 4&#xA;Local in buffer .szi; global value is 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The file variable seems to set the global value but not the buffer local value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set the buffer local value with the file variable?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2015-10-20T15:51:45.713" Title="How to make a file variable buffer local?" Tags="|file-local-variables|sh-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17494" PostTypeId="5" CreationDate="2015-10-19T11:02:03.840" Score="0" Body="&lt;p&gt;This mode works for many shells, since they all have roughly the same syntax,&#xA;as far as commands, arguments, variables, pipes, comments etc. are concerned.&#xA;Unless the file's magic number indicates the shell, your usual shell is&#xA;assumed.  Since filenames rarely give a clue, they are not further analyzed.&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="2787" LastEditDate="2015-10-19T11:25:00.220" LastActivityDate="2015-10-19T11:25:00.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17495" PostTypeId="4" CreationDate="2015-10-19T11:02:03.840" Score="0" Body="Major mode for editing shell scripts." OwnerUserId="2787" LastEditorUserId="2787" LastEditDate="2015-10-19T11:24:41.023" LastActivityDate="2015-10-19T11:24:41.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17496" PostTypeId="5" CreationDate="2015-10-19T11:05:44.300" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-10-19T11:05:44.300" LastActivityDate="2015-10-19T11:05:44.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17497" PostTypeId="4" CreationDate="2015-10-19T11:05:44.300" Score="0" Body="Htmlfontify provides a means of converting individual Emacs buffers, source files, or entire source trees to html, preserving formatting and Emacs colorization / syntax highlighting as much as possible through careful application of CSS stylesheets and html tags." OwnerUserId="2787" LastEditorUserId="2787" LastEditDate="2015-10-19T15:13:28.900" LastActivityDate="2015-10-19T15:13:28.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17498" PostTypeId="5" CreationDate="2015-10-19T11:07:12.360" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-10-19T11:07:12.360" LastActivityDate="2015-10-19T11:07:12.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17499" PostTypeId="4" CreationDate="2015-10-19T11:07:12.360" Score="0" Body="Compilation mode turns each error message in the buffer into a hyperlink; you can move point to it and type RET, or click on it with the mouse (see Mouse References), to visit the locus of the error message in a separate window." OwnerUserId="2787" LastEditorUserId="2787" LastEditDate="2015-10-19T15:14:02.970" LastActivityDate="2015-10-19T15:14:02.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17500" PostTypeId="1" CreationDate="2015-10-19T11:19:30.267" Score="2" ViewCount="2117" Body="&lt;p&gt;Is it possible to have a link to a specific heading (e.g. identified by a &lt;code&gt;CUSTOM_ID&lt;/code&gt; property) of an external org file?&#xA;The only relevant example in &lt;a href=&quot;http://orgmode.org/guide/External-links.html&quot; rel=&quot;nofollow&quot;&gt;the external links section of the manual&lt;/a&gt; seems to be to an org-file as whole (and not to a heading of it).&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-11-19T02:40:38.660" Title="can I have a link to a specific point of an external org file?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17501" PostTypeId="1" AcceptedAnswerId="17675" CreationDate="2015-10-19T11:24:12.273" Score="10" ViewCount="344" Body="&lt;p&gt;When parental level node, which contains both child items and tags, is folded by &lt;code&gt;tab&lt;/code&gt;, the &lt;code&gt;...&lt;/code&gt; indication for folded child items is associated with the tags rather than the node text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for instance, it displays like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*1st level node            :@tag1...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while I would like it to be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*1st level node...      :@tag1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible?&lt;/p&gt;&#xA;" OwnerUserId="9570" LastEditorUserId="253" LastEditDate="2015-10-20T14:09:28.497" LastActivityDate="2015-12-26T12:52:52.030" Title="org folding: show tags after the &quot;...&quot;, not before?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17502" PostTypeId="1" AcceptedAnswerId="17513" CreationDate="2015-10-19T11:42:35.097" Score="10" ViewCount="977" Body="&lt;p&gt;It's easy to navigate quickly from the start of one org-mode headline to another using &lt;a href=&quot;http://orgmode.org/manual/Speed-keys.html&quot; rel=&quot;noreferrer&quot;&gt;speed keys&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose now I'm at the start of a headline, and I want to add to the main text, in the beginning immediately after the TODO keyword. Then &lt;kbd&gt;M-f Space&lt;/kbd&gt; will get me where I want to go. If there is no TODO keyword, then it's &lt;kbd&gt;M-f M-b&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to get to the &lt;em&gt;end&lt;/em&gt; of the headline text, it's trickier. If there are no keywords at the end, and no folded text hidden under the headline, it's as easy as &lt;kbd&gt;C-e&lt;/kbd&gt;. But that's rarely the case. If there is folded text, but no keywords, then I can do &lt;kbd&gt;C-e M-b&lt;/kbd&gt;. But if there &lt;em&gt;is&lt;/em&gt; a keyword or two at the end of a folded headline, then I will find myself typing (the horror) &lt;kbd&gt;C-e M-b M-b M-b M-f&lt;/kbd&gt;! And if there are more then two keywords, it gets worse.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm jumping around and editing a lot of headlines one after the other, this can be a lot to think about and it really mess up my whole flow. Ideally I'd like to re-define &lt;kbd&gt;s&lt;/kbd&gt; and &lt;kbd&gt;e&lt;/kbd&gt; as speed keys to get me exactly I want to go, in all of these cases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone seen an existing solution to this problem? My elisp skills are minimal and it would be daunting to solve this on my own.&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="874" LastEditDate="2015-10-20T02:00:15.643" LastActivityDate="2015-10-20T02:00:15.643" Title="How to navigate most efficiently to the start or end of the main text of an org headline?" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17503" PostTypeId="1" AcceptedAnswerId="17504" CreationDate="2015-10-19T14:13:17.707" Score="1" ViewCount="48" Body="&lt;p&gt;I had the following hook:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'image-mode-hook 'imagex-sticky-maximize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;imagex-sticky-maximize&lt;/code&gt; is a function that maximizes the image to the borders of the window. I prefer to see my images to his fullest inside the window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works fine so far. But I noticed that Emacs crashes if the next file is a &lt;code&gt;*.gif&lt;/code&gt; file. So disabling the &lt;code&gt;imagex-sticky-maximize&lt;/code&gt; helps.&#xA;But I would like to enable that function when the file is a &lt;code&gt;*.PNG&lt;/code&gt;, or &lt;code&gt;*.JPG&lt;/code&gt; or &lt;code&gt;*.TIFF&lt;/code&gt; image. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I was looking for a solution. I know you have the &lt;code&gt;auto-mode-alist&lt;/code&gt;. When you declare something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.clj$\\'&quot; . paredit-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then paredit mode will be called as minor mode, when you open file with the extension &lt;code&gt;*.clj&lt;/code&gt;. This works only for minor modes.&#xA;I was looking for a sort of &lt;code&gt;auto-function-alist&lt;/code&gt;, that calls &lt;code&gt;imagex-sticky-maximize&lt;/code&gt; when a specifix extension is being opened. However, I couldn't find anything of this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion in that direction would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="675" LastEditDate="2016-09-12T19:37:31.787" LastActivityDate="2016-09-12T19:37:31.787" Title="Does something like a auto-function-list exist?" Tags="|hooks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17504" PostTypeId="2" ParentId="17503" CreationDate="2015-10-19T14:19:55.290" Score="3" Body="&lt;p&gt;You can easily write your own function that checks the extension of the file name of the current buffer, and call a function if it does (or doesn't) match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example (warning: untested):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-image-mode-hook ()&#xA;  (let ((name (buffer-file-name)))&#xA;    (when name&#xA;      (let ((ext (file-name-extension name)))&#xA;        (unless (string= (downcase ext) &quot;gif&quot;)&#xA;          (imagex-sticky-maximize))))))&#xA;(add-hook 'image-mode-hook 'my-image-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="675" LastEditDate="2016-09-12T19:37:18.443" LastActivityDate="2016-09-12T19:37:18.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17506" PostTypeId="2" ParentId="14952" CreationDate="2015-10-19T14:53:27.983" Score="1" Body="&lt;p&gt;Install all the dictionaries you want in the location that hunspell searches in; find this with &lt;code&gt;hunspell -D&lt;/code&gt;. Once installed, this command should show them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the init file, add just add one of them E.g. I have &lt;code&gt;en_GB&lt;/code&gt; and &lt;code&gt;en_US&lt;/code&gt; dictionaries installed. I've, in my init file, this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;DICTIONARY&quot; &quot;en_GB&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Upon opening Emacs, just enable &lt;code&gt;flyspell-mode&lt;/code&gt;. Emacs should say that it is started ispell with default dictionary. This means &lt;code&gt;en_GB&lt;/code&gt; is in action, for our example. Now if you want to switch, just do &lt;code&gt;M-x ispell-change-dictionary&lt;/code&gt; and give the new dictionary name E.g. &lt;code&gt;en_US&lt;/code&gt;. Now the other dictionary should be in action. This, again, will be notified by Emacs saying it started ispell but this time with the &lt;code&gt;en_US&lt;/code&gt; dictionary.&lt;/p&gt;&#xA;" OwnerUserId="4106" LastActivityDate="2015-10-19T14:53:27.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17507" PostTypeId="2" ParentId="17478" CreationDate="2015-10-19T15:21:41.303" Score="1" Body="&lt;p&gt;There is no predefined way to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll probably want to start by defining your own replacement for &lt;code&gt;overwrite-mode&lt;/code&gt;, mirroring what is done for &lt;code&gt;overwrite-mode&lt;/code&gt; but:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Switching (for example), the keys for commands &lt;code&gt;delete-backward-char&lt;/code&gt; and &lt;code&gt;delete-forward-char&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Binding your own replacement command for &lt;code&gt;quoted-insert&lt;/code&gt; (&lt;code&gt;C-q&lt;/code&gt;), using &lt;code&gt;backward-delete-char&lt;/code&gt; in place of &lt;code&gt;delete-char&lt;/code&gt; in the definition.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, because there are multiple predefined Lisp functions that use &lt;code&gt;overwrite-mode&lt;/code&gt; (e.g., check the value and do something accordingly), you might just want to advise &lt;code&gt;overwrite-mode&lt;/code&gt;, instead of defining a replacement command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, I would ask why you want to do this?  What is your actual use case?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update after your use-case comment:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Try &lt;strong&gt;&lt;code&gt;M-x picture-mode&lt;/code&gt;&lt;/strong&gt; -- see the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Picture-Mode.html&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Picture-Mode&lt;/em&gt;&lt;/a&gt; and its 4 subnodes. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Maybe try the &lt;code&gt;table&lt;/code&gt; package -- see the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Text Based Tables&lt;/em&gt;&lt;/a&gt; and its 8 subnodes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-19T20:15:06.130" LastActivityDate="2015-10-19T20:15:06.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17508" PostTypeId="1" AcceptedAnswerId="17524" CreationDate="2015-10-19T15:24:57.157" Score="4" ViewCount="669" Body="&lt;p&gt;I've bound a command to &lt;kbd&gt;A-m&lt;/kbd&gt;, however some package that I load seems to modify &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#Translation-Keymaps&quot; rel=&quot;nofollow&quot;&gt;input translation maps&lt;/a&gt; (&lt;code&gt;input-decode-map&lt;/code&gt;, &lt;code&gt;local-function-key-map&lt;/code&gt;, &lt;code&gt;function-key-map&lt;/code&gt;, &lt;code&gt;key-translation-map&lt;/code&gt;) that interfere with my intended behavior for the key, which is to run the command I've bound it to. Instead when I press &lt;kbd&gt;A-m&lt;/kbd&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;µ (translated from A-m) runs the command self-insert-command&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions here are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How can I override this behavior if a package interferes like this?&lt;/li&gt;&#xA;&lt;li&gt;How can I &lt;em&gt;quickly&lt;/em&gt; zero-in on which package has interfered in this way without the slow and painful comment-packages/restart emacs cycle?&lt;/li&gt;&#xA;&lt;li&gt;Prevent packages from overriding my custom settings-- or at least warn me when modifying the input maps so I can easily figure out which package without hunting?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2138" LastEditorUserId="105" LastEditDate="2023-01-28T21:32:26.420" LastActivityDate="2023-01-28T21:32:26.420" Title="How can I prevent/override key translation behavior such as: µ (translated from A-m) runs the command self-insert-command" Tags="|key-bindings|keymap|key-translation-map|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17509" PostTypeId="1" CreationDate="2015-10-19T16:09:41.597" Score="30" ViewCount="4395" Body="&lt;p&gt;Normally, for historic reasons, emacs treats the &lt;code&gt;TAB&lt;/code&gt; keycode and the &lt;code&gt;C-i&lt;/code&gt; key as the same, cf. &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Function-Keys.html&quot; rel=&quot;noreferrer&quot;&gt;the emacs lisp documentation on function keys&lt;/a&gt; or &lt;a href=&quot;https://emacs.stackexchange.com/a/9634/448&quot;&gt;abo-abo's answer on the question &quot;What is the difference between TAB and ?&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In this post, keycodes are &lt;code&gt;TAB&lt;/code&gt;, &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;, and &lt;code&gt;C-i&lt;/code&gt;; &lt;kbd&gt;tab&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;i&lt;/kbd&gt; on the other hand are the &lt;em&gt;physical&lt;/em&gt; keys on the keyboard.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;However, at the moment, emacs treats the &lt;code&gt;TAB&lt;/code&gt; and &lt;code&gt;C-i&lt;/code&gt; as the same thing, i.e. &lt;code&gt;(equal (kbd &quot;TAB&quot;) (kbd &quot;C-i&quot;))&lt;/code&gt; -&gt; &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, since we are no longer living in the stoneage of computing I find this &lt;strong&gt;extremely&lt;/strong&gt; annoying. There's a few suggestions out there what can be done to work around this, e.g.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1792326/how-do-i-bind-a-command-to-c-i-without-changing-tab&quot;&gt;&quot;How do I bind a command to C-i without changing TAB?&quot;&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/1792482/1396507&quot;&gt;Trey's Solution&lt;/a&gt; did not work for my, the variable &lt;code&gt;local-function-key-maps&lt;/code&gt; is not changed. Modifying it to use &lt;code&gt;delete&lt;/code&gt; rather than &lt;code&gt;delq&lt;/code&gt; does result in a modified variable but it does not bring resolve ... &lt;kbd&gt;tab&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt; are still the same.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/2253044/1396507&quot;&gt;Translating to&lt;/a&gt;&lt;a href=&quot;https://stackoverflow.com/a/11319885/1396507&quot;&gt; the hyper map&lt;/a&gt; seems like a 1980s workaround ... I might want to use &lt;kbd&gt;Hyper&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt; as well.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/32279388/1396507&quot;&gt;Using the &lt;code&gt;input-decode-map&lt;/code&gt; to map &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt; to some post-ASCII control code&lt;/a&gt; is almost what I'm looking for. Except that it does not work properly with the &lt;code&gt;kbd&lt;/code&gt; macro meaning that one must modify all bits of source code that will bind &lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;i&lt;/kbd&gt;. Arguably this is the best solution given that all source code is modified properly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;code&gt;(kbd &quot;&amp;lt;tab&amp;gt;&quot;)&lt;/code&gt; for &lt;kbd&gt;tab&lt;/kbd&gt; and &lt;code&gt;(kbd &quot;C-i&quot;)&lt;/code&gt; (which translates to &lt;code&gt;(kbd &quot;TAB&quot;)&lt;/code&gt; i.e. the &lt;code&gt;\t&lt;/code&gt; literal) for &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt; &lt;strong&gt;does work&lt;/strong&gt; but you'd have to modify &lt;em&gt;all&lt;/em&gt; source files which use the wrong kind of &lt;kbd&gt;tab&lt;/kbd&gt; [Read: the keycode &lt;code&gt;TAB&lt;/code&gt;] which is annoying.&lt;br&gt;&#xA;This has been suggested e.g. &lt;a href=&quot;https://github.com/bling/evil-jumper/issues/8&quot; rel=&quot;noreferrer&quot;&gt;in a github issue&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/9631/what-is-the-difference-between-tab-and-tab&quot;&gt;on emacs.sx as well&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;None of these solutions seem real solutions, I'd rather consider them workarounds or hacks (of the existing &lt;em&gt;bug&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way out there to &lt;strong&gt;force&lt;/strong&gt; emacs to map &lt;kbd&gt;tab&lt;/kbd&gt; to &lt;code&gt;(kbd &quot;&amp;lt;tab&amp;gt;&quot;)&lt;/code&gt; and &lt;code&gt;(kbd &quot;TAB&quot;)&lt;/code&gt; while &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt; is mapped to &lt;code&gt;(kbd &quot;C-i&quot;)&lt;/code&gt; short of modyfing the emacs source code?  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This approach should be completely invisible to the user, meaning that the &lt;kbd&gt;tab&lt;/kbd&gt; like keycodes &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; and &lt;code&gt;TAB&lt;/code&gt; should map to one binding whilst the &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt; like keycode &lt;code&gt;C-i&lt;/code&gt; should map to another binding.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On a less serious note: Any emacs developers here who can comment whether this will be changed / fixed in the emacs source code at some point?&lt;/p&gt;&#xA;" OwnerUserId="448" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-02-12T16:42:46.013" Title="How to distinguish C-i from TAB?" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17510" PostTypeId="2" ParentId="17509" CreationDate="2015-10-19T16:46:19.290" Score="29" Body="&lt;p&gt;The future is long gone, and the stone age of computing is just about to come.  All text terminals I know still send the exact same byte-sequence to Emacs for &lt;kbd&gt;C-i&lt;/kbd&gt; as for &lt;kbd&gt;TAB&lt;/kbd&gt;, so the original need to &quot;unify&quot; them is still very much with us.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The input-decode-map (à la &lt;code&gt;(define-key input-decode-map &quot;\C-i&quot; [C-i])&lt;/code&gt;) is probably about as good as it gets right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Emacs ex-maintainer, I'd welcome a better solution to this problem, so as to free up the &lt;kbd&gt;C-i&lt;/kbd&gt; (and &lt;kbd&gt;C-m&lt;/kbd&gt; and &lt;kbd&gt;C-[&lt;/kbd&gt;) keys under GUIs (probably make them &quot;reserved for the user&quot;).  But I don't know how to do that without causing lots of problems with existing packages.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-10-19T16:46:19.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17511" PostTypeId="1" AcceptedAnswerId="17512" CreationDate="2015-10-19T19:41:42.243" Score="5" ViewCount="1406" Body="&lt;p&gt;When I press &lt;code&gt;CTRL-H&lt;/code&gt; in emacs running on my xterm, then this is interpreted as backspace and the character before the point is deleted. I've found various discussions about the &quot;opposite&quot; issue (pressing backspace invokes help), but was unable to modify them to my needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I access help commands (like the describe functions) from a &lt;code&gt;emacs -nw&lt;/code&gt; running in an xterm with the keystroke &lt;code&gt;CTRL-H&lt;/code&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;GNU Emacs 24.5.2, XTerm(312), NixOS x86_64, empty .emacs&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="9838" LastActivityDate="2015-10-19T19:45:06.790" Title="Trying to invoke help (CTRL-H) deletes character on terminal" Tags="|key-bindings|terminal-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17512" PostTypeId="2" ParentId="17511" CreationDate="2015-10-19T19:45:06.790" Score="3" Body="&lt;p&gt;Use &lt;code&gt;M-x normal-erase-is-backspace-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/DEL-Does-Not-Delete.html&quot; rel=&quot;nofollow&quot;&gt;DEL Does Not Delete&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In all of those cases, the immediate remedy is the same: use the&#xA;  command &lt;code&gt;M-x normal-erase-is-backspace-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Another way to fix the problem for every Emacs session is to&#xA;  customize the variable &lt;code&gt;normal-erase-is-backspace&lt;/code&gt;: the value &lt;code&gt;t&lt;/code&gt;&#xA;  specifies the mode where &lt;code&gt;&amp;lt;BS&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;BACKSPACE&amp;gt;&lt;/code&gt; is &lt;code&gt;&amp;lt;DEL&amp;gt;&lt;/code&gt;, and &lt;code&gt;nil&lt;/code&gt;&#xA;  specifies the other mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-19T19:45:06.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17513" PostTypeId="2" ParentId="17502" CreationDate="2015-10-19T19:53:43.763" Score="9" Body="&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You need to set the &lt;code&gt;org-special-ctrl-a/e&lt;/code&gt; variable to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Documentation&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Non-nil means `C-a' and `C-e' behave specially in headlines and items.&#xA;&#xA;When t, `C-a' will bring back the cursor to the beginning of the&#xA;headline text, i.e. after the stars and after a possible TODO&#xA;keyword.  In an item, this will be the position after bullet and&#xA;check-box, if any.  When the cursor is already at that position,&#xA;another `C-a' will bring it to the beginning of the line.&#xA;&#xA;`C-e' will jump to the end of the headline, ignoring the presence&#xA;of tags in the headline.  A second `C-e' will then jump to the&#xA;true end of the line, after any tags.  This also means that, when&#xA;this variable is non-nil, `C-e' also will never jump beyond the&#xA;end of the heading of a folded section, i.e. not after the&#xA;ellipses.&#xA;&#xA;When set to the symbol `reversed', the first `C-a' or `C-e' works&#xA;normally, going to the true line boundary first.  Only a directly&#xA;following, identical keypress will bring the cursor to the&#xA;special positions.&#xA;&#xA;This may also be a cons cell where the behavior for `C-a' and&#xA;`C-e' is set separately.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Below is evaluated,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-special-ctrl-a/e t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(1) Initial state (▮ represents the point)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO ab▮c                                                        :test:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(2) After first &lt;code&gt;C-a&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO ▮abc                                                        :test:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(3) After second &lt;code&gt;C-a&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮* TODO abc                                                        :test:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(4) After first &lt;code&gt;C-e&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO abc▮                                                        :test:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(5) After second &lt;code&gt;C-e&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO abc                                                        :test:▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Related: &lt;a href=&quot;https://emacs.stackexchange.com/q/16845/115&quot;&gt;Expand org-mode subtree with point after ellipsis?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-10-19T19:53:43.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17515" PostTypeId="1" AcceptedAnswerId="17516" CreationDate="2015-10-19T20:27:11.087" Score="26" ViewCount="7132" Body="&lt;p&gt;If I want to delete everything in a buffer with elisp, how do I do that? &lt;/p&gt;&#xA;" OwnerUserId="8653" LastEditorUserId="105" LastEditDate="2017-02-07T19:05:01.457" LastActivityDate="2017-07-18T21:48:11.020" Title="How do I clear a buffer completely with elisp?" Tags="|buffers|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17516" PostTypeId="2" ParentId="17515" CreationDate="2015-10-19T20:33:03.660" Score="31" Body="&lt;p&gt;Have you tried &lt;code&gt;erase-buffer&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;erase-buffer is an interactive built-in function in `C source code'.&#xA;&#xA;(erase-buffer)&#xA;&#xA;&#xA;Delete the entire contents of the current buffer.&#xA;Any narrowing restriction in effect (see `narrow-to-region') is removed,&#xA;so the buffer is truly empty after this.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to find such a function? &lt;code&gt;M-x apropos buffer erase&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-19T20:33:03.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17517" PostTypeId="2" ParentId="17515" CreationDate="2015-10-19T21:21:12.527" Score="9" Body="&lt;p&gt;You can use some &lt;code&gt;setf&lt;/code&gt; magic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setf (buffer-string) &quot;&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-10-19T21:21:12.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17518" PostTypeId="2" ParentId="17249" CreationDate="2015-10-19T21:49:41.053" Score="4" Body="&lt;p&gt;Given the actual title here &quot;How to make terminal/shell spawned inside Emacs running on a Mac inherit the environment variables of the native terminal?&quot; you can't as Emacs will not have the Terminal.app as a super process at any level so Emacs cannot inherit anything form the shell in Terminal.app. You have to make the environment the same by sourcing the same files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Building on  this &lt;a href=&quot;https://apple.stackexchange.com/questions/119711/why-mac-os-x-dont-source-bashrc/119714#119714&quot;&gt;answer&lt;/a&gt; on AskDifferent&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to note what the startup files for bash are. ~/.bash_profile is read in a login shell ~/.bashrc when another shell starts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cocoa Emacs is a GUI and when it runs it runs in a subprocess where nothing has run a login shell so it its environment there is nothing that has sourced ~/.bash_profile. Emacs will start a non login shell so anything in ~/.bashrc will be read.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sort of thing is why is recommended in the bash manual to have this in ~/,bash_profile&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [ -f ~/.bashrc ]; then . ~/.bashrc; fi &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and put your environment settings in ~/.bashrc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to why /Applications/Emacs.app/Contents/MacOS/Emacs . works in the terminal. Terminal.app defaults to running a shell in login mode and so that shell has sourced ~/.bash_profile and emacs is a subprocess of that shell and so inherits its environment. So in this case you do inherit from the shell in Terminal.app&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note X11 differs as you run it from a shell so that shell has environment variables as that shell is started as a login one.&lt;/p&gt;&#xA;" OwnerUserId="9874" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:30.630" LastActivityDate="2015-10-19T21:49:41.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17519" PostTypeId="1" CreationDate="2015-10-19T21:58:05.353" Score="2" ViewCount="206" Body="&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to run ispell on a region (or the whole diff and nothing else) directly from the &lt;code&gt;magit-status&lt;/code&gt; buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Motivation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am writing varying amounts of text and often keep it under version control.&#xA;I also use magit as a front-end for git.&#xA;After adding chunks of text here and there and then checking the &lt;code&gt;magit-status&lt;/code&gt; I catch myself wanting to spell check newly edited regions without the hassle of diving in to the text and find it or spell-check the whole document. &lt;/p&gt;&#xA;" OwnerUserId="427" LastActivityDate="2016-04-09T12:39:04.070" Title="How do I spell check directly from the magit-status buffer" Tags="|magit|ispell|spell-checking|diff|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="17520" PostTypeId="1" CreationDate="2015-10-19T22:14:47.860" Score="3" ViewCount="749" Body="&lt;p&gt;Let us say I have a command to start a REPL. How do I most easily read output and send input? A minimal example with shell, sending ls and reading the output would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The shell should preferably not be opened in a buffer, but run in the background, if that isn't very hard.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2017-02-07T19:04:30.980" LastActivityDate="2017-02-07T19:04:30.980" Title="How can I connect to a REPL and send and read data?" Tags="|shell|process|repl|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17521" PostTypeId="2" ParentId="17249" CreationDate="2015-10-19T22:40:57.590" Score="5" Body="&lt;p&gt;I recently started using emacs outside of the terminal which was causing me some PATH issues. I had tried setting it by adding &lt;code&gt;(getenv &quot;PATH&quot;)&lt;/code&gt; to my exec-path, among other things that ultimately never worked. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ended up installing the &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;exec-path-from-shell package&lt;/a&gt; via melpa. It works by using your &lt;code&gt;$SHELL&lt;/code&gt; environment variable to ask your shell to print out your &lt;code&gt;$PATH&lt;/code&gt; and copying the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Here's the code I use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; I set this at the beginning of my init.el for other mac specific settings&#xA;(defconst *is-a-mac* (eq system-type 'darwin))&#xA;&#xA;;; Later on, after loading exec-path-from-shell package&#xA;(if *is-a-mac*&#xA;    (add-hook 'after-init-hook 'exec-path-from-shell-initialize))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3902" LastEditorUserId="3902" LastEditDate="2016-06-08T20:28:18.907" LastActivityDate="2016-06-08T20:28:18.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17522" PostTypeId="2" ParentId="17520" CreationDate="2015-10-19T22:54:17.383" Score="4" Body="&lt;p&gt;What you are looking for is called &lt;code&gt;comint-mode&lt;/code&gt; - the system which underlies most (all?) emacs interaction modes (lisp, scheme, shell, python, &amp;amp;c).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some starting points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.masteringemacs.org/article/comint-writing-command-interpreter&quot; rel=&quot;nofollow&quot;&gt;Comint: Writing your own Command Interpreter&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacswiki.org/emacs/ComintMode&quot; rel=&quot;nofollow&quot;&gt;Comint Mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-10-19T22:54:17.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17523" PostTypeId="2" ParentId="16500" CreationDate="2015-10-20T02:41:15.077" Score="2" Body="&lt;p&gt;This issue might be happening because you are loading &lt;code&gt;org&lt;/code&gt; package from system installation then loading it again from local installation (e.g. from a ELPA repository).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Double check if your have any &lt;code&gt;(require 'org)&lt;/code&gt; before &lt;code&gt;(package-initialize)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="639" LastActivityDate="2015-10-20T02:41:15.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17524" PostTypeId="2" ParentId="17508" CreationDate="2015-10-20T02:49:50.580" Score="4" Body="&lt;p&gt;This behavior seems to introduced by the packages &lt;code&gt;iso-transl&lt;/code&gt;. From the library's commentary (&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;find-library&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;iso-transl&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Loading this package defines three ways of entering the non-ASCII&#xA;  printable characters with codes above 127: the prefix C-x 8, or the&#xA;  Alt key, or a dead accent key.  For example, you can enter uppercase&#xA;  A-umlaut as &lt;code&gt;C-x 8 &quot; A' or&lt;/code&gt;Alt-&quot; A' (if you have an Alt key) or&#xA;  `umlaut A' (if you have an umlaut/diaeresis key).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To disable the keybinding for &lt;kbd&gt;A-m&lt;/kbd&gt; introduced by this package add something like this to your init file&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'iso-transl&#xA;  (let ((vec (vconcat &quot;m&quot;)))&#xA;    (aset vec 0 (logior (aref vec 0) ?\A-\^@))&#xA;    (define-key key-translation-map vec nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively if you want to disable all key translation set &lt;code&gt;iso-transl-char-map&lt;/code&gt; to nil before &lt;code&gt;iso-transl&lt;/code&gt; has loaded. Other way would be map over &lt;code&gt;iso-transl-char-map&lt;/code&gt; and unset keys like above, something like this&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (transl-char iso-transl-char-map)&#xA;  (let ((vec (vconcat (car transl-char))))&#xA;    (aset vec 0 (logior (aref vec 0) ?\A-\^@))&#xA;    (define-key key-translation-map vec nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After which your binding for the key will start working. This works, I tested by instructing emacs to use &lt;code&gt;meta&lt;/code&gt; key as &lt;code&gt;alt&lt;/code&gt; modifier and &lt;code&gt;alt&lt;/code&gt; key as &lt;code&gt;meta&lt;/code&gt; modifier by doing &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-meta-keysym 'alt)&#xA;(setq x-alt-keysym 'meta)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;kbd&gt;M-m&lt;/kbd&gt; will act as &lt;kbd&gt;A-m&lt;/kbd&gt;, to disable it do the reverse of the above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel you should &lt;a href=&quot;http://debbugs.gnu.org/&quot; rel=&quot;nofollow&quot;&gt;report&lt;/a&gt; this as a bug to emacs-devel, there should be a way to easily disable to the key translations introduced by &lt;code&gt;iso-transl&lt;/code&gt; (perhaps there is a way, but I don't see it).&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="247" LastEditDate="2015-10-20T09:54:54.563" LastActivityDate="2015-10-20T09:54:54.563" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17525" PostTypeId="1" AcceptedAnswerId="17526" CreationDate="2015-10-20T07:05:14.457" Score="0" ViewCount="302" Body="&lt;p&gt;When I'm in gnus and type m&#xA;I got the following error &#xA;&lt;code&gt;gnus-group-mail: Autoloading failed to define function gnus-nnir-group-p&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't not find the function &lt;code&gt;gnus-nnir-group-p&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this &lt;a href=&quot;https://emacs.stackexchange.com/questions/14290/projectile-installed-but-autoloading-failed-to-define-function-projectile-mode&quot;&gt;post&lt;/a&gt; , i tried &lt;code&gt;M-x list-load-path-shadows&lt;/code&gt; and think I've found the culprit. I'm still trying to sort this out. Any idea?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/share/emacs/site-lisp/gnus-bonus/spam-stat hides /usr/share/emacs/24.5/lisp/gnus/spam-stat&#xA;/usr/share/emacs/site-lisp/gnus-bonus/nnir hides /usr/share/emacs/24.5/lisp/gnus/nnir&#xA;/usr/share/emacs/site-lisp/gnus-bonus/nnnil hides /usr/share/emacs/24.5/lisp/gnus/nnnil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-11-19T07:47:14.403" Title="conflicting libraries Autoloading failed to define function: problem sending mail with gnus" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17526" PostTypeId="2" ParentId="17525" CreationDate="2015-10-20T07:39:18.747" Score="0" Body="&lt;p&gt;Apologies, I was too quick to rely on your help. &#xA;I found the answer &lt;a href=&quot;http://www.emacswiki.org/emacs/ConflictingLibraries&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. It was indeed a problem of conflicting libraries. I just put the &quot;right&quot; library up the &lt;code&gt;load-path&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt; as recommended :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcar load-path &quot;/usr/share/emacs/24.5/lisp/gnus&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/pdf-tools-20150716.643/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'll modify a little bit the title for the question to be more general. Thanks&lt;/p&gt;&#xA;" OwnerUserId="9340" LastActivityDate="2015-10-20T07:39:18.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17527" PostTypeId="1" CreationDate="2015-10-20T10:10:00.907" Score="3" ViewCount="572" Body="&lt;p&gt;I'm trying to run latex on remote host from the local host with tramp. &#xA;But it seems that it cannot find the file. To be more specific:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;start emacs on localhost: &lt;/li&gt;&#xA;&lt;li&gt;/ssh:user@remotehost:/tmp/test.tex&lt;/li&gt;&#xA;&lt;li&gt;compile latex on remote host using C-c C-c&lt;/li&gt;&#xA;&lt;li&gt;error cannot find the file test.tex&#xA;&quot; ! I can't find file `test.tex'.&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;so I guess it's trying to find &lt;code&gt;/ssh:user@remotehost:/tmp/test.tex&lt;/code&gt; but somehow cannot find it. May be it should look for &lt;code&gt;/tmp/test.tex&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;code&gt;knitr&lt;/code&gt; as well and found that it tries to execute&#xA;&lt;code&gt;/ssh:user@remotehost:foobar.rnw&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it should use the /ssh command since the program is running locally but I can't grasp what's happening. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;&#xA;Works fine when using emacs -Q. See comment below. will keep you posted once I have found what's wrong in the .emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 3&lt;/strong&gt;&#xA;The problem does not lies in the .emacs file though. I commented out everything in the .emacs and still got the same issue. I'll continue the investigation. But we are getting there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 4&lt;/strong&gt;&#xA;As suggested in the comments below firing emacs with the -Q option works find. I've got good results even with emacs -q. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Launching emacs -q is supposed to prevent loading the .emacs and the default.el files at startup. I place &lt;code&gt;(setq inhibit-default-init 1)&lt;/code&gt; in my .emacs file and commented the rest of the commands. Therefore only the command &lt;code&gt;(setq inhibit-default-init 1)&lt;/code&gt; is active in my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I launch emacs without any options and load tramp by hand &lt;code&gt;(require 'tramp)&lt;/code&gt; and tried latex again but still no success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must be missing something that the -q option does not load but I can't figure it out right now. &lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="9340" LastEditDate="2015-12-30T10:28:58.363" LastActivityDate="2020-04-21T03:53:57.853" Title="running latex on remote host with tramp" Tags="|tramp|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="17528" PostTypeId="2" ParentId="10504" CreationDate="2015-10-20T10:23:54.983" Score="6" Body="&lt;p&gt;By scheduling a meeting, we are making an &quot;appointment&quot;, which&#xA;1. Regardless its priority, it must be done at the scheduled date (and time) if it ever has to be done. In this sense, it kind of shapes the &quot;hard landscape&quot; of that day.&#xA;2. Usually, it is pointless to display the entry in agenda after the scheduled date no matter if you attend that meeting or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, the SCHEDULED in org-mode means that you plan to get started with that task on that day. It does not say if you must finish (or even start) it on that day or not. In fact, by default, org mode will show it in you agenda until you mark it done. This way, you not only know you've started a task but also is reminded how many days you spend on it (if you spend to many days, you may need reconsider about the task or split it into smaller ones).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for deadline, when you set a deadline for a task but don't schedule it, you probably want it done by that day but haven't made up your mind about when to do it. Maybe you want to do it whenever you got a chance, maybe you'll schedule it later. But anyway, you'll do it and complete before the deadline.&lt;/p&gt;&#xA;" OwnerUserId="9670" LastEditorUserId="9670" LastEditDate="2015-10-22T07:01:20.897" LastActivityDate="2015-10-22T07:01:20.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17529" PostTypeId="1" AcceptedAnswerId="40844" CreationDate="2015-10-20T13:07:02.370" Score="11" ViewCount="1477" Body="&lt;p&gt;I have the following in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;(setq desktop-restore-eager 10)&#xA;(setq desktop-save t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Often I have a lot of buffers open (100 or so), then this really helps - as emacs is loading buffers only when not beeing busy with something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, sometimes the following happens: I close emacs before I want to shut down my laptop. Then I realize - I need to edit one more file quickly - so I open emacs again, perform the editing, and then close it. If  this happens within a short amount of time, then &lt;code&gt;desktop-save-mode&lt;/code&gt; was not able to restore all previously saved buffers. In this case, when I now close emacs again, only the buffers that were restored are saved and the state before the initial shutdown is lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make the &lt;code&gt;desktop-save&lt;/code&gt; only happening, if the previously saved desktop has been completely restored?&lt;/p&gt;&#xA;" OwnerUserId="5254" LastEditorUserId="105" LastEditDate="2016-12-24T02:28:04.847" LastActivityDate="2018-04-06T14:26:26.293" Title="Emacs desktop-save-mode - only save desktop when previous desktop was fully restored" Tags="|start-up|desktop|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17530" PostTypeId="1" CreationDate="2015-10-20T13:14:11.403" Score="1" ViewCount="434" Body="&lt;p&gt;I want to have &lt;code&gt;w/&lt;/code&gt; expand to &lt;code&gt;with&lt;/code&gt; globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Defining the abbrev in the usual way works (e.g. typing&lt;code&gt;with C-x ag w/&lt;/code&gt;), and the entry in the &lt;code&gt;abbrev_defs&lt;/code&gt; file looks fine - output of &lt;code&gt;M-x list-abbrevs&lt;/code&gt; under &lt;code&gt;(global-abbrev-table)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;with&quot;         0    &quot;w/&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, typing &quot;w/&quot; in &lt;code&gt;abbrev-mode&lt;/code&gt; or even manually trying to expand this using &lt;code&gt;C-x '&lt;/code&gt; does not work. Why is that and how can I change it?&lt;/p&gt;&#xA;" OwnerUserId="5254" LastActivityDate="2015-10-20T20:14:45.220" Title="abbrev-mode - Expansion with trailing / does not work" Tags="|abbrev|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17531" PostTypeId="2" ParentId="17493" CreationDate="2015-10-20T14:34:54.923" Score="4" Body="&lt;p&gt;Firstly, &lt;em&gt;all&lt;/em&gt; file-local and directory-local variables are (necessarily) buffer-local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, Emacs is telling you that &lt;code&gt;sh-indentation&lt;/code&gt; is buffer-local (with a value of &lt;code&gt;2&lt;/code&gt;) in that buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can trust that Emacs isn't lying to you, and that it's not ignoring the local value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should suggest to you that maybe the behaviour you're looking for is &lt;em&gt;not&lt;/em&gt; entirely dependent on the variable you've set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important variable you've missed is &lt;code&gt;sh-basic-offset&lt;/code&gt;, but there's a whole section on indentation in the Commentary of &lt;code&gt;sh-script.el&lt;/code&gt; which you should read:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-library&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;sh-script&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-10-20T15:51:45.713" LastActivityDate="2015-10-20T15:51:45.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17532" PostTypeId="2" ParentId="17530" CreationDate="2015-10-20T15:06:34.980" Score="1" Body="&lt;p&gt;Expanding on djangoliv's comment, &quot;you cant'': abbrev's expands the last word and the &quot;/&quot; is not considered a word character. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this. Put this in a buffer: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abc/ def/ghi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then move by word (Meta-F and Meta-B). You'll see that &quot;abc&quot; &quot;def&quot; and &quot;ghi&quot; is moved over, but we stop at the slash. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can however modify what emacs-considers a word character via &lt;code&gt;M-x modify-syntax-entry / w&lt;/code&gt;. Then when you move word you'll see that / is included in the word. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://emacswiki.org/emacs/EmacsSyntaxTable&quot; rel=&quot;nofollow&quot;&gt;http://emacswiki.org/emacs/EmacsSyntaxTable&lt;/a&gt; for more information on syntax tables.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-10-20T16:53:22.883" LastActivityDate="2015-10-20T16:53:22.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17533" PostTypeId="2" ParentId="17519" CreationDate="2015-10-20T15:50:59.087" Score="1" Body="&lt;p&gt;Magit does not support this and I am not aware of any third-party support. Edit: in the comments on the question there is some talk about third-party support.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-11T10:52:33.977" LastActivityDate="2015-12-11T10:52:33.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17534" PostTypeId="2" ParentId="16929" CreationDate="2015-10-20T17:03:50.043" Score="2" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.gnu.org/software/gsrc/&quot; rel=&quot;nofollow&quot;&gt;gsrc&lt;/a&gt; for this. Just follow the instructions on the website - and be sure to read the manual. Basically, when you have a running &lt;code&gt;gsrc&lt;/code&gt; you can type&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;make -C gnu/emacs&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the latest stable version of emacs will be downloaded and compiled for you, including some of the dependencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't like the default configuration parameters that are used in &lt;code&gt;gsrc&lt;/code&gt;, therfore I alter the &lt;code&gt;config.mk&lt;/code&gt; file accordingly in the &lt;code&gt;gnu/emacs&lt;/code&gt; directory. Note, that if you want some third-party non-gnu dependencies (i.e. for image support in emacs), these libraries need to be present on your system.&lt;/p&gt;&#xA;" OwnerUserId="5254" LastActivityDate="2015-10-20T17:03:50.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17535" PostTypeId="1" CreationDate="2015-10-20T17:07:27.183" Score="2" ViewCount="610" Body="&lt;p&gt;I currently have a few latex templates stored in a folder. Then I copy and paste to create a new document. I want to streamline this process because, well, I am lazy and I like to play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preferably, my latex templates are stored in a single org file as &lt;code&gt;BEGIN_LATEX&lt;/code&gt; blocks. And I want function(s) &lt;code&gt;(create-latex-doc-from-template template-name)&lt;/code&gt; so that I can turn it into a org-mode link. When I click on the link, it'll create a new buffer with the specified template.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since these templates are usually pretty big in size, I need proper syntax highlighting to edit them. So &lt;code&gt;yasnippet&lt;/code&gt; doesn't work for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on what I need for this? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="9374" LastActivityDate="2015-10-20T17:07:27.183" Title="use org-mode to manage latex templates" Tags="|org-mode|latex|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17537" PostTypeId="1" CreationDate="2015-10-20T18:00:03.317" Score="11" ViewCount="9004" Body="&lt;p&gt;I know this isn't the best type of question for stack... but I can't think of another place where it might get enough exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I really like company-mode, but sometimes it's annoying to have to manually switch to the next backend (company-try-hard is handy here). I've started playing around with grouped backends, and I can see some awesome potential. Unfortunately, I'm not happy with anything I've tried so far. I think this might be better set with hooks for different modes. Does anyone have some interesting company-backends lists that I could get some inspiration from?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mainly use python (elpy), javascript (js3-mode), web (web-mode) and shell scripts if that helps.&lt;/p&gt;&#xA;" OwnerUserId="3852" LastActivityDate="2015-10-21T02:45:38.717" Title="Best company-backends lists" Tags="|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17538" PostTypeId="2" ParentId="17327" CreationDate="2015-10-20T18:50:17.020" Score="4" Body="&lt;p&gt;Try the following:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/point-in-defun-declaration-p ()&#xA;  (let ((bod (save-excursion (c-beginning-of-defun)&#xA;                             (point))))&#xA;    (&amp;lt;= bod&#xA;        (point)&#xA;        (save-excursion (goto-char bod)&#xA;                        (re-search-forward &quot;{&quot;)&#xA;                        (point)))))&#xA;&#xA;(defun my/arglist-cont-nonempty-indentation (arg)&#xA;  (unless (my/point-in-defun-declaration-p) '++))&#xA;&#xA;(push '(arglist-cont-nonempty &#xA;        my/arglist-cont-nonempty-indentation &#xA;        c-lineup-gcc-asm-reg &#xA;        c-lineup-arglist) &#xA;      c-offsets-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tested it, and it appears to be working.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-10-20T18:50:17.020" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17539" PostTypeId="2" ParentId="17530" CreationDate="2015-10-20T20:14:45.220" Score="2" Body="&lt;p&gt;I think I found a solution without modification of the syntax-table.&lt;/p&gt;&#xA;&lt;p&gt;From the GNU Emacs Manual - &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Abbrev-Table-Properties.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sect. 35.7 &lt;em&gt;Abbrev Table Properties&lt;/em&gt;:&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;:regexp&lt;/p&gt;&#xA;&lt;p&gt;[...]&lt;/p&gt;&#xA;&lt;p&gt;If this property is nil, the default is to use backward-word and forward-word to find the name. This property allows the use of abbrevs whose name contains characters of non-word syntax.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I.e. it is only the default behaviour that non-word syntax is used to define the abbrev &amp;quot;boundaries&amp;quot;, but this can be configured.&lt;/p&gt;&#xA;&lt;p&gt;And indeed:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(abbrev-table-put org-mode-abbrev-table :regexp &amp;quot;\\(\\\\[a-z0-9@]+\\)&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;lets me insert abbrevs with leading and trailing slashes in &lt;code&gt;org-mode&lt;/code&gt;. (For other modes, or globally &lt;code&gt;org-mode-abbrev-table&lt;/code&gt; needs to be replaced accordingly)&lt;/p&gt;&#xA;&lt;p&gt;(With help from reddit: &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3pi8wx/abbrevmode_expansion_with_trailing_does_not_work/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.reddit.com/r/emacs/comments/3pi8wx/abbrevmode_expansion_with_trailing_does_not_work/&lt;/a&gt; )&lt;/p&gt;&#xA;" OwnerUserId="5254" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-20T20:14:45.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17540" PostTypeId="1" AcceptedAnswerId="17541" CreationDate="2015-10-20T20:47:36.927" Score="2" ViewCount="251" Body="&lt;p&gt;I am using sql mode. Is there a way to connect multiple buffers to a single sql connection? When I try to connect an existing buffer to a database, it always creates a new connection instead of reusing the existing one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate the help.&lt;/p&gt;&#xA;" OwnerUserId="5117" LastActivityDate="2015-10-20T20:57:11.643" Title="How do I make multiple buffers use a single sql connection?" Tags="|sql-interactive-mode|sql|sql-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17541" PostTypeId="2" ParentId="17540" CreationDate="2015-10-20T20:57:11.643" Score="1" Body="&lt;p&gt;The &lt;code&gt;sql-set-sqli-buffer-generally&lt;/code&gt; command can be used to make all the buffers use the latest connection created. For a related question, see: &lt;a href=&quot;https://stackoverflow.com/a/5431463/1589512&quot;&gt;https://stackoverflow.com/a/5431463/1589512&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5117" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-10-20T20:57:11.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17542" PostTypeId="1" AcceptedAnswerId="17581" CreationDate="2015-10-20T21:34:56.173" Score="14" ViewCount="1513" Body="&lt;p&gt;I ran into a bug that involved an interaction between several packages. In order to report the bug, I need to provide a reproducible recipe illustrating the problem. This requires loading the appropriate packages, but nothing else from my init, and no other packages. What is the best way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify, I am familiar with the concept of sifting through my .emacs in a binary search to identify the code causing a problem. In this situation, I know exactly what packages are causing the problem already. What I don't know, is how to use the &lt;code&gt;package-&lt;/code&gt; system to load just those few packages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(package-initialize)&lt;/code&gt; will load the packages, but also everything else in my &lt;code&gt;.emacs.d/elpa&lt;/code&gt; directory. &lt;code&gt;package-load-list&lt;/code&gt; allows me to specify particular versions of packages to load, or particular packages to explicitly &lt;em&gt;exclude&lt;/em&gt;. I need the reverse - how to supply Emacs with a list of packages to &lt;em&gt;include&lt;/em&gt;, without loading any other packages in the elpa/package system. &lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2015-10-22T12:45:33.340" LastActivityDate="2020-04-26T16:50:52.467" Title="How to load only a subset of installed packages" Tags="|package|package-development|" AnswerCount="4" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17543" PostTypeId="1" AcceptedAnswerId="17579" CreationDate="2015-10-20T21:37:09.573" Score="25" ViewCount="10795" Body="&lt;p&gt;I am using the Macports flavor of Emacs on OSX Yosemite, and have looked through every thread here on Tramp being slow without any solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tramp is usable, but there is about a 100ms delay between every action. It's not a problem on the server's end because this delay does not exist if I just use terminal/iTerm to just ssh to the same server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought maybe the problem was limited to editing files, but it turns out it's ubiquitous. Whether I'm using just a remote shell, or just pressing &lt;code&gt;M-x&lt;/code&gt; (with helm) it's all delayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried ssh, scp, and rsync as methods for connecting without any solution. Also have tried the &lt;code&gt;ControlMaster auto&lt;/code&gt; without any effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone else had this problem, and was able to solve it?&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2018-01-03T02:20:40.540" Title="Tramp mode is much slower than using terminal to ssh" Tags="|shell|tramp|remote|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17544" PostTypeId="2" ParentId="630" CreationDate="2015-10-20T22:17:43.537" Score="3" Body="&lt;p&gt;&lt;em&gt;Note: The accepted answer on this question is not the optimal solution!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing the syntax table is not neccesary to alter the behaviour of what is expanded and what not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default emacs uses indeed word syntax, i.e. non-word characters like &lt;code&gt;_&lt;/code&gt; and &lt;code&gt;/&lt;/code&gt; etc. can not occur in an abbrev.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this behaviour can be customized per abrrev-table. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Abbrev-Table-Properties.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sect. 35.7 &lt;em&gt;Abbrev Table Properties&lt;/em&gt;&lt;/a&gt; of the emacs manual. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(abbrev-table-put table :regexp val)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can add an regular expression &lt;code&gt;val&lt;/code&gt; instead of word-syntax to the abbrev-table &lt;code&gt;table&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I'm not so familiar with emacs regular expressions, I cannot give you the answer of what exactly you would need to put there in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, have a look at this answer on stackoverflow, you can start experimenting from the solution presented there: &lt;a href=&quot;https://stackoverflow.com/questions/18232384/how-to-replace-a-string-with-a-non-backslashed-string-in-emacs-abbrev-mode&quot;&gt;https://stackoverflow.com/questions/18232384/how-to-replace-a-string-with-a-non-backslashed-string-in-emacs-abbrev-mode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5254" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-10-20T22:17:43.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17545" PostTypeId="1" CreationDate="2015-10-21T01:21:42.557" Score="22" ViewCount="5495" Body="&lt;p&gt;I can see many image formats in orgmode, but not SVG. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the error &lt;code&gt;Invalid image type 'svg'&lt;/code&gt; when I run &lt;code&gt;org-display-inline-images&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be possible given this question exists: &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/2o21gf/orgmode_svg_rendering/&quot; rel=&quot;noreferrer&quot;&gt;https://www.reddit.com/r/emacs/comments/2o21gf/orgmode_svg_rendering/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't see an obvious package to install, or other way to fix this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: This is on Mac OS X 10.9.5, Emacs 24.4.1 (installed via homebrew), Org 8.3.2. &lt;code&gt;(image-type-available-p 'svg)&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8234" LastEditorUserId="8234" LastEditDate="2015-10-21T17:41:21.470" LastActivityDate="2023-01-20T10:45:42.060" Title="Inline SVG's in org-mode?" Tags="|org-mode|images|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17546" PostTypeId="1" AcceptedAnswerId="17552" CreationDate="2015-10-21T01:44:57.813" Score="4" ViewCount="502" Body="&lt;p&gt;I'm using Emacs 24.5.1 in Mac OS X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently I had to input &lt;code&gt;£&lt;/code&gt; frequently so I changed my input source from U.S. to British. With British keyboard, &lt;kbd&gt;Option+3&lt;/kbd&gt; will yield &lt;code&gt;#&lt;/code&gt; in other editors, however, this doesn't work in Emacs since &lt;code&gt;M&lt;/code&gt; is special keystroke in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I insert &lt;code&gt;#&lt;/code&gt; in Emacs in Mac OS X with Brithsh keyboard?&lt;/p&gt;&#xA;" OwnerUserId="630" LastEditorUserId="2287" LastEditDate="2015-10-21T02:33:50.943" LastActivityDate="2015-10-21T04:07:00.453" Title="How to input '#' in Emacs with UK keyboard on Mac OS X?" Tags="|keystrokes|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17547" PostTypeId="1" AcceptedAnswerId="17564" CreationDate="2015-10-21T01:59:08.933" Score="1" ViewCount="441" Body="&lt;p&gt;After updating to magit v2.2.0 (and removing the old &lt;code&gt;magit&lt;/code&gt;, &lt;code&gt;git-rebase-mode&lt;/code&gt; and &lt;code&gt;git-commit-mode&lt;/code&gt; I got the following error message after calling &lt;code&gt;M-x magit-status&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: symbolp, (cyg . win)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and Magit does not fire up. Thought it could come from my init file but removing it did not solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x magit-version&lt;/code&gt; gives Magit 20151019.443, Git 2.6.2, Emacs 24.4.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OS: Ubuntu 15.04&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints? Thx!&lt;/p&gt;&#xA;" OwnerUserId="9882" LastActivityDate="2015-10-21T14:15:18.937" Title="Magit v2.2.0 failed to load: wrong type argument" Tags="|magit|install|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17548" PostTypeId="2" ParentId="17537" CreationDate="2015-10-21T02:45:38.717" Score="15" Body="&lt;p&gt;You can set a default &lt;code&gt;company-backends&lt;/code&gt;, then use hook to append different backends to different mode.&#xA;Here is a way I config in my emacs.&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; set default `company-backends'&#xA;(setq company-backends&#xA;      '((company-files          ; files &amp;amp; directory&#xA;         company-keywords       ; keywords&#xA;         company-capf&#xA;         company-yasnippet&#xA;         )&#xA;        (company-abbrev company-dabbrev)&#xA;        ))&#xA;&#xA;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (add-to-list (make-local-variable 'company-backends)&#xA;                         'company-anaconda)))&#xA;(dolist (hook '(js-mode-hook&#xA;                js2-mode-hook&#xA;                js3-mode-hook&#xA;                inferior-js-mode-hook&#xA;                ))&#xA;  (add-hook hook&#xA;            (lambda ()&#xA;              (tern-mode t)&#xA;&#xA;              (add-to-list (make-local-variable 'company-backends)&#xA;                           'company-tern)&#xA;              )))&#xA;&#xA;;;;_. company-mode support like auto-complete in web-mode&#xA;&#xA;;; Enable CSS completion between &amp;lt;style&amp;gt;...&amp;lt;/style&amp;gt;&#xA;(defadvice company-css (before web-mode-set-up-ac-sources activate)&#xA;  &quot;Set CSS completion based on current language before running `company-css'.&quot;&#xA;  (if (equal major-mode 'web-mode)&#xA;      (let ((web-mode-cur-language (web-mode-language-at-pos)))&#xA;        (if (string= web-mode-cur-language &quot;css&quot;)&#xA;            (unless css-mode (css-mode))))))&#xA;&#xA;;; Enable JavaScript completion between &amp;lt;script&amp;gt;...&amp;lt;/script&amp;gt; etc.&#xA;(defadvice company-tern (before web-mode-set-up-ac-sources activate)&#xA;  &quot;Set `tern-mode' based on current language before running `company-tern'.&quot;&#xA;  (if (equal major-mode 'web-mode)&#xA;      (let ((web-mode-cur-language (web-mode-language-at-pos)))&#xA;        (if (or (string= web-mode-cur-language &quot;javascript&quot;)&#xA;               (string= web-mode-cur-language &quot;jsx&quot;))&#xA;            (unless tern-mode (tern-mode))&#xA;          ;; (if tern-mode (tern-mode))&#xA;          ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for web-mode, you also can use package `company-web'.&lt;/li&gt;&#xA;&lt;li&gt;or shell script, there are other packages support completion, you can search for it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="411" LastActivityDate="2015-10-21T02:45:38.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17549" PostTypeId="2" ParentId="17542" CreationDate="2015-10-21T02:49:55.203" Score="4" Body="&#xA;&#xA;&lt;p&gt;An option that would work well in contexts where the developers working on reproducing the bug may not already have (or want) those dependencies installed is to use the &lt;code&gt;try&lt;/code&gt; package (&lt;a href=&quot;https://melpa.org/#/try&quot; rel=&quot;nofollow&quot;&gt;https://melpa.org/#/try&lt;/a&gt;).  Others can load a packages from package management without modifying their local installation.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-install 'try)&#xA;(require 'try)&#xA;&#xA;(try 'some-package)&#xA;(try 'some-other-package)&#xA;&#xA;(steps (to reproduce) (the (problem)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="115" LastEditDate="2015-10-21T20:07:20.010" LastActivityDate="2015-10-21T20:07:20.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17550" PostTypeId="1" AcceptedAnswerId="17657" CreationDate="2015-10-21T02:58:20.867" Score="10" ViewCount="1373" Body="&lt;p&gt;I've been Googling and digging through the &lt;code&gt;org-babel&lt;/code&gt; docs, but it's coming out with not a lot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, one of things I'm working on is &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-makefile.html&quot;&gt;using org-babel to tangle Makefile source&lt;/a&gt;. In it, the documentation states, and I understand why it does, that I need to evaluate &lt;code&gt;(setq org-src-preserve-indentation t)&lt;/code&gt;, which I have, right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thing is, I don't &lt;em&gt;want&lt;/em&gt; to enable this value globally. I can understand that it makes sense for Python, Makefile, or other languages that are white-space sensitive, but I &lt;em&gt;really&lt;/em&gt; don't want it enabled elsewhere. Plus, the end result of this is that the final org-file won't work for people who &lt;em&gt;don't&lt;/em&gt; enable the value by default, so the resulting org-file is less portable anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd prefer it if I could &lt;em&gt;just&lt;/em&gt; enable &lt;code&gt;org-src-preserve-indentation&lt;/code&gt; on a per code-block basis (it's extra typing, but I can live with that), but even a buffer-specific setting is acceptable. The thing is, I'm not sure how to do it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;suspect&lt;/em&gt; that it &lt;em&gt;could&lt;/em&gt; be done by taking advantage of how &lt;code&gt;#+HEADER&lt;/code&gt; settings can eval Lisp code, but doesn't that mean that every time I tangle the file, or something, the setting is kept on every time? I'd rather not do that, that just makes the file unpredictable to use.&lt;/p&gt;&#xA;" OwnerUserId="5509" LastActivityDate="2015-10-26T07:01:32.733" Title="Using org-src-preserve-indentation only on specific code blocks (or buffers, or anything beyond the global context, really)" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17551" PostTypeId="2" ParentId="17547" CreationDate="2015-10-21T03:09:47.657" Score="0" Body="&lt;p&gt;Recent magit updates broke compatibility with older versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to fix it is to remove it from your &lt;code&gt;.emacs.d&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rm -rf ~/.emacs.d/elpa/magit*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Restart your Emacs and install Magit again and everything should be fine.&lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2015-10-21T03:09:47.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17552" PostTypeId="2" ParentId="17546" CreationDate="2015-10-21T04:07:00.453" Score="5" Body="&lt;p&gt;There are other methods than the one mentioned in this answer, but I personally prefer the best of both worlds -- i.e., I use the left alt/option key as meta, and I use the right alt/option key for stock Apple stuff -- e.g., special characters like the ones mentioned by the original poster:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq ns-alternate-modifier 'meta)&#xA;(setq ns-right-alternate-modifier 'none)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-10-21T04:07:00.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17553" PostTypeId="2" ParentId="7890" CreationDate="2015-10-21T05:22:12.230" Score="19" Body="&lt;p&gt;The correct way to do this with use-package is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org&#xA;  :ensure org-plus-contrib&#xA; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first argument makes sure that it is the org.el file being sourced. The :ensure argument makes sure that you are getting the version with all the extras. Of course you also need to have &lt;code&gt;(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)&lt;/code&gt; in your package-archives alist.&lt;/p&gt;&#xA;" OwnerUserId="9006" LastActivityDate="2015-10-21T05:22:12.230" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17554" PostTypeId="1" CreationDate="2015-10-21T05:41:13.677" Score="6" ViewCount="2091" Body="&lt;p&gt;I'm not a lisp programmer. But I'm an emacs user, so I use elisp from times to times to do simple scripting. I'm not familiar with lisp style and I'm quite incompatible with it. Default indents quickly become over 80 whitespaces long making the program unreadable. Lisp style implies writing all braces in the single line and that makes me crazy. I'm much more comfortable with the K-R notation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def doSomething() {&#xA;  ...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That style may be easily adopted to lisp code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun doSomething ()&#xA;   ...&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I'm using it for my code, see &lt;a href=&quot;https://stackoverflow.com/questions/12965814/emacs-how-can-i-eliminate-whitespace-mode-in-auto-complete-pop-ups/27960576#27960576&quot;&gt;example&lt;/a&gt;. But accidental calls to the indent function ruins line. That is not a big deal, undo function works well. But that still bothers me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'd like to change indent function for lisp mode in either way:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;work like for java mode (preferred)&lt;/li&gt;&#xA;&lt;li&gt;do nothing (not make things worse at least)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9629" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-08-22T22:03:33.293" Title="How to change lisp mode indentation style" Tags="|indentation|emacs-lisp-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17556" PostTypeId="5" CreationDate="2015-10-21T09:54:39.297" Score="0" Body="&lt;p&gt;Go, also called golang, is an open source programming language initially developed at Google. It is statically-typed language, has syntax loosely derived from C, but learning however from C's mistakes. Concurrent communication is handled by Hoare-style message passing. Go has automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-10-21T11:30:52.527" LastActivityDate="2015-10-21T11:30:52.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17557" PostTypeId="4" CreationDate="2015-10-21T09:54:39.297" Score="0" Body="Go is an open source programming language that makes it easy to build simple, reliable, and efficient software." OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-10-21T11:30:57.340" LastActivityDate="2015-10-21T11:30:57.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17558" PostTypeId="1" CreationDate="2015-10-21T11:34:56.243" Score="10" ViewCount="1004" Body="&lt;p&gt;Is this something that can / should be done? For example, often I use emacs in my user account and sometimes root account. When using the package manager (i.e marmalade or something) do I have to install the same packages seperately for each account? It seems to me that they get installed in your home directory.&lt;/p&gt;&#xA;" OwnerUserId="9887" LastActivityDate="2015-10-21T13:18:48.420" Title="Install packages globallly" Tags="|package|package-repositories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17559" PostTypeId="1" CreationDate="2015-10-21T11:44:03.707" Score="1" ViewCount="1138" Body="&lt;p&gt;I've got the following configuration set up for displaying my current agenda and tagged todo items:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq org-agenda-custom-commands&#xA;        '((&quot;g&quot; &quot;Plan today&quot;&#xA;           ((agenda &quot;&quot;)&#xA;            (tags-todo &quot;Computer&quot;)&#xA;            (tags-todo &quot;Online&quot;)&#xA;            ...&#xA;            )&#xA;           )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When called with &lt;code&gt;C-c a g&lt;/code&gt; this shows the agenda for the current week. I can switch to the current fortnight using &lt;code&gt;v t&lt;/code&gt; which is org-agenda-fortnight-view, but when calling the agenda again, it switches back to week view. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I do to make the fortnight-view the default?&lt;/p&gt;&#xA;" OwnerUserId="204" LastActivityDate="2015-12-20T12:42:39.820" Title="How do I make org-agenda-fortnight-view the default in custom block agenda?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17560" PostTypeId="2" ParentId="17559" CreationDate="2015-10-21T11:52:57.317" Score="2" Body="&lt;p&gt;The related questions section here on SO actually provided me with a pointer to the solution, which is to set the org-agenda-span variable/option like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq org-agenda-custom-commands&#xA;        '((&quot;g&quot; &quot;Plan today&quot;&#xA;           ((agenda &quot;&quot; ((org-agenda-span 14)))&#xA;            (tags-todo &quot;Computer&quot;)&#xA;            ...&#xA;            )&#xA;           )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="204" LastActivityDate="2015-10-21T11:52:57.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17561" PostTypeId="2" ParentId="17558" CreationDate="2015-10-21T12:06:39.263" Score="3" Body="&lt;p&gt;According to the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;package-directory-list's value is&lt;br&gt;&#xA;  (&quot;/usr/local/share/emacs/24.4/site-lisp/elpa&quot;&#xA;  &quot;/usr/local/share/emacs/site-lisp/elpa&quot;&#xA;  &quot;/usr/share/emacs/24.4/site-lisp/elpa&quot;&#xA;  &quot;/usr/share/emacs/site-lisp/elpa&quot;)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This variable may be risky if used as a file-local variable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: List of additional directories containing Emacs Lisp&#xA;  packages. Each directory name should be absolute.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;These directories contain packages intended for system-wide; in&#xA;  contrast, `package-user-dir' contains packages for personal use.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This variable was introduced, or its default value was changed, in&#xA;  version 24.1 of Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Another &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Files.html#Package-Files&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In addition to package-user-dir, Emacs looks for installed packages in&#xA;  the directories listed in package-directory-list. These directories&#xA;  are meant for system administrators to make Emacs packages available&#xA;  system-wide; Emacs itself never installs packages there. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, for site wide install, I suggest you to, as a system administrator, manually install the packages inside /usr/local/share/emacs/site-lisp/elpa. Or you can also do as suggested by @Stefan&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-10-21T13:18:48.420" LastActivityDate="2015-10-21T13:18:48.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17562" PostTypeId="2" ParentId="17558" CreationDate="2015-10-21T12:56:23.020" Score="7" Body="&lt;p&gt;As pointed out by Nsukami, package.el does support system-wide packages.  But as your subsequent question points out, it does not provide any special help to &lt;em&gt;install&lt;/em&gt; packages in a system-wide manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way you can do that is by using something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-user-dir &quot;/usr/share/emacs/site-lisp/elpa&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your root account's &lt;code&gt;~/.emacs&lt;/code&gt;.  This will make the root user's installed packages available to all users (since &lt;code&gt;/usr/share/emacs/site-lisp/elpa&lt;/code&gt; should normally appear in the default value of &lt;code&gt;package-directory-list&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-10-21T12:56:23.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17563" PostTypeId="1" AcceptedAnswerId="17565" CreationDate="2015-10-21T14:12:51.893" Score="7" ViewCount="2932" Body="&lt;p&gt;When I write Python code, I personally prefer indenting with 4 spaces instead of a tab. However, in my day job I work with a codebase that uses only tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I open one of these files in emacs, tabs display eight spaces wide. I have tried adding both &lt;code&gt;(setq-default tab-width 4)&lt;/code&gt; and &lt;code&gt;(setq tab-width 4)&lt;/code&gt; to my init file, but neither of these seem to have any affect on this problem. I have used &lt;code&gt;whitespace-mode&lt;/code&gt; to confirm that it is indeed one tab that I am seeing and not two, and that they are indeed eight spaces wide. When I check the value of the variable &lt;code&gt;tab-width&lt;/code&gt; from whatever buffer I am having the problem in, I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tab-width is a variable defined in `C source code'.&#xA;Its value is 8&#xA;Local in buffer &amp;lt;whateverbuffer&amp;gt;; global value is 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that I want &lt;code&gt;Its value&lt;/code&gt; to be 4 instead of eight, but I have not had any luck setting it. Also, in the documentation it says of &lt;code&gt;tab-width&lt;/code&gt;: &lt;code&gt;Automatically becomes buffer-local when set&lt;/code&gt;...I have a feeling my problem stems from this, but I don't quite understand what this means. Any suggestions? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-10-21T15:40:02.783" Title="Trouble adjusting tab-width" Tags="|indentation|python|tabs|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17564" PostTypeId="2" ParentId="17547" CreationDate="2015-10-21T14:15:18.937" Score="2" Body="&lt;p&gt;The problem is that the Magit package on Melpa (&quot;non-stable&quot;) depends on version &lt;code&gt;2.11.0&lt;/code&gt; of Dash and that versions (i.e. snapshot) strings on Melpa have the form &lt;code&gt;YYYYMMDD.SSSS&lt;/code&gt;, which is always larger than &lt;code&gt;2.MM.SS&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll fix that, but meanwhile you can just install the most recent Dash version explicitly.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-10-21T14:15:18.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17565" PostTypeId="2" ParentId="17563" CreationDate="2015-10-21T14:59:45.620" Score="7" Body="&lt;p&gt;The first line when enabling &lt;code&gt;python-mode&lt;/code&gt; is &lt;code&gt;(set (make-local-variable 'tab-width) 8)&lt;/code&gt;.  Because &lt;code&gt;tab-width&lt;/code&gt; is a buffer-local variable, a new value would need to be set subsequent to the code above.  The most common way this is done is with a major-mode hook, in this case the &lt;code&gt;python-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a variable called &lt;code&gt;python-indent-offset&lt;/code&gt;, which is used when the function &lt;code&gt;python-indent-guess-indent-offset&lt;/code&gt; can't figure out what indentation to use.  That should be set outside of the major-mode hook so that its custom value is available when &lt;code&gt;python-mode&lt;/code&gt; first initializes.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq python-indent-offset 4)&#xA;&#xA;(defun python-custom-settings ()&#xA;  (setq tab-width 4))&#xA;&#xA;(add-hook 'python-mode-hook 'python-custom-settings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-10-21T15:40:02.783" LastActivityDate="2015-10-21T15:40:02.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17566" PostTypeId="1" AcceptedAnswerId="17571" CreationDate="2015-10-21T15:32:36.013" Score="7" ViewCount="2707" Body="&lt;p&gt;How do you configure emacs to open a file in the current window -- using the mouse -- when it is selected from a &lt;code&gt;dired&lt;/code&gt; buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, when I open a directory and then select a file with the mouse I want the file displayed in the same window which displayed the &lt;code&gt;dired&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="9892" LastEditorUserId="2287" LastEditDate="2015-10-21T16:12:17.267" LastActivityDate="2023-12-09T03:09:05.497" Title="Open file from dired in the same window -- using the mouse" Tags="|dired|window-splitting|" AnswerCount="5" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17567" PostTypeId="2" ParentId="52" CreationDate="2015-10-21T15:40:18.367" Score="13" Body="&lt;p&gt;There are today many packages that solve this problem (as of 2018). Some of them are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://melpa.org/#/sudo-edit&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;sudo-edit&lt;/code&gt;&lt;/a&gt;, allows to switch editing rights on an already opened read-only file. Just &lt;code&gt;M-x sudo&lt;/code&gt; and type a password and you're done. After many years of use of this one, I think it is the more convenient for this need. &lt;code&gt;sudo-edit&lt;/code&gt; allows you to open a file as any user, but it default on sudo if none provided.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://melpa.org/#/dired-toggle-sudo&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;dired-toggle-sudo&lt;/code&gt;&lt;/a&gt;. It was &lt;a href=&quot;https://github.com/renard/dired-toggle-sudo/issues/1&quot; rel=&quot;noreferrer&quot;&gt;the first packaged solution&lt;/a&gt; I found after asking this question. It is Dired oriented, so if you prefer the &lt;em&gt;file&lt;/em&gt; oriented version, see the first bullet of this list. &lt;/li&gt;&#xA;&lt;li&gt;Other solutions &lt;a href=&quot;https://melpa.org/#/?q=sudo&quot; rel=&quot;noreferrer&quot;&gt;exists on Melpa&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="119" LastEditorUserId="119" LastEditDate="2018-12-27T10:07:43.090" LastActivityDate="2018-12-27T10:07:43.090" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="17568" PostTypeId="1" CreationDate="2015-10-21T15:57:16.537" Score="0" ViewCount="546" Body="&lt;p&gt;I am sending text to a REPL as if I had typed it in, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert &quot;source activate py3; hy&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I do the programmatic equivalent of pressing &lt;kbd&gt;enter&lt;/kbd&gt; after inserting this string?&lt;/p&gt;&#xA;" OwnerUserId="8653" LastEditorUserId="253" LastEditDate="2015-10-22T13:21:29.267" LastActivityDate="2015-10-22T13:21:29.267" Title="How do I send a string to a REPL?" Tags="|repl|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17569" PostTypeId="2" ParentId="17568" CreationDate="2015-10-21T15:57:46.437" Score="1" Body="&lt;p&gt;For a REPL, it was simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(comint-send-input)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8653" LastActivityDate="2015-10-21T15:57:46.437" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17570" PostTypeId="1" AcceptedAnswerId="17590" CreationDate="2015-10-21T16:29:05.387" Score="2" ViewCount="1546" Body="&lt;p&gt;From time to time I am using &lt;code&gt;gdb&lt;/code&gt; through the &lt;code&gt;gud&lt;/code&gt; Emacs interface to debug my C programs. Nevertheless, I find extremely annoying to not be able to browse the &lt;code&gt;gdb&lt;/code&gt; command history by just using the &lt;kbd&gt;Up&lt;/kbd&gt; and &lt;kbd&gt;Down&lt;/kbd&gt; keys. In place of this behavior, the cursor can move anywhere in the emacs buffer even outside of the regular &lt;code&gt;gdb&lt;/code&gt; prompt (which I find totally useless for my purpose).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to force &lt;code&gt;gud&lt;/code&gt; to take the &lt;kbd&gt;Up&lt;/kbd&gt; and &lt;kbd&gt;Down&lt;/kbd&gt; keys as get backward and forward in the command history. And, is there a way to prevent the cursor to move away from the &lt;code&gt;gdb&lt;/code&gt; prompt ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea would be to have a behavior similar to the &lt;code&gt;M-x term&lt;/code&gt; terminal, but for &lt;code&gt;gdb&lt;/code&gt; and having the benefit of &lt;code&gt;gud&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="333" LastEditorUserId="333" LastEditDate="2015-10-21T16:39:01.057" LastActivityDate="2015-10-22T08:18:30.040" Title="How to browse through the gdb command history in gud?" Tags="|gud|gdb|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17571" PostTypeId="2" ParentId="17566" CreationDate="2015-10-21T17:19:56.243" Score="4" Body="&lt;p&gt;If you really want that, just define your own command to do it. You can copy the code for what &lt;code&gt;mouse-2&lt;/code&gt; is already bound to, &lt;code&gt;dired-mouse-find-file-other-window&lt;/code&gt;, and just change the occurrence of &lt;code&gt;find-file-other-window&lt;/code&gt; to &lt;code&gt;find-file&lt;/code&gt;.  Then bind your command to &lt;code&gt;mouse-2&lt;/code&gt;, in place of &lt;code&gt;dired-mouse-find-file-other-window&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only changes I made here are (1) the name of the command and (2) &lt;code&gt;find-file-other-window&lt;/code&gt; instead of &lt;code&gt;find-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-mouse-find-file (event)&#xA;  &quot;In Dired, visit the file or directory name you click on.&quot;&#xA;  (interactive &quot;e&quot;)&#xA;  (let (window pos file)&#xA;    (save-excursion&#xA;      (setq window (posn-window (event-end event))&#xA;            pos (posn-point (event-end event)))&#xA;      (if (not (windowp window))&#xA;          (error &quot;No file chosen&quot;))&#xA;      (set-buffer (window-buffer window))&#xA;      (goto-char pos)&#xA;      (setq file (dired-get-file-for-visit)))&#xA;    (if (file-directory-p file)&#xA;        (or (and (cdr dired-subdir-alist)&#xA;                 (dired-goto-subdir file))&#xA;            (progn&#xA;              (select-window window)&#xA;              (dired-other-window file)))&#xA;      (select-window window)&#xA;      (find-file (file-name-sans-versions file t)))))&#xA;&#xA;(define-key dired-mode-map [mouse-2] 'dired-mouse-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if you want to also replace (kill) the Dired buffer then use &lt;code&gt;find-alternate-file&lt;/code&gt; instead of &lt;code&gt;find-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-21T21:30:50.847" LastActivityDate="2015-10-21T21:30:50.847" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17572" PostTypeId="1" AcceptedAnswerId="17656" CreationDate="2015-10-21T18:56:28.777" Score="2" ViewCount="3007" Body="&lt;p&gt;In Windows I've set my default font height to &lt;code&gt;120&lt;/code&gt; with: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'default nil :height 120)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to not take effect in &lt;code&gt;org-mode&lt;/code&gt;, however, when specially formatting is applied. For example, when I use &lt;code&gt;//&lt;/code&gt; or &lt;code&gt;**&lt;/code&gt; to italicize or bold, the font size shrinks when the formatting is applied. What setting am I missing to have org-mode use the correct formatting with its specially formatted text. The rest of the text looks right. It's just the formatted stuff that is shrunk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example below. Note that after the &quot;have,&quot; the text no longer aligns because the italicized &lt;em&gt;have&lt;/em&gt; has shrunk:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0gCHz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0gCHz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-10-26T05:24:29.197" Title="Org-mode font size changes with formatting" Tags="|org-mode|font-lock|formatting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17573" PostTypeId="1" AcceptedAnswerId="18942" CreationDate="2015-10-21T18:57:20.867" Score="5" ViewCount="1219" Body="&lt;p&gt;To ssh, the server I am connecting to needs a password followed by an RSA-like key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It goes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Password:&#xA;Verification code:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've read &lt;a href=&quot;https://emacs.stackexchange.com/questions/16581/tramp-with-2-factor-authentication&quot;&gt;Tramp with 2-factor authentication&lt;/a&gt;, but it does not solve the problem completely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've appended &quot;Verification code&quot; into tramp-password-prompt-regexp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what happens when I try to login is that I get an opportunity to put in my password, and then I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Sending Password&#xA;Tramp: Sending Verification code&#xA;Tramp: Sending Password&#xA;Tramp: Sending Verification code&#xA;Tramp: Sending Password&#xA;Tramp: Sending Verification code&#xA;Tramp: Waiting for prompts from remote shell...failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Before it eventually fails. I feel like it's treating Verification code and Password as one and the same, and instead of prompting me for a Verification code, it just goes ahead and sends the password.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get tramp to prompt a second time for the verification code? I want it to collect a second &lt;code&gt;read-string&lt;/code&gt; from the user or something.&lt;/p&gt;&#xA;" OwnerUserId="9881" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2020-04-21T14:14:13.363" Title="Tramp login with 2-factor authentication" Tags="|tramp|ssh|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17574" PostTypeId="2" ParentId="16749" CreationDate="2015-10-21T19:00:09.307" Score="1" Body="&lt;p&gt;Somehow, but I don't know &lt;em&gt;how&lt;/em&gt;, your Emacs is receiving the wrong keys, &lt;kbd&gt;M-6 M-9&lt;/kbd&gt; instead of &lt;kbd&gt;`&lt;/kbd&gt; and &lt;kbd&gt;M-2&lt;/kbd&gt; instead of &lt;kbd&gt;~&lt;/kbd&gt;.  The easiest solution would be to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html&quot; rel=&quot;nofollow&quot;&gt;translate&lt;/a&gt; those keys to the correct ones, but all &lt;kbd&gt;M-number&lt;/kbd&gt; (being &lt;kbd&gt;number&lt;/kbd&gt; a single digit numeric key) keys are bound to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;command digit-argument&lt;/code&gt;&lt;/a&gt;, which is a really useful feature that would be a pity to lose.  This is why you get a long sequence of letters when you press a letter key after the backtick, they are 69, count them ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, also all &lt;kbd&gt;C-number&lt;/kbd&gt; keys are bound to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;command digit-argument&lt;/code&gt;&lt;/a&gt; and, speaking for myself, I prefer to use &lt;kbd&gt;C-number&lt;/kbd&gt; over &lt;kbd&gt;M-number&lt;/kbd&gt;, so it won't hurt to translate &lt;kbd&gt;M-2&lt;/kbd&gt;, &lt;kbd&gt;M-6&lt;/kbd&gt;, and &lt;kbd&gt;M-9&lt;/kbd&gt; to what you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To restore the wanted behavior add the following code to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; For the backtick&#xA;(define-key key-translation-map (kbd &quot;M-6&quot;) &quot;&quot;)        ; Do nothing&#xA;(define-key key-translation-map (kbd &quot;M-9&quot;) (kbd &quot;`&quot;)) ; Actually insert the backtick&#xA;;; For the tilde&#xA;(define-key key-translation-map (kbd &quot;M-2&quot;) (kbd &quot;~&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-10-21T19:05:30.597" LastActivityDate="2015-10-21T19:05:30.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17575" PostTypeId="2" ParentId="17554" CreationDate="2015-10-21T19:14:44.987" Score="3" Body="&lt;p&gt;If you really do want to change it, it's Emacs, of course you can.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Brutality&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;In the extreme, one can always use &lt;code&gt;M-x fundamental-mode&lt;/code&gt; to “turn off” all of the mode-specific goodies, but that's probably overkill here.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Conformity&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The only thing in your code that seems to be particularly injured by indentation was the use of &lt;code&gt;(if … (progn))&lt;/code&gt; forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(if … (progn))&lt;/code&gt; is usually considered bad form; one uses one of &lt;code&gt;when&lt;/code&gt;, &lt;code&gt;unless&lt;/code&gt;, or &lt;code&gt;cond&lt;/code&gt; for such cases more often. Switching these to &lt;code&gt;when&lt;/code&gt; or &lt;code&gt;cond&lt;/code&gt; forms yields what you might have wanted/expected:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your example code with standard indentation and dangling &lt;code&gt;)&lt;/code&gt;s:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:push-whitespace (&amp;amp;rest skip)&#xA;  (if (my:prev-whitespace-pushed) (progn&#xA;                                     (setq my:prev-whitespace-mode whitespace-mode)&#xA;                                     (setq my:prev-whitespace-pushed t)&#xA;                                     (my:force-modes nil 'whitespace-mode)&#xA;                                     ))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;↓&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:push-whitespace (&amp;amp;rest skip)&#xA;  (when (my:prev-whitespace-pushed) &#xA;    (setq my:prev-whitespace-mode whitespace-mode)&#xA;    (setq my:prev-whitespace-pushed t)&#xA;    (my:force-modes nil 'whitespace-mode)&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:push-whitespace (&amp;amp;rest skip)&#xA;  (cond ((my:prev-whitespace-pushed) &#xA;         (setq my:prev-whitespace-mode whitespace-mode)&#xA;         (setq my:prev-whitespace-pushed t)&#xA;         (my:force-modes nil 'whitespace-mode))&#xA;        )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Customization&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The indentation patterns for various special forms are defined by &lt;code&gt;lisp-indent-function&lt;/code&gt; properties on their symbols. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will change the &lt;code&gt;progn&lt;/code&gt; special form to indent from the prior (containing) form's start point, rather than its own:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun progn-java-indent (path state indent-point sexp-column normal-indent)&#xA;  (declare (ignored path state sexp-column normal-indent))&#xA;  ;; Find the point at the start of the containing sexp&#xA;  (let ((containing-point (condition-case&#xA;                           nil&#xA;                           (save-excursion&#xA;                            ;; Start at the current line&#xA;                            (goto-char indent-point)&#xA;                            ;; Up once to `|(progn` and again to its parent&#xA;                            (up-list -2)&#xA;                            ;; Take that column&#xA;                            (current-column))&#xA;                           ;; If there isn't a containing list, use the&#xA;                           ;; left margin, instead.&#xA;                           (scan-error 0))))&#xA;    ;; Increase by standard indentation, or 2, by default.&#xA;    (+ containing-point (or lisp-indent-offset&#xA;                            2))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;scan-error&lt;/code&gt; condition is signaled by &lt;code&gt;up-list&lt;/code&gt; when &lt;code&gt;progn&lt;/code&gt; appears as a top-level form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could put that into your &lt;code&gt;init.el&lt;/code&gt; and associate it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (put 'progn 'lisp-indent-function 'progn-java-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With your sample code, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:push-whitespace (&amp;amp;rest skip)&#xA;  (if my:prev-whitespace-pushed () (progn&#xA;    (setq my:prev-whitespace-mode whitespace-mode)&#xA;    (setq my:prev-whitespace-pushed t)&#xA;    (my:force-modes nil 'whitespace-mode)&#xA;    ))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;QED, I think.&lt;/p&gt;&#xA;" OwnerUserId="2776" LastActivityDate="2015-10-21T19:14:44.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17576" PostTypeId="1" AcceptedAnswerId="17577" CreationDate="2015-10-21T19:17:17.387" Score="6" ViewCount="563" Body="&#xA;&#xA;&lt;p&gt;When I want to do something in another buffer and then restore the original, I currently do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((this-buffer (current-buffer)))&#xA;  (switch-to-buffer (other-buffer))&#xA;  (insert &quot;I was here!&quot;)&#xA;  (switch-to-buffer this-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a less verbose way to this, something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-buffer-and-switch (other-buffer)&#xA;  (insert &quot;I was here!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8653" LastEditorUserId="105" LastEditDate="2016-11-12T03:09:06.133" LastActivityDate="2016-11-12T03:09:06.133" Title="Function like save excursion for restoring buffers?" Tags="|buffers|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17577" PostTypeId="2" ParentId="17576" CreationDate="2015-10-21T19:17:49.607" Score="8" Body="&#xA;&#xA;&lt;p&gt;You want &lt;code&gt;with-current-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer (other-buffer)&#xA;  (insert &quot;I was here!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is also &lt;code&gt;save-current-buffer&lt;/code&gt;, which is a simpler mechanism used to implement the &lt;code&gt;with-current-buffer&lt;/code&gt; macro:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-current-buffer&#xA;  (set-buffer (other-buffer))&#xA;  (insert &quot;I was here!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The combination of &lt;code&gt;save-current-buffer&lt;/code&gt; and &lt;code&gt;set-buffer&lt;/code&gt; mostly seems to show up in older code.  Most of the time, &lt;code&gt;with-current-buffer&lt;/code&gt; is clearer, IMO.&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorUserId="115" LastEditDate="2015-10-21T20:07:56.307" LastActivityDate="2015-10-21T20:07:56.307" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17578" PostTypeId="1" AcceptedAnswerId="17582" CreationDate="2015-10-21T19:19:08.197" Score="4" ViewCount="119" Body="&#xA;&#xA;&lt;p&gt;I just noticed that modifying another buffer creates an undo barrier in the current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-test-undo ()&#xA;  (interactive)&#xA;  (insert &quot;A&quot;)&#xA;  (with-current-buffer (get-buffer-create &quot;FOO&quot;)&#xA;    (insert &quot;abc&quot;))&#xA;  (insert &quot;B&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The command will print &lt;code&gt;AB&lt;/code&gt;. When hitting undo, only the &lt;code&gt;B&lt;/code&gt; is removed. A second undo is needed to remove the &lt;code&gt;A&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This version logs &lt;code&gt;buffer-undo-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-test-undo-log nil)&#xA;(defun my-test-undo-with-log ()&#xA;  (interactive)&#xA;  (setq buffer-undo-list '())&#xA;  (let ((before buffer-undo-list))&#xA;    (insert &quot;A&quot;)&#xA;    (with-current-buffer (get-buffer-create &quot;FOO&quot;)&#xA;      (insert &quot;abc&quot;))&#xA;    (let ((mid buffer-undo-list))&#xA;      (insert &quot;B&quot;)&#xA;      (setq my-test-undo-log (list before mid buffer-undo-list)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After running this &lt;code&gt;my-test-undo-log&lt;/code&gt; contains three versions of the undo information. In the last a &lt;code&gt;nil&lt;/code&gt; has been inserted, indicating an undo barrier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came up with the following to manually modifying the undo list, but it feels like a hack. (Of course, it can be slimlined into a macro.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-delete-nil-until (list sublist)&#xA;  ;; Strip of leading nil:s&#xA;  (while (and (not (eq list sublist))&#xA;          (null (car list)))&#xA;    (setq list (cdr list)))&#xA;  ;; Destructively remove nil:s&#xA;  (let ((next list))&#xA;    (while (not (eq (cdr next) sublist))&#xA;      (if (car (cdr next))&#xA;      (setq next (cdr next))&#xA;    (setcdr next (cdr (cdr next))))))&#xA;  list)&#xA;&#xA;(defun my-test-undo-with-workaround ()&#xA;  (interactive)&#xA;  (let ((before buffer-undo-list))&#xA;    (insert &quot;A&quot;)&#xA;    (with-current-buffer (get-buffer-create &quot;FOO&quot;)&#xA;      (insert &quot;abc&quot;))&#xA;    (insert &quot;B&quot;)&#xA;    (setq buffer-undo-list (my-delete-nil-until buffer-undo-list before))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any rational reasons why Emacs should behave this way, or is it a bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there better ways to handle this, like a built-in macro I've missed?&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="105" LastEditDate="2015-10-21T21:41:42.290" LastActivityDate="2016-09-23T14:41:22.540" Title="Why does modification in another buffer create undo boundary in current buffer?" Tags="|buffers|undo|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17579" PostTypeId="2" ParentId="17543" CreationDate="2015-10-21T19:24:46.453" Score="21" Body="&lt;p&gt;Turns out it was &lt;code&gt;projectile&lt;/code&gt; that was causing the problems. As soon as I disabled &lt;code&gt;projectile-mode&lt;/code&gt; TRAMP was buttery smooth and I began to understand the hype behind it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully this helps out someone else who has exhausted all other options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another solution I found if you don't want to disable projectile constantly is to put this command in your &lt;code&gt;init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-mode-line &quot;Projectile&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Turns out all the lag was coming from projectile trying to calculate what to put as the project name in the mode line. This isn't an important feature at all to me so you can just set it to say &quot;Projectile&quot;&lt;/p&gt;&#xA;" OwnerUserId="9130" LastEditorUserId="9130" LastEditDate="2015-10-31T14:25:29.437" LastActivityDate="2015-10-31T14:25:29.437" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17580" PostTypeId="1" AcceptedAnswerId="17585" CreationDate="2015-10-21T19:57:39.050" Score="2" ViewCount="381" Body="&#xA;&#xA;&lt;p&gt;I've seen a tip several times that &lt;code&gt;ido-file-extensions-order&lt;/code&gt; can be used to easily order files. Setup is straightforward (code at bottom), but these filetypes are only given preference when choosing between two otherwise identical files.  Is there a way to order files based on type in the minibuffer (or any way other than alphabeticaly?).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq ido-file-extensions-order '(&quot;.org&quot; &quot;.py&quot; &quot;.txt&quot; &quot;.cpp&quot; &quot;.tex&quot;)&#xA;      ido-enable-flex-matching t)&#xA;(ido-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="2823" LastEditDate="2015-10-22T03:35:43.557" LastActivityDate="2015-10-22T04:45:17.150" Title="How to sort files by type in ido" Tags="|ido|ido-find-file|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17581" PostTypeId="2" ParentId="17542" CreationDate="2015-10-21T20:01:48.693" Score="11" Body="&lt;p&gt;The &lt;code&gt;package-load-list&lt;/code&gt; variable can be used to specify precisely which packages and versions to load:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;List of packages for `package-initialize' to load.&#xA;Each element in this list should be a list (NAME VERSION), or the&#xA;symbol `all'.  The symbol `all' says to load the latest installed&#xA;versions of all packages not specified by other elements.&#xA;&#xA;For an element (NAME VERSION), NAME is a package name (a symbol).&#xA;VERSION should be t, a string, or nil.&#xA;If VERSION is t, the most recent version is activated.&#xA;If VERSION is a string, only that version is ever loaded.&#xA; Any other version, even if newer, is silently ignored.&#xA; Hence, the package is &quot;held&quot; at that version.&#xA;If VERSION is nil, the package is not loaded (it is &quot;disabled&quot;).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only thing to watch out for is that the default value includes &lt;code&gt;all&lt;/code&gt;, if you &lt;code&gt;setq&lt;/code&gt; it then you'll be fine because that completely overwrites the original value.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-load-list&#xA;      '((package1 &quot;4.2&quot;)&#xA;        (package2 &quot;0.5.1&quot;)))&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-10-21T20:01:48.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17582" PostTypeId="2" ParentId="17578" CreationDate="2015-10-21T21:43:50.190" Score="3" Body="&lt;p&gt;I see this in the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Undo.html&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Undo&lt;/em&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;All buffer modifications add a boundary whenever the previous&#xA;       undoable change was made in some other buffer.  This is to ensure&#xA;       that each command makes a boundary in each buffer where it makes&#xA;       changes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm guessing that that design is responsible for the behavior you see here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding what you discovered: If you do &lt;code&gt;(buffer-disable-undo)&lt;/code&gt; in the buffer switched to then no undo boundary is set (in the original buffer).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Why do you quote nil? &lt;code&gt;'()&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-22T14:56:08.423" LastActivityDate="2015-10-22T14:56:08.423" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17584" PostTypeId="1" CreationDate="2015-10-22T01:34:54.970" Score="1" ViewCount="709" Body="&lt;p&gt;I get &lt;code&gt;Invalid function: org-with-silent-modifications&lt;/code&gt; in the minibuffer when I try to do any sort of export (&lt;code&gt;C-c C-e h o&lt;/code&gt; or &lt;code&gt;M-x org-html-export-to-html&lt;/code&gt; etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm in emacs 24.3.1 on Ubuntu 14. I have gotten this error before in various other things I can't remember, but ignored it because it wasn't critical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what this error is from and how to fix it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm using org-mode version 8.2.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the traceback:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (invalid-function org-with-silent-modifications)&#xA;org-with-silent-modifications(nil)&#xA;org-refresh-category-properties()&#xA;org-get-category()&#xA;org-entry-properties(nil standard)&#xA;org-element-headline-parser(6161 nil)&#xA;org-element--current-element(6161 nil first-section nil)&#xA;org-element--parse-elements(1 6161 first-section nil nil nil (org-data nil))&#xA;org-element-parse-buffer(nil nil)&#xA;(org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)&#xA;(setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info))&#xA;(progn (run-hook-with-args (quote org-export-before-processing-hook) (progn (or (and (vectorp backend) (&amp;gt;= (length backend) 8) (memq (aref backend 0) cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1))) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (progn (or (and (vectorp backend) (&amp;gt;= (length backend) 8) (memq (aref backend 0) cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1)))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (if (plist-get info :title) nil (plist-put info :title (let ((file (plist-get info :input-file))) (if file (file-name-sans-extension (file-name-nondirectory file)) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons &quot;author&quot; (org-element-interpret-data (plist-get info :author))) (cons &quot;date&quot; (org-element-interpret-data (plist-get info :date))) (cons &quot;email&quot; (or (plist-get info :email) &quot;&quot;)) (cons &quot;title&quot; (org-element-interpret-data (plist-get info :title))))) (let ((backend-name (progn (or (and (vectorp backend) (&amp;gt;= ... 8) (memq ... cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1)))) (progn (let ((--dolist-tail-- (plist-get info :filter-options)) filter) (while --dolist-tail-- (setq filter (car --dolist-tail--)) (let ((result ...)) (if result (progn ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or (org-export-data tree info) &quot;&quot;))) (inner-template (cdr (assq (quote inner-template) (plist-get info :translate-alist)))) (full-body (if (not (functionp inner-template)) body (funcall inner-template body info))) (template (cdr (assq (quote template) (plist-get info :translate-alist))))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not (functionp template)) body-only) full-body (funcall template full-body info)) info))))&#xA;(save-current-buffer (set-buffer --buf-copy) (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (progn (or (and (vectorp backend) (&amp;gt;= (length backend) 8) (memq (aref backend 0) cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1))) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (progn (or (and (vectorp backend) (&amp;gt;= ... 8) (memq ... cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1)))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (if (plist-get info :title) nil (plist-put info :title (let ((file (plist-get info :input-file))) (if file (file-name-sans-extension (file-name-nondirectory file)) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons &quot;author&quot; (org-element-interpret-data (plist-get info :author))) (cons &quot;date&quot; (org-element-interpret-data (plist-get info :date))) (cons &quot;email&quot; (or (plist-get info :email) &quot;&quot;)) (cons &quot;title&quot; (org-element-interpret-data (plist-get info :title))))) (let ((backend-name (progn (or (and ... ... ...) (error &quot;%s accessing a non-%s&quot; ... ...)) (aref backend 1)))) (progn (let ((--dolist-tail-- (plist-get info :filter-options)) filter) (while --dolist-tail-- (setq filter (car --dolist-tail--)) (let (...) (if result ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or (org-export-data tree info) &quot;&quot;))) (inner-template (cdr (assq (quote inner-template) (plist-get info :translate-alist)))) (full-body (if (not (functionp inner-template)) body (funcall inner-template body info))) (template (cdr (assq (quote template) (plist-get info :translate-alist))))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not ...) body-only) full-body (funcall template full-body info)) info)))))&#xA;(unwind-protect (save-current-buffer (set-buffer --buf-copy) (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (progn (or (and (vectorp backend) (&amp;gt;= ... 8) (memq ... cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1))) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (progn (or (and ... ... ...) (error &quot;%s accessing a non-%s&quot; ... ...)) (aref backend 1)))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (if (plist-get info :title) nil (plist-put info :title (let ((file ...)) (if file (file-name-sans-extension ...) (plist-get info :input-buffer))))) (org-macro-replace-all (list (cons &quot;author&quot; (org-element-interpret-data (plist-get info :author))) (cons &quot;date&quot; (org-element-interpret-data (plist-get info :date))) (cons &quot;email&quot; (or (plist-get info :email) &quot;&quot;)) (cons &quot;title&quot; (org-element-interpret-data (plist-get info :title))))) (let ((backend-name (progn (or ... ...) (aref backend 1)))) (progn (let ((--dolist-tail-- ...) filter) (while --dolist-tail-- (setq filter ...) (let ... ...) (setq --dolist-tail-- ...))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (or ... &quot;&quot;))) (inner-template (cdr (assq ... ...))) (full-body (if (not ...) body (funcall inner-template body info))) (template (cdr (assq ... ...)))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or ... body-only) full-body (funcall template full-body info)) info))))) (and (buffer-live-p --buf-copy) (progn (save-current-buffer (set-buffer --buf-copy) (restore-buffer-modified-p nil)) (kill-buffer --buf-copy))))&#xA;(let ((--buf-copy (org-export-copy-buffer))) (unwind-protect (save-current-buffer (set-buffer --buf-copy) (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (progn (or (and ... ... ...) (error &quot;%s accessing a non-%s&quot; ... ...)) (aref backend 1))) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (progn (or ... ...) (aref backend 1)))) (setq info (org-export-install-filters (org-combine-plists info (org-export-get-environment backend subtreep ext-plist)))) (if (plist-get info :title) nil (plist-put info :title (let (...) (if file ... ...)))) (org-macro-replace-all (list (cons &quot;author&quot; (org-element-interpret-data ...)) (cons &quot;date&quot; (org-element-interpret-data ...)) (cons &quot;email&quot; (or ... &quot;&quot;)) (cons &quot;title&quot; (org-element-interpret-data ...)))) (let ((backend-name (progn ... ...))) (progn (let (... filter) (while --dolist-tail-- ... ... ...)))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string ...)) (inner-template (cdr ...)) (full-body (if ... body ...)) (template (cdr ...))) (org-no-properties (org-export-filter-apply-functions (plist-get info :filter-final-output) (if ... full-body ...) info))))) (and (buffer-live-p --buf-copy) (progn (save-current-buffer (set-buffer --buf-copy) (restore-buffer-modified-p nil)) (kill-buffer --buf-copy)))))&#xA;(let* ((org-export-current-backend (progn (or (and (vectorp backend) (&amp;gt;= (length backend) 8) (memq (aref backend 0) cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1))) (info (org-combine-plists (list :export-options (delq nil (list (and subtreep ...) (and visible-only ...) (and body-only ...)))) (org-export--get-buffer-attributes))) tree) (let ((--buf-copy (org-export-copy-buffer))) (unwind-protect (save-current-buffer (set-buffer --buf-copy) (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (progn (or ... ...) (aref backend 1))) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args (quote org-export-before-parsing-hook) (progn ... ...))) (setq info (org-export-install-filters (org-combine-plists info ...))) (if (plist-get info :title) nil (plist-put info :title (let ... ...))) (org-macro-replace-all (list (cons &quot;author&quot; ...) (cons &quot;date&quot; ...) (cons &quot;email&quot; ...) (cons &quot;title&quot; ...))) (let ((backend-name ...)) (progn (let ... ...))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body ...) (inner-template ...) (full-body ...) (template ...)) (org-no-properties (org-export-filter-apply-functions ... ... info))))) (and (buffer-live-p --buf-copy) (progn (save-current-buffer (set-buffer --buf-copy) (restore-buffer-modified-p nil)) (kill-buffer --buf-copy))))))&#xA;(save-restriction (cond ((org-region-active-p) (narrow-to-region (region-beginning) (region-end))) (subtreep (org-narrow-to-subtree) (goto-char (point-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let* ((org-export-current-backend (progn (or (and (vectorp backend) (&amp;gt;= ... 8) (memq ... cl-struct-org-export-backend-tags)) (error &quot;%s accessing a non-%s&quot; (quote org-export-backend-name) (quote org-export-backend))) (aref backend 1))) (info (org-combine-plists (list :export-options (delq nil (list ... ... ...))) (org-export--get-buffer-attributes))) tree) (let ((--buf-copy (org-export-copy-buffer))) (unwind-protect (save-current-buffer (set-buffer --buf-copy) (goto-char (point-min)) (progn (run-hook-with-args (quote org-export-before-processing-hook) (progn ... ...)) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char (point-min)) (save-excursion (run-hook-with-args ... ...)) (setq info (org-export-install-filters ...)) (if (plist-get info :title) nil (plist-put info :title ...)) (org-macro-replace-all (list ... ... ... ...)) (let (...) (progn ...)) (setq tree (org-export-filter-apply-functions ... ... info)) (setq info (org-combine-plists info ...)) (let* (... ... ... ...) (org-no-properties ...)))) (and (buffer-live-p --buf-copy) (progn (save-current-buffer (set-buffer --buf-copy) (restore-buffer-modified-p nil)) (kill-buffer --buf-copy)))))))&#xA;(save-excursion (save-restriction (cond ((org-region-active-p) (narrow-to-region (region-beginning) (region-end))) (subtreep (org-narrow-to-subtree) (goto-char (point-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let* ((org-export-current-backend (progn (or (and ... ... ...) (error &quot;%s accessing a non-%s&quot; ... ...)) (aref backend 1))) (info (org-combine-plists (list :export-options (delq nil ...)) (org-export--get-buffer-attributes))) tree) (let ((--buf-copy (org-export-copy-buffer))) (unwind-protect (save-current-buffer (set-buffer --buf-copy) (goto-char (point-min)) (progn (run-hook-with-args ... ...) (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (org-export-execute-babel-code) (org-update-radio-target-regexp) (goto-char ...) (save-excursion ...) (setq info ...) (if ... nil ...) (org-macro-replace-all ...) (let ... ...) (setq tree ...) (setq info ...) (let* ... ...))) (and (buffer-live-p --buf-copy) (progn (save-current-buffer ... ...) (kill-buffer --buf-copy)))))))) org-export-as(html nil nil nil (:output-file &quot;./Literature_summary.html&quot;))&#xA;(let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert output) (let ((coding-system-for-write encoding)) (write-file file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (progn (org-kill-new output))) (or (and (functionp post-process) (funcall post-process file)) file))&#xA;(if async (let ((with-temp-message &quot;Initializing asynchronous export process&quot;) (current-message)) (unwind-protect (progn (if with-temp-message (progn (setq current-message (current-message)) (message &quot;%s&quot; with-temp-message))) (let ((--copy-fun (org-export--generate-copy-script ...)) (--temp-file (make-temp-file &quot;org-export-process&quot;)) (--coding buffer-file-coding-system)) (let ((temp-file --temp-file) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ... ...))) (let* ((process-connection-type nil) (--proc-buffer ...) (--process ...)) (org-export-add-to-stack (get-buffer --proc-buffer) nil --process) (let (...) (set-process-sentinel --process ...))))) (and with-temp-message (if current-message (message &quot;%s&quot; current-message) (message nil))))) (let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert output) (let (...) (write-file file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (progn (org-kill-new output))) (or (and (functionp post-process) (funcall post-process file)) file)))&#xA;(let ((ext-plist (org-combine-plists (list (quote :output-file) file) ext-plist)) (encoding (or org-export-coding-system buffer-file-coding-system))) (if async (let ((with-temp-message &quot;Initializing asynchronous export process&quot;) (current-message)) (unwind-protect (progn (if with-temp-message (progn (setq current-message ...) (message &quot;%s&quot; with-temp-message))) (let ((--copy-fun ...) (--temp-file ...) (--coding buffer-file-coding-system)) (let (... ...) (unwind-protect ... ...)) (let* (... ... ...) (org-export-add-to-stack ... nil --process) (let ... ...)))) (and with-temp-message (if current-message (message &quot;%s&quot; current-message) (message nil))))) (let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert output) (let ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (progn (org-kill-new output))) (or (and (functionp post-process) (funcall post-process file)) file))))&#xA;(if (not (file-writable-p file)) (error &quot;Output file not writable&quot;) (let ((ext-plist (org-combine-plists (list (quote :output-file) file) ext-plist)) (encoding (or org-export-coding-system buffer-file-coding-system))) (if async (let ((with-temp-message &quot;Initializing asynchronous export process&quot;) (current-message)) (unwind-protect (progn (if with-temp-message (progn ... ...)) (let (... ... ...) (let ... ...) (let* ... ... ...))) (and with-temp-message (if current-message (message &quot;%s&quot; current-message) (message nil))))) (let ((output (org-export-as backend subtreep visible-only body-only ext-plist))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ...) (and ... ...)))) (if (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (progn (org-kill-new output))) (or (and (functionp post-process) (funcall post-process file)) file))))) org-export-to-file(html &quot;./Literature_summary.html&quot; nil nil nil nil nil)&#xA;(let* ((extension (concat &quot;.&quot; org-html-extension)) (file (org-export-output-file-name extension subtreep)) (org-export-coding-system org-html-coding-system)) (org-export-to-file (quote html) file async subtreep visible-only body-only ext-plist)) org-html-export-to-html(nil nil nil nil) (org-open-file (org-html-export-to-html nil s v b)) (if a (org-html-export-to-html t s v b) (org-open-file (org-html-export-to-html nil s v b)))&#xA;(lambda (a s v b) (if a (org-html-export-to-html t s v b) (org-open-file (org-html-export-to-html nil s v b))))(nil nil nil nil) funcall((lambda (a s v b) (if a (org-html-export-to-html t s v b) (org-open-file (org-html-export-to-html nil s v b)))) nil nil nil nil) (save-excursion (if arg (progn (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer (current-buffer))) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil)))) (funcall action (and (memq (quote async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote visible) optns) t) (and (memq (quote body) optns) t)))&#xA;(cond ((eql action (quote template)) (org-export-insert-default-template nil optns)) ((eql action (quote stack)) (org-export-stack)) ((eql action (quote publish-current-file)) (org-publish-current-file (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-current-project)) (org-publish-current-project (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-choose-project)) (org-publish (assoc (org-icompleting-read &quot;Publish project: &quot; org-publish-project-alist nil t) org-publish-project-alist) (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-all)) (org-publish-all (memq (quote force) optns) (memq (quote async) optns))) (t (save-excursion (if arg (progn (if (eq (marker-buffer org-export-dispatch-last-position) (org-base-buffer ...)) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil)))) (funcall action (and (memq (quote async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote visible) optns) t) (and (memq (quote body) optns) t)))))&#xA;(let* ((input (cond ((equal arg (quote (16))) (quote (stack))) ((and arg org-export-dispatch-last-action)) (t (let ((wconfig ...)) (unwind-protect (progn ...) (set-window-configuration wconfig)))))) (action (car input)) (optns (cdr input))) (if (memq (quote subtree) optns) nil (move-marker org-export-dispatch-last-position nil)) (cond ((eql action (quote template)) (org-export-insert-default-template nil optns)) ((eql action (quote stack)) (org-export-stack)) ((eql action (quote publish-current-file)) (org-publish-current-file (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-current-project)) (org-publish-current-project (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-choose-project)) (org-publish (assoc (org-icompleting-read &quot;Publish project: &quot; org-publish-project-alist nil t) org-publish-project-alist) (memq (quote force) optns) (memq (quote async) optns))) ((eql action (quote publish-all)) (org-publish-all (memq (quote force) optns) (memq (quote async) optns))) (t (save-excursion (if arg (progn (if (eq ... ...) (goto-char org-export-dispatch-last-position) (move-marker org-export-dispatch-last-position nil)))) (funcall action (and (memq (quote async) optns) t) (and (memq (quote subtree) optns) t) (and (memq (quote visible) optns) t) (and (memq (quote body) optns) t)))))) org-export-dispatch(nil) call-interactively(org-export-dispatch nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hopefully I didn't butcher the indentation so that it's unreadable.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="9019" LastEditDate="2015-10-23T13:58:45.097" LastActivityDate="2015-10-23T13:58:45.097" Title="`Invalid function: org-with-silent-modifications` when org-export a file" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17585" PostTypeId="2" ParentId="17580" CreationDate="2015-10-22T04:45:17.150" Score="1" Body="&#xA;&#xA;&lt;p&gt;This code on the &lt;a href=&quot;http://emacswiki.org/emacs/InteractivelyDoThings#toc25&quot; rel=&quot;nofollow&quot;&gt;emacswiki&lt;/a&gt; allows a custom sort order, based on modification time. I've modified it to sort based on file extensions in &lt;code&gt;ido-file-extensions-order&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; sort ido filelist by extension instead of alphabetically&#xA;(require 'cl)&#xA;(defun ido-sort-extension ()&#xA;  &quot; sort ido file names by extension &quot;&#xA;  (setq ido-temp-list&#xA;        (sort ido-temp-list &#xA;              (lambda (a b)&#xA;                (&amp;lt; (order-file-extension a)&#xA;                   (order-file-extension b)))&#xA;              ))&#xA;  (ido-to-end  ;; move . files to end (again)&#xA;   (delq nil (mapcar&#xA;              (lambda (x) (and (char-equal (string-to-char x) ?.) x))&#xA;              ido-temp-list))))&#xA;&#xA;(defun order-file-extension (name)&#xA;  &quot; helper function to sort files by extension with ido&quot;&#xA;  (or&#xA;   (and (file-directory-p name) -1) ;list directories first&#xA;   (cl-position t (mapcar (lambda (str)&#xA;                            (string= str (concat &quot;.&quot; (file-name-extension name))))&#xA;                          ido-file-extensions-order))&#xA;   (+ 1 (length ido-file-extensions-order))))&#xA;(add-hook 'ido-make-file-list-hook 'ido-sort-extension)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-10-22T04:45:17.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17586" PostTypeId="2" ParentId="17584" CreationDate="2015-10-22T05:12:10.170" Score="1" Body="&lt;p&gt;Turn on &lt;code&gt;debug-on-error&lt;/code&gt; (non-&lt;code&gt;nil&lt;/code&gt;). Search the source code for &lt;code&gt;org-with-silent-modifications&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically names with &lt;code&gt;with-&lt;/code&gt; in them are macros, not functions. If you are using code that tries to invoke that macro without the file that defines the macro having been loaded, you might see this error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find the file that has the &lt;code&gt;defmacro&lt;/code&gt; for the macro, and require it before using the file that invokes the macro. Or at least load that defining file and then byte-compile the file that uses it -- IOW, load the defining file at byte-compile time, at least.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The macro is defined in &lt;code&gt;org-compat.el&lt;/code&gt;.  It seems that the Org files already require that file.  Probably some other library you are using tries to use that macro without first requiring &lt;code&gt;org-compat.el&lt;/code&gt;.  Turning on &lt;code&gt;debug-on-error&lt;/code&gt; should help you find that problematic library.  After you find it, just add this to it, at the beginning:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'org-compat)) ; org-with-silent-modifications&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-22T15:53:10.097" LastActivityDate="2015-10-22T15:53:10.097" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17587" PostTypeId="1" AcceptedAnswerId="17588" CreationDate="2015-10-22T07:08:36.963" Score="2" ViewCount="581" Body="&lt;p&gt;I am a long term Vim user but I consider switching to Emacs + EVil-mode.&#xA;However, there is one major obstacle.&#xA;I most frequently use Vim to edit LaTeX files and I have grown quite accustomed to the LaTeX macros of Vim-LaTeX-Suite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. typing &lt;strong&gt;EIT&lt;/strong&gt; automatically turns into &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{itemize}&#xA;   \item &amp;lt;++&amp;gt;&#xA;\end{itemize}   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;typing &lt;strong&gt;``8&lt;/strong&gt;  or &lt;strong&gt;`/&lt;/strong&gt; turns into &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\infty  or  \frac{&amp;lt;++&amp;gt;}{&amp;lt;++&amp;gt;}  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This actually depicts 2 issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Automatic replacement of strings (EIT; ``8) with the corresponding environment; LaTeX macro. It would be great if someone could point me to some tutorial. I think it should be fairly easy to solve with some kind of a replacement dictionary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The &lt;strong&gt;&amp;lt;++&gt;&lt;/strong&gt; tags are &lt;em&gt;jump marks&lt;/em&gt;. Hitting CTRL+J in Vim makes the cursor jump to the next jump mark in the text. This makes navigating automatically inserted environments and formulae very quick and easy. Is there any way to emulate this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) When writing braces &lt;strong&gt;{}&lt;/strong&gt; these braces become substituted by &lt;code&gt;{}&amp;lt;++&amp;gt;&lt;/code&gt; and the cursor jumps back in between the braces. I type my formula and CTRL+J jump behind the braces. Therefore I am now used to closing my braces first and typing the respective content afterwards. Anyway to get this behavior?&lt;/p&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2015-10-22T08:02:04.520" Title="Vim-LaTeX-Suite Macros in AucTeX / Emacs" Tags="|latex|auctex|replace|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17588" PostTypeId="2" ParentId="17587" CreationDate="2015-10-22T08:02:04.520" Score="2" Body="&lt;p&gt;1) The most basic facility for this would be &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html&quot; rel=&quot;nofollow&quot;&gt;abbrevs&lt;/a&gt;.  They correspond to Vim's abbreviations, but are in so far different that you need to enable &lt;code&gt;abbrev-mode&lt;/code&gt; first and can define mode-specific abbrevs.  I'd use these for correcting typos, expanding acronyms and other basic expansions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I haven't heard of &lt;code&gt;C-j&lt;/code&gt; for this purpose before, must be something specific to that plugin.  My approach to this would be different, I'd use an advanced snippet system like &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow&quot;&gt;Yasnippet&lt;/a&gt; which supports template expansion reminiscent of Sublime Text and Textmate, including their feature of jumping to fields inside the template for filling out subparts easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Management of delimiters is generally done with something like paredit or smartparens and would allow you to do things like automatic pairing, moving beyond limiters and much more.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-22T08:02:04.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17589" PostTypeId="1" CreationDate="2015-10-22T08:14:50.677" Score="2" ViewCount="250" Body="&lt;p&gt;I use Emacs for programming and I have &lt;code&gt;ECB&lt;/code&gt;; this package works very well for me except with some commands; the problem arises when a command tries to show its result in another window (e.g. &lt;code&gt;rtags&lt;/code&gt;'s &lt;code&gt;find-symbol&lt;/code&gt; or &lt;code&gt;undo-tree&lt;/code&gt;), because in this case instead of splitting the &lt;code&gt;Edit&lt;/code&gt; window of &lt;code&gt;ECB&lt;/code&gt; in half and using the two windows (analogously to what happens when NOT using &lt;code&gt;ECB&lt;/code&gt;) it opens a new frame, which is something that I would like to avoid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to force every command to make the required splits on the &lt;code&gt;Edit&lt;/code&gt; window instead of opening a new frame?&#xA;Right now what I managed to do is to manually change the functions I use the most, substituting the call to &lt;code&gt;switch-to-buffer-other-window&lt;/code&gt; with &lt;code&gt;switch-to-buffer&lt;/code&gt;, but it would be crazy to do this with every function.&lt;/p&gt;&#xA;" OwnerUserId="9810" LastEditorUserId="2370" LastEditDate="2016-10-21T12:34:45.757" LastActivityDate="2016-10-21T12:34:45.757" Title="ECB - avoid opening new windows" Tags="|window|frames|window-splitting|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17590" PostTypeId="2" ParentId="17570" CreationDate="2015-10-22T08:18:30.040" Score="4" Body="&lt;p&gt;Emacs does generally use &lt;code&gt;C-p&lt;/code&gt; and &lt;code&gt;C-n&lt;/code&gt; for moving the cursor up and down, &lt;code&gt;&amp;lt;up&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;down&amp;gt;&lt;/code&gt; are usually bound to the same command.  That's why you get the unfamiliar behaviour of the arrow keys not cycling the history.  As a compromise &lt;code&gt;M-p&lt;/code&gt; and &lt;code&gt;M-n&lt;/code&gt; are bound in these contexts to history cycling commands.  The only exception I'm aware of would be &lt;code&gt;term-mode&lt;/code&gt; which captures nearly all of your input and passes it on to the application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course adjust the respective keymaps to get the familiar behaviour back, but be warned that this will prevent you from moving the cursor elsewhere with the keyboard (the mouse can still be used to position it anywhere though).  The general approach to this is finding out what commands are bound to the respective keys (&lt;code&gt;F1 k &amp;lt;key sequence&amp;gt;&lt;/code&gt;) and what keymap they belong to (Emacs 25 provides this in the output of &lt;code&gt;F1 k&lt;/code&gt;, but as I'm not using that, I jump to the sources with the link present in the &lt;code&gt;F1 k&lt;/code&gt; output and search these).  Doing so reveals that the commands are &lt;code&gt;previous-line&lt;/code&gt;/&lt;code&gt;next-line&lt;/code&gt; and &lt;code&gt;comint-previous-input&lt;/code&gt;/&lt;code&gt;comint-next-input&lt;/code&gt;, the latter two being bound in &lt;code&gt;comint-mode-map&lt;/code&gt;.  Therefore, the following suffices:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'comint&#xA;  '(progn&#xA;    (define-key comint-mode-map (kbd &quot;&amp;lt;up&amp;gt;&quot;) 'comint-previous-input)&#xA;    (define-key comint-mode-map (kbd &quot;C-p&quot;) 'comint-previous-input)&#xA;    (define-key comint-mode-map (kbd &quot;&amp;lt;down&amp;gt;&quot;) 'comint-next-input)&#xA;    (define-key comint-mode-map (kbd &quot;C-n&quot;) 'comint-previous-input)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-22T08:18:30.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17592" PostTypeId="1" CreationDate="2015-10-22T10:04:25.693" Score="2" ViewCount="43" Body="&lt;p&gt;In earlier versions of emacs (&amp;lt;23, I believe), when a region ( e.g., 'some text') was selected in AucTeX, and C-e was entered to include the text an environment, the following was obtained:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{center}&#xA;some text&#xA;\end{center}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, in Emacs 24, it is not possible to use C-e if a region has been selected. Rather, I have to unselect the region and then type C-e. If the point is on the text, the environment is inserted after the text with C-e:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some text&#xA;\begin{center}&#xA;&#xA;\end{center}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the cursor is within the environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to get the old behaviour back?&lt;/p&gt;&#xA;" OwnerUserId="8982" LastActivityDate="2015-10-22T20:22:03.350" Title="AucTeX: Can not include selected text into LaTeX environment" Tags="|auctex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17595" PostTypeId="1" AcceptedAnswerId="17596" CreationDate="2015-10-22T13:14:38.637" Score="2" ViewCount="517" Body="&lt;p&gt;Say there is a file &lt;code&gt;a.org&lt;/code&gt; with the following link as a header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** [[./projects.html][Software &amp;amp; Services]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can it be linked to (from another file)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[[file:a.org::*Software &amp;amp; Services]]&lt;/code&gt; did not work. Neither did &lt;code&gt;[[file:a.org::[[./projects.html][Software &amp;amp; Services]]]]&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8431" LastActivityDate="2015-10-22T14:49:19.997" Title="How to link to a header that is only an external link?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17596" PostTypeId="2" ParentId="17595" CreationDate="2015-10-22T14:49:19.997" Score="5" Body="&lt;p&gt;There is an automatic way of creating links with &lt;code&gt;org-store-link&lt;/code&gt; (&lt;kbd&gt;C-c l&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the cursor on the header, call &lt;code&gt;org-store-link&lt;/code&gt;. Then, on the link position, type &lt;kbd&gt;C-c C-l&lt;/kbd&gt; (&lt;code&gt;org-insert-link&lt;/code&gt;), and then &lt;kbd&gt;M-p&lt;/kbd&gt; (or up arrow) to get the stored link and insert it. And it works!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The resulting documents are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.org:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** [[./projects.html][Software &amp;amp; Services]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;other_file.org:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Somewhere else&#xA;This is a [[file:a.org::*%5B%5B./projects.html%5D%5BSoftware%20&amp;amp;%20Services%5D%5D][link]] to the first heading.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this procedure automatically url-encodes your heading contents.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-10-22T14:49:19.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17597" PostTypeId="1" AcceptedAnswerId="17598" CreationDate="2015-10-22T15:19:26.283" Score="10" ViewCount="2312" Body="&lt;p&gt;I'm trying out &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; - the docs say the argument to the &lt;code&gt;:mode&lt;/code&gt; keyword &quot;can be a cons cell, a list, or just a string.&quot;  However, I'm not sure how to make a cons cell or list work.  Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package markdown-mode&#xA;  :mode (list &quot;\\.markdown\\'&quot; &quot;\\.md\\'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that in my init-file, I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: listp, list&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is that saying a &lt;code&gt;list&lt;/code&gt; doesn't pass the &lt;code&gt;listp&lt;/code&gt; test?&lt;/p&gt;&#xA;" OwnerUserId="8899" LastActivityDate="2015-10-22T15:28:13.610" Title="Use multiple `:mode` arguments with use-package" Tags="|init-file|use-package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17598" PostTypeId="2" ParentId="17597" CreationDate="2015-10-22T15:28:13.610" Score="22" Body="&#xA;&#xA;&lt;p&gt;The right way to do it would be&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package markdown-mode&#xA;  :mode (&quot;\\.markdown\\'&quot; &quot;\\.md\\'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package markdown-mode&#xA;  :mode ((&quot;\\.markdown\\'&quot; . markdown-mode)&#xA;         (&quot;\\.md\\'&quot;       . markdown-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In general, to see what any macro is expanding to, take the cursor to the closing parenthesis of that macro and do &lt;code&gt;M-x pp-macroexpand-last-sexp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2015-10-22T15:28:13.610" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17599" PostTypeId="1" AcceptedAnswerId="17600" CreationDate="2015-10-22T17:48:43.760" Score="27" ViewCount="6185" Body="&lt;p&gt;Say we have a Dired buffer open on some directory. How can I send the directory path to the clipboard? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how can I do the same when the Dired cursor is on a specific file, without opening the file first?&lt;/p&gt;&#xA;" OwnerUserId="6" LastActivityDate="2019-04-09T06:22:06.030" Title="Current path in Dired or Dired+ to clipboard" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17600" PostTypeId="2" ParentId="17599" CreationDate="2015-10-22T17:54:15.393" Score="37" Body="&lt;p&gt;Move the cursor to the directory header line (where the directory is shown - e.g., use &lt;code&gt;M-&amp;lt;&lt;/code&gt;), then hit &lt;code&gt;w&lt;/code&gt;. That copies the directory name to the kill ring. (&lt;code&gt;w&lt;/code&gt; copies any file name from Dired, and it works for the directory header too.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you haven't already done so, customize &lt;code&gt;x-select-enable-clipboard&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt;, so selection is copied to the clipboard.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;@Constantine's comment makes a good point. Instead of moving to the directory header line to get the absolute name, you can just use &lt;code&gt;C-0 w&lt;/code&gt; on any file or directory line. That will put the absolute file name in the clipboard. When you paste it you can just remove the relative file-name part, to get the absolute directory name.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-22T18:15:40.003" LastActivityDate="2015-10-22T18:15:40.003" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17601" PostTypeId="2" ParentId="17592" CreationDate="2015-10-22T20:22:03.350" Score="1" Body="&lt;p&gt;The selected text does not seem to be included if cua-mode is turned on, so it needs to be turned off:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cua-mode 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8982" LastActivityDate="2015-10-22T20:22:03.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17602" PostTypeId="1" CreationDate="2015-10-22T21:57:15.483" Score="1" ViewCount="65" Body="&lt;p&gt;For example I want to rename a file hello1 to hello. In dired mode, after dired-rename (R), I typed hello, but the focus was on hello1, so I used C-p to get to the option hello and then enter to finish the renaming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do it with just one key binding like C-m or C-j?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-08-22T22:02:25.020" LastActivityDate="2016-08-22T22:02:25.020" Title="How to quickly choose the option marked with [?] in helm" Tags="|helm|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17604" PostTypeId="1" AcceptedAnswerId="17606" CreationDate="2015-10-23T01:00:38.313" Score="2" ViewCount="1161" Body="&lt;p&gt;currently I'm trying to connect to my gmail.com account via gnus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following &lt;a href=&quot;http://www.emacswiki.org/emacs/GnusGmail#toc1&quot; rel=&quot;nofollow&quot;&gt;emacswiki.org: Gnus#Gmail Quickstart&lt;/a&gt; guide I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nnimap (gmail) open error: 'NO (ALERT) Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure)'.  Continue? (y or n) n &#xA;Couldn't open server on gmail&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Searching suggested page by google did not provide solution I could use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where did I went wrong?&lt;/p&gt;&#xA;" OwnerUserId="6527" LastActivityDate="2017-09-26T11:40:07.703" Title="Unable connect using gnus to gmail" Tags="|gnus|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17606" PostTypeId="2" ParentId="17604" CreationDate="2015-10-23T01:47:45.243" Score="2" Body="&lt;p&gt;This is not really a gnus question, but the problem is 2 factor authentication in gmail. &lt;a href=&quot;https://productforums.google.com/forum/#!topic/gmail/WUaXHSdI3WM&quot; rel=&quot;nofollow&quot;&gt;https://productforums.google.com/forum/#!topic/gmail/WUaXHSdI3WM&lt;/a&gt; explains the issue and how to fix it (you need to create an application specific password).&lt;/p&gt;&#xA;" OwnerUserId="838" LastActivityDate="2015-10-23T01:47:45.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17608" PostTypeId="2" ParentId="7826" CreationDate="2015-10-23T02:32:01.943" Score="-1" Body="&lt;p&gt;You can use Dropbox. It makes revisable version of your file every time you press C-x C-s. For encryption of my text files i use GNU Privacy Guard, it supported by Emacs.&lt;/p&gt;&#xA;" OwnerUserId="9911" LastEditorUserId="9911" LastEditDate="2015-10-23T02:39:15.410" LastActivityDate="2015-10-23T02:39:15.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17610" PostTypeId="1" CreationDate="2015-10-23T08:21:36.573" Score="8" ViewCount="271" Body="&lt;p&gt;Is there some extension that can make calc autocomplete units while value entered as algebraic input?&#xA;e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;' 1 kn&amp;lt;tab&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should be completed to &quot;1 knot&quot;.&lt;/p&gt;&#xA;" OwnerUserId="8433" LastEditorUserId="8433" LastEditDate="2015-10-23T15:02:55.970" LastActivityDate="2024-01-19T18:01:55.183" Title="Is it possible to make calc autocomplete units?" Tags="|calc|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17611" PostTypeId="2" ParentId="7826" CreationDate="2015-10-23T10:24:44.013" Score="2" Body="&lt;p&gt;I've not yet had the opportunity to use this solution, but you may also want to consider Cory Doctorow and Thomas Gideon's &lt;a href=&quot;https://github.com/commandline/flashbake&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Original link to bitbucketlabs.net/flashbake is dead, so we're using the github repo here&quot;&gt;flashbake&lt;/a&gt;. Here's &lt;a href=&quot;http://craphound.com/news/2009/02/13/flashbake-free-version-control-for-writers-using-git/&quot; rel=&quot;nofollow noreferrer&quot;&gt;what Doctorow has to say about it&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I was prompted to do this after discussions with several digital archivists who complained that, prior to the computerized era, writers produced a series complete drafts on the way to publications, complete with erasures, annotations, and so on. These are archival gold, since they illuminate the creative process in a way that often reveals the hidden stories behind the books we care about. By contrast, many writers produce only a single (or a few) digital files that are modified right up to publication time, without any real systematic records of the interim states between the first bit of composition and the final draft.&lt;/p&gt;&#xA;&lt;p&gt;Enter Flashbake. Every 15 minutes, Flashbake looks at any files that you ask it to check (I have it looking at all my fiction-in-progress, my todo list, my file of useful bits of information, and the completed electronic versions of my recent books), and records any changes made since the last check, annotating them with the current timezone on the system-clock, the weather in that timezone as fetched from Google, and the last three headlines with your by-line under them in your blog’s RSS feed (I’ve been characterizing this as “Where am I, what’s it like there, and what am I thinking about?”). It also records your computer’s uptime. For a future version, I think it’d be fun to have the most recent three songs played by your music player.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;That being said, I never had the opportunity to test it out, since I ended up writing a &lt;em&gt;lot&lt;/em&gt; of stuff in org-mode, and was programming a lot, and... well... I kind of got better at using &lt;code&gt;magit&lt;/code&gt;, and in the end, I kind of just... didn't need to use it.&lt;/p&gt;&#xA;&lt;p&gt;In any case, this solution was &lt;em&gt;aimed&lt;/em&gt; at writers working on non-technical projects. You may find that it may fit your requirements.&lt;/p&gt;&#xA;" OwnerUserId="5509" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-23T10:24:44.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17613" PostTypeId="2" ParentId="17610" CreationDate="2015-10-23T14:48:55.130" Score="0" Body="&lt;p&gt;Most unit descriptions in calc are usually very short. You will find  them when typing &lt;code&gt;u v&lt;/code&gt;. In my opinion a completion is here unnecessary, just type a &lt;code&gt;'&lt;/code&gt; (e. g. after typing a number) and specify your unit together with the quantity in algebraic mode. &lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2015-10-24T16:51:39.807" LastActivityDate="2015-10-24T16:51:39.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17614" PostTypeId="1" AcceptedAnswerId="17615" CreationDate="2015-10-23T16:38:38.433" Score="3" ViewCount="97" Body="&lt;p&gt;When I write lisp code that contains errors, I debug it with &lt;code&gt;toggle-debug-on-error&lt;/code&gt;. Unfortunately, once a certain function triggers the debugger once, Emacs stops launching the debugger on errors in subsequent calls to that function, giving only a summary in the echo area instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can have the debugger &lt;em&gt;always&lt;/em&gt; invoked on error?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-10-23T17:55:05.843" Title="Continue debugging same function" Tags="|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17615" PostTypeId="2" ParentId="17614" CreationDate="2015-10-23T17:55:05.843" Score="3" Body="&lt;p&gt;If variable &lt;code&gt;debug-on-error&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt; then an error always enters the debugger. However, if the debugger is &lt;strong&gt;already open&lt;/strong&gt; (but its window is hidden behind another frame or whatever) then you might not notice this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the mode line for &lt;code&gt;[...]&lt;/code&gt; and see whether you have a  buffer named &lt;code&gt;*Backtrace*&lt;/code&gt;, if the backtrace does not seem to get popped up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the backtrace is already open then quit it, using &lt;code&gt;q&lt;/code&gt;. Sometimes you can continue with the debugger (using &lt;code&gt;c&lt;/code&gt;) after an error occurs but typically you cannot do much at that point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point of entering the debugger on an error is to see what caused it. After you see that, quit the debugger. The next error will then reopen it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you find the cause of an error that was raised, you can, for example, use &lt;code&gt;debug-on-entry&lt;/code&gt; to debug the function that caused it. That will give you a better understanding of what's wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Read the Elisp manual about using the debugger.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-10-23T17:55:05.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17616" PostTypeId="1" AcceptedAnswerId="17620" CreationDate="2015-10-23T20:24:05.123" Score="1" ViewCount="35" Body="&lt;p&gt;I always forget the keybindings for the Emacs debugger. I'd like to have a small window open at the same time the debugger window opens with a list of keybindings (I'm thinking of something that would appear similar to the bottom Ediff window in this screenshot &lt;a href=&quot;https://gpvprasad.files.wordpress.com/2009/12/ediff.png&quot; rel=&quot;nofollow&quot;&gt;https://gpvprasad.files.wordpress.com/2009/12/ediff.png&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was hoping a package like guide-key could perform this task but it doesn't seem possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the simplest way to make a window appear containing a concise list of keybindings for the active window?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-10-24T00:43:07.527" Title="Construct window with list of keybindings for the Emacs Debugger" Tags="|key-bindings|window|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17617" PostTypeId="1" CreationDate="2015-10-23T20:40:32.787" Score="7" ViewCount="1998" Body="&lt;p&gt;Say I have a shell command &lt;code&gt;foo&lt;/code&gt; that I want to bind to a key. I could do for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c f&quot;) (lambda () (interactive) (shell-command &quot;foo&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to pass an argument to &lt;code&gt;foo&lt;/code&gt;. An argument will be the name of a file in the current directory, so I would like to take an advantage of shell auto-complete. The preferable behavior would be for &lt;code&gt;C-c f&lt;/code&gt; to open shell in the minibuffer with &lt;code&gt;foo&lt;/code&gt; already entered so that I can just add the filename and hit &lt;code&gt;RET&lt;/code&gt;. How can I achieve that?&lt;/p&gt;&#xA;" OwnerUserId="9803" LastActivityDate="2015-10-23T21:52:58.213" Title="Key binding with an argument" Tags="|key-bindings|shell|minibuffer|shell-command|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17618" PostTypeId="2" ParentId="17617" CreationDate="2015-10-23T21:45:42.153" Score="7" Body="&lt;p&gt;As you seem to have already noticed, a function need the &lt;code&gt;interactive&lt;/code&gt; form before it can be bound to a key.  &lt;code&gt;interactive&lt;/code&gt; doesn't just tell Emacs the function is a command, it is also tells Emacs where to get the functions arguments from.  From &lt;code&gt;C-h f interactive&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Specify a way of parsing arguments for interactive use of a function.&#xA;  For example, write&#xA;   (defun foo (arg buf) &quot;Doc string&quot; (interactive &quot;P\nbbuffer: &quot;) .... )&#xA;   to make ARG be the raw prefix argument, and set BUF to an existing buffer,&#xA;   when ‘foo’ is called as a command.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A typical case is &lt;code&gt;(interactive c)&lt;/code&gt; where &lt;code&gt;c&lt;/code&gt; is a single-letter string describe the type of argument you expect.  &quot;f&quot; means &quot;existing file&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example function would then be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-command (file)&#xA;  (interactive &quot;f&quot;)&#xA;  (message file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or to run a shell command &lt;code&gt;foo&lt;/code&gt; on a file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo-file (file)&#xA;  (interactive &quot;f&quot;)&#xA;  (shell-command (format &quot;foo %s&quot; (shell-quote-argument file))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that we wrap the file name with &lt;code&gt;shell-quote-argument&lt;/code&gt; which will quote the file name so that it's safer to call shell commands on it in case your file names have spaces or special shell characters. Safety First. (thanks @YoungFrog for the suggestion)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bind it to a key and call it.  Emacs will prompt you for a file name in the usual way, using whatever kind of completion you have set up, and then pass the name (as a string) into the function as &lt;code&gt;file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-10-23T21:52:58.213" LastActivityDate="2015-10-23T21:52:58.213" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17619" PostTypeId="1" CreationDate="2015-10-23T23:53:15.243" Score="6" ViewCount="1437" Body="&lt;h3&gt;MWE&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: Lisp is a language of timeless elegance.&#xA;https://imgs.xkcd.com/comics/lisp_cycles.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Export as HTML will look something like this (depending on CSS):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HZIPw.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HZIPw.png&quot; alt=&quot;output&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Lisp is a language of timeless elegance&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;to appear under the image.  How can I get rid of the numbering?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-02-05T17:54:45.197" Title="How can I turn off numbering for figures?" Tags="|org-mode|org-export|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17620" PostTypeId="2" ParentId="17616" CreationDate="2015-10-24T00:32:25.310" Score="2" Body="&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h m&lt;/code&gt;&lt;/strong&gt; (command &lt;code&gt;describe-mode&lt;/code&gt;) is your friend, always. Including in Debugger mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h b&lt;/code&gt;&lt;/strong&gt; (command &lt;code&gt;describe-bindings&lt;/code&gt;) lists more bindings.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then you can get the possible keys at any time, anywhere, and you can complete prefix keys.  This is &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Key_Completion&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;key completion&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relevant command is &lt;strong&gt;&lt;code&gt;icicle-complete-keys&lt;/code&gt;&lt;/strong&gt;.  By default, &lt;strong&gt;Icicles&lt;/strong&gt; binds it to &lt;strong&gt;&lt;code&gt;S-TAB&lt;/code&gt;&lt;/strong&gt; in places where &lt;code&gt;S-TAB&lt;/code&gt; is not already bound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;S-TAB&lt;/code&gt; is already bound to command &lt;code&gt;backward-button&lt;/code&gt; in Debugger mode (that is, in &lt;code&gt;debugger-mode-map&lt;/code&gt;).  You can bind &lt;code&gt;icicle-complete-keys&lt;/code&gt; to another key in that map, or bind it to &lt;code&gt;S-TAB&lt;/code&gt; there, if you like.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-24T00:43:07.527" LastActivityDate="2015-10-24T00:43:07.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17621" PostTypeId="1" CreationDate="2015-10-24T00:41:40.753" Score="12" ViewCount="186" Body="&lt;p&gt;In typography, there's a practice called 'protrusion' (or &lt;a href=&quot;https://en.wikipedia.org/wiki/Hanging_punctuation&quot; rel=&quot;noreferrer&quot;&gt;hanging punctuation&lt;/a&gt;) that allows certain symbols to hang off the end of the margin:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/41Gpf.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/41Gpf.gif&quot; alt=&quot;protrusion&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to do the same thing for my text documents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I change &lt;code&gt;fill-paragraph&lt;/code&gt; (and friends?) to ignore end-of-line punctuation (&lt;code&gt;.?!:;,'&quot;-&lt;/code&gt;) when it fills the paragraph?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2016-11-30T20:05:24.200" LastActivityDate="2019-03-25T01:35:32.533" Title="Can I allow punctuation to run past fill-column?" Tags="|fill-column|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17622" PostTypeId="1" CreationDate="2015-10-24T05:47:03.873" Score="13" ViewCount="3544" Body="&lt;h3&gt;Background&lt;/h3&gt;&#xA;&lt;p&gt;I'm writing a presentation mode for Emacs. I'd like the input to be org files, as org files are great for data.&lt;/p&gt;&#xA;&lt;h3&gt;Problem&lt;/h3&gt;&#xA;&lt;p&gt;I have to convert the org mode file into a list of &amp;quot;slide&amp;quot; data structures that I can iterate through. To do this, I'd like to take something like the following org-mode file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* this is the first headline, with a title property and no contents&#xA;* this is the second headline, with contents&#xA;- dash list nested under the second headline&#xA;  - further nested&#xA;** nested headline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and be able to walk it. I've tried &lt;code&gt;(org-element-parse-buffer)&lt;/code&gt;, and that does give me a list of elements, but it's hard to figure out how to walk further in them. For example, calling &lt;code&gt;(org-element-map (org-element-parse-buffer) 'headline #'identity)&lt;/code&gt; gives a list of &lt;em&gt;three&lt;/em&gt; elements; the last one represents the &amp;quot;nested headline&amp;quot;. I want &amp;quot;nested headline&amp;quot; to be a child of &amp;quot;this is the second headline, with contents&amp;quot;.&lt;/p&gt;&#xA;&lt;h3&gt;Avoiding the &lt;a href=&quot;https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem&quot;&gt;XY problem&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;p&gt;I'm certainly open to other ways of converting an org-mode file into an Elisp data structure. I don't &lt;em&gt;think&lt;/em&gt; org-export is the right tool for me, because I don't want to end up with a new file containing the results, but a data structure I can iterate through. My naive way is something like &amp;quot;give me all the top-level headlines, and then I can get their properties and contained elements (e.g., plain text or nested lists -- whether further headlines or dash lists)&amp;quot;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2021-03-27T16:20:59.810" Title="How can I walk an org-mode tree?" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17623" PostTypeId="1" CreationDate="2015-10-24T07:53:47.010" Score="5" ViewCount="706" Body="&lt;p&gt;Using Emacs 24.5 on a Gentoo/Kde workstation. Drag-and-drop of files used to work okay (as far as I remember), to open a new buffer on the dragged file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same behaviour when using &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not work anymore (FYI, I downgraded to emacs-23 (after reading Boregard's comment) and the drag-n-drop works perfectly.), or rather it sometimes works, but more often than not Emacs only displays &quot;5 1&quot; on the command line and adds &quot;5 1&quot; in the messages buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This occurs for all users on the relevant computer. I guess it comes from some weird configuration on our side (otherwise other people would complain about this missing functionality). But how to pinpoint the source of this problem (and solve it, of course)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the output of &lt;code&gt;M-x describe-variable x-dnd-types-alist&lt;/code&gt; requested by Nsukami _:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x-dnd-types-alist is a variable defined in `x-dnd.el'.&#xA;Value: ((&quot;text/uri-list&quot; . x-dnd-handle-uri-list)&#xA;   (&quot;text/x-moz-url&quot; . x-dnd-handle-moz-url)&#xA;   (&quot;_NETSCAPE_URL&quot; . x-dnd-handle-uri-list)&#xA;   (&quot;FILE_NAME&quot; . x-dnd-handle-file-name)&#xA;   (&quot;UTF8_STRING&quot; . x-dnd-insert-utf8-text)&#xA;   (&quot;text/plain;charset=UTF-8&quot; . x-dnd-insert-utf8-text)&#xA;   (&quot;text/plain;charset=utf-8&quot; . x-dnd-insert-utf8-text)&#xA;   (&quot;text/unicode&quot; . x-dnd-insert-utf16-text)&#xA;   (&quot;text/plain&quot; . dnd-insert-text)&#xA;   (&quot;COMPOUND_TEXT&quot; . x-dnd-insert-ctext)&#xA;   (&quot;STRING&quot; . dnd-insert-text)&#xA;   (&quot;TEXT&quot; . dnd-insert-text))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Sorry to be late in answering questions...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Drew : same behaviour when using 'emacs -Q'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Nsukami : here is the data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x-dnd-types-alist is a variable defined in `x-dnd.el'.&#xA;Value: ((&quot;text/uri-list&quot; . x-dnd-handle-uri-list)&#xA;   (&quot;text/x-moz-url&quot; . x-dnd-handle-moz-url)&#xA;   (&quot;_NETSCAPE_URL&quot; . x-dnd-handle-uri-list)&#xA;   (&quot;FILE_NAME&quot; . x-dnd-handle-file-name)&#xA;   (&quot;UTF8_STRING&quot; . x-dnd-insert-utf8-text)&#xA;   (&quot;text/plain;charset=UTF-8&quot; . x-dnd-insert-utf8-text)&#xA;   (&quot;text/plain;charset=utf-8&quot; . x-dnd-insert-utf8-text)&#xA;   (&quot;text/unicode&quot; . x-dnd-insert-utf16-text)&#xA;   (&quot;text/plain&quot; . dnd-insert-text)&#xA;   (&quot;COMPOUND_TEXT&quot; . x-dnd-insert-ctext)&#xA;   (&quot;STRING&quot; . dnd-insert-text)&#xA;   (&quot;TEXT&quot; . dnd-insert-text))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;FYI, I downgraded to emacs-23 (after reading Boregard's comment) and the drag-n-drop works perfectly.&lt;/p&gt;&#xA;" OwnerUserId="9924" LastEditorUserId="105" LastEditDate="2016-11-12T02:35:53.853" LastActivityDate="2021-11-17T05:07:05.567" Title="Drag-and-drop file does not work anymore" Tags="|files|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17624" PostTypeId="2" ParentId="17619" CreationDate="2015-10-24T10:19:57.737" Score="9" Body="&lt;p&gt;I'm afraid you can't influence this in the HTML export (as opposed to the LaTeX export which allows adding arbitrary captioning code) because the behaviour is hardcoded in Org's &lt;code&gt;org-html-paragraph&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (not (org-string-nw-p raw)) raw&#xA;  (concat&#xA;   &quot;&amp;lt;span class=\&quot;figure-number\&quot;&amp;gt;&quot;&#xA;   (format (org-html--translate &quot;Figure %d:&quot; info)&#xA;           (org-export-get-ordinal&#xA;            (org-element-map paragraph 'link&#xA;              'identity info t)&#xA;            info nil 'org-html-standalone-image-p))&#xA;   &quot;&amp;lt;/span&amp;gt; &quot; raw))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Therefore, the only alternative I can imagine is using raw HTML:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_HTML&#xA;&amp;lt;div class=&quot;figure&quot;&amp;gt;&#xA;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;https://imgs.xkcd.com/comics/lisp_cycles.png&quot; /&amp;gt;&amp;lt;/p&amp;gt;&#xA;&amp;lt;p&amp;gt;Lisp is a language of timeless elegance&amp;lt;/p&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;#+END_HTML&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Did you consider handing in a bug report with &lt;code&gt;M-x org-submit-bug-report&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-10-24T18:00:19.193" LastActivityDate="2015-10-24T18:00:19.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17625" PostTypeId="2" ParentId="17619" CreationDate="2015-10-24T13:15:49.980" Score="10" Body="&lt;p&gt;You may not be able to easily influence the Org export itself, but you can still remove the figure number with some CSS:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-css prettyprint-override&quot;&gt;&lt;code&gt;.figure-number {&#xA;    display: none;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iTvpm.png&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iTvpm.png&quot; alt=&quot;result&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-10-24T13:15:49.980" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17626" PostTypeId="1" AcceptedAnswerId="18347" CreationDate="2015-10-24T15:22:29.503" Score="3" ViewCount="3077" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32)&#xA;of 2015-10-05&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Compiled from EmacsW64.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gnus, using the latest version of Emacs development branch 25.05 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows 7 x64 bit.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Summary:&#xA;I had quite serious headaches with trying Gnus to getting working.&#xA;I haven't found a solution for the problem yet. Any assistance/ideas/guesses will be appreciated.&#xA;I have followed this manual to set up Gnus with Gmail: &lt;a href=&quot;http://www.emacswiki.org/emacs/GnusGmail&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/GnusGmail&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What follows are my experiments and results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When connecting I get the following messages in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Opening connection to imap.gmail.com via tls...&#xA;Unable to open server nnimap+gmail due to: Unknown service: 993&#xA;nnimap (gmail) open error: ‘’.  Continue? (y or n) n&#xA;Couldn’t open server on gmail&#xA;Warning: Unable to open server nnimap+gmail due to: Unknown service: 993&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when continue&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Opening connection to imap.gmail.com via tls...&#xA;Unable to open server nnimap+gmail due to: Unknown service: 993&#xA;nnimap (gmail) open error: ‘’.  Continue? (y or n) y&#xA;Reading c:/Users/ReneFroger/AppData/Roaming/.newsrc.eld...&#xA;Generating the cache active file...done&#xA;Opening nnimap server on gmail...&#xA;Server nnimap+gmail previously determined to be down; not retrying&#xA;Opening nnimap server on gmail...failed: &#xA;Checking new news...&#xA;gnus-setup-news: Wrong type argument: listp, nnimap&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Connecting to the same IMAP server with Opera on the same computer succeeds (so there should be no firewall issues).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The nnimap server is defined as a secondary select method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-secondary-select-methods '(nnimap &quot;gmail&quot;&#xA;(nnimap-address &quot;imap.gmail.com&quot;)  ; it could also be imap.googlemail.com if that's your server.&#xA;(nnimap-server-port &quot;imaps&quot;)&#xA;(nnimap-stream ssl)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found this thread which looked more promising:&lt;br&gt;&#xA;&lt;a href=&quot;http://thread.gmane.org/gmane.emacs.gnus.user/14695&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://thread.gmane.org/gmane.emacs.gnus.user/14695&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that thread it looked like the cause of the error message, might be a SSL certificate issue. &#xA;So I found the certificates SSL in the cygwin. So I pointed it to there with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;gnutls&quot;&#xA;'(progn&#xA;(setq gnutls-trustfiles '(&quot;c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.trust.crt&quot; &quot;c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.crt&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then tried to start gnus, but I got the same issue.&#xA;I also read &lt;a href=&quot;https://stackoverflow.com/questions/20591415/trouble-opening-gmail-nnimap-server-in-emacs-gnus-on-windows&quot;&gt;this stackoverflow topic&lt;/a&gt; which is not helping me, unfortunately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried the log levels 1 and 2  by evaluating&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnutls-log-level 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then tried &lt;kbd&gt;M-x gnus&lt;/kbd&gt;, and when that didn't give anything meaningful,&lt;br&gt;&#xA;I evaluated&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnutls-log-level 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then tried &lt;kbd&gt;M-x gnus&lt;/kbd&gt;, and that didn't give anything meaningful.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my full configuration for Gnus, following the manual for setting up with Gmail (&lt;a href=&quot;http://www.emacswiki.org/emacs/GnusGmail&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/GnusGmail&lt;/a&gt;) and trying to solve this issue with Windows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tls-program '(&quot;C:/Dropbox/Sys/cygwin_2/bin/openssl.exe s_client -connect %h:%p -no_ssl2 -ign_eof&quot;))&#xA;&#xA;(setq gnus-select-method&#xA;'(nnimap &quot;gmail&quot;&#xA;(nnimap-address &quot;imap.gmail.com&quot;)  ; it could also be imap.googlemail.com if that's your server.&#xA;(nnimap-server-port &quot;imaps&quot;)&#xA;(nnimap-stream ssl)))&#xA;&#xA;&#xA;(setq smtpmail-smtp-service 587&#xA;gnus-ignored-newsgroups &quot;^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\&quot;]\&quot;[#'()]&quot;)&#xA;&#xA;&#xA;(eval-after-load &quot;gnutls&quot;&#xA;'(progn&#xA;(setq gnutls-trustfiles '(&quot;c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.trust.crt&quot; &quot;c:/Dropbox/Sys/cygwin/usr/ssl/certs/ca-bundle.crt&quot;))))&#xA;&#xA;&#xA;(setq gnus-secondary-select-methods '(nnimap &quot;gmail&quot;&#xA;(nnimap-address &quot;imap.gmail.com&quot;)  ; it could also be imap.googlemail.com if that's your server.&#xA;(nnimap-server-port &quot;imaps&quot;)&#xA;(nnimap-stream ssl)))&#xA;&#xA;(setq smtpmail-smtp-service 587&#xA;gnus-ignored-newsgroups &quot;^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\&quot;]\&quot;[#'()]&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;.profile&lt;/code&gt; and &lt;code&gt;.authinfo&lt;/code&gt; are already in my home folder, which is also in my path. Any suggestion to debug this further would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-07T19:31:02.863" Title="Getting Gnus working on Windows with Gmail" Tags="|gnus|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17627" PostTypeId="1" CreationDate="2015-10-24T16:49:09.030" Score="8" ViewCount="1738" Body="&lt;p&gt;The &lt;code&gt;use-package&lt;/code&gt; is a useful and popular macro for installing packages, but flycheck always complains about it since it hides variable definitions. For example, if I attempt &lt;code&gt;(use-package org)&lt;/code&gt;, Flycheck will warn of a &lt;code&gt;reference to free variable 'org&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have a &lt;code&gt;defcom&lt;/code&gt; macro that simplifies command definitions for me, but which hides variable definitions in the same way. Flycheck chokes on these too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I advise Flycheck that these instances are okay? Alternatively, how can I selectively disable this warning? Getting Flycheck to ignore unknown macros also seems like a safe bet, since macros redefine syntax and will usually require new rules.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-11-15T10:31:29.793" Title="Make flycheck's &quot;reference to free variable&quot; work with macros" Tags="|elisp-macros|flycheck|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17628" PostTypeId="2" ParentId="17626" CreationDate="2015-10-24T17:01:40.583" Score="2" Body="&lt;p&gt;If your Emacs is compiled with gnutls support, I think Gnus automatically does StartTLS by itself, and you don't need any special configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use Windows, so take it with a pinch of salt, but I am configuring gnus-secondary-select-methods to include:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (nnimap &quot;gmail&quot;&#xA;            (nnimap-address &quot;imap.gmail.com&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and in my ~/.authinfo.gpg I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine gmail login USERNAME@gmail.com password &quot;PASSWORD&quot; port imap&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it Just Works™. (This is on Debian GNU/Linux, GNU Emacs 24.5.1, Ma Gnus v0.14)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; A quick search brings up &lt;a href=&quot;http://article.gmane.org/gmane.emacs.gnus.general/83134&quot; rel=&quot;nofollow&quot;&gt;this suggestion&lt;/a&gt;, try adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nnimap-server-port 993)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your configuration of the gmail server.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2015-10-24T21:18:59.057" LastActivityDate="2015-10-24T21:18:59.057" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17629" PostTypeId="1" AcceptedAnswerId="18046" CreationDate="2015-10-24T18:23:17.470" Score="7" ViewCount="1221" Body="&lt;p&gt;In my local shell, &lt;code&gt;completion-at-point&lt;/code&gt; after &lt;code&gt;cd&lt;/code&gt; returns a list of directories. However, when I ssh into a remote, Emacs thinks I'm still in my local home directory. How can I configure Emacs to give me remote directory autocompletion?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-11-13T05:23:41.237" Title="File and directory autocompletion in remote shell" Tags="|completion|shell|ssh|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="17631" PostTypeId="1" CreationDate="2015-10-24T22:02:47.267" Score="6" ViewCount="588" Body="&lt;p&gt;I'd like to get org-mode to recognize hyperlinks written in Markdown syntax, that is, links in this format:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[markdown link syntax](https://daringfireball.net/projects/markdown/syntax)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I add the markdown hyperlink type to org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related but different:&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/594/how-to-implement-markdown-style-link-ids-in-org-mode&quot;&gt;How to implement Markdown style link IDs in org-mode?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably helpful: &lt;a href=&quot;http://orgmode.org/manual/Adding-hyperlink-types.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Adding-hyperlink-types.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-12-17T14:07:01.357" Title="how to get org-mode to recognize markdown-style links?" Tags="|org-mode|org-export|hyperlinks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17632" PostTypeId="1" CreationDate="2015-10-24T22:41:16.663" Score="3" ViewCount="105" Body="&lt;p&gt;This is almost the same question as &lt;a href=&quot;https://emacs.stackexchange.com/questions/2745/make-fill-paragraph-in-python-docstring-leave-the-triple-quotes-on-separate-line&quot;&gt;this one&lt;/a&gt;, but not quite. I happen to like the docstring style&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def f():&#xA;    &quot;&quot;&quot;&#xA;    docstring&#xA;&#xA;    another line&#xA;    &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so in emacs I have &lt;code&gt;python-fill-docstring-style&lt;/code&gt; set to &lt;code&gt;(quote django)&lt;/code&gt;. Works great. But it doesn't work with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def f2():&#xA;    r&quot;&quot;&quot;&#xA;    A raw docstring with \n and \t and other symbols in it.&#xA;&#xA;    Another line.&#xA;    &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;fill-paragraph&lt;/code&gt; on the first paragraph of this docstring, it turns it into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r&quot;&quot;&quot; A raw docstring with \n and \t and other symbols in it.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run it on the second paragraph, it becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Another line.  &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this a bug or is there a customization setting I'm overlooking? The same problem arises if the docstring starts with &lt;code&gt;b&quot;&quot;&quot;&lt;/code&gt; or &lt;code&gt;u&quot;&quot;&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2416" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-10-24T22:41:16.663" Title="Make fill-paragraph in *raw* python docstring leave the triple-quotes on separate line" Tags="|python|fill-paragraph|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17633" PostTypeId="1" AcceptedAnswerId="17642" CreationDate="2015-10-25T01:32:09.817" Score="7" ViewCount="215" Body="&lt;p&gt;I want to understand why an expression of the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'my-kewl-theme t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fails&lt;sup&gt;1&lt;/sup&gt; when run as the last expression in my init (&lt;code&gt;~/.emacs&lt;/code&gt;) file, but works fine if I evaluate it as soon as soon as Emacs' startup is done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I troubleshoot/debug this conundrum?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only clue I have is that right before &lt;code&gt;(load-theme 'my-kewl-theme t)&lt;/code&gt; is evaluated &lt;strong&gt;&lt;em&gt;at the end&lt;/strong&gt; of the loading of &lt;code&gt;~/.emacs&lt;/code&gt;&lt;/em&gt;, the variable &lt;code&gt;custom-theme-load-path&lt;/code&gt; has the value&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-theme-load-directory t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;whereas after Emacs starts, it has the value&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;/path/to/my-kewl-theme/&quot; custom-theme-load-directory t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know what accounts for this difference.  (This variable is not referred to at all by &lt;code&gt;~/.emacs&lt;/code&gt;, at least explicitly.)  The variable &lt;code&gt;custom-theme-load-directory&lt;/code&gt; has the value &lt;code&gt;~/.emacs.d&lt;/code&gt; throughout.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;code&gt;error: Unable to find theme file for `my-kewl-theme`&lt;/code&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2015-10-25T19:00:04.350" LastActivityDate="2015-10-28T06:30:59.117" Title="Why expression fails in init file, but works fine during session" Tags="|init-file|themes|debugging|start-up|" AnswerCount="2" CommentCount="1" ClosedDate="2015-10-28T06:30:35.317" ContentLicense="CC BY-SA 3.0" />
  <row Id="17634" PostTypeId="2" ParentId="17633" CreationDate="2015-10-25T04:07:04.823" Score="10" Body="&lt;p&gt;I believe it is standard practice for themes installed as packages to add their own paths to &lt;code&gt;custom-theme-load-path&lt;/code&gt; as an autoload.  A call to &lt;code&gt;package-initialize&lt;/code&gt; will execute all of your package autoloads (among other things), and if there isn't an explicit call in your init file, it is called implicitly at the end of initialization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend putting a &lt;code&gt;(package-initialize)&lt;/code&gt; towards the beginning of your init file, right after you configure package.el itself (adding repositories, etc.) and before you do anything with any packages not built-in to Emacs itself.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="50" LastEditDate="2015-10-28T06:30:59.117" LastActivityDate="2015-10-28T06:30:59.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17635" PostTypeId="1" AcceptedAnswerId="17636" CreationDate="2015-10-25T06:31:08.980" Score="0" ViewCount="511" Body="&lt;p&gt;My Emacs customizations reside in a few separate .org files, all in the directory &lt;code&gt;~/emacs-prelude/personal&lt;/code&gt;. I'm always searching these files to find and change settings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I define a function &lt;code&gt;search-my-emacs-configutation-files&lt;/code&gt; to search the full text of these files? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like the most obvious way would be to do a &lt;code&gt;helm-projectile-grep&lt;/code&gt;, but Projectile seems to think the &quot;project&quot; is the entire Emacs-Prelude directory (including all my packages) when in fact I want to search only the subdirectory Personal which has my customizations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-cmd-t&lt;/code&gt; seemed promising but it seems like it searches only filenames. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-do-grep&lt;/code&gt; works, but it asks me for the directory each time. I'd like to be able to call this function using a single keystroke.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2019-10-22T17:45:53.847" Title="a function to grep specified files?" Tags="|helm|projectile|rgrep|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17636" PostTypeId="2" ParentId="17635" CreationDate="2015-10-25T07:07:16.837" Score="3" Body="&lt;p&gt;There are many ways to do what you need, here is one by using helm's &lt;code&gt;helm-do-grep-1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun search-my-emacs-configutation-files ()&#xA;  (helm-do-grep-1 '(&quot;~/emacs-prelude/personal/*.org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you even have &lt;code&gt;.org&lt;/code&gt; files under some sub-directories under &lt;code&gt;~/emacs-prelude/personal/&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun search-my-emacs-configutation-files ()&#xA;  (helm-do-grep-1 '(&quot;~/emacs-prelude/personal&quot;) :recurse nil '(&quot;*.org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h f helm-do-grep-1&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(helm-do-grep-1 TARGETS &amp;amp;optional RECURSE ZGREP EXTS DEFAULT-INPUT&#xA;  INPUT)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The 1st argument TARGETS is a list of files (including directories).&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-10-25T07:22:59.007" LastActivityDate="2015-10-25T07:22:59.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17637" PostTypeId="1" CreationDate="2015-10-25T08:06:14.007" Score="5" ViewCount="563" Body="&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt;, I can sum the rows in a column as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   | Column 1 |&#xA;|   |          |&#xA;|---+----------|&#xA;|   |        1 |&#xA;| 2 |        2 |&#xA;| 3 |        3 |&#xA;|   |        4 |&#xA;|---+----------|&#xA;|   |          |&#xA;|---+----------|&#xA;#+TBLFM: @7$2=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I add some lines in the middle, the coordinates of &lt;code&gt;@7$1&lt;/code&gt; will move. According to the &lt;a href=&quot;http://orgmode.org/manual/References.html#References&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;, I've tried to modify the formula to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @II+1$2=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the result for the last line is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|---+----------|&#xA;| 5 |       10 |&#xA;|---+----------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is it also summing the first column ?&lt;/p&gt;&#xA;" OwnerUserId="9932" LastActivityDate="2016-05-22T16:30:18.747" Title="Vertical sum and coordinates relative to separators" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17638" PostTypeId="1" AcceptedAnswerId="17655" CreationDate="2015-10-25T08:41:33.493" Score="1" ViewCount="2162" Body="&lt;p&gt;I have a red border around my modeline, and I don't like it. How can I get rid of it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24&#xA;&lt;img src=&quot;https://i.stack.imgur.com/yGD4G.png&quot; alt=&quot;Screenshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9014" LastEditorUserId="9014" LastEditDate="2015-10-26T04:11:57.127" LastActivityDate="2015-10-26T04:11:57.127" Title="Remove red border from modeline" Tags="|mode-line|colors|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17639" PostTypeId="1" AcceptedAnswerId="17651" CreationDate="2015-10-25T08:47:50.600" Score="4" ViewCount="934" Body="&lt;p&gt;I understand that Magit will report a commit as &quot;Unpushed&quot; immediately after pushing it because it has not been pushed to the Upstream branch (master in this case).  That makes me wonder what the rationale is for labeling the commit as &quot;Unpushed&quot; in the face of the common workflow convention of pushing a commit to a remote branch, creating a Pull Request on that remote branch, applying review comments, and then merging to the upstream branch.  I would think that what Magit currently labels &quot;Unpushed&quot; would be better labeled &quot;Unmerged&quot; and that &quot;Unpushed&quot; would mean that the current branch has not been pushed at all and the label gets changed to &quot;Unmerged&quot; after doing a successful push to any remote branch.  In this model, one could see (different) commits under an &quot;Unpushed&quot; section and under an &quot;Unmerged&quot; section.  I might have a misunderstanding for the Magit model and if so, I'd like to get a more accurate model.  I ask the question as a pre-cursor to filing an issue to make sure it really is a product issue and not just a grokking issue.&lt;/p&gt;&#xA;" OwnerUserId="9933" LastActivityDate="2015-12-30T23:26:43.253" Title="Seeing &quot;Unpushed commits&quot; after doing a push on the current commit" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17640" PostTypeId="2" ParentId="17638" CreationDate="2015-10-25T08:48:58.587" Score="1" Body="&lt;p&gt;Options &gt; Customize Emacs &gt; Specific Face &gt; &lt;code&gt;mode-line&lt;/code&gt; &gt; Box around text&lt;/p&gt;&#xA;" OwnerUserId="9014" LastActivityDate="2015-10-25T08:48:58.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17641" PostTypeId="1" AcceptedAnswerId="17646" CreationDate="2015-10-25T08:50:04.463" Score="0" ViewCount="79" Body="&lt;p&gt;Is there a way to programatically get the available movement commands for evil emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preferably also with the key they are currently bound to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There are a lot of commands for movement, but I do not know whether they are grouped or categorized in a way that makes them accessible as movement commands.)&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2016-08-22T22:01:52.940" LastActivityDate="2016-08-22T22:01:52.940" Title="Programatically get available movements evil emacs" Tags="|key-bindings|evil|commands|motion|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17642" PostTypeId="2" ParentId="17633" CreationDate="2015-10-25T08:56:40.627" Score="7" Body="&lt;p&gt;From the emacs manual regarding packages:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By default, Emacs also automatically loads all installed packages in&#xA;  subsequent Emacs sessions.  This happens at startup, after processing&#xA;  the init file. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So if your theme relies on some package initialisation you can put your call in &lt;code&gt;after-init-hook&lt;/code&gt;.  For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook &#xA;   (lambda ()&#xA;     (load-theme 'my-kewl-theme t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, enable the theme by customising &lt;code&gt;custom-enabled-themes&lt;/code&gt;, instead of using &lt;code&gt;load-theme&lt;/code&gt; in your init file.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2015-10-25T09:42:25.993" LastActivityDate="2015-10-25T09:42:25.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17643" PostTypeId="1" CreationDate="2015-10-25T11:18:41.623" Score="2" ViewCount="1056" Body="&lt;p&gt;I have emacs configured to refrain from inserting tabs for indentation purposes already. But this does not have any effect when I &lt;em&gt;paste&lt;/em&gt; text containing a tab (from an external application, Google Chrome). How can I ensure that tabs are always replaced with spaces in pasted text?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastEditorUserId="6790" LastEditDate="2015-10-25T12:28:39.323" LastActivityDate="2016-01-25T23:06:54.657" Title="Remove tabs from pasted text automatically?" Tags="|copy-paste|tabs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17644" PostTypeId="1" CreationDate="2015-10-25T11:18:58.403" Score="2" ViewCount="625" Body="&lt;p&gt;I am not able to access many info files. For example, the command &lt;code&gt;(info &quot;(gnus) Sorting the Summary Buffer&quot;)&lt;/code&gt; returns &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Info file gnus does not exist&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So I want to install/configure my info files directory. I am using emacs 24.5.1 on Archlinux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://emacs.stackexchange.com/questions/7238/info-file-emacs-does-not-exist&quot;&gt;this post&lt;/a&gt; I should have my info files located under &lt;code&gt;export INFOPATH=$INFOPATH:/usr/share/info/emacs-24&lt;/code&gt;. But it does not load my info files, and the directory &lt;code&gt;/usr/share/info/emacs-24&lt;/code&gt; does not exist. I notice, however, that I have numerous &lt;code&gt;*.info.gz&lt;/code&gt; files under, such as the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/share/info/flymake.info.gz&#xA;/usr/share/info/forms.info.gz&#xA;/usr/share/info/gnus.info.gz&#xA;/usr/share/info/emacs-gnutls.info.gz&#xA;/usr/share/info/emacs.info.gz&#xA;/usr/share/info/emacs-mime.info.gz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The complete file listing is listed here: &lt;a href=&quot;https://www.archlinux.org/packages/extra/i686/emacs/files/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.archlinux.org/packages/extra/i686/emacs/files/&lt;/a&gt; which includes many more &lt;code&gt;*.info.gz&lt;/code&gt; files under &lt;code&gt;/usr/share/info/&lt;/code&gt;. How can I make these files accessible to my emacs distro? Should I make the directory &lt;code&gt;/usr/share/info/emacs-24&lt;/code&gt; and unzip the files in there? Or is there an elpa package that I am missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be great.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;UPDATE&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly, if I run &lt;code&gt;M-x dired RET /usr/share/gnus.info.gz&lt;/code&gt;, then I can open the info manual. But how can I execute a function like &lt;code&gt;(info &quot;(gnus) Sorting the Summary Buffer&quot;)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-10-26T11:05:10.950" Title="Info files are found but not installed (on archlinux)" Tags="|info|install|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17645" PostTypeId="2" ParentId="17643" CreationDate="2015-10-25T12:19:46.240" Score="0" Body="&lt;p&gt;You can do this by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;advising&lt;/a&gt;   the yank commands: &lt;code&gt;clipboard-yank&lt;/code&gt;, &lt;code&gt;mouse-yank-primary&lt;/code&gt;, &lt;code&gt;yank&lt;/code&gt; and &lt;code&gt;yank-pop&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;(region-beginning)&lt;/code&gt; and &lt;code&gt;(region-end)&lt;/code&gt; to get the region and then call &lt;code&gt;query-replace&lt;/code&gt; to change the tabs to the appropriate numbers of spaces.&lt;/p&gt;&#xA;" OwnerUserId="7146" LastActivityDate="2015-10-25T12:19:46.240" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17646" PostTypeId="2" ParentId="17641" CreationDate="2015-10-25T12:32:08.050" Score="1" Body="&lt;p&gt;If this question weren't about programmatic access (for designing something like a printable cheatsheet), I'd suggest you to look at either &lt;code&gt;evil-maps.el&lt;/code&gt; or &lt;code&gt;evil-motions&lt;/code&gt; in &lt;code&gt;evil-vars.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evil's motions are bound in &lt;code&gt;evil-motion-state-map&lt;/code&gt;, so a possible approach would be just traversing that keymap and tracking both the key and command while doing so.  The problem with that is that (surprise, surprise), it's not just motions there, for example &lt;code&gt;digit-argument&lt;/code&gt; is bound there to the number keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative approach would be traversing &lt;code&gt;evil-command-properties&lt;/code&gt; (which is a variable altered by every Evil command defined) and looking for items with &lt;code&gt;:repeat motion&lt;/code&gt; as their property, these should be motions.  You could then look up what key these are bound to.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-25T12:32:08.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17647" PostTypeId="2" ParentId="17637" CreationDate="2015-10-25T13:59:45.650" Score="1" Body="&lt;pre&gt;&lt;code&gt;#+TBLFM: @II+1$2=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doesn't do anything for me &lt;em&gt;(org-version 8.3.1)&lt;/em&gt;, but this works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @&amp;gt;$2=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ie: &lt;em&gt;last row&lt;/em&gt; of table.&lt;/p&gt;&#xA;" OwnerUserId="9938" LastActivityDate="2015-10-25T13:59:45.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17648" PostTypeId="1" AcceptedAnswerId="17650" CreationDate="2015-10-25T17:24:44.720" Score="1" ViewCount="103" Body="&lt;pre&gt;&lt;code&gt;(where-is 'zap-to-char) ;; Prints (&quot;zap-to-char is on M-znil&quot;)   &#xA;(where-is-internal 'zap-to-char) ;; [134217850] ;;; this number seems like junk to me!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like a function that returns &lt;code&gt;M-z&lt;/code&gt; I imagine it would be something like &lt;code&gt;(keypress-of 'zap-to-char)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8653" LastEditorUserId="105" LastEditDate="2016-08-22T22:01:11.667" LastActivityDate="2016-08-22T22:01:11.667" Title="How do I get a string displaying the keypress of the function (like where-is shows)?" Tags="|key-bindings|keystrokes|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17649" PostTypeId="2" ParentId="17648" CreationDate="2015-10-25T18:19:13.027" Score="0" Body="&lt;p&gt;I want to do this often, so this might be too inefficient a way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-keys (function)&#xA;  (with-current-buffer (get-buffer-create &quot;temp-buffer&quot;)&#xA;    (erase-buffer)&#xA;    (where-is function t)&#xA;    (let* ((regex (pcre-to-elisp/cached &quot;(,\\s|\\s\\()&quot;))&#xA;           (results (s-split regex (buffer-string)))&#xA;           (take-until (- (length results) 1)))&#xA;      (subseq results 0 take-until)))) &#xA;&#xA;(get-keys 'ido-kill-buffer) ;; (&quot;M-m b k&quot; &quot;C-x k&quot;)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8653" LastActivityDate="2015-10-25T18:19:13.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17650" PostTypeId="2" ParentId="17648" CreationDate="2015-10-25T18:20:27.027" Score="2" Body="&lt;p&gt;Convert between readable key description (string, such as &lt;code&gt;&quot;M-z&quot;&lt;/code&gt;) and key sequence (vector or string, such as &lt;code&gt;[134217850]&lt;/code&gt;, &lt;code&gt;[?\M-z]&lt;/code&gt;, &lt;code&gt;&quot;\M-z&quot;&lt;/code&gt;, these three are the identical as key sequence):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(key-description [134217850])&#xA;    ⇒ &quot;M-z&quot;&#xA;&#xA;(kbd &quot;M-z&quot;)&#xA;    ⇒ [134217850]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you read the source code of &lt;code&gt;where-is&lt;/code&gt;, you should be able to think of something like following&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapconcat #'key-description (where-is-internal 'zap-to-char) &quot;, &quot;)&#xA;    ⇒ &quot;M-z&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-25T18:20:27.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17651" PostTypeId="2" ParentId="17639" CreationDate="2015-10-25T18:52:01.647" Score="2" Body="&lt;p&gt;&quot;Unpushed commits&quot; is short for &quot;Commits not yet pushed to / not yet merged into the branch where they should eventually end up&quot; or something like that. I.e. I mostly agree with your analysis, but don't think simply switching to &quot;Unmerged commits&quot; is the solution. That's also ambiguous, since it would make just as much sense to alternatively rename &quot;Unpulled commits&quot; to &quot;Unmerged commits&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: Starting with &lt;code&gt;v2.4&lt;/code&gt; there may be up to four log sections in the status buffer. Two for the push-remote and two for the upstream branch. E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unpulled from origin/master&#xA;Unpulled from my-fork/feature&#xA;Unpushed to origin/master&#xA;Unpushed to my-fork/feature&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T23:26:43.253" LastActivityDate="2015-12-30T23:26:43.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17652" PostTypeId="1" CreationDate="2015-10-25T19:10:57.037" Score="8" ViewCount="375" Body="&lt;p&gt;I am trying to find a way to export an Org document with lots of formulas in plain text, but the results aren't great so far.&lt;/p&gt;&#xA;&lt;h1&gt;What I tried:&lt;/h1&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;pandoc&lt;/code&gt; - basically keeps all math in LaTeX unchanged, doesn't even strip the environment makrers.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;detex&lt;/code&gt; - doesn't replace Greek symbols (simply removes them), there are artefacts in the produced formulas (s.a. ampersands left from alignment etc.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;tex2mail&lt;/code&gt; - looks funny and very hard to read, leaves artefacts, environment markers etc.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;catdvi&lt;/code&gt; - is the best so far, however, I only need it to run on the LaTeX fragments in the Org file, the rest of the file looks very bad (indenting, titles etc).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;hevea&lt;/code&gt; - this program is used by &lt;code&gt;texi2dvi&lt;/code&gt; to generate text output. Doesn't really work, the output looks very strange / some Greek letters are translated into Unicode, others aren't, the alignment is all wrong...&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I could probably write a special backend to first export all LaTeX fragments to DVI and then to run &lt;code&gt;catdvi&lt;/code&gt; on those, but before I get to it, maybe there's a simpler way to do it?&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-26T21:35:18.443" Title="Formulas in plain text export" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17653" PostTypeId="2" ParentId="17428" CreationDate="2015-10-25T19:15:41.937" Score="0" Body="&lt;p&gt;It seems it was a bug in Direx which was fixed by @tarsius, my thanks to him. So I consider this issue as being closed.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-10-25T21:41:33.963" LastActivityDate="2015-10-25T21:41:33.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17654" PostTypeId="2" ParentId="17644" CreationDate="2015-10-26T03:50:53.077" Score="2" Body="&lt;p&gt;Reviewing the variables &lt;code&gt;Info-directory-list&lt;/code&gt; and &lt;code&gt;Info-default-directory-list&lt;/code&gt; was very helpful. It turns out that I needed to add &lt;code&gt;export INFOPATH=$INFOPATH:/usr/share/info&lt;/code&gt; to my &lt;code&gt;~/.bashrc&lt;/code&gt;, reboot my pc, and it works!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently &lt;code&gt;Info-directory-list&lt;/code&gt; is created when emacs boots with the contents of &lt;code&gt;INFOPATH&lt;/code&gt;, but I needed to restart my pc to get &lt;code&gt;INFOPATH&lt;/code&gt; readable by emacs. &lt;code&gt;C-h v Info-directory-list&lt;/code&gt; was very helpful in learning more about this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: a logout/login would probably have been sufficient over a full reboot.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2015-10-26T11:05:10.950" LastActivityDate="2015-10-26T11:05:10.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17655" PostTypeId="2" ParentId="17638" CreationDate="2015-10-26T04:01:34.883" Score="3" Body="&lt;pre&gt;&lt;code&gt;(set-face-attribute 'mode-line nil&#xA;                    :box '(:width 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Like upper code shows, you can change &lt;code&gt;mode-line&lt;/code&gt; face, or &lt;code&gt;mode-line-inactive&lt;/code&gt;. set border &lt;code&gt;box&lt;/code&gt; to &lt;code&gt;0&lt;/code&gt; or change border color to the same color with mode-line background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'd better take a screenshot to show how it looks like.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2015-10-26T04:01:34.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17656" PostTypeId="2" ParentId="17572" CreationDate="2015-10-26T04:04:10.717" Score="3" Body="&lt;p&gt;You can set &lt;code&gt;italic&lt;/code&gt; face too.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'italic nil :height 120)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you might need to set &lt;code&gt;bold&lt;/code&gt; face too.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="2287" LastEditDate="2015-10-26T05:24:29.197" LastActivityDate="2015-10-26T05:24:29.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17657" PostTypeId="2" ParentId="17550" CreationDate="2015-10-26T07:01:32.733" Score="5" Body="&lt;p&gt;Based on feedback I received from &lt;a href=&quot;https://plus.google.com/u/0/112928802151311265855/posts/dM41faC1qwW&quot; rel=&quot;noreferrer&quot;&gt;the Google+ org-mode group&lt;/a&gt;, as well as reading up on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;buffer-local variables&lt;/a&gt;, I finally ended up using &lt;code&gt;M-x add-file-local-variable RET org-src-preserve-indentation RET t&lt;/code&gt; to finally add this code block at the bottom of my org-file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# org-src-preserve-indentation: t&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once I refresh the local setup (i.e. press C-c on the header arguments), Emacs asks me if I want to use the buffer local variable, and then sets &lt;code&gt;org-src-preserve-indentation&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; for this buffer alone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This appears to resolve the issue to my liking, so I'm going to mark this question closed.&lt;/p&gt;&#xA;" OwnerUserId="5509" LastActivityDate="2015-10-26T07:01:32.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17658" PostTypeId="1" CreationDate="2015-10-26T11:38:04.527" Score="3" ViewCount="115" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I add a new outline header regexp but change the overlaid text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often write presentations with &lt;a href=&quot;https://bitbucket.org/rivanvx/beamer/wiki/Home&quot; rel=&quot;nofollow&quot;&gt;Beamer&lt;/a&gt; in LaTeX.  As such, there are a &lt;em&gt;lot&lt;/em&gt; of &lt;code&gt;frame&lt;/code&gt; (ie, &quot;slide&quot;) environments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{frame}&#xA;  \frametitle{My frame}&#xA;  % ...&#xA;  % ...&#xA;\end{frame}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To make navigation easier, I've added the &lt;code&gt;frame&lt;/code&gt; environment to &lt;code&gt;TeX-outline-extra&lt;/code&gt; so that Emacs will treat frames as headers and allow me to hide and show them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'TeX-outline-extra '(&quot;\\\\begin{frame}&quot; 5)) % at paragraph level&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, when the headers are closed, I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{frame}...&#xA;\begin{frame}...&#xA;\begin{frame}...&#xA;\begin{frame}...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's a big help, but I'd like to have a visual cue about what each frame contains (such as the &lt;code&gt;frametitle&lt;/code&gt;).  How could I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{frame} (My frame)...&#xA;\begin{frame} (Another frame)...&#xA;\begin{frame} (A different frame)...&#xA;\begin{frame} (Yet another frame)...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2024-03-27T01:06:45.810" Title="Change overlaid text of an outline header?" Tags="|latex|auctex|overlays|outline-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17659" PostTypeId="2" ParentId="17283" CreationDate="2015-10-26T13:35:08.160" Score="1" Body="&lt;p&gt;Org has &lt;a href=&quot;http://orgmode.org/manual/Special-symbols.html&quot; rel=&quot;nofollow&quot;&gt;native pretty symbol mode&lt;/a&gt; that you can enable with &lt;code&gt;C-c C-x C-\&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2015-10-26T13:35:08.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17660" PostTypeId="1" CreationDate="2015-10-26T14:35:31.200" Score="0" ViewCount="656" Body="&lt;p&gt;Image for description:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OoLUv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OoLUv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you notice carefully, blue background of gnome-terminal is visible below where emacs ends. This probably means that emacs isn't taking full space inside gnome-terminal. How do I solve it (except setting my terminal background as same color which is an annoying hack)?&lt;/p&gt;&#xA;" OwnerUserId="9949" LastEditorDisplayName="user227" LastEditDate="2015-10-29T13:54:27.130" LastActivityDate="2015-10-29T15:53:50.657" Title="Emacs not taking full space inside terminal" Tags="|terminal-emacs|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17661" PostTypeId="1" CreationDate="2015-10-26T15:11:47.853" Score="2" ViewCount="650" Body="&lt;p&gt;I've created a new configuration layer (read more about it below) for multi-term but the settings specified there don't seem to apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code in particular&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; packages.el --- rgp-multi-term Layer packages File for Spacemacs&#xA;&#xA;(defun rgp-multi-term/init-multi-term ()&#xA;  &quot;Initialize rgp-multi-term&quot;&#xA;  (use-package multi-term&#xA;    :commands multi-term&#xA;    :defer t&#xA;    :init&#xA;    (progn&#xA;      (setq multi-term-program &quot;/bin/zsh&quot;)&#xA;      (add-hook 'term-mode-hook (lambda() (setq yas-dont-activate t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Multi-term itself works fine, but when I check for the value of &lt;code&gt;multi-term-program&lt;/code&gt; it returns &lt;code&gt;nil&lt;/code&gt;&#xA;So just to clarify, my problem is that the settings I specify in my configuration layer aren't applying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I successfully added many other layers but I'm having some kind of problem with this one in particular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what's going on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: A &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#configuration-layers&quot; rel=&quot;nofollow&quot;&gt;configuration layer&lt;/a&gt; is an Spacemacs specific term. It's basically a place to place some settings for a particular package. It uses the same syntax as the &lt;a href=&quot;https://github.com/jwiegley/use-packageg&amp;amp;sig2=ol0vXe7LI_QJ3TdGCO9B9Q&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="6546" LastEditorUserId="6546" LastEditDate="2015-10-29T16:20:58.967" LastActivityDate="2015-10-29T16:20:58.967" Title="Custom configuration layer for multi-term is ignored" Tags="|spacemacs|use-package|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17662" PostTypeId="1" AcceptedAnswerId="30946" CreationDate="2015-10-26T15:48:28.100" Score="0" ViewCount="90" Body="&lt;p&gt;I've been having some issues using org-mode with paren matching. Here are a few screenshots of the problem. In short, when my mouse isn't on a line, the line is shown correctly, but when parenthesis are being highlighted the line drops to the minimum indentation. W/o paren highlighting this problem isn't there, but I wanted to keep that in org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tcVui.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tcVui.png&quot; alt=&quot;correctly indented&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KtzzO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KtzzO.png&quot; alt=&quot;indentation dropped&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, this happens only on the last line (but this is a problem, as that is the line i'm usually editing).&lt;/p&gt;&#xA;" OwnerUserId="9361" LastEditorUserId="2710" LastEditDate="2015-10-28T11:34:18.270" LastActivityDate="2017-02-22T06:13:40.937" Title="Org mode flashes indentation of lines with parentheses" Tags="|org-mode|indentation|evil|balanced-parentheses|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17665" PostTypeId="1" AcceptedAnswerId="17667" CreationDate="2015-10-26T18:33:05.847" Score="1" ViewCount="193" Body="&lt;p&gt;I am using the &lt;code&gt;ov&lt;/code&gt; library to display overlays. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to insert an overlay into an empty line, it truncates the line. See the pictures below to understand the problem, and use the code to reproduce it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;ov.el&lt;/code&gt; is just a wrapper using emacs' overlays, so this should not be a library specific problem.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/c4sj6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/c4sj6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Iy3Uc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Iy3Uc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ov)&#xA;(defun untitled--display-char-at-point (char point)&#xA;  (progn (ov-set (ov point (+ 1 point))&#xA;                 'display char)))&#xA;&#xA;(point)&#xA;(untitled--display-char-at-point &quot;t&quot; 192)&#xA;&#xA;;; This line moves!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The below is another example of the same happening. If you evaluate this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun untitled--display-char-at-point (char point)&#xA;  (progn (ov-set (ov point (+ 1 point))&#xA;                 'display char)))&#xA;&#xA;(point)&#xA;(untitled--display-char-at-point &quot;t&quot; 184)&#xA;;; hi&#xA;&#xA;;; This line moves!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you end up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun untitled--display-char-at-point (char point)&#xA;  (progn (ov-set (ov point (+ 1 point))&#xA;                 'display char)))&#xA;&#xA;(point)&#xA;(untitled--display-char-at-point &quot;t&quot; 184)&#xA;;; hi&#xA;t;; This line moves!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.3.0, Carbon Version 157 AppKit 1347.57)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps. could we get an &lt;code&gt;ov&lt;/code&gt; tag? That library is the rural jurors bees' knees. &lt;/p&gt;&#xA;" OwnerUserId="8653" LastEditorUserId="3863" LastEditDate="2015-10-27T09:54:09.167" LastActivityDate="2015-10-27T09:54:09.167" Title="Overlay into empty line truncates line, workarounds?" Tags="|overlays|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17666" PostTypeId="2" ParentId="17652" CreationDate="2015-10-26T21:35:18.443" Score="2" Body="&lt;p&gt;So, here's something I came up with, but it's still not perfect.  There are two main problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;catdvi&lt;/code&gt; can't be made to use Unicode subscripts and superscripts, instead it places normal sized characters on the line below and above, which makes inline LaTeX bits look bad.  There are also related problems such as the rendering of &lt;code&gt;\frac{}{}&lt;/code&gt;, &lt;code&gt;\binom{}{}&lt;/code&gt; and similar inline, where they appear on the same line and completely disintegrate into surrounding text.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Multiline LaTeX code is noticeably better, but sometimes &lt;code&gt;catdvi&lt;/code&gt; adds extra blank lines (it's hard to know whether to remove them, but I could post-process the output to remove blank lines).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Below is the code I used and some examples generated:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro by-backend (&amp;amp;rest body)&#xA;  `(cl-case (when (boundp 'backend)&#xA;              (org-export-backend-name backend))&#xA;     ,@body))&#xA;&#xA;(defun my/org-latex-headers ()&#xA;  (mapcar&#xA;   (lambda (record) (plist-get (cl-second record) :value))&#xA;   (cl-remove-if-not&#xA;    (lambda (record)&#xA;      (let* ((data (cl-second record))&#xA;             (key (plist-get data :key)))&#xA;        (or (string-equal key &quot;LATEX_HEADER&quot;)&#xA;            (string-equal key &quot;LATEX_HEADER_EXTRA&quot;))))&#xA;    (org-element-map (org-element-parse-buffer) 'keyword 'identity))))&#xA;&#xA;(defun my/org-latex-template-with-header (body)&#xA;  (org-latex-template&#xA;   body&#xA;   `(:title &quot;&quot;&#xA;            :exported-data ,(make-hash-table)&#xA;            :language &quot;latex&quot;&#xA;            :latex-classes ,org-latex-classes&#xA;            :latex-class &quot;article&quot;&#xA;            :latex-header ,(mapconcat 'identity (my/org-latex-headers) &quot;\n&quot;))))&#xA;&#xA;(defun my/latex-to-ascii (latex &amp;amp;optional multiline)&#xA;  (let* ((catdvi-buf (get-buffer-create &quot;*catdvi-buf*&quot;))&#xA;         (tmpname (make-temp-file &quot;catdvi&quot; nil &quot;.tex&quot;))&#xA;         (dviname (format &quot;%s.dvi&quot; (file-name-sans-extension tmpname)))&#xA;         (template (my/org-latex-template-with-header latex)))&#xA;    (with-current-buffer catdvi-buf (erase-buffer))&#xA;    (with-temp-file tmpname&#xA;      (insert template)&#xA;      tmpname)&#xA;    (call-process (executable-find &quot;texi2dvi&quot;)&#xA;                  nil (get-buffer-create &quot;*texi2dvi-buf*&quot;) nil&#xA;                  &quot;-o&quot; dviname tmpname)&#xA;    (if multiline&#xA;        (progn&#xA;          (call-process (executable-find &quot;catdvi&quot;) nil (list catdvi-buf nil) nil&#xA;                        &quot;-e&quot; &quot;0&quot; dviname)&#xA;          (replace-regexp-in-string&#xA;            ;; removes page numbering and page break&#xA;            &quot;[\f\v\t\n ]*1[\f\n\t \\.]*\\'&quot; &quot;&quot;&#xA;            (with-current-buffer catdvi-buf (buffer-string))))&#xA;      (progn&#xA;        (call-process (executable-find &quot;catdvi&quot;) nil (list catdvi-buf nil) nil&#xA;                      &quot;-s&quot; &quot;-e&quot; &quot;0&quot; dviname)&#xA;        (org-trim&#xA;         (replace-regexp-in-string&#xA;          ;; removes page numbering and page break&#xA;          &quot;1[\f\n\t \\.]*\\'&quot; &quot;&quot;&#xA;          (with-current-buffer catdvi-buf (buffer-string))))))))&#xA;&#xA;(defun my/org-ascii-latex-fragment (orig latex-fragment contents info)&#xA;  (when (plist-get info :with-latex)&#xA;    (my/latex-to-ascii&#xA;     (org-element-property :value latex-fragment))))&#xA;&#xA;(defun my/org-ascii-latex-environment (orig latex-environment contents info)&#xA;  (message &quot;my/org-ascii-latex-environment&quot;)&#xA;  (when (plist-get info :with-latex)&#xA;    (org-ascii--justify-element&#xA;     (my/latex-to-ascii&#xA;      (org-remove-indentation (org-element-property :value latex-environment)) t)&#xA;     latex-environment info)))&#xA;&#xA;(advice-add 'org-ascii-latex-fragment :around 'my/org-ascii-latex-fragment)&#xA;(advice-add 'org-ascii-latex-environment :around 'my/org-ascii-latex-environment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you will also need to compile &lt;a href=&quot;http://sourceforge.net/projects/catdvi/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;catdvi&lt;/code&gt;&lt;/a&gt; from sources. There's also a minor problem with compiling it: some C file uses a variable defined in a dependent header file (typically installed separately) without a &lt;code&gt;const&lt;/code&gt;, while the header needs it to be a &lt;code&gt;const&lt;/code&gt; (easily fixed by just adding the necessary declaration bit).  &lt;code&gt;texi2dvi&lt;/code&gt; should be available for installing from the package manager.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alternatives for inline LaTeX:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking about using &lt;code&gt;TeX&lt;/code&gt; input method, which can use Unicode subscript and superscript characters, however, this would require parsing and pre-processing LaTeX code in order to feed it to &lt;code&gt;TeX&lt;/code&gt; input method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another alternative is to try to use AUCTeX parsing to figure out subscripts and superscripts, but both of these demand too much effort... It's easier at the moment to use &lt;code&gt;catdvi&lt;/code&gt; for inline formulas and then to fix the subscripts / superscripts by hand.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/prepare-tex-ime (input)&#xA;  (cl-loop for paren in '(&quot;[]{}&quot;) do&#xA;           (setq input (replace-regexp-in-string&#xA;                        (format &quot;\\\\%s&quot; paren) paren input)))&#xA;  input)&#xA;&#xA;(defun my/tex-ime-translate (input)&#xA;  (with-temp-buffer&#xA;    (set-input-method 'TeX)&#xA;    (setq quail-current-key &quot;&quot;)&#xA;    (cl-loop for c across input do&#xA;             (setq last-command-event c)&#xA;             (call-interactively 'quail-self-insert-command))&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Problem 1&#xA;   Prove that&#xA;   #+HEADER: :exports results&#xA;   #+HEADER: :results (by-backend (pdf &quot;latex&quot;) (t &quot;raw&quot;))&#xA;   #+BEGIN_SRC latex&#xA;     \begin{align*}&#xA;       L = \{w \in \{a, b, c, d\}^* \;|\; w=dv, v \in \{a, b, c\}^*,&#xA;       \#_a(w) \cdot \#_c(w) &amp;lt; \#_b(w) \}&#xA;     \end{align*}&#xA;   #+END_SRC&#xA;   is not regular.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Translates into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1.1 Problem 1&#xA;─────────────&#xA;&#xA;  Prove that&#xA;                    ∗                    ∗&#xA;  L = {w ∈ {a,b,c,d} | w = dv,v ∈ {a,b,c} ,# (w)·# (w) &amp;lt; # (w)}&#xA;                                            a     c       b&#xA;&#xA;  is not regular.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-10-26T21:35:18.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17667" PostTypeId="2" ParentId="17665" CreationDate="2015-10-26T22:10:41.590" Score="2" Body="&lt;p&gt;The question has nothing to do with &lt;code&gt;spacemacs&lt;/code&gt;, so the reference to that library/configuration should be removed from the question so as not to confuse other forum participants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original poster should use a test to determine whether point -- &lt;strong&gt;where the overlay will be placed&lt;/strong&gt; -- is at the end of the line, and use either of the following if that is the case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;'display&lt;/code&gt; property with the string plus a new-line &lt;code&gt;\n&lt;/code&gt; -- e.g., &lt;code&gt;&quot;t\n&quot;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;'after-string&lt;/code&gt; property with just the string -- e.g., &lt;code&gt;&quot;t&quot;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A sample test is as follows:  &lt;code&gt;(= (point) (point-at-eol))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;point&lt;/code&gt; is not at the end of the line, just the string and the &lt;code&gt;'display&lt;/code&gt; property will suffice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two examples of overlay placement when &lt;code&gt;point&lt;/code&gt; is at the end of the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(overlay-put (make-overlay (point) (1+ (point)) 'display &quot;t\n&quot;)&#xA;&#xA;(overlay-put (make-overlay (point) (point)) 'after-string &quot;t&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-10-26T22:16:52.587" LastActivityDate="2015-10-26T22:16:52.587" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17668" PostTypeId="1" AcceptedAnswerId="17669" CreationDate="2015-10-26T22:50:55.297" Score="1" ViewCount="462" Body="&lt;p&gt;I'm using these themes in my init file (it's literally all that is in my init file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'custom-theme-load-path &quot;~/.emacs.d/themes&quot;)&#xA;(load-theme 'org-beautify-theme t) &#xA;(load-theme 'zenburn t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result looks like this: &lt;a href=&quot;https://i.stack.imgur.com/nncig.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://i.stack.imgur.com/nncig.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get rid of these white borders? I think these borders are coming from the default white background color (if I disable the zenburn theme, the border blends into the white background).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on Windows 7, Emacs version is 24.5.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, it's really hard coming up with a tag if you don't have enough reputation to create new ones and you're left with no options because any other tag wouldn't make sense in this context... I tried 'theme', 'color', but they don't exist and so I had to put in some unrelated but existing tag like 'package' since it doesn't let me post the question without zero tags (which makes sense)...&lt;/p&gt;&#xA;" OwnerUserId="9775" LastEditorUserId="2274" LastEditDate="2015-10-27T01:28:29.527" LastActivityDate="2015-10-27T01:28:29.527" Title="White borders around text with theme org-beautify-theme" Tags="|themes|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17669" PostTypeId="2" ParentId="17668" CreationDate="2015-10-26T23:01:38.360" Score="1" Body="&lt;p&gt;Judging by &lt;a href=&quot;https://github.com/jonnay/emagicians-starter-kit/blob/master/themes/org-beautify-theme.el#L22-L24&quot; rel=&quot;nofollow&quot;&gt;the comment at the top&lt;/a&gt;, it should be sufficient to load zenburn first, then org-beautify.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-10-26T23:01:38.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17670" PostTypeId="1" AcceptedAnswerId="17671" CreationDate="2015-10-27T02:42:35.433" Score="9" ViewCount="674" Body="&lt;p&gt;When trying to theme certain modes, it's not possible to place the point on the themed item (e.g. to do &lt;code&gt;C-u C-x =&lt;/code&gt;) and identify the face used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thought is to use the mouse to identify the face used, but all I can get is the frame x, y position (using &lt;code&gt;(mouse-position)&lt;/code&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there I don't know how to get the face definition at those coords.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="105" LastEditDate="2015-10-27T04:33:41.113" LastActivityDate="2019-03-27T16:39:34.090" Title="Is there a way to determine the face at frame x / y (mouse position)?" Tags="|faces|themes|mouse|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17671" PostTypeId="2" ParentId="17670" CreationDate="2015-10-27T04:22:59.590" Score="4" Body="&lt;p&gt;Here's one way.  You need to bind the command to a mouse event.  But if you use a mouse-button click then you will likely need to bind the event for the other part of the click (e.g. down) to &lt;code&gt;ignore&lt;/code&gt;.  This is just an example - you might not want to waste &lt;code&gt;C-mouse1&lt;/code&gt; on such a command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main function (command, actually) is &lt;strong&gt;&lt;code&gt;describe-char&lt;/code&gt;&lt;/strong&gt;. It describes the point at a given buffer position. Part of that description includes the text properties and overlays at that position, and if property &lt;code&gt;face&lt;/code&gt; is one of these then you will see its value.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (event)&#xA;  (interactive &quot;e&quot;)&#xA;  (let* ((mouse-pos  (event-start event))&#xA;         (pos-pt     (posn-point mouse-pos)))&#xA;    (describe-char pos-pt)))&#xA;&#xA;(global-set-key [(control down-mouse-1)] 'ignore)&#xA;(global-set-key [(control mouse-1)] 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This might be slightly better - the above might not work in some contexts:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (event)&#xA;  (interactive &quot;e&quot;)&#xA;  (let* ((mouse-pos  (event-start event))&#xA;         (mouse-buf  (window-buffer (posn-window mouse-pos)))&#xA;         (pos-pt     (posn-point mouse-pos)))&#xA;    (with-current-buffer mouse-buf (describe-char pos-pt))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note too that &lt;code&gt;C-x =&lt;/code&gt; is bound to &lt;code&gt;what-cursor-position&lt;/code&gt;, which uses &lt;code&gt;describe-char&lt;/code&gt;. So you were on the right track with &lt;code&gt;C-u C-x =&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As concerns Ido: Unlike Icomplete, which uses an overlay, Ido mode inserts text in the minibuffer.  But the reason the above code does not work on that text is that Ido mode removes the text at the beginning of each command, using &lt;code&gt;pre-command-hook&lt;/code&gt;.  So when the command above is executed, the text showing the completions has already been removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code remedies that problem, just for Ido mode.  It re-inserts the text showing the completions at the start, and then removes the completions at the end.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (event)&#xA;  (interactive &quot;e&quot;)&#xA;  (when (and (boundp 'ido-mode)  ido-mode) (ido-exhibit))&#xA;  (let* ((mouse-pos  (event-start event))&#xA;         (mouse-buf  (window-buffer (posn-window mouse-pos)))&#xA;         (pos-pt     (posn-point mouse-pos)))&#xA;    (with-current-buffer mouse-buf (describe-char pos-pt)))&#xA;  (when (and (boundp 'ido-mode)  ido-mode) (ido-tidy)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-28T01:13:15.007" LastActivityDate="2015-10-28T01:13:15.007" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="17672" PostTypeId="2" ParentId="17670" CreationDate="2015-10-27T06:03:21.107" Score="1" Body="&lt;p&gt;You can use the packate &lt;a href=&quot;https://github.com/Lindydancer/faceup&quot; rel=&quot;nofollow&quot;&gt;faceup&lt;/a&gt; to create a human readable text representation of a text, with face information. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (arg)&#xA;  (if arg 1 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;M-x faceup-vire-buffer RET&lt;/code&gt;, and the following is shown:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(«k:defun» «f:foo» («v:arg»)&#xA;  («k:if» arg 1 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The standard font-lock faces are represented using short names, like &lt;code&gt;k&lt;/code&gt; for &lt;code&gt;font-lock-keyword-face&lt;/code&gt;, whereas non-standard faces are presented using their full name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Faceup is a regression test system for highlighting packages, e.g. font-lock keywords, the text representation is stored as a reference file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the question in the comment: &quot;If I'm trying to debug the faces used in a minibuffer display is this still going to give me the info?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, it does. However, you must bind the function to a key since running it using &lt;code&gt;M-x&lt;/code&gt; won't work when the minibuffer is in use. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt;&quot;) 'faceup-view-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you by the &quot;minibuffer&quot; really meant the echo area -- that it, you would like to inspect the current message you will need a bit more. The following function will do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-faceup-view-current-message ()&#xA;  (interactive)&#xA;  (let ((msg (current-message)))&#xA;    (unless msg&#xA;      (error &quot;Echo area is empty&quot;))&#xA;    (with-temp-buffer&#xA;      (insert msg)&#xA;      (faceup-view-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((s &quot;My Message&quot;))&#xA;  (add-text-properties 3 (length s) '(face font-lock-warning-face) s)&#xA;  (message s)&#xA;  (my-faceup-view-current-message))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will show you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;My «w:Message»&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-10-27T08:41:57.260" LastActivityDate="2015-10-27T08:41:57.260" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17673" PostTypeId="1" AcceptedAnswerId="17674" CreationDate="2015-10-27T06:16:35.553" Score="23" ViewCount="20960" Body="&lt;p&gt;my emacs version is 24.3.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i understand i have to put the ob-C.el (available from &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/plain/lisp/ob-C.el&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;) in a path where Emacs can read it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i first copy-pasted the code from that .el file to my .emacs file and restarted emacs. then i went to a C code block (within an org file) and tried to execute it (using C-c C-c). the minibuffer said 'no org-babel-execute function for C'. the same story played out with trying to execute a C++ code block. note that R and python evaluate perfectly from within my org files. the problems seems to be only with these compiled languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i then tried putting this ob-C.el inside the ~/.emacs.d directory to see if that helped matters. restarted emacs and checked. it didn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then i tried putting it into a directory ~/.emacs.d/lisp and added the following lines to my .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/lisp/&quot;)&#xA;(load &quot;ob-C.el&quot;)&#xA;(require 'ob-C)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after restarting emacs, evaluating the C or C++ code blocks from within an org file still doesn't work. i keep getting the same error &quot;no org-babel-execute function for C&quot; or &quot;no org-babel-execute function for C++&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i upgraded my emacs version to 24.5, deleted all the previous elpa and melpa subdirectories in my ~/.emacs.d directory. suspecting that it had to do with the order in which i placed my &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;&#xA;'(org-babel-load-languages&#xA;(quote&#xA;((emacs-lisp . t)&#xA; (C . t)&#xA; (css . t)&#xA; (sh . t)&#xA; (awk . t)&#xA; (R . t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; load the pathnames to custom lisp files&#xA;(add-to-list 'load-path &quot;~/.emacs.d/lisp/&quot;)&#xA;(load &quot;ob-C.el&quot;)&#xA;(require 'ob-C)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;code blocks, i put the load &quot;ob-C.el&quot; before the org-babel-load-languages thing. i then executed the c++ code block multiple times. no luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then i removed everything (cleaned out the custom-set-variables block in the .emacs file) and now my .emacs file looks like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; load the pathnames to custom lisp files&#xA;(add-to-list 'load-path &quot;~/.emacs.d/lisp/&quot;)&#xA;(load &quot;ob-C.el&quot;)&#xA;(require 'ob-C)&#xA;&#xA;;; load the languages that are needed&#xA;(org-babel-do-load-languages&#xA;'org-babel-load-languages '((C . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Its still not working. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code that i am trying to evaluate in an orgmode buffer is : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC c&#xA;printf(&quot;Hello world&quot;);&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;em&gt;Messages&lt;/em&gt; buffer looks like this after restarting emacs and attempting to execute the above code block : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading /home/taeten/.emacs.d/lisp/ob-C.el (source)...done&#xA;Wrote /home/taeten/.emacs.d/.emacs.desktop.lock&#xA;Desktop: 1 frame, 0 buffers restored.&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;Quit [2 times]&#xA;Making completion list... [3 times]&#xA;org-babel-execute-src-block: No org-babel-execute function for c! [5   &#xA;times]&#xA;Ignoring unknown mode `elisp-mode'&#xA;File local-variables error: (void-function elisp-mode)&#xA;byte-code: Beginning of buffer [6 times]&#xA;byte-code: Beginning of buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9958" LastEditorUserId="9958" LastEditDate="2015-10-29T05:35:25.327" LastActivityDate="2020-11-13T23:48:49.770" Title="&quot;no org-babel-execute function for c&quot; and &quot;no-org-babel-execute function for c++&quot;" Tags="|org-babel|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17674" PostTypeId="2" ParentId="17673" CreationDate="2015-10-27T09:19:29.620" Score="34" Body="&lt;p&gt;You really only need this bit in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA; 'org-babel-load-languages '((C . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note it's a capital &lt;code&gt;C&lt;/code&gt;. This enables Babel to process C, C++ and D source blocks.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-10-27T09:19:29.620" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17675" PostTypeId="2" ParentId="17501" CreationDate="2015-10-27T12:44:39.823" Score="1" Body="&lt;p&gt;@lawlist's comment is actually an answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;No, that is not possible – out of the box – because the folded content is subsequent to where the tag ends. It is possible to copy the contents of tag(s), and use it as an overlay in addition to the ellipsis (and start the fold before the tag begins), but that is certainly not built-in behavior and would involve modifying the source-code for someone motivated with some free time on his/her hands. In essence, the concept is that the tag will actually be folded/hidden and what is visible will be overlays in the form of an ellipsis plus a stretch spacer overlay plus a tag overlay.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9322" LastActivityDate="2015-10-27T12:44:39.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17676" PostTypeId="2" ParentId="9815" CreationDate="2015-10-27T12:47:36.343" Score="1" Body="&lt;p&gt;@idontgetoutmuch and @stsquad commented the question but the links in their comments in my opinion count as answers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/mattdeboard/jira-rest&quot; rel=&quot;nofollow&quot;&gt;jira-rest.el&lt;/a&gt; (very old and unmaintained)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/ototo/jic&quot; rel=&quot;nofollow&quot;&gt;JIRA Command Line Client&lt;/a&gt; (could be integrated into Emacs)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9322" LastActivityDate="2015-10-27T12:47:36.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17677" PostTypeId="2" ParentId="9492" CreationDate="2015-10-27T14:27:01.943" Score="34" Body="&lt;p&gt;This may be a preferred way (due to its simplicity) of accomplishing your goal -- it seems to have gotten buried in the comments of another answer:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Add the following to your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; (require 'ox-extra)&#xA; (ox-extras-activate '(ignore-headlines))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use the &lt;code&gt;ignore&lt;/code&gt; tag on headlines you'd like to have ignored (while not ignoring their content)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; currently, add-on &lt;code&gt;ox-extra&lt;/code&gt; becomes available after installation of the &lt;a href=&quot;https://elpa.nongnu.org/nongnu/org-contrib.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;package &lt;code&gt;org-contrib&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;OLDER NOTE:&lt;/strong&gt; if you are using ELPA to install org-mode, you must add the org-mode repository to your list of ELPA repositories.  See &lt;a href=&quot;https://orgmode.org/elpa.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for more details.  After this is done, refresh the package list (&lt;code&gt;M-x package-refresh-contents&lt;/code&gt;) and install the &lt;code&gt;org-plus-contrib&lt;/code&gt; package (e.g. with &lt;code&gt;M-x package-install&lt;/code&gt;).  Don't forget to get rid of any old org-mode installations.&lt;/p&gt;&#xA;" OwnerUserId="8541" LastEditorUserId="28451" LastEditDate="2024-03-02T19:57:27.020" LastActivityDate="2024-03-02T19:57:27.020" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="17679" PostTypeId="2" ParentId="17016" CreationDate="2015-10-27T15:42:08.090" Score="0" Body="&lt;p&gt;Finally I found what I was searching for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;s-&amp;lt;tab&amp;gt;&quot;) 'outline-hide-subtree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;do the trick. (shortcut is on Windows_key+TAB)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to overide the backtab (Shift tab) you can do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'org-shifttab 'outline-hide-subtree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-10-27T15:42:08.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17680" PostTypeId="2" ParentId="16735" CreationDate="2015-10-27T16:03:31.017" Score="9" Body="&lt;p&gt;To get the time mode, just add &lt;code&gt;(display-time-mode 1)&lt;/code&gt; to your &lt;code&gt;~/.spacemacs&lt;/code&gt; configuration.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get date and time, do this instead&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;display time in powerline&#xA;  (spacemacs|define-mode-line-segment date-time-segment&#xA;    (shell-command-to-string &quot;echo -n $(date +%k:%M--%m-%d)&quot;)&#xA;    )&#xA;  (add-to-list 'spacemacs-mode-line-right 'date-time-segment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3lu414/how_to_add_date_and_time_into_spacemacs_powerline/&quot; rel=&quot;noreferrer&quot;&gt;https://www.reddit.com/r/emacs/comments/3lu414/how_to_add_date_and_time_into_spacemacs_powerline/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I customized mine with this...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; display time in powerline&#xA;  (spacemacs|define-mode-line-segment date-time-segment&#xA;    (shell-command-to-string &quot;echo -n \&quot;⏰  $(date '+%a %d %b %I:%M%p')\&quot;&quot;))&#xA;  (add-to-list 'spacemacs-mode-line-right 'date-time-segment)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so now my powerline looks like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/R4P37.png&quot; alt=&quot;my_power_line&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9963" LastEditorUserId="9963" LastEditDate="2015-10-27T16:20:23.080" LastActivityDate="2015-10-27T16:20:23.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17682" PostTypeId="1" AcceptedAnswerId="17683" CreationDate="2015-10-27T17:15:11.440" Score="1" ViewCount="354" Body="&lt;p&gt;I use org-mode, with auto-capitalize-mode turned on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But sometimes, within org-mode, I want to type out some lisp, highlight it, and execute it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I might type something like &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq org-cycle-emulate-tab)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Auto-capitalize automatically capitalizes setq to Setq. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't feel like switching modes to emacs-lisp-mode or disabling auto-capitalize-mode. I just want it to recognize that I never want the word &lt;code&gt;setq&lt;/code&gt; capitalized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I disable autocapitalization for certain specific words? &lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="17852" LastEditDate="2021-06-15T16:14:29.103" LastActivityDate="2021-06-15T16:14:29.103" Title="how to disable autocapitalization for specific words?" Tags="|org-mode|capitalization|auto-capitalize-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17683" PostTypeId="2" ParentId="17682" CreationDate="2015-10-27T19:00:03.617" Score="3" Body="&lt;p&gt;The doc-string for the variable &lt;code&gt;auto-capitalize-words&lt;/code&gt; states as follows:  &quot;&lt;em&gt;If non-nil, a list of proper nouns or acronyms.  If 'auto-capitalize' mode is on, these words will be automatically capitalized or upcased as listed (mixed case is allowable as well), even in the middle of a sentence.  &lt;strong&gt;A lowercase word will not have its casemodified&lt;/strong&gt;.&lt;/em&gt;&quot;  [Admittedly, the comments in the source-code, &lt;em&gt;infra&lt;/em&gt;, are more concise than the doc-string itself.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lines 61 to 63 of the source-code -- &lt;a href=&quot;https://github.com/yuutayamada/auto-capitalize-el/blob/master/auto-capitalize.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/yuutayamada/auto-capitalize-el/blob/master/auto-capitalize.el&lt;/a&gt; -- contain comments that state:  &quot;&lt;em&gt;To prevent a word from ever being capitalized or upcased (e.g. &quot;http&quot;), simply add it (in lowercase) to the 'auto-capitalize-words' list.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original poster has confirmed (in the comments underneath the original question) that the following setting resolves his issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-capitalize-words '(&quot;I&quot; &quot;setq&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-10-27T19:00:03.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17684" PostTypeId="2" ParentId="16468" CreationDate="2015-10-27T19:02:52.647" Score="1" Body="&lt;p&gt;There is really only one answer that can work for everyone all of the time, at least if you want both the ability to view indentation increments at different widths and to be able to align continuation lines consistently with the indentation level of the line they are continued from:  &lt;a href=&quot;http://www.emacswiki.org/emacs/SmartTabs&quot; rel=&quot;nofollow&quot; title=&quot;Use SmartTabs&quot;&gt;Use Smart Tabs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an explanation of all the issues with indentation and alignment of continuation lines see &lt;a href=&quot;http://www.emacswiki.org/emacs/TabsAreEvil&quot; rel=&quot;nofollow&quot;&gt;Tabs Are Evil&lt;/a&gt;.  (Tabs aren't really evil of course, it's just a problem when they are abused for multiple purposes -- when used correctly they are &lt;em&gt;the&lt;/em&gt; enabling tool for viewing indentation at different widths.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important advantage of using tabs for indentation and spaces for alignment is that one can also view indentation increments with different widths &lt;em&gt;outside&lt;/em&gt; of the editor.  For example by simply setting tab stops every desired number of spaces in one's terminal (emulator), even a raw view (e.g. &lt;code&gt;cat file&lt;/code&gt;) of a tab-indented and space-aligned file will look as desired no matter what the terminal's tab width is set to.  This technique of &lt;a href=&quot;http://www.emacswiki.org/emacs/SmartTabs&quot; rel=&quot;nofollow&quot; title=&quot;Use SmartTabs&quot;&gt;Smart Tabs&lt;/a&gt; should even work for those other lesser editors, even if only by politely asking their users to be a little more careful about when they press  and when they press  so that they can manually implement &lt;a href=&quot;http://www.emacswiki.org/emacs/SmartTabs&quot; rel=&quot;nofollow&quot; title=&quot;Use SmartTabs&quot;&gt;Smart Tabs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9895" LastActivityDate="2015-10-27T19:02:52.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17685" PostTypeId="1" AcceptedAnswerId="17693" CreationDate="2015-10-27T20:00:25.733" Score="2" ViewCount="231" Body="&lt;p&gt;Is it possible to add priority to items of a list using &lt;code&gt;orgmode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [#A] first&#xA;- [#A] also imporstant&#xA;- [#B] important but a bit less&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If possible, What about lists with check boxes?&lt;/p&gt;&#xA;" OwnerUserId="2441" LastActivityDate="2015-10-27T22:12:58.823" Title="Orgmode: Priorities on list's items" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17687" PostTypeId="1" AcceptedAnswerId="72778" CreationDate="2015-10-27T20:20:02.860" Score="14" ViewCount="2048" Body="&lt;p&gt;in Helm I ignore some buffers from showing when using &lt;code&gt;C-x b&lt;/code&gt;, I'm looking for a way to make the commands &lt;code&gt;previous-buffer&lt;/code&gt; and &lt;code&gt;next-buffer&lt;/code&gt; behave the same ignoring some buffers.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2022-07-26T13:34:14.430" Title="make `previous-buffer` and `next-buffer` to ignore some buffers" Tags="|buffers|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17688" PostTypeId="1" AcceptedAnswerId="17703" CreationDate="2015-10-27T20:22:14.027" Score="1" ViewCount="792" Body="&lt;p&gt;I tried to use a following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-[&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it also disables &lt;code&gt;M-x&lt;/code&gt;. How can I properly disable it?&lt;/p&gt;&#xA;" OwnerUserId="6848" LastActivityDate="2015-10-28T16:27:17.760" Title="How to unbind C-[ shortcut" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ClosedDate="2015-10-28T18:35:01.947" ContentLicense="CC BY-SA 3.0" />
  <row Id="17689" PostTypeId="1" AcceptedAnswerId="17733" CreationDate="2015-10-27T20:31:39.873" Score="3" ViewCount="978" Body="&lt;p&gt;I recently updated &lt;code&gt;magit&lt;/code&gt; to 20151025.1115, which gave me a message about &lt;code&gt;git-commit-mode&lt;/code&gt; incompatibility.  I now, instead, have a package &lt;code&gt;git-commit&lt;/code&gt; at version 20151022.933 (from the magit project) installed alongside &lt;code&gt;magit&lt;/code&gt;, both through the &lt;code&gt;M-x list-packages&lt;/code&gt; interface).  In my global git config, &lt;code&gt;core.editor=emacs -nw&lt;/code&gt;.  My emacs is  version 24.5, compiled from source (Gentoo linux).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before this update when I ran &lt;code&gt;git commit&lt;/code&gt; from a terminal (outside of emacs), I would get an emacs instance in a mode aware of git commits -- &quot;syntax&quot; highlighting and &lt;code&gt;C-c C-c&lt;/code&gt; to commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After this update when I run &lt;code&gt;git commit&lt;/code&gt;, the emacs window is in Fundamental mode.  I can still commit with &lt;code&gt;C-s C-x&lt;/code&gt; but the mode is not git aware and I lose helpful text coloring of my commit message.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What do I need to change to get my terminal-launched commits to use a git-aware mode for commiting?&lt;/strong&gt;   Commiting within magit works as expected, I am just trying to &quot;fix&quot; the behavior from a git-launched &lt;code&gt;emacs -nw&lt;/code&gt; session.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2015-12-30T00:44:06.013" Title="Git commit uses fundamental mode after magit update" Tags="|magit|major-mode|git|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17690" PostTypeId="1" CreationDate="2015-10-27T20:32:48.887" Score="0" ViewCount="128" Body="&lt;p&gt;When I run 'emacs -nw --no-init abc' with emacs version 24.4.1, I always see the same escape codes inserted at the top of the file:  &quot;12;rgb:0000/0000/0000&quot;.  When I run the same command on the same machine with emacs version 24.3.1 I don't see those escape codes. Has something changed that I need to adapt to or is this an emacs bug?  This is on RedHat 5.8.  TERM is set to xterm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both versions were installed by recompiling from source.  This also happens with emacs version 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="9968" LastEditorUserId="9968" LastEditDate="2015-10-28T00:19:07.513" LastActivityDate="2015-10-28T00:19:07.513" Title="Emacs (-nw) version 24.4.1 adds escape code to the top of every file, when 24.3.1 doesn't" Tags="|terminal-emacs|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17691" PostTypeId="2" ParentId="17687" CreationDate="2015-10-27T20:38:07.257" Score="9" Body="&lt;p&gt;Here are two ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you take a look at the definition of function &lt;code&gt;switch-to-next-buffer&lt;/code&gt; (in library &lt;code&gt;window.el&lt;/code&gt;) you will see that it filters the buffers by the predicate (if any) that is the value of frame parameter &lt;code&gt;buffer-predicate&lt;/code&gt;. That function is used by &lt;code&gt;next-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set that frame parameter to a predicate that filters the way you want.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can simply advise function &lt;code&gt;switch-to-next-buffer&lt;/code&gt; to filter the way you want. You will essentially replace its definition by almost the same definition, but filter additionally the way you want.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Similarly for &lt;code&gt;switch-to-previous-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="897" LastEditDate="2015-10-27T21:43:10.033" LastActivityDate="2015-10-27T21:43:10.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17692" PostTypeId="1" AcceptedAnswerId="17967" CreationDate="2015-10-27T21:56:01.560" Score="0" ViewCount="192" Body="&lt;p&gt;The following code allows me to catch an escape key press.  After evaluating the code, pressing ESC will print &quot;Escape pressed&quot;, as desired.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, due to the equivalence between ESC and Meta, Meta keys do not function when this keymap is active.  Instead, I see messages like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-f is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to evaluate the following block of code, press M-f, and have it invoke &lt;code&gt;forward-word&lt;/code&gt; as usual.  Is there any way to achieve this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-transient-map&#xA; `(keymap &#xA;   (27 . ,(lambda () (interactive) (message &quot;Escape pressed&quot;))))&#xA; nil (lambda () (message &quot;Other key pressed&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3853" LastActivityDate="2015-11-10T02:22:58.123" Title="Catching escape key in transient keymap" Tags="|keymap|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17693" PostTypeId="2" ParentId="17685" CreationDate="2015-10-27T22:12:58.823" Score="5" Body="&lt;p&gt;This is not possible, at least not without rewriting a lot of org-mode.  Plain list are just text.  They do not have priorities, tags, properties or any of the other things headlines can have.  If you need priorities, just convert them to headlines with &lt;code&gt;C-c *&lt;/code&gt; first.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-10-27T22:12:58.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17694" PostTypeId="2" ParentId="17687" CreationDate="2015-10-27T22:17:00.493" Score="13" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom my-skippable-buffers '(&amp;quot;*Messages*&amp;quot; &amp;quot;*scratch*&amp;quot; &amp;quot;*Help*&amp;quot;)&#xA;  &amp;quot;Buffer names ignored by `my-next-buffer' and `my-previous-buffer'.&amp;quot;&#xA;  :type '(repeat string))&#xA;&#xA;(defun my-change-buffer (change-buffer)&#xA;  &amp;quot;Call CHANGE-BUFFER until current buffer is not in `my-skippable-buffers'.&amp;quot;&#xA;  (let ((initial (current-buffer)))&#xA;    (funcall change-buffer)&#xA;    (let ((first-change (current-buffer)))&#xA;      (catch 'loop&#xA;        (while (member (buffer-name) my-skippable-buffers)&#xA;          (funcall change-buffer)&#xA;          (when (eq (current-buffer) first-change)&#xA;            (switch-to-buffer initial)&#xA;            (throw 'loop t)))))))&#xA;&#xA;(defun my-next-buffer ()&#xA;  &amp;quot;Variant of `next-buffer' that skips `my-skippable-buffers'.&amp;quot;&#xA;  (interactive)&#xA;  (my-change-buffer 'next-buffer))&#xA;&#xA;(defun my-previous-buffer ()&#xA;  &amp;quot;Variant of `previous-buffer' that skips `my-skippable-buffers'.&amp;quot;&#xA;  (interactive)&#xA;  (my-change-buffer 'previous-buffer))&#xA;&#xA;(global-set-key [remap next-buffer] 'my-next-buffer)&#xA;(global-set-key [remap previous-buffer] 'my-previous-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or if you wanted to ignore buffer names matching a pattern, you could use this variant.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom my-skippable-buffer-regexp&#xA;  (rx bos (or &amp;quot;*Messages*&amp;quot; &amp;quot;*scratch*&amp;quot; &amp;quot;*Help*&amp;quot;) eos)&#xA;  &amp;quot;Matching buffer names are ignored by `my-next-buffer'&#xA;and `my-previous-buffer'.&amp;quot;&#xA;  :type 'regexp)&#xA;&#xA;(defun my-change-buffer (change-buffer)&#xA;  &amp;quot;Call CHANGE-BUFFER until `my-skippable-buffer-regexp' doesn't match.&amp;quot;&#xA;  (let ((initial (current-buffer)))&#xA;    (funcall change-buffer)&#xA;    (let ((first-change (current-buffer)))&#xA;      (catch 'loop&#xA;        (while (string-match-p my-skippable-buffer-regexp (buffer-name))&#xA;          (funcall change-buffer)&#xA;          (when (eq (current-buffer) first-change)&#xA;            (switch-to-buffer initial)&#xA;            (throw 'loop t)))))))&#xA;&#xA;(defun my-next-buffer ()&#xA;  &amp;quot;Variant of `next-buffer' that skips `my-skippable-buffer-regexp'.&amp;quot;&#xA;  (interactive)&#xA;  (my-change-buffer 'next-buffer))&#xA;&#xA;(defun my-previous-buffer ()&#xA;  &amp;quot;Variant of `previous-buffer' that skips `my-skippable-buffer-regexp'.&amp;quot;&#xA;  (interactive)&#xA;  (my-change-buffer 'previous-buffer))&#xA;&#xA;(global-set-key [remap next-buffer] 'my-next-buffer)&#xA;(global-set-key [remap previous-buffer] 'my-previous-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For the example from the comments, to tell this latter version to also skip all buffer names beginning with &lt;code&gt;helm&lt;/code&gt;, we could use:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq my-skippable-buffer-regexp&#xA;      (rx bos (or (or &amp;quot;*Messages*&amp;quot; &amp;quot;*scratch*&amp;quot; &amp;quot;*Help*&amp;quot;)&#xA;                  (seq &amp;quot;helm&amp;quot; (zero-or-more anything)))&#xA;          eos))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2020-08-10T01:04:56.423" LastActivityDate="2020-08-10T01:04:56.423" CommentCount="13" ContentLicense="CC BY-SA 4.0" />
  <row Id="17695" PostTypeId="1" CreationDate="2015-10-27T22:56:03.670" Score="3" ViewCount="88" Body="&lt;p&gt;I've been trying to get smartparens to recognize Mathematica's comments, which have delimiters &lt;code&gt;(*&lt;/code&gt; and &lt;code&gt;*)&lt;/code&gt;, while keeping the default behavior for ordinary parens &lt;code&gt;(&lt;/code&gt; and &lt;code&gt;)&lt;/code&gt;. The following configuration isn't working.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-with-modes '(wolfram-mode)&#xA;  (sp-local-pair &quot;(*&quot; &quot;*)&quot;&#xA;             :unless '(sp-in-string-p)&#xA;             :actions '(insert wrap)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As soon as I type an open paren, smartparens enters a close paren, as it should. I would like to have the active pair turn into Mathematica comments when I type &lt;code&gt;*&lt;/code&gt;, as follows,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(|) -&amp;gt; (* | *)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;|&lt;/code&gt; is point. Unfortunately, I found this in the smartparens &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Pair-management&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Pairs have to be prefix-free, that means no opening pair should be a prefix of some other pair. This is reasonable and in fact necessary for correct function. For example, with auto insertion of pair &quot;(&quot; &quot;)&quot; and pair &quot;(/&quot; &quot;/)&quot; (which has as a prefix the one paren version), the program wouldn't know you might want to insert the longer version and simply inserts (|). This can technically be fixed with &quot;look-ahead&quot; and then backward alteration of input text, but it will be confusing and probably not very useful anyway. If such functionality will ever get implemented, it will be disabled by default.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'd like to have this functionality, as it's the same behavior that the Mathematica parser itself exhibits. Can anyone tell me how to do this?&lt;/p&gt;&#xA;" OwnerUserId="9503" LastActivityDate="2016-02-21T08:30:32.757" Title="How do I set up smartparens for use with Mathematica comments?" Tags="|smartparens|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17696" PostTypeId="1" CreationDate="2015-10-28T00:47:40.387" Score="0" ViewCount="539" Body="&lt;p&gt;I new with elpa/melpa, and can not understand: &#xA;should package (installed from melpa repository) be autoload by emacs during start or not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I install 'company' from melpa repo, and &lt;code&gt;(require 'company)&lt;/code&gt; in my &quot;.emacs&quot; failed:&#xA;LANG=C emacs --debug-init show such error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;No such file or directory&quot; &quot;company&quot;)&#xA;   require(company)&#xA;   eval-buffer(# nil &quot;/home/user/.emacs&quot; nil t)  ; Reading at &#xA;  buffer position 9609&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;position 9609 is exactly where &lt;code&gt;(require 'company)&lt;/code&gt; ends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, when I install &quot;magit&quot; from melpa, all work fine without &quot;.emacs&quot; modification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after I install something using &lt;code&gt;M-x list-packages&lt;/code&gt; and restart emacs, should&#xA;installed package be autoload by default?&#xA;If they should be autoload, why company have different behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used GNU Emacs 24.5.1&lt;/p&gt;&#xA;" OwnerUserId="2448" LastEditorUserId="2448" LastEditDate="2015-10-28T03:11:46.230" LastActivityDate="2015-10-28T03:11:46.230" Title="elpa/melpa autoload package" Tags="|package-repositories|" AnswerCount="1" CommentCount="4" ClosedDate="2015-10-28T04:42:00.817" ContentLicense="CC BY-SA 3.0" />
  <row Id="17697" PostTypeId="2" ParentId="17696" CreationDate="2015-10-28T02:47:40.703" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;(require 'company) in my &quot;.emacs&quot; failed&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How did it fail? What message do you get? (See the messages buffer).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If they should be autoload, why company have different behavior?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is standard as far as I can tell. Install from &lt;code&gt;M-x list-packages&lt;/code&gt; and then &lt;code&gt;M-x company-mode&lt;/code&gt; to enable it. No need to edit .emacs.d or init.el files unless you want to customize. See &lt;a href=&quot;http://company-mode.github.io&quot; rel=&quot;nofollow&quot;&gt;usage&lt;/a&gt; section of company mode's main web page for more details.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-10-28T02:47:40.703" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17698" PostTypeId="1" CreationDate="2015-10-28T02:50:58.927" Score="2" ViewCount="234" Body="&lt;p&gt;By &quot;strong&quot; I mean that it will work unconditionally.  &lt;code&gt;'=verbatim='&lt;/code&gt; does not fit the bill.  It fails, for example, in &lt;code&gt;=[[0]]=&lt;/code&gt;.  Same for goes for &lt;code&gt;'~verbatim~'&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2015-11-02T23:27:39.603" Title="Looking for strong inline verbatim environment" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17699" PostTypeId="1" CreationDate="2015-10-28T12:34:57.273" Score="1" ViewCount="191" Body="&lt;p&gt;I want to write some lisp that will take the cwd, and keep traversing up the dirctory tree until it finds a file (in this case config.rb) then when it finds it I want to parse the contents (in this case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require 'compass/import-once/activate'                                                                                                                     &#xA;# Require any additional compass plugins here.                                                                                                             &#xA;&#xA;# Set this to the root of your project when deployed:                                                                                                      &#xA;http_path = &quot;/&quot;                                                                                                                                           &#xA;css_dir = &quot;stylesheets&quot;                                                                                                                                   &#xA;sass_dir = &quot;sass&quot;                                                                                                                                         &#xA;images_dir = &quot;images&quot;                                                                                                                                     &#xA;javascripts_dir = &quot;javascripts&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for example to extract the value for sass_dir&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I want to navigate back into that directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is all because the scss compile mode doesnt work as it tries to compile in the CWD of the buffer which is not how compass works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been wanting to develop my lisp skills anyhow so learning the above techniques would be great if anyone can help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I have done:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom scss-sass-command &quot;compass compile&quot;&#xA;&quot;Command used to compile SCSS files, should be sass or the complete path to your sass runnable example:&quot;&#xA; :group 'scss)&#xA;&#xA;(defun get-compass-root-dir()&#xA;    &quot;Get the root folder for the sass project to run compass command in&quot;&#xA;    (locate-dominating-file buffer-file-name &quot;config.rb&quot;))&#xA;&#xA;(defun scss-compile()&#xA;    &quot;Compiles the directory belonging to the current buffer, using the option&quot;&#xA;      (interactive)&#xA;      (message (get-compass-root-dir))&#xA;      (let ((default-directory (get-compass-root-dir))))&#xA;      (message (pwd))&#xA;      (compile scss-sass-command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I just dont seem to be nailing it. Compass complains there are no files to compile and my attempts to message out the directories to see what is going on dont seem to be working. I have byte compiled the file and relaunced emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anybody have any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="9887" LastEditorUserId="25" LastEditDate="2016-03-14T15:12:13.983" LastActivityDate="2016-03-14T15:15:18.920" Title="Navigate cwd in lisp" Tags="|dired|directory|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17700" PostTypeId="1" AcceptedAnswerId="17746" CreationDate="2015-10-28T12:50:32.710" Score="5" ViewCount="874" Body="&lt;p&gt;I have a hard time using &lt;code&gt;vc-annotate&lt;/code&gt; (my version control system is git), because the output is not very userfriendly, as it displays long filenames in a separate column in the buffer, which take up half of my screen. Apart from that it takes ages until &lt;code&gt;vc-annotate&lt;/code&gt; command returns any output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect this is because of some arguments passed to &lt;code&gt;git blame&lt;/code&gt; command. Can I somehow override the default &lt;code&gt;vc-annotate&lt;/code&gt; command and pass my custom options to &lt;code&gt;git blame&lt;/code&gt; (like not showing file paths, different date format etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;magit-blame&lt;/code&gt; but didn't like the output style of mixing code and annotations.&lt;/p&gt;&#xA;" OwnerUserId="9623" LastEditorUserId="306" LastEditDate="2015-10-29T18:17:02.073" LastActivityDate="2017-01-12T19:51:24.410" Title="How to change options passed to git vc-annotate?" Tags="|git|vc|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17702" PostTypeId="2" ParentId="17699" CreationDate="2015-10-28T14:33:05.257" Score="2" Body="&lt;p&gt;By modifying the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory (get-compass-root-dir))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-directory (get-compass-root-dir))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the desired result. I picked the 'let' code up from scouring other similar natured questions on the interweb, but in this instance it caused an issue. Dont ask me why - im really shooting in the dark with elisp at the minute! Anyway learning the hard way is never a bad way to learn. I haven't read this yet but the above will be probably be explained by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/19067632/difference-between-let-and-setq&quot;&gt;https://stackoverflow.com/questions/19067632/difference-between-let-and-setq&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;With &lt;a href=&quot;https://emacs.stackexchange.com/users/454/phils&quot;&gt;phils&lt;/a&gt;'s &lt;a href=&quot;https://emacs.stackexchange.com/questions/17699/navigate-cwd-in-lisp#comment26485_17702&quot;&gt;suggestion&lt;/a&gt;, the code becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom scss-sass-command &quot;compass compile&quot;&#xA;&quot;Command used to compile SCSS files, should be sass or the complete path to your sass runnable example:&quot;&#xA; :group 'scss)&#xA;&#xA;(defun get-compass-root-dir()&#xA;    &quot;Get the root folder for the sass project to run compass command in&quot;&#xA;    (locate-dominating-file buffer-file-name &quot;config.rb&quot;))&#xA;&#xA;(defun scss-compile()&#xA;    &quot;Compiles the directory belonging to the current buffer, using the option&quot;&#xA;      (interactive)&#xA;      (message (get-compass-root-dir))&#xA;      (let ((default-directory (get-compass-root-dir)))&#xA;        (message (pwd))&#xA;        (compile scss-sass-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9887" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-03-14T15:15:18.920" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17703" PostTypeId="2" ParentId="17688" CreationDate="2015-10-28T14:56:50.773" Score="1" Body="&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/a/10273/8647&quot;&gt;this answer&lt;/a&gt;, which should solve your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;A second possibility is to selectively remap this key combination for Emacs but &lt;em&gt;outside&lt;/em&gt; Emacs.  The options available for this will depend on your operating system.  On Windows, you could do this with &lt;a href=&quot;http://autohotkey.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;AutoHotkey&lt;/a&gt; pretty easily.  If you're on Linux, you might take a look at &lt;a href=&quot;https://emacs.stackexchange.com/a/7836/8647&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;hr&gt;&#xA;(This is the previous content of my answer, moved here because it is less helpful than the above but may still be of interest.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't care about the Esc key per se, you may be able to sever the link between this pair of keys and Meta by setting &lt;code&gt;meta-prefix-char&lt;/code&gt;, but a little bit of fiddling around has convinced me that this isn't as straightforward as simply setting the variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I tried setting &lt;code&gt;meta-prefix-char&lt;/code&gt; to nil.  Following advice in @lawlist's comment on &lt;a href=&quot;https://emacs.stackexchange.com/questions/17692/catching-escape-key-in-transient-keymap&quot;&gt;this question&lt;/a&gt;, I did so as early as possible in initialization to make sure all the keymaps got the hint, but some keybindings (most notably &lt;code&gt;C-M-x&lt;/code&gt; in &lt;code&gt;lisp-interaction-mode&lt;/code&gt;) were unexpectedly unbound, and I was getting many unexpected errors.  It may be possible to sort all this out, but it's probably not worth the effort.  Binding &lt;code&gt;meta-prefix-char&lt;/code&gt; to an alternative key will probably work better, but your options are limited to single ASCII characters, none of which seem more appealing to me than &lt;code&gt;C-[&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-10-28T16:27:17.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17705" PostTypeId="1" CreationDate="2015-10-28T19:02:50.513" Score="1" ViewCount="182" Body="&lt;p&gt;Is there a way to keep sublimity mode for R source buffers, while disabling it for the R console?&lt;/p&gt;&#xA;" OwnerUserId="9976" LastActivityDate="2017-05-21T05:05:16.693" Title="ESS - how to disable sublimity mode for R console only?" Tags="|ess|r|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17707" PostTypeId="2" ParentId="17705" CreationDate="2015-10-28T19:55:40.240" Score="1" Body="&lt;p&gt;ESS puts the R console buffer into &lt;code&gt;iESS&lt;/code&gt;, or &lt;code&gt;inferior-ess-mode&lt;/code&gt;, and the source buffers are in &lt;code&gt;ESS[S]&lt;/code&gt; or &lt;code&gt;r-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;R-mode-hook&lt;/code&gt; runs when you open a new source buffer, so anything you put in that will only effect your source buffers.&lt;code&gt;inferior-ess-mode-hook&lt;/code&gt; runs when you start an R console, so anything in there should only apply to the console buffer and not the source.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-10-28T19:55:40.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17708" PostTypeId="1" AcceptedAnswerId="17709" CreationDate="2015-10-28T20:29:35.190" Score="3" ViewCount="2112" Body="&lt;p&gt;This naive attempt did not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; function_key = dict()&#xA;(setq function-key '()) &#xA;;; function_key[&quot;evil-next-line&quot;] = 108&#xA;(add-to-list function-key '(evil-next-line . 108))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It just exploded with a &lt;code&gt;(setting-constant nil)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2016-03-14T04:51:58.560" LastActivityDate="2023-06-19T19:26:39.510" Title="How do I create and update an alist?" Tags="|association-lists|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17709" PostTypeId="2" ParentId="17708" CreationDate="2015-10-28T21:06:51.747" Score="9" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/List-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;add-to-list&lt;/code&gt;&lt;/a&gt; accept a &lt;code&gt;symbol&lt;/code&gt; as the first argument:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'function-key '(evil-next-line . 108))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If your variable is lexical, you will want to use &lt;code&gt;push&lt;/code&gt; instead:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(let ((foo ...))&#xA;  (push ... foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;NB. You might want to consider &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hash Tables&lt;/a&gt; instead of alists for lookup (they correspond to &lt;a href=&quot;https://docs.python.org/library/stdtypes.html#dict&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;dict&lt;/code&gt;&lt;/a&gt; in Python).&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2023-06-19T19:26:39.510" LastActivityDate="2023-06-19T19:26:39.510" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="17710" PostTypeId="1" AcceptedAnswerId="17722" CreationDate="2015-10-28T22:57:04.957" Score="14" ViewCount="9617" Body="&lt;p&gt;I'm trying to use &lt;code&gt;use-package&lt;/code&gt; to set up my &lt;code&gt;org-mode&lt;/code&gt; initialization.  I have the following in my &lt;code&gt;~/.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org-mode&#xA;  :mode &quot;\\.org$&quot;&#xA;  :ensure org&#xA;  :config&#xA;  (progn&#xA;    (setq org-log-done 'time)&#xA;    (setq org-confirm-babel-evaluate nil)&#xA;    (setq org-export-babel-evaluate nil)&#xA;    (setq org-html-validation-link nil)&#xA;    ;; ... more stuff&#xA;  )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;None of that &lt;code&gt;:config&lt;/code&gt; initialization stuff is getting run, though.  Do I have the package names wrong or something?  I get a bit confused on package names vs. ELPA names vs. invocation commands....&lt;/p&gt;&#xA;" OwnerUserId="8899" LastEditorUserId="8899" LastEditDate="2015-10-29T17:06:49.080" LastActivityDate="2015-10-29T17:46:35.163" Title="`use-package` with :config to set variables" Tags="|org-mode|init-file|use-package|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17711" PostTypeId="1" AcceptedAnswerId="17712" CreationDate="2015-10-29T01:10:03.037" Score="3" ViewCount="361" Body="&lt;p&gt;How can I simultaneously view multiple diffs with Magit? I want to view A..B in one window, and A..C in another window (B and C are diverged branches).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can run &lt;code&gt;magit-diff-dwim&lt;/code&gt; on A..B to view the first diff, but when I run it the second time on A..C, it appears to reuse the same buffer, replacing the A..B diff with A..C. I want to see A..B and A..C side by side to help resolve a merge conflict.&lt;/p&gt;&#xA;" OwnerUserId="9461" LastActivityDate="2015-10-29T01:29:07.997" Title="How do I simultaneously view multiple diffs with Magit?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17712" PostTypeId="2" ParentId="17711" CreationDate="2015-10-29T01:29:07.997" Score="8" Body="&lt;p&gt;In the current Magit (v2.3.0), you can make a buffer stick around by calling &lt;code&gt;magit-toggle-buffer-lock&lt;/code&gt;.  In earlier versions, &lt;code&gt;magit-rename-buffer&lt;/code&gt; served a similar purpose.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-10-29T01:29:07.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17713" PostTypeId="2" ParentId="17708" CreationDate="2015-10-29T03:31:42.043" Score="4" Body="&lt;p&gt;In addition to sds's suggestion of &lt;code&gt;add-to-list&lt;/code&gt;, you can also use &lt;code&gt;push&lt;/code&gt;, which doesn't require you to quote the variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(evil-next-line . 108) function-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="795" LastEditDate="2015-10-29T11:40:39.050" LastActivityDate="2015-10-29T11:40:39.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17714" PostTypeId="1" AcceptedAnswerId="18075" CreationDate="2015-10-29T05:15:43.140" Score="2" ViewCount="1295" Body="&lt;p&gt;I want to publish each of my org-mode posts so the HTML output uses a separate folder for each post.  I want to avoid .html in the URL.  I want the posts to look like &lt;code&gt;http://example.com/my-org-post/&lt;/code&gt; instead of &lt;code&gt;http://example.com/my-org-post.html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a publishing setting to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2015-11-13T21:57:00.407" Title="Publish org-mode to HTML using a separate directory for each post" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17715" PostTypeId="2" ParentId="17710" CreationDate="2015-10-29T05:42:00.240" Score="4" Body="&lt;p&gt;With the caveat that I haven't used &lt;code&gt;use-package&lt;/code&gt; before, I believe you want &lt;code&gt;org&lt;/code&gt; rather than &lt;code&gt;org-mode&lt;/code&gt;.  I'm basing this on the fact that, on my Emacs, &lt;code&gt;(package-installed-p 'org-mode)&lt;/code&gt; returns nil while &lt;code&gt;(package-installed-p 'org)&lt;/code&gt; does not.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-10-29T05:42:00.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17716" PostTypeId="2" ParentId="17714" CreationDate="2015-10-29T07:23:30.947" Score="4" Body="&lt;p&gt;There's no way to just configure this, but you can modify the behavior without too much work if you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a function called &lt;code&gt;org-export-output-file-name&lt;/code&gt; which computes the file name for the export. You can write a modification for this function using &lt;code&gt;defadvice&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've not tested it specifically, but something like this may get you started:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-export-output-file-name (around export-to-directories activate)&#xA;  &quot;alters the org export process to create a subdirectory for each exported org file&quot;&#xA;  (let* ((visited-file (buffer-file-name (buffer-base-buffer)))&#xA;         (dir-name (file-name-sans-extension (file-name-nondirectory visited-file))))&#xA;    (setf pub-dir&#xA;          (concat (file-name-as-directory (or pub-dir &quot;.&quot;))&#xA;                  dir-name))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-export-output-file-name&lt;/code&gt; takes an argument called &lt;code&gt;pub-dir&lt;/code&gt; which contains the directory to publish to; this is generally taken from your project configuration. This advice sets &lt;code&gt;pub-dir&lt;/code&gt; to a new value before calling &lt;code&gt;ad-do-it&lt;/code&gt; to call the original function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, even if I haven't made any other mistakes, there's still one potential problem here. The original &lt;code&gt;org-export-output-file-name&lt;/code&gt; is still going to use the current file name again when constructing the output file name. For example, when exporting the file &lt;code&gt;foo.org&lt;/code&gt; this advised function is going to return the file name &lt;code&gt;./foo/foo.html&lt;/code&gt;. For your use-case, it sounds like a better value would be &lt;code&gt;./foo/index.html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the code had been written to pass the file name in as an argument this would be easy to fix; just override that argument. It seems to me that the only way to fix this is to modify the return value as well as the arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-export-output-file-name (around export-to-directories activate)&#xA;  &quot;alters the org export process to create a subdirectory for each exported org file&quot;&#xA;  (let* ((visited-file (buffer-file-name (buffer-base-buffer)))&#xA;         (dir-name (file-name-sans-extension (file-name-nondirectory visited-file))))&#xA;    (setf pub-dir&#xA;          (concat (file-name-as-directory (or pub-dir &quot;.&quot;))&#xA;                  dir-name))&#xA;    ad-do-it&#xA;    (setf ad-return-value&#xA;          (replace-regexp-in-string (regexp-quote (concat dir-name &quot;.&quot; extension))&#xA;                                    (concat &quot;index.&quot; extension)&#xA;                                    ad-return-value))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's also possible that you could handle that with a rewrite rule (or similar) in your web server config.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-10-29T07:23:30.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17717" PostTypeId="2" ParentId="17660" CreationDate="2015-10-29T07:55:32.013" Score="1" Body="&lt;p&gt;It's hard to say for sure just from a screenshot, but perhaps the window size of your terminal is not an integer multiple of the line height of the text? If that's the case, then you'll get the same behavior even when emacs isn't running; try using less to view some longish file and see if there's the same gap after the last visible line. You could also try adjusting your terminal's font size to see if that gap changes size.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-10-29T07:55:32.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17718" PostTypeId="1" CreationDate="2015-10-29T09:17:14.287" Score="0" ViewCount="100" Body="&lt;p&gt;After upgrading to emacs 24 I have strange problems with copy and paste. I managed to reinstall copy and paste with the mouse but there remains the problem with German diacritic characters. If I copy an Umalut äöü and insert it using the mouse (middle button) I get unicode stuff that cannot be saved ﻿\344\366 and so on. Is there a way to fix this?&lt;/p&gt;&#xA;" OwnerUserId="2440" LastActivityDate="2016-05-27T12:00:55.833" Title="Copy and paste with mouse breaks Umlaute" Tags="|copy-paste|mouse|unicode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17719" PostTypeId="1" AcceptedAnswerId="17721" CreationDate="2015-10-29T09:32:49.420" Score="3" ViewCount="406" Body="&lt;p&gt;I have a buffer with this line of text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a random test&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I want to convert &lt;code&gt;test&lt;/code&gt; in &lt;code&gt;T.E.S.T.&lt;/code&gt;, like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a random T.E.S.T.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So far, I came up with this function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mu-convert-to-acronym (string)&#xA;  &quot;Convert the given STRING in an acronym.&#xA;An acronym must be uppercase and have each letter followed by a dot.&quot;&#xA;  (s-upcase&#xA;   (s-append &quot;.&quot;&#xA;             (s-join &quot;.&quot;&#xA;                     (delete &quot;&quot;&#xA;                             (s-split &quot;&quot; string))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is: how can I turn this function into a command I can call interactively? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like the command to behave like &lt;code&gt;capitalize-word&lt;/code&gt; and &lt;code&gt;upcase-word&lt;/code&gt;, meaning I don't need to select the word I need to convert but I can just issue the command on the word next to point or, given a negative prefix, the one before point.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="105" LastEditDate="2016-03-14T04:51:46.620" LastActivityDate="2016-03-14T04:51:46.620" Title="Convert a word into an acronym" Tags="|string|text|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17720" PostTypeId="2" ParentId="17719" CreationDate="2015-10-29T11:36:16.370" Score="0" Body="&lt;p&gt;Here it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 's)&#xA;&#xA;(defun mu--convert-word-to-acronym (string)&#xA;  &quot;Convert the given STRING in an acronym.&#xA;An acronym must be uppercase and have each letter followed by a dot.&quot;&#xA;  (insert (s-upcase&#xA;           (s-append &quot;.&quot;&#xA;                     (s-join &quot;.&quot;&#xA;                             (delete &quot;&quot;&#xA;                                     (s-split &quot;&quot; string)))))))&#xA;&#xA;(defun mu-convert-word-to-acronym (arg)&#xA;  &quot;Applies mu--convert-word-to-acronym to a word at point. With positive arg applies to the next word, with negative arg applies to the previous word&quot;&#xA;  (interactive &quot;P&quot;)&#xA;&#xA;  (cond&#xA;   ((equal arg '(4))&#xA;    (forward-word)&#xA;    (forward-char)&#xA;    )&#xA;   ((equal arg '(-4))&#xA;    (forward-word -1)&#xA;    (forward-char -1)&#xA;    )&#xA;   ((equal arg '-)&#xA;    (forward-word -1)&#xA;    (forward-char -1)&#xA;    )&#xA;   (t&#xA;    )&#xA;   )&#xA;&#xA;  (let (word-bounds word-start word-end)&#xA;&#xA;    (setq word-bounds (bounds-of-thing-at-point 'word))&#xA;    (setq word-start (car word-bounds))&#xA;    (setq word-end (cdr word-bounds))&#xA;&#xA;    (setq word (buffer-substring-no-properties word-start word-end))&#xA;&#xA;    (delete-region word-start word-end)&#xA;&#xA;    (mu--convert-word-to-acronym word)&#xA;&#xA;    )&#xA;&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Call &lt;code&gt;M-x mu-convert-word-to-acronym&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2015-10-29T11:44:42.023" LastActivityDate="2015-10-29T11:44:42.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17721" PostTypeId="2" ParentId="17719" CreationDate="2015-10-29T11:36:27.950" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;My question is: how can I turn this function into a command I can call&#xA;  interactively?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Use the special form &lt;code&gt;interactive&lt;/code&gt;, also see manual &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Commands.html&quot; rel=&quot;nofollow&quot;&gt;(elisp) Defining Commands&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a command named &lt;code&gt;foo&lt;/code&gt; which uses your &lt;code&gt;mu-convert-to-acronym&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (arg)&#xA;  &quot;Convert word at (or next to) point to its acronym with `mu-convert-to-acronym'.&#xA;With numerical argument ARG, convert the next ARG-1 words as well.&#xA;&#xA;With negative argument, convert previous words.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  ;; With negative argument, move back point firstly&#xA;  (when (&amp;lt; arg 0)&#xA;    ;; If point is in a word but not at the beginning of that word,&#xA;    ;; then move to the beginning fistly&#xA;    (let ((bounds (bounds-of-thing-at-point 'word)))&#xA;      (when (and bounds (not (= (car bounds) (point))))&#xA;        (forward-word -1)))&#xA;    (forward-word arg))&#xA;  (dotimes (_ (abs arg))&#xA;    ;; Adjust point in case point isn't on any word&#xA;    (forward-word)&#xA;    (backward-word)&#xA;    (let ((bounds (bounds-of-thing-at-point 'word)))&#xA;      (when bounds&#xA;        (let* ((beg (car bounds))&#xA;               (end (cdr bounds))&#xA;               (str (buffer-substring beg end)))&#xA;          (delete-region beg end)&#xA;          (goto-char beg)&#xA;          (insert (mu-convert-to-acronym str)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-10-29T11:36:27.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17722" PostTypeId="2" ParentId="17710" CreationDate="2015-10-29T13:50:04.213" Score="26" Body="&lt;p&gt;The below would work. For the sake of clarity, I am using &lt;code&gt;:ensure org-plus-contrib&lt;/code&gt; which deviates a bit from the example in your question.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package org&#xA;  :mode ((&quot;\\.org$&quot; . org-mode))&#xA;  :ensure org-plus-contrib&#xA;  :config&#xA;  (progn&#xA;    ;; config stuff&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are some explanation notes for the above:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(use-package FEATURE-NAME&lt;/code&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;FEATURE-NAME&lt;/code&gt; is what goes in the &lt;code&gt;(provide ..)&lt;/code&gt; line of a package. For &lt;code&gt;org-mode&lt;/code&gt;, that line is &lt;code&gt;(provide 'org)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;:mode ((FILE-REGEXP . MAJOR-MODE))&lt;/code&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;FILE-REGEXP&lt;/code&gt; is the regular expression for which you want a particular major mode to be enabled. You had that correct: &lt;code&gt;&quot;\\.org$&quot;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;MAJOR-MODE&lt;/code&gt; is the name of the major mode that you want to enable (including the &lt;code&gt;-mode&lt;/code&gt; part of the major mode name). In this case, the major mode name is &lt;code&gt;org-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The style &lt;code&gt;:mode (FILE-REGEXP)&lt;/code&gt; that you used would only work if &lt;code&gt;FEATURE-NAME&lt;/code&gt; and &lt;code&gt;MAJOR-MODE&lt;/code&gt; are the exact same. Example: &lt;code&gt;cperl-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;:ensure PACKAGE-NAME&lt;/code&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;PACKAGE-NAME&lt;/code&gt; is what I see listed in the package list (&lt;code&gt;M-x package-list-packages&lt;/code&gt;). For clarity, in my solution above, we are installing the &lt;code&gt;org-plus-contrib&lt;/code&gt;&lt;sup&gt;1&lt;/sup&gt; package. &lt;em&gt;This is to demonstrate the feature name, major mode and the actual package name do not have to be the exact same. And also I prefer installing that instead of plain &lt;code&gt;org-mode&lt;/code&gt; as you get all the &lt;code&gt;contrib/&lt;/code&gt; package goodies too! :)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; You will need to add &lt;code&gt;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&lt;/code&gt; to your emacs config in order to install &lt;code&gt;org-plus-contrib&lt;/code&gt;. See the &lt;a href=&quot;http://orgmode.org/elpa.html&quot;&gt;official org-mode installation page&lt;/a&gt; for more info.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way to make the above &lt;code&gt;use-package&lt;/code&gt; snippet to work is to save it to your emacs config first, then delete prior Package Manager installed versions of &lt;code&gt;org&lt;/code&gt;, and then restart emacs. &lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-10-29T17:46:35.163" LastActivityDate="2015-10-29T17:46:35.163" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17723" PostTypeId="1" AcceptedAnswerId="17728" CreationDate="2015-10-29T14:24:33.953" Score="13" ViewCount="1754" Body="&lt;p&gt;Is there a way to export a .org file into an html that supports expanding and collapsing titles?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want is to be able to press a key like TAB and expand and collapse the outline, but on a html site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Github wikis support orgmode but they don't seem to allow expanding and collapsing of titles.&lt;/p&gt;&#xA;" OwnerUserId="8844" LastActivityDate="2015-10-29T16:16:08.640" Title="How do I export an ORG file to an interactive HTML site?" Tags="|org-mode|html|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17724" PostTypeId="1" CreationDate="2015-10-29T14:28:42.747" Score="5" ViewCount="346" Body="&lt;p&gt;In previous versions (before 2.3) &lt;code&gt;M-x magit-status&lt;/code&gt; showed the status buffer taking the whole size of the current window.  However, now it instead pops up a half-sized buffer (like e.g. &lt;code&gt;C-h f&lt;/code&gt; does).  This looked fine but only until I wanted to review a diff of changes, as then it became apparent I want a full-sized window with the status buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to return the previous behavior of &lt;code&gt;M-x magit-status&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerDisplayName="user8782" LastActivityDate="2015-10-30T11:19:57.823" Title="magit-status doesn't use the whole screen size in 2.3" Tags="|magit|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17725" PostTypeId="1" AcceptedAnswerId="17730" CreationDate="2015-10-29T14:32:45.263" Score="3" ViewCount="1778" Body="&lt;p&gt;I just started using tramp mode, and it looks amazing. However, there's one issue that's making it non-usable for me. I have several boxes which I log into with one user, say, &lt;code&gt;user&lt;/code&gt;. He's in sudoers groups. Now when I go and edit a file, it gets opened in read-only mode. I would like to be able to sudo save, or even better, sudo open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;a href=&quot;http://www.emacswiki.org/emacs/TrampMode#toc31&quot; rel=&quot;nofollow&quot;&gt;tried&lt;/a&gt; &lt;a href=&quot;http://emacs-fu.blogspot.co.uk/2009/10/editing-files-owned-by-root.html&quot; rel=&quot;nofollow&quot;&gt;several&lt;/a&gt; &lt;a href=&quot;http://emacsredux.com/blog/2013/04/21/edit-files-as-root/&quot; rel=&quot;nofollow&quot;&gt;approaches&lt;/a&gt; &lt;a href=&quot;http://wikemacs.org/wiki/TRAMP#Edit_current_file_as_root&quot; rel=&quot;nofollow&quot;&gt;first&lt;/a&gt;, but none seem to actually work, given that emacs and dired changed how some variables get passed around (namely, &lt;code&gt;buffer-file-name&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on GNU Emacs 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="8616" LastActivityDate="2015-10-29T16:31:30.783" Title="How to sudo save file in TRAMP mode?" Tags="|dired|tramp|ssh|sudo|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17726" PostTypeId="2" ParentId="17725" CreationDate="2015-10-29T14:41:14.573" Score="2" Body="&lt;p&gt;You can open a file with sudo whith these functions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun sudo-find-file (file)&#xA;    &quot;Opens FILE with root privileges.&quot;&#xA;    (interactive &quot;FFind file: &quot;)&#xA;    (set-buffer&#xA;     (find-file (concat &quot;/sudo::&quot; (expand-file-name file)))))&#xA;  (global-set-key (kbd &quot;C-c f&quot;) 'sudo-find-file)&#xA;&#xA;(defun sudo-remote-find-file (file)&#xA;    &quot;Opens repote FILE with root privileges.&quot;&#xA;    (interactive &quot;FFind file: &quot;)&#xA;    (setq begin (replace-regexp-in-string  &quot;scp&quot; &quot;ssh&quot; (car (split-string file &quot;:/&quot;))))&#xA;    (setq end (car (cdr (split-string file &quot;@&quot;))))&#xA;    (set-buffer&#xA;     (find-file (format &quot;%s&quot; (concat begin &quot;|sudo:root@&quot; end)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-10-29T15:36:46.857" LastActivityDate="2015-10-29T15:36:46.857" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17727" PostTypeId="2" ParentId="17724" CreationDate="2015-10-29T14:55:05.940" Score="4" Body="&lt;p&gt;This is what I was doing before Magit 2.3, adapted from &lt;a href=&quot;http://whattheemacsd.com/setup-magit.el-01.html&quot; rel=&quot;nofollow&quot;&gt;What the .emacs.d!?&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice magit-status (around magit-fullscreen activate)&#xA;  &quot;Turn fullscreen on for magit-status.&quot;&#xA;  (window-configuration-to-register :magit-fullscreen)&#xA;  ad-do-it&#xA;  (delete-other-windows))&#xA;&#xA;(defun magit-quit-session ()&#xA;  &quot;Restore previous window configuration and cleanup buffers.&quot;&#xA;  (interactive)&#xA;  (mu-kill-buffers &quot;^\\*magit&quot;)&#xA;  (jump-to-register :magit-fullscreen))&#xA;&#xA;(bind-key &quot;q&quot; #'magit-quit-session magit-status-mode-map)&#xA;&#xA;(defun mu-kill-buffers (regexp)&#xA;  &quot;Kill buffers matching REGEXP without asking for confirmation.&quot;&#xA;  (interactive &quot;sKill buffers matching this regular expression: &quot;)&#xA;  (cl-letf (((symbol-function 'kill-buffer-ask)&#xA;             (lambda (buffer) (kill-buffer buffer))))&#xA;    (kill-matching-buffers regexp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The difference from the solution on What the .emacs.d!? is that I like &lt;code&gt;q&lt;/code&gt; to close all Magit buffers and not only &lt;code&gt;magit-status&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have &lt;code&gt;bind-key&lt;/code&gt;, you can just use regular &lt;code&gt;define-key&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key magit-status-mode-map (kbd &quot;q&quot;) #'magit-quit-session)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Following the new Magit guidelines, this is the solution that is now working for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq magit-post-display-buffer-hook&#xA;      #'(lambda ()&#xA;          (when (derived-mode-p 'magit-status-mode)&#xA;            (delete-other-windows))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2015-10-30T11:19:57.823" LastActivityDate="2015-10-30T11:19:57.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17728" PostTypeId="2" ParentId="17723" CreationDate="2015-10-29T15:17:13.153" Score="12" Body="&lt;p&gt;What you are looking for is org-info.js, a JavaScript library to be used in conjunction with HTML files generated from Org. This library adds support for folding, navigation, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at &lt;a href=&quot;http://orgmode.org/manual/JavaScript-support.html&quot;&gt;http://orgmode.org/manual/JavaScript-support.html&lt;/a&gt;, and the more detailed documentation here: &lt;a href=&quot;http://orgmode.org/worg/code/org-info-js/&quot;&gt;http://orgmode.org/worg/code/org-info-js/&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-10-29T16:16:08.640" LastActivityDate="2015-10-29T16:16:08.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17729" PostTypeId="2" ParentId="17660" CreationDate="2015-10-29T15:53:50.657" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This probably means that emacs isn't taking full space inside gnome-terminal.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Probably not. It could happen even when emacs takes full space due to the background color rendering of fringes. For example, you have the same problem on the right side also. Moreover, on the right side this blue fringe becomes thicker below the mode line. All this points to font and line sizes resulting in fractional multiples of the screen size. Emacs is taking the full space but rendering in different colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;linum-mode&lt;/code&gt; and mode-line themes often cause this. Besides turning off &lt;code&gt;linum-mode&lt;/code&gt;, try tweaking font metrics as others have suggested above. Or play with fringe theme colors. Make them same as the main theme's background color. Some themes come with a variable for such tweaking. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq solarized-distinct-fringe-background t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll have to find equivalent variables in your active theme.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-10-29T15:53:50.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17730" PostTypeId="2" ParentId="17725" CreationDate="2015-10-29T16:31:30.783" Score="5" Body="&lt;p&gt;Have you tried the multi-hop method as suggested in the TRAMP manual?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f /ssh:user@localhost|sudo:localhost:/path/to/file RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-10-29T16:31:30.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17731" PostTypeId="2" ParentId="10621" CreationDate="2015-10-29T17:38:05.170" Score="3" Body="&lt;p&gt;Not really part of the question, but here's a sorter that sorts by directory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (define-ibuffer-sorter pathname&#xA;    &quot;Sort by pathname&quot;&#xA;    (:description &quot;path&quot;)&#xA;    (cl-flet ((get-pathname&#xA;               (data)&#xA;               (with-current-buffer (car data)&#xA;                 (or buffer-file-name&#xA;                    (if (eq major-mode 'dired-mode)&#xA;                        (expand-file-name dired-directory))&#xA;                    ;; so that all non pathnames are at the end&#xA;                    &quot;&quot;))))&#xA;      (string&amp;lt; (get-pathname a) (get-pathname b))))&#xA;&#xA;  (define-key ibuffer-mode-map&#xA;    (kbd &quot;s p&quot;) 'ibuffer-do-sort-by-pathname)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This defines a directory filter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun get-all-buffer-directories ()&#xA;    &quot;Return a list of all directories that have at least one&#xA;       file being visited.&quot;&#xA;    (interactive)&#xA;    (let (l)&#xA;      (dolist (e (sort (mapcar 'file-name-directory&#xA;                               (remove-if-not 'identity&#xA;                                              (mapcar 'buffer-file-name&#xA;                                                      (buffer-list))))&#xA;                       'string&amp;lt;))&#xA;        (unless (string= (car l) e)&#xA;          (setq l (cons e l))))&#xA;      l))&#xA;&#xA;  (define-ibuffer-filter dirname&#xA;      &quot;Toggle current view to buffers with in a directory DIRNAME.&quot;&#xA;    (:description &quot;directory name&quot;&#xA;                  :reader&#xA;                  (intern&#xA;                   (completing-read &quot;Filter by directory: &quot;&#xA;                                    (get-all-buffer-directories)&#xA;                                    'identity&#xA;                                    t nil nil nil nil)))&#xA;    (string= qualifier&#xA;             (and (buffer-file-name buf)&#xA;                (file-name-directory (buffer-file-name buf)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This uses the filter to create filter groups by directory:    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun ibuffer-set-filter-groups-by-directory ()&#xA;    &quot;Set the current filter groups to filter by directory.&quot;&#xA;    (interactive)&#xA;    (setq ibuffer-filter-groups&#xA;          (mapcar (lambda (dir)&#xA;                    (cons (format &quot;%s&quot; dir) `((dirname . ,dir))))&#xA;                  (get-all-buffer-directories)))&#xA;    (ibuffer-update nil t))&#xA;&#xA;  (define-key ibuffer-mode-map&#xA;    (kbd &quot;/ D&quot;) 'ibuffer-set-filter-groups-by-directory)&#xA;  (define-key ibuffer-mode-map&#xA;    (kbd &quot;/ d&quot;) 'ibuffer-filter-by-dirname)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could modify the &lt;code&gt;format&lt;/code&gt; expression to truncate the filter group names.&lt;/p&gt;&#xA;" OwnerUserId="651" LastActivityDate="2015-10-29T17:38:05.170" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17732" PostTypeId="2" ParentId="17724" CreationDate="2015-10-29T17:45:45.157" Score="5" Body="&lt;p&gt;Magit itself did never make the status buffer full screen.  But many&#xA;starter-kits do that and there also exist a few blog posts which&#xA;explain how to do it.  You are probably using such a starter-kit or a&#xA;snippet you found somewhere, and that code stopped working due to&#xA;changes in Magit v2.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These changes are actually intended to make it easier to customize how&#xA;Magit buffers are displayed and switched to, but apparently these&#xA;changes also break some existing kludges which were previously used to&#xA;accomplish the same without any explicit support in Magit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with v2.3 Magit displays all Magit (-mode derived) buffers&#xA;using &lt;code&gt;magit-display-buffer&lt;/code&gt; which in turn calls the function&#xA;specified by the option &lt;code&gt;magit-display-buffer-function&lt;/code&gt;.  The default&#xA;value is &lt;code&gt;magit-display-buffer-traditional&lt;/code&gt; which displays the buffer&#xA;in much the same way as in previous releases.  All the rules which&#xA;control how certain Magit buffers are displayed are now contained in&#xA;this function, previously they were scattered all over the place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can learn more about this in&#xA;&lt;a href=&quot;http://magit.vc/manual/magit/Switching-Buffers.html&quot;&gt;Switching Buffers&lt;/a&gt;&#xA;from the Magit manual and in&#xA;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window.html&quot;&gt;Choosing a Window for Display&lt;/a&gt;&#xA;from the Elisp manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have found a satisfactory solution to make the status buffer&#xA;full screen (which uses &quot;display actions&quot; instead of third party&#xA;packages), then please post that here.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-10-29T17:45:45.157" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17733" PostTypeId="2" ParentId="17689" CreationDate="2015-10-29T17:58:56.990" Score="3" Body="&lt;p&gt;The problem is that the code which makes this happen has not been&#xA;loaded yet.  Maybe that code should be autoloaded, but currently it is&#xA;not.  (Unfortunately one can be fairly sure that if I did start to&#xA;autoload the relevant code, that then someone complains about that.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code which causes &lt;code&gt;git-commit-mode&lt;/code&gt; to be used in buffers&#xA;visiting commit message buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'with-editor-server-window-alist&#xA;             (cons git-commit-filename-regexp 'switch-to-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So all you have to do is to add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize) ; otherwise Emacs doesn't know were to find it&#xA;(setq package-initialize-at-startup nil) ; don't do it again&#xA;&#xA;(global-git-commit-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally you might want to consider using &lt;code&gt;core.editor=emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T00:44:06.013" LastActivityDate="2015-12-30T00:44:06.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17734" PostTypeId="2" ParentId="17124" CreationDate="2015-10-29T18:15:58.803" Score="7" Body="&lt;p&gt;As you have noticed, you can yank the password when Magit is reading&#xA;it in the minibuffer (this works pretty much always when user input is&#xA;read in the minibuffer for whatever purpose).  So the sequence is more&#xA;like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;P&lt;/code&gt; &lt;code&gt;P&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-y&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This might or might not cache the password, depending on various&#xA;settings.  First you need to tell Git to cache the password, which can&#xA;be done using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git config --global credential.helper cache&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, even with that setting, the entered password didn't get&#xA;cached before Magit v2.3.  The problem was that the daemon, which Git&#xA;starts to cache the password, terminates when receiving SIGHUP, and&#xA;that Emacs sends SIGHUP when git finishes.  The daemon cannot (yet) be&#xA;told not to terminate on SIGHUP, and Emacs cannot be told not to send&#xA;SIGHUP - which obviously is a bit of a problem.  Magit v2.3 works&#xA;around this by starting the &lt;code&gt;git credential-cache-daemon&lt;/code&gt; directly,&#xA;before calling e.g. &lt;code&gt;git push&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also new in v2.3 is support for the built-in &lt;code&gt;auth-source&lt;/code&gt; package.&#xA;This allows retrieving the password from any of the sources it supports&#xA;and then forwarding it to Git.  To use this, you have to customize&#xA;&lt;code&gt;magit-process-find-password-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally you might also want to consider using public key authentication.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="5296" LastEditDate="2015-10-29T20:00:49.750" LastActivityDate="2015-10-29T20:00:49.750" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17735" PostTypeId="2" ParentId="17718" CreationDate="2015-10-29T18:49:28.453" Score="0" Body="&lt;p&gt;Probably not related to a certain version: Emacs needs some info WRT coding-system. Fails sometimes with some known OS. Check setting of &lt;code&gt;coding-system-for-read&lt;/code&gt;. Sometimes copy-and-paste into another buffer helps.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-10-29T18:49:28.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17737" PostTypeId="1" AcceptedAnswerId="17738" CreationDate="2015-10-29T19:53:41.670" Score="2" ViewCount="271" Body="&lt;p&gt;When I try to start Emacs I get the following warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;symbol's function definition is void: slime-face-inheritance-possible-p&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This happens most of the time, only sometimes it seems to work. If I remove all installed packages (&lt;code&gt;package.el&lt;/code&gt;) and install them again, then it works fine on the first start, but not on subsequent starts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the packages &lt;code&gt;slime&lt;/code&gt;, &lt;code&gt;slime-repl&lt;/code&gt; and &lt;code&gt;slime-company&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9838" LastActivityDate="2015-10-29T19:53:41.670" Title="symbol's function definition is void: slime-face-inheritance-possible-p" Tags="|slime|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17738" PostTypeId="2" ParentId="17737" CreationDate="2015-10-29T19:53:41.670" Score="3" Body="&lt;p&gt;According to &lt;a href=&quot;https://github.com/slime/slime/commit/2e5538a59881d4767ea4773f1bf7efa9299a2e3a&quot; rel=&quot;nofollow&quot;&gt;commit 2e5538a&lt;/a&gt; the long deprecated function &lt;code&gt;slime-face-inheritance-possible-p&lt;/code&gt; has been removed from &lt;code&gt;slime&lt;/code&gt; in May 2015.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably installed the package &lt;code&gt;slime-repl&lt;/code&gt; via marmalade, where it is currently listed as version &lt;code&gt;20100404&lt;/code&gt;, e.g. being from 2010 and thus very old.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of now (October 2015) the package &lt;code&gt;slime&lt;/code&gt; also contains the &lt;code&gt;slime-repl.el&lt;/code&gt; in the &lt;code&gt;contrib&lt;/code&gt; folder, and thus supports the slime-repl out of the box (after enabling it via &lt;code&gt;slime-contribs&lt;/code&gt;). To solve the issue just remove the obsolete package &lt;code&gt;slime-repl&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9838" LastActivityDate="2015-10-29T19:53:41.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17740" PostTypeId="1" AcceptedAnswerId="17741" CreationDate="2015-10-29T21:12:26.943" Score="0" ViewCount="58" Body="&lt;p&gt;From &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-imagex&quot; rel=&quot;nofollow&quot;&gt;the package imagex&lt;/a&gt;, I use the function &lt;code&gt;imagex-sticky-maximize&lt;/code&gt; to maximize the image files to the current window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works like a charm on Windows 7 x64 with Emacs 25.0.50 However, with the same Emacs setup, I'm trying out Linux Ubuntu. I use the latest Emacs snapshot:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.16.7) of 2015-10-28&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything in Emacs works, except the function &lt;code&gt;imagex-sticky-maximize&lt;/code&gt;. Then I get the error when I want to maximize the image:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;image+: (file-error Searching for program No such file or directory convert) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see the pictures (JPEG, PNG, everything) in Emacs buffer. So image display works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look in the source code of &lt;code&gt;imagex-sticky-maximize&lt;/code&gt; in order to understand why this problem arises on Linux, and not on Windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun imagex-sticky-maximize ()&#xA;&quot;Maximize the point image to fit the current frame.&quot;&#xA;(interactive)&#xA;(imagex-sticky--convert-image&#xA;(lambda (image)&#xA;    (imagex--maximize image))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Given the error message, seems the &lt;code&gt;imagex-sticky--convert-image&lt;/code&gt; could be the culprit. Looking further in the source:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun imagex-sticky--convert-image (converter)&#xA;(catch 'done&#xA;    (let (err)&#xA;    (condition-case err1&#xA;        (let ((display (imagex-sticky--current-ovprop-display)))&#xA;            (when display&#xA;            (cl-destructuring-bind (image ov) display&#xA;                (let ((new (funcall converter image)))&#xA;                (plist-put (cdr new) 'imagex-manual-manipulation t)&#xA;                (overlay-put ov 'display new))&#xA;                (throw 'done t))))&#xA;        (error&#xA;        (setq err (append err err1))))&#xA;    (condition-case err2&#xA;        (let ((display (imagex-sticky--current-textprop-display)))&#xA;            (when display&#xA;            (cl-destructuring-bind (image begin end) display&#xA;                (let ((new (funcall converter image)))&#xA;                (plist-put (cdr new) 'imagex-manual-manipulation t)&#xA;                (imagex--replace-textprop-image begin end new))&#xA;                (throw 'done t))))&#xA;        (error&#xA;        (setq err (append err err2))))&#xA;    (when err&#xA;        (imagex--message &quot;%s&quot; err))&#xA;    (imagex-sticky-fallback this-command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see no possible causes that could suggest why this fails on Linux and works on Windows. Any suggestion?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-10-29T21:29:01.453" LastActivityDate="2015-10-29T22:25:56.937" Title="Why is imagex-sticky-maximize working in Windows, and not in Linux" Tags="|images|image-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17741" PostTypeId="2" ParentId="17740" CreationDate="2015-10-29T22:25:56.937" Score="1" Body="&lt;p&gt;Isn't the error message clear enough?  The package is missing a program called &lt;code&gt;convert&lt;/code&gt; which part of imagemagick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just install imagemagick on your system.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-10-29T22:25:56.937" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17742" PostTypeId="2" ParentId="5354" CreationDate="2015-10-29T22:51:45.357" Score="0" Body="&lt;p&gt;Remove slime-repl and slime-js.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DON't install slime-js from this repo (&lt;a href=&quot;https://github.com/Gozala/slime-js&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Gozala/slime-js&lt;/a&gt;). It's old&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the slime from MELPA. The version will be 2015 Oct.&lt;/li&gt;&#xA;&lt;li&gt;Manually download the slime-js.el from swank-js's repo. &lt;a href=&quot;https://github.com/swank-js/swank-js/blob/master/slime-js.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/swank-js/swank-js/blob/master/slime-js.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Copy slime-js.el to ~/.emacs.d/elpa/slime-20151021.1304/contrib&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You are good to go :)&lt;/p&gt;&#xA;" OwnerUserId="9990" LastActivityDate="2015-10-29T22:51:45.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17743" PostTypeId="2" ParentId="12899" CreationDate="2015-10-30T01:24:29.387" Score="7" Body="&lt;p&gt;It sounds like you should extend &lt;code&gt;tramp-methods&lt;/code&gt;, adding a new method which is similar to the &lt;code&gt;sudo&lt;/code&gt; method but uses &lt;code&gt;qsub -I&lt;/code&gt; instead. You would then be able to use a multi-hop tramp path to first connect to the head node and then to connect to a compute node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-methods&#xA;  '(&quot;qsub&quot;&#xA;    (tramp-login-program        &quot;qsub&quot;)&#xA;    (tramp-login-args           ((&quot;-I&quot;))) ; other options here?&#xA;    ;; Local $SHELL could be a nasty one, like zsh or fish.  Let's override it.&#xA;    (tramp-login-env            ((&quot;SHELL&quot;) (&quot;/bin/sh&quot;)))&#xA;    (tramp-remote-shell         &quot;/bin/sh&quot;)&#xA;    (tramp-remote-shell-args    (&quot;-c&quot;))&#xA;    (tramp-connection-timeout   10)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You would then use a tramp path like &lt;code&gt;/ssh:myserver|qsub:myserver:/path/to/file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may need to specify other options to pass to qsub; I've not used it so I can't help you there. You'll also want to look over the other options you can specify on a tramp method; there are a couple of dozen listed in tramp.el.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-10-30T01:24:29.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17744" PostTypeId="1" AcceptedAnswerId="24141" CreationDate="2015-10-30T07:20:06.953" Score="15" ViewCount="4419" Body="&lt;p&gt;I have an org document with scattered with source blocks that I'd like excluded when I export the file to html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a variable or option I can set which will ignore the src blocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried using the noexport as shown below but the code still appears in the resultant html.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC json :noexport:&#xA;{ ... }&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9992" LastEditorUserId="5385" LastEditDate="2016-06-23T21:41:49.413" LastActivityDate="2016-06-23T21:41:49.413" Title="Is there a way to make Org mode ignore src blocks when exporting to html?" Tags="|org-mode|org-export|org-babel|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17746" PostTypeId="2" ParentId="17700" CreationDate="2015-10-30T09:03:19.870" Score="1" Body="&lt;p&gt;These are hard-coded into the &lt;code&gt;vc-git-annotate-command&lt;/code&gt; function. The following is from 24.5:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun vc-git-annotate-command (file buf &amp;amp;optional rev)&#xA;  (let ((name (file-relative-name file)))&#xA;    (vc-git-command buf 'async nil &quot;blame&quot; &quot;--date=iso&quot; &quot;-C&quot; &quot;-C&quot; rev &quot;--&quot; name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The simplest thing at present is probably to redefine the function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;vc-git&quot;&#xA;  '(defun vc-git-annotate-command (file buf &amp;amp;optional rev)&#xA;     ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; to ask for the command arguments to be abstracted out to a variable, if you conclude there's a good case for this to be configurable.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-10-30T09:03:19.870" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17748" PostTypeId="1" CreationDate="2015-10-30T10:06:36.177" Score="1" ViewCount="381" Body="&lt;p&gt;This is the value of my &lt;code&gt;package-archives&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h v package-archives&#xA;package-archives's value is ((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;                         (&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I do a &lt;code&gt;M-x list-packages&lt;/code&gt; I see package &lt;code&gt;js2-mode&lt;/code&gt; but when I try to install it I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error during download request: Not Found &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also have the following in my &lt;code&gt;.emacs&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (use-package js2-mode&#xA;    :mode &quot;\\.js\\'&quot;&#xA;    :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when I visit a &lt;code&gt;*.js&lt;/code&gt; buffer (with &lt;code&gt;--init-debug&lt;/code&gt;) I get the following trace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Error during download request: Not Found&quot;)                                 &#xA;   signal(error (&quot;Error during download request: Not Found&quot;))                                                     &#xA;   error(&quot;Error during download request:%s&quot; &quot; Not Found&quot;)                                                         &#xA;  package-handle-response()                                                                                      &#xA;  package-download-tar(js2-mode &quot;20151027.456&quot;)                                                                  &#xA;  package-download-transaction((js2-mode))                                                                       &#xA;  package-install(js2-mode)                                                                                      &#xA;  use-package-ensure-elpa(js2-mode)                                                                              &#xA;  use-package-handler/:ensure(js2-mode :ensure t (:mode ((&quot;\\.js\\'&quot; . js2-mode)) :config (t) :defer t) nil)     &#xA;  use-package-process-keywords(js2-mode (:ensure t :mode ((&quot;\\.js\\'&quot; . js2-mode)) :config (t) :defer t))        &#xA;  #[(name &amp;amp;rest args) &quot;\306^H\235?\205\317^@    ;\203^R^@\307   !\202^S^@       ^Z\310  ^H\&quot;\311\312^[^\^]\313^M$&#xA;  (use-package js2-mode :mode &quot;\\.js\\'&quot; :ensure t)                                                              &#xA;  (progn (require (quote package)) (setq package-enable-at-startup nil) (mapc (function (lambda (p) (add-to-list$&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/mperdikeas/.emacs&quot; nil t)  ; Reading at buffer position 25263         &#xA;  load-with-code-conversion(&quot;/home/mperdikeas/.emacs&quot; &quot;/home/mperdikeas/.emacs&quot; t t)                             &#xA;  load(&quot;~/.emacs&quot; t t)                                                                                           &#xA;  #[0 &quot;^H\205\262^@     \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\$&#xA;  command-line()                                                                                                 &#xA;  normal-top-level()       &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/a/17761/4003&quot;&gt;my &quot;answer&quot;&lt;/a&gt; below.&lt;/p&gt;&#xA;" OwnerUserId="4003" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-10-30T16:46:26.657" Title="package listed in `list-packages' but get `Error during download request: Not Found`" Tags="|package-repositories|use-package|js2-mode|" AnswerCount="2" CommentCount="2" ClosedDate="2015-10-31T12:54:53.773" ContentLicense="CC BY-SA 3.0" />
  <row Id="17749" PostTypeId="1" CreationDate="2015-10-30T10:17:35.337" Score="6" ViewCount="1887" Body="&lt;p&gt;I put the following in the beginning of the Org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;* :noexport:&#xA;Local Variables:&#xA;ispell-local-dictionary: &quot;american&quot;&#xA;End:&#xA;#+EXPORT_EXCLUDE_TAGS: noexport&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I start flyspell via a hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook 'turn-on-flyspell)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But Ispell always uses the default dictionary instead of the american.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried Org's language tag, but it does not seem to have any effect on Flyspell.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE:  en&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to define the Ispell language in the Org file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I set the variable from within a &lt;code&gt;:noexport:&lt;/code&gt; taged heading the variable will not be set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* :noexport:&#xA;-*- ispell-local-dictionary: &quot;american&quot; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I set the variable before the &lt;code&gt;:noexport:&lt;/code&gt; tag the variable gets set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- ispell-local-dictionary: &quot;american&quot; -*-&#xA;* :noexport:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this the intended behavior? And if so, how can I change it?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="8979" LastEditDate="2015-11-01T22:44:23.973" LastActivityDate="2015-11-01T22:44:23.973" Title="How to set the Ispell language via a file variable in Org-Mode?" Tags="|org-mode|file-local-variables|ispell|flyspell|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17750" PostTypeId="2" ParentId="17744" CreationDate="2015-10-30T10:33:17.803" Score="10" Body="&lt;p&gt;Based on section &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html#Advanced-configuration&quot; rel=&quot;noreferrer&quot;&gt;12.15&lt;/a&gt; of org documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-html-filter-src-blocks (text backend info)&#xA;  &quot;Remove source blocks from html export.&quot;&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    &quot;[removed source block]&quot;))&#xA;&#xA;(add-to-list 'org-export-filter-src-block-functions&#xA;         'my-html-filter-src-blocks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace &quot;[removed source block]&quot; with an empty string of course!&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-10-30T10:33:17.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17751" PostTypeId="2" ParentId="17748" CreationDate="2015-10-30T10:40:39.003" Score="3" Body="&lt;p&gt;TL;DR: &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; and try again :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs tells you that a package was not found on the remote archive.  This is a symptom of an outdated local package archive cache: Your Emacs tries to fetch an outdated version of a package which does not exist on the server anymore because a never package is already available.  You can refresh the local cache with &lt;code&gt;M-x package-refresh-contents&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is specifically an issue with MELPA, because unlike GNU ELPA it does not keep a backlog of older releases: Every update of a package deletes all older releases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence you really need to make sure that your package archive cache is update if you are using MELPA.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-10-30T10:40:39.003" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17752" PostTypeId="1" AcceptedAnswerId="17759" CreationDate="2015-10-30T11:12:11.673" Score="3" ViewCount="186" Body="&lt;p&gt;I am trying to compare two log files, side by side in two emacs buffers. The logfiles are similar in context, but some have extra debug inserted. This makes simple use of pgup/pgdown painful as things get out of alignment between the two buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'd like to do is scroll by context, and although I don't expect emacs to know the context, I'd like to find the relevant line in the left and right buffers and then scroll both buffers such that that line appears at the top of the window in both buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this achievable?&lt;/p&gt;&#xA;" OwnerUserId="2453" LastEditorUserId="253" LastEditDate="2015-10-30T12:44:05.473" LastActivityDate="2015-10-30T15:39:59.020" Title="More useful vertical scrolling in emacs" Tags="|scrolling|align|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17753" PostTypeId="1" AcceptedAnswerId="21003" CreationDate="2015-10-30T11:41:57.617" Score="4" ViewCount="601" Body="&lt;p&gt;If I use tramp to open a remote file, and subsequently run &lt;code&gt;run-python&lt;/code&gt;, it tries to execute in the remote context (which is not what I want and super slow).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any way of specifying a local context or disabling this behaviour?&lt;/p&gt;&#xA;" OwnerUserId="9779" LastEditorUserId="2706" LastEditDate="2016-03-16T21:59:31.517" LastActivityDate="2021-01-19T23:42:15.447" Title="Make run-python etc. use local python" Tags="|python|tramp|inferior-buffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17754" PostTypeId="1" AcceptedAnswerId="17763" CreationDate="2015-10-30T12:04:48.050" Score="1" ViewCount="1287" Body="&lt;p&gt;when typing in some &lt;code&gt;projectile&lt;/code&gt; filter string for instance (eg &lt;code&gt;SPC p f&lt;/code&gt;) in &lt;code&gt;spacemacs&lt;/code&gt;, I often would like to reuse the word under the cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;code&gt;C-y&lt;/code&gt; to paste. Which is the one to insert the word under the cursor? I stumbled on &lt;code&gt;C-w&lt;/code&gt; but it's not that. And why does &lt;code&gt;C-w&lt;/code&gt; does by the way??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(btw if there is something more &lt;code&gt;spacemacs&lt;/code&gt;-y I'm interested)&lt;/p&gt;&#xA;" OwnerUserId="2592" LastEditorUserId="3889" LastEditDate="2015-10-31T08:04:52.077" LastActivityDate="2020-08-24T08:52:43.427" Title="insert word under cursor in projectile search" Tags="|key-bindings|helm|spacemacs|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17756" PostTypeId="1" AcceptedAnswerId="17757" CreationDate="2015-10-30T13:37:04.033" Score="2" ViewCount="193" Body="&lt;p&gt;In 1.x magit I often would rebase my local branch to master, the equivalent of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git checkout master&#xA;git pull --rebase&#xA;git checkout dev-feature-1&#xA;git rebase --interactive master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In 1.x magit this was super fast and simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;b b master&#xA;F F&#xA;b b dev-feature-1&#xA;E&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In 2.x magit it seems like this &quot;rebase to another branch&quot; functionality is gone, or very difficult to find? I read through the magit doc section on rebasing and it seems to assume the only place to rebase to is your currently set upstream. I don't want my upstream to change, it should remain origin/dev-feature-1, I just need to rebase -i against master to get my branch up-to-date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has this functionality been removed from magit, or is it called something else now? Maybe there are just more steps that make this formerly simple/frequent operation more complex and slow? Or maybe I'm just missing how to do it in my quick read of the docs?&lt;/p&gt;&#xA;" OwnerUserId="9831" LastActivityDate="2016-03-31T00:01:40.793" Title="How can magit 2.x &quot;git rebase --interactive master&quot; from my branch dev-feature-1?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17757" PostTypeId="2" ParentId="17756" CreationDate="2015-10-30T13:47:07.457" Score="2" Body="&lt;p&gt;Press &lt;kbd&gt;r&lt;/kbd&gt; &lt;kbd&gt;r&lt;/kbd&gt;. Now you are asked what branch you want to rebase to. Instead of just pressing &lt;kbd&gt;RET&lt;/kbd&gt; without reading the prompt (which would cause the default to be used, i.e. the upstream branch) instead select/type the branch you actually want to rebase to and &lt;em&gt;then&lt;/em&gt; press &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: Starting with &lt;code&gt;v2.4&lt;/code&gt; the &lt;kbd&gt;r&lt;/kbd&gt; &lt;kbd&gt;r&lt;/kbd&gt; binding has been replaced with three new bindings. &lt;kbd&gt;r&lt;/kbd&gt; &lt;kbd&gt;p&lt;/kbd&gt; rebases onto the configured push-remote, &lt;kbd&gt;r&lt;/kbd&gt; &lt;kbd&gt;u&lt;/kbd&gt; onto the configured upstream, and &lt;kbd&gt;r&lt;/kbd&gt; &lt;kbd&gt;e&lt;/kbd&gt; onto any other branch.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="2506" LastEditDate="2016-03-31T00:01:40.793" LastActivityDate="2016-03-31T00:01:40.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17759" PostTypeId="2" ParentId="17752" CreationDate="2015-10-30T15:39:59.020" Score="2" Body="&lt;p&gt;You can :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;go to the right relevant line (with isearch C-s 'pattern') and do C-l (recenter-top-bottom) 2 times.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;go to the left relevant line (same iseach C-s C-s) and do C-l 2 times.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;the two buffers will be align.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cursor will be at top position if &lt;code&gt;scroll-margin == 0&lt;/code&gt; (default value).&#xA;if not,  add &lt;code&gt;(setq scroll-margin 0)&lt;/code&gt; to your .emacs&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-10-30T15:39:59.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17760" PostTypeId="1" AcceptedAnswerId="19244" CreationDate="2015-10-30T16:38:48.890" Score="11" ViewCount="106" Body="&lt;p&gt;I have a package for interacting with GRASS GIS processes, available on MELPA. The rate of development and number of users are both quite low, so there's no need for a mailing list or any formal communications with my users.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I've just introduced some changes to the configuration options that will require some attention from my users - how can I communicate this to them, given that for most of them all they will see is the updated package coming in from MELPA? Is there a way to pass a message on to users that they will see the first time they run code after a certain change has been made? What is best-practice in this regard?&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-01-04T04:07:14.960" Title="How to communicate package changes to repository users?" Tags="|package-development|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17761" PostTypeId="2" ParentId="17748" CreationDate="2015-10-30T16:45:13.523" Score="0" Body="&lt;p&gt;Without changing anything, after a couple of hours it started working again. Some network vagary I suppose.&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-10-30T16:45:13.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17762" PostTypeId="2" ParentId="17463" CreationDate="2015-10-30T17:19:00.190" Score="0" Body="&lt;p&gt;I was finally able to display whitespace, by using &lt;code&gt;customize-set-variable&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x&lt;/code&gt; and then &lt;code&gt;customize-set-variable&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Search for the variable &lt;code&gt;show-trailing-whitespace&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Change it's value to &lt;strong&gt;on&lt;/strong&gt; by toggling it's state.&lt;/li&gt;&#xA;&lt;li&gt;Change the &lt;em&gt;State&lt;/em&gt; to *SAVED and set*.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I will further update the answer as and when I figure out the solutions to (2) and (3).&lt;/p&gt;&#xA;" OwnerUserId="6802" LastActivityDate="2015-10-30T17:19:00.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17763" PostTypeId="2" ParentId="17754" CreationDate="2015-10-30T18:33:19.213" Score="5" Body="&lt;p&gt;If you're using Helm (which I believe is the default in Spacemacs), you can insert the word at the point with &lt;code&gt;M-n&lt;/code&gt; or &lt;code&gt;C-w&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki#yanking-text&quot; rel=&quot;nofollow noreferrer&quot;&gt;Helm Wiki&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;To yank the symbol at point from &lt;code&gt;helm-current-buffer&lt;/code&gt; (i.e. buffer where a helm command originated):&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M-n&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Alternatively, customize &lt;code&gt;helm-yank-symbol-first&lt;/code&gt; to enable&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;C-w&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;to always yank the whole symbol on first invocation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-10-30T18:33:19.213" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17764" PostTypeId="2" ParentId="17754" CreationDate="2015-10-31T05:03:15.060" Score="4" Body="&lt;p&gt;Below is some commands that operate text between current buffer and minibuffer in helm: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-w&lt;/kbd&gt; (&lt;code&gt;helm-yank-text-at-point&lt;/code&gt;) Append the next word at point into minibuffer, like &lt;code&gt;isearch&lt;/code&gt;'s &lt;kbd&gt;C-w&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-n&lt;/kbd&gt; (&lt;code&gt;next-history-element&lt;/code&gt;) Move through the “future history” list (see manual &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-History.html&quot; rel=&quot;nofollow&quot;&gt;Minibuffer History&lt;/a&gt;, the first element of it is the symbol at point in the beginning)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c C-y&lt;/kbd&gt; (&lt;code&gt;helm-yank-selection&lt;/code&gt;) Set minibuffer contents to helm selection&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c C-k&lt;/kbd&gt; (&lt;code&gt;helm-kill-selection-and-quit&lt;/code&gt;) Save helm selection to kill-ring and quit helm&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c C-i&lt;/kbd&gt; (&lt;code&gt;helm-copy-to-buffer&lt;/code&gt;) Insert helm selection into the current buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;kbd&gt;C-w&lt;/kbd&gt; to insert from the beginning of word, not the cursor's position, you can try the following hack:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-yank-text-at-point--move-to-beginning (orig-func &amp;amp;rest args)&#xA;  &quot;Initialize `helm-yank-point' to the beginning of word at point.&quot;&#xA;  (unless helm-yank-point&#xA;    (setq helm-yank-point&#xA;          (with-helm-current-buffer&#xA;            (save-excursion&#xA;              (let ((fwd-fn (or helm-yank-text-at-point-function #'forward-word)))&#xA;                (funcall fwd-fn -1))&#xA;              (point)))))&#xA;  (apply orig-func args))&#xA;&#xA;(advice-add 'helm-yank-text-at-point :around&#xA;            #'helm-yank-text-at-point--move-to-beginning)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-10-31T08:17:04.050" LastActivityDate="2015-10-31T08:17:04.050" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17765" PostTypeId="1" AcceptedAnswerId="18834" CreationDate="2015-10-31T08:16:59.830" Score="1" ViewCount="168" Body="&lt;p&gt;Suppose that I have 3 types of tables in an org file, A latex table, an org-table, and a html-table. How can we to export these table as html tables when org-exporting to html?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# #+BEGIN_LaTeX&#xA;# \begin{table}&#xA;# \begin{center}&#xA;# \begin{tabular}{l c }&#xA;# \hline&#xA;#       &amp;amp; Model 1 \\&#xA;# \hline&#xA;# (Intercept) &amp;amp; $0.06$       \\&#xA;#       &amp;amp; $(0.10)$     \\&#xA;# x           &amp;amp; $1.02^{***}$ \\&#xA;#       &amp;amp; $(0.10)$     \\&#xA;# \hline&#xA;# R$^2$       &amp;amp; 0.53         \\&#xA;# Adj. R$^2$  &amp;amp; 0.53         \\&#xA;# Num. obs.   &amp;amp; 100          \\&#xA;# RMSE        &amp;amp; 1.05         \\&#xA;# \hline&#xA;# \multicolumn{2}{l}{\scriptsize{$^{***}p&amp;lt;0.001$, $^{**}p&amp;lt;0.01$, $^*p&amp;lt;0.05$}}&#xA;# \end{tabular}&#xA;# \caption{Statistical models}&#xA;# \label{table:coefficients}&#xA;# \end{center}&#xA;# \end{table}&#xA;# #+END_LaTeX&#xA;&#xA;&#xA;&#xA;|-----------+-----|&#xA;| groceries | qty |&#xA;|-----------+-----|&#xA;| apple     |   1 |&#xA;| banana    |   5 |&#xA;|-----------+-----|&#xA;&#xA;&#xA;&#xA;&#xA;#+BEGIN_HTML&#xA;&amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&amp;gt;&#xA;&amp;lt;table cellspacing=&quot;0&quot; align=&quot;center&quot; style=&quot;border: none;&quot;&amp;gt;&#xA;&amp;lt;caption align=&quot;bottom&quot; style=&quot;margin-top:0.3em;&quot;&amp;gt;Statistical models&amp;lt;/caption&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;th style=&quot;text-align: left; border-top: 2px solid black; border-bottom: 1px solid black; padding-right: 12px;&quot;&amp;gt;&amp;lt;/th&amp;gt;&#xA;&amp;lt;th style=&quot;text-align: left; border-top: 2px solid black; border-bottom: 1px solid black; padding-right: 12px;&quot;&amp;gt;&amp;lt;b&amp;gt;Model 1&amp;lt;/b&amp;gt;&amp;lt;/th&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;(Intercept)&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;-0.10&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;(0.11)&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;x&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;1.33&amp;lt;sup style=&quot;vertical-align: 0px;&quot;&amp;gt;***&amp;lt;/sup&amp;gt;&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;(0.11)&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;border-top: 1px solid black;&quot;&amp;gt;R&amp;lt;sup style=&quot;vertical-align: 0px;&quot;&amp;gt;2&amp;lt;/sup&amp;gt;&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;border-top: 1px solid black;&quot;&amp;gt;0.60&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;Adj. R&amp;lt;sup style=&quot;vertical-align: 0px;&quot;&amp;gt;2&amp;lt;/sup&amp;gt;&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;0.59&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;Num. obs.&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot;&amp;gt;100&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;border-bottom: 2px solid black;&quot;&amp;gt;RMSE&amp;lt;/td&amp;gt;&#xA;&amp;lt;td style=&quot;border-bottom: 2px solid black;&quot;&amp;gt;1.07&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td style=&quot;padding-right: 12px; border: none;&quot; colspan=&quot;2&quot;&amp;gt;&amp;lt;span style=&quot;font-size:0.8em&quot;&amp;gt;&amp;lt;sup style=&quot;vertical-align: 0px;&quot;&amp;gt;***&amp;lt;/sup&amp;gt;p &amp;amp;lt; 0.001, &amp;lt;sup style=&quot;vertical-align: 0px;&quot;&amp;gt;**&amp;lt;/sup&amp;gt;p &amp;amp;lt; 0.01, &amp;lt;sup style=&quot;vertical-align: 0px;&quot;&amp;gt;*&amp;lt;/sup&amp;gt;p &amp;amp;lt; 0.05&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;/table&amp;gt;&#xA;#+END_HTML&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="9340" LastEditDate="2015-10-31T11:14:17.710" LastActivityDate="2015-12-13T13:57:57.607" Title="How can we convert a range of table types (latex,org) to html when org-exporting to html?" Tags="|org-mode|org-export|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17766" PostTypeId="2" ParentId="5807" CreationDate="2015-10-31T09:46:31.180" Score="1" Body="&lt;p&gt;I've been using &lt;a href=&quot;https://github.com/ecukes/ecukes&quot; rel=&quot;nofollow&quot;&gt;ecukes&lt;/a&gt; to write these sorts of tests and it's &lt;em&gt;brilliant&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test cases look like &lt;a href=&quot;https://github.com/davidshepherd7/electric-operator/blob/master/features/python-mode.feature&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  # Check *args works ok&#xA;  Scenario: Space *args on its own&#xA;    When I type &quot;f(*args)&quot;&#xA;    Then I should see &quot;f(*args)&quot;&#xA;&#xA;  Scenario: Space *args with other args&#xA;    When I type &quot;f(a,*args)&quot;&#xA;    Then I should see &quot;f(a, *args)&quot;&#xA;&#xA;  # And **kwargs&#xA;  Scenario: Space **kwargs on its own&#xA;    When I type &quot;f(**kwargs)&quot;&#xA;    Then I should see &quot;f(**kwargs)&quot;&#xA;&#xA;  Scenario: Space **kwargs with other args&#xA;    When I type &quot;f(a,**kwargs)&quot;&#xA;    Then I should see &quot;f(a, **kwargs)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can add more details on setting it up if needed, or you can look at the project I linked (the &lt;code&gt;Cask&lt;/code&gt; file and the &lt;code&gt;features&lt;/code&gt; directory are relevant to ecukes). &lt;/p&gt;&#xA;" OwnerUserId="237" LastActivityDate="2015-10-31T09:46:31.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17769" PostTypeId="2" ParentId="5807" CreationDate="2015-10-31T14:19:31.727" Score="2" Body="&lt;p&gt;First, the idea is great, you should write this kind of test cases for your packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to do this is to insert a suitable content into a temporary buffer, add suitable keys to the input queue, break into recursive edit, and let nature have its course. This way, things like post-command hooks are executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-upcase-interactively ()&#xA;  (let ((unread-command-events&#xA;         (append&#xA;          (kbd &quot;M-u&quot;)&#xA;          ;; Remove the following line to stay in recursive edit.&#xA;          (kbd &quot;C-M-c&quot;)          ; Exit recursive edit.&#xA;          unread-command-events)))&#xA;    (with-temp-buffer&#xA;      (save-excursion&#xA;        (insert &quot;words&quot;))&#xA;      (save-window-excursion&#xA;        (select-window (display-buffer (current-buffer)))&#xA;        (recursive-edit))&#xA;      (buffer-substring (point-min) (point-max)))))&#xA;&#xA;&#xA;&#xA;(ert-deftest my-test ()&#xA;  (should (equal (test-upcase-interactively)&#xA;           &quot;WORDS&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, it's overkill to use the recursive edit trick for something like &lt;code&gt;upcase-word&lt;/code&gt;, as it doesn't rely on pre- and post-commands.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-10-31T14:54:12.743" LastActivityDate="2015-10-31T14:54:12.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17770" PostTypeId="1" AcceptedAnswerId="17775" CreationDate="2015-10-31T16:22:52.333" Score="3" ViewCount="828" Body="&lt;p&gt;I'm using &lt;code&gt;org-indent-mode&lt;/code&gt;. As far as I understand, the whitespace on the left is an overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UO8dD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UO8dD.png&quot; alt=&quot;org-indent-mode overlay&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use this mode in conjunction with &lt;code&gt;whitespace-mode&lt;/code&gt;, then there appears whitespace indications (dots) in the org-mode overlay on the left.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/v7geE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/v7geE.png&quot; alt=&quot;[&quot;&gt;&lt;/a&gt;2]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to get rid of it? Specifically, how to get rid of the whitespace markings in the &lt;code&gt;org-mode-indent&lt;/code&gt;'s overlay?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might ask yourself, white not remove the whitespace-mode? It's useful in marking the whitepaces in the buffer itself. Like... well I use it quite successfully, I just want to remove it from the damn overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. All of this is in emacs vanilla, no other programs than the one's packages by GNU.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The version is: 24.5.1&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="105" LastEditDate="2015-10-31T18:42:54.743" LastActivityDate="2015-11-30T19:24:29.103" Title="Whitespace mode write dots for space chars" Tags="|whitespace-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17771" PostTypeId="1" AcceptedAnswerId="17772" CreationDate="2015-10-31T16:50:53.953" Score="2" ViewCount="191" Body="&lt;p&gt;I want to be able to automatically insert pre-defined strings when pressing a certain keybinding. Currently this is being done with the following code snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;;; Personal keybindings                                                &#xA;(global-set-key [f6] &quot;\autocite[--]{}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is, that this does not work (the one in the example). Instead, &#xA;Emacs will tell me &quot;After 0 kbd macro iterations: Quit&quot; which does not show up, when just doing the string without the &quot;\&quot;. So how could I fix this and enter pre-defined strings which include special character such as &quot;\&quot;?&lt;/p&gt;&#xA;" OwnerUserId="8824" LastEditorUserId="105" LastEditDate="2015-10-31T18:36:49.777" LastActivityDate="2015-10-31T18:36:49.777" Title="Use special character in emacs init file with &quot;global-set-key&quot;" Tags="|key-bindings|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17772" PostTypeId="2" ParentId="17771" CreationDate="2015-10-31T16:59:19.180" Score="3" Body="&lt;p&gt;You need to double backslashes within strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [f6] &quot;\\autocite[--]{}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A more reliable binding uses the &lt;code&gt;insert&lt;/code&gt; function explicitly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [f6] #'(lambda ()&#xA;                         (interactive)&#xA;                         (insert &quot;\\autocite[--]{}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and you'll probably want to move point within the braces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [f6] #'(lambda ()&#xA;                         (interactive)&#xA;                         (insert &quot;\\autocite[--]{}&quot;)&#xA;                         (forward-char -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2015-10-31T16:59:19.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17773" PostTypeId="1" AcceptedAnswerId="17774" CreationDate="2015-10-31T18:32:26.713" Score="0" ViewCount="41" Body="&lt;p&gt;I'm trying to, in a buffer, insert some text, then play a sound. Sample code is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn (insert &quot;this won't be inserted until after the sound&quot;)&#xA;       (play-sound '(sound :file &quot;/home/zck/Documents/countdown.el/Ovation-Mike_Koenig-1061486511.wav&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put the path to a wav file in the argument to &lt;code&gt;play-sound&lt;/code&gt;. I've tried multiple files, but &lt;a href=&quot;http://soundbible.com/1647-Ovation.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; is the one I'm using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is that I hear the sound, &lt;em&gt;then&lt;/em&gt; the text is inserted. How can I invert that?&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-10-31T18:32:26.713" Title="If I insert text before playing a sound, why do I not see the text inserted until the sound finishes?" Tags="|display|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17774" PostTypeId="2" ParentId="17773" CreationDate="2015-10-31T18:32:26.713" Score="2" Body="&lt;p&gt;Emacs normally doesn't render the screen until it's waiting for input. From the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Forcing-Redisplay.html#Forcing-Redisplay&quot; rel=&quot;nofollow&quot;&gt;Emacs redisplay documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs normally tries to redisplay the screen whenever it waits for input.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;play-sound&lt;/code&gt; blocks, Emacs doesn't wait for input until the sound ends, so it won't render the screen with the inserted text until &lt;code&gt;play-sound&lt;/code&gt; returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we don't want to wait for input between inserting the text and playing the sound, we can explicitly call &lt;code&gt;redisplay&lt;/code&gt; to force Emacs to redraw the screen.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn (insert &quot;this won't be inserted until after the sound&quot;)&#xA;       (redisplay)&#xA;       (play-sound '(sound :file &quot;/home/zck/Documents/countdown.el/Ovation-Mike_Koenig-1061486511.wav&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the desired behavior of seeing the text inserted before the sound starts.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-10-31T18:32:26.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17775" PostTypeId="2" ParentId="17770" CreationDate="2015-10-31T18:39:11.093" Score="2" Body="&lt;p&gt;Customize option &lt;code&gt;whitespace-display-mappings&lt;/code&gt;, to get rid of this entry:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(space-mark   ?\     [?\u00B7]     [?.])        ; space - centered dot&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That maps a &lt;code&gt;SPC&lt;/code&gt; char to a centered dot.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-option RET whitespace-display-mappings RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the entry to remove or change, in the Customize UI:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ryBjX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ryBjX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can just click the first &lt;code&gt;DEL&lt;/code&gt; to remove it, if you do not want &lt;code&gt;SPC&lt;/code&gt; chars mapped to other chars.  (Save your changes when done.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-10-31T18:47:52.090" LastActivityDate="2015-10-31T18:47:52.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17776" PostTypeId="1" CreationDate="2015-10-31T18:47:13.957" Score="2" ViewCount="477" Body="&lt;p&gt;I want my &lt;code&gt;init.el&lt;/code&gt; file to get the latest version of &lt;code&gt;org&lt;/code&gt; from orgmode.org before loading my &lt;code&gt;pretty-init.org&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives&#xA;             '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  (add-to-list 'package-archives&#xA;               '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize)&#xA;&#xA;(when (boundp 'package-pinned-packages)&#xA;  (setq package-pinned-packages&#xA;        '((org . &quot;org&quot;))))&#xA;&#xA;;; I don't want the version hardcoded here, but without it&#xA;;; package-installed-p will find the built-in org package&#xA;(unless (package-installed-p 'org '20151005)&#xA;  (package-install 'org))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run this I get the error &lt;code&gt;(wrong-type-argument arrayp org)&lt;/code&gt; on the call &lt;code&gt;(package-install 'org)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it has something to do with the existence of the built-in &lt;code&gt;org&lt;/code&gt; package because if I run &lt;code&gt;(package-install 'nlinum)&lt;/code&gt; when &lt;code&gt;nlinum&lt;/code&gt; is installed already, I get the same error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running the latest build of &lt;a href=&quot;http://sourceforge.net/projects/emacsbinw64/&quot; rel=&quot;nofollow&quot;&gt;emacsbinw64&lt;/a&gt; and I can install the newest &lt;code&gt;org&lt;/code&gt; package if I use &lt;code&gt;M-x list-packages&lt;/code&gt; (though it doesn't work through &lt;code&gt;M-x package-install&lt;/code&gt; because it doesn't show up in the completion list).&lt;/p&gt;&#xA;" OwnerUserId="10006" LastActivityDate="2015-10-31T18:47:13.957" Title="How can I ensure that Org-Mode is Up-To-Date in init.el?" Tags="|org-mode|package|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17779" PostTypeId="1" CreationDate="2015-10-31T23:16:41.607" Score="2" ViewCount="39" Body="&lt;p&gt;What is the preferred method of reverting a partially applied set of operations within a function?  For example in a function that kills some text, performs some intervening operations, and then yanks the earlier killed text-- if one of those intervening operations throws an error the originally killed text should be restored by the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there are any generalized solutions like SQL transactions for this?    I know Emacs has a powerful undo system, but I have not used it programmatically.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2016-08-22T22:00:31.570" LastActivityDate="2016-08-22T22:00:31.570" Title="Reverting an incomplete set of operations" Tags="|undo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17780" PostTypeId="2" ParentId="17779" CreationDate="2015-11-01T06:29:49.707" Score="1" Body="&lt;p&gt;Sounds like you are looking for &lt;code&gt;unwind-protect&lt;/code&gt; or &lt;code&gt;condition-case&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former is for doing cleanup unconditionally. The latter is for handling errors - in general or of specific types.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;unwind-protect&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;unwind-protect is a special form in `C source code'.&#xA;&#xA;(unwind-protect BODYFORM UNWINDFORMS...)&#xA;&#xA;Do BODYFORM, protecting with UNWINDFORMS.&#xA;If BODYFORM completes normally, its value is returned&#xA;after executing the UNWINDFORMS.&#xA;If BODYFORM exits nonlocally, the UNWINDFORMS are executed anyway.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Cleanups.html&quot; rel=&quot;nofollow&quot;&gt;Cleanups&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;condition-case&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;condition-case is a special form in `C source code'.&#xA;&#xA;  (condition-case VAR BODYFORM &amp;amp;rest HANDLERS)&#xA;&#xA;Regain control when an error is signaled.&#xA;Executes BODYFORM and returns its value if no error happens.&#xA;Each element of HANDLERS looks like (CONDITION-NAME BODY...)&#xA;where the BODY is made of Lisp expressions.&#xA;&#xA;A handler is applicable to an error&#xA;if CONDITION-NAME is one of the error's condition names.&#xA;If an error happens, the first applicable handler is run.&#xA;&#xA;The car of a handler may be a list of condition names instead of a&#xA;single condition name; then it handles all of them.  If the special&#xA;condition name `debug' is present in this list, it allows another&#xA;condition in the list to run the debugger if `debug-on-error' and the&#xA;other usual mechanisms says it should (otherwise, `condition-case'&#xA;suppresses the debugger).&#xA;&#xA;When a handler handles an error, control returns to the `condition-case'&#xA;and it executes the handler's BODY...&#xA;with VAR bound to (ERROR-SYMBOL . SIGNAL-DATA) from the error.&#xA;(If VAR is nil, the handler can't access that information.)&#xA;Then the value of the last BODY form is returned from the `condition-case'&#xA;expression.&#xA;&#xA;See also the function `signal' for more info.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html&quot; rel=&quot;nofollow&quot;&gt;Handling Errors&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-01T06:38:24.887" LastActivityDate="2015-11-01T06:38:24.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17781" PostTypeId="5" CreationDate="2015-11-01T10:58:33.440" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-11-01T10:58:33.440" LastActivityDate="2015-11-01T10:58:33.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17782" PostTypeId="4" CreationDate="2015-11-01T10:58:33.440" Score="0" Body="About starting and initializing an Emacs session" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2015-11-01T16:23:10.353" LastActivityDate="2015-11-01T16:23:10.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17783" PostTypeId="1" CreationDate="2015-11-01T10:58:45.683" Score="14" ViewCount="6341" Body="&lt;p&gt;Configuration:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;One system&lt;/li&gt;&#xA;&lt;li&gt;OS Windows 10 as dual boot&lt;/li&gt;&#xA;&lt;li&gt;OS Ubuntu 15.10 as dual boot&lt;/li&gt;&#xA;&lt;li&gt;Emacs 25.0.1 with GUI&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have one &lt;code&gt;dot-emacs&lt;/code&gt; file and everything in my &lt;code&gt;.emacs.d&lt;/code&gt; folder (the packages also are located in &lt;code&gt;.emacs.d&lt;/code&gt;). All of these files are located in one Dropbox folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Windows 10:&#xA;I symlinked the &lt;code&gt;dot-emacs&lt;/code&gt; and &lt;code&gt;.emacs.d&lt;/code&gt; from the home folder in Windows to the locations in Dropbox. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Linux/Ubuntu 15.10:&#xA;I have also symlinked the &lt;code&gt;dot-emacs&lt;/code&gt; and &lt;code&gt;.emacs.d&lt;/code&gt; from my Ubuntu home folder (/home/user/ to the locations in Dropbox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So all files related to Emacs, are stored in one Dropbox folder across various operation systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows and Linux are running as dual boot on same disk, so also same hardware.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start Emacs on Windows, it takes &lt;strong&gt;7.4&lt;/strong&gt; seconds to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I start Emacs on Linux, it takes only &lt;strong&gt;2.3&lt;/strong&gt; seconds to start. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is both with the Emacs with graphical GUI and version 25.0.1. Both operating systems are located on same computer on same SSD drive. So it's also the same hardware. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following things are identical on the operating system (Windows 10 and Ubuntu 15.10):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs software, version 25.0.1&lt;/li&gt;&#xA;&lt;li&gt;Configuration files (.emacs.d)&lt;/li&gt;&#xA;&lt;li&gt;One harddisk (all files inside `.emacs.d) and both OS'es are on same SSD).&lt;/li&gt;&#xA;&lt;li&gt;Hardware&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One difference:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compiled Emacs for Windows or Linux  is running on Windows or Linux platform respectively. That's the only difference.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm struggling to understand why Emacs have noticeably shorter startup time on Ubuntu than Windows.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2019-11-12T22:18:10.777" LastActivityDate="2019-11-12T22:18:10.777" Title="Why does Emacs take longer to start on Windows than on Linux?" Tags="|start-up|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="17784" PostTypeId="1" CreationDate="2015-11-01T11:39:44.700" Score="3" ViewCount="223" Body="&lt;p&gt;I found old mail in my mailbox:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date: 2010-09-13 17:41:21+0300 Mon&#xA;(require 'session)&#xA;(add-hook 'after-init-hook 'session-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I am using &lt;code&gt;desktop&lt;/code&gt; mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq desktop-base-file-name &quot;.emacs.desktop&quot;)&#xA;(setq desktop-base-lock-name &quot;.emacs.desktop.lock&quot;)&#xA;(when (eq system-type 'cygwin)&#xA;  (setq desktop-base-file-name &quot;.emacs.desktop-cygwin&quot;)&#xA;  (setq desktop-base-lock-name &quot;.emacs.desktop-cygwin.lock&quot;)&#xA;  )&#xA;(setq desktop-dirname user-emacs-directory)&#xA;&#xA;(when (&amp;gt;= emacs-major-version 22)&#xA;  (require 'desktop)&#xA;  (add-to-list 'desktop-path desktop-dirname)&#xA;  (setq desktop-restore-frames nil)&#xA;  (desktop-save-mode 1)&#xA;  (setq&#xA;   desktop-globals-to-save&#xA;   (append&#xA;    '((file-name-history . 100)&#xA;      (compile-history . 100)&#xA;      (command-history . 100)&#xA;      (extended-command-history . 100)&#xA;      (shell-command-history . 100)&#xA;      (query-replace-history . 100)&#xA;      (regexp-history . 100)&#xA;      (grep-history . 100)&#xA;      (minibuffer-history . 100))&#xA;    desktop-globals-to-save))    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;session&lt;/code&gt; is provided by &lt;code&gt;/usr/share/emacs24/site-lisp/emacs-goodies-el/session.el&lt;/code&gt; so it is not built-in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I get any benefits from &lt;code&gt;session.el&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2015-11-01T11:39:44.700" Title="Do I need session mode if I use desktop mode?" Tags="|desktop|session|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17785" PostTypeId="2" ParentId="5807" CreationDate="2015-11-01T12:08:53.937" Score="3" Body="&lt;p&gt;My take on this is that &lt;code&gt;execute-kbd-macro&lt;/code&gt; acts on the buffer of the &lt;em&gt;selected window&lt;/em&gt; (it is effectively typed keystrokes from the user, after all), and you must therefore ensure that this is set to your temporary buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-temp-buffer&#xA;  (insert &quot;select&quot;)&#xA;  (save-window-excursion&#xA;    (set-window-buffer nil (current-buffer))&#xA;    (execute-kbd-macro (kbd &quot;SPC&quot;)))&#xA;  (buffer-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I note that the same kind of thing is going on in the code of Lindydancer's answer.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-11-01T12:24:43.770" LastActivityDate="2015-11-01T12:24:43.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17786" PostTypeId="1" AcceptedAnswerId="17917" CreationDate="2015-11-01T13:13:18.320" Score="0" ViewCount="603" Body="&lt;p&gt;To jump around in my init.el I used to do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq imenu-generic-expression '((nil &quot;;; \\[ \\(.*\\)&quot; 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then put markers in the file like so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; [ my marker here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To call imenu i have a handy shortcut&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(local-set-key (kbd &quot;C-*&quot;) 'imenu)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This worked nice but does not anymore... Now i only get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user-error: No items suitable for an index found in this buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;toggle-debug-on-error and removing user-error from ignored-debug-errors and calling imenu again gives me &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (user-error &quot;No items suitable for an index found in this buffer&quot;)&#xA;  signal(user-error (&quot;No items suitable for an index found in this buffer&quot;))&#xA;  user-error(&quot;No items suitable for an index found in this buffer&quot;)&#xA;  imenu--make-index-alist()&#xA;  imenu-choose-buffer-index()&#xA;  byte-code(&quot;\300 C\207&quot; [imenu-choose-buffer-index] 1)&#xA;  call-interactively(imenu nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My emacs version is 24.3.1. What am i doing wrong? How can i get the intended imenu behavior working the way i have had it?&lt;/p&gt;&#xA;" OwnerUserId="970" LastEditorUserId="970" LastEditDate="2015-11-02T05:35:57.090" LastActivityDate="2015-11-07T14:07:04.660" Title="Use imenu to index init.el" Tags="|imenu|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17787" PostTypeId="5" CreationDate="2015-11-01T14:40:23.420" Score="0" Body="&lt;p&gt;The kill ring is a list of blocks of text that were previously killed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Killing moves text from a buffer to the kill ring.  Text can also be copied from a buffer to the kill ring, without removing it from the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is only one kill ring, shared by all buffers, so you can kill text in one buffer and yank it in another buffer. This is a common way to move text from one buffer to another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maximum number of entries in the kill ring is controlled by option &lt;code&gt;kill-ring-max&lt;/code&gt; (which you can customize).  If you make a new kill when this limit has been reached, Emacs makes room by deleting the oldest entry in the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actual contents of the kill ring are stored in a variable named &lt;code&gt;kill-ring&lt;/code&gt;; you can view the entire contents of the kill ring using &lt;code&gt;C-h v kill-ring&lt;/code&gt;.  See also function &lt;code&gt;kill-new&lt;/code&gt;, which adds a killed or copied string to the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Kill-Ring.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Kill-Ring.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="105" LastEditDate="2015-11-01T16:22:22.373" LastActivityDate="2015-11-01T16:22:22.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17788" PostTypeId="4" CreationDate="2015-11-01T14:40:23.420" Score="0" Body="The kill ring is a global list of blocks of text that were previously copied or moved from buffers." OwnerUserId="45" LastEditorUserId="105" LastEditDate="2015-11-01T16:24:10.263" LastActivityDate="2015-11-01T16:24:10.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17789" PostTypeId="2" ParentId="17786" CreationDate="2015-11-01T16:30:25.013" Score="1" Body="&lt;p&gt;Load the source file &lt;code&gt;imenu.el&lt;/code&gt;, then use &lt;code&gt;M-x debug-on-entry RET imenu-choose-buffer-index&lt;/code&gt;.  Open file &lt;code&gt;imenu.el&lt;/code&gt; in a separate frame (&lt;code&gt;C-x 5 f&lt;/code&gt;), and move to the definition of &lt;code&gt;imenu-choose-buffer-index&lt;/code&gt;, so you can see what it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, when you try to invoke &lt;code&gt;imenu&lt;/code&gt; the debugger will open. You can walk through the debugger using &lt;code&gt;d&lt;/code&gt; (or &lt;code&gt;c&lt;/code&gt; to skip through an uninteresting step).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are especially interested in the invocation of &lt;code&gt;imenu--make-index-alist&lt;/code&gt;. (You could use &lt;code&gt;debug-on-entry&lt;/code&gt; for that, instead, but it might be instructive to see what goes on before it is invoked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for showing &lt;code&gt;imenu.el&lt;/code&gt; in another frame is so you can follow the code along with what the debugger is doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following the execution in the debugger will tell you what goes wrong, and possibly why.  If you have a question about what it shows you in this regard, update your question accordingly.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-01T16:30:25.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17790" PostTypeId="1" AcceptedAnswerId="17791" CreationDate="2015-11-01T16:50:47.873" Score="1" ViewCount="608" Body="&lt;p&gt;I want to write a set of functions that call specific files, not by a specific name, but the newest file (with a certain suffix) in the directory. So far I've got&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org_lisp_dir ()&#xA;  (interactive)&#xA;  (switch-to-buffer (find-file-noselect &quot;~/org/babeltest/c.org&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that doesn't get me the latest .org file. To do this I believe I need to use something like &lt;code&gt;(eshell/ls something)&lt;/code&gt;, but I'm not sure how to use &lt;code&gt;(eshell/ls)&lt;/code&gt; or integrate a complex eshell command into my code. The actual command would be something like &lt;code&gt;ls -Art *.org | tail -n 1&lt;/code&gt; which works just fine in eshell, BTW.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:51:00.217" LastActivityDate="2016-03-14T04:51:00.217" Title="How to write a custom find-file function" Tags="|eshell|find-file|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17791" PostTypeId="2" ParentId="17790" CreationDate="2015-11-01T17:39:11.890" Score="5" Body="&lt;p&gt;You can use &lt;code&gt;shell-command-to-string&lt;/code&gt; to get a shell command's output. From &lt;code&gt;C-h f shell-command-to-string&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;shell-command-to-string is a compiled Lisp function in ‘simple.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(shell-command-to-string COMMAND)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Execute shell command COMMAND and return its output as a string.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example, on my machine, your shell command gives&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((default-directory &quot;~/org/&quot;))     ; Ending slash is necessary&#xA;  (shell-command-to-string &quot;ls -Art *.org | tail -n 1&quot;))&#xA;    ⇒ &quot;todo.org&#xA;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: I have changed directory by setting &lt;code&gt;default-directory&lt;/code&gt; before running the shell command, mostly because &lt;code&gt;ls(1)&lt;/code&gt; can't tell file's full path. And there is also a trailing newline, which is not part of filename and needs to be removed, you can remove that from elisp or from shell.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a command named &lt;code&gt;foo&lt;/code&gt; for opening newest &lt;code&gt;.org&lt;/code&gt; file in &lt;code&gt;~/org/&lt;/code&gt; directory (non-recursively).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (let ((default-directory &quot;~/org/&quot;))&#xA;    (find-file (shell-command-to-string &quot;ls -Art *.org | tail -n 1 | tr -d '\n'&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tr(1)&lt;/code&gt; is used here to remove trailing newline.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-11-01T17:39:11.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17792" PostTypeId="2" ParentId="9834" CreationDate="2015-11-01T17:53:32.790" Score="2" Body="&lt;p&gt;The offending code is right in &lt;code&gt;mu4e-update-mail-and-index&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (unless mu4e-hide-index-messages&#xA;     (make-progress-reporter&#xA;      (mu4e-format &amp;quot;Retrieving mail...&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;which logs messages when the (undocumented) variable &lt;code&gt;mu4e-hide-index-messages&lt;/code&gt; is nil. I prefer to disable it entirely, but to answer your question the following should do the trick:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (add-hook 'minibuffer-setup-hook&#xA;          (lambda () (setq mu4e-hide-index-messages t)))&#xA;    (add-hook 'minibuffer-exit-hook&#xA;          (lambda () (setq mu4e-hide-index-messages nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10010" LastEditorUserId="17538" LastEditDate="2023-11-27T16:47:28.057" LastActivityDate="2023-11-27T16:47:28.057" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17793" PostTypeId="2" ParentId="17790" CreationDate="2015-11-01T18:13:16.783" Score="1" Body="&lt;p&gt;Use &lt;code&gt;directory-files&lt;/code&gt; to get the list of files in a directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then loop over that list (e.g. &lt;code&gt;dolist&lt;/code&gt;), examining the last-modified dates using function &lt;code&gt;file-attributes&lt;/code&gt; to identify the most recently modified file(s).  Or you can use function &lt;code&gt;file-newer-than-file-p&lt;/code&gt; to filter the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;find-file&lt;/code&gt; (not &lt;code&gt;find-file-noselect&lt;/code&gt;) when you have identified the file(s) you want to edit (I'm assuming you want to edit them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(However, I don't think that the original &lt;em&gt;creation&lt;/em&gt; date is available, if that's the information you are after.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-01T18:13:16.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17795" PostTypeId="1" CreationDate="2015-11-01T20:20:18.673" Score="0" ViewCount="423" Body="&lt;p&gt;After switching to gui version of emacs and also installing prelude with helm everywhere, I have lost the ability to paste stuff in to the search prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So before, I could mark a word, copy to clipboard and C-s (I-search) and then&#xA;Command-V would paste whatever was in the clipboard in to the I-search prompt.&#xA;This doesn't happen anymore.&#xA;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="9829" LastEditorUserId="306" LastEditDate="2015-11-04T13:04:29.290" LastActivityDate="2015-11-04T13:04:29.290" Title="lost ability to paste in to mini buffer" Tags="|helm|prelude|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17796" PostTypeId="1" AcceptedAnswerId="17849" CreationDate="2015-11-01T20:47:37.970" Score="5" ViewCount="807" Body="&lt;p&gt;I'm talking about &lt;a href=&quot;http://www.emacswiki.org/emacs/tea-time&quot; rel=&quot;nofollow&quot;&gt;tea-time&lt;/a&gt;. In short: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It allows you to set up time intervals and after this interval is elapsed, Emacs will notify you with sound and notification. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What I'm really interested in is the sound notification (otherwise, I'd miss it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also seys in the link that it's been integrated into org-mode:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Functionality of this package was integrated into org-mode (edge on May 2009). Check &lt;a href=&quot;http://orgmode.org/Changes.html#sec-1.4.2&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/Changes.html#sec-1.4.2&lt;/a&gt; for details.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I checked the link, but the only functionality that is mentioned is the use of &lt;code&gt;org-timer&lt;/code&gt; (&lt;code&gt;org-timer-set-timer&lt;/code&gt;, which I've been using for some time now). But &lt;code&gt;org-timer&lt;/code&gt; doesn't have any (sound) notifications. Did I miss something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: It could be that I just don't know how to configure &lt;code&gt;org-timer&lt;/code&gt; to play sounds. I'm not very good with lisp code (yet), can somebody please help me out on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit2: I found this piece of code &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=lisp/org-timer.el;hb=HEAD&quot; rel=&quot;nofollow&quot;&gt;org-timer.el&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-timer--run-countdown-timer (secs title)&#xA;  &quot;Start countdown timer that will last SECS.&#xA;TITLE will be appended to the notification message displayed when&#xA;time is up.&quot;&#xA;  (let ((msg (format &quot;%s: time out&quot; title)))&#xA;    (run-with-timer&#xA;     secs nil `(lambda ()&#xA;         (setq org-timer-countdown-timer nil&#xA;               org-timer-start-time nil)&#xA;         (org-notify ,msg ,org-clock-sound)&#xA;         (org-timer-set-mode-line 'off)&#xA;         (run-hooks 'org-timer-done-hook)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think org-clock-sound is a variable that I need to set to a specific *.wav file or something, but I don't know.&lt;/p&gt;&#xA;" OwnerUserId="9775" LastEditorUserId="9775" LastEditDate="2015-11-01T20:58:17.857" LastActivityDate="2015-11-04T11:01:42.687" Title="Emacs tea-time is supposed to be integrated in org-mode, but apparently, it's not" Tags="|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17797" PostTypeId="1" AcceptedAnswerId="17822" CreationDate="2015-11-01T21:23:02.850" Score="6" ViewCount="1015" Body="&lt;p&gt;When org-agenda-follow-mode is on, how do I make the buffer showing the items in the agenda narrow to the subtree of the relevant item?&lt;/p&gt;&#xA;" OwnerUserId="5463" LastActivityDate="2018-02-22T14:57:22.263" Title="How to narrow to subtree in org agenda follow mode?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17799" PostTypeId="2" ParentId="17795" CreationDate="2015-11-02T00:26:55.380" Score="1" Body="&lt;p&gt;Essentially, you've said that you have a whole lot of stuff in a sack, and something changed somewhere, and the resulting behavior changed.  And you're asking for help removing that behavior change.  That's all pretty nebulous. (What is &amp;quot;guy version of emacs&amp;quot;?)&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Please provide a succinct, step-by-step, minimal (or close to it) recipe to reproduce the problem. Describe what you see and what you expected to see instead. This question risks being closed because it is unclear.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To narrow down the problem, for yourself or for us to help you better, recursively bisect the giant sack that is your init file. Start by commenting out 1/2 of it, then 3/4, 7/8, 15/16, 31/32, 63/64,... until you have something that approaches a minimal startup that shows the problem.&lt;/p&gt;&#xA;&lt;p&gt;You can use command &lt;code&gt;comment-region&lt;/code&gt; to comment out selected text (or, with &lt;code&gt;C-u&lt;/code&gt;, to uncomment it).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-11-02T00:26:55.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17800" PostTypeId="1" AcceptedAnswerId="17802" CreationDate="2015-11-02T08:20:55.327" Score="0" ViewCount="45" Body="&lt;p&gt;Is it possible that Emacs ignores the system clipboard?&#xA;I mean when outside of Emacs I copy something, Emacs ignores it.&#xA;But not vice-versa, i.e., I would like to be able to have the access to the content of Emacs kill ring when I work in an external program (i.e. notapad). To be precise, the question is related to Microsoft Windows, but it is relavant for ther OS's.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2015-11-02T09:03:52.630" LastActivityDate="2015-11-02T10:11:09.673" Title="One directional access to the clipboard (OS to Emacs: no, Emacs to OS: yes)" Tags="|copy-paste|clipboard|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17801" PostTypeId="1" CreationDate="2015-11-02T09:34:09.540" Score="6" ViewCount="1181" Body="&lt;p&gt;I'm trying to use &lt;strong&gt;helm-projectile-grep&lt;/strong&gt; function on Windows 7, but it searches in every file, though in &lt;strong&gt;.projectile&lt;/strong&gt; I excluded file types which I don't want to work with. Do I have to configure &lt;strong&gt;grep&lt;/strong&gt; separately and how to do this? May be I should put something in pattern for &lt;strong&gt;grep&lt;/strong&gt;? Thanks for advice.&lt;/p&gt;&#xA;" OwnerUserId="10015" LastEditorUserId="10015" LastEditDate="2015-11-02T10:35:16.830" LastActivityDate="2015-11-02T10:35:16.830" Title="projectile grep file filter" Tags="|helm|projectile|grep|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17802" PostTypeId="2" ParentId="17800" CreationDate="2015-11-02T10:11:09.673" Score="2" Body="&lt;p&gt;Try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq interprogram-paste-function nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-02T10:11:09.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17803" PostTypeId="2" ParentId="12505" CreationDate="2015-11-02T10:36:51.647" Score="1" Body="&lt;p&gt;I believe the &lt;code&gt;window&lt;/code&gt; object is &lt;a href=&quot;https://github.com/ternjs/tern/blob/master/defs/browser.json&quot; rel=&quot;nofollow&quot;&gt;provided by the &lt;code&gt;browser&lt;/code&gt; lib&lt;/a&gt;, so you'll need something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;  &quot;libs&quot;: [&#xA;    &quot;browser&quot;&#xA;  ],&#xA;  &quot;plugins&quot;: {&#xA;    &quot;node&quot;: {},&#xA;    &quot;angular&quot;: {}&#xA;    }&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10017" LastActivityDate="2015-11-02T10:36:51.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17804" PostTypeId="1" AcceptedAnswerId="17809" CreationDate="2015-11-02T12:05:55.490" Score="1" ViewCount="90" Body="&lt;p&gt;Can we have nested bookmarks, working like a filesystem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Bookmark&#xA;- --------&#xA;  dir-1                         &#xA;  dir-2                         &#xA;  ...&#xA;  mark-n                         ~/work/file-n.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open dir-1 I have another screen with bookmarks, located in this dir:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Bookmark&#xA;- --------&#xA;  dir-1-1                         ~/work/file-1.txt&#xA;  dir-1-2                         ~/work/file-2.txt&#xA;  mark-1                         ~/work/file-n.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, we upgrade the bookmarks data structure from a list to a tree.&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2015-11-02T15:21:57.163" Title="Nested bookmarks" Tags="|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17805" PostTypeId="1" AcceptedAnswerId="17827" CreationDate="2015-11-02T12:58:02.793" Score="4" ViewCount="472" Body="&lt;p&gt;I'm trying to implement qmake-mode using SMIE(&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/SMIE.html&lt;/a&gt;), but I have no idea how to control indent width in line-continuation. Block indentation works(yes, I stole block indentation from sh-script.sh(sh-mode))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I expect this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SOURCES += a.cpp \&#xA;    b.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SOURCES += a.cpp \&#xA;        b.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is brief code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst qmake-smie-grammar  &#xA;  (smie-prec2-&amp;gt;grammar&#xA;   (smie-bnf-&amp;gt;prec2&#xA;    '((var)&#xA;      (value)&#xA;      (exp (var &quot;+=&quot; value)&#xA;           (var &quot;=&quot; value)&#xA;           (var &quot;-=&quot; value))&#xA;      (inst (exp &quot;||&quot; exp)&#xA;            (exp &quot;&amp;amp;&amp;amp;&quot; exp))&#xA;      (insts (inst &quot;;&quot; insts)))&#xA;    '((assoc &quot;+=&quot; &quot;=&quot; &quot;-=&quot;))&#xA;    '((assoc &quot;||&quot; &quot;&amp;amp;&amp;amp;&quot;))&#xA;    '((assoc &quot;;&quot;))&#xA;    )))&#xA;&#xA;(defun qmake-smie-backward-token ()&#xA;  (let ((bol (line-beginning-position))&#xA;        pos tok)&#xA;    (forward-comment (- (point)))&#xA;    (cond&#xA;     ((&amp;lt; (point) bol)&#xA;      (cond&#xA;       ((qmake-smie--looking-back-at-continuation-p)&#xA;        (forward-char -1)&#xA;        (funcall smie-backward-token-function))&#xA;       ((qmake-smie--newline-semi-p) &quot;;&quot;)&#xA;       (t (funcall smie-backward-token-function))))&#xA;     (t tok))))&#xA;&#xA;(defun qmake-smie-rules (kind token)&#xA;  (pcase (cons kind token)&#xA;    (`(:elem . basic) qmake-indentation)&#xA;    ((and `(:before . ,_)&#xA;          (guard (when qmake-indent-after-continuation&#xA;                   (save-excursion&#xA;                     (ignore-errors&#xA;                       (skip-chars-backward &quot; \t&quot;)&#xA;                       (qmake-smie--looking-back-at-continuation-p))))))&#xA;     ;; After a line-continuation, make sure the rest is indented.&#xA;     (let* ((qmake-indent-after-continuation nil)&#xA;            (indent (smie-indent-calculate))&#xA;            (initial (qmake-smie--continuation-start-indent)))&#xA;       (when (and (numberp indent) (numberp initial)&#xA;                  (&amp;lt;= indent initial))&#xA;         `(column . ,(+ initial qmake-indentation)))))&#xA;    (`(:before . ,(or `&quot;(&quot; `&quot;{&quot; `&quot;[&quot;))&#xA;     (if (smie-rule-hanging-p) (smie-rule-parent)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is full code:&#xA;&lt;a href=&quot;https://gist.github.com/inlinechan/2ff5194d06cfcfb34016&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/inlinechan/2ff5194d06cfcfb34016&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9018" LastEditorUserId="105" LastEditDate="2016-03-14T04:50:36.637" LastActivityDate="2016-03-14T04:50:36.637" Title="How to control line-continuation using SMIE?" Tags="|smie|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17806" PostTypeId="1" AcceptedAnswerId="17815" CreationDate="2015-11-02T14:06:58.803" Score="5" ViewCount="1181" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I change the &lt;em&gt;face&lt;/em&gt; of the outline ellipsis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When working with outlines, the (customizable) ellipsis indicates when a section is folded and there is hidden text, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A heading...&#xA;** A subheading...&#xA;*** A subsubheading...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The ellipsis is customizable via the &lt;code&gt;selective-display&lt;/code&gt; slot of the &lt;code&gt;display-table&lt;/code&gt;, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-display-table-slot standard-display-table &#xA;                        'selective-display &#xA;                        (string-to-vector &quot;!!!&quot;)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which gets us to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A heading!!!&#xA;** A subheading!!!&#xA;*** A subsubheading!!!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(No, I'm not actually using exclamation points, it's just an example.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what I'd like to do is &lt;em&gt;customize the ellipsis so that it &lt;strong&gt;takes the same face as the outline header&lt;/strong&gt; it is on&lt;/em&gt;.  How would one do that?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Note that the &lt;a href=&quot;http://www.emacswiki.org/emacs/OutlineMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsWiki &lt;code&gt;outline-mode&lt;/code&gt; node&lt;/a&gt; has a couple of suggestions for setting the face, but neither seem to work (at least for me).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PPS: A &lt;a href=&quot;https://emacs.stackexchange.com/questions/10981/changing-the-appearance-of-org-mode-hidden-contents-ellipsis&quot;&gt;related thread on the &lt;code&gt;org-ellipsis&lt;/code&gt;&lt;/a&gt; does not explicitly handle the faces issue.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-11-02T17:26:22.913" Title="Set face of outline ellipsis?" Tags="|faces|outline-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17807" PostTypeId="2" ParentId="17806" CreationDate="2015-11-02T15:06:28.237" Score="1" Body="&lt;p&gt;Since you mentioned in your PPS, you can set &lt;code&gt;org-ellipsis&lt;/code&gt; to a face. Looking at &lt;code&gt;org-ellipsis&lt;/code&gt; docstring in &lt;code&gt;org.el&lt;/code&gt;, it says &lt;code&gt;org-ellipsis&lt;/code&gt; can be set to a face:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-ellipsis nil&#xA;  &quot;The ellipsis to use in the Org-mode outline.&#xA;When nil, just use the standard three dots.&#xA;When a string, use that string instead.&#xA;When a face, use the standard 3 dots, but with the specified face.&#xA;The change affects only Org-mode (which will then use its own display table).&#xA;Changing this requires executing \\[org-mode] in a buffer to become&#xA;effective.&quot;&#xA;  :group 'org-startup&#xA;  :type '(choice (const :tag &quot;Default&quot; nil)&#xA;         (face :tag &quot;Face&quot; :value org-warning)&#xA;         (string :tag &quot;String&quot; :value &quot;...#&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2015-11-02T15:23:05.570" LastActivityDate="2015-11-02T15:23:05.570" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17808" PostTypeId="1" CreationDate="2015-11-02T15:10:04.333" Score="1" ViewCount="1395" Body="&lt;p&gt;While running pdb within emacs, &lt;a href=&quot;https://stackoverflow.com/a/10313090/2476373&quot;&gt;this answer&lt;/a&gt; (&lt;code&gt;python -m pdb myscript.py&lt;/code&gt;) is successful for enabling python pdb on emacs with virtualenv. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I need to type it manually after calling &lt;code&gt;M-x pdb&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I edit my .emacs file to use it automatically, without the need to type it manually every time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10018" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-11-03T11:50:13.700" Title="Enable python pdb on emacs with virtualenv" Tags="|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17809" PostTypeId="2" ParentId="17804" CreationDate="2015-11-02T15:21:57.163" Score="1" Body="&lt;p&gt;Yes, with &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would do it slightly differently from what you describe. You can &lt;em&gt;bookmark&lt;/em&gt; (1) a &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#bookmark-listBookmarks&quot; rel=&quot;nofollow&quot;&gt;bookmark-list display&lt;/a&gt; or (2) a &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#BookmarkFileBookmarks&quot; rel=&quot;nofollow&quot;&gt;bookmark file&lt;/a&gt;.  When you &quot;jump&quot; to such a bookmark you (1) get that display or (2) switch to using that bookmark file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can also bookmark an Emacs desktop -- when you &quot;jump&quot; to such a bookmark you switch to that desktop.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-02T15:21:57.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17810" PostTypeId="1" AcceptedAnswerId="17817" CreationDate="2015-11-02T15:25:27.767" Score="1" ViewCount="561" Body="&lt;p&gt;How can I apply &lt;code&gt;M-;&lt;/code&gt; to comments out blocks in matlab-mode? Currently it only adds comments at the end of line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10018" LastActivityDate="2015-11-04T13:45:42.520" Title="Adding comment out for matlab-mode" Tags="|comment|matlab|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17811" PostTypeId="1" CreationDate="2015-11-02T15:38:25.500" Score="6" ViewCount="3428" Body="&lt;p&gt;When using the menu system to modify customizations (Options &gt; Customize Emacs &gt; ...etc...), I am&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Able to &quot;Apply&quot; the change for the curent session&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Unable to &quot;Apply and save&quot; for future sessions&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The error message I get is 'forward-sexp: Scan error: &quot;Unbalanced parentheses&quot;, 30586, 41369'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea how to deal with this message. Online searches produce random results, none of which relate to my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am exploring and learning about org-mode. About three days ago I was able to make a change related to customizing a default option for org-mode without a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then a few minutes later when I tried to add another custom setting, I got the above &quot;forward-sexp...&quot; error and continue to. I get this error when attempting to &quot;Apply and save&quot; any setting whatsoever, such as changing the color of the default face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried swapping in an old &quot;init.el&quot; file, firing up a new emacs session, and making a change, but &quot;Apply and save&quot; also fails under those circumstances, so the problem does not appear related to my &quot;init.el&quot; file being corrupt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond that, I'm clueless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Update 2015-11-03&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you Drew for your long and thoughtful reply. I'm still out to sea though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put &lt;code&gt;(setq debug-on-error  t)&lt;/code&gt; at the top of my init.el file and attempted to change the color of the default face, uisng the Cutsomize option from the emacs menu. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had to try three times before I got any backtrace output. Unfortunately, to me it's meaningless, but here it is...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;Debugger entered--Lisp error: (scan-error &quot;Unbalanced parentheses&quot; 30598 41177)   scan-sexps(1 41176)   forward-sexp(41176)&lt;br&gt;&#xA;    custom-save-delete(custom-set-variables)   custom-save-variables()&lt;br&gt;&#xA;    custom-save-all()   Custom-save((push-button :tag &quot; Apply and Save &quot;&#xA;    :help-echo &quot;Apply settings and save for future sessions.&quot; :action&#xA;    Custom-save :button-overlay # :from # :to #) (mouse-1 (# 191 (270&#xA;    . 121) 23286452 nil 191 (26 . 5) nil (0 . 12) (10 . 25))))&lt;br&gt;&#xA;    widget-apply((push-button :tag &quot; Apply and Save &quot; :help-echo &quot;Apply&#xA;    settings and save for future sessions.&quot; :action Custom-save&#xA;    :button-overlay # :from # :to #)&#xA;    :action (mouse-1 (# 191 (270 .&#xA;    121) 23286452 nil 191 (26 . 5) nil (0 . 12) (10 . 25))))&lt;br&gt;&#xA;    widget-apply-action((push-button :tag &quot; Apply and Save &quot; :help-echo&#xA;    &quot;Apply settings and save for future sessions.&quot; :action Custom-save&#xA;    :button-overlay # :from # :to #)&#xA;    (mouse-1 (# 191 (270 . 121)&#xA;    23286452 nil 191 (26 . 5) nil (0 . 12) (10 . 25))))   #[0 &quot;\306&#xA;    r\307\310\311\312\313\314!\315\&quot;\316\317%DC\216\320\321\300@!\211,@)!\210\212\321\300@!,\322,8\206B`&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then I used diff to compare the resulting modified but unsaved init.el, and an init.el from last May.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There were two differences,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(setq debug-on-error  t) on line one of today's init.el. and&lt;/li&gt;&#xA;&lt;li&gt;a macro that I edited about three weeks ago&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since I was able to do one customization a couple of days ago with no problem, and unable since then, the macro editing is not an issue&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main part of the custom-set-variables secton of the init file hasn't been changed for years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;  ;; custom-set-variables was added by Custom.&#xA;  ;; If you edit it by hand, you could mess it up, so be careful.&#xA;  ;; Your init file should contain only one such instance.&#xA;  ;; If there is more than one, they won't work right.&#xA; '(auto-save-interval 75)&#xA; '(auto-save-timeout 10)&#xA; '(blink-cursor-mode nil)&#xA; '(bookmark-save-flag 0)&#xA; '(column-number-mode t)&#xA; '(dired-listing-switches &quot;-al --group-directories-first --time-style=long-iso&quot;)&#xA; '(display-time-day-and-date t)&#xA; '(display-time-mode t)&#xA; '(fill-column 110)&#xA; '(fringe-mode 2 nil (fringe))&#xA; '(inhibit-startup-screen t)&#xA; '(ispell-highlight-face (quote highlight))&#xA; '(ispell-highlight-p t)&#xA; '(ispell-program-name &quot;aspell&quot; t)&#xA; '(load-home-init-file t t)&#xA; '(ls-lisp-dirs-first t)&#xA; '(make-backup-files nil)&#xA; '(scroll-bar-mode (quote right))&#xA; '(sentence-end-double-space nil)&#xA; '(sort-fold-case t t)&#xA; '(tool-bar-mode nil)&#xA; '(truncate-lines t)&#xA; '(vc-make-backup-files t)&#xA; '(version-control t)&#xA; '(visible-bell t)&#xA; '(x-select-enable-clipboard t))&#xA;;;(custom-set-faces&#xA;  ;; custom-set-faces was added by Custom.&#xA;  ;; If you edit it by hand, you could mess it up, so be careful.&#xA;  ;; Your init file should contain only one such instance.&#xA;  ;; If there is more than one, they won't work right.&#xA;;; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The other part has been set for many months, and is...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;;; make pandoc the default markdown parser&#xA;(custom-set-variables '(markdown-command &quot;/usr/bin/pandoc&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Earlier today I reinstalled all the Emacs packages as well, but no change from that either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Update 2015-11-06&lt;/em&gt;&lt;/strong&gt;: Edited. Reply reconfigured and moved into a whole new answer for clarity. &lt;/p&gt;&#xA;" OwnerUserId="10019" LastEditorUserId="10019" LastEditDate="2015-11-07T11:40:28.137" LastActivityDate="2020-05-01T12:21:19.827" Title="forward-sexp: Scan error: &quot;Unbalanced parentheses&quot;, 30586, 41369" Tags="|init-file|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17812" PostTypeId="2" ParentId="17811" CreationDate="2015-11-02T15:56:25.733" Score="0" Body="&lt;p&gt;Put this in your init file, near the beginning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq debug-on-error  t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Post the backtrace you see when you get the error.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You mention using Customize, as if that is related to your problem. But you don't say just what you did in Customize. If, for example, you customized an option that expects a Lisp value, and you entered a sexp that is missing one or more right parentheses or a string terminator (&lt;code&gt;&quot;&lt;/code&gt;) or some such, then that could explain the error you are seeing.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can try to find what is provoking the problem in your init file by recursively bisecting it, to narrow it down.  Use &lt;code&gt;comment-region&lt;/code&gt; to comment out a selection of sexps (or &lt;code&gt;C-u&lt;/code&gt; with that command to uncomment a selection). Comment out 1/2, then 3/4, 7/8,... of your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are convinced that the problem is something you changed using Customize, then you can try just commenting out parts of the &lt;code&gt;custom-set-variables&lt;/code&gt; part of your init file - each of its parts is a sexp that customizes one option. Comment out 1/2 of them, then 3/4,... until you find the one that is problematic.  Then check that one for a missing termination (paren or &lt;code&gt;&quot;&lt;/code&gt; or &lt;code&gt;]&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But without more information all we can say is that Emacs is trying to evaluate a sexp that is unfinished -- missing something that should end it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-02T16:01:48.397" LastActivityDate="2015-11-02T16:01:48.397" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17813" PostTypeId="1" AcceptedAnswerId="18096" CreationDate="2015-11-02T16:57:28.143" Score="3" ViewCount="573" Body="&lt;p&gt;I have been using &lt;a href=&quot;http://dayoneapp.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Day One&lt;/a&gt; for a while but I dislike it being Mac only.&#xA;I have a capture template in orgmode that creates new journal entries in a tree.&lt;/p&gt;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&lt;p&gt;*2015&lt;/p&gt;&#xA;&lt;p&gt;**2015-11 November.&lt;/p&gt;&#xA;&lt;p&gt;***2015-11-2 Monday&lt;/p&gt;&#xA;&lt;p&gt;**** My journal entry.&lt;/p&gt;&#xA;&lt;p&gt;Day One can export to markdown. The format is like this:&lt;/p&gt;&#xA;&lt;p&gt;Date:   June 2, 2010 at 11:11 PM&#xA;Location:   My location, City, Country&#xA;Weather:    45° Clear&lt;/p&gt;&#xA;&lt;p&gt;Text entry.&lt;/p&gt;&#xA;&lt;p&gt;What would be the best way to I import this into my orgmode journal?&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2020-10-16T15:56:31.377" Title="How do I import a Day One journal into orgmode?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17814" PostTypeId="2" ParentId="17813" CreationDate="2015-11-02T17:07:48.190" Score="0" Body="&lt;p&gt;You can do this quickly with regex search &amp;amp; replace, M-C %. Replace ^Date: with *** to create your headlines, and repeat for other elements as necessary. Since you'll only likely do this once, a few rounds of search &amp;amp; replace is probably going to be faster than writing code. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-11-02T17:07:48.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17815" PostTypeId="2" ParentId="17806" CreationDate="2015-11-02T17:11:47.263" Score="5" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:   &quot;&lt;em&gt;However, what I'd like to do is customize the ellipsis so that it takes the same face as the outline header it is on. How would one do that?&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A&lt;/strong&gt;:   This cannot be done using the &lt;code&gt;buffer-display-table&lt;/code&gt;.  It's an all or nothing type of deal -- i.e., a change to the &lt;code&gt;buffer-display-table&lt;/code&gt; affects everything in the buffer, not merely a particular heading.  It is possible to create a different custom overlay for each heading, but it may not be very efficient -- in that case, the display slot 4 would not be used.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an example of what is going on behind the scenes when setting the face for the ellipsis in either &lt;code&gt;outline-mode&lt;/code&gt; or &lt;code&gt;org-mode&lt;/code&gt;.  The display engine of Emacs has built-in support for text with invisible property at the end of the line, which can be visualized via the &lt;code&gt;buffer-display-table&lt;/code&gt;.  For more information about this special slot, type:  &lt;code&gt;M-x describe-variable RET buffer-display-table RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((display-table&#xA;        (if buffer-display-table&#xA;          buffer-display-table&#xA;          (make-display-table))))&#xA;  (unless buffer-display-table&#xA;    (setq buffer-display-table display-table))&#xA;  (set-display-table-slot display-table 4&#xA;    (vconcat (mapcar (lambda (c)&#xA;      (make-glyph-code c 'font-lock-keyword-face)) &quot;...&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-11-02T17:26:22.913" LastActivityDate="2015-11-02T17:26:22.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17816" PostTypeId="1" CreationDate="2015-11-02T19:36:08.093" Score="0" ViewCount="166" Body="&lt;p&gt;I've just installed &lt;code&gt;header2&lt;/code&gt; from elpa and -- now what? I'm afraid I can't fathom where to begin with this beast. I'd like to make a custom org-mode header. Is there a tutorial somewhere that can get me going on it? I've only found the original &quot;OriginalHeaderEl&quot; code, which lists user commands such as &lt;code&gt;make-header&lt;/code&gt;. I do this, and a generic-looking emacs lisp file header stuff appears. Obviously, I haven't customized (created a template?) for what goes into my header yet. How is this done? I saw &lt;a href=&quot;https://emacs.stackexchange.com/questions/537/inserting-updating-source-file-header-comments&quot;&gt;this&lt;/a&gt;, but it tells me nothing about how to customize, etc., not the EmacsWiki homepage for header2 either. &lt;a href=&quot;https://stackoverflow.com/questions/26132104/template-for-an-automatic-header-on-emacs&quot;&gt;This&lt;/a&gt; shows a beginner's roll-your-own, which would be fine, but it's not the same as grokking an important piece of the Emacs eco-system like header2....&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-03-14T04:50:21.247" Title="header2 . . . how to use" Tags="|file-header|" AnswerCount="0" CommentCount="5" ClosedDate="2015-11-03T00:37:06.640" ContentLicense="CC BY-SA 3.0" />
  <row Id="17817" PostTypeId="2" ParentId="17810" CreationDate="2015-11-02T22:39:50.553" Score="0" Body="&#xA;&#xA;&lt;p&gt;I prefer to use a generic &quot;comment/uncomment line or region DWIM&quot; kind of function that works in any major mode.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Generic comment DWIM function&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is the function I use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun endless/comment-line-or-region (n)&#xA;  &quot;Comment or uncomment current line and proceed to the next line.&#xA;With positive prefix, apply to N lines including current one.&#xA;With negative prefix, apply to -N lines above.&#xA;If region is active, apply to active region instead.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (if (use-region-p)&#xA;      (comment-or-uncomment-region&#xA;       (region-beginning) (region-end))&#xA;    (let ((range&#xA;           (list (line-beginning-position)&#xA;                 (goto-char (line-end-position n)))))&#xA;      (comment-or-uncomment-region&#xA;       (apply #'min range)&#xA;       (apply #'max range)))&#xA;    (forward-line 1)&#xA;    (back-to-indentation)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Tweaking the bindings for &lt;code&gt;matlab-mode&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Unbind the M-; key from `matlab-mode-map'&#xA;;; `with-eval-after-load' will work in emacs 24.4 and newer versions&#xA;(with-eval-after-load 'matlab&#xA;  (define-key matlab-mode-map (kbd &quot;M-;&quot;) nil)) &#xA;&#xA;;; For emacs 24.3 and older versions use `eval-after-load' instead&#xA;;; of `with-eval-after-load'. Note that `eval-after-load' accepts&#xA;;; only a single quoted form.&#xA;;; (eval-after-load 'matlab&#xA;;;   '(define-key matlab-mode-map (kbd &quot;M-;&quot;) nil)) &#xA;&#xA;;; Define the M-; binding globally&#xA;;; This binding will be effective in any major-mode that does not&#xA;;; have that major-mode-specific M-; binding&#xA;(global-set-key (kbd &quot;M-;&quot;) #'endless/comment-line-or-region) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://endlessparentheses.com/implementing-comment-line.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Source&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-11-03T06:08:37.023" LastActivityDate="2015-11-03T06:08:37.023" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17818" PostTypeId="2" ParentId="669" CreationDate="2015-11-02T23:01:31.487" Score="3" Body="&lt;p&gt;The other answers have pretty well covered the low-level error-handling facilities that will be useful in a case like this.  Another approach that can help is modularity.  For instance, I divide my initialization file into several different files (using &lt;code&gt;provide&lt;/code&gt; as appropriate), and I load them using this function instead of &lt;code&gt;require&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/require-softly (feature &amp;amp;optional filename)&#xA;  &quot;As `require', but instead of an error just print a message.&#xA;&#xA;If there is an error, its message will be included in the message&#xA;printed.&#xA;&#xA;Like `require', the return value will be FEATURE if the load was&#xA;successful (or unnecessary) and nil if not.&quot;&#xA;  (condition-case err&#xA;      (require feature filename) &#xA;    (error (message &quot;Error loading %s: \&quot;%s\&quot;&quot;&#xA;                    (if filename (format &quot;%s (%s)&quot; feature filename) feature)&#xA;                    (error-message-string err))&#xA;           nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An error while loading a file in this way will still print a message, but it won't prevent execution of anything outside of the file where the error actually occurred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this function isn't really that different from wrapping a &lt;code&gt;require&lt;/code&gt; call in &lt;code&gt;with-demoted-errors&lt;/code&gt; (I wrote it before I knew about &lt;code&gt;with-demoted-errors&lt;/code&gt;), but the important point is that it you can essentially implement something like Dan's combination of &lt;code&gt;with-demoted-errors&lt;/code&gt; and &lt;code&gt;unwind-protect&lt;/code&gt; without wrapping (potentially very lengthy) blocks of code.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-11-02T23:01:31.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17819" PostTypeId="2" ParentId="17698" CreationDate="2015-11-02T23:27:39.603" Score="4" Body="&lt;p&gt;I don't have a clean solution but the below hack works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You basically break the matching for org links by introducing invisible zero-width spaces inbetween. For example, &lt;strong&gt;ZWS&lt;/strong&gt; below is where I insert the zero-width space unicode character. You can do so by doing &lt;code&gt;C-x 8&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;200b&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=[​ZWS[0]]=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tested it to work for both html and pdf exports using org-mode version 8.3.2.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also check out this another related QnA on emacs.stackexchange: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/16702/115&quot;&gt;How can I escape the * in org-mode to prevent bold fontification?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-11-02T23:27:39.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17820" PostTypeId="1" AcceptedAnswerId="17821" CreationDate="2015-11-03T00:07:21.130" Score="5" ViewCount="1350" Body="&lt;p&gt;The diary file is located by default at &lt;code&gt;~/diary&lt;/code&gt;. I'd rather it wasn't. I've looked quite a bit through the reference over the past couple of days, I haven't seen anything generated in the .emacs that sets it, and there are no SX questions about it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to put your diary in a different directory?&lt;/p&gt;&#xA;" OwnerUserId="10026" LastActivityDate="2015-11-03T01:18:44.260" Title="Change diary location?" Tags="|calendar|diary|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17821" PostTypeId="2" ParentId="17820" CreationDate="2015-11-03T01:00:21.247" Score="7" Body="&lt;p&gt;To learn more about the variable &lt;code&gt;diary-file&lt;/code&gt;, type &lt;code&gt;M-x describe-variable RET diary-file RET&lt;/code&gt;  This can be set through the built-in customize interface -- &lt;code&gt;M-x customize-variable RET diary-file RET&lt;/code&gt; -- or by placing something like the following snippet in the &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq diary-file &quot;/hello/world/diary-file&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If setting it manually, then restart Emacs or evaluate the expression.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-11-03T01:18:44.260" LastActivityDate="2015-11-03T01:18:44.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17822" PostTypeId="2" ParentId="17797" CreationDate="2015-11-03T02:11:27.357" Score="7" Body="&lt;p&gt;Basically all you need to do this is to have &lt;code&gt;org-narrow-to-subtree&lt;/code&gt; run right after whatever function &lt;code&gt;org-follow-mode&lt;/code&gt; is calling, which happen to be &lt;code&gt;org-agenda-goto&lt;/code&gt;.  You have to be a little careful writing the advice because &lt;code&gt;org-agenda-goto&lt;/code&gt; is sometimes called with an argument, which &lt;code&gt;org-narrow-to-subtree&lt;/code&gt; can't take.  Here's what we need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-agenda-goto :after&#xA;            (lambda (&amp;amp;rest args)&#xA;              (org-narrow-to-subtree)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-11-03T02:11:27.357" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17823" PostTypeId="1" AcceptedAnswerId="17824" CreationDate="2015-11-03T05:24:03.837" Score="35" ViewCount="10572" Body="&lt;p&gt;while going through the &lt;a href=&quot;https://www.youtube.com/watch?v=HTUE03LnaXA&quot;&gt;emacs as a c/c++ editor&lt;/a&gt; , I came across the following lines of code to include in my &lt;code&gt;~/.emacs&lt;/code&gt; file, to connect to &#xA;&lt;code&gt;melpa archives&lt;/code&gt; for package installation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after saving these lines into emacs , when i started emacs it is showing me an &lt;code&gt;wrong type argument: arrayp, nil&lt;/code&gt; in the minibuffer area&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when i tried for &lt;code&gt;$ emacs --debug -init&lt;/code&gt; , I got :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument arrayp nil)&#xA;  package--add-to-archive-contents(nil &quot;melpa&quot;)&#xA;  package-read-archive-contents(&quot;melpa&quot;)&#xA;  package-read-all-archive-contents()&#xA;  package-initialize()&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/anupam/.emacs&quot; nil t)  ; Reading at buffer position 905&#xA;  load-with-code-conversion(&quot;/home/anupam/.emacs&quot; &quot;/home/anupam/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 &quot;\205\262�    \306=\203�\307\310Q\202;�   \311=\204�\307\312Q\202;�\313\307\314\315#\203*�\316\202;�\313\307\314\317#\203:�\320\nB\321\202;�\316\322\323\322\211#\210\322=\203a�\324\325\326\307\327Q!\&quot;\323\322\211#\210\322=\203`�\210\203\243�\330!\331\232\203\243�\332!\211\333P\334!\203}�\211\202\210�\334!\203\207�\202\210�\314\262\203\241�\335\&quot;\203\237�\336\337#\210\340\341!\210\266\f?\205\260�\314\323\342\322\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; (initialization &quot;`_emacs' init file is deprecated, please use `.emacs'&quot;) &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7 &quot;\n\n(fn)&quot;]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am new to emacs, can someone please tell me how can i resolve this?&lt;/p&gt;&#xA;" OwnerUserId="933" LastEditorUserId="2642" LastEditDate="2016-02-17T22:57:25.643" LastActivityDate="2016-03-28T22:31:14.170" Title="package-initialize: wrong type argument : arrayp , nil" Tags="|package|start-up|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17824" PostTypeId="2" ParentId="17823" CreationDate="2015-11-03T05:50:45.460" Score="44" Body="&lt;p&gt;I ran into this the other day. I think it was caused by an invalid package archive file. The immediate fix is to delete &lt;code&gt;&amp;lt;user-emacs-directory&amp;gt;/elpa/archives/melpa/archive-contents&lt;/code&gt;; it will be rebuilt on the next &lt;code&gt;package-initialize&lt;/code&gt;. Unfortunately, package.el is not very robust to this sort of failure.&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="8" LastEditDate="2016-03-28T22:31:14.170" LastActivityDate="2016-03-28T22:31:14.170" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17825" PostTypeId="2" ParentId="17808" CreationDate="2015-11-03T09:35:55.607" Score="4" Body="&lt;p&gt;You can choose the pdb command like this in your .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq gud-pdb-command-name &quot;python -m pdb myscript.py&quot;)&#xA;;;or let you choose the python script&#xA;(setq gud-pdb-command-name &quot;python -m pdb &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-11-03T11:50:13.700" LastActivityDate="2015-11-03T11:50:13.700" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17826" PostTypeId="1" AcceptedAnswerId="17829" CreationDate="2015-11-03T13:31:42.960" Score="2" ViewCount="742" Body="&lt;p&gt;I'd like to export from a large orgmode file a subtree, which looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Subtree to be exported&#xA;:PROPERTIES:&#xA;:EXPORT_FILE_NAME: &quot;C:/PATH/TO/FOLDER/filename.org&quot;&#xA;:EXPORT_TITLE:&#xA;:END:&#xA;&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Error message after C-c C-e C-s h h : »Output file not writable«. How can I add a path to the filename? orgmode 8.3.2&lt;/p&gt;&#xA;" OwnerUserId="2334" LastActivityDate="2015-11-03T13:53:04.567" Title="Set `EXPORT_FILE_NAME` to a full path" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17827" PostTypeId="2" ParentId="17805" CreationDate="2015-11-03T13:41:01.340" Score="2" Body="&lt;p&gt;Check the code that uses &lt;code&gt;sh-indent-after-continuation&lt;/code&gt; since that's the config variable that decides how continued lines should be indented.  You'll probably want to look at the following change I installed recently:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;commit d6b49570f6fe1cfb5314c1b61b81ede0497a06b2&#xA;Author: Stefan Monnier &amp;lt;monnier@iro.umontreal.ca&amp;gt;&#xA;Date:   Tue Sep 29 21:43:07 2015 -0400&#xA;&#xA;    * lisp/progmodes/sh-script.el: Old &quot;dumb&quot; continued line indent&#xA;&#xA;    (sh-indent-after-continuation): Add new value `always' (bug#17620)&#xA;    (sh-smie-sh-rules): Remove old handling of continued lines.&#xA;    (sh-smie--indent-continuation): New function.&#xA;    (sh-set-shell): Use it.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-11-03T13:41:01.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17828" PostTypeId="2" ParentId="17810" CreationDate="2015-11-03T13:48:30.590" Score="0" Body="&lt;p&gt;AFAIK, all you should need is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'matlab-mode-hook (lamba () (local-set-key &quot;\M-;&quot; nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so as to stop matlab-mode from overriding the default &lt;kbd&gt;M-;&lt;/kbd&gt; binding.  And please report this problem to the matlab-mode authors so they can fix it.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-11-03T13:48:30.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17829" PostTypeId="2" ParentId="17826" CreationDate="2015-11-03T13:53:04.567" Score="3" Body="&lt;p&gt;Although not documented, as far as I can see, it works, but I made two mistakes.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Path and name not in &quot;&quot;, so no spaces are allowed.&lt;/li&gt;&#xA;&lt;li&gt;Filename without &quot;.org&quot;, just the filename without extension.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So this works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Subtree to be exported&#xA;:PROPERTIES:&#xA;:EXPORT_FILE_NAME: C:/PATH/TO/FOLDER/filename&#xA;:EXPORT_TITLE:&#xA;:END:&#xA;&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2334" LastActivityDate="2015-11-03T13:53:04.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17830" PostTypeId="1" CreationDate="2015-11-03T15:08:27.453" Score="3" ViewCount="778" Body="&lt;p&gt;There are two other questions asking this, but one accepted an answer that didn't help, and the other lacked detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ubuntu 14.04 running emacs-snapshot from &lt;code&gt;ppa.launchpad.net/ubuntu-elisp/ppa/ubuntu&lt;/code&gt;  &lt;/li&gt;&#xA;&lt;li&gt;Fire up &lt;code&gt;emacs -Q&lt;/code&gt;.  &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x org-version&lt;/code&gt; =&gt; &lt;code&gt;Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/25.0.50/lisp/org/)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x emacs-version&lt;/code&gt; =&gt; &lt;code&gt;GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2015-10-26&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;eval &lt;code&gt;(setq org-src-fontify-natively 't)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then make a tiny example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Simple Program&#xA;#+BEGIN_EXAMPLE ruby&#xA;  puts(&quot;foo&quot;)&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Voila: in the message buffer &lt;code&gt;org-mode fontification error [15 times]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix the fontification, so my buffers look pretty and my exports work?&lt;/p&gt;&#xA;" OwnerUserId="503" LastActivityDate="2017-02-26T00:07:41.107" Title="Emacs 25: org-mode fontification error" Tags="|org-mode|org-babel|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17831" PostTypeId="1" AcceptedAnswerId="17832" CreationDate="2015-11-03T15:12:26.903" Score="9" ViewCount="3005" Body="&lt;p&gt;I am using Emacs with org mode. When asking for agenda view (C-c a), each todo line item is started with the name of the org file the item belongs to, or possibly, the category defined for the todo. This visibility consumes horisontal space, and I do not need this info. How can I turn that visiblity off? &lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2018-09-13T15:04:51.087" Title="Org agenda view: how to turn of visibility of category/filename?" Tags="|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17832" PostTypeId="2" ParentId="17831" CreationDate="2015-11-03T16:45:43.873" Score="12" Body="&lt;p&gt;The category and file-name that displays in the agenda view can be controlled with the variable &lt;code&gt;org-agenda-prefix-format&lt;/code&gt;.  For more information about customizing this variable, type:  &lt;code&gt;M-x describe-variable RET org-agenda-prefix-format RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I decided that I wanted a dot to precede each item and I commented out the more detailed option:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org-agenda)&#xA;&#xA;(setq org-agenda-prefix-format '(&#xA;  ;; (agenda  . &quot; %i %-12:c%?-12t% s&quot;) ;; file name + org-agenda-entry-type&#xA;  (agenda  . &quot;  • &quot;)&#xA;  (timeline  . &quot;  % s&quot;)&#xA;  (todo  . &quot; %i %-12:c&quot;)&#xA;  (tags  . &quot; %i %-12:c&quot;)&#xA;  (search . &quot; %i %-12:c&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-11-04T16:28:30.913" LastActivityDate="2015-11-04T16:28:30.913" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17833" PostTypeId="2" ParentId="13011" CreationDate="2015-11-03T16:53:10.587" Score="2" Body="&lt;p&gt;Would it work to use the &lt;code&gt;%^g&lt;/code&gt; element in your template to prompt for a tag at a specific position within the template? In one of mine, I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-capture-templates&#xA;         `(&quot;j&quot; &quot;Journal&quot; entry&#xA;           (file+datetree &quot;journal.org&quot; &quot;Journal&quot;)&#xA;           &quot;* %^{Plan} %^g\n%?\n&quot;&#xA;           :kill-buffer t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which prompts for a tag after prompting for a headline, then lets me type in the rest of the entry in the capture buffer. As far as I can tell, it picks up the tags from the journal.org file appropriately for completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc in &lt;a href=&quot;http://orgmode.org/manual/Template-expansion.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Template-expansion.html&lt;/a&gt; describes &lt;code&gt;%^g&lt;/code&gt; as &quot;Prompt for tags, with completion on tags in target file.&quot; There is also &lt;code&gt;%^G&lt;/code&gt; to prompt for tags from all agenda files.&lt;/p&gt;&#xA;" OwnerUserId="10033" LastActivityDate="2015-11-03T16:53:10.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17834" PostTypeId="1" CreationDate="2015-11-03T16:59:48.960" Score="6" ViewCount="1111" Body="&lt;p&gt;Is there a built-in function that does this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mk-column-at (point)&#xA;  &quot;Return column number at POINT.&quot;&#xA;  (save-excursion&#xA;    (goto-char point)&#xA;    (current-column)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="105" LastEditDate="2016-03-14T04:49:43.747" LastActivityDate="2016-03-14T04:49:43.747" Title="Built-in function to get column at point" Tags="|column|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17835" PostTypeId="1" AcceptedAnswerId="17837" CreationDate="2015-11-03T18:46:09.660" Score="4" ViewCount="1497" Body="&lt;p&gt;In my work routine, I schedule tasks to days of the weeks according to their urgency and effort levels. If there is a deadline of a scheduled task two of them (one entry for deadlined and one for scheduled) are shown in the agenda view of the current day. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I can remove scheduled entry by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-skip-scheduled-if-deadline-is-shown t), &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it is not the solution that I am after since some of the deadlines that I will work on later still show up on the agenda view. &#xA;I like to see scheduled items instead of the deadline since I am also viewing efforts of the item. However, from time to time I need to see deadlined items so that I can schedule the tasks to the days of the week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I really want to do is turning on and off deadlined items when I need to. There should be an easy command but I could not find it, I would appreciate any help. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;" OwnerUserId="8839" LastActivityDate="2015-11-03T19:40:43.763" Title="Org-mode Agenda view - how to turn on and off tasks with deadlines" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17836" PostTypeId="2" ParentId="13011" CreationDate="2015-11-03T19:14:18.463" Score="2" Body="&#xA;&#xA;&lt;p&gt;Since I posted that question, I have switched to using the &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ivy&lt;/code&gt;/&lt;code&gt;counsel&lt;/code&gt;&lt;/a&gt; family of packages for this purpose (instead of &lt;code&gt;ido&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After installing the &lt;code&gt;counsel&lt;/code&gt; package from Melpa, and below piece of code in my emacs init, auto-completing org tags has become a breeze all-over org: In the Capture buffer, in regular org buffers and even in &lt;code&gt;org-agenda&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'counsel)&#xA;(with-eval-after-load 'org&#xA;  (define-key org-mode-map (kbd &quot;C-c C-q&quot;) #'counsel-org-tag))&#xA;(with-eval-after-load 'org-agenda&#xA;  (define-key org-agenda-mode-map (kbd &quot;C-c C-q&quot;) #'counsel-org-tag-agenda))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is what I get in my tag completion after hitting &lt;code&gt;C-c C-q&lt;/code&gt; in the Capture buffer and then searching for tags beginning with the letter &lt;code&gt;b&lt;/code&gt; (&lt;code&gt;^b&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HfYXa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HfYXa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;counsel&lt;/code&gt; basically uses the &lt;code&gt;ivy&lt;/code&gt; package for backend (which is like &lt;code&gt;ido-vertical-mode&lt;/code&gt; broadly speaking). You can learn more about Counsel completion from the package author's &lt;a href=&quot;http://oremacs.com/2015/04/09/counsel-completion/&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog post&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-11-03T19:49:30.497" LastActivityDate="2015-11-03T19:49:30.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17837" PostTypeId="2" ParentId="17835" CreationDate="2015-11-03T19:40:43.763" Score="8" Body="&lt;p&gt;Short answer: Press '!'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C-h m in the agenda opens a help buffer containing the line&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!               org-agenda-toggle-deadlines&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2015-11-03T19:40:43.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17838" PostTypeId="1" CreationDate="2015-11-03T20:20:55.583" Score="1" ViewCount="421" Body="&lt;p&gt;I am customizing my ~/.emacs file. Specifically, I am customizing org-mode's TODO list feature to include more tasks. However, I keep receiving the following error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;File mode specification error: (wrong-type-argument stringp\ (sequence&#xA;  &quot;TODO&quot; &quot;IN-PROGRESS&quot; &quot;WAITING&quot; &quot;DONE&quot;))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've pasted my ~/.emacs file below. I am every new to emacs and org-mode. Would love any insights.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; -*- mode: emacs-lisp -*-                                 &#xA;&#xA;;; Disable the splash screen (to enable it agin, replace th\&#xA;e t with 0)                                                 &#xA;(setq inhibit-splash-screen t)&#xA;&#xA;;; Enable transient mark mode                               &#xA;(transient-mark-mode 1)&#xA;&#xA;;;;;org-mode configuration                                  &#xA;;; Enable org-mode                                          &#xA;(require 'org)&#xA;(setq org-todo-keywords&#xA;  '((sequence &quot;TODO&quot; &quot;IN-PROGRESS&quot; &quot;WAITING&quot; &quot;DONE&quot;)))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.org\\'&quot; . org-mode))&#xA;&#xA;&#xA;;; don't create backupfiles                                 &#xA;(setq make-backup-files nil)&#xA;&#xA;;; don't create auto-save files                             &#xA;(setq auto-save-default nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks -- any insights would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="10035" LastEditorUserId="115" LastEditDate="2015-11-03T21:46:39.500" LastActivityDate="2015-11-04T06:56:27.347" Title=".emacs file issues with org-mode TODO tutorials" Tags="|org-mode|init-file|terminal-emacs|todo|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17839" PostTypeId="2" ParentId="17834" CreationDate="2015-11-03T22:58:12.433" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;&lt;em&gt;Point&lt;/em&gt;&quot; means something in Emacs. It is the buffer position just before the text cursor - the position at which text is self-inserted. It is confusing to name a parameter &lt;code&gt;POINT&lt;/code&gt;, since point typically does not correspond to whatever position might be passed to the function as argument. Better to call it &lt;code&gt;POSITION&lt;/code&gt; or &lt;code&gt;POS&lt;/code&gt; or &lt;code&gt;POSN&lt;/code&gt;, following convention, or something else.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Wrt the question, there is no such predefined function, as far as I know. What you write is about as succinct as it gets.  I would probably just use the code in the function body, rather than bothering to define a function for this, but what you've done seems reasonable to me.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-03T22:58:12.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17840" PostTypeId="1" CreationDate="2015-11-04T00:47:45.600" Score="4" ViewCount="584" Body="&lt;p&gt;I have a org-mode file (test.org) as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: my-tangle-to-file&#xA;#+BEGIN_SRC sh :tangle my_tangle_file.sh :dir /tmp :shebang &quot;#!/usr/bin/env bash&quot;&#xA;  me=$(basename $(test -L &quot;$0&quot; &amp;amp;&amp;amp; readlink &quot;$0&quot; || echo &quot;$0&quot;))&#xA;  echo &quot;I was tangled to a file (${me})&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How could I tangle/evaluate the source block &lt;code&gt;my-tangle-to-file&lt;/code&gt; in batch mode?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-11-04T04:40:33.950" Title="In emacs batch mode, how to evaluate/tangle a named source block in an org-mode file?" Tags="|org-mode|org-babel|batch-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17841" PostTypeId="2" ParentId="17838" CreationDate="2015-11-04T01:30:36.903" Score="1" Body="&lt;p&gt;The original poster has continued a comment from line 3 onto line 4 without placing the standard semicolon comment delimiter at the beginning of line 4.  The solution is to move &lt;code&gt;e t with 0)&lt;/code&gt; on line 4 back up to line 3 where it belongs, or add at least one semicolon to the beginning of line 4. Then save the &lt;code&gt;.emacs&lt;/code&gt; file and restart Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-11-04T01:30:36.903" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17843" PostTypeId="2" ParentId="17840" CreationDate="2015-11-04T04:40:33.950" Score="2" Body="&lt;p&gt;Does the instructions at &lt;a href=&quot;http://orgmode.org/manual/Batch-execution.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Batch-execution.html&lt;/a&gt; do what you want?&lt;/p&gt;&#xA;" OwnerUserId="6807" LastActivityDate="2015-11-04T04:40:33.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17844" PostTypeId="1" AcceptedAnswerId="17852" CreationDate="2015-11-04T04:54:39.630" Score="1" ViewCount="1401" Body="&lt;p&gt;When I set the core.editor=&quot;emacsclient -nc&quot;, after I press &quot;C-c C-c&quot; in the  &lt;code&gt;.git/TAG_EDITMSG&lt;/code&gt; buffer, I got the error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fatal: no tag message?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But here is the content of &lt;code&gt;.git/TAG_EDITMSG&lt;/code&gt; file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test&#xA;&#xA;#&#xA;# Write a message for tag:&#xA;#   v0.0.5&#xA;# Lines starting with '#' will be ignored.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried to set core.editor to &lt;code&gt;emacs&lt;/code&gt; or &lt;code&gt;gedit -s&lt;/code&gt;, they all work fine. TAGS are created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs: compiled from git commit &quot;ecb069e&quot;&#xA;Git  : 2.6.2&#xA;OS   : Ubuntu 14.04&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-11-04T13:02:01.263" Title="Got &quot;fatal: no tag message?&quot; error when set git core.editor to &quot;emacsclient -nc&quot;" Tags="|emacsclient|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17846" PostTypeId="1" AcceptedAnswerId="17848" CreationDate="2015-11-04T07:55:38.563" Score="1" ViewCount="1363" Body="&lt;p&gt;Simple question, I think: How can I calculate the length of a line in emacs lisp? It seems like there should be a function for this, but I can't find it. What I'm using right now is something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(-&#xA; (progn&#xA;   (end-of-line)&#xA;   (current-column))&#xA; (progn&#xA;   (beginning-of-line)&#xA;   (current-column)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this feels clumsy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there a standard way to do this? And are there any subtleties I should be aware of (i.e. regarding encoding, tabs, or anything like that)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually for my purposes, it would be just as handy to simply calculate if a line is empty. Is there a function for that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whatever method I use, it needs to be pretty fast. I need to calculate this for every line in a buffer on a pretty regular basis without interrupting flow.&lt;/p&gt;&#xA;" OwnerUserId="216" LastEditorUserId="105" LastEditDate="2016-03-14T04:49:25.997" LastActivityDate="2016-03-14T04:49:25.997" Title="Calculating the length of a line in a buffer" Tags="|text|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17847" PostTypeId="2" ParentId="17283" CreationDate="2015-11-04T09:31:05.890" Score="4" Body="&lt;p&gt;If you want the symbols to be prettified in the whole org file, just define &lt;code&gt;prettify-symbols-alist&lt;/code&gt; in the buffer and enable &lt;code&gt;prettify-symbols-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But a better solution would ensure that these symbols are prettified &lt;strong&gt;only&lt;/strong&gt; in the src blocks (and according to the language mode).  Note that they are when editing the source block through &lt;code&gt;org-edit-src-code&lt;/code&gt; (since the src block is copied in a buffer in the corresponding major mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at how src block fontification works (function &lt;code&gt;org-src-font-lock-fontify-block&lt;/code&gt; in file &lt;code&gt;org-src.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;extract block as a string&lt;/li&gt;&#xA;&lt;li&gt;insert it in a dedicated buffer&lt;/li&gt;&#xA;&lt;li&gt;set language major mode&lt;/li&gt;&#xA;&lt;li&gt;call font-lock-fontify-buffer&lt;/li&gt;&#xA;&lt;li&gt;copy 'face properties from buffer to org buffer&lt;/li&gt;&#xA;&lt;li&gt;mark text in org buffer as font-lock-fontified&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And seeing (function &lt;code&gt;enter prettify-symbols-mode&lt;/code&gt; in file &lt;code&gt;prog-mode.el&lt;/code&gt;) that symbol prettification relies on &lt;code&gt;'composition&lt;/code&gt; properties, one can deduce we just need to change &lt;code&gt;org-src-font-lock-fontify-block&lt;/code&gt; to make it copy &lt;code&gt;'composition&lt;/code&gt; properties as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the modified function (see marked 'Addition' part):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-src-font-lock-fontify-block (lang start end)&#xA;  &quot;Fontify code block.&#xA;This function is called by emacs automatic fontification, as long&#xA;as `org-src-fontify-natively' is non-nil.&quot;&#xA;  (let ((lang-mode (org-src--get-lang-mode lang)))&#xA;    (when (fboundp lang-mode)&#xA;      (let ((string (buffer-substring-no-properties start end))&#xA;        (modified (buffer-modified-p))&#xA;        (org-buffer (current-buffer)) pos next)&#xA;    (remove-text-properties start end '(face nil))&#xA;    (with-current-buffer&#xA;        (get-buffer-create&#xA;         (concat &quot; org-src-fontification:&quot; (symbol-name lang-mode)))&#xA;      (delete-region (point-min) (point-max))&#xA;      (insert string &quot; &quot;) ;; so there's a final property change&#xA;      (unless (eq major-mode lang-mode) (funcall lang-mode))&#xA;      ;; Avoid `font-lock-ensure', which does not display fonts in&#xA;      ;; source block.&#xA;      (font-lock-fontify-buffer)&#xA;      (setq pos (point-min))&#xA;      (while (setq next (next-single-property-change pos 'face))&#xA;        (put-text-property&#xA;         (+ start (1- pos)) (1- (+ start next)) 'face&#xA;         (get-text-property pos 'face) org-buffer)&#xA;        (setq pos next))&#xA;      ;; Addition: also copy 'composition info for prettified symbols&#xA;      (setq pos (point-min))&#xA;      (while (setq next (next-single-property-change pos 'composition))&#xA;        (put-text-property&#xA;         (+ start (1- pos)) (1- (+ start next)) 'composition&#xA;         (get-text-property pos 'composition) org-buffer)&#xA;        (setq pos next))&#xA;      ;; End addition&#xA;      )&#xA;    (add-text-properties&#xA;     start end&#xA;     '(font-lock-fontified t fontified t font-lock-multiline t))&#xA;    (set-buffer-modified-p modified)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You have to ensure this is loaded after the definition in &lt;code&gt;org-src.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2015-11-04T10:41:00.813" LastActivityDate="2015-11-04T10:41:00.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17848" PostTypeId="2" ParentId="17846" CreationDate="2015-11-04T09:47:03.687" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun line-length (n)&#xA;  &quot;Length of the Nth line.&quot;&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (if (zerop (forward-line (1- n)))&#xA;        (- (line-end-position)&#xA;           (line-beginning-position)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or calculate the length of all lines in &lt;code&gt;current-buffer&lt;/code&gt; (or of the accessible portion):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun line-lengths ()&#xA;  (let (lengths)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (not (eobp))&#xA;        (push (- (line-end-position)&#xA;                 (line-beginning-position))&#xA;              lengths)&#xA;        (forward-line)))&#xA;    (nreverse lengths)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-11-04T09:47:03.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17849" PostTypeId="2" ParentId="17796" CreationDate="2015-11-04T11:01:42.687" Score="7" Body="&lt;p&gt;You need the org-clock-sound variable:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-clock-sound nil) ;; no sound&#xA;(setq org-clock-sound t) ;; Standard Emacs beep&#xA;(setq org-clock-sound &quot;/path/to/my/sound&quot;) ;; Play this sound file, fall back to beep&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-11-04T11:01:42.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17850" PostTypeId="1" CreationDate="2015-11-04T12:43:25.840" Score="1" ViewCount="424" Body="&lt;p&gt;Given a plain list like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- buy tea&#xA;- call Anna&#xA;- Reply email to John&#xA;- pay bill 1&#xA;- phone Derick&#xA;- Reply to grad-pa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which you don't want to sort alphabetically, how can you sort it? Things like 'call' or 'phone' should go into the same category.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could  put the elements into separate categories like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* contact&#xA;  - phone Derick&#xA;  - call Anna&#xA;* Money&#xA;  - pay bill 1&#xA;  - buy tea&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Otherwise, I'd need to through the whole list several times and copy and paste all elements of each category, instead of going through it only once and marking the list items, and then sort them with a function. &lt;/p&gt;&#xA;" OwnerUserId="10042" LastEditorUserId="2274" LastEditDate="2015-11-04T13:36:14.500" LastActivityDate="2015-11-05T03:56:50.810" Title="Most efficient way of sorting a list" Tags="|org-mode|sorting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17851" PostTypeId="2" ParentId="17811" CreationDate="2015-11-04T12:48:11.913" Score="6" Body="&lt;p&gt;Based on some quick testing of &lt;code&gt;forward-sexp&lt;/code&gt;, the numbers listed in the error message define where the unbounded sexp are found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding a bare &lt;code&gt;(&lt;/code&gt; to my init file then trying &lt;code&gt;forward-sexp&lt;/code&gt; I received: &lt;code&gt;forward-sexp: Scan error: &quot;Unbalanced parentheses&quot;, 436, 52245&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-: (point)&lt;/code&gt; on the &lt;code&gt;(&lt;/code&gt; gave &lt;code&gt;436&lt;/code&gt; and &lt;code&gt;M-: (point-max)&lt;/code&gt; gave &lt;code&gt;52245&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case:  &lt;code&gt;M-g c&lt;/code&gt; (goto-char) &lt;code&gt;30586&lt;/code&gt; should send you to the &lt;code&gt;(&lt;/code&gt; that the file cannot find an end to.&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-11-04T12:48:11.913" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17852" PostTypeId="2" ParentId="17844" CreationDate="2015-11-04T13:02:01.263" Score="4" Body="&lt;p&gt;Remove the &lt;code&gt;-n&lt;/code&gt; flag.  Git expects the editor to block and &lt;code&gt;-n&lt;/code&gt; tells Emacs not to block.  Hence git tries to use the tag message before you even had the chance to write anything.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-11-04T13:02:01.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17853" PostTypeId="1" AcceptedAnswerId="17858" CreationDate="2015-11-04T13:21:39.757" Score="5" ViewCount="674" Body="&lt;p&gt;In org-mode, I need a function to move point to the last row of a named table of arbitrary length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From anywhere in the buffer, I would like to go to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: table-with-unique-name&#xA;|---+---------|&#xA;| X | Y       |&#xA;|---+---------|&#xA;| a | some    |&#xA;| b | random  |&#xA;| c | content | &amp;lt;--first cell in this row&#xA;|---+---------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I there a more elegant way to go to a named table than to isearch for&#xA;&lt;code&gt;#+NAME: table-with-unique-name&lt;/code&gt; and &lt;code&gt;next-line&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; ok, so I'm going with a function that searches for the &lt;code&gt;#+NAME: table-with-unique-name&lt;/code&gt; line and goes to &lt;code&gt;next-line&lt;/code&gt; but that, too, is giving me trouble. With this function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-goto-table ()&#xA;  (interactive)&#xA;    (goto-char (point-min))&#xA;    (re-search-forward &quot;^#\\+NAME: table-with-unique-name&quot;)&#xA;    (next-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can successfully go to the table if it exists but if the search fails, point ends up in the beginning of the buffer. Is there a way to wrap &lt;code&gt;re-search-forward&lt;/code&gt; or some other smart way to search the whole buffer? [Resolved by using &lt;code&gt;save-excursion&lt;/code&gt;. See &quot;Edit 2&quot; for working function.]&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;[Answered] Once at the table, how can I go to the last line? (I know&#xA;there's a    function    called &lt;code&gt;org-table-goto-line&lt;/code&gt; but I can't get&#xA;it to go to    last line, only to    a specific line number.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2:&lt;/strong&gt; This works to goto specific cell of a table with a unique name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tracktable-exists-p ()&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (re-search-forward &quot;^#\\+NAME: table-with-unique-name&quot; nil t)))&#xA;&#xA;(defun test-goto-cell ()&#xA;  (interactive)&#xA;  (if (tracktable-exists-p)&#xA;      (let ((tabel &quot;^#\\+NAME: table-with-unique-name&quot;))&#xA;        (goto-char (point-min))&#xA;        (re-search-forward tabel nil t)&#xA;        (show-subtree) ; necessary if the table is hidden in a subtree&#xA;        (goto-char (org-table-end))&#xA;        (previous-line 2) ; the dotted line in the bottom is not recognized as part of the table by 'org-table-goto-column' so go two lines up.&#xA;        (org-table-goto-column 1))&#xA;    (message &quot;table-with-unique-name doesn't exist&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Marco Wahl resolved the hard part, so accepting answer.&lt;/p&gt;&#xA;" OwnerUserId="5341" LastEditorUserId="5341" LastEditDate="2015-11-06T09:09:45.693" LastActivityDate="2023-07-28T07:00:32.687" Title="Goto last line in org-table" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17854" PostTypeId="2" ParentId="17850" CreationDate="2015-11-04T13:35:40.497" Score="2" Body="&lt;p&gt;The basic way to sort lists is with &lt;code&gt;org-sort&lt;/code&gt; (&lt;code&gt;C-c ^&lt;/code&gt;).  It will offer you a number of different sorting options one of which (f) lets you call a custom sorting function.  This function will be called on each entry and should return either a string or a number that will be used as a key to sort.  You will need to write a custom function to order things the way you want.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-11-04T13:35:40.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17855" PostTypeId="2" ParentId="17044" CreationDate="2015-11-04T13:37:43.677" Score="0" Body="&lt;p&gt;Install &lt;a href=&quot;https://github.com/rolandwalker/simpleclip&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rolandwalker/simpleclip&lt;/a&gt; (check its README on how to install cli tools)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then modify you snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: yank&#xA;# key: yank&#xA;# --&#xA;[[${1:`(simpleclip-get-contents)`}][$0]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This solution works always (Cygwin/Windows/Mac/Linux)&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-11-04T13:37:43.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17856" PostTypeId="2" ParentId="17810" CreationDate="2015-11-04T13:45:42.520" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/redguardtoo/evil-nerd-commenter&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/evil-nerd-commenter&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;supports even emacs23.4, all you need is just one line setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evilnc-default-hotkeys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There many commands you can use, but if you want to comment out blocks separated by empty line, you just need &lt;code&gt;M-x evilnc-comment-or-uncomment-paragraphs&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-11-04T13:45:42.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17857" PostTypeId="1" AcceptedAnswerId="17859" CreationDate="2015-11-04T14:10:23.030" Score="4" ViewCount="394" Body="&lt;p&gt;I wish to search a separate word with helm-swoop. There should be some trick for this I guess. For instance I know that to search 2 words will be like word1\|word2 and to search the end of the line like: endofline$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So does anybody know how to search a whole word only? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="10015" LastEditorUserId="10015" LastEditDate="2015-11-04T15:47:18.307" LastActivityDate="2015-11-04T15:47:18.307" Title="How do I search the whole word in swoop?" Tags="|helm|search|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17858" PostTypeId="2" ParentId="17853" CreationDate="2015-11-04T15:32:38.523" Score="5" Body="&lt;p&gt;This is an answer to 'Once at the table, how can I go to the last line?'.  So this is only a partial answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this command which at its core uses the function 'org-table-end'.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun stackexchange-org-table-goto-last-line ()&#xA;  (interactive)&#xA;  (goto-char (org-table-end))&#xA;  (backward-char)&#xA;  (org-table-goto-column 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2015-11-04T15:32:38.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17859" PostTypeId="2" ParentId="17857" CreationDate="2015-11-04T15:34:59.910" Score="6" Body="&lt;p&gt;You can use any regexps supported by Emacs, which provides &lt;code&gt;\b&lt;/code&gt; as a match for the boundary of a word. So swooping for &lt;code&gt;\bin\b&lt;/code&gt; will match &lt;code&gt;in&lt;/code&gt; but not &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;begin&lt;/code&gt; or &lt;code&gt;being&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full list of Emacs-supported regexps is in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html#Regexp-Backslash&quot; rel=&quot;nofollow&quot;&gt;second page&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2015-11-04T15:40:17.083" LastActivityDate="2015-11-04T15:40:17.083" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17860" PostTypeId="1" AcceptedAnswerId="17861" CreationDate="2015-11-04T15:55:00.520" Score="9" ViewCount="213" Body="&lt;p&gt;For years I've been using a zsh script that causes a pushd to implicitly happen everytime you change directories. The script also sets up 'b' and 'f' aliases, short for backwards and forwards, that move you up and down the stack, similar to the back and forward buttons in a web browser. Example session:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/etc $ cd /tmp&#xA;/tmp $ cd /bin&#xA;/bin $ b&#xA;/tmp $ b&#xA;/etc $ f&#xA;/tmp $ f&#xA;/bin $&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've found it incredibly useful and I was wondering, what's the best way to set this up in eshell? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: See the code I went with here, slight modification of below: &lt;a href=&quot;https://gist.github.com/jgarvin/0627ed76a773ade222f6&quot; rel=&quot;noreferrer&quot;&gt;https://gist.github.com/jgarvin/0627ed76a773ade222f6&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2015-11-04T19:04:39.757" LastActivityDate="2015-11-04T19:27:56.883" Title="How to create back/forward directory aliases for eshell?" Tags="|eshell|aliases|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17861" PostTypeId="2" ParentId="17860" CreationDate="2015-11-04T17:57:10.197" Score="6" Body="&lt;p&gt;The following saves &lt;code&gt;cd&lt;/code&gt; history and provides eshell commands &lt;code&gt;b&lt;/code&gt; and &lt;code&gt;f&lt;/code&gt; to navigate that history:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;*--- track cd history ------------------------------------------------*/&#xA;(defvar-local eshell-hist-dirs nil)&#xA;&#xA;(add-hook 'eshell-directory-change-hook&#xA;          (defun eshell-update-hist-dir ()&#xA;            (push (eshell/pwd) eshell-hist-dirs)&#xA;            (setq eshell-hist-index 0)))&#xA;&#xA;;;*--- navigate history ------------------------------------------------*/&#xA;(defvar-local eshell-hist-index 0)&#xA;&#xA;(defun eshell-forward (n)&#xA;  (unless eshell-hist-dirs&#xA;    (user-error &quot;eshell-hist-dirs is empty, cd a few times&quot;))&#xA;  (let ((dirs eshell-hist-dirs)&#xA;        (index (+ eshell-hist-index n)))&#xA;    (prog1 (eshell/cd (nth index dirs))&#xA;      (setq eshell-hist-dirs dirs&#xA;            eshell-hist-index index))))&#xA;&#xA;(defun eshell/b ()&#xA;  (eshell-forward 1))&#xA;&#xA;(defun eshell/f ()&#xA;  (eshell-forward -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;BTW, eshell's built-in &lt;code&gt;cd&lt;/code&gt; command already provides several ways to jump to history directories, for example, &lt;code&gt;cd -&lt;/code&gt; for the last directory, &lt;code&gt;cd -1&lt;/code&gt; for the penultimate directory and &lt;code&gt;cd =tmp&lt;/code&gt; for the last directory which contains &lt;code&gt;tmp&lt;/code&gt;. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/eshell/Built_002dins.html&quot; rel=&quot;nofollow&quot;&gt;(eshell) Built-ins&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2015-11-04T19:27:56.883" LastActivityDate="2015-11-04T19:27:56.883" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17862" PostTypeId="1" CreationDate="2015-11-04T19:19:21.620" Score="8" ViewCount="741" Body="&lt;p&gt;I know that I can add commands to eshell-visual-commands to for example make it so when I run &quot;top&quot; it runs in a temporary ansi-term buffer instead of the eshell buffer, so that programs that rely on complex terminal stuff work seamlessly with eshell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'd like them to work when using eshell's tramp integration too. So I can cd to another machine with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd /ssh:myuser@myhost:/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which then takes me to that machine, ls shows the right files, and everything working nice as long as I don't use a visual command. But as soon as I try to run top there I get a term buffer that's empty except for this output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;..: 1: exec: /ssh:myuser@myhost:/usr/bin/top: not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have verified /usr/bin/top exists on the machine, and that this happens even when using &lt;code&gt;emacs -Q&lt;/code&gt; so I think the issue is just that eshell-visual-commands assumes that whatever it gets back from running &quot;which top&quot; is what it should run in a term buffer, not understanding that that term buffer first needs to be ssh'd into the other machine. Has anybody else tackled making this work?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2015-11-06T16:19:57.117" LastActivityDate="2023-08-11T23:35:40.363" Title="eshell-visual-commands with tramp" Tags="|tramp|eshell|ssh|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17863" PostTypeId="1" CreationDate="2015-11-04T20:57:51.403" Score="8" ViewCount="1970" Body="&lt;p&gt;I use emacs in the terminal. One thing that I miss sometimes from a more traditional GUI editor are scrollbars. Sure, there's the percentage in the modeline, but sometimes you just want a visualization. Also, the percentage doesn't visualize how large the document is relative to the visible buffer like a scrollbar would.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are my options for scrollbars in terminal emacs? &lt;code&gt;scroll-bar-mode&lt;/code&gt; seems to be completely absent (I built emacs with &lt;code&gt;--without-x&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="118" LastActivityDate="2017-01-22T02:26:26.777" Title="What are my options for scroll bars in terminal emacs?" Tags="|terminal-emacs|scroll-bars|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17864" PostTypeId="2" ParentId="15231" CreationDate="2015-11-04T21:42:02.677" Score="7" Body="&lt;p&gt;You have to use &lt;code&gt;PROPERTIES&lt;/code&gt; for that. Try the following:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Handout #1&#xA;:PROPERTIES: &#xA;:EXPORT_OPTIONS: email:t&#xA;:END:&#xA;** Things&#xA;** More things&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;EDITED This does work, but only when &lt;code&gt;Export&lt;/code&gt; scope is set to &lt;code&gt;subtree&lt;/code&gt; and not &lt;code&gt;buffer&lt;/code&gt;. (Thanks to @michael-muldoon)&lt;/p&gt;&#xA;" OwnerUserId="6807" LastEditorUserId="6807" LastEditDate="2023-03-06T20:51:40.387" LastActivityDate="2023-03-06T20:51:40.387" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="17866" PostTypeId="1" AcceptedAnswerId="17890" CreationDate="2015-11-05T00:57:38.663" Score="32" ViewCount="10188" Body="&lt;p&gt;I've googled and read the FAQ and Wiki for Magit, but still unable to figure this out, all I find are answers about Windows...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure Magit to use my running ssh-agent session and don't ask for my password when doing a push.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running linux, and have the ssh-agent startup with my terminal and unlock my key then, which allows me to do git push, etc. without having me enter the password each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Env:&lt;br&gt;&#xA;Arch Linux&lt;br&gt;&#xA;Emacs 24.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ssh-agent with keys added, to unlock on first terminal opened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I meant using passphrase, you know for the ssh key, et al.&lt;br&gt;&#xA;And I'm pushing to Bitbucket, but I do believe the key problem is that Magit is not talking/recognizing my ssh-agent.&lt;br&gt;&#xA;Maybe there's some config to set, to tell it that I'm running it??&lt;/p&gt;&#xA;" OwnerDisplayName="user2234" LastEditorDisplayName="user2234" LastEditDate="2015-11-05T02:36:27.777" LastActivityDate="2017-04-20T23:13:41.390" Title="Magit, how to use system's ssh agent and don't ask for password" Tags="|magit|linux|ssh|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17867" PostTypeId="2" ParentId="17850" CreationDate="2015-11-05T02:14:39.733" Score="0" Body="&lt;p&gt;Here's some code that lets you run &lt;code&gt;M-x category-sort-this-buffer&lt;/code&gt; to sort the lines in the current buffer into specified categories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before evaluating it, you should change the &lt;code&gt;puthash&lt;/code&gt; calls categories-&gt;words to the categories and trigger words you want.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar categories-&amp;gt;words&#xA;  (let ((table (make-hash-table :test #'equal)))&#xA;    (puthash &quot;money&quot; (list &quot;buy&quot; &quot;pay&quot; &quot;purchase&quot;) table)&#xA;    (puthash &quot;contact&quot; (list &quot;phone&quot; &quot;call&quot; &quot;email&quot; &quot;reply&quot;) table)&#xA;    (puthash &quot;thing3&quot; (list &quot;the-rest&quot;) table)&#xA;    table))&#xA;&#xA;(defvar words-&amp;gt;categories&#xA;  (let ((table (make-hash-table :test #'equal)))&#xA;    (maphash (lambda (category words)&#xA;               (dolist (word words)&#xA;                 (puthash word category table)))&#xA;             categories-&amp;gt;words)&#xA;    table)&#xA;  &quot;A table mapping various words to the category they're in&quot;)&#xA;&#xA;(defun get-category-for-line (line)&#xA;  &quot;Return the category for LINE, defaulting to DEFAULT.&quot;&#xA;  (gethash (downcase (second (split-string line)))&#xA;           words-&amp;gt;categories&#xA;           &quot;uncategorized&quot;))&#xA;&#xA;(defun category-sort-this-buffer ()&#xA;  &quot;Sort this buffer by category&quot;&#xA;  (interactive)&#xA;  (let ((lines (split-string (buffer-string) &quot;\n&quot; t))&#xA;        (last-category nil))&#xA;    (erase-buffer)&#xA;    (dolist (new-line (cl-sort lines&#xA;                               #'string-lessp&#xA;                               :key #'get-category-for-line))&#xA;      (let ((current-category (get-category-for-line new-line)))&#xA;        (unless (equal last-category&#xA;                       current-category)&#xA;          (setq last-category current-category)&#xA;          (insert &quot;* &quot; current-category &quot;\n&quot;))&#xA;        (insert new-line &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It sets up two variables to hold the categories and words relationships, pulls the contents of the buffer out, sorts it, and puts the lines back in with category names. So your example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- buy tea&#xA;- call Anna&#xA;- Reply email to John&#xA;- pay bill 1&#xA;- phone Derick&#xA;- Reply to grad-pa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ends up as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* contact&#xA;- call Anna&#xA;- Reply email to John&#xA;- phone Derick&#xA;- Reply to grad-pa&#xA;* money&#xA;- buy tea&#xA;- pay bill 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this will, if a line doesn't have a category, be put in a category labeled &quot;uncategorized&quot;. You could change that in &lt;code&gt;#'category-sort-this-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="115" LastEditDate="2015-11-05T03:56:50.810" LastActivityDate="2015-11-05T03:56:50.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17868" PostTypeId="1" AcceptedAnswerId="17898" CreationDate="2015-11-05T03:40:00.903" Score="1" ViewCount="168" Body="&lt;p&gt;When an outline tree of headers &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* top 1&#xA;** something &#xA;** something &#xA;** something &#xA;*** something &#xA;**** something&#xA;***** something&#xA;****** something&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is exported, say, to html, org-mode produces a numerical outline as deep as the options are set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. top&#xA;1.1. something&#xA;1.2. something &#xA;1.3. something&#xA;1.3.1. something&#xA;1.3.1.1. something &#xA;1.3.1.1.1. something &#xA;1.3.1.1.1.1. something &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, is there any way to actually capture that outline numeration for use in the original buffer? I'm thinking I would like to make a sort of tags or custom_id  system based on these numbers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* top :1:&#xA;** something :1.1:&#xA;** something :1.2:&#xA;** something :1.3:&#xA;*** something :1.3.1:&#xA;**** something :1.3.1.1:&#xA;***** something :1.3.1.1.1:&#xA;****** something :1.3.1.1.1.1:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would also be nice if org-mode simply used these numbers in the original buffer instead of stars.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2015-11-06T09:16:31.497" Title="org-mode: Capture and use export header numbering?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17869" PostTypeId="1" CreationDate="2015-11-05T06:38:35.563" Score="4" ViewCount="787" Body="&lt;p&gt;I am using org mode to write blogs, after publishing the project, I found the &#xA;titles of the html has an line number before it. as below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uZcCJ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uZcCJ.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the original org file:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/1pdOq.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1pdOq.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't like this. Is there a way to eliminate the number before title after exporting to html?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this is my publish config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-publish-project-alist&#xA;  '((&quot;github-blog&quot;&#xA; :base-directory &quot;/Users/blog/org/post/&quot;&#xA; :publishing-directory &quot;/Users/blog/_posts/&quot;&#xA; :prepare-function nil&#xA; :completion-function nil&#xA; :exclude &quot;*.html&quot;&#xA; :recursive nil&#xA; :base-extension &quot;org&quot;&#xA; :publishing-function org-html-publish-to-html&#xA; :section-number nil&#xA; :headline-levels nil&#xA; :body-only t&#xA; )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9884" LastEditorUserId="9884" LastEditDate="2015-11-05T07:04:11.387" LastActivityDate="2015-11-30T02:17:16.363" Title="How to eliminate the html headline number?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17870" PostTypeId="1" CreationDate="2015-11-05T07:42:30.007" Score="3" ViewCount="230" Body="&lt;p&gt;I am using Emacs for OSX 24.4 on El Capitan. I am writing a text in Devanagari in LaTeX mode, which I compile using the XeTeX engine. I have changed the font set for Devanagari to Sanskrit 2003 in Emacs. While most characters (including complex ones) are displayed correctly, some simple ones are only displayed &quot;half&quot;. For example, only the &lt;strong&gt;left half&lt;/strong&gt;  (about the middle vertical line) of the character के is displayed in Emacs! (Sorry! Couldn't figure out how to load an image). This is also true for कं, फे, फं, कु, फु etc. का, फा etc. display correctly. When I place my cursor immediately to the right of these characters which display incorrectly, I see the negative of the un-displayed half in the background. Can anyone please tell me what is going on and how to correct it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: This is not a font problem as Sanskrit 2003 is a very extensive font for Devanagari and works fine elsewhere. I have also tried other Devanagari fonts by changing the font set in my .emacs file and the problem persists.&lt;/p&gt;&#xA;" OwnerUserId="10050" LastActivityDate="2015-11-05T07:42:30.007" Title="Emacs not displaying some Devanagari characters correctly" Tags="|fonts|display|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17871" PostTypeId="2" ParentId="17869" CreationDate="2015-11-05T11:43:48.773" Score="4" Body="&lt;p&gt;file specific option: #+OPTIONS: num:nil&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may customize &quot;org-export-with-section-numbers&quot; to change the option globally, say: &quot;(setq org-export-with-section-numbers nil)&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is document of it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-export-with-section-numbers is a variable defined in `ox.el'.&#xA;Its value is t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation:&#xA;Non-nil means add section numbers to headlines when exporting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When set to an integer n, numbering will only happen for&#xA;headlines whose relative level is higher or equal to n.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This option can also be set with the OPTIONS keyword,&#xA;e.g. &quot;num:t&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;" OwnerUserId="9670" LastEditorUserId="9670" LastEditDate="2015-11-30T02:17:16.363" LastActivityDate="2015-11-30T02:17:16.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17872" PostTypeId="1" CreationDate="2015-11-05T13:01:46.193" Score="6" ViewCount="1520" Body="&lt;p&gt;When I do &lt;code&gt;M-x compile&lt;/code&gt;, emacs will split my window to launch compilation and show its logs in a new window. As I understand, it has some algorithm to decide how to split the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, when I have just one window with code opened on my big monitor, for some reason, instead of more-convenient horizontal split (showing compile-log side-by-side on the right and code on left), it splits window vertically. How could that be tweaked? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="10053" LastActivityDate="2021-01-13T13:10:51.407" Title="Algorithm on deciding splitting vertically or horizontally" Tags="|window-splitting|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17873" PostTypeId="1" CreationDate="2015-11-05T13:12:53.553" Score="5" ViewCount="143" Body="&lt;p&gt;&lt;a href=&quot;http://www.red-lang.org/&quot; rel=&quot;noreferrer&quot;&gt;Red&lt;/a&gt; and &lt;a href=&quot;http://www.rebol.com/docs/core23/rebolcore-3.html#section-2.6&quot; rel=&quot;noreferrer&quot;&gt;Rebol&lt;/a&gt; have multiline strings that start with &lt;code&gt;{&lt;/code&gt; and end with &lt;code&gt;}&lt;/code&gt;. Reading through Elisp docs I don't see any simple way to define this in the syntax table. The string quotes class matches the same character only and the generic string delimiters class wouldn't work correctly either.&lt;/p&gt;&#xA;" OwnerUserId="10054" LastActivityDate="2015-11-05T13:12:53.553" Title="Paired string delimiters?" Tags="|syntax-highlighting|string|syntax-table|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17874" PostTypeId="1" AcceptedAnswerId="17876" CreationDate="2015-11-05T13:34:13.747" Score="1" ViewCount="331" Body="&lt;p&gt;I run emacs using a server and multiple clients on both, the graphical display and the terminal.&#xA;&lt;br&gt;To use the same configuration files for terminal and graphical display, I used &lt;a href=&quot;https://emacs.stackexchange.com/a/16435/4025&quot;&gt;this&lt;/a&gt; solution.&#xA;&lt;br&gt;&lt;br&gt;The issue is, on starting a new emacs client, the &lt;code&gt;fullscreen&lt;/code&gt; function gets called on all the already running clients too, and causes a very unwanted behaviour which sometimes throws up errors too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;display-graphic-p&lt;/code&gt; function doc says, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(display-graphic-p &amp;amp;optional DISPLAY)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return non-nil if DISPLAY is a graphic display. Graphical displays are&#xA;  those which are capable of displaying several frames and several&#xA;  different fonts at once.  This is true for displays that use a window&#xA;  system such as X, and false for text-only terminals. DISPLAY can be a&#xA;  display name, a frame, or nil (meaning the selected frame's display).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think my issue can be resolved by specifically calling the fullscreen function on the selected frame's display. So, my question is, &lt;em&gt;how to obtain the name of the current display?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="4025" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2022-01-28T11:26:18.977" Title="Find the name of the graphical display emacs is running on" Tags="|init-file|frames|display|fullscreen|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17875" PostTypeId="2" ParentId="17872" CreationDate="2015-11-05T14:22:30.123" Score="5" Body="&lt;p&gt;&lt;code&gt;C-h v split-width-threshold RET&lt;/code&gt; should give you some useful info about that.  There's also &lt;code&gt;split-height-threshold&lt;/code&gt;, of course.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-11-05T14:22:30.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17876" PostTypeId="2" ParentId="17874" CreationDate="2015-11-05T14:37:36.403" Score="2" Body="&lt;p&gt;After digging into &lt;code&gt;get-device-terminal&lt;/code&gt; it looks like it's the same as the &lt;code&gt;device&lt;/code&gt; or &lt;code&gt;tty&lt;/code&gt; frame property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the documentation, it's the X11 display name &lt;code&gt;HOST.SERVER.SCREEN&lt;/code&gt;. On MS-windows it's simply the string &lt;code&gt;&quot;w32&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-05T14:37:36.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17877" PostTypeId="2" ParentId="17872" CreationDate="2015-11-05T14:51:18.230" Score="6" Body="&lt;p&gt;The function that splits the window is &lt;code&gt;split-window-sensibly&lt;/code&gt;, which can be tweaked by &lt;code&gt;split-width-threshold&lt;/code&gt; and &lt;code&gt;split-height-threshold&lt;/code&gt;, as Stefan suggested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can tell Emacs to use a different function to split the window by setting &lt;code&gt;split-window-preferred-function&lt;/code&gt; (the default is &lt;code&gt;split-window-sensibly&lt;/code&gt;). For more details see &lt;code&gt;C-h v split-window-sensibly RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-11-05T14:51:18.230" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17878" PostTypeId="1" CreationDate="2015-11-05T15:23:09.330" Score="0" ViewCount="81" Body="&lt;p&gt;I want to change keywords colors of the AUCTeX package. I found the variable &lt;code&gt;font-latex-built-in-keyword-classes&lt;/code&gt; that could help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If me assume I want to display the keyword &quot;newpage&quot; with the face &lt;code&gt;new-face&lt;/code&gt;, I've (unsuccessfully) tried that :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq font-latex-built-in-keyword-classes&#xA;  '((&quot;warning&quot;&#xA;     (&quot;newpage&quot;)&#xA;     'new-face 1 noarg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't change nothing. How can I do that ?&lt;/p&gt;&#xA;" OwnerUserId="10056" LastEditorUserId="105" LastEditDate="2016-03-14T04:48:58.433" LastActivityDate="2016-03-14T04:48:58.433" Title="Change keywords faces in AUCTeX" Tags="|auctex|faces|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17879" PostTypeId="2" ParentId="17783" CreationDate="2015-11-05T15:43:34.890" Score="22" Body="&lt;h1&gt;Op-ed: Windows is just slow.&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I regularly use Emacs on both Windows (Cygwin and native) and GNU/Linux (Arch), and I've noticed this as well. I believe the answer is that Linux is just plain faster than Windows in a lot of areas, most notably in file system operations&lt;a href=&quot;http://www.slideshare.net/PrincipledTechnologies/comparing-file-system-performance-red-hat-enterprise-linux-6-vs-microsoft-windows-server-2012&quot; rel=&quot;noreferrer&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt; and threading/forking operations&lt;a href=&quot;https://stackoverflow.com/questions/12878980/speed-performance-of-a-qt-program-windows-vs-linux&quot;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the difference in performance is most noticeably exemplified when using git, and especially Magit (since it runs quite a few commands for its status buffer). Git is horrendously slow on Windows. It's so slow, in fact, that I often edit code on Windows in my Dropbox folder, wait for it to be synced to my Linux VPS, and then use Magit via SSH, instead of simply using it on Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing &lt;code&gt;time git status&lt;/code&gt; on the Emacs master branch takes an average 0.025 seconds on Arch for me. On Windows (native), it takes 0.075-0.100 seconds, Windows (cygwin) 0.200 seconds. That may not seem like much, but that means it's 3-4x slower on Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should also note that certain anti-virus software (McAfee, in particular) can cause massive slowdowns. With McAfee's On-Access Scanner enabled, things are a noticeably slower for me. Cygwin's &lt;code&gt;git status&lt;/code&gt; can take up to 2 minutes! Only after turning it off do I get the times I stated above.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Aside: I just found the variable &lt;code&gt;magit-refresh-verbose&lt;/code&gt;, which times the status refreshes. Here are some times for a refresh of the &lt;code&gt;magit-status&lt;/code&gt; buffer on the Emacs master branch:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Windows (native)&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570&#xA;Magit 20151028.1649, Git 2.6.1.windows.1, Emacs 24.5.1&#xA;Refreshing buffer `*magit: emacs'...done (9.317s)&#xA;Refreshing buffer `*magit: emacs'...done (9.318s)&#xA;Refreshing buffer `*magit: emacs'...done (9.357s)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Windows (cygwin)&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.0.50.1 (i686-pc-cygwin) of 2015-07-29 on NAND-LT&#xA;Magit 20151015.22, Git 2.5.0.234.gefc8a62, Emacs 25.0.50.1&#xA;Refreshing buffer `*magit: emacs'...done (4.609s)&#xA;Refreshing buffer `*magit: emacs'...done (4.720s)&#xA;Refreshing buffer `*magit: emacs'...done (4.626s)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;GNU/Linux (Arch, worse hardware, VPS)&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.0.50.6 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.2) of 2015-10-26&#xA;Magit 20151028.1649, Git 2.6.2, Emacs 25.0.50&#xA;Refreshing buffer ‘*magit: emacs’...done (0.517s)&#xA;Refreshing buffer ‘*magit: emacs’...done (0.507s)&#xA;Refreshing buffer ‘*magit: emacs’...done (0.523s)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Cygwin's faster speed surprised me. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.slideshare.net/PrincipledTechnologies/comparing-file-system-performance-red-hat-enterprise-linux-6-vs-microsoft-windows-server-2012&quot; rel=&quot;noreferrer&quot;&gt;http://www.slideshare.net/PrincipledTechnologies/comparing-file-system-performance-red-hat-enterprise-linux-6-vs-microsoft-windows-server-2012&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/12878980/speed-performance-of-a-qt-program-windows-vs-linux&quot;&gt;https://stackoverflow.com/questions/12878980/speed-performance-of-a-qt-program-windows-vs-linux&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="654" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-11-05T16:42:23.770" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17880" PostTypeId="1" AcceptedAnswerId="17881" CreationDate="2015-11-05T17:10:43.273" Score="4" ViewCount="269" Body="&lt;p&gt;I am new to emacs and would like to make a simple function to automate a series of commands I use repeatedly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;auto-fill-mode&lt;/code&gt; after I edit the text I often need to re-wrap the lines. (I am writing in LaTeX with each sentence starting on a new line.) To do this I type &lt;code&gt;M-a&lt;/code&gt;,&lt;code&gt;C-SPC&lt;/code&gt;,&lt;code&gt;M-e&lt;/code&gt;,&lt;code&gt;M-q&lt;/code&gt;. This is equivalent to &lt;code&gt;backward-sentence&lt;/code&gt;, &lt;code&gt;set-mark-command&lt;/code&gt;, &lt;code&gt;forward-sentence&lt;/code&gt;, &lt;code&gt;fill-region&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I wrap these together in one simple command? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my non-working attempt:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun fill-sentence()&#xA;  &quot;In auto-fill mode, select current sentence and re-wrap it.&quot;&#xA;  (interactive)&#xA;  ((backward-sentence)&#xA;   (set-mark-command)&#xA;   (forward-sentence)&#xA;   (fill-region)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9530" LastEditorUserId="9530" LastEditDate="2015-11-05T19:02:00.853" LastActivityDate="2015-11-05T19:02:00.853" Title="Simple fill-sentence function" Tags="|functions|auto-fill-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17881" PostTypeId="2" ParentId="17880" CreationDate="2015-11-05T17:25:31.937" Score="4" Body="&lt;p&gt;Based on the docstrings of the commands, you probably want something along the lines of:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fill-sentence ()&#xA;  (interactive)&#xA;  ;; optional &#xA;  ;; (save-excursion&#xA;  (backward-sentence)&#xA;  (push-mark)&#xA;  (forward-sentence)&#xA;  (fill-region (point) (mark))&#xA;  ;; )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The optional save-excursion (and commented &lt;code&gt;)&lt;/code&gt;) will keep the point where you started (so can be used mid-change to keep track of wrapping without breaking flow).&lt;/p&gt;&#xA;" OwnerUserId="337" LastActivityDate="2015-11-05T17:25:31.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17883" PostTypeId="1" CreationDate="2015-11-05T20:02:03.610" Score="1" ViewCount="242" Body="&lt;p&gt;From the Magit docs:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Furthermore the old dependencies &lt;code&gt;git-commit-mode&lt;/code&gt; and &lt;code&gt;git-rebase-mode&lt;/code&gt; have to be removed because they are no longer used by the &lt;code&gt;2.1.0&lt;/code&gt; release and later, and get in the way of their successors &lt;code&gt;git-commit&lt;/code&gt; and &lt;code&gt;git-rebase&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have a lot of machines that have these old packages lying around. Is there any way I can teach &lt;code&gt;magit&lt;/code&gt; to automatically clean them up?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="337" LastEditDate="2015-11-06T12:18:50.057" LastActivityDate="2015-11-06T12:18:50.057" Title="Automate the removal of git-rebase-mode and git-commit-mode" Tags="|package|magit|emacs24|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17885" PostTypeId="1" AcceptedAnswerId="17886" CreationDate="2015-11-05T22:20:05.760" Score="6" ViewCount="769" Body="&lt;p&gt;Say you would for instance define 5 variables with multiple cursors and you wanted to name them x_i where i ∈ {1,2,3,4,5}. Instead of writing 5 rows with x_ and then filling the rest manually, is there any way this could be done with multiple cursors? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. like &lt;a href=&quot;https://github.com/duydao/Text-Pastry&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/duydao/Text-Pastry&lt;/a&gt; for sublime.&lt;/p&gt;&#xA;" OwnerUserId="10061" LastActivityDate="2019-02-14T14:40:25.327" Title="Enumerating with multiple cursors?" Tags="|multiple-cursors|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17886" PostTypeId="2" ParentId="17885" CreationDate="2015-11-05T22:34:17.697" Score="14" Body="&lt;p&gt;&lt;strong&gt;Yes&lt;/strong&gt;, it's possible with &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7APcU.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7APcU.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let's say you have atleast 5 consecutive empty lines.&lt;/li&gt;&#xA;&lt;li&gt;With the cursor at the topmost empty line, create 5 multiple cursors by keeping on hitting &lt;code&gt;C-&amp;gt;&lt;/code&gt; (default binding for &lt;code&gt;mc/mark-next-like-this&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Type the common variable prefix: &lt;code&gt;x_&lt;/code&gt; as per your example.&lt;/li&gt;&#xA;&lt;li&gt;Insert numbers starting with the prefix you specify (default starting number is &lt;code&gt;0&lt;/code&gt;) to &lt;code&gt;mc/insert-numbers&lt;/code&gt;. For your example, you would do &lt;code&gt;C-u 1 M-x mc/insert-numbers&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;C-g&lt;/code&gt; or &lt;code&gt;RET&lt;/code&gt; to exit multiple cursors mode.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Alternative way using the &lt;a href=&quot;https://github.com/abo-abo/tiny&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;tiny&lt;/code&gt;&lt;/a&gt; package&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;m1\n5|x_%d&lt;/code&gt; and &lt;code&gt;M-x tiny-expand&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The best part is that you can &lt;code&gt;undo&lt;/code&gt; and get back to that expression, tweak it, &lt;code&gt;M-x tiny-expand&lt;/code&gt;, repeat, ..&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tiny&lt;/code&gt; syntax &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-tiny.el&quot; rel=&quot;noreferrer&quot;&gt;cheat-sheet&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mBSEO|F&#xA; ││││--&#xA; │││││└──&amp;gt; (optional) Format - %x | 0x%x | %c | %s | %(+ x x) | %014.2f | %03d &#xA; ││││└───&amp;gt; (optional) Pipe character used if Format specified for reading clarity&#xA; │││└────&amp;gt; (optional) Lisp Operation - *xx | (* x x) | (+ x ?A) | *2+3x | (* 2 (+ 3 x))&#xA; ││└─────&amp;gt; End value&#xA; │└──────&amp;gt; (optional) Separator - Space | , | \n (default=Space)&#xA; └───────&amp;gt; (optional) Begin value (default=0)&#xA;- No space allowed between 'm' and 'B'&#xA;- No space allowed between 'E' and 'O'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-11-05T23:03:48.240" LastActivityDate="2015-11-05T23:03:48.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17887" PostTypeId="1" CreationDate="2015-11-05T22:55:33.683" Score="34" ViewCount="17313" Body="&lt;p&gt;I would like emacs to switch to &lt;code&gt;gnuplot-mode&lt;/code&gt; when I open a file ending in &lt;code&gt;.g&lt;/code&gt; or &lt;code&gt;.gnuplot&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; gnuplot mode-name&#xA;(add-to-list 'gnuplot-mode '(&quot;\\.g\\'&quot; . gnuplot-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; gnuplot mode-name&#xA;(add-to-list 'gnuplot '(&quot;\\.g\\'&quot; . gnuplot))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Neither works.  How do I make Emacs behave this way?&lt;/p&gt;&#xA;" OwnerUserId="9653" LastEditorUserId="253" LastEditDate="2015-11-06T13:03:56.377" LastActivityDate="2018-11-06T14:43:18.280" Title="How do I associate a file extension with a specific mode?" Tags="|major-mode|" AnswerCount="1" CommentCount="1" ClosedDate="2015-11-06T16:39:30.980" ContentLicense="CC BY-SA 3.0" />
  <row Id="17888" PostTypeId="2" ParentId="17887" CreationDate="2015-11-05T23:48:40.710" Score="34" Body="&lt;p&gt;The full syntax for specifying file extensions for gnuplot-mode is: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.g\\'&quot; . gnuplot-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The other point to verify is that you are using Bruce Ravel's recent (year 2012) implementation of &lt;a href=&quot;https://github.com/bruceravel/gnuplot-mode&quot; rel=&quot;noreferrer&quot;&gt;gnuplot-mode&lt;/a&gt;. This is a separate MELPA package that requires gnuplot version 4.4 and higher. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly avoid gnuplot-mode files that come pre-packaged with gnuplot itself. They have not been kept compatible with newer emacs versions.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="1979" LastEditDate="2018-11-06T14:43:18.280" LastActivityDate="2018-11-06T14:43:18.280" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17889" PostTypeId="1" AcceptedAnswerId="17891" CreationDate="2015-11-06T03:10:45.633" Score="1" ViewCount="689" Body="&lt;p&gt;I recently reinstalled emacs after some technical difficulties. I managed to keep some of my personal configuration files, which I believe may have caused an issue. As I went to install packages, I discovered that each non-installed package had a duplicate. I figure this is due to remnant from when I transferred my data over, but I am unsure as to exactly what.&lt;/p&gt;&#xA;" OwnerUserId="10062" LastActivityDate="2015-11-06T03:34:07.483" Title="Package duplicates in emacs package manager" Tags="|package|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17890" PostTypeId="2" ParentId="17866" CreationDate="2015-11-06T03:17:15.113" Score="18" Body="&lt;p&gt;Well this turned out to be more of a rabbit hole than I though... And for what I can gather there's not a better solution for this specific issue, with this combination of desktop, ssh-agent, emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem 1&lt;/strong&gt;&lt;br&gt;&#xA;XFCE was starting it's own ssh-agent with the session, without actually saying so anywhere, which caused the system to have 1 unused global ssh-agent, and my shell specific unlocked agent.&lt;br&gt;&#xA;On a different DE you might run with the same problem, and will need to find the specifics to disable the agent auto start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution 1&lt;/strong&gt;&lt;br&gt;&#xA;Run this command to disable the startup ssh-agent from executing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem 2&lt;/strong&gt;&lt;br&gt;&#xA;Now Emacs does not have any &lt;strong&gt;SSH_AGENT_PID&lt;/strong&gt; and &lt;strong&gt;SSH_AUTH_SOCK&lt;/strong&gt; variables set, so nothing on the loaded environment. Obviously Magit still asks for the key as it doesn't know about the new &lt;strong&gt;ssh-agent&lt;/strong&gt; we started.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution 2&lt;/strong&gt;&lt;br&gt;&#xA;We need to have Emacs fetch up these new variables from the enviroment, but of course, no straight forward way.&lt;br&gt;&#xA;Enter: &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot;&gt;exec-path-from-shell&lt;/a&gt; that allows you to fetch environment variables from your shell.&#xA;So.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the &lt;strong&gt;&lt;em&gt;exec-path-from-shell&lt;/em&gt;&lt;/strong&gt; package in your preferred way.&lt;/li&gt;&#xA;&lt;li&gt;Add the following code to your &lt;strong&gt;init.el&lt;/strong&gt; so that it loads when you start Emacs.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'exec-path-from-shell)&#xA;(exec-path-from-shell-copy-env &quot;SSH_AGENT_PID&quot;)&#xA;(exec-path-from-shell-copy-env &quot;SSH_AUTH_SOCK&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks guys for the suggestion on looking at the SSH_** variables, that pointed me on the right direction.&lt;/p&gt;&#xA;" OwnerDisplayName="user2234" LastActivityDate="2015-11-06T03:17:15.113" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17891" PostTypeId="2" ParentId="17889" CreationDate="2015-11-06T03:34:07.483" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;each non-installed package had a duplicate&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's because you have &lt;a href=&quot;https://emacs.stackexchange.com/q/268/115&quot;&gt;multiple package repositories&lt;/a&gt; added to the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Package-Archives.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;package-archives&lt;/code&gt;&lt;/a&gt; list. It is OK for a package to be present in multiple repositories, say GNU Elpa and Melpa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;Archive&lt;/em&gt; column in the &lt;em&gt;Package Menu&lt;/em&gt; buffer indicates the archive name like &lt;em&gt;gnu&lt;/em&gt; (GNU Elpa), &lt;em&gt;melpa&lt;/em&gt; (Melpa), &lt;em&gt;marmalade&lt;/em&gt; (Marmalade). You, the user, can choose which version of the package to install.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you sure &lt;em&gt;each&lt;/em&gt; non-installed package has a duplicate? Or is it many of them?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On another note, if you are re-installing emacs and you already have an emacs config, it might be a good idea to remove the &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; directory (&lt;strong&gt;IF&lt;/strong&gt; you maintain a list of all the packages you installed). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This step will get rid of all the duplicate package rows that appear with the &lt;strong&gt;&lt;em&gt;obsolete&lt;/em&gt;&lt;/strong&gt; tag (if any) that showed up in the Archive column in &lt;em&gt;Package Menu&lt;/em&gt; buffer (&lt;code&gt;M-x list-packages&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;See also:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Package Installation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Menu.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Package Menu&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-11-06T03:34:07.483" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17892" PostTypeId="2" ParentId="17883" CreationDate="2015-11-06T05:22:56.990" Score="1" Body="&lt;p&gt;This should be your package manager's duty, not magit, if you are using &lt;code&gt;package.el&lt;/code&gt; on Emacs 25, you can try &lt;code&gt;package-autoremove&lt;/code&gt;. From &lt;code&gt;C-h f package-autoremove&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(package-autoremove)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Remove packages that are no more needed.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Packages that are no more needed by other packages in&#xA;  ‘package-selected-packages’ and their dependencies will be deleted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is a post from Artur Malabarba on this: &lt;a href=&quot;http://endlessparentheses.com/new-in-package-el-in-emacs-25-1-better-dependency-management.html&quot; rel=&quot;nofollow&quot;&gt;http://endlessparentheses.com/new-in-package-el-in-emacs-25-1-better-dependency-management.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-11-06T05:22:56.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17894" PostTypeId="1" AcceptedAnswerId="18197" CreationDate="2015-11-06T05:49:28.087" Score="0" ViewCount="775" Body="&lt;p&gt;If I create a new org-journal entry, the entry will open with an Org-mode bullet and a timestamp. If I already have a journal entry open though, is there a way to add a new bullet and timestamp from within the entry? I did not see any mention of that, but I figure it would not be very hard.&lt;/p&gt;&#xA;" OwnerUserId="6822" LastActivityDate="2016-10-15T17:38:16.807" Title="Org-journal create a new bullet with timestamp within the existing journal entry" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17895" PostTypeId="2" ParentId="17883" CreationDate="2015-11-06T05:58:36.867" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/20541322/how-to-remove-installed-elpa-package&quot;&gt;https://stackoverflow.com/questions/20541322/how-to-remove-installed-elpa-package&lt;/a&gt; suggests simply removing the package directories from your disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;package-delete&lt;/code&gt; is undocumented in Emacs 24, but seems to do the same thing (as well as removing any &lt;code&gt;.signed&lt;/code&gt; file corresponding to the deleted package).&lt;/p&gt;&#xA;" OwnerUserId="2057" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-11-06T06:29:30.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17896" PostTypeId="1" CreationDate="2015-11-06T06:19:54.763" Score="1" ViewCount="47" Body="&lt;p&gt;I use appt with org-mode to warn me when is time to do something scheduled. I have one repetitive task schedule to be checked and done once per week, but there is a possibility that I may not turn on my laptop such day, hence that task may not be checked and done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if I can make appt-mode remind me about tasks been leaved in the past without being checked, how can I achieve that? &lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="2710" LastEditDate="2015-11-13T08:13:49.573" LastActivityDate="2015-11-13T08:13:49.573" Title="How can I tell appt to warn me about tasks not done in the past?" Tags="|org-agenda|appt|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17897" PostTypeId="1" CreationDate="2015-11-06T06:38:50.323" Score="5" ViewCount="2684" Body="&lt;p&gt;I was just wondering if there is a way to create a standard set of sections for my daily journal entry. So if I want a section for Todos, and another section for meetings, etc. Is it possible to just create a standard template in emacs that gets built when a new journal file is created?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATED TO CLARIFY:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just wanted to clarify any ambiguity. Org-journal will create a new empty journal file for each day. The file is usually named with the date, so &quot;20151106&quot;. The file is empty when it is created. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I wanted to create a set of org bulletted sections that were created in the new file. So they should include:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Tasks&lt;/li&gt;&#xA;&lt;li&gt;Exercise&lt;/li&gt;&#xA;&lt;li&gt;Meal Plan&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That way I don't have to manually create these each time a new journal entry is created.&lt;/p&gt;&#xA;" OwnerUserId="6822" LastEditorUserId="6822" LastEditDate="2015-11-06T22:32:21.997" LastActivityDate="2017-05-08T05:37:05.740" Title="Create an org-journal template for daily journal entry" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17898" PostTypeId="2" ParentId="17868" CreationDate="2015-11-06T09:16:31.497" Score="2" Body="&lt;p&gt;Well, it would be a bit silly to have to export it to an html file and then read the result back in just to parse out the headline numbers. What you can do instead is call the functions that parse the buffer and use that information to add the tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know the org source code very well, but it's usually pretty easy to get started with these things. I first double checked the manual to see how you actually start an html export (I don't export my org mode files, so I couldn't remember). As usual, the manual gives both the key sequence and the function name, so I started by looking at the help for this function: &lt;code&gt;C-h f org-html-export-to-html&lt;/code&gt;. This help buffer includes a link to the source code, so I followed it. This function calls &lt;code&gt;org-export-to-file&lt;/code&gt;, which is longer, so I just skimmed it. After setting some variables and checking some conditions, it calls &lt;code&gt;org-export-as&lt;/code&gt;. Several steps later I found &lt;code&gt;org-export-collect-tree-properties&lt;/code&gt;. This appears to be the function you want; it can collect the headline numbers for you; if the second argument is &lt;code&gt;'(:headline-numbering)&lt;/code&gt; it'll return exactly that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course it doesn't operate on the buffer directly, it looks like you have to first parse the buffer with &lt;code&gt;org-element-parse-buffer&lt;/code&gt; first; this examines the current buffer and parses it to build an AST.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you've called &lt;code&gt;org-export-collect-tree-properties&lt;/code&gt; you'll have an alist mapping headlines to headline-numbers and can go to each headline and add/remove tags as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's about as far as I can go at so late an hour, but it should be enough to get you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for using numbered headlines from the get-go, the problem then becomes one of renumbering everything whenever you move nodes around. Using unordered symbols such as asterisks eliminates that headache.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-06T09:16:31.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17899" PostTypeId="2" ParentId="17897" CreationDate="2015-11-06T16:07:24.567" Score="1" Body="&lt;p&gt;Updated answer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a capture template that will get you started. You may want to change &lt;code&gt;org-directory&lt;/code&gt; into the directory where you want to store the journal files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates '((&quot;j&quot; &quot;Journal&quot; entry (file&#xA;                                                (expand-file-name (concat (format-time-string &quot;%Y%m%d&quot;) &quot;.org&quot;) org-directory))&#xA;                           &quot;* Tasks%?\n* Exercise\n* Meal plan&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="-1" LastEditDate="2015-11-07T23:16:17.573" LastActivityDate="2015-11-07T23:16:17.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17900" PostTypeId="2" ParentId="8036" CreationDate="2015-11-06T16:11:20.253" Score="1" Body="&lt;p&gt;If you set tags-table-list, do not also set ‘tags-file-name’.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover if your TAGS file name is &quot;TAGS&quot; you can only write the directory path:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tags-table-list (list &quot;~/trunk/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-11-06T16:11:20.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17901" PostTypeId="1" AcceptedAnswerId="17910" CreationDate="2015-11-06T16:24:29.493" Score="1" ViewCount="1308" Body="&lt;p&gt;After having upgraded a computer from Ubuntu 15.04 to 15.10 the colors in Emacs (which I run in the terminal with &lt;code&gt;--no-window-system&lt;/code&gt;) have changed substantially and some text is now illegible. I would like to find out to change the colors back to how they were.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;After. Output of &lt;code&gt;M-x customize-create-theme&lt;/code&gt; in a 15.10 terminal (some faces change only the background leading to illegible text):&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/28qDH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/28qDH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Before. Output of &lt;code&gt;M-x customize-create-theme&lt;/code&gt; in a 15.04 terminal: (both foreground and background are changed)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UluGk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UluGk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some investigation has led me to believe that the problem lies with having upgraded the terminal or some related application rather than Emacs: I installed version 24.5 from source on two computers, one running 15.04 and the other 15.10, and ran &lt;code&gt;emacs -q -nw&lt;/code&gt; in various configurations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;On the 15.04 install, the colors are &quot;right&quot;&lt;/li&gt;&#xA;&lt;li&gt;On the 15.10 install, the colors are &quot;wrong&quot;&lt;/li&gt;&#xA;&lt;li&gt;SSH from 15.04 terminal to run the 15.10 install, the colors are &quot;right&quot;&lt;/li&gt;&#xA;&lt;li&gt;SSH from 15.10 terminal to run the 15.04 install, the colors are &quot;wrong&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So I'm guessing that the terminal is providing some information to Emacs about what colors it should use, but I can't work out any more than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me to understand how the OS and terminal can affect Emacs' color scheme, and what I might be able to change to get the old colors back?&lt;/p&gt;&#xA;" OwnerUserId="7189" LastActivityDate="2017-03-18T15:42:22.287" Title="Colors illegible after upgrading OS" Tags="|terminal-emacs|colors|term|ubuntu|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17902" PostTypeId="1" CreationDate="2015-11-06T16:54:59.473" Score="0" ViewCount="206" Body="&lt;p&gt;I am looking for a pure elisp email program to examine and potentially modify.&lt;/p&gt;&#xA;" OwnerUserId="10067" LastEditorUserId="105" LastEditDate="2016-03-14T04:48:25.370" LastActivityDate="2016-05-04T00:25:51.373" Title="Which, if any, of the emacs email programs is written exclusively in elisp?" Tags="|email|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17903" PostTypeId="2" ParentId="14852" CreationDate="2015-11-06T17:00:46.657" Score="1" Body="&lt;p&gt;The following is an example of how to examine the text-properties of the items being generated by &lt;code&gt;org-agenda-list&lt;/code&gt;, and modify the string based on certain criteria.  In this example, the value of the text property &lt;code&gt;ts-date&lt;/code&gt; is obtained and compared against the current date -- if it is overdue, we add &lt;code&gt;OLD:&lt;/code&gt;; if it is current, we add &lt;code&gt;CURRENT:&lt;/code&gt;, if its future, we add &lt;code&gt;FUTURE:&lt;/code&gt;.  The original poster can customize this example add a new line and/or a divider line at select locations.  The customization may vary depending upon the sorting criteria chosen by the original poster in the &lt;code&gt;org-agenda-sorting-strategy&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example, the function &lt;code&gt;org-agenda-finalize-entries&lt;/code&gt; has been modified near the bottom between the sections labeled &lt;code&gt;;; BEGIN modification&lt;/code&gt; and &lt;code&gt;;; END modification&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org-agenda)&#xA;&#xA;(defun org-agenda-finalize-entries (list &amp;amp;optional type)&#xA;  &quot;Sort, limit and concatenate the LIST of agenda items.&#xA;The optional argument TYPE tells the agenda type.&quot;&#xA;  (let ((max-effort (cond ((listp org-agenda-max-effort)&#xA;         (cdr (assoc type org-agenda-max-effort)))&#xA;        (t org-agenda-max-effort)))&#xA;  (max-todo (cond ((listp org-agenda-max-todos)&#xA;       (cdr (assoc type org-agenda-max-todos)))&#xA;      (t org-agenda-max-todos)))&#xA;  (max-tags (cond ((listp org-agenda-max-tags)&#xA;       (cdr (assoc type org-agenda-max-tags)))&#xA;      (t org-agenda-max-tags)))&#xA;  (max-entries (cond ((listp org-agenda-max-entries)&#xA;          (cdr (assoc type org-agenda-max-entries)))&#xA;         (t org-agenda-max-entries))) l)&#xA;    (when org-agenda-before-sorting-filter-function&#xA;      (setq list&#xA;      (delq nil&#xA;      (mapcar&#xA;       org-agenda-before-sorting-filter-function list))))&#xA;    (setq list (mapcar 'org-agenda-highlight-todo list)&#xA;    list (mapcar 'identity (sort list 'org-entries-lessp)))&#xA;    (when max-effort&#xA;      (setq list (org-agenda-limit-entries&#xA;      list 'effort-minutes max-effort 'identity)))&#xA;    (when max-todo&#xA;      (setq list (org-agenda-limit-entries list 'todo-state max-todo)))&#xA;    (when max-tags&#xA;      (setq list (org-agenda-limit-entries list 'tags max-tags)))&#xA;    (when max-entries&#xA;      (setq list (org-agenda-limit-entries list 'org-hd-marker max-entries)))&#xA;    ;; BEGIN modification&#xA;    (setq list&#xA;      (mapcar&#xA;        (lambda (string)&#xA;          (let* (&#xA;              (current-date (time-to-days (current-time)))&#xA;              (ts-date (get-text-property 0 'ts-date string)) )&#xA;            (if ts-date&#xA;              (cond&#xA;                ((&amp;lt; ts-date current-date)&#xA;                  (message &quot;The task dated %s is overdue.&quot; ts-date)&#xA;                  ;; The new value of `string' is returned/thrown as a result.&#xA;                  (replace-regexp-in-string &quot;^&quot; &quot;OLD:  &quot; string))&#xA;                ((= ts-date current-date)&#xA;                  (message &quot;The task dated %s is due today.&quot; ts-date)&#xA;                  ;; The new value of `string' is returned/thrown as a result.&#xA;                  (replace-regexp-in-string &quot;^&quot; &quot;CURRENT:  &quot; string))&#xA;                ((&amp;gt; ts-date current-date)&#xA;                  (message &quot;The task dated %s is not due yet.&quot; ts-date)&#xA;                  ;; The new value of `string' is returned/thrown as a result.&#xA;                  (replace-regexp-in-string &quot;^&quot; &quot;FUTURE:  &quot; string)))&#xA;              string)))&#xA;        list))&#xA;    ;; END modification&#xA;    (mapconcat 'identity list &quot;\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-11-07T00:43:57.383" LastActivityDate="2015-11-07T00:43:57.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17905" PostTypeId="2" ParentId="8036" CreationDate="2015-11-06T17:04:18.173" Score="3" Body="&lt;p&gt;I encountered the similar problem weeks ago and found it was caused by &lt;code&gt;desktop.el&lt;/code&gt;: once you enable &lt;code&gt;desktop-save-mode&lt;/code&gt; in your init file, some global variables (specified by user option &lt;code&gt;desktop-globals-to-save&lt;/code&gt;, which  includes &lt;code&gt;tags-table-list&lt;/code&gt; by default) will be recovered and also &lt;strong&gt;override you own setting in init file&lt;/strong&gt;. So if you was in the same situation, simply evaluate &lt;code&gt;(setq tags-table-list (list &quot;~/trunk/TAGS&quot;))&lt;/code&gt; with &lt;kbd&gt;C-x C-e&lt;/kbd&gt; &lt;strong&gt;before&lt;/strong&gt; closing Emacs.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-11-06T17:04:18.173" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17906" PostTypeId="1" AcceptedAnswerId="17907" CreationDate="2015-11-06T20:48:40.903" Score="1" ViewCount="993" Body="&lt;p&gt;I need a function that can determine whether an org-time-stamp in a table equals the current date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: test&#xA;| date             | breakfast |&#xA;|------------------+-----------|&#xA;| &amp;lt;2015-11-06 Fri&amp;gt; | eggs      |&#xA;| &amp;lt;2015-11-07 Sat&amp;gt; | oatmel    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can get the timestamp from last line in above table with &lt;code&gt;org-table-get-remote-range&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(substring-no-properties (org-table-get-remote-range &quot;test&quot; &quot;@&amp;lt;$1&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2015-11-07 Sat&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I convert that string to a number so that I can compare it with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format-time-string &quot;%Y%m%d&quot; (current-time))?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5341" LastEditorUserId="5341" LastEditDate="2015-11-06T22:20:54.187" LastActivityDate="2015-11-06T22:36:19.190" Title="Convert org-time-stamp" Tags="|org-mode|time-date|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17907" PostTypeId="2" ParentId="17906" CreationDate="2015-11-06T22:36:19.190" Score="7" Body="&lt;p&gt;You can use &lt;code&gt;org-read-date&lt;/code&gt; to convert timestamp strings into internal times&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-read-date nil t &quot;&amp;lt;2015-11-06&amp;gt;&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can be compared to either &lt;code&gt;(org-read-date nil t &quot;today&quot; nil)&lt;/code&gt; which always returns the current date or directly to the output of &lt;code&gt;(current-time)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-11-06T22:36:19.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17908" PostTypeId="2" ParentId="17902" CreationDate="2015-11-06T23:57:07.040" Score="1" Body="&lt;p&gt;All of them, as far as I am aware. I use Gnus myself. You can see the IMAP protocol parsing in nnimap.el, POP3 in pop3.el, etc.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-06T23:57:07.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17909" PostTypeId="2" ParentId="17901" CreationDate="2015-11-07T00:11:08.290" Score="3" Body="&lt;p&gt;Make sure that your &lt;code&gt;$TERM&lt;/code&gt; is set correctly before running Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If launching direct from the terminal, check with &lt;code&gt;echo $TERM&lt;/code&gt; - preferably its value would be &lt;code&gt;xterm-256color&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set it either directly before you run Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TERM=xterm-256color emacs -nw &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With any other arguments you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a more permanent solution, set the value of &lt;code&gt;TERM&lt;/code&gt; in your terminal emulator setup.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="2485" LastEditDate="2015-11-08T13:40:28.733" LastActivityDate="2015-11-08T13:40:28.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17910" PostTypeId="2" ParentId="17901" CreationDate="2015-11-07T00:17:16.637" Score="5" Body="&lt;p&gt;In general, a terminal application like &lt;code&gt;emacs -nw&lt;/code&gt; has only very limited information about what colors are available. The shell will have an environment variable called TERM which contains the name of the terminal you're using. The application can then use a library such as terminfo to pick the right escape sequences to use each feature of the terminal. This design reflects the historical reality that there were hundreds of different types of terminals, and that they all had different capabilities, and that even when those capabilities overlapped they had different protocols for using them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a modern system you will likely only ever see four different values for this variable, as modern terminals have been replaced by terminal emulators. The most common value is &lt;code&gt;xterm&lt;/code&gt;. This represents a terminal with the least-common-denominator of features, and most importantly supports 16 colors. Most terminals also support &lt;code&gt;xterm-256color&lt;/code&gt; which extends this to 256 colors. (The other common values &lt;code&gt;screen&lt;/code&gt; and &lt;code&gt;screen-256color&lt;/code&gt; aren't as important here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the original 16 color setup, the terminal chooses the colors (and possibly allows the user to edit the selection). In the 256 color setup the terminal still chooses the colors, but the colors are chosen to be uniformly spaced so that all hues are more or less equally well represented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how does this help you? Well, you can see that the color palette is entirely up to the terminal, so you'll want to find out how to configure it (or choose a different one). The emacs theme tells emacs a 24-bit color to use, then emacs looks at the &lt;code&gt;TERM&lt;/code&gt; variable to see how many colors are available and makes a guess as to how to best map that 24-bit color into a palette entry, then the terminal takes that palette entry and maps it back into a 24-bit color to display on your monitor. (Unless your X-Windows display is in some other color mode, but that's super unlikely these days).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another fix would be to run emacs not in a terminal but as a normal X application. This gives it access to the full 24-bit color space, the ability to use your entire selection fonts (with anti-aliasing even), multiple font sizes, text zooming, proportional fonts and more. Just run it without the &lt;code&gt;-nw&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Followup:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic faces (those not defined in some more specialized mode) are all defined in the &lt;code&gt;lisp/faces.el&lt;/code&gt; source file. Here's the definition of the &lt;code&gt;highlight&lt;/code&gt; face:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface highlight&#xA;  '((((class color) (min-colors 88) (background light))&#xA;     :background &quot;darkseagreen2&quot;)&#xA;    (((class color) (min-colors 88) (background dark))&#xA;     :background &quot;darkolivegreen&quot;)&#xA;    (((class color) (min-colors 16) (background light))&#xA;     :background &quot;darkseagreen2&quot;)&#xA;    (((class color) (min-colors 16) (background dark))&#xA;     :background &quot;darkolivegreen&quot;)&#xA;    (((class color) (min-colors 8))&#xA;     :background &quot;green&quot; :foreground &quot;black&quot;)&#xA;    (t :inverse-video t))&#xA;  &quot;Basic face for highlighting.&quot;&#xA;  :group 'basic-faces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously you can see that when there are more than 8 colors (16-color modes have 8 colors each with a bright and dark version) it doesn't set a background color. This doesn't answer the question &quot;why&quot;, however. You should file a bug on emacs and suggest it; you'll either find the answer or get it changed :). Use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; to send in the bug report. Naturally, including a patch that fixes it usually gets you mad props.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2015-11-08T04:49:44.677" LastActivityDate="2015-11-08T04:49:44.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17911" PostTypeId="2" ParentId="17210" CreationDate="2015-11-07T06:11:38.443" Score="0" Body="&lt;p&gt;You need only the backup dir set correctly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/.emacs-saves&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't have any trailing / either. Also as erikstokes mentioned above, you don't need &lt;code&gt;auto-save-file-name-transforms&lt;/code&gt; for backups to work.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-11-07T06:11:38.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17913" PostTypeId="1" AcceptedAnswerId="17914" CreationDate="2015-11-07T09:06:13.460" Score="0" ViewCount="157" Body="&lt;p&gt;Here's an example Org clock table in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 1 :scope file :tcolumns 1 :formula %&#xA;#+CAPTION: Clock summary at [2014-03-30 Sun 22:47]&#xA;| Headline     |   Time |     % |&#xA;|--------------+--------+-------|&#xA;| *Total time* | *4:31* | 100.0 |&#xA;|--------------+--------+-------|&#xA;| Item A       |   1:07 |  24.7 |&#xA;| Item B       |   1:06 |  24.4 |&#xA;| Item C       |   2:18 |  50.9 |&#xA;#+TBLFM: $3='(org-clock-time% @2$2 $2..$2);%.1f&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to move my cursor over &lt;code&gt;Item B&lt;/code&gt; and run a command that would take me to &lt;code&gt;Item B&lt;/code&gt;'s clock? If so, is it possible to do the reverse and jump from the clock to the clock's row in the Org clock table?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-11-07T09:14:28.997" Title="Jump to an org agenda clock from an org agenda clock report" Tags="|org-mode|org-agenda|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17914" PostTypeId="2" ParentId="17913" CreationDate="2015-11-07T09:14:28.997" Score="1" Body="&lt;p&gt;I think I figured this out - sorry for the brevity. I need to add a &lt;code&gt;link:&lt;/code&gt; attribute in my org clock BEGIN statement. For the above example, I need to make it look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 1 :scope file :tcolumns 1 :formula :link %&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the items will be rendered as link, and I can either click or execute the function &lt;code&gt;M-x org-agenda-open-link&lt;/code&gt;, which will open a new buffer with the cursor over the org clock item.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-11-07T09:14:28.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17915" PostTypeId="1" CreationDate="2015-11-07T09:23:26.770" Score="4" ViewCount="1291" Body="&lt;p&gt;The &lt;code&gt;json&lt;/code&gt; package coming with Emacs 24 has function &lt;code&gt;json-encode&lt;/code&gt; that works like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(json-encode '((&quot;key&quot; . &quot;value&quot;)))&#xA;&quot;{\&quot;key\&quot;:\&quot;value\&quot;}&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In case there are no keys (object is empty) I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(json-encode '())&#xA;&quot;null&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when in this case I need to get an empty object:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(json-encode '())&#xA;&quot;{}&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is there a way to make json encode empty alist or plist as &lt;code&gt;{}&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Is there another json package that can do this?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="1979" LastEditDate="2019-05-30T02:27:57.507" LastActivityDate="2019-05-30T02:27:57.507" Title="How to encode empty json object in elisp?" Tags="|json|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17916" PostTypeId="2" ParentId="17811" CreationDate="2015-11-07T11:38:07.987" Score="3" Body="&lt;p&gt;First, there was a suggestion to write my own answer rather than editing the question. Also, thanks to everyone for supplying intelligent and thoughtful comments. I obviously needed the help.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I had a saved keyboard macro set to produce &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;, which is an &lt;code&gt;em dash&lt;/code&gt; for use in HTML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The macro looked like &lt;code&gt;(global-set-key [?\C-c ?h] [? ?&amp;amp; ?m ?d ?a ?s ?h ?; ? ])&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Me? Clueless, so I just ended the expression with a &lt;code&gt;semicolon&lt;/code&gt; and a &lt;code&gt;space&lt;/code&gt;. And oddly enough, it works fine. It did work fine, until I did a bit of customizing via the Emacs menu system while adding a couple of tweaks to make use of some &lt;em&gt;Org mode&lt;/em&gt; features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that I understand where the problem is and why it should be a problem it all (finally) makes sense. The semicolon begins a comment, which causes two parenthetical expressions to be not-closed, i.e. &lt;code&gt;]&lt;/code&gt; and &lt;code&gt;)&lt;/code&gt;. This actually is reasonable in the Emacs world. Even I can understand it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it gets better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;init.el&lt;/code&gt; file, bent as it was, still let itself be saved without even a tiny squeak of protest, and ran perfectly. It was only when I tried something like changing the face color, for example, that &lt;code&gt;init.el&lt;/code&gt; would get ornery. And reluctantly throw a an &lt;em&gt;error message&lt;/em&gt;. I guess we have to call it a &lt;em&gt;message&lt;/em&gt; even though I've had better communications with a drunken chicken. (Her name was Heather, by the way. She was actually pretty astute at times, besides the eggs too, but then there was that drinking problem. &lt;em&gt;Anyhow.&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there I was, up to my elbows in a bucket of snakes all going every whichway and suddenly it all made sense, at which point I knew I'd better start backing away or it would soon be too late. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs. Make sense? Ow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after about six hours more searching, I found &lt;code&gt;\&lt;/code&gt; (It's how you draw an escape hatch in Emacs). So I added that to the macro and it kept working. And now whenever I get in there and try to do some customizing and things get hot and furious, that little escape hatch pops open and lets out enough steam so things don't blow up any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The updated macro with the escape hatch now looks like:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(global-set-key [?\C-c ?h] [? ?&amp;amp; ?m ?d ?a ?s ?h ?\; ? ])&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I guess the moral of the story is that you can stick your head into a fan if you want, or stick it into Emacs. Pretty much the same result, except that Emacs can also do &lt;code&gt;&amp;amp;mdash;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it really has to.&lt;/p&gt;&#xA;" OwnerUserId="10019" LastEditorUserId="10019" LastEditDate="2015-11-07T11:43:37.990" LastActivityDate="2015-11-07T11:43:37.990" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17917" PostTypeId="2" ParentId="17786" CreationDate="2015-11-07T14:07:04.660" Score="1" Body="&lt;p&gt;It turned out that I have installed a package called lispy and that this package seems to change imenu-create-index-functions value.&#xA;Answering my own question gives me the impression that doing &quot;emacs -Q&quot; should have been my pre-post action... Since I had not time to get used to lispy I just removed the package and now i can imenu through my init.el again!&lt;/p&gt;&#xA;" OwnerUserId="970" LastActivityDate="2015-11-07T14:07:04.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17918" PostTypeId="1" CreationDate="2015-11-07T16:30:17.460" Score="0" ViewCount="256" Body="&lt;p&gt;Currently I have this javascript code in a &lt;code&gt;js2-mode&lt;/code&gt; buffer after I press tab:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const entries = state.get('entries')&#xA;          .concat(getWinners(state.get('vote')));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I would like for it to look like this aligned according to the dots&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const entries = state.get('entries')&#xA;                     .concat(getWinners(state.get('vote')));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to get emacs to behave like this? &lt;code&gt;indent-relative&lt;/code&gt; does not seem to be the answer.&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2015-11-13T20:35:43.853" Title="Is there any way to get tabs to align relative to the previous line?" Tags="|indentation|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17919" PostTypeId="1" CreationDate="2015-11-07T18:29:45.600" Score="0" ViewCount="205" Body="&lt;h2&gt;Setup:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;GUI version GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.16.7)&#xA;of 2015-11-02, from emacs-snapshot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linux Ubuntu distrubition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gnus version 5.13&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Situation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I switched to Linux, to be able to read my own mail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm reading my mail, I would like to reply it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type my answer in the message window, and I send it with &lt;kbd&gt;C-c C-s&lt;/kbd&gt;, I get the error messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sending...&#xA;Sending via mail...&#xA;let*: Cannot infer SMTP&#xA;information.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When Googling around, it seems none had stumbled this issue earlier. I found only the contents of the Lisp code that produces this error message. It seems my SMTP is unknown to Gnus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how could I solve it? Gnus seems to have access to my Gmail.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-04-06T01:58:24.653" Title="I'm able to read Gmail with Gnus, but not sending: cannot infer SMTP" Tags="|gnus|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17920" PostTypeId="2" ParentId="3798" CreationDate="2015-11-07T18:39:18.757" Score="-1" Body="&lt;p&gt;I can't comment on Fu86's answer due to rep but I'm piggy backing off it (sorry if this isn't normal protocol). I got a void function using his answer due to &quot;helm-find-files-map&quot;. It worked for me to use the &quot;helm-map&quot; key map instead. No conflicts so far and it is the behavior I was looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;...&#xA;(define-key helm-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) 'helm-execute-persistent-action)&#xA;...&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10074" LastActivityDate="2015-11-07T18:39:18.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17922" PostTypeId="2" ParentId="5796" CreationDate="2015-11-07T20:23:32.283" Score="1" Body="&lt;p&gt;I've run into this difficulty as well.  Once you've evaluated the modified &lt;code&gt;(req-package somepackage ...)&lt;/code&gt; form call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(req-package-eval 'somepackage)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should do what you want.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2015-11-07T23:15:24.603" LastActivityDate="2015-11-07T23:15:24.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17923" PostTypeId="1" CreationDate="2015-11-07T20:27:23.637" Score="1" ViewCount="277" Body="&lt;p&gt;I want to insert a date in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the function &lt;code&gt;calendar-cursor-to-date&lt;/code&gt; that when invoked gives back the date at which the cursor is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how do I get that info back into my program?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I've got so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-new-entry ()&#xA;   (interactive)&#xA;   (save-excursion&#xA;      (goto-char (point-max))&#xA;      ;;next comes mostly pseudocode except *calendar-cursor-to-date*&#xA;&#xA;      (calendar)&#xA;       (let ((x (bind-key (kdb &quot;enter) 'calendar-mode calendar-cursor-to-date)))&#xA;            (insert x))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So in english it's:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;go to the last location in the buffer&lt;/li&gt;&#xA;&lt;li&gt;open calendar&lt;/li&gt;&#xA;&lt;li&gt;store in x whatever is returned where enter is pressed&lt;/li&gt;&#xA;&lt;li&gt;insert it into buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The problem is step 3. How do I store into x whatever is returned from &lt;code&gt;calendar-cursor-to-date&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="105" LastEditDate="2016-03-14T04:47:41.387" LastActivityDate="2018-08-01T22:18:11.633" Title="How do I pick a date in my new major mode?" Tags="|time-date|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17924" PostTypeId="2" ParentId="17923" CreationDate="2015-11-07T20:57:20.143" Score="3" Body="&lt;p&gt;As stated in a comment of mine underneath a similar / duplicate question by this original poster -- &lt;a href=&quot;https://emacs.stackexchange.com/q/15080/2287&quot;&gt;how to detect selection in date mode?&lt;/a&gt; -- the function &lt;code&gt;org-read-date&lt;/code&gt; is the best choice:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(insert (org-read-date))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following example function demonstrates proposed usage of &lt;code&gt;org-read-date&lt;/code&gt; based on the outline of the original poster:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-date-at-eob ()&#xA;&quot;Go to the end of the buffer, insert a date using the function `org-read-date',&#xA;and return to the original position in the buffer.&quot;&#xA;(interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-max))&#xA;    (insert (org-read-date))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more information on the function &lt;code&gt;org-read-date&lt;/code&gt;, type &lt;code&gt;M-x describe-function RET org-read-date RET&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-11-07T21:59:33.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17925" PostTypeId="1" CreationDate="2015-11-07T23:14:27.853" Score="1" ViewCount="3931" Body="&lt;p&gt;I have a huge number of text files (.txt), in which I store notes. I would like to add tags to the start of each of these files in order to characterize their content. The best would be to be able to, either chose tags from a list of tags already used (that dynamically expands for each new tag used), or if none of these tags are useful add a new one (therby expanding the dynamic list with this new tag). Does it already exist such a dynamic tagging functionality, and if so, how to I implement it? How can I search over these multiple file?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2015-11-12T07:14:13.827" Title="Org mode: How to tag and search the content of different text files?" Tags="|org-mode|org-tags|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17926" PostTypeId="1" AcceptedAnswerId="17928" CreationDate="2015-11-07T23:25:39.160" Score="26" ViewCount="6180" Body="&lt;p&gt;This is my source block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python&#xA;print &quot;hello&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output is always: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: None&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is my org-babel configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((python . t)&#xA;   (C . t)&#xA;   (calc . t)&#xA;   (latex . t)&#xA;   (java . t)&#xA;   (ruby . t)&#xA;   (scheme . t)&#xA;   (sh . t)&#xA;   (sqlite . t)&#xA;   (js . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Python is on my PATH and executable via terminal.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs-lisp SRC blocks works just fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do I get &lt;code&gt;None&lt;/code&gt; instead of &lt;code&gt;hello&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6527" LastEditorUserId="591" LastEditDate="2018-10-03T21:15:12.423" LastActivityDate="2020-02-14T17:31:49.913" Title="Python org-mode source block output is always ': None'" Tags="|org-mode|python|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="17927" PostTypeId="2" ParentId="14673" CreationDate="2015-11-07T23:38:43.870" Score="1" Body="&lt;p&gt;There doesn't appear to be any built-in functionality to do that (&lt;strong&gt;edit&lt;/strong&gt;: yes there is, see below).  The simplest solution, one that does not require delving into the internals of the capture functionality, is to bind the value of &lt;code&gt;org-default-notes-file&lt;/code&gt; at capture time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-capture-advice (func &amp;amp;rest args)&#xA;   (let ((org-default-notes-file&#xA;         (format-time-string &quot;~/org/%Y-%m-%d--%H-%M-%S.org&quot;)))&#xA;    (apply func args)))&#xA;&#xA;(advice-add 'org-capture :around #'my-org-capture-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This advice happens very early, so it doesn't yet know which template you're going to use.  If the name of the file depends on the capture template, then you'll probably need to advice &lt;code&gt;org-capture-set-target-location&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: the &lt;code&gt;function&lt;/code&gt; template target is a better way to achieve that.  See Aaron's answer for an example.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2015-11-08T17:12:45.400" LastActivityDate="2015-11-08T17:12:45.400" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17928" PostTypeId="2" ParentId="17926" CreationDate="2015-11-08T02:00:07.627" Score="25" Body="&lt;p&gt;This is a peculiarity of how babel handles some languages.  &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html&quot; rel=&quot;noreferrer&quot;&gt;This&lt;/a&gt; gives some detail on python, and a complete list of options is available &lt;a href=&quot;https://orgmode.org/manual/Results-of-Evaluation.html#Results-of-Evaluation&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. There are quite a few useful ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, depending on the language, there are several options for output.  Sometimes it makes sense to use the standard output (what &lt;code&gt;print&lt;/code&gt; does), for other languages (eg octave), it makes sense to display an image.  For python, the default is &lt;code&gt;value&lt;/code&gt;, which shows the return value of the code, so changing your print statement to a return would give the expected behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't very useful in some cases, so it can be changed by adding &lt;code&gt;:results output&lt;/code&gt; to the first line of the source block. &lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="13472" LastEditDate="2020-02-14T17:31:49.913" LastActivityDate="2020-02-14T17:31:49.913" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="17929" PostTypeId="1" AcceptedAnswerId="17952" CreationDate="2015-11-08T02:37:29.883" Score="6" ViewCount="318" Body="&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit is constantly forcing my tramp/ssh buffers to connect remotely to their source machines. The buffers are all unrelated to the repo I'm working with. How do I stop this? The tramp/ssh buffers &lt;em&gt;do&lt;/em&gt; contain git-versioned files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Backstory:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a number of tramp/ssh buffers open in my Emacs to a virtual machine. Due to a years-old bug in VMware Fusion, I must close it before putting my laptop to sleep or Fusion crashes my entire laptop. I leave the Emacs buffers open because they'll reconnect to the VM after restarting it. I don't close the tramp/ssh files because my desktop setup doesn't seem to restore tramp buffers on a restart of Emacs, and I spent a lot of time finding each of those files among thousands of files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to use Magit on a local repo unrelated to my VM work, it causes all of my tramp buffers to try to re-connect and tramp blocks Emacs until it succeeds or fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** Backtrace (toggle-debug-on-quit): **&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (quit)&#xA;  signal(quit nil)&#xA;  byte-code(&quot;\302\303\&quot;\210\304 @   A\&quot;\207&quot; [vec err tramp-cleanup-connection t signal] 3)&#xA;  tramp-maybe-open-connection([&quot;ssh&quot; nil &quot;and&quot; &quot;/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; nil])&#xA;  tramp-send-command([&quot;ssh&quot; nil &quot;and&quot; &quot;/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; nil] &quot;echo \\\&quot;`getconf PATH 2&amp;gt;/dev/null`\\\&quot; 2&amp;gt;/dev/null; echo tramp_exit_status $?&quot;)&#xA;  tramp-send-command-and-check([&quot;ssh&quot; nil &quot;and&quot; &quot;/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; nil] &quot;echo \\\&quot;`getconf PATH 2&amp;gt;/dev/null`\\\&quot;&quot;)&#xA;  tramp-send-command-and-read([&quot;ssh&quot; nil &quot;and&quot; &quot;/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; nil] &quot;echo \\\&quot;`getconf PATH 2&amp;gt;/dev/null`\\\&quot;&quot; noerror)&#xA;  tramp-get-remote-path([&quot;ssh&quot; nil &quot;and&quot; &quot;/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; nil])&#xA;  tramp-get-remote-readlink([&quot;ssh&quot; nil &quot;and&quot; &quot;/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; nil])&#xA;  tramp-sh-handle-file-truename(&quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot;)&#xA;  apply(tramp-sh-handle-file-truename &quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot;)&#xA;  tramp-sh-file-name-handler(file-truename &quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot;)&#xA;  apply(tramp-sh-file-name-handler file-truename &quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot;)&#xA;  byte-code(&quot;\300\301\215\207&quot; [suppress (apply foreign operation args)] 2)&#xA;  byte-code(&quot;K\306\211&amp;lt;\203\237\n@\307=\203\237\306\310\311!\203\&quot;\312\311\313N@!\206\221\314\315!\2039\316\315!\2044\317\315!\205\221\315 \202\221\320\321!\211\205D\322\f!)\203P\323\320\321!!\202\221\320\324!\211\205[\322\f!)\203g\323\320\324!!\202\221\320\325!\211\205r\322\f!)\203~\323\320\325!!\202\221\326\327!\203\212\323\327!\202\221\330\331!\210\323\332!)\333\n\211A@\262\334\335#\210)\336\337\215\211\336=\203\312*\340\341+,BC-./0\306\342\343\217,\210\344+,\&quot;\202\374    \345=\203\373\3061*\346\347+,BC-./0\306\342\343\217,\210\350*\351\&quot;\210\344+,\&quot;)\202\374    *\207&quot; [foreign result sf file-name-handler-alist d default-directory nil autoload boundp temporary-file-directory eval standard-value fboundp temp-directory subrp functionp getenv &quot;TEMP&quot; file-directory-p file-name-as-directory &quot;TMP&quot; &quot;TMPDIR&quot; file-exists-p &quot;c:/temp&quot; message &quot;Neither `temporary-file-directory' nor `temp-directory' is defined -- using /tmp.&quot; &quot;/tmp&quot; load noerror nomessage non-essential (byte-code &quot;\300\301\215\207&quot; [suppress (apply foreign operation args)] 2) 5 &quot;Non-essential received in operation %s&quot; (byte-code &quot;   X\205g\306 \307\216\203;\310X\203;\311\312\313U\203!\314\2026\315U\203+\314\2026\316U\2035\317\2026\320\fP&#xA;#\210   \321Y\205f\322!\203S\313\323\324\325#)\326!\205f\311\327\330\331\&quot;\fP&#xA;$*\207&quot; [level tramp-verbose save-match-data-internal tramp-message-show-message fmt-string arguments match-data ((byte-code &quot;\301\302\&quot;\207&quot; [save-match-data-internal set-match-data evaporate] 3)) 3 apply message 0 &quot;&quot; 1 2 &quot;Warning: &quot; &quot;Tramp: &quot; 4 processp tramp-get-connection-property &quot;vector&quot; nil vectorp tramp-debug-message format &quot;(%d) # &quot; vec-or-proc] 6) ((error)) tramp-run-real-handler suppress 1 &quot;Suppress received in operation %s&quot; tramp-cleanup-connection t v operation args arguments fmt-string level vec-or-proc tramp-message-show-message] 6)&#xA;  tramp-file-name-handler(file-truename &quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot;)&#xA;  file-truename(&quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot;)&#xA;  file-in-directory-p(&quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; &quot;/Users/hchapman/work/RDM/&quot;)&#xA;  apply(file-in-directory-p (&quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; &quot;/Users/hchapman/work/RDM/&quot;))&#xA;  tramp-run-real-handler(file-in-directory-p (&quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; &quot;/Users/hchapman/work/RDM/&quot;))&#xA;  tramp-sh-file-name-handler(file-in-directory-p &quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; &quot;/Users/hchapman/work/RDM/&quot;)&#xA;  apply(tramp-sh-file-name-handler file-in-directory-p (&quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; &quot;/Users/hchapman/work/RDM/&quot;))&#xA;  byte-code(&quot;\300\301\215\207&quot; [suppress (apply foreign operation args)] 2)&#xA;  byte-code(&quot;K\306\211&amp;lt;\203\237\n@\307=\203\237\306\310\311!\203\&quot;\312\311\313N@!\206\221\314\315!\2039\316\315!\2044\317\315!\205\221\315 \202\221\320\321!\211\205D\322\f!)\203P\323\320\321!!\202\221\320\324!\211\205[\322\f!)\203g\323\320\324!!\202\221\320\325!\211\205r\322\f!)\203~\323\320\325!!\202\221\326\327!\203\212\323\327!\202\221\330\331!\210\323\332!)\333\n\211A@\262\334\335#\210)\336\337\215\211\336=\203\312*\340\341+,BC-./0\306\342\343\217,\210\344+,\&quot;\202\374    \345=\203\373\3061*\346\347+,BC-./0\306\342\343\217,\210\350*\351\&quot;\210\344+,\&quot;)\202\374    *\207&quot; [foreign result sf file-name-handler-alist d default-directory nil autoload boundp temporary-file-directory eval standard-value fboundp temp-directory subrp functionp getenv &quot;TEMP&quot; file-directory-p file-name-as-directory &quot;TMP&quot; &quot;TMPDIR&quot; file-exists-p &quot;c:/temp&quot; message &quot;Neither `temporary-file-directory' nor `temp-directory' is defined -- using /tmp.&quot; &quot;/tmp&quot; load noerror nomessage non-essential (byte-code &quot;\300\301\215\207&quot; [suppress (apply foreign operation args)] 2) 5 &quot;Non-essential received in operation %s&quot; (byte-code &quot;   X\205g\306 \307\216\203;\310X\203;\311\312\313U\203!\314\2026\315U\203+\314\2026\316U\2035\317\2026\320\fP&#xA;#\210   \321Y\205f\322!\203S\313\323\324\325#)\326!\205f\311\327\330\331\&quot;\fP&#xA;$*\207&quot; [level tramp-verbose save-match-data-internal tramp-message-show-message fmt-string arguments match-data ((byte-code &quot;\301\302\&quot;\207&quot; [save-match-data-internal set-match-data evaporate] 3)) 3 apply message 0 &quot;&quot; 1 2 &quot;Warning: &quot; &quot;Tramp: &quot; 4 processp tramp-get-connection-property &quot;vector&quot; nil vectorp tramp-debug-message format &quot;(%d) # &quot; vec-or-proc] 6) ((error)) tramp-run-real-handler suppress 1 &quot;Suppress received in operation %s&quot; tramp-cleanup-connection t v operation args arguments fmt-string level vec-or-proc tramp-message-show-message] 6)&#xA;  tramp-file-name-handler(file-in-directory-p &quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; &quot;/Users/hchapman/work/RDM/&quot;)&#xA;  file-in-directory-p(&quot;/ssh:and:/android/out/RDM/output/android_os_build/kernel_imx/drivers/video/mxc/mxc_hdmi.c&quot; &quot;/Users/hchapman/work/RDM/&quot;)&#xA;  magit-revert-buffers()&#xA;  magit-refresh()&#xA;  call-interactively(magit-refresh nil nil)&#xA;  command-execute(magit-refresh)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2240" LastEditorUserId="2240" LastEditDate="2015-11-09T12:26:12.007" LastActivityDate="2015-11-09T16:10:56.710" Title="Can Magit be configured to NOT touch/read every buffer in Emacs?" Tags="|magit|tramp|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17930" PostTypeId="1" AcceptedAnswerId="17942" CreationDate="2015-11-08T03:40:04.527" Score="7" ViewCount="125" Body="&lt;p&gt;If I run certain functions like &lt;code&gt;isearch-forward&lt;/code&gt; (with &lt;kbd&gt;C-s&lt;/kbd&gt;) in an org-mode buffer, all content become temporarily visible. When I end the search, headings automagically collapse the way they were before I searched. Nice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I run something like &lt;code&gt;query-replace&lt;/code&gt; (with &lt;kbd&gt;M-%&lt;/kbd&gt;), trees stay collapsed. The point essentially hidden inside them. I am asked to confirm a change that I can't see. That's not good at all!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely functions like &lt;code&gt;query-replace&lt;/code&gt; should behave more like &lt;code&gt;isearch-forward&lt;/code&gt; does. I swear I found a simple solution to this at some point. (A variable with a &lt;code&gt;smart&lt;/code&gt; setting, I thought?) But I seem to have lost track of it. Please help me.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2015-11-08T22:05:07.680" Title="Sane settings to show context when doing search and replace in org-mode" Tags="|org-mode|replace|query-replace|visibility|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17931" PostTypeId="2" ParentId="17926" CreationDate="2015-11-08T04:11:24.497" Score="24" Body="&lt;p&gt;In a very simple case like this one, there's a hack I tend to use, replace &lt;code&gt;print&lt;/code&gt; with &lt;code&gt;return&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python&#xA;return &quot;hello&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in general the better solution will be to use &lt;code&gt;:results output&lt;/code&gt;, as mentioned by user2699.    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :results output&#xA;print(&quot;hello&quot;)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="874" LastEditorUserId="591" LastEditDate="2018-10-03T23:57:05.110" LastActivityDate="2018-10-03T23:57:05.110" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17932" PostTypeId="1" CreationDate="2015-11-08T05:13:24.940" Score="2" ViewCount="758" Body="&lt;p&gt;I am trying to track down a weird bug in my emacs configuration - the cursor, occasionally, jumps to a random location when I am scrolling using the arrow keys, in &lt;code&gt;cc-mode&lt;/code&gt;. I don't see any accidental keystrokes registered in &lt;code&gt;view-lossage&lt;/code&gt;. Is there a way to get a list of all functions called, instead of just the commands displayed by &lt;code&gt;view-lossage&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="2536" LastEditorUserId="14920" LastEditDate="2018-05-22T21:14:23.457" LastActivityDate="2018-05-22T21:14:23.457" Title="Get a list of functions evaluated" Tags="|debugging|functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17933" PostTypeId="2" ParentId="17932" CreationDate="2015-11-08T13:20:56.163" Score="2" Body="&lt;p&gt;Listing &lt;em&gt;every&lt;/em&gt; function that got called would be unreadable I'm sure (lots of functions calling functions calling functions). You might try &lt;code&gt;command-log-mode&lt;/code&gt;, available via the package manager or from &lt;a href=&quot;https://github.com/lewang/command-log-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lewang/command-log-mode&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-08T13:20:56.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17934" PostTypeId="1" AcceptedAnswerId="17938" CreationDate="2015-11-08T13:53:23.700" Score="6" ViewCount="131" Body="&lt;p&gt;&lt;code&gt;(query-replace &quot;foo&quot; &quot;bar&quot;)&lt;/code&gt; shows you all occurrences of &lt;code&gt;foo&lt;/code&gt; and offers to replace them by &lt;code&gt;bar&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to have a version of &lt;code&gt;query-replace&lt;/code&gt; that only picks the occurrences of &lt;code&gt;foo&lt;/code&gt; that are &quot;in some context&quot; (to be defined). At the moment, I'm thinking of LaTeX files with the context being &quot;any part that is in math style&quot;. Or any part not in math style. These parts are already highlighted by Emacs' &lt;code&gt;latex-mode&lt;/code&gt; so it can recognize them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;query-replace&lt;/code&gt; can already perform a bit of context checking since its &lt;code&gt;DELIMITED&lt;/code&gt; argument allows restricting to occurrences surrounded by word boundaries, but this is a simple special case that can be implemented with regular expressions, e.g., looking for &lt;code&gt;\&amp;lt;foo\&amp;gt;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt; do you know of an extension of &lt;code&gt;query-replace&lt;/code&gt; in some package somewhere that can do the replace-only-in-math-style trick I need? Or of something similar enough that would be a good start for tweaking and hacking around? &lt;/p&gt;&#xA;" OwnerUserId="1992" LastEditorUserId="15606" LastEditDate="2024-03-03T17:59:53.997" LastActivityDate="2024-03-03T17:59:53.997" Title="Query-replace with some context checking?" Tags="|latex|query-replace|isearch-filter-predicate|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17935" PostTypeId="2" ParentId="14878" CreationDate="2015-11-08T15:48:45.657" Score="1" Body="&lt;p&gt;Another answer, unlike to others this doesn't rely on fancy libraries and esoteric features like &lt;code&gt;catch&lt;/code&gt; and &lt;code&gt;throw&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((rest (list str1 str2 str3 str4 str5)))&#xA;  (while rest&#xA;    (let ((entry (pop rest)))&#xA;      (when (firstFunction entry)&#xA;        (secondFunction entry)&#xA;        (setq rest ())))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This assumes that the value the original &lt;code&gt;cond&lt;/code&gt; expression wasn't used.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-08T15:48:45.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17936" PostTypeId="1" CreationDate="2015-11-08T16:23:58.203" Score="1" ViewCount="139" Body="&lt;p&gt;on orgmode 8.3.2 I've got a large org-file. Offen, I need to export a subtree like this:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Subtree to be exported&#xA;:PROPERTIES:&#xA;:EXPORT_FILE_NAME: /PATH/TO/FOLDER/filename&#xA;:EXPORT_TITLE:&#xA;:END:&#xA;&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'd like to save the exported file in a project folder, as you can see in &#xA;EXPORT_FILE_NAME . This is a different folder than folder where my large org file resides.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be very helpful to use link abbrevations in EXPORT_FILE_NAME :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-link-abbrev-alist&#xA;   '((&quot;anglisky&quot; . &quot;~/Path/whereever/%s&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in .emacs and write:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Subtree to be exported&#xA;:PROPERTIES:&#xA;:EXPORT_FILE_NAME: anglisky:filename&#xA;:EXPORT_TITLE:&#xA;:END:&#xA;&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Possible? Feature Request?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick in my &lt;code&gt;org-link-abbrev-alist&lt;/code&gt; is that the path depends, e.g. on the OS of the computer. Under Windows, the path  may be X:/..., under Linux the path is /home/&amp;lt;user&amp;gt;/whatever/else/ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it would be very helpful to use link abbrevation for the export file name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been asking this question on the orgmode-mailing-list, but without an answer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been an answer on the orgmode mailinglist: no, it is not possible to use the link abbrevations for the properties list. Sorry, I can't provide a link, Gmane seems to be down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What a pity, but I'll find another way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="2334" LastEditorUserId="2334" LastEditDate="2015-11-15T20:32:49.070" LastActivityDate="2015-11-15T20:32:49.070" Title="Using link abbrevations for EXPORT_FILE_NAME?" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17937" PostTypeId="2" ParentId="14673" CreationDate="2015-11-08T16:27:08.957" Score="6" Body="&lt;p&gt;You should be able to use the &lt;code&gt;function&lt;/code&gt; target form to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-file-by-date ()&#xA;  &quot;Create an Org file with current time as name.&quot;&#xA;  (find-file (format-time-string &quot;~/org/%Y-%m-%d--%H-%M-%S.org&quot;)))&#xA;&#xA;(add-to-list 'org-capture-templates&#xA;             '(&quot;x&quot; &quot;Template Name&quot; plain&#xA;              (function my/org-file-by-date)&#xA;              &quot;Capture template contents&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;: As it turns out, code passed to a &lt;code&gt;file&lt;/code&gt; form or the like isn't evaluated until capture time, so there's a more compact way to do this.  See &lt;a href=&quot;https://emacs.stackexchange.com/a/17951/8647&quot;&gt;Erik Sjöstrand's answer&lt;/a&gt; for an example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1&lt;/strong&gt;: To get similar functionality without going through the capture interface, you can use functions similar to these.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-file-by-date-with-inline-skeleton ()&#xA;  &quot;Create Org file from skeleton with current time as name.&quot;&#xA;  (interactive)&#xA;  (find-file (format-time-string &quot;~/org/%Y-%m-%d--%H-%M-%S.org&quot;))&#xA;  (insert &quot;Skeleton contents&quot;))&#xA;&#xA;(defun my/org-file-by-date-with-file-skeleton ()&#xA;  &quot;Create Org file from skeleton file with current time as name.&quot;&#xA;  (interactive)&#xA;  (let ((filename (format-time-string &quot;~/org/%Y-%m-%d--%H-%M-%S.org&quot;)))&#xA;    (copy-file &quot;path/to/skeleton/file&quot; filename)&#xA;    (find-file filename)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-11-09T15:29:24.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17938" PostTypeId="2" ParentId="17934" CreationDate="2015-11-08T19:18:53.553" Score="1" Body="&lt;p&gt;Yes.  If you use libraries &lt;a href=&quot;http://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/Zones&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Zones&lt;/strong&gt;&lt;/a&gt; (including optional library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/isearch-prop.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/a&gt;), and you set option &lt;strong&gt;&lt;code&gt;isearchp-query-replace-zones-flag.&lt;/code&gt;&lt;/strong&gt; to non-&lt;code&gt;nil&lt;/code&gt;, then replacement commands such as &lt;code&gt;query-replace&lt;/code&gt; are limited to the buffer zones you define.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works by binding &lt;code&gt;isearch-filter-predicate&lt;/code&gt; to a function that recognizes the zones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Isearch works the same way - you can limit searching to defined zones.  And if you use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can bookmark a set of zones.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also query-replace (or search) the &lt;em&gt;complement&lt;/em&gt; of a set of zones.  Toggle this behavior using &lt;code&gt;C-M-~&lt;/code&gt; during Isearch.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-08T19:24:14.707" LastActivityDate="2015-11-08T19:24:14.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17939" PostTypeId="1" CreationDate="2015-11-08T19:45:18.820" Score="3" ViewCount="397" Body="&lt;p&gt;I would like to bind C-h to do exactly the same thing as backspace, no matter&#xA;the mode I'm in. So far I bound C-h to delete-backward-char in global-map,&#xA;but the results are inconsistent across the modes (it doesn't work well with electric-pair for example, python mode is broken as well).&lt;/p&gt;&#xA;" OwnerUserId="10081" LastEditorUserId="105" LastEditDate="2015-11-08T20:04:54.107" LastActivityDate="2015-11-08T20:04:54.107" Title="Binding one key to another" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17940" PostTypeId="2" ParentId="17939" CreationDate="2015-11-08T19:52:08.430" Score="0" Body="&lt;p&gt;I found the answer, for future reference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-h&quot;) (kbd &quot;&amp;lt;backspace&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10082" LastActivityDate="2015-11-08T19:52:08.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17941" PostTypeId="2" ParentId="17939" CreationDate="2015-11-08T20:03:46.733" Score="1" Body="&lt;p&gt;I use &lt;code&gt;(define-key key-translation-map [?\C-h] [?\C-?])&lt;/code&gt;, this also works for when backspaces as parts of key sequences, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x DEL (translated from C-x C-h) runs the command&#xA;backward-kill-sentence&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-11-08T20:03:46.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17942" PostTypeId="2" ParentId="17930" CreationDate="2015-11-08T22:05:07.680" Score="2" Body="&lt;p&gt;Please try in GNU Emacs 24.4 or 24.5 where it should work as you want.&lt;/p&gt;&#xA;" OwnerUserId="478" LastActivityDate="2015-11-08T22:05:07.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17943" PostTypeId="1" CreationDate="2015-11-09T02:50:57.933" Score="1" ViewCount="66" Body="&lt;p&gt;I've got this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-random-uuid ()&#xA;  (interactive)&#xA;  (shell-command &quot;uuidgen&quot; t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which produces a uuid that looks like this &lt;code&gt;ffc715d2-1e10-4faf-b1f6-f85cae88a7d7&lt;/code&gt;. However, I believe it's throwing in a newline &lt;em&gt;and&lt;/em&gt; that it isn't returning a string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(stringp (insert-random-uuid))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which returns &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I find this at the EmacsWiki:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun chomp (str)&#xA;      &quot;Chomp leading and tailing whitespace from STR.&quot;&#xA;      (while (string-match &quot;\\`\n+\\|^\\s-+\\|\\s-+$\\|\n+\\'&quot;&#xA;                           str)&#xA;        (setq str (replace-match &quot;&quot; t t str)))&#xA;      str)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which seems to handle both whitespace and \n. But of course &lt;code&gt;(chomp (insert-random-uuid)&lt;/code&gt; gives an error, no doubt because &lt;code&gt;insert-random-uuid&lt;/code&gt; is not returning a true string. So what is it returning, and how can I remove the newline? I tried various things to &quot;cast&quot; the output to string, but no luck. How can I get rid of this newline?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:47:18.667" LastActivityDate="2016-03-14T04:47:18.667" Title="How to know output type" Tags="|shell|string|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17944" PostTypeId="2" ParentId="17943" CreationDate="2015-11-09T03:08:38.473" Score="5" Body="&lt;p&gt;Use &lt;code&gt;(type-of EXPRESSION)&lt;/code&gt; to determine the type of an expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case you are confusing the value being inserted into a buffer by a function with its return value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;shell-command&lt;/code&gt; &lt;em&gt;inserts&lt;/em&gt; the textual output of the command, but it &lt;em&gt;returns&lt;/em&gt; the exit status of the command (which, of course, is an integer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest solution to your problem is probably to prevent the shell from generating a newline in the output in the first place. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command &quot;printf %s \&quot;$(uuidgen)\&quot;&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-11-09T20:37:27.660" LastActivityDate="2015-11-09T20:37:27.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17945" PostTypeId="2" ParentId="12414" CreationDate="2015-11-09T04:00:09.720" Score="0" Body="&lt;p&gt;Instead of trying to print a frame, you should create a new buffer whose contents are created from copies of what's in the two calc buffers.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-09T04:00:09.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17946" PostTypeId="1" AcceptedAnswerId="17977" CreationDate="2015-11-09T04:22:01.057" Score="6" ViewCount="188" Body="&lt;p&gt;I have a project that wants to play a sound file. I'd like to distribute this project in MELPA. There are two issues I'm having with that. They're both part of the question &amp;quot;how do I use resources in an Emacs package&amp;quot;, so I'm asking this as one question.&lt;/p&gt;&#xA;&lt;h3&gt;1. Package setup&lt;/h3&gt;&#xA;&lt;p&gt;How do I set it up so I can distribute it through ELPA? Obviously the sound file needs to be included. Is there anything I need to do in the package, or is that something that needs to happen upon someone creating the package download?&lt;/p&gt;&#xA;&lt;h3&gt;2. Referencing the file&lt;/h3&gt;&#xA;&lt;p&gt;I'm having a problem referencing the sound file from the Emacs Lisp file. There's the function &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Expansion.html#index-expand_002dfile_002dname&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;expand-file-name&lt;/code&gt;&lt;/a&gt;, but if I open a new Emacs and &lt;code&gt;load-file&lt;/code&gt; the elisp file, during the call to &lt;code&gt;expand-file-name&lt;/code&gt; for the sound file, the path is expanded relative to the location of the Emacs executable.&lt;/p&gt;&#xA;&lt;p&gt;There's an argument to &lt;code&gt;expand-file-name&lt;/code&gt; that is the default directory to start with, but I'm not sure how to get the directory the file is in when the file is being loaded. During the execution of &lt;code&gt;load-file&lt;/code&gt;, &lt;code&gt;default-directory&lt;/code&gt; gets the value of the folder that holds the Emacs executable. How can I get the file to load without hardcoding the full path?&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-11-10T11:14:56.357" Title="How do I include non-code resources as part of an Emacs package?" Tags="|package|files|package-development|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17947" PostTypeId="1" CreationDate="2015-11-09T04:43:45.187" Score="4" ViewCount="249" Body="&lt;p&gt;I can't seem to get indentation working properly in the REPLs I've used so far (IELM, MIT-Scheme, and Python).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I type the following and RET:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (defun something ()&#xA;_&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My cursor ends up at the underscore, and pressing TAB doesn't seem to do anything. The same thing happens with the MIT-Scheme REPL. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be explicit, I'd like to have it automatically indent it like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (defun something ()&#xA;         _&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In IELM, TAB is bound to &lt;code&gt;ielm-tab&lt;/code&gt; which is supposed to &quot;Indent or complete&quot;. The function calls &lt;code&gt;ielm-indent-line&lt;/code&gt; at the beginning of a line. Calling &lt;code&gt;ielm-indent-line&lt;/code&gt; directly does not indent the line as advertised.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Python REPL, it does indent just enough to get past the prompt, but not more. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; def something():&#xA;... _&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was hoping to be able to have the Python REPL automatically indent like in regular Python files. The mode description doesn't seem to turn up any relevant results for 'indent'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;electric-indent-mode&lt;/code&gt; is enabled in all cases. Would anybody know what I'm missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I noticed that &lt;code&gt;ielm-indent-line&lt;/code&gt; is supposed to (but evidently does not) call &lt;code&gt;lisp-indent-line&lt;/code&gt;. Calling &lt;code&gt;lisp-indent-line&lt;/code&gt; directly &lt;em&gt;does&lt;/em&gt; work in IELM, but not Inferior Scheme/MIT-Scheme.&#xA;Calling &lt;code&gt;python-indent-line&lt;/code&gt; in the Python REPL also does not work.&lt;/p&gt;&#xA;" OwnerUserId="9314" LastEditorUserId="9314" LastEditDate="2015-11-09T16:48:20.723" LastActivityDate="2017-09-15T20:02:51.510" Title="Indentation in REPLs" Tags="|indentation|repl|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17948" PostTypeId="1" CreationDate="2015-11-09T07:16:27.400" Score="2" ViewCount="715" Body="&lt;p&gt;The below command insert the contents of the file &lt;code&gt;myfile.txt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(insert-file-contents &quot;~/myfile.txt&quot;)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tell emacs to not insert the comments (assuming the comment syntax is known to the user and is for example&lt;code&gt;%&lt;/code&gt;). &lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2015-11-09T07:16:27.400" Title="`insert-file-contents` without the comments" Tags="|comment|insert|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17949" PostTypeId="2" ParentId="2740" CreationDate="2015-11-09T08:02:55.507" Score="1" Body="&lt;p&gt;I have also been trying to get org-mode to integrate properly with the idea of urgent vs important tasks.  Considering that they are actually supposed to be independent dimensions, I think the more natural way to represent these concepts is to map level of importance to Org's priority, and to map level of urgency to the amount of time remaining before an Org deadline arrives.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still figuring out how to make use of such a setup by creating a custom use of Org's mapping API (&lt;a href=&quot;http://orgmode.org/manual/Using-the-mapping-API.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Using-the-mapping-API.html&lt;/a&gt;) which collects tasks tagged in an appropriate way, and represents them in a table sorted first by TODO status, then by PRIORITY, then by DEADLINE.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Quite possibly Org's agenda functionality is capable of doing what i'm trying to do manually, but I've always been a bit leery of agenda seeming to &quot;lose&quot; tasks whose deadline has passed, where i actually still want to see them.)&lt;/p&gt;&#xA;" OwnerUserId="10086" LastActivityDate="2015-11-09T08:02:55.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17950" PostTypeId="1" AcceptedAnswerId="17955" CreationDate="2015-11-09T11:45:59.210" Score="1" ViewCount="655" Body="&lt;p&gt;I'm running emacs 24.5.1 under windows 7 and I'm trying to figure out how EDE works and I have a problem, I don't understand how to load the project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've created Project.ede file like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Object vmic&#xA;;; EDE Project Files are auto generated: Do Not Edit&#xA;(ede-proj-project &quot;vmic&quot;&#xA;  :file &quot;Project.ede&quot;&#xA;  :name &quot;vmic&quot;&#xA;  :targets&#xA;  (list&#xA;    (ede-proj-target-makefile-program &quot;PP-build&quot;&#xA;      :name &quot;PP-build&quot;&#xA;      :path &quot;&quot;&#xA;      :source '(&quot;platform/PP/src/pmain.c&quot;)&#xA;      :configuration-variables nil))&#xA;  :configuration-variables nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And on this stage everything looks fine. Then I'm saving the project buffers and restarting emacs. Go to menu -&gt; &quot;load project&quot; -&gt; selecting directory of Project.ede and nothing. It returns me an error &quot;&lt;em&gt;Wrong type argument: arrayp, nil&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, I tried to create myproject.el file with content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ede-cpp-root-project &quot;test&quot;&#xA;                      :file &quot;c:/Users/user/Desktop/test/Project.ede&quot;&#xA;                      :include-path '(&quot;/&quot; &quot;/common/inc&quot; &quot;/common/src&quot;)&#xA;                      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And again nothing. But if I'm trying now to load the project again it says that project is already loaded:&#xA;&quot;&lt;em&gt;ede: c:/Users/user/Desktop/test/ already has an open project associated with it&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what Am I missing Here? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="10015" LastEditorUserId="10015" LastEditDate="2015-11-09T13:27:55.760" LastActivityDate="2015-11-09T15:57:34.717" Title="EDE load project" Tags="|cedet|project|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17951" PostTypeId="2" ParentId="14673" CreationDate="2015-11-09T12:26:33.220" Score="1" Body="&lt;p&gt;Here's a way to keep it all in the &lt;code&gt;org-capture-templates&lt;/code&gt; list, without defining other functions. &lt;code&gt;org-directory&lt;/code&gt; can be changed to whatever directory you want to store the files in.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-capture-templates&#xA;             '(&quot;x&quot; &quot;Template name&quot; plain&#xA;               (file (expand-file-name&#xA;                      (format-time-string &quot;%Y-%m-%d--%H-%M-%S.org&quot;)&#xA;                      org-directory))&#xA;               &quot;This string is inserted in the capture&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastActivityDate="2015-11-09T12:26:33.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17952" PostTypeId="2" ParentId="17929" CreationDate="2015-11-09T13:28:58.610" Score="4" Body="&lt;p&gt;The problem is that ultimately &lt;code&gt;tramp-sh-handle-file-truename&lt;/code&gt; is called which needs to make remote connections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Previously Tramp also tries to handle &lt;code&gt;file-in-directory-p&lt;/code&gt; itself but since it eventually figures out that it does not implement a handler for that function and just falls back to the vanilla &lt;code&gt;file-in-directory-p&lt;/code&gt;, that doesn't cause any remote connections. Except that &lt;code&gt;file-in-directory-p&lt;/code&gt; does call &lt;code&gt;file-truename&lt;/code&gt; and that, as stated earlier, &lt;em&gt;does&lt;/em&gt; make remote connections.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This patch was applied (will be part of v2.3.1) to fix this issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el&#xA;index 271cc5f..d187cf5 100644&#xA;--- a/lisp/magit-mode.el&#xA;+++ b/lisp/magit-mode.el&#xA;@@ -833,6 +833,8 @@ (defun magit-revert-buffers (&amp;amp;optional force)&#xA;                   (--filter&#xA;                    (let ((file (buffer-file-name it)))&#xA;                      (and file&#xA;+                          (equal (file-remote-p file)&#xA;+                                 (file-remote-p topdir))&#xA;                           (file-in-directory-p file topdir)&#xA;                           (member (file-relative-name file topdir) tracked)))&#xA;                    (buffer-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This checks whether the &lt;code&gt;file&lt;/code&gt; (each file which is being visited in some buffer in turn) and the directory/repository &lt;code&gt;topdir&lt;/code&gt; are located on the same remote (&lt;code&gt;nil&lt;/code&gt; for the local machine) before checking whether the file is located inside that directory. Obviously a file cannot possibly be located inside a directory which isn't even located on the same machine, so in that case we can bail before performing the more expensive check.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-11-09T16:10:56.710" LastActivityDate="2015-11-09T16:10:56.710" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17953" PostTypeId="1" AcceptedAnswerId="18025" CreationDate="2015-11-09T13:39:06.363" Score="1" ViewCount="130" Body="&lt;p&gt;I'm using SSH to connect to remote server. On the server, I'm running emacs (&lt;code&gt;emacsclient -c&lt;/code&gt;). It servers as my console, text editor and WM. While everything works nice when I'm not dealing with cyryllic, when I'm to work with cyryllic letters, it gets bad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a file, let's call it &lt;code&gt;x&lt;/code&gt;, with &quot;Юра&quot; string in it. If I &lt;code&gt;cat&lt;/code&gt; the file from console(without using Emacs), I get proper output. However, if I open it in Emacs, or &lt;code&gt;cat&lt;/code&gt; it from &lt;code&gt;ansi-term&lt;/code&gt;, I get the following output:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;\u042E\u0440\u0430&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now that's obviously not something I want. How can I make Emacs display the cyryllic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;locale&lt;/code&gt; is the same both under &lt;code&gt;ansi-term&lt;/code&gt; and the terminal Emacs's running in(the one where russina letters are displayed correctly).&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2015-11-12T15:45:27.213" Title="Emacs doesn't show cyryllic properly over SSH" Tags="|character-encoding|display|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17954" PostTypeId="1" AcceptedAnswerId="17956" CreationDate="2015-11-09T15:26:39.837" Score="5" ViewCount="1181" Body="&lt;p&gt;I have the following in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'latex-mode-hook #'outine-minor-mode)&#xA;(add-hook 'latex-mode-hook&#xA;      (lambda ()&#xA;          (outline-minor-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I am aware this redundant, I am just trying to demonstrate that neither method works). Yet, when I open a &lt;code&gt;*.tex&lt;/code&gt; file I see the following upon executing &lt;code&gt;C-h m&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption         &#xA;Column-Number File-Name-Shadow Font-Lock Global-Font-Lock&#xA;Global-Hl-Line Global-Linum Line-Number Linum Mouse-Wheel Openwith   &#xA;Override-Global Tex-Pdf Tool-Bar Tooltip Transient-Mark&#xA;&#xA;(Information about these minor modes follows the major mode info.)&#xA;LaTeX/P mode defined in `tex-site.el':&#xA;Major mode in AUCTeX for editing LaTeX files.&#xA;See info under AUCTeX for full documentation.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand from the above list of minor modes that the &lt;code&gt;outline-minor-mode&lt;/code&gt; has not turned on. Why?&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-11-09T16:12:31.637" Title="how to start outline-minor-mode with latex-mode?" Tags="|latex|outline-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17955" PostTypeId="2" ParentId="17950" CreationDate="2015-11-09T15:57:34.717" Score="0" Body="&lt;p&gt;Finally I found a solution here: &lt;a href=&quot;http://www.emacswiki.org/emacs/CEDET_Quickstart&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/CEDET_Quickstart&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just add these strings to init.el and &quot;load project&quot; will work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cedet)&#xA;(require 'eieio)&#xA;(require 'eieio-speedbar)&#xA;(require 'eieio-opt)&#xA;(require 'eieio-base)&#xA;(require 'ede/source)&#xA;(require 'ede/base)&#xA;(require 'ede/auto)&#xA;(require 'ede/proj)&#xA;(require 'ede/proj-archive)&#xA;(require 'ede/proj-aux)&#xA;(require 'ede/proj-comp)&#xA;(require 'ede/proj-elisp)&#xA;(require 'ede/proj-info)&#xA;(require 'ede/proj-misc)&#xA;(require 'ede/proj-obj)&#xA;(require 'ede/proj-prog)&#xA;(require 'ede/proj-scheme)&#xA;(require 'ede/proj-shared)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after &lt;strong&gt;sr-speedbar-toggle&lt;/strong&gt; then &lt;strong&gt;ede-speedbar&lt;/strong&gt; and voilà all you targets and connected files in front of you.&lt;/p&gt;&#xA;" OwnerUserId="10015" LastActivityDate="2015-11-09T15:57:34.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17956" PostTypeId="2" ParentId="17954" CreationDate="2015-11-09T15:58:08.937" Score="4" Body="&lt;p&gt;&lt;code&gt;latex-mode-hook&lt;/code&gt; is the hook for the default Emacs latex mode. You appear to be using AUCTeX, which uses the hook &lt;code&gt;LaTeX-mode-hook&lt;/code&gt; (note capitalization). More info in the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Modes-and-Hooks.html&quot; rel=&quot;nofollow&quot;&gt;AUCTeX manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-11-09T15:58:08.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17957" PostTypeId="2" ParentId="17954" CreationDate="2015-11-09T16:12:31.637" Score="0" Body="&lt;p&gt;You're using AUCTex.  According to the documentation (section 5.1, use C-h i m auctex [RET] to read it in emacs), the hook name for AUCtex is actually &lt;code&gt;LaTeX-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So just use instead&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'outline-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The hook &lt;code&gt;latex-mode-hook&lt;/code&gt; also exists (see section 25.10.4 of emacs manual) but is used by emacs native tex/latex mode (when AUCTex is not loaded).  This is arguably confusing.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-09T16:12:31.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17958" PostTypeId="1" AcceptedAnswerId="17961" CreationDate="2015-11-09T16:25:29.253" Score="3" ViewCount="440" Body="&lt;p&gt;Say there is a &lt;code&gt;defmacro&lt;/code&gt; defined like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro do-something (foo &amp;amp;optional bar)&#xA;  (...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then there is another one that calls it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro something-else (wat baz &amp;amp;optional bar)&#xA;  (let ((foo (concat wat baz)))&#xA;    (do-something ...)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the best practice for calling &lt;code&gt;do-something&lt;/code&gt; from within&#xA;&lt;code&gt;something-else&lt;/code&gt; with the let variable &lt;code&gt;foo&lt;/code&gt;, and &lt;code&gt;bar&lt;/code&gt; only if it&#xA;exists as an argument passed into &lt;code&gt;something-else&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know you could conditionally check the presence of &lt;code&gt;bar&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (if bar&#xA;        (do-something foo bar)&#xA;      (do-something foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ideally I'm looking for some pattern where I can prepare a list of&#xA;argument variables and call &lt;code&gt;do-something&lt;/code&gt; once, with something like&#xA;&lt;code&gt;(apply)&lt;/code&gt; for macros, where a list variable can be turned into a&#xA;variable series of consecutive arguments. Or maybe I'm just thinking&#xA;about this in the wrong manner?&lt;/p&gt;&#xA;" OwnerUserId="264" LastEditorUserId="105" LastEditDate="2016-03-14T00:36:40.663" LastActivityDate="2016-03-14T00:36:40.663" Title="Calling a macro from a macro with a variable number of arguments" Tags="|elisp-macros|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17960" PostTypeId="1" AcceptedAnswerId="17964" CreationDate="2015-11-09T17:12:24.533" Score="4" ViewCount="679" Body="&lt;p&gt;I have tried to code my &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; to show only todo's which are either priority &lt;code&gt;A&lt;/code&gt; or priority &lt;code&gt;B&lt;/code&gt;. However, I am only able to do this indirectly, by filtering out todo's that are NOT priority &lt;code&gt;C&lt;/code&gt;. Why doesn't the or-function &lt;code&gt;|&lt;/code&gt; in my code below work the way I want? (alternative 2 and 3).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '(&#xA;  (&quot;d&quot; &quot;Daily &quot;(&#xA;    (tags-todo &quot;+TODO=\&quot;TODO\&quot; -PRIORITY=\&quot;C\&quot; &quot;  ( ; works&#xA;    (org-agenda-sorting-strategy '(priority-down))&#xA;    ))&#xA;  (tags-todo &quot;+TODO=\&quot;TODO\&quot; +PRIORITY={\&quot;B\&quot;|\&quot;A\&quot;} &quot;  ( ; works NOT&#xA;    (org-agenda-sorting-strategy '(priority-down))&#xA;    ))&#xA;  (tags-todo &quot;+TODO=\&quot;TODo\&quot;  {+PRIORITY=\&quot;B\&quot;}|{+PRIORITY=\&quot;A\&quot;} &quot;  ( ; works NOT&#xA;    (org-agenda-sorting-strategy '(priority-down))&#xA;    ))&#xA;  ))&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternative 2 and 3 using the or-function &lt;code&gt;|&lt;/code&gt; results in showing &lt;code&gt;A&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt; and &lt;code&gt;C&lt;/code&gt;, not only priority &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;, as was my intention. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is wrong with my usage of the &quot;|&quot; function? How can I use &lt;code&gt;|&lt;/code&gt; to show both priority &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2015-11-09T22:59:04.977" Title="Emacs org mode: How to use &quot;or&quot; in org-agenda-custom-command" Tags="|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17961" PostTypeId="2" ParentId="17958" CreationDate="2015-11-09T17:45:15.530" Score="1" Body="&lt;p&gt;Based on the code you've written, you can simply replace this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if bar&#xA;    (do-something foo bar)&#xA;  (do-something foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(do-something foo bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because optional arguments default to &lt;code&gt;nil&lt;/code&gt;. From the Emacs Lisp manual: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If actual arguments for the optional and rest variables are omitted, then they always default to nil. There is no way for the function to distinguish between an explicit argument of nil and an omitted argument.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-11-09T19:17:02.537" LastActivityDate="2015-11-09T19:17:02.537" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17962" PostTypeId="2" ParentId="17431" CreationDate="2015-11-09T18:09:21.543" Score="17" Body="&lt;p&gt;I favor using &lt;code&gt;custom-theme-set-faces&lt;/code&gt; to redefine how the theme displays a particular face, e.g.,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-theme-set-faces&#xA; 'zenburn&#xA; '(font-lock-comment-face ((t (:foreground &quot;#DFAF8F&quot;))))&#xA; '(font-lock-comment-delimiter-face ((t (:foreground &quot;#DFAF8F&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the specific case of &lt;code&gt;zenburn&lt;/code&gt;, the theme itself defines various colors and a macro in which those are bound to variable names, so you can write the above as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(zenburn-with-color-variables&#xA;  (custom-theme-set-faces&#xA;   'zenburn&#xA;   `(font-lock-comment-face ((t (:foreground ,zenburn-orange))))&#xA;   `(font-lock-comment-delimiter-face ((t (:foreground ,zenburn-orange))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-11-09T18:09:21.543" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17963" PostTypeId="1" AcceptedAnswerId="17968" CreationDate="2015-11-09T22:22:00.910" Score="1" ViewCount="170" Body="&lt;p&gt;Today I decided to install emacs and give it a try. I followed some tutorials/examples/explanations and managed to install &lt;code&gt;Python Jedi&lt;/code&gt; for getting suggestions while coding / code completion. It does that nicely, but there is one issue with it. The list with the completion suggestions is so wide, that the documentation strings don't have any space anymore and are squeezed into a single column. A screenshot will help to show what I am talking about: &lt;a href=&quot;http://i.snag.gy/UQM6R.jpg&quot; rel=&quot;nofollow&quot;&gt;screenshot&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how I could fix this? (Keep in mind, I only installed emacs today and it's totally new to me.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After solving the issue, my .emacs file contains these lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook 'jedi:setup)&#xA;(setq jedi:complete-on-dot t)&#xA;(setq jedia:ac-max-width 0.5) ; This line solved the issue.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10090" LastEditorUserId="10090" LastEditDate="2015-11-10T12:53:27.507" LastActivityDate="2015-11-10T12:53:27.507" Title="Python Jedi Completion layout unusable" Tags="|python|completion|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17964" PostTypeId="2" ParentId="17960" CreationDate="2015-11-09T22:59:04.977" Score="8" Body="&lt;p&gt;The contents of &lt;code&gt;{}&lt;/code&gt; in an agenda command are regular expressions.  So something like &lt;code&gt;PRIORITY={\&quot;B\&quot;|\&quot;A\&quot;}&lt;/code&gt; will only match if &lt;code&gt;PRIORITY&lt;/code&gt; is &lt;code&gt;&quot;A&quot;&lt;/code&gt; or &lt;code&gt;&quot;B&quot;&lt;/code&gt;, including the quotes.  You also need more escaping in you regex (&lt;code&gt;\\|&lt;/code&gt; instead of &lt;code&gt;|&lt;/code&gt;).  A regex won't work if you don't pay the slash tax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct search is &lt;code&gt;+PRIORITY={A\\|B}&lt;/code&gt;.  You can also simplify things a little by using the &lt;code&gt;/&lt;/code&gt; syntax.  Anything following a &lt;code&gt;/&lt;/code&gt; is assumed to be a &lt;code&gt;TODO&lt;/code&gt; keyword.  So &lt;code&gt;+PRIORITY={A\\|B}/TODO&lt;/code&gt; will find all entries with keyword &lt;code&gt;TODO&lt;/code&gt; and priority &lt;code&gt;A&lt;/code&gt; or &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-11-09T22:59:04.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17965" PostTypeId="1" AcceptedAnswerId="17970" CreationDate="2015-11-09T23:01:38.423" Score="6" ViewCount="1857" Body="&lt;p&gt;Company-mode gives me a popup with options, but once I press C-n to navigate through the options, the popup disappears (I can still cycle through the options , but they are shown inline). I want the popup to remain open until I make my selection. Is this a customizable behavior (for instance, &lt;a href=&quot;https://www.youtube.com/watch?v=HKF41ivkBb0&quot; rel=&quot;noreferrer&quot;&gt;this screencast&lt;/a&gt; shows a company-mode popup which remains open while he cycles through values)?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could some other mode be interfering and closing the popup (e.g., evil-mode)? How would I go about debugging that (I'm new to emacs)? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10091" LastActivityDate="2020-04-02T19:14:15.660" Title="Company mode popup closes after C-n" Tags="|company-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17967" PostTypeId="2" ParentId="17692" CreationDate="2015-11-10T02:22:58.123" Score="1" Body="&lt;p&gt;After reading the question @lawlist referred to, I put together the following. It seems to work (and I learned something new):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-transient-map&#xA; `(keymap&#xA;   (27 . (menu-item &quot;&quot;&#xA;                    ,(lambda () (interactive) (message &quot;Escape pressed&quot;))&#xA;                    :filter&#xA;                    ,(lambda (binding)&#xA;                       (let ((keys (this-command-keys-vector)))&#xA;                         (if (and (&amp;gt; (length keys) 0)&#xA;                                  (eq (aref keys 0) 27))&#xA;                             binding&#xA;                           nil)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Clearly, this is not a menu item, but it seems as though the menu system contains bells and whistles that can be used for normal key bindings as well.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-10T02:22:58.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17968" PostTypeId="2" ParentId="17963" CreationDate="2015-11-10T03:09:43.753" Score="3" Body="&lt;p&gt;You can configure max width by &lt;code&gt;ac-max-width&lt;/code&gt;. Could you set its value, for example &lt;code&gt;0.5&lt;/code&gt; as below ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ac-max-width 0.5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suppose this issue is not occurred in &lt;a href=&quot;https://github.com/syohex/emacs-company-jedi/&quot; rel=&quot;nofollow&quot;&gt;company-jedi&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5415" LastActivityDate="2015-11-10T03:09:43.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17969" PostTypeId="2" ParentId="17915" CreationDate="2015-11-10T07:56:05.343" Score="4" Body="&lt;p&gt;It's unlikely that there will be a solution here that will satisfy every user of the json package, since the problem is that elisp and json have differing semantics. In Lisp, the empty list and the lack of a value (nil) are the same thing. In Javascript (and therefore JSON), the empty array, the &quot;empty&quot; object,  the boolean false value, and a lack of a value are three different things. Any mapping between Lisp and Javascript will thus be a matter of compromises.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend defining some advice which changes how json-encode works; just test to see if the object argument is nil and return what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice json-encode (around encode-nil-as-json-empty-object activate)&#xA;  (if (null object)&#xA;    (setq ad-return-value &quot;{}&quot;)&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will work in the normal recursive case, as the advice will modify the definition of json-encode; the recursive calls will naturally call the modified code.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-10T07:56:05.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17970" PostTypeId="2" ParentId="17965" CreationDate="2015-11-10T08:11:11.183" Score="11" Body="&lt;p&gt;&lt;code&gt;company-mode&lt;/code&gt; does not rebind &lt;kbd&gt;C-n&lt;/kbd&gt; or &lt;kbd&gt;C-p&lt;/kbd&gt; probably to minimize interference with normal editing commands. To cycle through options, Company uses &lt;kbd&gt;up&lt;/kbd&gt;, &lt;kbd&gt;down&lt;/kbd&gt;, &lt;kbd&gt;M-n&lt;/kbd&gt;, and &lt;kbd&gt;M-p&lt;/kbd&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;C-h f&lt;/kbd&gt; &lt;code&gt;company-mode&lt;/code&gt; to peruse the mode specific documentation for Company. It will show the available bindings for the company popup when it is active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if you do want &lt;kbd&gt;C-n&lt;/kbd&gt; and &lt;kbd&gt;C-p&lt;/kbd&gt; in addition to the existing bindings the following elisp should help. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key company-active-map (kbd &quot;C-n&quot;) 'company-select-next-or-abort)&#xA;(define-key company-active-map (kbd &quot;C-p&quot;) 'company-select-previous-or-abort)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2015-11-10T08:18:23.460" LastActivityDate="2015-11-10T08:18:23.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17972" PostTypeId="1" AcceptedAnswerId="17974" CreationDate="2015-11-10T08:59:06.897" Score="4" ViewCount="657" Body="&lt;p&gt;I'm using AUCTeX to edit LaTeX files. The behavior of the fill command &lt;kbd&gt;M-q&lt;/kbd&gt; (also &lt;kbd&gt;C-c C-q C-p&lt;/kbd&gt;, &lt;code&gt;LaTeX-fill-paragraph&lt;/code&gt;) is very erratic. For example, if I have the following text:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-tex prettyprint-override&quot;&gt;&lt;code&gt;test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;filling it yields:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-tex prettyprint-override&quot;&gt;&lt;code&gt;test $1 + 1 = 2$&#xA;test $1 + 1 = 2$&#xA;test $1 + 1 = 2$&#xA;test $1 + 1 = 2$&#xA;test $1 + 1 = 2$&#xA;test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is clearly not ideal. However, I have auto-fill-mode enabled, and if I take the text from the beginning and manually add a space at the end of the line, the auto-fill does this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-tex prettyprint-override&quot;&gt;&lt;code&gt;test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$&#xA;test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$ test $1 + 1 = 2$&#xA;test $1 + 1 = 2$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is infinitely better. Is there a way I can configure the fill-command to work correctly? I'm using Emacs 24.5.1 on Windows and AUCTeX 11.88.9.&lt;/p&gt;&#xA;" OwnerUserId="10098" LastEditorUserId="620" LastEditDate="2015-11-10T10:07:25.887" LastActivityDate="2015-11-13T10:25:17.610" Title="Why does filling in AUCTeX behave so badly?" Tags="|auctex|fill-paragraph|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17973" PostTypeId="1" CreationDate="2015-11-10T09:09:06.327" Score="4" ViewCount="419" Body="&lt;p&gt;My flymake configuration &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; flymake&#xA;(require 'flymake-cursor)  ;; Hoover over error to show help message&#xA;&#xA;;; use pyflakes for Python&#xA;(when (load &quot;flymake&quot; t)&#xA;  (defun flymake-pyflakes-init ()&#xA;    (let* ((temp-file (flymake-init-create-temp-buffer-copy&#xA;                       'flymake-create-temp-inplace))&#xA;           (local-file (file-relative-name&#xA;                        temp-file&#xA;                        (file-name-directory buffer-file-name))))&#xA;      (list &quot;pyflakes&quot; (list local-file))))&#xA;&#xA;  (add-to-list 'flymake-allowed-file-name-masks&#xA;               '(&quot;\\.py\\'&quot; flymake-pyflakes-init)))&#xA;&#xA;(add-hook 'find-file-hook 'flymake-find-file-hook)&#xA;&#xA;(add-hook 'python-mode-hook 'flymake-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works fine locally but breaks when I try to edit files remotely. I have no intention of fixing that, I'm almost not using it, how can I disable it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9088" LastActivityDate="2016-08-08T12:18:57.090" Title="How to disable flymake for files edited over network with TRAMP?" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17974" PostTypeId="2" ParentId="17972" CreationDate="2015-11-10T10:04:48.790" Score="5" Body="&lt;p&gt;The behavior of filling of math switches is controlled by the &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#index-LaTeX_002dfill_002dbreak_002dat_002dseparators&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;LaTeX-fill-break-at-separators&lt;/code&gt;&lt;/a&gt; variable and there are currently discussions about its best default value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently came up with with setting&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq LaTeX-fill-break-at-separators '(\\\( \\\[))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which fulfills the goal of keeping math formulae in the the same line (this is useful for example for &lt;code&gt;preview-latex&lt;/code&gt;) and to provide a somewhat pleasing filling.  With the above setting, your code is filled as you expected (&lt;code&gt;fill-column&lt;/code&gt; set to &lt;code&gt;70&lt;/code&gt;).  As &lt;a href=&quot;https://emacs.stackexchange.com/questions/17972/why-does-filling-in-auctex-behave-so-badly/17974?noredirect=1#comment26947_17974&quot;&gt;suggested&lt;/a&gt; by Omar Antolín-Camarena in comments,  it should be noted that the presence of the opening &lt;code&gt;\(&lt;/code&gt; in that list affects also the behavior of &lt;code&gt;$&lt;/code&gt; as AUCTeX treats them in the same way.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For the record, the above value &lt;code&gt;LaTeX-fill-break-at-separators&lt;/code&gt; is now the default in the just released AUCTeX 11.89.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2015-11-13T10:25:17.610" LastActivityDate="2015-11-13T10:25:17.610" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17975" PostTypeId="2" ParentId="17239" CreationDate="2015-11-10T10:40:17.830" Score="4" Body="&lt;p&gt;It seems that the lilypond file is compiled into a picture that is then included in the latex file by the latex macro &lt;code&gt;\includegraphics&lt;/code&gt; which is not supposed to handle multi-page files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you apparently don't want to edit your lilypond files from the org file (you would use src blocks rather than &lt;code&gt;#+INCLUDE:&lt;/code&gt;), I would suggest that you:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;convert them to pdf outside of org (&lt;code&gt;lilypond music.ly&lt;/code&gt; in a command&#xA;line shell should create file &lt;code&gt;music.pdf&lt;/code&gt; for example),&lt;/li&gt;&#xA;&lt;li&gt;include them through &lt;code&gt;\includepdf&lt;/code&gt; from the &lt;code&gt;pdfpages&lt;/code&gt; latex package.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's a minimum working example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: test include lilypond through includepdf&#xA;#+LaTeX_HEADER: \usepackage{pdfpages}&#xA;&#xA;* intro&#xA;&#xA;bla bla&#xA;&#xA;now the music !&#xA;&#xA;\includepdf[pages=-]{music.pdf}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This turns out to be more of a latex answer than an org one.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-10T10:40:17.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17977" PostTypeId="2" ParentId="17946" CreationDate="2015-11-10T11:14:56.357" Score="4" Body="&lt;p&gt;Emacs supports multifile packages, which are essentially just TAR archives that contain arbitrary files, plus some package metadata.  However, MELPA builds these archives for you, so you don't need to concern yourself with the actual details of the package format.  Just add your resource files to the MELPA recipe of your package—take a look at &lt;a href=&quot;https://github.com/milkypostman/melpa/blob/63812707948e6dcc00e00ebc3c423469593e80fd/recipes/flycheck-haskell&quot; rel=&quot;nofollow&quot;&gt;flycheck-haskell&lt;/a&gt; for instance, which contains additional Haskell source files by the &lt;code&gt;*.hs&lt;/code&gt; glob in &lt;code&gt;:files&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Unfortunately Emacs does not provide an API for packages to load their resources.  Fortunately, though, Emacs' package format is somewhat simple:  An installed package is essentially just the tarball being extracted to disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, you can load your resources relative to your Emacs Lisp code.  Emacs provides a special variable &lt;code&gt;load-file-name&lt;/code&gt;, which contains the full path of the file currently being loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this variable to automatically determine the directory where your package is located:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst my-package-directory (file-name-directory load-file-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Later in your code you can load resources relative to &lt;code&gt;my-package-directory&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(play-sound (expand-file-name &quot;resources/my-sound-file.mp3&quot; my-package-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This loads the file &lt;code&gt;resources/my-sound-file.mp3&lt;/code&gt; from your package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, though, that you &lt;em&gt;cannot&lt;/em&gt; use &lt;code&gt;load-file-name&lt;/code&gt; inside functions.  You &lt;strong&gt;must&lt;/strong&gt; use it on a top-level form, because it's only defined while the package is being loaded, i.e. while it's top-level forms are evaluated.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-11-10T11:14:56.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17978" PostTypeId="2" ParentId="14878" CreationDate="2015-11-10T11:53:55.700" Score="1" Body="&lt;p&gt;This macro does the trick.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro condstrings (f1 f2 &amp;amp;rest strings)&#xA;  `(cond ,@(mapcar (lambda (s)&#xA;                     `((,f1 ,s) (,f2 ,s)))&#xA;                   strings)))&#xA;&#xA;(condstrings firstFunction secondFunction str1 str2 str3 str4 str5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it's a concern that the strings are each evaluated twice then you can use the &lt;code&gt;once-only&lt;/code&gt; macro defined &lt;a href=&quot;http://www.emacswiki.org/emacs/macro-utils.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="283" LastEditorUserId="283" LastEditDate="2015-11-10T12:45:37.620" LastActivityDate="2015-11-10T12:45:37.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17979" PostTypeId="1" CreationDate="2015-11-10T12:57:57.690" Score="0" ViewCount="114" Body="&lt;p&gt;When I do a double click, I don't see any selection.&#xA;Is there anything I need to enable to make it work?&#xA;Other mouse functionalities work fine.&#xA;See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Word-and-Line-Mouse.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Word-and-Line-Mouse.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my mouse configuration&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Enable mouse support&#xA;  (require 'mouse)&#xA;  (xterm-mouse-mode t)&#xA;  (global-set-key [mouse-4] (lambda ()&#xA;                              (interactive)&#xA;                              (scroll-down 1)))&#xA;  (global-set-key [mouse-5] (lambda ()&#xA;                              (interactive)&#xA;                              (scroll-up 1)))&#xA;  (defun track-mouse (e))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;I use emacs through a terminal: I ssh from ubuntu terminal to a remote machine and run emacs -nw on the remote machine.&lt;/p&gt;&#xA;" OwnerUserId="10018" LastEditorUserId="105" LastEditDate="2019-12-26T23:23:49.917" LastActivityDate="2019-12-26T23:23:49.917" Title="Double-Mouse-1 doesn't do selection" Tags="|mouse|config|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="17981" PostTypeId="1" CreationDate="2015-11-10T13:15:11.477" Score="6" ViewCount="289" Body="&lt;p&gt;Whenever Git fails (e.g. if you try to rebase when your working tree has changes), Magit writes the following message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Git failed ... [See buffer *magit-process: ... for details]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which is then immediately obscured with other stuff like&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Reverting (up to) 670 file-visiting buffer(s)...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words it is &lt;em&gt;extremely&lt;/em&gt; non-obvious when and why something fails, especially if you don't watch it closely, e.g. commit and switch to a different desktop, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to make Magit bark hard when Git underneath it fails, e.g. pop some buffer?&lt;/p&gt;&#xA;" OwnerDisplayName="user8782" LastActivityDate="2020-03-06T02:13:59.373" Title="Any way to make git errors more prominent in Magit?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17983" PostTypeId="1" AcceptedAnswerId="17986" CreationDate="2015-11-10T13:43:46.550" Score="2" ViewCount="480" Body="&lt;p&gt;I would like to view the (MD5) hash of the file at point in a &lt;code&gt;dired&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be done?&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="253" LastEditDate="2015-11-10T14:49:12.627" LastActivityDate="2015-11-10T14:49:12.627" Title="Display the hash of a file" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17984" PostTypeId="1" AcceptedAnswerId="18033" CreationDate="2015-11-10T13:51:59.997" Score="6" ViewCount="902" Body="&lt;p&gt;For terminal, there is an app called byobu which shows different mode line based on host.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I open terminal in system 1, mode line will be like this.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/4R5Gq.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4R5Gq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I ssh into system2 from system1, mode line will automatically changes to something like this.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/K6dT9.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/K6dT9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I ssh into system3, mode line will change to something like this.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Uf8po.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Uf8po.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs, when I open a file/dired using tramp, I want to change mode line color automatically.&#xA;How can I achieve that?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-11-12T21:35:33.960" Title="How to change mode line color based on host?" Tags="|themes|tramp|mode-line|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17985" PostTypeId="1" AcceptedAnswerId="17987" CreationDate="2015-11-10T14:09:40.767" Score="2" ViewCount="761" Body="&lt;p&gt;I have a defun get-quotes with one mandatory and 2 optional arguments.  I would like to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((articles &#xA;       '(&quot;/home/matt/art/mice.pdf&quot; '(&quot;/home/matt/art/cats.pdf&quot; &quot;Smith, &quot;Neural Pathways in Cat Brains&quot; 3)))&#xA;  (dolist (thisarticle articles)&#xA;     (get-quotes (SOMEFUNCTION thisarticle)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where SOMEFUNCTION checks thisarticle, and if it's a string, passes it directly as an argument, or if it's a list, makes it available to get-quotes as a set of elements (rather than a list object).  My understanding of elisp is pretty vague, so I may be missing some fundamental point. Many thanks for the help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The possible dupe in @Drew's post is quite helpful, but since the new answer from @abo-abo was a little easier for me to follow, I'm going to accept it rather than the slightly more technical answer in the earlier question.  Thanks to everyone though.&lt;/p&gt;&#xA;" OwnerUserId="10102" LastEditorUserId="105" LastEditDate="2016-03-14T04:45:56.293" LastActivityDate="2016-03-14T04:45:56.293" Title="turn a list into a set of arguments for a function" Tags="|list|arguments|apply|" AnswerCount="1" CommentCount="2" ClosedDate="2016-10-11T16:12:42.777" ContentLicense="CC BY-SA 3.0" />
  <row Id="17986" PostTypeId="2" ParentId="17983" CreationDate="2015-11-10T14:16:42.363" Score="4" Body="&lt;p&gt;To run shell command &lt;code&gt;md5&lt;/code&gt; on file-at-point in dired, use &lt;code&gt;! md5&lt;/code&gt; (Here &lt;code&gt;!&lt;/code&gt; runs &lt;code&gt;dired-do-shell-command&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-11-10T14:16:42.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17987" PostTypeId="2" ParentId="17985" CreationDate="2015-11-10T14:21:09.457" Score="2" Body="&lt;p&gt;Something like this, the new function to learn is &lt;code&gt;apply&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun get-quotes (x &amp;amp;rest y)&#xA;  (cons x y))&#xA;(let ((articles&#xA;       '(&quot;/home/matt/art/mice.pdf&quot;&#xA;         (&quot;/home/matt/art/cats.pdf&quot;&#xA;          &quot;Smith, \&quot;Neural Pathways in Cat Brains\&quot;&quot;&#xA;          3))))&#xA;  (dolist (thisarticle articles)&#xA;    (if (stringp thisarticle)&#xA;        (get-quotes thisarticle)&#xA;      (apply 'get-quotes thisarticle))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-10T14:21:09.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17988" PostTypeId="1" AcceptedAnswerId="17989" CreationDate="2015-11-10T16:20:23.083" Score="5" ViewCount="1420" Body="&lt;p&gt;How can I set which pdf viewer org-export uses when it exports to latex and pdf and views?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the command &lt;code&gt;C-c C-e l o&lt;/code&gt; with default keybindings (Emacs 24.5). Currently it always uses xpdf, even though I am using pdf-tools and have set AUCTeX to use Zathura. I have also tried setting the &lt;code&gt;openwith-associations&lt;/code&gt; variable to no avail.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="2274" LastEditDate="2015-11-12T03:02:14.763" LastActivityDate="2015-11-12T03:02:14.763" Title="Variable to Set org-export pdf viewer" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17989" PostTypeId="2" ParentId="17988" CreationDate="2015-11-10T19:12:42.007" Score="8" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;org-file-apps&lt;/code&gt; is a variable defined in ‘org.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: External applications for opening ‘file:path’ items in&#xA;  a document. Org-mode uses system defaults for different file types,&#xA;  but you can use this variable to set the application for a given file&#xA;  extension.  The entries in this list are cons cells where the car&#xA;  identifies files and the cdr the corresponding command.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Read the full documentation to find out the different ways to configure the variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple example would be something like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-file-apps '(&quot;\\.pdf&quot; . &quot;some shell command %s&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-11-10T19:12:42.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17990" PostTypeId="1" CreationDate="2015-11-10T21:01:30.777" Score="13" ViewCount="10367" Body="&lt;p&gt;I switched from sublime text to emacs a while back, and while I feel emacs is much nicer, its autocompletion is really lacking in responsiveness.&#xA;I went and customized company so that it would try to complete after two characters had been typed and so the delay was only 0.1s, but it doesn't show up half the time and when it does, it's really not useful. Has anyone else had success in getting company to be as responsive as sublime/visual studio/eclipse? Any other IDE really.&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2016-06-13T21:45:54.067" Title="Speeding up company mode?" Tags="|completion|company-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17991" PostTypeId="2" ParentId="17925" CreationDate="2015-11-10T21:29:20.017" Score="1" Body="&lt;h1&gt;If using Org Mode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;See answers to &lt;a href=&quot;https://emacs.stackexchange.com/questions/10012/a-search-interface-for-org-mode-files&quot;&gt;this question&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;If not using Org Mode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Look at &lt;a href=&quot;https://github.com/jrblevin/deft&quot; rel=&quot;nofollow&quot;&gt;Deft package for Emacs&lt;/a&gt;. It isn't exactly oriented to tagging approach, rather fulltext search, and it is  recursive, i.e. contents of subfolders are included too&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Also&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You may also try contacting author to provide missing functionality&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Generally&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This feature requires regex-like functions and a convention for tags (can be org-mode file tags)&lt;/p&gt;&#xA;" OwnerUserId="8526" LastActivityDate="2015-11-10T21:29:20.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17992" PostTypeId="1" CreationDate="2015-11-10T23:38:04.507" Score="4" ViewCount="490" Body="&lt;p&gt;I can insert a date 2-days from now with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C c .&lt;/code&gt; and then +2 or +2d among many other possibilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the equivalent for time? What can I use instead of &lt;code&gt;+2d&lt;/code&gt; for inserting a date+time in two hours (or whatever other time from now). I tried &lt;code&gt;+2h&lt;/code&gt; and &lt;code&gt;+2:00&lt;/code&gt;, but no luck. &lt;/p&gt;&#xA;" OwnerUserId="10108" LastEditorUserId="10108" LastEditDate="2015-11-11T00:49:40.373" LastActivityDate="2015-11-11T06:49:00.600" Title="Org mode: Insert time+date +2 hours" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17993" PostTypeId="1" CreationDate="2015-11-11T01:41:36.693" Score="2" ViewCount="318" Body="&lt;p&gt;I have a function that opens a buffer in order to extract some information from it, then switches back to the original buffer and inserts some text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion &#xA;  (find-file ThisFile)&#xA;  (setq results some-function))&#xA;(insert results)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The brief flash when emacs switches to the new buffer is disconcerting. Is it possible to suppress the buffer -- I guess, keep it at the bottom of the buffer stack?  &lt;/p&gt;&#xA;" OwnerUserId="10102" LastEditorUserId="105" LastEditDate="2016-03-14T04:45:36.573" LastActivityDate="2016-03-14T04:45:36.573" Title="find-file, but suppress buffer?" Tags="|buffers|files|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17994" PostTypeId="2" ParentId="17993" CreationDate="2015-11-11T02:05:37.893" Score="-2" Body="&lt;p&gt;I had a problem with visual-bell. Try this for gui Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq visible-bell nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or this for terminal Emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq visible-bell t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One of these will fix it. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-11-11T02:05:37.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17995" PostTypeId="2" ParentId="17992" CreationDate="2015-11-11T06:49:00.600" Score="3" Body="&lt;p&gt;No, not quite. You can type a timestamp with a range in it like 11:30+2 to get &amp;lt;2015-11-10 Tue 11:30-13:30&gt;; perhaps that could suffice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could edit (or rather redefine) the function &lt;code&gt;org-read-date-analyze&lt;/code&gt; so that it supports &quot;+2h&quot; in addition to &quot;+2d&quot;. The function is quite long, so I won't include the whole thing here, but if you look at line 16653 of lisp/org/org.el (at least in my version, might have moved up or down since) you'll see this section:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(deltan&#xA; (setq futurep nil)&#xA; (unless deltadef&#xA;   (let ((now (decode-time (current-time))))&#xA;     (setq day (nth 3 now) month (nth 4 now) year (nth 5 now))))&#xA; (cond ((member deltaw '(&quot;d&quot; &quot;&quot;)) (setq day (+ day deltan)))&#xA;       ((equal deltaw &quot;w&quot;) (setq day (+ day (* 7 deltan))))&#xA;       ((equal deltaw &quot;m&quot;) (setq month (+ month deltan)))&#xA;       ((equal deltaw &quot;y&quot;) (setq year (+ year deltan)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you type something like &quot;+2d&quot; &lt;code&gt;deltan&lt;/code&gt; gets set to the integer part and deltaw to the suffix. This clause first checks that deltan has a value. Tf it does then it first sets the variables &lt;code&gt;day&lt;/code&gt;, &lt;code&gt;months&lt;/code&gt;, and &lt;code&gt;year&lt;/code&gt; then uses the suffix to choose which one to modify.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function ultimately returns &lt;code&gt;(list second minute hour day month year)&lt;/code&gt;, so we can just extend this clause to modifiy of the &lt;code&gt;hour&lt;/code&gt; variable as well. There is, however, a wrinkle. We must also set a dynamic variable in order to signal to our caller that the user explicitly entered a time, otherwise the caller will ignore the time information and just insert a date stamp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(deltan&#xA; (setq futurep nil)&#xA; (unless deltadef&#xA;   (let ((now (decode-time (current-time))))&#xA;     (setq hour (nth 2 now) day (nth 3 now) month (nth 4 now) year (nth 5 now))))&#xA; (cond ((equal deltaw &quot;h&quot;)&#xA;        (setq org-time-was-given t)&#xA;        (setq hour (+ hour deltan)))&#xA;       (member deltaw '(&quot;d&quot; &quot;&quot;)) (setq day (+ day deltan)))&#xA;       ((equal deltaw &quot;w&quot;) (setq day (+ day (* 7 deltan))))&#xA;       ((equal deltaw &quot;m&quot;) (setq month (+ month deltan)))&#xA;       ((equal deltaw &quot;y&quot;) (setq year (+ year deltan)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tested this locally and it works just fine.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-11T06:49:00.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17997" PostTypeId="2" ParentId="14950" CreationDate="2015-11-11T11:08:03.637" Score="4" Body="&lt;p&gt;Turns out it has something to do with the plugin &lt;code&gt;wakatime&lt;/code&gt;. Currently the workaround is to disable &lt;code&gt;global-wakatime-mode&lt;/code&gt; when recovering a file and re-enable it afterwards. I've reported the &lt;a href=&quot;https://github.com/wakatime/wakatime-mode/issues/10&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt; but no reply yet.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2015-11-11T11:08:03.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17998" PostTypeId="1" AcceptedAnswerId="17999" CreationDate="2015-11-11T12:27:17.913" Score="3" ViewCount="58" Body="&lt;p&gt;Hello I'm currently running emacs 24.3.1 on Ubuntu 14.04. I recently discovered that I cannot call special-form-p as apparently its definition is void. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to change emacs versions or is this function defined in some library?&lt;/p&gt;&#xA;" OwnerUserId="10113" LastActivityDate="2015-11-13T11:24:44.837" Title="Symbol's function definition is void: special-form-p" Tags="|emacs24|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17999" PostTypeId="2" ParentId="17998" CreationDate="2015-11-11T12:34:15.067" Score="2" Body="&lt;p&gt;Should be defined in at least Emacs 24.5 and later:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun special-form-p (object)&#xA;  &quot;Non-nil if and only if OBJECT is a special form.&quot;&#xA;  (if (and (symbolp object) (fboundp object))&#xA;      (setq object (indirect-function object)))&#xA;  (and (subrp object) (eq (cdr (subr-arity object)) 'unevalled)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-11-13T11:24:44.837" LastActivityDate="2015-11-13T11:24:44.837" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18000" PostTypeId="1" AcceptedAnswerId="18015" CreationDate="2015-11-11T12:58:05.103" Score="4" ViewCount="1228" Body="&lt;p&gt;I am using terminal Emacs (&lt;code&gt;emacs -nw&lt;/code&gt;). Gnome terminal doesn't behave well with it (key bindings break), and KDE's Konsole is even worse. Surprisingly, when I ssh from a windows machine the behavior is much better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which terminal apps work out of the box without any tweaking for keybindings and mouse support?&lt;/p&gt;&#xA;" OwnerUserId="10018" LastEditorUserId="105" LastEditDate="2020-12-21T23:02:26.797" LastActivityDate="2020-12-22T06:58:31.177" Title="What linux terminal app is compatible with emacs keybindings?" Tags="|key-bindings|terminal-emacs|term|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18001" PostTypeId="2" ParentId="18000" CreationDate="2015-11-11T13:05:32.220" Score="1" Body="&lt;p&gt;I used suckless' &lt;a href=&quot;http://st.suckless.org/&quot; rel=&quot;nofollow&quot;&gt;st&lt;/a&gt; and &lt;a href=&quot;https://wiki.archlinux.org/index.php/Rxvt-unicode&quot; rel=&quot;nofollow&quot;&gt;rxvt-unicode&lt;/a&gt; in the past with &lt;code&gt;emacs -nw&lt;/code&gt;, both worked well with no issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are both light on resources. St is customizable through its config.h (requiring compilation at every edit, though). Rxvt is customizable through ~/.Xresources.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2015-11-11T13:05:32.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18002" PostTypeId="2" ParentId="17993" CreationDate="2015-11-11T13:11:44.203" Score="2" Body="&lt;p&gt;Thanks to @lawlist for this answer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion&#xA;   (find-file some-file)&#xA;   ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the solution is to use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (insert-file-contents some-file)&#xA;  ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This keeps the temp buffer in the background, and also eliminates the problem of stray buffers being left behind after the operation is complete.  Works perfectly!&lt;/p&gt;&#xA;" OwnerUserId="10102" LastActivityDate="2015-11-11T13:11:44.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18003" PostTypeId="1" AcceptedAnswerId="18005" CreationDate="2015-11-11T13:54:04.790" Score="12" ViewCount="1534" Body="&lt;p&gt;Modifying the reader would allow introducing new read-syntax (such as &lt;code&gt;#(hash table)&lt;/code&gt; and &lt;code&gt;'(quoted)&lt;/code&gt;).  Many Lisps have this​​​​​ capability, but no such facility seems to exist for elisp.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2022-09-18T17:38:02.563" LastActivityDate="2022-09-18T17:38:02.563" Title="How can I modify Elisp's reader?" Tags="|elisp|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18004" PostTypeId="2" ParentId="12919" CreationDate="2015-11-11T14:14:59.473" Score="8" Body="&lt;p&gt;Actually you can do it by using a wrapper of those two functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun smart-for-files ()&#xA;  &quot;Call `helm-projectile' if `projectile-project-p', otherwise&#xA;fallback to `helm-for-files'.&quot;&#xA;  (interactive)&#xA;  (if (projectile-project-p)&#xA;      (helm-projectile)&#xA;    (helm-for-files)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then set the keybinding as you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'smart-for-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10114" LastActivityDate="2015-11-11T14:14:59.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18005" PostTypeId="2" ParentId="18003" CreationDate="2015-11-11T15:00:05.070" Score="12" Body="&lt;p&gt;Turns out that the manual implies that you can't actually do reader macros.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/cl/Porting-Common-Lisp.html&quot;&gt;Appendix C Porting Common Lisp&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Reader macros. Common Lisp includes a second type of macro that works at the level of individual characters. For example, Common Lisp implements the quote notation by a reader macro called ', whereas Emacs Lisp’s parser just treats quote as a special case. &lt;strong&gt;Some Lisp packages use reader macros to create special syntaxes for themselves, which the Emacs parser is incapable of reading.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-11-11T15:00:05.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18007" PostTypeId="1" AcceptedAnswerId="18009" CreationDate="2015-11-11T16:10:31.277" Score="5" ViewCount="492" Body="&lt;p&gt;I tried many different folding plugins for Emacs and ended up using &lt;a href=&quot;http://www.emacswiki.org/emacs/FoldingMode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;folding-mode&lt;/code&gt;&lt;/a&gt; as I used &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/fold.html&quot; rel=&quot;nofollow&quot;&gt;Vim's folding marks&lt;/a&gt; and so my files contain a large number of folding marks. I am currently in the process of switching from Vim to Emacs (&lt;code&gt;evil-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I miss that my file is fully folded when I open it. Does anyone know how to force &lt;code&gt;folding-mode&lt;/code&gt; to fold everything when opening a file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My init file contains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; folding-mode&#xA;(load &quot;folding&quot; 'nomessage 'noerror)&#xA;(folding-add-to-marks-list 'ess-mode &quot;/*{{{*/&quot;  &quot;/*}}}*/&quot;  nil t)&#xA;(folding-mode-add-find-file-hook)&#xA;(add-hook 'ess-mode-hook 'folding-mode)&#xA;(evil-leader/set-key &quot;ff&quot; 'folding-toggle-show-hide)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9901" LastEditorUserId="7" LastEditDate="2015-11-11T20:55:45.853" LastActivityDate="2015-11-11T20:55:45.853" Title="folding-mode start fully folded?" Tags="|code-folding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18008" PostTypeId="1" CreationDate="2015-11-11T16:39:25.690" Score="3" ViewCount="550" Body="&lt;p&gt;What I would like to accomplish is this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Allow emacs daemon to start with my start up applications like normal&lt;/li&gt;&#xA;&lt;li&gt;When I open an emacs frame I would like only the first one to start with my rss news feed from &lt;code&gt;elfeed&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;When I open another frame I would like it to just open to the scratch buffer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I start the emacs daemon upon start up on startup with &lt;code&gt;emacs --daemon&lt;/code&gt; added to my Autostart list. I have &lt;code&gt;emacsclient -a &quot;&quot; -c &quot;$@&quot;&lt;/code&gt; bound to my launcher on my dock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file I initialize &lt;code&gt;elfeed&lt;/code&gt; just fine but my way of trying to start it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(elfeed-update) ;; Update elfeed when daemon starts&#xA;(defun start-elfeed ()&#xA;  &quot;This function will start elfeed and update it.&quot;&#xA;  (if (not (get-buffer &quot;*elfeed-search*&quot;))&#xA;      (progn&#xA;       (elfeed)&#xA;       (switch-to-buffer &quot;*elfeed-search*&quot;)&#xA;    )))&#xA;(add-hook 'after-make-frame-functions 'start-elfeed)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I start emacs without the daemon it starts up in the &lt;code&gt;scratch&lt;/code&gt; buffer and &lt;code&gt;elfeed&lt;/code&gt; has not started, even in a background buffer. When I start it with &lt;code&gt;emacsclient -a &quot;&quot; -c &quot;$@&quot;&lt;/code&gt; the daemon seems to start but a frame never pops up. In the terminal I get this error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;*ERROR*: Wrong number of arguments: (lambda nil &quot;This function will start elfeed and update it.&quot; (if (not (get-buffer &quot;*elfeed-search*&quot;)) (progn (elfeed) (switch-to-buffer &quot;*elfeed-search*&quot;)))), 1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new to customizing emacs with elisp and could use some help here. Does that error mean that my &lt;code&gt;start-elfeed&lt;/code&gt; function has the wrong number of arguments or am I using the &lt;code&gt;after-make-frame-functions&lt;/code&gt; hook wrong? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any pointers here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Distro: Xubuntu 14.04&lt;/li&gt;&#xA;&lt;li&gt;Emacs 24.5&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit Nov 11&lt;/strong&gt;&#xA;I changed my function to be like this now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun start-elfeed (&amp;amp;optional frame)&#xA;  &quot;This function will start elfeed and update it.  I think it needs FRAME Passed to it.&quot;&#xA;  (if (not (get-buffer &quot;*elfeed-search*&quot;))&#xA;      (progn&#xA;    (elfeed)&#xA;    (while (not (get-buffer &quot;*elfeed-search*&quot;)))&#xA;    (switch-to-buffer &quot;*elfeed-search*&quot;)&#xA;    )))&#xA;(add-hook 'server-visit-hook 'start-elfeed)&#xA;(add-hook 'after-make-frame-functions 'start-elfeed)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now it calls &lt;code&gt;(elfeed)&lt;/code&gt; but I don't think it is finished when it continues on to the &lt;code&gt;(switch-to-buffer &quot;*elfeed-search*&quot;)&lt;/code&gt; function. The &lt;code&gt;*scratch*&lt;/code&gt; buffer is still the initial buffer but now there is a buffer called &lt;code&gt;*elfeed-search*&lt;/code&gt;, with the RSS feeds in it. It seems like the &lt;code&gt;switch-to-buffer&lt;/code&gt; call is being skipped over.&lt;/p&gt;&#xA;" OwnerUserId="10117" LastEditorUserId="10117" LastEditDate="2015-11-11T22:07:43.927" LastActivityDate="2015-11-11T22:07:43.927" Title="Startup Emacs Daemon With Elfeed (RSS Feed Reader) Buffer" Tags="|start-up|daemon|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18009" PostTypeId="2" ParentId="18007" CreationDate="2015-11-11T16:53:16.320" Score="3" Body="&lt;p&gt;Folding-mode will automatically fold files when opened if you call &lt;code&gt;(folding-mode-add-find-file-hook)&lt;/code&gt; in your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation, however, seems wrong. It says that you need to specify a file-local variable, but testing suggests that this is not needed.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-11T16:53:16.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18010" PostTypeId="1" CreationDate="2015-11-11T18:26:30.907" Score="1" ViewCount="815" Body="&lt;p&gt;I installed &lt;code&gt;haskell-mode&lt;/code&gt;, and I follow this tutorial to install company &lt;a href=&quot;https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&#xA;But it only ran once; now when I launch Emacs I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading /home/lowley/.emacs':&#xA;File error: Cannot open load file, company&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the --debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on &lt;code&gt;M-x company-mode&lt;/code&gt;, the company mode is activated but if I enter &lt;code&gt;putS&lt;/code&gt; it proposes putStrLn only (no putStr) and the mode turns to &lt;code&gt;company-&amp;lt;dabbrev-code&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my emacs config file :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(custom-set-variables&#xA; '(package-archives&#xA;   (quote&#xA;    ((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;     (&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;)))))&#xA;&#xA;&#xA;(custom-set-variables&#xA; '(custom-enabled-themes (quote (misterioso))))&#xA;(custom-set-faces&#xA; )&#xA;&#xA;(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)&#xA;&#xA;(let ((my-cabal-path (expand-file-name &quot;~/.cabal/bin&quot;)))&#xA;  (setenv &quot;PATH&quot; (concat my-cabal-path &quot;:&quot; (getenv &quot;PATH&quot;)))&#xA;  (add-to-list 'exec-path my-cabal-path))&#xA;&#xA;(add-to-list 'load-path &quot;~/.cabal/share/ghc-mod-5.4.0.0&quot;)&#xA;&#xA;(autoload 'ghc-init &quot;ghc&quot; nil t)&#xA;(autoload 'ghc-debug &quot;ghc&quot; nil t)&#xA;(add-hook 'haskell-mode-hook (lambda () (ghc-init)))&#xA;&#xA;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;&#xA;(add-to-list 'company-backends 'company-ghc)&#xA;(custom-set-variables '(company-ghc-show-info t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10119" LastEditorUserId="7" LastEditDate="2015-11-11T20:56:53.757" LastActivityDate="2016-01-05T00:19:13.600" Title="Error with company-mode, using Haskell" Tags="|company-mode|haskell-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18011" PostTypeId="1" CreationDate="2015-11-11T20:10:06.147" Score="8" ViewCount="1033" Body="&lt;p&gt;I'm using &lt;code&gt;org-mode&lt;/code&gt; to create a handout for a poetry class in which I want to include John Hollander's &quot;Swan and Shadow.&quot; It looks great in emacs, but when it's exported to PDF through LaTeX, it no longer looks like a swan and a shadow. In emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qIdNG.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qIdNG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it is with whitespace-mode active, to show that it's all spaces and not TABs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VAIp4.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VAIp4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here it is in LaTeX-processed PDF:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9Q7Wk.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9Q7Wk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I do to better preserve the appearance of this poem?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2016-04-09T22:40:59.737" Title="Poem in org-mode #+VERSE environment mangled by LaTeX export" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18012" PostTypeId="2" ParentId="18000" CreationDate="2015-11-11T20:27:41.400" Score="0" Body="&lt;p&gt;xterm works great (actually I use uxterm), but I don't usually run emacs inside of it. If you're sshing into another machine to run emacs and edit files there you might consider running emacs locally and using TRAMP mode instead. You can then run emacs as a normal X application rather than with -nw, and not have to worry about the terminal.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-11T20:27:41.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18013" PostTypeId="2" ParentId="18011" CreationDate="2015-11-11T20:31:21.523" Score="3" Body="&lt;p&gt;Looks like it's just wrapping. Use a smaller font? A larger page?&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-11T20:31:21.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18014" PostTypeId="2" ParentId="18010" CreationDate="2015-11-11T20:50:56.680" Score="-1" Body="&lt;p&gt;The error indicates that emacs cannot find the &lt;code&gt;company&lt;/code&gt; package when it hits the &lt;code&gt;(require 'company)&lt;/code&gt; in your init file. Use &lt;code&gt;M-x list-packages&lt;/code&gt; to install it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-11T20:50:56.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18015" PostTypeId="2" ParentId="18000" CreationDate="2015-11-11T23:53:28.470" Score="4" Body="&lt;p&gt;No terminal emulator will &lt;em&gt;default&lt;/em&gt; to supporting all of the key sequences you're asking about, because they are emulating terminals which did not support those sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the only emulator I'm aware of which is even &lt;em&gt;capable&lt;/em&gt; of supporting all the key sequences Emacs recognises is Thomas Dickey's xterm, and configuration is very much non-trivial (I've failed to get it working on the occasions I've tried).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can, however, get a &lt;em&gt;subset&lt;/em&gt; of the extended sequences with a fairly minimal config; see the links below.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone does have a working configuration for the fully-extended sequences, I would love to know the details!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a couple of related answers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/17267661/324105&quot;&gt;https://stackoverflow.com/a/17267661/324105&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/24963704/324105&quot;&gt;https://stackoverflow.com/a/24963704/324105&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &lt;a href=&quot;https://emacs.stackexchange.com/a/13957/454&quot;&gt;Gilles' answer&lt;/a&gt; in the thread Dan has linked to discusses some more recent developments, and looks extremely interesting at first glance.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-11-12T00:04:35.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18017" PostTypeId="1" AcceptedAnswerId="18021" CreationDate="2015-11-12T02:17:07.410" Score="7" ViewCount="1393" Body="&lt;p&gt;Emacs 24.5.1 on OS X 10.11.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the content of &lt;code&gt;/etc/paths&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/local/bin&#xA;/usr/bin&#xA;/bin&#xA;/usr/sbin&#xA;/sbin&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the value of &lt;code&gt;exec-path&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;/usr/bin&quot;&#xA; &quot;/bin&quot;&#xA; &quot;/usr/sbin&quot;&#xA; &quot;/sbin&quot; &quot;/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9&quot; &#xA; &quot;/Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_9&quot; &#xA; &quot;/Applications/Emacs.app/Contents/MacOS/libexec&quot; &#xA; &quot;/Applications/Emacs.app/Contents/MacOS/bin&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why doesn't it contain &lt;code&gt;/usr/local/bin&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10043" LastEditorUserId="3856" LastEditDate="2020-03-09T18:39:28.493" LastActivityDate="2020-03-09T18:39:28.493" Title="Why exec-path doesn't contain /usr/local/bin while /etc/paths already contains it?" Tags="|osx|exec-path|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18018" PostTypeId="1" CreationDate="2015-11-12T03:29:00.600" Score="1" ViewCount="65" Body="&lt;p&gt;I'm new to the LaTeX &lt;code&gt;metre&lt;/code&gt; package, but am hoping to use it to create a poetry handout. Right now, it is generating extra symbols when I export from &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_HEADER: \usepackage[en]{metre}&#xA;\metra{\m\b}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Produces:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ymSbX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ymSbX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last two symbols there are the ones I asked for. How do I eliminate the four extraneous other symbols from this output?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2015-11-12T20:57:57.503" Title="extra symbols in LaTeX \metre output" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18019" PostTypeId="2" ParentId="18017" CreationDate="2015-11-12T04:07:39.930" Score="-1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs initializes ‘exec-path’ when it starts up, based on the value of the environment variable ‘PATH’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Subprocess Creation&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-11-12T04:07:39.930" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18020" PostTypeId="2" ParentId="17925" CreationDate="2015-11-12T07:14:13.827" Score="0" Body="&lt;p&gt;I think I use a similar method to what you're describing that I initially cribbed from &lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot; rel=&quot;nofollow&quot;&gt;http://doc.norang.ca/org-mode.html&lt;/a&gt;.  Let me see if I can distill it to what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, have a directory that contains all of your note files (e.g. ~/org) and then set the &lt;code&gt;org-agenda-files&lt;/code&gt; to that path and inside of that directory, I have a default notes file where everything that I capture goes into at first and then I can file it later in another file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files '(&quot;~/org&quot;))&#xA;(setq org-default-notes-file &quot;~/org/inbox.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To create a new note, I use &lt;code&gt;org-capture&lt;/code&gt; which I bind to &lt;code&gt;CTRL-C c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c c&quot;) 'org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can setup templates for different capture tasks which I use for both my to-dos and my notes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates '((&quot;t&quot; &quot;todo&quot; entry (file &quot;~/org/inbox.org&quot;)&#xA;                               &quot;* TODO %?\n%U\n%a\n&quot; :clock-in t :clock-resume t)&#xA;                              (&quot;n&quot; &quot;note&quot; entry (file &quot;~/org/inbox.org&quot;)&#xA;                               &quot;* %? :NOTE:\n%U\n%a\n&quot; :clock-in t :clock-resume t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see the in template above that my to-do's have a TODO tag in front of them, which is made special through the &lt;code&gt;org-todo-keywords&lt;/code&gt; variable while my note has the :NOTE: tag applied to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm done creating the entry, I can then choose where I would like to file it.  org-mode will give you all the headlines that exist in your org files.  What I like to do is have a file per large project and inside of that file, I have the following structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+FILETAGS: PROJ-NAME&#xA;* Notes&#xA;* Dates&#xA;* TODO Tasks&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So for when I'm just creating notes for the project, I'll file them under the &lt;code&gt;Notes&lt;/code&gt; heading but my to-do's are filed under the &lt;code&gt;Tasks&lt;/code&gt; heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see the &lt;code&gt;FILETAGS&lt;/code&gt; header there which applies that tag to all of the items contained in the file.  This achieves part of what you were asking but we still want to add tags to each individual note item.  This can also be done and I do this as part of a GTD style system where I want to know the context of a particular item.  Tags can be applied to each item by going to an org header and doing the key command &lt;code&gt;CTRL-c CTRL-c&lt;/code&gt;.  The choices for tags are given by the &lt;code&gt;org-tag-alist&lt;/code&gt; variable which I currently have as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-tag-alist '((:startgroup)&#xA;                      (&quot;@errand&quot; . ?e)&#xA;                      (&quot;@office&quot; . ?o)&#xA;                      (&quot;@home&quot; . ?H)&#xA;                      (:endgroup)&#xA;                      (&quot;WAITING&quot; . ?w)&#xA;                      (&quot;HOLD&quot; . ?h)&#xA;                      (&quot;PERSONAL&quot; . ?P)&#xA;                      (&quot;ORG&quot; . ?O)&#xA;                      (&quot;crypt&quot; . ?E)&#xA;                      (&quot;NOTE&quot; . ?n)&#xA;                      (&quot;CANCELLED&quot; . ?c)&#xA;                      (&quot;FLAGGED&quot; . ??))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each item in the list has a hot key that you can press immediately after the &lt;code&gt;CTRL-c CTRL-c&lt;/code&gt; command to choose that tag.  If you want to apply a different command than your hot keys, you can just hit &lt;code&gt;TAB&lt;/code&gt; and then type in whatever tag you want to apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To search on these tags, you can use the org-agenda command, which I have set to the &lt;code&gt;CTRL-c a&lt;/code&gt; key command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once that org-agenda is invoked, you can type &quot;m&quot; for matching on TAGS/PROP/TODO.  So in the example above, if I wanted all of my PROJ-NAME items which were tagged as on hold, I could just type &quot;PROJ-NAME HOLD&quot; in my query and the appropriate items would be returned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this almost gets you where you want but the list of tags isn't dynamic.  For that, you would need to add a function to the &lt;code&gt;org-capture-before-finalize-hook&lt;/code&gt; that would scan the tags applied to the headline, add any missing tags to the &lt;code&gt;org-tag-alist&lt;/code&gt; and then save that list out to a file which can then be read on initialisation to set the &lt;code&gt;org-tag-plist&lt;/code&gt; file.  I haven't finished that function but here's the beginnings of it (using the &lt;code&gt;dash.el&lt;/code&gt; helper library for the &lt;code&gt;-filter&lt;/code&gt; function):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-persist-new-tags ()&#xA;  (interactive)&#xA;  (let ((known-tags (append org-tag-persistent-alist org-tag-alist))&#xA;        (item-tags (split-string (org-get-tags))))&#xA;    (setq org-tag-alist&#xA;          (append org-tag-alist&#xA;                  (-filter (lambda (tag) (assoc tag known-tags)) item-tags)))&#xA;    ;; TODO: write out to a file the org-tag-alist&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sorry I can't finish the whole function right now but I wanted to at least see if this is a direction you think is interesting.&lt;/p&gt;&#xA;" OwnerUserId="2003" LastActivityDate="2015-11-12T07:14:13.827" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18021" PostTypeId="2" ParentId="18017" CreationDate="2015-11-12T08:33:13.193" Score="5" Body="&lt;p&gt;OS X only evaluates &lt;code&gt;/etc/paths&lt;/code&gt; and &lt;code&gt;/etc/paths.d/&lt;/code&gt; for shell sessions, through an invocation of &lt;code&gt;path_helper&lt;/code&gt; in the global shell profile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GUI applications have a different launch path (through launchd as far as I know), which includes a different environment and a different environment configuration.  Specifically, GUI applications do not inherit &lt;code&gt;$PATH&lt;/code&gt; from a shell session, and thus do not get &lt;code&gt;$PATH&lt;/code&gt; entries from the aforementioned files.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can work around this behaviour with &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;noreferrer&quot;&gt;exec-path-from-shell&lt;/a&gt;, which sets &lt;code&gt;exec-path&lt;/code&gt; based on the &lt;code&gt;$PATH&lt;/code&gt; value of a shell session.  This package is more or less a standard equipment for Emacs users on OS X.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-11-12T08:33:13.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18022" PostTypeId="1" AcceptedAnswerId="18024" CreationDate="2015-11-12T13:26:05.113" Score="0" ViewCount="140" Body="&lt;p&gt;This comment gets font-lock-comment-face in C++ mode, but not in C mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA; *   \file test.cpp&#xA; *&#xA; */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I add another &lt;code&gt;*&lt;/code&gt; to &lt;code&gt;/**&lt;/code&gt; -&gt; &lt;code&gt;/***&lt;/code&gt;, it's working in C-mode, too...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not aware of any customisations, but I could be wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using CC Mode version 5.32.5&#xA;GNU Emacs 24.5.1 (x86_64-unknown-cygwin) of 2015-06-23 on desktop-new&lt;/p&gt;&#xA;" OwnerUserId="10128" LastEditorUserId="654" LastEditDate="2015-11-12T13:55:36.700" LastActivityDate="2015-11-12T15:18:44.553" Title="Why does font-lock for comment work in cpp, but not in c?" Tags="|font-lock|c-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18023" PostTypeId="2" ParentId="2347" CreationDate="2015-11-12T13:42:27.920" Score="2" Body="&lt;p&gt;A less ad-hoc way is to define &lt;code&gt;mark-whole-line&lt;/code&gt;, which Emacs really should have a default command for. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mark-whole-line ()               &#xA;    &quot;Combinition of C-a, mark, C-e&quot;&#xA;    (interactive)&#xA;    (move-beginning-of-line nil)&#xA;    (set-mark-command nil)&#xA;    (move-end-of-line nil)&#xA;)&#xA;(global-set-key (kbd &quot;C-2&quot;) 'mark-whole-line) ; 2 is near w&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;C-2 C-w&lt;/code&gt; will do the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also make things easier like commenting the current whole line.&lt;/p&gt;&#xA;" OwnerUserId="5466" LastEditorUserId="5466" LastEditDate="2015-11-12T15:58:14.287" LastActivityDate="2015-11-12T15:58:14.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18024" PostTypeId="2" ParentId="18022" CreationDate="2015-11-12T15:18:44.553" Score="2" Body="&lt;p&gt;The highlighting used is &lt;code&gt;font-lock-doc-face&lt;/code&gt;, as the comment begins with ** and emacs &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/ccmode/Faces.html&quot; rel=&quot;nofollow&quot;&gt;recognizes this as javadoc&lt;/a&gt;.  As you noted, using three stars, ore only one, will cause it to be treated as a regular comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the shortcut &lt;code&gt;C-u C-x =&lt;/code&gt; to get info on the current face, text properties are the last item so you may need to scroll the buffer that appears.  It's very handy for troubleshooting these sorts of issues.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-11-12T15:18:44.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18025" PostTypeId="2" ParentId="17953" CreationDate="2015-11-12T15:45:27.213" Score="2" Body="&lt;p&gt;I solved my problem by changing &lt;code&gt;LC_ALL&lt;/code&gt; to &lt;code&gt;en_US.utf8&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export LC_ALL=en_US.utf8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then, I opened emacs again. Voila, I can see everything clearly now. :)&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2015-11-12T15:45:27.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18026" PostTypeId="1" CreationDate="2015-11-12T16:31:21.690" Score="7" ViewCount="450" Body="&lt;p&gt;If I have following scheduled items in my org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** meeting a&#xA;&#xA;   SCHEDULED: &amp;lt;2015-11-12 Thu 21:00-23:00&amp;gt;&#xA;&#xA;** meeting b&#xA;&#xA;   SCHEDULED: &amp;lt;2015-11-12 Thu 22:00-23:00&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which generates following lines in the agenda view:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  annotations:21:00-23:00 Scheduled:  meeting a&#xA;&#xA;  annotations:22:00-23:00 Scheduled:  meeting b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can highlight overlapping items like these? I thought that &lt;code&gt;v c&lt;/code&gt; in the agenda view would show them, but no. The case above is quite obvious, but in the case of a recurring task, it would not be feasible to review all items.&lt;/p&gt;&#xA;" OwnerUserId="10129" LastEditorUserId="2274" LastEditDate="2015-11-12T22:36:04.947" LastActivityDate="2015-11-12T22:36:04.947" Title="Emacs org-mode, agenda view, discover overlapping tasks" Tags="|org-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18027" PostTypeId="1" CreationDate="2015-11-12T18:40:29.387" Score="3" ViewCount="388" Body="&lt;p&gt;In &lt;code&gt;c-mode&lt;/code&gt;, &lt;code&gt;rust-mode&lt;/code&gt;, and similar major language modes, I frequently type something such as the following Rust:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if some_bool { Some(foo) } else { None }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As I enter this (&lt;code&gt;|&lt;/code&gt; represents my cursor), electric-pair mode inserts matching brackets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if some_bool { |}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a setting that allows Emacs to insert matching space on the other side of the cursor following an opening character of a pair, so the above example would look like the following?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if some_bool { | }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect it to behave exactly like additional parens had been inserted, and backspacing at this point should produce&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if some_bool {|}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;again.&lt;/p&gt;&#xA;" OwnerUserId="10131" LastActivityDate="2016-11-23T16:55:25.767" Title="Matching spacing around electric pairs" Tags="|electric-pair-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18028" PostTypeId="1" AcceptedAnswerId="18029" CreationDate="2015-11-12T19:01:26.233" Score="1" ViewCount="203" Body="&lt;p&gt;I want to replace a character inside a word, so I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq regexp &quot;[ab]&quot;)&#xA;(and (re-search-backward regexp nil t 1)&#xA;     (replace-match &quot;c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This replaces &lt;code&gt;a&lt;/code&gt; or &lt;code&gt;b&lt;/code&gt; to &lt;code&gt;c&lt;/code&gt; as I wish, but I want to set a bound of it.&#xA;There is a &lt;code&gt;BOUND&lt;/code&gt; option with &lt;code&gt;re-search-backward&lt;/code&gt;.&#xA;How can I make the match only a word that is under the current cursor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for @jackson I can write the function, but still it doesn't work properly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq regexp &quot;.*[ab].*&quot;)&#xA;(defun test-it ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (narrow-to-region (progn (backward-word) (point))&#xA;                        (progn (forward-word) (point)))&#xA;      (and (re-search-backward regexp)&#xA;           (replace-match &quot;c&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thins function replaces &lt;code&gt;ab&lt;/code&gt; to &lt;code&gt;ac&lt;/code&gt; and &lt;code&gt;ad&lt;/code&gt; to &lt;code&gt;cd&lt;/code&gt; as I expected, but it doesn't replace &lt;code&gt;ac&lt;/code&gt; to &lt;code&gt;cc&lt;/code&gt;. Why?&lt;/p&gt;&#xA;" OwnerUserId="10106" LastEditorUserId="105" LastEditDate="2016-03-14T04:45:16.370" LastActivityDate="2016-03-14T04:45:16.370" Title="How to match only a word when using `re-search-backward` function" Tags="|search|words|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18029" PostTypeId="2" ParentId="18028" CreationDate="2015-11-12T19:19:37.520" Score="2" Body="&lt;p&gt;Not quite sure what you're asking.  If you're using &lt;code&gt;re-search-backward&lt;/code&gt; because you want to include the beginning of the word that encompasses the point, perhaps this does what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq regexp &quot;.*[ab].*&quot;)&#xA;(defun test-it ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (narrow-to-region (progn (backward-word 1) (point))&#xA;                        (progn (forward-word 1) (point)))&#xA;      (backward-word 1)&#xA;      (if (looking-at regexp)&#xA;          (replace-match &quot;frog&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code is a bit clumsy, but will replace the regexp with the given string if it matches.&lt;/p&gt;&#xA;" OwnerUserId="442" LastActivityDate="2015-11-12T19:19:37.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18030" PostTypeId="1" AcceptedAnswerId="18031" CreationDate="2015-11-12T19:38:57.807" Score="9" ViewCount="2379" Body="&lt;p&gt;I see this elisp code (&lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot;&gt;Bernt Hansen)&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bh/hide-other ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (org-back-to-heading 'invisible-ok)&#xA;    (hide-other)&#xA;    (org-cycle)&#xA;    (org-cycle)&#xA;    (org-cycle)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I wonder if the &lt;code&gt;bh/hide-other&lt;/code&gt; name with the forward slash means something special. I'm guessing not. But I need clarification that this isn't some module or namespace rocket science.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:44:57.400" LastActivityDate="2016-03-14T04:44:57.400" Title="Function naming with forward slash?" Tags="|symbols|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18031" PostTypeId="2" ParentId="18030" CreationDate="2015-11-12T20:09:37.557" Score="8" Body="&lt;p&gt;There's no name space in Emacs lisp, so people use various prefixes to avoid name clash.  Section D.1 of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html#Coding-Conventions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs lisp reference manual&lt;/a&gt; recommends using a short prefix followed by one or two hyphen(s):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;• You should choose a short word to distinguish your program from&#xA;      other Lisp programs.  The names of all global symbols in your&#xA;      program, that is the names of variables, constants, and functions,&#xA;      should begin with that chosen prefix.  Separate the prefix from the&#xA;      rest of the name with a hyphen, ‘-’.  This practice helps avoid&#xA;      name conflicts, since all global variables in Emacs Lisp share the&#xA;      same name space, and all functions share another name space(1).&#xA;      Use two hyphens to separate prefix and name if the symbol is not&#xA;      meant to be used by other packages.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/questions/2706/why-does-elisp-not-have-namespaces?s=1|0.8512&quot;&gt;this question&lt;/a&gt; about why elisp does not have namespaces.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-01-08T20:00:16.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18032" PostTypeId="2" ParentId="18018" CreationDate="2015-11-12T20:57:57.503" Score="1" Body="&lt;p&gt;Remember when exporting to pdf, a latex file is generated which is then compiled to pdf.  You can always look at the generated tex file and try to tweak it.  Here, when exporting to pdf, the generated latex file looks ok, but compiling it, through producing a pdf, raises an error.  I tracked it down to the fact that &lt;code&gt;\usepackage{metre}&lt;/code&gt; should appear &lt;em&gt;before&lt;/em&gt; the &lt;code&gt;\usepackage{amsmath}&lt;/code&gt; inserted by the exporter.  I'm not sure how to fix this in org (maybe with the variable &lt;code&gt;org-latex-packages-alist&lt;/code&gt;) but fixing this in the latex file, while removing the error, does not change the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, even when compiling the minimal latex file below, the output is still the same.  This does not seem to be a problem with emacs or org.  I would suggest asking on tex.stackexchange.com.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[11pt]{article}&#xA;\usepackage[en]{metre}&#xA;\begin{document}&#xA;\metra{\m\b}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-12T20:57:57.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18033" PostTypeId="2" ParentId="17984" CreationDate="2015-11-12T21:29:30.160" Score="6" Body="&lt;p&gt;Like @lawlist said, determining if a file or directory is remote is easy and can be done using &lt;code&gt;file-remote-p&lt;/code&gt; which will actually return the remote host is available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could then use &lt;code&gt;find-file-hook&lt;/code&gt; and &lt;code&gt;dired-mode-hook&lt;/code&gt; to check if the file is remote and if so assign the host a color(s) and use that color to determine the &lt;code&gt;mode-line&lt;/code&gt; and &lt;code&gt;mode-line-inactive&lt;/code&gt; faces and keep that color for all future opened files on that host.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To change the look of faces on per-buffer, use the &lt;code&gt;face-remap&lt;/code&gt; lib included with emacs. Specifically, the &lt;code&gt;face-remap-add-relative&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an implementation of this you can modify to suite your needs. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-remote-buffer-colors&#xA;  (let ((colors '((&quot;red&quot; &quot;darkred&quot;)&#xA;                  (&quot;green&quot; &quot;darkgreen&quot;)&#xA;                  (&quot;blue&quot; &quot;darkblue&quot;)&#xA;                  (&quot;orange&quot; &quot;firebrick&quot;))))&#xA;    (setcdr (last colors) colors)&#xA;    colors)&#xA;  &quot;Cyclic list of color combos to use for remote files. &#xA;Elements are in the form: (active-background-color inactive-background-color).&quot;)&#xA;&#xA;(defvar my-assigned-remote-colors (make-hash-table :test 'equal)&#xA;  &quot;Hash table pairing remote hosts to mode-line color overrides.&quot;)&#xA;&#xA;(defvar-local my-assigned-remote-color-cookies nil&#xA;  &quot;Stores the face remap cookies created by `my-maybe-assign-remote-color' for removal if necessary.&quot;)&#xA;&#xA;(defun my-maybe-assign-remote-color ()&#xA;  &quot;If newly found file is remote assign it new modeline colors.&#xA;&#xA;Colors are taken from `my-remote-buffer-colors', every file on the same remote&#xA;host will have the same colors, each newly accessed remote host will be assigned a new&#xA;color cycled from `my-remote-buffer-colors'.&quot;&#xA;  (let ((remote (file-remote-p default-directory)))&#xA;    (when remote&#xA;      (let ((color (or (gethash remote my-assigned-remote-colors) &#xA;                       (puthash remote (pop my-remote-buffer-colors) my-assigned-remote-colors))))&#xA;        (setq my-assigned-remote-color-cookies&#xA;              (list (face-remap-add-relative 'mode-line (list :background (car color)))&#xA;                    (face-remap-add-relative 'mode-line-inactive (list :background (cadr color)))))))))&#xA;&#xA;(add-hook 'find-file-hook 'my-maybe-assign-remote-color)&#xA;(add-hook 'dired-mode-hook 'my-maybe-assign-remote-color)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-11-12T21:35:33.960" LastActivityDate="2015-11-12T21:35:33.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18034" PostTypeId="1" AcceptedAnswerId="18036" CreationDate="2015-11-12T23:06:17.067" Score="3" ViewCount="543" Body="&lt;p&gt;When I want to know whether a list includes a value, I can use &lt;code&gt;member&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(member &quot;a&quot; '(&quot;a&quot; &quot;ā&quot; &quot;á&quot; &quot;ǎ&quot; &quot;à&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there similar way to check if a vector includes a value?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(member &quot;a&quot; [&quot;a&quot; &quot;ā&quot; &quot;á&quot; &quot;ǎ&quot; &quot;à&quot;])&#xA;;=&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10106" LastEditorUserId="454" LastEditDate="2019-01-26T20:50:56.150" LastActivityDate="2019-01-26T20:56:43.453" Title="How to check if a vector includes a value" Tags="|sequences|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18035" PostTypeId="2" ParentId="18034" CreationDate="2015-11-13T00:29:10.580" Score="3" Body="&lt;p&gt;You can always convert the vector to a list, and then test with &lt;code&gt;member&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(member &quot;a&quot; (append [&quot;a&quot; &quot;ā&quot; &quot;á&quot; &quot;ǎ&quot; &quot;à&quot;] ()))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because this is the normal list function &lt;code&gt;member&lt;/code&gt;, if the value is a member the return value is the &quot;tail&quot; of the vector, as the sublist whose car is that value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;(member &quot;á&quot; (append [&quot;a&quot; &quot;ā&quot; &quot;á&quot; &quot;ǎ&quot; &quot;à&quot;] ()))&lt;/code&gt; returns &lt;code&gt;(&quot;á&quot; &quot;ǎ&quot; &quot;à&quot;)&lt;/code&gt;.  In some contexts, this can be an advantage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the built-in function &lt;code&gt;append&lt;/code&gt; is quite fast in this context.  However, this does create a list, which means there is a cost for consing.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-13T05:03:48.520" LastActivityDate="2015-11-13T05:03:48.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18036" PostTypeId="2" ParentId="18034" CreationDate="2015-11-13T00:40:22.030" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;cl-position&lt;/code&gt;, from the &lt;code&gt;cl-seq&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (cl-position &quot;a&quot; [&quot;a&quot; &quot;ā&quot; &quot;á&quot; &quot;ǎ&quot; &quot;à&quot;] :test #'equal)&#xA;0 (#o0, #x0, ?\C-@)&#xA;ELISP&amp;gt; (cl-position &quot;b&quot; [&quot;a&quot; &quot;ā&quot; &quot;á&quot; &quot;ǎ&quot; &quot;à&quot;] :test #'equal)&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it returns an integer, your vector contains the element. If it returns &lt;code&gt;nil&lt;/code&gt;, the vector does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to use a test function that can compare strings; the default test won't treat two strings containing the same characters as equivalent; you can use &lt;code&gt;#'test&lt;/code&gt;, as above, to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, &lt;code&gt;cl-member&lt;/code&gt; also requires a list, but &lt;code&gt;cl-position&lt;/code&gt; definitely works, with the caveat that it returns the &lt;em&gt;index&lt;/em&gt; the element is at, and not &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-11-13T00:45:56.927" LastActivityDate="2015-11-13T00:45:56.927" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18037" PostTypeId="1" CreationDate="2015-11-13T02:05:23.903" Score="0" ViewCount="76" Body="&lt;p&gt;There is &lt;code&gt;M-x manual-entry&lt;/code&gt; that show concrete &lt;code&gt;man page&lt;/code&gt;,&#xA;but what if I don't know which manual page exactly I need,&#xA;from shell I can run &lt;code&gt;man -K apropos&lt;/code&gt; and see result,&#xA;is equivalent functional in emacs, that search in the&#xA;same places as &lt;code&gt;man -K&lt;/code&gt; and then show me the first&#xA;search result via &lt;code&gt;manual-entry&lt;/code&gt; then ask continue, or I satisfied,&#xA;and then repeat search if I want?&lt;/p&gt;&#xA;" OwnerUserId="2448" LastEditorUserId="9995" LastEditDate="2015-11-14T19:01:58.100" LastActivityDate="2015-11-14T19:01:58.100" Title="man -K from emacs" Tags="|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18038" PostTypeId="2" ParentId="10115" CreationDate="2015-11-13T02:16:19.653" Score="1" Body="&lt;p&gt;glad to know that someone is looking for this. I was also inspired by tmux and have wrote an elisp exactly for this purpose .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please download and install &lt;a href=&quot;https://github.com/lgfang/elisp/blob/master/tiling.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lgfang/elisp/blob/master/tiling.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can &quot;C-\&quot; to switch among predefined layouts, or 'C-u 4 C-\' to tile the last 4 active windows using a predefined layout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is by no means a good elisp since I am not an elisp elite. However, that is one of the fun of emacs: you can add functionalities per your very own needs. Isn't it.&lt;/p&gt;&#xA;" OwnerUserId="9670" LastActivityDate="2015-11-13T02:16:19.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18039" PostTypeId="1" AcceptedAnswerId="18080" CreationDate="2015-11-13T02:43:23.523" Score="2" ViewCount="210" Body="&lt;p&gt;I just wonder whether there is some instruction on the proper order of the time stamp and the contents under one heading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Style 1:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading 1&#xA;  &amp;lt;2015-11-13 Fri 10:30&amp;gt;&#xA;  Some contents.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Style 2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading 1&#xA;  Some contents.&#xA;  &amp;lt;2015-11-13 Fri 10:30&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which style is the proper one?&lt;/p&gt;&#xA;" OwnerUserId="6580" LastActivityDate="2015-11-14T00:24:50.097" Title="The proper order of time stamp and content under a heading in org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18040" PostTypeId="1" CreationDate="2015-11-13T02:51:45.983" Score="2" ViewCount="425" Body="&lt;p&gt;When I attach files using &lt;code&gt;M-x mml-attach-file&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x m&lt;/code&gt; does attachments as expected but&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x mail&lt;/code&gt; just sends the text&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;#part type=&quot;text/plain&quot; filename=&quot;~/Downloads/coding_style.c&quot; disposition=attachment description=&quot;modified coding_style.c&quot;&amp;gt; &amp;lt;#/part&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why are these different when sending mail works with both?&lt;/p&gt;&#xA;" OwnerUserId="10133" LastEditorUserId="2842" LastEditDate="2016-07-24T21:09:25.800" LastActivityDate="2016-07-25T12:54:19.810" Title="Difference between C-x m and M-x mail" Tags="|email|smtpmail|attachment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18041" PostTypeId="2" ParentId="12487" CreationDate="2015-11-13T03:29:33.410" Score="2" Body="&lt;p&gt;I use &lt;code&gt;with-eval-after-load&lt;/code&gt; a lot, mostly for adding or removing elements to or from lists after the default values have been evaluated. That way I don't have to keep track of changes in the default values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the problem with your &lt;code&gt;helm&lt;/code&gt; initialization, &lt;a href=&quot;https://github.com/emacs-helm/helm#quick-install-from-git&quot; rel=&quot;nofollow&quot;&gt;the documentation&lt;/a&gt; recommends that &lt;code&gt;(require 'helm-config)&lt;/code&gt; be present in your &lt;code&gt;init.el&lt;/code&gt; or its dependencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found that it's easier just to require &lt;code&gt;helm-config&lt;/code&gt; during initialization rather than relying on &lt;code&gt;autoload&lt;/code&gt;, especially since I would be loading it almost immediately most of the time anyway.&lt;/p&gt;&#xA;" OwnerUserId="681" LastActivityDate="2015-11-13T03:29:33.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18042" PostTypeId="1" CreationDate="2015-11-13T04:09:08.673" Score="1" ViewCount="598" Body="&lt;p&gt;I want to quickly alternate between the buffer I'm in and the last buffer I was in. Is there a built-in command for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I rolled my own, but I might rather use something built-in.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun alternate-buffer ()&#xA;  &quot;Alternate between the current buffer and the previous.&quot;&#xA;  (interactive)&#xA;  (switch-to-buffer (caar (window-prev-buffers))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've checked &lt;code&gt;M-x apropos&lt;/code&gt; and searched for &quot;buffer&quot;, but I haven't located such a command.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastEditorUserId="2631" LastEditDate="2015-11-13T04:11:19.777" LastActivityDate="2015-11-14T03:35:37.840" Title="Is there a command to alternate buffers?" Tags="|buffers|" AnswerCount="4" CommentCount="4" ClosedDate="2015-11-15T23:31:20.533" ContentLicense="CC BY-SA 3.0" />
  <row Id="18043" PostTypeId="1" CreationDate="2015-11-13T04:30:12.897" Score="0" ViewCount="74" Body="&lt;p&gt;Can we know, that we are in the following position:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;text1 ... &amp;lt;cursor&amp;gt; ... text2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this doesn't count:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;text1 ... text2 ... &amp;lt;cursor&amp;gt; ... text2&#xA;&#xA;text1 ... &amp;lt;cursor&amp;gt; ... text1 ... text2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2016-01-12T17:38:28.980" Title="How to know that cursor is surrounded by specific text" Tags="|cursor|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18044" PostTypeId="2" ParentId="18043" CreationDate="2015-11-13T04:44:58.480" Score="1" Body="&lt;p&gt;Here's a function that takes two arguments, and returns &lt;code&gt;t&lt;/code&gt; if the text before point is TEXT-BEFORE and the text after is TEXT-AFTER.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun in-between-p (text-before text-after)&#xA;  &quot;Return t if point is directly between TEXT-BEFORE and TEXT-AFTER.&quot;&#xA;  (and (first-text-comes-closer-to-point-than-second-before-point text-before text-after)&#xA;       (first-text-comes-closer-to-point-than-second-after-point text-after text-before)))&#xA;&#xA;(defun first-text-comes-closer-to-point-than-second-before-point (first-text second-text)&#xA;  (and (looking-back (format &quot;%s.*&quot; (regexp-quote first-text))) ;;first-text appears before point&#xA;&#xA;       (let ((first-text-match-position (match-beginning 0)))&#xA;&#xA;         (or (not (looking-back (format &quot;%s.*&quot; (regexp-quote second-text)))) ;;either second-text isn't before point&#xA;             (&amp;lt; (match-beginning 0) ;;or it's before first-text&#xA;                first-text-match-position)))))&#xA;&#xA;(defun first-text-comes-closer-to-point-than-second-after-point (first-text second-text)&#xA;  (and (looking-at-p (format &quot;.*%s&quot; (regexp-quote first-text)))&#xA;       (let ((first-text-match-position (match-beginning 0)))&#xA;         (or (not (looking-back (format &quot;.*%s&quot; (regexp-quote second-text))))&#xA;             (&amp;gt; (match-beginning 0)&#xA;                first-text-match-position)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here's a way to test it interactively.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun between-rock-and-hard-place (rock hard-place)&#xA;  (interactive (list (read-string &quot;string before: &quot;)&#xA;                     (read-string &quot;string after: &quot;)))&#xA;  (if (in-between-p rock hard-place)&#xA;      (message &quot;you're between them&quot;)&#xA;    (message &quot;you have different neighbors&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluate these two functions, then type something in a buffer. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abcd|efgh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using the &lt;code&gt;|&lt;/code&gt; character to represent point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can call &lt;code&gt;M-x between-rock-and-hard-place&lt;/code&gt;, which will prompt for two strings. If, for example, you input &lt;code&gt;abcd&lt;/code&gt; and &lt;code&gt;efgh&lt;/code&gt; in that order, you'll get the message &quot;you're between them&quot;. If you input something like &quot;bcd&quot; and &quot;BAD TEXT&quot;, you'll get the &quot;you have different neighbors&quot; message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It won't match across newlines right now, but I'll try to fix that tomorrow.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-11-13T05:49:57.640" LastActivityDate="2015-11-13T05:49:57.640" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18045" PostTypeId="1" AcceptedAnswerId="18070" CreationDate="2015-11-13T04:58:31.940" Score="7" ViewCount="3035" Body="&lt;p&gt;The following code should in principle return the contents of &lt;a href=&quot;https://badssl.com&quot; rel=&quot;noreferrer&quot;&gt;https://badssl.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer&#xA;    (url-retrieve-synchronously &quot;https://badssl.com&quot;)&#xA;  (buffer-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But with my &lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1112)) of 2015-08-24&lt;/code&gt; on OS X 10.10.5, run with &lt;code&gt;-Q&lt;/code&gt;, it instead shows me this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Certificate information&#xA;Issued by:          COMODO RSA Domain Validation Secure Server CA&#xA;Issued to:          Domain Control Validated&#xA;Hostname:           *.badssl.com&#xA;Public key:         RSA, signature: RSA-SHA256&#xA;Protocol:           TLS1.2, key: ECDHE-RSA, cipher: AES-128-GCM, mac: AEAD&#xA;Security level:     Medium&#xA;Valid:              From 2015-04-09 to 2016-07-07&#xA;&#xA;&#xA;The TLS connection to badssl.com:443 is insecure for the following&#xA;reasons:&#xA;&#xA;the certificate was signed by an unknown and therefore untrusted authority&#xA;certificate could not be verified&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and asks whether to accept the certificate - No/Session/Always. It then works if I accept the certificate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not experience the same problem with, for example, wget. Wget correctly downloads (without asking the question) &lt;a href=&quot;https://badssl.com&quot; rel=&quot;noreferrer&quot;&gt;https://badssl.com&lt;/a&gt; and rejects &lt;a href=&quot;https://self-signed.badssl.com&quot; rel=&quot;noreferrer&quot;&gt;https://self-signed.badssl.com&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, there appear to be &lt;em&gt;two&lt;/em&gt; separate customization groups - gnutls and tls. I have previously compiled emacs with support for gnutls (&lt;code&gt;gnutls-available-p&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt;). Gnutls was installed with homebrew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I set &lt;code&gt;gnutls-verify-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, I instead get the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnutls-negotiate: Certificate validation failed badssl.com, verification code 42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so presumably gnutls was not being used in the first example. On OS X none of the files mentioned in &lt;code&gt;gnutls-trustfiles&lt;/code&gt; (in &lt;code&gt;/usr/ssl&lt;/code&gt; and &lt;code&gt;/etc/ssl&lt;/code&gt;) exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I configure emacs to use the default trusted root certificates on OS X?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt; If I install &lt;code&gt;libressl&lt;/code&gt; from homebrew, and add &lt;code&gt;/opt/brew/etc/libressl/cert.pem&lt;/code&gt; to &lt;code&gt;gnutls-trustfiles&lt;/code&gt;, the issue disappears when using &lt;code&gt;gnutls-verify-error&lt;/code&gt; set to t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit 2:&lt;/em&gt; In my testing it didn't seem like the value of &lt;code&gt;tls-certtool-program&lt;/code&gt; was actually used, but it may be incorrect for OS X anyway: the default certtool on OS X is not the GnuTLS certtool required by tls.el, and with homebrew's gnutls I think it should be gnutls-certtool instead.&lt;/p&gt;&#xA;" OwnerUserId="875" LastEditorUserId="875" LastEditDate="2015-11-13T18:56:21.227" LastActivityDate="2017-10-05T18:39:47.457" Title="How can I retrieve an HTTPS URL on Mac OS X without warnings about an untrusted authority?" Tags="|osx|url|gnutls|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18046" PostTypeId="2" ParentId="17629" CreationDate="2015-11-13T05:23:41.237" Score="5" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Open a remote directory in &lt;code&gt;dired&lt;/code&gt; using &lt;code&gt;tramp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;d&lt;/kbd&gt; &lt;code&gt;/ssh:username@hostname:/path&lt;/code&gt; &lt;kbd&gt;return&lt;/kbd&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Start a remote shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;shell&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="388" LastActivityDate="2015-11-13T05:23:41.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18047" PostTypeId="2" ParentId="10726" CreationDate="2015-11-13T07:25:44.183" Score="0" Body="&lt;p&gt;Customize the mode to use &lt;code&gt;motion&lt;/code&gt; state instead of &lt;code&gt;normal&lt;/code&gt; state to keep motion keybindings while leaving out &lt;code&gt;q&lt;/code&gt; for quitting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-set-initial-state 'Custom-mode 'motion)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-11-13T07:25:44.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18049" PostTypeId="1" AcceptedAnswerId="18050" CreationDate="2015-11-13T08:34:34.150" Score="5" ViewCount="1024" Body="&lt;p&gt;What is the easiest way to skip forward to the first whitespace character after the current cursor?  I used to do it just by searching for a space (when I knew there was one there), but now that seems to behave like &lt;code&gt;forward-whitespace&lt;/code&gt; (not sure when this behavior switched, maybe when I transitioned to emacs 24.  This is a function I need all the time when defining macros interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fwiw, &lt;code&gt;forward-whitespace&lt;/code&gt; doesn't work for me because it skips to the last whitespace character in the first block of whitespace after the current cursor.&lt;/p&gt;&#xA;" OwnerUserId="10136" LastEditorUserId="253" LastEditDate="2015-11-13T12:55:46.393" LastActivityDate="2015-11-13T12:55:46.393" Title="How to skip forward to first whitespace character?" Tags="|whitespace|motion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18050" PostTypeId="2" ParentId="18049" CreationDate="2015-11-13T12:54:32.490" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;skip-syntax-forward&lt;/code&gt; to skip &lt;em&gt;non&lt;/em&gt;-whitespace.  Docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(skip-syntax-forward SYNTAX &amp;amp;optional LIM)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move point forward across chars in specified syntax classes.&#xA;  SYNTAX is a string of syntax code characters.&#xA;  Stop before a char whose syntax is not in SYNTAX, or at position LIM.&#xA;  &lt;strong&gt;If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.&lt;/strong&gt;&#xA;  This function returns the distance traveled, either zero or positive.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want to use it interactively, you can wrap it in an interactive command:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun skip-to-next-whitespace ()&#xA;  &quot;Move point forward to next whitespace character.&quot;&#xA;  (interactive)&#xA;  (skip-syntax-forward &quot;^\s&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-11-13T12:54:32.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18051" PostTypeId="1" AcceptedAnswerId="18224" CreationDate="2015-11-13T13:04:10.977" Score="1" ViewCount="922" Body="&lt;p&gt;I'm accustomed to remapping Esc to Tab in Vim. In Spacemacs this can be done with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map [tab] 'evil-normal-state)&#xA;(define-key evil-visual-state-map [tab] 'evil-normal-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;dotspacemacs/config&lt;/code&gt; in &lt;code&gt;.spacemacs&lt;/code&gt;. This leaves me with the option of pressing &lt;code&gt;C-i&lt;/code&gt; when &lt;code&gt;Tab&lt;/code&gt; is really needed (quite rarely in my case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, shells in Spacemacs are also run in vi-mode, and there &lt;code&gt;Tab&lt;/code&gt; key is really convenient for completion, obviously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i either&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Run shells in emacs-mode&lt;/li&gt;&#xA;&lt;li&gt;or disable &lt;code&gt;Tab&lt;/code&gt; remapping in shells while retaining it elsewhere?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9419" LastActivityDate="2015-11-19T13:05:45.707" Title="Remapping Esc to Tab in Spacemacs" Tags="|shell|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18052" PostTypeId="1" AcceptedAnswerId="18055" CreationDate="2015-11-13T13:13:01.370" Score="8" ViewCount="1271" Body="&lt;p&gt;I'm using &lt;code&gt;evil&lt;/code&gt; via &lt;code&gt;spacemacs&lt;/code&gt;.  When I exit insert state, the cursor moves to the left one character.  Why is that?  Is it a bug, or is it a feature?  Can I turn it off?&lt;/p&gt;&#xA;" OwnerUserId="9419" LastEditorUserId="253" LastEditDate="2015-11-13T13:59:46.643" LastActivityDate="2015-11-13T13:59:46.643" Title="Cursor moves one position left after exiting insert mode?" Tags="|evil|spacemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18053" PostTypeId="1" CreationDate="2015-11-13T13:26:30.360" Score="0" ViewCount="119" Body="&lt;p&gt;Is there a way to &lt;strong&gt;remap&lt;/strong&gt; the &quot;zc&quot; or &quot;zf&quot; key combo for code folding from evil-mode normal-state to folding-toggle-show-hide?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &#xA;&lt;code&gt;(define-key evil-normal-state-map &quot;zc&quot; 'folding-toggle-show-hide)&lt;/code&gt; without success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F1 k zc returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;z c runs the command evil-close-fold, which is an interactive compiled&#xA;Lisp function in 'evil-commands.el'.&#xA;&#xA;It is bound to z c.&#xA;&#xA;(evil-close-fold)&#xA;&#xA;Close fold at point.&#xA;See also 'evil-open-fold'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9901" LastEditorUserId="9901" LastEditDate="2015-11-16T08:49:54.700" LastActivityDate="2015-11-16T08:49:54.700" Title="remap evil-mode normal-state folding key to folding-mode folding-toggle-show-hide" Tags="|evil|code-folding|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18054" PostTypeId="1" AcceptedAnswerId="18069" CreationDate="2015-11-13T13:42:28.090" Score="14" ViewCount="2440" Body="&lt;p&gt;I would like to set the major mode for a file as you would using file-local variables&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Local Variables:&#xA;mode: text&#xA;End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but in &lt;code&gt;.dir-locals.el&lt;/code&gt; in order not to “pollute” the file in question.  Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="8566" LastActivityDate="2021-09-24T18:10:15.130" Title="How to set major mode for a file in .dir-locals.el?" Tags="|major-mode|directory-local-variables|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18055" PostTypeId="2" ParentId="18052" CreationDate="2015-11-13T13:57:55.797" Score="9" Body="&lt;p&gt;&quot;Moving one space left after leaving insert&quot; is the default behavior in Vim, which &lt;code&gt;evil&lt;/code&gt; (on top of which &lt;code&gt;spacemacs&lt;/code&gt; is built) emulates by default.  If you don't like that behavior, you can set &lt;code&gt;(setq evil-move-cursor-back nil)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-11-13T13:57:55.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18056" PostTypeId="1" CreationDate="2015-11-13T14:13:55.173" Score="6" ViewCount="988" Body="&lt;p&gt;I have the following text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Row # | Facility                 | Recycled Off-site |&#xA;|-------+--------------------------+-------------------+&#xA;|     1 | 1234, 12th st, jamestown |           216,574 |&#xA;|     2 | 1234, 12th st, jamestown |               760 |&#xA;|     3 | 1234, 12th st, jamestown |                 0 |&#xA;|     4 | 1234, 12th st, jamestown |               464 |&#xA;|     5 | 1234, 12th st, jamestown |                 0 |&#xA;|     6 | 1234, 12th st, jamestown |             2,280 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to remove all of the commas in the last column. I am able to select the last column (using a rectangular selection, or C-v in evil-mode), but how do I perform a regex replace only within the selected area? I don't want to replace the commas in the second column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions that use evil-mode would be extra helpful!&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2023-12-04T14:13:27.627" Title="How to find and replace regex within a rectangle selection block" Tags="|rectangle|query-replace|" AnswerCount="4" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18057" PostTypeId="1" CreationDate="2015-11-13T14:23:05.460" Score="4" ViewCount="417" Body="&lt;p&gt;I have the following org-table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Row # | Facility                 | Recycled Off-site |&#xA;|-------+--------------------------+-------------------+&#xA;|     1 | 1234, 12th st, jamestown |           216,574 |&#xA;|     2 | 1234, 12th st, jamestown |               760 |&#xA;|     3 | 1234, 12th st, jamestown |                 0 |&#xA;|     4 | 1234, 12th st, jamestown |               464 |&#xA;|     5 | 1234, 12th st, jamestown |                 0 |&#xA;|     6 | 1234, 12th st, jamestown |             2,280 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to sort the table by the last column. I perform &lt;code&gt;M-x org-table-sort-lines n&lt;/code&gt; to sort the column numerically, and here is my output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Row # | Facility                 | Recycled Off-site |&#xA;|-------+--------------------------+-------------------+&#xA;|     3 | 1234, 12th st, jamestown |                 0 |&#xA;|     5 | 1234, 12th st, jamestown |                 0 |&#xA;|     6 | 1234, 12th st, jamestown |             2,280 |&#xA;|     1 | 1234, 12th st, jamestown |           216,574 |&#xA;|     4 | 1234, 12th st, jamestown |               464 |&#xA;|     2 | 1234, 12th st, jamestown |               760 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortuntaly, the commas are a thousands place holder, not a decimal. Is there a setting where I can have org-table sort the rows using the commas as a thousands placeholder? For example, here is my desired result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Row # | Facility                 | Recycled Off-site |&#xA;|-------+--------------------------+-------------------+&#xA;|     3 | 1234, 12th st, jamestown |                 0 |&#xA;|     5 | 1234, 12th st, jamestown |                 0 |&#xA;|     4 | 1234, 12th st, jamestown |               464 |&#xA;|     2 | 1234, 12th st, jamestown |               760 |&#xA;|     6 | 1234, 12th st, jamestown |             2,280 |&#xA;|     1 | 1234, 12th st, jamestown |           216,574 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2016-02-13T00:19:51.163" Title="Sorting an org-table numerically, ignoring commas (org-table-sort-lines)" Tags="|org-table|sorting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18058" PostTypeId="1" CreationDate="2015-11-13T14:27:18.790" Score="0" ViewCount="136" Body="&lt;p&gt;I've been using powerline, but this doesn't look anything like it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/nHBYb.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and just in case anyone is curious the theme in the picture is this one: &lt;a href=&quot;https://github.com/emacsfodder/emacs-soothe-theme&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/emacsfodder/emacs-soothe-theme&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2015-11-13T14:27:18.790" Title="How can I get the mode line to look like the one used in this screen shot?" Tags="|mode-line|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18059" PostTypeId="1" AcceptedAnswerId="18086" CreationDate="2015-11-13T14:29:48.167" Score="3" ViewCount="3913" Body="&lt;p&gt;How would I activate a specific &lt;code&gt;virtual environment&lt;/code&gt; in my &lt;code&gt;init file&lt;/code&gt;? I know how to activate it manually, but I don't like to do it every time I start emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To activate it manually I used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pyvenv-activate&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then a &lt;code&gt;path&lt;/code&gt; needs to be specified and it works. So I tried the following in the init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(pyvenv-activate PATH_TO_VENV)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately it tells me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid function: (quote pyvenv-activate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to do this, because without activating the &lt;code&gt;venv&lt;/code&gt;, &lt;code&gt;elpy&lt;/code&gt; does not find it and thus doesn't find &lt;code&gt;jedi&lt;/code&gt; etc.&lt;/p&gt;&#xA;" OwnerUserId="10090" LastEditorUserId="10090" LastEditDate="2015-11-13T14:51:40.743" LastActivityDate="2015-11-14T05:47:55.467" Title="How to activate python virtual environment in init file?" Tags="|init-file|python|start-up|environment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18060" PostTypeId="2" ParentId="18043" CreationDate="2015-11-13T14:46:35.143" Score="1" Body="&lt;p&gt;In the comments to @zck:s answer, you say that you want to find out if the point is in a php &lt;code&gt;array&lt;/code&gt; construct. The following does this, with the limitation that the point must not be inside a parenthesized subexpression.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-in-php-array ()&#xA;  &quot;Return non-nil if the point is inside a php array construct.&quot;&#xA;  (save-excursion&#xA;    (and (ignore-errors&#xA;           (backward-up-list)&#xA;           t)&#xA;         (eq (char-after) ?\(  )&#xA;         (looking-back &quot;\\&amp;lt;array[ \t]*&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-13T14:46:35.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18061" PostTypeId="2" ParentId="18027" CreationDate="2015-11-13T14:55:42.037" Score="0" Body="&lt;p&gt;Check out &lt;a href=&quot;https://github.com/xwl/electric-spacing&quot; rel=&quot;nofollow&quot;&gt;electric-spacing&lt;/a&gt; or &lt;a href=&quot;https://github.com/davidshepherd7/electric-operator&quot; rel=&quot;nofollow&quot;&gt;electric-operator&lt;/a&gt;. You might need to configure it a bit for your use case, but it aims to automatically pad certain characters with spaces.&lt;/p&gt;&#xA;" OwnerUserId="264" LastActivityDate="2015-11-13T14:55:42.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18062" PostTypeId="1" CreationDate="2015-11-13T15:46:47.160" Score="3" ViewCount="220" Body="&lt;p&gt;Is it possible to make emacs as an input middle man for any text field in the system? It should work like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 user focus the text input field of any gui program&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 a system hotkey brings up a dedicated emacs buffer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 user do the editing in that emacs buffer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 when finished editing, a short cut key send text to the original text input field&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible problem is between step 3 and 4, the user may change windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible reference is the input method program fcitx, which has a pre-edit window, the editing is done in a separated popup window, a key need to be pressed to commit the content. What we need is to change the pre-edit window to an emacs buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;issue on fcitx tracker (&lt;a href=&quot;https://github.com/fcitx/fcitx/issues/232&quot; rel=&quot;nofollow&quot;&gt;https://github.com/fcitx/fcitx/issues/232&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="4036" LastEditDate="2015-11-14T20:29:25.860" LastActivityDate="2015-11-14T20:29:25.860" Title="Edit any input field in emacs buffer" Tags="|text-editing|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18063" PostTypeId="2" ParentId="18042" CreationDate="2015-11-13T15:49:02.113" Score="0" Body="&lt;p&gt;This can be done easily with the modern completion systems:&#xA;&lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;Helm&lt;/a&gt; or&#xA;&lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow&quot;&gt;Ivy&lt;/a&gt;.  Use &lt;code&gt;helm-buffers-list&lt;/code&gt; or&#xA;&lt;code&gt;ivy-switch-buffer&lt;/code&gt; correspondingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now here's the trick: repeatedly press &lt;kbd&gt;C-M-n&lt;/kbd&gt; to switch to&#xA;the next buffer without exiting the completion. Press &lt;kbd&gt;C-M-p&lt;/kbd&gt;&#xA;for the previous buffer.  Finally, press &lt;kbd&gt;C-m&lt;/kbd&gt; to exit&#xA;completion.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-13T15:49:02.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18064" PostTypeId="2" ParentId="18042" CreationDate="2015-11-13T17:00:14.000" Score="2" Body="&lt;p&gt;I use this function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun switch-to-previous-buffer ()&#xA;  (interactive)&#xA;  (switch-to-buffer (other-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still custom elisp, but better that &lt;code&gt;caar&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2015-11-13T17:00:14.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18065" PostTypeId="2" ParentId="18056" CreationDate="2015-11-13T17:05:21.397" Score="2" Body="&lt;p&gt;For this particular case, it looks like you can just replace &lt;code&gt;\([0-9]\),\([0-9]\)&lt;/code&gt; with &lt;code&gt;\1\2&lt;/code&gt;.  That will leave the commas in the second column alone because all of those are followed by spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you didn't have spaces in the second column, you could still replace &lt;code&gt;\([,0-9]+\) |$&lt;/code&gt; with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| \,(replace-regexp-in-string &quot;,&quot; &quot;&quot; \1) |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This hits only the last column (because of the &lt;code&gt;\$&lt;/code&gt; anchor), and then uses the &lt;code&gt;\,&lt;/code&gt; construct to replace the commas only there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this will disrupt your column spacing (because the commas aren't being replaced by anything), but it looks like you're in Org-mode, where &lt;code&gt;C-c C-c&lt;/code&gt; will take care of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the general case, I agree that what you really want is a rectangular regexp replace, but I don't know of a really easy way to achieve that.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-11-13T17:05:21.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18066" PostTypeId="2" ParentId="18042" CreationDate="2015-11-13T17:08:48.173" Score="0" Body="&lt;p&gt;How about?:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;previous-buffer&lt;/code&gt; [&quot;&lt;em&gt;In selected window switch to previous buffer.&lt;/em&gt;&quot;]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;next-buffer&lt;/code&gt; [&quot;&lt;em&gt;In selected window switch to next buffer.&lt;/em&gt;&quot;]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both are built-in functions defined in &lt;code&gt;window.el&lt;/code&gt; and come with their own keyboard shortcuts, which you can of course change or create additional ones. &lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-11-13T17:08:48.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18067" PostTypeId="2" ParentId="18027" CreationDate="2015-11-13T17:40:25.743" Score="1" Body="&lt;p&gt;With &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt;, you can add a &lt;code&gt;:post-handler&lt;/code&gt;, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;{&quot; nil :post-handlers '((&quot;| &quot; &quot;SPC&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use an additional handler for pressing return:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;{&quot; nil :post-handlers '((&quot;||\n[i]&quot; &quot;RET&quot;)&#xA;                                  (&quot;| &quot; &quot;SPC&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-11-13T17:40:25.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18068" PostTypeId="1" AcceptedAnswerId="18087" CreationDate="2015-11-13T17:56:07.287" Score="14" ViewCount="2436" Body="&lt;p&gt;How can I do that either in a different buffer or even in the current buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to do Github README.md and other Github rendering of Markdown (for notes and such), &lt;/p&gt;&#xA;" OwnerUserId="5451" LastActivityDate="2016-02-05T11:01:20.233" Title="How do I do live Markdown previewing as I'm writing it?" Tags="|buffers|markdown|previewing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18069" PostTypeId="2" ParentId="18054" CreationDate="2015-11-13T18:15:24.070" Score="6" Body="&lt;p&gt;It's possible to specify a string instead of a mode, but this only works for subdirectories.  So I'll use &lt;code&gt;nil&lt;/code&gt; instead to match all modes, then the &lt;code&gt;eval&lt;/code&gt; key to change the major mode conditionally:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;  (eval&#xA;   (lambda ()&#xA;     (when (string= (file-name-nondirectory buffer-file-name)&#xA;                    &quot;file-name.extension&quot;)&#xA;       (my-mode))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A downside of this approach is that the &lt;code&gt;eval&lt;/code&gt; key is unsafe, so you'll need to confirm the variable permanently for this to have an effect.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-11-13T18:15:24.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18070" PostTypeId="2" ParentId="18045" CreationDate="2015-11-13T18:48:58.990" Score="4" Body="&lt;p&gt;To solve this issue it seems sufficient to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Set &lt;code&gt;gnutls-verify-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, and&lt;/li&gt;&#xA;&lt;li&gt;Add an appropriate trusted root certificate file to &lt;code&gt;gnutls-trustfiles&lt;/code&gt; - the default setting for that list does not include any existing files on OS X and it doesn't seem to default to using the system keychain.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This can be done, for example, by installing &lt;code&gt;libressl&lt;/code&gt; from homebrew and adding the file &lt;code&gt;$(brew --prefix)/etc/libressl/cert.pem&lt;/code&gt; - homebrew says this file is created from the system keychain. Setting the variable &lt;code&gt;gnutls-log-level&lt;/code&gt; to a positive value shows that it does actually use that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; With these settings I get an extra unrelated message from gnutls saying&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;gnutls.c: [audit] Note that the security level of the Diffie-Hellman key exchange has been lowered to 256 bits and this may allow decryption of the session data&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This can be fixed by setting &lt;code&gt;gnutls-min-prime-bits&lt;/code&gt; to a value higher than the emacs default (256) and higher than what gnutls considers insecure (768) such as 3072, see &lt;a href=&quot;http://gnutls.org/manual/html_node/Selecting-cryptographic-key-sizes.html&quot; rel=&quot;nofollow&quot;&gt;http://gnutls.org/manual/html_node/Selecting-cryptographic-key-sizes.html&lt;/a&gt; as well as &lt;a href=&quot;http://www.keylength.com/en/3/&quot; rel=&quot;nofollow&quot;&gt;http://www.keylength.com/en/3/&lt;/a&gt; - this sets the minimum group size for Diffie-Hellman key exchange.&lt;/p&gt;&#xA;" OwnerUserId="875" LastActivityDate="2015-11-13T18:48:58.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18072" PostTypeId="2" ParentId="17918" CreationDate="2015-11-13T20:12:32.297" Score="1" Body="&lt;p&gt;If you don't mind some ugly code, I whipped up something that seems to work:&lt;br&gt;&#xA;&lt;sub&gt;(Disclaimer: I don't know Javascript, but it works on what I've tested)&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/js2-indent ()&#xA;  &quot;If a period is found on the previous line and it's not in a comment&#xA;or a string, then indent the current line to the last period on that&#xA;line, else indent normally.&quot;&#xA;  (interactive)&#xA;  ;; find column of . if any&#xA;  (let ((col (catch 'found&#xA;               (save-excursion&#xA;                 (back-to-indentation)&#xA;                 ;; if the start of the line is not a period (46)&#xA;                 ;; or is in a comment then indent normally&#xA;                 (when (or (not (eq (char-after) 46))&#xA;                           (nth 4 (syntax-ppss)))&#xA;                   (throw 'found nil))&#xA;                 (end-of-line 0)&#xA;                 (backward-char)&#xA;                 ;; if the previous line ends with a comment&#xA;                 ;; then skip the comment&#xA;                 (if (nth 4 (syntax-ppss (1- (point))))&#xA;                     (progn&#xA;                       (forward-line)&#xA;                       (forward-comment -1))&#xA;                   ;; syntax-ppss moved point backward&#xA;                   ;; so go forward a char&#xA;                   (forward-char))&#xA;                 ;; while the char isn't a newline (10)&#xA;                 (while (not (eq (char-after) 10))&#xA;                   ;; break if it's a period (46)&#xA;                   ;; and not in a string&#xA;                   (if (and (eq (char-after) 46)&#xA;                            (not (nth 3 (syntax-ppss))))&#xA;                       (throw 'found (current-column))&#xA;                     (backward-char)))&#xA;                 nil))))&#xA;    ;; indent to the found column, otherwise indent normally&#xA;    (if col&#xA;        (indent-line-to col)&#xA;      (js2-indent-line))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then to set the indenting so that &lt;code&gt;indent-region&lt;/code&gt; or &lt;code&gt;electric-indent-mode&lt;/code&gt; don't undo the changes, set the variable &lt;code&gt;indent-line-function&lt;/code&gt; to it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'js2-mode-hook (lambda ()&#xA;                           (setq indent-line-function #'my/js2-indent)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9314" LastEditorUserId="9314" LastEditDate="2015-11-13T20:35:43.853" LastActivityDate="2015-11-13T20:35:43.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18073" PostTypeId="1" AcceptedAnswerId="18097" CreationDate="2015-11-13T20:23:16.353" Score="0" ViewCount="263" Body="&lt;p&gt;I'd like to use one hotkey for continuing running (gud-cont) and starting running (gud-run). How can I check if gdb (or other debugger, if possible) is running a program right now? Is there a debugger-independent variable?&#xA;Currently my function looks as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun gud-run-or-cont (arg)&#xA;  &quot;Run or continue program with numeric argument ARG.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (when (boundp 'gdb-thread-number)&#xA;    (if (eq gdb-thread-number nil)&#xA;        (gud-run arg)&#xA;      (gud-cont arg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it does work with gdb only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, BTW, how to &lt;em&gt;properly&lt;/em&gt; bind this function to key (i.e. for gud buffers and source buffer, but for no one else)?&lt;/p&gt;&#xA;" OwnerUserId="2479" LastActivityDate="2015-11-15T01:44:47.443" Title="GUD mode: check if program is running" Tags="|gud|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18074" PostTypeId="2" ParentId="18042" CreationDate="2015-11-13T20:42:04.643" Score="-1" Body="&lt;p&gt;The command you're looking for is &lt;code&gt;switch-to-other-buffer&lt;/code&gt;. I bind it to F9, and use it frequently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: My bad - it's an elisp function co-opted from Xemacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Switch To Other Buffer, from Xemacs/files.el&#xA;(defun switch-to-other-buffer (arg)&#xA; &quot;Switch to the previous buffer.  With a numeric arg, n, switch to the nth&#xA;most recent buffer.  With an arg of 0, buries the current buffer at the&#xA;bottom of the buffer stack.&quot;&#xA; (interactive &quot;p&quot;)&#xA; (if (eq arg 0)&#xA; (bury-buffer (current-buffer)))&#xA; (switch-to-buffer&#xA;  (if (&amp;lt;= arg 1) (other-buffer (current-buffer))&#xA;(nth (1+ arg) (buffer-list)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10140" LastEditorUserId="10140" LastEditDate="2015-11-14T03:35:37.840" LastActivityDate="2015-11-14T03:35:37.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18075" PostTypeId="2" ParentId="17714" CreationDate="2015-11-13T21:57:00.407" Score="2" Body="&lt;p&gt;Okay, this was a little bit involved, but I have a solution now.  There were two main steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create the appropriate folder in the output directory.  I used the new advice system, inspired by db48x.&lt;/li&gt;&#xA;&lt;li&gt;Fix links to point to &quot;example/index.html&quot; instead of &quot;example.html&quot;.  I created a new backend, derived from &lt;code&gt;ox-html.el&lt;/code&gt;.  It was a one-line change.  But the change was inside a lambda within a function meaning I couldn't modify the lambda even with advice.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I made a quick project at &lt;a href=&quot;https://github.com/jschaf/org-export-html-clean&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jschaf/org-export-html-clean&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2015-11-13T21:57:00.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18076" PostTypeId="1" AcceptedAnswerId="36234" CreationDate="2015-11-13T21:59:19.883" Score="2" ViewCount="896" Body="&lt;p&gt;In GNU Emacs GUI, I use the Mac Command key &lt;kbd&gt;⌘&lt;/kbd&gt; as &lt;code&gt;super&lt;/code&gt;: &lt;code&gt;(setq mac-command-modifier 'super)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the &lt;kbd&gt;⌘&lt;/kbd&gt; key &lt;a href=&quot;https://emacs.stackexchange.com/questions/14029/making-command-act-as-super-in-iterm2&quot;&gt;does not send input to Terminal or iTerm2&lt;/a&gt;. Given this, is there a way to simulate the &lt;code&gt;super&lt;/code&gt; key and still access my Emacs &lt;code&gt;super&lt;/code&gt; keybindings from within terminal mode? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm trying to do keybinding &lt;code&gt;(kbd &quot;s-s&quot;)&lt;/code&gt;, for instance, can I tell Emacs to look for some substitute, like maybe &lt;kbd&gt;Esc&lt;/kbd&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt; or something? Or even a key-chord like &lt;code&gt;(key-chord-define-global &quot;SS&quot; 'super-modifier)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I also have keybindings that combine &lt;code&gt;super&lt;/code&gt; with other modifier keys, e.g. &lt;code&gt;(kbd &quot;s-S-k&quot;)&lt;/code&gt;, i.e. &lt;kbd&gt;⌘⇧K&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-10-17T22:37:39.770" Title="how to substitute SUPER keybindings in Emacs terminal mode?" Tags="|key-bindings|osx|terminal-emacs|term|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18077" PostTypeId="1" AcceptedAnswerId="18078" CreationDate="2015-11-13T22:00:52.303" Score="40" ViewCount="6585" Body="&lt;p&gt;git is capable of stashing of individual hunks.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With &lt;code&gt;--patch&lt;/code&gt;, you can interactively select hunks from the diff between &lt;strong&gt;HEAD&lt;/strong&gt; and the working tree to be stashed. The stash entry is constructed such that its index state is the same as the index state of your repository, and its worktree contains only the changes you selected interactively. The selected changes are then rolled back from your worktree. See the &lt;em&gt;“Interactive Mode”&lt;/em&gt; section of &lt;em&gt;git-add[1]&lt;/em&gt; to learn how to operate the &lt;code&gt;--patch&lt;/code&gt; mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use it with magit frontend? Magit simplifies patch mode usage for staging spectacular. Could it do the same work for stashes?&lt;/p&gt;&#xA;" OwnerUserId="9629" LastActivityDate="2022-12-02T11:31:46.610" Title="How to stash individual files with magit" Tags="|magit|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18078" PostTypeId="2" ParentId="18077" CreationDate="2015-11-13T22:25:49.847" Score="59" Body="&lt;p&gt;You can stage whatever changes you want to stash and then call magit-stash-index (zi).&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-11-13T22:25:49.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18079" PostTypeId="1" AcceptedAnswerId="18610" CreationDate="2015-11-13T22:36:08.713" Score="7" ViewCount="3347" Body="&lt;p&gt;After &lt;a href=&quot;https://glyph.twistedmatrix.com/2015/11/editor-malware.html&quot; rel=&quot;nofollow&quot;&gt;reading this post&lt;/a&gt; I decided to harder the security of Emacs. However, after setting everything and doing the test, Emacs is still ill-configured. Everything is done in a GNU/Linux distribution.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Installing certifi&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As said the in the blog post above, we install &lt;code&gt;certifi&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pip3 install -U --user certifi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I check that the module have been installed correctly&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python3 -m certifi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which it was!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/jorge/.local/lib/python3.5/site-packages/certifi/cacert.pem&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Configuring Emacs&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I little modified version of the elisp snippet from the blog post above.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((trustfile&#xA;       (replace-regexp-in-string&#xA;        &quot;\\\\&quot; &quot;/&quot;&#xA;        (replace-regexp-in-string&#xA;         &quot;\n&quot; &quot;&quot;&#xA;         (shell-command-to-string &quot;python3 -m certifi&quot;)))))&#xA;  (setf tls-program&#xA;        (list&#xA;         (format &quot;gnutls-cli%s --x509cafile %s -p %%p %%h&quot;&#xA;                 (if (eq window-system 'w32) &quot;.exe&quot; &quot;&quot;) trustfile)))&#xA;  (setf tls-checktrust t)&#xA;  (setf gnutls-verify-error t)&#xA;  (setf gnutls-trustfiles (list trustfile)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Testing the configuration&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Again, another snippet of elisp slightly modified by me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((bad-hosts&#xA;       (loop for bad&#xA;             in `(&quot;https://wrong.host.badssl.com/&quot;&#xA;                  &quot;https://self-signed.badssl.com/&quot;)&#xA;             if (condition-case e&#xA;                    (url-retrieve&#xA;                     bad (lambda (retrieved) t))&#xA;                  (error nil))&#xA;             collect bad)))&#xA;  (if bad-hosts&#xA;      (print (format &quot;tls misconfigured; retrieved %s ok&quot;&#xA;                     bad-hosts))&#xA;    (url-retrieve &quot;https://badssl.com&quot;&#xA;                  (lambda (retrieved) t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After running that snippet, I get this output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;tls misconfigured; retrieved (https://self-signed.badssl.com/) ok&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Edit&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;code&gt;gnutls-log-level&lt;/code&gt; to 2 output this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Evaluate this emacs-lisp code block on your system? (y or n) y&#xA;executing Emacs-Lisp code block...&#xA;Contacting host: wrong.host.badssl.com:443&#xA;gnutls.c: [1] (Emacs) allocating credentials&#xA;gnutls.c: [2] (Emacs) allocating x509 credentials&#xA;gnutls.c: [2] (Emacs) using default verification flags&#xA;gnutls.c: [1] (Emacs) setting the trustfile:  /home/jorge/.local/lib/python3.5/site-packages/certifi/cacert.pem&#xA;gnutls.c: [1] (Emacs) gnutls callbacks&#xA;gnutls.c: [1] (Emacs) gnutls_init&#xA;gnutls.c: [1] (Emacs) got non-default priority string: NORMAL&#xA;gnutls.c: [1] (Emacs) setting the priority string&#xA;gnutls.c: [audit] Note that the security level of the Diffie-Hellman key exchange has been lowered to 256 bits and this may allow decryption of the session data&#xA;&#xA;gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable, try again. [4822 times]&#xA;Contacting host: self-signed.badssl.com:443&#xA;gnutls.c: [1] (Emacs) allocating credentials&#xA;gnutls.c: [2] (Emacs) allocating x509 credentials&#xA;gnutls.c: [2] (Emacs) using default verification flags&#xA;gnutls.c: [1] (Emacs) setting the trustfile:  /home/jorge/.local/lib/python3.5/site-packages/certifi/cacert.pem&#xA;gnutls.c: [1] (Emacs) gnutls callbacks&#xA;gnutls.c: [1] (Emacs) gnutls_init&#xA;gnutls.c: [1] (Emacs) got non-default priority string: NORMAL&#xA;gnutls.c: [1] (Emacs) setting the priority string&#xA;gnutls.c: [audit] Note that the security level of the Diffie-Hellman key exchange has been lowered to 256 bits and this may allow decryption of the session data&#xA;&#xA;gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable, try again. [3737 times]&#xA;Code block evaluation complete.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;EDIT 2&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I decided to try fetching another website, a website which such SSL certificate bothers Firefox/Iceweasel:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(url-retrieve &quot;https://parabola.nu/&quot; (lambda (retrieved) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, I got this sweet error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Certificate validation failed parabola.nu, verification code 66&quot;)&#xA;gnutls-boot(#&amp;lt;process parabola.nu&amp;gt; gnutls-x509pki (:priority &quot;NORMAL&quot; :hostname &quot;parabola.nu&quot; :loglevel 0 :min-prime-bits 256 :trustfiles (&quot;/home/jorge/.local/lib/python3.5/site-packages/certifi/cacert.pem&quot;) :crlfiles nil :keylist nil :verify-flags nil :verify-error t :callbacks nil))&#xA;gnutls-negotiate(:process #&amp;lt;process parabola.nu&amp;gt; :type gnutls-x509pki :hostname &quot;parabola.nu&quot;)&#xA;open-gnutls-stream(&quot;parabola.nu&quot; #&amp;lt;buffer  *url-http-temp*&amp;gt; &quot;parabola.nu&quot; 443)&#xA;network-stream-open-tls(&quot;parabola.nu&quot; #&amp;lt;buffer  *url-http-temp*&amp;gt; &quot;parabola.nu&quot; 443 (:type tls :nowait t))&#xA;open-network-stream(&quot;parabola.nu&quot; #&amp;lt;buffer  *url-http-temp*&amp;gt; &quot;parabola.nu&quot; 443 :type tls :nowait t)&#xA;byte-code(&quot;\306\211\n\307&amp;gt;\203$\n\310=\203\311\312\f&#xA;\313\n\314\315\316\317\&quot;&amp;amp;\202Y\n\320=\2034\321\f&#xA;$\202Y\n\322=\203D\323\f&#xA;$\202Y\n\324=\203T\325\f&#xA;$\202Y\326\327\&quot;*\306\207&quot; [coding-system-for-write coding-system-for-read gw-method name buffer host binary (tls ssl native) native plain open-network-stream :type :nowait featurep make-network-process (:nowait t) socks socks-open-network-stream telnet url-open-telnet rlogin url-open-rlogin error &quot;Bad setting of url-gateway-method: %s&quot; service url-gateway-method conn] 11)&#xA;url-open-stream(&quot;parabola.nu&quot; #&amp;lt;buffer  *url-http-temp*&amp;gt; &quot;parabola.nu&quot; 443)&#xA;url-http-find-free-connection(&quot;parabola.nu&quot; 443)&#xA;url-http([cl-struct-url &quot;https&quot; nil nil &quot;parabola.nu&quot; nil &quot;/&quot; nil nil t nil t] (lambda (retrieved) t) (nil))&#xA;url-https([cl-struct-url &quot;https&quot; nil nil &quot;parabola.nu&quot; nil &quot;/&quot; nil nil t nil t] (lambda (retrieved) t) (nil))&#xA;url-retrieve-internal(&quot;https://parabola.nu/&quot; (lambda (retrieved) t) (nil) nil nil)&#xA;url-retrieve(&quot;https://parabola.nu/&quot; (lambda (retrieved) t))&#xA;eval((url-retrieve &quot;https://parabola.nu/&quot; (function (lambda (retrieved) t))) nil)&#xA;eval-last-sexp-1(nil)&#xA;eval-last-sexp(nil)&#xA;call-interactively(eval-last-sexp nil nil)&#xA;command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, so far I can say the changes made to my Emacs configuration are working.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="875" LastEditDate="2015-11-16T20:38:54.387" LastActivityDate="2015-12-04T16:13:34.857" Title="Emacs TLS check is still ill-configured" Tags="|gnutls|ssl|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18080" PostTypeId="2" ParentId="18039" CreationDate="2015-11-14T00:24:50.097" Score="2" Body="&lt;p&gt;It doesn't matter at all.  The proper style is the one that suits you best.  You can even put timestamps right in the middle if you want.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Watch out&#xA;  On &amp;lt;2015-11-13 Fri&amp;gt; something will happen.  Be prepared.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; treats every timestamp it finds in the body the same and the entry will correctly appear in the agenda on every day for which there is an active timestamp in the body or the heading.  You can make every reference to time a timestamp (active or inactive depending on context) and rely on the agenda and exporters to do something sensible with them.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-11-14T00:24:50.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18081" PostTypeId="1" CreationDate="2015-11-14T01:02:54.310" Score="0" ViewCount="162" Body="&lt;p&gt;I am having issues getting org-babel to export accented letters properly. This happens only in source blocks. For &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC java&#xA;// Testing characters á, é, í, ó, ú, ç, ã&#xA;public void test(){}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The resulting export will exclude these characters. If I use them outside of source blocks everything works as expected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help here is appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;This only happens in the PDF export. The generated text file contains &lt;code&gt;\usepackage[utf8]{inputenc}&lt;/code&gt; which should work.&lt;/p&gt;&#xA;" OwnerUserId="10144" LastEditorUserId="10144" LastEditDate="2015-11-16T12:23:23.933" LastActivityDate="2015-11-16T12:23:23.933" Title="Accented letters in source blocks in org-mode" Tags="|org-mode|org-export|org-babel|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18082" PostTypeId="1" AcceptedAnswerId="18084" CreationDate="2015-11-14T04:28:11.727" Score="58" ViewCount="27929" Body="&lt;p&gt;If I am editing a .tex file in emacs, by default (for me) the bottom right corner of the frame will say &quot;LaTeX/P&quot;. However, I won't get to that mode by typing &quot;M-x LaTeX/P-mode&quot;; I can only get to it by typing &quot;M-x latex-mode&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than Googling it, how am I supposed to know the thing I type to get to that mode is &quot;latex-mode&quot;?&lt;/p&gt;&#xA;" OwnerUserId="10145" LastActivityDate="2018-09-09T20:07:29.027" Title="How do I get the current major mode?" Tags="|major-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18083" PostTypeId="2" ParentId="18082" CreationDate="2015-11-14T04:50:10.427" Score="18" Body="&lt;p&gt;&lt;code&gt;C-h m&lt;/code&gt; gives you help on the current mode, and it typically tells you the name of the command that turns the mode on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in Emacs-Lisp mode &lt;code&gt;C-h m&lt;/code&gt; tells you that you are in &lt;code&gt;Emacs-Lisp&lt;/code&gt; mode. The command that turns the mode on is just &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h m&lt;/code&gt; also provides a link to the library that defines the mode, and if you click on that link it takes you to the definition of the mode command. For example, in Emacs-Lisp mode &lt;code&gt;C-h m&lt;/code&gt; tells you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs-Lisp mode defined in `lisp-mode.el'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if you click the link &lt;code&gt;lisp-mode.el&lt;/code&gt; then Emacs takes you to the definition of command &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, which is the command that turns the mode on:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-derived-mode emacs-lisp-mode prog-mode &quot;Emacs-Lisp&quot;&#xA;  &quot;Major mode for editing Lisp code to run in Emacs.&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-14T04:55:10.783" LastActivityDate="2015-11-14T04:55:10.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18084" PostTypeId="2" ParentId="18082" CreationDate="2015-11-14T05:06:23.703" Score="82" Body="&lt;p&gt;I think the simplest way is to check the value of the buffer-local &lt;code&gt;major-mode&lt;/code&gt; variable, with either of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;major-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;major-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-11-14T05:06:23.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18086" PostTypeId="2" ParentId="18059" CreationDate="2015-11-14T05:47:55.467" Score="2" Body="&lt;p&gt;Load &lt;code&gt;pyvenv&lt;/code&gt; first and then activate env. Add this to your init file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'pyvenv)&#xA;(pyvenv-activate &quot;~/.virtualenvs/exp/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you are using virtualenvwrapper, you can use &lt;code&gt;pyvenv-workon&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'pyvenv)&#xA;(pyvenv-workon &quot;exp&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you load &lt;code&gt;elpy&lt;/code&gt; first, it will automatically load &lt;code&gt;pyvenv&lt;/code&gt;. You don't need to do &lt;code&gt;(require 'pyvenv)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-11-14T05:47:55.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18087" PostTypeId="2" ParentId="18068" CreationDate="2015-11-14T10:08:04.180" Score="5" Body="&lt;p&gt;Here's a pretty long but efficient solution.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install &lt;code&gt;simple-httpd&lt;/code&gt; and &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;httpd-start&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Install &lt;code&gt;markdown&lt;/code&gt; from your system's package manager.&lt;/li&gt;&#xA;&lt;li&gt;Open your markdown buffer and run &lt;kbd&gt;markdown-export&lt;/kbd&gt;. That produces a HTML file in the same directory.&lt;/li&gt;&#xA;&lt;li&gt;Open that HTML file.&lt;/li&gt;&#xA;&lt;li&gt;Install &lt;code&gt;impatient-mode&lt;/code&gt; and &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;impatient-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Go back to your markdown file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Finally, evaluate this code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun markdown-export-continuous (&amp;amp;optional output-file)&#xA;  (interactive)&#xA;  (let ((input-file (buffer-file-name))&#xA;        (output-file (markdown-export-file-name &quot;.html&quot;)))&#xA;    (when output-file&#xA;      (with-current-buffer (find-file-noselect output-file)&#xA;        (erase-buffer)&#xA;        (insert&#xA;         (shell-command-to-string&#xA;          (format &quot;markdown %s&quot; input-file)))&#xA;        (save-buffer)))))&#xA;(add-hook 'after-save-hook 'markdown-export-continuous t t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;add-hook&lt;/code&gt; statement needs to be local to Markdown, so run it in that buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After all this, open your browser on &lt;code&gt;http://localhost:8080/imp/&lt;/code&gt; and&#xA;it will refresh each time you &lt;kbd&gt;C-x C-s&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-14T10:08:04.180" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18088" PostTypeId="1" CreationDate="2015-11-14T11:43:19.447" Score="0" ViewCount="233" Body="&lt;p&gt;Sometimes it is possible to add commands to the start of an &lt;code&gt;org-mode&lt;/code&gt; buffer to customize it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like &lt;code&gt;flyspell&lt;/code&gt; to run and stay active with &lt;code&gt;pt_PT&lt;/code&gt; dictionary on a specific file whenever I open it. This is an org-mode file opened with emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that? &lt;/p&gt;&#xA;" OwnerUserId="9864" LastActivityDate="2015-11-14T11:43:19.447" Title="Run flyspell when loading new buffer with custom dictionary" Tags="|org-mode|flyspell|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18089" PostTypeId="2" ParentId="18057" CreationDate="2015-11-14T14:25:03.493" Score="1" Body="&lt;p&gt;I don't have a very good answer for you, but org-mode is just calling &lt;code&gt;string-to-number&lt;/code&gt; on the cell when it sorts it. &lt;code&gt;string-to-number&lt;/code&gt; just ignores anything after the first non-digit character, so &quot;216,574&quot; is converted to 216. I don't know if this is always the case; internally it's calling &lt;code&gt;strtoumax&lt;/code&gt; (or &lt;code&gt;atof&lt;/code&gt; if it looks like a floating-point number) which is likely to change its behavior in different locales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see what language environment you're in by running &lt;code&gt;M-x describe-language-environment RET&lt;/code&gt;. You can change it with &lt;code&gt;set-language-environment&lt;/code&gt;, or by setting the &lt;code&gt;LANG&lt;/code&gt; environment variable before you start emacs.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-14T14:25:03.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18090" PostTypeId="1" CreationDate="2015-11-14T15:38:49.083" Score="0" ViewCount="3902" Body="&lt;p&gt;When I type emacs it opens it in the terminal window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish it to open in it's regular separate window (the color scheme look different in the terminal compared to the separate window).&#xA;I tried &quot;emacs -c&quot; and &quot;emacsclient -c&quot;, both don't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using centos 7 ( just starting to transition to linux) , there is no emacs ,so I install and the version I get is 24.3.1&lt;/p&gt;&#xA;" OwnerUserId="10148" LastActivityDate="2015-11-14T17:36:48.993" Title="Open emacs in new window" Tags="|window|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18091" PostTypeId="1" AcceptedAnswerId="18092" CreationDate="2015-11-14T16:11:53.077" Score="1" ViewCount="115" Body="&lt;p&gt;Scheme syntax seems very lambda-expression-friendly. I can do this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define blah&#xA;   (lambda (n) (* n n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this isn't possible in elisp. I can do this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun simple (x)&#xA;  ((lambda (n) (* n n)) x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but of course not this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun simple&#xA;   (lambda (n) (* n n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;defun simple ()&#xA;       (lambda (n) (* n n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence, elisp seems a step removed from the Scheme world of &quot;purer&quot; lambda expressions . . . or am I, the beginner, missing something here . . . or is this not a big deal, i.e., there's nothing gained with the Scheme way of doing lambda.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2022-09-18T17:37:45.603" LastActivityDate="2022-09-18T17:37:45.603" Title="Scheme-like lambda expressions?" Tags="|elisp|scheme|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18092" PostTypeId="2" ParentId="18091" CreationDate="2015-11-14T16:46:34.750" Score="9" Body="&lt;p&gt;It's not a big deal. You can still:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq blah-1&#xA;      (lambda (n) (* n n)))&#xA;(funcall blah-1 3)&#xA;;; =&amp;gt; 9&#xA;(fset 'blah-2 (lambda (n) (* n n)))&#xA;(blah-2 3)&#xA;;; =&amp;gt; 9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically, Elisp is LISP-2, and Scheme is LISP-1.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-14T16:46:34.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18093" PostTypeId="2" ParentId="18090" CreationDate="2015-11-14T17:36:48.993" Score="2" Body="&lt;p&gt;If you want to edit a configuration file which is owned by root, you can of course run emacs as root and just live with the fact that it's running in the terminal window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is a different way that you may find to be better. You can run emacs as yourself, and then open the file using &lt;a href=&quot;http://www.gnu.org/software/tramp/&quot; rel=&quot;nofollow&quot;&gt;TRAMP&lt;/a&gt;. TRAMP is usually used to open files located on remote computers, but it can also open files as root. For example, if you wanted to edit the file &lt;code&gt;/etc/hosts&lt;/code&gt;, you would open it via TRAMP by specifying the path &lt;code&gt;/sudo:localhost:/etc/hosts&lt;/code&gt;. This will prompt for your password just like the &lt;code&gt;sudo&lt;/code&gt; program would, and saves you the hassle of leaving your current emacs session and starting a new one as root.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-14T17:36:48.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18094" PostTypeId="2" ParentId="18037" CreationDate="2015-11-14T18:37:04.850" Score="1" Body="&lt;p&gt;See documentation for the &lt;code&gt;man&lt;/code&gt; command (&lt;code&gt;man-entry&lt;/code&gt; is an alias to it) with &lt;code&gt;C-h f man&lt;/code&gt;.  You can add an option to be passed to man, as in:&#xA;&lt;code&gt;-K texttosearchfor&lt;/code&gt;, and then navigate the pages with &lt;code&gt;M-n&lt;/code&gt; and &lt;code&gt;M-p&lt;/code&gt;.  There are two pitfalls, however:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you need to protect the space with &lt;code&gt;C-q&lt;/code&gt; (or emacs will erroneously perform completion),&lt;/li&gt;&#xA;&lt;li&gt;you may have to wait quite some time for all pages to be rendered.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;-k&lt;/code&gt; (lowercase) option is handled nicely.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-14T18:37:04.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18095" PostTypeId="2" ParentId="17627" CreationDate="2015-11-14T19:06:15.990" Score="2" Body="&lt;p&gt;You must &lt;code&gt;(require …)&lt;/code&gt; or &lt;code&gt;(eval-and-compile (load …))&lt;/code&gt; the libraries or files that provide the definitions of these macros in &lt;em&gt;every&lt;/em&gt; file where you use these macros, &lt;em&gt;before&lt;/em&gt; their &lt;em&gt;first&lt;/em&gt; use, and you need to set up &lt;code&gt;flycheck-emacs-lisp-load-path&lt;/code&gt; to include the directories containing these libraries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise the byte compiler does not even know that these symbols are macros and necessarily must treat invocations as normal function calls and arguments as normal Emacs Lisp expressions.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-11-15T10:31:29.793" LastActivityDate="2015-11-15T10:31:29.793" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18096" PostTypeId="2" ParentId="17813" CreationDate="2015-11-14T22:05:41.353" Score="1" Body="&lt;p&gt;I ended up doing this because dayone exports with tabs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\t\Date:\t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;***&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then creating years and moving stuff manually. Titles don't have the same exact format that orgmode journal creates but who cares.&lt;/p&gt;&#xA;" OwnerUserId="8844" LastActivityDate="2015-11-14T22:05:41.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18097" PostTypeId="2" ParentId="18073" CreationDate="2015-11-14T23:10:43.577" Score="1" Body="&lt;p&gt;Alas, I don't think this will be easily doable if at all. gud with gdb works a little differently (and, overall, better) than the other debuggers gud supports because it has a more tighter communication with the underlying debugger, gdb. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the other debuggers, I think what you'd have to do is first see if there is a gud process running. If so, then try to send a command asking the debugger what state it is in and parse the results of that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first part, seeing if there is a gud process and if it is running you could get like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun gud-process-running-p ()&#xA;   &quot;Returns true if gud buffer process is running&quot;&#xA;   (let ((process (get-buffer-process gud-comint-buffer)))&#xA;     (and gud-comint-buffer process  (eq 'run (process-status process)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The equivalent for &lt;a href=&quot;https://github.com/rocky/emacs-dbgr&quot; rel=&quot;nofollow&quot;&gt;realgud&lt;/a&gt; is which allows for multiple debug sessions is: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun realgud-process-running-p ()&#xA;  &quot;Returns true if command buffer process is running&quot;&#xA;  (let ((cmdbuf (realgud-get-cmdbuf))&#xA;    (process (get-buffer-process cmdbuf)))&#xA;    (and cmdbuf process (eq 'run (process-status process)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In a gdb-like debugger, you can find out whether the debugger is running using &quot;info program&quot;. In jdb, I suppose you could run a command like &quot;where&quot; and look for the error message it reports. For pdb, I'm not sure what the equivalent is for &quot;info program&quot;. A &quot;where&quot; command will give a stack trace even after the program terminates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lack of features let alone uniformity is one reason why &lt;a href=&quot;https://pypi.python.org/pypi/trepan/&quot; rel=&quot;nofollow&quot;&gt;my&lt;/a&gt; &lt;a href=&quot;https://pypi.python.org/pypi/trepan3k/&quot; rel=&quot;nofollow&quot;&gt;python debuggers&lt;/a&gt; follow the gdb command set. This makes it easier to have a common front end do the same task across different debuggers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok. But now suppose you have figured how the command to run to get status. Next you'd need to send it via &lt;em&gt;gud-call&lt;/em&gt; or &lt;em&gt;process-send-string&lt;/em&gt; and interpret the results. But see &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/gud.el#n2481&quot; rel=&quot;nofollow&quot;&gt;this comment&lt;/a&gt; regarding sending information that you don't want echoed. &lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2015-11-15T01:44:47.443" LastActivityDate="2015-11-15T01:44:47.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18098" PostTypeId="1" AcceptedAnswerId="18117" CreationDate="2015-11-15T03:15:16.090" Score="2" ViewCount="50" Body="&lt;p&gt;Emacs provides a nice manual viewer which could be used for obtaining documentation for C syscalls (at point with &lt;code&gt;Man-default-man-entry&lt;/code&gt;. However, it always starts searching manuals from section 0. How can I configure man viewer so that it will start from section 2, then 3, and then 0?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;man 1 perror&lt;/code&gt; doesn't make much sense&lt;/p&gt;&#xA;" OwnerUserId="2479" LastActivityDate="2015-11-16T07:32:33.937" Title="Manual pages priority in Emacs" Tags="|shell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18101" PostTypeId="1" CreationDate="2015-11-15T07:39:59.707" Score="18" ViewCount="6739" Body="&lt;p&gt;Is there any sort of markup in org-mode to get multiple lines of text to be bold, italics, etc?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*This is what I want to be bold and I only want lines to &#xA;be a certain length so that this doesn't work.*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I know about using &lt;code&gt;visual-line-mode&lt;/code&gt; as an alternative to &lt;code&gt;fill-paragraph&lt;/code&gt; which would solve this problem, but I like &lt;code&gt;M-q&lt;/code&gt; too much and I want to try and keep my files at a certain width.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Snippets welcome. I don't know Elisp so I can't do it myself. But I guess this would ruin export too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_BOLD&#xA;  All my text in here would be super bold&#xA;  and would be very nice.&#xA;#+END_BOLD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="7" LastEditDate="2015-11-15T13:34:50.673" LastActivityDate="2020-10-23T22:25:10.173" Title="Org-mode multi-line emphasis and bold" Tags="|org-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18102" PostTypeId="2" ParentId="5758" CreationDate="2015-11-15T09:16:03.533" Score="0" Body="&lt;p&gt;I have a few different files that I load in the init.el, one of these files loading the evil-mode related definitions. Adding the statements according to below in the evil-mode definition file solved the problem for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'evil)&#xA;;; all the definitions goes here&#xA;(add-hook 'evil-after-load-hook (lambda () ...)) ; config&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10158" LastEditorUserId="1979" LastEditDate="2015-11-15T22:16:15.560" LastActivityDate="2015-11-15T22:16:15.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18103" PostTypeId="1" CreationDate="2015-11-15T11:23:52.847" Score="5" ViewCount="117" Body="&lt;p&gt;Let's say I have a source block containing a shell command that outputs some C code.  For instance&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results verbatim :exports both&#xA;echo 'const char* str = &quot;foo&quot;;'&#xA;#+END_SRC&#xA;#+RESULTS:&#xA;: const char* str = &quot;foo&quot;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export that to HTML, for example, the shell code is fontified like shell code.  However the result is not fontified, since org does not know it is actually C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I fix that?  Is there a way to hint that the result of some command is in another language?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading &lt;a href=&quot;http://orgmode.org/manual/results.html&quot; rel=&quot;noreferrer&quot;&gt;the documentation of &lt;code&gt;:results&lt;/code&gt;&lt;/a&gt; it seems I might want use option &lt;code&gt;code&lt;/code&gt; to specify that the output is some code, but that seems to assume the output uses the same language as the input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results verbatim code :exports both&#xA;echo 'const char* str = &quot;foo&quot;;'&#xA;#+END_SRC&#xA;#+RESULTS:&#xA;#+BEGIN_SRC sh&#xA;const char* str = &quot;foo&quot;;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to specify the language of the output?&lt;/p&gt;&#xA;" OwnerUserId="10151" LastEditorUserId="105" LastEditDate="2015-11-15T16:09:06.093" LastActivityDate="2015-11-15T16:09:06.093" Title="Fontify result of source block in org-mode" Tags="|org-mode|org-babel|font-lock|" AnswerCount="0" CommentCount="0" ClosedDate="2015-11-19T08:22:20.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="18104" PostTypeId="1" AcceptedAnswerId="18170" CreationDate="2015-11-15T15:59:09.897" Score="2" ViewCount="591" Body="&lt;p&gt;In git one could do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone ssh://userid@somerepository.org:2222/home/user/gitRepo/myRepo /home/user/localrepo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to clone a remote repo with ssh and a non-standard port (in this example: 2222).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can the same be done with Magit2.0? Using the above format fails with an error that Magit is trying to user port 22&lt;/p&gt;&#xA;" OwnerUserId="8231" LastActivityDate="2015-11-17T18:23:44.233" Title="How to use magit-clone for a non-standard port?" Tags="|magit|ssh|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18106" PostTypeId="1" CreationDate="2015-11-15T18:59:10.623" Score="9" ViewCount="1017" Body="&lt;p&gt;Normally, when I export to html an &lt;code&gt;org-mode&lt;/code&gt; buffer that contains a&#xA;link to an image, the link is coverted to a proper html &lt;code&gt;&amp;lt;img...&amp;gt;&lt;/code&gt;.&#xA;However, if that image has a &lt;code&gt;.svg&lt;/code&gt; extension, it is exported as an &lt;code&gt;&amp;lt;object...&amp;gt;&lt;/code&gt; instead. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I prevent this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, the following link:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:https://clojars.org/malabarba/lazy-map/latest-version.svg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gets exported like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;object type=&quot;image/svg+xml&quot; data=&quot;https://clojars.org/malabarba/lazy-map/latest-version.svg&quot; &amp;gt;&#xA;Sorry, your browser does not support SVG.&amp;lt;/object&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'd like it to be exported like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;img src=&quot;https://clojars.org/malabarba/lazy-map/latest-version.svg&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastActivityDate="2015-11-15T20:53:37.450" Title="How to export svg images as &lt;img ...&gt; in html export" Tags="|org-mode|org-export|html|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18107" PostTypeId="1" CreationDate="2015-11-15T20:07:31.833" Score="2" ViewCount="417" Body="&lt;p&gt;I used &lt;code&gt;cask package&lt;/code&gt; to generate a package tar file for my local fork of &lt;code&gt;ensime&lt;/code&gt;, and added it to my &lt;code&gt;package-archives&lt;/code&gt; using &lt;code&gt;customize-option&lt;/code&gt;. However, I then got this backtrace when attempting to &lt;code&gt;list-packages&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Opening input file&quot; &quot;no such file or directory&quot; &quot;/home/hackthetower/ensime-emacs/dist/archive-contents&quot;)&#xA;  insert-file-contents(&quot;/home/hackthetower/ensime-emacs/dist/archive-contents&quot;)&#xA;  package--download-one-archive((&quot;hackthetower&quot; . &quot;/home/hackthetower/ensime-emacs/dist&quot;) &quot;archive-contents&quot;)&#xA;  #[0 &quot;\301\300\302\&quot;\207&quot; [(&quot;hackthetower&quot; . &quot;/home/hackthetower/ensime-emacs/dist&quot;) package--download-one-archive &quot;archive-contents&quot;] 3 &quot;\n\n(fn)&quot;]()&#xA;  funcall(#[0 &quot;\301\300\302\&quot;\207&quot; [(&quot;hackthetower&quot; . &quot;/home/hackthetower/ensime-emacs/dist&quot;) package--download-one-archive &quot;archive-contents&quot;] 3 &quot;\n\n(fn)&quot;])&#xA;  package-refresh-contents()&#xA;  list-packages(nil)&#xA;  call-interactively(list-packages record nil)&#xA;  command-execute(list-packages record)&#xA;  helm-M-x(nil &quot;list-packages&quot;)&#xA;  call-interactively(helm-M-x nil nil)&#xA;  command-execute(helm-M-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Indeed, this &lt;code&gt;archive-contents&lt;/code&gt; file mentioned in the backtrace doesn't exist. How am I supposed to create it?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-03-15T07:48:34.797" Title="What is archive-contents and how do I create it?" Tags="|package-repositories|package-development|cask|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18108" PostTypeId="2" ParentId="18106" CreationDate="2015-11-15T20:53:37.450" Score="2" Body="&lt;p&gt;Using a &lt;code&gt;:fallback&lt;/code&gt; attribute almost does it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :fallback /tmp/toto.svg&#xA;[[file:/tmp/toto.svg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is exported as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;figure&quot;&amp;gt;&#xA;&amp;lt;p&amp;gt;&amp;lt;object type=&quot;image/svg+xml&quot; data=&quot;file:///tmp/toto.svg&quot; &amp;gt;&#xA;&amp;lt;img src=&quot;/tmp/toto.svg&quot;  /&amp;gt;&amp;lt;/object&amp;gt;&#xA;&amp;lt;/p&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Otherwise, it seems easy to redefine or advice &lt;code&gt;org-html--format-image&lt;/code&gt; in &lt;code&gt;ox-html.el&lt;/code&gt; (for some reason, it treats svg's specially).&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-15T20:53:37.450" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18109" PostTypeId="1" AcceptedAnswerId="18110" CreationDate="2015-11-15T22:01:09.650" Score="7" ViewCount="776" Body="&lt;p&gt;I added the following settings to my &lt;code&gt;dot-Emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook 'turn-on-auto-fill)&#xA;(add-hook 'org-mode-hook&#xA;        (lambda() (set-fill-column 80)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I'm typing sentences in an existing Org-file  which are longer than 80 columns, it places on the next line in the Org-file. It works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have in the same Org-file already sentences that I typed in the past,&#xA;which are longer than 80 columns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I tell Emacs that he must format all sentences in the buffer which are longer than 80 columns. So that the existing words, which exceed 80 columns-limit will begin on the next line?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="1979" LastEditDate="2015-11-16T12:52:18.303" LastActivityDate="2015-11-16T12:52:18.303" Title="How realign existing contents of buffer on column-width?" Tags="|fill-paragraph|auto-fill-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18110" PostTypeId="2" ParentId="18109" CreationDate="2015-11-15T22:12:52.877" Score="5" Body="&lt;p&gt;If you don't mind filling &lt;em&gt;paragraphs&lt;/em&gt; rather than just individual&#xA;sentences, the simplest way to do it is probably to select the&#xA;entire buffer and use &lt;code&gt;fill-region&lt;/code&gt;.  Here's a simple command that&#xA;will automate the process:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fill-buffer ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (widen)&#xA;      (fill-region (point-min) (point-max)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-11-15T22:12:52.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18111" PostTypeId="1" CreationDate="2015-11-16T01:41:21.253" Score="7" ViewCount="1374" Body="&lt;p&gt;I'd like to display event counts in a conky window. Things like tasks scheduled for today, within the next 3 days, 15 days, count of pending todo items, etc. Since conky doesn't &quot;talk&quot; org-mode, the next best way is to call a shell script and use its output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I call emacs in batch mode for this? Is there an org-agenda function that prints event counts? Should I do my own parsing instead?&lt;/p&gt;&#xA;" OwnerUserId="3945" LastActivityDate="2015-11-16T21:04:52.353" Title="Query the org agenda from the commandline?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18112" PostTypeId="1" CreationDate="2015-11-16T02:30:31.110" Score="4" ViewCount="229" Body="&lt;p&gt;I have different workflows with emacs: for example Python development and LaTeX. When I code some Python I like to have a wider window to have different buffers opened at the same time, plus a repl buffer. However when I write LaTeX I prefer having a smaller window with a single buffer, so that I can see the output in Preview.app&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is the following. Let's say I switch from coding python to writing LaTeX, is there any way I can save the current state of the whole thing (window width, buffer positions, buffers, etc.) so that when I'm done with LaTeX I can go back quickly to my previous emacs environment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="6909" LastEditorUserId="105" LastEditDate="2015-11-16T03:02:20.670" LastActivityDate="2015-11-16T03:02:20.670" Title="Save configuration of buffers, buffer positions and windows for later recall" Tags="|buffers|window|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18113" PostTypeId="1" AcceptedAnswerId="18114" CreationDate="2015-11-16T02:42:10.823" Score="5" ViewCount="1360" Body="&lt;p&gt;I've seen this sort of thing a few times:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapconcat 'identity '(&quot;&quot; &quot;home&quot; &quot;alex &quot; &quot;elisp&quot; &quot;erc&quot;) &quot;/&quot;)&#xA;   =&amp;gt; &quot;/home/alex /elisp/erc&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which means &lt;code&gt;mapconcat&lt;/code&gt;wants a function in the second position, hence just shove it the &quot;identity&quot; function if you don't want anything done to your input list first. But &lt;a href=&quot;http://pages.sachachua.com/.emacs.d/Sacha.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shk-yas/helm-prompt (prompt choices &amp;amp;optional display-fn)&#xA;  &quot;Use helm to select a snippet. Put this into `yas/prompt-functions.'&quot;&#xA;  (interactive)&#xA;  (setq display-fn (or display-fn 'identity))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;has me confused. Likewise &lt;a href=&quot;https://emacs.stackexchange.com/questions/17622/how-can-i-walk-an-org-mode-tree&quot;&gt;this&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-element-map (org-element-parse-buffer) 'headline #'identity)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume it has something to do with the code calling a function, but we don't want to give it one -- other than something reflexive like an identity. Again, the first example is clear, but not so much the next two.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="14920" LastEditDate="2019-04-05T21:27:25.210" LastActivityDate="2019-04-05T21:27:25.210" Title="What is identity doing?" Tags="|functions|" AnswerCount="1" CommentCount="1" ClosedDate="2015-11-17T02:44:35.153" ContentLicense="CC BY-SA 3.0" />
  <row Id="18114" PostTypeId="2" ParentId="18113" CreationDate="2015-11-16T03:46:03.480" Score="10" Body="&lt;p&gt;The first example becomes a little clearer if you look further down the function.  Just a bit past what you quoted we have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar (lambda (x) (funcall display-fn x)) choices)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So a list of &quot;choices&quot; is being made and &lt;code&gt;display-fn&lt;/code&gt; is being applied to each choice, presumably to modify how they get displayed.  A sensible default is that each choice is displayed as itself, which means &lt;code&gt;display-fn&lt;/code&gt; should be &lt;code&gt;identity&lt;/code&gt; a function that just returns its argument.  You can see that &lt;code&gt;display-fn&lt;/code&gt; is an optional argument, but optional arguments default to &lt;code&gt;nil&lt;/code&gt;.  &lt;code&gt;(or display-fn 'identity)&lt;/code&gt; is just a clever way of saying &quot;if &lt;code&gt;display-fn&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; return &lt;code&gt;identity&lt;/code&gt; otherwise return &lt;code&gt;display-fn&lt;/code&gt;&quot;.    It works because &lt;code&gt;or&lt;/code&gt; returns its first non-nil argument.  Writing &lt;code&gt;(if display-fn display-fn 'identity)&lt;/code&gt; would do the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second example is similar &lt;code&gt;mapconcat&lt;/code&gt;.  The third argument is a function that gets applied to every headline in the buffer.  The manual says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;FUN is&#xA;  the function called on the matching element or object.  It has to&#xA;  accept one argument: the element or object itself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Just like &lt;code&gt;mapconcat&lt;/code&gt; we have to give a function to transform the data, even if we don't want to.  The identity function is perfect for this as it doesn't do anything to the data.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-11-16T03:46:03.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18116" PostTypeId="2" ParentId="18107" CreationDate="2015-11-16T06:54:35.493" Score="1" Body="&lt;p&gt;That file is created by &lt;code&gt;package-upload-file&lt;/code&gt;, but unfortunately that function has &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19800&quot; rel=&quot;nofollow&quot;&gt;a bug&lt;/a&gt; in Emacs 24.4.1 that means it does not work in this scenario.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2015-11-16T06:54:35.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18117" PostTypeId="2" ParentId="18098" CreationDate="2015-11-16T07:19:46.353" Score="2" Body="&lt;p&gt;Emacs defers to the external &lt;code&gt;man&lt;/code&gt; command's section choice in the absence of a specific section value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can edit the &lt;code&gt;SECTION&lt;/code&gt; definition in &lt;code&gt;/etc/manpath.config&lt;/code&gt; to modify the default priority order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can override that value with the &lt;code&gt;MANSECT&lt;/code&gt; environment variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you can override all of that by passing a &lt;code&gt;--sections=list&lt;/code&gt; option to the command itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See &lt;code&gt;man man&lt;/code&gt; for details.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the final approach, you can set the &lt;code&gt;Man-switches&lt;/code&gt; variable in Emacs. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq Man-switches &quot;--sections=2,3,1,n,l,8,3posix,3pm,3perl,5,4,9,6,7&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that Emacs re-uses man page buffers where possible, so kill the existing buffers before testing this.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-11-16T07:32:33.937" LastActivityDate="2015-11-16T07:32:33.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18118" PostTypeId="1" AcceptedAnswerId="18123" CreationDate="2015-11-16T09:53:35.087" Score="2" ViewCount="369" Body="&lt;p&gt;&lt;code&gt;line-number-at-pos&lt;/code&gt; works fine when &lt;code&gt;visual-line-mode&lt;/code&gt; is off.&#xA;But I can't find its equivalent for &lt;code&gt;visual-line-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2016-08-22T17:51:59.243" LastActivityDate="2016-08-22T17:51:59.243" Title="How to get visual line-number-at-pos?" Tags="|line-numbers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18119" PostTypeId="2" ParentId="18111" CreationDate="2015-11-16T10:19:42.293" Score="2" Body="&lt;p&gt;A lot of org logic is bound up in large functions (i.e. org-agenda-list), so you probably need to write your own functions with a bunch of duplicated logic.  &lt;code&gt;org-map-entries&lt;/code&gt; might be a useful starting point for you (use the &lt;code&gt;'agenda&lt;/code&gt; scope).  You can work out match patterns (&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/advanced-searching.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/advanced-searching.html&lt;/a&gt;) over scheduled or deadline dates for your counting conditions and simply look at the length of the returned list or do aggregation within your map function using &lt;code&gt;org-get-deadline-time&lt;/code&gt; and other functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest invoking &lt;code&gt;emacs --batch --script ~/.emacs.d/init.el --eval &quot;(prin1 (my-counting-function))&quot;&lt;/code&gt; and examine only stdout.  Replace with your own init location (since it otherwise would not be loaded in batch mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example count of headings scheduled today:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(length (org-map-entries nil &quot;SCHEDULED=\&quot;&amp;lt;today&amp;gt;\&quot;&quot; 'agenda))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2015-11-16T21:04:52.353" LastActivityDate="2015-11-16T21:04:52.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18120" PostTypeId="1" AcceptedAnswerId="18121" CreationDate="2015-11-16T12:06:22.743" Score="1" ViewCount="90" Body="&lt;p&gt;When I enter a new line the cursor always jumps to the column which was the starting column the line before! I would like for the curser to stay in the first column until I hit enter!&lt;/p&gt;&#xA;" OwnerUserId="9378" LastActivityDate="2015-11-16T13:43:02.333" Title="New line should start at first column" Tags="|indentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18121" PostTypeId="2" ParentId="18120" CreationDate="2015-11-16T12:23:48.307" Score="1" Body="&lt;p&gt;Most likely, this is caused by &lt;code&gt;electric-indent&lt;/code&gt;. You can toggle it globally by running &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;&lt;code&gt;electric-indent-mode&lt;/code&gt;&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an init file, you can disable it using &lt;code&gt;(electric-indent-mode -1)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-16T12:23:48.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18122" PostTypeId="1" AcceptedAnswerId="18125" CreationDate="2015-11-16T13:05:00.673" Score="3" ViewCount="2217" Body="&lt;p&gt;The help for &lt;code&gt;custom-set-variables&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The arguments should each be a list of the form:&#xA;&#xA;  (SYMBOL EXP [NOW [REQUEST [COMMENT]]])&#xA;&#xA;This stores EXP (without evaluating it) as the saved value for SYMBOL.&#xA;If NOW is present and non-nil, then also evaluate EXP and set&#xA;the default value for the SYMBOL to the value of EXP.&#xA;&#xA;REQUEST is a list of features we must require in order to&#xA;handle SYMBOL properly.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if &lt;code&gt;NOW&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; then &lt;code&gt;EXP&lt;/code&gt; won't be evaluated immediately, which suggests to me that it should be possible for &lt;code&gt;EXP&lt;/code&gt; to refer to variables or functions provided by features in the &lt;code&gt;REQUEST&lt;/code&gt; list which are not yet loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if my interpretation is wrong, it should be possible to safely use &lt;code&gt;custom-set-variables&lt;/code&gt; to customize variables in features which are not yet loaded.  For example, if I have something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-variables&#xA; '(yas-snippet-dirs&#xA;   ('(&quot;~/.config/yasnippets/rails&quot;)) nil (yasnippet)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I would expect this variable only to be set once &lt;code&gt;yasnippet&lt;/code&gt; is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out that &lt;code&gt;custom-set-variables&lt;/code&gt; tries to load &lt;code&gt;yasnippet&lt;/code&gt; immediately.  This means that the &lt;code&gt;custom-file&lt;/code&gt; containing this directive has to be loaded after all other user init code which takes care of ensuring that &lt;code&gt;yasnippet&lt;/code&gt; is available (e.g. loading it from MELPA or &lt;code&gt;el-get&lt;/code&gt; or via &lt;code&gt;req-package&lt;/code&gt;).  That's all well and good if &lt;code&gt;yasnippet&lt;/code&gt; is available, but what if it &lt;em&gt;isn't&lt;/em&gt; available, or at least not &lt;em&gt;yet&lt;/em&gt; available, due to some deferred or lazy-loading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently this will result in a backtrace ending in something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;no such file or directory&quot; &quot;yasnippet&quot;)&#xA;  require(yasnippet)&#xA;  mapc(require (yasnippet))&#xA;  custom-theme-set-variables(user (yas-snippet-dirs (quote (&quot;~/.config/yasnippets/rails&quot;)) nil (yasnippet)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will then break the rest of the user's initialisation, which is really bad.  OTOH, if I just remove the &lt;code&gt;REQUEST&lt;/code&gt; argument in order to allow deferred loading, then presumably the value of specifying that argument is lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what's the correct way to safely customize variables for packages which are lazy-loaded or loaded on demand?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(BTW in case it's not obvious, I'm looking for a solution which doesn't bypass &lt;code&gt;custom.el&lt;/code&gt;, because then I lose the ability to customize via &lt;code&gt;custom.el&lt;/code&gt;'s nice UI.  Otherwise I would simply do &lt;code&gt;setq&lt;/code&gt; inside the &lt;code&gt;:config&lt;/code&gt; section of my &lt;code&gt;use-package&lt;/code&gt; declaration ...  Doing &lt;code&gt;custom-set-variables&lt;/code&gt; in the same place doesn't work either, because updating the value via the &lt;code&gt;custom.el&lt;/code&gt; UI would still update the file pointed to by &lt;code&gt;custom-file&lt;/code&gt; rather than this correct location.)&lt;/p&gt;&#xA;" OwnerUserId="2018" LastEditorUserId="2018" LastEditDate="2015-11-17T10:28:31.260" LastActivityDate="2015-11-17T13:32:26.873" Title="how to use custom-set-variables safely?" Tags="|custom|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18123" PostTypeId="2" ParentId="18118" CreationDate="2015-11-16T13:40:03.327" Score="4" Body="&lt;p&gt;The &quot;visual line number, counting from point-min&quot; depends on the window width, font choice, font size, etc... so a given buffer's position can have several different &quot;visual line numbers&quot; at the same time if it's displayed in different windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Emacs does not really try to provide this info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OTOH you can easily get the &quot;visual line number, counting from windows-start&quot;, using &lt;code&gt;posn-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, and there's apparently &lt;code&gt;count-screen-lines&lt;/code&gt; (as well as &lt;code&gt;compute-motion&lt;/code&gt;) which should be able to provide the info you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun visual-line-number-at-pos ()&#xA;  (count-screen-lines&#xA;   (point-min)&#xA;   (save-excursion (beginning-of-visual-line) (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="2094" LastEditDate="2015-11-16T14:24:07.867" LastActivityDate="2015-11-16T14:24:07.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18124" PostTypeId="2" ParentId="18120" CreationDate="2015-11-16T13:43:02.333" Score="0" Body="&lt;p&gt;Additionally to LindyDancer's answer, this behavior depends on the indentation rules used by the major mode.  So if you're writing text, you might like &lt;code&gt;paragraph-indent-text-mode&lt;/code&gt; or &lt;code&gt;paragraph-indent-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-11-16T13:43:02.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18125" PostTypeId="2" ParentId="18122" CreationDate="2015-11-16T13:49:55.083" Score="6" Body="&lt;p&gt;When NOW is non-nil, what happens is that EXP is evaluated (and used to set the corresponding variable) only when the variable's &lt;code&gt;defcustom&lt;/code&gt; is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The REQUEST part will always be used right away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the var's defcustom has already been evaluated (or is evaluated while handling the REQUEST), then the value of NOW will have no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why not just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; '(yas-snippet-dirs '(&quot;~/.config/yasnippets/rails&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will set &lt;code&gt;yas-snippet-dirs&lt;/code&gt; when/if yasnipet is loaded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The REQUEST argument is very rarely needed. The typical case where it was needed was for minor modes, where enabling foo-mode should load the corresponding file (since nothing else would load it otherwise), and this is now handled differently: those minor mode defcustom are expected to be marked as &lt;code&gt;;;;###autoload&lt;/code&gt;, so Emacs knows to autoload the file without needing a REQUEST.  The advantage is also that the actul name of the file that defines this variable is not hard-coded in the user's &lt;code&gt;~/.emacs&lt;/code&gt;, so it won't fail if the function is moved or its file is renamed.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2015-11-17T13:32:26.873" LastActivityDate="2015-11-17T13:32:26.873" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18127" PostTypeId="2" ParentId="17337" CreationDate="2015-11-16T15:32:59.920" Score="1" Body="&lt;p&gt;This was indeed a bug. After upgrading to the Org package of 20151116, the calendar works OK again. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2015-11-16T15:32:59.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18128" PostTypeId="1" AcceptedAnswerId="18130" CreationDate="2015-11-16T16:27:31.753" Score="5" ViewCount="1457" Body="&lt;p&gt;There is something that blocks my workflow quite often and I'm quite sure it's easy to solve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I sometimes copy file paths (e.g. &lt;code&gt;/tmp/bar/foo.gz&lt;/code&gt;) from the command line into my host systems clipboard. Then I want to open them inside emacs and edit them. My system clipboard is linked to emacs clipboard so this is no problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I use &lt;code&gt;(ido-find-file)&lt;/code&gt; bound to &lt;code&gt;C-x C-f&lt;/code&gt; which brings up the minibuffer with the path of the current file e.g. &lt;code&gt;/home/cb0/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Option 1:&lt;/em&gt; If I now yank into the minibuffer it will always append to the current selection, resulting in something non-existing /home/cb0//tmp/bar/foo.gz&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Option 2&lt;/em&gt;: Pressing &lt;code&gt;M-DEL&lt;/code&gt; multiple times will delete the path in the minibuffer, leaving a single &lt;code&gt;/&lt;/code&gt; at the beginning. Now yanking will also result in a faulty path ``//tmp/bar/foo.gz`.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Option 3&lt;/em&gt;: Pressing &lt;code&gt;C-a&lt;/code&gt; (go to line start), &lt;code&gt;C-k&lt;/code&gt; (kill rest of line) and yank again also does not work in minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are not applicable for me:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;use &lt;code&gt;emacsclient&lt;/code&gt; straight from command line to edit this file&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;use a shell script to tell emacs to open the file whose filepath is in current clipboard.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;using &lt;code&gt;find-file&lt;/code&gt; or &lt;code&gt;helm-mode-find-file&lt;/code&gt; all left me with the same result&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the easiest way to have a filepath in &quot;system&quot; or &quot;emacs&quot; clipboard, and then head over to emacs and start editing just that file ?&lt;/p&gt;&#xA;" OwnerUserId="2315" LastActivityDate="2015-11-16T17:11:11.573" Title="Quickly open file by full path in clipboard" Tags="|find-file|yank|ido-find-file|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18129" PostTypeId="2" ParentId="18128" CreationDate="2015-11-16T16:40:42.390" Score="2" Body="&lt;p&gt;Normally, if you open /home/cb0//tmp/bar/foo.gz with find-file emacs will open /tmp/bar/foo.gz because /home/cb0/ will be ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, If you want to delete before yanking you can use this function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun backward-delete-line ()&#xA;     (interactive)&#xA;     (delete-region&#xA;      (point)&#xA;      (save-excursion (beginning-of-line 1) (point))))&#xA;   (global-set-key (kbd &quot;S-&amp;lt;backspace&amp;gt;&quot;) 'backward-delete-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-11-16T16:40:42.390" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18130" PostTypeId="2" ParentId="18128" CreationDate="2015-11-16T16:56:37.260" Score="6" Body="&lt;p&gt;&lt;kbd&gt;C-x C-f&lt;/kbd&gt; x 2 &lt;kbd&gt;C-a&lt;/kbd&gt;&lt;kbd&gt;C-y&lt;/kbd&gt;&lt;kbd&gt;C-k&lt;/kbd&gt;&lt;kbd&gt;enter&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;kbd&gt;C-x C-f&lt;/kbd&gt; while inside &lt;code&gt;ido-find-file&lt;/code&gt; will take you back into the normal &lt;code&gt;find-file&lt;/code&gt; in which you can easily clear out all the input and yank your path into.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-11-16T16:56:37.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18131" PostTypeId="2" ParentId="18128" CreationDate="2015-11-16T17:11:11.573" Score="2" Body="&lt;p&gt;Back when I was using Ido, I was relying on this code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(define-key ido-file-dir-completion-map (kbd &quot;C-y&quot;) 'ido-yank)&#xA;(defun ido-yank ()&#xA;  &quot;Forward to `yank'.&quot;&#xA;  (interactive)&#xA;  (if (file-exists-p (current-kill 0))&#xA;      (ido-fallback-command)&#xA;    (yank)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setup, you have to press &lt;kbd&gt;C-y C-y&lt;/kbd&gt;: the first one&#xA;gets you to regular &lt;code&gt;find-file&lt;/code&gt;, and the second one yanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I'm using &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow&quot;&gt;Ivy&lt;/a&gt;, where&#xA;&lt;kbd&gt;C-y&lt;/kbd&gt; simply works with no extra setup. Well, there's some&#xA;minor setup:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-f&quot;) 'counsel-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While &lt;code&gt;find-file&lt;/code&gt; works similar to &lt;code&gt;ido-find-file&lt;/code&gt; when &lt;code&gt;ivy-mode&lt;/code&gt; is&#xA;on, &lt;code&gt;counsel-find-file&lt;/code&gt; additionally allows you to cycle files with&#xA;&lt;kbd&gt;C-M-n&lt;/kbd&gt;/&lt;kbd&gt;C-M-p&lt;/kbd&gt;. And it also works with&#xA;&lt;code&gt;ivy-resume&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-16T17:11:11.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18133" PostTypeId="1" CreationDate="2015-11-16T18:53:19.580" Score="1" ViewCount="68" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/Schnouki/dotfiles/blob/1e8b6cfa7cd98e28b5ad38f2988f4c0b5db3c178/emacs/init-20-tex.el&quot; rel=&quot;nofollow&quot;&gt;this configuration file&lt;/a&gt;, I've discovered the &lt;code&gt;#'&lt;/code&gt; operator, which I did not know, used as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm wondering what is the difference with writing just&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Anonymous-Functions.html&quot; rel=&quot;nofollow&quot;&gt;only documentation I could find about this &lt;code&gt;#'&lt;/code&gt; operator&lt;/a&gt; hints that it may have some effect when the code is byte-compiled, but I don't understand how.  Is there any difference in this case?  If yes, how can I observe it?&lt;/p&gt;&#xA;" OwnerUserId="10151" LastActivityDate="2015-11-16T18:53:19.580" Title="What is the difference between #'fun and 'fun?" Tags="|elisp|" AnswerCount="0" CommentCount="2" ClosedDate="2015-11-17T00:08:55.187" ContentLicense="CC BY-SA 3.0" />
  <row Id="18135" PostTypeId="1" AcceptedAnswerId="18193" CreationDate="2015-11-16T20:58:38.177" Score="8" ViewCount="1041" Body="&lt;p&gt;It's possible to programmatically update an org table inside a babel source code block like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: mytable&#xA;| 0 | 0 | 0 |&#xA;| 0 | 0 | 0 |&#xA;&#xA;#+begin_src emacs-lisp :var table=mytable&#xA;  (append table '((1 2 3)))&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| 0 | 0 | 0 |&#xA;| 0 | 0 | 0 |&#xA;| 1 | 2 | 3 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to update the original named table and discard the RESULTS output.  In the case of this code it would keep appending a row to the table each time the source block is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen org samples that name the babel source the same as the source/target table (that presumably will do this) (&lt;a href=&quot;https://eschulte.github.io/org-scraps/scraps/2011-08-19-replacing-a-table.html&quot; rel=&quot;noreferrer&quot;&gt;https://eschulte.github.io/org-scraps/scraps/2011-08-19-replacing-a-table.html&lt;/a&gt;), but I get an &lt;code&gt;org-get-property-block: Variable binding depth exceeds max-specpdl-size&lt;/code&gt; error whenever the names collide.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2015-11-21T08:48:42.907" Title="How to programmatically update a named org-table in-situ" Tags="|org-mode|org-babel|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18136" PostTypeId="1" AcceptedAnswerId="18149" CreationDate="2015-11-16T21:40:36.730" Score="1" ViewCount="170" Body="&lt;p&gt;I use a template engine for a lot of files in my project.  The specific one is irrelevant -- let's say all my template files end with &lt;code&gt;.template&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I've got many different kinds of templated files, like &lt;code&gt;foo.txt.template&lt;/code&gt;, &lt;code&gt;bar.html.template&lt;/code&gt;, &lt;code&gt;baz.py.template&lt;/code&gt;, and &lt;code&gt;qux.json.template&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, Emacs doesn't know about my template engine, so they all open in fundamental-mode.  I could manually add each templated filetype to my .emacs file (&lt;code&gt;.txt.template&lt;/code&gt;, &lt;code&gt;.html.template&lt;/code&gt;, etc), but that's tedious, and I'll have to update it whenever anybody finds a new filetype that's useful to template.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to tell Emacs' major-mode-selection functionality that &lt;code&gt;.template&lt;/code&gt; is special, and that any file that looks like &lt;code&gt;foo.ext.template&lt;/code&gt; should be opened as if it were called &lt;code&gt;foo.ext&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10174" LastActivityDate="2015-11-17T04:39:51.647" Title="Recognize template filename extension?" Tags="|major-mode|files|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18137" PostTypeId="1" AcceptedAnswerId="18150" CreationDate="2015-11-16T21:42:49.877" Score="1" ViewCount="768" Body="&lt;p&gt;In Emacs, when I need to start a python interpreter, I have to run &lt;code&gt;(python-shell-switch-to-shell)&lt;/code&gt; , but then I always have to confirm two things: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Confirm the &lt;code&gt;python-shell-interpreter-args&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Confirm to make a dedicated process (y or n), it is really tedious to confirm them every time i need to start a python shell, is there a way to provide the default options and skip these steps?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also, I found every time I have the python shell restarted, I have to manually run &lt;code&gt;python-shell-send-setup-code&lt;/code&gt; again to make the shell works properly. it seems this setup function only will be called when you start a new python shell, 'cus it is a hooked function for the inferior python mode, if you don't leave the python shell buffer, and restart the python shell within the same buffer, this setup function won't be called. Is there a way to solve this? e.g., by override the original &lt;code&gt;python-shell-send-setup-code&lt;/code&gt; or &lt;code&gt;python-shell-switch-to-shell&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10175" LastEditorUserId="105" LastEditDate="2016-03-14T04:42:56.197" LastActivityDate="2017-05-10T19:06:02.930" Title="Switch to python shell without confirmation" Tags="|python|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18138" PostTypeId="1" CreationDate="2015-11-16T21:49:43.407" Score="0" ViewCount="48" Body="&lt;p&gt;Every time I start emacs and visit my &lt;em&gt;first&lt;/em&gt; reStructuredText file, I discover that I once again have the default colors for the section headings, which are illegible to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have the customizer open in another window while I open the &lt;em&gt;first&lt;/em&gt; reStructuredText file, I can see the colors revert to their defaults right before my eyes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, if I open my &lt;code&gt;~/.emacs&lt;/code&gt; file and re-execute this statement with &lt;code&gt;C-x C-e&lt;/code&gt;, the colors right themselves:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA;  ;; custom-set-faces was added by Custom.&#xA;  ;; If you edit it by hand, you could mess it up, so be careful.&#xA;  ;; Your init file should contain only one such instance.&#xA;  ;; If there is more than one, they won't work right.&#xA; '(rst-level-1-face ((t (:background &quot;blue1&quot;))) t)&#xA; '(rst-level-2-face ((t (:background &quot;blue2&quot;))) t)&#xA; '(rst-level-3-face ((t (:background &quot;blue3&quot;))) t)&#xA; '(rst-level-4-face ((t (:background &quot;blue4&quot;))) t)&#xA; '(rst-level-5-face ((t (:background &quot;navy&quot;))) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would I hunt down the thing that is causing my colors to change?&lt;/p&gt;&#xA;" OwnerUserId="3950" LastEditorUserId="3950" LastEditDate="2015-11-17T18:43:48.667" LastActivityDate="2015-11-17T18:43:48.667" Title="Why does visiting a file cause my to lose me custom faces?" Tags="|init-file|colors|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18139" PostTypeId="5" CreationDate="2015-11-16T22:16:48.450" Score="0" Body="&lt;p&gt;Paredit keeps parentheses balanced while editing Lisp source code.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2015-11-17T02:44:53.157" LastActivityDate="2015-11-17T02:44:53.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18140" PostTypeId="4" CreationDate="2015-11-16T22:16:48.450" Score="0" Body="Paredit is an emacs minor mode for controlled editing of s-expressions." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2015-11-17T03:05:59.360" LastActivityDate="2015-11-17T03:05:59.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18141" PostTypeId="5" CreationDate="2015-11-16T22:19:33.447" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-11-16T22:19:33.447" LastActivityDate="2015-11-16T22:19:33.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18142" PostTypeId="4" CreationDate="2015-11-16T22:19:33.447" Score="0" Body="The fringe is a tiny margin to the left or right edge, or both, of a window on a graphical display. Glyphs can be displayed there." OwnerUserId="45" LastEditorUserId="105" LastEditDate="2015-11-17T00:00:48.713" LastActivityDate="2015-11-17T00:00:48.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18143" PostTypeId="2" ParentId="18135" CreationDate="2015-11-17T00:09:38.543" Score="1" Body="&lt;p&gt;Having taken a look through the source, I'm not sure why that example would be expected to work. Perhaps org-babel has simply changed in the last four years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your test file works exactly as expected. Org-babel sees the table reference, calls into org-table to copy the table values from the buffer into a list structure, then passes that in as the argument. Your call to append copies the list, tacks on a new row and returns it. Org-babel formats the returned list structure as an org table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you'll probably have to do is pass in a string containing the name of the table (&lt;code&gt;var=&quot;mytable&quot;&lt;/code&gt;), find that named item (&lt;code&gt;org-babel-named-data-regexp-for-name&lt;/code&gt;, I think?), narrow to it, double-check that it's a table and not something else (&lt;code&gt;org-at-table-p&lt;/code&gt;), append the new row to it and widen again.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-17T00:09:38.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18144" PostTypeId="1" AcceptedAnswerId="18146" CreationDate="2015-11-17T01:22:32.773" Score="14" ViewCount="4346" Body="&lt;p&gt;I'm trying unbind  &lt;code&gt;org-cycle-agenda-files&lt;/code&gt; which is set by default to  &lt;code&gt;C-'&lt;/code&gt; and &lt;code&gt;C-,&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My weapon of choice to do so is &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;use-package&lt;/a&gt; package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot; rel=&quot;noreferrer&quot;&gt; github.com/use-package/bind-key.el&#xA;&lt;/a&gt; page I have found following lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; To unbind a key within a keymap (for example, to stop your favorite major&#xA;;; mode from changing a binding that you don't want to override everywhere),&#xA;;; use `unbind-key':&#xA;;;&#xA;;;   (unbind-key &quot;c-c x&quot; some-other-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This resulted in me unsuccessfully trying following variations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unbind-key &quot;C-'&quot; )&#xA;(unbind-key &quot;C-,&quot; )&#xA;(unbind-key &quot;C-'&quot; (org-cycle-agenda-files))&#xA;(unbind-key &quot;C-,&quot; (org-cycle-agenda-files))&#xA;(bind-keys :map org-mode-map&#xA;       :unbind &quot;C-'&quot;)&#xA;(unbind-key &quot;C-'&quot; org-cycle-agenda-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that fail I triyed some &quot;traditional&quot; solution to the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Information found in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rebinding.html&quot; rel=&quot;noreferrer&quot;&gt;gnu.org manual&lt;/a&gt;, and some &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Rebinding.html&quot; rel=&quot;noreferrer&quot;&gt;emacs.stackexchange answers&lt;/a&gt; resulted in me producing following useless havoc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key (org-cycle-agenda-files) key nil)&#xA;(define-key (current-global-map) &quot;C-'&quot; nil)&#xA;(local-unset-key &quot;C-'&quot;)&#xA;(global-unset-key &quot;C-'&quot;)&#xA;(with-eval-after-load org-mode&#xA;  (unbind-key &quot;C-'&quot; org-mode-map)&#xA;  (unbind-key &quot;C-,&quot; org-mode-map))&#xA;(global-set-key (kbd &quot;C-'&quot;) 'nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yep.... None these variations vorks. :D &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to find &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;use-package&lt;/a&gt; based solution, since I'm already using some of it's awesome capabilities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any kind of suggestion is welcome.&lt;/p&gt;&#xA;" OwnerUserId="6527" LastActivityDate="2020-06-24T08:42:47.620" Title="Unbinding key using use-package" Tags="|key-bindings|use-package|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18145" PostTypeId="2" ParentId="9853" CreationDate="2015-11-17T01:32:53.257" Score="0" Body="&lt;p&gt;Using the link filter on org export, this inserts the linked files contents (for .c files) as a src block.  At the moment, it only seems to work when exporting to text.  If anyone knows how to fix that, please let me know.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq src-block-string&#xA;&quot;#+begin_src&#xA;%c&#xA;#+end_src&quot;)&#xA;(defun org-export-link-to-block (text backend info)&#xA;  &quot;Translate code files int src blocks.&quot;&#xA;  (when (string-match &quot;\\[file:\\(.+\\.c\\)\\]&quot; text)&#xA;    (let* ((file (match-string 1 text))&#xA;            (buffer (find-file-noselect file)))&#xA;       (set-buffer buffer)&#xA;       (format-spec src-block-string&#xA;                    (format-spec-make&#xA;                     ?c (buffer-string)))&#xA;       )))&#xA;(add-to-list 'org-export-filter-link-functions&#xA;             'org-export-link-to-block)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I started creating a custom link type as well, but this seems like a much simpler solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;This implements it as a filter before any changes are made, which allows it in more modes, or even to pre-process a file. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq src-block-string&#xA;      &quot;&#xA;#+begin_src %m&#xA;%c&#xA;#+end_src&#xA;&quot;)&#xA;(setq link-to-src-extensions '(&quot;h&quot; &quot;hpp&quot; &quot;c&quot; &quot;cc&quot; &quot;py&quot;))&#xA;(defun org-links-to-src-block (backend)&#xA;  &quot;Translate code files int src blocks.&quot;&#xA;  (let ((pos 0)&#xA;        (prev-buffer (current-buffer))&#xA;        (extensions (concat &quot;\\[\\[file:\\(.+\\.\\(&quot;&#xA;                            (mapconcat 'identity link-to-src-extensions &quot;\\|&quot;)&#xA;                            &quot;\\)\\)\\]\\]&quot;)))&#xA;    (message extensions)&#xA;    (while (string-match extensions (buffer-string) pos)&#xA;      (setq pos (match-end 0))&#xA;      (let* ( (start (match-beginning 0))&#xA;              (end (match-end 0))&#xA;              (mode (match-string 2 (buffer-string)))&#xA;              (file (match-string 1 (buffer-string)))&#xA;             (buffer (find-file-noselect file)))&#xA;        (delete-region start (+ end 1 ))&#xA;        (set-buffer buffer)&#xA;        (let ((block (format-spec src-block-string&#xA;                     (format-spec-make&#xA;                      ?c (buffer-string)&#xA;                      ?m mode))))&#xA;          (set-buffer prev-buffer)&#xA;          (goto-char start)&#xA;          (insert block)&#xA;          )))))&#xA;&#xA;(add-to-list 'org-export-before-parsing-hook 'org-links-to-src-block)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="2823" LastEditDate="2015-11-30T04:59:28.243" LastActivityDate="2015-11-30T04:59:28.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18146" PostTypeId="2" ParentId="18144" CreationDate="2015-11-17T02:05:34.300" Score="17" Body="&lt;p&gt;If you &lt;kbd&gt;C-h f&lt;/kbd&gt; and enter &lt;code&gt;unbind-key&lt;/code&gt;, the help says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;unbind-key is an autoloaded Lisp macro in `bind-key.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(unbind-key KEY-NAME &amp;amp;optional KEYMAP)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Not documented.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The second argument to &lt;code&gt;unbind-key&lt;/code&gt; is a key map -- for example &lt;code&gt;org-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'bind-key)&#xA;(unbind-key &quot;C-,&quot; org-mode-map)&#xA;(unbind-key &quot;C-'&quot; org-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A good place to put this would be the &lt;code&gt;:config&lt;/code&gt; section of a &lt;code&gt;use-package&lt;/code&gt; form.&lt;/p&gt;&#xA;" OwnerUserId="849" LastActivityDate="2015-11-17T02:05:34.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18147" PostTypeId="2" ParentId="18144" CreationDate="2015-11-17T02:08:19.610" Score="5" Body="&lt;p&gt;Yeah the unbinding does not look elegant, but that's the main approach according to this &lt;a href=&quot;https://stackoverflow.com/a/7549357/4780877&quot;&gt;answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for use-package, I have been using unbind under :init directive like so: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:init&#xA;(unbind-key &quot;C-'&quot; org-mode-map)&#xA;(unbind-key &quot;C-,&quot; org-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-11-17T02:08:19.610" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18148" PostTypeId="2" ParentId="18136" CreationDate="2015-11-17T04:30:31.410" Score="1" Body="&lt;p&gt;The normal procedure for specifying file extensions works here,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.ext.template&quot; . ext-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just add a line like this for each mode you're interested in.  To speed things up you can use &lt;code&gt;C-h v&lt;/code&gt; to find the current value of &lt;code&gt;auto-mode-alist&lt;/code&gt; and copy the entries for extensions you want.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-11-17T04:30:31.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18149" PostTypeId="2" ParentId="18136" CreationDate="2015-11-17T04:34:28.217" Score="5" Body="&lt;p&gt;&lt;code&gt;auto-mode-alist&lt;/code&gt; is the variable that determines what major mode a file is opened in. Part of its documentation is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Alist of filename patterns vs corresponding major mode functions.&#xA;Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).&#xA;&#xA;...&#xA;&#xA;If the element has the form (REGEXP FUNCTION NON-NIL), then after&#xA;calling FUNCTION (if it’s not nil), we delete the suffix that matched&#xA;REGEXP and search the list again for another match.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So this will make Emacs open, for example, foo.html.template in html-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(&quot;\\.template\\'&quot; nil t) auto-mode-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2015-11-17T04:39:51.647" LastActivityDate="2015-11-17T04:39:51.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18150" PostTypeId="2" ParentId="18137" CreationDate="2015-11-17T06:56:38.503" Score="1" Body="&lt;p&gt;I  would recommend to use &lt;a href=&quot;http://elpy.readthedocs.org/en/latest/index.html&quot; rel=&quot;nofollow&quot;&gt;elpy&lt;/a&gt; as it comes with lot of such utilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;elpy-shell-switch-to-shell&lt;/code&gt; function which starts a python process and switches to shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you dont want to install package for that, you can add this to your config.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/python-shell-switch-to-shell ()&#xA;  &quot;Switch to inferior Python process buffer.&quot;&#xA;  (interactive)&#xA;  (pop-to-buffer (process-buffer (elpy-shell-get-or-create-process))))&#xA;&#xA;(defun my/python-shell-get-or-create-process ()&#xA;  &quot;Get or create an inferior Python process for current buffer and return it.&quot;&#xA;  (let* ((bufname (format &quot;*%s*&quot; (python-shell-get-process-name nil)))&#xA;         (proc (get-buffer-process bufname)))&#xA;    (if proc&#xA;        proc&#xA;      (run-python (python-shell-parse-command))&#xA;      (get-buffer-process bufname))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and  then you can run &lt;code&gt;M-x my/python-shell-switch-to-shell&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-11-17T06:56:38.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18151" PostTypeId="1" AcceptedAnswerId="18152" CreationDate="2015-11-17T07:48:43.787" Score="8" ViewCount="605" Body="&lt;p&gt;If I select image files in a Dired buffer and do &lt;kbd&gt;C-t C-t&lt;/kbd&gt;, a nice little thumbnail appears. But if I try this with PDF files, nothing happens. I would expect to see a thumbnail of the first page of the PDF. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this normal? Is there an easy way to get the behavior I want? (I am running Emacs 24.3.1 on Ubuntu 14.04 if that matters.) &lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="253" LastEditDate="2017-04-09T23:19:56.420" LastActivityDate="2017-04-11T04:06:32.557" Title="Thumbnail previews of PDF files" Tags="|dired|pdf|image-dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18152" PostTypeId="2" ParentId="18151" CreationDate="2015-11-17T08:42:12.600" Score="3" Body="&lt;p&gt;This is a feature of &lt;code&gt;dired+&lt;/code&gt; as far as I can tell.  &lt;code&gt;C-t C-t&lt;/code&gt; is bound to &lt;code&gt;image-dired-dired-toggle-marked-thumbs&lt;/code&gt;, which first checks whether the file is an image or not with &lt;code&gt;diredp-get-image-filename&lt;/code&gt;.  This procedure runs &lt;code&gt;image-file-name-regexp&lt;/code&gt; to generate a regular expression matching all image file names.  Then it creates thumbnails with Imagemagick's &lt;code&gt;convert&lt;/code&gt; (defined in &lt;code&gt;image-dired-cmd-create-thumbnail-program&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to modify the behaviour of &lt;code&gt;image-file-name-regexp&lt;/code&gt; by adding a regular expression for PDF files to the variable &lt;code&gt;image-file-name-regexps&lt;/code&gt;.  &lt;code&gt;convert&lt;/code&gt; can convert PDF files to images, so you should get a thumbnail.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastActivityDate="2015-11-17T08:42:12.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18153" PostTypeId="1" CreationDate="2015-11-17T09:02:22.143" Score="3" ViewCount="123" Body="&lt;p&gt;Is it possible to highlight the changed line in the resulting pdf using auctex and pdf-tools. I have this feature enabled in Skim with the following lines in my setup.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (add-hook 'LaTeX-mode-hook (lambda ()&#xA;                             (push&#xA;                              '(&quot;pdflatex&quot; &quot;pdflatex -synctex=1 %s&quot; TeX-run-TeX nil t&#xA;                                :help &quot;Run pdflatex with SyncTex on file&quot;)&#xA;                              TeX-command-list)))&#xA;(add-hook 'TeX-mode-hook '(lambda () (setq TeX-command-default &quot;pdflatex&quot;)))&#xA;(setq TeX-view-program-list&#xA;      '((&quot;PDF Viewer&quot; &quot;/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6732" LastActivityDate="2015-11-17T09:02:22.143" Title="Highlighting the changed line in the source file in the resulting pdf using auctex and pdf-tools?" Tags="|init-file|latex|auctex|pdf|highlighting|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18154" PostTypeId="1" CreationDate="2015-11-17T09:15:57.063" Score="8" ViewCount="555" Body="&lt;p&gt;I'm using org-mode's clocking functions to track the hours I spend on projects. Since my main org file is rather large and I scroll through it a lot, it would be great to have a visual cue of the task that's currently clocked in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally some marker (e.g. a red arrow) in the fringe would be nice, especially if it 'moves' to the parent header if the subheaders are collapsed. Alternatively a highlighted line would be an options (somewhat similar to &lt;code&gt;hl-line-mode&lt;/code&gt;, but fixed to the current task (or its parent)). Unfortunately my (e)lisp skills are almost non existent, so I don't have much of a clue where to start. Going through the Emacs manual it looks like &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlay-Arrow.html#Overlay-Arrow&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;overlay-arrow-string&lt;/code&gt; and &lt;code&gt;overlay-arrow-position&lt;/code&gt;&lt;/a&gt; are the variables I could use, and &lt;code&gt;org-clock-in-hook&lt;/code&gt; and &lt;code&gt;org-clock-out-hook&lt;/code&gt; from &lt;code&gt;org-clock.el&lt;/code&gt; look like places where I could (un)set these variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know you can easily jump to the current task with &lt;code&gt;C-c C-x C-j&lt;/code&gt;, but a visual cue would be much appreciated. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2015-11-17T09:15:57.063" Title="How to indicate the currently clocked-in task?" Tags="|org-mode|highlighting|org-clock|fringe|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18155" PostTypeId="1" AcceptedAnswerId="18166" CreationDate="2015-11-17T10:16:57.197" Score="8" ViewCount="1195" Body="&lt;p&gt;Is there a mode out there that has syntax higlighting (and possibly more, but this is the least I want) for a more recent ecmascript? I'm especially interested in one that has support for template strings and generator functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should render properly: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;co(function*(){&#xA;   var a = yield request(`some.domain/${variable}`)&#xA;   return a;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5336" LastActivityDate="2015-11-17T17:34:57.277" Title="Which mode to use for ECMAScript 6?" Tags="|major-mode|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18156" PostTypeId="1" AcceptedAnswerId="18157" CreationDate="2015-11-17T11:09:08.370" Score="0" ViewCount="169" Body="&lt;p&gt;I use flycheck for Python with pylint, pep8 and other built-in checkers, but also I will use pep257 to highlight doc-comments formatting errors. I read official documentation, but not understand, who I must write in my .emacs for connecting pep257 to flycheck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to add pep257 to flycheck without opening issue on GutHub?&lt;/p&gt;&#xA;" OwnerUserId="6919" LastActivityDate="2015-11-17T12:33:39.927" Title="How to add pep257 to flycheck?" Tags="|flycheck|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18157" PostTypeId="2" ParentId="18156" CreationDate="2015-11-17T12:18:47.343" Score="1" Body="&lt;p&gt;I think that you could just &lt;code&gt;pip install flake8-pep257&lt;/code&gt; to automatically include PEP 257 warnings in &lt;code&gt;flake8&lt;/code&gt;. You'd have to use &lt;code&gt;flake8&lt;/code&gt; as syntax checker instead of &lt;code&gt;pylint&lt;/code&gt; then, obviously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, though, that there's &lt;a href=&quot;https://github.com/Robpol86/flake8-pep257/issues/2&quot; rel=&quot;nofollow&quot;&gt;a bug in flake8-pep257&lt;/a&gt; which prevents it from reading from standard input.  This prevents pep257 from working with Flycheck currently.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2015-11-17T12:33:39.927" LastActivityDate="2015-11-17T12:33:39.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18158" PostTypeId="1" AcceptedAnswerId="18160" CreationDate="2015-11-17T12:31:07.383" Score="5" ViewCount="313" Body="&lt;p&gt;I have multiple short videos in a directory and I have to play all of them in a queue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using a file manager(Nautilus), I can select videos and then right click, select vlc and all videos will be played in a queue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QwKXa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QwKXa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In dired, i can place point on a video and press enter which plays that video.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried selecting/marking multiple videos and press enter but i cant get  all videos to play. How to do achieve that in emacs?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-11-17T14:16:26.200" Title="How play multiple videos from dired?" Tags="|dired|openwith|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18159" PostTypeId="2" ParentId="18158" CreationDate="2015-11-17T13:44:25.583" Score="3" Body="&lt;p&gt;I've described my approach to this &lt;a href=&quot;http://oremacs.com/2015/01/04/dired-nohup/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&#xA;Here's the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired-aux)&#xA;(defvar dired-filelist-cmd&#xA;  '((&quot;vlc&quot; &quot;-L&quot;)))&#xA;(defun dired-start-process (cmd &amp;amp;optional file-list)&#xA;  (interactive&#xA;   (let ((files (dired-get-marked-files&#xA;                 t current-prefix-arg)))&#xA;     (list&#xA;      (dired-read-shell-command &quot;&amp;amp; on %s: &quot;&#xA;                                current-prefix-arg files)&#xA;      files)))&#xA;  (let (list-switch)&#xA;    (start-process&#xA;     cmd nil shell-file-name&#xA;     shell-command-switch&#xA;     (format&#xA;      &quot;nohup 1&amp;gt;/dev/null 2&amp;gt;/dev/null %s \&quot;%s\&quot;&quot;&#xA;      (if (and (&amp;gt; (length file-list) 1)&#xA;               (setq list-switch&#xA;                     (cadr (assoc cmd dired-filelist-cmd))))&#xA;          (format &quot;%s %s&quot; cmd list-switch)&#xA;        cmd)&#xA;      (mapconcat #'expand-file-name file-list &quot;\&quot; \&quot;&quot;)))))&#xA;(define-key dired-mode-map &quot;r&quot; 'dired-start-process)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Mark the video files and press &lt;kbd&gt;r&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-17T13:44:25.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18160" PostTypeId="2" ParentId="18158" CreationDate="2015-11-17T13:58:43.103" Score="8" Body="&lt;p&gt;Mark the videos with &lt;kbd&gt;m&lt;/kbd&gt; and then use &lt;kbd&gt;!&lt;/kbd&gt; to run on shell command on each of them. You can specify your operating system's equivilent of an open-anything command such as &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;xdg-open&lt;/code&gt;, &lt;code&gt;gnome-open&lt;/code&gt; etc or use a specific one like &lt;code&gt;vlc&lt;/code&gt; in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will open all the files by running the shell command on each of them. However if you want to pass all the files to one shell command like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;open file.avi file2.avi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;open file1.avi&#xA;open file2.avi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can specify your shell command like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;open *&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the docs of &lt;code&gt;dired-do-shell-command&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If there is a ‘*’ in COMMAND, surrounded by whitespace, this runs&#xA;  COMMAND just once with the entire file list substituted there.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can read more about this &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Commands-in-Dired.html&quot;&gt;here&lt;/a&gt; or by reading the docs for &lt;code&gt;dired-do-shell-command&lt;/code&gt; inside Emacs.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-11-17T14:16:26.200" LastActivityDate="2015-11-17T14:16:26.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18161" PostTypeId="1" AcceptedAnswerId="18165" CreationDate="2015-11-17T14:41:38.367" Score="3" ViewCount="5465" Body="&lt;p&gt;I have file which has multiple newlines. I want to receive single newline in their place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to do it in vim(found in google query):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:%s/\n\n\n*/\r\r/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I do the same in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;this is file&#xA;with lines&#xA;&#xA;&#xA;and&#xA;&#xA;&#xA;&#xA;empty lines &#xA;&#xA;badly&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;this is file&#xA;with lines&#xA;&#xA;and&#xA;&#xA;empty lines &#xA;&#xA;badly&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="405" LastActivityDate="2021-07-13T16:56:57.683" Title="How to replace multiple newlines for single one in whole file?" Tags="|regular-expressions|text-editing|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18162" PostTypeId="2" ParentId="18161" CreationDate="2015-11-17T15:13:44.303" Score="2" Body="&lt;p&gt;You can do it with this function:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-extra-blank-lines ()&#xA;    &amp;quot;replace multiple blank lines with a single one&amp;quot;&#xA;    (interactive)&#xA;    (setq orig (point))&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward &amp;quot;^\n+&amp;quot; nil t)&#xA;      (replace-match &amp;quot;\n&amp;quot;)&#xA;      (forward-char 1))&#xA;     (goto-char orig))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2021-07-13T16:56:57.683" LastActivityDate="2021-07-13T16:56:57.683" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="18163" PostTypeId="2" ParentId="18161" CreationDate="2015-11-17T15:18:00.047" Score="2" Body="&lt;p&gt;&lt;code&gt;M-%&lt;/code&gt; runs the command &lt;code&gt;query-replace&lt;/code&gt;, which prompts you first for the string to find, then the string to replace matches with. The enter key would normally close each of these prompts, so you have to do something special to search for or replace a newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any time you want to type a character that would ordinarily have some other effect, you can prefix it with &lt;code&gt;C-q&lt;/code&gt;. So &lt;code&gt;C-q RET&lt;/code&gt; will enter the literal carriage return character, which is visually represented in a buffer as &lt;code&gt;^M&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, your text file may or may not use carriage returns to indicate newlines. Most likely it uses line feeds instead. In this case you'll want to use &lt;code&gt;C-q C-J&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to put it all together: use &lt;code&gt;M-% C-q C-j C-q C-j RET C-q C-j RET&lt;/code&gt; to replace two line-feed characters in a row with a single line-feed character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At each match the &lt;code&gt;query-replace&lt;/code&gt; command will ask you what to do. You can replace a single match, skip a match, or hit &lt;code&gt;!&lt;/code&gt; to replace all matches. There are a few other options as well.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2015-11-17T15:26:56.973" LastActivityDate="2015-11-17T15:26:56.973" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18164" PostTypeId="2" ParentId="18161" CreationDate="2015-11-17T15:20:25.403" Score="1" Body="&lt;p&gt;You could use &lt;code&gt;replace-regexp&lt;/code&gt; (&lt;kbd&gt;C-M-%&lt;/kbd&gt;) to replace at least two new lines, with just one. To enter a new line, you can use &lt;kbd&gt;C-q C-j&lt;/kbd&gt;. So:&#xA;&lt;kbd&gt;C-M-%&lt;/kbd&gt; (or M-x replace-regexp) then you replace &lt;kbd&gt;^C-q C-j C-q C-j +&lt;/kbd&gt; with &lt;kbd&gt;C-q C-j&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="437" LastActivityDate="2015-11-17T15:20:25.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18165" PostTypeId="2" ParentId="18161" CreationDate="2015-11-17T15:28:37.510" Score="5" Body="&lt;p&gt;Use &lt;code&gt;C-M-%&lt;/code&gt; to run &lt;code&gt;query-replace-regexp&lt;/code&gt;.  This works similarly to &lt;code&gt;query-replace&lt;/code&gt; in db48x's answer, but allows for a regular expression.  Using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^&#xA;+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as input (^ matches end of line, followed by one or more newlines), and replace with a single newline. &lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-11-17T15:28:37.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18166" PostTypeId="2" ParentId="18155" CreationDate="2015-11-17T17:34:57.277" Score="11" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/mooz/js2-mode&quot;&gt;js2-mode&lt;/a&gt; supports all of this. It is available on GNU ELPA and MELPA for easy access.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-11-17T17:34:57.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18168" PostTypeId="1" CreationDate="2015-11-17T18:00:24.260" Score="0" ViewCount="385" Body="&lt;p&gt;Note that I use spaces for tabs.&#xA;When I am working in erb files for rails such as example.js.erb or example2.html.erb, I am getting some very odd (and annoying) auto-tabbing behaviour, which I can't figure out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in a js.erb file I'll type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function blaah(){  //a comment&#xA;  var a = 5;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I'll press tab on each line and I'll get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function blaah(){  //a comment&#xA;                   var a = 5;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would appear as though the 2nd line is attempting to align with the comment above, but for what reason I do not know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;)&#xA;         t)&#xA;(package-initialize)&#xA;&#xA;(load-theme 'misterioso)&#xA;(setq inhibit-splash-screen t)&#xA;&#xA;; remove tool/scroll bars&#xA;(tool-bar-mode -1)&#xA;(scroll-bar-mode -1)&#xA;&#xA;; (row,column) shown in bottom bar&#xA;(line-number-mode)&#xA;(column-number-mode 1)&#xA;&#xA;; line numbers on the left&#xA;(global-linum-mode 1)&#xA;&#xA;; highlight current line num&#xA;(require 'hlinum)&#xA;(hlinum-activate)&#xA;(setq hl-line-sticky-flag nil)&#xA;&#xA;(require 'smartparens)&#xA;(smartparens-global-mode t)&#xA;(require 'smartparens-config)&#xA;(sp-pair &quot;%&quot; &quot;%&quot; :wrap &quot;C-%&quot;)&#xA;&#xA;(add-to-list 'load-path &quot;c:/Users/darre00/AppData/Roaming/.emacs.d/web-mode-master&quot;)&#xA;(require 'web-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.phtml\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.tpl\\.php\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.[agj]sp\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.as[cp]x\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.erb\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.mustache\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.djhtml\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.html?\\'&quot; . web-mode))&#xA;(setq web-mode-enable-auto-pairing nil)&#xA;&#xA;(require 'json-mode)&#xA;(add-hook 'json-mode-hook 'hs-minor-mode)&#xA;&#xA;(require 'org)&#xA;;; Make org-mode activate automatically for files ending in .org&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.org$&quot; . org-mode))&#xA;&#xA;(require 'multiple-cursors)&#xA;(global-set-key (kbd &quot;C-S-c C-S-c&quot;) 'mc/edit-lines)&#xA;(global-set-key (kbd &quot;C-&amp;gt;&quot;) 'mc/mark-next-like-this)&#xA;(global-set-key (kbd &quot;C-&amp;lt;&quot;) 'mc/mark-previous-like-this)&#xA;(global-set-key (kbd &quot;C-c C-&amp;lt;&quot;) 'mc/mark-all-like-this)&#xA;&#xA;(require 'expand-region)&#xA;(global-set-key (kbd &quot;C-=&quot;) 'er/expand-region)&#xA;(global-set-key (kbd &quot;C-+&quot;) 'er/contract-region)&#xA;&#xA;; scrolling starts 2 lines away from top/bottom&#xA;(setq scroll-margin 2&#xA;      scroll-preserve-screen-position 1)&#xA;&#xA;; indentation&#xA;(setq-default c-basic-offset 2)&#xA;(setq-default js-indent-level 2)&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 2)&#xA;(setq-default web-mode-code-indent-offset 2)&#xA;&#xA;; full file path in title bar&#xA;(setq-default frame-title-format '((:eval (if (buffer-file-name)&#xA;                                              (abbreviate-file-name (buffer-file-name)) &quot;%f&quot;))))&#xA;&#xA;(ido-mode 1)&#xA;&#xA;; FUNCS&#xA;(defun kill-dired-buffers()&#xA;  &quot;Kill all dired buffers open.&quot;&#xA;  (interactive)&#xA;  (mapc (lambda (buffer)&#xA;      (when (eq 'dired-mode (buffer-local-value 'major-mode buffer))&#xA;        (kill-buffer buffer)))&#xA;    (buffer-list)&#xA;   )&#xA;  (message &quot;Killed all dired buffers&quot;)&#xA;)&#xA;&#xA;(defun toggle-comment ()&#xA;  &quot;comment or uncomment region or line&quot;&#xA;  (interactive)&#xA;  (let (beg end)&#xA;    (if (region-active-p)&#xA;        (setq beg (region-beginning) end (region-end))&#xA;      (setq beg (line-beginning-position) end (line-end-position)))&#xA;    (comment-or-uncomment-region beg end)))&#xA;&#xA;&#xA;; KEYBINDINGS&#xA;(global-set-key (kbd &quot;C-c k&quot;) 'kill-dired-buffers)&#xA;(global-set-key (kbd &quot;C-c /&quot;) 'toggle-comment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any help is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9344" LastActivityDate="2015-11-17T18:00:24.260" Title="Strange tabbing behaviour in .erb files" Tags="|web-mode|javascript|ruby|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18169" PostTypeId="2" ParentId="17981" CreationDate="2015-11-17T18:08:34.420" Score="4" Body="&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: The last error messages is now &lt;em&gt;also&lt;/em&gt; shown in the status buffer. You'll know it when you see it. But it is only shown in the status buffer - if that buffer is not visible, then the message can only be seen in the echo area. So everything said below about how to make sure you get to see the message there, still applies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that the message is only shown in the status buffer until that is refreshed.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When a git process exits with a non-zero exit status, then magit tries to find an error message in git's output. So usually you should see e.g.:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Could not read from remote repository. ... [See buffer *magit-process: use-package for details]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Git failed&lt;/code&gt; is only used if git did not output anything resembling an error message.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But you are right, without any user configuration, these error messages are usually drowned in a see of messages about buffers being reverted. The last of these messages reads like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;Reverting 55 file-visiting buffer(s)...done&#xA;This can be undone using `C-/' in the affected buffers&#xA;Customize behavior using `M-x customize-option RET magit-revert-buffers RET'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My hope was that this is verbose enough to annoy users sufficiently to actually bother customizing the mentioned variable. When you do that, then you will get to read its doc-string, which explains that you should set the value to &lt;code&gt;silent&lt;/code&gt; and (to some extend) why that isn't the default:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;‘usage’   Like ‘t’ but include usage information in the summary.&#xA;          This is the default so that users come here and pick&#xA;          what is right for them.&#xA;&#xA;‘silent’  Revert the buffers synchronously and be quiet about it.&#xA;          This is the recommended setting, because for the other&#xA;          values the revert messages might prevent you from&#xA;          seeing other, more important, messages in the echo&#xA;          area.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So change the value to &lt;code&gt;silent&lt;/code&gt; and you should get to see the error messages in most cases. There might be other messages which shadow the git error messages in some cases, but that's expected to be rare.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The reason we are forcing users to read the doc-string and to change the value from the &lt;em&gt;actual&lt;/em&gt; default to the &lt;em&gt;intended&lt;/em&gt; default, is that there is a tiny risk of data loss, when buffers are reverted without the user being aware of it. So we &lt;em&gt;do&lt;/em&gt; revert by default (because that's very useful), but we do it very verbosely and tell the user how to undo the reverts. (And also suggest that s/he configures the variable, which is the part you missed.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q: When could the automatic reverts lead to data-loss?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the buffer has unsaved changes, then Emacs won't attempt to revert; so no risk here. If the buffer is saved and that caused the file in the working tree to contain uncommitted changes, then git refuses to perform any action which would lose these changes; so no risk here. There only is a risk, if you knowingly use buffers as a staging area (without knowing about the automatic reverts by magit). For example: Make changes, save, and commit. Notice that you should for some reason not have committed. Do a hard reset to &lt;code&gt;HEAD~&lt;/code&gt;, &lt;em&gt;expecting the buffer not to be reverted&lt;/em&gt;. What you should do instead (as in &quot;take full advantage of Git and the nice wrapping provided by Magit&quot;) is a soft reset, but ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q: So if the risk of data loss is tiny, why are you doing all that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... not every user might realize that, so we play it safe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q: But...?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/magit/magit/issues/1809&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magit/magit/issues/1809&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-04-14T22:41:54.327" LastActivityDate="2016-04-14T22:41:54.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18170" PostTypeId="2" ParentId="18104" CreationDate="2015-11-17T18:23:44.233" Score="1" Body="&lt;p&gt;The url you type at the &lt;code&gt;Clone repository:&lt;/code&gt; prompt is passed verbatim to git, as in &lt;code&gt;git clone &quot;the-url-you-typed&quot;&lt;/code&gt;. If that doesn't work, then you probably made a typo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try typing &lt;code&gt;git clone double-checked-url&lt;/code&gt; into a shell. If that works, then &lt;code&gt;M-x magit-clone RET double-checked-url RET /local/path RET&lt;/code&gt; would work too.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-11-17T18:23:44.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18171" PostTypeId="1" AcceptedAnswerId="18201" CreationDate="2015-11-17T18:34:20.527" Score="4" ViewCount="524" Body="&lt;h1&gt;problem&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Lately I run GNU Emacs mostly as GUI on X/tty7 (which I'll call &quot;the desktop&quot; as opposed to emacs-desktop) on one of my Debian laptops. Occasionally the desktop hangs, in which case I usually can goto tty1 and &lt;code&gt;sudo shutdown -[whatever] now&lt;/code&gt;. Unfortunately this does not cause Emacs to shut down as cleanly as I'd like: I'd like Emacs to (e.g.) save any unsaved buffers and &lt;code&gt;desktop-save&lt;/code&gt;, but that doesn't seem to get done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm thinking that, in this usecase, I should utter something from tty1 (before &lt;code&gt;shutdown&lt;/code&gt;) to tell Emacs to shutdown cleanly ... but I don't know what to say. How to do this?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;solution&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;thanks&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;TIA and for past help to the many fine folks @ &lt;a href=&quot;https://lists.gnu.org/mailman/listinfo/help-gnu-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;help-gnu-emacs&lt;/a&gt;, esp &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2015-11/msg00219.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Yuri Khan&lt;/a&gt; for the initial suggestion and &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2015-11/msg00223.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jorge A. Alfaro-Murillo&lt;/a&gt; for the more important details of this solution. Special thanks to &lt;a href=&quot;https://emacs.stackexchange.com/users/8760/faried-nawaz&quot;&gt;Faried Nawaz&lt;/a&gt; for &lt;a href=&quot;https://emacs.stackexchange.com/a/18201/5444&quot;&gt;2 important advances&lt;/a&gt; that pretty-much solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;server and client&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;One way that WFM (not entirely without problems--see &lt;code&gt;notes&lt;/code&gt; below) is&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Preparation:&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;1.1. Whenever you start Emacs, make it start a server instance. I did this by adding the following line to my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (server-start)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;1.2. Also in &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;, define a callable function to tell emacs to shutdown cleanly, with as few prompts as possible. &lt;a href=&quot;https://emacs.stackexchange.com/users/8760/faried-nawaz&quot;&gt;Faried Nawaz&lt;/a&gt; &lt;a href=&quot;https://emacs.stackexchange.com/questions/18171/how-to-tell-graphical-emacs-to-shutdown-cleanly-from-tty1#comment27339_18201&quot;&gt;recommended&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun my-kill-emacs ()&#xA;      &quot;Set kill-emacs-query-functions , confirm-kill-emacs , and&#xA;    kill-emacs-hook to nil to quit emacs without any pesky prompts&#xA;    (except to save buffers)&quot;&#xA;      (let (kill-emacs-query-functions confirm-kill-emacs kill-emacs-hook)&#xA;        (save-buffers-kill-emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;1.3. Restart your emacs to be sure to incorporate your new &lt;code&gt;init.el&lt;/code&gt; code.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;strong&gt;When you encounter tty7/desktop hang:&lt;/strong&gt; Goto tty1, and login if not already. Then do either of the following:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;2.1. manually: from bash commandline, run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -a '' -e '(my-kill-emacs)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2.2. scripted: save the above line into an executable file à la &lt;code&gt;~/bin/shutdown_Emacs_cleanly.sh&lt;/code&gt; and run it. E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;emacsclient -c -a '' -e '(my-kill-emacs)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;notes&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If your (graphical) Emacs has no unsaved buffers when you kill it (as described above), Emacs will exit with no prompts. If your Emacs &lt;em&gt;has&lt;/em&gt; unsaved buffers when you kill it, you will get prompts (from your character-mode Emacs in tty1) to save the buffers. (Writing a function that saves all unsaved buffers without &lt;em&gt;any&lt;/em&gt; prompts is left as an exercise for the reader :-)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Whether or not you have unsaved buffers, when your tty1 commandline exits, its terminal handling may be &quot;polluted&quot;: e.g. (and in roughly decreasing order of importance),&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You will no longer see what you type at the bash prompt.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;History browsing (via up/down-arrow key) also fails--at least, I cannot see anything on the commandline.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hitting RET at the bash prompt no longer does a line feed, though it still produces a new prompt. This results in a display like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ me@it:~$ &lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My tty1 is always polluted by running the above; YMMV. Fortunately, as &lt;a href=&quot;https://emacs.stackexchange.com/a/18201/5444&quot;&gt;Nawaz points out&lt;/a&gt;, one can unpollute by calling &lt;code&gt;reset&lt;/code&gt; from the tty1 commandline (after installing package=&lt;code&gt;ncurses-bin&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-11-22T09:36:14.247" Title="how to tell graphical Emacs to shutdown cleanly from tty1?" Tags="|emacsclient|linux|gui-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18173" PostTypeId="1" AcceptedAnswerId="18175" CreationDate="2015-11-17T19:37:38.470" Score="5" ViewCount="1052" Body="&lt;p&gt;I'm using Prelude. When I press &lt;code&gt;M-x&lt;/code&gt;, I get &lt;code&gt;helm-M-x&lt;/code&gt;. Recently I've used &lt;code&gt;query-replace-regexp&lt;/code&gt;. Now when I type &quot;replace-regexp&quot;, it automatically reaches for element in my history. There is separate section for commands below, where my beloved &lt;code&gt;replace-regexp&lt;/code&gt; is, but I don't know how to reach it. How can I get in there and use the command I want to?&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="654" LastEditDate="2015-11-17T20:20:11.463" LastActivityDate="2020-05-09T10:25:17.640" Title="How to jump from &quot;Emacs Command History&quot; to &quot;Emacs Commands&quot; in helm" Tags="|helm|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18174" PostTypeId="1" CreationDate="2015-11-17T20:00:17.450" Score="3" ViewCount="59" Body="&lt;p&gt;I'd like to advise &lt;code&gt;format-mode-line&lt;/code&gt; to collapse whitespace across the whole string. The following attempt does not work for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(advice-add 'format-mode-line :filter-return 'collapse-whitespace)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I evaluate &lt;code&gt;(format-mode-line mode-line-format)&lt;/code&gt;, the output seems to be what I want, but the appearance of my mode line does not change.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-11-17T20:00:17.450" Title="Passing advice to mode line" Tags="|mode-line|advice|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18175" PostTypeId="2" ParentId="18173" CreationDate="2015-11-17T20:19:06.853" Score="7" Body="&lt;p&gt;You can use &lt;code&gt;C-n&lt;/code&gt; (&lt;code&gt;helm-next-line&lt;/code&gt;) to move line-wise or &lt;code&gt;C-o&lt;/code&gt;/&lt;code&gt;&amp;lt;right&amp;gt;&lt;/code&gt; (&lt;code&gt;helm-next-source&lt;/code&gt;) to move source-wise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://github.com/emacs-helm/helm#basic-usage&quot; rel=&quot;noreferrer&quot;&gt;Basic Usage&lt;/a&gt; section of the Helm guide for more info:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Once you are in the helm session (of &lt;code&gt;helm-M-x&lt;/code&gt; or any one else) you can hit either &lt;code&gt;C-h m&lt;/code&gt; or &lt;code&gt;C-c ?&lt;/code&gt;, the former is will popup a general info buffer about helm while the second will popup a specialized info of the current source you are into.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h m&lt;/code&gt; will give you a nice basic hotkey table and plenty of more info.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-11-17T20:19:06.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18177" PostTypeId="1" AcceptedAnswerId="18291" CreationDate="2015-11-18T07:57:46.237" Score="0" ViewCount="293" Body="&lt;p&gt;I have started programming scheme, and I noticed the scheme minor mode highlights comments in the most obnoxious way possible when using solarized dark (color-theme-solarized). This also occurs on elisp files. Its a super bright grey, and makes the contrast too much to handle. I suppose its because the solarized theme overwrote some color that would normally be used for this kind of thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can disable highlighting of these comments or correct the color? It's making the code unreadable, and Google is not helping. This seems to only occur on lisp-likes, such as scheme and elisp on my Arch Linux machine. On my mac, this does not occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10194" LastActivityDate="2015-11-21T23:08:43.027" Title="Disabling strange emacs comment highlighting" Tags="|syntax-highlighting|scheme|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18178" PostTypeId="1" CreationDate="2015-11-18T08:07:05.503" Score="1" ViewCount="25" Body="&lt;p&gt;Basically, I am looking for an autocomplete-mode that suggests words as ido-mode does on file. Meaning,&lt;br&gt;&#xA;if I've typed &quot;em&quot; and the autocomplete suggests two words &quot;Emacs&quot; and &quot;Emacsclient&quot; , it should suggest &quot;Emacsclient&quot; if I type any of &quot;l&quot;, &quot;i&quot;, &quot;e&quot;, &quot;n&quot; or &quot;t&quot; next.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is such thing already there. Native auto-complete mode doesn't do that. So, is there any other package that any of you are aware of that does such thing?&lt;/p&gt;&#xA;" OwnerUserId="10160" LastActivityDate="2015-11-18T08:07:05.503" Title="Feature query to auto-complete mode" Tags="|package|ido|auto-complete-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18179" PostTypeId="1" AcceptedAnswerId="18233" CreationDate="2015-11-18T08:11:39.993" Score="7" ViewCount="4147" Body="&lt;p&gt;I have the following agenda command for things that I want to do at home:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     (&quot;h&quot; &quot;thing TODO at Home&quot;&#xA;     (&#xA;&#xA;      (tags-todo &quot;+dailies+SCHEDULED&amp;lt;=\&quot;&amp;lt;today&amp;gt;+1\&quot;&quot;)&#xA;      (agenda &quot;&quot; ((org-agenda-ndays 1)&#xA;                  (org-agenda-filter-by-tag  '(&quot;-work&quot; ))&#xA;                  (org-agenda-sorting-strategy&#xA;                   (quote ((agenda time-up priority-down tag-up) )))&#xA;                  (org-deadline-warning-days 0)&#xA;                  ))&#xA;      (tags &quot;reading&quot;)&#xA;      (tags &quot;writing&quot;)&#xA;      (tags-todo &quot;REFILE&quot;)&#xA;&#xA;&#xA;      )&#xA;&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;org-agenda-filter-by-tag&lt;/code&gt; to remove all the entries that are tagged work. (I have some file&#xA;wide tags on the files). However, the agenda works, but is showing me also the entries tagged &lt;code&gt;work&lt;/code&gt;.&#xA;I also tried putting the &lt;code&gt;org-agenda-filter-by-tag&lt;/code&gt; on the top of the definition of the block agenda&#xA;but it is also not working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode: 8.3.2&#xA;Emacs 24.5.1&#xA;OS: Mac OSX Yosemite 10.10.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="9708" LastActivityDate="2024-01-18T21:55:28.987" Title="Org: Agenda command with org-agenda-filter-by-tag not working" Tags="|org-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18180" PostTypeId="1" CreationDate="2015-11-18T08:39:24.013" Score="5" ViewCount="1919" Body="&lt;p&gt;I tried to install emacs-snapshot through their PPA on a fresh Ubuntu 14.04 LTS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-add-repository ppa:ubuntu-elisp/ppa&#xA;sudo apt-get update&#xA;sudo apt-get install emacs-snapshot&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when i try to start it, it gives me this error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs-snapshot&#xA;Warning: Could not find simple.el or simple.elc&#xA;Cannot open load file: No such file or directory, warnings&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also tried running it as sudo, and the same thing happens. &#xA;I do not have an .emacs.d/ folder, so it should just run as vanilla.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do anyone have any idea how i can make it work?&lt;/p&gt;&#xA;" OwnerUserId="8260" LastEditorUserId="8260" LastEditDate="2015-11-18T08:56:09.417" LastActivityDate="2021-07-03T13:44:29.760" Title="emacs-snapshot: Could not find simple.el or simple.elc" Tags="|emacs-snapshot|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18181" PostTypeId="1" AcceptedAnswerId="18182" CreationDate="2015-11-18T09:04:01.857" Score="0" ViewCount="586" Body="&lt;p&gt;I wrote a simple mode with the following &lt;code&gt;font-lock&lt;/code&gt; definition, which defines just some keywords:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar marpa-mode-font-lock&#xA;  `((,(regexp-opt '(&quot;:default&quot; &quot;action&quot; &quot;lexeme&quot; &quot;default&quot; &quot;latm&quot; &quot;separator&quot;) t)&#xA;     . 'font-lock-keyword-face)&#xA;    )&#xA;  &quot;Highlighting for Marpa mode&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use it in my mode function in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'font-lock-defaults) '(marpa-mode-font-lock))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use the mode more than just the keywords are highlighted. Strings are also highlighted with some kind of C or Lisp default syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I disable the default string syntax in order to replace it with my own definition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the language for which I wrote the mode, strings are not delimited by double quotes. Instead they are delimited by single quotes and may have a suffix attribute like this: &lt;code&gt;'create':i&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2015-11-18T09:21:25.250" Title="How to change the font-lock string definition?" Tags="|major-mode|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18182" PostTypeId="2" ParentId="18181" CreationDate="2015-11-18T09:21:25.250" Score="1" Body="&lt;p&gt;Strings and comments are highlighted based on the information in the syntax table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, this is much better than a keyword-based solution as it handles multi-line constructs better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you really want to disable this, you can set &lt;code&gt;font-lock-keywords-only&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;font-lock-keywords-only is a variable defined in `font-lock.el'.&#xA;  Its value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Non-nil means Font Lock should not fontify comments or strings.&#xA;  This is normally set via `font-lock-defaults'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-11-18T09:21:25.250" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18184" PostTypeId="1" CreationDate="2015-11-18T11:40:02.393" Score="8" ViewCount="723" Body="&lt;p&gt;I often seem to want to copy paste multiple columns, for example, I paste one column&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;line one&#xA;line two&#xA;line three&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I'd like to be able to yank another column behind it. Assuming my kill buffer has the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;added to one&#xA;added to two&#xA;added to three&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which command would I need to invoke to get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;line one added to one&#xA;line two added to two&#xA;line three added to three&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Using the rectangles functionality of Emacs helps quite a bit, but is still suboptimal. For instance, if using Emacs in graphical mode and you are yanking from external programs, i.e. using the Copy-paste functionality from your OS, the kill-buffer has no rectangular meta info, so rectangular yank does not work.&#xA;Another issue is if you are having a columns with varying internal width:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;short line                        *&#xA;a much larger line which goes on&#xA;short line again&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you want to rectangular yank, you'll have to place your pointer at the marked spot (*). Although this is trivial with three lines, it can be quite cumbersome to make sure you are placing the pointer at the most outer edge of the first column.&lt;/p&gt;&#xA;" OwnerUserId="10197" LastEditorUserId="105" LastEditDate="2015-11-18T16:03:50.647" LastActivityDate="2023-08-16T10:42:09.383" Title="Yank a column of text copied from the clipboard" Tags="|rectangle|yank|clipboard|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18185" PostTypeId="2" ParentId="14777" CreationDate="2015-11-18T12:07:44.807" Score="3" Body="&lt;p&gt;Try doing a scheduled time stamp of: &lt;code&gt;SCHEDULED: &amp;lt;2015-11-18 Wed .+10d/13d -6d&amp;gt;&lt;/code&gt;.  The trailing &lt;code&gt;-6d&lt;/code&gt; says to only start showing it in the agenda when you're 6 days away from the date.&lt;/p&gt;&#xA;" OwnerUserId="2003" LastEditorUserId="2003" LastEditDate="2015-11-19T12:16:39.223" LastActivityDate="2015-11-19T12:16:39.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18186" PostTypeId="1" AcceptedAnswerId="18192" CreationDate="2015-11-18T13:48:19.227" Score="1" ViewCount="805" Body="&lt;p&gt;My main setup uses &lt;code&gt;zsh&lt;/code&gt; and &lt;code&gt;prezto&lt;/code&gt; on Mac OS with a custom prompt theme (I use &lt;code&gt;iTerm2&lt;/code&gt; and not &lt;code&gt;Terminal.app&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering what's the best way to have a similar experience with an Emacs terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I seems that the answer is easy: &lt;code&gt;M-x ansi-term&lt;/code&gt; (or just &lt;code&gt;M-x term&lt;/code&gt; ?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the prompt is not very nice as Emacs doesn't understand the special character my theme uses (some kind of fat arrow).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I fix this? Can I 'detect' in my &lt;code&gt;zshrc&lt;/code&gt; file that I'm inside Emacs and change the prompt?&lt;/p&gt;&#xA;" OwnerUserId="9959" LastActivityDate="2015-11-18T17:14:22.170" Title="Emacs terminal prompt" Tags="|term|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18187" PostTypeId="2" ParentId="18180" CreationDate="2015-11-18T14:14:56.723" Score="3" Body="&lt;p&gt;I have the same issue. It looks all el-files were placed into incorrect directory. I'm not sure but I found 2 directories in /usr/share/emacs for 25.0.50 and 25.1.50. The version of my emacs is 25.0.50 and I think it's the latest version but all required files in directory 25.1.50. I just renamed original 25.0.50 directory and created symlink with name 25.0.50 to point to 25.1.50. It works for me.&lt;/p&gt;&#xA;" OwnerUserId="10199" LastActivityDate="2015-11-18T14:14:56.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18188" PostTypeId="1" AcceptedAnswerId="18189" CreationDate="2015-11-18T15:13:46.797" Score="3" ViewCount="384" Body="&lt;p&gt;I use multiple monitors with different DPIs so I would like to have all windows in the Emacs frame on a specific monitor with a bigger font height to have the a closer physical appearance to the other monitor. We can assume I won't open the same buffer on separate frames/monitors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&#xA;I'm running brew 24.5 emacs on OSX.&lt;/p&gt;&#xA;" OwnerUserId="6978" LastActivityDate="2015-11-18T15:33:28.123" Title="Different font heights for each Emacs frame" Tags="|frames|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18189" PostTypeId="2" ParentId="18188" CreationDate="2015-11-18T15:33:28.123" Score="7" Body="&lt;p&gt;Yes. You can put a function on &lt;code&gt;after-make-frame-functions&lt;/code&gt; (or perhaps &lt;code&gt;make-frame-functions&lt;/code&gt;) that tests which display (monitor) is used and adjusts the frame's default font height (size) appropriately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That function can use function &lt;code&gt;display-monitor-attributes-list&lt;/code&gt; to determine which display is used. It can then change the size of the frame's font, if appropriate, using function &lt;code&gt;set-frame-font&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-18T15:33:28.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18190" PostTypeId="1" AcceptedAnswerId="18198" CreationDate="2015-11-18T15:51:32.533" Score="1" ViewCount="1714" Body="&lt;p&gt;For a number of reasons - the main one being that &lt;strong&gt;Emacs is amazing!&lt;/strong&gt; - I am trying to do all my Python development at work in Emacs instead of Pycharm, which I was using previously. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one component I have not been able to get running right in Emacs is the debugger. I have been trying to use &lt;code&gt;pdb&lt;/code&gt; in emacs to debug the application I am working on, but I haven't been able to figure out how to get &lt;code&gt;pdb&lt;/code&gt; to find all the necessary modules. Instead, when I run my &lt;code&gt;__main__.py&lt;/code&gt; file through pdb, I get a bunch of import errors because it can't find the modules for the project. If I manually add the appropriate paths to &lt;code&gt;sys.paths&lt;/code&gt; and then import the modules one by one from the interactive pdb prompt, this works, but obviously is not the right solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Pycharm debugger there are two options: &quot;add content roots to PYTHONPATH&quot; and &quot;add source roots to PYTHONPATH&quot;, which configure this stuff automatically. My issue is that I haven't figured out how to configure equivalent options in Emacs - i.e., I am not sure how/where to set PYTHONPATH so that &lt;code&gt;pdb&lt;/code&gt; within Emacs recognizes it. I have tried setting it a few different was in my Emacs config, but nothing seems to work. Any suggestions? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-11-18T18:49:39.490" Title="Missing modules when debugging Python code in Emacs" Tags="|python|debugging|environment|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18191" PostTypeId="1" AcceptedAnswerId="18214" CreationDate="2015-11-18T16:43:32.753" Score="5" ViewCount="1986" Body="&lt;p&gt;I've got &lt;code&gt;#+OPTIONS: tex:t&lt;/code&gt; and &lt;code&gt;#+STARTUP: entitiespretty&lt;/code&gt; at the top of my org file, however, this seems to allow only a subset of Latex. For example, typing &lt;code&gt;\rightarrow&lt;/code&gt; embeds upon the last keystroke a → just fine. But if I try a &lt;code&gt;\vdash&lt;/code&gt; (⊢) I get nothing. &lt;code&gt;\vdash&lt;/code&gt; just sits there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I looked around and found &lt;a href=&quot;https://emacs.stackexchange.com/questions/14301/how-can-i-extend-org-symbols-table&quot;&gt;this&lt;/a&gt;, which seems to be an Emacs-wide solution (per buffer). &lt;code&gt;(set-input-method 'TeX)&lt;/code&gt; in fact does recognize &lt;code&gt;\vdash&lt;/code&gt; and converts it instantly to ⊢. Another curiosity is how I put &lt;code&gt;\vdash&lt;/code&gt; inside an emacs-lisp code block -- while &lt;code&gt;set-input-method&lt;/code&gt; is still active -- and it worked, &lt;em&gt;and&lt;/em&gt; it saved it, &lt;em&gt;and&lt;/em&gt; it exported to HTML just fine. Typically, being in a code block means Latex markup either won't display, or if it does, it won't export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then tried to use ⊢ as a symbol&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-input-method 'TeX)&#xA;(setf ⊢ t)&#xA;(defun foo ()&#xA;  (if ⊢ 1 2))&#xA;(foo)&#xA;    =&amp;gt; 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm guessing this is utf-8 lore, and Emacs will work with a utf-8 &quot;character&quot; just as if it were old-school ascii. &lt;code&gt;set-input-method&lt;/code&gt; seems to have permanently replaced the Latex markup code. Is this correct? Also, why is org mode incomplete at in-buffer Latex substitutions while &lt;code&gt;set-input-method&lt;/code&gt; with TeX is more complete? Which is the better choice?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-11-18T22:40:54.810" Title="Latex symbols in org mode buffer" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18192" PostTypeId="2" ParentId="18186" CreationDate="2015-11-18T17:14:22.170" Score="1" Body="&lt;p&gt;&lt;code&gt;M-x ansi-term&lt;/code&gt; (and &lt;code&gt;M-x term&lt;/code&gt; by the way) sets the &lt;code&gt;TERM&lt;/code&gt; environment variable to &lt;code&gt;eterm-color&lt;/code&gt;, so that's something you can use to adjust the prompt in you .zshrc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have something similar in my &lt;code&gt;prezto&lt;/code&gt; setup (although for &lt;code&gt;dumb&lt;/code&gt; terminal, which is even more limited):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Disable color and theme in dumb terminals.&#xA;if [[ &quot;$TERM&quot; == 'dumb' ]]; then&#xA;  zstyle ':prezto:*:*' color 'no'&#xA;  zstyle ':prezto:module:prompt' theme 'off'&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might want something more subtle in your case !&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2015-11-18T17:14:22.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18193" PostTypeId="2" ParentId="18135" CreationDate="2015-11-18T17:43:23.007" Score="12" Body="&lt;p&gt;You can achieve that by naming your results table. Then, the code block will update the same table it used as input.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :var table=mytable&#xA;  (append table '((1 2 3)))&#xA;#+end_src&#xA;&#xA;#+name: mytable&#xA;#+RESULTS:&#xA;| 0 | 0 | 0 |&#xA;| 0 | 0 | 0 |&#xA;| 1 | 2 | 3 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To have the greater flexibility that the OP had in mind: it isn't necessary to have the results immediately follow the source block if the source block and &lt;code&gt;RESULTS&lt;/code&gt; label also share a name.  Shown here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: mytable&#xA;#+RESULTS: mytable-calc&#xA;| 0 | 0 | 0 |&#xA;| 0 | 0 | 0 |&#xA;| 1 | 2 | 3 |&#xA;&#xA;#+name: mytable-calc&#xA;#+begin_src emacs-lisp :var table=mytable&#xA;  (append table '((1 2 3)))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10206" LastEditorUserId="2731" LastEditDate="2015-11-21T08:48:42.907" LastActivityDate="2015-11-21T08:48:42.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18194" PostTypeId="1" AcceptedAnswerId="24828" CreationDate="2015-11-18T18:24:22.767" Score="4" ViewCount="904" Body="&lt;p&gt;Preface this by saying I program but I'm not a programmer, and I especially don't know lisp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use org capture during code reviews, and we use line numbers as a way or organizing changes that need to be made. Is there a way to have org-capture include the line number that point was at when org capture was called? &lt;/p&gt;&#xA;" OwnerUserId="10208" LastActivityDate="2016-07-25T19:04:39.857" Title="Add line number to org-capture" Tags="|org-mode|org-capture|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18195" PostTypeId="2" ParentId="14952" CreationDate="2015-11-18T18:29:07.767" Score="4" Body="&lt;p&gt;I ran into this problem myself a while back. If I recall correctly, the reason you get that error message is because &lt;code&gt;hunspell&lt;/code&gt; is unable to configure itself based on the current environment. So to fix it, you need to configure the &lt;code&gt;hunspell&lt;/code&gt; specific &lt;code&gt;ispell&lt;/code&gt; variables. The following code &lt;em&gt;should&lt;/em&gt; be enough to setup hunspell for english dictionaries:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'flyspell)&#xA;(setq ispell-dictionary &quot;english&quot;)&#xA;(add-to-list 'ispell-local-dictionary-alist '((&quot;english&quot;&#xA;                                               &quot;[[:alpha:]]&quot;&#xA;                                               &quot;[^[:alpha:]]&quot;&#xA;                                               &quot;[']&quot;&#xA;                                               t&#xA;                                               (&quot;-d&quot; &quot;en_US&quot;)&#xA;                                               nil&#xA;                                               utf-8)))&#xA;(setq ispell-hunspell-dictionary-alist ispell-local-dictionary-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The important part is the &lt;code&gt;ispell-hunspell-dictionary-alist&lt;/code&gt;, it has to be populated with a proper dictionary list, such as the one given in &lt;code&gt;ispell-local-dictionary-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's quite a bit of details surrounding this list though. If you want to know more about it, feel free to read up with &lt;code&gt;M-x describe-variable&lt;/code&gt; &lt;code&gt;ispell-local-dictionary-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2015-11-18T18:29:07.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18196" PostTypeId="1" CreationDate="2015-11-18T18:30:54.030" Score="1" ViewCount="85" Body="&lt;p&gt;I am using Emacs 24.5 on Mac OS (installed with homebrew) in daemon mode. I normally leave the daemon running for long periods of time (weeks) while I'm working. I'll open up files from the command line using &lt;code&gt;emacsclient -n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've noticed is that emacsclient will block if opening the file causes a minibuffer prompt. For instance, if I've already got the file open and the file on disk differs from the file in the associated buffer. 99% of the time, I just switch to emacs, answer yes (or sometimes no) and everything works perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, intermittently, emacsclient will block, as will the emacs GUI, but no minibuffer message will be displayed. My only option at this point seems to be killing the daemon. It's almost as if the minibuffer message is being displayed on a non-existent frame (I often work with multiple frames).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does anyone know what's going on here - and perhaps a way to prevent it?&lt;/li&gt;&#xA;&lt;li&gt;Is there a way to unblock a blocked emacs daemon? C-g from the GUI isn't having any effect.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10012" LastActivityDate="2015-11-18T18:30:54.030" Title="Minibuffer prompt not displaying (intermittently) in daemon mode" Tags="|minibuffer|daemon|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18197" PostTypeId="2" ParentId="17894" CreationDate="2015-11-18T18:44:37.530" Score="1" Body="&lt;p&gt;I press C-c ! to run org-time-stamp-inactive to add a timestamp. That may be bound for you. Preface it with a C-u to get the time in addition to the date.&lt;/p&gt;&#xA;" OwnerUserId="10206" LastActivityDate="2015-11-18T18:44:37.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18198" PostTypeId="2" ParentId="18190" CreationDate="2015-11-18T18:49:39.490" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I am not sure how/where to set PYTHONPATH&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To inform Emacs about your PYTHONPATH, just edit your init file and add this line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setenv &quot;PYTHONPATH&quot; &quot;/the/python/path&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2015-11-18T18:49:39.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18199" PostTypeId="2" ParentId="18177" CreationDate="2015-11-18T18:52:38.623" Score="1" Body="&lt;p&gt;The face in question is &lt;code&gt;font-lock-comment-face&lt;/code&gt;, just &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html&quot; rel=&quot;nofollow&quot;&gt;change the color&lt;/a&gt; to something more to your liking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, when one wants to figure out what properties are being applied to a string, one can go to the character in question and &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;describe-char&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2395" LastActivityDate="2015-11-18T18:52:38.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18200" PostTypeId="1" AcceptedAnswerId="18782" CreationDate="2015-11-18T18:52:54.573" Score="1" ViewCount="677" Body="&lt;p&gt;I found out that &lt;code&gt;magit-ediff-dwim&lt;/code&gt; cannot &quot;read my mind&quot; in a diff buffer when the point is on a hunk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, I would expect this command to need only two things to guess what I mean: a file (e.g. the file of the hunk at point) and either a revision or a range. In a revision buffer, &lt;code&gt;magit-ediff-dwim&lt;/code&gt; correctly guesses which revision ediff should use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When visiting arbitrary diffs however, the function does not guess that &quot;what I mean&quot; is starting an ediff session using the same range as the one which defines the diff buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some scenarios to reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;d r foo..bar&lt;/code&gt; will spawn a diff buffer showing changes between revisions &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;d d&lt;/code&gt; when point is on branch &lt;code&gt;baz&lt;/code&gt; in the refs buffer will spawn a diff buffer showing changes from the current branch to &lt;code&gt;baz&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;d d&lt;/code&gt; in the log buffer when the region spans commits &lt;code&gt;foo&lt;/code&gt; to &lt;code&gt;bar&lt;/code&gt; will spawn a diff buffer showing changes between revisions &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In each of these situations, if I set the point on a hunk and call &lt;code&gt;magit-ediff-dwim&lt;/code&gt;, the function fails to read my mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I poked around &lt;code&gt;magit-diff.el&lt;/code&gt; and &lt;code&gt;magit-ediff.el&lt;/code&gt; and found that I could help magit read my mind by adding the following to &lt;code&gt;magit-diff--dwim&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@@ -616,6 +616,8 @@ If no DWIM context is found, nil is retu&#xA;     (cons 'commit magit-buffer-refname))&#xA;    ((derived-mode-p 'magit-revision-mode)&#xA;     (cons 'commit (car magit-refresh-args)))&#xA;+   ((derived-mode-p 'magit-diff-mode)&#xA;+    (nth 0 magit-refresh-args))&#xA;    (t&#xA;     (magit-section-case&#xA;       ([* unstaged] 'unstaged)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Disclaimer: I am &lt;strong&gt;not&lt;/strong&gt; an E?Lisp developer by any means. I just threw the above together after looking up a few symbols' documentation or &lt;code&gt;message&lt;/code&gt;ing their value when trying to wrap my head around what was happening.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Onto questions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Am I missing something that would explain why &lt;code&gt;magit-ediff-dwim&lt;/code&gt; should not read my mind in diff buffers, although it can in rev buffers?&lt;/li&gt;&#xA;&lt;li&gt;Is this worth creating an issue on the Github tracker?&lt;/li&gt;&#xA;&lt;li&gt;Is the patch above sound? I figure maybe it is not appropriate to poke around &lt;code&gt;magit-refresh-args&lt;/code&gt;, or maybe another case could be added to the &lt;code&gt;magit-section-case&lt;/code&gt; switch below.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Version: &lt;code&gt;20151118.241&lt;/code&gt; from &lt;a href=&quot;https://melpa.org/packages/&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Additional disclaimer: sorry if I sound like I am complaining - magit is a wonderful piece of software that makes version control a very pleasant experience.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="10209" LastActivityDate="2015-12-11T10:36:50.003" Title="Helping `magit-ediff-dwim` read my mind" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18201" PostTypeId="2" ParentId="18171" CreationDate="2015-11-18T18:55:09.383" Score="5" Body="&lt;p&gt;When you run &lt;code&gt;(server-start)&lt;/code&gt; it adds a function called &lt;code&gt;server-kill-emacs-query-function&lt;/code&gt; (defined in &lt;code&gt;server.el&lt;/code&gt;) to the &lt;code&gt;kill-emacs-query-functions&lt;/code&gt; hook.  One solution that might work for you (I've tested it and it works for me) is to modify your emacsclient line to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -a '' \&#xA;-e '(let (kill-emacs-query-functions confirm-kill-emacs kill-emacs-hook) (save-buffers-kill-emacs))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or better yet, define a function in your &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt; and call it from &lt;code&gt;emacsclient&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-kill-emacs ()&#xA;  &quot;Set kill-emacs-query-functions , confirm-kill-emacs , and&#xA;kill-emacs-hook to nil to quit emacs without any pesky prompts&#xA;(except to save buffers)&quot;&#xA;  (let (kill-emacs-query-functions confirm-kill-emacs kill-emacs-hook)&#xA;    (save-buffers-kill-emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;emacsclient -c -a '' -e '(my-kill-emacs)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If running the above messes up your terminal, just type &quot;reset&quot; (part of Debian package=&lt;code&gt;ncurses-bin&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8760" LastEditorUserId="5444" LastEditDate="2015-11-22T09:36:14.247" LastActivityDate="2015-11-22T09:36:14.247" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18202" PostTypeId="1" AcceptedAnswerId="18209" CreationDate="2015-11-18T19:12:24.273" Score="1" ViewCount="1092" Body="&lt;p&gt;The dropdown menus in my installation of Emacs 24.3.1 are not working anymore. Pressing F10 or &lt;code&gt;M-x menu-bar-open&lt;/code&gt; opens the menu in a text buffer. I really miss the graphical dropdown menu in text mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue seems related to &lt;a href=&quot;https://stackoverflow.com/questions/2158320/file-edit-options-etc-menus-dont-work-on-emacs-23-any-ideas&quot;&gt;this&lt;/a&gt;, but that thread reports a bug on OS X Emacs while I'm using Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for my &lt;code&gt;.emacs&lt;/code&gt; file: it only had a couple of commands from &lt;a href=&quot;https://github.com/gabrielelanaro/emacs-for-python&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-for-python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;/home/erickrf/.emacs.d/emacs-for-python/epy-init.el&quot;)&#xA;(epy-setup-ipython)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I deleted everything from the file, but to no help. The dropdown doesn't appear.&lt;/p&gt;&#xA;" OwnerUserId="10210" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-11-18T20:08:20.403" Title="Dropdown menu not working" Tags="|menu-bar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18203" PostTypeId="2" ParentId="13297" CreationDate="2015-11-18T19:16:38.833" Score="3" Body="&lt;p&gt;In the general case, what you want cannot be achieved.  This is because several utilities and modes in Emacs store their read-completion history in different variables, not in one location.  You can manually set those history variables to &lt;code&gt;nil&lt;/code&gt; (for your &lt;code&gt;C-x r t&lt;/code&gt; example, &lt;code&gt;(setq string-rectangle-history nil)&lt;/code&gt;), but it doesn't scale.  It's also not easy to discover the names of the history variables without reading the code.&lt;/p&gt;&#xA;" OwnerUserId="8760" LastActivityDate="2015-11-18T19:16:38.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18204" PostTypeId="2" ParentId="17500" CreationDate="2015-11-18T19:40:51.353" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;Go to the place you want your link to point.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x org-store-link&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Go to the buffer where you want to have the link.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x org-insert-link&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10206" LastEditorUserId="654" LastEditDate="2015-11-18T20:03:52.760" LastActivityDate="2015-11-18T20:03:52.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18205" PostTypeId="1" CreationDate="2015-11-18T19:43:54.990" Score="7" ViewCount="1059" Body="&lt;p&gt;For example, to distinguish between Linux and Windows, I can use &lt;code&gt;(when (eq system-type 'gnu/linux)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to distinguish between Linux distributions, such as Ubuntu vs CentOS?&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="654" LastEditDate="2015-11-18T19:55:10.743" LastActivityDate="2018-08-25T15:24:11.333" Title="How can I distinguish between Linux distributions in Emacs?" Tags="|system-environment|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18207" PostTypeId="2" ParentId="18205" CreationDate="2015-11-18T19:58:09.843" Score="3" Body="&lt;p&gt;The variable &lt;code&gt;operating-system-release&lt;/code&gt; might be helpful. On my Arch Linux VPS, it is set to &lt;code&gt;3.14.1-1-ARCH&lt;/code&gt;. On Windows, it's &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to check if I'm on Arch, I would do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (string-match-p &quot;ARCH&quot; operating-system-release)&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This variable contains the same value output by the Linux command &lt;code&gt;uname -r&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="654" LastEditorUserId="654" LastEditDate="2015-11-18T21:04:55.880" LastActivityDate="2015-11-18T21:04:55.880" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18208" PostTypeId="1" AcceptedAnswerId="18258" CreationDate="2015-11-18T20:00:47.210" Score="1" ViewCount="110" Body="&lt;p&gt;I want to be able to gpg sign specific files, specifically org-mode file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, doing &lt;code&gt;M-x epa-sign-file RET filename.org&lt;/code&gt; will create the file &lt;code&gt;filename.org.asc&lt;/code&gt; and introduce new text in that file that might disrupt functionality of the file if used as the original file.&#xA;It seems cumbersome to publish both files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make sure that the file &lt;code&gt;filename.org.asc&lt;/code&gt; can be used as the original file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Minimal working example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example &lt;code&gt;filename.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Should be loaded&#xA;&#xA;#+begin_src emacs-lisp&#xA;(message &quot;hello world&quot;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will be after &lt;code&gt;M-x epa-sign-file RET filename.org&lt;/code&gt; -&gt; &lt;code&gt;filename.org.asc&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-----BEGIN PGP SIGNED MESSAGE-----&#xA;Hash: SHA1&#xA;&#xA;* Should be loaded&#xA;&#xA;#+begin_src emacs-lisp&#xA;(message &quot;hello world boom&quot;)&#xA;#+end_src&#xA;-----BEGIN PGP SIGNATURE-----&#xA;Version: GnuPG v1&#xA;&#xA;iQEcBAEBAgAGBQJWTNPCAAoJED51s3ZWaq4/D5cH/3ztdd3YZxOu/XCG7bOEZuQa&#xA;jcxKrXiwhmLhKoC4a9tmgCJVDryy4tdSci2WUHoIxJ0vN3BFI2txFm7aoxGpIQCk&#xA;Dxjczy2RtHeN1+N+wBsxeQq5EeZ0A/7c9+eJQmub2GopAWe6D7rggCAEvnFNFcdN&#xA;LcZTo1o/jrKa63Q/KPmN+Y2E2nC4KjICn+SvaVUy2noZzS7c6ofw2dsY7YP915Ng&#xA;hs/38aITDMOpapzphQ0/VkJRDAard8U5jGmCIOMGwXyC7NIYVYB69Cdruo8uz/HA&#xA;xzl8QpMz/tv7qOLyQJLZYCPAglrt5ZGA19XAuKHqMgfvS563UCmRJdcLuGZaj58=&#xA;=3jbG&#xA;-----END PGP SIGNATURE-----&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="427" LastActivityDate="2015-11-20T16:27:27.980" Title="How do I use epa-sign-file and not disrupt functionality of the file with the ASCII-armored signature" Tags="|org-mode|major-mode|pgp|gpg|epa|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18209" PostTypeId="2" ParentId="18202" CreationDate="2015-11-18T20:08:20.403" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The dropdown menus in my installation of Emacs 24.3.1 are not working anymore.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Upgrade to Emacs 24.4 for the dropdown menus feature.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-11-18T20:08:20.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18210" PostTypeId="1" AcceptedAnswerId="18212" CreationDate="2015-11-18T20:38:17.397" Score="1" ViewCount="505" Body="&lt;p&gt;I have this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-dateutc ()&#xA;  (interactive)&#xA;  (shell-command &quot;printf %s $(date +\&quot;%Y-%m-%dT%H:%M:%S\&quot;)&quot; t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I want to use in this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo1 ()&#xA;  (format &quot;this is the date-time %s&quot; (insert-dateutc)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the output is the elisp id number of the function call (yes?)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo1)&#xA;==&amp;gt; &quot;this is the date-time 1185&quot;&#xA;2015-11-18T20:31:30 ; &amp;lt;-- inserted&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the actual desired return left outside. I need to suppress that number and get the actual date-time output. Gosh, I know it's something simple...&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:42:44.430" LastActivityDate="2016-03-14T04:42:44.430" Title="How to format (print) output of the shell-command function" Tags="|format|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18212" PostTypeId="2" ParentId="18210" CreationDate="2015-11-18T21:29:07.397" Score="3" Body="&lt;p&gt;If what you want is just a timestamp, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar user-time-format&#xA;  (eval-when-compile (or (getenv &quot;STRFTIME&quot;) &quot;%Y-%m-%d %a %H:%M:%S %Z&quot;))&#xA;  &quot;The time format for the user to set.&quot;)&#xA;(defun user-time-format (&amp;amp;optional insert)&#xA;  &quot;Return or insert the time string according to `user-time-format'.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((str (format-time-string user-time-format)))&#xA;    (if insert (insert str)&#xA;        (if (called-interactively-p 'interactive) (message &quot;%s&quot; str) str))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;except you would set &lt;code&gt;user-time-format&lt;/code&gt; to &lt;code&gt;&quot;%Y-%m-%dT%H-%M-%S&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, your question raises an interesting issue, so let us discuss it too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &lt;code&gt;insert-dateutc&lt;/code&gt; is fine (but see below), but it &lt;em&gt;inserts&lt;/em&gt; the date instead of returning it,&#xA;so  &lt;code&gt;foo&lt;/code&gt; has to correct that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (with-temp-buffer&#xA;    (insert-dateutc)&#xA;    (buffer-string)))&#xA;&#xA;(format &quot;timestamp = [%s]&quot; (foo))&#xA;==&amp;gt; &quot;timestamp = [2015-11-18T16:37:12]&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, take a look at &lt;kbd&gt;C-h f shell-command RET&lt;/kbd&gt;. It says discourages the use of this function in lisp code, recommending &lt;code&gt;call-process&lt;/code&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (call-process &quot;date&quot; nil t nil &quot;+%Y-%m-%dT%H:%M:%S&quot;)&#xA;  (buffer-substring-no-properties 1 (line-end-position 0)))&#xA;==&amp;gt; &quot;2015-11-18T16:47:27&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2015-11-18T21:47:54.497" LastActivityDate="2015-11-18T21:47:54.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18213" PostTypeId="2" ParentId="18205" CreationDate="2015-11-18T22:39:44.820" Score="6" Body="&lt;p&gt;Here's a quick custom function definition for your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun which-linux-distribution ()&#xA;  &quot;from lsb_release&quot;&#xA;  (interactive)&#xA;  (when (eq system-type 'gnu/linux)&#xA;     (shell-command-to-string &quot;lsb_release -sd&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then run it as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x which-linux-distribution&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or test for a known distribution, for example, as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (eq which-linux-distribution 'LinuxMint) &#xA;     ....)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for unknown distributions or systems without the &lt;code&gt;lsb_release&lt;/code&gt; tool, &lt;code&gt;which-linux-distribution&lt;/code&gt; returns null, thereby stopping at the &lt;code&gt;when&lt;/code&gt; test.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-11-19T11:04:54.633" LastActivityDate="2015-11-19T11:04:54.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18214" PostTypeId="2" ParentId="18191" CreationDate="2015-11-18T22:40:54.810" Score="3" Body="&lt;p&gt;There's a couple questions you asked, but I'll cover what I can.  Org translates some names beginning with \ into &quot;prettified&quot; versions, as defined in the variable &lt;code&gt;org-entities&lt;/code&gt;, and &lt;code&gt;org-entities-user&lt;/code&gt;.  These define translations for html, latex, and other encodings. I would speculate that more options aren't included since either they aren't commonly used, or have no simple equivalent when exported without latex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, the setting input method to 'TeX allows &quot;LaTeX-like input method for many characters.  These characters are from the charsets used by the &lt;code&gt;utf-8' coding system, including many technical ones.  Examples:\n \\'a -&amp;gt; á  \\&lt;/code&gt;{a} -&gt; à\n \pi -&gt; π  \int -&gt; ∫  ^1 -&gt; ¹&quot; (As described in the variable input-method-alist.)  So basically, this is an easy way to enter unicode characters using latex syntax.  So, for example \frac12 = ½, but \frac79 doesn't have a unicode equivalent, so it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a third option in org-mode, you can use the usual $$ and [] symbols to set up a math environment, which allows full latex syntax, and will even render it as an image (or using mathjax) for html export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to sum up, there are some special names in org-mode beginning with \ that are translated into an appropriate character for the exporter being used. If you need full latex syntax, use a math environment, and it will even be nicely formatted when exporting to non-latex formats.  Lastly  &lt;code&gt;(set-input-method 'TeX)&lt;/code&gt; can be used anywhere to enter unicode characters using latex syntax.  &lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-11-18T22:40:54.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18215" PostTypeId="1" AcceptedAnswerId="18220" CreationDate="2015-11-18T22:51:00.537" Score="4" ViewCount="1801" Body="&lt;p&gt;My goal is to: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generate graph &lt;strong&gt;(with math symbols / equations)&lt;/strong&gt; from org-mode source block.&lt;/li&gt;&#xA;&lt;li&gt;Display result inside buffer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My best attempt was to use &lt;a href=&quot;https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29&quot; rel=&quot;nofollow noreferrer&quot;&gt;dot&lt;/a&gt; and &lt;a href=&quot;http://www.graphviz.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;graphviz&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TzSo0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TzSo0.png&quot; alt=&quot;graph without math formula&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm unable to add math symbol or equation to the graph. &#xA;Which is, to the best of my knowledge, impossible with &lt;a href=&quot;https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29&quot; rel=&quot;nofollow noreferrer&quot;&gt;dot&lt;/a&gt;. - Please correct me if I'm mistaken. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whole process inside Emacs looks like this:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/o2Ko6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o2Ko6.png&quot; alt=&quot;work process&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion is appreciated. &lt;/p&gt;&#xA;" OwnerUserId="6527" LastActivityDate="2015-11-19T11:25:31.860" Title="drawing graph with math formula in org-mode" Tags="|org-babel|images|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18216" PostTypeId="2" ParentId="5719" CreationDate="2015-11-18T23:24:07.120" Score="6" Body="&lt;p&gt;If I understand it correctly, you have a list of subtrees&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A1&#xA;*** A1a&#xA;* B&#xA;** B1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and want to insert them into another subtree&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* First&#xA;** First Sub&#xA;* Second&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at the right level:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* First&#xA;** First Sub&#xA;*** A&#xA;**** A1&#xA;***** A1a&#xA;*** B&#xA;**** B1&#xA;* Second&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As this is Emacs (and org-mode of course), there is a function for this ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use &lt;code&gt;org-paste-subtree&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;save your new list in the kill ring (select and &lt;kbd&gt;M-w&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;li&gt;enter &lt;code&gt;***&lt;/code&gt; after &lt;em&gt;First Sub&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;call &lt;code&gt;org-paste-subtree&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The function is described as &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Paste the clipboard as a subtree, with modification of headline level.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and will work for demoting &lt;strong&gt;and&lt;/strong&gt; promoting the subtree in the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-mode can even be configured to use this style of yank every time a subtree is yanked into a subtree.  Customize the variable &lt;code&gt;org-yank-adjusted-subtrees&lt;/code&gt; and you can use &lt;kbd&gt;C-y&lt;/kbd&gt; instead of &lt;code&gt;org-paste-subtree&lt;/code&gt; in the example above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me this was especially useful when I wanted to promote all subtrees under one toplevel.&lt;/p&gt;&#xA;" OwnerUserId="934" LastActivityDate="2015-11-18T23:24:07.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18217" PostTypeId="2" ParentId="18205" CreationDate="2015-11-19T01:19:18.980" Score="4" Body="&lt;p&gt;There's no real standard method to detect the Linux distribution that a program is running under. Well, actually, there's a &lt;em&gt;de jure&lt;/em&gt; standard: the &lt;a href=&quot;https://refspecs.linuxbase.org/LSB_2.1.0/LSB-generic/LSB-generic/lsbrelease.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;lsb_release&lt;/code&gt;&lt;/a&gt; program. &lt;code&gt;lsb_release -sir&lt;/code&gt; displays the name of the distribution and its version number. However, many Linux systems don't have the &lt;code&gt;lsb_release&lt;/code&gt; program installed. Several distributions don't include it in the default installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;em&gt;you probably don't want to do this&lt;/em&gt;. How will you cope with unknown distributions? Say you have code for Debian and Fedora, and someone creates a new distribution derived from Debian, with its own name: your code wouldn't know that it should use the Debian-specific code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of testing the distribution, test for the behavior that matters. If different distributions put files in different directories, look for the directory that contains the file you want. If different distributions include different packages, check which packages are available. If a distribution has fixed a bug, test whether the bug is present and apply your workaround only if it is, and so on.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-11-19T01:19:18.980" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18218" PostTypeId="2" ParentId="17500" CreationDate="2015-11-19T02:40:38.660" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is it possible to have a link to a specific heading...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. The syntax is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file+emacs:full/path/to/file.org::#UniqueCustom_ID&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where file+emacs ensures emacs opens it another buffer, and the full path to org file gives the filename and org extension. #UniqueCustom_ID comes after the :: to identify the specific heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can look at &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;info:org#External Links&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for other variations and keyboard shortcuts.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-11-19T02:40:38.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18220" PostTypeId="2" ParentId="18215" CreationDate="2015-11-19T03:16:18.413" Score="1" Body="&lt;p&gt;For me the best half-way point between org and LaTeX is unicode. &lt;code&gt;C-x RET C-\&lt;/code&gt;, set the input method to 'tex', and then you can type &lt;code&gt;\in&lt;/code&gt; and have it replaced with &lt;code&gt;∈&lt;/code&gt; in the buffer, no processing needed.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-11-19T03:16:18.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18221" PostTypeId="1" AcceptedAnswerId="18223" CreationDate="2015-11-19T11:22:27.200" Score="6" ViewCount="486" Body="&lt;p&gt;When I search for text in my buffer, the cursor moves to the first occurrence but &lt;em&gt;all&lt;/em&gt; occurrences beyond the first are also lit. E.g. &quot;jumped&quot; in the screenshot below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/J7fPU.png&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/J7fPU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this particular color for the &quot;other&quot; occurrences is very similar to a color used in my Java syntax highlighting and so I would like to customize it to make it stand out more (e.g. perhaps adding a background color too). What do I do that? &lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-11-19T11:50:33.330" Title="how to customize the secondary highlighting in searches" Tags="|isearch|emacs24|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18222" PostTypeId="2" ParentId="18215" CreationDate="2015-11-19T11:25:31.860" Score="2" Body="&lt;p&gt;For just a few symbols or equations, you can embed latex code with \codes directly in an org file and then use a latex export backend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the ultimate in fine-grained layout control, use &lt;a href=&quot;http://www.ctan.org/pkg/dot2texi&quot; rel=&quot;nofollow&quot;&gt;dot2texi tool&lt;/a&gt; to &lt;a href=&quot;http://www.alessandrovermeulen.me/2013/07/08/combining-graphviz-dot-and-tikz-with-dot2tex/&quot; rel=&quot;nofollow&quot;&gt;wrap dot code&lt;/a&gt; in latex and then embed that in a &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html&quot; rel=&quot;nofollow&quot;&gt;latex source code block&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-11-19T11:25:31.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18223" PostTypeId="2" ParentId="18221" CreationDate="2015-11-19T11:38:22.883" Score="4" Body="&lt;p&gt;You can change the lazy-highlight face:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-faces&#xA;  `(lazy-highlight ((t (:foreground &quot;white&quot; :background &quot;SteelBlue&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this face is used in other cases.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-11-19T11:50:33.330" LastActivityDate="2015-11-19T11:50:33.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18224" PostTypeId="2" ParentId="18051" CreationDate="2015-11-19T13:05:45.707" Score="0" Body="&lt;p&gt;Seems that i simply did not enable Spacemacs's own &lt;code&gt;shell&lt;/code&gt; layer. This is what i have now in &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell :variables&#xA;             shell-default-height 30&#xA;             shell-default-position 'bottom&#xA;             shell-default-shell 'multi-term)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this configuration, &lt;code&gt;Tab&lt;/code&gt; works as &lt;code&gt;Tab&lt;/code&gt;, even when though it's remapped to &lt;code&gt;Esc&lt;/code&gt; in my configuration as shown in the question. Which seems nice.&lt;/p&gt;&#xA;" OwnerUserId="9419" LastActivityDate="2015-11-19T13:05:45.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18225" PostTypeId="1" CreationDate="2015-11-19T13:13:04.087" Score="0" ViewCount="40" Body="&lt;p&gt;I'm using Spacemacs and multi-term on OS X 10.11. Preferred shell in zsh with oh-my-zsh installed.&lt;/p&gt;&#xA;&lt;p&gt;In the Spacemacs shell window, there are two weird UI issues:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Command line never scrolls to the bottom, so that i always several empty lines in the bottom of the buffer.&lt;/li&gt;&#xA;&lt;li&gt;Command prompt has got weird &lt;code&gt;4m&lt;/code&gt; symbols prepended (&lt;strong&gt;UPDATE:&lt;/strong&gt; per lunaryorn's comment, this got fixed by adding &lt;code&gt;export TERM=xterm-256color&lt;/code&gt; to &lt;code&gt;.zshrc&lt;/code&gt;. Previously &lt;code&gt;echo $TERM&lt;/code&gt; yielded &lt;code&gt;eterm&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Both issues are visible in the screenshot attached. Does anyone know how to address these?&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ro7Qt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ro7Qt.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9419" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-11-19T14:27:56.153" Title="UI issues in Spacemacs shell" Tags="|shell|spacemacs|" AnswerCount="0" CommentCount="4" ClosedDate="2015-11-20T01:26:58.437" ContentLicense="CC BY-SA 3.0" />
  <row Id="18229" PostTypeId="1" CreationDate="2015-11-19T13:57:38.313" Score="4" ViewCount="256" Body="&lt;p&gt;I have set Emacs to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Appointments.html&quot; rel=&quot;noreferrer&quot;&gt;alert&lt;/a&gt; me via a &lt;code&gt;window&lt;/code&gt; 30 minutes before an appointment. This is working as expected. However, every three minutes thereafter, Emacs continues to alert me to the same appointment. How do I dismiss/acknowledge the reminder and prevent it from triggering repeatedly?&lt;/p&gt;&#xA;" OwnerUserId="5345" LastActivityDate="2023-04-13T08:01:35.200" Title="Dismiss diary appointment alert" Tags="|calendar|diary|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18230" PostTypeId="1" CreationDate="2015-11-19T14:24:36.960" Score="1" ViewCount="33" Body="&lt;p&gt;What determines the shape of the result of a vector mapping (&lt;code&gt;V M&lt;/code&gt;)?  I had thought it was directly based on the shape of the input, but have a look at this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;k f&lt;/code&gt; factors an integer, returning a vector of its prime factors.  Given a vector of &lt;em&gt;n&lt;/em&gt; integers,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[27 31 33]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;V M k f&lt;/code&gt; will factor all of them, yielding&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[3, 3, 3], [31], [3, 11]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is what I'd expect.  But if all of them are primes, for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[31, 37, 41]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the output of &lt;code&gt;V M k f&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ [ 31 ]&#xA;  [ 37 ]&#xA;  [ 41 ] ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The shape (&lt;code&gt;H v l&lt;/code&gt;) of the first result is &lt;code&gt;[3]&lt;/code&gt;; the shape of the second result is &lt;code&gt;[3, 1]&lt;/code&gt;.  Why?&lt;/p&gt;&#xA;" OwnerUserId="321" LastActivityDate="2015-11-19T14:24:36.960" Title="Calc vector mapping: shape of result" Tags="|calc|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18231" PostTypeId="2" ParentId="18229" CreationDate="2015-11-19T15:01:00.467" Score="1" Body="&lt;p&gt;&lt;code&gt;M-x appt-delete&lt;/code&gt; is a possibility to delete entries from the appointment list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also (info &quot;(emacs) Appointments&quot;).&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2015-11-19T15:01:00.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18232" PostTypeId="1" AcceptedAnswerId="18234" CreationDate="2015-11-19T16:25:01.690" Score="1" ViewCount="49" Body="&lt;p&gt;This code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-dateutc.* ()&#xA;  (interactive)&#xA;  (insert (with-temp-buffer&#xA;            (call-process &quot;date&quot; nil t nil &quot;+%Y-%m-%dT%H:%M:%S&quot;)&#xA;            (buffer-substring-no-properties 1 (line-end-position 0)))))&#xA;&#xA;(defun insert-random-uuid.* ()&#xA;  (interactive)&#xA;  (with-temp-buffer&#xA;    (call-process &quot;uuidgen&quot; nil t nil)&#xA;    (buffer-substring-no-properties 1 (line-end-position 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works stand-alone, but when stuck into this code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (insert (format &quot;'(start-symbol :id %s&#xA;               :graph &#xA;               :ts %s&#xA;               :0.0 &#xA;               :1.0 &#xA;               )&quot; (insert-random-uuid.*) (insert-dateutc.*))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;produces this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2015-11-19T16:07:38'(start-symbol :id 9c5a8a91-325a-44d1-8535-03afc10f405a&#xA;               :graph &#xA;               :ts nil&#xA;               :0.0 &#xA;               :1.0 &#xA;               )nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, it's sticking the formatted date outside the &lt;code&gt;format&lt;/code&gt; output. I can only assume that I'm going to the &lt;code&gt;buffer-substring-no-properties&lt;/code&gt; too many times, or it needs to be reset or something. An earlier version that simply did this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (insert (format &quot;'(start-symbol :id %s&#xA;               :graph &#xA;               :ts %s&#xA;               :0.0 &#xA;               :1.0 &#xA;               )&quot; (insert-random-uuid.*) (format-time-string &quot;%Y-%m-%dT%H:%M:%S&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;played well with &lt;code&gt;insert-random-uuid.*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(start-symbol :id 2bfebed2-82c3-4ccb-b9f3-84b82a421e06&#xA;               :graph &#xA;               :ts 2015-11-19T16:21:39&#xA;               :0.0 &#xA;               :1.0 &#xA;               )nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure what the problem is. . . .&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:42:20.760" LastActivityDate="2016-03-14T04:42:20.760" Title="must clear insert buffer-string?" Tags="|insert|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18233" PostTypeId="2" ParentId="18179" CreationDate="2015-11-19T16:46:27.177" Score="10" Body="&lt;p&gt;Your first problem is that &lt;code&gt;org-agenda-filter-by-tag&lt;/code&gt; is a function.  Interactively, this will apply a filter, but in an agenda command like this, you're just assigning a value to it as a variable.  Since functions and variables are in different namespaces, this doesn't cause an error, but it doesn't do anything either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the variable you do want, &lt;code&gt;org-agenda-tag-filter-preset&lt;/code&gt;, is designed to work agenda-wide and can't be usefully set per-block (see the footnote for &lt;a href=&quot;http://orgmode.org/manual/Filtering_002flimiting-agenda-items.html&quot; rel=&quot;noreferrer&quot;&gt;this manual entry&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're okay with having the filter set for the whole agenda, your command should look like this (and I apologize for changing your indentation setup):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(&quot;h&quot; &quot;thing TODO at Home&quot;&#xA; ((tags-todo &quot;+dailies+SCHEDULED&amp;lt;=\&quot;&amp;lt;today&amp;gt;+1\&quot;&quot;)&#xA;  (agenda &quot;&quot; ((org-agenda-ndays 1)&#xA;              (org-agenda-sorting-strategy&#xA;               (quote ((agenda time-up priority-down tag-up))))&#xA;              (org-deadline-warning-days 0)))&#xA;  (tags &quot;reading&quot;)&#xA;  (tags &quot;writing&quot;)&#xA;  (tags-todo &quot;REFILE&quot;))&#xA; ((org-agenda-tag-filter-preset '(&quot;-work&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want work tasks to show up in your &lt;code&gt;tags&lt;/code&gt; and &lt;code&gt;tags-todo&lt;/code&gt; blocks, you can use skip functions instead.  For some reason, there is no out-of-the-box skip function for tag filtering, but I wrote one for &lt;a href=&quot;https://stackoverflow.com/a/33444799/5030424&quot;&gt;this answer&lt;/a&gt;; with that code, your agenda command should look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(&quot;h&quot; &quot;thing TODO at Home&quot;&#xA; ((tags-todo &quot;+dailies+SCHEDULED&amp;lt;=\&quot;&amp;lt;today&amp;gt;+1\&quot;&quot;)&#xA;  (agenda &quot;&quot; ((org-agenda-ndays 1)&#xA;              (org-agenda-skip-function&#xA;               '(my/org-agenda-skip-without-match &quot;-work&quot;))&#xA;              (org-agenda-sorting-strategy&#xA;               (quote ((agenda time-up priority-down tag-up))))&#xA;              (org-deadline-warning-days 0)))&#xA;  (tags &quot;reading&quot;)&#xA;  (tags &quot;writing&quot;)&#xA;  (tags-todo &quot;REFILE&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-11-20T15:04:09.047" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18234" PostTypeId="2" ParentId="18232" CreationDate="2015-11-19T16:54:22.580" Score="4" Body="&lt;p&gt;If your function inserts text into a buffer, it should be called &lt;code&gt;insert-something&lt;/code&gt; and its return value should &lt;em&gt;not&lt;/em&gt; be passed to &lt;code&gt;format&lt;/code&gt; and friends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e., rename &lt;code&gt;insert-random-uuid.*&lt;/code&gt; to &lt;code&gt;get-random-uuid.*&lt;/code&gt; and &lt;code&gt;insert-dateutc.*&lt;/code&gt; to &lt;code&gt;get-dateutc.*&lt;/code&gt; and remove the &lt;code&gt;insert&lt;/code&gt; call from the latter.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-11-19T16:54:22.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18236" PostTypeId="1" AcceptedAnswerId="18237" CreationDate="2015-11-19T19:03:50.320" Score="3" ViewCount="278" Body="&lt;p&gt;I find I can create bullets with the - and + both. How can I decide when to use + and -&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="454" LastEditDate="2015-11-19T22:40:40.173" LastActivityDate="2015-11-19T22:40:40.173" Title="What's difference between + and - in the list in org mode" Tags="|org-mode|list|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18237" PostTypeId="2" ParentId="18236" CreationDate="2015-11-19T19:11:20.687" Score="10" Body="&lt;p&gt;They make no difference, they are just a style of bullet and have no meaning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many different bullet types you can use, for sorted and non-sorted lists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;org-shiftright&lt;/code&gt; (&lt;kbd&gt;s-right&lt;/kbd&gt;) and &lt;code&gt;org-shiftleft&lt;/code&gt; (&lt;kbd&gt;s-left&lt;/kbd&gt;) to cycle through bullet types to see them all. It is up to you to decide which one you would like to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the docs of &lt;code&gt;org-cycle-list-bullet&lt;/code&gt; to see all possible bullet types.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2015-11-19T19:11:20.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18238" PostTypeId="1" CreationDate="2015-11-19T19:27:26.023" Score="1" ViewCount="838" Body="&lt;p&gt;GNU Emacs 24.5.1 (i686-pc-mingw32) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode version 8.2.10 (release_8.2.10 @ e:/emacs/share/emacs/24.5/lisp/org/)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my org file,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. one thing&#xA;   #+begin_src sh&#xA;   ls -la&#xA;   #+end_src&#xA;2. second thing&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I export html, it shows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;&lt;p&gt;one thing&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;ls -la&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;  &#xA;  &lt;p&gt;1 second thing&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This happens when I use Yasnippet, some lines can't be indent. &#xA;For example, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src dot :file xx :cmdline -Tpdf :exports none :results silent&#xA; sss&#xA;#+end_src &#xA;[[file:xx]] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;[[file:xx]]&lt;/code&gt; can't forcely indent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update-2015-12-9&lt;/strong&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Bnl3G.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Bnl3G.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="9923" LastEditDate="2015-12-09T22:46:35.550" LastActivityDate="2019-04-10T01:25:46.697" Title="How to continue giving list number after insert a block of code" Tags="|org-mode|code-folding|list|" AnswerCount="2" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="18241" PostTypeId="1" AcceptedAnswerId="18246" CreationDate="2015-11-19T20:50:05.603" Score="2" ViewCount="829" Body="&lt;p&gt;Last time I saw a screenshot of &lt;code&gt;Emacs-nav&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yfnwJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yfnwJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA; /// My attention was directly shifted to the left corner in the bottom, called &quot;Quickjumps&quot;. I assume this is sort of bookmark list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I open Dired, I often find myself switching between various directories, before I land on the directory that I want. So the idea of integrating frequently directories in your file explorer find I very neat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When googling around, it seems there is no any option to integrate a sort of bookmark/quickjump in the Dired buffer? I'm open for any suggestion in this case.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2023-01-18T17:23:17.833" Title="How integrate quickjumps/bookmarks in Dired window?" Tags="|dired|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18242" PostTypeId="1" AcceptedAnswerId="18243" CreationDate="2015-11-19T21:03:05.067" Score="4" ViewCount="285" Body="&lt;p&gt;ace-window numbers windows for selection by the user (&lt;code&gt;ace-select-window&lt;/code&gt;, &lt;code&gt;ace-swap-window&lt;/code&gt;, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this identification scheme be replaced with alphabetic / alpha-numeric identifiers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rationale is: letters are generally slightly easier to type, so I'd like to use letters. &lt;em&gt;(at least before numbers; what kind of user has more than 26 windows open?!? :-)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2015-11-19T21:15:14.237" LastActivityDate="2015-11-21T13:19:24.370" Title="Customizing ace-window to use letters instead of numbers" Tags="|window|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18243" PostTypeId="2" ParentId="18242" CreationDate="2015-11-19T21:22:02.550" Score="5" Body="&lt;p&gt;From the &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;noreferrer&quot;&gt;manual:&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;h1&gt;aw-keys&lt;/h1&gt;&#xA;&lt;p&gt;&lt;em&gt;aw-keys&lt;/em&gt; - the sequence of leading characters for each window:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;aw-keys&lt;/em&gt; are 0-9 by default, which is reasonable, but in the setup above, the keys are on the home row.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-11-19T21:22:02.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18244" PostTypeId="2" ParentId="18184" CreationDate="2015-11-19T21:49:35.047" Score="6" Body="&lt;p&gt;Here is a one-off command you can use to yank the each line of the current kill on the end of each subsequent line, starting on the current line.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun yank-append-lines (&amp;amp;optional without-space)&#xA;  &quot;Yank each line of the current kill at the end of each subsequent line.&#xA;&#xA;A space will be added between each line unless WITHOUT-SPACE which can&#xA;be passed in via a prefix arg.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (save-excursion&#xA;    (let ((lines (split-string (current-kill 0) &quot;\n&quot;)))&#xA;      (dolist (line lines)&#xA;        (goto-char (line-end-position))&#xA;        (unless without-space&#xA;          (just-one-space))&#xA;        (insert line)&#xA;        (unless (zerop (forward-line))&#xA;          (insert &quot;\n&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The implementation is fairly simple. Take the &lt;code&gt;current-kill&lt;/code&gt;, split it by line. Then for each split line: go to the end of the split line, insert a space, insert a line then move forward one line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could also be done with a repeatable macro that moves a line from one place in the buffer to the end of a line in another part of the buffer.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-11-19T22:02:02.163" LastActivityDate="2015-11-19T22:02:02.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18245" PostTypeId="1" CreationDate="2015-11-19T23:59:56.427" Score="7" ViewCount="835" Body="&lt;p&gt;I am working with Emacs on Cygwin, which actually has 3 types of Emacsen:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Win32 Emacs, which is a graphical Emacs compiled to use native Windows GUI (so no X windows is required)&lt;/li&gt;&#xA;&lt;li&gt;Terminal Emacs, which displays in the mintty terminal by default&lt;/li&gt;&#xA;&lt;li&gt;X Windows Emacs (requires X, and not relevant to this question)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am trying to bind the APPS key (the one with the little menu on it, usually to the right of the right-hand Windows key, I think it is properly known as the MENU key, &lt;a href=&quot;https://en.wikipedia.org/wiki/Menu_key&quot; rel=&quot;noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Menu_key&lt;/a&gt;) to the &quot;super&quot; modifier (gotta love those short key sequences). In Win32 Emacs this is pretty easy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (equal window-system 'w32)&#xA;    (setq w32-pass-apps-to-system nil&#xA;          w32-apps-modifier 'super))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This makes Emacs treat APPS as super and stops it passing it onto the OS. It then becomes trivial to make bindings such as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;s-r&quot;) 'recentf-open-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Problem&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;How to make terminal mode Emacs also treat APPS as super? Firstly it was necessary to have mintty changed to pass through the APPS key to Emacs; this has been done already by the maintainer (see &lt;a href=&quot;https://github.com/mintty/mintty/issues/494&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/mintty/mintty/issues/494&lt;/a&gt;) and we can now configure mintty to send any escape sequence we want through to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said in the issue, the initial suggestion of &lt;code&gt;Key_Menu=29&lt;/code&gt; (which results in &lt;code&gt;ESC [ 2 9 ~&lt;/code&gt; appearing in the &lt;code&gt;view-lossage&lt;/code&gt; log), appears to be interpreted by Emacs as the &quot;&amp;lt;print&amp;gt;&quot; key, so that I can succesfully bind using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;print&amp;gt; r&quot;) 'recentf-open-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above, while it is a great advance, is not ideal because 2 sets of bindings would be required, one for terminal mode and one for graphical windowed mode.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Things that I don't know&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How does Emacs translate a sequence of input characters into a logical key?&lt;/li&gt;&#xA;&lt;li&gt;Why does terminal Emacs think the ESC 29 sequence is the print key?&lt;/li&gt;&#xA;&lt;li&gt;Does terminal Emacs even know about the APPS key?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How can I configure W32 Emacs and terminal Emacs so that they both treat APPS/MENU as the &lt;code&gt;super&lt;/code&gt; modifier, thus enabling a single set of keybindings to be used in both cases?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10231" LastEditorUserId="10231" LastEditDate="2015-11-22T11:06:26.700" LastActivityDate="2015-11-22T17:43:28.923" Title="Making terminal Emacs treat APPS (aka MENU) key as super modifier" Tags="|key-bindings|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18246" PostTypeId="2" ParentId="18241" CreationDate="2015-11-20T00:01:10.940" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can &lt;em&gt;bookmark a Dired buffer&lt;/em&gt;.  Bookmarks are typically persistent, which means that you can return to them in another Emacs session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then a Dired bookmark records also which subdirs are inserted, as well as the current omissions and markings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could easily arrange to bookmark any Dired buffers you are visiting when you quit Emacs.  Or bookmark all Dired buffers that you visit.  You could also arrange to cull these according to bookmark-created date, so you would, in effect, keep only the most recent.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you insist on having the recent entries not in a bookmark-list buffer but in a Dired buffer, then remember that a Dired buffer need not show only a given directory and its subdirectories. It can show any set of files and directories, from anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, you can create a Dired listing that includes arbitrary files (and directories). You would only need to manage it (e.g. add/keep only recently accessed files/dirs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way to get a Dired buffer with an arbitrary list of files is to provide a cons argument to &lt;code&gt;dired&lt;/code&gt; as its first arg - see the doc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then you can easily add files and dirs to an existing Dired buffer - see commands &lt;code&gt;diredp-add-to-dired-buffer&lt;/code&gt; (&lt;code&gt;C-x E&lt;/code&gt; in Dired) and &lt;code&gt;diredp-add-to-this-dired-buffer&lt;/code&gt;. So you can easily add any recent files to any existing Dired buffer.  See also command &lt;code&gt;diredp-dired-union&lt;/code&gt; (&lt;code&gt;C-x D&lt;/code&gt; in Dired).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could easily have one Dired buffer for only recent stuff, and you could add that, as a union, to any other Dired buffers.  Or just add the recent stuff to any Dired buffer, without having a separate Dired buffer for just the recent stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of possibilities. The key is to know how to tell Dired to show an arbitrary list of files/dirs.  That is little known and hardly documented. And with vanilla Dired there is no way to take advantage of it interactively - no commands that let you add files to a Dired listing or to create a union of existing Dired buffers. &lt;strong&gt;Dired+&lt;/strong&gt; makes it easy to do these kinds of things.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-20T17:08:46.543" LastActivityDate="2015-11-20T17:08:46.543" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18247" PostTypeId="1" AcceptedAnswerId="18249" CreationDate="2015-11-20T03:25:24.897" Score="0" ViewCount="96" Body="&lt;p&gt;When I add some lisp program in the init.el.  I don't want to restart emacs in order to make effect.  Then how can I do that?&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2015-11-20T06:07:40.283" Title="How can I make the lisp function immediately take effect?" Tags="|init-file|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18248" PostTypeId="2" ParentId="18247" CreationDate="2015-11-20T03:57:09.227" Score="2" Body="&lt;p&gt;Evaluate it: call it with its arguments, using, for example &lt;code&gt;C-x C-e&lt;/code&gt;. If the function &lt;code&gt;foo&lt;/code&gt; takes arguments &lt;code&gt;arg1&lt;/code&gt; and &lt;code&gt;arg2&lt;/code&gt;, type &lt;code&gt;(foo arg1 arg2)&lt;/code&gt;, put the cursor after &lt;code&gt;)&lt;/code&gt;, and hit &lt;code&gt;C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you are going to use some Emacs Lisp you really should start to read the Intro to Emacs Lisp manual - use &lt;code&gt;C-h i&lt;/code&gt; then choose &lt;code&gt;Emacs Lisp Intro&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-20T03:57:09.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18249" PostTypeId="2" ParentId="18247" CreationDate="2015-11-20T04:10:18.627" Score="2" Body="&lt;p&gt;In addition to Drew's answer, if you add more than one expression, and don't want to have to evaluate them all individually, there's &lt;code&gt;eval-region&lt;/code&gt;. Its docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Execute the region as Lisp code.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Select the region (move point to before the first expression, press &lt;code&gt;C-space&lt;/code&gt;, move point to after the expression), then run &lt;code&gt;M-x eval-region&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-11-20T04:10:18.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18250" PostTypeId="2" ParentId="18247" CreationDate="2015-11-20T06:07:40.283" Score="1" Body="&lt;p&gt;If your function has defvar or defcustom and you want those reset as part of the eval, then consider C-M-x (eval-defun). A plain eval will not reset previous values of the defvars, if any.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-11-20T06:07:40.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18251" PostTypeId="1" CreationDate="2015-11-20T06:54:48.877" Score="0" ViewCount="520" Body="&lt;p&gt;I'm having a real hard time getting the paredit slurp key to work. I know it is bound to &lt;code&gt;C-)&lt;/code&gt;, and by describing the &lt;code&gt;paredit-slurp-forward-sexp&lt;/code&gt; it confirms that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I fire up &lt;code&gt;M-x describe-key&lt;/code&gt; and try to type &lt;code&gt;C-)&lt;/code&gt; (that is, press and hold control, press shift, and press &lt;code&gt;)&lt;/code&gt;) the describer only registers the &lt;code&gt;)&lt;/code&gt; part and trys to execute &lt;code&gt;paredit-close-round&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know slurp works because if I &lt;code&gt;M-x paredit-slurp-forward-sexp&lt;/code&gt; it works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I not using this hotkey right? It seems like it should be working fine.&lt;/p&gt;&#xA;" OwnerUserId="10194" LastActivityDate="2015-11-20T06:54:48.877" Title="Paredit slurp hotkey doesnt work" Tags="|key-bindings|paredit|" AnswerCount="0" CommentCount="3" ClosedDate="2019-01-16T06:38:42.453" ContentLicense="CC BY-SA 3.0" />
  <row Id="18252" PostTypeId="1" AcceptedAnswerId="18268" CreationDate="2015-11-20T07:48:16.313" Score="4" ViewCount="145" Body="&lt;p&gt;Given that the cell has already some string values filled in and the cursor is located somewhere at the middle of the cell.&#xA;How to quickly move cursor the the first/last char of the very same cell? I know C-a, C-e but it has scope of the whole line instead of one cell.&lt;/p&gt;&#xA;" OwnerUserId="9570" LastActivityDate="2015-11-21T00:44:55.767" Title="quickly go to begin or end of the cell in org table" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18253" PostTypeId="1" AcceptedAnswerId="18254" CreationDate="2015-11-20T10:14:46.673" Score="16" ViewCount="6574" Body="&lt;p&gt;I am frequently prompted when updating my current packages to run package-autoremove which claims to remove outdated or unnecessary packages. However it always seems to remove (along with those outdated packages) two packages which I do use (namely aurora-theme, my current theme of choice and dired+).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm afraid I'm something of a novice when it comes to Emacs-Lisp and I was just wondering if there was a way I could stop package autoremove deleting these packages so I didn't need to keep reinstalling them.&lt;/p&gt;&#xA;" OwnerUserId="10235" LastEditorUserId="105" LastEditDate="2016-03-14T04:41:45.227" LastActivityDate="2016-03-14T04:41:45.227" Title="How does package-autoremove decide which packages to remove?" Tags="|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18254" PostTypeId="2" ParentId="18253" CreationDate="2015-11-20T10:22:20.750" Score="7" Body="&lt;p&gt;The source is here: &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/package.el#L2113&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/package.el#L2113&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It deletes all packages that is not in package-selected-packages nor a dependency.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun package-autoremove ()&#xA;&quot;Remove packages that are no more needed.&#xA;        Packages that are no more needed by other packages in&#xA;        `package-selected-packages' and their dependencies&#xA;        will be deleted.&quot;&#xA;(interactive)&#xA;;; If `package-selected-packages' is nil, it would make no sense to&#xA;;; try to populate it here, because then `package-autoremove' will&#xA;;; do absolutely nothing.&#xA;(when (or package-selected-packages&#xA;            (yes-or-no-p&#xA;            (format-message&#xA;            &quot;`package-selected-packages' is empty! Really remove ALL packages? &quot;)))&#xA;    (let ((removable (package--removable-packages)))&#xA;    (if removable&#xA;        (when (y-or-n-p&#xA;                (format &quot;%s packages will be deleted:\n%s, proceed? &quot;&#xA;                        (length removable)&#xA;                        (mapconcat #'symbol-name removable &quot;, &quot;)))&#xA;            (mapc (lambda (p)&#xA;                    (package-delete (cadr (assq p package-alist)) t))&#xA;                removable))&#xA;        (message &quot;Nothing to autoremove&quot;)))))&#xA;&#xA;(defun package--removable-packages ()&#xA;  &quot;Return a list of names of packages no longer needed.&#xA;These are packages which are neither contained in&#xA;`package-selected-packages' nor a dependency of one that is.&quot;&#xA;  (let ((needed (cl-loop for p in package-selected-packages&#xA;                         if (assq p package-alist)&#xA;                         ;; `p' and its dependencies are needed.&#xA;                         append (cons p (package--get-deps p)))))&#xA;    (cl-loop for p in (mapcar #'car package-alist)&#xA;             unless (memq p needed)&#xA;             collect p)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10236" LastEditorUserId="10236" LastEditDate="2015-11-20T10:27:52.853" LastActivityDate="2015-11-20T10:27:52.853" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18255" PostTypeId="2" ParentId="14890" CreationDate="2015-11-20T11:34:32.667" Score="4" Body="&lt;p&gt;If you find the text to be &lt;strong&gt;unusually&lt;/strong&gt; bold, reducing font smoothing might help as a workaround, with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defaults write org.gnu.Emacs AppleFontSmoothing -int 1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do this globally, with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defaults -currentHost write -globalDomain AppleFontSmoothing -int 1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my understanding, OS X uses a sub-pixel antialiasing algorithm that many finds to render light text on dark backgrounds too bold. I have found it to affect Emacs in a greater extent than other applications, like Xcode. Interestingly, font bolding does not appear to affect Terminal, hence you &lt;em&gt;can&lt;/em&gt; run emacs in cli mode with the desired font.&lt;/p&gt;&#xA;" OwnerUserId="10237" LastEditorUserId="10237" LastEditDate="2015-11-20T18:32:58.973" LastActivityDate="2015-11-20T18:32:58.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18256" PostTypeId="1" CreationDate="2015-11-20T14:13:13.383" Score="2" ViewCount="269" Body="&lt;p&gt;I want to use &lt;a href=&quot;https://github.com/kinjo/org-impress-js.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/kinjo/org-impress-js.el&lt;/a&gt; with emacs-25.1 and the last org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (eval-after-load &quot;org&quot;&#xA;    '(progn&#xA;       (add-to-list 'load-path &quot;~/.emacs.d/org-impress-js.el&quot;)&#xA;       (require 'ox-impress-js)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I want to export (C-c C-e j j) I got the message: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-impress-js-section: Symbol’s function definition is void:&#xA;  org-export-get-headline-id&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="591" LastEditDate="2016-06-20T05:09:56.403" LastActivityDate="2024-01-09T11:07:30.947" Title="problem with org-impress export" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18257" PostTypeId="1" CreationDate="2015-11-20T14:33:58.330" Score="0" ViewCount="386" Body="&lt;p&gt;I use org-mode for a lot of things, but two of them are now in conflict. The two use cases are (1) drafting assignments and exporting to LaTeX and (2) tracking my reference library using RefTeX. My default system PDF reader is Acrobat, which is great for reading and annotating PDFs. However, it's not so great when you're exporting from org to LaTeX, because it locks the file, meaning you have to close it to redo the export. Recently I added the following lines to my configuration on Windows to use SumatraPDF instead, because it allows for live updates of the file without closing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; '(org-file-apps&#xA;   (quote&#xA;    ((auto-mode . emacs)&#xA;     (&quot;\\.mm\\'&quot; . default)&#xA;     (&quot;\\.x?html?\\'&quot; . default)&#xA;     (&quot;\\.pdf\\'&quot; . &quot;C:/SumatraPDF/SumatraPDF.exe %s&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The issue is that when I open PDF links from my reference library, they now (of course) open in SumatraPDF, when I would rather be using Acrobat, the system default. Is there a way to either (a) select a different PDF viewer only for org-mode exports or (b) specify to use the default PDF viewer when opening links from my reference notes file?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2015-11-20T14:33:58.330" Title="Separate org-file-apps for export" Tags="|org-mode|microsoft-windows|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18258" PostTypeId="2" ParentId="18208" CreationDate="2015-11-20T15:25:15.223" Score="1" Body="&lt;p&gt;Not really an Emacs related problem but, one of the solution could be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;create a SUM of your .org file, &lt;/li&gt;&#xA;&lt;li&gt;then create an encrypted signature of the SUM file, named SUM.sign, &lt;/li&gt;&#xA;&lt;li&gt;and finally, share the 3 files whenever necessary&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That way, your .org file will stay the same. &lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-11-20T16:27:27.980" LastActivityDate="2015-11-20T16:27:27.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18259" PostTypeId="1" CreationDate="2015-11-20T15:47:21.767" Score="4" ViewCount="115" Body="&lt;p&gt;The default &quot;command character&quot; for GNU-screen is &lt;code&gt;C-a&lt;/code&gt;, which collides with the default key combination for &lt;code&gt;move-beginning-of-line&lt;/code&gt; in Emacs, and for the analogous command of many other interfaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is difficult to find an alternative command character for GNU-screen that does not collide with some common Emacs binding.  And for users of org-mode the problem is considerably worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figure that there must be enough users of both GNU-screen and org-mode (and also of Emacs, of course) for there to be a widely accepted solution to this problem.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorDisplayName="user227" LastEditDate="2015-11-20T16:49:08.463" LastActivityDate="2015-11-21T06:46:20.367" Title="What is an Emacs- and org-friendly &quot;command character&quot; for GNU Screen?" Tags="|org-mode|key-bindings|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18260" PostTypeId="2" ParentId="18259" CreationDate="2015-11-20T17:10:26.727" Score="0" Body="&lt;p&gt;&lt;code&gt;C-b&lt;/code&gt; is only used for &lt;code&gt;backward-char&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-20T17:10:26.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18262" PostTypeId="1" AcceptedAnswerId="18305" CreationDate="2015-11-20T19:11:34.960" Score="5" ViewCount="1525" Body="&lt;p&gt;I'm using Magit over Tramp and my git push commands fail because tramp doesn't forward my ssh-agent to the remote machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In pseudo code, it looks like I need to do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tramp-methods[&quot;ssh&quot;][tramp-login-args].prepend( (&quot;-A&quot;) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I do this without copy/pasting the entire &lt;code&gt;tramp-methods&lt;/code&gt; variable into my emacs init file? Or is there a better way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2240" LastEditorUserId="306" LastEditDate="2015-11-24T12:21:17.153" LastActivityDate="2020-02-05T13:41:29.690" Title="Tramp: how to add (-A) agent forwarding to ssh connections?" Tags="|tramp|ssh|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18263" PostTypeId="1" CreationDate="2015-11-20T19:26:47.893" Score="5" ViewCount="229" Body="&lt;p&gt;I would like to use both &lt;a href=&quot;https://github.com/dholm/tabbar&quot; rel=&quot;nofollow&quot;&gt;tabbar-mode&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/semantic/Sticky-Func-Mode.html&quot; rel=&quot;nofollow&quot;&gt;global-semantic-stickyfunc-mode&lt;/a&gt; at the same time.  Both of these use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Header-Lines.html&quot; rel=&quot;nofollow&quot;&gt;header line&lt;/a&gt;.  When I try to enable them both, one of them &quot;wins&quot; and I don't get the other.  Is it possible to get them to both work at the same time?&lt;/p&gt;&#xA;" OwnerUserId="6898" LastEditorUserId="105" LastEditDate="2015-12-19T21:55:48.393" LastActivityDate="2015-12-19T21:55:48.393" Title="Multiple header lines for different modes?" Tags="|header-line|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18264" PostTypeId="2" ParentId="18259" CreationDate="2015-11-20T21:53:02.893" Score="6" Body="&lt;p&gt;Not sure how widely accepted this is, but &lt;kbd&gt;C-z&lt;/kbd&gt; works reasonably well. By default in emacs that is bound to &lt;code&gt;suspend-frame&lt;/code&gt;, and shell uses it for suspend/background task. Emacs also binds &lt;kbd&gt;C-x C-z&lt;/kbd&gt; to &lt;code&gt;suspend-frame&lt;/code&gt; so there is another binding anyway. If &lt;code&gt;escape ^Zz&lt;/code&gt; is set for screen, &lt;kbd&gt;C-z z&lt;/kbd&gt; will send a &lt;kbd&gt;C-z&lt;/kbd&gt; to the nested process to background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also works for tmux with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set -g prefix C-z                                                                                         &#xA;unbind C-b                                                                                                &#xA;bind C-z send-prefix    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For tmux this means sending &lt;kbd&gt;C-z&lt;/kbd&gt; to a nested application can be accomplished with &lt;kbd&gt;C-z C-z&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some additional reasons why &lt;kbd&gt;C-z&lt;/kbd&gt; is a good idea:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;suspend is a means of multi-tasking in a single shell session, whereas default workflow in screen/tmux is to open a new nested shell.&lt;/li&gt;&#xA;&lt;li&gt;suspend is still available but only one extra keystroke away (which befits the frequency of it's use for my workflow)&lt;/li&gt;&#xA;&lt;li&gt;It's an easy single hand binding (which might not be great for RSI) but makes it easier to use one-handed (if eating or mostly reading).&lt;/li&gt;&#xA;&lt;li&gt;In most other contexts it's bound to &lt;code&gt;undo&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="104" LastActivityDate="2015-11-20T21:53:02.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18265" PostTypeId="1" CreationDate="2015-11-20T22:54:17.127" Score="6" ViewCount="2733" Body="&lt;p&gt;When running &lt;code&gt;M-x pdb&lt;/code&gt; from Emacs, the current directory seems to be set to that of the directory of the script you are running, so &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pdb ~/path/to/project/__main__.py&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would set the working directory to &lt;code&gt;~/path/to/project/&lt;/code&gt;. However, what if I need the working directory to be a different directory - say, one directory back? Is there a way to set the directory that pdb/gud uses as the &quot;working directory&quot;? At the first &lt;code&gt;pdb&lt;/code&gt; prompt I can change the directory with &lt;code&gt;os.chdir()&lt;/code&gt;, which works, but I would like to not have to do this every time. Thank you!&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I have found that one potential solution would be to set &lt;code&gt;gud-chdir-before-run&lt;/code&gt; (mentioned by @Nsukami_ below) to &lt;code&gt;nil&lt;/code&gt; and then change to the desired directory with &lt;code&gt;(cd &quot;/path/to/directory&quot;)&lt;/code&gt;  before running &lt;code&gt;pdb&lt;/code&gt;. I tried doing this with the &lt;code&gt;gud-mode-hook&lt;/code&gt; but the directory is changed too late. I have also, tried to do this with by advising &lt;code&gt;pdb&lt;/code&gt; and &lt;code&gt;gud-mode-hook&lt;/code&gt;, but don't yet have the lisp skills for this apparently...Is there a good way to call &lt;code&gt;cd&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; &lt;code&gt;gud-mode-hook&lt;/code&gt;/ before the dubugger starts?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-11-30T21:56:34.117" LastActivityDate="2021-12-15T07:28:36.390" Title="How do I change the working directory used by pdb/gud?" Tags="|python|debugging|gud|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18266" PostTypeId="1" CreationDate="2015-11-21T00:11:51.313" Score="2" ViewCount="249" Body="&lt;p&gt;I've seen quite a few starter packages for Emacs (&lt;a href=&quot;https://eschulte.github.io/emacs24-starter-kit/&quot; rel=&quot;nofollow&quot;&gt;Starter kit&lt;/a&gt;, &lt;a href=&quot;http://batsov.com/prelude/&quot; rel=&quot;nofollow&quot;&gt;Prelude&lt;/a&gt;, etc), but all of them I'm aware of use lots of third-party packages downloaded from the various package repositories, such as GNU, MELPA, Marmalade, ...  I'm about to start using Emacs on a closed network - really closed - as in, no connectivity to the internet whatsoever. If I'm to use any third-party packages, I'll have to have IT review the packages, which takes forever. Too many requests for review will just result in wholesale rejection of all of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'd like to know: are there any similar setups out there that use packages included in Emacs to begin with? (I'm using Emacs 24.5) I can get away with a little bit of keyboarding stuff in, and maybe three or four third-party packages, but that's about it. This has to run on Windows 7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I should have mentioned that I will be writing Python code on this system. I've been using &lt;a href=&quot;http://www.flycheck.org/&quot; rel=&quot;nofollow&quot;&gt;flycheck&lt;/a&gt; on my internet-connected machine, but I'll be using flymake on the stand-alone network machine. Flymake is &lt;a href=&quot;https://www.masteringemacs.org/article/spotlight-flycheck-a-flymake-replacement&quot; rel=&quot;nofollow&quot;&gt;apparently&lt;/a&gt; more difficult to set up, but not that &lt;a href=&quot;https://github.com/jorgenschaefer/elpy/issues/137&quot; rel=&quot;nofollow&quot;&gt;much more difficult&lt;/a&gt;. This kind of thing is what I was going for in the original question: everything else being equal, I'd rather use flycheck, but things aren't equal, and I'd like to know how to set up flymake. Another example: I've been using &lt;a href=&quot;http://auto-complete.org/doc/manual.html&quot; rel=&quot;nofollow&quot;&gt;auto-complete&lt;/a&gt; - I love the tooltip-like presentation of possible completions - but I should probably try to stick with built-in stuff like dabbrev, pcomplete, and so on. Not trade-offs I'd like to make, but there it is.&lt;/p&gt;&#xA;" OwnerUserId="9503" LastEditorUserId="9503" LastEditDate="2015-11-21T03:07:57.010" LastActivityDate="2015-11-21T03:07:57.010" Title="Are there Emacs &quot;starter kits&quot; with few to no third-party packages required?" Tags="|python|microsoft-windows|package-repositories|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18268" PostTypeId="2" ParentId="18252" CreationDate="2015-11-21T00:44:55.767" Score="6" Body="&lt;p&gt;I think you want &lt;code&gt;M-a&lt;/code&gt; and &lt;code&gt;M-e&lt;/code&gt; (respectively, &lt;code&gt;org-backward-sentence&lt;/code&gt; and &lt;code&gt;org-forward-sentence&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-11-21T00:44:55.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18269" PostTypeId="2" ParentId="18266" CreationDate="2015-11-21T01:07:01.417" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;are there any similar setups out there that use packages included in Emacs to begin with?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Are you asking about configurations which &lt;em&gt;enable&lt;/em&gt; functionality which is available-but-disabled by default? i.e. Things which are generally considered to be better, but are not the traditional behaviour, and which have consequently been made opt-in features. e.g. &lt;code&gt;C-x C-b&lt;/code&gt; still calls &lt;code&gt;list-buffers&lt;/code&gt;, but the vastly superior &lt;code&gt;ibuffer&lt;/code&gt; has been built-in for years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's a really good question. Most people will configure default functionality in their own configs of course, but I don't know if anyone provides a &quot;better defaults&quot; (only) config online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you would be best to split your question in two. The question of &quot;good defaults&quot; is really unrelated to the question of &quot;three or four 3rd-party packages that are right for me&quot;, and I think mixing them will make the answers messy (the former has a pretty well-defined scope, while the latter does not).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding 3rd-party packages, I'm really doubtful that you'll find any &quot;starter kit&quot; which limits itself so severely -- as you've observed, they tend to add a rather large number of packages, to save the users from finding them by themselves; because there's a lot of stuff out there -- so it sounds like you just want GNU Emacs, a bunch of &quot;better default&quot; elisp, and to then install the &quot;three or four&quot; packages that &lt;em&gt;you&lt;/em&gt; want to have. (I don't know what those packages are, but I doubt it makes sense to expect someone to have prepared it in advance for you, given your constraints.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;em&gt;you&lt;/em&gt; have no idea what those packages are either, then I'm not sure how to help you, other than to suggest that you spend a bunch of time investigating what is out there so that you can work out which packages should make your (very very) short list.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-11-21T01:37:06.613" LastActivityDate="2015-11-21T01:37:06.613" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18270" PostTypeId="1" CreationDate="2015-11-21T01:10:37.040" Score="2" ViewCount="1138" Body="&lt;p&gt;I want to have no underlining on highlighted matching brackets. I've done the following to achieve that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-face&#xA;show-paren-match&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And there I deactivated the underlining of matching parenthesis. However, when I restart emacs the underlining in that same setting is checked again. It seems I can't turn it off forever by changing it this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I turn it off?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at this screenshot, you can see some teal underlining below the brackets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/f9hMO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/f9hMO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also in other files, not only on that settings buffer. In my init file I already have these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(cursor ((t (:background &quot;gold&quot; :foreground &quot;#151718&quot;))))&#xA; '(show-paren-match ((t (:background &quot;yellow green&quot; :foreground &quot;black&quot;))))&#xA; '(show-paren-mismatch ((t (:underline (:color &quot;#CE4045&quot; :style wave))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I do want a red wave below brackets, which have no counterpart, but none on the matching ones.&lt;/p&gt;&#xA;" OwnerUserId="10090" LastEditorUserId="25" LastEditDate="2016-07-25T07:34:36.820" LastActivityDate="2016-07-25T07:34:36.820" Title="How to disable underlining of highlighted matching brackets?" Tags="|faces|colors|balanced-parentheses|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18271" PostTypeId="1" AcceptedAnswerId="18289" CreationDate="2015-11-21T02:58:00.387" Score="0" ViewCount="332" Body="&lt;p&gt;I'm using &lt;code&gt;face-remap-add-relative&lt;/code&gt; in a tiny minor mode which, when activated, increases the size of the &lt;code&gt;org-level-1&lt;/code&gt; face. This function is perfect for that because when evaluated it returns a cookie that can be kept for later restoring the original size of the modified face. Here's the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar bigger-org-headlines-cookie nil)&#xA;&#xA;(make-variable-buffer-local 'bigger-org-headlines-cookie)&#xA;&#xA;(define-minor-mode bigger-org-headlines&#xA;  &quot;Increases the size of level 1 Org headlines.&quot;&#xA;  :lighter &quot; Big-Org-Headlines&quot;&#xA;  (if bigger-org-headlines&#xA;      (setq bigger-org-headlines-cookie&#xA;            (face-remap-add-relative 'org-level-1&#xA;                                     :height&#xA;                                     (expt text-scale-mode-step 1)))&#xA;    (face-remap-remove-relative bigger-org-headlines-cookie))&#xA;  (force-window-update (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I changed my mind and want to increase the size of every headline in an Org file. In total there are 8 levels that need to be changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easier way besides changing &lt;code&gt;face-remapping-alist&lt;/code&gt; manually (which BTW is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html#Face-Remapping&quot; rel=&quot;nofollow&quot;&gt;not recommended&lt;/a&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions are very welcome.&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="105" LastEditDate="2016-03-14T04:41:35.383" LastActivityDate="2016-03-14T04:41:35.383" Title="Remapping several faces for use in minor mode" Tags="|org-mode|faces|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18272" PostTypeId="2" ParentId="14775" CreationDate="2015-11-21T04:52:45.940" Score="1" Body="&lt;p&gt;You'd be better off creating an evil key map for one of the rectangle modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The macro evil-define-key allows you to bind to key maps in evil style.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'normal key-map-name &quot;key&quot; 'function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also you can add binding to the evil global map,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-global-set-key 'normal &quot;key&quot; 'function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may like this hydra for use with rectangle-mark-mode, which will work in a similar way to evil / vim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://oremacs.com/2015/02/25/rectangle-hydra/&quot; rel=&quot;nofollow&quot;&gt;http://oremacs.com/2015/02/25/rectangle-hydra/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd recommend you play with the different rectangle modes and decide which one you like best, and then make the key map bindings as you need them / see fit. There's also &lt;a href=&quot;https://github.com/zk-phi/phi-rectangle&quot; rel=&quot;nofollow&quot;&gt;https://github.com/zk-phi/phi-rectangle&lt;/a&gt; - Personally I use CUA Rectangle mode, it has a lot of features, although I think navigational bindings are a bit strange/inconsistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also up to you how you decide to invoke whichever rectangle mode, one option I think makes sense is to have it available in the Visual mode map.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="2485" LastEditDate="2015-11-21T05:24:26.157" LastActivityDate="2015-11-21T05:24:26.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18273" PostTypeId="1" AcceptedAnswerId="18537" CreationDate="2015-11-21T05:00:53.727" Score="9" ViewCount="1356" Body="&lt;p&gt;In org-mode I use &lt;a href=&quot;http://orgmode.org/manual/Paragraphs.html&quot;&gt;block quotes&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_QUOTE&#xA;Foo.&#xA;#+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I do &lt;code&gt;org-edit-special&lt;/code&gt; inside a block quote, I get &lt;code&gt;No special environment to edit here&lt;/code&gt;. How can I direct org-mode to treat block quotes (and verse quotes etc) as special environments, so that when I do &lt;code&gt;C-c '&lt;/code&gt; I can edit the quotation in its own buffer the same way I can with other code blocks?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="253" LastEditDate="2016-03-08T10:38:05.150" LastActivityDate="2016-11-12T21:36:23.023" Title="tell org to treat block quotes as a special environment?" Tags="|org-mode|quote|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18274" PostTypeId="1" AcceptedAnswerId="18276" CreationDate="2015-11-21T06:17:48.883" Score="0" ViewCount="2170" Body="&lt;p&gt;I use Prelude, and I want to use use-package for loading and configuring my personal config files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In ~/.emacs.d/personal/load-private-config.el, my code is below: (like &lt;a href=&quot;https://github.com/jwiegley/dot-emacs/blob/master/init.el#L99&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jwiegley/dot-emacs/blob/master/init.el#L99&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst zwb-private-emacs-config-path &quot;~/.emacs.d-private/&quot;)&#xA;&#xA;(eval-and-compile&#xA;  (mapc&#xA;   #'(lambda (path)&#xA;       (push (expand-file-name path zwb-private-emacs-config-path) load-path))&#xA;   '(&quot;lib&quot;&quot;theme&quot; &quot;&quot;)))&#xA;&#xA;(eval-and-compile&#xA;  (defvar use-package-verbose t)&#xA;  (require 'cl)&#xA;  (require 'use-package))&#xA;&#xA;(use-package zwb :load-path (lambda () (expand-file-name (concat zwb-private-emacs-config-path &quot;lib/zwb&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In ~/.emacs.d-private/lib/zwb/zwb.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;test-zwb&quot;)&#xA;(provide 'zwb)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;restart emacs, in &lt;strong&gt;*Message*&lt;/strong&gt; buffer, I cann't see &lt;strong&gt;test-zwb&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I add &lt;code&gt;(message load-path)&lt;/code&gt; at the end of load-private-config.el, restart emacs got:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (initialization): An error occurred while loading&#xA;  `/Users/zwb/.emacs.d/init.elc':&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Wrong type argument: stringp, (/Users/zwb/.emacs.d-private/lib/zwb&#xA;  /Users/zwb/.emacs.d-private /Users/zwb/.emacs.d-private/theme&#xA;  /Users/zwb/.emacs.d-private/lib&#xA;  ~/.emacs.d/themes/color-theme-ahei-20141223.221&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It seems the &lt;em&gt;lib/zwb&lt;/em&gt; is in the &lt;strong&gt;load-path&lt;/strong&gt;, so I don't how:    &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why I cann't get &lt;strong&gt;test-zwb&lt;/strong&gt; in &lt;strong&gt;*Message*&lt;/strong&gt; buffer?     &lt;/li&gt;&#xA;&lt;li&gt;Has zwb.el been already loaded? If not, how to load it?      &lt;/li&gt;&#xA;&lt;li&gt;How to print load-path (use message method seems has some problem)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My OS version: Mac OS X 10.11.2 beta4&lt;br&gt;&#xA;My Emacs version: 24.5.1 (brew emacs-mac-emacs)&lt;/p&gt;&#xA;" OwnerUserId="10004" LastEditorUserId="10004" LastEditDate="2015-11-21T07:36:29.347" LastActivityDate="2015-11-21T07:36:29.347" Title="How to load self package with use-package?" Tags="|use-package|prelude|message|autoload|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18275" PostTypeId="2" ParentId="18259" CreationDate="2015-11-21T06:46:20.367" Score="1" Body="&lt;p&gt;&lt;kbd&gt;C-j&lt;/kbd&gt; is rarely used inside or outside Emacs, and it's right on the home row.&lt;/p&gt;&#xA;" OwnerUserId="6898" LastActivityDate="2015-11-21T06:46:20.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18276" PostTypeId="2" ParentId="18274" CreationDate="2015-11-21T06:55:59.153" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Your zwb.el is wrong.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;test-zwb&quot;) ; &quot; and ' are not couple.&#xA;(provide 'zwb) ; This means the zwb.el provides the feature zwb&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This one is ok. &#xA;See this: &lt;a href=&quot;https://stackoverflow.com/questions/3349223/running-my-own-code-when-during-emacs-startup&quot;&gt;https://stackoverflow.com/questions/3349223/running-my-own-code-when-during-emacs-startup&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;:defer means the zwb package is autoloaded. You can remove :defer t to see the message immediately. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Print load-path. I did it by describe-variable load-path. And you may do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;%S&quot; load-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;P.S. You can expand the use-package macro and try to understand how the package is loaded. With :defer, the macro only does one thing: add the return of the lambda function to load-path. Without :defer, the macro expands to (require 'zwb) and timing.&lt;/p&gt;&#xA;" OwnerUserId="10236" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-11-21T07:22:44.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18278" PostTypeId="2" ParentId="18270" CreationDate="2015-11-21T14:01:33.200" Score="1" Body="&lt;p&gt;I found a solution that seems to work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TIegC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TIegC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of unchecking the attribute &lt;code&gt;underline&lt;/code&gt;, it seems, that it needs to be checked, but set to &lt;code&gt;Off&lt;/code&gt;. I also changed other settings for the brackets, which you can see in the screenshot.&lt;/p&gt;&#xA;" OwnerUserId="10090" LastActivityDate="2015-11-21T14:01:33.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18279" PostTypeId="1" CreationDate="2015-11-21T14:25:19.013" Score="2" ViewCount="361" Body="&lt;p&gt;I am trying to switch from vim to evil mode and got very far. The last thing what is missing is debugging with &quot;gdb&quot;. I want to be equally productive as with clewn in vim (this means source level debugging, not a bare command line interface). So I tried with gud-many-windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But with gud I experience lots of issues, which make it totally unusable for me. The most prominent is, that gud doesn't seem to follow jumps in other functions or other files. So if I step into function, the white indicator simply goes away. Manually invoking gud-refresh sometimes helps. But sometimes, the source also pops up in some other window then (e.g. the &lt;em&gt;input/output&lt;/em&gt; window) or not at all. So I have to go some steps &quot;in the dark&quot; before gud-refresh helps again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many people in the web experiencing similar problems, but there doesn't seem to be any solution (at least none, I could understand so far). In some forums it is stated, that debugging in emacs 24 is broken and I should go back to 23.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue seems to be that it is totally unconfigurable. So making the &lt;em&gt;input/output&lt;/em&gt; window disapear meant to literally copy 50 lines from the gud sources and modify them via defadvice ... What the heck?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried realgud, but was not even able to invoke gdb with it. On 25.0.50 I had the same problems then with 24.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards,&#xA;Kilian.&lt;/p&gt;&#xA;" OwnerUserId="10249" LastActivityDate="2015-11-22T12:45:20.547" Title="Is gud working at all in emacs 24?" Tags="|gud|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18280" PostTypeId="2" ParentId="18262" CreationDate="2015-11-21T14:58:17.150" Score="6" Body="&lt;p&gt;After suggestions...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun add-ssh-agent-to-tramp ()&#xA;  (cl-pushnew '(&quot;-A&quot;)&#xA;              (cadr (assoc 'tramp-login-args&#xA;                           ; if on Windows using Putty with Pageant,&#xA;                           ; replace &quot;ssh&quot; with &quot;plink&quot;&#xA;                           (assoc &quot;ssh&quot; tramp-methods)))&#xA;              :test #'equal))&#xA;(add-ssh-agent-to-tramp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2240" LastEditorUserId="26761" LastEditDate="2020-02-05T13:41:29.690" LastActivityDate="2020-02-05T13:41:29.690" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="18281" PostTypeId="1" AcceptedAnswerId="18285" CreationDate="2015-11-21T16:16:35.503" Score="8" ViewCount="6631" Body="&lt;p&gt;I simply need to take the output of &lt;code&gt;org-element-parse-buffer&lt;/code&gt; and put it in a file -- maybe with some &quot;if-does-not-exist&quot; etc. bells and whistles. In CL I have &lt;code&gt;with-open-file&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt; as tools. For example, here's CL to read a file containing lines like &lt;code&gt;foo=bar&lt;/code&gt; and output to a new file like this &lt;code&gt;(foo . bar)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun arabic_to_roman (filename)&#xA;  (cl-flet ((read-it ()&#xA;                  (with-open-file (in filename&#xA;                                      :direction :input&#xA;                                      :if-does-not-exist nil)&#xA;                                  (loop for line = (read-line in nil)&#xA;                                        for pos = (position \= line)&#xA;                                        while line collect (cons (subseq line 0 pos)&#xA;                                                                 (subseq line (1+ pos))))))&#xA;         (write-it (list)&#xA;                   (with-open-file (cl-stream #p&quot;ar_out.txt&quot;&#xA;                                           :direction :output&#xA;                                           :if-exists :overwrite&#xA;                                           :if-does-not-exist :create)&#xA;                                   (write list :stream stream :escape nil :readably nil :pretty nil))))&#xA;    (write-it (read-it))&#xA;    'done-read-write))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is someone abstruse compared to other languages -- but then I don't find anything like this in elisp. How is read-write done in elisp. What I find seems only buffer-oriented. . . .&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:41:19.947" LastActivityDate="2016-03-14T04:41:19.947" Title="How to do a simple write to file" Tags="|files|persistence|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18282" PostTypeId="1" CreationDate="2015-11-21T16:39:16.853" Score="0" ViewCount="1450" Body="&lt;p&gt;When I add a member initialization list to my class constructor, Emacs indents the body like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Vector::Vector(int s) : elem{new double[s]}, sz{s}&#xA;   {&#xA;&#xA;   }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expect it to be indented the same as when there is no member initialization list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Vector::Vector(int s)&#xA;{&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I accomplish this? Should I file a bug?&lt;/p&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2017-03-16T07:13:24.137" Title="C++ indentation after member initialization list" Tags="|indentation|c++|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18283" PostTypeId="1" CreationDate="2015-11-21T16:43:38.363" Score="0" ViewCount="84" Body="&lt;p&gt;If I want, for example, add all numbers in a  line with a keyboard macro, how can I do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would add:&#xA;1 1 34 53&#xA;into: 89.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, given a word:&#xA;asdf&#xA;transform it into &#xA;fdsa&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to define the macro, bind it, and name it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no interest in inputting the numbers in a table. This is meant for easy of use, like typing amount, interest, years, and getting a total amount.&lt;/p&gt;&#xA;" OwnerUserId="10251" LastActivityDate="2015-11-21T20:26:15.840" Title="How to run a macro in a buffer that would take an argument?" Tags="|keyboard-macros|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18284" PostTypeId="1" CreationDate="2015-11-21T17:06:46.393" Score="0" ViewCount="87" Body="&lt;p&gt;When I use &lt;code&gt;TRAMP&lt;/code&gt; and a remote shell, &lt;code&gt;terminfo&lt;/code&gt; doesn't export the &lt;code&gt;kcuu1&lt;/code&gt; (up arrow) resource. How can I get Emacs to provide this?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2015-12-08T05:07:49.437" Title="Terminfo does not export the up arrow resource" Tags="|shell|tramp|terminfo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18285" PostTypeId="2" ParentId="18281" CreationDate="2015-11-21T17:59:22.187" Score="12" Body="&lt;p&gt;Use &lt;code&gt;with-temp-file&lt;/code&gt;; this is documented at &lt;code&gt;M-: (info &quot;(elisp) Writing to Files&quot;)&lt;/code&gt; (also available &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Writing-to-Files.html#Writing-to-Files&quot;&gt;online&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This takes a filename or path and a list of body forms. It creates a temporary buffer, then executes the body forms with that new buffer as the current buffer, then writes the contents of that buffer to the file, then deletes the temporary buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't be so down on buffers; you can think of them as strings with cursors, if you'd like. If you have a string and want to put it into a buffer, just &lt;code&gt;insert&lt;/code&gt; it: &lt;code&gt;(insert (org-element-parse-buffer ...))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Followup:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should have double-checked, but since &lt;code&gt;org-element-parse-buffer&lt;/code&gt; doesn't return a string, you'll need to convert it to one first. As Drew mentioned, &lt;code&gt;(format &quot;%s&quot; (org-element-parse-buffer))&lt;/code&gt; will work.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2015-11-21T20:12:27.020" LastActivityDate="2015-11-21T20:12:27.020" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18286" PostTypeId="2" ParentId="18283" CreationDate="2015-11-21T18:10:02.547" Score="1" Body="&lt;p&gt;It's probably best not to try doing this with a keyboard macro. However, a simple elisp function to do it is easy to write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun db48x/add-up-numbers (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((sum (apply #'+&#xA;                    (mapcar #'string-to-number&#xA;                            (split-string (buffer-substring beg end))))))&#xA;    (delete-region beg end)&#xA;    (insert (number-to-string sum))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It operates on the region, so select the text containing the numbers first. You can bind it to the key of your choice or call it directly (&lt;code&gt;M-x db48x/add-up-numbers&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-21T18:10:02.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18287" PostTypeId="2" ParentId="18282" CreationDate="2015-11-21T20:17:32.870" Score="1" Body="&lt;p&gt;What indentation style do you have configured?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see &lt;a href=&quot;http://www.emacswiki.org/emacs/IndentingC&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/IndentingC&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have style = &quot;bsd&quot; and emacs doesn't do that.&lt;/p&gt;&#xA;" OwnerUserId="10249" LastActivityDate="2015-11-21T20:17:32.870" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18288" PostTypeId="2" ParentId="18283" CreationDate="2015-11-21T20:21:14.377" Score="0" Body="&lt;p&gt;Have you tried &lt;code&gt;C-x Q&lt;/code&gt; during macro definition? It's for putting in minibuffer prompts for getting variable arguments into the macro at runtime. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for adding a row of numbers in a region, you may find &lt;code&gt;M-x Quick-Calc&lt;/code&gt; more convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last option of course is to edit the macro and insert something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prompt (if arg (read-from-minibuffer &quot;PROMPT: &quot;) &quot;Input: &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-11-21T20:26:15.840" LastActivityDate="2015-11-21T20:26:15.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18289" PostTypeId="2" ParentId="18271" CreationDate="2015-11-21T21:33:05.823" Score="1" Body="&lt;p&gt;This seems like a straightforward application for &lt;code&gt;map&lt;/code&gt;.  Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar bigger-org-headlines-cookies nil) &#xA;&#xA;(make-variable-buffer-local 'bigger-org-headlines-cookies)&#xA;&#xA;(define-minor-mode bigger-org-headlines&#xA;  &quot;Make Org headlines bigger.&quot;&#xA;  :lighter &quot; Big-Org-Headlines&quot;&#xA;  (if bigger-org-headlines &#xA;      (mapc (lambda (face)&#xA;              (push (face-remap-add-relative face :height text-scale-mode-step)&#xA;                    bigger-org-headlines-cookies))&#xA;            (cons 'org-link org-level-faces))&#xA;    (mapc #'face-remap-remove-relative bigger-org-headlines-cookies)&#xA;    (setq bigger-org-headlines-cookies nil))&#xA;  (force-window-update (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that your code errored for me until I added the docstring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also removed your &lt;code&gt;expt&lt;/code&gt; call since it wasn't doing anything.  Feel free to reinstate it if it was just standing in for a calculation as-yet unimplemented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In testing, I found that links weren't being affected, so I went ahead and added the &lt;code&gt;org-link&lt;/code&gt; face, too.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2015-11-22T17:20:01.580" LastActivityDate="2015-11-22T17:20:01.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18290" PostTypeId="1" CreationDate="2015-11-21T21:43:37.463" Score="1" ViewCount="36" Body="&lt;p&gt;When using ido-find-file (&lt;code&gt;C-x C-f&lt;/code&gt;) to navigate through directories, directories that have a hyphen in the name are listed before shorter matches with no hyphen. For example, if directories named &quot;dir1&quot; and &quot;dir1-backup&quot; are present, &quot;dir1-backup&quot; is selected first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could just customize &lt;code&gt;ido-ignore-directories&lt;/code&gt; to ignore names with -backup in them, but I'd like to understand why this is occurring in the first place. It seems like the shorter name should be listed first in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to only be a problem if I'm using the variable &lt;code&gt;ido-file-extensions-order&lt;/code&gt;, but I don't see what file extensions have to do with directory names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq ido-file-extensions-order '(&quot;.org&quot; &quot;.txt&quot; &quot;.py&quot;))&lt;/code&gt; and dir1-backup is listed first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq ido-file-extensions-order nil)&lt;/code&gt; and dir1 is listed first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is causing dir1-backup to be listed first?&lt;/p&gt;&#xA;" OwnerUserId="10254" LastEditorUserId="105" LastEditDate="2015-11-21T22:31:43.530" LastActivityDate="2015-11-21T22:31:43.530" Title="ido-find-file: directory names with hyphens are listed first" Tags="|ido|ido-find-file|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18291" PostTypeId="2" ParentId="18177" CreationDate="2015-11-21T23:08:43.027" Score="0" Body="&lt;p&gt;After reviewing the above answer from PuercoPop I ended up finding the problem, and it was unrelated to &lt;code&gt;font-comment-lock-face&lt;/code&gt;. For reference I am running solarized in both my terminal, and in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run Arch Linux with URxvt. I noticed I could &quot;fake&quot; rxvt by adding &lt;code&gt;URxvt*termName: rxvt&lt;/code&gt; to my Xresources file. This worked, except for when I used tmux, or most anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real solution was two-fold&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I set my &lt;code&gt;TERM&lt;/code&gt; equal to &lt;code&gt;rxvt-256color&lt;/code&gt; and then made a simlink of &lt;code&gt;/usr/share/terminfo/r/rxvt-256color&lt;/code&gt; to &lt;code&gt;~/.terminfo/r/rvxt-256color&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This smoothed out the color weirdness involved. Emacs correctly adjusted the colors for my terminal. PuercoPop's solution works in general if your colors are wrong, but not if Emacs isn't cooperating with your terminal.&lt;/p&gt;&#xA;" OwnerUserId="10194" LastActivityDate="2015-11-21T23:08:43.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18292" PostTypeId="1" CreationDate="2015-11-21T23:51:21.697" Score="3" ViewCount="277" Body="&lt;p&gt;I use &lt;code&gt;message-mode&lt;/code&gt; to compose and send email. Rather than having to navigate manually through the fields, I would like to able to &lt;code&gt;TAB&lt;/code&gt; from the &lt;code&gt;To:&lt;/code&gt; field to the &lt;code&gt;Subject:&lt;/code&gt; field, then &lt;code&gt;TAB&lt;/code&gt; again to bring the point to the message body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE. I got this partially working:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun message-mode-next-field ()&#xA;  (interactive)&#xA;  (next-line)&#xA;  (end-of-line)) &#xA;&#xA;(setq message-tab-body-function #'message-mode-next-field)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works up to a point, but for some reason it gets stuck at the end of the &lt;code&gt;From:&lt;/code&gt; line and won't advance further to the message body.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="15748" LastEditDate="2017-07-30T21:08:05.843" LastActivityDate="2023-01-16T15:20:23.203" Title="How to TAB between fields in message-mode?" Tags="|email|message-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18293" PostTypeId="1" CreationDate="2015-11-21T23:55:44.980" Score="3" ViewCount="5179" Body="&lt;p&gt;Running a function, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(print '&quot;Hello World&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;Hello World&quot;&lt;/code&gt;&#xA;&lt;code&gt;&quot;Hello World&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... outputs twice the expected result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose one is the real printing, and the second is the value returned. However, I still want an alternative to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the equivalent of the Python &lt;code&gt;python -c &quot;print 'Hello World'&quot;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10251" LastEditorUserId="105" LastEditDate="2016-03-14T04:40:35.290" LastActivityDate="2016-03-14T04:40:35.290" Title="Functions print outputs twice the expected output" Tags="|print|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18294" PostTypeId="2" ParentId="18293" CreationDate="2015-11-22T00:09:22.873" Score="6" Body="&lt;p&gt;You see both:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The behavior of the &lt;code&gt;print&lt;/code&gt; function - a side effect.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The return value of that function.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is because of the way you evaluated the expression, interactively.  If you used something like &lt;code&gt;M-:&lt;/code&gt; to evaluate it, that command prints (echoes) the return value of the evaluated expression, independently of what the function itself might do (which in this case is to print the same thing as the return value).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-22T00:09:22.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18295" PostTypeId="1" AcceptedAnswerId="18301" CreationDate="2015-11-22T00:33:34.730" Score="2" ViewCount="511" Body="&lt;p&gt;I use org-mode lists, both plain-text lists and numbered lists. I precede my lists with a &quot;list title,&quot; which for me is any line ending in a colon.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Grocery list:&#xA;- tomatoes&#xA;- spinach&#xA;- blueberries&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like these list titles to be automatically italicized in export to HTML and LaTeX PDF. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to do this by making it a headline, since &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2010-11/msg01293.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;by design&lt;/a&gt;, as we know, &lt;a href=&quot;https://stackoverflow.com/questions/9793428/how-to-end-todo-lists-in-emacs-org-mode&quot;&gt;there is no way to end an org-heading and return to the parent level&lt;/a&gt; without creating a new heading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead, I want org to automatically consider any lines ending with a colon as list titles. (Even better would be to exclude headlines and lines that have a period somewhere before the ending colon.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured out how to fontify such lines within the Emacs buffer itself by defining a new face:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface list-title-face&#xA;'((t (:background &quot;pale green&quot;)))&#xA;&quot;fontify list titles&quot;)&#xA;&#xA; (font-lock-add-keywords 'org-mode&#xA;'((&quot;^.*:[ ]*$&quot; . 'list-title-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But how do I create an org-emphasis type so that the emphasis will be respected in org-export?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt; looks promising.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-01-21T16:32:25.090" Title="how to automatically add org-emphasis properties to list titles?" Tags="|org-mode|org-export|list|org-emphasis|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18296" PostTypeId="2" ParentId="18292" CreationDate="2015-11-22T00:41:04.767" Score="-2" Body="&lt;p&gt;&lt;code&gt;C-c C-f C-s&lt;/code&gt; will move your cursor to the Subject: header.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-22T00:41:04.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18298" PostTypeId="1" CreationDate="2015-11-22T02:59:26.350" Score="2" ViewCount="246" Body="&lt;p&gt;I put my custom js setting into zwb-js group in zwb-js.el, I want to use &lt;strong&gt;use-package&lt;/strong&gt; to load it, it seems that zwb-js.el has been loaded, but the functions defined in zwb-js.el seems not be called auto.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; zwb-js.el --- ZWB Js configuration entry point.&#xA;&#xA;;;; Commentary:&#xA;&#xA;;; This file simply sets up the default load path and requires&#xA;;; the various modules defined within Emacs Prelude.&#xA;&#xA;;;; Code:&#xA;&#xA;(defgroup zwb-js nil&#xA;  &quot;zwb's js setting.&quot;&#xA;  :group 'languages&#xA;  :prefix &quot;zwb-js-&quot;)&#xA;&#xA;(defcustom zwb-js-packages&#xA;  '(&#xA;    coffee-mode&#xA;    company&#xA;    company-tern&#xA;    flycheck&#xA;    js-doc&#xA;    js2-mode&#xA;    js2-refactor&#xA;    json-mode&#xA;    json-snatcher&#xA;    tern&#xA;    web-beautify&#xA;    )&#xA;  &quot;The package zwb-js needs.&quot;&#xA;  :type 'alist&#xA;  :group 'zwb-js)&#xA;&#xA;;;;###autoload&#xA;(defun zwb-js/init-package ()&#xA;  (message &quot;debug&quot;)&#xA;  (prelude-require-packages zwb-js-packages))&#xA;&#xA;(defun zwb-js/post-init-company ()&#xA;  (zwb|add-company-hook js2-mode))&#xA;&#xA;(defun zwb-js/post-init-flycheck ()&#xA;  (add-hook 'js2-mode-hook  'flycheck-mode)&#xA;  (add-hook 'json-mode-hook 'flycheck-mode)&#xA;  (defun zwb|disable-js2-checks-if-flycheck-active ()&#xA;    (unless (flycheck-get-checker-for-buffer)&#xA;      (set (make-local-variable 'js2-mode-show-parse-errors) t)&#xA;      (set (make-local-variable 'js2-mode-show-strict-warnings) t)))&#xA;  (add-hook 'js2-mode-hook 'zwb|disable-js2-checks-if-flycheck-active))&#xA;&#xA;(defun zwb-js/post-init-tern ()&#xA;  (add-hook 'js-mode-hook (lambda () (tern-mode t)))&#xA;  (add-to-list 'company-backends '(company-tern :with company-dabbrev-code)))&#xA;&#xA;(defun zwb-js/init-js-doc ()&#xA;  (defun zwb-js/js-doc-require ()&#xA;    (require 'js-doc))&#xA;  (add-hook 'js2-mode-hook 'zwb-js/js-doc-require))&#xA;&#xA;(defun zwb-js/init-js2-refactor ()&#xA;  (defun zwb-js/js2-refactor-require ()&#xA;    (require 'js2-refactor))&#xA;  (add-hook 'js2-mode-hook 'zwb-js/js2-refactor-require))&#xA;&#xA;(defun zwb-js/init-js-color ()&#xA;  (setq js2-highlight-level 3)&#xA;  (defun zwb-js/rainbow-delimiters-require ()&#xA;    (require 'rainbow-delimiters)&#xA;    (rainbow-delimiters-mode))&#xA;  (dolist (hook '(js2-mode-hook js-mode-hook json-mode-hook))&#xA;    (add-hook hook 'zwb-js/rainbow-delimiters-require)))&#xA;&#xA;(defun zwb-js/node-repl ()&#xA;  (setq inferior-js-program-command &quot;node&quot;)&#xA;  (setenv &quot;NODE_NO_READLINE&quot; &quot;1&quot;)&#xA;  (setq inferior-js-mode-hook (lambda () (ansi-color-for-comint-mode-on)))&#xA;  (defun zwb-js/comint-key-binding ()&#xA;    (local-set-key (kbd &quot;C-x C-e&quot;) 'js-send-last-sexp)&#xA;    (local-set-key (kbd &quot;C-M-x&quot;) 'js-send-last-sexp-and-go)&#xA;    (local-set-key (kbd &quot;C-c b&quot;) 'js-send-buffer)&#xA;    (local-set-key (kbd &quot;C-c C-b&quot;) 'js-send-buffer-and-go)&#xA;    (local-set-key (kbd &quot;C-c l&quot;) 'js-load-file-and-go))&#xA;  (add-hook 'js2-mode-hook 'zwb-js/comint-key-binding))&#xA;&#xA;(defun zwb-js/conf-js2-mode ()&#xA;  &quot;Conf js2-mode and so on.&quot;&#xA;    (custom-set-variables&#xA;     '(js2-basic-offset 2)&#xA;     '(js2-bounce-indent-p nil))&#xA;&#xA;    (setq-default js2-mode-show-parse-errors nil)&#xA;    (setq-default js2-mode-show-strict-warnings nil)&#xA;&#xA;    (setq json-reformat:indent-width 2))&#xA;&#xA;(defun zwb-js/js-fontlock ()&#xA;  (defvar js-font-lock-keywords&#xA;    `((&quot;\\(function *\\)[(|[[:space:]]]?&quot;&#xA;       (0 (progn (compose-region (match-beginning 1)&#xA;                                 (match-end 1) &quot;\u0192&quot;)&#xA;                 nil)))&#xA;      (&quot;[[:space:]]\\(var\\)[[:space:]]&quot;&#xA;       (0 (progn (compose-region (match-beginning 1)&#xA;                                 (match-end 1) &quot;\u028b &quot;)&#xA;                 nil)))&#xA;      (&quot;[[:space:]]\\(return\\)[[:space:]]&quot;&#xA;       (0 (progn (compose-region (match-beginning 1)&#xA;                                 (match-end 1) &quot;\u1d3f &quot;)&#xA;                 nil)))&#xA;      (&quot;\\(this\\)&quot;&#xA;       (0 (progn (compose-region (match-beginning 1)&#xA;                                 (match-end 1) &quot;\u0288&quot;)&#xA;                 nil)))))&#xA;  (eval-after-load 'js&#xA;    (font-lock-add-keywords&#xA;     'js2-mode js-font-lock-keywords)))&#xA;&#xA;(provide 'zwb-js)&#xA;;;; zwb-js.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can use &lt;strong&gt;C-h v&lt;/strong&gt; config &lt;strong&gt;zwb-js-packages&lt;/strong&gt;, so I don't know why I cann't see any defuns with M-x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also wrote zwb-js-autoloads.el to autoload &lt;strong&gt;zwb-js/init-package&lt;/strong&gt; for test, but it seems not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my zwb-js-autoloads.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; zwb-js-autoloads.el --- automatically extracted autoloads&#xA;;;&#xA;;;; Code:&#xA;(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))&#xA;&#xA;;;;### (autoloads nil nil (&quot;zwb-js.el&quot;))&#xA;&#xA;(provide 'zwb-js-autoloads)&#xA;;;;***&#xA;&#xA;;; Local Variables:&#xA;;; version-control: never&#xA;;; no-byte-compile: t&#xA;;; no-update-autoloads: t&#xA;;; End:&#xA;;;; zwb-js-autoloads.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; zwb-js-autoloads.el --- automatically extracted autoloads&#xA;;;&#xA;;;; Code:&#xA;(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))&#xA;&#xA;(autoload 'zwb-js/init-package &quot;zwb-js&quot; &quot;\&#xA;Install all packages that zwb-js needs&#xA;\(fn)&quot; nil nil)&#xA;&#xA;(provide 'zwb-js-autoloads)&#xA;;;;***&#xA;&#xA;;; Local Variables:&#xA;;; version-control: never&#xA;;; no-byte-compile: t&#xA;;; no-update-autoloads: t&#xA;;; End:&#xA;;;; zwb-js-autoloads.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Loaded by personal/load-private-config.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst zwb-private-emacs-config-path &quot;~/.emacs.d-private/&quot;)&#xA;&#xA;(eval-and-compile&#xA;  (mapc&#xA;   #'(lambda (path)&#xA;       (push (expand-file-name path zwb-private-emacs-config-path) load-path))&#xA;   '(&quot;lib&quot;&quot;theme&quot; &quot;&quot;)))&#xA;&#xA;(eval-and-compile&#xA;  (defvar use-package-verbose t)&#xA;  (require 'cl)&#xA;  (require 'use-package))&#xA;&#xA;(use-package zwb-js&#xA;  :defer t  ;; I tried commit or uncommit it&#xA;  :load-path (lambda () (expand-file-name (concat zwb-private-emacs-config-path &quot;lib/zwb-js&quot;)))&#xA;  :init (require 'zwb-js-autoloads))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both of the way, I cann't get &lt;strong&gt;debug&lt;/strong&gt; in &lt;strong&gt;*Message*&lt;/strong&gt; buffer, which defined in zwb-js/init-package for test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why I cann't see my defuns through M-x? &lt;/li&gt;&#xA;&lt;li&gt;What's the best way to use &lt;strong&gt;use-package&lt;/strong&gt; to load zwb-js?&lt;/li&gt;&#xA;&lt;li&gt;How to autoload my zwb-js group?&lt;/li&gt;&#xA;&lt;li&gt;How to auto run all defun defined in zwb-js?&lt;/li&gt;&#xA;&lt;li&gt;What's defgroup's prefix used for? Would you please give me an example?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My OS version: &lt;strong&gt;Mac OS X 10.11.2 beta4&lt;/strong&gt;&lt;br&gt;&#xA;My Emacs version: &lt;strong&gt;24.5.1 (brew emacs-mac-emacs)&lt;/strong&gt;&lt;br&gt;&#xA;My Emacs config is based on &lt;strong&gt;Prelude&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="10004" LastEditorUserId="10004" LastEditDate="2015-11-22T04:04:45.843" LastActivityDate="2015-11-22T04:04:45.843" Title="How to autoload a custom group?" Tags="|minor-mode|use-package|autoload|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18299" PostTypeId="1" AcceptedAnswerId="18309" CreationDate="2015-11-22T04:08:11.023" Score="4" ViewCount="3709" Body="&lt;p&gt;A vim user trying to make the leap to emacs here. A roadblock I'm facing right now is a small convenience-remapping. These remaps aren't important, but my difficulty in making them makes me worry I'm fundamentally misunderstanding something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maps as I have them now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'normal evil-normal-state-map (kbd &quot;&amp;lt;key-chord&amp;gt; C-w C-k&quot;) 'evil-window-up)&#xA;(evil-define-key 'normal evil-normal-state-map (kbd &quot;&amp;lt;key-chord&amp;gt; C-w C-j&quot;) 'evil-window-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These are meant to make the usual vim window motion commands (C-w k, C-w j, etc.) a bit more forgiving on my often rather stupid fingers. Am I missing something fundamental, still, about this? Do I need to create my own minor mode / separate keymapping just for this tiny addition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The symptom: Even with these mappings in my &lt;code&gt;.emacs&lt;/code&gt;, I still can't switch between windows with C-w C-k and C-w C-j keychords. The minibuffer helpfully reports that those chords are unbound.&lt;/p&gt;&#xA;" OwnerUserId="10256" LastActivityDate="2015-11-24T16:48:41.733" Title="How to define normal-mode keychords in evil mode" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18300" PostTypeId="1" AcceptedAnswerId="18320" CreationDate="2015-11-22T04:14:33.310" Score="6" ViewCount="2371" Body="&lt;p&gt;gnuplot ASCII graph is amazing.&#xA;I'd like to include gnuplot dumb ASCII graph results in babel code block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC gnuplot :results output :file gnuplot-dumb-plot.txt&#xA;set term dumb&#xA;set yrange [0:1.5]&#xA;plot [-2:2] exp(-x*x)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alas, first line of gnuplot-dumb-plot.txt includes &lt;code&gt;^L&lt;/code&gt; line feed control code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;code&gt;#+RESULTS:&lt;/code&gt; does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding another &lt;code&gt;#+INCLUDE:&lt;/code&gt; with example block specified does work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: gnuplot-dumb-plot.txt example&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or excluding first line with &lt;code&gt;:lines&lt;/code&gt; specified,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: gnuplot-dumb-plot.txt example :lines &quot;2-&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or by sed deleting first line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh&#xA;sed -e '1d' gnuplot-dumb-plot.txt&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;work, but are not elegant.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+begin_example&#xA;      +--------+-------+--------+--------+-------+--------+-------+--------+&#xA;  1.4 +-+      +       +        +        +       +        +       +      +-+&#xA;      |                                                  exp(-x*x) ******* |&#xA;      |                                                                    |&#xA;  1.2 +-+                                                                +-+&#xA;      |                                                                    |&#xA;    1 +-+                              ****                              +-+&#xA;      |                            ****    ****                            |&#xA;      |                          ***          ***                          |&#xA;  0.8 +-+                       *                *                       +-+&#xA;      |                       **                  **                       |&#xA;  0.6 +-+                   **                      **                   +-+&#xA;      |                    **                        **                    |&#xA;      |                  **                            **                  |&#xA;  0.4 +-+              **                                **              +-+&#xA;      |              ***                                  ***              |&#xA;  0.2 +-+          ***                                      ***          +-+&#xA;      |         ***                                            ***         |&#xA;      +   ******       +        +        +       +        +       ******   +&#xA;    0 ****-----+-------+--------+--------+-------+--------+-------+-----****&#xA;     -2      -1.5     -1      -0.5       0      0.5       1      1.5       2&#xA;&#xA;#+end_example&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are there any options or hacks for including gnuplot dumb ASCII graphs?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Thanks to @wvxvw, it turned out to be:&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Note: Emacs 24.5.1, org-mode 8.3.2, gnuplot Version 5.0 patchlevel 1, Mac OS X 10.10.5.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;:session none&lt;/code&gt; is required in gnuplot code block for printing ASCII graph in &lt;code&gt;#+RESULTS:&lt;/code&gt; .&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I wish if gnuplot has an option such as &lt;code&gt;noheadfeed&lt;/code&gt; for deleting a top &lt;code&gt;^L&lt;/code&gt; / or, perhaps org-babel might manage in the future.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTML export&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;:results output verbatim&lt;/code&gt; in gnuplot code block enables printing ASCII graph at &lt;code&gt;#+RESULTS:&lt;/code&gt; within org-mode.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-html-export-as-html&lt;/code&gt; works. This seems to be a simple solution if you don't need LaTeX.&lt;/li&gt;&#xA;&lt;li&gt;But &lt;code&gt;^L&lt;/code&gt; appears in the beginning of &lt;code&gt;#+RESULTS:&lt;/code&gt; which later makes error at LaTeX.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;LaTeX export&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Due to &lt;code&gt;^L&lt;/code&gt;, &quot;Forbidden control sequence&quot; in LaTeX, &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt; fails.&lt;/li&gt;&#xA;&lt;li&gt;For LaTeX export, do not &lt;code&gt;C-c C-c&lt;/code&gt; at gnuplot code block. &lt;code&gt;#+RESULTS:&lt;/code&gt; at gnuplot should be left blank.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;:exports none&lt;/code&gt; is also required in gnuplot code block for avoiding LaTeX error.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Org-mode, HTML, LaTeX&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;@wvxvw's solution removing &lt;code&gt;^L&lt;/code&gt; (&lt;code&gt;\014&lt;/code&gt;) succeeds in org-mode &lt;code&gt;#+RESULTS&lt;/code&gt;, HTML/LaTeX exports.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;#+NAME:&lt;/code&gt; , &lt;code&gt;:var&lt;/code&gt; , &lt;code&gt;#+CALL:&lt;/code&gt; for output a clean ASCII graph &lt;code&gt;#+RESULTS:&lt;/code&gt; (without &lt;code&gt;^L&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-11-24T06:33:35.000" LastActivityDate="2015-11-24T17:20:21.933" Title="using gnuplot dumb terminal ASCII graph in org-mode" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18301" PostTypeId="2" ParentId="18295" CreationDate="2015-11-22T04:23:28.800" Score="2" Body="&lt;p&gt;Org provides a variety of hooks to modify text on export.  So, re-using your regular expression and org's italic emphasis, one way would be &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-export-before-parsing-hook (lambda (backend)&#xA;            (replace-regexp &quot;^\\(.*:\\)[ ]*$&quot; &quot;/\\1/&quot;)))    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, then it will only appear in the exported document.  So you may want to define a custom face and add a hook for the export.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-11-22T04:23:28.800" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18304" PostTypeId="1" AcceptedAnswerId="18330" CreationDate="2015-11-22T07:15:01.057" Score="9" ViewCount="2064" Body="&lt;p&gt;As the question suggest, I am trying to set up the &lt;a href=&quot;http://auto-complete.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;auto-complete&lt;/code&gt;&lt;/a&gt; package for writing papers. I have also installed &lt;a href=&quot;https://github.com/syohex/emacs-ac-ispell&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ac-ispell&lt;/code&gt;&lt;/a&gt;. So far it seems more or less useless, mostly because it is &lt;strong&gt;way too slow&lt;/strong&gt;. Suggestions take several full seconds to appear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the relevant lines that I currently have in my init, which are based directly on the recommendations in the documentation for these two packages:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(add-to-list 'ac-modes '(org-mode text-mode LaTeX-mode))&#xA;&#xA;(custom-set-variables&#xA; '(ac-ispell-requires 4)&#xA; '(ac-ispell-fuzzy-limit 2))&#xA;&#xA;(eval-after-load &quot;auto-complete&quot;&#xA;  '(progn&#xA;     (ac-ispell-setup)))&#xA;&#xA;(add-hook 'git-commit-mode-hook 'ac-ispell-ac-setup)&#xA;(add-hook 'mail-mode-hook 'ac-ispell-ac-setup)&#xA;(add-hook 'org-mode-hook 'ac-ispell-ac-setup)&#xA;(add-hook 'text-mode-hook 'ac-ispell-ac-setup)&#xA;(add-hook 'LaTeX-mode-hook 'ac-ispell-ac-setup)&#xA;&#xA;(global-auto-complete-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In case this helps, the resulting value for &lt;code&gt;ac-sources&lt;/code&gt; is &lt;code&gt;(ac-source-ispell ac-source-ispell-fuzzy ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you've had better luck with this then I have, please help!&lt;/p&gt;&#xA;" OwnerUserId="874" LastEditorUserId="10269" LastEditDate="2016-01-05T22:42:05.383" LastActivityDate="2018-07-11T09:20:25.073" Title="Optimal settings for auto-complete for writing papers / prose in natural language?" Tags="|auto-complete-mode|writing|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18305" PostTypeId="2" ParentId="18262" CreationDate="2015-11-22T08:19:03.290" Score="4" Body="&lt;p&gt;Starting with Tramp 2.2.13, you will be able to overwrite entries of &lt;code&gt;tramp-methods&lt;/code&gt;. In your case, you would do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-connection-properties&#xA;             (list (regexp-quote &quot;/ssh:user@randomhost.your.domain:&quot;)&#xA;                   &quot;login-args&quot;&#xA;                   '((&quot;-A&quot;) (&quot;-l&quot; &quot;%u&quot;) (&quot;-p&quot; &quot;%p&quot;) (&quot;%c&quot;)&#xA;                     (&quot;-e&quot; &quot;none&quot;) (&quot;%h&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tramp 2.2.13 is integrated in the upcoming Emacs 25.1. Tramp 2.2.13 will be released itself at the end of this year. For the time being, you could use the development versions of Emacs or Tramp, of course.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-11-22T08:19:03.290" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18307" PostTypeId="1" CreationDate="2015-11-22T08:46:17.603" Score="1" ViewCount="188" Body="&lt;p&gt;I have some subscripts in my org file like &lt;code&gt;B_25&lt;/code&gt;, &lt;code&gt;B_30&lt;/code&gt;. These subscripts can be exported to LaTeX like &lt;code&gt;B_{25}&lt;/code&gt;, &lt;code&gt;B_{30}&lt;/code&gt;. However, I want part of the subscripts like &lt;code&gt;B&lt;/code&gt; to be exported as italic &lt;em&gt;B&lt;/em&gt;. As one solution for this, I can wrap these thing into a math environment like &lt;code&gt;\(B_{25}\)&lt;/code&gt;. But since my file contains large numbers of these subscripts, I just want to write the &lt;code&gt;B_25&lt;/code&gt; in org file and export as &lt;code&gt;\(B_{25}\)&lt;/code&gt; to LaTeX file in a programmable way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a subscript filter function in org-mode, so I tried to use it to wrap the subscripts by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wrap-subscript-with-math-environment (contents backend info)&#xA;  (when (eq backend 'latex)&#xA;   (format &quot;\\(%s\\)&quot; contents)))&#xA;&#xA;(add-to-list 'org-export-filter-subscript-functions 'wrap-subscript-with-math-environment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the results exported are like &lt;code&gt;B\($_{\text{25}}$ \)&lt;/code&gt;. It seems like the subscript filter contents only contain &lt;code&gt;_25&lt;/code&gt; part. Does anyone have some solutions about this?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2015-11-22T08:56:53.193" LastActivityDate="2015-11-22T08:56:53.193" Title="How can I wrap the subscript into a math environment in Org-mode?" Tags="|org-mode|org-export|latex|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18309" PostTypeId="2" ParentId="18299" CreationDate="2015-11-22T10:34:52.203" Score="2" Body="&lt;p&gt;Update: &lt;code&gt;evil-define-key&lt;/code&gt; is for a different purpose, namely installing a keybinding for a specific Evil state involving a mode's map.  For example you could configure &lt;code&gt;emacs-lisp-mode&lt;/code&gt; to do something different with &lt;code&gt;RET&lt;/code&gt; in &lt;code&gt;insert&lt;/code&gt; state.  As you're not making use of this, &lt;code&gt;define-key&lt;/code&gt; with &lt;code&gt;eval-after-load&lt;/code&gt; or &lt;code&gt;with-eval-after-load&lt;/code&gt; is the more sensible option for customizing Evil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please study &lt;code&gt;evil-maps.el&lt;/code&gt; (which you can look up from inside Emacs with &lt;code&gt;M-x find-library&lt;/code&gt;) to know what keymaps to modify.  Given this information, the correct invocations are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-window-map (kbd &quot;C-k&quot;) 'evil-window-up)&#xA;(define-key evil-window-map (kbd &quot;C-j&quot;) 'evil-window-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you want to do it properly, defer these forms until Evil is enabled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'evil-maps&#xA;  (define-key evil-window-map (kbd &quot;C-k&quot;) 'evil-window-up)&#xA;  (define-key evil-window-map (kbd &quot;C-j&quot;) 'evil-window-down))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On older Emacs versions than 24.4:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-maps&#xA;  '(progn&#xA;    (define-key evil-window-map (kbd &quot;C-k&quot;) 'evil-window-up)&#xA;    (define-key evil-window-map (kbd &quot;C-j&quot;) 'evil-window-down)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-11-24T16:48:41.733" LastActivityDate="2015-11-24T16:48:41.733" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18310" PostTypeId="2" ParentId="9527" CreationDate="2015-11-22T10:53:48.777" Score="2" Body="&lt;p&gt;Unfortunately, the format of citations is hard-coded as the latex one in reftex source code (see function &lt;code&gt;reftex-view-crossref&lt;/code&gt; in file &lt;code&gt;reftex-dcr.el&lt;/code&gt;), so there's no easy way to change it.  However, if what you need is just to be able to look up the citation at point, the following does it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'reftex-dcr)&#xA;(defun my-reftex-view-pandoc-cite ()&#xA;   &quot;View pandoc citation&quot;&#xA;   (interactive)&#xA;   (let ((w (word-at-point)))&#xA;    (if (eq ?@ (elt w 0))&#xA;    (setq dw (reftex-view-cr-cite &quot;&quot; (substring w 1) 'tmp-window))&#xA;      (if (and (eq arg 2) (windowp dw)) (select-window dw))&#xA;      (error &quot;Not on a citation&quot;)&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't need to enable &lt;code&gt;reftex-mode&lt;/code&gt; but you have to tell RefTex about your bibliography file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq reftex-default-bibliography '(&quot;biblio&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Something similar could be done for the 'idle display' feature, but it may be more complex.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2015-11-23T14:48:35.933" LastActivityDate="2015-11-23T14:48:35.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18311" PostTypeId="2" ParentId="18279" CreationDate="2015-11-22T12:45:20.547" Score="1" Body="&lt;p&gt;&lt;code&gt;M-x gud-gdb&lt;/code&gt; is fine when debugging on emacs24, this works on gdb6+&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x gdb&lt;/code&gt; requires gdb7+&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when debugging, you need compile your program with &lt;code&gt;gcc -g -O0&lt;/code&gt;. I use &lt;code&gt;M-x gud-gdb&lt;/code&gt; on both Mac/Linux without issue.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2015-11-22T12:45:20.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18312" PostTypeId="1" AcceptedAnswerId="18326" CreationDate="2015-11-22T15:24:52.530" Score="3" ViewCount="886" Body="&lt;p&gt;My &lt;code&gt;.vimrc&lt;/code&gt; contains this snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nnoremap S :%s//g&amp;lt;LEFT&amp;gt;&amp;lt;LEFT&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It creates a key binding which means that when I'm in normal mode, I can:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;type the character &lt;code&gt;S&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;type the string &lt;code&gt;find/replace&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;hit &lt;kbd&gt;Enter&lt;/kbd&gt;, which replaces all occurrences of &lt;code&gt;find&lt;/code&gt; in the current buffer with &lt;code&gt;replace&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;return to normal mode&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'd like similar functionality in Spacemacs.  Prefixing the command with &lt;kbd&gt;Space&lt;/kbd&gt; is fine.  How do I do it?&lt;/p&gt;&#xA;" OwnerUserId="10036" LastActivityDate="2015-11-23T05:32:28.163" Title="How can I recreate this keybinding in Spacemacs?" Tags="|key-bindings|spacemacs|query-replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18313" PostTypeId="1" CreationDate="2015-11-22T15:24:53.720" Score="5" ViewCount="1743" Body="&lt;p&gt;I have the following org-template set up: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;mw&quot; &quot;Note&quot; entry (file+headline &quot;~/org/mathematica.org&quot; &quot;WIA&quot;)&#xA;  &quot;* %f code review \n ** %T \n%? \n%a \n%i&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So that the heading name is determined by the file name and the &quot;code review,&quot; and then there's a subheading using the date and time of the note.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for example I've already made a note using this template while visiting the file foo.do, I would like the next entry to be with that one as in the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;     * foo.do code review&#xA;&amp;gt;     **&amp;lt;2015-11-22 Sun 09:00&amp;gt; &#xA;&amp;gt;     first note&#xA;&amp;gt;     **&amp;lt;2015-11-22 Sun 10:00&amp;gt; &#xA;&amp;gt;     second note&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But instead I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;     * foo.do code review&#xA;&amp;gt;     **&amp;lt;2015-11-22 Sun 09:00&amp;gt; &#xA;&amp;gt;     first note&#xA;&amp;gt;     * foo.do code review&#xA;&amp;gt;     **&amp;lt;2015-11-22 Sun 10:00&amp;gt; &#xA;&amp;gt;     second note&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make all the foo.do code review notes be under the same heading? &lt;/p&gt;&#xA;" OwnerUserId="10208" LastActivityDate="2020-03-05T18:02:35.390" Title="file org-capture item under existing heading if it exists" Tags="|org-mode|org-capture|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18314" PostTypeId="1" AcceptedAnswerId="18315" CreationDate="2015-11-22T15:40:07.383" Score="5" ViewCount="1204" Body="&lt;p&gt;The popular Mac editor iA Writer (&lt;a href=&quot;https://ia.net/writer/mac/&quot; rel=&quot;noreferrer&quot;&gt;https://ia.net/writer/mac/&lt;/a&gt;) has many nifty features that I rather like. So far, I've been able to recreate the look and feel for the most part -- except for the typewriter-style scrolling that keeps the current line centered in the window. Any ideas on how to implement this? &lt;/p&gt;&#xA;" OwnerUserId="10260" LastActivityDate="2015-11-22T16:30:52.867" Title="How to recreate iA Writer-style typewriter scrolling in Emacs?" Tags="|scrolling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18315" PostTypeId="2" ParentId="18314" CreationDate="2015-11-22T16:23:23.023" Score="3" Body="&lt;p&gt;&lt;code&gt;centered-cursor-mode&lt;/code&gt; Makes the cursor stay vertically in a defined position (usually centered). The vertical position can be altered, see key definition below. &lt;a href=&quot;http://melpa.org/#/centered-cursor-mode&quot; rel=&quot;nofollow&quot;&gt;http://melpa.org/#/centered-cursor-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package centered-cursor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then add &lt;code&gt;(centered-cursor-mode)&lt;/code&gt; to your &lt;code&gt;org&lt;/code&gt; hook.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="5142" LastEditDate="2015-11-22T16:30:52.867" LastActivityDate="2015-11-22T16:30:52.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18316" PostTypeId="1" CreationDate="2015-11-22T17:29:59.880" Score="0" ViewCount="434" Body="&lt;p&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode version 8.2.10 (release_8.2.10&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when I use &lt;code&gt;C-q M-Return&lt;/code&gt;. It shows &lt;code&gt;^[&lt;/code&gt; .&#xA;But when I use &lt;code&gt;C-q  M-S-Return&lt;/code&gt;. It still shows &lt;code&gt;^[&lt;/code&gt; . It seems S: Shift is useless. &lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2015-11-22T17:49:49.933" Title="The shift is useless when I am in the iterm2 with emacs -nw" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ClosedDate="2015-11-23T15:28:48.237" ContentLicense="CC BY-SA 3.0" />
  <row Id="18317" PostTypeId="2" ParentId="18245" CreationDate="2015-11-22T17:43:28.923" Score="6" Body="&lt;p&gt;I made quite a bit of progress on this. Reading up on key translation I found &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#Translation-Keymaps&quot; rel=&quot;noreferrer&quot; title=&quot;Translation Keymaps&quot;&gt;this Emacs manual page&lt;/a&gt; on Translation keymaps which has an interesting &lt;code&gt;hyperify&lt;/code&gt; function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hyperify (prompt)&#xA;  (let ((e (read-event)))&#xA;    (vector (if (numberp e)&#xA;                (logior (lsh 1 24) e)&#xA;              (if (memq 'hyper (event-modifiers e))&#xA;                  e&#xA;                (add-event-modifier &quot;H-&quot; e))))))&#xA;&#xA;(defun add-event-modifier (string e)&#xA;  (let ((symbol (if (symbolp e) e (car e))))&#xA;    (setq symbol (intern (concat string&#xA;                                 (symbol-name symbol))))&#xA;    (if (symbolp e)&#xA;        symbol&#xA;      (cons symbol (cdr e)))))&#xA;&#xA;(define-key local-function-key-map &quot;\C-ch&quot; 'hyperify)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An equivalent &lt;code&gt;superify&lt;/code&gt; function can be written by replacing the &lt;code&gt;lsh 1 24&lt;/code&gt; with &lt;code&gt;lsh 1 23&lt;/code&gt; (see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Other-Char-Bits.html&quot; rel=&quot;noreferrer&quot;&gt;Emacs page on character modifier bits&lt;/a&gt;). However, googling hyperify resulted in a hit on the Emacs wiki called &quot;StickyModifiers&quot; which mentions a built in function to achieve this called &lt;code&gt;event-apply-super-modifier&lt;/code&gt;. I guess the manual is a bit out of date or it was just for pedagogical purposes. In any case, this will make APPS/MENU into a super key in both terminal and W32 Emacs under mintty:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (equal system-type 'cygwin)&#xA;     (if (equal window-system 'w32)&#xA;         (setq w32-pass-apps-to-system nil&#xA;               w32-apps-modifier 'super)&#xA;       (define-key local-function-key-map (kbd &quot;&amp;lt;print&amp;gt;&quot;) 'event-apply-super-modifier)))&#xA;&#xA; (define-key global-map (kbd &quot;s-h&quot;) (lambda () (interactive) (message &quot;hello from menu key via s- prefix&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt; It is not perfect however, because holding the APPS key down results in the string &lt;code&gt;[29~&lt;/code&gt; being repeatedly written into the buffer, so you have to be quick. Contrast this with the way that the Alt key works: you can hold it down for as long as you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Alternative Technique&lt;/strong&gt;&#xA;Over at ErgoEmacs I found an article talking about leader keys, which unfortunately I cannot post because reputation is no longer high enough having given it all to bounty. &lt;strong&gt;&lt;em&gt;SIGH&lt;/em&gt;&lt;/strong&gt;. Anyway, it is called &quot;emacs_menu_app_keys&quot;. Using this technique:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (equal system-type 'cygwin)&#xA;     (if (equal window-system 'w32)&#xA;         (setq w32-pass-apps-to-system nil&#xA;               w32-apps-modifier nil)&#xA;       (progn ;; force all alternatives to &amp;lt;apps&amp;gt; so we can write one set of keybindings.&#xA;         (define-key key-translation-map (kbd &quot;&amp;lt;print&amp;gt;&quot;) (kbd &quot;&amp;lt;apps&amp;gt;&quot;))&#xA;         (define-key key-translation-map (kbd &quot;&amp;lt;menu&amp;gt;&quot;) (kbd &quot;&amp;lt;apps&amp;gt;&quot;)))))&#xA;&#xA; (define-key global-map (kbd &quot;&amp;lt;apps&amp;gt; h&quot;)&#xA;    (lambda () (interactive) (message &quot;hello from menu key via &amp;lt;apps&amp;gt; leader key&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works great, you press and release APPS before pressing H. I think I prefer it to the first technique as it is easier to type and this prefix key will be reserved for mnemonic-style, one-shot function bindings anyway i.e. nothing that I need to press repeatedly like &lt;code&gt;C-n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bounty&lt;/strong&gt;&#xA;If anybody can come up with something better, especially if they can get the first technique to work as perfectly as using the Alt or Ctrl keys I will still award the bounty to them.&lt;/p&gt;&#xA;" OwnerUserId="10231" LastActivityDate="2015-11-22T17:43:28.923" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18318" PostTypeId="2" ParentId="18316" CreationDate="2015-11-22T17:49:49.933" Score="1" Body="&lt;p&gt;That is due to the nature of terminals. The limitation is inherited from the old-style physical terminals, which communicated with computers via a serial line. Though in principle, the protocol on that serial line could have been used to encode all kinds of modifier key usage, in practice it just encoded ASCII. Later this was extended to include escape sequences for things like arrow keys and function keys, plus perhaps some eight bit characters. Modifier keys like Ctrl and Shift merely zeroed some bits from the code of the key being pressed (for the Ctrl key) or turned lower case into upper case, and numbers into symbols (for the Shift key).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there is no way for a terminal emulator like iTerm2 to communicate to the attached Emacs process that the shift key (or ctrl key) was pressed together with the return key.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2015-11-22T17:49:49.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18319" PostTypeId="2" ParentId="18313" CreationDate="2015-11-22T19:26:02.003" Score="-1" Body="&lt;p&gt;You can't; there's nothing implemented that would let you do it. You'll have to make some modifications to the code to support it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use capturing myself, so I took a look through the documentation to see how it works. You've no doubt read it, but you can jump right to this chapter of the manual in emacs by running &lt;code&gt;M-: (info &quot;(org) Capture&quot;)&lt;/code&gt;; of course it's also available &lt;a href=&quot;http://orgmode.org/org.html#Capture&quot; rel=&quot;nofollow&quot;&gt;online&lt;/a&gt;. This also tells me that the user starts a capture by calling the function &lt;code&gt;org-capture&lt;/code&gt;, which will be the most natural place to start reading the source. &lt;code&gt;C-h f org-capture&lt;/code&gt; will show the documentation of that function, along with a link directly to its source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you define a capture template you're specifying several things: how to select the template, what type of entry to create, where to save the entry, and any boilerplate text to insert on behalf of the user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question asks that org-capture match the boilerplate text against the content of the save location in order to avoid adding some lines to the file twice. You could implement it this way, but I recommend that you don't. The save location doesn't need to be an org file at all; you could be capturing to any type of file at all. The boilerplate text therefore isn't always going to use org syntax. A good example would be capturing to a BibTeX file; the boilerplate would presumably be LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead I think the best way to implement it would be to add a new type of save location. These are all handled by the &lt;code&gt;org-capture-set-target-location&lt;/code&gt; function in &lt;code&gt;org-capture.el&lt;/code&gt;. You're currently using the &lt;code&gt;'file+headline&lt;/code&gt; locator, which takes a filename and a headline, and sets org-capture to insert the new entry as a subheading of that headline found in that file. This is almost what you need. If you could specify &lt;code&gt;(file+headline &quot;~/org/mathematica.org&quot; &quot;WIA&quot; &quot;%f code review&quot;)&lt;/code&gt; then you would be in good shape.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the &lt;code&gt;'file+headline&lt;/code&gt; locator only accepts a single headline, and doesn't allow any of the substitutions allowed in the boilerplate text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Allowing multiple headlines shouldn't be too difficult to implement. Just modify this branch of the case in &lt;code&gt;org-capture-set-target-location&lt;/code&gt; so that it loops over all of the remaining items in the list, first searching for the headline and then narrowing the buffer to that subtree after it either finds it or creates it. Each time through the loop the search will naturally be limited to the narrowed region of the file, so the correct subheadings will be found or created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Allowing substitutions should be even easier; just call &lt;code&gt;org-capture-fill-template&lt;/code&gt; on each argument before using it. This should be done for all cases, so do it before handling any of them. This list is never likely to be very long, so the simplest thing to do is to map down the list calling &lt;code&gt;org-capture-fill-template&lt;/code&gt; on all the strings, even though you're later going to loop over the list again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, once you've written this I recommend submitting your changes for inclusion in the next release; see &lt;a href=&quot;http://orgmode.org/&quot; rel=&quot;nofollow&quot;&gt;orgmode.org&lt;/a&gt; for the details on how to do that.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-22T19:26:02.003" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18320" PostTypeId="2" ParentId="18300" CreationDate="2015-11-22T20:55:46.347" Score="4" Body="&lt;p&gt;Below is the example code for what I meant. Also note that you need &lt;code&gt;:session none&lt;/code&gt; since otherwise the output isn't generated. This looks like a bug to me in &lt;code&gt;org-babel-execute:gnuplot&lt;/code&gt;, so, if you feel like it, you could write to Org mailing list about it. ;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: pp_ascii_gnuplot&#xA;#+BEGIN_SRC emacs-lisp :var plot=&quot;&quot;&#xA;  (mapconcat 'identity (cl-subseq (split-string plot &quot;\n&quot;) 2 -2) &quot;\n&quot;)&#xA;#+END_SRC&#xA;&#xA;#+NAME: graph&#xA;#+BEGIN_SRC gnuplot :results output :session none&#xA;set term dumb&#xA;set yrange [0:1.5]&#xA;plot [-2:2] exp(-x*x)&#xA;#+END_SRC&#xA;&#xA;#+CALL: pp_ascii_gnuplot(plot=graph())&#xA;&#xA;#+RESULTS:&#xA;#+begin_example&#xA;      +--------+-------+--------+--------+-------+--------+-------+--------+&#xA;  1.4 ++       +       +        +        +       +        exp(-x*x) ******++&#xA;      |                                                                    |&#xA;      |                                                                    |&#xA;  1.2 ++                                                                  ++&#xA;      |                                                                    |&#xA;    1 ++                               ****                               ++&#xA;      |                            ****    ****                            |&#xA;      |                          ***          ***                          |&#xA;  0.8 ++                        *                *                        ++&#xA;      |                       **                  **                       |&#xA;  0.6 ++                    **                      **                    ++&#xA;      |                    **                        **                    |&#xA;      |                  **                            **                  |&#xA;  0.4 ++               **                                **               ++&#xA;      |              ***                                  ***              |&#xA;  0.2 ++           ***                                      ***           ++&#xA;      |         ***                                            ***         |&#xA;      +   ******       +        +        +       +        +       ******   +&#xA;    0 ****-----+-------+--------+--------+-------+--------+-------+-----****&#xA;     -2      -1.5     -1      -0.5       0      0.5       1      1.5       2&#xA;#+end_example&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-11-22T20:55:46.347" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18321" PostTypeId="1" CreationDate="2015-11-22T21:01:50.937" Score="1" ViewCount="152" Body="&lt;p&gt;How can you run fill-paragraph on an exported document?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;fill-paragraph&lt;/code&gt;/&lt;code&gt;auto-fill-mode&lt;/code&gt; distribute and insert newlines which help when reading a document in an editor that doesn't necessarily wrap long lines automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to use &lt;code&gt;auto-fill-mode&lt;/code&gt; because it transforms the org mode content being edited.  I just want exported content to have inserted newlines.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2015-11-22T21:01:50.937" Title="Run fill-paragraph for content on org-mode export" Tags="|org-mode|org-export|fill-paragraph|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18322" PostTypeId="2" ParentId="17348" CreationDate="2015-11-22T22:43:00.437" Score="3" Body="&lt;p&gt;An export filter (section &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html#Advanced-configuration&quot; rel=&quot;nofollow&quot; title=&quot;12.15&quot;&gt;12.15&lt;/a&gt; of org documentation) can do that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-latex-item (text backend info)&#xA;  &quot;Replace \\item with \\cvitem.&quot;&#xA;  (when (org-export-derived-backend-p backend 'latex)&#xA;    (concat &quot;\\cvitem&quot; (substring text 5))))&#xA;&#xA;(add-to-list 'org-export-filter-item-functions&#xA;         'my-latex-item)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For extending with other back-ends the &lt;code&gt;when&lt;/code&gt; can be replaced by a &lt;code&gt;cond&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2015-11-23T14:52:17.910" LastActivityDate="2015-11-23T14:52:17.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18323" PostTypeId="1" AcceptedAnswerId="18327" CreationDate="2015-11-22T23:44:40.893" Score="0" ViewCount="52" Body="&lt;p&gt;Using Emacs with Evil Mode, I wonder if there's a way to quickly re-enter all the characters that were typed before a whitespace character is entered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: you type &lt;code&gt;\hat{\beta}_{OLS,j}&lt;/code&gt; and then you add a whitespace  &lt;code&gt;&lt;/code&gt;, now you want to re-type &lt;code&gt;\hat{\beta}_{OLS,j}&lt;/code&gt; automatically, so that in the end you have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\hat{\beta}_{OLS,j} \hat{\beta}_{OLS,j}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example 2: you type &lt;code&gt;foo foo complicated_formula&lt;/code&gt; and then enter a whitespace &lt;code&gt;&lt;/code&gt;, now you want to retype &lt;code&gt;complicated_formula&lt;/code&gt; automatically, so that in the end you obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;foo foo complicated_formula complicated_formula&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this functionality? Is there something similar or better than this already available?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for helping me out! Keep in mind I'm extremely newb. Thanks again! :D&lt;/p&gt;&#xA;" OwnerUserId="9515" LastEditorUserId="3972" LastEditDate="2016-03-14T01:21:47.033" LastActivityDate="2016-03-14T01:21:47.033" Title="Repeat typed characters before a space" Tags="|evil|keyboard-macros|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18324" PostTypeId="1" AcceptedAnswerId="18325" CreationDate="2015-11-23T01:19:50.670" Score="3" ViewCount="715" Body="&lt;p&gt;How do you save a publishing behavior so that only a single org file out of a directory of org files is published?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-publish-file&lt;/code&gt; could be used with a larger unused project definition, but content could be published unintentionally.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2018-07-25T22:10:36.037" Title="Publishing a single file via org-publish" Tags="|org-mode|org-publish|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18325" PostTypeId="2" ParentId="18324" CreationDate="2015-11-23T01:19:50.670" Score="7" Body="&lt;p&gt;This was non-obvious and the scenario of single/select files wasn't mentioned in any documentation specifically, so here's my solution: &lt;strong&gt;(only the last two lines are relevant)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-publish-project-alist&#xA;      `((&quot;project&quot;&#xA;         :base-directory &quot;~/org/&quot;&#xA;         :publishing-function org-html-publish-to-html&#xA;         :publishing-directory &quot;~/html_pub/&quot;&#xA;         :exclude &quot;.*&quot;&#xA;         :include [&quot;project.org&quot;])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(specify the parent directory, exclude all files, and explicitly include the file(s) which you intend to publish)&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2015-11-23T01:19:50.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18326" PostTypeId="2" ParentId="18312" CreationDate="2015-11-23T04:19:25.890" Score="5" Body="&lt;p&gt;Here is a snippet to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-global-ex-search ()&#xA;  (interactive)&#xA;  (let ((evil-ex-substitute-global t))&#xA;    (evil-ex &quot;%s/&quot;)))&#xA;(define-key evil-normal-state-map &quot;S&quot; 'my-global-ex-search)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea is to define an interactive function (can be called by the user) to call &lt;code&gt;evil-ex&lt;/code&gt; with the initial input and &lt;code&gt;evil-ex-substitute&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. Then we bind this function to S in the &lt;code&gt;normal state&lt;/code&gt; keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: added support for &lt;code&gt;/g&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2015-11-23T05:32:28.163" LastActivityDate="2015-11-23T05:32:28.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18327" PostTypeId="2" ParentId="18323" CreationDate="2015-11-23T04:47:32.027" Score="2" Body="&lt;p&gt;&lt;code&gt;qayT pq&lt;/code&gt; creates a macro 'a' that copies the text from the previous space to the cursor and then paste it. You can write a function the do this as well. And i think this should be a vim-related question.&lt;/p&gt;&#xA;" OwnerUserId="10236" LastEditorUserId="10236" LastEditDate="2015-11-23T22:43:58.780" LastActivityDate="2015-11-23T22:43:58.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18329" PostTypeId="1" CreationDate="2015-11-23T10:08:51.377" Score="-1" ViewCount="111" Body="&lt;p&gt;In my document, I have some word like a_table_name_{variable}, and I just want it to export to HMTL to a_table_name_{variable} literally,&#xA;but when export it error out. And if I remove {variable} ghen it could export correctly. SO how to make it export literally (as it is)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;update:&#xA;If I use &#xA;a_table_name_ {variable}, then it can export without any issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if use a_table_name_{variable}, it will throw the error of&#xA;Wrong type argument: stringp, (subscript (:begin 17627 :end 17631 :use-brackets-p nil :contents-begin 17628 :contents-end 17631 ...) #(&quot;Key&quot; 0 3 (:parent #0)))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So looks like I can't use _{variable}, but could use _ {variable}&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="6697" LastEditDate="2015-11-24T01:37:31.930" LastActivityDate="2015-11-24T01:37:31.930" Title="how to export some thing like {variable} literally in org mode?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18330" PostTypeId="2" ParentId="18304" CreationDate="2015-11-23T10:45:04.380" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.dr-qubit.org/predictive/predictive-user-manual/html/What-is-predictive-completion_003f.html#What-is-predictive-completion_003f&quot; rel=&quot;nofollow&quot;&gt;Predictive-mode&lt;/a&gt; claims to be what you're looking for, though I'm not sure how it compares to more modern completion frameworks like &lt;a href=&quot;http://company-mode.github.io/&quot; rel=&quot;nofollow&quot;&gt;company-mode&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-11-23T10:45:04.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18331" PostTypeId="2" ParentId="13819" CreationDate="2015-11-23T11:02:10.787" Score="2" Body="&lt;p&gt;In the end the solution that worked for me was to put the entire email in a DIV tag. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mime-html-hook&#xA;      (lambda ()&#xA;        (goto-char (point-min))&#xA;        (insert &quot;&amp;lt;div style=\&quot;font-family:Georgia,serif\&quot;&amp;gt;&quot;)&#xA;        (goto-char (point-max))&#xA;        (insert &quot;&amp;lt;/div&amp;gt;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-11-23T11:02:10.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18332" PostTypeId="2" ParentId="9908" CreationDate="2015-11-23T11:17:04.220" Score="10" Body="&lt;p&gt;If you're doing editing at the locations you land on, &lt;code&gt;goto-last-change&lt;/code&gt; will do this for you. &lt;a href=&quot;http://www.emacswiki.org/emacs/GotoLastChange&quot; rel=&quot;noreferrer&quot;&gt;http://www.emacswiki.org/emacs/GotoLastChange&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-11-23T11:17:04.220" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18333" PostTypeId="2" ParentId="10361" CreationDate="2015-11-23T11:24:36.920" Score="2" Body="&lt;p&gt;How about this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'tex-mode&#xA; (defun expand-and-insert-space ()&#xA;  (interactive)&#xA;  (expand-abbrev)&#xA;  (insert &quot;\ &quot;)))&#xA;&#xA;(define-key latex-mode-map (kbd &quot;&amp;lt;SPC&amp;gt;&quot;) 'expand-and-insert-space)&#xA;(define-key latex-mode-map (kbd &quot;&amp;lt;M-/&amp;gt;&quot;) 'expand-abbrev)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDITED to include &lt;code&gt;eval-after-load&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2016-08-02T02:59:37.027" LastActivityDate="2016-08-02T02:59:37.027" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18334" PostTypeId="1" AcceptedAnswerId="18335" CreationDate="2015-11-23T12:12:40.420" Score="3" ViewCount="888" Body="&lt;p&gt;I would like to assign &lt;a href=&quot;http://www.emacswiki.org/emacs/Evil&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;evil-mode&lt;/code&gt;&lt;/a&gt; normal-state key bindings dependent on what major mode I am currently working in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. I am using &lt;a href=&quot;http://orgmode.org&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-mode&lt;/code&gt;&lt;/a&gt; and I want a set of keys and if I use AucTeX I want a different set of keys.&#xA;Potentially there are keys that behave differently under different major modes because I want to keep a certain naming logic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried assigning keys using different minor-modes, however the last loaded minor-mode overwrites the previously assigned key bindings. Switching to a different window with a different major mode &lt;em&gt;does not&lt;/em&gt; switch the key bindings back.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2015-11-23T13:16:03.070" Title="Assign evil-mode keys dependent on major-mode" Tags="|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18335" PostTypeId="2" ParentId="18334" CreationDate="2015-11-23T13:16:03.070" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;evil-define-key&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example to bind &quot;a&quot; in normal-state to different commands in org-mode and emacs-lisp-mode, you would do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'normal org-mode-map &quot;a&quot; 'bar) &#xA;(evil-define-key 'normal emacs-lisp-mode-map &quot;a&quot; 'foo) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &quot;a&quot; in normal state is bound to command &lt;code&gt;bar&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; and command &lt;code&gt;foo&lt;/code&gt; in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2015-11-23T13:16:03.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18336" PostTypeId="1" CreationDate="2015-11-23T14:01:46.567" Score="3" ViewCount="4101" Body="&lt;p&gt;I am using Emacs on a Win7 machine. I have added the Melpa repo. in &lt;code&gt;init.el&lt;/code&gt;.&#xA;When I do &lt;code&gt;M-x list-packages&lt;/code&gt;, I do get a buffer listing the packages from Melpa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, when i try to download them, I get an error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;open-network-stream: make client process failed: connection timed out,   :name, melpa.milkbox.net, :buffer, #&amp;lt;killed buffer&amp;gt;, :host, melpa.milkbox.net, :service, 80, :nowait, nil...&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that I am using Emacs behind a corporate proxy. Emacs is able to download the list of packages but not able to install any.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please find below snippet from my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;(add-to-list 'package-archives&#xA;         '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;(add-to-list 'package-archives&#xA;     '(&quot;gnu&quot; . &quot;https://elpa.gnu.org/packages/&quot;))&#xA;&#xA;(package-initialize)&#xA;&#xA;;; line numbers in emacs everywhere&#xA;(global-linum-mode t)&#xA;&#xA;(set-face-attribute 'default nil :font &quot;Consolas-12&quot;)&#xA;&#xA;;; set proxy&#xA;(defun proxy-activate ()&#xA; (interactive)&#xA;&#xA; (let ((proxy &quot;unrealproxy:8080&quot;) (credentials      &quot;unrealusername:unrealpwd&quot;))&#xA; (setq url-proxy-services&#xA;  `((&quot;no_proxy&quot; . &quot;^\\(localhost\\|10.*\\)&quot;)&#xA;   (&quot;http&quot; . ,proxy)&#xA;   (&quot;https&quot; . ,proxy)))&#xA;&#xA; (setq url-http-proxy-basic-auth-storage&#xA;  (list (list proxy&#xA;            (cons &quot;Input your LDAP UID !&quot;&#xA;                  (base64-encode-string credentials)))))))&#xA;&#xA; (provide 'proxy-activate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10262" LastEditorUserId="8842" LastEditDate="2015-11-23T14:44:04.627" LastActivityDate="2021-02-24T16:07:20.737" Title="Why am I getting an error while downloading Melpa packages in Emacs on Win7 OS" Tags="|init-file|microsoft-windows|package-repositories|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18337" PostTypeId="2" ParentId="18329" CreationDate="2015-11-23T15:11:34.533" Score="1" Body="&lt;p&gt;Please have a look at org documentation, with &lt;code&gt;C-h i m org&lt;/code&gt;. Your question is answered in 'Markup/Structural markup/Emphasis and monospace':&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You can make words *bold*, /italic/, _underlined_, ‘=verbatim=’ and&#xA;‘~code~’, and, if you must, ‘+strike-through+’.  Text in the code and&#xA;verbatim string is not processed for Org mode specific syntax, it is&#xA;exported verbatim.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-23T15:11:34.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18338" PostTypeId="1" CreationDate="2015-11-23T15:58:44.553" Score="3" ViewCount="399" Body="&lt;p&gt;Helm-mini displays a yellow &lt;code&gt;@&lt;/code&gt; when a file or buffer is remote (in my case accessed via tramp/ssh), which I find quite handy. I'd like to add such a marker to the buffer name part of my modeline, but I'm not sure what's the best way. I'm using &lt;code&gt;powerline&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2807" LastActivityDate="2015-11-23T17:44:35.710" Title="Modify the buffer name in the modeline" Tags="|mode-line|powerline|mode-line-format|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18339" PostTypeId="1" AcceptedAnswerId="18342" CreationDate="2015-11-23T17:02:55.097" Score="6" ViewCount="960" Body="&lt;p&gt;I'm trying to use a mode in emacs 24.4.1 for synonyms propositions. I saw those three modes: synonymous, thesaurus and synonyms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problems are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;synonymous&lt;/strong&gt; is apparently not working in emacs without X (i.e. using emacs -nw). The menu is correctly shown using X, but I use emacs in the terminal.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;thesaurus&lt;/strong&gt; is not a fully free solution (you have to use apparently a thesaurus from &lt;a href=&quot;http://words.bighugelabs.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://words.bighugelabs.com&lt;/a&gt;, which is limited in the number of queries per day through the API)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Synonyms&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;synonyms&lt;/strong&gt;&lt;/a&gt; needs a synonym library at &lt;a href=&quot;ftp://ibiblio.org/pub/docs/books/gutenberg/etext02/mthes10.zip&quot; rel=&quot;nofollow noreferrer&quot;&gt;ftp://ibiblio.org/pub/docs/books/gutenberg/etext02/mthes10.zip&lt;/a&gt;&#xA;which visibly is not available anymore.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How could I obtain a mode for synonyms lookup and replace in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="8719" LastEditorUserId="105" LastEditDate="2018-09-18T13:49:51.233" LastActivityDate="2018-09-18T13:49:51.233" Title="Synonyms in Emacs: thesaurus and synonyms modes" Tags="|synonyms|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18340" PostTypeId="1" AcceptedAnswerId="18345" CreationDate="2015-11-23T17:09:59.543" Score="1" ViewCount="393" Body="&lt;p&gt;Here's a chunk of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test-string &quot;bla bla bla 10.10.10.10 bla bla bla&quot;)&#xA;&#xA;(string-match &quot;[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+&quot; test-string)&#xA;(message (match-string 0 test-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I select the entire block it's evaluated correctly (using &lt;code&gt;eval-region&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;10.10.10.10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I evaluate sequentially (using &lt;code&gt;eval-last-sexp&lt;/code&gt;) I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bla bla bla 10.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've looked at the docs of the respective functions but couldn't find any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs version is &lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.3.0, Carbon Version 157 AppKit 1347.57)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10263" LastEditorUserId="1979" LastEditDate="2020-03-30T12:16:59.403" LastActivityDate="2020-03-30T12:16:59.403" Title="Elisp regex matching - evaluate as region vs as individual sexp gives different answers" Tags="|regular-expressions|string|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="18341" PostTypeId="2" ParentId="18338" CreationDate="2015-11-23T17:21:52.200" Score="-1" Body="&lt;p&gt;Would &lt;code&gt;rename-buffer&lt;/code&gt; function be what you are looking for? You could use a hook to append @ to a buffer name if you'd like to do it automatically.&lt;/p&gt;&#xA;" OwnerUserId="10263" LastActivityDate="2015-11-23T17:21:52.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18342" PostTypeId="2" ParentId="18339" CreationDate="2015-11-23T17:30:32.490" Score="7" Body="&lt;p&gt;Let's see. The url is on ibiblio, but it's in their Gutenberg Project mirror, so I bet we can find it on gutenberg.org. The package docs say that it needs the &quot;Moby Thesaurus II&quot;. A quick search and then a little rummaging pulls up the file you need at &lt;a href=&quot;http://www.gutenberg.org/files/3202/files/mthesaur.txt&quot; rel=&quot;noreferrer&quot;&gt;http://www.gutenberg.org/files/3202/files/mthesaur.txt&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-23T17:30:32.490" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18343" PostTypeId="2" ParentId="18340" CreationDate="2015-11-23T17:32:10.260" Score="1" Body="&lt;p&gt;`C-h f match-string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Return string of text matched by last search.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Likely that call to &lt;code&gt;string-match&lt;/code&gt; was &lt;em&gt;not&lt;/em&gt; the last search (maybe check the definition of command &lt;code&gt;eval-last-sexp&lt;/code&gt; etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Judging by the position values shown in the error message, the last match was against buffer text. Try using &lt;code&gt;save-match-data&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-23T17:32:10.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18344" PostTypeId="2" ParentId="18340" CreationDate="2015-11-23T17:34:14.687" Score="0" Body="&lt;p&gt;&lt;code&gt;string-match&lt;/code&gt; sets global state which &lt;code&gt;match-string&lt;/code&gt; uses. If you did another match (which many commands might do internally), then this global data will be from a different match, and will have different saved start and end points. The error you mention is because the saved start and end points were outside the string you passed to &lt;code&gt;match-string&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-23T17:34:14.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18345" PostTypeId="2" ParentId="18340" CreationDate="2015-11-23T17:38:22.543" Score="2" Body="&lt;p&gt;When you evaluate sequentially, there is a boat load of Elisp code executed between those to statements, and of course, this Elisp code will almost inevitably end up using regular expressions, so the &lt;code&gt;match-data&lt;/code&gt; of your first expression will be long gone by the time you run the second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of Elisp code might be run between the two?  Let's see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the code that you trigger when you try and move the cursor to the second expression&lt;/li&gt;&#xA;&lt;li&gt;the code of eval-last-sexp&lt;/li&gt;&#xA;&lt;li&gt;the code to recompute the mode-line, and frame title&lt;/li&gt;&#xA;&lt;li&gt;maybe some background timers&lt;/li&gt;&#xA;&lt;li&gt;possibly some font-lock refresh&lt;/li&gt;&#xA;&lt;li&gt;maybe some procees filter&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;match-data&lt;/code&gt; is very much transient, if not fleeting, so you have to use it &lt;em&gt;right&lt;/em&gt; after you've performed the regexp match.  If you're not sure if you do it quickly enough, then you can generally assume that it's not soon enough (i.e. assume that all functions can destroy the match-data, except for a few core functions like &lt;code&gt;car&lt;/code&gt;, &lt;code&gt;cdr&lt;/code&gt;, ...).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-11-23T17:38:22.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18346" PostTypeId="2" ParentId="18338" CreationDate="2015-11-23T17:44:35.710" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Define a separate face, e.g., &lt;code&gt;my-remote-buf&lt;/code&gt;, that you use to show remote buffers.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set &lt;code&gt;mode-line-buffer-identification&lt;/code&gt; to use that face when the buffer is remote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-line-buffer-identification&#xA;      (list (propertize (car mode-line-buffer-identification)&#xA;                        'face 'my-remote-buf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-23T17:44:35.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18347" PostTypeId="2" ParentId="17626" CreationDate="2015-11-23T18:48:57.210" Score="1" Body="&lt;p&gt;I'm replying to my own question. With the setup in the opening post, I couldn't get it working. But &lt;a href=&quot;http://sachachua.com/blog/2015/11/mail-with-gnus/&quot; rel=&quot;nofollow&quot;&gt;this answer&lt;/a&gt; helped me a lot if you want getting Gnus work on Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is with Windows 7 and Emacs 24.5. I'm not sure about the other versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I prefer mu4e above Gnus. Notice you need to install some binaries in the path first, as explained in the tutorial from Sacha Chua.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-11-23T21:23:36.440" LastActivityDate="2015-11-23T21:23:36.440" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18348" PostTypeId="2" ParentId="13086" CreationDate="2015-11-23T18:49:15.817" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://sachachua.com/blog/2015/11/mail-with-gnus/&quot; rel=&quot;nofollow&quot;&gt;This answer&lt;/a&gt; helped me a lot if you want getting Gnus work on Windows. By the way, I prefer mu4e above Gnus. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-11-23T18:49:15.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18349" PostTypeId="1" AcceptedAnswerId="18355" CreationDate="2015-11-23T19:04:55.683" Score="0" ViewCount="68" Body="&lt;p&gt;If I were trying to use a list as a data structure -- and it was getting really big -- is there a precedent of breaking it up and having it span files? One particular list of mine is looking very tree-ish (as Treebeard might say), and it's getting huge. I know I should just think &quot;graph theory&quot; and have branches of the tree in one file &quot;linked&quot; (edged) to others, but I thought I'd ask here for guidance, experiences on list size issues and handling in the real world.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:40:00.617" LastActivityDate="2016-03-14T04:40:00.617" Title="list data structure split across files?" Tags="|list|persistence|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18350" PostTypeId="1" CreationDate="2015-11-23T19:28:07.553" Score="0" ViewCount="72" Body="&lt;p&gt;I have a situation where I have a function that depends on other functions. So&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun a ()&#xA;   (something))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun b ()&#xA;   (something-else))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;are used by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun c ()&#xA;   (something-calling (a) (b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not wanting to do a blanket load of everything -- and not really wanting to rewrite to include &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; in a &lt;code&gt;cl-flet&lt;/code&gt; block -- would I change &lt;code&gt;c&lt;/code&gt; to use &lt;code&gt;eval&lt;/code&gt;, or is there any trick to have &lt;code&gt;c&lt;/code&gt; autoload what it is dependent upon? I've seen &lt;code&gt;autoload&lt;/code&gt;, but I'm not sure if it's applicable here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I'd like to be able to talk to the elisp &quot;live namespace&quot; and tell it, &quot;If you see &lt;em&gt;this&lt;/em&gt; function called, go ahead and load/initialize &lt;em&gt;these&lt;/em&gt; dependent functions/variables.&quot;&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:39:41.273" LastActivityDate="2016-03-14T04:39:41.273" Title="Dependent functions: eval or autoload?" Tags="|autoload|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18351" PostTypeId="1" AcceptedAnswerId="18352" CreationDate="2015-11-23T19:28:58.067" Score="2" ViewCount="635" Body="&lt;p&gt;For this simple question, I never found any answer. Let assume I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (true)&#xA;    (foo1) ;; When true&#xA;    (bar) ;; When false)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I would like to combine foo1 and foo2&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (true)&#xA;    (foo1)(foo2) ;; When true&#xA;    (bar) ;; When false)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that the Emacs Lisp interpreter consider &lt;code&gt;foo2&lt;/code&gt; as false statement. Trying to devise some workaround, I could get away with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (true)&#xA;    (foo3) ;; When true&#xA;    (bar) ;; When false)&#xA;&#xA;(defun foo3 ()&#xA;    (foo1)&#xA;    (foo2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this could be quite cumbersome when you use if-else statements a lot.  How&#xA;could I find a more practical way for this?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2016-03-14T04:38:39.617" LastActivityDate="2016-03-14T04:38:39.617" Title="How execute multiple lists in a true statement?" Tags="|conditionals|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18352" PostTypeId="2" ParentId="18351" CreationDate="2015-11-23T19:49:27.500" Score="5" Body="&lt;p&gt;Use &lt;code&gt;progn&lt;/code&gt; or &lt;code&gt;prog1&lt;/code&gt;. &lt;code&gt;progn&lt;/code&gt; takes a list of body forms, evaluates them one by one, then returns the value of the last one. &lt;code&gt;prog1&lt;/code&gt; does the same but returns the value of the first one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (true)&#xA;  (progn (foo1)&#xA;         (foo2))&#xA;  (bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-23T19:49:27.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18353" PostTypeId="1" AcceptedAnswerId="18354" CreationDate="2015-11-23T20:06:11.047" Score="1" ViewCount="109" Body="&lt;p&gt;I would like to insert the number &lt;code&gt;1&lt;/code&gt;, and then increase the number with calling&#xA;the function &lt;code&gt;evil-numbers/inc-at-pt&lt;/code&gt; from the package &lt;a href=&quot;https://github.com/cofi/evil-numbers&quot; rel=&quot;nofollow&quot;&gt;evil-numbers&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I went looking into the source code of the function &lt;code&gt;evil-numbers/inc-at-pt&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun evil-numbers/inc-at-pt (amount &amp;amp;optional no-region)&#xA;&quot;Increment the number at point or after point before end-of-line by `amount'.&#xA;When region is selected, increment all numbers in the region by `amount'&#xA;&#xA;NO-REGION is internal flag that allows&#xA;`evil-numbers/inc-at-point' to be called recursively when&#xA;applying the regional features of `evil-numbers/inc-at-point'.&#xA;&#xA;&quot;&#xA;(interactive &quot;p*&quot;)&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function don't need any region by the way. You can place your cursor after the number, without any region. It will increase&#xA;the number if there is no region, then it will look for any number and increase it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I created a function around this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eshell-go-to-number-down ()&#xA;    (interactive &quot;p*&quot;)&#xA;    (evil-insert)&#xA;    (insert &quot;0&quot;)&#xA;    (evil-numbers/inc-at-pt 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when I call that function, it will insert the number and increase it. I plan to modify it, when there is already a number then don't insert any number. But that's a later concern. I'm trying to figure out how I call &lt;code&gt;evil-numbers/inc-at-pt&lt;/code&gt; properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it seems from the source code, the function &lt;code&gt;evil-numbers/inc-at-pt&lt;/code&gt; expects&#xA;a number, which I provide with &lt;code&gt;1&lt;/code&gt; But I get the error message: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;funcall-interactively: Wrong number of arguments: (lambda nil (interactive &quot;p*&quot;) (evil-insert) (insert &quot;1&quot;) (evil-numbers/inc-at-pt 1)), 1 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So where went I wrong? Please don't verdict me, I'm trying to learn Lisp.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2016-03-14T04:38:13.147" LastActivityDate="2016-03-14T04:38:13.147" Title="How to figure out which parameters a function actually need?" Tags="|arguments|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18354" PostTypeId="2" ParentId="18353" CreationDate="2015-11-23T20:35:59.160" Score="2" Body="&lt;p&gt;You've misunderstood the error. Emacs is complaining about the call to &lt;em&gt;your&lt;/em&gt; function &lt;code&gt;eshell-go-to-number-down&lt;/code&gt;; not the call to &lt;code&gt;evil-numbers/inc-at-pt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your problem is that you have defined a function with an empty arglist &lt;code&gt;()&lt;/code&gt;, and then given it an &lt;code&gt;interactive&lt;/code&gt; spec of &lt;code&gt;&quot;p*&quot;&lt;/code&gt; -- which supplies an argument when the function is called interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;C-h f interactive&lt;/code&gt; if you're uncertain of what that spec means. Also &lt;code&gt;C-h i g (elisp) Prefix Command Arguments&lt;/code&gt;. Note that the &quot;numeric value&quot; of a &lt;code&gt;nil&lt;/code&gt; prefix argument is &lt;code&gt;1&lt;/code&gt;, which may have further confused you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To resolve the conflict you either need to change the interactive spec, or else introduce an argument to your function.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-11-23T20:47:46.397" LastActivityDate="2015-11-23T20:47:46.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18355" PostTypeId="2" ParentId="18349" CreationDate="2015-11-23T21:23:36.517" Score="2" Body="&lt;p&gt;Sure, you could do that. You'll have to walk the graph yourself, deciding which parts go in which file, and marking the links between them so that you can reread everything correctly; it'll be a pretty big chunk of work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you sure it's worth it? Modern computers can handle terabyte-sized files with no sweat; these are far larger than the data structures you can fit directly in memory will be. Even if the files are too big, running them through gzip or bzip2 will be far simpler, and may save enough to let you avoid all of that work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If file size is truly important and compression isn't enough, then I would investigate using a binary file format rather than text.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-23T21:23:36.517" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18356" PostTypeId="1" CreationDate="2015-11-23T21:50:56.667" Score="2" ViewCount="553" Body="&lt;p&gt;The auto-importing functionality of elpy is awesome. However, it rearranges all the previous import statements in the file alphabetically. This is problematic for me because:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I prefer to arrange my imports this way according to &lt;a href=&quot;https://www.python.org/dev/peps/pep-0008/#imports&quot; rel=&quot;nofollow noreferrer&quot;&gt;pep-8&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Imports should be grouped in the following order:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;standard library imports&lt;/li&gt;&#xA;&lt;li&gt;related third party imports&lt;/li&gt;&#xA;&lt;li&gt;local application/library specific imports&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You should put a blank line between each group of imports.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;More importantly, I don't want the unecessary changes in my commits when existing imports are rearranged.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Is there any way to customize how imports are arranged, or to have them not be rearranged at all? I am assuming that if it doesn't rearrange them, it will not know where to put the new import, so the former option would probably be preferable. Thanks for any suggestions!&lt;/p&gt;&#xA;&lt;h1&gt;EDIT:&lt;/h1&gt;&#xA;&lt;p&gt;On further investigation, it seems like it is &lt;em&gt;trying&lt;/em&gt; to arrange imports according to pep-8, but doesn't seem to recognize my &amp;quot;local application/library specific imports&amp;quot; as such.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-11-23T22:21:28.840" Title="elpy-importmagic-add-import without rearranging imports?" Tags="|python|elpy|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18357" PostTypeId="1" CreationDate="2015-11-23T22:36:43.987" Score="1" ViewCount="74" Body="&lt;p&gt;Using Emacs for Mac OSX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I used Emacs on Ubuntu, if I used a keystroke that my Emacs did not define, it would bubble up to the operating system and execute the OS native command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On OSX, it'll simply say &quot;command not defined&quot; even though I want to execute the Mac command. For example, if I customize option-f to open Firefox, and I un-define it on Emacs, I still cannot use option-f as intended because Emacs will simply complain &quot;meta - f&quot; not defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="10267" LastActivityDate="2015-11-23T22:36:43.987" Title="use native commands when emacs keystroke is not found" Tags="|osx|" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18358" PostTypeId="2" ParentId="18350" CreationDate="2015-11-23T23:02:28.447" Score="4" Body="&lt;p&gt;You don't need autoload here. Just put &lt;code&gt;(require 'a-lib)&lt;/code&gt; and &lt;code&gt;(require 'b-lib)&lt;/code&gt; inside function &lt;code&gt;c&lt;/code&gt; itself (assuming &lt;code&gt;a-lib&lt;/code&gt; and &lt;code&gt;b-lib&lt;/code&gt; are the libraries that define functions &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;, respectively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, let function &lt;code&gt;c&lt;/code&gt; load the libraries its code needs. They will be loaded only the first time (and only if they have not already been loaded).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun c ()&#xA;  (require 'a-lib)&#xA;  (require 'b-lib)&#xA;  (something-calling (a) (b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-23T23:02:28.447" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18359" PostTypeId="1" AcceptedAnswerId="18360" CreationDate="2015-11-24T00:57:57.037" Score="5" ViewCount="188" Body="&lt;p&gt;The &lt;code&gt;find-function-at-point&lt;/code&gt; command finds a function and displays its definition in the other window, while moving point to the other window as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to have a version of &lt;code&gt;find-function-at-point&lt;/code&gt; that opens the function definition in the other window, but leaves point in the current window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I could accomplish this with &lt;code&gt;save-excursion&lt;/code&gt; in a lambda expression as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda ()&#xA; (interactive)&#xA; (save-excursion)&#xA; (find-function-at-point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this doesn't seem to work. Point remains in the other window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding of &lt;code&gt;save-excursion&lt;/code&gt; is that it should restore point and mark after the body of &lt;code&gt;save-excursion&lt;/code&gt; is evaluated. What am I missing here?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2015-11-24T01:51:44.033" Title="save-excursion and find-function-at-point" Tags="|save-excursion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18360" PostTypeId="2" ParentId="18359" CreationDate="2015-11-24T01:04:08.427" Score="7" Body="&lt;p&gt;Your call to &lt;code&gt;save-excursion&lt;/code&gt; has no body.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is saving point, mark, and the current buffer, then &lt;em&gt;doing nothing&lt;/em&gt;, and then 'restoring' those things to their saved values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However that's the wrong macro. You want &lt;code&gt;save-selected-window&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like you are under the misconception that there is a &lt;em&gt;single&lt;/em&gt; &lt;code&gt;point&lt;/code&gt; and &lt;code&gt;mark&lt;/code&gt; which 'move' around between buffers. This is not the case -- each buffer has its own buffer-local &lt;code&gt;point&lt;/code&gt; and &lt;code&gt;mark&lt;/code&gt; values -- so &quot;restoring point and mark&quot; has nothing to do with changing the currently-selected window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nor indeed does &quot;restoring the current buffer&quot; -- that is simply the &lt;em&gt;buffer&lt;/em&gt; (which is not necessarily visible in any window) which is current for the functions being called. &quot;Restoring&quot; this value has no bearing on whether/where that buffer is displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, be aware that buffers are independent of the windows they can be displayed in. Mixing the two concepts in your mind will certainly lead to confusion.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-11-24T01:51:44.033" LastActivityDate="2015-11-24T01:51:44.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18361" PostTypeId="1" AcceptedAnswerId="18532" CreationDate="2015-11-24T01:10:01.603" Score="0" ViewCount="53" Body="&lt;p&gt;I have python-mode installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When editing any python script, if I have the point over any python statement, I noted that when using ido-mode and using any ido-find function, py-shell runs, opening a new buffer for the python shell, and then ido prompting me for the file to find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When point is not on any python statement, this behavior doesn't occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some kind of conflict between python-mode and ido-mode ? I have been looking if anything gets defined making this strange (and annoying) behavior but couldn't find anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell ido-find commands to stop running py-shell?&lt;/p&gt;&#xA;" OwnerUserId="684" LastActivityDate="2015-12-01T20:29:13.143" Title="Tell ido-find-file not to run py-shell on python-mode" Tags="|python|ido-find-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18362" PostTypeId="1" AcceptedAnswerId="18375" CreationDate="2015-11-24T05:58:52.227" Score="0" ViewCount="82" Body="&lt;p&gt;in org mode table. I have a cell with many words, and and to append more words to the end. But how to quick move to the end of current cell?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2015-11-24T16:02:10.520" Title="how to move to the end of current cell?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18363" PostTypeId="1" CreationDate="2015-11-24T09:03:08.893" Score="6" ViewCount="640" Body="&lt;p&gt;From some newer version of Emacs (I currently on 24.5.1) after some operation &lt;code&gt;*vc-dir*&lt;/code&gt; buffer begin to show &lt;em&gt;ignored&lt;/em&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I specially craft &lt;code&gt;.hgignore&lt;/code&gt; to make list of &lt;code&gt;hg status&lt;/code&gt; short. But Emacs &lt;code&gt;vc-mode&lt;/code&gt; doesn't respect my preference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to ignore &lt;em&gt;ignored&lt;/em&gt; files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open &lt;code&gt;*vc-dir*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;modify file&lt;/li&gt;&#xA;&lt;li&gt;undo changes on file from &lt;code&gt;*vc-dir*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;refresh &lt;code&gt;*vc-dir*&lt;/code&gt; content&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I made wrapper to diagnose problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;echo hg &quot;$@&quot; &amp;gt;&amp;gt; ~/tmp/hg.log&#xA;/usr/bin/hg &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From above instruction steps I get log:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;root       # here I press C-x v d&#xA;id -b&#xA;id -t&#xA;status -C ./   # below I edit and save file&#xA;hg --config alias.status=status --config defaults.status= status -A hg.rst&#xA;hg --config alias.status=status --config defaults.status= status -A hg.rst&#xA;hg parent --template {rev} hg.rst&#xA;hg --config alias.status=status --config defaults.status= status -A hg.rst&#xA;hg --config alias.status=status --config defaults.status= status -A hg.rst&#xA;hg diff hg.rst       # &amp;lt;== revert file in *vc-dir* by C-x v u&#xA;hg revert hg.rst&#xA;hg --config alias.status=status --config defaults.status= status -A hg.rst&#xA;hg root            # &amp;lt;== here I press g&#xA;hg id -b&#xA;hg id -t&#xA;hg status -C ./&#xA;hg status -mardui -C hg.rst ./&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Last command include &lt;code&gt;-i&lt;/code&gt; option which cause issue. Sources have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ grep -R -n mardu&#xA;lisp/vc/vc-hg.el:640:         (concat &quot;-mardu&quot; (if files &quot;i&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vc-hg-dir-status-files (dir files update-function)&#xA;  (apply 'vc-hg-command (current-buffer) 'async dir &quot;status&quot;&#xA;         (concat &quot;-mardu&quot; (if files &quot;i&quot;))&#xA;         &quot;-C&quot; files)&#xA;  (vc-run-delayed&#xA;    (vc-hg-after-dir-status update-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;lisp/vc/vc.el&lt;/code&gt; state that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; - dir-status-files (dir files update-function)&#xA;;;   If FILES is non-nil, this function should report on all requested&#xA;;;   files, including up-to-date or ignored files.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; I open bug: &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22003&quot; rel=&quot;nofollow&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22003&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I receive recommendation to type &lt;code&gt;x&lt;/code&gt; to clear unnecessary entry. &lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-01-26T17:40:07.653" LastActivityDate="2019-08-31T21:40:12.563" Title="*vc-dir* show ignored files" Tags="|vc-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18364" PostTypeId="1" AcceptedAnswerId="48309" CreationDate="2015-11-24T09:07:08.263" Score="6" ViewCount="802" Body="&lt;p&gt;I have recently setup polymode for use with Rnw and Rmd files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it came to knit/weave a document I was given the choice of four defaults;&#xA;knitR-ESS, Sweave, knitR and Sweave-ESS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually use knitR outside of emacs but I wondered what is the difference/advantage/disadvantage of using knitR-ESS over knitR, if any, when knitting documents?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="10271" LastActivityDate="2019-03-13T12:53:36.920" Title="What is the difference between the knitR and knitR-ESS for polymode?" Tags="|ess|polymode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18365" PostTypeId="1" CreationDate="2015-11-24T09:20:22.800" Score="4" ViewCount="258" Body="&lt;p&gt;Is it possible with whitespace-mode (or another mode) to only show mix spaces an tabs (in python mode) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only highlight if:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;there is space before tab or tab before space&lt;/li&gt;&#xA;&lt;li&gt;there is space and &lt;code&gt;indent-tabs-mode&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;there is tabs and &lt;code&gt;indent-tabs-mode&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;obviously I don't want to see any character like &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; or &lt;code&gt;.&lt;/code&gt; for unmixed spaces or tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any helps&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-11-24T09:20:22.800" Title="mix spaces and tabs in python mode" Tags="|whitespace-mode|indentation|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18367" PostTypeId="1" AcceptedAnswerId="20341" CreationDate="2015-11-24T11:44:44.900" Score="2" ViewCount="285" Body="&lt;p&gt;When using VC for a Git repository on Emacs 24.3, I want to view commits in a different branch from the one I've checked out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like &lt;code&gt;C-u C-x v l&lt;/code&gt; should be command for that, as it asks &lt;code&gt;Log from revision (default: last revision):&lt;/code&gt;, but if I enter &lt;code&gt;origin/master&lt;/code&gt;, the &lt;code&gt;*vc-change-log*&lt;/code&gt; buffer still shows the revision history of the currently checked out branch, just as if I had used plain &lt;code&gt;C-x v l&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get VC to show the change log for a different branch, or do I need to stick with &lt;code&gt;M-! git log HEAD..origin/master&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="7045" LastEditDate="2015-12-17T22:24:45.310" LastActivityDate="2016-04-07T15:06:18.257" Title="Show change log of other branch with vc-git" Tags="|git|vc|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18368" PostTypeId="2" ParentId="18362" CreationDate="2015-11-24T14:08:30.343" Score="1" Body="&lt;p&gt;In org-mode, table cells are called &lt;strong&gt;field&lt;/strong&gt;s. &lt;code&gt;C-h a org field&lt;/code&gt; outputs a list of commands related to org tables fields, including:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-table-end-of-field        M-x ... RET&#xA;   Move to the end of the current table field.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does not seem to be bound to any key by default.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-24T14:08:30.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18369" PostTypeId="1" AcceptedAnswerId="18372" CreationDate="2015-11-24T14:42:06.317" Score="15" ViewCount="3721" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ediff/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ediff&lt;/code&gt;&lt;/a&gt; allows comparing files, buffers, and regions in different buffers.&#xA;However, it does not let one compare sections in the same buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until now I used &lt;code&gt;isearch&lt;/code&gt; for that: &lt;kbd&gt;C-s&lt;/kbd&gt; at the beginning of the 1st identical section, the beginning of the second section is highlighted, then &lt;kbd&gt;C-w&lt;/kbd&gt; to increase the search string until the second section no longer match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I got &lt;code&gt;Too many words&lt;/code&gt; error after several &lt;kbd&gt;C-w&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what do people use these days to compare sections of the same buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(yes, I can copy one of the sections into a throwaway buffer, but this is ugly).&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="105" LastEditDate="2015-11-24T15:40:37.507" LastActivityDate="2015-11-24T20:34:44.127" Title="How do I compare regions in the same file?" Tags="|ediff|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18371" PostTypeId="2" ParentId="18369" CreationDate="2015-11-24T15:34:59.703" Score="1" Body="&lt;p&gt;One thing I sometimes use for this is command &lt;code&gt;compare-windows&lt;/code&gt; (repeated).  It compares the text in two windows, starting at point.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Compare text in current window with text in next window.&#xA;      Compares the text starting at point in each window,&#xA;      moving over text in each one as far as they match.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This command pushes the mark in each window&#xA;      at the prior location of point in that window.&#xA;      If both windows display the same buffer,&#xA;      the mark is pushed twice in that buffer:&#xA;      first in the other window, then in the selected window.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A prefix arg means reverse the value of variable&#xA;      &lt;code&gt;compare-ignore-whitespace&lt;/code&gt;.  If &lt;code&gt;compare-ignore-whitespace&lt;/code&gt; is&#xA;      nil, then a prefix arg means ignore changes in whitespace.  If&#xA;      &lt;code&gt;compare-ignore-whitespace&lt;/code&gt; is non-nil, then a prefix arg means&#xA;      don't ignore changes in whitespace.  The variable&#xA;      &lt;code&gt;compare-windows-whitespace&lt;/code&gt; controls how whitespace is skipped.&#xA;      If &lt;code&gt;compare-ignore-case&lt;/code&gt; is non-nil, changes in case are also&#xA;      ignored.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;compare-windows-sync&lt;/code&gt; is non-nil, then successive calls of&#xA;      this command work in interlaced mode:&#xA;      on first call it advances points to the next difference,&#xA;      on second call it synchronizes points by skipping the difference,&#xA;      on third call it again advances points to the next difference and so on.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Another thing you can do is, as you said, to create another, throwaway, buffer, copy the content, and compare the two buffers.  Or use an indirect buffer, as @fredtantini suggested.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-24T15:34:59.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18372" PostTypeId="2" ParentId="18369" CreationDate="2015-11-24T15:40:26.887" Score="16" Body="&lt;p&gt;You can use &lt;code&gt;ediff-regions-wordwise&lt;/code&gt;. It prompts you for two buffers, and then for two regions. The buffers can be the same.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-24T15:40:26.887" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18373" PostTypeId="1" CreationDate="2015-11-24T15:50:37.327" Score="2" ViewCount="188" Body="&lt;p&gt;I seem to have a problem with mu4e not correctly autofilling email addresses. According to &lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e/Address-autocompletion.html&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt;, this should happen automatically. And for many (most?) addresses it does. But then others it doesn't get for whatever reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas where to start here? &lt;/p&gt;&#xA;" OwnerUserId="10274" LastEditorUserId="253" LastEditDate="2016-12-03T03:24:18.753" LastActivityDate="2017-03-03T05:16:59.433" Title="Mu4e not autofilling email addresses" Tags="|mu4e|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18374" PostTypeId="1" AcceptedAnswerId="18376" CreationDate="2015-11-24T15:53:26.607" Score="3" ViewCount="1643" Body="&lt;p&gt;If I hide the cursor in a buffer with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq cursor-type nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it will reappear if I move it around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for hiding the cursor all the time (only for one specific buffer)?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-11-24T18:48:11.900" LastActivityDate="2015-11-24T18:48:11.900" Title="Persistently hide cursor [evil-mode problem]" Tags="|buffers|visibility|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18375" PostTypeId="2" ParentId="18362" CreationDate="2015-11-24T16:02:10.520" Score="3" Body="&lt;p&gt;The function &lt;code&gt;org-forward-sentence&lt;/code&gt; is bound to &lt;code&gt;M-e&lt;/code&gt;. When inside a table, it will jump to the end of the current field (calling &lt;code&gt;org-table-end-of-field&lt;/code&gt; as @JeanPierre noted in his answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All table related keybindings are listed &lt;a href=&quot;http://orgmode.org/manual/Built_002din-table-editor.html#Built_002din-table-editor&quot; rel=&quot;nofollow&quot;&gt;in the manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-11-24T16:02:10.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18376" PostTypeId="2" ParentId="18374" CreationDate="2015-11-24T16:03:57.703" Score="4" Body="&lt;p&gt;As far as I am aware, moving the cursor around should &lt;em&gt;not&lt;/em&gt; magically make the cursor reappear.  Try out a default &lt;strong&gt;Emacs -Q&lt;/strong&gt; and see if the behavior is present or not.  Setting the variable &lt;code&gt;cursor-type&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in a particular buffer should achieve the visual effect desired.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;See Also&lt;/em&gt;:  The popular built-in &lt;code&gt;blink-cursor-mode&lt;/code&gt; uses &lt;code&gt;internal-show-cursor&lt;/code&gt; to hide the cursor in a specific window rather than a buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;internal-show-cursor&lt;/code&gt; is a built-in function in `C source code'.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(internal-show-cursor WINDOW SHOW)&#xA;&#xA;Set the cursor-visibility flag of WINDOW to SHOW.&#xA;WINDOW nil means use the selected window.  SHOW non-nil means&#xA;show a cursor in WINDOW in the next redisplay.  SHOW nil means&#xA;don’t show a cursor.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="10" LastEditDate="2015-11-24T16:44:21.190" LastActivityDate="2015-11-24T16:44:21.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18377" PostTypeId="1" AcceptedAnswerId="18452" CreationDate="2015-11-24T16:31:43.253" Score="6" ViewCount="480" Body="&lt;p&gt;I use Emacs to edit Go files. When I compile them I can use &lt;code&gt;next-error&lt;/code&gt; to jump to the next error in a specific Go file. Very handy. However, when I also enable flycheck on my Go file for on-the-fly syntax checking, it somehow conflicts with the error reporting of the compilation. What I mean is when I compile a Go file that contains errors (not syntactic but semantic errors), the compilation window correctly shows the errors, but &lt;code&gt;next-error&lt;/code&gt; doesn't work: it just displays the message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No more Flycheck errors&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I disable Flycheck in the buffer, &lt;code&gt;next-error&lt;/code&gt; works again correctly. It's as if Flycheck has hidden compilation errors. (I looked at &lt;code&gt;next-error&lt;/code&gt; documentation and it does say it should cycle through all errors, but it doesn't do it in my case.) Emacs version:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian&lt;/p&gt;&#xA;" OwnerUserId="10275" LastActivityDate="2015-11-27T13:52:10.393" Title="flycheck hides compilation errors" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18379" PostTypeId="2" ParentId="18300" CreationDate="2015-11-24T17:20:21.933" Score="0" Body="&lt;p&gt;Thanks to @wvxvw's many advice, I attempted a short try. I'll never figure it out without @wvxvw's advice on &lt;code&gt;:session none&lt;/code&gt; and code &lt;code&gt;\014&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: graph&#xA;#+BEGIN_SRC gnuplot :results output verbatim :session none :exports none&#xA;set term dumb&#xA;set yrange [0:1.5]&#xA;plot [-2:2] exp(-x*x)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC emacs-lisp :results output value :exports both :var tmp=graph :exports both&#xA;(cadr (split-string tmp &quot;\014&quot;))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastActivityDate="2015-11-24T17:20:21.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18380" PostTypeId="1" AcceptedAnswerId="18382" CreationDate="2015-11-24T17:24:09.243" Score="2" ViewCount="300" Body="&lt;p&gt;I've seen &lt;a href=&quot;https://emacs.stackexchange.com/questions/5457/how-can-i-use-an-interactive-function-in-a-script&quot;&gt;this&lt;/a&gt;, but it doesn't work for this case.... Basically, I want to do a &lt;code&gt;load-file&lt;/code&gt; on an .el file containing &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-file-local-variable-prop-line &quot;eval&quot; &quot;(set-input-method 'TeX)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and have it add &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;-*- eval: (set-input-method 'TeX)  -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at the top of that same file; instead, it inserts &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- &quot;eval&quot;: &quot;(set-input-method 'TeX)&quot;; nil&#xA;-*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is mangled and doesn't work. Obviously, the double-quotes  (and the &lt;code&gt;nil&lt;/code&gt; too?) render it bad. But then using no quotes and single quotes to satisfy the two interactive prompts produce errors. How can I do this non-interactively &quot;batch&quot; style?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-03-14T04:36:57.537" Title="How to use a prompting interactive function in an elisp source file" Tags="|file-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18381" PostTypeId="1" AcceptedAnswerId="18395" CreationDate="2015-11-24T17:47:04.080" Score="3" ViewCount="981" Body="&lt;p&gt;I've been trying to use &lt;a href=&quot;http://www.emacswiki.org/emacs/HideShow&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hide Show&lt;/a&gt; package in emacs. I encountered a problem when using python. Let's say I have the following code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hgDH9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hgDH9.png&quot; alt=&quot;Test code&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have hit the command &lt;code&gt;hs-hide-level&lt;/code&gt;. This is the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aLS3T.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aLS3T.png&quot; alt=&quot;Result&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is not correct since I'm looking for this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jhrRo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jhrRo.png&quot; alt=&quot;What I&amp;#39;m looking for&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, apparently there's a bug in the code which provokes that the folding is being done only in the impair methods (for some reason), but I'm asking here for a workaround if anyone has encountered the same problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.3.1 under ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="5171" LastActivityDate="2015-11-25T09:02:52.543" Title="Hideshow with python hiding only one part" Tags="|package|code-folding|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18382" PostTypeId="2" ParentId="18380" CreationDate="2015-11-24T17:48:09.147" Score="2" Body="&lt;p&gt;This really has nothing to do with interactive functions at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An interactive function is just a function where emacs has some metadata about how the arguments to the function are to be filled in when the function is called by the user. This metadata is ignored when the function is called from code instead. It's up to the caller in this case to supply the necessary arguments, same as for any function call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case the important line is &lt;code&gt;(insert (format &quot;; %S: %S; &quot; variable value))&lt;/code&gt;. This is how &lt;code&gt;modify-file-local-variable-prop-line&lt;/code&gt; ultimately puts the text into the buffer. If we look at the help for the &lt;code&gt;format&lt;/code&gt; function (&lt;code&gt;C-h f format RET&lt;/code&gt;), we see that %S tells it to print the argument using &lt;code&gt;prin1&lt;/code&gt;, which has the goal of reproducing the lisp value exactly. Thus, if you pass in a string as the variable, it'll be printed as a string so that when someone calls &lt;code&gt;read&lt;/code&gt; on it they get back a string. This means that you want to pass in the &lt;code&gt;eval&lt;/code&gt; atom rather than the string &lt;code&gt;&quot;eval&quot;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-file-local-variable-prop-line 'eval '(set-input-method 'TeX))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-24T17:48:09.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18383" PostTypeId="1" CreationDate="2015-11-24T18:20:26.900" Score="2" ViewCount="102" Body="&lt;p&gt;I frequently want to follow an individual tag on a headline to see all the other headlines with that tag, however currently the entire tag block is bound as an agenda link, not each tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read up a bit on making custom links in Org but it seems like changing the behavior of the tag links will require &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;advising&lt;/a&gt; or replacing whatever function handles the linking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a starting point in the Org source for this?&lt;/p&gt;&#xA;" OwnerUserId="10277" LastEditorUserId="105" LastEditDate="2015-11-24T18:36:56.680" LastActivityDate="2015-11-24T18:36:56.680" Title="Link to individual Org-mode tag from headline" Tags="|org-mode|org-agenda|hyperlinks|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18384" PostTypeId="1" CreationDate="2015-11-24T18:40:43.253" Score="0" ViewCount="218" Body="&lt;p&gt;I'm currently using emacs24 and multi-term, my frame is split in two windows, top for buffers and the bottom terminals. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I need to open a new file I have to go to buffers and C-x C-f, I'm wondering if there's a way to avoid this and instead send files from current terminal path to buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to do is be able to open a file from the current pwd in multi-term and send it to the top window, avoiding to create a new one.&lt;/p&gt;&#xA;" OwnerUserId="6967" LastEditorUserId="6967" LastEditDate="2015-11-25T03:54:33.150" LastActivityDate="2015-11-25T03:54:33.150" Title="Send files from multi-term to buffer" Tags="|multi-term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18385" PostTypeId="2" ParentId="17689" CreationDate="2015-11-24T18:52:36.453" Score="-1" Body="&lt;p&gt;This builds a bit from what @tarsius mentioned above but is less convoluted. &lt;code&gt;git-commit-setup&lt;/code&gt; hasn't been loaded yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if it has to do with changes in the latest update to &lt;code&gt;magit&lt;/code&gt;, but you &lt;em&gt;have to&lt;/em&gt; (??) manually load it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could do all that @tarsius mentioned or just add &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-git-commit-mode t)&lt;/code&gt; to your startup&lt;/p&gt;&#xA;" OwnerUserId="10281" LastActivityDate="2015-11-24T18:52:36.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18386" PostTypeId="1" AcceptedAnswerId="18476" CreationDate="2015-11-24T18:56:46.333" Score="13" ViewCount="3127" Body="&lt;p&gt;Fast generation of graphs from a tree-like structure can be very useful when making notes in org-mode that require sharing and or beautification for other humans.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find any way to do this other than to manually create a dynamic dot/graphviz block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A translation from a structured tree to a simple directed graph should be fairly straightforward. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a simple way to traverse an org-mode tree (a selected region) and to translate the tree structure (and optionally some information from the contents of the structure) to a dot graph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't possibly be the first to have come up with this. Has this been solved?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;input&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* la1&#xA;** la2&#xA;*** la3&#xA;*** la4&#xA;** la5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and perhaps a variable org-to-dot-preamble&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;digraph {&#xA;   rankdir=TB;&#xA;   splines=true;&#xA;   node [shape=box];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the output would look like an org-mode dynamic block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC dot :file out.png :cmdline -Kdot -Tpng&#xA;(contents of org-to-dot-preamble)&#xA;&#xA;la1 -&amp;gt; la2&#xA;la1 -&amp;gt; la5&#xA;la2 -&amp;gt; la3&#xA;la2 -&amp;gt; la4&#xA;}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A more advanced version would first declare all the nodes and allow for some formatting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;input&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* la1&#xA;  firstline&#xA;  secondline&#xA;** la2&#xA;   firstline&#xA;   secondline&#xA;*** la3&#xA;*** la4&#xA;    firstline&#xA;** la5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some formatting variables&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-to-dot-shape&#xA;org-to-dot-font&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC dot :file out.png :cmdline -Kdot -Tpng&#xA;(contents of org-to-dot-preamble)&#xA;&#xA;la1 [shape=Mrecord, label=&quot;{firstline|secondline}&quot;, fontname = &quot;helvetica&quot;]&#xA;la2 [shape=Mrecord, label=&quot;{firstline|secondline}&quot;, fontname = &quot;helvetica&quot;]&#xA;la3 [shape=Mrecord, label=&quot;{firstline|secondline}&quot;, fontname = &quot;helvetica&quot;]&#xA;la4 [shape=Mrecord, label=&quot;{firstline|secondline}&quot;, fontname = &quot;helvetica&quot;]&#xA;la5 [shape=Mrecord, label=&quot;{firstline|secondline}&quot;, fontname = &quot;helvetica&quot;]&#xA;&#xA;la1 -&amp;gt; la2&#xA;la1 -&amp;gt; la5&#xA;la2 -&amp;gt; la3&#xA;la2 -&amp;gt; la4&#xA;}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2ofkP.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2ofkP.png&quot; alt=&quot;screenshot from an org-mode buffer of the mocked-up result&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10278" LastActivityDate="2019-05-07T17:10:51.530" Title="Convert org-mode structure to dot source" Tags="|org-mode|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18387" PostTypeId="2" ParentId="18369" CreationDate="2015-11-24T20:34:44.127" Score="2" Body="&lt;p&gt;I wrote &lt;code&gt;smerge-makeup-conflict&lt;/code&gt; for similar uses.  Admittedly, it's not polished but I find it does the job (when you can modify the buffer):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;C-SPC at the beginning of the first part,&lt;/li&gt;&#xA;&lt;li&gt;C-SPC at the beginning of the second (which should be after the end of the first, and ideally close to it),&lt;/li&gt;&#xA;&lt;li&gt;then move to the end of the second part and do &lt;code&gt;M-x smerge-makeup-conflict&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;At that point you're in &lt;code&gt;smerge-mode&lt;/code&gt; and you can use its functionality to compare (I typically mostly rely on &lt;code&gt;smerge-refine&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2015-11-24T20:34:44.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18388" PostTypeId="2" ParentId="18384" CreationDate="2015-11-24T21:16:29.443" Score="4" Body="&lt;p&gt;If you press &lt;code&gt;C-x 4 f&lt;/code&gt;, it runs &lt;code&gt;#'find-file-other-window&lt;/code&gt;, which is like &lt;code&gt;C-x C-f&lt;/code&gt; in that it prompts for and opens a file, but instead of opening the file in the current window, opens it in another one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have two windows open (as in your description), it'll use the other one. It will move point into the newly opened file. If you don't want that to happen, you could make an elisp function to open a file in the other window, then move back to your initial window.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-11-24T21:16:29.443" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18389" PostTypeId="1" AcceptedAnswerId="18396" CreationDate="2015-11-24T21:35:02.177" Score="2" ViewCount="109" Body="&lt;p&gt;I want yasnippet to expand both &quot;Cp&quot; and &quot;cp&quot; into the same, say, &quot;\citep{}&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be done?  Is there a way to make yasnippet case insensitive?  As a quick-and-dirty solution, I tried creating yasnippet description files for both &quot;cp&quot; and &quot;Cp&quot;, but only one of them is being recognized.  Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2015-11-25T15:48:57.193" Title="how to make yasnippet case insensitive" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18391" PostTypeId="1" AcceptedAnswerId="18392" CreationDate="2015-11-25T00:26:38.453" Score="10" ViewCount="1214" Body="&lt;p&gt;When navigating a source file with incremental search, I often find myself jumping into some context that is taller than the window.  This raises the question: &quot;Which class am I in?&quot;.  Or, if the previous developer is prone to writing tall methods: &quot;Which class &lt;em&gt;and method&lt;/em&gt; am I in?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently answer these questions by interrupting my search to start a new regex search in the reverse direction, then cancel this search with &lt;code&gt;C g&lt;/code&gt;, then do whatever (usually resume the search).  But, this happens to me so often, I feel like I should have a single command to just print the class/method context in the minibuffer.  Or, even better, if that context was &lt;em&gt;always&lt;/em&gt; visible.  (I would give up a line of window for that.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some Emacs gadget that already scratches this itch?  Or, am I just going about this in completely the wrong way?  If it matters, I happen to be working in Python and Java.&lt;/p&gt;&#xA;" OwnerUserId="3950" LastActivityDate="2015-11-25T01:02:08.117" Title="Which class or method or function am I in?" Tags="|python|mode-line|java|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18392" PostTypeId="2" ParentId="18391" CreationDate="2015-11-25T01:02:08.117" Score="12" Body="&lt;p&gt;&lt;code&gt;which-function-mode&lt;/code&gt; displays the current method name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following configuration, which I got from &lt;a href=&quot;http://emacsredux.com/blog/2014/04/05/which-function-mode/&quot;&gt;Emacs Redux&lt;/a&gt;, displays the current method / function / orgmode heading in the top header line rather than the mode line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Show the current function name in the header line&#xA;(which-function-mode)&#xA;(setq-default header-line-format&#xA;              '((which-func-mode (&quot;&quot; which-func-format &quot; &quot;))))&#xA;(setq mode-line-misc-info&#xA;            ;; We remove Which Function Mode from the mode line, because it's mostly&#xA;            ;; invisible here anyway.&#xA;            (assq-delete-all 'which-func-mode mode-line-misc-info))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do check the linked article for a complete explanation of &lt;code&gt;which-function-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-11-25T01:02:08.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18393" PostTypeId="1" AcceptedAnswerId="18394" CreationDate="2015-11-25T03:06:16.917" Score="2" ViewCount="511" Body="&lt;p&gt;&lt;code&gt;multi-term&lt;/code&gt; is my current goto when I want a command line in Emacs. However, I have noticed a strange behavior, and I am not sure whether it is a bug, or if it can be configured. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type a command at the prompt - or any text for that matter, and kill the text with &lt;code&gt;backward-kill-word&lt;/code&gt; (&lt;code&gt;M-BACKSPACE&lt;/code&gt; for me), the text no longer shows up, but behaves like it is still there (see the screenshot, and you will know what I mean). This is what happens when I type &lt;code&gt;ls&lt;/code&gt;, kill the text with &lt;code&gt;backward-kill-word&lt;/code&gt;, type &lt;code&gt;ls&lt;/code&gt; again, and hit enter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wz8k3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wz8k3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar, but slightly stranger thing happens when I move to the front of the text and use &lt;code&gt;kill-word&lt;/code&gt;. Below is a the result of typing &lt;code&gt;ls&lt;/code&gt;, moving to the beginning of the line, killing the text, and typing &lt;code&gt;ls&lt;/code&gt; again (notice the cursor position too).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/o1e3R.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o1e3R.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This certainly seems buggy, but I am not sure. This happens in &lt;code&gt;term&lt;/code&gt; as well, which is to be expected, so the problem is likely with &lt;code&gt;term&lt;/code&gt; and inherited by &lt;code&gt;multi-term&lt;/code&gt;. If I just delete one character at a time, nothhing goes wrong (but who has time to delete one character at a time! I use Emacs so I don't have to do such things. I am not an animal!) Also, this only happens in &lt;code&gt;char mode&lt;/code&gt;, not &lt;code&gt;line mode&lt;/code&gt;, which leads me to believe that maybe it is an intentional feature that I just don't understand. The docs &lt;code&gt;term&lt;/code&gt; include the following sentence:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In char sub-mode, each character (except `term-escape-char') is sent immediately to the subprocess.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't actually understand what this means, but sound potentially related...Any ideas what is  going on? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-11-25T13:44:06.317" Title="Strange behavior when killling text in term/multi-term" Tags="|term|kill-text|multi-term|" AnswerCount="1" CommentCount="1" ClosedDate="2015-11-26T16:18:46.400" ContentLicense="CC BY-SA 3.0" />
  <row Id="18394" PostTypeId="2" ParentId="18393" CreationDate="2015-11-25T08:39:14.157" Score="2" Body="&lt;p&gt;This is not a bug. You can't use emacs commands in &lt;code&gt;term-char-mode&lt;/code&gt;, you must toggle to &lt;code&gt;term-line-mode&lt;/code&gt; for these commands...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, you can use the terminal commands instead. For example C-w is the terminal &lt;code&gt;backward-kill-word&lt;/code&gt;. fortunately, a lot of commands have (almost) the same behavior in terminal and in emacs (C-k, M-c, M-l, M-. ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another problem is that multi-term (as term) intercept some commands so you must change the default configuration for using them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the muti-term configuration I use: &lt;a href=&quot;http://djangoliv.blogspot.fr/2015/10/emacs-term.html&quot; rel=&quot;nofollow&quot;&gt;http://djangoliv.blogspot.fr/2015/10/emacs-term.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;important precisions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am using two instances of emacs. One for the terminal (the conf above) and another (server) for the rest. It let me use terms in another frame but with emacs facilities. &lt;/li&gt;&#xA;&lt;li&gt;I use C-x (not C-c) as prefix in emacs term.&lt;/li&gt;&#xA;&lt;li&gt;I use tabbar and tabbar-more (&lt;a href=&quot;http://djangoliv.blogspot.fr/2015/11/tabbar.html&quot; rel=&quot;nofollow&quot;&gt;http://djangoliv.blogspot.fr/2015/11/tabbar.html&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope this help.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-11-25T13:44:06.317" LastActivityDate="2015-11-25T13:44:06.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18395" PostTypeId="2" ParentId="18381" CreationDate="2015-11-25T09:02:52.543" Score="4" Body="&lt;p&gt;Here a conf that do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun py-outline-level ()&#xA;      (let (buffer-invisibility-spec)&#xA;        (save-excursion&#xA;          (skip-chars-forward &quot;\t &quot;)&#xA;          (current-column))))&#xA;    (defun hide-body-recenter ()&#xA;      (interactive)&#xA;      (hide-body)&#xA;      (recenter))&#xA;    (defun my-pythonFold-hook ()&#xA;      (setq outline-regexp &quot;[^ \t\n]\\|[ \t]*\\(def[ \t]+\\|class[ \t]+\\)&quot;)&#xA;      (setq outline-level 'py-outline-level)&#xA;      (outline-minor-mode t)&#xA;      (define-key python-mode-map (kbd &quot;C-&amp;lt;kp-subtract&amp;gt;&quot;) 'hide-body-recenter)&#xA;      (define-key python-mode-map (kbd &quot;C-&amp;lt;kp-add&amp;gt;&quot;) 'show-all)&#xA;      (define-key python-mode-map (kbd &quot;C-S-&amp;lt;kp-subtract&amp;gt;&quot;) 'hide-subtree)&#xA;      (define-key python-mode-map (kbd &quot;C-S-&amp;lt;kp-add&amp;gt;&quot;) 'show-subtree))&#xA;    (add-hook 'python-mode-hook 'my-pythonFold-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can use C-+, C--, C-S-+, and C-S-- (numeric keypad)&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-11-25T09:02:52.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18396" PostTypeId="2" ParentId="18389" CreationDate="2015-11-25T15:48:57.193" Score="1" Body="&#xA;&#xA;&lt;p&gt;You can use the following advice:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yas--downcase-key (args) ; args = (table key)&#xA;  (cl-callf downcase (nth 1 args))&#xA;  args)&#xA;(advice-add 'yas--fetch :filter-args #'yas--downcase-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But there should probably be some kind of yasnippet option for this.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-11-25T15:48:57.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18397" PostTypeId="1" CreationDate="2015-11-25T17:04:04.317" Score="2" ViewCount="122" Body="&lt;p&gt;New to org/babel, so forgive me if this doesn't make sense. I have some code (in R) that produces a table. I also specify (in R) the number of digits that I want with &lt;code&gt;options(digits = 2)&lt;/code&gt;. When I run the code to produce the table in R, everything works well. However, when I do &lt;code&gt;C-c C-c&lt;/code&gt; on the source block, it inserts results with many digits. Why is this and how can I fix it? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R :exports results :colnames yes&#xA;  options(digits = 2)&#xA;  thedata &amp;lt;- data.frame(&#xA;    a = runif(100),&#xA;    b = runif(100))&#xA;&#xA;  library(dplyr)&#xA;&#xA;  thedata %&amp;gt;%&#xA;    summarize(meana = mean(a), meanb = mean(b))&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2015-11-25T17:04:04.317" Title="How to specify number of digits to print from a table using babel?" Tags="|org-mode|org-export|org-babel|r|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18398" PostTypeId="1" AcceptedAnswerId="18402" CreationDate="2015-11-25T18:09:03.390" Score="6" ViewCount="88" Body="&lt;p&gt;I see that &lt;code&gt;=&lt;/code&gt; is great for &quot;comparing&quot; more than two (numerical) arguments, e.g., &lt;code&gt;(= 1 1 1)&lt;/code&gt;. But then &lt;code&gt;eq&lt;/code&gt;, &lt;code&gt;eql&lt;/code&gt;, and &lt;code&gt;equal&lt;/code&gt; all only allow two arguments. And nesting is nonsense, i.e., the inner &lt;code&gt;eq&lt;/code&gt; returns only &lt;code&gt;nil&lt;/code&gt; or &lt;code&gt;t&lt;/code&gt; to compare the next argument. Any way to get more than two things (non-number) compared with a comparison predicate? For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(= (+ (* constant input-1) input-2)&#xA;   (+ (* constant input-2) input-1)&#xA;   (* constant output))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This, BTW, is a definition of a linear system. But then it's awkward to not be able to directly compare more than two conditions at a time.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-06-22T20:42:44.247" LastActivityDate="2016-06-22T20:42:44.247" Title="More than two variable for equality predicates?" Tags="|equality|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18399" PostTypeId="1" CreationDate="2015-11-25T18:20:51.757" Score="0" ViewCount="98" Body="&lt;p&gt;I want export a doi link from an org file to LaTeX and then to pdf. If the doi link has no description the export does not work. Why? I want as a result in pdf, not the description but the doi address.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    #+TITLE: Exporting doi link&#xA;    #+AUTHOR: SB&#xA;    #+Date: \today&#xA;    #+OPTIONS: H:3 toc:nil num:nil d:nil&#xA;    #+LATEX_CLASS: memarticle&#xA;    #+LATEX_CMD: xelatex&#xA;&#xA;    * First&#xA;&#xA;    This exports to \LaTeX: [[doi:10.1111/j.1468-0149.2007.00450_2.x][doi-description]] and this [[http:www.ine.pt]].&#xA;&#xA;    But not a doi link with no description: [[doi:10.1111/j.1468-0149.2007.00450_2.x][]].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6988" LastActivityDate="2015-11-25T18:20:51.757" Title="How to export doi links without description?" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18402" PostTypeId="2" ParentId="18398" CreationDate="2015-11-25T22:16:39.410" Score="4" Body="&lt;p&gt;I'm not aware of a package that does that but you can easily define an auxiliary function to help you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sortedp (predicate &amp;amp;rest args)&#xA;  &quot;Test whether ARGS are in increasing order according to PREDICATE.&#xA;That is, test whether (PREDICATE (nth 0 ARGS) (nth 1 ARGS)),&#xA;\(PREDICATE (nth 0 ARGS) (nth 1 ARGS)), etc. are all true.&#xA;PREDICATE is typically an order relation (`&amp;lt;=', `string-lessp', ...) or&#xA;an equivalence relation (`=', `eq', `equal', ...).&quot;&#xA;  (let ((ret t))&#xA;    (while (and ret (consp (cdr args)))&#xA;      (if (funcall predicate (car args) (car (cdr args)))&#xA;          (setq args (cdr args))&#xA;        (setq ret nil)))&#xA;    ret))&#xA;&#xA;(sortedp #'equal '(1) '(1) '(1))  ==&amp;gt;  t&#xA;(sortedp #'equal '() '(1) '(1))  ==&amp;gt;  nil&#xA;(sortedp #'string-lessp &quot;a&quot; &quot;ab&quot; &quot;ac&quot;)  ==&amp;gt;  t&#xA;(sortedp #'string-lessp &quot;a&quot; &quot;ab&quot; &quot;a&quot; &quot;ac&quot;)  ==&amp;gt;  nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-11-25T22:16:39.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18403" PostTypeId="2" ParentId="13315" CreationDate="2015-11-25T23:30:33.870" Score="5" Body="&lt;p&gt;This seems to be working nicely both for input typed at the sqli prompt, as well as for input sent from another query buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've only tested it with postgres, so feedback regarding other products is welcomed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't handle the case where multiple queries are sent together and you end up with prompts in the &lt;em&gt;middle&lt;/em&gt; of the output (i.e. at the start of the output for each of the individual queries). That's less of a concern, though (and I'm not convinced that attempting to handle it would be safe in any case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It took me a while to notice that &lt;code&gt;sql-interactive-remove-continuation-prompt&lt;/code&gt; exists and is called as a filter by default. A solution for this issue should probably happen in there, so a bug report may be in order. For now I have my custom filter appended so that it runs after the default filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've included my tweaking of the postgres prompts in the code below, as (a) that's an issue for my use-case, and (b) neither of the output filters will work if the prompt patterns don't match, so it's important to be aware of these regexps.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Silence compiler warnings&#xA;(defvar sql-product)&#xA;(defvar sql-prompt-regexp)&#xA;(defvar sql-prompt-cont-regexp)&#xA;&#xA;(add-hook 'sql-interactive-mode-hook 'my-sql-interactive-mode-hook)&#xA;(defun my-sql-interactive-mode-hook ()&#xA;  &quot;Custom interactive SQL mode behaviours. See `sql-interactive-mode-hook'.&quot;&#xA;  (when (eq sql-product 'postgres)&#xA;    ;; Allow symbol chars in database names in prompt.&#xA;    ;; Default postgres pattern was: &quot;^\\w*=[#&amp;gt;] &quot; (see `sql-product-alist').&#xA;    (setq sql-prompt-regexp &quot;^\\(?:\\sw\\|\\s_\\)*=[#&amp;gt;] &quot;)&#xA;    ;; Ditto for continuation prompt: &quot;^\\w*[-(][#&amp;gt;] &quot;&#xA;    (setq sql-prompt-cont-regexp &quot;^\\(?:\\sw\\|\\s_\\)*[-(][#&amp;gt;] &quot;))&#xA;&#xA;  ;; Deal with inline prompts in query output.&#xA;  ;; Runs after `sql-interactive-remove-continuation-prompt'.&#xA;  (add-hook 'comint-preoutput-filter-functions&#xA;            'my-sql-comint-preoutput-filter :append :local))&#xA;&#xA;(defun my-sql-comint-preoutput-filter (output)&#xA;  &quot;Filter prompts out of SQL query output.&#xA;&#xA;Runs after `sql-interactive-remove-continuation-prompt' in&#xA;`comint-preoutput-filter-functions'.&quot;&#xA;  ;; If the entire output is simply the main prompt, return that.&#xA;  ;; (i.e. When simply typing RET at the sqli prompt.)&#xA;  (if (string-match (concat &quot;\\`\\(&quot; sql-prompt-regexp &quot;\\)\\'&quot;) output)&#xA;      output&#xA;    ;; Otherwise filter all leading prompts from the output.&#xA;    ;; Store the buffer-local prompt patterns before changing buffers.&#xA;    (let ((main-prompt sql-prompt-regexp)&#xA;          (any-prompt comint-prompt-regexp) ;; see `sql-interactive-mode'&#xA;          (prefix-newline nil))&#xA;      (with-temp-buffer&#xA;        (insert output)&#xA;        (goto-char (point-min))&#xA;        (when (looking-at main-prompt)&#xA;          (setq prefix-newline t))&#xA;        (while (looking-at any-prompt)&#xA;          (replace-match &quot;&quot;))&#xA;        ;; Prepend a newline to the output, if necessary.&#xA;        (when prefix-newline&#xA;          (goto-char (point-min))&#xA;          (unless (looking-at &quot;\n&quot;)&#xA;            (insert &quot;\n&quot;)))&#xA;        ;; Return the filtered output.&#xA;        (buffer-substring-no-properties (point-min) (point-max))))))&#xA;&#xA;(defadvice sql-send-string (before my-prefix-newline-to-sql-string)&#xA;  &quot;Force all `sql-send-*' commands to include an initial newline.&#xA;&#xA;This is a trivial solution to single-line queries tripping up my&#xA;custom output filter.  (See `my-sql-comint-preoutput-filter'.)&quot;&#xA;  (ad-set-arg 0 (concat &quot;\n&quot; (ad-get-arg 0))))&#xA;(ad-activate 'sql-send-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advice at the end works around the problem of differentiating direct input into the sqli buffer (in which case an initial newline is inserted directly by the user), and sending a single-line query from a sql-mode query buffer (which was the remaining case when we didn't get the output we wanted). The apparent output is identical in these cases, but forcing an initial newline for the &lt;code&gt;sql-send-*&lt;/code&gt; commands works around that problem.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-11-26T08:51:17.510" LastActivityDate="2015-11-26T08:51:17.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18404" PostTypeId="1" CreationDate="2015-11-26T00:29:01.190" Score="8" ViewCount="4296" Body="&lt;p&gt;I have image files that I have included as org-mode attachments. I would like to display them inline in emacs (as I could a hyper-linked external image).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some standard way to do this?&lt;/p&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2020-01-30T05:35:50.760" Title="Can I display org-mode attachments as inline images in my document?" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18405" PostTypeId="1" CreationDate="2015-11-26T00:29:39.290" Score="2" ViewCount="526" Body="&lt;p&gt;I'm new to org-mode. I've tried to set up a simple TODO list by calling org-capture and when I select my [t] todo item on *Org Select*, Emacs freezes and I need to kill its process.&lt;/p&gt;&#xA;&lt;p&gt;On the mini-buffer I can read the following error message:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Clipboard pasted as level 2 subtree&lt;/p&gt;&#xA;&lt;p&gt;Error in post-command-hook (linum-update-current): (args-out-of-range 1 1)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I've updated all packages to the latest version, and reinstalled the latest Emacs 25, but the error persisted. Does anyone have an idea where this might be coming from? Am I overseeing something very simple?&lt;/p&gt;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;&lt;p&gt;In case this is important..&lt;/p&gt;&#xA;&lt;p&gt;on init.el:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;       '((&amp;quot;t&amp;quot; &amp;quot;todo&amp;quot; entry (file+headline &amp;quot;/Users/dgomez/todo.org&amp;quot; &amp;quot;Tasks&amp;quot;)&#xA;          &amp;quot;* TODO [#A] %?&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin15.0.0, NS appkit-1404.13 Version 10.11.1 (Build 15B42)) of 2015-11-25&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-08-19T12:33:59.587" Title="Emacs freeze after selecting a org-capture template" Tags="|org-mode|org-capture|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18407" PostTypeId="1" CreationDate="2015-11-26T03:43:24.320" Score="5" ViewCount="884" Body="&lt;p&gt;Similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/13401/change-syntax-highlighting-when-doing-ps-print-buffer-with-faces&quot;&gt;Change syntax highlighting when doing ps-print-buffer-with-faces&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I typically use emacs with a dark background, but I'd like to print my buffer onto a white background (i.e. white paper). I use a color-theme, usually wombat, via &lt;code&gt;M-x customize-theme&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I call &lt;code&gt;ps-print-buffer-with-faces&lt;/code&gt;, I end up with font faces suitable for a dark background, so a lot of the text is unreadable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Honestly the solution posted in &lt;a href=&quot;https://emacs.stackexchange.com/questions/13401/change-syntax-highlighting-when-doing-ps-print-buffer-with-faces&quot;&gt;Change syntax highlighting when doing ps-print-buffer-with-faces&lt;/a&gt; is unintelligible to me; I only have a rudimentary understanding of elisp. Are there easier fixes? When I alter the color-theme to a light background temporarily, the output ps is unchanged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shouldn't there be an easier way for the printer output to preserve syntax highlighting while having colors suitable for a white background?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: it's all my fault. I had first used &lt;code&gt;C-u M-x ps-print-buffer-with-faces&lt;/code&gt; to generate one file. Then as I switched themes and whatnot, I kept on using &lt;code&gt;M-x ps-print-buffer-with-faces&lt;/code&gt;, which I thought was just overwriting the .ps file I had initially generated. I now realize you need &lt;code&gt;C-u&lt;/code&gt; to prefix the print argument in order to generate a file instead of sending to the printer.&lt;/p&gt;&#xA;" OwnerUserId="9881" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-11-27T22:21:41.610" Title="ps-print-buffer-with-faces with color-theme'ed dark background" Tags="|syntax|highlighting|print|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18408" PostTypeId="1" AcceptedAnswerId="18409" CreationDate="2015-11-26T06:39:50.530" Score="2" ViewCount="856" Body="&lt;p&gt;I am trying to make term buffer to use slightly smaller font than of the rest of Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to quickly find that for that I need to customize &lt;code&gt;term&lt;/code&gt; face. I changed the font size, and indeed when the term buffer starts, initially it shows the prompt with the font size I set. But then, once I start typing it falls back to default font-size. Is it possible to get what I want at all?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me clarify: I don't want to change font-size with keyboard (which I still can do). I want it to be smaller by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;upd:&lt;/strong&gt; wondering if I can set &lt;code&gt;text-scale-mode&lt;/code&gt; on &lt;code&gt;term-mode-hook&lt;/code&gt;, since I can make it work through customizing the face&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="8992" LastEditDate="2015-11-26T06:54:28.017" LastActivityDate="2015-11-26T07:20:23.550" Title="Term buffer font-size" Tags="|fonts|spacemacs|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18409" PostTypeId="2" ParentId="18408" CreationDate="2015-11-26T07:20:23.550" Score="5" Body="&lt;p&gt;I did this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shell-hook ()&#xA;   (text-scale-decrease 1.1))&#xA;&#xA;(add-hook 'term-mode-hook 'shell-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it worked beautifully &lt;/p&gt;&#xA;" OwnerUserId="8992" LastActivityDate="2015-11-26T07:20:23.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18410" PostTypeId="1" CreationDate="2015-11-26T07:28:10.863" Score="3" ViewCount="3536" Body="&lt;p&gt;If I wanted to make a video game with emacs what are my options? Are there frameworks? What graphics capabilities does emacs have? Can I make 3D first person shooters with emacs?&lt;/p&gt;&#xA;" OwnerUserId="4013" LastEditorUserId="105" LastEditDate="2016-03-14T04:35:24.097" LastActivityDate="2016-03-14T04:35:24.097" Title="How to make a video game with emacs?" Tags="|games|" AnswerCount="3" CommentCount="0" ClosedDate="2015-11-26T18:48:19.793" ContentLicense="CC BY-SA 3.0" />
  <row Id="18411" PostTypeId="2" ParentId="18410" CreationDate="2015-11-26T08:29:21.990" Score="9" Body="&lt;p&gt;First of all, Emacs is a text editor.  Teaching it other tricks is a neat pastime (I engage in it all the time), but I've learned to lower my expectations.  I know of &lt;a href=&quot;https://gist.github.com/dto/4112806&quot;&gt;a single framework attempt&lt;/a&gt; (which the author scrapped for standalone implementation in CL) or maybe even two if the built-in &lt;code&gt;grid.el&lt;/code&gt; counts (it's the basis behind &lt;code&gt;M-x tetris&lt;/code&gt;, &lt;code&gt;M-x snake&lt;/code&gt;, &lt;code&gt;M-x pong&lt;/code&gt;, etc.).  3D games rely on graphical acceleration, typically solved with OpenGL, DirectX or whatever the favored low-level solution to leverage your GPU is.  Emacs doesn't have FFI and even with the upcoming module support this kind of thing is possible, but far from on the same level of convenience as SDL or comparable solutions.  You could alternatively write a software rasterizer, but I doubt this will have comparable speeds unless you restrict yourself to wireframe rendering maybe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the graphical abilities, the display engine allows you to display images.  Most games go for tiling by generating many square-sized images and moving them around, others generate a single one, place it in a suitable location and update.  Puzzle games can get away with updating on user input, anything more advanced will need to build its own game loop hosted on top of Emacs editing loop.  It's tricky to do this in a speedy manner, but I've succeeded in doing so for &lt;a href=&quot;https://github.com/wasamasa/retris&quot;&gt;a XPM Tetris&lt;/a&gt;.  &lt;a href=&quot;https://github.com/wasamasa/zone-nyan&quot;&gt;SVG allows you more freedom ultimately&lt;/a&gt;, so that's where my future demos will go.  For further details, check out my &lt;a href=&quot;https://github.com/wasamasa/quasiconf-2015&quot;&gt;Quasiconf 2015 talk&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tl;dr: You can make games, it's not a walk in the park, a 3D FPS is currently out of the question.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-11-26T08:29:21.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18412" PostTypeId="1" CreationDate="2015-11-26T11:48:15.793" Score="2" ViewCount="521" Body="&lt;p&gt;It is possible to control Spotify with &lt;code&gt;spotify.el&lt;/code&gt; and &lt;code&gt;helm-spotify&lt;/code&gt; packages right from Emacs, and that's awesome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I couldn't find a simple way to control Google Play Music, has anyone figured it out?&lt;/p&gt;&#xA;" OwnerUserId="8992" LastActivityDate="2015-11-26T11:48:15.793" Title="Google Play Music" Tags="|music-player|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18413" PostTypeId="2" ParentId="18410" CreationDate="2015-11-26T12:18:12.390" Score="3" Body="&lt;p&gt;Did you see Multiplayer 3D walk on Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's just amazing !&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=YS5CUj9oUhs&quot; rel=&quot;nofollow&quot;&gt;3D maze by Emacs (Multiplayer)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/kiwanami/emacs-3d-demo&quot; rel=&quot;nofollow&quot;&gt;kiwanami/emacs-3d-demo · GitHub&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://d.hatena.ne.jp/kiwanami/20110413/1302709536&quot; rel=&quot;nofollow&quot;&gt;Emacs 3D Multiplayer FPS (in Japanese)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=ckOpWQYpKjo&quot; rel=&quot;nofollow&quot;&gt;3D maze by Emacs (single player)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://news.ycombinator.com/item?id=2449500&quot; rel=&quot;nofollow&quot;&gt;Multi-player 3D FSP on Emacs | Hacker News&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The author kiwanami says, drawing graphics and numerical calculation in Emacs is so much slower compared to Java.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He is joking &quot;about 1,000 times slower.&quot; ;)&lt;/p&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-11-26T14:23:49.207" LastActivityDate="2015-11-26T14:23:49.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18414" PostTypeId="1" CreationDate="2015-11-26T12:18:46.947" Score="4" ViewCount="64" Body="&lt;p&gt;How can I express syntax rules like &quot;&lt;code&gt;[0-9/.:*+!_'?-]&lt;/code&gt; are valid symbol constituent, but not as the first char&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or &quot;&lt;code&gt;/&lt;/code&gt; is a valid symbol constituent, but can only appear once and in the middle of a symbol&quot;.&lt;/p&gt;&#xA;" OwnerUserId="6859" LastActivityDate="2015-11-26T12:18:46.947" Title="Help with advanced syntax rules" Tags="|syntax-highlighting|syntax-table|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18415" PostTypeId="2" ParentId="18410" CreationDate="2015-11-26T15:02:17.440" Score="2" Body="&lt;p&gt;Short: Is it text? Emacs can do it. Is it a 3D GUI that allows you to place objects in a scene? You are looking for a scene editor. Scene editors are not text editors or IDEs. They are a completely different application altogether. You can program any game imaginable in Emacs, but you will likely need other tools besides a code editor to perform the other tasks needed to complete a game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long: I professionally use Emacs to program games which utilize the Crytek, Unity, and Unreal game engines, among other engines. Game programming using a programming language is just text editing, which is something Emacs excels at. However, when it comes to placing objects in a scene, rotating them, animating them, etc., this is typically done in specialized applications. This separation of applications is not peculiar to Emacs, this is how game programming is done in general on all OS and development platforms. Visual Studio does not support scene management either. Indeed, I am not aware of any major IDE that supports scene management, though some scene managers have built-in code editors. However they are usually feature poor compared to a dedicated code editor or IDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you read about the applications and libraries professional game programmers use. I personally prefer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Blender (3D modeling and animation)&lt;/li&gt;&#xA;&lt;li&gt;Emacs (text and code editing)&lt;/li&gt;&#xA;&lt;li&gt;engine-specific scene editor (example: Unity and Unreal editors)&lt;/li&gt;&#xA;&lt;li&gt;lots of software libraries so I don't have to reinvent the wheel&lt;/li&gt;&#xA;&lt;li&gt;a GPU debugger, such as apitrace&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2015-11-26T15:16:20.857" LastActivityDate="2015-11-26T15:16:20.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18417" PostTypeId="2" ParentId="13701" CreationDate="2015-11-26T16:07:18.723" Score="3" Body="&lt;p&gt;All you (should) need to do is insert the following line in your emacs config:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq haskell-process-type 'stack-ghci)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That tells emacs that you want to use stack's repl command instead of whatever haskell-mode tries to infer automatically for you.&lt;/p&gt;&#xA;" OwnerUserId="10183" LastActivityDate="2015-11-26T16:07:18.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18418" PostTypeId="1" AcceptedAnswerId="18441" CreationDate="2015-11-26T16:29:09.790" Score="4" ViewCount="2553" Body="&lt;p&gt;It's a very simple task, really. But all my google results come up with complex solutions. I must be blind or going about this wrong. Anyway...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to split up my emacs configuration in the following structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.emacs.d/&#xA;  init.el&#xA;  custom1/&#xA;  custom2/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want &lt;code&gt;init.el&lt;/code&gt; to be as minimal as possible, just something that says &quot;load all &lt;code&gt;.el&lt;/code&gt; files in &lt;code&gt;custom1/&lt;/code&gt; and &lt;code&gt;custom2/&lt;/code&gt;, recursively&quot;. Whenever I put a new file in any of those two directories I want it to automatically be loaded when emacs is started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems simple and easy to me. But I fail at finding a simple solution.&lt;/p&gt;&#xA;" OwnerUserId="10298" LastActivityDate="2015-11-27T09:17:35.893" Title="Split configuration into multiple files" Tags="|init-file|osx|emacs24|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18419" PostTypeId="2" ParentId="18405" CreationDate="2015-11-26T16:34:48.510" Score="2" Body="&lt;p&gt;I had &lt;code&gt;(global-linum-mode 1)&lt;/code&gt; on my init.el, and that conflicts with org-capture somehow.&#xA;I've changed it to &lt;code&gt;(add-hook 'prog-mode-hook 'linum-mode)&lt;/code&gt; and the issue was gone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently linum-mode is not compatible with org-capture.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2015-11-26T16:34:48.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18420" PostTypeId="1" AcceptedAnswerId="18432" CreationDate="2015-11-26T18:51:16.473" Score="6" ViewCount="403" Body="&lt;p&gt;I have 2 documents, one of which I'd like to include in the other. The first is an assignment sheet, and the second the rubric I'm going to use to grade the assignment. I want to &lt;code&gt;#+INCLUDE&lt;/code&gt; the rubric with the assignment so I can discuss it with the class when I assign it, but I have it as a separate file so I can fill out a copy for each student's paper when I'm grading them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rubric and assignment sheet both have &lt;code&gt;#+TITLE&lt;/code&gt; and &lt;code&gt;#+AUTHOR&lt;/code&gt; fields, viz:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ASSIGNMENT SHEET:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: date:nil toc:nil num:nil&#xA;#+TITLE: Assignment Sheet&#xA;#+AUTHOR: me&#xA;&#xA;* heading&#xA;#+INCLUDE: &quot;rubric.org&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;RUBRIC:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: rubric&#xA;#+AUTHOR: me&#xA;&#xA;* content&#xA;  some content&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export &lt;code&gt;assignment-sheet.org&lt;/code&gt; with &lt;code&gt;C-c C-e l o&lt;/code&gt; the result has both titles and both authors concatenated:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YCa9X.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YCa9X.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish the included file's redundant &lt;code&gt;#+TITLE&lt;/code&gt; and &lt;code&gt;#+AUTHOR&lt;/code&gt; could be subordinated to the those of the main file. Is there a way to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2015-11-27T02:21:48.760" Title="Unwanted concatenation of multiple #+TITLE and #+AUTHOR when using #+INCLUDE" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18421" PostTypeId="1" AcceptedAnswerId="18423" CreationDate="2015-11-26T19:35:27.510" Score="0" ViewCount="629" Body="&lt;p&gt;I am having problems to configure my &lt;code&gt;EMACS&lt;/code&gt; in &lt;code&gt;-nw&lt;/code&gt; mode using linux thorough &lt;code&gt;ssh&lt;/code&gt;. I am trying to map &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt; to &lt;strong&gt;redo&lt;/strong&gt; using &lt;em&gt;undo-tree-redo&lt;/em&gt;. I tried the following code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'redo 'undo-tree-redo)&#xA;(global-set-key (kbd &quot;C-z&quot;) 'undo)&#xA;(global-set-key (kbd &quot;C-S-z&quot;) 'redo)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also want to map some other key bindings using the &lt;kbd&gt;Shift&lt;/kbd&gt; key, however, it seems that it is not mapped correctly. I tried to follow this solution &lt;a href=&quot;https://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal&quot;&gt;Shift+Up isn&amp;#39;t recognized by Emacs in a terminal&lt;/a&gt;. However when I try to get the escape function to say &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt; using &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Q&lt;/kbd&gt;, it returns &lt;code&gt;^Z&lt;/code&gt;, which is exactly the same as whiotu the shift key!!!! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the &lt;kbd&gt;Shift&lt;/kbd&gt; key has absolutly no effect on the key binding. The shift key does work though, since I can use it to capitalize etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I solve this issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: some other keys also have a weird behaviour when using &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Q&lt;/kbd&gt; to insert the characters literally. For instance the &lt;kbd&gt;return&lt;/kbd&gt; key gives &lt;code&gt;^M&lt;/code&gt; and the &lt;kbd&gt;backspace&lt;/kbd&gt; gives &lt;code&gt;^?&lt;/code&gt;. I have absolutely no idea what's going on!&lt;/p&gt;&#xA;" OwnerUserId="10302" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-11-26T20:16:47.747" Title="Weird keyboard behaviour by Emacs in a terminal" Tags="|key-bindings|keymap|terminal-emacs|" AnswerCount="1" CommentCount="1" ClosedDate="2015-11-27T14:12:42.177" ContentLicense="CC BY-SA 3.0" />
  <row Id="18422" PostTypeId="1" AcceptedAnswerId="18424" CreationDate="2015-11-26T20:15:28.330" Score="2" ViewCount="211" Body="&lt;p&gt;I would like my minor mode to set the buffer font, but not the frame font (the font contains special characters I need, but the hinting is abysmal). I got to this point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode transcribe-mode &#xA;    &quot;A minor mode for transkription of old prints and manuscripts.&quot;&#xA;    :light &quot;Transcribe mode&quot;&#xA;    :keymap (let &#xA;    ((map (make-sparse-keymap)))&#xA;&#xA;    (define-key map (kbd &quot;M-e&quot;) (kbd &quot;ͤ&quot;))  ;; superscript e&#xA;    (define-key map (kbd &quot;M-n&quot;) (kbd &quot;̃&quot;))  ;; superscript tilde (for nasalization)&#xA;    (define-key map (kbd &quot;M-r&quot;) (kbd &quot;ꝛ&quot;))  ;; r rotunda&#xA;    (define-key map (kbd &quot;M-s&quot;) (kbd &quot;ſ&quot;))  ;; long s&#xA;    (define-key map (kbd &quot;M-d n&quot;) (kbd &quot;&quot;))    ;; duplicate n&#xA;    (define-key map (kbd &quot;M-d m&quot;) (kbd &quot;&quot;))    ;; duplicate m&#xA;&#xA;    ;; map variants of German letters to their location on a German keyboard&#xA;    (define-key map (kbd &quot;M-'&quot;) (kbd &quot;&quot;))  ;; a umlaut with superscript e&#xA;    (define-key map (kbd &quot;M-;&quot;) (kbd &quot;&quot;))  ;; a umlaut with superscript e&#xA;    (define-key map (kbd &quot;M-[&quot;) (kbd &quot;&quot;))  ;; a umlaut with superscript e&#xA;    (define-key map (kbd &quot;M-u&quot;) (kbd &quot;ů&quot;))  ;; u with superscript o&#xA;    (define-key map (kbd &quot;M--&quot;) (kbd &quot;ß&quot;))  ;; sharp s, sz ligature&#xA;&#xA;    map)&#xA;&#xA;    ;; turn on abbrev mode globally&#xA;    (setq-default abbrev-mode t)&#xA;&#xA;    (setq-default auto-fill-function 'do-auto-fill)&#xA;&#xA;    (visual-line-mode t)&#xA;    (setq-default word-wrap t)&#xA;)&#xA;&#xA;(defun transcription-font-variable ()&#xA;        (interactive)&#xA;        (setq buffer-face-mode-face '(:family &quot;Andron Scriptor Web&quot; :height 100))&#xA;        (buffer-face-mode)&#xA;)&#xA;&#xA;(add-hook 'transcribe-hook 'transcription-font-variable)&#xA;&#xA;(add-hook 'text-mode-hook 'transcribe-mode)&#xA;&#xA;(provide 'transcribe-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works fine except the font change, and no errors or warnings are being displayed. The font is installed, setting it globally works. I'm using Emacs 24.&lt;/p&gt;&#xA;" OwnerUserId="10303" LastActivityDate="2015-11-26T20:37:38.663" Title="Set buffer font with minor mode" Tags="|fonts|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18423" PostTypeId="2" ParentId="18421" CreationDate="2015-11-26T20:16:47.747" Score="0" Body="&lt;p&gt;Correct, C-z and C-S-z are the same when inside of a terminal; the terminal protocol simply provides no way to distinguish between them. The terminal only deals in characters, not keypresses, so there's no way for the other end to know what modifier keys were in use, only what character was generated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I presume you're running Emacs over ssh in order to edit files on the remote host, I recommend that you run Emacs locally instead, and edit the files over ssh using TRAMP mode. Simply type in a remote filename when you open a file: &lt;code&gt;C-x f /user@otherhost:path/to/file RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, you can figure out what's going on by looking at a chart of the &lt;a href=&quot;https://en.wikipedia.org/wiki/ASCII#ASCII_control_code_chart&quot; rel=&quot;nofollow&quot;&gt;ASCII control codes&lt;/a&gt;. &lt;code&gt;C-q RET&lt;/code&gt; produces ^M because that's the carriage return character, and &lt;code&gt;C-q DEL&lt;/code&gt; produces ^? because that's the delete character. They're displayed as ^M and ^? because they're not normally displayed at all.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-26T20:16:47.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18424" PostTypeId="2" ParentId="18422" CreationDate="2015-11-26T20:37:38.663" Score="2" Body="&lt;p&gt;The hook is called &lt;code&gt;transcribe-mode-hook&lt;/code&gt;, not &lt;code&gt;transcribe-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see what the &lt;code&gt;define-minor-mode&lt;/code&gt; macro actually does, place point after the last closing paren and call &lt;code&gt;pp-macro-expand-last-sexp&lt;/code&gt;. Reading through the results you'll see the name of the hook. This is also documented in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Minor-Modes.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-11-26T20:37:38.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18425" PostTypeId="2" ParentId="17643" CreationDate="2015-11-26T22:10:18.443" Score="1" Body="&lt;p&gt;As suggested in Qudit's answer, this can be done by advising &lt;code&gt;clipboard-yank&lt;/code&gt; and &lt;code&gt;mouse-yank-primary&lt;/code&gt; (see section 12.3 of emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Cut-and-Paste.html#Cut-and-Paste&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-tabs-in-region (string)&#xA;  (subst-char-in-region (point) (mark) ?\t 32))&#xA;&#xA;(advice-add 'clipboard-yank :after #'remove-tabs-in-region)&#xA;(advice-add 'mouse-yank-primary :after #'remove-tabs-in-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not try to be smart, each tab is simply replaced by a space.  Maybe &lt;code&gt;indent-region&lt;/code&gt; could also be called in the advice?&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-26T22:10:18.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18426" PostTypeId="1" CreationDate="2015-11-26T22:18:58.563" Score="1" ViewCount="995" Body="&lt;p&gt;I have recently encountered a problem with autocomplete when used together with linum. When I turn on the global-linum-mode, the emacs only shows part of the popped-up menu of candidates correctly. For example, after typing 'add' at line 11, several lines of the popup menu for autocomplete are blocked by white space after the first letter of the candidate words, as shown in the following figure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6MGII.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6MGII.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a few trials, I found the error occurs when the autocomplete is aroused if the word to be completed (in this case the word 'add') starts from the first or second column. In addition, to reproduce the error, the popup menu needs to be overlapped with some text in the document (there are text in line 12-18 in the example). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following minimum configuration in the &lt;em&gt;.emacs&lt;/em&gt; file can be used to reproduce the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/lisp&quot;)   &#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;) &#xA;(global-auto-complete-mode t)&#xA;(defun auto-complete-mode-maybe ()&#xA;;  &quot;No maybe for you. Only AC!&quot;&#xA;  (unless (minibufferp (current-buffer))&#xA;    (auto-complete-mode 1)))&#xA;&#xA;(require 'linum)&#xA;(global-linum-mode t)&#xA;(setq linum-format &quot;%4d&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.16.6)&#xA; of 2015-09-17 on lgw01-52, modified by Debian on a linux machine (Ubuntu 15.10). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated and please feel free to let me know if my question is unclear. Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;It seems that this is a bug in emacs 24.5, shown by the following link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/auto-complete/auto-complete/issues/402&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/auto-complete/auto-complete/issues/402&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, the following error messages occur when the popup menu fails to show up completely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error running timer `ac-update-greedy': (wrong-type-argument wholenump -259)&#xA;Error running timer `ac-show-menu': (wrong-type-argument wholenump -120)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I will keep searching for solutions and update this question if I find one.  &lt;/p&gt;&#xA;" OwnerUserId="10300" LastEditorUserId="10300" LastEditDate="2015-11-29T17:49:10.223" LastActivityDate="2015-11-29T17:49:10.223" Title="autocomplete popup menu broken emacs 24.5.1" Tags="|auto-complete-mode|linum-mode|emacs24|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18427" PostTypeId="1" AcceptedAnswerId="18459" CreationDate="2015-11-26T22:27:30.053" Score="1" ViewCount="280" Body="&lt;p&gt;I am sitting on OS X and I have written the following elisp to set comint-previous-input function to s-up, but my configuration is not working. What might be wrong here? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'inferior-python-mode-hook&#xA;      (lambda () (local-set-key (kbd &quot;s-&amp;lt;up&amp;gt;&quot;) 'comint-previous-input)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8508" LastActivityDate="2015-11-27T22:47:46.383" Title="How do I add a hook to inferior python?" Tags="|init-file|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18428" PostTypeId="1" AcceptedAnswerId="18429" CreationDate="2015-11-27T00:59:58.513" Score="2" ViewCount="182" Body="&lt;p&gt;According to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html#Using-Lexical-Binding&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;, it seems to say setting &lt;code&gt;lexical-binding&lt;/code&gt; only happens at the individual buffer level, i.e. I could not do &lt;code&gt;(setq lexical-binding t)&lt;/code&gt; in my init file and have it apply to all subsequent buffers, right?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-06-22T20:41:25.633" LastActivityDate="2016-06-22T20:41:25.633" Title="lexical-binding only set at the buffer level?" Tags="|lexical-scoping|lexical-binding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18429" PostTypeId="2" ParentId="18428" CreationDate="2015-11-27T01:49:28.593" Score="2" Body="&lt;p&gt;Correct, it's set on a per-file/buffer basis.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I could not do &lt;code&gt;(setq lexical-binding t)&lt;/code&gt; in my init file and have it apply to all subsequent buffers, right?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed not, and nor would you want to do that. Libraries may behave differently with lexical binding enabled, and for the vast majority of the history of Emacs that wasn't an option, so no one was writing code with lexical binding in mind. Forcing it on libraries which aren't expecting it could break all manner of things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strictly speaking, &lt;code&gt;setq-default&lt;/code&gt; &lt;em&gt;might&lt;/em&gt; do this if there's no specific protection against it, but you'd never want to do that, and I have a feeling that Emacs requires it to be a file-local variable.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-11-27T01:49:28.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18430" PostTypeId="2" ParentId="14394" CreationDate="2015-11-27T01:58:08.777" Score="3" Body="&lt;p&gt;Here is a try for automating transpose on export, I hope it helps.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Example 1: Basic&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;First, We name each of R code blocks by placing &lt;code&gt;#+NAME:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: r-out-01&#xA;#+begin_src R :results output value&#xA;c('a','b','c')&#xA;#+end_src&#xA;&#xA;#+RESULTS: r-out-01&#xA;| a |&#xA;| b |&#xA;| c |&#xA;&#xA;&#xA;#+NAME: r-out-02&#xA;#+begin_src R :results output value&#xA;matrix(1:8, ncol = 4, byrow = TRUE)&#xA;##matrix(1:8, nrow = 4)&#xA;#+end_src&#xA;&#xA;#+RESULTS: r-out-02&#xA;| 1 | 2 | 3 | 4 |&#xA;| 5 | 6 | 7 | 8 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, Emacs Lisp block transpose values from r-out-01.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value :var tmp-01=r-out-01&#xA;;; (mapcar 'car tmp-01) ;; for a vector&#xA;(apply #'mapcar* #'list tmp-01) ;; for both a vector and a matrix&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| a | b | c |&#xA;&#xA;&#xA;#+BEGIN_SRC emacs-lisp :results value :var tmp-02=r-out-02&#xA;(apply #'mapcar* #'list tmp-02)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| 1 | 5 |&#xA;| 2 | 6 |&#xA;| 3 | 7 |&#xA;| 4 | 8 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, just &lt;code&gt;#+NAME:&lt;/code&gt; R code block, add 3 lines of Emacs Lisp after your R code block.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Example 2: Function&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you have to transpose so often, make it more convienient by &lt;code&gt;#+CALL:&lt;/code&gt;.&#xA;&lt;code&gt;C-c C-c&lt;/code&gt; on the line &lt;code&gt;#+CALL:&lt;/code&gt; will produce transposed &lt;code&gt;#+RESULTS:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: transpose-r-out&#xA;#+BEGIN_SRC emacs-lisp :var tmp=&quot;&quot; :results output value :exports code&#xA;(if (list tmp)(apply #'mapcar* #'list tmp) nil)&#xA;#+END_SRC&#xA;&#xA;&#xA;#+CALL: transpose-r-out(tmp=r-out-01) :results output value&#xA;&#xA;#+RESULTS:&#xA;| a | b | c |&#xA;&#xA;&#xA;#+CALL: transpose-r-out(tmp=r-out-02) :results output value&#xA;&#xA;#+RESULTS:&#xA;| 1 | 5 |&#xA;| 2 | 6 |&#xA;| 3 | 7 |&#xA;| 4 | 8 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastActivityDate="2015-11-27T01:58:08.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18432" PostTypeId="2" ParentId="18420" CreationDate="2015-11-27T02:21:48.760" Score="4" Body="&lt;p&gt;I'll have a try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To exclude first two lines of &quot;rubric.org&quot;.&#xA;include lines from 3 to end of file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: date:nil toc:nil num:nil&#xA;#+TITLE: Assignment Sheet&#xA;#+AUTHOR: me&#xA;&#xA;* heading&#xA;#+INCLUDE: &quot;rubric.org&quot; :lines &quot;3-&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Include-files.html&quot; rel=&quot;nofollow&quot;&gt;11.4 Include files&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8634" LastActivityDate="2015-11-27T02:21:48.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18433" PostTypeId="1" AcceptedAnswerId="18434" CreationDate="2015-11-27T03:43:03.283" Score="7" ViewCount="448" Body="&lt;p&gt;The option &lt;code&gt;org-return-follows-link&lt;/code&gt; is wonderfully convenient &lt;strong&gt;except&lt;/strong&gt; when the point is at the end of the line where the intention is usually to insert a carriage return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way to change this behavior to insert a carriage return in this edge case?&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2015-11-27T05:07:57.083" LastActivityDate="2016-03-09T10:26:00.327" Title="Avoid following link when using org-return-follows-link and point is at end of line" Tags="|org-mode|customize|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18434" PostTypeId="2" ParentId="18433" CreationDate="2015-11-27T03:43:03.283" Score="3" Body="&lt;p&gt;I made the following modification to &lt;code&gt;org-return&lt;/code&gt;.  I'll change the correct answer if a better one is offered.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ((and org-return-follows-link&#xA;+   (not (eolp))&#xA;    (or (org-at-timestamp-p t)&#xA;        (org-at-date-range-p t)&#xA;       (org-in-regexp org-any-link-re)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2015-11-27T03:57:41.873" LastActivityDate="2015-11-27T03:57:41.873" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18436" PostTypeId="2" ParentId="18386" CreationDate="2015-11-27T04:23:46.213" Score="4" Body="&lt;p&gt;You might be able to reuse some of the code from the bottom of &lt;a href=&quot;http://pages.sachachua.com/evil-plans/&quot; rel=&quot;nofollow&quot;&gt;http://pages.sachachua.com/evil-plans/&lt;/a&gt; . I basically use org-map-entries to go through my headings. Since I have a directed graph instead of a strict tree, I use simple regular expression searches to parse the link structure from human-friendly text. If you're just working with a tree, you can create your tree structure from the headings directly. After that, it's a matter of generating the appropriate graphviz syntax, and org-babel can handle producing that and converting it into a PNG or SVG. Hope that helps!&lt;/p&gt;&#xA;" OwnerUserId="364" LastActivityDate="2015-11-27T04:23:46.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18437" PostTypeId="2" ParentId="18386" CreationDate="2015-11-27T05:37:45.637" Score="3" Body="&lt;p&gt;It's not dot, but if you're in a hurry, followings might be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need &lt;code&gt;org-plus-contrib&lt;/code&gt; and FreeMind.app to produce a mindmap from org-mode documents.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://freemind.sourceforge.net/wiki/index.php/Main_Page&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://freemind.sourceforge.net/wiki/index.php/Main_Page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Install extra org-mode package called &lt;code&gt;org-plus-contrib&lt;/code&gt; by &lt;code&gt;M-x package-list-packages&lt;/code&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps we might need to add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox-freemind)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to our .emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we can export our org-mode file to Freemind *.mm file by &lt;code&gt;C-c C-e f f&lt;/code&gt;, &lt;code&gt;org-freemind-export-to-freemind&lt;/code&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we open *.mm from Freemind.app, and voila !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Cses3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Cses3.png&quot; alt=&quot;org-to-mm-mouse-over&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mouse over to see contents of the nodes. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;caution: &lt;a href=&quot;http://orgmode.org/worg/exporters/freemind.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Freemind export&lt;/a&gt; has old information on Org &amp;lt;8.0 manual &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-11-27T09:06:53.590" LastActivityDate="2015-11-27T09:06:53.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18438" PostTypeId="1" AcceptedAnswerId="19110" CreationDate="2015-11-27T06:51:58.437" Score="7" ViewCount="1393" Body="&lt;p&gt;I toggled the &lt;code&gt;debug-on-error&lt;/code&gt; and &lt;code&gt;debug-on-quit&lt;/code&gt; options, then press &lt;code&gt;C-g&lt;/code&gt; when Emacs suspend.&#xA;Got this error output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (quit)&#xA;  call-process(&quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;)&#xA;  (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;unknown.+key&quot; nil t) (setq result (concat result &quot; -o ControlPath='tramp.%%r@%%h:%%p'&quot;)) (setq result (concat result &quot; -o ControlPath='tramp.%%C'&quot;))))&#xA;  (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;unknown.+key&quot; nil t) (setq result (concat result &quot; -o ControlPath='tramp.%%r@%%h:%%p'&quot;)) (setq result (concat result &quot; -o ControlPath='tramp.%%C'&quot;)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))&#xA;  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;unknown.+key&quot; nil t) (setq result (concat result &quot; -o ControlPath='tramp.%%r@%%h:%%p'&quot;)) (setq result (concat result &quot; -o ControlPath='tramp.%%C'&quot;)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))&#xA;  (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;unknown.+key&quot; nil t) (setq result (concat result &quot; -o ControlPath='tramp.%%r@%%h:%%p'&quot;)) (setq result (concat result &quot; -o ControlPath='tramp.%%C'&quot;)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))&#xA;  (if (zerop (length result)) nil (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;unknown.+key&quot; nil t) (setq result (concat result &quot; -o ControlPath='tramp.%%r@%%h:%%p'&quot;)) (setq result (concat result &quot; -o ControlPath='tramp.%%C'&quot;)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPersist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;missing.+argument&quot; nil t) (progn (setq result ...)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))&#xA;  (progn (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlMaster&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;missing.+argument&quot; nil t) (progn (setq result &quot;-o ControlMaster=auto&quot;)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if (zerop (length result)) nil (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;unknown.+key&quot; nil t) (setq result ...) (setq result ...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPersist&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;missing.+argument&quot; nil t) (progn ...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))&#xA;  (if (executable-find &quot;ssh&quot;) (progn (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlMaster&quot;) (goto-char (point-min)) (if (search-forward-regexp &quot;missing.+argument&quot; nil t) (progn ...))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if (zerop (length result)) nil (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPath=%C&quot; &quot;host.does.not.exist&quot;) (goto-char ...) (if ... ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlPersist&quot;) (goto-char ...) (if ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))))&#xA;  (progn (if (executable-find &quot;ssh&quot;) (progn (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (call-process &quot;ssh&quot; nil t nil &quot;-o&quot; &quot;ControlMaster&quot;) (goto-char ...) (if ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (if (zerop (length result)) nil (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ...) (and ... ...)))) (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ...) (and ... ...))))))))&#xA;  (condition-case nil (progn (if (executable-find &quot;ssh&quot;) (progn (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ...) (and ... ...)))) (if (zerop (length result)) nil (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))) (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))))))) (error nil))&#xA;  (let ((result &quot;&quot;) (case-fold-search t)) (condition-case nil (progn (if (executable-find &quot;ssh&quot;) (progn (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...))) (if (zerop (length result)) nil (let (...) (save-current-buffer ... ...)) (let (...) (save-current-buffer ... ...)))))) (error nil)) result)&#xA;  (defvar tramp-ssh-controlmaster-options (let ((result &quot;&quot;) (case-fold-search t)) (condition-case nil (progn (if (executable-find &quot;ssh&quot;) (progn (let (...) (save-current-buffer ... ...)) (if (zerop ...) nil (let ... ...) (let ... ...))))) (error nil)) result) &quot;Call ssh to detect whether it supports the Control* arguments.\nReturn a string to be used in `tramp-methods'.&quot;)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-504950&amp;gt; nil &quot;/usr/share/emacs/24.5/lisp/net/tramp-loaddefs.el&quot; nil t)  ; Reading at buffer position 7082&#xA;  load-with-code-conversion(&quot;/usr/share/emacs/24.5/lisp/net/tramp-loaddefs.el&quot; &quot;/usr/share/emacs/24.5/lisp/net/tramp-loaddefs.el&quot; nil t)&#xA;  #&amp;lt;subr require&amp;gt;(tramp-loaddefs nil nil)&#xA;  ad-Advice-require(#&amp;lt;subr require&amp;gt; tramp-loaddefs)&#xA;  apply(ad-Advice-require #&amp;lt;subr require&amp;gt; tramp-loaddefs)&#xA;  require(tramp-loaddefs)&#xA;  byte-code(&quot;\300\301!\207&quot; [require tramp-loaddefs] 2)&#xA;  byte-code(&quot;\300\301\302\303#\210\300\304\305\306#\210\300\304\307\306#\210\300\304\310\306#\210\300\304\311\306#\210\300\304\312\306#\210\300\304\313\306#\210\300\314\315\316#\210\300\317\320\316#\210\300\304\321\306#\210\300\322\323\306#\210\300\324\325\306#\210\300\322\326\306#\210\300\327\330\316#\210\300\331\332\303#\210\300\331\333\303#\210\300\331\334\303#\210\300\331\335\303#\210\300\331\336\303#\210\300\337\340\341#\210\342\343!\203\206&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And ssh daemon also prompt for password through program &lt;code&gt;ksshaskpass&lt;/code&gt;:&#xA;Here is the screenshot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WMv5c.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WMv5c.png&quot; alt=&quot;ssh askpass screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="5296" LastEditDate="2015-12-27T16:21:40.290" LastActivityDate="2015-12-27T16:24:47.623" Title="Emacs suspend at startup ssh connection issue" Tags="|tramp|ssh|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18439" PostTypeId="2" ParentId="18438" CreationDate="2015-11-27T07:30:19.190" Score="0" Body="&lt;p&gt;I wrap tramp configs with &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt;. So it caused this error.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2015-11-27T10:40:15.833" LastActivityDate="2015-11-27T10:40:15.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18440" PostTypeId="1" CreationDate="2015-11-27T08:50:20.417" Score="4" ViewCount="342" Body="&lt;p&gt;I'm starting to use (a total newbie, actually) org-mode clocking commands to track time spent during the job day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to fill some reports on daily start and end time of my work day.  This is just: I sat to code at 9am and left at 1pm.  For each week's day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been reading through the docs and I can just find reports based on the task items and don't see how to accomplish my report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I start to look at or what docs would you recommend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="9309" LastActivityDate="2015-11-27T08:50:20.417" Title="org-mode report with start and end time for each day of the week" Tags="|org-mode|org-clock|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18441" PostTypeId="2" ParentId="18418" CreationDate="2015-11-27T09:17:35.893" Score="0" Body="&lt;p&gt;Here's an answer based on the comment from @lawlist:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The file &lt;code&gt;~/.emacs.d/load-directory.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun load-directory (directory)&#xA;  &quot;Load recursively all `.el' files in DIRECTORY.&quot;&#xA;  (dolist (element (directory-files-and-attributes directory nil nil nil))&#xA;    (let* ((path (car element))&#xA;           (fullpath (concat directory &quot;/&quot; path))&#xA;           (isdir (car (cdr element)))&#xA;           (ignore-dir (or (string= path &quot;.&quot;) (string= path &quot;..&quot;))))&#xA;      (cond&#xA;       ((and (eq isdir t) (not ignore-dir))&#xA;        (load-directory fullpath))&#xA;       ((and (eq isdir nil) (string= (substring path -3) &quot;.el&quot;))&#xA;        (load (file-name-sans-extension fullpath)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/.emacs.d/load-directory&quot;)&#xA;(load-directory &quot;~/.emacs.d/custom1&quot;)&#xA;(load-directory &quot;~/.emacs.d/custom2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10298" LastActivityDate="2015-11-27T09:17:35.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18442" PostTypeId="1" AcceptedAnswerId="18447" CreationDate="2015-11-27T10:12:21.720" Score="4" ViewCount="194" Body="&lt;p&gt;I'm having some performance problems with the latest version of &lt;code&gt;magit&lt;/code&gt;, which I'm trying to profile to find the reason. I'm doing the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x profiler-start&#xA;M-x magit-status&#xA;M-x profiler-report&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the report is truncated horizontally, so that I'm still at over 80% of CPU time when the function names are just replaced with &lt;code&gt;...&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I work around this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NjRcg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NjRcg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="753" LastEditorUserId="2642" LastEditDate="2017-01-10T17:41:34.240" LastActivityDate="2017-01-10T17:41:34.240" Title="`profiler-report` output is truncated horizontally?" Tags="|profiler|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18443" PostTypeId="2" ParentId="14898" CreationDate="2015-11-27T10:55:28.340" Score="3" Body="&lt;p&gt;ESLint silently ignores hidden files.  Thus, by setting &lt;code&gt;flycheck-temp-prefix&lt;/code&gt; to &lt;code&gt;.&lt;/code&gt; you've effectively disabled ESLint, which is why Flycheck shows no errors anymore: It doesn't get any from ESLint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Flycheck 0.25.1 no longer creates temporary files for ESLint (and plenty of other checkers) and passes buffer contents via standard input instead.  Hence the issue with mocha should be gone now, and you don't need to change &lt;code&gt;flycheck-temp-prefix&lt;/code&gt; anymore.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-11-27T10:55:28.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18444" PostTypeId="1" AcceptedAnswerId="18474" CreationDate="2015-11-27T11:00:19.517" Score="9" ViewCount="177" Body="&lt;p&gt;I'm teaching myself some more elisp and have encountered the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to reset a list variable it won't get updated after the first evaluation. Here is some example code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun initilize ()&#xA;  (setq example '(3)))&#xA;&#xA;(defun modify ()&#xA;  (initilize)&#xA;  (message &quot;%S&quot; example)&#xA;  (setcar example 2))&#xA;&#xA;; M-x eval-buffer RET&#xA;(modify) ; message --&amp;gt; (3)&#xA;(modify) ; message --&amp;gt; (2)&#xA;(modify) ; message --&amp;gt; (2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm interested in two things. The first is to learn more about what is happening &quot;under the hood&quot; so why does it work the first time and fails on subsequent calls?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second and more practical question is how to reinitialize the list properly or is there another common way of doing something like that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One workaround I found myself is to use a quoted list and evaluating &#xA;the content like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq example `(,3)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="105" LastEditDate="2016-06-13T03:19:31.427" LastActivityDate="2016-06-13T03:19:31.427" Title="Proper reinitialization of a list? What is happening under the hood?" Tags="|list|quote|mutability|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18446" PostTypeId="2" ParentId="18444" CreationDate="2015-11-27T11:38:13.887" Score="5" Body="&lt;p&gt;You can use &lt;code&gt;(setq example (list 3))&lt;/code&gt; to avoid this error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens is &lt;code&gt;init&lt;/code&gt; assigns an object that initially contains &lt;code&gt;(3)&lt;/code&gt; to &lt;code&gt;example&lt;/code&gt;.&#xA;It sets the value of the object only once. Subsequently, you modify this value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's your example in C++, if you understand that better:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c++ prettyprint-override&quot;&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;#include &amp;lt;string.h&amp;gt;&#xA;char* example;&#xA;char* storage = 0;&#xA;char* create_object_once (const char* str) {&#xA;  if (storage == 0) {&#xA;    storage = new char[strlen (str)];&#xA;    strcpy (storage, str);&#xA;  }&#xA;  return storage;&#xA;}&#xA;void init () {&#xA;  example = create_object_once (&quot;test&quot;);&#xA;}&#xA;void modify () {&#xA;  init ();&#xA;  printf (&quot;%s\n&quot;, example);&#xA;  example[0] = 'f';&#xA;}&#xA;int main (int argc, char *argv[]) {&#xA;  modify ();&#xA;  modify ();&#xA;  modify ();&#xA;  return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-11-27T11:38:13.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18447" PostTypeId="2" ParentId="18442" CreationDate="2015-11-27T11:43:52.967" Score="5" Body="&lt;p&gt;In &lt;code&gt;profiler.el&lt;/code&gt; are two variables defined:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar profiler-report-cpu-line-format&#xA;  '((50 left)&#xA;    (24 right ((19 right)&#xA;           (5 right)))))&#xA;&#xA;(defvar profiler-report-memory-line-format&#xA;  '((55 left)&#xA;    (19 right ((14 right profiler-format-number)&#xA;           (5 right)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Those seem to define the formatting of the report table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to adjust them via &lt;code&gt;setq&lt;/code&gt;. Customs do not seem to exist.&lt;/p&gt;&#xA;" OwnerUserId="5448" LastActivityDate="2015-11-27T11:43:52.967" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18451" PostTypeId="1" AcceptedAnswerId="18456" CreationDate="2015-11-27T13:14:15.590" Score="5" ViewCount="136" Body="&lt;p&gt;I was switching to vim for the C-support mode, and then I discover yasnippet for emacs, it is awesome I love it !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now I'm adding basic snippets to insert code and I am currently having a bit of difficulties to make a good for ( ...; ...; ... ) snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can do this :&#xA;    for ( $1; $2; $3 )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like to have some defaults values, or else benefit from the mirror functionality of yast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can set default values with ${$1value} but in my case I think need to imbricate them, I haven't succeed trying it.&#xA;I ewplain what I'd like :&#xA;By default, I should be&#xA;    for ( int i = 0; i &amp;lt; $something; i++ )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the possibility to modify the int type (could be nothing), the variable name, which I want to mirror in the second and third part, and the affectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The condition could also be different, but it needs to contain the first variable, same for incrementation.&#xA;Is it possible ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be a better idea to keep it simple and define more snippets, I wonder if some of you have results with complex snippets. &lt;/p&gt;&#xA;" OwnerUserId="10306" LastEditorUserId="10306" LastEditDate="2015-11-27T14:15:52.453" LastActivityDate="2015-11-27T18:29:26.073" Title="Need help for a snippet - a for in C" Tags="|yasnippet|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18452" PostTypeId="2" ParentId="18377" CreationDate="2015-11-27T13:52:10.393" Score="6" Body="&lt;p&gt;By default Flycheck hooks into the standard error navigation of Emacs to make error navigation for Flycheck as simple as possible.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can disable this feature by setting &lt;code&gt;flycheck-standard-error-navigation&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.  Emacs' standard bindings will now ignore Flycheck's errors.  You can still navigate these with Flycheck's own navigation bindings &lt;code&gt;C-c ! n&lt;/code&gt; and &lt;code&gt;C-c ! p&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-11-27T13:52:10.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18453" PostTypeId="2" ParentId="13911" CreationDate="2015-11-27T15:06:04.987" Score="2" Body="&lt;p&gt;TL;DR: Update to the latest Flycheck release to get rid temporary files entirely.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You cannot change the directory Flycheck writes its temporary files to.  Flycheck tries hard to avoid writing to the current directory, and normally uses the system's temporary directory.  But when it writes to the current directory it does so &lt;em&gt;for a reason&lt;/em&gt;.  In ESLint specifically that's because eslint uses the filename to locate its configuration files, and moving the file out of the source code tree broke user's eslint configuration.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;However, since Flycheck 0.25.1 Flycheck passes buffer contents on standard input to most syntax checkers, including eslint.  Flycheck creates no temporary files for these checkers anymore which should solve all issues with tools that watch the source code tree.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-11-27T15:06:04.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18454" PostTypeId="1" AcceptedAnswerId="18455" CreationDate="2015-11-27T17:21:35.787" Score="3" ViewCount="714" Body="&lt;p&gt;I'm curious about &lt;a href=&quot;http://nullprogram.com/blog/2014/01/27/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;. The author seems to talk about &quot;processes&quot; and whole buffers that hang around past their welcome. I'm hearing in this article that Emacs elisp can start a process, (&lt;a href=&quot;https://github.com/skeeto/elisp-finalize&quot; rel=&quot;nofollow&quot;&gt;this example uses system's ping?&lt;/a&gt;), but then the process stays live (where? on emacs' stack/heap?) until his &lt;code&gt;finalize&lt;/code&gt; frees it. A simpler question might be, how can you intentionally free up anything else in a running (one namespace) Emacs session? For example, with org-mode's Library of Babel, &quot;ingesting&quot; a file of code blocks tangles said code, then with &lt;code&gt;org-sbe&lt;/code&gt; attaches desired code blocks (by name) to a &lt;code&gt;org-babel-library-of-babel&lt;/code&gt; a live variable. All right, I can set it to nil or redo it manually, but what about functions? Do you just set a function symbol to nil in your session? How can I get an overview of what's &quot;live?&quot;&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-06-22T20:40:41.567" LastActivityDate="2016-06-22T20:40:41.567" Title="Control of garbage collection?" Tags="|variables|process|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18455" PostTypeId="2" ParentId="18454" CreationDate="2015-11-27T18:19:13.313" Score="7" Body="&lt;p&gt;A live object is one that you can reach by following pointers from other live objects. Functions and variables are live because they are reachable from the global list of definitions. Setting a definition to nil means that it no longer points to the value it once did, potentially creating garbage. The GC will collect that garbage in fairly short order. As for processes, it's true that they're never garbage collected. All Emacs has is the file handles to them; since they're external they can't participate in the garbage collection. This is rarely a problem; all the modes that create them either intend for them to stick around long-term (slime, tramp, erc, etc) or clean them up when they're done with them (compile, flymake, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, users of Emacs largely ignore these issues. The garbage collector just works, and although Emacs has a reputation for being a memory hog it uses a trivial amount of memory on today's systems. Clearing one variable is unlikely to free up more than a few bytes, and just causes you to lose information you might have had a use for later. Undefining functions is similar; if you know you're never going to use it you're better off not loading the library instead. That saves you startup time, which is a more valuable commodity than a few dozen bytes of memory.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-27T18:19:13.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18456" PostTypeId="2" ParentId="18451" CreationDate="2015-11-27T18:29:26.073" Score="5" Body="&lt;p&gt;To have a value repeat like you're asking, simply repeat the &lt;code&gt;$N&lt;/code&gt;. For example, I have this &lt;code&gt;for&lt;/code&gt; snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: for&#xA;# key: for&#xA;# --&#xA;for(${1:int} ${2:i} = 0; $2 &amp;lt; ${3:N}; $2++) {&#xA;    $0&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The default expansion is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(int i = 0; i &amp;lt; N; i++) {&#xA;    //cursor&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It only prompts for the first instance of &lt;code&gt;$2&lt;/code&gt;, and automatically updates the others to match it.&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2015-11-27T18:29:26.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18457" PostTypeId="1" AcceptedAnswerId="18884" CreationDate="2015-11-27T21:15:20.090" Score="4" ViewCount="875" Body="&lt;p&gt;I can't seem to identify this color sequence. I have enabled ansi colors successfully (to test, ls shows colored output), however a strange thing happens when I attempt to run &lt;code&gt;npm&lt;/code&gt; and I can't identify the kind of colors these are, or how to make it so eshell can show them. The output is as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Usage npm &amp;lt;command&amp;gt;&#xA;... &amp;lt;remainder of usage here&amp;gt;&#xA;npm @ 3.3.10 /usr/lib/node_modules/npm&#xA;^[[?25h^[[0G^[[?25h^[[0G~/my/directory/that/i/am/in $&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried to look for things like &quot;non-ansi color codes&quot; and &quot;npm color codes&quot; and none of them have pointed me in the correct direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone identify these colors and help me figure out how to display them properly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have identified these as unicode sequences. I have added everything in:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.masteringemacs.org/article/working-coding-systems-unicode-emacs&quot; rel=&quot;nofollow&quot;&gt;https://www.masteringemacs.org/article/working-coding-systems-unicode-emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as well as the following code for Eshell specifically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-buffer-utf8 ()&#xA;   (set-buffer-process-coding-system 'utf-8 'utf-8)&#xA; )&#xA; (add-hook 'eshell-mode-hook 'set-buffer-utf8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not work. I have also tried this with the modes &lt;code&gt;utf-16&lt;/code&gt; and &lt;code&gt;mule-utf-8&lt;/code&gt; with no luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if I type&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;echo $LANG&lt;/code&gt; I get &lt;code&gt;en_US.UTF-8&lt;/code&gt;. &lt;code&gt;echo $LC_ALL&lt;/code&gt; also returns &lt;code&gt;en_US.UTF-8&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have now tried to set the encoding of eshell (in the hook above) to &lt;code&gt;iso-8859-7&lt;/code&gt; and &lt;code&gt;iso-8859-1&lt;/code&gt; with no luck.&lt;/p&gt;&#xA;" OwnerUserId="10194" LastEditorUserId="10" LastEditDate="2015-12-16T08:46:11.640" LastActivityDate="2015-12-16T08:46:11.640" Title="Stripping stray ANSI escape sequences from eshell" Tags="|eshell|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18458" PostTypeId="1" AcceptedAnswerId="18471" CreationDate="2015-11-27T22:35:47.943" Score="5" ViewCount="677" Body="&lt;p&gt;I am trying to replace Microsoft Word(shudder) for this specific process. The process is not specific for email or traditional Mail but similar. The process is that I have a template file with variables that I pull from a spreadsheet. I'm able to &quot;page&quot; through the variables. I'm trying to replicate this in emacs. After searching I have found some cases of people accomplishing this but no details as to how. Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to try to explain further as requested. I need a template document that has variables that change per page like a mail merge(&lt;a href=&quot;https://en.wikipedia.org/wiki/Mail_merge&quot;&gt;https://en.wikipedia.org/wiki/Mail_merge&lt;/a&gt;). My use case is not to print these so that is not needed. This is actually for automating the creation of 100's of router configs. Thanks again for all the replies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;hostname &lt;code&gt;hostname-variable&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;username &lt;code&gt;username-variable&lt;/code&gt; password 0 &lt;code&gt;password-variable&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;no service pad&lt;/p&gt;&#xA;&#xA;&lt;p&gt;service timestamps debug datetime msec&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so on...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In Microsoft word you reference a excel spreadsheet for the variables. But I would be fine to reference the data in other ways. CSV, table, etc.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Hostname-variable |username-variable | password-variable |&#xA;|-------------------+------------------+-------------------|&#xA;| Hostname1         |Username1         | password1         |&#xA;| Hostname2         |Username2         | password2         |&#xA;| Hostname3         |Username3         | password3         |&#xA;|-------------------+------------------+-------------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;Page 1&quot; would look like this:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;hostname &lt;code&gt;Hostname1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;username &lt;code&gt;Username1&lt;/code&gt; password 0 &lt;code&gt;password1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;no service pad&lt;/p&gt;&#xA;&#xA;&lt;p&gt;service timestamps debug datetime msec&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so on...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&quot;Page 2&quot; would look like this&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;hostname &lt;code&gt;Hostname2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;username &lt;code&gt;Username2&lt;/code&gt; password 0 &lt;code&gt;password2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;no service pad&lt;/p&gt;&#xA;&#xA;&lt;p&gt;service timestamps debug datetime msec&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so on...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&quot;Page 3&quot; would look like this&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;hostname &lt;code&gt;Hostname3&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;username &lt;code&gt;Username3&lt;/code&gt; password 0 &lt;code&gt;password3&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;no service pad&lt;/p&gt;&#xA;&#xA;&lt;p&gt;service timestamps debug datetime msec&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so on...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;" OwnerUserId="10285" LastEditorUserId="10285" LastEditDate="2015-11-28T20:51:29.700" LastActivityDate="2015-12-01T19:35:41.113" Title="How would you do a mail merge?" Tags="|org-mode|email|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18459" PostTypeId="2" ParentId="18427" CreationDate="2015-11-27T22:47:46.383" Score="4" Body="&lt;p&gt;&lt;code&gt;(kbd &quot;s-&amp;lt;up&amp;gt;&quot;)&lt;/code&gt; isn't valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The great thing about &lt;code&gt;kbd&lt;/code&gt; is that Emacs will &lt;em&gt;tell you&lt;/em&gt; the argument to pass it, if you ask it using &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt; or &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt;. You never have to guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, Emacs tells me that &lt;code&gt;&quot;&amp;lt;s-up&amp;gt;&quot;&lt;/code&gt; is the correct argument.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-11-27T22:47:46.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18460" PostTypeId="1" CreationDate="2015-11-28T05:44:23.317" Score="0" ViewCount="36" Body="&lt;p&gt;&lt;code&gt;sct-dot&lt;/code&gt; is convenient for visualizing relationships by graphviz(dot) among functions in programs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/SimpleCallTree&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki: Simple Call Tree&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, since &lt;code&gt;simple-call-tree&lt;/code&gt; has updated from 20150806.1133 to 20151116.802 on melpa, &lt;code&gt;sct-dot&lt;/code&gt; does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the any work arounds?&lt;/p&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="105" LastEditDate="2016-03-14T04:33:56.767" LastActivityDate="2016-03-14T04:33:56.767" Title="sct-dot fails on updated simple-call-tree" Tags="|libraries|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18461" PostTypeId="1" AcceptedAnswerId="18466" CreationDate="2015-11-28T08:09:54.173" Score="6" ViewCount="411" Body="&lt;p&gt;Is it possible to replace regex like query-replace-regex without asking for each matching ?&lt;/p&gt;&#xA;" OwnerUserId="10306" LastEditorUserId="105" LastEditDate="2016-03-14T04:33:27.253" LastActivityDate="2016-03-14T04:33:27.253" Title="Regexp replace without interaction" Tags="|regular-expressions|query-replace|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18464" PostTypeId="1" CreationDate="2015-11-28T13:06:28.773" Score="0" ViewCount="26" Body="&lt;p&gt;I used to launch yasnippet just with c-mode with a hook in my .emacs but after adding some code to use CEDET and ECB yasnippet doesn't run automatically. I guess some modes may have been overwritten by CEDET, so how do I launch yasnippet mode automatically on c-mode now ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(yas-reload-all)&#xA;(add-hook 'c-mode-hook (lambda ()&#xA;                     (#'yas-minor-mode)))&#xA;(global-ede-mode 1)  ; Enable the Project   management system                                        &#xA;(semantic-mode 1)&#xA;(require 'semantic/bovine/gcc)&#xA;(require 'semantic/sb)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't understood the full CEDET configuration process so I may have done something wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="10306" LastActivityDate="2015-11-28T13:06:28.773" Title="Yasnippet with CEDET" Tags="|yasnippet|cedet|config|" AnswerCount="0" CommentCount="3" ClosedDate="2015-11-30T08:41:07.757" ContentLicense="CC BY-SA 3.0" />
  <row Id="18465" PostTypeId="2" ParentId="16802" CreationDate="2015-11-28T17:56:54.110" Score="1" Body="&lt;p&gt;Modifying &lt;code&gt;frame-set-background-mode&lt;/code&gt; (as suggested in @wasamasa's answer) isn't necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You only need to override Emacs' detection of the frame color.  In my case, since I like the color scheme when Emacs thinks I have a light-colored frame but I actually have a dark-colored frame, all I need to do is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-background-mode 'light)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More here: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Faces.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Faces.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tricking Emacs in this way can lead to bad effects: black-on-black text for example.&lt;/p&gt;&#xA;" OwnerUserId="9589" LastActivityDate="2015-11-28T17:56:54.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18466" PostTypeId="2" ParentId="18461" CreationDate="2015-11-28T18:55:59.803" Score="7" Body="&lt;p&gt;Use &lt;code&gt;replace-regexp&lt;/code&gt; (note the absence of the &lt;code&gt;query-&lt;/code&gt; prefix).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But also, note the &lt;code&gt;!&lt;/code&gt; keybinding when running &lt;code&gt;query-replace-regexp&lt;/code&gt;. It will replace all occurences beyond point without further questions.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2015-11-28T18:55:59.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18467" PostTypeId="2" ParentId="13965" CreationDate="2015-11-28T19:34:10.693" Score="2" Body="&lt;p&gt;You probably have the coding system set to a fixed value.  E.g. by using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq coding-system-for-read 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your .emacs file.  Setting this variable overrides the settings for individual files and lines like &lt;code&gt;-*- coding: iso-2022-jp-unix; -*-&lt;/code&gt; get ignored.  In my installation this skrewed up the generation of the autoloads for auctex during installation and resulted in the same scan error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test if this problem applies to you: locate were the elpa archives are extracted and open then file elpa/auctex-11.89/tex-jp.el.  If &lt;code&gt;buffer-buffer-file-coding-system&lt;/code&gt; is not set to &lt;code&gt;iso-2022-jp-unix&lt;/code&gt;, then this is the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is to &lt;em&gt;not&lt;/em&gt; set &lt;code&gt;coding-system-for-read&lt;/code&gt; globally.  See &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_encoding_decoding_faq.html&quot; rel=&quot;nofollow&quot;&gt;http://ergoemacs.org/emacs/emacs_encoding_decoding_faq.html&lt;/a&gt; for how to set the default coding system properly. &lt;/p&gt;&#xA;" OwnerUserId="7089" LastActivityDate="2015-11-28T19:34:10.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18468" PostTypeId="1" CreationDate="2015-11-28T20:01:24.557" Score="0" ViewCount="224" Body="&lt;p&gt;I'm looking for an extension of emacs that automaticaly generate headers from source like C code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made a script for this in the past using awk. I put my source path and it generate a header with all the function prototypes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have look for something similar directly in emacs but when I search for &quot;automatic header&quot; it lead me to auto-insert or header2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that ECB has a window for methods, is there a way to put it in a header automatically ?  Or maybe another extension to do that task ?&lt;/p&gt;&#xA;" OwnerUserId="10306" LastActivityDate="2015-12-29T00:52:23.547" Title="Automatic headers" Tags="|cedet|file-header|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18469" PostTypeId="1" CreationDate="2015-11-28T21:04:40.857" Score="1" ViewCount="92" Body="&lt;p&gt;I want to use autoinsert with C and headers, the code from &lt;a href=&quot;http://www.emacswiki.org/emacs/AutoInsertMode&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/AutoInsertMode&lt;/a&gt;&#xA;works well so I made my own template for header in an elisp funtion, but the insertion repeat to time, asking me twice, it results in :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**                                                                                                                    &#xA; * test.h -- test                                                                                                      &#xA; *                                                                                                                    &#xA; * Written on Saturday, 28 November 2015.                                                                            &#xA;*/                                                                                                                  &#xA;&#xA;#ifndef TEST_H                                                                                                         &#xA;#define TEST_H                                                                                                         &#xA;&#xA;int main()                                                                                                             &#xA;{                                                                                                                      &#xA;  /**                                                                                                                  &#xA;   * test.h --                                                                                                           &#xA;   *                                                                                                                    &#xA;   * Written on Saturday, 28 November 2015.                                                                            &#xA;   */                                                                                                                  &#xA;&#xA;   #ifndef TEST_H                                                                                                      &#xA;   #define TEST_H                                                                                                      &#xA;&#xA;   int main()                                                                                                           &#xA;   {                                                                                                                    &#xA;&#xA;   }                                                                                                                    &#xA;&#xA;  #endif                                                                                                               &#xA;}                                                                                                                      &#xA;#endif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10306" LastEditorUserId="97" LastEditDate="2015-11-28T23:06:30.827" LastActivityDate="2015-11-28T23:06:30.827" Title="Autoinsert inserts template twice" Tags="|auto-insert|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18470" PostTypeId="1" CreationDate="2015-11-28T21:13:00.360" Score="0" ViewCount="1178" Body="&lt;p&gt;I installed Emacs for Python (&lt;a href=&quot;https://github.com/gabrielelanaro/emacs-for-python&quot; rel=&quot;nofollow noreferrer&quot;&gt;from this github repo&lt;/a&gt;) on my Emacs 24.5.1. When I start an IPython shell, auto-complete with tab doesn't work. Instead, the tab key just insert four spaces. But if I press Enter leaving those spaces, the auto-complete suggestions appear in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [6]: import numpy as np&#xA;&#xA;In [7]: x = np.arr&#xA;&#xA;np.array         np.array_equal   np.array_repr    np.array_str&#xA;np.array2string  np.array_equiv   np.array_split&#xA;&#xA;np.array         np.array_equal   np.array_repr    np.array_str&#xA;np.array2string  np.array_equiv   np.array_split&#xA;&#xA;In [8]: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;x = np.arr&lt;/code&gt;, I pressed tab twice before Enter, and then all suggestions appeared at once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I press &lt;code&gt;M-/&lt;/code&gt;, Emacs tries to auto-complete the name, but it doesn't show me all options. In the example above, I would have to press it many times to cicle through all available completions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.emacs&lt;/code&gt; file is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;/home/erickrf/.emacs.d/emacs-for-python/epy-init.el&quot;)&#xA;(epy-setup-ipython)&#xA;&#xA;;; disable auto parenthesis completion&#xA;(setq skeleton-pair nil)&#xA;&#xA;(put 'erase-buffer 'disabled nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/19972936/no-tab-completion-for-ipython-in-emacs-textmode&quot;&gt;This&lt;/a&gt; is a similar problem. I tried the solution in the accepted answer, but it didn't work for me. Whenever I pressed tab, Emacs would show the error message &lt;code&gt;Symbol's value as variable is void: python-shell-completion-complete-or-indent&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10210" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-11-28T21:13:00.360" Title="Auto complete with tab not working in IPython" Tags="|auto-complete-mode|ipython|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18471" PostTypeId="2" ParentId="18458" CreationDate="2015-11-28T21:40:20.863" Score="4" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Create a Named Table&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: my-data&#xA;| Hostname-variable |username-variable | password-variable |&#xA;|-------------------+------------------+-------------------|&#xA;| Hostname1         |Username1         | password1         |&#xA;| Hostname2         |Username2         | password2         |&#xA;| Hostname3         |Username3         | password3         |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Create Template Code Block, e.g. ruby&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For this example, I chose ruby but &lt;strong&gt;ruby is not required&lt;/strong&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I encourage you to &lt;strong&gt;use your favorite language&lt;/strong&gt; to write the template.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: simple-template-ruby&#xA;#+BEGIN_SRC ruby :var data=my-data() :results replace   &#xA;  data.map{|d| &#xA;  template = &amp;lt;&amp;lt;-MYFORM&#xA;    hostname #{d[0]}&#xA;&#xA;    !&#xA;&#xA;    username #{d[1]} password 0 #{d[2]}&#xA;&#xA;    !&#xA;&#xA;    no service pad&#xA;&#xA;    service timestamps debug datetime msec&#xA;&#xA;&#xA;  MYFORM&#xA;&#xA;  template&#xA;&#xA;  }.join(&quot;\n&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Execute the Code Block using &lt;code&gt;C-c&lt;/code&gt; &lt;code&gt;C-C&lt;/code&gt; inside the code block or on inline &lt;code&gt;#+CALL:&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: Mail-Merge-Results&#xA;#+CALL: simple-template-ruby()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Below are the Mail Merge Results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS: Mail-Merge-Results&#xA;hostname Hostname1&#xA;&#xA;!&#xA;&#xA;username Username1 password 0 password1&#xA;&#xA;!&#xA;&#xA;no service pad&#xA;&#xA;service timestamps debug datetime msec&#xA;&#xA;&#xA;&#xA;hostname Hostname2&#xA;&#xA;!&#xA;&#xA;username Username2 password 0 password2&#xA;&#xA;!&#xA;&#xA;no service pad&#xA;&#xA;service timestamps debug datetime msec&#xA;&#xA;&#xA;&#xA;hostname Hostname3&#xA;&#xA;!&#xA;&#xA;username Username3 password 0 password3&#xA;&#xA;!&#xA;&#xA;no service pad&#xA;&#xA;service timestamps debug datetime msec&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code was tested using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&#xA; of 2014-12-25&#xA;&#xA;org-mode version: 8.3.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Below are the additional steps required to generate separate files, e.g. Hostname1.txt, Hostname2.txt and Hostname3.txt&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Add Escaped Code Block to Template&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Notice commas &lt;code&gt;,&lt;/code&gt; are used to escape the org-mode syntax inside the template&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;,#+begin_src&lt;/code&gt; and &lt;code&gt;,#+end_src&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Note that &lt;code&gt;sh&lt;/code&gt; is used in this example but this could be any configured language, e.g. &lt;code&gt;ruby&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Prevent accidental execution by adding &lt;code&gt;:eval never&lt;/code&gt; to escaped code block.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set file name using &lt;code&gt;:tangle #{d[0]}.txt&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Below is the updated code block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: tangled-template-ruby&#xA;#+BEGIN_SRC ruby :var data=my-data() :results replace   &#xA;  data.map{|d| &#xA;  template = &amp;lt;&amp;lt;-MYFORM&#xA;&#xA;  ,#+begin_src sh :eval never :tangle #{d[0]}.txt &#xA;    hostname #{d[0]}&#xA;&#xA;    !&#xA;&#xA;    username #{d[1]} password 0 #{d[2]}&#xA;&#xA;    !&#xA;&#xA;    no service pad&#xA;&#xA;    service timestamps debug datetime msec&#xA;  ,#+end_src&#xA;&#xA;  MYFORM&#xA;&#xA;  template&#xA;&#xA;  }.join(&quot;\n&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Add &lt;code&gt;:results drawer replace&lt;/code&gt; headers to inline&lt;code&gt;#+CALL:&lt;/code&gt; statement&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: Mail-Merge-Results-into-Files&#xA;#+CALL: tangled-template-ruby() :results drawer replace &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use &lt;code&gt;C-c&lt;/code&gt; &lt;code&gt;C-c&lt;/code&gt; on inline&lt;code&gt;#+CALL:&lt;/code&gt; statement to generate &lt;code&gt;results&lt;/code&gt; inside a &lt;code&gt;drawer&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS: Mail-Merge-Results-into-Files&#xA;:RESULTS:&#xA;&#xA;#+begin_src sh :eval never :tangle Hostname1.txt &#xA;  hostname Hostname1&#xA;&#xA;  !&#xA;&#xA;  username Username1 password 0 password1&#xA;&#xA;  !&#xA;&#xA;  no service pad&#xA;&#xA;  service timestamps debug datetime msec&#xA;#+end_src&#xA;&#xA;&#xA;&#xA;#+begin_src sh :eval never :tangle Hostname2.txt &#xA;  hostname Hostname2&#xA;&#xA;  !&#xA;&#xA;  username Username2 password 0 password2&#xA;&#xA;  !&#xA;&#xA;  no service pad&#xA;&#xA;  service timestamps debug datetime msec&#xA;#+end_src&#xA;&#xA;&#xA;&#xA;#+begin_src sh :eval never :tangle Hostname3.txt &#xA;  hostname Hostname3&#xA;&#xA;  !&#xA;&#xA;  username Username3 password 0 password3&#xA;&#xA;  !&#xA;&#xA;  no service pad&#xA;&#xA;  service timestamps debug datetime msec&#xA;#+end_src&#xA;&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use &lt;code&gt;C-c&lt;/code&gt; &lt;code&gt;C-v&lt;/code&gt; &lt;code&gt;t&lt;/code&gt; to &lt;code&gt;tangle&lt;/code&gt; the new code blocks into the separate files&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You should see a message similar too this&lt;br&gt;&#xA;  &lt;code&gt;Tangled 3 code blocks from your-file.org&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Additional code was tested using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.4.1 (x86_64-unknown-cygwin)&#xA; of 2014-11-14&#xA;&#xA;org-mode version: 8.2.10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2015-12-01T19:35:41.113" LastActivityDate="2015-12-01T19:35:41.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18472" PostTypeId="1" AcceptedAnswerId="18475" CreationDate="2015-11-28T23:27:38.327" Score="2" ViewCount="93" Body="&lt;p&gt;I would like &lt;code&gt;magit-diff&lt;/code&gt; and &lt;code&gt;magit-status&lt;/code&gt; to always take up the entire frame. I am trying to do this using the &lt;code&gt;fullframe&lt;/code&gt; package, and have configured things according to the documentation using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fullframe magit-status magit-mode-quit-window)&#xA;(fullframe magit-diff magit-mode-quit-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This configuration works if I use &lt;code&gt;M-x magit-status/magit-diff&lt;/code&gt;. But if &lt;code&gt;magit-status&lt;/code&gt; gets called from certain contexts, say if I access &lt;code&gt;magit-status&lt;/code&gt; from the &lt;code&gt;helm-projectile&lt;/code&gt; menu (&lt;code&gt;M-g&lt;/code&gt; for me), or if I access &lt;code&gt;magit-diff&lt;/code&gt; from &lt;code&gt;magit-status&lt;/code&gt; by hitting return on e.g., staged/unstaged changes, neither is in fullframe - and this is a problem, because this is how I usually access these modes...Any suggestions as to how to configure things so that the specified commands trigger &lt;code&gt;fullframe&lt;/code&gt; regardless of how they are called? Or is it the case that different functions are actually being called when &lt;code&gt;magit-status&lt;/code&gt; and &lt;code&gt;magit-diff&lt;/code&gt; are called in different context? I am not sure what's going on exactly...Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-11-29T02:46:02.867" Title="magit-diff and magit-status not opening in fullframe in some contexts" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18473" PostTypeId="2" ParentId="18468" CreationDate="2015-11-29T00:41:04.597" Score="1" Body="&lt;p&gt;Try library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/header2.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;header2.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;. It is simple but useful. You can tweak it for your own needs and for particular languages.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-11-29T00:41:04.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18474" PostTypeId="2" ParentId="18444" CreationDate="2015-11-29T01:00:01.387" Score="5" Body="&lt;p&gt;Maybe this will clear up some of the confusion:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Your function &lt;code&gt;initilize&lt;/code&gt; does not initialize variable &lt;code&gt;example&lt;/code&gt;.  It sets it to a particular cons cell - the same cons cell each time it is called. The first time &lt;code&gt;initilize&lt;/code&gt; is called, the &lt;code&gt;setq&lt;/code&gt; assigns &lt;code&gt;example&lt;/code&gt; to a new cons cell, which is the result of evaluating &lt;code&gt;'(3)&lt;/code&gt;. Subsequent calls to &lt;code&gt;initilize&lt;/code&gt; just reassign &lt;code&gt;example&lt;/code&gt; to the same cons cell.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since &lt;code&gt;initilize&lt;/code&gt; just reassigns the same cons cell to &lt;code&gt;example&lt;/code&gt;, &lt;code&gt;modify&lt;/code&gt; just sets the car of that same cons cell to &lt;code&gt;2&lt;/code&gt; each time it is called.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To initialize a list, use &lt;code&gt;list&lt;/code&gt; or &lt;code&gt;cons&lt;/code&gt; (or an equivalent backquote sexp, such as &lt;code&gt;`(,(+ 2 1))&lt;/code&gt; or &lt;code&gt;`(,3)&lt;/code&gt;). For example, use &lt;strong&gt;&lt;code&gt;(list 3)&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The key to understanding this is to know that a quoted cons cell is evaluated only once, and thereafter the same cons cell is returned.  This is not necessarily the way that all Lisps behave, but it is how Emacs Lisp behaves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, the behavior of evaluating a quoted mutable object is implementation dependent, if not language dependent.  In Common Lisp, for example, I'm pretty sure that there is nothing in the definition (spec) of the language that defines the behavior in this regard - it is left up to the implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Do not expect '(some list) to be eq to '(some list) - ever.There is generally &lt;em&gt;no guarantee&lt;/em&gt; in Lisp that code that visibly quotes a list returns new list structure each time.  In some Lisp implementations it might, or it might some of the time.  In others, it never does.  Your code should anyway not depend on any such behavior from the implementation.  If you want new list structure, use &lt;code&gt;list&lt;/code&gt; or &lt;code&gt;cons&lt;/code&gt; or equivalent.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-29T06:03:25.787" LastActivityDate="2015-11-29T06:03:25.787" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18475" PostTypeId="2" ParentId="18472" CreationDate="2015-11-29T02:40:33.597" Score="1" Body="&lt;p&gt;I did some digging through the different &lt;code&gt;magit&lt;/code&gt; commands, and have found that there are indeed a number of different commands for different contexts. For now, the following seems to cover all my current use cases, but I expect I will be adding more to the list in the future:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fullframe projectile-vc magit-mode-quit-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is called when I activate magit from &lt;code&gt;helm-projectile&lt;/code&gt;, and the rest are for &lt;code&gt;magit-diff&lt;/code&gt; in various context (the names should be self-explanitory, and there are more - you can use &lt;code&gt;M-x magit-diff-&lt;/code&gt; and look through all the available options/completions).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fullframe magit-diff-staged magit-quit-window)&#xA;(fullframe magit-diff-unstaged magit-mode-quit-window)&#xA;(fullframe magit-diff magit-mode-quit-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-11-29T02:46:02.867" LastActivityDate="2015-11-29T02:46:02.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18476" PostTypeId="2" ParentId="18386" CreationDate="2015-11-29T02:54:27.267" Score="4" Body="&lt;p&gt;Here is a working example that uses &lt;code&gt;org-element&lt;/code&gt; API to parse the buffer headings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* la1&#xA;** la2&#xA;*** la3&#xA;*** la4&#xA;** la5&#xA;**  Org element API test&#xA;&#xA;#+name: lista&#xA;#+begin_src elisp&#xA;  (org-element-map (org-element-parse-buffer 'headline )&#xA;      'headline&#xA;    (lambda(hl)&#xA;      (let ((parent (org-element-property :parent hl )))&#xA;        (and (eq (org-element-type parent) 'headline)&#xA;             (list (org-element-property :title parent) (org-element-property :title hl))))))&#xA;&#xA;#+end_src&#xA;&#xA;#+RESULTS: lista&#xA;| la1 | la2                  |&#xA;| la2 | la3                  |&#xA;| la2 | la4                  |&#xA;| la1 | la5                  |&#xA;| la1 | Org element API test |&#xA;&#xA;#+name: make-dot&#xA;#+BEGIN_SRC emacs-lisp :var table=lista :results output :exports none&#xA;  (mapcar #'(lambda (x)&#xA;                (princ (format &quot;\&quot;%s\&quot; -&amp;gt; \&quot;%s\&quot;;\n&quot; (first x) (second x))))&#xA;          table)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: make-dot&#xA;: &quot;la1&quot; -&amp;gt; &quot;la2&quot;;&#xA;: &quot;la2&quot; -&amp;gt; &quot;la3&quot;;&#xA;: &quot;la2&quot; -&amp;gt; &quot;la4&quot;;&#xA;: &quot;la1&quot; -&amp;gt; &quot;la5&quot;;&#xA;: &quot;la1&quot; -&amp;gt; &quot;Org element API test&quot;;&#xA;&#xA;#+BEGIN_SRC dot :file dependencias.pdf :cmdline -Tpdf :var input=make-dot :exports results&#xA;digraph {&#xA;   rankdir=TB;&#xA;   splines=true;&#xA;   node [shape=box];&#xA;   $input&#xA;  }&#xA;#+END_SRC&#xA;&#xA;#+CAPTION: Dependency diagram&#xA;#+RESULTS:&#xA;[[file:dependencias.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works in several steps: first an elisp block uses &lt;code&gt;org-element-parse-buffer&lt;/code&gt; to get all headlines, and extract a list of parent's title and headline title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then another source block transforms this list into dot syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third dot source block contains the DOT wrapping and includes the generated relations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cosmetic enhancements: filter out the section for the test itself; you could add a tag to this section and filter out by tag in the first block.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-11-29T02:54:27.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18477" PostTypeId="2" ParentId="15109" CreationDate="2015-11-29T04:24:28.077" Score="5" Body="&lt;p&gt;You need to modify the variable, &lt;code&gt;org-show-context-detail&lt;/code&gt;. &lt;code&gt;C-h v org-show-context-detail&lt;/code&gt; will offer you &lt;em&gt;quite&lt;/em&gt; a lot of documentation about the values this variable can take; the pertinent information is that it's an alist of &lt;code&gt;(context-symbol . visibility-symbol)&lt;/code&gt;. You probably want to set it in your &lt;code&gt;init.el&lt;/code&gt; / &lt;code&gt;.emacs.d&lt;/code&gt; / other-config-file like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(tags-tree . local) org-show-context-detail)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tags-tree&lt;/code&gt; is the context symbol for sparse trees (used also for todo statuses); &lt;code&gt;local&lt;/code&gt; will show you &lt;code&gt;current headline, entry, and next headline&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2015-11-29T04:24:28.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18478" PostTypeId="1" CreationDate="2015-11-29T04:56:17.637" Score="5" ViewCount="1096" Body="&lt;p&gt;I want to use org-mode's sparse trees to export &lt;em&gt;some&lt;/em&gt; of the headings in a document. Specifically, I want headlines and entries for all matches of a tag search, plus parents. &lt;code&gt;org-show-context-detail&lt;/code&gt; controls this, but doesn't have quite the right setting. &lt;code&gt;local&lt;/code&gt; is closest, &lt;em&gt;but&lt;/em&gt; &lt;code&gt;local&lt;/code&gt; also includes the &lt;em&gt;next heading&lt;/em&gt; at the same level of match; I do not want next heading. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;  :PROPERTIES:&#xA;  :EXPORT: yes&#xA;  :END:&#xA;&#xA;  * Subheading&#xA;    :PROPERTIES:&#xA;    :EXPORT: yes&#xA;    :END:&#xA;&#xA;    I am some content! I should be exported and visible!&#xA;&#xA;&#xA;  * Definitely Don't Want This Subheading&#xA;    :PROPERTIES:&#xA;    :EXPORT: NO&#xA;    :END&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how do I make and export a sparse tree using an &lt;code&gt;EXPORT=yes&lt;/code&gt; tag search, containing &lt;code&gt;Heading&lt;/code&gt;, &lt;code&gt;Subheading&lt;/code&gt;, and the entry of &lt;code&gt;Subheading&lt;/code&gt;, &lt;em&gt;without including the next heading&lt;/em&gt;? (Note: I do know about &lt;code&gt;C-v&lt;/code&gt; in the org export dispatcher -- but it will still include a visible-but-folded headline, like &lt;code&gt;Definitely Don't Want This Subheading&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2017-05-08T19:12:10.127" Title="Modifying Sparse Trees and Exporting in Org Mode" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18479" PostTypeId="1" AcceptedAnswerId="18481" CreationDate="2015-11-29T10:28:15.853" Score="5" ViewCount="627" Body="&lt;p&gt;How can I print a message for a period of time to the mode line and restore the default format afterwards?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="105" LastEditDate="2015-11-29T14:21:38.503" LastActivityDate="2015-11-29T14:34:14.533" Title="Temporarily show a message in the modeline?" Tags="|mode-line|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18480" PostTypeId="1" CreationDate="2015-11-29T13:17:42.367" Score="8" ViewCount="6298" Body="&lt;p&gt;I run emacs 24.5 and word/line wrap works fine when I write new text. However, when I reopen an org file, the text is not wrapped. This makes it hard to read text I have written before. Is there a setting or something that I can change to fix this?&lt;/p&gt;&#xA;" OwnerUserId="6822" LastActivityDate="2015-11-29T15:49:44.077" Title="Wrap line/text in org-mode when I re-open a file" Tags="|org-mode|spacemacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18481" PostTypeId="2" ParentId="18479" CreationDate="2015-11-29T14:19:19.547" Score="2" Body="&lt;p&gt;Temporarily change &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Top.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;mode-line-format&lt;/code&gt;&lt;/a&gt; or any of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Variables.html&quot; rel=&quot;nofollow&quot;&gt;its constituent variables&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html&quot; rel=&quot;nofollow&quot;&gt;Mode Line Format&lt;/a&gt; and its subnodes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example (taken from &lt;a href=&quot;http://www.emacswiki.org/emacs/download/icicles-mode.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-show-in-mode-line&lt;/code&gt;&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-show-in-mode-line (text &amp;amp;optional buffer delay)&#xA;  &quot;Display TEXT in BUFFER's mode line.&#xA;The text is shown for DELAY seconds (default 2), or until a user event.&#xA;So call this last in a sequence of user-visible actions.&quot;&#xA;  (message nil) ; Remove any current msg&#xA;  (with-current-buffer (or buffer  (current-buffer))&#xA;    (make-local-variable 'mode-line-format) ; Needed for Emacs 21+.&#xA;    (let ((mode-line-format  text))&#xA;      (force-mode-line-update) (sit-for (or delay  2)))&#xA;    (force-mode-line-update)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-11-29T14:24:54.500" LastActivityDate="2015-11-29T14:24:54.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18482" PostTypeId="2" ParentId="18479" CreationDate="2015-11-29T14:34:14.533" Score="3" Body="&lt;p&gt;You can save the current value of &lt;code&gt;mode-line-format&lt;/code&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Format.html#Mode-Line-Format&quot; rel=&quot;nofollow&quot;&gt;(elisp manual)&lt;/a&gt; before changing it, then use a timer &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Timers.html#Timers&quot; rel=&quot;nofollow&quot;&gt;(manual)&lt;/a&gt; to set it back to the saved value.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun temporary-mode-line (text time)&#xA;  &quot;Display TEXT in mode line for TIME seconds.&quot;&#xA;  (let ((old mode-line-format)&#xA;    (buf (current-buffer)))&#xA;    (setq mode-line-format text)&#xA;    (run-at-time time nil&#xA;            (lambda (v b)&#xA;              (with-current-buffer b&#xA;                (setq mode-line-format v)&#xA;                (force-mode-line-update)))&#xA;            old buf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-29T14:34:14.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18483" PostTypeId="2" ParentId="18480" CreationDate="2015-11-29T15:49:44.077" Score="11" Body="&lt;p&gt;You can set the variable &lt;a href=&quot;http://orgmode.org/worg/doc.html#org-startup-truncated&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-startup-truncated&lt;/code&gt;&lt;/a&gt;. Its documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil means entering Org-mode will set ‘truncate-lines’. This is&#xA;  useful since some lines containing links can be very long and&#xA;  uninteresting.  Also tables look terrible when wrapped.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So if we don't want to truncate lines, we need to set it to nil:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-startup-truncated nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After this, lines will wrap. However, this is &lt;em&gt;soft&lt;/em&gt; wrapping; it doesn't insert newlines into the text, just shows the text as though it wraps. This is probably what you want; newlines in titles won't really work for other things in org.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2015-11-29T15:49:44.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18484" PostTypeId="1" AcceptedAnswerId="18502" CreationDate="2015-11-29T16:20:34.100" Score="6" ViewCount="2835" Body="&lt;p&gt;I'd like to remove certain elements from the mode-line:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/yHOPp.png&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yHOPp.png&quot; alt=&quot;modeline&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the left, the &lt;code&gt;802&lt;/code&gt; is the buffer size in bytes, if I'm not mistaken. I could not care less about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the right, it tells me the buffer uses unix linebreaks, and I have no idea what the &lt;code&gt;2.2.3&lt;/code&gt; is, but it doesn't go away when toggling the &quot;new version&quot; element via &lt;code&gt;SPC t m V&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd also like to remove the rightmost buffer progress indicator, and replace it with an &lt;code&gt;x/y&lt;/code&gt; element in the point position field.&lt;/p&gt;&#xA;" OwnerUserId="3945" LastActivityDate="2016-07-28T00:49:27.810" Title="How to remove elements from the spacemacs mode-line" Tags="|mode-line|spacemacs|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18485" PostTypeId="1" CreationDate="2015-11-29T18:45:04.093" Score="10" ViewCount="275" Body="&lt;p&gt;I currently try to figure out, how I can handle some lines specifically without messing up the indentation of the rest of the buffer. Consider the following function &lt;code&gt;MyFunc&lt;/code&gt; as an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void MyFunc()&#xA;{&#xA;  unsigned y = 0;&#xA;&#xA;DONOTINDENT;&#xA;&#xA;  unsigned int x = 5 + 2;&#xA;  return x + 12;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, I want the line &lt;code&gt;DONOTINDENT;&lt;/code&gt; to be indented to column 0, whereas the rest of the function should be indented normally. I tried to solve this using the following custom &lt;code&gt;c-special-indent-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-c-mode-indent-hook ()&#xA;  (let (p1 p2 myline)&#xA;    (setq p1 (line-beginning-position))&#xA;    (setq p2 (line-end-position))&#xA;    (setq myLine (buffer-substring-no-properties p1 p2))&#xA;&#xA;    (if (string-match-p &quot;DONOTINDENT&quot; myLine)&#xA;        (save-excursion&#xA;          (indent-line-to 0))&#xA;      )&#xA;    )&#xA;  )&#xA;&#xA;(defun my-c-mode-common-hook ()&#xA;  ;; my customizations for all of c-mode and related modes&#xA;  (setq c-special-indent-hook 'my-c-mode-indent-hook)&#xA;  )&#xA;&#xA;(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OK, this works quite fine for the line &lt;code&gt;DONOTINDENT;&lt;/code&gt;, however it does not work for all the subsequent lines, as these are indented relative to &lt;code&gt;DONOTINDENT;&lt;/code&gt;. So, if &lt;code&gt;DONOTINDENT;&lt;/code&gt; is indented to column 0, &lt;code&gt;unsigned int x = 5 + 2;&lt;/code&gt; will be indented to column 0, too, but it should be indented to column &lt;code&gt;c-basic-offset&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix up the indentation for the following lines? Is there some internal variable that I can use to influence the computation of the indent-level of the subsequent lines, or is this computation purely based on the preceding indentation. I think, it should be possible to somehow accomplish this as labels in switch-case-statements are indented in a similar way, but I struggled to figure this out when digging into the cc-mode code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards,&#xA;Fabian  &lt;/p&gt;&#xA;" OwnerUserId="10324" LastActivityDate="2024-04-04T20:08:20.933" Title="Custom indentation for specific lines?" Tags="|indentation|cc-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18487" PostTypeId="1" AcceptedAnswerId="18519" CreationDate="2015-11-29T19:42:02.833" Score="8" ViewCount="2083" Body="&lt;p&gt;When I do something inside Emacs, with the buffer &lt;code&gt;*Messages*&lt;/code&gt; you get some idea what happened. But it's only if that function is echoing a message for the minibuffer. Then &lt;code&gt;*Messages*&lt;/code&gt; keeps a record of messages that are echoed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I remember there was a buffer where all commands were listed that are executed. But I cannot find it back in the Emacs documentation. It displayed also functions that are not echoing any message at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do anyone know about which function I'm talking?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-11-30T08:16:04.610" LastActivityDate="2015-12-01T08:26:34.650" Title="How to see which functions are executed" Tags="|commands|history|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18488" PostTypeId="1" AcceptedAnswerId="18490" CreationDate="2015-11-29T20:38:32.280" Score="10" ViewCount="1315" Body="&lt;p&gt;I run Emacs in the daemon mode as a user's systemd unit. However it won't read my environment variables. How to make it import my .bashrc first?&lt;br&gt;&#xA;I have multiple paths added in there and want to be able to use them in Emacs (but I don't want to maintain both .bashrc and .emacs by adding them to exec-path).&lt;/p&gt;&#xA;" OwnerUserId="2245" LastEditorUserId="2245" LastEditDate="2015-11-29T21:52:59.210" LastActivityDate="2015-12-02T02:15:55.180" Title="How to make emacs running in daemon mode read my bashrc before start?" Tags="|emacs-daemon|system-environment|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18489" PostTypeId="2" ParentId="18487" CreationDate="2015-11-29T22:11:22.313" Score="8" Body="&lt;p&gt;&lt;code&gt;view-lossage&lt;/code&gt; will show the last few hundred keystrokes. There's also &lt;a href=&quot;https://github.com/lewang/command-log-mode&quot;&gt;&lt;code&gt;command-log-mode&lt;/code&gt;&lt;/a&gt; which records the keystrokes and the command it executed.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-11-29T22:11:22.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18490" PostTypeId="2" ParentId="18488" CreationDate="2015-11-29T22:31:02.200" Score="10" Body="&lt;p&gt;You're probably looking for the package exec-path-from-shell. Once it's installed, put this in your .emacs: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(exec-path-from-shell-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for emacs to read .bashrc on startup. That way  you won't have to maintain paths in two places.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-11-29T22:31:02.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18492" PostTypeId="1" AcceptedAnswerId="18498" CreationDate="2015-11-29T22:39:36.283" Score="2" ViewCount="1122" Body="&lt;p&gt;I'm a newbie in Emacs configuration, I've just discovered the possibility to define my own key bindings to fit my needs. It is really cool, but Emacs has so many key bindings that some default key bindings often overlap mine.&lt;/p&gt;&#xA;&lt;p&gt;For example, I would like to have proper keys window splitting and navigation, and I like do this with arrows.&lt;/p&gt;&#xA;&lt;p&gt;This is what I may like :&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;;; Wind-split                                                                                                                                                                                                                                  &#xA;(global-set-key (kbd &amp;quot;C-x &amp;lt;C-down&amp;gt;&amp;quot;) 'split-window-below)&#xA;(global-set-key (kbd &amp;quot;C-x &amp;lt;C-left&amp;gt;&amp;quot;) 'split-window-right)&#xA;(global-set-key (kbd &amp;quot;C-x &amp;lt;C-up&amp;gt;&amp;quot;) 'find-file-other-window)&#xA;(global-set-key (kbd &amp;quot;C-x &amp;lt;C-right&amp;gt;&amp;quot;) 'switch-to-buffer-other-window)&#xA;;; Wind-move                                                                                                                                                                                                                                   &#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;left&amp;gt;&amp;quot;) 'windmove-left)&#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;down&amp;gt;&amp;quot;) 'windmove-down)&#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;up&amp;gt;&amp;quot;) 'windmove-up)&#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;right&amp;gt;&amp;quot;) 'windmove-right)&#xA;;; Wind-resize                                                                                                                                                                                                                                 &#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;C-up&amp;gt;&amp;quot;) 'enlarge-window)&#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;C-down&amp;gt;&amp;quot;) 'shrink-window)&#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;C-right&amp;gt;&amp;quot;) 'enlarge-window-horizontally)&#xA;(global-set-key (kbd &amp;quot;C-c &amp;lt;C-left&amp;gt;&amp;quot;) 'shrink-window-horizontally)&#xA;(global-set-key (kbd &amp;quot;C-c =&amp;quot;) 'balance-windows)&#xA;;; Wind-arranging                                                                                                                                                                                                                              &#xA;(global-set-key (kbd &amp;quot;C-c C-d&amp;quot;) 'delete-window)&#xA;(global-set-key (kbd &amp;quot;C-c C-c C-d&amp;quot;) 'kill-buffer-and-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You'll probably notice that I have used &lt;code&gt;C-c&lt;/code&gt; a lot and it's normal that it's overlapped since &lt;code&gt;C-c&lt;/code&gt; is traditionally used in modes, but &lt;code&gt;C-x&lt;/code&gt; seems less accessible and I other characters are often used for other commands.&lt;/p&gt;&#xA;&lt;p&gt;So what easy key bindings to use for these basic operations ?&lt;/p&gt;&#xA;" OwnerUserId="10306" LastEditorUserId="105" LastEditDate="2021-12-19T23:58:33.273" LastActivityDate="2021-12-19T23:58:33.273" Title="Too many key bindings" Tags="|key-bindings|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="18493" PostTypeId="2" ParentId="18492" CreationDate="2015-11-29T22:56:50.640" Score="0" Body="&lt;p&gt;If you don't want to have to define everything yourself, and would rather enjoy an Emacs experience (including packages and key bindings) that has been curated by a knowledgeable Emacs user, consider using something like &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow&quot;&gt;Emacs Prelude&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you'd like a good way to be able to check which key sequences have already been used, I recommend the &lt;a href=&quot;https://github.com/emacs-helm/helm-descbinds&quot; rel=&quot;nofollow&quot;&gt;helm-descbinds&lt;/a&gt; package. It presents the information in a nice way, and you can search for particular key sequences using regex.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2015-11-29T22:56:50.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18494" PostTypeId="1" AcceptedAnswerId="18497" CreationDate="2015-11-29T23:03:55.617" Score="7" ViewCount="1566" Body="&lt;p&gt;I would like to start a different background color beginning from a function to the end. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LMyzf.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LMyzf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware you can define background colors from some faces like function and function names like &lt;code&gt;foobar&lt;/code&gt;. But it affects only the background color of the words &lt;code&gt;function&lt;/code&gt; and &lt;code&gt;foobar&lt;/code&gt;. I would like to change the background color of the whole line where the function stats and end with it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why, you would ask? &#xA;It would make it a lot easier for me to distinct which parts belongs to a funcion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm wondering if there is a pratical way to manage this in Emacs, of there is a Lisp package to achieve something like that?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-11-30T08:16:42.240" LastActivityDate="2015-12-05T00:50:15.323" Title="Change the background color of specific block?" Tags="|colors|coloring|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18495" PostTypeId="1" CreationDate="2015-11-29T23:26:10.753" Score="1" ViewCount="469" Body="&lt;p&gt;I'm using &lt;code&gt;request&lt;/code&gt; to grab a json file (here's one for instance: &lt;a href=&quot;http://gd2.mlb.com/components/game/mlb/year_2015/month_06/day_10/grid.json&quot; rel=&quot;nofollow&quot;&gt;http://gd2.mlb.com/components/game/mlb/year_2015/month_06/day_10/grid.json&lt;/a&gt;) and trying to read the data. I'm interesting in looping through &lt;code&gt;games&lt;/code&gt; and look at the score for each game. The hierarchy goes a little something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data&#xA;    games&#xA;        game&#xA;            home_score&#xA;            away_score&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the following code together that grabs the file for a given date&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &quot;Download the grid json file for the given YEAR, MONTH and DAY.&quot;                                                                          &#xA;  (interactive)                                                                                                                             &#xA;  (let ((file-url (format &quot;http://gd2.mlb.com/components/game/mlb/%s/grid.json&quot; (mlb/format-date year month day)))                          &#xA;        (file-tmp (concat temporary-file-directory (format &quot;mlb-%04d-%02d-%02d.json&quot; year month day))))                                     &#xA;    (request file-url                                                                                                                       &#xA;             :parser (lambda ()                                                                                                             &#xA;                       (let ((json-object-type 'alist))                                                                                     &#xA;                         (json-read)))                                                                                                      &#xA;             :success (function*                                                                                                            &#xA;                       (lambda (&amp;amp;key data &amp;amp;allow-other-keys)                                                                                &#xA;                         (let* (                                                                                                            &#xA;                                (game (elt (assoc-default 'data data) 0))                                                                   &#xA;                                (a (assoc-default 'game game))                                                                              &#xA;                                )                                                                                                           &#xA;                           (message &quot;%s&quot; a)                                                                                                 &#xA;                           )                                                                                                                &#xA;&#xA;                         ))                                                                                                                 &#xA;             :status-code                                                                                                                   &#xA;             '((400 . (lambda (&amp;amp;rest _) (message &quot;Got 400.&quot;)))                                                                              &#xA;               (418 . (lambda (&amp;amp;rest _) (message &quot;Got 418.&quot;))))                                                                             &#xA;             :complete                                                                                                                      &#xA;             )                                                                                                                              &#xA;    )                                                                                                                                       &#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Along with this quick function to format the date to be used in the URL:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mlb/format-date (year month day)                                                                                                     &#xA;  &quot;Formats the given YEAR, MONTH and DAY as a path on mlb.com.&quot;                                                                             &#xA;  (let* ((a (format &quot;year_%04d/month_%02d/day_%02d&quot; year month day)))                                                                       &#xA;    a)                                                                                                                                      &#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When evaluating this for a given date, it'll output something like this in the message buffer (truncated):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[((away_code . phi) (tbd_flag . N) (group . MLB) (calendar_event_id . 14-414537-2015-06-10) (home_team_id . 113) (event_time . 12:35 PM) (a\&#xA;way_file_code . phi) (home_file_code . cin) (venue . Great American Ball Park) (away_name_abbrev . PHI) (game_pk . 414537) (inning . 9) (aw\&#xA;ay_score . 2) (home_code . cin) (status . Final) (home_score . 5) (away_team_id . 143) (gameday_sw . P) (venue_id . 2602) (ind . F) (home_t\&#xA;eam_name . Reds) (top_inning . Y) (media_state . media_archive) (home_name_abbrev . CIN) (id . 2015/06/10/phimlb-cinmlb-1) (away_team_name \&#xA;. Phillies) (double_header_sw . N) (game_nbr . 1) (game_media (homebase (media . [((type . mlbtv_away) (display . CSP-HD) (state . MEDIA_AR\&#xA;CHIVE) (playback_scenario . HTTP_CLOUD_WIRED) (free . NO) (combined_media_state . MEDIA_ARCHIVE) (blackout . ) (id . 135111383)) ((type . m\&#xA;lbtv_away) (display . CSP-HD) (state . MEDIA_ARCHIVE) (playback_scenario . HTTP_CLOUD_WIRED_ADS) (free . NO) (combined_media_state . MEDIA_\&#xA;ARCHIVE) (blackout . ) (id . 135111383)) ((type . mlbtv_away) (display . CSP-HD) (state . MEDIA_ARCHIVE) (playback_scenario . HTTP_CLOUD_WI\&#xA;RED_IRDETO) (free . NO) (combined_media_state . MEDIA_ARCHIVE) (blackout . ) (id . 135111383)) ((type . mlbtv_away) (display . CSP-HD) (sta\&#xA;te . MEDIA_ARCHIVE) (playback_scenario . HTTP_CLOUD_WIRED_WEB) (free . NO) (combined_media_state . MEDIA_ARCHIVE) (blackout . ) (id . 13511\&#xA;1383)) ((type . mlbtv_away) (display . CSP-HD) (state . MEDIA_ARCHIVE) (playback_scenario . FMS_CLOUD) (free . NO) (combined_media_state . \&#xA;MEDIA_ARCHIVE) (blackout . ) (id . 135111383))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm looking for the best way to loop through this mess and extra the fields I'm interested in at this point. Could anyone provide any tips?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10329" LastActivityDate="2015-11-29T23:26:10.753" Title="Parsing nested json" Tags="|json|http|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18496" PostTypeId="2" ParentId="18492" CreationDate="2015-11-29T23:49:02.627" Score="10" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;All &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;letter&gt;&lt;/kbd&gt; key sequences (for any lower or upper-case letter: [a-zA-Z]) and the function keys &lt;kbd&gt;&amp;lt;f5&gt;&lt;/kbd&gt; through &lt;kbd&gt;&amp;lt;f9&gt;&lt;/kbd&gt; are reserved for personal use, so you can always safely use those. (It's considered a bug if any third-party library uses these key sequences.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Key Binding Conventions&lt;/code&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider using the easiest-to-type instances as &lt;em&gt;prefix&lt;/em&gt; bindings, as everything you put under such a prefix will still be pretty easy to type.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs&quot;&gt;https://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs&lt;/a&gt; provides a working solution to the general problem of giving your custom bindings priority over (most) other keymaps.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Be wary of just merrily clobbering all the defaults. You can still do it if you want to (some people remap almost everything, to get an entirely customised interface), but you might regret overriding what you once thought were useless bindings, only to one day realise that you've clobbered a really standard binding used by lots of modes which you now want to use :)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;While it might be information overload, I highly recommend the excellent write-up at &lt;a href=&quot;https://www.masteringemacs.org/article/mastering-key-bindings-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.masteringemacs.org/article/mastering-key-bindings-emacs&lt;/a&gt; so that you have an idea of the different layers of keymaps at work in Emacs, and how they are prioritised.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If your keyboard has convenient extra keys (&quot;Windows&quot; key, &quot;Menu&quot; key, etc) and you can tell your OS to treat them as modifiers which Emacs understands ('super', 'hyper', etc) then you gain a vast array of key sequences which have no default bindings at all.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also find &lt;code&gt;C-z&lt;/code&gt; a convenient prefix. It's not a prefix by default, but the following code turns it into one. You still have access to its default binding (just by typing it twice), but you can then also add anything else you want to that prefix.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-z&quot;)) ; suspend-frame&#xA;(global-set-key (kbd &quot;C-z C-z&quot;) 'suspend-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-11-30T22:08:31.300" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18497" PostTypeId="2" ParentId="18494" CreationDate="2015-11-29T23:56:04.020" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;Highlight&lt;/a&gt; to highlight a region using an overlay or text properties -- in particular, property &lt;code&gt;face&lt;/code&gt;.  To highlight the background, use a face that uses attribute &lt;code&gt;background&lt;/code&gt; but not &lt;code&gt;foreground&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use text property &lt;code&gt;face&lt;/code&gt; then you can also copy properties from some text and paste them to other text. So if your definition changes and becomes larger you can just copy some of the highlighted part and then paste its property &lt;code&gt;face&lt;/code&gt; to the unhighlighted part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also use the functions defined in the library to do automatically (e.g. as a buffer-change hook or periodically, on a timer) extend the highlighting of a defun to accommodate changes to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use an overlay then you can use the highlight-erasing commands (e.g., &lt;code&gt;hlt-eraser&lt;/code&gt;) to remove only the last face you highlighted with. Drag the mouse over text where you want to remove the highlighting.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You could use ordinary font-locking. Add a pattern to &lt;code&gt;font-lock-keywords&lt;/code&gt; that uses a function that recognizes the start and end of your definition.  See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Customizing-Keywords.html&quot; rel=&quot;nofollow&quot;&gt;Customizing Keywords&lt;/a&gt; as well as the parent node, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Mode.html&quot; rel=&quot;nofollow&quot;&gt;Font-Lock Mode&lt;/a&gt; and its other children.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE after your comment&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think maybe you are asking about highlighting not the region but the &lt;strong&gt;&lt;em&gt;lines&lt;/em&gt;&lt;/strong&gt; touched by the region, and extending highlighting past the end of text (including past any whitespace chars). Is that it?  If so, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun hlt-highlight-lines (start end face msgp)&#xA;  &quot;Highlight full lines in region, window-wide.&quot;&#xA;  (interactive (list (save-excursion (goto-char (region-beginning))&#xA;                                     (line-beginning-position))&#xA;                     (save-excursion (goto-char (region-end))&#xA;                                     (line-beginning-position 2))&#xA;                     nil&#xA;                     t))&#xA;  (hlt-highlight-region start end face msgp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-05T00:50:15.323" LastActivityDate="2015-12-05T00:50:15.323" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18498" PostTypeId="2" ParentId="18492" CreationDate="2015-11-30T00:00:22.623" Score="6" Body="&lt;p&gt;One way to deal with this is to make your own prefix key and assign your personal bindings to that.  You can use any key, but most of the &lt;code&gt;C-&amp;lt;key&amp;gt;&lt;/code&gt; bindings are taken, so you have to search for an empty one or find one you don't care about to clobber.  I like using &lt;code&gt;C-'&lt;/code&gt; as a prefix.  If it's bound to anything by default, it isn't anything I've ever missed.  It's also very easy to press, especially if you make your caps locks key a second ctl (then the finger movements on each hand are symmetric).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make a prefix you first need to make a keymap to hold your bindings with &lt;code&gt;define-prefix-command&lt;/code&gt;, then assign a key to it and finally you can start assigning functions to keys.  I'm using &lt;code&gt;define-key&lt;/code&gt; below, but &lt;code&gt;global-set-key&lt;/code&gt; will work fine as well.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'my-prefix-map)&#xA;(define-key global-map (kbd &quot;C-'&quot;) 'my-prefix-map)&#xA;&#xA;(define-key my-prefix-map (kbd &quot;&amp;lt;C-down&amp;gt;&quot;) 'split-window-below)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As some other comments have mentioned, there can be issues with wholesale changing the default key bindings.  For example, you'll have problems using Emacs if your configuration isn't loaded (because, for example, you're debugging your &lt;code&gt;.emacs&lt;/code&gt;).  And it can become difficult to explain how to Emacs to other people, who aren't using your configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, there are a lot of keybindings and they aren't all (or even mostly) obvious.  A package like &lt;a href=&quot;https://github.com/kai2nenobu/guide-key&quot;&gt;which-key&lt;/a&gt;  can help you learn them.  You'll naturally learn the ones you actually use over time and then can start changing the ones you don't care for or adding keys for the functions you use that aren't bound by default&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2015-11-30T01:46:45.190" LastActivityDate="2015-11-30T01:46:45.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18499" PostTypeId="1" AcceptedAnswerId="18511" CreationDate="2015-11-30T04:09:27.710" Score="6" ViewCount="902" Body="&lt;p&gt;It's easy to make whole words bold, italic etc. by using the asterisk/slash before and after the word. It's imperative however to also have a space in front of the opener markup, and after the closer markup. In other words, this easy (to use and easy to read) way of marking text is limited to start and end with space boundaries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using org-mode with languages that don't use spaces (Japanese, Chinese, etc.), adding a space just to make a word bold in those languages will make the formatting look quite ugly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For html-export I could do the following, but that's neither handy, nor easy on the eye when looking at the org source.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abc@@html:&amp;lt;b&amp;gt;@@def@@html:&amp;lt;/b&amp;gt;ghi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does org-mode provide a better option?&lt;/p&gt;&#xA;" OwnerUserId="3951" LastEditorUserId="3951" LastEditDate="2015-11-30T04:25:44.423" LastActivityDate="2015-11-30T20:46:23.160" Title="Mark up only part of a word" Tags="|org-mode|markup|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18500" PostTypeId="2" ParentId="17022" CreationDate="2015-11-30T08:35:21.713" Score="1" Body="&lt;p&gt;Another option for this is &lt;a href=&quot;http://clang.llvm.org/docs/ClangFormat.html&quot; rel=&quot;nofollow&quot;&gt;clang-format&lt;/a&gt;. There's even a Melpa plugin for using it: &lt;a href=&quot;https://melpa.org/#/clang-format&quot; rel=&quot;nofollow&quot;&gt;clang-format&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I bind &lt;code&gt;C-c f&lt;/code&gt; to &lt;code&gt;clang-format-region&lt;/code&gt; to fix the coding style for the currently selected region:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c f&quot;) 'clang-format-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2015-11-30T08:35:21.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18501" PostTypeId="2" ParentId="17863" CreationDate="2015-11-30T10:25:29.053" Score="8" Body="&lt;p&gt;This project is a good alternative: &lt;a href=&quot;https://github.com/m2ym/yascroll-el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/m2ym/yascroll-el&lt;/a&gt; because it works with and without GUI.&#xA;Don't forget the cl require in your .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl) ;; build-in librairie&#xA;(require 'yascroll)&#xA;(global-yascroll-bar-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-11-30T10:25:29.053" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18502" PostTypeId="2" ParentId="18484" CreationDate="2015-11-30T14:14:49.657" Score="7" Body="&lt;p&gt;The Spacemacs mode-line is provided by the &lt;a href=&quot;https://github.com/TheBB/spaceline&quot;&gt;Spaceline&lt;/a&gt; package.&#xA;The answer for your question is found in the README, under the &lt;a href=&quot;https://github.com/TheBB/spaceline#turning-segments-on-and-off&quot;&gt;Turning segments on and off&lt;/a&gt; section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To toggle off the buffer size, add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spaceline-toggle-buffer-size-off)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what displays the &lt;code&gt;2.2.3&lt;/code&gt;, though it might be from the &lt;code&gt;perspective.el&lt;/code&gt; package. If it's not, there's also a list of all segments under the same section, so you can try them one by one until it works. Then you add the correct &lt;code&gt;(spaceline-toggle-&amp;lt;segment-name&amp;gt;-off)&lt;/code&gt; to your mode-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About replacing a segment, I'm not sure what's the best way. You probably need to remove the segment and define your own segment via &lt;code&gt;spaceline-define-segment&lt;/code&gt;, which is also explained in the README.&#xA;To add your segment to the mode-line, the README says to use &lt;code&gt;spaceline-install&lt;/code&gt;, but it requires you to specify the entire mode-line specification. If that's not what you want, you can try modifying the variables &lt;code&gt;spaceline-left&lt;/code&gt; and &lt;code&gt;spaceline-right&lt;/code&gt;, which are lists of mode-line segments. See their documentation for more (&lt;code&gt;C-h v &amp;lt;variable-name&amp;gt;&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2015-11-30T14:14:49.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18503" PostTypeId="1" AcceptedAnswerId="18505" CreationDate="2015-11-30T15:46:26.163" Score="5" ViewCount="926" Body="&lt;p&gt;So, I have this function, which works just fine for me and does what I want it to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mwp-set-grade ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (while &#xA;        (re-search-forward &quot;- Grade :: \\\(.*\\\)&quot;)&#xA;      (org-set-property &quot;GRADE&quot; (match-string 1))))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, at some point it finds the last match, and then throws a message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;while: Search failed: &quot;- Grade :: \\(.*\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I figure there must be a way to exit gracefully while searching for something in a buffer.  I bet the answer will also help me understand a little more about dealing with errors and failures in elisp, whihc I don't understand well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks as always... &lt;/p&gt;&#xA;" OwnerUserId="10102" LastEditorUserId="105" LastEditDate="2016-03-14T04:32:09.907" LastActivityDate="2016-03-14T04:32:09.907" Title="Gracefully Exiting a While Loop" Tags="|search|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18504" PostTypeId="1" CreationDate="2015-11-30T16:02:12.330" Score="0" ViewCount="494" Body="&lt;p&gt;I want gnus to remove all html tags from incoming mails, displaying only the text. How do I do that?&lt;/p&gt;&#xA;" OwnerUserId="10335" LastEditorUserId="105" LastEditDate="2015-11-30T18:23:42.173" LastActivityDate="2015-12-16T15:31:42.167" Title="Gnus: How to strip all html tags from incoming mails" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18505" PostTypeId="2" ParentId="18503" CreationDate="2015-11-30T16:14:02.537" Score="9" Body="&lt;p&gt;&lt;code&gt;re-search-forward&lt;/code&gt; has an option for not causing an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(re-search-forward REGEXP &amp;amp;optional BOUND NOERROR COUNT)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should call &lt;code&gt;(re-search-forward &quot;...&quot; nil t)&lt;/code&gt; and your while will receive a nil value when no match found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Jordon notes in the comments, there is a more general way of ignoring errors, which is the &lt;code&gt;ignore-errors&lt;/code&gt; macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while (ignore-errors (re-search-forward &quot;...&quot;)) body )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="53" LastEditorUserId="53" LastEditDate="2015-11-30T18:59:43.420" LastActivityDate="2015-11-30T18:59:43.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18507" PostTypeId="1" AcceptedAnswerId="18509" CreationDate="2015-11-30T16:32:30.560" Score="5" ViewCount="1081" Body="&lt;p&gt;I am using the railwaycat brew install version of emacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;24.5.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following alias in my &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;alias edit=&quot;emacsclient -a '' -nw&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have &lt;code&gt;$EDITOR&lt;/code&gt; set to the same command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;edit&lt;/code&gt; in a terminal before I open the gui version, it starts a daemon in the background, and opens emacs in the terminal, which is what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I run the GUI version of emacs first, and then type &lt;code&gt;edit&lt;/code&gt; in the terminal, it opens a new frame, which is NOT what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get it to always open the terminal version in the terminal?&lt;/p&gt;&#xA;" OwnerUserId="9590" LastActivityDate="2016-03-22T22:09:57.440" Title="OS X and Daemon Mode" Tags="|osx|daemon|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18508" PostTypeId="1" AcceptedAnswerId="19616" CreationDate="2015-11-30T19:26:19.187" Score="1" ViewCount="239" Body="&lt;p&gt;For some time now (a month or so, I reckon), I get a strange error message after running the &lt;code&gt;paradox-upgrade-packages&lt;/code&gt; command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Contacting host: raw.githubusercontent.com:443&#xA;Importing package-keyring.gpg...done&#xA;Contacting host: melpa.org:80 [2 times]&#xA;Contacting host: marmalade-repo.org:80 [2 times]&#xA;gnutls.c: [0] (Emacs) fatal error: The TLS connection was non-properly terminated.&#xA;Contacting host: orgmode.org:80&#xA;Contacting host: elpa.gnu.org:80 [2 times]&#xA;paradox--github-parse-response-code: Tried contacting Github, but I can't understand the result.  See *Paradox Github* buffer for the full result&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;paradox&lt;/code&gt; config is this one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ------------------ paradox -----------------------&#xA;(use-package paradox&#xA;  :ensure t&#xA;  :bind ((&quot;C-x C-u&quot; . paradox-upgrade-packages))&#xA;  :config&#xA;  (setq paradox-execute-asynchronously t&#xA;    paradox-github-token &quot;[private]&quot;&#xA;    paradox-automatically-star t&#xA;    )&#xA;  :commands&#xA;  (paradox-upgrade-packages paradox-list-packages)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is exactly the same config I have in my Macbook Pro machine, with no problems at all. However, in my Xubuntu 15.10 machine (with GNU Emacs 24.5.1) I get the said error message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2016-02-16T23:48:53.323" Title="Paradox problem: &quot;Tried contacting Github, but I can't understand the result.&quot;" Tags="|package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18509" PostTypeId="2" ParentId="18507" CreationDate="2015-11-30T19:51:27.573" Score="8" Body="&lt;p&gt;This behaviour is actually a &lt;em&gt;known and documented&lt;/em&gt; limitation of this port, see &lt;a href=&quot;https://github.com/railwaycat/mirror-emacs-mac/blob/master/README-mac#L212&quot; rel=&quot;nofollow&quot;&gt;README-mac&lt;/a&gt; (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;The Mac port doesn't support multi-tty with GUI&lt;/strong&gt;.  The developer has no&#xA;  idea how to detach Emacs as a GUI application from Window Server or&#xA;  Dock without separating a GUI process (not thread) from the main Emacs&#xA;  (Lisp evaluator) process.  TTY-only multi-tty is supposed to work.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, it's impossible to attach a client TTY frame to a server running in a GUI frame.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can run two different server instances, though, one for the GUI and another for TTY, by setting &lt;code&gt;server-name&lt;/code&gt; accordingly, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq server-name &quot;gui-server&quot;)&#xA;(server-start)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You have to explicitly give the socket file name to &lt;code&gt;emacsclient&lt;/code&gt; now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -f &quot;$TMPDIR/emacs-$(id -i)/gui-server …&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both instances will not be able to share any state at all, though, and they'll potentially override each other's state and history in &lt;code&gt;~/.emacs.d&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, both have separate buffer lists, undo history, save place history, etc., the instance which exists lasts wins for all files in &lt;code&gt;~/.emacs.d&lt;/code&gt; (i.e. save place history, minibuffer history, projectile project list, etc.) unless you give each data file a unique name, and if you save custom variables in one instance and then in the other, the values from the first instance are lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is really not made two run independently in two long-running separate interactive instances.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Finally, please don't refer to it as “railwaycat” port.  This variant of Emacs is actually maintained by Yamamoto Mitsuharu; the Github account &lt;a href=&quot;https://github.com/railwaycat&quot; rel=&quot;nofollow&quot;&gt;railwaycat&lt;/a&gt; just maintains the Homebrew formula and keeps a &lt;a href=&quot;https://github.com/railwaycat/mirror-emacs-mac/&quot; rel=&quot;nofollow&quot;&gt;Git mirror&lt;/a&gt;.  “railwaycat port” doesn't really give proper attribution.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2016-03-22T22:09:57.440" LastActivityDate="2016-03-22T22:09:57.440" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18510" PostTypeId="1" AcceptedAnswerId="18518" CreationDate="2015-11-30T20:30:21.870" Score="8" ViewCount="6529" Body="&lt;p&gt;Looking at the keybindings here &lt;a href=&quot;http://orgmode.org/guide/Structure-editing.html#Structure-editing&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/guide/Structure-editing.html#Structure-editing&lt;/a&gt;, it asks us to use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-S-&amp;lt;RET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to add a TODO at the same level. What does the S here mean? I have tried shift and capital S, neither have worked.&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2015-12-01T09:17:32.343" Title="What does S mean in emacs keybinding notation (org-mode)" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="5" ClosedDate="2019-02-11T18:23:51.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="18511" PostTypeId="2" ParentId="18499" CreationDate="2015-11-30T20:46:23.160" Score="8" Body="&lt;p&gt;One possibility would be to use Unicode Character 'ZERO WIDTH SPACE'&#xA;(U+200B).  You need to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;bind a key for inserting this character,&lt;/li&gt;&#xA;&lt;li&gt;add it to &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt; (don't forget to &lt;code&gt;M-x&#xA;org-reload&lt;/code&gt; for it to take effect).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-zero-width-space ()&#xA;  (interactive)&#xA;  (insert-char #x200b))&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-*&quot;) 'insert-zero-width-space)&#xA;&#xA;(setq org-emphasis-regexp-components&#xA;      '(&quot;   ('\&quot;{\x200B&quot; &quot;-     .,:!?;'\&quot;)}\\[\x200B&quot; &quot;     &#xA;,\&quot;'&quot; &quot;.&quot; 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can define more sophisticated bindings: make &lt;code&gt;*&lt;/code&gt; (and &lt;code&gt;/&lt;/code&gt; etc)&#xA;insert &lt;code&gt;\x200B*&lt;/code&gt; or &lt;code&gt;*\x200B&lt;/code&gt; depending on the previous &lt;code&gt;*&lt;/code&gt; in the&#xA;buffer being followed or preceded by &lt;code&gt;\x200B&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you don't want this &lt;code&gt;\x200B&lt;/code&gt; character to appear in the&#xA;exported output, you can remove it with an export filter:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-filter-remove-u200b (text backend info)&#xA;  &quot;Remove zero width space character (U+200B) from TEXT.&quot;&#xA;  (replace-regexp-in-string &quot;\x200B&quot; &quot;&quot; text))&#xA;&#xA;(add-to-list 'org-export-filter-plain-text-functions&#xA;         'my-filter-remove-u200b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This applies to all backends.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2015-11-30T20:46:23.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18513" PostTypeId="1" CreationDate="2015-11-30T23:25:57.503" Score="4" ViewCount="1145" Body="&lt;p&gt;When the cursor in eww is over a link, how can I follow it? Right now I copy it with 'w', and run eww again, which is kind of cumbersome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the same venue, if I access the bookmarks with 'B', how can I follow it, without copying and pasting after running M-x eww?&lt;/p&gt;&#xA;" OwnerUserId="10339" LastActivityDate="2017-02-25T12:28:17.900" Title="Navigation in eww, following links, bookmarks" Tags="|emacs24.4|eww|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18514" PostTypeId="1" AcceptedAnswerId="18525" CreationDate="2015-11-30T23:33:50.660" Score="24" ViewCount="6943" Body="&lt;p&gt;I'm interested on having each of my commits signed with my GPG key. Since I use magit for interfacing with git, I was wondering if telling magit to sign each commit was possible (or some workaround to achieve this was feasible, at least).&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-12-01T13:25:30.937" Title="How to automatically sign commits with magit?" Tags="|magit|git|security|gpg|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18515" PostTypeId="2" ParentId="7653" CreationDate="2015-11-30T23:41:26.737" Score="8" Body="&lt;p&gt;A simple solution that I've adopted from my shell scripts is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun internet-up-p (&amp;amp;optional host)&#xA;    (= 0 (call-process &quot;ping&quot; nil nil nil &quot;-c&quot; &quot;1&quot; &quot;-W&quot; &quot;1&quot; &#xA;                       (if host host &quot;www.google.com&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can test this in the &lt;code&gt;*scratch*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message (if (internet-up-p) &quot;Up&quot; &quot;Down&quot;))&#xA;&quot;Up&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10340" LastEditorUserId="1979" LastEditDate="2019-06-27T14:12:45.390" LastActivityDate="2019-06-27T14:12:45.390" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="18516" PostTypeId="2" ParentId="7653" CreationDate="2015-12-01T00:18:35.240" Score="2" Body="&lt;p&gt;On a modern Linux system with DBus and NetworkManager:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun nm-is-connected()&#xA;  (equal 70 (dbus-get-property&#xA;             :system &quot;org.freedesktop.NetworkManager&quot; &quot;/org/freedesktop/NetworkManager&quot;&#xA;             &quot;org.freedesktop.NetworkManager&quot; &quot;State&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-12-01T00:18:35.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18517" PostTypeId="1" CreationDate="2015-12-01T00:56:52.007" Score="1" ViewCount="63" Body="&lt;p&gt;In 24.3, I have this in my .emacs, and it works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(electric-pair-mode 1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq electric-pair-pairs '(    (?\&quot; . ?\&quot;) (?\{ . ?\}) (?\( . ?\)    ) )&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally I use this in org-mode. All of them worked in 24.3, but only {}, and [] works in 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The new version is loading the same .emacs.&lt;/p&gt;&#xA;" OwnerUserId="10339" LastEditorUserId="105" LastEditDate="2015-12-01T03:54:00.963" LastActivityDate="2015-12-01T03:54:00.963" Title="Electric pairs, working in Emacs 24.3, but not in 24.4" Tags="|emacs24.4|electric-pair-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18518" PostTypeId="2" ParentId="18510" CreationDate="2015-12-01T04:15:05.423" Score="5" Body="&lt;p&gt;The &quot;S&quot; means &quot;shift&quot;. Since you're using a terminal, you can't type a keyboard shortcut that uses shift unless the shift is modifying a letter (if the shortcut were C-S-j, Emacs would see C-J and know it was the same thing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use Emacs outside of your terminal instead, where it has a wider set of capabilities.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="2277" LastEditDate="2015-12-01T09:17:32.343" LastActivityDate="2015-12-01T09:17:32.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18519" PostTypeId="2" ParentId="18487" CreationDate="2015-12-01T08:26:34.650" Score="5" Body="&lt;p&gt;This project is also a good alternative:&#xA;&lt;a href=&quot;https://github.com/michael-heerdegen/interaction-log.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/michael-heerdegen/interaction-log.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-12-01T08:26:34.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18520" PostTypeId="2" ParentId="9571" CreationDate="2015-12-01T10:31:49.133" Score="1" Body="&lt;p&gt;I've had the same problem with Prelude.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason was that &lt;code&gt;whitespace-style&lt;/code&gt; has the value &lt;code&gt;(face tabs empty trailing lines-tail)&lt;/code&gt;. It is set in &lt;code&gt;.emacs.d/core/prelude-editor.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What whitespace-mode highlights seems to be governed by the value of &lt;code&gt;whitespace-display-mappings&lt;/code&gt;, which was &lt;code&gt;((space-mark 32 [183] [46]) (space-mark 160 [164] [95]) (newline-mark 10 [36 10]) (tab-mark 9 [187 9] [92 9]))&lt;/code&gt; on my machine. The documentation of this variable contains the note: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Used when whitespace-style includes tab-mark, space-mark or&#xA;  newline-mark.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which is not the case with an out-of-the-box prelude.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix it add these line to your configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'whitespace-style 'space-mark)&#xA;(add-to-list 'whitespace-style 'tab-mark)&#xA;(add-to-list 'whitespace-style 'newline-mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluate it and restart whitespace mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(BTW, I assume this is not a bug in Prelude. Their strategy seems to be to highlight only whitespace errors with color. See &lt;a href=&quot;https://github.com/bbatsov/prelude/issues/249&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="10344" LastEditorUserId="10344" LastEditDate="2015-12-01T10:40:20.833" LastActivityDate="2015-12-01T10:40:20.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18521" PostTypeId="2" ParentId="14006" CreationDate="2015-12-01T10:35:52.583" Score="1" Body="&lt;p&gt;As phils already said in the comments &lt;code&gt;whitespace-style&lt;/code&gt; needs to include &lt;code&gt;space-mark&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See my answer &lt;a href=&quot;https://emacs.stackexchange.com/a/18520/10344&quot;&gt;here&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="10344" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-01T10:35:52.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18522" PostTypeId="2" ParentId="18304" CreationDate="2015-12-01T11:50:16.633" Score="2" Body="&lt;p&gt;suppose you use company-mode and you only want to use it in text-mode. org-mode inherits from text-mode, so you don't need setup for both:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;&#xA;(defun text-mode-hook-setup ()&#xA;  ;; make `company-backends' local is critcal&#xA;  ;; or else, you will have completion in every major mode, that's very annoying!&#xA;  (make-local-variable 'company-backends)&#xA;&#xA;  ;; company-ispell is the plugin to complete words&#xA;  (add-to-list 'company-backends 'company-ispell)&#xA;&#xA;  ;; OPTIONAL, if `company-ispell-dictionary' is nil, `ispell-complete-word-dict' is used&#xA;  ;;  but I prefer hard code the dictionary path. That's more portable.&#xA;  (setq company-ispell-dictionary (file-truename &quot;~/.emacs.d/misc/english-words.txt&quot;)))&#xA;&#xA;(add-hook 'text-mode-hook 'text-mode-hook-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;english-words.txt&quot; is just a plain text file where lines sorted alphabetically. Every line is a word. (Plain text dictionary is required by &lt;code&gt;ispell&lt;/code&gt;, see &lt;a href=&quot;https://emacs.stackexchange.com/a/42526/&quot;&gt;https://emacs.stackexchange.com/a/42526/&lt;/a&gt; for technical details).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample file: &lt;a href=&quot;https://github.com/redguardtoo/emacs.d/raw/master/misc/english-words.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/raw/master/misc/english-words.txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tested with Emacs24.3, 24.4, company-mode 0.8.12&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2018-07-11T09:20:25.073" LastActivityDate="2018-07-11T09:20:25.073" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18524" PostTypeId="2" ParentId="18514" CreationDate="2015-12-01T13:13:20.717" Score="24" Body="&lt;p&gt;Try this in your &lt;code&gt;$HOME/.gitconfig&lt;/code&gt; or your &lt;code&gt;.git/config&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[user]&#xA;    email = YourEmail&#xA;    name = YourName&#xA;    signingkey = XXXXXXXX&#xA;[commit]&#xA;    gpgsign = true&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then just commit as usual.&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2015-12-01T13:13:20.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18525" PostTypeId="2" ParentId="18514" CreationDate="2015-12-01T13:25:30.937" Score="36" Body="&lt;p&gt;In Magit commits are created using the committing popup (&lt;kbd&gt;c&lt;/kbd&gt;). That popup would therefore be a good place to start looking for gpg support. If you do that, then you will find this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=S Sign using gpg (--gpg-sign=)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So type &lt;kbd&gt;= S&lt;/kbd&gt; and the select a key. To avoid having to do that every time you create a commit you can save the value of that argument (and all other currently set arguments) using &lt;kbd&gt;C-x C-s&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might still have to type the passphrase every time. To avoid that you should start a gpg-agent and make sure Emacs knows about it, e.g. using the &lt;code&gt;keychain&lt;/code&gt; shell script and the &lt;code&gt;keychain-environment&lt;/code&gt; Emacs package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see and set the &lt;code&gt;--show-signature&lt;/code&gt; argument in the logging popup.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-12-01T13:25:30.937" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18526" PostTypeId="1" CreationDate="2015-12-01T14:11:37.847" Score="1" ViewCount="2729" Body="&lt;p&gt;I code in C++ using VIM, but would love to try spacemacs.  My install is fresh, no custom configurations yet.  So looking at &lt;code&gt;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/c-c%2B%2B&lt;/code&gt;, a line, &lt;code&gt;(setq-default dotspacemacs-configuration-layers '(c-c++))&lt;/code&gt; needs to be added to &lt;code&gt;.spacemacs&lt;/code&gt;, but where can it be added?  Looking the snippet inside the &lt;code&gt;defun dotspacemacs/layers ()&lt;/code&gt;, there is a comment that user code should not be added to this function, but then there is another section:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-configuration-layers&#xA;'(&#xA; ;; ----------------------------------------------------------------&#xA; ;; Example of useful layers you may want to use right away.&#xA; ;; Uncomment some layer names and press &amp;lt;SPC f e R&amp;gt; (Vim style) or&#xA; ;; &amp;lt;M-m f e R&amp;gt; (Emacs style) to install them.&#xA; ;; ----------------------------------------------------------------&#xA; ;; auto-completion&#xA; ;; better-defaults&#xA; emacs-lisp&#xA; ;; git&#xA; ;; markdown&#xA; ;; org&#xA; ;; (shell :variables&#xA; ;;        shell-default-height 30&#xA; ;;        shell-default-position 'bottom)&#xA; ;; spell-checking&#xA; ;; syntax-checking&#xA; ;; version-control&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so can I assume that I should add the line &lt;code&gt;(setq-default dotspacemacs-configuration-layers '(c-c++))&lt;/code&gt; into the the &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt; block?  Or where should I add the line.  Then what do I do afterwards?&lt;/p&gt;&#xA;" OwnerUserId="10346" LastActivityDate="2015-12-01T16:45:31.787" Title="C++ with spacemacs_" Tags="|spacemacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18527" PostTypeId="2" ParentId="18526" CreationDate="2015-12-01T16:45:31.787" Score="2" Body="&lt;p&gt;The code you've quoted is incomplete; you've chopped off the head of the form. In lisp all expressions are surrounded by parens, and the first element of such a list is the name of a function to call. Although I don't use spacemacs, I imagine that the part you chopped off was &lt;code&gt;(setq&lt;/code&gt; or &lt;code&gt;(setq-default&lt;/code&gt;. This is setting a variable to a value which is a quoted list (quoted lists look like &lt;code&gt;'(foo bar baz)&lt;/code&gt;). It is, in fact, setting the same variable that the documentation on the c++ mode told you to set. You could include both of them in the file, one after the other, but the second would overwrite the changes made by the first. You should instead combine them. Just add &lt;code&gt;c-c++&lt;/code&gt; to the existing list alongside  &lt;code&gt;emacs-lisp&lt;/code&gt; and the commented-out suggestions.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-12-01T16:45:31.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18528" PostTypeId="1" CreationDate="2015-12-01T17:07:55.870" Score="6" ViewCount="634" Body="&lt;p&gt;Is it possible for gnus-demon to be asynchronous and silent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-demon-add-handler 'gnus-demon-scan-news 5 nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And every 5 minutes, emacs gets stuck fetching new stuff. Which is annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;gnus-demon&lt;/code&gt; itself can't do that (and looking at the code, the best I see is the &quot;idle&quot; mode), is there an alternative?&lt;/p&gt;&#xA;" OwnerUserId="88" LastEditorUserId="88" LastEditDate="2015-12-01T17:22:44.573" LastActivityDate="2016-04-12T13:04:52.157" Title="Silent/Asynchronous gnus-demon?" Tags="|gnus|async|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18530" PostTypeId="1" AcceptedAnswerId="18551" CreationDate="2015-12-01T19:27:00.650" Score="4" ViewCount="585" Body="&lt;p&gt;I'd like to catch too big recursive call nesting in elisp, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case nil&#xA;    (potentially-too-recursive-function)&#xA;  (xxx (message &quot;Gave up, using defaults&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the symbol in place of &lt;code&gt;xxx&lt;/code&gt; to catch too deep recursion?&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-06-22T20:39:56.143" LastActivityDate="2016-06-22T20:39:56.143" Title="How to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?" Tags="|error-handling|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18531" PostTypeId="1" AcceptedAnswerId="18538" CreationDate="2015-12-01T20:08:03.470" Score="2" ViewCount="97" Body="&lt;p&gt;When I do this &lt;code&gt;(setq v (f-read-text &quot;s.el&quot;))&lt;/code&gt; where &lt;code&gt;s.el&lt;/code&gt; is of this form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((thing1 . thing2) (thing3 . thing4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get &lt;code&gt;v&lt;/code&gt; back as one long string. And &lt;code&gt;(setq v (append (f-read-text &quot;s.el&quot;)))&lt;/code&gt; doesn't seem to change things to a list. I want to do a &lt;code&gt;push&lt;/code&gt; or &lt;code&gt;add-to-list&lt;/code&gt; an item, but I seem to be adding that item to a list containing a big string. I'd like to return the contents of &lt;code&gt;s.el&lt;/code&gt; as a list and then do the &lt;code&gt;push&lt;/code&gt; or &lt;code&gt;add-to-list&lt;/code&gt;. Then I need to write it back out, again not as a string.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-03-14T04:31:32.890" LastActivityDate="2016-03-14T04:31:32.890" Title="How to add-to-list to read-in file contents" Tags="|list|read|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18532" PostTypeId="2" ParentId="18361" CreationDate="2015-12-01T20:29:13.143" Score="0" Body="&lt;p&gt;solved by upgrading python-mode, guess was a bug on the version I was using&lt;/p&gt;&#xA;" OwnerUserId="684" LastActivityDate="2015-12-01T20:29:13.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18533" PostTypeId="1" CreationDate="2015-12-01T21:02:51.423" Score="5" ViewCount="2533" Body="&lt;p&gt;By default, when using a PC keyboard attached to a Mac, OS X treats presses of the  &lt;code&gt;Insert&lt;/code&gt; key as presses of the &lt;code&gt;Help&lt;/code&gt; key that appears on the extended Mac keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I map that keypress to have the same result in GNU Emacs that it does when running in, say, Windows or Linux: toggling &lt;code&gt;overwrite-mode&lt;/code&gt; on and off?  (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq/Overwrite-mode.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/efaq/Overwrite-mode.html&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a GUI window, Emacs treats &lt;code&gt;Insert&lt;/code&gt; presses as &lt;code&gt;Help&lt;/code&gt; key presses and shows the help, which is logical.  Googling, I can't find anywhere that discusses remapping the &lt;code&gt;Help&lt;/code&gt; key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In OS X's Terminal.app, as far as I can tell, the key presses aren't passed to the terminal itself at all.  At a Bash prompt, &lt;code&gt;Ctrl-v Insert&lt;/code&gt; results in no output.  Pressing another key behaves as if typing &lt;code&gt;Ctrl-v &amp;lt;key&amp;gt;&lt;/code&gt; with no intervening press of &lt;code&gt;Insert&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I've gotten closer.  I think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used Karabiner [1] to map &lt;code&gt;Insert&lt;/code&gt; to something more useful than &lt;code&gt;Help&lt;/code&gt;, since Terminal.app doesn't see &lt;code&gt;Help&lt;/code&gt;.  I picked &lt;code&gt;F13&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] pqrs.org/osx/karabiner/&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;item&amp;gt;&#xA;    &amp;lt;name&amp;gt;Map Insert to F13&amp;lt;/name&amp;gt;&#xA;    &amp;lt;identifier&amp;gt;private.map_insert_to_f13&amp;lt;/identifier&amp;gt;&#xA;    &amp;lt;autogen&amp;gt;__KeyToKey__ KeyCode::PC_INSERT, KeyCode::F13&amp;lt;/autogen&amp;gt;&#xA;&amp;lt;/item&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Ctrl+v Insert&lt;/code&gt; in Bash then shows &lt;code&gt;^[[25~&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking inspiration from &lt;a href=&quot;http://www.emacswiki.org/emacs/LinuxConsoleKeys&quot; rel=&quot;noreferrer&quot;&gt;http://www.emacswiki.org/emacs/LinuxConsoleKeys&lt;/a&gt; I added the following to my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map &quot;\e[25~&quot; [(f13)])&#xA;(define-key key-translation-map (kbd &quot;&amp;lt;f13&amp;gt;&quot;) (kbd &quot;&amp;lt;Insert&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now pressing &lt;code&gt;Insert&lt;/code&gt; once doesn't do anything.  Pressing it twice shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;f1&amp;gt; &amp;lt;Insert&amp;gt; is undefined.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;code&gt;Insert Down&lt;/code&gt; shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;f1&amp;gt; &amp;lt;down&amp;gt; is undefined.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know where to go from here.&lt;/p&gt;&#xA;" OwnerUserId="9589" LastEditorUserId="9589" LastEditDate="2015-12-02T14:51:32.400" LastActivityDate="2018-06-24T07:54:47.407" Title="How to use the Insert key to toggle `overwrite-mode` when using a PC keyboard in OS X?" Tags="|osx|keystrokes|keyboard-layout|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18534" PostTypeId="1" AcceptedAnswerId="18915" CreationDate="2015-12-01T21:10:23.300" Score="5" ViewCount="1788" Body="&lt;p&gt;I'm running Orgmode 8.2.10 on a Mac (El Capitan) and I'm trying to use &lt;code&gt;C-c C-x C-l&lt;/code&gt; to preview some latex formulas. However, using the mentioned shortcut produces the error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Can't find &quot;latex&quot; (needed to convert LaTeX fragments to images)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following on my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:/usr/local/bin/gs:/Library/TeX/texbin/&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I even tried adding &lt;code&gt;:/Library/TeX/texbin/latex&lt;/code&gt;, which is where my &quot;latex&quot; is. &lt;/p&gt;&#xA;" OwnerUserId="9515" LastActivityDate="2016-03-16T10:28:47.693" Title="Orgmode + Mac (el capitan): can't find latex" Tags="|org-mode|latex|preview-latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18535" PostTypeId="1" CreationDate="2015-12-01T21:56:44.507" Score="0" ViewCount="86" Body="&lt;p&gt;Based on &lt;a href=&quot;https://stackoverflow.com/questions/20891095/programatically-insert-text-into-command-that-normally-blocks-event-loop&quot;&gt;this&lt;/a&gt; answer, and its &lt;code&gt;with-initial-minibuffer&lt;/code&gt; function, I am trying to call &lt;code&gt;helm-projectile-grep&lt;/code&gt;, customizing minibuffer pre-filling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to avoid the default behaviour, which is to pre-fill the minibuffer with the contents of the region (if active) or the thing at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun with-initial-minibuffer-projectile-grep (str)&#xA;  (interactive)&#xA;  (funcall `(lambda ()&#xA;              (interactive)&#xA;              (minibuffer-with-setup-hook&#xA;                  (lambda () (insert (format &quot;: %s &quot; ,str)))&#xA;                (call-interactively 'helm-projectile-grep)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I call it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-initial-minibuffer-projectile-grep &quot;mytext&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;things go wrong. Any idea of where to start from ?&lt;/p&gt;&#xA;" OwnerUserId="546" LastActivityDate="2015-12-01T21:56:44.507" Title="Pre fill minibuffer upon calling to helm-projectile function" Tags="|helm|projectile|minibuffer|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18536" PostTypeId="1" CreationDate="2015-12-01T22:32:28.227" Score="2" ViewCount="1643" Body="&lt;p&gt;Emacs 24.3.1, OS: Linux Slackware 14.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my ~/.bash_profile file I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# If on console, change cursor colour according to&#xA;# /usr/src/linux/Documentation/VGA-softcursor.txt&#xA;# Reset using echo -e '\033[?2c'&#xA;if [ $TERM = 'linux' -a $SHELL == '/bin/bash' ] ; then&#xA;    echo -e '\033[?17;0;64c'&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This makes cursor non-blinking and makes it red. When I start Emacs the cursor becomes a blinking dash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Cursor-Display.html&quot; rel=&quot;nofollow&quot;&gt;Displaying the Cursor&lt;/a&gt; chapter I read this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On a text terminal, the cursor’s appearance is controlled by the&#xA;  terminal, largely out of the control of Emacs. Some terminals offer&#xA;  two different cursors: a “visible” static cursor, and a “very visible”&#xA;  blinking cursor. By default, Emacs uses the very visible cursor, and&#xA;  switches to it when you start or resume Emacs. If the variable&#xA;  visible-cursor is nil when Emacs starts or resumes, it uses the normal&#xA;  cursor.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So in ~/.emacs I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq visible-cursor nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And restarted Emacs. But it didn't help: the cursor is still blinking, and when I close Emacs it destroys my previous non-blinking cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to fix?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2021-01-28T16:03:35.873" Title="Can't remove cursor blinking in console mode" Tags="|terminal-emacs|cursor|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18537" PostTypeId="2" ParentId="18273" CreationDate="2015-12-01T23:45:31.470" Score="5" Body="&lt;p&gt;After reading the comments, it appears you're really looking for this: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;org-narrow-to-block&lt;/code&gt; to narrow the buffer to the current block  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Place cursor within the boundary of a block, e.g. quote block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_VERSE&#xA;Verse Block&#xA;#+END_VERSE&#xA;&#xA;#+BEGIN_VERBATIM&#xA;Verbatim Block&#xA;#+END_VERBATIM&#xA;&#xA;#+BEGIN_QUOTE&#xA;Quote Block&#xA;#+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Type &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;n&lt;/kbd&gt; &lt;kbd&gt;b&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buffer will narrow to just the quote block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_QUOTE&#xA;Quote Block&#xA;#+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you want your buffer to look more like &lt;code&gt;org-edit-special&lt;/code&gt;,&lt;br&gt;&#xA;  then type &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;n&lt;/kbd&gt; &lt;kbd&gt;e&lt;/kbd&gt; instead.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The buffer will look similar to the example below:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Quote Block&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;widen&lt;/code&gt; to remove narrowing from current buffer&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Type &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;n&lt;/kbd&gt; &lt;kbd&gt;w&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_VERSE&#xA;Verse Block&#xA;#+END_VERSE&#xA;&#xA;#+BEGIN_VERBATIM&#xA;Verbatim Block&#xA;#+END_VERBATIM&#xA;&#xA;#+BEGIN_QUOTE&#xA;Quote Block&#xA;#+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This was answer was tested using&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  org-mode version: 9.0&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-11-12T21:36:23.023" LastActivityDate="2016-11-12T21:36:23.023" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18538" PostTypeId="2" ParentId="18531" CreationDate="2015-12-01T23:50:03.913" Score="3" Body="&lt;p&gt;If your file contains just one lisp form, all you need to do is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq v (read (f-read-text &quot;s.el&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Input-Functions.html&quot; rel=&quot;nofollow&quot;&gt;Input Functions&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are several forms, like &lt;code&gt;(a b) (c d)&lt;/code&gt;, you will need to read in cycle using &lt;code&gt;read-from-string&lt;/code&gt; or do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read (concat &quot;(&quot; my-string &quot;)&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastActivityDate="2015-12-01T23:50:03.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18539" PostTypeId="2" ParentId="18488" CreationDate="2015-12-02T02:15:55.180" Score="0" Body="&lt;p&gt;When I wanted to put Emacs' socket into my encrypted &lt;code&gt;$HOME&lt;/code&gt;, I had to put the definition &lt;code&gt;TMPDIR=&quot;$HOME/tmp;export TMPDIR&quot;&lt;/code&gt; in my &lt;code&gt;$HOME/.profile&lt;/code&gt; file, so an early shell would see the definition and pass it in Emacs' &lt;code&gt;ENVIRONMENT&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10353" LastActivityDate="2015-12-02T02:15:55.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18540" PostTypeId="1" AcceptedAnswerId="18573" CreationDate="2015-12-02T04:09:41.070" Score="5" ViewCount="124" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How to obtain the points at the beginning and ending of each visual line of the current window -- &lt;em&gt;without&lt;/em&gt; using &lt;code&gt;vertical-motion&lt;/code&gt; -- when &lt;code&gt;word-wrap&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt; (aka &lt;code&gt;visual-line-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this experiment, I am using a few of the functions from the section of the manual entitled &lt;strong&gt;Accessing Mouse Events&lt;/strong&gt;:  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Accessing-Mouse.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Accessing-Mouse.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BACKGROUND:  As we all know, &lt;code&gt;vertical-motion&lt;/code&gt; is very costly in terms of time.  I have a custom minor-mode that is similar to &lt;code&gt;vline.el&lt;/code&gt; -- &lt;a href=&quot;http://www.emacswiki.org/emacs/vline.el&quot; rel=&quot;noreferrer&quot;&gt;http://www.emacswiki.org/emacs/vline.el&lt;/a&gt; -- except that mine works with &lt;code&gt;word-wrap&lt;/code&gt;/&lt;code&gt;visual-line-mode&lt;/code&gt;.  I am searching for a faster method to perform calculations each command loop.  At the present time, I make one pass of the current window (every command loop) using &lt;code&gt;vertical-motion&lt;/code&gt; to obtain the following information:  point at beginning/ending of the whole line; point at the beginning/ending of the visual line; the visual column number at the end of the visual line (which may be different than the actual column number when a line is wrapped at the window edge); point at each location in a vertical line from the cursor position spanning from window-start to window-end; and, various other information based on all of the foregoing -- e.g., colors of foreground/background faces and character codes at the various locations, line numbers, etc.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq word-wrap t)&#xA;&#xA;(setq truncate-lines nil)&#xA;&#xA;(progn&#xA;  (remove-overlays) ;; after-string properties prevent `posn-at-point` from working right.&#xA;  (let* (&#xA;      pt&#xA;      posn-at-x-y&#xA;      (counter 0)&#xA;      (window-height (window-height))&#xA;      (window-header-line-height (window-header-line-height))&#xA;      (frame-char-height (frame-char-height))&#xA;      (position (posn-at-point))&#xA;      (posn-x-y (nth 2 position))&#xA;      (posn-actual-col-row (nth 6 position)))&#xA;    (while (&amp;lt;= counter window-height)&#xA;      (unless&#xA;          (and&#xA;            (= counter 0)&#xA;            (= 0 window-header-line-height))&#xA;        (setq posn-at-x-y (posn-at-x-y (car posn-x-y) (* frame-char-height counter))))&#xA;      (setq pt (nth 1 posn-at-x-y))&#xA;      (setq counter (1+ counter))&#xA;      (message &quot;counter: %s | %s&quot; counter (if (integerp pt) (char-after pt) pt)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-12-02T04:27:57.167" LastActivityDate="2015-12-03T06:30:04.890" Title="Obtain points at beginning/ending of visual line without using vertical-motion" Tags="|mouse|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18541" PostTypeId="2" ParentId="801" CreationDate="2015-12-02T05:22:48.827" Score="1" Body="&lt;p&gt;&lt;strong&gt;M-x semantic-mode&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;www.gnu.org/software/emacs/manual/html_node/semantic/Using-Semantic.html#Using-Semantic&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;amp;&amp;amp;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tags Tables&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;find . -name &quot;*.[chCH]&quot; -print | etags -&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;www.gnu.org/software/emacs/manual/html_node/emacs/Tags.html&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;etags&lt;/strong&gt;, ctags - generate tag file for Emacs, vi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;manpages.debian.org/cgi-bin/man.cgi?query=etags&amp;amp;apropos=0&amp;amp;sektion=0&amp;amp;manpath=Debian+8+jessie&amp;amp;format=html&amp;amp;locale=en&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;C-M-i (or M-TAB)&lt;/strong&gt; completion-at-point.&#xA;If Semantic mode enabled, tries to use Semantic parser data.&#xA;If Semantic mode disabled or fails, tries to complete using selected tags table (see Tags)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Symbol-Completion.html#index-C_002dM_002di&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Symbol-Completion.html#index-C_002dM_002di&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;M-. (find-tag)&lt;/strong&gt; prompts tag name &amp;amp;&amp;amp; jump to definition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Tag.html#index-M_002d_002e&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Tag.html#index-M_002d_002e&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10354" LastEditorUserId="10354" LastEditDate="2015-12-02T05:56:51.997" LastActivityDate="2015-12-02T05:56:51.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18542" PostTypeId="1" AcceptedAnswerId="18546" CreationDate="2015-12-02T05:23:38.493" Score="0" ViewCount="130" Body="&lt;p&gt;This box appears in the center of my Emacs frame with certain actions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most reliable way to trigger it is attempting to move the cursor past the boundaries of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It disappears after switching to a different buffer, or scrolling enough to replace all the text in view.  Marking the area also solves it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think it's an accessibility feature because of the unusual way in which it disappears.  Anyone else recognize this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My version:&#xA;GNU Emacs 24.5.1 (x86_64-apple-darwin15.0.0, NS apple-appkit-1404.13) of 2015-11-30&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Installed with Macports on El Capitan&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BtADJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BtADJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/7hNNO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7hNNO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6682" LastActivityDate="2015-12-02T08:44:31.957" Title="magnifier box appears in middle of Emacs frame" Tags="|frames|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18543" PostTypeId="1" AcceptedAnswerId="20246" CreationDate="2015-12-02T05:41:42.567" Score="0" ViewCount="213" Body="&lt;p&gt;I'm using PrivateInternetAccess for my proxy and when I enable it, sending email via mu4e times out (although retrieving emails works fine). With the proxy disabled, sending works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a screenshot of my PIA settings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TEar0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TEar0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how my account is defined:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-mu4e-account-alist&#xA;  '((&quot;personal&quot;&#xA;     (mu4e-sent-folder &quot;/personal/[Gmail]/Sent Mail&quot;)&#xA;     (mu4e-drafts-folder &quot;/personal/drafts&quot;)&#xA;     (user-mail-address &quot;foo@gmail.com&quot;)&#xA;     (smtpmail-smtp-user &quot;foo@gmail.com&quot;)&#xA;     (smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;)&#xA;     (smtpmail-smtp-server &quot;smtp.gmail.com&quot;)&#xA;     (smtpmail-stream-type starttls)&#xA;     (smtpmail-smtp-service 587)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this a problem with the proxy? My settings (emacs or PIA)?&lt;/p&gt;&#xA;" OwnerUserId="251" LastActivityDate="2016-02-12T11:58:18.053" Title="mu4e sending email fails when using proxy?" Tags="|email|mu4e|proxy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18544" PostTypeId="1" CreationDate="2015-12-02T07:13:00.463" Score="1" ViewCount="274" Body="&lt;p&gt;I'm following info found on this &lt;a href=&quot;http://www.emacswiki.org/emacs/WindMove&quot; rel=&quot;nofollow&quot; title=&quot;link&quot;&gt;link&lt;/a&gt;, but cannot get the desired custom key bindings to work for &lt;code&gt;windmove&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I put the following in my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-M-&amp;lt;left&amp;gt;&quot;) 'windmove-left)&#xA;(global-set-key (kbd &quot;C-M-&amp;lt;right&amp;gt;&quot;) 'windmove-right)&#xA;(global-set-key (kbd &quot;C-M-&amp;lt;up&amp;gt;&quot;) 'windmove-up)&#xA;(global-set-key (kbd &quot;C-M-&amp;lt;down&amp;gt;&quot;) 'windmove-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where my &lt;code&gt;Control&lt;/code&gt; key is &lt;code&gt;Ctrl&lt;/code&gt; and my &lt;code&gt;Meta&lt;/code&gt; key is &lt;code&gt;Alt&lt;/code&gt;, and I am using &lt;code&gt;Emacs 24.5.1&lt;/code&gt; on OS X 10.10.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I have two windows in a maximized terminal (&lt;code&gt;iTerm2&lt;/code&gt;), nothing happens when I press any of the 3-key chords above. Why? &lt;/p&gt;&#xA;" OwnerUserId="10294" LastEditorUserId="105" LastEditDate="2019-02-11T17:51:00.617" LastActivityDate="2019-02-11T17:51:00.617" Title="Define key chords for windmove" Tags="|key-bindings|window|osx|terminal-emacs|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18546" PostTypeId="2" ParentId="18542" CreationDate="2015-12-02T08:44:31.957" Score="3" Body="&lt;p&gt;It's a known bug in Emacs, when running on El Capitan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can avoid this by setting &lt;code&gt;visual-bell&lt;/code&gt; to nil (in which case Emacs beeps instead) or &lt;code&gt;ring-bell-function&lt;/code&gt; to a function of your choice. If you want Emacs to be quiet, you can set it to &lt;code&gt;ignore&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has been fixed in the upcoming Emacs 25.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-12-02T08:44:31.957" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18547" PostTypeId="1" CreationDate="2015-12-02T12:26:42.827" Score="3" ViewCount="874" Body="&lt;p&gt;I export my Org-Mode notes with internal links to LaTeX and I want it to look like this ''Section 1.1 [Section name], page 99'' (Like in the Org Manual). I use this construction:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Chapter 1&#xA;** Section 1.1&#xA; :PROPERTIES:&#xA; :CUSTOM_ID: section-1&#xA; :END:&#xA;* Chapter 2&#xA;** Section 2.1&#xA;I want a reference to Section 1.1 from here (See #section-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I only get the number of the section ''1.1'' as a result, not ''Section 1.1 [Section name], page 99''. What options do I need to use?&lt;/p&gt;&#xA;" OwnerUserId="10244" LastEditorUserId="8431" LastEditDate="2016-04-28T14:16:07.517" LastActivityDate="2016-04-28T14:16:07.517" Title="Org-Mode LaTeX export with section number, name and page in internal links" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18550" PostTypeId="1" AcceptedAnswerId="18781" CreationDate="2015-12-02T14:11:34.220" Score="1" ViewCount="418" Body="&lt;p&gt;I'd like to remove all wip references but current and send unused commits to garbage. But I found no specific wip commands for it. Should I use some combinations of generic git commands?&lt;/p&gt;&#xA;" OwnerUserId="9629" LastActivityDate="2015-12-11T10:19:47.127" Title="How to clean wip references" Tags="|magit|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18551" PostTypeId="2" ParentId="18530" CreationDate="2015-12-02T14:17:09.853" Score="5" Body="&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case err&#xA;    (potentially-too-recursive-function)&#xA;  (error (message &quot;error=%S, data=%S&quot; (car err) (cdr err))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will not only catch the error but will additionally emit a message telling you which specific error was signaled.  Also, in recent Emacsen, you can use completion to see the possible error symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sadly, when you try the above, you'll see that the error signaled by excessive recursion is just &lt;code&gt;error&lt;/code&gt; (aka the generic parent of all errors).  You might like to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; and request that this error be given a more specific symbol.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="253" LastEditDate="2015-12-02T22:55:10.817" LastActivityDate="2015-12-02T22:55:10.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18552" PostTypeId="1" CreationDate="2015-12-02T15:00:32.027" Score="6" ViewCount="688" Body="&lt;p&gt;Suppose, we have a variable defined in &lt;code&gt;~/.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *my-var* &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in &lt;code&gt;**scratch**&lt;/code&gt; buffer we set some value to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq *my-var* &quot;value&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After we close emacs the value will be lost. How can we store the value to disk and read it again when Emacs is started?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastEditorUserId="105" LastEditDate="2016-03-14T04:30:53.343" LastActivityDate="2016-03-14T04:30:53.343" Title="How to store the variable value after Emacs was closed" Tags="|variables|persistence|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18553" PostTypeId="1" CreationDate="2015-12-02T15:15:55.807" Score="1" ViewCount="59" Body="&lt;p&gt;Editing Joomla articles in the web interface is the most pain the world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The articles in Joomla are stored in a mysql database. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to figure out how I can connect a buffer to a &quot;value&quot; in mysql database, which contains the html code, so that I can edit the html in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone got any idea?&lt;/p&gt;&#xA;" OwnerUserId="10351" LastActivityDate="2015-12-02T15:15:55.807" Title="Edit Joomla Articles with Emacs" Tags="|sql|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18554" PostTypeId="2" ParentId="18552" CreationDate="2015-12-02T16:21:57.567" Score="5" Body="&lt;p&gt;&lt;code&gt;desktop-save-mode&lt;/code&gt; will do this for you. It saves more than just the state of variables though, it also saves open buffers, window layouts and more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To explicitly save the value of a global variable with you desktop, add the symbol to the list: &lt;code&gt;desktop-globals-to-save&lt;/code&gt;. For local variables, use &lt;code&gt;desktop-locals-to-save&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more about &lt;code&gt;desktop-save-mode&lt;/code&gt; &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; to learn about enabling and customizing it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alternatively, persisting your scratch buffer between sessions so you could reevaluate customizations may suffice for your example. &lt;a href=&quot;https://github.com/Fanael/persistent-scratch&quot; rel=&quot;noreferrer&quot;&gt;persistent-scratch&lt;/a&gt; is available on MELPA and simplifies the process of saving your scratch buffer between sessions.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2015-12-02T16:27:01.453" LastActivityDate="2015-12-02T16:27:01.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18555" PostTypeId="1" AcceptedAnswerId="18566" CreationDate="2015-12-02T16:37:48.387" Score="3" ViewCount="90" Body="&lt;p&gt;I'm trying to make a table in org-mode, the first column of which should be the Monday of each week starting with a date I specify. So, for example, if I specify Dec 14th, I would get a column with Dec 14, Dec 21, Dec 28, Jan 4, etc. Is this possible? If so, how? &lt;/p&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="253" LastEditDate="2015-12-02T22:53:55.740" LastActivityDate="2015-12-03T01:04:38.553" Title="Column of programmatically updated dates in org-mode" Tags="|org-mode|time-date|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18556" PostTypeId="1" CreationDate="2015-12-02T17:52:34.613" Score="8" ViewCount="1385" Body="&lt;p&gt;When running &lt;code&gt;M-x ispell&lt;/code&gt;, is it possible to go back to the previous typo? For example, I accidentally pass a typo and want to go back to it.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2018-02-27T18:51:20.020" Title="How to move back to a previous typo in ispell?" Tags="|ispell|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18557" PostTypeId="1" CreationDate="2015-12-02T18:25:54.943" Score="5" ViewCount="92" Body="&lt;p&gt;I am using a font that does not include italic characters. However, it does include characters like &lt;code&gt;mathematical italic small a&lt;/code&gt;, which I would like to use instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can set up a display-table that maps a regular character &lt;code&gt;a&lt;/code&gt; to its mathematical italic counterpart &lt;code&gt;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((d (make-display-table)))&#xA;  (aset d ?a (vector ?))&#xA;  (set-window-display-table nil d))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I can't figure out how to use this display-table &lt;em&gt;only for italic text&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2015-12-02T18:25:54.943" Title="How to replace a character display only for the `italic` face?" Tags="|font-lock|display|unicode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18558" PostTypeId="1" CreationDate="2015-12-02T18:58:14.250" Score="2" ViewCount="236" Body="&lt;p&gt;I am using &lt;code&gt;wgrep&lt;/code&gt; but somehow for those read-only files (under version control), it always reports not to apply changes. Even the var of &lt;code&gt;wgrep-change-readonly-file&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;. Any idea how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="10364" LastEditorUserId="253" LastEditDate="2015-12-02T22:51:28.697" LastActivityDate="2015-12-02T22:51:28.697" Title="wgrep cannot modify read-only files?" Tags="|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18559" PostTypeId="2" ParentId="18558" CreationDate="2015-12-02T19:19:15.387" Score="3" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/mhayashi1120/Emacs-wgrep&quot; rel=&quot;nofollow&quot;&gt;Github README&lt;/a&gt; says that the variable actually means read-only &lt;em&gt;buffers&lt;/em&gt;, not read-only &lt;em&gt;files&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To apply all changes wheather or not &lt;strong&gt;buffer&lt;/strong&gt; is read-only.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq wgrep-change-readonly-file t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You cannot modify read-only files by definition. You must adjust the files' attributes in order to do so. This varies depending on your operating system and file system.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2015-12-02T19:19:15.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18560" PostTypeId="1" AcceptedAnswerId="18563" CreationDate="2015-12-02T19:31:08.810" Score="3" ViewCount="141" Body="&lt;p&gt;Let's say I have a &lt;code&gt;let&lt;/code&gt; form and I want to generate the &lt;code&gt;varlist&lt;/code&gt;&#xA;dynamically from another function. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((x 1)&#xA;      (y 2)&#xA;      (the-dyn-gen))&#xA;  body...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have some local vars already in the &lt;code&gt;varlist&lt;/code&gt; namely x and y. But I want to call a function that I called &lt;code&gt;the-dyn-gen&lt;/code&gt; which returns a list like this &lt;code&gt;'((a 3) (b 4))&lt;/code&gt; now I need to make these sub lists &lt;code&gt;(a 3)&lt;/code&gt; &amp;amp; &lt;code&gt;(b 3)&lt;/code&gt;  part of the &lt;code&gt;varlist&lt;/code&gt;.&#xA;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="10365" LastEditorUserId="105" LastEditDate="2016-06-22T20:39:11.480" LastActivityDate="2016-06-22T20:39:11.480" Title="Dynamic generation of varlist in a let form" Tags="|elisp-macros|let-binding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18561" PostTypeId="1" CreationDate="2015-12-02T20:11:35.407" Score="5" ViewCount="1551" Body="&lt;p&gt;Is there a package to let emacs display the parameters of a function while typing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I were to start typing &lt;code&gt;printf(&lt;/code&gt; in C, I would like it to display the format taken from man pages, kinda like auto-completion, but without actually putting in any text.&lt;/p&gt;&#xA;" OwnerUserId="5451" LastEditorUserId="253" LastEditDate="2015-12-02T22:50:15.383" LastActivityDate="2015-12-02T22:50:15.383" Title="Display function arguments in echo area?" Tags="|programming|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18562" PostTypeId="2" ParentId="18561" CreationDate="2015-12-02T20:50:53.043" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/ElDoc&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;eldoc-mode&lt;/code&gt;&lt;/a&gt; does precisely this.  From the wiki page:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A very simple but effective thing, eldoc-mode is a MinorMode which shows you, in the echo area, the argument list of the function call you are currently writing. Very handy. By NoahFriedman. Part of Emacs.&lt;/p&gt;&#xA;&lt;p&gt;ElDoc works for EmacsLisp and certain other language modes that implement support for ElDoc. These include&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CEldocMode – for C, by grepping cpp&lt;/li&gt;&#xA;&lt;li&gt;CPerlMode – for Perl&lt;/li&gt;&#xA;&lt;li&gt;css-eldoc – for css-mode, available on melpa, see &lt;a href=&quot;https://github.com/zenozeng/css-eldoc&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/zenozeng/css-eldoc&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;EshellElDoc – for Eshell&lt;/li&gt;&#xA;&lt;li&gt;EukleidesMode – for Eukleides plane geometry language&lt;/li&gt;&#xA;&lt;li&gt;PythonMode (the python.el one) – but only in Emacs 22, or using an Emacs 21 back-port&lt;/li&gt;&#xA;&lt;li&gt;SemanticBovinator – tools using that system&lt;/li&gt;&#xA;&lt;li&gt;TaclMode – Tandem/NSK/Guardian&lt;/li&gt;&#xA;&lt;li&gt;TalMode – Tandem/NSK/Guardian&lt;/li&gt;&#xA;&lt;li&gt;Org-mode&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-12-02T20:50:53.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18563" PostTypeId="2" ParentId="18560" CreationDate="2015-12-02T21:31:35.303" Score="6" Body="&lt;p&gt;Looks like a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Macros.html#Macros&quot; rel=&quot;nofollow noreferrer&quot;&gt;macro&lt;/a&gt; could do that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro mylet (defs fun body)&#xA;  (list 'let (append defs (funcall fun)) body))&#xA;&#xA;;; example uses&#xA;(defun the-dyn-gen () &#xA;  '((a 3) (b 3)))&#xA;&#xA;(mylet ((x 1) (y 2)) the-dyn-gen (+ a b x y))&#xA;&#xA;(mylet ((x 1)) the-dyn-gen (+ a b x))&#xA;&#xA;(mylet nil the-dyn-gen (+ a b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: while this seems to work, macros can be &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Problems-with-Macros.html#Problems-with-Macros&quot; rel=&quot;nofollow noreferrer&quot;&gt;tricky&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;macroexpand&lt;/code&gt; is a nice function to test a macro. Here&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(macroexpand '(mylet ((x 1) (y 2)) the-dyn-gen (+ a b x y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((x 1) (y 2) (a 3) (b 3)) (+ a b x y))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: related &lt;a href=&quot;https://emacs.stackexchange.com/questions/8156/use-a-variable-to-determine-let-bindings?rq=1&quot;&gt;question&lt;/a&gt; with &lt;code&gt;progv&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-12-02T21:45:11.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18564" PostTypeId="1" AcceptedAnswerId="18569" CreationDate="2015-12-02T22:58:03.973" Score="15" ViewCount="739" Body="&lt;p&gt;Before switching to eshell I had zsh setup so that it would:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Write out to the history file after every command&lt;/li&gt;&#xA;&lt;li&gt;Append to rather than overwrite the history file so when running multiple shells they would all get merged into one big history&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both zsh options are documented &lt;a href=&quot;http://zsh.sourceforge.net/Doc/Release/Options.html&quot;&gt;here&lt;/a&gt; (see APPEND_HISTORY and INC_APPEND_HISTORY).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is super useful when combined with a large history size because you can open a new shell weeks after issuing a command and find it in your history (without these options a large history is useless since it will only contain the history of the most recently closed shell). It also means you can open new shells and have them immediately know your most recent commands in other shells. Is there any way to setup eshell with this behavior? The first bullet seems easy enough but appending looks trickier...&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2015-12-03T14:01:09.393" LastActivityDate="2015-12-07T17:23:50.220" Title="Merge history from multiple eshells" Tags="|eshell|history|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18565" PostTypeId="1" CreationDate="2015-12-02T23:48:48.653" Score="2" ViewCount="143" Body="&lt;p&gt;I'm giving a presentation with &lt;code&gt;org-present-mode&lt;/code&gt;. I'd like to be able to center text and format quotations nicely, as described in the &lt;a href=&quot;http://orgmode.org/manual/Paragraphs.html#Paragraphs&quot; rel=&quot;nofollow&quot;&gt;structural markup&lt;/a&gt; section of the org-mode docs. I'd also like to be able to make notes to myself in comments that won't display when I give the presentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I get &lt;code&gt;org-present-mode&lt;/code&gt; to do this? I need to be able to execute elisp and open up new buffers within the presentation so exporting to HTML/PDF and viewing it externally isn't an option. If I could export it to a scratch buffer that's still in normal &lt;code&gt;org-mode&lt;/code&gt; but with the formatting applied, that would work, but it's not clear to me how to do that.&lt;/p&gt;&#xA;" OwnerUserId="10368" LastActivityDate="2015-12-02T23:48:48.653" Title="Render structural markup and hide comments in org-present-mode?" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18566" PostTypeId="2" ParentId="18555" CreationDate="2015-12-03T01:04:38.553" Score="4" Body="&lt;p&gt;Dates can be used in formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example should be similar to what you are asking for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |    | Date               | Other |&#xA;|---+----+--------------------+-------|&#xA;| $ |    | start=&amp;lt;2015-12-07&amp;gt; |       |&#xA;| # | 1  | &amp;lt;2015-12-14 Mon&amp;gt;   |       |&#xA;| # | 2  | &amp;lt;2015-12-21 Mon&amp;gt;   |       |&#xA;| # | 3  | &amp;lt;2015-12-28 Mon&amp;gt;   |       |&#xA;| # | 4  | &amp;lt;2016-01-04 Mon&amp;gt;   |       |&#xA;| # | 5  | &amp;lt;2016-01-11 Mon&amp;gt;   |       |&#xA;#+TBLFM: $3=$start + $2 * 7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-03T01:04:38.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18567" PostTypeId="1" CreationDate="2015-12-03T01:43:32.140" Score="4" ViewCount="1502" Body="&lt;p&gt;I use persp-mode and projectile both of which are installed using the use-package package and both want to prefix their keymaps with C-c p. The projectile readme says that you can define a custom keymap prefix with the projectile-keymap-prefix variable. (Similar is true for persp-mode.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether or not I set this variable within the use-package directive or outside, the actual prefix does not change even though describe-variable shows the value as &quot;^C^P&quot;. I still have to access projectile commands via C-c p. (The same is also true for persp-mode if i set the persp-keymap-prefix var to something other than C-c p.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does the actual prefix that needs pushed never update with the custom prefix, and how do I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the relevant code. For both libraries I still have to access their keymap actions via C-c p despite setting their keymap-prefix vars:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (add-hook 'after-init-hook&#xA;    (lambda ()&#xA;     (progn&#xA;      (use-package persp-mode&#xA;       :config&#xA;       (setq persp-keymap-prefix (kbd &quot;C-c o&quot;))&#xA;       (setq persp-nil-name &quot;Home&quot;)&#xA;       (persp-mode 1))&#xA;&#xA;&#xA;      (use-package projectile&#xA;       :diminish projectile-mode&#xA;       :config&#xA;       (setq projectile-keymap-prefix (kbd &quot;C-c C-p&quot;))&#xA;       (projectile-global-mode)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10370" LastActivityDate="2016-01-02T02:31:48.590" Title="Setting projectile-keymap-prefix with use-package" Tags="|keymap|projectile|use-package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18568" PostTypeId="2" ParentId="18567" CreationDate="2015-12-03T02:09:46.210" Score="4" Body="&lt;p&gt;It looks like defining the keymap var in the :init fixes it. I have a hunch (the keymaps are defined when the package is loaded), but I'd still be interested to know why this fixes it, and if this is generally how variables should be set with use-package. (FWIW, :init is run before the package is loaded and :config executes after)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (use-package projectile&#xA;    :diminish projectile-mode&#xA;    :init&#xA;    (setq projectile-keymap-prefix (kbd &quot;C-c C-p&quot;))&#xA;    :config&#xA;    (projectile-global-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10370" LastActivityDate="2015-12-03T02:09:46.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18569" PostTypeId="2" ParentId="18564" CreationDate="2015-12-03T03:26:16.280" Score="7" Body="&lt;p&gt;&lt;strong&gt;Disclaimer: I don't use eshell, so take this with a grain of salt.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eshell&lt;/code&gt; appears to call &lt;code&gt;eshell-write-history&lt;/code&gt; to write history, which takes an optional argument &lt;code&gt;append&lt;/code&gt; which defaults to &lt;code&gt;nil&lt;/code&gt;. This argument seems to be unused in &lt;code&gt;eshell&lt;/code&gt; presently, but does appear to work (it passes the argument through to &lt;code&gt;write-region&lt;/code&gt;, which does properly append).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a couple of options here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq eshell-save-history-on-exit nil)&lt;/code&gt; and call &lt;code&gt;eshell-write-history&lt;/code&gt; yourself&lt;/li&gt;&#xA;&lt;li&gt;Redefine &lt;code&gt;eshell-write-history&lt;/code&gt; to satisfy your requirement.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Personally, I'd go with 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq eshell-save-history-on-exit nil)&#xA;(defun eshell-append-history ()&#xA;  &quot;Call `eshell-write-history' with the `append' parameter set to `t'.&quot;&#xA;  (when eshell-history-ring&#xA;    (let ((newest-cmd-ring (make-ring 1)))&#xA;      (ring-insert newest-cmd-ring (car (ring-elements eshell-history-ring)))&#xA;      (let ((eshell-history-ring newest-cmd-ring))&#xA;        (eshell-write-history eshell-history-file-name t)))))&#xA;(add-hook eshell-pre-command-hook #'eshell-append-history)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Thanks to @joseph-garvin for the corrected, working &lt;code&gt;eshell-append-history&lt;/code&gt; function&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't handle dynamically loading the new history contents into a shell (eg run command &lt;code&gt;X&lt;/code&gt; in shell A, and having it appear in history in shell B without reloading; like zsh's SHARE_HISTORY). I don't know how efficient &lt;code&gt;eshell-read-history&lt;/code&gt; is, so I'd be hesitant to run it in a hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also possible that you will end up with duplicate entries with this &lt;code&gt;eshell-append-history&lt;/code&gt; function. You may need to do some shenanigans with clearing all but the most recent entry from &lt;code&gt;eshell-history-ring&lt;/code&gt;, then resetting it to the old value after writing history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((old-ring (copy-list eshell-history-ring)))&#xA;  (setq eshell-history-ring (list (car eshell-history-ring)))&#xA;  ; write&#xA;  (setq eshell-history-ring old-ring))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="147" LastEditorUserId="147" LastEditDate="2015-12-07T17:23:50.220" LastActivityDate="2015-12-07T17:23:50.220" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18570" PostTypeId="1" AcceptedAnswerId="18572" CreationDate="2015-12-03T03:52:08.317" Score="29" ViewCount="16969" Body="&lt;p&gt;I have seen &lt;code&gt;progn&lt;/code&gt; being used quite a lot as I browse the configuration files of experienced Emacs users. I found &lt;a href=&quot;https://emacs.stackexchange.com/questions/5829/curiosity-what-does-progn-stands-for&quot;&gt;this nice explanation of &lt;code&gt;progn&lt;/code&gt;&lt;/a&gt;, but what I am really curious about is, what is the benefit of using this function? Take for example this snippet (taken from &lt;a href=&quot;http://pages.sachachua.com/.emacs.d/Sacha.html#unnumbered-1&quot; rel=&quot;noreferrer&quot;&gt;Sacha Chua's configuration&lt;/a&gt;):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(use-package undo-tree&#xA;  :defer t&#xA;  :ensure t&#xA;  :diminish undo-tree-mode&#xA;  :config&#xA;  (progn&#xA;    (global-undo-tree-mode)&#xA;    (setq undo-tree-visualizer-timestamps t)&#xA;    (setq undo-tree-visualizer-diff t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Is there any major difference between the above configuration and this?&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(use-package undo-tree&#xA;  :defer t&#xA;  :ensure t&#xA;  :diminish undo-tree-mode&#xA;  :config&#xA;  (global-undo-tree-mode)&#xA;  (setq undo-tree-visualizer-timestamps t)&#xA;  (setq undo-tree-visualizer-diff t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I feel like the first example is somehow cleaner, even though it has more syntax, and my intuition is that there might be some kind of performance boost from using &lt;code&gt;progn&lt;/code&gt;, but I am not sure. Thank you for any insights!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="28858" LastEditDate="2021-02-20T18:09:51.080" LastActivityDate="2021-02-20T18:09:51.080" Title="When/why should I use progn?" Tags="|lisp|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="18571" PostTypeId="2" ParentId="18570" CreationDate="2015-12-03T04:15:28.880" Score="17" Body="&lt;p&gt;The most important reason for &lt;strong&gt;progn&lt;/strong&gt; is described in the first line of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/progn.html&quot; rel=&quot;noreferrer&quot;&gt;progn documentation&lt;/a&gt; (emphasis added):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;progn is a special form that causes each of its &lt;strong&gt;arguments to be evaluated in sequence&lt;/strong&gt; and then returns the value of the last one.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Addendum:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without &lt;strong&gt;progn&lt;/strong&gt;, sequence is not guaranteed, especially if subsequent expressions  are dependent on the side effects or return values of the previous expressions. &lt;strong&gt;progn&lt;/strong&gt; enforces execution sequence the same as textual sequence. Helps to not confuse execution with parsing. This behavior goes back to the fundamentals of lisp control structures and functional programming. Here's an excerpt (emphasis added) from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Control-Structures.html&quot; rel=&quot;noreferrer&quot;&gt;lisp reference manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The built-in control structures are special forms since their subforms are not necessarily evaluated or &lt;strong&gt;not evaluated sequentially&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does &lt;strong&gt;progn&lt;/strong&gt; boost performance? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parsing performance, no. Execution performance, no. At best it may equal but never magically boost performance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When is &lt;strong&gt;progn&lt;/strong&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequencing.html&quot; rel=&quot;noreferrer&quot;&gt;used&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...most often inside an &lt;strong&gt;unwind-protect, and, or&lt;/strong&gt;, or in the then-part of an &lt;strong&gt;if&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2015-12-03T16:44:18.187" LastActivityDate="2015-12-03T16:44:18.187" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18572" PostTypeId="2" ParentId="18570" CreationDate="2015-12-03T04:17:02.150" Score="21" Body="&lt;p&gt;&lt;code&gt;progn&lt;/code&gt; is typically used when dealing with macros. Some macros (&lt;code&gt;use-package&lt;/code&gt; is a macro, last I checked) accept &lt;em&gt;only 1 &lt;a href=&quot;https://stackoverflow.com/questions/2877371/definition-of-lisp-form#2877854&quot;&gt;form&lt;/a&gt;&lt;/em&gt;, where others consume &lt;em&gt;all remaining forms&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;progn&lt;/code&gt; is used in the former case to turn a sequence of forms into a single form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your examples, the first one uses &lt;code&gt;progn&lt;/code&gt; and thus there is &lt;em&gt;1 form&lt;/em&gt; after &lt;code&gt;:config&lt;/code&gt;. In the second, there are &lt;em&gt;3 forms&lt;/em&gt;. If the &lt;code&gt;use-package&lt;/code&gt; macro only expects 1 form following &lt;code&gt;:config&lt;/code&gt;, then it will cause an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is worth noting that using &lt;code&gt;progn&lt;/code&gt; works in both cases, while omitting it only works if the macro accepts multiple forms. As a result of this, some people prefer to simply always use &lt;code&gt;progn&lt;/code&gt;, because it will always work.&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-12-03T04:17:02.150" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="18573" PostTypeId="2" ParentId="18540" CreationDate="2015-12-03T06:24:16.480" Score="2" Body="&lt;p&gt;&lt;strong&gt;First Rough Draft&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to &lt;code&gt;x&lt;/code&gt;, one pixel less than the &lt;code&gt;(window-body-width nil t)&lt;/code&gt; when used in conjunction with &lt;code&gt;posn-at-x-y&lt;/code&gt; will yield the point at the end of the visual line.  As to &lt;code&gt;x&lt;/code&gt;, zero will return the point at the beginning of the visual line.  Refer to the diagram in the manual at the section relating to &lt;em&gt;window sizes&lt;/em&gt;:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (remove-overlays)&#xA;  (let* (&#xA;      pt&#xA;      posn-at-x-y&#xA;      (counter 0)&#xA;      (window-body-width (window-body-width nil t))&#xA;      (last-available-x (1- window-body-width))&#xA;      (window-height (window-height))&#xA;      (window-header-line-height (window-header-line-height))&#xA;      (frame-char-height (frame-char-height))&#xA;      (position (posn-at-point))&#xA;      (posn-x-y (nth 2 position))&#xA;      (posn-actual-col-row (nth 6 position)) ) ;; not presently used&#xA;    (while (&amp;lt;= counter window-height)&#xA;      (unless&#xA;          (and&#xA;            (= counter 0)&#xA;            (= 0 window-header-line-height))&#xA;        (setq posn-at-x-y (posn-at-x-y (car posn-x-y) (* frame-char-height counter)))&#xA;        (setq posn-x-y (nth 2 posn-at-x-y)))&#xA;      (setq pt (nth 1 posn-at-x-y))&#xA;      (message &quot;counter: %s | pt: %s | pbovl: %s | peovl: %s&quot;&#xA;        counter&#xA;        (if (integerp pt)&#xA;          pt ;; (char-after pt) -- not presently used.&#xA;          pt)&#xA;        (nth 1 (posn-at-x-y 0&#xA;          (if (= counter 0)&#xA;            (cdr posn-x-y)&#xA;            (+ window-header-line-height (cdr posn-x-y)))))&#xA;        (nth 1 (posn-at-x-y last-available-x&#xA;          (if (= counter 0)&#xA;            (cdr posn-x-y)&#xA;            (+ window-header-line-height (cdr posn-x-y))))))&#xA;      (setq counter (1+ counter)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-12-03T06:30:04.890" LastActivityDate="2015-12-03T06:30:04.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18574" PostTypeId="1" AcceptedAnswerId="18578" CreationDate="2015-12-03T06:36:06.457" Score="3" ViewCount="167" Body="&lt;p&gt;Using the command &lt;kbd&gt;ll&lt;/kbd&gt; in magit would get the complete commit history, but how can one show only the commits by an individual developer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked the cheetsheet but can't find a valid solution.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="306" LastEditDate="2015-12-03T12:08:14.107" LastActivityDate="2015-12-03T12:08:14.107" Title="How to get the commit history for a specific developer in Magit?" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18575" PostTypeId="2" ParentId="18547" CreationDate="2015-12-03T06:52:26.613" Score="2" Body="&lt;p&gt;You should write &lt;code&gt;[[section-1]]&lt;/code&gt; to get the number only (&lt;a href=&quot;http://orgmode.org/manual/Internal-links.html&quot; rel=&quot;nofollow&quot;&gt;source&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2015-12-03T06:52:26.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18576" PostTypeId="1" CreationDate="2015-12-03T07:55:51.850" Score="1" ViewCount="52" Body="&lt;p&gt;When both &lt;code&gt;auto-fill-mode&lt;/code&gt; and &lt;code&gt;auto-hscroll-mode&lt;/code&gt; are enabled, I often end up with a window that is horizontally scrolled, even though the entire content of the window should fit into an unscrolled window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs -Q&#xA;M-x toggle-truncate-lines RET&#xA;M-x auto-fill-mode RET&#xA;C-u 60 x&#xA;SPC&#xA;C-u 60 y&#xA;SPC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After the &lt;code&gt;y&lt;/code&gt;:s have been inserted, &lt;code&gt;auto-hscroll&lt;/code&gt; correctly scrolls the window so that the point is visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after the final SPC, the &lt;code&gt;x&lt;/code&gt;:s and &lt;code&gt;y&lt;/code&gt;:s are on separate lines, each short enough to be visible. Yet, the window still is horizontally scrolled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any setting or package that would make the window return to it's unscrolled state, once there is no need for it to be scrolled?&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2015-12-03T07:55:51.850" Title="auto-fill and auto-hscroll interferes, causing unnecessary horizontal scrolling" Tags="|auto-fill-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18578" PostTypeId="2" ParentId="18574" CreationDate="2015-12-03T12:07:35.490" Score="3" Body="&lt;p&gt;Look at the arguments available in the logging popup (&lt;kbd&gt;l&lt;/kbd&gt;). One of them is &lt;code&gt;--author&lt;/code&gt;, described as &quot;Limit to author&quot;. Sounds like that's what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you talking about the cheatsheet by Daemian Mack? If so then have a look at the top of that page and notice that it sais &quot;THIS CHEATSHEET IS OBSOLETE AS OF MAGIT V2&quot;. Below that you will also find links to more up-to-date documentation.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-12-03T12:07:35.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18579" PostTypeId="1" CreationDate="2015-12-03T13:27:24.077" Score="6" ViewCount="586" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I detect the keyboard layout from Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm writing some code that will set keybindings dynamically by selecting easy-to-reach keys (eg, those on home row).  To do this, though, I need to to know which keys correspond to home row on the user's computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could default to assuming that the computer uses the QWERTY layout, but that's not very portable for people using alternate layouts (I, myself, use Dvorak).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How would I detect the keyboard layout?  Is there anything portable (in pure elisp) that does it, or would one need to drop to the system level to do it?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I've browsed through various &lt;code&gt;*-keyboard-*&lt;/code&gt; and &lt;code&gt;*-input-method-*&lt;/code&gt; variables, and may have missed something obvious.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: there's an &lt;a href=&quot;https://stackoverflow.com/questions/7813648/emacs-determining-keyboard-layout&quot;&gt;old SO thread with a similar title&lt;/a&gt; that does not answer this question.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-12-03T13:27:24.077" Title="Detect keyboard layout?" Tags="|key-bindings|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18580" PostTypeId="1" AcceptedAnswerId="18658" CreationDate="2015-12-03T16:43:18.460" Score="0" ViewCount="192" Body="&lt;p&gt;I want to open a python interpreter in a buffer with ipython. So I use that, from the term-mode :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-term &quot;ipython&quot; &quot;/usr/bin/env&quot; nil &quot;ipython&quot; (or filename &quot;&quot;)&#xA;           &quot;--TerminalIPythonApp.force_interact=True&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I don't know where to precise the python version that I want to use : my default version is python2.7 and I want to start an interpreter with python 3.4.&lt;/p&gt;&#xA;" OwnerUserId="10056" LastActivityDate="2015-12-07T09:54:38.347" Title="Select the python version in a terminal" Tags="|python|ipython|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18581" PostTypeId="1" AcceptedAnswerId="18585" CreationDate="2015-12-03T16:50:46.753" Score="3" ViewCount="521" Body="&lt;p&gt;At work, I very commonly have to look up bits of information about strings in my code. For instance, we might use an incomprehensible ID, &quot;a587fg&quot;, to refer to a customer with a perfectly comprehensible name, &quot;FooCorp&quot;. It's fairly easy to define a function and bind it to a key mapping to look up a thing under point -- but what I'd much prefer is an ElDoc-style &quot;here's some info about thing-under-point in the echo area, automatically&quot; situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My reflex was to go to ElDoc itself, but I can't get it to work and I've no idea why. My best theory so far is that ElDoc only triggers on &lt;em&gt;symbols&lt;/em&gt; -- which, of course, an arbitrary string isn't, and probably shouldn't be. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: maybe I'm wiring up ElDoc wrong? Maybe there's a better way to do info-of-string-at-point? Who can help me understand how to get this working? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, here's how I'm wiring things up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-eldoc-function ()&#xA;  &quot;Get info about string at point&quot;&#xA;  (let (the-str)&#xA;    (if (setq the-str (thing-at-point 'string t))&#xA;        (my-str-doc-fun the-str) ;; Returns a string or nil&#xA;      nil)))&#xA;&#xA;(set (make-local-variable 'eldoc-documentation-function)&#xA;     'my-eldoc-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2015-12-03T17:49:52.670" Title="Displaying information for string under point" Tags="|eldoc|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18582" PostTypeId="1" AcceptedAnswerId="18584" CreationDate="2015-12-03T17:08:12.960" Score="5" ViewCount="6563" Body="&lt;p&gt;every time I try to open a python file I get the following message on the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File Mode Specification Error: (void-function nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I turned on the debug mode but I honestly don't understand what is going on or how to narrow down the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function nil)&#xA;nil()&#xA;run-hooks(change-major-mode-after-body-hook prog-mode-hook python-mode-hook)&#xA;apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook python-mode-hook))&#xA;run-mode-hooks(python-mode-hook)&#xA;python-mode()&#xA;set-auto-mode-0(python-mode nil)&#xA;set-auto-mode()&#xA;normal-mode(t)&#xA;after-find-file(nil t)&#xA;find-file-noselect-1(#&amp;lt;buffer flasktest.py&amp;gt; &quot;~/tmp/flasktest.py&quot; nil nil &quot;~/data/tmp/flasktest.py&quot; (8388619 2052))&#xA;find-file-noselect(&quot;/home/srp/tmp/flasktest.py&quot; nil nil)&#xA;ido-file-internal(raise-frame)&#xA;ido-find-file()&#xA;call-interactively(ido-find-file nil nil)&#xA;command-execute(ido-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I went through my &lt;code&gt;init.el&lt;/code&gt; but didn't find any suspicious with respect to python mode. Here are the relevant lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Package Management&#xA;(require 'package)&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;...&#xA;...&#xA;;; PYTHON IDE&#xA;;; Install rope, flake8, importmagic, autopep8 via pip&#xA;(elpy-enable)&#xA;(require 'py-autopep8)&#xA;(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)&#xA;(autoload 'pylint &quot;pylint&quot;)&#xA;(add-hook 'python-mode-hook 'pylint-add-menu-items)&#xA;(add-hook 'python-mode-hook 'pylint-add-key-bindings)&#xA;(add-hook 'python-mode-hook (highlight-indentation-mode 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to fix that error?&lt;/p&gt;&#xA;" OwnerUserId="10378" LastActivityDate="2015-12-03T17:48:48.760" Title="File Mode Specification Error: (void-function nil) after opening python file" Tags="|init-file|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18583" PostTypeId="1" CreationDate="2015-12-03T17:44:32.793" Score="4" ViewCount="257" Body="&lt;p&gt;My current configuration of Emacs (24.5.1 on U15.10) has auto-suggest set up for &lt;code&gt;find-file&lt;/code&gt;, that is, when I do C-x C-f, the mini-buffer fills with possible completions that I can tab to and hit enter to select. I'd like to do that on an interactive function I'm writing where it would auto-suggest each element of this list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((thing1a . thing1b) (thing2a . thing2b) ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there boilerplate code for this someone knows about?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-06-22T20:38:15.650" LastActivityDate="2017-05-10T22:04:24.663" Title="Interactive auto-suggest?" Tags="|completion|minibuffer|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18584" PostTypeId="2" ParentId="18582" CreationDate="2015-12-03T17:48:48.760" Score="6" Body="&lt;p&gt;This is your problem (at least one problem):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook (highlight-indentation-mode 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What does &lt;code&gt;(highlight-indentation-mode 0)&lt;/code&gt; return? (My guess is &lt;code&gt;nil&lt;/code&gt;, not a function.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it returns is added as an element of &lt;code&gt;python-mode-hook&lt;/code&gt;.  Then that thing, whatever it is, is invoked as a function.  In this case, Emacs tries to invoke &lt;code&gt;nil&lt;/code&gt; as a function. No can do.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-03T17:48:48.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18585" PostTypeId="2" ParentId="18581" CreationDate="2015-12-03T17:49:52.670" Score="2" Body="&lt;p&gt;It is not very clear to me what's the string that you wanted, and &lt;code&gt;thing-at-point&lt;/code&gt; doesn't understand either. The following displays corresponding commit summary if point is at hash &lt;code&gt;36dbe6f&lt;/code&gt; (see &lt;code&gt;eldoc-documentation-function&lt;/code&gt;'s docstring to learn how to change it, your way seems not correct).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo-eldoc-documentation-function ()&#xA;  (let ((str (thing-at-point 'word)))&#xA;    (when (string= &quot;36dbe6f&quot; str)&#xA;      &quot;* 36dbe6f More emacs-module.c fixes for wide ints&quot;)))&#xA;&#xA;(add-function :before-until (local 'eldoc-documentation-function)&#xA;                #'foo-eldoc-documentation-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-12-03T17:49:52.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18586" PostTypeId="1" CreationDate="2015-12-03T18:32:39.327" Score="2" ViewCount="1170" Body="&lt;p&gt;I installed the Solarized theme through package-install RET solarized-theme, and it went largely well but .org files have a strange appearance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vRBj8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vRBj8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note how it hides the line numbers. Here is how it looks on other files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mEPcN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mEPcN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make it so that org files have the same appearance as other files? Please note that I am new to this so I may not understand some things that are obvious to more experienced Emacs hackers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;;;settings files location&#xA;(add-to-list 'load-path &quot;~/.emacs.d/settings&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/&quot;)&#xA;;;import settings from other files&#xA;(require 'general-settings)&#xA;&#xA;;;theme loading&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/&quot;)&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(custom-enabled-themes (quote (solarized-dark)))&#xA; '(custom-safe-themes&#xA;   (quote&#xA;    (&quot;8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4&quot; default)))&#xA; '(inhibit-startup-screen t)&#xA; '(package-selected-packages (quote (solarized-theme))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;(load-theme 'solarized-dark t)&#xA;;;ido&#xA;(require 'ido)&#xA;(ido-mode t)(package-initialize)&#xA;&#xA;(setq package-archives&#xA;      '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;       (&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;       (&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;)))&#xA;&#xA;;;org-mode&#xA;&#xA;;;markdown&#xA;(autoload 'markdown-mode &quot;markdown-mode&quot;&#xA;   &quot;Major mode for editing Markdown files&quot; t)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\(.text\\|.markdown\\|.md\\)'&quot; . markdown-mode))&#xA;(setq markdown-enable-math t) ;;enables math functions&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my settings file (some useful things I borrowed from a friend):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;------------------------------;;&#xA;;;   Global Editor    Settings  ;;&#xA;;;------------------------------;;&#xA;&#xA;(setq current-language-environment &quot;English&quot;) ;; Language&#xA;(setq inhibit-startup-screen t) ;; Don't show the start-up Screen&#xA;&#xA;(menu-bar-mode 0) ;; Toggle menu bar&#xA;&#xA;(require 'tool-bar) ;; Toggle toolbar&#xA;(tool-bar-mode 0)&#xA;&#xA;(global-hl-line-mode 1) ;; Highlight line with cursorx&#xA;&#xA;(if window-system (scroll-bar-mode 0)) ;; Toggle scroll bar&#xA;(require 'mwheel) ;; Toggle mouse wheel support for scrolling&#xA;(mouse-wheel-mode 1)&#xA;&#xA;(transient-mark-mode 1) ;; Transient-Mark Mode (highlight selection&#xA;&#xA;(global-linum-mode t) ;; Display line number at left&#xA;(line-number-mode 1)&#xA;(column-number-mode 1)&#xA;&#xA;;; Text decoration&#xA;&#xA;&#xA;;; Window resizing bindings&#xA;(global-set-key (kbd &quot;S-C-&amp;lt;left&amp;gt;&quot;) 'shrink-window-horizontally)&#xA;(global-set-key (kbd &quot;S-C-&amp;lt;right&amp;gt;&quot;) 'enlarge-window-horizontally)&#xA;(global-set-key (kbd &quot;S-C-&amp;lt;down&amp;gt;&quot;) 'shrink-window)&#xA;(global-set-key (kbd &quot;S-C-&amp;lt;up&amp;gt;&quot;) 'enlarge-window)&#xA;&#xA;&#xA;(provide 'general-settings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10380" LastEditorUserId="7045" LastEditDate="2015-12-03T20:38:17.183" LastActivityDate="2020-07-02T13:25:53.957" Title="Strange behaviour of Solarized-theme in Org-mode" Tags="|org-mode|themes|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18588" PostTypeId="2" ParentId="18583" CreationDate="2015-12-03T20:15:10.357" Score="3" Body="&lt;p&gt;With a combination of &lt;code&gt;ido-completing-read&lt;/code&gt; and a conversion of the list items to strings, we may achieve this effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mystrlist (mapcar (lambda (l-item) (format &quot;%s&quot; l-item)) mylist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ido-completing-read &quot;What is your favorite thing? &quot; mystrlist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running this should pop up each list item as a possible completion.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="1979" LastEditDate="2017-05-10T22:04:24.663" LastActivityDate="2017-05-10T22:04:24.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18589" PostTypeId="2" ParentId="18586" CreationDate="2015-12-03T20:16:05.287" Score="1" Body="&lt;p&gt;For those with this problem, I solved it as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solarized theme has a toggle to scale font sizes of org headings. Disable that with this line in the init file to fix the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq solarized-scale-org-headlines nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10380" LastEditorUserId="7045" LastEditDate="2015-12-03T20:43:58.337" LastActivityDate="2015-12-03T20:43:58.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18590" PostTypeId="1" AcceptedAnswerId="18595" CreationDate="2015-12-03T20:46:01.093" Score="5" ViewCount="895" Body="&lt;p&gt;I am an English teacher who is profoundly not good at math, but I want to make some simple calculations with an &lt;code&gt;org-mode table&lt;/code&gt;. I've tried reading online, but am afraid the explanations are just not simple enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the following table, what formula would I put in the final boxes to calculate the average grade for &quot;draft&quot; and the average grade for &quot;final&quot;? (That is, to calculate the mean of column 2 and the mean of column 3.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| item    | draft | final|&#xA;|---------+-------+------|&#xA;| plot    |   2   |   3  |&#xA;| grammar |   3   |   4  |&#xA;|---------+-------+------|&#xA;| grade   |   ?   |   ?  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will the table recalculate with &lt;code&gt;C-c *&lt;/code&gt; if I change one of the grades?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&#xA;steven arntson&lt;/p&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-12-03T20:51:33.953" LastActivityDate="2015-12-04T00:24:28.123" Title="Painfully simple org spreadsheet question" Tags="|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18591" PostTypeId="1" CreationDate="2015-12-03T21:52:25.460" Score="3" ViewCount="195" Body="&lt;p&gt;I recently started having an issue. I am unsure as to how long it has existed, but it must have occurred during the past week. Whenever I type Shift-c, Emacs does not interpret it as the character C, but rather the Control command. This acts only in the outline minor mode (regular outline mode is unaffected). I am unsure if this is a component of the mode, or a bug somewhere&lt;/p&gt;&#xA;" OwnerUserId="10062" LastEditorUserId="10062" LastEditDate="2015-12-04T02:08:18.347" LastActivityDate="2016-03-10T19:40:28.447" Title="Shift-c acts as Control in Outline mode" Tags="|key-bindings|outline-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18592" PostTypeId="1" AcceptedAnswerId="18606" CreationDate="2015-12-03T22:01:12.020" Score="3" ViewCount="134" Body="&lt;p&gt;I need to get weblinks from a buffer (http....) and put them into scratch buffer. This code partially works, but the weblinks are&#xA;inserted in the same buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm new at programming.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-weblinks ()&#xA;  &quot;Get weblinks from a buffer&quot;&#xA;  (interactive)&#xA;  (let (p1 p2 url)&#xA;    (while (search-forward &quot;http&quot;)&#xA;      (backward-char 4)&#xA;      (setq p1 (point))&#xA;      (search-forward &quot;jpg&quot;)&#xA;      (setq p2 (point))&#xA;      (setq url (buffer-substring p1 p2))&#xA;      (insert url &quot;\n&quot;)&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I finish the function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="10382" LastEditorUserId="105" LastEditDate="2016-06-22T20:37:16.040" LastActivityDate="2016-06-22T20:37:16.040" Title="How to extract the weblinks?" Tags="|search|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18593" PostTypeId="1" AcceptedAnswerId="18596" CreationDate="2015-12-03T22:38:15.687" Score="1" ViewCount="341" Body="&lt;p&gt;I have a directory which contains directories with many music albums, and I'm doing a selection of songs according a list I found on the Internet. What I'm doing is splitting windows with the destination directory on the left, and the root directory of my music collection on the right. Sadly, I have to manually search for the song among many directories and subdirectories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I was wondering if there was a way to do a recursive search by term and have the results in a dired buffer, enabling me to operate over them as I would normally do in dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea on how to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2015-12-04T00:31:43.733" Title="How to search for files from a root directory and get the results as a dired buffer?" Tags="|dired|search|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18595" PostTypeId="2" ParentId="18590" CreationDate="2015-12-04T00:24:28.123" Score="14" Body="&lt;p&gt;You need 2 things here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;code&gt;vmean&lt;/code&gt; function (stands for &lt;em&gt;vector mean&lt;/em&gt;)&lt;/li&gt;&#xA;&lt;li&gt;The references &lt;code&gt;@I&lt;/code&gt; and &lt;code&gt;@II&lt;/code&gt; which stand for the first and second horizontal lines in the table.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, with the cursor on the draft average cell, type &lt;code&gt;:=vmean(@I..@II)&lt;/code&gt; and then &lt;code&gt;RET&lt;/code&gt;. This will add the formula tag at the bottom of the table and the result in the table. Repeat for the other column.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| item    | draft | final |&#xA;|---------+-------+-------|&#xA;| plot    | 2     | 3     |&#xA;| grammar | 3     | 4     |&#xA;|---------+-------+-------|&#xA;| grade   | 2.5   | 3.5   |&#xA;#+TBLFM: @4$2=vmean(@I..@II)::@4$3=vmean(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you are going to have many columns, you can also have only 1 formula for all columns thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @4$2..@4$&amp;gt;=vmean(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This means that all cells in row 4, from column 2 to the last column (denoted by &lt;code&gt;$&amp;gt;&lt;/code&gt;) will have the same formula. By not including column references in the &lt;code&gt;vmean()&lt;/code&gt; expressions, it automatically refers to the same column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to round your averages to, say, 2 decimal digits, you may add a format modifier:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @4$2..@4$&amp;gt;=vmean(@I..@II);%.2f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, the modifier says to display floating point (fractional) numbers, with 2 digits after the decimal point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation for &lt;a href=&quot;http://orgmode.org/manual/References.html#References&quot;&gt;references&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-04T00:24:28.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18596" PostTypeId="2" ParentId="18593" CreationDate="2015-12-04T00:31:43.733" Score="4" Body="&lt;p&gt;You can use the &lt;code&gt;find-dired&lt;/code&gt;, which runs a standard find command and displays the results in dired format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This command will ask for the directory to search within, and for find-style options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, to find files whose name include &quot;salsa&quot;, use &lt;code&gt;-iname &quot;*salsa*&quot;&lt;/code&gt; as an option.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-04T00:31:43.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18597" PostTypeId="1" AcceptedAnswerId="18603" CreationDate="2015-12-04T03:03:17.990" Score="1" ViewCount="198" Body="&lt;p&gt;I don't know if it is my version problem or not. I am trying to pull --rebase from the current branch (F -r RET). For now, I have to use workaround (r r origin/branch)&lt;/p&gt;&#xA;" OwnerUserId="10384" LastActivityDate="2015-12-29T23:38:00.827" Title="Magit pull --rebase does not work anymore - version 20151203.508" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18598" PostTypeId="1" AcceptedAnswerId="19851" CreationDate="2015-12-04T03:39:02.027" Score="0" ViewCount="3166" Body="&lt;p&gt;My C++ code use third-party library, so I have to add the library path to &lt;code&gt;flycheck-clang-include-path&lt;/code&gt; to avoid can't find header file error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't want &lt;code&gt;flycheck&lt;/code&gt; to do the syntax check on that library. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because it always report warning/error on any file which include header files from that library.&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2016-03-26T20:52:48.157" Title="How to configure flycheck (c/c++-clang) to ignore some files or directories?" Tags="|flycheck|c++|clang|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18600" PostTypeId="1" AcceptedAnswerId="18605" CreationDate="2015-12-04T07:35:45.073" Score="0" ViewCount="271" Body="&lt;p&gt;I'm new into latex, org and latex in org so it may sounds like a total newbie question... I want to preview latex in emacs with org-preview-latex-fragment, I have followed instructions from &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-preview.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and trying to preview this code :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC late :tangle /tmp/example.tex&#xA;\documentclass{article}&#xA;&#xA;\begin{document}&#xA;\[&#xA;e^{i\pi} = -1&#xA;\]&#xA;&#xA;\[&#xA;\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}&#xA;\]&#xA;&#xA;\end{document}&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it fails with a blank square.&#xA;I have checked the log in /tmp and latex has an error but I don't know why :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File: ts1cmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions&#xA;LaTeX Font Info:    ... okay on input line 33.&#xA;&#xA;! LaTeX Error: Can be used only in preamble.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.    &#xA; ...                                              &#xA;&#xA;l.34 \begin{document}&#xA;&#xA;? &#xA;! Emergency stop.&#xA; ...                                              &#xA;&#xA;l.34 \begin{document}&#xA;&#xA;Your command was ignored.&#xA;Type  I &amp;lt;command&amp;gt; &amp;lt;return&amp;gt;  to replace it with another command,&#xA;or  &amp;lt;return&amp;gt;  to continue without it.&#xA;&#xA;&#xA;Here is how much of TeX's memory you used:&#xA; 3089 strings out of 493055&#xA; 35108 string characters out of 6140611&#xA; 80703 words of memory out of 5000000&#xA; 6607 multiletter control sequences out of 15000+600000&#xA; 4509 words of font info for 16 fonts, out of 8000000 for 9000&#xA; 1141 hyphenation exceptions out of 8191&#xA; 27i,1n,26p,236b,50s stack positions out of                     5000i,500n,10000p,200000b,80000s&#xA;No pages of output.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried to compile out of emacs and get the same message, but as it's interactive when I type  it works.&#xA;So why do I get this error and how to make it works within emacs ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps: if you need the full log please tell me, it's just that it is huge and  doesn't work on my google chrome.&lt;/p&gt;&#xA;" OwnerUserId="10306" LastActivityDate="2015-12-04T14:25:40.957" Title="Latex preview fragment - latex error + blank square" Tags="|org-mode|latex|preview-latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18601" PostTypeId="1" AcceptedAnswerId="18604" CreationDate="2015-12-04T08:22:47.807" Score="8" ViewCount="1090" Body="&lt;p&gt;I have several repeating tasks (some with the &quot;habit&quot; style). I like my setup but now I have a lot state changes log just below the not drawers. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO Random Task                                                   :dailies:&#xA;SCHEDULED: &amp;lt;2015-12-03 Thu 13:00 ++1d&amp;gt;&#xA;:PROPERTIES:&#xA;:LAST_REPEAT: [2015-12-02 Wed 16:59]&#xA;:ID:       BA24BAA8-5094-49C9-A014-619C8D98F25E&#xA;:STYLE:    habit&#xA;:RESET_CHECK_BOXES: t&#xA;:CATEGORY: AccordionLearn&#xA;:END:&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2015-12-02 Wed 16:59]&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2015-12-01 Tue 14:16]&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2015-11-27 Fri 18:55]&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2015-11-23 Mon 22:02]&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2015-11-18 Wed 17:02]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is there a way to hide the  Lines:  &lt;code&gt;- State &quot;DONE&quot;       from &quot;TODO&quot;    ...&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="9708" LastActivityDate="2019-12-30T21:47:34.490" Title="Hiding State Changes of Org Mode Repeating Task" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18602" PostTypeId="1" CreationDate="2015-12-04T08:52:34.167" Score="3" ViewCount="246" Body="&lt;p&gt;When I run &lt;code&gt;describe-variable&lt;/code&gt;, then choose something, I often wind up looking at the same variable again later or next session. However, when I do &lt;code&gt;describe-variable&lt;/code&gt; again, the &lt;code&gt;helm&lt;/code&gt; list of variables that pops up is completely random, showing me variables I'll never use. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/CGv4c.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be much more useful to show me a list of my most recently described variables, as &lt;code&gt;recentf&lt;/code&gt; does with files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? I use helm, and I see that &lt;code&gt;helm-adaptive-mode&lt;/code&gt; is on. It would be great to make this work with other commands too, e.g. if &lt;code&gt;load-theme&lt;/code&gt; would show me my most recently (or commonly) used themes instead of showing me a list of themes in random order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related, but didn't help me: &lt;a href=&quot;https://emacs.stackexchange.com/questions/5311/is-there-any-way-to-order-helm-results-by-commonly-used&quot;&gt;Is there any way to order helm results by commonly used?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-12-04T18:52:45.027" Title="how to sort describe-variable completion list by recency (or frequency)?" Tags="|helm|completion|variables|sorting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18603" PostTypeId="2" ParentId="18597" CreationDate="2015-12-04T09:58:12.133" Score="1" Body="&lt;p&gt;Maybe that was just a typo in the question, but to pull while using &lt;code&gt;--rebase&lt;/code&gt;, you have to type &lt;kbd&gt;F - r F&lt;/kbd&gt;, not &lt;kbd&gt;F - r RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: Starting with &lt;code&gt;v2.4&lt;/code&gt; this has changed a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of using the pull popup to rebase, you could also use the dedicated rebase popup. If you do that, then you don't have to explicitly say that you want to rebase instead of merging. That is implied. &lt;kbd&gt;r u&lt;/kbd&gt; would rebase the current branch onto its upstream branch. There are some other rebase variants available. For example you might need &lt;kbd&gt;r e&lt;/kbd&gt;&lt;code&gt;some-other-branch&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt; occasionally. (That second binding was already available in older releases. The first was not.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often it makes more sense to use the rebase popup instead of the pull popup to rebase. &quot;Pull&quot; means to &quot;fetch, and then merge or rebase&quot;. If you use &lt;code&gt;git pull --rebase&lt;/code&gt; instead of &lt;code&gt;git rebase&lt;/code&gt;, then this might bring in additional commits which you have not previously seen. That might, or might not, be an issue, depending on what you expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &quot;one-time rebases&quot; I strongly recommend using the rebase popup. If, for a given branch, you &lt;em&gt;always&lt;/em&gt; rebase instead of merge, then it does make sense to continue to use the pull popup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in that case it is inconvenient to always have explicitly set the &lt;code&gt;--rebase&lt;/code&gt; switch. In older releases it was possible to enable that argument (or any other argument for that matter) by default.(In any popup &lt;kbd&gt;C-x C-s&lt;/kbd&gt; saves the current arguments for later invocations.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is a problem with &lt;code&gt;--rebase&lt;/code&gt; - it affects all branches. So I have replaced it in the push popup with the variable &lt;code&gt;branch.&amp;lt;name&amp;gt;.rebase&lt;/code&gt;. &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt; is the current branch, and setting the value for one branch does not affect other branches. (You don't have to use &lt;kbd&gt;C-x C-s&lt;/kbd&gt; to save variables, just setting the variable is enough.)&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-29T23:38:00.827" LastActivityDate="2015-12-29T23:38:00.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18604" PostTypeId="2" ParentId="18601" CreationDate="2015-12-04T13:58:47.920" Score="9" Body="&lt;p&gt;You can customize &lt;code&gt;org-log-into-drawer&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; rather than &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way, all state changes and notes will be stored into a drawer called &lt;code&gt;LOGBOOK&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can give another name to this drawer if you wish, or you can make this customization for a file only (adding a  &lt;code&gt;#+STARTUP: logdrawer&lt;/code&gt; directive), or inside a heading (by setting the &lt;code&gt;LOG_INTO_DRAWER&lt;/code&gt; property).&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-04T13:58:47.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18605" PostTypeId="2" ParentId="18600" CreationDate="2015-12-04T14:25:40.957" Score="3" Body="&lt;p&gt;Remove the stuff like &lt;code&gt;\documentclass&lt;/code&gt;, &lt;code&gt;\begin{document}&lt;/code&gt; and &lt;code&gt;\end{document}&lt;/code&gt;. This does not belong into an org-document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only keep the formulas.&#xA;The document structure is controlled by org and not by latex.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2015-12-04T14:25:40.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18606" PostTypeId="2" ParentId="18592" CreationDate="2015-12-04T15:20:32.607" Score="2" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun get-weblinks ()&#xA;&quot;Goto the beginning of the current buffer; perform the search and store the links;&#xA;go back to the point of origin; create a new buffer; iterate over the list and insert&#xA;the links into the new buffer; switch to the new buffer; go to the beginning of the&#xA;new buffer.&quot;&#xA;(interactive)&#xA;  (let (url-list)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward &quot;http.+jpg&quot; nil t)&#xA;        (push&#xA;          (buffer-substring-no-properties (match-beginning 0) (match-end 0))&#xA;          url-list)))&#xA;    (with-current-buffer (get-buffer-create &quot;*URL*&quot;)&#xA;      (mapc&#xA;        (lambda (url)&#xA;          (insert url &quot;\n&quot;))&#xA;        url-list))&#xA;    (switch-to-buffer (get-buffer &quot;*URL*&quot;))&#xA;    (goto-char (point-min))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2015-12-04T15:26:49.857" LastActivityDate="2015-12-04T15:26:49.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18607" PostTypeId="1" AcceptedAnswerId="18609" CreationDate="2015-12-04T15:24:11.187" Score="10" ViewCount="1481" Body="&lt;p&gt;I tried to set the foreground color of the cursor face, but it does not seem to work. Setting the background color works fine, but setting the foreground color does not have any effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like Emacs to act in the same way as my terminal. When I move the cursor over the text the foreground color does not change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xow9T.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xow9T.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do the same in Emacs the foreground color becomes white.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7BbIP.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7BbIP.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I stop Emacs inverting the text at the cursor?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2020-03-10T11:56:55.223" Title="How to set the foreground color of the cursor face?" Tags="|faces|cursor|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18608" PostTypeId="1" AcceptedAnswerId="18616" CreationDate="2015-12-04T15:56:00.730" Score="0" ViewCount="508" Body="&lt;p&gt;I'm attempting to modify the formatting of timestamps when they are exported to either HTML or TeX/pdf. I have tried two different ways, neither one of which works. The first way was &lt;a href=&quot;http://endlessparentheses.com/better-time-stamps-in-org-export.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and I put that code in my dotemacs file. However, I get a symbol's value is void error for &lt;code&gt;org-export-filter-timestamp-functions&lt;/code&gt; when I open emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second way I tried, which also does not work is to attempt the example in &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html#Advanced-configuration&quot; rel=&quot;nofollow&quot;&gt;the manual&lt;/a&gt; under &quot;defining filters for individual files.&quot; I copy/pasted the text into the beginning of my org document, but this does not change the formatting of timestamps at all. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BIND: org-export-filter-timestamp-functions (tmp-f-timestamp)&#xA; #+BIND: org-export-filter-strike-through-functions (tmp-f-strike-through)&#xA; #+begin_src emacs-lisp :exports results :results none&#xA;   (defun tmp-f-timestamp (s backend info)&#xA;     (replace-regexp-in-string &quot;&amp;amp;[lg]t;\\|[][]&quot; &quot;&quot; s))&#xA;   (defun tmp-f-strike-through (s backend info) &quot;&quot;)&#xA; #+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="2823" LastEditDate="2015-12-04T22:41:24.020" LastActivityDate="2015-12-04T22:41:24.020" Title="Org export: timestamps not working as expected" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18609" PostTypeId="2" ParentId="18607" CreationDate="2015-12-04T16:06:45.563" Score="6" Body="&lt;p&gt;Nope. &lt;code&gt;M-x customize-option cursor&lt;/code&gt; shows you the doc string:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Basic face for the cursor color under X. Hide&#xA;     Currently, only the &lt;code&gt;:background&lt;/code&gt; attribute is meaningful; all&#xA;     other attributes are ignored.  The cursor foreground color is&#xA;     taken from the background color of the underlying text.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note the last sentence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider filing an enhancement request: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-04T16:06:45.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18610" PostTypeId="2" ParentId="18079" CreationDate="2015-12-04T16:13:34.857" Score="4" Body="&lt;p&gt;I found &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3sjdyi/your_text_editor_is_malware/cxfol83&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; reddit comment, which states that the problem is Emacs built-in TLS doesn't reject bad certificates. It proposes using external TLS like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (fboundp 'gnutls-available-p)&#xA;    (fmakunbound 'gnutls-available-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;NOTE: if you still have issues trying to connect to marmalde repo, it seems to be a different problem. See &lt;a href=&quot;https://github.com/nicferrier/elmarmalade/issues/55&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; github issue.&lt;/p&gt;&#xA;" OwnerUserId="7093" LastActivityDate="2015-12-04T16:13:34.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18611" PostTypeId="2" ParentId="14618" CreationDate="2015-12-04T18:35:07.987" Score="9" Body="&lt;p&gt;Function &lt;code&gt;display-monitor-attributes-list&lt;/code&gt; gives you a list of the physical monitor attributes.  This includes the display &lt;code&gt;name&lt;/code&gt; (e.g., &quot;.DISPLAY1&quot;), which might be all you need. Dunno.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-04T18:35:07.987" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18612" PostTypeId="2" ParentId="18602" CreationDate="2015-12-04T18:52:45.027" Score="1" Body="&lt;p&gt;If you do not get a satisfactory answer for Helm, and if you are not limited to Helm and are open to another solution, you can use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; to do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Sorting_Candidates&quot; rel=&quot;nofollow&quot;&gt;sort completion candidates&lt;/a&gt; in general, not just for &lt;code&gt;describe-variable&lt;/code&gt;, and a few of the sort orders are for recency of use.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-04T18:52:45.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18614" PostTypeId="1" AcceptedAnswerId="18676" CreationDate="2015-12-04T19:25:52.173" Score="0" ViewCount="101" Body="&lt;p&gt;Recently I have started to split my Emacs windows horizontally. However, when I do this, moving the cursor down frequently raises the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;posn-col-row: Wrong type argument: windowp, #&amp;lt;frame buffer/file-name 0x11756e8&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the cursor will be stuck wherever it is. In the example below, as soon as I hit the dollar sign/newline (I have &lt;code&gt;whitespace-mode&lt;/code&gt; enabled to help myself with diagnosis) I can no longer move the cursor down (although I can always move left and right).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Mx7qF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Mx7qF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stranger thing, is that if I have a horizontal split with two windows and the same buffer in each window, then the problem only happens in the window on the right...It seems to only happen when I have &lt;code&gt;visual-line-mode&lt;/code&gt; disabled - but I have disabled it in certain modes precisely because &lt;code&gt;visual-line-mode&lt;/code&gt; seems to do weird things when the window is too narrow, so I would prefer a fix that doesn't involve enabling visual-line-mode. Any suggestions? Thank you!&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This problem was occurring on my work computer, and I just tried to recreate it on my home computer. My configuration is synced through github, so I thought everything was exactly the same, but I just remembered that the version of Emacs I am using at work (the one with the problem) is the one from the Ubuntu repositories, while the one I am using at home (which doesn't seem to have a problem) was compiled from source and is a newer version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Knowing this, I will do some more debugging on Monday when I get back to my work computer, and maybe just get a more recent version of Emacs.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-05T02:49:23.887" LastActivityDate="2015-12-07T21:24:21.863" Title="Cursor getting stuck after splitting windows horizontally" Tags="|window-splitting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18615" PostTypeId="1" CreationDate="2015-12-04T19:48:47.743" Score="0" ViewCount="819" Body="&lt;p&gt;I'm using &lt;code&gt;web-mode&lt;/code&gt; to edit &lt;code&gt;jsx&lt;/code&gt; files and I'm wondering what minor-mode can I use to add folding support. Is there anything out there that works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8586" LastActivityDate="2024-02-27T00:07:30.950" Title="Enable JSX folding in web-mode" Tags="|web-mode|javascript|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18616" PostTypeId="2" ParentId="18608" CreationDate="2015-12-04T20:12:25.657" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;org-export-filter-timestamp-functions&lt;/code&gt; is defined in &lt;code&gt;ox.el&lt;/code&gt;.&#xA;You need to add&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'ox)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in front of the code where you want to use &lt;code&gt;org-export-filter-timestamp-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: My comments above were wrong. (Sorry about that.)&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2015-12-04T20:12:25.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18617" PostTypeId="1" CreationDate="2015-12-04T21:33:18.870" Score="5" ViewCount="304" Body="&lt;p&gt;For a text &quot;naïve&quot;, for example, and the cursor is at &quot;n&quot;, if I press &lt;code&gt;vll&lt;/code&gt;, &quot;naï&quot; is highlighted, but if I press &lt;code&gt;y&lt;/code&gt;, the yanked text is &quot;nai&quot;, not &quot;naï&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make visual selection to include all diacritics/combining characters at the selection ending?&lt;/p&gt;&#xA;" OwnerUserId="10395" LastActivityDate="2016-07-03T17:22:28.710" Title="Emacs evil-mode: how to make visual selection to include diacritics?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18619" PostTypeId="1" AcceptedAnswerId="18620" CreationDate="2015-12-05T16:00:08.700" Score="3" ViewCount="848" Body="&lt;p&gt;On p.33 of the &lt;a href=&quot;http://orgmode.org/orgguide.pdf&quot; rel=&quot;nofollow&quot;&gt;Org-guide&lt;/a&gt; Carsten Dominek writes &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;you can use #+LATEX: and #+BEGIN_LATEX ... #+END_LATEX construct to add verbatim LATEX code&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there a keyboard combination or default snippet that automatically types either of those constructs into the .org file in a similar fashion to &lt;code&gt;&amp;lt;s&lt;/code&gt; followed by &lt;kbd&gt;TAB&lt;/kbd&gt; that adds &lt;code&gt;#+BEGIN_SRC&lt;/code&gt;? (see minute 3:00 in this &lt;a href=&quot;https://youtu.be/lsYdK0C2RvQ?t=180&quot; rel=&quot;nofollow&quot;&gt;youtube tutorial&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="9269" LastActivityDate="2015-12-07T13:20:24.210" Title="Org-mode: any keyboard shortcut for Latex code?" Tags="|yasnippet|keyboard-macros|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18620" PostTypeId="2" ParentId="18619" CreationDate="2015-12-05T16:23:46.060" Score="3" Body="&lt;p&gt;These shortcuts are called &lt;a href=&quot;http://orgmode.org/manual/Easy-Templates.html&quot; rel=&quot;nofollow&quot;&gt;easy templates&lt;/a&gt;. There are defaults for LaTeX lines (&lt;code&gt;&amp;lt;L TAB&lt;/code&gt;) and LaTeX blocks (&lt;code&gt;&amp;lt;l TAB&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can add your own templates by customizing &lt;code&gt;org-structure-template-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-05T16:23:46.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18624" PostTypeId="1" AcceptedAnswerId="18625" CreationDate="2015-12-05T20:27:34.327" Score="5" ViewCount="139" Body="&lt;p&gt;I am a beginner at &lt;code&gt;org-tables&lt;/code&gt;, trying to use them for computing grades in a class I'm teaching. I have a table showing attendance records for a student, resulting in a mean that I'd like to use in a calculation in another table. Is it possible?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: attendance&#xA;| time   | grade            |&#xA;|--------+------------------|&#xA;| week 1 | 1                |&#xA;| week 2 | 0                |&#xA;| week 3 | 1                |&#xA;|--------+------------------|&#xA;| grade  | :=vmean(@I..@-I) |&#xA;&#xA;#+NAME: grades&#xA;| assignment | grade                            |&#xA;|------------+----------------------------------|&#xA;| attendance | [INSERT VMEAN FROM &quot;attendance&quot;] |&#xA;| paper 1    | 2.5                              |&#xA;| paper 2    | 2.5                              |&#xA;|------------+----------------------------------|&#xA;| final grade| :=vmean(@I..@-I)                 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2413" LastEditorUserId="2413" LastEditDate="2015-12-08T17:12:51.117" LastActivityDate="2015-12-11T16:51:22.367" Title="Use Results from Table A in Table B" Tags="|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18625" PostTypeId="2" ParentId="18624" CreationDate="2015-12-05T20:47:59.750" Score="7" Body="&lt;p&gt;At the end of section 3.5.1 of &lt;a href=&quot;http://orgmode.org/manual/References.html#References&quot; rel=&quot;nofollow&quot;&gt;org manual&lt;/a&gt; there's a discussion of &lt;em&gt;remote references&lt;/em&gt;, that's exactly what you're looking for:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You may also reference constants, fields and ranges from a different&#xA;  table, either in the current file or even in a different file.  The&#xA;  syntax is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;remote(NAME-OR-ID,REF)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;where NAME can be the name of a table in the current file as set by a&#xA;  ‘#+NAME: Name’ line before the table. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here, you should simply name your first table and enter a formula using the remote reference in the chosen cell, &lt;code&gt;:=remote(attendance,@5$2)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: attendance&#xA;| time   | grade |&#xA;|--------+-------|&#xA;| week 1 |     1 |&#xA;| week 2 |     4 |&#xA;| week 3 |     2 |&#xA;|--------+-------|&#xA;| grade  |     2 |&#xA;#+TBLFM: @5$2=vmean(@I..@-I)&#xA;&#xA;#+NAME: grades&#xA;| assignment  |     grade |&#xA;|-------------+-----------|&#xA;| attendance  |         2 |&#xA;| paper 1     |       2.5 |&#xA;| paper 2     |       2.5 |&#xA;|-------------+-----------|&#xA;| final grade | 2.3333333 |&#xA;#+TBLFM: @2$2=remote(attendance,@5$2)::@5$2=vmean(@I..@-I)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To update the tables, use &lt;code&gt;M-x org-table-recalculate-buffer-tables&lt;/code&gt; or &lt;code&gt;M-x org-table-iterate-buffer-tables&lt;/code&gt; if you set up complex table dependencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that in this particular case, it's certainly better to use &lt;code&gt;@&amp;gt;$2&lt;/code&gt; (last line, column 2): the &lt;code&gt;@5$2&lt;/code&gt; won't be updated automatically in the 'grades' table if you later add lines to the 'attendance' table. Another, more general, way to avoid this kind of problem is to use &lt;a href=&quot;http://orgmode.org/manual/Advanced-features.html#Advanced-features&quot; rel=&quot;nofollow&quot;&gt;named references&lt;/a&gt;.  Here, we name the cell &lt;code&gt;grade&lt;/code&gt; so that we can reference it as &lt;code&gt;$grade&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: attendance2&#xA;|   | time   | grade |&#xA;|---+--------+-------|&#xA;|   | week 1 |     1 |&#xA;|   | week 2 |     4 |&#xA;|   | week 3 |     1 |&#xA;|---+--------+-------|&#xA;|   | grade  |     2 |&#xA;| ^ |        | grade |&#xA;#+TBLFM: @5$3=vmean(@I..@-I)&#xA;&#xA;#+NAME: grades2&#xA;| assignment  |     grade |&#xA;|-------------+-----------|&#xA;| attendance  |         2 |&#xA;| paper 1     |       2.5 |&#xA;| paper 2     |       2.5 |&#xA;|-------------+-----------|&#xA;| final grade | 2.3333333 |&#xA;#+TBLFM: @2$2=remote(attendance2,$grade)::@5$2=vmean(@I..@-I)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2015-12-11T16:51:22.367" LastActivityDate="2015-12-11T16:51:22.367" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18626" PostTypeId="1" AcceptedAnswerId="18630" CreationDate="2015-12-05T21:24:44.390" Score="3" ViewCount="366" Body="&lt;p&gt;I am currently discovering orgmode and as a math student I want to write my math lessons with this beautiful tool. I love the way LaTeX code can be displayed inline in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if there is a way to preview LaTeX in console mode.&#xA;It sounds like an adventure but I really prefer to run emacs in console mode, and of course I'm brave ! &lt;/p&gt;&#xA;" OwnerUserId="10306" LastActivityDate="2015-12-06T10:15:34.383" Title="Latex fragment in terminal" Tags="|org-mode|term|preview-latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18627" PostTypeId="1" CreationDate="2015-12-05T23:57:59.170" Score="5" ViewCount="1988" Body="&lt;p&gt;I have an org file, where I put a &lt;code&gt;LaTeX&lt;/code&gt; fragment to be rendered in line with &lt;code&gt;C-c C-x C-l&lt;/code&gt;. It is a simple formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\[&#xA; e^{i\pi} = -1&#xA;\]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;MiKTeX&lt;/code&gt; installed, &lt;code&gt;latex&lt;/code&gt; and &lt;code&gt;dvi&lt;/code&gt; commands work from command line in Windows without a problem.&#xA;I also have AUCTeX and preview of the same file (embedded in &lt;code&gt;\begin{document}&lt;/code&gt; and stuff) works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the following message in the &lt;code&gt;messages&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Failed to create dvi file from c:/Users/Michele/AppData/Local/Temp/orgtex6380KuB.tex&#xA;Creating images for entry...done.  Use `C-c C-c' to remove images.&#xA;Cannot find image file `c:/Users/Michele/Documents/ltxpnghome_5e3cd2413a24591c2b9e10c34d704b6effc5776a.png'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What to do next?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to change &lt;code&gt;org-latex-create-formula-image-program&lt;/code&gt; to &lt;code&gt;imagemagick&lt;/code&gt; instead of &lt;code&gt;dvipng&lt;/code&gt; but got no luck. However, during my trials I opened the tex editor of &lt;code&gt;MiKTeX&lt;/code&gt; to do some other, basically unrelated, testing.&#xA;While editor and package manager were open, I went to &lt;code&gt;emacs&lt;/code&gt; and reverted back to &lt;code&gt;dvipng&lt;/code&gt; and tried again &lt;code&gt;C-c C-x C-l&lt;/code&gt;. At this point, I got a series of request to install missing packages!!&#xA;Guess what? When the requests ended (it was quite a few), everything was working fine and previews are now correctly displayed!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to trace back the last packages installed, they should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ulem, marvosym, wasysym, vasy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope this can help in a similar case.&lt;/p&gt;&#xA;" OwnerUserId="9642" LastEditorUserId="9642" LastEditDate="2015-12-06T22:18:11.940" LastActivityDate="2020-08-12T21:07:55.827" Title="Preview Latex Fragment in org mode : blank square shown" Tags="|org-mode|preview-latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18628" PostTypeId="2" ParentId="18010" CreationDate="2015-12-06T00:09:19.163" Score="1" Body="&lt;p&gt;If you want to have the ELPA packages activated already when the init script runs, you should call &lt;code&gt;(package-initialize)&lt;/code&gt; first.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2015-12-06T00:09:19.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18629" PostTypeId="1" CreationDate="2015-12-06T03:33:49.443" Score="0" ViewCount="91" Body="&lt;p&gt;When opening a video file with &lt;a href=&quot;http://elinux.org/Omxplayer&quot; rel=&quot;nofollow&quot;&gt;Omxplayer&lt;/a&gt; through &lt;code&gt;dired&lt;/code&gt; using &lt;code&gt;dired-do-shell-command&lt;/code&gt;, I am unable to send commands to the external program to, for example, pause the video. The file plays fine but all keyboard input gets sent to the buffer from which the file was launched.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This occurs on my &lt;strong&gt;Raspberry Pi&lt;/strong&gt; running &lt;strong&gt;Arch Linux ARM&lt;/strong&gt; on a &lt;em&gt;TTY&lt;/em&gt;. Does anyone have an idea of what I can do to curb this behavior and force &lt;strong&gt;Emacs&lt;/strong&gt; to allow other programs to accept keyboard input?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: To get to my issue, I've ran &lt;code&gt;emacs -q&lt;/code&gt; then &lt;code&gt;C-x d&lt;/code&gt; to open the directory containing a video file. While the file is at point in dired, run &lt;code&gt;dired-do-shell-command&lt;/code&gt; (with &lt;code&gt;!&lt;/code&gt; if you'd like) and type &lt;code&gt;omxplayer RET&lt;/code&gt;. The video plays as normal over &lt;strong&gt;Emacs&lt;/strong&gt; and I expect to be able to pause the video with &lt;code&gt;SPC&lt;/code&gt; or seek with &lt;code&gt;&amp;lt;right&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;left&amp;gt;&lt;/code&gt; but instead of going to &lt;strong&gt;Omxplayer&lt;/strong&gt;, those commands runs in &lt;code&gt;dired&lt;/code&gt;. I'm not sure what else to try. The same process works fine in the &lt;strong&gt;Vim File Manager&lt;/strong&gt; (vifm). It seems &lt;strong&gt;Emacs&lt;/strong&gt; is running the shell command asyncronously even though I've specified for it not too.&lt;/p&gt;&#xA;" OwnerDisplayName="user9688" LastEditorDisplayName="user9688" LastEditDate="2015-12-06T07:07:41.117" LastActivityDate="2015-12-06T07:07:41.117" Title="Unable to Send Commands to Omxplayer from Dired" Tags="|dired|inputs|video|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18630" PostTypeId="2" ParentId="18626" CreationDate="2015-12-06T09:59:43.517" Score="0" Body="&lt;p&gt;The principle of the preview feature is to display images in the buffer (&lt;a href=&quot;http://orgmode.org/manual/Previewing-LaTeX-fragments.html#Previewing-LaTeX-fragments&quot; rel=&quot;nofollow&quot;&gt;doc&lt;/a&gt;). About images, Elisp &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Images.html#Images&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs is usually able to display images when it is run on a graphical&#xA;  terminal.  Images cannot be displayed in a text terminal, on certain&#xA;  graphical terminals that lack the support for this, or if Emacs is&#xA;  compiled without image support.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it seems there's currently no way to do what you want.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2015-12-06T10:15:34.383" LastActivityDate="2015-12-06T10:15:34.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18632" PostTypeId="2" ParentId="18617" CreationDate="2015-12-06T13:17:51.977" Score="1" Body="&lt;p&gt;I can confirm the issue on my machine.  May be a bug, or may simply be a product of encodings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears to be the case that your &quot;naïve&quot; (as transmitted to me through &lt;code&gt;elfeed&lt;/code&gt;) uses a regular &quot;i&quot; with some sort of visual diacritics rather than the unicode &quot;ï&quot;.  You can tell by putting the cursor on your &quot;ï&quot; and running &lt;code&gt;M-x what-cursor-position&lt;/code&gt;, which should return something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Char: i (105, #o151, #x69) point=321 of 343 (93%) column=1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's what you get with &quot;naïve&quot; when you use the &lt;em&gt;unicode&lt;/em&gt; &quot;ï&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Char: ï (239, #o357, #xef, file #xC3 #xAF) point=446 of 449 (99%) column=61&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use unicode, &lt;code&gt;evil&lt;/code&gt; will realize that you're talking about a single character.  So: unicode encoding and entry in probably the most effective way to fix the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The practical step if you can't do that is to move one more point over.  So, for example, &lt;code&gt;vll&lt;/code&gt; visually highlights &quot;naï&quot; but yanking only gets you &quot;nai&quot;.  &lt;code&gt;vlll&lt;/code&gt; visually highlights &quot;naïv&quot; and yanking gets you &quot;naï&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that I've mixed-and-matched the unicode &quot;ï&quot; in here so that the visuals will show up.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-12-06T13:17:51.977" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18634" PostTypeId="1" AcceptedAnswerId="18640" CreationDate="2015-12-06T14:14:25.273" Score="6" ViewCount="882" Body="&lt;p&gt;Having 'org-agenda-files' set, is there a way to display headlines, which does not have any tags?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g 'C-c a' runs 'org-agenda', and then 'M' gives TODO items with specified tag. What if I want TODOs, which does not have any?&lt;/p&gt;&#xA;" OwnerDisplayName="user3984" LastActivityDate="2015-12-06T18:21:46.480" Title="Orgmode: agenda for headlines without any tag" Tags="|org-mode|org-agenda|org-tags|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18635" PostTypeId="2" ParentId="18627" CreationDate="2015-12-06T14:19:49.200" Score="1" Body="&lt;p&gt;I think that you should add one of the following lines to your &lt;code&gt;.emacs&lt;/code&gt; file (or &lt;code&gt;init.el&lt;/code&gt;) :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-create-formula-image-program 'imagemagick)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-create-formula-image-program 'dvipng)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More details and further configuration hints available &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-preview.html#sec-3&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2015-12-06T14:19:49.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18636" PostTypeId="1" CreationDate="2015-12-06T15:07:32.530" Score="2" ViewCount="1402" Body="&lt;p&gt;I'm writing a long research org-mode document that I want to export to both LaTeX, ODT and HTML. The most important export environment is to LaTeX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to specify an environment inside the org-mode document without specifying the language. For instance, I could write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+latex: \begin{acknowledgement}&#xA;...&#xA;#+latex: \end{acknowledgement}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would prefer to write something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_acknowledgement&#xA;..&#xA;#+end_acknowledgement&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2015-12-06T15:07:32.530" Title="Create a custom block in org-mode that exports to latex and html" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18637" PostTypeId="2" ParentId="18634" CreationDate="2015-12-06T15:41:05.440" Score="1" Body="&lt;p&gt;You can do a regexp search on headlines not ending in a colon:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-c a m&lt;/kbd&gt; will prompt for a match query. Type &lt;code&gt;-{:$}&lt;/code&gt; to match headlines not ending in colon. The regular expression goes inside the curly brackets, and the minus sign is for negating the match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this method ignores tag inheritance.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-06T15:41:05.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18638" PostTypeId="1" CreationDate="2015-12-06T17:36:33.700" Score="1" ViewCount="205" Body="&lt;p&gt;I started a new question on this topic yesterday, and deleted it because I thought I had it solved. No, I'm still confused about exactly how &lt;code&gt;require&lt;/code&gt; works. In my situation I have a file &lt;code&gt;calctest.el&lt;/code&gt; in a path that &lt;code&gt;load-path&lt;/code&gt; sees. Here is the simple file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun calctest ()&#xA;  (calc-eval &quot;deg(37@ 26' 36.42\&quot;)&quot;))&#xA;(provide 'calctest)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if I call &lt;code&gt;(require 'calctest)&lt;/code&gt; in the scratch buffer, I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Required feature `calctest' was not provided&quot;. . .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is even after a successful &lt;code&gt;(load-library &quot;calctest&quot;)&lt;/code&gt; and a test to see if it is loaded&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calctest) ==&amp;gt;&#xA;&quot;37.44345&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I do a &lt;code&gt;load-file&lt;/code&gt; on &lt;code&gt;calctest.el&lt;/code&gt;, then do &lt;code&gt;(require 'calctest)&lt;/code&gt; it &quot;sees&quot; it and &quot;loads&quot; it (again?). Why will a &lt;code&gt;require&lt;/code&gt; not simply load my &lt;code&gt;calctest&lt;/code&gt;? What am I missing here?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2015-12-06T23:50:58.430" Title="Confusion with require" Tags="|load-path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18639" PostTypeId="1" AcceptedAnswerId="18648" CreationDate="2015-12-06T18:05:04.320" Score="2" ViewCount="311" Body="&lt;p&gt;If I press shift in insert mode, I can select text using the arrow keys. I want to be able to do the same in normal mode. This is what I got so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;S-&amp;lt;left&amp;gt;&quot;) (lambda () (interactive) (evil-visual-char) (backward-char)))&#xA;(define-key evil-normal-state-map (kbd &quot;S-&amp;lt;right&amp;gt;&quot;) (lambda () (interactive) (evil-visual-char) (forward-char)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works well, except &lt;code&gt;S-&amp;lt;left&amp;gt;&lt;/code&gt; behaves weirdly since pressing it continuously it also extends the selection on the right side, even though the key-binding is only set for the normal mode.&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="600" LastEditDate="2015-12-06T22:08:54.253" LastActivityDate="2015-12-06T22:18:06.943" Title="How can I enter visual mode by holding shift in normal mode in evil?" Tags="|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18640" PostTypeId="2" ParentId="18634" CreationDate="2015-12-06T18:21:46.480" Score="6" Body="&lt;p&gt;You can use a regular expression in a tags search.  A tag search for &lt;code&gt;{.*}&lt;/code&gt; will match any tag and conversely, &lt;code&gt;-{.*}&lt;/code&gt; will no tag.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-12-06T18:21:46.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18641" PostTypeId="1" CreationDate="2015-12-06T18:47:41.537" Score="6" ViewCount="58" Body="&lt;p&gt;When I process emails, 90% of my messages are either deleted or archived. When I get a big backlog, I work through the list marking a batch, then archiving or deleting them (&lt;code&gt;B del&lt;/code&gt; or &lt;code&gt;B m&lt;/code&gt;), and then moving on to the next batch. If I'm in the middle of marking a delete batch, I can't mark a message for archiving, or vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use two different marks in Gnus? It would be great if I could work down my list once, marking each message for either archiving or deletion, and then moving them all at once after I've finished. Is this possible? If not, is there another feature of Gnus that would help with this workflow?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update 23 October 2017&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I've switched to mu4e for email, and it does allow for marking emails for deletion and archiving at the same time, with the actions executed together once you're finished. So if you need that feature, it's there in mu4e. As this might still be useful for Gnus users, I'll leave the question for now.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-10-23T13:02:30.180" LastActivityDate="2017-10-23T13:02:30.180" Title="Multiple process categories for Gnus" Tags="|gnus|email|mu4e|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18642" PostTypeId="2" ParentId="18638" CreationDate="2015-12-06T19:07:16.253" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Why will a require not simply load my calctest? What am I missing here?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Perhaps the &lt;code&gt;path&lt;/code&gt; and a restart. &lt;code&gt;require&lt;/code&gt; works only if the package is in the &lt;code&gt;load-path&lt;/code&gt;. &lt;code&gt;require&lt;/code&gt; also does some filename guessing based on the feature name. Restart &lt;code&gt;Emacs&lt;/code&gt; may be required to trigger the re-loading. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-12-06T19:07:16.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18644" PostTypeId="1" AcceptedAnswerId="20703" CreationDate="2015-12-06T20:23:18.460" Score="5" ViewCount="749" Body="&lt;p&gt;I want to customize how a link is prettified.  Specifically, I want &lt;a href=&quot;https://github.com/jkitchin/org-ref&quot; rel=&quot;noreferrer&quot;&gt;Org-Ref&lt;/a&gt;'s cite links to display the bibiliography key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A cite link looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[[cite:my-bib-key][pg. 2]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default prettified display looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pg. 2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tweak org-mode to get this display instead:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;@my-bib-key: pg. 2&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-03-02T22:13:03.047" Title="Org-mode: customize link display" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18646" PostTypeId="1" AcceptedAnswerId="18652" CreationDate="2015-12-06T21:14:01.430" Score="5" ViewCount="399" Body="&lt;p&gt;Just out of curiosity, why isn't &lt;code&gt;emacs-lisp-mode&lt;/code&gt; derived from &lt;code&gt;lisp-mode&lt;/code&gt;? Instead, both are derived from &lt;code&gt;prog-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that there is a natural hierarchical relationship that should exist. Is the current situation simply a case of historical accident, or is there a good reason that &lt;code&gt;emacs-lisp-mode&lt;/code&gt; should not derived from &lt;code&gt;lisp-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2016-06-22T20:36:49.777" LastActivityDate="2016-06-22T20:36:49.777" Title="Why isn't emacs-lisp-mode derived from lisp-mode?" Tags="|major-mode|derived-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18647" PostTypeId="1" CreationDate="2015-12-06T21:31:07.670" Score="1" ViewCount="308" Body="&lt;p&gt;This has occurred several times now. I will have an Emacs session (24.5.1, OSX UI version installed via homebrew) running for a while when suddenly it no longer seems to understand how to navigate between visible windows.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;other_window&lt;/code&gt; will switch from left-most to right-most window, but not back&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;windmove-right&lt;/code&gt; will work but &lt;code&gt;windmove-left&lt;/code&gt; will say &quot;No window left from selected window&quot; when obviously there is&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Mouse-clicking in a visible window works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what is going on? I see no other error messages displayed anywhere. Restarting emacs restores correct behavior until it breaks again later.&lt;/p&gt;&#xA;" OwnerUserId="62" LastEditorUserId="105" LastEditDate="2015-12-06T23:41:15.950" LastActivityDate="2015-12-06T23:41:15.950" Title="Emacs doesn't understand where the windows are?" Tags="|window|navigation|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18648" PostTypeId="2" ParentId="18639" CreationDate="2015-12-06T22:18:06.943" Score="2" Body="&lt;p&gt;By default, &lt;code&gt;visual&lt;/code&gt; state inherits bindings from &lt;code&gt;normal&lt;/code&gt; state, as long as they do not collide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, this should (and does) work:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;S-&amp;lt;left&amp;gt;&quot;)&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (evil-visual-char)&#xA;    (backward-char)))&#xA;(define-key evil-normal-state-map (kbd &quot;S-&amp;lt;right&amp;gt;&quot;) &#xA;  (lambda ()&#xA;    (interactive)&#xA;    (evil-visual-char)&#xA;    (forward-char)))&#xA;(define-key evil-visual-state-map (kbd &quot;S-&amp;lt;left&amp;gt;&quot;)&#xA;  #'backward-char)&#xA;(define-key evil-visual-state-map (kbd &quot;S-&amp;lt;right&amp;gt;&quot;) &#xA;  #'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-12-06T22:18:06.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18649" PostTypeId="2" ParentId="17206" CreationDate="2015-12-06T23:21:51.140" Score="7" Body="&lt;p&gt;A trick that can work is to edit a variable-width font to adjust the bounding boxes of its characters, effectively making it monospace. There are some caveats:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The exact width depends on which monospace font one wants to use it with.&lt;/li&gt;&#xA;&lt;li&gt;Wide characters will bleed a bit onto neighbouring spaces (though they can be slightly shrunk to mitigate the issue)&lt;/li&gt;&#xA;&lt;li&gt;Kerning will be horrible (not too much of a problem, as it's only a fallback)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With this in mind, I've launched &lt;a href=&quot;https://github.com/cpitclaudel/monospacifier&quot; rel=&quot;noreferrer&quot;&gt;this GitHub project&lt;/a&gt;. It includes pre-generated fonts, and code. Here's a before/after demo:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ODlYq.gif&quot; alt=&quot;Before-after demo&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-12-06T23:21:51.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18650" PostTypeId="2" ParentId="18638" CreationDate="2015-12-06T23:45:45.770" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;But if I do a &lt;code&gt;load-file&lt;/code&gt; on &lt;code&gt;calctest.el&lt;/code&gt;, then do &lt;code&gt;(require 'calctest)&lt;/code&gt; it &quot;sees&quot; it and &quot;loads&quot; it (again?). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, the key point is that it &lt;em&gt;doesn't&lt;/em&gt; load it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you &lt;code&gt;load-file&lt;/code&gt; your calctest.el library, the &lt;code&gt;(provide 'calctest)&lt;/code&gt; form is evaluated and remembered, which in turn satisfies any subsequent call to &lt;code&gt;(require 'calctest)&lt;/code&gt; -- regardless of whether or not it would be able to load that library itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;require&lt;/code&gt; is essentially just a &lt;code&gt;load&lt;/code&gt; wrapper which &lt;em&gt;avoids re-loading&lt;/em&gt; libraries -- it doesn't care (or even know) whether or not they were originally loaded by another call to &lt;code&gt;require&lt;/code&gt;; just whether &lt;code&gt;(provide 'FEATURE)&lt;/code&gt; has been evaluated at some point (in which case it loads nothing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It very much sounds as if your &lt;code&gt;calctest.el&lt;/code&gt; &lt;em&gt;wasn't&lt;/em&gt; in your &lt;code&gt;load-path&lt;/code&gt; when you were originally testing this.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-12-06T23:50:58.430" LastActivityDate="2015-12-06T23:50:58.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18651" PostTypeId="1" CreationDate="2015-12-07T03:03:05.597" Score="5" ViewCount="2458" Body="&lt;p&gt;I want to delete lines with number &lt;code&gt;03,08,13,18,...., 3+5n.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that? Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2015-12-08T22:49:01.187" Title="How can I delete specified lines?" Tags="|deletion|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18652" PostTypeId="2" ParentId="18646" CreationDate="2015-12-07T03:08:56.220" Score="7" Body="&lt;p&gt;Because &lt;code&gt;lisp-mode&lt;/code&gt; is actually meant to be the major mode for Common-Lisp.  Emacs-Lisp and Common-Lisp are closely related but neither is a superset of the other, so they should both derive from the same parent mode but not from each-other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We could probably introduce a &lt;code&gt;lispish-mode&lt;/code&gt; as a parent of all major modes for Lisp-like languages, but I'm not completely sure how much they could/should share (should it accomodate Scheme as well?  Clojure?)&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorDisplayName="user227" LastEditDate="2015-12-07T09:43:33.013" LastActivityDate="2015-12-07T09:43:33.013" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18653" PostTypeId="2" ParentId="18644" CreationDate="2015-12-07T03:45:36.353" Score="2" Body="&lt;p&gt;I have a mostly working version.  Org is pretty clever about how it fontifies&#xA;links.  It just hides the parts of the link when&#xA;&lt;code&gt;org-descriptive-links&lt;/code&gt; is non-nil.  It does this using the&#xA;&lt;code&gt;buffer-invisibility-spec&lt;/code&gt;.  The function that does all the heavy lifting is&#xA;&lt;code&gt;org-activate-bracket-links&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution is remove the &lt;code&gt;invisible&lt;/code&gt; property from the cite-key part of the&#xA;URL by advising &lt;code&gt;org-activate-bracket-links&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:make-org-link-cite-key-visible (&amp;amp;rest _)&#xA;  &quot;Make the org-ref cite link visible in descriptive links.&quot;&#xA;  (when (string-prefix-p &quot;cite:&quot; (match-string 1))&#xA;    (remove-text-properties (+ (length &quot;cite:&quot;) (match-beginning 1))&#xA;                            (match-end 1)&#xA;                            '(invisible))))&#xA;&#xA;(advice-add 'org-activate-bracket-links :after #'my:make-org-link-cite-key-visible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, there's no space between the key and the description so it looks&#xA;like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;my-bib-keypg. 2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll look at using text properties to fix that, but that's a decent bit of complexity.&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2015-12-07T03:45:36.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18655" PostTypeId="1" AcceptedAnswerId="18660" CreationDate="2015-12-07T06:13:19.557" Score="13" ViewCount="5659" Body="&lt;p&gt;Inside the &lt;code&gt;magit&lt;/code&gt; log history, I can see the list of commits. How do I roll back to a specific commit from the list?&lt;/p&gt;&#xA;&lt;p&gt;I can move to that commit and use &lt;code&gt;d&lt;/code&gt; to see the diff/change of that commit, but I do not know how to check it out.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="14825" LastEditDate="2021-10-08T14:20:13.193" LastActivityDate="2021-10-08T14:20:13.193" Title="How to checkout a specific commit inside magit?" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="18656" PostTypeId="1" AcceptedAnswerId="18696" CreationDate="2015-12-07T07:03:01.000" Score="2" ViewCount="986" Body="&lt;p&gt;I am a newbie to emacs and know nothing about lisp.&#xA;I just want to config some features for autocompletion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how I config company-mode now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'company&#xA;  '(add-to-list&#xA;    'company-backends '(company-irony-c-headers company-irony)))&#xA;(eval-after-load 'company&#xA;  '(add-to-list 'company-backends 'company-irony))&#xA;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;(global-set-key &quot;\t&quot; 'company-complete-common)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the auto complete pop up window to be closed when I type any character. For example, I type &quot;ab&quot; and I hit , the auto complete window pop up. I was unable to type any character that is not in the auto complete list. So, I want when I type &quot;c&quot;, the pop-up window close and &quot;c&quot; should be inputted.&lt;/p&gt;&#xA;" OwnerUserId="10417" LastEditorUserId="105" LastEditDate="2016-06-22T20:18:16.420" LastActivityDate="2016-06-22T20:18:16.420" Title="Configure company completion to allow typing non-matching characters" Tags="|company-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18657" PostTypeId="2" ParentId="18651" CreationDate="2015-12-07T09:18:40.790" Score="8" Body="&lt;p&gt;The Swiss army knife of Emacs is called &lt;em&gt;keyboard macros&lt;/em&gt;. See the &lt;a href=&quot;http://www.emacswiki.org/emacs/KeyboardMacros#keyboard_macro&quot; rel=&quot;noreferrer&quot;&gt;Emacs Wiki&lt;/a&gt; and the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter the macro mode, perform the commands of the macro (note: the commands are not only recorded, they are also executed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Save your file for backup!&lt;/li&gt;&#xA;&lt;li&gt;Go to line 3 of your file&lt;/li&gt;&#xA;&lt;li&gt;Enter macro recording mode : &lt;code&gt;C-x (&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Delete this line : &lt;code&gt;M-x kill-whole-line&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Go down 4 times : &lt;kbd&gt;down ↓&lt;/kbd&gt; &lt;kbd&gt;down ↓&lt;/kbd&gt; &lt;kbd&gt;down ↓&lt;/kbd&gt; &lt;kbd&gt;down ↓&lt;/kbd&gt; &lt;/li&gt;&#xA;&lt;li&gt;Close the macro : &lt;code&gt;C-x )&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In case of any error during this process, you have to cancel the macro recording (&lt;code&gt;C-g&lt;/code&gt;), &lt;em&gt;undo&lt;/em&gt; until the file is back to the original state (or reload), then create the macro again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should now be on line 8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To repeat the sequence of commands, do &lt;code&gt;C-x e&lt;/code&gt;. If you don't do anything else and want to repeat again the macro execution, just enter &lt;code&gt;e&lt;/code&gt;, after &lt;code&gt;C-x e&lt;/code&gt; was executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To repeat the macro 3 times, do &lt;code&gt;C-u 3 C-x e&lt;/code&gt;, etc. To repeat the macro until the end of the file is reached (or more generally until an error occurs), do &lt;code&gt;C-u 0 C-x e&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10418" LastEditorUserId="454" LastEditDate="2015-12-08T22:49:01.187" LastActivityDate="2015-12-08T22:49:01.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18658" PostTypeId="2" ParentId="18580" CreationDate="2015-12-07T09:54:38.347" Score="-1" Body="&lt;p&gt;The solution was :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-term &quot;ipython&quot; &quot;/usr/bin/env&quot; nil &quot;ipython3&quot; (or filename &quot;&quot;)&#xA;   &quot;--TerminalIPythonApp.force_interact=True&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10056" LastActivityDate="2015-12-07T09:54:38.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18659" PostTypeId="1" AcceptedAnswerId="18663" CreationDate="2015-12-07T12:12:41.377" Score="2" ViewCount="326" Body="&lt;p&gt;I am new to emacs. I have a visual impairment which necessitates the use of very large font: &lt;code&gt;(set-face-attribute 'default nil :height 700)&lt;/code&gt;. When I open calendar, the third month flows to the next set of lines and meshes with the first month, making it useless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is it possible to display only two months (current and next), or even just show a single month?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="10419" LastEditorUserId="253" LastEditDate="2015-12-07T14:20:08.993" LastActivityDate="2015-12-08T12:12:47.103" Title="Calendar with just 1 month?" Tags="|calendar|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18660" PostTypeId="2" ParentId="18655" CreationDate="2015-12-07T13:07:13.703" Score="15" Body="&lt;p&gt;I like to do this with &lt;kbd&gt;bb&lt;/kbd&gt;. You'll be prompted for a branch with completion, and the current element (e.g. navigate to it with &lt;kbd&gt;ll&lt;/kbd&gt;) will be the default.  Then simply press &lt;kbd&gt;RET&lt;/kbd&gt; to check out that commit.  It's also possible to paste a commit hash during the &lt;kbd&gt;bb&lt;/kbd&gt; input.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-12-07T13:07:13.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18661" PostTypeId="2" ParentId="18619" CreationDate="2015-12-07T13:20:24.210" Score="1" Body="&lt;p&gt;You can make use of this &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow noreferrer&quot;&gt;hydra&lt;/a&gt; code to assist you in entering many Org block templates:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun hot-expand (str)&#xA;  &quot;Expand org template.&quot;&#xA;  (insert str)&#xA;  (org-try-structure-completion))&#xA;(defhydra hydra-org-template (:color blue :hint nil)&#xA;  &quot;&#xA;_c_enter  _q_uote    _L_aTeX:&#xA;_l_atex   _e_xample  _i_ndex:&#xA;_a_scii   _v_erse    _I_NCLUDE:&#xA;_s_rc     ^ ^        _H_TML:&#xA;_h_tml    ^ ^        _A_SCII:&#xA;&quot;&#xA;  (&quot;s&quot; (hot-expand &quot;&amp;lt;s&quot;))&#xA;  (&quot;e&quot; (hot-expand &quot;&amp;lt;e&quot;))&#xA;  (&quot;q&quot; (hot-expand &quot;&amp;lt;q&quot;))&#xA;  (&quot;v&quot; (hot-expand &quot;&amp;lt;v&quot;))&#xA;  (&quot;c&quot; (hot-expand &quot;&amp;lt;c&quot;))&#xA;  (&quot;l&quot; (hot-expand &quot;&amp;lt;l&quot;))&#xA;  (&quot;h&quot; (hot-expand &quot;&amp;lt;h&quot;))&#xA;  (&quot;a&quot; (hot-expand &quot;&amp;lt;a&quot;))&#xA;  (&quot;L&quot; (hot-expand &quot;&amp;lt;L&quot;))&#xA;  (&quot;i&quot; (hot-expand &quot;&amp;lt;i&quot;))&#xA;  (&quot;I&quot; (hot-expand &quot;&amp;lt;I&quot;))&#xA;  (&quot;H&quot; (hot-expand &quot;&amp;lt;H&quot;))&#xA;  (&quot;A&quot; (hot-expand &quot;&amp;lt;A&quot;))&#xA;  (&quot;t&quot; (hot-expand &quot;&amp;lt;t&quot;))&#xA;  (&quot;&amp;lt;&quot; self-insert-command &quot;ins&quot;)&#xA;  (&quot;o&quot; nil &quot;quit&quot;))&#xA;(define-key org-mode-map &quot;&amp;lt;&quot;&#xA;  (defun org-self-insert-or-less ()&#xA;    (interactive)&#xA;    (if (looking-back &quot;^&quot;)&#xA;        (hydra-org-template/body)&#xA;      (self-insert-command 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the hint you'll see in the echo area after pressing &lt;kbd&gt;&amp;lt;&lt;/kbd&gt; from beginning of line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://oremacs.com/download/hydra-org-template.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://oremacs.com/2015/03/07/hydra-org-templates/&quot; rel=&quot;nofollow noreferrer&quot;&gt;See also&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.867" LastActivityDate="2015-12-07T13:20:24.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18662" PostTypeId="2" ParentId="18583" CreationDate="2015-12-07T14:07:07.327" Score="2" Body="&lt;p&gt;My suggestion is to use code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(let ((lst '((&quot;John&quot; . &quot;John Smith&quot;)&#xA;             (&quot;James&quot; . &quot;James Bond&quot;))))&#xA;  (assoc (completing-read &quot;Test&quot; lst) lst))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, &lt;code&gt;lst&lt;/code&gt; is an alist, which is a valid collection type to pass to&#xA;&lt;code&gt;completing-read&lt;/code&gt;.  If you want &lt;code&gt;completing-read&lt;/code&gt; to use Ido, use&#xA;&lt;code&gt;ido-ubiquitous&lt;/code&gt; to set &lt;code&gt;completing-read-function&lt;/code&gt; accordingly.  But&#xA;the code above automatically will adapt to whatever completing mode&#xA;you have (default/helm/ido/ivy).&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-12-07T14:07:07.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18663" PostTypeId="2" ParentId="18659" CreationDate="2015-12-07T14:18:46.600" Score="1" Body="&lt;p&gt;Unfortunately, you can &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Calendar-Customizing.html#Calendar-Customizing&quot; rel=&quot;nofollow&quot;&gt;only display the 3-month calendar&lt;/a&gt; with the built-in &lt;code&gt;calendar-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a work-around that I use is to enable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Line-Truncation.html&quot; rel=&quot;nofollow&quot;&gt;line truncation&lt;/a&gt; so that the extra months flow out of sight across the screen rather than wrap into the next line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add the following to your init file to get that effect:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-calendar-hook ()&#xA;  &quot;Turn line truncation on.&quot;&#xA;  (toggle-truncate-lines 1))&#xA;&#xA;(add-hook 'calendar-mode-hook #'my-calendar-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you would like the current month to be on the left, you can instruct Emacs to scroll one month over when it opens the initial window.  The function in question is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Scroll-Calendar.html#Scroll-Calendar&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;calendar-scroll-left&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get it to run automatically, you need to add it to the relevant hook, so put the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'calendar-initial-window-hook #'calendar-scroll-left)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-12-08T12:12:47.103" LastActivityDate="2015-12-08T12:12:47.103" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18665" PostTypeId="1" CreationDate="2015-12-07T15:48:56.987" Score="1" ViewCount="41" Body="&lt;p&gt;In a &lt;a href=&quot;https://stackoverflow.com/q/34099739/155423&quot;&gt;Stack Overflow question&lt;/a&gt;, another poster wants to write OpenGL shader programs &lt;em&gt;near&lt;/em&gt; to where they are used. However, performance tuning indicates that you should compile these shaders once at the beginning of your program, which means you need access to the shaders in a non-local manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to have some indication to &quot;inline&quot; a view of another file? For example, say I had some raw source pseudocode like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// ~magic~ shader1.txt&#xA;fn my_awesome_method() {&#xA;    // do some things&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When actually viewing this file, I would see the contents of the file &lt;code&gt;shader1.txt&lt;/code&gt; instead of the comment. Ideally, I could even edit it in place, with modifications being written to the original file. In a way, it's kind of like a &quot;live&quot; &lt;code&gt;insert-file&lt;/code&gt;, except it isn't modifying the containing file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way, the shader would actually be non-local, but you can view and edit it in the context that it will be run in.&lt;/p&gt;&#xA;" OwnerUserId="4099" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-12-07T15:48:56.987" Title="Is it possible to display and edit the contents of a linked file?" Tags="|files|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18666" PostTypeId="1" CreationDate="2015-12-07T16:03:46.680" Score="1" ViewCount="489" Body="&lt;p&gt;I've been using Vim for a while and now I've discovered Spacemacs and I found it great how it blends Vim ease of editing with Emacs superior power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really loved some parts of my Vim config, one of them was relative numbering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In oder to have an idea, this is the Vim setup I'm trying to emulate (notice that relative numbering is off since Vim window doesn't have focus when taking the screen grab):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Rm0t9.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;vim setup&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to get the &lt;strong&gt;line numbering right aligned with a separator space&lt;/strong&gt; in Spacemacs was quite complicated. But I'm finding it impossible to do the same for &lt;strong&gt;relative numbering&lt;/strong&gt;. This is my code taken from emacs wiki for right aligned line numbering with a separator space:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (unless window-system&#xA;      (add-hook 'linum-before-numbering-hook&#xA;            (lambda ()&#xA;              (setq-local linum-format-fmt&#xA;                  (let ((w (length (number-to-string&#xA;                            (count-lines (point-min) (point-max))))))&#xA;                    (concat &quot;%&quot; (number-to-string w) &quot;d&quot;))))))&#xA;&#xA;    (defun linum-format-func (line)&#xA;      (concat&#xA;       (propertize (format linum-format-fmt line) 'face 'linum)&#xA;       (propertize &quot; &quot; 'face 'mode-line)))&#xA;&#xA;    (unless window-system&#xA;      (setq linum-format 'linum-format-func))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Any idea on how to achieve the same thing for &lt;strong&gt;linum-relative&lt;/strong&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 1:&lt;/strong&gt;&#xA;I've tried the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defvar my-linum-relative-format-string &quot;%4s&quot;)&#xA;  (defun my-linum-relative-get-format-string ()&#xA;    (let* ((width (length (number-to-string&#xA;                           (count-lines (point-min) (point-max)))))&#xA;           (format (concat &quot;%&quot; (number-to-string width) &quot;s&quot;)))&#xA;      (setq my-linum-relative-format-string format)))&#xA;&#xA;  (setq linum-relative-format 'my-linum-relative-format)&#xA;&#xA;  (defun my-linum-relative-format (line-number)&#xA;       (propertize (format my-linum-relative-format-string line-number) 'face 'linum-relative))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it fails with the error: &lt;code&gt;Error in post-command-hook (linum-update-current): (wrong-type-argument stringp my-linum-relative-format)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10423" LastEditorUserId="10423" LastEditDate="2015-12-07T22:16:44.577" LastActivityDate="2015-12-07T22:16:44.577" Title="Right aligned relative numbering with separator space in Spacemacs using linum-relative" Tags="|evil|spacemacs|linum-mode|line-numbers|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18668" PostTypeId="1" AcceptedAnswerId="18669" CreationDate="2015-12-07T16:47:58.483" Score="0" ViewCount="315" Body="&lt;p&gt;I successfully attach to my java app with emacs &amp;amp; gud, but &lt;code&gt;gud-break&lt;/code&gt; doesn't work as expected: it runs only:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stop at :48&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if the line number is 48. So even the class name is missing and the command fails. If I manually type in the gud prompt &lt;code&gt;stop at &amp;lt;class&amp;gt;:48&lt;/code&gt; that also doesn't work, I must type in the full package name: &lt;code&gt;stop at com.app.Class:48&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make &lt;code&gt;gud&lt;/code&gt; run the correct command? I found about &lt;code&gt;gud-def&lt;/code&gt; but I am baffled that this is not done properly out of the box and secondly, &lt;code&gt;gud-def&lt;/code&gt; allows to insert the file name (class name) but I have no idea how I would insert the package name?&lt;/p&gt;&#xA;" OwnerUserId="2592" LastActivityDate="2015-12-07T17:55:29.390" Title="gud-break doesn't work with jdb" Tags="|spacemacs|java|gud|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18669" PostTypeId="2" ParentId="18668" CreationDate="2015-12-07T17:55:29.390" Score="1" Body="&lt;p&gt;OK I got it... I started &lt;code&gt;jdb&lt;/code&gt; with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;jdb -attach &amp;lt;port&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but starting it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;jdb -attach &amp;lt;port&amp;gt; -sourcepath&amp;lt;source path on disk&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;gud-break&lt;/code&gt; now works as expected.&lt;/p&gt;&#xA;" OwnerUserId="2592" LastActivityDate="2015-12-07T17:55:29.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18670" PostTypeId="1" CreationDate="2015-12-07T18:02:28.097" Score="3" ViewCount="512" Body="&lt;p&gt;In Vim I have relative numbering which is turned on most of the time but it's turned off when in &lt;strong&gt;insert&lt;/strong&gt; mode or when the &lt;strong&gt;window losses focus&lt;/strong&gt; (both when changing to another Vim window or when changing to another tmux window).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How do I set this up in &lt;strong&gt;Spacemacs&lt;/strong&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think my main issue is that I don't know how to make Spacemacs do certain actions only when in certain evil-modes &lt;em&gt;(I'm really new to Emacs, I've been using Vim until I discovered the wonderful Spacemacs)&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10423" LastActivityDate="2015-12-07T18:02:28.097" Title="Turning relative numbering on (with linum-relative) in Spacemacs only when in normal mode" Tags="|evil|spacemacs|linum-mode|line-numbers|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18671" PostTypeId="1" AcceptedAnswerId="18673" CreationDate="2015-12-07T18:11:54.547" Score="3" ViewCount="3266" Body="&lt;p&gt;Is there a way to set the &lt;strong&gt;background color of the line numbering to the same color of the line highlighting background color&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have to put the line numbering background color manually and of course that works really bad when I change my color theme. The code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (custom-set-faces&#xA;      '(linum ((t (:inherit (shadow default) :background &quot;#073642&quot; :foreground &quot;#586e75&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea is to get something like this from my old Vim setup that works consistently across different color themes in Emacs: &lt;a href=&quot;https://i.stack.imgur.com/Rm0t9.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;vim setup&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10423" LastEditorUserId="105" LastEditDate="2016-12-22T17:30:33.593" LastActivityDate="2016-12-22T17:30:33.593" Title="Changing the background of line number column (linum) to the same color of line highlighting background color" Tags="|spacemacs|colors|linum-mode|line-numbers|hl-line-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18672" PostTypeId="1" AcceptedAnswerId="18678" CreationDate="2015-12-07T19:14:52.830" Score="6" ViewCount="1434" Body="&lt;p&gt;I'm using Julia within emacs, and I've found that despite the existence of ess and julia-mode, the best way for me to do that seems to be to use ansi-term and execute:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ipython3 console --kernel=julia-0.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way, I get behavior identical to the IJulia console opened in a regular terminal. Compared to run-julia, I get better shell and help support and will presumably eventually include magic as IJulia matures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To save time, I'd like to make a definition in my .emacs file so that I can write a function and bind a key that opens ansi-term and executes the command above. How would I go about doing that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastActivityDate="2015-12-08T05:34:10.097" Title="How to define a function that calls a console process using ansi-term?" Tags="|ansi-term|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18673" PostTypeId="2" ParentId="18671" CreationDate="2015-12-07T19:31:33.347" Score="1" Body="&lt;p&gt;After some answers I got it.&#xA;The answers in other threads didn't work right away in Spacemacs (I'm really new to Emacs world so I don't know why), but mixing parts of them I managed to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;It's still not perfect. I would prefer to get the color from Emacs theme instead of using the color that &lt;strong&gt;hl-line&lt;/strong&gt; figures out it should use, but I don't understand how to do it.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all for your help!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;&#xA;  (global-linum-mode t)&#xA;  (unless window-system&#xA;    (add-hook 'linum-before-numbering-hook&#xA;              (lambda ()&#xA;                (setq-local linum-format-fmt&#xA;                            (let ((w (length (number-to-string&#xA;                                              (count-lines (point-min) (point-max))))))&#xA;                              (concat &quot;%&quot; (number-to-string w) &quot;d&quot;))))))&#xA;&#xA;  (defface my-linum-hl&#xA;    `((t :inherit linum :background ,(face-background 'hl-line nil t)))&#xA;    &quot;Face for the current line number.&quot;&#xA;    :group 'linum)&#xA;&#xA;  (defun my-linum-format-func (line)&#xA;    (concat&#xA;     ;; (propertize (format linum-format-fmt line) 'face 'linum)&#xA;     (propertize (format linum-format-fmt line) 'face 'my-linum-hl)&#xA;     (propertize &quot; &quot; 'face 'mode-line)))&#xA;&#xA;  (unless window-system&#xA;      (setq linum-format 'my-linum-format-func)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10423" LastActivityDate="2015-12-07T19:31:33.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18674" PostTypeId="1" CreationDate="2015-12-07T20:35:42.217" Score="0" ViewCount="40" Body="&lt;p&gt;I try to use &lt;code&gt;helm-imenu&lt;/code&gt; to construct a custom menu of headings, where the menu&#xA;items are slightly different to what is shown in the headings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have an ordinary org file with some headings&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading 1&#xA;* Heading 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Upon calling to &lt;code&gt;helm-imenu&lt;/code&gt; I will get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Heading 1&#xA;Heading 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, using previous example, how can I achieve a menu with the following&#xA;contents ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+ Heading 1&#xA;+ Heading 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That’s to say, is it possible to alter &lt;code&gt;helm-imenu&lt;/code&gt; (&lt;code&gt;imenu&lt;/code&gt;) default behaviour, so that&#xA;it makes possible to add some text (plus sign, in this example) to the&#xA;extracted headings, without modifying the heading itself ?&lt;/p&gt;&#xA;" OwnerUserId="546" LastEditorUserId="105" LastEditDate="2015-12-07T21:46:55.337" LastActivityDate="2015-12-07T21:46:55.337" Title="Is it possible to include text in the extracted menus in `helm-imenu`?" Tags="|helm|imenu|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18675" PostTypeId="1" CreationDate="2015-12-07T20:41:12.697" Score="1" ViewCount="150" Body="&lt;p&gt;GNU Emacs 24 on El Capitan.  When opening a file whose path includes a directory which is a symlink, Emacs emits the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*ERROR*: Wrong type argument: numberp, &quot;Bus error: 10&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I handle this error, then the file will open but Emacs will hang until it receives a SIGHUP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The path is a volume mounted as a network share from a Linux VM running on the local machine.  It doesn't seem to occur on a local symlink, but I've only done a limited use case test of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not using org-mode, and have tried opening the file in Fundamental mode which results in the same problem of Emacs hanging.  I have started emacs without any .emacs file with the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions would be great.&lt;/p&gt;&#xA;" OwnerUserId="5297" LastEditorUserId="105" LastEditDate="2016-11-12T02:35:33.143" LastActivityDate="2016-11-12T02:35:33.143" Title="Mac OS X problem accessing file via symlink" Tags="|osx|files|symbolic-links|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18676" PostTypeId="2" ParentId="18614" CreationDate="2015-12-07T21:24:21.863" Score="0" Body="&lt;p&gt;I was having this issue on my work computer, and once I got home, I tested it out on my home computer, which uses the same init file. No problems at all! This made things even more confusing for me, until I remembered that I was running an older version (&lt;code&gt;24.4&lt;/code&gt;) on my work computer than on my home computer (running &lt;code&gt;24.5&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I installed Emacs 24.5 on my work computer following the super-easy instructions in the answer to &lt;a href=&quot;https://askubuntu.com/questions/437255/how-to-install-emacs-24-4-on-ubuntu&quot;&gt;this&lt;/a&gt; question. After that, I no longer have this issue, and everything works fine with horizontal and vertical window splits! I am not going to bother submitting a bug report, because it seems to have been fixed in the most recent version of Emacs.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2015-12-07T21:24:21.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18677" PostTypeId="1" AcceptedAnswerId="18682" CreationDate="2015-12-07T22:10:37.360" Score="5" ViewCount="2930" Body="&lt;p&gt;Although I have disable auto-save and auto-backups, the directory &lt;code&gt;auto-save-list&lt;/code&gt; is still autodramatically created in my &lt;code&gt;.emacs.d&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-inhibited t&#xA;      make-backup-files nil&#xA;      auto-save-default nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I prevent it to be created ?&lt;/p&gt;&#xA;" OwnerUserId="10422" LastActivityDate="2015-12-08T07:00:29.753" Title="Prevent auto-save-list directory to be created" Tags="|init-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18678" PostTypeId="2" ParentId="18672" CreationDate="2015-12-07T22:21:06.170" Score="7" Body="&lt;p&gt;This sort of thing?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-foo-console ()&#xA;  &quot;Runs foo in a `term' buffer.&quot;&#xA;  (interactive)&#xA;  (require 'term)&#xA;  (let* ((cmd &quot;foo&quot;)&#xA;         (args &quot;--args for --command&quot;)&#xA;         (switches (split-string-and-unquote args))&#xA;         (termbuf (apply 'make-term &quot;foo console&quot; cmd nil switches)))&#xA;    (set-buffer termbuf)&#xA;    (term-mode)&#xA;    (term-char-mode)&#xA;    (switch-to-buffer termbuf)))&#xA;&#xA;(global-set-key (kbd &quot;C-c s f&quot;) 'my-foo-console)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this is just a slight elaboration on what the &lt;code&gt;term&lt;/code&gt; command does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As another example (one that I use extremely regularly):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-ssh-history nil)&#xA;&#xA;(defun my-ssh (args)&#xA;  &quot;Connect to a remote host by SSH.&quot;&#xA;  (interactive&#xA;   (list (read-from-minibuffer &quot;ssh &quot; nil nil nil 'my-ssh-history)))&#xA;  (let* ((switches (split-string-and-unquote args))&#xA;         (name (concat &quot;ssh &quot; args))&#xA;         (termbuf (apply 'make-term name &quot;ssh&quot; nil switches)))&#xA;    (set-buffer termbuf)&#xA;    (term-mode)&#xA;    (term-char-mode)&#xA;    (switch-to-buffer termbuf)))&#xA;&#xA;(global-set-key (kbd &quot;C-c s h&quot;) 'my-ssh)&#xA;&#xA;(savehist-mode 1) ;; remembers minibuffer histories between sessions&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I use &lt;code&gt;C-c s&lt;/code&gt; as a prefix for all my shell/console type bindings, if you thought that seemed odd.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: It just occurred to me to write this variant for ad-hoc use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-terminal-run-history nil)&#xA;&#xA;(defun my-terminal-run (command &amp;amp;optional name)&#xA;  &quot;Runs COMMAND in a `term' buffer.&quot;&#xA;  (interactive&#xA;   (list (read-from-minibuffer &quot;$ &quot; nil nil nil 'my-terminal-run-history)))&#xA;  (let* ((name (or name command))&#xA;         (switches (split-string-and-unquote command))&#xA;         (command (pop switches))&#xA;         (termbuf (apply 'make-term name command nil switches)))&#xA;    (set-buffer termbuf)&#xA;    (term-mode)&#xA;    (term-char-mode)&#xA;    (switch-to-buffer termbuf)))&#xA;&#xA;(global-set-key (kbd &quot;C-c s c&quot;) 'my-terminal-run)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-12-08T04:59:42.587" LastActivityDate="2015-12-08T04:59:42.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18679" PostTypeId="1" CreationDate="2015-12-07T23:56:34.167" Score="2" ViewCount="189" Body="&lt;p&gt;When using eshell, if I run a command that outputs colored text, sometimes eshell will get 'stuck' in that color. For example if I use &lt;a href=&quot;http://beyondgrep.com/&quot; rel=&quot;nofollow&quot;&gt;ack&lt;/a&gt; and press Ctrl+C before the output finishes this will happen. Is there something I can put in eshell-before-prompt-hook or elsewhere so that it will always close any left over coloring before drawing the prompt?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I've discovered that if I run &quot;clear&quot; (which which says is /usr/bin/clear, not an eshell builtin) the prompt goes bck to normal. Now if I could just automate this ;) I tried running &lt;code&gt;(eshell-command &quot;clear&quot;)&lt;/code&gt; in &lt;code&gt;eshell-before-prompt-hook&lt;/code&gt; but it didn't help.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2015-12-14T19:04:19.000" LastActivityDate="2015-12-14T19:04:19.000" Title="Eshell stuck colors" Tags="|eshell|colors|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18682" PostTypeId="2" ParentId="18677" CreationDate="2015-12-08T04:36:38.160" Score="7" Body="&lt;p&gt;To dereference @lawlist's comment (link to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Auto_002dSaving.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Auto_002dSaving.html&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;User Option: auto-save-list-file-prefix&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;After Emacs reads your init file, it initializes &lt;code&gt;auto-save-list-file-name&lt;/code&gt; (if you have not already set it non-nil)&#xA;  based on this prefix, adding the host name and process ID. If you set&#xA;  this to &lt;code&gt;nil&lt;/code&gt; in your init file, then Emacs does not initialize&#xA;  &lt;code&gt;auto-save-list-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You need to have an equivalent of the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-save-list-file-prefix nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2015-12-08T07:00:29.753" LastActivityDate="2015-12-08T07:00:29.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18683" PostTypeId="2" ParentId="18284" CreationDate="2015-12-08T05:07:49.437" Score="1" Body="&lt;p&gt;The terminfo (and termcap) databases contain information about what escape sequences are used for various functions on a wide variety of terminals. These are keyed off of the name of the terminal you've specified in the TERM variable. I believe that shell and eshell use &lt;code&gt;dumb&lt;/code&gt; while term and ansi-term use &lt;code&gt;eterm-color&lt;/code&gt;. If you've change the value of the TERM variable (in your &lt;code&gt;~/.bashrc&lt;/code&gt; file, for example) to some thing else, then it'll look up the wrong values to use. If TERM is correct then you need to check the contents of your terminfo database, and perhaps compile a new database to add the entry you want.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2015-12-08T05:07:49.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18684" PostTypeId="2" ParentId="18672" CreationDate="2015-12-08T05:34:10.097" Score="1" Body="&lt;p&gt;Here is what I put in my .emacs based on phils' answer, for reference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ijulia-console ()&#xA;  &quot;Runs IJulia in a `term' buffer.&quot;&#xA;  (interactive)&#xA;  (require 'term)&#xA;  (let* ((rawjversion (shell-command-to-string &quot;julia --version&quot;))&#xA;         (jversion (replace-regexp-in-string &quot; version \\([^.]*[.][^.]*\\).*\n$&quot; &quot;-\\1&quot; rawjversion))&#xA;         (cmd &quot;ipython3&quot;)&#xA;         (args (concat &quot;console --kernel=&quot; jversion))&#xA;         (switches (split-string-and-unquote args))&#xA;         (termbuf (apply 'make-term &quot;IJulia Console&quot; cmd nil switches)))&#xA;    (set-buffer termbuf)&#xA;    (term-mode)&#xA;    (term-char-mode)&#xA;    (switch-to-buffer termbuf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code I added asks for the Julia version in order to make sure that the correct Julia kernel is called.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastActivityDate="2015-12-08T05:34:10.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18685" PostTypeId="1" AcceptedAnswerId="18686" CreationDate="2015-12-08T05:38:50.390" Score="5" ViewCount="1990" Body="&lt;p&gt;I'm trying to build a function but having trouble with the regex. Specifically, I want to match capital letters only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function is supposed to capitalize words that are in lowercase (&lt;code&gt;the&lt;/code&gt; → &lt;code&gt;The&lt;/code&gt;) but not touch words that are already in uppercase (like &lt;code&gt;#+STARTUP:&lt;/code&gt; or &lt;code&gt;* TODO&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun capitalize-unless-org-heading ()&#xA;  (interactive)&#xA;(unless &#xA;(or&#xA;(looking-at &quot;\*&quot;)&#xA;(looking-at &quot;[\n\t ]*\\*&quot;) ; don't capitalize an org heading&#xA;(looking-at &quot;* TODO&quot;) ; don't capitalize an org todo heading&#xA;(looking-at &quot;[\n\t\ ]*#+&quot;) ; don't capitalize org options like #+STARTUP:&#xA;(looking-at &quot;[\n\t\ *[A-Z]&quot;) ; don't capitalize any word that might be all uppercase&#xA;)&#xA;(capitalize-word 1))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it matters, &lt;code&gt;case-fold-search&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt; so I can search for text in my buffers without worrying about case. How do I build a regex to search for uppercase letters only? &lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-12-10T15:47:04.063" Title="in Emacs regex, how to search for uppercase letters only?" Tags="|regular-expressions|search|case-folding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18686" PostTypeId="2" ParentId="18685" CreationDate="2015-12-08T07:57:04.503" Score="6" Body="&lt;p&gt;You can temporarily bind &lt;code&gt;case-fold-search&lt;/code&gt; using &lt;code&gt;let&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((case-fold-search nil))&#xA;  (looking-at &quot;[\n\t ]*[A-Z]&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, I changed your regexp for matching whitespace and newlines -- a &lt;code&gt;]&lt;/code&gt; was missing and you don't need the backslash before the space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the corrected code, also incorporating Zorgoth's edits below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun capitalize-unless-org-heading ()&#xA;  (interactive)&#xA;  (unless (or&#xA;            (looking-at &quot;[\n\t ]*\\*&quot;)&#xA;            (let ((case-fold-search nil))&#xA;              (looking-at &quot;[\n\t ]*[A-Z]&quot;)) &#xA;            (looking-at &quot;[\n\t ]*#\\+&quot;)) &#xA;    (capitalize-word 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2015-12-10T15:47:04.063" LastActivityDate="2015-12-10T15:47:04.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18687" PostTypeId="1" CreationDate="2015-12-08T10:58:39.987" Score="13" ViewCount="368" Body="&lt;p&gt;Is it possible for auctex to display missing references differently to ones which are in the bib file? Currently, all references look identical so it's impossible to tell at a glance which citation keys are defined in the bib file, and which are not. Texstudio does this quite nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;book.tex&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{book}&#xA;\usepackage[backend=biber]{biblatex}&#xA;\addbibresource{bib.bib}&#xA;&#xA;\begin{document}&#xA;This reference exists \autocite{ref1}.&#xA;This reference does not \autocite{ref2}.&#xA;% A squiggle, red, anything different to show &quot;ref2&quot; differently to &quot;ref1&quot; would be lovely.&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;book.bib&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@misc{ref1, ...}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10429" LastEditorUserId="13326" LastEditDate="2017-01-30T22:01:08.527" LastActivityDate="2017-08-30T12:09:06.070" Title="Highlighting missing references" Tags="|auctex|highlighting|bibtex|org-ref|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18688" PostTypeId="1" CreationDate="2015-12-08T12:05:40.343" Score="7" ViewCount="1236" Body="&lt;p&gt;I would like to keep a list of terms in an org file, lets say &lt;code&gt;glossary.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* ABC&amp;lt;&amp;lt;&amp;lt;abc&amp;gt;&amp;gt;&amp;gt;&#xA;  other name for alphabet&#xA;* foo&amp;lt;&amp;lt;&amp;lt;foo&amp;gt;&amp;gt;&amp;gt;&#xA;  see bar&#xA;* bar&amp;lt;&amp;lt;&amp;lt;bar&amp;gt;&amp;gt;&amp;gt;&#xA;  see foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now while &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt; would be created as internal links to the radio targets correctly, I want to use this glossary in another org mode file, so that the occurrences are converted in to links to these entries in e.g. a paragraph like this (in &lt;code&gt;somefile.org&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Variables are always called foo and bar.  No exceptions.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to have the words &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt; correctly linked to the entries in &lt;code&gt;glossary.org&lt;/code&gt; (automatically, as described in &lt;a href=&quot;http://orgmode.org/manual/Radio-targets.html&quot; rel=&quot;noreferrer&quot;&gt;the documentation about radio targets&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have these kinds of cross-file radio targets?&#xA;Even more convenient would be not to have to tag every headline in &lt;code&gt;glossary.org&lt;/code&gt; as being a radio target, since all entries in that file are possible radio targets.&lt;/p&gt;&#xA;" OwnerUserId="9481" LastEditorUserId="9481" LastEditDate="2015-12-08T13:40:39.877" LastActivityDate="2017-05-09T14:16:51.803" Title="Radio targets in external org mode file, for glossary application" Tags="|org-mode|hyperlinks|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18690" PostTypeId="1" AcceptedAnswerId="18693" CreationDate="2015-12-08T12:37:55.520" Score="0" ViewCount="54" Body="&lt;p&gt;I'm using the Anaconda distribution for Numpy, Ipython etc. and during the installation the following was added to my .bashrc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# added by Anaconda2 2.4.0 installer&#xA;export PATH=&quot;/home/matthias/anaconda2/bin:$PATH&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I run M-x shell in emacs &quot;ipython bla.py&quot; works perfectly fine. However, when I run M-x compile and then enter &quot;ipython bla.py&quot; it will say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ipython bla.py&#xA;/bin/bash: ipython: Kommando nicht gefunden.&#xA;&#xA;Compilation exited abnormally with code 127 at Tue Dec  8 13:35:59&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I tell emacs about my anaconda installation, like I did in .bashrc?&lt;/p&gt;&#xA;" OwnerUserId="9653" LastActivityDate="2015-12-08T13:44:21.853" Title="Exports in compile command" Tags="|shell|compilation|environment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18691" PostTypeId="1" AcceptedAnswerId="18916" CreationDate="2015-12-08T13:11:06.023" Score="2" ViewCount="478" Body="&lt;p&gt;I am having a large org-mode file and would like to export to HTML only a particular subtree. So I narrow to that subtree using &lt;code&gt;M-x org-narrow-to-subtree&lt;/code&gt; and then export to HTML with &lt;code&gt;C-c C-e h h&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the export fails since some references can no longer be resolved (as they point to other parts of the tree), so I simply get a message like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unable to resolve ID &quot;mpm-2015-09-02&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The message appears in the mini-buffer and then the export fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to export the entire document (without narrowing) I succeed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to instruct org-mode to just export the text of the link instead of failing?&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2015-12-17T09:44:12.953" Title="exporting when narrowed to subtree fails due to unresolved references" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18692" PostTypeId="1" CreationDate="2015-12-08T13:18:01.203" Score="1" ViewCount="76" Body="&lt;p&gt;I'm trying to get &lt;code&gt;git-gutter-fringe+&lt;/code&gt; working under emacs 24.5.5 on OS X, but I'm having some trouble. In general, it works fine upon install, but on subsequent restarts the package is not loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;req-package&lt;/code&gt; to manage package installation and init, and my config for &lt;code&gt;git-gutter-fringe+&lt;/code&gt; is (currently) as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.milkbox.net/packages/&quot;) t)&#xA;(add-to-list 'package-archives '(&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;) t)&#xA;(add-to-list 'package-archives '(&quot;gnu&quot; . &quot;https://elpa.gnu.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;&#xA;(unless (package-installed-p 'el-get)&#xA;  (package-install 'el-get))&#xA;(unless (package-installed-p 'req-package)&#xA;  (package-install 'req-package))&#xA;(package-initialize)&#xA;(require 'req-package)&#xA;&#xA;;; ...other packages and config...&#xA;&#xA;(req-package git-gutter-fringe+&#xA;             :requires (fringe-helper)&#xA;             :init&#xA;             (progn&#xA;               (global-git-gutter-mode)&#xA;               (git-gutter-fr+-minimal)&#xA;               (setq-default left-fringe-width  16)&#xA;               (setq-default right-fringe-width 16)&#xA;               ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried variations on this, including simply:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(req-package git-gutter-fringe+&#xA;             :init (git-gutter-fr+-minimal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but after the initial install and load, it fails to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've had a look at the package's files under &lt;code&gt;~/.emacs.d/elpa/&lt;/code&gt; and I can see that the &lt;code&gt;git-gutter-fringe+-autoloads.el&lt;/code&gt; file looks mostly commented out:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; git-gutter-fringe+-autoloads.el --- automatically extracted autoloads&#xA;;;&#xA;;;; Code:&#xA;(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))&#xA;&#xA;&#xA;;;;### (autoloads nil nil (&quot;git-gutter-fringe+.el&quot;) (22118 3236 355828&#xA;;;;;;;  0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this to be expected? How can I diagnose the issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, I've had the same issue previously with the &lt;code&gt;alchemist&lt;/code&gt; package, though since uninstalling/reinstalling a few times, it's since been pretty stable.&lt;/p&gt;&#xA;" OwnerUserId="10430" LastEditorUserId="10430" LastEditDate="2015-12-10T19:53:29.700" LastActivityDate="2015-12-10T19:53:29.700" Title="Packages only working &quot;once&quot; after install" Tags="|package|use-package|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18693" PostTypeId="2" ParentId="18690" CreationDate="2015-12-08T13:44:21.853" Score="1" Body="&lt;p&gt;You should move &lt;code&gt;$PATH&lt;/code&gt; to &lt;code&gt;~/.profile&lt;/code&gt;.  &lt;code&gt;.bashrc&lt;/code&gt; is only for interactive sessions; variables in this file do &lt;em&gt;not&lt;/em&gt; propagate to GUI applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you moved the setting, restart your system, and Emacs should see your new &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-12-08T13:44:21.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18695" PostTypeId="1" CreationDate="2015-12-08T15:51:37.593" Score="1" ViewCount="354" Body="&lt;p&gt;When inside a python source code block in an .org file, I get the following error displayed on my mini buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eldoc error: &#xA;(wrong-type-argument symbolp #[128 \300\301&quot;\206�\300\302&quot;\207 &#xA;[apply python-eldoc-function #[128 \301\302\300!&quot;\207 &#xA;[eldoc-documentation-function apply default-value] 4 &#xA;(fn &amp;amp;rest ARGS)] nil] 4 nil])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Has anyone ever come across this problem? &#xA;I am running the latest org-mode under Emacs 25 on a OS X 10.11.1, and I use the anaconda python 2.7 distribution.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2015-12-08T15:51:37.593" Title="Org-mode and python source code block -&gt; ElDoc error wrong-type-argument" Tags="|org-mode|org-babel|eldoc|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18696" PostTypeId="2" ParentId="18656" CreationDate="2015-12-08T16:11:06.197" Score="3" Body="&lt;p&gt;Try adding this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-require-match nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This tells company not to require what you type to match a completion candidate. If you start completion you should then be able to type something that doesn't match to cancel the completion and keep typing normally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can use a &lt;code&gt;progn&lt;/code&gt; to perform multiple steps within a single &lt;code&gt;eval-after-load&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'company&#xA;    '(progn&#xA;        (add-to-list 'company-backends ....)&#xA;        (add-to-list 'company-backends ....)&#xA;        (setq company-require-match nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2015-12-08T16:11:06.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18697" PostTypeId="1" AcceptedAnswerId="18729" CreationDate="2015-12-08T16:26:08.913" Score="0" ViewCount="147" Body="&lt;p&gt;Pretty simple xml file with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&#xA;&amp;lt;!DOCTYPE book PUBLIC &quot;-//OASIS//DTD DocBook XML V4.4//EN&quot;&#xA;                      &quot;../../../../tools/docbook-dtd-4.4b2/docbookx.dtd&quot;&#xA;[&#xA;&amp;lt;!ENTITY % vers   SYSTEM &quot;../../../../doc_developer/version.xml&quot;&amp;gt;&#xA;%vers;&#xA;]&amp;gt;&#xA;&#xA;&amp;lt;book&amp;gt;&#xA;&#xA;  &amp;lt;bookinfo&amp;gt;&#xA;    &amp;lt;title&amp;gt;SuperDuper Product Test High-Level Requirements&amp;lt;/title&amp;gt;&#xA;    &amp;lt;subtitle&amp;gt;Release &amp;amp;superduper_prod_dot_version;&amp;lt;/subtitle&amp;gt;&#xA;    &amp;lt;pubdate&amp;gt;&amp;amp;superduper_prod_date;&amp;lt;/pubdate&amp;gt;&#xA;    &amp;lt;xi:include xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; href=&quot;../../../../doc_developer/copyright/copyright.xml&quot; /&amp;gt;&#xA;  &amp;lt;/bookinfo&amp;gt;&#xA;&#xA;  &amp;lt;xi:include xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; href=&quot;high_level_requirements_intro.xml&quot; /&amp;gt;&#xA;  &amp;lt;xi:include xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; href=&quot;reqs_refs_docbook.xml&quot; /&amp;gt;&#xA;  &amp;lt;xi:include xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; href=&quot;high_level_requirements_context.xml&quot; /&amp;gt;&#xA;  &amp;lt;xi:include xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; href=&quot;reqs_content_docbook.xml&quot; /&amp;gt;&#xA;  &amp;lt;xi:include xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot; href=&quot;high_level_requirements_guidelines.xml&quot; /&amp;gt;&#xA;&#xA;&amp;lt;/book&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs (or nxml?) selects&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;uri resource=&quot;high_level_requirements.xml&quot; uri=&quot;../../../../../../../../../../Program Files/Emacs/emacs-24.3/etc/schema/docbook.rnc&quot;/&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as the schema; attempts to use  &quot;XML&quot; -&gt; &quot;Set Schema&quot; -&gt; &quot;File...&quot; to the cited docbookx.dtd fail (&quot;No schema loader available for file extenson 'dtd'&quot;) M-x rng-set-vacuous-schema finds the xi:include acceptable. The cited version.xml defines the superduper_prod_dot_version and superduper_prod_date (xlst generates an html file with no problems from this file; fop is unhappy.)&lt;/p&gt;&#xA;" OwnerUserId="9131" LastActivityDate="2016-02-07T13:59:13.750" Title="What should I do to get xi:include to be recognised and my specified dtd file used?" Tags="|nxml|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18698" PostTypeId="1" CreationDate="2015-12-08T17:13:26.673" Score="4" ViewCount="387" Body="&lt;p&gt;I'm using helm with projectile and trying to exclude various files from the output that are project specific (i.e with &lt;code&gt;.projectile&lt;/code&gt; files, not &lt;code&gt;globally&lt;/code&gt; variable). The problem is that it never works for me, e.g in my &lt;code&gt;.emacs.d&lt;/code&gt; folder i have a &lt;code&gt;.cask&lt;/code&gt; folder, so i'm adding the following line to the &lt;code&gt;.projectile&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-/.cask&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This invalidates my projectile cache and everything is clean, but if i open any file under &lt;code&gt;.cask&lt;/code&gt; directory, it's added to the cache and i can see the file in &lt;code&gt;helm-projectile&lt;/code&gt; output. Maybe i understand the guide incorrectly, but adding &lt;code&gt;-/.cask&lt;/code&gt; to the &lt;code&gt;.projectile&lt;/code&gt; file i expect it to ignore any file under this project root path.&lt;/p&gt;&#xA;" OwnerUserId="2361" LastActivityDate="2015-12-08T17:13:26.673" Title="Helm-projectile doesn't ignore files" Tags="|projectile|helm-projectile|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18699" PostTypeId="2" ParentId="18651" CreationDate="2015-12-08T17:57:45.293" Score="0" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-3+5n-lines ()&#xA;  &quot;Delete the 3+5n linum lines in current buffer.&quot;&#xA;  (interactive)&#xA;  (let* ((lines (split-string (buffer-string) &quot;\n&quot;))&#xA;         (max-linum (length lines))&#xA;         (3+5n-linums&#xA;          (cl-loop for x from 0&#xA;                   for y = (+ 3 (* 5 x))&#xA;                   until (&amp;gt; y max-linum)&#xA;                   collect y)))&#xA;    (erase-buffer)&#xA;    (insert&#xA;     (mapconcat&#xA;      #'identity&#xA;      (cl-loop for x from 1 to max-linum&#xA;               unless (memq x 3+5n-linums)&#xA;               collect (elt lines (1- x)))&#xA;      &quot;\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-12-08T17:57:45.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18700" PostTypeId="2" ParentId="18685" CreationDate="2015-12-08T18:05:22.447" Score="2" Body="&lt;p&gt;Be aware that there are some mistakes in that code. I don't know if \* means anything at all in this context (\\* does). You also need to escape + with two backslashes as that has a meaning in emacs regexps. And there is a * at the beginning of a string that I presume was intended to be after a space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from that, the answer above answers the main question you had.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wanted a more general way of getting to the next word for other purposes you could use [^A-Za-z]* to see past all non-letters.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastEditorUserId="10424" LastEditDate="2015-12-08T18:22:13.633" LastActivityDate="2015-12-08T18:22:13.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18701" PostTypeId="2" ParentId="18651" CreationDate="2015-12-08T18:58:48.080" Score="1" Body="&lt;p&gt;If the user wishes to also delete the &lt;code&gt;\n&lt;/code&gt; at the end of the line, then just change &lt;code&gt;(line-end-position)&lt;/code&gt; to &lt;code&gt;(1+ (line-end-position))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-line-number (line)&#xA;&quot;Doc-string.&quot;&#xA;  (save-excursion&#xA;    (goto-line line)&#xA;    (delete-region (line-beginning-position) (line-end-position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-12-08T18:58:48.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18702" PostTypeId="1" AcceptedAnswerId="18703" CreationDate="2015-12-08T19:01:51.333" Score="1" ViewCount="144" Body="&lt;p&gt;Alignment is not working for me on my Windows machine, but it is on my Centos machine.  I want to understand why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first noticed the problem when I turned on &lt;code&gt;linum-mode&lt;/code&gt;.  Here's what it looks like in Centos:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hIeMK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hIeMK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in Windows, it looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/y6Gp2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y6Gp2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, I tried to follow &lt;a href=&quot;https://emacs.stackexchange.com/questions/2644/understanding-of-emacs-align-regexp&quot;&gt;Understanding of emacs align-regexp&lt;/a&gt;, and the following is what I got.  In Centos:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Go4IR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Go4IR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in Windows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LPbmZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LPbmZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is wrong with my alignment in Windows?  How can I fix it?&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-12-08T19:39:16.027" Title="Alignment not working on one machine, but working on others?" Tags="|microsoft-windows|align|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18703" PostTypeId="2" ParentId="18702" CreationDate="2015-12-08T19:35:38.347" Score="5" Body="&lt;p&gt;Judging from your screenshots, you are using a &lt;a href=&quot;https://en.wikipedia.org/wiki/Monospaced_font&quot;&gt;monospaced font&lt;/a&gt; in centos, but a &lt;a href=&quot;https://en.wikipedia.org/wiki/Typeface#Proportion&quot;&gt;proportional/variable-width font&lt;/a&gt; in Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't looked at the source code, but I suspect that the alignment functions are based on the number of characters in the line and &lt;em&gt;not&lt;/em&gt; the width of each, individual character.  As such, they will line up visually with no problems when you use a monospaced font (because the width is constant), but in general, we would &lt;em&gt;not&lt;/em&gt; expect them to line up visually with a variable-width font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting your default font on your Windows machine to use a monospaced font should take care of the visual alignment problems.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-12-08T19:35:38.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18704" PostTypeId="1" CreationDate="2015-12-08T19:38:02.937" Score="1" ViewCount="699" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/14543064/elisp-factorial-calculation-gives-incorrect-result&quot;&gt;This&lt;/a&gt; discussion got me investigating Calc programming with elisp, especially at the bottom this code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmath myFact (n)&#xA; (format-number (calcFunc-fact n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calcFunc-myFact 33)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yields &lt;code&gt;8683317618811886495518194401280000000&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...all of which works nicely from my &lt;code&gt;*scratch*&lt;/code&gt;. However, I would like &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/calc/Vector-Lisp-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;these&lt;/a&gt; functions to work, but they don't seem to. The docs say many confusing things, such as prepending &lt;code&gt;calcFunc-&lt;/code&gt; and &lt;code&gt;math-&lt;/code&gt;. Also I've tried &lt;code&gt;(require 'calc-ext)&lt;/code&gt; and tried running &lt;code&gt;(calc-extensions)&lt;/code&gt;. All of attempts to use these vector functions return &lt;code&gt;void function&lt;/code&gt; errors. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-06-22T20:17:27.730" Title="How to use Calc vector functions" Tags="|calc|" AnswerCount="2" CommentCount="6" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18705" PostTypeId="1" CreationDate="2015-12-08T19:39:19.907" Score="2" ViewCount="327" Body="&lt;p&gt;I have this in my .init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist&#xA;      `((&quot;.*&quot; . &quot;~/.saves&quot;)))&#xA;(setq auto-save-file-name-transforms&#xA;      `((&quot;.*&quot; &quot;~/.saves&quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet I am still getting random backup files in both the working directory and my home directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this? Is there another setting I'm missing?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2015-12-10T14:06:38.353" Title="Temporary Files Still Appearing in Current Dir" Tags="|auto-save|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18706" PostTypeId="2" ParentId="17244" CreationDate="2015-12-08T19:42:50.097" Score="9" Body="&lt;h3&gt;This is the expected behavior.&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A list ends whenever every item has ended, which means before any line less or equally indented than items at top level. It also ends before two blank lines. In that case, all items are closed.&lt;sup&gt;&lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html#fnd-5&quot; rel=&quot;noreferrer&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;When switching between the different kinds of &lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html&quot; rel=&quot;noreferrer&quot;&gt;plain lists&lt;/a&gt;, i.e. unordered, ordered and description, &lt;code&gt;org-mode&lt;/code&gt; will need the end of each list to be clearly defined.&lt;/p&gt;&#xA;&lt;p&gt;In your example&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;    - item1 :: item1 description bla bla bla&#xA;    - item2&#xA;    - item3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;the list begins as a &lt;strong&gt;description list&lt;/strong&gt; and immediately transitions into an &lt;strong&gt;unordered list&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;To switch between types provide a clear ending to each type of list:&lt;/p&gt;&#xA;&lt;h3&gt;Option 1 - Indent description list under an empty unordered list.&lt;/h3&gt;&#xA;&lt;pre&gt;&lt;code&gt;    -&#xA;      - item1 :: item1 description bla bla bla&#xA;    - item2&#xA;    - item3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;exports to html as&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;ul class=&amp;quot;org-ul&amp;quot;&amp;gt;&#xA;        &amp;lt;li&amp;gt;&amp;lt;dl class=&amp;quot;org-dl&amp;quot;&amp;gt;&#xA;                &amp;lt;dt&amp;gt; item1 &amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;item1 description bla bla bla&#xA;                &amp;lt;/dd&amp;gt;&#xA;            &amp;lt;/dl&amp;gt;&#xA;        &amp;lt;/li&amp;gt;&#xA;        &amp;lt;li&amp;gt;item2&#xA;        &amp;lt;/li&amp;gt;&#xA;        &amp;lt;li&amp;gt;item3&#xA;        &amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And will render like this&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;item1&lt;/strong&gt;&lt;br /&gt;&#xA;item1 description bla bla bla&lt;/li&gt;&#xA;&lt;li&gt;item2&lt;/li&gt;&#xA;&lt;li&gt;item3&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;I recommend this option 1&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Option 2 - Create 2 lists by adding 2 blank lines after description list.&lt;/h3&gt;&#xA;&lt;pre&gt;&lt;code&gt; - item1 :: item1 description bla bla bla&#xA;&#xA;&#xA; - item2&#xA; - item3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;will export to html as&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;dl class=&amp;quot;org-dl&amp;quot;&amp;gt;&#xA;        &amp;lt;dt&amp;gt; item1 &amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;item1 description bla bla bla&#xA;                        &amp;lt;/dd&amp;gt;&#xA;&amp;lt;/dl&amp;gt;&#xA;&#xA;&#xA;&amp;lt;ul class=&amp;quot;org-ul&amp;quot;&amp;gt;&#xA;        &amp;lt;li&amp;gt;item2&#xA;        &amp;lt;/li&amp;gt;&#xA;        &amp;lt;li&amp;gt;item3&#xA;        &amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And will render like this&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;item1&lt;/strong&gt;&lt;br /&gt;&#xA;item1 description bla bla bla&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;item2&lt;/li&gt;&#xA;&lt;li&gt;item3&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This answer was tested using&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;GNU Emacs 24.4.1 (x86_64-unknown-cygwin)&lt;br /&gt;&#xA;of 2014-11-14&lt;/p&gt;&#xA;&lt;p&gt;org-version: 8.2.10&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-12-12T20:35:45.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18707" PostTypeId="1" AcceptedAnswerId="18715" CreationDate="2015-12-08T19:54:14.223" Score="4" ViewCount="123" Body="&lt;p&gt;I use a standard org-mode table to store a lot of my own personal data. However, the tables have gotten quite large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a way to have the top row stay visible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I set this with &lt;code&gt;header-line-format&lt;/code&gt; or something similar?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2016-05-01T18:36:01.030" Title="Possible to Set a Frozen Row in Org-Mode Table?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18709" PostTypeId="1" AcceptedAnswerId="18732" CreationDate="2015-12-08T20:45:47.043" Score="2" ViewCount="362" Body="&lt;p&gt;I often use &lt;code&gt;helm-lisp-completion-at-point&lt;/code&gt; to &quot;search&quot; for elisp symbol names. The problem for me is that if I start the completion with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(line|&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it filters the completion candidates to symbols &lt;strong&gt;beginning&lt;/strong&gt; with &quot;line&quot;. But sometimes I guessed wrong and the symbol does not begin with &quot;line&quot;. When I delete the helm input line it will only show the candidates starting with &quot;line&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I always get the full list of completion candidates?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2015-12-14T11:18:57.797" LastActivityDate="2015-12-14T11:18:57.797" Title="Get complete list of symbols in helm-lisp-completion-at-point?" Tags="|helm|completion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18710" PostTypeId="1" AcceptedAnswerId="27424" CreationDate="2015-12-08T20:58:29.367" Score="3" ViewCount="1099" Body="&lt;p&gt;I've read through all the questions here, and searched extensively online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I've started using org-drill, I have a lot of scheduled tasks with the tag &lt;code&gt;:drill:&lt;/code&gt;. Instead of having all these tasks show up in my agenda, I just want to show something like &lt;code&gt;Org-Drill: 42 cards today.&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ripped this off org-effectiveness:&#xA;&lt;code&gt;&#xA;(defun drill-card-count()&#xA;  &quot;Print a message with the number of todo tasks in the current buffer&quot;&#xA;  (interactive)&#xA;  (save-excursion &#xA;    (goto-char (point-min))&#xA;    (message &quot;Number of cards: %d&quot; (count-matches &quot;:drill:&quot;))))&#xA;&lt;/code&gt;&#xA;I can run this in my agenda but of course it doesn't do what I'd like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, I'd like to:&#xA;1. Filter any tasks tagged &lt;code&gt;drill&lt;/code&gt; from my agenda.&#xA;2. Display instead the count of those tagged tasks.&#xA;3. Otherwise display the agenda as normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ETA:&#xA;Lawlist's comment below is helpful. I've added this, and it hides the tasks tagged &lt;code&gt;:drill:&lt;/code&gt;, but doesn't count them. So, 1 and 3 accomplished, but don't know how to insert a task showing the drill items count.&#xA;&lt;code&gt;&#xA;(defun my-skip-tag(tag)&#xA;    &quot;Skip entries that are tagged TAG&quot;&#xA;    (let* ((entry-tags (org-get-tags-at (point))))&#xA;      (if (member tag entry-tags)&#xA;          (progn (outline-next-heading) (point))&#xA;        nil)))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(setq org-agenda-custom-commands&#xA;      '((&quot;x&quot; &quot;again&quot; &#xA;     ((agenda &quot;&quot; &#xA;          ((org-agenda-overriding-header (drill-card-count))&#xA;           (org-agenda-skip-function '(my-skip-tag &quot;drill&quot;))))))))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10434" LastEditorUserId="10434" LastEditDate="2015-12-08T21:56:00.967" LastActivityDate="2021-04-06T18:05:45.527" Title="Display count of tasks in agenda, instead of tasks, based on tag" Tags="|org-mode|org-agenda|org-drill|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18712" PostTypeId="2" ParentId="18651" CreationDate="2015-12-08T21:41:15.417" Score="3" Body="&lt;p&gt;The following function (briefly tested) will allow you to delete lines with a starting value and a step value:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-some-lines (&amp;amp;optional start step)&#xA;  &quot;Delete lines starting with START at STEP intervals.&quot;&#xA;  (interactive)&#xA;  (let ((lines (list (or start&#xA;                         (string-to-number (read-string &quot;Starting line: &quot;)))))&#xA;        (step  (or step (string-to-number (read-string &quot;Skipping: &quot;))))&#xA;        (last  (line-number-at-pos (point-max))))&#xA;    (while (&amp;lt;= (+ step (car lines)) last)&#xA;      (push (+ step (car lines)) lines))&#xA;    (save-excursion&#xA;      (cl-dolist (line lines)&#xA;        (goto-line line)&#xA;        (delete-region (point-at-bol)&#xA;                       (min (1+ (point-at-eol)) (point-max)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that it doesn't do any error checking.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-12-08T21:41:15.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18713" PostTypeId="2" ParentId="9504" CreationDate="2015-12-08T22:11:42.200" Score="0" Body="&lt;p&gt;I recently wondered this again and decided to do what I should have the first time: read the source code! The answer is very simple: &lt;code&gt;iy-go-to-char&lt;/code&gt; is written with knowledge of &lt;code&gt;multiple-cursors&lt;/code&gt; and has some specific code to make it work well with it. Roughly speaking, it stores the character you give it in a variable called &lt;code&gt;iy-go-to-char-last-char&lt;/code&gt; and has a separate command, &lt;code&gt;iy-go-to-char--command&lt;/code&gt;, that takes no input character and does the actual searching up to the given character, &lt;code&gt;iy-go-to-char-last-char&lt;/code&gt;. The point is that that command sets &lt;code&gt;mc--this-command&lt;/code&gt; to &lt;code&gt;iy-go-to-char--command&lt;/code&gt;, so that when the command is repeated for other cursors, you are not again prompted for a character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I still don't understand is why &lt;code&gt;zap-to-char&lt;/code&gt; doesn't behave the same way as &lt;code&gt;zap-up-to-char&lt;/code&gt; does when used with &lt;code&gt;multiple-cursors&lt;/code&gt;. The difference for &lt;code&gt;multiple-cursors&lt;/code&gt; between those two seems to come from how they take their interactive arguments: &lt;code&gt;zap-up-to-char&lt;/code&gt; uses &lt;code&gt;(interactive &quot;p\ncZap up to char: &quot;)&lt;/code&gt; but &lt;code&gt;zap-to-char&lt;/code&gt; uses instead&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(interactive (list (prefix-numeric-value current-prefix-arg)&#xA;                   (read-char &quot;Zap up to char: &quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is not clear to me why exactly that makes &lt;code&gt;multiple-cursors&lt;/code&gt; behave differently.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2015-12-08T22:28:35.047" LastActivityDate="2015-12-08T22:28:35.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18715" PostTypeId="2" ParentId="18707" CreationDate="2015-12-09T00:05:21.417" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/19069713/freeze-table-rows-in-emacs-org-mode&quot;&gt;This&lt;/a&gt; question on stackoverflow has two suggestions, including using elisp to set the header-line-format to the first line of the table. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also suggests splitting the window horizontally and keeping the header in the upper window as a hackish workaround.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use the code, add it to org-mode-hook as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda()&#xA;  (setq-local header-line-format&#xA;    (list '(:eval&#xA;        (save-excursion&#xA;          (org-table-goto-line 1)&#xA;          (substring (thing-at-point 'line t) 0 -1)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-12-10T21:49:18.487" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18716" PostTypeId="1" AcceptedAnswerId="18880" CreationDate="2015-12-09T00:19:29.577" Score="6" ViewCount="494" Body="&lt;p&gt;This a follow up to my earlier question &lt;a href=&quot;https://emacs.stackexchange.com/questions/9504/why-does-multiple-cursors-use-the-same-char-for-all-cursors-with-iy-go-to-char&quot;&gt;Why does multiple-cursors use the same char for all cursors with iy-go-to-char, but not with zap-up-to-char?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I describe in that question, for some commands that prompt for a character in the mini-buffer multiple-cursors will repeat the prompting for each cursor, but for others it will happily prompt only once and use that character for all cursors. In particular, for &lt;code&gt;iy-go-to-char&lt;/code&gt; multiple-cursors prompts only once, but for &lt;code&gt;zap-up-to-char&lt;/code&gt; it prompts per cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, oddly enough for &lt;code&gt;zap-to-char&lt;/code&gt; the prompting also happens only once, not once per cursor! My question is why does this happen? As far as I can tell the difference is caused by their different calls to interactive:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;zap-up-to-char&lt;/code&gt; uses the seemingly sensible &lt;code&gt;(interactive &quot;p\ncZap up to char: &quot;)&lt;/code&gt;,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;zap-to-char&lt;/code&gt; instead has:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(interactive (list (prefix-numeric-value current-prefix-arg)&#xA;                   (read-char &quot;Zap to char: &quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That is indeed the cause because taking the implementation of &lt;code&gt;zap-up-to-char&lt;/code&gt; from &lt;code&gt;misc.el&lt;/code&gt; and replacing the &lt;code&gt;interactive&lt;/code&gt; call with one similar to the one &lt;code&gt;zap-to-char&lt;/code&gt; uses produces a version of &lt;code&gt;zap-up-to-char&lt;/code&gt; that, when used with multiple-cursors, only prompts once &#xA;(not once per cursor):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mc-friendly/zap-up-to-char (arg char)&#xA;  (interactive (list (prefix-numeric-value current-prefix-arg)&#xA;                     (read-char &quot;Zap up to char: &quot; t)))&#xA;  (let ((direction (if (&amp;gt;= arg 0) 1 -1)))&#xA;    (kill-region (point)&#xA;                 (progn&#xA;                   (forward-char direction)&#xA;                   (unwind-protect&#xA;                       (search-forward (char-to-string char) nil nil arg)&#xA;                     (backward-char direction))&#xA;           (point)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why does changing the call to &lt;code&gt;interactive&lt;/code&gt; have that effect?&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-16T18:02:59.473" Title="Why does multiple cursors use the same char for all cursors with zap-to-char but not with zap-up-to-char?" Tags="|interactive|multiple-cursors|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18717" PostTypeId="2" ParentId="18688" CreationDate="2015-12-09T00:20:02.160" Score="3" Body="&lt;p&gt;No, What you want probably isn't possible without some extreme customization.  However, Org once again surprises me with how well the default behavior works, included files with links are treated the same as links within the file.  (If you aren't familiar with the syntay, say you have the glossary in glossary.txt, add the line &lt;code&gt;#+include: glossary.txt&lt;/code&gt; to the file.) After exporting, radio targets in the included file are linked.  This doesn't show the links while editing, but does allow for quite a bit of organization in the files.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-12-09T00:20:02.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18718" PostTypeId="1" CreationDate="2015-12-09T02:35:41.413" Score="2" ViewCount="90" Body="&lt;p&gt;I'm using org-mode and I like to keep track of my TODO tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EG: Here is what my TODO's look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TODO [#B] Implement stuff [%]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I currently add a TODO I just get the following;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TODO &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have to then set a priority, add a title and add the [%] at the end, I would like to have it automatically set to priority [#B] and put the [%] on the end, is this possible?&lt;/p&gt;&#xA;" OwnerUserId="9463" LastActivityDate="2015-12-09T02:35:41.413" Title="Automatically adding [/] or [%] to the end of TODO tasks" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18719" PostTypeId="1" AcceptedAnswerId="18731" CreationDate="2015-12-09T04:32:20.213" Score="4" ViewCount="1814" Body="&lt;p&gt;I'm using Firefox extention &lt;code&gt;It's all text&lt;/code&gt;, with it I can edit stackoverflow form text in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I often want to add four spaces before selected text to markdown codes.&#xA;&lt;code&gt;indent-region&lt;/code&gt; only &quot;indent&quot; the region. Is there already function like this or should I write it myself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already installed &lt;code&gt;markdown-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10106" LastEditorUserId="25" LastEditDate="2015-12-09T21:46:11.900" LastActivityDate="2015-12-10T10:19:46.783" Title="How to add four spaces selected region" Tags="|indentation|markdown-mode|" AnswerCount="3" CommentCount="0" ClosedDate="2015-12-10T12:10:14.793" ContentLicense="CC BY-SA 3.0" />
  <row Id="18720" PostTypeId="2" ParentId="18719" CreationDate="2015-12-09T04:58:21.417" Score="3" Body="&lt;p&gt;Try &lt;code&gt;rectangle-mark-mode&lt;/code&gt;, down N lines, forward 4 spaces, then &lt;code&gt;open-rectangle&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9878" LastActivityDate="2015-12-09T04:58:21.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18721" PostTypeId="1" AcceptedAnswerId="20801" CreationDate="2015-12-09T05:06:19.143" Score="0" ViewCount="253" Body="&lt;p&gt;I've recently been trying to convert my startup files to using &lt;code&gt;use-package&lt;/code&gt;, so I've been editing my &lt;code&gt;.emacs&lt;/code&gt; file a lot.  I seem to have myself in a state where some common &lt;code&gt;self-insert-command&lt;/code&gt; operations are failing.  For instance, I'm editing a buffer in PHP mode, I try to enter a space in a comment line, and I get the error shown in the title, with the following stack trace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function nil)&#xA;  nil(370 1)&#xA;  abbrev--before-point()&#xA;  #[0 &quot;\304 \211@^AA\211@^AA\211@^AA\211@^AA^A^D^F^G^F\n\211\205O^@\305`\306\&quot;\305^E\306\&quot;^H\2040^@\307 \2040^@\310 \210^C^Q^B^R^D^S\311^C^E^F^G^F      $^B^BV\203M^@`^BU\203M\&#xA;^@^Bb\210\266\202\266\204\207&quot; [noninteractive last-abbrev-text last-abbrev last-abbrev-location abbrev--before-point copy-marker t window-minibuffer-p undo-boundary abbrev-i\&#xA;nsert] 20 &quot;\n\n(fn)&quot;]()&#xA;  apply(#[0 &quot;\304 \211@^AA\211@^AA\211@^AA\211@^AA^A^D^F^G^F\n\211\205O^@\305`\306\&quot;\305^E\306\&quot;^H\2040^@\307 \2040^@\310 \210^C^Q^B^R^D^S\311^C^E^F^G^F        $^B^BV\203M^@`\&#xA;^BU\203M^@^Bb\210\266\202\266\204\207&quot; [noninteractive last-abbrev-text last-abbrev last-abbrev-location abbrev--before-point copy-marker t window-minibuffer-p undo-boundary \&#xA;abbrev-insert] 20 &quot;\n\n(fn)&quot;] nil)&#xA;  #[771 &quot;^B:\2030^@^B@\301=\203^W^@\300\242\302^C^EA\&quot;\303^C#\207\304^C@\305\306\307\310\311\312\300!\313\&quot;\314\315%^F^FA^F^F#^C#\207\304\316^B\&quot;\207&quot; [(#0) t append nil appl\&#xA;y apply-partially make-byte-code 642 &quot;\300\242^C^C^C#\207&quot; vconcat vector [] 7 &quot;\n\n(fn FUNS GLOBAL &amp;amp;rest ARGS)&quot; #[0 &quot;\304 \211@^AA\211@^AA\211@^AA\211@^AA^A^D^F^G^F\n\211\20\&#xA;5O^@\305`\306\&quot;\305^E\306\&quot;^H\2040^@\307 \2040^@\310 \210^C^Q^B^R^D^S\311^C^E^F^G^F $^B^BV\203M^@`^BU\203M^@^Bb\210\266\202\266\204\207&quot; [noninteractive last-abbrev-text last\&#xA;-abbrev last-abbrev-location abbrev--before-point copy-marker t window-minibuffer-p undo-boundary abbrev-insert] 20 &quot;\n\n(fn)&quot;]] 12 &quot;\n\n(fn FUNS GLOBAL ARGS)&quot;](nil nil nil)&#xA;  abbrev--default-expand()&#xA;  expand-abbrev()&#xA;  self-insert-command(1)&#xA;  call-interactively(self-insert-command nil nil)&#xA;  command-execute(self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had a similar problem in &lt;code&gt;cperl-mode&lt;/code&gt;, trying to type a colon (:) inside a double-quoted string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What might be the problem?  I'm using GNU Emacs 24.5.1 on OS X, and my &lt;code&gt;.emacs&lt;/code&gt; file is &lt;a href=&quot;https://gist.github.com/kenahoo/fbdb2cba62cff5f5c4bd&quot; rel=&quot;nofollow&quot;&gt;pasted here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8899" LastActivityDate="2016-03-07T01:06:37.750" Title="Typing common keys (e.g. space, colon) gives &quot;Symbol's function definition is void: nil&quot;" Tags="|self-insert-command|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18722" PostTypeId="1" CreationDate="2015-12-09T05:34:57.073" Score="3" ViewCount="232" Body="&lt;p&gt;Really bizarre issue here; I suspect it's X-related. This may be better suited to the Linux/Unix SE, but I figured there might be more domain-specific expertise here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often (but not 100% of the time), if I run Emacs and Chromium (or google-chrome, I'm on Ubuntu) at the same time, then UI updates on Emacs take &lt;em&gt;ages&lt;/em&gt; to show. As in, I'll try to scroll around the package menu and it will take 45 seconds to render a few dozen lines worth of scrolling. It seems to go both ways: I'm updating 31 packages in the background as I type this and there's a few seconds of lag between every character I type and the on-screen rendering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This issue occurs with both &lt;code&gt;emacsclient&lt;/code&gt;s and stand-alone Emacs sessions. I have 6 cores and I see that only one of them is being used at the moment, which I think must be the cause of the issue. I 'm only at 60% memory usage with almost no swap space being used, so it's not a question of the system being over-taxed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like the lag spikes correlate with CPU-intensive actions in Emacs. It's almost as if chromium and Emacs have decided to run on the same core and compete for cycles, but I can't imagine why. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on the latest Ubuntu release, via Xubuntu, and I use XMonad as my window manager. I've never had any other pair of programs have this kind of issue. Firefox doesn't cause this problem, I only discovered it recently after switching to Chrome. What's going on here?&lt;/p&gt;&#xA;" OwnerUserId="10368" LastEditorUserId="25" LastEditDate="2016-03-28T18:59:55.093" LastActivityDate="2017-02-04T01:58:36.017" Title="Emacs slows to a crawl when Chrome is running" Tags="|performance|x11|" AnswerCount="3" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="18723" PostTypeId="1" AcceptedAnswerId="18724" CreationDate="2015-12-09T07:16:31.663" Score="4" ViewCount="3839" Body="&lt;p&gt;I try to set a default path for opening a file via &lt;code&gt;C-x C-f&lt;/code&gt; by adding the following to my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-directory &quot;~/some_dir/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, after I launch &lt;code&gt;Emacs&lt;/code&gt; in some directory, the find-file directory is always reset to the current working directory when I do &lt;code&gt;C-x C-f&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something else I need to configure to enforce this?&lt;/p&gt;&#xA;" OwnerUserId="10294" LastActivityDate="2019-02-05T10:12:15.903" Title="Setting default-directory does not change find-file directory" Tags="|files|find-file|directories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18724" PostTypeId="2" ParentId="18723" CreationDate="2015-12-09T09:00:34.613" Score="8" Body="&lt;p&gt;According to the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;default-directory&lt;/code&gt; is a variable defined in ‘C source code’. Its value&#xA;  is &quot;~/&quot; Local in buffer *scratch*; global value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Automatically becomes permanently buffer-local when set.   This&#xA;  variable is safe as a file local variable if its value   satisfies the&#xA;  predicate 'stringp'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Name of default directory of current buffer. To&#xA;  interactively change the default directory, use command ‘cd’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, the &lt;code&gt;default-directory&lt;/code&gt; variable, is the &quot;current&quot; directory, for the current buffer. And visiting any file or any directory, changes the &lt;code&gt;default-directory&lt;/code&gt; for that buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can achieve what you want by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;adding &lt;code&gt;(cd &quot;/some/dir/&quot;)&lt;/code&gt; in yout init file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;using a hook: &lt;code&gt;(add-hook 'find-file-hook #'(lambda () (setq default-directory (expand-file-name &quot;/some/dir/&quot;))))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;writing a custom function that will &lt;code&gt;(cd &quot;/some/dir/&quot;)&lt;/code&gt; before finding file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2015-12-09T22:21:10.390" LastActivityDate="2015-12-09T22:21:10.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18725" PostTypeId="1" CreationDate="2015-12-09T09:19:54.800" Score="2" ViewCount="277" Body="&lt;p&gt;When I press &lt;code&gt;M-&amp;lt;up&amp;gt;&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; to move my headers I get this message in the minibuffer:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;There is no other window&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Why does my key binding not work?&lt;/p&gt;&#xA;" OwnerUserId="7199" LastEditorUserId="105" LastEditDate="2021-12-20T00:14:04.187" LastActivityDate="2021-12-20T00:14:04.187" Title="Key binding to the wrong command?" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="18726" PostTypeId="1" AcceptedAnswerId="18727" CreationDate="2015-12-09T11:23:03.057" Score="5" ViewCount="797" Body="&lt;p&gt;I'm using this code on Xubuntu (emacs 24.5.1) but it throw error on windows (emacs 25.0.50.1 64bit)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ignore-error-wrapper (fn)&#xA;  &quot;Funtion return new function that ignore errors.&#xA;   The function wraps a function with `ignore-errors' macro.&quot;&#xA;  (lexical-let ((fn fn))&#xA;    (lambda ()&#xA;      (interactive)&#xA;      (ignore-errors&#xA;        (funcall fn)))))&#xA;&#xA;(global-set-key [s-left] (ignore-error-wrapper 'windmove-left))&#xA;(global-set-key [s-right] (ignore-error-wrapper 'windmove-right))&#xA;(global-set-key [s-up] (ignore-error-wrapper 'windmove-up))&#xA;(global-set-key [s-down] (ignore-error-wrapper 'windmove-down))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="105" LastEditDate="2016-06-22T20:16:59.320" LastActivityDate="2016-06-22T20:16:59.320" Title="void-function lexical-let" Tags="|microsoft-windows|lexical-scoping|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18727" PostTypeId="2" ParentId="18726" CreationDate="2015-12-09T11:30:59.080" Score="5" Body="&lt;p&gt;&lt;code&gt;lexical-let&lt;/code&gt; is defined in &lt;code&gt;cl.el&lt;/code&gt;. You can &lt;code&gt;(eval-when-compile (require 'cl))&lt;/code&gt; to fix the problem. This is mostly equivalent to &lt;code&gt;(require 'cl)&lt;/code&gt; but is more efficient when you byte-compile your code (see Drew's comment below).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-12-10T10:28:31.950" LastActivityDate="2015-12-10T10:28:31.950" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18728" PostTypeId="2" ParentId="5665" CreationDate="2015-12-09T12:02:36.910" Score="1" Body="&lt;p&gt;If the first answer does not work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the package &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;nofollow&quot;&gt;elpy&lt;/a&gt;, hides the company lighter in the modeline (even in other major modes). Same might be true for globally installed major modes.&lt;/p&gt;&#xA;" OwnerUserId="10439" LastActivityDate="2015-12-09T12:02:36.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18729" PostTypeId="2" ParentId="18697" CreationDate="2015-12-09T12:26:40.517" Score="1" Body="&lt;p&gt;I found some excellent documentation at New Mexico Tech's &lt;a href=&quot;http://infohost.nmt.edu/tcc/help/pubs/nxml/index.html&quot; rel=&quot;nofollow&quot; title=&quot;New Mexico Tech nxml mode help&quot;&gt;nxml mode help page&lt;/a&gt;, describing specifically how emacs locates the schema that it uses and describing the content of the schemas.xml file. The xi:include was apparently not the real problem that I was facing; the real problems were   definitions in included files which did not have  content, just plain text. All is well now.&lt;/p&gt;&#xA;" OwnerUserId="9131" LastActivityDate="2015-12-09T12:26:40.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18731" PostTypeId="2" ParentId="18719" CreationDate="2015-12-09T12:44:23.073" Score="5" Body="&lt;p&gt;I think &lt;code&gt;indent-rigidly&lt;/code&gt; (C-x TAB or C-x C-i, see footnote) can help you.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;indent-rigidly is an interactive compiled Lisp function in&#xA;  `indent.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to C-x TAB.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(indent-rigidly START END ARG &amp;amp;optional INTERACTIVE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Indent all lines starting in the region. If called interactively with&#xA;  no prefix argument, activate a transient mode in which the indentation&#xA;  can be adjusted interactively by typing left, right, S-left, or&#xA;  S-right. Typing any other key deactivates the transient mode.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If called from a program, or interactively with prefix ARG, indent all&#xA;  lines starting in the region forward by ARG columns. If called from a&#xA;  program, START and END specify the beginning and end of the text to&#xA;  act on, in place of the region.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Negative values of ARG indent backward, so you can remove all&#xA;  indentation by specifying a large negative ARG.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Footnote: C-x TAB is equivalent to C-x C-i. This was noted by nanny in the comment, and I think it's worth mentioning because C-x C-i is so much easier to hit.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2015-12-10T10:19:46.783" LastActivityDate="2015-12-10T10:19:46.783" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18732" PostTypeId="2" ParentId="18709" CreationDate="2015-12-09T14:19:18.607" Score="4" Body="&lt;p&gt;There's no way to do this by default, see &lt;code&gt;(glob-syms (and target pred (all-completions target obarray pred)))&lt;/code&gt; in the code - it's all pre-determined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is a good thing, since pre-narrowing the candidate list&#xA;really speeds up the completion.  For example, I have 70k symbols&#xA;bound/fbound in my current session - narrowing them to &quot;line&quot; gives&#xA;just 12.  Of course, 70k isn't that drastic, but you may get a 0.1s&#xA;delay here and there - perceptible if you use the command a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how to patch the function to do what you want (if you decide to accept the slowdown).  The change is &lt;code&gt;(all-completions target obarray pred)&lt;/code&gt; -&gt; &lt;code&gt;(all-completions &quot;&quot; obarray pred)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-lisp-completion-at-point ()&#xA;  &quot;Preconfigured helm for lisp symbol completion at point.&quot;&#xA;  (interactive)&#xA;  (setq helm-lgst-len 0)&#xA;  (let* ((target (helm-thing-before-point))&#xA;         (beg (car (helm-bounds-of-thing-before-point)))&#xA;         (end (point))&#xA;         (pred (and beg (helm-lisp-completion--predicate-at-point beg)))&#xA;         (loc-vars (and (fboundp 'elisp--local-variables)&#xA;                        (ignore-errors&#xA;                          (mapcar #'symbol-name (elisp--local-variables)))))&#xA;         (glob-syms (and target pred (all-completions &quot;&quot; obarray pred)))&#xA;         (candidates (append loc-vars glob-syms))&#xA;         (helm-quit-if-no-candidate t)&#xA;         (helm-execute-action-at-once-if-one t)&#xA;         (enable-recursive-minibuffers t))&#xA;    (setq helm-lisp-completion--cache (cl-loop for sym in candidates&#xA;                                         for len = (length sym)&#xA;                                         when (&amp;gt; len helm-lgst-len)&#xA;                                         do (setq helm-lgst-len len)&#xA;                                         collect sym))&#xA;    (if candidates&#xA;        (with-helm-show-completion beg end&#xA;          ;; Overlay is initialized now in helm-current-buffer.&#xA;          (helm&#xA;           :sources (helm-build-in-buffer-source &quot;Lisp completion&quot;&#xA;                      :data helm-lisp-completion--cache&#xA;                      :persistent-action 'helm-lisp-completion-persistent-action&#xA;                      :nomark t&#xA;                      :fuzzy-match helm-lisp-fuzzy-completion&#xA;                      :persistent-help (helm-lisp-completion-persistent-help)&#xA;                      :filtered-candidate-transformer&#xA;                      'helm-lisp-completion-transformer&#xA;                      :action `(lambda (candidate)&#xA;                                 (with-helm-current-buffer&#xA;                                   (run-with-timer&#xA;                                    0.01 nil&#xA;                                    'helm-insert-completion-at-point&#xA;                                    ,beg ,end candidate))))&#xA;           :input (if helm-lisp-fuzzy-completion&#xA;                      target (concat target &quot; &quot;))&#xA;           :resume 'noresume&#xA;           :buffer &quot;*helm lisp completion*&quot;&#xA;           :allow-nest t))&#xA;      (message &quot;[No Match]&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-12-09T14:19:18.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18733" PostTypeId="1" CreationDate="2015-12-09T15:18:56.520" Score="3" ViewCount="319" Body="&lt;p&gt;Today I started using desktop-mode. It's nice to be able to save a desktop using the &lt;code&gt;desktop-save&lt;/code&gt; command, and load one using the &lt;code&gt;desktop-change-dir&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes I do &lt;code&gt;M-x cd&lt;/code&gt; to change the working directory in Emacs.&#xA;I have three clients at work, with files pertaining to them stored in &lt;code&gt;~/client_foo/&lt;/code&gt;, &lt;code&gt;~/client_baa/&lt;/code&gt;, &lt;code&gt;~/client_baz/&lt;/code&gt;. What if I wanted Emacs to have a background color of black when cd'd in to the first clients directory, green for the second client, and brown for the third. Is there any module that can help me?&lt;/p&gt;&#xA;" OwnerUserId="9829" LastEditorUserId="25" LastEditDate="2015-12-09T21:55:43.620" LastActivityDate="2018-12-03T16:02:35.490" Title="A different color for each client" Tags="|buffers|colors|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18734" PostTypeId="2" ParentId="18719" CreationDate="2015-12-09T15:29:53.203" Score="1" Body="&lt;p&gt;This function inserts 4 spaces at the beginning of each line of the region:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-indent (reg-beg reg-end)&#xA;     (interactive &quot;r&quot;) ;; r: take the active region and give its boundaries as arguments&#xA;     (save-excursion&#xA;       (replace-regexp &quot;^&quot; &quot;    &quot; nil reg-beg reg-end)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;evil mode's &lt;code&gt;&amp;gt;&lt;/code&gt; does it too.&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2015-12-09T15:29:53.203" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18735" PostTypeId="2" ParentId="8169" CreationDate="2015-12-09T16:00:16.840" Score="1" Body="&lt;p&gt;I've also run into issues trying to run Emacs as a daemon in OS X, so I wrote a &quot;pseudo-daemon&quot; mode that just creates a new hidden GUI frame when you close the last frame. The result is that Emacs just hides in the dock whenever it would normally exit, which provides a surprisingly good approximation of daemon mode while keeping the Dock icon functional. You can get it from MELPA: &lt;a href=&quot;https://melpa.org/#/mac-pseudo-daemon&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://melpa.org/#/mac-pseudo-daemon&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2046" LastEditorUserId="2046" LastEditDate="2019-04-15T20:14:53.917" LastActivityDate="2019-04-15T20:14:53.917" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18736" PostTypeId="1" AcceptedAnswerId="18770" CreationDate="2015-12-09T18:11:05.953" Score="5" ViewCount="712" Body="&lt;p&gt;I need to convert all nested lists present in buffer to org-mode headers using elisp. How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1.2.7.2 Some Header Name&lt;/code&gt; -&gt; &lt;code&gt;**** Some Header Name&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10444" LastEditorUserId="105" LastEditDate="2016-06-22T20:16:45.710" LastActivityDate="2016-06-22T20:16:45.710" Title="Converting nested lists to org-mode lists" Tags="|org-mode|list|header-line|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18737" PostTypeId="2" ParentId="16487" CreationDate="2015-12-09T18:25:33.573" Score="1" Body="&lt;p&gt;What you're proposing isn't really a text object.  To recap:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Text objects are defined with &lt;code&gt;evil-define-text-object&lt;/code&gt;. In Visual&#xA;  state, they modify the current selection; in Operator-Pending state,&#xA;  they return a pair of buffer positions. Outer text objects are bound&#xA;  in the keymap &lt;code&gt;evil-outer-text-objects-map&lt;/code&gt;, and inner text objects&#xA;  are bound in &lt;code&gt;evil-inner-text-objects-map&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Common text objects like words, WORDS, paragraphs and sentences are&#xA;  defined via a corresponding move-function. […]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The definition of a text object as movement means that it must be part of the buffer to allow each Evil operator to work upon it.  If you look at the arguments of &lt;code&gt;evil-delete&lt;/code&gt; for example, you'll notice the first two are BEG and END.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I can only imagine the approach of overloading the operators you have in mind to work.  &lt;a href=&quot;https://emacs.stackexchange.com/questions/9389/map-a-key-to-an-evil-operator-and-to-other-things&quot;&gt;It isn't nearly as easy to do as in Vim&lt;/a&gt; (where you just override a mapping with your custom command and are done), but still possible.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-12-09T18:25:33.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18738" PostTypeId="1" CreationDate="2015-12-09T19:59:15.160" Score="2" ViewCount="968" Body="&lt;p&gt;I'd like to filter &lt;code&gt;*foo*&lt;/code&gt; buffers out of my helm-mini (&lt;code&gt;C-x b&lt;/code&gt;) list, but occasionally I do need to operate on a buffer like that. The natural solution (to me, anyway) is to use helm-buffers-list (&lt;code&gt;C-x C-b&lt;/code&gt;) to access those. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I successfully filtered out these buffers by adding &lt;code&gt;\*.+\*&lt;/code&gt; to &lt;code&gt;helm-boring-buffer-regexp-list&lt;/code&gt; but I can't figure out how to configure helm-buffers-list to include boring buffers.&lt;/p&gt;&#xA;" OwnerUserId="10445" LastActivityDate="2015-12-09T19:59:15.160" Title="Helm - hide &quot;boring buffers&quot; in helm-mini but not helm-buffers-list" Tags="|helm|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18739" PostTypeId="2" ParentId="5665" CreationDate="2015-12-09T20:22:16.900" Score="25" Body="&lt;p&gt;You can type &lt;kbd&gt;M-x company-diag&lt;/kbd&gt; now, and see the used backend in the resulting buffer.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2015-12-09T20:22:16.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18740" PostTypeId="1" AcceptedAnswerId="18851" CreationDate="2015-12-09T20:33:38.257" Score="1" ViewCount="190" Body="&lt;p&gt;Emacs startup time on Linux is &lt;code&gt;2.3 seconds&lt;/code&gt;. When I exit Emacs with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;, it quits instantly.&#xA;This changes when I put only the following lines in my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq savehist-file (concat user-emacs-directory &quot;savehist&quot;))&#xA;(savehist-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when starting Emacs, it took &lt;code&gt;4.5&lt;/code&gt; seconds to start. That's nearly the double of the old startup time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And when I quit Emacs, it tooks some time. I see only the message &#xA;&lt;code&gt;wrote /home/ReneFroger/Dropbox/Emacs/places&lt;/code&gt; before it finally quits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering which the savehist feature is consuming so much time? I didn't had this problem earlier.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-12-14T18:04:38.527" Title="Savehistory doubles my startup time, and is not quitting directly" Tags="|saveplace|" AnswerCount="1" CommentCount="14" ClosedDate="2015-12-15T08:52:46.350" ContentLicense="CC BY-SA 3.0" />
  <row Id="18741" PostTypeId="1" AcceptedAnswerId="31818" CreationDate="2015-12-09T21:40:57.657" Score="4" ViewCount="1037" Body="&lt;p&gt;Is it possible to get syntax highlight for HTML code within a &lt;code&gt;#+BEGIN_EXPORT HTML&lt;/code&gt; environment block in org-mode? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it is possible to highlight HTML within a &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; block using &lt;a href=&quot;https://github.com/krisajenkins/ob-browser&quot; rel=&quot;nofollow noreferrer&quot;&gt;ob-browser&lt;/a&gt;. Is there a way to &quot;extend&quot; such highlighting to other blocks as well?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2017-03-29T16:49:50.063" LastActivityDate="2017-03-31T11:49:46.253" Title="How to syntax highlight #+BEGIN_EXPORT HTML environment in org-mode buffer?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18742" PostTypeId="1" AcceptedAnswerId="19115" CreationDate="2015-12-09T22:10:00.533" Score="3" ViewCount="1939" Body="&lt;p&gt;When I open a new file I want it to pop-up in a new frame. I've set &lt;code&gt;pop-up-frames&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, but it still opens files that I double-click in Finder in existing buffers which results in other buffers being hidden. &lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2015-12-27T19:48:34.900" Title="How can I force Emacs to open files in new frames?" Tags="|frames|emacsclient|" AnswerCount="2" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="18743" PostTypeId="1" AcceptedAnswerId="18744" CreationDate="2015-12-10T00:01:22.727" Score="1" ViewCount="317" Body="&lt;p&gt;I've made a minor change to the existing code in &lt;code&gt;bibtex.el&lt;/code&gt;; to be more precise, I've modified the function &lt;code&gt;bibtex-generate-url-list&lt;/code&gt; so that it can generate URLs for several more fields (in addition to the DOI and URL fields that the existing code can handle).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written the code that I need, that's not a problem. The problem is that I don't know how to make emacs see the changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I tried:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Back up the original files &lt;code&gt;bibtex.el.gz&lt;/code&gt; and the byte-compiled version &lt;code&gt;bibtex.elc&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Save my changes in the old location and byte-compile the file. So the versions of &lt;code&gt;bibtex.el.gz&lt;/code&gt; and &lt;code&gt;bibtex.elc&lt;/code&gt; in the directory &lt;code&gt;/usr/local/share/emacs/24.4/lisp/textmodes&lt;/code&gt; now contain my changes.&lt;/li&gt;&#xA;&lt;li&gt;Restart emacs.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But my changes don't seem to work when I load a bibtex file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I make emacs use my changes?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For completeness, here is the code I added (everything after the doi entry). I've tested the regular expressions and they do what I want, so that's not the issue, as I explained above.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom bibtex-generate-url-list&#xA; '(((&quot;url&quot; . &quot;.*:.*&quot;))&#xA;((&quot;doi&quot; . &quot;10\\.[0-9]+/.+&quot;)&#xA; &quot;http://dx.doi.org/%s&quot;&#xA; (&quot;doi&quot; &quot;.*&quot; 0))&#xA;((&quot;mrkey&quot; . &quot;\\(mr\\)?[0-9]\\{1,8\\}&quot;)&#xA; &quot;http://www.ams.org/mathscinet-getitem?mr=%s&quot;&#xA; (&quot;mrkey&quot; &quot;\\(mr\\)?\\([0-9]\\{1,8\\}\\)&quot; 2))&#xA;((&quot;arxiv&quot; . &quot;\\([0-9]\\{4\\}\\.[0-9]\\{4,5\\}\\|[-a-z]+/[0-9]\\{7\\}\\|[-a-z]+\\.[a-z]\\{2\\}/[0-9]\\{7\\}\\)\\(v[0-9]+\\)?&quot;)&#xA; &quot;http://arxiv.org/abs/%s&quot;&#xA; (&quot;arxiv&quot; &quot;.*&quot; 0))&#xA;((&quot;zblnumber&quot; . &quot;\\([0-9]\\{4\\}\\.[0-9]\\{5\\}\\|[0-9]\\{8\\}\\)&quot;)&#xA; &quot;http://zbmath.org/?q=an:%s&quot;&#xA; (&quot;zblnumber&quot; &quot;.*&quot; 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6692" LastEditorUserId="105" LastEditDate="2016-06-22T20:16:05.520" LastActivityDate="2016-06-22T20:16:05.520" Title="How to modify existing major-mode?" Tags="|major-mode|bibtex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18744" PostTypeId="2" ParentId="18743" CreationDate="2015-12-10T00:50:36.787" Score="7" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Never modify the source code in its original location like that. You'll lose (or be forced to merge) your changes whenever you upgrade.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;defcustom&lt;/code&gt; defines a &quot;user option&quot; variable. Variables are designed to be modified without touching the code, and for user options there's even a UI for that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-option&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;bibtex-generate-url-list&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs will save your customisations into your init file (or your &lt;code&gt;custom-file&lt;/code&gt;, should that value be set).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt; to visit the manual, and then &lt;kbd&gt;m&lt;/kbd&gt; &lt;code&gt;Customization&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to read about this facility.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you ever do find yourself needing to redefine some existing code, you can achieve that in your personal init file, without editing the original code.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To set a user option value in code in your init file, use &lt;code&gt;customize-set-variable&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(customize-set-variable&#xA; 'bibtex-generate-url-list&#xA; '(((&quot;url&quot; . &quot;.*:.*&quot;))&#xA;   ((&quot;doi&quot; . &quot;10\\.[0-9]+/.+&quot;)&#xA;    &quot;http://dx.doi.org/%s&quot;&#xA;    (&quot;doi&quot; &quot;.*&quot; 0))&#xA;   ((&quot;mrkey&quot; . &quot;\\(mr\\)?[0-9]\\{1,8\\}&quot;)&#xA;    &quot;http://www.ams.org/mathscinet-getitem?mr=%s&quot;&#xA;    (&quot;mrkey&quot; &quot;\\(mr\\)?\\([0-9]\\{1,8\\}\\)&quot; 2))&#xA;   ((&quot;arxiv&quot; . &quot;\\([0-9]\\{4\\}\\.[0-9]\\{4,5\\}\\|[-a-z]+/[0-9]\\{7\\}\\|[-a-z]+\\.[a-z]\\{2\\}/[0-9]\\{7\\}\\)\\(v[0-9]+\\)?&quot;)&#xA;    &quot;http://arxiv.org/abs/%s&quot;&#xA;    (&quot;arxiv&quot; &quot;.*&quot; 0))&#xA;   ((&quot;zblnumber&quot; . &quot;\\([0-9]\\{4\\}\\.[0-9]\\{5\\}\\|[0-9]\\{8\\}\\)&quot;)&#xA;    &quot;http://zbmath.org/?q=an:%s&quot;&#xA;    (&quot;zblnumber&quot; &quot;.*&quot; 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might also set it with &lt;code&gt;setq&lt;/code&gt; (or just &lt;code&gt;set&lt;/code&gt;, for a direct substitution in the above code), and with the majority of variables it won't matter, but there &lt;em&gt;are&lt;/em&gt; some user options for which you need to be using &lt;code&gt;customize-set-variable&lt;/code&gt;, so it's best to use that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the variable was defined by &lt;code&gt;defvar&lt;/code&gt; then you can safely use &lt;code&gt;setq&lt;/code&gt;/&lt;code&gt;set&lt;/code&gt; to set its value.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-12-10T03:41:33.480" LastActivityDate="2015-12-10T03:41:33.480" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18745" PostTypeId="1" AcceptedAnswerId="18747" CreationDate="2015-12-10T01:04:31.957" Score="1" ViewCount="208" Body="&lt;p&gt;This is not working for some reason:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;s-S-z&quot;) 'undo-tree-redo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;CMD - Shift - z&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;While this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;s-y&quot;) 'undo-tree-redo) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get &quot;CMD - Shift - z&quot; to be 'undo-tree-redo'&lt;/p&gt;&#xA;" OwnerUserId="9654" LastActivityDate="2015-12-10T02:49:06.470" Title="On a mac, setup CMD - Shift - z to be 'undo-tree-redo'" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18747" PostTypeId="2" ParentId="18745" CreationDate="2015-12-10T02:49:06.470" Score="1" Body="&lt;p&gt;Try &lt;code&gt;(global-set-key (kbd &quot;s-Z&quot;) 'undo-tree-redo)&lt;/code&gt;. (&lt;code&gt;Z&lt;/code&gt; = &lt;code&gt;SHIFT + z&lt;/code&gt;). This works for me on Linux with &lt;code&gt;s-&lt;/code&gt; being the windows key, but should work with the command key on a Mac I think. This threw me off at first as well.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-12-10T02:49:06.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18748" PostTypeId="2" ParentId="14063" CreationDate="2015-12-10T06:56:43.137" Score="0" Body="&lt;p&gt;You can run bash in a new buffer in Emacs by pressing &lt;code&gt;C-x 2&lt;/code&gt; (or &lt;code&gt;C-x 3)&lt;/code&gt;. Then go to that buffer and press &lt;code&gt;M-x shell&lt;/code&gt; to run &lt;code&gt;bash&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to run matlab in console mode you need to do the following in bash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;matlab -nodisplay -nosplash -nodesktop -r &quot;run('yourfile.m');exit&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's better to write the above command in a shell script that accepts the matlab file as an input.&lt;/p&gt;&#xA;" OwnerUserId="8698" LastEditorUserId="105" LastEditDate="2015-12-10T14:35:16.937" LastActivityDate="2015-12-10T14:35:16.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18749" PostTypeId="2" ParentId="18238" CreationDate="2015-12-10T08:22:48.570" Score="1" Body="&lt;p&gt;This is an &lt;code&gt;org-mode&lt;/code&gt;-bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that the case of &quot;Lists&quot; is handled before &quot;Special blocks&quot; in &lt;code&gt;org-indent-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you exchange these cases the tab-indentation behaves better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The corrected code for &lt;code&gt;org-indent-line&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; 8.2.10 is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;(if (equal (mapcar 'string-to-number (split-string org-version &quot;\\.&quot;)) '(8 2 10))&#xA;    (defun org-indent-line ()&#xA;      &quot;Indent line depending on context.&quot;&#xA;      (interactive)&#xA;      (let* ((pos (point))&#xA;         (itemp (org-at-item-p))&#xA;         (case-fold-search t)&#xA;         (org-drawer-regexp (or org-drawer-regexp &quot;\000&quot;))&#xA;         (inline-task-p (and (featurep 'org-inlinetask)&#xA;                 (org-inlinetask-in-task-p)))&#xA;         (inline-re (and inline-task-p&#xA;                 (org-inlinetask-outline-regexp)))&#xA;         column)&#xA;    (if (and orgstruct-is-++ (eq pos (point)))&#xA;        (let ((indent-line-function (cadadr (assoc 'indent-line-function org-fb-vars))))&#xA;          (indent-according-to-mode))&#xA;      (beginning-of-line 1)&#xA;      (cond&#xA;       ;; Headings&#xA;       ((looking-at org-outline-regexp) (setq column 0))&#xA;       ;; Footnote definition&#xA;       ((looking-at org-footnote-definition-re) (setq column 0))&#xA;       ;; Literal examples&#xA;       ((looking-at &quot;[ \t]*:\\( \\|$\\)&quot;)&#xA;        (setq column (org-get-indentation))) ; do nothing&#xA;       ;; Drawers&#xA;       ((and (looking-at &quot;[ \t]*:END:&quot;)&#xA;         (save-excursion (re-search-backward org-drawer-regexp nil t)))&#xA;        (save-excursion&#xA;          (goto-char (1- (match-beginning 1)))&#xA;          (setq column (current-column))))&#xA;       ;; Special blocks&#xA;       ((and (looking-at &quot;[ \t]*#\\+end_\\([a-z]+\\)&quot;)&#xA;         (save-excursion&#xA;           (re-search-backward&#xA;            (concat &quot;^[ \t]*#\\+begin_&quot; (downcase (match-string 1))) nil t)))&#xA;        (setq column (org-get-indentation (match-string 0))))&#xA;       ((and (not (looking-at &quot;[ \t]*#\\+begin_&quot;))&#xA;         (org-between-regexps-p &quot;^[ \t]*#\\+begin_&quot; &quot;[ \t]*#\\+end_&quot;))&#xA;        (save-excursion&#xA;          (re-search-backward &quot;^[ \t]*#\\+begin_\\([a-z]+\\)&quot; nil t))&#xA;        (setq column&#xA;          (cond ((equal (downcase (match-string 1)) &quot;src&quot;)&#xA;             ;; src blocks: let `org-edit-src-exit' handle them&#xA;             (org-get-indentation))&#xA;            ((equal (downcase (match-string 1)) &quot;example&quot;)&#xA;             (max (org-get-indentation)&#xA;                  (org-get-indentation (match-string 0))))&#xA;            (t&#xA;             (org-get-indentation (match-string 0))))))&#xA;       ;; Lists&#xA;       ((ignore-errors (goto-char (org-in-item-p)))&#xA;        (setq column (if itemp&#xA;                 (org-get-indentation)&#xA;               (org-list-item-body-column (point))))&#xA;        (goto-char pos))&#xA;       ;; This line has nothing special, look at the previous relevant&#xA;       ;; line to compute indentation&#xA;       (t&#xA;        (beginning-of-line 0)&#xA;        (while (and (not (bobp))&#xA;            (not (looking-at org-table-line-regexp))&#xA;            (not (looking-at org-drawer-regexp))&#xA;            ;; When point started in an inline task, do not move&#xA;            ;; above task starting line.&#xA;            (not (and inline-task-p (looking-at inline-re)))&#xA;            ;; Skip drawers, blocks, empty lines, verbatim,&#xA;            ;; comments, tables, footnotes definitions, lists,&#xA;            ;; inline tasks.&#xA;            (or (and (looking-at &quot;[ \t]*:END:&quot;)&#xA;                 (re-search-backward org-drawer-regexp nil t))&#xA;                (and (looking-at &quot;[ \t]*#\\+end_&quot;)&#xA;                 (re-search-backward &quot;[ \t]*#\\+begin_&quot;nil t))&#xA;                (looking-at &quot;[ \t]*[\n:#|]&quot;)&#xA;                (looking-at org-footnote-definition-re)&#xA;                (and (not inline-task-p)&#xA;                 (featurep 'org-inlinetask)&#xA;                 (org-inlinetask-in-task-p)&#xA;                 (or (org-inlinetask-goto-beginning) t))))&#xA;          (beginning-of-line 0))&#xA;        (cond&#xA;         ;; There was a list item above.&#xA;         ((ignore-errors (goto-char (org-in-item-p)))&#xA;          (goto-char (org-list-get-top-point (org-list-struct)))&#xA;          (setq column (org-get-indentation)))&#xA;         ;; There was an heading above.&#xA;         ((looking-at &quot;\\*+[ \t]+&quot;)&#xA;          (if (not org-adapt-indentation)&#xA;          (setq column 0)&#xA;        (goto-char (match-end 0))&#xA;        (setq column (current-column))))&#xA;         ;; A drawer had started and is unfinished&#xA;         ((looking-at org-drawer-regexp)&#xA;          (goto-char (1- (match-beginning 1)))&#xA;          (setq column (current-column)))&#xA;         ;; Else, nothing noticeable found: get indentation and go on.&#xA;         (t (setq column (org-get-indentation))))))&#xA;      ;; Now apply indentation and move cursor accordingly&#xA;      (goto-char pos)&#xA;      (if (&amp;lt;= (current-column) (current-indentation))&#xA;          (org-indent-line-to column)&#xA;        (save-excursion (org-indent-line-to column)))&#xA;      ;; Special polishing for properties, see `org-property-format'&#xA;      (setq column (current-column))&#xA;      (beginning-of-line 1)&#xA;      (if (looking-at org-property-re)&#xA;          (replace-match (concat (match-string 4)&#xA;                     (format org-property-format&#xA;                         (match-string 1) (match-string 3)))&#xA;                 t t))&#xA;      (org-move-to-column column))))&#xA;  (error &quot;Bugfix of `org-indent-line' is for org-version 8.2.10 only.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, this source code is not tested thoroughly because of lack of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is not corrected in higher org-mode versions one should issue a bug-report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remark on your Update-2015-12-9: With this fix you still need to add a space in front of &lt;code&gt;[[file:xx]]&lt;/code&gt; to get it indented correctly.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-12-11T13:40:57.410" LastActivityDate="2015-12-11T13:40:57.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18751" PostTypeId="1" CreationDate="2015-12-10T11:08:13.940" Score="2" ViewCount="63" Body="&lt;p&gt;I have a couple of times experienced an elpy (Emacs Python development environment) python process using a considerable amount of CPU resources, loading the computer to an extent that I had to kill the python process. This seems to happen if there temporarily is a syntax error in the Python file edited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that the elpy Python process is also loading the computer during startup: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                          &#xA;5011 fnielsen  20   0 1926520 232172  68344 S  51.0  5.7   0:52.33 python     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe my elpy setup is pretty vanilla just following &lt;a href=&quot;https://github.com/jorgenschaefer/elpy/wiki/Installation&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jorgenschaefer/elpy/wiki/Installation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could be wrong?&lt;/p&gt;&#xA;" OwnerUserId="10455" LastActivityDate="2015-12-10T11:08:13.940" Title="Sometimes experiencing heavy load using elpy" Tags="|elpy|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18752" PostTypeId="2" ParentId="18705" CreationDate="2015-12-10T14:06:38.353" Score="1" Body="&lt;p&gt;Try without the star in &lt;code&gt;backup-directory-alist&lt;/code&gt; and add slash at the end of directory name&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (setq backup-directory-alist&#xA;        '((&quot;.&quot; . &quot;~/.saves/&quot;))) ;; remove the star&#xA; (setq auto-save-file-name-transforms&#xA;        `((&quot;.*&quot; ,&quot;~/.saves/&quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-12-10T14:06:38.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18753" PostTypeId="2" ParentId="18725" CreationDate="2015-12-10T15:38:37.817" Score="2" Body="&lt;p&gt;Your &lt;code&gt;M-&amp;lt;up&amp;gt;&lt;/code&gt; is mapped on &lt;code&gt;scroll-other-window-down&lt;/code&gt; somewhere.&#xA;You &lt;strong&gt;really&lt;/strong&gt; need to find where this shortcut is define.&#xA;If you don't find the pb you can eventually overwrite the shortcuts but this turnaround is not recommended.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;(define-key org-mode-map (kbd &quot;M-&amp;lt;down&amp;gt;&quot;) 'org-metadown) &#xA;(define-key org-mode-map (kbd &quot;M-&amp;lt;up&amp;gt;&quot;) 'org-metaup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA; &lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;org&quot;&#xA;    '(progn&#xA;      (define-key org-mode-map (kbd &quot;M-&amp;lt;down&amp;gt;&quot;) 'org-metadown) &#xA;      (define-key org-mode-map (kbd &quot;M-&amp;lt;up&amp;gt;&quot;) 'org-metaup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-12-11T14:08:53.693" LastActivityDate="2015-12-11T14:08:53.693" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18754" PostTypeId="1" CreationDate="2015-12-10T17:55:05.393" Score="4" ViewCount="1429" Body="&lt;p&gt;I've got a macbook pro with a retina display and Emacs 24.5. &#xA;DocView rendering of pdf are very blurry. There is a few threads on the subjects but they deal with setting a higher resolution which didn't work for me.&#xA;I wrote on my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq doc-view-resolution 300)&#xA;(require 'doc-view)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it had no effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know how to deal with it ?&#xA;Any help would be grateful.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/77BMZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/77BMZ.png&quot; alt=&quot;Doc_View_low_rendering_with_retina&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10456" LastEditorUserId="10456" LastEditDate="2015-12-11T18:41:53.520" LastActivityDate="2019-02-22T17:31:56.170" Title="Emacs 24 Gui and Retina Display" Tags="|docview|rendering|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18755" PostTypeId="1" CreationDate="2015-12-10T17:56:30.320" Score="1" ViewCount="328" Body="&lt;p&gt;I don't like that C-c C-c is untoggle the org-latex-preview fragment because it's the &quot;magic key&quot; in org and whenever I press it it untoggle my latex-fragment so I have to toggle it again manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to unmap this function from C-c C-c and map it to another key like [f9].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand quite well the part on remapping in the GNU manual so I am asking here. Also I apologize for my lack of vocubalary...&lt;/p&gt;&#xA;" OwnerUserId="10306" LastEditorUserId="105" LastEditDate="2019-02-11T17:48:26.707" LastActivityDate="2019-02-11T17:48:26.707" Title="Unmap C-c from org-latex-preview-fragment" Tags="|org-mode|key-bindings|preview-latex|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="18756" PostTypeId="2" ParentId="14063" CreationDate="2015-12-10T18:32:37.920" Score="1" Body="&lt;p&gt;Start by installing &lt;a href=&quot;https://github.com/dimitri/el-get&quot; rel=&quot;nofollow&quot;&gt;el-get&lt;/a&gt;; then, juts &lt;code&gt;el-get-install&lt;/code&gt; and select &lt;code&gt;matlab-mode&lt;/code&gt;. Then, have a look to &lt;code&gt;INSTALL&lt;/code&gt; and &lt;code&gt;README&lt;/code&gt;. Here you'll find all you need. Don't forget to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'matlab-load) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At this point, you'll be able to launch the matlab shell as an inferior process, evaluate regions, lines, etc., and use &lt;code&gt;mlint&lt;/code&gt; to check your code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you may achieve the same using the provided &lt;code&gt;matlab-mode&lt;/code&gt; package when using &lt;code&gt;melpa&lt;/code&gt; instead of &lt;code&gt;el-get&lt;/code&gt;. No instruction files in this case, though.&lt;/p&gt;&#xA;" OwnerUserId="546" LastEditorUserId="546" LastEditDate="2015-12-12T14:42:25.273" LastActivityDate="2015-12-12T14:42:25.273" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18757" PostTypeId="1" AcceptedAnswerId="18764" CreationDate="2015-12-10T18:38:47.253" Score="2" ViewCount="437" Body="&lt;p&gt;On Windows Emacs v24.2.1 I get error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(error &quot;Required feature `cl-macs' was not provided&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I byte-compile my &lt;code&gt;.emacs&lt;/code&gt; and here is code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-no-warning (require 'cl-macs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually &lt;code&gt;(load &quot;cl-macs&quot;)&lt;/code&gt; succeed but &lt;code&gt;cl-macs.el&lt;/code&gt; lack &lt;code&gt;(provide 'cl-macs)&lt;/code&gt; statement for that version (newer Emacs has corresponding provide statement).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What workaround to use for? I think:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;cl-macs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it look ugly in compare to usual &lt;code&gt;(require '...)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'cl-macs nil t)&lt;/code&gt; doesn't prevent from above error.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2016-06-22T20:15:50.097" LastActivityDate="2016-06-22T20:15:50.097" Title="(error &quot;Required feature `cl-macs' was not provided&quot;)" Tags="|require|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18759" PostTypeId="1" AcceptedAnswerId="18760" CreationDate="2015-12-10T19:28:22.430" Score="3" ViewCount="371" Body="&lt;p&gt;Reading the &lt;a href=&quot;http://magit.vc/manual/magit/Pushing.html#Pushing&quot; rel=&quot;nofollow&quot;&gt;Magit user manual&lt;/a&gt;, there is an entry on pushing the current branch to its upstream branch, by pressing &lt;code&gt;P P&lt;/code&gt;. This is not working for me, as I get &lt;em&gt;P isn't bound to any action&lt;/em&gt; on the second P press. Same issue for &lt;code&gt;F F&lt;/code&gt; as well. Anyone else having the same issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(magit-version): &lt;em&gt;Magit 20151208.1407, Git 2.6.3, Emacs 24.5.1&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs installed via homebrew on OS X El'Capitan: &lt;em&gt;brew install emacs --with-cocoa&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="10459" LastEditorUserId="10459" LastEditDate="2015-12-10T19:54:44.797" LastActivityDate="2015-12-30T23:25:29.723" Title="Pushing with P P does not work for me" Tags="|magit|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18760" PostTypeId="2" ParentId="18759" CreationDate="2015-12-10T19:59:34.153" Score="3" Body="&lt;p&gt;Magit did change a few keybindings recently to make operations like pushing and pulling less dangerous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/magit/magit/commit/3108805552de45f613e913647c6a2dc380faea3a&quot; rel=&quot;nofollow&quot;&gt;this commit&lt;/a&gt; for a summary of what changed.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-12-10T19:59:34.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18761" PostTypeId="1" AcceptedAnswerId="18765" CreationDate="2015-12-10T21:03:59.330" Score="3" ViewCount="969" Body="&lt;p&gt;I may have missed something somewhere but I can't make babel work !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have installed and enabled correctly python-mode and in org mode I enter the begin_src section by completing .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything stay grey and it with no code indentation, it seems that python isn't recognize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my .emacs I have loaded python for babel :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((emacs-lisp . t)&#xA;   (python . t)&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The org file section looks like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC: python&#xA;def hello( ):&#xA;    print &quot;hello&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't seen it working on my computer yet and I keep dreaming of it every night !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any org hero in the area ?&lt;/p&gt;&#xA;" OwnerUserId="10306" LastEditorUserId="10306" LastEditDate="2015-12-10T21:14:29.007" LastActivityDate="2015-12-10T21:40:59.507" Title="Babel source code not working" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18762" PostTypeId="2" ParentId="18759" CreationDate="2015-12-10T21:05:06.863" Score="5" Body="&lt;p&gt;Starting with &lt;code&gt;v2.4&lt;/code&gt; (or &quot;a few days ago&quot; if you use Melpa (non-stable, i.e. a development snapshot)) Magit supports the push-remote in addition to the upstream branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should read the &lt;em&gt;Branching&lt;/em&gt; info node to learn about the push-remote, how it is different from the upstream, and how to configure it all. I'll likely write a tutorial about branching before releasing &lt;code&gt;v2.4&lt;/code&gt;, and also update this answer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: You can get the &lt;kbd&gt;P P&lt;/kbd&gt; binding back if you really want to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-change-popup-key 'magit-push-popup   :action ?p ?P)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and to restore the other same-key-twice bindings&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-change-popup-key 'magit-fetch-popup  :action ?u ?f)&#xA;(magit-change-popup-key 'magit-pull-popup   :action ?u ?F)&#xA;(magit-change-popup-key 'magit-rebase-popup :action ?e ?r)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that has downsides too:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;This just restores the bindings, the commands they are bound to by this are not in all cases identical to the old commands. For example &lt;kbd&gt;P P&lt;/kbd&gt; used to push to the configured upstream or if no upstream was configured it asked where to push to. Now it pushes to the push-remote or if that is undefined, it offers to set the push-remote and then pushes to it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;While it will take some time to get used to, the new default bindings also have the potential to make it into muscle memory. I think it is a nice property of the new bindings, that from all of these popups &lt;kbd&gt;p&lt;/kbd&gt; will do something with the &lt;strong&gt;p&lt;/strong&gt;ush-remote and &lt;kbd&gt;u&lt;/kbd&gt; will do something with the &lt;strong&gt;u&lt;/strong&gt;pstream branch.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another alternative would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-action 'magit-push-popup ?P&#xA;  'magit-push-implicitly--desc&#xA;  'magit-push-implicitly ?p t)&#xA;&#xA;(define-key magit-mode-map &quot;f&quot; 'magit-pull-and-fetch-popup)&#xA;(define-key magit-mode-map &quot;F&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;With that, &lt;kbd&gt;P P&lt;/kbd&gt; would once more push to &quot;the most reasonable place possible&quot;. Again this is not the same command these keys were previously bound to, but this might be an approach that users who do not want to use the push-remote might like. This command just calls &lt;code&gt;git push&lt;/code&gt; without a refspec, so what will happen depends on a variety of Git variables. (For that reason I consider it to be somewhat risky and don't add it to the popup by default.) See the doc-string for more information.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And it would once more be possible to fetch by pressing the same key twice (but that key would be &lt;kbd&gt;f&lt;/kbd&gt;, not &lt;kbd&gt;F&lt;/kbd&gt; and that would also fetch all remotes instead of just the current remote as before).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T23:25:29.723" LastActivityDate="2015-12-30T23:25:29.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18764" PostTypeId="2" ParentId="18757" CreationDate="2015-12-10T21:06:28.743" Score="1" Body="&lt;p&gt;Do you need the macros at runtime? If you need them only at compile time, do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'cl))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you need them also at &lt;em&gt;runtime&lt;/em&gt; (with byte-compiled code) then do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(load-library &quot;cl-macs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-11T15:01:28.640" LastActivityDate="2015-12-11T15:01:28.640" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18765" PostTypeId="2" ParentId="18761" CreationDate="2015-12-10T21:29:21.090" Score="2" Body="&lt;p&gt;try: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-fontify-natively t&#xA;    org-src-preserve-indentation t&#xA;    org-src-tab-acts-natively t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your init file. This should give you syntax highlighting, allow you to indent as you would in &lt;code&gt;python-mode&lt;/code&gt;, and preserve those indents when if you export. Also, get rid of the &lt;code&gt;:&lt;/code&gt; after &lt;code&gt;BEGIN_SRC&lt;/code&gt;. So your example should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python&#xA;def hello():&#xA;    print &quot;hello&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On my computer, with those options it looks like:&lt;a href=&quot;https://i.stack.imgur.com/9uZfZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9uZfZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And notice, I am still in &lt;code&gt;org-mode&lt;/code&gt; :) With your cursor at the end of the src block, you can hit &lt;code&gt;C-x C-e&lt;/code&gt; to evaluate your &lt;code&gt;hello&lt;/code&gt; function, and print the result in the echo area at the bottom of your frame!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-10T21:40:59.507" LastActivityDate="2015-12-10T21:40:59.507" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18766" PostTypeId="1" AcceptedAnswerId="18943" CreationDate="2015-12-10T21:58:49.643" Score="6" ViewCount="1178" Body="&lt;p&gt;So, for variety's sake I'd like lists and sublists to have different styles.  In emacs, I've enabled &lt;code&gt;org-list-allow-alphabetical&lt;/code&gt;, but this doesn't work with export (&lt;a href=&quot;http://orgmode.org/worg/org-faq.html#sec-11-5&quot; rel=&quot;nofollow&quot;&gt;not a bug&lt;/a&gt;).  However, there doesn't seem to be any simple way to change styles without adding extensive latex or html code to the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with a list like this,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. Parent&#xA;   1. child&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to use a different marker for the sublist, to avoid confusion,  eg&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. Parent&#xA;   a) child&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Latex seems to do this rather well by default.  Is there a way to specify it for other exporters?&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="2710" LastEditDate="2015-12-18T15:54:26.713" LastActivityDate="2020-09-09T14:39:01.467" Title="Styling lists in org-export (html)" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18767" PostTypeId="1" CreationDate="2015-12-10T22:17:41.113" Score="5" ViewCount="467" Body="&lt;p&gt;Often, when creating a plot I would like several plots with the data.  It's possible to return the name of one file as output, using &lt;code&gt;results: file&lt;/code&gt;, but what about returning several?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, I'd like a solution that works for any language, but I'm working with Python at the moment.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="1985" LastEditDate="2015-12-30T01:51:03.810" LastActivityDate="2016-05-28T04:27:39.183" Title="Returning multiple files from src block in babel" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18768" PostTypeId="2" ParentId="18767" CreationDate="2015-12-10T22:18:57.677" Score="2" Body="&lt;p&gt;This is a solution for python, using noweb syntax.  It saves all open matplotlib figures, but the idea can be extended easily.  First off, make sure noweb is enabled in settings.  Then, define a function which returns a  list of filenames. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: plt-save&#xA;#+begin_src python :exports results :results verbatim&#xA;idx = get_fignums()&#xA;files = []&#xA;&#xA;for i in idx:&#xA;    figure(i)&#xA;    files.append('{0}_{1}.png'.format(path, i))&#xA;    savefig(numbered[-1], bbox_inches='tight')&#xA;return &quot;\n&quot;.join([&quot;[[file:{0}]]&quot;.format(f) for f in files])&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, in the block where the figures are to be saved, define a variable &lt;code&gt;path&lt;/code&gt;, call &lt;code&gt;&amp;lt;&amp;lt;plt-save&amp;gt;&amp;gt;&lt;/code&gt;, and set the results to verbatim.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :results verbatim&#xA;&#xA;# Do processing here#&#xA;path='features_heatmap'&#xA;&amp;lt;&amp;lt;plt-save&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-12-10T22:18:57.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18769" PostTypeId="2" ParentId="17446" CreationDate="2015-12-11T00:33:41.660" Score="3" Body="&lt;p&gt;To include the speedbar in the main frame, use the &lt;strong&gt;sr-speedbar&lt;/strong&gt; library - &lt;kbd&gt;M-x package-list-packages&lt;/kbd&gt;, look for sr-speedbar, then hit &lt;kbd&gt;i&lt;/kbd&gt; then &lt;kbd&gt;x&lt;/kbd&gt; to install it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To turn it on and off, call &lt;code&gt;sr-speedbar-toggle&lt;/code&gt; - then you can bind it to a convenient key in your .emacs file, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-1&quot;) 'sr-speedbar-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With a little tweaking you can get it over on the left side of the screen and looking a little nicer. Try &lt;kbd&gt;M-x customize-apropos&lt;/kbd&gt; sr-speedbar and &lt;kbd&gt;M-x customize-apropos&lt;/kbd&gt; speedbar to set various options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a bit more info on the Emacs Wiki - &lt;a href=&quot;http://www.emacswiki.org/emacs/SrSpeedbar&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/SrSpeedbar&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be great if these libraries could be merged and included in Emacs someday. &lt;/p&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2015-12-11T00:39:37.070" LastActivityDate="2015-12-11T00:39:37.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18770" PostTypeId="2" ParentId="18736" CreationDate="2015-12-11T01:02:09.287" Score="2" Body="&lt;p&gt;Here's a quick and dirty function to do the conversion - it just looks for lines starting with up to 4 numbers. Paste it into your *scratch* buffer, type &lt;kbd&gt;C-x C-e&lt;/kbd&gt; after it, switch to the buffer to convert, then enter &lt;kbd&gt;M-x convert-headers&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun convert-headers ()&#xA;  (interactive)&#xA;  (beginning-of-buffer)&#xA;  (replace-regexp &quot;^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+ &quot; &quot;**** &quot;)&#xA;  (beginning-of-buffer)&#xA;  (replace-regexp &quot;^[0-9]+\\.[0-9]+\\.[0-9]+ &quot; &quot;*** &quot;)&#xA;  (beginning-of-buffer)&#xA;  (replace-regexp &quot;^[0-9]+\\.[0-9]+ &quot; &quot;** &quot;)&#xA;  (beginning-of-buffer)&#xA;  (replace-regexp &quot;^[0-9]+ &quot; &quot;* &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2462" LastActivityDate="2015-12-11T01:02:09.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18771" PostTypeId="1" AcceptedAnswerId="18783" CreationDate="2015-12-11T01:15:32.170" Score="4" ViewCount="1253" Body="&lt;p&gt;Is there a package to get a popup of the documentation for the thing at the point?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example that flycheck uses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pzffe.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pzffe.jpg&quot; alt=&quot;emacs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2015-12-11T11:13:55.387" Title="Pop-up documentation with pos-tip or popup?" Tags="|display|documentation|popup|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18772" PostTypeId="2" ParentId="14063" CreationDate="2015-12-11T01:49:11.283" Score="0" Body="&lt;p&gt;If matlab-mode isn't installed, by default .m files are loaded in octave mode.  If you aren't familiar with octave, it can run most matlab code. (Functions from some of the toolboxes aren't implemented, and some newer features are absent.  For most basic things though, matlab code will run as-is in octave).  This is a good option if matlab isn't available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a console, use the command &lt;code&gt;run-octave&lt;/code&gt;, which will open a command line instance in a new window.  Running scripts can be done in several ways, as others have mentioned running a shell within emacs works quite well, but emacs compilation mode provides some helpful functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start compilation-mode with the &lt;code&gt;compile&lt;/code&gt; function. You need to change the compile-command to be &lt;code&gt;octave &amp;lt;&amp;lt;filename&amp;gt;&amp;gt;&lt;/code&gt;.  You can also set the compile command on a per-file basis by a line similar to &lt;code&gt;## -*- compile-command: &quot;octave test.m&quot;; -*-&lt;/code&gt; as the first line in the file.  I would strongly suggest creating a keybinding for compile.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-12-11T01:49:11.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18773" PostTypeId="1" AcceptedAnswerId="18784" CreationDate="2015-12-11T02:26:12.220" Score="15" ViewCount="4396" Body="&lt;p&gt;I want to open just the head of a large file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know you can use a shell command (&lt;code&gt;M-! RET head file RET&lt;/code&gt;), but I lose &lt;code&gt;helm&lt;/code&gt; completion, it opens in a separate window, and the buffer has the uninformative name of &lt;code&gt;*Shell Command Output*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I open large files with &lt;code&gt;head&lt;/code&gt; (or something similar)?&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="105" LastEditDate="2016-11-12T03:06:01.173" LastActivityDate="2016-11-12T03:06:01.173" Title="Open large files?" Tags="|files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18774" PostTypeId="1" CreationDate="2015-12-11T03:52:05.380" Score="15" ViewCount="2203" Body="&lt;p&gt;I want to put some config outside my &lt;code&gt;init.el&lt;/code&gt; file into &lt;code&gt;.dir-locals.el&lt;/code&gt;, i.e the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;  (let ((dirs '(&quot;.cask&quot; &quot;core&quot; &quot;packages&quot; &quot;modules&quot; &quot;snippets&quot; &quot;themes&quot;)))&#xA;   (mapc #'(lambda (path) (add-to-list 'projectile-globally-ignored-directories path)) dirs))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But each time i'm trying to open any file in my &lt;code&gt;.emacs.d&lt;/code&gt; folder, emacs asks me if it's save to apply this code. I've tried to silence it by setting file local vars:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- enable-local-variables: t; enable-local-eval: t -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it didn't help at all, on the contrary adds another message to trust these local settings. How can i make it trust my &lt;code&gt;.dir-locals.el&lt;/code&gt; code?&lt;/p&gt;&#xA;" OwnerUserId="2361" LastEditorUserId="105" LastEditDate="2016-06-22T20:15:30.343" LastActivityDate="2016-09-13T22:11:23.077" Title="Trust .dir-locals.el" Tags="|file-local-variables|directory-local-variables|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18775" PostTypeId="1" AcceptedAnswerId="18776" CreationDate="2015-12-11T05:18:03.793" Score="4" ViewCount="2870" Body="&lt;p&gt;Some people like me prefer to keep as much as possible in one emacs window (it saves screen retail), so want to run Julia as an inferior shell in emacs. The &quot;run-julia&quot; command that comes with the emacs Julia packages is inferior to running Julia in a terminal emulator; most obviously, &quot;;&quot; for shell commands and &quot;?&quot; for help don't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question becomes: How can you get a fully functional Julia REPL in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it doesn't work to run julia directly in term because as anyone who tries this will see, there are crippling bugs that make it unusable. Running it in any other shell gives you the same limited features as run-julia.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastActivityDate="2020-12-18T14:17:37.790" Title="How to get a fully functional Julia REPL in emacs?" Tags="|term|repl|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18776" PostTypeId="2" ParentId="18775" CreationDate="2015-12-11T05:18:03.793" Score="6" Body="&lt;p&gt;There is a way! The problem with using term is that term doesn't understand some of the escape sequences Julia sends, which causes term to put a bunch of extra prompts on the screen that make it unusable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method should also work for more or less any REPL or terminal application you could want to run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a ridiculously useful terminal application called screen that can come to rescue! While my favorite use of screen is to create sessions detachable from a terminal or ssh session (meaning that you can ssh into a computer, run a screen session, detach it, close the ssh connection, and your process will keep running), it also happens to solve our problem here by translating julia's messages into a language term can understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install screen (e.g. &quot;sudo apt-get install screen&quot; in Ubuntu)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then run screen inside term, and run julia inside screen. Observe: It works perfectly! You can run &quot;screen julia&quot; to make a screen session immediately open julia.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some code you can add to your .emacs file to create a command (julia-repl) to launch a julia in a screen in a term and bind it to a key combination (&quot;C-x j&quot; - you can of course edit it to be whatever combination you prefer):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(defun julia-repl ()&#xA;  &quot;Runs Julia in a screen session in a `term' buffer.&quot;&#xA;  (interactive)&#xA;  (require 'term)&#xA;  (let ((termbuf (apply 'make-term &quot;Julia REPL&quot; &quot;screen&quot; nil (split-string-and-unquote &quot;julia&quot;))))&#xA;    (set-buffer termbuf)&#xA;    (term-mode)&#xA;    (term-char-mode)&#xA;    (switch-to-buffer termbuf)))&#xA;(global-set-key (kbd &quot;C-x j&quot;) 'julia-repl)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is some more useful code - I'm using Google Drive links because otherwise it would be really long:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I strongly recommend the following to make &lt;code&gt;C-x&lt;/code&gt; the default escape char for giving emacs commands, rather that &lt;code&gt;C-c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq term-escape-char [24])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This emulates the ESS command Michael mentioned, except that it doesn't load variables (you can presumably do that pretty straightforwardly from the REPL):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://drive.google.com/file/d/0B7M8PPMhKHOLeWU2SVF4NjZKRVU/view?usp=sharing&quot; rel=&quot;nofollow&quot;&gt;https://drive.google.com/file/d/0B7M8PPMhKHOLeWU2SVF4NjZKRVU/view?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(there was a bug in the original version I uploaded, but it is now fixed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mode allows one to enter a sort of shell mode within the REPL by automatically sending semicolons. Default keybinding set to &lt;code&gt;C-x ;&lt;/code&gt;. You exit the mode by pressing &lt;code&gt;C-x ;&lt;/code&gt; again or by hitting backspace at the prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://drive.google.com/file/d/0B7M8PPMhKHOLTWFfRmtTUXUtN2c/view?usp=sharing&quot; rel=&quot;nofollow&quot;&gt;https://drive.google.com/file/d/0B7M8PPMhKHOLTWFfRmtTUXUtN2c/view?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: The (setq term-escape char [24]) at the beginning causes C-x to become the escape key instead of C-c. I think that's much better to use, but if you don't want it, don't set it, and use a different hotkey for this mode.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastEditorUserId="-1" LastEditDate="2015-12-21T22:56:26.240" LastActivityDate="2015-12-21T22:56:26.240" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18777" PostTypeId="2" ParentId="18775" CreationDate="2015-12-11T05:24:05.600" Score="1" Body="&lt;p&gt;An (inferior) alternative is to use an IJulia console. This is what I had been doing before I learned about the screen trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of running &quot;screen julia&quot; in ansi-term, you'd have to run something like &quot;ipython3 console --kernel=julia-0.4&quot; (replace 0.4 with the appropriate number for the Julia version on your computer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If IJulia console ever gets cool magic like IPython has, there might be a reason to do this. Right now, I can't think of a single reason to use an IJulia console over the standard Julia REPL, while there are a number of reasons the standard REPL is better than the IJulia console. IJulia primarily exists for the sake of the Notebook.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastEditorUserId="10424" LastEditDate="2015-12-11T15:01:49.867" LastActivityDate="2015-12-11T15:01:49.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18779" PostTypeId="1" AcceptedAnswerId="18962" CreationDate="2015-12-11T07:27:18.907" Score="3" ViewCount="1148" Body="&lt;p&gt;I use an &lt;code&gt;org&lt;/code&gt; file called &lt;code&gt;books.org&lt;/code&gt; to store all the information about my books, including the location of the files (&lt;code&gt;.pdf&lt;/code&gt; or &lt;code&gt;.djvu&lt;/code&gt;). Usually I open these files directly from Emacs by pressing &lt;code&gt;C-c o&lt;/code&gt;. This works like a charm with &lt;code&gt;.pdf&lt;/code&gt; which are opened in Evince because I added this lines in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;  '(lambda ()&#xA;     (delete '(&quot;\\.pdf\\'&quot; . default) org-file-apps)&#xA;     (add-to-list 'org-file-apps '(&quot;\\.pdf\\'&quot; . &quot;evince %s&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but not with &lt;code&gt;.djvu&lt;/code&gt; which are not opened even if Evince can handle both filetypes. Do you know how I can tell to Emacs to use Evince to open these files?&lt;/p&gt;&#xA;" OwnerUserId="7199" LastEditorUserId="2609" LastEditDate="2015-12-12T08:50:22.053" LastActivityDate="2017-02-02T16:28:51.940" Title="Opening .djvu files from emacs links" Tags="|org-mode|pdf|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18781" PostTypeId="2" ParentId="18550" CreationDate="2015-12-11T10:19:47.127" Score="1" Body="&lt;p&gt;Whenever you create a new commit on a branch, then the respective wip refs are reset to start at that new commit. From the perspective of the garbage collector the effect is about the same as if you deleted the wip refs and then recreated them. (Actually this does not happen right after creating a new &quot;real commit&quot; but only after additionally performing something that triggers an update to the wip refs, such as staging a change).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since you mention that you also want to remove the wip refs themselves, not just outdated wip commits, I assume you want to stop using the wip modes altogether.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately there's no Magit command to purge the wip refs. You'll have to use something like this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git update-ref -d refs/wip/index/refs/heads/master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-12-11T10:19:47.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18782" PostTypeId="2" ParentId="18200" CreationDate="2015-12-11T10:36:50.003" Score="0" Body="&lt;p&gt;The addition you suggested does the job just fine. I've added them now. Sorry for the delay. It would of course be nice if this also jumped to the correct change, but that isn't implemented yet (see &lt;a href=&quot;https://github.com/magit/magit/issues/1566&quot; rel=&quot;nofollow&quot;&gt;issue #1566&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-12-11T10:36:50.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18783" PostTypeId="2" ParentId="18771" CreationDate="2015-12-11T11:13:55.387" Score="2" Body="&lt;p&gt;Don't know what kind of &lt;em&gt;documentation&lt;/em&gt; you want, I use the following to display a short summary of elisp function/variable's docstring with popup:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun chunyang-elisp-function-or-variable-quickhelp (symbol)&#xA;  &quot;Display summary of function or variable at point.&#xA;&#xA;Adapted from `describe-function-or-variable'.&quot;&#xA;  (interactive&#xA;   (let* ((v-or-f (variable-at-point))&#xA;          (found (symbolp v-or-f))&#xA;          (v-or-f (if found v-or-f (function-called-at-point))))&#xA;     (list v-or-f)))&#xA;  (if (not (and symbol (symbolp symbol)))&#xA;      (message &quot;You didn't specify a function or variable&quot;)&#xA;    (let* ((fdoc (when (fboundp symbol)&#xA;                   (or (documentation symbol t) &quot;Not documented.&quot;)))&#xA;           (fdoc-short (and (stringp fdoc)&#xA;                            (substring fdoc 0 (string-match &quot;\n&quot; fdoc))))&#xA;           (vdoc (when  (boundp symbol)&#xA;                   (or (documentation-property symbol 'variable-documentation t)&#xA;                       &quot;Not documented as a variable.&quot;)))&#xA;           (vdoc-short (and (stringp vdoc)&#xA;                            (substring vdoc 0 (string-match &quot;\n&quot; vdoc)))))&#xA;      (and (require 'popup nil 'no-error)&#xA;           (popup-tip&#xA;            (or&#xA;             (and fdoc-short vdoc-short&#xA;                  (concat fdoc-short &quot;\n\n&quot;&#xA;                          (make-string 30 ?-) &quot;\n&quot; (symbol-name symbol)&#xA;                          &quot; is also a &quot; &quot;variable.&quot; &quot;\n\n&quot;&#xA;                          vdoc-short))&#xA;             fdoc-short&#xA;             vdoc-short)&#xA;            :margin t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is what it looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/H9W8U.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/H9W8U.png&quot; alt=&quot;Screenshot of chunyang-elisp-function-or-variable-quickhelp&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2015-12-11T11:13:55.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18784" PostTypeId="2" ParentId="18773" CreationDate="2015-12-11T14:28:21.600" Score="20" Body="&lt;p&gt;I suggest you use the &lt;a href=&quot;https://github.com/m00natic/vlfi&quot;&gt;&lt;code&gt;vlf&lt;/code&gt; package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It handles opening larges files in chunks and is very performant, I use it regularly to open files ~2gb.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your config, require &lt;code&gt;vlf-setup&lt;/code&gt; to have &lt;code&gt;vlf&lt;/code&gt; ask you if you want to use &lt;code&gt;vlf&lt;/code&gt; every time you try to open a large file. This means it works with anything that uses &lt;code&gt;find-file&lt;/code&gt; such as &lt;code&gt;helm-find-files&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="115" LastEditDate="2015-12-11T14:52:09.230" LastActivityDate="2015-12-11T14:52:09.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18785" PostTypeId="2" ParentId="18774" CreationDate="2015-12-11T15:07:17.303" Score="14" Body="&lt;p&gt;You can customize &lt;code&gt;safe-local-variable-values&lt;/code&gt; in your init file. This will require you to also specify which values you consider safe. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'safe-local-variable-values '(var . value))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is OK if you know the set of possible values, as your question implies you do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to make a variable safe for all values that satisfy a predicate, you can do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'var 'safe-local-variable #'stringp) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6615" LastEditorUserId="2274" LastEditDate="2016-09-13T22:11:23.077" LastActivityDate="2016-09-13T22:11:23.077" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18786" PostTypeId="1" AcceptedAnswerId="18809" CreationDate="2015-12-11T15:33:20.450" Score="2" ViewCount="743" Body="&lt;p&gt;I can send mail with message, via &lt;code&gt;C-x m&lt;/code&gt;. However, when I try to send a message from Gnus, via &lt;code&gt;m&lt;/code&gt; in the summary buffer, or other commands like &lt;code&gt;S r&lt;/code&gt;, &lt;code&gt;F&lt;/code&gt; etc, the message shows up in my sent folder in Gnus, but doesn't actually get sent. i.e., everything appears to work as expected from Gnus, no errors are generated, but the recipient doesn't get the email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to do something specific to configure Gnus to send mail? I have the following config which appears to be sufficient for message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-select-method&#xA;      '(nnimap &quot;&amp;lt;my-mail-server&amp;gt;&quot;)&#xA;       send-mail-function 'smtpmail-send-it&#xA;       smtpmail-smtp-server  &quot;&amp;lt;my-mail-server&amp;gt;&quot;&#xA;       smtpmail-stream-type  'ssl&#xA;       smtpmail-smtp-service 465)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-12-12T15:05:46.180" Title="Can't send mail from Gnus, but message works?" Tags="|gnus|email|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18787" PostTypeId="1" AcceptedAnswerId="18789" CreationDate="2015-12-11T17:09:40.587" Score="0" ViewCount="63" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I strip non-word characters from a string?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an arbitrary string, how do I strip all characters with non-word syntax?  Alternately, using a regexp, how do I strip out the non-alphabetic characters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hypothetical example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(some-fnx &quot;#here's a string!&quot;) ; =&amp;gt; &quot;heres a string&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Specific application:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to get a list of the LaTeX font commands without the markup syntax.  The value of &lt;code&gt;LaTeX-font-list&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((1 &quot;&quot; &quot;&quot; &quot;\\mathcal{&quot; &quot;}&quot;)&#xA; (2 &quot;\\textbf{&quot; &quot;}&quot; &quot;\\mathbf{&quot; &quot;}&quot;)&#xA; (3 &quot;\\textsc{&quot; &quot;}&quot;)&#xA; (5 &quot;\\emph{&quot; &quot;}&quot;)&#xA; (6 &quot;\\textsf{&quot; &quot;}&quot; &quot;\\mathsf{&quot; &quot;}&quot;)&#xA; (9 &quot;\\textit{&quot; &quot;}&quot; &quot;\\mathit{&quot; &quot;}&quot;)&#xA; (13 &quot;\\textmd{&quot; &quot;}&quot;)&#xA; (14 &quot;\\textnormal{&quot; &quot;}&quot; &quot;\\mathnormal{&quot; &quot;}&quot;)&#xA; (18 &quot;\\textrm{&quot; &quot;}&quot; &quot;\\mathrm{&quot; &quot;}&quot;)&#xA; (19 &quot;\\textsl{&quot; &quot;}&quot; &quot;\\mathbb{&quot; &quot;}&quot;)&#xA; (20 &quot;\\texttt{&quot; &quot;}&quot; &quot;\\mathtt{&quot; &quot;}&quot;)&#xA; (21 &quot;\\textup{&quot; &quot;}&quot;)&#xA; (4 &quot;&quot; &quot;&quot; t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to iterate through the nested lists in order to get returned values like &quot;textbf&quot;, &quot;textrm&quot;, etc., without the rest of the markup.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-12-11T19:01:09.287" Title="Strip arbitrary characters from a string?" Tags="|regular-expressions|syntax|string|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18789" PostTypeId="2" ParentId="18787" CreationDate="2015-12-11T19:01:09.287" Score="2" Body="&lt;p&gt;I'll go for the regex route:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar (lambda (item) (replace-regexp-in-string &quot;\\W&quot; &quot;&quot; (cadr item)))&#xA;        LaTeX-font-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-12-11T19:01:09.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18790" PostTypeId="1" AcceptedAnswerId="18791" CreationDate="2015-12-11T19:34:00.797" Score="3" ViewCount="115" Body="&lt;p&gt;For some reason it appears eshell/echo can't handle dashes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo &quot;aaaaaaaaaaaaa&quot;&#xA;aaaaaaaaaaaaa&#xA;$ echo &quot;=============&quot;&#xA;=============&#xA;$ echo &quot;-------------&quot;&#xA;$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this expected behavior? I assume it's interpreting the dashes as flags and the quote isn't helping inhibit that. Should I be escaping it a different way?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-12-11T21:35:17.833" Title="Why can't eshell/echo print dashes?" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18791" PostTypeId="2" ParentId="18790" CreationDate="2015-12-11T21:03:21.463" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;--&lt;/code&gt; to tell &lt;code&gt;eshell&lt;/code&gt; not to interpret arguments that follow as command-line switches. This is the standard way of passing an argument (such as a file name) starting with a dash to GNU tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary: try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo -- &quot;-------------&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or just&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo -- -------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(as far as I can tell all arguments are interpreted as strings).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two issues (I would even say &lt;em&gt;bugs&lt;/em&gt; here):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;eshell--process-args&lt;/code&gt; uses &lt;code&gt;&quot;^-\\(-\\)?\\(.*\\)&quot;&lt;/code&gt; to match switches, i.e. anything starting with one or two dashes is treated as a switch and removed from the list of arguments. If we disallow switches starting with three dashes and use &lt;code&gt;&quot;^-\\(-\\)?\\([^-].*\\)&quot;&lt;/code&gt;, &lt;code&gt;echo ---&lt;/code&gt; works as expected.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;eshell--process-option&lt;/code&gt; has a bug that prevents it from printing an error message when an unrecognized switch is passed to an &lt;code&gt;eshell&lt;/code&gt; command without an &quot;external&quot; equivalent.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See the code block below for the fixed version. (Note that &lt;code&gt;(error ...)&lt;/code&gt; is outside &lt;code&gt;(when extcmd ...)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun eshell--process-option (name switch kind ai options opt-vals)&#xA;  &quot;For NAME, process SWITCH (of type KIND), from args at index AI.&#xA;    The SWITCH will be looked up in the set of OPTIONS.&#xA;&#xA;    SWITCH should be either a string or character.  KIND should be the&#xA;    integer 0 if it's a character, or 1 if it's a string.&#xA;&#xA;    The SWITCH is then be matched against OPTIONS.  If no matching handler&#xA;    is found, and an :external command is defined (and available), it will&#xA;    be called; otherwise, an error will be triggered to say that the&#xA;    switch is unrecognized.&quot;&#xA;  (let* ((opts options)&#xA;         found)&#xA;    (while opts&#xA;      (if (and (listp (car opts))&#xA;               (nth kind (car opts))&#xA;               (equal switch (nth kind (car opts))))&#xA;          (progn&#xA;            (eshell--set-option name ai (car opts) options opt-vals)&#xA;            (setq found t opts nil))&#xA;        (setq opts (cdr opts))))&#xA;    (unless found&#xA;      (let ((extcmd (memq ':external options)))&#xA;        (when extcmd&#xA;          (setq extcmd (eshell-search-path (cadr extcmd)))&#xA;          (if extcmd&#xA;              (throw 'eshell-ext-command extcmd)))&#xA;        (error (if (characterp switch) &quot;%s: unrecognized option -%c&quot;&#xA;                 &quot;%s: unrecognized option --%s&quot;)&#xA;               name switch)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS: I'm using &lt;code&gt;GNU Emacs 24.5.1&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2015-12-11T21:35:17.833" LastActivityDate="2015-12-11T21:35:17.833" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18792" PostTypeId="2" ParentId="17431" CreationDate="2015-12-11T22:57:47.223" Score="4" Body="&lt;p&gt;I added advice to the load-theme function to override certain faces - that way you can continue to use load-theme as normal to select a theme and it'll apply the overrides automatically. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice load-theme (after theme-set-overrides activate)&#xA;  &quot;Set override faces for different custom themes.&quot;&#xA;  (dolist (theme-settings theme-overrides)&#xA;    (let ((theme (car theme-settings))&#xA;          (faces (cadr theme-settings)))&#xA;      (if (member theme custom-enabled-themes)&#xA;          (dolist (face faces)&#xA;            (custom-theme-set-faces theme face))))))&#xA;&#xA;(defcustom theme-overrides nil&#xA;  &quot;Association list of override faces to set for different custom themes.&quot;)&#xA;&#xA;(defun alist-set (alist-symbol key value)&#xA;  &quot;Set VALUE of a KEY in ALIST-SYMBOL.&quot;&#xA;  (set alist-symbol&#xA;        (cons (list key value) (assq-delete-all key (eval alist-symbol)))))&#xA;&#xA;; override some settings of the ample-flat theme&#xA;(alist-set 'theme-overrides 'ample-flat '(&#xA;                                          (default ((t (:background &quot;gray12&quot; :foreground &quot;#bdbdb3&quot;))))&#xA;                                          (mode-line ((t (:background &quot;cornsilk4&quot; :foreground &quot;#222&quot; :inherit 'variable-pitch))))&#xA;                                          (outline-2 ((t (:inherit font-lock-keyword-face)))) ; blueish&#xA;                                          (outline-3 ((t (:inherit font-lock-comment-face)))) ; brownish&#xA;                                          (outline-4 ((t (:inherit font-lock-string-face)))) ; orangeish&#xA;                                          (org-table ((t (:inherit fixed-pitch :height 0.7 :foreground &quot;#887&quot;))))&#xA;                                          (org-formula ((t (:inherit org-table :foreground nil))))&#xA;                                          ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, and it would be nice to have as part of the interface, but it's probably simplest to just make a function for each theme that you use and call custom-theme-set-faces after loading it - &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ample-flat ()&#xA;  (interactive)&#xA;  (mapc #'disable-theme custom-enabled-themes) ; clear any existing themes&#xA;  (load-theme 'ample-flat t)&#xA;  (custom-theme-set-faces 'ample-flat &#xA;                          '(default ((t (:background &quot;gray12&quot; :foreground &quot;#bdbdb3&quot;))))&#xA;                          '(mode-line ((t (:background &quot;cornsilk4&quot; :foreground &quot;#222&quot; :inherit 'variable-pitch))))&#xA;                          '(outline-2 ((t (:inherit font-lock-keyword-face)))) ; blueish&#xA;                          '(outline-3 ((t (:inherit font-lock-comment-face)))) ; brownish&#xA;                          '(outline-4 ((t (:inherit font-lock-string-face)))) ; orangeish&#xA;                          '(org-table ((t (:inherit fixed-pitch :height 0.7 :foreground &quot;#887&quot;))))&#xA;                          '(org-formula ((t (:inherit org-table :foreground nil))))&#xA;                          ))&#xA;&#xA;(ample-flat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2015-12-13T23:57:11.127" LastActivityDate="2015-12-13T23:57:11.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18793" PostTypeId="1" CreationDate="2015-12-11T23:13:44.503" Score="8" ViewCount="1423" Body="&lt;p&gt;When I run &lt;code&gt;package-install&lt;/code&gt; in windows with &lt;code&gt;Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570&lt;/code&gt; I got error &lt;code&gt;error in process filter: could not create connection to marmalade-repo.org:433&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;https://marmalade-repo.org/packages/#windowsinstructions&quot; rel=&quot;noreferrer&quot;&gt;web site&lt;/a&gt; of marmalade, that happens because they changed &lt;code&gt;http&lt;/code&gt; to &lt;code&gt;https&lt;/code&gt; and to avoid the error I followed the instruction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But by &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; I got the same error &lt;code&gt;error in process filter: could not create connection to marmalade-repo.org:433&lt;/code&gt;.&#xA;What can I do to avoid the error?&lt;/p&gt;&#xA;" OwnerUserId="10106" LastActivityDate="2015-12-11T23:13:44.503" Title="error in process filter: could not create connection to marmalade-repo.org:433" Tags="|package|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18794" PostTypeId="1" CreationDate="2015-12-12T00:13:58.390" Score="5" ViewCount="1137" Body="&lt;p&gt;I decided to use killer combination emacs + org mode + latex to take my lessons at school, the only thing that force me to use paper and not be an ecological student is for drawing and painting schemas...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that there are some mode that let you draw something in ascii some are able to use the mouse (like integrated artist-mode), and export it as a real picture, but it doesn't appeal me, programming picture too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be the best solution for me is to quickly run a painting application from emacs which will export by default the picture in a location that emacs would know so the links to the image would be inserted automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sure it is possible, I think it doesn't require that much lisp knowledge, but I still need some help...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can run an external command with exec, I may be able to pass the location in argument of the painting program and inserting the link won't be too difficult.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need your help for managing images name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get different default names for each picture ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to recover the name so I can save it to another name ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And How can I reopen the application to modify the picture ? (like C-c C-c is able to reevaluate source code... )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have never coded in lisp, but after configurating a bit emacs it doesn't seem to difficult...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am excited about lisp coding ! I need your help though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps: I am not aware of extensions that do the trick, tell me if there are some.&lt;/p&gt;&#xA;" OwnerUserId="10306" LastEditorUserId="105" LastEditDate="2016-06-22T20:15:03.797" LastActivityDate="2016-08-22T21:24:46.963" Title="Draw image outside of emacs and use it in org" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18795" PostTypeId="1" AcceptedAnswerId="18796" CreationDate="2015-12-12T00:49:44.303" Score="2" ViewCount="696" Body="&lt;p&gt;I want to make an alias in eshell so that when I type gcc it actually does &lt;code&gt;gcc -Wall -pedantic -std=c99&lt;/code&gt; but when I make the alias, it just displays &lt;code&gt;gcc -Wall -pedantic -std=c99&lt;/code&gt; and doesn't actually compile the program. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="10468" LastActivityDate="2015-12-12T01:09:45.910" Title="How to make an alias in eshell" Tags="|eshell|c|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18796" PostTypeId="2" ParentId="18795" CreationDate="2015-12-12T01:09:45.910" Score="3" Body="&lt;p&gt;In eshell aliases &lt;code&gt;$*&lt;/code&gt; is replaced by the list of arguments passed after the aliased command. (You can also use &lt;code&gt;$1&lt;/code&gt; to get the first argument, &lt;code&gt;$2&lt;/code&gt; for the second, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias gcc &quot;gcc -Wall -pedantic -std=c99 \$*&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I know this behavior is not documented in the manual. See the &lt;a href=&quot;http://www.emacswiki.org/emacs/EshellAlias&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki Eshell Alias&lt;/a&gt; page and the comment at the top of &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/eshell/em-alias.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;em-alias.el&lt;/code&gt;&lt;/a&gt;, though.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2015-12-12T01:09:45.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18797" PostTypeId="2" ParentId="18704" CreationDate="2015-12-12T02:11:26.810" Score="1" Body="&lt;p&gt;Apparently, the documentation is bad: this per the former maintainer of calc-vec.el, Jay Belanger. His advice (besides contacting emacs-devel@gnu.org) was to simply go to the main Calc docs (e.g. &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/calc/Extracting-Elements.html#Extracting-Elements&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/calc/Building-Vectors.html#Building-Vectors&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;) and use those function names (usually the one in brackets) prefixed by &lt;code&gt;calcFunc-&lt;/code&gt;. Another curiosity is you need to refer to a vector in its &quot;internal&quot; format, namely a list: &lt;code&gt;(vec 1 2 3)&lt;/code&gt;, which then can be seen as a normal Calc vector with &lt;code&gt;calc-eval&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq myv1 '(vec 1 2 3))&#xA;  =&amp;gt; (vec 1 2 3)&#xA;(calc-eval myv1)&#xA;  =&amp;gt; &quot;[1, 2, 3]&quot;&#xA;(calcFunc-subvec myv1 1 3)&#xA;  =&amp;gt; (vec 1 2)&#xA;(calcFunc-vlen myv1)&#xA;  =&amp;gt; 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it can get ugly. . .&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq myv2 '(vec 2 4 6 8))&#xA;(calcFunc-arrange myv2 1)&#xA;  =&amp;gt; (vec (vec 2) (vec 4) (vec 6) (vec 8))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;requiring &lt;code&gt;calc-eval&lt;/code&gt; to make it pretty&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calc-eval (calcFunc-arrange myv2 1))&#xA;  =&amp;gt;&quot;[[2], [4], [6], [8]]&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;why &lt;code&gt;calc-eval&lt;/code&gt; does this, I don't know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is not always easy. Here's an example that seems only &lt;code&gt;calc-eval&lt;/code&gt;-friendly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calc-eval &quot;deg(37@ 26' 36.42\&quot;)&quot;)&#xA;  =&amp;gt; &quot;37.44345&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is as close as I can get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calcFunc-deg '(hms 37 26 36))&#xA;  =&amp;gt; (float 374433333333 -10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it won't accept &lt;code&gt;36.42&lt;/code&gt; for some reasons better minds than mine might understand from this &lt;code&gt;calc-math.el&lt;/code&gt; code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Convert A from HMS or radians to degrees.&#xA;(defun calcFunc-deg (a)   ; [R R] [Public]&#xA;  (cond ((or (Math-numberp a)&#xA;         (eq (car a) 'intv))&#xA;     (math-with-extra-prec 2&#xA;       (math-div a (math-pi-over-180))))&#xA;    ((eq (car a) 'hms)&#xA;     (math-from-hms a 'deg))&#xA;    ((eq (car a) 'sdev)&#xA;     (math-make-sdev (calcFunc-deg (nth 1 a))&#xA;             (calcFunc-deg (nth 2 a))))&#xA;    (math-expand-formulas&#xA;     (math-div (math-mul 180 a) '(var pi var-pi)))&#xA;    ((math-infinitep a) a)&#xA;    (t (list 'calcFunc-deg a))))&#xA;(put 'calcFunc-deg 'math-expandable t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;. . . yes, the lengths some people go to stay in Emacs, i.e., I'm trying to follow a Coursera course that wants me to use Python, but I know a better way. . . &lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2015-12-12T02:11:26.810" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18800" PostTypeId="1" CreationDate="2015-12-12T10:41:06.830" Score="5" ViewCount="892" Body="&lt;p&gt;How do I disable all pre-existing yasnippet snippets?  I only want to use ones that I define myself.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="253" LastEditDate="2015-12-12T18:37:00.480" LastActivityDate="2015-12-12T18:37:00.480" Title="Disable default Yasnippet snippets?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18801" PostTypeId="1" AcceptedAnswerId="18802" CreationDate="2015-12-12T10:47:36.447" Score="1" ViewCount="307" Body="&lt;p&gt;I'm relatively new to emacs and currently working through the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/pdf/eintr.pdf&quot; rel=&quot;nofollow&quot;&gt;introduction to elisp&lt;/a&gt;. In chapter 4 I came across the &lt;code&gt;find-tag&lt;/code&gt; which should display the source code of its argument. I typed &lt;code&gt;M-x find-tag RET&lt;/code&gt; followed by the argument &lt;code&gt;copy-to-buffer&lt;/code&gt;. The echo-area shows the following message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Visit tags table (default TAGS): ~/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but there is no TAGS file. But somewhere must be the tag tabled (default one) be installed. I run a &lt;code&gt;find&lt;/code&gt; for &lt;code&gt;TAGS&lt;/code&gt; on all directories but no file was found. Where is this file located?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My setup is: Debian 8.2 and emacs 24.4.1&lt;/p&gt;&#xA;" OwnerUserId="10470" LastActivityDate="2015-12-12T11:26:37.367" Title="Where is the tag table located?" Tags="|ctags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18802" PostTypeId="2" ParentId="18801" CreationDate="2015-12-12T11:26:37.367" Score="2" Body="&lt;p&gt;A tag table is a project-specific lookup index.  It must be generated and updated periodically.  You can use &lt;code&gt;etags&lt;/code&gt; or &lt;code&gt;ctags&lt;/code&gt; to do that kind of thing, I do for example run &lt;code&gt;etags *.c *.h&lt;/code&gt; in &lt;code&gt;emacs/src&lt;/code&gt; to index all C and header files.  The resulting &lt;code&gt;TAGS&lt;/code&gt; file is placed in the same directory and needs to be selected by &lt;code&gt;M-x find-tag&lt;/code&gt; for it to discover definition locations.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-12-12T11:26:37.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18805" PostTypeId="1" AcceptedAnswerId="18820" CreationDate="2015-12-12T13:28:06.817" Score="0" ViewCount="233" Body="&lt;p&gt;I heard about Evil-mode, but will it work in all windows? I mean, emacs is more than text editor, and every specialised window has it's own hotkeys. Are there hotkey conflicts between Evil-mode and these?&lt;/p&gt;&#xA;" OwnerUserId="10411" LastEditorUserId="2823" LastEditDate="2015-12-12T15:13:28.247" LastActivityDate="2015-12-12T19:57:45.000" Title="How well does evil work with all emacs modes?" Tags="|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18806" PostTypeId="1" AcceptedAnswerId="18810" CreationDate="2015-12-12T13:33:17.230" Score="-1" ViewCount="193" Body="&lt;p&gt;I'm sure that almost everybody configured emacs in some way or another, but how many people shared their configurations, and where can I get them? I'm interested in something like starter packs, in things that make keyboard hotkeys less painful for newcomers.&lt;/p&gt;&#xA;" OwnerUserId="10411" LastActivityDate="2015-12-12T15:36:39.777" Title="Anybody did somethinig like &quot;alternative hotkey packs&quot; for emacs?" Tags="|key-bindings|" AnswerCount="1" CommentCount="4" ClosedDate="2015-12-13T20:40:42.347" ContentLicense="CC BY-SA 3.0" />
  <row Id="18807" PostTypeId="1" AcceptedAnswerId="18826" CreationDate="2015-12-12T13:57:39.220" Score="3" ViewCount="841" Body="&lt;p&gt;I would like to prevent Emacs from reporting on everyting that is being loaded at startup in the minibuffer. This is because it seems to pause when telling me which files are being loaded that I have specified myself in my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have byte-compiled the files that I load from my init file, but the minibuffer still gives me the same message and waits for ~3 seconds per loaded file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already use many &lt;code&gt;(inhibit startup-* t)&lt;/code&gt; style commands in my init file, so that emacs is faster at startup and I don't get the GNU start screen etc., but I cannot find an equivalent for the &lt;em&gt;minibuffer&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found &lt;code&gt;mini-buffer-message&lt;/code&gt; and &lt;code&gt;minibuffer-massage-timeout&lt;/code&gt;, with the option to set how long messages appear for, which sounds great, but I only want this action (i.e. := zero!) for the startup process, I want the messages otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something &lt;a href=&quot;https://stackoverflow.com/questions/11498108/elisp-silence-loading-messages-in-batch-mode&quot;&gt;similar to this&lt;/a&gt; might be an idea, but it isn't meant for the Emacs GUI, rather terminal use of eLisp, as far as I can understand.&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-12-13T08:38:31.670" Title="Turning off loading messages in Emacs minibuffer/GUI at startup" Tags="|start-up|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18808" PostTypeId="1" CreationDate="2015-12-12T14:20:46.993" Score="0" ViewCount="350" Body="&lt;p&gt;I have a hint for leuven which look quite nice, especially the presentation in orgmode, so I've installed with from the package manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I can't find it in &lt;code&gt;M-x cusomize-themes&lt;/code&gt;, I have tried to load it with &lt;code&gt;(load-theme 'leuven)&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt;, and this cause emacs -daemon failing to start...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone ever encountered that problem with leuven theme before ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2017-03-04T06:59:08.897" Title="Leuven theme cause emacsclient not to start" Tags="|themes|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18809" PostTypeId="2" ParentId="18786" CreationDate="2015-12-12T15:05:46.180" Score="0" Body="&lt;p&gt;I think I found a solution. The customization variable &lt;code&gt;message-send-mail-function&lt;/code&gt; was set to &lt;code&gt;message-send-mail-with-sendmail&lt;/code&gt;. My configuration (in the question above) appear to have over-ridden this when sending mail from &lt;code&gt;message&lt;/code&gt;, but not when sending/posting mail from &lt;code&gt;gnus&lt;/code&gt;. Somewhere in the posting process I think &lt;code&gt;gnus&lt;/code&gt; was querying the function &lt;code&gt;message-send-mail-function&lt;/code&gt;, which returned the value of the &lt;code&gt;message-send-mail-function&lt;/code&gt; variable, which was wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;code&gt;message-send-mail-with-function&lt;/code&gt; to &lt;code&gt;smtpmail-send-it&lt;/code&gt; seems to have fixed this problem. I suspect the ultimate source of the problem is that sendmail was installed on my machine but misconfigured. Emacs detected this and set the default values based on that. Maybe. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-12-12T15:05:46.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18810" PostTypeId="2" ParentId="18806" CreationDate="2015-12-12T15:36:39.777" Score="0" Body="&lt;p&gt;I know of a handful of modes and distributions that are along these lines, though ultimately I tuned my own bindings based on my usage.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs itself has &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/CUA-Bindings.html&quot; rel=&quot;nofollow&quot;&gt;CUA mode&lt;/a&gt;, which makes many keybindings more like newer editors.  There's also &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;Spacemacs&lt;/a&gt;, which, among other things, includes keybindings that are more like Vim.  &lt;a href=&quot;https://github.com/technomancy/better-defaults&quot; rel=&quot;nofollow&quot;&gt;better-defaults&lt;/a&gt; alters the behavior of certain keybindings, rather than the bindings themselves.  If you're focused on RSI issues, &lt;a href=&quot;http://ergoemacs.github.io/&quot; rel=&quot;nofollow&quot;&gt;ergomacs-mode&lt;/a&gt; might be worth a look.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to tune any of these further for your specific use case, I highly recommend checking out &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow&quot;&gt;hydra&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="618" LastActivityDate="2015-12-12T15:36:39.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18811" PostTypeId="2" ParentId="18808" CreationDate="2015-12-12T15:51:42.320" Score="0" Body="&lt;p&gt;The best way would be to make sure it does appear in your &lt;code&gt;customize-themes&lt;/code&gt;menu, rather than loading it manually via your init file. Leuven appear sin my list of themes (although you can see below I do not use it as default)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is you can see in the image below, there is the tip at the top &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Theme files are named *-theme.el in `custom-theme-load-path'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BrWHZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BrWHZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So make sure you have the file saved on that path. To get help with this, try &lt;code&gt;C-h v&lt;/code&gt; then &lt;code&gt;custom-theme-load-path&lt;/code&gt;, which will show you the current path(s) defined and gives hints on how to customise it.&lt;/p&gt;&#xA;" OwnerUserId="9558" LastActivityDate="2015-12-12T15:51:42.320" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18812" PostTypeId="1" AcceptedAnswerId="18814" CreationDate="2015-12-12T16:05:36.050" Score="3" ViewCount="263" Body="&lt;p&gt;I cannot understand the behavior of this simple code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (str bool)&#xA;  (interactive&#xA;    (list (read-string &quot;Some text: &quot;)&#xA;          (y-or-n-p &quot;Yes or no? &quot;)))&#xA;  (message &quot;%s is first&quot; str)&#xA;  (if bool (message &quot;%s is in if&quot; str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call it with &lt;code&gt;M-x foo&lt;/code&gt;, it prompts for a string input -- which I give as &lt;code&gt;this&lt;/code&gt; -- then &lt;code&gt;Yes or no?&lt;/code&gt; Good so far. But if I type in &lt;code&gt;n&lt;/code&gt;, it prints out &lt;code&gt;this is first&lt;/code&gt;. But if I choose &lt;code&gt;y&lt;/code&gt;, it seems to jump past the &lt;code&gt;(message &quot;%s is first&quot; str)&lt;/code&gt; line and enter the &lt;code&gt;if&lt;/code&gt;, which is true (not nil), printing &lt;code&gt;this is in f&lt;/code&gt;. Why is the line before &lt;code&gt;if...&lt;/code&gt; being skipped if I choose &lt;code&gt;y&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-06-22T20:14:28.620" LastActivityDate="2016-06-22T20:14:28.620" Title="Elisp code execution order?" Tags="|interactive|message|conditionals|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18813" PostTypeId="1" CreationDate="2015-12-12T16:19:16.733" Score="4" ViewCount="108" Body="&lt;p&gt;For my Emacs configuration, I use a literate programming setup. My config files are in org-mode format, and my &lt;code&gt;init.el&lt;/code&gt; file consists mostly of &lt;code&gt;org-babel&lt;/code&gt; lines like &lt;code&gt;(org-babel-load-file &quot;~/emacs/startup.org&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often use &lt;code&gt;describe-key&lt;/code&gt; to look up custom functions I have created in order to edit them. However, &lt;code&gt;describe-key&lt;/code&gt; gives me something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-s-g runs the command gnugol, which is an interactive Lisp function in `startup.el'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in which &lt;code&gt;startup.el&lt;/code&gt; is a link to that file. However in my case, startup.el is a file that's automatically generated (tangled?) every time I launch Emacs, so any edits I make to it will get overwritten. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I tell &lt;code&gt;describe-key&lt;/code&gt; to instead give me a link directly to &lt;code&gt;startup.org&lt;/code&gt; (or whatever config file contains the defun) so I can edit my actual config files?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="5213" LastEditDate="2016-03-16T17:55:52.950" LastActivityDate="2016-03-16T17:55:52.950" Title="Get describe-key links to bring me to org-mode config files, not .el config files?" Tags="|init-file|org-babel|config|literate-programming|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18814" PostTypeId="2" ParentId="18812" CreationDate="2015-12-12T16:22:48.570" Score="7" Body="&lt;p&gt;Forms in the function body are executed in order, just as you would expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you choose &quot;y&quot; if does not &quot;jump&quot; past the first &lt;code&gt;message&lt;/code&gt; call. If &lt;em&gt;looks&lt;/em&gt; like it did because the first message gets immediately replaced by the second one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To check that this is true, open the &lt;code&gt;*Messages*&lt;/code&gt; buffer and then do &lt;code&gt;M-x foo&lt;/code&gt;. You will see that &lt;code&gt;foo&lt;/code&gt; adds two messages to the bottom of this buffer, as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;edebug&lt;/code&gt; and step through your function to see what happens. To instrument a function for &lt;code&gt;edebug&lt;/code&gt;, put the cursor somewhere inside the &lt;code&gt;defun&lt;/code&gt; form and press &lt;code&gt;C-u C-M-x&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2015-12-12T16:22:48.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18815" PostTypeId="2" ParentId="18812" CreationDate="2015-12-12T16:24:38.563" Score="3" Body="&lt;p&gt;It's not being skipped. The second message is printed after the first message is printed, but there is no wait between the two, so you do not notice the first message.  Look in buffer &lt;code&gt;*Messages*&lt;/code&gt; and you will see both messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give the user time to see the first message, you can use &lt;code&gt;sit-for&lt;/code&gt; or &lt;code&gt;sleep-for&lt;/code&gt; after it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (str bool)&#xA;  (interactive (list (read-string &quot;Some text: &quot;)&#xA;               (y-or-n-p &quot;Yes or no? &quot;)))&#xA;  (message &quot;%s is first&quot; str)&#xA;  (sit-for 2)&#xA;  (when bool (message &quot;%s is in if&quot; str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-12T16:24:38.563" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18818" PostTypeId="1" AcceptedAnswerId="18910" CreationDate="2015-12-12T17:52:08.443" Score="7" ViewCount="1559" Body="&lt;p&gt;I would like have a menu created from the directory structure of the org files created as a html menu that is inserted at the top of each html file.&#xA;I know I can generate a sitemap that spans multiple files, so the required parsing is done anyway, but what about a menu in each file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I have a directory structure like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|- News.org&#xA;|- Stuff.org&#xA;|- Coding&#xA;   |- Emacs.org&#xA;   |- Lisp.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like that all four html files that are generate have a menu that says &quot;News - Stuff - Coding&quot;, and if coding is selected, there is a submenu that says &quot;Emacs - Lisp&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The styling of the menus is not important here, but is it possible to produce something like this (that can then be styled via css)?&lt;/p&gt;&#xA;" OwnerUserId="8218" LastActivityDate="2015-12-17T07:24:13.010" Title="Creating a menu from file / directory structure upon html export" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18819" PostTypeId="2" ParentId="18800" CreationDate="2015-12-12T18:06:35.680" Score="6" Body="&lt;p&gt;Customize the value of &lt;code&gt;yas-snippet-dirs&lt;/code&gt; so that it doesn't include the default snippet directory. On recent yasnippet versions this will be the symbol &lt;code&gt;yas-installed-snippets-dir&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;yas-snippet-dirs is a variable defined in `yasnippet.el'.&#xA;Its value is (&quot;~/.emacs.d/snippets&quot; yas-installed-snippets-dir)&#xA;&#xA;Documentation:&#xA;List of top-level snippet directories.&#xA;&#xA;Each element, a string or a symbol whose value is a string,&#xA;designates a top-level directory where per-mode snippet&#xA;directories can be found.&#xA;&#xA;Elements appearing earlier in the list override later elements'&#xA;snippets.&#xA;&#xA;The first directory is taken as the default for storing snippet's&#xA;created with `yas-new-snippet'. &#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-12-12T18:06:35.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18820" PostTypeId="2" ParentId="18805" CreationDate="2015-12-12T19:57:45.000" Score="1" Body="&lt;p&gt;I'll just go out and say it: Evil has compatibility problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And why shouldn't it? It's a complete re-architecturing of the traditional Emacs keybinding model. Of course it can't do everything perfectly. However with that said, &lt;strong&gt;it's nothing you can't fix with sufficient skill.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I built my personal config around &lt;code&gt;evil&lt;/code&gt; from the very beginning, and I've bumped into annoying niggles here and there, and I just fix them as I go. It ends up being a good deal of work in the long run, but the result is an Emacs that's perfectly fitted to your taste, and that's what Emacs for, after all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that said, here's a few things to note:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Most &lt;code&gt;major-modes&lt;/code&gt; that deal with actual programming languages work fine. It's the buffers that don't visit files (e.g. &lt;code&gt;magit&lt;/code&gt;) where most of the problems occur.&lt;/li&gt;&#xA;&lt;li&gt;You always have &lt;code&gt;evil-emacs-state&lt;/code&gt; (&lt;kbd&gt;C-z&lt;/kbd&gt; by default) which should emulate regular vanilla Emacs pretty well. &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil&lt;/code&gt; already has integration for a good number of packages.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;That said, if you don't want to spend the effort of blazing your own path, you might be in the market for &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;spacemacs&lt;/code&gt;&lt;/a&gt;, which should have sensible defaults for almost anything these days.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-12-12T19:57:45.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18821" PostTypeId="1" CreationDate="2015-12-12T20:45:57.107" Score="16" ViewCount="3018" Body="&lt;p&gt;Are there any tools available to make tracing errors in org-mode blocks easier?  (I'm working with python specifically)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current workflow is to copy code that works to a source block, and try to make only minimal modifications.  If major errors occur, I either copy it back to another file, or tangle the block and debug the resulting file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any tools I'm missing?  (eg, something like compilation mode where it would take you to the line the error is on.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: for example, I just found C-c C-v v, which brings up a buffer with noweb references expanded.  Unfortunately, it doesn't include header arguments, so the code from this can't be run without importing those in the interpreter first.  Similarly, if I have a return statement, that keeps it from being executed, and the buffer isn't editable, so takes several steps to get runnable source from a python block.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="2823" LastEditDate="2015-12-13T03:16:58.700" LastActivityDate="2023-09-11T15:53:29.280" Title="Debugging code blocks in org mode" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18822" PostTypeId="2" ParentId="608" CreationDate="2015-12-12T21:13:17.563" Score="1" Body="&lt;p&gt;I think that the cleanest way is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;M-.&quot;) 'xref-find-definitions)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(and also add every other map you are interested in)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;xref-find-definitions&lt;/code&gt; is the function binded to &lt;code&gt;M-.&lt;/code&gt; in emacs, as you can see using the command &lt;code&gt;C-h k&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2143" LastActivityDate="2015-12-12T21:13:17.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18823" PostTypeId="2" ParentId="18818" CreationDate="2015-12-12T22:19:26.927" Score="3" Body="&lt;p&gt;HTML/css files can be included using &lt;code&gt;#+html_head:&lt;/code&gt;.  This gets rather messy, if you have a significant amount of customization, so these can be put in a separate file and included with &lt;code&gt;#+setupfile:&lt;/code&gt;.  Even better, there are a number of themes that have been put together so you don't have to go through the details yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/fniessen/org-html-themes&quot; rel=&quot;nofollow&quot;&gt;https://github.com/fniessen/org-html-themes&lt;/a&gt; has some very nice ones.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2015-12-12T22:19:26.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18824" PostTypeId="1" CreationDate="2015-12-13T06:06:29.623" Score="0" ViewCount="33" Body="&lt;p&gt;After &lt;code&gt;text-scale-decrease&lt;/code&gt; or &lt;code&gt;text-scale-increase&lt;/code&gt; scrolling (e.g. with space, &lt;code&gt;scroll-down&lt;/code&gt;) does not seem to take the text scaling into account. Is there a way to adjust the &lt;code&gt;scroll&lt;/code&gt; commands to reflect these sorts of changes in text size?&lt;/p&gt;&#xA;" OwnerUserId="891" LastActivityDate="2015-12-13T06:06:29.623" Title="Adjust scrolling after font increase/decrease" Tags="|scrolling|editing|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18825" PostTypeId="1" AcceptedAnswerId="18827" CreationDate="2015-12-13T08:31:10.933" Score="1" ViewCount="240" Body="&lt;p&gt;I would like to visualize tabs. Here, I almost succeeded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq whitespace-style '(face trailing tabs lines-tail indentation))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;face&lt;/code&gt; is needed for other things to work;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;trailing&lt;/code&gt; visualizes trailing blanks just perfectly;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;tabs&lt;/code&gt; doesn't work;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;lines-tail&lt;/code&gt; highlights tails of too long lines — perfect;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;indentation&lt;/code&gt; according to documentation should show tabs when you've set up Emacs to indent with spaces and vice versa.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Why &lt;code&gt;tabs&lt;/code&gt; doesn't work? Two possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It's tricky. To make it work you need extra knowledge.&lt;/li&gt;&#xA;&lt;li&gt;Well, it's just currently broken.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Before reporting a bug, I decided to ask if anyone succeeded in visualizing tabs at any position (I'm particularly interested in indentation). Basically, if there is a tab character in file, I want to see it.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-12-13T17:43:01.323" LastActivityDate="2015-12-13T17:43:01.323" Title="How to visualize trailing blanks and any tab characters (even non trailing)" Tags="|whitespace-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18826" PostTypeId="2" ParentId="18807" CreationDate="2015-12-13T08:38:31.670" Score="1" Body="&lt;p&gt;The most straightforward solution is to pass &lt;code&gt;t&lt;/code&gt; to &lt;code&gt;load&lt;/code&gt; as its third argument, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(load &quot;my-file&quot; nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the documentation for &lt;code&gt;load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(load FILE &amp;amp;optional NOERROR NOMESSAGE NOSUFFIX MUST-SUFFIX)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Execute a file of Lisp code named FILE.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If optional second arg NOERROR is non-nil,&#xA;  report no error if FILE doesn't exist.&#xA;  Print messages at start and end of loading unless&#xA;  optional third arg NOMESSAGE is non-nil (but `force-load-messages'&#xA;  overrides that).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A better solution (in my opinion) would be to use &lt;code&gt;require&lt;/code&gt; instead of &lt;code&gt;load&lt;/code&gt;, assuming the file in question has a &lt;code&gt;provide&lt;/code&gt; statement (typically at the very end of the file).  For the file you specified in your comment (&lt;a href=&quot;https://github.com/zk-phi/indent-guide/blob/master/indent-guide.el&quot; rel=&quot;nofollow&quot;&gt;indent-guide.el&lt;/a&gt;), the syntax would be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'indent-guide)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will load the specified file (and suppress the loading messages automatically), but only if the file isn't already loaded.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-12-13T08:38:31.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18827" PostTypeId="2" ParentId="18825" CreationDate="2015-12-13T10:34:33.480" Score="3" Body="&lt;p&gt;Two things to check in this case:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does &lt;code&gt;whitespace-tab&lt;/code&gt; have non-transparent background? Use &lt;kbd&gt;M-x list-faces-display&lt;/kbd&gt; to check faces. In my case &lt;code&gt;solarized-dark&lt;/code&gt; had &lt;code&gt;whitespace-tab&lt;/code&gt; with transparent background.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Remove &lt;code&gt;indentation&lt;/code&gt; because it turns out that this thing has the ability to override tab face in indentation with indentation face which was also transparent.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2015-12-13T17:41:29.450" LastActivityDate="2015-12-13T17:41:29.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18829" PostTypeId="2" ParentId="15144" CreationDate="2015-12-13T12:52:46.440" Score="3" Body="&lt;p&gt;That's not exactly the answer to my question but I managed to sidestep the problem by using this solution from a post in &lt;a href=&quot;https://stackoverflow.com/questions/16819248/emacs-tramp-over-an-unreliable-connection&quot;&gt;SO&lt;/a&gt;. Just wanting to share the solution with the one who are still struggling with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key is using dtach with tramp to keep the process alive on the remote host alive even if your disconnect from the server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the command to launch R on the server.  It's the same code on SO except I enable port forwarding to view graphics created on the remote server&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar R-remote-host &quot;remotehost&quot;)&#xA;(defvar R-remote-session &quot;R&quot;)&#xA;&#xA;(defun R-remote (&amp;amp;optional remote-host session)&#xA;  &quot;Connect to the remote-host's dtach session running R.&quot;&#xA;  (interactive (list&#xA;        (read-from-minibuffer &quot;R remote host: &quot; R-remote-host)&#xA;        (read-from-minibuffer &quot;R remote session: &quot; R-remote-session)))&#xA;  (pop-to-buffer (make-comint (concat &quot;remote-&quot; session)&#xA;              &quot;ssh&quot; nil &quot;-X&quot;  &quot;-t&quot; &quot;-t&quot; remote-host&#xA;              &quot;dtach&quot; &quot;-A&quot; (concat &quot;.dtach-&quot; session)&#xA;              &quot;-z&quot; &quot;-E&quot;  &quot;-r&quot; &quot;none&quot;&#xA;              inferior-R-program-name &quot;--no-readline&quot;&#xA;              inferior-R-args))&#xA;  (ess-remote (process-name (get-buffer-process (current-buffer))) &quot;R&quot;)&#xA;  (setq comint-process-echoes t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As long as you don't kill the process on purpose or the server doesn't restart  you can disconnect as you like and get back the process when you connect again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's easy to extend to other remote processes as well. Here is the one I use for python for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar remote-host &quot;remotehost&quot;)&#xA;(defvar remote-session &quot;python&quot;)&#xA;(defun python-remote (&amp;amp;optional remote-host session)&#xA;  &quot;Connect to the remote-host's dtach session running python.&quot;&#xA;  (interactive (list&#xA;        (read-from-minibuffer &quot;R remote host: &quot; remote-host)&#xA;        (read-from-minibuffer &quot;R remote session: &quot; remote-session)))&#xA;  (pop-to-buffer (make-comint (concat &quot;remote-&quot; session)&#xA;              &quot;ssh&quot; nil &quot;-t&quot; &quot;-t&quot; remote-host&#xA;              &quot;dtach&quot; &quot;-A&quot; (concat &quot;.dtach-&quot; session)&#xA;              &quot;-z&quot; &quot;-E&quot; &quot;-r&quot; &quot;none&quot;&#xA;             &quot;python&quot; )&#xA;         )&#xA;  (setq comint-process-echoes t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I still need to use to pull both functions together to be more concise. But it might get you going.&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-12-13T12:52:46.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18830" PostTypeId="1" AcceptedAnswerId="18838" CreationDate="2015-12-13T12:53:39.477" Score="8" ViewCount="1430" Body="&lt;p&gt;I want to export an org mode document so that sections or subsections&#xA;with &lt;code&gt;TODO&lt;/code&gt; keywords do not appear in the exported output. How can&#xA;this be achieved?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot;&gt;export-settings&lt;/a&gt;&#xA;documentation does not explicitly mention anything related to this.&lt;/p&gt;&#xA;" OwnerUserId="6924" LastActivityDate="2020-05-23T11:35:26.927" Title="Org mode export: exclude sections with todo keyword" Tags="|org-mode|org-export|todo|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18831" PostTypeId="1" AcceptedAnswerId="18833" CreationDate="2015-12-13T13:19:22.470" Score="9" ViewCount="3127" Body="&lt;p&gt;I have &lt;code&gt;packages&lt;/code&gt; variables that have list of github users and package names.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar packages '('(&quot;auto-complete&quot; . &quot;auto-complete&quot;)&#xA;                   (&quot;defunkt&quot; . &quot;markdown-mode&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to &lt;code&gt;git clone&lt;/code&gt; if the file is not exist yet.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun git-clone (author name)&#xA;  (let* ((repo-url (concat &quot;git@github.com:&quot; author &quot;/&quot; name &quot;.git&quot;)))&#xA;    (print repo-url)&#xA;    (unless (file-exists-p (concat &quot;~/.emacs.d/git/&quot; name))&#xA;      (shell-command (concat &quot;git clone &quot; repo-url &quot; ~/.emacs.d/git/&quot; name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I want to apply &lt;code&gt;git-clone&lt;/code&gt; to all packages variable to &lt;code&gt;packages&lt;/code&gt; list. But I could not figure out how to apply with arguments.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; This obviously doesn't work&#xA;(mapcar `git-clone `packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10106" LastEditorUserId="105" LastEditDate="2016-06-22T20:13:33.773" LastActivityDate="2020-01-24T14:43:31.223" Title="How to apply mapcar to a function with multiple arguments" Tags="|mapping|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18833" PostTypeId="2" ParentId="18831" CreationDate="2015-12-13T13:57:00.360" Score="9" Body="&lt;p&gt;You can create an anonymous lambda function to take each element of your list and apply your function to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar packages '((&quot;auto-complete&quot; . &quot;auto-complete&quot;)&#xA;                   (&quot;defunkt&quot; . &quot;markdown-mode&quot;)))&#xA;&#xA;(defun toy-fnx (author name)&#xA;  &quot;Just testing.&quot;&#xA;  (message &quot;Package %s by author %s&quot; name author)&#xA;  (sit-for 1))&#xA;&#xA;(mapcar (lambda (package)&#xA;          (funcall #'toy-fnx (car package) (cdr package)))&#xA;        packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that, if you don't care about the return values (ie, your function is only for side effects, which appears to be the case here), you can use &lt;code&gt;mapc&lt;/code&gt; in place of &lt;code&gt;mapcar&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc (lambda (package)&#xA;        (funcall #'toy-fnx (car package) (cdr package)))&#xA;      packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For your specific purposes, a loop may be simplest:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-dolist (package packages)      ; or dolist if you don't want to use cl-lib&#xA;  (funcall #'toy-fnx (car package) (cdr package)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-12-13T14:30:30.483" LastActivityDate="2015-12-13T14:30:30.483" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18834" PostTypeId="2" ParentId="17765" CreationDate="2015-12-13T13:57:57.607" Score="0" Body="&lt;p&gt;Thanks to wvxvw for pointing to the answer.  I don't deserve any credit, just gathering the information here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key thing here is to use the header that will export in latex directly when exporting to latex (C-e-C-l-l).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it will generate an image first when exporting to html.(C-e-C-h-h)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you need to put the following in your .emacs as well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-babel-latex-htlatex &quot;htlatex&quot;)&#xA;(defmacro by-backend (&amp;amp;rest body)&#xA;`(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can have more info about this &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4-3&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is the way to do it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+header: :results (by-backend (html &quot;results.png&quot;) (t &quot;raw&quot;))&#xA;#+header: :results (by-backend (pdf &quot;latex&quot;) (t &quot;raw&quot;))&#xA;#+BEGIN_SRC latex&#xA;\begin{table}&#xA;\begin{center}&#xA;\begin{tabular}{l c }&#xA;\hline&#xA;  &amp;amp; Model 1 \\&#xA;\hline&#xA;(Intercept) &amp;amp; $0.06$       \\&#xA;  &amp;amp; $(0.10)$     \\&#xA;x           &amp;amp; $1.02^{***}$ \\&#xA;  &amp;amp; $(0.10)$     \\&#xA;\hline&#xA;R$^2$       &amp;amp; 0.53         \\&#xA;Adj. R$^2$  &amp;amp; 0.53         \\&#xA;Num. obs.   &amp;amp; 100          \\&#xA;RMSE        &amp;amp; 1.05         \\&#xA;\hline&#xA;\multicolumn{2}{l}{\scriptsize{$^{***}p&amp;lt;0.001$, $^{**}p&amp;lt;0.01$, $^*p&amp;lt;0.05$}}&#xA;\end{tabular}&#xA;\caption{Statistical models}&#xA;\label{table:coefficients}&#xA;\end{center}&#xA;\end{table}&#xA;#+END_SRC&#xA;&#xA;&#xA;|-----------+-----|&#xA;| groceries | qty |&#xA;|-----------+-----|&#xA;| apple     |   1 |&#xA;| banana    |   5 |&#xA;|-----------+-----|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9340" LastActivityDate="2015-12-13T13:57:57.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18836" PostTypeId="2" ParentId="7461" CreationDate="2015-12-13T15:29:19.810" Score="3" Body="&lt;p&gt;I had the same problem. Could send mail from home but not at university. I struggle with it for days. I was already using but I was using the port 587. Then changing to port 465 did the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So may be you only have to add &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq smtpmail-stream-type  'ssl)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make sure you don't have any port number specified in your .authinfo file, it might override the one you specify in .gnus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an extract from  my .gnus.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq send-mail-function    'smtpmail-send-it&#xA;  smtpmail-smtp-server  &quot;smtp.gmail.com&quot;&#xA;  smtpmail-stream-type  'ssl&#xA;  smtpmail-smtp-service 465&#xA;  smtpmail-debug-info t&#xA;  smtpmail-debug-verb t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;May the force be with you.&lt;/p&gt;&#xA;" OwnerUserId="9340" LastActivityDate="2015-12-13T15:29:19.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18837" PostTypeId="2" ParentId="18831" CreationDate="2015-12-13T19:32:31.930" Score="9" Body="&lt;p&gt;If you're happy using &lt;a href=&quot;https://github.com/magnars/dash.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;dash.el&lt;/a&gt; you can use &lt;code&gt;-each&lt;/code&gt; and destructuring &lt;code&gt;-let&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(--each packages&#xA;  (-let [(author . name) it]&#xA;    (git-clone author name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use &lt;code&gt;-lambda&lt;/code&gt; from dash.el to create an anonymous function with destructuring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar&#xA; (-lambda ((author . name)) (git-clone author name))&#xA; packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2017-07-24T15:28:45.430" LastActivityDate="2017-07-24T15:28:45.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18838" PostTypeId="2" ParentId="18830" CreationDate="2015-12-13T21:35:24.460" Score="9" Body="&lt;p&gt;There is an export option to control exporting of TODO items:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;tasks: Toggle inclusion of tasks (TODO items), can be nil to remove&#xA;  all tasks, todo to remove DONE tasks, or a list of keywords to keep&#xA;  (org-export-with-tasks).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Setting it to &lt;code&gt;nil&lt;/code&gt; will hide tasks from your exported document.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-13T21:35:24.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18839" PostTypeId="1" CreationDate="2015-12-13T21:49:02.290" Score="1" ViewCount="130" Body="&lt;p&gt;In the Haxe programming language, you can specify the type of the return value of a function with a colon.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function funcName() : ReturnType { }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This becomes a problem when using emacs with haxe-mode. Whenever I try to enter a newline, the point is automatically indented to the column as to where the &quot;:&quot; character is found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a gif that better explains what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bG8i0.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bG8i0.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, creating a newline after the first function works fine. But on the second function (the one with a return datatype of &quot;: Void&quot;), we can see that the newline is indented at the same column of the &quot;:&quot; character in &quot;: Void&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried disabling &lt;code&gt;electric-indent-mode&lt;/code&gt; similar to the one &lt;a href=&quot;https://emacs.stackexchange.com/questions/3322/python-auto-indent-problem&quot;&gt;found here&lt;/a&gt; but it did not do anything. I tried messing around with tab spacings but to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate some help with this one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/itegebo/haxe-mode-mirror&quot; rel=&quot;nofollow noreferrer&quot;&gt;Link to the Haxe-Node that I am using&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10481" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-12-13T21:49:02.290" Title="Auto-indent problems related to syntax in Haxe-Mode" Tags="|indentation|major-mode|syntax|newlines|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18841" PostTypeId="1" AcceptedAnswerId="18842" CreationDate="2015-12-14T04:49:59.820" Score="1" ViewCount="463" Body="&lt;p&gt;I'm writing a function to enable binding a &quot;double tap&quot; on a key (or one key then another key in rapid succession) to a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It almost works, but not quite. Here is the code I have in my lisp evaluation test chamber:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq doubletap-secondtap nil)&#xA;&#xA;(defun doubletap (doubletap-key1 doubletap-key2 doubletap-wait doubletap-function)&#xA;  (let* ((doubletap-secondtap 't)&#xA;         (doubletap-event (read-event nil nil doubletap-wait)))&#xA;           (if doubletap-event&#xA;             (if (equal doubletap-event doubletap-key2)&#xA;                 (funcall doubletap-function)&#xA;                 (setq unread-command-events&#xA;                   (append (list doubletap-key1 doubletap-event) unread-command-events)) )&#xA;           (setq unread-command-events&#xA;             (append (list doubletap-key1) unread-command-events)) )))&#xA;&#xA;(defun doubletap-j-j-godmodeall () (interactive)&#xA;       (if doubletap-secondtap&#xA;         (funcall 'self-insert-command 1)&#xA;         (doubletap 106 106 0.3 'god-mode-all)))&#xA;&#xA;(funcall 'doubletap-j-j-godmodeall)&#xA;&#xA;(global-set-key (kbd &quot;j&quot;) 'doubletap-j-j-godmodeall)&#xA;&#xA;(global-set-key (kbd &quot;j&quot;) 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first function is intended to do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;wait doubletap-wait seconds for input&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if input is not given, simulate a keypress of doubletap-key1&lt;/li&gt;&#xA;&lt;li&gt;if input is given and it is not doubletap-key2, simulate two keypresses, first doubletap-key1 then doubletap-key2&lt;/li&gt;&#xA;&lt;li&gt;if input is given and it is doubletap-key2, call doubletap-function&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Because we use plan to bind doubletap-key1 to call the interactive function &lt;code&gt;doubletap-j-j-godmodeall&lt;/code&gt;, we make a flag &lt;code&gt;doubletap-secondtap&lt;/code&gt; to tell &lt;code&gt;doubletap-j-j-godmodeall&lt;/code&gt; whether we are already inside the first function. If the flag is nil, it will call &lt;code&gt;doubletap&lt;/code&gt;, but if it has a value, it will perform the default action self-insert-command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;doubletap-j-j-godmodeall&lt;/code&gt; works perfectly when it isn't bound to anything, as can be seen by evaluating the first three expressions and then evaluating the fourth expression, which is designed to activate god-mode for all buffers when two &quot;j&quot;s are pressed within 0.3 seconds, but otherwise behave like a normal function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(this will only work if you have god-mode installed; if you don't, try a different function)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, when we evaluate the fifth expression, we find that its behavior becomes bizarre and unexpected. It hangs indefinitely until you either cancel it with &quot;C-g&quot; or press &quot;j&quot;. If you press &quot;j,&quot; it will toggle god-mode (even if you do it well after 0.3 seconds have passed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluate the last expression to restore normal behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain this behavior, and more importantly, does anyone know how to make the function work correctly?&lt;/p&gt;&#xA;" OwnerUserId="10424" LastEditorUserId="105" LastEditDate="2016-06-22T20:12:31.800" LastActivityDate="2016-06-22T20:12:31.800" Title="Help with my double tap key-binding function" Tags="|key-bindings|keystrokes|events|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18842" PostTypeId="2" ParentId="18841" CreationDate="2015-12-14T07:52:10.867" Score="1" Body="&lt;p&gt;Based on phils' comment, this is what I needed to do to make it work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq doubletap-flag nil)&#xA;&#xA;(defun doubletap (doubletap-key1 doubletap-key2 doubletap-wait doubletap-function)&#xA;  (setq doubletap-flag 't)&#xA;   (let ((doubletap-event (read-event nil nil doubletap-wait)))&#xA;     (if doubletap-event&#xA;       (if (equal doubletap-event doubletap-key2)&#xA;         (progn (setq doubletap-flag nil) (funcall doubletap-function))&#xA;       (setq unread-command-events&#xA;             (append (list doubletap-key1 doubletap-event) unread-command-events)) )&#xA;     (setq unread-command-events&#xA;           (append (list doubletap-key1) unread-command-events)) )))&#xA;&#xA;(defun doubletap-j-j-godmodeall () (interactive)&#xA;       (if doubletap-flag&#xA;         (progn (setq doubletap-flag nil) (funcall 'self-insert-command 1))&#xA;         (doubletap 106 106 0.3 'god-mode-all)))&#xA;&#xA;(global-set-key (kbd &quot;j&quot;) 'doubletap-j-j-godmodeall)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'd need to make a second interactive function bound with a mode hook if you wanted to be able to leave god-mode the same way, since god-mode will map &quot;j&quot; to &quot;C-j&quot;. I'm not going to implement this since key-chord-mode is a better solution to that practical problem, as noted by PythonNut. I'll note that I think the default delay times for key-chord-mode are too short. You can change them by setting the values of key-chord-one-key-delay and key-chord-two-key-delay.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastEditorUserId="10424" LastEditDate="2015-12-15T01:55:17.787" LastActivityDate="2015-12-15T01:55:17.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18843" PostTypeId="1" CreationDate="2015-12-14T14:04:32.047" Score="3" ViewCount="109" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I keep EMMS from allowing my laptop to go to sleep?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;a href=&quot;http://www.gnu.org/software/emms/&quot; rel=&quot;nofollow noreferrer&quot;&gt;EMMS&lt;/a&gt; to play music files.  When I've got a long playlist going, I expect it to keep my laptop awake and continue working through the playlist, even when I'm not otherwise interacting with my laptop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However: my laptop still falls asleep at its regularly scheduled time if I don't touch it.  It seems to be the case that the laptop reaches the &quot;go to sleep after X minutes&quot; mark that I've set, finishes whatever track EMMS is currently playing, and then goes to sleep.  It then begins the next track on the playlist immediately after it wakes up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to have continuous play without needing to intervene.  Currently, I have to tap a key or jiggle the trackpad every 15 minutes or so to prevent the sleep, which is obviously silly.  &lt;strong&gt;How do I get continuous play and have EMMS prevent the laptop from sleeping?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW: this is a problem on laptops with Linux (Fedora, Ubuntu) and OSX.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2018-02-23T22:38:10.743" LastActivityDate="2018-02-23T22:38:10.743" Title="Can EMMS prevent my laptop from going to sleep?" Tags="|emms|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18844" PostTypeId="5" CreationDate="2015-12-14T14:06:40.107" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emms/&quot; rel=&quot;nofollow&quot;&gt;EMMS&lt;/a&gt; is the Emacs multimedia system.  As described on its web site:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EMMS is the Emacs Multimedia System. It tries to be a clean and small application to play multimedia files from Emacs using external players. Many of it's ideas are derived from MpthreePlayer , but it tries to be more general and cleaner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that EMMS is based on external players makes it powerful, because it supports all formats that those players support, with no effort from your side.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-12-14T14:06:40.107" LastActivityDate="2015-12-14T14:06:40.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18845" PostTypeId="4" CreationDate="2015-12-14T14:06:40.107" Score="0" Body="EMMS is the Emacs multimedia system.  It plays multimedia files using external players." OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-12-14T14:06:40.107" LastActivityDate="2015-12-14T14:06:40.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18846" PostTypeId="1" CreationDate="2015-12-14T14:50:49.693" Score="3" ViewCount="200" Body="&lt;p&gt;I have hooked &lt;code&gt;whitespace-cleanup&lt;/code&gt; to &lt;code&gt;before-save-hook&lt;/code&gt; and there is a timer to  auto save buffer every  5 seconds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i am  typing something, or coding in python, I stop once in a while and buffer will be whitespace cleaned. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this text&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs  is |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs is|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo():&#xA;     x = 1&#xA;     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo():&#xA;     x = 1&#xA;|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is quite annoying to type all  that whitespaces again and again.  How can i prevent whitespace cleanup at point but still clean  whitespace in the remaining buffer?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2015-12-18T20:31:56.477" Title="How to prevent whitespace cleanup at point?" Tags="|hooks|whitespace|point|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18847" PostTypeId="1" AcceptedAnswerId="18848" CreationDate="2015-12-14T15:07:03.817" Score="4" ViewCount="1137" Body="&lt;p&gt;While in &lt;code&gt;org-mode&lt;/code&gt; I've tried calling &lt;code&gt;fill-paragraph&lt;/code&gt; directly.  I've tried using &lt;code&gt;auto-fill-mode&lt;/code&gt; and &lt;code&gt;refill-mode&lt;/code&gt;.  I've tried &lt;code&gt;org-fill-paragraph&lt;/code&gt;.  The &lt;code&gt;fill-column&lt;/code&gt; is set appropriately.  None of them make the fill happen; absolutely no changes occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know if this is a known bug or is otherwise a problem? Even better, do you know of a solution?&lt;/p&gt;&#xA;" OwnerUserId="10484" LastEditorUserId="253" LastEditDate="2015-12-14T15:17:15.133" LastActivityDate="2016-04-12T17:49:07.613" Title="Fill is not working in org-mode?" Tags="|org-mode|fill-paragraph|auto-fill-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18848" PostTypeId="2" ParentId="18847" CreationDate="2015-12-14T15:49:15.220" Score="1" Body="&lt;p&gt;Operator Error: After getting a suggestion from @Dan ( &lt;code&gt;emacs -Q&lt;/code&gt; ), I tried org-mode again.  With distractions out of the way it became clear that headers and paragraphs are treated differently.  I was expecting a header to wrap, but they don't.  Paragraphs are wrapping just fine with no fixes required.&lt;/p&gt;&#xA;" OwnerUserId="10484" LastActivityDate="2015-12-14T15:49:15.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18849" PostTypeId="1" CreationDate="2015-12-14T16:36:44.233" Score="0" ViewCount="333" Body="&lt;p&gt;I found this code on stackoverflow (from Rainer Joswig):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun listFormat ()&#xA;   (cl-labels ((place-index (idx l)&#xA;        (if (null l)&#xA;            nil&#xA;            (append (list (first l)) (list idx)&#xA;                  (place-index (+ idx 1) (rest l))))))&#xA;    (place-index 1 l))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I changed it by adding a &lt;code&gt;let&lt;/code&gt; form and &lt;code&gt;cl-labels&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun listFormat ()&#xA;   (let ((l '(a b c d)))&#xA;   (cl-labels ((place-index (idx l)&#xA;                         (if (null l)&#xA;                             nil&#xA;                           (append (list (first l)) (list idx)&#xA;                                   (place-index (+ idx 1) (rest l))))))&#xA;     (place-index 1 l))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this a good practice? In the code I'm working on I need to establish variables with &lt;code&gt;let&lt;/code&gt;, then do a recursive function, i.e., I don't want the stuff inside the &lt;code&gt;let&lt;/code&gt; to be repeated on each recursion. I'm wondering if there is a way to combine this under &lt;code&gt;cl-letf&lt;/code&gt;. I try this, but it's not liking it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun listFormat ()&#xA;   (cl-letf ((l '(a b c d))&#xA;             (place-index (idx l)&#xA;                          (if (null l)&#xA;                              nil&#xA;                            (append (list (first l)) (list idx)&#xA;                                    (place-index (+ idx 1) (rest l))))))&#xA;     (place-index 1 l)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;complaining of &lt;code&gt;void function idx&lt;/code&gt;. So, is there a way to combine &lt;code&gt;let&lt;/code&gt; content that shouldn't be resursed with an inner recursion function?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-06-22T20:11:47.437" LastActivityDate="2016-06-22T20:11:47.437" Title="Recursion with let and cl-labels or just cl-letf?" Tags="|local-functions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18851" PostTypeId="2" ParentId="18740" CreationDate="2015-12-14T18:04:38.527" Score="3" Body="&lt;p&gt;The problem you experienced is unrelated to the &lt;code&gt;/home/ReneFroger/Dropbox/Emacs/places&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, your &lt;code&gt;savehist-file&lt;/code&gt; is becoming too large. Every time you close Emacs, it serializes the variables storing minibuffer histories along with any other variables of your choosing and writes it to the file. When you start Emacs, it does the reverse, reading the file, parsing it's contents, and reconstructing the state. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;28,622,699 bytes is a lot of data. It may not sound like much, but serialization and parsing isn't a cheap operation, and therefore it takes a good bit of time to convert.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The temporary solution is to delete the &lt;code&gt;savehist-file&lt;/code&gt;, but that only delays future bloat. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, this is caused by some abnormal configuration. (&lt;code&gt;history-length&lt;/code&gt; is too large, or too many variables are being saved, for example), and you'll need to investigate to determine why &lt;code&gt;savehist&lt;/code&gt; is being directed to store all this data.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2015-12-14T18:04:38.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18852" PostTypeId="2" ParentId="18849" CreationDate="2015-12-14T18:09:25.247" Score="3" Body="&lt;p&gt;Recursion as general looping construct is discouraged in Emacs Lisp.  Don't.  This is not Scheme.  Why don't you use one of the following instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dash.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun list-format (list)&#xA;  (-flatten (--map-indexed (list it (1+ it-index)) list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;cl-lib:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun list-format (list)&#xA;  (cl-mapcan 'list list (number-sequence 1 (length list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;LOOP:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun list-format (list)&#xA;  (cl-loop for item in list&#xA;           for i from 1&#xA;           append (list item i)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Vanilla:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun list-format (list)&#xA;  (let ((i 1)&#xA;        (list list)&#xA;        result)&#xA;    (while list&#xA;      (push (pop list) result)&#xA;      (push i result)&#xA;      (setq i (1+ i)))&#xA;    (nreverse result)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-12-14T18:09:25.247" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18855" PostTypeId="1" AcceptedAnswerId="18858" CreationDate="2015-12-15T03:46:33.767" Score="2" ViewCount="871" Body="&lt;p&gt;In Section 13.5.4 of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Eval-During-Expansion.html#Eval-During-Expansion&quot; rel=&quot;nofollow&quot;&gt;Elisp reference&lt;/a&gt;, we are shown a problem whereby a macro definition evaluates one of its argument expressions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro foo (a)&#xA;  (list 'setq (eval a) t))&#xA;(setq x 'b)&#xA;(foo x) → (setq b t)&#xA;     ⇒ t                  ; and b has been set.&#xA;;; but&#xA;(setq a 'c)&#xA;(foo a) → (setq a t)&#xA;     ⇒ t                  ; but this set a, not c.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We are then advised to&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;substitute the expression into the macro expansion, so that its value will be computed as part of executing the expansion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what this means, but I interpret it as meaning that we should try to rewrite the macro as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro foo (a)&#xA;  `(setq (eval ',a) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which, when expanded, gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(macroexpand '(foo x)) → (setq (eval (quote x)) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'm getting the following error when I call &lt;code&gt;(foo x)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(wrong-type-argument symbolp (eval (quote x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Even though when I evaluate &lt;code&gt;(symbolp (eval (quote x)))&lt;/code&gt;, the result is &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that there's something fundamental that I'm not understanding here. What's the issue?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2016-06-22T20:10:29.853" LastActivityDate="2016-06-22T20:10:29.853" Title="Evaluating Macro Arguments in Expansion" Tags="|elisp-macros|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18856" PostTypeId="1" AcceptedAnswerId="18857" CreationDate="2015-12-15T05:16:15.920" Score="2" ViewCount="67" Body="&lt;p&gt;Many times when I check the backtrace buffer, I can't copy the text out because of the embedded binary data (perhaps it's the internal null characters making the copy function think the string is shorter than it is?) so that when I try to copy the buffer with &lt;kbd&gt;C-x h M-w&lt;/kbd&gt; (don't remember if those are standard bindings), only a portion of the buffer gets copied (presumably up until the internal null character).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to escape the binary data so that I may copy the buffer in its entirety? Or is there a way to omit the binary data?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="105" LastEditDate="2015-12-15T06:11:15.010" LastActivityDate="2015-12-15T06:29:04.377" Title="escape or omit binary data in backtrace buffer?" Tags="|debugging|backtrace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18857" PostTypeId="2" ParentId="18856" CreationDate="2015-12-15T06:10:43.950" Score="3" Body="&lt;p&gt;Nope. There is no simple solution ready-to-hand. As far as I know, users just manually remove the bytecode from backtraces they report. That's what I do, at least.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has been requested more than once, including with &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6991&quot; rel=&quot;nofollow&quot;&gt;Emacs bug #6991&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bug was summarily closed immediately -- no reason given.  Eventually it was reopened and relegated to the &quot;wishlist&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can always try again -- &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;, now that there is a new GNU Emacs maintainer. Dunno whether that will make a difference.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-15T06:29:04.377" LastActivityDate="2015-12-15T06:29:04.377" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18858" PostTypeId="2" ParentId="18855" CreationDate="2015-12-15T06:22:02.493" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;setq&lt;/code&gt; does not evaluate its first argument, so your second defmacro definition cannot work.  The error message tells you that &lt;code&gt;setq&lt;/code&gt; expects a symbol as its first argument, but you passed it the list &lt;code&gt;(eval (quote x))&lt;/code&gt; instead.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The problem with the original code is that there is variable capture: the parameter of the defmacro is &lt;code&gt;a&lt;/code&gt;, as is the variable passed to &lt;code&gt;foo&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-15T06:22:02.493" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18859" PostTypeId="1" AcceptedAnswerId="36640" CreationDate="2015-12-15T12:17:55.570" Score="2" ViewCount="93" Body="&lt;p&gt;I normally start Emacs in daemon mode and reload my last session with the desktop package. This causes whichever file &lt;code&gt;desktop-read&lt;/code&gt; open last to remain visited in a buffer which is selected in the window which is selected in the “dummy” frame created for the daemon. As far as Emacs is concerned, this file is visible in a frame. But as far as I'm concerned, it's not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could fix all my code to skip the daemon's frame… if I could identify it. But it would be easier to just make the daemon frame visit a buffer whose visibility I don't particularly care about, like &lt;code&gt;*Messages*&lt;/code&gt; or &lt;code&gt;​ *Minibuf-0&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I put in my init file to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;identify whether Emacs was started in daemon mode;&lt;/li&gt;&#xA;&lt;li&gt;identify the frame corresponding to the daemon;&lt;/li&gt;&#xA;&lt;li&gt;make this frame visit a harmless buffer, or kill it (what can go wrong if I do that), or otherwise not let it continue “showing” some interesting buffer?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Test by running &lt;code&gt;emacs --daemon -q -l foo.emacs&lt;/code&gt; where &lt;code&gt;foo.emacs&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*-emacs-lisp-*-&#xA;(setq server-name &quot;foo&quot;)&#xA;;; Simulate loading a desktop session&#xA;(find-file &quot;~/.emacs&quot;)&#xA;;; Test code&#xA;(defun foo ()&#xA;  (interactive)&#xA;  (let* ((buffer (find-buffer-visiting &quot;~/.emacs&quot;))&#xA;         (window (get-buffer-window buffer t)))&#xA;    (if (interactive-p) (message &quot;%S&quot; window) window)))&#xA;;; Here goes the code I want&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I want &lt;code&gt;emacsclient -s foo -e '(foo)'&lt;/code&gt; to return &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2017-11-06T00:16:59.160" Title="Don't let the daemon frame make a file visible" Tags="|buffers|frames|daemon|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18860" PostTypeId="1" AcceptedAnswerId="18862" CreationDate="2015-12-15T12:24:40.297" Score="2" ViewCount="201" Body="&lt;p&gt;I saw a teacher in iTunes U doing this: have 2 windows open in Emacs, the top is the Scheme (or Lisp) source code, and the bottom is the Scheme interpreter.  He seems to press something on the keyboard and the whole Scheme statement will be copied down to the buffer below.  How is that done?&lt;/p&gt;&#xA;" OwnerUserId="10496" LastEditorUserId="10496" LastEditDate="2015-12-15T12:47:41.780" LastActivityDate="2015-12-15T13:13:40.853" Title="How to &quot;copy&quot; Scheme or Lisp code from one window to another window in Emacs?" Tags="|emacs-lisp-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18861" PostTypeId="1" AcceptedAnswerId="18864" CreationDate="2015-12-15T12:38:44.873" Score="5" ViewCount="1175" Body="&lt;p&gt;Is it possible to change binding to navigate throw Helm list via &lt;code&gt;C-j&lt;/code&gt; and &lt;code&gt;C-k&lt;/code&gt; bindings? I came to Emacs from Vi(m) world and I really want to keep this mapping in my emacs + evil setup.&lt;/p&gt;&#xA;" OwnerUserId="10497" LastActivityDate="2015-12-15T20:37:08.370" Title="Helm bind &quot;C-j&quot; and &quot;C-k&quot; to list navigation (cursor position)" Tags="|key-bindings|helm|evil|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18862" PostTypeId="2" ParentId="18860" CreationDate="2015-12-15T12:39:12.000" Score="4" Body="&lt;p&gt;Here's how to do it with vanilla Emacs commands:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-SPC C-M-n M-w&lt;/kbd&gt; mark the list with a region and copy it to the kill ring.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x o C-y&lt;/kbd&gt; switch to other window and paste.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x o&lt;/kbd&gt; switch back to the original window.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's how to evaluate an expression before point with &lt;a href=&quot;http://nongnu.org/geiser/&quot; rel=&quot;nofollow&quot;&gt;geiser&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x C-e&lt;/kbd&gt; calls &lt;code&gt;geiser-eval-last-sexp&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There's no need to use the REPL window at all if you can just evaluate the expression in place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how to evaluate an expression before or after point using &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow&quot;&gt;lispy&lt;/a&gt; interface to &lt;code&gt;geiser&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;e&lt;/kbd&gt; calls &lt;code&gt;lispy-eval&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Defun for the first method&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun copy-sexp-to-other-window ()&#xA;  (interactive)&#xA;  (let* ((end (save-excursion (forward-list 1) (point)))&#xA;         (str (buffer-substring (point) end)))&#xA;    (save-window-excursion&#xA;      (other-window 1)&#xA;      (insert str &quot;\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Perhaps you'll want to remove &lt;code&gt;save-window-excursion&lt;/code&gt;, since you'll want to press &lt;kbd&gt;RET&lt;/kbd&gt; in the REPL at some point.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2015-12-15T13:13:40.853" LastActivityDate="2015-12-15T13:13:40.853" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18864" PostTypeId="2" ParentId="18861" CreationDate="2015-12-15T12:43:00.643" Score="3" Body="&lt;p&gt;It's possible to use &lt;kbd&gt;j&lt;/kbd&gt; and &lt;kbd&gt;k&lt;/kbd&gt; if you want, and have the escape key on e.g. &lt;kbd&gt;C-k&lt;/kbd&gt;.  See this &lt;a href=&quot;https://github.com/abo-abo/hydra/wiki/Helm&quot; rel=&quot;nofollow&quot;&gt;hydra wiki entry&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defhydra helm-like-unite (:hint nil&#xA;                           :color pink)&#xA;  &quot;&#xA;Nav ^^^^^^^^^        Mark ^^          Other ^^       Quit&#xA;^^^^^^^^^^------------^^----------------^^----------------------&#xA;_K_ ^ ^ _k_ ^ ^     _m_ark           _v_iew         _i_: cancel&#xA;^↕^ _h_ ^✜^ _l_     _t_oggle mark    _H_elp         _o_: quit&#xA;_J_ ^ ^ _j_ ^ ^     _U_nmark all     _d_elete&#xA;^^^^^^^^^^                           _f_ollow: %(helm-attr 'follow)&#xA;&quot;&#xA;  ;; arrows&#xA;  (&quot;h&quot; helm-beginning-of-buffer)&#xA;  (&quot;j&quot; helm-next-line)&#xA;  (&quot;k&quot; helm-previous-line)&#xA;  (&quot;l&quot; helm-end-of-buffer)&#xA;  ;; beginning/end&#xA;  (&quot;g&quot; helm-beginning-of-buffer)&#xA;  (&quot;G&quot; helm-end-of-buffer)&#xA;  ;; scroll&#xA;  (&quot;K&quot; helm-scroll-other-window-down)&#xA;  (&quot;J&quot; helm-scroll-other-window)&#xA;  ;; mark&#xA;  (&quot;m&quot; helm-toggle-visible-mark)&#xA;  (&quot;t&quot; helm-toggle-all-marks)&#xA;  (&quot;U&quot; helm-unmark-all)&#xA;  ;; exit&#xA;  (&quot;&amp;lt;escape&amp;gt;&quot; keyboard-escape-quit &quot;&quot; :exit t)&#xA;  (&quot;o&quot; keyboard-escape-quit :exit t)&#xA;  (&quot;i&quot; nil)&#xA;  ;; sources&#xA;  (&quot;}&quot; helm-next-source)&#xA;  (&quot;{&quot; helm-previous-source)&#xA;  ;; rest&#xA;  (&quot;H&quot; helm-help)&#xA;  (&quot;v&quot; helm-execute-persistent-action)&#xA;  (&quot;d&quot; helm-persistent-delete-marked)&#xA;  (&quot;f&quot; helm-follow-mode))&#xA;(define-key helm-map (kbd &quot;&amp;lt;escape&amp;gt;&quot;) 'helm-like-unite/body)&#xA;(define-key helm-map (kbd &quot;C-k&quot;) 'helm-like-unite/body)&#xA;(define-key helm-map (kbd &quot;C-o&quot;) 'helm-like-unite/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How the hint looks:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/wiki/abo-abo/hydra/images/hydra-helm-unite.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-12-15T12:43:00.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18865" PostTypeId="1" AcceptedAnswerId="18868" CreationDate="2015-12-15T15:06:14.943" Score="5" ViewCount="219" Body="&lt;p&gt;I couldn't find anything on this, so I'm asking it here. I can display a message in minibuffer with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;foo bar&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to give only the message &quot;foo bar&quot; a red color in the minibuffer. Is that possible with Emacs?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="2710" LastEditDate="2015-12-18T08:06:35.220" LastActivityDate="2015-12-18T08:06:35.220" Title="Define colors for single use in minibuffer" Tags="|minibuffer|colors|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18866" PostTypeId="1" CreationDate="2015-12-15T15:15:41.457" Score="10" ViewCount="818" Body="&lt;p&gt;I read that the usual way to bind key to keyboard macros are &lt;code&gt;C-x C-k 0&lt;/code&gt; to &lt;code&gt;9&lt;/code&gt; and &lt;code&gt;A&lt;/code&gt; to &lt;code&gt;Z&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example, after we define a keyboard macro, we can type&#xA;&lt;code&gt;C-x C-k b&lt;/code&gt; and Emacs will ask for a key to bind.  And the reserved keys for this purpose are &lt;code&gt;C-x C-k 0&lt;/code&gt; to &lt;code&gt;9&lt;/code&gt; and &lt;code&gt;A&lt;/code&gt; to &lt;code&gt;Z&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this involves quite a few keystrokes.  What are good keys to bind this to?  I found that I could bind it to &lt;code&gt;C-&amp;lt;return&amp;gt;&lt;/code&gt; or &lt;kbd&gt;Option&lt;/kbd&gt; + &lt;kbd&gt;Enter&lt;/kbd&gt; on a Mac running the Ubuntu Virtual Machine using the Emacs GUI version. So that should work, but the Emacs terminal version and the native Emacs on a Mac both treat &lt;code&gt;C-&amp;lt;return&amp;gt;&lt;/code&gt; or &lt;kbd&gt;Option&lt;/kbd&gt; + &lt;kbd&gt;Enter&lt;/kbd&gt; as just &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;, so that won't work.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What might be unused keys on Emacs that generally can be used to bind keyboard macros?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe alternatively, is there a way to show all the simple keys that are not bound to &lt;kbd&gt;Ctrl&lt;/kbd&gt; and &lt;kbd&gt;Meta&lt;/kbd&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10496" LastEditorUserId="105" LastEditDate="2016-03-14T01:10:41.310" LastActivityDate="2018-01-17T16:04:32.937" Title="What might be unused keys on Emacs that generally can be used to bind keyboard macros?" Tags="|key-bindings|keyboard-macros|" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18867" PostTypeId="1" AcceptedAnswerId="18873" CreationDate="2015-12-15T15:16:11.740" Score="3" ViewCount="234" Body="&lt;p&gt;Looking for some data structures for elisp, I came across &lt;a href=&quot;http://www.math.utah.edu/docs/info/elib_toc.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;. But then &lt;a href=&quot;https://www.gnu.org/software/elib/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; warns me off -- without specifying exactly what replaces elib. So where do I get packages to do doubly linked lists?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-06-22T20:10:12.883" LastActivityDate="2016-06-22T20:10:12.883" Title="What has replaced elib?" Tags="|list|data-structures|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18868" PostTypeId="2" ParentId="18865" CreationDate="2015-12-15T15:16:24.447" Score="6" Body="&lt;p&gt;Just use a string with faces.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(message (propertize &quot;foo bar&quot; 'face 'highlight))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or use a different face, which has a red foreground.  Or use a face property list:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(message (propertize &quot;foo bar&quot; 'face '(:foreground &quot;Red&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-15T15:16:24.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18869" PostTypeId="1" CreationDate="2015-12-15T15:31:11.327" Score="1" ViewCount="905" Body="&lt;p&gt;I'd like to have a pseudo tooltip available but restrict its appearance more than the default options allow. For example, I might want it to only appear if no input has come for some period of time, or to wait for a tab before appearing. I know how to sleep and how to wait for a tab, but I do not know how to make sure the tooltip appears only under certain circumstances but also always disappears and changes as normal when visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, this is some of the relevant code in &lt;code&gt;company.el&lt;/code&gt;. It takes one of the following arguments: &lt;code&gt;'show, 'hide, 'update, 'pre-command, or 'post-command.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun company-pseudo-tooltip-unless-just-one-frontend (command)&#xA;  &quot;`company-pseudo-tooltip-frontend', but not shown for single candidates.&quot;&#xA;  (unless (and (eq command 'post-command)&#xA;               (company--show-inline-p))&#xA;    (company-pseudo-tooltip-frontend command)))&#xA;&#xA;(defun company-pseudo-tooltip-frontend (command)&#xA;  &quot;`company-mode' frontend similar to a tooltip but based on overlays.&quot;&#xA;  (cl-case command&#xA;    (pre-command (company-pseudo-tooltip-hide-temporarily))&#xA;    (post-command&#xA;     (unless (when (overlayp company-pseudo-tooltip-overlay)&#xA;              (let* ((ov company-pseudo-tooltip-overlay)&#xA;                     (old-height (overlay-get ov 'company-height))&#xA;                     (new-height (company--pseudo-tooltip-height)))&#xA;                (and&#xA;                 (&amp;gt;= (* old-height new-height) 0)&#xA;                 (&amp;gt;= (abs old-height) (abs new-height))&#xA;                 (equal (company-pseudo-tooltip-guard)&#xA;                        (overlay-get ov 'company-guard)))))&#xA;       ;; Redraw needed.&#xA;       (company-pseudo-tooltip-show-at-point (point) (length company-prefix))&#xA;       (overlay-put company-pseudo-tooltip-overlay&#xA;                    'company-guard (company-pseudo-tooltip-guard)))&#xA;     (company-pseudo-tooltip-unhide))&#xA;    (hide (company-pseudo-tooltip-hide)&#xA;          (setq company-tooltip-offset 0))&#xA;    (update (when (overlayp company-pseudo-tooltip-overlay)&#xA;              (company-pseudo-tooltip-edit company-selection)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't been able to understand what all the component parts do.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastActivityDate="2015-12-15T15:31:11.327" Title="How to write a frontend for company-mode that allows the pseudo-tooltip but restricts it further?" Tags="|company-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18870" PostTypeId="1" CreationDate="2015-12-15T17:28:19.700" Score="0" ViewCount="744" Body="&lt;p&gt;i installed and enabled flycheck but it doesn't find errors in my software (c code), errors that i deliberately inserted to test it&lt;/p&gt;&#xA;&#xA;&lt;p&gt;instead it works on a new minimal c file (also not saved)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what could be the problem? thanks in advance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs version&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.6)  of&#xA;  2015-12-14 on binet, modified by Debian&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;flycheck version&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Flycheck version: 0.26snapshot (package: 20151212.411)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;flycheck-verify-setup&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Syntax checkers for buffer formelement.c in c-mode:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c/c++-clang&#xA;      - predicate:  nil&#xA;      - executable: Not found&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c/c++-gcc&#xA;      - predicate:  t&#xA;      - executable: Found at /usr/bin/gcc&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c/c++-cppcheck&#xA;      - predicate:  nil&#xA;      - executable: Not found&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Flycheck Mode is enabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10500" LastActivityDate="2015-12-21T15:40:45.843" Title="flycheck doesn't check" Tags="|flycheck|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18871" PostTypeId="2" ParentId="18866" CreationDate="2015-12-15T17:39:22.280" Score="10" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;... is there a way to show all the simple keys that are not bound to CTRL and Meta?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Have you checked the &lt;code&gt;unbound&lt;/code&gt; package by Davis Herring? It has the function &lt;code&gt;describe-unbound-keys&lt;/code&gt;, which lists unbound key chords based on something he calls &lt;code&gt;key complexity&lt;/code&gt; score. Pretty cool feature to play around to isolate just the key chords with &lt;kbd&gt;CTRL&lt;/kbd&gt; and &lt;kbd&gt;META&lt;/kbd&gt; keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get at the underlying scoring mechanism, look at the &lt;code&gt;key-complexity-1&lt;/code&gt; function in unbound.el and tweak the weighting factors to isolate &lt;kbd&gt;CTRL&lt;/kbd&gt; and &lt;kbd&gt;META&lt;/kbd&gt; keys. This package has great potential for automatic discovery of useful key binding sequences.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-12-15T17:39:22.280" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18872" PostTypeId="2" ParentId="18861" CreationDate="2015-12-15T20:37:08.370" Score="7" Body="&lt;p&gt;This is what I actually need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;C-j&quot;) 'helm-next-line)&#xA;(define-key helm-map (kbd &quot;C-k&quot;) 'helm-previous-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks @abo-abo for help!&lt;/p&gt;&#xA;" OwnerUserId="10497" LastActivityDate="2015-12-15T20:37:08.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18873" PostTypeId="2" ParentId="18867" CreationDate="2015-12-15T22:31:41.850" Score="2" Body="&lt;p&gt;This does seem odd - the link you gave says &quot;Elib has been decommissioned as a separate package since its useful functions have long since been included in Emacs.&quot;, but Elib is the first Google result for &quot;emacs doubly linked lists&quot;, and I couldn't find anything about them being in Emacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess the key word there is &quot;useful&quot;, which is a bit subjective. But in all my novice lisp programming I've never needed doubly linked lists, and I've never seen any code that uses them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'd say, just use Elib if you need a doubly linked list, and Elib works - it looks like a well documented library. The code is available here - &lt;a href=&quot;https://github.com/burakbayramli/kod/tree/master/site-lisp/elib&quot; rel=&quot;nofollow&quot;&gt;https://github.com/burakbayramli/kod/tree/master/site-lisp/elib&lt;/a&gt;. It's interesting to see such an old library - copyright 1991-1995.&lt;/p&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2015-12-16T05:37:14.620" LastActivityDate="2015-12-16T05:37:14.620" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18874" PostTypeId="2" ParentId="16492" CreationDate="2015-12-15T22:47:25.470" Score="2" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;C-x b (type a name for your new scratch buffer, e.g. &quot;asdf&quot;)&lt;/li&gt;&#xA;&lt;li&gt;M-x org-mode (change &quot;asdf&quot; buffer's major mode)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When closing this buffer you won't get a query for saving its contents. I.e. you get a proper scratch buffer. And the &lt;code&gt;*scratch*&lt;/code&gt; buffer remains intact.&lt;/p&gt;&#xA;" OwnerUserId="920" LastActivityDate="2015-12-15T22:47:25.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18875" PostTypeId="1" CreationDate="2015-12-16T03:57:45.670" Score="0" ViewCount="254" Body="&lt;p&gt;I am a newbie. How do I install Magit from its git repository? Where do you copy the repositories of Emacs packages? And how to get the correct path in Aquamacs?&lt;/p&gt;&#xA;" OwnerUserId="10507" LastEditorUserId="25" LastEditDate="2015-12-16T21:33:32.870" LastActivityDate="2015-12-16T21:33:32.870" Title="Installing Magit from its Git repository" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18876" PostTypeId="2" ParentId="2538" CreationDate="2015-12-16T04:34:45.963" Score="2" Body="&lt;p&gt;Building on itsjeyd's answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro spw/add-mode-pairs (hook pairs)&#xA;  `(add-hook ,hook&#xA;             (lambda ()&#xA;               (setq-local electric-pair-pairs (append electric-pair-pairs ,pairs))&#xA;               (setq-local electric-pair-text-pairs electric-pair-pairs))))&#xA;&#xA;(spw/add-mode-pairs 'emacs-lisp-mode-hook '((?` . ?')))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8610" LastActivityDate="2015-12-16T04:34:45.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18877" PostTypeId="1" AcceptedAnswerId="18892" CreationDate="2015-12-16T05:27:12.160" Score="6" ViewCount="1957" Body="&lt;p&gt;By default org mode source blocks looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;  (dcg/add-to-list 'package-archives&#xA;                   '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;)&#xA;                   '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;                   '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;  (package-initialize)&#xA;  (setq package-enable-at-startup nil)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure it to indent without the two beginning spaces like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(dcg/add-to-list 'package-archives&#xA;                 '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;)&#xA;                 '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;                 '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(package-initialize)&#xA;(setq package-enable-at-startup nil)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="774" LastActivityDate="2015-12-16T15:24:08.833" Title="How to indent without the two extra spaces at the beginning of code blocks in org mode?" Tags="|org-mode|indentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18878" PostTypeId="1" AcceptedAnswerId="18889" CreationDate="2015-12-16T05:31:09.117" Score="4" ViewCount="3892" Body="&lt;p&gt;As we all know sometimes it's OK to break the rules. Flycheck Mode however, isn't as forgiving and happily displays it's warning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to disable this on a per line basis when using flake8? For example: Adding a comment &lt;code&gt;# fc:ignore&lt;/code&gt; on the same line as a warning you want to ignore.&lt;/p&gt;&#xA;" OwnerUserId="10370" LastEditorUserId="10370" LastEditDate="2015-12-17T03:07:25.010" LastActivityDate="2017-04-21T18:00:46.767" Title="Is there a way in Flycheck flake8 mode to ignore a specific warning?" Tags="|flycheck|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18879" PostTypeId="1" AcceptedAnswerId="18882" CreationDate="2015-12-16T07:24:00.387" Score="3" ViewCount="325" Body="&lt;p&gt;I am trying to rebind some keys for &lt;code&gt;info-mode&lt;/code&gt; without success. I am not sure whether I am missing something, or whether a special hook is required. I am using the following hook in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'info-mode-hook&#xA;          (lambda ()&#xA;            (message &quot;setting up info-mode&quot;)&#xA;            (local-set-key (kbd &quot;C-c l&quot;)&#xA;                           'info-last)&#xA;            (local-set-key (kbd &quot;g g&quot;)&#xA;                           'evil-goto-first-line)&#xA;            (local-set-key (kbd &quot;C-c g&quot;)&#xA;                           'info-goto-node)&#xA;            )&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run &lt;code&gt;C-h i&lt;/code&gt; to open &lt;code&gt;info-mode&lt;/code&gt;, my custom bound keys above do not work and I do not get any message like &quot;setting up info-mode&lt;code&gt;in my&lt;/code&gt;Messages` buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have evaluated the above hook with an empty emacs config (&lt;code&gt;emacs -q&lt;/code&gt;), and I have many other mode hooks that are working fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions to help troubleshoot or resolve this issue would be appreciated! I am happy to clarify anything as well.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-12-16T08:02:38.213" Title="what is info-mode-hook" Tags="|hooks|info|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18880" PostTypeId="2" ParentId="18716" CreationDate="2015-12-16T07:45:56.580" Score="6" Body="&lt;p&gt;This is because &lt;code&gt;read-char&lt;/code&gt; is advised to have special behaviour. When running in 'multiple-cursors-mode' it caches the character read the first time. If this cache is full then it does not ask for a character again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whatever function is called by &quot;c&quot; in the &lt;code&gt;interactive&lt;/code&gt; description is not advised in this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implementation is incredibly hackish: for example if you have multiple calls to read-char in the same &lt;code&gt;interactive&lt;/code&gt; specification you get nonsense. unfortunately I don't see how to improve the situation.&lt;/p&gt;&#xA;" OwnerUserId="2779" LastEditorUserId="2779" LastEditDate="2015-12-16T08:00:13.700" LastActivityDate="2015-12-16T08:00:13.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18881" PostTypeId="1" AcceptedAnswerId="18897" CreationDate="2015-12-16T07:59:14.500" Score="5" ViewCount="3933" Body="&lt;p&gt;it's not clear for me how should I set use-package to load a package when a mode is activated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read different things about :mode, :init :config and I am now confused.&#xA;Could someone explains it to me ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good exemple to me would be to start yasnipped in prog-mode.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2015-12-16T17:12:17.303" Title="Use-package for a mode" Tags="|major-mode|use-package|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18882" PostTypeId="2" ParentId="18879" CreationDate="2015-12-16T08:02:38.213" Score="6" Body="&lt;p&gt;The built-in &lt;code&gt;Info-mode&lt;/code&gt; uses a combination of initial uppercase and/or all lowercase letters for the various variables/functions/faces.  There may be a rhyme or reason, but it quite frankly escapes me as I read through the source-code.  I wish there were a better method than familiarizing ourselves with the source code by typing &lt;code&gt;M-x find-library RET info RET&lt;/code&gt; and reading through it with some targeted word searches, but I don't really have a better method -- except perhaps &lt;code&gt;find-variable&lt;/code&gt;/&lt;code&gt;find-function&lt;/code&gt;/&lt;code&gt;find-face&lt;/code&gt; and trying both &lt;code&gt;info-&lt;/code&gt; with a lowercase and &lt;code&gt;Info-&lt;/code&gt; with an uppercase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the context of this particular question, the major-mode is &lt;code&gt;Info-mode&lt;/code&gt; with a capital letter &quot;I&quot; and the hook is similar -- i.e., &lt;code&gt;Info-mode-hook&lt;/code&gt; with a capital &quot;I&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2015-12-16T08:02:38.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18883" PostTypeId="1" AcceptedAnswerId="19473" CreationDate="2015-12-16T08:12:37.813" Score="8" ViewCount="1175" Body="&lt;p&gt;Is there a way to make the list of recently clocked-in tasks in org-mode persistent across Emacs restarts and (more importantly) closed buffers? It's annoying having to find the previous task just because I happened to exit a file.&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2023-08-22T16:19:03.173" Title="persistent org-mode clock-in history" Tags="|org-mode|org-clock|persistence|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18884" PostTypeId="2" ParentId="18457" CreationDate="2015-12-16T08:45:49.687" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;There's a huge amount of ANSI escape sequences&lt;/a&gt;.  I've made a regex catching most you'll run into based on &lt;a href=&quot;https://stackoverflow.com/questions/14693701/how-can-i-remove-the-ansi-escape-sequences-from-a-string-in-python/33925425#33925425&quot;&gt;this answer&lt;/a&gt; and wrote some code to use it with eshell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-ansi-escape-re&#xA;  (rx (or ?\233 (and ?\e ?\[))&#xA;      (zero-or-more (char (?0 . ?\?)))&#xA;      (zero-or-more (char ?\s ?- ?\/))&#xA;      (char (?@ . ?~))))&#xA;&#xA;(defun my-nuke-ansi-escapes (beg end)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (re-search-forward my-ansi-escape-re end t)&#xA;      (replace-match &quot;&quot;))))&#xA;&#xA;(defun my-eshell-nuke-ansi-escapes ()&#xA;  (my-nuke-ansi-escapes eshell-last-output-start eshell-last-output-end))&#xA;&#xA;(add-hook 'eshell-output-filter-functions 'my-eshell-nuke-ansi-escapes t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-12-16T08:45:49.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18885" PostTypeId="1" AcceptedAnswerId="18886" CreationDate="2015-12-16T09:06:55.250" Score="8" ViewCount="1227" Body="&lt;p&gt;I had set up a custom hook for a mode, but I now realize that I want to use the mode without my changes and without my hook. So, I want the mode to behave as if I never set the hook in the first place, and I want to do this without restarting emacs. Is this reasonably doable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I was using the following hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'my-mode-hook&#xA;          (lambda ()&#xA;           ;; Do a bunch of stuff...ie:&#xA;           (local-set-key (kbd &quot;C-c l&quot;)&#xA;                          'some-fancy-function)&#xA;           )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can achieve my goal by deleting the hook for &lt;code&gt;my-mode&lt;/code&gt; from my &lt;code&gt;init.el&lt;/code&gt;, restarting emacs, and then using &lt;code&gt;my-mode&lt;/code&gt; as a default setup. But can I do this without restarting emacs? &lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2015-12-17T01:57:06.403" Title="how to unbind a mode hook without restarting" Tags="|hooks|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18886" PostTypeId="2" ParentId="18885" CreationDate="2015-12-16T09:35:19.287" Score="12" Body="&lt;p&gt;Using function symbols certainly makes this easier (and this is one of the reasons why I would recommend always using that approach). You can still use &lt;code&gt;remove-hook&lt;/code&gt; with the lambda form, though -- it just needs to be the &lt;em&gt;same&lt;/em&gt; lambda form as the one you added!&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(remove-hook 'my-mode-hook&#xA;             (lambda () (local-set-key (kbd &quot;C-c l&quot;) 'some-fancy-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you've edited the original code in the interim, you might find it simpler to inspect the &lt;code&gt;my-mode-hook&lt;/code&gt; variable to figure out which value to remove.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-12-16T09:35:19.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18887" PostTypeId="2" ParentId="18885" CreationDate="2015-12-16T09:37:35.523" Score="3" Body="&lt;p&gt;I've solved it in &lt;a href=&quot;https://github.com/abo-abo/oremacs/blob/github/oleh/hooks.el&quot; rel=&quot;nofollow&quot;&gt;my config&lt;/a&gt; by consistently naming all my hooks.  I use &lt;code&gt;eval-defun&lt;/code&gt; on a hook function to re-define it, followed possibly by &lt;code&gt;revert-buffer&lt;/code&gt; in relevant buffers. This approach also helps with autoloading mode-specific configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hooks.el:&#xA;(add-hook 'c++-mode-hook 'ora-c++-hook)&#xA;&#xA;modes/ora-c++.el:&#xA;;;;###autoload&#xA;(defun ora-c++-hook ()&#xA;  (auto-complete-mode 1)&#xA;  (c-toggle-auto-newline)&#xA;  ;; (hs-minor-mode)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to the consistent naming, it's possible to define a function that jumps to the hook that corresponds to the current mode - very useful.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-12-16T09:37:35.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18888" PostTypeId="2" ParentId="18875" CreationDate="2015-12-16T10:02:55.127" Score="2" Body="&lt;p&gt;Of course that is &lt;a href=&quot;http://magit.vc/manual/magit/Installing-from-the-Git-repository.html&quot; rel=&quot;nofollow&quot;&gt;covered by the manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I install all my packages as git submodules. To do that I run.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git submodule add --name magit git@github.com:magit/magit.git lib/magit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-16T10:08:53.940" LastActivityDate="2015-12-16T10:08:53.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18889" PostTypeId="2" ParentId="18878" CreationDate="2015-12-16T10:37:46.587" Score="5" Body="&lt;p&gt;Flycheck does not provide a generic way to ignore warnings, partly because no one implemented that feature yet, but mostly because we do not want to add yet another system to manage warnings to inline comments, configuration files, compiler flags, etc…  Warning control is already complicated enough without adding our ingredients to the soup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, Flycheck relies what the corresponding syntax checker provides for warning control.  For some syntax checkers that is a configuration file, for other it's flags to the compiler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flake8 specifically allows to inhibit warnings by adding a &lt;code&gt;# noqa&lt;/code&gt; comment to the end of the affected line.  Alternatively you can ignore specific warnings by disabling them in the &lt;a href=&quot;http://flake8.readthedocs.io/en/latest/user/configuration.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;configuration file&lt;/a&gt; of flake8.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="3922" LastEditDate="2017-04-21T18:00:46.767" LastActivityDate="2017-04-21T18:00:46.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18891" PostTypeId="1" AcceptedAnswerId="18895" CreationDate="2015-12-16T14:06:28.973" Score="0" ViewCount="69" Body="&lt;p&gt;In many many Gnus screenshots, I see this kind of presentation for the Group buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[groupname1 -- 3]&#xA;    2: subgroupname1&#xA;    1: subgroupname2&#xA;[groupname2 -- 6]&#xA;    6: subgroupname1&#xA;    0: subgroupname2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(ex: &lt;a href=&quot;http://zarb.org/~gc/img/gnus-screenshot-1.png&quot; rel=&quot;nofollow&quot;&gt;http://zarb.org/~gc/img/gnus-screenshot-1.png&lt;/a&gt; or &lt;a href=&quot;http://ostatic.com/files/images/Gnus-%5B2%5D.jpg&quot; rel=&quot;nofollow&quot;&gt;http://ostatic.com/files/images/Gnus-%5B2%5D.jpg&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to set this up but I do not know how or where to search.&#xA;Do you have any clue how to reach this result ?&lt;/p&gt;&#xA;" OwnerUserId="10422" LastActivityDate="2015-12-16T14:51:21.223" Title="Gnus group buffer presentation" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18892" PostTypeId="2" ParentId="18877" CreationDate="2015-12-16T14:16:17.300" Score="10" Body="&lt;p&gt;Try to customize &lt;code&gt;org-edit-src-content-indentation&lt;/code&gt;. I think by default it is set to 2. I think this is what controls that behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you put &lt;code&gt;(setq org-src-preserve-indentation t)&lt;/code&gt; in your init file, you will get your desired behaviour, plus indentation will be preserved on export. From the docs for &lt;code&gt;org-src-preserve-indentation&lt;/code&gt; (notice the reference to  &lt;code&gt;org-edit-src-content-indentation&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If non-nil preserve leading whitespace characters on export. If&#xA;  non-nil leading whitespace characters in source code blocks are&#xA;  preserved on export, and when switching between the org buffer and the&#xA;  language mode edit buffer.  If this variable is nil then, after&#xA;  editing with M-x org-edit-src-code, the minimum (across-lines) number&#xA;  of leading whitespace characters are removed from all lines, and the&#xA;  code block is uniformly indented according to the value of&#xA;  `org-edit-src-content-indentation'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is a bit of configuration code that I use to get nice indentation and syntax highlighting in the org buffer, among other things. Feel free to experiment with these settings!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-fontify-natively t&#xA;    org-src-window-setup 'current-window&#xA;    org-src-strip-leading-and-trailing-blank-lines t&#xA;    org-src-preserve-indentation t&#xA;    org-src-tab-acts-natively t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-16T15:24:08.833" LastActivityDate="2015-12-16T15:24:08.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18893" PostTypeId="1" CreationDate="2015-12-16T14:33:57.750" Score="9" ViewCount="344" Body="&lt;p&gt;When sorting the lines by &lt;code&gt;sort-lines&lt;/code&gt; the lines beginning with &lt;code&gt;ä&lt;/code&gt; comes after the lines starting with &lt;code&gt;z&lt;/code&gt;. It would be nice if the lines could be sorted ignoring the accents, Umlauts, etc, like in a dictionary. Ideally a line starting with &lt;code&gt;ändern&lt;/code&gt; should be come after a line starting with &lt;code&gt;anderen&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is simple solution for searching accented characters mentioned in &lt;a href=&quot;https://superuser.com/a/675172/&quot;&gt;https://superuser.com/a/675172/&lt;/a&gt; but can not be used here. I am wondering if that solution can be adapted in this situation.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2016-06-22T20:09:41.253" Title="Sorting lines with accented characters" Tags="|sorting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18894" PostTypeId="2" ParentId="18881" CreationDate="2015-12-16T14:37:00.717" Score="10" Body="&lt;p&gt;As the &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/README.md&quot; rel=&quot;noreferrer&quot;&gt;README&lt;/a&gt; will tell you, the &lt;code&gt;:mode&lt;/code&gt; keyword allows you to define a &lt;em&gt;deferred binding&lt;/em&gt; (i.e. on-demand), which will load the package when visiting a buffer which filename matches the expression you provided. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:init&lt;/code&gt; and &lt;code&gt;:config&lt;/code&gt; keywords are what you are looking for:&lt;br&gt;&#xA;They allow you to respectively execute code &lt;strong&gt;before&lt;/strong&gt; and &lt;strong&gt;after&lt;/strong&gt; the package is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keeping this in mind, here's what you could do to only load yasnippet in prog-mode buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package yasnippet&#xA;  :ensure t&#xA;  :init (add-hook 'prog-mode-hook #'yas-minor-mode)&#xA;  :config (yas-reload-all))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using this snippet, yasnippet will actually be &lt;em&gt;loaded&lt;/em&gt; on startup, but will only be &lt;em&gt;enabled&lt;/em&gt; in the buffers which major mode derive from &lt;code&gt;prog-mode&lt;/code&gt;. The appropriate snippets (if any) will then be loaded just-in-time.&lt;/p&gt;&#xA;" OwnerUserId="5136" LastEditorUserId="5136" LastEditDate="2015-12-16T15:09:43.023" LastActivityDate="2015-12-16T15:09:43.023" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18895" PostTypeId="2" ParentId="18891" CreationDate="2015-12-16T14:51:21.223" Score="1" Body="&lt;p&gt;'Topic' is the catchword.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Group buffer try 't' and 'T?' for a start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you may want to study (info &quot;(gnus) Group Topics&quot;).&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2015-12-16T14:51:21.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18896" PostTypeId="2" ParentId="17052" CreationDate="2015-12-16T14:55:48.817" Score="7" Body="&lt;p&gt;There is binding &lt;code&gt;C-c C-p&lt;/code&gt; which might please you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the docstring: '&lt;code&gt;C-c C-p&lt;/code&gt; runs the command org-previous-visible-heading'. Also note &lt;code&gt;C-c C-n&lt;/code&gt; for the move to the next heading.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2015-12-16T14:55:48.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18897" PostTypeId="2" ParentId="18881" CreationDate="2015-12-16T15:00:58.787" Score="5" Body="&#xA;&#xA;&lt;p&gt;The below snippet does the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It calls &lt;code&gt;yas-minor-mode&lt;/code&gt; when &lt;code&gt;prog-mode-hook&lt;/code&gt; is called.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;yasnippet&lt;/code&gt; package gets loaded/required automatically when &lt;code&gt;yas-minor-mode&lt;/code&gt; is called. &lt;em&gt;So if you do not open a buffer with a &lt;code&gt;prog-mode&lt;/code&gt; derived major mode, then &lt;code&gt;yas-minor-mode&lt;/code&gt; is not called, and so &lt;code&gt;yasnippet&lt;/code&gt; is not loaded at all.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Once &lt;code&gt;yasnippet&lt;/code&gt; is loaded, &lt;code&gt;yas-reload-all&lt;/code&gt; is called.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Please see the comments in below snippet for explanation.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package yasnippet&#xA;  :commands (yas-minor-mode) ; autoload `yasnippet' when `yas-minor-mode' is called&#xA;                                        ; using any means: via a hook or by user&#xA;                                        ; Feel free to add more commands to this&#xA;                                        ; list to suit your needs.&#xA;  :init ; stuff to do before requiring the package&#xA;  (progn&#xA;    (add-hook 'prog-mode-hook #'yas-minor-mode))&#xA;  :config ; stuff to do after requiring the package&#xA;  (progn&#xA;    (yas-reload-all)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For macros like &lt;code&gt;use-package&lt;/code&gt;, the &lt;code&gt;pp-macroexpand-last-sexp&lt;/code&gt; command is very valuable; simply put the cursor after the ending parenthesis of the macro form and call that command. For the above snippet, you will see,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (unless&#xA;      (fboundp 'yas-minor-mode)&#xA;    (autoload #'yas-minor-mode &quot;yasnippet&quot; nil t))&#xA;  (condition-case-unless-debug err&#xA;      (progn&#xA;        (add-hook 'prog-mode-hook #'yas-minor-mode))&#xA;    (error&#xA;     (ignore&#xA;      (display-warning 'use-package&#xA;                       (format &quot;%s %s: %s&quot; &quot;yasnippet&quot; &quot;:init&quot;&#xA;                               (error-message-string err))&#xA;                       :error))))&#xA;  (eval-after-load 'yasnippet&#xA;    '(progn&#xA;       (condition-case-unless-debug err&#xA;           (progn&#xA;             (yas-reload-all))&#xA;         (error&#xA;          (ignore&#xA;           (display-warning 'use-package&#xA;                            (format &quot;%s %s: %s&quot; &quot;yasnippet&quot; &quot;:config&quot;&#xA;                                    (error-message-string err))&#xA;                            :error))))&#xA;       t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2015-12-16T17:12:17.303" LastActivityDate="2015-12-16T17:12:17.303" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18898" PostTypeId="2" ParentId="18504" CreationDate="2015-12-16T15:31:42.167" Score="1" Body="&lt;p&gt;Maybe with this function&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun strip-html ()&#xA;  &quot;Remove HTML tags from the current buffer, &#xA;   (this will affect the whole buffer regardless of the restrictions in effect).&quot;&#xA;  (interactive &quot;*&quot;)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (widen)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward &quot;&amp;lt;[^&amp;lt;]*&amp;gt;&quot; (point-max) t)&#xA;    (replace-match &quot;\\1&quot;))&#xA;      (goto-char (point-min))&#xA;      (replace-string &quot;&amp;amp;copy;&quot; &quot;(c)&quot;)&#xA;      (goto-char (point-min))&#xA;      (replace-string &quot;&amp;amp;amp;&quot; &quot;&amp;amp;&quot;)&#xA;      (goto-char (point-min))&#xA;      (replace-string &quot;&amp;amp;lt;&quot; &quot;&amp;lt;&quot;)&#xA;      (goto-char (point-min))&#xA;      (replace-string &quot;&amp;amp;gt;&quot; &quot;&amp;gt;&quot;)&#xA;      (goto-char (point-min)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;source: &lt;a href=&quot;http://sachachua.com/notebook/emacs/small-functions.el&quot; rel=&quot;nofollow&quot;&gt;http://sachachua.com/notebook/emacs/small-functions.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-12-16T15:31:42.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18899" PostTypeId="1" CreationDate="2015-12-16T15:44:55.930" Score="1" ViewCount="115" Body="&lt;p&gt;I would like to htmlize my magit-log. When I try i get: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;htmlize-get-text-with-display: Args out of range: &quot; * &quot;, 0, -3&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there a workaround around? &lt;/p&gt;&#xA;" OwnerUserId="911" LastActivityDate="2016-01-16T06:09:05.213" Title="Htmlize magit-log" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18900" PostTypeId="2" ParentId="18893" CreationDate="2015-12-16T16:14:52.710" Score="5" Body="&lt;p&gt;I use this function for that&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-sort-lines ()&#xA;    (interactive)&#xA;    (shell-command-on-region (point-min) (point-max) &quot;LC_COLLATE=en_US.UTF-8 sort&quot; (buffer-name) t ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;To sort region or buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (defun my-sort-lines-buffer ()&#xA;    (interactive)&#xA;    (shell-command-on-region (point-min) (point-max) &quot;LC_COLLATE=en_US.UTF-8 sort&quot; (buffer-name) t ))&#xA;  (defun my-sort-lines-region (start end) &#xA;    (interactive &quot;r&quot;) &#xA;    (shell-command-on-region start end &quot;LC_COLLATE=en_US.UTF-8 sort&quot; (buffer-name) t))&#xA;  (defun my-sort-lines-region-or-buffer ()&#xA;    (interactive)&#xA;    (save-excursion&#xA;      (if (region-active-p)&#xA;          (progn&#xA;            (my-sort-lines-region (region-beginning) (region-end))&#xA;            (message &quot;Sorted selected region&quot;))&#xA;        (progn&#xA;          (my-sort-lines-buffer)&#xA;          (message &quot;Sorted buffer&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2015-12-17T16:16:41.170" LastActivityDate="2015-12-17T16:16:41.170" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18901" PostTypeId="1" AcceptedAnswerId="18920" CreationDate="2015-12-16T16:39:50.050" Score="7" ViewCount="457" Body="&lt;p&gt;I want to demonstrate my lack of knowledge with an example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the following two macro defintions,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro for (var from init to final do &amp;amp;rest body)&#xA;  &quot;Execute a simple for loop: (for i from 1 to 10 do (print i)).&quot;&#xA;  (let ((tempvar 'max))&#xA;    `(let ((,var ,init)&#xA;           (,tempvar ,final))&#xA;       (while (&amp;lt;= ,var ,tempvar)&#xA;         ,@body&#xA;         (setq ,var (1+ ,var))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro for (var from init to final do &amp;amp;rest body)&#xA;  &quot;Execute a simple for loop: (for i from 1 to 10 do (print i)).&quot;&#xA;  (let ((tempvar (make-symbol &quot;max&quot;)))&#xA;    `(let ((,var ,init)&#xA;           (,tempvar ,final))&#xA;       (while (&amp;lt;= ,var ,tempvar)&#xA;         ,@body&#xA;         (setq ,var (1+ ,var))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the first macro shadows any variables named &lt;code&gt;max&lt;/code&gt; which may&#xA;occur in the body and the second does not, which can be showed with&#xA;the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((max 0)) ;; this variable is shadowed if the first macro defintion is used&#xA;  (for i from 1 to 3 do&#xA;       (setq square (* i i))&#xA;       (if (&amp;gt; square max) &#xA;         (princ (format &quot;\n%d %d&quot; i square)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I have learned the evaluation of a macro call works like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The macro gets evaluated twice. First the body gets evaluated and returns a form.&#xA;This form then gets evaluated again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I assume that the macro really returns a chunk of &#xA;text which happens to be a lisp form, which then gets interpreted,&#xA;I get a conflict that makes me unable to understand the example above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What chunk of text does the second macro which uses &lt;code&gt;make-symbol&lt;/code&gt; return,&#xA;so that no shadowing occurs? In my understanding an extreme unlikely random choosen&#xA;symbol name would make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;code&gt;pp-macroexpand...&lt;/code&gt; both macros return the same expansion.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is someone able to help me out of this confusion?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="105" LastEditDate="2016-06-22T20:09:25.673" LastActivityDate="2016-06-22T20:09:25.673" Title="Understanding uninterned symbols and macro expansion?" Tags="|elisp-macros|symbols|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18902" PostTypeId="2" ParentId="9374" CreationDate="2015-12-16T17:01:58.550" Score="1" Body="&lt;p&gt;Here is my solution:&#xA;Put below code in your .emacs or .spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll need manually put upper-case marker name and file name at line: evil-add-to-alist. &#xA;I also modified evil-goto-mark to fix a bug that introduced by set evil-markers-alist directly. The old code assume when the marker is a cons, the buffer has been closed. (when buffer closed, it convert marker to cons).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq alist (default-value 'evil-markers-alist))&#xA;  (evil-add-to-alist 'alist ?E '(&quot;/path/to/yourfile&quot; . 1))&#xA;  (setq-default evil-markers-alist alist)&#xA;&#xA;  (evil-define-command evil-goto-mark (char &amp;amp;optional noerror)&#xA;    &quot;Go to the marker specified by CHAR.&quot;&#xA;    :keep-visual t&#xA;    :repeat nil&#xA;    :type exclusive&#xA;    (interactive (list (read-char)))&#xA;    (let ((marker (evil-get-marker char)))&#xA;      (cond&#xA;       ((markerp marker)&#xA;        (switch-to-buffer (marker-buffer marker))&#xA;        (goto-char (marker-position marker)))&#xA;       ((numberp marker)&#xA;        (goto-char marker))&#xA;       ((consp marker)&#xA;        (when (or (and (find-buffer-visiting (car marker))&#xA;                       (switch-to-buffer (find-buffer-visiting (car marker)) )&#xA;                       )&#xA;                  (and (y-or-n-p (format &quot;Visit file %s again? &quot;&#xA;                                         (car marker)))&#xA;                       (find-file (car marker))))&#xA;          (goto-char (cdr marker))))&#xA;       ((not noerror)&#xA;        (user-error &quot;Marker `%c' is not set%s&quot; char&#xA;                    (if (evil-global-marker-p char) &quot;&quot;&#xA;                      &quot; in this buffer&quot;))))))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10514" LastActivityDate="2015-12-16T17:01:58.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18903" PostTypeId="1" AcceptedAnswerId="18908" CreationDate="2015-12-16T18:17:28.270" Score="2" ViewCount="740" Body="&lt;p&gt;I'm trying to use tabbar to setup groups for each remote host where I have buffers open. I need to get the full buffer name, so I can parse the hostname to set the group name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've figured out how to do everything I want, except for when using tramp and dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I initially open /ssh:dev:/home/fandingo/, I get some strange values for &lt;code&gt;dired-directory&lt;/code&gt; and &lt;code&gt;default-directory&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (default-directory .&#xA;   #(&quot;/ssh:fandingo@dev:/home/fandingo/&quot; 5 12&#xA;     (tramp-default t)))&#xA;&#xA; (dired-directory .&#xA;                  #(&quot;/ssh:fandingo@dev:/home/fandingo/&quot; 5 12&#xA;                    (tramp-default t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I used &lt;code&gt;M-x pp-eval-expression RET (buffer-local-variables) RET&lt;/code&gt; to get this info.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I navigate to a directory within this buffer (say elisp/), these variables become &quot;normal:&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (default-directory . &quot;/ssh:fandingo@dev:/home/fandingo/elisp/&quot;)&#xA;&#xA; (dired-directory . &quot;/ssh:fandingo@dev:/home/fandingo/elisp/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I go up (..) to the original directory, things go back to the weird values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What variable or function can I use to consistently get the full tramp path, regardless of whether I've navigated anywhere or not in the dired buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, how can I transparently handle both data structures to get the tramp path? I'm not sure I even understand what Emacs is returning in the originally visited directory (It's not a list, or at least I couldn't &lt;code&gt;car&lt;/code&gt; it.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.16.6)&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2015-12-16T20:02:33.713" Title="Tramp and Dired: Initial default-directory/dired-directory" Tags="|dired|tramp|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18904" PostTypeId="1" CreationDate="2015-12-16T18:28:00.320" Score="3" ViewCount="1370" Body="&lt;p&gt;I've been maintaining my personal webpage by using the &lt;code&gt;htmlize&lt;/code&gt; feature with &lt;code&gt;org-mode&lt;/code&gt;. Basically, I have a directory &lt;code&gt;~/webpage&lt;/code&gt; with many subdirectories containing &lt;code&gt;.org&lt;/code&gt; files. I then run a script that finds each &lt;code&gt;.org&lt;/code&gt; file under &lt;code&gt;~/webpage&lt;/code&gt; and runs &lt;code&gt;htmlize&lt;/code&gt; on the file. The script is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/home/brian/.emacs.d/elpa/htmlize-20130207.1202/&quot;)&#xA;(require 'htmlize)&#xA;&#xA;(defun htmlize-files-in-dir (dir)&#xA;  (htmlize-many-files (directory-files dir t &quot;.org$&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My issue is that in order for each page to conform to my emacs theme, the script has to open a new instance of emacs for each file. After some googling I found that there exists a function &lt;code&gt;org-export-htmlize-generate-css&lt;/code&gt; that would generate a global css style file for my theme. Obtaining such a css file would allow my script to run a lot faster (and would prevent the annoying emacs windows from flashing every time I run the script). However, my version of emacs (24.3.1) does not have the function &lt;code&gt;org-export-htmlize-generate-css&lt;/code&gt;. Does anyone have an idea how I could obtain this function?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2015-12-16T18:45:15.757" Title="How can I get org mode to cooperate with htmlize?" Tags="|org-mode|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="18908" PostTypeId="2" ParentId="18903" CreationDate="2015-12-16T20:02:33.713" Score="1" Body="&lt;p&gt;As Drew wrote, you see strings with text properties. If you worry about, use &lt;code&gt;(substring-no-properties default-directory)&lt;/code&gt; and &lt;code&gt;(substring-no-properties dired-directory)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-12-16T20:02:33.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18909" PostTypeId="2" ParentId="18885" CreationDate="2015-12-16T21:59:30.373" Score="2" Body="&lt;p&gt;My solution to this problem is to use defined functions instead of lambdas for my custom config code, and using &lt;code&gt;remove-hook&lt;/code&gt; to undo the custom config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, from my hook above, I would make the following changes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-mode-config ()&#xA;  (local-set-key (kbd &quot;C-c l&quot;) 'some-fancy-function))&#xA;&#xA;(add-hook 'my-mode-hook 'my-mode-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which provides the same functionality as the above code. But with this new code, I can reset my mode as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(remove-hook 'my-mode-hook 'my-mode-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's it!&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="454" LastEditDate="2015-12-17T01:57:06.403" LastActivityDate="2015-12-17T01:57:06.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18910" PostTypeId="2" ParentId="18818" CreationDate="2015-12-16T22:40:56.450" Score="4" Body="&lt;p&gt;OK, I dug some more into this. As far as I can see there are two possibilities of achieving this. Both rely on the autogenerated sitemap of &lt;code&gt;org-publish-project&lt;/code&gt;. So setting &lt;code&gt;:auto-sitemap t&lt;/code&gt; in the org-publish-project-alist is a prerequisite and in this example I set &lt;code&gt;:sitemap-filename &quot;sitemap.org&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first possibility relies on org's include facility. Adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML: &amp;lt;div id=&quot;navigation&quot;&amp;gt;&#xA;#+INCLUDE: &quot;sitemap.org&quot; :lines &quot;3-&quot;&#xA;#+HTML: &amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will include the generated sitemap. The &lt;code&gt;:lines &quot;3-&quot;&lt;/code&gt; ensures that the title of the sitemap is not included. You will need to create an empty file of the same name (if it does not already exist), so that you won't get a &quot;Cannot include file&quot; error on the first run. The output will only be correct after two runs of &lt;code&gt;org-publish-project&lt;/code&gt;, as the sitemap needs to be built during the first run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach has the disadvantage of including the menu in the body of the html, so it will always appear after the preamble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the second approach uses &lt;code&gt;:html-premble&lt;/code&gt; of the org-publish-project-alist. Here, you need a functions that exports the sitemap.org to html, using the &quot;body only&quot; option, reads the generated html file and returns it, wrapped in anything else that is required in the preamble.&lt;/p&gt;&#xA;" OwnerUserId="8218" LastEditorUserId="8218" LastEditDate="2015-12-17T07:24:13.010" LastActivityDate="2015-12-17T07:24:13.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18912" PostTypeId="2" ParentId="14550" CreationDate="2015-12-17T02:31:38.347" Score="0" Body="&lt;p&gt;Not sure I understand. Did you actually try setting &lt;code&gt;clang-format-style&lt;/code&gt;? By default it's set to &lt;code&gt;&quot;file&quot;&lt;/code&gt;, so that it takes the style information from the .clang-format file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can keep it that way and create a .clang-format file with the &lt;a href=&quot;http://clang.llvm.org/docs/ClangFormatStyleOptions.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;BasedOnStyle&lt;/code&gt;&lt;/a&gt; variable set to whatever style you want to inherit from, that way you retain the ability to use different styles on different projects (e.g. open source projects that might use a style different from your preferred).&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2015-12-17T02:31:38.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18913" PostTypeId="2" ParentId="18899" CreationDate="2015-12-17T05:24:22.627" Score="1" Body="&lt;p&gt;Same here. &lt;code&gt;Magit&lt;/code&gt; uses some overlay margin to display author/date and that is not handled properly by &lt;code&gt;htmlize&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you don't need the author/date margin, here's 2 way to disable it :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;inside the log window press &lt;code&gt;L&lt;/code&gt; then &lt;code&gt;t&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq magit-log-show-margin nil)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit: turns out that's not sufficent. if evaluate &lt;code&gt;(defun magit-format-log-margin (&amp;amp;optional authordate))&lt;/code&gt; (redefine as an empty function) it should work. &lt;/p&gt;&#xA;" OwnerUserId="499" LastEditorUserId="499" LastEditDate="2015-12-17T05:47:56.617" LastActivityDate="2015-12-17T05:47:56.617" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18914" PostTypeId="2" ParentId="17622" CreationDate="2015-12-17T05:28:26.577" Score="8" Body="&lt;p&gt;I had a similar problem, so maybe this will help - I'm not very familiar with org export or org internals, but I couldn't find anything that would parse an org file to a tree structure. But given a buffer like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* england&#xA;** london&#xA;** bristol&#xA;* france&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it will give you&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-get-header-tree) =&amp;gt; (&quot;england&quot; (&quot;london&quot; &quot;bristol&quot;) &quot;france&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and can include other information from the tree as well. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So given a flat list of levels we need to produce a tree, e.g. (1 1 2 3 1) =&gt; (1 1 (2 (3)) 1). I couldn't find a function that would do this either so wrote one after much drawing of cons cells - I'm sure there's a better way of doing this but it works. The function &lt;code&gt;unflatten&lt;/code&gt; takes a flat list and couple of functions to extract the information you want from the list and the item levels and produces a tree structure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;org-get-header-list&lt;/code&gt; you could add more information you want to extract from each item with calls to &lt;code&gt;org-element-property&lt;/code&gt;, and then in &lt;code&gt;org-get-header-tree&lt;/code&gt; you could include functions to extract the information from the list. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it stands this doesn't include handling for dash lists, but maybe it could be adapted to handle those also without too much trouble...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;&#xA;(defun unflatten (xs &amp;amp;optional fn-value fn-level)&#xA;  &quot;Unflatten a list XS into a tree, e.g. (1 2 3 1) =&amp;gt; (1 (2 (3)) 1).&#xA;FN-VALUE specifies how to extract the values from each element, which&#xA;are included in the output tree, FN-LEVEL tells how to extract the&#xA;level of each element. By default these are the `identity' function so&#xA;it will work on a list of numbers.&quot;&#xA;  (let* ((level 1)&#xA;         (tree (cons nil nil))&#xA;         (start tree)&#xA;         (stack nil)&#xA;         (fn-value (or fn-value #'identity))&#xA;         (fn-level (or fn-level #'identity)))&#xA;    (dolist (x xs)&#xA;      (let ((x-value (funcall fn-value x))&#xA;            (x-level (funcall fn-level x)))&#xA;        (cond ((&amp;gt; x-level level)&#xA;               (setcdr tree (cons (cons x-value nil) nil))&#xA;               (setq tree (cdr tree))&#xA;               (push tree stack)&#xA;               (setq tree (car tree))&#xA;               (setq level x-level))&#xA;              ((= x-level level)&#xA;               (setcdr tree (cons x-value nil))&#xA;               (setq tree (cdr tree)))&#xA;              ((&amp;lt; x-level level)&#xA;               (while (&amp;lt; x-level level)&#xA;                 (setq tree (pop stack))&#xA;                 (setq level (- level 1)))&#xA;               (setcdr tree (cons x-value nil))&#xA;               (setq tree (cdr tree))&#xA;               (setq level x-level)))))&#xA;      (cdr start)))&#xA;&#xA;; eg (unflatten '(1 2 3 2 3 4)) =&amp;gt; '(1 (2 (3) 2 (3 (4))))&#xA;&#xA;&#xA;(defun org-get-header-list (&amp;amp;optional buffer) &#xA;  &quot;Get the headers of an org buffer as a flat list of headers and levels.&#xA;Buffer will default to the current buffer.&quot;&#xA;  (interactive)&#xA;  (with-current-buffer (or buffer (current-buffer))&#xA;    (let ((tree (org-element-parse-buffer 'headline)))&#xA;      (org-element-map &#xA;          tree &#xA;          'headline&#xA;        (lambda (el) (list &#xA;                 (org-element-property :raw-value el) ; get header title without tags etc&#xA;                 (org-element-property :level el) ; get depth&#xA;                 ;; &amp;gt;&amp;gt; could add other properties here&#xA;                 ))))))&#xA;&#xA;; eg (org-get-header-list) =&amp;gt; ((&quot;pok&quot; 1) (&quot;lkm&quot; 1) ((&quot;cedar&quot; 2) (&quot;yr&quot; 2)) (&quot;kjn&quot; 1))&#xA;&#xA;&#xA;(defun org-get-header-tree (&amp;amp;optional buffer)&#xA;  &quot;Get the headers of the given org buffer as a tree.&quot;&#xA;  (interactive)&#xA;  (let* ((headers (org-get-header-list buffer))&#xA;         (header-tree (unflatten headers  &#xA;                 (lambda (hl) (car hl))  ; extract information to include in tree&#xA;                 (lambda (hl) (cadr hl)))))  ; extract item level&#xA;    header-tree))&#xA;&#xA;; eg (org-get-header-tree) =&amp;gt; (&quot;pok&quot; &quot;lkm&quot; (&quot;cedar&quot; &quot;yr&quot;) &quot;kjn&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2019-04-02T07:24:27.767" LastActivityDate="2019-04-02T07:24:27.767" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18915" PostTypeId="2" ParentId="18534" CreationDate="2015-12-17T08:41:12.540" Score="7" Body="&lt;p&gt;I have the same problem with you on my Mac(El Capitan), and the colon &quot;:&quot; maybe affects.&lt;br&gt;&#xA;After I delete the colon &quot;:&quot;, the preview works in my Emacs.&#xA;Here is my code on my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;PATH&quot; (concat &quot;/Library/TeX/texbin&quot; (getenv &quot;PATH&quot;)))&#xA;(setq exec-path (append '(&quot;/Library/TeX/texbin&quot;) exec-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10509" LastActivityDate="2015-12-17T08:41:12.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18916" PostTypeId="2" ParentId="18691" CreationDate="2015-12-17T09:44:12.953" Score="4" Body="&lt;p&gt;The configuraton variable &lt;code&gt;org-export-with-broken-links&lt;/code&gt; was added quite recently to support this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may not be running a sufficiently recent org-mode to get that option, though, since it was only committed in October. It doesn't seem to have landed in the &lt;em&gt;org-plus-contrib&lt;/em&gt; package I'm running from MELPA, for example (version 20151123).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=59761024b17b3b71e70b6fde4f8580eb586d2f7b;hp=707fbc37781eea123e70f1c27062a26374e61ef4&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=59761024b17b3b71e70b6fde4f8580eb586d2f7b;hp=707fbc37781eea123e70f1c27062a26374e61ef4&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2015-12-17T09:44:12.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18917" PostTypeId="2" ParentId="16835" CreationDate="2015-12-17T11:27:23.513" Score="3" Body="&lt;p&gt;You can try with the diffview package: &lt;a href=&quot;https://github.com/emacsmirror/diffview&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacsmirror/diffview&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;configuration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'diffview)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;execution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x diffview-current&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2015-12-17T11:27:23.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18920" PostTypeId="2" ParentId="18901" CreationDate="2015-12-17T14:08:38.943" Score="5" Body="&lt;p&gt;As mentioned in the comments, you have to turn on this setting to see how macro-expansion works more precisely.&#xA;Note that it only changes how &lt;code&gt;macroexpand&lt;/code&gt; is displayed, the macros still work the same in either case:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq print-gensym t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the first instance expands to (incorrect):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(let ((max 0))&#xA;  (let ((i 1)&#xA;        (max 3))&#xA;    (while (&amp;lt;= i max)&#xA;      (setq square (* i i))&#xA;      (if (&amp;gt; square max)&#xA;          (princ&#xA;           (format &quot;\n%d %d&quot; i square)))&#xA;      (setq i (1+ i)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the second one expands to (correct):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(let ((max 0))&#xA;  (let&#xA;      ((i 1)&#xA;       (#:max 3))&#xA;    (while&#xA;        (&amp;lt;= i #:max)&#xA;      (setq square&#xA;            (* i i))&#xA;      (if&#xA;          (&amp;gt; square max)&#xA;          (princ&#xA;           (format &quot;\n%d %d&quot; i square)))&#xA;      (setq i&#xA;            (1+ i)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To further understand the difference, consider evaluating this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq max 10)&#xA;;; =&amp;gt; 10&#xA;(symbol-value 'max)&#xA;;; =&amp;gt; 10&#xA;(symbol-value (make-symbol &quot;max&quot;))&#xA;;; =&amp;gt; Caught unbound variable #:max, setting it to nil.&#xA;(make-symbol &quot;max&quot;)&#xA;;; =&amp;gt; #:max&#xA;(eq (make-symbol &quot;max&quot;)&#xA;    (make-symbol &quot;max&quot;))&#xA;;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the result of &lt;code&gt;(make-symbol &quot;max&quot;)&lt;/code&gt; has no value. This ensures the correctness of the first eval pass on the macro.  With the second eval pass, &lt;code&gt;#:max&lt;/code&gt; gains a value since it's now bound as a dynamic variable.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2015-12-17T14:08:38.943" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18921" PostTypeId="1" AcceptedAnswerId="18923" CreationDate="2015-12-17T14:31:53.773" Score="1" ViewCount="472" Body="&lt;p&gt;I have the following snippet&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* ----------------------------------------------------&#xA;* METHOD ${1:$$(upcase yas-text)}.&#xA;* ---------------------------------------------------- */&#xA;public function f$1($2) {&#xA;    $3&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem is that the mirror starts on &lt;code&gt;METHOD&lt;/code&gt;, instead on &lt;code&gt;public&#xA;function&lt;/code&gt;. So the upcase characters inside the function name, that I type in&#xA;&lt;code&gt;METHOD&lt;/code&gt; will not being mirrored to the line with &lt;code&gt;public function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I configure the snippet to type on the line with &lt;code&gt;public function&lt;/code&gt;,&#xA;while being mirrored in the line with &lt;code&gt;METHOD&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-12-17T14:42:02.027" LastActivityDate="2017-04-18T23:38:29.960" Title="How mirror another line in Yasnippet?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18922" PostTypeId="1" AcceptedAnswerId="18927" CreationDate="2015-12-17T14:52:32.373" Score="1" ViewCount="454" Body="&lt;p&gt;An error tooltip is automatically closed after like 5 seconds. Could you prevent this? So it would be closed only when you move cursor? I changed tooltip-hide-delay but it did't help.&lt;/p&gt;&#xA;" OwnerUserId="10526" LastActivityDate="2015-12-17T18:01:27.833" Title="Is it possible to not close error tooltip?" Tags="|flycheck|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18923" PostTypeId="2" ParentId="18921" CreationDate="2015-12-17T14:58:22.373" Score="2" Body="&lt;p&gt;Using &lt;code&gt;$$()&lt;/code&gt; indicates a field transformation, not a mirror. To get a mirror use only 1 &lt;code&gt;$&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* ----------------------------------------------------&#xA;* METHOD ${1:$(upcase yas-text)}.&#xA;* ---------------------------------------------------- */&#xA;public function f$1($2) {&#xA;    $3&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://joaotavora.github.io/yasnippet/snippet-development.html#sec-3-7&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://joaotavora.github.io/yasnippet/snippet-development.html#sec-3-7&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2017-04-18T23:38:29.960" LastActivityDate="2017-04-18T23:38:29.960" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18924" PostTypeId="1" AcceptedAnswerId="18959" CreationDate="2015-12-17T15:32:27.840" Score="0" ViewCount="527" Body="&lt;p&gt;I give this new interface the benefit of a doubt, but I'm close to just removing this version and going back to something earlier and more friendly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There appears to be no way, at least not on the surface to push your changes to new branch, i.e. Say, you've checked out branch &lt;code&gt;A&lt;/code&gt;, created branch &lt;code&gt;B&lt;/code&gt; from it and now you want to push your branch &lt;code&gt;B&lt;/code&gt; while at the same time creating a branch with the same name in remote repository.  Something you'd typically achieve by running:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git push -u origin B&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is no way that I can see in the pop-up buffer to accomplish this. When I use &lt;code&gt;-u&lt;/code&gt; in combination with &lt;code&gt;o&lt;/code&gt; - I am prompted for another branch = useless. When I combine this with &lt;code&gt;m&lt;/code&gt; - instead of creating new branch, Magit tries to push the local branch tracking &lt;code&gt;A&lt;/code&gt; - this is completely useless behavior. &lt;code&gt;t&lt;/code&gt; and &lt;code&gt;T&lt;/code&gt; pushes tags, so in this case is useless too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also no option to &lt;code&gt;just push&lt;/code&gt;, which was one of the reasons to use Magit instead of just typing this on the command line...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To prevent further attempts to mark this as a duplicate: this question is not about pushing to the remote branch tracked by local branch (possible by pressing &lt;kbd&gt;P u&lt;/kbd&gt;) this is about creating a branch in remote repository named after local branch and pushing into it (all at once), something that can be achieved by typing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git push -u origin B&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-12-17T16:44:40.567" LastActivityDate="2015-12-30T18:52:31.763" Title="New Magit interface: no actual &quot;push&quot;" Tags="|magit|" AnswerCount="3" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="18926" PostTypeId="1" AcceptedAnswerId="18951" CreationDate="2015-12-17T17:57:50.950" Score="1" ViewCount="190" Body="&lt;p&gt;Is it possible in emacs-24 to set up a solid-colored mode-line with my color choice? ... for example, the entire mode-line would have a red background, and all mode-line text fields would be in foreground white?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to be able to do this in emacs-23 via color-theme.el, but now, all the &quot;modeline*&quot; settings that color-theme uses only seem to affect the buffer-name portion of the mode-line, and not that entire line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I out of luck in emacs-24, or is there some way to color the entire mode line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastActivityDate="2015-12-18T17:17:22.707" Title="emacs-24: solid-colored mode-line with my color choice?" Tags="|mode-line|coloring|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18927" PostTypeId="2" ParentId="18922" CreationDate="2015-12-17T18:01:27.833" Score="4" Body="&lt;p&gt;It turned out I use flycheck-pos-tip for tooltips and it has flycheck-pos-tip-timeout variable.&lt;/p&gt;&#xA;" OwnerUserId="10526" LastActivityDate="2015-12-17T18:01:27.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18929" PostTypeId="2" ParentId="18924" CreationDate="2015-12-17T19:01:01.570" Score="8" Body="&lt;p&gt;Ideally the relevant part of the popup looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; p myfork/feature&#xA; u origin/master&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in your case it probably looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;kbd&gt;p&lt;/kbd&gt; and &lt;kbd&gt;u&lt;/kbd&gt; variants are missing because the relevant options are not set.  &lt;kbd&gt;p&lt;/kbd&gt; pushes to the configured &lt;strong&gt;p&lt;/strong&gt;ush-remote, while &lt;kbd&gt;u&lt;/kbd&gt; pushes to the configured &lt;strong&gt;u&lt;/strong&gt;pstream branch.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I have added another way of setting the upstream and push-remote. By default you would now see the following if both of them are unset:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; p pushRemote, after setting that&#xA; u @{upstream}, after setting that&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/questions/19149&quot;&gt;this question&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The upstream branch, as suggested by the word &quot;upstream&quot;, should be used for the &quot;official&quot; branch on the &quot;official&quot; remote.  I.e. the branch on which most work is based and into which much changes should eventually be merged.  Often this is &quot;master&quot; on &quot;origin&quot;, i.e. &quot;origin/master&quot;; but it could also be something like &quot;origin/maint&quot; or &quot;origin/next&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you always work on just one branch &quot;master&quot; then the upstream branch and the branch you push to are the same, but if you use feature branches, then you don't want to push directly to &quot;master&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A branch &quot;feature&quot; should usually be pushed to &quot;feature&quot; on &quot;myfork&quot;, i.e. &quot;myfork/feature&quot;.  But because there might be more than one remote, e.g. &quot;origin&quot; and &quot;myfork&quot;, you have to tell Git where you want to push to.  This is done by setting the variable &lt;code&gt;branch.pushDefault&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git config branch.pushDefault myfork&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;kbd&gt;b M-p&lt;/kbd&gt; to do the same.  Keep pressing &lt;kbd&gt;M-p&lt;/kbd&gt; until the remote which should be used as the push-remote is highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often the push-remote should be the same for all branches, but when that is not the case, then you can override it for a single branch using e.g. &lt;code&gt;branch.&amp;lt;feature&amp;gt;.pushRemote&lt;/code&gt;.  That variable too can be set from the branching popup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concept of a push-remote, which is destinct from the upstream, existed in Git for many years, but Magit did not support it until &lt;code&gt;v2.4&lt;/code&gt;.  If you don't want to push-remote, because it &quot;is an unnecessary complication&quot;, then you can just abuse the upstream as before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But of course that too has to be configured.  Usually the upstream is automatically set when you create a branch.  But if that is not the case or if you need to change the value, then that to can be done from the branching popup, using &lt;kbd&gt;b u&lt;/kbd&gt; (if you want to change the value then you have to press that twice, because the first time just unsets the old value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do that directly from the pushing popup using the &lt;code&gt;--set-upstream&lt;/code&gt; argument.  In the popup first press &lt;kbd&gt;- u&lt;/kbd&gt; to turn on that switch.  Then you have to invoke a command which lets you choose where you want to push too.  It seems fairly obvious that the correct command to do that is &quot;Push feature to elsewhere&quot;.  The word &quot;elsewhere&quot; is used here because usually a branch has an upstream and a push-to branch.  If neither of the two is already configured, then the working might seem a bit strange, but it should still convey that you get to choose where that &quot;elsewhere&quot; is, i.e. to which branch you want to push.  So press &lt;kbd&gt;e&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next time you come to the pushing popup it will look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; u myfork/feature&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I recommend you instead make use of the distinction between the upstream and the push-remote and configure them as described above.  One huge advantage of the push-remote is that you usually only have to configure it once per repository.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-12-29T22:40:19.003" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18930" PostTypeId="1" CreationDate="2015-12-17T19:08:38.037" Score="1" ViewCount="570" Body="&lt;p&gt;I would like to add snippets of code for several languages to my org files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code I enter has syntax highlighting, but does use correct indetation.&#xA;One language I use is python, and &lt;a href=&quot;https://youtu.be/lsYdK0C2RvQ?t=3m15s&quot; rel=&quot;nofollow noreferrer&quot;&gt;I have seen here&lt;/a&gt;, that what I want &lt;strong&gt;is possible&lt;/strong&gt;. In the linked video, referring to entering code snippets with the correct syntax highlighting and so fourth, Matthew says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;... provided you have configured the appropriate settings...&quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am not sure what I could be missing as, for example, my python works just fine in a python buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I always need to open a separate buffer to achieve this, &lt;a href=&quot;https://emacs.stackexchange.com/questions/5850/how-to-auto-format-the-source-code-block-in-org-mode&quot;&gt;as mentioned here&lt;/a&gt;. The OP in that answer pasted his code in from somewhere else, but I am writing mine on the fly. Also, I do not really wish to use the accepted answer there, which is the timed-running of a custom function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a clear example, I enter the code here, leaving my cursor at the underscore, &lt;strong&gt;_&lt;/strong&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python&#xA;for i in range(1:23): _&#xA;∫   √&#xA;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and when I press enter, I end up at the &lt;em&gt;integral sign&lt;/em&gt;, &lt;strong&gt;∫&lt;/strong&gt;. I would of coursel ike to end up at the square root symbol (sorry for overkill on symbols!). That means 4-space indent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs 24.5 (9.0) on Mac OSX automatically inserts the &lt;code&gt;#+begin_src&lt;/code&gt; and &lt;code&gt;#+end_src&lt;/code&gt; all in upper case. I have tried both out and it doesn't make a difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there are some parameters one can set in the opening line, after having written the mode, in my case &lt;code&gt;python&lt;/code&gt; is there. Is there a parameter to specify something like indentation in the code snippet?&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-12-17T19:08:38.037" Title="Org mode code snippets - not appearing as expected" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18931" PostTypeId="1" CreationDate="2015-12-17T19:38:24.803" Score="9" ViewCount="889" Body="&lt;p&gt;Org tables do a great job in aligning columns with plain text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the alignment is lost when math formulas (in LaTeX) in cells are replaced with their preview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to preview LaTeX in tables with good alignment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/heCN0.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/heCN0.png&quot; alt=&quot;Notice the right-most misaligned table border&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="115" LastEditDate="2015-12-17T20:26:34.350" LastActivityDate="2023-09-17T08:25:42.293" Title="Aligning org tables with rendered LaTeX formulae" Tags="|org-mode|org-table|preview-latex|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18932" PostTypeId="1" AcceptedAnswerId="18936" CreationDate="2015-12-17T20:18:49.643" Score="12" ViewCount="5944" Body="&lt;p&gt;I set my theme with load-theme in a use-package macro loaded at startup. The theme has also been installed with use-package, from the repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At each start emacs asks me if I really want to load the theme in case it's not safe, how can I tell him to stop ?&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2015-12-17T22:22:31.727" Title="Stop emacs asking if a theme is safe" Tags="|themes|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18933" PostTypeId="1" CreationDate="2015-12-17T21:01:09.173" Score="4" ViewCount="370" Body="&lt;p&gt;Python's style guide (&lt;a href=&quot;https://www.python.org/dev/peps/pep-0008/#indentation&quot; rel=&quot;nofollow&quot;&gt;PEP 8: Indentation&lt;/a&gt;) suggests two alternatives for indenting the close paren for a multi-line function call.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function(&#xA;    first_long_argument,&#xA;    second_long_argument,&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function(&#xA;    first_long_argument,&#xA;    second_long_argument,&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm getting the second style (with Emacs 24.5.1) with &lt;code&gt;M-x indent-region&lt;/code&gt; but would like to know how to customize my .emacs configuration to get the first. I would like the first indentation to also result from tabbing the line with ')', as right now it remains unindented.&lt;/p&gt;&#xA;" OwnerUserId="10530" LastEditorUserId="10530" LastEditDate="2015-12-17T23:52:32.167" LastActivityDate="2015-12-18T08:36:25.847" Title="Python-mode: maintain indentation before closing brace?" Tags="|indentation|python|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18934" PostTypeId="1" CreationDate="2015-12-17T21:35:17.547" Score="6" ViewCount="591" Body="&lt;p&gt;I try to read email and mail list with Gnus on different computer. I am able to sync the configure files through Dropbox and it works fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't know how to sync the read history. I am always get the read articles show as unread on different computers repeatedly. &lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2024-03-29T01:03:35.420" Title="How to sync the read history of Gnus between computers through Dropbox?" Tags="|gnus|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18935" PostTypeId="2" ParentId="18367" CreationDate="2015-12-17T21:58:51.390" Score="0" Body="&lt;p&gt;I don't know for VC, but for magit, there is magit-log-ranged which should do what you want.&lt;/p&gt;&#xA;" OwnerUserId="10531" LastActivityDate="2015-12-17T21:58:51.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18936" PostTypeId="2" ParentId="18932" CreationDate="2015-12-17T22:22:31.727" Score="25" Body="&lt;p&gt;Set the second argument of the &lt;code&gt;load-theme&lt;/code&gt; function. From its docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the theme is not considered safe by ‘custom-safe-themes’,&#xA;  prompt the user for confirmation before loading it.  But if&#xA;  optional arg NO-CONFIRM is non-nil, load the theme without&#xA;  prompting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'solarized-dark t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will load the &lt;code&gt;solarized-dark&lt;/code&gt; theme without asking.&lt;/p&gt;&#xA;" OwnerUserId="920" LastActivityDate="2015-12-17T22:22:31.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18937" PostTypeId="1" AcceptedAnswerId="18966" CreationDate="2015-12-17T22:36:34.127" Score="1" ViewCount="317" Body="&lt;p&gt;I load multiple daemons service at startup with systemd.&#xA;The purpose of this is to have each one for different applications, one for C coding, one for Ocaml, one for Org...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a configuration file for each client which is passed to &lt;code&gt;-e&lt;/code&gt; with &lt;code&gt;load-file&lt;/code&gt; when running the daemon.&#xA;I want to set the dedault major mode of the scratch buffer for each one of them, so in the config file I have, for the ocaml config as example :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq initial-major-mode 'tuareg-mode)&#xA; (setq initial-scratch-message &quot;\&#xA; (* This buffer is for notes you don't want to save, and for OCaml code.&#xA; * If you want to create a file, visit that file with C-x C-f,&#xA; * then enter the text in that file's own buffer. *)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The message is written but the major mode is still lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens and how I can I fix that ?&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2015-12-19T15:32:05.830" Title="Emacs daemon major mode startup" Tags="|init-file|emacsclient|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18938" PostTypeId="2" ParentId="15206" CreationDate="2015-12-18T03:00:13.673" Score="1" Body="&lt;p&gt;Apparently, the thing to do is to edit the project over TRAMP (not in a shared directory).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running specs over TRAMP has &lt;a href=&quot;https://github.com/pezra/rspec-mode/issues/133&quot; rel=&quot;nofollow&quot;&gt;just been fixed&lt;/a&gt; in &lt;code&gt;rspec-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2015-12-18T03:00:13.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18939" PostTypeId="2" ParentId="18933" CreationDate="2015-12-18T08:36:25.847" Score="1" Body="&lt;p&gt;With python-mode.el, that would be &lt;code&gt;py-closing-list-dedents-bos&lt;/code&gt;.&#xA;Sorry, can't answer that WRT built-in python.el&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2015-12-18T08:36:25.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18941" PostTypeId="2" ParentId="10884" CreationDate="2015-12-18T10:31:56.220" Score="10" Body="&lt;p&gt;I'm using two different accounts that I want to mix as little as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;offlineimap&lt;/em&gt; is configured with two accounts, one delivering mail into &lt;code&gt;~/.maildir-work&lt;/code&gt; the other one into &lt;code&gt;~/.maildir-home&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My configuration for &lt;em&gt;mu4e&lt;/em&gt; uses the new context mechanism:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mu4e-contexts&#xA;      `( ,(make-mu4e-context&#xA;           :name &quot;home&quot;&#xA;           :match-func (lambda (_) (string-equal &quot;home&quot; (mu4e-context-name mu4e~context-current)))&#xA;           :enter-func '()&#xA;           :leave-func (lambda () (mu4e-clear-caches))&#xA;           :vars '((mu4e-maildir . &quot;~/.maildir-home&quot;)&#xA;                   (mu4e-mu-home . &quot;~/.mu-home&quot;)&#xA;                   (mu4e-get-mail-command . &quot;offlineimap -a Home&quot;)&#xA;                    ...))&#xA;         ,(make-mu4e-context&#xA;           :name &quot;work&quot;&#xA;           :match-func (lambda (_) (string-equal &quot;work&quot; (mu4e-context-name mu4e~context-current)))&#xA;           :enter-func '()&#xA;           :leave-func (lambda () (mu4e-clear-caches))&#xA;           :vars '((mu4e-maildir . &quot;~/.maildir-work&quot;)&#xA;                   (mu4e-mu-home . &quot;~/.mu-work&quot;)&#xA;                   (mu4e-get-mail-command . &quot;offlineimap -a Work&quot;)&#xA;                   ...))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10536" LastActivityDate="2015-12-18T10:31:56.220" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18942" PostTypeId="2" ParentId="17573" CreationDate="2015-12-18T15:11:08.333" Score="2" Body="&lt;p&gt;Solution (per Michael Albinus, above) for 2-factor authentication in Tramp:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;upgrade Emacs to 24.5 or use Emacs development version 25.0.50 or later&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/16584/7045&quot;&gt;Also see related answer.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-12-18T15:11:08.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18943" PostTypeId="2" ParentId="18766" CreationDate="2015-12-18T15:30:34.503" Score="7" Body="&lt;p&gt;The &lt;code&gt;html&lt;/code&gt; output from the exporter is just nested &lt;code&gt;ol&lt;/code&gt; lists without any labels.  To alter the labels you can use CSS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD: &amp;lt;style type=&quot;text/css&quot;&amp;gt;&#xA;#+HTML_HEAD:  ol ol { list-style-type: lower-alpha; }&#xA;#+HTML_HEAD: &amp;lt;/style&amp;gt;&#xA;&#xA;  1. first&#xA;  2. second&#xA;     a. sub&#xA;     b. under&#xA;  3. third&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RDG1q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RDG1q.png&quot; alt=&quot;Sample output&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To change the fullstops after the labels to something else see &lt;a href=&quot;https://stackoverflow.com/q/5945161/4050592&quot;&gt;https://stackoverflow.com/q/5945161/4050592&lt;/a&gt; for appropriate CSS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can use the &lt;code&gt;#+ATTR_HTML&lt;/code&gt; to add specific attributes to elements including a list.  This way you can make specific styling, such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD: &amp;lt;style type=&quot;text/css&quot;&amp;gt;&#xA;#+HTML_HEAD:  ol#al { list-style-type: upper-alpha; }&#xA;#+HTML_HEAD: &amp;lt;/style&amp;gt;&#xA;&#xA;#+ATTR_HTML: :id al&#xA;  1. first&#xA;  2. second&#xA;  3. third&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TB0a5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TB0a5.png&quot; alt=&quot;Styled sample&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2019-07-20T12:18:58.530" LastActivityDate="2019-07-20T12:18:58.530" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="18944" PostTypeId="2" ParentId="14394" CreationDate="2015-12-18T16:07:20.907" Score="2" Body="&lt;p&gt;Another one here, I updated with nadvice.el.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;1. Normal Evaluation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now, We have normal evaluation and results here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :results value&#xA;c('a','b','c')&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| a |&#xA;| b |&#xA;| c |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;2. Function Override&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can override temporary &lt;code&gt;org-babel-R-process-value-result&lt;/code&gt; in ob-R.el by &lt;code&gt;C-c C-c&lt;/code&gt; the following code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value&#xA;(defun org-babel-R-process-value-result-transpose (result column-names-p)&#xA;  (apply #'mapcar* #'list result))&#xA;&#xA;(advice-add 'org-babel-R-process-value-result&#xA;            :override #'org-babel-R-process-value-result-transpose)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;3. Transposed evaluation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Hereafter, every result of R evaluation will be transposed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :results value&#xA;c('a','b','c')&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| a | b | c |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;4. Remove Function Override&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You have to redefine back by &lt;code&gt;C-c C-c&lt;/code&gt; the following code for normal org-mode operation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value&#xA;(advice-remove 'org-babel-R-process-value-result&#xA;               #'org-babel-R-process-value-result-transpose)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;5. Normal Evaluation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Results are in normal operation now.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :results value&#xA;c('a','b','c')&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| a |&#xA;| b |&#xA;| c |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will be useful if you evaluate whole org-mode document by &lt;code&gt;C-c C-v C-b&lt;/code&gt; (&lt;code&gt;M-x org-babel-execute-buffer&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2015-12-19T17:17:19.270" LastActivityDate="2015-12-19T17:17:19.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18945" PostTypeId="1" AcceptedAnswerId="18956" CreationDate="2015-12-18T16:29:56.557" Score="13" ViewCount="933" Body="&lt;p&gt;My modeline is cluttered. Can I make it display pictures instead of mode names?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could use unicode Emoji (such as  for Python or  for Coq), but some machines on which I use my Emacs config do not have the right fonts pre-installed (ideally, I'd also like to reuse this technique in a mode that I'm writing, so I can't expect users to have the right font setup).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried adding an &lt;code&gt;:image&lt;/code&gt; display property to the modeline lighter of a toy minor-mode, but nothing appeared in the modeline:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode my/test-mode&#xA;  &quot;Test mode.&quot;&#xA;  :lighter (propertize &quot; &quot; 'display '(image :type imagemagick&#xA;                                             :file &quot;/home/clement/.emacs.d/rooster.png&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BqrLK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BqrLK.png&quot; alt=&quot;TWEmoji rooster (https://raw.githubusercontent.com/twitter/twemoji/gh-pages/72x72/1f413.png)&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2015-12-28T10:15:09.743" Title="Can I use an image in my modeline lighter?" Tags="|mode-line|images|text-properties|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18946" PostTypeId="1" CreationDate="2015-12-18T16:38:04.493" Score="0" ViewCount="225" Body="&lt;p&gt;I have been using emacs for a long time in windows.&#xA;(windows 10 on an HP laptop PC)  My .emacs file is in c:.emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Up until yesterday, the file was run whenever I started up emacs.&#xA;But yesterday it failed to run, so I have to manually run it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The .emacs (and _emacs) file is visible within emacs when I do a directory listing of c:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-rw-rw-rw-  1 Ray Voith        None           6670 2014-06-14  .emacs &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-rw-rw-rw-  1 Ray Voith        None           6605 2014-06-14  _emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but is not visible within cygwin in directory /cygdrive/c&#xA;I tried chmod 777 .emacs (also chmod 777 _emacs) within cygwin but it says&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ chmod 777 _emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;chmod: changing permissions of ‘_emacs’: Permission denied&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ray Voith@laptop /cygdrive/c&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ chmod 777 .emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;chmod: cannot access ‘.emacs’: No such file or directory&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not intentionally done anything to the .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why emacs would all of a sudden stop executing .emacs?&lt;/p&gt;&#xA;" OwnerUserId="10541" LastActivityDate="2015-12-18T16:56:47.377" Title="emacs failing to run c:\.emacs" Tags="|init-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18947" PostTypeId="1" CreationDate="2015-12-18T16:39:28.333" Score="4" ViewCount="94" Body="&lt;p&gt;You could colorize the message in the minibuffer with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (message (propertize &quot;foo bar&quot; 'face '(:foreground &quot;green&quot; :weight bold)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would apply this only to the confirmation message of writings. The green color will help me to clearly distinct errors and confirmations from the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the confirmation message is different every time. So the confirmation message in the minibuffer could be like : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrote C:/foo.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrote C:/bar.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When searching around on Emacs Stackexchange, there are various ways to surpress or display another message. But they assume it's a static string message. It's not. The message differs each time, it's depends from the path/filename where the buffer will be stored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there perhaps any way to recognize it's a write confirmation message, catch it, colorize it, and pass it further to the minibuffer?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-12-18T21:14:08.627" LastActivityDate="2015-12-18T21:14:08.627" Title="How catch the minibuffer message when saving, and colorize it? (Only for savings)" Tags="|minibuffer|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18948" PostTypeId="2" ParentId="18946" CreationDate="2015-12-18T16:56:47.377" Score="2" Body="&lt;p&gt;Set your MS Windows &lt;strong&gt;&lt;code&gt;HOME&lt;/code&gt;&lt;/strong&gt; environment variable to point to the folder where you store your init file (e.g., &lt;code&gt;.emacs&lt;/code&gt;). This is apparently &lt;code&gt;C:\&lt;/code&gt;, for you.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;C:\&lt;/code&gt; is the place where users put their init files in the past, but it is not necessarily the best place to do so. I recommend that you do this:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Set your to &lt;code&gt;HOME&lt;/code&gt; environment variable to something like &lt;code&gt;d:\usr\yourusername\&lt;/code&gt;.  Your user name here can be any name you like. In other words, just set &lt;code&gt;HOME&lt;/code&gt; to some folder explicitly.&lt;/p&gt;&#xA;&lt;p&gt;You can use &lt;code&gt;System&lt;/code&gt; &amp;gt; &lt;code&gt;Advanced system settings&lt;/code&gt; &amp;gt; &lt;code&gt;Environment Variables&lt;/code&gt; &amp;gt; &lt;code&gt;User Variables&lt;/code&gt; to do this.  Just add a &lt;code&gt;HOME&lt;/code&gt; variable if none is there.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Be sure to make yourself the &lt;em&gt;owner&lt;/em&gt; of that entire folder, including all its subfolders.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-12-18T16:56:47.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18949" PostTypeId="2" ParentId="18947" CreationDate="2015-12-18T17:07:31.583" Score="4" Body="&lt;p&gt;You are referring to messages written to the &lt;strong&gt;echo area&lt;/strong&gt; (not the &lt;strong&gt;minibuffer&lt;/strong&gt;, though the screen space is the same -- the minibuffer is for input; the echo area is for output).  And you are referring no doubt to such messages as the output of function &lt;code&gt;message&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;message&lt;/code&gt; is a built-in function (coded in C), and so in recent Emacs builds &lt;em&gt;you cannot advise it&lt;/em&gt;.  So you are out of luck wrt capturing its intended output and propertizing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can at least replace your &lt;em&gt;own&lt;/em&gt; calls to &lt;code&gt;message&lt;/code&gt; by calls to your own function, &lt;code&gt;rene-message&lt;/code&gt;, which first propertizes the formatted string before then passing it to &lt;code&gt;message&lt;/code&gt;.  Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun rene-message (fmt-strg &amp;amp;rest strgs)&#xA;  (message &quot;%s&quot; (propertize (format fmt-strg strgs) 'face 'rene-emphasis))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you want to emphasize certain parts of the message then you are better off doing that directly where the message is created. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(message &quot;%s `%s' added to the `%s', file `%s'&quot;&#xA;         type&#xA;         (propertize entry     'face 'rene-emphasis)&#xA;         (propertize set-name  'face 'rene-emphasis)&#xA;         (propertize file-name 'face 'rene-emphasis))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-18T17:07:31.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18950" PostTypeId="2" ParentId="18945" CreationDate="2015-12-18T17:15:06.430" Score="5" Body="&lt;p&gt;Good question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might try using something like this as the lighter: &lt;code&gt;(concat &quot; &quot; (propertize &quot; &quot; 'display (create-image img-file)))&lt;/code&gt;, where &lt;code&gt;img-file&lt;/code&gt; is the name of your image file.  (The first space char is just to separate this lighter from the previous one.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, I just tried, using this code, but it did &lt;strong&gt;not&lt;/strong&gt; work for me. You might try fiddling a bit more with it. Dunno whether it is possible.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-lighter-string&#xA;        (concat &quot; &quot; (propertize &quot; &quot; 'display (create-image &quot;/path/to/an/image/file.png&quot;))))&#xA;&#xA;(define-minor-mode foo &quot;...&quot; nil my-lighter-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The lighter just shows as an ordinary space char -- the &lt;code&gt;display&lt;/code&gt; property does not seem to be respected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't get a good answer to this question, consider filing an Emacs enhancement request, using &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing you can certainly do is to use one or two Unicode characters in the mode-line string.  And you can use chars that are, in effect, graphics.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-18T17:27:25.597" LastActivityDate="2015-12-18T17:27:25.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18951" PostTypeId="2" ParentId="18926" CreationDate="2015-12-18T17:17:22.707" Score="-1" Body="&lt;p&gt;Thanks to lawlist, I now know that the answer to my question is this:&#xA;set the attributes for the faces &quot;mode-line&quot; and &quot;mode-line-inactive&quot;.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastActivityDate="2015-12-18T17:17:22.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18953" PostTypeId="1" AcceptedAnswerId="44932" CreationDate="2015-12-18T19:09:02.763" Score="8" ViewCount="1874" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/14444/read-process-output-line-by-line&quot;&gt;Read process output line by line&lt;/a&gt; gives some partial ideas about how to deal with sub-process output in an intelligent manner, but no example and no working solution.  I have a couple of examples, one of them works (badly) and the other doesn't.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To invoke the code: save the Emacs Lisp snippets as &lt;code&gt;code1&lt;/code&gt; and &lt;code&gt;code2&lt;/code&gt; then make them executable with &lt;code&gt;chmod +x code*&lt;/code&gt; and run, e.g. &lt;code&gt;./code1 test.tex&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h1&gt;test.tex&lt;/h1&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\begin{document}&#xA;Emacs compilation test.&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&#xA;&#xA;&lt;h1&gt;this prints output from the inferior process all at once&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;#!/usr/bin/emacs --script&#xA;&#xA;(call-process &quot;pdflatex&quot; nil '(&quot;*scratch*&quot; t) nil (car argv))&#xA;(set-buffer (get-buffer &quot;*scratch*&quot;))&#xA;&#xA;(prin1 (buffer-string))&#xA;&#xA;(setq argv nil)&#xA;&#xA;;;; Local Variables: &#xA;;;; mode:emacs-lisp &#xA;;;; End: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;This does not print output from the inferior process at all&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;#!/usr/bin/emacs --script&#xA;&#xA;(defun my-process-filter (proc string)&#xA;  (print &quot;%s\n&quot; string))&#xA;&#xA;;; my understanding from comments on the question linked above&#xA;;; is that this would cause the output of the inferior process&#xA;;; to print out line by line.  It doesn't seem to work though.&#xA;(set-process-filter&#xA; (start-process &quot;tex&quot; &quot;*Messages*&quot; &quot;pdflatex&quot; (car argv))&#xA; #'my-process-filter)&#xA;&#xA;(setq argv nil)&#xA;&#xA;;;; Local Variables: &#xA;;;; mode:emacs-lisp &#xA;;;; End: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;tl;dr&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Another &quot;solution&quot; that serves as an interactive &quot;proof of concept&quot; is to run &lt;code&gt;M-x shell&lt;/code&gt; followed by &lt;code&gt;pdflatex test.tex&lt;/code&gt;.  Output from &lt;code&gt;pdflatex&lt;/code&gt; is printed line by line.  How to achieve the same result non-interactively?&lt;/p&gt;&#xA;" OwnerUserId="8406" LastEditorUserId="1979" LastEditDate="2018-09-25T15:39:51.413" LastActivityDate="2020-12-11T10:42:06.943" Title="Print process output line by line" Tags="|shell|process|script|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="18954" PostTypeId="1" CreationDate="2015-12-18T19:14:04.267" Score="2" ViewCount="216" Body="&lt;p&gt;For writing efficient emacs functions, would it be worthwhile/not too difficult to write a C wrapper for calling Julia functions or for calling Python functions via Numba/pycc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference: &lt;em&gt;Julia&lt;/em&gt; is a higher-level language designed for scientific computing that contains cfunction, a routine for efficiently passing Julia functions to C functions that accept function pointers. From what I gather, these functions are called more or less as efficiently as a native C function is called. Julia also happens to be able to call functions in many other languages very efficiently. &lt;em&gt;Numba&lt;/em&gt; is a just-in-time compiler for Python that can also create C libraries using the command &lt;em&gt;pycc&lt;/em&gt;. Both Julia and Python/Numba approach C-level performance for many tasks.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastEditorUserId="10424" LastEditDate="2015-12-18T23:08:38.973" LastActivityDate="2015-12-18T23:08:38.973" Title="Is it worthwhile to write a wrapper for calling Julia or Python functions from emacs?" Tags="|elisp|python|functions|" AnswerCount="0" CommentCount="8" ClosedDate="2016-02-27T20:24:26.727" ContentLicense="CC BY-SA 3.0" />
  <row Id="18955" PostTypeId="2" ParentId="18846" CreationDate="2015-12-18T20:31:56.477" Score="2" Body="&lt;p&gt;You can define your own whitespace-cleanup function which does not clean up the current line, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun white-space-cleanup-without-current-line ()&#xA;  (interactive)&#xA;  (whitespace-cleanup-region (point-min) (line-beginning-position))&#xA;  (whitespace-cleanup-region (line-end-position) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and use it for the save hook.&lt;/p&gt;&#xA;" OwnerUserId="10531" LastActivityDate="2015-12-18T20:31:56.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18956" PostTypeId="2" ParentId="18945" CreationDate="2015-12-18T21:52:56.600" Score="12" Body="&lt;p&gt;The mode line is rendered from a list of segments, each of which come with their own special rules.  See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html&quot; rel=&quot;noreferrer&quot;&gt;Mode Line Data&lt;/a&gt; for the details.  The symbol section contains a crucial hint to make your code work:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unless SYMBOL is marked as “risky” (i.e., it has a non-‘nil’&#xA;  ‘risky-local-variable’ property), all text properties specified in&#xA;  SYMBOL’s value are ignored.  This includes the text properties of&#xA;  strings in SYMBOL’s value, as well as all ‘:eval’ and ‘:propertize’&#xA;  forms in it.  (The reason for this is security: non-risky variables&#xA;  could be set automatically from file variables without prompting&#xA;  the user.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I suspect &lt;a href=&quot;https://github.com/TeMPOraL/nyan-mode/blob/master/nyan-mode.el#L240&quot; rel=&quot;noreferrer&quot;&gt;nyan-mode is doing it in a less than ideal way&lt;/a&gt;, so here's my minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-nyan-mode-lighter&#xA;  (list &quot; &quot; (propertize &quot;:3&quot; 'display&#xA;                        `(image :type imagemagick&#xA;                                :file ,(expand-file-name &quot;~/nyan.png&quot;)))))&#xA;(put 'my-nyan-mode-lighter 'risky-local-variable t)&#xA;&#xA;(define-minor-mode my-nyan-mode&#xA;  &quot;Nyan mode&quot;&#xA;  :lighter my-nyan-mode-lighter)&#xA;&#xA;(my-nyan-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason why I use a list of a space and an image is because it is convention to start a lighter with a space for separating it from the preceding ones.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2015-12-28T10:15:09.743" LastActivityDate="2015-12-28T10:15:09.743" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18957" PostTypeId="1" CreationDate="2015-12-18T22:03:43.510" Score="2" ViewCount="342" Body="&lt;p&gt;I'd like to write some lightning-fast functions for analyzing LaTeX code. Because they could involve a lot of complicated processing of large documents, I don't know whether it's a good idea to write them completely in Lisp or not. How fast is byte-compiled Lisp compared to C, and how intensive does the processing have to be for the user to notice a difference?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Specifically, I'm trying to implement better functions for finding certain types of errors -- for example, neither show-paren-mode nor smartparens-latex are smart enough to notice that \left and \right are brackets that must match with another \left or \right. These programs also don't know that there are features brackets can't match across (so if it encounters one of these features, which will have to be defined a complicated way since it's environment-dependent), it should report a paren mismatch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of the potential complexity of the code (parsing LaTeX can depend on the environment in complicated ways) and the fact that it has to be fast enough that the user won't notice a delay when, for example, they move the cursor over a parenthesis, I'm concerned about optimizing the code, and I want to know whether I can get away with writing careful Lisp or if it would be smarter to implement one or more primitives to help with the grunt-work.&lt;/p&gt;&#xA;" OwnerUserId="10424" LastEditorUserId="10424" LastEditDate="2015-12-18T22:51:35.767" LastActivityDate="2015-12-18T22:51:35.767" Title="How much faster is C than compiled elisp?" Tags="|elisp|byte-compilation|" AnswerCount="0" CommentCount="10" ClosedDate="2015-12-19T19:10:58.780" ContentLicense="CC BY-SA 3.0" />
  <row Id="18958" PostTypeId="2" ParentId="10049" CreationDate="2015-12-19T00:37:29.000" Score="3" Body="&lt;p&gt;I solved this by modifying the answer &lt;a href=&quot;https://stackoverflow.com/questions/1731634/dont-show-uninteresting-files-in-emacs-completion-window&quot;&gt;here&lt;/a&gt;.  This works for emacs 24.3.1, at least.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put the following in my .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Don't show dot files in the completion...                               &#xA;(require 'cl-lib) ; Needed for cl-remove-if-not                                        &#xA;&#xA;; Define string-suffix-p.                                                       &#xA;(defun string-suffix-p (str1 str2 &amp;amp;optional ignore-case)&#xA;  (let ((begin2 (- (length str2) (length str1))) (end2 (length str2)))&#xA;    (when (&amp;lt; begin2 0) (setq begin2 0))&#xA;    (eq t (compare-strings str1 nil nil str2 begin2 end2 ignore-case))))&#xA;&#xA;; Modify to return true for files you're interested in.                         &#xA;(defun my-file-match (str)&#xA;  (and (not (cl-remove-if-not (lambda (x) (string-suffix-p x str))&#xA;                               completion-ignored-extensions))&#xA;       (not (string-prefix-p &quot;.&quot; str))))&#xA;&#xA;; Add the advice after completion.                                              &#xA;(defadvice completion-file-name-table (after ignoring-backups-f-n-completion&#xA;                                             activate)&#xA;  (if (and (listp ad-return-value) (stringp (car ad-return-value))&#xA;           (cdr ad-return-value))&#xA;      (let ((newlis (cl-remove-if-not 'my-file-match ad-return-value)))&#xA;        ; If there are no qualifiers, list everything.                          &#xA;        (if (and (listp newlis) (cdr newlis))&#xA;            (setq ad-return-value newlis)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10542" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-12-20T02:22:48.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18959" PostTypeId="2" ParentId="18924" CreationDate="2015-12-19T00:44:32.110" Score="3" Body="&lt;p&gt;There's typically no need to manually type the name of the desired upstream branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press &lt;kbd&gt;M-n&lt;/kbd&gt; or &lt;kbd&gt;&amp;lt;down&gt;&lt;/kbd&gt; at the prompt, and Magit will offer a likely candidate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Many Emacs commands will provide useful suggestions if you go 'forwards' in the prompt's 'history' instead of backwards.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore a one-time &lt;code&gt;P -u e M-n RET&lt;/code&gt; would typically push &amp;lt;branch&gt; to origin/&amp;lt;branch&gt;, whilst setting that upstream for future usage with &lt;code&gt;P u&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2015-12-19T00:44:32.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18962" PostTypeId="2" ParentId="18779" CreationDate="2015-12-19T07:31:00.543" Score="4" Body="&lt;p&gt;I use this construction in my .emacs init-file (for djvu I prefer Okular, but you may use Evince as well):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Files association&#xA;(setq org-file-apps&#xA;    '((auto-mode . emacs)&#xA;    (&quot;\\.x?html?\\'&quot; . &quot;firefox %s&quot;)&#xA;    (&quot;\\.odp\\'&quot; . &quot;libreoffice \&quot;%s\&quot;&quot;)&#xA;    (&quot;\\.doc\\'&quot; . &quot;libreoffice \&quot;%s\&quot;&quot;)&#xA;    (&quot;\\.pdf\\'&quot; . &quot;okular \&quot;%s\&quot;&quot;)&#xA;    (&quot;\\.pdf::\\([0-9]+\\)\\'&quot; . &quot;okular \&quot;%s\&quot; -p %1&quot;)&#xA;    (&quot;\\.djvu\\'&quot; . &quot;okular \&quot;%s\&quot;&quot;)&#xA;    (&quot;\\.djvu::\\([0-9]+\\)\\'&quot; . &quot;okular \&quot;%s\&quot; -p %1&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And after that I may use links to file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:/data/file.djvu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Оr link to page of file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:/data/file.djvu::90&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10244" LastEditorUserId="2441" LastEditDate="2017-02-02T16:28:51.940" LastActivityDate="2017-02-02T16:28:51.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18963" PostTypeId="1" AcceptedAnswerId="18965" CreationDate="2015-12-19T11:47:03.030" Score="3" ViewCount="766" Body="&lt;p&gt;I'm testing out emacs today and I'm trying to sync config and packages to my dropbox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution I used with vim is what I'm planning for emacs&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a .emacs.d directory on dropbox&lt;/li&gt;&#xA;&lt;li&gt;Put an init.el file within that directory&lt;/li&gt;&#xA;&lt;li&gt;Create a link from &lt;code&gt;C:\Users\Simon\.emacs.d&lt;/code&gt; to the dropbox location&lt;/li&gt;&#xA;&lt;li&gt;Possibly push that entire thing up to github for version control&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My questions&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are there any problems with pushing the entire .emacs.d directory to github/dropbox?&lt;/li&gt;&#xA;&lt;li&gt;Does any personal information get stored in that directory?&lt;/li&gt;&#xA;&lt;li&gt;Where are packages typically stored for emacs? If its within the .emacs.d dir then that'd be ideal as I can ensure my entire config is in the cloud and available on all my machines&lt;/li&gt;&#xA;&lt;li&gt;On a new machine, after I create a symlink to the dropbox location, is there anything else I need to do within emacs to get the entire config back?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10550" LastEditorUserId="10550" LastEditDate="2015-12-19T12:08:50.800" LastActivityDate="2015-12-19T15:06:18.190" Title="Dropbox packages and config" Tags="|github|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18964" PostTypeId="1" AcceptedAnswerId="19078" CreationDate="2015-12-19T11:58:18.773" Score="0" ViewCount="161" Body="&lt;p&gt;&lt;code&gt;wgrep&lt;/code&gt; works well for every line in context search like &lt;code&gt;grep -C 2&lt;/code&gt;. It also works for grepmail, special grep-like program for mailboxes. You can edit each line of output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to force &lt;code&gt;pcregrep&lt;/code&gt; with multiline request like &lt;code&gt;^[ \t]+-.*\n +CLOCK&lt;/code&gt; to cooperate with &lt;code&gt;wgrep&lt;/code&gt; correctly (with ability to edit each line, not only the first)?&lt;/p&gt;&#xA;" OwnerUserId="2064" LastActivityDate="2016-04-24T00:30:54.133" Title="wgrep for special multiline grep (pcregrep)" Tags="|grep|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18965" PostTypeId="2" ParentId="18963" CreationDate="2015-12-19T15:06:18.190" Score="6" Body="&lt;p&gt;Here is my short answer (there is a longer answer below, and since the answer as a whole is kind of long, if I forgot to address something or you have further questions let me know, and I will try to include them):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I can't see any major problems with pushing your entire .emacs.d to dropbox or github, but I think there is a better solution which I will explain below. &lt;/li&gt;&#xA;&lt;li&gt;AFAIK there is no sensitive personal information that is stored in that directory by default, but it would depend on what you personally put in there. If you want to e.g., store password and other sensitive information that you need emacs to have access to, you can put it in a separate file which emacs loads explicitly from your init file, but which you do not track in github (&lt;a href=&quot;http://pages.sachachua.com/.emacs.d/Sacha.html#orgheadline5&quot;&gt;here is an example of that&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Packages are usually stored in a sub-directory within your .emacs.d, so you should be able to sync everything together, but again, see solution below for details.&lt;/li&gt;&#xA;&lt;li&gt;I will defer answering this question until below.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here is my more involved answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From you questions, I assume that you are interested in 1. syncing your setup, and 2. tracking changes in your setup with version control. I had these same requirements for my setup, and my final solution (though I have used a combination over the last few months) is to use github alone, which will allow you to sync (albeit not necessarily automatically) and track changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial setup was to sync &lt;em&gt;only&lt;/em&gt; my &lt;code&gt;init.el&lt;/code&gt; file through dropbox and symlink it to my &lt;code&gt;.emacs.d&lt;/code&gt;. Since I use &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; it was not necessary to sync anything else, because almost all my packages are installed from &lt;code&gt;MELPA&lt;/code&gt;, and &lt;code&gt;use-package&lt;/code&gt; will automatically download any missing packages automatically on any machine I sync the config to. This approach worked fine, but with dropbox there is always the risk of sync conflicts, and if your files are not under source control, it can be a pain to resolve the conflicts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This problem is solved by simply pushing my entire &lt;code&gt;.emacs.d&lt;/code&gt; to github. Then all I have to do is clone the repository on a new machine, push if I make changes, and pull if I made changes elsewhere. I do most of this through &lt;code&gt;magit&lt;/code&gt;. This way, if there are any conflicts, I can easily solve them through git-related tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still don't sync my packages; again, because of &lt;code&gt;use-package&lt;/code&gt; it is not necessary. I do however sync a sub-directory &lt;code&gt;~/.emacs.d/elisp&lt;/code&gt; where I put any elisp code that I got from somewhere other than &lt;code&gt;MELPA&lt;/code&gt;. &#xA;If you would like to see how &lt;a href=&quot;https://github.com/el-ethan/.emacs.d&quot;&gt;my setup&lt;/a&gt; works, you can take a look on github. Just keep in mind that I don't claim to know the best way, this is just the way that has worked best for me so far. Also, most of my actual configuration is in an org file to make it more manageable. &#xA;I am currently syncing this emacs setup between two home computers and my work computer, and have never experienced any issues with it. &#xA;Also, I see no problem using just dropbox, or a combination of dropbox and github similar to what you suggested, but I prefer my way for the reasons I explained above. You should experiment to find what is best for you, but I personally think it is import to have your emacs config under source control, so it is a good idea to have git as part of the equation, even if you don't push it to github. Dropbox and git together without github would also mean that you don't have to worry so much about personal information in your &lt;code&gt;.emacs&lt;/code&gt;, but I don't think this is a major issue in general anyway.  &lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-12-19T15:06:18.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18966" PostTypeId="2" ParentId="18937" CreationDate="2015-12-19T15:32:05.830" Score="1" Body="&lt;p&gt;You cannot change &lt;code&gt;initial-major-mode&lt;/code&gt; in a file loaded with &lt;code&gt;-l&lt;/code&gt;, because by the time it's loaded the initial buffer was already created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to set this variable in your init file.  To create different scratch buffer in different Emacs daemons, pass an environment variable while you start that daemon instance, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ export MY_EMACS_DAEMON=&quot;ocaml&quot;&#xA;$ emacs --daemon …&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your init file inspect the value of the variable and set &lt;code&gt;initial-major-mode&lt;/code&gt; accordingly, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (string= (getenv &quot;MY_EMACS_DAEMON&quot;) &quot;ocaml&quot;)&#xA;  (setq initial-buffer-choice 'tuareg-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To set this variable in a systemd unit file use the &lt;a href=&quot;http://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment=&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Environment=&lt;/code&gt;&lt;/a&gt; option, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Environment=MY_EMACS_DAEMON=tuareg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-12-19T15:32:05.830" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18967" PostTypeId="1" AcceptedAnswerId="18968" CreationDate="2015-12-19T15:58:50.110" Score="3" ViewCount="122" Body="&lt;p&gt;The docstring of the following function doesn't make Emacs happy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo-all-the-bars ()&#xA;  &quot;Foo all the bars.&#xA;Starts by fooing some bars by enabling `prettify-symbols-mode',&#xA;then manually foos any remaining bars.&quot;&#xA;  (prettify-symbols-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Checkdoc complains with the following message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Disambiguate prettify-symbols-mode by preceding w/ function,command,variable,option or symbol.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which one should I use?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="105" LastEditDate="2015-12-19T18:46:02.220" LastActivityDate="2015-12-19T18:46:02.220" Title="How do I disambiguate mentions of a minor mode in a docstring?" Tags="|doc-strings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18968" PostTypeId="2" ParentId="18967" CreationDate="2015-12-19T16:49:06.087" Score="2" Body="&lt;p&gt;If any I would use &quot;function&quot; because the proper documentation of a minor mode is in its function docstring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I tend to ignore this particular checkdoc warning.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-12-19T16:49:06.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18969" PostTypeId="2" ParentId="18967" CreationDate="2015-12-19T16:53:53.187" Score="1" Body="&lt;p&gt;One way to disambiguate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo-all-the-bars ()&#xA;  &quot;Foo all the bars.&#xA;Starts by fooing some bars by enabling the command `prettify-symbols-mode',&#xA;then manually foos any remaining bars.&quot;&#xA;  (prettify-symbols-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;code&gt;command&lt;/code&gt;, you can use &lt;code&gt;function&lt;/code&gt;, &lt;code&gt;variable&lt;/code&gt;, &lt;code&gt;option&lt;/code&gt;, or &lt;code&gt;symbol&lt;/code&gt; as the &lt;code&gt;checkdoc&lt;/code&gt; string suggests. In any case, this is not a lisp syntactic requirement but a grammar style suggested by &lt;code&gt;checkdoc&lt;/code&gt; for doc strings. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-12-19T16:53:53.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18970" PostTypeId="1" AcceptedAnswerId="18971" CreationDate="2015-12-19T19:52:33.897" Score="9" ViewCount="2247" Body="&lt;p&gt;When loading things like themes from custom directories, is it possible to specify a path relative to the init.el file, rather than an absolute path?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask because I want to be able to use the same config file across my OSX and Windows machines, where an absolute path like ~/.emacs.d/themes means something different on each machine (I'm not even sure how Windows handles ~)&lt;/p&gt;&#xA;" OwnerUserId="10550" LastActivityDate="2018-11-28T08:30:40.803" Title="Relative paths in init file" Tags="|init-file|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18971" PostTypeId="2" ParentId="18970" CreationDate="2015-12-20T01:34:09.883" Score="12" Body="&lt;p&gt;You can use ~/ in your init file and it will work fine on Windows. I always define a HOME environment variable and put my .emacs.d there, but there are other approaches. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html#Location-of-init-file&quot;&gt;the FAQ&lt;/a&gt; for the details of how Emacs decides what to use for home. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also build paths with the &lt;code&gt;user-emacs-directory&lt;/code&gt; variable, if you prefer: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (expand-file-name &quot;foo.el&quot; user-emacs-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which in my case would be interchangeable with just &lt;code&gt;&quot;~/.emacs.d/foo.el&quot;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2015-12-20T01:47:46.550" LastActivityDate="2015-12-20T01:47:46.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18972" PostTypeId="1" AcceptedAnswerId="18974" CreationDate="2015-12-20T03:04:26.770" Score="2" ViewCount="1129" Body="&lt;p&gt;I am a newbie here, currently I am learning some advanced features of org mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs24.4 which has a build in org mode(version 8.2.10, dir &quot;emacs.d/elpa/org-20150608&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use org-plus-contrib so I installed it from orgmode.org/elpa, but after installing, I found it also contains most files in org mode folder. &#xA;I am very confused of how to use this &quot;contrib&quot; folder? Does it means I have two org installed? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if I just copy the contrib folder from org git repo, where should I put it? and what the configure like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks all.&lt;/p&gt;&#xA;" OwnerUserId="9884" LastActivityDate="2015-12-21T21:28:09.670" Title="org vs org-plus-contrib in Emacs24.4" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18973" PostTypeId="1" AcceptedAnswerId="18977" CreationDate="2015-12-20T06:16:44.420" Score="4" ViewCount="929" Body="&lt;p&gt;Solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the help of @Drew, I figure out a solution. I am not good at elisp. The code may not be a good design but at least is working. I use this code to add 4 white space so I can copy a highlighted code and paste to web like stackoverflow and remove 4 white space afterward easily.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shift-region (distance)&#xA;  (let ((beg (save-excursion (goto-char (region-beginning))(line-beginning-position)))&#xA;        (end (save-excursion (goto-char (region-end))(line-end-position))))&#xA;    (goto-char beg)&#xA;    (set-mark end)&#xA;    (indent-rigidly beg end distance)&#xA;    (setq deactivate-mark nil)))&#xA;&#xA;(defun shift-right ()&#xA;  (interactive)&#xA;  (shift-region 4))&#xA;&#xA;(defun shift-left ()&#xA;  (interactive)&#xA;  (shift-region -4))&#xA;&#xA;(global-set-key (kbd &quot;C-&amp;lt;tab&amp;gt;&quot;) 'shift-right)&#xA;(global-set-key (kbd &quot;&amp;lt;backtab&amp;gt;&quot;) 'shift-left)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shift-region (distance)&#xA;  (let ((mark (mark)))&#xA;    (save-excursion&#xA;      (indent-rigidly (region-beginning) (region-end) distance)&#xA;      (push-mark mark t t)&#xA;      (setq deactivate-mark nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to expand the &lt;code&gt;region-beginning&lt;/code&gt; to the beginning of that line &#xA;while the &lt;code&gt;region-end&lt;/code&gt; to the end of that line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visual representation&#xA;(I use [ ] to represent the region mark)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abcde&#xA;abcde [ fghi&#xA;abcdefghi&#xA;abc ] defg&#xA;abcde&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will become&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abcde&#xA;[ abcdefghi&#xA;abcdefghi&#xA;abcdefg ]&#xA;abcde&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10417" LastEditorUserId="10417" LastEditDate="2015-12-21T06:05:40.653" LastActivityDate="2021-08-07T00:19:14.730" Title="How do I expand the region-beginning and region-end?" Tags="|region|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18974" PostTypeId="2" ParentId="18972" CreationDate="2015-12-20T07:02:47.537" Score="4" Body="&lt;p&gt;The common files you observe are identical so you can simply use &lt;code&gt;org-plus-contrib&lt;/code&gt; if you wish to use contributed packages.  The &lt;code&gt;org&lt;/code&gt; package is then unnecessary.  You can put the files anywhere you wish, but it's easiest just to retain the directory structure and make sure that the &lt;code&gt;contrib/&lt;/code&gt; folder is in your &lt;a href=&quot;http://www.emacswiki.org/emacs/LoadPath&quot; rel=&quot;nofollow noreferrer&quot;&gt;load-path&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, I highly recommend using Emacs package management so you don't need to bother with manually manipulating package files.  Once set up, &lt;code&gt;M-x list-packages&lt;/code&gt; then provides a very simple interface to find, install, update, and remove packages.  See &lt;a href=&quot;https://emacs.stackexchange.com/questions/8182/how-to-use-org-plus-contrib&quot; title=&quot;how to use org-plus-contrib?&quot;&gt;this&lt;/a&gt; question for details about configuring package management for org-mode.  You may also want to use other repositories such as MELPA (instructions &lt;a href=&quot;http://melpa.org/#/getting-started&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2015-12-21T21:28:09.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18975" PostTypeId="1" AcceptedAnswerId="18976" CreationDate="2015-12-20T11:35:11.947" Score="7" ViewCount="683" Body="&lt;p&gt;I am using &lt;code&gt;LaTeX-Mode&lt;/code&gt; and need to include some listings which contain dollar-signs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{lstlisting}[caption=Meteor Server: Bereitstellen einer entfernten Prozedur,label=lst:meteor-server-publish-rpc]&#xA;Meteor.Methods({&#xA;  addStar: function(messageId) {&#xA;    Messages.update(messageId, {&#xA;      $inc : { &quot;stars&quot; : 1 }&#xA;    });&#xA;  }&#xA;});&#xA;\end{lstlisting}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sadly, this breaks syntax highlighting as emacs treats the contents of the &lt;code&gt;listing&lt;/code&gt; block as &quot;normal&quot; LaTeX code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9L8gP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9L8gP.png&quot; alt=&quot;emacs with incorrect syntax highlighting&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to tell emacs not to ignore certain blocks? I know I could use an external file and use that, but I would prefer to keep my source together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is running &lt;code&gt;GNU Emacs 24.5.1&lt;/code&gt; and &lt;code&gt;AUCTeX 11.89&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="542" LastEditorUserId="9995" LastEditDate="2015-12-21T11:32:23.810" LastActivityDate="2015-12-21T11:32:23.810" Title="LaTeX Mode and Listings with $-signs?" Tags="|latex|auctex|syntax-highlighting|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18976" PostTypeId="2" ParentId="18975" CreationDate="2015-12-20T15:57:21.927" Score="6" Body="&lt;p&gt;Syntax highlighting would be correct if file parsing is enabled. First check whether the options suggested at the beginning of the &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html&quot; rel=&quot;nofollow&quot;&gt;AUCTeX manual&lt;/a&gt; are enabled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq TeX-auto-save t)&#xA;(setq TeX-parse-self t)&#xA;(setq-default TeX-master nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In general AUCTeX should not highlight verbatim-like environments.  How does it know these envs?  Section &lt;a href=&quot;http://www.gnu.org/software/auctex/manual/auctex/Verbatim-content.html#Verbatim-content&quot; rel=&quot;nofollow&quot;&gt;3.1.4&lt;/a&gt; of AUCTex documentation says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;3.1.4 Verbatim macros and environments&lt;br&gt;&#xA;      Usually it is not desirable to have content to be typeset verbatim&#xA;      highlighted according to LaTeX syntax.  Therefore this content will be&#xA;      fontified uniformly with the face `font-latex-verbatim-face'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;font-latex differentiates three different types of verbatim&#xA;      constructs for fontification.  Macros with special characters like | as&#xA;      delimiters, macros with braces, and environments.  Which macros and&#xA;      environments are recognized is controlled by the variables&#xA;      &lt;code&gt;LaTeX-verbatim-macros-with-delims&lt;/code&gt;,&#xA;      &lt;code&gt;LaTeX-verbatim-macros-with-braces&lt;/code&gt;, and &lt;code&gt;LaTeX-verbatim-environments&lt;/code&gt;&#xA;      respectively.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you can tell AUCTeX about a new verb-like env by adding to your&#xA;init file something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'latex '(add-to-list 'LaTeX-verbatim-environments &quot;myverb&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, verb-like envs of common latex packages (including&#xA;&lt;code&gt;lstlistings&lt;/code&gt; from the &lt;code&gt;listings&lt;/code&gt; package) can be automatically&#xA;detected and 'styles' applied.  By &lt;a href=&quot;http://www.gnu.org/software/auctex/manual/auctex/Parsing-Files.html#Parsing-Files&quot; rel=&quot;nofollow&quot;&gt;parsing&lt;/a&gt; your file, AUCTeX sees the&#xA;&lt;code&gt;\usepackage{listings}&lt;/code&gt; and so adds &lt;code&gt;lstlistings&lt;/code&gt; to its list of&#xA;verb-like envs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AUCTeX parses the file only if &lt;code&gt;TeX-parse-self&lt;/code&gt; is set.  If&#xA;&lt;code&gt;TeX-auto-save&lt;/code&gt; is set, it saves the found information in the &lt;code&gt;auto&lt;/code&gt;&#xA;local directory.  Once the file exists, it gets the information from&#xA;it and does not re-parse the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make it parse again (eg because your file changed), run &lt;code&gt;C-c C-n&lt;/code&gt;&#xA;(&lt;code&gt;TeX-normal-mode&lt;/code&gt;) (I found that I sometimes need to run it twice).&#xA;Actually, you can dispend setting any variable and just type &lt;code&gt;C-c C-n&lt;/code&gt;&#xA;when you want your file to be parsed and styles applied.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="542" LastEditDate="2015-12-21T10:55:39.353" LastActivityDate="2015-12-21T10:55:39.353" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18977" PostTypeId="2" ParentId="18973" CreationDate="2015-12-20T16:03:02.913" Score="2" Body="&lt;p&gt;Instead of the position &lt;code&gt;(region-beginning)&lt;/code&gt; use the position of the beginning of the same line:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion (goto-char (region-beginning)) (line-beginning-position))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun shift-region (distance)&#xA;  (let ((mark  (mark))&#xA;        (beg   (save-excursion (goto-char (region-beginning))&#xA;                               (line-beginning-position)))&#xA;        (end   (region-end)))&#xA;    (indent-rigidly beg end distance)&#xA;    (push-mark mark t t)&#xA;    (setq deactivate-mark  nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="19475" LastEditDate="2021-08-07T00:19:14.730" LastActivityDate="2021-08-07T00:19:14.730" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18978" PostTypeId="1" AcceptedAnswerId="24145" CreationDate="2015-12-20T20:58:21.627" Score="4" ViewCount="794" Body="&lt;p&gt;I've just installed &lt;a href=&quot;https://github.com/milkypostman/powerline&quot; rel=&quot;nofollow&quot;&gt;powerline&lt;/a&gt; to update my emacs looks for the 21. century.&#xA;I like it, but I'm bothered that the modified-buffer indicator is just a simple, barely discernible asterisk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make the fact that the buffer is modified to be more eye-catching?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My config up to now is very simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package powerline&#xA;  :config&#xA;  (setq powerline-display-buffer-size nil)&#xA;  (setq powerline-display-mule-info nil)&#xA;  (setq powerline-display-hud nil)&#xA;  (which-function-mode)&#xA;  (when (display-graphic-p)&#xA;    (powerline-default-theme)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to change certain faces without creating custom poweline themes (I also don't like the color of the (which-function-mode) output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="5237" LastEditorUserId="5237" LastEditDate="2015-12-21T08:18:51.800" LastActivityDate="2017-06-19T02:14:34.773" Title="Powerline: how to show whether buffer is modified more prominently" Tags="|powerline|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18980" PostTypeId="1" CreationDate="2015-12-20T22:17:21.137" Score="1" ViewCount="182" Body="&lt;p&gt;I have a problem with my Auctex + Emacs in LateX Preview functions.&#xA;They are located in my USB together TexLive packages, Sumatra pdf-reader &amp;amp; all Ghostscript tools.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Where can I include Ghostscript path to allow the Latex preview functions go on in correct way?&#xA;(I mean what variable must include the Ghostscrip bin path and others binary file used in windows i.e. Ghostxps &amp;amp; Ghostpcl).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the binary &quot;rungs.exe&quot; included in TeXlive that is called by preview-gs-command variable?&#xA;(If I see the variable I find &quot;f:/Program-folders/TeXlive2015/bin/win32/rungs.exe&quot;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What can I do to remove into Emacs exec-path others files &#xA;that the installation program read from windows path variable and they are not used in usb pen drive?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10559" LastEditorUserId="105" LastEditDate="2015-12-20T23:13:26.983" LastActivityDate="2015-12-20T23:13:26.983" Title="Auctex &amp; Ghostscript config" Tags="|auctex|preview-latex|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18981" PostTypeId="2" ParentId="12998" CreationDate="2015-12-21T01:05:01.287" Score="2" Body="&lt;p&gt;Yes, you can use the &lt;code&gt;do-applescript&lt;/code&gt; command with some AppleScript to hide all other applications:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mac-hide-others ()&#xA;  &quot;On a Mac, hide all applications other than Emacs.&quot;&#xA;  (interactive)&#xA;  (do-applescript (concat &quot;tell application \&quot;System Events\&quot; to &quot;&#xA;                          &quot;set visible of every process whose visible is true &quot;&#xA;                          &quot;and name is not \&quot;Emacs\&quot; to &quot;&#xA;                          &quot;false&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want the frontmost application to be hidden (in case you are calling the command from a terminal emulator, for example, and you do not want the terminal to be hidden after executing the command), then use this slight modification:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mac-hide-others ()&#xA;  &quot;On a Mac, hide all applications other than Emacs and the frontmost&#xA;application.&quot;&#xA;  (interactive)&#xA;  (do-applescript (concat &quot;tell application \&quot;System Events\&quot; to &quot;&#xA;                          &quot;set visible of every process whose visible is true &quot;&#xA;                          &quot;and name is not \&quot;Emacs\&quot; &quot;&#xA;                          &quot;and frontmost is false to &quot;&#xA;                          &quot;false&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To call either of these functions with &quot;M-s-h&quot;, use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-s-h&quot;) 'mac-hide-others)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10561" LastActivityDate="2015-12-21T01:05:01.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18982" PostTypeId="1" AcceptedAnswerId="18993" CreationDate="2015-12-21T06:31:47.823" Score="10" ViewCount="16735" Body="&lt;p&gt;I'm running GNU Emacs 24.4.1 on a clean install of Debian 8.1.  I've installed auto-complete using the package manager.  It is installed and if I type &lt;code&gt;M-x auto-complete-mode&lt;/code&gt; I get a working auto-complete.  I would like to have it enabled by default.  I added the following to my .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete)&#xA;(global-auto-complete-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, that resulted in the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/greg/.emacs':&#xA;&#xA;File error: Cannot open load file, no such file or directory, auto-complete&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, I tried adding to the load path with a bunch of different attempts like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path' (&quot;~/.emacs.d/elpa/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OR&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path (file-name-as-directory&#xA;                     (expand-file-name &quot;~/.emacs.d/elpa/auto-complete-20151211.227/auto-complete&quot;))&#xA;                     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But nothing seems to do the trick.  If I use &lt;code&gt;C-h v load-path&lt;/code&gt; when I run emacs with &lt;code&gt;--debug-init&lt;/code&gt;, I can see what I've added to the load path, but even when it looks correctly I still get the same can't load file error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read other similar questions but these are all the things their answers said to try and I still can't get it to work.  How do I get auto-complete to load automatically?&lt;/p&gt;&#xA;" OwnerUserId="10562" LastEditorUserId="25" LastEditDate="2015-12-22T14:17:16.133" LastActivityDate="2016-10-19T01:33:30.393" Title="How do I make auto-complete enabled by default" Tags="|init-file|auto-complete-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18987" PostTypeId="1" AcceptedAnswerId="18998" CreationDate="2015-12-21T12:57:01.330" Score="8" ViewCount="194" Body="&lt;p&gt;Or is there an alternative tool (perhaps some option to &lt;code&gt;isearch&lt;/code&gt;?) that would show just the matches in a separate buffer linked to the original buffer?&lt;/p&gt;&#xA;&lt;h1&gt;Use-case&lt;/h1&gt;&#xA;&lt;p&gt;I have a log file with very long lines. When the matching line appears in &lt;code&gt;*occur*&lt;/code&gt; buffer, it is still too cluttered to be useful (due to wrapping and a lot of extra info).&lt;/p&gt;&#xA;&lt;p&gt;It isn't difficult to write something like this, but it seems so basic that it must've been done before.&lt;/p&gt;&#xA;&lt;p&gt;If my explanation wasn't good enough, think about &lt;code&gt;grep -Po search-string&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2015-12-21T23:19:22.507" Title="Can occur display just the matched part?" Tags="|isearch|occur|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18988" PostTypeId="1" AcceptedAnswerId="19015" CreationDate="2015-12-21T15:32:22.847" Score="21" ViewCount="5367" Body="&lt;p&gt;I would like to see all the lines from the current buffer, that contain some phrase, or match regex.&#xA;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dam madam&#xA;madam&#xA;&#xA;this is da&#xA;m a&#xA;dam 1&#xA;dam 2&#xA;dam pi&#xA;dam 321:)&#xA;is dam 2?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looking for &lt;code&gt;dam&lt;/code&gt;. Result:&#xA;&lt;code&gt;&#xA;dam madam&#xA;dam 1&#xA;dam 2&#xA;dam pi&#xA;dam 321:)&#xA;is dam 2?&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same buffer. Looking for regexp: &lt;code&gt;^dam\s\d&lt;/code&gt;. Result:&#xA;&lt;code&gt;&#xA;dam 1&#xA;dam 2&#xA;dam 321:)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="105" LastEditDate="2015-12-22T02:13:01.180" LastActivityDate="2015-12-22T17:27:59.520" Title="Only show lines containing phrase/regex" Tags="|regular-expressions|search|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18989" PostTypeId="2" ParentId="18870" CreationDate="2015-12-21T15:40:45.843" Score="1" Body="&lt;p&gt;it needs to add each include path to flycheck-gcc-include-path (in my case glib cflags taken from pkg-config)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;otherwise flycheck says nothing (no error)&lt;/p&gt;&#xA;" OwnerUserId="10500" LastActivityDate="2015-12-21T15:40:45.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18990" PostTypeId="1" CreationDate="2015-12-21T17:15:33.500" Score="4" ViewCount="50" Body="&lt;p&gt;If you execute the following in bash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo hello | sed 's/hello/world/g'&#xA;world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;sed quits immediately, as desired. If you do the same in eshell, sed will still print 'world' but it will keep running, reading from STDIN. Is there a workaround for this? I assume this happens because eshell isn't using normal pipes or something.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-12-21T17:15:33.500" Title="How do I prevent sed from endlessly reading stdin when run in eshell?" Tags="|eshell|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18991" PostTypeId="1" AcceptedAnswerId="19028" CreationDate="2015-12-21T17:20:21.163" Score="2" ViewCount="415" Body="&lt;p&gt;When I use tuareg I like to have the toplevel in a separate frame, but as soon as I evaluate some code in the original frame the toplevel window reopen in that frame and that's not what I wan't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, I'd like to always popup new windows into frames as I'm using emacs daemon and a tiling window manager, I would like to replace all the window part of emacs by the frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a function to pop a window into a frame but I'd like to change the default behaviour. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/7116/pop-a-window-into-a-frame&quot;&gt;&amp;quot;Pop&amp;quot; a window into a frame&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How tuareg works :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can open ocaml interpreter with &lt;code&gt;C-c C-s&lt;/code&gt;, if the interpreter isn't running it runs it in a new buffer called *ocaml toplevel* in a new window splitted horizontally. If it's already opened but the window at the bottom isn't, it open the window with the already opened *ocaml toplevel* in it.&#xA;It is binded to the function :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tuareg-run-ocaml ()&#xA;  &quot;Run an OCaml toplevel process.  I/O via buffer `*ocaml-toplevel*'.&quot;&#xA;  (interactive)&#xA;  (tuareg-run-process-if-needed)&#xA;  (display-buffer tuareg-interactive-buffer-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess that it's &lt;code&gt;display-buffer&lt;/code&gt; whih I wan't to hack...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also evaluate region and evaluate buffer that evaluate some code in the tuareg buffer by the opened interpreter, and if it's not opened it opens it in a new window at the bottom like previously. In fact, it is quite similar to elisp evaluation but the result is in the *\ocaml toplevel* buffer and the window is always reopened when needed to show the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't show these functions because they call other tuareg functions so there would be a lot of functions in the post and I don't want to bother you with all that code. Jus tell me if you want more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-12-23T09:04:45.567" Title="Always pop window into frames" Tags="|window|frames|window-splitting|popup|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="18992" PostTypeId="1" AcceptedAnswerId="19107" CreationDate="2015-12-21T19:21:06.280" Score="9" ViewCount="252" Body="&lt;p&gt;If I startup emacs 24.5.2 with &lt;code&gt;emacs -Q&lt;/code&gt; and do &lt;code&gt;M-x eshell&lt;/code&gt;, then run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which rm&#xA;eshell/rm is a compiled Lisp function in `em-unix.el'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the eshell version. But if I &lt;code&gt;C-h v eshell-prefer-lisp-functions&lt;/code&gt; I see the value is nil. Yet &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/eshell/Built_002dins.html&quot;&gt;the documentation&lt;/a&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you would prefer to use the built-in commands instead of the external commands, set eshell-prefer-lisp-functions to t.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is this a bug? I thought the docs might be backwards so I tried setting the variable to &lt;code&gt;t&lt;/code&gt;, but the behavior stays the same, I continue getting the eshell implementation rather than the version in /bin.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2016-07-19T21:20:12.590" Title="Why does eshell prefer lisp functions even when eshell-prefer-lisp-functions is nil?" Tags="|eshell|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18993" PostTypeId="2" ParentId="18982" CreationDate="2015-12-21T19:32:28.683" Score="11" Body="&lt;p&gt;I tried to create a minimal config that would have a working &lt;code&gt;auto-complete&lt;/code&gt; and this is what I came up with. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;&#xA;(package-initialize)  ;load and activate packages, including auto-complete&#xA;&#xA;(ac-config-default)&#xA;&#xA;(global-auto-complete-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try that out and see if it works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'ac-modes 'name-of-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;auto-complete&lt;/code&gt; doesn't work by default with a given mode. E.g., &lt;code&gt;(add-to-list 'ac-modes 'sql-mode)&lt;/code&gt;. Also, see &lt;a href=&quot;http://auto-complete.org/doc/manual.html&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt; for more details on configuration, etc.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-21T20:34:15.347" LastActivityDate="2015-12-21T20:34:15.347" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18994" PostTypeId="1" CreationDate="2015-12-21T20:07:20.273" Score="0" ViewCount="602" Body="&lt;p&gt;I'd like terminal Emacs to observe the current value of &lt;code&gt;cursor-style&lt;/code&gt; when the current terminal emulator supports commands to change the cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;a href=&quot;https://code.google.com/p/mintty/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;MinTTY&lt;/code&gt;&lt;/a&gt; is the default terminal emulator for Cygwin. According to &lt;a href=&quot;https://code.google.com/p/mintty/wiki/Tips#Mode-dependent_cursor_in_vim&quot; rel=&quot;nofollow noreferrer&quot;&gt;this page&lt;/a&gt;, it supports changing cursor styles using the following escape sequences:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;\e[1 q&lt;/code&gt; for a block cursor.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\e[5 q&lt;/code&gt; for a bar cursor.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other terminal emulators that support these escapes include the VTE-based emulators (&lt;code&gt;gnome-terminal&lt;/code&gt; and friends) and &lt;code&gt;xterm&lt;/code&gt; and its derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, hacks exist for &lt;a href=&quot;https://emacs.stackexchange.com/questions/14929/how-do-i-set-cursor-colours-per-evil-state-in-the-non-gui-text-terminal?lq=1&quot;&gt;&lt;code&gt;evil-mode&lt;/code&gt;&lt;/a&gt; that attempt to simulate this support. Unfortunately, these break when the terminal doesn't support said escapes. &lt;a href=&quot;https://emacs.stackexchange.com/questions/19040/send-string-to-terminal-but-hide-output/19043?noredirect=1#comment28715_19043&quot;&gt;Here's a question to see if that's fixable&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell, Emacs doesn't support changing the cursor natively. Is there any way we can support it without relying on a package like &lt;code&gt;evil&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-24T16:19:57.873" Title="Change cursor-type in MinTTY" Tags="|terminal-emacs|cursor|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18996" PostTypeId="1" AcceptedAnswerId="19016" CreationDate="2015-12-21T21:33:52.143" Score="7" ViewCount="350" Body="&lt;p&gt;If I run this in bash (it's a GraphViz command to make a picture of a graph based on the input file testgraph):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ dot -Tpng testgraph.dot &amp;gt; graph.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with this testgraph.dot:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;digraph G {&#xA;    a -&amp;gt; b&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can execute it as many times as I want, and graph.png comes out right everytime. But if I execute it in eshell, the file will be corrupt if I don't move the old graph.png out of the way first. My first guess was that eshell must do appending by default rather than truncating, but if I test with echo and cat with plaintext it works as expected. If I compare one of the corrupt files against one of the regular ones, the broken ones are shorter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ls -l graph*&#xA;-rw-r--r--   1 aaaaa        xxxx          3203 2015-12-21 15:24 graph.png&#xA;-rw-r--r--   1 aaaaa        xxxx          3087 2015-12-21 15:24 graph.png.broken&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The file sizes are consistent, if I run the command fifty times without removing I will get the exact same size truncated file every time.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2015-12-22T17:58:17.247" Title="Why does eshell corrupt my files when using redirection?" Tags="|eshell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18998" PostTypeId="2" ParentId="18987" CreationDate="2015-12-21T23:19:22.507" Score="5" Body="&lt;p&gt;&lt;code&gt;occur&lt;/code&gt; can do this with prefix argument &lt;code&gt;C-u M-x occur&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="478" LastActivityDate="2015-12-21T23:19:22.507" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18999" PostTypeId="1" AcceptedAnswerId="19009" CreationDate="2015-12-22T00:28:24.053" Score="2" ViewCount="1574" Body="&lt;p&gt;Imaginee I set a deadline for Project A and the schedule date for task A1 and A2, now the project is cancelled (with CANCELLED todo keyword), which makes the scheduled date for A1 and A2 invalidated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, I didn't remove the SCHEDULED: keywords in the sequential nodes. These information is useful if the project is activated again somehow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder what's the best way to ignore these dates (deadline and schedule) in the &lt;code&gt;org-agenda&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The org buffer looks like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* CANCELLED Project A &#xA;  DEADLINE: &amp;lt;2015-12-22 Tue&amp;gt;&#xA;** A1 &#xA;   SCHEDULED: &amp;lt;2015-12-25 Fri&amp;gt;&#xA;** A2 &#xA;   SCHEDULED: &amp;lt;2016-01-03 Sun&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the &lt;code&gt;org-agenda&lt;/code&gt; buffer I have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3ooOi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3ooOi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="2274" LastEditDate="2015-12-22T14:51:40.007" LastActivityDate="2016-02-05T06:41:39.343" Title="Ignore scheduled date in agenda if item is &quot;CANCELLED&quot;?" Tags="|org-mode|org-agenda|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19000" PostTypeId="2" ParentId="18999" CreationDate="2015-12-22T00:41:00.310" Score="1" Body="&lt;p&gt;You can set the variables &lt;code&gt;org-agenda-skip-scheduled-if-done&lt;/code&gt; and &lt;code&gt;org-agenda-skip-deadline-if-done&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; if you want your &quot;done&quot; &lt;a href=&quot;http://orgmode.org/manual/TODO-Items.html&quot; rel=&quot;nofollow&quot;&gt;TODO items&lt;/a&gt; to get skipped in the agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a link to the &lt;code&gt;org&lt;/code&gt; manual node on &lt;a href=&quot;http://orgmode.org/manual/Deadlines-and-scheduling.html&quot; rel=&quot;nofollow&quot;&gt;deadlines and scheduling&lt;/a&gt; for more information..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for example:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-skip-scheduled-if-done t&#xA;      org-agenda-skip-deadline-if-done  t&#xA;      org-todo-keywords '((sequence &quot;TODO&quot; &quot;|&quot; &quot;DONE&quot; &quot;CANCELLED&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-12-22T00:41:00.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19001" PostTypeId="2" ParentId="18988" CreationDate="2015-12-22T02:12:30.930" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; multi-command &lt;code&gt;icicle-occur&lt;/code&gt; (bound to &lt;code&gt;C-'&lt;/code&gt; in Icicle mode) does this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you type into the minibuffer, the lines matching the pattern you type are shown as completion candidates.  Your pattern can be as simple or as complex (e.g. a regexp) as you like.  You can change the pattern dynamically, and the set of matches changes accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can combine search patterns, that is, you can use any number of them to narrow the set of search hits.  It is typically much easier to use two or more simple search patterns than it is to try to come up with a complex regexp that does exactly what you want. (But each of the individual search patterns can be as complex as you like.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can cycle among matches, or you can visit any of them, in any order. You can even replace matches selectively, on demand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow&quot;&gt;Overview of Icicles Search&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-22T02:12:30.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19002" PostTypeId="1" AcceptedAnswerId="19079" CreationDate="2015-12-22T07:27:24.717" Score="6" ViewCount="465" Body="&lt;p&gt;For example, I have the following code snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$query = 'SELECT  SUM(T01.foobar)&#xA;          FROM   db_foo.bar T01&#xA;            WHERE   T01.fooID = 1&#xA;           AND    T01.barID = 2&#xA;           AND  T01.foo IS NOT NULL'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to align it as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$query = 'SELECT   SUM(T01.foobar)&#xA;            FROM   db_foo.bar T01&#xA;           WHERE   T01.fooID = 1&#xA;             AND   T01.barID = 2&#xA;             AND   T01.foo IS NOT NULL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a very common operation, that I would like to devise a function or align&#xA;regelar expression for it. I spent too much time to align it every time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;M-x align-regexp RET&lt;/code&gt; didn't help me out here. When I make a rectular&#xA;selection block around the SQL query, and align it on tabs, it doesn't align.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone have better suggestion to let Emacs align this as I mean?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-12-27T19:48:23.897" Title="How align tabs inside block of string?" Tags="|align|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19003" PostTypeId="1" AcceptedAnswerId="19036" CreationDate="2015-12-22T08:45:37.917" Score="2" ViewCount="240" Body="&lt;p&gt;I noticed something that might be a feature, but I find it rather annoying. Say I have a piece of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function = (x, y) -&amp;gt;&#xA;  z()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I wish to add a new function call one indentation level deeper than the &lt;code&gt;z()&lt;/code&gt;. To illustrate it I will use indenting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function = (x, y) -&amp;gt;&#xA;  z()&#xA;foo()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is with no indentation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function = (x, y) -&amp;gt;&#xA;  z()&#xA;-&amp;gt;foo()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pressing tab once, places two spaces in front of &lt;code&gt;foo()&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function = (x, y) -&amp;gt;&#xA;  z()&#xA;foo()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pressing tab again does not do the expected behavior of adding two additional spaces. Instead, it de-indents back to the beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to override this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT:&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my relevant configuration stuff&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;   '(coffee-tab-width 2)&#xA;   '(coffee-indent-like-python t)&#xA;)&#xA;&#xA;&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 2)&#xA;(setq tab-always-indent t)&#xA;(electric-indent-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10194" LastEditorUserId="7045" LastEditDate="2015-12-23T16:56:02.477" LastActivityDate="2015-12-23T16:56:02.477" Title="Stop 2nd TAB from undoing indenting" Tags="|indentation|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19005" PostTypeId="1" AcceptedAnswerId="19011" CreationDate="2015-12-22T08:48:49.320" Score="5" ViewCount="447" Body="&lt;p&gt;I had a simple config to set &lt;code&gt;fci-rule-column&lt;/code&gt; to different values depend on file types:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(use-package fill-column-indicator&#xA;  :ensure t&#xA;  :config&#xA;  (setq fci-rule-color &quot;LightSlateBlue&quot;)&#xA;  (setq fci-handle-truncate-lines t)&#xA;  (add-hook 'python-mode-hook (lambda ()&#xA;                                (setq-default fci-rule-column 79)&#xA;                                (fci-mode t)))&#xA;  (add-hook 'c-mode-hook (lambda ()&#xA;                           (setq-default fci-rule-column 80)&#xA;                           (fci-mode t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see every time I add new file type, I have to repeat the work &lt;code&gt;(add-hook ...)&lt;/code&gt;. So I decide to refactor the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(use-package fill-column-indicator&#xA;  :ensure t&#xA;  :config&#xA;  (setq fci-rule-color &quot;LightSlateBlue&quot;)&#xA;  (setq fci-handle-truncate-lines t)&#xA;  (defun my/fci-config (mode num)&#xA;    (add-hook mode (lambda ()&#xA;                     (progn&#xA;                       (setq-default fci-rule-column num)&#xA;                       (fci-mode t)))))&#xA;  (let (mode-config-hash)&#xA;    (setq mode-config-hash (make-hash-table :test 'equal))&#xA;    (puthash 'python-mode-hook 79 mode-config-hash)&#xA;    (puthash 'c-mode-hook 80 mode-config-hash)&#xA;    (puthash 'cperl-mode-hook 80 mode-config-hash)&#xA;    (maphash (lambda (k v) (my/fci-config k v)) mode-config-hash)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this approach, I only to put the mode and the number to hash table &lt;code&gt;mode-config-hash&lt;/code&gt; when I configure setting for new file type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the code above did not work. I opened a Python or C file and the &lt;code&gt;fci-mode&lt;/code&gt; was not enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try some debugging and realized that the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default fci-rule-column num)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;did not ran correctly. If I change it to an integer value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default fci-rule-column 79)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then it worked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why did emacs &lt;em&gt;see&lt;/em&gt; my variable? Is there a better way to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="8701" LastEditorUserId="105" LastEditDate="2016-03-14T17:25:33.587" LastActivityDate="2016-03-14T17:25:33.587" Title="Why emacs can not see outer variable in lambda function?" Tags="|variables|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19006" PostTypeId="1" AcceptedAnswerId="19084" CreationDate="2015-12-22T09:44:31.837" Score="3" ViewCount="431" Body="&lt;p&gt;I'm trying to devise a function which returns the class name. I would like to call that function inside a Yasnippet snippet for PHP-mode, so the class name will be inserted inside the template snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading Emacs documentation, I found &lt;code&gt;which-function-mode&lt;/code&gt;, which it returns a function name. But nothing about class names, unfortunately. Do anyone know a alternative way to get the class name of the position/current buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I found an regex in the imenu source code that matches the name of the classes in PHP. But now I'm wondering how he could returns the result for yasnippet:   &lt;code&gt;(&quot;^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?class\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)&quot; 1)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-12-22T12:24:28.280" LastActivityDate="2015-12-26T23:44:10.460" Title="How to get the class name?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19009" PostTypeId="2" ParentId="18999" CreationDate="2015-12-22T15:04:46.657" Score="6" Body="&lt;p&gt;Children don't inherit the &quot;done&quot; state of their parents.  They do inherit &lt;em&gt;tags&lt;/em&gt;, so you can set a special tag on the parent and tell the agenda to ignore anything with that tag.  In fact, org-mode provides such a tag out of the box: &lt;code&gt;ARCHIVE&lt;/code&gt;.  You can (un)set it with &lt;code&gt;org-toggle-archive-tag&lt;/code&gt; (&lt;code&gt;C-c C-x a&lt;/code&gt;); see the &lt;a href=&quot;http://orgmode.org/manual/Internal-archiving.html#Internal-archiving&quot; rel=&quot;noreferrer&quot;&gt;internal archiving&lt;/a&gt; section of the manual.  Reviving the project is as simple as removing the archive tag (using &lt;code&gt;C-c C-x a&lt;/code&gt; a second time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want all &lt;code&gt;CANCELLED&lt;/code&gt; projects to automatically be archived, you can have the tag automatically applied when the todo state changes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-state-tags-triggers&#xA;  '((&quot;CANCELLED&quot; (&quot;ARCHIVE&quot; . t)))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-12-22T15:04:46.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19010" PostTypeId="1" AcceptedAnswerId="19017" CreationDate="2015-12-22T15:05:42.860" Score="4" ViewCount="1224" Body="&lt;p&gt;I use emacsclient to open files from my webrowser (pdfs, text files etc). When I'm done with the file, I know I need to close it with &lt;code&gt;C-x #&lt;/code&gt; (server-edit); if I use &lt;code&gt;C-x k&lt;/code&gt; (kill-buffer) I get a warning that the buffer still has a client. This happens frequently, and I'm tempted to advise kill-buffer to check for, and close, clients for the current buffer when called. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems obvious enough that there's probably a reason it's not the default - am I overlooking a problem this will create? What bad things could happen if I automatically close clients when killing a buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(motivated by discussion of my answer to a related question on &lt;a href=&quot;https://stackoverflow.com/questions/22615646/why-does-emacs-server-say-buffer-still-has-clients-when-its-only-open-on-one-c/22616217#22616217/&quot;&gt;stack overflow&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2018-05-22T18:35:17.750" Title="server-edit vs kill-buffer to kill an emacsclient buffer" Tags="|emacsclient|server|emacs-daemon|kill-buffer|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19011" PostTypeId="2" ParentId="19005" CreationDate="2015-12-22T15:10:41.750" Score="9" Body="&lt;p&gt;Either enable lexical binding as a file-local variable in the file's first line, as described in the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html&quot;&gt;Using Lexical Binding&lt;/a&gt;, or just use this with dynamic binding (which is the default):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(lambda ()&#xA;   (setq-default fci-rule-column ',num)&#xA;   (fci-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(The &lt;code&gt;'&lt;/code&gt; before &lt;code&gt;,num&lt;/code&gt; is not needed, except if you are unsure whether &lt;code&gt;NUM&lt;/code&gt; will be a number and you want to go ahead and assign whatever is passed as &lt;code&gt;NUM&lt;/code&gt; to variable &lt;code&gt;fci-rule-column&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;em&gt;substitutes&lt;/em&gt;, at the time &lt;code&gt;my/fci-config&lt;/code&gt; is invoked, the &lt;em&gt;value&lt;/em&gt; of &lt;code&gt;NUM&lt;/code&gt; that is passed to it, so there is no free variable in the resulting function (lambda form).  The result of this code is a &lt;em&gt;list&lt;/em&gt;.  For example, if 42 is passed to &lt;code&gt;my/fci-config&lt;/code&gt; as the value of its second arg then this is the resulting list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda ()&#xA;  (setq-default fci-rule-column '42)&#xA;  (fci-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The list will &lt;strong&gt;not&lt;/strong&gt; be byte-compiled, because it is created (and evaluated) at runtime.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;That's the downside -- not as efficient, by default.  But you can byte-compile it explicitly using function &lt;code&gt;byte-compile&lt;/code&gt;.  And this is the only downside.  Any other advantages of lexical binding (both lexical and dynamic binding have their advantages) do &lt;em&gt;not&lt;/em&gt; apply here wrt variable &lt;code&gt;NUM&lt;/code&gt;, since that variable has been eliminated.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The upside here is that the function that is the lambda form does &lt;em&gt;not at all need&lt;/em&gt; any such variable, &lt;em&gt;as a variable&lt;/em&gt;.  That is, it &lt;strong&gt;does not use the variable&lt;/strong&gt; &lt;em&gt;as such&lt;/em&gt;; it needs only its (predefined) value.  If the lambda form, or other code that it invokes, actually needed to do something with its free variable &lt;code&gt;NUM&lt;/code&gt;, as a variable (e.g., set it, for other code), then it would make sense to keep it in the lambda body as a (free) variable.  But in this case all you need is its value (which was passed to &lt;code&gt;my/fci-config&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-22T15:25:58.220" LastActivityDate="2015-12-22T15:25:58.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19012" PostTypeId="1" AcceptedAnswerId="19013" CreationDate="2015-12-22T15:48:01.610" Score="6" ViewCount="1339" Body="&lt;p&gt;From the &lt;code&gt;magit-status&lt;/code&gt; buffer, if I hit &lt;code&gt;b k&lt;/code&gt; it will bring up a list of branches with &lt;code&gt;helm-mode-magit-branch-delete&lt;/code&gt;. If I select a branch and hit &lt;code&gt;RET&lt;/code&gt;, it will delete that branch (sometimes prompting to make sure that is what I want to do if the branch is unmerged). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I am looking for is a way to delete &lt;em&gt;multiple&lt;/em&gt; branches.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation from &lt;code&gt;magit-branch-delete&lt;/code&gt; says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Delete one or multiple branches.&#xA;  If the region marks multiple branches, then offer to delete&#xA;  those, otherwise prompt for a single branch to be deleted,&#xA;  defaulting to the branch at point.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, from &lt;code&gt;helm-mode-magit-branch-delete&lt;/code&gt;, I am not sure how to select multiple branches. I have tried using &lt;code&gt;C-SPC&lt;/code&gt; (&lt;code&gt;helm-toggle-visual-mark&lt;/code&gt;), which &lt;em&gt;visually&lt;/em&gt; marks the branches I wan't, but when I hit &lt;code&gt;RET&lt;/code&gt; with multiple branches marked, it only deletes the branch at point. I can't seem to find documentation for &lt;code&gt;helm-mode-magit-branch-delete&lt;/code&gt;, and am out of ideas as to how to delete multiple branches. Any suggestions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, as suggested in the comments below, I am not sure that&lt;code&gt;helm-mode-magit-branch-delete&lt;/code&gt; is an actual command since I can't find it documented or referenced anywhere else, but it is the name of the buffer when I try to call &lt;code&gt;magit-delete-branch&lt;/code&gt; from the &lt;code&gt;magit-status-buffer&lt;/code&gt;, so this was the only way I new to reference it. From my modeline:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/toTZu.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/toTZu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-22T17:02:14.147" LastActivityDate="2015-12-23T13:11:54.650" Title="Delete multiple branches in using magit from `helm-mode-magit-branch-delete`" Tags="|helm|magit|git|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19013" PostTypeId="2" ParentId="19012" CreationDate="2015-12-22T16:53:01.617" Score="9" Body="&lt;p&gt;The doc-string you quote talks about marking multiple branches in a &lt;em&gt;Magit buffer&lt;/em&gt;, not during Helm completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can show a buffer which lists all branches and tags using &lt;kbd&gt;y&lt;/kbd&gt;. In that buffer you can mark multiple branches using the region. Then press &lt;kbd&gt;k&lt;/kbd&gt; to delete them. You'll be asked if you really want to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit does not support marking non-consecutive sections dired-style.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-23T13:11:54.650" LastActivityDate="2015-12-23T13:11:54.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19014" PostTypeId="1" CreationDate="2015-12-22T17:14:04.350" Score="2" ViewCount="459" Body="&lt;p&gt;I work with Emacs within Docker as my dev environment so that I can have clean dev environments per language or type or projects that I do e.g. PHP dev, NodeJS dev, Haskell dev etc with different software or extensions installed etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since upgrading to the latest version of Docker though (1.8, now 1.9) characters get misplaced, making a mess of the code. This happens when I open a file, or when I type something. This is only a display issue - the characters in the file are actually in the correct place. When I select the messed up lines (Ctrl+Space Ctrl+n or similar) the lines are corrected and properly displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually characters get misplaced within the same line, but occasionally characters disappear or are overridden by other characters, or characters that do not belong to the line appear. One pattern that I have seen is that if I jump a page down with Ctrl+v, a line from the new visible part of the buffer gets messed up with the line that was previously there e.g. some of the characters of the 8th line from the bottom are overriden by the characters that where on the same line before jumping down. But there are other cases as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attached are some screenshots that may clarify what happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was not happening before the upgrade (I was using Docker 1.5 I believe, or earlier). The upgrade was part of a system upgrade to Fedora 23, but when I run emacs directly on the host I don't have this issue. The Docker container is based on the Fedora 23 official Docker image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure it is a Docker issue though. I would expect fedora to install all required dependencies when doing &quot;dnf install emacs&quot; since I believe the repositories are the standard Fedora repositories. But since the Fedora Docker image is a very minimal image, is there any package that I may need to install?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any insights are welcome, my dev environments are kind of unusable at the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Messed up code&#xA;&lt;a href=&quot;https://i.stack.imgur.com/KboYc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KboYc.png&quot; alt=&quot;Messed up code&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Corrected by selection&#xA;&lt;a href=&quot;https://i.stack.imgur.com/A6VN0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/A6VN0.png&quot; alt=&quot;Corrected by selection&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Messed up code&#xA;&lt;a href=&quot;https://i.stack.imgur.com/KQUTK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KQUTK.png&quot; alt=&quot;Messed up code&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Corrected by selection&#xA;&lt;a href=&quot;https://i.stack.imgur.com/W0HxF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/W0HxF.png&quot; alt=&quot;Corrected by selection&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Messed up code&#xA;&lt;a href=&quot;https://i.stack.imgur.com/x7mI2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/x7mI2.png&quot; alt=&quot;Messed up code&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Corrected by selection&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Dvgym.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Dvgym.png&quot; alt=&quot;Corrected by selection&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10575" LastEditorUserId="105" LastEditDate="2015-12-22T21:07:32.827" LastActivityDate="2017-12-03T19:55:47.503" Title="Issue with characters in buffers being displayed in wrong positions" Tags="|display|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19015" PostTypeId="2" ParentId="18988" CreationDate="2015-12-22T17:27:59.520" Score="31" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;...see all the lines from the current buffer...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;With built-in commands and no external packages or dependencies in&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a new buffer, use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x occur&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the same buffer, use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x keep-lines&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-12-22T17:27:59.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19016" PostTypeId="2" ParentId="18996" CreationDate="2015-12-22T17:58:17.247" Score="7" Body="&lt;p&gt;Redirection in Eshell works by writing the output of the command to a temporary buffer that's visiting the target file, then saving the buffer to the target file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, “output” includes anything the command writes to the terminal. &lt;code&gt;&amp;gt;&lt;/code&gt; in Eshell isn't the redirection of standard output (stdout) like it is in other shells, it redirects everything including standard error (stderr).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output of a command is a sequence of bytes, but the content of a buffer is a sequence of characters. Normally, this doesn't matter: once the buffer is saved, it's again a series of bytes. Problems arise when there isn't a distinct character sequence for every byte sequence. If the conversion from characters to bytes is ambiguous (i.e. there are multiple byte sequences that are read as the same character), then the output may be a different byte sequence from the original; I don't know if this actually happens. If the conversion from bytes to characters is impossible, some bytes may be lost, and that happens in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many ways to configure Emacs with respect to encodings and I'm not familiar with all of them. I'll report what I observed in Emacs 24.3 running on Linux, started with &lt;code&gt;emacs -Q&lt;/code&gt;; other versions and especially user configuration, as well as the ambient locale, may cause different behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Emacs started in a UTF-8 locale:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/tmp $ printf 'a\xe3\n' &amp;gt;a; hd a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs prompts me to select a coding system because &lt;code&gt;\343&lt;/code&gt; (&lt;code&gt;\xe3&lt;/code&gt;) is not a valid byte sequence in UTF-8. It defaults to &lt;code&gt;raw-text&lt;/code&gt;. I allow the default, and the file has the desired content.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;00000000  61 e3 0a                                          |a..|&#xA;00000003&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when the invalid byte is the last one in the file, it seems to be silently dropped.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/tmp $ printf 'a\xe3' &amp;gt;a; hd a&#xA;00000000  61                                                |a|&#xA;00000001&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This smacks of a bug to me. I don't know if this is specific to Eshell or if it's an underlying issue with subprocess output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start Emacs in the C locale, the behavior is different. The temporary buffer defaults to UTF-8, but the process's output is, somehow, interpreted as Latin-1. I can't explain this behavior.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/tmp $ printf 'a\xe3\n' &amp;gt;a; hd a&#xA;00000000  61 c3 a3 0a                                       |a...|&#xA;00000004&#xA;/tmp $ printf 'a\xe3' &amp;gt;a; hd a&#xA;00000000  61 c3 a3                                          |a..|&#xA;00000003&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output from &lt;code&gt;dot&lt;/code&gt; may depend on its version. With mine, if I execute &lt;code&gt;dot&lt;/code&gt; outside of Eshell, or if I run &lt;code&gt;dot -Tpng testgraph.dot -o graph.png&lt;/code&gt;, I get a 3204-byte file that ends in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;00000c80  ae 42 60 82                                       |.B`.|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I run &lt;code&gt;dot -Tpng testgraph.dot &amp;gt;graph.png&lt;/code&gt;, the last byte is missing. As in my example above, the file ends with a partial UTF-8 byte sequence, which gets dropped by Eshell redirection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't been able to reproduce the 3087-byte file when running the command again, but I can imagine this happening if your Emacs configuration causes it to make some automatic encoding decision when &lt;em&gt;saving&lt;/em&gt; the file the first time round, which then influences the way the subprocess output is &lt;em&gt;read&lt;/em&gt; the second time round. With &lt;code&gt;emacs-24.3 -Q&lt;/code&gt;, Emacs detects that the output is an image (because of the PNG magic header) and tells me in the Eshell buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/tmp $ dot -Tpng testgraph.dot &amp;gt;graph.png&#xA;/tmp $ dot -Tpng testgraph.dot &amp;gt;graph.png&#xA;Text is read-only&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because the file is still open in Image mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, &lt;strong&gt;output redirection in Eshell is not reliable for binary data&lt;/strong&gt; or text that isn't encoded in your default encoding (for some value of “default encoding”), as of Emacs 24.3 (I also tested with 24.5, no improvement). This is a limitation in Eshell, arguably a bug.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2015-12-22T17:58:17.247" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19017" PostTypeId="2" ParentId="19010" CreationDate="2015-12-22T19:17:17.570" Score="4" Body="&lt;p&gt;For me, using emacsclient with the '-n' switch prevents me from getting the &quot;no client connection&quot; warning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Invoking &lt;code&gt;emacsclient file&lt;/code&gt; from the command line will open &lt;code&gt;file&lt;/code&gt; in the current Emacs session.  The command line from which you ran emacsclient will be waiting for the file to be closed by the server, and then terminate.  You won't be able to execute additional commands until it does so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would like to be able to continue executing commands after opening &lt;code&gt;file&lt;/code&gt;, then use &lt;code&gt;emacsclient -n file&lt;/code&gt; which tells emacsclient, &quot;don't wait&quot; after opening &lt;code&gt;file&lt;/code&gt;, and continue processing.  Emacsclient has nothing else to do, and so terminates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, if you already have a running Emacs session, but would like to open &lt;code&gt;file&lt;/code&gt; in a new frame (or Window in most GUI lingo) use the -c switch: &lt;code&gt;emacsclient -c file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mutually exclusive with -c is the -t switch:  open a new session, but do so in the current terminal rather than a new frame (Window).  Note, if you are in a non-GUI terminal, then -c and -t are equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that -n may be used with -t as well as -c.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because my Emacs usage is only a single session, I don't benefit from the differentiation of &quot;C-x/C-k&quot; and &quot;C-x/#&quot;.  If I had multiple Emacs sessions then this would be a relevant warning and my workflow with emacsclient would probably change.&lt;/p&gt;&#xA;" OwnerUserId="5297" LastEditorUserId="5511" LastEditDate="2018-05-22T18:35:17.750" LastActivityDate="2018-05-22T18:35:17.750" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19018" PostTypeId="1" CreationDate="2015-12-22T19:56:03.897" Score="10" ViewCount="3679" Body="&lt;p&gt;&lt;strong&gt;What boolean/logical convenience functions / macros are available for Emacs Lisp in either the core set of functions or external packages?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'm interested in just about anything other than the built-in logical operators in &lt;code&gt;and&lt;/code&gt;, &lt;code&gt;or&lt;/code&gt;, &lt;code&gt;not&lt;/code&gt; (&lt;code&gt;null&lt;/code&gt;) and conditional forms (&lt;code&gt;if&lt;/code&gt;, &lt;code&gt;when&lt;/code&gt;, &lt;code&gt;unless&lt;/code&gt;, &lt;code&gt;cond&lt;/code&gt;).  To illustrate the sort of convenience functions I have in mind:&lt;/p&gt;&#xA;&lt;p&gt;Common Lisp has sequence predicates such as &lt;strong&gt;&lt;code&gt;some&lt;/code&gt; and &lt;code&gt;every&lt;/code&gt;&lt;/strong&gt; and other functions like &lt;strong&gt;&lt;code&gt;count-if&lt;/code&gt;&lt;/strong&gt; (in &lt;code&gt;cl-lib&lt;/code&gt; as &lt;code&gt;cl-some&lt;/code&gt;, &lt;code&gt;cl-every&lt;/code&gt;, and &lt;code&gt;cl-count-if&lt;/code&gt; respectively).  When used with an identity function, &lt;code&gt;(cl-some #'identity my-list)&lt;/code&gt; it performs a logical OR over elements in the list and &lt;code&gt;(cl-every #'identity my-list)&lt;/code&gt; performs a logical AND over elements in the list.  These are convenient and are nearly ideal, but aren't purely logical functions because they require a predicate that is applied to each element.  These functions are available in &lt;code&gt;cl-lib&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;and&lt;/code&gt; and &lt;code&gt;or&lt;/code&gt;&lt;/strong&gt; conceptually fill the same niche, but clearly note that their use is limited because they are implemented as macros.  Expressions such as &lt;code&gt;(apply #'and my-list)&lt;/code&gt; are not possible.&lt;/p&gt;&#xA;&lt;p&gt;I have reviewed the list of ~1089 built-in Elisp functions and macros and only know of two relevant convenience functions.  &lt;strong&gt;&lt;code&gt;booleanp&lt;/code&gt;&lt;/strong&gt; checks if the argument's value is &lt;code&gt;t&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt; and &lt;strong&gt;&lt;code&gt;not&lt;/code&gt;&lt;/strong&gt; is an alias for &lt;code&gt;null&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There are also numerous &lt;strong&gt;boolean vector convenience functions&lt;/strong&gt; that are a part of Elisp, but as far as I can tell are only suitable for binary manipulation.&lt;/p&gt;&#xA;&lt;p&gt;@Dan points out the use of &lt;strong&gt;&lt;code&gt;memq&lt;/code&gt;&lt;/strong&gt; to search for nil values in a list can evaluate functions of logical values of a list using variations of &lt;code&gt;(memq nil my-list)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;An example of a potential convenience function would be a boolean identity function that simply converts a value to its canonical boolean form.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun boolean-identity (x)&#xA;  (if x t nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2020-10-13T16:35:56.593" LastActivityDate="2020-10-13T16:35:56.593" Title="What Emacs Lisp boolean/logical convenience functions exist?" Tags="|boolean|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="19019" PostTypeId="1" AcceptedAnswerId="19038" CreationDate="2015-12-22T20:15:36.520" Score="4" ViewCount="1662" Body="&lt;p&gt;I am aware that you can customise the &quot;find&quot; command executed when using &quot;find-grep&quot; with &quot;setq grep-find-command&quot; and define which file-patterns to ignore in the search. I would like to take this further and be able to read the patterns to ignore from a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each framework or tool might generate different files that I would like to be ignored in search. For example, SASS generates &quot;.sass-cache&quot; folder, the Symfony framework stores the &quot;logs&quot; and the &quot;cache&quot; in respectively named folders, while Haskell stack creates a &quot;.stack-work&quot; folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of customising the &quot;find-grep&quot; command to exclude all patterns from different frameworks/tools, I would prefer a system where you can add a &quot;.findignore&quot; file in the root folder of the project and &quot;find-grep&quot; should be picking up the exclusions from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple of questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Is there such a solution already out there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) If not, advice on how to go about the following two requirements would help me get started:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How can I detect the .findignore file upwards up to the root folder of the project (just like .gitignore).&lt;/li&gt;&#xA;&lt;li&gt;How to load each line and sequence it as an argument to &quot;find-grep&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I haven't done advanced emacs customisations so any hints would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="10575" LastEditorUserId="10575" LastEditDate="2015-12-22T20:55:47.440" LastActivityDate="2015-12-23T17:56:00.477" Title="Read find-grep exclusion patterns from a .findignore file" Tags="|grep|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19020" PostTypeId="2" ParentId="19018" CreationDate="2015-12-22T20:25:15.253" Score="12" Body="&lt;p&gt;It's not 100% clear what you're looking to do.  As a general response, Emacs Lisp treats all non-&lt;code&gt;nil&lt;/code&gt; values as true for logical testing purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, just about the only &quot;boolean&quot; predicates, in the sense that you seem to be using the term, are &lt;code&gt;null&lt;/code&gt; and &lt;code&gt;not&lt;/code&gt;, which, as the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/List_002drelated-Predicates.html&quot; rel=&quot;noreferrer&quot;&gt;manual states&lt;/a&gt;, are identical:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function returns &lt;code&gt;t&lt;/code&gt; if object is &lt;code&gt;nil&lt;/code&gt;, and returns &lt;code&gt;nil&lt;/code&gt; otherwise. This function is identical to &lt;code&gt;not&lt;/code&gt;, but as a matter of clarity we use &lt;code&gt;null&lt;/code&gt; when object is considered a list and not when it is considered a truth value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(null nil)                              ; =&amp;gt; t&#xA;(not nil)                               ; =&amp;gt; t&#xA;(null t)                                ; =&amp;gt; nil&#xA;(not t)                                 ; =&amp;gt; nil&#xA;(null '(a b c))                         ; =&amp;gt; nil&#xA;(null '())                              ; =&amp;gt; t (empty list is nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're looking to see if some or all of the elements of a list are non-&lt;code&gt;nil&lt;/code&gt;, you can use &lt;code&gt;memq&lt;/code&gt;.  Here's an example of testing that each element is non-&lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(memq nil '(a b c))                     ; =&amp;gt; nil&#xA;(null (memq nil '(a b c)))              ; =&amp;gt; t (so all elements are non-nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's an example showing that not all elements are non-&lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(memq nil '(a b nil))                   ; =&amp;gt; (nil)&#xA;(null (memq nil '(a b nil)))            ; =&amp;gt; nil (so not all elements are non-nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you can also use &lt;code&gt;or&lt;/code&gt; and &lt;code&gt;and&lt;/code&gt; to do implicit &lt;code&gt;nil&lt;/code&gt; testing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(and 1 2 3)                             ; =&amp;gt; 3&#xA;(and 1 2 nil)                           ; =&amp;gt; nil&#xA;(or 1 2 3)                              ; =&amp;gt; 1&#xA;(or nil 2 3)                            ; =&amp;gt; 2&#xA;(or nil nil nil)                        ; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2015-12-22T20:40:38.983" LastActivityDate="2015-12-22T20:40:38.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19021" PostTypeId="2" ParentId="19019" CreationDate="2015-12-22T21:24:05.480" Score="1" Body="&lt;p&gt;For the &lt;code&gt;lgrep&lt;/code&gt; command, you could set &lt;code&gt;grep-find-ignored-files&lt;/code&gt; as a &lt;a href=&quot;http://www.emacswiki.org/emacs/DirectoryVariables&quot; rel=&quot;nofollow&quot;&gt;Directory Local variable&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;code&gt;rgrep&lt;/code&gt; you could additionally (or alternatively) set &lt;code&gt;grep-find-ignored-directories&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These tend to be much simpler than using &lt;code&gt;find-grep&lt;/code&gt; (which calls &lt;code&gt;grep-compute-defaults&lt;/code&gt; to determine the command, which is rather more complex to work with).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-12-23T01:06:24.200" LastActivityDate="2015-12-23T01:06:24.200" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19022" PostTypeId="1" AcceptedAnswerId="19041" CreationDate="2015-12-22T22:53:04.867" Score="3" ViewCount="3725" Body="&lt;p&gt;I have been looking around for some fix for this but I cannot google-fu my way out of it. I have tried setting the fringe, but that doesn't seem to work. Right now I have the code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (bound-and-true-p linum-mode)&#xA;  (setq left-fringe-width 10))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To give my text some space to the left of the edge of the buffer when &lt;code&gt;linum-mode&lt;/code&gt; isn't enabled. This is because with &lt;code&gt;neo-tree&lt;/code&gt; active its hard to see the edge of the text sometimes, and the text is pressed right up against the edge of the window. However, this doesn't seem to work. Is there a better method to do this? I am using console Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10229" LastEditorUserId="306" LastEditDate="2015-12-23T00:46:04.153" LastActivityDate="2023-10-09T12:08:12.903" Title="Adding padding to the left of text in buffer" Tags="|linum-mode|fringe|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19023" PostTypeId="1" AcceptedAnswerId="19031" CreationDate="2015-12-23T00:22:18.297" Score="1" ViewCount="389" Body="&lt;p&gt;Is it there a easy way to fill the same data in the rectangle area from cell &lt;code&gt;a&lt;/code&gt; to cell &lt;code&gt;b&lt;/code&gt; (4x4 cells) in the org-mode table as shown below in one go?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |   |   |   |   |   |   |   |&#xA;|---+---+---+---+---+---+---+---|&#xA;|   |   |   |   |   |   |   |   |&#xA;|   |   | a |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   | b |   |   |&#xA;|   |   |   |   |   |   |   |   |&#xA;|   |   |   |   |   |   |   |   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-12-24T21:42:16.837" Title="How to fill same data to selected rectangle cells in org-mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19024" PostTypeId="1" AcceptedAnswerId="19032" CreationDate="2015-12-23T00:30:24.700" Score="2" ViewCount="912" Body="&lt;p&gt;This question is pretty self explanatory. I'd like to move &lt;code&gt;evil-mode-line-tag&lt;/code&gt; to the beginning of &lt;code&gt;mode-line-format&lt;/code&gt;. However, when I try my instinctive solution:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default mode-line-format (cons &#xA;                                 'evil-mode-line-tag &#xA;                                 (delete 'evil-mode-line-tag &#xA;                                          mode-line-format)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My changes seem to be reverted instantly. Why is this, and how can I achieve the effect I'm looking for?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2015-12-23T05:44:56.690" LastActivityDate="2015-12-23T08:55:27.823" Title="Move evil tag to beginning of mode line" Tags="|evil|mode-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19025" PostTypeId="2" ParentId="19018" CreationDate="2015-12-23T00:54:26.270" Score="7" Body="&lt;p&gt;Based on the example code you provided, I am guessing you are looking for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(-non-nil my-list-of-boolean-values)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course &lt;code&gt;-non-nil&lt;/code&gt; is from the &lt;code&gt;dash&lt;/code&gt; library. If you don't want to use &lt;code&gt;dash&lt;/code&gt;, then you might have to go with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-mapcan (lambda (elt) (and elt (list elt)))&#xA;           my-list-of-boolean-values)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2015-12-23T00:54:26.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19026" PostTypeId="2" ParentId="2416" CreationDate="2015-12-23T00:55:19.613" Score="0" Body="&lt;p&gt;For this part of your question (I don't really follow the rest of it, so far):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Can packages like ido, helm, icicles etc. be configured to provide autocompletion in Customize widgets?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answer is yes, depending I guess on what you mean by &quot;&lt;em&gt;autocompletion&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vanilla Emacs provides completion for some Customize widgets. And you can define additional widgets that also let the user use completion to choose a value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;, for example, defines a color-choice widget that provides completion, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-widget 'icicle-color 'editable-field&#xA;  &quot;Icicles version of the `color' widget.&#xA;`M-TAB' completes the color name using Icicles WYSIWYG completion.&#xA;See `icicle-widget-color-complete'.&quot;&#xA;  :format   &quot;%{%t%}: %v (%{sample%})\n&quot;&#xA;  :size     (1+ (apply #'max (mapcar #'length (x-defined-colors))))&#xA;  :tag      &quot;Color&quot;&#xA;  :match    'widgetp-color-match&#xA;  :validate 'widgetp-color-validate&#xA;  :value    &quot;black&quot;&#xA;  :complete 'icicle-widget-color-complete&#xA;  :sample-face-get 'widget-color-sample-face-get&#xA;  :notify   'widget-color-notify&#xA;  :action   'widget-color-action)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The part that provides (Icicles-style) completion is &lt;code&gt;:complete 'icicle-widget-color-complete&lt;/code&gt;. It just specifies that completion is provided by function &lt;code&gt;icicle-widget-color-complete&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(FWIW, I don't think you can easily modify widgets on the fly. I also think you might get more help if you more clearly specify (details) the behavior you are looking for.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &quot;&lt;em&gt;autocompletion&lt;/em&gt;&quot; do you mean completion that is not initiated on-demand (e.g., from hitting &lt;code&gt;TAB&lt;/code&gt;) but automatically, either immediately or after typing one or more chars (some minimum number) or after some minimum delay? That is possible with Icicles, Ido, and Helm, AFAIK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do you mean completion that might be initiated on-demand initially but is updated thereafter automatically, each time you change the input patter (e.g. type or delete a char)?  That too is possible with Icicles, Ido, and Helm, AFAIK. (In Icicles it is called &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Icompletion#IncrementalCompletion&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;incremental completion&lt;/em&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Icicles such is controlled by user options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-incremental-completion&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-incremental-completion&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; -- Completion and completion updating when you start typing or once you have hit &lt;code&gt;TAB&lt;/code&gt;.  You can cycle  among the possible option values using &lt;code&gt;C-#&lt;/code&gt; from the minibuffer at any time.  (Behavior is further governed by options &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-incremental-completion-delay&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-incremental-completion-delay&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-incremental-completion-threshold&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;icicle-incremental-completion-threshold&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-show-Completions-initially-flag&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-show-Completions-initially-flag&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; -- Completion immediately, without typing anything.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-23T01:01:27.930" LastActivityDate="2015-12-23T01:01:27.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19027" PostTypeId="1" CreationDate="2015-12-23T01:19:06.417" Score="5" ViewCount="1024" Body="&lt;p&gt;How to set Emacs to wrap long line (using Visual Line Mode) at &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt;, &lt;code&gt;(&lt;/code&gt;, &lt;code&gt;)&lt;/code&gt; too, instead of just at spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A sample line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a long line with long words like long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-long-word, long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_word, (very)long(very)long(very)long(very)long(very)long(very)long(very)long(very)long(very)long(very)long(very)long-word.&lt;/p&gt;&#xA;" OwnerUserId="10395" LastActivityDate="2022-04-13T10:56:19.550" Title="How to wrap line at some characters other than space?" Tags="|wrapping|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19028" PostTypeId="2" ParentId="18991" CreationDate="2015-12-23T01:56:07.763" Score="1" Body="&lt;p&gt;The following example relies upon two functions from the &lt;code&gt;frame-fns.el&lt;/code&gt; library written by Drew Adams -- &lt;a href=&quot;http://www.emacswiki.org/emacs/frame-fns.el&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/frame-fns.el&lt;/a&gt; -- which has been consolidated into just one function for the purposes of this example.  The original poster has indicated that the function &lt;code&gt;tuareg-run-ocaml&lt;/code&gt; is the most likely suspect that causes behavior described by the original poster as:  &quot;&lt;strong&gt;it split the window to show tuareg toplevel&lt;/strong&gt;&quot;.  This example modifies &lt;code&gt;tuareg-run-ocaml&lt;/code&gt; by adding an optional second argument of &lt;code&gt;display-buffer&lt;/code&gt; for &lt;strong&gt;ACTION&lt;/strong&gt; -- e.g., what do we want to do with the buffer.  We use Drew Adams' function to test for whether there is an existing frame named &lt;code&gt;TUAREG&lt;/code&gt;:  If there is, then we use that.  If there is not, then we create a new frame with that name.  If the buffer is already being displayed in that frame, then use the same window -- if not, then the buffer is displayed in the largest visible window in said frame.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Original Author:  Drew Adams -- http://www.emacswiki.org/emacs/frame-fns.el&#xA;;; @lawlist combined the functions `get-frame-name` and `get-a-frame`.&#xA;(defun db-get-frame--drew-adams (frame)&#xA;  &quot;Return a frame, if any, named FRAME (a frame or a string).&#xA;  If none, return nil. If FRAME is a frame, it is returned.&quot;&#xA;  (let ((get-frame-name--drew-adams&#xA;          (lambda (&amp;amp;optional frame)&#xA;            (unless frame (setq frame (selected-frame)))&#xA;            (if (framep frame)&#xA;                (cdr (assq 'name (frame-parameters frame)))&#xA;              (error &quot;Argument not a frame: `%s'&quot; frame)))))&#xA;    (cond ((framep frame) frame)&#xA;          ((stringp frame)&#xA;           (catch 'get-a-frame-found&#xA;             (dolist (fr (frame-list))&#xA;               (when (string= frame (funcall get-frame-name--drew-adams fr))&#xA;                 (throw 'get-a-frame-found fr)))&#xA;             nil))&#xA;          (t&#xA;           (error &quot;Arg neither a string nor a frame: `%s'&quot; frame)))))&#xA;&#xA;(defun db-display-buffer-fn (buffer _alist)&#xA;  (let (frame)&#xA;    (if (db-get-frame--drew-adams &quot;TUAREG&quot;)&#xA;      (setq frame (db-get-frame--drew-adams &quot;TUAREG&quot;))&#xA;      (setq frame (make-frame (list '(name . &quot;TUAREG&quot;)))))&#xA;    (select-frame frame)&#xA;    (raise-frame frame)&#xA;    (unless (get-buffer-window buffer)&#xA;      (set-window-buffer (get-largest-window) buffer))&#xA;    (select-window (get-buffer-window buffer))))&#xA;&#xA;;; In order to redefine `tuareg-run-ocaml', need to make sure the library is loaded.&#xA;(require 'tuareg)&#xA;&#xA;(defun tuareg-run-ocaml ()&#xA;  &quot;Run an OCaml toplevel process.  I/O via buffer `*ocaml-toplevel*'.&quot;&#xA;  (interactive)&#xA;  (tuareg-run-process-if-needed)&#xA;  (display-buffer tuareg-interactive-buffer-name '(db-display-buffer-fn)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="9790" LastEditDate="2015-12-23T09:04:45.567" LastActivityDate="2015-12-23T09:04:45.567" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19029" PostTypeId="2" ParentId="19027" CreationDate="2015-12-23T05:33:34.157" Score="3" Body="&lt;p&gt;This is what you need to do (e.g., in the mode where you will be filling text):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;&lt;b&gt;(modify-category-entry ?- ?|)&lt;/b&gt;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That gives the hyphen character (&lt;code&gt;-&lt;/code&gt;) the category of &lt;code&gt;|&lt;/code&gt;, which means &lt;strong&gt;&lt;em&gt;line breakable&lt;/em&gt;&lt;/strong&gt;.  Do the same for &lt;code&gt;_&lt;/code&gt;, &lt;code&gt;(&lt;/code&gt;, and &lt;code&gt;)&lt;/code&gt;, if you want lines to be broken at each of those characters also. (But I suspect that you do not really want lines to be broken after &lt;code&gt;(&lt;/code&gt; -- just after &lt;code&gt;)&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;M-x describe-categories&lt;/code&gt; to see the available categories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I should say that I did not bother to try this with &lt;code&gt;visual-line-mode&lt;/code&gt; (I don't use or like &lt;code&gt;visual-line-mode&lt;/code&gt;), but only with ordinary text filling.  If &lt;code&gt;(modify-category-entry ?- ?|)&lt;/code&gt; is not sufficient for &lt;code&gt;visual-line-mode&lt;/code&gt; then you might need to tinker a bit more with it or perhaps look at the &lt;code&gt;visual-line-mode&lt;/code&gt; code to see how it does filling (if it is different from the usual filling).)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;How I found this out:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I looked at the code that does filling.  I started with just command &lt;code&gt;fill-paragraph&lt;/code&gt; (bound to &lt;code&gt;M-q&lt;/code&gt;), and I eventually got to function &lt;code&gt;fill-move-to-break-point&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Function &lt;code&gt;fill-move-to-break-point&lt;/code&gt; does this:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (re-search-backward &quot;[ \t]\\|\\c|.\\|.\\c|&quot; linebeg 0)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Not being familiar with &lt;code&gt;\c&lt;/code&gt;, I looked in the Elisp manual, under regexps, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html&quot; rel=&quot;nofollow&quot;&gt;Regexp Backslash&lt;/a&gt;, and saw that &quot;&lt;code&gt;\cC&lt;/code&gt; matches any character whose category is &lt;code&gt;C&lt;/code&gt;.&quot;.  I followed the link there to node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Categories.html&quot; rel=&quot;nofollow&quot;&gt;Categories&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I knew nothing about categories at this point, although I had some familiarity with character tables.  So I read about categories.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I found, from &lt;code&gt;M-x describe-categories&lt;/code&gt; and from the &lt;code&gt;fill-move-to-break-point&lt;/code&gt; code, that &lt;code&gt;|&lt;/code&gt; is the category for a character to be &lt;em&gt;line breakable&lt;/em&gt;.&#xA;So I tried modifying the category entry for the character &lt;code&gt;-&lt;/code&gt; (hyphen) to be &lt;em&gt;line-breakable&lt;/em&gt; (&lt;code&gt;|&lt;/code&gt;).  It worked.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-23T06:01:22.653" LastActivityDate="2015-12-23T06:01:22.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19030" PostTypeId="2" ParentId="598" CreationDate="2015-12-23T08:01:39.520" Score="41" Body="&lt;p&gt;&lt;code&gt;so-long.el&lt;/code&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/SoLong&quot; rel=&quot;noreferrer&quot;&gt;Emacs Wiki&lt;/a&gt;, &lt;a href=&quot;https://elpa.gnu.org/packages/so-long.html&quot; rel=&quot;noreferrer&quot;&gt;GNU ELPA&lt;/a&gt;) will help in many situations.  It is included by default in Emacs 27+ and available in GNU ELPA for older versions of Emacs (24.4 and later).&lt;/p&gt;&#xA;&lt;p&gt;This library enables you to configure some simple thresholds to check when visiting a file, beyond which a more performant mode will be used in place of the normal mode, including disabling certain buffer-local minor modes with performance implications, and tuning buffer-local variables to maximise responsiveness.  By default this will happen for programming modes only, but the behaviour is all highly configurable.&lt;/p&gt;&#xA;&lt;p&gt;Use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;global-so-long-mode&lt;/code&gt; to enable/toggle the functionality.  To enable&#xA;the functionality by default, either customize the &lt;code&gt;global-so-long-mode&lt;/code&gt; user&#xA;option, or add the following to your init file:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Avoid performance issues in files with very long lines.&#xA;(global-so-long-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The comprehensive documentation can be read on its &lt;a href=&quot;https://elpa.gnu.org/packages/so-long.html&quot; rel=&quot;noreferrer&quot;&gt;GNU ELPA page&lt;/a&gt; in plain text, but is nicer to read inside Emacs itself using the command:&lt;/p&gt;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;so-long-commentary&lt;/code&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Using the 18MiB &lt;code&gt;one_line.json&lt;/code&gt; from the question as an example, the time until Emacs is responsive (on my system) after visiting that file:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Without &lt;code&gt;so-long&lt;/code&gt;, Emacs hangs for nearly 3.5 &lt;em&gt;minutes&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ time emacs -Q --eval &amp;quot;(setq large-file-warning-threshold nil)&amp;quot; --eval &amp;quot;(run-with-idle-timer 0.1 nil #'kill-emacs)&amp;quot; -- one_line.json&#xA;&#xA;real    3m25.785s&#xA;user    3m25.058s&#xA;sys     0m0.365s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With &lt;code&gt;so-long&lt;/code&gt;, Emacs is responsive in under a second.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ time emacs -Q -f global-so-long-mode --eval &amp;quot;(setq large-file-warning-threshold nil)&amp;quot; --eval &amp;quot;(run-with-idle-timer 0.1 nil #'kill-emacs)&amp;quot; -- one_line.json&#xA;&#xA;real    0m0.890s&#xA;user    0m0.538s&#xA;sys     0m0.047s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Note that despite that very dramatic improvement, if you actually need to navigate to a position very far into a line of such magnitude, then performance will again become very bad -- still better than it would have been, but the performance issues that so-long &lt;em&gt;can't&lt;/em&gt; address will rapidly overshadow the ones it can address, the further into the line you get.&lt;/p&gt;&#xA;&lt;p&gt;Visiting and moving around near the start of the file should present no problems at all, however -- and for long lines which are not on the scale of this example, the improvements may well be sufficient to make editing practical throughout the buffer.&lt;/p&gt;&#xA;&lt;p&gt;This library may be noticeably more effective in Emacs 27.1 than in earlier versions, because one of the variables that it sets, &lt;code&gt;bidi-inhibit-bpa&lt;/code&gt;, was introduced in 27.1, and that has a significant effect on performance for lines with vast numbers of deeply-nested 'paired bracket' characters (as are abundant in JSON); so the combination of Emacs 27.1 and &lt;code&gt;global-so-long-mode&lt;/code&gt; is the best pairing at present.&lt;/p&gt;&#xA;&lt;p&gt;(If editing files like this one is a regular requirement, however, then Emacs probably isn't the best tool for the job.  For JSON specifically, the &lt;code&gt;jq&lt;/code&gt; command-line tool may serve you well.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2020-08-18T00:37:26.573" LastActivityDate="2020-08-18T00:37:26.573" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="19031" PostTypeId="2" ParentId="19023" CreationDate="2015-12-23T08:15:24.897" Score="3" Body="&lt;p&gt;I assume that the following code does what you want.&#xA;Select the rectangle from &lt;code&gt;a&lt;/code&gt; to &lt;code&gt;b&lt;/code&gt; in your table and call &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;org-table-copy-corner-to-rectangle&lt;/code&gt;.&#xA;All fields inside the rectangle are filled with &lt;code&gt;a&lt;/code&gt;.&#xA;You can put the code into your init-file (e.g., &lt;code&gt;~/.emacs&lt;/code&gt;) and bind some key or menu-entry to it. Adding a menu item to the Tbl menu is already included at the end of the following code.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org-table)&#xA;(defun org-table-copy-corner-to-rectangle  ()&#xA;  &quot;Copy the field at the start corner of the currently active rectangle to the full rectangle.&quot;&#xA;  (interactive)&#xA;  (unless (org-region-active-p)&#xA;    (error &quot;Active region in org-table required&quot;))&#xA;  (let* ((beg (region-beginning))&#xA;     (end (region-end)))&#xA;    (save-excursion&#xA;      (goto-char beg)&#xA;      (org-table-check-inside-data-field)&#xA;      (let* ((field (save-excursion (org-table-get-field)))&#xA;         (l01 (org-table-current-dline))&#xA;         (c01 (org-table-current-column))&#xA;         (l02 (progn (goto-char end)&#xA;             (org-table-check-inside-data-field)&#xA;             (org-table-current-dline)))&#xA;         (c02 (org-table-current-column))&#xA;         (cMin (min c01 c02))&#xA;         (cMax (max c01 c02))&#xA;         (nl (abs (- l01 l02))))&#xA;    (goto-char beg)&#xA;    (loop for row from 0 upto nl do&#xA;          (while (org-at-table-hline-p) (beginning-of-line 2))&#xA;          (if (not (org-at-table-p))&#xA;          (progn (end-of-line 0) (org-table-next-field)))&#xA;          (loop for col from cMin upto cMax do&#xA;            (org-table-goto-column col nil 'force)&#xA;            (org-table-get-field nil field))&#xA;          (forward-line)))&#xA;      (goto-char beg)&#xA;      (org-table-align))))&#xA;&#xA;(easy-menu-add-item org-tbl-menu '(&quot;Rectangle&quot;) [&quot;Copy start corner to rectangle&quot; org-table-copy-corner-to-rectangle :active (org-at-table-p)])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-12-24T21:42:16.837" LastActivityDate="2015-12-24T21:42:16.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19032" PostTypeId="2" ParentId="19024" CreationDate="2015-12-23T08:55:27.823" Score="4" Body="&lt;p&gt;Evil does modify the mode line on its own and refreshes it regularly (according to the code at activation and state changes).  The placement of its tag depends on &lt;code&gt;evil-mode-line-format&lt;/code&gt;, theoretically it should be possible for the code to perform &lt;code&gt;(cons 'evil-mode-line-tag mode-line-format)&lt;/code&gt;, but I've went with &lt;code&gt;(setq evil-mode-line-format '(before . mode-line-front-space))&lt;/code&gt; instead as that does definitely work for me.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-12-23T08:55:27.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19033" PostTypeId="1" AcceptedAnswerId="19067" CreationDate="2015-12-23T09:02:11.077" Score="0" ViewCount="184" Body="&lt;p&gt;I have set &lt;code&gt;tramp-persistency-file-name&lt;/code&gt; to a custom location since I want all the files generated by emacs stored in a specific location.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq files-dir &quot;~/src/emacs.d/vendor/files/&quot;)&#xA;(setq custom-file (concat files-dir &quot;custom.el&quot;)&#xA;      tramp-persistency-file-name (concat files-dir &quot;tramp&quot;)&#xA;      host-file (concat hosts-dir (replace-regexp-in-string &quot;[^A-Za-z0-9_-]&quot; &quot;-&quot; (downcase (car (split-string (system-name) &quot;\\.&quot;)))) &quot;.el&quot;)&#xA;      version-file (concat versions-dir (number-to-string emacs-major-version) &quot;.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do have some bookmarks set to some remote locations, that are supposed to use tramp to reach some remote files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the &quot;first time&quot; I use it, it works. I can reach my &lt;code&gt;/scp:host:/path&lt;/code&gt; remote path and open some files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, Tramp generates the history file in the right location I've set (&lt;code&gt;~/src/emacs.d/vendor/files/tramp&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the next time, I want to open such a location, it crashes and generates this backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (invalid-function ([&quot;scp&quot; nil &quot;my-host&quot; nil nil] (&quot;locale&quot; &quot;LC_ALL=en_US.utf8&quot;) (&quot;uname&quot; &quot;Linux 3.2.0-4-amd64&quot;) (&quot;test&quot; &quot;test&quot;) (&quot;remote-path&quot; (&quot;/bin&quot; &quot;/usr/bin&quot; &quot;/sbin&quot; &quot;/usr/sbin&quot; &quot;/usr/local/bin&quot; &quot;/usr/local/sbin&quot;)) (&quot;remote-shell&quot; &quot;/bin/sh&quot;) (&quot;stat&quot; &quot;\\stat&quot;) (&quot;file-exists&quot; &quot;test -e&quot;) (&quot;id&quot; &quot;/usr/bin/id&quot;) (&quot;gid-string&quot; &quot;my-user&quot;) (&quot;ls&quot; &quot;/bin/ls --color=never&quot;) (&quot;ls-dired&quot; t) (&quot;gid-integer&quot; 1016) (&quot;perl-file-spec&quot; t) (&quot;perl-cwd-realpath&quot; t) (&quot;perl&quot; &quot;\\perl&quot;) (&quot;readlink&quot; &quot;\\readlink&quot;)))&#xA;  (([&quot;scp&quot; nil &quot;my-host&quot; nil nil] (&quot;locale&quot; &quot;LC_ALL=en_US.utf8&quot;) (&quot;uname&quot; &quot;Linux 3.2.0-4-amd64&quot;) (&quot;test&quot; &quot;test&quot;) (&quot;remote-path&quot; (&quot;/bin&quot; &quot;/usr/bin&quot; &quot;/sbin&quot; &quot;/usr/sbin&quot; &quot;/usr/local/bin&quot; &quot;/usr/local/sbin&quot;)) (&quot;remote-shell&quot; &quot;/bin/sh&quot;) (&quot;stat&quot; &quot;\\stat&quot;) (&quot;file-exists&quot; &quot;test -e&quot;) (&quot;id&quot; &quot;/usr/bin/id&quot;) (&quot;gid-string&quot; &quot;my-user&quot;) (&quot;ls&quot; &quot;/bin/ls --color=never&quot;) (&quot;ls-dired&quot; t) (&quot;gid-integer&quot; 1016) (&quot;perl-file-spec&quot; t) (&quot;perl-cwd-realpath&quot; t) (&quot;perl&quot; &quot;\\perl&quot;) (&quot;readlink&quot; &quot;\\readlink&quot;)))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/Users/my-user/src/emacs.d/vendor/files/tramp&quot; nil t)  ; Reading at buffer position 702&#xA;  load-with-code-conversion(&quot;/Users/my-user/src/emacs.d/vendor/files/tramp&quot; &quot;/Users/my-user/src/emacs.d/vendor/files/tramp&quot; nil t)&#xA;  load(&quot;tramp&quot; nil t)&#xA;  (let ((default-directory (or (symbol-value (quote temporary-file-directory)) &quot;/&quot;))) (load &quot;tramp&quot; nil t))&#xA;  tramp-autoload-file-name-handler(expand-file-name &quot;/scp:my-host:/home/my-user/my/path&quot; nil)&#xA;  file-readable-p(&quot;/scp:my-host:/home/my-user/my/path&quot;)&#xA;  bookmark-default-handler((&quot;MyBookmark&quot; (filename . &quot;/scp:my-host:/home/my-user/my/path&quot;)))&#xA;  byte-code(&quot;\301!\206�\302\303!!\207&quot; [bookmark-name-or-record bookmark-get-handler bookmark-default-handler bookmark-get-bookmark] 3)&#xA;  bookmark-handle-bookmark(&quot;MyBookmark&quot;)&#xA;  bookmark--jump-via(&quot;MyBookmark&quot; switch-to-buffer)&#xA;  bookmark-jump(&quot;MyBookmark&quot;)&#xA;  bookmark-bmenu-this-window()&#xA;  call-interactively(bookmark-bmenu-this-window nil nil)&#xA;  command-execute(bookmark-bmenu-this-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: if I comment the line &lt;code&gt;setq tramp-persistency-file-name blabla&lt;/code&gt;, it solves the problem but the file is located in my &lt;code&gt;emacs.d&lt;/code&gt; directory (which I do not want).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any idea what's going wrong ?&#xA;Should I report a bug or am I the bug ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: as requested here is the &lt;code&gt;tramp&lt;/code&gt; file generated after the first use of the feature&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- emacs-lisp -*- &amp;lt;15/12/23 10:35:22 ~/src/emacs.d/vendor/files/tramp&amp;gt;&#xA;;; Tramp connection history.  Don't change this file.&#xA;;; You can delete it, forcing Tramp to reapply the checks.&#xA;&#xA;(([&quot;scp&quot; nil &quot;my-host&quot; nil nil]&#xA;  (&quot;locale&quot; &quot;LC_ALL=en_US.utf8&quot;)&#xA;  (&quot;uname&quot; &quot;Linux 3.2.0-4-amd64&quot;)&#xA;  (&quot;test&quot; &quot;test&quot;)&#xA;  (&quot;remote-path&quot;&#xA;   (&quot;/bin&quot; &quot;/usr/bin&quot; &quot;/sbin&quot; &quot;/usr/sbin&quot; &quot;/usr/local/bin&quot; &quot;/usr/local/sbin&quot;))&#xA;  (&quot;remote-shell&quot; &quot;/bin/sh&quot;)&#xA;  (&quot;stat&quot; &quot;\\stat&quot;)&#xA;  (&quot;file-exists&quot; &quot;test -e&quot;)&#xA;  (&quot;id&quot; &quot;/usr/bin/id&quot;)&#xA;  (&quot;gid-string&quot; &quot;my-user&quot;)&#xA;  (&quot;ls&quot; &quot;/bin/ls --color=never&quot;)&#xA;  (&quot;ls-dired&quot; t)&#xA;  (&quot;gid-integer&quot; 1016)&#xA;  (&quot;readlink&quot; &quot;\\readlink&quot;)&#xA;  (&quot;perl-file-spec&quot; t)&#xA;  (&quot;perl-cwd-realpath&quot; t)&#xA;  (&quot;perl&quot; &quot;\\perl&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="56" LastEditorUserId="56" LastEditDate="2015-12-23T09:37:25.273" LastActivityDate="2015-12-24T20:44:41.147" Title="Tramp+bookmark crash when setting a different tramp-persistency-file-name file location" Tags="|tramp|bookmarks|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19034" PostTypeId="1" AcceptedAnswerId="19134" CreationDate="2015-12-23T16:01:11.553" Score="3" ViewCount="579" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/roman/golden-ratio.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;golden-ratio&lt;/code&gt;&lt;/a&gt; to automagically resize my buffers when I switch from one to another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have 2 buffers, my window is split vertically and active buffer is the one on the right. While activating &lt;code&gt;helm-imenu&lt;/code&gt;, I would like to open results in an existing buffer on the left side (because those have a higher height than the ones below/above the active one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know of &lt;code&gt;C-t&lt;/code&gt;, but I have to use it N times before it places &lt;code&gt;helm-imenu&lt;/code&gt; buffer where I want.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2015-12-29T17:05:52.577" Title="How to open helm-imenu in existing buffer" Tags="|helm|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19035" PostTypeId="1" AcceptedAnswerId="19049" CreationDate="2015-12-23T16:30:14.743" Score="5" ViewCount="1257" Body="&lt;p&gt;I'm trying to write a little compilation monitor frame that gets compilation updates written to it without the overhead of seeing absolutely everything going on in the compile. I've been working with frames a little bit, and it's mostly a huge pain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to figure out if the frame that I'm creating exists yet. I've come up with two ways to do that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Loop through all the frames in (frame-list) and do a string match on the title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) This doofy bit of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (if (not (select-frame-by-name &quot;COMPILATION MONITOR&quot;))&#xA;  (selected-frame)&#xA;(print &quot;ERROR&quot; (get-buffer &quot;*monitor*&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;select-frame-by-name returns an error if it can't find a frame, which isn't actually a value, as near as I can tell. It just quietly exits. But if it DOES find the frame that I want, it returns nil, and focuses the frame. (Then I can return the frame if I need it using 'selected-frame'. Ignore the error reporting to my buffer--that's not terribly relevant here.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some better way? With buffers, I can use get-buffer-create to create something new if it doesn't exist and use it if it does. Am I missing something in frame creation? Maybe what I need to know is how the error handling code works, so I can catch the error that select-frame-by-name throws when it can't find what I want?&lt;/p&gt;&#xA;" OwnerUserId="8254" LastActivityDate="2015-12-24T19:14:56.093" Title="Finding frames by name" Tags="|frames|error-handling|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19036" PostTypeId="2" ParentId="19003" CreationDate="2015-12-23T16:31:09.107" Score="3" Body="&lt;p&gt;From what I have seen with the languages that I work in, emacs major modes for programming languages will often define their own functions to indent code properly for that language. To see some of these functions you can do &lt;code&gt;C-h f&lt;/code&gt; type &lt;code&gt;coffee-indent-&lt;/code&gt; and then tab to see the list of different indentation functions that &lt;code&gt;coffee-mode&lt;/code&gt; provides, and pick one to read it's documentation. I looked through the source code of &lt;code&gt;coffee-mode.el&lt;/code&gt; and I don't really understand enough elisp to comment on exactly how what setting &lt;code&gt;coffee-indent-like-python-mode&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; will do exactly, but my assumtion from the variable name and from the behaviour it achieves as described in my tests below, is that it causes the &lt;code&gt;coffee-mode&lt;/code&gt; indentation commands to behave like &lt;code&gt;python-mode&lt;/code&gt; indentation commands (i.e., causes them to behave exactly as you are describing above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From tests that I ran in a few scratch buffers, I think that the problem is indeed caused by the variable &lt;code&gt;coffee-indent-like-python-mode&lt;/code&gt;.&#xA;Here are the steps that I took to reproduce and then fix your problem (at least in my version of emacs). (Also note that my tabs are bigger than yours, but that shouldn't make a difference. I have enabled &lt;code&gt;whitespace-mode&lt;/code&gt; for these screenshots so that it is clear that each indent is a single tab)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Opened a scratch buffer and set it to &lt;code&gt;coffee-mode&lt;/code&gt; with &lt;code&gt;M-x coffee-mode&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Pasted in this code with &lt;code&gt;z()&lt;/code&gt; and &lt;code&gt;foo()&lt;/code&gt; at the same indentation level:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Wd59c.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Wd59c.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Hit tab on the line with &lt;code&gt;z()&lt;/code&gt; indenting it on level&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1uxtK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1uxtK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;Hit tab on the line with &lt;code&gt;foo()&lt;/code&gt; indenting it to the same level as &lt;code&gt;z()&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NmVmB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NmVmB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;Hit tab again on the line with &lt;code&gt;foo()&lt;/code&gt; nesting it one level below &lt;code&gt;z()&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3C8Dl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3C8Dl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand your question correctly, this is the behaviour you are looking for, right? Pressing tab again on the line with &lt;code&gt;foo()&lt;/code&gt; will bring it back to to the first level, subsiquent tabs will cycle through levels one, two, and three in this case.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;6&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;I opened a new scratch buffer in &lt;code&gt;lisp-interaction-mode&lt;/code&gt;, entered the code &lt;code&gt;(setq coffee-indent-like-python-mode t)&lt;/code&gt; (notice the &lt;code&gt;mode&lt;/code&gt; at the end of the variable name which is missing from your sample configuration), and evaluated that code with the point after the last paren with &lt;code&gt;C-x C-e&lt;/code&gt;. Then I returned to my &lt;code&gt;coffee-mode&lt;/code&gt; buffer and tried indenting again with tab. As expected it indents &quot;like python-mode&quot;, i.e., it will not indent &lt;code&gt;foo()&lt;/code&gt; past &lt;code&gt;z()&lt;/code&gt;, because this kind of indentation is invalid in Python.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I went back to my lisp buffer, changed the &lt;code&gt;t&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, i.e., &lt;code&gt;(setq coffee-indent-like-python-mode nil)&lt;/code&gt;, evaluated that, and back in my &lt;code&gt;coffee-mode&lt;/code&gt; buffer I can indent &lt;code&gt;foo()&lt;/code&gt; past &lt;code&gt;z()&lt;/code&gt; again.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Please try these experiments, or simply try removing the reference to &lt;code&gt;coffee-indent-like-python-mode&lt;/code&gt; in your config (or set it to &lt;code&gt;nil&lt;/code&gt;) to see if it works. Let me know if you have other questions or need to do more troubleshooting. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-23T16:45:16.750" LastActivityDate="2015-12-23T16:45:16.750" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19037" PostTypeId="1" AcceptedAnswerId="19301" CreationDate="2015-12-23T16:41:45.070" Score="8" ViewCount="3489" Body="&lt;p&gt;Is there a simple configuration to get org-babel to invoke cmd.exe that doesn't involve modifying the org-babel source?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Googling for &lt;a href=&quot;https://www.google.co.uk/search?q=%22org-babel%22%20sh%20%22cmd%22&quot; rel=&quot;noreferrer&quot;&gt;[&quot;org-babel&quot; sh &quot;cmd&quot;]&lt;/a&gt; finds this email list discussion from 2010: &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2010-02/msg00292.html&quot; rel=&quot;noreferrer&quot;&gt;Re: [Orgmode] org-babel-sh and Microsoft Windows&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but that looks like a blanket solution, not one that could be applied on a per-block or per-file, as I'd want to able to run sh/bash too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This is for &lt;a href=&quot;http://www.howardism.org/Technical/Emacs/literate-devops.html&quot; rel=&quot;noreferrer&quot;&gt;literate DevOps&lt;/a&gt; of windows servers, so &quot;use sh/bash/zsh&quot; is unfortunately not a option.)&lt;/p&gt;&#xA;" OwnerUserId="2495" LastActivityDate="2018-03-29T16:45:46.363" Title="Org-babel invoking cmd.exe" Tags="|org-babel|microsoft-windows|shell|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19038" PostTypeId="2" ParentId="19019" CreationDate="2015-12-23T17:56:00.477" Score="5" Body="&lt;p&gt;&lt;strong&gt;Preferred solution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have settled with using &quot;ag&quot; (The Silver Searcher) for search and &quot;helm-ag&quot; or &quot;ag.el&quot; for Emacs integration. &quot;ag&quot; allows you to specify a &quot;.agignore&quot; file where you can add file/directory patterns that will be ignored for the search - exactly what I was looking for. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# .agignore&#xA;folder&#xA;file.txt&#xA;*.js&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It also takes &quot;.gitignore&quot; and &quot;.hgignore&quot; into account&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install &quot;ag&quot; (&lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/ggreer/the_silver_searcher&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Use &quot;helm-ag&quot; mode if you're using &quot;helm&quot; (&lt;a href=&quot;https://github.com/syohex/emacs-helm-ag&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/syohex/emacs-helm-ag&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Use &quot;ag&quot; mode if you're not using &quot;helm&quot; (&lt;a href=&quot;https://github.com/Wilfred/ag.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/Wilfred/ag.el&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Less favourable solution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Achieving the same with &quot;rgrep&quot; or &quot;grep-find&quot; is more difficult. You can set the &quot;grep-find-ignore-directories&quot; or &quot;grep-find-ignore-files&quot; (for rgrep) as directory-local variables in a dir-locals.el file, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Reference: http://stackoverflow.com/a/16247272/1505303&#xA;((nil . ((eval . (progn&#xA;                   (require 'grep)&#xA;                   (add-to-list &#xA;                    (make-local-variable 'grep-find-ignored-directories)&#xA;                    &quot;folder-to-ignore&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or (thanks to @phils answer for the direction):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((grep-find-ignored-directories . (&quot;folder-to-ignore&quot;))&#xA;         (grep-find-ignored-files . (&quot;file-to-ignore&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both of these solutions though have the drawback that the directory-local variables are set from the folder defined and below. This means that if I make a search from the root folder of the project, or any parent folder, the undesired files will be included in the search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, they are a bit more cumbersome and difficult to set up, especially for emacs beginners that do not understand elisp well enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may be possible to write a function that looks for &quot;.findignore&quot; or &quot;.grepignore&quot; files in in the folder the search is being executed and below, convert the patterns from each file as relative to the folder, and then pass them as arguments to &quot;find&quot; or &quot;grep&quot;. That would certainly be much slower than &quot;ag&quot; though, so it may not be worth developing.&lt;/p&gt;&#xA;" OwnerUserId="10575" LastActivityDate="2015-12-23T17:56:00.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19039" PostTypeId="1" AcceptedAnswerId="19052" CreationDate="2015-12-23T18:22:45.650" Score="3" ViewCount="1326" Body="&lt;p&gt;My emacs daemon for ocaml (I use more than one emacs daemon) starts in a tuareg scratch buffer.  I am aware of &lt;code&gt;initial-major-mode&lt;/code&gt; but this hasn't worked: the scratch is started before &lt;code&gt;(setq&lt;/code&gt;initial-major-mode 'tuareg-mode)` is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I keep the &lt;code&gt;initial-buffer-choice&lt;/code&gt; to scratch, I just run &lt;code&gt;(tuareg-mode)&lt;/code&gt; and my scratch mode is modified as I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now, when I kill the scratch, new scratch buffers are not in tuareg mode, so I added a little hack found on stackexchange:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun prepare-scratch-for-kill ()&#xA;  (save-excursion&#xA;    (set-buffer (get-buffer-create &quot;*scratch*&quot;))&#xA;    (tuareg-mode)&#xA;    (add-hook 'kill-buffer-query-functions 'kill-scratch-buffer t)))&#xA;&#xA;(defun kill-scratch-buffer ()&#xA;  (let (kill-buffer-query-functions)&#xA;    (kill-buffer (current-buffer)))&#xA;  ;; no way, *scratch* shall live&#xA;  (prepare-scratch-for-kill)&#xA;  ;; Since we &quot;killed&quot; it, don't let caller try too&#xA;  nil)&#xA;&#xA;(prepare-scratch-for-kill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, but now I don't see my magnificent &lt;code&gt;initial-scratch-message&lt;/code&gt;.&#xA;I have tried to &lt;code&gt;(setq initial-major-mode 'tuareg-mode)&lt;/code&gt;, which normally modifies the scratch major mode.  But it doesn't, even if I start a new scratch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to do it the proper way, emacs embeded way, but what I have tried doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="253" LastEditDate="2015-12-25T13:05:29.947" LastActivityDate="2015-12-25T13:05:29.947" Title="Set a default scratch buffer" Tags="|init-file|major-mode|scratch-buffer|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19040" PostTypeId="1" CreationDate="2015-12-23T18:23:52.687" Score="1" ViewCount="330" Body="&lt;p&gt;I'd like to send some commands to the terminal Emacs is running in, using &lt;code&gt;send-string-to-terminal&lt;/code&gt;. However, some terminals don't support the command I have in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When this is the case, the command is echoed after the cursor, temporarily overwriting the display, and causing graphical corruption:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Result of running &lt;kbd&gt;M-:&lt;/kbd&gt;&lt;code&gt;(send-string-to-terminal &quot;\e[5 q&quot;)&lt;/code&gt; in &lt;code&gt;xfce4-terminal&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Wg4zo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Wg4zo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that the text appears in the echo area by mere coincidence—if I had run the code using a keybinding in a different buffer, the output would be positioned after the cursor)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, this is not desirable. Is there a way to hide the output (or mask it by redrawing the display in that region) so the command can silently fail?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-01-23T13:55:41.030" LastActivityDate="2016-01-23T13:55:41.030" Title="send-string-to-terminal but hide output" Tags="|terminal-emacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19041" PostTypeId="2" ParentId="19022" CreationDate="2015-12-23T19:23:57.503" Score="2" Body="&lt;p&gt;The answer from &lt;a href=&quot;https://stackoverflow.com/questions/7251784/how-do-i-adjust-the-left-margin-in-emacs-nox&quot;&gt;https://stackoverflow.com/questions/7251784/how-do-i-adjust-the-left-margin-in-emacs-nox&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(set-window-margins nil 1)&lt;/code&gt; will instantly give a left margin of one&#xA;  char to the current window (that's the nil)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2015-12-23T19:23:57.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19042" PostTypeId="1" AcceptedAnswerId="19044" CreationDate="2015-12-23T19:26:17.490" Score="2" ViewCount="295" Body="&lt;p&gt;I'm a happy user of Emacs and SLIME. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like SLIME is aware of only files with the extension &quot;.lisp&quot; and not others such as &quot;.cl&quot; or &quot;.asd&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make SLIME aware of and work with different file extensions? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2784" LastActivityDate="2015-12-23T20:56:14.673" Title="Make SLIME aware of file extensions other than &quot;.lisp&quot;" Tags="|slime|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19043" PostTypeId="2" ParentId="19040" CreationDate="2015-12-23T20:21:54.287" Score="-1" Body="&lt;p&gt;&lt;strike&gt;&#xA;You may temporarily replace the &lt;code&gt;message&lt;/code&gt; function, which does the actual job of displaying the string in the echo area :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-letf (((symbol-function 'message) #'ignore))&#xA;  (send-string-to-terminal &quot;\e[5 q&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ignore&lt;/code&gt; takes an arbitrary number of arguments, does nothing and returns nil.&#xA;&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I misunderstood the question's meaning. It turns out, after looking a bit at the &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/src/dispnew.c#L5575&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;send-string-to-terminal&lt;/code&gt; function definition&lt;/a&gt; in Emacs' C source, there is no way to prevent it from echoing the supplied command.&lt;/p&gt;&#xA;" OwnerUserId="5136" LastEditorUserId="5136" LastEditDate="2015-12-23T22:18:52.920" LastActivityDate="2015-12-23T22:18:52.920" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19044" PostTypeId="2" ParentId="19042" CreationDate="2015-12-23T20:40:57.503" Score="3" Body="&lt;p&gt;Try adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.cl\\'&quot; . slime-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.asd\\'&quot; . slime-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init/config file. Then files with those extensions will use &lt;code&gt;slime-mode&lt;/code&gt; by default. This pattern of &lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.EXTENSION\\'&quot; . MODE))&lt;/code&gt; is a good way to have files with the extension &lt;strong&gt;EXTENSION&lt;/strong&gt; open in the mode &lt;strong&gt;MODE&lt;/strong&gt;. Just be careful that you have the &lt;code&gt;&quot;\\.EXTENSION\\'&quot;&lt;/code&gt; part, which is a regular expression, formatted correctly (with slashes and quotes in the right places), or you will will not get the results you want. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-23T20:56:14.673" LastActivityDate="2015-12-23T20:56:14.673" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19045" PostTypeId="1" CreationDate="2015-12-24T00:30:57.333" Score="0" ViewCount="33" Body="&lt;p&gt;I enable &lt;code&gt;BBDB&lt;/code&gt; as below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (el-get-bundle! bbdb&#xA;    (defun ec--bbdb-initialize ()&#xA;      (flyspell-mode t)&#xA;      (bbdb-initialize 'message)&#xA;      (bbdb-initialize 'gnus)&#xA;      (local-set-key &quot;&amp;lt;TAB&amp;gt;&quot; 'bbdb-complete-name))&#xA;&#xA;    (add-hook 'message-mode-hook #'ec--bbdb-initialize)&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to write message in &lt;code&gt;Gnus&lt;/code&gt; after press &lt;code&gt;a&lt;/code&gt; in a group. I can't insert &lt;code&gt;&amp;lt;&lt;/code&gt; char. Because it is define as &lt;code&gt;Prefix Command&lt;/code&gt;. But I can't find where it is defined in &lt;code&gt;BBDB&lt;/code&gt; package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I think it is the issue related to &lt;code&gt;BBDB&lt;/code&gt; is when I comments the code above in my config file, I can insert &lt;code&gt;&amp;lt;&lt;/code&gt; char and it is not show as &lt;code&gt;Prefix Command&lt;/code&gt; in &lt;code&gt;describe-bindings&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doesn't anyone know how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-12-24T01:00:51.840" Title="Can't insert &quot;&lt;&quot; when writing message with Gnus after enable BBDB" Tags="|gnus|bbdb|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19046" PostTypeId="2" ParentId="19045" CreationDate="2015-12-24T01:00:51.840" Score="1" Body="&lt;p&gt;You can pretty much always insert any character using &lt;code&gt;C-q&lt;/code&gt;: &lt;code&gt;C-q &amp;lt;&lt;/code&gt;. I'd be surprised if that didn't work in your context. (Of course, often there is an easier, more direct way to insert a given character.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-24T01:00:51.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19047" PostTypeId="2" ParentId="10898" CreationDate="2015-12-24T01:02:11.190" Score="1" Body="&lt;p&gt;When Emacs 25.1 is released, this will be as simple as just &lt;code&gt;(add-hook 'replace-update-post-hook 'recenter)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="478" LastEditorUserId="105" LastEditDate="2015-12-24T01:41:36.653" LastActivityDate="2015-12-24T01:41:36.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19048" PostTypeId="1" AcceptedAnswerId="19050" CreationDate="2015-12-24T01:06:41.747" Score="3" ViewCount="1262" Body="&lt;p&gt;I'm using the latest org-plus-contrib package from the org ELPA archive under emacs 24.5 (Linux and OSX). I needed to have a custom title which includes a logo PNG in documents I export from org to PDF. I use the hitec document class as the bae article class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't always need to generate this custom title, so rather than define a new custom class, I add the following to one of my org template files I use when creating a new document. The solution mostly works, but I'm not sure if my approach is really that good and would like to get some feedback or suggestions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My requirement is to have the title include a PNG logo on the left and have the title, subtitle, author and date on the right (flushright). This is what I have in my latex preamble&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\makeatletter&#xA;\def\@maketitle{&#xA;  \begin{minipage}[c][4cm][t]{\linewidth}&#xA;    \begin{minipage}[t][4cm][c]{4cm}&#xA;      \includegraphics{/home/tcross/Pictures/unelogo_medium.png}&#xA;    \end{minipage}&#xA;    \begin{minipage}[t][5cm][c]{10cm}&#xA;      \flushright&#xA;      \Large \textbf{\@title} \\&#xA;      \vspace{16pt}&#xA;      \large \@author \\&#xA;      \normalsize \@date&#xA;    \end{minipage}&#xA;  \end{minipage}}&#xA;\makeatother&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I do is define a minipage and then inside this minipage, I define two more minipages which are set to be side by side with the left minipage containing the logo and the right minipage containing the title, author, date etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mostly works. I do need to tweak the left minipage a little to get the logo positioned closer to the left margin, but apart from that it seems to work OK (so far). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm wondering is whether this is the best way to structure this title and logo requirement? I thought about using other possible techniques, such as a frame box etc, but reading the manual, there seemed to be other restrictions which might have been a problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been a LaTeX user for a long time, but up until now, I've just used the default styles. This is the first time I've attempted to modify something like the article title page style in a generic manner which wold work for all my future org documents which need this type of title. I don't necessarily understand exactly how this all works - I got to this point by looking at existing style files and doing a git of googling etc. &lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2015-12-24T02:33:03.210" Title="org-mode latex and pdf export custom title" Tags="|org-mode|latex|customize|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19049" PostTypeId="2" ParentId="19035" CreationDate="2015-12-24T01:26:48.567" Score="3" Body="&lt;p&gt;Consider using the two (2) functions written by Drew Adams that are specifically designed for the purpose of obtaining a particular frame by name -- &lt;a href=&quot;http://www.emacswiki.org/emacs/frame-fns.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/frame-fns.el&lt;/a&gt; -- i.e., &lt;code&gt;get-frame-name&lt;/code&gt; and &lt;code&gt;get-a-frame&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more complex example of creating/locating/targeting specific frames with buffers, see the following related thread entitled &lt;strong&gt;How to intercept a file before it opens and decide which frame&lt;/strong&gt;: &lt;a href=&quot;https://stackoverflow.com/questions/18346785/how-to-intercept-a-file-before-it-opens-and-decide-which-frame&quot;&gt;https://stackoverflow.com/questions/18346785/how-to-intercept-a-file-before-it-opens-and-decide-which-frame&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-12-24T01:26:48.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19050" PostTypeId="2" ParentId="19048" CreationDate="2015-12-24T02:33:03.210" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What I'm wondering is whether this is the best way to structure this title and logo requirement?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Not sure what all the requirements are, but it appears you have not mixed the usual float environments inside minipage. That's a good thing, especially if you want to fine tune placements later. Go with what you already have. I would stop adding any more packages that may re-introduce floating objects inside the minipage. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-12-24T02:33:03.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19051" PostTypeId="2" ParentId="19035" CreationDate="2015-12-24T02:56:59.720" Score="1" Body="&lt;p&gt;The functions lawlist mentions should work for you.  If for whatever reason you don't want to use them, here's the implementation I came up with when trying to &lt;a href=&quot;https://stackoverflow.com/a/32509408/5030424&quot;&gt;make Org-mode capture in a pop-out frame&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/get-frame-by-name (fname)&#xA;  &quot;If there is a frame named FNAME, return it, else nil.&quot;&#xA;  (require 'dash)                       ; For `-some'&#xA;  (-some (lambda (frame)&#xA;           (when (equal fname (frame-parameter frame 'name))&#xA;             frame))&#xA;         (frame-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-12-24T02:56:59.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19052" PostTypeId="2" ParentId="19039" CreationDate="2015-12-24T04:23:37.957" Score="5" Body="&lt;p&gt;My original suggestion to the OP based on my own slightly misguided experimentation was this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;make sure that the mode you want to set as the &lt;code&gt;initial-major-mode&lt;/code&gt; is loaded before you set &lt;code&gt;initial-major-mode&lt;/code&gt; with &lt;code&gt;(setq initial-major-mode 'name-of-mode)&lt;/code&gt;. This seems to have solved the problem that the OP was having.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have also tested changing my entire &lt;code&gt;init.el&lt;/code&gt; to contain only the lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-major-mode 'tuareg-mode)&#xA;(setq inhibit-startup-screen t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and literally nothing else, and when I started emacs I got a &lt;code&gt;*scratch*&lt;/code&gt; buffer in &lt;code&gt;tuareg-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leads me to believe that something else was causing the issue, but I am happy that my suggestion could lead to a solution one way or another. Also, in my case &lt;code&gt;tuareg-mode&lt;/code&gt;was installed through &lt;code&gt;MELPA&lt;/code&gt; and would have automatically been added to the &lt;code&gt;load-path&lt;/code&gt;, which might not have been the case for the OP, and this could be why I have no issue with the above configuration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emacsredux.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Redux&lt;/a&gt; also has &lt;a href=&quot;http://emacsredux.com/blog/2014/07/25/configure-the-scratch-buffers-mode/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this short, useful tutorial&lt;/a&gt; on how to solve the problem in question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, I think setting &lt;code&gt;initial-major-mode&lt;/code&gt; as described above in your &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt; or whatever emacs config you use should be enough to set a default mode for your scratch buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you find that this doesn't work as was the case for the OP, it won't hurt to ensure that &lt;code&gt;initial-major-mode&lt;/code&gt; is set to the desired mode &lt;em&gt;after&lt;/em&gt; the package that contains that mode gets initialized. If setting &lt;code&gt;initial-major-mode&lt;/code&gt; &lt;em&gt;still&lt;/em&gt; doesn't work as expected, you can follow the advice in &lt;a href=&quot;https://emacs.stackexchange.com/a/14062/8430&quot;&gt;this accepted answer&lt;/a&gt; and check that the value has not been set in &lt;code&gt;customize&lt;/code&gt; with &lt;code&gt;M-x customize-option RET initial-major-mode RET&lt;/code&gt;. From here you can not only see what value this variable has been set to, but also change the value.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2015-12-24T04:45:50.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19053" PostTypeId="1" AcceptedAnswerId="19059" CreationDate="2015-12-24T05:38:50.690" Score="0" ViewCount="715" Body="&lt;h2&gt;summary&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Elisp newbie has been given &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Commands.html#Defining-Commands&quot; rel=&quot;nofollow noreferrer&quot;&gt;interactive&lt;/a&gt; code (aka &lt;em&gt;commands&lt;/em&gt;, called with &lt;code&gt;M-x whatever&lt;/code&gt;) that &quot;does stuff&quot; on the currently-selected region in the current buffer. What is an/the &quot;elispish way&quot; to scale that code up to handle all of the following (and all interactive) usecases:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;em&gt;(current)&lt;/em&gt; If called with (no argument &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; region selected in the current buffer):&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;do something on the text in the region&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;If called with (no argument &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; no region selected in the current buffer):&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;do something on all the text in the buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;If called with (&lt;code&gt;C-u filepath M-x whatever&lt;/code&gt;) &lt;em&gt;(more on this below)&lt;/em&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;evaluate the argument as a filepath&lt;/li&gt;&#xA;&lt;li&gt;do something on all the text in the file&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;? &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I have code in &lt;a href=&quot;https://bitbucket.org/tlroche/elisp_bulk_replacement&quot; rel=&quot;nofollow noreferrer&quot;&gt;this repo&lt;/a&gt; that currently &quot;does stuff&quot; (usecase detailed in &lt;a href=&quot;http://lists.gnu.org/archive/html/help-gnu-emacs/2015-12/msg00077.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;thread beginning here&lt;/a&gt;) on a region in a buffer. The relevant code is part of &lt;a href=&quot;https://bitbucket.org/tlroche/elisp_bulk_replacement/src/HEAD/test_code.el?at=master&amp;amp;fileviewer=file-view-default&quot; rel=&quot;nofollow noreferrer&quot;&gt;this file&lt;/a&gt; (adapted from &lt;a href=&quot;https://raw.githubusercontent.com/informatimago/emacs/master/pjb-emacs.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;original code&lt;/a&gt; by &lt;a href=&quot;https://github.com/informatimago/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pascal Bourguignon&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun bulk-replace-region-with-tuples-from-file (start end)&#xA;  (interactive &quot;r&quot;) ; need &quot;r&quot; to get region start and end&#xA;  (save-excursion&#xA;    (narrow-to-region start end)&#xA;    (goto-char (point-min))&#xA;    (replace-multiple-strings   ; the payload&#xA;      (with-file BULK-REPLACE-TUPLES-FILEPATH ; defined earlier in the test code&#xA;        (goto-char (point-min))&#xA;        (read (current-buffer))&#xA;      )&#xA;    )&#xA;    (widen)&#xA;  )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That works iff ∃region selected in the current buffer, i.e., usecase#=1 above. How to scale to handle the others?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;answer-in-progress&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Following &lt;a href=&quot;https://emacs.stackexchange.com/users/563/wvxvw&quot;&gt;wvxvw&lt;/a&gt;'s guidance (&lt;a href=&quot;https://emacs.stackexchange.com/a/19059/5444&quot;&gt;below&lt;/a&gt;), I have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;0.&lt;/code&gt; later discovered that a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;prefix argument cannot be a string&lt;/a&gt;! Dunno why I thought this: I've been &lt;em&gt;using&lt;/em&gt; Emacs forever. Instead, if given a non-&lt;code&gt;nil&lt;/code&gt; prefix argument, I'll hafta prompt for a filepath.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Simply refactored &lt;code&gt;bulk-replace-region-with-tuples-from-file&lt;/code&gt; above into a non-interactive helper &lt;code&gt;bulk-replace-region-non-interactive&lt;/code&gt;, merely by removing the &lt;code&gt;(interactive &quot;r&quot;)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Created a &lt;code&gt;bulk-replace-buffer-non-interactive&lt;/code&gt; that simply wraps &lt;code&gt;bulk-replace-region-non-interactive&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun bulk-replace-buffer-non-interactive ()&#xA;      (bulk-replace-region-non-interactive (point-min) (point-max))&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Created a &lt;code&gt;bulk-replace-file-non-interactive&lt;/code&gt; that simply wraps &lt;code&gt;bulk-replace-buffer-non-interactive&lt;/code&gt;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun bulk-replace-file-non-interactive (filepath)&#xA;      (set-buffer (find-file-noselect filepath))&#xA;      (bulk-replace-buffer-non-interactive)&#xA;      (save-buffer)&#xA;      (kill-buffer)&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;Created a hardcoded but interactive solution to usecase#=1 by simply wrapping its non-interactive helper. It's mostly for testing the helper, but it's a useful API as well as a &quot;step along the path&quot;:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun bulk-replace-region (begin end)&#xA;      (interactive &quot;r&quot;) ; need &quot;r&quot; to get region begin and end&#xA;      (bulk-replace-region-non-interactive begin end) &#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;Created a hardcoded but interactive solution to usecase#=2 very similar to previous step:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun bulk-replace-buffer ()&#xA;      (interactive) ; purely to enable `M-x`&#xA;      (bulk-replace-buffer-non-interactive)&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;6&quot;&gt;&#xA;&lt;li&gt;Sorta/kinda handled usecase#=3 in a manner similar to the previous 2 steps: a hardcoded but interactive solution which&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;takes the filepath from a prompt (without a prefix argument). (Note &lt;code&gt;BULK-REPLACE-FILEPATH-PROMPT&lt;/code&gt; is defined above in the &lt;a href=&quot;https://bitbucket.org/tlroche/elisp_bulk_replacement/src/HEAD/test_code.el?at=master&amp;amp;fileviewer=file-view-default&quot; rel=&quot;nofollow noreferrer&quot;&gt;code&lt;/a&gt;.)&lt;/li&gt;&#xA;&lt;li&gt;calls the helper on the filepath&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/19082/how-to-parameterize-prompt-for-interactive-command&quot;&gt;does &lt;em&gt;not&lt;/em&gt; try to use a parameterized prompt with &lt;code&gt;(interactive)&lt;/code&gt;!&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    ; Don't try this! see https://emacs.stackexchange.com/q/19082/5444&#xA;    ; (defun bulk-replace-file (filepath)&#xA;    ;   (interactive (concat &quot;F&quot; BULK-REPLACE-FILEPATH-PROMPT))&#xA;&#xA;    (defun bulk-replace-file ()&#xA;      (interactive) ; purely to enable `M-x`&#xA;      (bulk-replace-file-non-interactive&#xA;        ; `(read-file-name)` does the prompting&#xA;        (expand-file-name (read-file-name BULK-REPLACE-FILEPATH-PROMPT))&#xA;      ) &#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;7&quot;&gt;&#xA;&lt;li&gt;Handled all the usecases (hopefully--pending more complete testing) with an über-wrapper that hides {API, separate code paths} from the user:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun bulk-replace (prefix-argument)&#xA;      (interactive &quot;P&quot;)  ; to catch prefix argument (if given)&#xA;      (cond&#xA;        (prefix-argument ; got one, so prompt user for filepath&#xA;          (bulk-replace-file)&#xA;        )&#xA;        ((use-region-p)  ; we have a region, so bulk-replace-region&#xA;          (bulk-replace-region-non-interactive (region-beginning) (region-end))&#xA;        )&#xA;        (t               ; we always have a current-buffer, so bulk-replace-buffer&#xA;          (bulk-replace-buffer-non-interactive)&#xA;        )&#xA;      )&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works! but needs more, better, automated} testing, docstrings, error-handling, etc: &lt;a href=&quot;https://bitbucket.org/tlroche/elisp_bulk_replacement&quot; rel=&quot;nofollow noreferrer&quot;&gt;to be continued ...&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-07-26T04:01:42.497" Title="elisp pattern for handling region || buffer || file" Tags="|buffers|files|region|interactive|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19054" PostTypeId="5" CreationDate="2015-12-24T05:42:39.480" Score="0" Body="&lt;p&gt;A &lt;code&gt;region&lt;/code&gt; is all text in a &lt;code&gt;buffer&lt;/code&gt; between the &lt;code&gt;point&lt;/code&gt; (the text-cursor position) and the &lt;code&gt;mark&lt;/code&gt; (if it exists). With &lt;code&gt;transient-mark-mode&lt;/code&gt; on, the region text is highlighted.&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="105" LastEditDate="2015-12-24T05:53:28.993" LastActivityDate="2015-12-24T05:53:28.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19055" PostTypeId="4" CreationDate="2015-12-24T05:42:39.480" Score="0" Body="The text between the point and mark in a buffer." OwnerUserId="5444" LastEditorUserId="2274" LastEditDate="2015-12-24T18:00:59.377" LastActivityDate="2015-12-24T18:00:59.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19056" PostTypeId="5" CreationDate="2015-12-24T05:53:14.203" Score="0" Body="&lt;p&gt;Emacs-Lisp functions are made &lt;em&gt;interactive&lt;/em&gt; (i.e., &lt;strong&gt;commands&lt;/strong&gt;, which are invocable using&lt;code&gt;M-x&lt;/code&gt; or a key binding) by placing an &lt;strong&gt;&lt;code&gt;interactive&lt;/code&gt;&lt;/strong&gt; spec (a special form) in the function definition. The spec provides the actual arguments to the command. The argument to the spec is either a literal string with predefined &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html#Interactive-Codes&quot; rel=&quot;nofollow&quot;&gt;codes&lt;/a&gt;) or a sexp that is evaluated to return the list of actual arguments.&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="105" LastEditDate="2015-12-24T06:02:40.613" LastActivityDate="2015-12-24T06:02:40.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19057" PostTypeId="4" CreationDate="2015-12-24T05:53:14.203" Score="0" Body="`interactive` spec of an Emacs-Lisp command (function invocable using `M-x` or a key binding)" OwnerUserId="5444" LastEditorUserId="105" LastEditDate="2015-12-24T05:55:08.630" LastActivityDate="2015-12-24T05:55:08.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19058" PostTypeId="2" ParentId="19053" CreationDate="2015-12-24T06:13:46.287" Score="0" Body="&lt;p&gt;Your description does not say that the function needs to be a command.  This is essentially what you want, in that case:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (&amp;amp;optional file)&#xA;  &quot;...&quot;&#xA;  (if file&#xA;      (with-current-buffer (find-file-noselect file)&#xA;        (do-something-with-text-in-file))&#xA;    (if (use-region-p)                  ; or (region-active-p)&#xA;        (save-restriction&#xA;          (narrow-to-region (region-beginning) (region-end))&#xA;          (do-something-with-text-in-region))&#xA;      (do-something-with-text-in-current-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;use-region-p&lt;/code&gt; assumes you want the active region to be non-empty. If not, use &lt;code&gt;active-region-p&lt;/code&gt;.  Depending on what you want to do in the region, you might not need to use &lt;code&gt;save-restriction&lt;/code&gt; -- you can perhaps just bind local variables to &lt;code&gt;region-beginning&lt;/code&gt; and &lt;code&gt;region-end&lt;/code&gt;, and work within those bounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And no, you do not need to mark the whole buffer to be able to act on it.  Just perform whatever action you want, using &lt;code&gt;point-min&lt;/code&gt; and &lt;code&gt;point-max&lt;/code&gt; as the bounds of the action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is the &lt;em&gt;same&lt;/em&gt; action that you want to do when the region is active, then you can use the same code: if the region is active, just use &lt;code&gt;save-restriction&lt;/code&gt; and &lt;code&gt;narrow-to-region&lt;/code&gt; first. Within the narrowed buffer, &lt;code&gt;point-min&lt;/code&gt; and &lt;code&gt;point-max&lt;/code&gt; are the beginning and end of the region, not the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you do want a &lt;em&gt;command&lt;/em&gt; then you will need to specify how you want the command to (optionally) get a file-name argument. Do you want to test a prefix argument and depending on its value prompt to read a file name?  And so on.  IOW, you need to decide what &lt;em&gt;interactive&lt;/em&gt; behavior you want, if you want a command.  For a command, your question is unclear so far.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-24T06:22:18.240" LastActivityDate="2015-12-24T06:22:18.240" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19059" PostTypeId="2" ParentId="19053" CreationDate="2015-12-24T06:13:58.090" Score="1" Body="&lt;p&gt;Probably the confusing thing is the &lt;code&gt;interactive&lt;/code&gt; part, so I'll work from it.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Interactive&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Is the part of the function which is executed before the function is called. If it has some particular strings, Emacs will know to interpret those as asking for performing some interaction.  But, more generally, &lt;code&gt;interactive&lt;/code&gt; form can contain whatever code you like; the requirement is that it produce a list with the arguments matching function's formal arguments.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Your case&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can have two strategies:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;(bulk-replace-current-region-with-tuples-from-file file-or-begin end)&lt;/code&gt;.  In this case you would do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bulk-replace-current-region-with-tuples-from-file (file-or-begin &amp;amp;optional end)&#xA;  (interactive&#xA;    (if (region-active-p)&#xA;       (list (region-beginning) (region-end))&#xA;       (read-file-name &quot;Replace in file: &quot;)))&#xA;  (if end ; this is an operation on region&#xA;     ; otherwise perform replacement in a file&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is an &quot;ugly&quot; function signature because it mixes types, and the meaning of its arguments is ambiguous, but it keeps the number of arguments to the minimum, and every combination of arguments has a meaning.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;(bulk-replace-current-region-with-tuples-from-file begin end file)&lt;/code&gt; In this case, your code might look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun bulk-replace-current-region-with-tuples-from-file (begin end file)&#xA;  (interactive&#xA;    (if (region-active-p)&#xA;       (list (region-beginning) (region-end) nil)&#xA;       (list nil nil (read-file-name &quot;Replace in file: &quot;)))&#xA;  (cond&#xA;     ((and begin end file) ; this is an operation on a region in a file&#xA;     )&#xA;     (file ; this is an operation on a file&#xA;     )&#xA;     ( ; this is an operation on a region&#xA;     ))&#xA;   ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unlike in the previous case, you would need to handle the situation when you are both given the file name and the region.  Perhaps, you would also want to be able to specify both of these parameters interactively (in which case you would need to modify the &lt;code&gt;interactive&lt;/code&gt; part).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Since the above seems complicated, my strategy would be to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Write a non-interactive function that does replacement on a region.&lt;/li&gt;&#xA;&lt;li&gt;Write two interactive functions calling the first function in a situation when I need it to work on a buffer, or to switch to the given file and to specify the &lt;code&gt;begin&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; by giving it &lt;code&gt;(point-min)&lt;/code&gt; and &lt;code&gt;(point-max)&lt;/code&gt;.  You'd have more functions, but each one of them would be simpler, so it's not so complicated after all.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2015-12-24T08:04:45.620" LastActivityDate="2015-12-24T08:04:45.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19060" PostTypeId="2" ParentId="19053" CreationDate="2015-12-24T09:17:55.430" Score="0" Body="&lt;p&gt;I'd use something like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;write a general basic processing defun, with start-end interface&lt;/li&gt;&#xA;&lt;li&gt;determine what you has been given&lt;/li&gt;&#xA;&lt;li&gt;set start and end&lt;/li&gt;&#xA;&lt;li&gt;apply basic processing defun&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's an implementation. Note though that I didn't test it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun extensible-omnivorous-defun (arg)&#xA;  &quot;Applyies basic-processing to active region,&#xA;or whole buffer if there's no active region.&#xA;With C-u brings up a dialog to select the file to process.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;&#xA;  ;; basic processing with start-end interface:&#xA;  (defun basic-processing (start end)&#xA;    ;; do something here&#xA;    )&#xA;&#xA;  ;; determing start and end:&#xA;  (let (start end &#xA;              (file-is-given? nil))&#xA;&#xA;    (cond&#xA;     ((equal arg '(4))&#xA;      (ido-find-file &quot;Select file to process: &quot;)&#xA;&#xA;      (setq start (point-min))&#xA;      (setq end   (point-max))&#xA;&#xA;      (setq file-is-given? t)&#xA;      )&#xA;     ;; ;; easily extend the defun later:&#xA;     ;; ((equal arg '(16))&#xA;     ;;  (message &quot;%s&quot; arg)&#xA;     ;;  )&#xA;     ;; ((equal arg '-)&#xA;     ;;  (message &quot;%s&quot; arg)&#xA;     ;;  )&#xA;     (t&#xA;      ;; no file name is given&#xA;      (if (use-region-p)&#xA;          (progn (setq start (region-beginning))&#xA;                 (setq end (region-end)) )&#xA;        (progn (setq start (point-min))&#xA;               (setq end (point-max)) )  )&#xA;      )&#xA;     )&#xA;&#xA;    ;; applying basic processing to what ever is given:&#xA;    (basic-processing start end)&#xA;    )&#xA;&#xA;  ;; if it has been file -- save and close it:&#xA;  (when file-is-given?&#xA;    (save-buffer)&#xA;    (kill-buffer)&#xA;    )&#xA;&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastActivityDate="2015-12-24T09:17:55.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19061" PostTypeId="1" CreationDate="2015-12-24T09:18:09.390" Score="1" ViewCount="426" Body="&lt;p&gt;Not sure what's going on here. This is my capture template:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (&quot;j&quot; &quot;Capture RSS to Incoming&quot;&#xA;   entry&#xA;   (file+headline &quot;~/Org/jay.org&quot; &quot;Incoming&quot;)&#xA;   &quot;* %c :RSS:\n%(org-link-unescape \&quot;%i\&quot;)&quot;&#xA;   :immediate-finish t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call it with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-protocol-capture &quot;j/aaa/bbb/cccddd&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get what I'd expect, a line like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* [[aaa][bbb]] :RSS:&#xA;  cccddd&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when I call it with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-protocol-capture &quot;j/aaa/bbb/ccc%0Addd&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;byte-code: Capture abort: (end-of-file)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So somehow it seems it does not like the initial content, %i, to have multiple lines.&#xA;Can anyone clue me in to what I'm doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2018-06-30T02:06:11.843" Title="Can org protocol capture have multiline content" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19062" PostTypeId="1" AcceptedAnswerId="19063" CreationDate="2015-12-24T12:44:39.600" Score="2" ViewCount="477" Body="&lt;p&gt;Is it possible to view all errors? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;flycheck-list-errors&lt;/code&gt; only show errors for current buffer&lt;/p&gt;&#xA;" OwnerUserId="10526" LastActivityDate="2015-12-24T16:31:49.243" Title="How to view the errors from all buffers?" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19063" PostTypeId="2" ParentId="19062" CreationDate="2015-12-24T16:31:49.243" Score="2" Body="&lt;p&gt;No that is not possible, and we do not plan to add this feature to Flycheck itself.  We think that it is beyond Flycheck's scope, and we believe that it's the task of a build system or a CI to provide an overview over the entire &quot;project&quot;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm sorry but you have to write this feature yourself.  You would add a hook for &lt;code&gt;flycheck-mode&lt;/code&gt;, which in turn adds a local hook to &lt;code&gt;flycheck-after-syntax-check-hook&lt;/code&gt;.  In this local you you would simply collect all &lt;code&gt;flycheck-errors&lt;/code&gt; of the current buffer, and add them to a buffer in Tabulated List Mode.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2015-12-24T16:31:49.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19064" PostTypeId="2" ParentId="18742" CreationDate="2015-12-24T17:45:57.040" Score="4" Body="&lt;p&gt;If you're using emacsclient, opening files with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will open a new frame for each file. Not sure how this would work on OS X, but in XFCE I can set such a command for a filetype.&lt;/p&gt;&#xA;" OwnerUserId="10585" LastActivityDate="2015-12-24T17:45:57.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19065" PostTypeId="1" CreationDate="2015-12-24T18:01:29.443" Score="4" ViewCount="205" Body="&lt;p&gt;In the magit-status window Magit shows '^M&quot; for many things. This is on FreeBSD, which should be using newlines instead:&lt;a href=&quot;https://i.stack.imgur.com/nCBWl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nCBWl.png&quot; alt=&quot;Shot of magit-status&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is, I think, the reason the push doesn't work right. From the magit-process buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;git … push -v origin master^M:refs/heads/master&lt;/p&gt;&#xA;" OwnerUserId="10591" LastActivityDate="2016-04-17T12:05:19.723" Title="Magit appends '^M' (return) characters to git results" Tags="|magit|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19066" PostTypeId="2" ParentId="19035" CreationDate="2015-12-24T18:52:39.370" Score="3" Body="&lt;p&gt;So here's the code that I ended up writing (before I saw the answers here):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (let ((prev-frame (selected-frame)))&#xA;;; select-frame-by-name returns nil if the frame exists and can be selected, but just throws an&#xA;;; error if it doesn't exist without a return value. &#xA;(if (condition-case nil&#xA;        (select-frame-by-name &quot;COMPILATION MONITOR&quot;)&#xA;      (error t))&#xA;    (progn&#xA;      (make-frame '((name . &quot;COMPILATION MONITOR&quot;)&#xA;                    (width . 96)&#xA;                    (height . 30)&#xA;                    (minibuffer . nil)&#xA;                    (font . &quot;-outline-Gill Sans MT-normal-normal-normal-sans-11-*-*-*-p-*-iso8859-1&quot;)&#xA;                    (top . 1486)&#xA;                    (left + -2250)&#xA;                    (menu-bar-lines 0)))&#xA;&#xA;      ;; The *monitor* buffer is either acquired or created if it doesn't already exist, and dedicated&#xA;      ;; to the compilation frame.&#xA;      (modify-frame-parameters (select-frame-by-name &quot;COMPILATION MONITOR&quot;) '((top . 1486)))&#xA;      (dedicate-window (display-buffer-use-some-frame (get-buffer-create &quot;*monitor*&quot;) '((name . &quot;COMPILATION MONITOR&quot;))) t ))&#xA;  )&#xA;(raise-frame prev-frame))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By catching the error that select-frame-by-name throws when it can't find a frame and throwing 't' back (since 'nil' is returned when it DOES find the frame and raises it) I can use it as a condition. I'm not trying to open any files in the frame--it's meant to display exactly one buffer all the time, and no other frame should ever have the same name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I've selected one of the other answers as the 'correct' one since it's more generally correct, as opposed to my one-off solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Interesting side-note: for some reason, when I make the frame, it ignores the 'top' parameter, but obeys everything else. That's why I modify-frame-parameters to set the top again.)&lt;/p&gt;&#xA;" OwnerUserId="8254" LastEditorUserId="8254" LastEditDate="2015-12-24T19:14:56.093" LastActivityDate="2015-12-24T19:14:56.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19067" PostTypeId="2" ParentId="19033" CreationDate="2015-12-24T20:44:41.147" Score="1" Body="&lt;p&gt;I believe I understand. Your &lt;code&gt;files-dir&lt;/code&gt; is contained in &lt;code&gt;load-path&lt;/code&gt;. When Tramp is loaded, Emacs finds the  file &lt;code&gt;tramp&lt;/code&gt; in this directory and tries to load it instead of &lt;code&gt;tramp.el&lt;/code&gt; in its original directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Give that file another name but &lt;code&gt;tramp&lt;/code&gt; or &lt;code&gt;tramp.el&lt;/code&gt;, or locate it in another directory, which is not covered by &lt;code&gt;load-path&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2015-12-24T20:44:41.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19068" PostTypeId="1" CreationDate="2015-12-24T22:52:14.290" Score="0" ViewCount="127" Body="&lt;p&gt;At my work (Windows 7), we don't have access to elpa or melpa, but we have a network drive which contains emacs packages that have been manually downloaded and approved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using code similar to the following (heavily based on &lt;a href=&quot;https://emacs.stackexchange.com/a/17408/5142&quot;&gt;https://emacs.stackexchange.com/a/17408/5142&lt;/a&gt;) Emacs users are able to have a MELPA-like experience.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(setq myelpa-msde &quot;//network/fsf/emacs-plugins/&quot;&#xA;      myelpa (expand-file-name &quot;myelpa/&quot; user-emacs-directory)&#xA;      package-archives `((&quot;myelpa&quot; . ,myelpa))&#xA;      use-package-always-ensure t)&#xA;(package-initialize)&#xA;(unless (file-exists-p myelpa)&#xA;  (require 'package-x)&#xA;  (setq package-archive-upload-base myelpa)&#xA;  (mkdir myelpa)&#xA;  (dolist (file (directory-files myelpa-msde 'fqn &quot;\\.*[.]\\(el\\|tar\\)&quot;))&#xA;    (message &quot;Preparing %s&quot; file)&#xA;    (package-upload-file file)&#xA;    (when (string= (file-name-extension file) &quot;tar&quot;)&#xA;      (copy-file file myelpa 'force)))&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;(require 'use-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, look at that again&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (when (string= (file-name-extension file) &quot;tar&quot;)&#xA;      (copy-file file myelpa 'force)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;without this hack, any tar file that gets uploaded to the &quot;myelpa&quot; local repository is corrupt (it seems to be a file containing just the directory listing of the original tar). The package index is updated correctly, so I was able to apply this workaround by just force copying the tarball again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug in Emacs or am I doing it wrong? According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Package-Archives.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Package-Archives.html&lt;/a&gt; I would have thought this would be considered a &quot;multi file package&quot; and just work.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2018-03-23T23:51:54.640" Title="correct usage of package-upload-file for multi-file package?" Tags="|package|package-repositories|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19069" PostTypeId="1" CreationDate="2015-12-24T23:40:56.313" Score="1" ViewCount="225" Body="&lt;p&gt;It seems &lt;code&gt;helm-mini&lt;/code&gt; places the currently open buffer on the bottom of the &lt;code&gt;Buffers&lt;/code&gt; list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I have a two splits and &lt;code&gt;test.txt&lt;/code&gt; is open in one of them. Sometimes I want to open &lt;code&gt;test.txt&lt;/code&gt; in the current split, and when I do &lt;code&gt;helm-mini&lt;/code&gt;, the &lt;code&gt;test.txt&lt;/code&gt; is on the bottom of the list (even though it is the most recently opened one), which makes selecting that file inconvenient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there is any way to put it on the top of the list - or at least in the order of recency. It seems like &lt;code&gt;helm-mini&lt;/code&gt; sorts buffers in the most recent order, except the currently visible one in one of the splits.&lt;/p&gt;&#xA;" OwnerUserId="6807" LastEditorUserId="6807" LastEditDate="2015-12-25T01:04:00.750" LastActivityDate="2016-08-23T10:55:58.270" Title="Make the most recently open currently open buffer on top of the Buffers list with helm-mini" Tags="|helm|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19070" PostTypeId="1" AcceptedAnswerId="20609" CreationDate="2015-12-25T08:05:20.913" Score="1" ViewCount="95" Body="&lt;p&gt;[Reposted here after a comment from wilx on stackoverflow.com]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following snippet of C++ code, indented using cc-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;auto good1 = f(a,&#xA;               {1, 2});   // ((arglist-cont-nonempty 1 15))&#xA;auto bad1 = f&amp;lt;1&amp;gt;(a,&#xA;  {1, 2});                // ((inexpr-statement) (block-open 36))&#xA;&#xA;auto good2 = f(a,&#xA;               b,         // ((arglist-cont-nonempty 68 82))&#xA;               {1, 2});   // ((arglist-cont-nonempty 68 82))&#xA;auto bad2 = f&amp;lt;1&amp;gt;(a,&#xA;                 b        // ((arglist-cont-nonempty 114 130))&#xA;  {1, 2});                // ((inexpr-statement) (block-open 114))&#xA;&#xA;auto good3 = f(a,&#xA;               b,         // ((arglist-cont-nonempty 151 165))&#xA;               {1, 2},    // ((arglist-cont-nonempty 151 165))&#xA;               c);&#xA;&#xA;auto bad3 = f&amp;lt;3&amp;gt;(a,&#xA;                 b,       // ((arglist-cont-nonempty 209 225))&#xA;  {1, 2},                 // ((inexpr-statement) (block-open 209))&#xA;                 c);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the curly-bracket-arguments &lt;code&gt;{1, 2}&lt;/code&gt; are not indented properly when occurring in a templated function call. This is due to them being wrongly labelled as &lt;code&gt;((inexpr-statement) (block-open X))&lt;/code&gt; rather than &lt;code&gt;((arglist-cont-nonempty Y Z))&lt;/code&gt; (the exact offsets may be different, I edited the comments after using &lt;code&gt;C-c C-s&lt;/code&gt; to get the syntactic labels).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know how one can fix this? I tried the newest version of CC-Mode (5.32.5) specifically downloaded from Sourceforge as well as the default versions coming with Debian and Ubuntu, but all of them get this wrong.&lt;/p&gt;&#xA;" OwnerUserId="10593" LastActivityDate="2016-08-28T14:23:42.873" Title="CC-Mode doesn't indent arguments to templated functions starting with a curly bracket" Tags="|indentation|cc-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19071" PostTypeId="1" CreationDate="2015-12-25T10:00:12.387" Score="1" ViewCount="1989" Body="&lt;p&gt;I'm using evil-leader and bind the leader key to &lt;code&gt;&amp;lt;SPC&amp;gt;&lt;/code&gt;. Evil-leader config follows after evil-mode in .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Sometimes when I hits &lt;code&gt;&amp;lt;SPC&amp;gt;&lt;/code&gt;, it uses default forward char of evil-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added this line to unset the key.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;SPC&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It still doesn't help. So I &lt;code&gt;M-x&lt;/code&gt; + evil-leader-mode every time the problem occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My full code is as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; evil-mode&#xA;(evil-mode t)    &#xA;&#xA;(require 'evil-leader)&#xA;(global-evil-leader-mode)&#xA;(setq evil-leader/in-all-states 1)&#xA;;; unbind evil dafault SPC of forward char&#xA;(define-key evil-normal-state-map (kbd &quot;SPC&quot;) nil)&#xA;(evil-leader/set-leader &quot;&amp;lt;SPC&amp;gt;&quot;)&#xA;(evil-leader/set-key&#xA;  &quot;f&quot; 'helm-find-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10594" LastEditorUserId="253" LastEditDate="2016-03-11T21:38:35.307" LastActivityDate="2016-06-10T02:55:57.487" Title="Disable default key binding in evil mode for evil leader" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19072" PostTypeId="1" CreationDate="2015-12-25T11:04:03.257" Score="3" ViewCount="2130" Body="&lt;p&gt;I use &lt;code&gt;company&lt;/code&gt; for completion, and it's fast and efficient in OCaml, Tuareg, and Merlin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is very slow in my C project.  For example, it takes more than 10 seconds when it suggests completions for structure, during which I cannot do anything in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of structure I use in my project :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;typedef struct {&#xA;  char name[D_NAME_MAXLEN];      /**&amp;lt; name of the disk */&#xA;  uint32_t size;   /**&amp;lt; size of the disk */&#xA;  uint32_t npart;   /**&amp;lt; number of partitions */&#xA;  uint32_t part[D_PARTMAX];    /**&amp;lt; parition sizes */&#xA;} d_stat;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I have a d_stat pointer caled d_stat and after typing typing &lt;code&gt;dstat-&amp;gt;&lt;/code&gt; it stops for a looong long time, even sometimes it bugs...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same thing with the macros, I have some macros :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;OPT_SIZE&#xA;OPT_LONG_SIZE&#xA;OPT_FORCE&#xA;OPT_LONG_FORCE&#xA;OPT_NAME&#xA;OPT_LONG_NAME&#xA;etc...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when I type OPT_ it stops like above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I speed up &lt;code&gt;company&lt;/code&gt; completion when it gets this slow?  Right now, it is not usable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;(global-company-mode)&lt;/code&gt; in my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tree of the project looks like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;syscp&#xA;├── bin&#xA;│   ├── disk.tfs&#xA;│   ├── libll.so&#xA;│   ├── libtfs.so&#xA;│   ├── tfs_analyze&#xA;│   ├── tfs_create&#xA;│   ├── tfs_format&#xA;│   └── tfs_partition&#xA;├── dev&#xA;│   └── device.tfs&#xA;├── disk.tfs&#xA;├── doc&#xA;│   └── config&#xA;├── ld&#xA;├── lib&#xA;│   ├── block0.h&#xA;│   ├── block.c&#xA;│   ├── block.h&#xA;│   ├── error.c&#xA;│   ├── error.h&#xA;│   ├── ll.c&#xA;│   ├── ll.h&#xA;│   ├── tfs.c&#xA;│   ├── tfs.h&#xA;│   ├── utils.c&#xA;│   └── utils.h&#xA;├── Makefile&#xA;├── obj&#xA;│   ├── block.o&#xA;│   ├── error.o&#xA;│   ├── libblock.o&#xA;│   ├── liberror.o&#xA;│   ├── libll.o&#xA;│   ├── libtfs.o&#xA;│   ├── ll.o&#xA;│   └── utils.o&#xA;├── README&#xA;├── setup.sh&#xA;└── src&#xA;    ├── default.h&#xA;    ├── tfs_analyze.c&#xA;    ├── tfs_create.c&#xA;    ├── tfs_format.c&#xA;    └── tfs_partition.c&#xA;&#xA;7 directories, 39 files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="9790" LastEditDate="2015-12-27T09:32:03.637" LastActivityDate="2015-12-27T09:32:03.637" Title="Company completion very slow" Tags="|company-mode|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19073" PostTypeId="1" AcceptedAnswerId="19074" CreationDate="2015-12-25T11:09:02.107" Score="7" ViewCount="3351" Body="&lt;p&gt;Org-mode code evaluation seems to be a great tool for literate programming. Unfortunately, I couldn't find many examples on that online. I would like to pass variables (in my case python) between code blocks &lt;em&gt;without&lt;/em&gt; the use of the session argument in the header. I know that using sessions you can do it, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session sample :results none&#xA;x = 12&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :results output :session sample&#xA;print 'x=' + str(x)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to pass variables by using the &quot;var&quot; header argument?&lt;/p&gt;&#xA;" OwnerUserId="10595" LastActivityDate="2015-12-25T14:52:56.213" Title="Org-mode: Passing variables between code blocks without sessions" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19074" PostTypeId="2" ParentId="19073" CreationDate="2015-12-25T14:52:56.213" Score="8" Body="&lt;p&gt;If you name the block you can use its output as input into another block using the &lt;code&gt;:var variable=block_name&lt;/code&gt; option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: first_block&#xA;#+BEGIN_SRC python&#xA;x = 12&#xA;return x&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :var x=first_block&#xA;return int(x)+1&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second block will always get &lt;code&gt;x&lt;/code&gt; as a &lt;em&gt;string&lt;/em&gt; when the first block returns a basic types like &lt;code&gt;int&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt; or as a list of tuples if it returns a table.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-12-25T14:52:56.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19075" PostTypeId="1" AcceptedAnswerId="38911" CreationDate="2015-12-25T20:55:52.567" Score="6" ViewCount="1181" Body="&lt;p&gt;When I'm currently in a large project and I call the command&#xA;&lt;code&gt;projectile-regenate-tags&lt;/code&gt;, the project will be scanned by &lt;code&gt;ctags&lt;/code&gt; and the tags will be stored in the &lt;code&gt;TAGS&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While all this action is progressing, Emacs will be unreachable until the tags generation is completed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there are some attempts to make Emacs process asynchronously, or even&#xA;doing it in the background. My knowledge of concurrency is somewhat limited, so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if there is any way that I could call &lt;code&gt;projectile-regenerate-tags&lt;/code&gt;&#xA;and while the tags file being processed, I can do further other things with&#xA;Emacs and the text? If so, what would be a good way to make it so?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2016-08-15T01:20:00.030" LastActivityDate="2020-02-03T13:25:38.343" Title="Regenerate ctags TAGS file without freezing Emacs for a while?" Tags="|projectile|ctags|async|" AnswerCount="1" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="19076" PostTypeId="2" ParentId="5436" CreationDate="2015-12-25T22:45:05.850" Score="3" Body="&lt;p&gt;I know this has been answered already, but incase anybody is interested, I took the &lt;code&gt;org&lt;/code&gt; implementation and played a bit of code golf on it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun plist-merge (&amp;amp;rest plists)&#xA;  &quot;Create a single property list from all PLISTS.&#xA;Inspired by `org-combine-plists'.&quot;&#xA;  (let ((rtn (pop plists)))&#xA;    (dolist (plist plists rtn)&#xA;      (setq rtn (plist-put rtn&#xA;                           (pop plist)&#xA;                           (pop plist))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="5142" LastEditDate="2015-12-25T22:53:34.117" LastActivityDate="2015-12-25T22:53:34.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19077" PostTypeId="1" AcceptedAnswerId="19086" CreationDate="2015-12-25T22:48:13.757" Score="8" ViewCount="812" Body="&lt;p&gt;I made a custom function that combines two functions of &lt;a href=&quot;http://twmode.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;twittering-mode&lt;/a&gt; , &lt;code&gt;twittering-favorite&lt;/code&gt; and &lt;code&gt;twittering-native-retweet&lt;/code&gt;, however these two needs input from me by answering an yes or no question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know if there is a way to wrap those those two functions with something that will make them receive an answer without my direct intervention.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="105" LastEditDate="2016-03-14T17:23:17.837" LastActivityDate="2016-03-14T17:23:17.837" Title="How to programmatically answer &quot;yes&quot; to those commands that prompt for a decision from the user?" Tags="|arguments|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19078" PostTypeId="2" ParentId="18964" CreationDate="2015-12-25T22:48:48.100" Score="0" Body="&lt;p&gt;I have created such one-liner&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f=filename(s).org; diff --unchanged-group-format='' &amp;lt;(grep -i -nH -e  [.]* ${f}) &amp;lt;(pcregrep -v -M -nH -e &quot;^[ \t]+-.*\n +CLOCK&quot; ${f})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is used instead of grep command in &lt;code&gt;grep-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2064" LastActivityDate="2015-12-25T22:48:48.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19079" PostTypeId="2" ParentId="19002" CreationDate="2015-12-25T22:53:30.807" Score="3" Body="&lt;p&gt;The following is the solution from Jordon Biondo at &lt;a href=&quot;https://stackoverflow.com/questions/24397274/writing-php-with-sql-queries-in-emacs/24659949#24659949&quot;&gt;&quot;Writing PHP with SQL queries in emacs&quot;&lt;/a&gt; supplemented by alignment of the first spaces and equal signs.&#xA;You can further adapt the alignment rules in &lt;code&gt;align&lt;/code&gt; to your liking (see the description of the variable &lt;code&gt;align-rules-list&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The packages &lt;code&gt;expand-region&lt;/code&gt; and &lt;code&gt;sql-indent&lt;/code&gt; from MELPA are required. (That is already mentioned at &lt;a href=&quot;https://stackoverflow.com/questions/24397274/writing-php-with-sql-queries-in-emacs/24659949#24659949&quot;&gt;the above link&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution does not exactly follow your specification but it brings some order into the code. Your comments look like you would be satisfied with such a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For aligning an sql-string put the point into the string and call &lt;code&gt;sql-indent-string&lt;/code&gt;. There is a nice video at &lt;a href=&quot;https://stackoverflow.com/questions/24397274/writing-php-with-sql-queries-in-emacs/24659949#24659949&quot;&gt;the above link&lt;/a&gt; that demonstrates the usage.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'expand-region)&#xA;(require 'sql-indent)&#xA;(require 'sqlup-mode)&#xA;(require 'cl-lib)&#xA;(require 'align)&#xA;&#xA;(defcustom sql-indent-string-upcase t&#xA;  &quot;Upcase sql keywords when running `sql-indent-string'.&quot;&#xA;  :type 'boolean&#xA;  :group 'sql-indent)&#xA;&#xA;(defcustom align-sql-indent-rules-list&#xA;  '((space (regexp . &quot;^\\s-*[[:alnum:]]+\\(\\s-+\\)[^[:space:]]&quot;))&#xA;    (equal-sign (regexp . &quot;\\(\\s-*\\)=&quot;) (separate . group)))&#xA;  &quot;Alignment rules for `sql-indent-string'.&quot;&#xA;  :type align-rules-list-type&#xA;  :group 'sql-indent)&#xA;&#xA;(defun sql-indent-string ()&#xA;  &quot;Indents the string under the cursor as SQL.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (er/mark-inside-quotes)&#xA;    (let* ((-tabs (list indent-tabs-mode tab-width tab-stop-list))&#xA;           (text (buffer-substring-no-properties (region-beginning) (region-end)))&#xA;           (pos (region-beginning))&#xA;           (column (progn (goto-char pos) (current-column)))&#xA;           (start-indent (make-string column ?\ ))&#xA;           (formatted-text (with-temp-buffer&#xA;                             (cl-multiple-value-bind&#xA;                                 (indent-tabs-mode  tab-width  tab-stop-list) -tabs&#xA;                               (insert text)&#xA;                               (when sql-indent-string-upcase&#xA;                                 (sqlup-capitalize-keywords-in-region (point-min) (point-max)))&#xA;                               (delete-trailing-whitespace)&#xA;                               (goto-char (point-min))&#xA;                               (sql-indent-buffer)&#xA;                               (align (point-min) (point-max) nil align-sql-indent-rules-list)&#xA;                               (goto-char (point-min))&#xA;                               (while (progn (forward-line) (null (eobp))) (insert start-indent))&#xA;                               (buffer-string)))))&#xA;      (delete-region (region-beginning) (region-end))&#xA;      (goto-char pos)&#xA;      (insert formatted-text))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;UPDATE 1: I have added &lt;code&gt;sqlup-capitalize-keywords-in-region&lt;/code&gt; as response to an additional requirement of Rene stated in the comments below.&#xA;It seems that there is actually no problem with adding this function.&#xA;(sqlup-mode version: 0.5.3)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE 2:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Made the alignment customizable.&lt;/li&gt;&#xA;&lt;li&gt;Group-wise alignment of equal signs.&lt;/li&gt;&#xA;&lt;li&gt;avoid &lt;code&gt;replace-string&lt;/code&gt; since this is intended for interactive use only&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;NOTE: &lt;strong&gt;Once more for clarification: The &lt;a href=&quot;https://stackoverflow.com/questions/24397274/writing-php-with-sql-queries-in-emacs/24659949#24659949&quot;&gt;original code&lt;/a&gt; is from Jordon Biondo. I have just added the alignment stuff that was wanted here.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two (maybe, somewhat extreme) examples how formatted sql strings look like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-php prettyprint-override&quot;&gt;&lt;code&gt;$query = 'SELECT  SUM(T01.foobar)&#xA;          FROM    db_foo.bar T01&#xA;          WHERE   T01.fooIsomeD = 1&#xA;              AND T01.barI      = 2&#xA;              AND T01.foo IS NOT NULL'&#xA;&#xA;$query = 'SELECT  SUM(T01.foobar)&#xA;          FROM    db_foo.bar T01 AND fill IS nil&#xA;          WHERE   T01.fooID           = 1&#xA;              AND T01.barIDuhfsdhufue = 2&#xA;              AND T01.foo IS NOT NULL AND fill IS nil&#xA;              AND t01.bar1zdfjiifajjdijfuheuwihfufheuiwfheufu = 0&#xA;              AND t02.bar2                                    = 1'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some facts can be recognized from this example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There is some context-sensitive indentation through &lt;code&gt;sql-indent&lt;/code&gt; (see the &lt;code&gt;AND&lt;/code&gt; operator).&lt;/li&gt;&#xA;&lt;li&gt;The second token on a line is aligned.&lt;/li&gt;&#xA;&lt;li&gt;Keywords are up-cased.&lt;/li&gt;&#xA;&lt;li&gt;Equal signs are aligned in groups.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is not exactly what the original poster wanted but I hope it satisfies the requirements.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2015-12-27T19:48:23.897" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19080" PostTypeId="1" CreationDate="2015-12-26T00:50:49.363" Score="3" ViewCount="1098" Body="&lt;p&gt;I don't like the behavior of compilation-goto-locus (bound to Enter in a *compilation* or *grep* buffer), where it splits the window and jumps to the line in a new window. I prefer the *compilation*/*grep* buffer to be entirely replaced. I've accomplished this by copy-pasting the whole definition of compilation-goto-locus into my init.el from compile.el, and commenting out the behavior I don't like. It looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'compile)&#xA;&#xA;(defun compilation-goto-locus (msg mk end-mk)&#xA;  &quot;Jump to an error corresponding to MSG at MK.&#xA;All arguments are markers.  If END-MK is non-nil, mark is set there&#xA;and overlay is highlighted between MK and END-MK.&quot;&#xA;  ;; Show compilation buffer in other window, scrolled to this error.&#xA;  (let* ((from-compilation-buffer (eq (window-buffer)&#xA;                                      (marker-buffer msg)))&#xA;         ;; Use an existing window if it is in a visible frame.&#xA;         (pre-existing (get-buffer-window (marker-buffer msg) 0))&#xA;         (w (if (and from-compilation-buffer pre-existing)&#xA;                ;; Calling display-buffer here may end up (partly) hiding&#xA;                ;; the error location if the two buffers are in two&#xA;                ;; different frames.  So don't do it if it's not necessary.&#xA;                pre-existing&#xA;          (display-buffer (marker-buffer msg) '(nil (allow-no-window . t)))))&#xA;     (highlight-regexp (with-current-buffer (marker-buffer msg)&#xA;                 ;; also do this while we change buffer&#xA;                 (goto-char (marker-position msg))&#xA;                 (and w (compilation-set-window w msg))&#xA;                 compilation-highlight-regexp)))&#xA;    ;; Ideally, the window-size should be passed to `display-buffer'&#xA;    ;; so it's only used when creating a new window.&#xA;    (when (and (not pre-existing) w)&#xA;      (compilation-set-window-height w))&#xA;&#xA;;; I commented out this code&#xA;&#xA;;;    (if from-compilation-buffer&#xA;;;        ;; If the compilation buffer window was selected,&#xA;;;        ;; keep the compilation buffer in this window;&#xA;;;        ;; display the source in another window.&#xA;;;        (let ((pop-up-windows t))&#xA;;;          (pop-to-buffer (marker-buffer mk) 'other-window))&#xA;;;      (switch-to-buffer (marker-buffer mk)))&#xA;&#xA;;; and replaced it with this line&#xA;&#xA;    (switch-to-buffer (marker-buffer mk))&#xA;&#xA;&#xA;    (unless (eq (goto-char mk) (point))&#xA;      ;; If narrowing gets in the way of going to the right place, widen.&#xA;      (widen)&#xA;      (if next-error-move-function&#xA;      (funcall next-error-move-function msg mk)&#xA;    (goto-char mk)))&#xA;    (if end-mk&#xA;        (push-mark end-mk t)&#xA;      (if mark-active (setq mark-active)))&#xA;    ;; If hideshow got in the way of&#xA;    ;; seeing the right place, open permanently.&#xA;    (dolist (ov (overlays-at (point)))&#xA;      (when (eq 'hs (overlay-get ov 'invisible))&#xA;        (delete-overlay ov)&#xA;        (goto-char mk)))&#xA;&#xA;    (when highlight-regexp&#xA;      (if (timerp next-error-highlight-timer)&#xA;      (cancel-timer next-error-highlight-timer))&#xA;      (unless compilation-highlight-overlay&#xA;    (setq compilation-highlight-overlay&#xA;          (make-overlay (point-min) (point-min)))&#xA;    (overlay-put compilation-highlight-overlay 'face 'next-error))&#xA;      (with-current-buffer (marker-buffer mk)&#xA;    (save-excursion&#xA;      (if end-mk (goto-char end-mk) (end-of-line))&#xA;      (let ((end (point)))&#xA;        (if mk (goto-char mk) (beginning-of-line))&#xA;        (if (and (stringp highlight-regexp)&#xA;             (re-search-forward highlight-regexp end t))&#xA;        (progn&#xA;          (goto-char (match-beginning 0))&#xA;          (move-overlay compilation-highlight-overlay&#xA;                (match-beginning 0) (match-end 0)&#xA;                (current-buffer)))&#xA;          (move-overlay compilation-highlight-overlay&#xA;                (point) end (current-buffer)))&#xA;        (if (or (eq next-error-highlight t)&#xA;            (numberp next-error-highlight))&#xA;        ;; We want highlighting: delete overlay on next input.&#xA;        (add-hook 'pre-command-hook&#xA;              'compilation-goto-locus-delete-o)&#xA;          ;; We don't want highlighting: delete overlay now.&#xA;          (delete-overlay compilation-highlight-overlay))&#xA;        ;; We want highlighting for a limited time:&#xA;        ;; set up a timer to delete it.&#xA;        (when (numberp next-error-highlight)&#xA;          (setq next-error-highlight-timer&#xA;            (run-at-time next-error-highlight nil&#xA;                 'compilation-goto-locus-delete-o)))))))&#xA;    (when (and (eq next-error-highlight 'fringe-arrow))&#xA;      ;; We want a fringe arrow (instead of highlighting).&#xA;      (setq next-error-overlay-arrow-position&#xA;        (copy-marker (line-beginning-position))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my question is: is there a better way to accomplish this? It seems tricky, because the behavior is controlled by the pop-up-windows variable, which the commented out code is explicitly resetting.&lt;/p&gt;&#xA;" OwnerUserId="9459" LastEditorUserId="105" LastEditDate="2016-03-14T17:22:15.760" LastActivityDate="2017-01-09T01:57:26.797" Title="Is there a better way to override opening window in compilation-goto-locus?" Tags="|window|window-splitting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19082" PostTypeId="1" CreationDate="2015-12-26T01:45:07.277" Score="2" ViewCount="643" Body="&lt;h2&gt;background&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I had elisp code (in this &lt;a href=&quot;https://bitbucket.org/tlroche/elisp_bulk_replacement&quot; rel=&quot;nofollow noreferrer&quot;&gt;very small &lt;code&gt;git&lt;/code&gt; repo&lt;/a&gt;) like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun bulk-replace-file (filepath)&#xA;  (interactive &quot;FPath to file to bulk-replace: &quot;)&#xA;  (bulk-replace-file-non-interactive filepath)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That worked. Then I decided to parameterize the prompt, producing code like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst BULK-REPLACE-FILEPATH-PROMPT &quot;Path to file to bulk-replace: &quot;)&#xA;&#xA;(defun bulk-replace-file (filepath)&#xA;;  (interactive &quot;FPath to file to bulk-replace: &quot;) ; should always work&#xA;  (interactive (concat &quot;F&quot; BULK-REPLACE-FILEPATH-PROMPT))&#xA;  (bulk-replace-file-non-interactive filepath)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However that fails with (in &lt;code&gt;*Messages*&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;command-execute: Wrong type argument: listp, &quot;FPath to file to bulk-replace: &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which frankly stuns me, esp since I'm positive this code formerly worked, but that's why one does regression testing &lt;code&gt;:-(&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;questions&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How is &lt;code&gt;(interactive)&lt;/code&gt; getting a list from &lt;code&gt;&quot;FPath to file to bulk-replace: &quot;&lt;/code&gt;, given that the latter surely &lt;em&gt;looks&lt;/em&gt; like a string? Am I missing something?&lt;/li&gt;&#xA;&lt;li&gt;Why is &lt;code&gt;(interactive)&lt;/code&gt; &lt;em&gt;not&lt;/em&gt; getting a list from &lt;code&gt;(concat &quot;F&quot; BULK-REPLACE-FILEPATH-PROMPT)&lt;/code&gt;, given that&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(concat &quot;F&quot; BULK-REPLACE-FILEPATH-PROMPT)&lt;/code&gt; returns a string (I have checked with &lt;code&gt;(type-of)&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(concat &quot;F&quot; BULK-REPLACE-FILEPATH-PROMPT)&lt;/code&gt; == &lt;code&gt;&quot;FPath to file to bulk-replace: &quot;&lt;/code&gt; (per the error message above)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(interactive &quot;FPath to file to bulk-replace: &quot;)&lt;/code&gt; works (see first code snippet)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;What's &quot;the right way&quot; to parameterize a prompt used for &lt;code&gt;(interactive)&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;über-answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Given that, as &lt;a href=&quot;https://emacs.stackexchange.com/users/105/drew&quot;&gt;Drew&lt;/a&gt; points out, &lt;code&gt;(interactive)&lt;/code&gt; is &lt;a href=&quot;https://emacs.stackexchange.com/a/19083/5444&quot;&gt;quite demanding&lt;/a&gt;, an easier (and working) way to achieve the desired functionality avoids prompting via &lt;code&gt;(interactive)&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defconst BULK-REPLACE-FILEPATH-PROMPT &quot;Path to file to bulk-replace: &quot;)&#xA;&#xA;(defun bulk-replace-file ()&#xA;  (interactive) ; Purely to enable `M-x`: let `read-file-name` get the filepath&#xA;  (bulk-replace-file-non-interactive&#xA;    (read-file-name BULK-REPLACE-FILEPATH-PROMPT)))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-26T03:52:49.343" Title="how to parameterize prompt for interactive/command?" Tags="|interactive|string|list|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19083" PostTypeId="2" ParentId="19082" CreationDate="2015-12-26T02:09:53.643" Score="1" Body="&lt;p&gt;&lt;code&gt;interactive&lt;/code&gt; is a special form, not a function.  As such, it need not handle its argument as would an ordinary function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;interactive&lt;/code&gt; expects a &lt;strong&gt;literal&lt;/strong&gt; string as argument, or else a sexp that is evaluated to produce the list of arguments for the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the argument is a literal string then the various &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html&quot; rel=&quot;nofollow&quot;&gt;interactive codes&lt;/a&gt; apply. In other words, the string has special formatting, with certain codes (first char and first char after each newline char (&lt;code&gt;\n&lt;/code&gt;) in the string that are interpreted to produce the list of arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the argument is a sexp then it must do &lt;em&gt;everything&lt;/em&gt; to come up with the correct list of arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you could use a sexp, but it would need to do two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Construct the prompt -- you know how to do that, using &lt;code&gt;concat&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use the prompt to read and return a file name.  For that, you need to use a function such as &lt;code&gt;read-file-name&lt;/code&gt; (which expects a prompt-string argument).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Put the file name in a list.  (&lt;code&gt;interactive&lt;/code&gt; must return a &lt;strong&gt;list&lt;/strong&gt; of all arguments.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(interactive (list (read-file-name BULK-REPLACE-FILEPATH-PROMPT)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&quot; rel=&quot;nofollow&quot;&gt;Using Interactive&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is almost always best to &lt;strong&gt;ask Emacs first&lt;/strong&gt;.  In this case, in the Elisp manual, use &lt;code&gt;i interactive RET&lt;/code&gt; to get information about &lt;code&gt;interactive&lt;/code&gt;, including the answer to this very question.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2015-12-26T03:52:49.343" LastActivityDate="2015-12-26T03:52:49.343" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19084" PostTypeId="2" ParentId="19006" CreationDate="2015-12-26T02:18:03.353" Score="3" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foobar ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (call-interactively 'move-end-of-line)&#xA;    (search-backward-regexp &quot;^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?class\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)&quot;)&#xA;    (let ((ret (match-string 1)))&#xA;      (message ret)&#xA;      ret)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the cursor is inside a class definition then calling &lt;code&gt;foobar&lt;/code&gt; gives the class name.&lt;/p&gt;&#xA;" OwnerUserId="2064" LastEditorUserId="2064" LastEditDate="2015-12-26T23:44:10.460" LastActivityDate="2015-12-26T23:44:10.460" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19085" PostTypeId="2" ParentId="17862" CreationDate="2015-12-26T03:10:01.177" Score="1" Body="&lt;p&gt;One workaround I've been using is to trigger a local shell on the remote host for visual commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd /ssh:myuser@myhost:/&#xA;*ssh localhost &quot;top&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The * ensures eshell does not use any built-in commands when available. Of course ssh-agent running on the &lt;strong&gt;remote host&lt;/strong&gt; will help with pwd-less interactions.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2015-12-26T03:10:01.177" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19086" PostTypeId="2" ParentId="19077" CreationDate="2015-12-26T06:50:10.873" Score="7" Body="&lt;p&gt;EDIT:&#xA;As @hatschipuh pointed out in the comments, an &lt;code&gt;flet&lt;/code&gt;-type construction is more straightforward and doesn't rely on my idiosyncratic advice macro.  At least on my Emacs (24.5.1), &lt;code&gt;cl-flet&lt;/code&gt; uses lexical scoping, so you'll need the &lt;code&gt;noflet&lt;/code&gt; package for the following snippet to work.  Scroll down for the original, idiosyncratic answer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/bypass-confirmation (function &amp;amp;rest args)&#xA;  &quot;Call FUNCTION with ARGS, bypassing all `y-or-n-p' prompts.&quot;&#xA;  (require 'noflet)&#xA;  (noflet&#xA;      ((y-or-n-p (prompt) t))&#xA;    (apply function args)))&#xA;&#xA;(defun my/bypass-confirmation-all (function &amp;amp;rest args)&#xA;  &quot;Call FUNCTION with ARGS, bypassing all prompts.&#xA;This includes both `y-or-n-p' and `yes-or-no-p'.&quot;&#xA;  (require 'noflet)&#xA;  (noflet&#xA;      ((y-or-n-p    (prompt) t)&#xA;       (yes-or-no-p (prompt) t))&#xA;    (apply function args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: This is the original answer, except that I fixed &lt;code&gt;my/bypass-confirmation-all&lt;/code&gt; to work as advertised and changed the calling conventions a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a general wrapper that should work for any function.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/bypass-confirmation (function &amp;amp;rest args)&#xA;  &quot;Call FUNCTION with ARGS, bypassing all `y-or-n-p' prompts.&quot;&#xA;  (my/with-advice&#xA;      ((#'y-or-n-p :override (lambda (prompt) t)))&#xA;    (apply function args)))&#xA;&#xA;(defun my/bypass-confirmation-all (function &amp;amp;rest args)&#xA;  &quot;Call FUNCTION with ARGS, bypassing all prompts.&#xA;This includes both `y-or-n-p' and `yes-or-no-p'.&quot;&#xA;  (my/with-advice&#xA;      ((#'y-or-n-p    :override (lambda (prompt) t))&#xA;       (#'yes-or-no-p :override (lambda (prompt) t)))&#xA;    (apply function args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code depends on this macro, which seems to be my go-to solution for everything on Stackexchange.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my/with-advice (adlist &amp;amp;rest body)&#xA;  &quot;Execute BODY with temporary advice in ADLIST.&#xA;&#xA;Each element of ADLIST should be a list of the form&#xA;  (SYMBOL WHERE FUNCTION [PROPS])&#xA;suitable for passing to `advice-add'.  The BODY is wrapped in an&#xA;`unwind-protect' form, so the advice will be removed even in the&#xA;event of an error or nonlocal exit.&quot;&#xA;  (declare (debug ((&amp;amp;rest (&amp;amp;rest form)) body))&#xA;           (indent 1))&#xA;  `(progn&#xA;     ,@(mapcar (lambda (adform)&#xA;                 (cons 'advice-add adform))&#xA;               adlist)&#xA;     (unwind-protect (progn ,@body)&#xA;       ,@(mapcar (lambda (adform)&#xA;                   `(advice-remove ,(car adform) ,(nth 2 adform)))&#xA;                 adlist))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whether this code is the smartest way to handle this situation, I don't know.  In general, I like using this sort of temporary advice to make modifications of existing functions instead of duplicating the original functions' code, in part because it helps to future-proof your modified function against unrelated changes in the original.  But in this case you may need to take additional care, because if &lt;code&gt;twittering-mode&lt;/code&gt; updates and changes the prompts or adds an additional one, you won't see the changes.  Since a y-or-n prompt indicates a controversial choice, that could have unfortunate consequences.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: It occurred to me that an example of use might be helpful.  This example works with either implementation.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/twittering-function ()&#xA;  ;; This will bypass `y-or-n-p' in both commands.&#xA;  (my/bypass-confirmation #'twittering-favorite arg)&#xA;  (my/bypass-confirmation #'twittering-native-retweet)&#xA;  ;; This will bypass both `y-or-n-p' and `yes-or-no-p' in this command.&#xA;  (my/bypass-confirmation-all #'twittering-favorite arg)&#xA;  ;; Prompts in this call are not bypassed.&#xA;  (twittering-native-retweet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2015-12-28T15:55:39.140" LastActivityDate="2015-12-28T15:55:39.140" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19087" PostTypeId="2" ParentId="19080" CreationDate="2015-12-26T07:47:33.500" Score="0" Body="&lt;p&gt;I've developed some machinery using temporary advice that should accomplish what you want.  Notice that if you replace &lt;code&gt;pop-to-buffer&lt;/code&gt; in the code you commented out with &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt;, everything should work like you want it to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this should do what you want, but be aware that I've done only the most cursory testing.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/compilation-goto-locus (msg mk end-mk)&#xA;  &quot;As `compilation-goto-locus', but open in same window.&quot; &#xA;  (my/with-advice&#xA;      ((:once #'pop-to-buffer :override&#xA;              (lambda (buffer &amp;amp;optional action norecord)&#xA;                (pop-to-buffer-same-window buffer norecord))))&#xA;    (compilation-goto-locus msg mk end-mk)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the macro doing the heavy lifting:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)           ; For `cl-destructuring-bind', `cl-gensym'&#xA;&#xA;(defmacro my/with-advice (adlist &amp;amp;rest body)&#xA;  &quot;Execute BODY with temporary advice in ADLIST.&#xA;&#xA;Each element of ADLIST should be a list of the form&#xA;  ([OPTION] SYMBOL WHERE FUNCTION [PROPS]).&#xA;Here SYMBOL, WHERE, FUNCTION, and PROPS are as in `advice-add', and&#xA;OPTION is a keyword modifying how the advice should be handled.  At&#xA;present, the following keywords are recognized, with the specified&#xA;effects:&#xA;&#xA;:once&#xA;This keyword indicates that the advice should be applied using&#xA;`my/advice-once' so that it is executed at most once.&#xA;&#xA;The BODY is wrapped in an `unwind-protect' form, so the advice&#xA;will be removed even in the event of an error or nonlocal exit.&quot;&#xA;  (declare (debug ((&amp;amp;rest (&amp;amp;rest form)) body))&#xA;           (indent 1))&#xA;  (let ((removal-list nil))&#xA;    `(progn&#xA;       ,@(mapcar&#xA;          (lambda (adform)&#xA;            (let ((option (if (keywordp (car adform)) (pop adform) nil)))&#xA;              (cl-destructuring-bind&#xA;                  (symbol where function &amp;amp;optional props) adform&#xA;                (cond&#xA;                 ((null option)&#xA;                  (push `(advice-remove ,symbol ,function) removal-list)&#xA;                  (cons 'advice-add adform))&#xA;&#xA;                 ((eq option :once)&#xA;                  (push `(advice-remove ,symbol ,function) removal-list)&#xA;                  (cons 'my/advice-once adform))))))&#xA;          adlist) &#xA;       (unwind-protect (progn ,@body)&#xA;         ,@removal-list))))&#xA;&#xA;(defun my/advice-once (symbol where function &amp;amp;optional props)&#xA;  &quot;As `advice-add', but remove advice after first call.&#xA;&#xA;This can be useful to avoid infinite recursion, in the event that&#xA;FUNCTION calls the function named by SYMBOL directly.&quot;&#xA;  (let* ((id      (cl-gensym &quot;my/advice-once:cleanup-&quot;))&#xA;         (cleanup (lambda (&amp;amp;rest args)&#xA;                    (advice-remove symbol function)&#xA;                    (advice-remove symbol id))))&#xA;    (advice-add symbol where function props) &#xA;    (advice-add symbol :before cleanup `((name . ,id)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that we need to use the &lt;code&gt;:once&lt;/code&gt; keyword here because &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt; calls &lt;code&gt;pop-to-buffer&lt;/code&gt;, and if we don't replace only the first &lt;code&gt;pop-to-buffer&lt;/code&gt; call, we go into infinite recursion.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-12-26T07:47:33.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19088" PostTypeId="1" CreationDate="2015-12-25T23:23:40.770" Score="2" ViewCount="61" Body="&lt;p&gt;I am using emacs for editing *.tex file. Tex file is controlled under svn.&#xA;I recently migrated to new macbook 12&quot; with sub-c.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I launch emacs from the shell, I do not have any problem in manipulating the tex file. When I launch the emacs clicking the icon in the launch bar, there occur two issue in manipulating the same tex file. They are executing the same emacs binary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, when the emacs is launched through icon click, the svn check-in fails. It says &#xA;    svn: E155021: This client is too old to work with the working copy at&#xA;    '/Users/...' (format 31).&#xA;    You need to get a newer Subversion client. For more details, see&#xA;     &lt;a href=&quot;http://subversion.apache.org/faq.html#working-copy-format-change&quot; rel=&quot;nofollow&quot;&gt;http://subversion.apache.org/faq.html#working-copy-format-change&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, in shell launched emacs, emacs shows the version number of the tex file in the bottom of its window. When the emacs is launched from the icon clock, i do not see any version number of the tex document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the both issues are rooted at the same reason. I am just wondering if&#xA;I could get some clue. &lt;/p&gt;&#xA;" OwnerDisplayName="user77857" LastEditorUserId="253" LastEditDate="2015-12-26T16:03:51.120" LastActivityDate="2015-12-26T16:03:51.120" Title="emacs svn tex file in mac os x" Tags="|osx|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19089" PostTypeId="2" ParentId="17463" CreationDate="2015-12-26T09:57:08.900" Score="0" Body="&lt;p&gt;The standard way to customise these variables is with a line added to &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; saying &lt;code&gt;(setq show-trailing-whitespace t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA; This function is called at the very end of Spacemacs initialization after&#xA;layers configuration. You are free to put any user code.&quot;&#xA;  (setq show-trailing-whitespace t)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this seems to be working fine on develop right now, if you update your distribution, it should just work.&lt;/p&gt;&#xA;" OwnerUserId="5199" LastActivityDate="2015-12-26T09:57:08.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19090" PostTypeId="2" ParentId="13736" CreationDate="2015-12-26T09:59:49.010" Score="2" Body="&lt;p&gt;This works on the latest develop, (fresh installation). open &lt;code&gt;undo-tree-visualise&lt;/code&gt; with &lt;code&gt;SPC a u&lt;/code&gt;. be sure that you have the minimum emacs version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst spacemacs-emacs-min-version   &quot;24.3&quot; &quot;Minimal version of Emacs.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5199" LastActivityDate="2015-12-26T09:59:49.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19091" PostTypeId="1" CreationDate="2015-12-26T14:33:20.323" Score="2" ViewCount="1997" Body="&lt;p&gt;I want to customize &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; before org agenda starts ：&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-prefix-format '(todo . &quot;  %b&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I put the previous line in my .emacs.d, Emacs will show me this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error (use-package): org :config: Symbol's value as variable is void: org-agenda-prefix-format&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that the variable is not defined before org agenda has been started once.  How to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2015-12-26T16:05:20.727" Title="How to set `org-agenda-prefix-format` before org agenda starts?" Tags="|org-mode|org-agenda|start-up|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19092" PostTypeId="2" ParentId="19091" CreationDate="2015-12-26T16:05:20.727" Score="4" Body="&lt;p&gt;The problem is that &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; doesn't exist as a list so you can't add to it.  You could define it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-prefix-format '((todo . &quot;  %b&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, really this variable isn't good for anything until &lt;code&gt;org-agenda&lt;/code&gt; is loaded, so just tell Emacs to &lt;code&gt;add-to-list&lt;/code&gt;, but not until &lt;code&gt;org-agenda&lt;/code&gt; is loaded using &lt;code&gt;with-eval-after-load&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org-agenda &#xA;  (add-to-list 'org-agenda-prefix-format '(todo . &quot;  %b&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2015-12-26T16:05:20.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19093" PostTypeId="1" AcceptedAnswerId="19097" CreationDate="2015-12-26T18:22:30.147" Score="1" ViewCount="304" Body="&lt;p&gt;I have a list with the pattern &lt;code&gt;(list (cons key-binding1 file-name1) (cons key-binding2 file-name2)...)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq hot-list&#xA;      (list&#xA;       (cons &quot;H-g&quot; &quot;~/Documents/goals&quot;)&#xA;       (cons &quot;H-h&quot; &quot;~/Documents/things&quot;)&#xA;       (cons &quot;H-1&quot; &quot;~/Files/C/abc.c&quot;)&#xA;       (cons &quot;H-2&quot; &quot;~/Files/C/abc2.c&quot;)&#xA;       (cons &quot;H-3&quot; &quot;~/Files/C/abc3.c&quot;)&#xA;       (cons &quot;H-e&quot; &quot;~/.emacs&quot;) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want to bind each key-binding to the respective file. But I don't want to do write a &lt;code&gt;(global-set-key)&lt;/code&gt; form for each file. Instead I use &lt;code&gt;(dolist)&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (i hot-list)&#xA;  (global-set-key (kbd (car i))&#xA;          (list `lambda (list i)&#xA;            `(interactive)&#xA;            `(find-file (cdr ,i)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try &quot;H-1&quot;, it gives an error: &quot; Invalid function: &lt;code&gt;(lambda ((&quot;H-1&quot; . &quot;~/Files/C/abc.c&quot;)) (interactive) (find-file (cdr (&quot;H-1&quot; . &quot;~/Files/C/abc.c&quot;))))&lt;/code&gt; &quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I don't find anything wrong with my code. &lt;code&gt;(global-set-key)&lt;/code&gt; accept a command. And the test: &lt;code&gt;(commandp (lambda ((&quot;H-1&quot; . &quot;~/Files/C/abc.c&quot;)) (interactive) (find-file (cdr (&quot;H-1&quot; . &quot;~/Files/C/abc.c&quot;)))))&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I do this?&lt;/p&gt;&#xA;" OwnerUserId="10603" LastEditorUserId="105" LastEditDate="2016-03-14T17:21:57.620" LastActivityDate="2016-03-14T17:21:57.620" Title="Using (dolist) to set multiple keybindings" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19094" PostTypeId="1" CreationDate="2015-12-26T18:22:34.383" Score="3" ViewCount="89" Body="&lt;p&gt;I'm curious about the Emacs architecture. Do you know where are the structures for keeping opened text file? Where are the main functions for opening, editing and closing text files? How in general terms text is stored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I once opened one xml file, which was 100 MiB large and had only two lines of text. Then I typed a character in the large one, emacs stopped reacting for a several minutes with a 100% cpu usage. So, I guess, emacs did kept that 100 MiB line as a single memory block, and moved 99.999999 of them to the right then this happened. I'm curious where exactly in the code this happened, what's the file name + function name.&lt;/p&gt;&#xA;" OwnerUserId="10411" LastEditorUserId="105" LastEditDate="2023-06-16T22:12:25.057" LastActivityDate="2023-06-16T22:12:25.057" Title="How text is stored internally in emacs?" Tags="|emacs-internals|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19095" PostTypeId="1" CreationDate="2015-12-26T19:46:48.963" Score="3" ViewCount="159" Body="&lt;p&gt;Is there a straightforward way to use a variable for the tangle file? For example, I want to tanlge my file into the directory &lt;code&gt;files&lt;/code&gt;. For multiple files I could do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :tangle files/fileA.py&#xA;some code&#xA;#+end_src&#xA;&#xA;#+begin_src python :tangle files/fileB.py&#xA;some code&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that would mean repeating the file path every time. So ideally I would do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: mydir&#xA;: files/&#xA;&#xA;#+name: combine&#xA;#+begin_src python :var filename=&quot;&quot;&#xA;return files+filename&#xA;#+end_src&#xA;&#xA;#+begin_src python :tangle combine(fileA.py)&#xA;some code&#xA;#+end_src&#xA;&#xA;#+begin_src python :tangle combine(fileB.py)&#xA;some code&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried using &lt;code&gt;:dir&lt;/code&gt; instead but that doesn't work either, as it seems to apply to the execution directory, not the tangle directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found this &lt;a href=&quot;https://emacs.stackexchange.com/questions/2328/using-org-babel-to-tangle-to-a-variable-file-name&quot;&gt;post&lt;/a&gt; that shows how to use &lt;strong&gt;elisp variables&lt;/strong&gt; but that requires the use of &lt;code&gt;setq&lt;/code&gt; and doesn't seem like a good idea.&lt;/p&gt;&#xA;" OwnerUserId="10595" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-14T17:21:42.870" Title="Org-mode Babel: Evaluating code in header of code block for tangling" Tags="|org-babel|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19096" PostTypeId="1" AcceptedAnswerId="19099" CreationDate="2015-12-26T20:23:34.180" Score="17" ViewCount="4045" Body="&lt;p&gt;I just installed &lt;a href=&quot;http://spacemacs.org&quot;&gt;Spacemacs&lt;/a&gt;, mainly for its nifty defaults. One default I'm not so pleased about is that it puts tildes on empty lines in the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried putting &lt;code&gt;(setq vi-tilde-fringe nil)&lt;/code&gt; and &lt;code&gt;(setq indicate-empty-lines nil)&lt;/code&gt; inside the &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; function, which seem to have no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get rid of all these messy tildes once and for all?&lt;/p&gt;&#xA;" OwnerUserId="10604" LastActivityDate="2017-09-01T21:12:24.010" Title="How do I turn off Spacemacs’s tildes on empty lines?" Tags="|evil|spacemacs|fringe|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19097" PostTypeId="2" ParentId="19093" CreationDate="2015-12-26T20:56:20.217" Score="4" Body="&lt;p&gt;It's usually easier to construct code to evaluate this way using backquote. A backquoted list is like a quoted list, except that forms preceded by a comma are evaluated and the result interpolated into the list. So, for your example, you might do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (i hot-list)&#xA;  (global-set-key (kbd (car i))&#xA;                 `(lambda ()&#xA;                    (interactive)&#xA;                    (find-file ,(cdr i)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In defining the functions, the only thing that needs to be evaluated is the &lt;code&gt;(cdr i)&lt;/code&gt;. In practice, I find that the easiest way to write something like this is to write the lambda (or other expression) that you want, then figure out which small parts need to be evaluated to get the result.&lt;/p&gt;&#xA;" OwnerUserId="10033" LastActivityDate="2015-12-26T20:56:20.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19098" PostTypeId="1" AcceptedAnswerId="19106" CreationDate="2015-12-26T20:57:02.143" Score="0" ViewCount="178" Body="&lt;p&gt;When I define a function in Emacs Lisp mode, you can evaluate it with moving the pointer to the&#xA;last parenthese of a function, and do &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-e&lt;/kbd&gt;. Aka calling &lt;code&gt;eval-last-sexp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought this is somewhat a cumbersome. So I bound the key &lt;kbd&gt;C-e&lt;/kbd&gt; to&#xA;&lt;code&gt;eval-defun&lt;/code&gt;. So every time you define a new &lt;code&gt;setq&lt;/code&gt; definition or a function,&#xA;you can evaluate it with &lt;code&gt;eval-defun&lt;/code&gt; without the need to move your pointer to&#xA;the latest parenthese first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm trying Clojure in pair with CIDER. I noticed you need to move to the&#xA;latest parenthese and then call &lt;code&gt;cider-eval-last-sexp&lt;/code&gt;. I would like to eval the&#xA;current function/whatever where my cursor is, where the pointer is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I couldn't find any Clojure/Cider alternative for ELisp's &lt;code&gt;eval-defun&lt;/code&gt;. Any suggestion for a function would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2015-12-27T10:11:38.593" Title="Is there an eval-defun alternative for Clojure mode?" Tags="|clojure|cider|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19099" PostTypeId="2" ParentId="19096" CreationDate="2015-12-27T01:02:47.237" Score="16" Body="&lt;h1&gt;Toggle&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can toggle it off with &lt;code&gt;(spacemacs/toggle-vi-tilde-fringe-off)&lt;/code&gt;, you can get the list of all toggles in &lt;code&gt;helm-spacemacs&lt;/code&gt; accessible via &lt;code&gt;SPC f e h&lt;/code&gt; or &lt;code&gt;SPC h SPC&lt;/code&gt; in more recent versions. Every toggle in this list have 3 functions associated to them, if we take &lt;code&gt;vi-tilde-fringe&lt;/code&gt; then the functions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;spacemacs/toggle-vi-tilde-fringe&lt;/code&gt; (toggle the state on and off)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;spacemacs/toggle-vi-tilde-fringe-on&lt;/code&gt; (force the toggle state to on)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;spacemacs/toggle-vi-tilde-fringe-off&lt;/code&gt; (force the toggle state to off)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To get the name of the function associated to a key binding use &lt;code&gt;SPC h d k&lt;/code&gt; (or &lt;code&gt;C-h k&lt;/code&gt;) and type the key binding, with the &lt;code&gt;vi-tilde-fringe&lt;/code&gt; example this is &lt;code&gt;SPC h d k SPC T ~&lt;/code&gt; (in most recent version) and you should get the function name.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Excluded packages&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Another way to remove the tildes is to exclude the package &lt;code&gt;vi-tilde-fringe&lt;/code&gt; from your configuration by adding &lt;code&gt;vi-tilde-fringe&lt;/code&gt; to your dotfile variable &lt;code&gt;dotspacemacs-excluded-packages&lt;/code&gt;. This will have the effect of completely removing the package and all its associated configuration from your Spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once again to get the package name you can try &lt;code&gt;helm-spacemacs&lt;/code&gt; and type tilde in the helm buffer.&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2015-12-27T01:07:56.123" LastActivityDate="2015-12-27T01:07:56.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19101" PostTypeId="2" ParentId="16917" CreationDate="2015-12-27T04:51:52.003" Score="1" Body="&lt;p&gt;Place the hyperlink in &lt;code&gt;=&lt;/code&gt; tags to denote &lt;code&gt;org-code verbatim&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode text like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=http://www.pharo.org=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will get exported to HTML that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;&#xA;&amp;lt;code&amp;gt;http://www.pharo.org&amp;lt;/code&amp;gt; &#xA;&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-12-27T04:51:52.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19102" PostTypeId="2" ParentId="17463" CreationDate="2015-12-27T05:21:37.290" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq show-trailing-whitespace t)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;You can use the package &lt;a href=&quot;https://github.com/lewang/ws-butler&quot; rel=&quot;nofollow&quot;&gt;ws-butler&lt;/a&gt; and enable &lt;code&gt;ws-butler-mode&lt;/code&gt;. This will remove trailing whitespace on save for any lines that have been modified. At one point &lt;code&gt;ws-butler&lt;/code&gt; &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/235&quot; rel=&quot;nofollow&quot;&gt;was enabled by default&lt;/a&gt;, that may still be the case. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2015-12-27T05:21:37.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19104" PostTypeId="2" ParentId="19069" CreationDate="2015-12-27T08:03:11.630" Score="1" Body="&lt;p&gt;The following code will fix this (thanks to thierryvolpiatto): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm/modify-ido-temp-list ()&#xA;  (let ((bl (mapcar #'buffer-name (buffer-list (selected-frame)))))&#xA;    (setq ido-temp-list (append (cdr bl) (list (car bl))))))&#xA;&#xA;(add-hook 'ido-make-buffer-list-hook 'helm/modify-ido-temp-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(See &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/1301&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/issues/1301&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="6807" LastActivityDate="2015-12-27T08:03:11.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19105" PostTypeId="1" AcceptedAnswerId="19125" CreationDate="2015-12-27T09:25:28.370" Score="9" ViewCount="6579" Body="&lt;p&gt;In Org-mode buffers, table or code block can have &lt;code&gt;#+NAME: title&lt;/code&gt;.&#xA;But I don't know how to reference them in current buffer or in other files with org-mode hyperlink. (like one link format: &lt;code&gt;[[file:some-file.org::*headline]]&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode has support for some &lt;a href=&quot;http://orgmode.org/org.html#Custom-searches&quot; rel=&quot;noreferrer&quot;&gt;Custom Search&lt;/a&gt; functions.&#xA;By default, Org-mode does not supprt this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody knows how to add this support?&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2015-12-28T02:56:44.643" LastActivityDate="2015-12-29T10:21:37.117" Title="How to reference named table or code block in Org-mode" Tags="|org-mode|hyperlinks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19106" PostTypeId="2" ParentId="19098" CreationDate="2015-12-27T10:11:38.593" Score="3" Body="&lt;p&gt;&lt;code&gt;C-M-x&lt;/code&gt; does the right thing in Clojure buffers for me after spawning a REPL.  To look up what command is bound to it, use &lt;code&gt;F1 k &amp;lt;key sequence&amp;gt;&lt;/code&gt; and you'd find out that it's &lt;code&gt;cider-eval-defun-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2015-12-27T10:11:38.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19107" PostTypeId="2" ParentId="18992" CreationDate="2015-12-27T11:11:33.957" Score="4" Body="&lt;p&gt;Eshell always prefers Lisp functions. &lt;code&gt;eshell-prefer-lisp-functions&lt;/code&gt; only affects the interpretation of &lt;code&gt;*rm&lt;/code&gt;, not the interpretation of &lt;code&gt;rm&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: the source code… From Emacs 24.3:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun eshell-plain-command (command args)&#xA;  (let* ((esym (eshell-find-alias-function command))&#xA;    …&#xA;    (if (and …&#xA;             (or esym eshell-prefer-lisp-functions&#xA;                 (not (eshell-search-path command))))&#xA;        (eshell-lisp-command sym args)&#xA;      (eshell-external-command command args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eshell-find-alias-function&lt;/code&gt; looks up a function under the &lt;code&gt;eshell/&lt;/code&gt; prefix. There's similar logic in &lt;code&gt;eshell/which&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable's documentation is downright misleading, and the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_mono/eshell.html#Built_002dins&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; is rather misleading too. I guess the behavior is by design (after all, why would you define an eshell function if it's not to use it?), so it's a documentation bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To invoke the external utility, call &lt;code&gt;/bin/rm&lt;/code&gt;, or, provided that you left &lt;code&gt;eshell-prefer-lisp-functions&lt;/code&gt; set to nil, call &lt;code&gt;*rm*&lt;/code&gt;. If you want &lt;code&gt;rm&lt;/code&gt; to always invoke the external utility, you can define an alias: &lt;code&gt;alias rm &quot;rm $*&quot;&lt;/code&gt; (thanks &lt;a href=&quot;https://emacs.stackexchange.com/users/10761/gdp2&quot;&gt;GDP2&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-19T21:20:12.590" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19108" PostTypeId="1" CreationDate="2015-12-27T14:21:23.473" Score="0" ViewCount="50" Body="&lt;p&gt;I want to colorize code snippet in &lt;code&gt;markdown-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# foo.rb&#xA;def foo&#xA;  do_something&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And javascript code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// bar.js&#xA;function bar(){&#xA;  do_something();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In markdown-mode the codes are colored by single color. Is there a way to colorize the codes by using proper programming language color mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean by reading first line of the codes like &lt;code&gt;# foo.rb&lt;/code&gt; or &lt;code&gt;// bar.js&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10106" LastEditorUserId="304" LastEditDate="2016-02-05T10:59:12.490" LastActivityDate="2016-02-05T10:59:12.490" Title="Is there a way to colorize markdown coding partial" Tags="|javascript|markdown|ruby|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19110" PostTypeId="2" ParentId="18438" CreationDate="2015-12-27T16:24:47.623" Score="6" Body="&#xA;&#xA;&lt;p&gt;Similar to &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20015&quot;&gt;Emacs bug#20015&lt;/a&gt;, this can be avoided by setting &lt;code&gt;tramp-ssh-controlmaster-options&lt;/code&gt; before loading tramp.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq tramp-ssh-controlmaster-options&#xA;      &quot;-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no&quot;)&#xA;(require 'tramp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or with &lt;code&gt;use-package&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package tramp&#xA;  :init (setq tramp-ssh-controlmaster-options&#xA;              &quot;-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Although getting a password prompt for a non-existing host seems like a bug in your ssh setup to me.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2015-12-27T16:24:47.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19111" PostTypeId="2" ParentId="14425" CreationDate="2015-12-27T19:01:02.460" Score="0" Body="&lt;p&gt;I have just find  &lt;a href=&quot;https://github.com/yasuhito/orgbox&quot; rel=&quot;nofollow noreferrer&quot;&gt;orgbox&lt;/a&gt; mode which works like how described in question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a picture which describe how it is work &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XkbBe.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XkbBe.png&quot; alt=&quot;orgbox-pic&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8426" LastActivityDate="2015-12-27T19:01:02.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19114" PostTypeId="1" CreationDate="2015-12-27T19:41:03.500" Score="1" ViewCount="3884" Body="&lt;p&gt;When I open a file in Emacs.app, via Finder, via the edit-server or during merging on an SVN update, it shows up in a new frame. When I kill that buffer, I pretty much always also want close the frame that came with it. Is there a way to easily recognize such situations and add an appropriate advice to kill-buffer? Is there perhaps a buffer history for each frame? If that history only contains one buffer, and the frame is not the last remaining one, it would be safe to close.&lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2015-12-28T00:28:25.920" Title="How can I close the current frame upon killing a buffer if that frame was only opened for it?" Tags="|frames|kill-buffer|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19115" PostTypeId="2" ParentId="18742" CreationDate="2015-12-27T19:48:34.900" Score="0" Body="&lt;p&gt;I have switched from the brew formula &lt;code&gt;railwaycat/emacsmacport/emacs-mac&lt;/code&gt; to standard emacs using &lt;code&gt;brew install emacs --with-cocoa --with-gnutls --with-imagemagick --with-librsvg --with-mailutils&lt;/code&gt;, which compiles with the &lt;code&gt;--with-ns&lt;/code&gt; switch per default (which the other port apparently does not contain). This required fixing up a few things such as the modifier keys. I'm also missing the Emoji &amp;amp; Symbols menu entry and the pixel-wise smooth scrolling, but I think I will get used to it.&lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2015-12-27T19:48:34.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19116" PostTypeId="2" ParentId="19093" CreationDate="2015-12-27T20:23:03.917" Score="1" Body="&lt;p&gt;You may be interested in Emacs' built-in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html&quot; rel=&quot;nofollow&quot;&gt;register&lt;/a&gt; feature with which you can bind a letter to a file location (among other things):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-loop for (key file-name) in '((?g &quot;~/Documents/goals&quot;)&#xA;                                  (?h &quot;~/Documents/things&quot;)&#xA;                                  (?1 &quot;~/Documents/C/abc.c&quot;)&#xA;                                  (?2 &quot;~/Documents/C/abc2.c&quot;)&#xA;                                  (?3 &quot;~/Documents/C/abc3.c&quot;)&#xA;                                  (?e &quot;~/.emacs&quot;))&#xA;         do (set-register key `(file . ,file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then jump to your &lt;code&gt;.emacs&lt;/code&gt; file with &lt;kbd&gt;C-x r j e&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10610" LastActivityDate="2015-12-27T20:23:03.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19117" PostTypeId="1" AcceptedAnswerId="19118" CreationDate="2015-12-27T20:54:29.017" Score="2" ViewCount="94" Body="&lt;pre&gt;&lt;code&gt;(eval-after-load 'lisp-mode&#xA;  (define-key emacs-lisp-mode-map (kbd &quot;C-c r&quot;) 'raise-sexp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When above lisp is evaluated, it shows following error message.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;up-list: Scan error: &quot;Unbalanced parentheses&quot;, 183, 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What's strange to me is that following lisp is evaluated without any error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'lisp-mode&#xA;  (define-key emacs-lisp-mode-map (kbd &quot;C-c r&quot;) 'forward-sexp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could someone help me figure out what's going on here?&lt;/p&gt;&#xA;" OwnerUserId="9371" LastEditorUserId="105" LastEditDate="2016-03-14T17:21:26.743" LastActivityDate="2018-12-24T16:56:35.997" Title="eval-after-load and define-key of raise-sexp results in an error of &quot;Unbalanced parenthesis&quot;" Tags="|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19118" PostTypeId="2" ParentId="19117" CreationDate="2015-12-27T21:04:56.957" Score="0" Body="&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'lisp-mode&#xA;  (define-key emacs-lisp-mode-map (kbd &quot;C-c r&quot;) 'raise-sexp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively - note the &lt;strong&gt;quote&lt;/strong&gt; mark before the argument:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'lisp-mode&#xA;  '(define-key emacs-lisp-mode-map (kbd &quot;C-c r&quot;) 'raise-sexp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eval-after-load&lt;/code&gt; is a function, which means that it evaluates all of its arguments. So you want to quote the form you pass to it, so it is evaluated after loading, not when &lt;code&gt;eval-after-load&lt;/code&gt; itself is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-eval-after-load&lt;/code&gt; is a macro, which means that it does not necessarily evaluate any of its arguments (and a macro often doesn't evaluate any of them). Emacs added &lt;code&gt;with-eval-after-load&lt;/code&gt; specifically because with &lt;code&gt;eval-after-load&lt;/code&gt; some users have fallen into the same gotcha that you did: forgetting a quote mark or not realizing that they wanted one.&lt;/p&gt;&#xA;" OwnerUserId="9371" LastEditorUserId="105" LastEditDate="2018-12-24T16:56:35.997" LastActivityDate="2018-12-24T16:56:35.997" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="19119" PostTypeId="2" ParentId="19114" CreationDate="2015-12-28T00:03:20.010" Score="1" Body="&lt;p&gt;The solution you found &lt;a href=&quot;https://emacs.stackexchange.com/a/2915/105&quot;&gt;here&lt;/a&gt; should be fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is another approach, which I use.  To use it you will need to either pull out the relevant code from these libraries or require each of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach does two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Defines an alternative command to &lt;code&gt;kill-buffer&lt;/code&gt;, for interactive use: &lt;code&gt;kill-buffer-and-its-windows&lt;/code&gt;.  I remap all keys bound to the former to the latter, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map [remap kill-buffer] 'kill-buffer-and-its-windows)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Advises &lt;code&gt;delete-window&lt;/code&gt; so that if the window is alone in its frame, then the frame is deleted (using &lt;code&gt;delete-frame&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In other words, when you use &lt;code&gt;C-x k&lt;/code&gt; you will get this behavior: the buffer will be killed and its window (or its frame, if it has only one window) will be deleted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The code for &lt;code&gt;kill-buffer-and-its-windows&lt;/code&gt; is in library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The code that advises &lt;code&gt;delete-window&lt;/code&gt; is in librarly &lt;a href=&quot;http://www.emacswiki.org/emacs/download/frame-cmds.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;frame-cmds.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Each of those libraries requires these libraries:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/download/frame-fns.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;frame-fns.el&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-fns.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;misc-fns.el&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/download/strings.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;strings.el&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(As I said, you do &lt;em&gt;not&lt;/em&gt; need all of that code to do only what you want.  You could just copy the code I mentioned from &lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/download/frame-cmds.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;frame-cmds.el&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-28T00:03:20.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19120" PostTypeId="2" ParentId="19114" CreationDate="2015-12-28T00:28:25.920" Score="0" Body="&lt;p&gt;This isn't precisely what you're asking for, but from the discussion in comments, it sounds like it might still work for you.  This is a slight modification of the command I use on &lt;code&gt;C-x C-c&lt;/code&gt; (I added the buffer-killing feature).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will kill the current buffer and close the current frame, unless there's only one frame open.  In that case, it will ask you for the go-ahead to kill Emacs.  If you're using &lt;code&gt;emacsclient&lt;/code&gt;, note that the daemon appears to have its own frame in &lt;code&gt;(visible-frame-list)&lt;/code&gt;, so in this situation you can close the last open frame without killing Emacs entirely.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/kill-buffer-and-frame-or-exit (&amp;amp;optional arg)&#xA;  &quot;Kill this buffer and frame.  With only one frame, exit Emacs.&#xA;&#xA;When there is more than one visible frame, run `delete-frame'.&#xA;Otherwise, exit Emacs with `save-buffers-kill-terminal' after&#xA;confirming this with user.&#xA;&#xA;If a prefix ARG is supplied, ignore it in the multiple-frame&#xA;case.  Otherwise, bypass confirmation and pass the argument to&#xA;`save-buffers-kill-terminal'.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (cond&#xA;   ((&amp;gt; (length (visible-frame-list)) 1)  (kill-this-buffer) (delete-frame))&#xA;   ((or arg (y-or-n-p &quot;Quit Emacs?&quot;))    (save-buffers-kill-terminal arg))&#xA;   (t                                    (message &quot;Abort&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2015-12-28T00:28:25.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19121" PostTypeId="1" CreationDate="2015-12-28T00:35:09.313" Score="2" ViewCount="205" Body="&lt;p&gt;After taking a look at the definition of &lt;code&gt;defun&lt;/code&gt; in &lt;code&gt;byte-run.el&lt;/code&gt;, it seems that the macro does some very interesting things regarding checking for the existence of a docstring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, it uses a &lt;code&gt;declare&lt;/code&gt; form to indicate that the third argument to the &lt;code&gt;defun&lt;/code&gt; is the docstring. It then checks whether the third argument is a string (which means it's a docstring), or actually a &lt;code&gt;declare&lt;/code&gt; form (which means there is no docstring).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand correctly, this allows the user of a &lt;code&gt;defun&lt;/code&gt; to specify a docstring or to it out altogether.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this use of an optional argument considered unusual? Usually, for a function &lt;code&gt;(foo a b &amp;amp;optional c d &amp;amp;rest rest)&lt;/code&gt;, we'd enter a &lt;code&gt;nil&lt;/code&gt; for &lt;code&gt;c&lt;/code&gt; if we wanted to specify &lt;code&gt;d&lt;/code&gt; but not &lt;code&gt;c&lt;/code&gt;. I haven't seen other examples of arguments that can simply be &quot;left out&quot; like the docstring.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2016-03-14T17:20:54.480" LastActivityDate="2016-03-14T17:20:54.480" Title="Optional docstring in defun" Tags="|doc-strings|defun|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19122" PostTypeId="1" CreationDate="2015-12-28T00:58:52.570" Score="1" ViewCount="56" Body="&lt;p&gt;I am seeing it in connection with certain websites and eww.el.  Is there quick hack I can do to make those sites load?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error I see is like the following:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error in process filter: url-domsuf-parse-file: Opening input file: \&#xA;no such file or directory, \&#xA;/Applications/Aquamacs.app/Contents/Resources/etc/publicsuffix.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was using Aquamacs 3.2, the most recent at the time of writing.&lt;/p&gt;&#xA;" OwnerUserId="7130" LastEditorUserId="7130" LastEditDate="2015-12-28T02:56:52.980" LastActivityDate="2015-12-28T03:01:45.827" Title="How do I make errors about url-domsuf-parse-file go away?" Tags="|eww|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19123" PostTypeId="1" AcceptedAnswerId="39077" CreationDate="2015-12-28T01:02:03.210" Score="16" ViewCount="835" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/nomeata/gtk-vector-screenshot&quot;&gt;&lt;code&gt;gtk-vector-screenshot&lt;/code&gt;&lt;/a&gt; program can be used to take vector screenshots of Gtk-3 applications. It seems to work by asking the application to redraw itself onto an SVG canvas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs on GNU/Linux can be built with Gtk+, but trying to use the aforementioned application on an Emacs window results in a screenshot that only contains GUI elements such as the menu bar; buffers are not rendered (I tried with and without Cairo). This is not too surprising, given that Emacs' buffer rendering happens at a pretty low level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, &lt;strong&gt;is there a way to take scalable vector screenshots of Emacs&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2020-07-20T19:52:12.037" Title="Can I take vector (SVG) screenshots of Emacs?" Tags="|fonts|rendering|gtk3|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19124" PostTypeId="2" ParentId="19122" CreationDate="2015-12-28T02:36:38.063" Score="1" Body="&lt;p&gt;It looks like this might be a symptom of a bug in Aquamacs that has supposedly been fixed. See &lt;a href=&quot;http://emacs.1067599.n5.nabble.com/aquamacs-devel-Re-quot-no-such-file-or-directory-quot-quot-Applications-Aquamacs-app-Contents-Resour-td311612.html&quot; rel=&quot;nofollow&quot;&gt;this discussion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like the user in that post was able to solve the problem by running:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;touch /Applications/Aquamacs.app/Contents/Resources/etc/publicsuffix.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from the terminal to create the missing file. You can try this, our try creating the file from emacs by calling &lt;code&gt;C-x C-f&lt;/code&gt; (&lt;code&gt;find-file&lt;/code&gt;), entering the complete the path &lt;code&gt;/Applications/Aquamacs.app/Contents/Resources/etc/publicsuffix.txt&lt;/code&gt; and confirming that you want to create the file which seems to be missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is that the function &lt;code&gt;url-domsuf-parse-file&lt;/code&gt; i&lt;a href=&quot;https://github.com/jwiegley/emacs-release/blob/master/lisp/url/url-domsuf.el#L36&quot; rel=&quot;nofollow&quot;&gt;s expecting to find that file&lt;/a&gt;, and it isn't where it should be. I am not sure what the consequences are of putting an empty file in its place, but it is worth a try. I guess you could even paste in the contents of &lt;a href=&quot;https://github.com/davidswelt/aquamacs-emacs/blob/aquamacs3/etc/publicsuffix.txt&quot; rel=&quot;nofollow&quot;&gt;this file&lt;/a&gt;, because I assume that is what it is looking for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you are using an outdated version of Aquamacs, you should update if possible, and the problem will likely fix itself.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-28T03:01:45.827" LastActivityDate="2015-12-28T03:01:45.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19125" PostTypeId="2" ParentId="19105" CreationDate="2015-12-28T03:17:33.220" Score="14" Body="&lt;p&gt;I found the solution, Org-mode radio target can be used here.&#xA;here is the doc: &lt;a href=&quot;http://orgmode.org/org.html#Internal-links&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/org.html#Internal-links&lt;/a&gt;&#xA;Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is a named table.&#xA;&#xA;#+NAME: my target&#xA;| x | y |&#xA;| 1 | 2 |&#xA;&#xA;I can reference it with its name. Like this:&#xA;[[my target]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are also &lt;a href=&quot;http://orgmode.org/manual/References.html#index-remote-references-352&quot; rel=&quot;noreferrer&quot;&gt;table remote references&lt;/a&gt; further explained by an example in the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First we define a table with a name &lt;code&gt;TBL_origin&lt;/code&gt; to have something to play with.&#xA;The two numbers in the row &lt;code&gt;Average&lt;/code&gt; are referenced in the tables further below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  #+NAME: TBL_origin&#xA;  | Leaders  | Caption 1 | Caption 2 |&#xA;  |----------+-----------+-----------|&#xA;  | Average  |        16 |        17 |&#xA;  |----------+-----------+-----------|&#xA;  | Leader 1 |        11 |        12 |&#xA;  | Leader 2 |        21 |        22 |&#xA;  #+TBLFM: @2$2=vmean(@II$2..@III$2)::@2$3=vmean(@II$3..@III$3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The vector of the two numeric cells in row &lt;code&gt;Average&lt;/code&gt; of table &lt;code&gt;TBL_origin&lt;/code&gt;&#xA;are referenced in the table formulas of the next tables.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  | Use table reference |&#xA;  |---------------------|&#xA;  |                16.5 |&#xA;  #+TBLFM: @2$1=vmean(remote(TBL_origin,@2$2..@2$3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you can not directly assign remote references to table ranges (see the posting&#xA;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2010-01/msg00433.html&quot; rel=&quot;noreferrer&quot;&gt;Re: [Orgmode] remote reference&lt;/a&gt; in the orgmode mailing list).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A workaround is demonstrated in the following table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  | Refer to averages |&#xA;  |-------------------|&#xA;  |                16 |&#xA;  |                17 |&#xA;  #+TBLFM: $1=subscr(remote(TBL_origin,@2$2..@2$3),@#-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="2370" LastEditDate="2015-12-29T10:21:37.117" LastActivityDate="2015-12-29T10:21:37.117" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19126" PostTypeId="1" AcceptedAnswerId="19132" CreationDate="2015-12-28T05:17:46.060" Score="1" ViewCount="847" Body="&lt;p&gt;What is an easy way to automatically resize a window (height and or width) according to the length / line length of the buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible behavior: A frame split horizontally with two windows with the right-hand buffer set to automatically resize to a minimum width that minimizes wrapped lines.  A maximum width might be specified and occasionally force some lines to be wrapped.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-10-11T09:32:57.383" Title="Auto-resize window widths to accomodate line length" Tags="|window|window-splitting|wrapping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19127" PostTypeId="1" AcceptedAnswerId="19128" CreationDate="2015-12-28T05:36:33.193" Score="1" ViewCount="114" Body="&lt;p&gt;Does Emacs have some notion of associating minor modes with windows rather than setting them as &quot;global&quot; or &quot;buffer-local&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in a certain window layout I may wish to have a minor mode associated with a particular window regardless of the buffer currently shown in that window.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2015-12-28T13:35:21.217" Title="Is it possible to associate minor modes with windows rather than buffers?" Tags="|window|minor-mode|buffer-local|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19128" PostTypeId="2" ParentId="19127" CreationDate="2015-12-28T08:07:21.390" Score="4" Body="&lt;p&gt;Not as such. Even 'global' minor modes are generally just buffer-local minor modes which are enabled or disabled for multiple buffers en masse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there's nothing to stop you writing a global mode (or hook function, or whatever approach makes the most sense) which is ostensibly active everywhere, but which checks the window of the current buffer, and only actually does something if that window is the one you're interested in. Or you might determine the buffer currently displayed in the window you're interested in, and do things with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will work nicely for some kinds of behaviours, and be very difficult for others, so it really depends on what you're hoping to achieve.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2015-12-28T13:35:21.217" LastActivityDate="2015-12-28T13:35:21.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19130" PostTypeId="1" AcceptedAnswerId="19131" CreationDate="2015-12-28T09:06:54.287" Score="4" ViewCount="118" Body="&lt;p&gt;With ESS + auto-complete, I get AC suggestions for function arguments that allow me to save time typing them out. What irks me is that it completes the function arguments with spaces around them. For example: &lt;code&gt;print(x = )&lt;/code&gt; instead of &lt;code&gt;print(x=)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to change this behavior in ESS using some variable customization?&lt;/p&gt;&#xA;" OwnerUserId="9193" LastEditorUserId="253" LastEditDate="2015-12-28T12:42:52.877" LastActivityDate="2015-12-29T06:14:45.657" Title="ESS: Disable spaces around `=` in function arguments" Tags="|ess|r|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19131" PostTypeId="2" ParentId="19130" CreationDate="2015-12-28T12:13:41.163" Score="4" Body="&lt;p&gt;See &lt;a href=&quot;http://ess.r-project.org/Manual/ess.html#Features&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for a hint to the solution. From the changelist for 12.09-1:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ESS[R] Auto-completion: new variable ess-ac-R-argument-suffix to&#xA;  customize the insertion of trailing &quot;=&quot;. Defaults to “ = “.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And from the documentation for the variable &lt;code&gt;ess-ac-R-argument-suffix&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ess-ac-R-argument-suffix is a variable defined in&#xA;  'ess-r-completion.el'. Its value is &quot; = &quot;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This variable is an alias for 'ess-R-argument-suffix'.   This&#xA;  variable is obsolete since 15.3;   use 'ess-R-argument-suffix'&#xA;  instead.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Suffix appended by 'ac-source-R' and `ac-source-R-args'&#xA;  to candidates.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To fix:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq ess-R-argument-suffix &quot;=&quot;)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9193" LastEditorUserId="9193" LastEditDate="2015-12-29T06:14:45.657" LastActivityDate="2015-12-29T06:14:45.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19132" PostTypeId="2" ParentId="19126" CreationDate="2015-12-28T15:06:46.307" Score="2" Body="&lt;p&gt;The command &lt;code&gt;fit-window-to-buffer&lt;/code&gt; resizes a window, so you can type &lt;code&gt;M-x fit-window-to-buffer RET&lt;/code&gt; to resize the current buffer's window.&#xA;By default &lt;code&gt;fit-window-to-buffer&lt;/code&gt; only resizes vertically (according to height), but you can use the variable &lt;code&gt;fit-window-to-buffer-horizontally&lt;/code&gt; to change that:&#xA;- &lt;code&gt;nil&lt;/code&gt; (the default): only resize vertically&#xA;- &lt;code&gt;only&lt;/code&gt;: only resize horizontally (according to width)&#xA;- other value: both vertical and horizontal resizing is allowed&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To resize a window programatically, you can call &lt;code&gt;fit-window-to-buffer&lt;/code&gt; or hook it into appropriate places, depending on what you want to do exactly. Here are some helper functions that might be easier to use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun fit-window-to-buffer-width (&amp;amp;optional window max-width min-width)&#xA;  &quot;Fit WINDOW according to its buffer's width.&#xA;WINDOW, MAX-WIDTH and MIN-WIDTH have the same meaning as in&#xA;`fit-window-to-buffer'.&quot;&#xA;  (interactive)&#xA;  (let ((fit-window-to-buffer-horizontally 'only))&#xA;    (fit-window-to-buffer window nil nil max-width min-width)))&#xA;&#xA;(defun fit-window-to-buffer-height (&amp;amp;optional window max-height min-height)&#xA;  &quot;Fit WINDOW according to its buffer's height.&#xA;WINDOW, MAX-HEIGHT and MIN-HEIGHT have the same meaning as in&#xA;`fit-window-to-buffer'.&quot;&#xA;  (interactive)&#xA;  (let ((fit-window-to-buffer-horizontally nil))&#xA;    (fit-window-to-buffer window max-height min-height nil nil)))&#xA;&#xA;(defun fit-window-to-buffer-height-or-width&#xA;    (&amp;amp;optional window max-height min-height max-width min-width)&#xA;  &quot;Fit WINDOW according to its buffer's height and width.&#xA;WINDOW, MAX-HEIGHT, MIN-HEIGHT, MAX-WIDTH and MIN-WIDTH have the same meaning&#xA;as in `fit-window-to-buffer'.&quot;&#xA;  (interactive)&#xA;  (let ((fit-window-to-buffer-horizontally t))&#xA;    (fit-window-to-buffer window max-height min-height max-width min-width)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6533" LastEditorUserId="6533" LastEditDate="2016-10-11T09:32:57.383" LastActivityDate="2016-10-11T09:32:57.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19133" PostTypeId="1" CreationDate="2015-12-28T15:21:12.917" Score="6" ViewCount="334" Body="&lt;p&gt;I want to execute a list of commands all at once in the evil's command line. In vim, you can use the pipe to execute multiple commands, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%s/ó/o/g|%s/ç/c/g&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I do this in evil?&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2015-12-28T15:21:12.917" Title="Evil: how to execute multiple commands at command line?" Tags="|evil|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19134" PostTypeId="2" ParentId="19034" CreationDate="2015-12-28T16:19:17.567" Score="0" Body="&lt;p&gt;What I want doesn't seem possible, that is, without adding some logic between change of active buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What was bothering me was the lack of consistency. I am satisfied with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq&#xA; helm-always-two-windows t&#xA; helm-split-window-default-side 'left)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will open helm buffer on the left, full height and place the active buffer from which I invoked the helm menu on the right, full height as well. This is consistent and satisfies me, even though it doesn't directly answer my initial question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, one could play around with &lt;code&gt;helm-split-window-in-side-p&lt;/code&gt;, &lt;code&gt;helm-always-two-windows&lt;/code&gt; and &lt;code&gt;helm-split-window-default-side&lt;/code&gt; for a different approach.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2015-12-29T17:05:52.577" LastActivityDate="2015-12-29T17:05:52.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19135" PostTypeId="2" ParentId="13603" CreationDate="2015-12-28T17:13:43.113" Score="4" Body="&lt;p&gt;Here is a trick that I learned from &lt;a href=&quot;https://emacs.stackexchange.com/a/5990/8430&quot;&gt;this answer&lt;/a&gt; to only use &lt;code&gt;electric-pair-mode&lt;/code&gt; with specifically whitelisted modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-electic-pair-modes '(python-mode org-mode))&#xA;&#xA;(defun my-inhibit-electric-pair-mode (char)&#xA;  (not (member major-mode my-electic-pair-modes)))&#xA;&#xA;(setq electric-pair-inhibit-predicate #'my-inhibit-electric-pair-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can add any mode that you want to use &lt;code&gt;electric-pair-mode&lt;/code&gt; for to &lt;code&gt;my-electric-pair-modes&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tested this, and &lt;strong&gt;it removes the annoyance of having parens pair in the minibuffer&lt;/strong&gt;. In your case you can replace &lt;code&gt;python-mode&lt;/code&gt; with &lt;code&gt;latex-mode&lt;/code&gt; or whatever modes you want. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2015-12-28T17:13:43.113" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19136" PostTypeId="1" CreationDate="2015-12-28T19:06:02.447" Score="4" ViewCount="1040" Body="&lt;h2&gt;Context / initial need (works fine)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I wrote and use a script that generates a file and uses &lt;code&gt;emacsclient&lt;/code&gt; to edit it in an existing or new instance of &lt;code&gt;emacs&lt;/code&gt;, in a new window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/146/set-up-emacs-on-windows-to-start-a-single-instance-and-open-files-in-the-existin&quot;&gt;Set up Emacs on Windows to start a single instance and open files in the existing instance - Emacs Stack Exchange&lt;/a&gt;, it boils down to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;exec emacsclient -c -s &quot;$SOCKETNAME&quot; -a emacs &quot;$GENERATEDFILENAME&quot; &amp;lt;&amp;gt;/dev/null&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's been working for years. &lt;code&gt;emacs&lt;/code&gt; open a new frame, opens the requested file there.  Works both if emacs already launched or not (my init files include &lt;code&gt;server-start&lt;/code&gt;).  So far, so good.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Wish: open file and run some simple expression&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;That on opening the new file, the cursor, instead of landing on the first line, lands (1) at the end of the buffer or (2) at the end of some specific line. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Search before you ask&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I actually use several one emacs instance per project, similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/10527/from-file-manager-open-file-in-specific-instance-of-emacs&quot;&gt;frames - From File Manager, open file in specific instance of Emacs - Emacs Stack Exchange&lt;/a&gt;. So there are several emacs instances with servers that may be active at a given time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there's no finite, known-in-advance, list of servers/projects.  So running that many servers in &lt;code&gt;.xinitrc&lt;/code&gt; like in &lt;a href=&quot;https://emacs.stackexchange.com/questions/495/multiple-emacs-instances-each-with-their-own-server&quot;&gt;emacsclient - Multiple Emacs instances each with their own server? - Emacs Stack Exchange&lt;/a&gt; is not an option.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Try before you ask&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Interactive experiment in &lt;code&gt;emacs&lt;/code&gt; session, OK&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Interactively,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x end-of-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;goes to the end of the buffer, and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u 11 move-end-of-line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;move the cursor 11-1 lines down then at the end of that line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, so good.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Scripted, new emacs instance: OK&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's try first running a new instance.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &quot;(find-file \&quot;$GENERATEDFILENAME\&quot;)&quot; --eval &quot;(end-of-buffer)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Line above correctly runs a new emacs instance, opens the requested file and puts cursor at end of buffer.  So far so good.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Scripted, existing emacs instance through &lt;code&gt;emacsclient&lt;/code&gt;: OK&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's run an emacs instance and make sure &lt;code&gt;server-start&lt;/code&gt; is run.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s &quot;$SOCKETNAME&quot; -e '(end-of-buffer)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Line above outputs &lt;code&gt;nil&lt;/code&gt;, showing that it connects to the &lt;code&gt;emacs-server&lt;/code&gt;, but does not move the cursor.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -s server- --eval &quot;(find-file \&quot;$GENERATEDFILENAME\&quot;)&quot; --eval &quot;(end-of-buffer)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Line above appears to open file and put cursor at end.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Having &lt;code&gt;emacsclient&lt;/code&gt; do the job in both cases (emacs already running, and new emacs): NOK&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's add &lt;code&gt;-a emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -s server- -a emacs --eval &quot;(find-file \&quot;$GENERATEDFILENAME\&quot;)&quot; --eval &quot;(end-of-buffer)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If emacs already runs with server, work okay.&lt;/li&gt;&#xA;&lt;li&gt;If emacs does not already run, instead of running the expressions, if opens two buffers names like the expression, as if the command was &lt;code&gt;emacs &quot;(find-file \&quot;$GENERATEDFILENAME\&quot;)&quot; &quot;(end-of-buffer)&quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Bad bad bad. :-(&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Showing why &quot;no emacs running&quot; case fails&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;strace&lt;/code&gt; shows what happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When running emacs directly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;execve(&quot;/usr/bin/emacs&quot;, [&quot;emacs&quot;, &quot;--eval&quot;, &quot;(find-file \&quot;2015y12m28d-18h23m49&quot;..., &quot;--eval&quot;, &quot;(end-of-buffer)&quot;], [/* 68 vars */]) = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When emacsclient calls emacs (in this case &lt;code&gt;GENERATEDFILENAME&lt;/code&gt; is &lt;code&gt;gfn.txt&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;execve(&quot;/usr/bin/emacsclient&quot;, [&quot;emacsclient&quot;, &quot;-c&quot;, &quot;-s&quot;, &quot;server-&quot;, &quot;-a&quot;, &quot;emacs&quot;, &quot;--eval&quot;, &quot;(find-file \&quot;gfn.txt\&quot;)&quot;, &quot;--eval&quot;, &quot;(end-of-buffer)&quot;], [/* 68 vars */]) = 0&#xA;execve(&quot;/usr/bin/emacs&quot;, [&quot;--eval&quot;, &quot;(find-file \&quot;gfn.txt\&quot;)&quot;, &quot;(end-of-buffer)&quot;], [/* 68 vars */]) = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, &lt;code&gt;emacsclient&lt;/code&gt; does not call &lt;code&gt;emacs&lt;/code&gt; the same way when using --eval.  Instead &lt;code&gt;argv[0]&lt;/code&gt; is &lt;code&gt;--eval&lt;/code&gt; which &lt;strong&gt;does not conform to exec tradition&lt;/strong&gt;, and the other &lt;code&gt;--eval&lt;/code&gt; is skipped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably &lt;code&gt;emacsclient&lt;/code&gt; does not assume that alternate editor is emacs or even emacs compliant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just in case, environment is Linux Mint 17.2 64-bit, which is base on Ubuntu 14.04.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Now what? Questions&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Should we consider &lt;code&gt;emacsclient&lt;/code&gt; behavior in the &lt;code&gt;exec()&lt;/code&gt; call a bug?  It sure has some inconsistency.&lt;/li&gt;&#xA;&lt;li&gt;Is there a simple way to have desired behavior: run the expressions either on an existing emacs instance or a new if none exists?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10614" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-05-29T21:45:51.767" Title="From an external script, open file and run some simple expression whether emacs already running or not" Tags="|emacsclient|server|eval-expression|command-line-arguments|invocation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19137" PostTypeId="2" ParentId="19136" CreationDate="2015-12-28T19:30:18.600" Score="1" Body="&lt;h1&gt;Sort-of solution: &lt;code&gt;emacsclient -a '' ...&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Looking at the automatic links appearing at the right of the question, I saw a question not seen before: &lt;a href=&quot;https://emacs.stackexchange.com/questions/7928/opening-frames-from-emacs-daemon&quot;&gt;emacsclient - Opening frames from emacs-daemon - Emacs Stack Exchange&lt;/a&gt;.  User there uses &lt;code&gt;emacsclient -a '' ...&lt;/code&gt; which incidentally solves the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it allows &lt;code&gt;emacsclient&lt;/code&gt; to assume that callee is a real emacs and therefore forward all emacs-specific call parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway it works now.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;But... new problem of emacs process staying&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;emacsclient -a '' ...&lt;/code&gt; the server never automatically quits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, emacs instances keep running forever which is not intended.  This also has some side effects, like preventing to umount external filesystems (e.g. USB keys), since they are used by some emacs instance which I have to search and stop.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still open to more explanations, other options, etc.  Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10614" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-01-29T18:25:34.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19139" PostTypeId="2" ParentId="9840" CreationDate="2015-12-28T22:09:40.873" Score="1" Body="&lt;p&gt;I find that using the javascript (c++) comment style (/**/ and //) is more convenient and also much easier to add to json-mode. I was able to add support for this in json-mode.el with some very minor changes (the json-mode.el itself):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defconst json-font-lock-keywords-1&#xA;   (list&#xA;-   (list json-mode-quoted-key-re    1 font-lock-keyword-face)&#xA;+   (list json-mode-quoted-key-re    1 font-lock-keyword-face t)&#xA;-   (list json-mode-quoted-string-re 1 font-lock-string-face)&#xA;    (list json-mode-keyword-re       1 font-lock-constant-face)&#xA;    (list json-mode-number-re        1 font-lock-constant-face)&#xA;    )&#xA;   &quot;Level one font lock.&quot;)&#xA;&#xA; ;;;###autoload                                                                                                                                                                                                                                                                                                                                                                                                  &#xA; (define-derived-mode json-mode javascript-mode &quot;JSON&quot;&#xA;   &quot;Major mode for editing JSON files&quot;&#xA;-  (set (make-local-variable 'font-lock-defaults) '(json-font-lock-keywords-1 t)))&#xA;+  (setq font-lock-defaults '(json-font-lock-keywords-1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Explanation:&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;font-lock-defaults&lt;/code&gt; automatically becomes buffer-local when set, so you don't need that extra &lt;code&gt;make-local-variable&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The 't' that I removed from the initialization of &lt;code&gt;font-lock-defaults&lt;/code&gt; (the second element in the list) corresponds to the keywords-only &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Basics.html&quot; rel=&quot;nofollow&quot;&gt;in emacs docs&lt;/a&gt;. It basically means that if you DON'T set it then you inherit the string and comment fontification from the parent mode - &lt;code&gt;javascript-mode&lt;/code&gt;, which has the exact comment syntax I want! :)&lt;/li&gt;&#xA;&lt;li&gt;Now that we inherit the string fontification from js-mode, we no longer need to do it ourselves, so that's why I removed &lt;code&gt;json-mode-quoted-string-re&lt;/code&gt; from &lt;code&gt;json-font-lock-keywords-1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The last important detail is that since we inherited all string syntax from &lt;code&gt;javascript-mode&lt;/code&gt;, all the strings, including the keys will have the &lt;code&gt;font-lock-string-face&lt;/code&gt; and not the &lt;code&gt;font-lock-keyword-face&lt;/code&gt;. To remedy this, I used the override element when adding &lt;code&gt;json-mode-quoted-key-re&lt;/code&gt;. If you look at the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html#Search_002dbased-Fontification&quot; rel=&quot;nofollow&quot;&gt;docs&lt;/a&gt; (where they talk about &lt;code&gt;(matcher . subexp-highlighter)&lt;/code&gt;), you'll see that if override is &lt;code&gt;t&lt;/code&gt; it simply replaces the previous fontification.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6987" LastActivityDate="2015-12-28T22:09:40.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19140" PostTypeId="1" AcceptedAnswerId="19165" CreationDate="2015-12-28T22:28:03.003" Score="4" ViewCount="684" Body="&lt;p&gt;I'm trying to highlight a syllable &lt;strong&gt;within a word&lt;/strong&gt; in order to show that it is different from another word. How can I do this with &lt;kbd&gt;*&lt;/kbd&gt; in org-mode and then properly export to LaTeX? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on Windows 7 32-bit, Emacs 24.4.1 (i686-pc-mingw32), Org-mode version 8.2.10.&#xA;I have followed the instructions &lt;a href=&quot;https://stackoverflow.com/questions/1218238/how-to-make-part-of-a-word-bold-in-org-mode&quot;&gt;on this page&lt;/a&gt; but something went wrong with Org -- it thinks an *.org file is a LaTeX file! I therefore had to comment out those lines in my &lt;em&gt;.emacs&lt;/em&gt; configuration file. The lines I'm talking about are these:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcar org-emphasis-regexp-components &quot; \t('\&quot;{[:alpha:]&quot;)&#xA;(setcar (nthcdr 1 org-emphasis-regexp-components) &quot;[:alpha:]- \t.,:!?;'\&quot;)}\\&quot;)&#xA;(org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know why, but they don't work with my emacs. Are they still valid? Can anyone help me out, please?&#xA;By the way I have this same question open on StackOverflow (&lt;a href=&quot;https://stackoverflow.com/questions/34499238/org-file-not-recognized-after-character-emphasis-changes-in-the-emacs-file-wh&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Screenshots&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This is the structure of &lt;em&gt;vocab.org&lt;/em&gt;. It has LaTeX tags at the bottom of the file so that when I export only the body as &lt;em&gt;vocab.tex&lt;/em&gt;, it doesn't have problems recognizing &lt;em&gt;vocab-main.tex&lt;/em&gt; as its master file. &lt;em&gt;vocab-main.tex&lt;/em&gt; is a file containing all the font and page formatting that make the final pdf look good to the eyes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NfxfX.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NfxfX.jpg&quot; alt=&quot;vocab.org file structure&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9269" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2015-12-30T17:18:04.420" Title="Why is this .org file not using any org-mode highlighting?" Tags="|org-mode|org-emphasis|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19141" PostTypeId="1" CreationDate="2015-12-28T23:49:45.367" Score="0" ViewCount="68" Body="&lt;p&gt;Just want to create a table of LaTeX command for Greek Alphabet. One column for the Greek Alphabet and one for the command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;\beta&lt;/code&gt;, it shows as Greek alphabet in the exported PDF file. How could I escape it to make it shows as LaTeX command?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2015-12-28T23:49:45.367" Title="How to have both Greek Alphabet and LaTeX command of it in the same table in exported PDF (TEX)?" Tags="|org-mode|latex|org-table|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19143" PostTypeId="1" AcceptedAnswerId="19780" CreationDate="2015-12-29T10:02:51.400" Score="4" ViewCount="189" Body="&lt;p&gt;I'd like to start using Gnus to read mailing lists via nntp/Gmane.  Works fine so far, but each time I press &lt;code&gt;RET&lt;/code&gt; on a group name in the &lt;code&gt;*Group*&lt;/code&gt; buffer, Gnus seems to download a lot of data (in case of the org-mode list, some 30+M, which takes 10+ seconds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I don't understand the workings of NNTP and Gnus properly, but shouldn't it be possible to somehow cache these data locally?  Waiting many seconds for entering a group seems to be a waste of time, especially since at this point, Gnus already knows the number of unread messages ...&lt;/p&gt;&#xA;" OwnerUserId="1985" LastEditorUserId="106" LastEditDate="2016-01-23T19:03:19.800" LastActivityDate="2016-01-23T19:03:19.800" Title="Possible to cache newsgroup message headers in Gnus" Tags="|gnus|spacemacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19144" PostTypeId="1" AcceptedAnswerId="19145" CreationDate="2015-12-29T15:19:49.697" Score="1" ViewCount="840" Body="&lt;p&gt;At work, if I am working on a bug fix, I sometimes want to base my hotfix branch off of the &lt;code&gt;merge-base&lt;/code&gt; of our &lt;code&gt;master&lt;/code&gt; and &lt;code&gt;develop&lt;/code&gt; branches, because the branch will eventually be merged into both of these branches, and sometimes, they (&lt;code&gt;master&lt;/code&gt; and &lt;code&gt;develop&lt;/code&gt;) will have diverged. From the command line I would do this with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git checkout `git merge-base master develop`&#xA;git checkout -b my-hotfix-branch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I am wondering is, &lt;strong&gt;is there a straightforward way to do this in &lt;code&gt;magit&lt;/code&gt;&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't fully understand some of the options in the branching popup, even after reading the documentation, and I am hesitant to experiment with my work repository. I know how to do the second command (checkout a new branch once I have checked out the &lt;code&gt;merge-base&lt;/code&gt;, but I am not sure how to check out the &lt;code&gt;merge-base&lt;/code&gt; itself). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Worse comes to worse, I assume everything will go fine if I run the command from the &lt;code&gt;magit-run-popup&lt;/code&gt;, but I am curious if there is a better way. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-12-30T18:07:39.693" Title="Create a branch off of the merge-base of two branches in magit" Tags="|magit|git|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19145" PostTypeId="2" ParentId="19144" CreationDate="2015-12-29T15:40:02.633" Score="1" Body="&lt;p&gt;There isn't a direct way to do that. What I would do - assuming that both of these branches have at most a few dozen commits since the merge-base - is to manually move to the merge-base in some log and then type &lt;kbd&gt;b c&lt;/kbd&gt;&lt;code&gt;hotfix&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. A good log to start from you would get with &lt;kbd&gt;l b&lt;/kbd&gt; (assuming &lt;code&gt;--graph&lt;/code&gt; is enabled), and then you have to press &lt;kbd&gt;n&lt;/kbd&gt; a &quot;few&quot; times.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T18:07:39.693" LastActivityDate="2015-12-30T18:07:39.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19146" PostTypeId="1" AcceptedAnswerId="19147" CreationDate="2015-12-29T16:18:05.510" Score="2" ViewCount="541" Body="&lt;p&gt;Is it possible to combine &lt;code&gt;:stepskip0&lt;/code&gt; and &lt;code&gt;:fileskip0&lt;/code&gt; in org mode clock tables?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can skip files with :&lt;code&gt;fileskip0&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 2 :scope agenda :block thisweek :step day :fileskip0&#xA;&#xA;Daily report: [2015-12-28 Mon]&#xA;| File | Headline         | Time   |&#xA;|------+------------------+--------|&#xA;|      | ALL *Total time* | *0:00* |&#xA;&#xA;Daily report: [2015-12-29 Tue]&#xA;| File             | Headline         | Time   |      |&#xA;|------------------+------------------+--------+------|&#xA;|                  | ALL *Total time* | *0:46* |      |&#xA;|------------------+------------------+--------+------|&#xA;| housekeeping.org | *File time*      | *0:46* |      |&#xA;|                  | Housekeeping     | 0:46   |      |&#xA;|                  | \emsp Reading    |        | 0:46 |&#xA;&#xA;Daily report: [2015-12-30 Wed]&#xA;| File | Headline         | Time   |&#xA;|------+------------------+--------|&#xA;|      | ALL *Total time* | *0:00* |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I can exclude empty days with &lt;code&gt;:stepskip0&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Daily report: [2015-12-29 Tue]&#xA;| File                  | Headline         | Time   |      |&#xA;|-----------------------+------------------+--------+------|&#xA;|                       | ALL *Total time* | *0:46* |      |&#xA;|-----------------------+------------------+--------+------|&#xA;| cba.org               | *File time*      | *0:00* |      |&#xA;|-----------------------+------------------+--------+------|&#xA;| consultations.org     | *File time*      | *0:00* |      |&#xA;|-----------------------+------------------+--------+------|&#xA;| cranberry.org         | *File time*      | *0:00* |      |&#xA;|-----------------------+------------------+--------+------|&#xA;| housekeeping.org      | *File time*      | *0:46* |      |&#xA;|                       | Housekeeping     | 0:46   |      |&#xA;|                       | \emsp Reading    |        | 0:46 |&#xA;|-----------------------+------------------+--------+------|&#xA;| journal.org           | *File time*      | *0:00* |      |&#xA;|-----------------------+------------------+--------+------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I'd like is both at once, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 2 :scope agenda :step day :block thisweek :stepskip0 :fileskip0&#xA;&#xA;Daily report: [2015-12-29 Tue]&#xA;| File             | Headline         | Time   |      |&#xA;|------------------+------------------+--------+------|&#xA;|                  | ALL *Total time* | *0:46* |      |&#xA;|------------------+------------------+--------+------|&#xA;| housekeeping.org | *File time*      | *0:46* |      |&#xA;|                  | Housekeeping     | 0:46   |      |&#xA;|                  | \emsp Reading    |        | 0:46 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So empty days and 0-time rows are both excluded. It seems that org only considers the first &lt;code&gt;:*skip0&lt;/code&gt; option. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-05-27T21:22:16.500" Title="Combine fileskip0 and stepskip0 in org mode clock tables" Tags="|org-mode|org-table|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19147" PostTypeId="2" ParentId="19146" CreationDate="2015-12-29T16:39:06.733" Score="3" Body="&lt;p&gt;It was my mistake. &lt;code&gt;:fileskip0&lt;/code&gt; and &lt;code&gt;:stepskip0&lt;/code&gt; work on their own with or without an explicitly set value, but to use them together you need to supply the value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :step day :block thisweek :stepskip0 t :fileskip0 t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was working from some examples I'd found online that omitted the value.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2015-12-29T16:39:06.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19148" PostTypeId="1" CreationDate="2015-12-29T17:08:33.223" Score="14" ViewCount="826" Body="&lt;h1&gt;Context&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;When emacs detects that a file was changed outside of an editing buffer.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Observed&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;emacs will ask:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;somefilename changed in disk; really edit the buffer? (y, n, r or C-h) &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Incidentally, sometimes it happens even when there is no actual change, e.g. remote file on a server with drifted clock, but the question is interesting in all cases.)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Wished&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;emacs would ask:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;somefilename changed in disk; really edit the buffer? (y, n, r, d or C-h) &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;code&gt;d&lt;/code&gt; would show the difference between versions, e.g. &lt;code&gt;ediff-current-file&lt;/code&gt; which allows to walk the differences interactively.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Additional information&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;That would be similar to what Debian package management does when it detects that a config file locally customized gets updated by a newer version of its owning package. For an example see &lt;a href=&quot;https://unix.stackexchange.com/questions/113732/a-new-version-of-configuration-file-etc-default-grub-is-available-but-the-vers&quot;&gt;A new version of configuration file /etc/default/grub is available, but the version installed currently has been locally modified - Unix &amp;amp; Linux Stack Exchange&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Search before you ask&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I usually find my way to solutions (e.g. &lt;a href=&quot;https://emacs.stackexchange.com/questions/19136/from-an-external-script-open-file-and-run-some-simple-expression-whether-emacs&quot;&gt;emacsclient - From an external script, open file and run some simple expression whether emacs already running or not - Emacs Stack Exchange&lt;/a&gt;) but after searching on this I could not find any pre-existing solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd consider adjusting this myself but am not proficient enough in emacs-lisp and emacs internals.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Sketch of solution&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Pressing &lt;code&gt;C-g&lt;/code&gt; then 'M-x ediff-current-file` does the job, at the cost of some keystrokes.&lt;/li&gt;&#xA;&lt;li&gt;The goal here would be to run &lt;code&gt;ediff-current-file&lt;/code&gt; on one keypress at the above prompt.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10614" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-01-29T21:50:48.197" Title="On &quot;really edit the buffer&quot;, have emacs run ediff-current-file automatically?" Tags="|ediff|revert-buffer|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19149" PostTypeId="1" AcceptedAnswerId="19150" CreationDate="2015-12-29T18:02:00.870" Score="11" ViewCount="8074" Body="&lt;p&gt;From what I remember, if I am working on a branch, e.g., &lt;code&gt;my-feature-branch&lt;/code&gt;, I used to be able to do this from the &lt;code&gt;magit-status&lt;/code&gt; menu with &lt;code&gt;P P&lt;/code&gt;, and then selecting the remote branch from a list which had &lt;code&gt;origin/my-feature-branch&lt;/code&gt; at the top. This worked beautifully. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently, &lt;a href=&quot;https://emacs.stackexchange.com/questions/18924/new-magit-interface-no-actual-push&quot;&gt;as of this discussion&lt;/a&gt;, I could do something similar with &lt;code&gt;P -u e&lt;/code&gt; (opening the &lt;code&gt;magit-push-popup&lt;/code&gt;, setting the &lt;code&gt;--set-upstream&lt;/code&gt; flag, and using &lt;code&gt;e&lt;/code&gt; for elsewhere), which would similarly let me pick from a list of branches starting with &lt;code&gt;origin/my-feature-branch&lt;/code&gt;. This worked fine for me too. Even more recently however, this no longer works, and I haven't been able to figure out the best way to set an upstream branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;P e&lt;/code&gt; the first option for a branch to push to is &lt;code&gt;origin/my-feature-branch&lt;/code&gt;, which is almost always what I want. However, it doesn't set &lt;code&gt;origin/my-feature-branch&lt;/code&gt; as the upstream for my local branch. Using &lt;code&gt;P u&lt;/code&gt; allows me to pick the upstream branch, but &lt;code&gt;origin/my-feature-branch&lt;/code&gt; is not in the list, and I have to type out &lt;code&gt;origin/my-feature-branch&lt;/code&gt; without tab completion (I know this is not hard, but it is prone to user error, and is slower than the command line). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the only way to set an upstream branch now, or am I missing something? I have looked at other discussions and documentation related to the issue, but all the sources I have found seem to be out of date.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-29T21:30:00.727" Title="How do I set the upstream branch to push a local branch to in magit?" Tags="|magit|git|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19150" PostTypeId="2" ParentId="19149" CreationDate="2015-12-29T21:22:08.753" Score="14" Body="&lt;p&gt;There are several ways to set the upstream, while pushing or without pushing at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;magit-push-current-set-remote-if-missing&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt; (the default), then you will see something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; p pushRemote, after setting that&#xA; u @{upstream}, after setting that&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To push to &lt;code&gt;origin/feature&lt;/code&gt; and set that as upstream press &lt;kbd&gt;u&lt;/kbd&gt; and then &lt;kbd&gt;RET&lt;/kbd&gt; to accept the default completion candidate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;magit-push-current-set-remote-if-missing&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, then you would see this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you did press &lt;kbd&gt;p&lt;/kbd&gt; now, then you would be told that the upstream is not configured (implying that you cannot push to the upstream if there is no upstream).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if &lt;code&gt;magit-push-current-set-remote-if-missing&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, then the list of switches would feature &lt;code&gt;--set-upstream&lt;/code&gt;, so you could use &lt;kbd&gt;P - u p&lt;/kbd&gt; as you are used to (except that the second p is lowercase). There's one complication though: after changing the value of &lt;code&gt;magit-push-current-set-remote-if-missing&lt;/code&gt; you have to restart Emacs for &lt;code&gt;--set-upstream&lt;/code&gt; to appear or disappear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally you can set the upstream using the &quot;set upstream (and do nothing else)&quot; command: &lt;kbd&gt;b u&lt;/kbd&gt;&lt;code&gt;origin/master&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. Note that when you use this approach, then you can only select a branch which already exists.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But it would be better to configure the push-remote and push to that. To learn more about the push-remote and how it differs from the upstream, see the &lt;em&gt;Branching&lt;/em&gt; node in the info manual (the web version hasn't been updated yet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically the upstream branch is the branch into which your feature branch will eventually be merged (by merging or rebasing, not by pushing), most likely &lt;code&gt;origin/master&lt;/code&gt;. And the push-remote is where you push your feature branches to while still working on them or so that someone else can merge them. If the local branch is named &lt;code&gt;feature&lt;/code&gt; and the push-remote is &lt;code&gt;my-fork&lt;/code&gt;, then pushing that branch using &lt;kbd&gt;P p&lt;/kbd&gt; would push to &lt;code&gt;my-fork/feature&lt;/code&gt;. (The &quot;push-to-branch&quot; cannot be configured, the name of the branch on the push-remote is always the same as the local name.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So while your question was something like &quot;how do I push to the upstream, while configuring the upstream at the same time&quot;, my recommendation is to not push to the upstream at all, but to instead push to the push-remote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Provided you have not changed the value of &lt;code&gt;magit-push-current-set-remote-if-missing&lt;/code&gt; you can configure the push-remote using &lt;kbd&gt;P p&lt;/kbd&gt;&lt;code&gt;some-remote&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;. But, since you likely push all feature branches to the same remote, it is better to set the push-remote once for all branches and be done with it: &lt;kbd&gt;b&lt;/kbd&gt; and then &lt;kbd&gt;M-p&lt;/kbd&gt; until the right remote is selected.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also note that it should usually not be necessary to explicitly set the upstream branch. When you create a new branch and select a remote branch as starting-point, then that is used as the upstream.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the starting-point usually is a local branch and in that case Git by default doesn't use it as the upstream. But that can easily be fixed by running this once:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git config --global branch.autoSetupMerge always&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The default value is &lt;code&gt;true&lt;/code&gt;, which means &quot;set starting-point as upstream, provided it is a &lt;em&gt;remote&lt;/em&gt; branch&quot;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;By the way, the same applies to the push-remote. That too should usually be set semi-automatically in &quot;new&quot; repositories. If you clone a repository, you will be asked whether you want to use &lt;code&gt;origin&lt;/code&gt; as the push-remote. You should answer &quot;yes&quot;, unless you are going to add another remote, say &lt;code&gt;my-fork&lt;/code&gt;, which should be used as the push-remote. When you add a new remote using &lt;kbd&gt;M a&lt;/kbd&gt; and &lt;code&gt;remote.pushDefault&lt;/code&gt; isn't set yet, then you will be asked whether you want to use the newly added remote as the push-remote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be configured using &lt;code&gt;magit-clone-set-remote.pushDefault&lt;/code&gt; and &lt;code&gt;magit-remote-add-set-remote.pushDefault&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another advanced option is &lt;code&gt;magit-branch-prefer-remote-upstream&lt;/code&gt;, which defaults to &lt;code&gt;nil&lt;/code&gt;. If you set it to &lt;code&gt;t&lt;/code&gt;, and then select a local branch as the starting-point for a new branch, then the upstream of the starting-point &lt;em&gt;might&lt;/em&gt; (according to some rules, see doc-string) be used as the upstream, instead of the starting-point itself.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-29T21:30:00.727" LastActivityDate="2015-12-29T21:30:00.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19151" PostTypeId="1" AcceptedAnswerId="19153" CreationDate="2015-12-29T21:41:47.810" Score="2" ViewCount="713" Body="&lt;p&gt;I'm trying to make a table like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |  x |   y |&#xA;| a | 12 | 354 |&#xA;| b | 45 |  65 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when I export it to pdf via beamer/latex I'd like to have a short comment below it (like Souce: www.google.com). Is this possible to do? &lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2016-01-28T23:10:35.603" Title="Have short comments at bottom of table in org mode (beamer/latex export)" Tags="|org-mode|org-export|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19152" PostTypeId="1" AcceptedAnswerId="19227" CreationDate="2015-12-29T21:52:17.973" Score="1" ViewCount="1942" Body="&lt;p&gt;In org-mode, Latex previews are not loaded at startup when using &lt;code&gt;#+STARTUP: latexpreview&lt;/code&gt;. I've also tried customizing &lt;code&gt;org-startup-with-latex-preview&lt;/code&gt; with no effect. Only way to preview latex fragment is individually doing so by using &lt;code&gt;C-c C-x C-l&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As example I'm using the following org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: showall indent latexpreview entitiespretty&#xA;* dfs&#xA;* df [2/2]                                                              :prb:&#xA;- [X] sdf&#xA;- [X] sac&#xA;* LaTeX embed:&#xA;** \gamma \alpha \beta \theta Caracteres especiales, renderizados con: C-c C-x \ Se hace permanente con #+STARTUP: entitiespretty&#xA;** Subscripts M_sun ( =M_sun= ) | Superscripts 2^2 ( =2^2= C-x 8 RET hex RET)&#xA;** $a ^2=b$ Previsualizar con =C-c C-x C-l= &#xA;** Previsualizar con =C-c C-x C-l=&#xA;\begin{equation}&#xA;x=\sqrt{b}&#xA;\end{equation}      &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;Following tobias advice I checked with emacs -Q which seem to work, but now, I don't know what is it in my emacs init file that is making the previews to fail. Next is my init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path' &quot;/home/khamsin/.emacs.d/cc-mode&quot;)&#xA;(add-to-list 'load-path' &quot;/home/khamsin/.emacs.d/custom&quot;)&#xA;&#xA;(setq ring-bell-function 'ignore)&#xA;(tool-bar-mode -1)&#xA;(menu-bar-mode -1)&#xA;(setq inhibit-startup-message t)&#xA;&#xA;(require 'package)&#xA;(package-initialize)&#xA;&#xA;;; Activate Solarized theme&#xA;(load-theme 'zenburn t)&#xA;&#xA;;; Elpa repositories:&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t) ; Org-mode's repository&#xA;&#xA;;; Acivate Line Numbers&#xA;(global-linum-mode 1)&#xA;&#xA;;; Ativate indentation at RET&#xA;(global-set-key (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;;; (define-key c-mode-base-map (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;&#xA;;;;;;;;;;; Org require and configuration ;;;;;;;;;;&#xA;(define-key global-map &quot;\C-cl&quot; 'org-store-link)&#xA;(define-key global-map &quot;\C-ca&quot; 'org-agenda)&#xA;&#xA;;; Shift select config&#xA;(setq org-support-shift-select t)&#xA;&#xA;;; Org mode margin&#xA;(setq-default fill-column 80)&#xA;(add-hook 'org-mode-hook 'turn-on-auto-fill)&#xA;&#xA;;; Autopair&#xA;(defun autopair-insert-opening ()&#xA;     (interactive)&#xA;     (when (autopair-pair-p)&#xA;       (setq autopair-action (list 'opening (autopair-find-pair) (point))))&#xA;     (autopair-fallback))&#xA;&#xA;&#xA;;; C Style identation&#xA;(setq c-default-style &quot;bsd&quot;&#xA;          c-basic-offset 4)&#xA;(setq-default c-basic-offset 4&#xA;                  tab-width 4&#xA;                  indent-tabs-mode t)&#xA;(add-hook 'c-mode-common-hook '(lambda () (c-toggle-auto-state 1)))&#xA;&#xA;;; Set default font&#xA;(set-default-font &quot;Ubuntu Mono-14&quot;)&#xA;&#xA;(set-fontset-font &quot;fontset-default&quot;&#xA;                  'japanese-jisx0208&#xA;                  '(&quot;Source Han Sans JP&quot; . &quot;iso10646-1&quot;))&#xA;&#xA;;; Org LaTeX alignment&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(initial-frame-alist (quote ((fullscreen . maximized)))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10621" LastEditorUserId="10621" LastEditDate="2015-12-30T10:14:14.753" LastActivityDate="2016-10-07T14:51:45.160" Title="Org-mode does not load Latex previews at startup" Tags="|org-mode|latex|auctex|start-up|preview-latex|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19153" PostTypeId="2" ParentId="19151" CreationDate="2015-12-29T22:45:16.357" Score="4" Body="&lt;p&gt;After much google-ing, I've found a way to make this happen. It relies on the LaTeX package &lt;code&gt;threeparttable&lt;/code&gt; so you must add that to your org preamble:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage{threeparttable}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then add comments in the following manner: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_table&#xA;#+begin_threeparttable&#xA;#+ATTR_LATEX: :environment tabular :width \textwidth :center nil&#xA;|   |  x |   y |&#xA;| a | 12 | 354 |&#xA;| b | 45 |  65 |&#xA;#+begin_tablenotes&#xA;  \item[] here are some notes \item[] Here's a note on a new line&#xA;#+end_tablenotes&#xA;#+end_threeparttable&#xA;#+end_table&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which produces a nicely-formatted table as a pdf through beamer. &lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2015-12-29T22:45:16.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19154" PostTypeId="1" CreationDate="2015-12-29T23:56:27.320" Score="0" ViewCount="35" Body="&lt;p&gt;Given an org-mode file like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: My title&#xA;#+AUTHOR: Me Myself&#xA;&#xA;First and so on words sixth this we don't want &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get the first &lt;em&gt;N&lt;/em&gt; words of the main body?  So for &lt;em&gt;N=5&lt;/em&gt;, I would like to get the string &lt;code&gt;First and so on words&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If possible, links should only count with their &lt;code&gt;desc&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2015-12-30T06:23:20.640" Title="How to get the first N words of an org file's main body" Tags="|org-mode|string|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19155" PostTypeId="2" ParentId="14543" CreationDate="2015-12-30T00:22:35.517" Score="3" Body="&lt;p&gt;Since this question was asked a few things related to this have changes (starting with &lt;code&gt;v2.4&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all instead of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unpushed commits (1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you would now see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unpushed to origin/master (1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which should make this quite a bit more obvious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore Magit now supports a push-remote in addition to the upstream branch. The upstream of some feature branch is the branch into which it should eventually be &lt;em&gt;merged&lt;/em&gt; (not pushed to). Often the upstream is &lt;code&gt;origin/master&lt;/code&gt;. The push-remote is where you actually push to. To learn more about these remotes see the &lt;em&gt;Branching&lt;/em&gt; node in the &lt;code&gt;magit&lt;/code&gt; info manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Configuring two &quot;related branches&quot; for each branch has many advantages. One advantage, which is relevant to this question, is that this makes it possible to show both the commits that have not made it into the mainline yet, as well as the commits which nobody else can see yet, because you haven't pushed them anywhere yet at all. E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unpushed to origin/master (5)        # 5 not in mainline yet&#xA;Unpushed to my-fork/feature (2)      # 2 of those 5 not at all pushed yet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T23:29:01.527" LastActivityDate="2015-12-30T23:29:01.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19156" PostTypeId="1" AcceptedAnswerId="19159" CreationDate="2015-12-30T01:41:45.627" Score="7" ViewCount="2061" Body="&lt;p&gt;Occasionally, emacs opens a file in &lt;code&gt;shell-script[fish]&lt;/code&gt; when I want it to open in &lt;code&gt;shell-script[bash]&lt;/code&gt;. How can I manually change the subtype of shell-script mode that I'm in?&lt;/p&gt;&#xA;" OwnerUserId="8338" LastActivityDate="2015-12-30T04:13:52.643" Title="How can I change which shell script mode I'm in?" Tags="|major-mode|commands|shell-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19157" PostTypeId="1" CreationDate="2015-12-30T02:38:06.957" Score="6" ViewCount="183" Body="&lt;p&gt;I've just finished a pretty significant refactoring; byte-compiler warnings were a great way to quickly find errors, without even running tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, &lt;strong&gt;there's one kind of code smell that the byte-compiler doesn't seem to catch: unused variables&lt;/strong&gt;. And unfortunately, tests are powerless against that one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, my recent refactoring caused a number of internal &lt;code&gt;defconst&lt;/code&gt;s to become useless; but I didn't get warnings. Same for &lt;code&gt;defvar&lt;/code&gt;s and even a few &lt;code&gt;defun&lt;/code&gt;s. All of these were private &lt;code&gt;my-package--blah&lt;/code&gt;, so I really don't expect them to be used outside of the package. Even then, &quot;unused definition&quot; warnings would be useful (I'd mark the definitions obsolete, for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to get warnings about unused definitions?&lt;/strong&gt; I don't mind false positives too much (using intern and eval could hide uses of a definition from the byte-compiler, for example).&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="105" LastEditDate="2016-03-14T17:20:31.493" LastActivityDate="2016-11-20T01:36:17.180" Title="Can the byte-compiler warn me about unused variables?" Tags="|byte-compilation|warning|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19158" PostTypeId="1" CreationDate="2015-12-30T03:50:41.150" Score="3" ViewCount="566" Body="&lt;p&gt;In my &lt;code&gt;django&lt;/code&gt; project I use basic &lt;code&gt;.html&lt;/code&gt; files for my templates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to force the &lt;code&gt;django&lt;/code&gt; engine from &lt;code&gt;web-mode.el&lt;/code&gt; so I don't have to constantly change between &lt;code&gt;.html&lt;/code&gt; and &lt;code&gt;.djhtml&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-engines-alist&#xA;      '((&quot;django&quot;    . &quot;\\.html\\'&quot;))&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with no luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone had any success in this? Should I try out a different plugin?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2016-08-01T14:10:07.390" Title="Force web-mode.el Engine" Tags="|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19159" PostTypeId="2" ParentId="19156" CreationDate="2015-12-30T04:13:52.643" Score="4" Body="&lt;p&gt;What is determining whether you see &lt;code&gt;shell-script[fish]&lt;/code&gt; or &lt;code&gt;shell-script[bash]&lt;/code&gt; is probably:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The extension of the file (&lt;code&gt;*.sh&lt;/code&gt; files will probably open with &lt;code&gt;shell-script[bash]&lt;/code&gt;, and &lt;code&gt;*.fish&lt;/code&gt; files will probably open with &lt;code&gt;shell-script[fish]&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The starting #!-line (e.g., if the first line of the file you are opening is &lt;code&gt;#!/bin/bash&lt;/code&gt;, it should start in &lt;code&gt;shell-script[bash]&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am not sure in your case what is causing your files to open in different submodes (if you provide further detail in your question I will update my answer if necessary), but if you want to be able to manually switch between submodes as you say, you can do so with the command &lt;code&gt;M-x sh-set-shell&lt;/code&gt; (for me it is bound to &lt;code&gt;C-c :&lt;/code&gt;) and then select your desired shell from a list of completions or type it in yourself. It should also update the #!-line of whatever script you are editing.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2015-12-30T04:13:52.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19160" PostTypeId="2" ParentId="19154" CreationDate="2015-12-30T06:23:20.640" Score="1" Body="&lt;p&gt;This wasn't thoroughly tested, and I'm not really sure what parts of Org file to treat as its main body, but here you go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/first-n-org-words (n)&#xA;  (interactive &quot;nHow many words: &quot;)&#xA;  (let ((buf (get-buffer-create &quot;*org-first-words*&quot;))&#xA;        results)&#xA;    (catch t&#xA;      (org-element-map (org-element-parse-buffer)&#xA;          '(headline iterm paragraph plain-list verse-block)&#xA;        (lambda (record)&#xA;          (cl-destructuring-bind (kind options &amp;amp;rest contents) record&#xA;            (let ((begin (plist-get options :begin))&#xA;                  (cnt (if (and contents (stringp (car contents)))&#xA;                           (car contents)&#xA;                         (or (car (plist-get options :title))&#xA;                             (plist-get options :value)))))&#xA;              (when cnt&#xA;                (setq results&#xA;                      (append results&#xA;                              (split-string &#xA;                               (substring-no-properties cnt 0 (length cnt))&#xA;                               &quot;[ \t\n]+&quot; t)&#xA;                              results))&#xA;                (when (&amp;gt;= (length results) n)&#xA;                  (throw t nil))))))))&#xA;    (with-current-buffer buf&#xA;      (erase-buffer)&#xA;      (insert (mapconcat 'identity results &quot;\n&quot;)))&#xA;    (pop-to-buffer buf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you are unhappy about what parts of the Org file it looks into, change the second argument of &lt;code&gt;org-element-map&lt;/code&gt;.  To see what values are possible, look at the value of &lt;code&gt;org-element-all-elements&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2015-12-30T06:23:20.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19161" PostTypeId="1" CreationDate="2015-12-30T07:19:03.093" Score="4" ViewCount="3243" Body="&lt;p&gt;Here's my proxy setup: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq url-proxy-services '((&quot;no_proxy&quot; . &quot;my-corp-proxy&quot;)&#xA;                           (&quot;http&quot; . &quot;my-corp-proxy:8080&quot;)&#xA;                           (&quot;https&quot; . &quot;my-port-proxy:8080&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can use &lt;code&gt;eww&lt;/code&gt; to access HTTP sites, but when I try to access HTTPS sites I get this response:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DL62k.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DL62k.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've installed &lt;code&gt;gnutls&lt;/code&gt; as well; evaluating &lt;code&gt;(gnutls-available-p)&lt;/code&gt; gives &lt;code&gt;t&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I solve this issue?&lt;/p&gt;&#xA;" OwnerUserId="10287" LastEditorUserId="15748" LastEditDate="2018-02-08T15:53:30.343" LastActivityDate="2018-02-08T15:53:30.343" Title="EWW cannot access HTTPS sites via proxy" Tags="|eww|url|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19162" PostTypeId="1" CreationDate="2015-12-30T07:35:34.633" Score="1" ViewCount="88" Body="&lt;p&gt;In magit status buffer, it said:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Head:     feature/event&#xA;Rebase:   origin/feature/event123&#xA;Tag:      8000.102 (9)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if run git status, I don't see such Rebase information if simply run the following in command line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git status&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the meaning of Rebase here?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2015-12-30T15:30:43.273" Title="What's the meaning of rebase in magit status buffer?" Tags="|magit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19163" PostTypeId="1" AcceptedAnswerId="19166" CreationDate="2015-12-30T08:20:57.127" Score="5" ViewCount="396" Body="&lt;p&gt;Since command outputs are easily mutable, I have to be careful when I work with eshell and REPL buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to protect them?&lt;/p&gt;&#xA;" OwnerDisplayName="user8780" LastActivityDate="2016-01-02T11:27:37.033" Title="How do I protect command output in eshell and REPL buffers?" Tags="|eshell|repl|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19164" PostTypeId="1" AcceptedAnswerId="19737" CreationDate="2015-12-30T08:49:09.840" Score="6" ViewCount="1058" Body="&lt;p&gt;I'm using mu4e as my email client and it works fine for the most part.  However, I'm working with patches sent via email very often and mu4e won't display inlined attachments as part of the email body, which is very inconvenient.  Instead it lists them as attachments that I can awkwardly open in Emacs with a little too many steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to let mu4e display certain attachments &lt;strong&gt;inline&lt;/strong&gt; with the email text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I would also like attachments of type &lt;code&gt;text/plain&lt;/code&gt; or &lt;code&gt;text/x-patch&lt;/code&gt; to be displayed inline, even when their &lt;code&gt;Content-Disposition&lt;/code&gt; is &lt;code&gt;attachment&lt;/code&gt;, but that's optional.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is especially annoying when I get an email with an embedded short patch snippet, with the body text continuing afterward.  The snippet is cut out of context and having to do &lt;code&gt;A-e 2 RET&lt;/code&gt; is taking me out of the email.&lt;/p&gt;&#xA;" OwnerDisplayName="user2005" LastEditorDisplayName="user2005" LastEditDate="2016-01-15T13:21:22.330" LastActivityDate="2016-01-21T04:22:34.300" Title="How to display plain text attachments inline with mu4e?" Tags="|email|mu4e|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19165" PostTypeId="2" ParentId="19140" CreationDate="2015-12-30T10:53:30.317" Score="6" Body="&lt;p&gt;The figure you added in the question explains everything!&#xA;You have the line&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mode: latex&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in your file-local variables of the file &lt;code&gt;vocab.org&lt;/code&gt;.&#xA;And &lt;code&gt;latex-mode&lt;/code&gt; is exactly what you get!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need these lines in your org-file you should add a line with only the special form-feed character &lt;code&gt;^L&lt;/code&gt; in it right after &lt;code&gt;#+END_LATEX&lt;/code&gt;.&#xA;You can input the form-feed character by typing &lt;kbd&gt;C-q C-L&lt;/kbd&gt; or &lt;kbd&gt;C-q C-l&lt;/kbd&gt; (after &lt;kbd&gt;C-q&lt;/kbd&gt; uppercase or lowercase letter L with control key pressed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;File local variables are searched from the end of the file. The form-feed character limits this search forcefully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The end of your file should look like in the following picture.&#xA;Note the &lt;code&gt;^L&lt;/code&gt; in the picture! It should be marked by some color as control character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1yqM4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1yqM4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2015-12-30T11:12:16.447" LastActivityDate="2015-12-30T11:12:16.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19166" PostTypeId="2" ParentId="19163" CreationDate="2015-12-30T15:06:50.517" Score="5" Body="&lt;p&gt;Modes that communicate with external shells should inherit from &lt;code&gt;comint&lt;/code&gt; mode. &lt;code&gt;eshell&lt;/code&gt; is an exception w.r.t this principle since it emulates almost all commands on elisp-base. First, setting output read-only is described for &lt;code&gt;eshell&lt;/code&gt; afterwards for &lt;code&gt;comint&lt;/code&gt;-based modes.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;code&gt;eshell&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The following lisp snippet demonstrates the usage of &lt;code&gt;eshell-output-filter-functions&lt;/code&gt; for setting the output read-only.&#xA;It is not very sophisticated and not thoroughly tested.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun eshell-interactive-output-readonly ()&#xA;  &quot;Make output of interactive commands in eshell read-only.&#xA;This should be the last entry in eshell-output-filter-functions!&quot;&#xA;  (let ((end eshell-last-output-end))&#xA;    (save-excursion&#xA;      (goto-char end)&#xA;      (end-of-line 0)&#xA;      (setq end (point)))&#xA;    (when (&amp;lt; eshell-last-output-block-begin end)&#xA;      (put-text-property eshell-last-output-block-begin end 'read-only &quot;Read-only interactive eshell output&quot;))))&#xA;&#xA;(defun eshell-make-interactive-output-readonly ()&#xA;  (add-hook 'eshell-output-filter-functions 'eshell-interactive-output-readonly 'append))&#xA;&#xA;(add-hook 'eshell-mode-hook 'eshell-make-interactive-output-readonly)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;&lt;code&gt;comint&lt;/code&gt; based modes:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It looks like one cannot use &lt;code&gt;comint-output-filter-functions&lt;/code&gt; for setting the command output read-only in &lt;code&gt;comint&lt;/code&gt;-based modes.&#xA;The reason is that &lt;code&gt;comint-output-filter&lt;/code&gt; sets unconditionally the &lt;code&gt;rear-nonsticky&lt;/code&gt; text property to &lt;code&gt;t&lt;/code&gt;. Therefore you can insert text into the output despite of the &lt;code&gt;read-only&lt;/code&gt;-property even if already existing output characters cannot be modified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only chance to protect the output is an &lt;code&gt;after&lt;/code&gt;-advice for &lt;code&gt;comint-output-filter&lt;/code&gt;. The following code-snippet demonstrates the principle.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defadvice comint-output-filter (after output-readonly activate)&#xA;  &quot;Set last process output read-only.&quot;&#xA;  (add-text-properties comint-last-output-start (line-end-position 0)&#xA;               '(read-only &quot;Process output is read-only.&quot;&#xA;                   rear-nonsticky (inhibit-line-move-field-capture))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-02T11:27:37.033" LastActivityDate="2016-01-02T11:27:37.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19167" PostTypeId="1" CreationDate="2015-12-30T15:12:24.327" Score="2" ViewCount="331" Body="&lt;p&gt;I'm using Spacemacs with Solarized dark theme on Arch linux using i3wm, and I'm having some issues with tooltips. If I open Emacs so it only covers part of the screen, the tooltips shows up with the correct font, colors and size. If I fullscreen Emacs (and optionally make it smaller again), the tooltips seems to revert to some standard X11 theme with a black background, white text and very small font (I'm on a HiDPI display). Changing theme and back doesn't revert the correct tooltip theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what is wrong here and how I might fix it? I don't know what information would be useful, and I'm totally new on Emacs.&lt;/p&gt;&#xA;" OwnerUserId="10624" LastActivityDate="2016-01-30T13:37:47.040" Title="Spacemacs not using the theme for tooltips after resizing the window" Tags="|themes|spacemacs|tooltip|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19168" PostTypeId="2" ParentId="19162" CreationDate="2015-12-30T15:17:44.393" Score="2" Body="&lt;p&gt;Until recently the line would have been:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Upstream:  origin/feature/event123&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which tells you that &lt;code&gt;feature/event&lt;/code&gt;s upstream branch is &lt;code&gt;origin/feature/event123&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have changed it so that either &quot;Merge&quot; or &quot;Rebase&quot; is shown instead of &quot;Upstream&quot;. &quot;Rebase&quot; is shown if &lt;code&gt;branch.feature/event.rebase&lt;/code&gt; is true, &quot;Merge&quot; otherwise.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T15:30:43.273" LastActivityDate="2015-12-30T15:30:43.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19169" PostTypeId="1" CreationDate="2015-12-30T15:30:06.723" Score="4" ViewCount="865" Body="&lt;p&gt;I'm looking for an easy way to highlight a chunk of text inside a Babel source block (not the entire block) and execute that inside the current session (creating the new session buffer if necessary).  In my case, it's almost always R code, but theoretically I guess it should sense the language of the block the same way &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt; does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't need the results inserted back in the org buffer, I'm only executing for side effects like defining variables, etc., similar to hitting &lt;kbd&gt;Cmd&lt;/kbd&gt;-&lt;kbd&gt;Return&lt;/kbd&gt; in RStudio.&lt;/p&gt;&#xA;" OwnerUserId="8899" LastActivityDate="2023-10-11T08:00:43.063" Title="Org mode: execute region in session" Tags="|org-mode|org-babel|session|r|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19170" PostTypeId="1" AcceptedAnswerId="30697" CreationDate="2015-12-30T15:42:35.210" Score="9" ViewCount="852" Body="&lt;p&gt;Normally on OS X if you hold down a key, e.g. the &lt;code&gt;a&lt;/code&gt; you get a menu after a little while that allows you to input an accented character. It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TuKDN.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TuKDN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to activate this input dialogue from Emacs? Doing it the same way as on other OS X apps (by holding down a key) would be great, but I'd accept just being able to bind it to a key combination. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I install Emacs from &lt;a href=&quot;http://emacsformacosx.com&quot; rel=&quot;noreferrer&quot;&gt;http://emacsformacosx.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10625" LastEditorUserId="10625" LastEditDate="2015-12-30T16:37:28.620" LastActivityDate="2017-02-14T01:44:24.960" Title="How to bring up the OS X `accented-characters` dialogue in Emacs on OS X?" Tags="|osx|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19171" PostTypeId="2" ParentId="18924" CreationDate="2015-12-30T18:25:09.603" Score="2" Body="&lt;p&gt;I have already provided another, more complete answer, but because another answer was accepted, which no longer is correct, I additionally provide this TL;DR answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I already intended to make this change when you posed your question. (You are using the development version, so you have to expect that sometimes a feature only exists in an unfinished and suboptimal state.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Assuming that you have not customized any variables related to this and the upstream has not been configured yet, you will see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; p pushRemote, after setting that&#xA; u @{upstream}, after setting that&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now type &lt;kbd&gt;u&lt;/kbd&gt;, causing &lt;code&gt;Set upstream of feature and push there&lt;/code&gt; to appear in the minibuffer. The default completion candidate likely is &lt;code&gt;origin/master&lt;/code&gt;, but &lt;code&gt;origin/feature&lt;/code&gt; is offered as another candidate. How you select the desired candidate of course depends on the completion framework you use, but generally speaking pressing &lt;kbd&gt;M-n&lt;/kbd&gt; or &lt;kbd&gt;&amp;lt;down&gt;&lt;/kbd&gt; a few times should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next time you enter the popup, you will see this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Push feature to&#xA; p pushRemote, after setting that&#xA; u origin/feature&#xA; e elsewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;kbd&gt;u&lt;/kbd&gt; now pushes to &lt;code&gt;origin/feature&lt;/code&gt; without prompting or asking for confirmation.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2015-12-30T18:52:31.763" LastActivityDate="2015-12-30T18:52:31.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19172" PostTypeId="2" ParentId="19169" CreationDate="2015-12-30T18:53:28.257" Score="1" Body="&lt;p&gt;There is a somewhat hacky solution.&#xA;The following advice re-defines the source code string returned by &lt;code&gt;org-babel-get-src-block-info&lt;/code&gt; if the region is active within this source code block and it is the top-level source code block.&#xA;You can switch off this behavior by setting the &lt;code&gt;org-babel-region&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-babel-region t&#xA;  &quot;Restrict execution to region.&quot;&#xA;  :type 'boolean&#xA;  :group 'org-babel)&#xA;&#xA;(defadvice org-babel-get-src-block-info (after org-babel-src-region activate)&#xA;  &quot;Restrict org-babel execution to region&#xA;  if region is active within this source code block&#xA;  and it is the top-level source code block.&quot;&#xA;  ;; source code block string is (nth 1 (org-babel-get-src-block-info))&#xA;  ;; head marker is (last (org-babel-get-src-block-info))&#xA;  ;; the outer-most src code block is stored in variable `org-babel-current-src-block-location'&#xA;  (let (head-marker b e)&#xA;    (and org-babel-region&#xA;     (use-region-p)&#xA;     ad-return-value&#xA;     (setq head-marker (car (last ad-return-value)))&#xA;     (equal org-babel-current-src-block-location head-marker)&#xA;     (setq b (region-beginning) e (region-end))&#xA;     (save-excursion&#xA;       (and (goto-char b)&#xA;        (org-babel-in-example-or-verbatim)&#xA;        (equal head-marker (org-babel-where-is-src-block-head))&#xA;        (goto-char e)&#xA;        (org-babel-in-example-or-verbatim)&#xA;        (equal head-marker (org-babel-where-is-src-block-head))))&#xA;     (setf (nth 1 ad-return-value)&#xA;           (buffer-substring-no-properties b e)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tested the advice with code blocks for &lt;code&gt;emacs-lisp&lt;/code&gt; and &lt;code&gt;sh&lt;/code&gt;.&#xA;I do not have R but it should work for R too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the current implementation output remains enabled for the evaluation of a region if it is enabled for the whole source code block (e.g., in the header arguments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may be a catch. There are some source code blocks where you must print the output within the source code block or you get an error.&#xA;In this case you will get an error if the selected region does not include the print directives, i.e., in most cases the end of the source code block.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-03T10:52:59.783" LastActivityDate="2016-01-03T10:52:59.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19173" PostTypeId="1" CreationDate="2015-12-30T19:02:20.217" Score="2" ViewCount="463" Body="&lt;p&gt;I have the following Emacs org buffer that I'm editing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R&#xA;regimes &amp;lt;- read.spreadsheet(wlda, 3) %&amp;gt;%&#xA;    within({&#xA;        TurbineID &amp;lt;- paste(Site, Turbine)&#xA;        Date.of.Change.of.Risk.Level &amp;lt;- convert.excel.date(Date.of.Change.of.Risk.Level)&#xA;        Non.REA &amp;lt;- Non.REA==&quot;Yes&quot;  # Convert to boolean &amp;amp; foo&#xA;        X9 &amp;lt;- X10 &amp;lt;- NULL # Trailing columns&#xA;    }) %&amp;gt;%&#xA;    group_by(Site, Turbine) %&amp;gt;%&#xA;    mutate(&#xA;        Curtailment.Level.Before = na.locf(Curtailment.Level.Before),&#xA;        Curtailment.Level.After  = na.locf(Curtailment.Level.After, fromLast=TRUE)&#xA;    )&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Syntax highlighting (&lt;code&gt;font-lock-mode&lt;/code&gt;) is enabled in this buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hit &lt;kbd&gt;Meta&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; &lt;kbd&gt;R&lt;/kbd&gt; to start a new R session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I then go back to the Org buffer, highlight all the code in the code block, hit &lt;kbd&gt;Meta&lt;/kbd&gt;-&lt;kbd&gt;w&lt;/kbd&gt; to grab it, and then move to the R session buffer and yank it (&lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;y&lt;/kbd&gt;, which runs &lt;code&gt;ess-yank&lt;/code&gt;), Emacs immediately freezes and consumes 100% CPU.  None of &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;g&lt;/kbd&gt;, &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt;, or anything else I've tried will interrupt it, I have to actually kill the Emacs process from a shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I have &lt;em&gt;not&lt;/em&gt; actually tried to execute the R code at this point, it's just been yanked (pasted) into the ESS console buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone help with some debugging here?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;My setup:&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs 24.5.1, installed using homebrew&lt;/li&gt;&#xA;&lt;li&gt;OS X 10.10.5&lt;/li&gt;&#xA;&lt;li&gt;Org-mode 8.3.2, installed using &lt;code&gt;org-plus-contrib&lt;/code&gt; 20151228 from ELPA&lt;/li&gt;&#xA;&lt;li&gt;ESS 15.09-2, installed from ELPA 20151217.544&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This behavior happens whether I'm using the OS X &lt;code&gt;.app&lt;/code&gt; or running in a terminal.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I think this has something to do with syntax highlighting.  If I run &lt;code&gt;font-lock-mode&lt;/code&gt; to turn off highlighting in my org buffer before I grab the text, the problem disappears.  I simplified the example above to reflect this.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update 2&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I triggered this problem in the way described above, then I hit the process with a &lt;code&gt;SIGUSR2&lt;/code&gt; signal and got the following backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--beginning evaluation of function call form:&#xA;* (byte-code &quot;r^Hq\210\302      !\210)\302\207&quot; [buffer table set-syntax-table] 2)&#xA;  font-lock-default-fontify-region(802 1304 nil)&#xA;  inferior-ess-fontify-region(802 1304 nil)&#xA;  font-lock-fontify-region(802 1304)&#xA;  run-hook-with-args(font-lock-fontify-region 802 1304)&#xA;  #[0 &quot;\302\303\300\242\301\242#\207&quot; [(802) (1304) run-hook-with-args jit-lock-functions] 4 &quot;\n\n(fn)&quot;]()&#xA;  funcall(#[0 &quot;\302\303\300\242\301\242#\207&quot; [(802) (1304) run-hook-with-args jit-lock-functions] 4 &quot;\n\n(fn)&quot;])&#xA;  jit-lock-fontify-now(802 1302)&#xA;  jit-lock-function(802)&#xA;  redisplay_internal\ \(C\ function\)()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I notice that the docs of &lt;code&gt;byte-code&lt;/code&gt; say &quot;If the third argument is incorrect, Emacs may crash.&quot;  In this case, the third argument (&lt;code&gt;MAXDEPTH&lt;/code&gt;) is passed as 2, perhaps that's the problem?&lt;/p&gt;&#xA;" OwnerUserId="8899" LastEditorUserId="8899" LastEditDate="2015-12-31T19:42:44.310" LastActivityDate="2015-12-31T19:42:44.310" Title="Emacs/ESS/Org hangs/spins on yank" Tags="|org-mode|font-lock|ess|yank|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19175" PostTypeId="1" CreationDate="2015-12-30T20:17:17.233" Score="9" ViewCount="8246" Body="&lt;p&gt;I just upgraded to Emacs 24 and can't find ispell.  If I try to use ispell I get the error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Searching for program: no such file or directory, ispell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After a small amount of searching on the Unix &amp;amp; Linux SE, I found that I should put this code in my &lt;code&gt;.emacs&lt;/code&gt; file: &lt;code&gt;(setq ispell-program-name &quot;/path/to/ispell&quot;)&lt;/code&gt;. But I can't figure out what ispell's path is.  Can anybody tell me?  I'm on Mac OS10.8 and GNU emacs 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="10628" LastActivityDate="2015-12-31T10:24:34.487" Title="Where is ispell?" Tags="|ispell|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19176" PostTypeId="1" AcceptedAnswerId="19177" CreationDate="2015-12-30T21:05:48.080" Score="19" ViewCount="1707" Body="&lt;p&gt;I'm maintaining several git repositories using magit, and their&#xA;numbers keep growing. Is there a way to inform magit of&#xA;all these projects so that a single command would present a summary of&#xA;the status of each one instead of manually running &lt;code&gt;magit-status&lt;/code&gt; on&#xA;each one of them ?&lt;/p&gt;&#xA;" OwnerUserId="10630" LastEditorUserId="9343" LastEditDate="2018-01-30T06:12:40.503" LastActivityDate="2022-08-20T16:36:57.447" Title="Manage several git repositories from magit" Tags="|magit|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19177" PostTypeId="2" ParentId="19176" CreationDate="2015-12-30T21:44:25.050" Score="21" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to inform magit of the list of all these projects...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, see &lt;code&gt;magit-repository-directories&lt;/code&gt; and &lt;code&gt;magit-repository-directories-depth&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...so that a single command would present a summary of the status of each one&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At the time this question was asked such a command did not exist, but now it does. Try &lt;code&gt;M-x magit-list-repositories&lt;/code&gt; and see the &lt;a href=&quot;https://magit.vc/manual/magit/Repository-List.html&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; : (&lt;a href=&quot;https://magit.vc/manual/magit/Repository-List.html&quot; rel=&quot;noreferrer&quot;&gt;https://magit.vc/manual/magit/Repository-List.html&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can also list all submodules of a super-repository in a similar fashion using &lt;code&gt;M-x magit-list-submodules&lt;/code&gt;. Or you can show some of that information directly in the status buffer using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-add-section-hook 'magit-status-sections-hook&#xA;                        'magit-insert-modules&#xA;                        'magit-insert-unpulled-from-pushremote)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then all the modules are listed in a separate section. Modules with changes are listed as usual in &lt;em&gt;Staged changes&lt;/em&gt; and &lt;em&gt;Unstaged changes&lt;/em&gt;.  &lt;kbd&gt;RET&lt;/kbd&gt; on any of these modules shows the status buffer for that repository and &lt;kbd&gt;q&lt;/kbd&gt; takes you back to the status buffer of the super-repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Submodules can be fetched using &lt;kbd&gt;f m&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="16436" LastEditDate="2018-04-13T11:31:26.593" LastActivityDate="2018-04-13T11:31:26.593" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19178" PostTypeId="2" ParentId="19175" CreationDate="2015-12-30T23:23:22.560" Score="16" Body="&lt;p&gt;This isn't an Emacs problem. You need to have the &lt;code&gt;ispell&lt;/code&gt; program installed on your machine. &lt;code&gt;ispell&lt;/code&gt; &lt;a href=&quot;https://github.com/Homebrew/homebrew/blob/master/Library/Formula/ispell.rb&quot; rel=&quot;noreferrer&quot;&gt;is available on homebrew&lt;/a&gt;, so you can do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ brew install ispell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's probably all you need. If Emacs can't find &lt;code&gt;ispell&lt;/code&gt; after you've installed it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which ispell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will tell you the path to the ispell executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, &lt;code&gt;aspell&lt;/code&gt; and &lt;code&gt;hunspell&lt;/code&gt; are compatible and can be used instead.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2015-12-31T10:24:34.487" LastActivityDate="2015-12-31T10:24:34.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19179" PostTypeId="1" AcceptedAnswerId="19181" CreationDate="2015-12-31T00:50:14.893" Score="1" ViewCount="111" Body="&lt;p&gt;I want to highlight &lt;code&gt;foo&lt;/code&gt; in &lt;code&gt;foo::&lt;/code&gt; without highlighting &lt;code&gt;foo::&amp;lt;bar&amp;gt;&lt;/code&gt;, using &lt;code&gt;font-lock-keywords&lt;/code&gt;. This is the result I want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sbOpg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sbOpg.png&quot; alt=&quot;correct higlighting&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initially I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar example-font-lock-keywords&#xA;  `((,(rx (group (1+ word)) &quot;::&quot; (not (any &quot;&amp;lt;&quot;))) 1 font-lock-type-face)))&#xA;&#xA;(define-derived-mode example-mode prog-mode &quot;Example&quot;&#xA;  (setq-local font-lock-defaults '(example-font-lock-keywords)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that gave the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pr3sW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pr3sW.png&quot; alt=&quot;bad trailing character&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead I tried two separate keywords:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar example-font-lock-keywords&#xA;  `((,(rx (group (1+ word)) &quot;::&quot;) 1 font-lock-type-face)&#xA;    ;; This is ignored if I use `default', but other faces work!&#xA;    (,(rx (group (1+ word)) &quot;::&amp;lt;&quot;) 1 font-lock-variable-name-face t)))&#xA;&#xA;(define-derived-mode example-mode prog-mode &quot;Example&quot;&#xA;  (setq-local font-lock-defaults '(example-font-lock-keywords)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second pattern is used if I specify &lt;code&gt;font-lock-variable-name-face&lt;/code&gt;, but if I use &lt;code&gt;default&lt;/code&gt;, the whole pattern is ignored!&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2015-12-31T10:01:21.040" LastActivityDate="2015-12-31T20:49:20.530" Title="How can I highlight different keywords according to a suffix?" Tags="|font-lock|syntax-highlighting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19180" PostTypeId="2" ParentId="2666" CreationDate="2015-12-31T03:53:30.597" Score="4" Body="&lt;p&gt;There are two problems here. The first is that you are setting the &lt;code&gt;tangle&lt;/code&gt; property on the whole&#xA;document. When you do this, you need to set every block that is a&#xA;noweb block as &lt;code&gt;:tangle no&lt;/code&gt;. It's much easier to set the &lt;code&gt;tangle&lt;/code&gt;&#xA;property on one block and use it as a framework for the entire tangled&#xA;document. You can see how this works in my example below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second problem is your inconsistent source type declarations. the&#xA;&lt;code&gt;elisp&lt;/code&gt; blocks are coming out first because they collate before&#xA;&lt;code&gt;emacs-lisp&lt;/code&gt;. They should all be labelled the same if they are the&#xA;same language and go in the same file (there are exceptions, of&#xA;course, such as embedding SQL in PHP or something, but following my&#xA;first suggestion will help avoid problems.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* A&#xA;&#xA;#+header: :tangle init.el&#xA;#+header: :noweb yes&#xA;#+begin_src emacs-lisp&#xA;  ; initialization code&#xA;  ; this *must* come first&#xA;&#xA;  &amp;lt;&amp;lt;support-functions&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&#xA;* B&#xA;&#xA;** Cool Stuff&#xA;&#xA;#+name: support-functions&#xA;#+begin_src emacs-lisp&#xA;  (message &quot;willkommen&quot;)&#xA;#+end_src&#xA;&#xA;** Test&#xA;&#xA;#+name: support-functions&#xA;#+begin_src emacs-lisp&#xA;  (message &quot;hi&quot;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tangles to&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;; initialization code&#xA;; this *must* come first&#xA;&#xA;(message &quot;willkommen&quot;)&#xA;(message &quot;hi&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10633" LastActivityDate="2015-12-31T03:53:30.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19181" PostTypeId="2" ParentId="19179" CreationDate="2015-12-31T10:01:27.810" Score="3" Body="&lt;p&gt;The problem is that your regular expression eats the character behind the second colon and the next search starts behind that character. That is why the first letter of &lt;code&gt;module2&lt;/code&gt; is not highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may only look at the character behind the second colon but you may not include it into the regular expression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Basis&lt;/strong&gt; for a working version:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar example-font-lock-keywords&#xA;  `((example-font-lock-matcher 1 font-lock-type-face)))&#xA;&#xA;(defun example-font-lock-matcher (limit)&#xA;  &quot;Matcher matching \&quot;keyword::\&quot; but only if we are not looking at &amp;lt; afterwards.&quot;&#xA;  (let (match)&#xA;    (while (and (setq match (re-search-forward &quot;\\_&amp;lt;\\(\\(?:\\sw\\|\\s_\\)+\\)::&quot; limit t))&#xA;        (eq (char-after) ?&amp;lt;)))&#xA;    match))&#xA;&#xA;(define-derived-mode example-mode prog-mode &quot;Example&quot;&#xA;  (setq-local font-lock-defaults '(example-font-lock-keywords)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that solves your question, but you have still work to do. For an instance you should consider whether there may be some whitespace in between the colon and the &lt;code&gt;&amp;lt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you actually always want to highlight the first keyword in the case that the two colons are followed by a further keyword the following version would be even more appropriate:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar example-font-lock-keywords&#xA;  `((&quot;\\_&amp;lt;\\(\\(?:\\sw\\|\\s_\\)+\\)::[[:space:]]*\\_&amp;lt;&quot; 1 font-lock-type-face)))&#xA;&#xA;(define-derived-mode example-mode prog-mode &quot;Example&quot;&#xA;  (setq-local font-lock-defaults '(example-font-lock-keywords)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Allow me one further remark. It would be nice if you would not only post a picture of the text to be highlighted but also the text itself. This would ease the reconstruction of the problem for the people who want to help you.&#xA;I do so here for other potential helpers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;use module1::function;&#xA;use module1::module2::function;&#xA;&#xA;foo::&amp;lt;bar&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="304" LastEditDate="2015-12-31T20:49:20.530" LastActivityDate="2015-12-31T20:49:20.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19182" PostTypeId="1" AcceptedAnswerId="19191" CreationDate="2015-12-31T10:17:08.153" Score="7" ViewCount="2025" Body="&lt;p&gt;I have another syntax highlighting for SQL keywords inside strings (inside quotes) in VIM. It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4YcGg.png(&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4YcGg.png(&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then in Emacs with PHP-mode, everything between quotes (&lt;code&gt;'&lt;/code&gt;) will be considered as a string by the font lock:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/A3xZC.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/A3xZC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, the first example with another font face properties (no cursive keywords) is more clear. The keywords are much easier to distinct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm looking into my &lt;code&gt;font face&lt;/code&gt; properties:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (font-lock-string-face ((t (:foreground &quot;#536991&quot; :slant italic)))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I'm wondering how I could tell that there another face &lt;strong&gt;inside&lt;/strong&gt; a &lt;code&gt;font-lock-string-face&lt;/code&gt; should be applied, if it matchs the specific keywords.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2015-12-31T19:23:56.080" LastActivityDate="2016-01-03T19:25:08.190" Title="How to highlight specific keywords inside strings/quotes?" Tags="|font-lock|syntax-highlighting|highlighting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19183" PostTypeId="1" AcceptedAnswerId="19187" CreationDate="2015-12-31T14:47:31.190" Score="1" ViewCount="1448" Body="&lt;p&gt;I can use following code to create sum of numbers. But how can I append some text?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: $4=$2+$1+$3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 名字   | 内容1        | 内容2                | 结果 results  |&#xA;|--------+--------------+----------------------+--------|&#xA;| Mr. 域| dear | happy | dear Mr. 域 happy  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="9923" LastEditDate="2015-12-31T16:18:40.097" LastActivityDate="2015-12-31T19:11:33.283" Title="Can I use formula to manipulate text in org mode table?" Tags="|org-mode|formula|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19184" PostTypeId="1" AcceptedAnswerId="19186" CreationDate="2015-12-31T15:05:04.777" Score="3" ViewCount="217" Body="&lt;p&gt;I want to access any current file quickly. Therefore I want to build a function that put a file the register. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've started with this function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tmp-register ()&#xA;&quot;&quot;&quot; put the current buffer in the temporary register &quot;&quot;&quot;&#xA;(interactive)&#xA;(set-register , ?q  (file . buffer-file-name))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it fails as expected as I need a string instead of &lt;code&gt;buffer-file-name&lt;/code&gt;. Do you see a way around this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tweaked some code from Sacha Chua &lt;a href=&quot;http://pages.sachachua.com/.emacs.d/Sacha.html#babel-init&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. I've come up with this. I don't understand it entirely yet and it can probably be improved. Do you have something else in mind?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tmp-register ()&#xA;&quot;&quot;&quot; put the current buffer in the temporary register &quot;&quot;&quot;&#xA;(interactive)&#xA;(my/defshortcut ?q buffer-file-name)&#xA;)&#xA;&#xA;(defvar my/refile-map (make-sparse-keymap))&#xA;(defmacro my/defshortcut (key file)&#xA;  `(progn&#xA;    (set-register ,key (cons 'file ,file))&#xA; (define-key my/refile-map&#xA;   (char-to-string ,key)&#xA;   (lambda (prefix)&#xA;     (interactive &quot;p&quot;)&#xA;     (let ((org-refile-targets '(((,file) :maxlevel . 6)))&#xA;           (current-prefix-arg (or current-prefix-arg '(4))))&#xA;       (call-interactively 'org-refile))))))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f12&amp;gt;&quot;) 'tmp-register)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="9340" LastEditDate="2015-12-31T15:38:22.360" LastActivityDate="2015-12-31T19:05:02.267" Title="function to put current buffer in temporary register" Tags="|registers|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19185" PostTypeId="1" AcceptedAnswerId="19193" CreationDate="2015-12-31T15:05:16.833" Score="2" ViewCount="1777" Body="&lt;p&gt;I'm trying to connect to a remote Emacs server. I created the server with &lt;code&gt;server-use-tcp&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt; so a connection file was created. I inspected the connection file and found out that it contains the IP and address socket port, the PID and an auth token&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;127.0.0.1:41507 6843   &#xA;&amp;lt;SECRET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;copied (via scp) the connection file to my local pc&lt;/li&gt;&#xA;&lt;li&gt;forwarded the server port vie &lt;code&gt;ssh -L ssh -L 41507:127.0.0.1:41507 remote&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;and now when I do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient  -f ~/.emacs.d/server/server test-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The buffer is really opened in the remote server process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I cannot find a way to make &lt;code&gt;emacsclient&lt;/code&gt; create a frame. If I use &lt;code&gt;-c&lt;/code&gt; I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Waiting for Emacs...&#xA;*ERROR*: Display :0 can't be opened&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and with &lt;code&gt;-t&lt;/code&gt; it just hangs, does not even print &lt;code&gt;Waiting for Emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know similar questions have been asked, but I'm trying to do this without TRAMP, because I'm mostly interested in the fast access time and processing resources on the remote server.&lt;/p&gt;&#xA;" OwnerUserId="10636" LastActivityDate="2016-01-01T13:16:54.553" Title="Forwarding emacs server TCP connection works, but cannot create local frame" Tags="|emacsclient|remote|server|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19186" PostTypeId="2" ParentId="19184" CreationDate="2015-12-31T15:24:33.557" Score="3" Body="&lt;p&gt;OK, I have updated my answer to save the file being visited by the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this slight variation on your original function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun tmp-register ()&#xA;  &quot;&quot;&quot; put the current buffer in the temporary register &quot;&quot;&quot;&#xA;  (interactive)&#xA;  (set-register ?q (cons 'file buffer-file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After calling this function (with &lt;code&gt;M-x tmp-register RET&lt;/code&gt; (or by key combination if you set that) in a buffer that is visiting a file, it will be saved to the register and you will be able to jump back to that buffer with &lt;code&gt;jump-to-register&lt;/code&gt; (bound to &lt;code&gt;C-x r j&lt;/code&gt; for me) and then typing &lt;code&gt;q&lt;/code&gt; (or however you access registers in your setup). Note that if you call the function in a buffer that is not visiting a file (e.g., the &lt;code&gt;*Scratch*&lt;/code&gt; buffer, it will not work.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2015-12-31T17:23:11.800" LastActivityDate="2015-12-31T17:23:11.800" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19187" PostTypeId="2" ParentId="19183" CreationDate="2015-12-31T16:32:38.937" Score="3" Body="&lt;p&gt;See Section &quot;3.5.3 Emacs Lisp forms as formulas&quot; of the orgmode manual or see &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lisp expression is introduced by a single quote and embraced in parentheses. You can use cell references in the lisp expression. They are replaced by the cell entries as string by default. But you can change these defaults through flags like 'N' (standing for Numeric) as in the comment of &lt;a href=&quot;https://emacs.stackexchange.com/users/563/wvxvw&quot;&gt;wvxvw&lt;/a&gt;. Consult the manual for further information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following you find an example for your special case.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 名字   | 内容1 | 内容2 | 结果 results    |&#xA;|--------+-------+-------+-------------------|&#xA;| Mr. 域 | dear  | happy | dear Mr. 域 happy |&#xA;#+TBLFM: $4='(format &quot;%s %s %s&quot; $2 $1 $3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2015-12-31T16:42:11.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19188" PostTypeId="2" ParentId="19184" CreationDate="2015-12-31T19:05:02.267" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;&lt;em&gt;I want to access any current file quickly. Therefore I want to build a function that put a file the register.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope you realize that Emacs-Lisp &quot;registers&quot; are not computer registers. There is nothing inherently super-quick about them.  A Lisp register is essentially a pointer to an object in memory, like a variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course there is nothing wrong with using a register to save the content of a file or buffer.  I just wanted to point out that using a register is not quicker than other means of doing the same thing.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As an alternative, consider using Emacs &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Bookmarks.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;bookmarks&lt;/strong&gt;&lt;/a&gt;.  They can be persistent or temporary; they point to file or buffer locations; and they are accessed quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if a file has not yet been visited or the buffer does not yet exist, then there is the cost of visiting that data.  But that is true however you proceed.  Once a buffer exists that corresponds to the data you want, jumping to it using a bookmark is immediate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's the same as using a register, except that (1) a bookmark can have any name you like -- not just a character, and (2) a bookmark can be persistent.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2015-12-31T19:05:02.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19189" PostTypeId="2" ParentId="19183" CreationDate="2015-12-31T19:11:33.283" Score="1" Body="&lt;p&gt;Use formulas, as suggested by @wvxvw in the comments. &lt;code&gt;mapconcat&lt;/code&gt; is a nice option for joining strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 名字   | 内容1 | 内容2 | 结果 results      |&#xA;|--------+-------+-------+-------------------|&#xA;| Mr. 域 | dear  | happy | dear Mr. 域 happy |&#xA;#+TBLFM: $4='(mapconcat 'identity (list $2 $1 $3) &quot; &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="53" LastActivityDate="2015-12-31T19:11:33.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19190" PostTypeId="1" CreationDate="2015-12-31T19:49:39.930" Score="9" ViewCount="2154" Body="&lt;p&gt;I use &lt;code&gt;Emacs 24.5.1&lt;/code&gt; on OS X in terminal mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I intend to use &lt;code&gt;desktop-save-mode&lt;/code&gt; to save and restore window layout (i.e. positions of buffer windows) upon exiting and starting &lt;code&gt;Emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://emacs.stackexchange.com/a/857/10491&quot;&gt;this answer and its comments&lt;/a&gt;, people suggest that recent versions of &lt;code&gt;Emacs&lt;/code&gt; does save and restore window layout when &lt;code&gt;desktop-save-mode&lt;/code&gt; is enabled. However, when I exit &lt;code&gt;Emacs&lt;/code&gt; with two side-by-side windows each containing a file buffer, only the last active buffer (the one where the cursor last rested at) is restored upon restarting &lt;code&gt;Emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My relevant configurations are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq desktop-auto-save-timeout nil&#xA;      desktop-save 'ask-if-new&#xA;      desktop-dirname &quot;./&quot;&#xA;      desktop-path (list desktop-dirname)&#xA;      desktop-load-locked-desktop nil)&#xA;(desktop-save-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've checked the value of variable &lt;code&gt;desktop-restore-frames&lt;/code&gt;, and Emacs reports &quot;Its value is t&quot;, and its description says &quot;When non-nil, save and restore the frame and window configuration&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also use &lt;a href=&quot;https://github.com/nex3/perspective-el&quot; rel=&quot;noreferrer&quot;&gt;perspective.el&lt;/a&gt;, but I am not sure if it is related to the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if the problem is caused by some conflict with other package/settings, and if possible, how do I detect and resolve such conflict.&lt;/p&gt;&#xA;" OwnerUserId="10491" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2019-01-06T19:03:10.707" Title="desktop-save-mode fails to save window layout" Tags="|window|frames|window-splitting|desktop|session|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19191" PostTypeId="2" ParentId="19182" CreationDate="2016-01-01T02:25:01.607" Score="11" Body="&lt;p&gt;The following elisp snippet should do. The important details are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Strings are handled by &lt;strong&gt;syntax&lt;/strong&gt; highlighting and not by pattern matching (i.e., keyword highlighting). This has very high priority. So one needs to override it explicitly by the value &lt;code&gt;t&lt;/code&gt; for the MATCHER flag OVERRIDE (see doc of &lt;code&gt;font-lock-keywords&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;One cannot use a regexp as keyword MATCHER since one has to check only SQL keywords within strings. The code below provides &lt;code&gt;php-sql-keyword-matcher&lt;/code&gt; for that purpose. The test for strings is done via &lt;code&gt;syntax-ppss&lt;/code&gt; (see the doc for this function).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that I only have a display of class &lt;code&gt;color&lt;/code&gt;. So I could not test the other classes. I assume that you have an other display class since strings are displayed in italic face in your example. If you do not get the expected result please customize the face &lt;code&gt;php-sql-keyword-face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'sql) ;; for sql-keywords&#xA;(require 'php-mode) ;; for php-mode-hook&#xA;&#xA;(defvar php-sql-keywords (concat &quot;\\&amp;lt;&quot; (mapconcat 'car sql-mode-ansi-font-lock-keywords &quot;\\|&quot;) &quot;\\&amp;gt;&quot;)&#xA;  &quot;SQL keywords for php-mode stolen from `sql-mode-ansi-font-lock-keywords'.&quot;)&#xA;&#xA;(defun php-sql-keyword-matcher (end)&#xA;  &quot;Search for SQl keywords within PHP strings.&quot;&#xA;  (let (pos (case-fold-search t))&#xA;    (while (and (setq pos (re-search-forward php-sql-keywords end t))&#xA;                (null (nth 3 (syntax-ppss pos)))))&#xA;    (when pos (message &quot;Found keyword at %s&quot; pos))&#xA;    pos))&#xA;&#xA;(defface php-sql-keyword-face&#xA;  '((((class grayscale))  :slant nil :inherit font-lock-string-face)&#xA;    (((class color)) :slant italic :inherit font-lock-string-face)&#xA;    (t :slant nil :inherit font-lock-string-face))&#xA;  &quot;Face to highlight SQL keywords within PHP strings.&quot;&#xA;  :group 'php-sql)&#xA;&#xA;(defcustom php-sql-keyword-face 'php-sql-keyword-face&#xA;  &quot;Face to highlight SQL keywords within PHP strings.&quot;&#xA;  :type 'face&#xA;  :group 'php-sql)&#xA;&#xA;(defun php-add-sql-keyword-matcher ()&#xA;  &quot;Hook to add fontification of sql-keywords in strings.&quot;&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   '((php-sql-keyword-matcher 0 php-sql-keyword-face t))&#xA;   'append))&#xA;&#xA;(add-hook 'php-mode-hook 'php-add-sql-keyword-matcher)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: Please do not only insert images of texts that are needed for the reconstruction of the problem. The ascii text can ease potential helpers  the reconstruction of the problem.&#xA;For the case that someone other has a better solution I insert the ASCII-version of the text here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$sSql = 'SELECT T05.foo&#xA;             T07.bar&#xA;&#xA;         FROM db_pgm_intranet.inttbl_keyuser_proces_keyuser T05&#xA;&#xA;             INNER JOIN db_pgm_intranet.inttbl_keyuser_keyuser T07&#xA;             ON    T07.nKkuID = T01.nKpkKeyuserID&#xA;&#xA;             LEFT JOIN db_pgm_intranet.inttbl_keyuser_applicate T07&#xA;             ON   T06.nKpaProcesID = T07.nKapID';&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here a picture of the text as it looks like when I load it into emacs with PHP mode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HVxIv.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HVxIv.png&quot; alt=&quot;Picture of the php file with italic keywords in sql strings&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With display class &lt;code&gt;color&lt;/code&gt; strings are not italic but have a different color. Therefore, I have chosen &lt;em&gt;italic font face&lt;/em&gt; for SQL keywords within strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The comments indicate some difficulties with this answer. It has been indicated that the solution would not work with the default font set to &lt;code&gt;Consolas&lt;/code&gt;. I've just tested it and on my system it also works with Consola font as default:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HqK5s.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HqK5s.png&quot; alt=&quot;Highlighting of SQL keywords in php strings with Consolas fonts as default.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the help for &lt;code&gt;font-lock-add-keywords&lt;/code&gt; I found the following text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'c-mode&#xA;  '((&quot;\\&amp;lt;\\(FIXME\\):&quot; 1 'font-lock-warning-face prepend)&#xA;    (&quot;\\&amp;lt;\\(and\\|or\\|not\\)\\&amp;gt;&quot; . 'font-lock-keyword-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;adds two fontification patterns for C mode, to fontify 'FIXME:' words, even in&#xA;  comments, and to fontify &lt;code&gt;and&lt;/code&gt;, &lt;code&gt;or&lt;/code&gt; and &lt;code&gt;not&lt;/code&gt; words as keywords.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The first case &quot;&lt;code&gt;FIXME&lt;/code&gt;&quot; is the interesting one. Here they use &lt;code&gt;prepend&lt;/code&gt; as override flag.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-03T19:25:08.190" LastActivityDate="2016-01-03T19:25:08.190" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19192" PostTypeId="1" CreationDate="2016-01-01T05:03:06.243" Score="3" ViewCount="109" Body="&lt;p&gt;Is there a way to make the major mode column in &lt;code&gt;helm&lt;/code&gt; narrower? See image below; the major mode names are taking up a lot of space, while the file paths are cut off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LpU8o.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LpU8o.png&quot; alt=&quot;Helm major mode width&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's &lt;code&gt;helm-buffer-max-length&lt;/code&gt; for buffer names (which, ironically, I'd never want to cut off), but nothing for the major mode that I could find.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-01-01T05:03:06.243" Title="Reduce width of major mode column in Helm?" Tags="|helm|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19193" PostTypeId="2" ParentId="19185" CreationDate="2016-01-01T13:16:54.553" Score="6" Body="&lt;p&gt;You cannot use&lt;code&gt;emacsclient&lt;/code&gt; this way.  The Emacs Server does not create frames on the client side; it always creates them on the server-side X11 display or TTY, but the remote server doesn't have access to your local client side TTYs or X11 displays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The TCP connection of Emacs server is not intended for remote access, it's just a work around for the lack of local sockets in some operating systems (i.e. Windows).&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-01-01T13:16:54.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19194" PostTypeId="2" ParentId="9982" CreationDate="2016-01-01T15:44:03.867" Score="10" Body="&lt;p&gt;The feature of PyCharm that you mention was one of my favourites, and one of the first things I looked for in trying to replace PyCharm completely with Emacs (which I am happy to say I have been able to do). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in another answer the &lt;code&gt;elpy&lt;/code&gt; package &lt;a href=&quot;http://elpy.readthedocs.org/en/latest/ide.html#command-elpy-goto-definition&quot; rel=&quot;noreferrer&quot;&gt;has this feature&lt;/a&gt; (in addition to many other &lt;a href=&quot;http://elpy.readthedocs.org/en/latest/ide.html#ide-features&quot; rel=&quot;noreferrer&quot;&gt;useful IDE features&lt;/a&gt;). However, if you use &lt;code&gt;elpy-goto-definition&lt;/code&gt; to look up the symbol at point, you will find sooner or later that in some cases where PyCharm would succeed in finding what you are looking for, &lt;code&gt;elpy&lt;/code&gt; will not. As the docs say:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the backends can not always identify what kind of symbol is at point. Especially after a few indirections, they have &#xA;  basically no hope of guessing right, so they don’t&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this case, invoking &lt;code&gt;elpy-goto-definition&lt;/code&gt; will do nothing and show a little error message in the echo area. When this happens, of course you still want to find what you are looking for, and &lt;code&gt;elpy&lt;/code&gt; doesn't leave you hanging. In this kind of situation I always use &lt;code&gt;C-c C-s&lt;/code&gt; (&lt;code&gt;elpy-rgrep-symbol&lt;/code&gt;) to &lt;code&gt;rgrep&lt;/code&gt; for the symbol at point in whatever project I am in. At least for me, the thing I am looking for more or less always shows up in the &lt;code&gt;rgrep&lt;/code&gt; results. Actually, I think this is similar to what PyCharm does too: if you try to look up the definition of something and PyCharm is not sure where it is defined, it will have you choose from a list. I actually prefer &lt;code&gt;elpy&lt;/code&gt;'s implementation, because rather than a transient list that disappears when you go to the first option, &lt;code&gt;elpy-rgrep-symbol&lt;/code&gt; will leave the list of possibilities open in another buffer so that you can jump back and forth between them if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since my workflow is almost always to first call &lt;code&gt;elpy-goto-definition&lt;/code&gt; and if it fails, call &lt;code&gt;elpy-rgrep-symbol&lt;/code&gt;, I decided to hack together a simple function that just calls &lt;code&gt;elpy-rgrep-symbol&lt;/code&gt; automatically if &lt;code&gt;elpy-goto-definition&lt;/code&gt; fails. That function is below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun goto-def-or-rgrep ()&#xA;  &quot;Go to definition of thing at point or do an rgrep in project if that fails&quot;&#xA;  (interactive)&#xA;  (condition-case nil (elpy-goto-definition)&#xA;    (error (elpy-rgrep-symbol (thing-at-point 'symbol)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I bind this to &lt;code&gt;M-.&lt;/code&gt; (the default binding for  &lt;code&gt;elpy-goto-definition&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key elpy-mode-map (kbd &quot;M-.&quot;) 'goto-def-or-rgrep)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way I can use one of my favorite PyCharm features in my favorite editor. I know this is kind of an old question and you may have already solved this problem or moved on, but I hope you or someone else finds this useful!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-01T15:44:03.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19195" PostTypeId="1" AcceptedAnswerId="19200" CreationDate="2016-01-01T16:11:26.323" Score="3" ViewCount="2092" Body="&lt;p&gt;Gray text highlighting no longer works on my Debian/stretch system. While this is particularly annoying in Emacs, it's not a specific Emacs problem; gray background is also gone from other applications, including the web browser. Therefore I asked for help at  &lt;a href=&quot;https://unix.stackexchange.com/questions/252706/gray-highlighting-is-gone&quot;&gt;Unix SO&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do however have an Emacs-specific question: Are there ways of active-region highlighting other than gray background? I would like to try them out in order to narrow down the gray-background-is-gone bug.&lt;/p&gt;&#xA;" OwnerUserId="10639" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-01-01T16:28:17.597" Title="how to modify the active region highlighting color" Tags="|init-file|display|region|coloring|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19196" PostTypeId="5" CreationDate="2016-01-01T16:17:41.523" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Echo-Area.html#Echo-Area&quot; rel=&quot;nofollow noreferrer&quot;&gt;Echo Area&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer.html#Minibuffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Minibuffer&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T02:27:42.657" LastActivityDate="2017-03-02T02:27:42.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19197" PostTypeId="4" CreationDate="2016-01-01T16:17:41.523" Score="0" Body="is the blank line at the very bottom of an Emacs frame. Emacs by default reserves that screen space for echoing keystrokes, error messages, complier messages, messages from background processes, and alerts. Since the `echo-area` is a special case of the `minibuffer` window, it uses the same functions for customizing its size and display attributes." OwnerUserId="45" LastEditorUserId="7045" LastEditDate="2017-03-02T13:52:12.587" LastActivityDate="2017-03-02T13:52:12.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19198" PostTypeId="5" CreationDate="2016-01-01T16:21:03.423" Score="0" Body="&lt;p&gt;From &lt;a href=&quot;http://www.emacswiki.org/CuaMode&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki: Cua Mode&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Cua-mode allows one to use ‘C-v’, ‘C-c’, and ‘C-x’ to paste, copy, and cut the region. Since this conflicts with very important keybindings in Emacs, these CUA bindings are only active when the mark is active. The package does a whole lot more, too: ‘C-z’ to undo, Shift-movement to select, and it includes support for rectangular regions (‘C-RET’ and arrow keys instead of using the &lt;code&gt;C-x r …’ keys) and registers (instead of using the register commands), and it uses&lt;/code&gt;’ and `S-’ to indent and outdent the region. As you can see, it is very powerful!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="45" LastEditorUserId="45" LastEditDate="2016-01-01T20:31:16.730" LastActivityDate="2016-01-01T20:31:16.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19199" PostTypeId="4" CreationDate="2016-01-01T16:21:03.423" Score="0" Body="Cua-mode allows one to use ‘C-v’, ‘C-c’, and ‘C-x’ to paste, copy, and cut the region." OwnerUserId="45" LastEditorUserId="45" LastEditDate="2016-01-01T20:31:21.613" LastActivityDate="2016-01-01T20:31:21.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19200" PostTypeId="2" ParentId="19195" CreationDate="2016-01-01T16:25:46.393" Score="4" Body="&lt;p&gt;What you're looking for is the &lt;code&gt;region&lt;/code&gt; face. Put this in your &lt;code&gt;.emacs&lt;/code&gt; file and change &lt;code&gt;#666&lt;/code&gt; to any color you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'region nil :background &quot;#666&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also then change the font color to make it more readable. E.g. to white&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'region nil :background &quot;#666&quot; :foreground &quot;#ffffff&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sources: &lt;a href=&quot;https://stackoverflow.com/questions/18684579/how-do-i-change-the-highlight-color-for-selected-text-with-emacs-deftheme&quot;&gt;This Question&lt;/a&gt; answered by &lt;a href=&quot;https://stackoverflow.com/users/401539/tungd&quot;&gt;tungd&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/users/1752229/philippe&quot;&gt;Philippe&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="45" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-01-01T16:25:46.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19201" PostTypeId="1" AcceptedAnswerId="19203" CreationDate="2016-01-01T16:46:03.627" Score="3" ViewCount="243" Body="&lt;p&gt;I created a derived mode (using define-derived-mode) based on c++-mode to include new keywords, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode is working great, but I'm having problems with other minor modes that stop working with my derived mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, flycheck and company-mode, the first stops telling me when there is broken code in the buffer, and the second will not complete (it will always say No completion found).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I load the c++-mode in the buffer, all these minor modes start working again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is how can I make these modes see my derived mode as if it was c++-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10640" LastActivityDate="2016-01-02T12:12:24.570" Title="Minor modes not working with derived mode from c++-mode" Tags="|company-mode|flycheck|cc-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19202" PostTypeId="2" ParentId="16971" CreationDate="2016-01-01T16:54:20.737" Score="2" Body="&lt;p&gt;I had tried the instructions in emacs/nt/INSTALL last year for the 32-bit build&#xA;but something went wrong (I don't remember what, exactly), so recently I tried&#xA;the instructions for&#xA;&lt;a href=&quot;http://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/&quot; rel=&quot;nofollow&quot;&gt;emacsbinw64&lt;/a&gt; - it worked very well, and it was simpler to get the necessary libraries also. It uses MSYS2 and MinGW-w64 for a 64-bit build - the emacsbinw64 project provides binaries at &lt;a href=&quot;https://sourceforge.net/projects/emacsbinw64/files/&quot; rel=&quot;nofollow&quot;&gt;https://sourceforge.net/projects/emacsbinw64/files/&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I wrote up some instructions following that outline, with feedback from Eli Zaretski and the author Chris Zheng - the full version is up at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/plain/nt/INSTALL.W64?h=emacs-25&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/plain/nt/INSTALL.W64?h=emacs-25&lt;/a&gt; (just includes building from a release tarball also). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This took about 90 minutes total on an Intel i3 and high speed internet connection - YMMV. Note that most of the work for building on Windows is just setting up the build environment...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The total space required is 3GB: 1.8GB for MSYS2 / MinGW-w64 and 1.2GB for&#xA;Emacs with the full repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Download and install MinGW-w64 and MSYS2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Download the x86_64 version of MSYS2 (i.e. msys2-x86_64-.exe)&#xA;from &lt;a href=&quot;https://sourceforge.net/projects/msys2/files/Base/x86_64&quot; rel=&quot;nofollow&quot;&gt;https://sourceforge.net/projects/msys2/files/Base/x86_64&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run this file to install MSYS2 in your preferred directory, e.g. the default&#xA;C:\msys64 -- this will install MinGW-w64 also.  Note that directory names&#xA;containing spaces may cause problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you'll need to add the following directories to your Windows PATH&#xA;environment variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\msys64\usr\bin;c:\msys64\mingw64\bin&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can do this through Control Panel / System and Security / System /&#xA;Advanced system settings / Environment Variables / Edit path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding these directories to your PATH tells Emacs where to find the DLLs it&#xA;needs to run, and some optional commands like grep and find.  These commands&#xA;will also be available at the Windows console.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Download and install the necessary packages&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run msys2_shell.bat in your MSYS2 directory and you will see a BASH window&#xA;opened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the BASH prompt, use the following command to install the necessary&#xA;packages (you can copy and paste it into the shell with Shift + Insert):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pacman -S base-devel \&#xA;mingw-w64-x86_64-toolchain \&#xA;mingw-w64-x86_64-xpm-nox \&#xA;mingw-w64-x86_64-libtiff \&#xA;mingw-w64-x86_64-giflib \&#xA;mingw-w64-x86_64-libpng \&#xA;mingw-w64-x86_64-libjpeg-turbo \&#xA;mingw-w64-x86_64-librsvg \&#xA;mingw-w64-x86_64-libxml2 \&#xA;mingw-w64-x86_64-gnutls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You now have a complete build environment for Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Install Git (optional) and disable autocrlf&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't already have Git on your system, you can install it&#xA;in your MSYS2 environment with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pacman -S git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The autocrlf feature of Git may interfere with the configure file, so it is&#xA;best to disable this feature by running the command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git config core.autocrlf false&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Get the Emacs source code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To download the Git repository, do something like the following -- this will&#xA;put the Emacs source into C:\emacs\emacs-25:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mkdir /c/emacs&#xA;cd /c/emacs&#xA;git clone git://git.sv.gnu.org/emacs.git emacs-25&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Build Emacs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you're ready to build and install Emacs with autogen, configure, make,&#xA;and make install.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First we need to switch to the MinGW-w64 environment.  Exit the MSYS2 BASH&#xA;console and run mingw64_shell.bat in the C:\msys64 folder, then cd back to&#xA;your Emacs source directory, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd /c/emacs/emacs-25&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Run autogen&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are building the development sources, run autogen to generate the&#xA;configure script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./autogen.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Run configure&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can run configure, which will build the various Makefiles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The '--prefix' option specifies a location for the resulting binary files,&#xA;which 'make install' will use - in this example we set it to C:\emacs\emacs-25.&#xA;If a prefix is not specified the files will be put in the standard Unix&#xA;directories located in your C:\msys64 directory, but this is not recommended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that we need to disable Imagemagick because Emacs does not yet&#xA;support it on Windows.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PKG_CONFIG_PATH=/mingw64/lib/pkgconfig \&#xA;./configure --prefix=/c/emacs/emacs-25 --without-imagemagick&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Run make&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will compile Emacs and build the executables, putting them in the src&#xA;directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To speed up the process, you can try running&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make -jN&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where N is the number of cores in your system -- if your MSYS2 make supports&#xA;parallel execution it will run significantly faster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Run make install&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can run &quot;make install&quot;, which will copy the executable and&#xA;other files to the location specified in the configure step. This will&#xA;create the bin, libexec, share, and var directories:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make install prefix=/c/somewhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to install them somewhere else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Test Emacs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test it out, run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./bin/runemacs.exe -Q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and if all went well, you will have a new 64-bit version of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Make a shortcut&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make a shortcut to run the new Emacs, right click on the location where you&#xA;want to put it, e.g. the Desktop, select New / Shortcut, then select&#xA;runemacs.exe in the bin folder of the new Emacs, and give it a name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set any command line options by right clicking on the resulting&#xA;shortcut, select Properties, then add any options to the Target command,&#xA;e.g. --debug-init.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Credits&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to Chris Zheng for the original build outline as used by the&#xA;emacsbinw64 project, located at &lt;a href=&quot;https://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/&quot; rel=&quot;nofollow&quot;&gt;https://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;License&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This file is part of GNU Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs is free software: you can redistribute it and/or modify&#xA;it under the terms of the GNU General Public License as published by&#xA;the Free Software Foundation, either version 3 of the License, or&#xA;(at your option) any later version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs is distributed in the hope that it will be useful,&#xA;but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#xA;GNU General Public License for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should have received a copy of the GNU General Public License&#xA;along with GNU Emacs. If not, see &lt;a href=&quot;http://www.gnu.org/licenses/&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/licenses/&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2462" LastActivityDate="2016-01-01T16:54:20.737" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19203" PostTypeId="2" ParentId="19201" CreationDate="2016-01-01T18:23:50.447" Score="2" Body="&lt;p&gt;&lt;code&gt;company-mode&lt;/code&gt; is just a framework. If you want completions from &lt;code&gt;company-clang&lt;/code&gt;, try adding your major mode to &lt;code&gt;company-clang-modes&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you only created a new major mode for minor reasons like new font-lock keywords, maybe you would be better served by moving that logic to a new minor mode instead (and adding it to &lt;code&gt;c++-mode-hook&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-01-01T18:23:50.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19204" PostTypeId="1" AcceptedAnswerId="19207" CreationDate="2016-01-01T21:39:54.413" Score="2" ViewCount="143" Body="&lt;p&gt;Solved! helm-descbinds solved the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm-descbinds&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm-descbinds&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I was trying to work out if I could build a simple script to narrow down key bindings, somewhat similar to IDO. I know of Icicle, but for some reason I didn't like it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During my search I ran into many problems and beging to think that the only way out is to run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(describe-bindings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then try to parse &lt;em&gt;Help&lt;/em&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get pre-parsed flat list of biding? I got lost trying to understand the keymap structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess recursively parsing the keymap structure is too much work. Is there a simple solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is example of my early progress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/bigos/Pyrulis/blob/master/Emacs/key-bindings-lister/lisp/key-bindings-lister.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bigos/Pyrulis/blob/master/Emacs/key-bindings-lister/lisp/key-bindings-lister.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a while of trying, looks like getting the info from &lt;em&gt;Help&lt;/em&gt; buffer didnt work. I got some strange structures with the string and when I tried to use print, it didn't print what I wanted.  Perhaps I will have to parse the keymap? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After playing with keymap for a while, I think this is the way to go. More in my github link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My last attempt.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; run in ielm like this: (my-list-bindings 11)&#xA;;;; n=11 for global&#xA;(defun my-list-bindings (n)&#xA;  &quot;almost clean way of listing key bindings&quot;&#xA;  (map-keymap&#xA;   (lambda (x y)&#xA;     (print &quot;!!!!!!!!!!!!!!!!!!!!!&quot;)&#xA;     (princ x)&#xA;     (if (eq x 'menu-bar)&#xA;         (print &quot;*** skipping menu bar ***&quot;)&#xA;       (print y)))&#xA;   (elt (current-active-maps) n )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8952" LastEditorUserId="8952" LastEditDate="2016-01-02T05:39:31.990" LastActivityDate="2016-01-05T22:26:48.533" Title="Emacs Lisp, programatically narrow down key bindings" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19205" PostTypeId="1" CreationDate="2016-01-01T22:54:57.700" Score="2" ViewCount="164" Body="&lt;p&gt;I'd like to follow some accounts on Twitter, but would prefer not to open an account with them - I want to use Twitter read-only.  What I'd like is define a list of accounts I want to read, and have a &quot;check for new tweets&quot; functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible in Emacs? What would I need to do?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2016-01-01T22:54:57.700" Title="Is it possible to read-only Twitter in Emacs?" Tags="|twitter|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19206" PostTypeId="1" AcceptedAnswerId="19293" CreationDate="2016-01-02T02:23:59.107" Score="3" ViewCount="153" Body="&lt;p&gt;I use &lt;code&gt;fill-column&lt;/code&gt; in my dot-Emacs. And I have the following setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(turn-on-auto-fill)&#xA;(set-fill-column 60)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lRpbX.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lRpbX.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every time when the input exceeds columnnumber 60, it will break and proceed further on the new line. &#xA;Next to this, I use an YASnippet snippet, which will set up a proper structure for documentation of functions. The snippet is constructed as following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#name : example of snippet foo bar&#xA;# --&#xA;&#xA;#  EXAMPLE FOO BAR &#xA;/* $1&#xA;*&#xA;*/&#xA;public function f$2($3) {&#xA;&#xA;} # End scope f$2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, with the &lt;code&gt;fill-column&lt;/code&gt; setting enabled, I ran into weird problems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/s5c3Q.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/s5c3Q.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When typing in the docstring, the sentence get stucked at the end. I've expected it to proceed on a new line (with a new comment tag before), when the current line gets too long. But this is not the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the weird thingy is that this problem is not anymore when I delete the mirror on the last line in the snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#name : example of snippet foo bar&#xA;# --&#xA;&#xA;#  EXAMPLE FOO BAR &#xA;/* $1&#xA;*&#xA;*/&#xA;public function f$2($3) {&#xA;&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I get this instead:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Cr784.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Cr784.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why? Can anyone explain why the last line is causing an error with fill-column? I don't see any relationship between these two things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how can I get the latest line mirrored, without the docstring stucked on first line?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2018-09-18T22:11:40.920" LastActivityDate="2018-09-18T22:11:40.920" Title="Fill-column conflicts with YASnippet [Examples in gif]" Tags="|yasnippet|auto-fill-mode|fill-column|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19207" PostTypeId="2" ParentId="19204" CreationDate="2016-01-02T05:01:52.960" Score="5" Body="&lt;p&gt;If I understand correctly, you're trying to see what key bindings are available at any instant in time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, try &lt;a href=&quot;https://github.com/emacs-helm/helm-descbinds&quot; rel=&quot;nofollow&quot;&gt;helm-descbinds&lt;/a&gt;, which works with &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;helm&lt;/a&gt;. Key bindings are organized by major mode, minor modes, and the global map. You can then use a regular expression to narrow down your choice, e.g. &lt;code&gt;^C-x\ [a-z]&lt;/code&gt; to find all bindings that begin with &lt;code&gt;C-x&lt;/code&gt; and are followed by a letter from &lt;code&gt;a-z&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also try &lt;a href=&quot;https://github.com/steckerhalter/discover-my-major&quot; rel=&quot;nofollow&quot;&gt;discover-my-major&lt;/a&gt;, which lists all the key bindings of your current major mode, along with an &lt;code&gt;apropos&lt;/code&gt;-like description of what they do. I find that it is useful when I'm trying to learn a new major mode.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2016-01-05T22:26:48.533" LastActivityDate="2016-01-05T22:26:48.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19208" PostTypeId="2" ParentId="19201" CreationDate="2016-01-02T12:12:24.570" Score="1" Body="&lt;p&gt;Flycheck provides &lt;code&gt;flycheck-add-mode&lt;/code&gt; to register syntax checkers for new major modes, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (checker '(c/c++-clang c/c++-gcc c/c++-cppcheck))&#xA;  (flycheck-add-mode checker 'my-derived-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will add your &lt;code&gt;my-derived-mode&lt;/code&gt; to all C/C++ syntax checkers in Flycheck.  After evaluating this expression, Flycheck will check buffers in your derived mode just like buffers in the default C and C++ modes.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-01-02T12:12:24.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19209" PostTypeId="1" CreationDate="2016-01-02T14:42:33.777" Score="1" ViewCount="293" Body="&lt;p&gt;Emacs freezes while I was moving cursor in a latex file with AucTeX-mode (and LaTeX-mode). Emacs becomes black and I can do nothing, including &lt;code&gt;C-g&lt;/code&gt;. I followed the approach in &lt;a href=&quot;https://emacs.stackexchange.com/questions/14354/how-do-i-debug-an-emacs-crash/14376#14376&quot;&gt;this answer&lt;/a&gt;, and obtained the following backtrace information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using emacs on a Ubuntu 14.04.2 Desktop on my laptop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs-version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2015-12-14 on zhlaptop&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;uname -a:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Linux zhlaptop 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;GDB:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;jzzhao@zhlaptop:~/Downloads/emacs-24.5/src$ gdb ./emacs&#xA;GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1&#xA;Copyright (C) 2014 Free Software Foundation, Inc.&#xA;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&#xA;This is free software: you are free to change and redistribute it.&#xA;There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;&#xA;and &quot;show warranty&quot; for details.&#xA;This GDB was configured as &quot;x86_64-linux-gnu&quot;.&#xA;Type &quot;show configuration&quot; for configuration details.&#xA;For bug reporting instructions, please see:&#xA;&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.&#xA;Find the GDB manual and other documentation resources online at:&#xA;&amp;lt;http://www.gnu.org/software/gdb/documentation/&amp;gt;.&#xA;For help, type &quot;help&quot;.&#xA;Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...&#xA;Reading symbols from ./emacs...done.&#xA;SIGINT is used by the debugger.&#xA;Are you sure you want to change it? (y or n) [answered Y; input not from terminal]&#xA;DISPLAY = :0&#xA;TERM = xterm-256color&#xA;Breakpoint 1 at 0x543ef2: file emacs.c, line 349.&#xA;Temporary breakpoint 2 at 0x565cbf: file sysdep.c, line 850.&#xA;(gdb) r --debug-init&#xA;Starting program: /home/jzzhao/Downloads/emacs-24.5/src/emacs --debug-init&#xA;[Thread debugging using libthread_db enabled]&#xA;Using host libthread_db library &quot;/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.&#xA;[New Thread 0x7fffe9f11700 (LWP 18606)]&#xA;[New Thread 0x7fffe8ed9700 (LWP 18607)]&#xA;[New Thread 0x7fffe39c2700 (LWP 18608)]&#xA;^Z&#xA;Program received signal SIGTSTP, Stopped (user).&#xA;0x00007ffff185012d in poll () at ../sysdeps/unix/syscall-template.S:81&#xA;81  ../sysdeps/unix/syscall-template.S: No such file or directory.&#xA;(gdb) bt&#xA;#0  0x00007ffff185012d in poll () at ../sysdeps/unix/syscall-template.S:81&#xA;#1  0x00007fffee333b72 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1&#xA;#2  0x00007fffee33564f in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1&#xA;#3  0x00007ffff4c99198 in _XReadEvents () from /usr/lib/x86_64-linux-gnu/libX11.so.6&#xA;#4  0x00007ffff4c81751 in XIfEvent () from /usr/lib/x86_64-linux-gnu/libX11.so.6&#xA;#5  0x00007ffff4cc7f24 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6&#xA;#6  0x00007ffff4cc8b80 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6&#xA;#7  0x00007ffff4cc8e71 in _XimRead () from /usr/lib/x86_64-linux-gnu/libX11.so.6&#xA;#8  0x00007ffff4cb78a6 in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6&#xA;#9  0x00007ffff4ca5b3d in XSetICValues () from /usr/lib/x86_64-linux-gnu/libX11.so.6&#xA;#10 0x000000000051d28f in xic_set_preeditarea (w=0x11f5ea8, x=180, y=46) at xfns.c:2107&#xA;#11 0x0000000000513483 in x_draw_window_cursor (w=0x11f5ea8, glyph_row=0x45e7240, x=180, y=46, cursor_type=FILLED_BOX_CURSOR, cursor_width=-1, on_p=true, active_p=true) at xterm.c:7331&#xA;#12 0x0000000000483397 in display_and_set_cursor (w=0x11f5ea8, on=true, hpos=20, vpos=2, x=180, y=46) at xdisp.c:27662&#xA;#13 0x0000000000506067 in x_update_window_end (w=0x11f5ea8, cursor_on_p=true, mouse_face_overwritten_p=false) at xterm.c:582&#xA;#14 0x000000000041d413 in update_window (w=0x11f5ea8, force_p=true) at dispnew.c:3541&#xA;#15 0x000000000041caa5 in update_window_tree (w=0x11f5ea8, force_p=true) at dispnew.c:3216&#xA;#16 0x000000000041c719 in update_frame (f=0x11f4e98, force_p=true, inhibit_hairy_id_p=false) at dispnew.c:3105&#xA;#17 0x00000000004550d0 in redisplay_internal () at xdisp.c:14052&#xA;#18 0x0000000000452e9e in redisplay () at xdisp.c:13229&#xA;#19 0x000000000054adac in read_char (commandflag=1, map=165321094, prev_event=12874034, used_mouse_menu=0x7fffffffd7c9, end_time=0x0) at keyboard.c:2571&#xA;#20 0x000000000055723f in read_key_sequence (keybuf=0x7fffffffd9b0, bufsize=30, prompt=12874034, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, &#xA;prevent_redisplay=false) at keyboard.c:9089&#xA;#21 0x0000000000548651 in command_loop_1 () at keyboard.c:1453&#xA;#22 0x00000000005dad9e in internal_condition_case (bfun=0x548289 &amp;lt;command_loop_1&amp;gt;, handlers=12925602, hfun=0x547b78 &amp;lt;cmd_error&amp;gt;) at eval.c:1348&#xA;#23 0x0000000000547fe3 in command_loop_2 (ignore=12874034) at keyboard.c:1178&#xA;#24 0x00000000005da5b0 in internal_catch (tag=12921538, func=0x547fbd &amp;lt;command_loop_2&amp;gt;, arg=12874034) at eval.c:1112&#xA;#25 0x0000000000547f91 in command_loop () at keyboard.c:1157&#xA;#26 0x0000000000547773 in recursive_edit_1 () at keyboard.c:778&#xA;#27 0x00000000005478e0 in Frecursive_edit () at keyboard.c:849&#xA;#28 0x00000000005458f2 in main (argc=2, argv=0x7fffffffddb8) at emacs.c:1642&#xA;&#xA;Lisp Backtrace:&#xA;&quot;redisplay_internal (C function)&quot; (0xc2cae8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I still do not know where goes wrong. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can provide more information if you need.&lt;/p&gt;&#xA;" OwnerUserId="10646" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-01-02T15:12:23.800" Title="Emacs freezes while editing a tex file" Tags="|debugging|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19210" PostTypeId="1" AcceptedAnswerId="19212" CreationDate="2016-01-02T15:44:29.620" Score="7" ViewCount="2470" Body="&lt;p&gt;Suppose I have an &lt;code&gt;org-mode&lt;/code&gt; buffer that contains the outline shown below, and that point is at the position indicated by the ▮ character.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;** bar&#xA;*** baz&#xA;    - eenie&#xA;      - yabba&#xA;      - dabba▮&#xA;      - doo&#xA;    - meenie&#xA;    - minie&#xA;* frobozz&#xA;** quux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Call this particular configuration (buffer content + point position) the &lt;em&gt;initial state&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I now run &lt;code&gt;org-insert-heading&lt;/code&gt; (IOW, I type &lt;code&gt;M-&amp;lt;RET&amp;gt;&lt;/code&gt;), I get a new list item:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;** bar&#xA;*** baz&#xA;    - eenie&#xA;      - yabba&#xA;      - dabba&#xA;      - ▮&#xA;      - doo&#xA;    - meenie&#xA;    - minie&#xA;* frobozz&#xA;** quux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I think of a &quot;heading&quot; in an &lt;code&gt;org-mode&lt;/code&gt; outline as a line beginning with &lt;code&gt;*&lt;/code&gt;'s.  Therefore, if I interpret the name of the command &lt;code&gt;org-insert-heading&lt;/code&gt; &lt;em&gt;literally&lt;/em&gt;, I would have expected that running &lt;code&gt;org-insert-heading&lt;/code&gt; from the &lt;em&gt;initial state&lt;/em&gt; would have produced the following, which I'll refer to as the &lt;em&gt;desired state&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;** bar&#xA;*** baz&#xA;    - eenie&#xA;      - yabba&#xA;      - dabba&#xA;      - doo&#xA;    - meenie&#xA;    - minie&#xA;*** ▮&#xA;* frobozz&#xA;** quux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;does the &lt;code&gt;org-mode&lt;/code&gt; interface already provides a more direct way&lt;sup&gt;1&lt;/sup&gt; to achieve the &lt;em&gt;desired state&lt;/em&gt; starting from the &lt;em&gt;initial state&lt;/em&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(In case that the answer to this question is &quot;no&quot;, then a distant second-best would be a way to override &lt;code&gt;org-insert-heading&lt;/code&gt; so that it behaves the way I think it should (i.e. always inserting a &lt;strong&gt;heading&lt;/strong&gt;, namely a line starting with &lt;code&gt;*&lt;/code&gt;s, and thus producing the &lt;em&gt;desired state&lt;/em&gt; from the &lt;em&gt;initial state&lt;/em&gt;), together with a new custom command that preserves the default behavior of &lt;code&gt;org-insert-heading&lt;/code&gt; in the &lt;em&gt;initial state&lt;/em&gt;.  I'd appreciate any help I can get with this too.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; I stress that my question does not ask for &lt;em&gt;any&lt;/em&gt; way, by hook or crook, to get to the &lt;em&gt;desired state&lt;/em&gt; from the &lt;em&gt;initial state&lt;/em&gt;.  I realize that, if nothing else, I can always &quot;revert to plain Emacs&quot;, so to speak: for example, I can move point as shown below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* foo&#xA;** bar&#xA;*** baz&#xA;    - eenie&#xA;      - yabba&#xA;      - dabba&#xA;      - doo&#xA;    - meenie&#xA;    - minie▮&#xA;* frobozz&#xA;** quux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and then type the sequence &lt;kbd&gt;RET&lt;/kbd&gt;&lt;kbd&gt;&amp;ast;&lt;/kbd&gt;&lt;kbd&gt;&amp;ast;&lt;/kbd&gt;&lt;kbd&gt;&amp;ast;&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;, to arrive at the &lt;em&gt;desired state&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2022-02-25T15:37:16.810" Title="How to insert a new same-level headline after current one?" Tags="|org-mode|insert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19211" PostTypeId="1" CreationDate="2016-01-02T16:00:42.603" Score="7" ViewCount="2163" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; I have an expression of the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice find-file ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...which modifies the behavior of the standard &lt;code&gt;find-file&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are times, however, when I want to bypass this customized behavior altogether, and run the original, unmodified, &lt;code&gt;find-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way I have found to do this is to comment-out the &lt;code&gt;(defadvice find-file ...)&lt;/code&gt; expression in my &lt;code&gt;.emacs&lt;/code&gt; file and start a fresh Emacs session.  This is an extremely disruptive, not to mention heavy-handed, solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tell Emacs to run the original &lt;code&gt;find-file&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, is there at least a way to rescind the &lt;code&gt;defadvice&lt;/code&gt; altogether for the remainder of the Emacs session?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;An earlier attempt to try something like what PythonNut suggests in a comment failed because I could not figure out how to write a simple wrapper for &lt;code&gt;find-file&lt;/code&gt;.  More specifically, I replaced the &lt;code&gt;(defadvice find-file ...)&lt;/code&gt; expression in my &lt;code&gt;.emacs&lt;/code&gt; file with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-find-file (&amp;amp;rest args)&#xA;  (apply 'find-file args))&#xA;&#xA;(global-set-key (kbd &quot;C-x C-f&quot;) 'my-find-file)&#xA;&#xA;(defadvice my-find-file ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...where the code shown as &lt;code&gt;...&lt;/code&gt; in the new &lt;code&gt;(defadvice my-find-file ...)&lt;/code&gt; is identical to the &lt;code&gt;...&lt;/code&gt; in the original &lt;code&gt;(defadvice find-file ...)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start a new Emacs session with this new &lt;code&gt;.emacs&lt;/code&gt; file, and type &lt;code&gt;C-x C-f&lt;/code&gt;, I get the error message &lt;code&gt;Wrong type argument: commandp, my-find-file&lt;/code&gt;.  It looks like &lt;code&gt;my-find-file&lt;/code&gt; is not an adequate wrapper for &lt;code&gt;find-file&lt;/code&gt;.  (I posted a &lt;a href=&quot;https://emacs.stackexchange.com/q/19215/882&quot;&gt;question&lt;/a&gt; specifically about this.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-01-04T03:55:49.867" Title="How to bypass (or disable) a command's &quot;advice&quot;?" Tags="|advice|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19212" PostTypeId="2" ParentId="19210" CreationDate="2016-01-02T16:10:49.247" Score="17" Body="&lt;p&gt;&lt;code&gt;C-&amp;lt;RET&amp;gt;&lt;/code&gt;, &lt;code&gt;org-insert-heading-respect-content&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Other options are listed in the &lt;a href=&quot;https://orgmode.org/manual/Structure-Editing.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="37285" LastEditDate="2022-02-25T15:37:16.810" LastActivityDate="2022-02-25T15:37:16.810" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19213" PostTypeId="2" ParentId="19211" CreationDate="2016-01-02T16:22:43.383" Score="7" Body="&lt;p&gt;The &lt;code&gt;defadvice&lt;/code&gt; macro is almost obsolete, having been replaced by an improved system that uses &lt;code&gt;advice-add&lt;/code&gt;, &lt;code&gt;advice-remove&lt;/code&gt;, etc, which allows you to turn advice on and off, among other things. See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot;&gt;manual&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are stuck on an older version of Emacs without the improved system, you can deactivate advice on a function with &lt;code&gt;(ad-deactivate FUNCTION)&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-01-02T16:22:43.383" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19214" PostTypeId="2" ParentId="19211" CreationDate="2016-01-02T16:49:12.523" Score="5" Body="&lt;p&gt;If you have an Emacs version prior to release 24.4 then you have the doc for `defadvice' available from within Emacs.  In that case, &lt;strong&gt;Ask Emacs!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h i&lt;/code&gt; to open Info, the doc browser, in Emacs. Then choose the Elisp manual.  Then &lt;code&gt;i advice TAB&lt;/code&gt; to look up advice in the index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;TAB&lt;/code&gt; shows you the index entries that start with &lt;code&gt;advice&lt;/code&gt;, one of which is &lt;code&gt;advice, enabling and disabling&lt;/code&gt;. so continue typing: &lt;code&gt;, enab&lt;/code&gt; and hit &lt;code&gt;RET&lt;/code&gt; (Enter key) to visit the part of the manual (node ) that tells you the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One answer is... command &lt;code&gt;ad-disable-advice&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x ad-disable-advice RET find-file&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But reading more you see that this disables a particular piece of advice of a particular class for the given function.  You can also &lt;em&gt;deactivate&lt;/em&gt; &lt;strong&gt;all&lt;/strong&gt; advice for the function.  Reading more, you come across command &lt;code&gt;ad-deactivate&lt;/code&gt;, which does that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x ad-deactivate RET find-file&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="454" LastEditDate="2016-01-02T21:50:14.110" LastActivityDate="2016-01-02T21:50:14.110" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19215" PostTypeId="1" AcceptedAnswerId="19221" CreationDate="2016-01-02T17:23:08.480" Score="12" ViewCount="1974" Body="&lt;p&gt;What I mean by a &quot;transparent 'pass-through' function wrapper&quot; is a function, let's call it &lt;code&gt;wrapper&lt;/code&gt;, that returns the result from passing all its argument to some other function, let's call it &lt;code&gt;wrappee&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this done in Emacs Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: The ideal &lt;code&gt;wrapper&lt;/code&gt; function is &lt;em&gt;agnostic&lt;/em&gt; about the &lt;code&gt;wrappee&lt;/code&gt; function's signature; i.e. it knows nothing of the number, positions, names, etc. of &lt;code&gt;wrappee&lt;/code&gt;'s arguments; it just passes all its arguments along to &lt;code&gt;wrappee&lt;/code&gt;, just as if &lt;code&gt;wrappee&lt;/code&gt; had been the one originally called.  (There's no need, however, to mess with the call stack to replace the call to &lt;code&gt;wrapper&lt;/code&gt; with a call to &lt;code&gt;wrappee&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I posted a &lt;em&gt;partial&lt;/em&gt; answer to my question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wrapper (&amp;amp;rest args) (apply 'wrappee args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works only when &lt;code&gt;wrappee&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; interactive.  Apparently, the way interactive functions get their arguments represents a different &quot;channel&quot; from what's covered by the &lt;code&gt;(&amp;amp;rest args)&lt;/code&gt; incantation.  What I still need, therefore, is an equally-&lt;code&gt;wrappee&lt;/code&gt;-agnostic counterpart of the &lt;code&gt;(&amp;amp;rest args)&lt;/code&gt; signature for the case where &lt;code&gt;wrappee&lt;/code&gt; is an &lt;em&gt;interactive&lt;/em&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This question was motivated by a problem described in this &lt;a href=&quot;https://emacs.stackexchange.com/q/19211/882&quot;&gt;earlier question&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In case further clarification of what I'm asking for is needed, below are a couple of examples, showing the Python and JavaScript equivalents of what I'm after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Python a couple of standard ways to implement such a wrapper are shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def wrapper(*args, **kwargs):&#xA;    return wrappee(*args, **kwargs)&#xA;&#xA;# or&#xA;&#xA;wrapper = lambda *args, **kwargs: wrappee(*args, **kwargs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Here &lt;code&gt;*args&lt;/code&gt; stands for &quot;all the positional arguments&quot;, and &lt;code&gt;**kwargs&lt;/code&gt; stands for &quot;all the keyword arguments&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The JavaScript equivalent would be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function wrapper () { return wrappee.apply(this, arguments); }&#xA;&#xA;// or&#xA;&#xA;wrapper = function () { return wrappee.apply(this, arguments); }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For the record, I disagree that this question is a duplicate of &lt;a href=&quot;https://emacs.stackexchange.com/questions/18831/how-to-apply-mapcar-to-a-function-with-multiple-arguments&quot;&gt;How to apply mapcar to a function with multiple arguments&lt;/a&gt;.  I am at a loss to explain why, since the two questions look so obviously different to me.  It is like being asked &quot;explain why an apple should not be considered equivalent to an orange&quot;.  The mere question is so crazy, that one doubts one could ever come up with an answer that would satisfy the person asking it.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-15T12:24:12.547" Title="How to write a transparent &quot;pass-through&quot; function wrapper?" Tags="|advice|arguments|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19218" PostTypeId="1" AcceptedAnswerId="19220" CreationDate="2016-01-02T18:22:27.957" Score="1" ViewCount="1852" Body="&lt;p&gt;I have a variable that holds a GIF image&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;my-image's value is&#xA;(image :type gif :data &quot;GIF89a+&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I add it to a buffer and it is being displayed&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-image my-image)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the animation is not being shown. I try to do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(image-animate my-image 0 t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the animation does not start either. If I ask the current frame&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(image-current-frame my-image)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It always return zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I start the animation?&lt;/p&gt;&#xA;" OwnerUserId="5247" LastActivityDate="2016-01-02T19:23:24.097" Title="Starting animation in Gif" Tags="|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19220" PostTypeId="2" ParentId="19218" CreationDate="2016-01-02T19:23:24.097" Score="3" Body="&lt;p&gt;An animated GIF is a multi-frame image to Emacs.  You can display an arbitrary frame of it by specifying the &lt;code&gt;:index&lt;/code&gt; property in the image specification.  &lt;code&gt;image-animate&lt;/code&gt; does modify the index of the given image specification with a timer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, &lt;a href=&quot;http://brause.cc/video/emacs_animated_gif.mkv&quot; rel=&quot;nofollow&quot;&gt;it works for me&lt;/a&gt;.  What you could do is finding the definition of &lt;code&gt;image-animate&lt;/code&gt; with &lt;code&gt;M-x find-function&lt;/code&gt;, then instrument it with &lt;code&gt;C-u C-M-x&lt;/code&gt; and step through its execution to see what's going wrong.  Alternatively, try figuring out whether something about the image spec is wrong, like by using an absolute file name as argument to &lt;code&gt;create-image&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-01-02T19:23:24.097" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19221" PostTypeId="2" ParentId="19215" CreationDate="2016-01-02T21:18:43.717" Score="13" Body="&lt;p&gt;Of course it is possible inclusive the &lt;code&gt;interactive&lt;/code&gt; specification. We are dealing here with &lt;strong&gt;elisp&lt;/strong&gt;! (Lisp is the language where the most important constructs are lists. Callable forms are just lists. So you can construct them after your liking.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Application: You want to add some functionality to some functions automagically. The extended functions should be given new names so that &lt;code&gt;defadvice&lt;/code&gt; is not applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First a version that fits quite exactly your purpose. We set the function cell (&lt;code&gt;fset&lt;/code&gt;) of the symbol &lt;code&gt;wrapper&lt;/code&gt; with all required information from &lt;code&gt;wrappee&lt;/code&gt; and add our extra stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works for both &lt;code&gt;wrappee&lt;/code&gt; definitions. The first version of &lt;code&gt;wrappee&lt;/code&gt; is interactive the second is not.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun wrappee (num str)&#xA;  &quot;Nontrivial wrappee.&quot;&#xA;  (interactive &quot;nNumber:\nsString:&quot;)&#xA;  (message &quot;The number is %d.\nThe string is \&quot;%s\&quot;.&quot; num str))&#xA;&#xA;(defun wrappee (num str)&#xA;  &quot;Noninteractive wrappee.&quot;&#xA;  (message &quot;The number is %d.\nThe string is \&quot;%s\&quot;.&quot; num str))&#xA;&#xA;(fset 'wrapper (list 'lambda&#xA;             '(&amp;amp;rest args)&#xA;             (concat (documentation 'wrappee t) &quot;\n Wrapper does something more.&quot;)&#xA;             (interactive-form 'wrappee)&#xA;             '(prog1 (apply 'wrappee args)&#xA;            (message &quot;Wrapper does something more.&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it is more convenient to define a macro that constructs the extended functions. Therewith we can even specify the function names afterwards. (Good for an automated version.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After executing the code below you can call &lt;code&gt;wrapper-interactive&lt;/code&gt; interactively and &lt;code&gt;wrapper-non-interactive&lt;/code&gt; non-interactively.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro make-wrapper (wrappee wrapper)&#xA;  &quot;Create a WRAPPER (a symbol) for WRAPPEE (also a symbol).&quot;&#xA;  (let ((arglist (make-symbol &quot;arglist&quot;)))&#xA;  `(defun ,wrapper (&amp;amp;rest ,arglist)&#xA;     ,(concat (documentation wrappee) &quot;\n But I do something more.&quot;)&#xA;     ,(interactive-form wrappee)&#xA;     (prog1 (apply (quote ,wrappee) ,arglist)&#xA;       (message &quot;Wrapper %S does something more.&quot; (quote ,wrapper))))))&#xA;&#xA;(defun wrappee-interactive (num str)&#xA;  &quot;That is the doc string of wrappee-interactive.&quot;&#xA;  (interactive &quot;nNumber:\nsString:&quot;)&#xA;  (message &quot;The number is %d.\nThe string is \&quot;%s\&quot;.&quot; num str))&#xA;&#xA;(defun wrappee-non-interactive (format &amp;amp;rest arglist)&#xA;  &quot;That is the doc string of wrappee-non-interactive.&quot;&#xA;  (apply 'message format arglist))&#xA;&#xA;(make-wrapper wrappee-interactive wrapper-interactive)&#xA;(make-wrapper wrappee-non-interactive wrapper-non-interactive)&#xA;;; test of the non-interactive part:&#xA;(wrapper-non-interactive &quot;Number: %d, String: %s&quot; 1 &quot;test&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, up to now I did not yet find a way to transfer the declare forms but that should also be possible. &lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-02T21:40:35.983" LastActivityDate="2016-01-02T21:40:35.983" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19222" PostTypeId="2" ParentId="19215" CreationDate="2016-01-02T21:38:10.373" Score="1" Body="&lt;p&gt;edit: Tobias' answer is nicer than this, as it obtains the precise interactive form and docstring of the wrapped function.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Combining the answers of Aaron Harris and kjo, you might use something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my-make-wrapper (fn &amp;amp;optional name)&#xA;  &quot;Return a wrapper function for FN defined as symbol NAME.&quot;&#xA;  `(defalias ',(or (eval name)&#xA;                   (intern (concat &quot;my-&quot; (symbol-name (eval fn)) &quot;-wrapper&quot;)))&#xA;     (lambda (&amp;amp;rest args)&#xA;       ,(format &quot;Generic wrapper for %s.&quot;&#xA;                (if (symbolp (eval fn))&#xA;                    (concat &quot;`&quot; (symbol-name (eval fn)) &quot;'&quot;)&#xA;                  fn))&#xA;       (interactive)&#xA;       (if (called-interactively-p 'any)&#xA;           (call-interactively ,fn)&#xA;         (apply ,fn args)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(my-make-wrapper 'find-file 'wrapper-func)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Call wrapper with either of:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(wrapper-func &quot;~/.emacs.d/init.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;wrapper-func&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-01-02T21:43:34.673" LastActivityDate="2016-01-02T21:43:34.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19223" PostTypeId="1" AcceptedAnswerId="19224" CreationDate="2016-01-02T23:30:45.573" Score="8" ViewCount="1263" Body="&lt;p&gt;Given an outline with arbitrary structure, how can one demote every single heading by one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, starting from something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Lorem ips&#xA;  um dolor sit ame&#xA;** t, consectetur a&#xA;   dipiscing elit. Vivamus ph&#xA;*** aretra diam lorem, e&#xA;** u consectetur urna m&#xA;   - alesuada sit amet. Donec turpis lacus, molestie id nunc et, laoreet&#xA;   - cursus ex Integer porttitor nisl neque, id f ermentum erat tincidun&#xA;   - t sit amet. Etiam in d&#xA;*** ignissim quam. D&#xA;* onec non &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...what's the easiest way to get to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Lorem ips&#xA;   um dolor sit ame&#xA;*** t, consectetur a&#xA;    dipiscing elit. Vivamus ph&#xA;**** aretra diam lorem, e&#xA;*** u consectetur urna m&#xA;    - alesuada sit amet. Donec turpis lacus, molestie id nunc et, laoreet&#xA;    - cursus ex Integer porttitor nisl neque, id f ermentum erat tincidun&#xA;    - t sit amet. Etiam in d&#xA;**** ignissim quam. D&#xA;** onec non &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, after this global demotion I'd add a new top-level header encompassing all the demoted headers in its subtree.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="91" LastEditDate="2016-01-03T15:03:17.783" LastActivityDate="2019-03-06T22:46:31.013" Title="How to demote all headings by 1?" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19224" PostTypeId="2" ParentId="19223" CreationDate="2016-01-03T00:06:39.007" Score="15" Body="&lt;p&gt;&lt;code&gt;org-do-demote&lt;/code&gt; will demote everything within a marked region.  According to the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(org-do-demote)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Demote the current heading lower down the tree.&#xA;  If the region is active in &lt;code&gt;transient-mark-mode&lt;/code&gt;, demote all headings&#xA;  in the region.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So: mark the region and &lt;code&gt;org-do-demote&lt;/code&gt;.  In practice, you can use &lt;code&gt;org-mataright&lt;/code&gt; in this situation, which will demote the subtree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, you can simply use &lt;code&gt;org-demote-subtree&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;org-demote-subtree&lt;/code&gt; is an interactive compiled Lisp function in&#xA;  &lt;code&gt;org.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(org-demote-subtree)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Demote the entire subtree.  See &lt;code&gt;org-do-demote&lt;/code&gt;.&#xA;  See also &lt;code&gt;org-do-promote&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-demote-subtree&lt;/code&gt; is bound to &lt;code&gt;M-S-&amp;lt;right&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="21152" LastEditDate="2019-03-06T22:46:31.013" LastActivityDate="2019-03-06T22:46:31.013" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19225" PostTypeId="1" AcceptedAnswerId="19226" CreationDate="2016-01-03T00:18:35.057" Score="3" ViewCount="160" Body="&lt;p&gt;How does one access the &lt;code&gt;declare&lt;/code&gt; specification of a function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; After the answer of &lt;a href=&quot;https://emacs.stackexchange.com/users/5296/npostavs&quot;&gt;npostavs&lt;/a&gt; I have to correct myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;As long as a function is not byte-compiled the &lt;code&gt;declare&lt;/code&gt; forms are still in its &lt;code&gt;symbol-function&lt;/code&gt;. Where do they go after byte-compilation?&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: (content of scratch buffer with lisp code and evaluation results)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun test (&amp;amp;rest args)&#xA;  &quot;Function with declare form.&quot;&#xA;  (declare (indent 1))&#xA;  (interactive)&#xA;  (message args))&#xA;;; repl: test&#xA;&#xA;(symbol-function 'test)&#xA;;; repl: (lambda (&amp;amp;rest args) &quot;Function with declare form.&quot; (interactive) (message args))&#xA;&#xA;(symbol-plist 'test)&#xA;;; repl: (lisp-indent-function 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That means the &lt;code&gt;declare&lt;/code&gt; forms are not contained in the function cell of the symbol after the &lt;code&gt;defun&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test (&amp;amp;rest args)&#xA;  &quot;Function with declare form.&quot;&#xA;  (interactive)&#xA;  (declare (indent 1))&#xA;  (message args))&#xA;&#xA;(symbol-function 'test)&#xA;(lambda (&amp;amp;rest args) &quot;Function with declare form.&quot; (interactive) (declare (indent 1)) (message args))&#xA;&#xA;(setf f (byte-compile 'test))&#xA;#[(&amp;amp;rest args) &quot;\301!\207&quot; [args message] 2 &quot;Function with declare form.&quot; nil]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the right way to access the declare information of a function in elisp?&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-06-22T20:08:40.407" Title="How to access the declare specifications of a function" Tags="|declare|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19226" PostTypeId="2" ParentId="19225" CreationDate="2016-01-03T02:51:43.910" Score="6" Body="&#xA;&#xA;&lt;p&gt;Actually you have the &lt;code&gt;declare&lt;/code&gt; in the wrong place, it should go before &lt;code&gt;(interactive)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun test (&amp;amp;rest args)&#xA;  &quot;Function with declare form.&quot;&#xA;  (declare (indent 1))&#xA;  (interactive)&#xA;  (message args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then if you macroexpand you can see what it does:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(prog1&#xA;    (defalias 'test&#xA;      #'(lambda&#xA;          (&amp;amp;rest args)&#xA;          &quot;Function with declare form.&quot;&#xA;          (interactive)&#xA;          (message args)))&#xA;  (put 'test 'lisp-indent-function '1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the &lt;code&gt;declare&lt;/code&gt; form itself is not stored, but &lt;code&gt;defun&lt;/code&gt; interprets and rewrites it into code with the needed effect.  Also note that the effect works on the symbol, not the function itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reconstruct a &lt;code&gt;declare&lt;/code&gt; form you would have to see what each kind of declaration does; the effects are listed in &lt;code&gt;defun-declarations-alist&lt;/code&gt; and &lt;code&gt;macro-declarations-alist&lt;/code&gt; (you can see this by looking at the definitions of &lt;code&gt;defun&lt;/code&gt; and &lt;code&gt;defmacro&lt;/code&gt;).  Almost all work by &lt;code&gt;put&lt;/code&gt;ting a property on the symbol, so you could just &lt;code&gt;get&lt;/code&gt; the corresponding property.  The only exception (as of Emacs 24.5) is &lt;code&gt;advertised-calling-convention&lt;/code&gt; which stores the preferred signature in &lt;code&gt;advertised-signature-table&lt;/code&gt;, a hash table with the function itself as the key.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2016-01-03T13:46:51.480" LastActivityDate="2016-01-03T13:46:51.480" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19227" PostTypeId="2" ParentId="19152" CreationDate="2016-01-03T06:57:40.750" Score="1" Body="&lt;p&gt;I experienced the exact same issue. The proposed &quot;solution&quot; using &lt;code&gt;emacs -Q&lt;/code&gt; works (also in my case), because it loads a different version of org-mode, in which the bug with previewlatex does not yet exist. (compare &lt;code&gt;M-x org-version&lt;/code&gt; if you start emacs with and without the &lt;code&gt;-Q&lt;/code&gt; option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this problem is probably not related to the &lt;code&gt;.emacs&lt;/code&gt; file. Its probably a bug in newer versions of org-mode (I'm using version 8.3.2).&lt;/p&gt;&#xA;" OwnerUserId="10651" LastActivityDate="2016-01-03T06:57:40.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19228" PostTypeId="1" AcceptedAnswerId="19248" CreationDate="2016-01-03T11:12:03.127" Score="3" ViewCount="213" Body="&lt;p&gt;The boolean variable &lt;code&gt;truncate-lines&lt;/code&gt; controls whether continuation lines are displayed or not. I use this when I am checking some log file where the very long lines are truncated thanks to a previous &lt;code&gt;(setq truncate-lines t)&lt;/code&gt;. This is convenient since the relevant contents is usually at the beginning of the lines. However I sometimes need to see the end of the inspected lines and I'll occasionally toggle &lt;code&gt;truncate-lines&lt;/code&gt; on and off (this is done in code temporarily bound to a function key).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that toggling &lt;code&gt;truncate-lines&lt;/code&gt; on and off does not update the display unless I do some editing, or move the cursor far enough, or .. I don't know what. I tried to insert a &lt;code&gt;(redisplay t)&lt;/code&gt; in my toggling code but this is not enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What bit of elisp magic will cause the display to be updated according to the new value of &lt;code&gt;truncate-lines&lt;/code&gt; once it is changed?  And, by the way, is the lack of immediate update a bona fide bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How to reproduce the problem:&lt;/em&gt; After some investigation, it seems that the problem appears because I invoke the toggle via some key binding and not by &lt;code&gt;execute-extended-command&lt;/code&gt; aka &lt;code&gt;M-x&lt;/code&gt;. &lt;a href=&quot;http://www.lsv.ens-cachan.fr/~phs/test_file&quot; rel=&quot;nofollow&quot;&gt;Here is a test file for you to download&lt;/a&gt;. Start with &lt;code&gt;emacs -Q test_file&lt;/code&gt;, then &lt;code&gt;eval-defun&lt;/code&gt; the first expression. Now &lt;code&gt;M-x ttl&lt;/code&gt; does the toggle ok but on my machine hitting &lt;code&gt;CTRL l&lt;/code&gt; (now bound to &lt;code&gt;ttl&lt;/code&gt;) does the toggle &lt;strong&gt;without redisplay&lt;/strong&gt;. If I move to end of buffer, the redisplay is activated.&#xA;FWIW I use emacs 24.5.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Added Jan. 5th:&lt;/em&gt; it turns out that the behaviour described above is due to a minor bug that will be fixed in Emacs 25, &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&amp;amp;id=50575b1bdd7fcb4d1bf525fb5ca635fe7ab7d8c6&quot; rel=&quot;nofollow&quot;&gt;see here&lt;/a&gt;. In principle there is nothing wrong with changing &lt;code&gt;truncate-lines&lt;/code&gt; directly without going through &lt;code&gt;toggle-truncate-lines&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1992" LastEditorUserId="1992" LastEditDate="2016-01-05T10:46:04.477" LastActivityDate="2016-01-05T10:46:04.477" Title="How to force redisplay after you change truncate-lines?" Tags="|redisplay|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19230" PostTypeId="1" AcceptedAnswerId="19239" CreationDate="2016-01-03T17:04:18.623" Score="6" ViewCount="1031" Body="&lt;p&gt;I use org-mode mostly (by far) directly within Emacs (as opposed to as a mark-up to be ultimately viewed through, say, a web browser or a PDF viewer).  Therefore, I'm interested in ways to &quot;hide&quot;&lt;sup&gt;1&lt;/sup&gt; as much of the org-mode mark-up as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is there a way to hide org-mode target specs, of the form &lt;code&gt;&amp;lt;&amp;lt;target&amp;gt;&amp;gt;&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm primarily interested in solutions that can be applied selectively (e.g. only target specs that match a particular regular expression get hidden), but a solution that hides all targets of this form would be OK too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, I'd be interested in ways to hide arbitrary org-mode mark-up.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; By &quot;hide&quot; I mean whatever the process is that accounts for the &quot;invisibility&quot; (&lt;em&gt;in an Emacs org-mode buffer&lt;/em&gt;) of the leading &lt;code&gt;[[#target][&lt;/code&gt; and trailing &lt;code&gt;]]&lt;/code&gt; (for example) in the hyperlink spec &lt;code&gt;[[#target][here]]&lt;/code&gt;.  This form of hiding should be contrasted with what happens with the leading stars of a heading when &lt;code&gt;org-hide-leading-stars&lt;/code&gt; is non-nil.  In the latter case, the stars are still being displayed, albeit in a color that approximates the window's background color.  They still take up space on the screen.  This is &lt;em&gt;not&lt;/em&gt; what I'm referring to by &quot;hiding&quot; in this post.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2016-01-03T17:10:15.827" LastActivityDate="2017-04-22T07:50:42.570" Title="How to hide &lt;&lt;target&gt;&gt;s?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19231" PostTypeId="1" AcceptedAnswerId="59935" CreationDate="2016-01-03T18:01:10.893" Score="1" ViewCount="275" Body="&lt;p&gt;I have the following in my &lt;code&gt;.bashrc&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export R_LIBS_USER=&quot;/home/wdkrnls/R/lib/3.2&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I start &lt;code&gt;R&lt;/code&gt; from the shell I see (even in Emacs &lt;code&gt;M-x shell&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.libPaths()&#xA;[1] &quot;/home/wdkrnls/R/lib/3.2&quot;  &quot;/usr/lib/R/library&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I start an &lt;code&gt;R&lt;/code&gt; process with &lt;code&gt;M-x R&lt;/code&gt;, I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.libPaths()&#xA;[1] &quot;/usr/lib/R/library&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I make &lt;code&gt;ESS&lt;/code&gt; know about and use official R environment variables instead of ignoring them?&lt;/p&gt;&#xA;" OwnerUserId="55" LastActivityDate="2020-08-02T21:43:38.297" Title="ESS ignores R_LIBS_USER environment variable" Tags="|ess|r|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19233" PostTypeId="1" CreationDate="2016-01-03T19:19:24.077" Score="12" ViewCount="1146" Body="&lt;p&gt;Following on from &lt;a href=&quot;https://emacs.stackexchange.com/a/3102/2162&quot;&gt;an answer to another question about the new advice system&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In old-style &lt;code&gt;advice.el&lt;/code&gt;, it was possible to manipulate individual members of an advised function's argument list, without making any assertions regarding those members not so manipulated. For example, the following advice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice ansi-term (around prompt-for-name last)&#xA;  (let ((name (read-from-minibuffer &quot;Tag: &quot;)))&#xA;    (and (not (string= name &quot;&quot;))&#xA;         (ad-set-arg 1 (concat &quot;Term: &quot; name)))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;allows the (optional) provision of a buffer-name argument to an &lt;code&gt;ansi-term&lt;/code&gt; call, while &lt;code&gt;ansi-term&lt;/code&gt; will still obtain its first argument by prompting according to its own interactive form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For later reference, &lt;code&gt;ansi-term&lt;/code&gt;'s signature is &lt;code&gt;(PROGRAM &amp;amp;optional BUFFER-NAME)&lt;/code&gt;, and its interactive form prompts for PROGRAM with several possible defaults, but does nothing regarding BUFFER-NAME.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure whether or not this is possible in &lt;code&gt;nadvice.el&lt;/code&gt;. If it is, I'm not certain how it can be done. I've found a couple of ways to &lt;em&gt;replace&lt;/em&gt; an advised function's argument list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, from &lt;strong&gt;*info* (elisp) Advice combinators&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;`:filter-args'&#xA; Call FUNCTION first and use the result (which should be a list) as&#xA; the new arguments to pass to the old function.  More specifically,&#xA; the composition of the two functions behaves like:&#xA;      (lambda (&amp;amp;rest r) (apply OLDFUN (funcall FUNCTION r)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Other combinators provide similar capabilities, and the common thread among them is that, while a function's argument list may be replaced, truncated, extended, et al, there's no apparent way for function advice to modify the argument at a given position in the list &lt;em&gt;without asserting anything about the rest of it&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case under discussion, it appears impossible for the advice author to pass &lt;code&gt;ansi-term&lt;/code&gt; only a buffer name, because it's not possible to construct a list which has a value in position 1 but nothing, not even &lt;code&gt;nil&lt;/code&gt;, in position 0. In the general case, it appears impossible for the advice author to arbitrarily modify arguments beyond position 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems unfortunate in that, in order to produce a similar effect, it's necessary to copy-paste code: specifically, either I can copy &lt;code&gt;ansi-term&lt;/code&gt;'s interactive form and extend it to my taste, or I can copy &lt;code&gt;ansi-term&lt;/code&gt; altogether and extend it likewise. In either case, I now must redefine part of the Emacs Lisp distribution in my init file, which strikes me as undesirable in terms of both durability and aesthetics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question, then, is: Can this sort of argument list mangling be done with &lt;code&gt;nadvice.el&lt;/code&gt;? If so, how?&lt;/p&gt;&#xA;" OwnerUserId="2162" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2023-08-22T20:54:41.450" Title="How to manipulate argument list in nadvice.el?" Tags="|advice|arguments|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19234" PostTypeId="1" AcceptedAnswerId="19260" CreationDate="2016-01-03T19:29:36.403" Score="3" ViewCount="493" Body="&lt;p&gt;I am using Emacs master branch built &lt;code&gt;--with-ns&lt;/code&gt; on a drive that is case &lt;em&gt;insensitive&lt;/em&gt; -- aka &lt;strong&gt;Mac OS Extended (Journaled)&lt;/strong&gt;.  I would like to use &lt;code&gt;dired-do-rename&lt;/code&gt; to change a folder name from upper to lower-case or visa-versa.  Emacs throws a &lt;code&gt;file-error&lt;/code&gt; and does not change the name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Move ‘/Volumes/STORAGE/PROGRAMS/HP_ScanJet_8290’ to ‘/Volumes/STORAGE/PROGRAMS/hp_scanjet_8290/HP_ScanJet_8290’ failed:&#xA;&#xA;(file-error Renaming Invalid argument /Volumes/STORAGE/PROGRAMS/HP_ScanJet_8290 /Volumes/STORAGE/PROGRAMS/hp_scanjet_8290/HP_ScanJet_8290)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am looking for some assistance, please, to redefine one or more of the &lt;code&gt;dired&lt;/code&gt; functions to permit this operation to succeed.  The solution can certainly use &lt;code&gt;advice&lt;/code&gt; (since most of the forum participants seem to prefer that method), however, a new function that replaces one or more existing functions is also acceptable.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  The following is the output from &lt;code&gt;M-x debug-on-entry dired-do-create-files&lt;/code&gt; after evaluating &lt;code&gt;(require 'dired-aux)&lt;/code&gt;, and then trying to rename a folder [from CamelCase to all lower-case] using &lt;code&gt;S-r&lt;/code&gt; in &lt;code&gt;dired-mode&lt;/code&gt; -- aka &lt;code&gt;dired-do-rename&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--entering a function:&#xA;  * dired-do-create-files(move dired-rename-file &quot;Move&quot; nil t &quot;Rename&quot;)&#xA;    dired-do-rename(nil)&#xA;    funcall-interactively(dired-do-rename nil)&#xA;    call-interactively(dired-do-rename nil nil)&#xA;    command-execute(dired-do-rename)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  This appears to be a bug affecting OSX users of Emacs and the appropriate thing to do (as Drew suggested) is file a bug report so that everyone can benefit from the fix -- instead of a fix that is only available on emacs.stackexchange.com.  Here is the link to the report:  &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22300&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22300&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  The bug was summarily dismissed / closed in about 5 minutes flat with the following explanation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Since this is not an Emacs bug, I'm closing this report, but here is what I do&#xA;that should work for you:&#xA;&#xA;  1. Rename the file to 'x'.&#xA;  2. Rename 'x' to the correctly cased name.&#xA;&#xA;Copy the name to the kill-ring before #1, so that you can paste it in when&#xA;asked by #2.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[@lawlist (the original poster)]&lt;/strong&gt;:  The moral of the story is that this question remains open and any help to implement a proper bug fix for OSX users would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-01-03T21:18:44.497" LastActivityDate="2016-01-04T20:07:04.147" Title="dired-do-rename throws file-error when changing upper/lower-case name" Tags="|dired|" AnswerCount="1" CommentCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="19236" PostTypeId="1" AcceptedAnswerId="19238" CreationDate="2016-01-03T20:06:41.180" Score="0" ViewCount="185" Body="&lt;p&gt;I am trying to extend evil-like conventions to comint mode so I can use vim-like key bindings from the shell. I also rebound &lt;code&gt;C-c&lt;/code&gt; to &lt;code&gt;#'evil-normal-state&lt;/code&gt; since that is what I use in vim (it isn't strictly equivalent to &lt;code&gt;C-[&lt;/code&gt; but I haven't run into the weird edge cases where that actually matters yet).&lt;/p&gt;&#xA;&lt;p&gt;I am using the &lt;code&gt;evil-define-key&lt;/code&gt; macro to define &lt;code&gt;comint-mode&lt;/code&gt;-specific bindings in normal state that begin with &lt;code&gt;SPC f&lt;/code&gt; and so far that works great.&lt;/p&gt;&#xA;&lt;p&gt;However, all the mode-specific key bindings beginning with &lt;code&gt;C-c&lt;/code&gt; are still there despite the fact that &lt;code&gt;C-c&lt;/code&gt; is bound to &lt;code&gt;#'evil-normal-state&lt;/code&gt; in every state. I don't want to globally rebind &lt;code&gt;C-c&lt;/code&gt; since that would interfere with emacs state.&lt;/p&gt;&#xA;&lt;p&gt;What is the cleanest way to prevent &lt;code&gt;comint-mode&lt;/code&gt; from defining any additional key bindings at all since evil-mode is effectively managing all the keys?&lt;/p&gt;&#xA;&lt;p&gt;I have tried adding&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setf comint-mode-map (make-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setf comint-mode-map (make-sparse-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to my &lt;code&gt;.emacs&lt;/code&gt; file, but whenever I type &lt;code&gt;M-x shell&lt;/code&gt;, I get the error&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: keymapp, 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="105" LastEditDate="2021-12-19T23:59:31.687" LastActivityDate="2021-12-19T23:59:31.687" Title="Prevent emacs mode from defining keybindings" Tags="|key-bindings|evil|hooks|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="19237" PostTypeId="2" ParentId="19233" CreationDate="2016-01-03T20:08:44.570" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This seems unfortunate in that, in order to produce a similar effect, it's necessary to copy-paste code: [...] I can copy &lt;code&gt;ansi-term&lt;/code&gt;'s interactive form&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On the contrary, I think it would be a good idea to copy-paste the interactive form of the advised function, even though you don't actually have to do so here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read you question from top to bottom. When I got to the code-block I &lt;em&gt;guessed&lt;/em&gt; that your advise &lt;em&gt;probably&lt;/em&gt; is changing the buffer name. But I didn't &lt;em&gt;know&lt;/em&gt; until you later provided the signature as a comment.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In the case under discussion, it appears impossible for the advice author to pass &lt;code&gt;ansi-term&lt;/code&gt; only a buffer name, because it's not possible to construct a list which has a value in position 1 but nothing, not even &lt;code&gt;nil&lt;/code&gt;, in position 0.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed nothing is less nothing than nothing. :-) But that's hardly relevant here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in the documentation you quoted, the value returned by the advice is used as the arguments to the advised function. The return value has to be a list of all arguments not just the ones that have changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Staying as close as possible to the old advise, this is what you would have to do using &lt;code&gt;nadvice&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ansi-term--tag-buffer (args)&#xA;  ;; As npostavs pointed out we also have to make sure the list is&#xA;  ;; two elements long.  Which makes this approach even more undesirable.&#xA;  (when (= (length args) 1)&#xA;    (setq args (nconc args (list nil))))&#xA;  (let ((name (read-from-minibuffer &quot;Tag: &quot;)))&#xA;    (and (not (string= name &quot;&quot;))&#xA;         (setf (nth 1 args) (concat &quot;Term: &quot; name))))&#xA;  args)&#xA;&#xA;(advice-add 'ansi-term :filter-args 'ansi-term--tag-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I recommend you define the advice like this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ansi-term--tag-buffer (program &amp;amp;optional buffer-name)&#xA;  (list program&#xA;        (let ((tag (read-from-minibuffer &quot;Tag: &quot;)))&#xA;          (if (string= tag &quot;&quot;)&#xA;              buffer-name&#xA;            (concat &quot;Term: &quot; tag)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This variant actually is self-explanatory.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-02-14T18:08:29.970" LastActivityDate="2016-02-14T18:08:29.970" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19238" PostTypeId="2" ParentId="19236" CreationDate="2016-01-03T20:16:40.943" Score="1" Body="&lt;p&gt;If that's really what you want to do, do it on &lt;code&gt;comint-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'comint-mode-hook (lambda () (setq comint-mode-map (make-sparse-keymap))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You are probably getting that error because the comint code itself tries to bind keys on the prefix key &lt;code&gt;C-c&lt;/code&gt;, but you have removed that.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-03T20:16:40.943" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19239" PostTypeId="2" ParentId="19230" CreationDate="2016-01-03T21:04:15.207" Score="6" Body="&lt;p&gt;Paste the following into your init files.&#xA;This gives you a new customization option &lt;code&gt;org-hidden-links-additional-re&lt;/code&gt;. You can switch this option off or parameterize it with a regular expression. The strings matching this regular expression in an org-buffer are hidden when &quot;descriptive links&quot; are activated (menu item &lt;strong&gt;Org-&gt;Hyperlinks-&gt;Descriptive Links&lt;/strong&gt;).&#xA;The default is &lt;code&gt;&amp;lt;&amp;lt;[&amp;lt;]?[[:alnum:]]&amp;gt;&amp;gt;[&amp;gt;]?&lt;/code&gt; which hides link targets.&#xA;This variable is buffer local. You can set it in the file-local variables.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-hidden-links-additional-re &quot;&amp;lt;&amp;lt;[&amp;lt;]?[[:alnum:]]+&amp;gt;&amp;gt;[&amp;gt;]?&quot;&#xA;  &quot;Regular expression that matches strings where the invisible-property is set to org-link.&quot;&#xA;  :type '(choice (const :tag &quot;Off&quot; nil) regexp)&#xA;  :group 'org-link)&#xA;(make-variable-buffer-local 'org-hidden-links-additional-re)&#xA;&#xA;(defun org-activate-hidden-links-additional (limit)&#xA;  &quot;Put invisible-property org-link on strings matching `org-hide-links-additional-re'.&quot;&#xA;  (if org-hidden-links-additional-re&#xA;      (re-search-forward org-hidden-links-additional-re limit t)&#xA;    (goto-char limit)&#xA;    nil))&#xA;&#xA;(add-hook 'org-font-lock-set-keywords-hook (lambda ()&#xA;                         (add-to-list 'org-font-lock-extra-keywords&#xA;                              '(org-activate-hidden-links-additional&#xA;                                (0 '(face org-target invisible org-link))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following version addresses the wishes from Kartik Shenoy's first comment, i.e.: Just hide two of the angles at each end of the link text:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-hidden-links-additional-re &quot;\\(&amp;lt;&amp;lt;\\)[[:alnum:]]+\\(&amp;gt;&amp;gt;\\)&quot;&#xA;  &quot;Regular expression that matches strings where the invisible-property of the sub-matches 1 and 2 is set to org-link.&quot;&#xA;  :type '(choice (const :tag &quot;Off&quot; nil) regexp)&#xA;  :group 'org-link)&#xA;(make-variable-buffer-local 'org-hidden-links-additional-re)&#xA;&#xA;(defun org-activate-hidden-links-additional (limit)&#xA;  &quot;Put invisible-property org-link on strings matching `org-hide-links-additional-re'.&quot;&#xA;  (if org-hidden-links-additional-re&#xA;      (re-search-forward org-hidden-links-additional-re limit t)&#xA;    (goto-char limit)&#xA;    nil))&#xA;&#xA;(defun org-hidden-links-hook-function ()&#xA;  &quot;Add rule for `org-activate-hidden-links-additional' to `org-font-lock-extra-keywords'.&#xA;You can include this function in `org-font-lock-set-keywords-hook'.&quot;&#xA;  (add-to-list 'org-font-lock-extra-keywords&#xA;                              '(org-activate-hidden-links-additional&#xA;                                (1 '(face org-target invisible org-link))&#xA;                (2 '(face org-target invisible org-link)))))&#xA;&#xA;(add-hook 'org-font-lock-set-keywords-hook #'org-hidden-links-hook-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2017-03-21T11:39:49.493" LastActivityDate="2017-03-21T11:39:49.493" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19241" PostTypeId="1" AcceptedAnswerId="19347" CreationDate="2016-01-04T01:18:30.897" Score="2" ViewCount="449" Body="&lt;p&gt;I'm on day 2 of my switch from 15 years of Vim to Evil Emacs -- so I'm just starting learning how to customize emacs and how to read elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to use &lt;code&gt;helm-projectile-find-file&lt;/code&gt; with &lt;code&gt;elscreen-find-file&lt;/code&gt;  That is, I want search for a file in my project and open up in a new window/tab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried creating my own version of &lt;code&gt;elscreen-find-file&lt;/code&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun elscreen-find-file (filename)&#xA;  &quot;Edit file FILENAME.&#xA;Switch to a screen visiting file FILENAME,&#xA;creating one if none already exists.&quot;&#xA;  (interactive &quot;FFind file in new screen: &quot;)&#xA;  (elscreen-find-and-goto-by-buffer (helm-projectile-find-file filename) 'create))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's not activating the helm-projectile-find-file functionality. I'm curious to learn the &lt;em&gt;best&lt;/em&gt; way to accomplish this task. Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think by answering just #2 I can extrapolate a solution for #1.  I'd like to &lt;code&gt;helm-projectile-find-file&lt;/code&gt; and split the result in a new vertical window&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Follow-up&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it might have been a simpler solution to just open up a blank tab, switch to it, and then run helm-projectile&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did something similar trying to replicate Vim's vsplit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun vsplit ()&#xA;    (interactive)&#xA;    (progn&#xA;      (split-window-right)&#xA;      (other-window 1)&#xA;      (helm-projectile)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10654" LastEditorUserId="10654" LastEditDate="2016-01-14T13:51:39.977" LastActivityDate="2016-01-14T13:51:39.977" Title="helm-projectile with elscreen" Tags="|helm|projectile|elscreen|helm-projectile|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19242" PostTypeId="2" ParentId="19215" CreationDate="2016-01-04T03:46:01.977" Score="14" Body="&lt;p&gt;I had to solve a very similar problem in &lt;code&gt;nadvice.el&lt;/code&gt;, so here is a solution (which uses some of the code from nadvice.el):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wrapper (&amp;amp;rest args)&#xA;  (interactive (advice-eval-interactive-spec&#xA;                (cadr (interactive-form #'wrappee))))&#xA;  (apply #'wrappee args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Compared to the other solutions posted so far, this one has the advantage of working correctly if &lt;code&gt;wrappee&lt;/code&gt; gets redefined with a different interactive spec (i.e. it won't keep using the old spec).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if you want your wrapper to be truly transparent, you can do it more simply:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'wrapper #'wrappee)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-04T03:46:01.977" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19243" PostTypeId="2" ParentId="19211" CreationDate="2016-01-04T03:55:49.867" Score="4" Body="&lt;p&gt;I agree with PythonNut that the best solution is probably not to use advice at all, but to define a new command &lt;code&gt;my-find-file&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, if you find that advising &lt;code&gt;find-file&lt;/code&gt; is a better option (e.g. because you also want to affect pre-exisitng calls to &lt;code&gt;find-file&lt;/code&gt;), you might like to do it as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode my-find-file-mode&#xA;  &quot;Tweak `find-file' the way I like it.&quot;&#xA;  :global t :init-value t)&#xA;&#xA;(defun my-find-file-advice (orig &amp;amp;rest args)&#xA;  (if (not my-find-file-mode)&#xA;      (apply orig args)&#xA;    ..do the advice thing here..))&#xA;(advice-add 'find-file :around #'my-find-file-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After which you can enable/disable your advice via &lt;code&gt;M-x my-find-file-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-04T03:55:49.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19244" PostTypeId="2" ParentId="17760" CreationDate="2016-01-04T04:07:14.960" Score="4" Body="&lt;p&gt;I think the answer is that you're looking at the wrong place: try to solve the more general problem where the user installs your package maybe by hand, or via some other package system, or via ELPA but in a 100% automated way (so he won't see any message that may show up at that point).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW do it with code within your package, which tries to recognize the problematic situation and emit a warning/error accordingly at that time (i.e. at the time the package is used, rather than when it's installed or compiled).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-04T04:07:14.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19245" PostTypeId="2" ParentId="9819" CreationDate="2016-01-04T04:22:22.540" Score="5" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/jwiegley/use-package&quot;&gt;newer version&lt;/a&gt; of &lt;code&gt;use-package&lt;/code&gt; has the following to enable this behavior for all packages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq use-package-always-ensure t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just in case anyone else had the same question.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-01-04T04:22:22.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19246" PostTypeId="1" CreationDate="2016-01-04T04:38:43.947" Score="1" ViewCount="268" Body="&lt;p&gt;Following &lt;a href=&quot;https://emacs.stackexchange.com/q/18771/10269&quot;&gt;this question&lt;/a&gt; about automatically displaying documentation in a pop-up window, I decided to give it a try based on existing work on &lt;a href=&quot;http://blog.jenkster.com/2013/12/popup-help-in-emacs-lisp.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Popup Help in Emacs Lisp&lt;/a&gt; and &lt;a href=&quot;https://github.com/Fuco1/clippy.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;clippy&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I've run into an issue whereby &lt;code&gt;help-xref-interned&lt;/code&gt; doesn't play nice with &lt;code&gt;popwin&lt;/code&gt;. When I try to create a temp buffer for &lt;code&gt;help-xref-interned&lt;/code&gt;, there is a brief flash as &lt;code&gt;popwin&lt;/code&gt; brings the window up, then quickly dismisses it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, it seems necessary to disable &lt;code&gt;popwin&lt;/code&gt; temporarily, then restore it to its original state. I'm wondering what the idiomatic way to do this is. What I have is below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun *-describe-symbol-popup ()&#xA;  &quot;Display full documentation of symbol in a pop-up window.&quot;&#xA;  (interactive)&#xA;  (let ((doc (*-symbol-full-doc (symbol-at-point)))&#xA;        (x-gtk-use-system-tooltips nil))&#xA;    (if (string-empty-p doc)&#xA;        (message &quot;Unknown symbol, or no documentation available.&quot;)&#xA;      (pos-tip-show doc 'tooltip nil nil -1))))&#xA;&#xA;(defmacro *-symbol-full-doc (symbol)&#xA;  &quot;Return a string of the full documentation of SYMBOL, as given by&#xA;`help-xref-interned'.&#xA;&#xA;If `popwin-mode' is active, disable it temporarily. The value of&#xA;`popwin-mode' is thus always nil, even when the mode is active.'&quot;&#xA;  (let* ((sym (make-symbol &quot; sym &quot;))&#xA;         (form `(let ((,sym ,symbol))&#xA;                  (with-temp-buffer&#xA;                    (let ((help-xref-following t))&#xA;                      (help-mode)&#xA;                      (help-xref-interned ,sym)&#xA;                      (buffer-string))))))&#xA;    (if (fboundp #'popwin-mode)&#xA;        `(let ((old-popwin popwin-mode))&#xA;           (popwin-mode -1)&#xA;           (unwind-protect&#xA;               ,form&#xA;             (popwin-mode (or old-popwin -1))))&#xA;      ,form)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I make this more idiomatic/less verbose?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-01-04T04:38:43.947" Title="Disable popwin temporarily with pop-up documentation" Tags="|documentation|popup|" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19247" PostTypeId="1" CreationDate="2016-01-04T04:53:06.150" Score="2" ViewCount="278" Body="&lt;p&gt;I recently started using emacs to code in Python. I currently prefer to use python mode (defined in python.el) alongside ansi-term for the python interactive shell. I'm trying to change the behavior of C-c C-c in python mode so it sends the buffer into ansi-term to be executed. That is, I'd like it to act as if I wrote 'execfile([current .py file i'm working on])' in the ansi-term.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this? If not specifically through C-c C-c, with some other shortcut/method?&lt;/p&gt;&#xA;" OwnerUserId="10657" LastActivityDate="2016-01-04T04:53:06.150" Title="Send Python Buffer to ansi-term" Tags="|python|shell|ansi-term|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19248" PostTypeId="2" ParentId="19228" CreationDate="2016-01-04T08:17:50.613" Score="3" Body="&lt;p&gt;You should use the command &lt;code&gt;toggle-truncate-lines&lt;/code&gt; rather than changing directly the value of variable&lt;code&gt;truncate-lines&lt;/code&gt;.  This command does ensure the display is updated (apparently through &lt;code&gt;force-mode-line-update&lt;/code&gt; although nor its name neither its docstring does suggest that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is described in emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Line-Truncation.html#Line-Truncation&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; but unfortunately not mentionned in &lt;code&gt;truncate-lines&lt;/code&gt; docstring nor in the section about truncation of elisp &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Truncation.html#Truncation&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-01-04T08:17:50.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19249" PostTypeId="1" AcceptedAnswerId="19263" CreationDate="2016-01-04T08:39:36.330" Score="1" ViewCount="481" Body="&lt;p&gt;Inexperienced programmer here - When I open Emacs (24.5) on Mac Mavericks 10.9, I am getting a delay between the Emacs GUI opening and the init file being loaded. There is a white screen, which appears to do nothing for ~7 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could this be a result of something in my &lt;code&gt;init&lt;/code&gt; file (which otherwise loads &lt;em&gt;without error&lt;/em&gt;), or must it originate from something in my &lt;code&gt;PATH&lt;/code&gt; or &lt;code&gt;.bash_profile&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an &lt;em&gt;alias&lt;/em&gt; set to open emacs from the Terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias=&quot;open /Path/To/Emacs-x86_64-10_9&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any other ideas what this might be our how I can debug the pause?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the output of &lt;code&gt;etc/hosts&lt;/code&gt;, @phils having pointed out it may be the cause.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;##&#xA;# Host Database&#xA;#&#xA;# localhost is used to configure the loopback interface&#xA;# when the system is booting.  Do not change this entry.&#xA;##&#xA;#127.0.0.1      localhost&#xA;255.255.255.255 broadcasthost&#xA;::1             localhost&#xA;fe80::1%lo0     localhost&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="9558" LastEditDate="2016-01-04T08:57:36.300" LastActivityDate="2016-01-04T20:14:41.520" Title="Long pause during Emacs startup, prior to init file running" Tags="|start-up|term|" AnswerCount="1" CommentCount="10" ClosedDate="2016-01-05T21:07:11.327" ContentLicense="CC BY-SA 3.0" />
  <row Id="19250" PostTypeId="2" ParentId="19158" CreationDate="2016-01-04T09:21:25.637" Score="3" Body="&lt;p&gt;Your configuration works for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can force the engine like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'web-mode-hook (lambda ()&#xA; (web-mode-set-engine &quot;django&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-01-04T09:21:25.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19251" PostTypeId="1" CreationDate="2016-01-04T14:02:44.537" Score="2" ViewCount="289" Body="&lt;p&gt;I'm new to emacs/LISP and would like guidance how to achieve the following output&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to type&#xA;&quot;color glass hat sport&quot; in a single string ($1) that will be converted to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Color = &quot;C&quot;&#xA;Glass = &quot;G&quot;&#xA;Hat   = &quot;H&quot;&#xA;Sport = &quot;S&quot;&#xA;&#xA;_CATEGORIES = (&#xA;    (Color, 'Colors'), (Glass, 'Glasses'), (Hat, 'Hats'), (Sport, 'Sports'),&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to achieve that with YAS Snippets?&lt;/p&gt;&#xA;" OwnerUserId="10547" LastEditorUserId="105" LastEditDate="2016-03-14T17:17:15.947" LastActivityDate="2016-03-14T17:17:15.947" Title="Iterate over string in YAS Snippet?" Tags="|yasnippet|text-editing|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19252" PostTypeId="1" CreationDate="2016-01-04T15:53:43.123" Score="4" ViewCount="576" Body="&lt;p&gt;In list environment, after I copy several paragraphs, the next  item number will change into number 1, How can I&#xA;deal with that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. aaa&#xA;2. aaa&#xA;3. aaa&#xA;bbb    &amp;lt;---this is what I copied&#xA;ccc&#xA;1. aaa &amp;lt;---I want it becomes 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="9923" LastEditDate="2016-01-04T16:31:45.890" LastActivityDate="2016-01-27T08:30:37.060" Title="How can I paste paragraph not to interrupt numbers in list org mode?" Tags="|org-mode|list|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19253" PostTypeId="1" CreationDate="2016-01-04T17:19:01.253" Score="2" ViewCount="445" Body="&lt;p&gt;Very often I want to commit a change in magit and push it straight after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the default magit keybindings, I have to press &lt;code&gt;C-c C-c P u&lt;/code&gt;. How can I do this in a single command/keystroke?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-01-06T13:11:36.490" Title="How can I commit and push in one command from Emacs?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19254" PostTypeId="1" AcceptedAnswerId="19256" CreationDate="2016-01-04T17:26:27.243" Score="12" ViewCount="1477" Body="&lt;p&gt;If I ever close the &lt;code&gt;*scratch*&lt;/code&gt; buffer it is always an accident.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;persistent-scratch&lt;/code&gt; so it's as easy as a &lt;code&gt;persistent-scratch-reload&lt;/code&gt; but it'd be nice if the scratch couldn't be killed. How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2016-01-28T05:49:08.587" Title="never close scratch" Tags="|scratch-buffer|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19255" PostTypeId="1" AcceptedAnswerId="19267" CreationDate="2016-01-04T17:41:27.127" Score="2" ViewCount="477" Body="&lt;p&gt;Some of my modes use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Overlays.html&quot; rel=&quot;nofollow&quot;&gt;overlays&lt;/a&gt; for contextual information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have a face that I'd like to always be shown despite any overlays on top of it. Is there any way to have such a &quot;super face&quot;?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2016-01-05T00:03:04.457" Title="face vs overlays, can face ever win?" Tags="|faces|overlays|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19256" PostTypeId="2" ParentId="19254" CreationDate="2016-01-04T17:44:38.290" Score="17" Body="&lt;p&gt;You can (ab-)use &lt;code&gt;kill-buffer-query-functions&lt;/code&gt; for this purpose:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'kill-buffer-query-functions #'my/dont-kill-scratch)&#xA;(defun my/dont-kill-scratch ()&#xA;  (if (not (equal (buffer-name) &quot;*scratch*&quot;))&#xA;      t&#xA;    (message &quot;Not allowed to kill %s, burying instead&quot; (buffer-name))&#xA;    (bury-buffer)&#xA;    nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my old Emacs configuration I used this to protect a bunch of important buffer like &lt;code&gt;*Messages*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that my function uses &lt;code&gt;bury-buffer&lt;/code&gt; to achieve the effect of killing a buffer—doing the buffer away—without actually killing the buffer.  Emacs will switch to a different buffer just as if you had killed scratch, but keep scratch alive and just put it at the end of the buffer list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, simply&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'kill-buffer-query-functions&#xA;          (lambda() (not (equal (buffer-name) &quot;*scratch*&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="5142" LastEditDate="2016-01-04T22:28:49.757" LastActivityDate="2016-01-04T22:28:49.757" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="19257" PostTypeId="2" ParentId="19255" CreationDate="2016-01-04T18:00:14.130" Score="2" Body="&lt;p&gt;I don't think so.  That'd defeat the purpose of overlays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you must also use an overlay, with a high priority to make sure that it appears on top of everything else.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-01-04T18:00:14.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19258" PostTypeId="2" ParentId="19253" CreationDate="2016-01-04T18:20:51.483" Score="1" Body="&lt;p&gt;This should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'git-commit-setup-hook&#xA;          (lambda ()&#xA;            (add-hook 'with-editor-post-finish-hook&#xA;                      (lambda ()&#xA;                        (call-interactively #'magit-push-current-to-upstream))&#xA;                      t t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I think you should neither push to the upstream nor push right after committing. You should (usually) push to the push-remote instead and you should give yourself a change to notice a mistake before you have to choose between force-pushing or adding a new commit to undo the mistake. But that's just me, if you want to push right away, then by all means do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code above arranges for the push to &lt;em&gt;always&lt;/em&gt; happen right after committing. You'll have to make adjustments if you only want it to happen &quot;very often&quot;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-01-06T11:40:34.910" LastActivityDate="2016-01-06T11:40:34.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19259" PostTypeId="1" AcceptedAnswerId="19261" CreationDate="2016-01-04T19:01:36.390" Score="6" ViewCount="8592" Body="&lt;p&gt;I would like to use a specific linter for python files in spacemacs. A coworker sent me an emacs code-snippet that should solve my problem, but doesn't seem to be loaded.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode '(lambda ()&#xA;                           (semantic-mode 1)&#xA;                           (setq flycheck-checker 'python-pylint&#xA;                                 flycheck-pylintrc &quot;~/.pylintrc&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know it isn't loaded because when I load a (very poorly written file) it has the following error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (flycheck): Syntax checker python-flake8 reported too many errors (826) and is disabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am trying to use pylint with our specific lintrc file to get around this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &lt;code&gt;C-h v flycheck-checker&lt;/code&gt; says the value is nil. Also, it doesn't seem like I can set that variable at all interactively (with &lt;code&gt;M-x set-variable&lt;/code&gt;)&#xA;&lt;strong&gt;Edit2:&lt;/strong&gt; I can't seem to even disable flycheck, so if anyone knows how to do that, it would be great.&lt;/p&gt;&#xA;" OwnerUserId="10662" LastEditorDisplayName="user227" LastEditDate="2016-01-04T22:00:21.863" LastActivityDate="2016-05-05T09:33:19.437" Title="spacemacs flycheck: use specific linter for python" Tags="|python|spacemacs|flycheck|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19260" PostTypeId="2" ParentId="19234" CreationDate="2016-01-04T19:30:00.390" Score="1" Body="&lt;p&gt;Although the bug report is being handled by the Emacs team -- &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22300&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22300&lt;/a&gt; -- I am using the following workaround in the interim, which basically bypasses &lt;code&gt;dired-create-files&lt;/code&gt; if the situation is as described in the original question above.  The workaround also reverts the buffer after the file has been renamed, instead of the fancy cut/paste of just the affected line that &lt;code&gt;dired-mode&lt;/code&gt; normally does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[The workaround was inspired by the helpful comment of @wvxvw underneath the original question -- i.e., using &lt;code&gt;mv&lt;/code&gt; to rename the file.]&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired-aux)&#xA;&#xA;(require 'cl) ;; for `lexical-let*' to penetrate the `set-process-sentinel'.&#xA;&#xA;(defun dired-do-create-files (op-symbol file-creator operation arg&#xA;                    &amp;amp;optional marker-char op1&#xA;                    how-to)&#xA;  &quot;Create a new file for each marked file.&#xA;Prompt user for a target directory in which to create the new&#xA;  files.  The target may also be a non-directory file, if only&#xA;  one file is marked.  The initial suggestion for target is the&#xA;  Dired buffer's current directory (or, if `dired-dwim-target' is&#xA;  non-nil, the current directory of a neighboring Dired window).&#xA;OP-SYMBOL is the symbol for the operation.  Function `dired-mark-pop-up'&#xA;  will determine whether pop-ups are appropriate for this OP-SYMBOL.&#xA;FILE-CREATOR and OPERATION as in `dired-create-files'.&#xA;ARG as in `dired-get-marked-files'.&#xA;Optional arg MARKER-CHAR as in `dired-create-files'.&#xA;Optional arg OP1 is an alternate form for OPERATION if there is&#xA;  only one file.&#xA;Optional arg HOW-TO determines how to treat the target.&#xA;  If HOW-TO is nil, use `file-directory-p' to determine if the&#xA;   target is a directory.  If so, the marked file(s) are created&#xA;   inside that directory.  Otherwise, the target is a plain file;&#xA;   an error is raised unless there is exactly one marked file.&#xA;  If HOW-TO is t, target is always treated as a plain file.&#xA;  Otherwise, HOW-TO should be a function of one argument, TARGET.&#xA;   If its return value is nil, TARGET is regarded as a plain file.&#xA;   If it return value is a list, TARGET is a generalized&#xA;    directory (e.g. some sort of archive).  The first element of&#xA;    this list must be a function with at least four arguments:&#xA;      operation - as OPERATION above.&#xA;      rfn-list  - list of the relative names for the marked files.&#xA;      fn-list   - list of the absolute names for the marked files.&#xA;      target    - the name of the target itself.&#xA;      The rest of into-dir are optional arguments.&#xA;   For any other return value, TARGET is treated as a directory.&quot;&#xA;  (or op1 (setq op1 operation))&#xA;  (let* ((fn-list (dired-get-marked-files nil arg))&#xA;     (rfn-list (mapcar (function dired-make-relative) fn-list))&#xA;     (dired-one-file    ; fluid variable inside dired-create-files&#xA;      (and (consp fn-list) (null (cdr fn-list)) (car fn-list)))&#xA;     (target-dir (dired-dwim-target-directory))&#xA;     (default (and dired-one-file&#xA;               (expand-file-name (file-name-nondirectory (car fn-list))&#xA;                     target-dir)))&#xA;     (defaults (dired-dwim-target-defaults fn-list target-dir))&#xA;     (target (expand-file-name ; fluid variable inside dired-create-files&#xA;          (minibuffer-with-setup-hook&#xA;              (lambda ()&#xA;            (set (make-local-variable 'minibuffer-default-add-function) nil)&#xA;            (setq minibuffer-default defaults))&#xA;            (dired-mark-read-file-name&#xA;             (concat (if dired-one-file op1 operation) &quot; %s to: &quot;)&#xA;             target-dir op-symbol arg rfn-list default))))&#xA;     (into-dir (cond ((null how-to)&#xA;              ;; Allow DOS/Windows users to change the letter&#xA;              ;; case of a directory.  If we don't test these&#xA;              ;; conditions up front, file-directory-p below&#xA;              ;; will return t because the filesystem is&#xA;              ;; case-insensitive, and Emacs will try to move&#xA;              ;; foo -&amp;gt; foo/foo, which fails.&#xA;              (if (and (memq system-type '(ms-dos windows-nt cygwin))&#xA;                   (eq op-symbol 'move)&#xA;                   dired-one-file&#xA;                   (string= (downcase&#xA;                         (expand-file-name (car fn-list)))&#xA;                        (downcase&#xA;                         (expand-file-name target)))&#xA;                   (not (string=&#xA;                     (file-name-nondirectory (car fn-list))&#xA;                     (file-name-nondirectory target))))&#xA;                  nil&#xA;                (file-directory-p target)))&#xA;             ((eq how-to t) nil)&#xA;             (t (funcall how-to target)))))&#xA;    (if (and (consp into-dir) (functionp (car into-dir)))&#xA;    (apply (car into-dir) operation rfn-list fn-list target (cdr into-dir))&#xA;      (if (not (or dired-one-file into-dir))&#xA;      (error &quot;Marked %s: target must be a directory: %s&quot; operation target))&#xA;      ;; rename-file bombs when moving directories unless we do this:&#xA;      (or into-dir (setq target (directory-file-name target)))&#xA;;;; BEGIN modification by @lawlist&#xA;      (if&#xA;          (and&#xA;            (eq system-type 'darwin)&#xA;            dired-one-file&#xA;            (equal op1 &quot;Rename&quot;)&#xA;            (equal operation &quot;Move&quot;)&#xA;            (equal (downcase (expand-file-name dired-one-file)) (downcase (expand-file-name target))))&#xA;        ;; Penetrate the `set-process-sentinel' with `lexical-let'.&#xA;        (lexical-let* ((dired-one-file dired-one-file)&#xA;                       (target target))&#xA;          (set-process-sentinel&#xA;            (start-process &quot;rename&quot; nil &quot;mv&quot; dired-one-file target)&#xA;            (lambda (p e) (when (= 0 (process-exit-status p))&#xA;              (revert-buffer)&#xA;              (message &quot;Renamed %s to %s&quot; dired-one-file target)))))&#xA;      (dired-create-files&#xA;       file-creator operation fn-list&#xA;       (if into-dir         ; target is a directory&#xA;       ;; This function uses fluid variable target when called&#xA;       ;; inside dired-create-files:&#xA;       (function&#xA;        (lambda (from)&#xA;          (expand-file-name (file-name-nondirectory from) target)))&#xA;     (function (lambda (_from) target)))&#xA;       marker-char))&#xA;;;; END modification by @lawlist&#xA;  )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-01-04T20:07:04.147" LastActivityDate="2016-01-04T20:07:04.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19261" PostTypeId="2" ParentId="19259" CreationDate="2016-01-04T19:46:29.483" Score="8" Body="&lt;p&gt;Replace your relevant configuration with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook (lambda ()&#xA;                               (flycheck-mode 1)&#xA;                               (semantic-mode 1)&#xA;                               (setq flycheck-checker 'python-pylint&#xA;                                     flycheck-checker-error-threshold 900&#xA;                                     flycheck-pylintrc &quot;~/.pylintrc&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The specific error you mention was being caused because your file has a lot of errors, and by default the variable &lt;code&gt;flycheck-checker-error-threshold&lt;/code&gt; is set to &lt;code&gt;400&lt;/code&gt; (while your file seems to contain &lt;code&gt;826&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By setting this really high, you will avoid this error, but I assume you will get a very slow buffer. With files like this it might be better to not use &lt;code&gt;flycheck&lt;/code&gt; and instead use something that doesn't do its checking in real time (I use the line &lt;code&gt;(setq python-check-command &quot;flake8&quot;)&lt;/code&gt; in my configuration and syntax is checked each time the file is saved. I don't use &lt;code&gt;pylint&lt;/code&gt; but &lt;code&gt;(setq python-check-command &quot;pylint&quot;)&lt;/code&gt; should work too, as long as you have &lt;code&gt;pylint&lt;/code&gt; installed, and should use the same &lt;code&gt;.pylintrc&lt;/code&gt; (in fact, you can try the example above without setting &lt;code&gt;flycheck-pylintrc&lt;/code&gt;, because I think emacs will look for this file in your home folder by default). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This configuration snippet will also enable &lt;code&gt;flycheck-mode&lt;/code&gt; by default so remove the line &lt;code&gt;(flycheck-mode 1)&lt;/code&gt; if you don't want this. At any rate, you can run &lt;code&gt;M-x flycheck-mode&lt;/code&gt; &lt;strong&gt;to toggle this mode on and off&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, when you are using &lt;code&gt;add-hook&lt;/code&gt; make sure the next argument is a mode hook, not the mode itself (e.g., &lt;code&gt;'python-mode-hook&lt;/code&gt; not &lt;code&gt;'python-mode&lt;/code&gt;) Happy configuring!&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Also, note that I have removed the &lt;code&gt;'&lt;/code&gt; before the &lt;code&gt;lambda&lt;/code&gt; from the OP's original configuration snippet. As pointed out in the comments by &lt;strong&gt;@lunaryorn&lt;/strong&gt;, &lt;code&gt;lambda&lt;/code&gt;'s are &quot;self-quoting&quot; and so the quote is at best redundant, and at worst...well, I will direct you to these posts that seem useful on the subject (I will be reading up on this topic myself):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/20948567/3642398&quot;&gt;https://stackoverflow.com/a/20948567/3642398&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/QuotedLambda&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emacswiki.org/emacs/QuotedLambda&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you were using the snippet pre-edit (i.e., &lt;em&gt;with&lt;/em&gt; the quote), have no fear: it will still work as expected without it.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-01-04T22:16:57.940" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19262" PostTypeId="2" ParentId="14537" CreationDate="2016-01-04T20:04:33.427" Score="0" Body="&lt;p&gt;Another attempt. (A variant of &lt;a href=&quot;https://emacs.stackexchange.com/a/14552/2642&quot;&gt;yuutayamada's answer&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key key-translation-map &quot;\033[M'X1-&quot; (kbd &quot;&amp;lt;wheel-up&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-03-30T08:40:35.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19263" PostTypeId="2" ParentId="19249" CreationDate="2016-01-04T20:14:41.520" Score="3" Body="&lt;p&gt;A bit of added information for your init file processing time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this at the very start of your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-init-load-start (current-time))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this at the very end:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Display the time taken to start Emacs.&#xA;(let ((my-init-time (time-to-seconds (time-since my-init-load-start))))&#xA;  (add-hook 'after-init-hook&#xA;            `(lambda ()&#xA;               (message &quot;Init time was %.2fs (%.2fs in %s).&quot;&#xA;                        (time-to-seconds (time-since before-init-time))&#xA;                        ,my-init-time&#xA;                        (file-name-nondirectory user-init-file)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After starting Emacs, look for that timing message in the echo area, or else switch to the &lt;code&gt;*Messages*&lt;/code&gt; buffer with &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;e&lt;/kbd&gt; to find it in the log.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-01-04T20:14:41.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19264" PostTypeId="1" AcceptedAnswerId="19265" CreationDate="2016-01-04T21:09:45.213" Score="4" ViewCount="114" Body="&lt;p&gt;When choosing a project using &lt;code&gt;helm-projectile-switch-project&lt;/code&gt; one can type C-d to run dired on that project root directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;describe-key&lt;/code&gt; on &lt;code&gt;C-d&lt;/code&gt; returns the following function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#[nil &quot;\300\301!\207&quot; [helm-exit-and-execute-action dired]&#xA;2 nil nil]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any pointers on where I can read about on how to make sense of this notation? This looks like a &quot;printed notation&quot;, yet I'm unable to find it in the docs.&lt;/p&gt;&#xA;" OwnerUserId="10263" LastActivityDate="2016-01-04T21:15:18.830" Title="Emacs hashtag bracket(#[]) notation" Tags="|projectile|helm-projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19265" PostTypeId="2" ParentId="19264" CreationDate="2016-01-04T21:15:18.830" Score="4" Body="&lt;p&gt;This is the printed notation of compiled emacs lisp byte-code, you can read more about it &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Byte-Compilation.html#Byte-Compilation&quot;&gt;in the manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://nullprogram.com/blog/2014/01/04/&quot;&gt;This post will probably be more helpful&lt;/a&gt; with understanding what is represented in the vectors you see.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-01-04T21:15:18.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19266" PostTypeId="1" CreationDate="2016-01-04T21:54:53.183" Score="4" ViewCount="227" Body="&lt;p&gt;I am trying to use Gnus for sending and receiving gpg signed/encrypted emails. I am following these tutorials for the setup etc.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/kensanata/ggg&quot; rel=&quot;nofollow&quot;&gt;https://github.com/kensanata/ggg&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;By the way, I am using this Emacs setup as well:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/purcell/emacs.d&quot; rel=&quot;nofollow&quot;&gt;https://github.com/purcell/emacs.d&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, &lt;strong&gt;signed/encrypted emails are not verified/decrypted automatically when I open them&lt;/strong&gt;, and I cannot figure out how to setup this.&#xA;I beleive that this manual page contains some clues, but still I don't see how to include them in the setup:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Security.html#Security&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/gnus/Security.html#Security&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10664" LastEditorUserId="10664" LastEditDate="2016-01-06T16:40:56.327" LastActivityDate="2016-01-06T16:40:56.327" Title="Automatic gpg signature verification and decryption with gnus" Tags="|gnus|gpg|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19267" PostTypeId="2" ParentId="19255" CreationDate="2016-01-05T00:03:04.457" Score="2" Body="&lt;p&gt;If you want a whitespace warning face to win, then &lt;em&gt;use an overlay&lt;/em&gt; for that face, and give it a &lt;em&gt;higher &lt;strong&gt;&lt;code&gt;priority&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt; value than the overlay you want to shadow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use library &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Highlight&lt;/strong&gt;&lt;/a&gt; to do this. It lets you highlight using text properties or overlays (or both).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-05T00:03:04.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19268" PostTypeId="1" AcceptedAnswerId="21665" CreationDate="2016-01-05T03:52:54.813" Score="4" ViewCount="330" Body="&lt;p&gt;Sometimes, though seemingly not in a consistent way, some modes that use version control information do not get updated correctly after &lt;code&gt;git&lt;/code&gt; commands are run (e.g.,&lt;code&gt;diff-hl-mode&lt;/code&gt; or &lt;code&gt;git-gutter-mode&lt;/code&gt; indicate uncommitted changes though those changes have already been committed, or &lt;code&gt;vc-mode-line&lt;/code&gt; will show the name of a branch that I am no longer on). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to be different behaviors that trigger it, but two cases where I made note of what I did to trigger the behavior are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Doing a &lt;code&gt;git rebase&lt;/code&gt; from a terminal outside of emacs&lt;/li&gt;&#xA;&lt;li&gt;Creating and checking out a new branch through the &lt;code&gt;magit&lt;/code&gt; interface.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When this happens, it seems like &lt;code&gt;magit&lt;/code&gt; is always up to speed and displays the correct information, as does &lt;code&gt;git status&lt;/code&gt; from the command line of course. However, the mode-line and sometimes other packages like &lt;code&gt;diff-hl-mode&lt;/code&gt; are one branch change or one commit behind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this is enough information to give someone some idea as to what could be going on. What I would like to know specifically is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;What is causing this behavior?&lt;/strong&gt; The symptoms as described here may be too vague at the moment, but I will try to add more details as I have them. My guess is that either a mode is not updating correctly when vc information changes, or a mode that is changing vc information is not letting other modes know in the right way - but I could be way off. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;When this happens, how can I refresh version control information so that various modes that use the information will displays correctly?&lt;/strong&gt; Restarting emacs has always worked, but it would be nice to not have to resort to that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-04-17T11:07:31.157" Title="Version control information out of sync with certain modes" Tags="|magit|mode-line|git|version-control|vc-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19269" PostTypeId="1" AcceptedAnswerId="19408" CreationDate="2016-01-05T04:14:15.703" Score="2" ViewCount="2598" Body="&lt;p&gt;Is it possible to rebind the &lt;kbd&gt;Capslock&lt;/kbd&gt; key to something else?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose we want to invoke the &lt;kbd&gt;Control-x&lt;/kbd&gt; commands by using &lt;kbd&gt;CapsLock&lt;/kbd&gt;; so instead of pressing &lt;kbd&gt;Control-x&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;, one can type &lt;kbd&gt;Capslock&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6924" LastEditorUserId="6924" LastEditDate="2016-01-10T10:52:34.150" LastActivityDate="2016-01-10T10:52:34.150" Title="Rebind CapsLock to a different key?" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19271" PostTypeId="2" ParentId="2797" CreationDate="2016-01-05T11:17:56.680" Score="28" Body="&lt;p&gt;By default, Emacs only autoload the packages after processing the init file. So when it was trying to set theme, the theme package wasn't loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than making all packages load in your init file (like what you seem to be doing), you can also load the them after package autoloading by adding a hook to &lt;code&gt;after-init-hook&lt;/code&gt;, since packages are autoloaded just after the init file and before &lt;code&gt;after-init-hook&lt;/code&gt;. Note that it will not work if you try to &lt;code&gt;load-theme&lt;/code&gt; directly in the init file because the package hasn't been loaded at that point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So alternatively, add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook (lambda () (load-theme 'solarized-light)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10671" LastActivityDate="2016-01-05T11:17:56.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19272" PostTypeId="2" ParentId="3458" CreationDate="2016-01-05T11:19:18.957" Score="4" Body="&lt;p&gt;Some good answers here, I also am a fan of WinMove, but I bind it to C- because org-mode uses M- for manipulating headings&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;C-&amp;lt;up&amp;gt;&quot;) 'windmove-up)&#xA;(define-key global-map (kbd &quot;C-&amp;lt;down&amp;gt;&quot;) 'windmove-down)&#xA;(define-key global-map (kbd &quot;C-&amp;lt;left&amp;gt;&quot;) 'windmove-left)&#xA;(define-key global-map (kbd &quot;C-&amp;lt;right&amp;gt;&quot;) 'windmove-right)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where it gets really good is if you combine it with &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow&quot;&gt;Hydra&lt;/a&gt;. Following the &lt;a href=&quot;https://github.com/abo-abo/hydra/wiki/Window-Management&quot; rel=&quot;nofollow&quot;&gt;examples on their wiki&lt;/a&gt; I created my own monster:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defhydra hydra-windows ()&#xA;  &quot;C-arrow = switch, S-arrow = size, M-arrow = move&quot;&#xA;  (&quot;C-&amp;lt;left&amp;gt;&quot; windmove-left nil)&#xA;  (&quot;C-&amp;lt;right&amp;gt;&quot; windmove-right nil)&#xA;  (&quot;C-&amp;lt;up&amp;gt;&quot; windmove-up nil)&#xA;  (&quot;C-&amp;lt;down&amp;gt;&quot; windmove-down nil)&#xA;  (&quot;S-&amp;lt;left&amp;gt;&quot; hydra-move-splitter-left nil)&#xA;  (&quot;S-&amp;lt;right&amp;gt;&quot; hydra-move-splitter-right  nil)&#xA;  (&quot;S-&amp;lt;up&amp;gt;&quot; hydra-move-splitter-up nil)&#xA;  (&quot;S-&amp;lt;down&amp;gt;&quot; hydra-move-splitter-down nil)&#xA;  (&quot;M-&amp;lt;left&amp;gt;&quot; buf-move-left nil)&#xA;  (&quot;M-&amp;lt;right&amp;gt;&quot; buf-move-right nil)&#xA;  (&quot;M-&amp;lt;up&amp;gt;&quot; buf-move-up nil)&#xA;  (&quot;M-&amp;lt;down&amp;gt;&quot; buf-move-down nil)&#xA;  (&quot;p&quot; previous-buffer &quot;prev-buf&quot;)&#xA;  (&quot;n&quot; next-buffer &quot;next-buf&quot;)&#xA;  (&quot;1&quot; delete-other-windows &quot;1&quot;)&#xA;  (&quot;d&quot; delete-window &quot;del&quot;)&#xA;  (&quot;k&quot; kill-buffer &quot;kill&quot;)&#xA;  (&quot;s&quot; save-buffer &quot;save&quot;)&#xA;  (&quot;u&quot; (progn (winner-undo) (setq this-command 'winner-undo)) &quot;undo&quot;)&#xA;  (&quot;r&quot; winner-redo &quot;redo&quot;)&#xA;  (&quot;b&quot; helm-mini &quot;helm-mini&quot; :exit t)&#xA;  (&quot;f&quot; helm-find-files &quot;helm-find&quot; :exit t)&#xA;  (&quot;|&quot; (lambda () (interactive) (split-window-right) (windmove-right)))&#xA;  (&quot;_&quot; (lambda () (interactive) (split-window-below) (windmove-down)))&#xA;  (&quot;q&quot; nil &quot;cancel&quot;)&#xA;  )&#xA;&#xA;(global-set-key (kbd &quot;M-#&quot;) 'hydra-windows/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lets me change windows, resize them, move buffers from window to window, cycle buffers, kill buffers and even undo window configurations via winner-mode, and it also integrates helm. To exit the hydra, just press arrow or some other key not in the hydra. You can find the &quot;hydra-move&quot; functions on &lt;a href=&quot;https://github.com/abo-abo/hydra/blob/master/hydra-examples.el&quot; rel=&quot;nofollow&quot;&gt;the hydra examples&lt;/a&gt; The great thing about hydra is I don't have to remember all those keybindings and its &quot;modeful&quot;, so once you are in the hydra everything is available as a single key press.&lt;/p&gt;&#xA;" OwnerUserId="10231" LastEditorUserId="10231" LastEditDate="2016-01-05T11:52:12.120" LastActivityDate="2016-01-05T11:52:12.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19273" PostTypeId="1" CreationDate="2016-01-05T13:28:06.467" Score="2" ViewCount="283" Body="&lt;p&gt;At the moment, I only know one way to determine which Emacs functions are called by any given Evil command (e.g. a sequence of key bindings in the Normal state): read the Evil source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a more reliable and efficient way, and if so, what is it? For example, does Evil (or Emacs) have a mechanism that allows the user to tell Emacs:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;When I enter my next command, show me afterwards which Emacs functions it mapped to.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user8341" LastEditorDisplayName="user8341" LastEditDate="2016-01-05T14:21:35.483" LastActivityDate="2016-01-05T14:21:35.483" Title="Trace Evil-mode commands" Tags="|key-bindings|evil|commands|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19275" PostTypeId="1" AcceptedAnswerId="19285" CreationDate="2016-01-05T14:48:46.430" Score="6" ViewCount="267" Body="&lt;p&gt;I'm using the following functions to speed up some regexps&#xA;replacements I frequently use. &lt;code&gt;jc-replace-regexp-in-region&lt;/code&gt; can be&#xA;called by several functions like &lt;code&gt;jc-dollar-to-paren&lt;/code&gt;. At the moment,&#xA;when one of those functions completes, the region is deactivated and I&#xA;have to reactivate it to execute another replace-regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;query-replace-regexp&lt;/code&gt; doesn't seem to offer an option to save the&#xA;activation of the mark, and the function jc-replace-regexp-in-region&#xA;explicitly sets the dectivate-mark (I don't actually know why, I&#xA;didn't write it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I'd like to be able to chain several replace-regexp on the&#xA;same region without having to mark the region between each one. How&#xA;can it be done ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jc-replace-regexp-in-region (Begin End from to)&#xA;  &quot;Replace from by to in the selected region&quot;&#xA;   (interactive &quot;r&quot;)&#xA;   (let (deactivate-mark)&#xA;    (query-replace-regexp from to nil Begin End)))&#xA;&#xA;(defun jc-dollar-to-paren (Begin End)&#xA;      &quot;Replace $toto$ by \\(toto\\) in selected region&quot;&#xA;      (interactive &quot;r&quot;)&#xA;      (jc-replace-regexp-in-region Begin End &quot;\\$\\([\n\t [:nonascii:][:ascii:]]+?\\)\\$&quot; &quot;\\\\\(\\1\\\\\)&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10630" LastEditorUserId="105" LastEditDate="2016-01-05T19:43:36.290" LastActivityDate="2016-01-05T20:49:15.100" Title="Keep region activated upon completion of my command" Tags="|region|mark|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19276" PostTypeId="1" AcceptedAnswerId="19277" CreationDate="2016-01-05T15:06:42.837" Score="5" ViewCount="100" Body="&lt;p&gt;In sx.el compose mode, what is the correct way to mark some region as&#xA;a code block, the way &lt;kbd&gt;C-k&lt;/kbd&gt; does it on the web interface ?&lt;/p&gt;&#xA;" OwnerUserId="10630" LastEditorUserId="5165" LastEditDate="2016-01-05T17:09:44.093" LastActivityDate="2016-01-05T17:09:44.093" Title="Insertion of code blocks in sx.el" Tags="|markdown|sx.el|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19277" PostTypeId="2" ParentId="19276" CreationDate="2016-01-05T15:28:57.343" Score="4" Body="&lt;p&gt;If you select a region and run the command &lt;code&gt;markdown-insert-pre&lt;/code&gt; (&lt;code&gt;C-c C-s p&lt;/code&gt; for me), it will mark the selected region as preformatted text. I am not sure if there is any difference, but for me it seems to indent the region as a code block. You can also start a code block this way if there is no active region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;code&gt;C-c C-s c&lt;/code&gt; will wrap selection in backticks or give you a pair of backticks with the cursor in the middle so you can write a code snippet&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-05T15:28:57.343" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19278" PostTypeId="2" ParentId="19252" CreationDate="2016-01-05T15:53:13.940" Score="3" Body="&lt;p&gt;It is not a good idea to adjust the yanked region directly on &lt;code&gt;yank&lt;/code&gt;. The indent is syntactic relevant for the structure of an org-file. If you copy-paste already structured text the structure would get lost through the adjustments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I propose that you leave &lt;code&gt;yank&lt;/code&gt; as it is and use the following command &lt;code&gt;org-adjust-region&lt;/code&gt; that re-adjusts all the stuff in the current region according to the preceeding stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have bound this function to &lt;kbd&gt;C-+&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install the lisp snippet below in your init file.&#xA;In your use case you just press &lt;kbd&gt;C-+&lt;/kbd&gt; right after pasting and see what happens...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;(defun org-adjust-region (b e)&#xA;  &quot;Readjust stuff in region according to the preceeding stuff.&quot;&#xA;  (interactive &quot;r&quot;) ;; current region&#xA;  (save-excursion&#xA;    (let ((e (set-marker (make-marker) e))&#xA;      (_indent (lambda ()&#xA;             (insert ?\n)&#xA;             (backward-char)&#xA;             (org-indent-line)&#xA;             (delete-char 1)))&#xA;      last-item-pos)&#xA;      (goto-char b)&#xA;      (beginning-of-line)&#xA;      (while (&amp;lt; (point) e)&#xA;    (indent-line-to 0)&#xA;    (cond&#xA;     ((looking-at &quot;[[:space:]]*$&quot;)) ;; ignore empty lines&#xA;     ((org-at-heading-p)&#xA;      (error &quot;Headings cannot be balanced (yet).&quot;))&#xA;     ((org-at-item-p)&#xA;      (funcall _indent)&#xA;      (let ((struct (org-list-struct))&#xA;        (mark-active nil))&#xA;        (ignore-errors (org-list-indent-item-generic -1 t struct)))&#xA;      (setq last-item-pos (point)))&#xA;     ((org-at-block-p)&#xA;      (funcall _indent)&#xA;      (goto-char (plist-get (cadr (org-element-special-block-parser e nil)) :contents-end))&#xA;      (org-indent-line))&#xA;     (t (funcall _indent)))&#xA;    (forward-line))&#xA;      (when last-item-pos&#xA;    (goto-char last-item-pos)&#xA;    (org-list-repair)&#xA;    ))))&#xA;&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-+&quot;) 'org-adjust-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-27T08:30:37.060" LastActivityDate="2016-01-27T08:30:37.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19279" PostTypeId="2" ParentId="12867" CreationDate="2016-01-05T16:09:06.150" Score="3" Body="&lt;p&gt;pdf-tools says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Other operating systems are currently not supported (patches welcome)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so your best option is to get pdf-tools to work on Windows.  I don't see any technical reason why this should be difficult.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-05T16:09:06.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19280" PostTypeId="2" ParentId="2486" CreationDate="2016-01-05T16:15:00.823" Score="1" Body="&lt;p&gt;It's definitely possible.  You might need to be careful about performance (Emacs Lisp is no speed daemon), but other than that, it's a small matter of coding.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-05T16:15:00.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19281" PostTypeId="2" ParentId="14582" CreationDate="2016-01-05T16:21:54.130" Score="0" Body="&lt;p&gt;Indirect buffers suck.  They may look like &quot;just what I need&quot;, but it's &lt;em&gt;very&lt;/em&gt; rarely the case, and then sooner or later you bump into problems.  IOW, I think they are an &lt;em&gt;attractive nuisance&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend you try and figure out why you want to use indirect-buffers and then try to look for other ways to get the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. you say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;indirect buffers are more useful if I want to keep two fixed places&#xA;of a long buffer open after switching my windows to other buffers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are many other ways which are a lot less intrusive than using indirect buffers.  E.g. using &lt;em&gt;registers&lt;/em&gt;, &lt;em&gt;bookmarks&lt;/em&gt;, or maybe with a package which tries to remember which &lt;em&gt;point&lt;/em&gt; was used for your buffers individually in each window.  E.g. in Emacs's master branch we have now enabled &lt;code&gt;switch-to-buffer-preserve-window-point&lt;/code&gt; by default, which should provide some of the behavior you were looking for via indirect buffers.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-06-25T00:43:50.963" LastActivityDate="2016-06-25T00:43:50.963" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19282" PostTypeId="1" AcceptedAnswerId="19284" CreationDate="2016-01-05T17:49:50.437" Score="7" ViewCount="636" Body="&lt;p&gt;I want to write some text including sequences like &lt;code&gt;[123]&lt;/code&gt; in an org-mode text file, but this is automatically turned into a footnote reference. This plain numeric footnote is &lt;a href=&quot;http://orgmode.org/manual/Footnotes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;not recommended&lt;/a&gt; anyway. How can I turn off this footnote reference type completely?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's an &lt;a href=&quot;https://unix.stackexchange.com/a/118005/20865&quot;&gt;answer&lt;/a&gt; on the Unix SE based on &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01255.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this thread from 2010&lt;/a&gt;, but the solution doesn't work: with &lt;code&gt;#+DISABLE_PLAIN_FOOTNOTES: some arbitrary text&lt;/code&gt; in the org file the footnote reference is still created in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if this configuration is supposed to depend on the custom .emacs function, but adding that returns an warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `~/.emacs.d/init.el':&#xA;Symbol's value as variable is void: org-export-inbuffer-options-extra&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can the plain numeric footnote reference type be disabled?&lt;/p&gt;&#xA;" OwnerUserId="10677" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-01-05T22:47:42.863" Title="How to disable plain footnote references?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19283" PostTypeId="2" ParentId="19275" CreationDate="2016-01-05T18:06:00.923" Score="4" Body="&lt;p&gt;You need to add this at the end of your command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq deactivate-mark  nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h v deactivate-mark&lt;/code&gt; tells you this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;deactivate-mark is a variable defined in ‘C source code’.&#xA;  Its value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Automatically becomes buffer-local when set.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  If an editing command sets this to t, deactivate the mark afterward.&#xA;  The command loop sets this to nil before each command,&#xA;  and tests the value when the command returns.&#xA;  Buffer modification stores t in this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-01-05T18:11:10.397" LastActivityDate="2016-01-05T18:11:10.397" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19284" PostTypeId="2" ParentId="19282" CreationDate="2016-01-05T19:49:14.033" Score="3" Body="&lt;p&gt;You can redefine the footnote regular expressions to convince &lt;code&gt;org-mode&lt;/code&gt; not to use the &lt;code&gt;[n]&lt;/code&gt; markers as footnotes.  A little bit of testing suggests that you want to change &lt;code&gt;org-footnote-definition-re&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Regular expression matching the definition of a footnote.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;org-footnote-re&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Regular expression for matching footnotes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You'll want to change the regexps as follows:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-footnote-definition-re &quot;^\\[fn:[-_[:word:]]+\\]&quot;&#xA;      org-footnote-re            (concat &quot;\\[\\(?:fn:\\([-_[:word:]]+\\)?:&quot;&#xA;                                         &quot;\\|&quot;&#xA;                                         &quot;\\(fn:[-_[:word:]]+\\)\\)&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I simply removed the regexp to match the &lt;code&gt;[n]&lt;/code&gt; format.  It works fine for me.  Side note: the &lt;code&gt;concat&lt;/code&gt; stuff is to make the regexp easier to read, at least for me.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-01-05T19:49:14.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19285" PostTypeId="2" ParentId="19275" CreationDate="2016-01-05T20:49:15.100" Score="1" Body="&lt;p&gt;I had to get rid of query-replace-regexp because it deactivates the mark. Here is what I came up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jc-replace-regexp-in-region (Begin End from to)&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (let ((deactivate-mark nil))&#xA;      (goto-char (min Begin End))&#xA;      (while (re-search-forward from nil t)&#xA;    (replace-match to nil nil)))))&#xA;&#xA;(defun jc-dollar-to-paren (Begin End)&#xA;  &quot;Replace $toto$ by \\(toto\\) in selected region&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (jc-replace-regexp-in-region Begin End &quot;\\$\\([\n\t [:nonascii:] [:ascii:]]+?\\)\\$&quot; &quot;\\\\\(\\1\\\\\)&quot;)&#xA;  )&#xA;&#xA;(defun jc-do-all-regexps (Begin End)&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((deactivate-mark nil))&#xA;    (jc-alert-or-emph-to-stars Begin End)&#xA;    ;; any other function similar to jc-dollar-to-paren&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, jc-do-all-regexps will perform several regexps search and replace in the same region, without deactivating the mark. Also, the region can be defined from beginning to end or the other way around.&lt;/p&gt;&#xA;" OwnerUserId="10630" LastActivityDate="2016-01-05T20:49:15.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19286" PostTypeId="1" AcceptedAnswerId="19287" CreationDate="2016-01-05T20:49:30.763" Score="8" ViewCount="1619" Body="&lt;p&gt;The title says it all. How to change face in specific color theme locally, in my configuration?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2020-04-27T13:40:29.967" Title="How to change face in particular theme locally?" Tags="|faces|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19287" PostTypeId="2" ParentId="19286" CreationDate="2016-01-05T21:41:34.300" Score="10" Body="&lt;p&gt;Use &lt;code&gt;custom-theme-set-faces&lt;/code&gt; in a &lt;code&gt;with-eval-after-load&lt;/code&gt; to easily customize a theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this modifies &lt;code&gt;ample-theme&lt;/code&gt; to have a lighter background and green keywords instead of the defaults.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;ample-theme&quot;&#xA;  (custom-theme-set-faces&#xA;   'ample&#xA;   '(default ((t (:foreground &quot;#bdbdb3&quot; :background &quot;gray15&quot;))))&#xA;   '(font-lock-keyword-face ((t (:foreground &quot;#818053&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-01-05T21:41:34.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19288" PostTypeId="2" ParentId="19282" CreationDate="2016-01-05T22:47:42.863" Score="3" Body="&lt;p&gt;The current development version of Org (what will eventually be &lt;code&gt;org-9&lt;/code&gt;) requires footnotes to be prefixed with &lt;code&gt;fn&lt;/code&gt;, i.e. &lt;em&gt;&lt;code&gt;[n]&lt;/code&gt; footnotes are not supported&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See commit &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=3699558452077ff5bc0fb81d74cb5e832ff4013b&quot; rel=&quot;nofollow&quot;&gt;3699558452077&lt;/a&gt; for the updated documentation (related commits: &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=deafe565548992fb56a4fe7d613996fcd18d038f&quot; rel=&quot;nofollow&quot;&gt;0&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8eb318f2d0ae3840d14d9b0985853b11bfe27995&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f229ee8e3453c8648bc70b3a8bd26a88253c48ee&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=6de8c94d8d837be48237445d11c2f85f8d2ba9e7&quot; rel=&quot;nofollow&quot;&gt;3&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=d210a8a578b55f5118af24a6f684c12896e02227&quot; rel=&quot;nofollow&quot;&gt;4&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=05973be2979bd5f42278d256146b21d7e81cbc71&quot; rel=&quot;nofollow&quot;&gt;5&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This work was done by &lt;strong&gt;Nicolas Goaziou&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-01-05T22:47:42.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19289" PostTypeId="2" ParentId="19252" CreationDate="2016-01-05T22:56:19.770" Score="2" Body="&lt;p&gt;Paragraph &lt;code&gt;bbb\nccc&lt;/code&gt; is not part of item 3:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. aaa&#xA;2. aaa&#xA;3. aaa&#xA;bbb    &amp;lt;---this is what I copied&#xA;ccc&#xA;4. [@4] aaa &amp;lt;---I want it becomes 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Paragraph &lt;code&gt;bbb\nccc&lt;/code&gt; is a separate paragraph within item 3&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. aaa&#xA;2. aaa&#xA;3. aaa&#xA;&#xA;   bbb    &amp;lt;---this is what I copied&#xA;   ccc&#xA;4. aaa &amp;lt;---I want it becomes 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-01-05T22:56:19.770" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19290" PostTypeId="1" CreationDate="2016-01-05T23:42:16.367" Score="0" ViewCount="496" Body="&lt;p&gt;When I open a file and activate &lt;a href=&quot;http://elpa.gnu.org/packages/nhexl-mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;nhexl-mode&lt;/a&gt;, non-ASCII characters are shown as 3fffxx in the hex column instead of xx. This disrupts the alignment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/onNms.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/onNms.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I observed this on Emacs 23.2 and 24.4 started with &lt;code&gt;emacs -Q&lt;/code&gt;. On Emacs 22.2, it works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's wrong here, and how do I fix it?&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-06T01:17:13.920" Title="nhexl-mode shows bytes 80-ff with 6-digit hex 3fff80–3fffff" Tags="|binary|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19291" PostTypeId="2" ParentId="19290" CreationDate="2016-01-05T23:42:16.367" Score="1" Body="&lt;p&gt;I think the problem is that unibyte characters in an unknown encoding — which is what non-ASCII characters are in a binary file — are represented internally with character values #x3fff80–#x3fffff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Arguably, not taking this into account is a bug in nhexl-mode, or at least an incompatibility with MULE and Emacs ≥23.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible fix is to switch the buffer to unibyte mode. The code below does this automatically on entry to nhexl-mode. Note that it doesn't restore multibyte mode if you switch nhexl-mode off.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-nhexl-mode-hook ()&#xA;  (when nhexl-mode&#xA;    ;; Turn off multibyte, otherwise nhexl 0.1 displays non-ASCII characters&#xA;    ;; in hexa as values in the range 3fff80-3fffff instead of 80-ff.&#xA;    (if (and (fboundp 'toggle-enable-multibyte-characters)&#xA;             enable-multibyte-characters)&#xA;        (toggle-enable-multibyte-characters))))&#xA;(add-hook 'nhexl-mode-hook 'my-nhexl-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This feels more like a partial workaround though. It would be nice to be able to display multibyte characters in the text display and individual bytes in the hexadecimal display.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-01-05T23:42:16.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19292" PostTypeId="1" CreationDate="2016-01-05T23:58:12.577" Score="5" ViewCount="377" Body="&lt;p&gt;I like to use org-refile to refile notes during the capture process. But,  since org-refile does not saves the file after the refiling is done, the file ends up being locked up and I need to visit the file and manually save the buffer in order to access it from another emacs process or another application. Emacs also ask me if I want to save the file upon exit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway to make org-refile save the file automatically after the capture process is done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also note that after refiling there is no buffer opened associated with the file, still, if I visit the file the buffer appears as modified and the changes are not saved.&lt;/p&gt;&#xA;" OwnerUserId="8949" LastActivityDate="2019-05-16T22:54:46.297" Title="Org-refile locks up file when used from org capture" Tags="|org-mode|org-capture|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19293" PostTypeId="2" ParentId="19206" CreationDate="2016-01-06T00:12:40.137" Score="2" Body="&lt;p&gt;You didn't mention which major mode this happens in, but I can see the problem using &lt;code&gt;c-mode&lt;/code&gt;.  Here is an (abridged) backtrace which you can get after setting &lt;code&gt;debug-on-error&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range #&amp;lt;buffer xx&amp;gt; 66 66)...&#xA;  buffer-substring(#&amp;lt;marker at 66 in xx&amp;gt; #&amp;lt;marker at 66 in xx&amp;gt;)&#xA;  yas--field-text-for-display([cl-struct-yas--field 2 #&amp;lt;marker at 66 in xx&amp;gt; #&amp;lt;ma...&#xA;  (let* ((yas-text (yas--field-text-for-display field)) (yas-modified-p (progn (...&#xA;  yas--apply-transform([cl-struct-yas--mirror #&amp;lt;marker at 89 in xx&amp;gt; #&amp;lt;marker at ...&#xA;  ...&#xA;  yas--mirror-update-display([cl-struct-yas--mirror #&amp;lt;marker at 89 in xx&amp;gt; #&amp;lt;mark...&#xA;  ...&#xA;  yas--update-mirrors([cl-struct-yas--snippet ([cl-struct-yas--field 1 #&amp;lt;marker ...&#xA;  ...&#xA;  yas--on-field-overlay-modification(#&amp;lt;overlay from 26 to 41 in xx&amp;gt; t 37 37 1)&#xA;  delete-horizontal-space()&#xA;  #[nil ... [soft allow-auto-fill delete-horizontal-space ...&#xA;  c-indent-new-comment-line(t)&#xA;  default-indent-new-line(t)&#xA;  do-auto-fill()&#xA;  apply(do-auto-fill nil)&#xA;  c-mask-paragraph(nil t do-auto-fill)&#xA;  c-do-auto-fill()&#xA;  self-insert-command(1)&#xA;  call-interactively(self-insert-command nil nil)&#xA;  command-execute(self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically the problem is that yasnippet updates &lt;em&gt;all&lt;/em&gt; mirrors when any field is modified.  The filling code calls &lt;code&gt;c-mask-paragraph&lt;/code&gt; which narrows the region to just that paragraph so the mirror updating fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following advice can work around the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun apply-with-widening (fun &amp;amp;rest args)&#xA;  (save-restriction&#xA;    (widen)&#xA;    (apply fun args)))&#xA;(advice-add 'yas--update-mirrors :around #'apply-with-widening)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm considering the fix at &lt;a href=&quot;https://github.com/capitaomorte/yasnippet/pull/643&quot; rel=&quot;nofollow&quot;&gt;https://github.com/capitaomorte/yasnippet/pull/643&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-01-06T00:12:40.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19294" PostTypeId="2" ParentId="19292" CreationDate="2016-01-06T02:42:03.853" Score="2" Body="&lt;p&gt;There is no hook for &lt;code&gt;org-refile&lt;/code&gt; that could usefully save the buffer (there's &lt;code&gt;org-after-refile-insert-hook&lt;/code&gt; but it won't help).  Since you're capturing you can use &lt;code&gt;org-capture-after-finalize-hook&lt;/code&gt; to save.  Since you're refiling you don't know which file needs to be save, so just save them all:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-capture-after-finalize-hook #'org-save-all-org-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-01-06T02:42:03.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19295" PostTypeId="1" AcceptedAnswerId="19321" CreationDate="2016-01-06T03:38:13.623" Score="10" ViewCount="2309" Body="&lt;p&gt;Throughout the day I am constantly using &lt;code&gt;C-h f&lt;/code&gt; or &lt;code&gt;C-h v&lt;/code&gt; (&lt;code&gt;describe-function&lt;/code&gt; and &lt;code&gt;describe-variable&lt;/code&gt;) to look up documentation for functions and variables. More often than not, if I don't get all the information I need, I will click on the file link at the end of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some-random-command is an interactive compiled Lisp function in `some-mode.el'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and navigate to the source code. This works for installed packages, but doesn't seem to work for built-in ones. For example, at the top of the help page for the command &lt;code&gt;describe-function&lt;/code&gt; all I get is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;describe-function is an interactive compiled Lisp function.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with no link to the source code. &lt;strong&gt;Is there any way to quickly navigate to the source code of a built in package?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can find source code in e.g., &lt;code&gt;/usr/share/emacs/24.5/lisp&lt;/code&gt;, and come up with any number of ways to access that directory quickly, but I am curious if there is a quick and easy way to navigate to a built-in function/variable definition in the source code. Thank you! &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-07T14:49:28.730" LastActivityDate="2016-01-07T14:49:28.730" Title="Navigate to the source code of built-in functions and variables" Tags="|debugging|navigation|source|" AnswerCount="2" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19296" PostTypeId="1" CreationDate="2016-01-06T05:30:23.040" Score="6" ViewCount="542" Body="&lt;p&gt;I'm using emacs as an external editor for mutt, and am hoping to get format=flowed messages to compose properly. The default behavior for fill-paragraph is to end lines without any whitespace, but the format=flowed style as detailed in RFC 2646 and 3676 requires trailing spaces before &quot;soft&quot; newlines. Is there an easy modification to append a space before every newline added by fill-paragraph? My elisp skill is quite limited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To elaborate on specifically what kind of text is wanted, RFC 3676 establishes the  &quot;format=flowed&quot; parameter to MIME type text/plain to describe text that flows well both on devices that automatically line-wrap and those that don't. The salient idea is that a newline immediately following a space is considered a &quot;soft&quot; newline, one provided for line-wrapping for display on devices which don't automatically line-wrap, and that other devices are free to remove this newline and to wrap text according to their own preferences. A newline without a preceding space is a &quot;hard&quot; newline, one meant to be rendered as a newline regardless of the line-width or wrap capabilities of the display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So from a text processing point of view, what I'd like for format=flowed text is for fill-paragraph to precede every intra-paragraph line break with at least one whitespace, while leaving the end-of-paragraph line break with no whitespace preceding it. All of this of course could be done with post-processing search-and-replace on all my messages, but it seems like it should be possible to dothis with some appropriate modification of fill-paragraph.&lt;/p&gt;&#xA;" OwnerUserId="10681" LastEditorUserId="10681" LastEditDate="2016-01-07T14:24:29.243" LastActivityDate="2016-08-20T16:31:53.473" Title="Retooling fill-paragraph to append trailing spaces" Tags="|fill-paragraph|whitespace|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19298" PostTypeId="1" AcceptedAnswerId="19299" CreationDate="2016-01-06T11:36:54.247" Score="4" ViewCount="1270" Body="&lt;p&gt;Vim has the following setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:help gdefault&#xA;&#xA;When on, the &quot;:substitute&quot; flag 'g' is default on.  This means that&#xA;all matches in a line are substituted instead of one.  When a 'g' flag&#xA;is given to a &quot;:substitute&quot; command, this will toggle the substitution&#xA;of all or one match.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get this behavior in &lt;code&gt;evil-emacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2016-01-06T11:59:02.317" LastActivityDate="2016-01-06T12:38:35.930" Title="Evil-emacs: how to make search/replace (:s/) global by default?" Tags="|evil|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19299" PostTypeId="2" ParentId="19298" CreationDate="2016-01-06T12:38:35.930" Score="8" Body="&lt;p&gt;There is a variable named: &lt;code&gt;evil-ex-substitute-global&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you check it with C-h v, it will give you the explanation: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If non-nil substitute patterns a global by default. Hide    Usually&#xA;  (if this variable is nil) a substitution works only on    the first&#xA;  match of a pattern in a line unless the 'g' flag is    given, in which&#xA;  case the substitution happens on all matches in a    line. If this&#xA;  option is non-nil, this behaviour is reversed: the    substitution&#xA;  works on all matches unless the 'g' pattern is    specified, then is&#xA;  works only on the first match.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="10684" LastActivityDate="2016-01-06T12:38:35.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19300" PostTypeId="1" CreationDate="2016-01-06T13:00:50.477" Score="2" ViewCount="1022" Body="&lt;p&gt;This export option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: My title&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;adds a meta tag on the document's &lt;code&gt;head&lt;/code&gt;: &lt;code&gt;&amp;lt;title&amp;gt;My title&amp;lt;/title&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;adds a heading at the start of the generated &lt;code&gt;content&lt;/code&gt; &lt;code&gt;div&lt;/code&gt;: &lt;code&gt;&amp;lt;h1 class=&quot;title&quot;&amp;gt;My title&amp;lt;/h1&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I want 1 but do not want 2. Is it possible to configure this?&lt;/p&gt;&#xA;" OwnerUserId="9216" LastActivityDate="2016-03-06T15:37:18.217" Title="Do not add TITLE as heading to body when exporting org file" Tags="|org-mode|org-export|html|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19301" PostTypeId="2" ParentId="19037" CreationDate="2016-01-06T13:08:15.647" Score="8" Body="&lt;p&gt;In spite of what I wrote in the comments one can set &lt;code&gt;cmd&lt;/code&gt; as shell in &lt;code&gt;ob-sh&lt;/code&gt;!&#xA;The only thing to be aware of is that one needs to use &lt;code&gt;cmdproxy.exe&lt;/code&gt; instead of &lt;code&gt;cmd.exe&lt;/code&gt; to get the output to &lt;code&gt;stdout&lt;/code&gt; right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do this on a per-code-block basis with the following small advice (working with your version &lt;code&gt;GNU Emacs 25.0.50.1 (x86_64-w64-mingw32)&lt;/code&gt;). It defines the new header argument &lt;code&gt;:shcmd&lt;/code&gt; for &lt;code&gt;sh&lt;/code&gt;-code blocks. There you set the shell you want to use, e.g., &lt;code&gt;cmdproxy.exe&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'ob-sh)&#xA;(defadvice org-babel-sh-evaluate (around set-shell activate)&#xA;  &quot;Add header argument :shcmd that determines the shell to be called.&quot;&#xA;  (let* ((org-babel-sh-command (or (cdr (assoc :shcmd params)) org-babel-sh-command)))&#xA;    ad-do-it&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After installing this advice you can use it as in the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :shcmd &quot;cmdproxy.exe&quot;&#xA;dir&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;#+begin_example&#xA;dir&#xA; Datenträger in Laufwerk C: ist CRUZER&#xA; Volumeseriennummer: CEAB-B990&#xA;&#xA; Verzeichnis von c:\temp&#xA;.&#xA;..&#xA;test.org&#xA;.&#xA;.&#xA;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-06T13:35:51.557" LastActivityDate="2016-01-06T13:35:51.557" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19302" PostTypeId="2" ParentId="19253" CreationDate="2016-01-06T13:11:36.490" Score="0" Body="&lt;p&gt;You can define a command for this and bind it to a key:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-commit-and-push (prefix)&#xA;  (interactive &quot;P&quot;)&#xA;  (add-hook 'with-editor-post-finish-hook&#xA;            (lambda ()&#xA;              (call-interactively #'magit-push-current-to-upstream))&#xA;            t t)&#xA;  (with-editor-finish nil))&#xA;&#xA;(define-key with-editor-mode-map (kbd &quot;&amp;lt;f12&amp;gt;&quot;) #'my-commit-and-push)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-01-06T13:11:36.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19303" PostTypeId="1" AcceptedAnswerId="19320" CreationDate="2016-01-06T13:29:21.237" Score="4" ViewCount="906" Body="&lt;p&gt;Scenario: I'm working with a horizontal split &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---------------------&#xA;|  File 1  |  File 2 |&#xA;|          |         |&#xA;|          |         |&#xA;----------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I'm working on File 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 1: Sometimes when I use a command like &lt;code&gt;M-x helm-mini&lt;/code&gt; and load up another file the new file opens up in File 1's window.  I'd like it to open up in the current window&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;----------------------                   ----------------------&#xA;|  File 1  | *File 2* |                  | File 3  |  File 2  |&#xA;|----------|----------|   --Select---&amp;gt;   |         |          |&#xA;|       Helm          |                  |         |          |&#xA;----------------------                   |---------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to keep file 1 active.  This is very annoying Emacs behavior&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 2: &lt;code&gt;M-x helm-mini&lt;/code&gt; (for example) does a few other annoying thing.  First, it expands the size of File 2's window to full width.  Secondly, the temp vertically split buffer for the &lt;code&gt;helm-mini&lt;/code&gt; buffer is full width as well&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preferably I'd like this to happen:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---------------------                   ----------------------&#xA;|  File 1  |  File 2 |                  | File 1  |  File 3  |&#xA;|          |---------|   --Select---&amp;gt;   |         |          |&#xA;|          | Helm    |                  |         |          |&#xA;----------------------                  |---------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like the new split helm screen (or any new command window) to only fill the current working window.  Is that possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- Update --&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't intend to make this a helm only type question.  I think simply put I'd like:  If I have 2 files horizontally split I don't want emacs to disturb those windows unless I open a new file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like if I'm working in file1, file2 window should &lt;em&gt;never&lt;/em&gt; change.  I can't stand when emacs does this.  I am either working on file2 or using it as a reference -- I don't want that buffer changed&lt;/p&gt;&#xA;" OwnerUserId="10654" LastEditorUserId="105" LastEditDate="2016-08-10T22:35:05.797" LastActivityDate="2016-08-10T22:35:05.797" Title="Split window buffers" Tags="|window-splitting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19304" PostTypeId="1" AcceptedAnswerId="19308" CreationDate="2016-01-06T13:59:25.477" Score="1" ViewCount="595" Body="&lt;p&gt;when I have latex in a section, and press &lt;code&gt;C-c C-x C-l&lt;/code&gt; it preview all LaTeX fragments in the section, and when I jump to another section and toggle latex preview fragment for that section, it untoggle the latex preview of the other section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By section I mean an outline, or source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I have some LaTeX in an outline and some in a source code (because I am writing a lesson), and when I toggle the LaTeX in the source code, it untogle the LaTeX of the outline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent that ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have a binding to preview all the LaTeX of a document, even if it's already previewed ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2016-01-06T14:51:18.290" Title="Org latex preview untoggle when toggling" Tags="|org-mode|preview-latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19305" PostTypeId="2" ParentId="19300" CreationDate="2016-01-06T14:02:54.347" Score="5" Body="&lt;p&gt;You can hide the title by providing the appropriate CSS setting.  For example, add this line to your file (and hit &lt;code&gt;C-c C-c&lt;/code&gt; to activate the change):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD: &amp;lt;style type=&quot;text/css&quot;&amp;gt; &amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/ .title { display: none; } /*]]&amp;gt;*/--&amp;gt; &amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or set the &lt;code&gt;org-html-head&lt;/code&gt; variable.&#xA;Here's the &lt;a href=&quot;http://orgmode.org/manual/CSS-support.html#CSS-support&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-01-06T14:02:54.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19306" PostTypeId="1" AcceptedAnswerId="19327" CreationDate="2016-01-06T14:06:15.190" Score="4" ViewCount="9685" Body="&lt;p&gt;My current setup is as follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elementary OS Freya&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs version 24.5.1&lt;/li&gt;&#xA;&lt;li&gt;company-mode 0.8.12&lt;/li&gt;&#xA;&lt;li&gt;clang-3.5-dev&lt;/li&gt;&#xA;&lt;li&gt;libclang-3.5-dev&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've checked that both libclang-3.5-dev and clang-3.5-dev are installed&#xA;and I have also checked that clang was in /usr/bin. There is no problem on init but when I open a cpp file the following error in thrown&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Company back-end 'company-clang' could not be initialized:                                     &#xA;Company found no clang executable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm trying to setup a C/C++ development environment in emacs, I was following &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; guide in order to achieve this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e adding the following to my .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;(setq company-backends (delete 'company-semantic company-backends))&#xA;(define-key c-mode-map  [(tab)] 'company-complete)&#xA;(define-key c++-mode-map  [(tab)] 'company-complete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how do I get clang recognized by company-clang?&lt;/p&gt;&#xA;" OwnerUserId="10532" LastEditorUserId="5426" LastEditDate="2018-03-15T02:10:27.683" LastActivityDate="2018-03-15T02:10:27.683" Title="How do I get company mode to recognize clang?" Tags="|company-mode|c++|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19307" PostTypeId="1" CreationDate="2016-01-06T14:38:49.267" Score="0" ViewCount="67" Body="&lt;p&gt;I have css-mode and javascript-mode and if I open css file the &lt;code&gt;indent-region-function&lt;/code&gt; is set to &lt;code&gt;css-indent-region&lt;/code&gt; which break javascript-mode indent region, how can I fix that? the workaround is to execute:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq indent-region-function nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after I switch to css-mode, is there a way to fix this without this hack?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calling this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun css-indent-mode-fix ()&#xA;  (setq indent-region-function nil))&#xA;&#xA;(add-hook 'css-mode-hook 'css-indent-mode-fix)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Disable indent region in css mode.&lt;/p&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="10438" LastEditDate="2016-01-06T17:16:15.673" LastActivityDate="2016-01-06T17:16:15.673" Title="Css mode break indent region for javascript-mode" Tags="|javascript|css|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19308" PostTypeId="2" ParentId="19304" CreationDate="2016-01-06T14:51:18.290" Score="4" Body="&lt;p&gt;From &lt;code&gt;org-preview-latex-fragment&lt;/code&gt; documentation, if you use a double prefix, it'll display all fragments in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is bound to C-c C-x C-l.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(org-preview-latex-fragment &amp;amp;optional SUBTREE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Preview the LaTeX fragment at point, or all locally or globally. If&#xA;  the cursor is in a LaTeX fragment, create the image and overlay it&#xA;  over the source code.  If there is no fragment at point, display all&#xA;  fragments in the current text, from one headline to the next.  With&#xA;  prefix SUBTREE, display all fragments in the current subtree.  &lt;strong&gt;With a&#xA;  double prefix arg C-u C-u, or when the cursor is before the first&#xA;  headline, display all fragments in the buffer.&lt;/strong&gt; The images can be&#xA;  removed again with M-x org-ctrl-c-ctrl-c.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-01-06T14:51:18.290" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19311" PostTypeId="1" AcceptedAnswerId="19312" CreationDate="2016-01-06T17:34:20.167" Score="0" ViewCount="350" Body="&lt;p&gt;I am a vim user for about 2 years and a feel a little out of place here. :) I've also used emacs and very much fond of it, but I am comfortable with vim and getting to the same level in emacs will be tricky. But I realized that I am using a fair number of vim plugins as I work with different code and tasks for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;code completion&lt;/li&gt;&#xA;&lt;li&gt;fuzzy finder (CtrlP) &lt;/li&gt;&#xA;&lt;li&gt;commenter plugin (nerdcommenter) &lt;/li&gt;&#xA;&lt;li&gt;improved syntax highlighting (C, Python, Go)&lt;/li&gt;&#xA;&lt;li&gt;vim-airline for better information about the files &lt;/li&gt;&#xA;&lt;li&gt;go plugins &lt;/li&gt;&#xA;&lt;li&gt;yada-yada for the total of 15&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have them version controlled and in submodules, and I also have a 200+ line vimrc file. However, I am starting to realize that maybe that's not very healthy and requires maintenance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does Emacs require as many plugins to use it efficiently as main code text editor? I don't just mean effective navigation, but also things that make your life easier like better syntax highlighting, auto parenthesis surround, tag matching, file outline and all that stuff. If in some near future I were to move to Emacs, would I find myself in the same boat again and it's just the nature of using editors like Emacs and Vim?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: thanks to the comments I wanted to clarify that the actual question is: are these (or some of them) plugins available out of the box in Emacs (they are not in Vim) or does one needs to search and add them like I do in Vim. Hopefully, this helps making this question unop-ed. I don't want to have an vim vs emacs discussion.&lt;/p&gt;&#xA;" OwnerUserId="10686" LastEditorUserId="10686" LastEditDate="2016-01-06T18:48:12.067" LastActivityDate="2016-01-06T18:48:12.067" Title="Emacs and plugins" Tags="|customize|" AnswerCount="2" CommentCount="4" ClosedDate="2016-01-06T18:32:30.780" ContentLicense="CC BY-SA 3.0" />
  <row Id="19312" PostTypeId="2" ParentId="19311" CreationDate="2016-01-06T17:56:01.347" Score="1" Body="&lt;p&gt;To do all the things you mentioned in Emacs should not be very tricky, and all should be possible. However, if you are asking if Emacs will do all/most of the things you want out of the box without configuration, the answer is &lt;em&gt;no&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you say, if you moved to Emacs you would likely be:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;in the same boat again and it's just the nature of using editors like Emacs and Vim&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That being said, I don't think that is unhealthy to configure your editor (to a point). In fact, this is one of many things I (and I assume many on this site) love about Emacs. It is a tool that I use all day every day for a living, and so sharpening that tool is necessary and usually improves my productivity (as long as I don't get too sucked in with the tweaking). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to do all the configuration yourself, you can use a pre-configured &quot;kit&quot; (I won't say &quot;starter kit&quot;, because they are not necessarily for beginners) like &lt;a href=&quot;http://spacemacs.org/&quot; rel=&quot;nofollow&quot;&gt;spacemacs&lt;/a&gt; or &lt;a href=&quot;http://batsov.com/prelude/&quot; rel=&quot;nofollow&quot;&gt;prelude&lt;/a&gt;. If you are used to working in VIM, you might give spacemacs a try. These kits or &quot;distributions&quot; (and there are others out there) should give you more of the functionality out of the box that you are looking for than vanilla Emacs would. However, I can't imagine you will go to long using any version of Emacs without wanting/needing to do &lt;em&gt;a little&lt;/em&gt; bit of tweaking. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I have never used VIM, so I don't know what goes into maintaing a VIM configuration, but if you use an Emacs package manager like MELPA, getting and maintaining plugins/packages should be pretty painless more or less automatic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, if you use something like &lt;code&gt;use-package&lt;/code&gt; to organize packages and package-specific configuration, this will improve your experience and remove some headaches as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you can do the &lt;a href=&quot;https://en.wikipedia.org/wiki/Literate_programming&quot; rel=&quot;nofollow&quot;&gt;literate programming&lt;/a&gt; thing and keep your configuration in an &lt;a href=&quot;http://orgmode.org/&quot; rel=&quot;nofollow&quot;&gt;org&lt;/a&gt; file like &lt;a href=&quot;https://github.com/sachac/.emacs.d/blob/gh-pages/Sacha.org&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;, or &lt;a href=&quot;https://github.com/danielmai/.emacs.d/blob/master/config.org&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;. This makes it much easier (in my opinion) to keep your configuration organized and maintainable.  &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-06T18:15:34.003" LastActivityDate="2016-01-06T18:15:34.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19313" PostTypeId="2" ParentId="19311" CreationDate="2016-01-06T18:31:42.860" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;If in some near future I were to move to Emacs, would I find myself in the same boat again?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Probably, but on a different planet.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...the nature of using editors like Emacs and Vim?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why not try &lt;a href=&quot;http://www.emacswiki.org/emacs/Evil&quot; rel=&quot;nofollow&quot;&gt;evil mode&lt;/a&gt; during the transition? There's also a &lt;a href=&quot;https://youtu.be/Uz_0i27wYbg&quot; rel=&quot;nofollow&quot;&gt;screencast&lt;/a&gt; before you take the trip.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-01-06T18:31:42.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19314" PostTypeId="1" CreationDate="2016-01-06T18:35:41.300" Score="5" ViewCount="1014" Body="&lt;p&gt;I'm trying to use a hydra to dispatch among a selection of motions. See this minimal example:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defhydra hydra/test (:color blue)&#xA;  &quot;This is a test hydra&quot;&#xA;  (&quot;n&quot; evil-next-line))&#xA;&#xA;(evil-define-motion hydra/test/motion-proxy (&amp;amp;rest args)&#xA;  (hydra/test/body))&#xA;&#xA;(global-set-key (kbd &quot;M-RET&quot;) #'hydra/test/motion-proxy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this motion does not compose with evil operators. For example, &lt;kbd&gt;d&lt;/kbd&gt; &lt;kbd&gt;M-RET&lt;/kbd&gt; &lt;kbd&gt;n&lt;/kbd&gt; does move to the next line, but &lt;em&gt;does not&lt;/em&gt; delete any text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I work around this?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2023-12-09T16:03:10.840" Title="Use hydra with evil motions" Tags="|evil|hydra|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19315" PostTypeId="1" AcceptedAnswerId="19316" CreationDate="2016-01-06T19:06:58.233" Score="2" ViewCount="1132" Body="&lt;p&gt;I have set autofill to 80 with &lt;code&gt;C-x f&lt;/code&gt; and autofill-mode is enabled (I see &lt;code&gt;Fill&lt;/code&gt; in the modeline), but it doesn't return automatically after 80 characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make it works ?&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2016-01-06T21:16:57.763" Title="80 columns with autofill-mode doesn't return automatically" Tags="|auto-fill-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19316" PostTypeId="2" ParentId="19315" CreationDate="2016-01-06T19:31:25.683" Score="2" Body="&lt;p&gt;From the &lt;code&gt;auto-fill-mode&lt;/code&gt; docs:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When Auto Fill mode is enabled, &lt;strong&gt;inserting a space at a column&#xA;  beyond `current-fill-column'&lt;/strong&gt; automatically breaks the line at a&#xA;  previous space.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So if you e.g., type a continuous string starting from column 1 to column 100, it will not break at 80 even if you set &lt;code&gt;fill-column&lt;/code&gt; to 80. However, if you enter a space at any point after column 80, any text you type after that should go on the next line automatically. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The OP was having this issue in &lt;code&gt;c-mode&lt;/code&gt;, which contains the variable&lt;code&gt;c-ignore-auto-fill&lt;/code&gt; which is a&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List of contexts in which automatic filling never occurs.&#xA;  If Auto Fill mode is active, it will be temporarily disabled if point&#xA;  is in any context on this list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;By default (for me) it is set to &lt;code&gt;(string cpp code)&lt;/code&gt; which means that it will ignore &lt;code&gt;auto-fill-mode&lt;/code&gt; in the following contexts:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;string  -- inside a string or character literal&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;cpp     -- inside a preprocessor directive&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;code    -- anywhere else, i.e. in normal code&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you put &lt;code&gt;(setq c-ignore-auto-fill nil)&lt;/code&gt; in your init file, it should work as you want it to. However, I don't have any experience in the c language, and am not sure if there will be consequences to this setting. I assume, because of these defaults, that there may be some consequences...&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-06T21:16:57.763" LastActivityDate="2016-01-06T21:16:57.763" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19317" PostTypeId="1" CreationDate="2016-01-06T19:38:58.657" Score="2" ViewCount="181" Body="&lt;p&gt;I would like to generate a blog by publishing org files to jekyll, as described in the &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-jekyll.html&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wiki recommends formatting each post like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_HTML&#xA;---&#xA;layout: default&#xA;title: Benighted on the Ben.&#xA;excerpt: An unplanned bivouac on Ben Nevis.&#xA;---&#xA;#+END_HTML&#xA;It was early January when six of us travelled up to ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While this works, it is inconvenient when exporting to other formats.  I am looking for a function (possibly a publish or preamble) that allows me to publish this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LAYOUT: default&#xA;#+TITLE: Benighted on the Ben.&#xA;#+EXCEPRT: An unplanned bivouac on Ben Nevis.&#xA;&#xA;It was early January when six of us travelled up to ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Into this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---&#xA;layout: default&#xA;title: Benighted on the Ben.&#xA;excerpt: An unplanned bivouac on Ben Nevis.&#xA;---&#xA;&amp;lt;p&amp;gt;It was early January when six of us travelled up to ....&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Has anyone accomplished this?  Does anyone know of a good place to start?&lt;/p&gt;&#xA;" OwnerUserId="10687" LastActivityDate="2017-02-07T20:08:11.087" Title="Publish org entries to Jekyll with a custom header" Tags="|org-mode|org-publish|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19318" PostTypeId="1" CreationDate="2016-01-06T20:23:03.730" Score="2" ViewCount="553" Body="&lt;p&gt;I'd like to run mu4e in a dedicated frame but on the same emacs server. The following function gets me almost there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun malb/mail ()&#xA;  (interactive)&#xA; (select-frame (make-frame-command))&#xA; (toggle-frame-maximized) ;; HACK, I usually run maximised&#xA; (sleep-for 0.1) ;; this is a HACK&#xA; (set-frame-size (selected-frame) 200 64)&#xA; (mu4e))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, it creates a new frame in which mu4e is started. However, that frame is just like any other emacs frame and might visit any buffer when I close a buffer created by mu4e. How can I dedicate this frame to mu4e and mu4e only?&lt;/p&gt;&#xA;" OwnerUserId="8930" LastActivityDate="2016-01-06T20:23:03.730" Title="dedicated frame for mu4e" Tags="|frames|mu4e|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19319" PostTypeId="2" ParentId="3898" CreationDate="2016-01-06T20:53:44.657" Score="33" Body="&lt;p&gt;I'm not sure when this feature was added, but it does this perfectly:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Merge one branch into another and encounter a conflict&lt;/li&gt;&#xA;&lt;li&gt;In the Magit buffer, there will be sections for &lt;code&gt;Merging master&lt;/code&gt;, and &lt;code&gt;Unstaged changes&lt;/code&gt;, &lt;code&gt;Staged changes&lt;/code&gt;. The conflicted file is in &lt;code&gt;Unstaged changes&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;On the line with the conflicted file, hit &lt;code&gt;k&lt;/code&gt; to discard the changes (i.e., the conflicted changes)&lt;/li&gt;&#xA;&lt;li&gt;In the minibuffer, you will see the answer:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;For &amp;lt;conflicted file&amp;gt; checkout: [o]ur stage, [t]heir stage, [c]onflict, or [C-g] to abort&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8465" LastActivityDate="2016-01-06T20:53:44.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19320" PostTypeId="2" ParentId="19303" CreationDate="2016-01-07T01:22:13.553" Score="2" Body="&lt;p&gt;For question 2, you want to set &lt;code&gt;helm-split-window-in-side-p&lt;/code&gt; non-nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For question 1, your desired behavior is how it works on my setup, and I can't find anything in my &lt;code&gt;helm&lt;/code&gt; config that seems to be affecting this.  I suspect &lt;code&gt;helm&lt;/code&gt; is respecting the vanilla Emacs settings that affect whether buffers try to open in the active window.  I'm not very familiar with those, so maybe someone else can weigh in.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-07T01:22:13.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19321" PostTypeId="2" ParentId="19295" CreationDate="2016-01-07T02:42:33.513" Score="7" Body="&lt;p&gt;The reason you sometimes see “interactive compiled Lisp function” (or likewise for variables) with no file name is that the function was loaded from a byte-compiled file and the corresponding Elisp source file is not present. In order to show you the source code, Emacs has to be able to find the source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many distributions ship Lisp source files in a separate package, because not every user wants them and they're bulky. For example, on Debian and derivatives, install &lt;code&gt;emacs24-el&lt;/code&gt;. If you build Emacs from source, &lt;code&gt;make install&lt;/code&gt; copies the Elisp sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to see the source code of primitives (subroutines and special forms), Emacs needs to be able to find the C sources. Those are not normally available unless you installed from source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs looks for the Lisp sources in the directories in &lt;code&gt;load-path&lt;/code&gt;. For a function or variable loaded from &lt;code&gt;foo.elc,&lt;/code&gt; the file can be &lt;code&gt;foo.el&lt;/code&gt; or &lt;code&gt;foo.el.gz&lt;/code&gt;. Emacs looks for C sources under &lt;code&gt;source-directory&lt;/code&gt;, and prompts you for a different directory if it doesn't find the source file.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-01-07T02:42:33.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19322" PostTypeId="2" ParentId="19317" CreationDate="2016-01-07T03:01:16.147" Score="1" Body="&lt;p&gt;I have written two org-mode exporter for pelican and hexo for my self (no public release yet, just opensource on GitHub)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, the best way is write a org-mode exporter based on ox-html, I don't know if anyone did it for jekyll but you can based on my org-hexo to achieved this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/coldnew/org-hexo&quot; rel=&quot;nofollow&quot;&gt;https://github.com/coldnew/org-hexo&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/coldnew/org-pelican&quot; rel=&quot;nofollow&quot;&gt;https://github.com/coldnew/org-pelican&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10693" LastActivityDate="2016-01-07T03:01:16.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19324" PostTypeId="1" CreationDate="2016-01-07T04:08:10.630" Score="1" ViewCount="91" Body="&lt;p&gt;I am having an issue viewing my time logged for individual days. I want to easily traverse through each day, and view the Org Clock Table for that day. When my pointer is on the clock table's config row that starts with &lt;code&gt;#+BEGIN&lt;/code&gt;, I can easily traverse through each week using org-shift[up/down/left/right]. For example, with my pointer on the line &lt;code&gt;#+BEGIN: clocktable :scope tree :maxlevel 4 :block 2016-W01 :step day :link&lt;/code&gt;, I can press &lt;code&gt;S-right&lt;/code&gt; to traverse to the next week by changing the &lt;code&gt;:block 2016-W01&lt;/code&gt; to &lt;code&gt;:block 2016-W02&lt;/code&gt;, which updates my org clock for that week. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But org-shift does not work on the date pattern when it is defined for a specific day. For example, on the second Org Clock Table in my example below, I changed &lt;code&gt;2016-W01&lt;/code&gt; to &lt;code&gt;2016-01-05&lt;/code&gt;, in an effort to traverse each day instead of each week. But now, org-shift[up/down/left/right] does not work. I want to easily move through my timesheet and traverse &lt;code&gt;2016-01-06&lt;/code&gt;, &lt;code&gt;2016-01-07&lt;/code&gt;, etc. but org-shift gives me the error: &lt;code&gt;org-clocktable-shift: Wrong type argument: integerp, nil&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* tasks&#xA;&#xA;#+BEGIN: clocktable :scope tree :maxlevel 4 :block 2016-W01 :step day :link&#xA;&#xA;Daily report: [2016-01-04 Mon]&#xA;| Headline     | Time   |&#xA;|--------------+--------|&#xA;| *Total time* | *0:00* |&#xA;#+END&#xA;&#xA;#+BEGIN: clocktable :scope tree :maxlevel 4 :block 2016-01-05 :step day :link&#xA;&#xA;Daily report: [2016-01-05 Tue]&#xA;| Headline          | Time   |      |      |      |&#xA;|-------------------+--------+------+------+------|&#xA;| *Total time*      | *1:20* |      |      |      |&#xA;|-------------------+--------+------+------+------|&#xA;| [[file:nil::tasks][tasks]]             | 1:20   |      |      |      |&#xA;| \_  [[file:nil::Community][Community]]     |        | 1:20 |      |      |&#xA;| \_    [[file:nil::Contractors][Contractors]] |        |      | 1:20 |      |&#xA;| \_      [[file:nil::more%20work][more work]] |        |      |      | 1:20 |&#xA;#+END&#xA;&#xA;** Community&#xA;*** Contributors&#xA;**** getting work done&#xA;:LOGBOOK:&#xA;CLOCK: [2016-01-06 Wed 19:30]--[2016-01-06 Wed 21:30] =&amp;gt;  2:00&#xA;:END:&#xA;&#xA;*** Contractors&#xA;**** more work&#xA;:LOGBOOK:&#xA;CLOCK: [2016-01-08 Fri 19:38]--[2016-01-08 Fri 21:38] =&amp;gt;  2:00&#xA;CLOCK: [2016-01-05 Tue 16:10]--[2016-01-05 Tue 17:30] =&amp;gt;  1:20&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I investigated a little further, and I found that org-shift[up/down/left/right] works when I use the form &lt;code&gt;[2016-01-06 Wed]&lt;/code&gt; for my &lt;code&gt;:block&lt;/code&gt; (ie using the line &lt;code&gt;#+BEGIN: clocktable :scope tree :maxlevel 4 :block [2016-01-05 Tue] :step day :link&lt;/code&gt; for my table below), but the Org Clock Table does not recognize that format. Is there a fix for this issue? Are others experiencing this same issue? Should I file a bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, is there an easier way to traverse daily Org Clock Table reports, via &lt;code&gt;:step day&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2016-01-07T04:08:10.630" Title="org-shift[up/right/left/down] gives error on Org Clock Table pattern `yyyy-mm-dd`" Tags="|org-mode|org-agenda|org-table|org-clock|org-clock-table|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19325" PostTypeId="1" CreationDate="2016-01-07T04:33:17.543" Score="1" ViewCount="197" Body="&lt;p&gt;I want to set the indentation of conditional comments to 2 space, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!--[if lt IE 9]&amp;gt;&#xA;  &amp;lt;script src=&quot;https://...) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The default is 4, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!--[if lt IE 9]&amp;gt;&#xA;    &amp;lt;script src=&quot;https://...) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;NOTE: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried without web-mode, just builtin HtmlMode and SgmlMode, and the behavior is the same: I can't modify conditional comments indentation.&lt;/p&gt;&#xA;" OwnerUserId="9763" LastEditorUserId="9763" LastEditDate="2016-01-07T18:16:40.250" LastActivityDate="2016-01-07T19:04:52.623" Title="Indentation of conditional comments in web-mode.el" Tags="|web-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19326" PostTypeId="2" ParentId="19295" CreationDate="2016-01-07T06:22:03.137" Score="3" Body="&lt;p&gt;If you're looking for ways to quickly jump to source code, there are also &lt;code&gt;find-function-at-point&lt;/code&gt; and &lt;code&gt;find-variable-at-point&lt;/code&gt; which will jump to the definition of the symbol under the cursor - you could bind them to C-h C-f and C-h C-v, for instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you could try &lt;strong&gt;elisp-slime-nav&lt;/strong&gt;, which uses M-. to jump to a symbol's definition, and M-, to return - it navigates to variables, functions, libraries, and faces - &lt;a href=&quot;https://github.com/purcell/elisp-slime-nav/&quot; rel=&quot;nofollow&quot;&gt;https://github.com/purcell/elisp-slime-nav/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2462" LastActivityDate="2016-01-07T06:22:03.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19327" PostTypeId="2" ParentId="19306" CreationDate="2016-01-07T09:10:50.073" Score="8" Body="&lt;p&gt;OP here, my clang executable wasn't being recognized by &lt;code&gt;company-clang&lt;/code&gt; because the name of the executable in my &lt;code&gt;/usr/bin&lt;/code&gt; was  &lt;code&gt;clang-3.5&lt;/code&gt; and not &lt;code&gt;clang&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using &lt;code&gt;M-x customize-variable RET company-clang-executable RET&lt;/code&gt; as @elethan suggested and setting the absolute path to the clang executable didn't resolve the problem.&lt;/li&gt;&#xA;&lt;li&gt;Above suggested that &lt;code&gt;company-clang&lt;/code&gt; was searching in the right place (&lt;em&gt;directory&lt;/em&gt;) but not searching for the right file (&lt;em&gt;clang executable&lt;/em&gt;)&lt;/li&gt;&#xA;&lt;li&gt;I used &lt;code&gt;M-x find-variable RET company-clang-executable RET&lt;/code&gt; to find out the name of the file &lt;code&gt;company-clang&lt;/code&gt; was looking.&lt;/li&gt;&#xA;&lt;li&gt;From &lt;code&gt;company-clang.el&lt;/code&gt;, we can see that &lt;code&gt;company-clang&lt;/code&gt; is looking for a file named &lt;code&gt;clang&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In &lt;code&gt;/usr/bin&lt;/code&gt; I created a symbolic link to my &lt;code&gt;clang-3.5&lt;/code&gt; named &lt;code&gt;clang&lt;/code&gt; using the following command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo ln -s /usr/bin/clang-3.5 clang&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;TL;DR&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;My clang executable was not named &lt;code&gt;clang&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Created a symbolic link named &lt;code&gt;clang&lt;/code&gt; to my clang executable&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;company-clang&lt;/code&gt; finds clang executable&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10532" LastActivityDate="2016-01-07T09:10:50.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19328" PostTypeId="1" AcceptedAnswerId="19335" CreationDate="2016-01-07T10:13:18.307" Score="1" ViewCount="171" Body="&lt;p&gt;I am creating a keymap based on a configuration file.&lt;br&gt;&#xA;The resulting keys all call the same function but with different arguments.&#xA;Here is the code I am using for a single key:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun add-do-my-stuff-keybinding (config-pair)&#xA;  &quot;Add config to do-my-stuff-map&quot;&#xA; (define-key do-my-stuff-map (kbd (config-get-key config-pair))&#xA;   `(lambda ()&#xA;      (interactive)&#xA;      (do-stuff ,(config-get-name config-pair)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is, is there a way to avoid the lambda so that the inspection of the keybindings does not show a lambda but a helpful function name?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like generating defuns oder named lambdas?&lt;/p&gt;&#xA;" OwnerUserId="10556" LastEditorUserId="306" LastEditDate="2016-01-07T11:23:13.577" LastActivityDate="2016-01-07T14:03:57.180" Title="How to create named functions for dynamic key bindings?" Tags="|key-bindings|functions|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19329" PostTypeId="1" AcceptedAnswerId="19751" CreationDate="2016-01-07T11:03:18.660" Score="2" ViewCount="563" Body="&lt;p&gt;I'm fairly new to spacemacs/emacs, so apologies if this is a trivial question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using org-mode for my notes, stored within nvAlt. This works wonderfully in terms of searching/syncing, however emacs seems to keep creating numbered backups. I.e. if I have a note called &lt;code&gt;todo.org&lt;/code&gt;, it will keep creating files called &lt;code&gt;todo.1.org&lt;/code&gt; all the way through to &lt;code&gt;todo.10.org&lt;/code&gt; and so on. Furthermore, the currently opened buffer would undo a bunch of latest changes I made, presumably because a new backup was created. This can be rather irritating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked into how emacs handles backups, and this seems to be slightly different to the classic numbered backups (i.e. I would expect them to look like &lt;code&gt;todo.org.~1~&lt;/code&gt;), so it seems like a custom backup format to spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did try to move the backups to a different location via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist `((&quot;.&quot; . &quot;~/.emacs_saves&quot;)))&#xA;(setq backup-by-copying t)&#xA;(setq auto-save-file-name-transforms `((&quot;.&quot; &quot;~/.emacs_saves&quot; t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a good way to move the backup files, so they don't cause the abrupt &quot;undos&quot;?&lt;/p&gt;&#xA;" OwnerUserId="8616" LastActivityDate="2016-01-22T07:47:26.443" Title="Spacemacs/org-mode with nvAlt: disabling numbered backups" Tags="|org-mode|spacemacs|backup|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19330" PostTypeId="1" AcceptedAnswerId="21093" CreationDate="2016-01-07T11:10:43.613" Score="10" ViewCount="843" Body="&lt;p&gt;How do I visually select the last pasted text with &lt;code&gt;evil-emacs&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;gv&lt;/code&gt; reselects the last visual selection. I'd like a function/snippet that does the same for my last pasted text.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2023-02-07T15:31:13.797" Title="Evil-emacs: how to select last pasted text (like gv)?" Tags="|evil|copy-paste|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19331" PostTypeId="1" CreationDate="2016-01-07T12:24:37.780" Score="5" ViewCount="1451" Body="&lt;p&gt;I am running Emacs 24.5.1 (compiled) and Spacemacs v.0.105.4 on Ubuntu 12.04.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to use the spotify layer I get the following error:&#xA;peculiar error: &quot;Emacs not compiled with dbus support&quot;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I fix it?&lt;/p&gt;&#xA;" OwnerUserId="10699" LastEditorUserId="25" LastEditDate="2016-01-09T13:44:10.890" LastActivityDate="2016-01-09T13:44:10.890" Title="Error: compiled without dbus support?" Tags="|build|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19332" PostTypeId="2" ParentId="19331" CreationDate="2016-01-07T12:51:10.270" Score="5" Body="&lt;p&gt;Found the solution:&#xA;I was missing the package libdbus-1-dev. After ./configure &amp;amp;&amp;amp; make dbus support was automatically added. So basically follow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-get install libdbus-1-dev&#xA;./autogen.sh&#xA;./configure&#xA;make&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10699" LastEditorUserId="10699" LastEditDate="2016-01-08T15:05:29.507" LastActivityDate="2016-01-08T15:05:29.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19333" PostTypeId="1" AcceptedAnswerId="19336" CreationDate="2016-01-07T13:11:20.707" Score="2" ViewCount="1131" Body="&lt;p&gt;I want to write a list like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. bla&#xA;2. blabla&#xA;2.1 blabla&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But having written &lt;code&gt;1.&lt;/code&gt;, &lt;code&gt;org-mode&lt;/code&gt; tries to infer what I want on the next line, which makes the numbering impossible to edit. How do I turn off this feature?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="253" LastEditDate="2016-01-07T14:43:23.633" LastActivityDate="2016-01-07T14:43:23.633" Title="How do I turn off the automatic list feature in org-mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19334" PostTypeId="2" ParentId="19325" CreationDate="2016-01-07T13:20:08.607" Score="0" Body="&lt;p&gt;Here are examples of how to customize indentation settings for &lt;code&gt;web-mode&lt;/code&gt; in your init file from the &lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;nofollow&quot;&gt;web-mode documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;HTML element offset indentation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-markup-indent-offset 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;CSS offset indentation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-css-indent-offset 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Script/code offset indentation (for JavaScript, Java, PHP, Ruby, VBScript, Python, etc.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-code-indent-offset 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By default, tag attributes are indented like this:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;img src=&quot;pix.png&quot;&#xA;     class=&quot;noborder&quot;/&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can force a fixed indentation with &lt;code&gt;web-mode-attr-indent-offset&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;img src=&quot;pix.png&quot;&#xA;  class=&quot;noborder&quot;/&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think one of these should work for you. If none of these works for you, it might be related to &lt;a href=&quot;https://github.com/fxbois/web-mode/issues/554&quot; rel=&quot;nofollow&quot;&gt;this issue&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-07T16:52:46.697" LastActivityDate="2016-01-07T16:52:46.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19335" PostTypeId="2" ParentId="19328" CreationDate="2016-01-07T14:03:57.180" Score="2" Body="&lt;p&gt;I have found a solution. Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/users/9695/erik-sj%C3%B6strand&quot;&gt;Erik Sjöstrand&lt;/a&gt; for pointing me in the right direction. I was able to find &lt;a href=&quot;https://stackoverflow.com/a/12714919/2328956&quot;&gt;this stackoverflow answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply aliasing the lambda function is enough.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun add-do-my-stuff-keybinding (config-pair)&#xA;  &quot;Add config to do-my-stuff-map&quot;&#xA; (define-key do-my-stuff-map (kbd (config-get-key config-pair))&#xA;  (defalias (intern (concat &quot;my-stuff-&quot; (config-get-name config-pair))&#xA;  `(lambda ()&#xA;    ,(format &quot;Call `do-my-stuff` for %s&quot; (config-get-name config-pair))&#xA;    (interactive)&#xA;    (do-stuff ,(config-get-name config-pair)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10556" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-01-07T14:03:57.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19336" PostTypeId="2" ParentId="19333" CreationDate="2016-01-07T14:43:10.417" Score="6" Body="&lt;p&gt;I'm not sure I completely understand what you're trying to do.  Here's your list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. item one&#xA;2. item two&#xA;2.1 subitem one&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's not how &lt;code&gt;org-mode&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html&quot;&gt;plain lists&lt;/a&gt; work.  Each plain bullet can take an unordered character (&lt;code&gt;*&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;, or &lt;code&gt;-&lt;/code&gt;), and ordered characters can be numbers (or single letters if &lt;code&gt;org-list-allow-alphabetical&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;), and the ordered characters end with either a &lt;code&gt;.&lt;/code&gt; or a &lt;code&gt;)&lt;/code&gt; (but you can set &lt;code&gt;org-plain-list-ordered-item-terminator&lt;/code&gt; to allow &lt;em&gt;only&lt;/em&gt; &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;)&lt;/code&gt; if you like).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, instead of what you've got, the list should look like the following, with &lt;code&gt;subitem one&lt;/code&gt; demoted a level:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. item one&#xA;2. item two&#xA;   1. subitem one&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can choose what form the demoted bullet takes by customizing &lt;code&gt;org-list-demote-modify-bullet&lt;/code&gt;.  Let's say you want ordered (numbered) lists to start with &lt;code&gt;1.&lt;/code&gt; and then demote to &lt;code&gt;1)&lt;/code&gt; and then demote again to &lt;code&gt;1.&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. item one&#xA;   1) subitem one&#xA;      1. subsubitem one&#xA;2. item two&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To achieve this, you could use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-list-demote-modify-bullet '((&quot;-&quot;  . &quot;+&quot;)&#xA;                                      (&quot;+&quot;  . &quot;*&quot;)&#xA;                                      (&quot;*&quot;  . &quot;-&quot;)&#xA;                                      (&quot;1.&quot;  . &quot;1)&quot;)&#xA;                                      (&quot;1)&quot;  . &quot;1.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again, if you plan to use text such as &quot;2.1&quot; within your bullet and don't want it to mess up your numbering, you can:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-plain-list-ordered-item-terminator ?\))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will mean &lt;code&gt;org&lt;/code&gt; will only allow order list bullets ending with parentheses, and will not recognize &quot;2.&quot;, &quot;2.1&quot;, etc., as bullets.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-01-07T14:43:10.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19337" PostTypeId="5" CreationDate="2016-01-07T15:07:35.870" Score="0" Body="" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-01-07T15:07:35.870" LastActivityDate="2016-01-07T15:07:35.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19338" PostTypeId="4" CreationDate="2016-01-07T15:07:35.870" Score="0" Body="Use this tag when Emacs gives you an error message you can't understand." OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-01-07T15:07:35.870" LastActivityDate="2016-01-07T15:07:35.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19339" PostTypeId="1" AcceptedAnswerId="29316" CreationDate="2016-01-07T15:12:13.073" Score="27" ViewCount="5019" Body="&lt;p&gt;Ediff interface has &lt;kbd&gt;+&lt;/kbd&gt; button, but it doesn't seem to do anything (the minibuffer invariably shows &amp;quot;nil&amp;quot; when I press it), I thought this button was meant for using both variants in the result buffer.&lt;/p&gt;&#xA;&lt;p&gt;Anyhow, the original question is: how do I make Ediff resolve a merge conflict by putting the content from both buffers A and B into buffer C (I know I can just edit C, but would hope this can be done more easily).&lt;/p&gt;&#xA;&lt;p&gt;Suppose file &lt;strong&gt;A&lt;/strong&gt; is this:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Same line&lt;/p&gt;&#xA;&lt;p&gt;Different line&lt;/p&gt;&#xA;&lt;p&gt;Same line&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;while file &lt;strong&gt;B&lt;/strong&gt; is:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Same line&lt;/p&gt;&#xA;&lt;p&gt;Another line&lt;/p&gt;&#xA;&lt;p&gt;Same line&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I want the file &lt;strong&gt;C&lt;/strong&gt;, the result of merging &lt;strong&gt;A&lt;/strong&gt; with &lt;strong&gt;B&lt;/strong&gt; to look like this:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Same line&lt;/p&gt;&#xA;&lt;p&gt;Different line&lt;/p&gt;&#xA;&lt;p&gt;Another line&lt;/p&gt;&#xA;&lt;p&gt;Same line&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-15T19:17:35.680" Title="How to use both variants in Ediff?" Tags="|ediff|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19340" PostTypeId="1" CreationDate="2016-01-07T16:01:59.457" Score="5" ViewCount="787" Body="&lt;p&gt;Is there something like &lt;code&gt;multiple-cursors&lt;/code&gt;, but that would send input into multiple buffers at once?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use case: I want to send the same shell commands to a number of virtual machines and see the output in the real time. Maybe &lt;code&gt;multi-term&lt;/code&gt; can do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. Sorry for non-descriptive tags, feel free to add more.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="7045" LastEditDate="2016-01-08T00:02:50.250" LastActivityDate="2016-01-08T10:42:09.030" Title="Send input to multiple buffers simultaneously" Tags="|shell-command|events|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19341" PostTypeId="1" AcceptedAnswerId="19343" CreationDate="2016-01-07T16:03:34.147" Score="1" ViewCount="2911" Body="&lt;p&gt;I have many files with the many of the following forms:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export function foo(payload={}) {&#xA;  return { type: bar, payload };&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to do a &lt;code&gt;regex-replace&lt;/code&gt; that removes the spaces between the brackets so that the above becomes (note the removed spaces in the return clause):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export function foo(payload={}) {&#xA;  return {type: bar, payload};&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;regex-builder&lt;/code&gt; I can get matches with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;{ \\(.*?\\) }&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I try to do any kind of &lt;code&gt;regex-replace&lt;/code&gt; across the file, with a replace pattern like &lt;code&gt;{\1}&lt;/code&gt; I get 0 matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flummoxed.&lt;/p&gt;&#xA;" OwnerUserId="8487" LastActivityDate="2016-01-07T16:52:26.053" Title="Regex to remove spaces inside braces" Tags="|regular-expressions|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19342" PostTypeId="1" AcceptedAnswerId="19357" CreationDate="2016-01-07T16:35:24.080" Score="9" ViewCount="245" Body="&lt;p&gt;I am hoping to figure out how to do a query search that will comment out a line instead of query replace.  That is, do an interactive query search, and if I say yes, comment out the line the match is on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this command exist?  If not, how would I write it?  I'm new to elisp, and don't know how to program my own functions.&lt;/p&gt;&#xA;" OwnerUserId="10702" LastEditorUserId="253" LastEditDate="2016-01-07T16:41:00.227" LastActivityDate="2016-04-23T11:09:41.713" Title="Query search and comment out line?" Tags="|search|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19343" PostTypeId="2" ParentId="19341" CreationDate="2016-01-07T16:52:26.053" Score="1" Body="&lt;p&gt;First be sure that your cursor is before the region you want to work on or that you highlight it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{ +\(.*\) +}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;worked for me.&lt;/p&gt;&#xA;" OwnerUserId="10703" LastActivityDate="2016-01-07T16:52:26.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19344" PostTypeId="1" AcceptedAnswerId="19351" CreationDate="2016-01-07T17:04:12.027" Score="9" ViewCount="1305" Body="&lt;p&gt;I want to open &lt;strong&gt;a.html&lt;/strong&gt; in a browser from emacs (v. 24.5.1, using &lt;code&gt;-Q&lt;/code&gt; [updated after comment]).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x shell-command&#xA;xdg-open a.html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works as expected, but&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eshell&#xA;$ xdg-open a.html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does not seem to do anything. There is no error message. This problem also occurs when exporting and directly opening html files from &lt;strong&gt;org-mode&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10585" LastEditorUserId="10585" LastEditDate="2016-01-07T20:10:31.743" LastActivityDate="2017-09-09T13:30:17.723" Title="Why does xdg-open not work in eshell?" Tags="|org-mode|eshell|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19345" PostTypeId="2" ParentId="19325" CreationDate="2016-01-07T19:04:52.623" Score="1" Body="&lt;p&gt;It is currently not possible to do so.&#xA;Please open an issue on github and describe very precisely the behavior you expect. Do not forget in your issue to link to a complete example on gist.&lt;/p&gt;&#xA;" OwnerUserId="197" LastActivityDate="2016-01-07T19:04:52.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19346" PostTypeId="1" AcceptedAnswerId="19348" CreationDate="2016-01-07T19:54:59.833" Score="3" ViewCount="68" Body="&lt;p&gt;It seems like some variables that I set at one place in my init file could potentially be modified by other packages that are loaded later. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One place where this has come up for me is the variable &lt;code&gt;yas-snippet-dirs&lt;/code&gt; which I set after I load &lt;code&gt;yasnippet&lt;/code&gt;, but which is then modified when I load elpy (elpy appends its own snippet directory to the list). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to ensure that all that is contained in &lt;code&gt;yas-snippet-dirs&lt;/code&gt; is &lt;code&gt;&quot;~/.emacs.d/snippets&quot;&lt;/code&gt;, I can simply make sure that I set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs '(&quot;~/.emacs.d/snippets&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after I load elpy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;strong&gt;I am wondering if there is a general way to tell packages not to modify a variable&lt;/strong&gt;. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-07T22:38:22.557" Title="Tell packages not to change certain variables" Tags="|init-file|package|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19347" PostTypeId="2" ParentId="19241" CreationDate="2016-01-07T21:38:16.107" Score="8" Body="&lt;p&gt;Okay, let me share a bit of the process of arriving at the solution to Question #1 (which should also resolve #2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to assume you know Emacs key notation and at least a little about Elisp.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;TL;DR&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;It's hard. :)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Research&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;First, let's think a bit. &lt;code&gt;helm-projectile-find-file&lt;/code&gt; is definitely calling &lt;code&gt;find-file&lt;/code&gt; or some similar function at some point. You want to substitute &lt;code&gt;elscreen-find-file&lt;/code&gt; for whatever &lt;code&gt;helm-projectile-find-file&lt;/code&gt; is using by default. With this in mind, it's time to determine what &lt;code&gt;helm-projectile-find-file&lt;/code&gt; actually does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;helm-projectile-find-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be met with the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;helm-projectile-find-file is an interactive compiled Lisp function in&#xA;  &lt;code&gt;helm-projectile.el&lt;/code&gt;.&#xA;  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(helm-projectile-find-file &amp;amp;optional ARG)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Use projectile with Helm for finding files in project&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With a prefix &lt;code&gt;ARG&lt;/code&gt; invalidates the cache first.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Navigate over to the &lt;code&gt;helm-projectile.el&lt;/code&gt; and press &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll be met with the following message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unable to find location in file&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is bad news. This means that the function you're looking for was generated using some form of metaprogramming, and the literal definition of the function is not available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this instance, I'd recommend &lt;strong&gt;reading the whole file&lt;/strong&gt;. Yes, I understand you're new to Elisp, and most of it will not make sense (esp. since Helm source is particularly difficult Elisp). But, thankfully, there are provisions to help you understand:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Docstrings&lt;/li&gt;&#xA;&lt;li&gt;Function and variable names&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After plugging through the whole file and reading these, you should have a decent idea of what should be doing what. You might even have determined that the variable &lt;code&gt;helm-projectile-file-actions&lt;/code&gt; is what's controlling the &lt;em&gt;actions&lt;/em&gt; that &lt;code&gt;helm-projectile-find-file&lt;/code&gt; takes after you select a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition of &lt;code&gt;helm-projectile-file-actions&lt;/code&gt; is a bit involved, but you can skip right to the important stuff (i.e. the actual value it holds) by doing &#xA;&lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;helm-projectile-file-actions&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((&quot;Find File&quot; . helm-find-file-or-marked)&#xA; (&quot;Find file in Dired&quot; . helm-point-file-in-dired)&#xA; (&quot;View file&quot; . view-file)&#xA; (&quot;Checksum File&quot; . helm-ff-checksum)&#xA; ...&#xA; (&quot;Add files to Dired buffer `C-c a'&quot; . helm-projectile-dired-files-add-action))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Ellipses mine)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a list of conses. The first element of each pair is clearly a string. After a few &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt;s you can determine that the second element of each pair is a function. You can probably also guess that the first element of the list is the one that is executed when you press &lt;kbd&gt;RET&lt;/kbd&gt; during a helm session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check your guess with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;debug-on-entry&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;helm-find-file-or-marked&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;. Now attempt to open a file with &lt;code&gt;helm-projectile-find-file&lt;/code&gt;, and you'll be greeted by the Emacs debugger (a topic for another time, I'm afraid), signaling that that was indeed the function that was run. &lt;kbd&gt;q&lt;/kbd&gt; to quit the debugger. To clear the instrumentation, repeat the process with &lt;code&gt;cancel-debug-on-entry&lt;/code&gt; instead of &lt;code&gt;debug-on-entry&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alright. &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;helm-find-file-or-marked&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; and skip straight to the source. You'll be greeted by a long and complicated function. However, you don't necessarily need to read the entire function, you just need to know what you're looking for: something to do with &lt;code&gt;find-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;32 lines down the function&lt;/strong&gt; you'll see this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapc 'find-file-noselect (cdr marked))&#xA;(find-file (car marked))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code is run when you select multiple helm candidates at once, using &lt;kbd&gt;C-SPC&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;44 lines down the function&lt;/strong&gt; you'll also see this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(find-file-at-point&#xA;      &amp;lt;confusing garbage here&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code is run when you are acting on only one candidate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both &lt;code&gt;find-file&lt;/code&gt; and &lt;code&gt;find-file-at-point&lt;/code&gt; are essentially synonymous in this usage. They both represent the point where helm hands the file path off to Emacs builtins to actually open the file. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Execution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Copy the entire &lt;code&gt;helm-find-file-or-marked&lt;/code&gt; definition into your init file, rename it &lt;code&gt;my/helm-elscreen-find-file-or-marked&lt;/code&gt; and replace both &lt;code&gt;find-file&lt;/code&gt; and &lt;code&gt;file-file-at-point&lt;/code&gt; with &lt;code&gt;elscreen-find-file&lt;/code&gt;. (&lt;code&gt;find-file-noselect&lt;/code&gt; as well, depending on what you're trying to achieve)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you've produced a helm action function that opens the given candidate with &lt;code&gt;elscreen-find-file&lt;/code&gt;. The next step is to climb back up the levels of abstraction, and make a helm command that uses this function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're going to need to go back to &lt;code&gt;helm-projectile.el&lt;/code&gt;. Let me just extract the relevant bits here:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar helm-source-projectile-files-list&#xA;  (helm-build-in-buffer-source &quot;Projectile files&quot;&#xA;    :data (lambda ()&#xA;             (condition-case nil&#xA;                (projectile-current-project-files)&#xA;              (error nil)))&#xA;    :fuzzy-match helm-projectile-fuzzy-match&#xA;    :coerce 'helm-projectile-coerce-file&#xA;    :keymap helm-projectile-find-file-map&#xA;    :help-message 'helm-ff-help-message&#xA;    :mode-line helm-read-file-name-mode-line-string&#xA;    :action helm-projectile-file-actions&#xA;    )&#xA;  &quot;Helm source definition for Projectile files.&quot;)&#xA;&#xA;(defvar helm-source-projectile-files-and-dired-list&#xA;  '(helm-source-projectile-dired-files-list&#xA;    helm-source-projectile-files-list))&#xA;&#xA;(helm-projectile-command &quot;find-file&quot; helm-source-projectile-files-and-dired-list &quot;Find file: &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now what are you going to need to do?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a new source &lt;code&gt;my/helm-source-projectile-elscreen-files-list&lt;/code&gt;, using our new action&lt;/li&gt;&#xA;&lt;li&gt;Create a new &lt;code&gt;helm-projectile&lt;/code&gt; command with that source&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my/helm-source-projectile-elscreen-files-list&#xA;  (helm-build-in-buffer-source &quot;Projectile files&quot;&#xA;    :data (lambda ()&#xA;             (condition-case nil&#xA;                (projectile-current-project-files)&#xA;              (error nil)))&#xA;    :fuzzy-match helm-projectile-fuzzy-match&#xA;    :coerce 'helm-projectile-coerce-file&#xA;    :keymap helm-projectile-find-file-map&#xA;    :help-message 'helm-ff-help-message&#xA;    :mode-line helm-read-file-name-mode-line-string&#xA;    :action (cons my/helm-elscreen-find-file-or-marked &#xA;                  helm-projectile-file-actions))&#xA;  &quot;Helm source definition for Projectile files.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(helm-projectile-command &quot;elscreen-find-file&quot; 'my/helm-source-projectile-elscreen-files-list &quot;Find file in projects (elscreen): &quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've created a &lt;a href=&quot;https://gist.github.com/PythonNut/b800d3e4dad022658c1d&quot;&gt;gist&lt;/a&gt; will the finished code.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Disclaimer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;There are more efficient ways to do this. Namely, instead of copying the definition of &lt;code&gt;helm-find-file-or-marked&lt;/code&gt;, you could instead override the functions programmatically using &lt;code&gt;cl-letf&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/helm-elscreen-find-file-or-marked (candidate)&#xA;  (cl-letf (((symbol-function #'find-file) #'elscreen-find-file)&#xA;            ((symbol-function #'find-file-noselect) #'elscreen-find-file)&#xA;            ((symbol-function #'find-file-at-point) #'elscreen-find-file))&#xA;    (helm-find-file-or-marked)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this is reasonablely advanced ELisp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This thing is long, and probably contains errors. But I'm hoping there will be at least a few useful tidbits that will help you understand how I produced my answer, and how you can go about answering some of your questions in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep at it and don't give up! :)&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-01-08T00:55:20.663" LastActivityDate="2016-01-08T00:55:20.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19348" PostTypeId="2" ParentId="19346" CreationDate="2016-01-07T22:38:22.557" Score="4" Body="&lt;p&gt;No, there is no &quot;&lt;em&gt;general way to tell packages not to modify a variable&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or put differently: The way to tell packages not to modify a variable is for it to be a &lt;strong&gt;user option&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if I understand right, &lt;code&gt;yas-snippet-dirs&lt;/code&gt; &lt;em&gt;is&lt;/em&gt; a user option.  If so:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Packages should, in general, &lt;strong&gt;not&lt;/strong&gt; change its value, once it has been set. &#xA;The general rule is that user options are for &lt;strong&gt;users&lt;/strong&gt; to customize.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If they do so then presumably it is because they &lt;strong&gt;must&lt;/strong&gt; or they have some other very good reason.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For #1: Contact the package maintainer if you think this is a bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For #2: Contact the package maintainer if this is not &lt;em&gt;documented extremely prominently&lt;/em&gt;. Case #2 should be a rare exception.  It really needs good justification, which should be well documented.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-07T22:38:22.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19349" PostTypeId="2" ParentId="19340" CreationDate="2016-01-08T00:17:06.287" Score="1" Body="&lt;p&gt;If you have to stay in emacs, then the two options I've tried are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(process-send-string &quot;my-vm-1&quot; &quot;command to vm&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where I'd change my-vm-1 to my-vm-2 and so on in a macro. The other option I use now is to run &lt;a href=&quot;https://www.gnu.org/software/parallel/parallel_tutorial.html#Running-the-same-commands-on-all-hosts&quot; rel=&quot;nofollow&quot;&gt;gnu-parallel&lt;/a&gt; via &lt;code&gt;M-x !&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more recent solution for VMs to use their own mgmt interface to send commands to to multiple instances. This may turn out to be the most robust in the long-run especially if you rely on nagios-type remote management tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ADDENDUM:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Would gnu-parallel be able to jump these multiple hops? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't see why not. At its most simplest, just invoke another gnu-parallel command on each remote VM. If you need to customize some portion of your command to each VM, look into gnu-parallel's --hostgroup option under &lt;a href=&quot;https://www.gnu.org/software/parallel/parallel_tutorial.html#Sshlogin&quot; rel=&quot;nofollow&quot;&gt;sshlogin&lt;/a&gt;. &lt;a href=&quot;https://gist.github.com/manuquentin/5d514e43d28f592afb4b#file-gistfile1-txt&quot; rel=&quot;nofollow&quot;&gt;This script&lt;/a&gt; might give you ideas on how to loop through them.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You realize all this is far from tweaking with emacs buffers but not all that different from Tramp's multi-hops. Maybe a custom external method in Tramp can hop into each container, run a custom command, and return the results as a log buffer back to emacs.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-01-08T10:42:09.030" LastActivityDate="2016-01-08T10:42:09.030" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19351" PostTypeId="2" ParentId="19344" CreationDate="2016-01-08T02:54:21.160" Score="5" Body="&lt;p&gt;Set &lt;code&gt;process-connection-type&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. To be honest I don't understand why &lt;code&gt;xdg-open&lt;/code&gt; doesn't work when that variable has the value &lt;code&gt;t&lt;/code&gt; and I also can't remember how I learned that changing the value let me use &lt;code&gt;xdg-open&lt;/code&gt; from Emacs. (If someone knows, I'd love to hear about it.)&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-01-08T02:54:21.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19352" PostTypeId="1" AcceptedAnswerId="19366" CreationDate="2016-01-08T03:14:54.700" Score="2" ViewCount="2735" Body="&lt;p&gt;&lt;strong&gt;first question&lt;/strong&gt;:  is how to adjust colors of ediff-revision output, tried various versions - no luck:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Customizing colors used in diff mode&#xA;(load-library &amp;quot;ediff&amp;quot;)&#xA;(setq ediff-window-setup-function 'ediff-setup-windows-plain)&#xA;(setq ediff-split-window-function 'split-window-horizontally)&#xA;&#xA;(defun update-diff-colors ()&#xA;  &amp;quot;update the colors for diff faces&amp;quot;&#xA;  (set-face-attribute 'diff-added nil&#xA;                      :foreground &amp;quot;white&amp;quot; :background &amp;quot;blue&amp;quot;)&#xA;  (set-face-attribute 'diff-removed nil&#xA;                      :foreground &amp;quot;white&amp;quot; :background &amp;quot;red3&amp;quot;)&#xA;  (set-face-attribute 'diff-changed nil&#xA;                      :foreground &amp;quot;white&amp;quot; :background &amp;quot;purple&amp;quot;))&#xA;&#xA;(eval-after-load &amp;quot;diff-mode&amp;quot;&#xA;  '(update-diff-colors))&#xA;&#xA;;; Usage: emacs -diff file1 file2&#xA;(defun command-line-diff (switch)&#xA;      (let ((file1 (pop command-line-args-left))&#xA;            (file2 (pop command-line-args-left)))&#xA;        (ediff file1 file2)))&#xA;&#xA;(add-to-list 'command-switch-alist '(&amp;quot;diff&amp;quot; . command-line-diff))&#xA;&#xA;;; turn off whitespace checking:&#xA;(setq ediff-diff-options &amp;quot;-w&amp;quot;)&#xA;&#xA;(provide 'ediff-settings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;second&lt;/strong&gt;: How to merge the changes from left to right but only a selected portion / changed block?&lt;/p&gt;&#xA;" OwnerUserId="10547" LastEditorUserId="2418" LastEditDate="2020-06-20T02:04:18.493" LastActivityDate="2020-06-20T02:04:18.493" Title="ediff - change colors and how to merge code" Tags="|colors|ediff|diff-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="19353" PostTypeId="2" ParentId="19352" CreationDate="2016-01-08T04:56:24.257" Score="4" Body="&lt;p&gt;Move to the coloured text you're interested in, and type &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;=&lt;/kbd&gt; to view details of the character at point, including any faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select the face you're interested in, then select &quot;customize this face&quot;, make the desired changes, and save.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-01-08T04:56:24.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19354" PostTypeId="1" CreationDate="2016-01-08T06:47:06.443" Score="3" ViewCount="358" Body="&lt;p&gt;Recently I upgraded my emacs from 24 to 25 and now when I do a org-clock-display command in one of my org files it only shows me the total for the current year, not previous years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to adjust the range in which org-clock-display will check?&lt;/p&gt;&#xA;" OwnerUserId="9463" LastActivityDate="2016-02-07T18:59:59.120" Title="how to expand the range of org-clock-display" Tags="|org-mode|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19355" PostTypeId="1" AcceptedAnswerId="19363" CreationDate="2016-01-08T07:04:32.953" Score="3" ViewCount="676" Body="&lt;p&gt;When using Org-mode 8.2.10, setting the &lt;code&gt;header-args&lt;/code&gt; property does not seem to work as expected with  Common Lisp code blocks. The following does not tangle the code blocks in the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :tangle yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Specifying the language explicitly, however, does work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args:lisp :tangle yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html#Header-arguments-in-Org-mode-properties&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;, &lt;code&gt;header-args&lt;/code&gt; without a language specifier should work for all code blocks, not just those for Emacs Lisp (which is presumably the default, and what I have working in my init file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this expected behavior, or a subtle bug?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-01-08T15:49:10.403" Title="Buffer-local tangle in org-mode" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19356" PostTypeId="1" CreationDate="2016-01-08T08:40:27.910" Score="3" ViewCount="3061" Body="&lt;p&gt;Lets say I'm already in emacs and I need to open some obscure file (long complicated path) that I rarely ever edit (so its not in my recent files list) - what is the correct way to do this using spacemacs shortcuts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have to use helm and manually type the path to the file. Id rather have some sort of browser where I could look at directory structures and select folders to &quot;cd&quot; into&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, lets say I need to create a brand new file in some obscure directory. Again, what is the correct spacemacs way to create this new file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty new to emacs so the way that I'm currently doing this things (manually typing paths in helm) feels very slow and I'm mostly wondering whether this is common or whether theres another way to do these things that I'm not aware of&lt;/p&gt;&#xA;" OwnerUserId="10550" LastEditorUserId="10550" LastEditDate="2016-01-08T17:48:10.273" LastActivityDate="2016-01-08T17:48:10.273" Title="Spacemacs - opening and creating files" Tags="|files|spacemacs|" AnswerCount="0" CommentCount="8" ClosedDate="2016-01-08T18:53:18.850" ContentLicense="CC BY-SA 3.0" />
  <row Id="19357" PostTypeId="2" ParentId="19342" CreationDate="2016-01-08T10:35:19.353" Score="1" Body="&lt;pre&gt;&lt;code&gt;(defun my-comment-matching-line ()&#xA;  (interactive &quot;*&quot;)&#xA;  (call-interactively 'search-forward)&#xA;  (beginning-of-line)&#xA;  ;; don't comment the region maybe&#xA;  (push-mark)&#xA;  (comment-line 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Should comment-line not be available, here from a recent newcomment.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comment-line (n)&#xA;  &quot;Comment or uncomment current line and leave point after it.&#xA;With positive prefix, apply to N lines including current one.&#xA;With negative prefix, apply to -N lines above.  Also, further&#xA;consecutive invocations of this command will inherit the negative&#xA;argument.&#xA;&#xA;If region is active, comment lines in active region instead.&#xA;Unlike `comment-dwim', this always comments whole lines.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (if (use-region-p)&#xA;      (comment-or-uncomment-region&#xA;       (save-excursion&#xA;         (goto-char (region-beginning))&#xA;         (line-beginning-position))&#xA;       (save-excursion&#xA;         (goto-char (region-end))&#xA;         (line-end-position)))&#xA;    (when (and (eq last-command 'comment-line-backward)&#xA;               (natnump n))&#xA;      (setq n (- n)))&#xA;    (let ((range&#xA;           (list (line-beginning-position)&#xA;                 (goto-char (line-end-position n)))))&#xA;      (comment-or-uncomment-region&#xA;       (apply #'min range)&#xA;       (apply #'max range)))&#xA;    (forward-line 1)&#xA;    (back-to-indentation)&#xA;    (unless (natnump n) (setq this-command 'comment-line-backward))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2016-01-24T09:32:27.270" LastActivityDate="2016-01-24T09:32:27.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19358" PostTypeId="1" AcceptedAnswerId="19359" CreationDate="2016-01-08T11:28:13.743" Score="6" ViewCount="395" Body="&lt;p&gt;My &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/message/Various-Message-Variables.html#index-message_002ddirectory&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;message-directory&lt;/code&gt;&lt;/a&gt; is &lt;code&gt;~/.emacs.d/mail&lt;/code&gt;, this is where &lt;a href=&quot;http://gnus.org/&quot; rel=&quot;noreferrer&quot;&gt;Gnus&lt;/a&gt; stores all my mail. Suppose I have a directory &lt;code&gt;misc&lt;/code&gt; that contains some email in &lt;code&gt;nnml&lt;/code&gt; format. I create a Group &lt;code&gt;mail.misc&lt;/code&gt;, move directory &lt;code&gt;misc&lt;/code&gt; under &lt;code&gt;~/.emacs.d/mail/misc&lt;/code&gt;. But Gnus doesn't see my mail automatically, even though the files, corresponding to articles, exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make Gnus see my email under the corresponding Group? I think it has to do with &lt;code&gt;.overview&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-04-30T17:12:15.790" Title="Gnus doesn't see mail, even though files are there" Tags="|gnus|email|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19359" PostTypeId="2" ParentId="19358" CreationDate="2016-01-08T11:28:13.743" Score="5" Body="&lt;p&gt;If Gnus doesn't see some or all mail in your mail directory, even though the files are there, it may be for 2 reasons.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You miss or have corrupted an &lt;code&gt;.overview&lt;/code&gt; file. An &lt;code&gt;.overview&lt;/code&gt; file is called a &lt;a href=&quot;http://heim.ifi.uio.no/%7Elarsi/notes/nov-faq.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;NOV database&lt;/a&gt;, Gnus uses this file to track your mail.&lt;/p&gt;&#xA;&lt;p&gt;Call &lt;code&gt;nnml-generate-nov-databases-directory&lt;/code&gt;, enter directory containing your mail. Or, call &lt;code&gt;nnml-generate-nov-databases&lt;/code&gt; to update all mail directories. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Mail-Spool.html#Mail-Spool&quot; rel=&quot;nofollow noreferrer&quot;&gt;Section “Mail Spool”&lt;/a&gt; of Gnus manual.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some of your articles are hidden.&lt;/p&gt;&#xA;&lt;p&gt;First try &lt;kbd&gt;T S&lt;/kbd&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Thread-Commands.html#index-gnus_002dsummary_002dshow_002dall_002dthreads&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;gnus-summary-show-all-threads&lt;/code&gt;&lt;/a&gt;). If that doesn't work, show all &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Unread-Articles.html#index-gnus_002ddormant_002dmark&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;dormant&lt;/em&gt;&lt;/a&gt; articles with &lt;kbd&gt;/ D&lt;/kbd&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Limiting.html#index-gnus_002dsummary_002dlimit_002dinclude_002ddormant&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;gnus-summary-limit-include-dormant&lt;/code&gt;&lt;/a&gt;). Remove dormant status with &lt;kbd&gt;M c&lt;/kbd&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Setting-Marks.html#index-gnus_002dsummary_002dclear_002dmark_002dforward&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;gnus-summary-clear-mark-forward&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3972" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-04-30T17:12:15.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19360" PostTypeId="1" AcceptedAnswerId="19361" CreationDate="2016-01-08T11:42:37.030" Score="2" ViewCount="498" Body="&lt;p&gt;&lt;kbd&gt;B m&lt;/kbd&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Mail-Group-Commands.html#Mail-Group-Commands&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-summary-move-article&lt;/code&gt;&lt;/a&gt;) in Gnus &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Summary-Buffer.html&quot; rel=&quot;nofollow&quot;&gt;summary mode&lt;/a&gt; allows to move an article from one &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Group-Buffer.html#Group-Buffer&quot; rel=&quot;nofollow&quot;&gt;group&lt;/a&gt; to another. But how do I move not a single, but tens or hundreds of articles from one group to another? Using keyboard macros seems unidiomatic and error-prone.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-03-08T13:11:10.763" Title="How to move multiple articles from one Gnus group to another?" Tags="|gnus|email|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19361" PostTypeId="2" ParentId="19360" CreationDate="2016-01-08T11:42:37.030" Score="1" Body="&lt;p&gt;What you need is &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/gnus/Setting-Process-Marks.html#Setting-Process-Marks&quot; rel=&quot;nofollow&quot;&gt;process marks&lt;/a&gt;. Mark all articles you need to move from one group to another. For example, you can simply mark all articles you want to move by manually pressing &lt;kbd&gt;#&lt;/kbd&gt; (&lt;code&gt;gnus-summary-mark-as-processable&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then after you marked all needed articles, press &lt;kbd&gt;B m&lt;/kbd&gt; and move all articles to the group you want.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-01-08T11:42:37.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19362" PostTypeId="2" ParentId="16935" CreationDate="2016-01-08T15:01:23.677" Score="6" Body="&lt;p&gt;Spacemacs uses the concept of &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUMENTATION.org#toggles&quot; rel=&quot;noreferrer&quot;&gt;toggles&lt;/a&gt; to enable/disable minor-modes per buffer. Toggles are grouped under &lt;kbd&gt;SPC t&lt;/kbd&gt; and &lt;kbd&gt;SPC T&lt;/kbd&gt;, but they only switch for the current buffer. You can temporarily disable smartparens for the current buffer by pressing &lt;kbd&gt;SPC t p&lt;/kbd&gt; (&lt;code&gt;spacemacs/toggle-smartparens&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you want to disable smartparens for every buffer permanently, put &lt;code&gt;spacemacs/toggle-smartparens-globally-off&lt;/code&gt; in your &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; function. To do that, press &lt;kbd&gt;SPC f e d&lt;/kbd&gt;, this will open your &lt;code&gt;.spacemacs&lt;/code&gt; file. Then make sure you have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA;This function is called at the very end of Spacemacs initialization after&#xA;layers configuration. You are free to put any user code.&quot;&#xA;  ; other code&#xA;  (spacemacs/toggle-smartparens-globally-off)&#xA;  ; other code&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-01-08T15:01:23.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19363" PostTypeId="2" ParentId="19355" CreationDate="2016-01-08T15:07:55.663" Score="4" Body="&lt;p&gt;You need to refresh/activate the &lt;code&gt;#+PROPERTY:&lt;/code&gt; line by invoking &lt;code&gt;C-c C-c&lt;/code&gt; with point somehwhere in the line &lt;code&gt;#+PROPERTY: header-args :tangle yes&lt;/code&gt;. After that, you should be able to call &lt;code&gt;org-babel-tangle&lt;/code&gt; and have it work as expected!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not necessary if you use a property drawer, but is for the &lt;code&gt;#+PROPERTY:&lt;/code&gt; line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that this applies if you decide to change the &lt;code&gt;#+PROPERTY:&lt;/code&gt; line too. If you change the line to &lt;code&gt;#+PROPERTY: header-args :tangle no&lt;/code&gt;, those changes will not be registered even if you save the buffer. You will need to call &lt;code&gt;C-c C-c&lt;/code&gt; again with point on the line for the setup to be refreshed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure why &lt;code&gt;#+PROPERTY: header-args:lisp :tangle yes&lt;/code&gt; worked for you when the other didn't, but I assume that things somehow got refreshed in the meantime, making it seem like one worked and one didn't.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-08T15:49:10.403" LastActivityDate="2016-01-08T15:49:10.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19364" PostTypeId="2" ParentId="3747" CreationDate="2016-01-08T15:18:01.840" Score="34" Body="&lt;p&gt;On November 23 &lt;a href=&quot;https://emacs.stackexchange.com/a/3756/3972&quot;&gt;syl20bnr&lt;/a&gt; added a new toggle called &lt;code&gt;spacemacs/toggle-truncate-lines&lt;/code&gt;, available on &lt;kbd&gt;SPC t l&lt;/kbd&gt;. Another toggle you may also find useful is &lt;code&gt;spacemacs/toggle-visual-line-navigation&lt;/code&gt;, available on &lt;kbd&gt;SPC t L&lt;/kbd&gt;. See &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/commit/99fdb754d1f5727af1be8e50ff81732a4c318bdd&quot; rel=&quot;noreferrer&quot;&gt;Github commit&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how your &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; can look like to enable both toggles:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA;This function is called at the very end of Spacemacs initialization after&#xA;layers configuration. You are free to put any user code.&quot;&#xA;  (spacemacs/toggle-truncate-lines-on)&#xA;  ;; Visual line navigation for textual modes&#xA;  (add-hook 'text-mode-hook 'spacemacs/toggle-visual-line-navigation-on)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't know where &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; is, it's in your &lt;code&gt;.spacemacs&lt;/code&gt; file, available by pressing &lt;kbd&gt;SPC f e d&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html&quot; rel=&quot;noreferrer&quot;&gt;hook&lt;/a&gt; for &lt;code&gt;spacemacs/toggle-visual-line-navigation-on&lt;/code&gt; is because it doesn't work globally otherwise.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-01-08T15:18:01.840" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19365" PostTypeId="1" CreationDate="2016-01-08T15:29:31.267" Score="2" ViewCount="708" Body="&lt;p&gt;Is there a function to parse the text around the cursor and return the date if found?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., if I'm in a buffer with the cursor in the middle of this text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2015-12-01 First day of new exercise program&#xA;2016-01-08 Hit a milestone: ran a 7-minute-mile&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to use emacs to parse the dates and tell me the elapsed time between them, is there a function to help me do that?&#xA;Ideally it would handle full ISO timestamps also, e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2016-01-08T08:13:55-0700 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and of course other date formats.  Yeah - I know - it gets tricky, might need some hinting on formats, etc....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like &lt;code&gt;date-to-time&lt;/code&gt; can parse ISO strings, and &lt;code&gt;parse-time-string&lt;/code&gt; can parse some formats, but not ISO.  But are there any functions to pick the right text from around the cursor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See e.g. &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_parse_time.html&quot; rel=&quot;nofollow&quot;&gt;Emacs Lisp: Parsing Date Time&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8577" LastActivityDate="2016-01-08T15:29:31.267" Title="How to parse calendar date or timestamp at cursor from elisp?" Tags="|calendar|parse-time|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19366" PostTypeId="2" ParentId="19352" CreationDate="2016-01-08T16:43:59.260" Score="3" Body="&lt;p&gt;&lt;strong&gt;first question:&lt;/strong&gt;&#xA;You can custom a face like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-faces&#xA; '(ediff-current-diff-A ((t (:foreground &quot;White&quot; :background &quot;brown&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the ediff faces are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ediff-current-diff-A &#xA;ediff-current-diff-Ancestor&#xA;ediff-current-diff-B &#xA;ediff-current-diff-C &#xA;ediff-even-diff-A &#xA;ediff-even-diff-Ancestor &#xA;ediff-even-diff-B &#xA;ediff-even-diff-C &#xA;ediff-fine-diff-A &#xA;ediff-fine-diff-Ancestor&#xA;ediff-fine-diff-B &#xA;ediff-fine-diff-C &#xA;ediff-odd-diff-A &#xA;ediff-odd-diff-Ancestor&#xA;ediff-odd-diff-B&#xA;ediff-odd-diff-C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;second question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where you are on the changed region you can use &lt;code&gt;a&lt;/code&gt; or &lt;code&gt;b&lt;/code&gt; to copy the region &lt;code&gt;from left to right&lt;/code&gt; or &lt;code&gt;from right to left&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-01-08T16:43:59.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19369" PostTypeId="2" ParentId="19354" CreationDate="2016-01-08T17:28:46.380" Score="3" Body="&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I've now tried &lt;strong&gt;org-mode 8.3.2&lt;/strong&gt;. There &lt;code&gt;org-mode-display&lt;/code&gt;is rewritten. See the new documentation of &lt;code&gt;org-mode-display&lt;/code&gt;. If you run &lt;code&gt;org-mode-display&lt;/code&gt; with two prefix args then you can input the time range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the range you have the following choices (just try tab):&#xA;&quot;today&quot; &quot;yesterday&quot; &quot;thisweek&quot; &quot;lastweek&quot;&#xA;               &quot;thismonth&quot; &quot;lastmonth&quot; &quot;thisyear&quot; &quot;lastyear&quot;&#xA;               &quot;interactive&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize the default range with the option &lt;code&gt;org-clock-display-default-range&lt;/code&gt;. The original value of this option is &lt;code&gt;thisyear&lt;/code&gt; which explains your results.&#xA;If you set its value to &lt;code&gt;untilnow&lt;/code&gt; you get the summation without lower bound.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The following text regards org-mode 8.2.X only.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note at first that I have GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-11-10 with org-mode 8.2.10. There, I cannot reconstruct the effect that time is summed only over the current year.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now, to your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is it possible to adjust the range in which org-clock-display will check?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I found that &lt;code&gt;(org-clock-sum)&lt;/code&gt; is hard-wired in &lt;code&gt;(org-clock-display)&lt;/code&gt; without the optional &lt;code&gt;tstart&lt;/code&gt; and &lt;code&gt;tend&lt;/code&gt; arguments of &lt;code&gt;org-clock-sum&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, some hack is required to accept clock intervals in &lt;code&gt;org-clock-display&lt;/code&gt;.&#xA;The following &lt;strong&gt;new&lt;/strong&gt; command &lt;code&gt;org-clock-interval-display&lt;/code&gt; asks for a start and an end time for summing the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, the &lt;code&gt;total-only&lt;/code&gt; option in &lt;code&gt;org-clock-display&lt;/code&gt; is broken. So I did remove it in &lt;code&gt;org-clock-interval-display&lt;/code&gt;. One can add it without problems via &lt;code&gt;current-prefix-arg&lt;/code&gt; in the &lt;code&gt;interactive&lt;/code&gt;-list in &lt;code&gt;org-clock-interval-display&lt;/code&gt; if it is fixed in &lt;code&gt;org-clock-display&lt;/code&gt;. But, before you do that you should rather issue a feature request for adding optional interactive &lt;code&gt;tstart&lt;/code&gt; and &lt;code&gt;tstop&lt;/code&gt; arguments to &lt;code&gt;org-clock-display&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-current-fset (backup symbol function &amp;amp;rest body)&#xA;  &quot;Save SYMBOL's function definition in BACKUP,&#xA;set it temporarily to FUNCTION, and execute BODY.&#xA;After the execution of BODY the function definition of SYMBOL is restored.&quot;&#xA;  (declare (debug (sexp sexp function-form body)) (indent 3))&#xA;  `(let ((,backup (symbol-function ',symbol)))&#xA;     (unwind-protect&#xA;     (progn&#xA;       (fset ',symbol ,function)&#xA;       ,@body)&#xA;       (fset ',symbol ,backup))))&#xA;&#xA;(defun org-clock-interval-display (tstart tend)&#xA;  &quot;Like `org-clock-display' but considers tstart and tstop for `org-clock-sum'.&quot;&#xA;  (interactive (list (org-read-date t t nil &quot;Start time:&quot;)&#xA;             (org-read-date t t nil &quot;Stop time:&quot;)))&#xA;  (with-current-fset --org-clock-sum org-clock-sum (lambda () (funcall --org-clock-sum tstart tend))&#xA;    (org-clock-display)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-08T18:19:10.570" LastActivityDate="2016-01-08T18:19:10.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19370" PostTypeId="1" CreationDate="2016-01-08T17:46:26.107" Score="1" ViewCount="1291" Body="&lt;p&gt;I recently uninstalled emacs 24.3 and then installed 24.5.1, because I was not able to update Spacemacs in 24.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now .png images are not displaying, including the spacemacs logo that should appear on the homepage, as well as images in .org files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a library I am missing?  I am on Ubuntu.&lt;/p&gt;&#xA;" OwnerUserId="10714" LastEditorUserId="10714" LastEditDate="2016-01-08T17:56:45.970" LastActivityDate="2016-01-08T17:56:45.970" Title=".png's not displaying" Tags="|spacemacs|images|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19371" PostTypeId="5" CreationDate="2016-01-08T18:24:45.343" Score="0" Body="&lt;p&gt;Emacs can start in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server&quot; rel=&quot;nofollow noreferrer&quot;&gt;daemon mode&lt;/a&gt;: it starts without any user interface, only with a &lt;a href=&quot;/questions/tagged/server&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;server&amp;#39;&quot; rel=&quot;tag&quot;&gt;server&lt;/a&gt;, and you can open files and windows by contacting the server with the &lt;a href=&quot;/questions/tagged/emacsclient&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;emacsclient&amp;#39;&quot; rel=&quot;tag&quot;&gt;emacsclient&lt;/a&gt; utility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do not use this tag for questions about other kinds of daemons! Use a tag that is related to what the daemon is for.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="25" LastEditDate="2018-06-11T22:50:14.187" LastActivityDate="2018-06-11T22:50:14.187" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19372" PostTypeId="4" CreationDate="2016-01-08T18:24:45.343" Score="0" Body="Starting Emacs in daemon mode" OwnerUserId="262" LastEditorUserId="25" LastEditDate="2018-06-11T22:50:14.187" LastActivityDate="2018-06-11T22:50:14.187" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19373" PostTypeId="1" AcceptedAnswerId="19377" CreationDate="2016-01-08T19:26:38.787" Score="3" ViewCount="165" Body="&lt;p&gt;Like if you have a buffer containing &lt;code&gt;hel!&lt;/code&gt; and paste in &lt;code&gt;lo world&lt;/code&gt; after the third letter you get 4 and 11 respectively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has many state variables, are there any that could help me in this case?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2016-01-08T20:16:26.780" Title="Is it possible to get the start and end points in the buffer in which text is pasted?" Tags="|copy-paste|point|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19374" PostTypeId="5" CreationDate="2016-01-08T19:29:30.313" Score="0" Body="&lt;p&gt;Electric Pair mode, a global minor mode, provides a way to easily insert matching delimiters. Whenever you insert an opening delimiter, the matching closing delimiter is automatically inserted as well, leaving point between the two. To toggle Electric Pair mode, type &lt;code&gt;M-x electric-pair-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10430" LastEditorUserId="10430" LastEditDate="2016-01-08T22:25:44.953" LastActivityDate="2016-01-08T22:25:44.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19375" PostTypeId="4" CreationDate="2016-01-08T19:29:30.313" Score="0" Body="Electric Pair mode, a global minor mode, provides a way to easily insert matching delimiters. Whenever you insert an opening delimiter, the matching closing delimiter is automatically inserted as well, leaving point between the two. To toggle Electric Pair mode, type `M-x electric-pair-mode`." OwnerUserId="10430" LastEditorUserId="10430" LastEditDate="2016-01-08T22:25:41.290" LastActivityDate="2016-01-08T22:25:41.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19376" PostTypeId="2" ParentId="19373" CreationDate="2016-01-08T19:38:26.800" Score="1" Body="&lt;p&gt;Here's a quick snippet I came up with that does what you need on brief testing.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/get-yanked-text-boundaries ()&#xA;  &quot;Yank and return the start and end boundaries of the yanked text in the buffer.&quot;&#xA;  (interactive)&#xA;  (let ((start (point))&#xA;        end)&#xA;    (call-interactively #'yank)&#xA;    (setq end (point))&#xA;    (message (format &quot;Start: %0d End: %0d&quot; start end))&#xA;    (list start end)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-08T19:38:26.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19377" PostTypeId="2" ParentId="19373" CreationDate="2016-01-08T20:16:26.780" Score="6" Body="&lt;p&gt;These are just point and mark right after the yank command. Just see the doc for &lt;code&gt;yank&lt;/code&gt; or &lt;code&gt;yank-pop&lt;/code&gt;. If you want to conserve these positions you could advice yank. Make sure that you save these values as markers or in buffer-local variables! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more thing: If you want to see these values just once you can call &lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(mark)&lt;/code&gt; and &lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(point)&lt;/code&gt; right after the yank command.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-01-08T20:16:26.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19379" PostTypeId="1" AcceptedAnswerId="31476" CreationDate="2016-01-08T22:15:07.927" Score="5" ViewCount="1474" Body="&lt;p&gt;I would like to load TODO objects from individual files using org-babel and elisp. I have a working snippet that produces this output.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS: import_file&#xA;:   * TODO Go to grocery store&#xA;:   * TODO Go to bank&#xA;:   * TODO Go to dry cleaners&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:&lt;/code&gt; in the output causes org-mode not to recognize the TODO keywords. I want the output to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS: import_file&#xA;* TODO Go to grocery store&#xA;* TODO Go to bank&#xA;* TODO Go to dry cleaners&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an org-babel configuration item that accomplishes this? If not, is there another way to accomplish this without modifying org-babel?&lt;/p&gt;&#xA;" OwnerUserId="10665" LastActivityDate="2017-03-15T05:41:03.873" Title="How to customize org-babel RESULTS" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19381" PostTypeId="2" ParentId="2173" CreationDate="2016-01-09T06:34:44.973" Score="23" Body="&lt;p&gt;The NEWS file for Emacs 25 is available at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-25&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-25&lt;/a&gt; - it currently has about 400 items. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it's closer to release now, here is a (subjective) list of some of the major features included so far - items are subject to change. There are other features that might make it in also (x-widgets? someone more involved might know of the major features being worked on):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Improved rectangle editing - corners can go past EOL, &lt;strong&gt;C-x C-x&lt;/strong&gt; cycles through the corners, &lt;code&gt;string-rectangle&lt;/code&gt; provides a dynamic preview of results of inserting a string before all lines of the rectangle&lt;/li&gt;&#xA;&lt;li&gt;New command &lt;code&gt;describe-symbol&lt;/code&gt; - works for functions, variables, faces, etc., bound to &lt;strong&gt;C-h o&lt;/strong&gt; by default&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;list-packages&lt;/code&gt; loads list of packages asynchronously in the background&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;C-h l&lt;/strong&gt; shows commands run also&lt;/li&gt;&#xA;&lt;li&gt;New package Project provides generic infrastructure for dealing with projects&lt;/li&gt;&#xA;&lt;li&gt;New package Xref replaces etags front-end and UI - &lt;strong&gt;M-,&lt;/strong&gt; to return to previous location&lt;/li&gt;&#xA;&lt;li&gt;New command &lt;code&gt;comment-line&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;New library &lt;code&gt;seq&lt;/code&gt; for sequence manipulation functions - work on lists, strings, and vectors&lt;/li&gt;&#xA;&lt;li&gt;New library &lt;code&gt;map&lt;/code&gt; works on alists, hash-tables and arrays&lt;/li&gt;&#xA;&lt;li&gt;Support for dynamically loaded binary modules (e.g. .so files for POSIX)&lt;/li&gt;&#xA;&lt;li&gt;Successive single char deletions are collapsed in the undo-log&lt;/li&gt;&#xA;&lt;li&gt;New macro &lt;code&gt;define-advice&lt;/code&gt;   &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And some other interesting things: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Improved package dependency management - packages which were installed as dependencies are marked as such&lt;/li&gt;&#xA;&lt;li&gt;Compression/decompression handling in Dired&lt;/li&gt;&#xA;&lt;li&gt;Elisp has support for generators&lt;/li&gt;&#xA;&lt;li&gt;New function &lt;code&gt;alist-get&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Initial scratch message is interpreted as a doc string&lt;/li&gt;&#xA;&lt;li&gt;Prog-mode has support for multi-mode indentation&lt;/li&gt;&#xA;&lt;li&gt;Symbols can be unprettified while point is inside them&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;M-s M-w&lt;/strong&gt; uses eww to search web for selected text&lt;/li&gt;&#xA;&lt;li&gt;eww renders variable width fonts, adds new command &lt;code&gt;eww-toggle-fonts&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;quick-calc&lt;/code&gt; with prefix argument to insert result into buffer&lt;/li&gt;&#xA;&lt;li&gt;New macro &lt;code&gt;let-alist&lt;/code&gt; - allows one to let binds values stored in an alist&lt;/li&gt;&#xA;&lt;li&gt;New function &lt;code&gt;directory-files-recursively&lt;/code&gt; returns all matching files (recursively) under a directory&lt;/li&gt;&#xA;&lt;li&gt;New variable &lt;code&gt;inhibit-message&lt;/code&gt; inhibits &lt;code&gt;message&lt;/code&gt; from displaying messages in echo area&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2016-07-28T21:37:54.817" LastActivityDate="2016-07-28T21:37:54.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19382" PostTypeId="1" CreationDate="2016-01-09T09:43:17.493" Score="4" ViewCount="2130" Body="&lt;p&gt;Is there any way I can read mail with emacs that comes from a gmail account protected with compulsory 2-factor auth? Application-specific passwords are disabled for GMail by my employer. So I can't use the usual workaround of setting an application-specific password.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google says that Apple Mail and iOS are able to do this, but doesn't explain how. And I know that Apple Mail works because one of my colleagues uses it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I want to use IMAP, so that I can read emails from my phone too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, this is not Google's 2 factor auth but a third-party SSO provider.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2020-11-28T17:25:04.003" Title="GMail 2-factor auth without application-specific password" Tags="|gnus|wanderlust|imap|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19383" PostTypeId="2" ParentId="17278" CreationDate="2016-01-09T10:34:16.723" Score="2" Body="&lt;p&gt;As wasamasa already pointed out word-wrapping only a part of the buffer requires most probably some re-plumping.&#xA;The following demonstrates an idea. It works with truncated lines and puts a newline with indent before the word reaching &lt;code&gt;fill-column&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that this is not perfect. Some things that are not handled:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;word wrapping does not adapt to &lt;code&gt;window-body-width&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;it does also not adapt to changes of &lt;code&gt;fill-column&lt;/code&gt;; one could advice &lt;code&gt;set-fill-column&lt;/code&gt; with &lt;code&gt;jit-lock-redisplay&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;no special point motion (e.g. &lt;code&gt;forward-line&lt;/code&gt; jumps over the visual lines)&lt;/li&gt;&#xA;&lt;li&gt;other &lt;code&gt;jit-lock&lt;/code&gt; handlers might interfere with &lt;code&gt;visline-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to try this stuff load it. There is an &lt;code&gt;org-visline-mode&lt;/code&gt; function at the end of this code which installs the filter for org headlines and switches on &lt;code&gt;visline-mode&lt;/code&gt; in &lt;code&gt;org-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local visline-predicate-functions nil&#xA;  &quot;List of predicate functions that are run at the beginning of each line which is visually word-wrapped by `visline-mode'.&#xA;You should add your handlers before running `visline-mode'.&#xA;The predicate functions are called without arguments.&quot;)&#xA;&#xA;(defmacro visline-expand-region (start end)&#xA;  &quot;Expand region between START and END such that START is at the beginning of a line and END at the end of a line.&quot;&#xA;  (declare (debug (sexp sexp)))&#xA;  `(progn&#xA;     (setq ,start (save-excursion (goto-char ,start) (beginning-of-line) (point)))&#xA;     (setq ,end (save-excursion (goto-char ,end) (end-of-line) (point)))))&#xA;&#xA;(defun visline-clear (start end)&#xA;  &quot;Remove visual linebreaks in the region from START to END.&quot;&#xA;  (with-silent-modifications&#xA;    (while (setq start (text-property-any start end 'visline t))&#xA;      (remove-text-properties start (1+ start) '(visline t display &quot;\n&quot;)))))&#xA;&#xA;(defsubst visline-put (pos indent)&#xA;  &quot;Put a visual linebreak at the character following position POS.&quot;&#xA;  (add-text-properties pos (1+ pos) (list 'visline t 'display (concat &quot;\n&quot; (make-string indent ?\ )))))&#xA;&#xA;(defun visline-fill-line ()&#xA;  &quot;Word-wrap current line with the help of visual linebreaks.&quot;&#xA;  (beginning-of-line)&#xA;  (forward-to-indentation 0)&#xA;  (let* ((indent (current-column))&#xA;     (last-col indent)&#xA;     last-posn&#xA;     (last-virtual-newline indent)&#xA;     fitting-line)&#xA;    (while (null (eolp))&#xA;      (setq last-col (current-column))&#xA;      (setq last-posn (point))&#xA;      (forward-char)&#xA;      (skip-chars-forward &quot;^[[:space:]]\n&quot;)&#xA;      (when (and (&amp;gt; (- (current-column) last-virtual-newline) fill-column)&#xA;         (&amp;gt; last-col indent))&#xA;    (visline-put last-posn indent)&#xA;    (setq last-virtual-newline (+ last-col indent))))))&#xA;&#xA;(defun visline-handler (start end)&#xA;  &quot;Visually word-wrap region between START and END.&quot;&#xA;  (with-silent-modifications&#xA;    (save-excursion&#xA;      (visline-expand-region start end)&#xA;      (visline-clear start end)&#xA;      (goto-char start)&#xA;      (while (&amp;lt; (point) end)&#xA;    (when (run-hook-with-args-until-failure 'visline-predicate-functions)&#xA;      (visline-fill-line))&#xA;    (forward-line)))))&#xA;&#xA;(define-minor-mode visline-mode&#xA;  &quot;Word-wrap via text-properties&quot;&#xA;  :keymap nil&#xA;  (if visline-mode&#xA;      (jit-lock-register 'visline-handler) ;; `jit-lock-register' also re-fontifies&#xA;    (jit-lock-unregister 'visline-handler)&#xA;    (with-silent-modifications&#xA;      (visline-clear (point-min) (point-max)))))&#xA;&#xA;(defun org-visline-dont-wrap-headlines ()&#xA;  &quot;Return only t if we are not on a headline.&quot;&#xA;  (null (eq (char-after) ?*)))&#xA;&#xA;(defun org-visline-mode ()&#xA;  &quot;Switches `visline-mode' on in `org-mode'.&#xA;Usage:&#xA; (require 'visline)&#xA; (add-hook 'org-mode-hook 'org-visline-mode)&quot;&#xA;  (add-hook 'visline-predicate-functions 'org-visline-dont-wrap-headlines)&#xA;  (visline-mode t))&#xA;&#xA;(provide 'visline)&#xA;&#xA;(add-hook 'org-mode-hook 'org-visline-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-09T20:34:06.890" LastActivityDate="2016-01-09T20:34:06.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19384" PostTypeId="2" ParentId="19382" CreationDate="2016-01-09T10:46:07.053" Score="6" Body="&lt;p&gt;Google Mail uses a proprietary—it doesn't appear to be standardised nor used anywhere else—SASL extension named XOAUTH2 to support OAuth 2.0 tokens for SMTP/IMAP authentication. See &lt;a href=&quot;https://developers.google.com/gmail/oauth_overview&quot; rel=&quot;noreferrer&quot;&gt;IMAP and SMTP&lt;/a&gt; for more information about these extensions.  These OAuth tokens are supplied by the &lt;a href=&quot;https://developers.google.com/identity/protocols/OAuth2&quot; rel=&quot;noreferrer&quot;&gt;Google Identity Platform API&lt;/a&gt; which—among other things—provides the familiar Google Login screen you see everywhere Google is used for authentication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this is proprietary, albeit publicly accessible.  As such, I doubt that any Emacs mail client has support for SASL XOAUTH2, let alone for Google Identity signin.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am afraid that without application specific passwords you'll not be able to use an Emacs mail client for Google Mail out of the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll have to sit down, work through the API documentation, and write a significant non-trivial amount of code to hook this authentication API into Gnus or whatever other mail client and MTA you use.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-01-09T10:46:07.053" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19385" PostTypeId="1" CreationDate="2016-01-09T10:47:47.123" Score="5" ViewCount="1176" Body="&lt;p&gt;I want to debug my init file, by exiting from loading the file in the middle so if something is wrong after that place it will not be loaded. How can I exit from .emacs file?&lt;/p&gt;&#xA;" OwnerUserId="10438" LastActivityDate="2016-11-26T11:08:42.310" Title="How to exit from .emacs init file?" Tags="|init-file|exit|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19386" PostTypeId="1" AcceptedAnswerId="19387" CreationDate="2016-01-09T11:46:06.743" Score="6" ViewCount="8002" Body="&lt;p&gt;I'm a bit confused because the I'm trying to configure &lt;code&gt;org&lt;/code&gt; within spacemacs as advised in the &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/org&quot; rel=&quot;nofollow&quot;&gt;official layer documentation for spacemacs&lt;/a&gt;), I should use      &lt;code&gt;(with-eval-after-load 'org ( ...&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function.&#xA; This function is called at the very end of Spacemacs initialization after&#xA;layers configuration.&quot;&#xA;  ;; My keys&#xA;  (global-set-key [f2] 'deft)&#xA;  ;; My Notes&#xA;  (setq deft-directory &quot;c:/Users/ZsBotykai/Dropbox/Notes/&quot;&#xA;        deft-extensions '(&quot;org&quot; &quot;md&quot; &quot;txt&quot;)&#xA;        deft-use-filename-as-title t&#xA;        deft-text-mode 'org-mode)&#xA;&#xA;  ;; ORG settings&#xA;  (with-eval-after-load 'org (&#xA;                              (setq org-agenda-files&#xA;                                    &quot;c:/Users/USERNAME/Dropbox/Notes/&quot;))&#xA;;; Further lines snipped...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm getting the following  error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(Spacemacs) Error in dotspacemacs/user-config: Invalid function: (setq org-agenda-files &quot;c:/Users/USERNAME/Dropbox/Notes/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I did try to use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org (&#xA;                            (setq org-agenda-files&#xA;                                  '(&quot;c:/Users/USERNAME/Dropbox/Notes/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Without any success. Could you point me into the right direction?&lt;/p&gt;&#xA;" OwnerUserId="473" LastEditorUserId="25" LastEditDate="2016-07-25T07:38:37.120" LastActivityDate="2016-07-25T07:38:37.120" Title="Configuring org-mode within spacemacs" Tags="|org-mode|spacemacs|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19387" PostTypeId="2" ParentId="19386" CreationDate="2016-01-09T12:07:50.190" Score="9" Body="&lt;p&gt;As pointed in the spacemacs Gitter channel, you should do just:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org (setq org-agenda-files&#xA;                              '(&quot;c:/Users/USERNAME/Dropbox/Notes/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason is that when the lisp reader tries to evaluate that code you put, it interprets that &lt;code&gt;(setq org-agenda-files '(&quot;c:/Users/USERNAME/Dropbox/Notes/&quot;))&lt;/code&gt; is a whole function, which is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The macro &lt;code&gt;with-eval-after-load&lt;/code&gt; just expects a form to execute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps. (credits to honkhonkhonk, gitter channel)&lt;/p&gt;&#xA;" OwnerUserId="10720" LastActivityDate="2016-01-09T12:07:50.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19388" PostTypeId="1" CreationDate="2016-01-09T12:38:15.197" Score="4" ViewCount="172" Body="&lt;p&gt;I currently have my clocktable defined as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 4 :scope file :tags &quot;RESIM|DOAS|GENIUP|NOIUP&quot; :block 2016 :step week :stepskip0 :emphasize nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Headline                 |    Time |       |&#xA;|--------------------------+---------+-------|&#xA;| *Total time*             | *34:54* |       |&#xA;|--------------------------+---------+-------|&#xA;| Work for the RESIM group |    3:56 |       |&#xA;| \_  Homeoffice           |         |  1:06 |&#xA;| Work for the DOAS group  |    7:02 |       |&#xA;| \_  Homeoffice           |         |  0:10 |&#xA;| General work for IUP     |    0:26 |       |&#xA;| \_  Homeoffice           |         |  0:10 |&#xA;| Not at IUP               |   23:30 |       |&#xA;| \_  Sick leave           |         | 23:30 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to add two columns to this table.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The first column should have some string entry in the first row (next to&#xA;&lt;em&gt;time&lt;/em&gt;), and in the second row (&lt;em&gt;Total time&lt;/em&gt;) it should show me the hours I&#xA;am supposed to have worked this week until today, i.e., a fixed amount of&#xA;hours (7:10 in my case) multiplied with the number of days since (and&#xA;including) Monday. So if today is Monday, it should read &lt;code&gt;7:10&lt;/code&gt;, if today is&#xA;Tuesday, it should read &lt;code&gt;14:20&lt;/code&gt;, and so on.&lt;/li&gt;&#xA;&lt;li&gt;The second new column should again have some string in the &lt;em&gt;Headline&lt;/em&gt;, and in&#xA;the &lt;em&gt;Total time&lt;/em&gt; row, it should show the difference (in hours) between the&#xA;total time worked and the time I should have worked (see previous column).&lt;/li&gt;&#xA;&lt;li&gt;As a bonus, a third column could show the sum of all these &lt;em&gt;Balance&lt;/em&gt; columns&#xA;for the current year.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm rather new to Elisp, so have not really any idea how to start - which means&#xA;any suggestions are greatly appreciated ;)&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2016-01-09T12:38:15.197" Title="How to keep current time balance in org-mode's clock table" Tags="|org-mode|org-clock|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19389" PostTypeId="5" CreationDate="2016-01-09T13:45:06.010" Score="0" Body="&lt;p&gt;This tag is about building Emacs from its source code. For questions about running compilers and more generally building programs from within Emacs, see &lt;a href=&quot;/questions/tagged/compilation&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;compilation&amp;#39;&quot; rel=&quot;tag&quot;&gt;compilation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-01-09T13:45:06.010" LastActivityDate="2016-01-09T13:45:06.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19390" PostTypeId="4" CreationDate="2016-01-09T13:45:06.010" Score="0" Body="Building Emacs from source" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-01-09T13:45:06.010" LastActivityDate="2016-01-09T13:45:06.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19391" PostTypeId="1" AcceptedAnswerId="19393" CreationDate="2016-01-09T13:59:56.563" Score="4" ViewCount="6182" Body="&lt;p&gt;I was trying to use the capture as is explained in org-manual p. 85. This is the relevant part of my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq org-default-notes-file (concat org-directory &quot;~/Notities/org-mode/Capture.org&quot;))&#xA;    (define-key global-map &quot;\C-cc&quot; 'org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get this error.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's value as variable is void: org-directory&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I tried the &lt;a href=&quot;https://stackoverflow.com/questions/3622603/org-mode-setup-problem-when-trying-to-use-capture#3622770&quot;&gt;following solution&lt;/a&gt;, but it didn't work. The filepath is directed to an existing file. Why do I still get this error?&lt;/p&gt;&#xA;" OwnerUserId="7071" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-01-09T14:50:19.727" Title="Can' t set directory for org-mode capture" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19392" PostTypeId="1" CreationDate="2016-01-09T14:23:54.677" Score="2" ViewCount="2325" Body="&lt;p&gt;I'm trying to search using &lt;code&gt;M-s o&lt;/code&gt; or &lt;code&gt;M-x occur&lt;/code&gt;. The string that I'm searching for may or may not have an acute accent, eg, &quot;Mart&lt;strong&gt;í&lt;/strong&gt;n&quot; or &quot;Mart&lt;strong&gt;i&lt;/strong&gt;n&quot;. The output is showing only the terms that has the acute accent (Mart&lt;strong&gt;í&lt;/strong&gt;n), but I need the term without the acute accent (Mart&lt;strong&gt;i&lt;/strong&gt;n) in the output also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get the search to ignore the accents?&lt;/p&gt;&#xA;" OwnerUserId="10721" LastEditorUserId="253" LastEditDate="2016-02-08T19:03:21.553" LastActivityDate="2016-03-09T19:46:32.240" Title="Search for string but ignore acute accent?" Tags="|search|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19393" PostTypeId="2" ParentId="19391" CreationDate="2016-01-09T14:31:42.087" Score="10" Body="&lt;p&gt;Make sure you have the line &lt;code&gt;(require 'org)&lt;/code&gt; before you set the location. This will ensure that the package &lt;code&gt;org&lt;/code&gt; where &lt;code&gt;org-directory&lt;/code&gt; is defined is loaded before it is used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you are adding &lt;code&gt;concat&lt;/code&gt;ing a path to &lt;code&gt;org-directory&lt;/code&gt;, I think that the path you provide should be relative to &lt;code&gt;org-directory&lt;/code&gt;, not an absolute path. In your case you might want to set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-default-notes-file &quot;~/Notities/org-mode/Capture.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead. By default, I think &lt;code&gt;org-directory&lt;/code&gt; is set to &lt;code&gt;~/org&lt;/code&gt;, but if you don't want this as your default directory, you can change this as well. For example, in your case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-directory &quot;~/Notities/org-mode&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Combining these things, it should work to add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;(setq org-directory &quot;~/Notities/org-mode&quot;)&#xA;(setq org-default-notes-file (concat org-directory &quot;/Capture.org&quot;))&#xA;(define-key global-map &quot;\C-cc&quot; 'org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-09T14:50:19.727" LastActivityDate="2016-01-09T14:50:19.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19394" PostTypeId="2" ParentId="19382" CreationDate="2016-01-09T14:35:59.880" Score="0" Body="&lt;p&gt;It should be possible to use &lt;a href=&quot;http://offlineimap.org/&quot; rel=&quot;nofollow&quot;&gt;offlineimap&lt;/a&gt; master to download the mails, and then any emacs mail client that works with offlineimap, to view them. However, this will not allow sending emails using the correct SMTP server, so it is at best a partial solution.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-01-09T14:35:59.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19395" PostTypeId="2" ParentId="19392" CreationDate="2016-01-09T15:02:40.040" Score="1" Body="&lt;p&gt;Try searching for this &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html&quot; rel=&quot;nofollow&quot;&gt;regular expression&lt;/a&gt;: &lt;code&gt;\bMart[ií]n\b&lt;/code&gt;. the &lt;code&gt;\b&lt;/code&gt;s match word boundries (so that you don't match &quot;Martini&quot; etc., and the &lt;code&gt;[ií]&lt;/code&gt; matches &lt;code&gt;i&lt;/code&gt; or &lt;code&gt;í&lt;/code&gt;. There might be a better regexp, but I think this should work just fine if you are using it from &lt;code&gt;occur&lt;/code&gt; or with &lt;code&gt;isearch-forward-regexp&lt;/code&gt; (&lt;code&gt;C-M s&lt;/code&gt; by default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also simply search for the regular expression &lt;code&gt;\bMart.n\b&lt;/code&gt;. The dot matches any single character except newline. If you do not have too many words like &lt;code&gt;Marten&lt;/code&gt; the additional matches should not disturb you too much.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-09T15:37:58.027" LastActivityDate="2016-01-09T15:37:58.027" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19396" PostTypeId="1" AcceptedAnswerId="19417" CreationDate="2016-01-09T15:16:28.330" Score="4" ViewCount="869" Body="&lt;p&gt;Installing Windows 64 bit for Windows 7 is currently a massive pain &lt;a href=&quot;https://emacs.stackexchange.com/questions/13272/&quot;&gt;Where is official 64-bit Emacs for Windows? (The manual said there is!)&lt;/a&gt; because although there are many roque cuts, GNU are not distributing those binaries for one reason or another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One must compile their own binaries using the lengthy instructions at &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/emacs-25/nt/INSTALL.W64&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-mirror/emacs/blob/emacs-25/nt/INSTALL.W64&lt;/a&gt; or trust one of the many unofficial builds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have any hard evidence that 64 bit Emacs is faster than 32 bit running on 64 bit Windows 7?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, I use a few external applications such as &lt;a href=&quot;http://ctags.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;exuberant ctags&lt;/a&gt;, &lt;a href=&quot;http://aspell.net/win32/&quot; rel=&quot;nofollow&quot;&gt;aspell&lt;/a&gt;. Does anybody have any evidence of performance benefits to creating 64 bit versions of these applications?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="5142" LastEditDate="2016-01-09T22:50:05.487" LastActivityDate="2016-01-11T16:27:26.393" Title="is 64 bit Windows actually faster?" Tags="|microsoft-windows|performance|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19397" PostTypeId="1" CreationDate="2016-01-09T15:53:07.260" Score="1" ViewCount="186" Body="&lt;p&gt;I'm getting better and better at using emacs but one thing is annoying when using dired. When I run dired, it opens a new one, which is obviously the intended behaviour. Would it be possible to write a function so when I run M-x dired, it starts dired, however, if there's already a dired buffer, it'll take me there without starting a new instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't really know anything about elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I'm adding some pseudo code to clarify it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function dired2() {&#xA;   if (dired.buffer.exists) {&#xA;     existing_dired = get.dired.buffer&#xA;     focus.on.existing_dired&#xA;   }&#xA;   else {&#xA;     run.dired&#xA;  {&#xA;{&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="10722" LastEditorUserId="10722" LastEditDate="2016-01-09T16:52:08.643" LastActivityDate="2016-01-09T16:52:08.643" Title="When starting dired, go to the existing dired window" Tags="|dired|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19398" PostTypeId="1" CreationDate="2016-01-09T16:33:26.173" Score="1" ViewCount="192" Body="&lt;p&gt;With &lt;a href=&quot;http://www.emacswiki.org/emacs/AbbrevMode&quot; rel=&quot;nofollow&quot;&gt;abbrev mode&lt;/a&gt;, I can define abbreviations that trigger when I type a certain term. For example, typing &quot;yn&quot; would be expanded to &quot;Your Name&quot;. For this, &quot;yn&quot; must have been defined as an abbreviation before hand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm looking for is a setup in which rather than specifying the abbreviation terms explicitly, I can specify a regular expression that when matched gets expanded by the defined instructions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple example would be that everytime I type a website as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;website_name.org &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it gets expanded to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://website_name.org &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm specifically looking for a solution that works like abbrev in that I don't have to invoke a command after typing my abbreviation to have it converted.&lt;/p&gt;&#xA;" OwnerUserId="338" LastActivityDate="2016-01-09T16:33:26.173" Title="Triggering abbreviation expansion or auto completion automatically from a regular expression match?" Tags="|yasnippet|abbrev|automation|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19400" PostTypeId="1" CreationDate="2016-01-09T21:58:28.587" Score="4" ViewCount="498" Body="&lt;p&gt;I created a buffer, &lt;code&gt;test1.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (defmacro dummy-macro (_) nil)&#xA;  (dummy-macro s))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Trying to compile this file, I get the following errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In toplevel form:&#xA;test1.el:3:16:Warning: reference to free variable `s'&#xA;test1.el:3:16:Error: Symbol's value as variable is void: s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I change &lt;code&gt;eval-when-compile&lt;/code&gt; to &lt;code&gt;eval-and-compile&lt;/code&gt; I do not get these errors. Why is this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs 24.4.1.&lt;/p&gt;&#xA;" OwnerUserId="2701" LastEditorUserId="105" LastEditDate="2016-03-14T17:16:38.103" LastActivityDate="2016-03-14T17:16:38.103" Title="Byte-compiling a file loads macros with `(eval-and-compile)` but not `(eval-when-compile)`" Tags="|elisp-macros|byte-compilation|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19401" PostTypeId="1" AcceptedAnswerId="22509" CreationDate="2016-01-09T22:59:53.160" Score="0" ViewCount="297" Body="&lt;p&gt;I'm finding that EMMS fails to import the info from the tags for certain mp3 files and I'm not sure why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I select such a track and press &lt;kbd&gt;E&lt;/kbd&gt; to call &lt;code&gt;emms-tag-editor-edit&lt;/code&gt;, all fields show empty. But if I check a problem track directly with &lt;code&gt;mp3info&lt;/code&gt;, the files seem to be tagged correctly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What might be going wrong here and how do I fix it?&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2016-05-25T15:06:28.940" Title="Trouble importing tags from certain mp3 files in EMMS" Tags="|emms|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19403" PostTypeId="1" CreationDate="2016-01-09T23:30:06.523" Score="5" ViewCount="4111" Body="&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; agenda view has a bunch of commands accessible with a single key press.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. typing &lt;code&gt;b&lt;/code&gt; moves backward in time to display earlier dates, and typing &lt;code&gt;t&lt;/code&gt; brings up a dialog to change the TODO state of the item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to redefine &lt;code&gt;t&lt;/code&gt; to toggle between &lt;code&gt;TODO&lt;/code&gt; and &lt;code&gt;DONE&lt;/code&gt; without any dialog, and also redefine &lt;code&gt;b&lt;/code&gt; to reschedule a task at focus to the next week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can those built-in commands be redefined?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="874" LastEditDate="2016-01-10T12:59:20.573" LastActivityDate="2022-02-08T10:15:10.840" Title="How do I change key bindings for org-mode agenda view?" Tags="|org-mode|key-bindings|org-agenda|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19404" PostTypeId="1" AcceptedAnswerId="19421" CreationDate="2016-01-10T00:24:08.870" Score="3" ViewCount="1475" Body="&lt;p&gt;What could possibly preventing execution of code blocks upon export to pdf, if &lt;code&gt;org-export-babel-evaluate&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;? &lt;code&gt;:results&lt;/code&gt; is set to &lt;code&gt;silent&lt;/code&gt; on the relevant codeblock but I don't think that should affect execution upon export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I set &lt;code&gt;:exports&lt;/code&gt; to &lt;code&gt;results&lt;/code&gt; the file outputted by the code block is inserted at the end of the document. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I set &lt;code&gt;:exports&lt;/code&gt; to &lt;code&gt;both&lt;/code&gt; the file is inserted correctly (ie where the link is), but then the codeblock is of course also inserted. Neither is useful as I would just like the file generated by the codeblock to be inserted at the location of the link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** CODE&#xA;#+begin_src clojure :var bc=case :colnames no :results silent :tangle ../src/roight/core.clj &#xA;  (ns roight.core&#xA;    (:require [roight.org]&#xA;              [roight.sim]&#xA;              [incanter.core]&#xA;              [incanter.charts]&#xA;              [incanter.pdf]))&#xA;&#xA;  (defn calc-bc [bc]&#xA;    (apply  #(- (* (+ %1 %2 %3) %5) (* %4 %5)) bc))&#xA;&#xA;  (defn sample-business-case [case i]&#xA;    (map calc-bc (repeatedly i #(map roight.sim/sample case))))&#xA;&#xA;  (let [business-case (roight.org/org-table-&amp;gt;map bc)&#xA;        chart (incanter.charts/histogram (sample-business-case business-case 20000))]&#xA;    (incanter.core/view chart)&#xA;    (incanter.core/save chart &quot;org/business-case.png&quot;))&#xA;#+end_src&#xA;** Illustration&#xA;   #+CAPTION: Simulation of the business case&#xA;   #+NAME: fig:business_case_simulation&#xA;   [[./business-case.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 25.1.50.1 and org-mode 8.3.2 on OSX.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Remark by Tobias:&#xA;The effect described by mac cannot be reproduced with the html-file export of the following example using an &lt;code&gt;emacs-lisp&lt;/code&gt; code block, &lt;code&gt;emacs 24.3.1&lt;/code&gt; and &lt;code&gt;org-mode 8.3.2&lt;/code&gt;. The figure is shown between the first and the second sentence -- as it is expected. This rises the question whether the problem is clojure-specific.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :exports results :results silent&#xA;(with-current-buffer (find-file-noselect &quot;testsvg.svg&quot;)&#xA;  (delete-region (point-min) (point-max))&#xA;  (insert &quot;&amp;lt;svg version=\&quot;1.1\&quot; baseProfile=\&quot;full\&quot; width=\&quot;300\&quot; height=\&quot;200\&quot; xmlns=\&quot;http://www.w3.org/2000/svg\&quot;&amp;gt;&#xA;  &amp;lt;rect width=\&quot;100%\&quot; height=\&quot;100%\&quot; fill=\&quot;red\&quot;/&amp;gt;&#xA;  &amp;lt;text x=\&quot;150\&quot; y=\&quot;125\&quot; font-size=\&quot;60\&quot; text-anchor=\&quot;middle\&quot;&amp;gt;Test&amp;lt;/text&amp;gt;&#xA;&amp;lt;/svg&amp;gt;&quot;)&#xA;  (save-buffer))&#xA;#+end_src&#xA;** Illustration&#xA;   The figure is placed below this first sentence.&#xA;&#xA;   #+CAPTION: Simulation of the business case&#xA;   #+NAME: fig:business_case_simulation&#xA;   [[./testsvg.svg]]&#xA;&#xA;   The figure is placed above this second sentence.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="199" LastEditorUserId="199" LastEditDate="2016-01-10T19:10:30.583" LastActivityDate="2016-01-10T22:29:27.267" Title="No execution of code blocks upon export from org-mode to pdf" Tags="|org-mode|org-export|org-babel|osx|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19405" PostTypeId="1" CreationDate="2016-01-10T01:31:40.727" Score="7" ViewCount="801" Body="&lt;p&gt;So, I'm pretty much a noob with regards to Emacs and Org-Mode but I'm wondering if a particular feature exists...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of old outliners (I'm talking MS-DOS era) had a feature called &quot;Mark and Gather,&quot; where you were able to mark several items and move them all at once. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if this functionality exists anywhere in Org-Mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, I'm wondering if there's a way to mark several headings then run Org-Refile to move them all at once. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything I find about marking seems to refer either to selecting text or turning something into a Todo item. &lt;/p&gt;&#xA;" OwnerUserId="10730" LastActivityDate="2016-01-11T00:29:10.547" Title="&quot;Mark and Gather&quot; in Org-Mode?" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19406" PostTypeId="2" ParentId="19405" CreationDate="2016-01-10T02:24:08.383" Score="6" Body="&lt;p&gt;You can select items by hitting &lt;kbd&gt;m&lt;/kbd&gt; on each one, or using a regexp by hitting &lt;kbd&gt;%&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you've selected the agenda items, entering &lt;kbd&gt;B&lt;/kbd&gt; will give you a menu of bulk actions, including &lt;kbd&gt;r&lt;/kbd&gt; to refile. See the manual under &quot;&lt;a href=&quot;http://orgmode.org/manual/Agenda-commands.html&quot;&gt;Commands in the agenda buffer&lt;/a&gt;&quot; for more info.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2016-01-10T02:24:08.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19407" PostTypeId="2" ParentId="19405" CreationDate="2016-01-10T02:53:41.547" Score="6" Body="&lt;p&gt;It is not quite as nice as how it works in an &lt;code&gt;org-agenda&lt;/code&gt; buffer as @Brian Z describes, but within an actual &lt;code&gt;.org&lt;/code&gt; file, all the items in a selected region will be refiled when you call &lt;code&gt;org-refile&lt;/code&gt;. So you could set the mark, highlight all the headlines you want to act on, and call &lt;code&gt;org-refile&lt;/code&gt; through whatever key combination you have it bound to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, if you want to use the &lt;code&gt;agenda&lt;/code&gt; buffer for processing headlines, you can run &lt;code&gt;org-agenda&lt;/code&gt;, and then select the view that shows all TODOs (&lt;code&gt;t&lt;/code&gt;) or create a &lt;a href=&quot;http://orgmode.org/manual/Custom-agenda-views.html#Custom-agenda-views&quot;&gt;custom view&lt;/a&gt; tailored to your needs (like one that includes all the headlines in your document) and act on tasks from there as described by @Brian Z.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-10T03:55:58.067" LastActivityDate="2016-01-10T03:55:58.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19408" PostTypeId="2" ParentId="19269" CreationDate="2016-01-10T10:35:18.203" Score="0" Body="&lt;p&gt;User &lt;a href=&quot;https://emacs.stackexchange.com/users/253/dan&quot;&gt;Dan&lt;/a&gt; mentions: &lt;em&gt;&quot;&lt;kbd&gt;Capslock&lt;/kbd&gt; is a special key, and you will need to remap it at the operating system level before you can use it for this task in Emacs.&quot;&lt;/em&gt;  (&lt;a href=&quot;https://emacs.stackexchange.com/questions/19269/rebind-capslock-to-a-different-key#comment29242_19269&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;Capslock&lt;/kbd&gt; was first re-mapped to Nabla (∇). This was done at the Operating System level; &lt;a href=&quot;http://www.emacswiki.org/emacs/CapsKey#toc5&quot; rel=&quot;nofollow noreferrer&quot;&gt;Example&lt;/a&gt; configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the desired task can be achieved by re-mapping Nabla from within Emacs. For example, to map Nabla to &lt;code&gt;Control-X-prefix&lt;/code&gt;, the following command can be used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key '[8711] 'Control-X-prefix)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6924" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-01-10T10:35:18.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19409" PostTypeId="1" AcceptedAnswerId="27058" CreationDate="2016-01-10T11:41:55.427" Score="3" ViewCount="213" Body="&lt;p&gt;I am using org-mode to write papers and I am often confronted the following problem: starting from&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A1&#xA;   Text for level A1&#xA;** A2&#xA;   Text for level A2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to add an additional information after &lt;code&gt;Text for level A2&lt;/code&gt; but at the level of A as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** A1&#xA;   Text for level A1&#xA;** A2&#xA;   Text for level A2&#xA;  Text stil in section A but not in section A2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But org mode does not seem to enable this and aligns the text with section A2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to insert an &quot;artificial&quot; section&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* &#xA;  Text stil in section A but not in section A2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it appears in the LaTeX export and therefore this is not a satisfactory solution. Is there a way to solve this problem, for instance by adjusting the export of the &quot;artificial&quot; section to make it invisible in the exported document ?&lt;/p&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2016-09-13T11:08:45.037" Title="Decrease text indentation to level N after headline at level N+1" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19410" PostTypeId="2" ParentId="19404" CreationDate="2016-01-10T11:58:44.590" Score="0" Body="&lt;p&gt;Since it inserts the result to the end of the document, I guess you might not have a &lt;code&gt;#+RESULTS:&lt;/code&gt; tag after the code block. See some of the examles here &lt;a href=&quot;http://orgmode.org/org.html#Header-arguments&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/org.html#Header-arguments&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10734" LastActivityDate="2016-01-10T11:58:44.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19411" PostTypeId="1" CreationDate="2016-01-10T12:47:15.540" Score="1" ViewCount="46" Body="&lt;p&gt;How can I copy LaTeX-equations from an emacs editor to an MS-Word equation, like the following does for Browsers instead of emacs: &lt;a href=&quot;https://github.com/idf/LaTex2Word-Equation&quot; rel=&quot;nofollow&quot;&gt;https://github.com/idf/LaTex2Word-Equation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-01-10T12:47:15.540" Title="How to copy latex equations as word equations from emacs?" Tags="|latex|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19412" PostTypeId="2" ParentId="19405" CreationDate="2016-01-10T16:56:38.883" Score="2" Body="&lt;p&gt;I too have hoped for this feature outside of org-agenda and the closest I have found convenience-wise is to rely on the default completion behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After refiling an item the refile target is the default target until something is refiled to a different target.  I, for example, have &lt;code&gt;org-refile&lt;/code&gt; bound to &lt;code&gt;C-c C-w&lt;/code&gt;, so after refiling the first heading would press &lt;code&gt;C-c C-w &amp;lt;enter&amp;gt;&lt;/code&gt; at each heading that should also be refiled to the same location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are probably already aware of this &quot;method&quot;, but it might be useful for someone to know even though it is less efficient than marking within org-agenda.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-01-11T00:29:10.547" LastActivityDate="2016-01-11T00:29:10.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19413" PostTypeId="2" ParentId="13029" CreationDate="2016-01-10T18:19:34.087" Score="3" Body="&lt;p&gt;This is a known problem in the current release of Emacs. It is fixed in the upcoming release of Emacs 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying cause is that input events started to arrive before the initialization code was done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems were more prominent when the system was low on resources or when under heavy load, e.g. when Emacs was launched at system startup.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-01-10T18:19:34.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19414" PostTypeId="1" AcceptedAnswerId="19415" CreationDate="2016-01-10T18:38:50.753" Score="3" ViewCount="7166" Body="&lt;p&gt;I'm new to emacs and try to learn elisp. I've read some tutorials and try to build now my own customized emacs. Looking at this &lt;a href=&quot;http://y.tsutsumi.io/emacs-from-scratch-part-2-package-management.html&quot; rel=&quot;nofollow&quot;&gt;blog&lt;/a&gt; I want to write a similar script for automatically installing required packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the blog the author defines a variable &lt;code&gt;required-package&lt;/code&gt; which binds to a list of required packages. Then he writes (I quote):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; my-packages.el&#xA;(require 'cl)&#xA;&#xA;; method to check if all packages are installed&#xA;(defun packages-installed-p ()&#xA;  (loop for p in required-packages&#xA;        when (not (package-installed-p p)) do (return nil)&#xA;        finally (return t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My goal is to write a similar function which does not depend on the common lisp package (since I would like to learn elisp :)). So I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun check-required-packages (list-check)&#xA;  &quot;The function check if the packages in LIST-CHECK are installed&quot;&#xA;  (let ((return '(t))) ; return list&#xA;    (dolist (p list-check return) ; for each p in package execute the body and finally return RERTURN.&#xA;      (when (not (package-installed-p p))&#xA;    (add-to-list return nil)))&#xA;    return))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Having also a variable &lt;code&gt;required-packages&lt;/code&gt; binding to such a list leads to the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(check-required-packages required-packages)&#xA;Wrong type argument: symbolp, (t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I dont understand this. Since I can define&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq a '(t)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;without a problem. &lt;/p&gt;&#xA;" OwnerUserId="10470" LastEditorUserId="105" LastEditDate="2016-03-14T17:15:54.353" LastActivityDate="2016-03-14T17:15:54.353" Title="Error: Wrong type argument: symbolp, (t)" Tags="|arguments|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19415" PostTypeId="2" ParentId="19414" CreationDate="2016-01-10T19:08:23.970" Score="7" Body="&lt;p&gt;The error is &lt;code&gt;(add-to-list return nil)&lt;/code&gt;. The first argument of &lt;code&gt;add-to-list&lt;/code&gt; must be the symbol of the variable holding the list and not the list itself.&#xA;That means you have to write &lt;code&gt;(add-to-list 'return nil)&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find such errors easily yourself if you use &lt;code&gt;edebug&lt;/code&gt;.&#xA;I think you have &lt;code&gt;lisp-interaction-mode&lt;/code&gt; or &lt;code&gt;emacs-lisp-mode&lt;/code&gt; as major mode of the buffer where you try your code. You find &lt;code&gt;edebug&lt;/code&gt; in both modes in the major mode menu, either &lt;code&gt;Lisp-Interaction&lt;/code&gt; or &lt;code&gt;Emacs-Lisp&lt;/code&gt; as menu item &lt;code&gt;Instrument Function For Debugging&lt;/code&gt;. Place point on the closing parenthesis of the &lt;code&gt;defun&lt;/code&gt; you want to instrument for debugging and click on that menu item.&#xA;Afterwards call the instrumented function. Emacs will enter the debugger on your function.&#xA;The buffer will be read-only and the key-bindings are redefined. If you press space you can execute the function form after form and see the effects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to debug your code is to check the option &lt;code&gt;Options -&amp;gt; Enter Debugger On Error&lt;/code&gt;. Then run your code. Emacs will show you the backtrace when the error occurs. That gives you a quite good feeling for the place where the error is.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-11T05:07:19.193" LastActivityDate="2016-01-11T05:07:19.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19416" PostTypeId="2" ParentId="19414" CreationDate="2016-01-10T19:31:06.880" Score="2" Body="&lt;p&gt;As documented in the Info for Elisp:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The argument SYMBOL is not implicitly quoted; &lt;code&gt;add-to-list&lt;/code&gt; is an&#xA;    ordinary function, like &lt;code&gt;set&lt;/code&gt; and unlike &lt;code&gt;setq&lt;/code&gt;.  Quote the&#xA;    argument yourself if that is what you want.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Here's a scenario showing how to use &lt;code&gt;add-to-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo '(a b))&#xA;      =&amp;gt; (a b)&#xA;&#xA;(add-to-list 'foo 'c)     ;; Add `c'.&#xA;      =&amp;gt; (c a b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2526" LastActivityDate="2016-01-10T19:31:06.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19417" PostTypeId="2" ParentId="19396" CreationDate="2016-01-10T20:58:28.990" Score="5" Body="&lt;p&gt;I did a couple of tests using Emacs 24.5 with the 32-bit build provided by &lt;a href=&quot;http://reflection.oss.ou.edu/gnu/gnu/emacs/windows/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Emacs&lt;/a&gt; and the 64-bit build provided by &lt;a href=&quot;https://sourceforge.net/projects/emacsbinw64/files/release/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs-w64&lt;/a&gt; - I thought the 64-bit build would be a little slower due to the larger pointer size but the differences were pretty negligible for ~20 second processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then at Tobias's suggestion, I tested loading an .org file, and the 64-bit build was about 20% slower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All times in seconds &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Test                     | 32-bit | 64-bit | Result     |&#xA;|--------------------------+--------+--------+------------|&#xA;| Startup a 200kb init.el  |   19.1 |   19.0 |            |&#xA;|                          |   19.4 |   18.9 |            |&#xA;|                          |   19.3 |   19.3 |            |&#xA;| average                  |   19.3 |   19.1 | same       |&#xA;|--------------------------+--------+--------+------------|&#xA;| Open a 220mb binary file |   19.6 |   19.4 |            |&#xA;|                          |   18.4 |   19.5 |            |&#xA;|                          |   18.9 |   18.9 |            |&#xA;| average                  |   19.0 |   19.3 | same       |&#xA;|--------------------------+--------+--------+------------|&#xA;| Open a 10mb .org file    |  108.0 |  124.7 |            |&#xA;|                          |  105.6 |  128.4 |            |&#xA;|                          |  113.4 |  136.9 |            |&#xA;| average                  |  109.0 |  130.0 | 19% slower |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(note that it's just a coincedence that the first two tests have similar times)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The test script: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; startup time with 200kb init.el&#xA;(message (emacs-init-time))&#xA;&#xA;;; test file load times&#xA;(require 'benchmark)&#xA;(message &quot;%f&quot; (benchmark-elapse &#xA;  ;;(find-file &quot;c:/apps/emacs/bin/emacsclient.exe&quot;) ; 1mb file&#xA;  ;;(find-file &quot;c:/users/bburns/downloads/Core-current.iso&quot;) ; 10mb file&#xA;  (find-file-noselect &quot;c:/users/bburns/downloads/LibreOffice_4.3.6_Win_x86.msi&quot; t) ; 220mb file&#xA;  ))&#xA;&#xA;;; test .org file fontification&#xA;(message &quot;%f&quot; (benchmark-elapse &#xA;  (find-file-noselect &quot;test10m.org&quot; t) ; 10mb file&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My init file is fairly large so takes a while to load - it exercises loading the exe and running a lot of elisp code, loading a file tests the underlying C code and buffer handling, and loading the .org file exercises fontification. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for these tests, it looks like the 64-bit build is slower, unless the 32-bit build had some different optimization settings - the README for the GNU Emacs distribution doesn't have any information on the build, so presumably it was just a plain make, which is what the 64-bit build used, if it used the procedure on the &lt;a href=&quot;https://sourceforge.net/p/emacsbinw64/wiki/Build%20guideline%20for%20MSYS2-MinGW-w64%20system/&quot; rel=&quot;nofollow noreferrer&quot;&gt;wiki&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The build process for 64-bit is easier, at least as far as setting up the environment, but I think you can also make a 32-bit build using MSYS2, so I'll add some tests for that when I get a chance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://stackoverflow.com/questions/2378399/are-64-bit-programs-bigger-and-faster-than-32-bit-versions&quot;&gt;here&lt;/a&gt; also for a discussion on some performance differences between 32 and 64 bit applications. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And just for completeness, the .org file was just repeated blocks of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* headline 1&#xA;&#xA;This is some text.&#xA;&#xA;** subheading 1&#xA;&#xA;This is some more text&#xA;&#xA;** subheading 2&#xA;&#xA;This is a table &#xA;&#xA;| one | two | three |&#xA;|   1 |   2 |     3 |&#xA;|     |     |       |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-01-11T16:27:26.393" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="19418" PostTypeId="1" AcceptedAnswerId="19420" CreationDate="2016-01-10T21:16:23.137" Score="7" ViewCount="5734" Body="&lt;p&gt;&lt;code&gt;frame-list&lt;/code&gt; returns a list of references for live Emacs frames.  How does one get a reference for the &lt;em&gt;current&lt;/em&gt; Emacs frame?  I have been unable to find an appropriate function.  Current could be either &lt;strong&gt;(1)&lt;/strong&gt; the Emacs frame that has focus (one or zero references) or &lt;strong&gt;(2)&lt;/strong&gt; the Emacs frame that last had focus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm presently looking to use &lt;strong&gt;(1)&lt;/strong&gt; under w32, but for didactic purposes I'm interested in both and whether there are any caveats for focus tracking in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-01-10T21:46:11.000" Title="Get a reference for the current frame" Tags="|frames|focus|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19419" PostTypeId="1" CreationDate="2016-01-10T21:22:38.207" Score="3" ViewCount="188" Body="&lt;p&gt;During export, Org generates this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{tikzpicture}[-&amp;gt;,&amp;gt;=stealth',shorten &amp;gt;=1pt,auto,node distance=2.8cm,&#xA;                    semithick]&#xA;&#xA;\node[initial,state]   (A)              \{\$q$_{\text{0}}$\$\};&#xA;\node[state]           (B) [right of=A] \{\$q$_{\text{1}}$\$\};&#xA;\node[state]           (C) [right of=B] \{\$q$_{\text{2}}$\$\};&#xA;\node[accepting,state] (D) [below of=A] \{\$q$_{\text{3}}$\$\};&#xA;\node[accepting,state] (E) [below of=C] \{\$q$_{\text{4}}$\$\};&#xA;&#xA;  \path (A) edge [loop above] node \{\$b\$\} (A)&#xA;            edge              node \{\$a\$\} (B)&#xA;        (B) edge              node \{\$a\$\} (C)&#xA;            edge              node \{\$a\$\} (D)&#xA;            edge              node \{\$b\$\} (E)&#xA;        (C) edge              node \{\$a\$\} (B);&#xA;\end{tikzpicture}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADER: :exports results&#xA;#+HEADER: :results (by-backend (pdf &quot;latex&quot;) (t &quot;raw&quot;))&#xA;#+BEGIN_SRC latex&#xA;  \begin{tikzpicture}[-&amp;gt;,&amp;gt;=stealth',shorten &amp;gt;=1pt,auto,node distance=2.8cm,&#xA;                      semithick]&#xA;&#xA;    \node[initial,state]   (A)              {$q_0$};&#xA;    \node[state]           (B) [right of=A] {$q_1$};&#xA;    \node[state]           (C) [right of=B] {$q_2$};&#xA;    \node[accepting,state] (D) [below of=A] {$q_3$};&#xA;    \node[accepting,state] (E) [below of=C] {$q_4$};&#xA;&#xA;    \path (A) edge [loop above] node {$b$} (A)&#xA;              edge              node {$a$} (B)&#xA;          (B) edge              node {$a$} (C)&#xA;              edge              node {$a$} (D)&#xA;              edge              node {$b$} (E)&#xA;          (C) edge              node {$a$} (B);&#xA;  \end{tikzpicture}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;by-backend&lt;/code&gt; looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro by-backend (&amp;amp;rest body)&#xA;  `(cl-case (when (boundp 'backend)&#xA;              (org-export-backend-name backend))&#xA;     ,@body))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This behavior is present in Org version 8.2.10, but it didn't happen on my laptop with potentially different version, which I don't remember.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to prevent it from escaping the results?&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-01-10T21:22:38.207" Title="Prevent Org from escaping latex results" Tags="|org-mode|org-export|org-babel|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19420" PostTypeId="2" ParentId="19418" CreationDate="2016-01-10T21:46:11.000" Score="11" Body="&lt;p&gt;You can use &lt;code&gt;selected-frame&lt;/code&gt; and &lt;code&gt;selected-window&lt;/code&gt; to get the current frame and window. Also see the &lt;code&gt;focus-in-hook&lt;/code&gt; an &lt;code&gt;focus-out-hook&lt;/code&gt; hooks (new in Emacs 24.4) if you want to take some action when a frame gains or loses focus.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-01-10T21:46:11.000" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19421" PostTypeId="2" ParentId="19404" CreationDate="2016-01-10T22:14:24.183" Score="2" Body="&lt;p&gt;When you export to PDF the intermediate format is LaTeX. In LaTeX images with captions are exported as floats. They are saved in a stack and placed into the text where they fit best in the sense of the optimization algorithm implemented in LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can avoid this with the LaTeX attribute &lt;code&gt;:float&lt;/code&gt; set to &lt;code&gt;nil&lt;/code&gt;. See the corresponding &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;orgmode manual section &quot;Images in LaTeX export&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following I give a modified version of the example that I have added to your question. There I did not yet know that you actually want to export to PDF. The new version of the example contains an emacs-lisp code block that produces a png image. This org file can be exported to PDF (via LaTeX). &lt;strong&gt;Please, note the &lt;code&gt;#+ATTR_LATEX&lt;/code&gt; line.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :exports results :results silent&#xA;(with-current-buffer (find-file-noselect &quot;testpng.png&quot;)&#xA;  (delete-region (point-min) (point-max))&#xA;  (insert &quot;iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA&#xA;B3RJTUUH4AEKFTYTnwLJxgAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAIU&#xA;SURBVFjD7Zc9y7JgFMfrmQpcBJF0aAuiaGkqHBpTiAqiTVdtst3l+griN7Dmlj5AQ6BN1ZJLBNFg&#xA;LyQU9AK9oPfwLA/V3VO31t1w/cfL6xx+wnXO+R+/4zi+z9Mf30cKYkEsiAWxXGDpus4wTDAYZBhG&#xA;1/U3cTl3pSjKxX1FUZzX6x6WYRg3/8QwjAezW5YlSRJBEARBSJJkWZYHWIIg3MQSBOGR1KZpXsea&#xA;pukWC8Owm1gYhj2SmmXZ61iWZX8ZC0GQ61gEQR6JvVeJpVLpqfMLFYvFBw+fq0SXT/5Vb8t9g3hJ&#xA;Jf6Vpmk0TQcCAZqmNU1z3iI/NM0QC2JBLIj1aqxer/drXN+1//l8TpJkpVLZbrceThXbttvttquZ&#xA;aFlWuVyORCKdTsc90Ol0qtfriUSCoqj1eu12VDcaDRzHeZ7f7XY/A1qtVgAAkiQ5juv3+944CMdx&#xA;FotFoVCIxWLdbvcpoOl0KooijuOiKI5GI282nwupqoqiKADgfD7/9/JkMuF5HsdxAMBsNvNyIbvW&#xA;eDzOZDKpVGo4HN7xtBzHhUIhAMByufR+T/yulGRZRlFUlmXbtv/9pOt6LpcLh8OyLLusX9/PwgaD&#xA;QTKZzGazpmnatt1sNimKikajqqoeDofXbtX3td/vq9UqSZLpdDoej9dqtePx+CmmudVqbTabfD7v&#xA;9/s9bPLQy0MsiAWxIBbEeru+AFjCnWMWvjgvAAAAAElFTkSuQmCC&quot;)&#xA;  (base64-decode-region (point-min) (point-max))&#xA;  (save-buffer))&#xA;#+end_src&#xA;** Illustration&#xA;   The figure is placed below this first sentence.&#xA;   #+ATTR_LATEX: :float nil&#xA;   #+CAPTION: Simulation of the business case&#xA;   #+NAME: fig:business_case_simulation&#xA;   [[./testpng.png]]&#xA;   The figure is placed above this second sentence.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following picture shows the pdf output with the &lt;code&gt;:float&lt;/code&gt; attribute:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/H43KL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/H43KL.png&quot; alt=&quot;with :float attribute&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following picture shows the pdf output without the &lt;code&gt;:float&lt;/code&gt; attribute:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GXPnT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GXPnT.png&quot; alt=&quot;without :float attribute&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-10T22:29:27.267" LastActivityDate="2016-01-10T22:29:27.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19422" PostTypeId="1" AcceptedAnswerId="19471" CreationDate="2016-01-11T00:02:57.973" Score="12" ViewCount="10214" Body="&lt;p&gt;I'm looking for an elisp package that automatically inserts Python docstring for a method. I found a package, which is very close to my purpose. But it's in reStructured text, not in Google style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;sphinx-doc.el&#xA;&lt;a href=&quot;https://github.com/naiquevin/sphinx-doc.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/naiquevin/sphinx-doc.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Describing arguments in docstrings (Google python style guide)&#xA;&lt;a href=&quot;https://www.chromium.org/chromium-os/python-style-guidelines#TOC-Describing-arguments-in-docstrings&quot; rel=&quot;noreferrer&quot;&gt;https://www.chromium.org/chromium-os/python-style-guidelines#TOC-Describing-arguments-in-docstrings&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My expectation is when I call &lt;code&gt;M-x sphinx-doc-google&lt;/code&gt; within the following function,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def some_function(a, b, c):&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I need a result like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def some_function(a, b, c):&#xA;    &quot;&quot;&quot;&#xA;    Args:&#xA;        a:&#xA;        b:&#xA;        c:&#xA;    Returns:&#xA;    &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know it's not difficult to implement by myself. I just want to ask this question to avoid the reinvention.&lt;/p&gt;&#xA;" OwnerUserId="10622" LastEditorUserId="105" LastEditDate="2016-03-14T17:14:43.027" LastActivityDate="2021-08-31T16:28:34.157" Title="Library for automatically inserting python docstring in Google style" Tags="|python|doc-strings|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19423" PostTypeId="1" AcceptedAnswerId="19424" CreationDate="2016-01-11T01:31:21.280" Score="7" ViewCount="2104" Body="&lt;p&gt;Recent versions of Magit (&gt;=2.3) have snazzy new popups with variables that feature more than two options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0DAK8.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0DAK8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, &lt;kbd&gt;r&lt;/kbd&gt; cycles between the three values: &lt;code&gt;true&lt;/code&gt;, &lt;code&gt;false&lt;/code&gt;, and &lt;code&gt;default:false&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I almost always pull with rebase, so how can I make the default &lt;code&gt;default:true&lt;/code&gt; instead?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-01-11T01:40:40.617" Title="Set magit to pull with rebase by default" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19424" PostTypeId="2" ParentId="19423" CreationDate="2016-01-11T01:40:40.617" Score="9" Body="&lt;p&gt;The default for the repository can be changed from the branch popup: &lt;kbd&gt;b M-r...&lt;/kbd&gt;. The branch popup is used for creating, checking out, &lt;em&gt;and modifying&lt;/em&gt; branches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To set the global default use &lt;code&gt;git config --global pull.rebase true&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-01-11T01:40:40.617" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19425" PostTypeId="1" CreationDate="2016-01-11T04:44:50.620" Score="3" ViewCount="160" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs24.5 -Q&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(setq python-shell-interpreter &quot;ipython&quot;)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;run-python&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Python 3.5.1 (default, Dec  7 2015, 12:58:09) &#xA;Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&lt;br/&gt;&#xA;IPython 4.0.0 -- An enhanced Interactive Python.&#xA;?         -&gt; Introduction and overview of IPython's features.&#xA;%quickref -&gt; Quick reference.&#xA;help      -&gt; Python's own help system.&#xA;object?   -&gt; Details about 'object', use 'object??' for extra details.&lt;br/&gt;&#xA;&lt;b&gt;In [1]: &#xA;In [2]: &#xA;In [3]: &#xA;In [4]:&lt;/b&gt;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This may seem pretty insignificant, but I honestly believe that small cosmetic quirks like these can have a large impression on those who do not already love Emacs. And besides, I'm OCD. :)&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="105" LastEditDate="2016-08-15T01:19:02.810" LastActivityDate="2016-08-15T01:19:02.810" Title="Remove extra prompts in inferior-python-mode with ipython" Tags="|python|ipython|prompt|" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19427" PostTypeId="1" CreationDate="2016-01-11T05:29:09.487" Score="1" ViewCount="96" Body="&lt;p&gt;If I click and drag my mouse within a buffer, garbage text appears all around the mouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried (global-set-key [drag-mouse-1] 'mouse-set-region) with no effect.  I have otherwise no explicit remapping of mouse-1.  How can I redefine normal drag-mouse-1 behaviour or at least disable the current action?  &lt;/p&gt;&#xA;" OwnerUserId="10740" LastActivityDate="2016-01-11T05:29:09.487" Title="Dragging mouse in emacs results in strange output" Tags="|key-bindings|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19429" PostTypeId="1" AcceptedAnswerId="19432" CreationDate="2016-01-11T07:55:57.620" Score="1" ViewCount="285" Body="&lt;p&gt;I want to remove magit local key binding for &lt;code&gt;C-w&lt;/code&gt; (to use global one).&#xA;But can't find which hook I can use for that.&lt;/p&gt;&#xA;" OwnerUserId="10741" LastEditorUserId="105" LastEditDate="2021-12-20T00:16:08.263" LastActivityDate="2021-12-20T00:16:08.263" Title="Unset local key binding in `magit-status`" Tags="|key-bindings|magit|hooks|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19430" PostTypeId="2" ParentId="17333" CreationDate="2016-01-11T10:10:37.107" Score="0" Body="&lt;p&gt;You can also do something like this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-change-major-mode-hook&#xA;          '(lambda ()&#xA;             (linum-mode&#xA;              (if (-contains?&#xA;               '(text-mode&#xA;                 term-mode&#xA;                 help-mode&#xA;                 doc-view-mode)&#xA;               0 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="-1" LastEditDate="2023-01-10T09:06:11.617" LastActivityDate="2023-01-10T09:06:11.617" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19431" PostTypeId="1" CreationDate="2016-01-11T11:08:59.647" Score="4" ViewCount="3361" Body="&lt;p&gt;I want to add a Tramp method for opening files from Docker containers. Here's what I've got so far (but it doesn't work):&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'tramp-methods&#xA;             '(&amp;quot;docker&amp;quot;&#xA;               (tramp-login-program &amp;quot;docker&amp;quot;)&#xA;               (tramp-login-args&#xA;                ((&amp;quot;run&amp;quot; &amp;quot;-ti&amp;quot; &amp;quot;%h&amp;quot; &amp;quot;bash&amp;quot;)))))&#xA;(setq tramp-debug-buffer t)&#xA;(setq tramp-verbose 10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The output this produces:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for test-newapi using docker...failed&#xA;Tramp: Opening connection for test-newapi using docker...failed&#xA;Tramp: Opening connection for test-newapi using docker...failed&#xA;Tramp: Opening connection for test-newapi using docker...failed&#xA;Tramp: Opening connection for test-newapi using docker...failed&#xA;byte-code: Host `test' looks like a remote host, `docker' can only use the local host&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When trying to open &lt;code&gt;/docker:test:/&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&lt;p&gt;How can I see what exactly Tramp was doing (what command did it feed to Docker?)&lt;/p&gt;&#xA;&lt;h1&gt;PS&lt;/h1&gt;&#xA;&lt;p&gt;I found &lt;a href=&quot;http://www.emacswiki.org/emacs/TrampAndDocker&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;, but it gives the same result.&lt;/p&gt;&#xA;&lt;h1&gt;PPS&lt;/h1&gt;&#xA;&lt;p&gt;Nevermind, it had to be &lt;code&gt;(tramp-login-args ((&amp;quot;run&amp;quot; &amp;quot;-ti&amp;quot;) (&amp;quot;%h&amp;quot;) (&amp;quot;bash&amp;quot;)))&lt;/code&gt;. But I'd still want to know how to debug a problem like this.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-06-13T12:41:40.637" Title="Tramp method for Docker" Tags="|tramp|networking|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19432" PostTypeId="2" ParentId="19429" CreationDate="2016-01-11T11:29:06.503" Score="2" Body="&lt;pre&gt;&lt;code&gt;(add-hook 'magit-status-mode-hook&#xA;          (lambda () (define-key magit-status-mode-map &quot;\C-w&quot; nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;C-h m&lt;/kbd&gt; to view the doc for the current major mode and &lt;kbd&gt;C-s hook&lt;/kbd&gt; to search for hook, then you should know which hook to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is another way without using hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'magit&#xA;  (define-key magit-status-mode-map &quot;\C-w&quot; nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-01-11T11:29:06.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19434" PostTypeId="2" ParentId="19431" CreationDate="2016-01-11T11:52:05.537" Score="1" Body="&lt;p&gt;I don't know how to integrate docker with Tramp, but you seem to have it solved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you have enabled Tramp traces, there is a Tramp debug buffer. Enable at least trace level 6. Then you can search through the debug buffer with &lt;code&gt;(6)&lt;/code&gt;, this shows you all commands Tramp has sent, and the responses.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-01-11T11:52:05.537" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19435" PostTypeId="2" ParentId="19429" CreationDate="2016-01-11T12:00:47.037" Score="4" Body="&lt;p&gt;To remove Magit's binding use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'magit&#xA;  (define-key magit-status-mode-map &quot;\C-w&quot; nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This delays changing the key binding until the keymap you want to change actually exists. You should never use a major-mode hook to change a key binding, because that would re-establish the (un)binding every time a buffer is created that uses the same major-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in this particular case there is no reason to restore the default binding. Magit's binding for &lt;kbd&gt;C-w&lt;/kbd&gt;,&lt;code&gt;magit-copy-section-value&lt;/code&gt;, does shadow the global binding, &lt;code&gt;kill-region&lt;/code&gt;. But that doesn't matter because &lt;code&gt;kill-region&lt;/code&gt; only works when the region is active, and &lt;code&gt;magit-copy-section-value&lt;/code&gt; does fall back to do the same thing as &lt;code&gt;kill-region&lt;/code&gt; does, when the region is active. So effectively Magit does &lt;em&gt;not&lt;/em&gt; shadow the global binding, it augments it.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-01-11T17:04:05.063" LastActivityDate="2016-01-11T17:04:05.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19437" PostTypeId="2" ParentId="19422" CreationDate="2016-01-11T15:51:53.990" Score="3" Body="&lt;p&gt;As lunaryorn mentioned that style is not popular and there aren't any packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there is a package called &lt;a href=&quot;https://github.com/naiquevin/sphinx-doc.el&quot; rel=&quot;nofollow&quot;&gt;sphinx-doc&lt;/a&gt; which will generate doc string in sphinx format(&lt;a href=&quot;https://github.com/naiquevin/sphinx-doc.el&quot; rel=&quot;nofollow&quot;&gt;demo&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can modify that package to generate strings as per your requirement.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2016-01-11T15:51:53.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19438" PostTypeId="2" ParentId="19422" CreationDate="2016-01-11T15:59:24.230" Score="-1" Body="&lt;p&gt;You can use this code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Move the cursor on your function name and then F9.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (defun chomp (str)&#xA;        &quot;Chomp leading and tailing whitespace from STR.&quot;&#xA;        (let ((s (if (symbolp str) (symbol-name str) str)))&#xA;          (replace-regexp-in-string&#xA;           &quot;\\(^[[:space:]\n]*\\|[[:space:]\n]*$\\)&quot; &quot;&quot; s)))&#xA; (defun get-function-definition(sentence)&#xA;    (if (string-match &quot;def.*(.*):&quot; sentence)&#xA;        (match-string 0 sentence)))&#xA; (defun get-parameters(sentence)&#xA;    (setq y (get-function-definition sentence))&#xA;    (if y&#xA;        (if (string-match &quot;(.*)&quot; y)&#xA;            (match-string 0 y))))&#xA; (autoload 'thing-at-point &quot;thingatpt&quot; nil t) ;; build-in librairie&#xA; (defun python-insert-docstring()&#xA;        (interactive)&#xA;        (setq p (get-parameters (thing-at-point 'sentence)))&#xA;        (forward-line 1)&#xA;        (insert &quot;    \&quot;\&quot;\&quot;\n&quot;)&#xA;        (insert &quot;\tArgs:\n&quot;)&#xA;        (setq params (split-string p &quot;[?\,?\(?\)?\ ]&quot;))&#xA;        (while params&#xA;          (if (/= (length (chomp (car params))) 0)&#xA;              (progn&#xA;                (insert &quot;        &quot;)&#xA;                (insert (chomp (car params)))&#xA;                (insert &quot;: \n&quot;)))&#xA;          (setq params (cdr params)))&#xA;        (insert &quot;    Returns:\n    \&quot;\&quot;\&quot;\n&quot;))&#xA;      (global-set-key (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'python-insert-docstring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-01-11T15:59:24.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19439" PostTypeId="1" CreationDate="2016-01-11T16:22:24.080" Score="4" ViewCount="152" Body="&lt;p&gt;When writing LaTeX code I use a snippet that expands &lt;code&gt;begin&lt;/code&gt; to the following&#xA;&lt;code&gt;&#xA;\begin{$1}&#xA;    \label{$1:$2}&#xA;    $0&#xA;\end{$1}&#xA;&lt;/code&gt;&#xA;This suits most of my purposes well, since I use labels rather systematically. Still there are often times when I do not need a label in an environment and I'd love for a slightly more sophisticated snippet to be possible. I suppose my question boils down to the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above snippet, is it possible to tell yasnippet to write&#xA;&lt;code&gt;&#xA;\begin{$1}&#xA;    $0&#xA;\end{$1}&#xA;&lt;/code&gt;&#xA;if I have started typing part of the &lt;code&gt;$0&lt;/code&gt; input after leaving &lt;code&gt;$2&lt;/code&gt; blank?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize there are many reasonable alternatives to automating this, including using either a separate, non-labelled version of this snippet when I don't need labels or replacing the second snippet line with &lt;code&gt;$2\label{$1:$3}&lt;/code&gt; and killing that line when unnecessary; this is more of an educational exercise for me about the more advanced features in &lt;code&gt;yasnippets&lt;/code&gt;. I feel like knowing how to optionally remove portions of a snippet based on input would be useful in other applications. Thanks in advance for your advice!&lt;/p&gt;&#xA;" OwnerUserId="8643" LastActivityDate="2016-01-11T16:22:24.080" Title="Conditionally remove parts of a snippet when the corresponding input field is left empty?" Tags="|yasnippet|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19440" PostTypeId="1" AcceptedAnswerId="19525" CreationDate="2016-01-11T16:28:46.760" Score="18" ViewCount="6783" Body="&lt;p&gt;I am forced to use Windows 10 for a project. Yes, I would rather use GNU/Linux. To keep my sanity, I've tried to regard Windows as a bootloader for Emacs :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, Magit (one of my favorite parts of Emacs, which also makes up for the lack of a good command line on Windows) is unbearably slow. I have an SSD, 16 GB of RAM and a quad-core i7 but it takes &lt;strong&gt;eight seconds&lt;/strong&gt; to execute &lt;code&gt;magit-status&lt;/code&gt; on a small repository. Then, when I want to stage another change, it takes about 5 seconds &lt;em&gt;per file&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I've tried:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;$ git config --global core.preloadindex true&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$ git config --global core.fscache true&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$ git config --global gc.auto 256&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Adding the entire project to the Windows Defender (my only AV) exclusion list&lt;/li&gt;&#xA;&lt;li&gt;Setting the &lt;code&gt;magit-git-executable&lt;/code&gt; to the regular msysgit one I downloaded (&lt;a href=&quot;https://git-for-windows.github.io/&quot; rel=&quot;noreferrer&quot;&gt;https://git-for-windows.github.io/&lt;/a&gt;). I checked and &lt;code&gt;git status&lt;/code&gt; here takes &amp;lt; 1 second. I know that &lt;code&gt;magit-status&lt;/code&gt; does way more, but this is too much.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest ways to make this faster? I can't imagine anyone using Magit on Windows like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was suggested that &lt;a href=&quot;https://emacs.stackexchange.com/questions/17783/why-does-emacs-take-longer-to-start-on-windows-than-on-linux&quot;&gt;this question&lt;/a&gt; is a duplicate, but they asked:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'm struggling to understand why Emacs have noticeably shorter startup time on Ubuntu than Windows. Anyone knows the answer?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I know at least some reasons why Emacs, Git, and Magit are slower on Windows. I am asking &lt;em&gt;how do I optimize Magit&lt;/em&gt; to do fewer things, or cache results, or something, even if it's at the expense of functionality.&lt;/p&gt;&#xA;" OwnerUserId="8465" LastEditorUserId="20340" LastEditDate="2019-05-17T12:08:20.907" LastActivityDate="2020-05-11T17:14:19.223" Title="Magit extremely slow in Windows. How do I optimize?" Tags="|magit|microsoft-windows|git|performance|" AnswerCount="3" CommentCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="19441" PostTypeId="1" CreationDate="2016-01-11T17:01:55.017" Score="1" ViewCount="101" Body="&lt;p&gt;I'm trying to use GUD more as a front-end to GDB. I mostly work in the interaction buffer as I do normally on the command line. However when I come across a particular line in the code (through bt or frame) how can I jump to the code buffer? It seems such an obvious navigation but I can't figure out what command it is.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2016-01-11T17:01:55.017" Title="Jumping from gud-interaction-buffer to code" Tags="|gud|gdb|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19442" PostTypeId="1" AcceptedAnswerId="19462" CreationDate="2016-01-11T17:38:20.577" Score="1" ViewCount="122" Body="&lt;p&gt;I've been successfully using org2blog for awhile, but it has stopped working in recent days. When I try to log in from emacs, org2blog asks my password as always. I provide it, and the process fails with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xml-rpc-request: Error during request: 403&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can still log in to my account from my web browser, so it doesn't appear to be on that end. Here's my init.el lines for org2blog:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; * org2blog &#xA;(require 'org2blog-autoloads)&#xA;(setq org2blog/wp-blog-alist&#xA;   '((&quot;stevenarntson.com&quot;&#xA;      :url &quot;http://stevenarntson.com/xmlrpc.php&quot;&#xA;      :username &quot;stevenarntson&quot;&#xA;      :tags-as-categories nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is wrong here, or, alternatively, what next step should I take to diagnose this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs 24.5.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org 8.3.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org2blog .9.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;xml-rpc 1.6.11&lt;/p&gt;&#xA;" OwnerUserId="2413" LastActivityDate="2016-01-12T04:19:47.527" Title="org2blog/xml-rpc posting fails with &quot;403&quot;" Tags="|org-mode|xml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19443" PostTypeId="1" AcceptedAnswerId="19444" CreationDate="2016-01-11T17:49:03.643" Score="4" ViewCount="747" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;noreferrer&quot;&gt;Hydra&lt;/a&gt;, and find it very useful. However, I often find that I can only remember the key to trigger the hydra itself, but can't remember which keys are used for the &quot;heads&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, Hydra will give me a nicely formatted list of the keys and the commands they will trigger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/H2Tk4.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/H2Tk4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I can only seem to get this list of hints to come up once I have &lt;em&gt;already successfully triggered one of the commands listed&lt;/em&gt; - this requires that I remember how to trigger at least one of the heads, which is sometimes not the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there any way to have the hints show up immediately?&lt;/strong&gt; That is, if I have the following hydra: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defhydra hydra-transpose (global-map &quot;C-t&quot;)&#xA;  &quot;transposing hydra&quot;&#xA;  (&quot;l&quot; transpose-lines &quot;lines&quot;)&#xA;  (&quot;w&quot; transpose-words &quot;words&quot;)&#xA;  (&quot;s&quot; transpose-sexps &quot;sexps&quot;)&#xA;  (&quot;p&quot; transpose-paragraphs &quot;paragraphs&quot;)&#xA;  (&quot;c&quot; transpose-chars &quot;characters&quot;)&#xA;  (&quot;w&quot; transpose-frame &quot;windows&quot;)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I get it to show me hints as soon as I hit&lt;/strong&gt; &lt;code&gt;C-t&lt;/code&gt;? &lt;a href=&quot;https://github.com/abo-abo/hydra#description-for-pragmatics&quot; rel=&quot;noreferrer&quot;&gt;The documentation seems to suggest that this is possible&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assign a custom hint to this group of functions, so that you know immediately after pressing C-c that you can follow up with j or k.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But I have not yet been able to figure out how to accomplish this by reading the documentation, or by exploring the different hydra variables and functions. Does anyone know if this is possible/how to achieve it?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-11T18:01:56.607" Title="Make hints appear immedietly when using Hydra" Tags="|key-bindings|hydra|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19444" PostTypeId="2" ParentId="19443" CreationDate="2016-01-11T18:01:56.607" Score="5" Body="&lt;p&gt;Here's how to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defhydra hydra-transpose ()&#xA;  &quot;transposing hydra&quot;&#xA;  (&quot;l&quot; transpose-lines &quot;lines&quot;)&#xA;  (&quot;w&quot; transpose-words &quot;words&quot;)&#xA;  (&quot;s&quot; transpose-sexps &quot;sexps&quot;)&#xA;  (&quot;p&quot; transpose-paragraphs &quot;paragraphs&quot;)&#xA;  (&quot;c&quot; transpose-chars &quot;characters&quot;)&#xA;  (&quot;w&quot; transpose-frame &quot;windows&quot;))&#xA;(global-set-key (kbd &quot;C-t&quot;) 'hydra-transpose/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/abo-abo/hydra/wiki/Binding-Styles&quot; rel=&quot;noreferrer&quot;&gt;the documentation&lt;/a&gt; for more info.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-01-11T18:01:56.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19445" PostTypeId="1" AcceptedAnswerId="19476" CreationDate="2016-01-11T19:19:29.207" Score="2" ViewCount="774" Body="&lt;p&gt;Using &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot; rel=&quot;nofollow&quot;&gt;markdown-mode&lt;/a&gt;, I can run &lt;code&gt;M-x markdown-live-preview-mode&lt;/code&gt; (or &lt;code&gt;C-c C-c l&lt;/code&gt;) and it will split the window horizontally and display the rendered markdown (i.e. the HTML) with &lt;code&gt;eww&lt;/code&gt; in a window below the markdown text window. How can I get this command to instead split the window vertically so that the markdown and rendered output are side by side? I'd like to avoid having to manually &lt;a href=&quot;http://www.emacswiki.org/emacs/ToggleWindowSplit&quot; rel=&quot;nofollow&quot;&gt;toggle the window split&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10746" LastActivityDate="2016-01-12T13:39:11.043" Title="How to default markdown-mode's markdown-live-preview-mode to vertical split" Tags="|window|window-splitting|markdown-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19446" PostTypeId="1" AcceptedAnswerId="19452" CreationDate="2016-01-11T19:45:15.603" Score="2" ViewCount="219" Body="&lt;p&gt;I'm a heavy Emacs Org-mode user and VERY dependent on the date functionality. I frequently enter events, receipts, etc. using capture templates after they've already occurred. My current solution is to prompt for the relevant dates or change them manually, but this is time consuming and error prone. Emacs documentation and Googling failed me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to hit a few keys (or execute a function), change and freeze the date-time at (for example) noon yesterday, &lt;code&gt;[2016-01-11 12:00]&lt;/code&gt;, perform some Org-mode functions (state changes, capture templates, logging time, etc.) which all operate as indented with the new &quot;frozen date-time&quot;, then hit a few keys (or execute a function) to return the clock to normal behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="804" LastEditorUserId="804" LastEditDate="2016-01-11T19:55:07.643" LastActivityDate="2016-01-12T15:56:49.323" Title="Is it possible to change and freeze the current date-time in Emacs?" Tags="|org-mode|time-date|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19448" PostTypeId="1" AcceptedAnswerId="19451" CreationDate="2016-01-11T20:49:33.187" Score="6" ViewCount="134" Body="&lt;p&gt;I use a Gnus score file to mark certain Usenet articles that I don't want to read. For example, a line from my &lt;code&gt;$HOME/News/name.of.newsgroup.SCORE&lt;/code&gt; might look something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;troll@example.com&quot; -1000 nil e)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I enter the newsgroup, articles from that user are marked as read, but they still show up in the list of articles in the Summary buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's easy enough to type &lt;code&gt;x&lt;/code&gt; (&lt;code&gt;gnus-summary-limit-to-unread&lt;/code&gt;) to remove those articles from the list, but is there a way to configure Gnus so I don't see them in the first place?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, is it also possible to configure my score file so that &lt;em&gt;some&lt;/em&gt; articles are not shown at all, while others are shown but automatically marked as read? (For example, I might assign a larger negative score to articles I don't want to see at all.)&lt;/p&gt;&#xA;" OwnerUserId="540" LastActivityDate="2016-01-11T21:14:31.430" Title="Gnus: Don't show negatively scored articles" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19449" PostTypeId="1" CreationDate="2016-01-11T21:01:08.663" Score="4" ViewCount="2189" Body="&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;gnus&lt;/code&gt; under &lt;code&gt;emacs -nw&lt;/code&gt; (so this question is about text-based usage, not the GUI).  Depending on the value of the &lt;code&gt;$TERM&lt;/code&gt; environment variable, &lt;code&gt;gnus&lt;/code&gt; will, for example, highlight quoted text in articles, using different colors depending on the depth of quoting (the number of &lt;code&gt;&amp;gt;&lt;/code&gt; characters at the beginning of each line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally prefer plain black text on a white or light background. I usually run &lt;code&gt;emacs -nw&lt;/code&gt; in a terminal emulator with color disabled; in that case it isn't an issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for some ssh clients on mobile devices (particularly JuiceSSH on Android), there doesn't seem to be a way to disable color in the terminal emulator. And the default color scheme seems to assume I have a black background; since I use a white background, yellow text is essentially illegible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One workaround I've found is to set &lt;code&gt;$TERM&lt;/code&gt; to &lt;code&gt;vt100&lt;/code&gt;, but that requires quitting and restarting emacs.  (I run it under GNU &lt;code&gt;screen&lt;/code&gt;, so I commonly view the same Emacs session on different terminal emulators.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Finally, the question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a command or configuration option in &lt;code&gt;emacs&lt;/code&gt; or in &lt;code&gt;gnus&lt;/code&gt; to tell it &lt;em&gt;not&lt;/em&gt; to use color highlighting &lt;em&gt;without&lt;/em&gt; quitting and restarting either &lt;code&gt;emacs&lt;/code&gt; or &lt;code&gt;gnus&lt;/code&gt;? A global configuration for &lt;code&gt;emacs&lt;/code&gt; would be ideal, but something specific to &lt;code&gt;gnus&lt;/code&gt; would do nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not practical, a decent backup solution would be a &lt;em&gt;straightforward&lt;/em&gt; way to use a color scheme that's legible on a white background.&lt;/p&gt;&#xA;" OwnerUserId="540" LastEditorUserId="540" LastEditDate="2016-01-11T21:23:34.067" LastActivityDate="2016-08-09T17:58:46.633" Title="Disable color highlighting" Tags="|gnus|display|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19450" PostTypeId="2" ParentId="19449" CreationDate="2016-01-11T21:07:14.300" Score="3" Body="&lt;p&gt;If all of the coloring is from &lt;code&gt;font-lock-mode&lt;/code&gt; you can just turn off that mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also get the &lt;em&gt;effect&lt;/em&gt; of removing all highlighting for a particular face by just customizing that face to be the same as face &lt;code&gt;default&lt;/code&gt; (just inherit from face &lt;code&gt;default&lt;/code&gt; and turn off all other face attributes besides inherit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can tell which face is used to highlight a given bit of text by putting the text cursor on that text and hitting &lt;code&gt;C-u C-x =&lt;/code&gt;. The &lt;code&gt;*Help*&lt;/code&gt; output tells you what faces are used at point (the cursor position).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-11T21:07:14.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19451" PostTypeId="2" ParentId="19448" CreationDate="2016-01-11T21:14:31.430" Score="3" Body="&lt;p&gt;You can set the variable &lt;code&gt;gnus-summary-expunge-below&lt;/code&gt; to control below which score not to show.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have set it to -9999 and I score articles I don't want to even appear in the Summary buffer -10000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Articles I want automatically read, but still shown in the Summary, I usually score at -5000.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-01-11T21:14:31.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19452" PostTypeId="2" ParentId="19446" CreationDate="2016-01-11T21:52:49.213" Score="6" Body="&#xA;&#xA;&lt;p&gt;Sure such evil stuff is possible with elisp. But be warned. I am not aware of all the dark consequences that this evil piece of black art has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you interactively run &lt;code&gt;freeze-time&lt;/code&gt; you can input the date string at which you want to freeze the time.&#xA;From then on time is frozen until you run &lt;code&gt;release-time&lt;/code&gt; which undoes this science fiction scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do not expect any version control system or any file system function which trusts in the modification time of files to work reliable after such a hack!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, that I have running something similar in my org-system. But, I use it only locally within an advice of `org-time-stamp-inactive'.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;;; The real evil-mode:&#xA;(require 'org)&#xA;(defun freeze-time (time)&#xA;  &quot;Freeze `current-time' at the given TIME&quot;&#xA;  (interactive (list (org-read-date nil nil nil &quot;Input freeze time:&quot;)))&#xA;  (eval (macroexpand `(defadvice current-time (around freeze activate)&#xA;            (setq ad-return-value ',(append (org-read-date nil t time) '(0 0)))))))&#xA;&#xA;(defun release-time ()&#xA;  &quot;Release the time frozen by `freeze-time'.&quot;&#xA;  (interactive)&#xA;  (ad-remove-advice 'current-time 'around 'freeze)&#xA;  (ad-update 'current-time))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Thanks Phils for pointing out the need to activate the advice after its removal.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There follows a more subtle method that only advices a set of org functions that use &lt;code&gt;current-time&lt;/code&gt;.&#xA;The advantage is that it does not potentially blow up emacs. The disadvantage is that some maintenance of &lt;code&gt;org-commands-with-current-time&lt;/code&gt; may be required. It may be that some functions are not covered in this list and that this list must be adapted to the further development of org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar org-commands-with-current-time '(org-current-time org-read-date-analyze org-today org-current-effective-time org-todo-yesterday org-read-date-analyze org-time-stamp-to-now org-small-year-to-year org-closest-date org-goto-calendar org-get-cursor-date org-time-string-to-absolute org-time-stamp-inactive org-time-stamp org-sort-entries)&#xA;  &quot;Functions to be adviced by `org-ad-freeze-time'.&quot;)&#xA;&#xA;(defvar org-frozen-time nil&#xA;  &quot;Frozen time for org-commands. It should have the same format as the return value of `current-time'.&#xA;Time flows normal if set to `nil'.&quot;)&#xA;&#xA;(defun org-freeze-time (time)&#xA;  &quot;Freeze `current-time' at the given TIME in the org-functions from `org-commands-with-current-time'&quot;&#xA;  (interactive (list (org-read-date nil nil nil &quot;Input freeze time:&quot;)))&#xA;  (setq org-frozen-time (append (org-read-date nil t time) '(0 0))))&#xA;&#xA;(defun org-release-time ()&#xA;  &quot;Release the time frozen by `org-freeze-time'.&quot;&#xA;  (interactive)&#xA;  (setq org-frozen-time nil))&#xA;&#xA;(defmacro org-ad-freeze-time (fun)&#xA;  &quot;Advice FUN to use `org-frozen-time'.&quot;&#xA;  (let ((old-def (make-symbol &quot;old-def&quot;)))&#xA;    `(defadvice ,fun (around freeze-time activate)&#xA;       (let ((,old-def (symbol-function 'current-time)))&#xA;     (unwind-protect&#xA;         (progn&#xA;           (when org-frozen-time&#xA;         (fset 'current-time (lambda () org-frozen-time)))&#xA;           ad-do-it)&#xA;       (fset 'current-time ,old-def))))))&#xA;&#xA;(dolist (fun org-commands-with-current-time)&#xA;  (eval (macroexpand `(org-ad-freeze-time ,fun))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here's what the end should look like if you want to use nadvice instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-ad-frozen-time () org-frozen-time)&#xA;(defun org-ad-with-frozen-time (&amp;amp;rest args)&#xA;  (unwind-protect&#xA;      (progn&#xA;        (when org-frozen-time&#xA;          (advice-add 'current-time :override #'org-ad-frozen-time))&#xA;        (apply args))&#xA;    (advice-remove 'current-time #'org-ad-frozen-time)))&#xA;(dolist (fun org-commands-with-current-time)&#xA;  (advice-add fun :around #'org-ad-with-frozen-time))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Look ma!  No &lt;code&gt;eval&lt;/code&gt;, no &lt;code&gt;macroexpand&lt;/code&gt;, no &lt;code&gt;defmacro&lt;/code&gt;!&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="115" LastEditDate="2016-01-12T15:56:49.323" LastActivityDate="2016-01-12T15:56:49.323" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19455" PostTypeId="2" ParentId="18615" CreationDate="2016-01-12T01:05:33.440" Score="-1" Body="&lt;p&gt;It's not quite a full answer (unless you're O. K. with ditching web-mode which I would think is less than ideal) but Hideshow Minor Mode will, technically, get the job done for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you enable it (with &lt;code&gt;(hs-minor-mode t)&lt;/code&gt;), running the function &lt;code&gt;hs-hide-block&lt;/code&gt; while the cursor is within a pair of curly braces will fold that block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one snag in all of this – from the perspective of web development in Emacs – is that Web Mode won't allow you to enable Hideshow Minor Mode while it (Web Mode) is in use. An ideal answer will allow find someway to enable the feature while keeping Web Mode present and fully functional.&lt;/p&gt;&#xA;" OwnerUserId="10750" LastActivityDate="2016-01-12T01:05:33.440" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="19456" PostTypeId="1" AcceptedAnswerId="19457" CreationDate="2016-01-12T01:14:35.073" Score="3" ViewCount="287" Body="&lt;p&gt;I'd like &lt;code&gt;tab-width&lt;/code&gt; to be set to 2 in all programming modes.  I use &lt;code&gt;prelude&lt;/code&gt; (which might be one of the problems), but I have this in my &lt;code&gt;custom.el&lt;/code&gt; (which is sort of the analogue to &lt;code&gt;.emacs&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-tab-width 2)&#xA;(setq standard-indent my-tab-width)&#xA;(setq tab-width my-tab-width)&#xA;(setq c-basic-offset my-tab-width)&#xA;(setq js2-basic-offset my-tab-width)&#xA;(setq web-mode-attr-indent-offset my-tab-width)&#xA;(setq web-mode-code-indent-offset my-tab-width)&#xA;(setq web-mode-css-indent-offset my-tab-width)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I avoid all the duplication?&lt;/p&gt;&#xA;" OwnerUserId="653" LastEditorUserId="653" LastEditDate="2016-01-12T06:11:13.990" LastActivityDate="2016-01-12T06:11:13.990" Title="How do I set a variable in all programming modes?" Tags="|customize|programming|tabs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19457" PostTypeId="2" ParentId="19456" CreationDate="2016-01-12T01:23:27.360" Score="3" Body="&lt;p&gt;(Nearly) all &lt;a href=&quot;http://emacsredux.com/blog/2013/04/05/prog-mode-the-parent-of-all-programming-modes/&quot; rel=&quot;nofollow&quot;&gt;programming modes inherit&lt;/a&gt; from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;prog-mode&lt;/code&gt;&lt;/a&gt;, so you can set the variable in &lt;code&gt;prog-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-prog-mode-hook ()&#xA;  (setq tab-width 2))&#xA;(add-hook 'prog-mode-hook #'my-prog-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that you could use a lambda instead, but this way you'll have an easier time removing the hook if you ever want to do so.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-01-12T01:42:44.223" LastActivityDate="2016-01-12T01:42:44.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19458" PostTypeId="2" ParentId="18281" CreationDate="2016-01-12T01:45:42.547" Score="9" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/rejeep/f.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;f&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; third-party library has &lt;a href=&quot;https://github.com/rejeep/f.el#f-write-text-text-coding-path&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;f-write-text&lt;/code&gt;&lt;/a&gt; and some other file manipulation functions, such as &lt;a href=&quot;https://github.com/rejeep/f.el#f-exists-path&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;f-exists?&lt;/code&gt;&lt;/a&gt; predicate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(f-write-text &quot;some string&quot; 'utf-8 &quot;path/to/my/file.txt&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-01-12T01:45:42.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19459" PostTypeId="2" ParentId="10628" CreationDate="2016-01-12T01:55:47.903" Score="1" Body="&lt;p&gt;One idea is to use &lt;a href=&quot;https://github.com/magnars/dash.el#-map-indexed-fn-list&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;-map-indexed&lt;/code&gt;&lt;/a&gt; from &lt;a href=&quot;https://github.com/magnars/dash.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;dash&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; and apply transformation only to odd values of the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(-non-nil (-map-indexed (lambda (index item) (when (oddp index) item))&#xA;  '(a x b y c z))) ; =&amp;gt; (x y z)&#xA;(-non-nil (--map-indexed (when (oddp it-index) it) '(a x b y c z))) ; =&amp;gt; (x y z)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another idea is to just convert a plist to a hash-table, using &lt;code&gt;ht&amp;lt;-plist&lt;/code&gt; from &lt;a href=&quot;https://github.com/Wilfred/ht.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;ht&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ht-values (ht&amp;lt;-plist '(a x b y c z) 'equal)) ; (z y x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that hash-table doesn't preserve the order of items.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-01-12T01:55:47.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19460" PostTypeId="1" AcceptedAnswerId="19474" CreationDate="2016-01-12T02:38:30.037" Score="1" ViewCount="178" Body="&lt;p&gt;I am using magit in spacemacs 105.7. When I press &lt;code&gt;l l&lt;/code&gt; from the &lt;code&gt;magit-status&lt;/code&gt; buffer to list the commit history, it pops out &quot;Log rev,s (tags/8000.123^0):&quot; in the mini buffer, and when I press enter, then it will list all the commits. Why does this message pop up?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="306" LastEditDate="2016-01-12T12:27:21.360" LastActivityDate="2016-01-12T12:27:21.360" Title="message of &quot;Log rev,s (tags/8000.123^0):&quot; in magit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19461" PostTypeId="1" AcceptedAnswerId="19463" CreationDate="2016-01-12T02:57:53.350" Score="8" ViewCount="562" Body="&lt;p&gt;Having copied the 3x3 rectangular region containing &lt;code&gt;a&lt;/code&gt;'s, how can I yank/paste that content at the desired point without slicing into the following text?  The following is the behavior for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-w&lt;/code&gt; (kill-ring-save), &lt;code&gt;M-y&lt;/code&gt; (kill-ring-save)&lt;/li&gt;&#xA;&lt;li&gt;(copy-rectangle-as-kill), &lt;code&gt;C-x r y&lt;/code&gt; (yank-rectangle)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(all using &lt;code&gt;C-x SPC&lt;/code&gt; (rectangle-mark-mode))&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aaa&#xA;aaa&#xA;aaa&#xA;&#xA;Insert&#xA;here -&amp;gt;aaa&#xA;Here isaaa some text after &#xA;the yanaaak point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to figure out how to yank, so that this is the result.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Insert&#xA;here -&amp;gt;aaa&#xA;aaa&#xA;aaa&#xA;Here is some text after &#xA;the yank point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'll admit that I've been yanking rectangles at the bottom of buffers and then doing a normal region kill for some time now...&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2021-12-10T15:27:16.633" Title="Insert lines when yanking rectangle rather than inserting among following lines?" Tags="|rectangle|yank|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19462" PostTypeId="2" ParentId="19442" CreationDate="2016-01-12T04:19:47.527" Score="0" Body="&lt;p&gt;Something may have changed in your Wordpress config with respect to XML-RPC. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Opening the &lt;code&gt;xmlrpc.php&lt;/code&gt; page in a browser is giving a 403 instead of a GET not allowed response. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://testorg2blog.wordpress.com/xmlrpc.php&quot; rel=&quot;nofollow&quot;&gt;https://testorg2blog.wordpress.com/xmlrpc.php&lt;/a&gt; vs. &lt;a href=&quot;http://stevenarntson.com/xmlrpc.php&quot; rel=&quot;nofollow&quot;&gt;http://stevenarntson.com/xmlrpc.php&lt;/a&gt; in a browser. &lt;/p&gt;&#xA;" OwnerUserId="2465" LastActivityDate="2016-01-12T04:19:47.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19463" PostTypeId="2" ParentId="19461" CreationDate="2016-01-12T05:24:21.653" Score="3" Body="&lt;p&gt;Removing &lt;code&gt;yank-handler&lt;/code&gt; text property from just killed text should do the trick, since this will make &lt;code&gt;yank&lt;/code&gt; use normal &lt;code&gt;insert&lt;/code&gt; instead of &lt;code&gt;rectangle-mark-mode&lt;/code&gt;'s own insert function.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kill-ring-save--strip (orig-fun &amp;amp;rest args)&#xA;  (let ((rtv (apply orig-fun args)))&#xA;    (if rectangle-mark-mode&#xA;        (let ((killed (car kill-ring)))&#xA;          (remove-text-properties 0 (length killed) '(yank-handler nil) killed)&#xA;          (setcar kill-ring killed)))&#xA;    rtv))&#xA;&#xA;(advice-add 'kill-ring-save :around #'kill-ring-save--strip)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-01-12T05:24:21.653" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19464" PostTypeId="1" CreationDate="2016-01-12T06:37:46.393" Score="6" ViewCount="848" Body="&lt;p&gt;When I execute a &lt;code&gt;M-x describe-variable web-mode-markup-indent-offset&lt;/code&gt; I get this output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;web-mode-markup-indent-offset is a variable defined in `web-mode.el'.&#xA;Its value is 4&#xA;Original value was 2&#xA;&#xA;Documentation:&#xA;Html indentation level.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the original value, but I can't find where in my setup I've set it to 4. Is there a way to determine this? (I'm using prelude, if that matters).&lt;/p&gt;&#xA;" OwnerUserId="653" LastActivityDate="2017-04-28T15:51:24.373" Title="How do I determine where a variable is set?" Tags="|customize|" AnswerCount="2" CommentCount="1" ClosedDate="2017-05-01T00:39:34.080" ContentLicense="CC BY-SA 3.0" />
  <row Id="19465" PostTypeId="1" CreationDate="2016-01-12T06:42:52.737" Score="1" ViewCount="594" Body="&lt;p&gt;I'm a very new user (~ 2 days) to Emacs. I switched from vim, because it wasn't working for me. I'm learning C++ and I've run into this issue when I write &lt;code&gt;M-x compile&lt;/code&gt;. Upon writing this command, emacs always runs &lt;code&gt;make -k&lt;/code&gt; on my small test program. However, I want it that emacs asks me what command to run for instance, in this example I want to run &lt;code&gt;g++ program_ name -o output_name&lt;/code&gt;. Can anyone help me out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="10751" LastActivityDate="2016-01-12T15:12:05.400" Title="`M-x` compile always runs the same command" Tags="|c++|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19466" PostTypeId="2" ParentId="19464" CreationDate="2016-01-12T07:02:38.627" Score="2" Body="&lt;p&gt;A variable might be changed anywhere at runtime. Grep for it's name to see at which point it happens. &lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-01-12T07:02:38.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19467" PostTypeId="1" CreationDate="2016-01-12T08:47:40.373" Score="7" ViewCount="2595" Body="&lt;p&gt;Issuing &lt;code&gt;M-x org-html-htmlize-generate-css&lt;/code&gt; gives the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid face: font-lock-string&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What does this error mean and how can I correct it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issuing &lt;code&gt;$ grep -r &quot;font-lock-string[^-]&quot; ~/.emacs.d/&lt;/code&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d/elpa/solarized-theme-20160106.15/solarized.el: `(kite-string((,class (:inherit font-lock-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2016-01-12T19:20:42.133" LastActivityDate="2016-01-12T19:20:42.133" Title="How can I correct an &quot;Invalid face&quot; error?" Tags="|org-mode|faces|themes|" AnswerCount="0" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="19468" PostTypeId="2" ParentId="19465" CreationDate="2016-01-12T09:00:18.413" Score="0" Body="&lt;p&gt;You should get a prompt by default, unless you've set &lt;code&gt;compilation-read-command&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in your config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I always do is write a Makefile and use &lt;a href=&quot;https://github.com/abo-abo/helm-make&quot; rel=&quot;nofollow&quot;&gt;helm-make&lt;/a&gt; instead of &lt;code&gt;compile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-01-12T09:00:18.413" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19469" PostTypeId="1" CreationDate="2016-01-12T09:11:17.850" Score="3" ViewCount="210" Body="&lt;p&gt;Is there a way for the code inside of an &lt;code&gt;:eval&lt;/code&gt; form in the modeline format spec to determine whether the modeline will be drawn with the active or inactive face? I'd like part of the modeline to display differently based on whether its active or inactive. I speciafically don't want to use advice, since the code will end up being used in a package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(eq (get-buffer-window) (selected-window))&lt;/code&gt; always returns true from the code run in &lt;code&gt;mode-line-format&lt;/code&gt;, so that doesn't seem to do the trick. I also tried adding a hook to &lt;code&gt;buffer-list-change-hook&lt;/code&gt; as suggested by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Selecting-Windows.html&quot; rel=&quot;nofollow&quot;&gt;the manual&lt;/a&gt;, but that doesn't do; somehow some updates are missed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to check from the &lt;code&gt;:eval&lt;/code&gt; portion of a modeline format spec whether the window is selected?`&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Based on the following code I'll bet no, but I'd love to be proven wrong:)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Lisp_Object old_selected_window = selected_window;&#xA;  Lisp_Object old_selected_frame = selected_frame;&#xA;  Lisp_Object new_frame = w-&amp;gt;frame;&#xA;  Lisp_Object old_frame_selected_window = XFRAME (new_frame)-&amp;gt;selected_window;&#xA;  int n = 0;&#xA;&#xA;  selected_frame = new_frame;&#xA;  /* FIXME: If we were to allow the mode-line's computation changing the buffer&#xA;     or window's point, then we'd need select_window_1 here as well.  */&#xA;  XSETWINDOW (selected_window, w);&#xA;  XFRAME (new_frame)-&amp;gt;selected_window = selected_window;&#xA;&#xA;  /* These will be set while the mode line specs are processed.  */&#xA;  line_number_displayed = false;&#xA;  w-&amp;gt;column_number_displayed = -1;&#xA;&#xA;  if (WINDOW_WANTS_MODELINE_P (w))&#xA;    {&#xA;      struct window *sel_w = XWINDOW (old_selected_window);&#xA;&#xA;      /* Select mode line face based on the real selected window.  */&#xA;      display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w),&#xA;             BVAR (current_buffer, mode_line_format));&#xA;      ++n;&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2016-01-12T18:59:59.053" LastActivityDate="2016-01-12T18:59:59.053" Title="Can I know whether the current window is selected during a modeline update" Tags="|window|mode-line|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19470" PostTypeId="1" AcceptedAnswerId="19491" CreationDate="2016-01-12T09:51:16.850" Score="0" ViewCount="384" Body="&lt;p&gt;I'm not sure this is specific to helm, but when in helm's &lt;code&gt;helm-ucs&lt;/code&gt; (&lt;code&gt;C-c h 8&lt;/code&gt;) (though this also happens with &lt;a href=&quot;https://github.com/shosti/helm-unicode&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-unicode&lt;/code&gt;&lt;/a&gt;), I notice that some characters show the weird little box glyph as if the character can't be rendered, but then when I actually &quot;select&quot; them in helm, they do render. This seems very curious, and so I myself am curious as to what could be causing this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following example, consider the character &lt;code&gt;RIGHTWARDS ARROW WITH NOTCHED TAIL&lt;/code&gt;, though this happens with all of the other characters that show boxes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not selected:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tA3RU.png&quot; alt=&quot;not selected&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Selected:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/NunOQ.png&quot; alt=&quot;selected&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-05-13T00:57:52.597" Title="unicode character sometimes renders, sometimes doesn't" Tags="|helm|fonts|unicode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19471" PostTypeId="2" ParentId="19422" CreationDate="2016-01-12T10:33:02.260" Score="12" Body="&lt;h1&gt;Package&lt;/h1&gt;&#xA;&lt;p&gt;The code described in the following section have now been made available in a separate package. Please see this repository for details: &lt;a href=&quot;https://github.com/Xaldew/yasnippet-radical-snippets&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/Xaldew/yasnippet-radical-snippets&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;Old Answer&lt;/h1&gt;&#xA;&lt;p&gt;I use the package called &lt;a href=&quot;https://github.com/capitaomorte/yasnippet&quot; rel=&quot;nofollow noreferrer&quot;&gt;yasnippet&lt;/a&gt; for something similar to this. After some minor changes I adapted it to use the the Google docstring style instead:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uxSPU.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uxSPU.gif&quot; alt=&quot;Google styled Python yasnippet&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Do note however that it requires some setup:&lt;/p&gt;&#xA;&lt;p&gt;The snippet itself needs to execute some utility elisp code to generate the text. This is typically solved by creating a file called &lt;code&gt;.yas-setup.el&lt;/code&gt; with the code inside the &lt;code&gt;python-mode&lt;/code&gt; snippet directory. It is however also possible to place the code somewhere inside your &lt;code&gt;.emacs&lt;/code&gt; instead.&lt;/p&gt;&#xA;&lt;p&gt;The code for the snippet is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# Insert Google style docstring and function definition.&#xA;# name: Python Google style Docstring&#xA;# key: defg&#xA;# type: snippet&#xA;# contributor: Xaldew&#xA;# --&#xA;def ${1:name}($2):&#xA;    \&amp;quot;\&amp;quot;\&amp;quot;$3&#xA;    ${2:$(python-args-to-google-docstring yas-text t)}&#xA;    ${5:Returns:&#xA;        $6&#xA;}&#xA;    \&amp;quot;\&amp;quot;\&amp;quot;&#xA;    ${0:$$(let ((beg yas-snippet-beg)&#xA;                (end yas-snippet-end))&#xA;        (yas-expand-snippet&#xA;          (buffer-substring-no-properties beg end) beg end&#xA;              (quote ((yas-indent-line nil) (yas-wrap-around-region nil))))&#xA;            (delete-trailing-whitespace beg (- end 1)))}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The code for the &lt;code&gt;.yas-setup.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun python-args-to-google-docstring (text &amp;amp;optional make-fields)&#xA;  &amp;quot;Return a reST docstring format for the python arguments in yas-text.&amp;quot;&#xA;  (let* ((indent (concat &amp;quot;\n&amp;quot; (make-string (current-column) 32)))&#xA;         (args (python-split-args text))&#xA;     (nr 0)&#xA;         (formatted-args&#xA;      (mapconcat&#xA;       (lambda (x)&#xA;         (concat &amp;quot;   &amp;quot; (nth 0 x)&#xA;             (if make-fields (format &amp;quot; ${%d:arg%d}&amp;quot; (cl-incf nr) nr))&#xA;             (if (nth 1 x) (concat &amp;quot; \(default &amp;quot; (nth 1 x) &amp;quot;\)&amp;quot;))))&#xA;       args&#xA;       indent)))&#xA;    (unless (string= formatted-args &amp;quot;&amp;quot;)&#xA;      (concat&#xA;       (mapconcat 'identity&#xA;          (list &amp;quot;&amp;quot; &amp;quot;Args:&amp;quot; formatted-args)&#xA;          indent)&#xA;       &amp;quot;\n&amp;quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that &lt;code&gt;python-split-args&lt;/code&gt; is provided by the &lt;em&gt;standard&lt;/em&gt; snippets. I.e.:&#xA;&lt;a href=&quot;https://github.com/AndreaCrotti/yasnippet-snippets/tree/master&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/AndreaCrotti/yasnippet-snippets/tree/master&lt;/a&gt; You do however get those by default when you install the package through &lt;code&gt;package.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;With everything setup properly, you should be able to write &amp;quot;defg&amp;quot; followed by &lt;kbd&gt;Tab&lt;/kbd&gt; to expand the snippet (See the image for an example).&lt;/p&gt;&#xA;&lt;p&gt;&lt;del&gt;There is still an issue with using this inside nested indentation, e.g., within classes or as nested functions. In those cases the docstring is erroneously indented an extra time for some reason. I'll update this post if I manage to fix that.&lt;/del&gt;&lt;/p&gt;&#xA;&lt;p&gt;The snippet should now work inside other scopes by forbidding &lt;code&gt;yasnippet&lt;/code&gt; from auto-indenting the second expansion.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2653" LastEditDate="2021-08-31T16:28:34.157" LastActivityDate="2021-08-31T16:28:34.157" CommentCount="14" ContentLicense="CC BY-SA 4.0" />
  <row Id="19472" PostTypeId="1" AcceptedAnswerId="19475" CreationDate="2016-01-12T10:35:03.053" Score="12" ViewCount="9206" Body="&lt;p&gt;Some TeX/LaTeX editor has support for embedding PDF viewer, and forward/backward search support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to configure AUCTeX and pdf-tools to this result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a discussion in mailing list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/auctex/2015-02/msg00013.html&quot;&gt;https://lists.gnu.org/archive/html/auctex/2015-02/msg00013.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It give out a method to implement this opening PDF file with pdf-tools in Emacs.&#xA;I followed that, but it does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'tex-site)&#xA;(require 'latex)&#xA;&#xA;;;; AUCTeX config&#xA;(setq TeX-auto-save t&#xA;      TeX-parse-self t)&#xA;&#xA;(setq-default TeX-master nil)&#xA;&#xA;;; automatic detection of master file&#xA;(defun guess-TeX-master (filename)&#xA;  &quot;Guess the master file for FILENAME from currently open .tex files.&quot;&#xA;  (let ((candidate nil)&#xA;        (filename (file-name-nondirectory filename)))&#xA;    (save-excursion&#xA;      (dolist (buffer (buffer-list))&#xA;        (with-current-buffer buffer&#xA;          (let ((name (buffer-name))&#xA;                (file buffer-file-name))&#xA;            (if (and file (string-match &quot;\\.tex$&quot; file))&#xA;                (progn&#xA;                  (goto-char (point-min))&#xA;                  (if (re-search-forward (concat &quot;\\\\input{&quot; filename &quot;}&quot;) nil t)&#xA;                      (setq candidate file))&#xA;                  (if (re-search-forward (concat &quot;\\\\include{&quot; (file-name-sans-extension filename) &quot;}&quot;) nil t)&#xA;                      (setq candidate file))))))))&#xA;    (if candidate&#xA;        (message &quot;TeX master document: %s&quot; (file-name-nondirectory candidate)))&#xA;    candidate))&#xA;&#xA;(add-hook 'LaTeX-mode-hook&#xA;          '(lambda ()&#xA;             (setq TeX-master (guess-TeX-master (buffer-file-name)))&#xA;             ))&#xA;&#xA;;; enable RefTeX in AUCTeX (LaTeX-mode)&#xA;(setq reftex-plug-into-AUCTeX t)&#xA;(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode&#xA;(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode&#xA;&#xA;;; view generated PDF with `pdf-tools'.&#xA;(unless (assoc &quot;PDF Tools&quot; TeX-view-program-list-builtin)&#xA;  (add-to-list 'TeX-view-program-list-builtin&#xA;               '(&quot;PDF Tools&quot; TeX-pdf-tools-sync-view)))&#xA;(add-to-list 'TeX-view-program-selection&#xA;             '(output-pdf &quot;PDF Tools&quot;))&#xA;&#xA;;; LaTeX source code block syntax highlighting.&#xA;;; [ minted ]&#xA;;; toggle shell escape using [C-c C-t x].&#xA;(defun TeX-toggle-escape ()&#xA;  &quot;Toggle Shell Escape&quot;&#xA;  (interactive)&#xA;  (setq-local LaTeX-command&#xA;              (if (string= LaTeX-command &quot;latex&quot;) &quot;latex -shell-escape&quot;&#xA;                &quot;latex&quot;))&#xA;  (message (concat &quot;shell escape &quot;&#xA;                   (if (string= LaTeX-command &quot;latex -shell-escape&quot;)&#xA;                       &quot;enabled&quot;&#xA;                     &quot;disabled&quot;))&#xA;           ))&#xA;(add-hook 'LaTeX-mode-hook&#xA;          '(lambda ()&#xA;             (local-set-key (kbd &quot;C-c C-t x&quot;) 'TeX-toggle-escape)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2017-11-12T06:25:52.150" Title="How to let AUCTeX open PDF with pdf-tools" Tags="|auctex|pdf-tools|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19473" PostTypeId="2" ParentId="18883" CreationDate="2016-01-12T12:25:35.683" Score="5" Body="&lt;p&gt;I made a little package &lt;a href=&quot;http://melpa.milkbox.net/#/org-mru-clock&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-mru-clock&lt;/a&gt; to solve this.&lt;/p&gt;&#xA;&lt;p&gt;When I run &lt;code&gt;org-mru-clock-select-recent-task&lt;/code&gt; or &lt;code&gt;org-mru-clock-in&lt;/code&gt; it finds all recently-clocked-in tasks from org files and stores the top &lt;code&gt;org-mru-clock-how-many&lt;/code&gt; in &lt;code&gt;org-history&lt;/code&gt;; that takes about 5 seconds, so it doesn't do anything if &lt;code&gt;org-history&lt;/code&gt; already has that many entries. This is nicer than saving to disk, since I have the org files version controlled, and the initial 5 second wait is acceptable.&lt;/p&gt;&#xA;&lt;p&gt;It's compatible with &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;ivy&lt;/a&gt;, ido, selectrum or the built-in completion; my init.el has this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org-mru-clock&#xA;  :ensure t&#xA;  :bind* ((&amp;quot;&amp;lt;f8&amp;gt;&amp;quot; . org-mru-clock-in))&#xA;  :commands (org-mru-clock-in org-mru-clock-select-recent-task)&#xA;  :config&#xA;  ;; I use embark, this gives me some actions on tasks:&#xA;  (add-hook 'minibuffer-setup-hook #'org-mru-clock-embark-minibuffer-hook)&#xA;  (setq org-mru-clock-how-many 100))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The ivy interface also happens to make it really easy to switch quickly between recent tasks:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NXHUp.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NXHUp.gif&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="730" LastEditDate="2022-02-08T07:51:16.290" LastActivityDate="2022-02-08T07:51:16.290" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19474" PostTypeId="2" ParentId="19460" CreationDate="2016-01-12T12:26:44.493" Score="0" Body="&lt;p&gt;Normally &lt;kbd&gt;l l&lt;/kbd&gt; shows the log for the current branch. But you checked out something that isn't a local branch, so there currently isn't a current branch (&quot;HEAD is detached&quot;). In that case &lt;kbd&gt;l l&lt;/kbd&gt; falls back to asking you what log you want to see, defaulting to the log for the commit at point.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-01-12T12:26:44.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19475" PostTypeId="2" ParentId="19472" CreationDate="2016-01-12T12:58:03.930" Score="21" Body="&lt;p&gt;Here's my setup, using &lt;code&gt;auctex-11.89&lt;/code&gt; and &lt;code&gt;pdf-tools-20151224.1159&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Use pdf-tools to open PDF files&#xA;(setq TeX-view-program-selection '((output-pdf &quot;PDF Tools&quot;))&#xA;      TeX-source-correlate-start-server t)&#xA;&#xA;;; Update PDF buffers after successful LaTeX runs&#xA;(add-hook 'TeX-after-compilation-finished-functions&#xA;           #'TeX-revert-document-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2017-11-12T06:25:52.150" LastActivityDate="2017-11-12T06:25:52.150" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19476" PostTypeId="2" ParentId="19445" CreationDate="2016-01-12T13:39:11.043" Score="2" Body="&lt;p&gt;After reading &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Choice.html#Window-Choice&quot; rel=&quot;nofollow&quot;&gt;Window Choice&lt;/a&gt; in the emacs documentation, I was able to get the desired behaviour by setting &lt;code&gt;split-height-threshold&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. I added this to my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq split-height-threshold nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10746" LastActivityDate="2016-01-12T13:39:11.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19477" PostTypeId="1" CreationDate="2016-01-12T13:54:40.643" Score="1" ViewCount="203" Body="&lt;p&gt;In Evil, there is the variable &lt;code&gt;evil-move-cursor-back&lt;/code&gt;. This is what it's documentation says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Whether the cursor is moved backwards when exiting Insert state.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, by default, it is set to &lt;code&gt;t&lt;/code&gt; . The effect this has is that, if you enter Insert state and then immediately leave it (switch to Normal state), the cursor is moved back one character compared to where you started off. I understand I can change this behavior by changing the value of the variable, but as a beginner Evil and Vim user I am afraid I will not gain the benefits of having it enabled still.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, does anyone know the background or thinking of this variable or the behavior it controls?&lt;/p&gt;&#xA;" OwnerUserId="320" LastActivityDate="2016-01-12T13:54:40.643" Title="What are the thoughts behind evil-move-cursor-back?" Tags="|evil|vim-emulation|" AnswerCount="0" CommentCount="2" ClosedDate="2016-01-12T19:54:22.357" ContentLicense="CC BY-SA 3.0" />
  <row Id="19479" PostTypeId="2" ParentId="19465" CreationDate="2016-01-12T15:12:05.400" Score="4" Body="&lt;p&gt;&lt;strong&gt;Ask Emacs.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f compile&lt;/code&gt; tells you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Compile the program including the current buffer.  Default: run &lt;code&gt;make&lt;/code&gt;.&#xA;  Runs COMMAND, a shell command, in a separate process asynchronously&#xA;  with output going to the buffer &lt;code&gt;*compilation*&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can then use the command &lt;code&gt;C-x `&lt;/code&gt; to find the next error message&#xA;  and move to the source code that caused it.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If optional second arg COMINT is t the buffer will be in Comint mode with&#xA;  &lt;code&gt;compilation-shell-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Interactively, prompts for the command if the variable&#xA;  &lt;code&gt;compilation-read-command&lt;/code&gt; is non-nil&lt;/strong&gt;; otherwise uses &lt;code&gt;compile-command&lt;/code&gt;.&#xA;  With prefix arg, always prompts.&#xA;  Additionally, with universal prefix arg, compilation buffer will be in&#xA;  comint mode, i.e. interactive.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To run more than one compilation at once, start one then rename&#xA;  the &lt;code&gt;*compilation*&lt;/code&gt; buffer to some other name with&#xA;  M-x rename-buffer.  Then &lt;em&gt;switch buffers&lt;/em&gt; and start the new compilation.&#xA;  It will create a new &lt;code&gt;*compilation*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;On most systems, termination of the main compilation process&#xA;  kills its subprocesses.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The name used for the buffer is actually whatever is returned by&#xA;  the function in &lt;code&gt;compilation-buffer-name-function&lt;/code&gt;, so you can set that&#xA;  to a function that generates a unique name.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The part in &lt;strong&gt;bold&lt;/strong&gt; tells you the answer: be sure that user option &lt;strong&gt;&lt;code&gt;compilation-read-command&lt;/code&gt;&lt;/strong&gt; is set to a non-&lt;code&gt;nil&lt;/code&gt; value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you click the &lt;code&gt;compilation-read-command&lt;/code&gt; link in that &lt;code&gt;*Help*&lt;/code&gt; output then you get even more information about its behavior:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil means M-x compile reads the compilation command to use.&#xA;  Otherwise, M-x compile just uses the value of &lt;code&gt;compile-command&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note that changing this to nil may be a security risk, because a&#xA;  file might define a malicious &lt;code&gt;compile-command&lt;/code&gt; as a file local&#xA;  variable, and you might not notice.  Therefore, &lt;code&gt;compile-command&lt;/code&gt;&#xA;  is considered unsafe if this variable is nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-12T15:12:05.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19480" PostTypeId="1" CreationDate="2016-01-12T15:37:33.380" Score="8" ViewCount="1846" Body="&lt;p&gt;I'm looking for a way to share &lt;code&gt;org-mode&lt;/code&gt; outlines such that&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it is accessible to non-Emacs users;&lt;/li&gt;&#xA;&lt;li&gt;preserves as much of &lt;code&gt;org-mode&lt;/code&gt;'s expand/collapse functionality as possible.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I know that one can export &lt;code&gt;*.org&lt;/code&gt; files to, e.g., HTML, but I find that viewing such exports in a web browser is &lt;em&gt;far less useful&lt;/em&gt; than viewing the original &lt;code&gt;org-mode&lt;/code&gt; outline with Emacs.  With the export one gets &quot;everything all at once&quot;, thereby losing the ability to selectively &quot;zoom in and out of nodes&quot;, so to speak.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I miss most are the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the ability to expand and collapse headings;&lt;/li&gt;&#xA;&lt;li&gt;visibility cycling;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-narrow-to-subtree&lt;/code&gt;/&lt;code&gt;widen&lt;/code&gt; (aka &lt;code&gt;C-x n s&lt;/code&gt;/&lt;code&gt;C-x n w&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="882" LastActivityDate="2016-01-23T18:29:29.167" Title="Exploring org-mode outlines without Emacs" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19481" PostTypeId="1" AcceptedAnswerId="19498" CreationDate="2016-01-12T16:20:16.007" Score="0" ViewCount="160" Body="&lt;p&gt;I use org-mode clocks extensively for task tracking, with one exception. End of day. Depending on my location, amount of haste (trains or battery power) etc. I sometimes neglect clocking out at day end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a setting to set the maximum allowed day-time (same day) end?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: I start an action at 16:35, I run for a train at 17:45. I forgot to log out. On clocking in the next morning - I don't want the keep value of working on the last action overnight, but to a maximum time of say 17:30.&lt;/p&gt;&#xA;" OwnerUserId="10754" LastActivityDate="2016-01-13T15:43:50.967" Title="How can I limit an org-mode clock out, to some specified time of day?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19482" PostTypeId="1" CreationDate="2016-01-12T17:00:16.457" Score="3" ViewCount="111" Body="&lt;p&gt;I want to add import statements in my yasnippets that go the top of the file (where they will be automatically sorted (or removed if the import already exists)).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from subprocess import call # I want this line moved to the top of the &#xA;                            # buffer after snippet expansion&#xA;&#xA;subprocess.call(&quot;$0&quot;, ${1:shell=True})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the import statements moved to the top of the file because if the snippet is expanded within a code block, the import statement ends up within the block, and &lt;a href=&quot;https://github.com/timothycrosley/isort/&quot; rel=&quot;nofollow&quot;&gt;isort&lt;/a&gt; won't be able to sort the import. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can move the import to the top of the file using an elisp snippet within a yasnippet snippet? If so, how do I do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(All the elisp yasnippet examples I could find dealt with modifying inserted text, not moving stuff within the buffer after the snippet was expanded...)&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2016-01-12T17:15:54.153" LastActivityDate="2016-01-12T17:15:54.153" Title="Can I move imports to top of file from yasnippet using elisp code?" Tags="|yasnippet|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19483" PostTypeId="2" ParentId="19469" CreationDate="2016-01-12T17:50:28.540" Score="1" Body="&lt;p&gt;Here is a rough draft that records the &lt;code&gt;selected-window&lt;/code&gt; with a &lt;code&gt;post-command-hook&lt;/code&gt; and compares the value to each newly &lt;code&gt;selected-window&lt;/code&gt; as &lt;code&gt;redisplay&lt;/code&gt; runs its course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just evaluate the sample code in a &lt;code&gt;*scratch*&lt;/code&gt; buffer and then type &lt;code&gt;M-x text-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar modeline-selected-window nil)&#xA;&#xA;(let ((default-background (face-background 'default nil 'default)))&#xA; (set-face-attribute 'mode-line-inactive nil :background default-background :box nil))&#xA;&#xA;(defun modeline-record-selected-window ()&#xA;  (setq modeline-selected-window (selected-window)))&#xA;&#xA;(defun modeline-update-function ()&#xA;  (cond&#xA;    ((minibufferp)&#xA;      (let ((default-background (face-background 'default nil 'default)))&#xA;        (with-selected-window (minibuffer-window)&#xA;          (setq-local face-remapping-alist '(&#xA;            (default :foreground &quot;blue&quot;)&#xA;            (minibuffer-prompt :foreground &quot;red&quot;))))&#xA;          (setq-default face-remapping-alist `((mode-line ,'mode-line-inactive)))))&#xA;    (t&#xA;      (with-selected-window (minibuffer-window)&#xA;        (when (local-variable-p 'face-remapping-alist)&#xA;          (kill-local-variable 'face-remapping-alist)))&#xA;      (setq-default face-remapping-alist nil))))&#xA;&#xA;(defun modeline-set-format ()&#xA;  (setq mode-line-format '(&#xA;    (:eval&#xA;      (if (eq modeline-selected-window (selected-window))&#xA;        (propertize &quot;SELECTED WINDOW&quot; 'face 'font-lock-warning-face)&#xA;        (propertize &quot;NOT-SELECTED WINDOW&quot; 'face 'font-lock-keyword-face)))))&#xA;  ;; next two lines make the affect immediately apparent&#xA;  (setq modeline-selected-window (selected-window))      &#xA;  (force-mode-line-update))&#xA;&#xA;(define-minor-mode modeline-mode&#xA;&quot;This is a minor-mode for `modeline-mode`.&quot;&#xA;  :init-value nil&#xA;  :lighter &quot; ML&quot;&#xA;  :keymap nil&#xA;  :global t&#xA;  :group nil&#xA;  (cond&#xA;    (modeline-mode&#xA;      (add-hook 'post-command-hook 'modeline-record-selected-window)&#xA;      (add-hook 'buffer-list-update-hook 'modeline-update-function)&#xA;      (add-hook 'text-mode-hook 'modeline-set-format)&#xA;      (when (called-interactively-p 'any)&#xA;        (message &quot;Globally turned ON `modeline-mode`.&quot;)))&#xA;    (t&#xA;      (remove-hook 'post-command-hook 'modeline-record-selected-window)&#xA;      (remove-hook 'buffer-list-update-hook 'modeline-update-function)&#xA;      (remove-hook 'text-mode-hook 'modeline-set-format)&#xA;      (when (called-interactively-p 'any)&#xA;        (message &quot;Globally turned OFF `modeline-mode`.&quot;) ))))&#xA;&#xA;(modeline-mode 1) ;; globally turn on minor-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-01-12T18:38:28.120" LastActivityDate="2016-01-12T18:38:28.120" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19484" PostTypeId="1" CreationDate="2016-01-12T18:41:42.437" Score="2" ViewCount="585" Body="&lt;p&gt;I am using org mode to organize my various Emacs settings. Within my init.el file I just have (taking out initial comments):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Code:&#xA;(package-initialize)&#xA;(eval-when-compile&#xA;  (require 'use-package))&#xA;(org-babel-load-file&#xA; (expand-file-name &quot;settings.org&quot;&#xA;           user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My settings.org file is too long to post here, but if the details of it are pertinent I put the whole thing into a pastebin: &lt;a href=&quot;http://pastebin.com/STkz1ADQ&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/STkz1ADQ&lt;/a&gt;&#xA;(The section about ein is at the bottom)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently (I don't know when this issue cropped up, I hadn't touched my settings.org in a while), any time I edit my settings.org file I get the following error message upon re-loading Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/dan/.emacs.d/init.el':&#xA;&#xA;File error: Cannot open load file, no such file or directory, cl-generic&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The full debug message: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;no such file or directory&quot; &quot;cl-generic&quot;)&#xA;  require(cl-generic)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-973163&amp;gt; nil &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-cell-output.el&quot; nil t)  ; Reading at buffer position 1010&#xA;  load-with-code-conversion(&quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-cell-output.el&quot; &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-cell-output.el&quot; nil t)&#xA;  require(ein-cell-output)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-288601&amp;gt; nil &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebook.el&quot; nil t)  ; Reading at buffer position 1628&#xA;  load-with-code-conversion(&quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebook.el&quot; &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebook.el&quot; nil t)&#xA;  require(ein-notebook)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-347368&amp;gt; nil &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebooklist.el&quot; nil t)  ; Reading at buffer position 1026&#xA;  load-with-code-conversion(&quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebooklist.el&quot; &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-notebooklist.el&quot; nil t)&#xA;  require(ein-notebooklist)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-648891&amp;gt; nil &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-org.el&quot; nil t)  ; Reading at buffer position 896&#xA;  load-with-code-conversion(&quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-org.el&quot; &quot;/home/dan/.emacs.d/elpa/ein-20160107.455/ein-org.el&quot; nil t)&#xA;  ein:org-store-link()&#xA;  #[(f) &quot;\302   \205\f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reading through this the issue seemed to be that something weird was going on with EIN (Emacs Ipython Notebook). So I removed ein, and reinstalled it, and the issue went away. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to do this (remove ein, re-install ein) any time I edit settings.org. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea why this is happening - whether it's something with my setup, or with ein, or what. What is cl-generic (brief googling hasn't turned up much information)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The compile log for ein also makes mention of cl-generic: &lt;a href=&quot;http://pastebin.com/1zgQXvsx&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/1zgQXvsx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any light anyone can shed on this would be appreciated. &lt;/p&gt;&#xA;" OwnerUserId="7113" LastActivityDate="2016-01-12T18:41:42.437" Title="init error: file missing - cl-generic after any time I edit settings.org file" Tags="|init-file|debugging|use-package|ein|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19485" PostTypeId="2" ParentId="19481" CreationDate="2016-01-12T20:06:00.603" Score="1" Body="&lt;p&gt;You could schedule a command to clock out at 17:30.  &lt;a href=&quot;http://www.emacswiki.org/emacs/MidnightMode&quot; rel=&quot;nofollow&quot;&gt;Midnight Mode&lt;/a&gt; lets you schedule commands to run at a specified time.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-01-13T03:01:18.920" LastActivityDate="2016-01-13T03:01:18.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19486" PostTypeId="1" AcceptedAnswerId="19514" CreationDate="2016-01-12T21:39:20.213" Score="2" ViewCount="1085" Body="&lt;p&gt;I have the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process-region (point-min) (point-max) &#xA;   &quot;python /Users/myname/code/move_imports/moveimports.py&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Incredibly, it tells me that it cannot find the file, even though it exists in the very same location given. Same happens with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process-region (point-min) (point-max) &#xA;   &quot;/Users/myname/code/move_imports/moveimports.py&quot;))) ; Using shebang in python file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I fix this problem and run the executable by using the full path?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: The error I am getting is &lt;code&gt;Searching for program: no such file or directory&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2016-03-14T17:13:03.087" LastActivityDate="2016-03-14T17:13:03.087" Title="Help with `call-process-region`: Searching for program: no such file or directory" Tags="|process|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19487" PostTypeId="1" CreationDate="2016-01-12T21:45:09.940" Score="4" ViewCount="2052" Body="&lt;p&gt;Configuration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 25.0.50 on Ubuntu 15.04.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to produce?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do &lt;code&gt;emacs -Q&lt;/code&gt;, then &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;sql-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paste the following in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SELECT  SUM(T01.foobar)&#xA;FROM   db_foo.bar T01&#xA;WHERE   T01.fooID = 1&#xA;AND    T01.barID = 2&#xA;AND  T01.foo IS NOT NULL'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;kbd&gt;C-x h&lt;/kbd&gt;, and then &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;indent-region&lt;/code&gt;, it says the&#xA;indent region is done. But the SQL statement is indented in an another way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SELECT  SUM(T01.foobar)&#xA;FROM    db_foo.bar T01&#xA;WHERE   T01.fooID = 1&#xA;    AND T01.barID = 2&#xA;    AND T01.foo IS NOT NULL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to change the indentation it in the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; SELECT  SUM(T01.foobar)&#xA; FROM    db_foo.bar T01&#xA; WHERE   T01.fooID = 1&#xA; AND     T01.barID = 2&#xA; AND     T01.foo IS NOT NULL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I decided to change the indentation myself.&#xA;When looking &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/sql.el&quot; rel=&quot;nofollow&quot;&gt;on the source code of SQL mode&lt;/a&gt;,&#xA;I don't see any hints where I could change the indentation for words and for &quot;AND&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion how I could change the indentation of SQL string? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-03-06T15:26:24.703" LastActivityDate="2016-03-06T15:26:24.703" Title="How to change the indentation of major mode (SQL-mode)?" Tags="|sql-interactive-mode|sql|indentation|sql-mode|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19488" PostTypeId="1" CreationDate="2016-01-12T22:36:47.527" Score="3" ViewCount="584" Body="&lt;p&gt;I have my time stamps customized as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default org-display-custom-times t)&#xA;(setq org-time-stamp-custom-formats '(&quot;&amp;lt;%a %d-%b %Y&amp;gt;&quot; . &quot;&amp;lt;%a %d-%b %Y %H:%M&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My issue is that my org-tables do not align correctly when dates are inserted in them&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;2016-01-12 Tue&amp;gt;   | &amp;lt;2016-01-13 Wed&amp;gt;  |&#xA;|-------------------+-------------------|&#xA;| aligned           | improperly        |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to change this? &lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-01-13T04:17:16.317" Title="Can org tables cooperate with my customized dates?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19489" PostTypeId="1" AcceptedAnswerId="19530" CreationDate="2016-01-13T01:15:25.247" Score="1" ViewCount="1227" Body="&lt;p&gt;I've installed AucTex as per the &lt;a href=&quot;http://www.gnu.org/software/auctex/manual/auctex/Installation.html&quot; rel=&quot;nofollow&quot;&gt;official instructions&lt;/a&gt; with &lt;code&gt;package-list-packages&lt;/code&gt;, however there is no trace of preview-latex. Helm displays no results for &lt;code&gt;M-x auctex&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After installing Auctex with package-list-packages, &lt;code&gt;(load &quot;auctex.el&quot; nil t t)&lt;/code&gt; returns true, but &lt;code&gt;(load &quot;preview-latex.el&quot; nil t t)&lt;/code&gt; does not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've reinstalled Auctex from scratch (by having a backup of my .emacs.d), and arrived the same results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I produce &lt;code&gt;preview-latex.el&lt;/code&gt;? And why am I not seeing any traces of Auctex? &lt;/p&gt;&#xA;" OwnerUserId="6554" LastEditorUserId="6554" LastEditDate="2016-01-13T02:37:56.063" LastActivityDate="2016-01-14T08:46:53.507" Title="Unable to locate preview-latex.el after installing the AucTeX package in Emacs24" Tags="|latex|auctex|emacs24.4|preview-latex|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19490" PostTypeId="2" ParentId="19489" CreationDate="2016-01-13T01:59:41.407" Score="0" Body="&lt;p&gt;If you install AUCTeX with the package manager you don't have to explicitly load it in your startup file. See the following question/answer: &lt;a href=&quot;https://tex.stackexchange.com/questions/101900/problems-with-auctex-and-emacs24&quot;&gt;https://tex.stackexchange.com/questions/101900/problems-with-auctex-and-emacs24&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to check if &lt;code&gt;preview-latex.el&lt;/code&gt; is loaded is to check if the following functions are defined: &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/preview-latex.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/auctex/manual/preview-latex.html&lt;/a&gt;. For example, see if you can run &lt;code&gt;M-x preview-at-point RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10757" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-01-13T01:59:41.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19491" PostTypeId="2" ParentId="19470" CreationDate="2016-01-13T03:14:13.910" Score="1" Body="&lt;p&gt;Thanks Drew and wvxvw. I'm convinced you guys are correct, although I don't think I can prove it anymore. It confounds me, but somehow after restarting emacs a couple times in between changes to my init.el (with no even remotely font-related changes), this behavior changed so that even when I selected the candidate it still showed the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I went to my font-related configuration and noticed that somehow I had this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Incorrect code below!&#xA;(cond&#xA; ((eq system-type 'darwin)&#xA;  (set-fontset-font &quot;fontset-default&quot; nil &quot;Symbola&quot; nil 'append))&#xA; ((eq system-type 'gnu/linux)&#xA;  (set-fontset-font t 'symbol (font-spec :family &quot;Apple Color Emoji&quot;) nil 'prepend)&#xA;  (set-fontset-font t 'symbol (font-spec :family &quot;Apple Symbols&quot;) nil 'append)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Somehow my OSes there were flipped, so I wasn't setting Symbola even though I'm on linux. I fixed that and now everything is perfectly fine.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="115" LastEditDate="2016-05-12T16:55:56.827" LastActivityDate="2016-05-12T16:55:56.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19492" PostTypeId="2" ParentId="19488" CreationDate="2016-01-13T03:57:22.430" Score="3" Body="&lt;p&gt;Unfortunately, this is a one of a few &lt;a href=&quot;http://orgmode.org/manual/Custom-time-format.html&quot; rel=&quot;nofollow&quot;&gt;documented side effects&lt;/a&gt; of having your custom time stamps overlaid on top of the default time stamps. From the documentaion:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the custom timestamp format is longer than the default and you are using &#xA;   dates in tables, table alignment will be messed up. If the custom format is &#xA;   shorter, things do work as expected. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could try to shorten your custom format, but other than that, you are probably out of luck. Also, note that the dates in your example table do not match your custom format. If you hand typed these dates, note that you can add a timestamp automatically in an org-mode buffer with &lt;code&gt;C-.&lt;/code&gt; (&lt;code&gt;org-time-stamp&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-13T04:17:16.317" LastActivityDate="2016-01-13T04:17:16.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19493" PostTypeId="1" AcceptedAnswerId="21027" CreationDate="2016-01-13T04:00:47.840" Score="3" ViewCount="1153" Body="&lt;p&gt;I found &lt;code&gt;ob-lisp.el&lt;/code&gt; use SLIME by default to evaluate lisp code.&#xA;I want to use SLY to evaluate lisp code. How to change it?&#xA;I found the file &lt;code&gt;ob-lisp.el&lt;/code&gt; is short. I tried to change &lt;code&gt;slime&lt;/code&gt; to &lt;code&gt;sly&lt;/code&gt;. But it is not customizable. I hope to define a &lt;code&gt;defcustom&lt;/code&gt; for it. So that user can customize it.&#xA;But I don't know how to apply this into code.&#xA;For example, I define a custom like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-babel-lisp-default-implement &quot;slime&quot;)&#xA;&#xA;((defcustom org-babel-lisp-implements&#xA;   '(&quot;slime&quot; &quot;sly&quot;)&#xA;   &quot;A list of Lisp implements.&quot;&#xA;   :group 'org-babel&#xA;   :version &quot;24.1&quot;&#xA;   ;; FIXME: reference code example.&#xA;   :type listp))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in file &lt;code&gt;ob-lisp.el&lt;/code&gt;. Has some places use &lt;code&gt;slime&lt;/code&gt;. I want to make them adapt to upper &lt;code&gt;defcustom&lt;/code&gt; value. like concate string from value or something else.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(declare-function slime-eval &quot;ext:slime&quot; (sexp &amp;amp;optional package))&#xA;&#xA;(defun org-babel-execute:lisp (body params)&#xA;  &quot;Execute a block of Common Lisp code with Babel.&quot;&#xA;  (require 'slime)&#xA;  (org-babel-reassemble-table&#xA;   (let ((result&#xA;          (funcall (if (member &quot;output&quot; (cdr (assoc :result-params params)))&#xA;                       #'car #'cadr)&#xA;                   (with-temp-buffer&#xA;                     (insert (org-babel-expand-body:lisp body params))&#xA;                     (slime-eval `(swank:eval-and-grab-output&#xA;....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2016-01-13T04:35:23.247" LastActivityDate="2023-02-11T20:14:28.693" Title="How to change Org-mode Babel lisp source code block from SLIME to SLY?" Tags="|org-mode|org-babel|slime|common-lisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19494" PostTypeId="2" ParentId="14007" CreationDate="2016-01-13T06:18:07.023" Score="1" Body="&lt;p&gt;The nuclear option worked for me after this behavior finally drove me around the bend while typing tramp filenames.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; disable company completion of *all* remote filenames, whether   &#xA;  ;; connected or not&#xA;  (defun company-files--connected-p (file)&#xA;    (not (file-remote-p file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2013" LastActivityDate="2016-01-13T06:18:07.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19495" PostTypeId="1" CreationDate="2016-01-13T07:17:38.003" Score="4" ViewCount="120" Body="&lt;p&gt;I just started using helm-apropos.  It's great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a helm equivalent for &lt;code&gt;apropos-documentation&lt;/code&gt; or alternatively does &lt;code&gt;helm-apropos&lt;/code&gt; have sources already available to narrow over docstrings?&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-01-13T07:17:38.003" Title="&quot;helm-documentation&quot;? (search docstrings like apropos-documentation but with helm)" Tags="|helm|help|doc-strings|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19497" PostTypeId="2" ParentId="1031" CreationDate="2016-01-13T07:30:13.877" Score="2" Body="&lt;p&gt;The usual &lt;code&gt;debug-on-error&lt;/code&gt; doesn't work, but you can make it work :) A convenient way to debug these issues was proposed on &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2010-07/msg01410.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-devel&lt;/a&gt; back in 2010:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;toggle-debug-on-error&lt;/code&gt;, then advise your function to add an error handler to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice endless/indent-defun (around intercept activate)&#xA;  (condition-case err&#xA;      ad-do-it&#xA;    ((debug error) (signal (car err) (cdr err)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will break into the debugger, just as if you were running the function as usual. The trick is from Johan Bockgård.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2017-01-28T14:35:28.253" LastActivityDate="2017-01-28T14:35:28.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19498" PostTypeId="2" ParentId="19481" CreationDate="2016-01-13T07:57:20.937" Score="2" Body="&lt;p&gt;The following advice of &lt;code&gt;org-clock-in&lt;/code&gt; does quite exactly what you want.&#xA;If the clock from yesterday or before is still running you are clocked-out at the time &lt;code&gt;org-clock-out-latest-back-dated&lt;/code&gt; on the day the clock started.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;;; Just for customization of `org-clock-out-latest-back-dated':&#xA;(defun time-string-hh:mm-validate (time)&#xA;  &quot;Returns nil if TIME has the correct format hh:mm.&#xA;Where hh are the digits of the number of hours and mm are the digits of the number of minutes.&#xA;TIME can be a string or a widget.&quot;&#xA;  (let ((val (if (stringp time) time (widget-value time))))&#xA;    (if (and (stringp val)&#xA;         (string-match &quot;^\\([0-9]\\{1,2\\}\\):\\([0-9]\\{1,2\\}\\)$&quot; val)&#xA;         (&amp;lt; (string-to-number (match-string 1)) 24)&#xA;         (&amp;lt; (string-to-number (match-string 2)) 60))&#xA;    nil&#xA;      (if (stringp time)&#xA;      time&#xA;    (widget-put time :error &quot;String does not match format hh:mm.&quot;)&#xA;    time))))&#xA;&#xA;(define-widget 'time-string-hh:mm 'editable-field&#xA;  &quot;Time string with format hh:mm.&quot;&#xA;  :size 5&#xA;  :format &quot;Time (hh:mm): %v &quot;&#xA;  :validate 'time-string-hh:mm-validate)&#xA;&#xA;(defcustom org-clock-out-latest-back-dated &quot;17:30&quot;&#xA;  &quot;Time as string with format hh:mm to check out on back-dated days.&quot;&#xA;  :group 'org-clock&#xA;  :type 'time-string-hh:mm)&#xA;&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;;; The actual advice:&#xA;(defadvice org-clock-in (before clock-out-back-dated activate)&#xA;  &quot;If there is a running clock from a back-dated day&#xA;clock it out at `org-clock-out-latest-back-dated' on that day.&quot;&#xA;  (when (and (org-clocking-p)&#xA;         (&amp;gt; (time-to-days (current-time)) (time-to-days org-clock-start-time)))&#xA;    (let ((time (decode-time org-clock-start-time))&#xA;      (hhmm (mapcar 'string-to-number (progn&#xA;                        (when (time-string-hh:mm-validate org-clock-out-latest-back-dated)&#xA;                          (error &quot;Wrong time format in `org-clock-out-latest-back-dated'&quot;))&#xA;                        (split-string org-clock-out-latest-back-dated &quot;:&quot;)))))&#xA;      (setf (nth 1 time) (cadr hhmm))&#xA;      (setf (nth 2 time) (car hhmm))&#xA;      (org-clock-out nil nil (apply 'encode-time time)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-13T15:43:50.967" LastActivityDate="2016-01-13T15:43:50.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19499" PostTypeId="1" CreationDate="2016-01-13T08:55:37.440" Score="0" ViewCount="82" Body="&lt;p&gt;git-timemachine is good to use, but how to show author (committer) along side with the commit message?This information sometime is important for me&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="306" LastEditDate="2016-01-13T11:59:03.473" LastActivityDate="2016-01-20T12:22:32.193" Title="there is no info of author in git-timemachine" Tags="|git|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19500" PostTypeId="1" AcceptedAnswerId="19504" CreationDate="2016-01-13T09:14:37.667" Score="1" ViewCount="43" Body="&lt;p&gt;I'm trying to modify a script I got from an &lt;a href=&quot;https://emacs.stackexchange.com/questions/14947/can-emacs-commands-be-called-from-a-shell-script&quot;&gt;old question&lt;/a&gt; of mine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have many &lt;code&gt;.org&lt;/code&gt; files under many subdirectories of &lt;code&gt;~/foo&lt;/code&gt;. I want to quickly run &lt;code&gt;htmlize&lt;/code&gt; on each &lt;code&gt;.org&lt;/code&gt; file. I have some elisp code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat ~/htmlize-script.el&#xA;(add-to-list 'load-path &quot;~/.emacs.d/elpa/htmlize-20130207.1202/&quot;)&#xA;(require 'htmlize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and my script is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat ~/script.sh&#xA;find ~/foo -name &quot;*.org&quot; -exec emacs --eval &quot;&#xA;(progn&#xA;  (load-file \&quot;~/htmlize-script.el\&quot;)&#xA;  (htmlize-many-files \&quot;{}\&quot;)&#xA;  )&#xA;&quot; --kill \;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, running this code gives the error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: listp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the issue here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issuing &lt;code&gt;C-h f htmlize-many-files&lt;/code&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;htmlize-many-files is an interactive autoloaded Lisp function in `htmlize.el'.&#xA;&#xA;(htmlize-many-files FILES &amp;amp;optional TARGET-DIRECTORY)&#xA;&#xA;Convert FILES to HTML and save the corresponding HTML versions.&#xA;&#xA;FILES should be a list of file names to convert.  This function calls&#xA;`htmlize-file' on each file; see that function for details.  When&#xA;invoked interactively, you are prompted for a list of files to convert,&#xA;terminated with RET.&#xA;&#xA;If TARGET-DIRECTORY is specified, the HTML files will be saved to that&#xA;directory.  Normally, each HTML file is saved to the directory of the&#xA;corresponding source file.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is the problem that the &lt;code&gt;find&lt;/code&gt; command does not pass the right list to emacs?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-01-13T11:17:18.197" Title="Can I use find to pass a list to emacs commands?" Tags="|org-mode|bash|script|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19501" PostTypeId="1" CreationDate="2016-01-13T09:43:04.033" Score="1" ViewCount="68" Body="&lt;p&gt;Today there was &lt;a href=&quot;https://github.com/milkypostman/melpa/issues/3487&quot; rel=&quot;nofollow&quot;&gt;a bug&lt;/a&gt; in the package recipe for magit in MELPA. The bug has been fixed but the new package has not yet been built. In the meantime, how can I either&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;revert to a previous, working version of the package?&lt;/li&gt;&#xA;&lt;li&gt;manually install the recipe from MELPA's git repo?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also, how can I avoid being stuck without a working package in future?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-01-13T21:27:29.250" Title="Fix botched package-install" Tags="|package|package-repositories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19502" PostTypeId="2" ParentId="19499" CreationDate="2016-01-13T09:50:44.997" Score="1" Body="&lt;p&gt;Here is a dirty way to display commit author (not committer, if you want that, replace &lt;code&gt;%an&lt;/code&gt; with &lt;code&gt;%cn&lt;/code&gt;) by advising &lt;code&gt;git-timemachine--show-minibuffer-details&lt;/code&gt;. Usually, you should ask the package author for the feature request.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun git-timemachine--show-minibuffer-details-add-anthor (orig-fun &amp;amp;rest args)&#xA;  (let* ((old-details (let (message-log-max)&#xA;                       (apply orig-fun args)))&#xA;        (commit (caar args))&#xA;        (default-directory git-timemachine-directory)&#xA;        (author (substring&#xA;                 (shell-command-to-string&#xA;                   (concat &quot;git show --format=%an --no-patch &quot;&#xA;                           commit))&#xA;                 0 -1)))&#xA;    (message (concat old-details &quot; &quot; author))))&#xA;&#xA;(advice-add 'git-timemachine--show-minibuffer-details&#xA;             :around #'git-timemachine--show-minibuffer-details-add-anthor)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-01-13T09:50:44.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19503" PostTypeId="2" ParentId="19501" CreationDate="2016-01-13T11:10:40.113" Score="1" Body="&lt;p&gt;This is basically why I disagree with those who choose not to put packages under version control with the rest of their Emacs config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to guarantee that your config is always complete and in working order -- or able to be reverted to previous states if that is not the case -- you want to put all of it under version control.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-01-13T11:10:40.113" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19504" PostTypeId="2" ParentId="19500" CreationDate="2016-01-13T11:17:18.197" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;FILES should be a list of file names to convert&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So presumably you actually need &lt;code&gt;(htmlize-many-files (list \&quot;{}\&quot;))&lt;/code&gt; in that shell script.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-01-13T11:17:18.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19505" PostTypeId="1" AcceptedAnswerId="19515" CreationDate="2016-01-13T11:44:44.647" Score="0" ViewCount="208" Body="&lt;p&gt;I forget to enter &lt;code&gt;sh-mode&lt;/code&gt; when I create new shell scripts in &lt;code&gt;~/.local/bin&lt;/code&gt;, so I want emacs to do this automatically. Because I have an advice set up to make them executable, this will have the effect of also marking them executable automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried creating this &lt;code&gt;.dir-locals.el&lt;/code&gt; file in the directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((magic-fallback-mode-alist . ((&quot;^$&quot; . sh-mode))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but although it asked me whether to apply the &quot;risky&quot; file-local variable &lt;code&gt;magic-fallback-mode-alist&lt;/code&gt;, it did not work - the new buffer was still using fundamental-mode.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-01-14T21:31:34.533" Title="Make major mode be used by default for new files in directory" Tags="|major-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19506" PostTypeId="1" AcceptedAnswerId="19507" CreationDate="2016-01-13T12:02:23.210" Score="20" ViewCount="7175" Body="&lt;p&gt;How can I suppress the &quot;assignment to free variable&quot; warning when byte compiling an emacs lisp file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm actually mostly interested in suppressing it for a specific buffer when using flycheck, but I understand this is just passing off to the byte compiler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be good to get a list of all warnings / errors that can be suppressed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;:&lt;br&gt;&#xA;For the sake of completeness, allow me to clarify that there are many (language agnostic) reasons to disable compiler warnings. Some examples: to ease the transition of legacy code into a lint enforced framework, for scratch files and recipes to be run within a live context, to remove noise while fixing higher priority problems, or because the compiler is just wrong.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="105" LastEditDate="2016-03-14T00:53:53.793" LastActivityDate="2016-03-14T00:53:53.793" Title="suppress warning: assignment to free variable (and others)" Tags="|flycheck|byte-compilation|warning|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19507" PostTypeId="2" ParentId="19506" CreationDate="2016-01-13T13:35:24.813" Score="26" Body="&lt;p&gt;For the benefit of clueless readers arriving here, allow me a small digression to say that these warnings &lt;em&gt;generally&lt;/em&gt; point to real code issues (and when they don't, you can suppress them on a per-variable basis) so people should research what they mean before disabling them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, I have no doubt that you know why you need to disable it, so the answer is below.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;The answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In order to disable this (or other) warning, you'll need to set the value of &lt;code&gt;byte-compile-warnings&lt;/code&gt;. You can do this as a file-local variable by adding the following snippet to the end of the file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; byte-compile-warnings: (not free-vars)&#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also set this globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can replace &lt;code&gt;(not free-vars)&lt;/code&gt; with &lt;code&gt;(not free-vars callargs unresolved)&lt;/code&gt; and whichever other warnings you want to suppress. The full list of warnings that can be included/supressed is found on the variable's docstring (below).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;byte-compile-warnings is a variable defined in `bytecomp.el'.&#xA;Its value is t&#xA;&#xA;  This variable is safe as a file local variable if its value&#xA;  satisfies the predicate which is a byte-compiled expression.&#xA;&#xA;Documentation:&#xA;List of warnings that the byte-compiler should issue (t for all).&#xA;&#xA;Elements of the list may be:&#xA;&#xA;  free-vars   references to variables not in the current lexical scope.&#xA;  unresolved  calls to unknown functions.&#xA;  callargs    function calls with args that don't match the definition.&#xA;  redefine    function name redefined from a macro to ordinary function or vice&#xA;              versa, or redefined to take a different number of arguments.&#xA;  obsolete    obsolete variables and functions.&#xA;  noruntime   functions that may not be defined at runtime (typically&#xA;              defined only under `eval-when-compile').&#xA;  cl-functions    calls to runtime functions (as distinguished from macros and&#xA;                  aliases) from the old CL package (not the newer cl-lib).&#xA;  interactive-only&#xA;          commands that normally shouldn't be called from Lisp code.&#xA;  lexical     global/dynamic variables lacking a prefix.&#xA;  make-local  calls to make-variable-buffer-local that may be incorrect.&#xA;  mapcar      mapcar called for effect.&#xA;  constants   let-binding of, or assignment to, constants/nonvariables.&#xA;  suspicious  constructs that usually don't do what the coder wanted.&#xA;&#xA;If the list begins with `not', then the remaining elements specify warnings to&#xA;suppress.  For example, (not mapcar) will suppress warnings about mapcar.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="50" LastEditorUserId="50" LastEditDate="2016-01-13T17:53:39.947" LastActivityDate="2016-01-13T17:53:39.947" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19508" PostTypeId="1" CreationDate="2016-01-13T13:43:47.660" Score="3" ViewCount="579" Body="&lt;p&gt;I would like a way to kill the URL under the point. I have tried &lt;code&gt;mark-thing&lt;/code&gt;, &lt;code&gt;next-visible-thing&lt;/code&gt; etc. from the &lt;code&gt;thing-cmds&lt;/code&gt; package, but they either do not know how to move over URLs in nxml-mode or fail with an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;goto-address-mode&lt;/code&gt; works for copying the URL, but it requires several extra steps (clicking on the link, switching to my external web browser window, and copying the URL from the browser address bar) and more importantly, does not work for URLs that redirect. I would like something more convenient.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-01-13T16:12:03.987" Title="Kill URL at point" Tags="|kill-text|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19509" PostTypeId="1" CreationDate="2016-01-13T14:07:58.853" Score="2" ViewCount="610" Body="&lt;p&gt;The official style of the project I'm working on is to indent after template control statements. We're using jinja2 templates with altered open/closing tags too...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;ul&amp;gt;&#xA;    {% for category in categories %}&#xA;       &amp;lt;li&amp;gt;...&amp;lt;/li&amp;gt;&#xA;    {% endfor %}&#xA; &amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some with if statements, elses, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to configure webmode to do this?&lt;/p&gt;&#xA;" OwnerUserId="10654" LastEditorUserId="253" LastEditDate="2016-03-08T10:37:55.400" LastActivityDate="2016-03-08T10:37:55.400" Title="web-mode django custom block indentions" Tags="|web-mode|" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19510" PostTypeId="2" ParentId="19508" CreationDate="2016-01-13T15:32:29.740" Score="1" Body="&lt;p&gt;This is the way to get a run of text with the same face under point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun face-under-point ()&#xA;  (interactive)&#xA;  (let ((face (face-at-point t))&#xA;        (start (point))&#xA;        (end (point))&#xA;        msg)&#xA;    (cl-loop while (eql face&#xA;                        (or (get-char-property start 'read-face-name)&#xA;                            (get-char-property start 'face)))&#xA;             do (decf start))&#xA;    (cl-loop while (eql face&#xA;                        (or (get-char-property end 'read-face-name)&#xA;                            (get-char-property end 'face)))&#xA;             do (incf end))&#xA;    (setq msg (buffer-substring-no-properties (+ start 1) end))&#xA;    (message &quot;face under point was: %s&quot; msg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once I'm home I could look into how to also put this into yank stack.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-01-13T15:32:29.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19511" PostTypeId="2" ParentId="19254" CreationDate="2016-01-13T15:49:10.197" Score="2" Body="&lt;p&gt;ok, this whole discussion has prompted me to return to an approach I've tried to setup but @Drew has rekindled an interest in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create a file like this in &lt;code&gt;~/.emacs.d/scratch.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; scratch.el --- Emacs Lisp Scratch -*- lexical-binding: t -*-&#xA;&#xA;&#xA;;; Local Variables:&#xA;;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)&#xA;;; byte-compile-warnings: (not free-vars unresolved)&#xA;;; End:&#xA;;;; scratch.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;thanks to &lt;a href=&quot;https://emacs.stackexchange.com/a/19507/5142&quot;&gt;https://emacs.stackexchange.com/a/19507/5142&lt;/a&gt; for the &lt;code&gt;Local Variables&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then add the following to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; as per @lunaryorn's answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; *scratch* is immortal&#xA;(add-hook 'kill-buffer-query-functions&#xA;          (lambda () (not (member (buffer-name) '(&quot;*scratch*&quot; &quot;scratch.el&quot;)))))&#xA;&#xA;(find-file (expand-file-name &quot;scratch.el&quot; user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-01-13T16:39:12.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19512" PostTypeId="2" ParentId="19508" CreationDate="2016-01-13T16:05:11.530" Score="5" Body="&lt;p&gt;The &lt;code&gt;url-get-url-at-point&lt;/code&gt; function from the &lt;code&gt;url-util&lt;/code&gt; (emacs built-in) package should do the job for you. It is used in interactive commands like &lt;code&gt;browse-url-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'url-util)&#xA;(defun my/kill-url-at-point ()&#xA;  &quot;Kill the url at point.&quot;&#xA;  (interactive)&#xA;  (kill-new (url-get-url-at-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you need to copy URL from an HTML page while in an emacs browser like &lt;code&gt;eww&lt;/code&gt;, you can use the &lt;code&gt;shr-copy-url&lt;/code&gt; command directly. The fun thing is that if you consecutively call that command twice while the point is on a hyperlink, it removes the link re-directions too!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h f shr-copy-url&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;shr-copy-url is an interactive compiled Lisp function in `shr.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(shr-copy-url &amp;amp;optional IMAGE-URL)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For more information check the manuals.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Copy the URL under point to the kill ring.&#xA;  If IMAGE-URL (the prefix) is non-nil, or there is no link under&#xA;  point, but there is an image under point then copy the URL of the&#xA;  image under point instead.&#xA;  If called twice, then try to fetch the URL and see whether it&#xA;  redirects somewhere else.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/1967df611445021747a2a1235ad21f1c283d2424/setup-files/setup-eww.el#L66-L75&quot; rel=&quot;nofollow&quot;&gt;Here's an example&lt;/a&gt; of how I use &lt;code&gt;shr-copy-url&lt;/code&gt; in one of my eww snippets.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-01-13T16:12:03.987" LastActivityDate="2016-01-13T16:12:03.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19513" PostTypeId="2" ParentId="18057" CreationDate="2016-01-13T17:13:49.270" Score="3" Body="&lt;p&gt;The most simple solution is to define your own key function that removes the comma before it transforms the string to a number for sorting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun string-to-number-remove-comma (str)&#xA;  &quot;Convert string STR to number but remove commas beforehand.&quot;&#xA;  (string-to-number (replace-regexp-in-string &quot;,&quot; &quot;&quot; str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function can be specified when you call &lt;code&gt;org-table-sort-lines&lt;/code&gt; with the type letter &lt;kbd&gt;f&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do that with point in the third column of your table you get the sorting in the third table of your description.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can also use the following advice of &lt;code&gt;org-table-sort-lines&lt;/code&gt;. One could make the regular expression &lt;code&gt;&quot;,&quot;&lt;/code&gt; and its replacement &lt;code&gt;&quot;&quot;&lt;/code&gt; to options. Therewith one would be more flexible. But, for your purpose the advice below is sufficient.&#xA;Note, that I need &lt;code&gt;with-current-fset&lt;/code&gt; more often -- therefore it is a separate macro.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-current-fset (backup symbol function &amp;amp;rest body)&#xA;  &quot;Save SYMBOL's function definition in BACKUP,&#xA;set it temporarily to FUNCTION, and execute BODY.&#xA;After the execution of BODY the function definition of SYMBOL is restored.&quot;&#xA;  (declare (debug (sexp sexp function-form body)) (indent 3))&#xA;  `(let ((,backup (symbol-function ',symbol)))&#xA;     (unwind-protect&#xA;     (progn&#xA;       (fset ',symbol ,function)&#xA;       ,@body)&#xA;       (fset ',symbol ,backup))))&#xA;&#xA;(defadvice org-table-sort-lines (around ignore-comma activate)&#xA;  &quot;Ignore commas when sorting.&quot;&#xA;  (with-current-fset&#xA;      string-to-number-original&#xA;      string-to-number&#xA;      (lambda (str) (funcall string-to-number-original (replace-regexp-in-string &quot;,&quot; &quot;&quot; str)))&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you do not like both solutions above you can also use an org formula to create a fourth column with commas removed from the numbers. You can then sort with respect to this column. This is only an option if you do not mind the extra column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the table formula below, iterate the table, and apply &lt;code&gt;org-table-sort-lines&lt;/code&gt; with type &lt;kbd&gt;n&lt;/kbd&gt; to the last column.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Row # | Facility                 | Recycled Off-site |        |&#xA;|-------+--------------------------+-------------------+--------|&#xA;|     3 | 1234, 12th st, jamestown |                 0 |      0 |&#xA;|     5 | 1234, 12th st, jamestown |                 0 |      0 |&#xA;|     4 | 1234, 12th st, jamestown |               464 |    464 |&#xA;|     2 | 1234, 12th st, jamestown |               760 |    760 |&#xA;|     6 | 1234, 12th st, jamestown |             2,280 |   2280 |&#xA;|     1 | 1234, 12th st, jamestown |           216,574 | 216574 |&#xA;#+TBLFM: $4='(replace-regexp-in-string &quot;,&quot; &quot;&quot; $3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-14T00:02:08.697" LastActivityDate="2016-01-14T00:02:08.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19514" PostTypeId="2" ParentId="19486" CreationDate="2016-01-13T17:52:58.080" Score="3" Body="&#xA;&#xA;&lt;p&gt;The 3rd argument to &lt;code&gt;call-process-region&lt;/code&gt; is an executable file name, not a whole command, so you should call it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(call-process-region&#xA; (point-min) (point-max) &quot;python&quot; nil nil nil&#xA; &quot;/Users/myname/code/move_imports/moveimports.py&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This looks for an exectutable named &lt;code&gt;python&lt;/code&gt; that should be located in one of the directories listed in &lt;code&gt;exec-path&lt;/code&gt; (you could provide the full path to &lt;code&gt;python&lt;/code&gt; instead).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original call would attempt to execute a file called &lt;code&gt;moveimports.py&lt;/code&gt; under a subdirectory named &lt;code&gt;python /Users/myname/code/move_imports/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You may find it easier to use &lt;code&gt;shell-command-on-region&lt;/code&gt; which would work with your first form:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(shell-command-on-region&#xA; (point-min) (point-max) &#xA; &quot;python /Users/myname/code/move_imports/moveimports.py&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You do have to watch out for spaces in file names and other shell meta-characters in this case though.  Also note that the shell uses the environment variable &lt;code&gt;PATH&lt;/code&gt; which usually (but not necessarily) contains the same list (encoded to a &lt;code&gt;:&lt;/code&gt; separated string) as &lt;code&gt;exec-path&lt;/code&gt; (especially Mac users should consider using &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;exec-path-from-shell&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I believe the second form&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(call-process-region (point-min) (point-max) &#xA;   &quot;/Users/myname/code/move_imports/moveimports.py&quot;))) ; Using shebang in python file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should work unless &lt;code&gt;&quot;/Users/myname/code/move_imports/moveimports.py&quot;&lt;/code&gt; is not marked executable, or its shebang is incorrect.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-01-13T17:52:58.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19515" PostTypeId="2" ParentId="19505" CreationDate="2016-01-13T19:32:25.143" Score="2" Body="&lt;p&gt;&lt;code&gt;auto-insert-mode&lt;/code&gt; should do this for you.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Follow the instructions at the beginning of the file you get when you type &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-library&lt;/code&gt; &lt;code&gt;autoinsert&lt;/code&gt;, i.e., add &lt;code&gt;(add-hook 'find-file-hook 'auto-insert)&lt;/code&gt; to your initialization file.&lt;/li&gt;&#xA;&lt;li&gt;Make sure you have &lt;code&gt;(&quot;/bin/.*[^/]\\'&quot; . &quot;Shell-Script mode magic number&quot;)&lt;/code&gt; in the variable &lt;code&gt;auto-insert-alist&lt;/code&gt;. This should already be the case.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="454" LastEditDate="2016-01-14T21:31:34.533" LastActivityDate="2016-01-14T21:31:34.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19516" PostTypeId="1" AcceptedAnswerId="19521" CreationDate="2016-01-13T19:58:55.643" Score="6" ViewCount="722" Body="&lt;p&gt;I'm dealing with a trivial shell script that invokes the &lt;code&gt;mysql&lt;/code&gt; binary on a remote server, and having org-babel capture its results as a table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With sensitive information scrubbed, the source block resembles&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results value table&#xA;#!/bin/sh&#xA;ssh remote.host 'mysql db -e &quot;SELECT foo,bar,baz FROM stuff&quot;'&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and its result is formatted as tab-separated values, the first row of which is a header naming the columns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo^Ibar^Ibaz&#xA;value^Ivalue^Ivalue&#xA;value^Ivalue^Ivalue&#xA;⋮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Org-babel correctly interprets this result as a table. What it doesn't do, and I haven't been able to figure out how to get it to do, is treat the first row of this result as a header. More specifically, I want there to be an hline automatically inserted after the first row, so that I can pass just the values to downstream code blocks, without having to have the code in them explicitly filter out the first line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm (almost) sure there is a fairly trivial way to do this, because I've seen examples in other questions on Emacs SE of code block result tables which (appear to be) automatically formatted the way I want mine to be. I just haven't been able to find how to do it for myself in the org-babel documentation.&lt;/p&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2016-01-13T21:07:03.393" Title="How to have org-babel treat the first line of a table result as a header?" Tags="|org-babel|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19518" PostTypeId="1" AcceptedAnswerId="19538" CreationDate="2016-01-13T20:23:15.453" Score="17" ViewCount="4012" Body="&lt;p&gt;In Python I'd do the following to process a file line by line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;with open(infile) as f:&#xA;    for line in f:&#xA;        process(line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Trying to look up how to do the same in elisp (with buffers instead of files), I found no obvious way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(What I want to end up with is two ordered datastructures of lines, one with all the lines matching a regex, the other containing those that did not match.)&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2016-03-14T00:53:25.167" LastActivityDate="2020-12-19T16:46:07.907" Title="Is there an idiomatic way of reading each line in a buffer to process it line by line?" Tags="|mapping|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19520" PostTypeId="2" ParentId="19518" CreationDate="2016-01-13T21:01:52.393" Score="7" Body="&lt;p&gt;I don't know of any idiomatic way but I came up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/walk-line-by-line ()&#xA;  &quot;Process each line in the buffer one by one.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (not (eobp))&#xA;      (let* ((lb (line-beginning-position))&#xA;             (le (line-end-position))&#xA;             (ln (buffer-substring-no-properties lb le)))&#xA;        (message &quot;&amp;gt;&amp;gt; %s&quot; ln) ; Replace this with any processing function you like&#xA;        (forward-line 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-13T21:01:52.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19521" PostTypeId="2" ParentId="19516" CreationDate="2016-01-13T21:07:03.393" Score="8" Body="&lt;p&gt;A rather brute force way is to define a post-processing function to add an &lt;code&gt;hline&lt;/code&gt; after the first row.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: addhdr&#xA;#+begin_src emacs-lisp :var tbl=&quot;&quot;&#xA;(cons (car tbl) (cons 'hline (cdr tbl)))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then call that function as postprocessing using the &lt;code&gt;:post&lt;/code&gt; header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src elisp :results value table :post addhdr(*this*)&#xA;'((a b c d) (1 2 3 4) (a b c d) (1 2 3 4))&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| a | b | c | d |&#xA;|---+---+---+---|&#xA;| 1 | 2 | 3 | 4 |&#xA;| a | b | c | d |&#xA;| 1 | 2 | 3 | 4 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;addhdr&lt;/code&gt; function lacks checks for empty tables.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-01-13T21:07:03.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19522" PostTypeId="2" ParentId="19501" CreationDate="2016-01-13T21:27:29.250" Score="0" Body="&lt;p&gt;Disclaimer: I've cooperated with Quelpa's author in creating it, so this post is most certainly biased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;https://github.com/quelpa/quelpa&quot; rel=&quot;nofollow&quot;&gt;Quelpa&lt;/a&gt; to build anything packagable with a MELPA recipe to your liking.  This can be used both to simply rebuild a package from its sources or to build an earlier snapshot that's been known to work for you.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-01-13T21:27:29.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19525" PostTypeId="2" ParentId="19440" CreationDate="2016-01-13T22:55:47.903" Score="13" Body="&#xA;&#xA;&lt;p&gt;I have actually done rather a lot of research on this and fundamentally the problem is that git for windows &lt;strong&gt;sucks&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the upstream bug: &lt;a href=&quot;https://github.com/git-for-windows/git/issues/596&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/git-for-windows/git/issues/596&lt;/a&gt; and it requires somebody to rewrite shell scripts in C so that there is no more command forking. For me, its the interactive rebase that is the real killer (I can kick off an interactive rebase, go make tea, come back, read some news, drink the tea, and then &lt;strong&gt;maybe&lt;/strong&gt; it's finished. It's much worse than a lot of people think it is), but general status-like calls are also enough to interrupt the work stride.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative might be to update jGit to support the commands that magit uses, and then run it in nailgun to reduce the JVM startup time, I started a thread to discuss this: &lt;a href=&quot;http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg03064.html&quot; rel=&quot;noreferrer&quot;&gt;http://dev.eclipse.org/mhonarc/lists/jgit-dev/msg03064.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to read &lt;a href=&quot;https://stackoverflow.com/questions/4485059&quot;&gt;https://stackoverflow.com/questions/4485059&lt;/a&gt; for some potential speedups, but honestly you'll barely notice them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something you can do in magit is to follow the author's advice in setting up a minimal &lt;code&gt;magit-status&lt;/code&gt; just for staging&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; WORKAROUND https://github.com/magit/magit/issues/2395&#xA;(define-derived-mode magit-staging-mode magit-status-mode &quot;Magit staging&quot;&#xA;  &quot;Mode for showing staged and unstaged changes.&quot;&#xA;  :group 'magit-status)&#xA;(defun magit-staging-refresh-buffer ()&#xA;  (magit-insert-section (status)&#xA;    (magit-insert-untracked-files)&#xA;    (magit-insert-unstaged-changes)&#xA;    (magit-insert-staged-changes)))&#xA;(defun magit-staging ()&#xA;  (interactive)&#xA;  (magit-mode-setup #'magit-staging-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so, do you know any experienced C or Java developers who'd be able to help with either of the solutions to fix git or jGit?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-01-14T22:52:59.347" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19526" PostTypeId="1" AcceptedAnswerId="19623" CreationDate="2016-01-13T23:50:09.107" Score="3" ViewCount="629" Body="&lt;p&gt;I'm currently trying to move from vim to emacs so be gentle with me ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Vim, one of my favorite features is auto commands, I'll have one for each project for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;au BufEnter c:/projects/foo/* :call FooSetup()&#xA;au BufEnter c:/projects/bar/* :call BarSetup()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will call the correct setup whenever I switch buffers and change setting like the root directory, make program, error format etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest emacs equivalent I've been able to find is mode hooks, which seem much more limited.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; - The solution, by combining both answers below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/test ()&#xA;  (when (and buffer-file-name (string-match &quot;c:/projects/foo/.*&quot; (buffer-file-name)))&#xA;    (message &quot;foo&quot;)&#xA;    (setq default-directory &quot;c:/projects/foo&quot;))&#xA;  (when (and buffer-file-name (string-match &quot;c:/projects/bar/.*&quot; (buffer-file-name)))&#xA;    (message &quot;bar&quot;)&#xA;    (setq default-directory &quot;c:/projects/bar&quot;)))&#xA;(add-hook 'buffer-list-update-hook #'my/test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10765" LastEditorUserId="10765" LastEditDate="2016-01-20T10:11:37.390" LastActivityDate="2016-01-20T10:11:37.390" Title="Emacs Equivalent of Vims's Auto Commands?" Tags="|hooks|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19527" PostTypeId="2" ParentId="14161" CreationDate="2016-01-14T01:32:12.453" Score="1" Body="&lt;p&gt;In order to get this working in Emacs.app in addition to setting PYTHIONIOENCODING, I also had to set the LANG variable, I now have the following lines in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setenv &quot;PYTHONIOENCODING&quot; &quot;utf-8&quot;)&#xA; (setenv &quot;LANG&quot; &quot;en_US.UTF-8&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10768" LastActivityDate="2016-01-14T01:32:12.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19528" PostTypeId="1" AcceptedAnswerId="19529" CreationDate="2016-01-14T03:29:31.747" Score="2" ViewCount="550" Body="&lt;p&gt;Tonight I started Emacs, and &lt;code&gt;helm-mode&lt;/code&gt; is no longer used for certain actions. So far I have found that, for me, &lt;code&gt;M-x&lt;/code&gt; and &lt;code&gt;find-file&lt;/code&gt; don't use &lt;code&gt;helm&lt;/code&gt; anymore, which they have since I first started using helm. I can clearly see &lt;code&gt;Helm&lt;/code&gt; displayed in my mode-line, but when I hit &lt;code&gt;M-x&lt;/code&gt; or &lt;code&gt;C-x C-f&lt;/code&gt;, &lt;code&gt;Helm&lt;/code&gt; disappears from my mode-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me these have always worked automatically, I haven't configured these commands to use &lt;code&gt;helm&lt;/code&gt; explicitly. Other commands continue to use &lt;code&gt;helm&lt;/code&gt;, e.g., &lt;code&gt;describe-variable&lt;/code&gt; and &lt;code&gt;describe-function&lt;/code&gt; still use &lt;code&gt;helm&lt;/code&gt; for completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally, I would assume that I messed up my configuration file or that an update to &lt;code&gt;helm&lt;/code&gt; changed something. However, all my configuration files are under version control, and nothing has changed. Also, I think I might have updated &lt;code&gt;helm&lt;/code&gt; yesterday through MELPA, but I can't imagine that I would have gone all day without using &lt;code&gt;find-file&lt;/code&gt; or &lt;code&gt;M-x&lt;/code&gt; without noticing that they had changed. Also, on the &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;helm&lt;/code&gt; github page&lt;/a&gt;, I cannot see any indication that these things have been changed recently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting Emacs with the &lt;code&gt;-Q&lt;/code&gt; option to bypass my init file, activating packages with &lt;code&gt;package-initialize&lt;/code&gt; and running &lt;code&gt;M-x helm-mode&lt;/code&gt; to activate &lt;code&gt;helm&lt;/code&gt; gives me the same results: &lt;code&gt;helm&lt;/code&gt; completion is used for e.g., &lt;code&gt;describe-variable&lt;/code&gt; and &lt;code&gt;describe-function&lt;/code&gt;, but not for &lt;code&gt;M-x&lt;/code&gt; or &lt;code&gt;find-file&lt;/code&gt; other commands might be affected as well, but this is what I have found so far. Is anyone else experiencing this behavior? Does anyone know what is going on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, &lt;code&gt;helm-find-files&lt;/code&gt; and &lt;code&gt;helm-M-x&lt;/code&gt; commands still work, so I could bind them to &lt;code&gt;C-x C-f&lt;/code&gt; and &lt;code&gt;M-x&lt;/code&gt;, but I am curious what happened, to the previoius behavior.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-21T02:56:10.507" Title="Helm completion no longer used for M-x or find-file" Tags="|helm|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19529" PostTypeId="2" ParentId="19528" CreationDate="2016-01-14T08:15:58.610" Score="2" Body="&lt;p&gt;Yes, this is done in &lt;a href=&quot;https://github.com/emacs-helm/helm/commit/1de1701c73b15a86e99ab1c5c53bd0e8659d8ede&quot; rel=&quot;nofollow&quot;&gt;this commit&lt;/a&gt; by the helm maintainer to reduce confusion for new users, if you want the old behaviour, just undo that commit by customizing &lt;code&gt;helm-completing-read-handlers-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="8430" LastEditDate="2016-01-21T02:56:10.507" LastActivityDate="2016-01-21T02:56:10.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19530" PostTypeId="2" ParentId="19489" CreationDate="2016-01-14T08:46:53.507" Score="2" Body="&lt;p&gt;Your question is based on faulty assumptions.  As already &lt;a href=&quot;https://emacs.stackexchange.com/a/19490/620&quot;&gt;explained by Karol&lt;/a&gt;, configuration for the package installed via ELPA is different from the &quot;standard&quot; configuration, you have &lt;strong&gt;NOT&lt;/strong&gt; to add the lines&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(load &quot;auctex.el&quot; nil t t)&#xA;(load &quot;preview-latex.el&quot; nil t t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After you install a package with ELPA, usually you don't have to write anything at all in your init file to load that package, this is also the case for AUCTeX.  It is so because ELPA uses its own way to load packages.  In particular, for AUCTeX all autoloads are in the file &lt;code&gt;auctex-autoloads.el&lt;/code&gt; and there is no &lt;code&gt;preview-latex.el&lt;/code&gt; file at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, there is no function in AUCTeX containing &lt;code&gt;AUCTeX&lt;/code&gt; in the name, so there is no reason for &lt;code&gt;M-x auctex&lt;/code&gt; to provide completion for a function.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-01-14T08:46:53.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19532" PostTypeId="1" AcceptedAnswerId="19541" CreationDate="2016-01-14T10:10:01.150" Score="13" ViewCount="7417" Body="&lt;p&gt;Is it possible to show the absolute number of the current line, instead of &quot;0&quot;, when in relative line number mode?  This is sometimes referred to as &quot;hybrid line number mode&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 7                                                                                                      &#xA;  6          this.oscs[i].oscillator.start();                                                            &#xA;  5        }                                                                                             &#xA;  4                                                                                                      &#xA;  3        this.bindController();                                                                        &#xA;  2      };                                                                                              &#xA;  1                                                                                                      &#xA;252      factory.stop = function () {  &amp;lt;- current line number shows                                                                                       &#xA;  1        console.log('theremin: now in stop 2');                                                       &#xA;  2        this.leapController.disconnect();                                                             &#xA;  3        //this.leapController.removeListener('frame', factory.ctrlFrameHandler);                      &#xA;  4        //this.leapController.removeListener('frame', this.ctrlFrameHandler);                         &#xA;  5        this.leapController.removeListener('frame', this.leapController.listeners('frame')[0]); &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://jeffkreeftmeijer.com/2013/vims-new-hybrid-line-number-mode/&quot; rel=&quot;noreferrer&quot;&gt;Here's how you do it in vim&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running evil, and activate relative line number mode in my .emacs like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(linum-mode)&#xA;(linum-relative-global-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't see any packages for this, or any customization available for it in the existing packages.  I'm somewhat familiar with elisp, so it might be possible to figure out how to hook the existing code e.g with advice, but I'd rather avoid going that route if possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6717" LastActivityDate="2017-10-13T12:33:20.527" Title="hybrid line number mode in emacs?" Tags="|evil|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19533" PostTypeId="1" CreationDate="2016-01-14T11:28:56.317" Score="1" ViewCount="48" Body="&lt;p&gt;I'm trying to write an &lt;code&gt;ido-completing-read&lt;/code&gt;-powered backend for &lt;code&gt;projectile-find-tag&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for really big TAG files, this is ridiculously slow when the user starts typing because there are so many completion options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I stop ido from trying to offer suggestions until the user has entered X many characters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm using &lt;code&gt;flx-ido&lt;/code&gt; if that matters)&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2016-01-14T11:28:56.317" Title="Minimum length for ido-completing-read" Tags="|projectile|ido|flx-ido|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19534" PostTypeId="1" AcceptedAnswerId="19554" CreationDate="2016-01-14T13:19:04.057" Score="1" ViewCount="251" Body="&lt;p&gt;Why can't my emacs find the google-translate package from melpa ?&#xA;I have trried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package google-translate :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it doesn't find it, also &lt;code&gt;M-x install-package&lt;/code&gt; does provide a &lt;code&gt;google-translate&lt;/code&gt; entry with tab completion, but it still doesn't find the package.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2016-01-15T09:01:54.307" Title="Can't find google-translate package from melpa" Tags="|package|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19535" PostTypeId="1" CreationDate="2016-01-14T13:48:06.090" Score="0" ViewCount="103" Body="&lt;p&gt;trying to run the google-translate package in org mode, I have the following error in the package :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ob-translate.el:84:1:Warning: the following functions are not known to be defined:&#xA;    google-translate-insert-nulls, google-translate-http-response-body,&#xA;    google-translate-format-request-url&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And these are the functions run by org babel when evaluating the source code.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2016-01-14T13:48:06.090" Title="Org babel google translate functions not defined" Tags="|org-babel|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19536" PostTypeId="1" AcceptedAnswerId="19817" CreationDate="2016-01-14T14:04:01.587" Score="1" ViewCount="609" Body="&lt;p&gt;I'm using native windows emacs together with mingw. When there's a compile error, the *compilation* buffer looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make -C ..&#xA;make: Entering directory `/c/Users/m.grunwald/Documents/Projects/aaaa/bbbb/cccc/dddd'&#xA;compiling Update.c&#xA;../Source/Update.c: In function 'SetMessage':&#xA;../Source/Update.c:52:1: error: 'd' undeclared (first use in this     function)&#xA; d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;(next-error)&lt;/code&gt;, emacs prompts me to &quot;Find this error in...:&quot; and the path it suggests is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:/c/Users/m.grunwald/Documents/Projects/aaaa/bbbb/cccc/dddd/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now this is neither a valid windows nor a valid mingw path and it makes compiling tideous. How do I get rid of the leading &quot;C:&quot; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that the path that &quot;make&quot; prompts in the 2nd line is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The linked topic &lt;a href=&quot;https://emacs.stackexchange.com/questions/12593/c-c-user-my-folder-isnt-an-existing-directory-error?lq=1&quot;&gt;&amp;quot;C:/c/user/...my-folder/ isn&amp;#39;t an existing directory&amp;quot; error&lt;/a&gt; is about the same problem, but fixes it only in magit. I have no idea where I should tackle the problem for compile-mode and this is the wrong aproach, IMHO. It should be possible to fix this in emacs itself and only once, not once in each mode...&lt;/p&gt;&#xA;" OwnerUserId="10128" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-02-24T19:07:40.860" Title="Why do paths start with &quot;c:/c/...&quot; in windows emacs when I use 'next-error'?" Tags="|microsoft-windows|compilation-mode|path|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19537" PostTypeId="2" ParentId="18704" CreationDate="2016-01-14T14:33:30.647" Score="0" Body="&lt;p&gt;Calc accepts &lt;strong&gt;37@ 26' 36.42&quot;&lt;/strong&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the simple case of 37@ 26' 36&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calc-eval &quot;deg(37@ 26' 36\&quot;)&quot;)         ; =&amp;gt; &quot;37.4433333333&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can call Calc functions from Emacs Lisp by &lt;code&gt;calcFunc-deg&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calcFunc-deg '(hms 37 26 36))          ; =&amp;gt; (float 374433333333 -10)&#xA;(math-format-number (calcFunc-deg '(hms 37 26 36))) ; =&amp;gt; &quot;37.4433333333&quot; as a string&#xA;(string-to-number&#xA; (math-format-number (calcFunc-deg '(hms 37 26 36)))) ; =&amp;gt; 37.4433333333 as a number&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the case for &lt;strong&gt;37@ 26' 36.42&quot;&lt;/strong&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As 36.42 is not an integer, it is expressed as &lt;code&gt;(float 3642 -2)&lt;/code&gt; in Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &lt;code&gt;'(hms 37 26 36.42)&lt;/code&gt; should be &lt;code&gt;'(hms 37 26 (float 3642 -2))&lt;/code&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Voila!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calc-eval &quot;deg(37@ 26' 36.42\&quot;)&quot;)          ; =&amp;gt; &quot;37.44345&quot;&#xA;(calcFunc-deg '(hms 37 26 (float 3642 -2))) ; =&amp;gt; (float 3744345 -5)&#xA;(math-format-number (calcFunc-deg '(hms 37 26 (float 3642 -2)))) ; =&amp;gt; &quot;37.44345&quot; as a string&#xA;(string-to-number&#xA; (math-format-number (calcFunc-deg '(hms 37 26 (float 3642 -2))))) ; =&amp;gt; 37.44345 as a number&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="8634" LastEditDate="2016-04-22T16:11:41.527" LastActivityDate="2016-04-22T16:11:41.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19538" PostTypeId="2" ParentId="19518" CreationDate="2016-01-14T14:53:37.157" Score="29" Body="&#xA;&#xA;&lt;p&gt;There are various ways to do it.  Kaushal's way can be made a good bit more efficient, with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(goto-char (point-min))&#xA;(while (not (eobp))&#xA;  (let ((line (buffer-substring (point)&#xA;                                (progn (forward-line 1) (point)))))&#xA;    ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in Emacs it is much more customary to work on the buffer rather than on strings. So rather than extract the string and then work on it, you'd just do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(goto-char (point-min))&#xA;(while (not (eobp))&#xA;  ...&#xA;  (forward-line 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, if you want to operate on a region rather than on the whole buffer, and if your &quot;operate&quot; includes modifying the buffer, it's frequent to do it backwards (so that you don't get bitten by the fact that the &quot;end&quot; position of your region moves every time you modify the buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(goto-char end)&#xA;(while (&amp;gt; (point) start)&#xA;  ...&#xA;  (forward-line -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2019-02-11T14:34:16.083" LastActivityDate="2019-02-11T14:34:16.083" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="19539" PostTypeId="2" ParentId="19164" CreationDate="2016-01-14T15:08:18.373" Score="1" Body="&lt;p&gt;Not completely sure if this is what you're looking for, but I open attachments in emacs with &lt;code&gt;A-e&lt;/code&gt; from inside the message. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info: &lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e/MSGV-Actions.html&quot; rel=&quot;nofollow&quot;&gt;http://www.djcbsoftware.nl/code/mu/mu4e/MSGV-Actions.html&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2016-01-14T15:08:18.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19540" PostTypeId="1" AcceptedAnswerId="19542" CreationDate="2016-01-14T16:50:38.110" Score="5" ViewCount="1766" Body="&lt;p&gt;Suppose I have hundreds lines of items:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;**** aa&#xA;**** bb&#xA;......&#xA;**** cc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I try to multiply set tags. I tried to mark them, and use &lt;code&gt;C-c C-q&lt;/code&gt;, but it didn't works&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2018-04-06T19:12:52.857" Title="Can I batchly set tags in org mode?" Tags="|org-mode|org-tags|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19541" PostTypeId="2" ParentId="19532" CreationDate="2016-01-14T16:53:08.317" Score="11" Body="&#xA;&#xA;&lt;p&gt;You can make the current line number show instead of &quot;0&quot; by customizing the &lt;code&gt;linum-relative-current-symbol&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change that variable by one of multiple ways.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;M-x customize-group RET linum-relative RET  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, customize the &quot;Linum Relative Current Symbol&quot; variable (whose default value is &lt;code&gt;0&lt;/code&gt;). If you hit on the &quot;More&quot; link, below it, the full description of the variable will read:  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The symbol you want to show on the current line, by default it is 0.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can use any string like &quot;-&gt;&quot;. If this variable is empty string, linum-relative will show the real line number at current line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, set that value to empty string, simply delete that &lt;code&gt;0&lt;/code&gt; and hit &quot;Apply and Save&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another way is to do add the below to your emacs config and evaluating it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq linum-relative-current-symbol &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-14T16:53:08.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19542" PostTypeId="2" ParentId="19540" CreationDate="2016-01-14T17:19:31.420" Score="5" Body="&lt;p&gt;As org files are plain text files, we can add tags using a simple approach: &lt;code&gt;query-replace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to the beginning of the buffer.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x query-replace-regexp&lt;/code&gt; or use the default binding &lt;code&gt;C-M-%&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Enter regexp to match the org headings: &lt;code&gt;^\*+\s-+.*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;To add a tag, you basically append the heading with a space, a &lt;code&gt;:&lt;/code&gt; and the tag.&lt;br&gt;&#xA;So the replacement text would be &lt;code&gt;\&amp;amp; :MYTAG&lt;/code&gt;. &lt;em&gt;Here &lt;code&gt;\&amp;amp;&lt;/code&gt; represents whatever text was matched in the &quot;search&quot; step above.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Now you can review and hit yes only where you want the tag to be appended, or just hit &lt;code&gt;!&lt;/code&gt; if you want to append tags to all the org headings in the buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's an example org buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* abc&#xA;** def&#xA;*** ghi&#xA;* jkl&#xA;** mno&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By implementing the above steps and hit &lt;code&gt;!&lt;/code&gt; in that last step, that would get converted to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* abc :MYTAG&#xA;** def :MYTAG&#xA;*** ghi :MYTAG&#xA;* jkl :MYTAG&#xA;** mno :MYTAG&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-14T17:19:31.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19546" PostTypeId="2" ParentId="19540" CreationDate="2016-01-14T23:19:19.783" Score="6" Body="&lt;p&gt;&lt;code&gt;org-agenda&lt;/code&gt; supports many &lt;a href=&quot;http://orgmode.org/manual/Agenda-commands.html&quot; rel=&quot;noreferrer&quot;&gt;bulk actions&lt;/a&gt;.  Do an &lt;code&gt;org-agenda&lt;/code&gt; search (&lt;code&gt;C-c a&lt;/code&gt;) that matches the entries you're interested in.  In the agenda view use &lt;code&gt;m&lt;/code&gt; to mark them (or &lt;code&gt;*&lt;/code&gt; to mark everything) and the &lt;code&gt;B&lt;/code&gt; to select a bulk action.  The &lt;code&gt;+&lt;/code&gt; action will add a tag to each entry.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-01-14T23:19:19.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19547" PostTypeId="1" AcceptedAnswerId="19549" CreationDate="2016-01-15T00:15:26.873" Score="2" ViewCount="775" Body="&lt;p&gt;I'm trying to write a function to do the following tasks:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Extract a piece of text from the current buffer (specifically, a diff)&lt;/li&gt;&#xA;&lt;li&gt;Switch to a temporary buffer in another window, and insert this text into that buffer.&lt;/li&gt;&#xA;&lt;li&gt;Set the temporary buffer's major mode (to diff-mode).&lt;/li&gt;&#xA;&lt;li&gt;Prompt the user to save that buffer to a file.&lt;/li&gt;&#xA;&lt;li&gt;Kill the buffer, and restore the window layout if necessary.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The rough skeleton of the function is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun extract-and-save ()&#xA;  (interactive)&#xA;  (let ((text-to-save (get-text-to-save)))&#xA;    (with-temp-buffer?&#xA;      (insert text-to-save)&#xA;      (diff-mode)&#xA;      (save-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not able to get the &lt;code&gt;with-temp-buffer&lt;/code&gt; invocation right -- I either end up saving the buffer before it's visible and not killing it afterwards, or mess up the major mode of the previous buffer before switching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using &lt;code&gt;with-temp-buffer-window&lt;/code&gt; and variants, but I don't understand them well enough/they don't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any pointers?&lt;/p&gt;&#xA;" OwnerUserId="285" LastEditorUserId="105" LastEditDate="2016-03-14T00:51:40.313" LastActivityDate="2016-03-14T00:51:40.313" Title="Jumping to a temp buffer, prompting for save and restoring layout" Tags="|buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19548" PostTypeId="2" ParentId="5758" CreationDate="2016-01-15T00:31:14.447" Score="3" Body="&lt;p&gt;To disable the initial warnings, I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set 'ad-redefinition-action 'accept)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't encountered your other errors, but they might be offshoots of the above. I haven't either investigated the side-effects of setting the above variable globally, I'll update this answer if I find any issues.&lt;/p&gt;&#xA;" OwnerUserId="285" LastActivityDate="2016-01-15T00:31:14.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19549" PostTypeId="2" ParentId="19547" CreationDate="2016-01-15T03:31:46.523" Score="4" Body="&lt;p&gt;EDIT: After thinking about this some more, I realized that &lt;code&gt;with-temp-buffer&lt;/code&gt; may be a good choice after all, as it can replace the &lt;code&gt;unwind-protect&lt;/code&gt; form in my original answer and the whole thing will be both cleaner and more robust.  Here's what I'm currently advocating:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun extract-and-save ()&#xA;  (interactive)&#xA;  (let ((text-to-save (get-text-to-save)))&#xA;    (with-temp-buffer&#xA;      (switch-to-buffer-other-window (current-buffer))&#xA;      (insert text-to-save)&#xA;      (diff-mode)&#xA;      (save-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, basically what you had to begin with, except for the explicit (and weird-looking) &lt;code&gt;switch-to-buffer&lt;/code&gt; form.  Again, this is because &lt;code&gt;with-temp-buffer&lt;/code&gt; selects its temporary buffer but doesn't display it to the user without specific prompting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;hr&gt;&#xA;(Original answer, for context)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think &lt;code&gt;with-temp-buffer&lt;/code&gt; is the wrong construct for this, because it makes the temporary buffer current but doesn't display it, and you want the user to see the diff they're about to save.  It's probably better to name the buffer and select it manually.  Try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun extract-and-save ()&#xA;  (interactive)&#xA;  (let ((text-to-save (get-text-to-save)))&#xA;    (save-window-excursion&#xA;      (switch-to-buffer-other-window (generate-new-buffer &quot;*extraction*&quot;))&#xA;      (insert text-to-save)&#xA;      (diff-mode)&#xA;      (unwind-protect (save-buffer) &#xA;        (kill-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;generate-new-buffer&lt;/code&gt; form is there in case of a collision with an existing buffer.  The &lt;code&gt;unwind-protect&lt;/code&gt; around &lt;code&gt;save-buffer&lt;/code&gt; is in case the user declines to save using &lt;code&gt;C-g&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2016-01-15T15:34:01.697" LastActivityDate="2016-01-15T15:34:01.697" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19550" PostTypeId="1" CreationDate="2016-01-15T03:47:12.643" Score="0" ViewCount="46" Body="&lt;p&gt;Org-mode has a face &lt;code&gt;org-verbatim&lt;/code&gt;. But it does not support &lt;code&gt;'&lt;/code&gt; at begin or end. (same for &lt;code&gt;=&lt;/code&gt;)&#xA;I use &lt;code&gt;\equal{}&lt;/code&gt; to replace &lt;code&gt;=&lt;/code&gt; in org-verbatim highlighted string.&#xA;But I don't know how to replace &lt;code&gt;'&lt;/code&gt;.&#xA;Does anybody knows that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;here is the minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=$ put 'string'=&#xA;=$ put &quot;string&quot;=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2016-01-15T08:16:43.777" LastActivityDate="2016-01-15T08:16:43.777" Title="How to make org-verbatim face include '" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ClosedDate="2016-01-15T22:49:25.387" ContentLicense="CC BY-SA 3.0" />
  <row Id="19551" PostTypeId="2" ParentId="19440" CreationDate="2016-01-15T04:23:15.390" Score="2" Body="&#xA;&#xA;&lt;p&gt;Having recently looked at the a list of &lt;code&gt;call-process&lt;/code&gt; calls from &lt;code&gt;magit-status&lt;/code&gt; for another reason, it occured to me that some of them can be cached.  With the following advice &lt;code&gt;magit-status&lt;/code&gt; on Magit's repo goes from 1.9 to 1.3 seconds (my previous measurement of 0.8s mentioned in the comments was for a different (faster) computer).  If you are already using &lt;code&gt;magit-staging&lt;/code&gt; from the other answer it's probably not going to help much: I saw a reduction from 0.16 to 0.12 seconds (but that's barely larger than measurement noise).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;WARNING: This doesn't take care of updating the cache, so things may go wrong (especially if you are fiddling with your git configuration).&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local magit-git--git-dir-cache nil)&#xA;(defvar-local magit-git--toplevel-cache nil)&#xA;(defvar-local magit-git--cdup-cache nil)&#xA;&#xA;(defun memoize-rev-parse (fun &amp;amp;rest args)&#xA;  (pcase (car args)&#xA;    (&quot;--git-dir&quot;&#xA;     (unless magit-git--git-dir-cache&#xA;       (setq magit-git--git-dir-cache (apply fun args)))&#xA;     magit-git--git-dir-cache)&#xA;    (&quot;--show-toplevel&quot;&#xA;     (unless magit-git--toplevel-cache&#xA;       (setq magit-git--toplevel-cache (apply fun args)))&#xA;     magit-git--toplevel-cache)&#xA;    (&quot;--show-cdup&quot;&#xA;     (let ((cdup (assoc default-directory magit-git--cdup-cache)))&#xA;       (unless cdup&#xA;         (setq cdup (cons default-directory (apply fun args)))&#xA;         (push cdup magit-git--cdup-cache))&#xA;       (cdr cdup)))&#xA;    (_ (apply fun args))))&#xA;&#xA;(advice-add 'magit-rev-parse-safe :around #'memoize-rev-parse)&#xA;&#xA;(defvar-local magit-git--config-cache (make-hash-table :test 'equal))&#xA;&#xA;(defun memoize-git-config (fun &amp;amp;rest keys)&#xA;  (let ((val (gethash keys magit-git--config-cache :nil)))&#xA;    (when (eq val :nil)&#xA;      (setq val (puthash keys (apply fun keys) magit-git--config-cache)))&#xA;    val))&#xA;&#xA;(advice-add 'magit-get :around #'memoize-git-config)&#xA;(advice-add 'magit-get-boolean :around #'memoize-git-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-01-15T04:23:15.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19552" PostTypeId="1" CreationDate="2016-01-15T08:25:38.323" Score="1" ViewCount="410" Body="&lt;p&gt;I have a binary (a rust program that uses bindings to ncurses) and I need to run it in eshell as xterm-256color (well, make it work correctly at least). I haven't figured out how to do this yet. Tried setting TERM to xterm-256color, but that didn't seem to help. Is there even a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="9404" LastActivityDate="2016-02-14T10:39:26.620" Title="run a binary that uses ncurses in eshell under xterm-256color emulation" Tags="|eshell|rust|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19553" PostTypeId="1" AcceptedAnswerId="19572" CreationDate="2016-01-15T08:59:54.153" Score="8" ViewCount="1082" Body="&lt;p&gt;It is possible to change the figure options for a latex figure in org-mode?&#xA;Currently I'm using the following to insert a figure in my org document.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: awesome figure&#xA;#+NAME: fig:my-figure&#xA;[[file:awesome-figure.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is exported to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{figure}[htb]&#xA;\centering&#xA;\includegraphics[ ... ]{awesome-figure.png}&#xA;\caption{\label{fig:my-figure}awesome-figure}&#xA;\end{figure}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is already quite good, but it tells latex not to try and enforce the &lt;code&gt;[htb]&lt;/code&gt; hints. How can I change it so that latex figures are exported as follows?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{figure}[!htb]&#xA;\centering&#xA;\inclduegraphics[ ... ]{awesome-figure.png}&#xA;\caption{\label{fig:my-figure}awesome-figure}&#xA;\end{figure}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The exclamation mark for the figure options is important since it tells latex it should enforce the figure placement.&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="14355" LastEditDate="2016-12-27T21:09:08.580" LastActivityDate="2016-12-27T21:09:08.580" Title="Change figure environment options" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19554" PostTypeId="2" ParentId="19534" CreationDate="2016-01-15T09:01:54.307" Score="4" Body="&lt;p&gt;This happens to me as well from time to time, the cause is melpa keeps only latest version of packages, so it is safe to always update package archive with &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; or &lt;code&gt;M-x list-packages&lt;/code&gt; before installing package from melpa, of course, this is time-consuming and inconvenient.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a rough programmatic solution that I can think of at this moment, I guess both &lt;code&gt;M-x package-install some-package&lt;/code&gt; and &lt;code&gt;(use-package some-package :ensure t)&lt;/code&gt; should work even when &lt;code&gt;some-package&lt;/code&gt;'s archive is outdated.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun package-install-ensure-melpa (orig-fun &amp;amp;rest args)&#xA;  (condition-case nil&#xA;      (apply orig-fun args)&#xA;    (error&#xA;     (progn (package-refresh-contents)&#xA;            (apply orig-fun args)))))&#xA;&#xA;(advice-add 'package-install :around #'package-install-ensure-melpa)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-01-15T09:01:54.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19555" PostTypeId="1" AcceptedAnswerId="19556" CreationDate="2016-01-15T09:31:20.940" Score="3" ViewCount="598" Body="&lt;p&gt;I'd like to obtain the absolute pixel position of the point (i.e. the cursor, &lt;strong&gt;not&lt;/strong&gt; the mouse pointer) in the current buffer in a GUI frame, to pass it onwards to an external program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't mind where the pixel position is anchored, e.g. whether to the frame or to the display, as I can easily convert between these, but I haven't found a way to obtain either position within Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What did I miss?  What function can I use to get the pixel position of the point?&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-01-15T09:59:55.760" Title="Obtain absolute pixel position of point" Tags="|frames|point|gui-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19556" PostTypeId="2" ParentId="19555" CreationDate="2016-01-15T09:59:55.760" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;window-absolute-pixel-position&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;window-absolute-pixel-position is a compiled Lisp function in&#xA;  `window.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(window-absolute-pixel-position &amp;amp;optional POSITION WINDOW)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return display coordinates of POSITION in WINDOW.&#xA;  If the buffer position POSITION is visible in window WINDOW,&#xA;  return the display coordinates of the upper/left corner of the&#xA;  glyph at POSITION.  The return value is a cons of the X- and&#xA;  Y-coordinates of that corner, relative to an origin at (0, 0) of&#xA;  WINDOW's display.  Return nil if POSITION is not visible in&#xA;  WINDOW.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;WINDOW must be a live window and defaults to the selected window.&#xA;  POSITION defaults to the value of `window-point' of WINDOW.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-01-15T09:59:55.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19557" PostTypeId="2" ParentId="19552" CreationDate="2016-01-15T10:13:27.607" Score="1" Body="&lt;p&gt;Have you tried using &lt;code&gt;M-x term&lt;/code&gt; instead of eshell? To my knowledge &lt;code&gt;eshell&lt;/code&gt; does not support ncurses anyway.&lt;/p&gt;&#xA;" OwnerUserId="10734" LastActivityDate="2016-01-15T10:13:27.607" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="19558" PostTypeId="1" AcceptedAnswerId="19559" CreationDate="2016-01-15T10:16:41.490" Score="3" ViewCount="1131" Body="&lt;p&gt;Goal:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When dired is opened by default hidden files should be hidden. &lt;/li&gt;&#xA;&lt;li&gt;When the user clicks &quot;M-q&quot; hidden files must be shown except for &quot;.&quot; and &quot;..&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;don't show hidden files&#xA;(setq dired-omit-files &quot;^\\..*$&quot;)&#xA;(defun swap-omit-files ()&#xA;      &quot;Show/hide hidden files except . and ..&quot;&#xA;      (interactive)&#xA;      (if (string= dired-omit-files &quot;^\\..*$&quot;)&#xA;            (setq dired-omit-files &quot;^\\.\\.?$&quot;)&#xA;            (setq dired-omit-files &quot;^\\..*$&quot;)&#xA;            )&#xA;      )&#xA;&#xA;(add-hook 'dired-mode-hook&#xA;      (lambda ()&#xA;            (setq dired-omit-mode t)&#xA;            (define-key dired-mode-map (kbd &quot;M-q&quot;) 'swap-omit-files)&#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hidden file are indeed hidden by default, but something is wrong with &lt;code&gt;swap-omit-files&lt;/code&gt; --- the hidden files are not shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to fix?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2016-01-15T10:27:59.887" Title="How to adjust dired-omit-mode" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19559" PostTypeId="2" ParentId="19558" CreationDate="2016-01-15T10:27:59.887" Score="1" Body="&lt;p&gt;This worked. We needed to &lt;code&gt;revert-buffer&lt;/code&gt; after changing &lt;code&gt;dired-omit-files&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun swap-omit-files ()&#xA;      &quot;Show/hide hidden files except . and ..&quot;&#xA;      (interactive)&#xA;      (if (string= dired-omit-files &quot;^\\..*$&quot;)&#xA;            (setq dired-omit-files &quot;^\\.\\.?$&quot;)&#xA;            (setq dired-omit-files &quot;^\\..*$&quot;)&#xA;            )&#xA;      (revert-buffer)&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2016-01-15T10:27:59.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19560" PostTypeId="1" CreationDate="2016-01-15T12:14:38.920" Score="5" ViewCount="2504" Body="&lt;p&gt;I am trying to pull together information that is scattered across a multipage PDF in an org buffer. The related items typically occupy a small region on a page only and may be many pages apart, hence the attempt to arrange them side by side in an org buffer where these images shall be included as a visual cue as org inline images along with a commentary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, the region of interest would be drawn interactively as a rectangle and pasted in the org buffer in a way that saved the image locally in a subfolder next to the org file and inserted a link to the local file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) imagemagick&lt;br&gt;&#xA;I am aware of &quot;Automatic screenshot insertion” over at &lt;a href=&quot;http://orgmode.org/worg/org-hacks.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/worg/org-hacks.html&lt;/a&gt; which involves imagemagick and seems to do what I want except I see no obvious way to crop the screenshot before inserting the link. &#xA;Saving the file first and cropping it manually is a stronger disruption of the workflow than I'd like since I expect lots of these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) accessing the system clipboard&lt;br&gt;&#xA;Depositing a suitably cropped screenshot to the system's clipboard in OS X is easily done using grab.app. If this could be used, that'd be fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="10782" LastActivityDate="2016-11-25T18:02:26.470" Title="interactively crop screenshot region and insert link to local image in org buffer" Tags="|org-mode|spacemacs|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19561" PostTypeId="1" AcceptedAnswerId="19565" CreationDate="2016-01-15T13:00:25.450" Score="9" ViewCount="665" Body="&lt;p&gt;I asked &lt;a href=&quot;https://stackoverflow.com/questions/34803502/bulk-reverse-the-order-of-headers-in-emacs-org-mode/&quot;&gt;this question&lt;/a&gt; on stack overflow, but haven't gotten to solve the problem yet, then I thought I should rather post it here.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to bulk-reverse the order of headings in Emacs org-mode? &#xA;I'd like to change this kind of list (&lt;strong&gt;but much bigger, not just two or three items, thus &quot;bulk&quot;&lt;/strong&gt;): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* personal computer&#xA; * Windows&#xA; * Mac&#xA; * Linux&#xA;* StackExchange&#xA; * stackoverflow&#xA;* countries&#xA;* people&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* people&#xA;* countries&#xA;* StackExchange&#xA; * stackoverflow&#xA;* personal computer&#xA; * Windows&#xA; * Mac&#xA; * Linux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just want to reverse the list so that the last heading with its subtrees would be the first heading of a new list, second-last would be the second heading of the new list, and so on.&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-03-14T00:51:25.670" Title="Bulk-reverse the order of headers in Emacs org-mode?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19562" PostTypeId="1" CreationDate="2016-01-15T13:13:02.600" Score="3" ViewCount="537" Body="&lt;p&gt;I know I can do this kind of thing with the sentence boundary, using (setq sentence-end &quot;[regexp]&quot;), but how can I do this with the word boundary?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to add capital letters to the default word boundary symbol sets, so that I could use forward word command from the beginning of the line below to select only the &quot;set&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;setWordBoundary blah blah blah&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-14T00:51:11.343" LastActivityDate="2016-03-14T00:51:11.343" Title="Is there a way to set arbitrary characters as the word boundary?" Tags="|syntax-table|words|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19563" PostTypeId="2" ParentId="19561" CreationDate="2016-01-15T13:46:44.243" Score="7" Body="&lt;p&gt;The following code block will parse the whole org buffer, reverse the first level sequence (hopefully all the level 1 headings), and then regenerate the org buffer again:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src elisp :results raw&#xA;(org-element-interpret-data (cons 'org-data (cons nil (reverse (cddr (org-element-parse-buffer))))))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, you can add this source block at the end of your document, press &lt;kbd&gt;C-c C-c&lt;/kbd&gt;, and get the reversed document as a result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Warnings&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;This code is &lt;strong&gt;very fragile&lt;/strong&gt;. It assumes that the parsed buffer has the structure &lt;code&gt;(org-data nil (headline...) (headline...) ...)&lt;/code&gt;. Anything else will fail.&lt;/li&gt;&#xA;&lt;li&gt;The code parses the whole buffer, so you should remove previous results before re-evaluating, lest you want an exponentially growing document.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-01-15T13:46:44.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19564" PostTypeId="2" ParentId="19562" CreationDate="2016-01-15T13:51:12.737" Score="8" Body="&lt;p&gt;Here are two possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/MixedCase-Words.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;subword-mode&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.  It is designed to do what you request.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs’s word commands recognize upper case letters in&#xA;  &lt;code&gt;StudlyCapsIdentifiers&lt;/code&gt; as word boundaries.  When Subword mode is&#xA;  enabled, the minor mode indicator &lt;code&gt;,&lt;/code&gt; appears in the mode line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Change the syntax class of uppercase letters to something other than word-constituent.  To do that, use function &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Table-Functions.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;modify-syntax-entry&lt;/code&gt;&lt;/a&gt;.  For example, this changes uppercase letter &lt;code&gt;A&lt;/code&gt; to be in symbols but not words:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?A &quot;_&quot;) ; Give `A` symbol syntax, not word syntax&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-15T13:51:12.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19565" PostTypeId="2" ParentId="19561" CreationDate="2016-01-15T14:03:28.353" Score="5" Body="&lt;p&gt;The following interactive function does what you want.&#xA;Nevertheless, Junacho's warning applies:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This code is very fragile. It assumes that the parsed buffer has the structure (org-data nil (headline...) (headline...) ...). Anything else will fail.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Put the following code into your initialization file, e.g., &lt;code&gt;~/.emacs&lt;/code&gt;, evaluate this buffer or re-start emacs, open your org-file and run &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;org-reverse-headers&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-reverse-headers ()&#xA;  &quot;Reverse headers of current org file&quot;&#xA;  (interactive)&#xA;  (let (str&#xA;    (content (nthcdr 2 (org-element-parse-buffer 'headline)))) ;; `org-element-parse-buffer' returns (ORG-DATA PROPERTIES CONTENT), CONTENT contains the headlines&#xA;    (setq content (nreverse content)) ;; reversal of sections&#xA;    (insert&#xA;     (with-output-to-string&#xA;       (dolist (header content)&#xA;     (princ (buffer-substring (plist-get (cadr header) :begin) (plist-get (cadr header) :end))))&#xA;       (delete-region (point-min) (point-max))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-15T15:48:21.863" LastActivityDate="2016-01-15T15:48:21.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19566" PostTypeId="1" CreationDate="2016-01-15T19:58:51.770" Score="1" ViewCount="144" Body="&lt;p&gt;I've hit a brick wall with this.  I'm running cygwin on a Windows 7 machine.  I can't connect vai ange-ftp to an ftp server, hosted by godaddy.com.  I do C-x C-f /username@ftp.foo.com: (to get a dir listing) or :index.html (file exists), and in both cases emacs asks me for my password, I enter it, and then emacs freezes.  Hard freezes - only way to kill it is to use Task Manager, and kill two emacs-w32 processes.&lt;/p&gt;&#xA;&lt;p&gt;I'm using the cygwin emacs-w32 program.&lt;/p&gt;&#xA;&lt;p&gt;My &lt;code&gt;.emacs&lt;/code&gt; includes &lt;code&gt;(require 'cygwin-mount)&lt;/code&gt;.  I also tried &lt;code&gt;(require 'setup-cygwin)&lt;/code&gt; (downloaded most recent version today), but that doesn't load properly.  Error about &amp;quot;cannot find cygwin&amp;quot;, having to do with a variable that sets the path to cygwin.  I couldn't figure it out so commented out &lt;code&gt;(require 'setup-cygwin)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So - suggestions?  Could this relate to what ftp client emacs / ange-ftp is finding?  Other things about my emacs setup for cygwin?  I've been using cygwin emacs for about 6 months and most other things work, including running processes from within emacs (shell, tex, grep, diff, etc).&lt;/p&gt;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&lt;p&gt;Here's the result of &lt;code&gt;emacs-w32 --debug-init&lt;/code&gt; with &lt;code&gt;(require 'steup-cygwin)&lt;/code&gt; in my .emacs.  Alas I can't give any error info on the actual ange-ftp issue, since emacs just freezes.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  file-directory-p(nil)&#xA;  (and (file-directory-p directory) (file-readable-p directory) directory)&#xA;  setcyg-dir-p(nil)&#xA;  (if (setcyg-dir-p cygwin-root-directory) nil (error &amp;quot;Cannot find Cygwin.  Please customize option `cygwin-root-directory'&amp;quot;))&#xA;  eval-buffer(#&amp;lt;buffer  *load*-780625&amp;gt; nil &amp;quot;/cygdrive/c/Users/strozzi2/.emacs.d/lisp/setup-cygwin.el&amp;quot; nil t)  ; Reading at buffer position 4972&#xA;  load-with-code-conversion(&amp;quot;/cygdrive/c/Users/strozzi2/.emacs.d/lisp/setup-cygwin.el&amp;quot; &amp;quot;/cygdrive/c/Users/strozzi2/.emacs.d/lisp/setup-cygwin.el&amp;quot; nil t)&#xA;  require(setup-cygwin)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &amp;quot;/cygdrive/c/Users/strozzi2/.emacs&amp;quot; nil t)  ; Reading at buffer position 1708&#xA;  load-with-code-conversion(&amp;quot;/cygdrive/c/Users/strozzi2/.emacs&amp;quot; &amp;quot;/cygdrive/c/Users/strozzi2/.emacs&amp;quot; t t)&#xA;  load(&amp;quot;~/.emacs&amp;quot; t t)&#xA;  #[0 &amp;quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;**** With new setup-cygwin.el from Drew, it behaves as he said.  The relevant part of .emacs is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cygwin-mount)&#xA;(setq cygwin-root-directory &amp;quot;/c/cygdrive/cygwin64/&amp;quot;)&#xA;(require 'setup-cygwin)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Startup now works.  C:/cygwin64/ didn't.&lt;/p&gt;&#xA;&lt;p&gt;And ange-ftp works!  Once I put ftp in passive mode to get around firewall.  Success!&lt;/p&gt;&#xA;" OwnerUserId="10788" LastEditorUserId="947" LastEditDate="2021-06-01T19:25:34.440" LastActivityDate="2021-06-01T19:25:34.440" Title="ange-ftp problem on cygwin emacs" Tags="|microsoft-windows|cygwin|ftp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="19567" PostTypeId="1" CreationDate="2016-01-15T19:58:52.947" Score="1" ViewCount="92" Body="&lt;p&gt;I'm on a new system (Amazon Linux 2015.9), and my emacs config seems to not like the stock install (Emacs 24.3.1) or vice-versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;code&gt;C-x C-c&lt;/code&gt; it runs &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this fails, and writes &lt;code&gt;Wrong type argument: listp, &quot;make -k &quot;&lt;/code&gt; to the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have determined that whatever value I set for &lt;code&gt;compile-command&lt;/code&gt; will appear in the message.  For example, I can make emacs fail to exit with the message &lt;code&gt;Wrong type argument: listp, &quot;foobar &quot;&lt;/code&gt; or &lt;code&gt;Wrong type argument: listp, &quot;&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't figure out what it causing a compile to run on exit or how to shut it off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a hook that lives somewhere?  Does anyone have any ideas for tracking this down?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I can only quit by backgrounding the process and doing &lt;code&gt;kill %1&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="8913" LastEditorUserId="8913" LastEditDate="2016-07-02T05:15:42.580" LastActivityDate="2016-07-02T05:15:42.580" Title="failed compile command runs on exit, prevents exit – how to track down?" Tags="|hooks|compilation|quitting|exit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19568" PostTypeId="1" CreationDate="2016-01-15T21:08:57.107" Score="4" ViewCount="468" Body="&lt;p&gt;Sometimes I put links in the header title of an org document. Org mode automatically re-colors and underlines the links. I would like my links that appear in section titles to appear unaltered. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I'd like the first header of the following document to look like the header section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xdFD0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xdFD0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2016-01-18T04:32:12.947" LastActivityDate="2017-07-11T18:19:13.777" Title="Can I hack org-mode to not visually modify links in headers?" Tags="|org-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19570" PostTypeId="1" CreationDate="2016-01-15T22:54:35.790" Score="4" ViewCount="1512" Body="&lt;p&gt;I am using &lt;code&gt;org-ref&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt;. I want to cite a book like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    \citep[p. 1445]{Fong:2006}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I am only getting &lt;code&gt;citep:Fong:2006&lt;/code&gt;. How can I include page number?&lt;/p&gt;&#xA;" OwnerUserId="6988" LastActivityDate="2017-06-03T16:51:24.973" Title="How to cite author-date including page number in org-mode?" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19571" PostTypeId="2" ParentId="19567" CreationDate="2016-01-15T23:06:47.817" Score="1" Body="&lt;p&gt;With the suggestions of @elethan and @Tobias I was able to generate this stack-trace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp &quot;make -k &quot;)&#xA;  savehist-save(t)&#xA;  savehist-autosave()&#xA;  kill-emacs()&#xA;  save-buffers-kill-emacs(nil)   &#xA;  save-buffers-kill-terminal(nil)&#xA;  call-interactively(save-buffers-kill-terminal nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And track it down to savehist, which I disabled for now.&lt;/p&gt;&#xA;" OwnerUserId="8913" LastActivityDate="2016-01-15T23:06:47.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19572" PostTypeId="2" ParentId="19553" CreationDate="2016-01-15T23:10:47.077" Score="12" Body="&lt;p&gt;Modify &lt;code&gt;org-latex-default-figure-position&lt;/code&gt; to change the default, or use the following on the specific elements,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+attr_latex: :placement [!tbh]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2016-01-16T11:57:16.533" LastActivityDate="2016-01-16T11:57:16.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19573" PostTypeId="2" ParentId="19566" CreationDate="2016-01-15T23:32:08.430" Score="1" Body="&lt;p&gt;The error tells you the problem, I think:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Cannot find Cygwin. Please customize option `cygwin-root-directory'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You need to set that variable.  Use &lt;strong&gt;&lt;code&gt;M-x customize-option RET cygwin-root-directory RET&lt;/code&gt;&lt;/strong&gt; to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(That said, the code should have handled a non-string argument to &lt;code&gt;setcyg-dir-p&lt;/code&gt;. Download the latest &lt;a href=&quot;http://www.emacswiki.org/emacs/download/setup-cygwin.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;setup-cygwin.el&lt;/code&gt;&lt;/a&gt; to get that fix.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-15T23:32:08.430" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19574" PostTypeId="1" AcceptedAnswerId="19587" CreationDate="2016-01-16T01:30:49.187" Score="1" ViewCount="90" Body="&lt;p&gt;When using predictive-mode, the following error often pops up:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error running timer `completion-ui-auto-show': (error &quot;Keyword argument :face not one of (:point :around :width :height :min-height :max-width :truncate :margin :margin-left :margin-right :scroll-bar :parent :parent-offset :nowait :nostrip :prompt)&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I removed all other extensions, removed custom Emacs settings and only left predictive mode turned on, this problem still persists. What can I do about it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; It turned out that predictive mode also includes a &quot;popup.el&quot; itself, while I also installed the auto-complete popup.el, which conflict with each other. Is there any way to resolve the conflict?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-01-17T00:49:26.193" LastActivityDate="2016-01-17T02:52:29.913" Title="Predictive always prompt error" Tags="|predictive-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19575" PostTypeId="1" AcceptedAnswerId="19599" CreationDate="2016-01-16T01:43:49.193" Score="3" ViewCount="267" Body="&lt;p&gt;When type &lt;code&gt;&quot;&lt;/code&gt; in AucTeX, either &lt;code&gt;``&lt;/code&gt; or &lt;code&gt;''&lt;/code&gt; is typed. How do I do similar action with single quotes? Typing &lt;code&gt;'&lt;/code&gt; won't give me &lt;code&gt;`&lt;/code&gt; or &lt;code&gt;'&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; I'm not asking about the double quotes---I agree with what double quotes did and I just want to show that single quotes do not behave the same as double quotes, but I want single quotes to behave the same as double quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My babel is English.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-01-16T20:29:24.507" LastActivityDate="2016-01-17T14:23:23.257" Title="Type single quotes in AucTeX" Tags="|auctex|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19576" PostTypeId="1" AcceptedAnswerId="19617" CreationDate="2016-01-16T10:40:12.323" Score="8" ViewCount="2562" Body="&lt;p&gt;All of a sudden Emacs returns an error at the startup, when I run &lt;code&gt;$ emacs --debug-init&lt;/code&gt; from the terminal (linux) I get this debug error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp &amp;lt;!DOCTYPE)&#xA;  package--read-archive-file(&quot;archives/gnu/archive-contents&quot;)&#xA;  package-read-archive-contents(&quot;gnu&quot;)&#xA;  package-read-all-archive-contents()&#xA;  package-initialize()&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/ffs/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 136&#xA;  load-with-code-conversion(&quot;/home/ffs/.emacs.d/init.el&quot; &quot;/home/ffs/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/ffs/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\266 \306=\203\307\310Q\202? \311=\204\307\312Q\202?\313\307\314\315#\203*\316\202?\313\307\314\317#\203&amp;gt;\320\321\322!D\nB\323\202?\316\324\325\324\211#\210\324=\203e\326\327\330\307\331Q!\&quot;\325\324\211#\210\324=\203d\210\203\247\332!\333\232\203\247\334!\211\335P\336!\203\201\211\202\214\336!\203\213\202\214\314\262\203\245\337\&quot;\203\243\340\341#\210\342\343!\210\266\f?\205\264\314\325\344\324\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; initialization format-message &quot;`_emacs' init file is deprecated, please use `.emacs'&quot; &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I suspect is the first lines of my &lt;code&gt;init.el&lt;/code&gt; which has the following start:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(package-initialize)&#xA;(require some_pakagename)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I evaluate the line of &lt;code&gt;(package-initialize)&lt;/code&gt; &lt;kbd&gt;C-x C-e&lt;/kbd&gt; from inside the &lt;code&gt;init.el&lt;/code&gt; file I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;package-read-archive-contents: Wrong type argument: listp, &amp;lt;!DOCTYPE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the same error when I try doing &lt;code&gt;M-x list-packages&lt;/code&gt; from the mini-buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, please could you help me spot the source of error?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2016-01-16T13:36:11.560" LastActivityDate="2018-02-28T15:59:13.530" Title="How to fix this startup package initialization problem?" Tags="|init-file|package|debugging|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19577" PostTypeId="1" CreationDate="2016-01-16T12:41:55.650" Score="2" ViewCount="1039" Body="&lt;p&gt;I'm trying to set up racer mode for Rust language autocomletion, but when press 'tab' key got messages like this:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Company: An error occurred in auto-begin&lt;br&gt;&#xA;Company: backend company-capf error &amp;quot;/cygdrive/d/Soft/Cygwin64/home/racer/target/release/racer exited with status 1&amp;quot; with args (candidates B)&lt;br&gt;&#xA;Company: An error occurred in auto-begin&lt;br&gt;&#xA;Company: backend company-capf error &amp;quot;/cygdrive/d/Soft/Cygwin64/home/racer/target/release/racer exited with status 1&amp;quot; with args (candidates B)&lt;br&gt;&#xA;Company: An error occurred in auto-begin&lt;br&gt;&#xA;Company: backend company-capf error &amp;quot;/cygdrive/d/Soft/Cygwin64/home/racer/target/release/racer exited with status 1&amp;quot; with args (candidates B)&lt;br&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Here is my .emacs:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;         '(&amp;quot;melpa&amp;quot; . &amp;quot;https://melpa.org/packages/&amp;quot;) t)&#xA;(package-initialize)&#xA;&#xA;&#xA;(setq company-tooltip-align-annotations t)&#xA;&#xA;(setq racer-cmd &amp;quot;/cygdrive/d/Soft/Cygwin64/home/racer/target/release/racer&amp;quot;)&#xA;(setq racer-rust-src-path &amp;quot;/home/rust/src/&amp;quot;)&#xA;&#xA;(add-hook 'rust-mode-hook #'racer-mode)&#xA;(add-hook 'racer-mode-hook #'eldoc-mode)&#xA;&#xA;(add-hook 'racer-mode-hook #'company-mode)&#xA;&#xA;(global-set-key (kbd &amp;quot;TAB&amp;quot;) #'company-indent-or-complete-common) ;&#xA;&#xA;(defun rust-save-compile-and-run ()&#xA;  (interactive)&#xA;  (save-buffer)&#xA;&#xA;  (if (locate-dominating-file (buffer-file-name) &amp;quot;Cargo.toml&amp;quot;)&#xA;&#xA;      (compile &amp;quot;cargo run&amp;quot;)&#xA;&#xA;    (compile&#xA;     (format &amp;quot;rustc %s &amp;amp; %s&amp;quot;&#xA;         (buffer-file-name)&#xA;         (file-name-sans-extension (buffer-file-name))))))&#xA;&#xA;(add-hook 'rust-mode-hook&#xA;      (lambda ()&#xA;        (define-key rust-mode-map (kbd &amp;quot;&amp;lt;f5&amp;gt;&amp;quot;) 'rust-save-compile-and-run)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;&lt;h2&gt;UPDATE:&lt;/h2&gt;&#xA;&lt;p&gt;So, when i try to call racer from emacs shell, i got following message:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;racer can't find the directory pointed to by the RUST_SRC_PATH variable &amp;quot;/cygdrive/c/src/rust/tasks/src/C:\Program Files\Rust stable 1.5\rustc-1.5.0\src&amp;quot;. Try using an absolute fully qualified path and make sure it points to the src directory of a rust checkout - e.g. &amp;quot;/home/foouser/src/rust/src&amp;quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But i don't know how to fix this. By the way, i'm working in Cygwin.&lt;/p&gt;&#xA;&lt;p&gt;Now, i got following error:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;eldoc error: (error /cygdrive/d/Soft/Cygwin64/home/racer/target/release/racer exited with status 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10793" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-25T01:11:14.623" Title="Rust Racer autocomplete problem in Cygwin" Tags="|company-mode|rust|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19578" PostTypeId="1" AcceptedAnswerId="19582" CreationDate="2016-01-16T13:51:38.700" Score="9" ViewCount="3997" Body="&lt;p&gt;Is there a way to lookup which hooks will run when a given command is called? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for major modes it is pretty easy to guess that activating &lt;code&gt;python-mode&lt;/code&gt; will run &lt;code&gt;python-mode-hook&lt;/code&gt;. But sometimes it is not obvious (to me at least) which hooks are run. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if there is a way to get a list of hooks that will run upon execution of a given command similar to how &lt;code&gt;M-x describe-variable python-mode-hook&lt;/code&gt; will show me a list of functions called when that hook runs. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-16T16:33:07.760" Title="List hooks that will run after command" Tags="|hooks|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19579" PostTypeId="1" AcceptedAnswerId="19601" CreationDate="2016-01-16T13:52:17.903" Score="1" ViewCount="284" Body="&lt;p&gt;I want to emulate (and even replace) some electric modes (eg. &lt;code&gt;cperl-electric&lt;/code&gt;, &lt;code&gt;ruby-electric&lt;/code&gt;) with my own custom templates using &lt;code&gt;yasnippet&lt;/code&gt;, but it doesn't seem to be possible - can someone enlighten me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in addition to normal templates triggered by &lt;kbd&gt;TAB&lt;/kbd&gt;, I'd like to have some snippets triggered simply by a space, eg. typing &quot;for&lt;kbd&gt;SPACE&lt;/kbd&gt;&quot; should fire a snippet instead of having to type &quot;for&lt;kbd&gt;TAB&lt;/kbd&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I also realise that for some &quot;electric&quot; features I want some patterns to fire without any sort of trigger key - eg. like cperl-mode turns { into a paired {} with the insertion point in the middle, I'd like to do the same for single and double quotes. (Of course in this case what I really want is &lt;code&gt;paren-mode&lt;/code&gt; to work with syntax less regular than lisp, but I fought that battle some years ago with only limited success!)&lt;/p&gt;&#xA;" OwnerUserId="215" LastEditorUserId="215" LastEditDate="2016-01-17T11:50:58.517" LastActivityDate="2017-04-19T16:08:37.430" Title="Is an &quot;Electric&quot; YASnippet possible?" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19580" PostTypeId="1" AcceptedAnswerId="19585" CreationDate="2016-01-16T15:44:52.297" Score="4" ViewCount="295" Body="&lt;p&gt;I'm using GUI emacs 24.4.9.0, so I can click to move the cursor, and double-click to select a word under the mouse pointer as a region. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure emacs so that right-click selects a character under the mouse pointer? I know that I can assign a function by writing &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;mouse-3&amp;gt;&quot;) 'foobar) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the init file, but when I wrote a function for this purpose a while ago, it didn't put the cursor under the place I right-clicked, it just started marking a character forward from where the mouse pointer is currently at. What kind of function I can use for placing the cursor right under the mouse pointer?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-14T00:50:40.700" LastActivityDate="2016-03-14T00:50:40.700" Title="Right-click to select one character under the mouse pointer?" Tags="|key-bindings|mouse|region|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19581" PostTypeId="1" CreationDate="2016-01-16T15:49:17.517" Score="1" ViewCount="1101" Body="&lt;p&gt;This is migrated from the LaTeX stack exchange. I am using Emacs on the Mavericks OSX Terminal. I can open the TeX file fine, but I can compile a pdf via &lt;code&gt;C-c C-c&lt;/code&gt;. Is there some way that I can open the pdf in an external window via the command line? I tried running &lt;code&gt;C-c C-c&lt;/code&gt; and then &lt;code&gt;C-c C-c&lt;/code&gt; again, but it said that was undefined. I have also looked here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://tex.stackexchange.com/questions/11613/launching-an-external-pdf-viewer-from-emacs-auctex-on-a-mac-osx-fails&quot;&gt;https://tex.stackexchange.com/questions/11613/launching-an-external-pdf-viewer-from-emacs-auctex-on-a-mac-osx-fails&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that didn't work either. I would really like to be able to run LaTeX in Emacs from the command line, but I do a lot of live TeXing and I need to continuously check the pdf. Can someone help me fix this problem?&lt;/p&gt;&#xA;" OwnerUserId="10796" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-06-14T23:52:26.317" Title="Opening an External PDF in the Terminal" Tags="|latex|terminal-emacs|pdf|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19582" PostTypeId="2" ParentId="19578" CreationDate="2016-01-16T16:33:07.760" Score="7" Body="&lt;p&gt;I'm pretty sure it's impossible to know &lt;em&gt;a priori&lt;/em&gt; what hooks a command will run; as others have mentioned, this smells a lot like the halting problem.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it's certainly possible to actually execute a command and make Emacs tell you when it runs a hook.  There is, as far as I know, no out-of-the-box command to do this, so I whipped one up.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/call-logging-hooks (command &amp;amp;optional verbose)&#xA;  &quot;Call COMMAND, reporting every hook run in the process.&#xA;Interactively, prompt for a command to execute.&#xA;&#xA;Return a list of the hooks run, in the order they were run.&#xA;Interactively, or with optional argument VERBOSE, also print a&#xA;message listing the hooks.&quot;&#xA;  (interactive &quot;CCommand to log hooks: \np&quot;)&#xA;  (let* ((log     nil)&#xA;         (logger (lambda (&amp;amp;rest hooks) &#xA;                   (setq log (append log hooks nil)))))&#xA;    (my/with-advice&#xA;        ((#'run-hooks :before logger))&#xA;      (call-interactively command))&#xA;    (when verbose&#xA;      (message&#xA;       (if log &quot;Hooks run during execution of %s:&quot;&#xA;         &quot;No hooks run during execution of %s.&quot;)&#xA;       command)&#xA;      (dolist (hook log)&#xA;        (message &quot;&amp;gt; %s&quot; hook)))&#xA;    log))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To look at what hooks are run, we're using this macro for installing temporary advice.  You could also do this with something like the &lt;code&gt;noflet&lt;/code&gt; package, if you prefer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro my/with-advice (adlist &amp;amp;rest body)&#xA;  &quot;Execute BODY with temporary advice in ADLIST.&#xA;&#xA;Each element of ADLIST should be a list of the form&#xA;  (SYMBOL WHERE FUNCTION [PROPS])&#xA;suitable for passing to `advice-add'.  The BODY is wrapped in an&#xA;`unwind-protect' form, so the advice will be removed even in the&#xA;event of an error or nonlocal exit.&quot;&#xA;  (declare (debug ((&amp;amp;rest (&amp;amp;rest form)) body))&#xA;           (indent 1))&#xA;  `(progn&#xA;     ,@(mapcar (lambda (adform)&#xA;                 (cons 'advice-add adform))&#xA;               adlist)&#xA;     (unwind-protect (progn ,@body)&#xA;       ,@(mapcar (lambda (adform)&#xA;                   `(advice-remove ,(car adform) ,(nth 2 adform)))&#xA;                 adlist))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;run-hooks&lt;/code&gt; is a primitive, so in theory this is a little risky.  In practice, I've found that advising most primitives with functions that don't try to change their underlying behavior (e.g., logging) doesn't seem to cause any problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few caveats:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This will only detect normal hooks, not abnormal hooks run with &lt;code&gt;run-hook-with-args&lt;/code&gt;, &lt;code&gt;run-hook-with-args-until-success&lt;/code&gt;, and so forth.  You could of course modify it to see these too.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A command might run a hook only in certain conditions.  Naturally, you will only see these hooks if the conditions are met during this execution of the command.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There's no way to know &lt;em&gt;why&lt;/em&gt; a particular hook was executed.  Maybe it's an intrinsic part of the command you're executing, or maybe it's being run by something that is itself in a different hook, or being run off a timer, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-16T16:33:07.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19583" PostTypeId="1" CreationDate="2016-01-16T18:39:16.083" Score="0" ViewCount="302" Body="&lt;p&gt;I learn org mode following the documentation, I try to plot an array with gnuplot but get the error &lt;code&gt;Wrong type argument: listp, hline&lt;/code&gt;. Where does it come from ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the array :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PLOT: title:&quot;Test&quot; ind:2 deps:(3) type:2d with:histograms set:&quot;yrange [0:]&quot;&#xA;|---+-------+--------+-------------|&#xA;|   | index | number | number / 10 |&#xA;| / |     &amp;lt; |      &amp;lt; |             |&#xA;|---+-------+--------+-------------|&#xA;|   |     1 |    100 |          10 |&#xA;|   |     2 |    200 |          20 |&#xA;|   |     3 |    300 |          30 |&#xA;|   |     4 |    400 |          40 |&#xA;|   |     5 |    500 |          50 |&#xA;|---+-------+--------+-------------|&#xA;|   | total |   1500 |         150 |&#xA;|---+-------+--------+-------------|&#xA;#+TBLFM: $4=$3/10 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the same error if I remove the last column (since it plots only 2d).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit :&lt;/em&gt;&#xA;I know have corrected the table according to the suggestion :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PLOT: title:&quot;Test&quot; ind:1 deps:(3) type:2d with:histograms set:&quot;yrange [0:]&quot;&#xA;| 1 | 100 |&#xA;| 2 | 200 |&#xA;| 3 | 300 |&#xA;| 4 | 400 |&#xA;| 5 | 500 |&#xA;#+TBLFM: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And get the error &lt;code&gt;Key sequence C-c SPC l starts with non prefix key C-c SPC&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="9790" LastEditDate="2016-01-16T20:43:18.467" LastActivityDate="2016-01-16T20:43:18.467" Title="Org plot table : wrong type argument listp hline" Tags="|org-table|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19584" PostTypeId="2" ParentId="19581" CreationDate="2016-01-16T18:46:06.463" Score="1" Body="&lt;p&gt;On a Mac the &quot;open&quot; command can be used to display most types of files, and it'll certainly work for a PDF.  So, one way to do it would be to press M-! which runs Emacs' shell-command, which prompts you for the command to run.  Enter &quot;open foo.pdf&quot; (or whatever your PDF is called) and it'll get loaded by Preview.  If you use this a lot you could bind it to a key (maybe C-c C-v, which in latex-mode is bound to tex-view which is used for previewing a dvi file), but given that Preview will automatically reload and redisplay the file when it changes it's probably not even worth the effort.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2016-01-16T18:46:06.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19585" PostTypeId="2" ParentId="19580" CreationDate="2016-01-16T18:46:47.823" Score="4" Body="&lt;p&gt;You can do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun select-char-at-click (event)&#xA;  &quot;Select char at EVENT position.&#xA;EVENT should be a mouse-click event.&quot;&#xA;  (interactive &quot;e&quot;)&#xA;  (run-hooks 'mouse-leave-buffer-hook) ; Give Isearch etc. a chance to turn off.&#xA;  (let ((pos  (cadr (event-start event))))&#xA;    (unless (&amp;gt;= pos (point-max))&#xA;      (push-mark pos)&#xA;      (goto-char (1+ (mark)))))&#xA;  (setq mark-active      t&#xA;    deactivate-mark  nil))&#xA;&#xA;(global-set-key [mouse-3] 'select-char-at-click)&#xA;(global-set-key [down-mouse-3] 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But you &lt;em&gt;really&lt;/em&gt; do &lt;strong&gt;not&lt;/strong&gt; want to do that.  Mouse-3 (right button) is used in Emacs to extend the region from the point you set using mouse-1.  It is also used in several contexts to pop up a right-click contextual menu.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-16T18:46:47.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19586" PostTypeId="1" CreationDate="2016-01-16T21:15:20.807" Score="2" ViewCount="133" Body="&lt;p&gt;I want to add the emacs &lt;code&gt;#...#&lt;/code&gt; files to the boring file list. I don't know how the helm regexp engine works since dots are not escaped, I have tried to manually escape them with a backslash but it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard regexp for my need would be &lt;code&gt;#.+#&lt;/code&gt; with the sequence &lt;code&gt;.+&lt;/code&gt; interpreted as &quot;any character at least one time&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone would like to briefly explain how the helm regexp engine works I'll be really happy!&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="2701" LastEditDate="2016-01-17T09:16:16.187" LastActivityDate="2016-01-17T09:16:16.187" Title="Add emacs #...# to helm boring files" Tags="|helm|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19587" PostTypeId="2" ParentId="19574" CreationDate="2016-01-17T02:52:29.913" Score="1" Body="&lt;p&gt;This is caused by predictive which uses its shipped popup.el which conflicts with the popup.el in ac-mode if you have installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following bash script would patch predictive and resolve the conflict.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for f in *.el; do sed -i -r 's/([ \t('&quot;'&quot;']+)popup/\1mypredictive-popup/g' $f; done&#xA;sed -i 's/make-popup/make-mypredictive-popup/g' popup.el&#xA;mv popup.el mypredictive-popup.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-01-17T02:52:29.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19589" PostTypeId="1" CreationDate="2016-01-17T04:42:21.393" Score="3" ViewCount="51" Body="&lt;p&gt;When I have test-assigned some function on mouse-3, and I want to revert the default feature assigned to it to compare which function is more useful to assign to the mouse-3, I have to comment out the particular assigning statement from the init file, &lt;strong&gt;and then restart emacs&lt;/strong&gt;. I could do (global-unset-key  (kbd &quot;&quot;)), but that would just unable the mouse-3 instead of get back the default feature assigned to it. It's cumbersome to restart emacs every time I'm in this kind of situation (I've been in this kind of situation many times.); is there a way to do this without restarting? &lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-14T00:50:01.587" LastActivityDate="2016-03-14T00:50:01.587" Title="Reverting the keybindings that I don't specify in the init files without restarting emacs?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19590" PostTypeId="2" ParentId="19589" CreationDate="2016-01-17T05:04:15.740" Score="2" Body="&lt;p&gt;Load library &lt;code&gt;mouse.el&lt;/code&gt; (again). It binds the default mouse keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or just visit it (&lt;code&gt;M-x find-library RET mouse.el RET&lt;/code&gt;) and evaluate the relevant key-binding code.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-17T05:04:15.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19592" PostTypeId="2" ParentId="16948" CreationDate="2016-01-17T06:47:25.070" Score="3" Body="&lt;p&gt;You should add a &quot;/&quot; before your items, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-/.meta&#xA;-/.projectile&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the source code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-paths-to-ignore ()&#xA;  &quot;Return a list of ignored project paths.&quot;&#xA;  (-non-nil (--map (and (string-prefix-p &quot;/&quot; it)&#xA;                        ;; remove the leading /&#xA;                        (substring it 1))&#xA;                   (cdr (projectile-parse-dirconfig-file)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We must put a &quot;/&quot; before the items to make them to be valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it uses string-prefix-p to check the file. If you want to ignore the files recursively, you can replace string-prefix-p with string-match-p.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-remove-ignored (files)&#xA;  &quot;Remove ignored files and folders from FILES.&#xA;&#xA;Operates on filenames relative to the project root.&quot;&#xA;  (let ((ignored (append (projectile-ignored-files-rel)&#xA;                         (projectile-ignored-directories-rel))))&#xA;    (-remove (lambda (file)&#xA;               (or (--any-p (string-prefix-p it file) ignored)&#xA;                   (--any-p (string-suffix-p it file) projectile-globally-ignored-file-suffixes)))&#xA;             files)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10801" LastActivityDate="2016-01-17T06:47:25.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19593" PostTypeId="1" CreationDate="2016-01-17T07:14:28.617" Score="2" ViewCount="258" Body="&lt;p&gt;How can I change the default double-mouse-1 word selection behavior so that I can move the point around right afterwards to extend/shrink the region? By default, if I forward/backward-char after selecting the word by double-mouse-1, it moves the point, but the mark disappears, so nothing is selected. &lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-01-17T17:53:04.863" LastActivityDate="2016-05-16T20:35:36.140" Title="Expand/shrink region after double-clicking mouse-1" Tags="|mouse|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19594" PostTypeId="1" CreationDate="2016-01-16T15:24:17.947" Score="1" ViewCount="131" Body="&lt;p&gt;I am using Emacs on the Mavericks OSX Terminal. I can open the TeX file fine, but I can compile a pdf via &lt;code&gt;C-c C-c&lt;/code&gt;. Is there some way that I can open the pdf in an external window via the command line? I tried running &lt;code&gt;C-c C-c&lt;/code&gt; and then &lt;code&gt;C-c C-c&lt;/code&gt; again, but it said that was undefined. I have also looked here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://tex.stackexchange.com/questions/11613/launching-an-external-pdf-viewer-from-emacs-auctex-on-a-mac-osx-fails&quot;&gt;https://tex.stackexchange.com/questions/11613/launching-an-external-pdf-viewer-from-emacs-auctex-on-a-mac-osx-fails&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that didn't work either. I would really like to be able to run LaTeX in Emacs from the command line, but I do a lot of live TeXing and I need to continuously check the pdf. Can someone help me fix this problem?&lt;/p&gt;&#xA;" OwnerUserId="10796" OwnerDisplayName="Joshuah Heath" LastEditorUserId="14920" LastEditDate="2018-05-12T22:58:43.340" LastActivityDate="2018-05-12T22:58:43.340" Title="Opening an External PDF in Emacs from Terminal" Tags="|latex|osx|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19596" PostTypeId="1" CreationDate="2016-01-17T11:15:55.590" Score="2" ViewCount="745" Body="&lt;p&gt;How can I see the code of a built-in function? &#xA;I'd like to look at the code of functions such as upcase-region. I looked at the completion list that I pulled up by &quot;find-library TAB&quot;, but the list is huge and couldn't figure out if what I'm looking for is included in it or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also looked at the help of upcase-region, and it says &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;upcase-region is an interactive built-in function in `C source code'. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I click the link `C source code', it just brings up a file selecting window with the .emacs.d folder opened, but there doesn't seem to be any file with the .c extension?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-14T00:49:15.677" LastActivityDate="2016-03-14T00:49:15.677" Title="How to see the code of a built-in function" Tags="|help|" AnswerCount="1" CommentCount="2" ClosedDate="2016-01-18T21:11:27.663" ContentLicense="CC BY-SA 3.0" />
  <row Id="19597" PostTypeId="2" ParentId="19596" CreationDate="2016-01-17T11:29:37.507" Score="4" Body="&lt;p&gt;It does that because you don't happen to already have a copy of the emacs source code handy; it's giving you the opportunity to go open the file yourself instead. The source is hosted on Savannah (at &lt;a href=&quot;http://savannah.gnu.org/projects/emacs/&quot; rel=&quot;nofollow&quot;&gt;http://savannah.gnu.org/projects/emacs/&lt;/a&gt;); you can view it there or do a git clone to get a local copy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, &lt;code&gt;upcase-region&lt;/code&gt; is defined in &lt;code&gt;casefiddle.c&lt;/code&gt;: &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/casefiddle.c#n297&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/casefiddle.c#n297&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: lawlist found it; you can customize the &lt;code&gt;find-function-C-source-directory&lt;/code&gt; variable (using &lt;code&gt;M-x customize-variable&lt;/code&gt;) to set the path where it can find the source.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2016-01-18T01:05:07.903" LastActivityDate="2016-01-18T01:05:07.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19598" PostTypeId="1" AcceptedAnswerId="19609" CreationDate="2016-01-17T14:14:38.363" Score="49" ViewCount="19439" Body="&lt;ol&gt;&#xA;&lt;li&gt;Is there a way to link to specific topic (*) in a different&#xA;org-file? &lt;/li&gt;&#xA;&lt;li&gt;How can I quickly find and copy the relative path from the&#xA;current org-file to the file that I want to link to?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Probably both straight forward but I couldn't figure it out.&#xA;Thanks your help.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2023-05-01T01:22:58.800" Title="org-mode link to heading in other org-file" Tags="|org-mode|emacs24.4|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19599" PostTypeId="2" ParentId="19575" CreationDate="2016-01-17T14:23:23.257" Score="3" Body="&lt;p&gt;Adapted from &lt;code&gt;TeX-insert-quote&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mg-TeX-insert-single-quote (force)&#xA;  &quot;Insert the appropriate quotation marks for TeX.&#xA;Inserts ` or ' depending on the context.  With prefix argument&#xA;FORCE, always inserts ' characters.&quot;&#xA;  (interactive &quot;*P&quot;)&#xA;  (if (or force&#xA;      ;; Do not insert TeX quotes in verbatim, math or comment constructs.&#xA;      (and (fboundp 'font-latex-faces-present-p)&#xA;           (font-latex-faces-present-p '(font-latex-verbatim-face&#xA;                         font-latex-math-face&#xA;                         font-lock-comment-face))&#xA;           (font-latex-faces-present-p '(font-latex-verbatim-face&#xA;                         font-latex-math-face&#xA;                         font-lock-comment-face)&#xA;                       (1- (point))))&#xA;      (texmathp)&#xA;      (and (TeX-in-comment) (not (eq major-mode 'doctex-mode))))&#xA;      (self-insert-command (prefix-numeric-value force))&#xA;    (TeX-update-style)&#xA;    (let* ((open-quote &quot;`&quot;)&#xA;       (close-quote &quot;'&quot;))&#xA;      (insert (cond ((bobp)&#xA;             open-quote)&#xA;            ((= (preceding-char) (string-to-char TeX-esc))&#xA;             ?\')&#xA;            ((= (preceding-char) ?\&quot;)&#xA;             ?')&#xA;            ((save-excursion&#xA;               (forward-char (- (length open-quote)))&#xA;               (looking-at (regexp-quote open-quote)))&#xA;             (delete-char (- (length open-quote)))&#xA;             ?')&#xA;            ((save-excursion&#xA;               (forward-char (- (length close-quote)))&#xA;               (looking-at (regexp-quote close-quote)))&#xA;             (delete-char (- (length close-quote)))&#xA;             ?')&#xA;            ((save-excursion&#xA;               (forward-char -1)&#xA;               (looking-at &quot;[ \t\n]\\|\\s(&quot;))&#xA;             open-quote)&#xA;            (t&#xA;             close-quote))))))&#xA;&#xA;(eval-after-load &quot;tex&quot;&#xA;  '(define-key LaTeX-mode-map (kbd &quot;'&quot;) 'mg-TeX-insert-single-quote))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-01-17T14:23:23.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19600" PostTypeId="2" ParentId="15242" CreationDate="2016-01-17T14:23:37.740" Score="4" Body="&lt;p&gt;Overwriting closing pair is called &quot;autoskipping&quot;. By default it works only on &quot;active sexp&quot;, that is, when user only moves cursor forward after opening delimiter. If user moves cursor backwards the sexp becomes &quot;inactive&quot; and smartparens inserts another pair of delimiters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a variable called &lt;code&gt;sp-cancel-autoskip-on-backward-movement&lt;/code&gt;, that controls whether the sexp stays active if user moves cursor backwards.  Setting it to &lt;code&gt;nil&lt;/code&gt; will give you behavior you want. &lt;/p&gt;&#xA;" OwnerUserId="873" LastActivityDate="2016-01-17T14:23:37.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19601" PostTypeId="2" ParentId="19579" CreationDate="2016-01-17T14:25:53.117" Score="2" Body="&lt;p&gt;You can change yasnippet's trigger key to &lt;kbd&gt;SPC&lt;/kbd&gt;, but it's not per snippet.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;SPC&quot;) ; `yas-maybe-expand' new in 0.12&#xA;  (or (bound-and-true-p yas-maybe-expand) #'yas-expand))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://joaotavora.github.io/yasnippet/snippet-expansion.html#sec-1-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;trigger key&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;what I really want is paren-mode to work with syntax less regular than lisp, but I fought that battle some years ago with only limited success!)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can try to emulate this with keybinding snippets, see &lt;a href=&quot;http://joaotavora.github.io/yasnippet/snippet-development.html#sec-2-6&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;# binding:&lt;/code&gt; direct keybinding&lt;/a&gt; and &lt;a href=&quot;https://github.com/joaotavora/yasnippet/pull/533&quot; rel=&quot;nofollow noreferrer&quot;&gt;joaotavora/yasnippet#533&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. this would give you electric parens:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: (&#xA;# binding: (&#xA;# --&#xA;($0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's probably better to use something like &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt;&lt;/a&gt;, or &lt;code&gt;electric-pair-mode&lt;/code&gt; as joaotavora suggested:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you want to try out a parenthesis and quote matching alternative to&#xA;  &lt;code&gt;smartparens&lt;/code&gt;, I suggest, in this order:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;code&gt;electric-pair-mode&lt;/code&gt; built-in emacs 24.4&lt;/li&gt;&#xA;  &lt;li&gt;&lt;code&gt;autopair-mode&lt;/code&gt; available at &lt;a href=&quot;http://github.com/joaotavora/autopair&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://github.com/joaotavora/autopair&lt;/a&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2017-04-19T16:08:37.430" LastActivityDate="2017-04-19T16:08:37.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19602" PostTypeId="1" AcceptedAnswerId="19611" CreationDate="2016-01-17T14:27:57.817" Score="9" ViewCount="1623" Body="&lt;p&gt;I am able to set the date language with &lt;code&gt;(setq system-time-locale &quot;LOCALE&quot;)&lt;/code&gt; but it doesn't affect the calendar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the language of calendar?&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="253" LastEditDate="2016-01-17T19:03:28.007" LastActivityDate="2016-01-17T19:03:28.007" Title="Org calendar : change date language?" Tags="|org-mode|calendar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19603" PostTypeId="1" AcceptedAnswerId="19606" CreationDate="2016-01-17T15:18:21.923" Score="2" ViewCount="1695" Body="&lt;p&gt;Following the documentation, I set to DONE a repeated task with &lt;code&gt;C-- 1 C-c C-t&lt;/code&gt; but this actually closes the task definitevely.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO Things&#xA;   DEADLINE: &amp;lt;2016-01-17 Sun +1m&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After typing &lt;code&gt;C-- 1 C-c C-t&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** DONE Things&#xA;   DEADLINE: &amp;lt;2016-01-17 Sun +0m&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I noticed that the key sequence seems not to be captured like desired :&#xA;I type &lt;code&gt;C--&lt;/code&gt; and emacs prompt &lt;code&gt;C--&lt;/code&gt; at the bottom of the window, and after typing &lt;code&gt;1&lt;/code&gt; the keysequence change to &lt;code&gt;C- kp-1-&lt;/code&gt; so maybe that is the problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if it is, I don't know how to change this behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2016-01-17T16:00:53.310" Title="Org repeated task doesn't repeat when DONE" Tags="|org-mode|todo|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19604" PostTypeId="2" ParentId="19603" CreationDate="2016-01-17T15:34:44.980" Score="-1" Body="&lt;p&gt;according this note &lt;a href=&quot;http://orgmode.org/manual/Tracking-your-habits.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Tracking-your-habits.html&lt;/a&gt; ,org&#xA;repeat task use  scheduled date, usually with a .+ style repeat interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so your task should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO Things&#xA;    SCHEDULED: &amp;lt;2016-01-17 Sun .+1m&amp;gt;&#xA;    :PROPERTIES:&#xA;    :STYLE:    habit&#xA;    :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2004" LastActivityDate="2016-01-17T15:34:44.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19605" PostTypeId="2" ParentId="19598" CreationDate="2016-01-17T15:42:33.173" Score="14" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;you can reference this topic &lt;a href=&quot;http://orgmode.org/manual/External-links.html#External-links&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/External-links.html#External-links&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;file:projects.org::some words             text search in Org file&lt;/p&gt;&#xA;&lt;p&gt;file:projects.org::*task title            heading search in Org file&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;sorry, I don't know what you mean.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2004" LastEditorUserId="14825" LastEditDate="2021-07-18T15:24:52.677" LastActivityDate="2021-07-18T15:24:52.677" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="19606" PostTypeId="2" ParentId="19603" CreationDate="2016-01-17T16:00:53.310" Score="4" Body="&lt;p&gt;From the &lt;a href=&quot;http://orgmode.org/manual/Repeated-tasks.html&quot; rel=&quot;nofollow&quot;&gt;org manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When you mark a DEADLINE or a SCHEDULE with the TODO keyword DONE, it will no longer produce entries in the agenda. The problem with this is, however, that then also the next instance of the repeated entry will not be active. Org mode deals with this in the following way: When you try to mark such an entry DONE (using C-c C-t), it will shift the base date of the repeating timestamp by the repeater interval, and immediately set the entry state back to TODO&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, &lt;code&gt;DONE&lt;/code&gt; for a repeating task means that it should not repeat any more because it is &quot;DONE&quot;. If it is truly a repeating task, marking it as &lt;code&gt;DONE&lt;/code&gt; like normal with &lt;code&gt;C-c C-t&lt;/code&gt; will keep the state as &lt;code&gt;TODO&lt;/code&gt;, but shift the timestamp ahead to the next repetition, so that you know when to do it again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to mark the current instance of a repeating task as &lt;code&gt;DONE&lt;/code&gt;, do it as you would any other task. If you are done with it for good, i.e., you want to &quot;close the task definitively&quot;, then you can use &lt;code&gt;C-- 1 C-c C-t&lt;/code&gt;, or delete or archive the task.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-17T16:00:53.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19607" PostTypeId="1" CreationDate="2016-01-17T16:13:20.200" Score="11" ViewCount="2451" Body="&lt;p&gt;I want &lt;a href=&quot;https://github.com/yasuyk/helm-company&quot;&gt;helm-company&lt;/a&gt; as the default selection method for company. Helm-company is meant to be invoked manually after company completion started. But I would really like to invoke helm automatically on completion (after &lt;code&gt;.&lt;/code&gt; etc) instead of using the usual pop-up method company provides.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use &lt;code&gt;company-completion-started-hook&lt;/code&gt; but it did not work. I'm not very familiar with company, has anyone solved a similar problem or knows how to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="105" LastEditDate="2016-01-17T17:47:46.273" LastActivityDate="2016-01-17T17:47:46.273" Title="Use helm-company as default for company autocompletion?" Tags="|helm|completion|company-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19608" PostTypeId="2" ParentId="19593" CreationDate="2016-01-17T17:50:19.157" Score="1" Body="&lt;p&gt;You don't need to change anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just need to &lt;em&gt;click&lt;/em&gt; &lt;strong&gt;&lt;code&gt;mouse-3&lt;/code&gt;&lt;/strong&gt; &lt;em&gt;where you want to put the new region limit&lt;/em&gt; (whether enlarging or shrinking, either end, as many times as you like).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Double-click &lt;code&gt;mouse1&lt;/code&gt; to select a word or symbol etc. (Or triple-click to select a line, etc.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Click &lt;code&gt;mouse-3&lt;/code&gt; to extend or retract either end of the region.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Repeat #2 as often as you like, to adjust the region.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-17T17:50:19.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19609" PostTypeId="2" ParentId="19598" CreationDate="2016-01-17T18:06:08.610" Score="48" Body="&lt;p&gt;For #2, first you'll want to add a couple of keybindings to your init file (these are the suggested keys in the Org manual) -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c l&quot;) 'org-store-link)&#xA;(global-set-key (kbd &quot;C-c C-l&quot;) 'org-insert-link)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then you can hit &lt;code&gt;C-c l&lt;/code&gt; somewhere in or on the item you want to link to, then &lt;code&gt;C-c C-l&lt;/code&gt; where you want to place the link. It'll ask you to confirm the location and then enter a link name - you can just hit enter to accept the defaults. It will create a link like [[file:foo.org::*bar][link-name]], which displays as &lt;code&gt;link-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://orgmode.org/manual/Handling-links.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Handling-links.html&lt;/a&gt; for more details. &lt;/p&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2016-01-17T19:58:49.203" LastActivityDate="2016-01-17T19:58:49.203" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19610" PostTypeId="1" AcceptedAnswerId="19612" CreationDate="2016-01-17T18:23:53.460" Score="1" ViewCount="660" Body="&lt;p&gt;I added the following two lines to my init.el script. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(split-window-vertically)&#xA;(other-window 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I now would like to achieve is to start within the current window a &lt;code&gt;term-mode&lt;/code&gt; with a bin/bash. How can this be achieved within the init.el? In emacs I run &lt;code&gt;M-x term&lt;/code&gt; and then I'm asked if /bin/bash should be run, hit enter and a terminal is running. I'm struggling to achieve the same within the init.el. Thanks for the help &lt;/p&gt;&#xA;" OwnerUserId="10470" LastActivityDate="2016-01-17T19:21:04.520" Title="how to start term in a separate window at launch" Tags="|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19611" PostTypeId="2" ParentId="19602" CreationDate="2016-01-17T19:02:44.230" Score="3" Body="&lt;p&gt;The &lt;a href=&quot;http://www.emacswiki.org/emacs/CalendarLocalization&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki node on calendar localization&lt;/a&gt; explains how to do this.  For example, it shows that, for &lt;a href=&quot;http://www.emacswiki.org/emacs/CalendarLocalization#toc11&quot; rel=&quot;nofollow&quot;&gt;Italian&lt;/a&gt;, you would want to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq calendar-week-start-day 1&#xA;          calendar-day-name-array [&quot;Domenica&quot; &quot;Lunedì&quot; &quot;Martedì&quot; &quot;Mercoledì&quot; &#xA;                                   &quot;Giovedì&quot; &quot;Venerdì&quot; &quot;Sabato&quot;]&#xA;          calendar-month-name-array [&quot;Gennaio&quot; &quot;Febbraio&quot; &quot;Marzo&quot; &quot;Aprile&quot; &quot;Maggio&quot;&#xA;                                     &quot;Giugno&quot; &quot;Luglio&quot; &quot;Agosto&quot; &quot;Settembre&quot; &#xA;                                     &quot;Ottobre&quot; &quot;Novembre&quot; &quot;Dicembre&quot;])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-01-17T19:02:44.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19612" PostTypeId="2" ParentId="19610" CreationDate="2016-01-17T19:21:04.520" Score="1" Body="&lt;p&gt;Add &lt;code&gt;(term &quot;/bin/bash&quot;)&lt;/code&gt; right after what you already have, and that worked on my setup. So you have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(split-window-vertically)&#xA;(other-window 1)&#xA;(term &quot;/bin/bash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your Emacs should start with (probably) the &lt;code&gt;*scratch*&lt;/code&gt; buffer on top, and a &lt;code&gt;term-mode&lt;/code&gt; window in a bash shell on the bottom, and your cursor at the command prompt. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-17T19:21:04.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19613" PostTypeId="1" CreationDate="2016-01-17T20:58:09.857" Score="1" ViewCount="35" Body="&lt;p&gt;I use autofill in org mode to return automatically after 80 characters, the thing is that when exporting to html newlines aren't automatically added.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would like to know if it is possible to tell autofill (or someone else) to insert a double backslash &lt;code&gt;\\&lt;/code&gt; after 80 characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you &lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2016-01-17T20:58:09.857" Title="Autofill insert a special string before returning" Tags="|auto-fill-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19614" PostTypeId="1" CreationDate="2016-01-17T22:10:00.313" Score="4" ViewCount="1788" Body="&lt;p&gt;I would like to use org to type my math lessons, documentation says it has an embedded system completion which can be activated by :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook 'turn-on-org-cdlatex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This command is not present on my system (emacs 24).&#xA;There is still an &lt;code&gt;org-cdlatex-mod&lt;/code&gt; but when I trigger it with &lt;code&gt;M-x&lt;/code&gt; it says &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Cannot open load file: no such file or directory, cdlatex&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After what if I retrigger the mod it says that the mode is now disabled. However it doesn't do anything after I type &lt;code&gt;C-c {&lt;/code&gt; to insert an environnment template...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a package, but the documentation says that I shouldn't use it since it's embedded in emacs.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="2823" LastEditDate="2016-01-20T15:20:52.750" LastActivityDate="2017-09-19T20:10:40.363" Title="Org cdlatex doesn't work" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19615" PostTypeId="1" CreationDate="2016-01-17T22:49:24.387" Score="2" ViewCount="262" Body="&lt;p&gt;following the tutorial &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-R/org-R.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/org-R/org-R.html&lt;/a&gt;, I get stuck because I can't find the function &lt;code&gt;org-R-apply&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have R installed on my computer and the package ess has been installed with usepackage (&lt;code&gt;(use-package ess :ensure t)&lt;/code&gt;) which automatically does the &lt;code&gt;require&lt;/code&gt;, and added the entry &lt;code&gt;(R . t)&lt;/code&gt; to babel suppported languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have tried to require &lt;code&gt;ess-site&lt;/code&gt; manually as it has a different name from the package, but the function is still not here.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="2823" LastEditDate="2016-01-20T15:21:01.503" LastActivityDate="2016-01-20T23:52:08.993" Title="Org babel R : can't find org-R-apply" Tags="|org-mode|org-babel|ess|r|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19616" PostTypeId="2" ParentId="18508" CreationDate="2016-01-17T22:50:22.863" Score="1" Body="&lt;p&gt;I finally managed to fix this. It appears to have been an SSH-key problem. I followed the instructions found &lt;a href=&quot;https://help.github.com/articles/generating-ssh-keys/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to generate a new SSH key  for use with GitHub, and the problem disappeared.&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2016-01-17T22:50:22.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19617" PostTypeId="2" ParentId="19576" CreationDate="2016-01-18T00:23:06.570" Score="9" Body="&lt;p&gt;The &quot;misbehaving&quot; file &lt;code&gt;~/.emacs.d/elpa/archives/gnu/archive-contents&lt;/code&gt; was most likely overwritten by HTML content of a page reporting a connection error. It should be safe to remove it. Emacs will fetch this file again upon calling &lt;code&gt;(package-initialize)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2018-02-28T15:59:13.530" LastActivityDate="2018-02-28T15:59:13.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19618" PostTypeId="2" ParentId="19526" CreationDate="2016-01-18T02:04:35.010" Score="2" Body="&lt;p&gt;The most similar way to do it in emacs would probably be to use &lt;code&gt;find-file-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun some-directory-setup ()&#xA;  (when (string-match &quot;/path/to/dir/.*&quot; (buffer-file-name))&#xA;    (..do stuff..)))&#xA;(add-hook 'find-file-hook 'some-directory-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for using &lt;code&gt;.dir-locals.el&lt;/code&gt;, you can use &lt;code&gt;eval&lt;/code&gt; if you want to do something other than change settings. For example, you could have &lt;code&gt;((nil . ((eval . (message &quot;Hello world.&quot;)))))&lt;/code&gt; in the &lt;code&gt;.dir-locals.el&lt;/code&gt; file to execute actual code.&lt;/p&gt;&#xA;" OwnerUserId="5278" LastActivityDate="2016-01-18T02:04:35.010" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19619" PostTypeId="1" AcceptedAnswerId="19622" CreationDate="2016-01-18T02:07:11.893" Score="4" ViewCount="319" Body="&lt;p&gt;Setting the &lt;strong&gt;mark&lt;/strong&gt; and moving &lt;strong&gt;point&lt;/strong&gt; activates the &lt;strong&gt;region&lt;/strong&gt;, which appears highlighted (assuming &lt;code&gt;transient-mark-mode&lt;/code&gt; is enabled). Once the mark is set it's location is sent to the &lt;strong&gt;mark ring&lt;/strong&gt;, thus changing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to activate the region &lt;em&gt;without&lt;/em&gt; altering the mark ring? I.e. making a &lt;strong&gt;&lt;em&gt;selection&lt;/em&gt;&lt;/strong&gt; as in other programs, such as your browser, to leave the region active and call other commands on it (kill, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to create a function to be implemented in new commands (something such as &lt;code&gt;my-set-mark&lt;/code&gt;), not to change the default Emacs behavior for existing commands/functions.&lt;/p&gt;&#xA;" OwnerUserId="920" LastEditorUserId="920" LastEditDate="2016-01-18T19:40:09.910" LastActivityDate="2016-01-18T19:40:09.910" Title="Activating the region without altering the mark ring" Tags="|region|mark|mark-ring|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19620" PostTypeId="1" CreationDate="2016-01-18T02:39:45.450" Score="1" ViewCount="23" Body="&lt;p&gt;I see from a few posts that there's no mechanism for ECB to magically auto-update it's directories buffer, but I would have thought that when using the &lt;code&gt;ecb-create-source&lt;/code&gt; and &lt;code&gt;ecb-delete-source&lt;/code&gt; functions via the context menu, that the directories tree would get updated (it takes care to save the file right away).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="215" LastActivityDate="2016-01-18T02:39:45.450" Title="Ways to get ECB Directories buffer to udpate?" Tags="|ecb|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19621" PostTypeId="2" ParentId="19619" CreationDate="2016-01-18T03:32:00.457" Score="-1" Body="&lt;p&gt;No. Mark and point form a region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can have temporary highlight just like other program. The region disappears upon actions. But still mark must exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The temporary highlight is controlled by two variables, &lt;code&gt;transient-mark-mode&lt;/code&gt; and &lt;code&gt;deactivate-mark&lt;/code&gt;. If &lt;code&gt;transient-mark-mode&lt;/code&gt; and &lt;code&gt;deactivate-mark&lt;/code&gt; are at the state &lt;code&gt;(only . t)&lt;/code&gt; and &lt;code&gt;nil&lt;/code&gt; respectively, the region between the point and mark is temporarily highlighted.&lt;/p&gt;&#xA;" OwnerUserId="10417" LastEditorUserId="10417" LastEditDate="2016-01-18T03:43:29.453" LastActivityDate="2016-01-18T03:43:29.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19622" PostTypeId="2" ParentId="19619" CreationDate="2016-01-18T03:37:24.867" Score="5" Body="&lt;p&gt;It's possible, and in fact it's dead simple, as long as you're okay with where mark already is.  There's no pre-existing command for it, but you could use this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/activate-region-only ()&#xA;  &quot;Activate the region without changing the mark ring.&quot;&#xA;  (interactive)&#xA;  (setq mark-active t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to set the mark without adding it to the mark ring, you start running into problems.  The naive implementation would be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/set-mark-no-push ()&#xA;  &quot;Set mark at point; activate region.  Do not change mark ring.&quot;&#xA;  (interactive)&#xA;  (set-mark (point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this probably won't behave as you expect.  It won't change the mark ring, but the &lt;em&gt;current&lt;/em&gt; mark isn't on the mark ring.  It only gets sent to the mark ring when a new mark gets set.  Most commands that interact with the mark ring (e.g., &lt;code&gt;C-u C-SPC&lt;/code&gt;) behave as if the current mark were on top of the mark ring, but this is sort of an illusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The upshot of all this is that &lt;code&gt;my/set-mark-no-push&lt;/code&gt;, above, will prevent the previous mark from getting put onto the mark ring, but the new mark will still get into the mark ring when some subsequent command sets the mark again.  If you want to set the mark without letting the &lt;em&gt;new&lt;/em&gt; value go to the mark ring, there doesn't seem to be a clean or easy way to do it, and you're probably better off learning to live with Emacs's eccentricity in this respect.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: Okay, this turned out to be easier than I thought.  Here's what I've got:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/dont-push-mark (&amp;amp;optional location nomsg activate)&#xA;  &quot;As `push-mark', but don't push old mark to mark ring.&quot;&#xA;  (setq location (or location (point)))&#xA;  (if (or activate (not transient-mark-mode))&#xA;      (set-mark location)&#xA;    (set-marker (mark-marker) location))&#xA;  (or nomsg executing-kbd-macro (&amp;gt; (minibuffer-depth) 0)&#xA;      (message &quot;Mark set&quot;))&#xA;  nil)&#xA;&#xA;(advice-add #'push-mark :override #'my/dont-push-mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Most of the code here dealing with NOMSG and ACTIVATE I lifted directly from &lt;code&gt;push-mark&lt;/code&gt;.  Three caveats:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This will only modify the behavior of functions that use &lt;code&gt;push-mark&lt;/code&gt;.  That should be most of them, but there may be functions that, for whatever reason, use some other method to add a mark to the mark ring.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Naturally, functions that are expecting to change the mark ring may behave unpredictably with this in effect.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Most importantly, this change will be global.  If you want to use the mark ring at all, you may want to write an interface that will add and remove the advice temporarily.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2016-01-18T19:38:53.793" LastActivityDate="2016-01-18T19:38:53.793" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="19623" PostTypeId="2" ParentId="19526" CreationDate="2016-01-18T03:40:39.193" Score="3" Body="&#xA;&#xA;&lt;p&gt;You need the &lt;code&gt;buffer-list-update-hook&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h v buffer-list-update-hook&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hook run when the buffer list changes.&lt;br&gt;&#xA;  Functions running this hook are, &lt;code&gt;get-buffer-create&lt;/code&gt;, &lt;code&gt;make-indirect-buffer&lt;/code&gt;, &lt;code&gt;rename-buffer&lt;/code&gt;, &lt;code&gt;kill-buffer&lt;/code&gt;, &lt;code&gt;bury-buffer-internal&lt;/code&gt; and &lt;code&gt;select-window&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can check out the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html&quot; rel=&quot;nofollow&quot;&gt;More Standard Hooks&lt;/a&gt;&#xA;section in the Emacs Lisp Reference Manual for info about this and other standard hooks too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, check out the below snippet which, after evaluating, will show you the current buffer name after switching buffers. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/test ()&#xA;  (message (buffer-name)))&#xA;(add-hook 'buffer-list-update-hook #'my/test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If you have the &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;projectile&lt;/code&gt;&lt;/a&gt; package installed, you can use the &lt;code&gt;projectile-project-root&lt;/code&gt; function, to get the current buffer project root directory.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-18T03:40:39.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19624" PostTypeId="2" ParentId="19568" CreationDate="2016-01-18T07:04:25.513" Score="1" Body="&lt;p&gt;You can tweak the &lt;code&gt;org-link&lt;/code&gt; face to remove the &lt;code&gt;underline&lt;/code&gt; and other properties using &lt;code&gt;custom-theme-set-faces&lt;/code&gt;. Here's one way to do it manually.     &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-theme-set-faces&#xA;  'whatEverIsYourCurrentTheme&#xA;  `(org-link ((,class (:underline nil :foreground ,type ))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;underline&lt;/code&gt; has been changed from &lt;code&gt;t&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. Depending on the theme you are using, you may have other tweaks to tune as well. Look in the theme's customization variables.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-01-18T07:04:25.513" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19625" PostTypeId="1" AcceptedAnswerId="19630" CreationDate="2016-01-18T09:16:40.910" Score="0" ViewCount="239" Body="&lt;p&gt;I've made the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun search-backward-lowercase-alphabet ()&#xA;  (interactive)&#xA;  (search-backward-regexp &quot;[a-z]&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run it at the end of a line like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abcDEF&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It just selects the last letter &lt;code&gt;F&lt;/code&gt;, when I actually want to select the &lt;code&gt;c&lt;/code&gt;. It doesn't distinguish between uppercase and lowercase at all. How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="15748" LastEditDate="2018-11-18T03:50:47.077" LastActivityDate="2018-11-18T03:50:47.077" Title="Regexp for distinguishing uppercase and lowercase not working" Tags="|regular-expressions|search|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="19627" PostTypeId="2" ParentId="19625" CreationDate="2016-01-18T10:08:14.917" Score="1" Body="&lt;p&gt;Check your setting of &lt;code&gt;case-fold-search&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Non-nil if searches and matches should ignore case.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This means you need &lt;code&gt;(setq case-fold-search nil)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-01-18T10:08:14.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19628" PostTypeId="1" AcceptedAnswerId="19635" CreationDate="2016-01-18T10:34:04.147" Score="2" ViewCount="396" Body="&lt;p&gt;I am having hard time trying to figure out how to add contents of multiple fields. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It isn't quite obvious from Org mode manual as issue like this should be. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to find a formula to sum the entry in fields &lt;code&gt;@2$5&lt;/code&gt; to &lt;code&gt;@5$5&lt;/code&gt; and make an entry of the sum in &lt;code&gt;@6$5&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I found that something like &lt;code&gt;@2$5..@5$5&lt;/code&gt; can be used to refer to range of fields, but how do I find the sum of them? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;sum(@2$5..@5$5)&lt;/code&gt; and &lt;code&gt;add(@2$5..@5$5)&lt;/code&gt;, but apparantly there's no such functions.&lt;/p&gt;&#xA;" OwnerUserId="10160" LastEditorUserId="10160" LastEditDate="2016-01-19T03:19:34.610" LastActivityDate="2016-01-19T03:19:34.610" Title="Org-mode spreadsheet: operate on range of fields" Tags="|org-mode|spreadsheet|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19629" PostTypeId="1" AcceptedAnswerId="19631" CreationDate="2016-01-18T10:41:44.537" Score="11" ViewCount="8982" Body="&lt;p&gt;Recently I discovered &lt;code&gt;emacs&lt;/code&gt; as a text editor for my &lt;code&gt;latex&lt;/code&gt; documents. So far, I am excited with how powerful the editor is. However, I have a problem with line wrapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely, in the &lt;code&gt;option&lt;/code&gt; menu I choose &lt;code&gt;line wrapping in this buffer --&amp;gt; word wrap&lt;/code&gt;. After that, I choose &lt;code&gt;save options&lt;/code&gt;, but when I reopen my &lt;code&gt;tex&lt;/code&gt; file, line wrapping is back to the default setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is how can I set &lt;code&gt;word wrap&lt;/code&gt; as my default wrapping option for all my documents?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance &lt;/p&gt;&#xA;" OwnerUserId="10809" LastEditorUserId="9995" LastEditDate="2016-01-18T12:44:15.967" LastActivityDate="2023-10-25T11:31:20.617" Title="Word wrap line option by default" Tags="|customize|wrapping|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19630" PostTypeId="2" ParentId="19625" CreationDate="2016-01-18T10:45:32.870" Score="3" Body="&lt;p&gt;As suggested by @abo-abo, you should set &lt;code&gt;case-fold-search&lt;/code&gt; to nil. However, in order to ensure that it doesn't affect any other part of the system, you can bind in using &lt;code&gt;let&lt;/code&gt;, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun search-backward-lowercase-alphabet ()&#xA;  (interactive)&#xA;  (let ((case-fold-search nil))&#xA;    (search-backward-regexp &quot;[a-z]&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-01-18T10:45:32.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19631" PostTypeId="2" ParentId="19629" CreationDate="2016-01-18T11:08:15.040" Score="9" Body="&lt;p&gt;As you noticed, the menu entry says &quot;Line Wrapping in &lt;em&gt;This&lt;/em&gt; Buffer&quot; so this is not something that is saved by &quot;Save Options&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable &lt;code&gt;visual-line-mode&lt;/code&gt; in all your latex documents, add the following in your init file (&lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'visual-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This ensures the function &lt;code&gt;visual-line-mode&lt;/code&gt; (aka &quot;word wrap&quot;) is called for each buffer that is put in &lt;code&gt;LaTeX-mode&lt;/code&gt; (assuming you're using AUCTeX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information about the hook mechanism can be found in the emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html#Hooks&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-01-18T13:07:22.513" LastActivityDate="2016-01-18T13:07:22.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19632" PostTypeId="1" AcceptedAnswerId="19636" CreationDate="2016-01-18T11:21:38.193" Score="1" ViewCount="287" Body="&lt;hr&gt;&#xA;&#xA;&lt;p&gt;below is my function for reschedule agenda item to &quot;today + 3 days&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-agenda-reschedule-week () &#xA;    (interactive) &#xA;    (org-agenda-schedule nil &quot;+3d&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;similarly i want function for rescheduling agenda item after current time + 3 hours, these code doesn't work &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-agenda-reschedule-hour () &#xA;    (interactive) &#xA;    (org-agenda-schedule nil &quot;+3h&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;" OwnerUserId="10810" LastEditorUserId="2274" LastEditDate="2016-01-18T16:12:05.713" LastActivityDate="2016-01-18T16:12:05.713" Title="Key Binding to reschedule agenda item after 2 hours" Tags="|org-mode|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19633" PostTypeId="1" CreationDate="2016-01-18T11:28:26.533" Score="5" ViewCount="5829" Body="&lt;p&gt;I'd like to write something like this except to compare the region with a regexp.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (string-match (buffer-substring-no-properties (point) (mark))&#xA;                  &quot;foo&quot;)&#xA;    (bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an equivalent of string-match for regexp that I can use like this &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (regexp-match (buffer-substring-no-properties (point) (mark))&#xA;                  &quot;^[A-Z]&quot;)&#xA;    (bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that it returns true if the selected region is &quot;Apple&quot; and nil if it's &quot;apple&quot;?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-14T00:48:47.020" LastActivityDate="2016-03-14T00:48:47.020" Title="Is there an equivalent of string-match for regexp?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19634" PostTypeId="1" AcceptedAnswerId="19652" CreationDate="2016-01-18T12:37:04.210" Score="1" ViewCount="1028" Body="&lt;p&gt;Is there a way to put notes below a table in org-mode that are exported &lt;strong&gt;into&lt;/strong&gt; the table environment but are not part of tabular when exporting to LaTeX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., I export a lot of regression tables and need to export some table explanations below the table body. If those are not included in between &lt;code&gt;\begin{table} ... \end{table}&lt;/code&gt; they are not part of the float environment and end up somewhere in the text, not below the table. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: tab:direct_xtivreg_de&#xA;#+CAPTION: Contribution explained by lagged received punishment (Panel *unclustered Std.Err.*)&#xA;|                   | (1)       | (2)             | (3)       |&#xA;| VARIABLES         | contrib   | L.realPunRecSum | contrib   |&#xA;|-------------------+-----------+-----------------+-----------|&#xA;| L.realPunRecSum   | -0.216*** |                 | -1.150*** |&#xA;|                   | (0.0433)  |                 | (0.0894)  |&#xA;| L.predPunRecSum31 |           | 1.084***        |           |&#xA;|                   |           | (0.0395)        |           |&#xA;| Constant          | 12.46***  | 0.414***        |           |&#xA;|                   | (0.115)   | (0.0592)        |           |&#xA;|-------------------+-----------+-----------------+-----------|&#xA;| Observations      | 2,016     | 2,016           | 2,016     |&#xA;| R-squared         | 0.014     | 0.296           | -0.242    |&#xA;| Number of subj.   | 224       | 224             | 224       |&#xA;| F test model      |           |                 | 165.3     |&#xA;|-------------------+-----------+-----------------+-----------|&#xA;\parbox{.8\textwidth}{\footnotesize Standard errors in parentheses, *** p&amp;lt;0.01, ** p&amp;lt;0.05, * p&amp;lt;0.1}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I added a code example. I would like the &lt;code&gt;parbox&lt;/code&gt;part to be within the &lt;code&gt;table&lt;/code&gt; environment as well.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastEditorUserId="9901" LastEditDate="2016-01-18T16:56:44.757" LastActivityDate="2016-01-20T08:12:37.900" Title="include notes in table environment below tabular when exporting from org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ClosedDate="2016-08-11T09:01:37.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="19635" PostTypeId="2" ParentId="19628" CreationDate="2016-01-18T12:47:45.400" Score="3" Body="&lt;p&gt;The formulas are evaluated by the &lt;code&gt;calc&lt;/code&gt; package, and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/calc.html&quot; rel=&quot;nofollow&quot;&gt;its manual&lt;/a&gt; is the goto place for functions lookup. (This manual can be quite overwhelming, but you will only visit a few pages most of the time.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, functions that operate on a single vector (in your case you want to sum coefficients of a vector) are prefixed by &lt;code&gt;v&lt;/code&gt;, and indeed here &lt;code&gt;vsum&lt;/code&gt; is what you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a list of these functions &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/calc.html#Single_002dVariable-Statistics&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2016-01-18T12:47:45.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19636" PostTypeId="2" ParentId="19632" CreationDate="2016-01-18T13:20:39.343" Score="0" Body="&lt;p&gt;This function should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-agenda-reschedule-hour () &#xA;  (interactive) &#xA;  (org-agenda-date-later-hours 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then bind it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-agenda-mode-map &quot;x&quot; 'my/org-agenda-reschedule-hour)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;x&lt;/code&gt; is whatever key you want. If you want to create more similar functions, there is also &lt;code&gt;org-agenda-date-later-minutes&lt;/code&gt;, as well as &lt;code&gt;earlier&lt;/code&gt; versions for both this and the &lt;code&gt;hours&lt;/code&gt; function. Similarly, you can use &lt;code&gt;(org-agenda-date-later n)&lt;/code&gt; to shift by &lt;code&gt;n&lt;/code&gt; days&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-18T13:20:39.343" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19637" PostTypeId="1" AcceptedAnswerId="19640" CreationDate="2016-01-18T13:30:56.307" Score="3" ViewCount="679" Body="&lt;p&gt;What is the predicate function to determine if a given file is under version control?  (I'm using git.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-12-16T21:08:16.033" Title="Predicate function to test if file is under version control?" Tags="|git|version-control|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19638" PostTypeId="2" ParentId="19637" CreationDate="2016-01-18T13:39:10.887" Score="2" Body="&lt;p&gt;Try &lt;code&gt;(vc-git-responsible-p (buffer-file-name))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-01-18T13:39:10.887" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19640" PostTypeId="2" ParentId="19637" CreationDate="2016-01-18T14:06:50.693" Score="4" Body="&lt;p&gt;The canonical way is to call &lt;code&gt;(vc-backend &amp;lt;file&amp;gt;)&lt;/code&gt;, AFAIK.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-18T14:06:50.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19641" PostTypeId="1" AcceptedAnswerId="19789" CreationDate="2016-01-18T14:43:40.893" Score="10" ViewCount="2328" Body="&lt;p&gt;I consolidated many text files (win, mac, unix) into a single orgmode file. For some characters I was seeing numbers instead of the right characters. Things like \314\203.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used &quot;revert-buffer-with-coding-sytem&quot; and choose utf-8-hfs-unix.&#xA;That fixes it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now every time I save, Emacs asks me to choose a coding system. If I choose raw-text it stops asking but when I open the file again the numbers are back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I fix this?&lt;/p&gt;&#xA;" OwnerUserId="8844" LastActivityDate="2016-01-24T00:15:19.060" Title="Emacs is asking me for a coding system on each save" Tags="|org-mode|character-encoding|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19643" PostTypeId="1" CreationDate="2016-01-18T15:25:24.173" Score="2" ViewCount="167" Body="&lt;p&gt;I'm using the icalendar export built into org-mode to export my agenda to an ical file. I also use org-bbdb to insert birthdays (anniversaries) into the agenda. Using the variable &lt;code&gt;org-icalendar-include-bbdb-anniversaries&lt;/code&gt;,  these anniversaries are exported to the ical file, which is great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that the format of these birthday entries is not customizable. I traced back the formatting of the org-bbdb entries to the ical entries to the function &lt;code&gt;org-bbdb-format-vevent&lt;/code&gt;, defined in &lt;code&gt;org-bbdb.el&lt;/code&gt;. Can I overwrite or modify this function without patching &lt;code&gt;org-bbdb.el&lt;/code&gt;? If so, what's the recommended way to do that?&lt;/p&gt;&#xA;" OwnerUserId="10816" LastActivityDate="2016-03-18T17:37:53.440" Title="Recommended way to overwrite built-in function (org-bbdb-format-vevent)" Tags="|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19644" PostTypeId="2" ParentId="19643" CreationDate="2016-01-18T16:27:42.863" Score="1" Body="&lt;p&gt;I'm not sure about the formatting in bbdb specifically, but it sounds like you are looking to &quot;advise&quot; &lt;code&gt;org-bbdb-format-vevent&lt;/code&gt;. Check out the manual which has &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;a section&lt;/a&gt; on this topic.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2016-01-18T16:27:42.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19645" PostTypeId="1" AcceptedAnswerId="19646" CreationDate="2016-01-18T16:51:23.677" Score="5" ViewCount="24833" Body="&lt;p&gt;I tried these two, but none of them worked.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (looking-at &quot;\[&quot;) (insert &quot;f&quot;))&#xA;&#xA;(if (looking-at &quot;[&quot;) (insert &quot;f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I escape square brackets in emacs regexp?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-14T00:48:28.627" LastActivityDate="2016-03-14T00:48:28.627" Title="Escaping brackets in regexp" Tags="|regular-expressions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19646" PostTypeId="2" ParentId="19645" CreationDate="2016-01-18T16:54:15.183" Score="8" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (looking-at &quot;\\[&quot;) (insert &quot;f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usually you will need to escape your escaping backslash. &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_regex.html&quot; rel=&quot;nofollow&quot;&gt;This tutorial&lt;/a&gt; has a short explanation of the &quot;double backslash&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When in doubt, I always use the built-in &lt;a href=&quot;https://www.masteringemacs.org/article/re-builder-interactive-regexp-builder&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;re-builder&lt;/code&gt;&lt;/a&gt;. If you try this on a buffer with &lt;code&gt;[&lt;/code&gt; in it, you will find that &lt;code&gt;&quot;\\[&quot;&lt;/code&gt; will match them. Pressing &lt;code&gt;C-c C-w&lt;/code&gt; in the &lt;code&gt;re-builder&lt;/code&gt; will copy the regular expression to your kill-ring to yank back into the function you are working on.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-18T17:13:52.123" LastActivityDate="2016-01-18T17:13:52.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19647" PostTypeId="1" CreationDate="2016-01-18T16:55:17.333" Score="3" ViewCount="399" Body="&lt;p&gt;Basically, I want to split a &lt;em&gt;multiline&lt;/em&gt; string at the regular expression that, &lt;em&gt;in Perl&lt;/em&gt;, would be specified with &lt;code&gt;\n(?=[^\W\d]\w*=)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the Perl regexp features a &quot;zero-width lookahead match&quot; (&lt;code&gt;(?=...)&lt;/code&gt;), meaning that the substrings that match this part of the regexp will not be &quot;consumed&quot;; they will appear in their corresponding entries in the resulting list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the string whose printed representation is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A=1&#xA;B_C_D=&#xA;foo&#xA;bar&#xA;baz&#xA;  =whatever=&#xA;X_Y_Z=quux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would be split into the following three-element list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;A=1&quot; &quot;B_C_D=\nfoo\nbar\nbaz\n  =whatever=&quot; &quot;X_Y_Z=quux\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Even though Elisp regexps do not support lookahead/lookbehind expressions, this sort of splitting problem (in which part or all of each matching substring is not consumed) is common enough that I hope there are some other standard ways to solve it in Elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, the ultimate goal here is to split the output of the shell command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/bin/zsh -ilc 'printenv' 2&amp;gt;/dev/null&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that each element of the result would correspond to one &quot;setting&quot; of an environment variable&lt;sup&gt;1&lt;/sup&gt;.  So I also figure that Elisp may possibly have functions that facilitate the handling of this special case&lt;sup&gt;2&lt;/sup&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;1&lt;/sup&gt; The desired result is &lt;em&gt;conceptually similar&lt;/em&gt; to value of the variable &lt;code&gt;process-environment&lt;/code&gt;, but in general it is &lt;em&gt;not&lt;/em&gt; be identical to it.  Also, the side-effects associated with setting and updating &lt;code&gt;process-environment&lt;/code&gt; do &lt;em&gt;not&lt;/em&gt; enter into my problem.&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;2&lt;/sup&gt; Unfortunately, it appears that &lt;code&gt;process-environment&lt;/code&gt; is initialized in C-code, so whatever functions do that are not available in Elisp.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-03-14T00:48:16.407" LastActivityDate="2017-01-30T16:29:47.150" Title="How to split the output of a `printenv` shell command?" Tags="|regular-expressions|string|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19648" PostTypeId="1" AcceptedAnswerId="19651" CreationDate="2016-01-18T17:34:42.810" Score="4" ViewCount="240" Body="&lt;p&gt;I have a number of parameter files that my code needs as inputs and I would like them all to be in the same org file in different blocks and have them all tangled to different files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I somehow tangle &lt;code&gt;#+BEGIN_EXAMPLE ... #+END_EXAMPLE&lt;/code&gt; blocks or some other block type? I tried this which didn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_EXAMPLE :tangle methanol.rtf&#xA;&#xA;MASS     1 H      1.00800 H ! polar H&#xA;...&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively can I define new languages for org-mode to recognize but not execute?&lt;/p&gt;&#xA;" OwnerUserId="9019" LastActivityDate="2016-01-18T18:33:09.870" Title="Tangling non-code files to separate files" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19649" PostTypeId="2" ParentId="19628" CreationDate="2016-01-18T18:22:21.920" Score="2" Body="&lt;p&gt;If you're more comfortable with elisp than calc functions, you can also do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(apply #'+ '(@2$5..@5$5));N&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://orgmode.org/manual/Formula-syntax-for-Lisp.html#Formula-syntax-for-Lisp&quot; rel=&quot;nofollow&quot;&gt;the Org manual&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-18T18:22:21.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19650" PostTypeId="2" ParentId="19645" CreationDate="2016-01-18T18:23:45.977" Score="5" Body="&lt;p&gt;All you need is this: &lt;strong&gt;&lt;code&gt;(if (looking-at &quot;[[]&quot;) (insert &quot;f&quot;))&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, &quot;special&quot; regexp characters are not special within brackets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Special.html&quot; rel=&quot;noreferrer&quot;&gt;Regexp Special&lt;/a&gt;. It tells you this about special chars and bracketed char classes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note also that the usual regexp special characters are not special&#xA;  inside a character alternative.  A completely different set of&#xA;  characters is special inside character alternatives: ‘]’, ‘-’ and&#xA;  ‘^’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To include a ‘]’ in a character alternative, you must make it the&#xA;  first character.  For example, ‘[]a]’ matches ‘]’ or ‘a’.  To&#xA;  include a ‘-’, write ‘-’ as the first or last character of the&#xA;  character alternative, or put it after a range.  Thus, ‘[]-]’&#xA;  matches both ‘]’ and ‘-’.  (As explained below, you cannot use ‘]’&#xA;  to include a ‘]’ inside a character alternative, since ‘\’ is not&#xA;  special there.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-18T18:23:45.977" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19651" PostTypeId="2" ParentId="19648" CreationDate="2016-01-18T18:33:09.870" Score="6" Body="&lt;p&gt;Just use &lt;code&gt;fundamental&lt;/code&gt; as &quot;language&quot;, i.e. replace your example by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC fundamental :tangle methanol.rtf&#xA;&#xA;MASS     1 H      1.00800 H ! polar H&#xA;...&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-01-18T18:33:09.870" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19652" PostTypeId="2" ParentId="19634" CreationDate="2016-01-18T19:01:53.933" Score="1" Body="&lt;p&gt;You can use the LaTeX attribute &lt;code&gt;:caption&lt;/code&gt;. There you can give raw LaTeX code (including the &lt;code&gt;\caption{...}&lt;/code&gt; macro).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get this below the table set the option &lt;code&gt;org-latex-table-caption-above&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&#xA;You can do that by the following steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;exporting any org file to latex (this ensures that the package &lt;code&gt;ox-latex&lt;/code&gt; is loaded)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-option&lt;/code&gt; &lt;code&gt;org-latex-table-caption-above&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Set the option to &lt;code&gt;Off&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Apply this option or even save it for later use.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Your example reads with this hints as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: tab:direct_xtivreg_de&#xA;#+ATTR_LATEX: :caption \\\parbox{.8\textwidth}{\footnotesize Standard errors in parentheses, *** p&amp;lt;0.01, ** p&amp;lt;0.05, * p&amp;lt;0.1} \caption{Contribution explained by lagged received punishment (Panel *unclustered Std.Err.*)}&#xA;|                   | (1)       | (2)             | (3)       |&#xA;| VARIABLES         | contrib   | L.realPunRecSum | contrib   |&#xA;|-------------------+-----------+-----------------+-----------|&#xA;| L.realPunRecSum   | -0.216*** |                 | -1.150*** |&#xA;|                   | (0.0433)  |                 | (0.0894)  |&#xA;| L.predPunRecSum31 |           | 1.084***        |           |&#xA;|                   |           | (0.0395)        |           |&#xA;| Constant          | 12.46***  | 0.414***        |           |&#xA;|                   | (0.115)   | (0.0592)        |           |&#xA;|-------------------+-----------+-----------------+-----------|&#xA;| Observations      | 2,016     | 2,016           | 2,016     |&#xA;| R-squared         | 0.014     | 0.296           | -0.242    |&#xA;| Number of subj.   | 224       | 224             | 224       |&#xA;| F test model      |           |                 | 165.3     |&#xA;|-------------------+-----------+-----------------+-----------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works with Emacs 24.5.1 (Org mode 8.2.10) and also with Emacs 24.5.1 (Org mode 8.2.10).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The generated LaTeX-text is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{table}[htb]&#xA;\centering&#xA;\begin{tabular}{llll}&#xA; &amp;amp; (1) &amp;amp; (2) &amp;amp; (3)\\&#xA;VARIABLES &amp;amp; contrib &amp;amp; L.realPunRecSum &amp;amp; contrib\\&#xA;\hline&#xA;L.realPunRecSum &amp;amp; -0.216*** &amp;amp;  &amp;amp; -1.150***\\&#xA; &amp;amp; (0.0433) &amp;amp;  &amp;amp; (0.0894)\\&#xA;L.predPunRecSum31 &amp;amp;  &amp;amp; 1.084*** &amp;amp; \\&#xA; &amp;amp;  &amp;amp; (0.0395) &amp;amp; \\&#xA;Constant &amp;amp; 12.46*** &amp;amp; 0.414*** &amp;amp; \\&#xA; &amp;amp; (0.115) &amp;amp; (0.0592) &amp;amp; \\&#xA;\hline&#xA;Observations &amp;amp; 2,016 &amp;amp; 2,016 &amp;amp; 2,016\\&#xA;R-squared &amp;amp; 0.014 &amp;amp; 0.296 &amp;amp; -0.242\\&#xA;Number of subj. &amp;amp; 224 &amp;amp; 224 &amp;amp; 224\\&#xA;F test model &amp;amp;  &amp;amp;  &amp;amp; 165.3\\&#xA;\hline&#xA;\end{tabular}\\\parbox{.8\textwidth}{\footnotesize Standard errors in parentheses, *** p&amp;lt;0.01, ** p&amp;lt;0.05, * p&amp;lt;0.1} \caption{Contribution explained by lagged received punishment (Panel *unclustered Std.Err.*)}&#xA;&#xA;\end{table}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The produced pdf displays as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oRa1J.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oRa1J.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-20T08:12:37.900" LastActivityDate="2016-01-20T08:12:37.900" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19653" PostTypeId="1" CreationDate="2016-01-18T19:17:20.880" Score="2" ViewCount="104" Body="&lt;p&gt;I use the two great html theme, bigblow and readtheorg, from &lt;a href=&quot;https://github.com/fniessen/org-html-themes&quot; rel=&quot;nofollow&quot;&gt;https://github.com/fniessen/org-html-themes&lt;/a&gt;. They're awesome ! Looks really professionnal. The problem is that when I export some LaTeX, in both mode it's not good yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In bigblow, the font LaTeX font size is way too big ! Like 3 times the size of normal text. So I would like to change that size to fit the font size of normal text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In readtheorg, some LaTeX sometimes overlap normal text, and also some characters aren't displayed like &lt;code&gt;\mathbb{K}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like both so I am looking for two solutions ! First solution will be marked as the answer.&#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="9790" LastEditDate="2016-01-19T11:30:52.263" LastActivityDate="2016-01-19T11:30:52.263" Title="Org LaTeX problems with themes when exporting to html" Tags="|org-export|latex|html|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19654" PostTypeId="1" CreationDate="2016-01-18T19:40:43.740" Score="2" ViewCount="729" Body="&lt;p&gt;Using org source blocks with OCaml, I get a blank resulting output with that code :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ocaml :results output&#xA;print_string &quot;hello&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And without the &lt;code&gt;:results value&lt;/code&gt; parameter :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: () &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to catch the output of OCaml in org source blocks ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt; : My init parts about ocaml &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package utop&#xA;  :ensure t)&#xA;&#xA;(use-package merlin&#xA;  :ensure&#xA;  :config&#xA;  ;; Add opam emacs directory to the load-path&#xA;  (setq opam-share (substring (shell-command-to-string &quot;opam config var share 2&amp;gt; /dev/null&quot;) 0 -1))&#xA;  (add-to-list 'load-path (concat opam-share &quot;/emacs/site-lisp&quot;))&#xA;  ;; Load merlin-mode&#xA;  (require 'merlin)&#xA;  ;; Start merlin on ocaml files&#xA;  (add-hook 'tuareg-mode-hook 'merlin-mode t)&#xA;  (add-hook 'caml-mode-hook 'merlin-mode t)&#xA;  ;; Make company aware of merlin&#xA;  (with-eval-after-load 'company&#xA;    (add-to-list 'company-backends 'merlin-company-backend))&#xA;  ;; Enable company on merlin managed buffers&#xA;  (add-hook 'merlin-mode-hook 'company-mode)&#xA;  ;; Or enable it globally:&#xA;                    ;(add-hook 'after-init-hook 'global-company-mode)&#xA;&#xA;  ;; Use opam switch to lookup ocamlmerlin binary&#xA;  (setq merlin-command 'opam)&#xA;;;  (define-key tuareg-mode-map (kbd &quot;C-c M-s&quot;) ')&#xA;  ;;;###autoload&#xA;  (defun tuareg-run-metaocaml ()&#xA;    &quot;Run an OCaml toplevel process.  I/O via buffer `*ocaml-toplevel*'.&quot;&#xA;    (interactive)&#xA;    (tuareg-run-process-if-needed&#xA;     &quot;/usr/bin/opam config exec -- metaocaml&quot;)&#xA;    (display-buffer tuareg-interactive-buffer-name))&#xA;&#xA;  (add-hook 'tuareg-mode-hook&#xA;        ' (lambda ()&#xA;              (define-key tuareg-mode-map (kbd &quot;C-c M-s&quot;)&#xA;            'tuareg-run-metaocaml)))&#xA;&#xA;  (setq tuareg-interactive-program &quot;/usr/local/bin/opam config -- exec metaocaml&quot;)&#xA;  ;;(setq merlin-use-auto-complete-mode t)&#xA;  ;;(setq merlin-error-after-save nil)&#xA;  )&#xA;&#xA;(use-package tuareg&#xA;  :ensure t&#xA;  :config&#xA;  (setq auto-mode-alist (cons '(&quot;\\.ml\\w?&quot; . tuareg-mode) auto-mode-alist))&#xA;  (autoload 'tuareg-mode &quot;tuareg&quot; &quot;Mode majeur pour éditer du code Caml&quot; t)&#xA;  (autoload 'camldebug &quot;camldebug&quot; &quot;Exécuter le débogueur Caml&quot; t) &#xA;  (when (string= (getenv &quot;MY_EMACS_DAEMON&quot;) &quot;ocaml&quot;)&#xA;    (load-file &quot;~/.emacs.d/elisp/daemon/my-tuareg-daemon.el&quot;))&#xA;  ;; Setup environment variables using opam&#xA;  (dolist (var (car (read-from-string (shell-command-to-string &quot;opam config env --sexp&quot;))))&#xA;    (setenv (car var) (cadr var)))&#xA;  ;; Update the emacs path&#xA;  (setq exec-path (append (parse-colon-path (getenv &quot;PATH&quot;))&#xA;                        (list exec-directory)))&#xA;  ;; Update the emacs load path&#xA;  (add-to-list 'load-path (expand-file-name &quot;../../share/emacs/site-lisp&quot;&#xA;                        (getenv &quot;OCAML_TOPLEVEL_PATH&quot;)))&#xA;  ;; utop top level&#xA;  (autoload 'utop &quot;utop&quot; &quot;Toplevel for OCaml&quot; t)&#xA;  (autoload 'utop-minor-mode &quot;utop&quot; &quot;Minor mode for utop&quot; t)&#xA;  (add-hook 'tuareg-mode-hook 'utop-minor-mode)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried without utop but output remained the same. &lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="2274" LastEditDate="2016-04-19T00:12:28.013" LastActivityDate="2020-12-06T02:31:49.293" Title="Org print output in OCaml source blocks" Tags="|org-mode|org-babel|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19655" PostTypeId="2" ParentId="19654" CreationDate="2016-01-18T20:04:51.130" Score="1" Body="&lt;p&gt;You can try adding &lt;code&gt;ocaml&lt;/code&gt; to the list of &lt;code&gt;org-babel-load-languages&lt;/code&gt; with &lt;code&gt;M-x customize-variable org-babel-load-languages&lt;/code&gt;, inserting a new value with &lt;code&gt;INS&lt;/code&gt;, and then selecting &lt;code&gt;Ocaml&lt;/code&gt; from the list. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can define the list in your init file. Here is mine (plus Ocaml just for testing):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((python . t)&#xA;   (sh . t)&#xA;   (ocaml . t)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this configuration I get the following results when I execute your example block with &lt;code&gt;C-c C-c&lt;/code&gt; in the block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ocaml :results output&#xA;print_string &quot;hello&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: ()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;:results value&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ocaml :results value&#xA;print_string &quot;hello&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: hello- : unit = ()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, you may find &lt;a href=&quot;http://orgmode.org/manual/results.html#results&quot; rel=&quot;nofollow&quot;&gt;this resource&lt;/a&gt; helpful if you haven't seen it already.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-18T20:25:54.987" LastActivityDate="2016-01-18T20:25:54.987" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19656" PostTypeId="1" AcceptedAnswerId="19657" CreationDate="2016-01-18T20:58:58.263" Score="4" ViewCount="849" Body="&lt;p&gt;I have a code blocks for a domain specific input files that I want to have in a single org file and tangle them out to separate files (see &lt;a href=&quot;https://emacs.stackexchange.com/questions/19648/tangling-non-code-files-to-separate-files/19651#19651&quot;&gt;Tangling non-code files to separate files&lt;/a&gt;). However, my source has things in it that look like org-mode headings, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC fundamental :tangle test.inp&#xA;* minimize&#xA;*&#xA;&#xA;open unit 10 read form name methanol.rtf&#xA;read rtf card unit 10&#xA;close unit 10&#xA;...&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and these don't get tangled. Removing the &lt;code&gt;* minimize&lt;/code&gt; line or putting any amount of text before it does not solve the problem. The &quot;headers&quot; aren't highlighted but they still have folding etc., and emacs won't let me put spaces in front of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems like a bug, but a workaround would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-01-18T21:23:17.620" Title="Tangling fundamental source blocks with org-header like code" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19657" PostTypeId="2" ParentId="19656" CreationDate="2016-01-18T21:13:06.097" Score="5" Body="&lt;p&gt;The problem is that you did trick org-mode. You did not use &lt;kbd&gt;C-'&lt;/kbd&gt; to input the text block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do so, the org-mode syntax is escaped as the following example shows. Note the commas before the stars! They are automatically added by org-babel.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC fundamental :tangle test.inp&#xA;,* minimize&#xA;,*&#xA;&#xA;open unit 10 read form name methanol.rtf&#xA;read rtf card unit 10&#xA;close unit 10&#xA;...&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you input a new source code block the sequence is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start on a new line and press &lt;kbd&gt;tab&lt;/kbd&gt; to get the right indentation.&lt;/li&gt;&#xA;&lt;li&gt;Input &lt;code&gt;&amp;lt;s&lt;/code&gt; and press &lt;kbd&gt;tab&lt;/kbd&gt; for the easy template that generates a source code block.&lt;/li&gt;&#xA;&lt;li&gt;Input &lt;code&gt;fundamental :tangle test.inp&lt;/code&gt; to complete the header of the source code block&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;C-'&lt;/kbd&gt; to edit the source code block.&lt;/li&gt;&#xA;&lt;li&gt;In the newly opened buffer paste your text.&lt;/li&gt;&#xA;&lt;li&gt;Finish editing the source code block with &lt;kbd&gt;C-'&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-18T21:23:17.620" LastActivityDate="2016-01-18T21:23:17.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19658" PostTypeId="1" AcceptedAnswerId="19660" CreationDate="2016-01-18T21:23:00.820" Score="6" ViewCount="2204" Body="&lt;p&gt;When I try to run &lt;code&gt;magit-commit-popup&lt;/code&gt; in Spacemacs, I get the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: cl-struct-define&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only reference I could find to this issue was on &lt;a href=&quot;https://github.com/magit/magit/issues/1838&quot; rel=&quot;noreferrer&quot;&gt;this Github thread&lt;/a&gt;, but I wasn't able to follow what he did to resolve the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs version is 24.4.2 and I am on Linux Mint 17.2&lt;/p&gt;&#xA;" OwnerUserId="10818" LastActivityDate="2016-01-19T12:27:57.650" Title="Can't use Magit in Spacemacs - &quot;Symbol's function is void: cl-struct-define&quot;" Tags="|magit|spacemacs|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19659" PostTypeId="1" CreationDate="2016-01-18T22:00:35.023" Score="1" ViewCount="620" Body="&lt;p&gt;I don't know why in an org buffer, where &lt;code&gt;company-math-symbols-latex&lt;/code&gt; and &lt;code&gt;company-latex-command&lt;/code&gt; backends are added to the backends list and company is activated, the command &lt;code&gt;company-math-symbols-latex&lt;/code&gt; doesn't show any completion, eg. after typing &lt;code&gt;\om&lt;/code&gt; where at least &lt;code&gt;\omega&lt;/code&gt; is a relevant completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;company-complete-common&lt;/code&gt; show me some LaTeX's command completion, but no LaTeX's symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get symbols completion ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is my org hook foc LaTeX completion :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun my-latex-mode-setup ()&#xA;    (setq-local company-backends&#xA;        (append '(company-math-symbols-latex company-latex-commands)&#xA;            company-backends))&#xA;    (local-set-key (kbd &quot;C-z TAB&quot;) 'company-math-symbols-latex))&#xA;  (add-hook 'org-mode-hook 'my-latex-mode-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="9790" LastActivityDate="2016-02-27T13:16:50.610" Title="Company-latex-commands doesn't show completion" Tags="|latex|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19660" PostTypeId="2" ParentId="19658" CreationDate="2016-01-18T23:13:36.313" Score="8" Body="&lt;p&gt;Exit Emacs. Does the directory &lt;code&gt;~/.emacs.d/elpa/cl-lib-&amp;lt;version&amp;gt;&lt;/code&gt; exist? If so remove it. If not, then remove &lt;code&gt;~/.emacs.d/elpa/{git-commit,magit,magit-popup,with-editor}-&amp;lt;version&amp;gt;&lt;/code&gt; instead. Actually you might want to remove these directories even if the &lt;code&gt;cl-lib&lt;/code&gt; directory existed, but first try without doing that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then start Emacs. I believe that Spacemacs should now reinstall missing packages. (Not sure though, I don't use Spacemacs. Or &lt;code&gt;package.el&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;magit&lt;/code&gt; does require &lt;code&gt;cl-lib&lt;/code&gt;, there is no need for you to require it yourself. The problem is something else and the above nuclear option should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, make sure that you are running an up-to-date version of Git. Magit requires at least v1.9.4.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="10818" LastEditDate="2016-01-19T12:27:57.650" LastActivityDate="2016-01-19T12:27:57.650" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19661" PostTypeId="1" CreationDate="2016-01-18T23:17:57.770" Score="3" ViewCount="2160" Body="&lt;p&gt;When I export an elisp source code block to html, the indentation of the code gets messed up. I've tried calling &lt;code&gt;(setq org-src-preserve-indentation t)&lt;/code&gt;, but that didn't help. I imagine there is perhaps something in my code that is being wrongly interpreted by &lt;code&gt;org-html-publish-to-html&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a minimum working example, I try exporting the following org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Test    &#xA;&#xA;Let's check the html output of this file...&#xA;&#xA;#+BEGIN_SRC elisp :tangle yes&#xA;(setq org-publish-project-alist&#xA;`((&quot;index&quot;&#xA; :with-title nil :base-directory &quot;~/website/org/&quot;&#xA; :base-extension &quot;org&quot; :publishing-directory &quot;~/website/public/html/&quot;&#xA; :headline-levels 3 :section-numbers nil&#xA; :publishing-function org-html-publish-to-html :with-toc nil&#xA; :html-head ,index-html-extra-head&#xA; :html-head-include-default-style nil&#xA; :html-head-include-scripts nil&#xA; :html-preamble nil :html-postamble t)))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and as a result comes out the following (notice how the code gets 4 tabs of indentation starting from the 3rd line):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FJ0Z0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FJ0Z0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;HTML here, in case it helps...:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&#xA;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;&#xA;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;&#xA;&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;en&quot; xml:lang=&quot;en&quot;&amp;gt;&#xA;    &amp;lt;head&amp;gt;&#xA;    &amp;lt;!-- 2016-01-19 Tue 00:08 --&amp;gt;&#xA;    &amp;lt;meta  http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=utf-8&quot; /&amp;gt;&#xA;    &amp;lt;meta  name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot; /&amp;gt;&#xA;    &amp;lt;title&amp;gt;Test&amp;lt;/title&amp;gt;&#xA;    &amp;lt;meta  name=&quot;generator&quot; content=&quot;Org-mode&quot; /&amp;gt;&#xA;    &amp;lt;meta  name=&quot;author&quot; content=&quot;name&quot; /&amp;gt;&#xA;    &amp;lt;style type=&quot;text/css&quot;&amp;gt;&#xA;     &amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/&#xA;     .title  { text-align: center;&#xA;             margin-bottom: .2em; }&#xA;     .subtitle { text-align: center;&#xA;             font-size: medium;&#xA;             font-weight: bold;&#xA;             margin-top:0; }&#xA;     .todo   { font-family: monospace; color: red; }&#xA;     .done   { font-family: monospace; color: green; }&#xA;     .priority { font-family: monospace; color: orange; }&#xA;     .tag    { background-color: #eee; font-family: monospace;&#xA;             padding: 2px; font-size: 80%; font-weight: normal; }&#xA;     .timestamp { color: #bebebe; }&#xA;     .timestamp-kwd { color: #5f9ea0; }&#xA;     .org-right  { margin-left: auto; margin-right: 0px;  text-align: right; }&#xA;     .org-left   { margin-left: 0px;  margin-right: auto; text-align: left; }&#xA;     .org-center { margin-left: auto; margin-right: auto; text-align: center; }&#xA;     .underline { text-decoration: underline; }&#xA;     #postamble p, #preamble p { font-size: 90%; margin: .2em; }&#xA;     p.verse { margin-left: 3%; }&#xA;     pre {&#xA;         border: 1px solid #ccc;&#xA;         box-shadow: 3px 3px 3px #eee;&#xA;         padding: 8pt;&#xA;         font-family: monospace;&#xA;         overflow: auto;&#xA;         margin: 1.2em;&#xA;     }&#xA;     pre.src {&#xA;         position: relative;&#xA;         overflow: visible;&#xA;         padding-top: 1.2em;&#xA;     }&#xA;     pre.src:before {&#xA;         display: none;&#xA;         position: absolute;&#xA;         background-color: white;&#xA;         top: -10px;&#xA;         right: 10px;&#xA;         padding: 3px;&#xA;         border: 1px solid black;&#xA;     }&#xA;     pre.src:hover:before { display: inline;}&#xA;     pre.src-sh:before    { content: 'sh'; }&#xA;     pre.src-bash:before  { content: 'sh'; }&#xA;     pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }&#xA;     pre.src-R:before     { content: 'R'; }&#xA;     pre.src-perl:before  { content: 'Perl'; }&#xA;     pre.src-java:before  { content: 'Java'; }&#xA;     pre.src-sql:before   { content: 'SQL'; }&#xA;&#xA;     table { border-collapse:collapse; }&#xA;     caption.t-above { caption-side: top; }&#xA;     caption.t-bottom { caption-side: bottom; }&#xA;     td, th { vertical-align:top;  }&#xA;     th.org-right  { text-align: center;  }&#xA;     th.org-left   { text-align: center;   }&#xA;     th.org-center { text-align: center; }&#xA;     td.org-right  { text-align: right;  }&#xA;     td.org-left   { text-align: left;   }&#xA;     td.org-center { text-align: center; }&#xA;     dt { font-weight: bold; }&#xA;     .footpara { display: inline; }&#xA;     .footdef  { margin-bottom: 1em; }&#xA;     .figure { padding: 1em; }&#xA;     .figure p { text-align: center; }&#xA;     .inlinetask {&#xA;         padding: 10px;&#xA;         border: 2px solid gray;&#xA;         margin: 10px;&#xA;         background: #ffffcc;&#xA;     }&#xA;     #org-div-home-and-up&#xA;     { text-align: right; font-size: 70%; white-space: nowrap; }&#xA;     textarea { overflow-x: auto; }&#xA;     .linenr { font-size: smaller }&#xA;     .code-highlighted { background-color: #ffff00; }&#xA;     .org-info-js_info-navigation { border-style: none; }&#xA;     #org-info-js_console-label&#xA;     { font-size: 10px; font-weight: bold; white-space: nowrap; }&#xA;     .org-info-js_search-highlight&#xA;     { background-color: #ffff00; color: #000000; font-weight: bold; }&#xA;     /*]]&amp;gt;*/--&amp;gt;&#xA;    &amp;lt;/style&amp;gt;&#xA;    &amp;lt;/head&amp;gt;&#xA;    &amp;lt;body&amp;gt;&#xA;    &amp;lt;div id=&quot;content&quot;&amp;gt;&#xA;        &amp;lt;h1 class=&quot;title&quot;&amp;gt;Test&amp;lt;/h1&amp;gt;&#xA;        &amp;lt;p&amp;gt;&#xA;        Let's check the html output of this file.&#xA;        &amp;lt;/p&amp;gt;&#xA;&#xA;        &amp;lt;div class=&quot;org-src-container&quot;&amp;gt;&#xA;&#xA;        &amp;lt;pre class=&quot;src src-elisp&quot;&amp;gt;&amp;lt;span style=&quot;color: #268bd2;&quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;setq&amp;lt;/span&amp;gt; org-publish-project-alist&#xA;`&amp;lt;span style=&quot;color: #2aa198;&quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span style=&quot;color: #b58900;&quot;&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span style=&quot;color: #2aa198;&quot;&amp;gt;&quot;index&quot;&amp;lt;/span&amp;gt;&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:with-title&amp;lt;/span&amp;gt; nil &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:base-directory&amp;lt;/span&amp;gt; &amp;lt;span style=&quot;color: #2aa198;&quot;&amp;gt;&quot;~/website/org/&quot;&amp;lt;/span&amp;gt;&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:base-extension&amp;lt;/span&amp;gt; &amp;lt;span style=&quot;color: #2aa198;&quot;&amp;gt;&quot;org&quot;&amp;lt;/span&amp;gt; &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:publishing-directory&amp;lt;/span&amp;gt; &amp;lt;span style=&quot;color: #2aa198;&quot;&amp;gt;&quot;~/website/public/html/&quot;&amp;lt;/span&amp;gt;&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:headline-levels&amp;lt;/span&amp;gt; 3 &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:section-numbers&amp;lt;/span&amp;gt; nil&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:publishing-function&amp;lt;/span&amp;gt; org-html-publish-to-html &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:with-toc&amp;lt;/span&amp;gt; nil&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:html-head&amp;lt;/span&amp;gt; ,index-html-extra-head&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:html-head-include-default-style&amp;lt;/span&amp;gt; nil&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:html-head-include-scripts&amp;lt;/span&amp;gt; nil&#xA;            &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:html-preamble&amp;lt;/span&amp;gt; nil &amp;lt;span style=&quot;color: #859900;&quot;&amp;gt;:html-postamble&amp;lt;/span&amp;gt; t&amp;lt;span style=&quot;color: #b58900;&quot;&amp;gt;)&amp;lt;/span&amp;gt;&amp;lt;span style=&quot;color: #2aa198;&quot;&amp;gt;)&amp;lt;/span&amp;gt;&amp;lt;span style=&quot;color: #268bd2;&quot;&amp;gt;)&amp;lt;/span&amp;gt;&#xA;        &amp;lt;/pre&amp;gt;&#xA;        &amp;lt;/div&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;    &amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Emacs 25 with latest org-mode.&lt;/em&gt;&lt;br&gt;&#xA;How to get the indentation correctly?!&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2021-12-19T07:07:15.650" Title="Org-mode export to HTML - problem with indentation" Tags="|org-mode|org-export|html|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19663" PostTypeId="2" ParentId="19647" CreationDate="2016-01-18T23:48:18.683" Score="4" Body="&lt;p&gt;This might not be quite the answer you want, but use &lt;code&gt;printenv -0&lt;/code&gt; instead. This puts a &lt;code&gt;NUL&lt;/code&gt; between each &quot;line&quot; of output, which in this case will be between each var=value pair:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TMUX_PANE=%0^@test=foo&#xA;bar&#xA;baz&#xA;^@SHLVL=2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Parsing that will be much easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(split-string (shell-command-to-string &quot;printenv -0&quot;) &quot;\0&quot; t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9434" LastEditDate="2017-01-30T16:29:47.150" LastActivityDate="2017-01-30T16:29:47.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19664" PostTypeId="1" AcceptedAnswerId="21120" CreationDate="2016-01-19T00:55:37.880" Score="8" ViewCount="698" Body="&lt;p&gt;Is it possible to hide items with a certain tag after at specific time of the day?  For example, I'd like that after 5pm and on weekends, :WORK: items don't appear in the agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I am dealing with scheduled items and relying on org-agenda-list function.&lt;/p&gt;&#xA;" OwnerUserId="10821" LastEditorUserId="10821" LastEditDate="2016-01-19T16:20:01.813" LastActivityDate="2016-03-20T23:55:10.487" Title="Hide items with a certain tag in agenda based on time of day" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19666" PostTypeId="2" ParentId="19629" CreationDate="2016-01-19T03:52:20.113" Score="22" Body="&lt;p&gt;JeanPierre's answer will work fine if you want to use different word wrapping per type of document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;em&gt;all&lt;/em&gt; your documents word-wrapped, use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-visual-line-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your ~/.emacs or ~/.emacs.d/init.el file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize that value via the menus as well, by going to &quot;Options-&gt;Customize Emacs-&gt;All Settings Matching...&quot; and searching for &quot;visual.&quot;&lt;/p&gt;&#xA;" OwnerUserId="10824" LastActivityDate="2016-01-19T03:52:20.113" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19667" PostTypeId="1" CreationDate="2016-01-19T05:28:05.653" Score="2" ViewCount="239" Body="&lt;p&gt;When expanding a yasnippet snippet and filling out completion fields yanking/pasting inserts text correctly among fields as expected, but interrupts the snippet expansion behavior (as if pressing &lt;code&gt;C-g&lt;/code&gt; / calling &lt;code&gt;yas-abort-snippet&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;How can I yank content and continue with yasnippet expansion?&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;This appears to be a problem with yasnippet itself and the order of placeholder fields.  According to the &lt;a href=&quot;https://capitaomorte.github.io/yasnippet/snippet-development.html&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; I believe each of these forms are correct and should work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this is exceptional behavior and not universally broken yanking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Are these forms valid / Is this in fact a bug?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: work&#xA;# key: work_&#xA;# binding: direct-keybinding&#xA;# --&#xA;This works: ${1:someDefault}&#xA;$1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: nowork&#xA;# key: nowork_&#xA;# binding: direct-keybinding&#xA;# --&#xA;This does not work: $1&#xA;${1:someDefault}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(emacs 24.5.1; yasnippet version 20160104.129)&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-01-19T21:33:11.003" LastActivityDate="2016-05-18T23:35:20.777" Title="Yank during yas-expand without aborting expansion" Tags="|yasnippet|yank|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19669" PostTypeId="2" ParentId="19658" CreationDate="2016-01-19T07:51:24.720" Score="9" Body="&lt;p&gt;I don't if it is the case for you, but this error sometimes happens to people who use multiple versions of Emacs. When installing packages, Emacs also compiles them, but byte-compiled (.elc) files are not 100% compatible between different Emacs version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As stated in the &lt;a href=&quot;https://github.com/magit/magit/issues/1838#issuecomment-168253191&quot;&gt;last comment&lt;/a&gt; (by offby1) in the thread you linked, this particular error can happen when installing/compiling packages with Emacs 25, and later loading them with Emacs 24.5 or older.&#xA;To solve it, you need to recompile the offending files, and there are several ways to do it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;find the offending packages, delete their directories from your &lt;code&gt;elpa&lt;/code&gt; directory and let Spacemacs reinstall them. This is what @tarsius suggests in his answer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;find the offending packages and recompile them. Look for Emacs commands that have &quot;byte&quot; and &quot;compile&quot; in their names.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;recompile all the packages with the command &lt;code&gt;spacemacs/recompile-elpa&lt;/code&gt;, or with the command &lt;code&gt;byte-recompile-directory&lt;/code&gt;. Useful if you have many incompatible elc files, or if you don't want to bother pin-pointing the offending packages.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;wipe (or move out of the way) your entire &lt;code&gt;elpa&lt;/code&gt; directory and restart Emacs, Spacemacs will reinstall all the packages for you. This is a bit extreme and it takes a while to reinstall everything, so I don't recommend it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-01-19T07:51:24.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19670" PostTypeId="1" AcceptedAnswerId="19671" CreationDate="2016-01-19T08:52:45.413" Score="4" ViewCount="1382" Body="&lt;p&gt;In a normal emacs (not spacemacs), discard change is bound to key of &quot;k&quot;, then in spacemacs, base on the following information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION.html&quot; rel=&quot;nofollow&quot;&gt;http://spacemacs.org/doc/DOCUMENTATION.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, anything originally bound to k will be found on K, since k is reserved but K is not. If there is a binding on K, that will be moved to C-k.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I press K, it pops us a helm buffer to let me select a file to ingore in git.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2016-01-19T11:37:41.167" Title="how to discard a change in magit from spacemacs" Tags="|magit|spacemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19671" PostTypeId="2" ParentId="19670" CreationDate="2016-01-19T11:37:41.167" Score="8" Body="&lt;p&gt;Discard command is bound to &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check key bindings by &lt;code&gt;?&lt;/code&gt; in magit-status buffer as below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5LuSK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5LuSK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5415" LastActivityDate="2016-01-19T11:37:41.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19672" PostTypeId="1" AcceptedAnswerId="26662" CreationDate="2016-01-19T11:48:46.040" Score="12" ViewCount="1648" Body="&lt;p&gt;I am using gerrit. When I want to push my commits, I use following command:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git push origin HEAD:refs/for/master&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I recreate the same command using &lt;code&gt;Magit&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2020-05-02T11:05:57.707" Title="Magit + gerrit - push to other branch" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19673" PostTypeId="1" CreationDate="2016-01-19T12:24:54.270" Score="1" ViewCount="944" Body="&lt;p&gt;I've downloaded a copy of GUI emacs from &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and have been using it since then, but it crashes pretty often when I have 20+ frames opened. (I don't know if it's also the case for when there are just few frames.) I heard that if you use the version you have built from the source code, it rarely crashes. How can I do that for a GUI emacs? Can I build some source code? I tried the terminal version of emacs before, but I learned that there was no way to move the cursor with the simple left clicks in it (It bypasses the left clicks. I could option-click, though). I'd like to move the cursor with clicks kind of frequently, so it should be the GUI version.&lt;/p&gt;&#xA;&lt;p&gt;Mac OS X Mountain Lion, Emacs 24.5.9.0 (also crashes frequently in 24.4)&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-01-21T16:09:18.200" Title="How can I build a GUI emacs on OS X?" Tags="|osx|build|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19674" PostTypeId="2" ParentId="19673" CreationDate="2016-01-19T13:03:04.810" Score="7" Body="&lt;p&gt;You can easily build from source with &lt;a href=&quot;http://brew.sh&quot; rel=&quot;nofollow&quot;&gt;Homebrew&lt;/a&gt;.  Install Homebrew according to its installation instructions and then type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ brew install emacs --build-from-source --cocoa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to install the latest stable Emacs release from source.  &lt;code&gt;--cocoa&lt;/code&gt; enables the GUI version.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;However,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I heard that if you use the version you have built from the source code, it rarely crashes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;this is a myth and nonsense.  Emacs rarely crashes generally, whether you use a binary or build from source.  Building from source will not magically make Emacs more stable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frequent crashes of Emacs indicate a deeper problem on your system, such as corrupted memory.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2016-01-21T08:37:44.543" LastActivityDate="2016-01-21T08:37:44.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19675" PostTypeId="2" ParentId="13413" CreationDate="2016-01-19T14:18:40.143" Score="5" Body="&lt;p&gt;The error appears if you have an empty file or no file in place.&#xA;You need at least a header line in your dictionary file. &#xA;following the format &lt;/p&gt;&#xA;&#xA;&lt;p&gt;personal_ws-1.1 &lt;em&gt;lang&lt;/em&gt; num [encoding]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;personal_ws-1.1 en 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as described in &lt;a href=&quot;http://aspell.net/man-html/Format-of-the-Personal-and-Replacement-Dictionaries.html&quot; rel=&quot;noreferrer&quot;&gt;aspell documentation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also:&lt;a href=&quot;https://blog.samat.org/2008/11/02/creating-your-own-personal-aspell-dictionary/&quot; rel=&quot;noreferrer&quot;&gt;https://blog.samat.org/2008/11/02/creating-your-own-personal-aspell-dictionary/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2227" LastEditorUserId="2227" LastEditDate="2016-01-21T09:31:32.037" LastActivityDate="2016-01-21T09:31:32.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19676" PostTypeId="1" CreationDate="2016-01-19T14:27:29.390" Score="0" ViewCount="48" Body="&lt;p&gt;I would like to prettify \(A_i\) to A&lt;sub&gt;i&lt;/sub&gt;. Is this possible? I looked up the source of &lt;code&gt;org-match-substring-regexp&lt;/code&gt; and tried to modify it, but no luck. any help?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2016-01-19T14:35:43.157" LastActivityDate="2016-01-19T14:35:43.157" Title="Is this possible to prettify \(A_i\) to A_i (A&lt;sub&gt;i&lt;/sub&gt;) in org-mode?" Tags="|org-mode|text-properties|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19677" PostTypeId="2" ParentId="19647" CreationDate="2016-01-19T15:03:13.860" Score="1" Body="&lt;p&gt;I think db48x has the right answer for your underlying problem (without the -0 argument, printenv's output is ambiguous in case one of your env vars contains &lt;code&gt;...\nfoo=bar&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But as for how to do it in Elisp, I'd do it as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun parse-foo (str)&#xA;  (with-temp-buffer&#xA;    (insert str)&#xA;    (goto-char (point-min))&#xA;    (let ((start (point))&#xA;          (strs ()))&#xA;    (while (re-search-forward &quot;\n\\w+=&quot; nil 'move)&#xA;      (push (buffer-substring start (match-beginning 0)) strs)&#xA;      (setq start (1+ (match-beginning 0))))&#xA;    (cons (buffer-substring start (point)) strs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-19T15:03:13.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19678" PostTypeId="2" ParentId="19667" CreationDate="2016-01-19T15:03:35.860" Score="2" Body="&lt;p&gt;One thing that you could do (though in the example below, it would limit you to the most recent thing on the kill ring), is to use &lt;a href=&quot;https://capitaomorte.github.io/yasnippet/snippet-development.html#sec-3-2&quot; rel=&quot;nofollow&quot;&gt;elisp code embedded in your snippet&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: my-snippet&#xA;# key: foo&#xA;# binding: direct-keybinding&#xA;# --&#xA;Here is my text to yank: `(yank)`. And here is the rest: $1 $2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you expand the snippet, the most recent item on your kill-ring will actually be yanked in automatically, saving you the additional step of having to yank it your self. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after coming up with this example, I tried yanking as normal with &lt;code&gt;C-y&lt;/code&gt; during snippet expansion, and it works fine, i.e., I am able to yank, and then press &lt;code&gt;TAB&lt;/code&gt; to move to the next placeholder. I am even able to cycle through the kill-ring and yank older pieces of text without interrupting snippet expansion. If you have not updated yansippet recently, you might try doing that. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-19T15:03:35.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19679" PostTypeId="1" CreationDate="2016-01-19T15:50:29.697" Score="1" ViewCount="445" Body="&lt;p&gt;Vim has a plugin called &lt;a href=&quot;https://github.com/ervandew/supertab&quot; rel=&quot;nofollow&quot;&gt;SuperTab&lt;/a&gt; that uses the tab key to complete words in the current buffer (roughly speaking). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if a buffer's contents are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This buffer is for notes you don't want to save, and for Lisp evaluation.&#xA;;; If you want to create a file, visit that file with C-x C-f,&#xA;;; then enter the text in that file's own buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then typing &lt;code&gt;eval&lt;/code&gt; and then pressing tab will complete &lt;code&gt;eval&lt;/code&gt; to &lt;code&gt;evaluation&lt;/code&gt;, since the latter word is already in the buffer. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am looking for a emacs equivalent. I know of &lt;code&gt;hippie-expand&lt;/code&gt;, but I do not quite like its behavior; sometimes, instead of completing just a word, it will try to complete an entire line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching on the emacs-wiki, I found &lt;a href=&quot;https://github.com/genehack/smart-tab&quot; rel=&quot;nofollow&quot;&gt;smart-tab&lt;/a&gt;, which almost does what I want. The &lt;em&gt;only&lt;/em&gt; rub is that, in the example above, it will complete &lt;code&gt;eval&lt;/code&gt; to &lt;code&gt;evaluation.&lt;/code&gt; instead of &lt;code&gt;evaluation&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The question is the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is there a direct SuperTab equivalent for emacs that I haven't discovered?&lt;/li&gt;&#xA;&lt;li&gt;If not, is there a way to change smart-tab's behavior so that the extra period is not part of the completion? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="117" LastActivityDate="2016-03-16T01:18:42.053" Title="Vim's SuperTab for emacs" Tags="|completion|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19680" PostTypeId="1" AcceptedAnswerId="19681" CreationDate="2016-01-19T15:58:03.947" Score="4" ViewCount="394" Body="&lt;p&gt;If &lt;code&gt;test-string&lt;/code&gt; is defined like so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq test-string &quot;fooXbarXbazXextraYstuff&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the regexp &lt;code&gt;&quot;^[^XY]+X&quot;&lt;/code&gt; matches &lt;code&gt;test-string&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;^[^XY]+X&quot; test-string)&#xA;=&amp;gt; 0 (#o0, #x0, ?\C-@)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but the same regexp with grouping parentheses added no longer matches:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;^\([^XY]+X\)&quot; test-string)&#xA;=&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Simply adorable.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Given the behavior above, it is not surprising that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string &quot;^\([^XY]+X\)+&quot; &quot;&quot; test-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;evaluates to the original value of &lt;code&gt;test-string&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What regexp must I put in place of the &lt;code&gt;???&lt;/code&gt; below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string ??? &quot;&quot; test-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that the resulting value is the string &lt;code&gt;&quot;extraYstuff&quot;&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(BTW, I'd love to know the official/documented rationale for the behavior shown above, if there is one.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-01-22T05:53:46.720" LastActivityDate="2016-01-22T05:53:46.720" Title="Why does adding grouping parentheses cause a regexp to no longer match?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19681" PostTypeId="2" ParentId="19680" CreationDate="2016-01-19T16:01:46.637" Score="7" Body="&lt;p&gt;You need to escape the &lt;code&gt;\&lt;/code&gt; on your &lt;code&gt;\(...\)&lt;/code&gt; to read &lt;code&gt;\\(...\\)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;^\\([^XY]+X\\)&quot; &quot;fooXbarXbazXextraYstuff&quot;) ; =&amp;gt; 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-01-19T16:01:46.637" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19683" PostTypeId="1" CreationDate="2016-01-19T16:20:50.110" Score="1" ViewCount="83" Body="&lt;p&gt;I have defined an &lt;a href=&quot;http://orgmode.org/manual/Per_002dfile-keywords.html&quot; rel=&quot;nofollow&quot;&gt;additional TODO state&lt;/a&gt; in my org-mode file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SEQ_TODO: TODO(t) WAIT(w) HAZY(h) | DONE(d) FINE(f)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;DONE&lt;/code&gt; means &quot;I am ready&quot; and &lt;code&gt;FINE&lt;/code&gt; means &quot;It is accepted&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use hierarchical TODOs and &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;#&lt;/kbd&gt; to update the headlines. This is an example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** DONE [#1] Headline [3/4]&#xA;   SCHEDULED: &amp;lt;2016-01-11 Mo&amp;gt;&#xA;*** Description&#xA;*** FINE First task&#xA;    CLOSED: [2016-01-15 Fr 10:57]&#xA;*** FINE Second task&#xA;    CLOSED: [2016-01-15 Fr 15:33]&#xA;*** FINE Third task&#xA;    CLOSED: [2016-01-15 Fr 16:13]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I update the headline &lt;code&gt;org-update-statistics-cookies&lt;/code&gt; does not mark the headline as &lt;code&gt;FINE&lt;/code&gt;. Even worse: when I manually set the state of the headline to &lt;code&gt;FINE&lt;/code&gt; it gets changed back to &lt;code&gt;DONE&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intention is to mark the headline as &lt;code&gt;DONE&lt;/code&gt; as long as there is a child marked &lt;code&gt;DONE&lt;/code&gt; and if all children are marked with &lt;code&gt;FINE&lt;/code&gt; the parent should also marked as &lt;code&gt;FINE&lt;/code&gt;. Later on I want to define an agenda view containing everything but those marked as &lt;code&gt;FINE&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tired to find the right position in the source, but I am a bit lost. The function &lt;code&gt;org-update-statistics-cookies&lt;/code&gt; calls &lt;code&gt;org-update-parent-todo-statistics&lt;/code&gt; and I think this is a good candidate to cause the error, but I am not sure, because I still did not find the exact line where the &lt;code&gt;DONE&lt;/code&gt; gets written.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody help me to find it?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2016-01-19T16:20:50.110" Title="How to keep the right done tag while updating statistics?" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19684" PostTypeId="1" CreationDate="2016-01-19T16:24:41.573" Score="1" ViewCount="74" Body="&lt;p&gt;When I open commit buffer (pressing &lt;kbd&gt;c c&lt;/kbd&gt;), the pointer is shown in random locations instead of showing point at beginning of buffer. This is quite annoying as I have to manually move point every time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also checked this &lt;a href=&quot;http://magit.vc/manual/magit/Point-is-wrong-in-the-COMMIT_005fEDITMSG-buffer.html&quot; rel=&quot;nofollow&quot;&gt;FAQ in magit&lt;/a&gt; and added these to init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq session-name-disable-regexp &quot;\\(?:\\`'\\.git/[A-Z_]+\\'\\)&quot;)&#xA;&#xA;(with-eval-after-load 'pointback&#xA;  (lambda ()&#xA;     (when (or git-commit-mode git-rebase-mode)&#xA;     (pointback-mode -1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But still point is not getting restored. I even tried  this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun restore-point ()&#xA;   (interactive)&#xA;   (when (string-match &quot;.git/COMMIT_EDITMSG&quot; buffer-file-name)&#xA;      (goto-char (point-min))))&#xA;(add-hook 'git-commit-mode-hook 'restore-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still its not restoring. Any idea what might be going wrong here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit &lt;a href=&quot;https://github.com/ChillarAnand/.emacs.d/blob/master/init.el#L378-L397&quot; rel=&quot;nofollow&quot;&gt;config is here&lt;/a&gt; and &lt;a href=&quot;https://github.com/ChillarAnand/.emacs.d/blob/master/init.el&quot; rel=&quot;nofollow&quot;&gt;emacs config&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="306" LastEditDate="2016-08-31T10:57:31.443" LastActivityDate="2016-08-31T10:57:31.443" Title="Unable to restore point in magit commit buffer" Tags="|magit|point|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19685" PostTypeId="2" ParentId="19664" CreationDate="2016-01-19T16:33:31.070" Score="3" Body="&lt;p&gt;A very simple workaround would would be to make a special agenda view (or views) that you only use on evenings and weekends. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give a very simple example, you could customize &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; by adding something like &lt;code&gt;(&quot;x&quot; &quot;No Work&quot; tags-todo &quot;-work&quot; nil)&lt;/code&gt;. Then on evenings and weekends you can pull up your overall agenda view with &lt;kbd&gt;C-c a x&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2016-01-19T16:33:31.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19686" PostTypeId="1" AcceptedAnswerId="24502" CreationDate="2016-01-19T16:58:59.450" Score="31" ViewCount="39849" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;pdf-tools&lt;/a&gt; includes pdf-view-mode which offers several features not present in doc-view-mode (see end of question).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can pdf-view-mode be used as a replacement for doc-view-mode generally, or does it have to be &quot;tool&quot; by tool?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either case, is it necessary to edit emacs source to use pdf-tools in gnus, eww and orgmode or are their system-wide settings that can be employed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--- Features of pdf-tools here for convenience; see &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;github site&lt;/a&gt; for details ---&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Seems faster than doc-view&lt;/li&gt;&#xA;&lt;li&gt;Resolution usually better since not being rendered as a png&lt;/li&gt;&#xA;&lt;li&gt;Nice search, and can even search for all occurrences of a phrase&lt;/li&gt;&#xA;&lt;li&gt;Can add text annotations, and highlighting, underlining, and the like&lt;/li&gt;&#xA;&lt;li&gt;Can create imenus for pdf parts&lt;/li&gt;&#xA;&lt;li&gt;Can treat several pdfs as a single &quot;virtual&quot; pdf&lt;/li&gt;&#xA;&lt;li&gt;Can integrate with latex to see latex source and pdf side by side and jump from one to the other at the equivalent locations (e.g. select &lt;code&gt;\section{A section}&lt;/code&gt; in LaTeX and got that section in pdf.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8231" LastEditorUserId="8231" LastEditDate="2016-01-20T17:23:38.833" LastActivityDate="2020-06-10T13:47:17.840" Title="How to use pdf-tools (pdf-view-mode) in emacs?" Tags="|org-mode|gnus|pdf|pdf-tools|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19687" PostTypeId="1" CreationDate="2016-01-19T17:31:43.327" Score="1" ViewCount="51" Body="&lt;p&gt;I've bound the mouse-3 to a custom function, with a statement &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map [mouse-3] 'foobar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I revert some .org file, the keybinding of the mouse-3 goes back to the default and it displays the context menu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this problem every time I start up emacs too. The init file loads, but the mouse-3 won't run the custom function I assigned for the org-mode in org-mode buffers. And when I eval-buffer the init file, it gets fixed until I revert those buffers.&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-14T00:47:16.073" LastActivityDate="2016-04-13T00:51:53.777" Title="Org-mode default mouse-3 behavior overrides keybinding I've defined each time I revert a buffer" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19688" PostTypeId="2" ParentId="19687" CreationDate="2016-01-19T19:10:18.073" Score="-1" Body="&lt;p&gt;What is the value of variable &lt;code&gt;revert-buffer-function&lt;/code&gt;? If it doesn't do what you want, set the variable (in that mode) to your own function that does.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-19T19:10:18.073" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19689" PostTypeId="1" CreationDate="2016-01-19T20:34:58.667" Score="0" ViewCount="64" Body="&lt;p&gt;My yasnippet version is 0.8.0 and emacs is 25.0.50&#xA;I want to add a default value&#xA;And I use following code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: matrix&#xA;# key: y_ma&#xA;# binding: direct-keybinding&#xA;# --&#xA;&#xA;&#xA;\left ${1:[}&#xA;\begin{array}{${3:ccc}}&#xA;    $0  \\&#xA;\end{array}&#xA;\right$2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I use this code &#xA;it shows directly &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\left ${1:[}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\left [&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I change &lt;code&gt;\begin{array}{${3:ccc}}&lt;/code&gt; into &lt;code&gt;\begin{array}{${3:[}}&lt;/code&gt; for a test. It works&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2016-01-19T20:34:58.667" Title="A problem of first line of yasnippet" Tags="|yasnippet|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19690" PostTypeId="1" CreationDate="2016-01-19T23:13:42.717" Score="1" ViewCount="305" Body="&lt;p&gt;I want to see stack trace lines highlighted in GUD and have &lt;code&gt;next-error&lt;/code&gt; work there.  That works for me if, after starting GUD (via &lt;code&gt;M-x pdb&lt;/code&gt;) I enable &lt;code&gt;compilation-shell-minor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'pdb-mode-hook (lambda () (compilation-shell-minor-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when I run &lt;code&gt;M-x pdb&lt;/code&gt;, I get that minor mode enabled, but the matching error lines in the buffer don't get highlighted.  I then have to disable and re-enable the minor mode to get the highlighting back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure things so that the minor mode works fully as soon as I start GUD?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-01-19T23:13:42.717" Title="Enabling compilation-shell-minor-mode in GUD (for next-error)" Tags="|gud|compilation-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19692" PostTypeId="2" ParentId="19684" CreationDate="2016-01-20T00:40:01.927" Score="1" Body="&lt;p&gt;The snippet to turn off &lt;code&gt;pointback-mode&lt;/code&gt; from the FAQ misses a crucial part. Here's a fixed version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'pointback&#xA;  (add-hook 'git-commit-setup-hook&#xA;            (lambda ()&#xA;              (when (or git-commit-mode git-rebase-mode)&#xA;                (pointback-mode -1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'll update the FAQ later (after checking whether &lt;code&gt;pointback&lt;/code&gt; offers an option which would make that hack unnecessary.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-01-20T00:40:01.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19694" PostTypeId="1" AcceptedAnswerId="19718" CreationDate="2016-01-20T02:20:01.957" Score="6" ViewCount="1132" Body="&lt;p&gt;My understanding is if that I use any of &lt;code&gt;:commands&lt;/code&gt;, &lt;code&gt;:bind&lt;/code&gt;, &lt;code&gt;:bind*&lt;/code&gt;, &lt;code&gt;:bind-keymap&lt;/code&gt;, &lt;code&gt;:bind-keymap*&lt;/code&gt;, &lt;code&gt;:mode&lt;/code&gt;, or &lt;code&gt;:interpreter&lt;/code&gt;, then it will create a corresponding autoload and defer loading of the package until that autoload is triggered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm confused about the situations in which the package will load given that I don't use any of the above sections and I set it to &lt;code&gt;:defer t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see this in the readme:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Typically, you only need to specify &lt;code&gt;:defer&lt;/code&gt; if you know for a fact that some other package will do something to cause your package to load at the appropriate time, and thus you would like to defer loading even though use-package isn't creating any autoloads for you.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I know for a fact that package X has &quot;built-in&quot; autoloads (i.e. autoloads defined by the package author), then can I simply set &lt;code&gt;:defer t&lt;/code&gt; and rely on those to load the package at the appropriate time?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-01-20T19:10:21.703" Title="use-package :defer t and autoloads" Tags="|use-package|autoload|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19695" PostTypeId="1" AcceptedAnswerId="19719" CreationDate="2016-01-20T02:22:12.700" Score="4" ViewCount="1944" Body="&lt;p&gt;If I have something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package X&#xA;  :defer t&#xA;  (add-hook 'some-mode 'package-x-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will that work as expected given that I set &lt;code&gt;:defer t&lt;/code&gt; and the package &lt;em&gt;doesn't&lt;/em&gt; have any &quot;built-in&quot; autoloads and I'm not using any of the autoload-creating use-package functions? In other words, does registering a hook &lt;em&gt;alone&lt;/em&gt; take care of loading package X given that I set &lt;code&gt;:defer t&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what is the minimal additional configuration I require to make the hook work? Would I have to do something like &lt;code&gt;:commands package-x-function&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-01-20T19:28:29.703" Title="use-package :defer t and add-hook" Tags="|use-package|autoload|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19696" PostTypeId="1" AcceptedAnswerId="19841" CreationDate="2016-01-20T02:23:35.310" Score="5" ViewCount="531" Body="&lt;p&gt;I'm using Emacs to typeset a document which has English as its main language but which will use Hebrew and Greek as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see on my screenshot how the &lt;code&gt;\footnote&lt;/code&gt; command shows two open brackets as opposed to the correct open and close brackets.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;{\footnoteA{This is a Hebrew related footnote&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as opposed to the correct way&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\footnoteA{This is a Hebrew related footnote}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The end result however, on the PDF is correct.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/k8JNb.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/k8JNb.png&quot; alt=&quot;Incorrect handling of left-to-right text within a right-to-left paragraph&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a MWE:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{reledmac}&#xA;\usepackage{reledpar}&#xA;\usepackage{polyglossia}&#xA;\setmainlanguage{english}&#xA;\setotherlanguages{greek, hebrew}&#xA;\setmainfont{SBL BibLit}&#xA;\begin{document}&#xA;\begin{pairs}&#xA;\begin{Leftside}&#xA;\beginnumbering&#xA;\begin{hebrew}&#xA;  \pstart&#xA;&#xA;בְּרֵאשִׁ֖ית\footnoteA{This is a Hebrew related footnote} בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃&#xA;&#xA;  \pend&#xA;\end{hebrew}&#xA;\endnumbering&#xA;\end{Leftside}&#xA;\begin{Rightside}&#xA;\beginnumbering&#xA;\begin{greek}&#xA;  \pstart&#xA;  Ἐν ἀρχῇ\footnoteA{This is a Greek related footnote} ἐποίησεν ὁ&#xA;  θεὸς τὸν οὐρανὸν καὶ τὴν γῆν.&#xA;  \pend&#xA;\end{greek}&#xA;\endnumbering&#xA;\end{Rightside}&#xA;\end{pairs}&#xA;\Column&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note how the text a line of Hebrew with mixed English characters is rendered correctly when edited using TextEdit (i.e. test editor that comes with MacOS)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ze81K.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ze81K.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="10832" LastEditorUserId="10832" LastEditDate="2016-01-22T11:52:45.290" LastActivityDate="2016-01-26T11:06:30.737" Title="Handling left-to-right inside right-to-left paragraphs using Emacs and AUCTeX" Tags="|latex|auctex|right-to-left|bidirectional-support|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19697" PostTypeId="1" AcceptedAnswerId="19727" CreationDate="2016-01-20T02:23:56.007" Score="3" ViewCount="79" Body="&lt;p&gt;Do I have to worry about a package's built-in autoloads somehow conflicting with those implicitly defined by use-package? For example if I do &lt;code&gt;:commands some-cmd&lt;/code&gt; but the package already had an autoload created for &lt;code&gt;some-cmd&lt;/code&gt;, will there be any problems?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-01-20T22:30:10.807" Title="are there conflicts between use-package and a package's autoloads?" Tags="|use-package|autoload|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19698" PostTypeId="1" CreationDate="2016-01-20T02:29:30.937" Score="5" ViewCount="390" Body="&lt;p&gt;I saw that use-package has an &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/use-package.el#L1055-L1056&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;:after&lt;/code&gt;&lt;/a&gt; section that can be used, which:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Defer loading of a package until after any of the named features are loaded.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The wording uses &quot;any&quot; instead of &quot;all&quot;, so would that mean that if I set something like &lt;code&gt;:after one two three&lt;/code&gt;, it will start loading even if only &lt;code&gt;one&lt;/code&gt; is loaded but not &lt;code&gt;two&lt;/code&gt; and &lt;code&gt;three&lt;/code&gt;? The &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/use-package.el#L870-L878&quot; rel=&quot;noreferrer&quot;&gt;source&lt;/a&gt; seems to show that this is the case, but I'm not entirely sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this &lt;em&gt;is&lt;/em&gt; the case, though, what is the point of specifying more than one feature? Wouldn't it be preferable to defer until &lt;em&gt;all&lt;/em&gt; of the specified features are loaded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have trouble envisioning a scenario in which it would be useful to defer a package until &lt;em&gt;any&lt;/em&gt; of the specified features is loaded. Perhaps I'm misunderstanding the purpose of &lt;code&gt;:after&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-01-20T02:29:30.937" Title="use-package's :after directive" Tags="|use-package|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19699" PostTypeId="1" AcceptedAnswerId="19729" CreationDate="2016-01-20T02:34:02.310" Score="11" ViewCount="3086" Body="&lt;p&gt;If my &lt;code&gt;:config&lt;/code&gt; section is entirely wrapped in &lt;code&gt;with-eval-after-load&lt;/code&gt;, is that equivalent to simply specifying an &lt;code&gt;:after&lt;/code&gt; directive? That is, can I replace this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company-tern&#xA;  :config&#xA;  (with-eval-after-load 'company&#xA;    (add-to-list 'company-backends 'company-tern)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company-tern&#xA;  :after company&#xA;  :config&#xA;  (add-to-list 'company-backends 'company-tern))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I correct in my understanding that if there is other configuration that &lt;em&gt;isn't&lt;/em&gt; inside of the &lt;code&gt;with-eval-after-load&lt;/code&gt; then it wouldn't be useful to replace it with an &lt;code&gt;:after&lt;/code&gt; directive since that would defer the loading of the &lt;em&gt;entire&lt;/em&gt; package just for the subset of the configuration that depends on the feature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should note, in the above situation it seems simple enough to just nest &lt;code&gt;company-tern&lt;/code&gt;'s use-package under &lt;code&gt;company&lt;/code&gt;'s &lt;code&gt;:config&lt;/code&gt; section, since they're logically related. However, my question is for the more general case where the &quot;dependency&quot; doesn't necessarily have a logical connection, or when there is more than one &quot;dependency.&quot;&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="105" LastEditDate="2018-12-24T16:50:52.557" LastActivityDate="2018-12-24T16:50:52.557" Title="use-package: Can :after be used instead of with-eval-after-load?" Tags="|use-package|eval-after-load|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19700" PostTypeId="1" AcceptedAnswerId="19730" CreationDate="2016-01-20T02:35:27.073" Score="6" ViewCount="996" Body="&lt;p&gt;I found that there's a &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/use-package.el#L115&quot;&gt;&lt;code&gt;:requires&lt;/code&gt;&lt;/a&gt; (&lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/use-package.el#L513&quot;&gt;source&lt;/a&gt;) section, but I'm not quite sure what it does and there doesn't seem to be any documentation on it. Can someone explain what it does?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2021-02-18T04:53:14.583" Title="use-package :requires explanation" Tags="|use-package|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19701" PostTypeId="1" CreationDate="2016-01-20T07:17:17.313" Score="3" ViewCount="354" Body="&lt;p&gt;So, you would be able to setup it like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA;  one-line-comment &quot;//&quot;&#xA;  multi-line-comment-start &quot;/*&quot;&#xA;  multi-line-comment-end &quot;*/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And use one command to comment anything. If nothing is selected it would comment one line otherwise it would use multi line comment. And most important if you inside a comment it would uncomment both types of comments. I know about &lt;code&gt;newcomment.el&lt;/code&gt; but I cannot figure out if it's possible to configure it in such way, especially for uncommenting multi line comments.&lt;/p&gt;&#xA;" OwnerUserId="10526" LastEditorUserId="10526" LastEditDate="2016-01-20T12:27:53.733" LastActivityDate="2016-01-22T05:49:10.517" Title="Is there a package for supporting two types of comments?" Tags="|comment|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19702" PostTypeId="1" AcceptedAnswerId="19754" CreationDate="2016-01-20T08:03:26.863" Score="3" ViewCount="240" Body="&lt;p&gt;I set break-point in function&#xA;&lt;code&gt;&#xA;(add-hook 'c-mode-common-hook&#xA;      (function&#xA;       (lambda nil &#xA;         (if (or (string-match &quot;llvm&quot; buffer-file-name)&#xA;             (string-match &quot;nvvm&quot; buffer-file-name))&#xA;         (progn&#xA;           (c-set-style &quot;llvm.org&quot;))))))&#xA;&lt;/code&gt;&#xA;I am unable to remove the break-point. This code fragment is in &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="6702" LastEditorUserId="105" LastEditDate="2016-03-14T00:46:54.917" LastActivityDate="2016-03-14T00:46:54.917" Title="Delete breakpoint set using edebug-defun" Tags="|debugging|edebug|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19703" PostTypeId="1" AcceptedAnswerId="19752" CreationDate="2016-01-20T08:25:07.107" Score="3" ViewCount="413" Body="&lt;p&gt;I have a elisp program which check server in a endless loop, like&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(while t&#xA;  (let ((status (check-server)))&#xA;     (case status&#xA;        ...)&#xA;     (sleep-for 100))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to debug or update code in ielm, like &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(print status)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun check-server ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However when I run it, I can't enter any code in ielm. Is there a method to finish my purpose?&lt;/p&gt;&#xA;" OwnerUserId="5292" LastEditorUserId="675" LastEditDate="2016-07-13T20:08:11.647" LastActivityDate="2016-07-13T20:08:11.647" Title="How to debug elisp code when it is running" Tags="|debugging|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19705" PostTypeId="1" AcceptedAnswerId="19715" CreationDate="2016-01-20T11:17:12.133" Score="5" ViewCount="1230" Body="&lt;p&gt;I can't remember since when exactly, but Emacs is getting slow with basic operations (moving cursor around). It's not exactly slow, but feeling laggy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before I try and halven my configuration files step by step as suggested in many places, I was wondering if there was another way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what &lt;code&gt;profiler-report&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;- ...                                   433  36%&#xA;   Automatic GC                         406  34%&#xA; + helm-check-minibuffer-input           22   1%&#xA; + company--perform                       3   0%&#xA; + byte-compile-let                       1   0%&#xA; + sp-skip-closing-pair                   1   0%&#xA;- command-execute                       426  36%&#xA; - call-interactively                   426  36%&#xA;  + helm-M-x                            287  24%&#xA;  + next-line                           103   8%&#xA;  + previous-line                        16   1%&#xA;  + save-buffer                          10   0%&#xA;  + kill-ring-save                        3   0%&#xA;  + windmove-up                           3   0%&#xA;  + windmove-down                         2   0%&#xA;  + yank                                  1   0%&#xA;  + self-insert-command                   1   0%&#xA;- timer-event-handler                   153  13%&#xA; - byte-code                            148  12%&#xA;  - apply                               148  12%&#xA;   + mouse-avoidance-fancy              112   9%&#xA;   + auto-revert-buffers                 21   1%&#xA;   + hl-paren-highlight                   4   0%&#xA;   + #&amp;lt;lambda 0x72a5c9c7f6e60&amp;gt;            1   0%&#xA;     jit-lock-context-fontify             1   0%&#xA;   + blink-cursor-start                   1   0%&#xA;   + company-echo-show                    1   0%&#xA; + timer-activate-when-idle               2   0%&#xA; + timer-inc-time                         2   0%&#xA;+ redisplay_internal (C function)        87   7%&#xA;+ delete-selection-pre-hook              45   3%&#xA;+ flycheck-error-list-highlight-errors   19   1%&#xA;  x-set-selection                         5   0%&#xA;+ deactivate-mark                         2   0%&#xA;+ flycheck-display-error-at-point-soon    2   0%&#xA;+ yas--post-command-handler               1   0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't really identify what gives me that laggy feel, especially since I am merely moving point around.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-01-20T16:47:44.800" Title="How to better debug Emacs CPU management?" Tags="|debugging|profiler|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19706" PostTypeId="1" CreationDate="2016-01-20T11:56:31.703" Score="2" ViewCount="189" Body="&lt;p&gt;I'm writing an org-mode document where I want to mark up only part of a single word; for example, I might want some&lt;em&gt;thing&lt;/em&gt; like these &lt;code&gt;example&lt;/code&gt;s, which were generated by the Markdown &lt;code&gt;some*thing* like these `example`s&lt;/code&gt;.  The analogous org-mode code, however, doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some/thing/ like these ~example~s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;syntax highlights/exports (or rather, doesn't) as&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;some/thing/ like these ~example~s&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I get org-mode to produce the appropriate syntax highlighting/exported output, namely&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;some&lt;em&gt;/thing/&lt;/em&gt; like these &lt;code&gt;~example~&lt;/code&gt;s&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;?  (Dropping the &quot;/&quot; and &quot;~&quot; in exported content, of course.)&lt;/p&gt;&#xA;" OwnerUserId="5295" LastEditorUserId="5295" LastEditDate="2016-01-20T13:05:23.870" LastActivityDate="2016-01-20T13:05:23.870" Title="Sub-word formatting in org-mode" Tags="|org-mode|org-export|syntax-highlighting|" AnswerCount="1" CommentCount="0" ClosedDate="2016-01-21T03:23:38.600" ContentLicense="CC BY-SA 3.0" />
  <row Id="19707" PostTypeId="2" ParentId="19706" CreationDate="2016-01-20T12:18:57.477" Score="1" Body="&lt;p&gt;There is no way to do that. You can work around it for HTML export like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Some@@html:&amp;lt;i&amp;gt;thing&amp;lt;/i&amp;gt;@@ else&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; After further investigation, you should see &lt;a href=&quot;https://stackoverflow.com/a/24540651/5747548&quot;&gt;this answer&lt;/a&gt; on StackOverflow.&lt;/p&gt;&#xA;" OwnerUserId="10734" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-01-20T12:18:57.477" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19710" PostTypeId="1" CreationDate="2016-01-20T13:39:52.223" Score="6" ViewCount="281" Body="&lt;p&gt;Because of some difficulties in getting Emacs interact correctly with the &lt;code&gt;fcitx&lt;/code&gt; input framework on my Ubuntu, I have to use built-in input methods in Emacs. However, I haven't been able to find a way to see the character mapping for each input method that is there. For example, I couldn't find a way to enter &lt;code&gt;ñ&lt;/code&gt; in Spanish (input method &lt;code&gt;spanish-prefix&lt;/code&gt;), or &lt;code&gt;'&lt;/code&gt; in German (input method &lt;code&gt;german&lt;/code&gt;), in my US keyboard. How can I view the character mapping with respect to the current keyboard?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2016-01-20T13:39:52.223" Title="Where can I see the character mapping of an input method?" Tags="|input-method|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19711" PostTypeId="2" ParentId="19701" CreationDate="2016-01-20T14:46:33.717" Score="3" Body="&lt;p&gt;You don't need a special package for this. Emacs offers such a feature out of the box.  And as @ais indicated in a comment, it is available to use for any mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html&quot; rel=&quot;nofollow&quot;&gt;Syntax Class Table&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Comment starters: ‘&amp;lt;’&#xA;Comment enders: ‘&amp;gt;’&#xA; Characters used in various languages to delimit comments.  Human&#xA; text has no comment characters.  In Lisp, the semicolon (‘;’)&#xA; starts a comment and a newline or formfeed ends one.&#xA;&#xA;Generic comment delimiters: ‘!’&#xA; Characters that start or end a special kind of comment.  _Any_&#xA; generic comment delimiter matches _any_ generic comment delimiter,&#xA; but they cannot match a comment starter or comment ender; generic&#xA; comment delimiters can only match each other.&#xA;&#xA; This syntax class is primarily meant for use with the&#xA; ‘syntax-table’ text property (*note Syntax Properties::).  You can&#xA; mark any range of characters as forming a comment, by giving the&#xA; first and last characters of the range ‘syntax-table’ properties&#xA; identifying them as generic comment delimiters.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and more particularly node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Flags.html&quot; rel=&quot;nofollow&quot;&gt;Syntax Flags&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See how it is done for C code, for example, by checking the Lisp sources.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-01-22T05:49:10.517" LastActivityDate="2016-01-22T05:49:10.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19712" PostTypeId="2" ParentId="19701" CreationDate="2016-01-20T15:00:10.787" Score="0" Body="&lt;p&gt;Here is a solution that I came up with to comment the way I like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comment-or-uncomment-line-or-region ()&#xA;  &quot;Comments or uncomments the current line or region.&quot;&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (comment-or-uncomment-region (region-beginning) (region-end))&#xA;    (if (save-excursion (beginning-of-line) (looking-at &quot;[[:space:]]*$&quot;))&#xA;        (comment-dwim nil)&#xA;      (comment-or-uncomment-region (line-beginning-position) (line-end-position)))))&#xA;&#xA;(global-set-key (kbd &quot;M-;&quot;) 'comment-or-uncomment-line-or-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should do everything the way you want, except that multi line comments are formatted as multiple single line comments. If want a package instead of a home-grown function, you can try the &lt;a href=&quot;https://github.com/remyferre/comment-dwim-2&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;comment-dwim-2&lt;/code&gt; package&lt;/a&gt;, but it seems like this does more or less the same thing my function does. Also, see the various answers and links in &lt;a href=&quot;https://stackoverflow.com/questions/499206/emacs-mode-multiline-comments&quot;&gt;this question&lt;/a&gt; which discusses multi line comments.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-01-20T15:00:10.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19713" PostTypeId="1" AcceptedAnswerId="19714" CreationDate="2016-01-20T15:51:20.113" Score="6" ViewCount="1689" Body="&lt;p&gt;I looked around, but I couldn't find any answer in the documentation of&#xA;        &lt;code&gt;recentf&lt;/code&gt; and with &lt;kbd&gt;C-h v&lt;/kbd&gt; &lt;code&gt;recent&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My default directory is set with the following:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-emacs-directory &quot;~/home/ReneFroger/&quot;&#xA;       default-directory &quot;~/home/ReneFroger/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I noticed Emacs saves the recent files that I have visited in the file&#xA;&lt;code&gt;recentf&lt;/code&gt;, which will be stored in the &lt;code&gt;home/ReneFroger/&lt;/code&gt; path. &#xA;I would like to change the location of &lt;code&gt;recentf&lt;/code&gt; but I can't find any variable&#xA;that allows me to do this. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorDisplayName="user227" LastEditDate="2016-01-20T17:39:04.063" LastActivityDate="2021-03-27T17:11:26.447" Title="How change the storage location of recentf file?" Tags="|recentf|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19714" PostTypeId="2" ParentId="19713" CreationDate="2016-01-20T16:20:22.707" Score="10" Body="&lt;p&gt;You can set it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq recentf-save-file (expand-file-name &quot;recentf&quot; &amp;lt;other-directory&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can usually find settings like this by looking at the help for one of the functions, e.g. &lt;code&gt;recentf-mode&lt;/code&gt;, then following the link to the source code, and then doing &lt;code&gt;occur&lt;/code&gt; for &lt;code&gt;defcustom&lt;/code&gt; to find one that looks like it might be a file storage location - e.g. in this case you'd get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 23 matches for &quot;defcustom&quot; in buffer: recentf.el&#xA; 65:(defcustom recentf-max-saved-items 20&#xA; 72:(defcustom recentf-save-file (locate-user-emacs-file &quot;recentf&quot; &quot;.recentf&quot;)&#xA; 85:(defcustom recentf-save-file-modes 384 ;; 0600&#xA; 94:(defcustom recentf-exclude nil&#xA;111:(defcustom recentf-keep&#xA;etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2462" LastActivityDate="2016-01-20T16:20:22.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19715" PostTypeId="2" ParentId="19705" CreationDate="2016-01-20T16:47:44.800" Score="2" Body="&lt;p&gt;Something you might try is increasing &lt;code&gt;gc-cons-threshold&lt;/code&gt; - with packages like helm, they need more memory or might get slowed down - note that the garbage collector and helm take up most of your CPU time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you set it too high, Emacs would freeze for some seconds when it finally garbage collects. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default is 800kb - Spacemacs uses 100mb, so that's what I've been using - &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gc-cons-threshold 100000000) ; ie 100mb, default is 800kb&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/41m7x3/why_are_you_changing_gcconsthreshold/&quot; rel=&quot;nofollow&quot;&gt;https://www.reddit.com/r/emacs/comments/41m7x3/why_are_you_changing_gcconsthreshold/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2462" LastActivityDate="2016-01-20T16:47:44.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19716" PostTypeId="1" AcceptedAnswerId="19740" CreationDate="2016-01-20T17:32:47.777" Score="2" ViewCount="892" Body="&lt;p&gt;I like my Emacs to reopen all previously opened files when I start it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My setup is simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; save desktop autosave sessions&#xA;(setq desktop-dirname             &quot;~/&quot;&#xA;      desktop-base-file-name      &quot;.emacs.desktop&quot;&#xA;      desktop-base-lock-name      &quot;lock&quot;&#xA;      desktop-path                (list desktop-dirname)&#xA;      desktop-save                t&#xA;      desktop-files-not-to-save   &quot;^$&quot; ;reload tramp paths&#xA;      desktop-load-locked-desktop nil)&#xA;(desktop-save-mode 1)&#xA;(setq desktop-restore-frames t)&#xA;(setq desktop-restore-in-current-display t)&#xA;(setq desktop-restore-forces-onscreen nil)&#xA;&#xA;;; measured in autosave cycles&#xA;(setq desktop-recover-save-period 1)&#xA;&#xA;;; ; if idle s save&#xA;(run-with-idle-timer 60.0 t 'desktop-save-in-desktop-dir)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that after startup, the .emacs.desktop file is not reloaded - the only thing reopened is the buffer that was active when I quit emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The .emacs.desktop was correctly saved in the previous session (every 60s of idle time as per my setup) and the file looks ok to me... I can't reload it with &lt;code&gt;desktop-read&lt;/code&gt; either I get this error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;desktop-create-buffer: Wrong number of arguments: #[(beg end length)&#xA;  &quot;è         è Æ=MÇ È!.GÉV.ÊË!.ËÉH!?IÌÍ#Æ=I&#xA;  ÉUI67ZÎU)Y89zÏ)e Ð=e Ñ=¦7eVè7SfzÏèÒvÓ&#xA;  :Ô&lt;code&gt;;ÕÖxÉW²×Ø!ÉW²&lt;/code&gt;&amp;lt;Ö=&gt;ÞÖ?;bÙÚÛÜ&gt;Ý#ÞQ!)ÞÎÎ{=&gt;?£ß&#xA;  àá=&gt;âÜãä&amp;amp;Í#£?&lt;em&gt;)£Ö?;bÙë!)£Í=ìíîÉÉ{\&quot;!ïð!£ß&#xA;  ;bñÎ!.Eè ò=½ ÉUè Í=è7bÓ&#xA;  :óôõ6Í#çÆÉfF8ÀÉÉÉ#+È+&quot; [auto-capitalize&#xA;  auto-capitalize-predicate this-command key global-map length&#xA;  self-insert-command this-command-keys vectorp 0 ...] 9&#xA;  (&quot;/home/rxs/.emacs.d/elpa/auto-capitalize-20131013.2205/auto-capitalize.elc&quot;&#xA;  . 3420)], 1 desktop-create-buffer: Wrong number of arguments: #[(beg&#xA;  end length) &quot;è         è Æ=MÇ&#xA;  È!.GÉV.ÊË!.ËÉH!?IÌÍ#Æ=I ÉUI67ZÎU)Y89zÏ)e&#xA;  Ð=e Ñ=¦7eVè7SfzÏèÒvÓ&#xA;  :Ô&lt;code&gt;;ÕÖxÉW²×Ø!ÉW²&lt;/code&gt;&amp;lt;Ö=&gt;ÞÖ?;bÙÚÛÜ&gt;Ý#ÞQ!)ÞÎÎ{=&gt;?£ß&#xA;  àá=&gt;âÜãä&amp;amp;Í#£?&lt;/em&gt;)£Ö?;bÙë!)£Í=ìíîÉÉ{\&quot;!ïð!£ß&#xA;  ;bñÎ!.Eè ò=½ ÉUè Í=è7bÓ&#xA;  :óôõ6Í#çÆÉfF8ÀÉÉÉ#+È+&quot; [auto-capitalize&#xA;  auto-capitalize-predicate this-command key global-map length&#xA;  self-insert-command this-command-keys vectorp 0 ...] 9&#xA;  (&quot;/home/rxs/.emacs.d/elpa/auto-capitalize-20131013.2205/auto-capitalize.elc&quot;&#xA;  . 3420)], 1&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My .emacs.desktop file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- mode: emacs-lisp; coding: emacs-mule; -*-&#xA;;; --------------------------------------------------------------------------&#xA;;; Desktop File for Emacs&#xA;;; --------------------------------------------------------------------------&#xA;;; Created Thu Jan 21 11:26:04 2016&#xA;;; Desktop file format version 206&#xA;;; Emacs version 24.5.1&#xA;&#xA;;; Global section:&#xA;(setq desktop-saved-frameset [frameset 1 (22176 45628 743516 309000) (desktop . &quot;206&quot;) &quot;rxs@localhost.localdomain&quot; nil nil ((((font-backend xft x) (font . &quot;-unknown-Liberation Mono-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1&quot;) (font-parameter) (border-width . 0) (internal-border-width . 1) (right-divider-width . 0) (bottom-divider-width . 0) (vertical-scroll-bars) (foreground-color . &quot;#f8f8f8&quot;) (background-color . &quot;#26292c&quot;) (mouse-color . &quot;black&quot;) (border-color . &quot;black&quot;) (screen-gamma) (line-spacing) (left-fringe . 10) (right-fringe . 11) (scroll-bar-foreground) (scroll-bar-background . &quot;grey75&quot;) (menu-bar-lines . 0) (tool-bar-lines . 0) (title) (wait-for-wm . t) (fullscreen) (tool-bar-position . top) (icon-type . t) (auto-raise) (auto-lower) (cursor-type . box) (scroll-bar-width . 0) (alpha) (horizontal-scroll-bars . t) (display-type . color) (background-mode . dark) (cursor-color . &quot;brown3&quot;) (environment) (powerline-cache) (frameset--id . &quot;1A06-6A10-F26F-68FD&quot;) (frameset--mini t . t) (height . 55) (width . 179) (modeline . t) (minibuffer . t) (unsplittable) (left . 0) (top . 0) (icon-name) (visibility . t) (display . &quot;:0&quot;) (explicit-name)) ((min-height . 4) (min-width . 10) (min-height-ignore . 2) (min-width-ignore . 5) (min-height-safe . 1) (min-width-safe . 2) (min-pixel-height . 56) (min-pixel-width . 70) (min-pixel-height-ignore . 28) (min-pixel-width-ignore . 35) (min-pixel-height-safe . 14) (min-pixel-width-safe . 14)) leaf (pixel-width . 1276) (pixel-height . 762) (total-width . 182) (total-height . 54) (normal-height . 1.0) (normal-width . 1.0) (buffer &quot;org-wiki.org&quot; (selected . t) (hscroll . 0) (fringes 10 11 nil) (margins 3) (scroll-bars 0 0 t nil) (vscroll . 0) (dedicated) (point . 24576) (start . 1))))])&#xA;(setq desktop-missing-file-warning nil)&#xA;(setq tags-file-name nil)&#xA;(setq tags-table-list nil)&#xA;(setq search-ring '(&quot;ohio&quot; &quot;q&quot; &quot;someb&quot; &quot;revie&quot; &quot;exp&quot; &quot;grow&quot; &quot;goals&quot; &quot;make&quot; &quot;agile&quot;))&#xA;(setq regexp-search-ring nil)&#xA;(setq register-alist '((48 . &quot;&quot;)))&#xA;(setq file-name-history '(&quot;/home/rxs/org/wiki/org-wiki.org&quot; &quot;/home/rxs/org/agenda.org&quot; &quot;/home/rxs/.emacs.desktop&quot;))&#xA;&#xA;;; Buffer section -- buffers listed in same order as in buffer list:&#xA;(desktop-create-buffer 206&#xA;  &quot;/home/rxs/org/wiki/org-wiki.org&quot;&#xA;  &quot;org-wiki.org&quot;&#xA;  'org-mode&#xA;  '(rsk-minor-mode override-global-mode auto-compile-on-load-mode auto-capitalize which-key-mode beacon-mode modalka-mode helm-mode company-mode ivy-mode yas-minor-mode smartparens-mode)&#xA;  24576&#xA;  '(nil nil)&#xA;  nil&#xA;  nil&#xA;  '((buffer-file-coding-system . utf-8-unix) (truncate-lines . t)))&#xA;&#xA;(desktop-create-buffer 206&#xA;  &quot;/home/rxs/org/agenda.org&quot;&#xA;  &quot;agenda.org&quot;&#xA;  'org-mode&#xA;  '(rsk-minor-mode override-global-mode auto-compile-on-load-mode auto-capitalize which-key-mode beacon-mode modalka-mode helm-mode company-mode ivy-mode yas-minor-mode smartparens-mode)&#xA;  1&#xA;  '(nil nil)&#xA;  nil&#xA;  nil&#xA;  '((buffer-file-coding-system . utf-8-unix) (truncate-lines . t)))&#xA;&#xA;(desktop-create-buffer 206&#xA;  &quot;/home/rxs/.emacs.desktop&quot;&#xA;  &quot;.emacs.desktop&quot;&#xA;  'emacs-lisp-mode&#xA;  '(rsk-minor-mode override-global-mode auto-compile-on-load-mode which-key-mode beacon-mode modalka-mode helm-mode company-mode ivy-mode yas-minor-mode smartparens-mode)&#xA;  4510&#xA;  '(1 nil)&#xA;  nil&#xA;  nil&#xA;  '((buffer-file-coding-system . emacs-mule-unix)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5237" LastEditorUserId="5237" LastEditDate="2016-01-21T10:36:09.963" LastActivityDate="2017-12-01T06:21:30.087" Title="Error on reopening files from previous session via desktop-save-mode" Tags="|start-up|session|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19717" PostTypeId="1" AcceptedAnswerId="19720" CreationDate="2016-01-20T19:01:45.570" Score="2" ViewCount="439" Body="&lt;p&gt;I've just installed 24.5 on SUSE, and I have no windowing available, so I am using emacs in the terminal window. When I choose 'Read the Emacs Manual' from the 'Help' Menu, I see (for example) &quot;type \u2018h\u2019 to read a basic introduction&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://emacs.stackexchange.com/questions/10223/how-to-display-unicode-utf-8-as-unicode&quot;&gt;other answers related to this topic&lt;/a&gt; seem to indicate the problem is with how the file is loaded. But, since this is the help, I don't have any obvious way to affect that. I can mostly not care about this, but it does make reading the help very difficult.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any insight into what configuration changes are necessary?&lt;/p&gt;&#xA;" OwnerUserId="10835" LastActivityDate="2016-01-21T02:42:45.780" Title="How to fix UTF-8 in info buffer that doesn't correctly display in terminal?" Tags="|utf-8|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19718" PostTypeId="2" ParentId="19694" CreationDate="2016-01-20T19:10:21.703" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;If I know for a fact that package X has &quot;built-in&quot; autoloads (i.e. autoloads defined by the package author), then can I simply set &lt;code&gt;:defer t&lt;/code&gt; and rely on those to load the package at the appropriate time?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, that's exactly what that means.  Similarly, you can also use &lt;code&gt;:defer t&lt;/code&gt; in place of something like &lt;code&gt;:mode&lt;/code&gt; or &lt;code&gt;:interpreter&lt;/code&gt; if the package already handles its &lt;code&gt;auto-mode-alist&lt;/code&gt; or &lt;code&gt;interpreter-mode-alist&lt;/code&gt; assignments correctly.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-20T19:10:21.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19719" PostTypeId="2" ParentId="19695" CreationDate="2016-01-20T19:28:29.703" Score="5" Body="&lt;p&gt;I think this should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package X&#xA;  :commands package-x-function&#xA;  :init&#xA;  (add-hook 'some-mode 'package-x-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:commands&lt;/code&gt; directive will generate an autoload for &lt;code&gt;package-x-function&lt;/code&gt;, and the &lt;code&gt;:init&lt;/code&gt; directive will immediately add it to the hook.  Because &lt;code&gt;:commands&lt;/code&gt; implies &lt;code&gt;:defer&lt;/code&gt;, the package won't be loaded immediately.  When the hook is run, the autoload will be looked up and the package will be loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you left off the &lt;code&gt;:commands&lt;/code&gt; part, then you'd get a &lt;code&gt;void-function&lt;/code&gt; error when the hook is run, because Emacs won't have a definition for &lt;code&gt;package-x-function&lt;/code&gt; and there's no autoload to tell it how to get one.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-20T19:28:29.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19720" PostTypeId="2" ParentId="19717" CreationDate="2016-01-20T19:30:57.187" Score="2" Body="&lt;p&gt;You can set the coding system that your terminal uses by adding the following to your init file: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(set-terminal-coding-system 'utf-8)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;utf-8&lt;/code&gt; is often what you want, but to get a list of other possible values, you can use &lt;code&gt;M-x list-coding-systems&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-20T19:30:57.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19721" PostTypeId="1" AcceptedAnswerId="19722" CreationDate="2016-01-20T19:44:24.393" Score="1" ViewCount="695" Body="&lt;p&gt;I would like to create a patch (git diff) with custom name -- e.g., &lt;strong&gt;hello-world.diff&lt;/strong&gt;.  Emacs doesn't seem to be able to handle &lt;code&gt;git diff &amp;gt; hello-world.diff&lt;/code&gt;, perhaps because of the greater-than sign that works in regular terminals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried using &lt;code&gt;start-process&lt;/code&gt;, but it fails:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun create-diff-patch ()&#xA;  (interactive)&#xA;    (let ((name-of-patch&#xA;           (read-string &quot;Name of Patch:  &quot; nil nil &quot;patch.diff&quot; nil)))&#xA;      (start-process &quot;process-name&quot; &quot;*output-buffer*&quot;&#xA;                     &quot;git&quot; &quot;diff&quot; &quot;&amp;gt;&quot; name-of-patch)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fatal: ambiguous argument '&amp;gt;': unknown revision or path not in the working tree.&#xA;Use '--' to separate paths from revisions, like this:&#xA;'git &amp;lt;command&amp;gt; [&amp;lt;revision&amp;gt;...] -- [&amp;lt;file&amp;gt;...]'&#xA;&#xA;Process process-name exited abnormally with code 128&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following two examples create automatic names, but I'd like to use my own name instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply #'magit-call-git&#xA;       (magit-process-quote-arguments '(&quot;format-patch&quot; &quot;-1&quot; &quot;SHA1&quot;)))&#xA;&#xA;(apply #'magit-call-git&#xA;       (magit-process-quote-arguments '(&quot;format-patch&quot; &quot;HEAD~~&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="306" LastEditDate="2016-01-20T19:47:42.223" LastActivityDate="2016-01-20T21:31:15.210" Title="How to create a patch (git diff) with a specific name" Tags="|magit|git|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19722" PostTypeId="2" ParentId="19721" CreationDate="2016-01-20T20:08:37.107" Score="1" Body="&lt;p&gt;One possibility (not tested, but the principle should be sound) is something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun create-diff-patch (filename)&#xA;  (start-process &quot;git-diff&quot; nil &quot;/bin/sh&quot; &quot;-c&quot;&#xA;         (format &quot;git diff &amp;gt; %s&quot; (shell-quote-argument filename))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A more elaborate solution would be to use &lt;code&gt;make-process&lt;/code&gt; to collect the git output in a temporary buffer, then use a process sentinel to save the buffer in the file you want when the process finishes.&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="2287" LastEditDate="2016-01-20T21:31:15.210" LastActivityDate="2016-01-20T21:31:15.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19723" PostTypeId="2" ParentId="19672" CreationDate="2016-01-20T20:20:34.370" Score="4" Body="&lt;p&gt;Use &lt;code&gt;!&lt;/code&gt; to use a generic git command, then you can simple write: &lt;code&gt;push origin HEAD:refs/for/master&lt;/code&gt; almost as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a dedicated package for &lt;code&gt;gerrit&lt;/code&gt; here:&#xA;&lt;a href=&quot;https://github.com/terranpro/magit-gerrit&quot; rel=&quot;nofollow&quot;&gt;https://github.com/terranpro/magit-gerrit&lt;/a&gt;&#xA;I haven't used it personally however, so don't know exactly how to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a recent version of &lt;code&gt;magit&lt;/code&gt;, it is now possible to specify an explicit git refspec from the &lt;kbd&gt;r&lt;/kbd&gt; subcommand. Thus, to push to the &lt;code&gt;gerrit&lt;/code&gt; refspec, simply use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;P&lt;/kbd&gt; &lt;kbd&gt;r&lt;/kbd&gt; &quot;origin&quot; &lt;kbd&gt;RET&lt;/kbd&gt; &quot;HEAD:refs/for/master&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although, this is not really a shortcut since you have to do even more key-presses, but it &lt;em&gt;is&lt;/em&gt; available out of the box.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2653" LastEditDate="2016-10-25T08:46:31.647" LastActivityDate="2016-10-25T08:46:31.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19724" PostTypeId="1" CreationDate="2016-01-20T22:00:00.310" Score="1" ViewCount="86" Body="&lt;p&gt;I am using window-numbering.el to switch between windows in a frame. However if I have multiple frames each frame starts numbering its windows beginning with 1. Is there a way I can have global window numbers over all frames, so that window numbering jumps between frames as well?&lt;/p&gt;&#xA;" OwnerUserId="9292" LastEditorUserId="9292" LastEditDate="2016-01-20T22:08:18.293" LastActivityDate="2016-01-21T02:03:21.453" Title="Global window numbers for all frames" Tags="|window|frames|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19725" PostTypeId="1" CreationDate="2016-01-20T22:14:51.913" Score="3" ViewCount="279" Body="&lt;p&gt;The error is as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (emacs): Unable to activate package `flycheck'.&#xA;Required package `seq-1.11' is unavailable&#xA;Warning (emacs): Unable to activate package `beacon'.&#xA;Required package `seq-1.11' is unavailable&#xA;Warning (emacs): Unable to activate package `flycheck'.&#xA;Required package `seq-1.11' is unavailable&#xA;Warning (emacs): Unable to activate package `beacon'.&#xA;Required package `seq-1.11' is unavailable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is that the only way to deal with it is to recompile the .emacs.d file?&#xA;If yes, how can I do that. Thank you&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2016-01-20T22:21:59.533" Title="Downgrade emacs from 25.0.50 into 24.5.1 introduce error on startup" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19726" PostTypeId="2" ParentId="19725" CreationDate="2016-01-20T22:21:59.533" Score="3" Body="&lt;p&gt;It looks like you need the &lt;a href=&quot;https://github.com/NicolasPetton/seq.el&quot; rel=&quot;nofollow&quot;&gt;seq package&lt;/a&gt;. According to its webpage, its included in Emacs 25 by default, so you already had it with Emacs 25.0.50. It's not in Emacs 24, so after you downgraded you need to install it from the Elpa repository.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-01-20T22:21:59.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19727" PostTypeId="2" ParentId="19697" CreationDate="2016-01-20T22:30:10.807" Score="3" Body="&lt;p&gt;I don't think you should run into any problems.  I use &lt;code&gt;:bind&lt;/code&gt; for commands that are already autoloaded (note that &lt;code&gt;:bind&lt;/code&gt; implicitly generates autoloads, in the same way as &lt;code&gt;:commands&lt;/code&gt;), and haven't run into any problems.  And if you're using &lt;code&gt;:commands&lt;/code&gt; and not &lt;code&gt;:bind&lt;/code&gt; and you run into problems because of this, you should be able to solve them just by dropping the &lt;code&gt;:commands&lt;/code&gt; directive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;User npostavs linked to &lt;a href=&quot;https://github.com/jwiegley/use-package/issues/177&quot; rel=&quot;nofollow&quot;&gt;this github issue&lt;/a&gt; in a comment, which suggests that there was previously a problem with &lt;code&gt;:commands&lt;/code&gt; clobbering pre-existing autoloads, but this has since been fixed.  Reading through it might be helpful if problems do arise.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-20T22:30:10.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19728" PostTypeId="1" CreationDate="2016-01-20T22:43:05.913" Score="1" ViewCount="1204" Body="&lt;p&gt;I have been having trouble getting user-defined dictionaries to work with &lt;code&gt;auto-complete-mode&lt;/code&gt;. I have read &lt;a href=&quot;http://auto-complete.org/doc/manual.html#user-defined-dictionary&quot; rel=&quot;nofollow&quot;&gt;the documentation&lt;/a&gt;, and I have the following configuration in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package auto-complete&#xA;   :ensure t&#xA;   :init&#xA;   (require 'auto-complete-config)&#xA;   (add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/es-ac-dict&quot;)&#xA;   (setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers))&#xA;   (add-to-list 'ac-modes 'sql-interactive-mode)&#xA;   (add-hook 'sql-interactive-mode-hook (lambda () (auto-complete-mode 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I only use auto-complete mode with &lt;code&gt;sql-interactive mode&lt;/code&gt; and I have a file called &lt;code&gt;sql-interactive-mode&lt;/code&gt; in the directory &lt;code&gt;~/.emacs.d/es-ac-dict&lt;/code&gt; with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;select&#xA;where&#xA;from&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I am in a &lt;code&gt;sql-interactive-mode&lt;/code&gt; buffer, my dictionary doesn't seem to be used. Once I type &lt;code&gt;select&lt;/code&gt;, the next time I type &lt;code&gt;select&lt;/code&gt; I will get a completion from &lt;code&gt;ac-source-words-in-same-mode-buffers&lt;/code&gt;, but I don't get completions initially from my dictionary. Do I have the format of the file/directory structure wrong, or is it something else in my &lt;code&gt;auto-complete-mode&lt;/code&gt; configuration? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-20T22:43:05.913" Title="Getting auto-complete-mode user dictionary to work" Tags="|completion|auto-complete-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19729" PostTypeId="2" ParentId="19699" CreationDate="2016-01-20T22:57:38.137" Score="7" Body="&lt;p&gt;Yes, I believe those are equivalent.  If there's additional configuration outside of &lt;code&gt;with-eval-after-load&lt;/code&gt;, then switching to use &lt;code&gt;:after&lt;/code&gt; should be semantically equivalent to moving them inside the &lt;code&gt;with-eval-after-load&lt;/code&gt; form and so may change when they are executed.  Whether this is a problem or not will depend on the exact configuration details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I don't know the exact details of how things are implemented, so it's possible that there's some very subtle timing issue, but at least your intuition seems to match mine here.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-20T22:57:38.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19730" PostTypeId="2" ParentId="19700" CreationDate="2016-01-20T23:19:34.023" Score="4" Body="&lt;p&gt;Unfortunately, &lt;code&gt;use-package&lt;/code&gt; is not as thoroughly documented as it should be.  I remember finding an explanation of this keyword at some point, but can't seem to turn it up now.  Looking at the source for &lt;code&gt;use-package-handler/:requires&lt;/code&gt;, I think what this does is make the entire &lt;code&gt;use-package&lt;/code&gt; block conditional on the presence of the specified feature(s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Macroexpanding a sample block seems to confirm this interpretation.  Take&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package foo&#xA;  :requires (bar baz)&#xA;  :config&#xA;  (blah))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and call &lt;code&gt;pp-macroexpand-last-sexp&lt;/code&gt; on it.  You get this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if&#xA;    (not&#xA;     (member nil&#xA;             (mapcar #'featurep&#xA;                     '(bar baz))))&#xA;    (progn&#xA;      (if&#xA;          (not&#xA;           (require 'foo nil 'noerror))&#xA;          (ignore&#xA;           (message&#xA;            (format &quot;Could not load %s&quot; 'foo)))&#xA;        (condition-case-unless-debug err&#xA;            (blah)&#xA;          (error&#xA;           (ignore&#xA;            (display-warning 'use-package&#xA;                             (format &quot;%s %s: %s&quot; &quot;foo&quot; &quot;:config&quot;&#xA;                                     (error-message-string err))&#xA;                             :error))))&#xA;        t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you remove the &lt;code&gt;:requires&lt;/code&gt; line and try again, you get just the contents of the &lt;code&gt;progn&lt;/code&gt; form.  So if all of the features you listed are present at the time the block is being executed, then everything's the same.  If any feature is missing, nothing is loaded whatsoever.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-20T23:19:34.023" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19731" PostTypeId="2" ParentId="19615" CreationDate="2016-01-20T23:52:08.993" Score="2" Body="&lt;p&gt;Looking at your tutorial , I have never used the &lt;code&gt;#+R&lt;/code&gt; specification. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recent (&gt;2 years old) org-mode mainly uses code blocks to input several R lines.&#xA;Add this to your dotemacs: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((R . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in an org file &lt;code&gt;C-c C-v C-d&lt;/code&gt; and select R to create a R source block. &lt;code&gt;C-c C-c&lt;/code&gt; inside the block to evaluate it, &lt;code&gt;C-c &amp;lt;backquote&amp;gt;&lt;/code&gt; to edit it with ess. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info here: &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="499" LastActivityDate="2016-01-20T23:52:08.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19732" PostTypeId="2" ParentId="19717" CreationDate="2016-01-21T01:25:53.720" Score="1" Body="&lt;p&gt;FWIW I've have a collection of coding system settings, which is largely copy/paste from &lt;a href=&quot;https://www.masteringemacs.org/article/working-coding-systems-unicode-emacs&quot; rel=&quot;nofollow&quot;&gt;elsewhere&lt;/a&gt; (and thus I could not say with certainty that they are all required), but may be of interest:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;(set-default-coding-systems 'utf-8)&#xA;(set-terminal-coding-system 'utf-8) ;; also see `my-frame-config'&#xA;(set-keyboard-coding-system 'utf-8)&#xA;(set-locale-environment &quot;en_NZ.UTF-8&quot;)&#xA;(setq-default buffer-file-coding-system 'utf-8)&#xA;(when (boundp 'default-buffer-file-coding-system) ;; obsolete since 23.2&#xA;  (setq default-buffer-file-coding-system 'utf-8))&#xA;;; Treat clipboard input as UTF-8 string first; compound text next, etc.&#xA;(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of particular note to this question, however, is that you set the &lt;em&gt;terminal&lt;/em&gt; coding system on a &lt;em&gt;per-terminal&lt;/em&gt; basis, which means you should be reacting to new frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(e.g. With Emacs running as a server, set the terminal coding system, then in a completely separate terminal connect to the server and inspect the terminal coding system, and you'll note that it's the default value.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, various Emacs variables are &lt;em&gt;terminal-local&lt;/em&gt;, such that setting them in one terminal does not affect their value in other terminals. See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Multiple Terminals&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are certain that you can reliably use a particular coding system in all of your terminals, you can do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Per-frame/terminal configuration.&#xA;(defun my-frame-config (frame)&#xA;  &quot;Custom behaviours for new frames.&quot;&#xA;  (with-selected-frame frame&#xA;    ;; do things&#xA;    (unless window-system&#xA;      ;; Terminal configuration&#xA;      (set-terminal-coding-system 'utf-8))&#xA;    ))&#xA;;; Run now, for non-daemon Emacs...&#xA;(my-frame-config (selected-frame))&#xA;;; ...and later, for new frames / emacsclient&#xA;(add-hook 'after-make-frame-functions 'my-frame-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-01-21T02:42:45.780" LastActivityDate="2016-01-21T02:42:45.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19733" PostTypeId="2" ParentId="19724" CreationDate="2016-01-21T02:03:21.453" Score="1" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then command &lt;code&gt;icicle-choose-window-by-name&lt;/code&gt; with &lt;code&gt;C-u&lt;/code&gt; lets you choose a window, on any frame, by its name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A window is named by its buffer.  If there is more than one window displaying the same buffer then the window name includes a suffix &lt;code&gt;[N]&lt;/code&gt; (&lt;em&gt;N&lt;/em&gt; = 2,3,...), to make it a unique name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The prefix arg you use determines whether to choose from windows on only the selected frame, on all visible frames, or all frames (including iconified and invisible frames).)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-21T02:03:21.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19734" PostTypeId="2" ParentId="19577" CreationDate="2016-01-21T02:03:28.577" Score="1" Body="&lt;p&gt;I think you need to install rust source code and set the RUST_SRC_PATH environment variable. It's the point 4 in &quot;Install from sources&quot; in the racer readme &lt;a href=&quot;https://github.com/phildawes/racer&quot; rel=&quot;nofollow&quot;&gt;https://github.com/phildawes/racer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10841" LastActivityDate="2016-01-21T02:03:28.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19735" PostTypeId="1" CreationDate="2016-01-21T02:08:29.293" Score="7" ViewCount="1322" Body="&lt;p&gt;I removed my &lt;code&gt;.emacs&lt;/code&gt; and &lt;code&gt;.emacs.d&lt;/code&gt;, then created a new &lt;code&gt;.emacs&lt;/code&gt; consisting of only the essential to use R and a shell with org-babel to make sure my configs weren't causing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-install)&#xA;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '(&#xA;   (sh . t)&#xA;   (R . t)&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to run the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :results output verbatim&#xA;(any R code)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It runs just fine. However, if I add &lt;code&gt;:session&lt;/code&gt; or &lt;code&gt;:session name&lt;/code&gt; to the &lt;code&gt;#+begin_src&lt;/code&gt; header, Emacs freezes. I can't move the cursor nor do anything. I can see both R and Emacs on &lt;code&gt;htop&lt;/code&gt;, none using any CPU. The only way to get out is to send &lt;code&gt;SIGTERM&lt;/code&gt; to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When running the snippet with &lt;code&gt;C-c&lt;/code&gt; the minibuffer says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ESS (*R*, R (newest)) starting data directory? pwd (I say yes)&#xA;Cannot read history file pwd/.Rhistory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is normal, I get it on other computers where Emacs doesn't freeze. Then hangs forever on&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ess-tracebug mode enabled&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also normal. Except the hanging forever part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar issue occurs with sh snippets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :results output verbatim&#xA;echo&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works fine. So with &lt;code&gt;:session&lt;/code&gt;. However, with &lt;code&gt;:session name&lt;/code&gt; it hangs forever just like R. All the minibuffer says is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrote /tmp/babel-XXXXX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then hangs forever on&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;executing sh code block...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All packages (&lt;code&gt;emacs&lt;/code&gt;, &lt;code&gt;ess&lt;/code&gt;, &lt;code&gt;org-mode&lt;/code&gt;) are the latest version from Debian stable repos. I have other computers with the same setup that work just fine. &lt;code&gt;emacs --version&lt;/code&gt; returns &lt;code&gt;GNU Emacs 24.4.1&lt;/code&gt;. The same happened in previous versions, and I also tried downloading Emacs &lt;code&gt;24.5.1&lt;/code&gt; from a GNU mirror and compiling it. The exact same thing happens. I'm completely lost as to what could be causing this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also tried downloading latest stable ess and org-mode from the respective websites and installing and configuring for the compiled emacs. Added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/path/to/emacs-24.5/b/share/emacs/site-lisp/ess&quot;)&#xA;(load &quot;ess-site&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To &lt;code&gt;.emacs&lt;/code&gt; as per ess' README&lt;/p&gt;&#xA;" OwnerUserId="10713" LastEditorUserId="10713" LastEditDate="2016-01-21T02:24:45.470" LastActivityDate="2017-01-28T22:05:29.887" Title="Emacs freezes with any org-babel snippet using `:session`" Tags="|org-mode|org-babel|session|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19736" PostTypeId="1" AcceptedAnswerId="19741" CreationDate="2016-01-21T03:33:27.423" Score="4" ViewCount="921" Body="&lt;p&gt;I have language specific syntax highlighting and (kind of) indentation working in Org-mode source code blocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, because of the syntax highlighting if I am editing the code block in the Org-mode buffer, I often find myself thinking that I am in an e.g., emacs lisp buffer. When I try to comment out code in one of these blocks though, I get &lt;code&gt;#&lt;/code&gt; at the begining of the comment, instead of the delimiter for the language of the source code block. This mean that commenting is often a 4 step process of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Comment the code with &lt;code&gt;M-;&lt;/code&gt; leading to code that has the wrong style comment.&lt;/li&gt;&#xA;&lt;li&gt;Uncomment that code.&lt;/li&gt;&#xA;&lt;li&gt;Call &lt;code&gt;org-edit-special&lt;/code&gt; with &lt;code&gt;C-c '&lt;/code&gt; to get to a buffer specific to the language.&lt;/li&gt;&#xA;&lt;li&gt;Comment out the code again (and usually go back to the org-mode buffer).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would like to do this with only the first step if possible. &lt;strong&gt;Is there a way to use language specifc comments in org-src block?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-21T12:54:41.797" Title="Language specific comments in org-mode source code blocks" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19737" PostTypeId="2" ParentId="19164" CreationDate="2016-01-21T04:22:34.300" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to let mu4e display certain attachments &lt;strong&gt;inline&lt;/strong&gt; with the email text?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The short answer is &quot;no.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mu&lt;/code&gt; concatenates all &lt;code&gt;text/plain&lt;/code&gt; parts to form the body of a message--- both for indexing and viewing messages. As far as I can tell &lt;strong&gt;only&lt;/strong&gt; &lt;code&gt;text/plain&lt;/code&gt; gets this treatment and since this is done by &lt;code&gt;mu&lt;/code&gt; you cannot change this behavior in &lt;code&gt;mu4e&lt;/code&gt;. (See &lt;a href=&quot;https://github.com/djcb/mu/blob/master/lib/mu-msg-part.c#L131&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;static void accumulate_text_part (MuMsg *msg, MuMsgPart *part, GString **gstrp)&lt;/code&gt;&lt;/a&gt; for the code.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;location&lt;/em&gt; of a part with &lt;code&gt;Content-Disposition: inline&lt;/code&gt; is lost when &lt;code&gt;mu&lt;/code&gt; accumulates text parts to build a message body, and so one cannot display &lt;em&gt;any&lt;/em&gt; part (except for &lt;code&gt;text/plain&lt;/code&gt;) truely inline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be possible to display &lt;code&gt;text/plain&lt;/code&gt;, &lt;code&gt;text/x-patch&lt;/code&gt;, or any other attachment at the end of the body similar to the way &lt;code&gt;mu4e&lt;/code&gt; displays images when &lt;code&gt;mu4e-view-show-images&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;. (This would require writing a bit of elisp to extend &lt;code&gt;mu4e&lt;/code&gt;. I think I know how to do it, so let me know if you're interested.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I learned all this by reading the &lt;a href=&quot;https://github.com/djcb/mu/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;mu&lt;/code&gt; source code&lt;/a&gt;. Please do correct me if I'm wrong.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-21T04:22:34.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19738" PostTypeId="1" AcceptedAnswerId="19744" CreationDate="2016-01-21T08:58:29.887" Score="9" ViewCount="2977" Body="&lt;p&gt;In the magit from spacemacs, when I press &lt;kbd&gt;O&lt;/kbd&gt; on a commit, it shows several actions, two of them are &quot;revert commit&quot; and &quot;revert change&quot;, what's the difference between them?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="306" LastEditDate="2016-08-31T10:56:54.677" LastActivityDate="2016-08-31T10:56:54.677" Title="what's the difference between &quot;revert commits&quot; and &quot;revert change&quot; in magit?" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19740" PostTypeId="2" ParentId="19716" CreationDate="2016-01-21T11:17:20.787" Score="2" Body="&lt;p&gt;Regarding the comments, that encoding is fine (note that it's explicit in the desktop file's header, hence clearly intentional).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The seeming-gibberish is byte-compiled elisp, and we can see from the file path displayed that it's from &lt;code&gt;auto-capitalize.elc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can infer from the full path that this is an ELPA package you got from MELPA, so I suspect you basically have a third-party library which doesn't play nicely with desktop.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would try editing both instances of &lt;code&gt;auto-capitalize&lt;/code&gt; out of the desktop file, and then attempting to read it again.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-01-21T11:17:20.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19741" PostTypeId="2" ParentId="19736" CreationDate="2016-01-21T12:54:41.797" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00318.html&quot; rel=&quot;nofollow&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2013-11/msg00318.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; allow comment region in the code edit buffer (according to language)&#xA;(defun my-org-comment-dwim (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (or (org-babel-do-key-sequence-in-edit-buffer (kbd &quot;M-;&quot;))&#xA;      (comment-dwim arg)))&#xA;&#xA;;; make `C-c C-v C-x M-;' more convenient&#xA;(define-key org-mode-map&#xA;  (kbd &quot;M-;&quot;) 'my-org-comment-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-01-21T12:54:41.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19742" PostTypeId="1" AcceptedAnswerId="19747" CreationDate="2016-01-21T15:26:45.610" Score="9" ViewCount="3652" Body="&lt;p&gt;I don't find this warning particularly helpful and pretty distracting because it hides the current text in the echo area for a brief moment. Is also seems unnecessary, because I will notice anyway that I cannot write in read-only areas. Is there a way to disable it?&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="2355" LastEditDate="2016-01-21T21:14:51.817" LastActivityDate="2016-01-21T21:14:51.817" Title="Is there a way to disable the &quot;buffer is read-only&quot; warning?" Tags="|echo-area|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19743" PostTypeId="2" ParentId="19742" CreationDate="2016-01-21T16:02:40.053" Score="3" Body="&lt;h2&gt;Source of the 'buffer read-only' error&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I believe that the source of that error: &lt;code&gt;Buffer is read-only: &amp;lt;#BUFFER-NAME&amp;gt;&lt;/code&gt; is in the C source code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the solution to this would be to tweak the source code and build emacs locally by commenting out &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/buffer.c?a=a2981c90f661e8fa0356ee5bfe00f8565d721de8#n2156&quot; rel=&quot;nofollow&quot;&gt;this specific line&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, here is that code snippet that throws that error:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;if (!NILP (BVAR (current_buffer, read_only))&#xA;    &amp;amp;&amp;amp; NILP (Vinhibit_read_only)&#xA;    &amp;amp;&amp;amp; NILP (Fget_text_property (pos, Qinhibit_read_only, Qnil)))&#xA;  xsignal1 (Qbuffer_read_only, Fcurrent_buffer ());&#xA;return Qnil;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;.. and commenting out that &lt;code&gt;xsignal&lt;/code&gt; line should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Suggested Approach&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There is a much easier way to avert this annoyance for the duration you are working in a read-only buffer .. you can temporarily NOT make it read-only.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Doing &lt;code&gt;M-x read-only-mode&lt;/code&gt; (bound by default to &lt;code&gt;C-x C-q&lt;/code&gt;) toggles &lt;em&gt;any&lt;/em&gt; buffer between read-only mode and editable mode.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So if you are getting a lot of these errors, simply make the buffer temporarily editable by hitting &lt;code&gt;C-x C-q&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;A note of warning: Doing the C source hack could be a major source of confusion in future. So I wouldn't do it.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-01-21T16:57:16.653" LastActivityDate="2016-01-21T16:57:16.653" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19744" PostTypeId="2" ParentId="19738" CreationDate="2016-01-21T16:10:51.520" Score="14" Body="&lt;p&gt;According to the magit documentation, &lt;code&gt;Revert changes&lt;/code&gt; does the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Revert COMMIT by applying it in reverse to the worktree.&#xA;  Prompt for a commit, defaulting to the commit at point.  If&#xA;  the region selects multiple commits, then revert all of them,&#xA;  without prompting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;git&lt;/code&gt; command that it runs under the hood is &lt;code&gt;git revert --no-commit COMMIT&lt;/code&gt; where &lt;code&gt;COMMIT&lt;/code&gt; is the commit you selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;Revert commit(s)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Revert COMMIT by creating a new commit.&#xA;  Prompt for a commit, defaulting to the commit at point.  If&#xA;  the region selects multiple commits, then revert all of them,&#xA;  without prompting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For this, the &lt;code&gt;git&lt;/code&gt; command that gets run is &lt;code&gt;git revert COMMIT&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, reverting changes puts the changes from the selected commit back in the working tree for you to do what you want with (including commit again), while reverting a commit will undo the changes from the selected commit and create a new commit (i.e., a new commit where those changes have been undone).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, whenever you see options in a magit popup, you can hit &lt;code&gt;?&lt;/code&gt; and then the key associated with an option to see the documentation for that option. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-21T16:17:49.143" LastActivityDate="2016-01-21T16:17:49.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19746" PostTypeId="1" AcceptedAnswerId="19772" CreationDate="2016-01-21T16:59:22.617" Score="20" ViewCount="6586" Body="&lt;p&gt;In an attempt to figure out how I've been spending my time, I've started logging my time spent on different tasks with &lt;code&gt;org-clock-in&lt;/code&gt; and &lt;code&gt;org-clock-out&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often find myself editing clock entries by hand, for instance, when I realize that I should have clocked in 20 minutes ago. So is there a way to see a) which clocks are currently running (or haven't been terminated properly because I forgot to clock out before exiting Emacs), and b) a list of clock entries?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can get a table that shows the total amount of time I've spent on each task, but I can't get a list that says,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;9:00--9:30   Project A&#xA;9:18--10:00  Project B&#xA;10:00--11:00 Meeting&#xA;11:45--13:00 Lunch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which would let me see overlapping times (like Projects A and B, above) and gaps (like the one between Meeting and Lunch). Is there such a thing?&lt;/p&gt;&#xA;" OwnerUserId="10837" LastActivityDate="2016-01-23T08:57:05.027" Title="Get a timeline of clocked time in org-mode" Tags="|org-mode|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19747" PostTypeId="2" ParentId="19742" CreationDate="2016-01-21T18:35:11.820" Score="9" Body="&#xA;&#xA;&lt;p&gt;Yes, you can disable these messages by setting &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Processing-of-Errors.html#Processing-of-Errors&quot;&gt;&lt;code&gt;command-error-function&lt;/code&gt;&lt;/a&gt; to a function that ignores &lt;code&gt;buffer-read-only&lt;/code&gt; signals.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-command-error-function (data context caller)&#xA;  &quot;Ignore the buffer-read-only signal; pass the rest to the default handler.&quot;&#xA;  (when (not (eq (car data) 'buffer-read-only))&#xA;    (command-error-default-function data context caller)))&#xA;&#xA;(setq command-error-function #'my-command-error-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Tested using GNU Emacs 24.5.1.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="115" LastEditDate="2016-01-21T19:35:56.073" LastActivityDate="2016-01-21T19:35:56.073" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19748" PostTypeId="1" AcceptedAnswerId="19890" CreationDate="2016-01-21T21:53:10.567" Score="1" ViewCount="290" Body="&lt;p&gt;I'm using yasnippet to create a template for org-mode tables. This works fine, and allows me to create default values (placeholders) for the column headers. The default values are highlighted by default and get replaced when I enter actual names for the columns. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: orgtable &#xA;# key: orgtable&#xA;# --&#xA;| ${1:column A}      | ${2:column B}      | &#xA;|--------------------+--------------------|&#xA;| $0                 |                    |&#xA;|--------------------+--------------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I try to do the same thing for the org-mode caption line, it doesn't work. The default values do NOT get overwritten.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: orgtable &#xA;# key: orgtable&#xA;# --&#xA;#+CAPTION: ${1:Title} &#xA;| ${2:column A}      | ${3:column B}      | &#xA;|--------------------+--------------------|&#xA;| $0                 |                    |&#xA;|--------------------+--------------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get the second version of the snippet to respect the default values, i.e. overwrite them when I type?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2016-01-21T23:02:05.040" LastActivityDate="2016-01-27T22:33:27.363" Title="yasnippet won't replace default values (placeholders) in org-table caption" Tags="|org-mode|yasnippet|org-table|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19750" PostTypeId="2" ParentId="19480" CreationDate="2016-01-22T07:39:09.110" Score="2" Body="&lt;p&gt;The best existing solution might be to upload the org-mode files to a Github repository. &lt;a href=&quot;https://github.com/github/markup#markups&quot; rel=&quot;nofollow&quot;&gt;Github supports org markup&lt;/a&gt;, so the files will automatically be rendered and appear in a formatted view. Your collaborator can then switch to &lt;code&gt;Raw&lt;/code&gt; view to see the original unparsed org-mode source. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This still won't support org heading navigation or visibility cycling, however.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-01-22T07:39:09.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19751" PostTypeId="2" ParentId="19329" CreationDate="2016-01-22T07:47:26.443" Score="2" Body="&lt;p&gt;Those numbered files are created by nvALT when Emacs and nvALT both attempt to write to the same file. When there's a conflict, nvALT creates those files to prevent data loss. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, nvALT saves files automatically, so if you have it open at the same time as Emacs, you may run into conflicts, as well as these duplicate files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Emacs has its own nvALT clone, &lt;a href=&quot;http://jonathanchu.is/posts/setting-up-deft-mode-in-emacs-with-org-mode/&quot; rel=&quot;nofollow&quot;&gt;deft-mode&lt;/a&gt;. Like nvALT, deft-mode allows &lt;a href=&quot;http://pragmaticemacs.com/emacs/make-quick-notes-with-deft/&quot; rel=&quot;nofollow&quot;&gt;incremental searching&lt;/a&gt;, as well as creating new text files from within the search interface.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-01-22T07:47:26.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19752" PostTypeId="2" ParentId="19703" CreationDate="2016-01-22T09:07:00.420" Score="4" Body="&lt;p&gt;In the menus, enable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options -&gt; Enter debugger on Quit/C-g&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then press C-g when your code is running and you want to debug.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-01-22T09:07:00.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19753" PostTypeId="2" ParentId="19703" CreationDate="2016-01-22T10:40:11.877" Score="1" Body="&lt;p&gt;Run your server with &lt;code&gt;run-with-timer&lt;/code&gt;. In this way you can do anything you like with it. For an instance you can instrument &lt;code&gt;check-server&lt;/code&gt; for &lt;code&gt;edebug&lt;/code&gt; or redefine &lt;code&gt;check-server&lt;/code&gt; while it is still running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example how to run the &lt;code&gt;check-server&lt;/code&gt; with &lt;code&gt;run-with-timer&lt;/code&gt;.&#xA;Each started server has its own buffer. The variable &lt;code&gt;my-server-status&lt;/code&gt; is buffer local to this buffer. If you want to see its value first switch to this buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun check-server ()&#xA;  (let ((time (current-time)))&#xA;    (message &quot;Running server at %s&quot; time)&#xA;    time))&#xA;&#xA;(defun my-server-start (time fun)&#xA;  &quot;Run `fun' with timer for every time seconds.&quot;&#xA;  (interactive &quot;nTime in seconds:\naServer to run:&quot;)&#xA;  (let ((buf (generate-new-buffer (concat &quot;*my-server(&quot; (symbol-name fun) &quot;)&quot;))))&#xA;    (with-current-buffer buf&#xA;      (setq-local my-server-fun fun)&#xA;      (setq-local my-server-timer (run-with-timer 0 time `(lambda () (with-current-buffer ,buf (setq-local my-server-status (funcall my-server-fun))))))&#xA;      (add-hook 'kill-buffer-hook (lambda () (cancel-timer my-server-timer)) t t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: You get rid of the server timer when you kill the server buffer.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-22T10:49:32.833" LastActivityDate="2016-01-22T10:49:32.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19754" PostTypeId="2" ParentId="19702" CreationDate="2016-01-22T11:42:22.343" Score="1" Body="&lt;p&gt;It is not a good idea to add a lambda to a hook if you want to debug this lambda. &lt;code&gt;edebug&lt;/code&gt; adds its own stuff so that you cannot easily remove or redefine the function. If you try you end up with two functions in the hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather define a function such as &lt;code&gt;my-c-mode-common-hook-function&lt;/code&gt; and instrument that one.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-c-mode-common-hook-function ()&#xA;  &quot;some useful documentation&quot;&#xA;  (if (or (string-match &quot;llvm&quot; buffer-file-name)&#xA;             (string-match &quot;nvvm&quot; buffer-file-name))&#xA;         (progn&#xA;           (c-set-style &quot;llvm.org&quot;))))&#xA;&#xA;(add-hook 'c-mode-common-hook #'my-c-mode-common-hook-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then easily instrument &lt;code&gt;my-c-mode-common-hook-function&lt;/code&gt; for debugging.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-01-22T11:42:22.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19755" PostTypeId="1" CreationDate="2016-01-22T13:21:59.660" Score="0" ViewCount="62" Body="&lt;p&gt;Is it possible to use auto-complete with twittering-mode to complete twitter handle names and hashtags?&lt;/p&gt;&#xA;" OwnerUserId="6702" LastActivityDate="2016-09-18T21:15:13.300" Title="auto-complete twitter handles and hashtags in twittering mode" Tags="|auto-complete-mode|twitter|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19756" PostTypeId="2" ParentId="19755" CreationDate="2016-01-22T15:52:59.550" Score="-1" Body="&lt;p&gt;Escape-x to access command mode, enter the emacs command to complete twitter handle names and hashtags, type the hashtag, hit the space bar to auto-complete.  Use the space bar to find the appropriate emacs command in command mode.&lt;/p&gt;&#xA;" OwnerUserId="10854" LastActivityDate="2016-01-22T15:52:59.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19757" PostTypeId="1" AcceptedAnswerId="19759" CreationDate="2016-01-22T15:56:58.240" Score="1" ViewCount="82" Body="&lt;p&gt;Is there a built-in option or a package that can help me navigate the C-source code to jump to functions, variables and other items with underscores in the name?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example # 1&lt;/strong&gt;:  I would like to place my cursor on &lt;code&gt;optional_new_start&lt;/code&gt; in &lt;code&gt;window.c&lt;/code&gt; -- hit an &lt;code&gt;M-x find-...&lt;/code&gt; -- and be automatically transported to &lt;code&gt;window.h&lt;/code&gt; at the location that tells me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* True means we have explicitly changed the value of start,&#xA;   but that the next redisplay is not obliged to use the new value.&#xA;   This is used in Fdelete_other_windows to force a call to&#xA;   Vwindow_scroll_functions; also by Frecenter with argument.  */&#xA;bool_bf optional_new_start : 1;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example # 2&lt;/strong&gt;:  I would like to place my cursor on &lt;code&gt;redisplay_window&lt;/code&gt; -- hit an &lt;code&gt;M-x find-...&lt;/code&gt; -- and be automatically transported to &lt;code&gt;xdisp.c&lt;/code&gt; -- where I can read about:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;static void&#xA;redisplay_window (Lisp_Object window, bool just_this_one_p)&#xA;{&#xA;  struct window *w = XWINDOW (window);&#xA;  struct frame *f = XFRAME (w-&amp;gt;frame);&#xA;***&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-06-09T00:13:59.040" Title="Navigating the C-source code for names with underscores" Tags="|help-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19758" PostTypeId="1" CreationDate="2016-01-22T16:13:26.940" Score="4" ViewCount="114" Body="&lt;p&gt;When using &lt;code&gt;global-linum-mode&lt;/code&gt; with a latex file that has blocks of R code (&lt;code&gt;*.rnw&lt;/code&gt; file) moving in and out of the R code blocks cause the line numbers to disappear until the cursor is moved again. Is there a way to stop the disappearing line numbers or just to turn off the line numbers for &lt;code&gt;*.rnw&lt;/code&gt; files, but not in pure LaTeX ESS files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &#xA;&lt;code&gt;Aquamacs 3.2&lt;/code&gt;&#xA;&lt;code&gt;GNU Emacs 24.4.51.2&lt;/code&gt;&#xA;&lt;code&gt;ESS-Version 15.09-2&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8720" LastEditorUserId="253" LastEditDate="2016-01-22T16:17:19.050" LastActivityDate="2016-01-26T04:02:28.540" Title="using global-linum-mode with ess with a latex/R knit file" Tags="|latex|ess|linum-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19759" PostTypeId="2" ParentId="19757" CreationDate="2016-01-22T16:44:47.513" Score="4" Body="&lt;p&gt;Emacs can do this &quot;out of the box&quot;. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Tags.html#Tags&quot; rel=&quot;nofollow&quot;&gt;Tags&lt;/a&gt; in the manual. (Press &lt;code&gt;C-h r m tags RET&lt;/code&gt; to read this section in Emacs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I did to make sure it works.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Got Emacs sources from &lt;a href=&quot;https://github.com/emacs-mirror/emacs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-mirror/emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Ran &lt;code&gt;find . -iname &quot;*.c&quot; -or -iname &quot;*.h&quot; | xargs etags&lt;/code&gt; to create a TAGS table.&lt;/li&gt;&#xA;&lt;li&gt;Added this &lt;code&gt;TAGS&lt;/code&gt; table using &lt;code&gt;M-x visit-tags-table&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now I can put my cursor on &lt;code&gt;optional_new_start&lt;/code&gt; in &lt;code&gt;window.c&lt;/code&gt;, press &lt;code&gt;M-. RET&lt;/code&gt; and end up on the appropriate line in &lt;code&gt;window.h&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then press &lt;code&gt;M-*&lt;/code&gt; to go back to the point you started from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: It does not matter if variable and function names have underscores in them.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-01-22T17:06:00.970" LastActivityDate="2016-01-22T17:06:00.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19760" PostTypeId="1" CreationDate="2016-01-22T17:10:41.930" Score="3" ViewCount="415" Body="&lt;p&gt;I'm in Windows 7 (32 bit) and I'm using Emacs 24.4 where I have, among other things, Org 8.2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to open pdfs in Sumatra PDF after exporting *.org files to pdf via *.tex. So I read this &lt;a href=&quot;https://tex.stackexchange.com/questions/54205/org-mode-export-to-latex-temptation-or-nuisance/54211#54211&quot;&gt;other discussion&lt;/a&gt;, and I wrote in my &lt;em&gt;.emacs&lt;/em&gt; config file the following code similar to what's written under the &quot;Tricks&quot; paragraph:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;org&quot; '(progn (setcdr (assoc &quot;\\.pdf\\'&quot; org-file-apps) &quot;sumatra PDF %s&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know it's not correct because when I export (&lt;code&gt;C-c C-e l o&lt;/code&gt;) from org to pdf, it doesn't open the pdf in Sumatra PDF. I have the configuration for tex --&gt; pdf fw/backwrd sync b/w AUCTeX and Sumatra -- it works perfectly. I'd like the same for org and Sumatra too. Is it possible? If not, just opening with Sumatra instead of Adobe Acrobat Reader will do. Can someone please help me out here?&lt;/p&gt;&#xA;" OwnerUserId="9269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-01-22T17:10:41.930" Title="Org-mode export open in Sumatra PDF?" Tags="|org-mode|org-export|pdf|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19761" PostTypeId="1" CreationDate="2016-01-22T17:32:49.790" Score="4" ViewCount="3780" Body="&lt;p&gt;I'm using Org 8.2 on emacs 24.4, in a Windows 7 machine. Recently I've managed to install &lt;strong&gt;cdlatex.el&lt;/strong&gt; script by saving this file in one of my 'load-paths'. As you may know, cdlatex is a minor mode that can work with Org-mode and helps speed up writing math in Org by the use of keyboard shortcuts. However, when in cdlatex I get this error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wrong type argument: characterp, 134217782&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This error appears in the mini-buffer every time I press the backquote or backtick key on my keyboard (this symbol: &lt;kbd&gt;`&lt;/kbd&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly I must add some line in the &lt;em&gt;.emacs&lt;/em&gt; configuration file to fix this problem otherwise I'm unable to use 90% of CDLaTeX commands from keyboard. Can someone please help me out? I'm not proficient in elisp (I just copy/paste other folks lines). This is what I've got in my .emacs file regarding tilde and backquote (they respond to the same key, on my laptop's keyboard, see &lt;a href=&quot;https://emacs.stackexchange.com/q/16749/620&quot;&gt;this question&lt;/a&gt; for context):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; a key for tilde symbol&#xA;(define-key key-translation-map (kbd &quot;M-2&quot;) (kbd &quot;~&quot;))&#xA;;;; a key for backtick symbol&#xA;(define-key key-translation-map (kbd &quot;M-6&quot;) &quot;&quot;)&#xA;(define-key key-translation-map (kbd &quot;M-9&quot;) (kbd &quot;`&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Edit 1&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The reply to &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument characterp 134217782)&#xA;  format(&quot;No such math symbol %c on level %d&quot; 134217782 1)&#xA;  apply(format (&quot;No such math symbol %c on level %d&quot; 134217782 1))&#xA;  error(&quot;No such math symbol %c on level %d&quot; 134217782 1)&#xA;  (if (or (not symbol) (not (stringp symbol)) (equal symbol &quot;&quot;)) (error &quot;No such math symbol %c on level %d&quot; char level))&#xA;  (let* ((cell (cdlatex-read-char-with-help cdlatex-math-symbol-alist-comb 1 cdlatex-math-symbol-no-of-levels &quot;Math symbol level %d of %d: &quot; &quot;AVAILABLE MATH SYMBOLS.  [%c]=next level &quot; cdlatex-math-symbol-prefix (get (quote cdlatex-math-symbol-alist-comb) (quote cdlatex-bindings)))) (char (car cell)) (level (cdr cell)) (entry (assoc char cdlatex-math-symbol-alist-comb)) (symbol (nth level entry))) (if (or (not symbol) (not (stringp symbol)) (equal symbol &quot;&quot;)) (error &quot;No such math symbol %c on level %d&quot; char level)) (if (or (not (texmathp)) (cdlatex-number-of-backslashes-is-odd)) (cdlatex-dollar)) (insert symbol) (if (string-match &quot;\\?&quot; symbol) (progn (cdlatex-position-cursor))))&#xA;  cdlatex-math-symbol()&#xA;  call-interactively(cdlatex-math-symbol nil nil)&#xA;  command-execute(cdlatex-math-symbol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-01-26T17:39:00.803" Title="How to fix 'Wrong type argument: characterp, 134217782'?" Tags="|key-bindings|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19762" PostTypeId="2" ParentId="19761" CreationDate="2016-01-22T18:38:19.147" Score="5" Body="&lt;p&gt;Sounds like you have loaded byte-compiled code from an older Emacs version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, check by loading the Lisp source file that defines the functions in question: &lt;code&gt;*.el&lt;/code&gt;, not the byte-compiled file (&lt;code&gt;*.elc&lt;/code&gt;). (It sounds like the file in question might be &lt;code&gt;cdlatex.el&lt;/code&gt; - but it might be another file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that solves the problem (and it should), then you can byte-compile the library again, using your more recent Emacs version (the same version you are using at runtime). &lt;code&gt;M-x byte-compile-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-22T18:38:19.147" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19763" PostTypeId="1" AcceptedAnswerId="19855" CreationDate="2016-01-22T20:06:51.180" Score="2" ViewCount="318" Body="&lt;p&gt;From the package &lt;a href=&quot;https://github.com/jaypei/emacs-neotree/&quot; rel=&quot;nofollow&quot;&gt;Neotree&lt;/a&gt;, I want to bind a key, that moves to the upper directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The upper directory is always on the top with &lt;code&gt;.. (up a dir)&lt;/code&gt;. So I go to the first line of the neotree buffer, and call &lt;code&gt;neotree-enter&lt;/code&gt; to move to the upper directory. As a true Emacs'er, I figured out I need to modify it to my own preference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I created a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun neotree-go-to-upper-directory ()&#xA;    (interactive)&#xA;    (evil-goto-first-line)&#xA;    (neotree-enter)&#xA;)&#xA;&#xA;(evil-define-key 'normal neotree-mode-map (kbd &quot;h&quot;)'neotree-go-to-upper-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After pressing &lt;kbd&gt;h&lt;/kbd&gt; in NeoTree buffer, the cursor moves only to the&#xA;top. But nothing happens. Then I call &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;neotree-enter&lt;/code&gt;, but still&#xA;nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When trace back into the source code of &lt;code&gt;neotree-enter&lt;/code&gt; with &lt;kbd&gt;C-h f&lt;/kbd&gt;&#xA;then following the link, it's defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun neotree-enter (&amp;amp;optional arg)&#xA;    &quot;NeoTree typical open event.&#xA;    ARG are the same as `neo-open-file'.&quot;&#xA;    (interactive &quot;P&quot;)&#xA;    (neo-buffer--execute arg 'neo-open-file 'neo-open-dir))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I modified my function with adding the arguments as parameters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun neotree-go-to-upper-directory (arg)&#xA;    (interactive &quot;P&quot;)&#xA;    (evil-goto-first-line)&#xA;    (neo-open-dir arg)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Re-evaluated and calling &lt;code&gt;neotree-go-to-upper-directory&lt;/code&gt; again inside Neotree&#xA;buffer, but still nothing happens. Something I went wrong. But can anyone tell&#xA;me where my code went wrong? It would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; For clarifity, as Lawlist suggested, I'm interested in a neotree&#xA;solution. But some knowledge of Elisp would be also nice, because I'm struggling&#xA;to understand why the function works for Neotree as well, and not in my case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got an working answer below: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun neotree-go-to-upper-directory ()&#xA;    &quot;Go to the parent directory in the NeoTree buffer.&quot;&#xA;    (interactive)&#xA;    (neotree-dir &quot;..&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But unfortunately, this is not always working and I can't figure out what the cause of this is.  For example, I enter a directory with &lt;code&gt;neotree-enter&lt;/code&gt; and I want to call the function, then nothing will happen. It will be only working if I call &lt;code&gt;neotree-change-root-directory&lt;/code&gt; then calling the function afterwards, it seems. And not when I do &lt;code&gt;neotree-enter&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2016-03-14T00:46:10.583" LastActivityDate="2016-03-14T00:46:10.583" Title="How to pass an argument from command to another command?" Tags="|functions|arguments|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19764" PostTypeId="1" AcceptedAnswerId="19770" CreationDate="2016-01-22T20:11:46.640" Score="1" ViewCount="259" Body="&lt;p&gt;Reading code in the wild, I seem to see less of the &quot;many small functions doing one thing each&quot; pattern in emacs lisp. Might this be due to calling functions being expensive (like in Python), so that you rather inline as much code as possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is calling elisp functions expensive?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2016-01-22T20:44:13.380" LastActivityDate="2016-04-16T01:00:15.577" Title="Is calling elisp functions expensive (time-wise)?" Tags="|functions|" AnswerCount="3" CommentCount="5" ClosedDate="2016-01-23T18:27:15.053" ContentLicense="CC BY-SA 3.0" />
  <row Id="19765" PostTypeId="1" CreationDate="2016-01-22T20:37:27.297" Score="3" ViewCount="162" Body="&lt;p&gt;I want to use &lt;a href=&quot;https://github.com/cask/cask&quot; rel=&quot;nofollow&quot;&gt;Cask&lt;/a&gt; for development, but have trouble getting it set up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone please show a minimal example with one package file, one function and one ert-test and which commands you need to 1) run the tests and 2) install the package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just something simple like an add function, and a test for 2+2.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2020-04-16T13:39:28.043" Title="Minimal working example of Cask project with ert-test?" Tags="|cask|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19766" PostTypeId="1" AcceptedAnswerId="19768" CreationDate="2016-01-22T20:54:38.330" Score="6" ViewCount="214" Body="&lt;p&gt;I configure numerous additional key bindings, and sometimes I unintentionally overwrite others.  Is there a way to determine if a key binding is taken before binding a key, and if so throw an error?&lt;/p&gt;&#xA;" OwnerUserId="2191" LastEditorUserId="105" LastEditDate="2021-12-20T00:23:37.667" LastActivityDate="2021-12-20T00:23:37.667" Title="How to tell if a key binding will overwrite another" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19767" PostTypeId="2" ParentId="19764" CreationDate="2016-01-22T21:07:00.607" Score="2" Body="&lt;p&gt;I don't have much to say about Emacs Lisp efficiency, except that I don't think it is the reason for this phenomenon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First and foremost, the language's ecosystem shapes its culture and practice. Emacs' lack of support for namespaces, modules (not the same thing as packages), and standard libraries has resulted in a culture where each contributor tries to make their code &quot;self-contained&quot;. This inevitably results in lots of duplicate work or &quot;God functions&quot;. Older code, which was written without niceties like package repositories and dependency management, is particularly prone to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also keep in mind that Emacs Lisp (or Lisp in general) is not strongly associated with the functional programming paradigm, where each function is designed to take inputs and produce outputs, avoiding (or at least minimizing) side effects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, Emacs (and GNU software in general) has never really bought into the Unix philosophy of &quot;small sharp tools&quot;. In fact, &lt;a href=&quot;http://www.johndcook.com/blog/2012/05/25/unix-doesnt-follow-the-unix-philosophy/&quot; rel=&quot;nofollow&quot;&gt;even Unix doesn't follow the Unix philosophy&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2016-04-16T01:00:15.577" LastActivityDate="2016-04-16T01:00:15.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19768" PostTypeId="2" ParentId="19766" CreationDate="2016-01-22T21:43:02.727" Score="9" Body="&lt;p&gt;See function &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Functions-for-Key-Lookup.html&quot;&gt;&lt;code&gt;lookup-key&lt;/code&gt;&lt;/a&gt;. It will tell you whether a given key is defined in a given map, including in the global map, or even (with non-nil arg &lt;code&gt;ACCEPT-DEFAULTS&lt;/code&gt;) whether it has a fallback (default) binding in the current context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you want to see whether &lt;code&gt;C-M-kp-+&lt;/code&gt; is defined in the current mode's map:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(lookup-key (current-local-map) (kbd &quot;&amp;lt;C-M-S-kp-add&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if you want to see whether it has a global binding:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(lookup-key (current-global-map) (kbd &quot;&amp;lt;C-M-S-kp-add&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if you want to see if has a default behavior in the context of the current mode, even though it is not specifically defined:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(lookup-key (current-local-map) (kbd &quot;&amp;lt;C-M-S-kp-add&amp;gt;&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Lookup.html&quot;&gt;Key Lookup&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-01-22T22:10:41.647" LastActivityDate="2016-01-22T22:10:41.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19769" PostTypeId="2" ParentId="19764" CreationDate="2016-01-22T23:49:09.180" Score="1" Body="&lt;p&gt;I've noticed this a lot also - functions that are pages long that could be decomposed into smaller (and reusable) functions. They're harder to read that way - pulling out some semantically meaningful functions would make them easier to follow, test, debug, and modify. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be leftover from days when computers were slower and had less memory, or due to the extra overhead of refactoring the code to make it more readable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is a performance hit - here's a test of inline code vs a function call&#xA;for both a simple and (simulated) complex function -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun simple-fn () (+ 1 1))&#xA;(benchmark-run 10000000 (+ 1 1))&#xA;(benchmark-run 10000000 (simple-fn))&#xA;&#xA;(defun complex-fn () (dotimes (n 100000) (+ 1 1)))&#xA;(benchmark-run 100 (dotimes (n 100000) (+ 1 1)))&#xA;(benchmark-run 100 (complex-fn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All times in seconds    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| test          | simple fn | complex fn |&#xA;|---------------+-----------+------------|&#xA;| inline        |      0.65 |       2.23 |&#xA;|               |      0.74 |       2.27 |&#xA;|               |      0.67 |       2.22 |&#xA;| avg           |      0.69 |       2.24 |&#xA;|---------------+-----------+------------|&#xA;| function call |      1.24 |       2.21 |&#xA;|               |      1.17 |       2.26 |&#xA;|               |      1.21 |       2.23 |&#xA;| avg           |      1.21 |       2.23 |&#xA;|---------------+-----------+------------|&#xA;| difference    |       75% |         0% |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The complex function has less of a performance hit because more time is spent in&#xA;the function than the function call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there would definitely be a cost for having lots of smaller functions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But as the old saying goes, premature optimization is the root of all evil -&#xA;it's best to code for readability and then optimize where needed.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I also tested with &lt;code&gt;benchmark-run-compiled&lt;/code&gt; - the results were basically the&#xA;same for the complex function, but for the simple function I got negative&#xA;numbers, despite a wait of a few seconds, so I'm not sure what was going on&#xA;there: &lt;code&gt;(benchmark-run-compiled 10000000 (+ 1 1)) =&amp;gt; -0.13&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="2462" LastEditDate="2016-01-23T00:25:15.770" LastActivityDate="2016-01-23T00:25:15.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19770" PostTypeId="2" ParentId="19764" CreationDate="2016-01-23T00:49:01.237" Score="6" Body="&lt;p&gt;To quote the Emacs Lisp Manual, appendix &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Compilation-Tips.html#Compilation-Tips&quot;&gt;D.4 Tips for Making Compiled Code Fast&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Use iteration rather than recursion whenever possible. &lt;strong&gt;Function calls are slow in Emacs Lisp even when a compiled function is calling another compiled function.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Emphasis is mine.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether the function call overhead is something one should worry about is a different question -- and I don't really want to go there. :-)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-23T00:49:01.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19771" PostTypeId="2" ParentId="19763" CreationDate="2016-01-23T05:08:08.237" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;From the package Neotree, I want to bind a key, that moves to the upper directory.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here's what I came up with after a bit of exploration.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun neotree-go-to-upper-directory ()&#xA;  &quot;Go to the parent directory in the NeoTree buffer.&quot;&#xA;  (interactive)&#xA;  (neotree-dir &quot;..&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please edit the question to make it clear if this is what you were looking for (see &lt;strong&gt;@lawlists&lt;/strong&gt;'s comment above).&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-23T05:08:08.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19772" PostTypeId="2" ParentId="19746" CreationDate="2016-01-23T08:57:05.027" Score="24" Body="&lt;p&gt;&lt;code&gt;org-agenda-log-mode&lt;/code&gt; or &lt;code&gt;C-u C-u l&lt;/code&gt; in your Agenda will give you exactly this table. Depending on the &lt;code&gt;org-agenda-log-mode-items&lt;/code&gt; variable it will restrict the agenda to entries that have been clocked or closed today (that's the default setting). To add visual emphasis to gaps and overlaps of your clocking chunks look into the &lt;code&gt;org-agenda-clock-consistency-checks&lt;/code&gt; variable.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-01-23T08:57:05.027" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19773" PostTypeId="1" AcceptedAnswerId="19779" CreationDate="2016-01-23T12:16:45.823" Score="3" ViewCount="323" Body="&lt;p&gt;Emacs has a really nice mode for applying and navigating hunks of a diff file: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Diff-Mode.html&quot; rel=&quot;nofollow&quot;&gt;Diff-Mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there doesn't seem to be a way to apply the full diff when in this mode. Is this just so obvious that I missed it?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2016-01-23T16:54:52.530" Title="apply full diff in Diff-Mode?" Tags="|diff-mode|diff|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19775" PostTypeId="1" AcceptedAnswerId="19781" CreationDate="2016-01-23T13:48:46.407" Score="1" ViewCount="1043" Body="&lt;p&gt;I want to use only one org file to export both &lt;code&gt;.tex&lt;/code&gt; and &lt;code&gt;.html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;begin_latex&lt;/code&gt; in my org files to embed maths and I can use &lt;kbd&gt;C-c '&lt;/kbd&gt; to use the &lt;code&gt;org-edit-src-code&lt;/code&gt; feature which help fast typing latex(Thus I can use Auctex and more). But it seems that the contents in &lt;code&gt;begin_latex&lt;/code&gt; will not be formatted into equations when exporting to html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I read the org manual, I know that latex code can be embedded without &lt;code&gt;begin_latex&lt;/code&gt;, and can be export to both &lt;code&gt;html&lt;/code&gt; and &lt;code&gt;tex&lt;/code&gt;. In this situation, I have to use &lt;code&gt;cdlatex&lt;/code&gt; to type latex in a org file and can &lt;em&gt;not&lt;/em&gt; use the &lt;code&gt;org-edit-src-code&lt;/code&gt; feature, which means that I lost the latex code highlighting when typing. That really annoys me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions about this?&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-01-23T18:21:06.387" Title="Export org file to html and latex" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19776" PostTypeId="1" CreationDate="2016-01-23T14:55:17.950" Score="4" ViewCount="512" Body="&lt;p&gt;I &lt;a href=&quot;http://this-plt-life.tumblr.com/post/36425231672/when-a-code-base-uses-a-directory-structure-deeper&quot; rel=&quot;nofollow&quot;&gt;prefer flatter projects&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately some languages dictate a deeper structure. When dealing with those, it helps (a little) if directory views &quot;collapse&quot; empty paths. &lt;a href=&quot;https://github.com/plumatic/schema/tree/master/src&quot; rel=&quot;nofollow&quot;&gt;Example how GitHub does this&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering how I could make &lt;code&gt;dired&lt;/code&gt; do this?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is there an existing option I'm overlooking?&lt;/li&gt;&#xA;&lt;li&gt;Is there an existing package that adds this?&lt;/li&gt;&#xA;&lt;li&gt;Should I attempt to write such a package? O_o&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;: Drew commented that the GitHub example isn't clear and asked me to explain. Their &lt;a href=&quot;https://github.com/blog/1877-folder-jumping&quot; rel=&quot;nofollow&quot;&gt;August 19, 2014 blog post&lt;/a&gt; explains a new feature they call &quot;Folder Jumping&quot;.&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="849" LastEditDate="2016-01-23T21:23:39.477" LastActivityDate="2016-03-24T19:07:16.777" Title="How to make dired &quot;collapse&quot; empty directories?" Tags="|dired|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19778" PostTypeId="1" CreationDate="2016-01-23T15:47:10.417" Score="4" ViewCount="103" Body="&lt;p&gt;I'm using Gnus to read newsgroups via nntp.  I am using mu4e to read and send e-mails.  My e-mail server credentials are stored in &lt;code&gt;~/.authinfo.gpg&lt;/code&gt; so that mu4e can access them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that whenever I open Gnus for the first time, I get asked the passphrase of the GnuPG key used to encrypt &lt;code&gt;~/.authinfo.gpg&lt;/code&gt;.  It seems that Gnus wants to open that file by default, even though it does not need any credentials to read my nntp sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can disable this automatic opening of &lt;code&gt;~/.authinfo.gpg&lt;/code&gt; whenever I open Gnus?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2016-01-23T15:47:10.417" Title="How to prevent gnus from unlocking my GnuPG key" Tags="|gnus|gpg|authinfo|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19779" PostTypeId="2" ParentId="19773" CreationDate="2016-01-23T15:56:42.230" Score="1" Body="&lt;p&gt;There doesn't seem to be a function that does that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get that functionality by using a macro. First, hit &lt;code&gt;F3 C-c C-a F4&lt;/code&gt; to define a macro that applies a hunk, and then type &lt;code&gt;C-u 0 M-x kmacro-call-macro&lt;/code&gt; to repeatedly call that macro until an error occurs (probably at the end of the diff file).&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2016-01-23T15:56:42.230" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19780" PostTypeId="2" ParentId="19143" CreationDate="2016-01-23T16:18:15.390" Score="1" Body="&lt;p&gt;Turns out the problem lies with the &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bemail/gnus/packages.el&quot; rel=&quot;nofollow&quot;&gt;default Spacemacs configuration&lt;/a&gt; I was using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution was provided to me &lt;a href=&quot;http://article.gmane.org/gmane.emacs.gnus.user/17930&quot; rel=&quot;nofollow&quot;&gt;on the Gnus mailing list&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set &lt;code&gt;gnus-fetch-old-headers&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Set &lt;code&gt;gnus-keep-backlog&lt;/code&gt; to &lt;code&gt;20&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2016-01-23T16:18:15.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19781" PostTypeId="2" ParentId="19775" CreationDate="2016-01-23T18:21:06.387" Score="1" Body="&lt;p&gt;You can write the code in a &lt;code&gt;begin_src latex&lt;/code&gt; block with &lt;code&gt;:results drawer :export results&lt;/code&gt; in the header. Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src latex :results drawer :exports results&#xA;  \[  \frac{1}{2} \]&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way you can edit the latex with full editor support and end up with raw latex. Best of both worlds!&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2016-01-23T18:21:06.387" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19782" PostTypeId="2" ParentId="19480" CreationDate="2016-01-23T18:29:29.167" Score="2" Body="&lt;p&gt;Most of what you want is achievable by adding &lt;code&gt;#+INFOJS_OPT: view:info toc:nil&lt;/code&gt; and exporting to html. Read the html export section of the  documentation for details&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2016-01-23T18:29:29.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19783" PostTypeId="1" CreationDate="2016-01-23T18:33:26.757" Score="1" ViewCount="791" Body="&lt;p&gt;I'm trying install &lt;code&gt;spacemacs&lt;/code&gt; on elementary OS,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacs --version&lt;/code&gt;: GNU Emacs 24.3.1&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon&#xA;(Spacemacs) --&amp;gt; refreshing package archive: marmalade... [1/4]&#xA;Contacting host: marmalade-repo.org:443&#xA;Contacting host: marmalade-repo.org:443&#xA;Saving file /home/mateuspv/.emacs.d/elpa/archives/marmalade/archive-contents...&#xA;Loading vc-git...&#xA;Loading vc-git...done&#xA;Wrote /home/mateuspv/.emacs.d/elpa/archives/marmalade/archive-contents&#xA;(Spacemacs) --&amp;gt; refreshing package archive: melpa... [2/4]&#xA;Contacting host: melpa.org:443&#xA;Contacting host: melpa.org:443&#xA;Saving file /home/mateuspv/.emacs.d/elpa/archives/melpa/archive-contents...&#xA;Wrote /home/mateuspv/.emacs.d/elpa/archives/melpa/archive-contents&#xA;(Spacemacs) --&amp;gt; refreshing package archive: org... [3/4]&#xA;Contacting host: orgmode.org:80&#xA;Contacting host: orgmode.org:80&#xA;Saving file /home/mateuspv/.emacs.d/elpa/archives/org/archive-contents...&#xA;Wrote /home/mateuspv/.emacs.d/elpa/archives/org/archive-contents&#xA;(Spacemacs) --&amp;gt; refreshing package archive: gnu... [4/4]&#xA;Contacting host: elpa.gnu.org:443&#xA;Saving file /home/mateuspv/.emacs.d/elpa/archives/gnu/archive-contents...&#xA;Wrote /home/mateuspv/.emacs.d/elpa/archives/gnu/archive-contents&#xA;(Spacemacs) --&amp;gt; installing package: git-gutter+@version-control... [1/3]&#xA;(Spacemacs) --&amp;gt; installing package: git-gutter-fringe+@version-control... [2/3]&#xA;(Spacemacs) --&amp;gt; installing package: helm-flx@spacemacs-base... [3/3]&#xA;Error (use-package): git-gutter+ :**init: Cannot open load file: git-gutter+**&#xA;Truncate long lines enabled&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I fix that?&lt;/p&gt;&#xA;" OwnerUserId="10861" LastEditorUserId="675" LastEditDate="2016-07-12T17:21:34.200" LastActivityDate="2016-07-12T17:21:34.200" Title="Spacemacs: Cannot open load file: git-gutter+" Tags="|spacemacs|emacs24.4|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19785" PostTypeId="1" CreationDate="2016-01-23T19:38:41.750" Score="1" ViewCount="671" Body="&lt;p&gt;I am using Emacs 24.5.1 and John Miller's &lt;a href=&quot;https://github.com/millejoh/emacs-ipython-notebook&quot; rel=&quot;nofollow&quot;&gt;fork&lt;/a&gt; of the Emacs IPython Notebook (EIN) client. The documentation indicates support for auto-completion based on auto-complete mode. As I am a company-mode user, I would like to use this mode for auto-completion, but I'm stuck on how to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within regular Python files I use the Python mode of &lt;code&gt;python.el&lt;/code&gt; (sometimes with or without Elpy) and it works perfectly. When typing a dot, I get nice tooltips (and additional documentation strings) shown. In addition, I can get documentation on every Python function easily with &lt;code&gt;C-c C-d&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to get this working in EIN? Any help is appreciated!&lt;/p&gt;&#xA;" OwnerUserId="5475" LastActivityDate="2016-01-23T19:38:41.750" Title="How can I get completion and tooltips based on company mode in Emacs Ipython Notebook?" Tags="|completion|company-mode|ipython|ein|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19786" PostTypeId="1" AcceptedAnswerId="19788" CreationDate="2016-01-23T21:01:56.010" Score="3" ViewCount="345" Body="&lt;p&gt;I'm using Spacemacs on Debian Linux.  Each time I start Gnus with &lt;code&gt;SPC a g&lt;/code&gt;, it creates a folder &lt;code&gt;~/News&lt;/code&gt; in my home directory.  I don't see the point in this, as I only use Gnus to read news via NNTP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is this folder good for, and how can I prevent Gnus from creating it?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2016-01-23T23:12:06.480" Title="How to prevent Gnus from creating a `~/News` directory?" Tags="|gnus|spacemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19788" PostTypeId="2" ParentId="19786" CreationDate="2016-01-23T22:09:01.633" Score="3" Body="&lt;p&gt;My ~/News/ folder holds (at least) drafts, cache, score-files, and the file &quot;suppression&quot; containing gnus-dup-list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you can &lt;a href=&quot;https://superuser.com/a/519687&quot;&gt;configure Gnus to put the folder somewhere else&lt;/a&gt;, but some of the things stored there are integral parts of a news reader, so I don't think you can do without it completely.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2016-01-23T23:12:06.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19789" PostTypeId="2" ParentId="19641" CreationDate="2016-01-24T00:15:19.060" Score="10" Body="&lt;p&gt;This happened to me for a while also before I had an idea of what was going on - here's an example of how something like this can happen - (if it matters, I'm on Windows, in case it's something specific to this build) - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have a file that's encoded in UTF-8, and you paste some text from a website that's encoded with the Latin-1 or Windows-1252 code page, e.g. an O with an umlaut, or curly quotes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you have a sequence of UTF-8 encoded characters followed by something which either doesn't make sense to UTF-8 or will possibly be misinterpreted. If it can't interpret it as a correct UTF-8 sequence it will display it as the raw value, e.g. octal \326 (which is an O with an umlaut in the Latin-1 code page). This is because to UTF-8, the \326 in particular is supposed to be followed by something with a 10 in the highest two bits, and if it's not, it doesn't know what to do with it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if you were to go to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Intro.html#Intro&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Intro.html#Intro&lt;/a&gt; and copy some text that included curly quotes, like &quot;The `G' in GNU&quot; and pasted it into a UTF-8 encoded buffer, you'd end up with &quot;The \221G\222 in GNU&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So... what to do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For one thing, you can look at the buffer with different encoding systems to see if it will display those characters correctly, e.g. Windows-1252 and Latin-1 are fairly common -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x revert-buffer-with-coding-system windows-1252 RET&#xA;M-x revert-buffer-with-coding-system latin-1 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the document looks better this way, you can save it with this new encoding. There are a &lt;em&gt;lot&lt;/em&gt; of different coding systems though. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put it back to UTF-8, just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x revert-buffer-with-coding-system utf-8 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for why this happens, I'm not sure - it would seem that Emacs would know how something was encoded in the clipboard and translate it accordingly, but it doesn't seem to do this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some more explanation, see &lt;a href=&quot;https://stackoverflow.com/questions/1543613/how-does-utf-8-variable-width-encoding-work&quot;&gt;https://stackoverflow.com/questions/1543613/how-does-utf-8-variable-width-encoding-work&lt;/a&gt; and &lt;a href=&quot;http://kunststube.net/encoding/&quot; rel=&quot;noreferrer&quot;&gt;http://kunststube.net/encoding/&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2462" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-01-24T00:15:19.060" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19791" PostTypeId="1" CreationDate="2016-01-24T13:55:08.123" Score="4" ViewCount="450" Body="&lt;p&gt;Currently using Bibdesk to organise my references and various associated documents. I would like if possible to use the great addons Helm-bibtex and org-ref. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To specify the location of the PDF associated with a reference it is possible to us two settings in Helm-bibtex; &quot;helm-bibtex-library-path&quot; which will look in the specified directory for a file based on the citation key and the &quot;helm-bibtex-pdf-field&quot; which will get the path to the pdf from the specified field in the bibtex entry. Currently Bibdesk stores information about attached files in fields called &quot;Bdsk-File-#&quot; where the hash is a numeric, using Base64-encoded pathnames. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, has anybody got the intergration between Bibdesk bibtex files and Helm-bibtex working using the Base64-encoded pathnames? There is a perl script on github for decoding the pathname from the Bibdesk fields &lt;a href=&quot;https://github.com/pmcarlton/BibDesk2Zotero_attachments&quot; rel=&quot;nofollow&quot;&gt;https://github.com/pmcarlton/BibDesk2Zotero_attachments&lt;/a&gt; that is used by Zotero for conversion of a Bibdesk bibtex file. Would it be possible to use this as basis to extract the information required?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could use the &quot;helm-bibtex-library-path&quot; setting instead, but I would have to override the &quot;helm-bibtex-find-pdf-in-library&quot; function, to accommodate my custom sub-directory structure (based on author name and year) and Bibdesk's requirement that the filename be unique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prefer to use the pdf field in the bibtex file, but my Lisp knowledge is limited, so any help or a point in the right direction would be appreciated to get either solution working. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update #1&lt;/strong&gt;&#xA;Although I have not figured out an answer to the above question, there does seem to be a work around using BibDesk Applescripts. From the Bibdesk website, &lt;a href=&quot;http://sourceforge.net/p/bibdesk/wiki/BibDesk_Applescripts/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/p/bibdesk/wiki/BibDesk_Applescripts/&lt;/a&gt;, Christiaan Hofman kindly provides Applescripts to automatically update the Local-Url field with the first linked file. It is possible to amend these scripts to have the Local-Url field contain all the linked files in a format similar to Mendeley.&lt;/p&gt;&#xA;" OwnerUserId="8720" LastEditorUserId="8720" LastEditDate="2016-02-05T12:30:49.387" LastActivityDate="2016-02-05T12:30:49.387" Title="Helm-bibtex and Bibdesk bibtex intergration" Tags="|helm|bibtex|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19792" PostTypeId="1" AcceptedAnswerId="19809" CreationDate="2016-01-24T14:12:36.993" Score="1" ViewCount="502" Body="&lt;p&gt;From many Emacs documentation sources, it's clear that when I have a document open, I should be able to press M-&amp;lt; and M-&gt; to go to the start and end of that document respectively. Alternatively, I could press Esc, then &amp;lt; or &gt; for the same effect. &amp;lt; and &gt; of course stand for the left and right arrows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried these keyboard shortcuts in multiple Emacs configurations (mostly emacs24 on Ubuntu 14.04) and they do not have this effect. These keystrokes cause the cursor to move between words (from the boundaries of one word to another), rather than to the beginning/end of the document. I have tried in both the terminal and GUI versions of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what the correct keystrokes are for moving the cursor to the start and end of the document?&lt;/p&gt;&#xA;" OwnerUserId="10868" LastActivityDate="2016-01-25T05:25:22.690" Title="Keystroke for moving cursor to beginning/end of document" Tags="|key-bindings|cursor|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19793" PostTypeId="1" CreationDate="2016-01-24T14:24:21.293" Score="1" ViewCount="413" Body="&lt;p&gt;I try to create an own portable installation (in USB pen drive).&#xA;The first problem is to cancel the &quot;old&quot; values looks in &lt;code&gt;exec-path&lt;/code&gt; stored.&#xA;When I insert the command &lt;code&gt;C-h v&lt;/code&gt;, I see together &quot;&lt;code&gt;exec-path&lt;/code&gt; is a variable defined in C source code&quot; followed by current exec path settings, the sentences &quot;the old value was&quot;. Is there a way to remove the last entry from the path?&lt;/p&gt;&#xA;" OwnerUserId="10559" LastEditorUserId="105" LastEditDate="2016-01-24T15:27:08.330" LastActivityDate="2016-12-20T03:27:35.750" Title="How to erase the old value in &quot;exec-path&quot; value" Tags="|init-file|customize|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19794" PostTypeId="1" CreationDate="2016-01-24T14:33:10.217" Score="1" ViewCount="49" Body="&lt;p&gt;I recently installed emacs 25 on my Windows 7 machine. Things are doing okay in general, but when I want to reach the top of buffer (M-&amp;lt;) or bottom of buffer (M-&gt;) it simply inserts the &quot;&amp;lt;&quot; or &quot;&gt;&quot; in the text, as if I didn't press the meta key. Other meta combinations seem to be working fine. On Linux (Debian) it is working just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to google the problem but I haven't found any meaningful results. I don't really know what kind of information should I provide for this, so please ask if you need to know anything more. I am using a non-English keyboard layout, but I also use the same keyboard layout on Linux, and even if I switch to English layout it still doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="10869" LastActivityDate="2016-01-24T14:33:10.217" Title="M-&lt; and M-&gt; not doing what it should on Windows" Tags="|motion|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="19795" PostTypeId="2" ParentId="19793" CreationDate="2016-01-24T15:25:07.100" Score="1" Body="&lt;p&gt;Use &lt;strong&gt;&lt;code&gt;M-x customize-option RET exec-path RET&lt;/code&gt;&lt;/strong&gt; to change the value. You can change it just for the current session, or you can change it and save the change for future Emacs sessions also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider also defining variable &lt;strong&gt;&lt;code&gt;custom-file&lt;/code&gt;&lt;/strong&gt;, so that Customize writes settings to a different file from your &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;init file&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-24T15:25:07.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19797" PostTypeId="2" ParentId="19487" CreationDate="2016-01-24T15:39:34.500" Score="1" Body="&lt;p&gt;Emacs provides commands for lining up text, including the very powerful &lt;code&gt;align-regexp&lt;/code&gt;.  Select the text to align, then execute &lt;code&gt;C-u M-x align-regexp&lt;/code&gt; with &lt;code&gt;^[[:upper:]]+\(\s-+\)&lt;/code&gt; for the regex and use 1 for both group and spacing.  It doesn't matter what you answer with regards to repetition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be easily turned into a command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-align-sql-statement ()&#xA;  (interactive)&#xA;  (align-regexp (region-beginning) (region-end)&#xA;                &quot;^[[:upper:]]+\\(\\s-+\\)&quot; 1 nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-01-24T15:39:34.500" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19798" PostTypeId="2" ParentId="19776" CreationDate="2016-01-24T16:36:00.550" Score="1" Body="&lt;p&gt;I think I should self-answer. (But it's not an exact answer to my question as-asked. So I'm not sure if I should self-accept.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to wasamasa I checked out &lt;code&gt;dired-subtree&lt;/code&gt;. Unlike plain &lt;code&gt;dired&lt;/code&gt;, it inserts subdir trees &quot;inline&quot;. Nice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next I realized I can use its &lt;code&gt;dired-subtree-cycle&lt;/code&gt; command with a prefix argument to expand N levels deep. So I bound that to &lt;kbd&gt;TAB&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package dired-subtree&#xA;  :ensure t&#xA;  :init (setq dired-subtree-use-backgrounds nil)&#xA;  :config (bind-keys :map dired-mode-map&#xA;                     ;; With C-u prefix expands N deep.&#xA;                     ;; C-u TAB will expand 4&#xA;                     ;; C-u C-u TAB will expand 16&#xA;                     ;; C-u C-u C-u TAB will expand 64&#xA;                     (&quot;TAB&quot; . dired-subtree-cycle)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a result, I can &lt;kbd&gt;C-u C-u TAB&lt;/kbd&gt; to expand 16 levels deep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can even &lt;kbd&gt;C-u C-u C-u TAB&lt;/kbd&gt; to expand 64 levels -- enough for even the most ceremonial languages (hello, Java).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another &lt;kbd&gt;TAB&lt;/kbd&gt; closes the whole subtree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although not the GitHub-style &quot;folder jumping&quot; I originally imagined, I think this will work as well or better, for me.&lt;/p&gt;&#xA;" OwnerUserId="849" LastActivityDate="2016-01-24T16:36:00.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19799" PostTypeId="2" ParentId="19793" CreationDate="2016-01-24T16:42:47.527" Score="0" Body="&lt;p&gt;A different approach, from &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_env_var_paths.html&quot; rel=&quot;nofollow&quot;&gt;this tutorial&lt;/a&gt;: &quot;By default, emacs copies the value of (getenv &quot;PATH&quot;) to exec-path. So, their values should be identical.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also try to change the PATH environment variable, prior to running emacs, to remove the executable directory you don't want.  The exec-path would be free of the directories you don't want.  This is just a little ugly since you would need a launch script, batch file, or Windows link on the portable drive to have it prune all the default executable directories in PATH you don't want.  But then, things like grep and shell commands stop working from emacs without a sufficient exec-path, so it seems you might want to leave some things in your PATH alone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To cherry pick in your startup file you could write a little Elisp like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (delete &quot;/usr/bin&quot; exec-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2375" LastActivityDate="2016-01-24T16:42:47.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19800" PostTypeId="1" AcceptedAnswerId="19807" CreationDate="2016-01-24T16:45:21.187" Score="0" ViewCount="306" Body="&lt;p&gt;The title contains the crux of my question. In &lt;code&gt;go-mode&lt;/code&gt;, tabs and auto-indentation generally works well, except when I am editing strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When inside of a string, I'd like the tab key to self-insert. Right now, it does nothing.&lt;/p&gt;&#xA;" OwnerUserId="10871" LastActivityDate="2016-01-24T22:31:52.743" Title="How to Self Insert Tab When Editing String In go-mode?" Tags="|indentation|tabs|self-insert-command|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19801" PostTypeId="1" CreationDate="2016-01-24T19:12:39.457" Score="3" ViewCount="956" Body="&lt;p&gt;When building Emacs, I use &lt;code&gt;./configure --enable-checking='glyphs'&lt;/code&gt; so that I can take advantage of some of the built-in tools such as &lt;code&gt;M-x trace-redisplay&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The redisplay debugging messages can be seen if the GUI version of Emacs was launched from the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of watching a separate terminal application while using Emacs, I would like to see the &lt;code&gt;stderr&lt;/code&gt; output — in real time (if possible¹) — from within Emacs.  For example, I would like to do some stuff in one Emacs window and be able to see &lt;code&gt;stderr&lt;/code&gt; output in another visible Emacs window.  How can I achieve that goal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;¹ &lt;sub&gt; Due to the nature of redisplay, the buffer that displays &lt;code&gt;stderr&lt;/code&gt; (when this question is answered) may not be able to update until the next command loop? &lt;/sub&gt;  &lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="25" LastEditDate="2016-03-29T09:42:49.127" LastActivityDate="2024-03-19T04:05:35.623" Title="trace-redisplay: How to see stderr from within Emacs?" Tags="|debugging|redisplay|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19803" PostTypeId="1" AcceptedAnswerId="19813" CreationDate="2016-01-24T21:31:31.007" Score="2" ViewCount="54" Body="&lt;p&gt;Let's say I've added some text to some line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some text▊&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I scroll down a bit, so that the line is out of sight: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▊&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press undo, I don't want Emacs to delete the line above immediatedly, but only locate it: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some text▊&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when I press undo a second time it should actually undo it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▊&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="600" LastEditorUserId="105" LastEditDate="2016-01-25T02:57:38.230" LastActivityDate="2016-01-25T14:23:13.460" Title="Is there a way to defer undo when the changes are off-screen?" Tags="|undo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19805" PostTypeId="2" ParentId="19487" CreationDate="2016-01-24T22:10:44.907" Score="1" Body="&lt;p&gt;I've got kind of deja vu from &lt;a href=&quot;https://emacs.stackexchange.com/questions/19002/how-align-tabs-inside-block-of-string&quot;&gt;How align tabs inside block of string?&lt;/a&gt;. ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Almost everything you need is already mentioned there.&#xA;The only thing left to say is that you can combine indentation and alignment by setting &lt;code&gt;indent-line-function&lt;/code&gt; to a function that does both.&#xA;Just press tab for indentation and you get the current line not only indented but also the current section/group aligned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;sql-indent-line&lt;/code&gt; from the package &lt;code&gt;sql-indent&lt;/code&gt; again. So the &lt;code&gt;AND&lt;/code&gt; is indented relative to &lt;code&gt;WHERE&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'align)&#xA;(require 'sql-indent)&#xA;&#xA;(defun ReneFroger-indent-relative-and-align ()&#xA;  &quot;Like `sql-indent-line' but also calls `align'.&quot;&#xA;  (prog1 ;; variable `indent-line-function' wants `noindent' when indentation is not possible&#xA;      (sql-indent-line)&#xA;      (align nil nil)))&#xA;&#xA;(defcustom align-sql-indent-rules-list&#xA;  '((space (regexp . &quot;^\\s-*[[:alnum:]]+\\(\\s-+\\)[^[:space:]]&quot;)) ;; alignment of the first second word on line&#xA;    (equal-sign (regexp . &quot;\\(\\s-*\\)=&quot;) (separate . group))) ;; alignment of assignment groups&#xA;  &quot;Alignment rules for `sql-mode'.&quot;&#xA;  :type align-rules-list-type&#xA;  :group 'sql-indent)&#xA;&#xA;(defun ReneFroger-sql-mode-hook-function ()&#xA;  &quot;All your add-ons to `sql-mode'.&quot;&#xA;  (setq indent-tabs-mode nil) ;; Do as you like. When set to t the distance of = is rather large (depending on `tab-width' or `tab-to-tab-stop').&#xA;  (setq align-mode-rules-list align-sql-indent-rules-list) ;; HERE we say how to align in `sql-mode'&#xA;  (setq indent-line-function #'ReneFroger-indent-relative-and-align))&#xA;&#xA;(add-hook 'sql-mode-hook #'ReneFroger-sql-mode-hook-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Ah yes, before you ask: You can also add &lt;code&gt;(sqlup-mode 1)&lt;/code&gt; to &lt;code&gt;ReneFroger-sql-mode-hook-function&lt;/code&gt; to get SQL keywords capitalized.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note, that you can also add the alignment rules to &lt;code&gt;align-rules-list&lt;/code&gt; instead of &lt;code&gt;align-mode-rules-list&lt;/code&gt;. The difference is that &lt;code&gt;align-rules-list&lt;/code&gt; is global while &lt;code&gt;align-mode-rules-list&lt;/code&gt; is buffer local (set when the major mode is activated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case that you use &lt;code&gt;align-rules-list&lt;/code&gt; you should add the &lt;code&gt;modes&lt;/code&gt; attribute to the alignment rule, e.g., &lt;code&gt;(modes sql-mode)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think adding the alignment rules to &lt;code&gt;align-rules-list&lt;/code&gt; is the official way. But, it makes the customization a bit more cumbersome.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-01-24T22:54:21.810" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19807" PostTypeId="2" ParentId="19800" CreationDate="2016-01-24T22:31:52.743" Score="3" Body="&lt;p&gt;The function below checks if the point is in a string using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Position-Parse.html#index-syntax_002dppss&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;syntax-ppss&lt;/code&gt;&lt;/a&gt; and inserts a &lt;code&gt;TAB&lt;/code&gt; if it is, otherwise calls &lt;code&gt;indent-for-tab-command&lt;/code&gt;, which is what &lt;code&gt;TAB&lt;/code&gt; is bound to in &lt;code&gt;go-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-indent-or-insert-tab (arg)&#xA;  &quot;Insert TAB if point is in a string, otherwise call&#xA;`indent-for-tab-command'.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if (nth 3 (syntax-ppss (point)))&#xA;      (insert &quot;\t&quot;)&#xA;    (indent-for-tab-command arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's one way to get the behavior you need with the help of this function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'go-mode-hook (lambda () (local-set-key (kbd &quot;TAB&quot;) #'my-indent-or-insert-tab)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let me know if this works for you.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-24T22:31:52.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19808" PostTypeId="1" CreationDate="2016-01-24T22:59:50.730" Score="14" ViewCount="1438" Body="&lt;p&gt;How can I mix Japanese and English in the same org-mode table (that uses fixed-width fonts)? Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;| m m m   m m m |      |&#xA;| はどう  デシウ |       |&#xA;| ﾊｰﾌ           | ﾊｰﾌ   |&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;won't align. Emacs simply counts the Japanese characters as one, when indeed they are more like 10% bigger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could the width of a column be set in pixels? I know that &amp;lt;10&gt; would set the width, but that does not help, since it counts in terms of fixed-width letters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is basically how emacs aligns columns (using the font width).&lt;/p&gt;&#xA;" OwnerUserId="9320" LastEditorUserId="2055" LastEditDate="2016-02-25T03:42:58.657" LastActivityDate="2020-07-18T00:58:36.060" Title="Align columns in Org mode table with Japanese fonts" Tags="|fonts|org-table|display|align|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19809" PostTypeId="2" ParentId="19792" CreationDate="2016-01-25T05:25:22.690" Score="1" Body="&lt;p&gt;The resource I was using mentioned the arrow keys, then shortly afterwards mentioned the M-&amp;lt; and M-&gt; shortcuts; I assumed &amp;lt; and &gt; referred to arrow keys. They actually refer to the literal '&amp;lt;' and '&gt;' operators.&lt;/p&gt;&#xA;" OwnerUserId="10868" LastActivityDate="2016-01-25T05:25:22.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19810" PostTypeId="1" AcceptedAnswerId="19811" CreationDate="2016-01-25T12:50:19.713" Score="19" ViewCount="5803" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/18896/5345&quot;&gt;This&lt;/a&gt; answer describes how to move point to the next or previous heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to move point to the next or previous heading, which is one level higher up the tree (at the parent level).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* One&#xA;** OneA&#xA;** OneB []&#xA;** OneC&#xA;* Two&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If point is the &lt;code&gt;[]&lt;/code&gt;, I would like to move point to &lt;code&gt;* One&lt;/code&gt; or &lt;code&gt;* Two&lt;/code&gt; immediately.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2019-10-23T13:18:10.170" Title="Move point to previous/next parent heading" Tags="|org-mode|outline-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19811" PostTypeId="2" ParentId="19810" CreationDate="2016-01-25T13:23:26.397" Score="34" Body="&lt;p&gt;&lt;code&gt;C-c C-u&lt;/code&gt; runs the command &lt;code&gt;outline-up-heading&lt;/code&gt;, which moves up to the parent heading. &lt;code&gt;C-c C-f&lt;/code&gt; runs the command &lt;code&gt;org-forward-same-level&lt;/code&gt; (or &lt;code&gt;org-forward-heading-same-level&lt;/code&gt; as of org mode 9.1.9), which moves forward to the next heading at the same level. You can mix and match as you like to get what you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-j&lt;/code&gt; runs the command &lt;code&gt;org-goto&lt;/code&gt;, which provides a general interface for quickly navigating through all headings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is explained in the &lt;a href=&quot;http://orgmode.org/manual/Motion.html#Motion&quot; rel=&quot;noreferrer&quot;&gt;orgmode manual&lt;/a&gt;, along with other related commands.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="19424" LastEditDate="2019-10-23T13:18:10.170" LastActivityDate="2019-10-23T13:18:10.170" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="19812" PostTypeId="1" CreationDate="2016-01-25T13:32:10.187" Score="7" ViewCount="312" Body="&lt;p&gt;I need to display word-diffs of a number of small strings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, I have a list of pairs similar to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;aaa bbb ccc&quot; . &quot;aaa vv ccc&quot;&#xA;&quot;abcd ef ghkl&quot; . &quot;ghkl&quot;&#xA;&quot;a (u -&amp;gt; h)&quot; . &quot;(a -&amp;gt; g) (u -&amp;gt; h)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In each case I'd like to highlight changed or added text. I can do this with many calls to the diff command, but I'm afraid of the cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there elisp libraries that I could use for this purpose?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="11" LastEditDate="2016-01-25T15:55:24.307" LastActivityDate="2016-07-03T22:36:44.140" Title="Lightweight (pure elisp) diffs?" Tags="|diff|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19813" PostTypeId="2" ParentId="19803" CreationDate="2016-01-25T14:23:13.460" Score="1" Body="&lt;p&gt;As I have already mentioned in the comments I would prefer &lt;code&gt;undo-tree&lt;/code&gt;.&#xA;But, with emacs there is always a way to get what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following advice of &lt;code&gt;undo&lt;/code&gt; does what you want in most cases. I think some rare cases cannot be handled.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice undo (around first-make-change-visible activate)&#xA;  &quot;Before actually un-doing make the changed position visible.&quot;&#xA;  (let (goal)&#xA;    (if (listp buffer-undo-list)&#xA;    (let ((top buffer-undo-list))&#xA;      (while (null (car top))&#xA;        (setq top (cdr top)))&#xA;      (setq top (car top))&#xA;      (cond&#xA;       ((and (consp top)&#xA;         (number-or-marker-p (car top))&#xA;         (number-or-marker-p (cdr top)); insertion starting at (car top) and ending at (cdr top)&#xA;         (null (pos-visible-in-window-p (car top)))&#xA;         (null (pos-visible-in-window-p (cdr top)))); not visible&#xA;        (setq goal (cdr top)))&#xA;       ((and (consp top)&#xA;         (stringp (car top))&#xA;         (numberp (cdr top)); deletion&#xA;         (null (pos-visible-in-window-p (cdr top)))); not visible&#xA;        (setq goal))&#xA;       ((and (consp top)&#xA;         (null (car top))&#xA;         (symbolp (nth 1 top))&#xA;         (number-or-marker-p (nth 3 top))&#xA;         (number-or-marker-p (nth-cdr 4 top)); property change&#xA;         (null (pos-visible-in-window-p (nth-cdr 4 top))))&#xA;        (setq goal (nth-cdr 4 top))))))&#xA;    (if goal&#xA;    (progn&#xA;      (goto-char goal)&#xA;      (recenter))&#xA;      ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-01-25T14:23:13.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19814" PostTypeId="2" ParentId="19810" CreationDate="2016-01-25T14:49:01.810" Score="11" Body="&lt;p&gt;As &lt;a href=&quot;https://emacs.stackexchange.com/a/17054/253&quot;&gt;the other answer on that post&lt;/a&gt; points out, &lt;code&gt;org-mode&lt;/code&gt; is built on top of &lt;code&gt;outline-mode&lt;/code&gt;, so you have access to all of the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Motion.html#Outline-Motion&quot; rel=&quot;noreferrer&quot;&gt;outline motion commands&lt;/a&gt;.  According to the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Motion.html#Outline-Motion&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt;, you can use:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-c C-f&lt;/code&gt;&#xA;  Move point to the next visible heading line at the same level as the one point is on (&lt;code&gt;outline-forward-same-level&lt;/code&gt;). &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;C-c C-b&lt;/code&gt;&#xA;  Move point to the previous visible heading line at the same level (&lt;code&gt;outline-backward-same-level&lt;/code&gt;). &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;C-c C-u&lt;/code&gt;&#xA;  Move point up to a lower-level (more inclusive) visible heading line (&lt;code&gt;outline-up-heading&lt;/code&gt;). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-01-25T14:49:01.810" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19815" PostTypeId="1" AcceptedAnswerId="19820" CreationDate="2016-01-25T16:22:07.907" Score="2" ViewCount="486" Body="&lt;p&gt;When I run magit commands through the magit interface it runs those commands relative to the branch/repository I am currently visiting. However, I am trying to write some code in my config file that will automatically push to or pull from a specific repo, and am not sure how to format magit commands in elisp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the documentation for &lt;code&gt;magit-pull-from-upstream&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Pull from the upstream of the current branch.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But what determines the current branch, and how can I specify it? &lt;code&gt;magit-push-current-to-upstream&lt;/code&gt; similarly mentions the &quot;current branch&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am looking for is a way to call these commands &lt;strong&gt;from my config file in elisp code&lt;/strong&gt; (or similar commands, if these are not the appropriate ones) while specifying which branch of which repo to pull from/push to. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-25T16:44:10.667" LastActivityDate="2016-01-25T17:35:17.493" Title="Git pull from/push to a specific branch with magit commands in elisp" Tags="|init-file|magit|git|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19816" PostTypeId="2" ParentId="19815" CreationDate="2016-01-25T16:29:18.790" Score="0" Body="&lt;p&gt;Current branch is the one currently checked out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use a non-current branch and non-default upstream, use the &lt;kbd&gt;e&lt;/kbd&gt;lsewhere option of &lt;code&gt;push&lt;/code&gt; or &lt;kbd&gt;o&lt;/kbd&gt;ther of &lt;code&gt;pull&lt;/code&gt;, which in turn run &lt;code&gt;magit-push-elsewhere&lt;/code&gt; and &lt;code&gt;magit-pull&lt;/code&gt;, respectivelly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cd &quot;/path/to/the/repo&quot;)&#xA;(magit-pull &quot;origin&quot; &quot;master&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2526" LastEditorUserId="2526" LastEditDate="2016-01-25T16:59:57.307" LastActivityDate="2016-01-25T16:59:57.307" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19817" PostTypeId="2" ParentId="19536" CreationDate="2016-01-25T17:08:46.547" Score="1" Body="&lt;p&gt;It looks like cygwin-mount.el only works for cygwin names.  Emacs already comes with &lt;code&gt;unmsys--file-name&lt;/code&gt; to convert msys names, so I used it to write an msys file name handler for &lt;code&gt;expand-file-name&lt;/code&gt; and &lt;code&gt;substitute-in-file-name&lt;/code&gt; (it's unclear to me how to know which operations are important, so I just followed cygwin-mount.el's lead.  The code below seems to work for me).&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun msys-file-name-handler (operation &amp;amp;rest args)&#xA;  &quot;Call `unmsys--file-name' on file names.&quot;&#xA;  (let ((inhibit-file-name-handlers&#xA;         (cons 'msys-file-name-handler&#xA;               (and (eq inhibit-file-name-operation operation)&#xA;                    inhibit-file-name-handlers)))&#xA;        (inhibit-file-name-operation operation))&#xA;    (pcase (cons operation args)&#xA;      (`(expand-file-name ,name . ,(or `(,directory) directory))&#xA;       (expand-file-name (unmsys--file-name name) (if directory (unmsys--file-name directory))))&#xA;      (`(substitute-in-file-name ,name)&#xA;       (substitute-in-file-name (unmsys--file-name name)))&#xA;      (_ (apply operation args)))))&#xA;&#xA;(add-to-list 'file-name-handler-alist '(&quot;\\`/[a-zA-Z]/&quot; . msys-file-name-handler))&#xA;&#xA;;; Work around apparent bug in `compilation-parse-errors'.&#xA;(defun save-match-data-advice (fun &amp;amp;rest args)&#xA;  &quot;Add this as `:around' advice to save the match-data.&quot;&#xA;  (save-match-data&#xA;    (apply fun args)))&#xA;&#xA;(advice-add 'compilation-error-properties :around #'save-match-data-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2017-02-24T19:07:40.860" LastActivityDate="2017-02-24T19:07:40.860" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19818" PostTypeId="1" AcceptedAnswerId="19825" CreationDate="2016-01-25T17:15:33.643" Score="1" ViewCount="67" Body="&lt;p&gt;I have a co-worker to edit LaTeX document. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The co-worker uses LaTeX \color and \sout command to make the changs visible in pdf file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;Hello world&lt;/code&gt; becomes &lt;code&gt;Hell{\color{red}\sout{o}a} world&lt;/code&gt;. What I do is remove the tags to make it &lt;code&gt;Hella world&lt;/code&gt;. Can I make the process automatically? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to do is that if I put a cursor on &lt;code&gt;{&lt;/code&gt; and press assigned key, emacs will remove everything &lt;code&gt;\color{red}\sout{...}&lt;/code&gt; including the outer brackets to leave only &lt;code&gt;a&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="9485" LastEditorUserId="115" LastEditDate="2016-01-25T18:00:39.363" LastActivityDate="2016-01-25T18:00:39.363" Title="Intelligently edit draft with emacs" Tags="|editing|query-replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19819" PostTypeId="1" AcceptedAnswerId="19824" CreationDate="2016-01-25T17:26:07.310" Score="11" ViewCount="3011" Body="&lt;p&gt;Is there a way, in the buffer launched from &lt;code&gt;helm-find-files&lt;/code&gt;, to copy a file path to the kill ring?&lt;/p&gt;&#xA;" OwnerUserId="2141" LastActivityDate="2016-01-26T01:08:50.397" Title="How can I use Helm File Finder to copy a file path to a buffer?" Tags="|helm|kill-ring|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19820" PostTypeId="2" ParentId="19815" CreationDate="2016-01-25T17:28:51.510" Score="2" Body="&lt;p&gt;Like many Magit &lt;em&gt;commands&lt;/em&gt;, the push commands are not really intended to be used non-interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently no warning is shown if you use them non-interactively, but that might change. The commands are not considered part of any application &lt;em&gt;programming&lt;/em&gt; interface, and I don't make any promises about their &quot;interfaces&quot; staying the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, assuming you know elisp and are also somewhat familiar with Emacs programming concepts (in particular how commands work), then I would assume it to be fairly obvious what you have to do, after looking at the various push commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;/path/to/local/repo/&quot;))&#xA;  (magit-git-push (magit-get-current-branch)&#xA;                  (magit-get-upstream-branch)&#xA;                  (magit-push-arguments)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course you should also handle the cases when there is no current branch or when it has no upstream. Again, look at &lt;code&gt;magit-push-current-to-upstream&lt;/code&gt; for one way of doing that. And since you don't actually want to push to the upstream (I believe), you'll have to adjust that part too.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But what determines the current branch, and how can I specify it?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Look at the code, specifically inside the &lt;code&gt;interactive&lt;/code&gt; form; there &lt;code&gt;magit-get-current-branch&lt;/code&gt; is being called. That then becomes the value of the &lt;code&gt;BRANCH&lt;/code&gt; argument, but only when the command is being called interactively. When it is being called non-interactively as in &lt;code&gt;(magit-push-current-to-upstream ...)&lt;/code&gt;, then the &lt;code&gt;interactive&lt;/code&gt; form is irrelevant, and you have to provide the arguments yourself, which makes it kind of pointless to use this command/function in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better use the low-level function as shown above, or if you want to avoid having to write more code than absolutely necessary, then call the command (pseudo-)interactively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-interactively #'magit-push-current-to-upstream)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-01-25T17:35:17.493" LastActivityDate="2016-01-25T17:35:17.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19821" PostTypeId="1" AcceptedAnswerId="19822" CreationDate="2016-01-25T17:33:51.043" Score="1" ViewCount="135" Body="&lt;p&gt;If I need to remove everything in a parenthesis &lt;code&gt;{...}&lt;/code&gt;, I do&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Put the cursor on &lt;code&gt;{&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;C-space&lt;/code&gt; (set mark)&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;C-M-right&lt;/code&gt; (go to the &lt;code&gt;}&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Click &lt;code&gt;C-w&lt;/code&gt; (remove selection)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How can I automatize these steps? How to do this macro-like action in emacs?&lt;/p&gt;&#xA;" OwnerUserId="9485" LastEditorUserId="9485" LastEditDate="2016-01-25T21:26:50.533" LastActivityDate="2016-01-27T03:24:54.950" Title="Macro-like feature in emacs?" Tags="|editing|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19822" PostTypeId="2" ParentId="19821" CreationDate="2016-01-25T17:35:36.043" Score="8" Body="&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html#Keyboard-Macros&quot;&gt;Keyboard Macros&lt;/a&gt; in the Emacs manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary: press &lt;code&gt;C-x (&lt;/code&gt; to start recording a macro, &lt;code&gt;C-x )&lt;/code&gt; to stop, &lt;code&gt;C-x e&lt;/code&gt; to execute.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-25T17:35:36.043" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19823" PostTypeId="1" CreationDate="2016-01-25T17:39:47.883" Score="6" ViewCount="982" Body="&lt;p&gt;I have a repeating task which repeats every four weeks, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO wash car&#xA;SCHEDULED: &amp;lt;2015-05-18 Wed ++4w&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to postpone this task by, say, two &lt;code&gt;4 weeks&lt;/code&gt; cycles starting today, by calling a lisp function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I have researched so far, I could write something in the order of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-schedule&#xA; (org-table-time-seconds-to-string&#xA;  (+&#xA;   (org-time-string-to-seconds (org-get-scheduled-time))&#xA;   (* 2 4 7 24 3600))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to have the &lt;code&gt;SCHEDULED:&lt;/code&gt; date shifted by 8 weeks forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could this be automated to shift the date by the amount specified in the repeater string, e.g. &lt;code&gt;4w&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a side note, I am not sure about the correctness of the &lt;code&gt;(org-table-time-seconds-to-string)&lt;/code&gt; function use, it is here just to illustrate the idea.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="2590" LastEditDate="2016-03-21T22:36:17.217" LastActivityDate="2016-03-21T22:36:17.217" Title="How to postpone (skip) an org-mode repeated task by a cycle or two?" Tags="|org-mode|org-agenda|todo|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19824" PostTypeId="2" ParentId="19819" CreationDate="2016-01-25T17:42:10.630" Score="10" Body="&lt;p&gt;Try &lt;code&gt;C-c TAB&lt;/code&gt; when you have the file highlighted. This will yank the path into the current buffer, which might be an undesired side effect, but as long as you do &lt;code&gt;helm-find-files&lt;/code&gt; from the buffer you want to use it in, you should be fine.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-01-25T17:49:02.313" LastActivityDate="2016-01-25T17:49:02.313" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19825" PostTypeId="2" ParentId="19818" CreationDate="2016-01-25T17:56:03.683" Score="3" Body="&lt;p&gt;You do not even need to place the cursor on that &lt;code&gt;{&lt;/code&gt;. Using the built-in &lt;code&gt;query-replace-regexp&lt;/code&gt; command (bound to &lt;code&gt;C-M-%&lt;/code&gt; by default), you can do that &lt;code&gt;\color{red}\sout{...}&lt;/code&gt; replacement either one-by-one by reviewing each replacement or in one fell swoop. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how to do those replacements in the whole document instantly.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to the beginning of the document by doing &lt;code&gt;M-&amp;lt;&lt;/code&gt; or &lt;code&gt;M-x beginning-of-buffer&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;C-M-%&lt;/code&gt; or &lt;code&gt;M-x query-replace-regexp&lt;/code&gt; and enter &lt;code&gt;{\\color{red}\\sout{.*?}\(.*?\)}&lt;/code&gt; as the search pattern and &lt;code&gt;\1&lt;/code&gt; as the replacement string.&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;!&lt;/code&gt; to do the replacements in the whole document. (Or you can hit &lt;code&gt;y&lt;/code&gt;/&lt;code&gt;n&lt;/code&gt; as appropriate as you review each replacement about to happen.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-25T17:56:03.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19826" PostTypeId="1" AcceptedAnswerId="19865" CreationDate="2016-01-25T18:43:24.670" Score="10" ViewCount="2722" Body="&lt;p&gt;After using Emacs for some time, the message &lt;code&gt;Invalid face reference: quote&lt;/code&gt; starts popping up in my message buffer. I'm not sure what causes it to start appearing.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;debug-on-message&lt;/code&gt; doesn't do anything (this is an error in the redisplay code)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;debug-on-error&lt;/code&gt; doesn't work either (for the same reason)&lt;/li&gt;&#xA;&lt;li&gt;grepping my .emacs.d for &lt;code&gt;quote&lt;/code&gt; or &lt;code&gt;'&lt;/code&gt; returns way too many results &lt;/li&gt;&#xA;&lt;li&gt;The problem is probably caused by a specific mode, but I don't know which, so debugging with &lt;code&gt;-Q&lt;/code&gt; is tricky&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What tricks could I use to locate the issue? Would a carefully crafted grep command work? Can I make font-lock output more information? Can I edit part of the Emacs C sources to get a backtrace if that message appears?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2016-01-26T21:35:53.243" LastActivityDate="2016-01-27T08:43:20.293" Title="How do I debug an &quot;Invalid face reference: quote&quot; message?" Tags="|faces|debugging|font-lock|redisplay|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19828" PostTypeId="1" AcceptedAnswerId="19831" CreationDate="2016-01-25T19:14:54.187" Score="2" ViewCount="289" Body="&lt;p&gt;The default mapping of &lt;code&gt;SPC&lt;/code&gt; in minibuffer is &lt;code&gt;(self-insert-command N)&lt;/code&gt;. However, I prefer &lt;code&gt;SPC&lt;/code&gt; to simply type a single space (for instance, in passing arguments to environments and commands within AuCTeX). Is there a way of unmapping &lt;code&gt;SPC&lt;/code&gt; in the minibuffer, and remapping it to &lt;code&gt;&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2016-01-25T21:49:48.110" Title="Make spaces show as spaces in minibuffer instead of completion" Tags="|minibuffer|whitespace|mapping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19829" PostTypeId="1" AcceptedAnswerId="19832" CreationDate="2016-01-25T19:32:28.087" Score="2" ViewCount="653" Body="&lt;p&gt;What are (if any) the lisp functions to read and write the repeater interval part of the &lt;code&gt;org-mode&lt;/code&gt; timestamps? (The ones at the end of the timestamp string, which are optional, e.g. &lt;code&gt;+1w&lt;/code&gt; or &lt;code&gt;+6d&lt;/code&gt; in &lt;code&gt;&amp;lt;2016-03-03 Thu .+6d -3d&amp;gt;&lt;/code&gt; or &lt;code&gt;[2016-01-27 Wed ++1w -2d]&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are none such functions, how does one approach creating them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any way to convert them to seconds for use in arithmetic manipulations?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="105" LastEditDate="2016-03-14T00:45:26.533" LastActivityDate="2016-03-14T00:45:26.533" Title="org-mode timestamp repeater interval manipulation" Tags="|org-mode|time-date|parse-time|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19830" PostTypeId="2" ParentId="19826" CreationDate="2016-01-25T19:38:27.460" Score="0" Body="&lt;p&gt;Start by finding a minimal way to reproduce the problem. Maybe you can record keystores (is it called &quot;lossage&quot;?) to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you tried the basic trick bisecting your configuration to locate which package/mode the problem comes from? I.e. disabling half, seeing if the problem is still there (if so, disable half of what is left, if not, disabling the other half, and so on).&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2016-01-26T22:50:11.867" LastActivityDate="2016-01-26T22:50:11.867" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19831" PostTypeId="2" ParentId="19828" CreationDate="2016-01-25T21:42:46.347" Score="3" Body="&lt;p&gt;No problem. Just bind &lt;code&gt;SPC&lt;/code&gt; to &lt;code&gt;self-insert-command&lt;/code&gt; in the minibuffer keymaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several such maps, depending on your Emacs version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;minibuffer-inactive-mode-map     minibuffer-local-completion-map  &#xA;minibuffer-local-filename-completion-map minibuffer-local-filename-must-match-map &#xA;minibuffer-local-isearch-map     minibuffer-local-map             &#xA;minibuffer-local-must-match-filename-map minibuffer-local-must-match-map &#xA;minibuffer-local-ns-map          minibuffer-local-shell-command-map &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But some of them inherit from others, so you can just bind the key in the parents.  Start with &lt;strong&gt;&lt;code&gt;minibuffer-local-completion-map&lt;/code&gt;&lt;/strong&gt;.  Probably that is the only one you need, but if not then try also &lt;code&gt;minibuffer-local-must-match-map&lt;/code&gt;. Those are the two completion maps.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key minibuffer-local-completion-map (kbd &quot;SPC&quot;) 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-01-25T21:49:48.110" LastActivityDate="2016-01-25T21:49:48.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19832" PostTypeId="2" ParentId="19829" CreationDate="2016-01-25T23:40:31.177" Score="3" Body="&lt;p&gt;See &lt;code&gt;org-element-timestamp-parser&lt;/code&gt; (parses the timestamp at point, including the repeater part) and &lt;code&gt;org-element-timestamp-interpreter&lt;/code&gt; (transforms a timestamp object back into Org syntax).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, calling &lt;code&gt;(org-element-timestamp-parser)&lt;/code&gt; with the point at the &quot;&lt;code&gt;&amp;lt;&lt;/code&gt;&quot; of &quot;&lt;code&gt;&amp;lt;2016-01-25 Mon 14:51 +1w&amp;gt;&lt;/code&gt;&quot; produces&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(timestamp (:type active&#xA;            :raw-value &quot;&amp;lt;2016-01-25 Mon 14:51 +1w&amp;gt;&quot;&#xA;            :year-start 2016&#xA;            :month-start 1&#xA;            :day-start 25&#xA;            :hour-start 14&#xA;            :minute-start 51&#xA;            :year-end 2016&#xA;            :month-end 1&#xA;            :day-end 25&#xA;            :hour-end 14&#xA;            :minute-end 51&#xA;            :begin 1&#xA;            :end 27&#xA;            :post-blank 0&#xA;            :repeater-type cumulate&#xA;            :repeater-value 1&#xA;            :repeater-unit week))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second element of this list is a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html#Property-Lists&quot; rel=&quot;nofollow&quot;&gt;property list&lt;/a&gt; that can be easily accessed and changed using &lt;code&gt;plist-get&lt;/code&gt; and &lt;code&gt;plist-put&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I found these by running &lt;code&gt;zrgrep&lt;/code&gt; in the Org source directory, searching for &quot;repeater&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PPS: I use Org-mode version 8.2.10.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-01-25T23:57:02.057" LastActivityDate="2016-01-25T23:57:02.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19833" PostTypeId="2" ParentId="18363" CreationDate="2016-01-26T00:20:18.670" Score="1" Body="&lt;p&gt;Every time ignored files show up, you move your cursor (not mouse pointer :D) to a line with an ignored file, and then type &lt;code&gt;C-u x&lt;/code&gt;.  That makes all the files in that state (ignored) disappear.  Until an update of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I could find out, they for some unfathomable reason (tried to find it, found some mails which didn't seem to make any sense) decided to... have you manually redo this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found some mails from Emacs 25 development which mention it, and... I couldn't tell what the proposed and/or implemented solution was.  We'll have to wait for 25 and see.&lt;/p&gt;&#xA;" OwnerUserId="8278" LastEditorUserId="105" LastEditDate="2016-01-26T02:17:44.940" LastActivityDate="2016-01-26T02:17:44.940" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19834" PostTypeId="2" ParentId="19819" CreationDate="2016-01-26T01:08:50.397" Score="15" Body="&lt;p&gt;If yanking the path into the current buffer is not acceptable, use &lt;code&gt;C-u C-c C-k&lt;/code&gt;, which invokes &lt;code&gt;helm-kill-selection-and-quit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation of &lt;code&gt;helm-kill-selection-and-quit&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Store display value of current selection to kill ring.&#xA;  With a prefix arg set to real value of current selection.&#xA;  Display value is what you see in `helm-buffer' and real value&#xA;  is what is used to perform actions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Tested using helm 1.9.1.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-26T01:08:50.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19835" PostTypeId="1" CreationDate="2016-01-26T03:51:12.317" Score="3" ViewCount="712" Body="&lt;p&gt;Like the title says.  I like to organize papers/books/etc that I've read, usually with a heading that has the name and a link to a pdf file.  Unfortunately, once a link is inserted in a heading it becomes impossible to create a working link to that heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example (created with org-store-link and org-insert-link):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Broken link: [[*heading%20with%20%5B%5Bfile:alink.stuff%5D%5Blinks%5D%5D][heading with links]] &#xA;* heading with [[file:alink.stuff][links]]&#xA;   - some notes here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The best solution would be a way to link only to the visible text.  That way, it would be possible to move the linked file around without breaking things.  However, any insight at all would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2016-01-26T07:38:26.843" Title="Org: linking to heading which contains a link" Tags="|org-mode|hyperlinks|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19837" PostTypeId="1" AcceptedAnswerId="19858" CreationDate="2016-01-26T04:31:28.227" Score="1" ViewCount="359" Body="&lt;p&gt;I am trying to add a hook which calls &lt;code&gt;shr-render-buffer&lt;/code&gt; after loading a file in &lt;code&gt;html-mode&lt;/code&gt;. This is what I came up with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'html-mode-hook (lambda () (call-interactively #'shr-render-buffer)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works, except not quite as expected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calling &lt;code&gt;M-x shr-render-buffer&lt;/code&gt; in an &lt;code&gt;html-mode&lt;/code&gt; buffer splits the current frame vertically, and puts the rendered output in the bottom window with the html still visible in the top window. On the other hand, if I do &lt;code&gt;find-file&lt;/code&gt; and open an html file, my hook code splits the frame vertically, but buries the html buffer, so that I have the rendered buffer on the bottom, and whichever buffer I was visiting when I did &lt;code&gt;find-file&lt;/code&gt; at the top.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is happening here? Seemingly, something with the timing is getting messed up from the way I am calling &lt;code&gt;shr-render-buffer&lt;/code&gt;, but I don't really know what/how.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-27T03:16:41.733" Title="Calling function from hook not working as expected" Tags="|hooks|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19838" PostTypeId="2" ParentId="19835" CreationDate="2016-01-26T05:13:21.337" Score="1" Body="&lt;p&gt;Seems like Org successfully stores the link to a heading like this one but fails to parse it as an internal link afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a workaround: use the &lt;code&gt;CUSTOM_ID&lt;/code&gt; property:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Working link: [[#heading-with-links][heading with links]]&#xA;* heading with [[file:alink.stuff][links]]&#xA;  :PROPERTIES:&#xA;  :CUSTOM_ID: heading-with-links&#xA;  :END:&#xA;   - some notes here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See section &lt;a href=&quot;http://orgmode.org/manual/Internal-links.html#Internal-links&quot; rel=&quot;nofollow&quot;&gt;4.2 Internal links&lt;/a&gt; of the Org manual for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The current stable version of Org (8.3.3) handles the link in the question correctly, i.e. this &lt;strong&gt;does&lt;/strong&gt; work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Working link: [[*heading%20with%20%5B%5Bfile:alink.stuff%5D%5Blinks%5D%5D][heading with links]]&#xA;* heading with [[file:alink.stuff][links]]&#xA;   - some notes here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-01-26T07:38:26.843" LastActivityDate="2016-01-26T07:38:26.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19839" PostTypeId="2" ParentId="14043" CreationDate="2016-01-26T05:31:00.590" Score="9" Body="&lt;p&gt;The reason 24.5 builds so quickly for you is that the &lt;code&gt;.elc&lt;/code&gt; files are actually distributed in the tarball, see &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/make-dist?id=emacs-24.5&quot;&gt;make-dist&lt;/a&gt;.  When building from git, the majority of the time is spent compiling the &lt;code&gt;.el&lt;/code&gt; files into &lt;code&gt;.elc&lt;/code&gt;.  By optimizing the C code, the Lisp compilation can go faster, but it still takes a long time.  Compare build times &lt;a href=&quot;https://travis-ci.org/npostavs/emacs-travis/builds/91107858&quot;&gt;using your original settings&lt;/a&gt; (~14 vs ~1 minutes)  with &lt;a href=&quot;https://travis-ci.org/npostavs/emacs-travis/builds/91142923&quot;&gt;a build using &lt;code&gt;CFLAGS='-O2 -march=native'&lt;/code&gt;&lt;/a&gt; (~9 vs ~1.5 minutes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, cloning from git takes about a minute, while downloading and unpacking the tarball takes about 5 seconds.  Compare &lt;a href=&quot;https://travis-ci.org/npostavs/emacs-travis/builds/95214811&quot;&gt;build times between versions when downloading the git archive from github&lt;/a&gt; (~5, ~6, ~8 minutes for v24.5, master, and emacs-25, respectively.  As you can see, when not using a distribution tarball, all the build times are at least the same order of magnitude. (not sure why emacs-25 was slower than master, could be random variation, or some obsolete code was removed in master?).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And, in a related question, how to I get Emacs to build quietly? Currently almost 80% of my unit test output is Emacs building. Ideally, I'd like to have &lt;code&gt;make install&lt;/code&gt; printing no output at all.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can always redirect the output to &lt;code&gt;/dev/null&lt;/code&gt;.  For my experiments I piped the &lt;code&gt;make install&lt;/code&gt; output to &lt;code&gt;grep -E '^(make|[A-Z])'&lt;/code&gt; to cut down on the output (the Travis CI javascript that formats the log on the web was having trouble with the full output).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;can I get Emacs trunk to build as fast as Emacs 24.5?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No (or yes in the sense that you can get Emacs 24.5 to build (almost) as slow as Emacs trunk :p).  But what you can do is save the the Emacs build, and just download that cached result for unit-testing.  I have implemented this in the &lt;a href=&quot;https://github.com/npostavs/emacs-travis/tree/upload&quot;&gt;upload branch&lt;/a&gt; of my emacs-travis fork, here is an &lt;a href=&quot;https://travis-ci.org/capitaomorte/yasnippet/builds/104816927&quot;&gt;example use by yasnippet&lt;/a&gt;: Emacs install time is ~2.5 seconds.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-01-26T05:31:00.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19840" PostTypeId="2" ParentId="2594" CreationDate="2016-01-26T07:54:23.053" Score="8" Body="&lt;p&gt;After crawling the &lt;code&gt;configure&lt;/code&gt; script, I think I have found your missing packet:&#xA;&lt;strong&gt;&lt;code&gt;libmagickwand-dev&lt;/code&gt;&lt;/strong&gt;. On my machine, after installing this packet, &lt;code&gt;./configure&lt;/code&gt; finally says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Does Emacs use imagemagick?                             yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;NB1: as with other features (eg &lt;code&gt;libxml2-dev&lt;/code&gt; for eww), I do not get the purpose of &lt;code&gt;--with-feature&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the libraries and development headers are on your system, &lt;code&gt;configure&lt;/code&gt; will enable the feature even if you do not explicitly ask &lt;code&gt;--with-feature&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;If the libraries and development headers are not on your system, &lt;code&gt;configure&lt;/code&gt; will ignore &lt;code&gt;--with-feature&lt;/code&gt; and exit with status 0.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;NB2: This has been tested on Ubuntu 14.04; &lt;a href=&quot;https://packages.debian.org/jessie/libmagickwand-dev&quot; rel=&quot;noreferrer&quot;&gt;libmagickwand-dev&lt;/a&gt; seems to exist in Debian too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB3: A general &quot;methodology&quot; to figure out the necessary packages from the&#xA;&lt;code&gt;configure&lt;/code&gt; script:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;search &lt;code&gt;configure&lt;/code&gt; for &quot;imagemagick&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;find these snippets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;IMAGEMAGICK_MODULE=&quot;Wand &amp;gt;= 6.3.5 Wand != 6.8.2&quot;&#xA;...&#xA;if &quot;$PKG_CONFIG&quot; --exists &quot;$IMAGEMAGICK_MODULE&quot;...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;apt-cache search Wand&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;⇒ &lt;code&gt;libmagickwand-dev - image manipulation library - development files&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10209" LastActivityDate="2016-01-26T07:54:23.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19841" PostTypeId="2" ParentId="19696" CreationDate="2016-01-26T11:06:30.737" Score="4" Body="&lt;p&gt;I've since find out that wrapping the phrase on both ends with the LEFT-TO-RIGHT MARK gives the desired result. To do that position your cursor appropriately and &lt;code&gt;C-x 8 RET LEFT-TO-RIGHT MARK&lt;/code&gt;. The visual display will fix itself and the text will be shown correctly. &lt;/p&gt;&#xA;" OwnerUserId="10832" LastActivityDate="2016-01-26T11:06:30.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19843" PostTypeId="1" CreationDate="2016-01-26T14:24:02.520" Score="12" ViewCount="3644" Body="&lt;p&gt;I have several tasks in my Org file, one of which has items starting with a checkbox (but only those). They all have a statistic cookie at their end ([n/m]).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a way to automatically update the parent task from &lt;code&gt;TODO&lt;/code&gt; to &lt;code&gt;DONE&lt;/code&gt; once all of the checkboxes are marked as done as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you would like a TODO entry to automatically change to DONE when all children are done, you can use the following setup [...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Another possibility is the use of checkboxes to identify (a hierarchy of) a large number of subtasks (see Checkboxes).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The way I understand that last part is that if children items are checkboxes, parent state should already be automatically updated (which is not the case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;org-after-todo-statistics-hook&lt;/code&gt;'s documentation (org.el):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hook that is called after a TODO statistics cookie has been updated.&#xA;  Each function is called with two arguments: the number of not-done entries&#xA;  and the number of done entries.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which means that the proposed code from orgmode.org:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-summary-todo (n-done n-not-done)&#xA;  &quot;Switch entry to DONE when all subentries are done, to TODO otherwise.&quot;&#xA;  (let (org-log-done org-log-states)   ; turn off logging&#xA;    (org-todo (if (= n-not-done 0) &quot;DONE&quot; &quot;TODO&quot;))))&#xA;&#xA;(add-hook 'org-after-todo-statistics-hook 'org-summary-todo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;won't count checkbox items.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2016-01-28T11:31:23.213" LastActivityDate="2022-04-07T15:59:56.847" Title="How to automatically adjust an Org task state with its children checkboxes" Tags="|org-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19844" PostTypeId="1" AcceptedAnswerId="74278" CreationDate="2016-01-26T15:20:45.473" Score="5" ViewCount="379" Body="&lt;p&gt;When I use &lt;code&gt;replace-string&lt;/code&gt; for the first time, it asks me for the string to replace and string to replace with. When running it again, it uses the previous values as default:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Replace string (default a -&amp;gt; b):&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to replace an empty string now. I can't just press &lt;kbd&gt;Enter&lt;/kbd&gt;, though, as that would confirm the default. Is there a way how to replace the empty string after having previously replaced something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When asked for the first time without default, just pressing &lt;kbd&gt;Enter&lt;/kbd&gt; works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I know there are other ways how to get the thing done. My question is how to enter an empty string when there's a default.&lt;/p&gt;&#xA;" OwnerUserId="2526" LastEditorUserId="2526" LastEditDate="2016-01-27T09:26:53.377" LastActivityDate="2022-10-30T07:37:34.737" Title="How to cancel the default in replace-string?" Tags="|replace|" AnswerCount="5" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19845" PostTypeId="1" AcceptedAnswerId="19892" CreationDate="2016-01-26T17:00:07.363" Score="0" ViewCount="220" Body="&lt;p&gt;For many built-in commands that require user input in the minibuffer I can yank from the middle mouse button (&lt;code&gt;mouse-yank-primary&lt;/code&gt; with &lt;code&gt;&amp;lt;down-mouse-2&amp;gt;&lt;/code&gt;). Some examples where this works are &lt;code&gt;rgrep&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;query-replace&lt;/code&gt;, &lt;code&gt;find-file&lt;/code&gt;, &lt;code&gt;execute-extended-command&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for &lt;code&gt;helm-&lt;/code&gt; related commands, I haven't found &lt;em&gt;any&lt;/em&gt; where this works. For example, with &lt;code&gt;helm-M-x&lt;/code&gt;, &lt;code&gt;helm-swoop&lt;/code&gt;, and functions that are on the &lt;code&gt;helm-completing-read-handlers-alist&lt;/code&gt;, if I try to yank from the mouse, I get the message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;down-mouse-2&amp;gt; is undefined&#xA;&amp;lt;mouse-2&amp;gt; is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the minibuffer. Is there any way to use &lt;code&gt;mouse-yank-primary&lt;/code&gt; in helm contexts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I have gotten is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map&#xA;  (kbd &quot;&amp;lt;down-mouse-2&amp;gt;&quot;) 'mouse-yank-primary)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works to yank the text into the minibuffer, but now it gives me an annoying &lt;code&gt;&amp;lt;drag-mouse-2&amp;gt; is undefined&lt;/code&gt; message which I haven't been able to get rid of, and which doesn't appear with the built-in commands mentioned above. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-01-27T23:58:33.773" Title="Yank from mouse in helm modes" Tags="|helm|mouse|yank|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19846" PostTypeId="2" ParentId="19844" CreationDate="2016-01-26T17:19:47.180" Score="1" Body="&lt;p&gt;This isn't an answer to the exact question you asked, but it does solve your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;replace-regexp&lt;/code&gt;, with the search regexp as &lt;code&gt;\([[:digit:]]\)&lt;/code&gt; and &#xA;&lt;code&gt;\1 &lt;/code&gt; as replacement (&lt;em&gt;Note that there's a space after &lt;code&gt;\1&lt;/code&gt;&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regexp captures a single digit (the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Char-Classes.html&quot; rel=&quot;nofollow&quot;&gt;character class&lt;/a&gt; &lt;code&gt;[:digit:]&lt;/code&gt;). The replacement is the group matched in the regexp followed by a space.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="115" LastEditDate="2016-01-27T03:08:09.343" LastActivityDate="2016-01-27T03:08:09.343" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19847" PostTypeId="2" ParentId="19761" CreationDate="2016-01-26T17:39:00.803" Score="2" Body="&lt;p&gt;I found a work-around by remapping backquote (or back-tick). In my &lt;em&gt;.emacs&lt;/em&gt; file I wrote: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;C-1&quot;) (kbd &quot;`&quot;))&#xA;&#xA;;;; how to tell cdlatex that it should keep Org-mode's backquote symbol?&#xA;;(eval-after-load &quot;cdlatex&quot;&#xA;;  '(define-key minor-mode-map (kbd &quot;M-9&quot;) nil) ; clean it up&#xA;;  '(define-key minor-mode-map (kbd &quot;M-9&quot;) (kbd &quot;`&quot;))) ; now set it&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried the second part, the one that's commented out but it gave me trouble so I left it out. This remapping allows me to enter the math symbols menu by invoking backquote. Once inside I can cycle through the 3 levels of symbols by pressing &lt;code&gt;@&lt;/code&gt;. Sure enough I changed the backquote character necessary to cycle and put instead 'at the rate of' with the commands &lt;em&gt;@Drew&lt;/em&gt; suggested above: &lt;code&gt;M-x customize-option RET cdlatex-math-symbol-prefix RET&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case I need to escape backquote I can type &lt;strong&gt;C-q `&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9269" LastActivityDate="2016-01-26T17:39:00.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19848" PostTypeId="1" AcceptedAnswerId="19853" CreationDate="2016-01-26T17:45:45.873" Score="6" ViewCount="5783" Body="&lt;p&gt;I recently switched to zsh (with &lt;em&gt;oh-my-zsh&lt;/em&gt;) as my primary shell, but running the shell from emacs results in some strange (for lack of a better word) &quot;residural&quot; characters; however changing to bash removes these characters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;➜  ~  ^[[?2004h bash&#xA; bash^[[?2004l&#xA;coffee@Lappy:~$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way for me to keep using zsh in emacs without it looking like absolute garbage?&lt;/p&gt;&#xA;" OwnerUserId="10872" LastEditorUserId="25" LastEditDate="2016-01-26T21:18:21.767" LastActivityDate="2016-01-26T21:32:20.160" Title="weird characters in shell mode with zsh" Tags="|shell|shell-mode|zsh|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19849" PostTypeId="1" CreationDate="2016-01-26T17:51:41.637" Score="1" ViewCount="1053" Body="&lt;p&gt;I'm trying to configure Emacs to use CNTLM to work with my company's authenticating proxy. I've followed the steps to configure CNTLM, and I've got the following in my init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq url-proxy-services&#xA;      '((&quot;http&quot; . &quot;127.0.0.1:3128&quot;)&#xA;        (&quot;https&quot; . &quot;127.0.0.1:3128&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, every time I try to perform a package-refresh-contents or a package-list command, I see a prompt at the bottom of Emacs with &quot;Username [for Cntlm for parent]:&quot;. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="8483" LastActivityDate="2017-09-10T13:39:10.833" Title="Emacs and CNTLM" Tags="|proxy|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19850" PostTypeId="1" CreationDate="2016-01-26T19:17:26.980" Score="8" ViewCount="1838" Body="&lt;p&gt;One usually adds entries to &lt;code&gt;org-publish-project-alist&lt;/code&gt; to describe what and how needs to be published, including &lt;code&gt;:publishing-directory&lt;/code&gt;, fancy &lt;code&gt;:publishing-function&lt;/code&gt; and alike. However it seems handy for some projects to reside in version controlled repository with all that it entails, i.e. different users, different checkout paths. My problem is that I cannot wrap my head around how would I go about making it all flexible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like everything to go by a &quot;standard&quot; project name no matter what repository clone I'm in, i.e. if I have multiple cloned copies of my repository, I'd like to have same project name while exporting files from subfolders. And I'd like for an export to take place, e.g. to a sibling folder, i.e. not some hard-coded paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that &lt;code&gt;.dir-locals.el&lt;/code&gt; is the way to go. But it is getting gnarly with on the fly evaluation of various path names, etc and I have to mark variable and values as safe. But minor changes cause pollution of &lt;code&gt;safe-local-variable-values&lt;/code&gt; in my &lt;code&gt;custom-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a canonical way on how to achieve such setups in general?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&#xA;Currently, I'm having a custom function that overrides quite many things (starting with looking up a working repository copy root containing &lt;code&gt;.git&lt;/code&gt;) on a global scale with &lt;code&gt;setq&lt;/code&gt; and this function is wrapped into a minor mode. It is still somewhat broken (autoload part) due to my knowledge (or lack thereof) of Elisp so I have to re-evaluate the file as some variables aren't set right. And a huge shortcoming is that I have to restart Emacs to get variables back to their original values as it is too many of them that I change (like &lt;code&gt;org-twbs-tag-class-prefix&lt;/code&gt;, &lt;code&gt;org-twbs-format-headline-function&lt;/code&gt;, &lt;code&gt;org-latex-classes&lt;/code&gt;, &lt;code&gt;org-babel-default-header-args:dot&lt;/code&gt; and more).&lt;/p&gt;&#xA;" OwnerUserId="6665" LastEditorUserId="6665" LastEditDate="2016-01-26T19:31:12.230" LastActivityDate="2017-08-09T13:15:26.107" Title="How to achieve dynamic projects without fixed paths for publishing from Org mode?" Tags="|org-mode|org-publish|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19851" PostTypeId="2" ParentId="18598" CreationDate="2016-01-26T20:05:50.317" Score="0" Body="&lt;p&gt;You can use the &lt;code&gt;-isystem&lt;/code&gt; compiler option to suppress such warnings.&#xA;If you're using a &lt;code&gt;.dir-locals.el&lt;/code&gt; setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((c++-mode . ((flycheck-clang-args . (&quot;-isystem/path/to/3rd-party-libs/include&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case you may need to configure that variable content as safe, e.g. in .emacs (if you trust any clang args):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'flycheck-clang-args 'safe-local-variable (lambda (xx) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10892" LastActivityDate="2016-01-26T20:05:50.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19852" PostTypeId="2" ParentId="19848" CreationDate="2016-01-26T20:24:24.330" Score="0" Body="&lt;p&gt;This looks like bad color encodings. Try using &lt;code&gt;ansi-color&lt;/code&gt; like so &lt;a href=&quot;http://wikemacs.org/wiki/Shell#More_colors&quot; rel=&quot;nofollow&quot;&gt;http://wikemacs.org/wiki/Shell#More_colors&lt;/a&gt; or with &lt;code&gt;M-x ansi-color-for-comint-mode-on&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps: yes it's possible, I use zsh !&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2016-01-26T20:24:24.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19853" PostTypeId="2" ParentId="19848" CreationDate="2016-01-26T21:32:20.160" Score="11" Body="&lt;p&gt;The control sequences &lt;code&gt;^[[?2004h&lt;/code&gt; and &lt;code&gt;^[[?2004l&lt;/code&gt; turn &lt;a href=&quot;http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Bracketed-Paste-Mode&quot; rel=&quot;noreferrer&quot;&gt;bracketed paste mode&lt;/a&gt; on and off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shell mode doesn't support bracketed paste mode (with these or any other control sequences), so zsh shouldn't try to turn it on. Shell mode correctly advertises that it doesn't support these control sequences by declaring &lt;code&gt;TERM=dumb&lt;/code&gt;. It seems that zsh blindly assumes that the terminal either supports or ignores these two control sequences. That's a bug in zsh, which I can reproduce with zsh from git.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround, disable bracketed paste mode in your &lt;code&gt;.zshrc&lt;/code&gt; if the terminal doesn't support escape sequences.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ $TERM = dumb ]]; then&#xA;  unset zle_bracketed_paste&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-01-26T21:32:20.160" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19854" PostTypeId="1" CreationDate="2016-01-26T22:11:21.910" Score="11" ViewCount="930" Body="&lt;p&gt;Most of the time my echo area sits empty while the modeline of each of my windows displays plenty of redundant redundant information (current time, system load, and various other buffer-independent pieces of information).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can I display the current time (right-aligned) in the echo area (whenever it is not in use?)&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-01-26T22:36:45.930" Title="Can I show a clock in the echo area?" Tags="|mode-line|echo-area|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19855" PostTypeId="2" ParentId="19763" CreationDate="2016-01-26T22:23:07.800" Score="2" Body="&lt;p&gt;Another possible solution:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun neotree-go-to-upper-directory ()&#xA;    (interactive)&#xA;    (evil-goto-first-line)&#xA;    (call-interactively #'neotree-enter))&#xA;&#xA;(evil-define-key 'normal neotree-mode-map (kbd &quot;h&quot;)'neotree-go-to-upper-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;call-interactively&lt;/code&gt; invokes the function exactly as it would have been with a keybinding, so it &lt;em&gt;should&lt;/em&gt; work, in theory that is.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Okay, so the &lt;code&gt;.. (up a dir)&lt;/code&gt; line is actually a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Buttons.html&quot; rel=&quot;nofollow&quot;&gt;button&lt;/a&gt;, which temporarily overrides &lt;kbd&gt;RET&lt;/kbd&gt; while the point is over it. In that light, the solution is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun neotree-go-to-upper-directory ()&#xA;    (interactive)&#xA;    (evil-goto-first-line)&#xA;    (call-interactively #'push-button))&#xA;&#xA;(evil-define-key 'normal neotree-mode-map (kbd &quot;h&quot;)'neotree-go-to-upper-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-01-28T22:25:47.327" LastActivityDate="2016-01-28T22:25:47.327" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19856" PostTypeId="2" ParentId="19854" CreationDate="2016-01-26T22:36:45.930" Score="4" Body="&#xA;&#xA;&lt;p&gt;You can use the &lt;a href=&quot;https://elpa.gnu.org/packages/minibuffer-line.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;minibuffer-line&lt;/code&gt;&lt;/a&gt; package from GNU ELPA for this.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'minibuffer-line)&#xA;(setq minibuffer-line-format '((:eval&#xA;                                (let ((time-string (format-time-string &quot;%l:%M %b %d %a&quot;)))&#xA;                                  (concat&#xA;                                   (make-string (- (frame-text-cols)&#xA;                                                   (string-width time-string)) ? )&#xA;                                   time-string)))))&#xA;(minibuffer-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-26T22:36:45.930" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19857" PostTypeId="2" ParentId="19826" CreationDate="2016-01-26T23:11:24.537" Score="-1" Body="&lt;p&gt;The approach I've taken for similar things is to grep the Emacs and Elpa source code for the error to find where it might be triggered, find some likely looking functions, then instrument them to invoke edebug. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Instrumenting.html#Instrumenting&quot; rel=&quot;nofollow&quot;&gt;http://www.gnu.org/software/emacs/manual/html_node/elisp/Instrumenting.html#Instrumenting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then when they get triggered, step through the code, look at the call stack, etc, and try to figure out where things are going wrong. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find anything for &quot;Invalid face reference&quot;, so this approach might not work in this case, but &quot;Invalid face&quot; had a couple of hits in the Emacs source code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C:\apps\emacs\lisp&amp;gt;grep -ir &quot;invalid face&quot; *&#xA;&#xA;ChangeLog.10:   always highlighted with the inverted invalid face.  It can&#xA;ChangeLog.14:   `face-id', which already signals an error for invalid faces.&#xA;ChangeLog.8:    The code relied on the fact that Emacs ignored invalid faces in&#xA;cus-edit.el:    (error &quot;Invalid face %S&quot; face))&#xA;cus-edit.el:                        :error (format &quot;Invalid face: %S&quot;&#xA;cus-edit.el:(add-to-list 'debug-ignored-errors &quot;^Invalid face:? &quot;)&#xA;Binary file cus-edit.elc matches&#xA;faces.el:         (t nil))))                    ; Invalid face value.&#xA;faces.el:         (t nil))))                    ; Invalid face value.&#xA;gnus/ChangeLog: place holder since this gives `Invalid face reference: nil' messages.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In that file, &lt;code&gt;customize-face&lt;/code&gt; can trigger that error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if that's where your error is happening - it could be in an Elpa package also, but that's one possible approach. &lt;/p&gt;&#xA;" OwnerUserId="2462" LastActivityDate="2016-01-26T23:11:24.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19858" PostTypeId="2" ParentId="19837" CreationDate="2016-01-27T03:00:02.597" Score="3" Body="&lt;p&gt;(1) &lt;code&gt;shr-render-current-buffer-noselect&lt;/code&gt; creates an HTML rendering of the current-buffer, but does not select or display said rendering in any particular window.  The value returned is the HTML buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) &lt;code&gt;my-display-buffer&lt;/code&gt; is a little complex in terms of its capabilities that are dependent upon the built-in library &lt;code&gt;window.el&lt;/code&gt;, which is beyond the scope of this example.  For purposes of this example, let us just focus on the third argument DIRECTION -- either &lt;code&gt;'left&lt;/code&gt;, &lt;code&gt;'right&lt;/code&gt;, &lt;code&gt;'above&lt;/code&gt;, or &lt;code&gt;'below&lt;/code&gt;.  Essentially, there are three built-in options -- &lt;strong&gt;(a)&lt;/strong&gt; if the window already displaying the target buffer exists, then that will become the target window; &lt;strong&gt;(b)&lt;/strong&gt; if there is already a window in the desired direction, then it will be used as the target window; &lt;strong&gt;(c)&lt;/strong&gt; the catch-all is to create a new window in the desired direction if (a) and (b) are not applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) &lt;code&gt;my-shr-display-buffer&lt;/code&gt; uses a direction of &lt;code&gt;'right&lt;/code&gt; in this example (see above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(4) The hook.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'shr)&#xA;&#xA;(defun shr-render-current-buffer-noselect ()&#xA;&quot;Generate (but do not select) an HTML rendering of the current buffer.&quot;&#xA;  (or (fboundp 'libxml-parse-html-region)&#xA;      (error &quot;This function requires Emacs to be compiled with libxml2&quot;))&#xA;  (let* (&#xA;      (htmlbuf (get-buffer-create &quot;*html*&quot;))&#xA;      (dom (libxml-parse-html-region (point-min) (point-max))) )&#xA;    (with-current-buffer htmlbuf&#xA;      (erase-buffer)&#xA;      (shr-insert-document dom)&#xA;      (goto-char (point-min)))&#xA;    htmlbuf))&#xA;&#xA;(defun my-display-buffer (buffer alist direction &amp;amp;optional size pixelwise)&#xA;&quot;BUFFER:  The buffer that will be displayed.&#xA;ALIST:  See the doc-string of `display-buffer' for more information.&#xA;DIRECTION:  Must use one of these symbols:  'left 'right 'below 'above&#xA;SIZE:  See the doc-string for `split-window'.&#xA;PIXELWISE:  See the doc-string for `split-window'&quot;&#xA;  (let (&#xA;      (window&#xA;        (cond&#xA;          ((get-buffer-window buffer (selected-frame)))&#xA;          ((window-in-direction direction))&#xA;          (t&#xA;            (split-window (selected-window) size direction pixelwise)))))&#xA;    (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)&#xA;    window))&#xA;&#xA;(defun my-shr-display-buffer ()&#xA;  (let ((buffer (shr-render-current-buffer-noselect)))&#xA;    (my-display-buffer buffer nil 'right nil nil)))&#xA;&#xA;(add-hook 'html-mode-hook 'my-shr-display-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-01-27T03:16:41.733" LastActivityDate="2016-01-27T03:16:41.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19859" PostTypeId="2" ParentId="19844" CreationDate="2016-01-27T03:24:33.840" Score="4" Body="&lt;p&gt;Search regexp &lt;code&gt;\(\)&lt;/code&gt; is the exact same as hitting &lt;code&gt;RET&lt;/code&gt; when trying to specify an &lt;em&gt;empty string&lt;/em&gt; for searching.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As a quick test, using both &lt;code&gt;\(\)&lt;/code&gt; and &lt;code&gt;RET&lt;/code&gt; resulted in 833 search hits for this random text block generated using a &lt;a href=&quot;http://www.blindtextgenerator.com/lorem-ipsum&quot;&gt;random text generator&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! &quot;§ $%&amp;amp; /() =? * '&amp;lt;&amp;gt;&#xA;&#xA;|; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! &quot;§ $%&amp;amp; /() =? * '&amp;lt;&amp;gt;&#xA;&#xA;|; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! &quot;§ $%&amp;amp; /() =? * '&amp;lt;&amp;gt;&#xA;&#xA;|; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! &quot;§ $%&amp;amp; /() =? * '&amp;lt;&amp;gt; |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ !&#xA;&#xA;&quot;§ $%&amp;amp; /() =? * '&amp;lt;&amp;gt; |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! &quot;§ $%&amp;amp; /() =? * '&amp;lt;&amp;gt; |; ²³~ @`´ ©«» ¤¼× {} abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI JKL MNO PQRS TUV WXYZ ! &quot;§ $%&amp;amp; /() =? * '&amp;lt;&amp;gt; |; ²³~ @`´ ©«» ¤¼× {}abc def ghi jkl mno pqrs tuv wxyz ABC DEF GHI&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But based on your comment: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The input contains digits, I need to separate them by spaces.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;using &lt;code&gt;\([[:digit:]]\)&lt;/code&gt; as &lt;strong&gt;zck&lt;/strong&gt; states in his answer would be a more efficient search regexp.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-27T03:24:33.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19860" PostTypeId="2" ParentId="19821" CreationDate="2016-01-27T03:24:54.950" Score="1" Body="&lt;p&gt;You can also use multiple-cursors as an alternative to use instead of&#xA;macros -- especially when you would only run the macro three or four&#xA;times and each one is viewable on the current page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They're not quite as powerful as macros and there's some decent&#xA;performance overhead, but it can be a more intuitive solution.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-01-27T03:24:54.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19861" PostTypeId="1" AcceptedAnswerId="19862" CreationDate="2016-01-27T03:57:47.377" Score="31" ViewCount="9897" Body="&lt;p&gt;&lt;code&gt;highlight-symbol-at-point&lt;/code&gt; is really useful however I could not find an easy way to un-highlight symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have to call &lt;code&gt;unhighlight-regexp&lt;/code&gt; repeatedly for each highlighted symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;unhighlight all highlighted symbols in a buffer&lt;/li&gt;&#xA;&lt;li&gt;unhighlight a symbol at point?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9464" LastEditorUserId="9464" LastEditDate="2016-01-27T04:17:04.370" LastActivityDate="2019-10-09T20:49:54.080" Title="How to unhighlight symbol highlighted with highlight-symbol-at-point" Tags="|highlighting|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19862" PostTypeId="2" ParentId="19861" CreationDate="2016-01-27T04:19:46.563" Score="22" Body="&lt;h2&gt;Is there a better way to unhighlight all highlighted symbols in a buffer?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h f unhighlight-regexp&lt;/code&gt;, we get&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(unhighlight-regexp REGEXP)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Remove highlighting of each match to REGEXP set by hi-lock.&#xA;  Interactively, prompt for REGEXP, accepting only regexps&#xA;  previously inserted by hi-lock interactive functions.&#xA;  If REGEXP is t (or if C-u was specified interactively),&#xA;  then remove all hi-lock highlighting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That means that we simply need to call &lt;code&gt;unhighlight-regexp&lt;/code&gt; with &lt;code&gt;t&lt;/code&gt; as its argument to remove all hi-lock highlighting in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it were a one-time thing, it could be quickly done by &lt;code&gt;M-: (unhighlight-regexp t)&lt;/code&gt; or &lt;code&gt;C-u M-s h u&lt;/code&gt;. But it seems that this is something you need to do quite often. In that case, it's better to wrap it in an &lt;code&gt;interactive&lt;/code&gt; function and bind it to some key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a proposed solution where &lt;code&gt;my/unhighlight-all-in-buffer&lt;/code&gt; is the wrapper interactive function and it is bound to &lt;code&gt;hU&lt;/code&gt; in the &lt;code&gt;search-map&lt;/code&gt;. By default the &lt;code&gt;search-map&lt;/code&gt; prefix is &lt;code&gt;M-s&lt;/code&gt;. So now, just as &lt;code&gt;M-s h u&lt;/code&gt; launches &lt;code&gt;unhighlight-regexp&lt;/code&gt;, &lt;code&gt;M-s h U&lt;/code&gt; (note the capital U) launches &lt;code&gt;my/unhighlight-all-in-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'hi-lock)        &#xA;(defun my/unhighlight-all-in-buffer ()&#xA;  &quot;Remove all highlights made by `hi-lock' from the current buffer.&#xA;The same result can also be be achieved by \\[universal-argument] \\[unhighlight-regexp].&quot;&#xA;  (interactive)&#xA;  (unhighlight-regexp t))&#xA;(define-key search-map &quot;hU&quot; #'my/unhighlight-all-in-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Is there a better way to unhighlight a symbol at point?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The good thing is that you do not need to place the point on a symbol you need to unhighlight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You simply call &lt;code&gt;M-x unhighlight-regexp&lt;/code&gt; or &lt;code&gt;M-s h u&lt;/code&gt; (its default binding) and hit &lt;code&gt;M-p&lt;/code&gt;/&lt;code&gt;M-n&lt;/code&gt; till you come across the regexp of the symbol you need to unhighlight, and hit Enter.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-01-27T04:45:45.090" LastActivityDate="2016-01-27T04:45:45.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19863" PostTypeId="1" AcceptedAnswerId="19876" CreationDate="2016-01-27T04:47:57.977" Score="11" ViewCount="6074" Body="&lt;p&gt;Hello I am new to Emacs and I have started using org mode for improving my productivity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently when I press &lt;code&gt;C-c .&lt;/code&gt; the date format displayed is &lt;code&gt;&amp;lt;2016-01-26 Thu&amp;gt;&lt;/code&gt; I would like to change it to &lt;code&gt;&amp;lt;Thu Jan 26th 2016&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make the corresponding changes in my &lt;code&gt;.emacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2016-01-27T18:40:03.713" Title="How to set my own date format for Org" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19864" PostTypeId="2" ParentId="19861" CreationDate="2016-01-27T05:04:49.887" Score="4" Body="&lt;p&gt;Another way is to use library &lt;a href=&quot;http://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Highlight&lt;/strong&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt;), commands &lt;code&gt;hlt-highlight-symbol-at-point&lt;/code&gt; and &lt;code&gt;hlt-unhighlight-symbol-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are bound default to &lt;code&gt;C-x X h s&lt;/code&gt; and &lt;code&gt;C-x X u s&lt;/code&gt;, respectively.  All of the highlighting and unhighlighting commands are bound on prefix key &lt;strong&gt;&lt;code&gt;C-x X&lt;/code&gt;&lt;/strong&gt; by default.  Highlighting commands use prefix key &lt;strong&gt;&lt;code&gt;C-x X h&lt;/code&gt;&lt;/strong&gt;.  Unhighlighting commands use prefix key &lt;strong&gt;&lt;code&gt;C-x X u&lt;/code&gt;&lt;/strong&gt;.  You can use a different prefix key than &lt;code&gt;C-x X&lt;/code&gt; by just binding it to prefix command &lt;code&gt;hlt-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Highlighting in library Highlight can use overlays or text properties (or both). The highlighting face or color can be chosen automatically (from a customized sequence of faces and colors) or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Highlighting can use property &lt;code&gt;font-lock-face&lt;/code&gt;, so that it is controlled by Font Lock mode.  Or it can use property &lt;code&gt;face&lt;/code&gt;, so that it is not controlled by it. (You can use property &lt;code&gt;face&lt;/code&gt; to highlight in buffers that do not use font-lock, and the highlighting remains in font-locked buffers when you turn off Font Lock mode.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-27T05:04:49.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19865" PostTypeId="2" ParentId="19826" CreationDate="2016-01-27T08:43:20.293" Score="4" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/Lindydancer/font-lock-studio&quot; rel=&quot;nofollow&quot;&gt;font-lock-studio&lt;/a&gt; to debug this. It's a debugger for font-lock keywords that let you single-step each step in the font-lock engine, run to breakpoints etc. Unlike the real font-lock, it enters the elisp debugger when an error occurs (if &lt;code&gt;debug-on-error&lt;/code&gt; is non-nil).&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-01-27T08:43:20.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19866" PostTypeId="1" CreationDate="2016-01-27T10:02:08.370" Score="1" ViewCount="55" Body="&lt;p&gt;Prelude has enabled a lot of very useful features, esp. auto complete. For some reason auto complete uses only lower case letters, which is not very helpful with camel-case class or function names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, given the function name handleNewMessage, auto complete suggests handlenewmessage:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/S0257.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/S0257.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get suggestions in camel case?&lt;/p&gt;&#xA;" OwnerUserId="2076" LastActivityDate="2016-01-27T10:02:08.370" Title="Set auto complete to match case" Tags="|auto-complete-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19867" PostTypeId="1" AcceptedAnswerId="19869" CreationDate="2016-01-27T10:48:30.487" Score="0" ViewCount="111" Body="&lt;p&gt;I try to switch from notmuch mail to Gnus (since the notmuch setup is too komplex; keeping the tags synchronized across three devices is very hard; and due to work requirements I have to move messages with a specific tag to a specific folder; much too complex). In notmuch I wrote this little snippet to always sign messages with GnuPG:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ck/sign-message ()&#xA;  (interactive)&#xA;  (goto-char (point-min))&#xA;  (search-forward &quot;--text follows this line--&quot;)&#xA;  (end-of-line)&#xA;  (insert &quot;\n&quot;)&#xA;&#xA;  (mml-secure-message-sign-pgpmime))&#xA;&#xA;(add-hook 'message-setup-hook 'ck/sign-message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This ensures that the signing marker is always the first thing in the new message since &lt;code&gt;mml-secure-message-sign-pgpmime&lt;/code&gt; searches for the first newline and then inserts the marker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since Gnus yanks the text after the message-setup-hook gets executed. I now end up with the signing marker after the quoted message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a hook that gets executed after the yanking? I could not find one, but maybe I’ve been overseeing it? If not: is there a different solution for this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’d like to have the marker directly below the &lt;code&gt;--text follows this line--&lt;/code&gt; marker and the quoted text below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards,&lt;/p&gt;&#xA;" OwnerUserId="2037" LastActivityDate="2016-01-27T13:38:35.230" Title="set the pgp signing marker to the top of the new message" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19868" PostTypeId="1" CreationDate="2016-01-27T13:23:28.753" Score="1" ViewCount="51" Body="&lt;p&gt;In nxml-mode, I would like to insert an XML tag that has the same name as the nearest closing tag before point, without having to retype (or complete) the same tag name each time I do it.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-02-26T19:40:21.723" Title="Insert another XML element of the same type" Tags="|nxml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19869" PostTypeId="2" ParentId="19867" CreationDate="2016-01-27T13:38:35.230" Score="1" Body="&lt;p&gt;Turns out: there is another hook, the &lt;code&gt;gnus-message-setup-hook&lt;/code&gt;. Documentation says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hook run after setting up a message buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this is also after the quoted message has been yanked.&lt;/p&gt;&#xA;" OwnerUserId="2037" LastActivityDate="2016-01-27T13:38:35.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19870" PostTypeId="2" ParentId="19868" CreationDate="2016-01-27T14:15:52.837" Score="1" Body="&lt;p&gt;This requires the &lt;code&gt;expand-region&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun repeat-element ()&#xA;  &quot;start a new XML element with the same name as the previous XML element&quot;&#xA;  (interactive)&#xA;  (er/expand-region 1)&#xA;  (replace-regexp &quot;&amp;lt;/\\([^&amp;gt;]+\\)&amp;gt;&quot; &quot;\\&amp;amp;&#xA;&amp;lt;\\1&quot; nil (region-beginning) (region-end) nil)&#xA;  (funcall indent-line-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6790" LastEditorUserId="160" LastEditDate="2016-02-26T19:40:21.723" LastActivityDate="2016-02-26T19:40:21.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19871" PostTypeId="2" ParentId="14935" CreationDate="2016-01-27T14:20:06.580" Score="3" Body="&lt;p&gt;Since this solution uses only CLI Diff, it also answers your &quot;ignore whitespace&quot; question, tweak diff's option to do whatever you want. Please &lt;code&gt;man diff&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Diff two regions&#xA;;; Step 1: Select a region and `M-x diff-region-tag-selected-as-a'&#xA;;; Step 2: Select another region and `M-x diff-region-compare-with-b'&#xA;(defun diff-region-format-region-boundary (b e)&#xA;  &quot;Make sure lines are selected and B is less than E&quot;&#xA;  (let (tmp rlt)&#xA;    ;; swap b e, make sure b &amp;lt; e&#xA;    (when (&amp;gt; b e)&#xA;      (setq tmp b)&#xA;      (setq b e)&#xA;      (set e tmp))&#xA;&#xA;    ;; select lines&#xA;    (save-excursion&#xA;      ;; Another workaround for evil-visual-line bug:&#xA;      ;; In evil-mode, if we use hotkey V or `M-x evil-visual-line` to select line,&#xA;      ;; the (line-beginning-position) of the line which is after the last selected&#xA;      ;; line is always (region-end)! Don't know why.&#xA;      (if (and (&amp;gt; e b)&#xA;               (save-excursion (goto-char e) (= e (line-beginning-position)))&#xA;               (boundp 'evil-state) (eq evil-state 'visual))&#xA;          (setq e (1- e)))&#xA;      (goto-char b)&#xA;      (setq b (line-beginning-position))&#xA;      (goto-char e)&#xA;      (setq e (line-end-position)))&#xA;    (setq rlt (list b e))&#xA;    rlt))&#xA;&#xA;(defun diff-region-tag-selected-as-a ()&#xA;  &quot;Select a region to compare&quot;&#xA;  (interactive)&#xA;  (when (region-active-p)&#xA;    (let (tmp buf)&#xA;      ;; select lines&#xA;      (setq tmp (diff-region-format-region-boundary (region-beginning) (region-end)))&#xA;      (setq buf (get-buffer-create &quot;*Diff-regionA*&quot;))&#xA;      (save-current-buffer&#xA;        (set-buffer buf)&#xA;        (erase-buffer))&#xA;      (append-to-buffer buf (car tmp) (cadr tmp))))&#xA;  (message &quot;Now select other region to compare and run `diff-region-compare-with-b`&quot;))&#xA;&#xA;(defun diff-region-compare-with-b ()&#xA;  &quot;Compare current region with region selected by `diff-region-tag-selected-as-a' &quot;&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (let (rlt-buf&#xA;            diff-output&#xA;            (fa (make-temp-file (expand-file-name &quot;scor&quot;&#xA;                                                  (or small-temporary-file-directory&#xA;                                                      temporary-file-directory))))&#xA;            (fb (make-temp-file (expand-file-name &quot;scor&quot;&#xA;                                                  (or small-temporary-file-directory&#xA;                                                      temporary-file-directory)))))&#xA;        (when fb&#xA;          (setq tmp (diff-region-format-region-boundary (region-beginning) (region-end)))&#xA;          (write-region (car tmp) (cadr tmp) fb))&#xA;&#xA;        (setq rlt-buf (get-buffer-create &quot;*Diff-region-output*&quot;))&#xA;        (when (and fa (file-exists-p fa) fb (file-exists-p fb))&#xA;          (save-current-buffer&#xA;            (set-buffer (get-buffer-create &quot;*Diff-regionA*&quot;))&#xA;            (write-region (point-min) (point-max) fa))&#xA;          (setq diff-output (shell-command-to-string (format &quot;diff -Nabur %s %s&quot; fa fb)))&#xA;          ;; show the diff output&#xA;          (if (string= diff-output &quot;&quot;)&#xA;              (message &quot;Two regions are SAME!&quot;)&#xA;              (save-current-buffer&#xA;                (switch-to-buffer-other-window rlt-buf)&#xA;                (set-buffer rlt-buf)&#xA;                (erase-buffer)&#xA;                (insert diff-output)&#xA;                (diff-mode))))&#xA;&#xA;        (if (and fa (file-exists-p fa))&#xA;            (delete-file fa))&#xA;        (if (and fb (file-exists-p fb))&#xA;            (delete-file fb)))&#xA;    (message &quot;Please select region at first!&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-01-28T02:46:22.010" LastActivityDate="2016-01-28T02:46:22.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19872" PostTypeId="1" CreationDate="2016-01-27T14:59:22.720" Score="0" ViewCount="81" Body="&lt;p&gt;I have auto-insert-mode configured to insert a basic XML file in nxml-mode, but nxml-mode is then still configured to use an empty schema, as if the file was still empty. How can I automatically make nxml-mode use the correct schema corresponding to the template? Set schema automatically in the menus does work, but I want to run this automatically.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-01-28T14:04:31.487" Title="Set schema automatically after auto-insert" Tags="|nxml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19873" PostTypeId="1" AcceptedAnswerId="19889" CreationDate="2016-01-27T15:28:48.143" Score="1" ViewCount="990" Body="&lt;p&gt;it is my first time asking question here. I am a college sophomore. I am taking a Matlab course this semester and find Octave an alternative so I get that installed through Homebrew in my Mac. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that Octave doesn't seem to be compatible with emacs (or saying, lots of bugs?). First of all, functions like clc, clean won't work in Emacs (by running M-x run-octave) while it works in the terminal. Also, I was trying to make plotting work but whenever I tried to plot in Emacs, they say &quot;no graphics toolkits are available!,&quot; further verified by typing &quot;available_graphics_toolkits&quot; and they shown nothing. The strange thing is that if I run the same line &quot;available_graphics_toolkits&quot; in the terminal, gnuplot does shown up. It seems like I  get everything set up but Emacs just somehow doesn't recognize it. I have done research online but still problem not solved.&#xA;Here are some screenshots:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/mRYMH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mRYMH.png&quot; alt=&quot;Everything works fine in Terminal&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/o4jeI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o4jeI.png&quot; alt=&quot;Everything is not working in Emacs&quot;&gt;&lt;/a&gt;&#xA;[My OS version] [need at least 10 reputation :(]&#xA;OSX El Capitain Version 10.11.3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Octave settings in ~/.emacs] [need at least 10 reputation :(]&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;Manipulating the Load Path for Octave&#xA;(setq inferior-octave-program &quot;/usr/local/bin/octave&quot;)&#xA;;Fix the frezze error&#xA;(setq inferior-octave-prompt &quot;&amp;gt;&amp;gt; &quot;)&#xA;;Fix can't find the program error&#xA;(add-to-list 'load-path &quot;/usr/local/bin/gnuplot&quot;)&#xA;;Octave Settings&#xA;;using Octave mode for all .m files you visit&#xA;(setq auto-mode-alist&#xA;      (cons '(&quot;\\.m$&quot; . octave-mode) auto-mode-alist))&#xA;;turn on the abbrevs, auto-fill and font-lock features automatically&#xA;(add-hook 'octave-mode-hook&#xA;          (lambda ()&#xA;            (abbrev-mode 1)&#xA;            (auto-fill-mode 1)&#xA;            (if (eq window-system 'x)&#xA;                (font-lock-mode 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let me know for any further information and feel free to give me advises on how to make my question better. Thank you so much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE1&lt;/strong&gt;: Tried installing the package exec-path-from-shell as Dan suggested, doesn't seem to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE2&lt;/strong&gt;: UPDATE1 actually work after I put those lines in to ~/.emacs instead of ~/.emacs.d/init.el Now the only thing that is bugging me is the clc command still doesn't work. Any ideas? &lt;/p&gt;&#xA;" OwnerUserId="10243" LastEditorUserId="253" LastEditDate="2016-01-29T21:47:08.530" LastActivityDate="2016-01-29T21:47:08.530" Title="[OSX]Octave not quite working within Emacs" Tags="|osx|octave|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19874" PostTypeId="1" CreationDate="2016-01-27T16:02:27.293" Score="2" ViewCount="139" Body="&lt;p&gt;I have the following document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Test&#xA;| Links |&#xA;|-------|&#xA;| [[http://emacs.stackexchange.com/questions/ask]] |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This Link is not recognized as a Link. If I press TAB while the cursor is on the link the cursor moves to the beginning of the line and I get a warning in messages:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;font-lock-fontify-keywords-region: Wrong type argument: listp, org-table&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I remove http from the link, it works. If I change http to some other term like httpd it works also. It just seems, http and https do not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong? What is missing? How can I add a external http link to an org table?&lt;/p&gt;&#xA;" OwnerUserId="10903" LastActivityDate="2016-01-27T16:02:27.293" Title="External http link not recognized as link" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19875" PostTypeId="1" AcceptedAnswerId="40512" CreationDate="2016-01-27T16:28:11.653" Score="5" ViewCount="611" Body="&lt;p&gt;Within helm I'd like to find all of the files that have the content 'foo' and 'bar', even if 'foo' and 'bar' are on different lines.&lt;/p&gt;&#xA;" OwnerUserId="10904" LastEditorUserId="10904" LastEditDate="2016-01-27T17:25:38.533" LastActivityDate="2018-03-19T04:32:37.510" Title="How to find files by content across lines with helm" Tags="|helm|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19876" PostTypeId="2" ParentId="19863" CreationDate="2016-01-27T18:15:07.150" Score="13" Body="&lt;p&gt;You can start with something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default org-display-custom-times t)&#xA;(setq org-time-stamp-custom-formats '(&quot;&amp;lt;%a %b %e %Y&amp;gt;&quot; . &quot;&amp;lt;%a %b %e %Y %H:%M&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will give you &lt;code&gt;&amp;lt;Thu Jan 26 2016&amp;gt;&lt;/code&gt; for date timestamps or &lt;code&gt;&amp;lt;Thu Jan 26 2016 11:30&amp;gt;&lt;/code&gt; for timestamps with times. If you want zero-padded dates instead of blank-padded dates use &lt;code&gt;%d&lt;/code&gt; instead of &lt;code&gt;%e&lt;/code&gt; above (e.g., if you want &lt;code&gt;09&lt;/code&gt; instead of &lt;code&gt;9&lt;/code&gt;, but I figured blank-padded would be better if you figure out a way to add the ordinal suffix). For a comprehensive list of the formatting symbols, see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. You can try to combine this with the solution &lt;a href=&quot;https://stackoverflow.com/a/20317537/3642398&quot;&gt;here&lt;/a&gt; as suggested by @KaushalModi, but I haven't gotten that to work yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you use custom timestamps in org-mode, be aware that there are sometimes undesired side-effects: see &lt;a href=&quot;https://emacs.stackexchange.com/questions/19488/can-org-tables-cooperate-with-my-customized-dates/19492#19492&quot;&gt;this question and answer&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/manual/Custom-time-format.html&quot; rel=&quot;noreferrer&quot;&gt;this page&lt;/a&gt; from the org manual.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-01-27T18:40:03.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19877" PostTypeId="1" AcceptedAnswerId="19878" CreationDate="2016-01-27T18:15:16.797" Score="26" ViewCount="4716" Body="&lt;p&gt;The question pretty much says it all: I have a string containing the source code for a valid Elisp expression, and I would like to evaluate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In Python, for example, the expression &lt;code&gt;eval(&quot;1 - 2 + 3&quot;)&lt;/code&gt; evaluates to 2.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-03-14T00:45:03.687" LastActivityDate="2022-02-25T21:14:30.153" Title="How to evaluate Elisp code contained in a string?" Tags="|read|eval|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19878" PostTypeId="2" ParentId="19877" CreationDate="2016-01-27T18:26:02.263" Score="30" Body="&lt;p&gt;Evaluating a string of elisp code is a two-stage process: you need to parse the string using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Input-Functions.html#index-read_002dfrom_002dstring&quot;&gt;&lt;code&gt;read-from-string&lt;/code&gt;&lt;/a&gt; and then evaluate the resulting Lisp expression with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Eval.html#index-eval&quot;&gt;&lt;code&gt;eval&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval-string (string)&#xA;  &quot;Evaluate elisp code stored in a string.&quot;&#xA;  (eval (car (read-from-string string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;(my-eval-string &quot;(+ 1 2)&quot;)&lt;/code&gt; evaluates to &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As pointed out by &lt;strong&gt;@lunaryorn&lt;/strong&gt;, &lt;code&gt;read-from-string&lt;/code&gt; &lt;em&gt;reads the first expression only&lt;/em&gt;, so this should be better:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval-string (string)&#xA;  (eval (car (read-from-string (format &quot;(progn %s)&quot; string)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To evaluate elisp code for side effects one could also use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Current-Buffer.html#index-with_002dtemp_002dbuffer&quot;&gt;&lt;code&gt;with-temp-buffer&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Eval.html#index-eval_002dbuffer&quot;&gt;&lt;code&gt;eval-buffer&lt;/code&gt;&lt;/a&gt; (&lt;code&gt;eval-buffer&lt;/code&gt; always returns &lt;code&gt;nil&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval-string-for-side-effects (string)&#xA;  &quot;Evaluate a string of elisp code for side effects.&quot;&#xA;  (with-temp-buffer&#xA;    (insert string)&#xA;    (eval-buffer)))&#xA;&#xA;(my-eval-string-for-side-effects &quot;(message \&quot;hello!\&quot;)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-01-28T15:51:22.873" LastActivityDate="2016-01-28T15:51:22.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19879" PostTypeId="1" CreationDate="2016-01-27T19:45:20.340" Score="0" ViewCount="183" Body="&lt;p&gt;I want to list all items with specified TODO and then export into html.&#xA; &lt;code&gt;C-c a T&lt;/code&gt; is used, but it only shows the headlines such as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TODO 1&#xA;TODO 2&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I show that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TODO 1&#xA;blablablabla&#xA;....&#xA;TODO 2&#xA;blablablabla&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also I use &lt;code&gt;C-c / T&lt;/code&gt;, but when I export to html, it exports all items.&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="9923" LastEditDate="2016-01-27T20:15:47.360" LastActivityDate="2016-03-27T23:18:51.493" Title="filter todo keywords and shows contents" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19880" PostTypeId="1" AcceptedAnswerId="19881" CreationDate="2016-01-27T19:50:56.447" Score="20" ViewCount="10721" Body="&lt;p&gt;I love the ability to &lt;a href=&quot;http://orgmode.org/manual/Previewing-LaTeX-fragments.html#Previewing-LaTeX-fragments&quot; rel=&quot;noreferrer&quot;&gt;preview LateX fragments&lt;/a&gt; in Org-mode. With two easy shortcuts one can turn them on and off on-demand:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Turning previewing ON: &lt;code&gt;C-c C-x, C-l&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Turning previewing OFF: &lt;code&gt;C-c C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One problem I encounter often is that the preview has a small font size. Is there any way to control it?&lt;/p&gt;&#xA;" OwnerUserId="6" LastActivityDate="2017-07-06T15:09:00.980" Title="Font size control of LateX previews in Org files" Tags="|org-mode|latex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19881" PostTypeId="2" ParentId="19880" CreationDate="2016-01-27T19:57:38.037" Score="20" Body="&lt;p&gt;You can customize the variable &lt;code&gt;org-format-latex-options&lt;/code&gt; to increase &lt;code&gt;:scale&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Org Manual, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Previewing-LaTeX-fragments.html&quot; rel=&quot;noreferrer&quot;&gt;11.7.4 Previewing LaTeX fragments&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-27T19:57:38.037" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19882" PostTypeId="1" CreationDate="2016-01-27T20:35:13.623" Score="4" ViewCount="966" Body="&lt;p&gt;When I run &lt;code&gt;helm-M-x&lt;/code&gt; (&lt;code&gt;SPC :&lt;/code&gt;) in Spacemacs, the first time is slow in loading/showing. Is there a way to &quot;preload&quot; it during startup/.spacemacs?&lt;/p&gt;&#xA;" OwnerUserId="10906" LastEditorUserId="2274" LastEditDate="2016-01-28T01:31:14.550" LastActivityDate="2016-01-28T16:50:02.820" Title="How to speed up the initial use of `helm-M-x`?" Tags="|helm|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19884" PostTypeId="1" AcceptedAnswerId="19888" CreationDate="2016-01-27T21:10:30.017" Score="2" ViewCount="182" Body="&lt;p&gt;The following snippet, featuring the &quot;fantasy function&quot; &lt;code&gt;clone-function&lt;/code&gt;, illustrates what I'd like to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar last-enabled-foo nil)&#xA;&#xA;;; hold on to a &quot;clone&quot;/copy of third-party function enable-foo&#xA;(defvar original-enable-foo (clone-function 'enable-foo))&#xA;&#xA;;; replace enable-foo with a wrapper function around it&#xA;;; module foo.el&#xA;(defun enable-foo (foo)&#xA;  (setq last-enabled-foo foo)&#xA;  (funcall original-enable-foo foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically, &lt;code&gt;clone-function&lt;/code&gt; ensures that &lt;code&gt;original-enable-foo&lt;/code&gt; refers to a function that is completely distinct from the newly defined &lt;code&gt;enable-foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could one implement &lt;code&gt;clone-function&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-03-14T00:43:48.183" LastActivityDate="2016-03-14T00:43:48.183" Title="On monkey-patching a third-party function" Tags="|customize|advice|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19885" PostTypeId="2" ParentId="19884" CreationDate="2016-01-27T21:26:21.407" Score="4" Body="&lt;p&gt;I agree that using advice is probably the way to go, but if you really, truly have to, you can use something like this. (Comments are welcome.)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun third-party-func ()&#xA;  (message &quot;original&quot;))&#xA;&#xA;(defalias 'third-party-func-original&#xA;          (symbol-function 'third-party-func))&#xA;&#xA;(defun third-party-func ()&#xA;  (message &quot;new!&quot;)&#xA;  (third-party-func-original))&#xA;&#xA;; now (third-party-func) calls the patched version;&#xA;; (third-party-func-original) calls the original version&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-01-27T22:21:02.897" LastActivityDate="2016-01-27T22:21:02.897" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19887" PostTypeId="2" ParentId="19879" CreationDate="2016-01-27T21:52:46.033" Score="1" Body="&lt;p&gt;To show the first few lines of an entry in an agenda view use the entry text view mode: &lt;code&gt;v E&lt;/code&gt;.  The number of lines shown can be configured by setting &lt;code&gt;org-agenda-entry-text-maxlines&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-01-27T21:52:46.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19888" PostTypeId="2" ParentId="19884" CreationDate="2016-01-27T21:54:49.897" Score="7" Body="&#xA;&#xA;&lt;p&gt;For variety, here's a solution using the &lt;code&gt;:around&lt;/code&gt; advice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Copy the below test snippet to the *scratch* buffer and evaluate the &lt;code&gt;progn&lt;/code&gt; form. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (defvar last-enabled-foo nil)&#xA;  (setq last-enabled-foo nil)&#xA;&#xA;  (defun enable-foo (foo)&#xA;    (message &quot;last-enabled-foo = %S&quot; last-enabled-foo))&#xA;&#xA;  (defun adv/enable-foo (orig-fun &amp;amp;rest args)&#xA;    (setq last-enabled-foo args)&#xA;    (apply orig-fun args))&#xA;  (advice-add 'enable-foo :around #'adv/enable-foo)&#xA;  ;; Comment the below line to see the advice in effect&#xA;  (advice-remove 'enable-foo #'adv/enable-foo)&#xA;&#xA;  (enable-foo 9))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;With the way it is right now, you will always see the output as:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;last-enabled-foo = nil&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is because we are setting the &lt;code&gt;last-enabled-foo&lt;/code&gt; value to &lt;code&gt;nil&lt;/code&gt; and the value &lt;code&gt;9&lt;/code&gt; passed to &lt;code&gt;enable-foo&lt;/code&gt; is not being assigned to &lt;code&gt;last-enabled-foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq last-enabled-foo nil)&#xA;(defun enable-foo (foo)&#xA;  (message &quot;last-enabled-foo = %S&quot; last-enabled-foo))&#xA;(enable-foo 9)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The advice code is ineffective as we are adding an advice and then again removing the same.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now comment out the &lt;code&gt;(advice-remove ..)&lt;/code&gt; line. &lt;strong&gt;Now&lt;/strong&gt; the advice will be in effect and you will see the &lt;em&gt;magic&lt;/em&gt; when you re-evaluate that same &lt;code&gt;progn&lt;/code&gt; form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the output will be:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;last-enabled-foo = (9)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, even though the &lt;code&gt;setq&lt;/code&gt; form is setting the &lt;code&gt;last-enabled-foo&lt;/code&gt; value to &lt;code&gt;nil&lt;/code&gt; during each &lt;code&gt;progn&lt;/code&gt; evaluation, it is being set to the &lt;code&gt;enable-foo&lt;/code&gt; argument &lt;code&gt;args&lt;/code&gt; inside the advice function &lt;code&gt;adv/enable-foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun adv/enable-foo (orig-fun &amp;amp;rest args)&#xA;  (setq last-enabled-foo args)&#xA;  (apply orig-fun args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot;&gt;Advising Emacs Lisp Functions&lt;/a&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advice-combinators.html#Advice-combinators&quot;&gt;Advice Combinators like &lt;code&gt;:around&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Named-Functions.html#Advising-Named-Functions&quot;&gt;&lt;code&gt;advice-add&lt;/code&gt; and &lt;code&gt;advice-remove&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-01-27T22:00:52.237" LastActivityDate="2016-01-27T22:00:52.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19889" PostTypeId="2" ParentId="19873" CreationDate="2016-01-27T22:07:58.240" Score="1" Body="&lt;p&gt;&lt;em&gt;(Migrated from a comment.)&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can get Octave to work in the terminal but not in Emacs, it may be a problem with Emacs getting access to your OSX path.  See &lt;a href=&quot;https://emacs.stackexchange.com/a/10737/253&quot;&gt;this answer&lt;/a&gt;, which suggests installing the &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;exec-path-from-shell&lt;/code&gt;&lt;/a&gt; package to deal with that problem (which you can do via the Emacs package manager: &lt;code&gt;M-x list-packages&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-01-27T22:07:58.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19890" PostTypeId="2" ParentId="19748" CreationDate="2016-01-27T22:33:27.363" Score="0" Body="&lt;p&gt;Per @Constantine's comment above, this seems to have been a problem with the version of yasnippet I was using. I use Spacemacs, and I resolved the problem by removing yasnippet from my manual package configuration, and instead enabling the &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/auto-completion&quot; rel=&quot;nofollow&quot;&gt;spacemacs auto-completion layer&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-01-27T22:33:27.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19891" PostTypeId="2" ParentId="19875" CreationDate="2016-01-27T23:02:15.537" Score="0" Body="&lt;p&gt;If you are not limited to Helm, you can do this easily using &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x C-f&lt;/code&gt; &lt;code&gt;C-M-j&lt;/code&gt; &lt;strong&gt;&lt;code&gt;foo&lt;/code&gt;&lt;/strong&gt; &lt;code&gt;S-SPC&lt;/code&gt; &lt;code&gt;C-M-j&lt;/code&gt; &lt;strong&gt;&lt;code&gt;bar&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Translation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-x C-f&lt;/code&gt; is the command for finding a file (&lt;code&gt;icicle-file&lt;/code&gt;).  It uses &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Multi-Completions&quot; rel=&quot;nofollow&quot;&gt;multi-completion&lt;/a&gt; input (like the Helm command you are used to, I presume).  This means that you can match either file &lt;em&gt;name&lt;/em&gt; or file &lt;em&gt;content&lt;/em&gt;, or both.  In this case, you apparently do not care about the file names, so you match only the content (see next).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-M-j&lt;/code&gt; is (by default) the key that separates file-name pattern from file-content pattern.  You can use any key you like for this -- it's customizable (but there is a good reason for this odd-seeming default value). You use this key immediately, because there is no file-name pattern to match in your case. You use it to go on to specifying a file-content pattern.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;foo&lt;/code&gt; is the first pattern that you want the file content to match.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;S-SPC&lt;/code&gt; is the key to narrow to the current set of completion candidates, in this case, all files that contain a match for &lt;code&gt;foo&lt;/code&gt; (which in this case is a literal pattern, so all files that contain &lt;code&gt;foo&lt;/code&gt;). You can think of this key as &quot;locking-in&quot; a set of matches so that they become the new domain to match against. (Again, the key that does this is only &lt;code&gt;S-SPC&lt;/code&gt; by default; you can customize it to be any other key.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-M-j&lt;/code&gt; again, to skip a file-name pattern and provide another file-content pattern.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;bar&lt;/code&gt; is the second pattern that you want the file content to match.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What you see now is the set of files you are after. You can choose one to visit, or you can visit &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Choose_All_Candidates&quot; rel=&quot;nofollow&quot;&gt;all of them&lt;/a&gt; at once (using &lt;code&gt;C-!&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#SecondExampleMultiCompletion&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is another example you can follow, with explanations:&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-27T23:02:15.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19892" PostTypeId="2" ParentId="19845" CreationDate="2016-01-27T23:58:33.773" Score="3" Body="&lt;p&gt;After poking around the helm source code a bit, it looks like helm tries to temporarily override all the mouse commands using the minor mode &lt;code&gt;helm--remap-mouse-mode&lt;/code&gt;, and this is most likely the source of your issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the caveat that I don't have any experience with using the mouse in Emacs, there are several solutions that occur to me here, in increasing order of sophistication/precision:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Solution #1: The reason helm is trying to disable the mouse here is because by default helm won't let you leave the minibuffer when it's active.  If you're fine with being able to leave the minibuffer (including with commands like &lt;code&gt;other-window&lt;/code&gt;), you can set &lt;code&gt;helm-prevent-escaping-from-minibuffer&lt;/code&gt; to nil.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Solution #2: You can just disable &lt;code&gt;helm--remap-mouse-mode&lt;/code&gt; entirely.  Here's some advice to just prevent it from ever being turned on.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add #'helm--remap-mouse-mode :override #'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Solution #3: Apparently bindings in &lt;code&gt;helm-map&lt;/code&gt; will shadow those in &lt;code&gt;helm--remap-mouse-mode-map&lt;/code&gt;, as you've already discovered.  Together with your binding for &lt;code&gt;&amp;lt;mouse-2&amp;gt;&lt;/code&gt;, you can bind &lt;code&gt;&amp;lt;drag-mouse-2&amp;gt;&lt;/code&gt; to &lt;code&gt;ignore&lt;/code&gt; in &lt;code&gt;helm-map&lt;/code&gt; to get rid of the annoying message you mentioned.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Non-)Solution #4: The ideal solution here would be to adjust the bindings in &lt;code&gt;helm--remap-mouse-mode-map&lt;/code&gt; directly.  However helm is doing something weird (and possibly buggy?) here that I don't fully understand.  Here's the full definition of the mode, including its keymap:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar helm--remap-mouse-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (cl-loop for k in '([mouse-1] [mouse-2] [mouse-3]&#xA;                        [down-mouse-1] [down-mouse-2] [down-mouse-3]&#xA;                        [drag-mouse-1] [drag-mouse-2] [drag-mouse-3]&#xA;                        [double-mouse-1] [double-mouse-2] [double-mouse-3]&#xA;                        [triple-mouse-1] [triple-mouse-2] [triple-mouse-3])&#xA;             do (define-key map k 'undefined))&#xA;    map))&#xA;&#xA;(define-minor-mode helm--remap-mouse-mode&#xA;    &quot;[INTERNAL] Prevent escaping helm minibuffer with mouse clicks.&#xA;Do nothing when used outside of helm context.&#xA;&#xA;WARNING: Do not use this mode yourself, it is internal to helm.&quot;&#xA;  :group 'helm&#xA;  :global t&#xA;  :keymap helm--remap-mouse-mode-map&#xA;  (unless helm-alive-p&#xA;    (setq helm--remap-mouse-mode-map nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The body here is run whenever the mode is enabled or disabled, and as far as I can tell &lt;code&gt;helm-alive-p&lt;/code&gt; will be false under normal use during the disabling call.  Thus after the first time the mode is used, &lt;code&gt;helm--remap-mouse-mode-map&lt;/code&gt; gets set to nil (which isn't even a valid keymap!) and never gets set back.  The baffling part is that the mode still somehow works, since the advice from solution #2 successfully re-enables the mouse.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Final note: When checking to see if there was an enlightening bug report dealing with the issues from solution #4, I found two issues (&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/501&quot; rel=&quot;nofollow&quot;&gt;#501&lt;/a&gt; and &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/622&quot; rel=&quot;nofollow&quot;&gt;#622&lt;/a&gt;) in which the implementation of this feature was discussed.  I figured I'd pass them on for additional context in case anyone is interested.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-01-27T23:58:33.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19893" PostTypeId="1" CreationDate="2016-01-28T03:12:05.393" Score="2" ViewCount="72" Body="&lt;p&gt;How can I change the font background based on the first character on a given line? Take for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'marker-2 nil :background some_function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;some_function&lt;/code&gt; returns &lt;code&gt;&quot;blue&quot;&lt;/code&gt; if the first character of a line is equal to &lt;code&gt;%&lt;/code&gt;, otherwise it returns &lt;code&gt;&quot;red&quot;&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10913" LastEditorUserId="9995" LastEditDate="2016-01-28T10:13:33.297" LastActivityDate="2016-01-28T10:13:33.297" Title="Changing background color based on first character on line" Tags="|faces|font-lock|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19895" PostTypeId="2" ParentId="19254" CreationDate="2016-01-28T05:49:08.587" Score="5" Body="&lt;p&gt;A new feature has been introduced for persistent scratch called &lt;strong&gt;&quot;remember&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://www.masteringemacs.org/article/whats-new-in-emacs-24-4&quot; rel=&quot;noreferrer&quot;&gt;https://www.masteringemacs.org/article/whats-new-in-emacs-24-4&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The new command ``remember-notes`` creates a buffer which is saved&#xA;&#xA;on ``kill-emacs``.&#xA;&#xA;You may think of it as a \*scratch\* buffer whose content is preserved.&#xA;&#xA;In fact, it was designed as a replacement for \*scratch\* buffer and can&#xA;&#xA;be used that way by setting ``initial-buffer-choice`` to&#xA;&#xA;``remember-notes`` and ``remember-notes-buffer-name`` to “\*scratch\*”.&#xA;&#xA;Without the second change, \*scratch\* buffer will still be there for&#xA;&#xA;notes that do not need to be preserved.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5488" LastActivityDate="2016-01-28T05:49:08.587" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19897" PostTypeId="1" AcceptedAnswerId="19899" CreationDate="2016-01-28T12:21:18.673" Score="1" ViewCount="101" Body="&lt;p&gt;I am running Emacs mac ports (24.5) on a Macbook Air. I have the following code as an &lt;code&gt;.el&lt;/code&gt; file to setup my own multilingual environment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'quail)&#xA;&#xA;(quail-define-package &quot;maatra&quot;&#xA;                      &quot;UTF-8&quot; &quot;m&quot; t&#xA;                      &quot;Input method for Roman transliteration of Devanāgarī using IAST scheme. E.g. aa -&amp;gt; ā&quot;&#xA;                      nil t nil nil nil nil nil nil nil nil t)&#xA;&#xA;(quail-define-rules (&quot;aa&quot; ?\ā)&#xA;                    (&quot;AA&quot; ?\Ā)&#xA;                    (&quot;ii&quot; ?\ī)&#xA;                    (&quot;II&quot; ?\Ī)&#xA;                    (&quot;uu&quot; ?\ū)&#xA;                    (&quot;UU&quot; ?\Ū)&#xA;                    (&quot;.r&quot; ?\ṛ)&#xA;                    (&quot;.R&quot; ?\Ṛ)&#xA;                    (&quot;.rr&quot; ?\ṝ)&#xA;                    (&quot;.RR&quot; ?\Ṝ)&#xA;                    (&quot;.l&quot; ?\ḷ)&#xA;                    (&quot;.L&quot; ?\Ḷ)&#xA;                    (&quot;.ll&quot; ?\ḹ)&#xA;                    (&quot;.LL&quot; ?\Ḹ)&#xA;                    (&quot;.M&quot; ?\ṁ)&#xA;                    (&quot;.m&quot; ?\ṃ)&#xA;                    (&quot;.h&quot; ?\ḥ)&#xA;                    (&quot;.H&quot; ?\Ḥ)&#xA;                    (&quot;;n&quot; ?\ṅ)&#xA;                    (&quot;;N&quot; ?\Ṅ)&#xA;                    (&quot;~n&quot; ?\ñ)&#xA;                    (&quot;~N&quot; ?\Ñ)&#xA;                    (&quot;.t&quot; ?\ṭ)&#xA;                    (&quot;.T&quot; ?\Ṭ)&#xA;                    (&quot;.d&quot; ?\ḍ)&#xA;                    (&quot;.D&quot; ?\Ḍ)&#xA;                    (&quot;.n&quot; ?\ṇ)&#xA;                    (&quot;.N&quot; ?\Ṇ)&#xA;                    (&quot;;s&quot; ?\ś)&#xA;                    (&quot;;S&quot; ?\Ś)&#xA;                    (&quot;.s&quot; ?\ṣ)&#xA;                    (&quot;.S&quot; ?\Ṣ)&#xA;                    ;;(&quot;dd&quot; ?\d̤)&#xA;                    )&#xA;&#xA;        (provide 'maatra)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am facing two problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I receive the error 'Invalid read syntax: ?' only when I uncomment the last line above. Else the code works perfectly. Emacs has no problem with any other character except d̤.&lt;/li&gt;&#xA;&lt;li&gt;Emacs is even unable to properly display the d̤ character except when I use the Monaco font. Other fonts like Dejavu Mono which perfectly display this character in other applications do not render it properly in Emacs. Typically, the adjacent characters overlap this character and the text becomes unreadable.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How do I fix the problem with the &lt;em&gt;d̤&lt;/em&gt; character?&lt;/p&gt;&#xA;" OwnerUserId="10050" LastEditorUserId="253" LastEditDate="2016-01-28T12:37:34.440" LastActivityDate="2016-01-28T13:02:42.947" Title="Can't use the diacritic character d̤?" Tags="|quail|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19898" PostTypeId="1" AcceptedAnswerId="26300" CreationDate="2016-01-28T12:47:23.663" Score="2" ViewCount="176" Body="&lt;p&gt;Emacs &quot;suddenly&quot; stopped automatically inserting the correct quotes once I hit the &lt;kbd&gt;&quot;&lt;/kbd&gt; key. It seems to me that this is due to a duplicate installation of some package, but I can't put my finger on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some commands that seem to duplicates, so far I stumbled over the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;latex-mode&#xA;LaTeX-mode&#xA;tex-insert-quote&#xA;TeX-insert-quote (&quot;)&#xA;tex-insert-braces&#xA;TeX-insert-braces (C-C {)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sadly, even though helm tells me that &lt;code&gt;TeX-insert-quote&lt;/code&gt; is bound to &lt;code&gt;&quot;&lt;/code&gt;, it does not seem to trigger. And even if I call it manually, it simply inserts &lt;code&gt;&quot;&lt;/code&gt; into my text instead of ``correct'' quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody point me out where to start diagnosing this behaviour?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: After running &lt;code&gt;C-h k &quot;&lt;/code&gt; emacs tells me that it's indeed bound to &lt;code&gt;TeX-insert-quote&lt;/code&gt;. So the trouble is not the binding, but something else.&lt;/p&gt;&#xA;" OwnerUserId="542" LastEditorUserId="542" LastEditDate="2016-08-15T13:01:29.010" LastActivityDate="2016-08-15T13:01:29.010" Title="&quot;TeX-insert-quote&quot; does not work anymore" Tags="|latex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19899" PostTypeId="2" ParentId="19897" CreationDate="2016-01-28T13:02:42.947" Score="1" Body="&lt;p&gt;The &lt;code&gt;d̤&lt;/code&gt; is the only character in there which isn't pre-composed; it's a normal LATIN SMALL LETTER D followed by a COMBINING DIAERESIS BELOW. That makes it a syntax error because a character literal can only be a single character. &lt;code&gt;quail-define-rules&lt;/code&gt; will also accept strings so use &lt;code&gt;&quot;d̤&quot;&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-01-28T13:02:42.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19900" PostTypeId="2" ParentId="19872" CreationDate="2016-01-28T14:04:31.487" Score="1" Body="&lt;p&gt;I never used that but looking at the documentation and code, I think&#xA;the function you're talking about is &lt;code&gt;rng-auto-set-schema&lt;/code&gt; from&#xA;&lt;code&gt;rng-validate-mode&lt;/code&gt;.  This minor mode is enabled by default with&#xA;&lt;code&gt;nxml-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what &lt;code&gt;auto-insert-mode&lt;/code&gt; does:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (if auto-insert-mode&#xA;      (add-hook 'find-file-hook 'auto-insert)&#xA;    (remove-hook 'find-file-hook 'auto-insert)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is probably that &lt;code&gt;find-file-hook&lt;/code&gt; is considered only after the&#xA;major mode has been selected, so &lt;code&gt;rng-auto-set-schema&lt;/code&gt; is called&#xA;before your snippet is actually inserted in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;auto-insert&lt;/code&gt; apparently does not provide any hooks, I see two ways to work around that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;advise &lt;code&gt;auto-insert&lt;/code&gt; so that after inserting, it calls&#xA;&lt;code&gt;rng-auto-set-schema&lt;/code&gt; if major mode is &lt;code&gt;nxml-mode&lt;/code&gt;,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;add a hook at the end of &lt;code&gt;find-file-hook&lt;/code&gt; to do the same thing.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's a tentative for the second solution:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-set-schema-if-nxml ()&#xA;  (if (eq major-mode 'nxml-mode)&#xA;      (rng-auto-set-schema)))&#xA;&#xA;(add-hook 'find-file-hook 'my-set-schema-if-nxml t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-01-28T14:04:31.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19901" PostTypeId="1" CreationDate="2016-01-28T14:57:16.853" Score="2" ViewCount="101" Body="&lt;p&gt;A use Emacs 24 on an Ubuntu computer. The following are  parts of my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for activating flyspell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'flyspell-mode &quot;flyspell&quot; &quot;On-the-fly spelling checker.&quot; t)&#xA;(autoload 'flyspell-delay-command &quot;flyspell&quot; &quot;Delay on command.&quot; t)&#xA;(autoload 'tex-mode-flyspell-verify &quot;flyspell&quot; &quot;&quot; t)&#xA;(add-hook 'LaTeX-mode-hook 'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This defines a key binding for running Auctex Latex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-run-latex ()&#xA;  (interactive)&#xA;  (TeX-save-document (TeX-master-file))&#xA;  (TeX-command &quot;LaTeX&quot; 'TeX-master-file -1))&#xA;&#xA;&#xA;(defun my-LaTeX-hook ()&#xA; (global-set-key (kbd &quot;C-c C-a&quot;) 'my-run-latex))&#xA;&#xA;(add-hook 'LaTeX-mode-hook 'my-LaTeX-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This one raises the Emacs window when using Latex reverse search: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun raise-client-frame ()&#xA;      (let ((wmctrl (executable-find &quot;wmctrl&quot;)))&#xA;        (if wmctrl&#xA;        (start-process &quot;wmctrl&quot; nil wmctrl &quot;-R&quot; (frame-parameter nil 'name)))))&#xA;    ;; This raises the frame when using Evince.&#xA;    (add-hook 'TeX-source-correlate-mode-hook&#xA;          (lambda ()&#xA;            (when (TeX-evince-dbus-p)&#xA;              (dbus-register-signal&#xA;               :session nil &quot;/org/gnome/evince/Window/0&quot;&#xA;               &quot;org.gnome.evince.Window&quot; &quot;SyncSource&quot;&#xA;               (lambda (file linecol &amp;amp;rest ignored)&#xA;             (TeX-source-correlate-sync-source file linecol ignored)&#xA;             (raise-client-frame))))))&#xA;    ;; This raises the frame when using all other viewers.&#xA;    (add-hook 'server-switch-hook 'raise-client-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that these three sometimes work and sometimes don't and this seems to be random. When they work, all three work and when they don't, none. Whether they work or not is somehow decided at Emacs startup but I don't know how.&lt;/p&gt;&#xA;" OwnerUserId="10919" LastActivityDate="2016-01-28T14:57:16.853" Title="A part of my .emacs sometimes takes effect, sometimes doesn't" Tags="|key-bindings|init-file|auctex|" AnswerCount="0" CommentCount="6" ClosedDate="2016-01-30T12:51:20.963" ContentLicense="CC BY-SA 3.0" />
  <row Id="19902" PostTypeId="1" AcceptedAnswerId="19913" CreationDate="2016-01-28T15:48:21.590" Score="3" ViewCount="501" Body="&lt;p&gt;I used to use Magit &amp;lt;2's wazzup mode to survey unmerged branches or general branch divergence.  What's the right way to do that or some other way to view unmerged branches in Magit 2?&lt;/p&gt;&#xA;" OwnerUserId="5435" LastActivityDate="2016-01-28T20:26:03.090" Title="What is the Magit 2 way to do what wazzup used to?" Tags="|magit|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19903" PostTypeId="1" AcceptedAnswerId="19941" CreationDate="2016-01-28T16:20:45.857" Score="7" ViewCount="2552" Body="&lt;p&gt;I regularly use org-mode and org-babel to create e.g. exercises or proof-of-principle documents which I export to PDF via the LaTeX exporter. I noticed that the &lt;code&gt;#RESULTS&lt;/code&gt; generated by a &lt;code&gt;#+begin_src&lt;/code&gt;-&lt;code&gt;#+end_src&lt;/code&gt; block are put in a &lt;code&gt;#+begin_example&lt;/code&gt;-&lt;code&gt;#+end_example&lt;/code&gt; block, which is exported to LaTeX's &lt;code&gt;verbatim&lt;/code&gt; environment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to customize this LaTeX export. I could try and add some &lt;code&gt;#+LATEX_HEADER&lt;/code&gt; lines customizing the &lt;code&gt;verbatim&lt;/code&gt; environment (e.g. using the &lt;code&gt;fancyvrb&lt;/code&gt; package), however, ideally I would like to use the &lt;code&gt;listings&lt;/code&gt; environment for the output. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: &#xA;I currently use the &lt;code&gt;listings&lt;/code&gt; package to format the &lt;code&gt;src&lt;/code&gt; blocks, so ideally I would like to use the same formatting for both. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2019-11-09T00:00:17.780" Title="How can I customize the LaTeX export of org babel #+RESULTS?" Tags="|org-mode|org-export|latex|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19904" PostTypeId="2" ParentId="19882" CreationDate="2016-01-28T16:50:02.820" Score="3" Body="&lt;p&gt;This requires an understanding of &lt;code&gt;autoload&lt;/code&gt;, &lt;code&gt;require&lt;/code&gt;, &lt;code&gt;provide&lt;/code&gt;, and &quot;named features&quot;. A brief introduction to those concepts is at: &lt;a href=&quot;http://spacemacs.org/doc/LAYERS.html&quot; rel=&quot;nofollow&quot;&gt;Spacemacs Layers&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Find out which &quot;named feature&quot; &lt;code&gt;helm-M-x&lt;/code&gt; is in. One way: look at the source code of the file and try to find &lt;code&gt;(provide 'xxxx)&lt;/code&gt;. In this case, it is &lt;code&gt;'helm-command&lt;/code&gt; (source: &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/master/helm-command.el&quot; rel=&quot;nofollow&quot;&gt;helm-command.el&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;(require 'helm-command)&lt;/code&gt; in your init/startup configuration after all other layers/packages have been loaded (eg &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10906" LastActivityDate="2016-01-28T16:50:02.820" CommentCount="0" CommunityOwnedDate="2016-01-28T16:50:02.820" ContentLicense="CC BY-SA 3.0" />
  <row Id="19905" PostTypeId="1" AcceptedAnswerId="19914" CreationDate="2016-01-28T17:07:09.720" Score="3" ViewCount="121" Body="&lt;p&gt;The title pretty much says it all: I'm looking for the &quot;org source&quot;&lt;sup&gt;1&lt;/sup&gt; for the page &lt;a href=&quot;http://orgmode.org/manual/Installation.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Installation.html&lt;/a&gt;.  (I want to replicate several aspects of that page's formatting.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Many org-mode documentation pages (e.g. &lt;a href=&quot;http://orgmode.org/worg/index.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) have a &lt;kbd&gt;Show Org Source&lt;/kbd&gt; button, but the page I'm interested in is not one of them.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: To see what I mean by &quot;org source&quot;, please click the &lt;kbd&gt;Show Org Source&lt;/kbd&gt; in &lt;a href=&quot;http://orgmode.org/worg/index.html&quot; rel=&quot;nofollow&quot;&gt;the page I cited&lt;/a&gt;.  Alternatively, you can see it &lt;a href=&quot;http://orgmode.org/worg/index.org.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm &lt;strong&gt;not&lt;/strong&gt; after is the HTML source that one can view by, for example, pointing one's browser to view-source:&lt;a href=&quot;http://orgmode.org/manual/Installation.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Installation.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;1&lt;/sup&gt; Assuming, of course, that the web page in question was generated from an org document.  This assumption could be incorrect; if so, please let me know.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2016-01-28T19:02:08.187" LastActivityDate="2016-01-28T20:42:08.167" Title="Where can I find the org source code for orgmode.org/manual/Installation.html" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19907" PostTypeId="1" AcceptedAnswerId="19911" CreationDate="2016-01-28T19:40:11.887" Score="0" ViewCount="49" Body="&lt;p&gt;I downloaded the Table editor for emacs &lt;a href=&quot;http://table.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;table.el&lt;/a&gt;. I then edited my .emacs file to load the table file as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/manual&quot;)&#xA;(load &quot;table.el&quot;)&#xA;(require 'table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Opening the emacs in debug-mode throws me the following error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: integerp, (32 . 126)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8683" LastEditorUserId="9995" LastEditDate="2016-01-28T20:25:33.870" LastActivityDate="2016-01-28T20:25:33.870" Title="Error trying to add Table editor to .emacs" Tags="|table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19908" PostTypeId="1" AcceptedAnswerId="19915" CreationDate="2016-01-28T19:48:34.373" Score="3" ViewCount="307" Body="&lt;p&gt;I like to have my emacs set up as one full-screen frame with two side-by-side windows at all time. To do this, I've used this code to force emacs not to split windows arbitrarily:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun never-split-a-window nil)&#xA;(setq split-window-preferred-function 'never-split-a-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works great, and importantly, I can still use &lt;code&gt;popwin&lt;/code&gt; to display &lt;em&gt;temporary&lt;/em&gt; popup windows as splits. Other packages still successfully split as well, for example Helm. And a few weeks ago, so did Magit's popups. It was nice to have the main Magit buffer occupy one whole window, but then have popups split the window (temporarily).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, since some changes to Magit to consolidate window handling, I get my Magit popups in the opposite window rather than as a split. Is there any easy way to get back the splitting behavior, without allowing Emacs to go nuts and split things willy-nilly (as it did before changing &lt;code&gt;split-window-preferred-function&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="10921" LastActivityDate="2016-01-28T20:43:37.403" Title="Magit popups no longer behaving as popups (in my setup)" Tags="|magit|window-splitting|popup|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19909" PostTypeId="2" ParentId="19877" CreationDate="2016-01-28T20:01:00.127" Score="6" Body="&lt;p&gt;The answer of Constantine is okay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to provide a slight modification:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval-string (str)&#xA;  &quot;Read and evaluate all forms in str.&#xA;Return the results of all forms as a list.&quot;&#xA;  (let ((next 0)&#xA;        ret)&#xA;    (condition-case err&#xA;        (while t&#xA;          (setq ret (cons (funcall (lambda (ret)&#xA;                                     (setq next (cdr ret))&#xA;                                     (eval (car ret)))&#xA;                                   (read-from-string str next))&#xA;                          ret)))&#xA;      (end-of-file))&#xA;    (nreverse ret)))&#xA;&#xA;(my-eval-string &quot;1 2 3 (+ 3 1)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last form returns the list &lt;code&gt;(1 2 3 4)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="5296" LastEditDate="2016-07-15T14:33:56.183" LastActivityDate="2016-07-15T14:33:56.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19910" PostTypeId="1" CreationDate="2016-01-28T20:08:26.783" Score="2" ViewCount="472" Body="&lt;p&gt;I started having some problems with org mode after upgrading my melpa packages. One of the problems is described in &lt;a href=&quot;https://emacs.stackexchange.com/questions/19874/external-http-link-not-recognized-as-link&quot;&gt;this question&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to simply downgrade to my previous version of org-mode until these issues are resolved. Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the record, issuing &lt;code&gt;M-x org-version&lt;/code&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org-mode version 8.3.3 (8.3.3-26-ge92a06-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20160125/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, I'm using Emacs 24.3.1 on Ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-01-28T20:08:26.783" Title="Org broke! How do I downgrade?" Tags="|org-mode|package|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19911" PostTypeId="2" ParentId="19907" CreationDate="2016-01-28T20:09:47.877" Score="3" Body="&lt;p&gt;According to &lt;a href=&quot;https://www.emacswiki.org/emacs/TableMode&quot; rel=&quot;nofollow&quot;&gt;emacs wiki&lt;/a&gt; &lt;code&gt;table.el&lt;/code&gt; is provided with emacs since version 22...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the same kind of error by trying the sourceforge version, but the bundled version works fine.  It is documented in emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html#Text-Based-Tables&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-01-28T20:09:47.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19912" PostTypeId="2" ParentId="10384" CreationDate="2016-01-28T20:10:12.743" Score="5" Body="&lt;p&gt;Use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Comparison.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;string-suffix-p&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-suffix-p &quot;string&quot; &quot;strinG&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Much simpler and doesn't require 4 &lt;code&gt;nil&lt;/code&gt;s. It doesn't test if strings are equal &lt;em&gt;per se&lt;/em&gt; (&lt;code&gt;(string-suffix-p &quot;word&quot; &quot;buzzword&quot; t) ⇒ t&lt;/code&gt;). Although, in some cases this should be sufficient (if you have limited dictionary to check upon).&lt;/p&gt;&#xA;" OwnerUserId="6596" LastEditorUserId="6596" LastEditDate="2016-01-29T15:27:52.867" LastActivityDate="2016-01-29T15:27:52.867" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19913" PostTypeId="2" ParentId="19902" CreationDate="2016-01-28T20:26:03.090" Score="4" Body="&lt;p&gt;In &lt;code&gt;v2.1&lt;/code&gt; the &quot;branch manager&quot; and &quot;wazzup&quot; were merged into one mode. Such changes are usually being announced in the release notes.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The new Refs buffer combines the features of the old Wazzup and&#xA;  Branch Manager buffers into one, more powerful and efficient&#xA;  synthesis.  For each reference, cherries can be shown by expanding&#xA;  the ref section, but unlike in the Wazzup buffer, the cherries are&#xA;  not calculated until the expansion happens, making it vastly more&#xA;  efficient.  Besides local and remote branches, the buffer now also&#xA;  lists tags, and users can add additional sections listing other&#xA;  refs, e.g., stashes.  The format of refs headers is now&#xA;  customizable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The new key binding is &lt;kbd&gt;y&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default the number of commits a branch has in addition to those in the current branch are not shown, that would be to expensive when there exist many refs with many additional commits. You can show them using &lt;kbd&gt;C-y&lt;/kbd&gt;, or you can customize &lt;code&gt;magit-refs-show-commit-count&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-01-28T20:26:03.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19914" PostTypeId="2" ParentId="19905" CreationDate="2016-01-28T20:42:08.167" Score="1" Body="&lt;p&gt;If you download org source, you'll see the manual is provided as a texinfo file (as well as info and pdf, both generated from texinfo).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, some have tried to rewrite it in org.  See &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2013-02/msg01517.html&quot; rel=&quot;nofollow&quot;&gt;this post from 2013&lt;/a&gt; and &lt;a href=&quot;http://comments.gmane.org/gmane.emacs.orgmode/98836&quot; rel=&quot;nofollow&quot;&gt;this thread from 2015&lt;/a&gt;.  They both link to a stale github &lt;a href=&quot;https://github.com/tsdye/orgmanual&quot; rel=&quot;nofollow&quot;&gt;repo&lt;/a&gt; that was last updated three years ago but since you only need it as an example it may be usefull for you.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-01-28T20:42:08.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19915" PostTypeId="2" ParentId="19908" CreationDate="2016-01-28T20:43:37.403" Score="3" Body="&lt;p&gt;I doubt that using a dummy function which always returns &lt;code&gt;nil&lt;/code&gt; as &lt;code&gt;split-window-preferred-function&lt;/code&gt; is what you should be doing, but since it otherwise works for you, here's how you can tell &lt;code&gt;magit-popup&lt;/code&gt; to use the default splitter function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'magit-popup-mode-display-buffer :around&#xA;            'magit-popup-mode-display-buffer--split-window-sensibly)&#xA;&#xA;(defun magit-popup-mode-display-buffer--split-window-sensibly (fn buffer mode)&#xA;  (let ((split-window-preferred-function 'split-window-sensibly))&#xA;    (funcall fn buffer mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively you could replace &lt;code&gt;never-split-a-window&lt;/code&gt; with &lt;code&gt;only-sometimes-split-a-window&lt;/code&gt; (depending on e.g. the major-mode of the current buffer).&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-01-28T20:43:37.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19916" PostTypeId="1" CreationDate="2016-01-28T20:43:40.133" Score="1" ViewCount="95" Body="&lt;p&gt;My goal is to resize Emacs frame on start to make its width 120 chars and center the frame. To compute offset i'm using this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((width-left (- (x-display-pixel-width)&#xA;                      (frame-pixel-width)))&#xA;       (frame-left-offest (/ width-left 2)))&#xA; (add-to-list 'default-frame-alist (cons 'left frame-left-offest)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that &lt;code&gt;(frame-pixel-width)&lt;/code&gt; during the app launch gives me one width and when the app has started it gives me another width (the proper one, which i need). So the result is wrong. I'm not sure why that happens and what's the proper way to do it.&lt;/p&gt;&#xA;" OwnerUserId="2361" LastActivityDate="2016-01-28T20:43:40.133" Title="Behaviour of frame-pixel-width function during Emacs loading" Tags="|frames|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19917" PostTypeId="1" CreationDate="2016-01-29T01:20:51.243" Score="1" ViewCount="315" Body="&lt;p&gt;I want search-title-face to be non-bold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tried to add to my &lt;em&gt;.emacs&lt;/em&gt; file this chunk (due to &lt;a href=&quot;http://nullprogram.com/blog/2013/11/26/&quot; rel=&quot;nofollow&quot;&gt;http://nullprogram.com/blog/2013/11/26/&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; '(elfeed-search-title-face&#xA;   ((t :weight normal))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="9686" LastActivityDate="2023-12-19T03:04:25.490" Title="how to make non-bold text in Elfeed?" Tags="|fonts|customize|elfeed|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19921" PostTypeId="2" ParentId="6111" CreationDate="2016-01-29T04:07:24.117" Score="1" Body="&lt;p&gt;In short, press them all easily with the thumbs. You can do it without Kinesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the details. Buy e.g. a Japanese keyboard:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/waP5R.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/waP5R.jpg&quot; alt=&quot;Japanese keyboard&quot;&gt;&lt;/a&gt;&lt;br&gt;&#xA;&lt;sub&gt;(source: &lt;a href=&quot;http://www.owltech.co.jp/products/keyboard/KB86STD/KB86STD_B-320.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;owltech.co.jp&lt;/a&gt;)&lt;/sub&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and use the bottom row &lt;em&gt;both&lt;/em&gt; e.g. as &lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt; and &lt;kbd&gt;Esc&lt;/kbd&gt;&lt;kbd&gt;BS&lt;/kbd&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;kbd&gt;Ret&lt;/kbd&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;, the middle one being the physical space bar. It means that if you press the space alone, it's a plain space, but when pressed with others, it'll be Ctrl. Same for Alt/Esc, Shift/BS etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For how to actually achive it, see &lt;a href=&quot;https://stackoverflow.com/a/8935973&quot;&gt;What is the best way to avoid getting “Emacs Pinky”?&lt;/a&gt; in stackoverflow.com. (This question is already referred to by &lt;a href=&quot;https://emacs.stackexchange.com/users/25/gilles&quot;&gt;Gilles&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can buy Japanese keyboards at e.g. ebay.com or amazon.com. amazon.co.jp is available in English, too.&lt;/p&gt;&#xA;" OwnerUserId="10927" LastEditorUserId="14920" LastEditDate="2019-02-18T16:59:04.363" LastActivityDate="2019-02-18T16:59:04.363" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19922" PostTypeId="1" AcceptedAnswerId="19954" CreationDate="2016-01-29T07:50:51.647" Score="3" ViewCount="193" Body="&lt;p&gt;Is it possible to customize some, not all, of keywords in a major mode?&#xA;(Pardon my vocabulary, since this is still new to me.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say these are keywords: &lt;code&gt;function&lt;/code&gt;, &lt;code&gt;new&lt;/code&gt;, &lt;code&gt;throw&lt;/code&gt;, &lt;code&gt;return&lt;/code&gt;.&#xA;And I want to override the look of &lt;code&gt;throw&lt;/code&gt; and &lt;code&gt;new&lt;/code&gt;, but leave &lt;code&gt;function&lt;/code&gt; and &lt;code&gt;return&lt;/code&gt; alone.&lt;/p&gt;&#xA;" OwnerUserId="10906" LastEditorUserId="25" LastEditDate="2016-01-30T12:50:52.813" LastActivityDate="2016-01-30T16:10:17.123" Title="How would you customize a subsection of keywords in a major mode in Emacs?" Tags="|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19924" PostTypeId="1" AcceptedAnswerId="19928" CreationDate="2016-01-29T09:34:34.380" Score="3" ViewCount="1737" Body="&lt;p&gt;I get an error, &lt;code&gt;Invalid face: helm-selection&lt;/code&gt;, using &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-background 'helm-selection &quot;#EEAD0E&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It runs fine if I manually enter it using &lt;code&gt;helm-M-x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I get no errors (during startup) for the following in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (custom-set-faces&#xA;    '(helm-selection ((t (:background &quot;#EEAD0E&quot; :foreground &quot;#222226&quot;))))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've read the documentation on both face functions, but I still counldn't figure out the reason for the different behaviour.&lt;/p&gt;&#xA;" OwnerUserId="10906" LastActivityDate="2016-01-29T14:58:55.880" Title="What's the difference between `set-face-background` and `custom-set-faces`?" Tags="|faces|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19925" PostTypeId="1" CreationDate="2016-01-29T09:55:51.380" Score="1" ViewCount="150" Body="&lt;p&gt;My sqlite database has columns which consist of TEXT objects containing spaces. I'm new to both emacs and programming, and while I want to use emacsql for reasons, it's crucial that I can select on string objects containing spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. &lt;code&gt;(emacsql db [:select * :from table1 :where (= name &quot;John Q Doe-Deer&quot;)])&lt;/code&gt; &#xA;doesn't work, and neither does &lt;code&gt;'John\ Q\ Doe-Deer&lt;/code&gt;: they both returned &lt;code&gt;nil&lt;/code&gt; even though an analogous query works in command-line sqlite. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="6858" LastEditorUserId="105" LastEditDate="2016-03-14T00:42:58.443" LastActivityDate="2016-03-14T00:42:58.443" Title="Emacsql string query with space" Tags="|whitespace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19926" PostTypeId="1" AcceptedAnswerId="19977" CreationDate="2016-01-29T11:49:31.973" Score="1" ViewCount="850" Body="&lt;p&gt;I use quite a lot the useful command &lt;code&gt;show-branches&lt;/code&gt; and I couldn't find the analogue command to hide all the branches under a certain Item. In other words my aim is to fold only a subtree and its parent. How to do this?&lt;/p&gt;&#xA;" OwnerUserId="7199" LastEditorUserId="7199" LastEditDate="2016-02-02T11:38:01.100" LastActivityDate="2016-02-02T11:38:01.100" Title="Org-mode command to hide-branches" Tags="|org-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19927" PostTypeId="2" ParentId="19925" CreationDate="2016-01-29T11:52:16.983" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Any readable lisp value can be stored as a value in EmacSQL, including numbers, strings, symbols, lists, vectors, and closures. EmacSQL has no concept of &quot;TEXT&quot; values; it's all just lisp objects. The lisp object nil corresponds 1:1 with NULL in the database.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;All values (except &lt;code&gt;nil&lt;/code&gt;) are stored as text and then &lt;code&gt;read&lt;/code&gt; back. So &lt;code&gt;(a b)&lt;/code&gt; would be stored as &lt;code&gt;&quot;(a b)&quot;&lt;/code&gt; and &lt;code&gt;&quot;John Q Doe-Deer&quot;&lt;/code&gt; as &lt;code&gt;&quot;\&quot;John Q Doe-Deer\&quot;&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see &lt;a href=&quot;https://github.com/skeeto/emacsql/issues/13&quot; rel=&quot;nofollow&quot;&gt;https://github.com/skeeto/emacsql/issues/13&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-01-29T11:52:16.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19928" PostTypeId="2" ParentId="19924" CreationDate="2016-01-29T14:31:43.097" Score="1" Body="&lt;p&gt;Seems pretty clear: &lt;code&gt;helm-M-x&lt;/code&gt; must cause face &lt;code&gt;helm-selection&lt;/code&gt; to be defined. Otherwise, it is not defined by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error message tells you that symbol `helm-selection' is not associated with a face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you had tried just &lt;code&gt;(set-face-background 'highlight &quot;#EEAD0E&quot;)&lt;/code&gt; you would have seen that there is no problem, because face &lt;code&gt;highlight&lt;/code&gt; is predefined.  Your problem is that nothing has defined face &lt;code&gt;helm-selection&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you don't see a problem with &lt;code&gt;custom-set-faces&lt;/code&gt; is that it does not require the face to be defined ahead of time. It just applies of face specs (specifications that are lists) to the &lt;code&gt;user&lt;/code&gt; theme. It does not try to change, itself, an existing face.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-29T14:31:43.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19930" PostTypeId="1" AcceptedAnswerId="19932" CreationDate="2016-01-29T15:33:09.050" Score="4" ViewCount="337" Body="&lt;p&gt;I have a data file that looks as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ALGO = Fast&#xA;EDIFF = 6.7e-05&#xA;ENCUT = 520&#xA;IBRION = 2&#xA;ICHARG = 1&#xA;ISIF = 2&#xA;ISMEAR = 0&#xA;ISPIN = 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm interested in copying the first column of uneven width but where every element ends with an &lt;code&gt;=&lt;/code&gt; character. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;kill-yank rectangle&lt;/em&gt; mode does not work in this case, since the columns are of uneven width. &lt;/p&gt;&#xA;" OwnerUserId="8683" LastActivityDate="2016-02-01T16:01:49.457" Title="Copy a column of uneven width that ends with a specific character" Tags="|copy-paste|rectangle|column|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19931" PostTypeId="2" ParentId="19930" CreationDate="2016-01-29T16:05:18.623" Score="2" Body="&lt;p&gt;It feels as if the combination of the &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/doitian/iy-go-to-char&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;iy-go-to-char&lt;/code&gt;&lt;/a&gt; packages is to do exactly this kind of stuff. First of all, if you don't have those packages installed, they can be installed via MELPA.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select all the lines you need and then do &lt;code&gt;M-x mc/edit-lines&lt;/code&gt; (or the default binding &lt;code&gt;C-S-c C-S-c&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Move all the cursors to the beginning of the lines (&lt;code&gt;C-a&lt;/code&gt;) as that's from where we want to start the selection. /If you are using &lt;code&gt;multiple-cursors&lt;/code&gt; of the first time, or hitting &lt;code&gt;C-a&lt;/code&gt; for the first time while this mode is active, you will be asked if you want to run that command for each cursor, and you will need to say yes./&lt;/li&gt;&#xA;&lt;li&gt;Set mark (&lt;code&gt;C-SPC&lt;/code&gt;) and do &lt;code&gt;M-x iy-go-to-char&lt;/code&gt; (It's good to have these commands bound to your favorite keys for efficiency) and hit &lt;code&gt;=&lt;/code&gt;. You should now be seeing an effectively &quot;non-rectangle&quot; area having been selected by all those cursors.&lt;/li&gt;&#xA;&lt;li&gt;Adjust the selection using &lt;code&gt;C-b&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Now do a plain copy &lt;code&gt;M-w&lt;/code&gt;. The magic is that doing a plain old kill/copy in multiple-cursors mode kills the whole collective selection as a rectangle.&lt;/li&gt;&#xA;&lt;li&gt;Quit the multiple-cursors mode by hitting &lt;code&gt;RET&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You can now paste that rectangle anywhere using &lt;code&gt;M-x yank-rectangle&lt;/code&gt; or &lt;code&gt;C-x r y&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If all those sounds too cumbersome, it's not. Proof is in the GIF below :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SetYv.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SetYv.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-29T16:05:18.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19932" PostTypeId="2" ParentId="19930" CreationDate="2016-01-29T16:21:28.490" Score="5" Body="&lt;p&gt;You can also achieve this using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Single-Shell.html#index-shell_002dcommand_002don_002dregion&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;shell-command-on-region&lt;/code&gt;&lt;/a&gt; and the Unix utility &lt;a href=&quot;http://linux.die.net/man/1/cut&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;cut&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Highlight the region.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;code&gt;C-u M-|&lt;/code&gt;, enter &quot;&lt;code&gt;cut -d= -f1&lt;/code&gt;&quot;, press &lt;code&gt;RET&lt;/code&gt;. The prefix argument &lt;code&gt;C-u&lt;/code&gt; tells &lt;code&gt;shell-command-on-region&lt;/code&gt; to replace the region with results. If you don't want to (or can't) modify the current buffer, you can still use &lt;code&gt;M-|&lt;/code&gt; (now &lt;em&gt;without&lt;/em&gt; the prefix argument). In this case its output will be in the buffer named &lt;code&gt;*Shell Command Output*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &quot;&lt;code&gt;cut -d= -f1&lt;/code&gt;&quot; selects the first field (&lt;code&gt;-f1&lt;/code&gt;) after splitting lines using &quot;=&quot; as the delimiter (&lt;code&gt;-d=&lt;/code&gt;) (see &quot;&lt;code&gt;man cut&lt;/code&gt;&quot; for details).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-x C-x&lt;/code&gt; to exchange point and mark, i.e. highlight results.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-w&lt;/code&gt; to copy into the kill ring.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-/&lt;/code&gt; to undo the changes to get back the text after &quot;&lt;code&gt;=&lt;/code&gt;&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now you have the text &lt;em&gt;before&lt;/em&gt; equal signs is in the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can align this text so that &lt;code&gt;kill-rectangle&lt;/code&gt; works:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Highlight the region.&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x align-regexp&lt;/code&gt;, enter &quot;&lt;code&gt;=&lt;/code&gt;&quot;, press &lt;code&gt;RET&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Highlight the rectangle containing the first column.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-x r M-w&lt;/code&gt; to invoke &lt;code&gt;copy-rectangle-as-kill&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-/&lt;/code&gt; to return the region to its original state.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now you can yank the first column with &lt;code&gt;C-x r y&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-02-01T16:01:49.457" LastActivityDate="2016-02-01T16:01:49.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19933" PostTypeId="1" AcceptedAnswerId="19935" CreationDate="2016-01-29T17:37:41.333" Score="6" ViewCount="429" Body="&#xA;&#xA;&lt;p&gt;I'm trying to get &lt;code&gt;pcase&lt;/code&gt; to match against a &lt;code&gt;let&lt;/code&gt;-bound variable. However, I can't seem to get &lt;code&gt;pcase&lt;/code&gt; to recognize the variable correctly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((a 1)) (pcase 2 (a 7)))  =&amp;gt; 7    ;; as predicted by the docs&#xA;(let ((a 2)) (pcase 2 (`a 7))) =&amp;gt; nil  ;; ???&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get &lt;code&gt;pcase&lt;/code&gt; to return &lt;code&gt;7&lt;/code&gt; iff &lt;code&gt;a = 2&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(An alternative to &lt;code&gt;pcase&lt;/code&gt; with similar features would also suffice.)&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="454" LastEditDate="2018-11-06T05:14:16.213" LastActivityDate="2020-03-17T21:19:04.153" Title="Match against a variable with pcase" Tags="|local-variables|let-binding|pcase|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19934" PostTypeId="2" ParentId="19930" CreationDate="2016-01-29T18:39:18.910" Score="1" Body="&lt;p&gt;There are many ways to do this.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;1. Using built-in emacs stuff&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Switch to a programming mode where aligning at the equal sign makes sense, e.g.: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;python-mode&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Place point right at the end of the line with the last &lt;code&gt;=&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Call &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;align&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Call &lt;code&gt;copy-rectangle-as-kill&lt;/code&gt; on the rectangle before the &lt;code&gt;=&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Undo the alignment with &lt;kbd&gt;C-x u&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;2. Using the versatile &lt;code&gt;matches&lt;/code&gt; function&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The following function &lt;code&gt;matches&lt;/code&gt; is quite usefull for collecting strings matching some regular expression. Please also read the doc-string of that function.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the function in your init files. (You only need this once to use it later on.)&lt;/li&gt;&#xA;&lt;li&gt;Select the region with the strings you want to collect. If region is not active then the region from &lt;code&gt;(point-min)&lt;/code&gt; to &lt;code&gt;(point-max)&lt;/code&gt; is used.&lt;/li&gt;&#xA;&lt;li&gt;Input &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;matches&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;. You can also bind &lt;code&gt;matches&lt;/code&gt; to some key if you like.&lt;/li&gt;&#xA;&lt;li&gt;Input your regular expression. In your case that can be &lt;code&gt;^[^= ]+&lt;/code&gt;. Press two times &lt;kbd&gt;RET&lt;/kbd&gt;. (The first time you confirm the default &lt;code&gt;0&lt;/code&gt; for the number of the sub-expression you want to collect from the match. Thereby &lt;code&gt;0&lt;/code&gt; means the full match.)&lt;/li&gt;&#xA;&lt;li&gt;Now you can yank a string with all matches where you want to have it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I've added the protection against matching empty strings before pasting the function here. Hopefully, that did not break anything. Just leave a comment if you encounter problems. I will fix them.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom matches-default-separator &quot; &quot;&#xA;  &quot;Default separator string for `matches'.&quot;&#xA;  :group 'matching&#xA;  :type 'string)&#xA;&#xA;(defvar matches-separator-history nil&#xA;  &quot;History of the separators for `matches'.&quot;)&#xA;&#xA;(defun matches (re &amp;amp;optional n b e unique)&#xA;  &quot;Return a list of all occurences of re within region from B to E.&#xA;If B and E are `nil' then search from point to end of buffer.&#xA;If called interactively the list goes to the kill-ring.&#xA;If UNIQUE is non-nil or if `matches' is called with interactively with prefix arg&#xA;then collect each matching string only once.&#xA;On interactive calls also the separator is asked for.&quot;&#xA;  (interactive &quot;sRegular expression:\nMNumber of subexpression (default: 0):&quot;)&#xA;  (let (sep)&#xA;    (if (stringp n) (setq n (string-to-number n)))&#xA;    (when (called-interactively-p 'any)&#xA;      (setq unique current-prefix-arg)&#xA;      (setq sep (read-string (format &quot;Separator (default: \&quot;%s\&quot;):&quot; matches-default-separator) nil 'matches-separator-history matches-default-separator))&#xA;      (if (use-region-p)&#xA;      (progn&#xA;        (setq b (region-beginning))&#xA;        (setq e (region-end)))))&#xA;    (let (ret)&#xA;      (save-excursion&#xA;    (unless n (setq n 0))&#xA;    (unless b (setq b (point)))&#xA;    (unless e (setq e (point-max)))&#xA;    (goto-char b)&#xA;    (condition-case err&#xA;        (while (search-forward-regexp re e 'noErr)&#xA;          (let ((str (match-string-no-properties n)))&#xA;        (unless (and unique&#xA;                 (assoc-string str ret))&#xA;          (setq ret (cons str ret)))&#xA;        (if (= (length str) 0) ;; protection against inappropriate re&#xA;            (forward-char))))&#xA;      (end-of-buffer))&#xA;    (setq ret (nreverse ret))&#xA;    (if (called-interactively-p 'any)&#xA;        (progn&#xA;          (message &quot;Matches found: %s&quot; ret)&#xA;          (kill-new (mapconcat 'identity ret sep))))&#xA;    ret))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-01-29T19:00:45.023" LastActivityDate="2016-01-29T19:00:45.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19935" PostTypeId="2" ParentId="19933" CreationDate="2016-01-29T18:44:58.590" Score="7" Body="&lt;p&gt;Here's one way to do it:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((a 2)) (pcase 2 ((pred (equal a)) 7)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This snippet uses the fact that (rephrasing &lt;code&gt;(describe-function 'pcase)&lt;/code&gt;) a predicate may have the form&lt;code&gt;(FUN ARG1 .. ARGN)&lt;/code&gt; in which case it gets called with an &lt;code&gt;N+1&lt;/code&gt;'th argument which is the value being matched.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-01-29T18:44:58.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19936" PostTypeId="1" AcceptedAnswerId="44679" CreationDate="2016-01-29T19:22:16.817" Score="34" ViewCount="8474" Body="&lt;p&gt;I would like to try spacemacs.  But I don't want to switch from my regular emacs configuration just yet, so I would like the configuration that's currently in my &lt;code&gt;.emacs.d&lt;/code&gt; to be in one directory, and the equivalent configuration for spacemacs to be in another directory.  I don't mind what name either directory has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that possible, short of chroots / LD_PRELOAD / other such trickery?  How can I do it?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2018-09-12T05:46:02.863" Title="Running spacemacs alongside regular emacs: how to keep a separate .emacs.d" Tags="|init-file|spacemacs|" AnswerCount="6" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19937" PostTypeId="1" AcceptedAnswerId="19938" CreationDate="2016-01-29T19:27:11.667" Score="0" ViewCount="158" Body="&lt;p&gt;I'm learning emacs now and I've run into a problem.&lt;br /&gt;&#xA;I would like to use &lt;code&gt;orgtbl&lt;/code&gt; minor-mode within an HTML file and be able to update the contents of the org table as HTML code directly.&lt;/p&gt;&#xA;&lt;p&gt;I saw an YouTube video and got interested to do so. But I don't know how. Here is my code as entered in emacs.&lt;br /&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/nlwGg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nlwGg.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I do not know where I'm wrong.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-01-30T08:20:52.687" Title="orgtbl-to-html within HTML document" Tags="|org-export|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19938" PostTypeId="2" ParentId="19937" CreationDate="2016-01-29T20:32:17.120" Score="2" Body="&lt;p&gt;The doc for this quite nice feature is in &lt;a href=&quot;http://orgmode.org/manual/Tables-in-arbitrary-syntax.html#Tables-in-arbitrary-syntax&quot; rel=&quot;nofollow&quot;&gt;Appendix A&lt;/a&gt; of org manual and says (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Just above the source table&lt;/strong&gt;, we put a special line that tells Orgtbl&#xA;  mode how to translate this table and where to install it.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ORGTBL: SEND table_name translation_function arguments...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you need to remove the blank line between the &lt;code&gt;#+ORGTBL:&lt;/code&gt; and the table itself.  Typing &lt;code&gt;C-c C-c&lt;/code&gt; with point in the table does update html code in the &lt;code&gt;RECEIVE ORGTBL&lt;/code&gt; area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;orgtbl-insert-radio-table&lt;/code&gt; inserts a skeleton, avoiding this kind of problems.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-01-30T08:20:52.687" LastActivityDate="2016-01-30T08:20:52.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19939" PostTypeId="2" ParentId="19933" CreationDate="2016-01-29T20:41:12.277" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;An alternative to pcase with similar features would also suffice&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(let ((a 2))&#xA;  (cond ((eq a 2)&#xA;         7)))&#xA;;; =&amp;gt; 7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This isn't a joke - everything that &lt;em&gt;can be&lt;/em&gt; done with &lt;code&gt;pcase&lt;/code&gt; can&#xA;also be done with a combination of &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;cond&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it think it &lt;em&gt;should be&lt;/em&gt; - gratuitous branch-introducing macros&#xA;aren't helping anyone to either code faster or maintain&#xA;easier. They're introducing &lt;em&gt;another&lt;/em&gt; language you have to learn, on&#xA;top of Elisp.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-01-29T20:41:12.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19940" PostTypeId="2" ParentId="19936" CreationDate="2016-01-29T20:43:14.417" Score="21" Body="&lt;p&gt;One option is to specify which configuration you want to load in a &lt;code&gt;~/.emacs&lt;/code&gt; file. When Emacs starts up it will look for such a file before looking in &lt;code&gt;~/.emacs.d/&lt;/code&gt;. For more details you can read about the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html#Init-File&quot;&gt;Init File&lt;/a&gt; in the Emacs manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example you might create a &lt;code&gt;~/.spacemacs.d&lt;/code&gt; and keep your existing &lt;code&gt;~/.emacs.d&lt;/code&gt; as it is. Then create a &lt;code&gt;~/.emacs&lt;/code&gt; to load whichever one you are in the mood to use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq use-spacemacs t)   ; or nil &#xA;&#xA;(when use-spacemacs&#xA;  (setq user-emacs-directory &quot;~/.spacemacs.d/&quot;))   ; defaults to ~/.emacs.d/&#xA;&#xA;(load (expand-file-name &quot;init.el&quot; user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want you can come up with ways to switch configs without modifying the .emacs file. For example, have your .emacs check for some environment variable that you set in your shell or in a script that you use to start spacemacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq use-spacemacs (getenv &quot;USE_SPACEMACS&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-02-02T18:51:43.530" LastActivityDate="2016-02-02T18:51:43.530" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19941" PostTypeId="2" ParentId="19903" CreationDate="2016-01-29T21:01:23.247" Score="9" Body="&lt;p&gt;There may be a &quot;smarter&quot; way but if you don't use &lt;code&gt;EXAMPLE&lt;/code&gt; blocks for other purpose you could instruct the latex exporter to export them as &lt;code&gt;lstlisting&lt;/code&gt; environment, using &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html#Advanced-configuration&quot; rel=&quot;noreferrer&quot;&gt;export filters&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-latex-export-example-blocks (text backend info)&#xA;  &quot;Export example blocks as listings env.&quot;&#xA;  (when (org-export-derived-backend-p backend 'latex)&#xA;    (with-temp-buffer&#xA;      (insert text)&#xA;      ;; replace verbatim env by listings&#xA;      (goto-char (point-min))&#xA;      (replace-string &quot;\\begin{verbatim}&quot; &quot;\\begin{lstlisting}&quot;)&#xA;      (replace-string &quot;\\end{verbatim}&quot; &quot;\\end{lstlisting}&quot;)&#xA;      (buffer-substring-no-properties (point-min) (point-max)))))&#xA;&#xA;(add-to-list 'org-export-filter-example-block-functions&#xA;         'my-latex-export-example-blocks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-06-14T06:00:45.000" LastActivityDate="2016-06-14T06:00:45.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19942" PostTypeId="2" ParentId="19148" CreationDate="2016-01-29T21:50:48.197" Score="4" Body="&lt;p&gt;&lt;em&gt;grepping&lt;/em&gt; for &quot;really edit the buffer&quot; in emacs source I found function &lt;code&gt;ask-user-about-supersession-threat&lt;/code&gt; in file &lt;code&gt;userlock.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems straightforward to add a &lt;code&gt;d&lt;/code&gt; choice for calling &lt;code&gt;ediff-current-file&lt;/code&gt;. I haven't tested this extensively, though (edits marked with &lt;code&gt;;;-&lt;/code&gt; comments).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ask-user-about-supersession-threat (fn)&#xA;  &quot;Ask a user who is about to modify an obsolete buffer what to do.&#xA;This function has two choices: it can return, in which case the modification&#xA;of the buffer will proceed, or it can (signal 'file-supersession (file)),&#xA;in which case the proposed buffer modification will not be made.&#xA;&#xA;You can rewrite this to use any criterion you like to choose which one to do.&#xA;The buffer in question is current when this function is called.&quot;&#xA;  (discard-input)&#xA;  (save-window-excursion&#xA;    (let ((prompt&#xA;       (format &quot;%s changed on disk; \&#xA;really edit the buffer? (y, n, r, d or C-h) &quot; ;;- changed&#xA;           (file-name-nondirectory fn)))&#xA;      (choices '(?y ?n ?r ?d ?? ?\C-h))       ;;- changed&#xA;      answer)&#xA;      (while (null answer)&#xA;    (setq answer (read-char-choice prompt choices))&#xA;    (cond ((memq answer '(?? ?\C-h))&#xA;           (ask-user-about-supersession-help)&#xA;           (setq answer nil))&#xA;          ((eq answer ?r)&#xA;           ;; Ask for confirmation if buffer modified&#xA;           (revert-buffer nil (not (buffer-modified-p)))&#xA;           (signal 'file-supersession&#xA;               (list &quot;File reverted&quot; fn)))&#xA;          ((eq answer ?d)                     ;;- added&#xA;           (ediff-current-file))              ;;- added&#xA;          ((eq answer ?n)&#xA;           (signal 'file-supersession&#xA;               (list &quot;File changed on disk&quot; fn)))))&#xA;      (message&#xA;       &quot;File on disk now will become a backup file if you save these changes.&quot;)&#xA;      (setq buffer-backed-up nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-01-29T21:50:48.197" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19943" PostTypeId="1" AcceptedAnswerId="19944" CreationDate="2016-01-29T22:05:51.663" Score="0" ViewCount="80" Body="&lt;p&gt;Usually I name my LaTeX files using the extension &lt;code&gt;.ltx&lt;/code&gt; like &lt;code&gt;file.ltx&lt;/code&gt;. How can I configure Emacs+AUCTeX in a way that it recognizes those files and load AUCTeX?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2016-01-29T22:15:35.593" Title="How to use .ltx as extension for LaTeX documents?" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19944" PostTypeId="2" ParentId="19943" CreationDate="2016-01-29T22:15:35.593" Score="3" Body="&lt;p&gt;Add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq auto-mode-alist (cons '(&quot;\\.ltx$&quot; . latex-mode) auto-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The regular expression says &quot;ends with &lt;code&gt;.ltx&lt;/code&gt;&quot;. &#xA;Documentation is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-01-29T22:15:35.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19945" PostTypeId="1" AcceptedAnswerId="19946" CreationDate="2016-01-29T22:27:40.820" Score="45" ViewCount="38748" Body="&lt;p&gt;I found the command &lt;code&gt;SPC m x c&lt;/code&gt; to insert a small code snippet like &lt;code&gt;~~&lt;/code&gt;. I would like to insert a longer snippet like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN_SRC &#xA; #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a command to do this? I found a way to add it for markdown, which is &lt;code&gt;SPC m x c&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10940" LastEditorUserId="-1" LastEditDate="2018-04-11T14:46:43.370" LastActivityDate="2023-04-07T15:11:19.197" Title="Command to insert code block?" Tags="|org-mode|spacemacs|" AnswerCount="1" CommentCount="3" ClosedDate="2016-01-31T15:07:12.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="19946" PostTypeId="2" ParentId="19945" CreationDate="2016-01-29T22:43:10.530" Score="94" Body="&lt;p&gt;&lt;em&gt;&lt;strong&gt;February 2020 update to this answer:&lt;/strong&gt;&lt;/em&gt;&#xA;From org version 9.2, the old easy templates referred to in this answer is no longer active by default, see this answer for more info: &lt;a href=&quot;https://emacs.stackexchange.com/questions/46988/why-do-easy-templates-e-g-s-tab-in-org-9-2-not-work&quot;&gt;Why do easy templates, .e.g, &amp;quot;&amp;lt; s TAB&amp;quot; in org 9.2 not work?&lt;/a&gt; along with the new way to access easy templates which is invoking &amp;quot;org-insert-structure-template&amp;quot; &lt;kbd&gt;C-c C-,&lt;/kbd&gt;, or using Spacemacs: &lt;kbd&gt;, i b&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;p&gt;Original answer:&lt;/p&gt;&#xA;&lt;p&gt;Yes, it's called &lt;strong&gt;easy templates&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Org mode supports insertion of empty structural elements (like&#xA;‘#+BEGIN_SRC’ and ‘#+END_SRC’ pairs) with just a few key strokes.  This&#xA;is achieved through a native template expansion mechanism.  Note that&#xA;Emacs has several other template mechanisms which could be used in a&#xA;similar way, for example ‘yasnippet’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;To insert a structural element, type a ‘&amp;lt;’, followed by a template&#xA;selector and ‘TAB’.  Completion takes effect only when the above&#xA;keystrokes are typed on a line by itself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;For your precise question: &lt;code&gt;&amp;lt;s&lt;/code&gt; then TAB.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Note it's not specific to spacemacs, since it's from native org-mode&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="40283" LastEditDate="2023-04-07T15:11:19.197" LastActivityDate="2023-04-07T15:11:19.197" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="19947" PostTypeId="1" CreationDate="2016-01-29T23:25:27.080" Score="8" ViewCount="1864" Body="&lt;p&gt;Suppose I want the face &lt;code&gt;helm-match&lt;/code&gt; to have an unset foreground. Unfortunately, &lt;code&gt;helm-match&lt;/code&gt; inherits from &lt;code&gt;match&lt;/code&gt; so, if I try to unset the foreground normally:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-foreground 'helm-match nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The inherited foreground becomes active. I'd rather not mess with the &lt;code&gt;match&lt;/code&gt; face itself (because I can't tell what ramifications that would have), and I would like to avoid hard coding the other values in &lt;code&gt;helm-match&lt;/code&gt; because I use multiple themes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this sanely?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2024-03-06T01:07:15.893" Title="Unset inherited face attribute" Tags="|faces|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19948" PostTypeId="2" ParentId="19947" CreationDate="2016-01-30T00:47:29.227" Score="0" Body="&lt;p&gt;Use &lt;code&gt;unspecified&lt;/code&gt; as value instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html&quot; rel=&quot;nofollow&quot;&gt;face attributes&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-01-30T00:47:29.227" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19949" PostTypeId="1" CreationDate="2016-01-30T06:39:45.193" Score="3" ViewCount="470" Body="&lt;p&gt;I'm using emacs to run ansi-term with an ssh'ed tmux inside. I can scroll using my prefix &lt;code&gt;C-b + [&lt;/code&gt; as per &lt;a href=&quot;https://superuser.com/questions/209437/how-do-i-scroll-in-tmux&quot;&gt;this thread&lt;/a&gt;, but I would like to be able to scroll with the mouse immediately. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to work if I'm doing it in a terminal outside of emacs, so I'm wondering what steps are necessary when doing it within emacs. &lt;/p&gt;&#xA;" OwnerUserId="9014" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2016-01-30T06:39:45.193" Title="Scrolling in tmux in emacs" Tags="|scrolling|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19951" PostTypeId="1" CreationDate="2016-01-30T12:01:54.077" Score="3" ViewCount="123" Body="&lt;p&gt;As I am working more and more with these modern &quot;compiles to Javascript&quot; languages my ECB files view becomes more and more cluttered. Projectile seems to get things right out of the box by ignoring everything that is part of my &lt;code&gt;.gitignore&lt;/code&gt; file, can I tell ECB to do something similar? Specifically I want to get rid of those &lt;code&gt;.js&lt;/code&gt; and &lt;code&gt;.js.map&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qpKBT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qpKBT.png&quot; alt=&quot;Unneeded .js and .map files&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of &lt;code&gt;M-x customize-group RET ecb-sources&lt;/code&gt; and &lt;code&gt;source-file-regexps&lt;/code&gt; but that seems like a global solution to a local problem: In other projects I need to see files with these extensions.&lt;/p&gt;&#xA;" OwnerUserId="542" LastActivityDate="2016-01-30T12:01:54.077" Title="Restrict the ECB file tree to files known by projectile OR files not in my .gitignore?" Tags="|projectile|ecb|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19954" PostTypeId="2" ParentId="19922" CreationDate="2016-01-30T16:10:17.123" Score="2" Body="&lt;p&gt;It is possible to customize some keywords of a mode. For example, here is a way to highlight &lt;code&gt;throw&lt;/code&gt; and &lt;code&gt;new&lt;/code&gt; in bold yellow, in Java mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; define the look for your modified keywords&#xA;(defface my-keyword-face&#xA;  '((default :foreground &quot;yellow&quot; :weight bold))&#xA;  &quot;Face for my own keywords.&quot;)&#xA;&#xA;;; define the keywords you want to modify&#xA;(defvar my-modified-java-keywords&#xA;  '((&quot;\\&amp;lt;\\(throw\\)\\&amp;gt;&quot; . 'my-keyword-face)&#xA;    (&quot;\\&amp;lt;\\(new\\)\\&amp;gt;&quot; . 'my-keyword-face)))&#xA;&#xA;;; modify the keywords&#xA;(font-lock-add-keywords 'java-mode my-modified-java-keywords)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More detailed information is found in &lt;a href=&quot;http://www.emacswiki.org/emacs/AddKeywords&quot; rel=&quot;nofollow&quot;&gt;emacswiki&lt;/a&gt;, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Mode.html&quot; rel=&quot;nofollow&quot;&gt;the manual&lt;/a&gt; and the documentation for the relevant functions in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-01-30T16:10:17.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19957" PostTypeId="1" AcceptedAnswerId="19978" CreationDate="2016-01-30T18:38:51.777" Score="0" ViewCount="115" Body="&lt;p&gt;I liked the interactivity of Clojure/Lisp, where you can see the result in the REPL. I tried to implement the same behaviour for SQL-mode.&#xA;The idea is that when I do &lt;kbd&gt;C-x C-e&lt;/kbd&gt; on the SQL-statemnt, I see the result in the &lt;code&gt;*SQL*&lt;/code&gt;-mode, which will function as an alternative REPL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get this behaviour, I wrote two functions (I use Evil, so I have a normal, visual and insert state).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sql-region-evaluate (start end)&#xA;&quot;This will send the selected region to the SQL process&quot;&#xA;(interactive &quot;r&quot;)&#xA;(if (evil-visual-state-p)&#xA;    (sql-send-string (buffer-substring-no-properties start end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I select a region, then I will use this function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not want to use the &lt;code&gt;sql-send-buffer&lt;/code&gt; command, because sometimes I type the next statement after the previous statement. When calling &lt;code&gt;sql-send-buffer&lt;/code&gt; both SQL-statements will be queried, instead the last one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that's why I use the &lt;code&gt;sql-send-region&lt;/code&gt;. The key command &lt;kbd&gt;vap&lt;/kbd&gt; is an Evil keysequence in normal state which will visually selects the block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sql-evaluate (s)&#xA;&quot;It will visually select the text block, and send it to the SQL process&quot;&#xA;(interactive)&#xA;    ;; If I'm in the normal mode&#xA;    (if (evil-normal-state-p)&#xA;        (lambda ()&#xA;            (execute-kbd-macro (kbd &quot;vap&quot;))&#xA;            (sql-send-region start end)&#xA;            )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call &lt;code&gt;sql-region-evaluate&lt;/code&gt;, it works fine.&#xA;When I call &lt;code&gt;sql-evaluate&lt;/code&gt;, nothing happens, I don't get any error message or something. So I cannot trace it back where it went wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions where it could get wrong?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-01-31T10:50:02.073" Title="The function will not pass anything to a SQL process, when called. There is no error" Tags="|evil|sql-interactive-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19958" PostTypeId="2" ParentId="12662" CreationDate="2016-01-30T18:50:12.427" Score="0" Body="&lt;p&gt;I don't think &lt;code&gt;emms&lt;/code&gt; is what you want. Try following the instructions in the emms manual carefully, ending up at &lt;code&gt;emms-smart-browse&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-01-30T18:50:12.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19959" PostTypeId="1" AcceptedAnswerId="19962" CreationDate="2016-01-30T19:01:36.597" Score="0" ViewCount="111" Body="&lt;p&gt;On each action (opening new buffer, opening packages-list), I have different messages in minibuffer, how to disable it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks like the problem is in ergoemacs package, beacuse when I disable it - all works normally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WWWT1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WWWT1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/JWtao.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JWtao.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2759" LastEditorUserId="105" LastEditDate="2016-01-31T00:50:09.070" LastActivityDate="2016-02-01T17:10:17.070" Title="How to disable annoying messages &quot;- Label-&gt;: xxxxxxx&quot; in minibuffer" Tags="|ergoemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19960" PostTypeId="1" AcceptedAnswerId="19971" CreationDate="2016-01-30T19:18:26.187" Score="3" ViewCount="228" Body="&lt;p&gt;This may be a more general programming question that just for Emacs Lisp, but I'm wondering when a function should signal an error vs. return nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Raising an error is &quot;failing loudly&quot;, which is usually a good thing for debugging, etc. But for a function like &lt;code&gt;file-name-directory&lt;/code&gt;, which I often use together with &lt;code&gt;buffer-file-name&lt;/code&gt;, it often seems unnecessary that I should need to check that &lt;code&gt;buffer-file-name&lt;/code&gt; is non-nil so that &lt;code&gt;file-name-directory&lt;/code&gt; does not signal an error. In this case, it should be reasonable that &lt;code&gt;file-name-directory&lt;/code&gt; of nil is nil.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2016-03-14T17:12:37.807" LastActivityDate="2016-03-14T17:12:37.807" Title="When to return nil vs. signal error?" Tags="|coding-conventions|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19961" PostTypeId="1" AcceptedAnswerId="20024" CreationDate="2016-01-30T19:33:29.970" Score="3" ViewCount="3543" Body="&lt;p&gt;I'm trying to transfer over from vim to Emacs. I'm using &lt;code&gt;evil&lt;/code&gt; to emulate vim modal editing. In vim, I've remapped &lt;code&gt;jk&lt;/code&gt; to get me out of insert mode and back into normal mode using &lt;code&gt;inoremap jk &amp;lt;esc&amp;gt;&lt;/code&gt;. At the moment, I'm using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define evil-insert-state-map &quot;jk&quot; 'evil-normal-state)&#xA;(key-chord-define evil-replace-state-map &quot;jk&quot; 'evil-normal-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to do this in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I'm in insert mode and want to type, say, &lt;code&gt;jump&lt;/code&gt;, I end up with just &lt;code&gt;mp&lt;/code&gt;, and &lt;code&gt;j u is undefined&lt;/code&gt; appears under the mode bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to fix this behaviour? Preferably, the solution would even allow me to type &lt;code&gt;jk&lt;/code&gt; by typing &lt;code&gt;j&lt;/code&gt;, waiting, and then typing &lt;code&gt;k&lt;/code&gt; (like in vim).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; &lt;br&gt;&#xA;&lt;br&gt;&#xA;To clarify, I was only using &lt;code&gt;key-chord&lt;/code&gt; as a temporary solution to get me  into normal mode; I am very willing to accept any solution that fixes the &lt;em&gt;problem&lt;/em&gt;, regardless of whether it involves &lt;code&gt;key-chord&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10948" LastEditorUserId="10" LastEditDate="2016-02-02T22:53:55.973" LastActivityDate="2023-12-11T23:43:59.183" Title="Using 'jk' to exit insert mode with key-chord or anything else" Tags="|evil|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19962" PostTypeId="2" ParentId="19959" CreationDate="2016-01-30T20:13:09.600" Score="0" Body="&lt;p&gt;I fix this problem by reinstalling ergoemacs from GNU package archives &lt;strong&gt;NOT FROM MELPA&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read how to pin package versions &lt;a href=&quot;http://www.lonecpluspluscoder.com/2014/11/using-elpa-pinned-packages-gnu-emacs-24-4/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bug &lt;a href=&quot;https://github.com/ergoemacs/ergoemacs-mode/issues/403&quot; rel=&quot;nofollow&quot;&gt;already fixed&lt;/a&gt; in &lt;strong&gt;Git&lt;/strong&gt; version, MELPA one will soon update. To disable all messages you can also use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ergoemacs-messages-level 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2759" LastEditorUserId="2759" LastEditDate="2016-02-01T17:10:17.070" LastActivityDate="2016-02-01T17:10:17.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19963" PostTypeId="1" AcceptedAnswerId="20126" CreationDate="2016-01-30T20:27:34.020" Score="6" ViewCount="121" Body="&lt;p&gt;In &lt;code&gt;haskell-doc-mode&lt;/code&gt; we have a timer that shows useful tips in minibuffer when cursor is idle for a moment. In other part of Haskell Mode there is code asking questions using &lt;code&gt;y-or-n-p&lt;/code&gt; or &lt;code&gt;read-event&lt;/code&gt;. The problem is &lt;code&gt;haskell-doc-mode&lt;/code&gt; does not know about this and overwrites echo area. Users are confused and think Emacs is hanging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a general mechanism to detect if &lt;code&gt;read-event&lt;/code&gt; or &lt;code&gt;y-or-n-p&lt;/code&gt; is running?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link to the reported issue:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/haskell/haskell-mode/issues/820&quot;&gt;https://github.com/haskell/haskell-mode/issues/820&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-03-13T22:09:15.280" LastActivityDate="2016-03-13T22:09:15.280" Title="How to detect if `read-event` or `y-or-n-p` is running?" Tags="|events|timers|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19964" PostTypeId="1" AcceptedAnswerId="19968" CreationDate="2016-01-30T20:58:24.707" Score="0" ViewCount="601" Body="&lt;p&gt;I want to run Latexmk automatically with the correct TeX-engine as set in the local file variable at the end of the file, for example: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% Local Variables:&#xA;%% TeX-engine: luatex&#xA;%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file I tried something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook (lambda ()&#xA;  (push &#xA;    '(&quot;Latexmk&quot; &quot;latexmk %(-PDF) %s&quot; TeX-run-TeX nil t&#xA;      :help &quot;Run Latexmk on file&quot;)&#xA;    TeX-command-list)&#xA;&#xA;'(&quot;%(-PDF)&quot;&#xA;  (lambda ()&#xA;    (if (equal TeX-engine 'luatex)&#xA;        &quot;-lualatex&quot; &quot;-pdf&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I get the desired result?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-01-30T22:21:05.523" Title="Run latexmk with luatex or pdflatex depending on the local variable" Tags="|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19965" PostTypeId="2" ParentId="19963" CreationDate="2016-01-30T21:26:59.730" Score="1" Body="&lt;p&gt;For &lt;code&gt;y-or-n-p&lt;/code&gt;, you could check the value of &lt;code&gt;input-method-use-echo-area&lt;/code&gt;. It is turned on by &lt;code&gt;read-key-sequence&lt;/code&gt;, which is indirectly used by &lt;code&gt;y-or-n-p&lt;/code&gt; – and quite likely by various other commands you'd like to treat the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Detecting an active &lt;code&gt;read-event&lt;/code&gt; seems to be harder. Perhaps it's preferable to call it via a wrapper which rebinds some variable to let you detect its use.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-01-30T21:26:59.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19966" PostTypeId="2" ParentId="19960" CreationDate="2016-01-30T21:59:43.520" Score="1" Body="&lt;p&gt;This is not a direct answer to your question, but for the special use case you mention, a different method might be to define&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro maybe (fun val)&#xA;    &quot;Evaluate VAL and if the result is non-nil, run FUN on the value.&#xA;Otherwise, return nil.&quot;&#xA;  (let ((tmp (gensym)))&#xA;    `(let ((,tmp ,val)) (if ,tmp (,fun ,val) nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and to call this using &lt;code&gt;(maybe file-name-directory (buffer-file-name))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Very loosely inspired by the &lt;code&gt;Maybe&lt;/code&gt; monad of haskell.)&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-01-30T21:59:43.520" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19967" PostTypeId="1" AcceptedAnswerId="19979" CreationDate="2016-01-30T22:17:05.017" Score="9" ViewCount="2301" Body="&lt;p&gt;That is, how do I change this task list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO A&#xA;* DONE B&#xA;* TODO C&#xA;* DONE D&#xA;* TODO E&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into the following one?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE B&#xA;* DONE D&#xA;* TODO A&#xA;* TODO C&#xA;* TODO E&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-01-31T15:04:19.483" Title="How do I move TODO entries to the bottom of a task list?" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19968" PostTypeId="2" ParentId="19964" CreationDate="2016-01-30T22:21:05.523" Score="2" Body="&lt;p&gt;I am going out on a limb and guessing that what you want is more along these lines (&lt;em&gt;totally untested&lt;/em&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;tex&quot;&#xA;  '(progn&#xA;     (push '(&quot;Latexmk&quot; &quot;latexmk %(-PDF) %s&quot; TeX-run-TeX nil t&#xA;             :help &quot;Run Latexmk on file&quot;)&#xA;           TeX-command-list)&#xA;     (push '(&quot;%(-PDF)&quot;&#xA;             (lambda ()&#xA;               (if (equal TeX-engine 'luatex)&#xA;                   &quot;-lualatex&quot; &quot;-pdf&quot;)))&#xA;           TeX-expand-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By using &lt;code&gt;eval-after-load&lt;/code&gt; instead of a hook variable, I avoid having the same value pushed over and over again each time the mode is run. (You could achieve the same by using &lt;code&gt;pushnew&lt;/code&gt;, since we are trying to push literally the same object on each run. Or by arraning for a hook function to remove itself after running.)&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-01-30T22:21:05.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19969" PostTypeId="1" AcceptedAnswerId="19970" CreationDate="2016-01-30T22:26:04.277" Score="2" ViewCount="147" Body="&lt;p&gt;I'm running &lt;code&gt;M-x man ...&lt;/code&gt; and I'm getting this in my &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;You can run the command `man' with m&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does it mean? It obviously doesn't run when I just press &lt;code&gt;m&lt;/code&gt; and it doesn't run &lt;code&gt;man&lt;/code&gt; when I do &lt;code&gt;M-x m&lt;/code&gt; either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked in my config and there's nothing mentioning man there.&lt;/p&gt;&#xA;" OwnerUserId="10949" LastActivityDate="2016-01-31T11:27:23.877" Title="What does &quot;You can run the command X with Y&quot; mean?" Tags="|key-bindings|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19970" PostTypeId="2" ParentId="19969" CreationDate="2016-01-30T22:44:06.583" Score="7" Body="&lt;p&gt;The &lt;code&gt;m&lt;/code&gt; key does indeed run the &lt;code&gt;man&lt;/code&gt; command in the given context, which turned out to be a &lt;code&gt;Man-mode&lt;/code&gt; buffer. Never forget that keybindings can be local! They can even vary within the same buffer, depending on character properties.&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2016-01-31T11:27:23.877" LastActivityDate="2016-01-31T11:27:23.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19971" PostTypeId="2" ParentId="19960" CreationDate="2016-01-31T00:34:45.693" Score="3" Body="&lt;p&gt;If you think that is a reasonable behavior for &lt;code&gt;file-name-directory&lt;/code&gt; then consider filing an enhancement request: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, imagine that most of the cases where &lt;code&gt;file-name-directory&lt;/code&gt; is called, it is passed a value that is beyond the control of the immediate code.  That is, &lt;code&gt;file-name-directory&lt;/code&gt; can be called in any context, and it could be supposed that in most contexts an argument value of &lt;code&gt;nil&lt;/code&gt; would indeed represent an error and should be raised as such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's always a programmer choice - a judgment of which behavior is most useful. Presumably, the Emacs developers who designed &lt;code&gt;file-name-directory&lt;/code&gt; figured that a non-string argument should in general raise an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember too that it is trivial for code that calls &lt;code&gt;file-name-directory&lt;/code&gt; to control the behavior, so that it is different in the case of a &lt;code&gt;nil&lt;/code&gt; (or other non-string) argument.  It could be as trivial as this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-file-name-directory (file)&#xA;  &quot;`file-name-directory', except return `nil' for `nil' argument.&quot;&#xA;  (and file  (file-name-directory file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or it could handle the &lt;code&gt;wrong-type-argument&lt;/code&gt; error anyway you like, including special-casing &lt;code&gt;nil&lt;/code&gt; to just return &lt;code&gt;nil&lt;/code&gt; (as in the above code).  To do that, just wrap the call in &lt;code&gt;condition-case&lt;/code&gt; and handle the error that would normally be raised anyway you like.  This code does exactly the same as the above code, but you can see that you could handle other wrong types individually, by testing them (&lt;code&gt;numberp&lt;/code&gt;, &lt;code&gt;arrayp&lt;/code&gt;, &lt;code&gt;symbolp&lt;/code&gt;, etc.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-file-name-directory (file)&#xA;  &quot;`file-name-directory', except return `nil' for `nil' argument.&quot;&#xA;  (condition-case err&#xA;      (file-name-directory file)&#xA;    (wrong-type-argument (and file  (error &quot;%s&quot; (error-message-string err))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-31T00:34:45.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19972" PostTypeId="2" ParentId="19961" CreationDate="2016-01-31T00:48:45.833" Score="4" Body="&lt;p&gt;You have, in effect, defined &lt;code&gt;j&lt;/code&gt; as a prefix key, which means that any key you press after it is looked up in the keymap associated with &lt;code&gt;j&lt;/code&gt;.  Since &lt;code&gt;u&lt;/code&gt; is undefined after &lt;code&gt;j&lt;/code&gt; you get the behavior you see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A key cannot be bound to two different commands.  In particular, it cannot be bound to both &lt;code&gt;self-insert-command&lt;/code&gt; (or equivalent), which inserts a character, and bound to a keymap (acts as a prefix key).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do instead is to bind &lt;code&gt;j&lt;/code&gt; to a command that reads a character and does something different depending on what that character is: If it is &lt;code&gt;k&lt;/code&gt; then do &lt;code&gt;evil-normal-state&lt;/code&gt;.  If it is any other character than &lt;code&gt;k&lt;/code&gt; then it inserts that character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this (but you would bind the key in some Evil mode, no doubt, not globally):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-j ()&#xA;  &quot;Read a char.  If `k' then invoke `evil-normal-state'.  Else insert it.&quot;&#xA;  (interactive)&#xA;  (let ((ch  (read-char-exclusive)))&#xA;    (if (eq ?k ch)&#xA;        (message &quot;Invoke EVIL-NORMAL-STATE HERE&quot;) ;; (evil-normal-state)&#xA;      (insert &quot;j&quot; (string ch)))))&#xA;&#xA;(global-set-key &quot;j&quot; 'my-j)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-01-31T00:48:45.833" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19973" PostTypeId="2" ParentId="19963" CreationDate="2016-01-31T01:05:45.863" Score="0" Body="&lt;p&gt;I believe you could check the return value of &lt;code&gt;current-message&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IIRC you can use the haskell-doc.el by enabling &lt;code&gt;eldoc-mode&lt;/code&gt; instead of &lt;code&gt;haskell-doc-mode&lt;/code&gt; (at least that worked for me at some point), so maybe an alternative solution is to deprecate &lt;code&gt;haskell-doc-mode&lt;/code&gt; and rely on &lt;code&gt;eldoc-mode&lt;/code&gt; (which is enabled by default in Emacs-25) instead.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-01-31T01:05:45.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19974" PostTypeId="1" CreationDate="2016-01-31T04:41:42.647" Score="2" ViewCount="412" Body="&lt;p&gt;I installed auto-complete by &lt;code&gt;M-x list-packages&lt;/code&gt;, navigating to the &lt;code&gt;auto-complete&lt;/code&gt; package, and hit the Install button. The emacswiki page says that doing so will configure the load-path so auto-complete.el will be loaded correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this in my init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'auto-complete)&#xA;(global-auto-complete-mode t)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and emacs gives the following error:&#xA;File error: Cannot open load file, not a directory, auto-complete&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried adding the directory containing &lt;code&gt;auto-complete.el&lt;/code&gt; to the &lt;code&gt;load-path&lt;/code&gt; but it still gives me the same error.&lt;/p&gt;&#xA;" OwnerUserId="10954" LastActivityDate="2016-01-31T05:09:36.733" Title="Cannot turn on global-auto-complete-mode" Tags="|init-file|auto-complete-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19975" PostTypeId="2" ParentId="19974" CreationDate="2016-01-31T05:09:36.733" Score="1" Body="&lt;p&gt;As discussed in the comments, the solution is to ensure that &lt;code&gt;(package-initialize)&lt;/code&gt; is in the emacs config.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html&quot; rel=&quot;nofollow&quot;&gt;Package Installation&lt;/a&gt; section of the emacs Manual,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In some circumstances, you may want to load packages explicitly in your init file (usually because some other code in your init file depends on a package). In that case, your init file should call the function &lt;code&gt;package-initialize&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I would say that in &lt;em&gt;almost all circumstances&lt;/em&gt; it would be needed to have &lt;code&gt;(package-initialize)&lt;/code&gt; in the very beginning of the user's init file.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-01-31T05:09:36.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19976" PostTypeId="1" CreationDate="2016-01-31T09:32:26.910" Score="2" ViewCount="1224" Body="&lt;p&gt;I have this component in org-publish list :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;presentations&quot;&#xA;:base-directory &quot;~/presentations/org/&quot;&#xA;:base-extension &quot;org&quot;&#xA;:publishing-directory &quot;~/presentations/&quot;&#xA;:publishing-function org-reveal-publish-to-reveal&#xA;:auto-sitemap t&#xA;:sitemap-filename &quot;index.html&quot;&#xA;:sitemap-function org-publish-org-sitemap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I avoid &lt;code&gt;:publishing-function org-reveal-publish-to-reveal&lt;/code&gt;&#xA;from adding &lt;code&gt;reveal.js&lt;/code&gt; styles to sitemap file. I just want to have&#xA;all the files listed in index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;I'm doing this to regenerate index file with org-html-publish-to-html.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;presentations-index&quot;&#xA;         :base-directory &quot;~/presentations/org/&quot;&#xA;         :base-extension nil&#xA;         :exclude &quot;.*&quot;&#xA;         :include [&quot;index.org&quot;]&#xA;         :publishing-function org-html-publish-to-html&#xA;         :publishing-directory &quot;~/presentations/&quot;&#xA;         :auto-sitemap nil)&#xA;(&quot;presentations&quot;&#xA;         :base-directory &quot;~/presentations/org/&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;~/presentations/&quot;&#xA;         :publishing-function org-reveal-publish-to-reveal&#xA;         :auto-sitemap t&#xA;         :sitemap-title &quot;[ Presentations ]&quot;&#xA;         :sitemap-filename &quot;index.org&quot;&#xA;         :exclude &quot;index.org&quot;&#xA;         )&#xA;(&quot;present&quot; :components (&quot;presentations&quot; &quot;presentations-index&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10956" LastEditorUserId="10956" LastEditDate="2016-02-01T08:04:04.950" LastActivityDate="2016-02-01T08:04:04.950" Title="How to use custom :sitemap-function with org-publish?" Tags="|org-mode|org-export|html|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19977" PostTypeId="2" ParentId="19926" CreationDate="2016-01-31T09:40:41.333" Score="4" Body="&lt;p&gt;What you want is to fold a subtree and its parent.  Doing &lt;code&gt;C-h f hide-&lt;/code&gt; &lt;code&gt;TAB&lt;/code&gt; shows there's apparently nothing doing exactly that, but there's a &lt;code&gt;hide-subtree&lt;/code&gt; command:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(hide-subtree)&lt;/p&gt;&#xA;&lt;p&gt;Hide everything after this heading at deeper levels.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So you could go up one heading (move to the parent) and then &lt;code&gt;hide-subtree&lt;/code&gt;.  Let's define a (very simple) command to do that:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun hide-subtree-and-parent ()&#xA;  (interactive)&#xA;  (outline-up-heading 1)&#xA;  (hide-subtree)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can then bind this command to a key (here &lt;code&gt;C-c h&lt;/code&gt;) if you use it very often.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook &#xA;   (lambda () (define-key org-mode-map &amp;quot;\C-ch&amp;quot; 'hide-subtree-and-parent)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-01-31T09:40:41.333" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19978" PostTypeId="2" ParentId="19957" CreationDate="2016-01-31T10:50:02.073" Score="1" Body="&lt;p&gt;Your code is not doing what you think it is doing.  The latter example wraps two forms in a lambda, so all that happens is that &lt;code&gt;sql-evaluate&lt;/code&gt; is going to return an anonymous function (or &lt;code&gt;nil&lt;/code&gt; if you're not in visual state).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please don't do that.  Use either &lt;code&gt;progn&lt;/code&gt; for wrapping forms to be evaluated sequentially (with the last form as return value) or use special forms using an implicit &lt;code&gt;progn&lt;/code&gt;, such as &lt;code&gt;when&lt;/code&gt; (which is like &lt;code&gt;if&lt;/code&gt;, but doesn't have an else clause, so it does allow you to specify as many then clauses as you need).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And now, a rewritten variant of the above (untested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-eval-sql ()&#xA;  (interactive)&#xA;  (cond&#xA;   ((evil-visual-state-p)&#xA;    (sql-send-region (region-beginning) (region-end)))&#xA;   ((evil-normal-state-p)&#xA;    (sql-send-region (beginning-of-thing 'paragraph) (end-of-thing 'paragraph)))&#xA;   (t (user-error &quot;Not in visual or normal state&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-01-31T10:50:02.073" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19979" PostTypeId="2" ParentId="19967" CreationDate="2016-01-31T15:04:19.483" Score="16" Body="&lt;p&gt;Use &lt;code&gt;org-sort&lt;/code&gt; to sort by todo state, or any thing else.  By default it's bound to &lt;code&gt;C-c ^&lt;/code&gt;;  it will ask you what you want to sort by.  Choose &lt;code&gt;O&lt;/code&gt; to sort by todo state, reversed (&lt;code&gt;o&lt;/code&gt; will put &lt;code&gt;TODO&lt;/code&gt; at the top).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-01-31T15:04:19.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19980" PostTypeId="2" ParentId="19936" CreationDate="2016-01-31T15:25:25.227" Score="5" Body="&lt;p&gt;It is explained &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/4850&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, and there is an &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/pull/4877&quot; rel=&quot;noreferrer&quot;&gt;ongoing PR&lt;/a&gt; to add it to the documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mkdir ~/spacemacs&#xA;git clone git@github.com:syl20bnr/spacemacs.git ~/spacemacs/.emacs.d&#xA;HOME=~/spacemacs emacs```&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6662" LastActivityDate="2016-01-31T15:25:25.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19982" PostTypeId="1" AcceptedAnswerId="19985" CreationDate="2016-01-31T16:20:27.353" Score="1" ViewCount="9282" Body="&lt;p&gt;My &lt;code&gt;.emacs&lt;/code&gt; file contains the following code to make &lt;code&gt;hunspell&lt;/code&gt; work, however I get the following error message when starting &lt;code&gt;flyspell-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Starting new Ispell process hunspell with deutsch-hunspell dictionary...&#xA;Error enabling Flyspell mode:&#xA;(ispell-phaf: No matching entry for deutsch-hunspell.&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea of how to fix this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'ispell-local-dictionary-alist '(&quot;deutsch-hunspell&quot;&#xA;                                              &quot;[[:alpha:]]&quot;&#xA;                                              &quot;[^[:alpha:]]&quot;&#xA;                                              &quot;[']&quot;&#xA;                                              t&#xA;                                              (&quot;-d&quot; &quot;de_DE&quot;); Dictionary file name&#xA;                                              nil&#xA;                                              iso-8859-1))&#xA;&#xA;(add-to-list 'ispell-local-dictionary-alist '(&quot;english-hunspell&quot;&#xA;                                              &quot;[[:alpha:]]&quot;&#xA;                                              &quot;[^[:alpha:]]&quot;&#xA;                                              &quot;[']&quot;&#xA;                                              t&#xA;                                              (&quot;-d&quot; &quot;en_US&quot;)&#xA;                                              nil&#xA;                                              iso-8859-1))&#xA;&#xA;(setq ispell-program-name &quot;hunspell&quot;          ; Use hunspell to correct mistakes&#xA;      ispell-dictionary   &quot;deutsch-hunspell&quot;) ; Default dictionary to use&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;hunspell -D&lt;/code&gt; gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; hunspell -D&#xA;SEARCH PATH:&#xA;.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/dw/.openoffice.org/3/user/wordbook:.openoffice.org2/user/wordbook:.openoffice.org2.0/user/wordbook:Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo&#xA;AVAILABLE DICTIONARIES (path is not mandatory for -d option):&#xA;/usr/share/hunspell/de_DE&#xA;/usr/share/hunspell/de_LU&#xA;/usr/share/hunspell/de_BE&#xA;/usr/share/hunspell/en_US&#xA;/usr/share/myspell/dicts/hyph_lt_LT&#xA;Can't open affix or dictionary files for dictionary named &quot;en_AU&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am working on an ubuntu 15.10 box with emacs 24.5.1 &lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-02-09T11:08:41.407" LastActivityDate="2017-08-06T16:00:35.287" Title="Hunspell error in emacs" Tags="|flyspell|spell-checking|hunspell|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19983" PostTypeId="1" CreationDate="2016-01-31T20:09:20.320" Score="5" ViewCount="829" Body="&lt;p&gt;I work on both work and personal projects on my machine, and for my work projects, I prefer to use my work email, and vice versa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In shell, I use &lt;a href=&quot;http://direnv.net/&quot; rel=&quot;noreferrer&quot;&gt;direnv&lt;/a&gt; to set &lt;code&gt;GIT_COMMITTER_EMAIL&lt;/code&gt; and &lt;code&gt;GIT_AUTHOR_EMAIL&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I achieve something like this in magit?&lt;/p&gt;&#xA;" OwnerUserId="9424" LastActivityDate="2019-11-05T14:18:38.410" Title="Set author per repository" Tags="|magit|git|project|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19984" PostTypeId="2" ParentId="19983" CreationDate="2016-01-31T20:37:34.483" Score="7" Body="&lt;p&gt;One way to do this is to set the author configuration in &lt;code&gt;.git/config&lt;/code&gt; in each repository, in the same format as in &lt;code&gt;~/.gitconfig&lt;/code&gt;, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[user]&#xA;    name = My Name&#xA;    email = me@example.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastActivityDate="2016-01-31T20:37:34.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19985" PostTypeId="2" ParentId="19982" CreationDate="2016-01-31T22:01:03.527" Score="2" Body="&lt;p&gt;Insert below code into ~/.emacs or ~/.emacs.d/init,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ispell-program-name &quot;hunspell&quot;)&#xA;(setq ispell-local-dictionary &quot;de_DE&quot;)&#xA;(setq ispell-local-dictionary-alist&#xA;      '((&quot;de_DE&quot; &quot;[[:alpha:]]&quot; &quot;[^[:alpha:]]&quot; &quot;[']&quot; nil nil nil utf-8)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;AFTER above setup, you need turn on flyspell-mode by &lt;code&gt;(flyspell-mode 1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please make sure your dictionary is loaded properly. This is hunspell setup instead of Emacs setup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;s&gt;At Linux, you don't need extra setup (if your dictionaries are installed in a standard location).&lt;/s&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At other operating systems, here is the easiest way to hint hunspell where to search the dictionary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You only need setup environment variable DICPATH by &lt;code&gt;export DICPATH=/usr/share/hunspell/de_DE&lt;/code&gt; in Bash (At windows, you can setup environment variable through &quot;Control Panel&quot;). Both de_DE.dic and de_DE.aff should exist in that directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you just change your locale to de_DE&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="6599" LastEditDate="2017-08-06T16:00:35.287" LastActivityDate="2017-08-06T16:00:35.287" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="19986" PostTypeId="1" CreationDate="2016-02-01T03:02:03.220" Score="7" ViewCount="583" Body="&lt;p&gt;Eg. when you're running nice things like Perl or Ruby REPLs, you have code/command completion exposed via GNU Readline. What I want to do is set some elisp/env variable when entering/exiting such a program to indicate that I want &lt;code&gt;shell-mode&lt;/code&gt; to pass the TAB key onto those programs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;C-q TAB&lt;/code&gt; also does not work, so I think that Readline is also ignoring it because &lt;code&gt;TERM=dumb&lt;/code&gt;, but setting it to eg. vt100 also doesn't do the trick, so it might even be looking at &lt;code&gt;EMACS=t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="215" LastEditorUserId="1979" LastEditDate="2018-09-26T15:10:43.617" LastActivityDate="2018-09-26T15:10:43.617" Title="Any way to have emacs shell pass the TAB into a readline command running inside it?" Tags="|shell-mode|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="19988" PostTypeId="2" ParentId="19983" CreationDate="2016-02-01T03:50:33.913" Score="2" Body="&lt;p&gt;Same effective answer as @legoscia, but instead of modifying the file, I find that if you do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git config user.email me@example.com&#xA;git config user.name &quot;My Name&quot; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It sets the local config, i.e &lt;code&gt;.git/config&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add the flag &lt;code&gt;--global&lt;/code&gt; then it modifies your global config. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus you can have different name/email setup per repository, and can even check them by running &lt;code&gt;git config user.email&lt;/code&gt;. When called without any arguements, it works as a &lt;code&gt;GET&lt;/code&gt; command.&lt;/p&gt;&#xA;" OwnerUserId="5206" LastActivityDate="2016-02-01T03:50:33.913" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19989" PostTypeId="1" AcceptedAnswerId="19991" CreationDate="2016-02-01T05:05:46.847" Score="14" ViewCount="792" Body="&lt;p&gt;When I copy some selected text (&lt;code&gt;kill-ring-save&lt;/code&gt; with &lt;code&gt;M-w&lt;/code&gt;), I automatically lose my selection. I have tried with Transient Mark Mode with no luck. (Note that I'm &lt;em&gt;not&lt;/em&gt; using CUA Mode.)&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2016-02-01T05:16:16.817" LastActivityDate="2016-02-01T09:50:03.947" Title="How to copy text without losing selection?" Tags="|region|kill-ring|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19990" PostTypeId="1" AcceptedAnswerId="19999" CreationDate="2016-02-01T08:56:32.473" Score="0" ViewCount="389" Body="&lt;p&gt;I have 2 university server I can connect to and I set up the config files in the ~/.ssh directory to connect to them just by using an alias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until 1 or 2 days ago both of them were working fine but now I cannot connect to one of them through TRAMP (I still can connect fine using the terminal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is the tramp log, it seems the initial connection get established but then something happen that doesn't allow it to go further.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Linux access.chaos-cluster.uni.lux 3.2.0-4-amd64 unknown&#xA;18:05:38 up 199 days, 23:06,  3 users,  load average: 0.06, 0.05, 0.05&#xA;[01;32m0 [36;1m18:05:38[0m [0;37username[0m@[4;36maccess[0m([1mchaos-cluster[0m)[0;31m[0m[0;32m (master #)[0m [34;1m~[0m $ &#xA;18:06:37.592257 tramp-process-sentinel (5) # Sentinel called: `#&amp;lt;process *tramp/ssh chaos-cluster*&amp;gt;' `killed&#xA;'&#xA;18:06:37.607714 tramp-process-actions (1) # File error: Timeout reached, see buffer `*tramp/ssh chaos-cluster*' for details&#xA;18:07:07.641803 tramp-maybe-open-connection (3) # Opening connection for chaos-cluster using ssh...failed&#xA;18:07:07.642873 tramp-get-remote-stat (5) # Finding a suitable `stat' command&#xA;18:07:07.643063 tramp-file-name-handler (1) # Suppress received in operation (file-attributes /ssh:chaos-cluster:/userpath)&#xA;18:07:07.643464 tramp-get-test-command (5) # Finding a suitable `test' command&#xA;18:07:07.643625 tramp-file-name-handler (1) # Suppress received in operation (file-readable-p /ssh:chaos-cluster:/userpath)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have searched for solution on internet but I didn't find solutions for similar situations.&#xA;Does anybody knows what it could be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I am using spacemacs on emacs 24.5.1 and debian testing.&lt;/p&gt;&#xA;" OwnerUserId="10962" LastActivityDate="2016-02-01T16:52:30.213" Title="cannot connect through TRAMP to university server" Tags="|tramp|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19991" PostTypeId="2" ParentId="19989" CreationDate="2016-02-01T09:50:03.947" Score="11" Body="&lt;p&gt;The best solution is using &lt;code&gt;C-x C-x&lt;/code&gt; to reactivate the mark.&#xA;But if you want to really keep the selection you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun copy-keep-highlight (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (prog1 (kill-ring-save beg end)&#xA;    (setq deactivate-mark nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-02-01T09:50:03.947" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19992" PostTypeId="1" AcceptedAnswerId="20014" CreationDate="2016-02-01T13:46:56.353" Score="4" ViewCount="1034" Body="&lt;p&gt;I have a freshly installed spacemacs installation and I want to make it so that I &lt;code&gt;ansi-term&lt;/code&gt; is in emacs mode. However, I try to add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'evil-emacs-state-modes 'term-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;.spacemacs&lt;/code&gt; in the &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; and/or &lt;code&gt;dotspacemacs/user-init&lt;/code&gt; function and it has no effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a canonical way to do this in spacemacs?&lt;/p&gt;&#xA;" OwnerUserId="2428" LastEditorUserId="10" LastEditDate="2016-02-01T23:21:00.653" LastActivityDate="2016-02-03T09:07:50.580" Title="Always enter emacs mode with ansi-term" Tags="|evil|spacemacs|ansi-term|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19993" PostTypeId="2" ParentId="19152" CreationDate="2016-02-01T13:47:33.887" Score="1" Body="&lt;p&gt;Same issue. If you uninstall the elpa org (8.3.3), emacs will use the built in org (8.2.10). This solves the issue for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I'd like to comment on BejaminSchiel's instead of posting an answer but I don't have enough reputation for that.&lt;/p&gt;&#xA;" OwnerUserId="10595" LastActivityDate="2016-02-01T13:47:33.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19994" PostTypeId="2" ParentId="4280" CreationDate="2016-02-01T15:22:49.387" Score="-1" Body="&lt;p&gt;I had a similar problem, and here's how I fixed it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I opened my init.el file and commented the last line of code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'(default ((((class color) (min-colors 4096)) (:foreground &quot;#5f5f5f&quot; :background &quot;#fdfde7&quot;)) (((class color) (min-colors 256)) (:foreground &quot;#5f5f5f&quot; :background &quot;#fdfde7&quot;)) (((class color) (min-colors 89)) (:foreground &quot;#5f5f5f&quot; :background &quot;#fdfde7&quot;)))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and add the following code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry &quot;apple&quot; :family &quot;Menlo&quot;)))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Restart Emacs, and you should be able to change theme.&lt;/p&gt;&#xA;" OwnerUserId="10969" LastEditorUserId="10969" LastEditDate="2016-02-01T15:37:27.037" LastActivityDate="2016-02-01T15:37:27.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19995" PostTypeId="1" AcceptedAnswerId="20000" CreationDate="2016-02-01T15:42:29.140" Score="4" ViewCount="1122" Body="&lt;p&gt;I want to archive an entry automatically when its &lt;code&gt;todo&lt;/code&gt; state gets marked as &lt;code&gt;done&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that you can set up lots of different states that mean &lt;code&gt;done&lt;/code&gt;.  So a function like this will only work if the done state is literally called &lt;code&gt;DONE&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun channing/archive-when-done ()&#xA;    (when (equal (org-get-todo-state) &quot;DONE&quot;) (org-archive-subtree-default)))&#xA;(add-hook 'org-after-todo-state-change-hook&#xA;    'channing/archive-when-done)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I detect if an entry is in the &lt;code&gt;done&lt;/code&gt; state, regardless of the particular keyword?&lt;/p&gt;&#xA;" OwnerUserId="5463" LastEditorUserId="253" LastEditDate="2016-02-01T16:54:25.653" LastActivityDate="2016-02-01T16:54:25.653" Title="Automatically archive &quot;DONE&quot; entries regardless of keyword?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19996" PostTypeId="1" CreationDate="2016-02-01T15:57:15.343" Score="1" ViewCount="20" Body="&lt;p&gt;&lt;br&gt;&#xA;Is there a way to customize vc-next-action &lt;code&gt;C-x v v&lt;/code&gt; so that it opens a URL on success?&#xA;&lt;br&gt;&#xA;I am using SVN and after each commit, I have to open manually a trac URL with the rev number. &lt;br&gt;For example: &lt;a href=&quot;http://server/trac/changeset/138258/project&quot; rel=&quot;nofollow&quot;&gt;http://server/trac/changeset/138258/project&lt;/a&gt;&#xA;&lt;br&gt;&#xA;I tried &lt;code&gt;C-u C-x v v&lt;/code&gt; but without success.&#xA;&lt;br&gt;&#xA;Or is there an even better way to deal with SVN from Emacs?&#xA;&lt;br&gt;&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="10970" LastEditorUserId="8842" LastEditDate="2016-02-01T18:11:08.597" LastActivityDate="2016-02-01T18:11:08.597" Title="Customize vc-next-action to open a URL" Tags="|version-control|svn|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19997" PostTypeId="2" ParentId="319" CreationDate="2016-02-01T16:45:31.097" Score="0" Body="&lt;p&gt;I recently came across &lt;a href=&quot;https://github.com/purcell/whitespace-cleanup-mode&quot; rel=&quot;nofollow&quot;&gt;`whitespace-cleanup-mode&lt;/a&gt;, which, according to its Github page is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a minor mode which calls &lt;code&gt;whitespace-cleanup&lt;/code&gt; before saving the&#xA;  current buffer, but only if the whitespace in the buffer was initially&#xA;  clean.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It may not do exactly what you want, but it may help others with a similar problem. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2016-02-01T16:45:31.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19998" PostTypeId="1" CreationDate="2016-02-01T16:50:21.350" Score="6" ViewCount="114" Body="&lt;p&gt;I'm developing a major mode for a language that has doc comments. They look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(** Foos three bars.&#xA;    Better call this as [foo 1 b c].&#xA;    Though of course [foo a b 1] works as well. **)&#xA;Definition foo a b c := a + b - c.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In that context &lt;code&gt;[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt; work as sorts of unescapes: anything between them is really code, not comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a generic approach this? IOW, &lt;strong&gt;is there a way to tell font-lock: in comments, treat anything between &lt;code&gt;[]&lt;/code&gt; as code?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can see a bunch of cool applications for this beyond my major mode: for example doctests in python (where &lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; should introduce code), or javadoc, or doxygen, etc.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;Foos the bars&#xA;&amp;gt;&amp;gt;&amp;gt; foo 1 2 3 # should be highlighted as code&#xA;0&#xA;&amp;gt;&amp;gt;&amp;gt; foo 4 5 6 # should be highlighted as code&#xA;3&quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I considered making &lt;code&gt;[&lt;/code&gt; a comment closer, and &lt;code&gt;]&lt;/code&gt; a comment opener, but it looks very brittle: it will confuse navigation commands, and nested comments, and will require a strange comment setup to allow multiple closers per opener; and it won't work outside of comments, either.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2016-02-01T17:18:20.717" LastActivityDate="2016-02-01T17:18:20.717" Title="Code blocks in font-lock comments" Tags="|font-lock|comment|semantic-mode|" AnswerCount="0" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="19999" PostTypeId="2" ParentId="19990" CreationDate="2016-02-01T16:52:30.213" Score="0" Body="&lt;p&gt;As suggested in the answer from Michael Albinus, the problem was in tramp not recognizing my prompt string.&#xA;In particular it was due to the presence of a git status in my prompt that was something like &quot;(master #)&quot;, with the # causing tramp not to recognize the prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I changed my .bashrc file to avoid fancy prompts when connecting through TRAMP and the issue is now solved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10962" LastActivityDate="2016-02-01T16:52:30.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20000" PostTypeId="2" ParentId="19995" CreationDate="2016-02-01T16:52:34.913" Score="4" Body="&lt;p&gt;You can detect if an &lt;code&gt;org&lt;/code&gt; entry is done with the (undocumented) predicate function &lt;strong&gt;&lt;code&gt;org-entry-is-done-p&lt;/code&gt;&lt;/strong&gt;.  It tests the current entry's &lt;code&gt;todo&lt;/code&gt; keyword against &lt;code&gt;org-done-keywords&lt;/code&gt;, which is also undocumented.  (I discovered these gems after reinventing this particular wheel symbol-for-symbol.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your purposes, you could rewrite your function as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun channing/archive-when-done ()&#xA;  &quot;Archive current entry if it is marked as DONE (see `org-done-keywords').&quot;&#xA;  (when (org-entry-is-done-p)&#xA;    (org-archive-subtree-default)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-01T16:52:34.913" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20001" PostTypeId="1" AcceptedAnswerId="20051" CreationDate="2016-02-01T18:07:48.340" Score="11" ViewCount="2195" Body="&lt;p&gt;Is it possible to read user input from STDIN while tangling a source block with &lt;code&gt;org-babel-tangle&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of this: &lt;a href=&quot;https://emacs.stackexchange.com/questions/15065/org-mode-babel-interactive-code-block-evaluation&quot;&gt;Org Mode Babel - Interactive code block evaluation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That doesn't help solve this particular use-case, as it still doesn't allow proper STDIN input from shell, but only simulates a limited input &lt;em&gt;internally&lt;/em&gt; to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Background&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I would like to use Org's Babel to learn new programming languages (Perl and Bash) by executing some tutorials from one org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that many tutorials rely on STDIN. For example, if one runs the following perl tidbit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC perl :tangle hello-name.pl  :results output :export code&#xA;use 5.010;&#xA;use strict;&#xA;use warnings;&#xA;&#xA;say &quot;What is your name?&quot;;&#xA;my $name=&amp;lt;STDIN&amp;gt;;&#xA;say &quot;Hello $name, how are you?&quot;;&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Emacs will not wait for the user's interaction&lt;/em&gt; to properly type a name on STDIN, and it will immediately output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: What is your name?&#xA;: Hello , how are you?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Same thing using a bash example. This:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh  :results output :export code :tangle dir-input.sh&#xA;#!/bin/bash&#xA;&#xA;if [ -z &quot;$TEST_DIR&quot; ]&#xA;then&#xA;    echo &quot;TEST_DIR was not set, please enter the path: &quot;&#xA;    read input_variable&#xA;    export TEST_DIR=$input_variable&#xA;fi&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will not wait for user input, and Emacs will immediately return this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: TEST_DIR was not set, please enter the path: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a native way for Emacs to wait for input on an executing tangled block?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, would you please give some pointers on how to write something like a &lt;code&gt;tangle-and-run-via-shell-buffer&lt;/code&gt; function that would:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Tangle the code block at point, saving with given filename,&lt;/li&gt;&#xA;&lt;li&gt;execute the corresponding file in a visible &lt;code&gt;shell&lt;/code&gt; buffer,&lt;/li&gt;&#xA;&lt;li&gt;possibly accepting input from the user,&lt;/li&gt;&#xA;&lt;li&gt;and finally reporting &lt;code&gt;STDOUT&lt;/code&gt;, if any, to &lt;code&gt;#+RESULTS:&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If such feature is not implemented (yet) in Org, how could one implement it with elisp?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update: After searching and studying more the Emacs and elisp manuals, it seems the way to do it would be leveraging &lt;a href=&quot;https://stackoverflow.com/a/13674570/2048692&quot;&gt;Comint&lt;/a&gt;, like perhaps &lt;code&gt;make-comint-in-buffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-comint-in-buffer &quot;*cmd-buffer*&quot; nil &quot;perl&quot; nil &quot;hello-name.pl&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, that is over my head right now &lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-02-04T07:42:34.277" Title="Is it possible to read user input from STDIN while tangling a source block?" Tags="|org-mode|org-babel|shell|interactive|comint|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20003" PostTypeId="1" CreationDate="2016-02-01T19:33:20.393" Score="2" ViewCount="360" Body="&lt;p&gt;I want a black background in my multi-term buffer and therefore, I call :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;'(term-default-bg-color &quot;#000000&quot;)&#xA;'(term-default-fg-color &quot;#dddd00&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my emacs initialization file. But, it does not color the entire background. See the attached image. I want the entire background color as black.&lt;a href=&quot;https://i.stack.imgur.com/WtuB0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WtuB0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10971" LastActivityDate="2016-02-02T20:57:22.500" Title="Multi-Term does not color the whole background" Tags="|colors|multi-term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20004" PostTypeId="2" ParentId="18433" CreationDate="2016-02-01T19:38:47.333" Score="0" Body="&lt;p&gt;my soluton for history purpose. Patch for original code not needed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (defun bss/my-org-return ()&#xA;     &quot;Insert newline if we at beginng or end of line&quot;&#xA;     (interactive)&#xA;     (if (or (eolp) (bolp))&#xA;      (newline-and-indent)&#xA;    (org-return)))&#xA;   (define-key org-mode-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) 'bss/my-org-return)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10972" LastActivityDate="2016-02-01T19:38:47.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20005" PostTypeId="2" ParentId="19992" CreationDate="2016-02-01T23:28:55.007" Score="2" Body="&lt;p&gt;Disclaimer: I assume this is in no way related to Spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;evil-emacs-state-modes&lt;/code&gt; variable is initialized with a list of modes to start in Emacs state.  This is a mishap as it makes it harder to customize it properly, any successful change to the variable will not take this value into account and Evil's code will not change it either because the variable is defined and initialized by then.  In your example, nothing happens as &lt;code&gt;add-to-list&lt;/code&gt; does only do something if the variable has already been defined.  You can circumvent this by using a hook run after the package has been loaded up or with &lt;code&gt;eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-vars '(add-to-list 'evil-emacs-state-modes 'term-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The official way of changing that list though is via &lt;code&gt;evil-set-initial-state&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-vars '(evil-set-initial-state 'term-mode 'emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-02-02T09:10:41.820" LastActivityDate="2016-02-02T09:10:41.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20006" PostTypeId="1" CreationDate="2016-02-02T02:36:59.373" Score="2" ViewCount="701" Body="&lt;p&gt;I'm a new user to Emacs and I'm using ORG mode to start with.&lt;br&gt;&#xA;When I create a list of items, sometimes I copy and paste data from other locations - forming a list of unstructured items.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How to make them with the same indent?   &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How to make them check list items by selecting them all in one go?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I tried all that is available &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Multi_002dline-Indent.html#Multi_002dline-Indent&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for indentation in vain. Where should I be looking for this information?&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-02-02T02:36:59.373" Title="Indent several lines in org mode" Tags="|org-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20007" PostTypeId="1" AcceptedAnswerId="20018" CreationDate="2016-02-02T03:27:35.437" Score="2" ViewCount="409" Body="&lt;p&gt;I'm using Emacs 24.5 with AUCTeX and RefTex to edit a multi-file project. It consists of one main file with &lt;code&gt;%%% TeX-master: t&lt;/code&gt; to mark as master. The 'slave' files all have &lt;code&gt;%%% TeX-master: main&lt;/code&gt; to link them to the master file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;RefTex can correctly find the bibliography defined on the master file. However &lt;code&gt;reftex-toc&lt;/code&gt; only works for the master file. On any slave file it shows only entries for that single file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make &lt;code&gt;reftex-toc&lt;/code&gt; aware of multiple files so I can quickly jump into other sections of the document defined in other slave files?&lt;/p&gt;&#xA;" OwnerUserId="10832" LastActivityDate="2023-02-18T21:12:57.680" Title="Make reftex-toc work with multiple files" Tags="|latex|auctex|reftex-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20008" PostTypeId="1" AcceptedAnswerId="20010" CreationDate="2016-02-02T04:13:14.420" Score="5" ViewCount="482" Body="&lt;p&gt;I'm working with a file which is zero-indexed. Using &lt;code&gt;M-x linum-mode&lt;/code&gt;, I can get emacs to display line numbers. How can I get emacs to start counting from 0 instead of 1?&lt;/p&gt;&#xA;" OwnerUserId="10983" LastActivityDate="2016-02-02T06:21:11.857" Title="Zero-indexed line numbering" Tags="|line-numbers|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20009" PostTypeId="2" ParentId="20008" CreationDate="2016-02-02T04:32:28.343" Score="2" Body="&lt;p&gt;Add a &lt;code&gt;1-&lt;/code&gt; to &lt;code&gt;line-number-at-pos&lt;/code&gt; and &lt;code&gt;count-lines&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'linum)&#xA;&#xA;(defun linum-update-window (win)&#xA;  &quot;Update line numbers for the portion visible in window WIN.&quot;&#xA;  (goto-char (window-start win))&#xA;  (let ((line (1- (line-number-at-pos)))&#xA;        (limit (window-end win t))&#xA;        (fmt (cond ((stringp linum-format) linum-format)&#xA;                   ((eq linum-format 'dynamic)&#xA;                    (let ((w (length (number-to-string&#xA;                                      (1- (count-lines (point-min) (point-max)))))))&#xA;                      (concat &quot;%&quot; (number-to-string w) &quot;d&quot;)))))&#xA;        (width 0))&#xA;    (run-hooks 'linum-before-numbering-hook)&#xA;    ;; Create an overlay (or reuse an existing one) for each&#xA;    ;; line visible in this window, if necessary.&#xA;    (while (and (not (eobp)) (&amp;lt; (point) limit))&#xA;      (let* ((str (if fmt&#xA;                      (propertize (format fmt line) 'face 'linum)&#xA;                    (funcall linum-format line)))&#xA;             (visited (catch 'visited&#xA;                        (dolist (o (overlays-in (point) (point)))&#xA;                          (when (equal-including-properties&#xA;                                 (overlay-get o 'linum-str) str)&#xA;                            (unless (memq o linum-overlays)&#xA;                              (push o linum-overlays))&#xA;                            (setq linum-available (delq o linum-available))&#xA;                            (throw 'visited t))))))&#xA;        (setq width (max width (length str)))&#xA;        (unless visited&#xA;          (let ((ov (if (null linum-available)&#xA;                        (make-overlay (point) (point))&#xA;                      (move-overlay (pop linum-available) (point) (point)))))&#xA;            (push ov linum-overlays)&#xA;            (overlay-put ov 'before-string&#xA;                         (propertize &quot; &quot; 'display `((margin left-margin) ,str)))&#xA;            (overlay-put ov 'linum-str str))))&#xA;      ;; Text may contain those nasty intangible properties, but that&#xA;      ;; shouldn't prevent us from counting those lines.&#xA;      (let ((inhibit-point-motion-hooks t))&#xA;        (forward-line))&#xA;      (setq line (1+ line)))&#xA;    (when (display-graphic-p)&#xA;      (setq width (ceiling&#xA;                   (/ (* width 1.0 (linum--face-width 'linum))&#xA;                      (frame-char-width)))))&#xA;    ;; open up space in the left margin, if needed, and record that&#xA;    ;; fact as the window-parameter `linum--set-margins'&#xA;    (let ((existing-margins (window-margins win)))&#xA;      (when (&amp;gt; width (or (car existing-margins) 0))&#xA;        (set-window-margins win width (cdr existing-margins))&#xA;        (set-window-parameter win 'linum--set-margins (window-margins win))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-02-02T04:32:28.343" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20010" PostTypeId="2" ParentId="20008" CreationDate="2016-02-02T06:10:29.080" Score="7" Body="&lt;p&gt;This is a cleaner solution:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; paste this in your init file&#xA;(eval-when-compile (require 'cl-lib))&#xA;(defun nadvice/linum-update-window (old-fun &amp;amp;rest args)&#xA;  (cl-letf* ((old-count-lines (symbol-function #'count-lines))&#xA;             ((symbol-function #'count-lines)&#xA;              (lambda (&amp;amp;rest args) (1- (apply old-count-lines args)))))&#xA;    (apply old-fun args)))&#xA;&#xA;(defun linum-toggle-zero-indexing ()&#xA;  (interactive)&#xA;  (if (advice-member-p #'nadvice/linum-update-window 'linum-update-window)&#xA;      (advice-remove 'linum-update-window #'nadvice/linum-update-window)&#xA;    (advice-add 'linum-update-window :around #'nadvice/linum-update-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;linum-toggle-zero-indexing&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to toggle the zero-indexing.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-02-02T06:21:11.857" LastActivityDate="2016-02-02T06:21:11.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20011" PostTypeId="1" AcceptedAnswerId="20012" CreationDate="2016-02-02T09:34:12.373" Score="7" ViewCount="171" Body="&lt;p&gt;Say that I evaluate the following Python code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import inspect&#xA;import scipy.ndimage.filters&#xA;&#xA;list (inspect.getargspec (scipy.ndimage.filters.gaussian_filter1d))&#xA;# =&amp;gt; [['input', 'sigma', 'axis', 'order', 'output', 'mode', 'cval'],&#xA;#      None, None, (-1, 0, None, 'reflect', 0.0)]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to transform the output string, which is simply Python's&#xA;print output, to an Elisp data structure. So I need a function &lt;code&gt;foo&lt;/code&gt;&#xA;that does this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo &quot;[['input', 'sigma', 'axis', 'order', 'output', 'mode', 'cval'], None, None, (-1, 0, None, 'reflect', 0.0)]&quot;)&#xA;;; =&amp;gt;&#xA;;; ((&quot;input&quot;&#xA;;;   &quot;sigma&quot;&#xA;;;   &quot;axis&quot;&#xA;;;   &quot;order&quot;&#xA;;;   &quot;output&quot;&#xA;;;   &quot;mode&quot;&#xA;;;   &quot;cval&quot;)&#xA;;;  nil&#xA;;;  nil&#xA;;;  (-1 0 nil &quot;reflect&quot; 0.0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While it's not hard to write a version of &lt;code&gt;foo&lt;/code&gt; that works for this&#xA;specific instance, I wonder if there's a library that does this in a&#xA;generic way, i.e. it is able to handle any complex Python structure.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2016-03-13T22:08:44.557" LastActivityDate="2016-03-13T22:08:44.557" Title="Library that converts a Python output string to an Elisp data structure?" Tags="|python|formatting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20012" PostTypeId="2" ParentId="20011" CreationDate="2016-02-02T11:31:22.390" Score="8" Body="&lt;h1&gt;Use JSON, not Python syntax&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;What you are looking for is &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/json.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;json.el&lt;/code&gt;&lt;/a&gt; which is a part of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it will &lt;em&gt;not&lt;/em&gt; read Python format OOTB; there are &lt;em&gt;at least&lt;/em&gt; 3 problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;'foo'&lt;/code&gt; is not recognized as a string&lt;/li&gt;&#xA;&lt;li&gt;keywords &lt;code&gt;true&lt;/code&gt;/&lt;code&gt;false&lt;/code&gt;/&lt;code&gt;null&lt;/code&gt; are recognized instead of &lt;code&gt;True&lt;/code&gt;/&lt;code&gt;False&lt;/code&gt;/&lt;code&gt;None&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;tuples &lt;code&gt;(1,&quot;bar&quot;)&lt;/code&gt; are not recognized&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Full solution using json.dumps in Python&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Python can easily print its data structures as &lt;a href=&quot;https://docs.python.org/2/library/json.html&quot; rel=&quot;nofollow&quot;&gt;JSON&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(require 'json)&#xA;(require 'python)&#xA;(json-read-from-string&#xA; (substring&#xA;  (python-shell-send-string-no-output&#xA;   &quot;import inspect, json; json.dumps (inspect.getargspec (json.dumps))&quot;&#xA;   (run-python))&#xA;  1 -1))&#xA;==&amp;gt;&#xA;[[&quot;obj&quot; &quot;skipkeys&quot; &quot;ensure_ascii&quot; &quot;check_circular&quot; &quot;allow_nan&quot;&#xA;  &quot;cls&quot; &quot;indent&quot; &quot;separators&quot; &quot;encoding&quot; &quot;default&quot; &quot;sort_keys&quot;]&#xA; nil &quot;kw&quot; [:json-false t t t nil nil nil &quot;utf-8&quot; nil :json-false]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-02-05T04:35:57.743" LastActivityDate="2016-02-05T04:35:57.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20014" PostTypeId="2" ParentId="19992" CreationDate="2016-02-02T15:21:06.293" Score="6" Body="&lt;p&gt;You can use this snippet in your &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-set-initial-state 'term-mode 'emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6662" LastEditorUserId="6662" LastEditDate="2016-02-03T09:07:50.580" LastActivityDate="2016-02-03T09:07:50.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20015" PostTypeId="2" ParentId="7904" CreationDate="2016-02-02T15:54:17.570" Score="6" Body="&lt;p&gt;May well be due to you're using the wrong &lt;code&gt;emacsclient&lt;/code&gt;. I had the same  (i.e.,&lt;br&gt;&#xA;&lt;code&gt;can't find socket&lt;/code&gt; and/or &lt;code&gt;-error Unknown&amp;amp;_command:&amp;amp;_THEFILENAME&lt;/code&gt;&#xA;Turned out I used &lt;code&gt;/usr/bin/emacsclient&lt;/code&gt;, whereas my emacs is actually &lt;code&gt;~/Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs&lt;/code&gt; . Creating a symlink from &lt;code&gt;~/Applications/Emacs.app/Contents/MacOS/bin/emacsclient&lt;/code&gt; to a place on my &lt;code&gt;$PATH&lt;/code&gt; that precedes &lt;code&gt;/usr/bin&lt;/code&gt; solved it. See &lt;a href=&quot;http://www.citizen428.net/blog/2010/09/22/emacsclient-on-os-x/&quot;&gt;http://www.citizen428.net/blog/2010/09/22/emacsclient-on-os-x/&lt;/a&gt;&#xA;BTW this is &lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0, NS apple-appkit-1348.17)&lt;/code&gt;, &lt;code&gt;OSX Yosemite version 10.10.5&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10988" LastActivityDate="2016-02-02T15:54:17.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20016" PostTypeId="1" AcceptedAnswerId="20055" CreationDate="2016-02-02T16:13:01.277" Score="8" ViewCount="2739" Body="&lt;p&gt;For some reason the html/jsx in my react source files always wants to indent as follows, i.e. there is almost no indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;return (&#xA;  &amp;lt;DateRangePicker ranges={this.state.ranges} startDate={this.state.startDate} endDate={this.state.endDate}&#xA;  onApply={this.applyEvent}&amp;gt;&#xA;    &amp;lt;Button className=&quot;selected-date-range-btn&quot; style={{width : '250px'}}&amp;gt;&#xA;    &amp;lt;div className=&quot;pull-left&quot;&amp;gt;&#xA;    &amp;lt;Glyphicon glyph=&quot;calendar&quot;/&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;    &amp;lt;div className=&quot;pull-right&quot;&amp;gt;&amp;lt;span&amp;gt;{label}&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&#xA;    &amp;lt;/Button&amp;gt;&#xA;  &amp;lt;/DateRangePicker&amp;gt;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I'd really like is something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;DateRangePicker ranges={this.state.ranges} startDate={this.state.startDate} endDate={this.state.endDate}&#xA;             onApply={this.applyEvent}&amp;gt;&#xA;    &amp;lt;Button className=&quot;selected-date-range-btn&quot; style={{width : '250px'}}&amp;gt;&#xA;        &amp;lt;div className=&quot;pull-left&quot;&amp;gt;&#xA;            &amp;lt;Glyphicon glyph=&quot;calendar&quot;/&amp;gt;&#xA;        &amp;lt;/div&amp;gt;&#xA;        &amp;lt;div className=&quot;pull-right&quot;&amp;gt;&amp;lt;span&amp;gt;{label}&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&#xA;    &amp;lt;/Button&amp;gt;&#xA;&amp;lt;/DateRangePicker&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the indentation I get when I copy the html/jsx to the scratch buffer with html-mode or web-mode enabled. As you can see, the indentation is much more readable and it works like this whether I use html-mode or web-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make my react source files indent the html/jsx like this?&lt;/p&gt;&#xA;" OwnerUserId="8401" LastEditorUserId="8401" LastEditDate="2016-02-02T16:28:43.280" LastActivityDate="2016-07-29T17:14:22.820" Title="no html/jsx indentation in jsx-mode" Tags="|indentation|web-mode|html|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20017" PostTypeId="1" AcceptedAnswerId="20044" CreationDate="2016-02-02T16:50:04.743" Score="1" ViewCount="349" Body="&lt;p&gt;By default, &lt;code&gt;auto-fill&lt;/code&gt; will only break a line at a whitespace character. Usually this is what you want. However, I'm writing a major mode for editing data files (DNA sequences) that contain long lines of text with no spaces, and I want them to auto-fill at exactly 80 columns. How can I achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e., I want to use auto-fill (or similar) to fill this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ACCATCGAAACTTTGAACGCAAGTTGCGCCTCAAGCCATTAGGTTGAGGGCACGTTTGCTTGGGTGTCATTCGTTATGTC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to this (using 20-character lines instead of 80 for a shorter example):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ACCATCGAAACTTTGAACGC&#xA;AAGTTGCGCCTCAAGCCATT&#xA;AGGTTGAGGGCACGTTTGCT&#xA;TGGGTGTCATTCGTTATGTC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-02-04T18:16:05.297" Title="Allow auto-fill to break words" Tags="|auto-fill-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20018" PostTypeId="2" ParentId="20007" CreationDate="2016-02-02T17:46:15.780" Score="4" Body="&lt;p&gt;This feature should work out-of-the-box, provided that &lt;code&gt;TeX-master&lt;/code&gt; is correctly set.  The format of that variable is described at &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#Multifile&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(info &quot;(auctex)Multifile&quot;)&lt;/code&gt;&lt;/a&gt;.  In particular, in the secondary files &lt;code&gt;TeX-master&lt;/code&gt; should be a string with the relative path to the master file, without extension.  Thus, if your master file is called &lt;code&gt;main.tex&lt;/code&gt; and resides in the same directory as the secondary files you should have&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;%%% TeX-master: &quot;main&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with quotes around &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there is a handy function that can help you to insert the right value of &lt;code&gt;TeX-master&lt;/code&gt;: &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#index-TeX_002dmaster_002dfile_002dask&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;TeX-master-file-ask&lt;/code&gt;&lt;/a&gt;, bound to &lt;kbd&gt;C-c _&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that it's &lt;em&gt;strongly&lt;/em&gt; suggested to put the line&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq-default TeX-master nil) ; Query for master file.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your init file, so that you'll be always prompted for the master file (just press &lt;kbd&gt;RET&lt;/kbd&gt; to select the current file as master file) every time you create a new *TeX file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While we are at it, add to your init file also the lines&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-parse-self t) ; Enable parse on load.&#xA;(setq TeX-auto-save t) ; Enable parse on save.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to enable all the parsing infrastructure that makes AUCTeX great.  All these settings are suggested in the very first lines of the AUCTeX manual.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-02-02T17:46:15.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20020" PostTypeId="2" ParentId="20003" CreationDate="2016-02-02T20:57:22.500" Score="1" Body="&lt;p&gt;I don't know why the background is white where the text is.  &lt;code&gt;term-default-bg-color&lt;/code&gt; and &lt;code&gt;term-default-fg-color&lt;/code&gt; are obsolete, use the &lt;code&gt;term&lt;/code&gt; face instead.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure there's a way to make the background of the terminal anything other than &lt;code&gt;default&lt;/code&gt; face, so you'll want the &lt;code&gt;term&lt;/code&gt; face to inherit its background color from &lt;code&gt;default&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'term nil :background 'unspecified)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;code&gt;M-x customize-face RET term RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="651" LastActivityDate="2016-02-02T20:57:22.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20021" PostTypeId="1" AcceptedAnswerId="20029" CreationDate="2016-02-02T21:27:40.337" Score="5" ViewCount="293" Body="&lt;p&gt;In spacemacs, you can update all the installed package. However, is there a way to get a release notes for each package which have been updated ?&lt;/p&gt;&#xA;" OwnerUserId="10554" LastActivityDate="2016-02-03T11:20:55.167" Title="How to get release note of updated package in Spacemacs" Tags="|package|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20023" PostTypeId="1" CreationDate="2016-02-02T22:26:24.947" Score="6" ViewCount="170" Body="&lt;p&gt;I use &lt;code&gt;desktop-save-mode&lt;/code&gt; in order to restore buffers on startup.  However, the buffer which is visible immediately after startup is &lt;code&gt;*scratch*&lt;/code&gt;, &lt;code&gt;*Messages*&lt;/code&gt;, &lt;code&gt;.bbdb&lt;/code&gt;, etc.  I am not interested in those.  Is there a way to have Emacs after a restart in the same buffer state, including ordering, as when it was closed?&lt;/p&gt;&#xA;" OwnerUserId="8794" LastActivityDate="2016-08-09T15:45:18.140" Title="How can one restore buffers on startup in correct order?" Tags="|buffers|start-up|desktop|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20024" PostTypeId="2" ParentId="19961" CreationDate="2016-02-02T23:26:59.387" Score="4" Body="&lt;p&gt;FWIW, I cannot reproduce the condition as reported above.  It would be helpful if you could share a minimal configuration that can reproduce this error of yours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative way of solving this is writing a command bound to the initial key of the escape sequence that waits with a timeout for another event to occur.  If this event happens in a timely manner and matches the final key of the escape sequence, execute the command to exit insert state.  If the timeout is met, but the final key is wrong, insert the initial key and the different one.  If the timeout is missed, insert the first key.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-jk ()&#xA;  (interactive)&#xA;  (let* ((initial-key ?j)&#xA;         (final-key ?k)&#xA;         (timeout 0.5)&#xA;         (event (read-event nil nil timeout)))&#xA;    (if event&#xA;        ;; timeout met&#xA;        (if (and (characterp event) (= event final-key))&#xA;            (evil-normal-state)&#xA;          (insert initial-key)&#xA;          (push event unread-command-events))&#xA;      ;; timeout exceeded&#xA;      (insert initial-key))))&#xA;&#xA;(define-key evil-insert-state-map (kbd &quot;j&quot;) 'my-jk)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another implementation of the above with slightly different semantics can be found in &lt;a href=&quot;https://github.com/cofi/dotfiles/blob/a000343ad9268786d459c776fbcf267036999422/emacs.d/config/cofi-evil.el#L81-L95&quot; rel=&quot;nofollow&quot;&gt;cofi's config&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-02-03T11:15:46.050" LastActivityDate="2016-02-03T11:15:46.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20025" PostTypeId="1" AcceptedAnswerId="20035" CreationDate="2016-02-02T23:33:20.793" Score="10" ViewCount="3682" Body="&lt;p&gt;I recently started using Helm with the configuration below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm-config)&#xA;(helm-mode 1)&#xA;(define-key global-map [remap occur] 'helm-occur)&#xA;(define-key global-map [remap list-buffers] 'helm-buffers-list)&#xA;(define-key global-map [remap dabbrev-expand] 'helm-dabbrev)&#xA;(global-set-key (kbd &quot;M-x&quot;) 'helm-M-x)&#xA;(setq helm-M-x-fuzzy-match t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Today I figured out that Tramp mode doesn't work anymore. When I try to open a file with &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-f&lt;/kbd&gt; and enter &lt;code&gt;/sudo:root@&lt;/code&gt;&lt;kbd&gt;TAB&lt;/kbd&gt; nothing happens. Usually I'd expect that &lt;code&gt;localhost&lt;/code&gt; is substituted and tramp asks for a password.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I have a still functional tramp mode plus a working Helm?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="105" LastEditDate="2016-02-03T02:23:00.843" LastActivityDate="2020-04-04T12:34:48.930" Title="How to open a file with tramp mode when Helm is active?" Tags="|helm|tramp|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20027" PostTypeId="1" AcceptedAnswerId="20032" CreationDate="2016-02-03T04:53:44.027" Score="3" ViewCount="57" Body="&lt;p&gt;How to walk through code blocks under a narrowed subtree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which function(s) should I use to achieve that?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="105" LastEditDate="2016-03-13T22:08:19.163" LastActivityDate="2016-03-13T22:08:19.163" Title="How to walk through code blocks under a narrowed subtree?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20028" PostTypeId="2" ParentId="19961" CreationDate="2016-02-03T09:38:47.843" Score="0" Body="&lt;p&gt;&lt;code&gt;(key-chord-define evil-insert-state-map &quot;jk&quot; 'evil-normal-state)&lt;/code&gt; let's you escape from insert mode.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-02-03T09:38:47.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20029" PostTypeId="2" ParentId="20021" CreationDate="2016-02-03T11:20:55.167" Score="4" Body="&lt;p&gt;Unfortunately, there's no way to do that.  There is simply no standard way to package release notes for Emacs to consume; hence there's no standard way to view release notes either.  Besides, many packages—particularly smaller ones—don't even provide release notes.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The closest you can get is the commit list that Spacemacs' package menu offers: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open the package menu with &lt;code&gt;SPC a k&lt;/code&gt;, &lt;/li&gt;&#xA;&lt;li&gt;type &lt;code&gt;F i&lt;/code&gt; to narrow the list down to installed packages,&lt;/li&gt;&#xA;&lt;li&gt;navigate to the package whose changelog you'd like to see, &lt;/li&gt;&#xA;&lt;li&gt;and then type &lt;code&gt;L&lt;/code&gt;.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A new buffer with the commit log will pop up, where &quot;new&quot; commits since the last update are in bold face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this feature has limitations: It is only available for MELPA, and only for packages hosted on Github.  &quot;New&quot; is also not very exact, as it's based on the timestamp of the release which is naturally inaccurate, the more, since Git's timestamps do not actually reflect the actual order of commits.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-02-03T11:20:55.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20030" PostTypeId="1" AcceptedAnswerId="38131" CreationDate="2016-02-03T11:51:25.397" Score="18" ViewCount="9990" Body="&lt;p&gt;Is there any keybinding or function to move an open buffer to a different window or a different frame in spacemacs?&lt;/p&gt;&#xA;" OwnerUserId="10537" LastActivityDate="2019-05-07T13:26:07.140" Title="How do I move a buffer in spacemacs to a different window / frame" Tags="|spacemacs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20031" PostTypeId="2" ParentId="20030" CreationDate="2016-02-03T11:53:30.850" Score="4" Body="&lt;p&gt;In spacemacs (vim mode) you can press &lt;code&gt;SPC b m &amp;lt;your-direction&amp;gt;&lt;/code&gt; to move a buffer. &lt;code&gt;&amp;lt;your-direction&amp;gt;&lt;/code&gt; can be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;h&lt;/code&gt; left&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;j&lt;/code&gt; down&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;k&lt;/code&gt; up&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;l&lt;/code&gt; right&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In emacs mode, it should be &lt;code&gt;M-m b m &amp;lt;your-direction&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to switch to the 'other' frame, you can use &lt;code&gt;SPC b M&lt;/code&gt; (or &lt;code&gt;M-m b M&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In general, Emacs places no restriction on the number of windows/frames a buffer is displayed in, so you can simply switch to the buffer in however many windows/frames you want.)&lt;/p&gt;&#xA;" OwnerUserId="2428" LastEditorUserId="2428" LastEditDate="2016-02-03T13:37:37.020" LastActivityDate="2016-02-03T13:37:37.020" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20032" PostTypeId="2" ParentId="20027" CreationDate="2016-02-03T13:42:45.840" Score="4" Body="&lt;p&gt;see &lt;a href=&quot;http://orgmode.org/manual/Key-bindings-and-useful-functions.html#Key-bindings-and-useful-functions&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Key-bindings-and-useful-functions.html#Key-bindings-and-useful-functions&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-v p or C-c C-v C-p    org-babel-previous-src-block &#xA;C-c C-v n or C-c C-v C-n    org-babel-next-src-block &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-02-03T13:42:45.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20033" PostTypeId="1" CreationDate="2016-02-03T14:02:56.250" Score="1" ViewCount="48" Body="&lt;p&gt;I have the following as a member of &lt;code&gt;auto-insert-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;/home/robin/.local/bin/.*[^/]\\'&quot; . &quot;Shell-Script mode magic number&quot;)&#xA;  lambda nil&#xA;  (if&#xA;      (eq major-mode&#xA;          (default-value 'major-mode))&#xA;      (progn &#xA;        (sh-mode)&#xA;        (insert &quot;#! /bin/bash -peux&#xA;# &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The mode is set correctly, but the text is not inserted. And it doesn't seem to have been inserted into the wrong buffer, either, because &lt;code&gt;C-x s&lt;/code&gt; says &quot;(No files need saving)&quot;.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-02-03T14:02:56.250" Title="Both set mode and insert in auto-insert-alist lambda" Tags="|auto-insert|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20034" PostTypeId="1" AcceptedAnswerId="20070" CreationDate="2016-02-03T14:49:36.990" Score="4" ViewCount="738" Body="&lt;p&gt;How can I merge two branches with magit interactively line by line. Important there is no conflict (well ONLY for git it isn't) but I still want to do this.&lt;/p&gt;&#xA;" OwnerUserId="10978" LastEditorUserId="105" LastEditDate="2016-02-03T15:07:33.960" LastActivityDate="2016-08-31T10:56:03.763" Title="Is there a way to merge two branches interactively line by line in magit" Tags="|magit|git|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20035" PostTypeId="2" ParentId="20025" CreationDate="2016-02-03T14:51:25.420" Score="5" Body="&lt;p&gt;the way it works for me is the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;call helm-find-files (usually &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-f&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;li&gt;write &lt;code&gt;/scp:&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;if you have used tramp before you get a list with previous locations&#xA;which you can select with &lt;kbd&gt;C-j&lt;/kbd&gt; (or type a new remote by hand), pressing now &lt;kbd&gt;C-j&lt;/kbd&gt; a second  time or typing a &lt;kbd&gt;:&lt;/kbd&gt; will connect you to the remote server&lt;/li&gt;&#xA;&lt;li&gt;now helm completion on the remote starts, type &lt;kbd&gt;/&lt;/kbd&gt; if you want to be located in the root directory or &lt;kbd&gt;~&lt;/kbd&gt;, if you want to access your home directory&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11000" LastActivityDate="2016-02-03T14:51:25.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20036" PostTypeId="2" ParentId="20023" CreationDate="2016-02-03T15:53:15.767" Score="4" Body="&#xA;&#xA;&lt;p&gt;I have the following in my equivalent of a .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-bury-star-buffers ()&#xA;  &quot;Bury all star buffers.&quot;&#xA;  (interactive)&#xA;  (mapc (lambda (buf)&#xA;          (when (string-match-p &quot;\\`\\*.*\\*\\'&quot; (buffer-name buf))&#xA;            (bury-buffer buf)))&#xA;        (buffer-list)))&#xA;(add-hook 'desktop-after-read-hook #'my-bury-star-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't remember where I got it.  You'll need to extend the regex for any other files you want buried (like .bbdb).  The non-buried buffers seem to be in the right order.&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="115" LastEditDate="2016-08-09T15:45:18.140" LastActivityDate="2016-08-09T15:45:18.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20037" PostTypeId="1" AcceptedAnswerId="20040" CreationDate="2016-02-03T16:01:09.603" Score="1" ViewCount="742" Body="&lt;p&gt;When I was using Vim in the past, I was charmed of the &lt;code&gt;vim-bufferline&lt;/code&gt;. Only when there were not any message displayed or any command invoked, it showed the opened buffers in the minibuffer. It looked like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/W1oFC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/W1oFC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5 buffers opened, the file &lt;code&gt;command&lt;/code&gt; is being displayed. It also worked well with multiple buffers in multiple windows opened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default my minibuffer is empty, when there is no message. I would like to display the current buffers in that minibuffer. When googling around, I found no Emacs equivalence of this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-02-03T18:18:22.757" LastActivityDate="2016-02-08T22:33:07.973" Title="Is there an Emacs equivalent for vim-bufferline?" Tags="|buffers|minibuffer|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20038" PostTypeId="2" ParentId="8166" CreationDate="2016-02-03T16:48:41.237" Score="2" Body="&lt;p&gt;I just use an external utility (recode) for that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-html-entity-encode (b e)&#xA;  (interactive &quot;r&quot;)&#xA;  (call-process-region b e &quot;recode&quot; t t nil &quot;..HTML_4.0&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;E.g. select a region, then &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;my-html-entity-encode&lt;/code&gt; &lt;kbd&gt;Return&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9611" LastActivityDate="2016-02-03T16:48:41.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20039" PostTypeId="2" ParentId="10932" CreationDate="2016-02-03T19:28:04.647" Score="7" Body="&lt;p&gt;This is very similar to the question &lt;a href=&quot;https://emacs.stackexchange.com/q/19742/2355&quot;&gt;Is there a way to disable the “buffer is read-only” warning?&lt;/a&gt;, so a very similar answer seems appropriate.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;You can disable these messages by setting &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Processing-of-Errors.html#Processing-of-Errors&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;command-error-function&lt;/code&gt;&lt;/a&gt; to a function that ignores signals &lt;code&gt;buffer-read-only&lt;/code&gt;, &lt;code&gt;beginning-of-buffer&lt;/code&gt;, and &lt;code&gt;end-of-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-command-error-function (data context caller)&#xA;  &quot;Ignore the buffer-read-only, beginning-of-buffer,&#xA;end-of-buffer signals; pass the rest to the default handler.&quot;&#xA;  (when (not (memq (car data) '(buffer-read-only&#xA;                                beginning-of-buffer&#xA;                                end-of-buffer)))&#xA;    (command-error-default-function data context caller)))&#xA;&#xA;(setq command-error-function #'my-command-error-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Tested using GNU Emacs 24.5.1.)&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-03T19:28:04.647" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20040" PostTypeId="2" ParentId="20037" CreationDate="2016-02-03T20:15:22.627" Score="2" Body="&lt;p&gt;I had already some lines of code when KaushalModi mentioned &lt;code&gt;minibuffer-line&lt;/code&gt;. Maybe, you should use that mode. If you like you can steal some ideas from the following code to get the updates on buffer-changing operations.&#xA;It works. But, it is not very efficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an example you could use &lt;code&gt;buffer-list-update-hook&lt;/code&gt; instead of &lt;code&gt;post-command-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also plug &lt;code&gt;buffer-file-name&lt;/code&gt; into &lt;code&gt;minibuffer-buffer-list-filter&lt;/code&gt; instead of &lt;code&gt;identity&lt;/code&gt;. This way emacs only shows file buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;;; Show buffer list in minibuffer&#xA;&#xA;(defcustom minibuffer-buffer-list-filter 'identity&#xA;  &quot;Function for filtering the buffer names shown in the minibuffer window.&quot;&#xA;  :group 'notify&#xA;  :type 'sexp)&#xA;&#xA;(defun substring-no-properties-safe (str from &amp;amp;optional to)&#xA;  &quot;Like `substring-no-properties' but does not fail on args out of range.&quot;&#xA;  (let ((n (length str)))&#xA;    (substring-no-properties str (min from (max (1- n) 0)) (when to (min to n)))))&#xA;&#xA;(defun minibuffer-buffer-list ()&#xA;  &quot;Show buffer list in minibuffer window.&quot;&#xA;  (substring-no-properties-safe&#xA;    (mapconcat 'buffer-name&#xA;           (cl-delete-if-not minibuffer-buffer-list-filter&#xA;                 (cl-delete-if (lambda (buf) (eq (aref (buffer-name buf) 0) #x20))&#xA;                           (buffer-list)))&#xA;           &quot; | &quot;)&#xA;    0 (1- (window-width (minibuffer-window)))))&#xA;&#xA;(defcustom notify-function 'minibuffer-buffer-list&#xA;  &quot;The string returned by this function is displayed in minibuffer.&quot;&#xA;  :group 'notify&#xA;  :type 'sexp)&#xA;&#xA;(defcustom notify-idle-time 1&#xA;  &quot;Time in seconds until showing buffers in minibuffer.&quot;&#xA;  :group 'notify&#xA;  :type 'number)&#xA;&#xA;(defvar notify-idle-timer nil)&#xA;&#xA;(defun notify-text-p ()&#xA;  &quot;Check whether text in current buffer has the :notification text property.&quot;&#xA;  (get-text-property (point-min) :notification))&#xA;&#xA;(defmacro notify-with-minibuffer (&amp;amp;rest body)&#xA;  &quot;Run BODY in minibuffer when there is one.&quot;&#xA;  (declare '(debug &amp;amp;rest body) '(indent 1))&#xA;  `(let ((minibuffer (window-buffer (minibuffer-window))))&#xA;     (when minibuffer&#xA;       (with-current-buffer minibuffer&#xA;       ,@body))))&#xA;&#xA;(defun notify-clear ()&#xA;  &quot;Clear notification from active minibuffer.&quot;&#xA;  (notify-with-minibuffer&#xA;   (when (notify-text-p)&#xA;     (with-silent-modifications&#xA;       (erase-buffer)))))&#xA;&#xA;(defun notify-run (&amp;amp;optional frame)&#xA;  &quot;Run `notify-function' if minibuffer is empty and emacs is idle for `notify-idle-time' seconds.&quot;&#xA;  (notify-with-minibuffer&#xA;   (when (and (null (active-minibuffer-window))&#xA;          (or (eq (length (buffer-string)) 0)&#xA;          (notify-text-p)))&#xA;     (with-silent-modifications&#xA;       (erase-buffer)&#xA;       (insert (propertize&#xA;        (funcall notify-function)&#xA;        :notification t)))&#xA;     )))&#xA;&#xA;(define-minor-mode notify-mode&#xA;  &quot;Show whatever `notify-function' wants us to show after `notify-idle-time' in minibuffer.&quot;&#xA;  nil nil nil&#xA;  (if notify-mode&#xA;      (progn&#xA;    (setq notify-idle-timer (run-with-idle-timer notify-idle-time t 'notify-run))&#xA;    (add-hook 'post-command-hook 'notify-run)&#xA;    (add-hook 'window-size-change-functions 'notify-run))&#xA;    (if (timerp notify-idle-timer)&#xA;    (cancel-timer notify-idle-timer))&#xA;    (notify-clear)&#xA;    (remove-hook 'post-command-hook 'notify-run)&#xA;    (remove-hook 'window-size-change-functions 'notify-run))&#xA;  :global 't)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation on the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/The-Echo-Area.html#The-Echo-Area&quot; rel=&quot;nofollow&quot;&gt;echo area&lt;/a&gt; motivates the following implementation.&#xA;Especially the functions &lt;code&gt;notify-p&lt;/code&gt;, &lt;code&gt;notify-run&lt;/code&gt; and &lt;code&gt;notify-clear&lt;/code&gt; have changed.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defcustom minibuffer-buffer-list-filter 'identity&#xA;  &quot;Function for filtering the buffer names shown in the minibuffer window.&quot;&#xA;  :group 'notify&#xA;  :type 'sexp)&#xA;&#xA;(defun substring-no-properties-safe (str from &amp;amp;optional to)&#xA;  &quot;Like `substring-no-properties' but does not fail on args out of range.&quot;&#xA;  (let ((n (length str)))&#xA;    (substring-no-properties str (min from (max (1- n) 0)) (when to (min to n)))))&#xA;&#xA;(defun notify-buffer-list ()&#xA;  &quot;Show buffer list in minibuffer window.&quot;&#xA;  (substring-no-properties-safe&#xA;    (mapconcat 'buffer-name&#xA;           (cl-delete-if-not minibuffer-buffer-list-filter&#xA;                 (cl-delete-if (lambda (buf) (eq (aref (buffer-name buf) 0) #x20))&#xA;                           (buffer-list)))&#xA;           &quot; | &quot;)&#xA;    0 (1- (window-width (minibuffer-window)))))&#xA;&#xA;(defcustom notify-function 'notify-buffer-list&#xA;  &quot;The string returned by this function is displayed in minibuffer.&quot;&#xA;  :group 'notify&#xA;  :type 'sexp)&#xA;&#xA;(defcustom notify-idle-time 1&#xA;  &quot;Time in seconds until showing buffers in minibuffer.&quot;&#xA;  :group 'notify&#xA;  :type 'number)&#xA;&#xA;(defvar notify-idle-timer nil)&#xA;&#xA;(defun notify-p ()&#xA;  &quot;Check whether the message buffer is ready for updating the notification.&#xA;That means either it is empty or contains already an old notification.&quot;&#xA;  (when (null (active-minibuffer-window))&#xA;    (let ((msg (current-message)))&#xA;      (or (null msg)&#xA;      (get-text-property 0 :notification msg)))))&#xA;&#xA;(defun notify-clear ()&#xA;  &quot;Clear notification from active minibuffer.&quot;&#xA;  (when (notify-p)&#xA;    (message nil)))&#xA;&#xA;(defun notify-run (&amp;amp;optional frame)&#xA;  &quot;Run `notify-function' if minibuffer is empty and emacs is idle for `notify-idle-time' seconds.&quot;&#xA;  (when (notify-p)&#xA;    (let (message-log-max) ;; inhibit copy to message buffer&#xA;      (message &quot;%s&quot; (propertize&#xA;             (funcall notify-function)&#xA;             :notification t)))))&#xA;&#xA;(define-minor-mode notify-mode&#xA;  &quot;Show whatever `notify-function' wants us to show after `notify-idle-time' in minibuffer.&quot;&#xA;  nil nil nil&#xA;  :global t&#xA;  (if notify-mode&#xA;      (progn&#xA;    (setq notify-idle-timer (run-with-idle-timer notify-idle-time t 'notify-run))&#xA;    (add-hook 'post-command-hook 'notify-run)&#xA;    (add-hook 'window-size-change-functions 'notify-run))&#xA;    (if (timerp notify-idle-timer)&#xA;    (cancel-timer notify-idle-timer))&#xA;    (remove-hook 'window-size-change-functions 'notify-run)&#xA;    (remove-hook 'post-command-hook 'notify-run)&#xA;    (notify-clear)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-02-08T22:33:07.973" LastActivityDate="2016-02-08T22:33:07.973" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20041" PostTypeId="1" AcceptedAnswerId="20042" CreationDate="2016-02-03T21:50:17.860" Score="2" ViewCount="52" Body="&lt;p&gt;Consider a buffer holding the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo&#xA;...&#xA;some text /foo/bar/hello.csv&#xA;...&#xA;bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where  represents the location of cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have an interactive function that automatically calls &lt;code&gt;&amp;lt;command&amp;gt; $PATH&lt;/code&gt; on the shell, where &lt;code&gt;$PATH&lt;/code&gt; is the path immediately preceding &lt;code&gt;&lt;/code&gt; (it can do this by finding the first &lt;code&gt;/&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I approach this problem in &lt;code&gt;elisp&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen packages like Helm being able to do something similar (e.g. &lt;code&gt;C-x C-f&lt;/code&gt; on cursor above would open&lt;code&gt;helm-find-files&lt;/code&gt; on that location)&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2016-02-04T04:14:04.643" LastActivityDate="2016-02-04T05:13:10.063" Title="Take path preceding cursor and run a shell command on it" Tags="|shell|interactive|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20042" PostTypeId="2" ParentId="20041" CreationDate="2016-02-03T22:01:13.157" Score="4" Body="&lt;p&gt;One way to achieve this is by using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Contents.html#index-thing_002dat_002dpoint&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;thing-at-point&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;shell-command&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-open-file-at-point ()&#xA;  (interactive)&#xA;  (shell-command (format &quot;open %s&quot; (thing-at-point 'filename))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-02-03T22:01:13.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20044" PostTypeId="2" ParentId="20017" CreationDate="2016-02-04T01:56:52.453" Score="3" Body="&lt;p&gt;You could modify the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Categories.html#Categories&quot; rel=&quot;nofollow&quot;&gt;category&lt;/a&gt; of characters &lt;code&gt;G&lt;/code&gt;, &lt;code&gt;C&lt;/code&gt;, &lt;code&gt;A&lt;/code&gt;, and &lt;code&gt;T&lt;/code&gt; to make them line-breakable:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun break-at-gcat ()&#xA;  &quot;Make characters G, C, A, and T line-breakable to simplify&#xA;wrapping DNA sequence strings.&quot;&#xA;  (dolist (char '(?G ?C ?A ?T))&#xA;    (modify-category-entry char ?|)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I evaluate &lt;code&gt;(break-at-gcat)&lt;/code&gt;, set &lt;code&gt;fill-column&lt;/code&gt; to 20,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-local fill-column 20)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;put the cursor on this line,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;ACCATCGAAACTTTGAACGCAAGTTGCGCCTCAAGCCATTAGGTTGAGGGCACGTTTGCTTGGGTGTCATTCGTTATGTC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and press &lt;code&gt;M-q&lt;/code&gt; (&lt;code&gt;fill-paragraph&lt;/code&gt;), I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;ACCATCGAAACTTTGAACGC&#xA;AAGTTGCGCCTCAAGCCATT&#xA;AGGTTGAGGGCACGTTTGCT&#xA;TGGGTGTCATTCGTTATGTC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To allow re-wrapping without inserting spaces we can use&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-local sentence-end &quot;[GCAT]&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This tricks &lt;code&gt;canonically-space-region&lt;/code&gt; in &lt;code&gt;fill.el&lt;/code&gt; into thinking that characters &lt;code&gt;G&lt;/code&gt;, &lt;code&gt;C&lt;/code&gt;, &lt;code&gt;A&lt;/code&gt;, and &lt;code&gt;T&lt;/code&gt; match the end a sentence (&lt;em&gt;including&lt;/em&gt; the break we want) so it removes any extra spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;em&gt;both&lt;/em&gt; modifying character categories and the &lt;code&gt;sentence-end&lt;/code&gt; regexp &lt;strong&gt;will&lt;/strong&gt; mess with wrapping English text in the same buffer! &lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-02-04T18:16:05.297" LastActivityDate="2016-02-04T18:16:05.297" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20045" PostTypeId="2" ParentId="20041" CreationDate="2016-02-04T03:36:56.930" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then you can use &lt;code&gt;M-.&lt;/code&gt; to &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Inserting_Text_from_Cursor&quot; rel=&quot;nofollow&quot;&gt;insert text at or near the cursor&lt;/a&gt; into the minibuffer anytime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example to run shell command &lt;code&gt;my-shell-command&lt;/code&gt;, passing it the filename (or whatever) at point you would type this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x shell-command my-shell-command M-. RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you hit &lt;code&gt;M-.&lt;/code&gt; the thing at or near point is inserted, so the minibuffer content after the &lt;code&gt;M-x&lt;/code&gt; prompt becomes &lt;code&gt;shell-command /foo/bar/hello.csv&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is the doc string for &lt;code&gt;M-.&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;icicle-insert-string-at-point is an interactive compiled Lisp function&#xA;in `icicles-mcmd.el'.&#xA;&#xA;(icicle-insert-string-at-point &amp;amp;optional ARG)&#xA;&#xA;Insert text at the cursor into the minibuffer.&#xA;Each time this command is called, some text at or near the cursor is&#xA;inserted into the minibuffer.  One of two things happens, depending on&#xA;the value of option `icicle-default-thing-insertion' and whether or&#xA;not you use `C-u'.&#xA;&#xA;See the doc for option `icicle-thing-at-point-functions' for a&#xA;complete description of its behavior.  What follows is an overview.&#xA;&#xA;`icicle-thing-at-point-functions' is a cons of two parts - call them&#xA;ALTERNATIVES and FORWARD-THING.&#xA;&#xA;If ALTERNATIVES is not nil and one of the following is true:&#xA; - FORWARD-THING is nil&#xA; - the value of `icicle-default-thing-insertion' is `alternatives' and&#xA;   you have not used plain `C-u' in this series of `M-.'&#xA; - the value of `icicle-default-thing-insertion' is `more-of-the-same'&#xA;   and you have used plain `C-u' in this series of `M-.'&#xA;then the next function in ALTERNATIVES is used to retrieve the text to&#xA;be inserted.&#xA;&#xA;If FORWARD-THING is not nil and one of the following is true:&#xA; - ALTERNATIVES is nil&#xA; - the value of `icicle-default-thing-insertion' is `more-of-the-same'&#xA;   and you have not used `C-u' in this series of `M-.'&#xA; - the value of `icicle-default-thing-insertion' is `alternatives' and&#xA;   you have used `C-u' in this series of `M-.'&#xA;then function FORWARD-THING is used to retrieve the text to be&#xA;inserted.&#xA;&#xA;If you use a numeric prefix arg (not just plain `C-u'), the behavior&#xA;is as follows.&#xA;&#xA;* If a function in ALTERNATIVES is used (see above), then the text&#xA;  that is grabbed at or near point is read as a Lisp sexp and&#xA;  evaluated, and the value is inserted instead of the grabbed text.&#xA;&#xA;  Yes, this means you need to know when the particular ALTERNATIVES&#xA;  function that you want is coming up next, and use, say, `C-9' just&#xA;  before hitting `M-.' for that alternative.  So if, e.g., you want to&#xA;  evaluate the active region and insert the value, then you use&#xA;  `M-. C-9 M-.', since it is the second `M-.' that grabs the region.&#xA;&#xA;* If the FORWARD-THING is being used, then the prefix arg determines&#xA;  the number of things to grab, and the direction of grabbing.: A&#xA;  negative argument grabs text to the left of the cursor; a positive&#xA;  argument grabs text to the right.&#xA;&#xA;You can use this command only from the minibuffer (`M-.').&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-04T05:13:10.063" LastActivityDate="2016-02-04T05:13:10.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20046" PostTypeId="1" AcceptedAnswerId="20048" CreationDate="2016-02-04T04:08:46.580" Score="2" ViewCount="508" Body="&lt;p&gt;It seems by default this can't be done. For example, if I try to activate &lt;code&gt;helm-mini&lt;/code&gt;, and then from there activate &lt;code&gt;helm-M-x&lt;/code&gt;, I get the error message: &lt;code&gt;Error: Trying to run helm within a running helm session&lt;/code&gt;. Is there a good way around this constraint when writing a custom function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My use case is this: I am trying to write my own function that will try to call &lt;code&gt;helm-mini&lt;/code&gt;, but if helm is already running (i.e., if &lt;code&gt;helm-alive-p&lt;/code&gt; evaluates to &lt;code&gt;t&lt;/code&gt;) it will run &lt;code&gt;helm-projectile-find-file&lt;/code&gt; instead. What I have so far is:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun es/helm-mini-or-projectile-find-file ()&#xA;  (interactive)&#xA;  (if (not (helm-alive-p))&#xA;      (helm-mini)&#xA;    (progn (helm-keyboard-quit)&#xA;           (helm-projectile-find-file))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am trying to kill helm if it is running before calling &lt;code&gt;helm-projectile-find-file&lt;/code&gt;, because, as mentioned above, I can't run a helm command if I am already in the middle of another helm command. However, it seems like &lt;code&gt;helm-keyboard-quit&lt;/code&gt; breaks out of the function before &lt;code&gt;helm-projectile-find-file&lt;/code&gt; is executed. Or perhaps there is something else wrong with my code. I am still not very proficient at all with emacs lisp. Is there a good way to get around the constraint of no helm commands during a running helm session?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="105" LastEditDate="2016-03-13T22:08:03.070" LastActivityDate="2016-03-13T22:08:03.070" Title="Run a helm command from a running helm session?" Tags="|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20047" PostTypeId="1" AcceptedAnswerId="20049" CreationDate="2016-02-04T04:48:47.090" Score="7" ViewCount="1443" Body="&lt;p&gt;I have started seeing some strange X related behaviour in emacs. I have not been able to pin it down. It goes away when I run &lt;code&gt;emacs -Q&lt;/code&gt;, but is still present when running &lt;code&gt;emacs -q --no-init-file --nosplash&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The man page says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-Q, --quick&lt;br&gt;&#xA;     Similar to &quot;-q --no-site-file --no-splash&quot;.  Also, avoid processing X resources.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does &lt;em&gt;avoid processing X resources&lt;/em&gt; mean?    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does that tell me about my problem? &lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="105" LastEditDate="2016-02-04T05:21:49.123" LastActivityDate="2016-02-04T05:21:49.123" Title="What is the difference between `-Q` and `-q --no-init-file --nosplash`" Tags="|start-up|x11|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20048" PostTypeId="2" ParentId="20046" CreationDate="2016-02-04T04:58:48.307" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;(helm-run-after-exit FUNCTION &amp;amp;rest ARGS)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-run-after-exit&lt;/code&gt; exits current helm session, and then runs FUNCTION, so this is what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun es/helm-mini-or-projectile-find-file ()&#xA;  (interactive)&#xA;  (if (helm-alive-p)&#xA;      (helm-run-after-exit #'helm-projectile-find-file)&#xA;    (helm-mini)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To call this command from a helm session, you need to bind a key to it since you can't use &lt;code&gt;helm-M-x&lt;/code&gt;, e.g.,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-key &quot;C-c C-p&quot; #'es/helm-mini-or-projectile-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Similarly, if you want to use &lt;code&gt;helm-M-x&lt;/code&gt; from arbitrary helm commands, you can wrap &lt;code&gt;helm-M-x&lt;/code&gt; with a new command and assign a key from &lt;code&gt;helm-map&lt;/code&gt; to it.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-helm-M-x ()&#xA;  (interactive)&#xA;  (with-helm-alive-p&#xA;    (helm-run-after-exit&#xA;     (lambda () (call-interactively #'helm-M-x)))))&#xA;&#xA;(bind-key &quot;M-x&quot; #'my-helm-M-x helm-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-02-04T04:58:48.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20049" PostTypeId="2" ParentId="20047" CreationDate="2016-02-04T05:20:32.583" Score="9" Body="&lt;p&gt;&lt;code&gt;Q&lt;/code&gt; also uses &lt;code&gt;--no-site-lisp&lt;/code&gt;. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Initial-Options.html&quot;&gt;Initial Options&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For information about X resources, see node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Resources.html&quot;&gt;Resources&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Learn to &lt;em&gt;ask Emacs&lt;/em&gt;: &lt;code&gt;C-h r&lt;/code&gt;, then &lt;code&gt;i&lt;/code&gt; and type some text to match an index entry, then &lt;code&gt;TAB&lt;/code&gt; to see the matches, and choose one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find &lt;code&gt;i&lt;/code&gt; and other manual-browsing keys by doing &lt;code&gt;C-h m&lt;/code&gt; in the manual. &lt;code&gt;C-h m&lt;/code&gt; in any mode gives you information about that mode.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-04T05:20:32.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20050" PostTypeId="1" CreationDate="2016-02-04T06:06:38.620" Score="4" ViewCount="354" Body="&lt;p&gt;I want to capture things with a deadline timestamp relative to the date that is open in my agenda view.  How can I do that?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;%T&lt;/code&gt; template inserts today's date.  I want a template that queries my agenda view for the date and uses that instead.&lt;/p&gt;&#xA;" OwnerUserId="9790" LastEditorUserId="253" LastEditDate="2016-02-04T11:38:22.843" LastActivityDate="2016-04-04T23:19:09.400" Title="Capture deadline timestamp based on date in agenda view?" Tags="|org-mode|org-agenda|org-capture|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20051" PostTypeId="2" ParentId="20001" CreationDate="2016-02-04T07:42:34.277" Score="6" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Made following minor changes to your code block:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;Moved &lt;code&gt;#!/bin/bash&lt;/code&gt; into code block header &lt;code&gt;:shebang #!/bin/bash&lt;/code&gt; to automatically set executable file permissions when block is tangled into &lt;code&gt;dir-input.sh&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Added debug code to show &lt;code&gt;$TEST_DIR&lt;/code&gt; was assigned correctly from &lt;code&gt;read input_variable&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh  :results output :export code :tangle dir-input.sh :shebang #!/bin/bash&#xA;&#xA;if [ -z &quot;$TEST_DIR&quot; ]&#xA;then&#xA;    echo &quot;TEST_DIR was not set, please enter the path: &quot;&#xA;    read input_variable&#xA;    export TEST_DIR=$input_variable&#xA;    echo &quot;# export TEST_DIR=$TEST_DIR&quot;&#xA;fi&#xA;#+END_SRC   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Then created new code block to call tangled file &lt;code&gt;./dir-input.sh&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results output :shebang #!/bin/bash  :var USER_INPUT=(read-string &quot;Test Dir: &quot;)&#xA;  echo $USER_INPUT | ./dir-input.sh &#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Notice header&lt;/strong&gt; &lt;code&gt;:var USER_INPUT=(read-string &quot;Test Dir: &quot;)&lt;/code&gt;  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This header will display a &lt;code&gt;Test Dir:&lt;/code&gt; prompt in the &lt;code&gt;minibuffer&lt;/code&gt; window when the code block is executed using a &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt;.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Enter the path, e.g. /path/to/test/dir &lt;kbd&gt;enter&lt;/kbd&gt;  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;and the block will pass the input to the &lt;code&gt;./dir-input.sh&lt;/code&gt; via &lt;code&gt;STDIN&lt;/code&gt;.&#xA;  You should see the following &lt;code&gt;#+RESULTS:&lt;/code&gt; &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: TEST_DIR was not set, please enter the path: &#xA;: # export TEST_DIR=/path/to/test/dir&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Code tested with:&lt;br&gt;&#xA;  GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14) of 2014-12-25&lt;br&gt;&#xA;  org-mode version: 8.3.2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastActivityDate="2016-02-04T07:42:34.277" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20052" PostTypeId="1" AcceptedAnswerId="20053" CreationDate="2016-02-04T09:39:43.137" Score="3" ViewCount="1248" Body="&lt;p&gt;I have one file that is my default file in &lt;code&gt;org-agenda-files&lt;/code&gt; (which I set in my &lt;code&gt;init.el&lt;/code&gt; file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I add other files to the &lt;code&gt;org-agenda-files&lt;/code&gt; list from within my default agenda file with paths relative to the default file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hypothetical example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* One heading&#xA;  Some text&#xA;* Second heading (external)&#xA;  AGENDAFILE: ext/ext.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10741" LastEditorUserId="253" LastEditDate="2016-02-04T11:20:00.757" LastActivityDate="2020-06-23T14:52:33.850" Title="Add file to org-agenda-files from another agenda file?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20053" PostTypeId="2" ParentId="20052" CreationDate="2016-02-04T11:17:06.040" Score="3" Body="&lt;p&gt;You can use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;file-local variable&lt;/a&gt; to evaluate a lisp form that will add another file to your &lt;code&gt;org-agenda-files&lt;/code&gt; list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you could put the following at the end of your default agenda file to add the &lt;code&gt;another-agenda-file.org&lt;/code&gt; file to the list.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## Local Variables:&#xA;## eval: (add-to-list 'org-agenda-files &quot;another-agenda-file.org&quot; 'append)&#xA;## End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;append&lt;/code&gt; argument (or any non-&lt;code&gt;nil&lt;/code&gt; value) in the call to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/List-Variables.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;add-to-list&lt;/code&gt;&lt;/a&gt; puts the file at the back of the list.  Leaving it off will put the file at the front of the list.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-04T11:17:06.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20054" PostTypeId="1" AcceptedAnswerId="20076" CreationDate="2016-02-04T12:20:14.167" Score="1" ViewCount="414" Body="&lt;p&gt;I added &lt;a href=&quot;https://emacs.stackexchange.com/a/7120/5345&quot;&gt;this&lt;/a&gt; function to my &lt;code&gt;~/.emacs&lt;/code&gt; file and run it by entering &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;my-turn-current-window-into-frame&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the following to my &lt;code&gt;~/.emacs&lt;/code&gt; file after that function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f12&amp;gt;&quot;) 'my-turn-current-window-into-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I copied that line to &lt;code&gt;*scratch*&lt;/code&gt; and evaluated it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;kbd&gt;F12&lt;/kbd&gt;, Emacs returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: my-turn-current-window-into-frame&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I configure a hot-key to run this function?&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-05T20:56:02.920" Title="&quot;Void function definition&quot; error when I press key bound to it" Tags="|key-bindings|" AnswerCount="1" CommentCount="4" ClosedDate="2016-02-25T11:59:37.973" ContentLicense="CC BY-SA 3.0" />
  <row Id="20055" PostTypeId="2" ParentId="20016" CreationDate="2016-02-04T12:21:44.400" Score="10" Body="&lt;p&gt;This is a known &lt;a href=&quot;https://github.com/jsx/jsx-mode.el/issues/8&quot;&gt;issue&lt;/a&gt; and as of now, it has not been fixed. I've decided to forego &lt;code&gt;jsx-mode&lt;/code&gt; for this reason and just use &lt;code&gt;web-mode&lt;/code&gt;. It has support for JSX and is better suited for mixed content files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I do work in several projects that don't all have the same convention of using the &lt;code&gt;.jsx&lt;/code&gt; ending for JSX files (some simply use &lt;code&gt;.js&lt;/code&gt; endings), I've also implemented the following hack to set the &lt;code&gt;web-mode-content-type&lt;/code&gt; to &lt;code&gt;jsx&lt;/code&gt;, when it's &quot;javascript&quot;. This has the consequence that all javascript files are considerd JSX, but hopefully this will not have any negative consequences.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'web-mode-hook&#xA;      (lambda ()&#xA;        ;; short circuit js mode and just do everything in jsx-mode&#xA;        (if (equal web-mode-content-type &quot;javascript&quot;)&#xA;            (web-mode-set-content-type &quot;jsx&quot;)&#xA;          (message &quot;now set to: %s&quot; web-mode-content-type))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8401" LastActivityDate="2016-02-04T12:21:44.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20056" PostTypeId="1" AcceptedAnswerId="20079" CreationDate="2016-02-04T13:27:16.930" Score="3" ViewCount="1063" Body="&lt;p&gt;I have started using mozilla's &lt;a href=&quot;http://rr-project.org/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;rr&lt;/code&gt;&lt;/a&gt; (timetravelling debugger, github &lt;a href=&quot;https://github.com/mozilla/rr&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) on the command line for debugging c++ code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs I can start it with &lt;code&gt;gud-gdb&lt;/code&gt; and writing &lt;code&gt;rr replay&lt;/code&gt; (as mentioned &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Debugger-Operation.html#Debugger-Operation&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;https://github.com/mozilla/rr/issues/1484&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot start it with &lt;code&gt;gdb&lt;/code&gt; followed by &lt;code&gt;rr replay&lt;/code&gt;, which is how I usually start gdb in order to work in gdb many-window-mode. (which I have enabled as a setting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try and start it that way I get these error messages to start off with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loaded symbols for /lib64/ld-linux-x86-64.so.2&#xA;0x00007f53bd89a6b0 in _start () from /lib64/ld-linux-x86-64.so.2&#xA;(rr) Undefined command: &quot;1-inferior-tty-set&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;2-gdb-set&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;3-gdb-set&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;4-enable-pretty-printing&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;5-file-list-exec-source-files&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;6-file-list-exec-source-file&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;7-gdb-show&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;8-stack-info-frame&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;9-thread-info&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;10-break-list&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;11-thread-info&quot;.  Try &quot;help&quot;.&#xA;(rr) Undefined command: &quot;12-break-list&quot;.  Try &quot;help&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;followed by this error message when I try and run anything from within the  gdb session:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rr) continue&#xA;Undefined command: &quot;-interpreter-exec&quot;.  Try &quot;help&quot;.&#xA;(rr) run&#xA;Undefined command: &quot;-interpreter-exec&quot;.  Try &quot;help&quot;.&#xA;(rr) break&#xA;Undefined command: &quot;-interpreter-exec&quot;.  Try &quot;help&quot;.&#xA;(rr) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know if it is possible to run rr with emacs many-window-mode?&lt;/p&gt;&#xA;" OwnerUserId="5199" LastActivityDate="2016-04-05T20:34:32.220" Title="Is it possible to use mozilla's rr with gdb multi-window?" Tags="|c++|gdb|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20057" PostTypeId="1" CreationDate="2016-02-04T14:03:16.577" Score="2" ViewCount="953" Body="&lt;p&gt;I have updated &lt;code&gt;emacs-snapshot&lt;/code&gt; earlier today and it broke my Emacs installation into pieces (it is Ubuntu 14.04).&#xA;It somehow removed whole &lt;code&gt;emacs24&lt;/code&gt; package so now I have no even &lt;code&gt;emacs-client&lt;/code&gt; installed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apt-cache policy emacs-snapshot&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;shows that latest version is installed but &lt;code&gt;emacs-snapshot&lt;/code&gt; is not known command in bash and &#xA;&lt;code&gt;find / -type f -name 'emacs-snapshot*'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can't find any binary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be fixed?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Proposed actions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ dpkg-query -L emacs-snapshot&#xA;/.&#xA;/usr&#xA;/usr/share&#xA;/usr/share/doc&#xA;/usr/share/doc/emacs-snapshot&#xA;/usr/share/doc/emacs-snapshot/changelog.gz&#xA;/usr/share/doc/emacs-snapshot/copyright&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems like just some docs are installed from here.&lt;/p&gt;&#xA;" OwnerUserId="6551" LastEditorUserId="8431" LastEditDate="2016-06-06T16:35:41.523" LastActivityDate="2016-06-06T16:35:41.523" Title="emacs-snapshot from Ubuntu PPA is currently totally broken" Tags="|install|ubuntu|" AnswerCount="0" CommentCount="14" ClosedDate="2016-02-04T14:48:11.293" ContentLicense="CC BY-SA 3.0" />
  <row Id="20058" PostTypeId="1" CreationDate="2016-02-04T19:16:24.173" Score="1" ViewCount="218" Body="&lt;p&gt;Using &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;nofollow&quot;&gt;pdf-tools&lt;/a&gt; for showing pdfs in emacs is great! But when I use it, I alway have to do a (C-c C-g) i.e., pdf-sync-forward-search after compilation. How can I make emacs do this automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I also get the error message &quot;error in process sentinel&quot;, when emacs reverts the buffer. Can I make this go away?&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2016-02-04T19:16:24.173" Title="Make pdf-tools do pdf-sync-forward-search after compilation" Tags="|pdf-tools|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20059" PostTypeId="1" CreationDate="2016-02-04T19:34:23.947" Score="2" ViewCount="468" Body="&lt;p&gt;Does anyone know how to make the pane in latex preview pane mode stay put? When I move it to the frame/window I would like it to be, it pops back to its default window when I refresh it, M-p.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Precisely what I mean.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install latex-preview-pane from melpa repo&lt;/li&gt;&#xA;&lt;li&gt;Open any .tex file. C-x C-f &quot;/mydir/myfile.tex&quot;&lt;/li&gt;&#xA;&lt;li&gt;Open a .pdf preview of the .tex file: M-x latex-preview-pane-mode. This will open a new myfile.pdf buffer in a new window to the right of myfile.tex&lt;/li&gt;&#xA;&lt;li&gt;Close the preview window C-x 1&lt;/li&gt;&#xA;&lt;li&gt;Open new frame C-x 5 2&lt;/li&gt;&#xA;&lt;li&gt;Open the myfile.pdf buffer in the new frame using C-x b.&lt;/li&gt;&#xA;&lt;li&gt;At this point I have a preview frame that I can place where ever I'd like, preferably on a second monitor&lt;/li&gt;&#xA;&lt;li&gt;Return to the original window containing myfile.tex, C-x 5 o&lt;/li&gt;&#xA;&lt;li&gt;Make changes to myfile.tex&lt;/li&gt;&#xA;&lt;li&gt;Update the myfile.pdf buffer to reflect changes M-p.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At this point the frame that was created and moved is still in place and updated, but a new window opens to the right of the myfile.tex buffer again with another copy of the preview pane. So I now have two views of the myfile.pdf buffer. &lt;/p&gt;&#xA;" OwnerUserId="11012" LastEditorUserId="11012" LastEditDate="2016-02-08T00:24:55.080" LastActivityDate="2016-02-08T00:24:55.080" Title="In latex preview pane mode, make the pane stay where I put it" Tags="|latex|preview-latex|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20060" PostTypeId="2" ParentId="20050" CreationDate="2016-02-04T21:19:16.863" Score="1" Body="&lt;p&gt;The current date in an agenda view is kept in the buffer-local &lt;code&gt;org-starting-day&lt;/code&gt;. Use a sexp like &lt;code&gt;%(format-time-string &quot;%Y-%m-%d&quot; (org-time-from-absolute org-starting-day))&lt;/code&gt; in your capture template to insert a date string.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-02-04T21:19:16.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20061" PostTypeId="2" ParentId="20050" CreationDate="2016-02-04T21:34:45.797" Score="1" Body="&lt;p&gt;With the cursor on the desired date in the agenda view, press &lt;code&gt;k&lt;/code&gt; (for kapture).  This will cause anything referring to the current day (for example &lt;code&gt;%T&lt;/code&gt; in a capture template) to refer to the date in the agenda instead.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-02-04T21:34:45.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20062" PostTypeId="1" AcceptedAnswerId="20812" CreationDate="2016-02-05T00:12:32.093" Score="18" ViewCount="5250" Body="&lt;p&gt;Hello Good people of Emacs!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having trouble exporting unicode math symbols from buffer (org-mode) to pdf file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1. Problem Description:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbols are inserted to the buffer as unicode characters (via &lt;a href=&quot;https://www.emacswiki.org/emacs/TeXInputMethod&quot; rel=&quot;noreferrer&quot;&gt;TEX input method&lt;/a&gt; or  &lt;a href=&quot;https://github.com/vspinu/company-math&quot; rel=&quot;noreferrer&quot;&gt;company-math&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is source code demonstration: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Unicode characters export test &#xA;#+AUThor: &#xA;#+date:&#xA;Unicode characters:&#xA;&#xA;ℝ ℤ ℕ ⇒ ∈ ∀ &#xA;&#xA;Same symbols in latex format:&#xA;&#xA;$$\Bbb{R} \Bbb{Z} \Bbb{N} \Rightarrow \in \forall$$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Produced .tex file includes unicode symbols:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Created 2016-03-04 Pá 21:01&#xA;\documentclass[11pt]{article}&#xA;\usepackage[utf8]{inputenc}&#xA;\usepackage[T1]{fontenc}&#xA;\usepackage{fixltx2e}&#xA;\usepackage{graphicx}&#xA;\usepackage{longtable}&#xA;\usepackage{float}&#xA;\usepackage{wrapfig}&#xA;\usepackage{rotating}&#xA;\usepackage[normalem]{ulem}&#xA;\usepackage{amsmath}&#xA;\usepackage{textcomp}&#xA;\usepackage{marvosym}&#xA;\usepackage{wasysym}&#xA;\usepackage{amssymb}&#xA;\usepackage{hyperref}&#xA;\tolerance=1000&#xA;\date{}&#xA;\title{Unicode characters export test}&#xA;\hypersetup{&#xA;  pdfkeywords={},&#xA;  pdfsubject={},&#xA;  pdfcreator={Emacs 24.4.1 (Org mode 8.2.10)}}&#xA;\begin{document}&#xA;&#xA;\maketitle&#xA;\tableofcontents&#xA;&#xA;Unicode characters:&#xA;&#xA;ℝ ℤ ℕ ⇒ ∈ ∀ &#xA;&#xA;Same symbols in latex format:&#xA;&#xA;$$\Bbb{R} \Bbb{Z} \Bbb{N} \Rightarrow \in \forall$$&#xA;% Emacs 24.4.1 (Org mode 8.2.10)&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pdf file does not :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QLw1p.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QLw1p.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. Things I have tried so far:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Xelatex and unicode-math:&lt;/strong&gt;&#xA;This is included in answer from Rasmus. Here I have to admit: I'm not using development version of org-mode he's mentioning. (failed to install it) I've tried xelatex adn unicode-math anyway. My version of Org mode is 8.2.10.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+latex_compiler: xelatex&#xA;#+latex_header: \usepackage{libertine}&#xA;#+latex_header: \usepackage{unicode-math}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Including this in file introduces not so lovely message instead pdf file. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-latex-compile: PDF file ./unicode_export_test.pdf wasn't produced:&#xA;  [package error]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have checked for correct unicode-math installation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ kpsewhich unicode-math.sty&#xA;/usr/share/texlive/texmf-dist/tex/latex/unicode-math/unicode-math.sty&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Installation of Xelatex is the newest version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ sudo apt-get install texlive-xetex&#xA;Reading package lists... Done&#xA;Building dependency tree       &#xA;Reading state information... Done&#xA;texlive-xetex is already the newest version.&#xA;0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;install development version of org-mode: (failed)&lt;/strong&gt; Following &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development&quot; rel=&quot;noreferrer&quot;&gt;How do I keep current with bleeding edge development? - tutorial&lt;/a&gt; I have been able (I think) download it and compile it. Since I have no idea how to tell to Emacs run this version,  Emacs runs Org-mode version 8.2.10 (release_8.2.10 @ /usr/local/share/emacs/24.4/lisp/org/).&#xA;I have tried to add following lines to my config.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path (expand-file-name &quot;~/elisp/org-mode/lisp&quot;))&#xA;(remove 'load-path (expand-file-name &quot;/usr/local/share/emacs/24.4/lisp/org/&quot;))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.\\(org\\|org_archive\\|txt\\)$&quot; . org-mode))&#xA;(require 'org)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Without pleasing result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Searching internet:&lt;/strong&gt;&#xA;Solution was not found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Beating my self for being stupid:&lt;/strong&gt;&#xA;Didn't help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3. Question: How to export unicode characters from org-mode to pdf?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do I have to configure some org-mode variable?&lt;/li&gt;&#xA;&lt;li&gt;Compile with different Latex interpreter?&lt;/li&gt;&#xA;&lt;li&gt;Any other ideas?&lt;/li&gt;&#xA;&lt;li&gt;If development version fixes this.... How can I install it?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6527" LastEditorUserId="6527" LastEditDate="2016-03-05T08:27:57.230" LastActivityDate="2016-03-07T21:26:56.470" Title="Exporting unicode characters to pdf using latex from org mode" Tags="|org-mode|org-export|latex|unicode|symbols|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20063" PostTypeId="1" AcceptedAnswerId="20064" CreationDate="2016-02-05T01:41:06.437" Score="6" ViewCount="462" Body="&lt;p&gt;I'm trying to implement the &lt;code&gt;complement&lt;/code&gt; &lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Body/f_comple.htm&quot;&gt;function from Common Lisp&lt;/a&gt; (CL) in Emacs Lisp, but I'm confused by why defining it as a function (as opposed to a macro) does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The macro definition is straightforward:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro complement (function)&#xA;  `(lambda (&amp;amp;rest args)&#xA;     (not (apply ,function args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function definition, however, does not work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun complement (f)&#xA;  (lambda (&amp;amp;rest args)&#xA;    (not (apply f args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Something like &lt;code&gt;(complement #'zerop)&lt;/code&gt; gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda (&amp;amp;rest args) (not (apply f args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where the &lt;code&gt;f&lt;/code&gt; is not replaced with the &lt;code&gt;zerop&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this? The equivalent function definition works fine in CL. Does it have something to do with scope?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="2355" LastEditDate="2016-02-12T08:43:56.243" LastActivityDate="2016-02-12T08:43:56.243" Title="Why doesn't &quot;complement&quot; work as a function?" Tags="|elisp|common-lisp|lexical-scoping|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20064" PostTypeId="2" ParentId="20063" CreationDate="2016-02-05T02:53:57.187" Score="11" Body="&lt;p&gt;Yes, this behavior is explained by differences in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Variable-Scoping.html#Variable-Scoping&quot;&gt;Variable Scoping&lt;/a&gt; between Emacs Lisp and Common Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Common Lisp (a lexically scoped lisp) a lambda returned by &lt;code&gt;complement&lt;/code&gt; you defined is turned into a &lt;em&gt;closure&lt;/em&gt;, i.e. it captures the lexical environment that existed when it was created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I get from SBCL:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*&#xA;(defun my-complement (f)&#xA;  (lambda (&amp;amp;rest args)&#xA;    (not (apply f args))))&#xA;&#xA;MY-COMPLEMENT&#xA;* (my-complement #'zerop)&#xA;&#xA;#&amp;lt;CLOSURE (LAMBDA (&amp;amp;REST ARGS) :IN MY-COMPLEMENT) {1002CD5BEB}&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs Lisp (which uses dynamic binding) your &lt;code&gt;complement&lt;/code&gt; returns the form &quot;&lt;code&gt;(lambda (&amp;amp;rest args) (not (apply f args)))&lt;/code&gt;&quot;, which does not &quot;see&quot; that &lt;code&gt;f&lt;/code&gt; was bound to &lt;code&gt;#'zerop&lt;/code&gt; because it cannot &quot;capture&quot; the environment it is created in. (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Closures.html#Closures&quot;&gt;Closures&lt;/a&gt; can exist only in the context of lexical binding.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You &lt;strong&gt;can&lt;/strong&gt; enable lexical binding in Emacs Lisp by setting &lt;code&gt;lexical-binding&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. This is a file-local variable, so you would usually put&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;near the top of the file to achieve this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this change the functional version of &lt;code&gt;complement&lt;/code&gt; works in Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for why this works as a macro in Emacs Lisp, a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Expansion.html#Expansion&quot;&gt;macro&lt;/a&gt; generates the form &lt;em&gt;with&lt;/em&gt; the value of &lt;code&gt;f&lt;/code&gt; captured (you took care of it by using a backquote and a comma) and then the resulting form is evaluated, turning the form &lt;code&gt;(lambda (&amp;amp;rest args) ...)&lt;/code&gt; into an anonymous function you can call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both steps are important: without the backquote you can't capture &lt;code&gt;f&lt;/code&gt;, and without evaluation all you get is a funny-looking list &lt;code&gt;(lambda (&amp;amp;rest args) ...)&lt;/code&gt; that you'd have to &lt;code&gt;eval&lt;/code&gt; &quot;by hand&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I'm not a Lisp expert. Comments, corrections, and edits are always welcome.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-02-05T02:53:57.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20065" PostTypeId="2" ParentId="20063" CreationDate="2016-02-05T03:09:09.157" Score="9" Body="&lt;p&gt;What @Constantine said about lexical and dynamic scoping is true, and it explains the difference from Common Lisp behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is something misleading in your question.  This really &lt;strong&gt;has nothing to do with macros&lt;/strong&gt;.  Here is a definition using &lt;code&gt;defun&lt;/code&gt; instead of &lt;code&gt;defmacro&lt;/code&gt;. Note that you need a quote mark (&lt;code&gt;'&lt;/code&gt;) before the use of &lt;code&gt;,function&lt;/code&gt;: &lt;code&gt;',function&lt;/code&gt;, because you want &lt;code&gt;'zerop&lt;/code&gt; and not &lt;code&gt;zerop&lt;/code&gt; (which would be evaluated as a variable).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun complement (function)&#xA;  &quot;Return a function that complements the effect of FUNCTION.&#xA;The resulting function applies FUNCTION to any number of args&#xA;and returns the Boolean complement of the result.&quot;&#xA;  `(lambda (&amp;amp;rest args)&#xA;     (not (apply ',function args))))&#xA;&#xA;(funcall (complement #'zerop) 0)   ; Returns nil&#xA;(funcall (complement #'zerop) 3)   ; Returns t&#xA;&#xA;(complement #'zerop) ; Returns (lambda (&amp;amp;rest args) (not (apply (quote zerop) args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you use &lt;code&gt;',function&lt;/code&gt; you are not leaving &lt;code&gt;function&lt;/code&gt; as a free variable in the resulting function (lambda form).  Instead, because of the backquote surrounding the comma, the value of FUNCTION that is passed to function &lt;code&gt;complement&lt;/code&gt; is &lt;strong&gt;substituted&lt;/strong&gt; for &lt;code&gt;,function&lt;/code&gt;, and then quoted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when &lt;code&gt;zerop&lt;/code&gt; is passed as argument to &lt;code&gt;complement&lt;/code&gt; it is substituted for &lt;code&gt;,function&lt;/code&gt; and then quoted, producing &lt;code&gt;'zerop&lt;/code&gt; within the resulting lambda form.  The backquote expression constructs a &lt;strong&gt;list&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda (&amp;amp;rest args) (not (apply 'zerop args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you use &lt;code&gt;complement&lt;/code&gt; that list is evaluated to a function and used as such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the &lt;em&gt;difference&lt;/em&gt; between this approach and the use of free variable &lt;code&gt;function&lt;/code&gt; in the lexical binding case (that is, the use of a closure that couples (a) the lambda form that has free variable &lt;code&gt;function&lt;/code&gt; with (b) an environment in which that variable is bound to &lt;code&gt;zerop&lt;/code&gt;) is that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In this approach there is &lt;em&gt;no&lt;/em&gt; variable in the resulting form, and&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The resulting form is a &lt;em&gt;list&lt;/em&gt;, not a function.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Number 1 means that you cannot use the variable for anything when the lambda form is used as a function, because, &lt;em&gt;Hey! - it isn't there&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it means that unless you explicitly go to the trouble of byte-compiling the resulting form (which is a list, whose car is &lt;code&gt;lambda&lt;/code&gt; etc.), evaluation is slower, because you are interpreting a list as a lambda form and that as a function - you do not have a (possibly byte-compiled) function directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When might you care whether you have a &lt;em&gt;variable&lt;/em&gt; at the time the function is used? When you need to do something with that variable &lt;em&gt;as a variable&lt;/em&gt;!  For example, you assign it another value than &lt;code&gt;function&lt;/code&gt; at some point.  In most cases you do &lt;em&gt;not&lt;/em&gt; need the variable as a variable - it is enough to have its &lt;em&gt;value&lt;/em&gt; (in this case, &lt;code&gt;zerop&lt;/code&gt;) when the function is used.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-05T15:51:23.697" LastActivityDate="2016-02-05T15:51:23.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20067" PostTypeId="2" ParentId="20062" CreationDate="2016-02-05T06:37:51.367" Score="2" Body="&lt;p&gt;Two ways to go:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Either write proper TeX expressions (instead of unicode) and let org just &lt;strong&gt;display&lt;/strong&gt; them as utf-8 characters (with &lt;code&gt;C-c C-x \&lt;/code&gt;) . &lt;a href=&quot;http://orgmode.org/manual/Special-symbols.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Special-symbols.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or 2) Load a TeX package which translates your utf-8 characters into the proper math expressions. For example &lt;a href=&quot;https://www.ctan.org/pkg/unicode-math?lang=en&quot; rel=&quot;nofollow&quot;&gt;https://www.ctan.org/pkg/unicode-math?lang=en&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2016-02-05T06:37:51.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20068" PostTypeId="2" ParentId="18999" CreationDate="2016-02-05T06:41:39.343" Score="0" Body="&lt;p&gt;you can also put COMMENT keyword first so subtasks will not be scanned for Scheduled tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i refile all DONE tasks to &quot;COMMENT Done&quot; and these DONE Task are not shown in Agenda&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;COMMENT Done&lt;/li&gt;&#xA;&lt;li&gt;** DONE asdfg&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Good point is that you can have bird eye view about which projects are commented, you dont have to look for ARCHIVE Tagged projects&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for such a poorly formatted answer&lt;/p&gt;&#xA;" OwnerUserId="10810" LastActivityDate="2016-02-05T06:41:39.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20070" PostTypeId="2" ParentId="20034" CreationDate="2016-02-05T10:53:16.710" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;M-x magit-status&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;m&lt;/kbd&gt; in magit status&lt;/li&gt;&#xA;&lt;li&gt;Activate the &quot;No fast-forward&quot; switch and do Merge but don't commit Action and press &lt;kbd&gt;m&lt;/kbd&gt; again&lt;/li&gt;&#xA;&lt;li&gt;Now your files are changed but not committed, so you can merge them with your last commit state when you press &lt;kbd&gt;e&lt;/kbd&gt; above the changed files&#xA;that will bring you ediff and you're able to review the changes&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope this will help you out.&lt;/p&gt;&#xA;" OwnerUserId="11003" LastEditorUserId="306" LastEditDate="2016-08-31T10:56:03.763" LastActivityDate="2016-08-31T10:56:03.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20071" PostTypeId="2" ParentId="18068" CreationDate="2016-02-05T11:01:20.233" Score="9" Body="&lt;p&gt;As of &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/rev-2-1&quot; rel=&quot;noreferrer&quot;&gt;markdown-mode 2.1&lt;/a&gt;, this is functionality is provided in &lt;code&gt;markdown-live-preview-mode&lt;/code&gt; (bound to &lt;code&gt;C-c C-c l&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It uses eww for rendering the HTML. Screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ICXHI.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ICXHI.png&quot; alt=&quot;live preview of markdown&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-02-05T11:01:20.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20072" PostTypeId="1" AcceptedAnswerId="20073" CreationDate="2016-02-05T13:11:51.343" Score="6" ViewCount="2335" Body="&lt;p&gt;I wan't to switch the keybinding in helm-find-files when I go one level up or go in to a folder. Now it looks like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;&quot;C-j&quot;&lt;/em&gt;&lt;/strong&gt; -&gt; go in to the folder&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;&quot;C-l&quot;&lt;/em&gt;&lt;/strong&gt; -&gt; go one level up&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For me, it's intuitive to switch them, so it will be the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;&quot;C-j&quot;&lt;/em&gt;&lt;/strong&gt; -&gt; go one level up&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;&quot;C-l&quot;&lt;/em&gt;&lt;/strong&gt; -&gt; go in to the folder&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I could replace the &lt;strong&gt;&lt;em&gt;&quot;C-j&quot;&lt;/em&gt;&lt;/strong&gt; to the one I wanted with this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;C-j&quot;) 'helm-find-files-up-one-level)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know what's the action's name to &quot;&lt;em&gt;go in to the folder&lt;/em&gt;&quot;. If I find it out, that could be a solution.&lt;/p&gt;&#xA;" OwnerUserId="11003" LastActivityDate="2016-02-05T13:44:56.277" Title="Helm-mode change default keybinding for &quot;helm-find-files-*&quot; * -&gt; &quot;down-one-level&quot; (?)" Tags="|key-bindings|init-file|helm|emacs24|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20073" PostTypeId="2" ParentId="20072" CreationDate="2016-02-05T13:44:56.277" Score="5" Body="&lt;p&gt;When running &lt;code&gt;helm-find-files&lt;/code&gt;, you should be able to use &lt;code&gt;C-h k C-j&lt;/code&gt; to find out what command will be run by &lt;code&gt;C-j&lt;/code&gt;, for me, it gives:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-j runs the command &lt;strong&gt;helm-execute-persistent-action&lt;/strong&gt; (found in&#xA;  &lt;strong&gt;helm-find-files-map&lt;/strong&gt;), which is an interactive Lisp closure in&#xA;  ‘helm.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to , C-j, C-z.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(helm-execute-persistent-action &amp;amp;optional (ATTR 'persistent-action)&#xA;  SPLIT-ONEWINDOW)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and to avoid affecting the key bindings in other helm commands, you should change &lt;code&gt;helm-find-files-map&lt;/code&gt; instead of &lt;code&gt;helm-map&lt;/code&gt;, so the following is probably what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-find-files-map (kbd &quot;C-j&quot;) 'helm-find-files-up-one-level)&#xA;(define-key helm-find-files-map (kbd &quot;C-l&quot;) 'helm-execute-persistent-action)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-02-05T13:44:56.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20074" PostTypeId="1" AcceptedAnswerId="20077" CreationDate="2016-02-05T13:50:34.167" Score="1" ViewCount="225" Body="&lt;p&gt;I'm using recentf-mode, part of Emacs. I'd like to open a file from the &lt;em&gt;Open Recent&lt;/em&gt; buffer read-only, like if I had opened it via C-x C-r. Maybe if you type C-u in the &lt;em&gt;Open Recent&lt;/em&gt; buffer before clicking on the file or typing its number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="2334" LastActivityDate="2016-02-05T14:26:42.203" Title="&quot;Recentf&quot;: Open file from *Open Recent* Buffer, but read-only" Tags="|read-only-mode|recentf|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20076" PostTypeId="2" ParentId="20054" CreationDate="2016-02-05T14:19:13.157" Score="3" Body="&#xA;&#xA;&lt;p&gt;This is what I did:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I put this code in my init.el:  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-turn-current-window-into-frame ()&#xA;  (interactive)&#xA;  (let ((buffer (current-buffer)))&#xA;    (unless (one-window-p)&#xA;      (delete-window))&#xA;    (display-buffer-pop-up-frame buffer nil)))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f12&amp;gt;&quot;) #'my-turn-current-window-into-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I restarted Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;I issued F12.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The current window was turned into a frame.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="115" LastEditDate="2016-02-05T20:56:02.920" LastActivityDate="2016-02-05T20:56:02.920" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20077" PostTypeId="2" ParentId="20074" CreationDate="2016-02-05T14:26:42.203" Score="3" Body="&lt;p&gt;You can customize &lt;code&gt;recentf-menu-action&lt;/code&gt;, from &lt;code&gt;C-h v recentf-menu-action&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;recentf-menu-action is a variable defined in ‘recentf.el’. Its value&#xA;  is ‘find-file’&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: Function to invoke with a filename item of the recentf&#xA;  menu. The default is to call ‘find-file’ to edit the selected file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;the default value is &lt;code&gt;find-file&lt;/code&gt;, so if you always want read-only, you can just change it to &lt;code&gt;find-file-read-only&lt;/code&gt;, if you only want read-only when with &lt;code&gt;C-u&lt;/code&gt;, you can write a new function as its value, for example,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun find-file-maybe-read-only (f)&#xA;  (if current-prefix-arg&#xA;      (find-file-read-only f)&#xA;    (find-file f)))&#xA;&#xA;(setq recentf-menu-action 'find-file-maybe-read-only)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notes: prefix arguments doesn't work for number, e.g., &lt;code&gt;C-u 2&lt;/code&gt; doesn't work, though both &lt;code&gt;C-u RET&lt;/code&gt; and &lt;code&gt;C-u Clicking&lt;/code&gt; work.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-02-05T14:26:42.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20078" PostTypeId="1" CreationDate="2016-02-05T16:20:39.920" Score="1" ViewCount="305" Body="&lt;p&gt;I use C-h instead of backspace, and it does not work in helm's minibuffer, however it works in normal minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The related section from my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;&amp;lt;backspace&amp;gt;&quot;))&#xA;(global-unset-key (kbd &quot;C-h&quot;))&#xA;(global-set-key (kbd &quot;C-h&quot;) 'delete-backward-char)&#xA;(global-unset-key (kbd &quot;&amp;lt;f1&amp;gt;&quot;))&#xA;(global-set-key (kbd &quot;&amp;lt;f1&amp;gt;&quot;) help-map)&#xA;(global-unset-key (kbd &quot;M-h&quot;))&#xA;(global-set-key (kbd &quot;s-h&quot;) 'mark-paragraph)&#xA;(global-set-key (kbd &quot;M-h&quot;) 'backward-kill-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-04-05T19:34:31.423" Title="custom delete-backward-char key-binding does not work in helm" Tags="|key-bindings|helm|keymap|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20079" PostTypeId="2" ParentId="20056" CreationDate="2016-02-05T17:21:57.737" Score="2" Body="&lt;p&gt;TL;DR wrap gdb in a script that has been put in your path like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-bash prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/bash&#xA;gdb -i=mi &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then call it with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x gdb&#xA;rr replay -d name_of_script_i_just_created&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If that doesn't work either address the error message in rr to stop it complaining, or patch &lt;code&gt;gdb.el&lt;/code&gt; as mentioned below. Long version below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alright, I figured it out. It does, (currently) require a bit of a patch to &lt;code&gt;gdb.el&lt;/code&gt; and requires an extra bash file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rr is able to specify the debugger it uses with &lt;code&gt;-d&lt;/code&gt; so first you create a wrapped gdb with &lt;code&gt;-i=mi&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-bash prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/bash&#xA;gdb -i=mi &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which we have called something like gdb-rr-emacs (and which we have added to our path). You can then specify that rr uses that by doing &lt;code&gt;rr replay -d gdb-rr-emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If however we have enabled &lt;code&gt;gdb-many-windows&lt;/code&gt; and then try and do this we get an error message saying:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error: you did not specify -i=mi on GDB's command line!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;along with a bunch of junk showing that we definitely did specify &lt;code&gt;-i=mi&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only happens when an error message is displayed at the start of running rr like so:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;rr: Warning: Your CPU frequency governor is 'ondemand'.  rr strongly&#xA;      recommends that you use the 'performance' governor.  Not using the&#xA;      'performance' governor can cause rr to be at least 2x slower&#xA;      on laptops.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;On Fedora-based systems, you can enable the 'performance' governor&#xA;by running the following commands:&#xA;&#xA;$ sudo dnf install kernel-tools&#xA;$ sudo cpupower frequency-set -g performance&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so you can either disable this warning, (as suggested) or do some code-diving (see below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when we do some code-diving we find that this error message comes from a function &lt;code&gt;gdb--check-interpreter&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at this function we see it looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun gdb--check-interpreter (filter proc string)&#xA;  (unless (zerop (length string))&#xA;    (remove-function (process-filter proc) #'gdb--check-interpreter)&#xA;    (unless (memq (aref string 0) '(?^ ?~ ?@ ?&amp;amp; ?* ?=))&#xA;      ;; Apparently we're not running with -i=mi.&#xA;      (let ((msg &quot;Error: you did not specify -i=mi on GDB's command line!&quot;))&#xA;        (message msg)&#xA;        (setq string (concat (propertize msg 'font-lock-face 'error)&#xA;                             &quot;\n&quot; string)))&#xA;      ;; Use the old gud-gbd filter, not because it works, but because it&#xA;      ;; will properly display GDB's answers rather than hanging waiting for&#xA;      ;; answers that aren't coming.&#xA;      (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter)&#xA;            )&#xA;    (funcall filter proc string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if we change it to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun gdb--check-interpreter (filter proc string)&#xA;  (unless (zerop (length string))&#xA;(remove-function (process-filter proc) #'gdb--check-interpreter)&#xA;(unless (memq (aref string 0) '(?^ ?~ ?@ ?&amp;amp; ?* ?=))&#xA;  ;; Apparently we're not running with -i=mi.&#xA;  (let ((msg &quot;Error: you did not specify -i=mi on GDB's command line! Luckily I don't care!&quot;))&#xA;    (message msg)&#xA;    (setq string (concat (propertize msg 'font-lock-face 'error)&#xA;             &quot;\n&quot; string))))&#xA;(funcall filter proc string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or similar we will then be able to start our rr session in gdb-many-window mode with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-bash prettyprint-override&quot;&gt;&lt;code&gt;M-x gdb&#xA;rr replay -d gdb-rr-emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5199" LastEditorUserId="5199" LastEditDate="2016-02-05T18:21:33.917" LastActivityDate="2016-02-05T18:21:33.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20080" PostTypeId="1" AcceptedAnswerId="20084" CreationDate="2016-02-05T17:22:18.190" Score="7" ViewCount="693" Body="&lt;p&gt;Is there any way to set a custom face for the echo area (and, by extension, the Isearch input text)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far my searching hasn't turned up anything, except that it seems like there isn't a way to modify this. Is that correct? &lt;/p&gt;&#xA;" OwnerUserId="7113" LastActivityDate="2016-02-05T18:25:20.463" Title="Echo Area font face?" Tags="|faces|font-lock|echo-area|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20081" PostTypeId="1" AcceptedAnswerId="20090" CreationDate="2016-02-05T17:31:04.283" Score="0" ViewCount="462" Body="&lt;p&gt;Elpy works in every buffer automaticly, however I wan it to work only with python files. The related section of my init.el is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'elpy)&#xA;(elpy-use-ipython)&#xA;(setq-default indent-tabs-mode nil)&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.py\\'&quot; . elpy-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I clarify my question: Elpy as a minor mode is activated in all of my buffers, and shadows important key-bindings such as C-c C-c for magit.&lt;/p&gt;&#xA;" OwnerUserId="10978" LastEditorUserId="10978" LastEditDate="2016-02-05T18:16:35.757" LastActivityDate="2016-02-05T18:34:20.780" Title="Force elpy to work only with .py extension files" Tags="|hooks|elpy|" AnswerCount="1" CommentCount="3" ClosedDate="2020-01-24T15:06:44.290" ContentLicense="CC BY-SA 3.0" />
  <row Id="20082" PostTypeId="1" AcceptedAnswerId="20085" CreationDate="2016-02-05T17:33:50.397" Score="3" ViewCount="68" Body="&lt;p&gt;While I am developing some elisp package I find myself &lt;code&gt;edebug-defun&lt;/code&gt;'ing the same critical functions &lt;code&gt;foo-some-mess&lt;/code&gt; and &lt;code&gt;bar-more&lt;/code&gt; everytime I modify them, or everytime I load the code after compiling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tell emacs &lt;em&gt;once and for all&lt;/em&gt; that these two functions must be stepped through with &lt;code&gt;edebug&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="1992" LastActivityDate="2016-02-05T18:12:06.187" Title="edebug-defun at compile-time or at eval-buffer time?" Tags="|edebug|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20084" PostTypeId="2" ParentId="20080" CreationDate="2016-02-05T17:49:08.440" Score="6" Body="&#xA;&#xA;&lt;p&gt;Sure you can, (see &lt;a href=&quot;https://stackoverflow.com/questions/2742435/in-emacs-how-do-i-display-a-message-in-the-minibuffer-with-font-face-properties&quot;&gt;this SO question&lt;/a&gt;) although it seems a bit heavy-handed.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nadvice/message-color (old-fun &amp;amp;optional str &amp;amp;rest args)&#xA;  (if (not str)&#xA;      (funcall old-fun)&#xA;    (funcall old-fun &quot;%s&quot; (propertize (apply #'format str args)&#xA;                                      'face '(:foreground &quot;red&quot;)))))&#xA;&#xA;(advice-add 'message :around #'nadvice/message-color)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A cleaner solution would be to only override the face for messages produced by specific pieces of code.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; for example&#xA;(cl-letf* ((old-message (symbol-function #'message))&#xA;           ((symbol-function #'message)&#xA;            (lambda (&amp;amp;optional str &amp;amp;rest args)&#xA;              (if (not str)&#xA;                  (funcall old-message)&#xA;                (funcall old-message &quot;%s&quot;&#xA;                         (propertize (apply #'format str args)&#xA;                                     'face '(:foreground &quot;red&quot;)))))))&#xA;  (message &quot;hi!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So naturally, you can combine these two techniques:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nadvice/isearch-color (old-fun &amp;amp;rest args)&#xA;  (cl-letf* ((old-message (symbol-function #'message))&#xA;             ((symbol-function #'message)&#xA;              (lambda (&amp;amp;optional str &amp;amp;rest iargs)&#xA;                (if (not str)&#xA;                    (funcall old-message)&#xA;                  (funcall old-message &quot;%s&quot;&#xA;                           (propertize (apply #'format str iargs)&#xA;                                       'face '(:foreground &quot;red&quot;)))))))&#xA;    (apply old-fun args)))&#xA;&#xA;(advice-add 'isearch-forward :around #'nadvice/isearch-color)&#xA;(advice-add 'isearch-backward :around #'nadvice/isearch-color)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-02-05T18:25:20.463" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20085" PostTypeId="2" ParentId="20082" CreationDate="2016-02-05T17:55:48.690" Score="4" Body="&lt;p&gt;You may be able to do this by surrounding definitions of function you want to instrument with &lt;code&gt;(edebug-all-defs)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(edebug-all-defs)&#xA;&#xA;;; this one is instrumented&#xA;(defun foo ()&#xA;  (bar))&#xA;&#xA;;; this one is, too&#xA;(defun bar ()&#xA;  (message &quot;hi!&quot;))&#xA;&#xA;(edebug-all-defs)&#xA;&#xA;;; this one is not&#xA;(defun baz ()&#xA;  (bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt; are instrumented, and &lt;code&gt;baz&lt;/code&gt; is not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this by pressing &lt;code&gt;C-h k C-M-x&lt;/code&gt; and reading the doc. string, which pointed me to &lt;code&gt;edebug-all-defs&lt;/code&gt;. Its documentation string says this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;edebug-all-defs&lt;/code&gt; is a variable defined in &lt;code&gt;edebug.el&lt;/code&gt;.&#xA;  Its value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If non-nil, evaluating defining forms instruments for Edebug.&#xA;  This applies to &lt;code&gt;eval-defun&lt;/code&gt;, &lt;code&gt;eval-region&lt;/code&gt;, &lt;code&gt;eval-buffer&lt;/code&gt;, and&#xA;  &lt;code&gt;eval-current-buffer&lt;/code&gt;.  &lt;code&gt;eval-region&lt;/code&gt; is also called by&#xA;  &lt;code&gt;eval-last-sexp&lt;/code&gt;, and &lt;code&gt;eval-print-last-sexp&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can use the command &lt;code&gt;edebug-all-defs&lt;/code&gt; to toggle the value of this&#xA;  variable.  You may wish to make it local to each buffer with&#xA;  &lt;code&gt;(make-local-variable 'edebug-all-defs)&lt;/code&gt; in your&#xA;  &lt;code&gt;emacs-lisp-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-02-05T17:55:48.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20086" PostTypeId="2" ParentId="20078" CreationDate="2016-02-05T18:10:32.097" Score="1" Body="&lt;p&gt;Thanks to Constantine I solved the problem, the only difference that newer helm use C-h C-d for the &lt;strong&gt;helm-enable-or-switch-to-debug&lt;/strong&gt; function. So it still can be unbound as Constantine advised.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;C-h&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if somebody really needs that function, it should be rebound to some other keys:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-map (kbd &quot;s-w&quot;)  'helm-enable-or-switch-to-debug)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I used grep to find this out.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;➜  helm git:(master) grep -Rn &quot;C-h&quot;                  &#xA;README.md:165:Once you are in the helm session (of `helm-M-x` or any one else) you can hit either `C-h m` or&#xA;README.md:168:Sometime `C-c ?` is not available, in this case you will see in mode-line `C-h m` instead of `C-c ?`.&#xA;README.md:273:- `helm-apropos`: Description of functions, variables, etc... Use it instead of Most `C-h` commands.&#xA;helm-files.el:758:                       &quot;C-h m: Help, \\[universal-argument]: Insert output at point&quot;)&#xA;helm.el:238:    (define-key map (kbd &quot;C-h C-d&quot;)    'undefined)&#xA;helm.el:239:    (define-key map (kbd &quot;C-h C-d&quot;)    'helm-enable-or-switch-to-debug)&#xA;helm.el:242:    (define-key map (kbd &quot;C-h C-h&quot;)    'undefined)&#xA;helm.el:243:    (define-key map (kbd &quot;C-h h&quot;)      'undefined)&#xA;helm.el:817:C-h m\t\tRun this generic help for helm.&#xA;emacs-helm.sh:77:;; You will find embeded help for most helm commands with \`C-h m'.\n\&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-02-05T18:10:32.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20087" PostTypeId="2" ParentId="20082" CreationDate="2016-02-05T18:12:06.187" Score="1" Body="&lt;p&gt;The usual way is: if it hurts, don't do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, don't &quot;compile + load&quot; the code, but edit the code directly in the Emacs where you perform the tests, and after changing the code just do &lt;code&gt;C-u C-M-x&lt;/code&gt; or &lt;code&gt;C-M-x&lt;/code&gt; (according to whether the changed code should be stepped or not).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-02-05T18:12:06.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20089" PostTypeId="1" AcceptedAnswerId="20232" CreationDate="2016-02-05T18:29:52.757" Score="4" ViewCount="199" Body="&lt;p&gt;With the PHP-mode that's shipped with Emacs, suppose I have the following PHP function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public function foo() &#xA;{&#xA;    print &quot;bar&quot;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Imenu will list the &lt;code&gt;foo&lt;/code&gt; in all methods and public methods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other packages like Helm and Ido use the same Imenu, which causes my functions to be double listed. When I call &lt;code&gt;helm-imenu&lt;/code&gt; that uses the imenu source, I see my functions double listed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gets listed in helm-imenu as &lt;code&gt;All methods / foo&lt;/code&gt; and &lt;code&gt;public methods / foo&lt;/code&gt;. I see the same in ido-imenu. &#xA;I would like to reduce that to only the methods get listed once, instead double. And in Emacs nearly everything is scriptable, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make it more clear what I'm meaning, a screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SlIGp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SlIGp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes it makes it very confusing for me, when navigating around in the codebase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So any suggestion how I could handle this?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-02-11T21:01:23.527" LastActivityDate="2016-02-11T21:45:11.140" Title="My imenu-entries get double listed. How could I correct that?" Tags="|ido|imenu|helm-sources|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20090" PostTypeId="2" ParentId="20081" CreationDate="2016-02-05T18:34:20.780" Score="1" Body="&lt;p&gt;The problem was that I added elpy-mode as hook for flyspell-prog-mode before I enabled elpy, so it activated it globally. I wrote that part of my config one week after I started using Emacs half year ago, So it was easy to forget. &lt;/p&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-02-05T18:34:20.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20091" PostTypeId="1" CreationDate="2016-02-05T18:41:00.720" Score="1" ViewCount="1529" Body="&lt;p&gt;I am trying out the Python 3 type hinting with this example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from typing import List&#xA;&#xA;def greeting(names: List[str]) -&amp;gt; str:&#xA;        return 'Hello, {}'.format(', '.join(names))&#xA;&#xA;greeting(['jane', 'john', 'judy'])    &#xA;&#xA;&#xA;greeting([1,2,3])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I should see is an error on the last method call, but no error on the first. However, on both I see the error &lt;code&gt;deferred error : (error &quot;\&quot;TypeError('expected string or buffer',)\&quot;&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another package that can do type hinting/way I can fix Jedi here?&lt;/p&gt;&#xA;" OwnerUserId="10211" LastEditorUserId="2292" LastEditDate="2023-12-07T14:34:08.017" LastActivityDate="2024-01-06T15:04:40.513" Title="getting Jedi to work with type hinting (Python)" Tags="|python|flycheck|jedi|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="20092" PostTypeId="1" AcceptedAnswerId="20093" CreationDate="2016-02-05T19:22:33.657" Score="27" ViewCount="16959" Body="&lt;p&gt;What is the best way to use &lt;a href=&quot;http://conda.pydata.org/docs/&quot; rel=&quot;noreferrer&quot;&gt;conda environmets&lt;/a&gt; using emacs as a Python IDE?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have got different conda environments while programming in Python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ conda info -e&#xA;# conda environments:&#xA;#&#xA;django                   /Users/Pablo/anaconda/envs/django&#xA;scipy                 *  /Users/Pablo/anaconda/envs/scipy&#xA;visual                   /Users/Pablo/anaconda/envs/visual&#xA;ml                       /Users/Pablo/anaconda/envs/ml&#xA;root                     /Users/Pablo/anaconda&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I use &lt;kbd&gt;crtl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;crtl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; emacs only uses my the Mac OS X default Python PATH. How can I chage it between all the different conda environments?&lt;/p&gt;&#xA;" OwnerUserId="11020" LastActivityDate="2021-03-18T13:16:12.637" Title="Using conda environments in emacs" Tags="|python|osx|path|environment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20093" PostTypeId="2" ParentId="20092" CreationDate="2016-02-05T20:52:34.240" Score="26" Body="&lt;p&gt;I'd suggest using &lt;a href=&quot;https://github.com/jorgenschaefer/pyvenv&quot; rel=&quot;noreferrer&quot; title=&quot;pyvenv&quot;&gt;pyvenv&lt;/a&gt; library, it provides a neat interface to selecting a virtual env among several alternatives updating interpreter and library paths. You will need to alter WORKON_HOME variable (it defaults to &lt;code&gt;$HOME/.virtualenvs&lt;/code&gt; used by virtualenvwrapper).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;WORKON_HOME&quot; &quot;/Users/Pablo/anaconda/envs&quot;)&#xA;(pyvenv-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that choose the environment with &lt;kbd&gt;M-x pyvenv-workon&lt;/kbd&gt;. &lt;/p&gt;&#xA;" OwnerUserId="533" LastActivityDate="2016-02-05T20:52:34.240" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20094" PostTypeId="1" AcceptedAnswerId="20110" CreationDate="2016-02-05T22:47:01.150" Score="1" ViewCount="229" Body="&lt;p&gt;I use a monitor and a laptop screen as my multimonitor setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the monitor and the laptop differs in resolution.&#xA;So I use 2 frames, one frame on the monitor and one frame on the laptop screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both frames are connected to one Emacs instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MONITOR&lt;/strong&gt;:&#xA;I will call the frame that's opened on monitor as &lt;code&gt;frame 1&lt;/code&gt;.&#xA;In the &lt;code&gt;frame 1&lt;/code&gt; on the monitor, I have a buffer opened with the default SQL-mode that's shipped with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;LAPTOP&lt;/strong&gt;:&#xA;On the laptop screen, there is a SQL-process being displayed in the Emacs &lt;code&gt;frame 2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SITUATION&lt;/strong&gt;:&#xA;In the &lt;code&gt;frame 1&lt;/code&gt;, in the buffer with SQL-mode, I call &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;sql-send-region&lt;/code&gt; to send a SQL-statement to the SQL-process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see the result on the laptop screen in &lt;code&gt;frame 2&lt;/code&gt;. But in the meanwhile, the SQL-mode propably have detected there is no window in the Emacs &lt;code&gt;frame 1&lt;/code&gt;, so Emacs opens a new window with the same buffer of the SQL-process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the result, there are two windows on two screens, viewing the same buffer (the SQL-process).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prevent that the SQL-mode opens a new window when sending a SQL-statement to the SQL-process. How could I 'tell' Emacs to prevent that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; as answered below, this question is solved by now. See the second option from the user &lt;code&gt;bmag&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-02-06T14:32:09.173" LastActivityDate="2016-02-06T16:15:38.850" Title="Avoid to create a new window in sql mode" Tags="|emacsclient|sql|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20095" PostTypeId="1" AcceptedAnswerId="20097" CreationDate="2016-02-05T22:48:47.670" Score="1" ViewCount="161" Body="&lt;p&gt;Recently I found out about &lt;code&gt;isearch-forward-symbol-at-point&lt;/code&gt; but in tcl it's rather useless, because when dereferencing a variable the &lt;code&gt;$&lt;/code&gt; is part of the symbol and so the &lt;code&gt;symbol-at-point&lt;/code&gt; &lt;code&gt;$var&lt;/code&gt; does not match &lt;code&gt;${var}&lt;/code&gt; or &lt;code&gt;var&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following example code look at each symbol with &lt;code&gt;M-: (symbol-at-point)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set var 1&#xA;puts &quot;var = $var&quot;&#xA;puts &quot;${var}23&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Funny enough the syntax highlighting clearly differentiates between the symbol and the syntactic character. In perl-mode this is working well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is: what has to be changed in &lt;em&gt;tcl.el&lt;/em&gt; (the one that comes with emacs 24.5.1) to exclude &lt;code&gt;$&lt;/code&gt; from  the symbol?&lt;/p&gt;&#xA;" OwnerUserId="934" LastActivityDate="2016-02-05T23:18:08.560" Title="How to make $ not part of a symbol in tcl-mode?" Tags="|major-mode|syntax|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20096" PostTypeId="2" ParentId="20095" CreationDate="2016-02-05T23:04:21.303" Score="1" Body="&lt;p&gt;Adding a hook that modifies the syntax of &lt;code&gt;$&lt;/code&gt; as suggested by a FIXME comment in &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/8a9ba4d67bfb3b9cf96cff2917fec1fa7a168724/lisp/progmodes/tcl.el#L248&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;tcl.el&lt;/code&gt;&lt;/a&gt; seems to work:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-tcl-modify-dollar-syntax ()&#xA;  (modify-syntax-entry ?$ &quot;'&quot; tcl-mode-syntax-table))&#xA;&#xA;(add-hook 'tcl-mode-hook #'my-tcl-modify-dollar-syntax)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-02-05T23:04:21.303" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20097" PostTypeId="2" ParentId="20095" CreationDate="2016-02-05T23:18:08.560" Score="2" Body="&lt;p&gt;With a bit of searching I found that syntactic elements like parentheses, comment delimiters, characters that can be used for syntactic symbols and others are managed by a &lt;em&gt;syntax table&lt;/em&gt; (look it up in the &lt;em&gt;elisp reference manual&lt;/em&gt;) .  With the help of &lt;code&gt;describe-syntax&lt;/code&gt; I compared the syntax tables for &lt;em&gt;perl-mode&lt;/em&gt; and &lt;em&gt;tcl-mode&lt;/em&gt;. In &lt;em&gt;perl-mode&lt;/em&gt; the character &lt;code&gt;$&lt;/code&gt; is given the class &lt;em&gt;character quote&lt;/em&gt; but in &lt;em&gt;tcl-mode&lt;/em&gt; it is class &lt;em&gt;symbol&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the solution is, to give &lt;code&gt;$&lt;/code&gt; another class than &lt;em&gt;symbol&lt;/em&gt; but I think, &lt;em&gt;character quote&lt;/em&gt; is not the right one, because the manual states about this class:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Characters used to quote the following character so that it loses&#xA;  its normal syntactic meaning.  This differs from an escape&#xA;  character in that only the character immediately following is ever&#xA;  affected.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;AFAIK the class &lt;em&gt;expression prefix&lt;/em&gt; is far better suited:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Characters used for syntactic operators that are considered as part&#xA;  of an expression if they appear next to one.  In Lisp modes, these&#xA;  characters include the apostrophe, ‘'’ (used for quoting), the&#xA;  comma, ‘,’ (used in macros), and ‘#’ (used in the read syntax for&#xA;  certain data types).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h2&gt;tl;dr&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The following form changes the tcl syntax table after it is defined:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;tcl&quot;&#xA;  (modify-syntax-entry ?$ &quot;'&quot; tcl-mode-syntax-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-eval-after-load&lt;/code&gt; was introduced in 24.4 for older version, there is the function &lt;code&gt;eval-after-load&lt;/code&gt; (see: &lt;a href=&quot;https://stackoverflow.com/questions/21880139/what-is-with-eval-after-load-in-emacs-lisp&quot;&gt;What is “with-eval-after-load” in Emacs Lisp&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="934" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-02-05T23:18:08.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20098" PostTypeId="1" AcceptedAnswerId="20226" CreationDate="2016-02-05T23:34:51.260" Score="5" ViewCount="203" Body="&lt;p&gt;I love to start emacs in daemon mode with my first login and then have the same emacs process for all subsequent logins, be it graphical, on physical console or from the network via ssh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is a problem with this, when using a session to save the last open files and some of this files are encrypted (e.g. with gpg) and ask for the decryption key on load. Then the application is frozen and waits for an input from a disconnected &lt;em&gt;stdin&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I defer the question to the first time interactively changing to the buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, how can I exclude the encrypted files from the session?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And maybe there is just another solution.&lt;/p&gt;&#xA;" OwnerUserId="934" LastActivityDate="2016-02-11T11:38:04.633" Title="How to start in daemon mode and suppress interactive dialogs?" Tags="|emacs-daemon|gpg|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20099" PostTypeId="1" AcceptedAnswerId="20916" CreationDate="2016-02-06T00:02:17.823" Score="2" ViewCount="1822" Body="&lt;p&gt;I quite like &lt;a href=&quot;http://tmux.github.io&quot; rel=&quot;nofollow&quot;&gt;tmux&lt;/a&gt; and &lt;a href=&quot;http://aquamacs.org&quot; rel=&quot;nofollow&quot;&gt;Aquamacs&lt;/a&gt;. I've recently been interested in how to integrate the two together. As far as I know, one cannot run Aquamacs within a terminal even with the Aquamacs CLI tool, so the next natural option is to run tmux in Aquamacs via something like Emacs' shell mode. Unfortunately, I've been running into some bottlenecks in doing this. Namely, running tmux from shell mode throws an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ tmux attach -t 0 # same thing happens by just running `$ tmux`&#xA;tmux attach -t 0&#xA;open terminal failed: terminal does not support clear&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've been searching for Aquamacs / tmux integration, but haven't found much. It seems like most folks are content to just use Emacs in the shell within tmux, but unfortunately this isn't an option for Aquamacs as stated above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that the error stated below in the comments (&lt;code&gt;open terminal failed: can't find terminfo database&lt;/code&gt;) also happens in vanilla Emacs, even on Linux.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2016-03-06T04:07:43.573" LastActivityDate="2016-03-11T07:45:35.040" Title="How to run tmux in Aquamacs" Tags="|shell|shell-mode|aquamacs|term|terminfo|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20100" PostTypeId="1" AcceptedAnswerId="20102" CreationDate="2016-02-06T01:09:05.260" Score="6" ViewCount="611" Body="&lt;p&gt;I wonder how could I disable this annoying square which seems like it's zooming in the text under the emacs' cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get rid of it? And what is this exactly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am on emacs 24.5 (homebrew installed) and MacOS X El Capitán.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dRoTd.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dRoTd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11020" LastEditorUserId="25" LastEditDate="2016-07-25T07:41:40.883" LastActivityDate="2016-07-25T07:41:40.883" Title="What is this square in the middle of the emacs' GUI?" Tags="|gui-emacs|bell|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20101" PostTypeId="1" AcceptedAnswerId="20105" CreationDate="2016-02-06T01:52:47.560" Score="0" ViewCount="809" Body="&lt;p&gt;I just started out on emacs so this might have a really simple answer. I'm getting an error message on startup and have no idea what it means. The debug message doesn't help much either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do these messages mean and how can I rectify the error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on emacs 24.4.1, Debian 8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When starting up emacs I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/user/.emacs.d/init.el':&#xA;&#xA;Symbol's value as variable is void: elpy-modules&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looking through my &lt;code&gt;.emacs/init.el&lt;/code&gt;, I can't find anything what looks like a variable called &lt;code&gt;elpy-module&lt;/code&gt; (however I don't know lisp, so perhaps that's part of the issue).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When starting with &lt;code&gt;emacs --debug-init&lt;/code&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable elpy-modules)&#xA;  (delq (quote elpy-module-flymake) elpy-modules)&#xA;  (setq elpy-modules (delq (quote elpy-module-flymake) elpy-modules))&#xA;  (progn (setq elpy-modules (delq (quote elpy-module-flymake) elpy-modules)) (add-hook (quote elpy-mode-hook) (quote flycheck-mode)))&#xA;  (if (require (quote flycheck) nil t) (progn (setq elpy-modules (delq (quote elpy-module-flymake) elpy-modules)) (add-hook (quote elpy-mode-hook) (quote flycheck-mode))))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/user/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 1923&#xA;  load-with-code-conversion(&quot;/home/user/.emacs.d/init.el&quot; &quot;/home/user/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/user/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11028" LastActivityDate="2016-02-06T02:53:39.860" Title="Cryptic startup error messages" Tags="|init-file|debugging|start-up|error-handling|debian|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20102" PostTypeId="2" ParentId="20100" CreationDate="2016-02-06T02:10:26.923" Score="8" Body="&lt;p&gt;I think the cause of the problem is &lt;code&gt;visible-bell&lt;/code&gt;. Just put the following to your .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ring-bell-function 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to get rid of both audible and visible bell&lt;/p&gt;&#xA;" OwnerUserId="2050" LastActivityDate="2016-02-06T02:10:26.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20103" PostTypeId="1" CreationDate="2016-02-06T02:28:03.113" Score="6" ViewCount="307" Body="&lt;p&gt;Emacs 25.1 obsoletes a variable &lt;code&gt;isearch-word&lt;/code&gt; and recommends to use the new &lt;code&gt;isearch-regexp-function&lt;/code&gt; instead.  Because Emacs 24 does not have the new variable, I can't just replace it like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if isearch-regexp-function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the best way to support both Emacs 24 and Emacs 25?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to just suppress the warning with &lt;code&gt;with-no-warnings&lt;/code&gt;, which is already answered here: &quot;&lt;a href=&quot;https://emacs.stackexchange.com/questions/9802&quot;&gt;How to avoid obsolete warning when defining a compatibility alias?&lt;/a&gt;&quot;&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-07T00:11:22.517" Title="Best way to support obsolete variables" Tags="|variables|version-support|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20104" PostTypeId="2" ParentId="20103" CreationDate="2016-02-06T02:42:04.933" Score="3" Body="&lt;p&gt;Use &lt;code&gt;boundp&lt;/code&gt; to test for the variable's existence:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(boundp SYMBOL)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return &lt;code&gt;t&lt;/code&gt; if SYMBOL's value is not void.&#xA;  Note that if &lt;code&gt;lexical-binding&lt;/code&gt; is in effect, this refers to the&#xA;  global value outside of any lexical scope.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (boundp 'isearch-regexp-function)&#xA;    (do-the-new-thing)&#xA;  (do-the-old-thing))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-06T02:42:04.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20105" PostTypeId="2" ParentId="20101" CreationDate="2016-02-06T02:53:39.860" Score="3" Body="&lt;p&gt;Your init file needs to load the code that defines &lt;code&gt;elpy-mode&lt;/code&gt; before it does the code that uses &lt;code&gt;elpy-mode&lt;/code&gt; (i.e., before the &lt;code&gt;(if (require 'flycheck)...)&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to add &lt;code&gt;(require 'elpy)&lt;/code&gt; before that &lt;code&gt;if&lt;/code&gt; code (assuming that the library that defines &lt;code&gt;elpy-mode&lt;/code&gt; is &lt;code&gt;elpy.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-06T02:53:39.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20106" PostTypeId="2" ParentId="20094" CreationDate="2016-02-06T04:13:23.137" Score="1" Body="&lt;p&gt;Untested, as I don't use &lt;code&gt;sql-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nadvice/sql-send-string (old-fun &amp;amp;rest args)&#xA;  (cl-letf* (((old-display-buffer (symbol-function #'display-buffer))&#xA;              ((symbol-function #'display-buffer)&#xA;               (lambda (buffer-or-name &amp;amp;rest iargs)&#xA;                 (unless (get-buffer-window-list buffer-or-name)&#xA;                   (apply old-display-buffer buffer-or-name iargs))))))&#xA;    (apply old-fun args)))&#xA;&#xA;(advice-add 'sql-send-string :around #'nadvice/sql-send-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-02-06T16:15:38.850" LastActivityDate="2016-02-06T16:15:38.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20107" PostTypeId="1" CreationDate="2016-02-06T04:16:36.567" Score="8" ViewCount="456" Body="&lt;p&gt;Emacs has self-documentation as one of its goals, and it achieves this pretty well for Emacs Lisp with commands like &lt;code&gt;describe-variable&lt;/code&gt;, &lt;code&gt;describe-function&lt;/code&gt;, etc. Packages like &lt;a href=&quot;https://github.com/expez/company-quickhelp&quot; rel=&quot;noreferrer&quot;&gt;company-quickhelp&lt;/a&gt; make this even more convenient by providing help in tooltips, which reduces the need to constantly switch attention to a Help buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The built-in Info reader is also very convenient for browsing Info manuals. &lt;code&gt;Helm&lt;/code&gt; improves upon this by providing &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki/Info-Files&quot; rel=&quot;noreferrer&quot;&gt;helm-info&lt;/a&gt;, which allows for choosing from all installed Info files and searching a file's index via incremental completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find the above tools important because, by making documentation look-up easier, they encourage me to do more of it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it's difficult to replicate the ease with which I can look up documentation about Emacs, Emacs Lisp, etc. with other tools and languages. For example, if I forget what a CSS rule does, I still find myself Googling for answers, which is slow and shifts attention away from Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what are some good ways (both general and specific to particular tools/languages) to look-up documentation or check manuals in Emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Common Lisp, for example, has &lt;a href=&quot;https://github.com/slime/slime&quot; rel=&quot;noreferrer&quot;&gt;SLIME&lt;/a&gt;, which tries to do for Common Lisp what Emacs does for Emacs Lisp, although it doesn't get as far because many references are made to the &lt;a href=&quot;http://www.lispworks.com/documentation/HyperSpec/Front/&quot; rel=&quot;noreferrer&quot;&gt;Common Lisp HyperSpec&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2016-02-19T01:23:12.110" LastActivityDate="2016-02-19T01:23:12.110" Title="Good ways to access documentation?" Tags="|documentation|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20108" PostTypeId="2" ParentId="19823" CreationDate="2016-02-06T07:25:16.347" Score="2" Body="&lt;p&gt; &#xA;Something like this should do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yashi/org-timestamp-cycle-up (arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (yashi/org-timestamp-cycle (prefix-numeric-value arg)))&#xA;&#xA;(defun yashi/org-timestamp-cycle-down (arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (yashi/org-timestamp-cycle (- (prefix-numeric-value arg))))&#xA;&#xA;(defun yashi/org-timestamp-cycle (cycle)&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((repeat (org-get-repeat)))&#xA;    (string-match &quot;\\([.+]\\)?\\(\\+[0-9]+\\)\\([dwmy]\\)&quot; repeat)&#xA;    (let ((n (string-to-number (match-string 2 repeat)))&#xA;          (what (match-string 3 repeat))&#xA;          (whata '((&quot;d&quot; . day) (&quot;m&quot; . month) (&quot;y&quot; . year))))&#xA;      (when (string= what &quot;w&quot;)&#xA;        (setq what &quot;d&quot; n (* n 7)))&#xA;      (org-timestamp-change (* cycle n) (cdr (assoc what whata))))))&#xA;&#xA;(bind-keys :map org-mode-map&#xA;           (&quot;S-&amp;lt;right&amp;gt;&quot; . yashi/org-timestamp-cycle-up)&#xA;           (&quot;S-&amp;lt;left&amp;gt;&quot; . yashi/org-timestamp-cycle-down))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2016-02-06T07:30:55.007" LastActivityDate="2016-02-06T07:30:55.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20110" PostTypeId="2" ParentId="20094" CreationDate="2016-02-06T10:40:28.080" Score="3" Body="&lt;p&gt;IIUC, the problem is that Emacs doesn't reuse the window from &lt;code&gt;frame 2&lt;/code&gt; when &lt;code&gt;frame 1&lt;/code&gt; is the selected frame. As per &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Choice.html&quot; rel=&quot;nofollow&quot;&gt;Window-Choice page&lt;/a&gt; in the manual, you can set &lt;code&gt;pop-up-frames&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq pop-up-frames t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;code&gt;pop-up-frames&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; will make Emacs consider windows on other frames whenever it needs to display a buffer. If you want Emacs to reuse windows from another frame only for SQL's process buffer, you need to add an entry to &lt;code&gt;display-buffer-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(push '(&quot;&amp;lt;buffer-name&amp;gt;&quot; nil . ((reusable-frames . t))) display-buffer-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;&amp;lt;buffer-name&amp;gt;&lt;/code&gt; should be replaced with the name of SQL's process buffer. The documentation of &lt;code&gt;display-buffer-alist&lt;/code&gt; and &lt;code&gt;display-buffer&lt;/code&gt; (via &lt;code&gt;C-h v&lt;/code&gt; and &lt;code&gt;C-h f&lt;/code&gt;) explains them in great detail. You can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window.html#Choosing-Window&quot; rel=&quot;nofollow&quot;&gt;read&lt;/a&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window-Options.html#Choosing-Window-Options&quot; rel=&quot;nofollow&quot;&gt;related&lt;/a&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html#Display-Action-Functions&quot; rel=&quot;nofollow&quot;&gt;pages&lt;/a&gt; from the Elisp manual to learn more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I am assuming &lt;code&gt;sql-mode&lt;/code&gt; uses &lt;code&gt;pop-to-buffer&lt;/code&gt; or similar to switch to SQL's process buffer. If it uses &lt;code&gt;switch-to-buffer&lt;/code&gt; or &lt;code&gt;split-window&lt;/code&gt; (it shouldn't), then my answer isn't likely to work.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-02-06T10:40:28.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20111" PostTypeId="1" AcceptedAnswerId="20117" CreationDate="2016-02-06T11:36:52.557" Score="0" ViewCount="147" Body="&lt;p&gt;Emacs fail to exit (save-buffers-kill-emacs, C-c C-x) with the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;KEY must be an integer, cons, symbol, or string&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My Emacs config:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/AttilaVM/.emacs.d/blob/master/init.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/AttilaVM/.emacs.d/blob/master/init.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-02-08T12:21:47.760" Title="Emacs fail to exit" Tags="|exit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20112" PostTypeId="1" AcceptedAnswerId="20141" CreationDate="2016-02-06T13:36:32.870" Score="1" ViewCount="355" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/20094/avoid-opening-a-new-window-in-sq-mode&quot;&gt;This issue&lt;/a&gt; might be related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a &lt;code&gt;SQL&lt;/code&gt; process viewed in a buffer in a frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I send SQL-statements from another window in frame to the SQL-process in the another frame, I have to scroll my SQL buffer to see the details of output. When I'm in an another buffer,  emacs stops &quot;following&quot; the SQL buffer, i.e., scrolling to automatically display new output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how I can &quot;reattach&quot; or encourage Emacs to follow the SQL buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; As noted in the replies below, you can set up Emacs to follow the tail of the output again, with to set up the point to the end of the buffer with &lt;kbd&gt;M-&gt;&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-07T10:44:40.913" Title="How do I encourage Emacs to follow the output of the SQL-buffer?" Tags="|sql-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20114" PostTypeId="1" AcceptedAnswerId="20116" CreationDate="2016-02-06T16:29:15.133" Score="5" ViewCount="1018" Body="&lt;p&gt;How can I define an Elisp function such that it is available only under a specific mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(FWIW, at the moment, the mode I want to restrict a function to is &lt;code&gt;comint&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-03-13T22:07:07.487" LastActivityDate="2016-03-13T22:07:07.487" Title="How to define &quot;mode-specific&quot; functions?" Tags="|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20115" PostTypeId="2" ParentId="20107" CreationDate="2016-02-06T16:32:47.547" Score="1" Body="&lt;p&gt;Info is great, if it is available for a particular tool or language. &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; can help with browsing and searching Info books (doc sets).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Completion is more flexible (regexp, fuzzy, progressive/incremental - combine patterns).&lt;/li&gt;&#xA;&lt;li&gt;Create virtual books from any set of Info nodes from any manuals.&lt;/li&gt;&#xA;&lt;li&gt;Visit nodes matching an input pattern in any order, selectively.&lt;/li&gt;&#xA;&lt;li&gt;Sort matches in &lt;code&gt;*Completions*&lt;/code&gt; in various ways (book order, alphabetic, etc.).&lt;/li&gt;&#xA;&lt;li&gt;Limit matches of your input pattern to nodes that follow the current node (i.e., in the remainder of the current manual).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;g&lt;/code&gt;&lt;/strong&gt; can match node name or node content, or both, so you can search a set of nodes (or a manual) and choose from the list of matching nodes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles_-_Info_Enhancements&quot; rel=&quot;nofollow&quot;&gt;More information...&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-06T16:32:47.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20116" PostTypeId="2" ParentId="20114" CreationDate="2016-02-06T16:35:22.687" Score="12" Body="&lt;p&gt;You can't. But you can do either of the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When the function is invoked, it can test the current mode and do something appropriate. For example, for some modes, or all modes except some modes, it can be a no-op or it can raise an error.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If it is a command, you can ensure that it is not bound to a key in some modes, or in all modes except some modes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Well, there &lt;strong&gt;&lt;em&gt;is&lt;/em&gt;&lt;/strong&gt; a way to make a function or variable essentially invisible in a given context, and that is to put its symbol in a different obarray from the default obarray. You can think of an obarray as a kind of a namespace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are a relative novice then I wouldn't recommend this, but if this is really what you need then go for it.  If you want an example of such use, you can take a look at library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/synonyms.el&quot;&gt;&lt;code&gt;synonyms.el&lt;/code&gt;&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/Synonyms&quot;&gt;description&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-06T16:40:49.320" LastActivityDate="2016-02-06T16:40:49.320" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20117" PostTypeId="2" ParentId="20111" CreationDate="2016-02-06T17:49:08.420" Score="1" Body="&lt;p&gt;Well the source of the problem was this line: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq help-char (kbd &quot;&amp;lt;f1&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I changed it to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq help-char nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Well it was a kinda intuitive solution, so if another answer explains it, I will accept that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update with explanation:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well I found the error, the kbd function returns with different datatypes, according to the given keys, an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(kbd &quot;C-h&quot;)  ;; &quot;^H&quot; string&#xA;(kbd &quot;C-x&quot;)  ;; &quot;^X&quot;&#xA;(consp (kbd &quot;M-g&quot;))  ;; [67108910]&#xA;(kbd &quot;C-.&quot;)  ;; [67108910]&#xA;(kbd &quot;C-&amp;lt;f1&amp;gt;&quot;) ;; [C-f1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Returned value for Ctrl or any given functional key is nor integer, nor cons, nor symbol, nor string.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(integerp (kbd &quot;C-&amp;lt;f1&amp;gt;&quot;)) ;; nil&#xA;(consp (kbd &quot;C-&amp;lt;f1&amp;gt;&quot;)) ;; nil&#xA;(symbolp (kbd &quot;C-&amp;lt;f1&amp;gt;&quot;)) ;; nil&#xA;(char-or-string-p (kbd &quot;C-&amp;lt;f1&amp;gt;&quot;)) ;; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It pretty much explains the given error. So check the kbd return type before assigning it to help-char or similar internal variables representing special characters. &lt;/p&gt;&#xA;" OwnerUserId="10978" LastEditorUserId="10978" LastEditDate="2016-02-08T12:21:47.760" LastActivityDate="2016-02-08T12:21:47.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20118" PostTypeId="1" AcceptedAnswerId="24900" CreationDate="2016-02-06T17:57:32.060" Score="3" ViewCount="2850" Body="&lt;p&gt;In my Clojure projects, I like to keep my REPL namespace separate from my other source files, so I always have something like this in my &lt;code&gt;project.clj&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:profiles {:dev {:source-paths [&quot;dev&quot;]&#xA;                 :repl-options {:init-ns user}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since I only use that file (and its parent directory) for temporary definitions and experimentation and such, I don't want it in version control, so I put the whole directory in my &lt;code&gt;.gitignore&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/dev/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my project structure looks something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;myproject&#xA;├── dev&#xA;│   └── user.clj&#xA;├── .gitignore&#xA;├── project.clj&#xA;└── ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, for the most part, Projectile works great for navigating around projects; I can use &lt;code&gt;C-c p f&lt;/code&gt; to quickly switch to my source files, tests, documentation, &lt;code&gt;project.clj&lt;/code&gt;, &lt;code&gt;.gitignore&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't switch to my REPL namespace file! I tried adding a &lt;code&gt;.projectile&lt;/code&gt; file to my project and playing around with that, but as far as I can tell, if a file is in &lt;code&gt;.gitignore&lt;/code&gt;, there is &lt;em&gt;no way&lt;/em&gt; to tell Projectile &lt;em&gt;not&lt;/em&gt; to ignore it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is, is it possible to ignore a file or directory in Git but not in Projectile?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastActivityDate="2016-07-28T15:55:46.747" Title="How can I whitelist a file or directory that is in my .gitignore?" Tags="|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20119" PostTypeId="1" CreationDate="2016-02-06T18:01:36.710" Score="3" ViewCount="201" Body="&#xA;&#xA;&lt;p&gt;Recently I was trapped by &lt;code&gt;void-variable&lt;/code&gt; error on &lt;code&gt;eval-after-load&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is not first time I forget to quote args like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'sql&#xA;   '(progn&#xA;       ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because &lt;code&gt;eval-after-load&lt;/code&gt; docs say:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load FILE FORM)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wrongly expect that &lt;code&gt;FORM&lt;/code&gt; is like &lt;code&gt;BODY...&lt;/code&gt; for example in &lt;code&gt;when&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when COND BODY...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the difference between &lt;code&gt;FORM&lt;/code&gt; and &lt;code&gt;BODY&lt;/code&gt; function call contract?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are there &lt;code&gt;FORM&lt;/code&gt; when &lt;code&gt;BODY&lt;/code&gt; is more convenient?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;BODY&lt;/code&gt; only for macros and &lt;code&gt;FORM&lt;/code&gt; only for functions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is &lt;code&gt;(quote (progn ...))&lt;/code&gt; usual way to make multi expression &lt;code&gt;FORM&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; Seems my guess is right about &lt;em&gt;&lt;code&gt;BODY&lt;/code&gt; only for macros and &lt;code&gt;FORM&lt;/code&gt; only for functions&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-eval-after-load (file &amp;amp;rest body)&#xA;  &quot;Execute BODY after FILE is loaded.&#xA;FILE is normally a feature name, but it can also be a file name,&#xA;in case that file does not provide any feature.&quot;&#xA;  (declare (indent 1) (debug t))&#xA;  `(eval-after-load ,file (lambda () ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="2355" LastEditDate="2016-02-06T18:30:07.120" LastActivityDate="2016-02-08T11:21:44.880" Title="FORM vs BODY in documentation?" Tags="|functions|elisp-macros|documentation|doc-strings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20120" PostTypeId="2" ParentId="20100" CreationDate="2016-02-06T18:25:18.240" Score="5" Body="&lt;p&gt;As noted in scaevola's answer, the problem is &lt;code&gt;visible-bell&lt;/code&gt;. Completely turning off both audible and visible bell may seem a bit drastic, though. Here's a homebrew version of visible bell that just flashes the mode-line – but excluding some cases where the user deliberately caused the condition triggering the bell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ring-bell-function&#xA;  (lambda ()&#xA;    (unless (memq this-command&#xA;          '(isearch-abort abort-recursive-edit&#xA;                  exit-minibuffer keyboard-quit))&#xA;      (invert-face 'mode-line)&#xA;      (run-with-timer 0.1 nil 'invert-face 'mode-line))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adjust the delay 0.1 (seconds) to taste.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-02-06T18:25:18.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20121" PostTypeId="1" CreationDate="2016-02-06T18:44:18.363" Score="1" ViewCount="109" Body="&lt;p&gt;Emacs makes assumptions about what constitutes an adequate match for a search.  In particular, AFAICT, it disregards whitespace differences, as well as differences in case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;During an incremental search&lt;/em&gt;, it is possible to toggle these settings.  For example, &lt;code&gt;M-s SPC&lt;/code&gt; toggles whitespace matching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is there something I can put in my &lt;code&gt;.emacs&lt;/code&gt; file such that the default initial settings are the strict ones?  (I.e. search for the exact string I have typed in the minibuffer.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to be clear, I still want to be able to toggle these settings.  (In fact, my preference would be to selectively adjust these settings for the duration of a search, rather than turning them on or off for the remainder of the session.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2016-03-07T22:03:14.807" Title="How can I configure Emacs to search verbatim by default?" Tags="|init-file|search|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20122" PostTypeId="2" ParentId="20119" CreationDate="2016-02-06T18:50:48.680" Score="3" Body="&lt;p&gt;There are two issues here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the one hand, when a function is called, the arguments are evaluated first. But when you evaluate a macro, the arguments are not evaluated. Instead, they are used to expand the macro into a form, which is subsequently evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, a &lt;em&gt;form&lt;/em&gt; is just a single lisp object that is going to be evaluated, while a &lt;em&gt;body&lt;/em&gt; is a sequence of forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is true that macro calls more commonly contain a body than a single form. This has less to do with their macro-ness than with what is more natural in each case, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The built-in function &lt;code&gt;eval&lt;/code&gt; is something of a special case: It is a function, hence when you call it, its argument is evaluated. But then, it evaluates its (already evaluated) argument again. The purpose of this is so you can programmatically build a lisp form and then evaluate it. This is rarely needed in ordinarty programming, however – but it's a common beginner's error for new lispers to use &lt;code&gt;eval&lt;/code&gt; needlessly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so at last we get to &lt;code&gt;eval-after-load&lt;/code&gt;: I imagine it is a function primarily because its perceived relationship with plain &lt;code&gt;eval&lt;/code&gt;. It might have been better to have it being a macro, but then the name should have been different so it's not so easily confused with the semantics of &lt;code&gt;eval&lt;/code&gt;. Perhaps &lt;code&gt;run-after-load&lt;/code&gt;? You can easily make one such yourself, perhaps even allowing it a body:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro run-after-load (file &amp;amp;rest body)&#xA;  `(eval-after-load ,file '(progn ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; There is in fact a macro &lt;code&gt;with-eval-after-load&lt;/code&gt; in newer emacsen (since 24.4) which is almost identical to the above. (It wraps the body in a &lt;code&gt;lambda&lt;/code&gt; instead of a &lt;code&gt;progn&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2016-02-08T11:21:44.880" LastActivityDate="2016-02-08T11:21:44.880" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20123" PostTypeId="1" CreationDate="2016-02-06T19:16:38.133" Score="4" ViewCount="1057" Body="&lt;p&gt;The agenda view helpfully only shows habits for the current day, but habits that should not yet be done still show up in the global todo list. How can I prevent this from happening?&lt;/p&gt;&#xA;" OwnerUserId="6677" LastActivityDate="2020-05-09T19:31:53.447" Title="How to not show habits in global todo list in org-mode?" Tags="|org-mode|org-agenda|org-habit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20124" PostTypeId="1" AcceptedAnswerId="20132" CreationDate="2016-02-06T20:44:04.103" Score="3" ViewCount="473" Body="&lt;p&gt;I am working with the C-source code of Emacs using the built-in &lt;code&gt;c-mode&lt;/code&gt;, and would like Emacs to automatically highlight functions and variables within comments with a different color:  In the following example, how can I make &lt;code&gt;pos-visible-in-window-p&lt;/code&gt; a different color?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* See the doc-string for `pos-visible-in-window-p'.  */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-02-09T02:12:20.207" Title="Colorizing `functions/variables' within comments in `c-mode'" Tags="|font-lock|c-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20125" PostTypeId="2" ParentId="20121" CreationDate="2016-02-06T21:16:42.837" Score="1" Body="&lt;p&gt;This is what I finally put in my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq isearch-lax-whitespace nil)&#xA;(setq isearch-regexp-lax-whitespace nil)&#xA;&#xA;;; the next setting affects both isearch-* and isearch-*-regexp; also, according&#xA;;; to its documentation it &quot;[a]utomatically becomes buffer-local when set&quot;;&#xA;;; therefore, `(setq-default case-fold-search nil)` won't do.&#xA;(setq-default case-fold-search nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can still toggle the white-space and case-fold settings during a search, with &lt;code&gt;M-s SPC&lt;/code&gt; and &lt;code&gt;M-s c&lt;/code&gt;, respectively, but I never figured out how to change either of these settings only for the duration of the search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to Constantine for the pointers.&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2016-02-06T21:16:42.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20126" PostTypeId="2" ParentId="19963" CreationDate="2016-02-06T21:20:12.493" Score="6" Body="&lt;p&gt;Best method seems to be found in &lt;code&gt;eldoc&lt;/code&gt; that also displays temporary info in minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Decide whether now is a good time to display a message.&#xA;(defun eldoc-display-message-p ()&#xA;  (and (eldoc-display-message-no-interference-p)&#xA;       ;; If this-command is non-nil while running via an idle&#xA;       ;; timer, we're still in the middle of executing a command,&#xA;       ;; e.g. a query-replace where it would be annoying to&#xA;       ;; overwrite the echo area.&#xA;       (not this-command)&#xA;       (eldoc--message-command-p last-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Specifically &lt;code&gt;(not this-command)&lt;/code&gt; ensures that no user command is running and that solves the problem in question.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="5213" LastEditDate="2016-02-07T18:52:42.523" LastActivityDate="2016-02-07T18:52:42.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20127" PostTypeId="1" AcceptedAnswerId="20128" CreationDate="2016-02-06T21:55:45.700" Score="1" ViewCount="49" Body="&lt;p&gt;I have some SQL code in the following style:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;CREATE TABLE IF NOT EXISTS test ( \n\&#xA;\  id INTEGER PRIMARY KEY, \n\&#xA;\  symbol TEXT NOT NULL, \n\&#xA;\  date TEXT NOT NULL, \n\&#xA;\  val DECIMAL(10, 2) NOT NULL, \n\&#xA;\&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like the datatypes to be aligned. In other words:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;CREATE TABLE IF NOT EXISTS test ( \n\&#xA;\  id     INTEGER PRIMARY KEY, \n\&#xA;\  symbol TEXT NOT NULL, \n\&#xA;\  date   TEXT NOT NULL, \n\&#xA;\  val    DECIMAL(10, 2) NOT NULL, \n\&#xA;\&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought using &lt;code&gt;align-regexp&lt;/code&gt; with the pattern &lt;code&gt;[A-Z]+&lt;/code&gt; would work, but it does not. Using &lt;code&gt;C-u M-x align-regexp&lt;/code&gt; with &lt;code&gt;\(\s-*\)[A-Z]+&lt;/code&gt; doesn't work either. Instead, it replaces the two spaces before the column names with a single space. I do not understand why this is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why doesn't &lt;code&gt;align-regexp&lt;/code&gt; with &lt;code&gt;[A-Z]+&lt;/code&gt; work? Searching based on the same pattern correctly identifies the text.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the right regexp that would get this alignment?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11036" LastEditorUserId="11036" LastEditDate="2016-02-06T22:02:43.230" LastActivityDate="2016-02-06T22:20:58.790" Title="How to align based on capitalized words?" Tags="|regular-expressions|align|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20128" PostTypeId="2" ParentId="20127" CreationDate="2016-02-06T22:20:58.790" Score="1" Body="&lt;p&gt;Becase &lt;code&gt;align-regexp&lt;/code&gt; is, by default, case-insensitive. Evaluate &lt;code&gt;(setq case-fold-search nil)&lt;/code&gt; before &lt;code&gt;align-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-02-06T22:20:58.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20129" PostTypeId="1" AcceptedAnswerId="20137" CreationDate="2016-02-06T22:53:26.123" Score="13" ViewCount="3731" Body="&lt;p&gt;For example, I want to filter table that make it shows the row which only contains &quot;USA&quot; string in the column 3 and 4. &lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2023-03-23T08:50:46.533" Title="How can I filter table in org mode" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20130" PostTypeId="1" CreationDate="2016-02-07T00:20:50.680" Score="8" ViewCount="1838" Body="&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt;, &lt;code&gt;M-x org-agenda a&lt;/code&gt; will display a built-in agenda view labeled &quot;Agenda for current week or day&quot;. How can I exclude a tag from this view?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Parenthetical clarification&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to filter a tag out of this view after it is displayed, but I would like to add something to my configuration to exclude the tag by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to exclude a tag from a custom agenda view, but I would like to exclude a tag from the built-in agenda view labeled &quot;Agenda for current week or day&quot;.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2020-05-02T14:53:58.933" Title="Exclude tag from default agenda view" Tags="|org-mode|org-agenda|org-tags|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20132" PostTypeId="2" ParentId="20124" CreationDate="2016-02-07T03:17:00.900" Score="5" Body="&lt;p&gt;This seems to work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cc-mode)&#xA;&#xA;(setq yashi-font-lock-doc-comments&#xA;  (let ((symbol &quot;[a-zA-Z0-9_-]+&quot;))&#xA;    `((,(concat &quot;`&quot; symbol &quot;'&quot;)&#xA;       0 ,c-doc-markup-face-name prepend nil))&#xA;    ))&#xA;&#xA;(setq yashi-font-lock-keywords&#xA;  `((,(lambda (limit)&#xA;        (c-font-lock-doc-comments &quot;/\\*&quot; limit&#xA;          yashi-font-lock-doc-comments)&#xA;        ))))&#xA;&#xA;&#xA;(add-hook 'c-mode-hook&#xA;          (lambda ()&#xA;            (setq c-doc-comment-style '((c-mode . yashi)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2016-02-09T02:12:20.207" LastActivityDate="2016-02-09T02:12:20.207" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20133" PostTypeId="2" ParentId="20130" CreationDate="2016-02-07T05:48:06.857" Score="6" Body="&lt;p&gt;I you don't want to see &lt;code&gt;:foo:&lt;/code&gt;, this should exclude it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-tag-filter-preset '(&quot;-foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the doc string says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This variable should not be set directly, but agenda custom commands can&#xA;  bind it in the options section.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, &lt;code&gt;let&lt;/code&gt; bind the variable before calling &lt;code&gt;org-agenda&lt;/code&gt; by defining your own wrapper function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yashi/org-agenda (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((org-agenda-tag-filter-preset '(&quot;-foo&quot;)))&#xA;   (org-agenda arg &quot;a&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And bind it to, say, &lt;kbd&gt;F1&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key &quot;&amp;lt;f1&amp;gt;&quot; 'yashi/org-agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2016-02-09T06:35:14.910" LastActivityDate="2016-02-09T06:35:14.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20134" PostTypeId="2" ParentId="20123" CreationDate="2016-02-07T06:24:38.207" Score="2" Body="&lt;p&gt;The global todo list is &lt;em&gt;global&lt;/em&gt;, meaning that it lists &lt;em&gt;all&lt;/em&gt; matching entries. Unfortunately, habit entries require &lt;code&gt;TODO&lt;/code&gt; to be present in its headings, thus they will show up in the global todo list by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can filter the global list by &lt;code&gt;tags&lt;/code&gt;, &lt;code&gt;categories&lt;/code&gt;, &lt;code&gt;efforts&lt;/code&gt;, or &lt;code&gt;regexp&lt;/code&gt; but these will not work with habits, because a habit entry is just an ordinary entry with a property &lt;code&gt;STYLE&lt;/code&gt; set to &lt;code&gt;habit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can, however, a) tag all your habit entry, say, &lt;code&gt;:habit:&lt;/code&gt; or b) use &lt;code&gt;#+CATEGORY: habit&lt;/code&gt; to filter out.  See &quot;&lt;a href=&quot;http://orgmode.org/org.html#Filtering_002flimiting-agenda-items&quot; rel=&quot;nofollow&quot;&gt;10.4.4 Filtering/limiting agenda items&lt;/a&gt;&quot; for more information.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-02-07T06:24:38.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20136" PostTypeId="1" AcceptedAnswerId="20150" CreationDate="2016-02-07T07:43:44.197" Score="7" ViewCount="847" Body="&lt;p&gt;Using the LaTeX-package pythontex I one can insert python code into the latex document which is executed (and printed to your latex file if you want) if you run latex. I use auctex for editing latex files, however editing the python code inside the latex document is a bit painful since the buffer is in latex mode and not in python mode, so there is no help for proper indentation of the python code and no syntax highlighting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there any reasonable way to mix the python mode with the latex mode? For example that the buffer automatically jumps to python mode if the point is inside  a python code snipped? What do I have to add to my .emacs file to make it work? Any other ideas?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[tikz]{standalone}&#xA;\usepackage{pgfplots}&#xA;\usepackage{pythontex}&#xA;&#xA;\begin{document}&#xA;&#xA;\begin{pycode}&#xA;print('test1')&#xA;def f( ):&#xA;    print('test2')&#xA;&#xA;f()&#xA;\end{pycode}   &#xA;&#xA;\pyc{f()}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;pythontex&lt;/code&gt; has multiple environments and commands which can contain pythoncode, for example &lt;code&gt;pycode&lt;/code&gt; or &lt;code&gt;pyverbatim&lt;/code&gt; as environments or &lt;code&gt;\pyc&lt;/code&gt; or &lt;code&gt;\py&lt;/code&gt; as commands. &lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2370" LastEditDate="2019-04-02T14:53:25.400" LastActivityDate="2019-04-02T14:53:25.400" Title="Multiple major modes in one buffer (e.g., python-mode &amp; LaTeX-mode)" Tags="|auctex|python|multiple-modes|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="20137" PostTypeId="2" ParentId="20129" CreationDate="2016-02-07T08:50:29.227" Score="26" Body="&lt;p&gt;You can use a multitude of solutions. I assume you want to produce a new table based on an existing one. This involves babel functionality where you define code blocks that produce the new table. The code blocks can be in many languages, and you even can define such a code block to be used afterwards normally in table formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am showing here just an example using emacs lisp. You can find many more examples in my example collection on github: &lt;a href=&quot;https://github.com/dfeich/org-babel-examples&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/dfeich/org-babel-examples&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; *table filter&#xA;&#xA;  #+NAME: table1&#xA;  | col1  | col2 | col3 | col4 | col5 |&#xA;  |-------+------+------+------+------|&#xA;  | row0  |    0 | CH   | CH   |    0 |&#xA;  | row1  |    2 | D    | CN   |    5 |&#xA;  | row2  |    4 | USA  | PL   |   10 |&#xA;  | row3  |    6 | CN   | D    |   15 |&#xA;  | row4  |    8 | JP   | USA  |   20 |&#xA;  | row5  |   10 | PL   | PL   |   25 |&#xA;  | row6  |   12 | USA  | JP   |   30 |&#xA;  | row7  |   14 | D    | CN   |   35 |&#xA;  | row8  |   16 | PL   | USA  |   40 |&#xA;  | row9  |   18 | CN   | D    |   45 |&#xA;  | row10 |   20 | CH   | CH   |   50 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we define a filter function which produces a new table with the required values.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am reading in the previous table by using the &lt;strong&gt;:var tbl=table1&lt;/strong&gt; argument in the BEGIN line.&lt;/li&gt;&#xA;&lt;li&gt;I define the value to be filtered in the same &lt;strong&gt;:var&lt;/strong&gt; assignment by setting &lt;strong&gt;val=&quot;USA&quot;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Notice that I am using the &lt;strong&gt;:colnames&lt;/strong&gt; argument in the BEGIN line in order to preserve the column headings.&lt;/li&gt;&#xA;&lt;li&gt;I only filter column 4 in these examples, for simplicity. But it is trivial to extend. If you want the explicit solution, just ask.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre&gt;&#xA;  #+NAME: my-filter&#xA;  #+BEGIN_SRC elisp :var tbl=table1 val=&quot;USA&quot; :colnames y&#xA;    (cl-loop for row in tbl&#xA;          if (equal (nth 3 row) val)&#xA;          collect row into newtbl&#xA;          finally return newtbl)&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS: my-filter&#xA;  | col1 | col2 | col3 | col4 | col5 |&#xA;  |------+------+------+------+------|&#xA;  | row4 |    8 | JP   | USA  |   20 |&#xA;  | row8 |   16 | PL   | USA  |   40 |&#xA;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can also use this function with the org-mode CALL syntax&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;  #+CALL: my-filter(tbl=table1, val=&quot;CN&quot;) :colnames y&#xA;&#xA;  #+RESULTS:&#xA;  | col1 | col2 | col3 | col4 | col5 |&#xA;  |------+------+------+------+------|&#xA;  | row1 |    2 | D    | CN   |    5 |&#xA;  | row7 |   14 | D    | CN   |   35 |&#xA;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also demonstrate here the SQLite approach where I use your&#xA;  original requirement of filtering all the rows which contain the&#xA;  string either in columns 3 or 4. A minor drawback of the sqlite&#xA;  approach is that we have some boilerplate code to read in the table&#xA;  and create a SQLite DB.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;  #+NAME: my-filter2&#xA;  #+BEGIN_SRC sqlite :db table1.sqlite :var tbl=table1 val=&quot;USA&quot; :colnames yes&#xA;    drop table if exists table1;&#xA;    create table table1 (col1 VARCHAR, col2 INTEGER, col3 VARCHAR,&#xA;    col4 VARCHAR, col5 INTEGER);&#xA;    .import &quot;$tbl&quot; table1&#xA;    select * from table1 where col3='$val' or col4='$val';&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS:&#xA;  | col1 | col2 | col3 | col4 | col5 |&#xA;  |------+------+------+------+------|&#xA;  | row2 |    4 | USA  | PL   |   10 |&#xA;  | row4 |    8 | JP   | USA  |   20 |&#xA;  | row6 |   12 | USA  | JP   |   30 |&#xA;  | row8 |   16 | PL   | USA  |   40 |&#xA;&#xA;&#xA;  #+CALL: my-filter2(tbl=table1, val=&quot;CN&quot;) :colnames y&#xA;&#xA;  #+RESULTS:&#xA;  | col1 | col2 | col3 | col4 | col5 |&#xA;  |------+------+------+------+------|&#xA;  | row1 |    2 | D    | CN   |    5 |&#xA;  | row3 |    6 | CN   | D    |   15 |&#xA;  | row7 |   14 | D    | CN   |   35 |&#xA;  | row9 |   18 | CN   | D    |   45 |&#xA;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that I understood your question correctly and that the links help you to find other variations of a solution.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="2025" LastEditDate="2016-06-03T19:43:08.857" LastActivityDate="2016-06-03T19:43:08.857" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20138" PostTypeId="1" CreationDate="2016-02-07T09:11:20.360" Score="1" ViewCount="856" Body="&lt;p&gt;I am having trouble of marking one word at a time (ctrl-shift-arrow or meta-shift f/b) when connecting from one of my terminals. I would like to bind it also to meta-shift-arrow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find what are the commands to do it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I am looking for something like (pseudocode) &lt;code&gt;(global-set-key (kbd &quot;M-S-right&quot;) 'mark-word-right)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's relevant, I am using CUA mode.&lt;/p&gt;&#xA;" OwnerUserId="10018" LastEditorUserId="10018" LastEditDate="2016-02-07T10:04:08.447" LastActivityDate="2019-02-14T22:02:30.557" Title="How to bind meta-shift-arrow to mark one word at a time" Tags="|key-bindings|mark|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20141" PostTypeId="2" ParentId="20112" CreationDate="2016-02-07T10:44:40.913" Score="1" Body="&lt;p&gt;To make buffers scroll along with newly appended contents, position point at their end (like with &lt;code&gt;M-&amp;gt;&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-02-07T10:44:40.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20144" PostTypeId="2" ParentId="20062" CreationDate="2016-02-07T13:16:00.983" Score="5" Body="&lt;p&gt;You'd just need to load proper unicode support in LaTeX via &lt;code&gt;unicode-math&lt;/code&gt; and &lt;code&gt;fontspec&lt;/code&gt;.  Then you'd need to compile with &lt;code&gt;xelatex&lt;/code&gt; or &lt;code&gt;lualatex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the docstring of the following variables: &lt;code&gt;org-latex-packages-alist&lt;/code&gt;, &lt;code&gt;org-latex-pdf-process&lt;/code&gt; and &lt;code&gt;org-latex-compiler&lt;/code&gt; (the latter is introduced in Org 9).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the development version of Org you could do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+latex_compiler: xelatex&#xA;#+latex_header: \usepackage{libertine}&#xA;#+latex_header: \usepackage{unicode-math}&#xA;&#xA;* Unicode symbols&#xA; $z$ ∈ ℝ ∖ ℤ&#xA;\begin{equation}&#xA;\label{eq:1}&#xA;X ≔ \left\{ z\colon z ∈ ℝ ∖ ℤ \right\}&#xA;\end{equation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Q2OjZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Q2OjZ.png&quot; alt=&quot;org-mode compiling latex documents with unicode symbols&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-02-07T13:16:00.983" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20145" PostTypeId="1" CreationDate="2016-02-07T13:21:10.233" Score="0" ViewCount="725" Body="&lt;p&gt;I'm switching over to Emacs as my C++ editor, and what I miss the most is when I use tab, it would write 8 spaces, I could use tab more than once and use it in the middle of code, when I pressed back space it would remove the whole tab area, and it wouldn't auto indent. How can I make this happen? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="11040" LastEditorUserId="105" LastEditDate="2016-02-07T17:33:28.423" LastActivityDate="2016-02-07T17:33:28.423" Title="How to make the tab key act normally in C++ mode?" Tags="|indentation|c++|tabs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20146" PostTypeId="2" ParentId="20145" CreationDate="2016-02-07T13:49:33.030" Score="1" Body="&lt;p&gt;First, backspace. If you want to delete all whitespaces before point, try &lt;a href=&quot;https://github.com/nflath/hungry-delete&quot; rel=&quot;nofollow&quot;&gt;hungry-delete mode&lt;/a&gt;.&#xA;If you would like to delete some whitespaces according to some indentation level, you could try to add this in you init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-deletion-count (arg)&#xA;  &quot;Return the amount of spaces to be deleted, ARG is indentation border.&quot;&#xA;  (if (eq (current-column) 0) 0&#xA;    (let ((result (mod (current-column) arg)))&#xA;      (if (eq result 0) arg&#xA;        result))))&#xA;&#xA;(defun backspace-some (arg)&#xA;  &quot;Deletes some backspaces, ARG unused.&quot;&#xA;  (interactive &quot;*P&quot;)&#xA;  (if (use-region-p) (backward-delete-char-untabify 1)&#xA;    (let ((here (point)))&#xA;      (if (eq 0 (skip-chars-backward &quot; &quot; (- (point) (get-deletion-count 4))))&#xA;          (backward-delete-char-untabify 1)&#xA;        (delete-region (point) here)))))&#xA;&#xA;(global-set-key [backspace] 'backspace-some)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my config I assume indentation level == 4. It will delete all whitespaces before point until next indentation level (..., 16, 12, 8, 4, 0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, tab. By default emacs indents all code according to your c-default-style and c-basic-offset variables. Try to configure them via (setq c-basic-offset 8) and your code will be indented with 8 spaces. Also you can override TAB key with some function which will insert 8 spaces like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-some-spaces ()&#xA;  &quot;Inserts 8 spaces after point&quot;&#xA;  (interactive)&#xA;  (insert &quot;        &quot;)&#xA;)&#xA;&#xA;(global-set-key [tab] 'insert-some-spaces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11038" LastEditorUserId="11038" LastEditDate="2016-02-07T14:00:19.457" LastActivityDate="2016-02-07T14:00:19.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20148" PostTypeId="1" AcceptedAnswerId="20149" CreationDate="2016-02-07T14:52:05.837" Score="0" ViewCount="465" Body="&lt;p&gt;I use evil (via spacemacs) and I want to insert a time stamp at the end of the current line in org-mode. Alas the end-of-line in evil normal mode is not the same as in vanilla emacs, so that pressing &lt;code&gt;$&lt;/code&gt; and then calling &lt;code&gt;org-time-stamp-inactive&lt;/code&gt; inserts the timestamp &lt;strong&gt;before the last character&lt;/strong&gt; in that line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can work around this by switching into emacs mode first, but this is unsatisfactory, because in emacs mode I have entirely different key bindings, whereas I try to fully embrace the spacemacs evil defaults.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions how to handle this? Perhaps a way to move the cursor one character further in normal mode? A command prefix that forces the execution of the following command at the &quot;true&quot; end of line while not moving the point at all?&lt;/p&gt;&#xA;" OwnerUserId="10870" LastActivityDate="2016-02-07T17:53:06.503" Title="evil &amp; org-time-stamp-inactive at end of line in normal mode" Tags="|org-mode|evil|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20149" PostTypeId="2" ParentId="20148" CreationDate="2016-02-07T17:53:06.503" Score="0" Body="&lt;p&gt;Evil has not one, but two settings to customize the behaviour of point at EOL:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-move-beyond-eol&lt;/code&gt; decides whether movement beyond EOL is possible at all.  When set to &lt;code&gt;t&lt;/code&gt;, you can move towards it, but things like &lt;code&gt;i&lt;/code&gt; or &lt;code&gt;a&lt;/code&gt; will still put cursor back after exiting insert state.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-move-cursor-back&lt;/code&gt; is a superset of the above as it disables moving cursor back, both after normal movement commands and after exiting insert state.  If you're after more Emacs-like behaviour, set it to &lt;code&gt;nil&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-02-07T17:53:06.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20150" PostTypeId="2" ParentId="20136" CreationDate="2016-02-07T21:14:51.627" Score="9" Body="&lt;p&gt;&lt;code&gt;MMM-mode&lt;/code&gt; (multiple major modes) seems exactly what you're looking for.  It is mentionned on the &lt;a href=&quot;http://www.emacswiki.org/emacs/MmmMode&quot; rel=&quot;noreferrer&quot;&gt;emacs wiki&lt;/a&gt;.  You need to define a &lt;em&gt;submode class&lt;/em&gt; to mix LaTeX and python, specifying that python parts are delimited by the &lt;code&gt;pycode&lt;/code&gt; LaTeX tags.  Adding the following to your init file should do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'mmm-auto)&#xA;(mmm-add-classes&#xA; '((latex-python&#xA;    :submode python-mode&#xA;    :face mmm-default-submode-face&#xA;    :front &quot;\\\\begin{pycode}\n&quot;&#xA;    :back &quot;\\\\end{pycode}\n&quot;)))&#xA;&#xA;(setq mmm-global-mode 'maybe)&#xA;(mmm-add-mode-ext-class 'latex-mode nil 'latex-python)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:front&lt;/code&gt; and &lt;code&gt;:back&lt;/code&gt; keywords specify &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regular-Expressions.html#Regular-Expressions&quot; rel=&quot;noreferrer&quot;&gt;regular expressions&lt;/a&gt; for delimiters.&#xA;The last two lines ask that &lt;code&gt;mmm-mode&lt;/code&gt; with the &lt;code&gt;latex-python&lt;/code&gt; class be activated by default in all buffers whose major mode is &lt;code&gt;latex-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the documentation for other options (activating it manually, based on file name, or with file variables).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two ways to specify several delimiter pairs.  First, several classes can be joined in a &lt;em&gt;group&lt;/em&gt;.  Below, instead of defining the &lt;code&gt;latex-python&lt;/code&gt; class we define it as a group that contains the two classes &lt;code&gt;latex-python-envs&lt;/code&gt; and &lt;code&gt;latex-python-cmds&lt;/code&gt; (itself recognizing the &lt;code&gt;\pyc{…}&lt;/code&gt; and &lt;code&gt;\py{…}&lt;/code&gt; LaTeX commands).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, each class can specify several several delimiter pairs: class &lt;code&gt;latex-python-envs&lt;/code&gt; below will recognize both &lt;code&gt;pycode&lt;/code&gt; and &lt;code&gt;pyverbatim&lt;/code&gt; LaTeX envs (&lt;code&gt;~1&lt;/code&gt; in &lt;code&gt;:back&lt;/code&gt; refers to the value matched in the first parenthesized group in &lt;code&gt;:front&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mmm-add-group 'latex-python&#xA; '((latex-python-envs&#xA;    :submode python-mode&#xA;    :face mmm-default-submode-face&#xA;    :front &quot;\\\\begin{\\(pycode\\|pyverbatim\\)}\n&quot;&#xA;    :back &quot;\\\\end{~1}\n&quot;&#xA;    :save-matches 1)&#xA;&#xA;   (latex-python-cmds&#xA;    :submode python-mode&#xA;    :face mmm-default-submode-face&#xA;    :front &quot;\\\\pyc?{&quot;&#xA;    :back &quot;}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For delimiters to be recognized you need to &lt;code&gt;mmm-parse-buffer&lt;/code&gt; (&lt;code&gt;C-c % C-b&lt;/code&gt;) (or &lt;code&gt;mmm-parse-region&lt;/code&gt;, or &lt;code&gt;mmm-parse-block&lt;/code&gt; ie a few lines around point).  If you're used to insert LaTeX envs through &lt;code&gt;LaTeX-insert-environment&lt;/code&gt; (&lt;code&gt;C-c C-e&lt;/code&gt;) it could be convenient to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html#Advising-Functions&quot; rel=&quot;noreferrer&quot;&gt;advise&lt;/a&gt; it to run &lt;code&gt;mmm-parse-block&lt;/code&gt; when it's done, so that MMM immediately recognizes the just inserted tags:&lt;/p&gt;&#xA;&#xA; &lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add 'LaTeX-insert-environment ':after &#xA;    '(lambda (env) (mmm-parse-block 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-02-09T20:07:04.823" LastActivityDate="2016-02-09T20:07:04.823" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20151" PostTypeId="1" AcceptedAnswerId="20162" CreationDate="2016-02-07T22:38:42.193" Score="3" ViewCount="1020" Body="&lt;p&gt;I am looking to rebind some evil mode keys used in navigation and text selection. For example, I am able to successfully map the following evil-mode keys to the following functions:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;w&quot;) 'evil-forward-little-word-begin)&#xA;(define-key evil-normal-state-map (kbd &quot;b&quot;) 'evil-backward-little-word-begin)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I don't know how to bind key combinations, like using &lt;code&gt;dw&lt;/code&gt; to delete only to the next little word. For example, I type &lt;code&gt;d C-h k w&lt;/code&gt; to describe the &lt;code&gt;w&lt;/code&gt; key after I have typed &lt;code&gt;d&lt;/code&gt;, and it is mapped to &lt;code&gt;evil-forward-word-begin&lt;/code&gt;, and not to &lt;code&gt;evil-forward-little-word-begin&lt;/code&gt;. Apparently, my key mapping above does not work for this scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to remap this keybinding, or am I being unreasonable in my attempt to remap the evil-little-word library?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this question is a tangent to &lt;a href=&quot;https://emacs.stackexchange.com/questions/14439/evil-package-alternative-for-motion-through-camelcase-words&quot;&gt;this question&lt;/a&gt; and I am trying to remap the &lt;a href=&quot;https://github.com/tarao/evil-plugins/blob/master/evil-little-word.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;evil-little-word&lt;/a&gt; library to the regular evil-mode keybindings.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-02-08T20:30:32.950" Title="How to rebind evil key mappings for delete and friends?" Tags="|key-bindings|evil|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20152" PostTypeId="1" CreationDate="2016-02-08T00:34:57.397" Score="2" ViewCount="103" Body="&lt;p&gt;In &lt;code&gt;describe-mode&lt;/code&gt;'s definition (in &lt;code&gt;help.el&lt;/code&gt;), there's the following piece of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Older packages do not register in minor-mode-list but only in&#xA;;; minor-mode-alist.&#xA;(dolist (x minor-mode-alist)&#xA;  (setq x (car x))&#xA;  (unless (memq x minor-mode-list)&#xA;    (push x minor-mode-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How big a concern is this? If I wanted to get a canonical, comprehensive list of minor modes, is it enough to check &lt;code&gt;minor-mode-list&lt;/code&gt;, or is doing the above really necessary?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's fine to be &quot;on the safe side&quot;, but &lt;code&gt;describe-mode&lt;/code&gt; already makes some powerful assumptions, such as that the control variable for a minor mode has the same name as its toggle command (see &lt;code&gt;define-minor-mode&lt;/code&gt;) for more information, so it's a probably not getting &quot;everything&quot; to begin with.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-02-08T00:34:57.397" Title="Canonical list of minor modes" Tags="|minor-mode|help|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20153" PostTypeId="1" CreationDate="2016-02-08T02:46:13.167" Score="3" ViewCount="388" Body="&lt;p&gt;I'm trying to remap some keys in &lt;code&gt;help-map&lt;/code&gt;, but the following does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key help-map [remap describe-mode] #'my-describe-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remapping in the global map does work, however:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [remap describe-mode] #'my-describe-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is this? I can see that the value of &lt;code&gt;help-map&lt;/code&gt; contains &lt;code&gt;describe-mode&lt;/code&gt; when I call &lt;code&gt;describe-variable&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;help-map is a variable defined in `help.el'.&#xA;Its value is shown below.&#xA;&#xA;  This variable may be risky if used as a file-local variable.&#xA;&#xA;Documentation:&#xA;Keymap for characters following the Help key.&#xA;&#xA;Value: (keymap&#xA; (remap keymap&#xA;    (describe-mode . my-describe-mode))&#xA; ...&#xA; (109 . describe-mode)&#xA; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does it have something to do with &lt;code&gt;C-h&lt;/code&gt; being a prefix key?  &lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-02-08T02:46:13.167" Title="Remapping help-map" Tags="|keymap|help|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20154" PostTypeId="1" AcceptedAnswerId="20160" CreationDate="2016-02-08T09:58:34.020" Score="5" ViewCount="674" Body="&lt;p&gt;I am trying to write a function which stages all modified files and commits them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Staging is easy - just run &lt;code&gt;magit-stage-modified&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Committing is not - I couldn't find a way of creating a commit without invoking &lt;code&gt;commit-message-buffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I'd like to have an interactive function looking like this:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun just-stage-and-commit (commit-msg)&#xA;  ;; ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any hints? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="390" LastEditorUserId="160" LastEditDate="2016-02-11T12:50:12.900" LastActivityDate="2016-02-11T12:50:12.900" Title="How can I stage all changes and commit them without displaying commit-message-buffer in Magit?" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20155" PostTypeId="1" AcceptedAnswerId="20156" CreationDate="2016-02-08T10:26:02.943" Score="5" ViewCount="933" Body="&lt;p&gt;I would like to have an agenda view that would contain all TODO entries that do not have timestamps associated with them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Org info i found that variables &lt;code&gt;org-agenda-todo-ignore-with-date&lt;/code&gt; and &lt;code&gt;org-agenda-todo-ignore-timestamp&lt;/code&gt; are provided for that purpose. However, i would like to keep original &quot;all TODO entries in &lt;code&gt;org-agenda-files&lt;/code&gt;&quot; view intact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i achieve that?&lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2016-02-08T11:09:14.973" Title="How to show a list of TODO entries without timestamps?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20156" PostTypeId="2" ParentId="20155" CreationDate="2016-02-08T11:09:14.973" Score="7" Body="&lt;p&gt;In my set-up I have the following customization&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(org-agenda-custom-commands&#xA;   (quote&#xA;    ((&quot;d&quot; &quot;Undated tasks&quot; alltodo &quot;&quot;&#xA;      ((org-agenda-todo-ignore-with-date t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which makes &lt;code&gt;C-a d&lt;/code&gt; give me a list of tasks that have no date.  Here is the customization buffer version of this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org Agenda Custom Commands:&#xA;INS DEL Choice: Value Menu Single command:&#xA;            Access Key(s) : d&#xA;            [X] Description: Undated tasks&#xA;            Choice: Value Menu TODO list&#xA;            Match (only for some commands): &#xA;            Local settings for this command.  Remember to quote values:&#xA;            INS DEL Setting: Value Menu Any variable:&#xA;                        Variable: org-agenda-todo-ignore-with-date&#xA;                        Value (sexp): t&#xA;            INS&#xA;            [ ] Export:&#xA;                INS&#xA;INS&#xA;    State : SAVED and set.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2016-02-08T11:09:14.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20157" PostTypeId="1" CreationDate="2016-02-08T14:45:39.527" Score="2" ViewCount="123" Body="&lt;p&gt;I have a directory with many folder. When I open it in dired I see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bundles&#xA;ckeditor&#xA;companies&#xA;contries&#xA;failitators&#xA;induction&#xA;jquery_update&#xA;lwt_shared&#xA;members&#xA;messages&#xA;offices&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I often work upon files from specific directory and my idea was to create a file with sorting order. And make the folder I need now to float to the top. All the other dirs should be sorted by name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I am working upon members and offices dirs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;members&#xA;offices&#xA;bundles&#xA;ckeditor&#xA;companies&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And our sorting file located in parent dir should be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;members&#xA;offices&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then Emacs will know, that members and offices must be put at the top. Is it possible to implement it? I read &lt;a href=&quot;http://www.emacswiki.org/emacs/DiredSorting&quot; rel=&quot;nofollow&quot;&gt;http://www.emacswiki.org/emacs/DiredSorting&lt;/a&gt;, and it says, that sorting can be changed by customizing per-directory local variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how should I write this file?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2016-02-08T14:45:39.527" Title="Dired: manual files sorting for specific directories" Tags="|dired|customize|sorting|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20159" PostTypeId="1" CreationDate="2016-02-08T16:05:11.890" Score="2" ViewCount="939" Body="&lt;p&gt;I am using markdown mode with the modifications suggested in the excellent &lt;a href=&quot;https://emacs.stackexchange.com/a/761/241&quot;&gt;answer&lt;/a&gt; I received to a previous question. My aim is to have basic rendering capabilities within emacs itself so I can structure and format my text documents. I now would like to extend this so that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;_foo_&lt;/code&gt; renders as &lt;em&gt;foo&lt;/em&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;*foo*&lt;/code&gt; renders as &lt;strong&gt;foo&lt;/strong&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;#Header&lt;/code&gt; renders as&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;header&lt;/h1&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;`code`&lt;/code&gt; renders as &lt;code&gt;code&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;At the moment, my documents look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/i8qZj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/i8qZj.png&quot; alt=&quot;emacs screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want it to look as it would if displayed on an SE page:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;header&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Normal text, &lt;strong&gt;bold text&lt;/strong&gt;, &lt;em&gt;italicized text&lt;/em&gt;, and &lt;code&gt;code&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In other words, I would like to add italics, bold, headers and inline code and have them be visible in the emacs buffer I am editing, without needing to export the markdown document, and I would like formatting marks (such as &lt;code&gt;#&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt; and backticks) to disappear once the format they define has been applied. &lt;/p&gt;&#xA;" OwnerUserId="241" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-06-13T05:28:37.260" Title="How can I hide formatting marks after the formatting they define has been applied in markdown mode?" Tags="|formatting|markdown-mode|rendering|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20160" PostTypeId="2" ParentId="20154" CreationDate="2016-02-08T18:57:51.433" Score="4" Body="&lt;p&gt;If you provide the &lt;code&gt;-m&lt;/code&gt; option to &lt;code&gt;magit-commit&lt;/code&gt; it will use what your provided and not open the message buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-magit-stage-all-and-commit(message)&#xA;  (interactive &quot;sCommit Message: &quot;)&#xA;  (magit-stage-modified)&#xA;  (magit-commit (list &quot;-m&quot; message)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-02-11T12:48:25.857" LastActivityDate="2016-02-11T12:48:25.857" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20161" PostTypeId="7" CreationDate="2016-02-08T19:12:34.913" Score="0" Body="&lt;p&gt;&#xA;On Stack Exchange, we believe the core moderators should come &lt;i&gt;from&lt;/i&gt; the community, and be elected by the community itself through popular vote. We hold regular elections to determine who these community moderators will be.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Community moderators are &lt;a href=&quot;http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/&quot;&gt;accorded the highest level of privilege on our community&lt;/a&gt;, and should themselves be exemplars of positive behavior and leaders within the community.&lt;/p&gt;&#xA;&lt;p&gt;&#xA;Our general criteria for moderators is as follows:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;patient and fair&lt;/li&gt;&#xA;&lt;li&gt;leads by example&lt;/li&gt;&#xA;&lt;li&gt;shows respect for their fellow community members in their actions and words&lt;/li&gt;&#xA;&lt;li&gt;open to some light but firm moderation to keep the community on track and resolve (hopefully) uncommon disputes and exceptions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&#xA;Every election has three phases:&#xA;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Nomination&lt;/li&gt;&#xA;&lt;li&gt;Primary&lt;/li&gt;&#xA;&lt;li&gt;Election&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&#xA;Please participate in the moderator elections by voting, and perhaps even by nominating yourself to be a community moderator!&#xA;&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="6907" LastEditDate="2022-02-15T15:48:26.903" LastActivityDate="2022-02-15T15:48:26.903" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="20162" PostTypeId="2" ParentId="20151" CreationDate="2016-02-08T20:29:26.457" Score="4" Body="&lt;p&gt;Functions such as &lt;code&gt;evil-delete&lt;/code&gt; (&lt;kbd&gt;d&lt;/kbd&gt;) and &lt;code&gt;evil-change&lt;/code&gt; (&lt;kbd&gt;c&lt;/kbd&gt;) are &lt;em&gt;operators&lt;/em&gt;, so you need to modify the &lt;code&gt;evil-operator-state-map&lt;/code&gt;.  If you want these modifications to show up in visual state as well, also modify &lt;code&gt;evil-visual-state-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at &lt;a href=&quot;https://bitbucket.org/lyro/evil/wiki/Home&quot; rel=&quot;nofollow&quot;&gt;Evil's bitbucket page&lt;/a&gt; for more details.  It includes an old &lt;a href=&quot;https://bytebucket.org/lyro/evil/raw/default/doc/evil.pdf&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;, but it will still give you enough of the core background to get started.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-08T20:29:26.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20163" PostTypeId="2" ParentId="14439" CreationDate="2016-02-08T20:35:16.947" Score="3" Body="&lt;p&gt;Using the &lt;a href=&quot;https://github.com/tarao/evil-plugins/blob/master/evil-little-word.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;evil-little-word&lt;/a&gt; library as suggested by @wasamasa above, you can rebind your standard vim bindings to the evil-little-word versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, once you load that library in your path, put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'evil-little-word)&#xA;(define-key evil-normal-state-map (kbd &quot;w&quot;) 'evil-forward-little-word-begin)&#xA;(define-key evil-normal-state-map (kbd &quot;b&quot;) 'evil-backward-little-word-begin)&#xA;(define-key evil-operator-state-map (kbd &quot;w&quot;) 'evil-forward-little-word-begin)&#xA;(define-key evil-operator-state-map (kbd &quot;b&quot;) 'evil-backward-little-word-begin)&#xA;(define-key evil-visual-state-map (kbd &quot;w&quot;) 'evil-forward-little-word-begin)&#xA;(define-key evil-visual-state-map (kbd &quot;b&quot;) 'evil-backward-little-word-begin)&#xA;(define-key evil-visual-state-map (kbd &quot;i w&quot;) 'evil-inner-little-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that covers the bindings, but let me know if I am missing something! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To figure this out, I asked another question &lt;a href=&quot;https://emacs.stackexchange.com/questions/20151/how-to-rebind-evil-key-mappings?noredirect=1#20151&quot;&gt;here&lt;/a&gt; about the details of re-binding evil-mode keys.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-02-15T13:44:45.987" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20165" PostTypeId="1" AcceptedAnswerId="20177" CreationDate="2016-02-08T22:17:28.833" Score="6" ViewCount="1154" Body="&lt;p&gt;Helm opens buffer using a vertical split by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jiF2J.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jiF2J.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want the Helm buffer to open using a horizontal split by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2mnsQ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2mnsQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can use &lt;code&gt;C-t&lt;/code&gt; (&lt;code&gt;helm-toggle-resplit-and-swap-windows&lt;/code&gt;) to manually toggle the position, but how can I make this change permanent?&lt;/p&gt;&#xA;" OwnerUserId="2292" LastEditorUserId="2292" LastEditDate="2016-02-08T22:40:31.493" LastActivityDate="2016-04-09T18:39:06.713" Title="Open Helm buffer vertically permanently" Tags="|helm|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20167" PostTypeId="1" CreationDate="2016-02-09T02:23:07.933" Score="7" ViewCount="1804" Body="&lt;p&gt;That is, how can I (from Lisp) create a frame similar to the one that &lt;code&gt;x_create_tip_frame&lt;/code&gt; (called by &lt;code&gt;x-show-tip&lt;/code&gt; in the C sources) creates when &lt;code&gt;x-gtk-use-system-tooltips&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My original guess was that the relevant part of the C code was this call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x_default_parameter (f, parms, Qborder_width, make_number (0),&#xA;             &quot;borderWidth&quot;, &quot;BorderWidth&quot;, RES_TYPE_NUMBER);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, neither &lt;code&gt;(set-frame-param (selected-frame) 'border-width 0)&lt;/code&gt; nor &lt;code&gt;(make-frame '((border-width . 0)))&lt;/code&gt; (both inspired from the call above) yield a borderless frame. Still, &lt;code&gt;x-show-tip&lt;/code&gt; works fine, so there must be a reliable way :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: &lt;strong&gt;How do I create a frame without a border added by the window manager?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2017-05-16T14:54:53.630" Title="How do I create a borderless frame?" Tags="|frames|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20168" PostTypeId="1" AcceptedAnswerId="20172" CreationDate="2016-02-09T03:38:20.697" Score="2" ViewCount="259" Body="&lt;p&gt;I'm trying to use a regular expression of the form &lt;code&gt;&quot;foo\\(?:\\(bar\\)\\(baz\\)\\)*\\(quux\\)&quot;&lt;/code&gt;, but I want the inner two subexpressions to retain &lt;em&gt;all&lt;/em&gt; of their matches, not just the first one.  I realize this may be impossible to achieve as stated, so I'll give more detail about why I want this to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My specific case is that I'm trying produce a major mode for editing and highlighting &lt;a href=&quot;http://dwarffortresswiki.org/index.php/DF2014:Raw_file&quot; rel=&quot;nofollow&quot;&gt;Dwarf Fortress &quot;raw&quot; files&lt;/a&gt;.  The regular expression I'm having this trouble with is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\(\\[\\)\\([_A-Z]+\\)\\(?:\\(:\\)\\([^][:]*\\)\\)*\\(\\]\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, which successfully matches a single complete raw tag with all of its parameters; however, capturing groups 3 and 4 only end up containing the last parameter (after having successfully matched all the previous ones), and therefore all but the last parameter is not highlighted by &lt;code&gt;font-lock&lt;/code&gt;.  I understand &lt;em&gt;why&lt;/em&gt; this is the case, but I'd like to know if there is a way to get around it, or to otherwise enable my desired behavior.&lt;/p&gt;&#xA;" OwnerUserId="11056" LastActivityDate="2016-02-09T11:52:55.560" Title="How to match more than one instance of a single subexpression?" Tags="|regular-expressions|major-mode|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20169" PostTypeId="1" AcceptedAnswerId="20170" CreationDate="2016-02-09T05:04:18.320" Score="2" ViewCount="1939" Body="&lt;p&gt;I am fairly new to emacs and I want to learn emacs Lisp. In particular, is it possible to write elisp functions in, say, the &lt;em&gt;scratch&lt;/em&gt; buffer to do some complex text-processing on my program file &lt;code&gt;example.cpp&lt;/code&gt; whose buffer I would have open in another frame. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed if I could write some elisp code to do text-processing across all the files in the project folder that would be even better! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Spacemacs &lt;/p&gt;&#xA;" OwnerUserId="10896" LastEditorUserId="105" LastEditDate="2016-03-13T22:06:32.373" LastActivityDate="2016-03-13T22:06:32.373" Title="Can I write elisp code to act on the text in a buffer" Tags="|spacemacs|text-editing|" AnswerCount="1" CommentCount="2" ClosedDate="2016-02-09T12:28:05.513" ContentLicense="CC BY-SA 3.0" />
  <row Id="20170" PostTypeId="2" ParentId="20169" CreationDate="2016-02-09T06:09:52.673" Score="8" Body="&lt;p&gt;Yes you can! (If you mean frame what Emacs think it is.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To demonstrate, do the following steps:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Run Emacs&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This will put you into the &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Create a new frame&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x make-frame-command&lt;/code&gt; to create a new frame, which is also in &lt;code&gt;*scratch*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Open &lt;code&gt;example.cpp&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;So that you can now see both &lt;code&gt;*scratch*&lt;/code&gt; buffer in the first frame and &lt;code&gt;example.cpp&lt;/code&gt; in the newly created frame, side by side.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Write lisp&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Copy the following code and past it into the &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;example.cpp&quot;&#xA;  (insert &quot;Hello, Emacs!\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Evaluate it&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Put your cursor after the last &lt;code&gt;)&lt;/code&gt; and do &lt;code&gt;M-x eval-last-sexp&lt;/code&gt;.  If you see &quot;Hello, Emacs!&quot; in the other frame, you got the first step right.  You can now customize the code to suite your needs.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-02-09T06:09:52.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20171" PostTypeId="1" AcceptedAnswerId="20178" CreationDate="2016-02-09T11:51:43.787" Score="6" ViewCount="555" Body="&lt;p&gt;When running (&lt;code&gt;C-x C-e&lt;/code&gt;) the following snippet and doing &lt;code&gt;M-x mes&lt;/code&gt;, I see &lt;code&gt;text&lt;/code&gt; written in red in the minibuffer area, but the text in the &lt;code&gt;*Messages*&lt;/code&gt; buffer is stripped of all formatting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mes ()&#xA;  &quot;message me&quot;&#xA;  (interactive)&#xA;  (message (propertize &quot;text&quot; 'face 'font-lock-warning-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I preserve the color and other font information in the &lt;code&gt;*Messages*&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="11060" LastEditorUserId="105" LastEditDate="2016-02-09T15:32:00.043" LastActivityDate="2016-02-09T18:40:56.077" Title="How to preserve color in *Messages* buffer?" Tags="|faces|message|logging|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20172" PostTypeId="2" ParentId="20168" CreationDate="2016-02-09T11:52:55.560" Score="2" Body="&lt;p&gt;You can use an &lt;strong&gt;anchored&lt;/strong&gt; font-lock rule. They are used when you want a search within a search. The look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(PATTERN&#xA; (SUBPATTERN&#xA;  PRE-MATCH-FORM&#xA;  POST-MATCH-FORM&#xA;  HIGHLIGHT&#xA;  ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your case, it could be something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-raw-rule&#xA;  '((&quot;\\[&quot;&#xA;     (&quot;\\_&amp;lt;\\(\\sw\\|\\s_\\)+\\_&amp;gt;&quot;&#xA;      ;; Pre-match form: Limit search to closing &quot;]&quot; or end-of-line.&#xA;      (save-excursion&#xA;        (if (re-search-forward &quot;\\]&quot; (line-end-position) t)&#xA;            (point)&#xA;          nil))&#xA;      ;; Post-match form&#xA;      nil&#xA;      (0 font-lock-constant-face)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the rule highlights words after the &lt;code&gt;[&lt;/code&gt; even when the &lt;code&gt;]&lt;/code&gt; isn't present -- this is typically what you want when writing code.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-02-09T11:52:55.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20173" PostTypeId="1" CreationDate="2016-02-09T13:26:21.563" Score="0" ViewCount="561" Body="&lt;p&gt;If I recall correctly I was able to view the C indentation rules applied for indenting the line at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After searching the manual for a while I still can not find the command  for it. Obviously I'm missing the proper key words for my search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you tell me how what the name of this command is?&lt;/p&gt;&#xA;" OwnerUserId="10870" LastEditorUserId="253" LastEditDate="2016-02-10T09:03:37.670" LastActivityDate="2016-02-10T09:03:37.670" Title="Find out C indentation rule at point" Tags="|indentation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20174" PostTypeId="1" AcceptedAnswerId="20175" CreationDate="2016-02-09T14:26:06.537" Score="2" ViewCount="133" Body="&lt;pre&gt;&lt;code&gt;(defvar-local hash-entries nil)&#xA;(put 'hash-entries &quot;key&quot; &quot;val&quot;)&#xA;(message &quot;%S&quot; hash-entries)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I try to add a &lt;code&gt;key-value&lt;/code&gt; pair to the hash variable, &lt;code&gt;hash-entries&lt;/code&gt; using the function &lt;code&gt;put&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when i print it, it prints &lt;code&gt;nil&lt;/code&gt; instead of its contents, &lt;code&gt;(key . val)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2016-02-09T14:37:46.820" Title="Insert an entry into hash using put" Tags="|hash-tables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20175" PostTypeId="2" ParentId="20174" CreationDate="2016-02-09T14:37:46.820" Score="3" Body="&lt;p&gt;&lt;code&gt;put&lt;/code&gt; is not for hash tables. What you want is &lt;code&gt;puthash&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(puthash KEY VALUE TABLE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Associate KEY with VALUE in hash table TABLE.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also you cannot just use &lt;code&gt;puthash&lt;/code&gt; on nil, you need to actually create a hash table first with &lt;code&gt;make-hash-table&lt;/code&gt;. If you want to use strings as the has keys make sure you pass &lt;code&gt;:test 'equal&lt;/code&gt; to &lt;code&gt;make-hash-table&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all the information you need to use hash tables you can consult &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html&quot; rel=&quot;nofollow&quot;&gt;this part&lt;/a&gt; of the manual.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;put&lt;/code&gt; is for storing properties on a symbol, not the symbols value. You can read more about what put actually does &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Properties.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. It's extremely rare that you would actually ever need to use &lt;code&gt;put&lt;/code&gt; for something.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-02-09T14:37:46.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20176" PostTypeId="2" ParentId="20016" CreationDate="2016-02-09T15:09:23.537" Score="9" Body="&lt;p&gt;FYI for anyone else who comes across this issue, this is because this jsx-mode project is &lt;strong&gt;not made to edit Facebook's React JSX templates&lt;/strong&gt; but rather this &lt;strong&gt;other compiled javascript language&lt;/strong&gt; also called &lt;a href=&quot;http://jsx.github.io&quot; rel=&quot;noreferrer&quot;&gt;JSX&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That having the same name as the React templates is entirely coincidental.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why the first commits to &lt;a href=&quot;https://github.com/jsx/jsx-mode.el&quot; rel=&quot;noreferrer&quot;&gt;this repo&lt;/a&gt; were 4 years (pre-dating Facebook's JSX and React by years) and the last commit in this repo was back in 2013 (also pre-dating React).&lt;/p&gt;&#xA;" OwnerUserId="11063" LastEditorUserId="304" LastEditDate="2016-07-29T17:14:22.820" LastActivityDate="2016-07-29T17:14:22.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20177" PostTypeId="2" ParentId="20165" CreationDate="2016-02-09T16:59:23.293" Score="1" Body="&lt;p&gt;More details: the problem was I was using &lt;code&gt;(push '(&quot;*Help*&quot; :regexp t) popwin:special-display-config)&lt;/code&gt; in &lt;code&gt;popwin&lt;/code&gt;. This matches helm buffers. &lt;/p&gt;&#xA;" OwnerUserId="2292" LastActivityDate="2016-02-09T16:59:23.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20178" PostTypeId="2" ParentId="20171" CreationDate="2016-02-09T17:34:38.573" Score="6" Body="&lt;p&gt;You can't with &lt;code&gt;message&lt;/code&gt;. Having looked at the internals of &lt;code&gt;message&lt;/code&gt;, only the raw char* is given to the function that actually logs the text, all text properties are lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can hack your way around this by writing a function that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;calls &lt;code&gt;message&lt;/code&gt; with &lt;code&gt;message-log-max&lt;/code&gt; let-bound to nil so that it won't log to &lt;code&gt;*Messages*&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;manually inserts the propertized string at the end of the messages buffer by let-binding &lt;code&gt;inhibit-read-only&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in the message buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is an implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-message (format &amp;amp;rest args)&#xA;  &quot;Acts like `message' but preserves string properties in the *Messages* buffer.&quot;&#xA;  (let ((message-log-max nil))&#xA;    (apply 'message format args))&#xA;  (with-current-buffer (get-buffer &quot;*Messages*&quot;)&#xA;    (save-excursion&#xA;      (goto-char (point-max))&#xA;      (let ((inhibit-read-only t))&#xA;        (unless (zerop (current-column)) (insert &quot;\n&quot;))&#xA;        (insert (apply 'format format args))&#xA;        (insert &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-02-09T18:40:56.077" LastActivityDate="2016-02-09T18:40:56.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20179" PostTypeId="2" ParentId="5461" CreationDate="2016-02-09T17:56:07.570" Score="0" Body="&lt;p&gt;Another solution: I noticed that my value for &lt;code&gt;org-plantuml-jar-path&lt;/code&gt; was incorrect. After fixing it to be an absolute path, everything was fine.&lt;/p&gt;&#xA;" OwnerUserId="3968" LastActivityDate="2016-02-09T17:56:07.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20180" PostTypeId="2" ParentId="20173" CreationDate="2016-02-09T18:29:28.973" Score="-1" Body="&lt;p&gt;Found it myself: &lt;kbd&gt;M-x c-set-offset&lt;/kbd&gt; or &lt;kbd&gt;C-c C-o&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(c-set-offset SYMBOL OFFSET &amp;amp;optional IGNORED)&lt;/p&gt;&#xA;&lt;p&gt;Change the value of a syntactic element symbol in `c-offsets-alist'.&#xA;SYMBOL is the syntactic element symbol to change and OFFSET is the new&#xA;offset for that syntactic element.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Called interactively, it proposes for SYMBOL the one applying on current line and so we can see what syntactic element governing its indentation the line belongs to.&lt;/p&gt;&#xA;" OwnerUserId="10870" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-02-09T20:30:30.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20181" PostTypeId="2" ParentId="19633" CreationDate="2016-02-09T18:36:52.550" Score="11" Body="&lt;p&gt;For the sake of an answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;string-match&lt;/code&gt; is meant for to be used with regexps.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(string-match REGEXP STRING &amp;amp;optional START)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return index of start of first match for REGEXP in STRING, or nil.&#xA;  Matching ignores case if ‘case-fold-search’ is non-nil.&#xA;  If third arg START is non-nil, start search at that index in STRING.&#xA;  For index of first char beyond the match, do (match-end 0).&#xA;  ‘match-end’ and ‘match-beginning’ also give indices of substrings&#xA;  matched by parenthesis constructs in the pattern.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can use the function ‘match-string’ to extract the substrings&#xA;  matched by the parenthesis constructions in REGEXP.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here are some examples&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(string-match &quot;\\(dog\\|cat\\)&quot; &quot;There is a dog.&quot;) ;; =&amp;gt; 11&#xA;(string-match &quot;\\(dog\\|cat\\)&quot; &quot;There are two cats here.&quot; 0) ;; =&amp;gt; 14&#xA;(string-match &quot;\\(dog\\|cat\\)&quot; &quot;There are two cats here.&quot; 15) ;; =&amp;gt; nil&#xA;(string-match &quot;\\(dog\\|cat\\)&quot; &quot;There are horses.&quot;) ;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that if you don't plan on using &lt;code&gt;match-data&lt;/code&gt; after using &lt;code&gt;string-match&lt;/code&gt; you should prefer to use &lt;code&gt;string-match-p&lt;/code&gt; which works just like &lt;code&gt;string-match&lt;/code&gt; except that it doesn't modify &lt;code&gt;match-data&lt;/code&gt; when run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As other have said, in your case &lt;code&gt;looking-at&lt;/code&gt; would probably be a better choice anyway.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(looking-at REGEXP)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return t if text after point matches regular expression REGEXP.&#xA;  This function modifies the match data that ‘match-beginning’,&#xA;  ‘match-end’ and ‘match-data’ access; save and restore the match&#xA;  data if you want to preserve them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-02-09T18:52:16.370" LastActivityDate="2016-02-09T18:52:16.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20182" PostTypeId="1" CreationDate="2016-02-09T20:49:36.573" Score="10" ViewCount="1646" Body="&lt;p&gt;In the Buffer List, I wonder what the CRM column means and &lt;code&gt;.&lt;/code&gt;, &lt;code&gt; *&lt;/code&gt;, &lt;code&gt; %&lt;/code&gt; and &lt;code&gt;D&lt;/code&gt; mean in the column? For example&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;CRM Buffer                Size  Mode              File&#xA;. * .emacs                3294  Emacs-Lisp        ~/.emacs&#xA; %  *Help*                 101  Help&#xA;    search.c             86055  C                 ~/cvs/emacs/src/search.c&#xA; %  src                  20959  Dired by name     ~/cvs/emacs/src/&#xA;  * *mail*                  42  Mail&#xA;D%  HELLO                 1607  Fundamental       ~/cvs/emacs/etc/HELLO&#xA; %  NEWS                481184  Outline           ~/cvs/emacs/etc/NEWS&#xA;    *scratch*              191  Lisp Interaction&#xA;  * *Messages*            1554  Messages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="120" LastEditorUserId="19227" LastEditDate="2021-02-22T07:38:42.100" LastActivityDate="2021-02-22T07:38:42.100" Title="Meaning of CRM column in buffer list from `C-x C-b`?" Tags="|buffers|documentation|symbols|buffer-list|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="20183" PostTypeId="1" CreationDate="2016-02-09T20:58:28.333" Score="6" ViewCount="577" Body="&lt;p&gt;Suppose I enter the following code using &lt;code&gt;LaTeX-environment&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\begin{tikzpicture}&#xA;    \begin{pycode}&#xA;        a = 2&#xA;    \end{pycode}&#xA;\end{tikzpicture}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then auctex automatically indents as shown above. This is not desired since it will bring error messages if I compile it via pythontex because of wrong indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have two question:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How to prevent that the &lt;code&gt;pycode&lt;/code&gt; environment becomes indented if it is insied any other environment (for example tikzpicture)&lt;/li&gt;&#xA;&lt;li&gt;How to prevent that code inside a &lt;code&gt;pycode&lt;/code&gt; environment is indented by auctex.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that this is a follow up question to &lt;a href=&quot;https://emacs.stackexchange.com/q/20136/2323&quot;&gt;Pythontex and auctex&lt;/a&gt;, so the solution should work together with &lt;code&gt;mmm-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After giordanos suggestion I made a minimal .emacs file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;;; (add-to-list 'package-archives &#xA;;;     '(&quot;marmalade&quot; .&#xA;;;       &quot;http://marmalade-repo.org/packages/&quot;))&#xA;;; (add-to-list 'package-archives&#xA;;;              '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;&#xA;;; (setq package-archive-enable-alist '((&quot;melpa&quot; deft magit)))&#xA;&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/auctex&quot;)&#xA;&#xA;(package-initialize)&#xA;&#xA;(add-hook 'LaTeX-mode-hook (lambda ()&#xA;&#xA;(add-to-list 'LaTeX-verbatim-environments &quot;pycode&quot;)&#xA;(add-to-list 'LaTeX-indent-environment-list&#xA;        '(&quot;pycode&quot; current-indentation))&#xA;))&#xA;&#xA;&#xA;(require 'python)&#xA;(defun python-indent-guess-indent-offset ()&#xA;  &quot;Guess and set `python-indent-offset' for the current buffer.&quot;&#xA;  (interactive))&#xA;&#xA;(require 'mmm-auto)&#xA;(mmm-add-group 'latex-python&#xA; '((latex-python-envs&#xA;    :submode python-mode&#xA;    :face mmm-default-submode-face&#xA;    :front &quot;\\\\begin{\\(pycode\\|pyverbatim\\)}\n&quot;&#xA;    :back &quot;\\\\end{~1}\n&quot;&#xA;    :save-matches 1)&#xA;&#xA;   (latex-python-cmds&#xA;    :submode python-mode&#xA;    :face mmm-default-submode-face&#xA;    :front &quot;\\\\pyc?{&quot;&#xA;    :back &quot;}&quot;)))&#xA;&#xA;;; (setq mmm-global-mode 'maybe)&#xA;;; (setq mmm-submode-decoration-level 0)&#xA;(mmm-add-mode-ext-class 'latex-mode nil 'latex-python)&#xA;;; (global-set-key [(f11)] 'mmm-parse-buffer)&#xA;&#xA;(advice-add 'LaTeX-insert-environment ':after '(lambda (env) (mmm-parse-block 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works but messes up the syntax highlighting: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qgqhC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qgqhC.png&quot; alt=&quot;output 1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do &lt;code&gt;C-c C-n&lt;/code&gt;, it becomes ok, but the mmm-mode get's disabled:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/K7Vr3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/K7Vr3.png&quot; alt=&quot;output 2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I enable the mmm-mode again, I get the first picture again.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-10T16:28:38.817" Title="How can I prevent auctex to indent a new environment inside another environment?" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20184" PostTypeId="2" ParentId="20183" CreationDate="2016-02-09T21:04:32.663" Score="6" Body="&lt;p&gt;Add to your init file&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'LaTeX-verbatim-environments &quot;pycode&quot;)&#xA;(add-to-list 'LaTeX-indent-environment-list&#xA;        '(&quot;pycode&quot; current-indentation))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#Verbatim-content&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(info &quot;(auctex)Verbatim content&quot;)&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#Indenting&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(info &quot;(auctex)Indenting&quot;)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2016-02-10T14:34:56.137" LastActivityDate="2016-02-10T14:34:56.137" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20185" PostTypeId="2" ParentId="20182" CreationDate="2016-02-09T21:48:48.607" Score="13" Body="&lt;pre&gt;&lt;code&gt;`C' shows `&amp;gt;' if you have marked the buffer to be displayed,&#xA;          `D' if you have marked it for deletion, and&#xA;          `.' for the buffer from which you came (current).&#xA;`R' shows `%' if the buffer is read-only.&#xA;`M' shows `*' if the buffer is modified, and&#xA;          `S' if you have marked it for saving.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-09T21:48:48.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20186" PostTypeId="1" AcceptedAnswerId="20207" CreationDate="2016-02-09T22:05:50.267" Score="4" ViewCount="1418" Body="&lt;p&gt;Is there a build of &lt;strong&gt;GUI&lt;/strong&gt; Emacs for Mac that can display emoji? I tried &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; and AquaEmacs but neither of them could display it. &lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-02-11T16:48:16.010" Title="A build of GUI Emacs for OS X that can display emoji?" Tags="|osx|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20187" PostTypeId="1" CreationDate="2016-02-09T22:08:14.277" Score="10" ViewCount="4644" Body="&lt;p&gt;When you have many buffers opened, they are all shown in the buffer list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are they shown in the order of visit, from the latest to the remotest?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we organize the buffers in the buffer list somehow? For example resort them by their pathnames?&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2021-06-05T23:08:58.077" Title="Organize the buffer list?" Tags="|buffer-list|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20188" PostTypeId="2" ParentId="20187" CreationDate="2016-02-09T22:40:56.440" Score="16" Body="&lt;p&gt;I assume you are referring to the list of buffers you get with the default key binding &lt;code&gt;C-x C-b&lt;/code&gt;, which calls &lt;code&gt;list-buffers&lt;/code&gt;. That command uses &lt;code&gt;Buffer-menu-mode&lt;/code&gt; which provides some key bindings for working with the list but has limited options for sorting or filtering. For more detail on what you can do in the list, try &lt;code&gt;C-h f Buffer-menu-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs includes a more powerful buffer list that you may prefer: &lt;code&gt;ibuffer&lt;/code&gt;. This mode provides a similar list of open buffers, but with additional capabilities for sorting, filtering, grouping, and otherwise working with the list. You can try it out with &lt;code&gt;M-x ibuffer&lt;/code&gt;, and if you like it you can add this to your Emacs init file to use ibuffer instead of the default list-buffers command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-b&quot;) 'ibuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The easiest way to get started with ibuffer is to explore the menu. Look under 'View' for options to sort, filter, and mark buffers.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-02-09T22:40:56.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20189" PostTypeId="2" ParentId="20187" CreationDate="2016-02-09T22:42:54.467" Score="6" Body="&lt;p&gt;Use &lt;code&gt;C-h m&lt;/code&gt; in the buffer-list buffer to get answers to these questions and more. You can click the header of a column to resort entries by that column. Click it again to reverse. To sort by pathname, click header &lt;code&gt;File&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have a mouse then move the cursor under the column you want to sort and use &lt;code&gt;S&lt;/code&gt; to sort it. Repeat to reverse the direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;C-h m&lt;/code&gt; then near the beginning of the description of the mode you see &lt;em&gt;See &lt;code&gt;buffer-menu&lt;/code&gt; for a description of its contents.&lt;/em&gt; Follow that link (using &lt;code&gt;RET&lt;/code&gt;, aka &lt;em&gt;Enter&lt;/em&gt;) to see more info about the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Near the end of that page of information you see this: &lt;em&gt;See &lt;code&gt;Buffer-menu-mode&lt;/code&gt; for the keybindings available the Buffer Menu.&lt;/em&gt; If you follow that link then near the top of the next page of info (about &lt;code&gt;Buffer-menu-mode&lt;/code&gt;) you see this: &lt;em&gt;Parent mode: &lt;code&gt;tabulated-list-mode&lt;/code&gt;.&lt;/em&gt; If you follow that link, to see info about the parent mode, there you will see additional keys that are available in &lt;code&gt;Buffer-menu-mode&lt;/code&gt; - keys that are not specific to it but are provided by its parent mode, &lt;code&gt;tabulated-list-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Among those key descriptions you see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S       tabulated-list-sort&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That tells you that the key &lt;code&gt;S&lt;/code&gt; runs command &lt;code&gt;tabulated-list-sort&lt;/code&gt;. If you follow that link then you see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tabulated-list-sort is an interactive compiled Lisp function in&#xA;`tabulated-list.el'.&#xA;&#xA;(tabulated-list-sort &amp;amp;optional N)&#xA;&#xA;Sort Tabulated List entries by the column at point.&#xA;With a numeric prefix argument N, sort the Nth column.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's a bit roundabout, but this tells you that &lt;em&gt;if you put the cursor (&lt;/em&gt; &lt;strong&gt;point&lt;/strong&gt; &lt;em&gt;is the cursor position) in a given column and you hit &lt;code&gt;S&lt;/code&gt; then you will sort the buffer according to that column&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main lesson is that &lt;code&gt;C-h m&lt;/code&gt; gives you information about the current mode, whatever mode you are in. In that description, you can follow links to get more information.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-10T05:10:08.543" LastActivityDate="2016-02-10T05:10:08.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20190" PostTypeId="1" AcceptedAnswerId="20195" CreationDate="2016-02-09T23:16:13.943" Score="2" ViewCount="448" Body="&lt;p&gt;I'm using my local emacs to edit files on a remote cluster. Therefore I added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[ $TERM == &quot;dumb&quot; ]] &amp;amp;&amp;amp; unsetopt zle &amp;amp;&amp;amp; PS1='$ ' &amp;amp;&amp;amp; return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my remote .zshrc and I can edit and browse files without any problems. I can even compile (M-x compile) file using: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gcc test.c -o test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I checked: It runs on the cluster and not my local machine, however if I run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mpicc -std=c99 -Wall -o exec heat.c&#xA;/bin/sh: line 2: mpicc: command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I do the same in a regular SSH-Session it works without any problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use mpicc on the cluster from emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs -Q doesn't help.&lt;/p&gt;&#xA;" OwnerUserId="9653" LastActivityDate="2016-02-10T08:52:44.817" Title="TRAMP doesn't know some of the remote commands" Tags="|tramp|ssh|remote|zsh|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20192" PostTypeId="2" ParentId="20130" CreationDate="2016-02-10T00:50:25.320" Score="5" Body="&lt;p&gt;As Yasushi Shoji mentioned, the correct approach is to &lt;code&gt;let&lt;/code&gt;-bind &lt;code&gt;org-agenda-tag-filter-preset&lt;/code&gt;.  To advise just the one pre-built agenda view, you'll want to use advice around the function &lt;code&gt;org-agenda-list&lt;/code&gt;, which builds just that particular view.  Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-agenda-list-exclude-tags-advice (orig-fn &amp;amp;rest args)&#xA;  &quot;Exclude selected tags from `org-agenda-list'.&#xA;Intended as :around advice for `org-agenda-list'.&quot;&#xA;  (let ((org-agenda-tag-filter-preset '(&quot;-foo&quot;)))&#xA;    (apply orig-fn args)))&#xA;&#xA;(advice-add #'org-agenda-list :around #'my/org-agenda-list-exclude-tags-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2020-05-02T14:53:58.933" LastActivityDate="2020-05-02T14:53:58.933" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="20193" PostTypeId="1" CreationDate="2016-02-10T04:21:19.197" Score="1" ViewCount="183" Body="&lt;p&gt;I'm brand spanking new to taming the beast that is emacs. I'm using the built in &quot;customize&quot; feature (it has checkboxes and the like). However, when I save the changes, it does not prompt me where to save the .emacs init file. It saves it in a location I don't want, from which I had moved the emacs program upon installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS any general tips are welcome. I am quite overwhelmed and hardly even know where to start!&lt;/p&gt;&#xA;" OwnerUserId="11073" LastActivityDate="2016-02-10T05:28:04.610" Title="Windows issue with default .emacs file" Tags="|init-file|customize|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20194" PostTypeId="2" ParentId="20193" CreationDate="2016-02-10T05:19:52.997" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In MS Windows (&lt;em&gt;Control Panel&lt;/em&gt; &gt; &lt;em&gt;System&lt;/em&gt; &gt; &lt;em&gt;Advanced system settings&lt;/em&gt; &gt; &lt;em&gt;Environment Variables&lt;/em&gt; &gt; &lt;em&gt;User Variables&lt;/em&gt;), set  environment variable &lt;code&gt;HOME&lt;/code&gt; to the directory where you want to keep your init file, &lt;code&gt;~/.emacs&lt;/code&gt;. If &lt;code&gt;HOME&lt;/code&gt; does not already exist, use &lt;em&gt;Add&lt;/em&gt; to create it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;Init File&lt;/a&gt;, which you can get to using &lt;code&gt;C-h r g init file&lt;/code&gt;) for alternative init file names and locations.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, Customize writes your customizations into your init file. But it is better to reserve your init file for Lisp code that you write yourself.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can make Customize write your customizations to another file, whose absolute file name is the value of variable &lt;strong&gt;&lt;code&gt;custom-file&lt;/code&gt;&lt;/strong&gt;. Just put this in your init file (&lt;code&gt;~/.emacs&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-file  /your/location/to/your/custom/file/any-name.el)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And in your init file somewhere after that, tell Emacs to load your &lt;code&gt;custom-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file custom-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-10T05:28:04.610" LastActivityDate="2016-02-10T05:28:04.610" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20195" PostTypeId="2" ParentId="20190" CreationDate="2016-02-10T08:52:44.817" Score="2" Body="&lt;p&gt;Your $PATH settings in your init file are not taken into account per default. Try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-remote-path 'tramp-own-remote-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also the Tramp manual discussing this setting.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-02-10T08:52:44.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20196" PostTypeId="1" AcceptedAnswerId="20197" CreationDate="2016-02-10T09:02:13.217" Score="8" ViewCount="417" Body="&lt;p&gt;I am using &lt;code&gt;company-mode&lt;/code&gt; for completion purposes. But somehow, some package always draws in &lt;code&gt;auto-complete&lt;/code&gt; as well, which collides with &lt;code&gt;company-mode&lt;/code&gt;, since both offer a popup with completion candidates. I want to blacklist &lt;code&gt;auto-complete&lt;/code&gt;, since I do not need it. How can I do that? I know there is a variable &lt;code&gt;package-pinned-package&lt;/code&gt;, but I cannot see how to blacklist a package — maybe by using an invalid archive?&lt;/p&gt;&#xA;" OwnerUserId="759" LastEditorUserId="25" LastEditDate="2016-02-10T13:48:43.970" LastActivityDate="2016-02-10T15:31:20.533" Title="How to blacklist a package?" Tags="|package|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20197" PostTypeId="2" ParentId="20196" CreationDate="2016-02-10T10:24:41.190" Score="7" Body="&lt;p&gt;I don't know how to blacklist the installation of a package. But it's easy to prevent it from &lt;em&gt;loading&lt;/em&gt;. If you put &lt;code&gt;(provide 'auto-complete)&lt;/code&gt; in your init file, then any package that tries to load &lt;code&gt;auto-complete&lt;/code&gt; will be told that it's already loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(More precisely, this takes care of libraries that load &lt;code&gt;auto-complete&lt;/code&gt; in the normal way, with &lt;code&gt;require&lt;/code&gt;. If there's any code that uses &lt;code&gt;load&lt;/code&gt; directly (which would be unusual), &lt;a href=&quot;https://emacs.stackexchange.com/a/20205&quot;&gt;you need to put this in a separate file called &lt;code&gt;auto-complete.el&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if the package requires &lt;code&gt;auto-complete&lt;/code&gt;, it's probably because it'll use it. But maybe a package only declares autocomplete sources and has useful functionality otherwise. So you can make the part that you don't want a no-op. Depending on what the package does, you may need other similar definitions.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(provide 'auto-complete)&#xA;(defmacro ac-define-source (&amp;amp;rest ignored)&#xA;  &quot;A no-op since I blacklist `auto-complete'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-02-10T15:31:20.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20198" PostTypeId="1" CreationDate="2016-02-10T11:02:26.733" Score="4" ViewCount="321" Body="&lt;p&gt;I have a big LaTeX project divided in many files; the &lt;code&gt;\documentclass&lt;/code&gt; statement and the preamble are in the main file, that in turn includes many (~20) other files, one for every chapter.  One of the statements in the main file is &lt;code&gt;\usepackage{paralist}&lt;/code&gt;, in order to use the environment &lt;code&gt;compactdesc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visiting the main file, in the &lt;em&gt;AucTeX&lt;/em&gt; &lt;code&gt;LaTeX -&amp;gt; Insert Environment&lt;/code&gt; menu, &lt;code&gt;compactdesc&lt;/code&gt; is listed; and &lt;code&gt;M-Enter&lt;/code&gt; inside the environment inserts an &lt;code&gt;\item&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; asks for the label of that item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visiting one of the included file, the lack of a &lt;code&gt;\usepackage&lt;/code&gt; causes no inclusion of the &lt;code&gt;compactdesc&lt;/code&gt; environment in the &lt;code&gt;LaTeX -&amp;gt; Insert Environment&lt;/code&gt; menu list; and I don't like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Giving the command &lt;code&gt;M-x LaTeX-environment&lt;/code&gt; followed by &lt;code&gt;compactdesc&lt;/code&gt;, inserts in the file a &lt;code&gt;\begin{compactdesc}&lt;/code&gt;-&lt;code&gt;\end{compactdesc}&lt;/code&gt; couple, but &lt;code&gt;M-Enter&lt;/code&gt; does &lt;strong&gt;not&lt;/strong&gt; ask for the item label - and I would like to be able to enter the labels for every \item added.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried with the local variables at the end of the file, inserting the lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Local Variables:&#xA;% mode: latex&#xA;% TeX-master: master.tex&#xA;% ispell-local-dictionary: &quot;italian&quot;&#xA;% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(where master is the main TeX file); but still &lt;code&gt;LaTeX -&amp;gt; Insert Environment&lt;/code&gt; does not know about &lt;code&gt;compactdesc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do, to have both 1) the environment &lt;code&gt;compactdesc&lt;/code&gt; available and 2) AucTeX knowing about items of that environment having a label?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for any help.&lt;/p&gt;&#xA;" OwnerUserId="11074" LastActivityDate="2017-08-04T17:37:14.697" Title="AucTeX - insert environment menu command" Tags="|auctex|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="20199" PostTypeId="1" CreationDate="2016-02-10T11:17:08.877" Score="1" ViewCount="144" Body="&lt;p&gt;I don't like to waste screen space, so usually I have the menu bar hidden. Sometimes, I'd like to show it nevertheless, so I have bound the &quot;menu&quot; key to menu-bar-mode. Works perfectly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key '[(apps)]                  'menu-bar-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My emacs window is always maximised. That's no problem when showing the menu bar. But when I hide it again, the window is not maximised any more. It is resized and the height of the menu bar is missing :( Is there a way to prevent this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make it more complicated: I'm talking about native windows Emacs&#xA;(GNU Emacs 24.5.1 (x86_64-w64-mingw32) of 2015-05-16 on KAEL)&lt;/p&gt;&#xA;" OwnerUserId="10128" LastActivityDate="2017-03-14T11:38:56.823" Title="How can I keep the emacs window at a constant size when hiding/showing the menu bar?" Tags="|frames|microsoft-windows|menu-bar|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20200" PostTypeId="1" CreationDate="2016-02-10T12:20:22.770" Score="1" ViewCount="45" Body="&lt;p&gt;I am lost in Gnus documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I report spam to Gmane when read Gmane NNPP in Gnus?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load gnus-art&#xA;   (setq gnus-visible-headers (concat gnus-visible-headers &quot;\\|^Archived-At:\\|^List-URL:&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in order to visit web page and push report button manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load gnus&#xA;  (require 'spam)&#xA;  (spam-initialize)&#xA;  (setq gnus-spam-process-newsgroups&#xA;        '((&quot;^gmane\\.&quot; ((spam spam-use-gmane))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I am unsure if this is correct way and if that worked at all.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-02-10T15:37:55.430" LastActivityDate="2016-02-11T08:04:23.217" Title="Report spam to Gmane?" Tags="|gnus|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20201" PostTypeId="1" CreationDate="2016-02-10T12:41:55.737" Score="13" ViewCount="1567" Body="&lt;p&gt;Sometimes I want to call &lt;code&gt;unload-feature&lt;/code&gt; to unload a library… and it a library depends on it… and another library depends on that library…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I unload a library and all the libraries that depends on it, without walking through the dependency tree manually?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common use case is to unload all the libraries of a package (e.g. when upgrading or uninstalling), so if there's a way to do that, it would be good enough.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2017-02-27T21:15:13.783" LastActivityDate="2017-02-27T21:16:27.200" Title="Unload a whole package or library tree" Tags="|package|libraries|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20202" PostTypeId="1" CreationDate="2016-02-10T13:31:19.520" Score="6" ViewCount="561" Body="&lt;p&gt;I would like to use special mark symbols not only in &lt;code&gt;window-system&lt;/code&gt; but also in &lt;code&gt;xterm&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-summary-to-prefix (if window-system &quot;▒ &quot; &quot;==&amp;gt; &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What check I should use?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="25" LastEditDate="2016-02-10T13:47:20.940" LastActivityDate="2016-03-11T16:10:01.597" Title="Check if terminal supports Unicode" Tags="|terminal-emacs|character-encoding|term|unicode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20204" PostTypeId="2" ParentId="20202" CreationDate="2016-02-10T14:40:23.340" Score="3" Body="&lt;p&gt;It's probably not just about whether Unicode is available but also whether a given font supports a particular Unicode character. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure that it helps for non-graphic (i.e., console/terminal) Emacs, but for a graphic display you can use &lt;code&gt;char-displayable-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;char-displayable-p is an autoloaded Lisp function in `mule-util.el'.&#xA;&#xA;(char-displayable-p CHAR)&#xA;&#xA;Return non-nil if we should be able to display CHAR.&#xA;On a multi-font display, the test is only whether there is an&#xA;appropriate font from the selected frame's fontset to display&#xA;CHAR's charset in general.  Since fonts may be specified on a&#xA;per-character basis, this may not be accurate.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-10T14:40:23.340" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20205" PostTypeId="2" ParentId="20196" CreationDate="2016-02-10T14:51:40.643" Score="7" Body="&lt;p&gt;What @Gilles wrote is the general answer I would have given also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But note that using &lt;code&gt;provide&lt;/code&gt; does &lt;em&gt;not&lt;/em&gt; prevent code from loading the package. It prevents code from loading the package only by &lt;code&gt;require&lt;/code&gt;. If code uses &lt;code&gt;load&lt;/code&gt;, &lt;code&gt;load-library&lt;/code&gt;, &lt;code&gt;load-file&lt;/code&gt; etc. then this trick has no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really need to prevent code from loading a given library, a better approach is to provide a proxy library that gets loaded in its stead. For example, in a directory that comes earlier in your &lt;code&gt;load-path&lt;/code&gt;, add a phony &lt;code&gt;auto-complete.el&lt;/code&gt; that does nothing except &lt;code&gt;(provide 'auto-complete)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That way, whenever code tries to load the library using &lt;code&gt;load&lt;/code&gt; or &lt;code&gt;load-library&lt;/code&gt; your proxy library will be loaded instead of the one you are avoiding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if code uses &lt;code&gt;load-file&lt;/code&gt; and provides the absolute address of the file of the library you are trying to avoid, then that file will be loaded. I don't see a good solution for that case (except to remove or replace that file).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-10T14:51:40.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20206" PostTypeId="1" CreationDate="2016-02-10T14:51:56.020" Score="4" ViewCount="1105" Body="&lt;p&gt;I want to load &lt;code&gt;flyspell-mode&lt;/code&gt; and execute &lt;code&gt;flyspell-buffer&lt;/code&gt; automatically after emacs loaded a tex file. I tried the following which loads &lt;code&gt;flyspell-mode&lt;/code&gt; but doesn't seem to execute &lt;code&gt;flyspell-buffer&lt;/code&gt;. What would be the proper way to to this? How do I have to change it if I want it on every file not just on LaTeX-files?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ispell-program-name &quot;hunspell&quot;)&#xA;(setq ispell-local-dictionary &quot;de_DE&quot;)&#xA;(setq ispell-local-dictionary-alist&#xA;      '((&quot;de_DE&quot; &quot;[[:alpha:]]&quot; &quot;[^[:alpha:]]&quot; &quot;[']&quot; nil nil nil utf-8)&#xA;    (&quot;en_US&quot; &quot;[[:alpha:]]&quot; &quot;[^[:alpha:]]&quot; &quot;[']&quot; nil nil nil utf-8)&#xA;    ))&#xA;&#xA;&#xA;(add-hook 'LaTeX-mode-hook 'turn-on-flyspell)&#xA;(add-hook 'LaTeX-mode-hook 'flyspell-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2019-07-27T21:15:16.640" Title="Run flyspell-buffer automatically after emacs loads a (tex)-file" Tags="|auctex|flyspell|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20207" PostTypeId="2" ParentId="20186" CreationDate="2016-02-10T15:49:52.560" Score="9" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/railwaycat/mirror-emacs-mac&quot;&gt;Emacs Mac Port&lt;/a&gt; is said to support emoji display out of the box:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Can display color bitmap fonts such as Apple Color Emoji, if&#xA;  compiled and executed on Mac OS X 10.7 or later.  Also supports&#xA;  display of some combinations of regional indicator symbols, such&#xA;  as U+1F1EF followed by U+1F1F5, as national flags.  Variation&#xA;  Selectors 15 (text-style) and 16 (emoji-style) are also supported.&#xA;  On OS X 10.10.3 and later, emoji modifiers for skin tones (U+1F3FB - U+1F3FF) are supported as well.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's available in a &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot;&gt;Homebrew Tap&lt;/a&gt;.  To enable the tap and install the port, type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ brew tap railwaycat/emacsmacport&#xA;$ brew install emacs-mac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can manually configure the Emacs' font choice to use Apple's Emoji font:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font t 'symbol (font-spec :family &quot;Apple Color Emoji&quot;)&#xA;                  frame 'prepend)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you'll need to apply this to every new frame, and thus call it in a function for &lt;code&gt;after-make-frame-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should work on a normal Cocoa build of standard Emacs, e.g. from &lt;code&gt;brew install emacs&lt;/code&gt; or &lt;a href=&quot;http://emacsformacosx.com&quot;&gt;Emacs for Mac OS X&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-02-10T15:49:52.560" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="20208" PostTypeId="2" ParentId="20198" CreationDate="2016-02-10T15:50:02.593" Score="1" Body="&lt;p&gt;Well, the last suggestion did the magic...  So I have to download the master file first and the included file second?  No problem.  Thank you, giordano, for your suggestions and your tolerance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I experimented a little bit more. I added to the master file the local variable (at the end of the file) &lt;code&gt;%%% mode: latex&lt;/code&gt; — that did the trick (in addition to the &lt;code&gt;%%% TeX-master: &quot;master&quot;&lt;/code&gt; local variable in the included files).&lt;/p&gt;&#xA;" OwnerUserId="11074" LastEditorUserId="25" LastEditDate="2016-04-11T08:19:14.163" LastActivityDate="2016-04-11T08:19:14.163" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20209" PostTypeId="1" AcceptedAnswerId="20220" CreationDate="2016-02-10T17:26:22.053" Score="1" ViewCount="348" Body="&lt;p&gt;I'm using Aquamacs on OS X and have multiple monitors in my setup. I'd like for all my Aquamacs frames to open with a certain position and size. In fact, my problem is rather similar to &lt;a href=&quot;https://stackoverflow.com/questions/11457317/on-mac-open-an-emacs-frame-in-a-specific-monitor&quot;&gt;this one&lt;/a&gt; on StackOverflow. &lt;a href=&quot;https://stackoverflow.com/a/11460472/2636454&quot;&gt;This solution&lt;/a&gt; of using &lt;code&gt;modify-frame-parameters&lt;/code&gt; seems to have worked for setting the initial frame to my preferred position and size, but any additional frames open on my main monitor with a certain size and position, which are not the ones I want. I've tried many and varied solutions for fixing this including setting &lt;code&gt;default-frame-alist&lt;/code&gt;, setting &lt;code&gt;smart-frame-positioning-mode&lt;/code&gt; to nil, setting &lt;code&gt;user-position&lt;/code&gt; to t, and even more. Yet, I'm still stuck with any additional frames opening in my main monitor with dimensions that I didn't specify. I even have this same problem in vanilla Emacs, so I guess this isn't specific to Aquamacs. Additionally, my version of OS X is 10.11.4 Beta, in case the OS / windowing system is causing this. Can someone specify a surefire way to have all frames open in a certain position and size on Emacs / Aquamacs for OS X?&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-02-11T02:40:12.243" Title="How to set the dimensions of additional frames in Emacs / Aquamacs (OS X)" Tags="|osx|frames|customize|aquamacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20210" PostTypeId="1" CreationDate="2016-02-10T18:08:18.227" Score="2" ViewCount="731" Body="&lt;p&gt;I have custom visit history ring which is independant of search seach engine used. I would like spacemacs smart search filled my ring as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;1. I'm in some buffer under location1.&#xA;2. I've pressed &quot;SPC *&quot; or &quot;SPC /&quot; to do smart searching.&#xA;   a. during this helm process I can temporary visit intermediate locations&#xA;      through TAB key press. Let's say I visited: location2 and location3.&#xA;   b. but I pressed enter for location4.&#xA;3. I end up in location4.&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want location1 and location4 be added to my history ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do You have an idea, what functions do I need to advice or what hooks to use in order to achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is helm-ag-pop-stack, that might be helpful, but on the other hand it handles ag search engine only, while spacemacs smart search mechanism uses other engines as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Global mark ring does not leave location1 either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;best regards&lt;/p&gt;&#xA;" OwnerUserId="11050" LastEditorUserId="105" LastEditDate="2016-02-10T18:11:30.693" LastActivityDate="2024-04-01T02:04:45.517" Title="spacemacs: keep track locations of smart search" Tags="|helm|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20211" PostTypeId="2" ParentId="20210" CreationDate="2016-02-10T20:15:52.877" Score="0" Body="&lt;p&gt;I think I've found the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is enough to advice 'before' and 'after' following functions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;spacemacs/helm-project-smart-do-search ;; SPC /&lt;/p&gt;&#xA;&#xA;&lt;p&gt;spacemacs/helm-project-smart-do-search-region-or-symbol ;; SPC *&lt;/p&gt;&#xA;&#xA;&lt;p&gt;best regards&lt;/p&gt;&#xA;" OwnerUserId="11050" LastActivityDate="2016-02-10T20:15:52.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20212" PostTypeId="1" CreationDate="2016-02-10T20:35:45.243" Score="1" ViewCount="896" Body="&lt;p&gt;In my dot-emacs I have the following backend for Company:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-to-list 'company-backends 'company-dabbrev t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Eshell, I use another company backends. So it's configured as the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'eshell-mode-hook&#xA;        (lambda ()&#xA;          (set (make-local-variable 'company-backends)&#xA;               '((company-shell company-eshell-history)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in &lt;code&gt;eshell-mode&lt;/code&gt; Company is also using &lt;code&gt;company-dabbrev&lt;/code&gt; backend for the completion candidates, next to the backends &lt;code&gt;company-shell&lt;/code&gt; and &lt;code&gt;company-eshell-history&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm wondering how I could 'tell' company do not use &lt;code&gt;company-dabbrev&lt;/code&gt; backend when the buffer is in &lt;code&gt;eshell-mode&lt;/code&gt;. I couldn't find any answer/solution on this.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-02-10T20:35:45.243" Title="Avoid company backend in a specific mode" Tags="|company-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20213" PostTypeId="1" CreationDate="2016-02-10T20:48:10.597" Score="22" ViewCount="9183" Body="&lt;p&gt;It says emacs/bin/emacs.exe. If it's not necesarily useful, I'd like to stop it from starting with emacs. The extra window is messing me up a bit.&lt;/p&gt;&#xA;" OwnerUserId="11073" LastEditorUserId="105" LastEditDate="2016-02-10T23:08:03.340" LastActivityDate="2016-02-10T23:08:03.340" Title="How to start Emacs without the cmd.exe window (on MS Windows)?" Tags="|microsoft-windows|start-up|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20214" PostTypeId="2" ParentId="20213" CreationDate="2016-02-10T21:01:13.380" Score="41" Body="&lt;p&gt;Instead of opening &lt;code&gt;emacs.exe&lt;/code&gt; directly, open &lt;code&gt;runemacs.exe&lt;/code&gt;. This will open Emacs without the extra window in the background.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2016-02-10T21:01:13.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20215" PostTypeId="1" CreationDate="2016-02-10T21:20:50.717" Score="2" ViewCount="222" Body="&lt;p&gt;I want to save a buffer somewhere temporary so I can later say bring up that buffer I was using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an equivalent to minimizing a window/buffer? I know you can kill the buffer to go to the previous one, but a true minimizing concept would be ideal.&lt;/p&gt;&#xA;" OwnerUserId="11073" LastEditorUserId="25" LastEditDate="2016-02-11T17:46:43.640" LastActivityDate="2016-02-11T17:46:43.640" Title="Switch to another buffer, then back to the first" Tags="|buffers|window|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20216" PostTypeId="1" CreationDate="2016-02-10T21:44:55.117" Score="4" ViewCount="5714" Body="&lt;p&gt;I think they have smaller file sizes meaning they are zipped. Is this right?&lt;/p&gt;&#xA;" OwnerUserId="11073" LastActivityDate="2016-02-10T22:18:26.920" Title="Why do some files generated by emacs have a tilde after their name?" Tags="|files|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20217" PostTypeId="2" ParentId="20216" CreationDate="2016-02-10T21:57:04.377" Score="8" Body="&lt;p&gt;These are backup files created by Emacs. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup.html#Backup&quot; rel=&quot;noreferrer&quot;&gt;Backup&lt;/a&gt; in the Emacs Manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Names.html#Backup-Names&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; also says this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When Emacs makes a backup file, its name is normally constructed by appending &lt;code&gt;~&lt;/code&gt; to the file name being edited; thus, the backup file for &lt;code&gt;eval.c&lt;/code&gt; would be &lt;code&gt;eval.c~&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the second (main) part of the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No, backup files created by Emacs are not compressed; the smaller size of &lt;code&gt;foo.txt~&lt;/code&gt; compared to &lt;code&gt;foo.txt&lt;/code&gt; means that &lt;code&gt;foo.txt&lt;/code&gt; &lt;em&gt;was smaller&lt;/em&gt; when &lt;code&gt;foo.txt~&lt;/code&gt; was created.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-02-10T22:18:26.920" LastActivityDate="2016-02-10T22:18:26.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20218" PostTypeId="2" ParentId="20215" CreationDate="2016-02-10T22:40:54.583" Score="5" Body="&lt;p&gt;The concept of buffer and window in Emacs can be confusing to new users: the terms are used to mean different things in Emacs than in other tools. (See for example &lt;a href=&quot;https://emacs.stackexchange.com/questions/13583/whats-the-difference-between-a-buffer-a-file-a-window-and-a-frame&quot;&gt;this question&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.cs.uwp.edu/Documentation/emacs/emacs_17.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Manual&lt;/a&gt; provides details about using multiple buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the specific question: many buffers can be open at one time in Emacs, and you can freely switch between them without having to minimize or kill anything. You can simply switch to another buffer by name (&lt;code&gt;C-x b&lt;/code&gt;) or choose one from the list of open buffers (&lt;code&gt;C-x C-b&lt;/code&gt;). As mentioned in the comments you can also use &lt;code&gt;bury-buffer&lt;/code&gt;, which moves the buffer you are currently looking at to the end of the list of buffers and shows you the next one. You can split the frame in to several windows and display a different buffer in each one... There are many options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are a new Emacs user I would suggest going through the Emacs Tutorial, which covers the basics. You can start the tutorial in Emacs using &lt;code&gt;C-h t&lt;/code&gt; (control h, followed by t). &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-10T22:40:54.583" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20220" PostTypeId="2" ParentId="20209" CreationDate="2016-02-10T23:58:02.707" Score="1" Body="&lt;p&gt;The following is an example usage of feature request 21415 for OSX and a couple of different versions of Windows.  [FYI:  feature request 21415 increased in scope to include several bug fixes affecting frame sizes and positioning, menu-bar, etc.]  I have already figured out my display width/height ahead of time using &lt;code&gt;display-pixel-width&lt;/code&gt; and &lt;code&gt;display-pixel-height&lt;/code&gt; for my various computers, and incorporated those known values into the example below.  For example, I already know that my desktop computer running OSX is 1920 x 1080, my MacBook Pro 17 inch laptop is 1920 by 1200 and my MacBookAir 13 inch laptop is 1280 x 800.  Run some tests ahead of time using &lt;code&gt;M-x eval-expression RET (display-pixel-width) RET&lt;/code&gt; and &lt;code&gt;M-x eval-expression RET (display-pixel-height RET&lt;/code&gt; and adjust the code based on your monotor.  I use &lt;code&gt;top&lt;/code&gt; &lt;strong&gt;0&lt;/strong&gt; and &lt;code&gt;left&lt;/code&gt; &lt;strong&gt;0&lt;/strong&gt;.  The original poster will probably end up using different values for &lt;code&gt;top&lt;/code&gt; and &lt;code&gt;left&lt;/code&gt; along with incorporating a test similar to what Drew suggested as an answer in the related link to target a particular display -- e.g., using the function &lt;code&gt;display-monitor-attributes-list&lt;/code&gt; to return a list containing values such as &lt;code&gt;&quot;.DISPLAY1&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a &lt;code&gt;make-frame&lt;/code&gt; example:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(make-frame '(&#xA; (name . &quot;HELLO-WORLD&quot;)&#xA; (font . &quot;-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1&quot;)&#xA; (top . 100)&#xA; (left . 100)&#xA; (left-fringe . 8)&#xA; (right-fringe . 8)&#xA; (vertical-scroll-bars)&#xA; (cursor-color . &quot;yellow&quot;)&#xA; (cursor-type . (bar . 1))&#xA; (background-color . &quot;black&quot;)&#xA; (foreground-color . &quot;white&quot;)&#xA; (tool-bar-lines . 0)&#xA; (menu-bar-lines . 0)&#xA; (width . (text-pixels . 400))&#xA; (height . (text-pixels . 400)) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is an example using the &lt;code&gt;default-frame-alist&lt;/code&gt;, which works for the initial frame and subsequently created frames that do not contain specific parameters that trump the default setting.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(when (eq system-type 'darwin)&#xA;  (setq ns-auto-hide-menu-bar t))&#xA;&#xA;(let* (&#xA;    (display-pixel-width (display-pixel-width))&#xA;    (display-pixel-height (display-pixel-height))&#xA;    (font&#xA;      (cond&#xA;        ((eq system-type 'darwin)&#xA;          '(font . &quot;-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1&quot;))&#xA;        ((eq system-type 'windows-nt)&#xA;          '(font . &quot;-outline-Courier New-normal-normal-normal-mono-18-*-*-*-c-*-iso10646-1&quot;))))&#xA;    (top '(top . 0))&#xA;    (left '(left . 0))&#xA;    (left-fringe '(left-fringe . 8))&#xA;    (right-fringe '(right-fringe . 8))&#xA;    (vertical-scroll-bars '(vertical-scroll-bars . nil))&#xA;    (cursor-color '(cursor-color . &quot;yellow&quot;))&#xA;    (cursor-type '(cursor-type . (bar . 1)))&#xA;    (background-color '(background-color . &quot;black&quot;))&#xA;    (foreground-color '(foreground-color . &quot;white&quot;))&#xA;    (tool-bar-lines '(tool-bar-lines . 0))&#xA;    (menu-bar-lines '(menu-bar-lines . 0))&#xA;    width&#xA;    height)&#xA;  (cond&#xA;    ((eq system-type 'darwin)&#xA;      (cond&#xA;        ((and&#xA;            (= 1920 display-pixel-width)&#xA;            (= 1080 display-pixel-height))&#xA;          (setq width '(width . (text-pixels . 1900)))&#xA;          (setq height '(height . (text-pixels . 1054))))&#xA;        ((and&#xA;            (= 1920 display-pixel-width)&#xA;            (= 1200 display-pixel-height))&#xA;          (setq width '(width . (text-pixels . 1900)))&#xA;          (setq height '(height . (text-pixels . 1174))))&#xA;        ((and&#xA;            (= 1280 display-pixel-width)&#xA;            (= 800 display-pixel-height))&#xA;          (setq width '(width . (text-pixels . 1259)))&#xA;          (setq height '(height . (text-pixels . 771))))))&#xA;    ((and&#xA;        (eq system-type 'windows-nt)&#xA;        (equal (w32-version) '(5 1 2600)))&#xA;      (cond&#xA;        ((and&#xA;            (= 1920 display-pixel-width)&#xA;            (= 1002 display-pixel-height))&#xA;          (setq width '(width . (text-pixels . 1896)))&#xA;          (setq height '(height . (text-pixels . 938))))&#xA;        ((and&#xA;            (= 1920 display-pixel-width)&#xA;            (= 1122 display-pixel-height))&#xA;          (setq width '(width . 172))&#xA;          (setq height '(height . 52)))&#xA;        ((and&#xA;            (= 1280 display-pixel-width)&#xA;            (= 722 display-pixel-height))&#xA;          (setq width '(width . 114))&#xA;          (setq height '(height . 32)))))&#xA;    ((and&#xA;        (eq system-type 'windows-nt)&#xA;        (equal (w32-version) '(6 1 7601)))&#xA;      (cond&#xA;        ((and&#xA;            (= 1920 display-pixel-width)&#xA;            (= 1080 display-pixel-height))&#xA;          (setq width '(width . 172))&#xA;          (setq height '(height . 52)))&#xA;        ((and&#xA;            (= 1920 display-pixel-width)&#xA;            (= 1200 display-pixel-height))&#xA;          (setq width '(width . 172))&#xA;          (setq height '(height . 58)))&#xA;        (t&#xA;                (message &quot;Not yet contemplated.&quot;)))) )&#xA;  (setq default-frame-alist (list&#xA;    font&#xA;    top&#xA;    left&#xA;    left-fringe&#xA;    right-fringe&#xA;    vertical-scroll-bars&#xA;    cursor-color&#xA;    cursor-type&#xA;    background-color&#xA;    foreground-color&#xA;    tool-bar-lines&#xA;    menu-bar-lines&#xA;    width&#xA;    height)) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-02-11T02:40:12.243" LastActivityDate="2016-02-11T02:40:12.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20221" PostTypeId="2" ParentId="16560" CreationDate="2016-02-11T03:00:32.743" Score="1" Body="&lt;p&gt;Technically it's a custom grammar: &#xA;&lt;a href=&quot;https://stackoverflow.com/questions/21442715/what-is-the-format-of-logstash-config-file&quot;&gt;https://stackoverflow.com/questions/21442715/what-is-the-format-of-logstash-config-file&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is supposed to be just for logstash configs: &lt;a href=&quot;https://github.com/Wilfred/logstash-conf.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/Wilfred/logstash-conf.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across this answer looking for something for Atom. Nothing exists as far as I can tell, but similarly the Ruby and JSON modes in Atom do an OK job of highlighting and indenting (auto-indent also works).&lt;/p&gt;&#xA;" OwnerUserId="11079" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-02-11T03:00:32.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20222" PostTypeId="1" AcceptedAnswerId="20228" CreationDate="2016-02-11T04:35:30.110" Score="2" ViewCount="350" Body="&lt;p&gt;I have implemented the solution of Yasushi Shoji in a previous thread -- &lt;a href=&quot;https://emacs.stackexchange.com/questions/20124/colorizing-functions-variables-within-comments-in-c-mode&quot;&gt;Colorizing `functions/variables&amp;#39; within comments in `c-mode&amp;#39;&lt;/a&gt; -- to highlight Lisp function/variable names in &lt;code&gt;c-mode&lt;/code&gt; &lt;strong&gt;comments&lt;/strong&gt; that begin with a back-tick and end with a single quote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* See the doc-string for `pos-visible-in-window-p'.  */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;c-font-lock-doc-comments&lt;/code&gt; unfortunately does away with the ability to highlight the comment beginning/ending with &lt;code&gt;font-lock-comment-delimiter-face&lt;/code&gt;, which is a member of &lt;code&gt;c-literal-faces&lt;/code&gt;.  What happens is that the entire comment (except for the function/variable) gets highlighted with &lt;code&gt;c-doc-face-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The unsophisticated approach is to redefine &lt;code&gt;c-font-lock-doc-comments&lt;/code&gt; by removing or commenting out the offending code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(c-put-font-lock-face region-beg region-end c-doc-face-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, doing so will break the &lt;em&gt;intended&lt;/em&gt; functionality for the three (3) other forms of predefined &lt;code&gt;c-doc-comment-style&lt;/code&gt; -- i.e., &lt;strong&gt;javadoc&lt;/strong&gt;, &lt;strong&gt;autodoc&lt;/strong&gt;, and &lt;strong&gt;gtkdoc&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a more sophisticated means to preserve the &lt;code&gt;font-lock-comment-delimiter-face&lt;/code&gt; for comment beginning/ending and preserve the &lt;code&gt;font-lock-comment-face&lt;/code&gt; for everything except the function/variable that is highlighted with Yasushi's solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The prior solution of Yasushi is as follows:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cc-mode)&#xA;&#xA;(setq yashi-font-lock-doc-comments&#xA;  (let ((symbol &quot;[a-zA-Z0-9_-]+&quot;))&#xA;    `((,(concat &quot;`&quot; symbol &quot;'&quot;)&#xA;       0 ,c-doc-markup-face-name prepend nil))&#xA;    ))&#xA;&#xA;(setq yashi-font-lock-keywords&#xA;  `((,(lambda (limit)&#xA;        (c-font-lock-doc-comments &quot;/\\*&quot; limit&#xA;          yashi-font-lock-doc-comments)&#xA;        ))))&#xA;&#xA;&#xA;(add-hook 'c-mode-hook&#xA;          (lambda ()&#xA;            (setq c-doc-comment-style '((c-mode . yashi)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-11T13:28:14.183" Title="Part II -- Colorizing `functions/variables' within comments in `c-mode'" Tags="|font-lock|c-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20223" PostTypeId="1" CreationDate="2016-02-11T06:02:51.657" Score="3" ViewCount="240" Body="&lt;p&gt;first time StackExchange user here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having trouble with highlight-chars (probably font-lock) and magit.&#xA;Enabling hc-toggle-highlight-* functions will remove the coloring from magit buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rlahA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rlahA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibly duplicate:&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/13568/font-lock-for-strings-messes-up-non-code-buffers&quot;&gt;Font-lock for strings messes up non-code buffers&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone else have this trouble, or know some possible workaround?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimum .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(package-initialize)&#xA;&#xA;(require 'magit) ;; Current version 20160210.555&#xA;(require 'highlight-chars) ;; Current version 20151231.1335&#xA;&#xA;;; (hc-toggle-highlight-tabs t)&#xA;;; (hc-toggle-highlight-trailing-whitespace t)&#xA;(add-hook 'font-lock-mode-hook 'hc-highlight-tabs)&#xA;(add-hook 'font-lock-mode-hook 'hc-highlight-trailing-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11080" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2018-04-08T00:48:41.380" Title="highlight-chars and magit is conflicting" Tags="|magit|font-lock|highlight-chars|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20224" PostTypeId="2" ParentId="20200" CreationDate="2016-02-11T08:04:23.217" Score="1" Body="&lt;p&gt;I have set these parameters on my [Gmane]-topic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((spam-process&#xA;  ((spam spam-use-gmane)))&#xA; (spam-summary-exit-behavior 'move-none)&#xA; (spam-use-hashcash nil)&#xA; (spam-use-crm114 nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last two are &quot;just to be sure&quot;, to turn off hashcash and crm114, which I have turned on globally (I think).&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-02-11T08:04:23.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20225" PostTypeId="1" CreationDate="2016-02-11T09:46:54.077" Score="1" ViewCount="123" Body="&lt;p&gt;Reading the documentation for &lt;code&gt;ido-find-file&lt;/code&gt; it says pressing &lt;code&gt;C-d&lt;/code&gt; will open the specified directory in dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I can't get this to work no matter what text I leave in the minibuffer, could someone explain how to get this working please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Windows x64, Emacs 25.0.50.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Update: works on 24.3.1 on BSD)&lt;/p&gt;&#xA;" OwnerUserId="727" LastEditorUserId="727" LastEditDate="2016-02-11T13:58:42.497" LastActivityDate="2016-02-11T13:58:42.497" Title="ido-find-file and dropping into directory" Tags="|ido-find-file|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20226" PostTypeId="2" ParentId="20098" CreationDate="2016-02-11T11:38:04.633" Score="1" Body="&lt;p&gt;Though having not found how to defer the password request, I have learned a lot about &lt;em&gt;desktops&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to exclude gpg-files from &lt;code&gt;desktop-save&lt;/code&gt; there is the variable &lt;code&gt;desktop-files-not-to-save&lt;/code&gt; that is documented&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Regexp identifying files whose buffers are to be excluded from saving.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The default value as shown in the customize buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\(^/[^/:]*:\|(ftp)$\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;excludes TRAMP files from being saved.  With the following regexp no files ending in &lt;code&gt;.gpg&lt;/code&gt; are saved, too&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\(^/[^/:]*:\|(ftp)$\)\|\(\.gpg$\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this is a first pragmatic answer to my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I have to learn about the alternatives to &lt;em&gt;desktop mode&lt;/em&gt; for &lt;a href=&quot;https://www.emacswiki.org/emacs/SessionManagement&quot; rel=&quot;nofollow&quot;&gt;Session Management&lt;/a&gt;.  Maybe there is something more clever ;-)&lt;/p&gt;&#xA;" OwnerUserId="934" LastActivityDate="2016-02-11T11:38:04.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20227" PostTypeId="1" CreationDate="2016-02-11T13:15:10.947" Score="1" ViewCount="29" Body="&lt;p&gt;How can you move a sub menu -- for example: &lt;code&gt;Search Documentation&lt;/code&gt; under &lt;code&gt;Help&lt;/code&gt; -- to the main menu?&lt;/p&gt;&#xA;" OwnerUserId="2763" LastEditorUserId="2763" LastEditDate="2016-02-11T16:49:36.210" LastActivityDate="2016-02-11T16:49:36.210" Title="Moving a sub menu to the main menu" Tags="|menu-bar|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20228" PostTypeId="2" ParentId="20222" CreationDate="2016-02-11T13:28:14.183" Score="4" Body="&lt;p&gt;You are using the wrong tool. The &lt;code&gt;c-doc&lt;/code&gt; system is used to highlight doxygen-style comments, which is why it changes the face from &lt;code&gt;font-lock-comment-face&lt;/code&gt; to &lt;code&gt;font-lock-doc-face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another drawback is that you can only have one doc style, so if you use it to highlight symbols, you can't use it for anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is code to add a plain font-lock keyword, with the twist that the symbol must be in a comment.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-highlight-symbol-font-lock-keywords-matcher (limit)&#xA;  &quot;Search for quoted symbols in comments.&#xA;Match group 0 is the entire construct, 1 the symbol.&quot;&#xA;  (let (res)&#xA;    (while&#xA;        (and (setq res (re-search-forward &quot;`\\([a-zA-Z0-9_-]+\\)'&quot; limit t))&#xA;             (not (nth 4 (syntax-ppss)))))  ; Continue, unless in a comment&#xA;    res))&#xA;&#xA;(defun my-highlight-symbol-activate ()&#xA;  &quot;Highlight symbols quoted in BACKTICK-TICK in comments.&quot;&#xA;  (font-lock-add-keywords nil&#xA;                          '((my-highlight-symbol-font-lock-keywords-matcher&#xA;                             (1 font-lock-constant-face prepend)))))&#xA;&#xA;(add-hook 'c-mode-common-hook #'my-highlight-symbol-activate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-02-11T13:28:14.183" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20229" PostTypeId="2" ParentId="20223" CreationDate="2016-02-11T14:44:59.563" Score="1" Body="&lt;p&gt;You might need to look at the Magit code to see what it is doing. You don't say what highlighting Magit does normally, and just what changes when &lt;a href=&quot;http://www.emacswiki.org/emacs/download/highlight-chars.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow noreferrer&quot;&gt;Highlight Library&lt;/a&gt;) is added to the mix. I don't use Magit -- maybe someone else can speak to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;highlight-chars.el&lt;/code&gt; does add to &lt;code&gt;font-lock-keywords&lt;/code&gt; for things like highlighting tabs and trailing whitespace. It's possible that this interferes with the font-lock keywords used by Magit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, user option &lt;strong&gt;&lt;code&gt;hc-font-lock-override&lt;/code&gt;&lt;/strong&gt; controls whether the current highlighting face used by &lt;code&gt;hc-*&lt;/code&gt; commands overrides (&lt;code&gt;t&lt;/code&gt;), is overridden by (&lt;code&gt;keep&lt;/code&gt;), or merges with (&lt;code&gt;append&lt;/code&gt; or &lt;code&gt;prepend&lt;/code&gt;) any existing highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should thus be able to make &lt;code&gt;hc-*&lt;/code&gt; highlighting cohabit well with other text-property highlighting - you can control which highlighting of a given piece of text, highlighting by &lt;code&gt;hc-*&lt;/code&gt; or highlighting by some other code, has precedence, and how much it dominates the other highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., you can set the value of &lt;code&gt;hc-font-lock-override&lt;/code&gt; to &lt;code&gt;keep&lt;/code&gt; (e.g., using &lt;code&gt;M-x customize-option hc-font-lock-override&lt;/code&gt;), to prevent &lt;code&gt;hc-*&lt;/code&gt; highlighting from overwriting any already existing highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also options &lt;code&gt;hc-other-chars&lt;/code&gt; and &lt;code&gt;hc-other-chars-NOT&lt;/code&gt;, which control which chars are governed by &lt;code&gt;hc-toggle-highlight-other-chars&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also try changing the order (i.e., when you turn on the &lt;code&gt;hc-*&lt;/code&gt; highlighting). &lt;code&gt;hc-highlight-trailing-whitespace&lt;/code&gt; and &lt;code&gt;hc-highlight-tabs&lt;/code&gt; just add patterns to match at the &lt;em&gt;end&lt;/em&gt; of &lt;code&gt;font-lock-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, be aware that highlighting from &lt;em&gt;text properties&lt;/em&gt; (e.g. &lt;code&gt;face&lt;/code&gt; or &lt;code&gt;font-lock-face&lt;/code&gt;) always has less precedence than highlighting from &lt;em&gt;overlays&lt;/em&gt;.  Library &lt;code&gt;highlight-chars.el&lt;/code&gt; uses text-property highlighting, as does all use of font-lock. If some other library uses overlay highlighting on the same text area then the overlay highlighting wins in case of conflict - always.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[2018-04-07: I updated &lt;code&gt;highlight-chars.el&lt;/code&gt; to let option &lt;code&gt;hc-font-lock-override&lt;/code&gt; (previously called &lt;code&gt;hc-other-chars-font-lock-override&lt;/code&gt;) control all &lt;code&gt;hc-*&lt;/code&gt; highlighting, not just other-char highlighting.]&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2018-04-08T00:48:41.380" LastActivityDate="2018-04-08T00:48:41.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20230" PostTypeId="1" AcceptedAnswerId="20245" CreationDate="2016-02-11T17:20:31.423" Score="7" ViewCount="707" Body="&lt;p&gt;Can I filter what Flyspell may check in the buffer? I don't want it to spell-check code in Markdown mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I can use the font-face at point for that? Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((get-char-property (point) 'face))&#xA;  (when (equal face &quot;markdown-pre-face&quot;)&#xA;    ;; no spell-check&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/9347/2332&quot;&gt;This question&lt;/a&gt; is similar, but the solution there works only for Org-mode.&lt;/p&gt;&#xA;" OwnerUserId="2332" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-06-13T06:05:00.430" Title="How to make Flyspell ignore code blocks in Markdown?" Tags="|flyspell|markdown-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20231" PostTypeId="1" AcceptedAnswerId="20310" CreationDate="2016-02-11T18:41:17.547" Score="4" ViewCount="452" Body="&lt;p&gt;I'm going through a LaTeX document fixing a bunch of broken references. I use AUCTeX. I ran &lt;code&gt;TeX-toggle-debug-warnings&lt;/code&gt; to make &lt;code&gt;TeX-next-error&lt;/code&gt; jump to warnings about references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my document also has &lt;a href=&quot;https://tex.stackexchange.com/questions/292410/babel-and-index-both-redefine-markboth-and-markright&quot;&gt;other warnings that I don't care about right now&lt;/a&gt;. So I compile, I press &lt;code&gt;C-x `&lt;/code&gt;, and each time I get these two warnings before the interesting ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell AUCTeX to ignore specific warnings? (This question isn't about the &lt;code&gt;\markboth&lt;/code&gt;/&lt;code&gt;\markright&lt;/code&gt; warnings in particular, I expect to enter a regexp somewhere.) Either on a document by document basis, or in my init file.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-02-21T16:07:02.220" Title="Ignore specific warnings in AUCTeX" Tags="|auctex|compilation|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20232" PostTypeId="2" ParentId="20089" CreationDate="2016-02-11T21:39:23.990" Score="2" Body="&lt;p&gt;Vanilla imenu presents things hierarchically, so you'd first have to choose between Public/Private/All functions, before you actually chose from a list of actual function. However, this is confusing with other imenu frontends that show them all at the same time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are distinct entries in the &lt;code&gt;imenu-generic-expression&lt;/code&gt; value that &lt;code&gt;php-mode&lt;/code&gt; defines for private, protected, public, and all functions. You could remove the &quot;all&quot; entry or remove the private, protected, and public entries to make things appear once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example this will remove the &quot;All Methods&quot; category from &lt;code&gt;imenu&lt;/code&gt; in &lt;code&gt;php-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;php-mode&quot;&#xA;  (add-hook 'php-mode-hook&#xA;            (defun my-php-mode-hook ()&#xA;              (setq-local imenu-generic-expression&#xA;                    (cl-remove-if &#xA;                     (lambda (entry) (equal (car entry) &quot;All Methods&quot;))&#xA;                     php-imenu-generic-expression)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may want to look at the definition of &lt;code&gt;php-imenu-generic-expression&lt;/code&gt; to better understand what the hook is doing.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-02-11T21:45:11.140" LastActivityDate="2016-02-11T21:45:11.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20233" PostTypeId="1" CreationDate="2016-02-11T23:27:34.187" Score="0" ViewCount="701" Body="&lt;p&gt;My file has one book listed per line, title first followed by a tab character, followed by the author's name.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TITLE&amp;lt;TAB&amp;gt;AUTHOR&#xA;TITLE&amp;lt;TAB&amp;gt;AUTHOR&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to swap the two fields, such that the author's name appears first on each line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AUTHOR&amp;lt;TAB&amp;gt;TITLE&#xA;AUTHOR&amp;lt;TAB&amp;gt;TITLE&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could accomplish this with a keyboard macro, but it seems like the sort of thing which might come up again. It seems to me that Emacs Lisp should be able to do the job, but how to go about it? What if next time I want to delete a field, or filter lines based on specific fields?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, AWK excels at exactly these kinds of tasks. What about Emacs Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: To reiterate, I'd like to do this with elisp, rather than &lt;code&gt;evil&lt;/code&gt;, &lt;code&gt;org&lt;/code&gt;, or other features.&lt;/p&gt;&#xA;" OwnerUserId="890" LastEditorUserId="105" LastEditDate="2016-03-13T22:05:45.213" LastActivityDate="2016-03-13T22:05:45.213" Title="How to swap two tab-separated values on a line, and generalize the process?" Tags="|text-editing|formatting|tabs|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20234" PostTypeId="2" ParentId="20233" CreationDate="2016-02-12T00:20:45.507" Score="0" Body="&lt;p&gt;use evil-mode, then type,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%s/\([a-zA-Z0-9]*\)\t\([a-zA-Z0-9]*\)/\2\t\1/g&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;delete the first field,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%s/\([a-zA-Z0-9]*\)\t\([a-zA-Z0-9]*\)/\2/g&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;delete rows whose first field is TITLE,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;g/TITLE\t/d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;delete rows whose first field is NOT TITLE,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;v/TITLE\t/d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The point is, LEARN regular expression for text processing.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-02-15T03:02:15.407" LastActivityDate="2016-02-15T03:02:15.407" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20235" PostTypeId="1" AcceptedAnswerId="20238" CreationDate="2016-02-12T00:27:35.430" Score="7" ViewCount="3278" Body="&lt;p&gt;I'm transitioning from VIM (using &lt;code&gt;GNU Emacs 24.5.1&lt;/code&gt;). I want to move between &quot;windows&quot; using familiar keys i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-k&quot;) 'windmove-up)&#xA;(global-set-key (kbd &quot;C-j&quot;) 'windmove-down)&#xA;(global-set-key (kbd &quot;C-h&quot;) 'windmove-left)&#xA;(global-set-key (kbd &quot;C-l&quot;) 'windmove-right)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However in org-mode...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-k runs the command org-kill-line, which is an interactive Lisp&#xA;  function in `org.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to C-k.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(org-kill-line &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Kill line, to tags or end of line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So I tried removing the &lt;code&gt;org-kill-line&lt;/code&gt; mapping but I couldn't get it to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;org&quot;&#xA;   '(define-key org-mode-map [remap org-kill-line] nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I've only been using emacs for 3 days so far.&lt;/p&gt;&#xA;" OwnerUserId="11088" LastActivityDate="2016-02-12T01:31:56.197" Title="Remove key-mapping from org-mode" Tags="|org-mode|key-bindings|evil|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20236" PostTypeId="1" AcceptedAnswerId="20237" CreationDate="2016-02-12T00:38:49.437" Score="3" ViewCount="857" Body="&lt;p&gt;In Spacemacs, how can I customize a variable used in a layer that's loaded lazily? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I'm trying to use Zathura and Synctex with Spacemacs' Latex layer. I have the following code in my &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;tex&quot;&#xA;  '(progn&#xA;     (add-to-list 'TeX-view-program-list&#xA;                  '(&quot;Zathura&quot;&#xA;                    (&quot;zathura &quot;&#xA;                     (mode-io-correlate &quot; --synctex-forward %n:0:%b   -x \&quot;emacsclient +%{line} %{input}\&quot; &quot;)&#xA;                     &quot; %o&quot;)&#xA;                    &quot;zathura&quot;))&#xA;     (add-to-list 'TeX-view-program-selection&#xA;                  '(output-pdf &quot;Zathura&quot;))&#xA;     (TeX-PDF-mode 1)&#xA;     ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My intent is to mutate the variables &lt;code&gt;TeX-view-program-list&lt;/code&gt; and &lt;code&gt;TeX-view-program-selection&lt;/code&gt; after the Latex layer is loaded since before that the variables are free, but this code doesn't seem to be working. Note that if I explicitly evaluate those two &lt;code&gt;add-to-list&lt;/code&gt; expressions after opening a &lt;code&gt;.tex&lt;/code&gt; file, they have their intended effect and Spacemacs defaults to viewing with Zathura.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know if there's a canonical way to customize the variables used in the Emacs modes provided by Spacemacs layers?&lt;/p&gt;&#xA;" OwnerUserId="6540" LastEditorUserId="105" LastEditDate="2018-12-24T16:49:18.590" LastActivityDate="2018-12-24T16:49:18.590" Title="How to customize a lazy-loaded variable?" Tags="|spacemacs|start-up|customization|eval-after-load|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20237" PostTypeId="2" ParentId="20236" CreationDate="2016-02-12T00:55:25.047" Score="7" Body="&lt;p&gt;Replace &lt;code&gt;'(progn ...)&lt;/code&gt; with &lt;code&gt;(progn ...)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By putting the quote there you are specifically telling emacs NOT to evaluate the code in your &lt;code&gt;progn&lt;/code&gt;. In fact you don't need progn at all. It looks like you are trying to treat &lt;code&gt;with-eval-after-load&lt;/code&gt; like &lt;code&gt;eval-after-load&lt;/code&gt;. Note the signature differences: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(with-eval-after-load FILE &amp;amp;rest BODY)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;vs&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(eval-after-load FILE FORM)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is how it should be written:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;tex&quot;&#xA;  (add-to-list 'TeX-view-program-list&#xA;               '(&quot;Zathura&quot;&#xA;                 (&quot;zathura &quot;&#xA;                  (mode-io-correlate &quot; --synctex-forward %n:0:%b   -x \&quot;emacsclient +%{line} %{input}\&quot; &quot;)&#xA;                  &quot; %o&quot;)&#xA;                 &quot;zathura&quot;))&#xA;  (add-to-list 'TeX-view-program-selection&#xA;               '(output-pdf &quot;Zathura&quot;))&#xA;  (TeX-PDF-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also note that nothing here is specific to Spacemacs, this is the same for any autoloaded Emacs package.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-02-12T20:20:48.907" LastActivityDate="2016-02-12T20:20:48.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20238" PostTypeId="2" ParentId="20235" CreationDate="2016-02-12T01:31:56.197" Score="9" Body="&lt;p&gt;Org-mode is built-in to Emacs 24.5.1, so there's no need to &lt;code&gt;eval-after-load&lt;/code&gt;. &lt;code&gt;with-eval-after-load&lt;/code&gt; is also &lt;a href=&quot;http://www.lunaryorn.com/2013/06/25/introducing-with-eval-after-load.html&quot; rel=&quot;noreferrer&quot;&gt;preferred over&lt;/a&gt; &lt;code&gt;eval-after-load&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of trying to remap &lt;code&gt;org-kill-line&lt;/code&gt;, why not just specify &lt;kbd&gt;C-k&lt;/kbd&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-k&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, there may be other modes that bind a common key like &lt;kbd&gt;C-k&lt;/kbd&gt;. Instead, you can use &lt;kbd&gt;C-c k&lt;/kbd&gt;. The &lt;kbd&gt;C-(letter)&lt;/kbd&gt; keys, by convention, are &lt;a href=&quot;https://stackoverflow.com/a/1758639/864684&quot;&gt;reserved for user-specified bindings&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-02-12T01:31:56.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20239" PostTypeId="1" AcceptedAnswerId="24898" CreationDate="2016-02-12T02:18:20.053" Score="7" ViewCount="1199" Body="&lt;p&gt;In Cider, I can use &lt;code&gt;C-c ,&lt;/code&gt; to run the tests for the current namespace. This will work whether I'm currently in the source namespace or the test namespace itself (and indeed, this magic behavior is discussed in detail &lt;a href=&quot;https://github.com/clojure-emacs/cider#running-tests&quot;&gt;in the README&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that Cider already knows how to find the test namespace for a given source namespace (and I'd assume that finding the reverse is a similar problem), is there a function that I can use to quickly switch from a source buffer (e.g. &lt;code&gt;src/example/core.clj&lt;/code&gt;) to its test buffer (e.g. &lt;code&gt;test/example/core_test.clj&lt;/code&gt;) and vice versa?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastActivityDate="2016-07-28T14:23:20.833" Title="How can I quickly switch between source namespace and test namespace?" Tags="|clojure|testing|cider|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20240" PostTypeId="1" AcceptedAnswerId="20241" CreationDate="2016-02-12T06:09:03.413" Score="15" ViewCount="3742" Body="&lt;p&gt;When in javascript mode trying to use &lt;code&gt;C-c C-m i&lt;/code&gt; get an error saying  &quot;&lt;code&gt;C-c RET&lt;/code&gt; is undefined?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What makes Emacs believe I am pressing &lt;code&gt;RET&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i properly make this keybinding work?&lt;/p&gt;&#xA;" OwnerUserId="10814" LastEditorUserId="253" LastEditDate="2016-02-12T16:42:13.857" LastActivityDate="2021-08-17T00:08:11.940" Title="How to distinguish C-m from RETURN?" Tags="|key-bindings|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20241" PostTypeId="2" ParentId="20240" CreationDate="2016-02-12T06:31:13.140" Score="25" Body="&lt;p&gt;Emacs &quot;thinks&quot; that &lt;code&gt;C-m&lt;/code&gt; is &lt;code&gt;RET&lt;/code&gt; because &quot;Control M&quot; is the ASCII control character &quot;carriage return&quot;. Even though this reason is &quot;historical&quot; Emacs can run in a terminal and so it needs to support the way terminals &lt;em&gt;still&lt;/em&gt; work now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try opening a terminal window, typing &quot;&lt;code&gt;ls&lt;/code&gt;&quot;, and pressing &lt;code&gt;C-m&lt;/code&gt;. You will see that it is interpreted as &quot;return&quot;, even though you are &lt;strong&gt;not&lt;/strong&gt; in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://en.wikipedia.org/wiki/Control_character&quot; rel=&quot;noreferrer&quot;&gt;Control character&lt;/a&gt; on Wikipedia for details about control characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To distinguish &lt;code&gt;C-m&lt;/code&gt; from &lt;code&gt;RET&lt;/code&gt; in a GUI Emacs, one could change &lt;code&gt;C-i&lt;/code&gt; to &lt;code&gt;C-m&lt;/code&gt; in &lt;a href=&quot;https://emacs.stackexchange.com/a/221/2355&quot;&gt;&lt;strong&gt;@nispio&lt;/strong&gt;'s answer&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key input-decode-map [?\C-m] [C-m])&#xA;&#xA;;; now we can do this:&#xA;&#xA;(defun my-command ()&#xA;  (interactive)&#xA;  (message &quot;C-m is not the same as RET any more!&quot;))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;C-m&amp;gt;&quot;) #'my-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/17509/2355&quot;&gt;How to distinguish C-i from TAB?&lt;/a&gt;, which is very closely related.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/220/2355&quot;&gt;How to bind C-i as different from TAB?&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/a/221/2355&quot;&gt;this answer&lt;/a&gt; in particular.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-12T17:03:04.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20243" PostTypeId="2" ParentId="16750" CreationDate="2016-02-12T11:35:56.607" Score="12" Body="&lt;p&gt;The Emacs one is actually better. Here's why, The purpose of syntax highlighting in text editors is not being pretty, but to make important code structures stand out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the Emacs sample, you'll see 'MyClass' being colored in the 'type name' color and 'obj' in 'variable' color, which makes the important information that you have one variable 'obj' of type 'MyClass' in the current scope really stand out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you happen to have other local variables, member variables or function parameters, you'll see them colored in similar way.  I personally think this helps a lot because I can  easily see where are these variables declared and where are they instantiated in a glance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The logic behind Emacs' syntax highlighting is that it doesn't highlight where you reference(use) symbols, instead, it only highlights where symbols are defined or declared.  These are much more important and informative then symbols being used. Let's face it, other than declarations and keywords, almost everything else is some symbols being referenced. Coloring these only makes the screen messier and the really important things less obvious.&lt;/p&gt;&#xA;" OwnerUserId="11092" LastActivityDate="2016-02-12T11:35:56.607" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20244" PostTypeId="1" AcceptedAnswerId="20249" CreationDate="2016-02-12T11:52:23.290" Score="1" ViewCount="489" Body="&lt;p&gt;It's really sad not to write well formatted angularJs code inside emacs, the image below shows what I am saying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is happening inside the photo is that the code is already well formatted as it is, but when I create a new line it become like the photo shows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If any one knows any solution to this problem, it would be so helpful to me.&#xA;(note i've used angularJs mode but in vain)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;update:&lt;/strong&gt; what i'm expecting is auto indentation is working as the file suggesting which means if the file is indented with 4-spaces so the indent-level would be 4 spaces, if it's 2-spaces the indent-level would be 2-spaces and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what is set now at my .emacs file is &lt;code&gt;(setq global-tab-width 2)&lt;/code&gt; but that doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;note&lt;/strong&gt;: i've done what is suggested in Jordon Biondo answer but that forces me to apply this change for Js files only where i need it to be globally applied&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/K1wzE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/K1wzE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11093" LastEditorUserId="11093" LastEditDate="2016-02-13T15:43:47.540" LastActivityDate="2016-02-13T15:43:47.540" Title="Emacs indent AngularJS code to wrong level" Tags="|formatting|javascript|indentation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20245" PostTypeId="2" ParentId="20230" CreationDate="2016-02-12T11:55:22.563" Score="6" Body="&lt;p&gt;The accepted answer for org-mode is written by me. org-mode is tricky because its own check-word-predicate is already defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;markdown is simpler because it uses default predicate provided by flyspell-mode,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun flyspell-generic-textmode-verify ()&#xA;  &quot;Used for `flyspell-generic-check-word-predicate' in text modes.&quot;&#xA;  ;; (point) is next char after the word. Must check one char before.&#xA;  (let ((f (get-text-property (- (point) 1) 'face)))&#xA;    (not (memq f '(markdown-pre-face)))))&#xA;&#xA;(setq flyspell-generic-check-word-predicate 'flyspell-generic-textmode-verify)&#xA;(flyspell-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By the way, &lt;code&gt;M-x describe-function ENTER flyspell-prog-mode ENTER&lt;/code&gt;, you will find similar setup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the Source, Luke.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-02-12T12:40:45.947" LastActivityDate="2016-02-12T12:40:45.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20246" PostTypeId="2" ParentId="18543" CreationDate="2016-02-12T11:58:18.053" Score="1" Body="&lt;p&gt;This seems an issue with PIA. By default they restrict SMTP access through their service to avoid SPAM abuse. You can contact their helpdesk to allow access to gmail from your account:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In order to have your SMTP server white listed, please submit a ticket&#xA;  via the following link (or emailing&#xA;  helpdesk@privateinternetaccess.com):&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;https://support.privateinternetaccess.com/index.php?/Tickets/Submit&quot; rel=&quot;nofollow&quot;&gt;https://support.privateinternetaccess.com/index.php?/Tickets/Submit&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Include the name of your SMTP server (smtp.gmail.com for example) and&#xA;  the IP address (74.125.136.109 for example) for the server. To get the&#xA;  IP address for the server, go to &lt;a href=&quot;http://ping.eu/ping/&quot; rel=&quot;nofollow&quot;&gt;http://ping.eu/ping/&lt;/a&gt; and put your&#xA;  email server in the box there, and click the black Go button. This&#xA;  will ping the server four times, then stop. Copy the IP address for&#xA;  the server, and include it in your ticket.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://support.privateinternetaccess.com/KnowledgeBase/Article/View/33&quot; rel=&quot;nofollow&quot; title=&quot;Source&quot;&gt;Source: PIA Knowledgebase&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11070" LastActivityDate="2016-02-12T11:58:18.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20248" PostTypeId="2" ParentId="20233" CreationDate="2016-02-12T12:37:56.680" Score="4" Body="&lt;h2&gt;Description&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You should use regular expression replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll describe how I would do the replacement with &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;swiper&lt;/a&gt;, the built-in &lt;code&gt;isearch-forward-regexp&lt;/code&gt; would work in a similar way but with more keys.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; (&lt;code&gt;swiper&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Enter &lt;code&gt;.*&lt;/code&gt; &lt;kbd&gt;C-q TAB&lt;/kbd&gt; &lt;code&gt;.*&lt;/code&gt;. There is a single space on each side of the tab char in the middle.&lt;/li&gt;&#xA;&lt;li&gt;Under the hood, &lt;code&gt;swiper&lt;/code&gt; translates the input string &lt;code&gt;&quot;.* \t .*&quot;&lt;/code&gt; into a regex string &lt;code&gt;&quot;\(.*\).*?\(\t\).*?\\(.*\)&quot;&lt;/code&gt;. Which I think is pretty great: the user input is nearly halved.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-q&lt;/kbd&gt; (&lt;code&gt;swiper-query-replace&lt;/code&gt;). Remember the above regex string? It has capture 3 groups, the title is in the first, the tab in the second, and the author in the third. So you need to enter: &lt;code&gt;\3&lt;/code&gt; &lt;kbd&gt;C-q TAB&lt;/kbd&gt; &lt;code&gt;\1&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Finally, either keep pressing &lt;kbd&gt;y&lt;/kbd&gt; or &lt;kbd&gt;n&lt;/kbd&gt; on each item, or press &lt;kbd&gt;!&lt;/kbd&gt; once to do all the replacements.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Screenshots&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Step 1-2-3&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Up9Sk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Up9Sk.png&quot; alt=&quot;step-1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 4&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ya82n.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ya82n.png&quot; alt=&quot;step-2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 5&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iryeY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iryeY.png&quot; alt=&quot;step-3&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The result&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/I7jmX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/I7jmX.png&quot; alt=&quot;step-4&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Key bindigs summary&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here's what I got from &lt;code&gt;view-lossage&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-s [swiper]&#xA;.* [self-insert-command]&#xA;SPC [self-insert-command]&#xA;C-q [quoted-insert]&#xA;&amp;lt;tab&amp;gt; SPC [self-insert-command]&#xA;.* [self-insert-command]&#xA;M-q [swiper-query-replace]&#xA;\3 [self-insert-command]&#xA;C-q [quoted-insert]&#xA;&amp;lt;tab&amp;gt; \1 [self-insert-command]&#xA;&amp;lt;return&amp;gt; [exit-minibuffer]&#xA;!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2016-02-12T12:43:02.473" LastActivityDate="2016-02-12T12:43:02.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20249" PostTypeId="2" ParentId="20244" CreationDate="2016-02-12T14:34:32.070" Score="1" Body="&lt;p&gt;The provided javascript mode,&lt;code&gt;js-mode&lt;/code&gt;, indents with four spaces by default, and you are trying to edit code that was indented with two spaces. You need to to change your indent settings to use two spaces instead like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-js-mode-hook ()&#xA;  (setq-local js-indent-level 2))&#xA;&#xA;(add-hook 'js-mode-hook 'my-js-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Will fix your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-variable&lt;/code&gt; to customize &lt;code&gt;js-indent-level&lt;/code&gt; if you prefer the customize interface.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-02-12T15:43:42.900" LastActivityDate="2016-02-12T15:43:42.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20251" PostTypeId="2" ParentId="20233" CreationDate="2016-02-12T15:25:33.967" Score="3" Body="&lt;p&gt;My course of action would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Copy the data into Org file (or buffer, where I then call &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;org-mode&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u C-u C-c |&lt;/kbd&gt; to convert it to an Org table.&lt;/li&gt;&#xA;&lt;li&gt;Manipulate the table columns as I need.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;org-table-export&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;code&gt;orgtbl-to-tsv&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-02-12T15:25:33.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20252" PostTypeId="1" CreationDate="2016-02-12T15:48:03.597" Score="3" ViewCount="195" Body="&lt;p&gt;I've got the following elisp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq proc (start-process &quot;powershell&quot; &quot;*powershell*&quot; &quot;powershell.exe&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I can't seem to get &lt;code&gt;proc&lt;/code&gt; to do anything.  For instance, in an normal shell, I can say &lt;code&gt;Get-Credential&lt;/code&gt; and be presented with a GUI popup asking for a username/password.  What I imagine as the analog simply doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(process-send-string proc &quot;Get-Credential\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get my process to do something?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I essentially want a shell that I can manipulate programmatically.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2016-02-19T20:23:39.820" LastActivityDate="2016-02-19T20:23:39.820" Title="Basic process management under Windows" Tags="|microsoft-windows|shell|process|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20254" PostTypeId="1" AcceptedAnswerId="20256" CreationDate="2016-02-12T16:21:22.830" Score="2" ViewCount="815" Body="&lt;p&gt;I am currently using Zsh in my regular terminal app on my Mac OS X. However, it's heavily customized and colors don't appear properly inside Emacs. So I am thinking, I should probably use &lt;code&gt;shell-mode&lt;/code&gt; with a different &lt;code&gt;zshrc&lt;/code&gt; or use &quot;Bash&quot; as the default shell in &lt;code&gt;shell-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="11097" LastEditorUserId="2355" LastEditDate="2016-02-12T16:42:49.603" LastActivityDate="2016-02-12T16:42:49.603" Title="How can i use a different shell in Emacs Shell?" Tags="|shell|shell-mode|bash|zsh|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20255" PostTypeId="2" ParentId="3798" CreationDate="2016-02-12T16:28:50.667" Score="-1" Body="&lt;p&gt;I could not get @Fu86's answer to work but the following worked for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jkf/helm-find-files-navigate-forward (orig-fun &amp;amp;rest args)&#xA;  (if (file-directory-p (helm-get-selection)) &#xA;      (helm-execute-persistent-action)&#xA;    (apply orig-fun args)))&#xA;(advice-add 'helm-confirm-and-exit-minibuffer &#xA;   :around #'jkf/helm-find-files-navigate-forward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;see also: &lt;a href=&quot;https://stackoverflow.com/questions/27652371/how-can-i-change-emacs-helm-find-file-default-action-on-directory-to-be-go-insid&quot;&gt;https://stackoverflow.com/questions/27652371/how-can-i-change-emacs-helm-find-file-default-action-on-directory-to-be-go-insid&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1&gt;Edit&lt;/h1&gt;&#xA;&lt;p&gt;My solution works in helm-20141112.946 but in helm-20160211.934 it does not work and @Fu86 answer is the solution&lt;/p&gt;&#xA;" OwnerUserId="11098" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-02-18T20:17:26.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20256" PostTypeId="2" ParentId="20254" CreationDate="2016-02-12T16:32:18.560" Score="2" Body="&lt;p&gt;You can explicitly set which shell &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;shell&lt;/code&gt; uses by customizing &lt;code&gt;explicit-shell-file-name&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your zsh config causes problems with &lt;code&gt;shell&lt;/code&gt; you might try &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;term&lt;/code&gt; or &lt;code&gt;ansi-term&lt;/code&gt; instead which may play better with your config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If nothing quite works right, you could always use tmux or screen to flip between emacs and a real shell.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-02-12T16:32:18.560" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20258" PostTypeId="1" CreationDate="2016-02-12T17:34:30.983" Score="1" ViewCount="40" Body="&lt;p&gt;The macro &lt;code&gt;kbd&lt;/code&gt; doesn't work for all desired input. For example, this results in an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(kbd &quot;C-H-left&quot;)&#xA;edmacro-parse-keys: C-H- must prefix a single character, not left&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and should be written as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(kbd &quot;C-H-&amp;lt;left&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is an alternative (vector) syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[?\C-\H-x home]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this representation also isn't unique: the vector above has the same meaning as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[(control hyper x) home]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;code&gt;(kbd &quot;RET&quot;)&lt;/code&gt; isn't &lt;code&gt;[return]&lt;/code&gt;, but &lt;code&gt;?\C-m&lt;/code&gt;. Same with &lt;code&gt;(kbd &quot;DEL&quot;)&lt;/code&gt; and others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forms &lt;code&gt;(kbd &quot;\e\eq&quot;)&lt;/code&gt; and &lt;code&gt;[?\e \?M-q]&lt;/code&gt; represent the same key sequence, but have different values:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(kbd &quot;\e\eq&quot;)  ; evaluated to &quot;^[^[q&quot;&#xA;&#xA;[?\e \?M-q]    ; evaluated to [27 134217841]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are all these syntax rules available in Emacs &gt;= v22.x?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which syntax is &lt;strong&gt;consistent and regular&lt;/strong&gt;? Which mini-language describing key sequences has &lt;strong&gt;fewer special cases&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that I need to consult references every time I make a new key binding. Consider binding &lt;code&gt;ESC M-H-kp-2 C-PgUp&lt;/code&gt; or similar.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="2355" LastEditDate="2016-02-12T19:13:08.977" LastActivityDate="2016-02-12T19:13:08.977" Title="Consistent way to represent key sequences?" Tags="|key-bindings|syntax|style|" AnswerCount="0" CommentCount="3" ClosedDate="2016-02-12T19:36:12.567" ContentLicense="CC BY-SA 3.0" />
  <row Id="20259" PostTypeId="1" CreationDate="2016-02-12T19:35:34.903" Score="3" ViewCount="167" Body="&lt;p&gt;Seems that &lt;code&gt;src/keyboard.c&lt;/code&gt; file contains C string arrays for &lt;code&gt;(info &quot;(elisp) Function Keys&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get that list in Elisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discovered that such symbols have special properties:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbol-plist 'backspace)&#xA;==&amp;gt; (event-symbol-element-mask (backspace 0) event-symbol-elements (backspace) ascii-character 127 event-kind function-key modifier-cache ((8388608 . s-backspace) (201326592 . C-M-backspace) (134217728 . M-backspace) (67108864 . C-backspace) (0 . backspace) (100663296 . C-S-backspace)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But some of them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbol-plist 'XF86AudioPlay)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;are empty until I press corresponding key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all pressed keys it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapatoms (lambda (ob) (when (eq (get ob 'event-kind) 'function-key)&#xA;                    (message &quot;%s&quot; ob)))&#xA;            obarray)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You ask why? Because I dig in Emacs internals...&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2016-08-15T01:47:51.953" LastActivityDate="2016-08-15T01:47:51.953" Title="How can I list all function keys?" Tags="|emacs-internals|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20260" PostTypeId="1" CreationDate="2016-02-12T20:33:26.463" Score="0" ViewCount="63" Body="&lt;p&gt;I found out there is movies browser for Emacs.&#xA;But there is no instruction of how to get it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/larsmagne/movie.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/larsmagne/movie.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9686" LastEditorUserId="105" LastEditDate="2016-02-12T23:03:57.297" LastActivityDate="2016-02-12T23:03:57.297" Title="How to install movie.el (movie browser for Emacs)?" Tags="|package|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20261" PostTypeId="1" CreationDate="2016-02-12T20:52:02.797" Score="1" ViewCount="2014" Body="&lt;p&gt;When I try to do &lt;code&gt;C-c C-c&lt;/code&gt; to run my buffer (python.el), I get the error: &lt;code&gt;Wrong type argument: arrayp, nil&lt;/code&gt;. This is what the backtrace looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument arrayp nil)                                                                                                                       &#xA;  replace-regexp-in-string(&quot;[^-0-9a-zA-Z_./\n]&quot; &quot;\\\\\\&amp;amp;&quot; nil)                                                                                                                       &#xA;  shell-quote-argument(nil)                                                                                                                                                          &#xA;  python-shell-parse-command()                                                                                                                                                       &#xA;  byte-code(&quot;^H\203^S^@\301\302\303 \&quot;\304\305!\306^H!\307UE\207\303 \310\311E\207&quot; [current-prefix-arg read-string &quot;Run Python: &quot; python-shell-parse-command y-or-n-p &quot;Make dedicat$&#xA;  call-interactively(run-python)                                                                                                                                                     &#xA;  python-shell-get-or-create-process()                                                                                                                                               &#xA;  python-shell-send-region(1 598 nil)                                                                                                                                                &#xA;  python-shell-send-buffer(nil)                                                                                                                                                      &#xA;  call-interactively(python-shell-send-buffer nil nil)                                                                                                                               &#xA;  command-execute(python-shell-send-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyone know what's going on? I'm fairly new to emacs, but &lt;code&gt;C-c C-c&lt;/code&gt; has never worked for me because of this error.&lt;/p&gt;&#xA;" OwnerUserId="10657" LastActivityDate="2016-06-11T21:08:27.777" Title="Python.el - Wrong type argument: arrayp, nil" Tags="|python|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20262" PostTypeId="1" AcceptedAnswerId="20275" CreationDate="2016-02-12T20:52:14.757" Score="1" ViewCount="68" Body="&lt;p&gt;I try to get around Wisent/Semantic and I'm playing with toy languages at this point. Issue I'm stuck with is how to mark multiple variable declarations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My toy language has only WORD terminal and all terminals should get VARIABLE-TAG. I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%token WORD&#xA;%start words&#xA;&#xA;words : word&#xA;      | words word&#xA;        (append $1 (list $2))&#xA;      ;&#xA;&#xA;word : WORD&#xA;        (VARIABLE-TAG $1 nil nil)&#xA;     ;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above seems to mark only first word as variable. How to properly use VARIABLE-TAG so that all words are marked as variables?&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-03-13T22:04:56.053" LastActivityDate="2016-03-13T22:04:56.053" Title="How to properly use VARIABLE-TAG in Wisent?" Tags="|variables|semantic-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20264" PostTypeId="1" CreationDate="2016-02-12T22:45:04.260" Score="23" ViewCount="1049" Body="&lt;p&gt;I've spent many, many hours now trying to get any sort of SMIE indentation rule/grammar/thing working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any examples of a small, toy or skeleton SMIE-based mode with &lt;strong&gt;&lt;em&gt;documentation&lt;/em&gt;&lt;/strong&gt; on how it actually works, or any discussion anywhere about how to use it? Something that, say, defines an expression as a string of tokens ending in semi-colon and a block as some expressions between brackets and nothing else. Really, really simple?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specific questions: when using smie-config-show-indent 90% of the time I get the response ':list-intro &quot;&quot; -&gt; nil'.  What is list-intro basing its definition of an expression or a list of expressions on? Why does it say nil and still indent the following lines? How do I change it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly: is there any relationship between my grammar and my smie-rules? I assume there is because they are both passed into smie-setup, but I can't find any way of saying, &quot;when you see a 'block', indent the contents&quot;, for example, based on a grammar that identifies a block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thirdly, SMIE seems to have lots of rules &quot;baked in&quot;. Just kicking it off gives a general handling of brackets, braces, and parenthesis for instance. Is there any way of seeing these rules or modifying them? Or is it that the syntax table is doing all this and SMIE is literally doing nothing at all (which I'm starting to suspect).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, when trying to debug SMIE I try to do an &quot;edit, eval mode buffer, go to example code in other buffer, M-X &amp;lt;my mode&amp;gt;, test&quot; cycle but it seems that each trip around does not clear out the rules from the previous cycle. How can I be sure that define-derived-mode starts from a clean sheet? I have (kill-all-local-variables) in there but it doesn't seem to be enough and I end up having to close emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not posting any examples of what I have because I have nothing that even vaguely works, aside from highlighting (using font-lock-defaults, so it's not even really SMIE I guess). I need some real baby steps.&lt;/p&gt;&#xA;" OwnerUserId="6545" LastEditorUserId="9942" LastEditDate="2016-06-26T14:42:35.773" LastActivityDate="2023-03-31T20:06:43.850" Title="Is there any SMIE documentation that is clear?" Tags="|indentation|smie|" AnswerCount="3" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="20265" PostTypeId="2" ParentId="20261" CreationDate="2016-02-12T23:00:47.770" Score="1" Body="&lt;p&gt;The problem seems to lie with &lt;code&gt;python-shell-parse-command&lt;/code&gt;. It is passing &lt;code&gt;nil&lt;/code&gt; to &lt;code&gt;shell-quote-argument&lt;/code&gt;, and that function expects a string argument, not &lt;code&gt;nil&lt;/code&gt;. (Actually, it passes &lt;code&gt;nil&lt;/code&gt; on to &lt;code&gt;replace-regexp-in-string&lt;/code&gt;, who complains. But I'm betting that &lt;code&gt;shell-quote-argument&lt;/code&gt; needs a string arg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider reporting this as a bug to the maintainer of &lt;code&gt;python-shell-parse-command&lt;/code&gt;, aka of &lt;code&gt;python-shell-send-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, you will get a more complete backtrace if you load the source file instead of the byte-compiled file, for the code that defines &lt;code&gt;run-python&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-12T23:00:47.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20266" PostTypeId="1" CreationDate="2016-02-12T23:13:44.897" Score="1" ViewCount="1226" Body="&lt;p&gt;I'm using emacs' gnus to connect to a gmail and a hotmail account, I'm currently unable to split email into specific groups. All of my email is collecting in their respective inboxes, regardless of my efforts to split it.    How can I ensure that I can write rules that will split mail coming to my gmail account and my hotmail account? I've read the gnus documentation for splitting mail several times, but my code is not working.  Here's what I've got written down:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq gnus-secondary-select-methods '((nntp &quot;news.gwene.org&quot;)&#xA;                                  (nnimap &quot;hotmail&quot;&#xA;                                          (nnimap-address &quot;imap-mail.outlook.com&quot;)&#xA;                                          (nnimap-server-port 993)&#xA;                                          (nnimap-stream ssl)&#xA;                                          (nnimap-streaming t)&#xA;                                          (nnimap-split-method default)&#xA;                                          (nnir-search-engine imap))))&#xA;&#xA;&#xA;&#xA; (setq gnus-select-method&#xA;  '(nnimap &quot;gmail&quot;&#xA;           (nnimap-inbox &quot;Google&quot;)&#xA;           (nnimap-address &quot;imap.gmail.com&quot;)  &#xA;           (nnimap-server-port &quot;993&quot;)&#xA;           (nnimap-stream ssl)&#xA;           (nnimap-split-method default)))&#xA;&#xA;&#xA;&#xA;   (setq nnimap-split-methods&#xA;       '((&quot;Accrisoft Support&quot; &quot;^From:.*support@accrisoft.com.*&quot;)&#xA;         (&quot;Basecamp&quot; &quot;^From:.*notifications@basecamp.com.*&quot;)&#xA;         (&quot;arch&quot; &quot;^To:.*arch-general@archlinux.org.*$&quot;)&#xA;         (&quot;emacs devel&quot; &quot;^To:.*emacs-devel@gnu.org.*&quot;)&#xA;         (&quot;emacs devel&quot; &quot;^CC:.*emacs-devel@gnu.org.*&quot;)&#xA;         (&quot;bug-hurd&quot; &quot;^To:.*bug-hurd@gnu.org.*&quot;)&#xA;         (&quot;bug-hurd&quot; &quot;^Cc:.*bug-hurd@gnu.org.*&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="11101" LastActivityDate="2019-05-20T18:56:08.577" Title="Splitting mail with gnus" Tags="|gnus|email|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20267" PostTypeId="1" AcceptedAnswerId="20509" CreationDate="2016-02-12T23:44:11.857" Score="0" ViewCount="47" Body="&lt;p&gt;When I'm writing a php program I often face the following situation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;step 1: '[' pressed:&#xA;Result:&#xA;[&amp;lt;cursor&amp;gt;&#xA;&#xA;step 2: ']' pressed&#xA;Result:&#xA;[]&amp;lt;cursor&amp;gt;&#xA;&#xA;step 3: move the cursor between '[]':&#xA;Result:&#xA;[&amp;lt;cursor&amp;gt;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My idea was to save 1 keystroke and do step 3 automatically when '[]' sequence was pressed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I did the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;flag to signal us the '[' was pressed&#xA;(defvar *kb--bracket-pressed* nil)&#xA;;activate flag&#xA;(defun bracket-pressed ()&#xA;      &quot;[ key pressed&quot;&#xA;      (interactive)&#xA;      ;activate flag&#xA;      (setq *kb--bracket-pressed* t)&#xA;      (insert &quot;[&quot;)&#xA;      )&#xA;&#xA;(defun back-bracket-pressed ()&#xA;      &quot;] key pressed&quot;&#xA;      (interactive)&#xA;      (when *kb--bracket-pressed*&#xA;            (insert &quot;]&quot;)&#xA;            (backward-char 1)&#xA;            ;deactivate flag&#xA;            (setq *kb--bracket-pressed* nil)&#xA;            )&#xA;      )&#xA;&#xA;;when php-mode is activated&#xA;(local-set-key (kbd &quot;[&quot;) 'bracket-pressed)&#xA;(local-set-key (kbd &quot;]&quot;) 'back-bracket-pressed)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is: I don't know how to reset the flag to nil, when any other key except &quot;]&quot; was pressed after &quot;[&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2016-02-22T23:25:29.590" Title="How to know that any other key except certain was pressed" Tags="|key-bindings|keystrokes|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20268" PostTypeId="1" CreationDate="2016-02-13T00:28:17.990" Score="1" ViewCount="95" Body="&lt;p&gt;I have written a custom interactive command that takes a character as an argument. When I happen to use the key binding for that command while in a eshell buffer where a long-running command is currently running, I get this backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument characterp (switch-frame #&amp;lt;frame perf_log.1 0x2b7af490&amp;gt;))&#xA;  char-to-string((switch-frame #&amp;lt;frame perf_log.1 0x2b7af490&amp;gt;))&#xA;  eshell-self-insert-command()&#xA;  call-interactively(eshell-self-insert-command nil nil)&#xA;  command-execute(eshell-self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I looked at the code for that function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eshell-self-insert-command ()&#xA;  (interactive)&#xA;  (process-send-string&#xA;   (eshell-interactive-process)&#xA;   (char-to-string (if (symbolp last-command-event)&#xA;               (get last-command-event 'ascii-character)&#xA;               last-command-event))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only reference to which I can find is inside the ominous sounding function &lt;code&gt;eshell-intercept-commands&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that in that circumstance eshell mistakenly thinks that the last command event was intended for it. Is there a way to filter those instances?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full implementation of my command is below (it assigns unique characters to emacs windows, displays the character in the modeline, then lets me switch to that window by pressing a hotkey and letter assigned to the window):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst md-glyphs&#xA;   '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z&#xA;   ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9&#xA;   ?^ ?\# ?\ ?&amp;gt; ?\; ?\&quot; ?* ?\' ?% ?\\ ?\` ?$ ?[ ?_ ?\, ?{ ?:&#xA;   ?! ?- ?\( ?\| ?~ ?\. ?? ?= ?\) ?&amp;lt; ?} ?&amp;amp; ?/ ?@ ?+ ?]))&#xA;&#xA;(defun md-get-window-glyph (w)&#xA;  (let* ((fp (frame-parameters (window-frame w)))&#xA;         (frame-top (cdr (assoc 'top fp)))&#xA;         (frame-left (cdr (assoc 'left fp)))&#xA;         (window-top (window-top-line w))&#xA;         (window-left (window-left-column w))&#xA;         (hash (md5 (format &quot;%S %S %S %S&quot; frame-top frame-left window-top window-left)))&#xA;         (glyph (nth (% (string-to-number (substring hash 0 2) 16) (length md-glyphs)) md-glyphs)))&#xA;    (char-to-string glyph)))&#xA;&#xA;(setq-default mode-line-format&#xA;              (append&#xA;               (list '(:eval (propertize (format &quot;[%s] &quot; (md-get-window-glyph (get-buffer-window))) 'face 'font-lock-constant-face)))&#xA;               mode-line-format))&#xA;&#xA;(defun md-select-window-with-glyph (chosen-glyph)&#xA;  (interactive &quot;cWindow glyph: &quot;)&#xA;  (dolist (f (frame-list))&#xA;    (dolist (w (window-list f 0))&#xA;      (ignore-errors &#xA;        (when (equal (downcase (md-get-window-glyph w)) (downcase (char-to-string chosen-glyph)))&#xA;          (select-frame-set-input-focus f)&#xA;          (select-window w))))))&#xA;&#xA;(global-set-key (kbd &quot;M-d&quot;) #'md-select-window-with-glyph)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2016-02-14T20:09:51.840" LastActivityDate="2016-02-14T20:09:51.840" Title="eshell backtrace when trying to use character command" Tags="|eshell|commands|self-insert-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20269" PostTypeId="2" ParentId="20268" CreationDate="2016-02-13T02:58:03.677" Score="1" Body="&lt;p&gt;Clearly this code is bugged: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(char-to-string (if (symbolp last-command-event)&#xA;                    (get last-command-event 'ascii-character)&#xA;                  last-command-event)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If, as is the case in your backtrace, &lt;code&gt;last-command-event&lt;/code&gt; is a list such as &lt;code&gt;(switch-frame #&amp;lt;frame perf_log.1 0x2b7af490&amp;gt;)&lt;/code&gt; then &lt;code&gt;char-to-string&lt;/code&gt; barfs because it expects a character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Report the bug to the library maintainer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not clear what the relation is between that code that raises the error (the backtrace) and your own code that you show. Presumably your code has a similar problem? (The question seems unclear.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your code: You don't show how &lt;code&gt;md-glyphs&lt;/code&gt; is populated. If you are asking about your code, and your code raises a similar error for &lt;code&gt;(char-to-string glyph)&lt;/code&gt;, then use &lt;code&gt;M-x debug-on-entry md-get-window-glyph&lt;/code&gt; and see where it goes wrong. Should be quick to see. (Presumably &lt;code&gt;glyph&lt;/code&gt; is not a character.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-13T03:03:20.240" LastActivityDate="2016-02-13T03:03:20.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20271" PostTypeId="1" AcceptedAnswerId="20276" CreationDate="2016-02-13T06:32:10.660" Score="0" ViewCount="86" Body="&lt;p&gt;Since a couple of months ago, Helm has changed in his behavior of &lt;em&gt;&quot;doing its thing&quot;&lt;/em&gt; when some command requires selecting a candidate, which was a default behavior in old releases of Helm. How can I restore that in these new releases of Helm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: the referred old behavior is that one where Helm handles completion candidates for any given command that requires choosing one candidate.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="690" LastEditDate="2016-02-13T17:26:07.347" LastActivityDate="2016-02-13T17:26:07.347" Title="How to restore helm's old behavior?" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20272" PostTypeId="1" AcceptedAnswerId="20277" CreationDate="2016-02-13T08:26:40.767" Score="2" ViewCount="266" Body="&lt;p&gt;I have two checkers &lt;code&gt;fast-checker&lt;/code&gt; and &lt;code&gt;slow-checker&lt;/code&gt;. So I want to use &lt;code&gt;fast-checker&lt;/code&gt; with &lt;code&gt;flycheck-check-syntax-automatically '(idle-change)&lt;/code&gt; and &lt;code&gt;slow-checker&lt;/code&gt; with &lt;code&gt;flycheck-check-syntax-automatically '(save)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or at least can I use &lt;code&gt;flycheck-buffer&lt;/code&gt; with specific checker?&#xA;So I could do something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-save-hook (lambda () (flycheck-buffer `slow-checker)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10526" LastEditorUserId="10526" LastEditDate="2016-02-13T16:02:05.730" LastActivityDate="2016-02-13T16:02:05.730" Title="Is it possible to use different checkers with different flycheck-check-syntax-automatically?" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20273" PostTypeId="1" AcceptedAnswerId="20457" CreationDate="2016-02-13T12:21:35.990" Score="2" ViewCount="320" Body="&lt;p&gt;For the SQL-mode I use the package &lt;a href=&quot;https://github.com/purcell/sqlint&quot; rel=&quot;nofollow&quot;&gt;Sqlint&lt;/a&gt; with Flycheck. This works fine. Now I switched to the package &lt;a href=&quot;https://github.com/kiwanami/emacs-edbi&quot; rel=&quot;nofollow&quot;&gt;EDBI&lt;/a&gt; which is an database interface for Emacs. There is a query editor built-in.  I would like to tell flycheck that he must syntax-check the query editor with the help of the SQL-lint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The major mode of the query editor is &lt;code&gt;edbi:sql-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading the well written documentation of flycheck, I have set it up as following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'flycheck&#xA;  '(progn&#xA;     (flycheck-add-mode 'sqlint 'edbi:sql-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After evaluating it and creating a new buffer, Flycheck doesn't have any checker in the &lt;code&gt;edbi:sql-mode&lt;/code&gt;, as &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;flycheck-verify-setup&lt;/code&gt; tells me the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Syntax checkers for buffer *edbi:query-editor 1 * in edbi:sql-mode:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;There are no syntax checkers for this buffer!&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Flycheck Mode is disabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I wonder why flycheck doesn't use sqlint in &lt;code&gt;edbi:sql-mode&lt;/code&gt;? It's set up following  the documentation.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-02-14T16:43:00.827" LastActivityDate="2016-02-20T21:20:39.110" Title="Setting up flycheck in pair with different mode is not working" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20274" PostTypeId="2" ParentId="20266" CreationDate="2016-02-13T12:22:22.047" Score="2" Body="&lt;p&gt;I think the problem is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nnimap-split-method default)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is missing an 's' (method&lt;strong&gt;s&lt;/strong&gt;), and then the variable &lt;code&gt;nnimap-split-methods&lt;/code&gt; should be called &lt;code&gt;nnmail-split-methods&lt;/code&gt; in your &lt;code&gt;setq&lt;/code&gt; afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At least that seems to be what &lt;a href=&quot;http://gnus.org/manual/gnus_83.html#Client_002dSide-IMAP-Splitting&quot; rel=&quot;nofollow noreferrer&quot;&gt;the documentation&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;nnimap-split-methods&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Uses the same syntax as &lt;code&gt;nnmail-split-methods&lt;/code&gt; (see section &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Splitting-Mail.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Splitting Mail&lt;/a&gt;), except the symbol &lt;code&gt;default&lt;/code&gt;, which means that it should&#xA;  use the value of the &lt;code&gt;nnmail-split-methods&lt;/code&gt; variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The next major thing is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;nnmail-split-methods&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The last element should always have &lt;code&gt;&quot;&quot;&lt;/code&gt; as the regexp.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So try replacing what you have above with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-select-method&#xA;      '(nnimap &quot;gmail&quot;&#xA;               (nnimap-inbox &quot;Google&quot;)&#xA;               (nnimap-address &quot;imap.gmail.com&quot;)&#xA;               (nnimap-server-port &quot;993&quot;)&#xA;               (nnimap-stream ssl)&#xA;               (nnimap-split-methods default)))&#xA;&#xA;(setq gnus-secondary-select-methods&#xA;      '((nntp &quot;news.gwene.org&quot;)&#xA;        (nnimap &quot;hotmail&quot;&#xA;                (nnimap-address &quot;imap-mail.outlook.com&quot;)&#xA;                (nnimap-server-port 993)&#xA;                (nnimap-stream ssl)&#xA;                (nnimap-streaming t)&#xA;                (nnimap-split-methods default)&#xA;                (nnir-search-engine imap))))&#xA;&#xA;(setq nnmail-split-methods&#xA;      '((&quot;Accrisoft Support&quot; &quot;^From:.*support@accrisoft\\.com.*&quot;)&#xA;        (&quot;Basecamp&quot; &quot;^From:.*notifications@basecamp\\.com.*&quot;)&#xA;        (&quot;arch&quot; &quot;^To:.*arch-general@archlinux\\.org.*&quot;)&#xA;        (&quot;emacs devel&quot; &quot;^\\(To\\|Cc\\):.*emacs-devel@gnu\\.org.*&quot;)&#xA;        (&quot;bug-hurd&quot; &quot;^\\(To\\|Cc\\):.*bug-hurd@gnu\\.org.*&quot;)&#xA;        (&quot;mail.misc&quot; &quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="106" LastEditorUserId="16592" LastEditDate="2019-05-20T18:56:08.577" LastActivityDate="2019-05-20T18:56:08.577" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="20275" PostTypeId="2" ParentId="20262" CreationDate="2016-02-13T12:54:39.493" Score="0" Body="&lt;p&gt;Partial answer to my question is that Wisent loops over start rule until in arrives at the end of the buffer. The following works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%token WORD&#xA;%start word&#xA;&#xA;word : WORD&#xA;        (VARIABLE-TAG $1 nil nil)&#xA;     ;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To process nested tags two things are needed. One is to notify semantic how to follow nesting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-mode-local-override semantic-tag-components ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(EXPANDTAG (VARIABLE-TAG $1 nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="5213" LastEditDate="2016-02-15T22:11:20.977" LastActivityDate="2016-02-15T22:11:20.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20276" PostTypeId="2" ParentId="20271" CreationDate="2016-02-13T13:06:10.893" Score="3" Body="&lt;p&gt;Yes, the behavior of helm has changed recently. See &lt;a href=&quot;https://github.com/emacs-helm/helm/commit/1de1701c73b15a86e99ab1c5c53bd0e8659d8ede&quot; rel=&quot;nofollow noreferrer&quot;&gt;this commit&lt;/a&gt;. I think what you are experiencing is the same thing I asked about &lt;a href=&quot;https://emacs.stackexchange.com/questions/19528/helm-completion-no-longer-used-for-m-x-or-find-file&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution was to add the commands that used to &quot;do their thing&quot; (i.e., use helm completion) to the &lt;code&gt;helm-completing-read-handlers-alist&lt;/code&gt; as suggested &lt;a href=&quot;https://emacs.stackexchange.com/a/19529&quot;&gt;here&lt;/a&gt;. For example, to get &lt;code&gt;find-file&lt;/code&gt; to use hem completion again: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'helm-completing-read-handlers-alist '(find-file . helm-completing-read-symbols))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-02-13T13:06:10.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20277" PostTypeId="2" ParentId="20272" CreationDate="2016-02-13T14:46:50.270" Score="1" Body="&lt;p&gt;No, neither of these are possible, but you can add a &lt;code&gt;:predicate&lt;/code&gt; to the slow checker that checks for &lt;code&gt;flycheck-buffer-saved-p&lt;/code&gt; to achieve the same effect.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-02-13T14:46:50.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20279" PostTypeId="1" CreationDate="2016-02-13T15:11:18.047" Score="5" ViewCount="2620" Body="&lt;p&gt;Mouse cursor position interpretation in emacs drives me nuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why draw the mouse cursor in emacs window with vertical thin bar if you cannot effectively position it between characters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Selecting text with mouse in emacs is drastically different from all other editors in both X Window and MS Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean when the mouse cursor is exactly between two consequent characters, clicking mouse puts the point one character back from the mouse position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, to put the point somewhere in the text with the mouse you need to click on the character &lt;em&gt;to the right&lt;/em&gt; of the place of expected point appearance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you, by muscle memory acquired from years of work in other editors, click exactly between two characters (or just a single pixel to the left for that matter) you end up with the point one character back from what was intended for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion the correct behavior would be to position the point to the left of the character &lt;strong&gt;only when the mouse cursor is over the &lt;em&gt;left half&lt;/em&gt; of the character&lt;/strong&gt;, and put it to the right otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An obvious solution to this would be to draw the mouse cursor offset by half a character width to the left from what it is in emacs by default. Or, to shift the mouse cursor hot point to the right for the emacs windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to achieve that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose I need to clarify that I use a thin cursor of 2-pixel-wide vertical bar (i.e. &lt;code&gt;(setq-default cursor-type '(bar . 2))&lt;/code&gt;). With a cursor in a traditional terminal style of a full-character rectangle this issue would not be so evident.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="2590" LastEditDate="2016-02-13T21:04:30.047" LastActivityDate="2021-04-03T14:07:32.143" Title="Mouse pointer between characters and the text cursor misplacement" Tags="|cursor|mouse|point|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20280" PostTypeId="2" ParentId="20279" CreationDate="2016-02-13T16:00:58.607" Score="5" Body="&lt;p&gt;First, you are apparently confusing the &lt;strong&gt;mouse pointer&lt;/strong&gt; with the &lt;strong&gt;text cursor&lt;/strong&gt; (aka cursor). It seems that you mostly talking about the latter, but referring to it as the &quot;cursor&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, insertion of a character is &lt;em&gt;always between characters&lt;/em&gt; (or before the first or after the last character). This is necessarily so, by definition. Even if it were to behave and be conceived as replacing an existing character by the one you want to insert, that insertion would still be between two chars (or before the first or after the last).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, as for the &lt;em&gt;representation&lt;/em&gt; of the (text) cursor: you have a choice. You can use a narrow vertical bar or a box, hollow or solid (on some platforms there might be additional options). If you choose a box cursor then the box is placed on top of the character to the right of the insertion point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You apparently already know how to change the (text) cursor style, and have opted for a bar. But your rant/question is more about the mouse pointer shape, I think, as it is apparently the pointer position (the part of the pointer shape that matters, determining where a click really is) that is throwing you off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fourth, you ask about setting point (the text cursor position) by clicking the mouse (left mouse button, aka &lt;code&gt;mouse-1&lt;/code&gt;). You say that clicking with the mouse pointer positioned exactly between two chars ends up setting point to the left of the character on the left of the pointer, and not at the pointer (between the two characters).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;clicking mouse puts the point one character back from the mouse position&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Why draw the mouse cursor in emacs window with vertical thin bar if you cannot effectively position it between characters?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't see that behavior. I position the I-beam pointer (which is what I think you mean here) between two characters, click it, and get the text insertion position (and the text cursor) between those characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can reproduce the behavior you describe then it is a bug, I think. Use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; to report it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I suspect that the problem is that you are positioning the wrong &lt;em&gt;part&lt;/em&gt; of your mouse pointer. What you call &quot;&lt;em&gt;mouse position&lt;/em&gt;&quot; is probably not the position of the part of the pointer that matters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as for text cursor representation, the mouse pointer can be represented in different ways. If it is an arrow of some kind, the pointer position (which sets point when you click &lt;code&gt;mouse-1&lt;/code&gt;) is often the tip of the arrow. Find out exactly which part of your pointer is used, and then get used to that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You say that Emacs behaves differently from the other programs you are used to, with respect to the pointer. Maybe your experience is limited? Having used all kinds of programs on lots of different platforms ever since computers had pointers and cursors, I can say that the behavior and representations are variable. And they vary in Emacs too, depending on the platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also easily change the pointer representation (choose another pointer). See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Pointer-Shape.html&quot; rel=&quot;nofollow&quot;&gt;Pointer Shape&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also the case that, by default, the pointer shape changes depending on where it is, depending, in fact, on what you can do with it at that position. At a position where you can insert text it is often a vertical I-beam shape (an insertion pointer). At other positions it is often an arrow. &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-13T18:07:19.040" LastActivityDate="2016-02-13T18:07:19.040" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20281" PostTypeId="1" CreationDate="2016-02-13T17:24:29.007" Score="1" ViewCount="538" Body="&lt;p&gt;Newbie question&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my Preferences.el file there is a line&#xA;(setq-default fill-column 78)&#xA;which works wonderfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I need to tell Emacs (Aqumacs in my case) to open windows&#xA;with 85 characters width, so that I do not have to resize every &#xA;window when it opens (as they open with around 60 characters width only).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do that?&lt;/p&gt;&#xA;" OwnerUserId="11104" LastEditorUserId="25" LastEditDate="2016-02-13T19:41:12.577" LastActivityDate="2016-02-13T19:41:12.577" Title="How to open windows with 85 characters width" Tags="|window|aquamacs|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20283" PostTypeId="2" ParentId="20281" CreationDate="2016-02-13T17:43:28.430" Score="1" Body="&lt;p&gt;If you are looking for a way to set the default &lt;strong&gt;frame&lt;/strong&gt; width, then just customize option &lt;code&gt;default-frame-alist&lt;/code&gt; to specify parameter &lt;code&gt;width&lt;/code&gt; as &lt;code&gt;85&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-option RET default-frame-alist RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Save your customization.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-13T18:10:29.077" LastActivityDate="2016-02-13T18:10:29.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20284" PostTypeId="2" ParentId="20281" CreationDate="2016-02-13T18:24:24.930" Score="1" Body="&lt;p&gt;My problem was solved using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist&#xA;              '(&#xA;                (width . 140)&#xA;                ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;85 did not work, probably because the number is font-dependent.&lt;/p&gt;&#xA;" OwnerUserId="11105" LastEditorUserId="25" LastEditDate="2016-02-13T19:37:59.893" LastActivityDate="2016-02-13T19:37:59.893" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20286" PostTypeId="1" AcceptedAnswerId="20287" CreationDate="2016-02-13T22:02:44.863" Score="2" ViewCount="67" Body="&lt;p&gt;Consider:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Before&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| plan      |  a | b | c |&#xA;|-----------+----+---+---|&#xA;| concern 1 | -1 | 0 | 2 |&#xA;| concern 2 |  2 | 1 | 1 |&#xA;| concern 3 |  0 | 2 | 1 |&#xA;|-----------+----+---+---|&#xA;| score:    |    |   |   |&#xA;#+TBLFM: @&amp;gt;=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;After&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| plan      |  a | b | c |&#xA;|-----------+----+---+---|&#xA;| concern 1 | -1 | 0 | 2 |&#xA;| concern 2 |  2 | 1 | 1 |&#xA;| concern 3 |  0 | 2 | 1 |&#xA;|-----------+----+---+---|&#xA;| 6 concern |  1 | 3 | 4 |&#xA;#+TBLFM: @&amp;gt;=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After the table is recalculated, my &lt;code&gt;score:&lt;/code&gt; identifier is changed to &lt;code&gt;6 concern&lt;/code&gt; (no doubt the sum of &lt;code&gt;concern 1..3&lt;/code&gt;).  How can I prevent this?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-02-13T22:11:08.773" Title="How can I protect Org spreadsheet columns from calculation?" Tags="|org-mode|spreadsheet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20287" PostTypeId="2" ParentId="20286" CreationDate="2016-02-13T22:11:08.773" Score="5" Body="&lt;p&gt;This seems to work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| plan      |  a | b | c |&#xA;|-----------+----+---+---|&#xA;| concern 1 | -1 | 0 | 2 |&#xA;| concern 2 |  2 | 1 | 1 |&#xA;| concern 3 |  0 | 2 | 1 |&#xA;|-----------+----+---+---|&#xA;| score:    |  1 | 3 | 4 |&#xA;#+TBLFM: @&amp;gt;$&amp;lt;&amp;lt;..$&amp;gt;=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;$&amp;lt;&amp;lt;..$&amp;gt;&lt;/code&gt; means &quot;the range of columns starting from the second and up to the last.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://orgmode.org/manual/References.html#References&quot;&gt;References&lt;/a&gt; in the Org Manual for more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tested using &lt;code&gt;Org-mode version 8.3.3 (8.3.3-51-g30bcff-elpa)&lt;/code&gt; and &lt;code&gt;GNU Emacs 24.5.1&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-02-13T22:11:08.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20289" PostTypeId="2" ParentId="9798" CreationDate="2016-02-14T01:51:14.863" Score="1" Body="&lt;p&gt;You can assign a list with &lt;code&gt;C-u&lt;/code&gt;, but not possible to assign a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;current-prefix-arg&lt;/code&gt;'s help doc says (at least in Emacs 24):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It may be a number, or the symbol `-' for just a minus sign as arg,&#xA;  or &lt;strong&gt;a list whose car is a number for just one or more C-u's&lt;/strong&gt;&#xA;  or nil if no argument has been specified.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That is, a) it is not a general list nor &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Sequences-Arrays-Vectors.html#Sequences-Arrays-Vectors&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Sequence&lt;/code&gt;, of which &lt;code&gt;String&lt;/code&gt; is a member&lt;/a&gt;, b) the list is generated by a &lt;code&gt;C-u&lt;/code&gt; or more of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see the list generated by &lt;code&gt;C-u&lt;/code&gt; with the following command, which is taken from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html&quot; rel=&quot;nofollow&quot;&gt;Prefix Command Arguments&lt;/a&gt; in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs Lisp Reference Manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun display-prefix (arg)&#xA;  &quot;Display the value of the raw prefix arg.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (message &quot;%s&quot; arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-u M-x display-prefix&lt;/code&gt; shows &lt;strong&gt;a list&lt;/strong&gt; whose value is &lt;code&gt;(4)&lt;/code&gt; in the minibuffer.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-02-14T01:51:14.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20290" PostTypeId="2" ParentId="220" CreationDate="2016-02-14T03:11:06.827" Score="19" Body="&lt;h2&gt;GUI frames&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In GUI frames (whether X11, Windows, OSX, …), Emacs reads the &lt;kbd&gt;Tab&lt;/kbd&gt; key as the &lt;code&gt;tab&lt;/code&gt; function key. However, because the &lt;kbd&gt;Tab&lt;/kbd&gt; key on terminals traditionally sends the &lt;code&gt;^I&lt;/code&gt; (&lt;a href=&quot;https://en.wikipedia.org/wiki/Control_character&quot; rel=&quot;noreferrer&quot;&gt;Control&lt;/a&gt;+I) character, Emacs translates the &lt;code&gt;tab&lt;/code&gt; function key into the Control+I character (character 9), which is displayed as &lt;code&gt;TAB&lt;/code&gt;. This translation is done via &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-local_002dfunction_002dkey_002dmap&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;function-key-map&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar translation happens with some other function keys. (&lt;kbd&gt;Backspace&lt;/kbd&gt; and &lt;kbd&gt;Delete&lt;/kbd&gt; are a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/DEL-Does-Not-Delete.html#DEL-Does-Not-Delete&quot; rel=&quot;noreferrer&quot;&gt;thorny case&lt;/a&gt; which I will not discuss in detail here.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function key    Translated to character         Notes&#xA;                Number  Name  Decomposition&#xA;backspace       127     DEL   Ctrl+?            May be translated to C-h instead&#xA;tab               9     TAB   Ctrl+I&#xA;linefeed         10     LFD   Ctrl+J            Few keyboards have this key&#xA;return           13     RET   Ctrl+M&#xA;escape           27     ESC   Ctrl+[&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to separate &lt;kbd&gt;Tab&lt;/kbd&gt; from &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt; altogether, remove the binding from &lt;code&gt;function-key-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key function-key-map [tab] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this is not very useful, because entries in &lt;code&gt;function-key-map&lt;/code&gt; are overridden by bindings in mode-specific keymaps or in the global map. So if you want to define a different binding for &lt;code&gt;tab&lt;/code&gt;, just do it (in Elisp, not interactively, because the key reading prompt applies the &lt;code&gt;function-key-map&lt;/code&gt; translation so you'd end up rebinding &lt;code&gt;TAB&lt;/code&gt; and not &lt;code&gt;tab&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [tab] '…)&#xA;(define-key some-mode-map [tab] '…)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All standard modes that modify the action of the &lt;kbd&gt;Tab&lt;/kbd&gt; key do it by modifying the &lt;code&gt;TAB&lt;/code&gt; key, which is a nickname for the &lt;code&gt;C-i&lt;/code&gt; character generated by the key combination &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt;. If you want standard bindings to apply to &lt;code&gt;tab&lt;/code&gt; rather than &lt;code&gt;C-i&lt;/code&gt;, leave &lt;code&gt;function-key-map&lt;/code&gt; and mode keymaps alone, and instead redirect &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt; to a different key.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key input-decode-map [(control ?i)] [control-i])&#xA;(define-key input-decode-map [(control ?I)] [(shift control-i)])&#xA;(define-key some-mode-map [control-i] '…)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now Emacs will report &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt; as “&lt;code&gt;&amp;lt;control-i&amp;gt;&lt;/code&gt; (translated from &lt;code&gt;TAB&lt;/code&gt;)”. This isn't pretty, but it's unavoidable: the pretty-printing of character 9 as &lt;code&gt;TAB&lt;/code&gt; is built into the Emacs source code.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Terminal frames&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In terminal frames, the problem is harder and often impossible. Terminals don't transmit keys, they transmit characters (more precisely, in fact, they transmit bytes). The &lt;kbd&gt;Tab&lt;/kbd&gt; key is transmitted as the tab character — which is Control+I, same as what the key combination &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;I&lt;/kbd&gt; generates. Function keys that have no corresponding character (such as cursor keys) are transmitted as escape sequences, i.e. sequences of characters beginning with &lt;code&gt;ESC&lt;/code&gt; = Control+[ (which is why Emacs defines &lt;kbd&gt;escape&lt;/kbd&gt; as a prefix key — &lt;code&gt;ESC&lt;/code&gt; has to be a prefix). See &lt;a href=&quot;https://unix.stackexchange.com/questions/116629/how-do-keyboard-input-and-text-output-work/116630#116630&quot;&gt;How do keyboard input and text output work?&lt;/a&gt; for more background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few terminals that can be configured to send different key sequences for function keys, but not many. Both &lt;a href=&quot;http://www.leonerd.org.uk/hacks/fixterms/&quot; rel=&quot;noreferrer&quot;&gt;LeoNerd's libtermkey/libtickit&lt;/a&gt; and &lt;a href=&quot;http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Alt-and-Meta-Keys&quot; rel=&quot;noreferrer&quot;&gt;Thomas Dickey's xterm&lt;/a&gt; (since version 216) support this. In Xterm, the feature is optional and activated through the &lt;code&gt;modifyOtherKeys&lt;/code&gt; resource. However, I don't know of any popular terminal emulator other than xterm that supports this, in particular the many emulators built on &lt;a href=&quot;https://bugzilla.gnome.org/show_bug.cgi?id=477068&quot; rel=&quot;noreferrer&quot;&gt;libvte&lt;/a&gt;. Some terminal emulators let you do this manually through a user-defined correspondence from keychords to escape sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mechanism allows many key combinations to be distinguished, not just tab/C-i, return/C-m and escape/C-[. See &lt;a href=&quot;https://emacs.stackexchange.com/questions/1020/problems-with-keybindings-when-using-terminal/13957#13957&quot;&gt;Problems with keybindings when using terminal&lt;/a&gt; for a more detailed description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic xterm feature is supported since Emacs 24.4. However the fundamentals (in particular &lt;kbd&gt;Tab&lt;/kbd&gt;, &lt;kbd&gt;Return&lt;/kbd&gt;, &lt;kbd&gt;Escape&lt;/kbd&gt;, &lt;kbd&gt;Backspace&lt;/kbd&gt;) still send the traditional control characters, because that's what applications expect. There is a mode where &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;letter&lt;/kbd&gt; sends an escape sequence instead of the control character. So to distinguish the function keys from the &lt;kbd&gt;Ctrl&lt;/kbd&gt; combinations on Emacs 24.4, modify its support for &lt;code&gt;modifyOtherKeys&lt;/code&gt; to use this mode by setting the resource to 2 instead of 1.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; xterm with the resource ?.VT100.modifyOtherKeys: 2&#xA;;; GNU Emacs &amp;gt;=24.4 sets xterm in this mode and define&#xA;;; some of the escape sequences but not all of them.&#xA;(defun character-apply-modifiers (c &amp;amp;rest modifiers)&#xA;  &quot;Apply modifiers to the character C.&#xA;MODIFIERS must be a list of symbols amongst (meta control shift).&#xA;Return an event vector.&quot;&#xA;  (if (memq 'control modifiers) (setq c (if (or (and (&amp;lt;= ?@ c) (&amp;lt;= c ?_))&#xA;                                                (and (&amp;lt;= ?a c) (&amp;lt;= c ?z)))&#xA;                                            (logand c ?\x1f)&#xA;                                          (logior (lsh 1 26) c))))&#xA;  (if (memq 'meta modifiers) (setq c (logior (lsh 1 27) c)))&#xA;  (if (memq 'shift modifiers) (setq c (logior (lsh 1 25) c)))&#xA;  (vector c))&#xA;(defun my-eval-after-load-xterm ()&#xA;  (when (and (boundp 'xterm-extra-capabilities) (boundp 'xterm-function-map))&#xA;    ;; Override the standard definition to set modifyOtherKeys to 2 instead of 1&#xA;    (defun xterm-turn-on-modify-other-keys ()&#xA;      &quot;Turn the modifyOtherKeys feature of xterm back on.&quot;&#xA;      (let ((terminal (frame-terminal)))&#xA;        (when (and (terminal-live-p terminal)&#xA;                   (memq terminal xterm-modify-other-keys-terminal-list))&#xA;          (send-string-to-terminal &quot;\e[&amp;gt;4;2m&quot; terminal))))&#xA;    (let ((c 32))&#xA;      (while (&amp;lt;= c 126)&#xA;        (mapc (lambda (x)&#xA;                (define-key xterm-function-map (format (car x) c)&#xA;                  (apply 'character-apply-modifiers c (cdr x))))&#xA;              '(;; with ?.VT100.formatOtherKeys: 0&#xA;                (&quot;\e\[27;3;%d~&quot; meta)&#xA;                (&quot;\e\[27;5;%d~&quot; control)&#xA;                (&quot;\e\[27;6;%d~&quot; control shift)&#xA;                (&quot;\e\[27;7;%d~&quot; control meta)&#xA;                (&quot;\e\[27;8;%d~&quot; control meta shift)&#xA;                ;; with ?.VT100.formatOtherKeys: 1&#xA;                (&quot;\e\[%d;3~&quot; meta)&#xA;                (&quot;\e\[%d;5~&quot; control)&#xA;                (&quot;\e\[%d;6~&quot; control shift)&#xA;                (&quot;\e\[%d;7~&quot; control meta)&#xA;                (&quot;\e\[%d;8~&quot; control meta shift)))&#xA;        (setq c (1+ c)))))&#xA;  (define-key xterm-function-map &quot;&quot;)&#xA;  t)&#xA;(eval-after-load &quot;xterm&quot; '(my-eval-after-load-xterm))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2019-10-11T16:58:45.020" LastActivityDate="2019-10-11T16:58:45.020" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="20291" PostTypeId="2" ParentId="10105" CreationDate="2016-02-14T03:41:31.430" Score="4" Body="&lt;p&gt;You don't have to create a one-liner.  The following list of definitions should create an imenu items:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq less-imenu-generic-expression&#xA;      '((nil &quot;\\(^@font-face\\)&quot; 1)&#xA;        (nil &quot;\\(^body\\)&quot; 1)&#xA;        (nil &quot;\\(^#foo\\)&quot; 1)&#xA;        (nil &quot;\\(^h[123]\\)&quot; 1)&#xA;        (nil &quot;\\(^\.CheltenhamBT-BoldHeadline\\)&quot; 1)&#xA;        (nil &quot;\\(^.ClarendonText-Bold\\)&quot; 1)))&#xA;(add-hook 'css-mode-hook &#xA;          (lambda ()&#xA;            (setq imenu-generic-expression less-imenu-generic-expression)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-02-14T03:41:31.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20292" PostTypeId="1" AcceptedAnswerId="20464" CreationDate="2016-02-14T03:57:48.740" Score="3" ViewCount="992" Body="&lt;p&gt;I'm drowning in parenthesis here. I want to write a function which returns in a string the time and the effort estimate of the current clocked task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first looked in org-mode checking I wasn't re-doing the wheel, I found &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-clock.el?id=005576f0b6b1814f83a991756ae62b41f0035ce6#n534&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-clock-get-clock-string&lt;/code&gt;&lt;/a&gt; which does what I want but it appends things I don't need making the string unusable for what I want. I took a look at the source code and tried to adapt it to do what I want, however, I fail miserably, I did this mess:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun shackra/task-clocked-time ()&#xA;  &quot;Return a string with the clocked time and effort, if any&quot;&#xA;  (let* ((clocked-time (org-clock-get-clocked-time))&#xA;         (h (floor clocked-time 60))&#xA;         (m (- clocked-time (* 60 h))))&#xA;    (if org-clock-effort&#xA;        (let* ((effort-in-minutes&#xA;                (org-duration-string-to-minutes org-clock-effort))&#xA;               (effort-h (floor effort-in-minutes 60))&#xA;               (effort-m (- effort-in-minutes (* effort-h 60)))&#xA;               (work-done-str (format org-time-clocksum-format h m))&#xA;               (effort-str (format org-time-clocksum-format effort-h effort-m))&#xA;               (clockstr (concat  &quot; [%s/&quot; effort-str&#xA;                                  &quot;] (&quot; (replace-regexp-in-string &quot;%&quot; &quot;%%&quot; org-clock-heading) &quot;)&quot;))))&#xA;      (format clockstr work-done-str))&#xA;    (format&#xA;     (concat &quot;[&quot; org-time-clocksum-format &quot; (%s)]&quot;)&#xA;     h m org-clock-heading)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but executing the function for testing yells this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp (:days &quot;%dd &quot; :hours &quot;%d&quot; :require-hours t :minutes &quot;:%02d&quot; :require-minutes t))&#xA;  format((:days &quot;%dd &quot; :hours &quot;%d&quot; :require-hours t :minutes &quot;:%02d&quot; :require-minutes t) 0 12)&#xA;  (let* ((effort-in-minutes (org-duration-string-to-minutes org-clock-effort)) (effort-h (floor effort-in-minutes 60)) (effort-m (- effort-in-minutes (* effort-h 60)))) (format org-time-clocksum-format h m))&#xA;  (if org-clock-effort (let* ((effort-in-minutes (org-duration-string-to-minutes org-clock-effort)) (effort-h (floor effort-in-minutes 60)) (effort-m (- effort-in-minutes (* effort-h 60)))) (format org-time-clocksum-format h m)))&#xA;  (let* ((clocked-time (org-clock-get-clocked-time)) (h (floor clocked-time 60)) (m (- clocked-time (* 60 h)))) (if org-clock-effort (let* ((effort-in-minutes (org-duration-string-to-minutes org-clock-effort)) (effort-h (floor effort-in-minutes 60)) (effort-m (- effort-in-minutes (* effort-h 60)))) (format org-time-clocksum-format h m))))&#xA;  shackra/task-clocked-time()&#xA;  eval((shackra/task-clocked-time) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To be honest, I don't know what I'm doing and I neither know how to &lt;em&gt;read&lt;/em&gt; the code of &lt;code&gt;org-clock-get-clock-string&lt;/code&gt; (the lacks of documentation in that code kills me)&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2016-02-22T00:26:41.467" Title="How can I get a plain string with the clocked time and the estimate effort for the current task clocked-in?" Tags="|org-mode|org-clock|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20294" PostTypeId="1" AcceptedAnswerId="20295" CreationDate="2016-02-14T06:04:58.160" Score="2" ViewCount="322" Body="&lt;p&gt;Is there a way to sort a list of packages in Package Menu (&lt;code&gt;*Packages*&lt;/code&gt;) sorted by &lt;code&gt;Version&lt;/code&gt;?  If you are using melpa, you see that melpa versions each package with &lt;code&gt;%Y%m%d.%d&lt;/code&gt;.  I'd like to sort by the melpa version string.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-02-14T06:56:20.193" Title="How to sort *packages* by Version" Tags="|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20295" PostTypeId="2" ParentId="20294" CreationDate="2016-02-14T06:56:20.193" Score="0" Body="&lt;p&gt;I use this to enable sorting on all columns in the package menu's tabular list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'package-menu-mode-hook&#xA;          (lambda () (setq tabulated-list-format&#xA;                             (vconcat (mapcar (lambda (arg) (list (nth 0 arg) (nth 1 arg)&#xA;                                                            (or (nth 2 arg) t)))&#xA;                                       tabulated-list-format)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8273" LastActivityDate="2016-02-14T06:56:20.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20296" PostTypeId="2" ParentId="20264" CreationDate="2016-02-14T08:10:02.393" Score="1" Body="&lt;p&gt;A mode which heavily uses SMIE is &lt;a href=&quot;https://github.com/elixir-lang/emacs-elixir&quot; rel=&quot;nofollow&quot;&gt;https://github.com/elixir-lang/emacs-elixir&lt;/a&gt;&#xA;Not sure if it really works though - see the list of indent-related bugs.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-02-14T08:10:02.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20297" PostTypeId="1" AcceptedAnswerId="20327" CreationDate="2016-02-14T08:18:07.003" Score="1" ViewCount="94" Body="&lt;p&gt;Emacs defines ` to be used for abbrevs in f90 mode. How do I change this so some other key, like e.g. # ? I think, I found the relevant lines in f90.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar f90-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map &quot;`&quot;        'f90-abbrev-start)&#xA;    ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but my attempts at mimicking this syntax usually lead to errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any help.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;So I followed the advice of Aaron Harris and added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'f90&#xA;  '(define-key f90-mode-map (kbd &quot;#&quot;) #'f90-abbrev-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my .emacs. Now when I open a Fortran file and hit&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h k #&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;#&lt;/code&gt; runs the command f90-abbrev-start, which is an interactive compiled Lisp&#xA;    function in `f90.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to #, `.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(f90-abbrev-start)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Typing &lt;code&gt;C-h or&lt;/code&gt;? lists all the F90 abbrevs.&#xA;   Any other key combination is executed normally.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But still&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`su&amp;lt;SPACE&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is expanded to subroutine while &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#su&amp;lt;SPACE&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is not. Do I misunderstand something here?&lt;/p&gt;&#xA;" OwnerUserId="7048" LastEditorUserId="7048" LastEditDate="2016-02-16T20:11:59.417" LastActivityDate="2016-02-16T20:47:28.360" Title="Change key for f90-start-abbrev" Tags="|key-bindings|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20299" PostTypeId="1" AcceptedAnswerId="20303" CreationDate="2016-02-14T09:04:56.133" Score="8" ViewCount="643" Body="&lt;p&gt;I have read the prefix has to be added after running &lt;code&gt;helm-m-x&lt;/code&gt;, but I don't know how to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I want to pass an argument to &lt;code&gt;shell&lt;/code&gt;. When I run &lt;code&gt;helm-m-x&lt;/code&gt; and then &lt;kbd&gt;C-u&lt;/kbd&gt; I see in the mode-line &lt;em&gt;[prefarg:4]&lt;/em&gt;. On the next key press there will be 4 occurrences of the key instead of only the first one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2016-02-14T11:34:48.313" Title="How to pass a prefix argument to helm-m-x?" Tags="|helm|prefix-argument|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20300" PostTypeId="1" AcceptedAnswerId="20301" CreationDate="2016-02-14T09:34:22.797" Score="2" ViewCount="1815" Body="&lt;p&gt;When I try to connect to my office computer with tramp: C-x f &quot;/ssh:office:&quot; it shows me the message: &quot;Found remote shell prompt on&quot; and then completely hangs. I have to terminate with C-g, if I hit enter the emacs session dies completely. Connecting with &quot;ssh&quot; works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the complete error messages:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the debug tramp/ssh buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;atias-HP-ProDesk-600-G1-TWR ~ % &#xA;10:28:01.900922 tramp-get-connection-property (7) # process-buffer nil&#xA;10:28:01.901918 tramp-process-actions (3) # Waiting for prompts from remote shell...done&#xA;10:28:01.904656 tramp-maybe-open-connection (3) # Found remote shell prompt on `office'&#xA;10:28:01.904954 tramp-get-connection-property (7) # remote-shell nil&#xA;10:28:01.905100 tramp-open-shell (5) # Opening remote shell `/bin/sh'...&#xA;10:28:01.905286 tramp-get-connection-property (7) # process-name nil&#xA;10:28:01.905420 tramp-get-connection-property (7) # remote-echo nil&#xA;10:28:01.905543 tramp-send-command (6) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;10:28:01.905668 tramp-get-connection-property (7) # process-name nil&#xA;10:28:01.905795 tramp-get-connection-property (7) # chunksize nil&#xA;10:28:01.905910 tramp-set-connection-property (7) # last-cmd-time (22208 18593 905880 548000)&#xA;10:28:01.906046 tramp-send-string (10) # exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;10:28:01.906184 tramp-get-connection-property (7) # process-buffer nil&#xA;10:28:01.906355 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.906491 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.906637 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.906849 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[K&#xA;10:28:01.907001 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.907118 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.907240 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.909402 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec&#xA;10:28:01.909563 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.909685 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.909798 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.909939 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/nul&#xA;10:28:01.910038 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.910128 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.910214 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.910807 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_CO&#xA;10:28:01.910964 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.911089 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.911213 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.911377 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /b&#xA;10:28:01.911480 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.911565 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.911645 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.911783 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;10:28:01.911874 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.911942 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.912022 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.912143 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;10:28:01.912219 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.912287 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.912363 tramp-get-connection-property (7) # gateway nil&#xA;10:28:01.917431 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ &#xA;10:28:01.918049 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.918349 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:01.918658 tramp-get-connection-property (7) # gateway nil&#xA;10:28:02.920243 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ &#xA;10:28:02.920613 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:02.920815 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:02.921068 tramp-get-connection-property (7) # gateway nil&#xA;10:28:03.922505 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ &#xA;10:28:03.922698 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:03.922803 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:03.922941 tramp-get-connection-property (7) # gateway nil&#xA;10:28:04.923560 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ &#xA;10:28:04.923871 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:04.924050 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:04.924275 tramp-get-connection-property (7) # gateway nil&#xA;10:28:05.925124 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ &#xA;10:28:05.925315 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:05.925409 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:05.925524 tramp-get-connection-property (7) # gateway nil&#xA;10:28:06.925941 tramp-accept-process-output (10) # *tramp/ssh matias@office* run *tramp/ssh matias@office*&#xA;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ &#xA;10:28:06.926110 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:06.926198 tramp-get-connection-property (7) # check-remote-echo nil&#xA;10:28:06.926310 tramp-get-connection-property (7) # gateway nil&#xA;10:28:07.432947 tramp-open-shell (5) # Opening remote shell `/bin/sh'...failed&#xA;10:28:07.434672 tramp-maybe-open-connection (3) # Opening connection for matias@office using ssh...failed&#xA;10:28:07.435634 tramp-get-file-property (8) #  file-truename nil&#xA;10:28:07.436239 tramp-flush-directory-property (8) # &#xA;10:28:07.436554 tramp-get-connection-property (7) # process-name nil&#xA;10:28:07.436781 tramp-get-connection-property (7) # process-name nil&#xA;10:28:07.437118 tramp-get-connection-property (7) # vector [ssh matias office  nil]&#xA;10:28:07.437291 tramp-process-sentinel (5) # Sentinel called: `#&amp;lt;process *tramp/ssh matias@office*&amp;gt;' `terminado (killed)&#xA;'&#xA;10:28:07.437433 tramp-flush-connection-property (7) # *tramp/ssh matias@office* (vector temp-file last-cmd-time)&#xA;10:28:07.437559 tramp-get-file-property (8) #  file-truename nil&#xA;10:28:07.437653 tramp-flush-directory-property (8) # &#xA;10:28:07.440201 tramp-get-connection-property (7) # process-name nil&#xA;10:28:07.440410 tramp-flush-connection-property (7) # [ssh matias office nil nil] (first-password-request)&#xA;10:28:07.440555 tramp-get-connection-property (7) # process-buffer nil&#xA;10:28:07.440735 tramp-file-name-handler (1) # Interrupt received in operation (file-exists-p /ssh:matias@office:)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; GNU Emacs: 24.5.1 Tramp: 2.2.11-24.5 -*- mode: outline; -*-&#xA;10:27:38.949023 tramp-check-proper-method-and-host (10) # &#xA;  backtrace()&#xA;  tramp-error([#(&quot;ssh&quot; 0 3 (tramp-default t)) nil &quot;ssh&quot; &quot;matias&quot; nil] user-error &quot;Host name must not match method \&quot;%s\&quot;&quot; &quot;ssh&quot;)&#xA;  apply(tramp-error [#(&quot;ssh&quot; 0 3 (tramp-default t)) nil &quot;ssh&quot; &quot;matias&quot; nil] user-error &quot;Host name must not match method \&quot;%s\&quot;&quot; &quot;ssh&quot;)&#xA;  tramp-check-proper-method-and-host([#(&quot;ssh&quot; 0 3 (tramp-default t)) nil &quot;ssh&quot; &quot;matias&quot; nil])&#xA;  tramp-maybe-open-connection([#(&quot;ssh&quot; 0 3 (tramp-default t)) nil &quot;ssh&quot; &quot;matias&quot; nil])&#xA;  tramp-send-command([#(&quot;ssh&quot; 0 3 (tramp-default t)) nil &quot;ssh&quot; &quot;matias&quot; nil] &quot;cd ~; pwd&quot;)&#xA;  tramp-sh-handle-expand-file-name(&quot;/ssh:matias&quot; nil)&#xA;  apply(tramp-sh-handle-expand-file-name (&quot;/ssh:matias&quot; nil))&#xA;  tramp-sh-file-name-handler(expand-file-name &quot;/ssh:matias&quot; nil)&#xA;  apply(tramp-sh-file-name-handler expand-file-name (&quot;/ssh:matias&quot; nil))&#xA;  byte-code(&quot;\300\301\215\207&quot; [suppress (apply foreign operation args)] 2)&#xA;  byte-code(&quot;K\306\211&amp;lt;\203\237&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="68" LastActivityDate="2016-02-14T10:19:05.060" Title="Tramp just hangs &quot;Found remote shell prompt on&quot;" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20301" PostTypeId="2" ParentId="20300" CreationDate="2016-02-14T10:19:05.060" Score="1" Body="&lt;p&gt;According to the traces, Tramp sends the following command after it has connected the remote host:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Keexec env ENV='' HISTFILE=/dev/null PROMP &#xA;[KT&#xA;T_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh &#xA;&#xA;]0;matias@matias-HP-ProDesk-600-G1-TWR: exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\  PS2='' PS3='' /bin/sh #$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looks, like there are strange prompt settings. Check the Tramp manual for techniques how to suppress those settings.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-02-14T10:19:05.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20302" PostTypeId="2" ParentId="87" CreationDate="2016-02-14T10:29:57.263" Score="4" Body="&lt;p&gt;I have since found that &lt;code&gt;elisp-index-search&lt;/code&gt; and &lt;code&gt;emacs-index-search&lt;/code&gt; are also quite useful. They search for indexed topics in the Emacs Lisp Reference Manual or the Emacs User Manual respectively.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2016-02-14T10:29:57.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20303" PostTypeId="2" ParentId="20299" CreationDate="2016-02-14T11:34:48.313" Score="11" Body="&lt;p&gt;&lt;code&gt;helm-M-x&lt;/code&gt; is arguably unusual in this aspect.  You first invoke it, type until you've picked the command you want to execute, then add the prefix argument by pressing &lt;code&gt;C-u&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-02-14T11:34:48.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20304" PostTypeId="1" AcceptedAnswerId="20306" CreationDate="2016-02-14T14:03:25.230" Score="2" ViewCount="263" Body="&lt;p&gt;Perhaps I'm kind of misusing that feature &amp;ndash; but I find desktop files rather handy to be kept with &lt;em&gt;projects&lt;/em&gt;. Clearly, it doesn't make much sense then to store &lt;em&gt;absolute paths&lt;/em&gt; for the files to be opened; rather, I would like paths relative to the desktop file's own folder, so I can move the entire project folder al gusto and always load the desktop file within.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has indeed no problem opening such &amp;ldquo;local desktop files&amp;rdquo;, like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-create-buffer 206&#xA;  &quot;src/Main.hs&quot;&#xA;  &quot;Main&quot;&#xA;  'haskell-mode&#xA;  ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, as soon as I do &lt;code&gt;desktop-save&lt;/code&gt; (e.g. because I added a new file to the project), all the stored paths will get changed to absolute format&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-create-buffer 206&#xA;  &quot;/home/me/right/now/the/project/is/stored/here/src/Main.hs&quot;&#xA;  &quot;Main&quot;&#xA;  'haskell-mode&#xA;  ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not hard to undo this by hand or with a quick &lt;code&gt;sed&lt;/code&gt; command, but that's quite annoying. Can I tell emacs not to store those paths in absolute format?&lt;/p&gt;&#xA;" OwnerUserId="10069" LastEditorUserId="105" LastEditDate="2016-03-20T01:26:21.030" LastActivityDate="2016-03-20T01:26:21.030" Title="How to make desktop-save store relative paths?" Tags="|files|desktop|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20305" PostTypeId="1" CreationDate="2016-02-14T16:11:18.240" Score="1" ViewCount="37" Body="&lt;p&gt;I've run ediff-buffers to compare two versions of the same file, how can I now exit from this diff? How can I restore the view of the buffer?&lt;/p&gt;&#xA;" OwnerUserId="10438" LastActivityDate="2016-02-14T16:11:18.240" Title="How to exit from ediff-buffers?" Tags="|buffers|ediff|" AnswerCount="0" CommentCount="0" ClosedDate="2016-02-14T16:50:08.647" ContentLicense="CC BY-SA 3.0" />
  <row Id="20306" PostTypeId="2" ParentId="20304" CreationDate="2016-02-14T16:37:25.633" Score="3" Body="&lt;p&gt;I believe you can achieve this by setting &lt;code&gt;desktop-file-name-format&lt;/code&gt; to &quot;&lt;code&gt;local&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what &lt;code&gt;describe-variable&lt;/code&gt; says about it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;desktop-file-name-format is a variable defined in `desktop.el'.&#xA;Its value is absolute&#xA;&#xA;Documentation:&#xA;Format in which desktop file names should be saved.&#xA;Possible values are:&#xA;   absolute -- Absolute file name.&#xA;   tilde    -- Relative to ~.&#xA;   local    -- Relative to directory of desktop file.&#xA;&#xA;You can customize this variable.&#xA;&#xA;This variable was introduced, or its default value was changed, in&#xA;version 22.1 of Emacs.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the &quot;local&quot; &lt;code&gt;desktop-file-name-format&lt;/code&gt; you just need to make sure that the desktop file is saved in the top directory of a project. One way to do this is by setting &lt;code&gt;desktop-dirname&lt;/code&gt; using &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables&quot; rel=&quot;nofollow&quot;&gt;Per-Directory Local Variables&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastActivityDate="2016-02-14T16:37:25.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20307" PostTypeId="1" AcceptedAnswerId="20311" CreationDate="2016-02-14T17:07:17.180" Score="1" ViewCount="163" Body="&lt;p&gt;I'm test-driving Emacs 25.1 and have noticed that a simple &lt;code&gt;concat&lt;/code&gt; command, which used to work in v.24 (and v.23), doesn't work in v.25.1:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs (concat user-emacs-directory &quot;snippets&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In v.25.1 I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;byte-code: Wrong type argument: listp, &quot;~/Dropbox/emacs/snippets&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To make it work in v.25.1, I need to do call the function thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs (concat user-emacs-directory '(&quot;snippets&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my question is, why doesn't the latter work in Emacs 25.1 anymore? (Or alternatively, is the former the &lt;em&gt;correct&lt;/em&gt; way actually?) &lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2016-02-15T00:25:09.307" Title="Is there a string manipulation difference between Emacs 24 and 25.1?" Tags="|string|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="20308" PostTypeId="1" AcceptedAnswerId="20316" CreationDate="2016-02-14T17:37:38.097" Score="1" ViewCount="407" Body="&lt;p&gt;I have downloaded the package &lt;a href=&quot;https://github.com/darksmile/cheatsheet&quot; rel=&quot;nofollow&quot;&gt;cheatsheel.el&lt;/a&gt; from Melpa for use in Emacs 25.5.1 in Ubuntu. &#xA;However, I seem unable to add cheats to it because only the command                &lt;code&gt;(cheatsheet-show)&lt;/code&gt; is available and works while the commands &lt;code&gt;cheatsheet-add&lt;/code&gt; and &lt;code&gt;cheatsheet-get&lt;/code&gt; do not show up at all. Any help on using this package would be appreciated. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="11112" LastActivityDate="2016-02-15T03:50:40.737" Title="Using cheatsheet.el and adding cheats to it" Tags="|package|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20309" PostTypeId="2" ParentId="20233" CreationDate="2016-02-14T21:58:54.463" Score="3" Body="&lt;p&gt;Well, just as a challenge, here's some Emacs Lisp code to do something slightly more general than just swapping two selected columns:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/determine-column (col line)&#xA;  (cl-loop for word in line&#xA;           for i from 0&#xA;           summing (length word) into total&#xA;           if (&amp;gt; total col) do&#xA;           (cl-return i)&#xA;           finally (cl-return (1- i))))&#xA;&#xA;(defun my/swap-columns (dir beg end)&#xA;  (interactive&#xA;   (let* ((dir (prefix-numeric-value current-prefix-arg)))&#xA;     (if (region-active-p)&#xA;         (list dir (region-beginning) (region-end))&#xA;       (list dir (point-min) (point-max)))))&#xA;  (save-excursion&#xA;    (let* ((lines (mapcar&#xA;                   (lambda (s) (split-string s &quot;\t&quot;))&#xA;                   (split-string (buffer-substring beg end) &quot;\n&quot; t)))&#xA;           (column (my/determine-column (current-column) (car lines)))&#xA;           (permuted (mod (+ column dir) (length (car lines)))))&#xA;      (delete-region beg end)&#xA;      (goto-char beg)&#xA;      (cl-loop for line in lines&#xA;               for temp = (nth column line) do&#xA;               (setf (nth column line) (nth permuted line)&#xA;                     (nth permuted line) temp)&#xA;               (insert (mapconcat 'identity line &quot;\t&quot;) &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea is that if you give it a negative argument it'll swap the column containing point that many columns leftwards, and if you give it a positive prefix argument, it'll swap that column that many columns rightwards.  I didn't really check this for correctness or sane behavior (it does swap columns though).&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-02-14T21:58:54.463" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20310" PostTypeId="2" ParentId="20231" CreationDate="2016-02-14T22:05:55.747" Score="2" Body="&lt;p&gt;This feature is now present in development version of AUCTeX and will be available in the next ELPA release (presumably 11.89.2) and in the next official stable version (presumably 11.90).  There are two options controlling the behavior: &lt;code&gt;TeX-ignore-warnings&lt;/code&gt; and &lt;code&gt;TeX-suppress-ignored-warnings&lt;/code&gt;.  With the former you set the regexp matching warnings to be ignored, with the second you actually tell AUCTeX to hide the warnings.  For your case you'd have to add the following code to your init file&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-ignore-warnings&#xA;      &quot;LaTeX Warning: Command \\\\mark\\(both\\|right\\)  has changed.&quot;&#xA;      TeX-suppress-ignored-warnings t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can show or hide these warnings with &lt;kbd&gt;C-C C-t C-x&lt;/kbd&gt; (&lt;code&gt;TeX-toggle-suppress-ignored-warnings&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the error overview you can open with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;TeX-error-overview&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, it's possible to toggle visibility of such ignored warnings with &lt;kbd&gt;x&lt;/kbd&gt;.  BTW, you can also toggle visibility of all bad boxes and generic warnings with &lt;kbd&gt;b&lt;/kbd&gt; and &lt;kbd&gt;w&lt;/kbd&gt;, respectively.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In previous versions of AUCTeX, the best way to accomplish what you ask is be to hack into &lt;code&gt;TeX-parse-error&lt;/code&gt; and skip warnings to be ignored there.  But this function was fairly large and is changed fairly often, then a redefinition would overwrite these changes, so I advise against redefining &lt;code&gt;TeX-parse-error&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, if you have AUCTeX 11.88 or later you can hack into &lt;code&gt;TeX-parse-all-errors&lt;/code&gt;: after parsing the whole compilation log remove the unwanted warnings.  Add the following code to your init file&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq mg-ignored-warnings&#xA;      &quot;LaTeX Warning: Command \\\\mark\\(both\\|right\\)  has changed.&quot;)&#xA;(defun mg-remove-ignored-warnings (&amp;amp;rest args)&#xA;  &quot;Remove unwanted warnings from `TeX-error-list'.&quot;&#xA;  (let ((list TeX-error-list)&#xA;    entry new-list)&#xA;    (while (setq entry (pop list))&#xA;      (unless (and mg-ignored-warnings&#xA;           (string-match mg-ignored-warnings (nth 3 entry)))&#xA;    (push entry new-list)))&#xA;    (setq TeX-error-list (reverse new-list))))&#xA;(advice-add #'TeX-parse-all-errors :after #'mg-remove-ignored-warnings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You only have to set &lt;code&gt;mg-ignored-warnings&lt;/code&gt; to a regexp matching warnings you want to skip and you're done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note also that since version 11.88 it's available a nice formatted list of all errors and warnings reported in the compilation log, &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;TeX-error-overview&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, that makes navigating through such messages much easier.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2016-02-21T16:07:02.220" LastActivityDate="2016-02-21T16:07:02.220" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20311" PostTypeId="2" ParentId="20307" CreationDate="2016-02-14T23:26:07.393" Score="4" Body="&lt;p&gt;The change is not in &lt;code&gt;concat&lt;/code&gt;, but in &lt;code&gt;yas-snippet-dirs&lt;/code&gt;. In earlier versions, &lt;code&gt;yas-snippet-dirs&lt;/code&gt; could be either a single directory (a string) or a list of directories. The line&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs (concat user-emacs-directory &quot;snippets&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is working, it's setting &lt;code&gt;yas-snippet-dirs&lt;/code&gt; to the string &lt;code&gt;&quot;~/Dropbox/emacs/snippets&quot;&lt;/code&gt;. The error message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;byte-code: Wrong type argument: listp, &quot;~/Dropbox/emacs/snippets&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;lists that string, and is telling you that this string was used in a context that requires a list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm actually surprised that your second attempt got anywhere, as Emacs from git, just like previous released versions, do not accept a list of strings as the argument of &lt;code&gt;concat&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, unless you need to keep supporting older versions of yasnippet, make &lt;code&gt;yas-snippet-dirs&lt;/code&gt; a list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs (list (concat user-emacs-directory &quot;snippets&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or the more explicit (and theoretically more portable, and more robust as it doesn't require that &lt;code&gt;user-emacs-directory&lt;/code&gt; have a trailing slash)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs (list (expand-file-name &quot;snippets&quot; user-emacs-directory)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-02-15T00:25:09.307" LastActivityDate="2016-02-15T00:25:09.307" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20312" PostTypeId="1" CreationDate="2016-02-14T23:48:24.283" Score="2" ViewCount="799" Body="&lt;p&gt;I am trying to use &lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-complete&lt;/code&gt;&lt;/a&gt; + &lt;a href=&quot;https://github.com/ejmr/php-auto-yasnippets&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;php-auto-yasnippets&lt;/code&gt;&lt;/a&gt; with &lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;web-mode&lt;/code&gt;&lt;/a&gt;, but I can't get the snippets to work correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start typing &lt;code&gt;imp&lt;/code&gt;, I correctly get auto-completion to &lt;code&gt;implode&lt;/code&gt; but if I press &lt;code&gt;TAB&lt;/code&gt; then &lt;code&gt;RET&lt;/code&gt; I get an error&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;payas/ac-insert-func-and-create-snippet: Wrong number of arguments: #[(arg) &quot;Æ ?]  [ac-menu string ac-prefix arg last-command cl-struct-popup-tags ac-expand-common popup-selected-item ac-next ac-previous ...] 5 (&quot;d:/UnixLike/home/.emacs.d/elpa/auto-complete-20160107.8/auto-complete.elc&quot; . 42072) &quot;P&quot;], 0&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;imp&lt;/code&gt;, then press &lt;code&gt;TAB&lt;/code&gt; to get autocompletion, and then use &lt;code&gt;C-c C-y&lt;/code&gt; to call &lt;code&gt;yes/create-php-snippet&lt;/code&gt;, it works, and after that I can use &lt;code&gt;TAB&lt;/code&gt; + &lt;code&gt;RET&lt;/code&gt; to get yasnippets... (but only for &lt;code&gt;implode&lt;/code&gt;, if I type another PHP functions, I have to call &lt;code&gt;C-c C-y&lt;/code&gt; before &lt;code&gt;TAB&lt;/code&gt; + &lt;code&gt;RET&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a part of my &lt;code&gt;.emacs.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete-config)&#xA;&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs.d/ac-dict&quot;)&#xA;(ac-config-default)&#xA;&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;(require 'php-auto-yasnippets)&#xA;&#xA;(require 'emmet-mode)&#xA;(require 'ac-emmet)&#xA;&#xA;(require 'web-mode)&#xA;&#xA;(payas/ac-setup)&#xA;&#xA;(setq web-mode-ac-sources-alist&#xA;  '((&quot;php&quot; . (ac-source-yasnippet ac-source-php-auto-yasnippets))&#xA;    (&quot;html&quot; . (ac-source-emmet-html-aliases ac-source-emmet-html-snippets))&#xA;    (&quot;css&quot; . (ac-source-css-property ac-source-emmet-css-snippets))))&#xA;&#xA;(add-hook 'web-mode-before-auto-complete-hooks&#xA;          '(lambda ()&#xA;             (let ((web-mode-cur-language&#xA;                    (web-mode-language-at-pos)))&#xA;               (if (string= web-mode-cur-language &quot;php&quot;)&#xA;                   (yas-activate-extra-mode 'php-mode)&#xA;                 (yas-deactivate-extra-mode 'php-mode))&#xA;               (if (string= web-mode-cur-language &quot;css&quot;)&#xA;                   (setq emmet-use-css-transform t)&#xA;                 (setq emmet-use-css-transform nil)))))&#xA;&#xA;(define-key web-mode-map (kbd &quot;C-c C-y&quot;) 'yas/create-php-snippet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Below are the &lt;code&gt;payas/ac-insert-func-and-create-snippet&lt;/code&gt; and &lt;code&gt;payas/ac-setup&lt;/code&gt; function from &lt;a href=&quot;https://github.com/ejmr/php-auto-yasnippets&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;php-auto-yasnippets&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun payas/ac-insert-func-and-create-snippet ()&#xA;  &quot;Insert the selected function name then create its auto-snippet.&quot;&#xA;  (ac-expand)&#xA;  (yas/create-php-snippet nil))&#xA;&#xA;(defun payas/ac-setup ()&#xA;  &quot;Add ac-source-php-auto-yasnippets to ac-sources.&quot;&#xA;  (interactive)&#xA;&#xA;  (ac-define-source php-auto-yasnippets&#xA;    '((depends yasnippet)&#xA;      ;; TODO The php-mode dictionary contains a few things (keywords and&#xA;      ;; the like) that should not be included&#xA;      (candidates . (ac-mode-dictionary 'php-mode))&#xA;      (action . payas/ac-insert-func-and-create-snippet)&#xA;&#xA;      ;; Since these trigger yasnippet, use the yasnippet face.&#xA;      (candidate-face . ac-yasnippet-candidate-face)&#xA;      (selection-face . ac-yasnippet-selection-face)&#xA;&#xA;      ;; The 'p' suffix on auto-complete entries stands for 'PHP', and helps&#xA;      ;; distinguish them from regular yasnippet entries.&#xA;      (symbol . &quot;p&quot;)))&#xA;  (add-to-list 'ac-sources 'ac-source-php-auto-yasnippets))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11022" LastEditorUserId="160" LastEditDate="2016-02-16T16:20:55.263" LastActivityDate="2016-02-16T16:20:55.263" Title="Web-Mode + Yasnippets + Autocomplete, error before create-php-snippet" Tags="|yasnippet|auto-complete-mode|web-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20313" PostTypeId="2" ParentId="19679" CreationDate="2016-02-15T00:40:30.483" Score="3" Body="&lt;p&gt;I'm not familiar with SuperTab, and it probably doesn't have an exact equivalent anyway, but rather similar features. Going by your description, I'd say you're looking for &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Dynamic-Abbrevs.html#index-dabbrev_002dexpand&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;dabbrev-expand&lt;/code&gt;&lt;/a&gt;, which is a built-in Emacs feature. The command is bound to &lt;code&gt;M-/&lt;/code&gt; by default. It completes the current word from a pool that isn't exactly words in the current buffer, but close: it first looks backward from the current position, and then if it finds nothing it looks forward, and if it still finds nothing, it looks in other buffers. &lt;code&gt;M-/&lt;/code&gt; completes the word in full; if you press is again, it gives you the next hit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also &lt;code&gt;C-M-/&lt;/code&gt; (&lt;code&gt;dabbrev-completion&lt;/code&gt;), which completes the unambiguous part of the word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;hippie-expand&lt;/code&gt; is a sort of &lt;code&gt;dabbrev-expand&lt;/code&gt; on steroids: it tries to guess your mind, but doesn't always succeed. &lt;code&gt;dabbrev-expand&lt;/code&gt; always sticks to a word (according to the syntax rules of the current buffer). If &lt;code&gt;eval&lt;/code&gt; expands to &lt;code&gt;evaluation.&lt;/code&gt;, you must have tried it in a buffer where the syntax rules make &lt;code&gt;.&lt;/code&gt; a symbol constituent, such as the &lt;code&gt;*scratch*&lt;/code&gt; buffer as &lt;a href=&quot;https://emacs.stackexchange.com/users/2370/tobias&quot;&gt;Tobias&lt;/a&gt; suggested (&lt;code&gt;*scratch*&lt;/code&gt; uses Lisp syntax rules since its primary purpose is to let you type Lisp expressions that Emacs evaluates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The smart-tab package invokes either &lt;code&gt;dabbrev-expand&lt;/code&gt; or &lt;code&gt;hippie-expand&lt;/code&gt; based on a configuration option. It doesn't provide a completion or expansion mechanism; what it does is to guess whether you mean to indent or to complete when you press Tab (whereas by default Emacs has completion and indentation on different keys).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-02-15T00:40:30.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20314" PostTypeId="6" CreationDate="2016-02-15T02:57:31.913" Score="0" Body="&lt;p&gt;I am new to Emacs. I have been an Emacs user probably for as long as I have been a participant on Emacs SE. However, I am heavily invested in Emacs, and dedicated to becoming better at using it each day, and helping others to do the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In recent months, I have become more and more active in this community, and find it to be the most helpful, welcoming, and healthy of all the SEs that I participate in (not to say that the others are unwelcoming, unhelpful, or unhealthy - but participants in this site will understand what I mean, I am sure). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am proud to be a part of this community, and though I am certainly not the most qualified, I would be honored to play a small part in keeping Emacs Stack Exchange great!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-02-15T02:57:31.913" LastActivityDate="2016-02-15T02:57:31.913" CommentCount="1" CommunityOwnedDate="2016-02-15T02:57:31.913" ContentLicense="CC BY-SA 3.0" />
  <row Id="20315" PostTypeId="1" AcceptedAnswerId="20319" CreationDate="2016-02-15T03:03:51.787" Score="4" ViewCount="1585" Body="&lt;p&gt;I cannot seem to set &lt;code&gt;#+PROPERTY: header-args:R&lt;/code&gt; as the first value and have it work the way I expect it to. This is used as an example for org-mode &lt;a href=&quot;http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting a language specific property for &lt;code&gt;:exports&lt;/code&gt; works. (I've put in some &lt;code&gt;emacs-lisp&lt;/code&gt; source blocks, and those results do not get shown.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Providing a name for the session does not change the output (i.e. &lt;code&gt;:session *R*&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing the order just makes the first one not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(As an aside, how can I check what a &lt;code&gt;#+PROPERTY&lt;/code&gt; is set to?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-mode 8.3.3 from elpa package. emacs-version 24.5.1 on OSX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some minimally working examples follow.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;This works:&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :session&#xA;#+PROPERTY: header-args:R :exports both&#xA;&#xA;#+BEGIN_SRC R &#xA;x = 3&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC R &#xA;x&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;resulting in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 3&#xA;3&#xA;x&#xA;3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Also this works&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :exports both&#xA;#+PROPERTY: header-args:R :session&#xA;&#xA;#+BEGIN_SRC R &#xA;x = 3&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC R &#xA;x&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and results in the same results as above.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;This does not work:&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args:R :session&#xA;#+PROPERTY: header-args:R :exports both&#xA;&#xA;#+BEGIN_SRC R &#xA;x = 3&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC R &#xA;x&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;resulting in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 3&#xA;3&#xA;x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Also does not work&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args:R :exports both&#xA;#+PROPERTY: header-args:R :session&#xA;&#xA;#+BEGIN_SRC R &#xA;x = 3&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC R &#xA;x&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;resulting in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 3&#xA;x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10426" LastActivityDate="2016-02-15T07:25:34.170" Title="setting an org mode property header doesn't work for the first one" Tags="|org-mode|org-babel|r|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20316" PostTypeId="2" ParentId="20308" CreationDate="2016-02-15T03:50:40.737" Score="1" Body="&lt;p&gt;&lt;code&gt;cheat-sheet-add&lt;/code&gt; is expecting to receive a &lt;em&gt;list&lt;/em&gt; programmatically, it is not meant to show up with an interactive user interface. Follow the instructions in the comments of &lt;code&gt;cheatsheet.el&lt;/code&gt; beginning at line 22.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Quick start. Load package. Add your first cheat:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cheatsheet-add :group 'Common :key &quot;C-x C-c&quot; :description &quot;leave Emacs.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;(cheatsheet-show)&lt;/code&gt; and enjoy looking at your own Emacs cheatsheet.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You add the above-mentioned cheat to your &lt;code&gt;.emacs&lt;/code&gt; file, save, and restart Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-02-15T03:50:40.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20317" PostTypeId="6" CreationDate="2016-02-15T05:16:47.767" Score="0" Body="&lt;p&gt;I've been an Emacs user for almost two years. I've been truly impressed by my new-found ability to turn text-editing ideas into reality. Emacs.SE is a wonderful, welcoming community, and I would like to help it however I can. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll be honest. Here are &lt;a href=&quot;http://meta.emacs.stackexchange.com/q/371&quot;&gt;a few reasons I may not serve as a good moderator&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;I use Emacs as a text editor.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not use Emacs to read mail, view documents, surf the web, or organize my life. I do not disagree with those who do, I simply haven't had the time to explore those realms of Emacs. As such, I am not useful when it comes to many popular topics on Emacs.SE. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;I am a student.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This point may not seem like a very big deal. Basically, this means that my contributions to this community come in concentrated chunks. On test days, I focus on the tests. I contribute far more during the summer and on holidays. During crunch time, I may disappear for weeks on end.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is my most sincere hope that the ones best suited for this position will win. I am nominating myself (a bit late, I fear) with the goal of inspiring other, hopefully better, candidates to nominate themselves as well.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-02-15T16:43:09.137" LastActivityDate="2016-02-15T16:43:09.137" CommentCount="1" CommunityOwnedDate="2016-02-15T05:16:47.767" ContentLicense="CC BY-SA 3.0" />
  <row Id="20318" PostTypeId="1" AcceptedAnswerId="20320" CreationDate="2016-02-15T06:26:40.357" Score="1" ViewCount="735" Body="&lt;p&gt;I want to re-install spacemacs, since something doesn't work and I don't want to spent on fix it. But how to backup the bookmarks of the spacemacs, even better also backup the most recent open file list.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2016-02-15T08:30:07.243" Title="How to backup bookmark for spacemacs?" Tags="|spacemacs|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20319" PostTypeId="2" ParentId="20315" CreationDate="2016-02-15T07:20:33.947" Score="6" Body="&lt;p&gt;Add a &lt;code&gt;+&lt;/code&gt; to the key to append values to a property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an instance, in your last example you should write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args:R :exports both&#xA;#+PROPERTY: header-args:R+ :session&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the &lt;code&gt;+&lt;/code&gt; behind the key &lt;code&gt;header-args:R&lt;/code&gt; in the second line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+PROPERTY: var  foo=1&#xA; #+PROPERTY: var+ bar=2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the orgmode online help &lt;a href=&quot;http://orgmode.org/manual/Property-syntax.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Property-syntax.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, I wonder myself how the &lt;code&gt;header-args:c++&lt;/code&gt; property can be set without appending;-).&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-02-15T07:25:34.170" LastActivityDate="2016-02-15T07:25:34.170" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20320" PostTypeId="2" ParentId="20318" CreationDate="2016-02-15T08:30:07.243" Score="2" Body="&lt;p&gt;Spacemacs saves the bookmarks in &lt;code&gt;~/.emacs.d/.cache/bookmarks&lt;/code&gt;, and the recent files lise in &lt;code&gt;~/.emacs.d/.cache/recentf&lt;/code&gt;. You can copy these two files somewhere outside of &lt;code&gt;~/.emacs.d&lt;/code&gt;, and copy them back in after re-installing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, there might be more files in &lt;code&gt;~/.emacs.d/.cache&lt;/code&gt; that you'd like to save. I suggest backing up the entire &lt;code&gt;~/.emacs.d/.cache&lt;/code&gt; and restoring what you miss after re-installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completeness, I'll mention that the locations of these two files are controlled by the variables &lt;code&gt;bookmark-default-file&lt;/code&gt; and &lt;code&gt;recentf-save-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-02-15T08:30:07.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20321" PostTypeId="1" CreationDate="2016-02-15T11:07:00.263" Score="22" ViewCount="1706" Body="&lt;p&gt;I have a couple files, e.g. &lt;code&gt;file-1.org&lt;/code&gt;, &lt;code&gt;file-2.org&lt;/code&gt; in the same directory sharing the &lt;code&gt;data/&lt;/code&gt; directory for attachments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to move &lt;code&gt;file-1.org&lt;/code&gt; to a different location, create a new &lt;code&gt;data/&lt;/code&gt; directory in that location and move all attachments that belong to &lt;code&gt;file-1.org&lt;/code&gt; to the new directory. Is there an automatic way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="253" LastEditDate="2016-02-18T11:41:04.197" LastActivityDate="2018-03-27T23:37:31.527" Title="How to move an org-mode file together with all attachments?" Tags="|org-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20322" PostTypeId="1" CreationDate="2016-02-15T13:09:32.483" Score="2" ViewCount="1574" Body="&lt;p&gt;Emacs terminal (from multi-term) can automatically detect a folder path. So  performing &lt;code&gt;C-x C-f&lt;/code&gt; from a local directory, automatically provides the path to that directory to open any relevant files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions is how to do the same for a remote directory that was accessed through ssh from emacs terminal? Since, if I perform &lt;code&gt;C-x C-f&lt;/code&gt;, it only tries to open the local directory from which ssh connection was launched. How to automatically pass information to tramp to help open the files in the remote directory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for something similar to this &lt;a href=&quot;https://emacs.stackexchange.com/questions/17629/file-and-directory-autocompletion-in-remote-shell&quot;&gt;question&lt;/a&gt;, but for &lt;code&gt;term&lt;/code&gt; or &lt;code&gt;multi-term&lt;/code&gt;, since &lt;code&gt;shell&lt;/code&gt; does not seem to recognize the local alias and other shortcuts that are stored in &lt;code&gt;~/.bashrc&lt;/code&gt; of the remote server.&lt;/p&gt;&#xA;" OwnerUserId="8683" LastActivityDate="2016-05-15T16:09:03.833" Title="Identify remote directories and open files through tramp from emacs terminal" Tags="|tramp|terminal-emacs|ssh|remote|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20323" PostTypeId="6" CreationDate="2016-02-15T13:52:48.700" Score="0" Body="&lt;p&gt;I am obsessed with Emacs, I use it for just about everything everyday and want to help other people interested in the editor find their way around the initial confusion in order to experience the eventual power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since day one of the Emacs SE site I have answered a lot of questions here for primarily two reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I want this site to thrive and I want Emacs to thrive.&lt;/li&gt;&#xA;&lt;li&gt;I enjoy it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I've answered 136 questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've asked 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to stay fairly active in reviewing posts, and I tend to lean more towards a &quot;Looks Ok&quot;, &quot;Leave Open&quot; style of moderation. I would prefer to start a discussion about a post before voting to close it, or editing it on behalf of the poster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am here to help others. If being a moderator gives me a better platform to do so, I'd like to be there.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-02-15T16:10:52.900" LastActivityDate="2016-02-15T16:10:52.900" CommentCount="1" CommunityOwnedDate="2016-02-15T13:52:48.700" ContentLicense="CC BY-SA 3.0" />
  <row Id="20325" PostTypeId="6" CreationDate="2016-02-15T14:48:35.990" Score="0" Body="&lt;p&gt;I learnt Emacs with version 19.29 was the latest and greatest and one of these days I'll learn those features introduced by 19.30. (Just kidding, I've become quite reliant on some new features and I'm even starting to use ELPA.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been participating on Emacs Stack Exchange since the private beta and &lt;a href=&quot;http://meta.emacs.stackexchange.com/questions/232/state-of-the-beta/283#283&quot;&gt;I'm happy with how it's turning out&lt;/a&gt;. &lt;a href=&quot;http://meta.emacs.stackexchange.com/users&quot;&gt;I'm a bit of a meta junkie&lt;/a&gt;. I've also been participating moderation activities open to everyone (with sufficient reputation) such as review queues, edits and comments. I'm even in &lt;a href=&quot;http://chat.stackexchange.com/rooms/info/17392/scratch?id=17392&amp;amp;tab=general&amp;amp;users=frequent&quot;&gt;chat&lt;/a&gt;. All of that won't change whether I'm a moderator or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently a moderator on two Stack Exchange sites and a former moderator on two others. I'm willing to lend my experience to this site. However, I do encourage new people to participates — it is not my objective to moderate all the sites. I'm putting myself forward because as I write, there are only 3 candidates, and it takes at least 4 to have an election.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-02-15T14:48:35.990" LastActivityDate="2016-02-15T14:48:35.990" CommentCount="2" CommunityOwnedDate="2016-02-15T14:48:35.990" ContentLicense="CC BY-SA 3.0" />
  <row Id="20326" PostTypeId="2" ParentId="20322" CreationDate="2016-02-15T15:26:41.673" Score="3" Body="&lt;p&gt;Tramp works on the basis of &lt;code&gt;default-directory&lt;/code&gt;. If you run a shell in Emacs, and you perform ssh in that shell, the buffers's &lt;code&gt;default-directory&lt;/code&gt; is still the local path the shell was started from. You have three options to adapt &lt;code&gt;default-directory&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Start the shell while you are visiting a remote file or directory. The shell doesn't run on your local host, but on the remote one. You don't need to perform any ssh'ing in the shell, because you're already there. &lt;code&gt;default-directory&lt;/code&gt; is set proper.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use the local shell, and run your ssh command. After that, change the default directory of that buffer via &lt;code&gt;M-x cd RET /ssh:user@host:&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use eshell. You can change the host you are running your programs inside eshell via &lt;code&gt;cd /ssh:user@host:&lt;/code&gt;. The most flexible solution, if you want to contact several remote hosts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-02-15T15:26:41.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20327" PostTypeId="2" ParentId="20297" CreationDate="2016-02-15T15:30:57.233" Score="2" Body="&lt;p&gt;EDIT: Okay, after actually looking at the &lt;code&gt;f90-mode&lt;/code&gt; code, it looks like &lt;code&gt;f90-abbrev-start&lt;/code&gt; doesn't really do much except call &lt;code&gt;self-insert-command&lt;/code&gt; and relies on every entry in &lt;code&gt;f90-mode-abbrev-table&lt;/code&gt; to start with a backquote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution would be to modify &lt;code&gt;f90-mode-abbrev-table&lt;/code&gt; so the abbreviations all start with a hash character instead of a backquote, but I'm not sure how to do this in a way that isn't messy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other possibility that occurs to me would be to remap the key on the input event level rather than the command level, so that the call to &lt;code&gt;self-insert-command&lt;/code&gt; sees a backquote.  I think this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key f90-mode-map (kbd &quot;#&quot;) (kbd &quot;`&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Original, not-particularly-helpful answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the snippet you posted, you probably want to write:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key f90-mode-map (kbd &quot;#&quot;) #'f90-abbrev-start)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the only significant departure from the code in the snippet is the lack of &lt;code&gt;defvar&lt;/code&gt; and &lt;code&gt;let&lt;/code&gt; forms.  This is because those are being used to &lt;em&gt;define&lt;/em&gt; the variable &lt;code&gt;f90-mode-map&lt;/code&gt;, and you just want to modify the variable as it already exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other two minor changes here are less important:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Exchanging &lt;code&gt;&quot;#&quot;&lt;/code&gt; for &lt;code&gt;(kbd &quot;#&quot;)&lt;/code&gt; does nothing here (since &lt;code&gt;(kbd &quot;#&quot;)&lt;/code&gt; returns &lt;code&gt;&quot;#&quot;&lt;/code&gt;), but it's good practice to get into when defining key bindings, because &lt;code&gt;kbd&lt;/code&gt; will return the correct answer in pretty much all circumstances, whereas a bare string won't always work.&lt;/li&gt;&#xA;&lt;li&gt;The use of the sharp quote (&lt;code&gt;#'f90-abbrev-start&lt;/code&gt; vs. &lt;code&gt;'f90-abbrev-start&lt;/code&gt;) just tells Emacs that we are talking about the function &lt;code&gt;f90-abbrev-start&lt;/code&gt; rather than the variable &lt;code&gt;f90-abbrev-start&lt;/code&gt; (which may or may not be defined).  I don't believe this matters unless you're byte-compiling the file in question, but putting it in is considered good practice.  Also, it makes function references easier to distinguish visually, which I find helpful.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2016-02-16T20:47:28.360" LastActivityDate="2016-02-16T20:47:28.360" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20328" PostTypeId="6" CreationDate="2016-02-15T15:38:17.127" Score="0" Body="&lt;p&gt;I'm currently an appointed moderator and want to see this site thrive.  I'm willing to continue to mod if it will help.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Why me&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Experience.&lt;/em&gt; I've been doing it for a year+, and nothing has&#xA;blown up.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Contributor.&lt;/em&gt; I answer a lot of questions (200-ish), but I also&#xA;ask a lot of them (75-ish).  I think one of our biggest&#xA;challenges is getting enough interesting questions posted to&#xA;keep people engaged.  I'm not going to pretend that I posted my&#xA;questions out of pure public-spiritedness, but I do think that&#xA;good questions are as much a public good as are good answers.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Why not me&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;You'd like new faces.&lt;/em&gt; Totally reasonable, and there are&#xA;several good candidates from which to choose.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;I do downvote on occasion.&lt;/em&gt; You might not consider that&#xA;reasonable behavior for a moderator.  I try to do it sparingly, but when I do,&#xA;it's either because of abrasive tone or&#xA;&lt;a href=&quot;http://meta.emacs.stackexchange.com/questions/178/how-much-background-research-before-posting-a-question&quot;&gt;lack of reasonable research effort&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;I'm not a copy-editor.&lt;/em&gt; Although I do clean up posts, I don't&#xA;think it's the moderator's job to micro-manage or otherwise&#xA;copy-edit them.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-02-15T15:38:17.127" LastActivityDate="2016-02-15T15:38:17.127" CommentCount="0" CommunityOwnedDate="2016-02-15T15:38:17.127" ContentLicense="CC BY-SA 3.0" />
  <row Id="20329" PostTypeId="6" CreationDate="2016-02-15T16:24:32.490" Score="0" Body="&lt;p&gt;I've been using Emacs for over 10 years now and have been &quot;living in Emacs&quot; for at least the the last 5. I use it in my work (software development using C, C++, and Python), e-mail, writing (AUCTeX), general note-taking (Org), et cetera.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there's anything I learned in this time, it is &lt;em&gt;how to ask Emacs&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been excited to witness the creation of Emacs SE back in 2014 and have been trying to give back by answering questions here. My current standing (top 1% this quarter and #15 out of 6000 users overall) gives you an idea of how much I enjoy using unanswered questions as an excuse to do the research and learn something new. :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want Emacs and this community to thrive and I'd be happy to contribute to it as a moderator  -- if the community would have me.&lt;/p&gt;&#xA;" OwnerUserId="2355" LastEditorUserId="2355" LastEditDate="2016-02-15T16:24:32.490" LastActivityDate="2016-02-15T16:24:32.490" CommentCount="0" CommunityOwnedDate="2016-02-15T16:24:32.490" ContentLicense="CC BY-SA 3.0" />
  <row Id="20330" PostTypeId="1" AcceptedAnswerId="20331" CreationDate="2016-02-15T18:12:32.380" Score="1" ViewCount="452" Body="&lt;p&gt;I installed AUCTeX through the package interface. This pulled version 11.89 from ELPA. Before that, I was running a version of AUCTeX provided by my operating system (Ubuntu 12.04), which is 11.87. After restarting Emacs to ensure I was using the new version, switching to (La)TeX mode fails with the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File mode specification error: (invalid-function TeX-auto-add-type)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no reference to &lt;code&gt;TeX-auto-add-type&lt;/code&gt; in my init file, so what's going on?&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-02-15T18:12:32.380" Title="After upgrading AUCTeX, (La)TeX mode is unusable (invalid-function TeX-auto-add-type)" Tags="|auctex|upgrade|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20331" PostTypeId="2" ParentId="20330" CreationDate="2016-02-15T18:12:32.380" Score="2" Body="&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: In version 11.87, &lt;code&gt;TeX-auto-add-type&lt;/code&gt; was a function. In version 11.88 (since &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/commit/tex.el?id=f4d3f2840e8f448a329b223c081bce556eb6ca67&quot; rel=&quot;nofollow&quot;&gt;commit f4d3f2840e8f448a329b223c081bce556eb6ca67&lt;/a&gt;, &lt;code&gt;TeX-auto-add-type&lt;/code&gt; became a macro. My understanding is that during the installation of the newer version in a live Emacs, the function was loaded, and the byte compiler picked up the function. After restarting Emacs, there was no function, only a macro, but the bytecode refered to the function, hence the error. It's unclear to me whether this is due to a bug in AUCTeX or a lack of robustness in byte compilation in Emacs in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;: to recompile the bytecode now that the function is no longer present in memory. This can be done by uninstalling the &lt;code&gt;auctex&lt;/code&gt; package and reinstalling. Alternatively, remove the bytecode files &lt;code&gt;~/.emacs.d/elpa/auctex-11.89.1/*.elc&lt;/code&gt; (adjust for your AUCTeX version) (open the directory in Dired, &lt;code&gt;% m \.elc RET D yes RET&lt;/code&gt;) and recompile them (&lt;code&gt;M-0 M-x byte-recompile-directory&lt;/code&gt; — you need the prefix argument 0 to recompile all the files even though the no &lt;code&gt;.elc&lt;/code&gt; file is present).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This problem can be avoided by not performing the package installation in a live Emacs, but in a dedicated instance. Generally speaking, performing package installations in an instance of Emacs just for that task is safer.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-02-15T18:12:32.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20332" PostTypeId="2" ParentId="16806" CreationDate="2016-02-15T18:17:07.243" Score="1" Body="&lt;p&gt;After accidentally losing &lt;code&gt;write-region&lt;/code&gt; (there's some weird interaction between &lt;a href=&quot;https://emacs.stackexchange.com/questions/16809/override-a-function-locally-but-allow-calls-to-the-original-function/16810#16810&quot;&gt;&lt;code&gt;flet&lt;/code&gt; and advice&lt;/a&gt; that I don't understand), I added this code early in my &lt;code&gt;.emacs&lt;/code&gt;. I save all the subroutines in a separate obarray, so as long as I don't lose both &lt;code&gt;fset&lt;/code&gt; and &lt;code&gt;defalias&lt;/code&gt; I should be able to recover.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Before anything else, keep a copy of all built-in functions. This&#xA;;; is not used during normal operation, only when I accidentally&#xA;;; unbind a primitive, e.g. due to ill-advised advice.&#xA;;; https://emacs.stackexchange.com/questions/16806/recover-a-built-in-function-that-i-accidentally-unbound&#xA;(defvar subr-backup-obarray&#xA;  (let ((backup-obarray (make-vector (length obarray) 0)))&#xA;    (mapatoms (lambda (symbol)&#xA;                (if (and (fboundp symbol) (subrp (symbol-function symbol)))&#xA;                    (fset (intern (symbol-name symbol) backup-obarray)&#xA;                          (symbol-function symbol)))))&#xA;    backup-obarray)&#xA;  &quot;Backup of all built-in functions.&quot;)&#xA;(defalias 'subr-backup&#xA;  ;; Why this strange definition? This way we get a byte-compiled&#xA;  ;; object that doesn't contain any call to a function symbol, only&#xA;  ;; bytecode opcodes and subr objects.&#xA;  (byte-compile&#xA;   (let ((intern-soft (list 'funcall (symbol-function 'intern-soft)))&#xA;         (symbol-function (list 'funcall (symbol-function 'symbol-function)))&#xA;         (symbol-name (list 'funcall (symbol-function 'symbol-name)))&#xA;         (symbolp (list 'funcall (symbol-function 'symbolp))))&#xA;     `(lambda (name)&#xA;        (,@symbol-function&#xA;         (,@intern-soft (if (,@symbolp name) (,@symbol-name name) name)&#xA;                        subr-backup-obarray)))))&#xA;  &quot;Return the backup of the built-in function (subr) originally bound to NAME.&#xA;NAME may be a string or symbol.&#xA;If a symbol that is normally bound to a built-in function has become unbound&#xA;or bound to another function, the original subr binding can be restored with&#xA;  (fset 'SYMBOL (subr-backup 'SYMBOL))&#xA;or (if SYMBOL has no `defalias-fset-function' property)&#xA;  (defalias 'SYMBOL (subr-backup 'SYMBOL))&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-15T18:17:07.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20333" PostTypeId="2" ParentId="18570" CreationDate="2016-02-15T21:01:47.970" Score="13" Body="&lt;p&gt;A better way to understand what &lt;code&gt;progn&lt;/code&gt; is is by comparing it to the family: &lt;code&gt;prog1&lt;/code&gt; and &lt;code&gt;prog2&lt;/code&gt;. The &lt;code&gt;n&lt;/code&gt; or &lt;code&gt;1&lt;/code&gt; or &lt;code&gt;2&lt;/code&gt; part of the name stands for the statement from the list whose result you are interested in.  In other words, &lt;code&gt;progn&lt;/code&gt; will return the result of the last statement it contains, whereas &lt;code&gt;prog1&lt;/code&gt; will return the first, and similar for &lt;code&gt;prog2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today this functionality seems a little awkward since we learn to either expect the program to return in the last statement, or to instruct it explicitly what to return.  Thus &lt;code&gt;prog1&lt;/code&gt; and &lt;code&gt;prog2&lt;/code&gt; are very seldom used.  However, if you think about it, it makes sense, and here is how:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different programming languages use different strategies to describe their semantics.  Lisp family used to be tightly tied to denotational semantics.  Without going into much detail, this kind of semantics has particular difficulty with something we grew to know as &quot;statements&quot;, which are not &quot;expressions&quot;.  Meanings of code are typically thought in terms of function combinations, while a &quot;statement&quot; which cannot be even described as a function (since it doesn't evaluate to anything) is thus difficult to deal with.  However, since Lisp permits side-effects, sometimes a programmer would want to use an expression without using its value in a way that it doesn't affect the expression following it.  And this is where &lt;code&gt;progX&lt;/code&gt; family comes in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In C-like languages this feature is sometimes known as &lt;a href=&quot;https://en.wikipedia.org/wiki/Sequence_point&quot; rel=&quot;noreferrer&quot;&gt;sequence point&lt;/a&gt; (i.e. &lt;code&gt;;&lt;/code&gt; and &lt;code&gt;,&lt;/code&gt; for example).  &lt;code&gt;progn&lt;/code&gt; is as essential to Lisp-like languages as &lt;code&gt;;&lt;/code&gt; is to C-like languages.  It is a fundamental feature of the language one cannot easily replace.  However, unlike in C-style languages, Lisp tends to build syntactical abstractions by completely hiding the syntax of the lower level.  And this perhaps why you don't see &lt;code&gt;progn&lt;/code&gt; used all that often, yet it is one of the important building blocks, when it comes to building higher level language abstractions (s.a. macros).&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-02-15T21:01:47.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20334" PostTypeId="1" AcceptedAnswerId="20349" CreationDate="2016-02-15T21:06:59.427" Score="5" ViewCount="306" Body="&lt;p&gt;I am writing a simple syntax highlighting mode for a special file type. In the syntax, a line is only valid if it starts with a &lt;code&gt;&amp;amp;&lt;/code&gt; character, otherwise it is treated as a comment (basically it is an 'inverse' comment). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way of implementing this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am by no means a lisp expert (only ever glue bits of code together to get what I want), so looking for answers has been difficult.&lt;/p&gt;&#xA;" OwnerUserId="11125" LastEditorUserId="11125" LastEditDate="2016-02-16T13:43:21.090" LastActivityDate="2016-02-16T17:01:45.870" Title="Highlight as Comment if character is not present" Tags="|syntax-highlighting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20335" PostTypeId="2" ParentId="19581" CreationDate="2016-02-15T21:35:21.067" Score="2" Body="&lt;p&gt;This is one way of doing what you want to do; there are other solutions too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This involves installing the Skim pdf viewer, which can interact with emacs. Then if you add the following to your .emacs file, it will set up skim open upon running the view command. AucTex will suggest this command after you compile C-c C-c (in the same way it will suggest BibTeX).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq TeX-view-program-selection '((output-pdf &quot;PDF Viewer&quot;)))&#xA;(setq TeX-view-program-list&#xA;      '((&quot;PDF Viewer&quot; &quot;/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The LaTeX preview pane package for emacs may also be an option for you.&lt;/p&gt;&#xA;" OwnerUserId="7067" LastActivityDate="2016-02-15T21:35:21.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20336" PostTypeId="2" ParentId="10006" CreationDate="2016-02-15T21:58:26.373" Score="2" Body="&lt;p&gt;Better answer is in &lt;a href=&quot;http://endlessparentheses.com/using-prettify-symbols-in-clojure-and-elisp-without-breaking-indentation.html&quot; rel=&quot;nofollow&quot;&gt;http://endlessparentheses.com/using-prettify-symbols-in-clojure-and-elisp-without-breaking-indentation.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One way to fix the width, is to join two spaces together, and then stick the inequality on top of them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'endless/clojure-prettify-alist&#xA;             '(&quot;&amp;gt;=&quot; . (?\s (Br . Bl) ?\s (Bc . Bc) ?≥)))&#xA;(add-to-list 'endless/clojure-prettify-alist&#xA;             '(&quot;&amp;lt;=&quot; . (?\s (Br . Bl) ?\s (Bc . Bc) ?≤)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5213" LastActivityDate="2016-02-15T21:58:26.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20338" PostTypeId="1" AcceptedAnswerId="20340" CreationDate="2016-02-15T23:49:58.553" Score="7" ViewCount="1476" Body="&lt;p&gt;&lt;br /&gt;&#xA;So my question is like in title. I want to turn off flycheck minor mode for all files in directory.&#xA;I have specified in my .emacs file that it should be on in c++-mode, c-mode and few others, but I don't want this rule to apply to one given directory.&#xA;&lt;br /&gt; Preferably I'd like to turn it off using .dir-locals.el file.&#xA;My knowledge of lisp code is very limited and since specyfying&#xA; &lt;code&gt;(remove-hook 'c++-mode-hook 'flycheck-mode)&lt;/code&gt; hasn't done anything, I don't really know what should I do to get the effect I want.&lt;/p&gt;&#xA;" OwnerUserId="11126" LastActivityDate="2016-02-16T00:40:19.610" Title="How can I turn off flycheck minor mode for given directory" Tags="|flycheck|directory-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20339" PostTypeId="1" CreationDate="2016-02-16T00:18:09.960" Score="5" ViewCount="1656" Body="&lt;p&gt;Org mode has support for showing unicode in place of latex commands through &lt;code&gt;org-pretty-entities&lt;/code&gt;. Org mode also has support for underlining through font locks that are activated through the &lt;code&gt;_&lt;/code&gt; character. If everything fails then I can directly input unicode characters through the character viewer (on OSX). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have never been able to get emacs to render overlines or characters with bars on top, e.g. ̅B , using any of the above three methods. Is there a way to show such characters in org-mode? Can font-lock automatically render code like \bar{B} as  ̅B ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Thanks to the comment I made partial progress. By adding &lt;code&gt;(&quot;̅&quot; (:overline t))&lt;/code&gt; to &lt;code&gt;org-emphasis-alist&lt;/code&gt; &lt;code&gt;barber&lt;/code&gt; is rendered with a bar/overline when I enter &lt;kbd&gt;C-x 8 RET 0 3 0 5 RET&lt;/kbd&gt;&#xA;&lt;kbd&gt;barber&lt;/kbd&gt; &#xA;&lt;kbd&gt;C-x 8 RET 0 3 0 5 RET&lt;/kbd&gt; &#xA;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what I'd really like is to just enter, &lt;kbd&gt;\bar{barber}&lt;/kbd&gt; to toggle its overline attribute. Is this possible? &lt;/p&gt;&#xA;" OwnerUserId="6589" LastEditorUserId="6589" LastEditDate="2016-02-17T00:45:23.307" LastActivityDate="2017-04-23T16:33:46.080" Title="Easiest way to render an overline in org mode?" Tags="|org-mode|fonts|font-lock|unicode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20340" PostTypeId="2" ParentId="20338" CreationDate="2016-02-16T00:40:19.610" Score="10" Body="&lt;p&gt;Well you wouldn't want to remove the hook, as that's a global effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can disable the mode on a per-buffer basis, though. Use the &lt;code&gt;eval&lt;/code&gt; pseudo-variable. e.g. a &lt;code&gt;.dir-locals.el&lt;/code&gt; like this would act for any/all major modes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((nil . ((eval . (flycheck-mode 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Local variables are processed after mode hooks, so this should reliably counteract your existing code (n.b. I've not tested this).&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-02-16T00:40:19.610" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20341" PostTypeId="2" ParentId="18367" CreationDate="2016-02-16T01:21:49.497" Score="1" Body="&lt;p&gt;Looks like you'll need to be calling &lt;code&gt;vc-print-log-internal&lt;/code&gt; with the &lt;code&gt;IS-START-REVISION&lt;/code&gt; argument. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(vc-print-log-internal 'Git '(&quot;/var/www/CHANGELOG.txt&quot;) &quot;origin/master&quot; t 2000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could make a modified variant of &lt;code&gt;vc-print-log&lt;/code&gt; to provide a command to do this, if there's nothing which does this already? (and I'm not seeing anything myself).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-vc-print-revision-log (working-revision &amp;amp;optional limit)&#xA;  &quot;List the change log at WORKING-REVISION of the current fileset in a window.&#xA;&#xA;If LIMIT is non-nil, it should be a number specifying the maximum&#xA;number of revisions to show; the default is `vc-log-show-limit'.&#xA;&#xA;When called interactively with a prefix argument, prompts for LIMIT also.&quot;&#xA;  (interactive&#xA;   (let ((rev (read-from-minibuffer&#xA;               &quot;Working revision (default: last revision): &quot; nil nil nil nil))&#xA;         (lim (when current-prefix-arg&#xA;                (string-to-number (read-from-minibuffer&#xA;                                   &quot;Limit display (unlimited: 0): &quot;&#xA;                                   (format &quot;%s&quot; vc-log-show-limit)&#xA;                                   nil nil nil)))))&#xA;     (when (string= rev &quot;&quot;) (setq rev nil))&#xA;     (when (and lim (&amp;lt;= lim 0)) (setq lim nil))&#xA;     (list rev lim)))&#xA;  (let* ((vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef&#xA;         (backend (car vc-fileset))&#xA;         (files (cadr vc-fileset)))&#xA;    (vc-print-log-internal backend files working-revision t limit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-02-16T01:46:07.777" LastActivityDate="2016-02-16T01:46:07.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20342" PostTypeId="1" AcceptedAnswerId="20348" CreationDate="2016-02-16T01:57:30.840" Score="7" ViewCount="3582" Body="&lt;p&gt;I want to put my .spacemacs into Github, so I cloned it to a local directory. How to let Emacs use the .spacemacs in that directory instead of from the default ~/.spacemacs?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="11169" LastEditDate="2016-02-19T14:32:24.183" LastActivityDate="2016-02-19T14:32:24.183" Title="How do I specify a different folder for .spacemacs file?" Tags="|spacemacs|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20344" PostTypeId="1" CreationDate="2016-02-16T03:54:21.347" Score="6" ViewCount="399" Body="&lt;p&gt;For me, one of Emacs' most useful functions is &lt;code&gt;delete-duplicate-lines&lt;/code&gt;. I call it this way, which very helpfully leaves blank lines intact: &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-duplicate-lines-keep-blanks ()&#xA;  (interactive)&#xA;  (delete-duplicate-lines (region-beginning) (region-end) nil nil t)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I'd like to be queried. How can I direct Emacs to query me, showing me each duplicate line, and giving me the option to delete it or leave it intact?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="160" LastEditDate="2016-02-16T16:22:10.457" LastActivityDate="2016-02-19T13:57:34.397" Title="how to query-delete-duplicate-lines?" Tags="|replace|query-replace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20345" PostTypeId="2" ParentId="20342" CreationDate="2016-02-16T05:13:13.447" Score="6" Body="&lt;p&gt;You can symlink your &lt;code&gt;.spacemacs&lt;/code&gt; file. From a bash prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ln -s /path/to/your/spacemacs-directory/.spacemacs ~/.spacemacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might find it easier to symlink the entire directory to a &quot;dot directory,&quot; i.e. &lt;code&gt;~/.spacemacs.d&lt;/code&gt;, in which case you would do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ mv /path/to/your/spacemacs-directory/.spacemacs /path/to/your/spacemacs-directory/init.el&#xA;$ ln -s /path/to/your/spacemacs-directory ~/.spacemacs.d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-02-16T05:13:13.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20346" PostTypeId="1" CreationDate="2016-02-16T07:41:42.393" Score="5" ViewCount="261" Body="&lt;p&gt;In org-mode, if I set the &lt;code&gt;:file&lt;/code&gt; header-arg at some point, like all header args, it is inherited at lower levels. I want to avoid duplicating the header-arg all over. In the case of &lt;code&gt;:session&lt;/code&gt;, the special value &lt;code&gt;none&lt;/code&gt; is used to not associate the code block with any existing session, it s always a new session. I want the special value for &lt;code&gt;:file&lt;/code&gt;, which represents &lt;em&gt;do not write this to a file, but insert it directly as usual&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* set at top header level&#xA;  :PROPERTIES:&#xA;  :header-args: :R :file &quot;abcd.pdf&quot; :exports both :results output graphics&#xA;  :END:&#xA;&#xA;#+BEGIN_SRC R &#xA;x = seq( from = -2, to = 2, by = 0.1)&#xA;plot (x,x^2,col=&quot;red&quot;, type=&quot;l&quot;)&#xA;#+END_SRC&#xA;&#xA;** lower level header &#xA;# output still goes to abcd.pdf, but I don't want it to, I want it inserted&#xA;#+BEGIN_SRC R &#xA;2 + 2&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10426" LastEditorUserId="10426" LastEditDate="2016-02-18T07:38:18.527" LastActivityDate="2016-06-17T09:45:57.380" Title="unset an org-babel property?" Tags="|org-mode|org-babel|r|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20347" PostTypeId="2" ParentId="19123" CreationDate="2016-02-16T10:16:58.097" Score="2" Body="&lt;p&gt;According to the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/GTK-resources.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt; Gtk+ widgets in Emacs are: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;menus,&lt;/li&gt;&#xA;&lt;li&gt;dialogs,&lt;/li&gt;&#xA;&lt;li&gt;tool bars and&lt;/li&gt;&#xA;&lt;li&gt;scroll bars&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Buffers are rendered by Emacs itself. Neither the buffer nor the lines in a buffer are Gtk+ widgets. This means they do not know anything about the export functionality of Gtk+ widgets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best thing you can do is to use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/htmlfontify/Interactive.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;htmlfontify-buffer&lt;/code&gt;&lt;/a&gt; in order to embed the generated HTML into your SVG containing the widgets. But this will require some additional work to merge the HTML and SVG. But be aware that &lt;code&gt;htmlfontify-buffer&lt;/code&gt; has also &lt;a href=&quot;https://emacs.stackexchange.com/q/17423/2787&quot;&gt;some limitations&lt;/a&gt; and does not work with every buffer.&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-16T10:22:22.987" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20348" PostTypeId="2" ParentId="20342" CreationDate="2016-02-16T11:27:15.470" Score="5" Body="&lt;p&gt;In much the same way as Emacs loads &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; if it can't find a &lt;code&gt;~/.emacs&lt;/code&gt; file, so does Spacemacs load &lt;code&gt;~/.spacemacs.d/init.el&lt;/code&gt; if it can't find a &lt;code&gt;~/.spacemacs&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means you can create a &lt;code&gt;~/.spacemacs.d&lt;/code&gt; directory and rename the &lt;code&gt;~/.spacemacs&lt;/code&gt; file to &lt;code&gt;~/.spacemacs.d/init.el&lt;/code&gt;. Then you put the &lt;code&gt;~/.spacemacs.d&lt;/code&gt; directory on GitHub, and you're done.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have some private layers, you can also move them inside &lt;code&gt;~/.spacemacs.d/&lt;/code&gt; and manage them in the same repository.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-02-16T11:27:15.470" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20349" PostTypeId="2" ParentId="20334" CreationDate="2016-02-16T11:53:58.667" Score="4" Body="&lt;p&gt;Clearly, using a normal syntax table doesn't work in this situation. Fortunately, Emacs allows you to set the &lt;code&gt;syntax-table&lt;/code&gt; property on text in a buffer, which takes precedens over the normal syntax entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assign the variable &lt;code&gt;syntax-propertize-function&lt;/code&gt; to a custom function, it will automatically be called whenever Emacs syntax highlight or indent the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example below, newline is statically set to end a comment. The function &lt;code&gt;my-ampersand-propertize&lt;/code&gt; marks all lines not starting with an &lt;code&gt;&amp;amp;&lt;/code&gt; as comments.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-ampersand-syntax-table&#xA;  (let ((table (make-syntax-table)))&#xA;    (modify-syntax-entry ?\n &quot;&amp;gt;   &quot; table)&#xA;    table))&#xA;&#xA;(defun my-ampersand-propertize (begin end)&#xA;  (save-excursion&#xA;    (goto-char begin)&#xA;    (while (&amp;lt; (point) end)&#xA;      (unless (eolp)&#xA;        (unless (eq (following-char) ?&amp;amp;)&#xA;          (put-text-property (point) (+ (point) 1)&#xA;                             'syntax-table (string-to-syntax &quot;&amp;lt;&quot;))))&#xA;      (forward-line))))&#xA;&#xA;(define-derived-mode my-ampersand-mode prog-mode &quot;Ampersand&quot;&#xA;  &quot;Major mode for ampersand.&quot;&#xA;  :syntax-table my-ampersand-syntax-table&#xA;  (set (make-local-variable 'syntax-propertize-function)&#xA;       'my-ampersand-propertize)&#xA;  (setq font-lock-defaults '(nil nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2016-02-16T14:44:57.503" LastActivityDate="2016-02-16T14:44:57.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20350" PostTypeId="1" AcceptedAnswerId="20352" CreationDate="2016-02-16T12:55:48.423" Score="4" ViewCount="581" Body="&lt;p&gt;I have definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my/python-checker-alist&#xA;  '((pylint . (my/python-pylint-command my/python-pylint-args))&#xA;    (pep8 . (my/python-pep8-command my/python-pep8-args))&#xA;    (pyflakes . (my/python-pyflakes-command my/python-pyflakes-args)))&#xA;  &quot;Known Python source code checkers.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Default checker defined in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom my/python-default-checker 'pyflakes&#xA;  &quot;Default Python source code checker. See `my/python-checker-alist' for full alist.&quot;&#xA;  :group 'my/python&#xA;  :type 'symbol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to restrict user choice in &lt;kbd&gt;M-x customize-group&lt;/kbd&gt; to only symbols from list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(pyflakes pylint pep8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;(1)&lt;/em&gt;&lt;/strong&gt; How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;(2)&lt;/em&gt;&lt;/strong&gt; What if I want to access alway up to date values? Can I specify function reference of lambda, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda () (mapcar 'car my/python-checker-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastActivityDate="2016-02-16T19:14:13.683" Title="defcustom values for selecting from function call?" Tags="|defcustom|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20352" PostTypeId="2" ParentId="20350" CreationDate="2016-02-16T14:08:35.980" Score="8" Body="&lt;h2&gt;Standard Info workflow&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here's how to get the info that you need: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;lt;f1&amp;gt; i&lt;/code&gt; to start Info.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;g (elisp) RET&lt;/code&gt; to select the Elisp node.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;i defcustom RET&lt;/code&gt; to search the index for &lt;code&gt;defcustom&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Immediately you'll see:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;‘:type TYPE’&#xA;      Use TYPE as the data type for this option.  It specifies which&#xA;      values are legitimate, and how to display the value (*note&#xA;      Customization Types::).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;‘:set SETFUNCTION’&#xA;       Specify SETFUNCTION as the way to change the value of this option&#xA;       when using the Customize interface.  The function SETFUNCTION&#xA;       should take two arguments, a symbol (the option name) and the new&#xA;       value, and should do whatever is necessary to update the value&#xA;       properly for this option (which may not mean simply setting the&#xA;       option as a Lisp variable); preferably, though, it should not&#xA;       modify its value argument destructively.  The default for&#xA;       SETFUNCTION is ‘set-default’.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; If you specify this keyword, the variable’s documentation string&#xA; should describe how to do the same job in hand-written Lisp code.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h2&gt;My shortcut for the above.&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;counsel-info-lookup-symbol&lt;/code&gt; &lt;code&gt;defcustom&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&#xA;will bring you to the same info page.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Sample code for :type&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defcustom avy-keys-alist nil&#xA;  &quot;Alist of avy-jump commands to `avy-keys' overriding the default `avy-keys'.&quot;&#xA;  :type '(alist&#xA;          :key-type (choice :tag &quot;Command&quot;&#xA;                     (const avy-goto-char)&#xA;                     (const avy-goto-char-2)&#xA;                     (const avy-isearch)&#xA;                     (const avy-goto-line)&#xA;                     (const avy-goto-subword-0)&#xA;                     (const avy-goto-subword-1)&#xA;                     (const avy-goto-word-0)&#xA;                     (const avy-goto-word-1)&#xA;                     (const avy-copy-line)&#xA;                     (const avy-copy-region)&#xA;                     (const avy-move-line))&#xA;          :value-type (repeat :tag &quot;Keys&quot; character)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Sample code for :set&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defcustom ediff-diff-options&#xA;  (if (memq system-type '(ms-dos windows-nt)) &quot;--binary&quot; &quot;&quot;)&#xA;  &quot;Options to pass to `ediff-diff-program'.&#xA;If Unix diff is used as `ediff-diff-program',&#xA;then a useful option is `-w', to ignore space.&#xA;Options `-c', `-u', and `-i' are not allowed. Case sensitivity can be&#xA;toggled interactively using \\[ediff-toggle-ignore-case].&#xA;Do not remove the default options. If you need to change this variable, add new&#xA;options after the default ones.&#xA;This variable is not for customizing the look of the differences produced by&#xA;the command \\[ediff-show-diff-output]. Use the variable&#xA;`ediff-custom-diff-options' for that.&quot;&#xA;  :set 'ediff-set-diff-options&#xA;  :type 'string&#xA;  :group 'ediff-diff)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-02-16T14:08:35.980" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20353" PostTypeId="2" ParentId="14853" CreationDate="2016-02-16T16:02:15.283" Score="3" Body="&lt;p&gt;You can use / t to limit the article in a *Summary* to a number of days:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;/ t runs the command gnus-summary-limit-to-age, which is an&#xA;  interactive compiled Lisp function in `gnus-sum.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to / t,    .&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(gnus-summary-limit-to-age AGE &amp;amp;optional YOUNGER-P)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Limit the summary buffer to articles that are older than (or equal)&#xA;  AGE days. If YOUNGER-P (the prefix) is non-nil, limit the summary&#xA;  buffer to articles that are younger than AGE days.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You are prompted: &quot;Limit to articles older than (in days, younger when negative): &quot; when using / t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you should be able to limit the articles shown to the ones older than 30*n days, and then mark those as read?&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-02-16T16:02:15.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20354" PostTypeId="1" AcceptedAnswerId="20355" CreationDate="2016-02-16T16:02:35.203" Score="1" ViewCount="258" Body="&lt;p&gt;(Emacs 24.3.1 i386-mingw-nt6.1.7601 of 2013-03-17 on MARVIN)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs dired of &lt;code&gt;C:Windows/System32/config&lt;/code&gt; displays only the directories: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;'..'&lt;/li&gt;&#xA;&lt;li&gt;'systemprofile'&lt;/li&gt;&#xA;&lt;li&gt;'.'&lt;/li&gt;&#xA;&lt;li&gt;'TxR'&lt;/li&gt;&#xA;&lt;li&gt;'RegBack'&lt;/li&gt;&#xA;&lt;li&gt;'Journal' &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;in the directory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows Explorer displays 33 other files, mostly &quot;.LOG&quot;, &quot;.LOG1&quot; or &quot;.LOG2&quot; files, but also &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;SOFTWARE&lt;/li&gt;&#xA;&lt;li&gt;DEFAULT&lt;/li&gt;&#xA;&lt;li&gt;SYSTEM&lt;/li&gt;&#xA;&lt;li&gt;SAM&lt;/li&gt;&#xA;&lt;li&gt;BCD-Template&lt;/li&gt;&#xA;&lt;li&gt;COMPONENTS{[hash]}&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My original suspicion was that the content of that directory is accurately displayed by dired (i.e. the files are not really there) but a cygwin ls -al shows the files that dired does not display. Is this one of Windows7 misdirections or is my Emacs config wrong or ...?&lt;/p&gt;&#xA;" OwnerUserId="9131" LastEditorUserId="296" LastEditDate="2016-02-16T16:30:23.183" LastActivityDate="2016-02-16T16:30:23.183" Title="Why does emacs dired not display the same files as the Windows &quot;Explorer&quot; (e.g. Windows/System32/config)" Tags="|dired|microsoft-windows|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20355" PostTypeId="2" ParentId="20354" CreationDate="2016-02-16T16:15:19.473" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Dired-ls.html&quot; rel=&quot;nofollow&quot;&gt;From the manual:&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Dired uses an internal lisp implementation of ls by default on&#xA;  Windows. For consistent display of symbolic links and other&#xA;  information with other programs (eg Cygwin) and performance reasons,&#xA;  you may want to use a Windows port of ls instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ls-lisp-use-insert-directory-program t)      ;; use external ls&#xA;(setq insert-directory-program &quot;c:/cygwin/bin/ls&quot;) ;; ls program name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-02-16T16:15:19.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20357" PostTypeId="2" ParentId="20334" CreationDate="2016-02-16T17:01:45.870" Score="1" Body="&lt;p&gt;Here's an alternative &quot;quick-fix&quot; solution using the built-in &lt;code&gt;hi-lock&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is to put special &lt;code&gt;Hi-Lock&lt;/code&gt; keywords in a comment at the top of the file (just like file-local variable comments starting with &lt;code&gt;-*-&lt;/code&gt;). But first we need to configure &lt;code&gt;hi-lock&lt;/code&gt; to automatically detect these special keywords without asking any questions.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Step 1: Minor config for &lt;code&gt;hi-lock-mode&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Add the below to your config.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'hi-lock)&#xA;;; Don't ask before highlighting any Hi-Lock: pattern found in a file&#xA;;; Below, (lambda (pattern) t) simply always returns `t' regardless of&#xA;;; what the `pattern' input is.&#xA;(setq hi-lock-file-patterns-policy (lambda (pattern) t))&#xA;(global-hi-lock-mode 1) ; Enable the detection of the Hi-Lock keywords globally&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Step 2: Put those keywords in your file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Provide the format for the regexp to match and the face to set the regexp groups to, using the &lt;code&gt;font-lock-keywords&lt;/code&gt; format. You can learn more about this format by doing &lt;code&gt;C-h v font-lock-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example that I tried out:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Hi-lock: ((&quot;\\(^[^&amp;amp;\n].*$\\)&quot; (0 '(:inherit font-lock-comment-face) prepend)))&#xA;# Hi-Lock: end&#xA;&#xA;this is a comment&#xA;&amp;amp; this is not a comment&#xA;&#xA;&amp;amp; this is not a comment even if there's a blank line above this line&#xA;&#xA;# this is a comment&#xA;&#xA;&amp;amp; not a comment&#xA;  &amp;amp; this is a comment too as the line is preceded with spaces&#xA;&#xA;! blah&#xA;% blah&#xA;12312312&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Outcome&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is how the comment face is rendered (font face is based on the theme you use):&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://i.stack.imgur.com/AvxSD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AvxSD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;h2&gt;Addendum&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is a gist of the &lt;code&gt;font-lock-keywords&lt;/code&gt; format from my personal &lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/e48e7ada2dc2a62b78fa3ec5423baabc9077ec9b/setup-files/setup-highlight.el#L157&quot; rel=&quot;nofollow noreferrer&quot;&gt;notes&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; The Hi-Lock regexp forms are in the form of font lock keywords. Do&#xA;;; `C-h v font-lock-keywords' to learn more.&#xA;&#xA;;; Hi-Lock: ((&quot;&amp;lt;REGEXP&amp;gt;&quot; (&amp;lt;SUBEXP-0&amp;gt; '&amp;lt;FACE-0&amp;gt; [&amp;lt;OVERRIDE&amp;gt; [&amp;lt;LAXMATCH&amp;gt;]])&#xA;;;                       (&amp;lt;SUBEXP-1&amp;gt; '&amp;lt;FACE-1&amp;gt; [&amp;lt;OVERRIDE&amp;gt; [&amp;lt;LAXMATCH&amp;gt;]])&#xA;;;                       .. ))&#xA;;; Hi-Lock: end&#xA;&#xA;;; OVERRIDE and LAXMATCH are flags.&#xA;;; If OVERRIDE is t, existing fontification can be overwritten.&#xA;;;   If `keep', only parts not already fontified are highlighted.&#xA;;;   If `prepend', existing fontification is merged with the new, in&#xA;;;     which the new fontification takes precedence.&#xA;;;   If `append', existing fontification is merged with the new, in&#xA;;;     which the existing fontification takes precedence.&#xA;;; If LAXMATCH is non-nil, that means don't signal an error if there is&#xA;;; no match for SUBEXP in REGEXP.&#xA;&#xA;;; Examples of Hi-Lock patterns:&#xA;&#xA;;; Highlight outshine headers in `shell-script-mode':&#xA;;; # Hi-lock: ((&quot;\\(^\\s&amp;lt; *\\**\\)\\(\\* *.*\\)&quot; (1 'org-hide prepend) (2 '(:inherit org-level-1 :height 1.3 :weight bold :overline t :underline t) prepend)))&#xA;&#xA;;; Highlight outshine headers in `emacs-lisp-mode':&#xA;;; ;; Hi-lock: ((&quot;\\(^;\\{3,\\}\\)\\( *.*\\)&quot; (1 'org-hide prepend) (2 '(:inherit org-level-1 :height 1.3 :weight bold :overline t :underline t) prepend)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As bonus, you can also set the &lt;code&gt;hi-lock-file-patterns&lt;/code&gt; variable directly using &lt;code&gt;.dir-locals.el&lt;/code&gt; files if you do not want to put the keywords in the file itself. But for that to work, you would need to put this in your emacs config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(put 'hi-lock-file-patterns 'safe-local-variable 'identity)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-02-16T17:01:45.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20358" PostTypeId="1" CreationDate="2016-02-16T18:06:30.313" Score="2" ViewCount="288" Body="&lt;p&gt;First off, you can find my entire current config at &lt;a href=&quot;https://gitlab.com/mordocai/emacs.d/tree/4cfdfd76368aa687a6277a22161b40624e32b8fe&quot; rel=&quot;nofollow&quot;&gt;https://gitlab.com/mordocai/emacs.d/tree/4cfdfd76368aa687a6277a22161b40624e32b8fe&lt;/a&gt;, just in case I miss including something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have my emacs browser config setup like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt; w&quot;) 'browse-url-at-point)&#xA;(setq w3m-coding-system 'utf-8&#xA;  w3m-file-coding-system 'utf-8&#xA;  w3m-file-name-coding-system 'utf-8&#xA;  w3m-input-coding-system 'utf-8&#xA;  w3m-output-coding-system 'utf-8&#xA;  w3m-terminal-coding-system 'utf-8&#xA;  w3m-use-cookies t)&#xA;&#xA;(defun browse-url-at-point-firefox ()&#xA;  (interactive)&#xA;  (let ((browse-url-browser-function 'browse-url-firefox))&#xA;    (browse-url-at-point)))&#xA;&#xA;(defun browse-url-at-point-default ()&#xA;  (interactive)&#xA;  (let ((browse-url-browser-function 'browse-url-default-browser))&#xA;    (browse-url-at-point)))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt; f&quot;) 'browse-url-at-point-firefox)&#xA;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt; d&quot;) 'browse-url-at-point-default)&#xA;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt; g&quot;)&#xA;                (icurry 'browse-url-default-browser &quot;http://www.google.com&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this only works if the link is &quot;written out&quot; like &lt;a href=&quot;http://www.duckduckgo.com&quot; rel=&quot;nofollow&quot;&gt;http://www.duckduckgo.com&lt;/a&gt;. If the current mode handles links natively (like org mode, gnus article's html view, or elfeed's html rendering) then the display text will be used as the link instead. Something like &lt;a href=&quot;http://www.google.com&quot; rel=&quot;nofollow&quot; title=&quot;Google&quot;&gt;Google&lt;/a&gt; will try to go to &lt;a href=&quot;http://Google&quot; rel=&quot;nofollow&quot;&gt;http://Google&lt;/a&gt; instead of &lt;a href=&quot;http://www.google.com&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to write a function(s) that will allow me to bind it to a key and will actually go to one of the above type of links properly? If so, is it possible to detect which situation is at point and intelligently go to the link? I think I could write this, but I'm not sure how to get the actual link text in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is a package that can do all of this, all the better!&lt;/p&gt;&#xA;" OwnerUserId="2535" LastActivityDate="2016-02-16T18:06:30.313" Title="How to write a function to open real hyperlinks (Org Mode, Gnus Article, elfeed hyperlinks) in a specific browser?" Tags="|org-mode|gnus|web-browser|elfeed|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20359" PostTypeId="1" CreationDate="2016-02-16T18:09:12.723" Score="0" ViewCount="181" Body="&lt;p&gt;I managed to make emacs dispaly any emoji in GUI Emacs for OS X thanks to the answer and comments &lt;a href=&quot;https://emacs.stackexchange.com/questions/20186/a-build-of-gui-emacs-for-os-x-that-can-display-emoji&quot;&gt;here&lt;/a&gt;, but then I noticed I have other symbols that I can't display in Emacs like the because symbol &quot;∵&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set Emacs so that it can display any Unicode symbol?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to set it so that it can display the because symbol in a new frame first by adding the snippet below to my init file, and it worked, but do I have to add a font-family for a specific symbol I found is not being displayed in Emacs one by one every time? I'm not even sure the new font family I just added, Arial Unicode MS, can display the rest of the unicode characters that emacs can't display by default.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-make-frame-functions 'my-set-font)&#xA;(defun my-set-font (frame)&#xA;  (interactive)&#xA;&#xA;  (set-fontset-font t 'symbol (font-spec :family &quot;Apple Color Emoji&quot;) frame 'prepend)&#xA;  (set-fontset-font t 'symbol (font-spec :family &quot;Arial Unicode MS&quot;) frame 'prepend)&#xA;&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-16T19:18:16.097" Title="How can I display any Unicode character in GUI Emacs for OS X?" Tags="|osx|unicode|" AnswerCount="0" CommentCount="3" ClosedDate="2016-02-16T19:20:03.577" ContentLicense="CC BY-SA 3.0" />
  <row Id="20360" PostTypeId="2" ParentId="10114" CreationDate="2016-02-16T18:13:16.277" Score="5" Body="&lt;p&gt;Just in case anybody had already downloaded the PNG DLL and they still get the &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No images to display inline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;message,  &lt;code&gt;[[Z:\test.png]]&lt;/code&gt; collapses down, but running &lt;code&gt;org-toggle-inline-images&lt;/code&gt; does not expand it into an image. However &lt;code&gt;[[file:Z:\test.png]]&lt;/code&gt; does.  Note that the &lt;code&gt;file:&lt;/code&gt; part is important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW - I downloaded my PNG dll from &lt;a href=&quot;https://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;noreferrer&quot;&gt;https://sourceforge.net/projects/ezwinports/files/&lt;/a&gt;, but Vincent Goulet's distribution mentioned above seems like a good idea.&lt;/p&gt;&#xA;" OwnerUserId="11094" LastActivityDate="2016-02-16T18:13:16.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20361" PostTypeId="2" ParentId="20350" CreationDate="2016-02-16T18:36:03.717" Score="0" Body="&lt;p&gt;I added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PROPOSAL: Is there a way to update available choices for defcustom variable?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?archive=yes&amp;amp;bug=22703&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?archive=yes&amp;amp;bug=22703&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems that defcustom API doesn't reevaluate &lt;code&gt;:type&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As proposal I ask about accepting function (lambda) as value of &lt;code&gt;:type&lt;/code&gt;. In that case &lt;code&gt;:type&lt;/code&gt; may be evaluated when widget build on &lt;kbd&gt;M-x customize-XXX&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-02-16T19:14:13.683" LastActivityDate="2016-02-16T19:14:13.683" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20362" PostTypeId="1" AcceptedAnswerId="20385" CreationDate="2016-02-16T18:42:53.993" Score="1" ViewCount="242" Body="&lt;p&gt;I recently added a modification to my Enter keybinding based on an &lt;a href=&quot;https://stackoverflow.com/questions/22107501/set-emacs-to-smart-auto-line-after-a-parentheses-pair/22109370#22109370&quot;&gt;answer&lt;/a&gt; (if you can't see it, this is a link) on this SE. It was good and I liked it. So of course...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to add MORE dwim behavior. Specifically, while programming, if I'm typing a comment, I'd like to press the Enter key and the next line automatically also be a comment. E.g. in Ruby, if I have &lt;code&gt;# blah blah|&lt;/code&gt; where &lt;code&gt;|&lt;/code&gt; is the cursor, I want to press Enter and see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# blah blah&#xA;# |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the question - what is preferred / philosophically correct with emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Expand my &lt;code&gt;enter-key-dwim&lt;/code&gt; function to just check for more things?&lt;/li&gt;&#xA;&lt;li&gt;Do I switch to two small functions that work as a local-buffer &lt;code&gt;post-command-hook&lt;/code&gt; and only run if the last command was the Enter key? &lt;/li&gt;&#xA;&lt;li&gt;Put an advice around the Enter key behavior?&lt;/li&gt;&#xA;&lt;li&gt;Something else? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;One comment says that I generally want to avoid &lt;code&gt;post-command-hook&lt;/code&gt; because it gets run after every keystroke as well, which seems to be a vote against option 2.&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="61" LastEditDate="2016-02-17T14:58:54.997" LastActivityDate="2016-02-17T19:57:03.340" Title="emacs philosophy: add dwim behavior when pressing Enter" Tags="|hooks|customize|" AnswerCount="3" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="20364" PostTypeId="1" CreationDate="2016-02-16T19:20:48.670" Score="4" ViewCount="340" Body="&lt;p&gt;I am running into a 1024 character limit for a bash command line in emacs shell mode.  For example the command:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo xxxxxxxxxxxxx...x  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with 1018 x's (for a total line length of 1023 chars) works fine, echoing the x's. However with 1019 or more x's (for a total line length of 1024 or more chars) it just starts generating ^G characters, one per character over 1023, and not returning (must ^C^C out of it). It does not matter if some of those 1023 characters are spaces, so it is not an issue of argument length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is of course not a problem running bash outside emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to change this emacs shell limit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(version: Aquamacs 3.2 GNU Emacs 24.4.51.2)&lt;/p&gt;&#xA;" OwnerUserId="11137" LastEditorUserId="25" LastEditDate="2016-02-17T01:42:44.787" LastActivityDate="2016-02-17T01:42:44.787" Title="1024 char limit on command line in emacs shell mode on OSX" Tags="|osx|term|shell-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20365" PostTypeId="2" ParentId="20346" CreationDate="2016-02-16T19:59:33.530" Score="-1" Body="&lt;p&gt;My solution to this problem is to set up yasnippets with a few different header arguments. It works well as long as you only have a few different options and use only 1 or 2 languages.&lt;/p&gt;&#xA;" OwnerUserId="11091" LastActivityDate="2016-02-16T19:59:33.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20366" PostTypeId="1" CreationDate="2016-02-16T20:39:39.293" Score="1" ViewCount="86" Body="&lt;p&gt;I'm using emacs 24.  I work on a variety of html files,&#xA;sometimes there's blocks of html with two space indentation,&#xA;others have four space indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I press C-j , emacs assumes i want 4 space indentation. How can I quickly tell C-j what kind (2 or 4) indentation I want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(on my system C-h k gives &quot;electric-newline-and-maybe-indent&quot; for C-j)&lt;/p&gt;&#xA;" OwnerUserId="9829" LastEditorUserId="105" LastEditDate="2016-03-13T22:04:24.787" LastActivityDate="2016-03-13T22:04:24.787" Title="emacs: specify 2 or 4 space indentation for C-j electric-newline-and-maybe-indent" Tags="|indentation|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20367" PostTypeId="2" ParentId="9317" CreationDate="2016-02-16T21:53:17.313" Score="23" Body="&lt;p&gt;In the Magit buffer, hit K (uppercase k) on the file. It works with magit 2.3; I don't know for earlier versions.&lt;/p&gt;&#xA;" OwnerUserId="10787" LastActivityDate="2016-02-16T21:53:17.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20368" PostTypeId="1" AcceptedAnswerId="20375" CreationDate="2016-02-16T22:57:42.203" Score="7" ViewCount="268" Body="&lt;p&gt;In my mode line I can see if a buffer has unsaved changes (&lt;code&gt;**-&lt;/code&gt; or a red &lt;code&gt;x&lt;/code&gt; in my case, since I am using &lt;a href=&quot;https://github.com/Malabarba/smart-mode-line&quot;&gt;&lt;code&gt;smart-mode-line&lt;/code&gt;&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar way to display whether or not the file visited by the current buffer has uncommitted changes in  Git or whatever VCS you are using?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-02-17T08:26:12.200" Title="Indicate whether file has uncommited changes in mode line" Tags="|mode-line|git|vc|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20369" PostTypeId="1" CreationDate="2016-02-16T23:45:14.357" Score="7" ViewCount="66" Body="&lt;p&gt;I am editing a document with lots of URLs in it, and I would like to automatically fold them down to just the last part of the URL so that they take up less room on the line, similar to the way &lt;code&gt;hideshow&lt;/code&gt; folds up blocks of code. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;http://www.foo.bar/baz.html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;baz.html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any suggestions on how to do this, preferably in a way that is compatible with &lt;code&gt;goto-address&lt;/code&gt;. I'm also wondering if it's possible to include a &lt;code&gt;+/-&lt;/code&gt; symbol next to the URL like in &lt;code&gt;hideshowvis&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11139" LastActivityDate="2016-02-17T08:42:38.690" Title="Folding up URLs" Tags="|hideshow|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20370" PostTypeId="2" ParentId="20344" CreationDate="2016-02-16T23:46:16.627" Score="4" Body="&lt;p&gt;It seems to be too difficult to make the  original &lt;code&gt;delete-duplicate-lines&lt;/code&gt; behave in the way you want. Here's something that might do the job though:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/update-lines (bunches pos keep)&#xA;  (cl-loop with dec = (if keep 0 1)&#xA;           for line being the hash-key of bunches&#xA;           using (hash-value positions) do&#xA;           (puthash&#xA;            line&#xA;            (cl-loop for p in positions&#xA;                     if (&amp;lt; p pos) collect p&#xA;                     else if (&amp;gt; p pos) collect (- p dec))&#xA;            bunches)))&#xA;&#xA;(defun my/suggest-delete-line (line)&#xA;  (let ((len (length line)))&#xA;    (move-overlay selection (point) (+ (point) len))&#xA;    (let* ((inhibit-quit t)&#xA;           (answer &#xA;            (with-local-quit&#xA;              (read-key&#xA;               (format &quot;Delete '%s%s'? [y]es/[n]o&quot;&#xA;                       (substring line 0 (min len 13))&#xA;                       (cond&#xA;                        ((&amp;gt; len 16) &quot;...&quot;)&#xA;                        ((&amp;gt; len 13) (substring line 13 len))&#xA;                        (t &quot;&quot;)))))))&#xA;      (when (= answer ?y)&#xA;        (delete-region&#xA;         (point)&#xA;         (progn&#xA;           (move-end-of-line 1)&#xA;           (forward-char)&#xA;           (point))))&#xA;      answer)))&#xA;&#xA;(defun my/delete-duplicate-lines (beg end)&#xA;  (interactive&#xA;   (if (region-active-p)&#xA;       (list (region-beginning) (region-end))&#xA;     (list (point-min) (point-max))))&#xA;  (let ((ignore-white (&amp;lt; (prefix-numeric-value current-prefix-arg) 1))&#xA;        (ignore-blank (&amp;lt; (prefix-numeric-value current-prefix-arg) 4))&#xA;        (bunches (make-hash-table :test 'equal))&#xA;        (selection (make-overlay 1 1)))&#xA;    (overlay-put selection 'face 'secondary-selection)&#xA;    (save-excursion&#xA;      (goto-char beg)&#xA;      (move-beginning-of-line 1)&#xA;      (cl-loop for lnum = (count-lines (point-min) beg)&#xA;               then (1+ lnum)&#xA;               for line = (buffer-substring-no-properties&#xA;                           (point)&#xA;                           (progn&#xA;                             (move-end-of-line 1)&#xA;                             (point)))&#xA;               while (&amp;lt; (point) end) do&#xA;               (forward-char)&#xA;               (unless&#xA;                   (or (and (string-match &quot;[ \t]+&quot; line) ignore-white)&#xA;                       (and (string-match &quot;^$&quot; line) ignore-blank))&#xA;                 (puthash line (cons lnum (gethash line bunches)) bunches))))&#xA;    (cl-loop for line being the hash-key of bunches &#xA;             using (hash-value positions)&#xA;             unless (cdr positions) do&#xA;             (remhash line bunches))&#xA;    (cl-loop named :outer for line being the hash-key of bunches do&#xA;             (cl-loop for positions = (gethash line bunches)&#xA;                      while positions do&#xA;                      (cl-loop with continue = t&#xA;                               for pos in positions&#xA;                               while continue do&#xA;                               (goto-char (point-min))&#xA;                               (forward-line pos)&#xA;                               (recenter)&#xA;                               (cl-case (my/suggest-delete-line line)&#xA;                                 (?\C-g (cl-return-from :outer))&#xA;                                 (?y)&#xA;                                 (otherwise (setf continue nil)))&#xA;                               (my/update-lines bunches pos continue))))&#xA;    (delete-overlay selection)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which, certainly, could be improved, but at the first glance seems to do what you want.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2016-02-19T13:57:34.397" LastActivityDate="2016-02-19T13:57:34.397" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="20371" PostTypeId="1" CreationDate="2016-02-17T01:48:26.190" Score="1" ViewCount="18" Body="&lt;p&gt;I'm following the instruction &lt;a href=&quot;https://www.emacswiki.org/emacs/SetFonts&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to set the default font:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(font . &quot;Monospace 10&quot;))&#xA;(set-face-attribute 'default t :font &quot;Monospace 10&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works. To avoid the repetition, I tried factoring the string out with &lt;code&gt;let&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((f &quot;Monospace 10&quot;))&#xA;  (add-to-list 'default-frame-alist '(font . f))&#xA;  (set-face-attribute 'default t :font f))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result I get when I load this is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Invalid font: f&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why is the second expression not equivalent to the first pair of statements?&lt;/p&gt;&#xA;" OwnerUserId="11140" LastActivityDate="2016-02-17T01:48:26.190" Title="Factoring code into a let block" Tags="|let-binding|" AnswerCount="0" CommentCount="3" ClosedDate="2016-02-17T02:10:57.910" ContentLicense="CC BY-SA 3.0" />
  <row Id="20372" PostTypeId="2" ParentId="14647" CreationDate="2016-02-17T06:30:38.733" Score="3" Body="&lt;p&gt;If you don't mind evaluating the whole code on export every time, you can do this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Give the code block a session and later use inline code to call the variable, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :session calc :exports code :results none&#xA;a = 5 + 5&#xA;#+end_src&#xA;&#xA;The result of the calculation is src_python[:session calc]{a}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is another way which may not be worth the hassle for small code-blocks (depending on how complex it is in the language you are working in; R gave me problems...), but where you don't have to run the code always on export (results are persistent, but updated when you re-run the code block) using Macros that are prepared &lt;em&gt;within&lt;/em&gt; the code-block as Macro Strings. At least, calling the results is then easier in-text: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python :session calc :exports code :results values drawer&#xA;a = 5 + 5&#xA;b = a-1&#xA;ares = '#+MACRO: a '+ str(a)&#xA;bres = '#+MACRO: b '+ str(b)&#xA;ares + '\n' + bres&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;:RESULTS:&#xA;#+MACRO: a 10&#xA;#+MACRO: b 9&#xA;:END:&#xA;&#xA;The result is still {{{a}}} and b is {{{b}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11142" LastEditorUserId="11142" LastEditDate="2017-02-16T09:05:36.447" LastActivityDate="2017-02-16T09:05:36.447" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20373" PostTypeId="2" ParentId="20362" CreationDate="2016-02-17T06:35:29.297" Score="1" Body="&lt;p&gt;Behavior of several commands is customizable. The features in question often are called &quot;electric&quot;. python-mode.el would provide that comment-insert when &lt;code&gt;py-electric-comment-p&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-02-17T06:35:29.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20374" PostTypeId="2" ParentId="20369" CreationDate="2016-02-17T07:03:48.087" Score="6" Body="&lt;p&gt;The URL parsing could probably be included, so take this just as an example, but the general idea is like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/minify-urls (beg end)&#xA;  (interactive&#xA;   (if (region-active-p)&#xA;       (list (region-beginning) (region-end))&#xA;     (list (point-min) (point-max))))&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (re-search-forward &quot;&amp;lt;\\w+:\\/\\/\\(:?[^&amp;gt;\\/]+\\/\\)*\\([^&amp;gt;\\/]+\\)&amp;gt;&quot; end t)&#xA;      (message &quot;matched&quot;)&#xA;      (let* ((all (match-string 0))&#xA;             (match (match-string 1))&#xA;             (ibeg (- (point) (length all) -1))&#xA;             (iend (- (point) (length match) -3)))&#xA;        (make-text-button iend (1- (point))&#xA;                          'len (- iend ibeg)&#xA;                          'state nil&#xA;                          'action (lambda (button)&#xA;                                    (let ((state (button-get button 'state))&#xA;                                          (len (button-get button 'len))&#xA;                                          (pos (button-start button)))&#xA;                                      (add-text-properties&#xA;                                       (- pos len) pos&#xA;                                       (if state '(invisible t) '(invisible nil)))&#xA;                                      (button-put button 'state (not state)))))&#xA;        (add-text-properties ibeg iend '(invisible t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;RET&lt;/kbd&gt; on the URLs to toggle expanded/minified state. &lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2016-02-17T08:42:38.690" LastActivityDate="2016-02-17T08:42:38.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20375" PostTypeId="2" ParentId="20368" CreationDate="2016-02-17T08:26:12.200" Score="7" Body="&lt;p&gt;Well, &lt;code&gt;vc&lt;/code&gt; does that by default.  From its &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/VC-Mode-Line.html#VC-Mode-Line&quot;&gt;documentation&lt;/a&gt; (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When you visit a file that is under version control, Emacs indicates&#xA;  this on the mode line.  For example, ‘Bzr-1223’ says that Bazaar is used&#xA;  for that file, and the current revision ID is 1223.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;The character between the back-end name and the revision ID indicates&#xA;  the &quot;version control status&quot; of the work file.  In a merge-based version&#xA;  control system, a ‘-’ character indicates that the work file is&#xA;  unmodified, and ‘:’ indicates that it has been modified&lt;/strong&gt;.  ‘!’ indicates&#xA;  that the file contains conflicts as result of a recent merge operation&#xA;  (*note Merging::), or that the file was removed from the version&#xA;  control.  Finally, ‘?’ means that the file is under version control, but&#xA;  is missing from the working tree.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-02-17T08:26:12.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20376" PostTypeId="1" CreationDate="2016-02-17T08:32:33.960" Score="1" ViewCount="577" Body="&lt;p&gt;Is there a way to make Gnus store sent emails in the inbox folder?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to see &lt;strong&gt;all&lt;/strong&gt; mail, i.e., received and sent mail, in my mail threads in my inbox.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2016-03-20T19:18:39.343" Title="Gnus store sent mail in Inbox" Tags="|gnus|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20377" PostTypeId="1" AcceptedAnswerId="20378" CreationDate="2016-02-17T09:40:47.393" Score="1" ViewCount="1168" Body="&lt;p&gt;See &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg01046.html&quot; rel=&quot;nofollow&quot;&gt;https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg01046.html&lt;/a&gt; for more background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;YAML defines a comment as a &lt;code&gt;#&lt;/code&gt; either preceded by the beginning of the line or whitespace (more specifically, &lt;code&gt;TAB&lt;/code&gt; or &lt;code&gt;SPC&lt;/code&gt;).  This means that &lt;code&gt;foo#bar&lt;/code&gt; is a normal token, not &lt;code&gt;foo&lt;/code&gt; with a &lt;code&gt;#bar&lt;/code&gt; comment.  You can get most of the way there with the traditional syntax rules:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?# &quot;&amp;lt;&quot;)&#xA;(modify-syntax-entry ?\n &quot;&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this will highlight &lt;code&gt;foo#bar&lt;/code&gt; incorrectly.  I've been pointed to &lt;code&gt;syntax-propertize-function&lt;/code&gt; which allows for more powerful syntax rules, but behaves weirdly.  Depending on the specific code I write, either insertion of new characters or deletion invalidates the existing fontification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example 1 (marking &lt;code&gt;#&lt;/code&gt; preceded by non-whitespace as &lt;code&gt;_&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?# &quot;&amp;lt;&quot;)&#xA;(modify-syntax-entry ?\n &quot;&amp;gt;&quot;)&#xA;&#xA;;; invalidated by deletion&#xA;(syntax-propertize-rules&#xA;  (&quot;[^ \t]#&quot; (0 &quot;_&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example 2 (marking &lt;code&gt;#&lt;/code&gt; preceded by whitespace as &lt;code&gt;&amp;lt;&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?\n &quot;&amp;gt;&quot;)&#xA;&#xA;;; invalidated by insertion&#xA;(syntax-propertize-rules&#xA;  (&quot;^#&quot; (0 &quot;&amp;lt;&quot;)))&#xA;  (&quot;[ \t]#&quot; (0 &quot;&amp;lt;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I rewrite either of these in terms of a function scanning for appliable parts and edebug it, edebug does &lt;em&gt;not&lt;/em&gt; take me through the function for the invalidating case.  Any idea why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus - Syntax propertize functions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example 1:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yaml-mode-syntax-propertize-function (beg end)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (search-forward &quot;#&quot; end t)&#xA;      (save-excursion&#xA;        (forward-char -2) ;; move to char preceding #&#xA;        (when (looking-at &quot;[^ \t]&quot;)&#xA;          (forward-char 1) ;; move to # again&#xA;          (put-text-property (point) (1+ (point))&#xA;                             'syntax-table (string-to-syntax &quot;_&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example 2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yaml-mode-syntax-propertize-function (beg end)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (search-forward &quot;#&quot; end t)&#xA;      (save-excursion&#xA;        (forward-char -1)&#xA;        (if (bolp)&#xA;            (put-text-property (point) (1+ (point))&#xA;                               'syntax-table (string-to-syntax &quot;&amp;lt;&quot;))&#xA;          (forward-char -1)&#xA;          (when (looking-at &quot;[ \t]&quot;)&#xA;            (forward-char 1)&#xA;            (put-text-property (point) (1+ (point))&#xA;                               'syntax-table (string-to-syntax &quot;&amp;lt;&quot;))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Test file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;keyword: token#token&#xA;#comment comment&#xA;token #comment&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-02-17T10:32:05.520" Title="Highlighting YAML comments correctly" Tags="|major-mode|syntax-highlighting|syntax-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20378" PostTypeId="2" ParentId="20377" CreationDate="2016-02-17T10:32:05.520" Score="1" Body="&lt;p&gt;&lt;code&gt;yaml-mode&lt;/code&gt; adds a function to the obsolete variable &lt;code&gt;font-lock-syntactic-keywords&lt;/code&gt;. It appears as though this interferes with syntactic propertize functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggestion is to combine the two into one and only use the modern &lt;code&gt;syntax-propertize-function&lt;/code&gt; method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw. your first example works (when &lt;code&gt;font-lock-syntactic-keywords&lt;/code&gt; isn't set), but you need to check if the &lt;code&gt;#&lt;/code&gt; is at the beginning of a line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yaml-mode-syntax-propertize-function (beg end)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (search-forward &quot;#&quot; end t)&#xA;      (save-excursion&#xA;        (forward-char -1)&#xA;        (unless (bolp)&#xA;          (forward-char -1)           ;; move to char preceding #&#xA;          (when (looking-at &quot;[^ \t]&quot;)&#xA;            (forward-char 1) ;; move to # again&#xA;            (put-text-property (point) (1+ (point))&#xA;                               'syntax-table (string-to-syntax &quot;_&quot;))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, it can be made more efficient if you use something like &lt;code&gt;(memq (preceding-char) '(?\s ?\t))&lt;/code&gt;, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yaml-mode-syntax-propertize-function (beg end)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (search-forward &quot;#&quot; end t)&#xA;      (save-excursion&#xA;        (forward-char -1)&#xA;        (unless (bolp)&#xA;          (unless (memq (preceding-char) '(?\s ?\t))&#xA;            (put-text-property (point) (1+ (point))&#xA;                               'syntax-table (string-to-syntax &quot;_&quot;))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-02-17T10:32:05.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20379" PostTypeId="1" CreationDate="2016-02-17T12:54:23.350" Score="6" ViewCount="198" Body="&lt;p&gt;Sometimes I have quite long org-mode documents. I tend to insert new headings and sub-headings throughout the whole document. However sometimes I think that I already used this text and begin searching in the document. The easier way would be to just insert the heading and have org-mode show some warning when this exact text exists somewhere in the document as heading. Currently I think best would be if the color of the heading changes.&#xA;Is this possible and if yes, how can this be done?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2016-02-17T12:54:23.350" Title="Show a warning when there are duplicate headings in org-mode" Tags="|org-mode|warning|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20380" PostTypeId="2" ParentId="17823" CreationDate="2016-02-17T14:12:57.623" Score="5" Body="&lt;p&gt;I had the same problem and applied the following fix. This worked for me:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Change the address for the melpa archive to: &quot;&lt;a href=&quot;http://melpa.org/packages&quot; rel=&quot;noreferrer&quot;&gt;http://melpa.org/packages&lt;/a&gt;&quot;&lt;/li&gt;&#xA;&lt;li&gt;Delete the ~/.emacs.d/elpa/archives/melpa/archive-contents file&lt;/li&gt;&#xA;&lt;li&gt;Run package-initialize and package-refresh-contents.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have a package-refresh-contents command in my .emacs file. This ensures that the packages are always up to date but it adds about two seconds to the boot time of emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My package-related commands in .emacs look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Package system&#xA;(require 'package)&#xA;(setq package-archives '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                         (&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;)&#xA;                         (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;                         (&quot;user42&quot; . &quot;http://download.tuxfamily.org/user42/elpa/packages/&quot;)))&#xA;(package-initialize)&#xA;&#xA;(package-refresh-contents)&#xA;(setq auto-install-packages&#xA;      '(color-theme bar-cursor htmlize flycheck flycheck-haskell&#xA;                    haskell-mode sml-mode rust-mode fsharp-mode nasm-mode go-mode&#xA;                    perl-mode web-mode )) ;;ffap-perl-module markdown-mode))&#xA;(dolist (pkg auto-install-packages)&#xA;  (unless (package-installed-p pkg)&#xA;    (package-install pkg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11147" LastEditorUserId="11147" LastEditDate="2016-02-17T20:46:58.510" LastActivityDate="2016-02-17T20:46:58.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20381" PostTypeId="2" ParentId="20362" CreationDate="2016-02-17T15:31:50.380" Score="0" Body="&lt;p&gt;Well, since I already had a tool that went most of the way (my current &lt;code&gt;enter-key-dwim&lt;/code&gt;) and emacs already has a tool that did what I want, I sidestepped the philosophical question and did the pragmatic thing; I replaced &quot;newline and indenting&quot; with &quot;newline and indenting also with special behavior if inside a comment&quot; (&lt;code&gt;indent-new-comment-line&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is acceptable for me right now. I don't mind having to press &lt;code&gt;C-j&lt;/code&gt; for a non-comment-newline ... Yet.&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2016-02-17T15:31:50.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20382" PostTypeId="2" ParentId="20346" CreationDate="2016-02-17T15:42:55.150" Score="1" Body="&lt;p&gt;It looks like you can override the &lt;code&gt;PROPERTY&lt;/code&gt; default values on a&#xA;block-by-block basis:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* CONFIG&#xA;#+PROPERTY: header-args:R :session *R* :results output &#xA;&#xA;* TESTING&#xA;  #+name: data-setup-silently&#xA;  #+begin_src R :results silent&#xA;    x &amp;lt;- 1:10&#xA;  #+end_src&#xA;&#xA;  #+name: results-silently&#xA;  #+begin_src R :results silent&#xA;     print(x)&#xA;  #+end_src&#xA;&#xA;  #+name: results&#xA;  #+begin_src R &#xA;     print(x)&#xA;  #+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;code&gt;PROPERTY&lt;/code&gt; sets the default &lt;code&gt;:results&lt;/code&gt; to &lt;code&gt;output&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Block 1: set up the data, and override with &lt;code&gt;silent&lt;/code&gt; to shut up about it&lt;/li&gt;&#xA;&lt;li&gt;Block 2: print out the results, but override with &lt;code&gt;silent&lt;/code&gt; to prevent results from being added to the buffer&lt;/li&gt;&#xA;&lt;li&gt;Block 3: default behavior: print out the results to the buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-17T15:42:55.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20384" PostTypeId="2" ParentId="20344" CreationDate="2016-02-17T19:45:24.943" Score="2" Body="&lt;p&gt;The following code advices &lt;code&gt;delete-duplicate-lines&lt;/code&gt; to get what you want but retains as much of the behavior of the original version as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Note, that &lt;code&gt;delete-region&lt;/code&gt; is replaced by the corresponding subroutine in the compiled lisp file &lt;code&gt;sort.elc&lt;/code&gt;. So we need to reload the source code &lt;code&gt;sort.el.gz&lt;/code&gt; to advice &lt;code&gt;delete-region&lt;/code&gt; within &lt;code&gt;delete-duplicate-lines&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure that you have have &lt;code&gt;emacs24-el&lt;/code&gt; installed on your system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have &lt;code&gt;sort.el&lt;/code&gt; instead of &lt;code&gt;sort.el.gz&lt;/code&gt; you should adapt the &lt;code&gt;load-library&lt;/code&gt; line in the code.&#xA;You can detect where &lt;code&gt;delete-duplicate-lines&lt;/code&gt; is defined by &lt;kbd&gt;C-h f&lt;/kbd&gt; &lt;code&gt;delete-duplicate-lines&lt;/code&gt;. If it just says &lt;code&gt;compiled lisp function&lt;/code&gt; but does not give you a source file name then you have only the byte compiled file &lt;code&gt;sort.elc&lt;/code&gt;. If you wanted to try the code below you need to get the corresponding source in some way. If the help page tells you that &lt;code&gt;delete-duplicate-line&lt;/code&gt; is defined in &lt;code&gt;sort.el&lt;/code&gt;, then click the corresponding link. It may be that the link leads you to &lt;code&gt;sort.el&lt;/code&gt; or &lt;code&gt;sort.el.gz&lt;/code&gt; anyway. In this case you are good with the code below.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'cl-macs))&#xA;&#xA;(defun delete-duplicate-lines-interactive (oldfun &amp;amp;rest args)&#xA;  &quot;Make `delete-region' interactive in `delete-duplicate-lines'.&quot;&#xA;  (let ((reverse (nth 2 args))&#xA;    (adjacent (nth 3 args))&#xA;    (arg-interactive (nth 5 args)))&#xA;    (if arg-interactive&#xA;    (let ((ol (make-overlay 1 1)))&#xA;      (overlay-put ol 'face 'secondary-selection) ;; could be customizable&#xA;      (unwind-protect&#xA;          (let (continue&#xA;            (deleted-lines 0))&#xA;        (catch :quit&#xA;          (advice-add 'delete-region&#xA;                  :around&#xA;                  (lambda (delete-region-original start end)&#xA;                (if continue&#xA;                    (funcall delete-region-original start end)&#xA;                  (recenter)&#xA;                  (move-overlay ol start end)&#xA;                  (cl-case  (let (mark-active) (read-key &quot;Delete line? ([y]es, [n]ext, [!] all, [q]uit, any other key is equivalent to next):&quot;))&#xA;                    (?y&#xA;                     (funcall delete-region-original start end)&#xA;                     (setq deleted-lines (1+ deleted-lines)))&#xA;                    (?!&#xA;                     (setq continue t)&#xA;                     (funcall delete-region-original start end)&#xA;                     (setq deleted-lines (1+ deleted-lines)))&#xA;                    (?q&#xA;                     (throw :quit nil))))&#xA;                (when reverse (goto-char start)))&#xA;                  '((name . interactive)))&#xA;          (apply oldfun args))&#xA;        (message &quot;Deleted %d %sduplicate line%s%s&quot;&#xA;             deleted-lines&#xA;             (if adjacent &quot;adjacent &quot; &quot;&quot;)&#xA;             (if (= deleted-lines 1) &quot;&quot; &quot;s&quot;)&#xA;             (if reverse &quot; backward&quot; &quot;&quot;)))&#xA;        (advice-remove 'delete-region 'interactive))&#xA;      (delete-overlay ol))&#xA;      (apply oldfun args) ;; non-interactive case&#xA;      )))&#xA;&#xA;(advice-add 'delete-duplicate-lines :around &#xA;        #'delete-duplicate-lines-interactive)&#xA;&#xA;(load-library &quot;sort.el&quot;) ;; Somehow `delete-region` is replaced in &quot;sort.elc&quot;. Therefore load the source version again.&#xA;&#xA;(defun delete-duplicate-lines-keep-blanks ()&#xA;  (interactive)&#xA;  (delete-duplicate-lines (region-beginning) (region-end) nil nil t t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-02-18T22:36:08.967" LastActivityDate="2016-02-18T22:36:08.967" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20385" PostTypeId="2" ParentId="20362" CreationDate="2016-02-17T19:57:03.340" Score="4" Body="&lt;p&gt;Just make your own hook! Here's an example that does what the answer you linked does: add an extra newline if you are between brackets. You can add other hooks without changing &lt;code&gt;newline-dwim&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun newline-dwim ()&#xA;  (interactive)&#xA;  (run-hooks 'newline-hooks))&#xA;&#xA;(defun basic-newline ()&#xA;  (newline)&#xA;  (indent-for-tab-command))&#xA;&#xA;(defun extra-newline-inside-braces ()&#xA;  (when (and (eq ?\( (char-syntax (char-before)))&#xA;             (eq ?\) (char-syntax (char-after))))&#xA;    (save-excursion (basic-newline))))&#xA;&#xA;(add-hook 'newline-hooks #'basic-newline)&#xA;(add-hook 'newline-hooks #'extra-newline-inside-braces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-02-17T19:57:03.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20386" PostTypeId="1" AcceptedAnswerId="20406" CreationDate="2016-02-17T23:17:11.507" Score="2" ViewCount="174" Body="&lt;p&gt;&lt;code&gt;zsh&lt;/code&gt; has a ton of syntax. In particular, the &lt;code&gt;#&lt;/code&gt; character serves a bunch of different roles. Here are two that are problematic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://zsh.sourceforge.net/Doc/Release/Expansion.html#Globbing-Flags&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Prefix globbing flags&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(#b)(*).c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This finds all files that end in &lt;code&gt;.c&lt;/code&gt; and captures their basenames using backreferences &lt;code&gt;(#b)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;Postfix alternative glob qualifiers&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*.c(#q:u)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lists the uppercase names of all files that end in &lt;code&gt;.c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;sh[zsh]-mode&lt;/code&gt;, the the &lt;code&gt;#&lt;/code&gt;s are incorrectly detected as starting comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RVB9O.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RVB9O.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally, this wouldn't be a big deal, but unfortunately, this throws the braces out of balance (as indicated by &lt;code&gt;rainbow-parentheses&lt;/code&gt;), which messes with the indentation of the rest of the file, making certain files essentially uneditable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took a stab at the &lt;code&gt;sh-mode&lt;/code&gt; source, but it's pretty dizzying. How can I teach Emacs about this syntax, and how can I answer this sort of question myself should anything similar arise in the future?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. see the &lt;a href=&quot;https://lists.gnu.org/archive/html/bug-gnu-emacs/2014-12/msg01005.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs bug&lt;/a&gt; I filed a while back.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-02-18T13:49:24.450" Title="zsh expansion modifiers are treated as comments" Tags="|syntax-highlighting|shell-mode|zsh|sh-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20387" PostTypeId="1" AcceptedAnswerId="20422" CreationDate="2016-02-18T00:51:33.697" Score="9" ViewCount="2767" Body="&lt;p&gt;In Magit, how can I cancel a git process that is taking too long?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I did something like &lt;code&gt;git push&lt;/code&gt; from a terminal, I could press control-C to cancel. How can I do this from Magit?&lt;/p&gt;&#xA;" OwnerUserId="9461" LastActivityDate="2016-02-19T03:20:28.437" Title="Magit how to cancel running git process" Tags="|magit|git|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20388" PostTypeId="1" CreationDate="2016-02-18T01:02:13.390" Score="0" ViewCount="105" Body="&lt;p&gt;I use &lt;code&gt;AucTeX&lt;/code&gt; as my latex major mode. I have been trying to setup the minor mode &lt;code&gt;latex-pretty-symbols&lt;/code&gt; which is available from melpa. I did:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Install from package-list-packages&#xA;(require 'latex-pretty-symbols)&#xA;(add-hook 'LaTeX-mode-hook&#xA;  (lambda () (message &quot;Show that my code ran&quot;) (latex-unicode-simplified)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's supposed to happen is that font-lock should render  &lt;code&gt;\alpha = 1&lt;/code&gt; as &lt;code&gt;α = 1&lt;/code&gt; in a latex buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this doesn't happen in AucTex. Instead I have to either interactively call &lt;code&gt;latex-unicode-simplified&lt;/code&gt; or manually evaluate &lt;kbd&gt;M-:&lt;/kbd&gt;&lt;code&gt;(latex-unicode-simplified)&lt;/code&gt; from the buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to programmatically send keystrokes after a mode is loaded? Is there some other way to tell auctex to do what I want ? I have been trying to solve this for 2.5 hours now so any help is welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB 1:&lt;/strong&gt; This problem only happens when I use auctex. When I deleted auctex and &#xA;did &lt;code&gt;(add-hook 'latex-mode-hook 'latex-unicode-simplified)&lt;/code&gt; then the problem got resolved. But I can't stop using AucTex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB 2:&lt;/strong&gt; This problem is not resolved through file local variables, I tried to put a &lt;code&gt;% eval: (latex-unicode-simplified)&lt;/code&gt; but that did not work&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB 3:&lt;/strong&gt; &lt;a href=&quot;https://bitbucket.org/mortiferus/latex-pretty-symbols.el&quot; rel=&quot;nofollow&quot;&gt;The package author is using bitbucket&lt;/a&gt;, with issues disabled.&lt;/p&gt;&#xA;" OwnerUserId="6589" LastEditorUserId="6589" LastEditDate="2016-02-18T19:02:10.393" LastActivityDate="2016-02-18T19:02:10.393" Title="Function call inside mode hook has no effect but manual execution of function from buffer works" Tags="|latex|auctex|font-lock|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20389" PostTypeId="2" ParentId="20388" CreationDate="2016-02-18T01:44:51.677" Score="1" Body="&lt;p&gt;A couple of things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The sharp-quote (&lt;code&gt;#'&lt;/code&gt;) is used only before functions, not all symbols.&lt;/li&gt;&#xA;&lt;li&gt;For easy debug and addition/removal of functions to hooks, it's better to first define a function and then add that to the hook.&lt;/li&gt;&#xA;&lt;li&gt;Bare &lt;code&gt;lambda&lt;/code&gt;s should not be quoted.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'latex-pretty-symbols)&#xA;&#xA;(defun my/LaTeX-mode-stuff ()&#xA;  (message &quot;Show that my code ran&quot;)&#xA;  (latex-unicode-simplified))&#xA;(add-hook 'LaTeX-mode-hook #'my/LaTeX-mode-stuff)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-02-18T01:44:51.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20390" PostTypeId="1" AcceptedAnswerId="20393" CreationDate="2016-02-18T05:11:46.667" Score="0" ViewCount="113" Body="&lt;p&gt;Here is a simple example in which I would like to replace&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(start-process &quot;ls&quot; &quot;*temp*&quot; &quot;ls&quot; &quot;-l&quot; &quot;-a&quot; &quot;-t&quot; &quot;-r&quot;) ; this works&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq some-var ????) ; &amp;lt;-- Need to figure this part out&#xA;(start-process &quot;ls&quot; &quot;*temp*&quot; &quot;ls&quot; some-var)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I cannot figure out how to represent that &lt;code&gt;some-var&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below did not work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Attempt 1&#xA;(setq some-var &quot;-l -a -t -r&quot;)&#xA;&#xA;;; Attempt 2&#xA;(setq some-var '(&quot;-l&quot; &quot;-a&quot; &quot;-t&quot; &quot;-r&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I basically need a solution to be able to provide variable number of args (&lt;code&gt;&amp;amp;rest args&lt;/code&gt;) to a function using a variable.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="105" LastEditDate="2016-03-14T17:09:51.070" LastActivityDate="2016-03-14T17:09:51.070" Title="How can I use a var to provide multiple arguments to a function?" Tags="|arguments|apply|" AnswerCount="1" CommentCount="1" ClosedDate="2016-09-28T15:39:53.893" ContentLicense="CC BY-SA 3.0" />
  <row Id="20391" PostTypeId="1" AcceptedAnswerId="20392" CreationDate="2016-02-18T05:11:54.020" Score="2" ViewCount="195" Body="&lt;p&gt;I have &lt;code&gt;global-subword-mode&lt;/code&gt; enabled and &lt;code&gt;diminish&lt;/code&gt; installed. I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(diminish 'subword-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;init.el&lt;/code&gt;. Despite this, subword-mode keeps appearing in the mode-line when I start emacs.&lt;/p&gt;&#xA;" OwnerUserId="5196" LastActivityDate="2016-02-18T05:36:45.687" Title="Unable to diminish subword mode" Tags="|mode-line|subword-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20392" PostTypeId="2" ParentId="20391" CreationDate="2016-02-18T05:36:45.687" Score="2" Body="&lt;p&gt;Sometimes &lt;code&gt;diminish&lt;/code&gt; can be tricky. Some things work only in an &lt;code&gt;with-eval-after-load&lt;/code&gt; form, and some only work in the mode's hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, I use:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; This is because the mode is initialized after the file is loaded?&#xA;;; I'm not too sure. I took a peek at the code, and it looks pretty normal.&#xA;(with-eval-after-load 'subword&#xA;  (diminish 'subword-mode))&#xA;(global-subword-mode +1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works in &lt;code&gt;emacs -Q&lt;/code&gt;, so it should work for you without any problems.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-02-18T05:36:45.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20393" PostTypeId="2" ParentId="20390" CreationDate="2016-02-18T05:45:45.913" Score="4" Body="&lt;p&gt;You are looking for the function &lt;code&gt;apply&lt;/code&gt;. Use it as follows:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq some-var '(&quot;-l&quot; &quot;-a&quot; &quot;-t&quot; &quot;-r&quot;))&#xA;(apply #'start-process &quot;ls&quot; &quot;*temp*&quot; &quot;ls&quot; some-var)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="838" LastEditorUserId="2642" LastEditDate="2016-02-18T06:47:34.927" LastActivityDate="2016-02-18T06:47:34.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20394" PostTypeId="1" AcceptedAnswerId="20416" CreationDate="2016-02-18T06:10:06.033" Score="3" ViewCount="1913" Body="&lt;p&gt;I am trying to use emacs with a background server running and client instances.&#xA;To do so, I lauch an emacs daemon with &lt;code&gt;emacs --daemon&lt;/code&gt;. Then I open a client session with &lt;code&gt;emacsclient -c&lt;/code&gt;. Doing like that and then visiting a file in the client session works fine. However, if I try to directly open a file with &lt;code&gt;emacsclient -c file&lt;/code&gt;, there is a &quot;Server&quot; minor mode displayed in the mode line, and when I click on it and choose &quot;Help for minor mode&quot;, a frame open with that text : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;server-buffer-clients is an alias for `server-buffer-clients',&#xA;which is not defined.  Please make a bug report.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, if I close the client and open a new client, the file previously opened with &lt;code&gt;emacsclient -c file&lt;/code&gt; isn't in the list of current buffers anymore (Ctrl-x b) while they stay in it if I just open a client with &lt;code&gt;emacsclient -c&lt;/code&gt; and next visit them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why this behavior ? I am doing things wrong ? How to properly use emacs in client/server modes to have a persistent background instance with which I can interact ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS :&#xA;I am running emacs-24.5.1&#xA;I have also tried that without any customization (with no .emacs and no .emacs.d)&lt;/p&gt;&#xA;" OwnerUserId="11155" LastActivityDate="2016-02-18T20:31:53.197" Title="Using emacs in client/server mode" Tags="|emacsclient|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20395" PostTypeId="1" AcceptedAnswerId="20397" CreationDate="2016-02-18T06:20:49.817" Score="3" ViewCount="1422" Body="&lt;p&gt;I set org-mode Babel to open rhtml block with web-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'org-src-lang-modes '(&quot;rhtml&quot; . web))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I have configure company-robe for completing for Rails code in &lt;code&gt;erb&lt;/code&gt; engine.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice company-robe (before web-mode-set-up-ac-sources activate)&#xA;    &quot;Set `robe-mode' based on current language before running `company-robe'.&quot;&#xA;    (if (equal major-mode 'web-mode)&#xA;        (let ((web-mode-cur-language (web-mode-language-at-pos)))&#xA;          (if (string= web-mode-cur-language &quot;erb&quot;)&#xA;              (unless robe-mode (robe-mode))&#xA;            (if robe-mode (robe-mode -1))&#xA;            ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The upper advice work correctly in normal file &lt;code&gt;index.html.erb&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But web-mode can't recognize engine correctly in Org-mode babel block.&#xA;When I run &lt;code&gt;(web-mode-language-at-pos)&lt;/code&gt;, it shows &lt;code&gt;html&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author of web-mode suggest me to use &lt;code&gt;web-mode-set-engine&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(web-mode-set-engine &quot;erb&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here the original question I asked in web-mode issues: &lt;a href=&quot;https://github.com/fxbois/web-mode/issues/678&quot; rel=&quot;nofollow&quot;&gt;https://github.com/fxbois/web-mode/issues/678&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is the org edited src buffer's major-mode is &lt;code&gt;web-mode&lt;/code&gt;, but I want to set &lt;code&gt;web-mode-engine&lt;/code&gt; to &lt;code&gt;erb&lt;/code&gt;. The only identity in src block is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC rhtml&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I checked out Org-mode source code, found some functions relative with this.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-src-construct-edit-buffer-name (org-buffer-name lang)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-babel-expand-src-block&lt;/code&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-babel-get-src-block-info&lt;/code&gt; (it should return a list: (language body header-arguments-alist switches name indent block-head) )&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tried to run &lt;code&gt;(nth 0 (org-babel-get-src-block-info))&lt;/code&gt; in opened src buffer which is opened by &lt;code&gt;[C-c ']&lt;/code&gt;.&#xA;But only get &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2016-03-16T10:35:07.090" LastActivityDate="2016-03-16T10:35:07.090" Title="How to get Org-mode Babel src code block language value?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20396" PostTypeId="2" ParentId="20387" CreationDate="2016-02-18T07:23:48.330" Score="5" Body="&lt;p&gt;Type $ in the Magit Status buffer to open Magit's process buffer , and then kill this buffer.  Emacs will ask you whether to kill the process.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-02-18T07:23:48.330" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20397" PostTypeId="2" ParentId="20395" CreationDate="2016-02-18T07:35:50.987" Score="1" Body="&lt;p&gt;I found the solution, add an advice to get lang before &lt;code&gt;[C-c ']&lt;/code&gt; keybinding.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; let Org-mode Babel src code block auto set `web-mode-engine' for rhtml.&#xA;  (defadvice org-edit-special (before org-edit-src-code activate)&#xA;    (let ((lang (nth 0 (org-babel-get-src-block-info))))&#xA;      (if (string= lang &quot;rhtml&quot;)&#xA;          (web-mode-set-engine &quot;erb&quot;))&#xA;      ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-02-18T07:35:50.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20401" PostTypeId="1" AcceptedAnswerId="20404" CreationDate="2016-02-18T09:53:18.330" Score="4" ViewCount="145" Body="&lt;p&gt;I activated &lt;code&gt;setq-local confirm-kill-emacs (quote y-or-n-p)&lt;/code&gt; on a hook for a local mode which has a shortcut very similar to &lt;code&gt;C-x C-c&lt;/code&gt;, in order to avoid accidentally closing Emacs when trying to execute the said shortcut. That way, Emacs will ask me to confirm it and I will be able to cancel it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this has an unfortunate consequence, that is, when I click on the close button on the top of Emacs' window, it also asks the same question. This is often annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to only ask for confirmation when using the keyboard shortcut, but not the mouse click?&lt;/p&gt;&#xA;" OwnerUserId="9259" LastActivityDate="2016-02-18T12:51:29.710" Title="Confirm quit only for keyboard shortcut, not for window close via mouse" Tags="|key-bindings|quitting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20402" PostTypeId="2" ParentId="20376" CreationDate="2016-02-18T11:08:56.887" Score="0" Body="&lt;p&gt;I found a workaround by sending the email in CC to myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this in your &lt;strong&gt;.gnus&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-posting-styles&#xA;  '((&quot;.*&quot;&#xA;     (&quot;CC&quot; &quot;YOUR_EMAIL_ADDRESS&quot;)&#xA;     (address &quot;YOUR_EMAIL_ADDRESS&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Every email you send will be send directly to yourself in CC.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2016-02-18T11:08:56.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20403" PostTypeId="1" CreationDate="2016-02-18T11:40:38.510" Score="5" ViewCount="636" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I make source blocks fold automatically when I hide the contents of their entry?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like source code blocks to fold automatically whenever I hide an entry so that they're always out of the way until I specifically want to see them.  Out of the box, however, their visibility seems to be independent of their home entry's visibility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* An entry&#xA;  #+begin_src R&#xA;    x &amp;lt;- 1:10&#xA;  #+end_src&#xA;&#xA;Some descriptive text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can toggle the visibility of the source block with &lt;kbd&gt;TAB&lt;/kbd&gt; when point is on the &lt;code&gt;begin_src&lt;/code&gt; line.  However, when I hide (fold) the &lt;em&gt;entry&lt;/em&gt; and then show (unfold) it again, the source block seems to remember it's prior visibility state: if it was visible/open, it will be visible when I show/unfold the entry, and if it was invisible/closed, it will be invisible/closed when I show/unfold the entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I want to fold/hide my source blocks automatically whenever I fold/hide the entry that contains them.&lt;/em&gt;  How do I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS I'm just now learning how to use source blocks, so I may be missing an obvious solution.  Apologies if so.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-03-19T17:03:45.730" Title="Fold source blocks when hiding their entries?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20404" PostTypeId="2" ParentId="20401" CreationDate="2016-02-18T12:37:19.947" Score="5" Body="&lt;p&gt;you may define a separate command for &lt;code&gt;C-x C-c&lt;/code&gt; like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun keyboard-kill-emacs ()&#xA;  (interactive)&#xA;  (let ((confirm-kill-emacs 'yes-on-no-p)) ; temporarily enable the confirmation&#xA;    (save-buffers-kill-emacs)))&#xA;&#xA;(global-set-key (kbd &quot;C-x C-c&quot;) 'keyboard-kill-emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11161" LastEditorUserId="9995" LastEditDate="2016-02-18T12:51:29.710" LastActivityDate="2016-02-18T12:51:29.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20406" PostTypeId="2" ParentId="20386" CreationDate="2016-02-18T13:49:24.450" Score="2" Body="&lt;p&gt;You want to look at &lt;code&gt;sh-syntax-propertize-function&lt;/code&gt; where it currently uses the regexp &lt;code&gt;&quot;\\(?:[^|&amp;amp;;&amp;lt;&amp;gt;()``\\\&quot;' \t\n]\\|\\${\\)\\(#+\\)&quot;&lt;/code&gt; to match those &lt;code&gt;#&lt;/code&gt; chars which should not be considered as starting a comment.  If you remove the &lt;code&gt;(&lt;/code&gt; char in the char range (i.e. replace &lt;code&gt;()&lt;/code&gt; with just &lt;code&gt;)&lt;/code&gt;), then it should solve your particular problem.  It will also cause the code below to be improperly handled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(#hey this is just a &quot;comment&#xA; echo and this is the actual command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know enough about zsh's syntax to tell you how to ditinguish the &lt;code&gt;(#&lt;/code&gt; that start a comment from those that don't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, please post this problem (ideally with a patch) via &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-02-18T13:49:24.450" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20408" PostTypeId="1" CreationDate="2016-02-18T14:20:32.397" Score="1" ViewCount="226" Body="&lt;p&gt;I like using helm-projectile-find-other-file to switch between header and cpp files, for example.  I tried to keybind it to C-c h with the following in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c h&quot;) 'helm-projectile-find-other-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use the function directly, I get the desired results, and even a message to the effect that: &lt;code&gt;You can run the command 'helm-projectile-find-other-file' with C-c h&lt;/code&gt;, but if I actually use the keybinding, I get the error: &#xA;    helm-compile-sources: Wrong type argument: sequencep, -1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I have to specify some argument(s?) within the keybinding?  Can someone help me out.  Explanation in addition to a solution is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8576" LastActivityDate="2016-02-18T14:20:32.397" Title="How to keybind helm-projectile-other-file" Tags="|key-bindings|helm-projectile|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20409" PostTypeId="1" AcceptedAnswerId="20410" CreationDate="2016-02-18T15:48:55.723" Score="1" ViewCount="1608" Body="&lt;p&gt;I got these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; turn on semantic&#xA;(semantic-mode 1)&#xA;&#xA;;; define a function which adds semantic as backup to auto-complete&#xA;(defun my:add-semantic-to-autocomplete()&#xA;  (add-to-list 'ac-sources 'ac-sources-semantic))&#xA;&#xA;(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this video &lt;a href=&quot;https://www.youtube.com/watch?v=Ib914gNr0ys&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.But for me it does not work at all.Save me please,i lost all day fighting with it...&lt;/p&gt;&#xA;" OwnerUserId="11163" LastEditorUserId="9995" LastEditDate="2016-02-18T16:19:53.113" LastActivityDate="2017-05-19T23:18:37.287" Title="Turn on semantic mode for C/C++" Tags="|auto-complete-mode|c++|syntax|cedet|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20410" PostTypeId="2" ParentId="20409" CreationDate="2016-02-18T16:24:45.960" Score="0" Body="&lt;p&gt;You mistyped your auto-complete source symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be &lt;code&gt;'ac-source-semantic&lt;/code&gt;, not &lt;code&gt;'ac-source(S)-semantic&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-02-18T16:24:45.960" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20411" PostTypeId="1" AcceptedAnswerId="20412" CreationDate="2016-02-18T16:48:36.833" Score="1" ViewCount="1710" Body="&lt;p&gt;I'm using bbatsov's prelude and I'm trying to change default font for when I'm running a GUI emacsclient window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added the following to my &lt;code&gt;~/.emacs.d/personal/preludes&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-default-font &quot;Source Code Pro-12&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I see the font change if I just start &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I restart the &lt;code&gt;emacs --daemon&lt;/code&gt; I have in the background and ask a GUI window to be opened using &lt;code&gt;emacsclient -c&lt;/code&gt;, I don't see the default font changed to the one I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried to put that lisp code in a file in &lt;code&gt;~/.emacs.d/personal/preload/preludes.el&lt;/code&gt; but it made no difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2016-02-18T16:51:51.710" Title="Changing default font for GUI in bbatsov's prelude" Tags="|fonts|prelude|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20412" PostTypeId="2" ParentId="20411" CreationDate="2016-02-18T16:51:51.710" Score="4" Body="&lt;p&gt;I found the answer &lt;a href=&quot;https://stackoverflow.com/questions/3984730/emacs-gui-with-emacs-daemon-not-loading-fonts-correctly&quot;&gt;here&lt;/a&gt;. Instead of &lt;code&gt;set-default-font&lt;/code&gt;, I needed the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist '((font . &quot;Source Code Pro-12&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-02-18T16:51:51.710" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20413" PostTypeId="2" ParentId="20403" CreationDate="2016-02-18T16:59:19.377" Score="2" Body="&lt;p&gt;In emacs 25.1 there is &lt;code&gt;org-cycle-hook&lt;/code&gt;.&#xA;I've stolen &lt;code&gt;org-cycle-hide-drawers&lt;/code&gt; and adapted it to the case of blocks.&#xA;The resulting code below does exactly what you want in emacs 25.1.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-cycle-hide-blocks (state &amp;amp;optional exceptions)&#xA;  &quot;Re-hide all blocks after a visibility state change.&#xA;When non-nil, optional argument EXCEPTIONS is a list of strings&#xA;specifying which blocks should not be hidden.&quot;&#xA;  (when (and (derived-mode-p 'org-mode)&#xA;         (not (memq state '(overview folded contents))))&#xA;    (save-excursion&#xA;      (let* ((globalp (memq state '(contents all)))&#xA;             (beg (if globalp (point-min) (point)))&#xA;             (end (if globalp (point-max)&#xA;            (if (eq state 'children)&#xA;            (save-excursion (outline-next-heading) (point))&#xA;              (org-end-of-subtree t)))))&#xA;    (goto-char beg)&#xA;    (while (re-search-forward org-block-regexp (max end (point)) t)&#xA;      (unless (member-ignore-case (match-string 1) exceptions)&#xA;        (let ((block (org-element-at-point)))&#xA;          (when (memq (org-element-type block) '(src-block))&#xA;        (org-hide-block-toggle t)&#xA;        ;; Make sure to skip block entirely or we might flag&#xA;        ;; it another time when matching its ending line with&#xA;        ;; `org-block-regexp'.&#xA;        (goto-char (org-element-property :end block))))))))))&#xA;&#xA;(add-hook 'org-cycle-hook 'org-cycle-hide-blocks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-02-18T16:59:19.377" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20414" PostTypeId="1" CreationDate="2016-02-18T19:04:02.427" Score="1" ViewCount="78" Body="&lt;p&gt;I'm running emacs 24.4.1.  Like the title says.  When I run &#xA;&lt;code&gt;M-x package-install RET flycheck&lt;/code&gt;  I get the message &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Package 'emacs-24.3' is unavailable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="11165" LastEditorUserId="8430" LastEditDate="2016-02-18T21:17:58.910" LastActivityDate="2016-02-18T21:17:58.910" Title="Error installing &quot;Package 'emacs-24.3' is unavailable&quot;" Tags="|package|" AnswerCount="0" CommentCount="2" ClosedDate="2016-02-20T01:13:01.267" ContentLicense="CC BY-SA 3.0" />
  <row Id="20415" PostTypeId="1" CreationDate="2016-02-18T19:47:38.057" Score="1" ViewCount="1608" Body="&lt;p&gt;I'm having some trouble trying to activate irony-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So i followed the steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;My version of gcc is 5.3.0 so I installed -&gt; clang 3.7.1&lt;/li&gt;&#xA;&lt;li&gt;I installed CMake&lt;/li&gt;&#xA;&lt;li&gt;Then irony from MELPA&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After that added this configuration to my init.el:  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'c++-mode-hook 'irony-mode)&#xA;(add-hook 'c-mode-hook 'irony-mode)&#xA;(add-hook 'objc-mode-hook 'irony-mode)&#xA;&#xA;;; replace the `completion-at-point' and `complete-symbol' bindings in&#xA;;; irony-mode's buffers by irony-mode's function&#xA;(defun my-irony-mode-hook ()&#xA;  (define-key irony-mode-map [remap completion-at-point]&#xA;    'irony-completion-at-point-async)&#xA;  (define-key irony-mode-map [remap complete-symbol]&#xA;    'irony-completion-at-point-async))&#xA;(add-hook 'irony-mode-hook 'my-irony-mode-hook)&#xA;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then I was asked to install irony-server,so I did it.And....nothing!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What could be the problem?&lt;/p&gt;&#xA;" OwnerUserId="11163" LastEditorUserId="12628" LastEditDate="2016-07-14T02:20:25.813" LastActivityDate="2016-07-14T02:20:25.813" Title="Enable Irony-mode" Tags="|auto-complete-mode|c++|irony-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20416" PostTypeId="2" ParentId="20394" CreationDate="2016-02-18T20:31:53.197" Score="4" Body="&lt;p&gt;I suspect that you really want to run emacsclient -n -c file instead. Then emacsclient will quit as soon as emacs has opened the file, and the buffer will remain until you kill it explicitly.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-02-18T20:31:53.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20417" PostTypeId="1" AcceptedAnswerId="24234" CreationDate="2016-02-18T22:26:50.687" Score="8" ViewCount="855" Body="&lt;p&gt;Github has a convenient way to show some lines as highlighted in the code, &lt;a href=&quot;https://github.com/arthurnn/minitest-emacs/blob/ffc1b7e3c65e0b9907d54c332499bc172dcfd526/minitest.el#L79-L80&quot; rel=&quot;noreferrer&quot;&gt;like so&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know if there's a way to setup something similar with org-mode code blocks when exporting (in my use case, to HTML), so I can show a longer code block for context yet point the reader quickly towards the lines that were added or modified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't found anything obvious in the documentation. I don't know where I would start the research to implement this myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be done? Has it already been implemented? If not, can I implement this myself? Where would I start? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found that org-mode exports to HTML and provides a &lt;code&gt;.code-highlighted&lt;/code&gt; class, but that seems to be only for the &lt;code&gt;(ref:xx)&lt;/code&gt; tools: hover over a reference, the corresponding code gets highlighted.&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="61" LastEditDate="2016-02-19T01:30:28.503" LastActivityDate="2016-06-28T05:31:12.653" Title="org-mode : highlight lines in src blocks when exported" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20419" PostTypeId="1" AcceptedAnswerId="20423" CreationDate="2016-02-18T23:54:16.633" Score="3" ViewCount="130" Body="&lt;p&gt;I would like to drag and drop an image file into an emacs buffer and make the filename appear instead of the image. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="8844" LastEditorUserId="105" LastEditDate="2016-02-19T02:46:10.310" LastActivityDate="2016-02-19T08:48:47.407" Title="How do I show the filename instead of the file I drag into an Emacs buffer?" Tags="|drag-and-drop|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20420" PostTypeId="2" ParentId="10125" CreationDate="2016-02-19T00:28:56.410" Score="24" Body="&lt;p&gt;I ran into a similar issue with emacs, so I made &lt;a href=&quot;https://github.com/jacktasia/dumb-jump&quot; rel=&quot;noreferrer&quot;&gt;Dumb Jump&lt;/a&gt;. I tried many of the solutions mentioned in the accepted answer, but I always ran into one or more of the following issues:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Solution only worked for a single programming language&lt;/li&gt;&#xA;&lt;li&gt;Solution required an index (TAG) file or persistent process&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I badly wanted a solution that &quot;just worked&quot; and didn't require customization or setup. That is, I wanted to clone a random repo on Github and navigate around it like any other of my own projects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now &lt;a href=&quot;https://github.com/jacktasia/dumb-jump&quot; rel=&quot;noreferrer&quot;&gt;Dumb Jump&lt;/a&gt; has basic support for: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;JavaScript&lt;/li&gt;&#xA;&lt;li&gt;Emacs Lisp&lt;/li&gt;&#xA;&lt;li&gt;Python&lt;/li&gt;&#xA;&lt;li&gt;Go&lt;/li&gt;&#xA;&lt;li&gt;PHP&lt;/li&gt;&#xA;&lt;li&gt;Ruby&lt;/li&gt;&#xA;&lt;li&gt;Faust&lt;/li&gt;&#xA;&lt;li&gt;R&lt;/li&gt;&#xA;&lt;li&gt;Lua&lt;/li&gt;&#xA;&lt;li&gt;Rust&lt;/li&gt;&#xA;&lt;li&gt;...and more&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It's &lt;a href=&quot;http://melpa.org/#/dumb-jump&quot; rel=&quot;noreferrer&quot;&gt;available via MELPA&lt;/a&gt; and GitHub issues and PRs are more than welcome.&lt;/p&gt;&#xA;" OwnerUserId="2738" LastEditorUserId="2738" LastEditDate="2016-07-08T19:45:51.767" LastActivityDate="2016-07-08T19:45:51.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20421" PostTypeId="1" CreationDate="2016-02-19T00:49:37.017" Score="0" ViewCount="80" Body="&lt;p&gt;It seems that org-timer (org-clock) slows down Emacs when I display it in the mode line. Is there a way for it to not affect the speed while I keep it running and visible in the mode line? e.g. by changing the update speed? Currently I can see it count every second in the mode line. Or is there an lighter alternative?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-02-19T12:14:08.353" Title="Org-timer slows down Emacs?" Tags="|org-clock|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20422" PostTypeId="2" ParentId="20387" CreationDate="2016-02-19T03:20:28.437" Score="9" Body="&lt;p&gt;You can use &lt;code&gt;M-x magit-process-kill&lt;/code&gt; in the Magit process buffer (&lt;code&gt;$&lt;/code&gt;, or &lt;code&gt;M-x magit-process-buffer&lt;/code&gt; jumps to process buffer for the current repository).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;magit-process-kill is an interactive Lisp closure in `magit-process.el'.&#xA;&#xA;(magit-process-kill)&#xA;&#xA;Kill the process at point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-02-19T03:20:28.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20423" PostTypeId="2" ParentId="20419" CreationDate="2016-02-19T08:48:47.407" Score="5" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq dnd-protocol-alist '((&quot;^file:&quot; . dnd-insert-filename)))&#xA;&#xA;(defun dnd-insert-filename (uri _action)&#xA;  (insert (dnd-get-local-file-name uri)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I learnt the &lt;code&gt;dnd-protocol-alist&lt;/code&gt; user option from Elisp manual: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Drag-and-Drop.html&quot; rel=&quot;noreferrer&quot;&gt;(elisp) Drag and Drop&lt;/a&gt; and read its docstring to know how to customize its value.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-02-19T08:48:47.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20424" PostTypeId="2" ParentId="20421" CreationDate="2016-02-19T08:49:05.843" Score="1" Body="&lt;p&gt;This does not seem to be configurable.  In &lt;code&gt;org-timer.el&lt;/code&gt; the function &lt;code&gt;org-timer-set-mode-line&lt;/code&gt; ends with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when org-timer-display&#xA;  (setq org-timer-mode-line-timer&#xA;    (run-with-timer 1 1 'org-timer-update-mode-line))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In you really want to change that, you could edit this file to change both 1 to eg 10 if you want the display to be updated only every 10 seconds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beware this change will be overriden next time you update your emacs installation, though.  Alternatively, you could copy the function in another file, make the modification there and ensure this is loaded after &lt;code&gt;org-timer.el&lt;/code&gt;, so that your modified version overrides the original one.  Beware any other changes in future versions of the function will be overriden by your modified version, though. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As suggested by @phils, a better way would be to define an &lt;em&gt;after &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html#Advising-Functions&quot; rel=&quot;nofollow&quot;&gt;advice&lt;/a&gt;&lt;/em&gt; to the function, cancelling the timer and restarting it with the chosen values:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/change-org-timer (&amp;amp;optional restart no-insert-p)&#xA;  (when org-timer-display&#xA;    (cancel-timer org-timer-mode-line-timer)&#xA;    (setq org-timer-mode-line-timer&#xA;      (run-with-timer 3 3 'org-timer-update-mode-line))))&#xA;&#xA;(advice-add 'org-timer-set-mode-line :after #'my/change-org-timer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-02-19T12:14:08.353" LastActivityDate="2016-02-19T12:14:08.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20425" PostTypeId="2" ParentId="10722" CreationDate="2016-02-19T12:43:46.470" Score="1" Body="&lt;p&gt;&#xA;You can also set an OS X-wide default path by for example saving a property list like this as &lt;code&gt;~/Library/LaunchAgents/my.startup.plist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&#xA;&amp;lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&amp;gt;&#xA;&amp;lt;plist version=&quot;1.0&quot;&amp;gt;&#xA;&amp;lt;dict&amp;gt;&#xA;  &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;&#xA;  &amp;lt;string&amp;gt;my.startup&amp;lt;/string&amp;gt;&#xA;  &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;&#xA;  &amp;lt;array&amp;gt;&#xA;    &amp;lt;string&amp;gt;sh&amp;lt;/string&amp;gt;&#xA;    &amp;lt;string&amp;gt;-c&amp;lt;/string&amp;gt;&#xA;    &amp;lt;string&amp;gt;launchctl setenv PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin&amp;lt;/string&amp;gt;&#xA;  &amp;lt;/array&amp;gt;&#xA;  &amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;&#xA;  &amp;lt;true/&amp;gt;&#xA;&amp;lt;/dict&amp;gt;&#xA;&amp;lt;/plist&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The new path should be shown in shells, Emacs, and other applications after you log out and back in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method does not change the path in applications that are opened as login items or when applications are reopened at login after a forced shutdown. If you have Emacs, a terminal application, or other applications where you want to change the path in login items, you'll have to remove them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 10.9 and earlier you can also add a line like this to &lt;code&gt;/etc/launchd.conf&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;setenv PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However support for &lt;code&gt;/etc/launchd.conf&lt;/code&gt; was removed in 10.10.&lt;/p&gt;&#xA;" OwnerUserId="11170" LastActivityDate="2016-02-19T12:43:46.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20426" PostTypeId="2" ParentId="10900" CreationDate="2016-02-19T12:55:33.903" Score="4" Body="&lt;p&gt;&#xA;As Stefan said, the graphical Emacs applications should do that by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a text terminal, another option is to use functions like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;(defun pbcopy ()&#xA;  (interactive)&#xA;  (let ((deactivate-mark t))&#xA;    (call-process-region (point) (mark) &quot;pbcopy&quot;)))&#xA;&#xA;(defun pbpaste ()&#xA;  (interactive)&#xA;  (call-process-region (point) (if mark-active (mark) (point)) &quot;pbpaste&quot; t t))&#xA;&#xA;(defun pbcut ()&#xA;  (interactive)&#xA;  (pbcopy)&#xA;  (delete-region (region-beginning) (region-end)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11170" LastActivityDate="2016-02-19T12:55:33.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20427" PostTypeId="2" ParentId="10822" CreationDate="2016-02-19T14:00:45.750" Score="4" Body="&#xA;&#xA;&lt;p&gt;Terminal.app and iTerm 2 set &lt;code&gt;LANG&lt;/code&gt; based on the region selected in System Preferences (&lt;code&gt;defaults read -g AppleLocale&lt;/code&gt;) by default unless the &quot;Set locale environment variables on startup&quot; setting is unchecked in Terminal or the &quot;Set locale variables automatically&quot; setting is unchecked in iTerm 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This changes &lt;code&gt;LANG&lt;/code&gt; in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;(setenv &quot;LANG&quot; &quot;en_US.UTF-8&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also add&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;export LANG=en_US.UTF-8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to a shell configuration file, but that alone won't for example affect &lt;code&gt;shell-command&lt;/code&gt; or &lt;code&gt;shell-command-on-region&lt;/code&gt; or shell scripts you run from Emacs.&lt;/p&gt;&#xA;" OwnerUserId="11170" LastActivityDate="2016-02-19T14:00:45.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20428" PostTypeId="1" AcceptedAnswerId="20430" CreationDate="2016-02-19T14:33:26.053" Score="3" ViewCount="63" Body="&lt;p&gt;I have a problem with AUCTeX loading the correct hooks with a Beamer file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my file contains line breaks in the &lt;code&gt;documentclass&lt;/code&gt; line, the style hooks are not loaded. (Thus I have no &lt;code&gt;frame&lt;/code&gt;s in my AUCTeX environments, and other commands are also unavailable.) For instance:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass[14pt,&#xA;  handout, % no transitions&#xA;  xcolor=svgnames]&#xA;  {beamer}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if there are indeed &lt;strong&gt;no&lt;/strong&gt; breaks, the style hooks are correctly loaded. For instance:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass[handout,xcolor=svgnames]{beamer}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that both ways are correct in LaTeX, but the first one enhances readability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to fix this?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2016-02-19T20:52:00.540" LastActivityDate="2016-02-19T20:52:00.540" Title="AUCTeX parsing question" Tags="|auctex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20429" PostTypeId="1" AcceptedAnswerId="20447" CreationDate="2016-02-19T15:15:43.937" Score="4" ViewCount="678" Body="&lt;p&gt;I like electric pairing for things like...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;someJavascript(function() {  });&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where it automatically pairs { with {) etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it infuriates me when I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;someFunction();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to turn that into &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wrapped(someFunction());&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It comes out as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wrapped()someFunction();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so I have to break my rhythm and delete the &lt;code&gt;)&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="10654" LastEditorUserId="10654" LastEditDate="2016-02-20T14:10:53.573" LastActivityDate="2018-07-04T20:04:22.467" Title="Smarter Electric Pair" Tags="|electric-pair-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20430" PostTypeId="2" ParentId="20428" CreationDate="2016-02-19T15:29:24.087" Score="3" Body="&lt;p&gt;The regexp matching &lt;code&gt;\documentclass&lt;/code&gt; commands is contained in &lt;code&gt;LaTeX-auto-minimal-regexp-list&lt;/code&gt;.  It does accept breaks withing optional arguments, but it expects the closing square bracket be followed by the opening curly bracket.  You can either write&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass[14pt,&#xA;  handout, % no transitions&#xA;  xcolor=svgnames&#xA;  ]{beamer}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your document or change the regexp in order to accept a newline after the closing square bracket.  I think the former is easier to do.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-02-19T15:29:24.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20431" PostTypeId="2" ParentId="14289" CreationDate="2016-02-19T16:27:19.503" Score="1" Body="&lt;p&gt;In elisp:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;defines URL + destination domain settings &lt;/li&gt;&#xA;&lt;li&gt;run the &lt;code&gt;&amp;lt;select file&amp;gt;&lt;/code&gt; emacs process&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;exec&lt;/code&gt; the file upload using &lt;code&gt;cadaver/lftp/netrc/...&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;grab/build the destination file-link (may need to use the ownCloud Share API)&lt;/li&gt;&#xA;&lt;li&gt;paste URL at emacs under cursor&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Or alternatively start with a simple alias which, for a given file (or directory) uploads it and returns the public destination URL (cf ownCloud share API to grab a unique link).&#xA;Then just call this wrapper from elisp.&lt;/p&gt;&#xA;" OwnerUserId="11171" LastActivityDate="2016-02-19T16:27:19.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20432" PostTypeId="1" AcceptedAnswerId="20433" CreationDate="2016-02-19T16:46:22.843" Score="4" ViewCount="700" Body="&lt;p&gt;The following elisp code inserts &lt;code&gt;hello world!&lt;/code&gt; 10 times:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- lexical-binding: t -*-&#xA;(dotimes (i 10) (insert &quot;hello world!\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I byte-compile that code, I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hellos.el:2:1:Warning: Unused lexical variable `i'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is strange ... &lt;code&gt;i&lt;/code&gt; is used to count from 0 to 9, even if it is not used in the repeated code. How am I supposed to loop 10 times ?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even stranger, the warning message disappears if I set&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- lexical-binding: nil -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Go figure ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug (admittedly minor) in the emacs compiler? Is there a way to loop 10 times without using a counting variable?&lt;/p&gt;&#xA;" OwnerUserId="1992" LastActivityDate="2016-02-19T17:04:14.720" Title="Strange elisp byte-compiler warning about unused variables" Tags="|byte-compilation|warning|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20433" PostTypeId="2" ParentId="20432" CreationDate="2016-02-19T17:04:14.720" Score="11" Body="&lt;p&gt;You don't use &lt;code&gt;i&lt;/code&gt; and that's what the byte-compiler tells you.&#xA;To let the byte-compiler know that you're aware of the fact that the variable is unused, give it a name that starts with an underscore.  E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dotimes (_ 10) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dotimes (_i 10) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-02-19T17:04:14.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20434" PostTypeId="1" AcceptedAnswerId="20435" CreationDate="2016-02-19T17:15:05.330" Score="1" ViewCount="346" Body="&lt;p&gt;I am working on a major mode for an input file format I am interested in and want to set multi-line comments with the delimiters skip and noskip like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;skip larb noskip&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;skip &#xA;GRID&#xA;  TYPE structured&#xA;  NXYZ 284 307 1&#xA;END&#xA;noskip&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the re-builder, I came upon the following regex that highlights both single and multi-line comments&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;skip\\(.\\|\n\\)*?noskip&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this doesn't work to pass to the font-lock-comment-face. Only the single-line version gets its font-locked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a mode with word-delimited multi-line comments like I  want, that I can borrow the right syntax from?&lt;/p&gt;&#xA;" OwnerUserId="674" LastEditorUserId="105" LastEditDate="2016-02-21T02:06:39.133" LastActivityDate="2018-01-04T22:36:58.957" Title="setting comment face in major mode on multi-line word-delimited comments" Tags="|font-lock|syntax-highlighting|comment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20435" PostTypeId="2" ParentId="20434" CreationDate="2016-02-19T17:32:43.017" Score="3" Body="&lt;p&gt;Rather than handle it in font-lock highlighing rules, you want to handle it at the level of syntax tables.  Now syntax-tables can't directly handle such start/end markers, so you'll have to use the &lt;em&gt;syntax-propertize&lt;/em&gt; system.  E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local syntax-propertize-function&#xA;  (syntax-propertize-rules&#xA;    (&quot;\\_&amp;lt;\\(s\\)kip\\_&amp;gt;&quot; (1 &quot;&amp;lt;&quot;))&#xA;    (&quot;\\_&amp;lt;noski\\(p\\)\\_&amp;gt;&quot; (1 &quot;&amp;gt;&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An important difference between font-lock rules and syntax-propertize rules is that font-lock rules can be applied &quot;out of order&quot; or piecemeal.  More specifically, by default Emacs only applies font-lock rules to the parts of the buffer that are displayed, so if the &lt;code&gt;skip&lt;/code&gt; in your code happens to be in a part of the buffer which was never displayed, the font-lock rules will simply miss it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another important difference is that font-lock rules don't naturally have state, so you either need to use one regexp which matches the multi-line element (and then try and force font-lock to always consider a large enough chunk of the buffer to see both &lt;code&gt;skip&lt;/code&gt; and &lt;code&gt;noskip&lt;/code&gt; at the same time) or to separately match &lt;code&gt;skip&lt;/code&gt;, &lt;code&gt;noskip&lt;/code&gt;, and every line between them, and to each time check whether we're still within a skip..noskip thingy.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2018-01-04T22:36:58.957" LastActivityDate="2018-01-04T22:36:58.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20436" PostTypeId="1" CreationDate="2016-02-19T18:45:24.523" Score="2" ViewCount="573" Body="&lt;p&gt;When pressing both &lt;kbd&gt;C&lt;/kbd&gt; at the same time, the combination is recognized as &lt;kbd&gt;C-M&lt;/kbd&gt; on a Win7 machine and Emacs 24.5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've stumbled on this by mistake while pressing &lt;kbd&gt;C-C-SPC&lt;/kbd&gt;. While on a Linux machine, this is the same as &lt;kbd&gt;C-SPC&lt;/kbd&gt;, on a Windows machine this is recognized as &lt;kbd&gt;C-M-SPC&lt;/kbd&gt;. This is very handy, but I'm not able to reproduce the behaviour on Linux. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how I might achieve this on Linux or why is it working only on Windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update for Windows:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If I start emacs with no init files (&lt;code&gt;emacs -q&lt;/code&gt;), the behavior is still present (i.e. &lt;kbd&gt;C-C-SPC&lt;/kbd&gt; is still recognized as &lt;kbd&gt;C-M-SPC&lt;/kbd&gt;)&lt;/li&gt;&#xA;&lt;li&gt;If I start emacs without the window system (&lt;code&gt;emacs -nw&lt;/code&gt;) the behavior disappears (i.e &lt;kbd&gt;C-C-SPC&lt;/kbd&gt; is recognized as &lt;kbd&gt;C-SPC&lt;/kbd&gt;), as expected.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11172" LastEditorUserId="11172" LastEditDate="2016-05-18T07:41:56.040" LastActivityDate="2016-05-18T07:41:56.040" Title="Pressing both Ctrl keys at the same time is recognized as Ctrl plus Meta" Tags="|key-bindings|microsoft-windows|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20437" PostTypeId="1" CreationDate="2016-02-19T20:23:47.063" Score="4" ViewCount="1085" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/vspinu/polymode&quot; rel=&quot;nofollow noreferrer&quot;&gt;polymode&lt;/a&gt; manual suggests that creating new polymodes should be very easy:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Creating new polymodes typically takes a few lines of code.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I wanted to set it up to make emacs to switch to python mode inside of &lt;code&gt;pythontex&lt;/code&gt; commands and environments. For the object oriented approach seems to be more complex to modify than just adding some delimiters to a list in my .emacs file. So I don't even see how to start and where to save apply my modifications. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how would the equivalent setup for polymode look like as that given by JeanPierre for mmm-mode: &lt;a href=&quot;https://emacs.stackexchange.com/a/20150/2323&quot;&gt;https://emacs.stackexchange.com/a/20150/2323&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-02-20T04:46:07.883" Title="Polymode with python and latex-mode" Tags="|polymode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20438" PostTypeId="2" ParentId="5741" CreationDate="2016-02-19T22:04:12.190" Score="16" Body="&lt;p&gt;You want &lt;code&gt;org-agenda-exit&lt;/code&gt;, conveniently bound to x by default in the agenda view&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Like `org-agenda-Quit', but kill any buffers that were created by&#xA;  the agenda.  Org buffers visited directly by the user will not be&#xA;  touched.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I found this using &lt;code&gt;describe-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2016-02-19T22:04:12.190" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20439" PostTypeId="1" CreationDate="2016-02-19T23:41:48.357" Score="1" ViewCount="245" Body="&lt;p&gt;I'm trying to replicate vims :tabnew functionality, which just creates a new empty tab (perspective). All the commands I've looked at prompts for confirmations and names etc. They clone the current tab and do not automatically switch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a command that will create a new (empty) tab, give it a default name (I'll name it later if I want) and switch to it?&lt;/p&gt;&#xA;" OwnerUserId="10765" LastActivityDate="2016-02-20T02:01:43.403" Title="Perp-mode - open new blank tab without prompts?" Tags="|evil|spacemacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20440" PostTypeId="1" CreationDate="2016-02-20T00:03:53.770" Score="2" ViewCount="213" Body="&lt;p&gt;What would be the best way to go about customizing the layout of the bookmarks &lt;em&gt;Bookmarks List&lt;/em&gt; buffer?  I'd like to end up with a result similar to the Spacemacs equivalent buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OlD5V.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OlD5V.png&quot; alt=&quot;Spacemacs bookmarks list buffer&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, the default header and column headings have been replaced with a single line header and 2-column indent. I also have bookmarks+ active which must be altering that buffer too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice much appreciated,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stu&lt;/p&gt;&#xA;" OwnerUserId="9242" LastEditorUserId="9242" LastEditDate="2016-02-20T00:16:53.563" LastActivityDate="2016-03-21T02:46:10.250" Title="Customizing the layout of the *Bookmarks List* buffer?" Tags="|buffers|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20441" PostTypeId="1" AcceptedAnswerId="20564" CreationDate="2016-02-20T00:08:34.040" Score="4" ViewCount="599" Body="&lt;p&gt;If I have a heading called &quot;heading1&quot;, I can link to it within the same &lt;code&gt;org&lt;/code&gt; file with &lt;code&gt;[[heading1]]&lt;/code&gt;, but cannot link to it with &lt;code&gt;[[Heading1]]&lt;/code&gt;. Is there a way to make links case insensitive?&lt;/p&gt;&#xA;" OwnerUserId="11177" LastEditorUserId="2710" LastEditDate="2016-04-27T15:25:37.017" LastActivityDate="2016-04-27T15:25:37.017" Title="How to make internal links in org-mode case insensitive" Tags="|org-mode|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20442" PostTypeId="1" AcceptedAnswerId="20443" CreationDate="2016-02-20T00:59:34.170" Score="1" ViewCount="39" Body="&lt;p&gt;I'm using bookmarks+ and smart modeline and have gone some way to styling the modeline and the &lt;em&gt;Bookmark List&lt;/em&gt; buffer.  I'd like to change the appearance of the modeline message &quot;sorting turned OFF&quot; in that buffer too.  Currently it looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UCxsF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UCxsF.png&quot; alt=&quot;Bookmark list buffer modeline&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which does not match the modeline faces. Looking through the list of display faces it seems to be similar to the bmkp-heading face?  Can anyone enlighten me on which faces or settings control the display of this text message?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stu&lt;/p&gt;&#xA;" OwnerUserId="9242" LastActivityDate="2016-02-20T01:59:39.990" Title="Styling the &quot;sorting turned OFF&quot; modeline message in *Bookmark List* buffer?" Tags="|mode-line|bookmarks|mode-line-format|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20443" PostTypeId="2" ParentId="20442" CreationDate="2016-02-20T01:54:20.353" Score="2" Body="&lt;p&gt;The relevant &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+&lt;/a&gt; code is in functions &lt;code&gt;bmkp-bmenu-mode-line-string&lt;/code&gt; (which creates the string, with its faces) and &lt;code&gt;bmkp-bmenu-mode-line&lt;/code&gt; (which displays that in the mode-line), in file &lt;a href=&quot;http://www.emacswiki.org/emacs/download/bookmark%2b-bmu.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;bookmark+-bmu.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first of these functions you will see that the faces used are (1) &lt;code&gt;bmkp-heading&lt;/code&gt; (for the &lt;code&gt;sorting...&lt;/code&gt; information) and (2) one or more of these faces (for the mark counts):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;bmkp-&amp;gt;-mark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bmkp-D-mark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bmkp-t-mark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bmkp-a-mark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bmkp-X-mark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bmkp-*-mark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That is, the counters that tell you the numbers of each kind of mark (&lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;D&lt;/code&gt;, &lt;code&gt;t&lt;/code&gt;, &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;X&lt;/code&gt;, and &lt;code&gt;*&lt;/code&gt;) use the same faces in the mode-line as do those markers in the listing: the counter for marker &lt;code&gt;&amp;gt;&lt;/code&gt; uses the same face as marker &lt;code&gt;&amp;gt;&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize any of the faces, of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note too that &lt;code&gt;M-x list-faces-display&lt;/code&gt; can be helpful in identifying faces in places where you cannot easily put point and use &lt;code&gt;C-u C-x =&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-20T01:59:39.990" LastActivityDate="2016-02-20T01:59:39.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20444" PostTypeId="2" ParentId="20439" CreationDate="2016-02-20T02:01:43.403" Score="1" Body="&lt;p&gt;Have you ever tried &lt;a href=&quot;https://github.com/ieure/scratch-el&quot; rel=&quot;nofollow&quot;&gt;scratch&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will create a new empty buffer according the current buffer mode without prompts and switch to it immediately. &lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2016-02-20T02:01:43.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20445" PostTypeId="2" ParentId="20440" CreationDate="2016-02-20T02:13:08.900" Score="2" Body="&lt;p&gt;You cannot easily do that. The &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+&lt;/a&gt; layout generally follows that of vanilla Emacs, but more information is provided in the &quot;heading&quot; (first few lines).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &quot;heading&quot; information includes the bookmark file and the current &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#FilteringIncrementallyByPatternMatching&quot; rel=&quot;nofollow&quot;&gt;filtering type&lt;/a&gt; (kinds of bookmarks that are shown). That is why more than one line is used. The bookmark file location alone can be wide, so it is placed on a line by itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no need for column headings, as it is pretty obvious that one is the bookmark name and the other is its location (e.g., file). And as there is no need for column headings, there is no need for an Emacs header line (which scrolls with the window, so that it is always visible, to let you know which column is which). The header line you show is pretty useless, IMHO, but even if you like it, you would need to do some programming to modify Bookmark+ to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(As for the columns you show, I assume that you know that you can toggle showing the file column, using &lt;code&gt;M-t&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your two-character indentation: Bookmark+ uses the first 4 characters of each line for markers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First char: &lt;code&gt;D&lt;/code&gt; or &lt;code&gt;&amp;gt;&lt;/code&gt; (or &lt;code&gt;&lt;/code&gt;) for deletion flag or ordinary &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#MarkingAndUnmarkingBookmarks&quot; rel=&quot;nofollow&quot;&gt;mark&lt;/a&gt; (or unmarked).&lt;/li&gt;&#xA;&lt;li&gt;Second char: &lt;code&gt;t&lt;/code&gt; if the bookmark has &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags&quot; rel=&quot;nofollow&quot;&gt;tags&lt;/a&gt; (or &lt;code&gt;&lt;/code&gt; if it has none).&lt;/li&gt;&#xA;&lt;li&gt;Third char: &lt;code&gt;X&lt;/code&gt; or &lt;code&gt;a&lt;/code&gt; (or &lt;code&gt;&lt;/code&gt;) for &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#TemporaryBookmarks&quot; rel=&quot;nofollow&quot;&gt;temporary&lt;/a&gt; bookmark or &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkAnnotations&quot; rel=&quot;nofollow&quot;&gt;annotated&lt;/a&gt; bookmark (or neither).&lt;/li&gt;&#xA;&lt;li&gt;Fourth char: &lt;code&gt;*&lt;/code&gt; if the bookmark has unsaved modifications (or &lt;code&gt;&lt;/code&gt; otherwise).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So bookmark names are always &quot;indented&quot; 4 chars.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-20T02:25:33.630" LastActivityDate="2016-02-20T02:25:33.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20446" PostTypeId="2" ParentId="20437" CreationDate="2016-02-20T04:46:07.883" Score="6" Body="&lt;p&gt;Following the example at &lt;a href=&quot;https://github.com/vspinu/polymode/tree/master/modes&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/vspinu/polymode/tree/master/modes&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (require 'polymode)&#xA;&#xA;  (defcustom pm-inner/python&#xA;    (pm-hbtchunkmode &quot;python&quot;&#xA;                     :mode 'python-mode&#xA;                     :head-reg  &quot;\\\\begin{pycode}&quot;&#xA;                     :tail-reg  &quot;\\\\end{pycode}&quot;)&#xA;    &quot;python typical chunk.&quot;&#xA;    :group 'innermodes&#xA;    :type 'object)&#xA;&#xA;  (defcustom pm-poly/latex-python&#xA;    (pm-polymode-one &quot;latex-python&quot;&#xA;                     :hostmode 'pm-host/latex&#xA;                     :innermode 'pm-inner/python)&#xA;    &quot;latex-python typical polymode.&quot;&#xA;    :group 'polymodes&#xA;    :type 'object)&#xA;&#xA;  (define-polymode poly-latex+python-mode pm-poly/latex-python)&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.tex$&quot; . poly-latex+python-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It appears to work, though I only tested it briefly. This snippet can go in your &lt;code&gt;.emacs&lt;/code&gt;, &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; or wherever you put your personal emacs configuration.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2016-02-20T04:46:07.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20447" PostTypeId="2" ParentId="20429" CreationDate="2016-02-20T06:34:18.450" Score="2" Body="&lt;p&gt;One way to deal with this is to use structural editing commands. So, instead of thinking &quot;delete the character, add it at the end&quot;, I think something like &quot;wrap the paren pair around the next token&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One library that does this is called &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow noreferrer&quot;&gt;smartparens&lt;/a&gt;, and the function is &lt;code&gt;#'sp-forward-slurp-sexp&lt;/code&gt;. Starting with this text (with the pipe marking point):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wrapped(|)someFunction();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling &lt;code&gt;#'sp-forward-slurp-sexp&lt;/code&gt; results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wrapped(|someFunction)();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And a second time in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wrapped(someFunction());&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2018-07-04T20:04:22.467" LastActivityDate="2018-07-04T20:04:22.467" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="20448" PostTypeId="1" AcceptedAnswerId="20455" CreationDate="2016-02-20T07:48:15.767" Score="3" ViewCount="298" Body="&lt;p&gt;I am new to emacs. I am using two keyboard layouts Arabic &amp;amp; English. I need a way to execute key combinations without the need to change to English layout. &#xA;Right now I got something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-ء is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I need something like key-translation-map but for all emacs key combinations using arabic characters.&lt;/p&gt;&#xA;" OwnerUserId="11180" LastActivityDate="2016-02-20T17:28:26.097" Title="Emacs Key Combinations with Arabic characters" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20449" PostTypeId="2" ParentId="20292" CreationDate="2016-02-20T09:37:50.820" Score="2" Body="&lt;p&gt;Maybe, the following is sufficient for your task. You should be able to adapt it to your purpose since it is more concise than the original version.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun shackra/task-clocked-time ()&#xA;  &quot;Return a string with the clocked time and effort, if any&quot;&#xA;  (apply 'concat&#xA;     (org-minutes-to-clocksum-string (org-clock-get-clocked-time))&#xA;     (when org-clock-effort&#xA;         (list &quot; [&quot; (org-minutes-to-clocksum-string (org-duration-string-to-minutes org-clock-effort))&quot;]&quot;)&#xA;       )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like you have used &lt;code&gt;org-clock-get-clock-string&lt;/code&gt; from an older version of &lt;code&gt;org-mode&lt;/code&gt; than you have running: You have &lt;code&gt;(format org-time-clocksum-format h m)&lt;/code&gt; in &lt;code&gt;shackra/task-clocked-time&lt;/code&gt;. This requires that &lt;code&gt;org-clock-get-clock-string&lt;/code&gt; is a format string for the  &lt;code&gt;format&lt;/code&gt;-function. But, the error message says that &lt;code&gt;org-time-clocksum-format&lt;/code&gt; is actually an alist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the actual tree version of &lt;code&gt;org-clock-get-clock-string&lt;/code&gt; is there:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-clock.el#n662&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-clock.el#n662&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formatting of the duration string in dependence of &lt;code&gt;org-time-clocksum-format&lt;/code&gt; is done in &lt;code&gt;org-minutes-to-clocksum-string&lt;/code&gt;.&#xA;This is a lengthy function. You can have a peep at it by using emacs' help system.&#xA;You get the help for &lt;code&gt;org-minutes-to-clocksum-string&lt;/code&gt; the same way as for any emacs-lisp function by typing &lt;kbd&gt;C-h f&lt;/kbd&gt;, typing in the function name &lt;code&gt;org-minutes-to-clocksum-string&lt;/code&gt;, and &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs-version 25.1.50 with &lt;code&gt;org-mode&lt;/code&gt; 8.3.2 the doc-string of &lt;code&gt;org-time-clocksum-format&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The format string used when creating CLOCKSUM lines.&#xA;This is also used when Org mode generates a time duration.&#xA;&#xA;The value can be a single format string containing two&#xA;%-sequences, which will be filled with the number of hours and&#xA;minutes in that order.&#xA;&#xA;Alternatively, the value can be a plist associating any of the&#xA;keys :years, :months, :weeks, :days, :hours or :minutes with&#xA;format strings.  The time duration is formatted using only the&#xA;time components that are needed and concatenating the results.&#xA;If a time unit in absent, it falls back to the next smallest&#xA;unit.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your code only handles the first case and not the alternative. That is the main cause of the error in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Further note:&lt;/strong&gt; Emacs is a self-documenting editor. That is the reason why I do not start here to explain the code line-by-line. For each function in the code you can place point on the function name and use &lt;kbd&gt;C-h f&lt;/kbd&gt; to get the corresponding help. Futhermore, there is a nice Lisp introduction in the info files (you get the info directory via &lt;kbd&gt;C-h i&lt;/kbd&gt;). In the info directory press &lt;kbd&gt;m&lt;/kbd&gt; for 'menu item' and input &lt;code&gt;Emacs Lisp Intro&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to get the lisp introduction. There is also a complete lisp manual in the menu item &lt;code&gt;Elisp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-02-21T07:31:50.587" LastActivityDate="2016-02-21T07:31:50.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20451" PostTypeId="1" CreationDate="2016-02-20T15:54:19.727" Score="5" ViewCount="7715" Body="&lt;p&gt;I would like to know how to center the text in a file exported from Org-mode to .odt&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of what I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO center text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;---&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                               * DONE center text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bonuses if it will automatically center when I type, or press enter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I want to do this and then export to odt.&lt;/p&gt;&#xA;" OwnerUserId="11040" LastEditorUserId="97" LastEditDate="2016-02-20T20:15:25.697" LastActivityDate="2016-06-21T10:48:47.120" Title="How do I center text when exporting an Org file to an .odt file?" Tags="|org-mode|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20452" PostTypeId="2" ParentId="14183" CreationDate="2016-02-20T16:37:08.633" Score="1" Body="&lt;p&gt;I'm not sure wether cask really rewrites the Cask file, cause I have two (independent) installations, that both have missing entries in the Cask-file that are nevertheless installed in the &lt;code&gt;.cask&lt;/code&gt; folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I'm not really an elisp hacker (but try to become one), for now I only have a tcl script that writes out a Cask files that mirrors the current installed packages.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env tclsh&#xA;#&#xA;# get-installed-cask ?cask-archive?&#xA;# print out a Cask-file with all currently installed packages&#xA;&#xA;if {[llength $argv] &amp;gt; 0} {&#xA;    cd [lindex $argv 0]&#xA;}&#xA;&#xA;set names [exec find elpa/ -maxdepth 1 -type d]&#xA;&#xA;proc getName {fn} {&#xA;    set sub &quot;&quot;&#xA;    regexp {elpa/(.*)-[01-9.]+} $fn all sub&#xA;    return $sub&#xA;}&#xA;&#xA;foreach name $names {&#xA;    set name [string trim $name]&#xA;    set new [getName $name]&#xA;    switch $new {&#xA;    &quot;&quot; -&#xA;    &quot;archives&quot; -&#xA;    &quot;gnupg&quot; {&#xA;        ; # nothing&#xA;    }&#xA;    default {&#xA;        lappend result $new&#xA;    }&#xA;    }&#xA;}&#xA;&#xA;set result [lsort -dictionary $result]&#xA;&#xA;puts &quot;(source gnu)&#xA;(source melpa)&#xA;(source org)&#xA;&quot;&#xA;&#xA;foreach name $result {&#xA;    puts &quot;(depends-on \&quot;$name\&quot;)&quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Call it with the cask-archive directory that you want to enumerate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;get-installed-cask ~/.emacs.d/.cask/24.5.1/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Simply use diff (meld or ...) to see the differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And BTW: change the hardcoded list of repositories to suite your installation.&lt;/p&gt;&#xA;" OwnerUserId="934" LastEditorUserId="934" LastEditDate="2016-02-21T11:56:30.237" LastActivityDate="2016-02-21T11:56:30.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20453" PostTypeId="1" AcceptedAnswerId="20512" CreationDate="2016-02-20T17:10:33.380" Score="11" ViewCount="5938" Body="&lt;p&gt;This is similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/13171/whats-the-best-way-to-use-local-packages-in-spacemacs&quot;&gt;this question&lt;/a&gt; but the answer there seems to be deprecated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I'm using a layer and want hack the code of a particular package that layer is using. How do I go about it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To better illustrate what I want to accomplish in general, I present a specific example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to get the &lt;code&gt;spotify&lt;/code&gt; layer to work, but the current &lt;code&gt;master&lt;/code&gt; branch in the &lt;code&gt;helm-spotify&lt;/code&gt; package uses a deprecated web API. There is a &lt;a href=&quot;https://github.com/krisajenkins/helm-spotify/pull/17&quot; rel=&quot;noreferrer&quot;&gt;pull request&lt;/a&gt; to fix this and I want to try it and maybe contribute something. My problem is, that I can not get the local copy of &lt;code&gt;helm-spotify&lt;/code&gt; to load.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I tried was to switch to the &lt;code&gt;develop&lt;/code&gt; branch of &lt;code&gt;spacemacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git branch --track develop origin/develop&#xA;git checkout develop&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;~/.emacs.d/layers/spotify/packages.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I changed from&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq spotify-packages '(spotify helm-spotify))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq spotify-packages&#xA;          '(    &#xA;                spotify&#xA;                (helm-spotify :location local)&#xA;           ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And pulled the &lt;code&gt;helm-spotify&lt;/code&gt; repository to &lt;code&gt;~/.emacs.d/layers/spotify/local/helm-spotify&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I restart spacemacs I get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Cannot open load file, no such file or directory, multi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In when I look into &lt;code&gt;helm-spotify.el&lt;/code&gt; there is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'multi)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my guess is, that when installing &lt;code&gt;helm-spotify&lt;/code&gt; from &lt;code&gt;melpa&lt;/code&gt; the dependency on &lt;code&gt;multi&lt;/code&gt; gets resolved prior to loading &lt;code&gt;helm-spotify&lt;/code&gt; but of course not anymore when I use a local copy of &lt;code&gt;helm-spotify&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So my questions are&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do resolve dependencies when using a local package? &lt;/li&gt;&#xA;&lt;li&gt;Or should I do this completely differently from what I described?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I also tried, without success, to add &lt;code&gt;multi&lt;/code&gt; to &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt; and to &lt;code&gt;spotify-packages&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq spotify-packages '(&#xA;                         multi ;; I added this&#xA;                         spotify&#xA;                         (helm-spotify :location local) ;; I modified here&#xA;                         ))&#xA;&#xA;;; I added this&#xA;(defun spotify/init-multi ()&#xA;  (use-package multi))&#xA;&#xA;;; the rest is as it was&#xA;&#xA;(defun spotify/init-spotify ()&#xA;  (use-package spotify&#xA;    :config (spacemacs/set-leader-keys&#xA;              &quot;amsp&quot; 'spotify-playpause&#xA;              &quot;amsn&quot; 'spotify-next&#xA;              &quot;amsN&quot; 'spotify-previous&#xA;              &quot;amsQ&quot; 'spotify-quit)))&#xA;&#xA;(when (configuration-layer/layer-usedp 'spacemacs-helm)&#xA;  (defun spotify/init-helm-spotify ()&#xA;    (use-package helm-spotify&#xA;      :config (spacemacs/set-leader-keys&#xA;                &quot;amsg&quot; 'helm-spotify))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;packages.el&lt;/code&gt;. Also tried without adding &lt;code&gt;multi&lt;/code&gt; to &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10870" LastEditorUserId="10870" LastEditDate="2016-02-20T21:02:32.443" LastActivityDate="2016-02-23T03:06:54.500" Title="How to use a local version of a package in spacemacs?" Tags="|spacemacs|package-development|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20454" PostTypeId="2" ParentId="20451" CreationDate="2016-02-20T17:21:59.550" Score="1" Body="&lt;p&gt;You can center lines with the command &lt;code&gt;center-line&lt;/code&gt; (&lt;code&gt;M-o M-s&lt;/code&gt;).  Other options include &lt;code&gt;center-paragraph&lt;/code&gt; and &lt;code&gt;center-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you should probably not use this command on &lt;code&gt;org-mode&lt;/code&gt; headers.  Headers are only recognized as such when the asterisks begin at the first column, so centering one turns it into plain text.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-20T17:21:59.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20455" PostTypeId="2" ParentId="20448" CreationDate="2016-02-20T17:28:26.097" Score="1" Body="&lt;p&gt;You are probably looking to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Input-Method.html&quot; rel=&quot;nofollow&quot;&gt;select an input method&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, &lt;code&gt;C-\&lt;/code&gt; will toggle your input method, which has the practical effect that, with an English keyboard layout, you can input text in Arabic, but the keybindings for other commands will be unaffected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set the &lt;code&gt;default-input-method&lt;/code&gt; to Arabic with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default default-input-method &quot;arabic&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The docstring for &lt;code&gt;default-input-method&lt;/code&gt; says that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Default input method for multilingual text (a string).&#xA;  This is the input method activated automatically by the command&#xA;  &lt;code&gt;toggle-input-method&lt;/code&gt; (&lt;code&gt;C-\&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-20T17:28:26.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20456" PostTypeId="2" ParentId="17626" CreationDate="2016-02-20T21:09:38.823" Score="4" Body="&lt;p&gt;The problem is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nnimap-server-port &quot;imaps&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on Windows it should be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nnimap-server-port 993)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The former works on GNU/Linux because /etc/services provides a known port to work with, whereas Windows doesn't have a similar mechanism.&lt;/p&gt;&#xA;" OwnerUserId="214" LastEditorUserId="1979" LastEditDate="2017-03-07T19:31:02.863" LastActivityDate="2017-03-07T19:31:02.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20457" PostTypeId="2" ParentId="20273" CreationDate="2016-02-20T21:20:39.110" Score="3" Body="&lt;p&gt;I'm not sure whether that's just a typo in your question but there's no &lt;code&gt;sqlint&lt;/code&gt; syntax checker in Flycheck.  It's name is &lt;code&gt;sql-sqlint&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-02-20T21:20:39.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20458" PostTypeId="1" AcceptedAnswerId="20460" CreationDate="2016-02-20T21:49:30.650" Score="2" ViewCount="285" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  I am seeking a proposed modification of &lt;code&gt;simple.el&lt;/code&gt; at lines 5251 to 5308 of the master branch relating to highlighting a selected region to achieve a better visual representation when the same buffer is displayed in more than one window (same frame or a different frame) -- with different &lt;code&gt;window-start&lt;/code&gt;/&lt;code&gt;window-end&lt;/code&gt; positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first couple of screen-shots are with the default &lt;code&gt;highlight-nonselected-windows&lt;/code&gt; set to &lt;code&gt;nil&lt;/code&gt;.  The last screen-shot is with &lt;code&gt;highlight-nonselected-windows&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;.  The test file for this example is the library &lt;code&gt;simple.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have only selected the four (4) lines of code in the second window in the first screen-shot, yet (12) lines of code are highlighted in the first window in the second-screen-shot.  The third screen-shot displays both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GOAL&lt;/strong&gt;:  The same four (4) lines of code should be highlighted in all three screen-shots.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/highlight_nonselected_windows_01.png&quot; alt=&quot;Example&quot;&gt;&#xA;&lt;img src=&quot;https://www.lawlist.com/images/highlight_nonselected_windows_02.png&quot; alt=&quot;Example&quot;&gt;&#xA;&lt;img src=&quot;https://www.lawlist.com/images/highlight_nonselected_windows_03.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.910" LastActivityDate="2016-02-20T22:50:22.583" Title="Highlighting selected region in same buffer, displayed in multiple windows" Tags="|region|overlays|highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20459" PostTypeId="2" ParentId="20441" CreationDate="2016-02-20T22:28:56.213" Score="3" Body="&lt;p&gt;Looking at the &lt;a href=&quot;http://orgmode.org/org.html#Internal-links&quot; rel=&quot;nofollow&quot;&gt;internal link&lt;/a&gt;&#xA;section in the Org manual, it doesn't look like it is possible. You can,&#xA;however, use &lt;code&gt;[[heading1][Heading1]]&lt;/code&gt; if you want to make the &lt;em&gt;description&lt;/em&gt; a&#xA;different case from the link target.&lt;/p&gt;&#xA;" OwnerUserId="10625" LastActivityDate="2016-02-20T22:28:56.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20460" PostTypeId="2" ParentId="20458" CreationDate="2016-02-20T22:50:22.583" Score="3" Body="&lt;p&gt;Not sure what the question is. Are you asking for code that gives you the behavior you want? Are you asking that Emacs Dev change &lt;code&gt;simple.el&lt;/code&gt; so that it behaves as you want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At any rate, this is the problem: Each window has its own &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;window point&lt;/strong&gt;&lt;/a&gt;, which is the position that point would have if that window were selected. This means that the &lt;em&gt;region&lt;/em&gt; when that window is selected is not the same as it is when another window is selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are asking for, as behavior, is to highlight the same text in each window (if it is shown in a given window). But that would not be highlighting the region for that window. You can do that, but you would need to use a different overlay (or text property) - you should not expect the region highlighting to highlight something other than the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead of modifying the &lt;code&gt;simple.el&lt;/code&gt; code that highlights the region in each window, consider writing your own code that highlights, in each window that shows it, the text that is selected as the region in the selected window. You know as well as anyone how to do that. The point is that you would need to do it (unless someone else volunteers code that does that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this answer does not give you what you want, but maybe it helps understand why what you really want should not be to try to modify &lt;code&gt;simple.el&lt;/code&gt;: the region is buffer/window-specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html&quot; rel=&quot;nofollow&quot;&gt;Window Point&lt;/a&gt;. (But I imagine you already know this.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-20T22:50:22.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20461" PostTypeId="1" AcceptedAnswerId="20658" CreationDate="2016-02-20T22:57:52.820" Score="11" ViewCount="2461" Body="&lt;p&gt;I have 2 &lt;code&gt;.org&lt;/code&gt; files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// a.org contains the anchor&#xA;&amp;lt;&amp;lt;my_anchor&amp;gt;&amp;gt;&#xA;&#xA;// b.org contains the link to my_anchor&#xA;[[file:a.org::my_anchor][My Link]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I click on the link in org-mode, it links correctly to the position of &lt;code&gt;my_anchor&lt;/code&gt; in &lt;code&gt;a.org&lt;/code&gt;. But when I export these 2 files to HTML, what I expect is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// b.html&#xA;&amp;lt;a href=&quot;a.html#my_anchor&quot;&amp;gt;My Link&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I got is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// b.html&#xA;&amp;lt;a href=&quot;a.html&quot;&amp;gt;My Link&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wonder how to correctly write an external link so that it works both in org-mode and in exported HTML.&lt;/p&gt;&#xA;" OwnerUserId="8679" LastActivityDate="2016-04-28T14:28:19.530" Title="Org-mode external links not working when exported to HTML" Tags="|org-mode|org-export|html|hyperlinks|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20463" PostTypeId="1" AcceptedAnswerId="20473" CreationDate="2016-02-21T05:16:05.550" Score="4" ViewCount="380" Body="&lt;p&gt;I'm trying to show certain icons to the left of TODO items in the agenda based on the presence of a property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if TODO item A has the &quot;important&quot; property, show an exclamation mark:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;!  TODO A&#xA;   TODO B&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like this can be customized with &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; using the &lt;code&gt;%(expression)&lt;/code&gt; syntax, but I encounter bizarre issues when using the following syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun show-exclamation-if-important()&#xA;  (save-window-excursion&#xA;    (org-agenda-goto)&#xA;    (if (org-entry-properties (point) &quot;important&quot;)&#xA;        &quot;!&quot;&#xA;      &quot; &quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This combined with using &lt;code&gt;%(show-exclamation-if-important)&lt;/code&gt; returns &lt;code&gt;user-error: Command not allowed in this line&lt;/code&gt;. It seems to be an issue with the excursion of some sorts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply put, how can I get a return value of the properties of a TODO item while on the corresponding agenda entry?&lt;/p&gt;&#xA;" OwnerUserId="11189" LastEditorUserId="105" LastEditDate="2016-02-21T06:27:13.870" LastActivityDate="2016-02-21T15:30:06.787" Title="Customize Org agenda entry based on properties in TODO items" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20464" PostTypeId="2" ParentId="20292" CreationDate="2016-02-21T05:41:48.830" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;org-minutes-to-clocksum-string&lt;/code&gt; to format your time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is modified version of the code.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun shackra/task-clocked-time ()&#xA;  &quot;Return a string with the clocked time and effort, if any&quot;&#xA;  (interactive)&#xA;  (let* ((clocked-time (org-clock-get-clocked-time))&#xA;         (h (floor clocked-time 60))&#xA;         (m (- clocked-time (* 60 h)))&#xA;         (work-done-str (org-minutes-to-clocksum-string m)))&#xA;    (if org-clock-effort&#xA;        (let* ((effort-in-minutes&#xA;                (org-duration-string-to-minutes org-clock-effort))&#xA;               (effort-h (floor effort-in-minutes 60))&#xA;               (effort-m (- effort-in-minutes (* effort-h 60)))&#xA;               (effort-str (org-minutes-to-clocksum-string effort-m)))&#xA;          (format &quot;[%s/%s (%s)&quot; work-done-str effort-str org-clock-heading))&#xA;      (format &quot;[%s (%s)]&quot; work-done-str org-clock-heading))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-clock-get-clock-string&lt;/code&gt; uses &lt;code&gt;org-time-clocksum-format&lt;/code&gt; to format your time the way you want. As the doc string says it can either be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a simple format string like &lt;code&gt;&quot;%d hours and %d minutes&quot;&lt;/code&gt;, or&lt;/li&gt;&#xA;&lt;li&gt;a plist like &lt;code&gt;(:hours &quot;%d hours and &quot; :minutes &quot;%d minutes&quot; :require-minutes t)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Both generates &lt;code&gt;&quot;1 hours and 10 minutes&quot;&lt;/code&gt; if you evaluate &lt;code&gt;(org-clock-get-clock-string 70)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The format string used when creating CLOCKSUM lines. This is also used&#xA;  when Org mode generates a time duration.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The value can be a single format string containing two %-sequences,&#xA;  which will be filled with the number of hours and minutes in that&#xA;  order.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Alternatively, the value can be a plist associating any of the keys&#xA;  &lt;code&gt;:years&lt;/code&gt;, &lt;code&gt;:months&lt;/code&gt;, &lt;code&gt;:weeks&lt;/code&gt;, &lt;code&gt;:days&lt;/code&gt;, &lt;code&gt;:hours&lt;/code&gt; or &lt;code&gt;:minutes&lt;/code&gt; with format&#xA;  strings.  The time duration is formatted using only the time&#xA;  components that are needed and concatenating the results. If a time&#xA;  unit in absent, it falls back to the next smallest unit.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The keys &lt;code&gt;:require-years&lt;/code&gt;, &lt;code&gt;:require-months&lt;/code&gt;, &lt;code&gt;:require-days&lt;/code&gt;,&#xA;  &lt;code&gt;:require-weeks&lt;/code&gt;, &lt;code&gt;:require-hours&lt;/code&gt;, &lt;code&gt;:require-minutes&lt;/code&gt; are also meaningful. &#xA;  A non-nil value for these keys indicates that the corresponding time&#xA;  component should always be included, even if its value is 0.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(:days &quot;%dd&quot; :hours &quot;%d&quot; :require-hours t :minutes &quot;:%02d&quot; :require-minutes t)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;means durations longer than a day will be expressed in days, hours and&#xA;  minutes, and durations less than a day will always be expressed in&#xA;  hours and minutes (even for durations less than an hour).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The value&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(:days &quot;%dd&quot; :minutes &quot;%dm&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;means durations longer than a day will be expressed in days and&#xA;  minutes, and durations less than a day will be expressed entirely in&#xA;  minutes (even for durations longer than an hour).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is line by line explanation of &lt;code&gt;org-clock-get-clock-string&lt;/code&gt; (comment removed).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-clock-get-clock-string ()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;define the function named &lt;code&gt;org-clock-get-clock-string&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (let ((clocked-time (org-clock-get-clocked-time)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;let bind (create a local variable) &lt;code&gt;clocked-time&lt;/code&gt; initialized to the current clocked time in minutes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (if org-clock-effort&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if the clocked item has an effort set, let bind 4 variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        (let* ((effort-in-minutes&#xA;                (org-duration-string-to-minutes org-clock-effort))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;first, initialize &lt;code&gt;effort-in-minutes&lt;/code&gt; as effort string to minutes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;               (work-done-str&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Second, work-done-str.  This is the time currently spent on the work.  We want to put color on it, so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                (org-propertize&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;use &lt;code&gt;org-propertize&lt;/code&gt; to do the work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                 (org-minutes-to-clocksum-string clocked-time)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;convert the &lt;code&gt;clocked-time&lt;/code&gt; to string,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                 'face (if (and org-clock-task-overrun (not org-clock-task-overrun-text))&#xA;                           'org-mode-line-clock-overrun 'org-mode-line-clock)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if it's been overrun, but not &lt;code&gt;org-clock-task-overrun-text&lt;/code&gt; is set, put overrun face.  Put mode line face, otherwise.  That tells you that if you don't want to have different face on overran work, set &lt;code&gt;org-clock-task-overrun-text&lt;/code&gt; to whatever it suits.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;               (effort-str (org-minutes-to-clocksum-string effort-in-minutes))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Third, convert &lt;code&gt;effort-in-minutes&lt;/code&gt; to string.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;               (clockstr (org-propertize&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Fourth, create string format with mode line face. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                          (concat  &quot; [%s/&quot; effort-str&#xA;                                   &quot;] (&quot; (replace-regexp-in-string &quot;%&quot; &quot;%%&quot; org-clock-heading) &quot;)&quot;)&#xA;                          'face 'org-mode-line-clock)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;replace the &lt;code&gt;%&lt;/code&gt; to &lt;code&gt;%%&lt;/code&gt; in the heading because we are creating format string. &lt;code&gt;%&lt;/code&gt; will mess up the format so convert it to literal &lt;code&gt;%&lt;/code&gt;, which is double % &lt;code&gt;%%&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;          (format clockstr work-done-str))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;do the actual format for the work with effort set.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      (org-propertize (concat &quot;[&quot; (org-minutes-to-clocksum-string clocked-time)&#xA;                              (format &quot; (%s)&quot; org-clock-heading) &quot;]&quot;)&#xA;                      'face 'org-mode-line-clock))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or without.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2016-02-22T00:26:41.467" LastActivityDate="2016-02-22T00:26:41.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20465" PostTypeId="1" AcceptedAnswerId="20466" CreationDate="2016-02-21T05:49:20.043" Score="3" ViewCount="1455" Body="&lt;p&gt;How do I append two lists together, and delete duplicates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq list1 (&quot;a&quot; &quot;b&quot; &quot;c&quot;))&#xA;(setq list2 (&quot;b&quot; &quot;c&quot; &quot;d&quot;))&#xA;&#xA;(setq list3 (a b c))&#xA;(setq list4 (c d e))&#xA;&#xA;;; use case&#xA;(append-list-to-list list1 list2) ; (&quot;a&quot; &quot;b&quot; &quot;c&quot; &quot;d&quot;)&#xA;(append-list-to-list list3 list4) ; (a b c d e)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;UPDATE after the &lt;code&gt;cl-union&lt;/code&gt; answer:&lt;/em&gt; I need to preserve the order of the resulting list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And when there is a nested list, how do I append and make element is unique in list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(a (b c) d) or ((a b) c d) etc&#xA;add list (x y z) to list ((a b) c d) to become ((a b x y z) c d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then how to append a new list to upper nested list?&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="105" LastEditDate="2016-03-13T22:03:46.627" LastActivityDate="2016-03-13T22:03:46.627" Title="Append lists smartly?" Tags="|list|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20466" PostTypeId="2" ParentId="20465" CreationDate="2016-02-21T06:04:33.217" Score="1" Body="&lt;p&gt;I think you meant your first case to result in &lt;code&gt;'(a b c d)&lt;/code&gt; but correct me if I'm wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like you're looking for the logical union, this is available as &lt;code&gt;cl-union&lt;/code&gt; or if you want to use the &lt;a href=&quot;https://github.com/magnars/dash.el&quot; rel=&quot;nofollow&quot;&gt;dash.el&lt;/a&gt; library you can use their provided &lt;code&gt;-union&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(cl-union '(a b c) '(b c d)) -&amp;gt; '(a b c d)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11189" LastActivityDate="2016-02-21T06:04:33.217" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20468" PostTypeId="2" ParentId="17695" CreationDate="2016-02-21T08:30:32.757" Score="1" Body="&lt;p&gt;With code newer than the documentation you found, you &lt;em&gt;can&lt;/em&gt; set up &lt;code&gt;(*&lt;/code&gt; to automatically insert the pair &lt;code&gt;*)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;(*&quot; &quot;*)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But we can actually do better, and tell smartparens to, upon insertion, add spaces, and put point between them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;(*&quot; &quot;*)&quot; :post-handlers '(:add &quot; | &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Permissions&quot; rel=&quot;nofollow&quot;&gt;some documentation&lt;/a&gt; on this, but I find it somewhat confusing. At least for this use case, it's not too complicated.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-02-21T08:30:32.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20469" PostTypeId="2" ParentId="16882" CreationDate="2016-02-21T08:40:30.057" Score="1" Body="&lt;p&gt;It looks like ggtags &lt;a href=&quot;https://github.com/leoliu/ggtags/blob/master/ggtags.el#L1739&quot; rel=&quot;nofollow&quot;&gt;rebinds M-&amp;lt;&lt;/a&gt; to &lt;code&gt;#'first-error&lt;/code&gt; in the keymap &lt;code&gt;ggtags-navigation-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we can unbind it there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ggtags-navigation-map (kbd &quot;M-&amp;lt;&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And bind something else to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ggtags-navigation-map (kbd &quot;C-M-&amp;lt;&quot;) #'first-error)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, you can pick another keybinding, as you prefer.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-02-21T08:40:30.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20470" PostTypeId="2" ParentId="20465" CreationDate="2016-02-21T12:07:10.267" Score="8" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/append.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;append&lt;/code&gt;&lt;/a&gt; does what the first part of your question asks:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(append &amp;amp;rest SEQUENCES)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Concatenate all the arguments and make the result a list.&#xA;  The result is a list whose elements are the elements of all the arguments.&#xA;  Each argument may be a list, vector or string.&#xA;  The last argument is not copied, just used as the tail of the new list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sets-And-Lists.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;delete-dups&lt;/code&gt;&lt;/a&gt; does what the second part of your question asks:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(delete-dups LIST)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Destructively remove &lt;code&gt;equal&lt;/code&gt; duplicates from LIST.&#xA;  Store the result in LIST and return it.  LIST must be a proper list.&#xA;  Of several &lt;code&gt;equal&lt;/code&gt; occurrences of an element in LIST, the first&#xA;  one is kept.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq temp1 '(a b c))&#xA;(setq temp2 '(c d e))&#xA;&#xA;(append temp1 temp2)                ; =&amp;gt; (a b c c d e)&#xA;(delete-dups (append temp1 temp2))  ; =&amp;gt; (a b c d e)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are also Common Lisp options in the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/cl/&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;cl-lib&lt;/code&gt;&lt;/a&gt; library, if you're interested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did not understand what you meant in your question update about nested lists.  Let me suggest you remove the nested lists from this question and post it as a separate question.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-03-04T13:34:50.280" LastActivityDate="2016-03-04T13:34:50.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20471" PostTypeId="1" CreationDate="2016-02-21T12:44:59.863" Score="7" ViewCount="627" Body="&lt;p&gt;Hello good people of Emacs!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To insert unicode math symbols I use &lt;strong&gt;TeX input method&lt;/strong&gt;. This way I get unicode character &lt;code&gt;ℝ&lt;/code&gt; by typing &lt;code&gt;\Bbb{R}&lt;/code&gt;, &lt;code&gt;ℕ&lt;/code&gt; by typing &lt;code&gt;\Bbb{N}&lt;/code&gt;, &lt;code&gt;ℤ&lt;/code&gt; by typing &lt;code&gt;\Bbb{Z}&lt;/code&gt;, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I'm unable to get&lt;/strong&gt; symbol &lt;code&gt;ℚ&lt;/code&gt;, since typing &lt;code&gt;\Bbb{Q}&lt;/code&gt; does not insert unicode character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any Ideas what can be the source of this error? &lt;/p&gt;&#xA;" OwnerUserId="6527" LastActivityDate="2016-02-23T07:28:04.503" Title="Inserting unicode symbol for rational numbers ℚ using TeX input method" Tags="|latex|unicode|tex|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20472" PostTypeId="1" CreationDate="2016-02-21T14:41:43.197" Score="8" ViewCount="2185" Body="&lt;p&gt;Currently, I'm inserting unicode characters (mainly math symbols) using TeX input method.  This is cumbersome, since, for each character, I have to do following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Switch to TeX input method pressing &lt;code&gt;C-\&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;type latex expression like &lt;code&gt;\Bbb{R}&lt;/code&gt; or &lt;code&gt;\Leftrightarrow&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There is relatively small subset of unicode characters (10-20) I am inserting all the time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there way to insert unicode characters with few (2-4) keystrokes?&lt;/p&gt;&#xA;" OwnerUserId="6527" LastEditorUserId="105" LastEditDate="2022-11-11T18:04:18.503" LastActivityDate="2022-11-11T18:04:18.503" Title="Fast unicode symbol insertion?" Tags="|unicode|characters|insert-char|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20473" PostTypeId="2" ParentId="20463" CreationDate="2016-02-21T15:30:06.787" Score="3" Body="&lt;p&gt;The error you get is thrown by &lt;code&gt;org-agenda-goto&lt;/code&gt; when it can't find an agenda entry corresponding to point.  After some further investigation, it looks like this is because the function is actually &lt;em&gt;not called from the agenda&lt;/em&gt;, but rather from the file containing the entry.  That is, you're already where &lt;code&gt;org-agenda-goto&lt;/code&gt; would put you, so you don't need either that or the &lt;code&gt;save-window-excursion&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun show-exclamation-if-important () &#xA;  (if (org-entry-properties (point) &quot;important&quot;) &quot;!&quot; &quot; &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-02-21T15:30:06.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20474" PostTypeId="2" ParentId="19296" CreationDate="2016-02-21T16:28:33.963" Score="1" Body="&#xA;&#xA;&lt;p&gt;I've kludged together a solution; posting it here for the edification of anyone who might find it handy. It's a complete redefinition of &lt;code&gt;fill-newline&lt;/code&gt; which adds a space at the end, and it almost certainly breaks some &lt;em&gt;other&lt;/em&gt; things, but since I use it in a very limited context, it doesn't seem to end up causing trouble. Duplicate at your own risk, of course. I added the following to my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-message-configuration ()&#xA;  &quot;Redefines fill-newline to beahve 3676ishly, and turns off auto fill&quot;&#xA;  (turn-off-auto-fill)&#xA;(defun fill-newline ()&#xA;  ;; Replace whitespace here with one newline, then&#xA;  ;; indent to left margin.&#xA;  (skip-chars-backward &quot; \t&quot;)&#xA;  (insert ?\s)&#xA;  (insert ?\n)&#xA;  ;; Give newline the properties of the space(s) it replaces&#xA;  (set-text-properties (1- (point)) (point)&#xA;               (fill-text-properties-at (point)))&#xA;  (and (looking-at &quot;\\( [ \t]*\\)\\(\\c|\\)?&quot;)&#xA;       (or (aref (char-category-set (or (char-before (1- (point))) ?\000)) ?|)&#xA;       (match-end 2))&#xA;       ;; When refilling later on, this newline would normally not be replaced&#xA;       ;; by a space, so we need to mark it specially to re-install the space&#xA;       ;; when we unfill.&#xA;       (put-text-property (1- (point)) (point) 'fill-space (match-string 1)))&#xA;  ;; If we don't want breaks in invisible text, don't insert&#xA;  ;; an invisible newline.&#xA;  (if fill-nobreak-invisible&#xA;      (remove-text-properties (1- (point)) (point)&#xA;                  '(invisible t)))&#xA;  (if (or fill-prefix&#xA;      (not fill-indent-according-to-mode))&#xA;      (fill-indent-to-left-margin)&#xA;    (indent-according-to-mode))&#xA;  ;; Insert the fill prefix after indentation.&#xA;  (and fill-prefix (not (equal fill-prefix &quot;&quot;))&#xA;       ;; Markers that were after the whitespace are now at point: insert&#xA;       ;; before them so they don't get stuck before the prefix.&#xA;       (insert-before-markers-and-inherit fill-prefix)))&#xA;)&#xA;&#xA;(add-hook 'message-mode-hook 'my-message-configuration)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only real change this makes to fill-newline is the &lt;code&gt;(insert ?\s)&lt;/code&gt; before the newline insert. As I said, an ugly hack which might well break any other code which expects &lt;code&gt;fill-newline&lt;/code&gt; to behave conventionally, and I'd welcome a less dirty way to achieve the same result, but for now this works.&lt;/p&gt;&#xA;" OwnerUserId="10681" LastEditorUserId="115" LastEditDate="2016-07-21T12:45:14.713" LastActivityDate="2016-07-21T12:45:14.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20475" PostTypeId="2" ParentId="20472" CreationDate="2016-02-21T17:09:33.947" Score="6" Body="&lt;p&gt;You can define your own key sequences with the elisp functions &lt;code&gt;global-set-key&lt;/code&gt; and &lt;code&gt;local-set-key&lt;/code&gt;.&#xA;Thereby, it is recommended to use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html#Key-Binding-Conventions&quot; rel=&quot;noreferrer&quot;&gt;&lt;kbd&gt;C-c&lt;/kbd&gt; and a single letter&lt;/a&gt; for user defined key sequences.&#xA;(Otherwise it may be that you override key-sequences bound by other emacs-lisp libraries. Later you get into trouble when you discover that the library version of the key sequence would be very useful for you.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use these sequences independent of the major mode you can bind them globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an example you can add&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c a&quot;) &quot;⇔&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to your configuration file &lt;code&gt;~/.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use these keys depending on the major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-latex-hook-function () (local-set-key (kbd &quot;C-c a&quot;) &quot;⇔&quot;))&#xA;(add-hook 'TeX-mode-hook 'my-latex-hook-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works with &lt;code&gt;auctex&lt;/code&gt;. If you are using the native &lt;code&gt;tex-mode&lt;/code&gt; or &lt;code&gt;latex-mode&lt;/code&gt; it might be that you have to replace &lt;code&gt;TeX-mode-hook&lt;/code&gt; by &lt;code&gt;tex-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note, that there is also &lt;code&gt;insert-char&lt;/code&gt; bound to &lt;kbd&gt;C-x 8 RET&lt;/kbd&gt;.&#xA;Therewith you can input utf8-characters if you know their code.&#xA;If you do not know the code you can input them by their description but that becomes cumbersome.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There are also special modes supporting the user with the input of latex symbols, such as &lt;a href=&quot;https://github.com/vspinu/company-math&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;company-math&lt;/code&gt;-Mode&lt;/a&gt; and &lt;a href=&quot;https://github.com/vspinu/ac-math&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;ac-math&lt;/code&gt;-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both of them are completion modes. &lt;code&gt;company&lt;/code&gt; works with mouse menus and &lt;code&gt;ac&lt;/code&gt; (autocomplete) works with the &lt;kbd&gt;tab&lt;/kbd&gt;-key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am not sure about the current status of these packages.&#xA;You can install these modes per melpa if you want to try them.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-02-22T07:26:35.463" LastActivityDate="2016-02-22T07:26:35.463" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20476" PostTypeId="1" CreationDate="2016-02-21T19:21:46.383" Score="6" ViewCount="983" Body="&lt;p&gt;When I turn on &lt;code&gt;linum-mode&lt;/code&gt; or &lt;code&gt;nlinum-mode&lt;/code&gt;and increase the font size via &lt;code&gt;C-x C-+&lt;/code&gt; it does not increase the size of the &quot;margin&quot; where the line number is displayed, so only part of the line number is visible. Is there a way to configure either of these modes so that the entire line number is always visible regardless of font size? Tested using emacs 24.5 on OS X and emacs 24.3.1 on ubuntu 14.04&lt;/p&gt;&#xA;" OwnerUserId="8921" LastActivityDate="2019-09-15T09:04:42.177" Title="Line number (linum, nlinum) grow margin with increase in font size" Tags="|linum-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20477" PostTypeId="1" AcceptedAnswerId="20478" CreationDate="2016-02-21T21:01:05.987" Score="3" ViewCount="1684" Body="&lt;p&gt;I've enabled some new packages in bbatsov's prelude and when I restart the emacs daemon, it hangs endlessly starting up showing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Prelude is powering up... Be patient, Master g!&#xA;Loading personal configuration files in /Users/g/.emacs.d/personal/preload...&#xA;Loading Prelude's core...&#xA;Loading /Users/g/.emacs.d/savefile/recentf...&#xA;Loading /Users/g/.emacs.d/savefile/recentf...done&#xA;Loading Prelude's modules...&#xA;Loading /Users/g/.emacs.d/prelude-modules.el (source)...&#xA;Contacting host: melpa.org:443&#xA;Opening TLS connection to `melpa.org'...&#xA;Opening TLS connection with `gnutls-cli --insecure -p 443 melpa.org'...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the problem exactly? I can access &lt;code&gt;https://melpa.org/&lt;/code&gt; without any problems. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any workarounds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&lt;/p&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2018-10-20T22:22:51.757" Title="TLS connection to Melpa.org hanging on prelude" Tags="|package-repositories|prelude|gnutls|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20478" PostTypeId="2" ParentId="20477" CreationDate="2016-02-21T21:17:44.707" Score="4" Body="&lt;p&gt;I got around this by first starting emacs with &lt;code&gt;emacs --insecure&lt;/code&gt; and once that worked and downloaded and what it needed, I was able to start &lt;code&gt;emacs --daemon&lt;/code&gt; fine.&lt;/p&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2016-02-21T21:17:44.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20479" PostTypeId="2" ParentId="16977" CreationDate="2016-02-21T21:36:11.220" Score="3" Body="&lt;p&gt;&lt;em&gt;I'm a beginner when it comes to Emacs (Lisp) but the following seems to work (at least for me). I'm also using the Spacemacs configuration framework so there's a possibility of some stuff being Spacemacs-only (feel free to edit such stuff).&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For those not yet familiar with imaxima, it's an Emacs package that comes prepackaged with Maxima. To start using it, add the folder in which the scripts reside to your &lt;code&gt;load-path&lt;/code&gt; and load the necessary files, like this (you may have to adapt the path) (taken from the &lt;a href=&quot;https://www.emacswiki.org/emacs/MaximaMode&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/usr/local/share/maxima/5.18.1/emacs/&quot;)&#xA;(autoload 'imaxima &quot;imaxima&quot; &quot;Frontend for maxima with Image support&quot; t)&#xA;(autoload 'imath-mode &quot;imath&quot; &quot;Imath mode for math formula input&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll also want to set a few variables since the rendered output is pretty small (at least to me) and because you want imaxima to use the &lt;em&gt;*maxima*&lt;/em&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq imaxima-use-maxima-mode-flag t)&#xA;(setq imaxima-fnt-size &quot;large&quot;)&#xA;(setq imaxima-pt-size 12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From my experimenting and poking around, I conluded that &lt;code&gt;imaxima-use-maxima-mode-flag&lt;/code&gt; only makes imaxima use the &lt;em&gt;*maxima*&lt;/em&gt; buffer instead of its own &lt;em&gt;*imaxima*&lt;/em&gt;. That's pretty much it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if maxima hasn't been started, &lt;code&gt;imaxima&lt;/code&gt; will start maxima, switch to &lt;em&gt;*maxima*&lt;/em&gt; (assuming &lt;code&gt;imaxima-use-maxima-mode-flag&lt;/code&gt; has been set) and load the appropriate code that is used to render the LaTeX maxima outputs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;However&lt;/strong&gt;, if maxima &lt;strong&gt;has been already been started using &lt;code&gt;maxima-start&lt;/code&gt; (which is automatically run for you when you call &lt;code&gt;maxima-display-buffer&lt;/code&gt; and maxima isn't running)&lt;/strong&gt;, &lt;code&gt;imaxima&lt;/code&gt; will do nothing but switch to the &lt;em&gt;*maxima*&lt;/em&gt; buffer (again, assuming &lt;code&gt;imaxima-use-maxima-mode-flag&lt;/code&gt; has been set), i.e. the LaTeX rendering code won't be loaded (unless you loaded it yourself manually or something).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to this is to always run &lt;code&gt;imaxima&lt;/code&gt; (&lt;strong&gt;with&lt;/strong&gt; the &lt;code&gt;imaxima-use-maxima-mode-flag&lt;/code&gt; set) first and only then run &lt;code&gt;maxima-display-buffer&lt;/code&gt;. Since the flag is active, &lt;code&gt;imaxima&lt;/code&gt; will start and load the necessary code inside &lt;em&gt;*maxima*&lt;/em&gt; which &lt;code&gt;maxima-display-buffer&lt;/code&gt; will subsequently switch to and to which other &lt;code&gt;maxima-*&lt;/code&gt; commands will send expressions to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, &lt;code&gt;maxima-display-buffer&lt;/code&gt; is bound to &lt;code&gt;C-c C-p&lt;/code&gt; and I've bound &lt;code&gt;imaxima&lt;/code&gt; to &lt;code&gt;C-c C-o&lt;/code&gt; with the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'maxima-mode-hook&#xA;          (lambda ()&#xA;            (define-key maxima-mode-map (kbd &quot;C-c C-o&quot;) 'imaxima)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried redefining the original &lt;code&gt;maxima-display-buffer&lt;/code&gt; to first run &lt;code&gt;imaxima&lt;/code&gt; and then the original &lt;code&gt;maxima-display-buffer&lt;/code&gt; but I failed. I'm not really sure how to go about doing that yet so if anyone has any ideas, feel free to comment/edit this answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now, whenever I want to interactively evaluate maxima code I'll first run &lt;code&gt;imaxima&lt;/code&gt; (using &lt;code&gt;C-c C-o&lt;/code&gt;) and only after that use the &lt;code&gt;maxima-*&lt;/code&gt; commands (such as &lt;code&gt;maxima-display-buffer&lt;/code&gt;, &lt;code&gt;maxima-send-line&lt;/code&gt;, etc.).&lt;/p&gt;&#xA;" OwnerUserId="11199" LastActivityDate="2016-02-21T21:36:11.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20480" PostTypeId="2" ParentId="20472" CreationDate="2016-02-21T22:32:31.047" Score="3" Body="&lt;p&gt;You say: &lt;em&gt;There is relatively small subset of unicode characters (I'm guessing 10-20) I am inserting all the time.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, as @Tobias indicated, you can just bind, for each of them, a simple key sequence to either (a) a command that inserts that character or (b) a single-character string with that character (this acts like a keyboard macro, to insert the character).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/ucs-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;ucs-cmds.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; can help you define such commands. The resulting commands have the same names as the characters. You can use macro &lt;code&gt;ucsc-make-commands&lt;/code&gt; to define a whole set of commands that insert a character of a certain kind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you can put this in your init file to define commands that insert all of the Unicode math symbols:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ucs-cmds)           ; Load the library&#xA;(ucsc-make-commands &quot;^math&quot;)  ; Use the macro to create commands&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That gives you commands whose names are the same as the math characters. Bind any of these that you use a lot to easy-to-use-keys. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c S&quot;) 'mathematical-bold-capital-sigma)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Or bind a key to such a command only in Tex mode, using &lt;code&gt;define-key&lt;/code&gt; with its keymap.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With just that simple &lt;code&gt;(ucsc-make-commands &quot;^math&quot;)&lt;/code&gt; you have available all of the character-inserting commands that are listed below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also other Unicode characters, whose names do not start with &lt;code&gt;math&lt;/code&gt; but which are used in mathematics - for example, character &lt;code&gt;PARTIAL DIFFERENTIAL&lt;/code&gt;. You can easily create commands that insert any of those characters too. (And note that the characters whose names start with &lt;code&gt;math&lt;/code&gt; might well require using a special font - many fonts do not support them.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course use a tighter regular expression than &lt;code&gt;^math&lt;/code&gt;, if you want to define only characters matching such a pattern. For example, this defines commands for all of the partial-differential characters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ucsc-make-commands &quot;^math.*partial differential&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That gives you these commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-italic-partial-differential&#xA;mathematical-bold-partial-differential&#xA;mathematical-italic-partial-differential&#xA;mathematical-sans-serif-bold-italic-partial-differential&#xA;mathematical-sans-serif-bold-partial-differential&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the Unicode character names separate words with space characters, and the names are uppercase. The corresponding insertion commands use hyphens instead of spaces and lowercase instead of uppercase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One advantage of having commands named after chars they insert, instead of, say, just binding keys to singleton strings of the characters, is that you can use &lt;code&gt;M-x&lt;/code&gt; to enter characters that you use less often, by name using completion. Instead of completing against the entire set of Unicode character names, you complete against the names of character-inserting commands you have defined.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;These are the commands that insert characters whose names start with &lt;code&gt;math&lt;/code&gt;. They are what you get by evaluating &lt;code&gt;(ucsc-make-commands &quot;^math&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-capital-a&#xA;mathematical-bold-capital-alpha&#xA;mathematical-bold-capital-b&#xA;mathematical-bold-capital-beta&#xA;mathematical-bold-capital-c&#xA;mathematical-bold-capital-chi&#xA;mathematical-bold-capital-d&#xA;mathematical-bold-capital-delta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-digit-eight&#xA;mathematical-bold-digit-five&#xA;mathematical-bold-digit-four&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-epsilon-symbol&#xA;mathematical-bold-fraktur-capital-a&#xA;mathematical-bold-fraktur-capital-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-fraktur-small-a&#xA;mathematical-bold-fraktur-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-italic-capital-a&#xA;mathematical-bold-italic-capital-alpha&#xA;mathematical-bold-italic-capital-b&#xA;mathematical-bold-italic-capital-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-italic-nabla&#xA;mathematical-bold-italic-partial-differential&#xA;mathematical-bold-italic-phi-symbol&#xA;mathematical-bold-italic-pi-symbol&#xA;mathematical-bold-italic-rho-symbol&#xA;mathematical-bold-italic-small-a&#xA;mathematical-bold-italic-small-alpha&#xA;mathematical-bold-italic-small-b&#xA;mathematical-bold-italic-small-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-nabla&#xA;mathematical-bold-partial-differential&#xA;mathematical-bold-phi-symbol&#xA;mathematical-bold-pi-symbol&#xA;mathematical-bold-rho-symbol&#xA;mathematical-bold-script-capital-a&#xA;mathematical-bold-script-capital-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-script-small-a&#xA;mathematical-bold-script-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-bold-small-a&#xA;mathematical-bold-small-alpha&#xA;mathematical-bold-small-b&#xA;mathematical-bold-small-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-double-struck-capital-a&#xA;mathematical-double-struck-capital-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-double-struck-digit-eight&#xA;mathematical-double-struck-digit-five&#xA;mathematical-double-struck-digit-four&#xA;mathematical-double-struck-digit-nine&#xA;mathematical-double-struck-digit-one&#xA;mathematical-double-struck-digit-seven&#xA;mathematical-double-struck-digit-six&#xA;mathematical-double-struck-digit-three&#xA;mathematical-double-struck-digit-two&#xA;mathematical-double-struck-digit-zero&#xA;mathematical-double-struck-small-a&#xA;mathematical-double-struck-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-falling-diagonal&#xA;mathematical-fraktur-capital-a&#xA;mathematical-fraktur-capital-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-fraktur-small-a&#xA;mathematical-fraktur-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-italic-capital-a&#xA;mathematical-italic-capital-alpha&#xA;mathematical-italic-capital-b&#xA;mathematical-italic-capital-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-italic-nabla&#xA;mathematical-italic-partial-differential&#xA;mathematical-italic-phi-symbol&#xA;mathematical-italic-pi-symbol&#xA;mathematical-italic-rho-symbol&#xA;mathematical-italic-small-a&#xA;mathematical-italic-small-alpha&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-italic-small-dotless-i&#xA;mathematical-italic-small-dotless-j&#xA;mathematical-italic-small-e&#xA;mathematical-italic-small-epsilon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-italic-small-final-sigma&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-left-angle-bracket&#xA;mathematical-left-double-angle-bracket&#xA;mathematical-left-flattened-parenthesis&#xA;mathematical-left-white-square-bracket&#xA;mathematical-left-white-tortoise-shell-bracket&#xA;mathematical-monospace-capital-a&#xA;mathematical-monospace-capital-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-monospace-digit-eight&#xA;mathematical-monospace-digit-five&#xA;mathematical-monospace-digit-four&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-monospace-small-a&#xA;mathematical-monospace-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-right-angle-bracket&#xA;mathematical-right-double-angle-bracket&#xA;mathematical-right-flattened-parenthesis&#xA;mathematical-right-white-square-bracket&#xA;mathematical-right-white-tortoise-shell-bracket&#xA;mathematical-rising-diagonal&#xA;mathematical-sans-serif-bold-capital-a&#xA;mathematical-sans-serif-bold-capital-alpha&#xA;mathematical-sans-serif-bold-capital-b&#xA;mathematical-sans-serif-bold-capital-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-digit-eight&#xA;mathematical-sans-serif-bold-digit-five&#xA;mathematical-sans-serif-bold-digit-four&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-italic-capital-a&#xA;mathematical-sans-serif-bold-italic-capital-alpha&#xA;mathematical-sans-serif-bold-italic-capital-b&#xA;mathematical-sans-serif-bold-italic-capital-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-italic-nabla&#xA;mathematical-sans-serif-bold-italic-partial-differential&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-italic-small-a&#xA;mathematical-sans-serif-bold-italic-small-alpha&#xA;mathematical-sans-serif-bold-italic-small-b&#xA;mathematical-sans-serif-bold-italic-small-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-italic-small-final-sigma&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-nabla&#xA;mathematical-sans-serif-bold-partial-differential&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-small-a&#xA;mathematical-sans-serif-bold-small-alpha&#xA;mathematical-sans-serif-bold-small-b&#xA;mathematical-sans-serif-bold-small-beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-bold-small-final-sigma&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-capital-a&#xA;mathematical-sans-serif-capital-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-digit-eight&#xA;mathematical-sans-serif-digit-five&#xA;mathematical-sans-serif-digit-four&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-italic-capital-a&#xA;mathematical-sans-serif-italic-capital-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-italic-small-a&#xA;mathematical-sans-serif-italic-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-sans-serif-small-a&#xA;mathematical-sans-serif-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-script-capital-a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mathematical-script-small-a&#xA;mathematical-script-small-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-21T22:53:03.627" LastActivityDate="2016-02-21T22:53:03.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20481" PostTypeId="1" AcceptedAnswerId="20484" CreationDate="2016-02-21T22:39:21.917" Score="5" ViewCount="1811" Body="&lt;p&gt;You can place a pointer on a number, like &lt;code&gt;1&lt;/code&gt;, and increment it to &lt;code&gt;2&lt;/code&gt;.&#xA;There are many alternatives on this. See also the Emacs Wiki:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/IncrementNumber&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/IncrementNumber&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;7 alternatives to increment a number under the pointer!&#xA;But there is a thing that I still miss.&#xA;In Vim, you can increment the number/character under the pointer whether it's a character or a number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incrementing an &lt;code&gt;A&lt;/code&gt; turns into a &lt;code&gt;B&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incrementing a &lt;code&gt;1&lt;/code&gt; turns into a &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs seems be to able to increment numbers only, from what I found on Emacs Wiki. Is there any way to dinstinct characters from numbers and increment them accordingly?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="105" LastEditDate="2016-03-13T22:03:27.877" LastActivityDate="2018-05-19T16:58:45.297" Title="Incrementing characters in Emacs, next to numbers?" Tags="|text-editing|formatting|keyboard-macros|characters|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20483" PostTypeId="2" ParentId="20472" CreationDate="2016-02-22T00:23:49.780" Score="6" Body="&lt;p&gt;You can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;abbrev-mode&lt;/code&gt;&lt;/a&gt; to create strings that &quot;expand&quot; to the unicode characters you want.  For example, the following &lt;code&gt;abbrev&lt;/code&gt; table defines abbrevs for the first three lowercase letters of the Greek alphabet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'unicode-table&#xA;  '((&quot;ualpha&quot; &quot;α&quot;)&#xA;    (&quot;ubeta&quot;  &quot;β&quot;)&#xA;    (&quot;ugamma&quot; &quot;γ&quot;))&#xA;    &quot;Unicode characters I use all the time.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then tell &lt;code&gt;text-mode&lt;/code&gt; (or whatever other modes you want) to inherit your unicode table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'text-mode-abbrev-table&#xA;  nil&#xA;  &quot;Text mode abbrev table.&quot;&#xA;  :parents (list unicode-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Go to a buffer in text mode.  Turn on &lt;code&gt;abbrev-mode&lt;/code&gt;.  Type in &lt;code&gt;ualpha&lt;/code&gt; and a non-word character (space, period, etc.), and watch it expand to α.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-02-22T00:23:49.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20484" PostTypeId="2" ParentId="20481" CreationDate="2016-02-22T00:29:07.950" Score="6" Body="&lt;p&gt;Characters &lt;strong&gt;&lt;em&gt;are&lt;/em&gt;&lt;/strong&gt; numbers (non-negative integers under some limit), in Emacs. If you want to increment a single character, including a digit character, then just increment it &lt;em&gt;as&lt;/em&gt; a character:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun increment-char-at-point ()&#xA;  &quot;Increment number or character at point.&quot;&#xA;  (interactive)&#xA;  (condition-case nil&#xA;      (save-excursion&#xA;        (let ((chr  (1+ (char-after))))&#xA;          (unless (characterp chr) (error &quot;Cannot increment char by one&quot;))&#xA;          (delete-char 1)&#xA;          (insert chr)))&#xA;    (error (error &quot;No character at point&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if you want to increment either a sequence of digits (a numeral) or a single character, then use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun increment-number-or-char-at-point ()&#xA;  &quot;Increment number or character at point.&quot;&#xA;  (interactive)&#xA;  (let ((nump  nil))&#xA;    (save-excursion&#xA;      (skip-chars-backward &quot;0123456789&quot;)&#xA;      (when (looking-at &quot;[0123456789]+&quot;)&#xA;        (replace-match (number-to-string (1+ (string-to-number (match-string 0)))))&#xA;        (setq nump  t)))&#xA;    (unless nump&#xA;      (save-excursion&#xA;        (condition-case nil&#xA;            (let ((chr  (1+ (char-after))))&#xA;              (unless (characterp chr) (error &quot;Cannot increment char by one&quot;))&#xA;              (delete-char 1)&#xA;              (insert chr))&#xA;          (error (error &quot;No character at point&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want point to advance after the command, remove the uses of &lt;code&gt;save-excursion&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code inside the first &lt;code&gt;save-excursion&lt;/code&gt; here is from the first &lt;code&gt;increment-number-at-point&lt;/code&gt; definition at the wiki page you referenced. Choose different increment-number code for that if you prefer. Note that the increment-number code shown here takes no account of decimal or exponential format, or other bases besides base 10.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-22T00:57:05.523" LastActivityDate="2016-02-22T00:57:05.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20485" PostTypeId="1" CreationDate="2016-02-22T01:55:24.527" Score="7" ViewCount="2365" Body="&lt;p&gt;I would like to be able to prevent company mode from automatically suggesting a specific backend (namely &lt;code&gt;company-dabbrev)&lt;/code&gt; when in a specific mode (using &lt;code&gt;text-mode-hook&lt;/code&gt;), however I don't want want to remove this backend from &lt;code&gt;company-backends&lt;/code&gt; as I still want to include to get its completions when I manually invoke &lt;code&gt;company-complete-common-or-cycle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how would I go about excluding a backend from autocompleting on text input without excluding it entirely from &lt;code&gt;company-backends&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The motivation for this is that I find autocompletion on arbitrary words I'm typing in a text document distracting, but I do want to keep autocompletions such as latex environments, as these are quite handy. I do however sometimes want manual autocompletion for when I'm typing a long word that I've forgotten how to spell, but I know I've typed before.)&lt;/p&gt;&#xA;" OwnerUserId="10780" LastActivityDate="2022-05-12T09:00:39.450" Title="How to exclude a company-backend from autocompleting without globally removing it" Tags="|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20487" PostTypeId="2" ParentId="20485" CreationDate="2016-02-22T05:04:30.080" Score="6" Body="&lt;p&gt;see &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/112&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/company-mode/company-mode/issues/112&lt;/a&gt; @dgutov comment.&lt;/p&gt;&#xA;&lt;p&gt;Make the &lt;code&gt;company-dabbrev&lt;/code&gt; the last element in &lt;code&gt;company-backends&lt;/code&gt;.&#xA;completion of previous backends will block company-dabbrev.&lt;/p&gt;&#xA;&lt;p&gt;I usually place &lt;code&gt;company-ispell&lt;/code&gt; at the beginning of the &lt;code&gt;company-backends&lt;/code&gt; in &lt;code&gt;text-mode-hook&lt;/code&gt; which blocks other backends in most cases.&lt;/p&gt;&#xA;&lt;p&gt;If your want to remove/add backends instead of tweaking the priority of backends.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun company-my-setup ()&#xA;  (when (boundp 'company-backends)&#xA;    (make-local-variable 'company-backends)&#xA;    ;; remove&#xA;    (setq company-backends (delete 'company-dabbrev company-backends))&#xA;    ;; add&#xA;    (add-to-list 'company-backends 'company-dabbrev)))&#xA;&#xA;(add-hook 'latex-major-mode-hook 'company-my-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2022-05-12T09:00:39.450" LastActivityDate="2022-05-12T09:00:39.450" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="20488" PostTypeId="1" AcceptedAnswerId="20664" CreationDate="2016-02-22T06:10:19.777" Score="4" ViewCount="3213" Body="&lt;p&gt;With org-mode 8.2.10 on Emacs 24.5.1, the following will produce a ditaa figure in the exported PDF (LaTeX):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ditaa :file foo.png :cmdline -E -s 4 -S&#xA;+---------+&#xA;| testing |&#xA;+---------+&#xA;#+END_SRC&#xA;#+CAPTION: ditaa caption&#xA;#+LABEL: fig:ditaa&#xA;#+attr_latex: :width 1in&#xA;#+RESULTS:&#xA;[[file:foo.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I try to do the same thing but using tikz to generate a figure, it does not work.  The following example (copied from &lt;a href=&quot;http://orgmode.org/tmp/worg/org-contrib/babel/languages/ob-doc-LaTeX.html#sec-4_2_2&quot; rel=&quot;nofollow&quot;&gt;the org-mode documentation&lt;/a&gt;) simply produces a PDF containing the string &quot;[[file:fsa.pdf]]&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src latex :file fsa.pdf :packages '((&quot;&quot; &quot;tikz&quot;)) :border 1em&#xA;  % Define block styles&#xA;  \usetikzlibrary{shapes,arrows}&#xA;  \tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize, fill=blue!25]&#xA;  \tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize, fill=red!25]&#xA;&#xA;  \begin{tikzpicture}[-&amp;gt;,&amp;gt;=stealth', shorten &amp;gt;=1pt, auto, node distance=2.8cm, semithick]&#xA;    \node [astate] (1) at (0,0) {1};&#xA;    \node [astate] (2) at (1,0) {2};&#xA;    \node [rstate] (3) at (2,0) {3};&#xA;    \path (1) edge [bend left] node {b} (2)&#xA;          (2) edge node {b} (3)&#xA;          (2) edge [bend left] node {a} (1)&#xA;          (3) edge [loop above] node {(a, b)} (3);&#xA;  \end{tikzpicture}&#xA;#+end_src&#xA;#+CAPTION: tikz caption&#xA;#+LABEL: fig:tikz&#xA;#+RESULTS:&#xA;[[file:fsa.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I generate a floating tikz figure without manually using &lt;code&gt;\begin{figure}...\end{figure}&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6898" LastActivityDate="2016-02-29T20:12:47.857" Title="How do I create a floating tikz figure when exporting to PDF in org-mode?" Tags="|org-mode|org-export|latex|org-babel|pdf|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20489" PostTypeId="2" ParentId="20471" CreationDate="2016-02-22T07:37:43.710" Score="7" Body="&lt;p&gt;The character set used is in the ISO 10646 encoding, which includes the following double stroked letters&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C H N P Q R Z&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and no others.  Unfortunately the TeX input method only defines shortcuts for &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N P R Z&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as &lt;code&gt;describe-input-encoding&lt;/code&gt; will tell you.  However, &lt;a href=&quot;https://emacs.stackexchange.com/q/3104/2710&quot;&gt;How can I add characters to an input method?&lt;/a&gt; shows you how to add extra sequences to this input encoding.  Thus all you need to know is that double stroked Q is at code point 211A to add this character.  To find the code points for other characters have a look at the ISO 10646 standard at &lt;a href=&quot;http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-23T07:28:04.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20490" PostTypeId="1" AcceptedAnswerId="20551" CreationDate="2016-02-22T08:46:55.417" Score="1" ViewCount="173" Body="&lt;p&gt;When I use regular expressions in &lt;em&gt;helm occur&lt;/em&gt; for narrowing, it does not show line previews&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QIVYH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QIVYH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this normal functioning? If so, are there any workarounds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found out that the error only occurs when I use white characters in a set.&lt;/p&gt;&#xA;" OwnerUserId="10978" LastEditorUserId="10978" LastEditDate="2016-02-23T13:21:39.537" LastActivityDate="2016-02-24T11:15:03.517" Title="Helm would not show line previews if used regexp" Tags="|helm|regular-expressions|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20491" PostTypeId="1" AcceptedAnswerId="20495" CreationDate="2016-02-22T08:55:16.927" Score="3" ViewCount="67" Body="&lt;p&gt;I have some commonly used helm regexp search patterns, can I save them for quick reuse?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe bind them to shortcuts?&lt;/p&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2017-01-03T01:19:17.850" Title="How can I predefine helm search patterns?" Tags="|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20492" PostTypeId="1" CreationDate="2016-02-22T11:02:40.300" Score="18" ViewCount="4294" Body="&lt;p&gt;Emacs is constantly making new windows and it's been ruining my day lately.  How can I tell emacs to use the following policy when creating windows?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Prefer vertical splits&lt;/li&gt;&#xA;&lt;li&gt;Stop doing vertical splits when windows would be less than 80 columns.&lt;/li&gt;&#xA;&lt;li&gt;Stop doing horizontal splits when window would be less than 60 rows.&lt;/li&gt;&#xA;&lt;li&gt;When I reach this 6x6 grid, on my 27&quot; monitor, start reusing windows!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also, I'd prefer my windows to always be balanced, but every split leaves the widow sizes unbalanced.  I'd rather have 3 equally sized windows than 1 large and two which are too small! Is there a setting for this, or a sensible place to put a balance-windows advice?&lt;/p&gt;&#xA;" OwnerUserId="6859" LastActivityDate="2020-04-30T04:01:19.353" Title="How can I get a sensible split-window policy?" Tags="|window-splitting|" AnswerCount="4" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20493" PostTypeId="1" CreationDate="2016-02-22T12:05:58.063" Score="1" ViewCount="630" Body="&lt;p&gt;Using for example &lt;code&gt;serial-term&lt;/code&gt;, or in lisp &lt;code&gt;make-serial-process&lt;/code&gt; one can open a serial port within Emacs. But both will fail if the tty is access on a remote computer thought tramp. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any alternative to using a remote Emacs for this?&lt;/p&gt;&#xA;" OwnerUserId="2237" LastActivityDate="2016-02-22T21:11:25.087" Title="Can Emacs open a serial connection behind tramp?" Tags="|tramp|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20494" PostTypeId="1" AcceptedAnswerId="20496" CreationDate="2016-02-22T14:50:34.710" Score="3" ViewCount="1346" Body="&lt;p&gt;I want to open the currently viewed buffer in an external application using &quot;xdg-open&quot;. What I tried is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(start-process &quot;&quot; nil &quot;xdg-open&quot; (buffer-file-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that only returns &lt;code&gt;#&amp;lt;process &amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I replace &lt;code&gt;&quot;xdg-open&quot;&lt;/code&gt; with the actual application (in my case it's &lt;code&gt;xppaut&lt;/code&gt;) everything works. That seems only to happen with programs that I call through the terminal. If I want to open the currently viewed buffer in another editor, everything works with &lt;code&gt;xdg-open&lt;/code&gt;, i.e. I change the default application for that file extension to &lt;code&gt;gedit&lt;/code&gt; then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But at the same time &lt;code&gt;xdg-open&lt;/code&gt; works when I try to call open a file with &lt;code&gt;xppaut&lt;/code&gt; through Gnome Files (Nautilus). So I'm not really sure if that is an Emacs issue or xdg one.&lt;/p&gt;&#xA;" OwnerUserId="10595" LastActivityDate="2016-02-22T15:14:14.717" Title="Open buffer in external application using xdg-open" Tags="|buffers|files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20495" PostTypeId="2" ParentId="20491" CreationDate="2016-02-22T15:10:34.527" Score="4" Body="&lt;p&gt;In general, you should be able to bind a macro to any key for a specific task as long as you know the corresponding keymap. For example:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key helm-map (kbd &quot;C-c l&quot;) (kbd &quot;../&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;l&lt;/kbd&gt; will enter &lt;code&gt;../&lt;/code&gt; during all helm sessions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to bind it only for a specific helm command, you can look at the various &lt;code&gt;helm-*-map&lt;/code&gt;s available. However, not all helm commands define their own map, so you may need to resort to more extreme measures. If that's the case, a new question may be appropriate.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2017-01-03T01:19:17.850" LastActivityDate="2017-01-03T01:19:17.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20496" PostTypeId="2" ParentId="20494" CreationDate="2016-02-22T15:14:14.717" Score="5" Body="&lt;p&gt;Try this snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun counsel-locate-action-extern (x)&#xA;  &quot;Use xdg-open shell command on X.&quot;&#xA;  (call-process shell-file-name nil&#xA;                nil nil&#xA;                shell-command-switch&#xA;                (format &quot;%s %s&quot;&#xA;                        (if (eq system-type 'darwin)&#xA;                            &quot;open&quot;&#xA;                          &quot;xdg-open&quot;)&#xA;                        (shell-quote-argument x))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The trick is to use &lt;code&gt;shell-file-name&lt;/code&gt; for the process call.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-02-22T15:14:14.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20497" PostTypeId="1" AcceptedAnswerId="20502" CreationDate="2016-02-22T15:59:36.950" Score="1" ViewCount="635" Body="&lt;p&gt;I have the following function defined in my dot-Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun call-shell-refresh-browser ()&#xA;  ;; When pressing 'sf', save the content and refresh the browser&#xA;  (interactive)&#xA;    (save-buffer)&#xA;    (shell-command &quot;python ~/Dropbox/Sys/Linux/chrome-refresh-back-emacs.py&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It saves the buffer in Emacs, then switching to Chrome, reload the webpage and gets back to Emacs. This worked like a charm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until now, I use TRAMP to edit files on a remote machine. When I save it, and call the function &lt;code&gt;call-shell-refresh-browser&lt;/code&gt;, it looks in the remote shell for the script &lt;code&gt;chrome-refresh-back-emacs.py&lt;/code&gt; which don't exists on the remote machine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I tell Emacs/Tramp to switch to the local shell on my machine, when editing a remote file? This is without terminating the current TRAMP session.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-02-22T18:46:58.360" Title="How to tell Emacs/TRAMP to use the local shell, instead the shell of remote machine?" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20498" PostTypeId="1" AcceptedAnswerId="20506" CreationDate="2016-02-22T16:05:51.237" Score="5" ViewCount="3520" Body="&lt;p&gt;I have heard that you can do math in &lt;code&gt;org-mode&lt;/code&gt; through tables, but looking it up comes up with things about LaTeX and other confusing subjects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I want to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |   1   |      2     |   3  |&#xA;|a.b| a1+b1 | a.b1+a2+b2 | etc. |&#xA;| a |   a1  |      a2    | etc. |&#xA;| b |   b1  |      b2    | etc. |&#xA;Total: a.b1, 2, 3, etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I do this? And is it possible?&lt;/p&gt;&#xA;" OwnerUserId="11040" LastEditorUserId="14825" LastEditDate="2022-11-05T01:16:59.573" LastActivityDate="2022-11-05T01:16:59.573" Title="How do I do simple addition in org mode?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20499" PostTypeId="2" ParentId="20498" CreationDate="2016-02-22T17:28:27.163" Score="0" Body="&lt;p&gt;I'll try to explain the first sample in the documentation located here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Basically, you refer to :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a line using @nb_line, &lt;/li&gt;&#xA;&lt;li&gt;a column using  $nb_col&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(at any cell, typing C-c ? will show you it's reference)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then you can create formulae by using the references: for instance, to compute the means of a two fields. Say we have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Student  | Maths | Physics | Mean |&#xA;|----------+-------+---------+------|&#xA;| Bertrand |    13 |      09 |      |&#xA;| Henri    |    15 |      14 |      |&#xA;| Arnold   |    17 |      13 |      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You put the cursor in the first empty cell in the &quot;Mean&quot; column&#xA;and you type &lt;code&gt;=vmean($2..$3)&lt;/code&gt; (without any columns so the formula is applied to the whole column). You eval the formula with &lt;code&gt;C-c C-c&lt;/code&gt; and that's it!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="776" LastEditorUserId="97" LastEditDate="2016-02-22T19:09:38.857" LastActivityDate="2016-02-22T19:09:38.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20500" PostTypeId="1" AcceptedAnswerId="20510" CreationDate="2016-02-22T18:08:52.043" Score="1" ViewCount="148" Body="&lt;p&gt;I'm new to org-mode, so I apologize if this is a silly question, but I couldn't find the answer on my own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports both :results output verbatim code&#xA;sed '/^elts/,$p' -n Heap03.hs&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The goal is to use a shell script to get a block of Haskell code. Unfortunately (though unsurprisingly) the result is interpreted as &lt;em&gt;shell&lt;/em&gt; code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the one hand, I'd be interested in any answer that explains how to programmatically get/generate some text and then treat it as code (for the purposes of highlighting) in an arbitrary language; on the other hand, I'm wondering if there's some additional parameter I can pass to the &lt;code&gt;begin_src&lt;/code&gt; block to control the language of the rendered code separately from the language of the executed code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6761" LastActivityDate="2016-02-23T00:07:28.080" Title="Is there a way to use org-mode to render generated code?" Tags="|org-mode|org-export|org-babel|" AnswerCount="2" CommentCount="0" ClosedDate="2016-02-24T15:40:37.307" ContentLicense="CC BY-SA 3.0" />
  <row Id="20501" PostTypeId="2" ParentId="20500" CreationDate="2016-02-22T18:12:27.013" Score="0" Body="&lt;p&gt;Huh... I thought I'd tried this before and it didn't work...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, one simple solution is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports both :results output verbatim raw&#xA;echo '#+BEGIN_SRC haskell'&#xA;sed '/^elts/,$p' -n Heap03.hs&#xA;echo '#+END_SRC'&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6761" LastActivityDate="2016-02-22T18:12:27.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20502" PostTypeId="2" ParentId="20497" CreationDate="2016-02-22T18:46:58.360" Score="5" Body="&lt;p&gt;You must change &lt;code&gt;default-directory&lt;/code&gt; to be a local file name. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory temporary-file-directory))&#xA;  (shell-command &quot;python ~/Dropbox/Sys/Linux/chrome-refresh-back-emacs.py&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-02-22T18:46:58.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20503" PostTypeId="1" AcceptedAnswerId="20507" CreationDate="2016-02-22T19:17:27.737" Score="3" ViewCount="696" Body="&lt;p&gt;I'd like to start swiper with a filter pre-set on the search -- as if I'd entered a search expression and then used S-SPC (&lt;code&gt;ivy-restrict-to-matches&lt;/code&gt;) to clear the query space to narrow the results down further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(swiper &quot;something to search on here&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I still see &lt;code&gt;something to search on here&lt;/code&gt; in the minibuffer.  How can I get that to go away programmatically?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My use-case is a simple way to navigate functions defined in a file. I defined a regexp that matches the beginning of functions up to the function name -- I'd like to match on this name.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2016-02-23T09:33:14.623" LastActivityDate="2016-02-23T09:48:26.267" Title="How can I start swiper with an initial filter?" Tags="|search|swiper|ivy|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20505" PostTypeId="2" ParentId="20493" CreationDate="2016-02-22T21:11:25.087" Score="2" Body="&lt;p&gt;Tramp doesn't support this, and I have also no plans to implement. But if somebody wants to volunteer an implementation, pls contact me or the the Tramp ML tramp-devel@gnu.org.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-02-22T21:11:25.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20506" PostTypeId="2" ParentId="20498" CreationDate="2016-02-22T21:16:40.073" Score="4" Body="&lt;p&gt;Below are two examples.  The simple one requires more manual labor, but is easier to understand.  The advanced one is more generic, but may be more difficult to understand.&lt;/p&gt;&#xA;&lt;h1&gt;Simple&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;  |        |  1 | 2 | 3    |&#xA;  |--------+----+---+------|&#xA;  | a.b    |  4 | 6 | etc. |&#xA;  | a      |  1 | 2 | etc. |&#xA;  | b      |  3 | 4 | etc. |&#xA;  |--------+----+---+------|&#xA;  | Total: | 10 |   |      |&#xA;  #+TBLFM: @&amp;gt;$2=vsum(@2$2..@2$3)::@2$2=@3$2+@4$2::@2$3=@3$3+@4$3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;::&lt;/code&gt; separate formulas.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$x&lt;/code&gt; column number &lt;code&gt;x&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;@x&lt;/code&gt; row number &lt;code&gt;x&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;@#&lt;/code&gt; current row.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$#&lt;/code&gt; current column.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;@&amp;gt;&lt;/code&gt; last row.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;x..y&lt;/code&gt; range between &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; where &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; designate top-left and bottom-right cells to select.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;vsum&lt;/code&gt; vector-sum, sums all elements of the given vector.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Briefly, what happens here can be described as: take values from second column third and fourth rows, add them together and save the result in the second row of the second column.  Similarly, for the third column.  Sum the second row between second and third columns and save the result in the last row, second column.&lt;/p&gt;&#xA;&lt;h1&gt;Advanced&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;  |        |  1 | 2 |  3 |&#xA;  |--------+----+---+----|&#xA;  | a.b    |  4 | 6 | 11 |&#xA;  | a      |  1 | 2 |  5 |&#xA;  | b      |  3 | 4 |  6 |&#xA;  |--------+----+---+----|&#xA;  | Total: | 21 |   |    |&#xA;  #+TBLFM: @&amp;gt;$2=vsum(@2$2..@2$4)::@2$2..@2$4=vsum(trn(pack([2, 3], @3$2..@4$4))_($#-1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;trn&lt;/code&gt; transpose matrix.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;pack&lt;/code&gt; in this particular case it will rearrange the elements of the vector into a 2-by-3 matrix.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;x_y&lt;/code&gt; access element of &lt;code&gt;x&lt;/code&gt; at coordinates given by &lt;code&gt;y&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Briefly, this extracts the rectangle between third row, second column and fourth row fourth column.  Rearranges this as a 2-by-3 matrix.  Transposes this matrix.  Sums every row of this matrix and stores the result in the column with the index greater by one than that of the row summed.  Finally, sums the second row (except for the first column) and saves that value in the second column, last row.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-02-22T21:16:40.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20507" PostTypeId="2" ParentId="20503" CreationDate="2016-02-22T21:40:57.197" Score="3" Body="&lt;p&gt;It's a bit tricky, since you can't call anything after &lt;code&gt;read-from-minibuffer&lt;/code&gt; (called by &lt;code&gt;ivy-read&lt;/code&gt; called by &lt;code&gt;swiper&lt;/code&gt;) until it returns.&#xA;However, there's a visible function &lt;code&gt;swiper--update-input-ivy&lt;/code&gt; that's called in &lt;code&gt;post-command-hook&lt;/code&gt;. You can advice this function.&#xA;It could also be possible to advice &lt;code&gt;ivy--exhibit&lt;/code&gt; (it's always in the minibuffer's &lt;code&gt;post-command-hook&lt;/code&gt;), but &lt;code&gt;swiper--update-input-ivy&lt;/code&gt; will have less side-effects.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun swiper-ivy-restrict-to-matches-once (&amp;amp;rest r)&#xA;  (ivy-restrict-to-matches)&#xA;  (advice-remove&#xA;   'swiper--update-input-ivy&#xA;   'swiper-ivy-restrict-to-matches-once))&#xA;&#xA;(defun swiper-for-defun ()&#xA;  (interactive)&#xA;  (advice-add&#xA;   'swiper--update-input-ivy&#xA;   :after 'swiper-ivy-restrict-to-matches-once)&#xA;  (swiper &quot;defun&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;New solution due to an update in API&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun swiper-for-defun ()&#xA;  (interactive)&#xA;  (swiper--ivy&#xA;   (cl-remove-if-not&#xA;    (lambda (x)&#xA;      (string-match &quot;^ (defun&quot; x))&#xA;    (swiper--candidates))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="2094" LastEditDate="2016-02-23T09:48:26.267" LastActivityDate="2016-02-23T09:48:26.267" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20508" PostTypeId="2" ParentId="19936" CreationDate="2016-02-22T23:14:07.413" Score="12" Body="&lt;p&gt;Since there is more to do on init than just loading a file and on the other hand symlinking &lt;code&gt;.emacs.d&lt;/code&gt; or changing &lt;code&gt;HOME&lt;/code&gt; changes my runtime environment, I opted for a variant of what @glucas had proposed.  I used the code from &lt;code&gt;startup.el&lt;/code&gt; and added the patch from &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&quot; rel=&quot;noreferrer&quot;&gt;#15539&lt;/a&gt; to use an environment variable for switching between different init dirs. If none is given, the default is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was one problem with spacemacs: &lt;code&gt;async&lt;/code&gt; doesn't know about the changed init directory and so cannot find some necessary files.  But this has been resolved in spacemacs recently: &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/3390&quot; rel=&quot;noreferrer&quot;&gt;Error when using a config directory other than .emacs.d · Issue #3390&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is my &lt;code&gt;~/.emacs&lt;/code&gt; that should behave like the original init-code but with configurable init directory:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; .emacs --- let the user choose the emacs environment to use&#xA;&#xA;;;; Commentary:&#xA;;;; This code mimics the behaviour of `startup.el' to let the&#xA;;;; usage of the custom init directory behave just like the&#xA;;;; one and only &quot;~/.emacs.d&quot;.&#xA;;;;&#xA;;;; By setting the environment variable `EMACS_USER_DIRECTORY'&#xA;;;; the user-emacs-directory can be chosen and if there is an&#xA;;;; `init.el' the configuration from that directory will be used.&#xA;;;; If the environment variable is not set or there is no `init.el'&#xA;;;; the default configuration directory `~/.emacs.d/' will be used.&#xA;;;;&#xA;;;; The variable `server-name' will be set to the name of the directory&#xA;;;; chosen as start path.  So if the server will be started, it can be&#xA;;;; reached with 'emacsclient -s servername'.&#xA;;;;&#xA;;;; This now works with a current version of spacemacs but does not&#xA;;;; work with `async-start' in general, if the code executed with `async'&#xA;;;; uses `user-init-dir' or makes other assumptions about the emacs&#xA;;;; start-directory.&#xA;&#xA;;;; Code:&#xA;(let* ((user-init-dir-default&#xA;    (file-name-as-directory (concat &quot;~&quot; init-file-user &quot;/.emacs.d&quot;)))&#xA;       (user-init-dir&#xA;    (file-name-as-directory (or (getenv &quot;EMACS_USER_DIRECTORY&quot;)&#xA;                    user-init-dir-default)))&#xA;       (user-init-file-1&#xA;    (expand-file-name &quot;init&quot; user-init-dir)))&#xA;  (setq user-emacs-directory user-init-dir)&#xA;  (with-eval-after-load &quot;server&quot;&#xA;    (setq server-name&#xA;      (let ((server--name (file-name-nondirectory&#xA;                   (directory-file-name user-emacs-directory))))&#xA;        (if (equal server--name &quot;.emacs.d&quot;)&#xA;        &quot;server&quot;&#xA;          server--name))))&#xA;  (setq user-init-file t)&#xA;  (load user-init-file-1 t t)&#xA;  (when (eq user-init-file t)&#xA;    (setq user-emacs-directory user-init-dir-default)&#xA;    (load (expand-file-name &quot;init&quot; user-init-dir-default) t t)))&#xA;&#xA;(provide '.emacs)&#xA;;;; .emacs ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is also a nice addition that makes it work as a daemon without extra effort: the server-name will be set to the name of the init directory. So now you can start a second emacs daemon with a vanilla spacemacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EMACS_USER_DIRECTORY=~/.emacsenv.d/spacemacs emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and still use emacsclient&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s spacemacs -c -e '(message &quot;Hello spacemacs&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My usecase is very simple and I'm astonished, that I'm the only one: I have an always running emacs daemon and use it from gui and over console (with ssh for example).  In this emacs I prepare all my documentation and work log, so it has to be there all the time.  But then I want to try out spacemacs or one of the other distribution packages and even configure it, till I can retire my current configuration or use some of the clever ideas.  And as others, I wanted to create a simple base configuration for my coworkers -- and document it with org-mode in my running instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the only problem I know of is &lt;code&gt;async&lt;/code&gt; and that it doesn't know about the changed init dir, I think about the best way to add some configuration to &lt;code&gt;async&lt;/code&gt; that has variables that should be injected by default, so that it's not necessary to patch all invocations of &lt;code&gt;async-start&lt;/code&gt; just as spacemacs had done.&lt;/p&gt;&#xA;" OwnerUserId="934" LastEditorUserId="15477" LastEditDate="2017-06-11T17:44:29.607" LastActivityDate="2017-06-11T17:44:29.607" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20509" PostTypeId="2" ParentId="20267" CreationDate="2016-02-22T23:25:29.590" Score="0" Body="&lt;p&gt;To save the keystrokes I created the following. I found that pretty often I have to type: &lt;code&gt;['']&lt;/code&gt;, which requires 4 keystrokes. So, I desided to add the following rules:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;step 1. &quot;[&quot; pressed: &#xA;    print &quot;[&quot;&#xA;    ;output looks like: &quot;[&amp;lt;cursor&amp;gt;&quot;&#xA;&#xA;step 2. &quot;[&quot; pressed for the 2-nd time. &#xA;    output &quot;'']&quot;; &#xA;    move cursor 2 characters to the left &#xA;   ;output looks like: &quot;['&amp;lt;cursor&amp;gt;']&quot;&#xA;step 3. &quot;[&quot; pressed for the 3-rd time: &#xA;    delete 1 character backwards&#xA;    delete 1 character forward&#xA;   ;output looks like: &quot;[]&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *kb--bracket-pressed* 0)&#xA;&#xA;;this function is called when any other characted except &quot;[&quot; is pressed &#xA;(defun clean-bracket-pressed ()&#xA;      (when (and&#xA;                  (not (= *kb--bracket-pressed* 0))&#xA;                  (not (string= (this-command-keys) &quot;[&quot;)&#xA;                        ))&#xA;            (setq *kb--bracket-pressed* 0)&#xA;            )&#xA;      )&#xA;&#xA;;this function is called when &quot;[&quot; is pressed &#xA;(defun bracket-pressed ()&#xA;      &quot;[ key pressed&quot;&#xA;      (interactive)&#xA;      (cond&#xA;            ((= 0 *kb--bracket-pressed*)&#xA;                  (insert &quot;[&quot;)&#xA;                  (setq *kb--bracket-pressed* (1+ *kb--bracket-pressed*))&#xA;                  )&#xA;            ((= 1 *kb--bracket-pressed*)&#xA;                  (insert &quot;'']&quot;)&#xA;                  (backward-char 2)&#xA;                  (setq *kb--bracket-pressed* (1+ *kb--bracket-pressed*))&#xA;                  )&#xA;            ((= 2 *kb--bracket-pressed*)&#xA;                  (delete-char -1)&#xA;                  (delete-char 1)&#xA;                  (setq *kb--bracket-pressed* 0)&#xA;                  )&#xA;            )&#xA;      )&#xA;&#xA;(defun my-php-mode ()&#xA;  &quot;My php-mode customisations.&quot;&#xA;  (local-set-key (kbd &quot;[&quot;) 'bracket-pressed)&#xA;  (add-hook 'pre-command-hook 'clean-bracket-pressed nil 'make-it-local)&#xA;)&#xA;&#xA;(add-hook 'php-mode-hook 'my-php-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2016-02-22T23:25:29.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20510" PostTypeId="2" ParentId="20500" CreationDate="2016-02-23T00:07:28.080" Score="4" Body="&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports both :results output :wrap SRC haskell&#xA;sed '/^elts/,$p' -n Heap03.hs&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming you have haskell setup in org-mode, that should do it.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-02-23T00:07:28.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20511" PostTypeId="1" AcceptedAnswerId="20529" CreationDate="2016-02-23T00:41:03.333" Score="18" ViewCount="3248" Body="&lt;p&gt;I want to close all my windows but the current one and maximize the frame so I can quickly see everything in the buffer in that one window, and then revert to my previous window setup. How would I go about doing this?&lt;/p&gt;&#xA;" OwnerUserId="10211" LastEditorUserId="253" LastEditDate="2016-02-23T20:55:24.957" LastActivityDate="2016-02-24T08:05:30.373" Title="Quick way to close all but one window, and then revert to previous window setup?" Tags="|window|frames|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20512" PostTypeId="2" ParentId="20453" CreationDate="2016-02-23T03:06:54.500" Score="14" Body="&lt;p&gt;First, you should never modify the code in master branch, Spacemacs is designed to be hackable while keeping the master branch read-only, also not that force pushes to master branch may happen!. If you really want to modify the code you should use the develop branch and keep it up to date manually. Develop branch is never forced push.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: actually you were using the develop branch, my apologies, I let the paragraph for reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the answer :-) The correct way to do what you want is to overwrite the location in &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;. I just tried it by forking &lt;code&gt;helm-spotify&lt;/code&gt; in my namespace and then added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   dotspacemacs-additional-packages&#xA;     '((helm-spotify :location (recipe :fetcher github :repo &quot;syl20bnr/helm-spotify&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then upon restart Spacemacs fetched the package from my fork correctly instead of reaching MELPA. Spacemacs uses &lt;code&gt;quelpa&lt;/code&gt; to fetch repositories from GitHub based on MELPA recipes, &lt;code&gt;package.el&lt;/code&gt; is used to install the packages so dependencies are correctly resolved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you may have to manually delete the &lt;code&gt;helm-spotify&lt;/code&gt; folder in &lt;code&gt;˜/.emacs.d/elpa&lt;/code&gt; directory and restart Emacs.&lt;/li&gt;&#xA;&lt;li&gt;You still have to add the &lt;code&gt;spotify&lt;/code&gt; layer to your &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt; variable.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="167" LastActivityDate="2016-02-23T03:06:54.500" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20513" PostTypeId="2" ParentId="169" CreationDate="2016-02-23T03:08:46.903" Score="10" Body="&lt;p&gt;you can also enable global-auto-revert-mode as shown below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-auto-revert-mode 1)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is helpful when you do a lot of checks of your js files with auto-fix mode enabled, like in jssc.&lt;/p&gt;&#xA;" OwnerUserId="10547" LastActivityDate="2016-02-23T03:08:46.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20514" PostTypeId="1" AcceptedAnswerId="38090" CreationDate="2016-02-23T04:22:05.807" Score="3" ViewCount="1294" Body="&lt;p&gt;&lt;code&gt;line-spacing&lt;/code&gt; adds space at the bottom. Here is what I mean - &lt;a href=&quot;http://imagebin.ca/v/2XusPASe4Nmh&quot; rel=&quot;nofollow&quot;&gt;Image link&lt;/a&gt;.&#xA;The docs say that the space is added below lines of graphic displays. I want the space to be added at the top. How do I do that?&lt;/p&gt;&#xA;" OwnerUserId="11208" LastEditorUserId="15748" LastEditDate="2018-01-14T11:55:30.983" LastActivityDate="2018-03-15T14:16:00.390" Title="Increase line-spacing on top" Tags="|display|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20515" PostTypeId="1" AcceptedAnswerId="20561" CreationDate="2016-02-23T06:02:12.687" Score="0" ViewCount="732" Body="&lt;p&gt;I've been trying to setup cc-mode based files to behave in the way I want, but with so many varying opinions and suggested ways of doing things, I've not been able to get things just right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I want to be able to do is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void foo() {&#xA;   if (something) {&#xA;      doSomethingElse();&#xA;&#xA;      while (bar()) {&#xA;         zap();&#xA;      }&#xA;   }&#xA;   else {&#xA;      orSomeOther();&#xA;   }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Opening braces should be on the same line.&lt;/li&gt;&#xA;&lt;li&gt;When I hit Return after I enter the opening brace, the cursor should move to the next line, and indent. &lt;/li&gt;&#xA;&lt;li&gt;Indentation should be using tabs, each with a width of 3.&lt;/li&gt;&#xA;&lt;li&gt;When I hit Return after entering the opening brace on the line with the &lt;code&gt;while&lt;/code&gt;, the cursor should be placed where the &lt;code&gt;z&lt;/code&gt; in &lt;code&gt;zap()&lt;/code&gt; is.&lt;/li&gt;&#xA;&lt;li&gt;When I do hit Return after opening braces, the closing brace should be added under the blank line where we've just indented and the cursor is now waiting for me to continue typing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11209" LastActivityDate="2016-02-24T16:02:41.570" Title="Setup c-mode indentation, braces and tabs" Tags="|indentation|cc-mode|tabs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20516" PostTypeId="1" CreationDate="2016-02-23T09:17:57.003" Score="5" ViewCount="787" Body="&lt;p&gt;Is there a way to bind keys across all modes? For example I have one binding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (define-key evil-normal-state-map (kbd &quot;gt&quot;) 'persp-next)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine in some modes, but not in others, like org-mode, where you have to add a specific binding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (evil-define-key 'normal org-mode-map (kbd &quot;gt&quot;) 'persp-next)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works, but it's annoying to have to define bindings for every major-mode. The final option, global bindings, doesn't seem to work at all without accelerator keys:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (global-set-key (kbd &quot;gt&quot;) 'persp-next)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10765" LastActivityDate="2016-02-23T17:32:33.327" Title="Map keys in all modes?" Tags="|evil|spacemacs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20518" PostTypeId="1" CreationDate="2016-02-23T11:16:57.063" Score="10" ViewCount="254" Body="&lt;p&gt;I frequently have color-bleed issues in emacs, most often with AUCTeX: all of a sudden and for no apparent reason, the line I'm writing will be fontified as math.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First things first: no, I do not have any lone &lt;code&gt;$&lt;/code&gt; character in a verbatim context. &lt;code&gt;;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it happens, I have a couple workarounds: I use &lt;code&gt;font-lock-fontify-buffer&lt;/code&gt; (I have now hooked it into various commands such as &lt;code&gt;save-file&lt;/code&gt;), or I scroll back up and back down. Occasionally, when it does not help, I can locate a line at which the font-issue starts, and sometimes there is a visible problem in that line (e.g. &lt;code&gt;$a[b$&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is not related to AUCTeX's syntactic parser, for example &lt;code&gt;texmathp&lt;/code&gt; returns the correct answer, regardless of the font. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the lack of results from google about it, I'm pretty sure it is a problem in my configuration. &#xA;But I can't reproduce the bleeding consistently, so proceeding on a dichotomy search in my init files looks like a daunting task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is it possible to examine &lt;code&gt;font-lock&lt;/code&gt;'s mechanic &lt;em&gt;in vivo&lt;/em&gt;, so that I can investigate the bug when I see it?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2021-04-10T12:15:36.383" Title="How to investigate &quot;color bleeding&quot;?" Tags="|auctex|font-lock|debugging|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="20519" PostTypeId="2" ParentId="20516" CreationDate="2016-02-23T15:02:54.877" Score="1" Body="&lt;p&gt;One potential solution would be to use &lt;a href=&quot;http://emacsredux.com/blog/2013/04/28/execute-commands-ninja-style-with-key-chord-mode/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;key-chord-mode&lt;/code&gt;&lt;/a&gt; and the function in that mode: &lt;code&gt;key-chord-define-global&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this mode, once you have enabled it with &lt;code&gt;(key-chord-mode 1)&lt;/code&gt;, you can set a global keybinding like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(key-chord-define-global &quot;jj&quot; 'helm-projectile-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is an example that I use personally, but you can of course add your own functions in place of &lt;code&gt;helm-projectile-find-file&lt;/code&gt;, and replace &lt;code&gt;&quot;jj&quot;&lt;/code&gt; with your desired key combination (I don't use evil, but I would assume that something like &lt;code&gt;(key-chord-define-global &quot;gt&quot; 'persp-next)&lt;/code&gt; would work for you). The combinations are case-sensitive too, so &lt;code&gt;&quot;jj&quot;&lt;/code&gt; is different from &lt;code&gt;&quot;JJ&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should allow you to set the kind of bindings you want, without using a modifier key like &lt;code&gt;C-&lt;/code&gt;, &lt;code&gt;M-&lt;/code&gt;, etc. Here is &lt;a href=&quot;http://emacsrocks.com/e07.html&quot; rel=&quot;nofollow&quot;&gt;a nice video demo&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-02-23T17:32:33.327" LastActivityDate="2016-02-23T17:32:33.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20520" PostTypeId="2" ParentId="20514" CreationDate="2016-02-23T15:12:23.797" Score="0" Body="&lt;p&gt;This would be an awful hack, but could work in case there is no other solution:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set the minibuffer line spacing to 0&lt;/li&gt;&#xA;&lt;li&gt;Have an empty default header line. &lt;/li&gt;&#xA;&lt;li&gt;Set the header line to only be a very few characters in height.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This way, there will be no empty space under emacs, and a thin space above emacs.&lt;/p&gt;&#xA;" OwnerUserId="8707" LastActivityDate="2016-02-23T15:12:23.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20521" PostTypeId="2" ParentId="20514" CreationDate="2016-02-23T15:15:16.477" Score="0" Body="&lt;p&gt;If you do not mind changing or tweaking your font, there may be some way to add space above the characters in the font glyphs or in the font properties (something like baseline, maybe?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think FontForge can do this.&lt;/p&gt;&#xA;" OwnerUserId="8707" LastActivityDate="2016-02-23T15:15:16.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20522" PostTypeId="2" ParentId="12119" CreationDate="2016-02-23T16:20:12.223" Score="0" Body="&lt;p&gt;I would simply create my own function that signs and sends, and use that instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I do not use wanderlust and therefore do not know all of its possibilities).&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2016-02-23T16:20:12.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20523" PostTypeId="2" ParentId="20516" CreationDate="2016-02-23T16:49:00.540" Score="0" Body="&lt;p&gt;Started such a project here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/andreas-roehler/general-key&quot; rel=&quot;nofollow&quot;&gt;https://github.com/andreas-roehler/general-key&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's still alpha, bug-reports welcome anyway.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-02-23T16:49:00.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20524" PostTypeId="1" AcceptedAnswerId="20996" CreationDate="2016-02-23T17:40:37.470" Score="3" ViewCount="826" Body="&lt;p&gt;When I'm logged in to a remote machine in eshell I can still do &lt;code&gt;man ls&lt;/code&gt;. But it appears that this only work for my local man pages. If I try &lt;code&gt;man yum&lt;/code&gt; I'll get a message that the yum man page is not found. However, if I log into the machine via a regular terminal and use &lt;code&gt;man yum&lt;/code&gt; there the manual is shown. Is there a way to get &lt;em&gt;remote&lt;/em&gt; man pages showing up when in TRAMP mode? I'd really like that because I'm running OS X locally but frequently log in to linux servers where the utilities have different options etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; To clarify, here's an example session:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Welcome to the Emacs shell&#xA;~ $ cd /ssh:example.com:/&#xA;/ssh:example.com:/ $ man yum&#xA;#&amp;lt;buffer *Man yum*&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alright! That's expected. But, regretfully, no &lt;code&gt;*Man yum*&lt;/code&gt; buffer is created an these messages appear in &lt;code&gt;*Messages*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invoking man yum in the background&#xA;Please wait: formatting the yum man page...&#xA;yum man page formatted&#xA;error in process sentinel: user-error: Can't find the yum manpage&#xA;error in process sentinel: Can't find the yum manpage&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update 2:&lt;/em&gt; I found out (from a comment on &lt;a href=&quot;https://emacs.stackexchange.com/a/4035/10625&quot;&gt;this answer&lt;/a&gt;) that I can invoke the remote man by prefixing with &lt;code&gt;*&lt;/code&gt;, so &lt;code&gt;*man yum&lt;/code&gt; -- which is an OK work-around. But it just dumps the content in the eshell window, rather than open a new buffer like the &lt;code&gt;man&lt;/code&gt; command does. I'd really like that behaviour.&lt;/p&gt;&#xA;" OwnerUserId="10625" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-02-04T17:37:58.123" Title="Can Emacs Eshell show remote man pages in TRAMP mode?" Tags="|tramp|eshell|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20525" PostTypeId="1" AcceptedAnswerId="20539" CreationDate="2016-02-23T18:21:27.607" Score="0" ViewCount="202" Body="&lt;p&gt;(Follow-up to &lt;a href=&quot;https://emacs.stackexchange.com/q/20500/6761&quot;&gt;Is there a way to use org-mode to render generated code?&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports results :results output :wrap SRC haskell&#xA;sed '/^elts/,$p' -n Heap03.hs&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;lets me extract Haskell code from a file to show in org-mode's export. It's effectively a safer and more idiomatic version of the hack I came up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports results :results output verbatim raw&#xA;echo '#+BEGIN_SRC haskell'&#xA;sed '/^elts/,$p' -n Heap03.hs&#xA;echo '#+END_SRC'&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want more abstraction. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: inline&#xA;#+BEGIN_SRC sh :exports none :results output verbatim raw&#xA;echo '#+BEGIN_SRC haskell'&#xA;echo &quot;[[./$FILE][$FILE]]&quot;&#xA;sed '/^elts/,$p' -n $FILE&#xA;echo '#+END_SRC'&#xA;#+END_SRC&#xA;&#xA;#+CALL: inline(FILE=&quot;Heap01.hs&quot;)&#xA;#+CALL: inline(FILE=&quot;Heap02.hs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The two criteria I'm trying to satisfy (and having trouble) are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I should have a link to the file automatically inserted above the Haskell code.&lt;/li&gt;&#xA;&lt;li&gt;The call should be as minimal as possible.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I haven't figured out how to get the first criterion satisfied using &lt;code&gt;:wrap&lt;/code&gt;, and the best I can do toward the second criterion is &lt;code&gt;#+CALL: inline(FILE=&quot;Heap01.hs&quot;) :wrap SRC haskell&lt;/code&gt;, which is just a bit too heavyweight for my taste.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6761" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-24T15:35:01.077" Title="How to get org-mode to generate code multiple times in one file without redundancy?" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20526" PostTypeId="1" AcceptedAnswerId="20544" CreationDate="2016-02-23T18:39:49.827" Score="3" ViewCount="1186" Body="&lt;p&gt;I'm using Emacs GUI on OSX and I've remapped &lt;code&gt;Cmd&lt;/code&gt; key to meta by adding the following to a &lt;code&gt;~/.emacs.d/personal/misc.el&lt;/code&gt; file on prelude:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mac-command-modifier 'meta)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas &lt;code&gt;C-M-u&lt;/code&gt; works as expected, &lt;code&gt;C-M-d&lt;/code&gt;, when using &lt;code&gt;Cmd&lt;/code&gt; as meta key, does nothing. If using alt key though, it works as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to solve this? I've tried typing &lt;code&gt;C-h l&lt;/code&gt; to see what's being typed but when I type &lt;code&gt;C-M-d&lt;/code&gt;, nothing appears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2016-02-24T07:52:49.903" Title="C-M-d not working on Emacs GUI OSX using Mac Command key as Meta" Tags="|osx|prelude|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20527" PostTypeId="1" AcceptedAnswerId="20532" CreationDate="2016-02-23T18:45:32.433" Score="5" ViewCount="172" Body="&lt;p&gt;If I want to do recursive hardlinks of a directory I have to use &lt;code&gt;cp -r -l dir&lt;/code&gt; in bash instead of &lt;code&gt;ln -h&lt;/code&gt;. How do I replicate this in dired, because &lt;code&gt;dired-do-hardlink&lt;/code&gt; uses &lt;code&gt;ln&lt;/code&gt; underneath?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can use &lt;code&gt;M-! cp -r -l dir&lt;/code&gt; but I would like to not have to treat directories differently when linking files around.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastActivityDate="2016-02-23T22:09:01.027" Title="Recursive Hard Links in dired" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20528" PostTypeId="2" ParentId="10818" CreationDate="2016-02-23T18:53:31.787" Score="2" Body="&lt;p&gt;Adding the following to my init file works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(fullscreen . maximized))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5486" LastActivityDate="2016-02-23T18:53:31.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20529" PostTypeId="2" ParentId="20511" CreationDate="2016-02-23T19:28:53.850" Score="20" Body="&lt;p&gt;The different sections of text you see in your Emacs are &lt;em&gt;windows&lt;/em&gt;. You can, for example, create a new window with &lt;code&gt;C-x 2&lt;/code&gt;. Yes, this terminology is confusing. It predates most GUI systems, so it's understandable if still confusing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But once we know we're talking about windows, we can do the changes you want. To get rid of all windows except the one that point is in, run &lt;code&gt;C-x 1&lt;/code&gt;, mapped to &lt;code&gt;delete-other-windows&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, for going back to what you had before, there's a pretty useful library called &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Convenience.html#Window-Convenience&quot;&gt;winner-mode&lt;/a&gt;. It lets you undo and redo changes to your window configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So enable winner-mode with &lt;code&gt;M-x winner-mode&lt;/code&gt;, and then after you call &lt;code&gt;C-x 1&lt;/code&gt;, you can press &lt;code&gt;C-c left&lt;/code&gt; to undo the change to the window configuration, setting the windows back to what they were.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to permanently enable winner-mode, put &lt;code&gt;(winner-mode)&lt;/code&gt; in your init file.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2016-02-23T19:52:07.403" LastActivityDate="2016-02-23T19:52:07.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20530" PostTypeId="2" ParentId="20511" CreationDate="2016-02-23T20:17:24.280" Score="9" Body="&lt;p&gt;Using &lt;code&gt;winner-mode&lt;/code&gt; is handy, but if you really just want to flip back and forth between one window and a multi-window configuration, here's something I've used before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar window-split-saved-config nil)&#xA;&#xA;(defun window-split-toggle-one-window ()&#xA;  &quot;Make the current window fill the frame.&#xA;If there is only one window try reverting to the most recently saved&#xA;window configuration.&quot;&#xA;  (interactive)&#xA;  (if (and window-split-saved-config (not (window-parent)))&#xA;      (set-window-configuration window-split-saved-config)&#xA;    (setq window-split-saved-config (current-window-configuration))&#xA;    (delete-other-windows)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could bind that to e.g. &lt;code&gt;C-x 1&lt;/code&gt; and use that same key to toggle the states.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-02-23T20:17:24.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20532" PostTypeId="2" ParentId="20527" CreationDate="2016-02-23T21:51:46.090" Score="4" Body="&lt;p&gt;Use &lt;strong&gt;&lt;code&gt;diredp-do-hardlink-recursive&lt;/code&gt;&lt;/strong&gt;, from library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diredp-do-hardlink-recursive is an interactive compiled Lisp function&#xA;in `dired+.el'.&#xA;&#xA;(diredp-do-hardlink-recursive &amp;amp;optional IGNORE-MARKS-P)&#xA;&#xA;Add hard links for marked files, including those in marked subdirs.&#xA;Like `dired-do-hardlink', but act recursively on subdirs to pick up the&#xA;files to link.&#xA;&#xA;The files included are those that are marked in the current Dired&#xA;buffer, or all files in the directory if none are marked.  Marked&#xA;subdirectories are handled recursively in the same way.&#xA;&#xA;With a prefix argument, ignore all marks - include all files in this&#xA;Dired buffer and all subdirs, recursively.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="25" LastEditDate="2016-02-23T22:09:01.027" LastActivityDate="2016-02-23T22:09:01.027" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20533" PostTypeId="1" AcceptedAnswerId="20640" CreationDate="2016-02-23T22:02:44.230" Score="9" ViewCount="2315" Body="&lt;p&gt;We have a new manager at work and he wants us to timesheet. No problem, I have org-mode. Except, he wants time reported like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0900-1000 Customer  Project  xMinutes&#xA;0900-1000 Customer2 Project2 yMinutes&#xA;1000-1100 Customer  Project3 zMinutes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, in other words, if I clock time on three things in an hour he wants three lines for that hour which show the three sets of minutes that I spent, against the task. Naturally, my Org file has tasks for different customers as subheadings under those customers, so in theory those two columns should be easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not very experienced with org hacking and I can't work out how to break the time down this way. So I thought I'd ask someone else to do it for me :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully the answer isn't staring  me in the face in the Org manual.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Greenwich Consultancy&#xA;   :LOGBOOK:&#xA;   CLOCK: [2016-02-18 Thu 10:40]--[2016-02-18 Thu 11:10] =&amp;gt;  0:30&#xA;   CLOCK: [2016-01-13 Wed 14:48]--[2016-01-13 Wed 15:29] =&amp;gt;  0:41&#xA;   CLOCK: [2016-01-12 Tue 11:00]--[2016-01-12 Tue 16:53] =&amp;gt;  5:53&#xA;   :END:&#xA;** PU [2/2]&#xA;*** DONE Identify PU Open equella block&#xA;    CLOSED: [2015-10-26 Mon 09:09]&#xA;    :LOGBOOK:&#xA;    CLOCK: [2015-10-09 Fri 14:10]--[2015-10-09 Fri 16:06] =&amp;gt;  1:56&#xA;    :END:&#xA;*** Update UAT &#xA;    :LOGBOOK:&#xA;    CLOCK: [2016-02-17 Wed 10:03]--[2016-02-17 Wed 10:16] =&amp;gt;  0:13&#xA;    CLOCK: [2015-11-17 Tue 09:12]--[2015-11-17 Tue 09:18] =&amp;gt;  0:06&#xA;    CLOCK: [2015-11-16 Mon 14:49]--[2015-11-16 Mon 15:00] =&amp;gt;  0:11&#xA;    :END:&#xA;*** PSMD Block&#xA;    :LOGBOOK:&#xA;    CLOCK: [2016-02-26 Fri 16:26]--[2016-02-26 Fri 16:53] =&amp;gt;  0:27&#xA;    CLOCK: [2016-02-11 Thu 14:27]--[2016-02-11 Thu 14:47] =&amp;gt;  0:20&#xA;    CLOCK: [2016-02-09 Tue 16:17]--[2016-02-09 Tue 16:31] =&amp;gt;  0:14&#xA;    CLOCK: [2016-02-09 Tue 14:24]--[2016-02-09 Tue 15:02] =&amp;gt;  0:38&#xA;    CLOCK: [2016-02-09 Tue 12:13]--[2016-02-09 Tue 13:01] =&amp;gt;  0:48&#xA;    CLOCK: [2016-02-09 Tue 10:15]--[2016-02-09 Tue 10:58] =&amp;gt;  0:43&#xA;    CLOCK: [2016-02-05 Fri 14:27]--[2016-02-05 Fri 16:36] =&amp;gt;  2:09&#xA;    CLOCK: [2016-02-05 Fri 11:11]--[2016-02-05 Fri 12:02] =&amp;gt;  0:51&#xA;    CLOCK: [2016-02-05 Fri 10:36]--[2016-02-05 Fri 10:53] =&amp;gt;  0:17&#xA;    CLOCK: [2016-02-03 Wed 09:39]--[2016-02-03 Wed 10:24] =&amp;gt;  0:45&#xA;    CLOCK: [2016-02-02 Tue 16:39]--[2016-02-02 Tue 17:00] =&amp;gt;  0:21&#xA;    CLOCK: [2016-01-29 Fri 12:27]--[2016-01-29 Fri 12:33] =&amp;gt;  0:06&#xA;    :END:       &#xA;*** Server tidy&#xA;**** STARTED Check TII code on UAT&#xA;     :LOGBOOK:&#xA;     CLOCK: [2016-02-25 Thu 16:59]--[2016-02-26 Fri 09:22] =&amp;gt; 16:23&#xA;     :END:&#xA;**** DONE Update Coursework M26 branch&#xA;     CLOSED: [2016-02-25 Thu 16:59]&#xA;     - State &quot;DONE&quot;       from &quot;STARTED&quot;    [2016-02-25 Thu 16:59]&#xA;     :LOGBOOK:&#xA;     CLOCK: [2016-02-25 Thu 16:56]--[2016-02-25 Thu 16:59] =&amp;gt;  0:03&#xA;     :END:   &#xA;*** UAT PSMD Roamers problem&#xA;    :LOGBOOK:&#xA;    CLOCK: [2016-02-25 Thu 11:19]--[2016-02-25 Thu 11:33] =&amp;gt;  0:14&#xA;    :END:&#xA;*** Gradebook problem&#xA;    :LOGBOOK:&#xA;    CLOCK: [2016-02-26 Fri 15:35]--[2016-02-26 Fri 16:26] =&amp;gt;  0:51&#xA;    :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So for example, the line &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CLOCK: [2016-02-05 Fri 11:11]--[2016-02-05 Fri 12:02] =&amp;gt;  0:51&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Should produce two output lines (with tabs or comma separators):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1000-1100 PU PSMD Block 49&#xA;1100-1200 PU PSMD Block  2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6545" LastEditorUserId="6545" LastEditDate="2016-02-27T11:46:46.227" LastActivityDate="2017-02-17T08:49:38.343" Title="Org: Show Clocked Time hour-by-hour" Tags="|org-mode|org-agenda|org-clock|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20534" PostTypeId="1" AcceptedAnswerId="20549" CreationDate="2016-02-23T22:44:53.857" Score="1" ViewCount="506" Body="&lt;p&gt;I have set up a mount point using the s3fs FUSE filesystem and autofs to talk to an Amazon S3 bucket, but it is excruciatingly slow to edit a file in the bucket in emacs - it is basically unusable due to the delays after every keypress, which cause emacs to hang completely until it finishes its I/O.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to avoid this problem?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-02-24T09:04:31.257" Title="s3fs is too slow for emacs" Tags="|performance|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20535" PostTypeId="1" AcceptedAnswerId="20537" CreationDate="2016-02-23T23:06:48.803" Score="13" ViewCount="655" Body="&lt;p&gt;Say we have such a &lt;code&gt;foo&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (e)&#xA;  (let ((lst '(a b c)))&#xA;    (delq e lst)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then we use it in following way (sequentially evaluating one by one):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo 'c) ; =&amp;gt; (a b)&#xA;(foo 'b) ; =&amp;gt; (a)&#xA;(foo 'a) ; =&amp;gt; nil&#xA;(foo 'b) ; =&amp;gt; (a)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What happened here? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I define another &lt;code&gt;bar&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bar (e)&#xA;  (let ((lst (list 'a 'b 'c)))&#xA;    (delq e lst)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use it in the same way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bar 'c) ; =&amp;gt; (a b)&#xA;(bar 'b) ; =&amp;gt; (a c)&#xA;(bar 'a) ; =&amp;gt; (b c)&#xA;(bar 'b) ; =&amp;gt; (a c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The results here seem reasonable to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So question is, why the constant in the &lt;code&gt;let&lt;/code&gt; form of the &lt;code&gt;foo&lt;/code&gt; function behave in this way? Is it intended?&lt;/p&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="304" LastEditDate="2016-06-26T11:49:00.277" LastActivityDate="2016-06-26T11:49:00.277" Title="Why does a constant in `let` change with repeated calls?" Tags="|list|quote|let-binding|" AnswerCount="1" CommentCount="6" ClosedDate="2019-05-23T22:04:35.693" ContentLicense="CC BY-SA 3.0" />
  <row Id="20536" PostTypeId="2" ParentId="20534" CreationDate="2016-02-23T23:15:51.810" Score="0" Body="&lt;p&gt;I initially used this simple Linux script to copy the file to a fast filesystem and then copy it back again (see my other answer for what I am now doing). Only the line beginning with &lt;code&gt;TMP=&lt;/code&gt; should need to be changed for other operating systems. The only slight complexity is dealing with simultaneous edits to identically-named files in different S3 buckets (without replacing the filename with randomly-generated garbage, which would be the easy way out).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#! /bin/bash -peux&#xA;# Edit files from slow filesystems in emacs&#xA;TMP=/run/user/$(id -u)&#xA;dest=$TMP/&quot;$(basename &quot;$1&quot;)&quot;&#xA;src_dir=&quot;$(dirname &quot;$1&quot;)&quot;&#xA;prefix=&quot;&quot;&#xA;while [ -e &quot;$dest&quot; ]; do&#xA;    prefix=&quot;$(basename &quot;$src_dir&quot;)/$prefix&quot;&#xA;    src_dir=&quot;$(dirname &quot;$src_dir&quot;)&quot;&#xA;    if [ &quot;$src_dir&quot; = &quot;/&quot; ]; then&#xA;        echo Unable to generate unique filename &amp;gt;&amp;amp;2&#xA;        exit 2&#xA;    fi&#xA;    mkdir $TMP/&quot;$prefix&quot; || :&#xA;    dest=$TMP/&quot;$prefix$(basename &quot;$1&quot;)&quot;&#xA;done&#xA;cp -p &quot;$1&quot; $dest || :&#xA;emacsclient &quot;$dest&quot;&#xA;cp -pu &quot;$dest&quot; &quot;$1&quot;&#xA;rm &quot;$dest&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6790" LastEditorUserId="6790" LastEditDate="2016-02-24T09:04:31.257" LastActivityDate="2016-02-24T09:04:31.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20537" PostTypeId="2" ParentId="20535" CreationDate="2016-02-23T23:45:07.303" Score="22" Body="&lt;p&gt;Here is my answer to &lt;a href=&quot;https://stackoverflow.com/q/16670989/850781&quot;&gt;the identical question&lt;/a&gt;, appropriately edited:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Bad&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;foo&lt;/code&gt; is &lt;strong&gt;self-modifying code&lt;/strong&gt;. This is &lt;strong&gt;extremely dangerous&lt;/strong&gt;. While the &lt;em&gt;variable&lt;/em&gt; &lt;code&gt;lst&lt;/code&gt; disappears at the end of the &lt;code&gt;let&lt;/code&gt; form, its &lt;em&gt;initial value&lt;/em&gt; persists in the function object, and that is the value you are modifying. Remember that in Lisp &lt;a href=&quot;https://en.wikipedia.org/wiki/First-class_function&quot; rel=&quot;nofollow noreferrer&quot;&gt;a function is a first class object&lt;/a&gt;, which can be passed around (just like a number or a list), and, sometimes, &lt;em&gt;modified&lt;/em&gt;. This is exactly what you are doing here: the initial value for &lt;code&gt;lst&lt;/code&gt; is a part of the function object and you are modifying it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us actually see what is happening:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbol-function 'foo)&#xA;==&amp;gt; (lambda (e) (let ((lst (quote (a b c)))) (delq e lst)))&#xA;(foo 'c)&#xA;==&amp;gt; (a b)&#xA;(symbol-function 'foo)&#xA;==&amp;gt; (lambda (e) (let ((lst (quote (a b)))) (delq e lst)))&#xA;(foo 'b)&#xA;==&amp;gt; (a)&#xA;(symbol-function 'foo)&#xA;==&amp;gt; (lambda (e) (let ((lst (quote (a)))) (delq e lst)))&#xA;(foo 'a)&#xA;==&amp;gt; nil&#xA;(symbol-function 'foo)&#xA;==&amp;gt; (lambda (e) (let ((lst (quote (a)))) (delq e lst)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;The Good&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;bar&lt;/code&gt;, &lt;code&gt;lst&lt;/code&gt; is initialized to a &lt;em&gt;fresh&lt;/em&gt; cons cell and thus is safe.&#xA;&lt;code&gt;bar&lt;/code&gt; does &lt;em&gt;not&lt;/em&gt; modify its code.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Bottom Line&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In general, it is best to treat &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;quoted&lt;/a&gt; data like &lt;code&gt;'(1)&lt;/code&gt; as constants - do &lt;strong&gt;not&lt;/strong&gt; modify them:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;quote&lt;/code&gt; returns the argument, without evaluating it.  &lt;code&gt;(quote x)&lt;/code&gt; yields &lt;code&gt;x&lt;/code&gt;.&#xA;  &lt;strong&gt;Warning&lt;/strong&gt;: &lt;code&gt;quote&lt;/code&gt; does not construct its return value, but just returns&#xA;  the value that was pre-constructed by the Lisp reader (see info node&#xA;  &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Printed-Representation.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Printed Representation&lt;/a&gt;). This means that &lt;code&gt;(a . b)&lt;/code&gt; is not&#xA;  identical to &lt;code&gt;(cons 'a 'b)&lt;/code&gt;: the former does not cons.  Quoting should&#xA;  be reserved for constants that will never be modified by side-effects,&#xA;  unless you like self-modifying code. See the common pitfall in info&#xA;  node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Rearrangement.html#Rearrangement&quot; rel=&quot;nofollow noreferrer&quot;&gt;Rearrangement&lt;/a&gt; for an example of unexpected results when&#xA;  a quoted object is modified.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you need to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Modifying-Lists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;modify a list&lt;/a&gt;, create it with &lt;code&gt;list&lt;/code&gt; or &lt;code&gt;cons&lt;/code&gt; or &lt;code&gt;copy-list&lt;/code&gt; instead of &lt;code&gt;quote&lt;/code&gt;, like you do in &lt;code&gt;bar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.clisp.org/impnotes/faq.html#faq-self-mod&quot; rel=&quot;nofollow noreferrer&quot;&gt;more&lt;/a&gt; &lt;a href=&quot;http://www.emacswiki.org/emacs/DestructiveOperations&quot; rel=&quot;nofollow noreferrer&quot;&gt;examples&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;ps - variable naming&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Emacs Lisp is a &lt;a href=&quot;https://stackoverflow.com/q/4578574/850781&quot;&gt;lisp-2&lt;/a&gt; so these is no reason to name your variable &lt;code&gt;lst&lt;/code&gt; instead of &lt;code&gt;list&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-02-24T21:59:05.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20538" PostTypeId="1" AcceptedAnswerId="20550" CreationDate="2016-02-24T00:34:40.443" Score="1" ViewCount="591" Body="&lt;p&gt;Javascript Angular has a peculiar pattern for creating controllers that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;myApp.controller('myController', ['$scope', 'foo', 'bar', &#xA;                 function($scope, foo, bar) {&#xA;                     //do stuff...&#xA;                 }]);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;'$scope', 'foo', 'bar'&lt;/code&gt; thing is repeated as the parameter list in the function inside the square-bracketed array. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I could make doing this less error-prone by writing a yasnippet. It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: angctl&#xA;# key: angctl&#xA;# --&#xA;$1.controller('$2', ['$3', function($3) {&#xA;$0;&#xA;}]);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine, but only if there is one parameter (in the $3 position), like if I'm just using &lt;code&gt;$scope&lt;/code&gt;. If I want to use more than one, it breaks down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way of writing the snippet so it will make a comma delimited list of quoted strings and repeat a comma delimited list of unquoted strings somewhere else within the snippet?&lt;/p&gt;&#xA;" OwnerUserId="10952" LastActivityDate="2016-02-24T10:30:51.070" Title="Can I create a yasnippet with a repeating variable length list" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20539" PostTypeId="2" ParentId="20525" CreationDate="2016-02-24T02:48:20.387" Score="1" Body="&lt;p&gt;How about (note : after name, and the :var definition):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: inline&#xA;#+BEGIN_SRC sh :exports none :results output verbatim raw :var FILE=&quot;&quot;&#xA;echo &quot;[[./$FILE][$FILE]]&quot;&#xA;echo '#+BEGIN_SRC haskell'&#xA;sed '/^elts/,$p' -n $FILE&#xA;cat $FILE&#xA;echo '\n#+END_SRC'&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then (with results raw):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CALL: inline(FILE=&quot;Heap01.hs&quot;) :results raw&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-02-24T02:48:20.387" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20540" PostTypeId="1" AcceptedAnswerId="20541" CreationDate="2016-02-24T04:32:41.163" Score="6" ViewCount="3125" Body="&lt;p&gt;I have heard of the power of Emacs, but I have a ton more experience with vim and an extensive amount of shortcuts in my &lt;code&gt;.vimrc&lt;/code&gt; file. I would like to transfer these mappings over to Emacs &lt;code&gt;evil-mode&lt;/code&gt;. What would be the best way to do this? One example would be mapping &lt;kbd&gt;tab&lt;/kbd&gt; to &lt;kbd&gt;&gt;&gt;&lt;/kbd&gt; (indenting the current line). Which looks like &lt;code&gt;nnoremap &amp;lt;tab&amp;gt; &amp;gt;&amp;gt;&lt;/code&gt; in my .vimrc. &lt;/p&gt;&#xA;" OwnerUserId="11219" LastEditorUserId="2642" LastEditDate="2016-02-24T05:04:31.283" LastActivityDate="2016-02-24T05:04:31.283" Title="How can I translate my .vimrc into evil-mode" Tags="|key-bindings|evil|vim-emulation|mapping|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20541" PostTypeId="2" ParentId="20540" CreationDate="2016-02-24T04:55:53.837" Score="4" Body="&lt;p&gt;Taken literally, your sample line would translate to the following:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) (kbd &quot;&amp;gt;&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although I don't personally recommend this. It's much cleaner to reference the function you want to run by name instead of using a keyboard macro. This clears up the need for a distinction between &lt;code&gt;nmap&lt;/code&gt; and &lt;code&gt;nnoremap&lt;/code&gt;, and is more fault-tolerant.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) #'evil-shift-right-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-02-24T04:55:53.837" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20542" PostTypeId="1" AcceptedAnswerId="21300" CreationDate="2016-02-24T05:17:21.930" Score="5" ViewCount="1436" Body="&lt;p&gt;When I run &lt;code&gt;cider-jack-in&lt;/code&gt; the following error appears. &lt;code&gt;Symbol's function definition is void: clojure-project-dir&lt;/code&gt; I am very new to Emacs and this is totally stumping me. Let me know if you need more information and I will provide.&lt;/p&gt;&#xA;" OwnerUserId="11219" LastEditorUserId="2642" LastEditDate="2016-02-24T05:29:13.617" LastActivityDate="2016-10-14T19:58:36.440" Title="cider-jack-in: Symbol's function definition is void: clojure-project-dir" Tags="|repl|clojure|cider|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20543" PostTypeId="1" CreationDate="2016-02-24T07:03:33.590" Score="6" ViewCount="773" Body="&lt;p&gt;I found two ways to display preview of the &lt;code&gt;markdown&lt;/code&gt; files in &lt;code&gt;markdown&lt;/code&gt; mode. One is &lt;kbd&gt;C-c C-c p&lt;/kbd&gt; which requires a parser (currently I use &lt;code&gt;pandoc&lt;/code&gt;) to preview using browser. The other is &lt;kbd&gt; C-c C-c l&lt;/kbd&gt; which display preview using &lt;code&gt;eww&lt;/code&gt; in &lt;code&gt;emacs buffer&lt;/code&gt;. However, none of them display changes in a &quot;real-time&quot; way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first one, I have to strike &lt;kbd&gt;C-c C-c p&lt;/kbd&gt; every time after edited. It will open a new time in my browser each time which is very annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;kbd&gt; C-c C-c l&lt;/kbd&gt; I can use &lt;kbd&gt; C-c C-c e&lt;/kbd&gt; or simply save file to update changes but still not convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More over, I found some subtle differences between these two commands' outputs. Which one is the real one?&lt;/p&gt;&#xA;" OwnerUserId="10753" LastEditorUserId="253" LastEditDate="2016-02-25T02:20:39.997" LastActivityDate="2016-05-25T11:34:46.793" Title="Markdown Mode: Is there a way to display changes on-the-fly?" Tags="|markdown|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20544" PostTypeId="2" ParentId="20526" CreationDate="2016-02-24T07:52:49.903" Score="2" Body="&lt;p&gt;Elethan's tip lead me to the answer &lt;a href=&quot;https://apple.stackexchange.com/questions/22785/how-do-i-disable-the-command-control-d-word-definition-keyboard-shortcut-in-os-x&quot;&gt;here&lt;/a&gt;, which essentially involves disabling system wide OSX Command-Control-D shortcut by calling:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 70 '&amp;lt;dict&amp;gt;&amp;lt;key&amp;gt;enabled&amp;lt;/key&amp;gt;&amp;lt;false/&amp;gt;&amp;lt;/dict&amp;gt;'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5486" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:30.630" LastActivityDate="2016-02-24T07:52:49.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20545" PostTypeId="1" CreationDate="2016-02-24T08:01:34.573" Score="4" ViewCount="6143" Body="&lt;p&gt;I'm using Emacs in a terminal and am finding that when the &lt;code&gt;TERM&lt;/code&gt; environment variable is changed between &lt;code&gt;screen-256color&lt;/code&gt; and &lt;code&gt;xterm-256color&lt;/code&gt;, the default colors within Emacs are set differently. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to be clear, I'm getting full 256 bit color support in both situations (running with byobu/tmux and running with Gnome Terminal respectively), but Emacs is applying different colors such that when I look at the same Python file, the syntax highlighting uses differ colors in each. When I manually change the colors using &lt;code&gt;color-theme-select&lt;/code&gt; to the same theme, they then use the same colors. The problem is that I have no idea how the colors are set to begin with, and more importantly, why they are set differently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior remains constant when I force byobu to use &lt;code&gt;TERM=xterm-256color&lt;/code&gt;, so it doesn't seem like this is a problem with either of the terminal emulators. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I ensure that Emacs uses the same colors in each situation?&lt;/p&gt;&#xA;" OwnerUserId="10780" LastActivityDate="2020-04-05T13:50:32.657" Title="Emacs colors being set differently when TERM is 'screen-256color' and 'xterm-256color'" Tags="|colors|term|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20546" PostTypeId="2" ParentId="20511" CreationDate="2016-02-24T08:05:30.373" Score="1" Body="&lt;p&gt;I use the following, copied from the web. It's a quick way to leave your current window configuration. After you are done use &lt;code&gt;exit-recursive-edit&lt;/code&gt; to get back.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; http://www.emacswiki.org/emacs/RecursiveEditPreservingWindowConfig    &#xA;;; inspired by Erik Naggum's `recursive-edit-with-single-window'&#xA;&#xA;(defmacro recursive-edit-preserving-window-config (body)&#xA;  &quot;*Return a command that enters a recursive edit after executing BODY.&#xA; Upon exiting the recursive edit (with\\[exit-recursive-edit] (exit)&#xA; or \\[abort-recursive-edit] (abort)), restore window configuration&#xA; in current frame.&quot;&#xA;  `(lambda ()&#xA;     &quot;See the documentation for `recursive-edit-preserving-window-config'.&quot;&#xA;     (interactive)&#xA;     (save-window-excursion&#xA;       ,body&#xA;       (recursive-edit))))&#xA;&#xA;(global-set-key (kbd &quot;C-c 0&quot;) (recursive-edit-preserving-window-config (delete-window)))&#xA;(global-set-key (kbd &quot;C-c 1&quot;) (recursive-edit-preserving-window-config&#xA;                               (if (one-window-p 'ignore-minibuffer)&#xA;                                   (error &quot;Current window is the only window in its frame&quot;)&#xA;                                 (delete-other-windows))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2016-02-24T08:05:30.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20547" PostTypeId="1" AcceptedAnswerId="20554" CreationDate="2016-02-24T08:15:24.630" Score="9" ViewCount="2464" Body="&lt;p&gt;I have an Org-mode document that I am exporting to PDF, and my document contains a table that I would like to rotate on export. I have been able to achieve the rotation with &lt;code&gt;#+ATTR_LATEX: :float sideways&lt;/code&gt;. However, this places the table at the very end of the document, whereas I would like it closer to where it appears in the text. One solution I have tried is using &lt;code&gt;#+LATEX: \begin{sidewaystable}[htbp]&lt;/code&gt; above the table and &lt;code&gt;#+LATEX: \end{sidewaystable}&lt;/code&gt; below it, which is hacky and makes me lose my table caption and the ability to reference the table elsewhere in the text. It does, however, put the table where I want it. Is there a way to specify the location of a sidewaystable when exporting from Org-mode?&lt;/p&gt;&#xA;" OwnerUserId="7060" LastEditorUserId="7060" LastEditDate="2016-02-24T08:25:41.990" LastActivityDate="2016-02-24T13:37:07.873" Title="Specify sidewaystable placement in Org-mode export" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20548" PostTypeId="2" ParentId="20545" CreationDate="2016-02-24T09:00:07.427" Score="2" Body="&lt;p&gt;I'm hardly an expert on this, but I believe that this isn't necessarily related to Emacs but rather with the terminal capabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., you can see the various terminal capabilities with &lt;code&gt;infocmp -I -r -T xterm-256color&lt;/code&gt; and &lt;code&gt;infocmp -I -r -T screen-256color&lt;/code&gt;. I did a quick comparison between them and noted that &lt;code&gt;xterm-256color&lt;/code&gt; has a significant amount of more capabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some guesswork, I believe that what happens is that Emacs finds the &lt;code&gt;initc&lt;/code&gt; capabilitiy and uses it to provide more shades of a particular color for the default theme. See for instance this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2814478/how-can-i-output-different-shades-of-green-to-the-terminal&quot;&gt;https://stackoverflow.com/questions/2814478/how-can-i-output-different-shades-of-green-to-the-terminal&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure you can entirely control this behaviour from Emacs, but as you noted you can use &lt;code&gt;color-theme-select&lt;/code&gt; to change the behaviour. A temporary fix could be to simply use &lt;code&gt;(load-theme &quot;theme&quot; t)&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt; to force the theme you had in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option could be to manually set the TERMINFO or TERMCAP environment variables to point to a file with the appropriate terminal capabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., you could do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export TERMINFO=&quot;$HOME/.terminfo&quot;&#xA;infocmp -I -r -T xterm-256color &amp;gt; $TERMINFO&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export TERMCAP=&quot;$HOME/.termcap&quot;&#xA;infocmp -C -r -T xterm-256color &amp;gt; $TERMCAP&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This forces Emacs to use the terminal capabilities you had in mind. It may also have other side-effects but I haven't seen any yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know why &lt;code&gt;tmux&lt;/code&gt;/&lt;code&gt;byobu&lt;/code&gt; seems to ignore forcing TERM as you describe. In &lt;code&gt;tmux&lt;/code&gt; however, I know that you can use &lt;code&gt;set-option -g xterm-256color&lt;/code&gt; to force the terminal to use. I don't know about &lt;code&gt;byobu&lt;/code&gt; however.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-02-24T09:00:07.427" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20549" PostTypeId="2" ParentId="20534" CreationDate="2016-02-24T09:04:00.740" Score="1" Body="&lt;p&gt;This appears to have been due to &lt;a href=&quot;https://github.com/bbatsov/projectile/issues/657&quot; rel=&quot;nofollow&quot;&gt;this issue&lt;/a&gt; in projectile, which I use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I followed the suggestion in a comment on that issue of using this workaround:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'find-file-hook&#xA;          (lambda ()&#xA;            (if (locate-dominating-file default-directory &quot;.git&quot;)&#xA;                (projectile-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. removing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-projectile-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from my &lt;code&gt;.emacs&lt;/code&gt; and replacing it with the above code, and performance is now acceptable (there is a lag on opening the file, and on the first keypress that makes an edit to the file, as I would expect). This does mean that projectile is only activated in git projects, but that's fine for me - and the same workaround can easily be extended to other version control systems if necessary.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-02-24T09:04:00.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20550" PostTypeId="2" ParentId="20538" CreationDate="2016-02-24T10:30:51.070" Score="3" Body="&lt;p&gt;I guess something like this might work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: angctl&#xA;# key: angctl&#xA;# --&#xA;$1.controller('$2', [${3:$(mapconcat (lambda (x) (format &quot;'%s'&quot; x))&#xA;                                     (split-string yas-text &quot;,&quot; t &quot;[ \t]&quot;) &quot;, &quot;)}, function($3) {&#xA;$0;&#xA;}])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in action:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hyX6o.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hyX6o.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2016-02-24T10:30:51.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20551" PostTypeId="2" ParentId="20490" CreationDate="2016-02-24T11:15:03.517" Score="0" Body="&lt;p&gt;Thanks to thierryvolpiatto from Helm's github, I learnt the answer. Helm interprets spaces as search pattern separators so they should be escaped with backslashes. &lt;/p&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-02-24T11:15:03.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20552" PostTypeId="1" CreationDate="2016-02-24T12:30:42.233" Score="1" ViewCount="26" Body="&lt;p&gt;Colleague of mine showed me a cool feature of gnome-builder which does colour symbols based on whether they are defined or not and I was wondering whether it is possible in Emacs as well.  And by that I mean whether there is already an existing solution so that I don't have to write the whole colouring backend or something like that.  I'm color-theme noob, I just have one that suits me and use it.  So, if there's an easy way how to add that feature by hooks, that's still fine.  I'm currently using &lt;code&gt;gtags&lt;/code&gt; backend for &lt;code&gt;helm&lt;/code&gt; if that helps.&lt;/p&gt;&#xA;" OwnerUserId="8445" LastActivityDate="2016-02-24T12:30:42.233" Title="How can I have C functions coloured based on whether they are defined?" Tags="|colors|c|gtags|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20553" PostTypeId="1" AcceptedAnswerId="20563" CreationDate="2016-02-24T12:52:51.993" Score="0" ViewCount="1022" Body="&lt;p&gt;I am using Emacs 24.5.1 and I seem to have a problem loading the &lt;code&gt;web-mode&lt;/code&gt; package using &lt;code&gt;use-package&lt;/code&gt;. I managed to narrow it down to the following &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;(mapc (lambda(p) (add-to-list 'package-archives p t))&#xA;      '((&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;        (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;        (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))) &#xA;&#xA;(package-initialize)&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;(require 'use-package)&#xA;&#xA;(use-package web-mode&#xA;   :init&#xA;   (progn&#xA;     (setq web-mode-enable-current-element-highlight t)&#xA;     (setq web-mode-enable-current-column-highlight t)&#xA;     (add-to-list 'auto-mode-alist '(&quot;\\.html\\'&quot; . web-mode))&#xA;     (defun my-web-mode-hook ()&#xA;       &quot;Hooks for Web mode.&quot;&#xA;       (setq web-mode-markup-indent-offset 2)&#xA;       (setq web-mode-css-indent-offset 2)&#xA;       (setq web-mode-code-indent-offset 2)&#xA;       (setq web-mode-style-padding 1)&#xA;       (setq web-mode-script-padding 1)&#xA;       (setq web-mode-block-padding 0)&#xA;       )&#xA;     (add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;     (eval-after-load &quot;web-mode&quot;&#xA;       '(set-face-background 'web-mode-current-element-highlight-face &quot;color-88&quot;))&#xA;     )&#xA;   :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I start &lt;code&gt;emacs&lt;/code&gt; with the above &lt;code&gt;.emacs&lt;/code&gt; I get the message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/mperdikeas/.emacs':&#xA;&#xA;Symbol's value as variable is void: &amp;lt;html&amp;gt;&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The backtrace with &lt;code&gt;--debug-init&lt;/code&gt; is not much informative (to me at least):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable &amp;lt;html&amp;gt;)&#xA;byte-code(\210  \210\n\210&#xA;\210\210\21\210        \210\n\210\210\f\210&#xA;\210\210\210\210\210\210\210\210\207&quot; [&amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;script type= &amp;gt;location\.href= &amp;lt;/script&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;body&amp;gt; Authentication is required\. Click &amp;lt;a href= &amp;gt;here&amp;lt;/a&amp;gt; to open the authentication page\. &amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;] 1)&#xA;require(web-mode nil noerror)&#xA;(not (require (quote web-mode) nil (quote noerror)))&#xA;(if (not (require (quote web-mode) nil (quote noerror))) (ignore (message (format &quot;Could not load %s&quot; (quote web-mode)))))&#xA;(progn (condition-case err (progn (setq web-mode-enable-current-element- highlight t) (setq web-mode-enable-current-column-highlight t) (add-to-list   (quote auto-mode-alist) (quote (&quot;\\.html\\'&quot; . web-mode))) (defalias (quote my- web-mode-hook) (function (lambda nil &quot;Hooks for Web mode.&quot; (setq web-mode- markup-indent-offset 2) (setq web-mode-css-indent-offset 2) (setq web-mode-code- indent-offset 2) (setq web-mode-style-padding 1) (setq web-mode-script-padding  1) (setq web-mode-block-padding 0)))) (add-hook (quote web-mode-hook) (quote my- web-mode-hook)) (eval-after-load &quot;web-mode&quot; (function (lambda nil (set-face- background (quote web-mode-current-element-highlight-face) &quot;color-88&quot;)))))  ((debug error) (ignore (display-warning (quote use-package) (format &quot;%s %s: %s&quot;  &quot;web-mode&quot; &quot;:init&quot; (error-message-string err)) :error)))) (if (not (require  (quote web-mode) nil (quote noerror))) (ignore (message (format &quot;Could not load   %s&quot; (quote web-mode))))))&#xA;eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/mperdikeas/.emacs&quot; nil t)  ; Reading at buffer position 1250&#xA;  load-with-code-conversion(&quot;/home/mperdikeas/.emacs&quot;   &quot;/home/mperdikeas/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 \205\262  \306=\203\30\310Q\202;  \311=\204\30\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\ nB\321\202;\316\322\323\322\211#\210&#xA;                                                                         \322=\203a\324\325\326\30\327Q!\&quot;\323\322\211#\210&#xA;                                       \322=\203`\210&#xA;                                                       \203\243\330&#xA;                                                                    !\331\232\203\243\332&#xA;     !\211\333P\334!\203}\211\202\210\334!\203\207\202\210\314\262\203\241\335&#xA; \&quot;\203\237\336\337&#xA;                   #\210\340\341!\210\266\f?\205\260\314\323\342\322\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; (initialization &quot;`_emacs' init file is deprecated, please use `.emacs'&quot;) &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7 &quot;\n\n(fn)&quot;]()&#xA; command-line()&#xA; normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2016-02-24T16:47:17.363" Title="problem with web-mode: Symbol's value as variable is void: &lt;html&gt;" Tags="|use-package|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20554" PostTypeId="2" ParentId="20547" CreationDate="2016-02-24T13:14:49.893" Score="10" Body="&lt;p&gt;Try to use the &lt;code&gt;:placement [H]&lt;/code&gt; modifier like in this example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;    #+NAME: tblSideways&#xA;    #+CAPTION: A sidewaystable&#xA;    #+ATTR_LATEX: :font \footnotesize :float sidewaystable :placement [H]&#xA;    | Column 1 | Column 2 | Column 3 | Column 4 | Column 5 | Column 6 |&#xA;    |----------+----------+----------+----------+----------+----------|&#xA;    |        1 |       10 |      100 |     1000 | example  | result   |&#xA;    |        2 |       11 |      101 |     1001 | example  | result   |&#xA;    |        3 |       12 |      102 |     1002 | example  | result   |&#xA;    |        4 |       13 |      103 |     1003 | example  | result   |&#xA;    |        5 |       14 |      104 |     1004 | example  | result   |&#xA;    |        6 |       15 |      105 |     1005 | example  | result   |&#xA;    |        7 |       16 |      106 |     1006 | example  | result   |&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this works, even though in the documentation it reads&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;:placement is ignored for :float sideways tables.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The modifier &lt;code&gt;[H]&lt;/code&gt; is observed, as can be confirmed in the resulting LaTeX, as can be seen here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;\begin{sidewaystable}[H]&#xA;\caption{\label{tab:orgtable3}&#xA;A sidewaystable}&#xA;\centering&#xA;\footnotesize&#xA;\begin{tabular}{rrrrll}&#xA;Column 1 &amp; Column 2 &amp; Column 3 &amp; Column 4 &amp; Column 5 &amp; Column 6\\&#xA;\hline&#xA;1 &amp; 10 &amp; 100 &amp; 1000 &amp; example &amp; result\\&#xA;2 &amp; 11 &amp; 101 &amp; 1001 &amp; example &amp; result\\&#xA;3 &amp; 12 &amp; 102 &amp; 1002 &amp; example &amp; result\\&#xA;4 &amp; 13 &amp; 103 &amp; 1003 &amp; example &amp; result\\&#xA;5 &amp; 14 &amp; 104 &amp; 1004 &amp; example &amp; result\\&#xA;6 &amp; 15 &amp; 105 &amp; 1005 &amp; example &amp; result\\&#xA;7 &amp; 16 &amp; 106 &amp; 1006 &amp; example &amp; result\\&#xA;\end{tabular}&#xA;\end{sidewaystable}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can find an example Org file + rendered PDF in my examples at &lt;a href=&quot;https://github.com/dfeich/org-babel-examples/tree/master/latex&quot;&gt;https://github.com/dfeich/org-babel-examples/tree/master/latex&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference: I am using Emacs version: GNU Emacs 25.1.50.3 and&#xA;org version: 8.3.3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&#xA;Derek&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="2025" LastEditDate="2016-02-24T13:37:07.873" LastActivityDate="2016-02-24T13:37:07.873" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20555" PostTypeId="1" AcceptedAnswerId="20559" CreationDate="2016-02-24T13:27:08.777" Score="3" ViewCount="4811" Body="&lt;p&gt;I copied and paste text in an org file and formatted it as a list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Funded pensions :: As explained more fully in Chapter 3, funded pensions are paid on behalf of its members.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I have the list formatted as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Funded pensions :: As explained more fully in Chapter 3, funded pensions are&#xA;      paid on behalf of its members.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another simple example where &lt;code&gt;fill-region-paragraphs&lt;/code&gt;does not work is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* first header&#xA;&#xA;- The primary objective of pensions is /economic security in old age/, achieved&#xA;through consumption smoothing, insurance, poverty relief, and redistribution.&#xA;- The primary objective of pension design is to /optimize old-age security/, includ-&#xA;ing the cost of providing it.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6988" LastEditorUserId="6988" LastEditDate="2016-02-25T00:03:19.427" LastActivityDate="2016-02-25T00:03:19.427" Title="Indenting lists in org-mode" Tags="|org-mode|indentation|list|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20556" PostTypeId="1" CreationDate="2016-02-24T13:32:30.747" Score="4" ViewCount="464" Body="&lt;p&gt;In orgmode you can move subtrees up and down using &lt;code&gt;org-metaup&lt;/code&gt; and &lt;code&gt;org-metadown&lt;/code&gt;. I use it all the time to move paragraphs around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do the same with sentences inside a paragraph?&lt;/p&gt;&#xA;" OwnerUserId="8844" LastActivityDate="2016-02-24T15:53:36.000" Title="How do you move sentences in orgmode?" Tags="|org-mode|sentences|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20557" PostTypeId="2" ParentId="20556" CreationDate="2016-02-24T13:57:06.463" Score="2" Body="&lt;p&gt;You can use drag-stuff: &lt;a href=&quot;https://github.com/rejeep/drag-stuff.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rejeep/drag-stuff.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'drag-stuff)&#xA;(drag-stuff-global-mode t)&#xA;(add-to-list 'drag-stuff-except-modes 'org-mode) # concurent&#xA;(eval-after-load &quot;org&quot;&#xA;    '(progn&#xA;       (define-key org-mode-map (kbd &quot;M-s-&amp;lt;up&amp;gt;&quot;) 'drag-stuff-up)&#xA;       (define-key org-mode-map (kbd &quot;M-s-&amp;lt;down&amp;gt;&quot;) 'drag-stuff-down)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-02-24T13:57:06.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20558" PostTypeId="2" ParentId="20556" CreationDate="2016-02-24T14:52:29.327" Score="4" Body="&lt;p&gt;Don't forget the vanilla sentence commands. The main ones out of the box that might be relevant here are &lt;code&gt;transpose-sentences&lt;/code&gt;, &lt;code&gt;mark-end-of-sentence&lt;/code&gt;, &lt;code&gt;kill-sentence&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;M-k&lt;/code&gt;&lt;/strong&gt;), and &lt;code&gt;backward-kill-sentence&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;C-x &amp;lt;backspace&amp;gt;&lt;/code&gt;&lt;/strong&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Others include: &lt;code&gt;backward-sentence&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;M-a&lt;/code&gt;&lt;/strong&gt;), &lt;code&gt;forward-sentence&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;M-e&lt;/code&gt;&lt;/strong&gt;, &lt;code&gt;repunctuate-sentences&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-02-24T15:53:36.000" LastActivityDate="2016-02-24T15:53:36.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20559" PostTypeId="2" ParentId="20555" CreationDate="2016-02-24T15:05:50.110" Score="5" Body="&lt;p&gt;Note, the problem with the original version of &lt;code&gt;paragraph-fill&lt;/code&gt; is that it calls &lt;code&gt;fill-region&lt;/code&gt; if the region is active. This merges all items into one filled item instead of several filled items.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There follows a command &lt;code&gt;fill-region-paragraphs&lt;/code&gt; that fills each paragraph with the non-interactive version of &lt;code&gt;fill-paragraph&lt;/code&gt; instead.&#xA;Thus the items in the region are filled separately.&#xA;In the code the command is bound to the key sequence &lt;kbd&gt;C-c f&lt;/kbd&gt;. You can change this to your likings.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun fill-region-paragraphs (b e &amp;amp;optional justify)&#xA;  &quot;Fill region between b and e like `fill-paragraph' for each paragraph in region&#xA;instead of `fill-region' which is implied by the original version of `fill-paragraph'.&#xA;Justify when called with prefix arg.&quot;&#xA;  (interactive &quot;r\nP&quot;)&#xA;  (save-excursion&#xA;    (goto-char b)&#xA;    (while (&amp;lt; (point) e)&#xA;      (fill-paragraph justify)&#xA;      (forward-paragraph)&#xA;      )))&#xA;(global-set-key (kbd &quot;C-c f&quot;) 'fill-region-paragraphs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Below, there is an extented version of the code from &lt;a href=&quot;https://emacs.stackexchange.com/questions/19252/how-can-i-paste-paragraph-not-to-interrupt-numbers-in-list-org-mode#19872&quot;&gt;the answer to another question&lt;/a&gt;.&#xA;I've added &lt;code&gt;paragraph-fill&lt;/code&gt; to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First select the items you want to be filled. Then press the prefix arg &lt;kbd&gt;C-u&lt;/kbd&gt; and &lt;kbd&gt;C-+&lt;/kbd&gt; to get the formatting you want.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-adjust-region (b e)&#xA;  &quot;Re-adjust stuff in region according to the preceeding stuff.&quot;&#xA;  (interactive &quot;r&quot;) ;; current region&#xA;  (save-excursion&#xA;    (let ((e (set-marker (make-marker) e))&#xA;      (_indent (lambda ()&#xA;             (insert ?\n)&#xA;             (backward-char)&#xA;             (org-indent-line)&#xA;             (delete-char 1)))&#xA;      last-item-pos)&#xA;      (goto-char b)&#xA;      (beginning-of-line)&#xA;      (while (&amp;lt; (point) e)&#xA;    (indent-line-to 0)&#xA;    (cond&#xA;     ((looking-at &quot;[[:space:]]*$&quot;)) ;; ignore empty lines&#xA;     ((org-at-heading-p)) ;; just leave the zero-indent&#xA;     ((org-at-item-p)&#xA;      (funcall _indent)&#xA;      (let ((struct (org-list-struct))&#xA;        (mark-active nil))&#xA;        (ignore-errors (org-list-indent-item-generic -1 t struct)))&#xA;      (setq last-item-pos (point))&#xA;      (when current-prefix-arg&#xA;        (fill-paragraph)))&#xA;     ((org-at-block-p)&#xA;      (funcall _indent)&#xA;      (goto-char (plist-get (cadr (org-element-special-block-parser e nil)) :contents-end))&#xA;      (org-indent-line))&#xA;     (t (funcall _indent)))&#xA;    (forward-line))&#xA;      (when last-item-pos&#xA;    (goto-char last-item-pos)&#xA;    (org-list-repair)&#xA;    ))))&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-+&quot;) 'org-adjust-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;emacs -Q&lt;/code&gt; 25.1.50.2 I used the following org file &lt;code&gt;test.org&lt;/code&gt; for testing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* first header&#xA;&#xA;- Funded pensions :: As explained more fully in Chapter 3, funded pensions are paid on behalf of its members.&#xA;- Funded pensions :: As explained more fully in Chapter 3, funded pensions are paid on behalf of its members.&#xA;- Funded pensions :: As explained more fully in Chapter 3, funded pensions are paid on behalf of its members.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Selecting all items as region and calling &lt;code&gt;fill-region-as-paragraph&lt;/code&gt; resulted into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* first header&#xA;&#xA;- Funded pensions :: As explained more fully in Chapter 3, funded&#xA;pensions are paid on behalf of its members.  - Funded pensions :: As&#xA;explained more fully in Chapter 3, funded pensions are paid on behalf&#xA;of its members.  - Funded pensions :: As explained more fully in&#xA;Chapter 3, funded pensions are paid on behalf of its members.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is clearly not what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying &lt;code&gt;fill-region-paragraphs&lt;/code&gt; results into the following text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* first header&#xA;&#xA;- Funded pensions :: As explained more fully in Chapter 3, funded&#xA;     pensions are paid on behalf of its members.&#xA;- Funded pensions :: As explained more fully in Chapter 3, funded&#xA;     pensions are paid on behalf of its members.&#xA;- Funded pensions :: As explained more fully in Chapter 3, funded&#xA;     pensions are paid on behalf of its members.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This text looks to me like what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;kbd&gt;C-u C-+&lt;/kbd&gt; even gets the indentation right:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* first header&#xA;&#xA;  - Funded pensions :: As explained more fully in Chapter 3, funded&#xA;       pensions are paid on behalf of its members.&#xA;  - Funded pensions :: As explained more fully in Chapter 3, funded&#xA;       pensions are paid on behalf of its members.&#xA;  - Funded pensions :: As explained more fully in Chapter 3, funded&#xA;       pensions are paid on behalf of its members.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-24T20:30:15.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20560" PostTypeId="1" CreationDate="2016-02-24T15:42:59.807" Score="2" ViewCount="263" Body="&lt;p&gt;I am trying to use Tramp to log into a Docker container running on a VM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Docker-related setup looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-methods&#xA;             '(&quot;docker-exec&quot;&#xA;               (tramp-login-program &quot;docker&quot;)&#xA;               (tramp-login-args&#xA;                ((&quot;exec&quot; &quot;-ti&quot;) (&quot;%h&quot;) (&quot;/bin/sh&quot;)))&#xA;               (tramp-remote-shell &quot;/bin/sh&quot;)&#xA;               (tramp-remote-shell-args (&quot;-i&quot;) (&quot;-c&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can use this on my machine to access directories inside container, but when I try to &quot;hop&quot; to remote machine like this: &lt;kbd&gt;C-x C-f&lt;/kbd&gt;&lt;code&gt;/ssh:root@vm|docker-exec:ed703f92ae19:/&lt;/code&gt; Tramp will at first get confused about &lt;code&gt;ls&lt;/code&gt; command because it would add a &lt;code&gt;^M&lt;/code&gt; characters at the end of the line and thus &lt;code&gt;tramp-find-executable&lt;/code&gt; will return something like &lt;code&gt;/usr/bin/ls^M&lt;/code&gt;, which would generate invalid command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to overcome this with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/tramp-find-executable&#xA;    (func vec progname dirlist &amp;amp;optional ignore-tilde ignore-path)&#xA;  (org-trim (funcall func vec progname dirlist ignore-tilde ignore-path)))&#xA;&#xA;(advice-add 'tramp-find-executable&#xA;            :around 'my/tramp-find-executable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;byte-code: Wrong type argument: number-or-marker-p, //DIRED-OPTIONS//&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the log looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;//DIRED-OPTIONS// --quoting-style=literal&#xA;///c92423c4fd16f4857a1b9d765f804f3e#$&#xA;17:32:16.175776 tramp-get-connection-property (7) # check-remote-echo nil&#xA;17:32:16.175817 tramp-get-connection-property (7) # check-remote-echo nil&#xA;17:32:16.175869 tramp-wait-for-regexp (6) # &#xA;  total 292&#xA;  drwxr-xr-x  18 root root   4096 Feb 24 09:08 .&#xA;  drwxr-xr-x  18 root root   4096 Feb 24 09:08 ..&#xA;  -rwxr-xr-x   1 root root      0 Feb 24 09:08 .dockerenv&#xA;  -rwxr-xr-x   1 root root      0 Feb 24 09:08 .dockerinit&#xA;  lrwxrwxrwx   1 root root      7 Mar 30  2015 bin -&amp;gt; usr/bin&#xA;&amp;lt;&amp;lt;&amp;lt; skipped &amp;gt;&amp;gt;&amp;gt;&#xA;  drwxrwxrwt   2 root root   4096 Feb 24 15:29 tmp&#xA;  drwxr-xr-x  13 root root   4096 Mar 30  2015 usr&#xA;  drwxr-xr-x  18 root root   4096 Mar 30  2015 var&#xA;//DIRED// 59 60 108 110 158 168 216 227 275 278 337 340 388 391 439 443 491 494 553 558 619 629 677 682 730 733 781 784 832 836 884 888 936 939 987 991 1051 1058 1106 1109 1157 1160 1208 1217 1265 1268 1316 1319 1367 1370&#xA;//DIRED-OPTIONS// --quoting-style=literal&#xA;///c92423c4fd16f4857a1b9d765f804f3e#$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I don't know what Tramp was trying to do, when it received this error, so I cannot think of a way to fix it.  But, maybe this is a known bug? Or, maybe I need some extra settings for Tramp so that it would not add &lt;code&gt;^M&lt;/code&gt;s? (I doubt they are in the original output since both machines run Linux, both CentOS.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="25" LastEditDate="2016-02-24T17:13:23.047" LastActivityDate="2016-02-24T17:13:23.047" Title="Multihop tramp adds extra carriage returns and gets confused by the output" Tags="|tramp|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="20561" PostTypeId="2" ParentId="20515" CreationDate="2016-02-24T16:02:41.570" Score="4" Body="&lt;p&gt;This is not necessarily a direct answers to what you should put in your &lt;code&gt;.emacs&lt;/code&gt; file but rather a more generic way to quickly figure out the parameters for the style you've chosen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cc-mode&lt;/code&gt; provide several functions to directly guess the right indentation parameters. They are aptly prefixed with &lt;code&gt;c-guess-&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this case in particular you could use the functions &lt;code&gt;c-guess-no-install&lt;/code&gt; followed by &lt;code&gt;c-guess-view&lt;/code&gt;. This will open a buffer where &lt;code&gt;cc-mode&lt;/code&gt; has guessed the appropriate indentation parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., Copying your code and running those commands give me this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(c-add-style &quot;STYLE NAME HERE&quot;&#xA;             '(&quot;linux-tabs-style&quot;&#xA;               (c-basic-offset . 3)     ; Guessed value&#xA;               (c-offsets-alist&#xA;                (block-close . 0)       ; Guessed value&#xA;                (defun-block-intro . +) ; Guessed value&#xA;                (defun-close . 0)       ; Guessed value&#xA;                (else-clause . 0)       ; Guessed value&#xA;                (statement . 0)         ; Guessed value&#xA;                (statement-block-intro . +) ; Guessed value&#xA;                (topmost-intro . 0)         ; Guessed value&#xA;                (topmost-intro-cont . c-lineup-topmost-intro-cont))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, you can simply name this style and use &lt;code&gt;c-set-style&lt;/code&gt; to use it.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2016-02-24T16:02:41.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20562" PostTypeId="1" AcceptedAnswerId="20568" CreationDate="2016-02-24T16:17:58.873" Score="6" ViewCount="1212" Body="&lt;p&gt;I have a table maintained by org-mode, and I would like to copy/paste it to an email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is what I was trying to do:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;export to the plain text&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;copy/paste to the gmail &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However, it just cannot aligned correctly among different columns.. This is something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AhLeq.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AhLeq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone help me on this issue? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="2805" LastEditorUserId="2055" LastEditDate="2016-02-25T03:03:24.440" LastActivityDate="2016-02-25T03:03:24.440" Title="How to make the org-mode exported table aligned in GMail?" Tags="|org-mode|org-export|org-table|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20563" PostTypeId="2" ParentId="20553" CreationDate="2016-02-24T16:47:17.363" Score="2" Body="&lt;p&gt;It appears that the installation of &lt;code&gt;web-mode&lt;/code&gt; has failed. Instead of getting an elisp file, you got a user oriented HTML file telling you that you are not authorized to get the file. Try to download the file manually in order to understand what happened and why.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-02-24T16:47:17.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20564" PostTypeId="2" ParentId="20441" CreationDate="2016-02-24T16:56:36.447" Score="1" Body="&lt;p&gt;Per @dfeich suggestion I installed org from ELPA and internal links became case insensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The version that I installed from ELPA is 8.3.4 (20160222). The built in version that I had before was 7.9.3f.&lt;/p&gt;&#xA;" OwnerUserId="11177" LastActivityDate="2016-02-24T16:56:36.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20565" PostTypeId="1" AcceptedAnswerId="23869" CreationDate="2016-02-24T18:04:55.937" Score="2" ViewCount="995" Body="&lt;p&gt;I'm trying to customize Helm buffers' mode-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have set &lt;code&gt;mode-line-format&lt;/code&gt; with &lt;code&gt;powerline&lt;/code&gt; package: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA; '(&quot;%e&quot;&#xA;   (:eval&#xA;    (let* ((active (powerline-selected-window-active))&#xA;&#xA;           ;; Conditionnal faces (in function of `active')&#xA;           ...&#xA;&#xA;           ;; Left elements&#xA;           (lhs ...)&#xA;&#xA;           ;; Right elements&#xA;           (rhs ...))&#xA;&#xA;      ;; Build the result&#xA;      (concat&#xA;       (powerline-render lhs)&#xA;       (powerline-fill mode-line-3-face (powerline-width rhs))&#xA;       (powerline-render rhs))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From what I understand from &lt;code&gt;helm-mode-line-string&lt;/code&gt;'s documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Help string displayed in mode-line in &lt;code&gt;helm'. It can be a string or a list of two args, in this case, first arg is a string that will be used as name for candidates number, second arg any string to display in mode line. If nil, use default&lt;/code&gt;mode-line-format'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I should be able to have my customized mode-line everywhere (in every buffers) with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default helm-mode-line-string nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Isn't &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/c59386797abaa91b9f8dec5a5ac48bf24e4bd7e3/helm.el#L3846&quot; rel=&quot;nofollow&quot;&gt;this line&lt;/a&gt; from helm.el supposed to do exactly what I want?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-format (default-value 'mode-line-format))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Edit&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Works as intended with: &lt;code&gt;helm-colors&lt;/code&gt;, &lt;code&gt;helm-projectile-ag&lt;/code&gt;, &lt;code&gt;helm-projectile-grep&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But not with: &lt;code&gt;helm-M-x&lt;/code&gt;, &lt;code&gt;helm-projectile-find-file&lt;/code&gt;, &lt;code&gt;helm-projectile-switch-project&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2016-02-25T14:06:20.920" LastActivityDate="2016-06-10T15:16:15.017" Title="How to customize Helm buffers' mode-line" Tags="|helm|mode-line|mode-line-format|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20567" PostTypeId="1" AcceptedAnswerId="20639" CreationDate="2016-02-24T19:42:48.600" Score="1" ViewCount="287" Body="&lt;p&gt;I write my projects in &lt;em&gt;FreePascal&lt;/em&gt; and use &lt;code&gt;opascal-mode&lt;/code&gt; to write it. I'm having a problem that this mode thinks that &lt;code&gt;'\'&lt;/code&gt; is not a complete string, and hence all code after it is highlighted as a string.&#xA;&lt;strong&gt;How can I change the opascal-mode (or add a hook) in which it will not try to parse the backslash as an escape character?&lt;/strong&gt; In FreePascal, strings do not support backslash as an escape char.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.5.1 and this is a sample code that when run in opascal-mode, it highlights everything after the &lt;code&gt;'\'&lt;/code&gt; improperly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// syntax_highlight.dpr                                                                                                                                                                                                &#xA;&#xA;{$mode objfpc}{$H+}&#xA;program my_program;&#xA;uses Classes;&#xA;&#xA;var newVal : char;&#xA;&#xA;begin&#xA;  newVal := '\'; // syntax highlight breaks here!                                                                                                                                                                                                       &#xA;  if newVal = '''' then begin                                                                                                                                                                                          &#xA;    writeln('single quote');                                                                                                                                                                                                    &#xA;  end else if newVal = '\' then begin&#xA;    writeln('backslash');&#xA;  end;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried messing around with &lt;code&gt;modify-syntax-entry&lt;/code&gt;, but nothing I tried worked.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: this is the fixed config in &lt;code&gt;~/.emacs&lt;/code&gt; after I've implemented @JeanPierre's fix&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; associate pascal files as opascal-mode                                                                                                                                                              &#xA;(add-to-list 'auto-mode-alist '(&quot;\\.pas$&quot; . opascal-mode))&#xA;(let* ((pascal-files '(&quot;.pas&quot; &quot;.pp&quot; &quot;.inc&quot; &quot;.lpr&quot; &quot;.dpr&quot;))&#xA;       (pascal-regexp (concat (regexp-opt pascal-files t) &quot;\\'&quot;)))&#xA;  (add-to-list 'auto-mode-alist (cons pascal-regexp 'opascal-mode)))&#xA;&#xA;;; don't escape backslashes in pascal    &#xA;(add-hook 'opascal-mode-hook&#xA;          (modify-syntax-entry ?\\ &quot;.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11226" LastEditorUserId="11226" LastEditDate="2016-02-29T18:06:25.340" LastActivityDate="2016-02-29T18:06:25.340" Title="syntax-highlighting strings incorrectly for strings in opascal-mode" Tags="|major-mode|syntax-highlighting|string|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20568" PostTypeId="2" ParentId="20562" CreationDate="2016-02-24T20:07:36.970" Score="8" Body="&lt;p&gt;You can export the table to Markdown and use &lt;a href=&quot;http://markdown-here.com/&quot; rel=&quot;noreferrer&quot;&gt;Markdown Here&lt;/a&gt; to format the table in your email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x org-md-export-as-markdown&lt;/code&gt; will export your document as Markdown, but the tables will be exported as HTML. This may be fine for your purposes, but if not you can install &lt;a href=&quot;https://github.com/kawabata/ox-pandoc&quot; rel=&quot;noreferrer&quot;&gt;ox-pandoc&lt;/a&gt; and export your org-mode document with &lt;code&gt;M-x org-pandoc-export-as-markdown_github&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will convert an org table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Column 1 | Column 2 |&#xA;|----------+----------|&#xA;| a        |        1 |&#xA;| b        |        2 |&#xA;| c        |        3 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To a Markdown table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Column 1 | Column 2 |&#xA;|----------|----------|&#xA;| a        | 1        |&#xA;| b        | 2        |&#xA;| c        | 3        |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Paste this table into your email and use Markdown Here (keyboard shortcut: Ctrl-Alt-m) to format it. It should then look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zoo7F.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zoo7F.png&quot; alt=&quot;Rendered table&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7060" LastActivityDate="2016-02-24T20:07:36.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20569" PostTypeId="1" CreationDate="2016-02-24T20:39:48.530" Score="1" ViewCount="1514" Body="&lt;p&gt;I'm playing with org mode and org-journal for the first time. My basic entry looks like&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Wednesday, 02/24/2016&#xA;** 15:02 Blah blah blah&#xA;&#xA;notes written here.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I would now like to append something to today's entry so that I get something like&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;** 15:37 A new entry&#xA;&#xA;Here we go...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I can't find any way to do this via a key binding. Of course, I could enter the new time manually, but I don't want to do that. Is there some way to do this?&lt;/p&gt;&#xA;&lt;p&gt;Edit: I have tried C-u C-j, which does indeed open the current day's journal with a new time entry, but this journal cuts opens on a second window&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7t6wR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7t6wR.png&quot; alt=&quot;Before C-u C-j&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/I4v0K.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/I4v0K.png&quot; alt=&quot;After C-u C-j&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'm not sure which version of org-mode I'm using, but it's probably the latest, since I installed it a couple of days ago.&lt;/p&gt;&#xA;" OwnerUserId="11227" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-10-25T20:43:42.480" Title="org-journal: How to add new entry at current time?" Tags="|org-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20570" PostTypeId="2" ParentId="16858" CreationDate="2016-02-24T21:12:09.147" Score="2" Body="&lt;p&gt;If you really want to use more than one full emacs configuration at the same time and not only some major mode configurations, then you can use the configuration that I have described here: &lt;a href=&quot;https://emacs.stackexchange.com/a/20508/934&quot;&gt;https://emacs.stackexchange.com/a/20508/934&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this &lt;code&gt;.emacs&lt;/code&gt;-file you can start emacs with a configuration directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EMACS_USER_DIRECTORY=~/your/emacs.d emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This even works as a daemon.&lt;/p&gt;&#xA;" OwnerUserId="934" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-24T21:12:09.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20571" PostTypeId="1" AcceptedAnswerId="20573" CreationDate="2016-02-24T21:21:39.113" Score="1" ViewCount="266" Body="&lt;p&gt;I've only just started with Emacs (about 6 weeks now) so I'm not really familiar with its coding language. I was wondering if it was possible to write, for Emacs, the equivalent of a Python macro I have in my Sublime Text setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Sublime Text, I have a Python macro which can transform selected lines of text. If I select the lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo&#xA;bar&#xA;baz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and press my chosen shortcut &lt;code&gt;C-l C-s&lt;/code&gt; the text is transformed to &lt;code&gt;['foo', 'bar', 'baz']&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering how to could do this for Emacs.&lt;/p&gt;&#xA;" OwnerUserId="8730" LastEditorUserId="105" LastEditDate="2016-03-13T22:02:16.540" LastActivityDate="2016-03-13T22:02:16.540" Title="Transform selected text like a Python macro" Tags="|text-editing|formatting|keyboard-macros|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20572" PostTypeId="2" ParentId="4253" CreationDate="2016-02-24T21:47:26.233" Score="12" Body="&lt;p&gt;A configuration that doesn't change &lt;code&gt;HOME&lt;/code&gt; or works with symlinks can be found in my answer &lt;a href=&quot;https://emacs.stackexchange.com/a/20508/934&quot;&gt;https://emacs.stackexchange.com/a/20508/934&lt;/a&gt;. With this configuration you can change the &lt;code&gt;user-emacs-directory&lt;/code&gt; by setting an environment variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EMACS_USER_DIRECTORY=~/.emacsenv.d/spacemacs emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this even works with the daemon.&lt;/p&gt;&#xA;" OwnerUserId="934" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-02-24T21:47:26.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20573" PostTypeId="2" ParentId="20571" CreationDate="2016-02-24T22:24:27.837" Score="5" Body="&lt;p&gt;This method will take the selected lines, wrap them in single quotes, and put them inside a list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun lines-to-list (point mark)&#xA;  (interactive &quot;r&quot;)&#xA;  (let ((text (buffer-substring point mark)))&#xA;    (delete-region point mark)&#xA;    (insert &quot;[&quot;)&#xA;    (insert (mapconcat (lambda (line) (format &quot;'%s'&quot; line))&#xA;                       (split-string text &quot;\s*\n\s*&quot;)&#xA;                       &quot;, &quot;))&#xA;    (insert &quot;]&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can, bind them to a key shortcut like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key python-mode-map (kbd &quot;C-c C-l&quot;) #'lines-to-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2016-02-24T23:44:48.127" LastActivityDate="2016-02-24T23:44:48.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20574" PostTypeId="1" AcceptedAnswerId="20598" CreationDate="2016-02-25T00:04:13.233" Score="15" ViewCount="2509" Body="&lt;p&gt;When an image has a transparent background, Emacs of course respects that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this can lead to issues with display:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ydbuJ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ydbuJ.png&quot; alt=&quot;black text on dark background&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to display a specific color (e.g. white) behind the image? There appears to be some support for it in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/ImageMagick-Images.html#ImageMagick-Images&quot; rel=&quot;noreferrer&quot;&gt;ImageMagick images&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specific stuff I'm working with right now can have the background color set, however I have to add an extra few lines to &lt;em&gt;every single figure&lt;/em&gt; in order to do that, which is less than ideal. I would like to get it to where inline images displayed in org-mode have the background color set by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: this isn't org-babel specific, it just happens to be how I'm getting these images right now)&lt;/p&gt;&#xA;" OwnerUserId="147" LastEditorUserId="105" LastEditDate="2016-02-25T05:00:33.230" LastActivityDate="2020-11-21T19:06:53.613" Title="Default Inline Image Background in Org Mode" Tags="|org-mode|images|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20575" PostTypeId="2" ParentId="19808" CreationDate="2016-02-25T02:33:41.017" Score="5" Body="&lt;p&gt;This depends on the fonts you are using. And I don't think Elisp has pixel level alignment capability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org calculate width of string with &lt;code&gt;string-width&lt;/code&gt; instead of &lt;code&gt;length&lt;/code&gt;.  &lt;code&gt;string-width&lt;/code&gt; returns 1 for ASCII and Half width CJK chars or 2 for Full width chars. Evaluate the following code will show you that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-width &quot;m&quot;)&#xA;1&#xA;(string-width &quot;ﾊ&quot;)&#xA;1&#xA;(string-width &quot;は&quot;)&#xA;2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, even though Org mode got the right answer from the sting property, and added pads around strings, it is the Emacs display engine's job to place where those bits go on the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs display engine gets font information from the underlying OS. To make the complex problem simple, let's say that, with your configuration, &lt;code&gt;m&lt;/code&gt;'s width is 5 pixels and &quot;は&quot; is 10. In this case they will be perfectly aligned because Org mode's assumption (&quot;は&quot; takes twice the width of &quot;m&quot;) matches with the actual pixels on your screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, if your fonts configuration has 7 pixel for &quot;m&quot; and 10 pixel for &quot;は&quot;, the things won't match up.  And there is nothing Org mode nor the Display engine can do.  They did what they told, by your configuration, to do.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2017-01-20T00:56:21.353" LastActivityDate="2017-01-20T00:56:21.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20576" PostTypeId="2" ParentId="20569" CreationDate="2016-02-25T03:54:21.897" Score="0" Body="&lt;p&gt;As I recommended before, try: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-j&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to add new journal entries in the same window. &lt;code&gt;C-u C-j&lt;/code&gt; is different. The manual shows these two key bindings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;To create a new journal entry: C-c C-j&#xA;To open today’s journal without creating a new entry: C-u C-c C-j&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To find the version of orgmode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x org-version&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-02-27T17:30:27.037" LastActivityDate="2016-02-27T17:30:27.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20577" PostTypeId="1" AcceptedAnswerId="20618" CreationDate="2016-02-25T04:15:29.683" Score="8" ViewCount="1982" Body="&lt;p&gt;I'm a big fan of supporting as many languages as possible. In particular, I wouldn't like to exclude support for any particular language from &lt;code&gt;org-babel&lt;/code&gt;. (Who knows? Maybe I'll need to write some Fortran one day.) However, I know that loading support for all of the available languages at once can be painful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way for &lt;code&gt;org-babel&lt;/code&gt; to load support for languages when I actually try to use a code block with that language?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: &lt;code&gt;org-babel-execute-src-block&lt;/code&gt; is probably the function that needs to be advised.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-02-25T04:30:24.183" LastActivityDate="2016-02-27T02:12:20.477" Title="org-babel: load (all) languages on-demand" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20579" PostTypeId="2" ParentId="20543" CreationDate="2016-02-25T07:00:26.260" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/skeeto/skewer-mode&quot; rel=&quot;nofollow&quot;&gt;Skewer&lt;/a&gt; looks really nice. Not under active dev though.&lt;/p&gt;&#xA;" OwnerUserId="10753" LastEditorUserId="10753" LastEditDate="2016-02-25T07:05:46.193" LastActivityDate="2016-02-25T07:05:46.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20580" PostTypeId="1" AcceptedAnswerId="20854" CreationDate="2016-02-25T07:06:38.390" Score="1" ViewCount="1028" Body="&lt;p&gt;Whenever I use helm-grep, helm-ag, or helm-ack, some results show up faster than others. In some cases the search completes after several minutes. Is it because I have to create some sort of index? If yes, how do I do it?&lt;/p&gt;&#xA;" OwnerUserId="5196" LastEditorUserId="5196" LastEditDate="2016-03-08T06:39:57.203" LastActivityDate="2016-03-08T23:05:55.470" Title="Helm grep is too slow" Tags="|helm|helm-projectile|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20582" PostTypeId="1" CreationDate="2016-02-25T11:41:50.270" Score="5" ViewCount="197" Body="&lt;p&gt;On &lt;code&gt;next-error&lt;/code&gt; in the grep or compilation window, I can use something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq next-error-recenter 35)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to ensure that window displaying the match scrolls to show the whole match, as described in more detail in &lt;a href=&quot;https://stackoverflow.com/questions/22796929/cursor-position-in-the-buffer-after-next-error/22798416#22798416&quot;&gt;this stackoverflow question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do the same thing in the grep or compilation window itself? I often have grep output or compile output that is off the bottom of the window, and on days when I spend all of my time going through grep output or compile errors, switching back and forth between windows adds a significant overhead.&lt;/p&gt;&#xA;" OwnerUserId="5426" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-19T15:32:44.630" Title="How can I recenter grep or compile window on next error" Tags="|compilation-mode|grep|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20583" PostTypeId="2" ParentId="19251" CreationDate="2016-02-25T13:36:50.080" Score="1" Body="&lt;p&gt;With the exception of the pluralization feature I managed to get it to work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, add this to your &lt;code&gt;.emacs&lt;/code&gt; (or &lt;code&gt;.yas-setup.el&lt;/code&gt; in your snippet directory):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dmitry-enum (beg end)&#xA;  &quot;Transform the selected region between BEG and END.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (let* ((strings (split-string (buffer-substring-no-properties beg end)))&#xA;         (max (apply 'max (mapcar (lambda (x) (length x)) strings))))&#xA;    (delete-region beg end)&#xA;    (insert (mapconcat (lambda (x) (format &quot;%s%s = \&quot;%s\&quot;&quot;&#xA;                                           (capitalize x)&#xA;                                           (make-string (- max (length x)) ? )&#xA;                                           (upcase (substring x 0 1))))&#xA;                       strings &quot;\n&quot;))&#xA;    (insert &quot;\n\n_CATEGORIES = (\n&quot;)&#xA;    (insert &quot;    &quot;)&#xA;    (insert (mapconcat (lambda (x) (format &quot;(%s, '%s')&quot;&#xA;                                           (capitalize x)&#xA;                                           (capitalize (concat x &quot;s&quot;))))&#xA;                       strings &quot;, &quot;))&#xA;    (insert &quot;,\n)\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then add the snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: special enum&#xA;# key: enums&#xA;# --&#xA;$1${0:$$(let ((beg yas-snippet-beg)&#xA;              (end yas-snippet-end))&#xA;              (dmitry-enum beg end))}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can either select a region with words such as &quot;color glass hat sport&quot; and call &lt;kbd&gt;M-x&lt;/kbd&gt;&#xA;&lt;code&gt;dmitry-enum&lt;/code&gt; or write &lt;code&gt;enums&lt;/code&gt; followed by &lt;code&gt;yas-expand&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it is in action:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0zaID.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0zaID.gif&quot; alt=&quot;yasnippet special enum&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2653" LastEditDate="2016-02-25T13:45:11.043" LastActivityDate="2016-02-25T13:45:11.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20584" PostTypeId="1" AcceptedAnswerId="21138" CreationDate="2016-02-25T15:12:47.140" Score="1" ViewCount="1175" Body="&lt;p&gt;I am trying to rebuild my &lt;em&gt;Org Agenda&lt;/em&gt; buffer with a timer. I am trying to do it like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun renewOrgBuffer ()&#xA;  (interactive)&#xA;  (dolist (buffer (buffer-list))&#xA;    (with-current-buffer buffer&#xA;      (when (derived-mode-p 'org-agenda-mode)&#xA;    (org-agenda-redo t))))&#xA;  )&#xA;(run-with-idle-timer 60 1000 #'renewOrgBuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I basically swiped this from another answer but they wanted to do somehting when the org file saved. I want to update it with a timer and am running into errors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I just run the function in &lt;code&gt;ielm&lt;/code&gt; I get the error: &lt;code&gt;*** Eval error ***  ‘recenter’ing a window that does not display current-buffer.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running Emacs 25.1.50.2 client connected to a daemon with org verion 8.2.10 on Ubuntu 15.10. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose for this for me is that I like to have my org file with my todos and appointments up in one buffer and the &lt;em&gt;Org Agenda&lt;/em&gt; buffer up next to it. So the the main purpose for me to update the &lt;em&gt;Org Agenda&lt;/em&gt; buffer is just so that the line that says &lt;code&gt;now - - - - -&lt;/code&gt; updates. It is a small think but I just want to figure it out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help or pointers is appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit March 7&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found that if you enable the sticky agenda view from the dispatcher (* option) then I can call my previously defined &lt;code&gt;renewOrgBuffer&lt;/code&gt; function interactively with M-x and instead of getting an error, I get a message in the mini buffer that says &quot;org-agenda-list: ‘recenter’ing a window that does not display current-buffer.&quot;, which is great, but I don't want to call it interactively every time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to run that function from the scratch buffer or on a timer like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-idle-timer 3 1000 #'renewOrgBuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Rebuilding agenda buffer...done&#xA;Error running timer ‘renewOrgBuffer’: (error &quot;‘recenter’ing a window that does not display current-buffer.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although it says &quot;Rebuilding agenda buffer...done&quot; it does not actually rebuild it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help with this added information would be helpful, Thank you.&lt;/p&gt;&#xA;" OwnerUserId="10117" LastEditorUserId="10117" LastEditDate="2016-03-07T19:00:16.490" LastActivityDate="2016-03-21T18:50:55.963" Title="Rebuilding Org Agenda Buffer With Timer" Tags="|org-mode|org-agenda|idle-timer|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20585" PostTypeId="1" CreationDate="2016-02-25T15:20:21.487" Score="2" ViewCount="1088" Body="&lt;p&gt;I'm played around with my &lt;code&gt;.emacs&lt;/code&gt; and installed a few packages from melpa related to C++. Now when I start emacs, I get this error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eval-buffer: Symbol's function definition is void: eieio-defclass-autoload&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't happen with &lt;code&gt;emacs -Q&lt;/code&gt;. So I completely emptied my &lt;code&gt;.emacs&lt;/code&gt; and removed all packages I installed today. The error persists. I also use desktop sessions, so I turned this off with &lt;code&gt;emacs --no-desktop&lt;/code&gt; but with no success. Which file is loaded that causes the error? Here is the complete &lt;code&gt;*messages*&lt;/code&gt; buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;Loading 00debian-vars...done&#xA;Loading /etc/emacs/site-start.d/50auctex.el (source)...&#xA;Loading /usr/share/emacs/site-lisp/auctex.el (source)...done&#xA;Loading /usr/share/emacs/site-lisp/preview-latex.el (source)...done&#xA;Loading /etc/emacs/site-start.d/50auctex.el (source)...done&#xA;Loading /etc/emacs/site-start.d/50autoconf.el (source)...done&#xA;Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done&#xA;Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...&#xA;Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...&#xA;Error while loading 50dictionaries-common: Symbol's value as variable is void: debian-aspell-only-dictionary-alist&#xA;Loading /etc/emacs/site-start.d/50ess.el (source)...done&#xA;Loading /etc/emacs/site-start.d/50global.el (source)...done&#xA;Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done&#xA;eval-buffer: Symbol's function definition is void: eieio-defclass-autoload&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I realized that &lt;code&gt;eieio&lt;/code&gt; is part of cedet but didn't know how to get rid of it I guess since it's now included into &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9286" LastActivityDate="2016-03-09T14:30:01.563" Title="eval-buffer: Symbol's function definition is void: eieio-defclass-autoload" Tags="|init-file|cedet|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20586" PostTypeId="1" AcceptedAnswerId="20589" CreationDate="2016-02-25T15:27:43.453" Score="9" ViewCount="2967" Body="&lt;p&gt;I have the following checklist in &lt;code&gt;org-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Delete data for problem days [0/4]&#xA;- [ ] task 1 &#xA;- [ ] task 2&#xA;- [ ] task 3&#xA;- [ ] task 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a command for quickly tagging one of these items as done? I'd like to end up with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Delete data for problem days [1/4]&#xA;- [X] task 1 &#xA;- [ ] task 2&#xA;- [ ] task 3&#xA;- [ ] task 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10940" LastEditorUserId="253" LastEditDate="2016-02-25T16:52:44.923" LastActivityDate="2016-02-25T16:52:44.923" Title="Toggle org checkbox?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20587" PostTypeId="1" AcceptedAnswerId="63681" CreationDate="2016-02-25T16:14:56.260" Score="4" ViewCount="1303" Body="&lt;p&gt;I have a bunch of html files encoded as iso-8859-1-unix and a few encoded in utf-8-unix. What I want is to encode all of them in utf-8-unix.&#xA;I have already tried (I think they are the same command, actually):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-m f utf-8-unix&#xA;C-x RET f utf-8-unix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the modeline changes from 1 to U, but after I close the file and reopen it, the modeline shows 1 again. It seems that I cannot make the change permanent no matter what I try and I don't understand why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following the suggestions below, I have created a new file with this content&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;ul class=&quot;navbar&quot;&amp;gt;&#xA;  &amp;lt;li&amp;gt;&amp;lt;a href=&quot;index.php&quot;&amp;gt;home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;  &amp;lt;li&amp;gt;&amp;lt;a href=&quot;bio.php&quot;&amp;gt;bio&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;  &amp;lt;li&amp;gt;&amp;lt;a href=&quot;research.php&quot;&amp;gt;research&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;  &amp;lt;li&amp;gt;&amp;lt;a href=&quot;software.php&quot;&amp;gt;software&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;  &amp;lt;li&amp;gt;&amp;lt;a href=&quot;contacts.php&quot;&amp;gt;contacts&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h v buffer-file-coding-system&lt;/code&gt; returns this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Its value is utf-8-unix&#xA;Local in buffer new.htm; global value is the same.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so it looks okay. I save, kill the buffer, reopen the file and &lt;code&gt;C-h v buffer-file-coding-system&lt;/code&gt; returns this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Its value is undecided-unix&#xA;Local in buffer new.htm; global value is utf-8-unix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am really confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: thanks everybody for helping making this clear!&lt;/p&gt;&#xA;" OwnerUserId="11232" LastEditorUserId="11232" LastEditDate="2016-02-26T17:14:26.260" LastActivityDate="2021-03-02T11:45:56.123" Title="How do I change permanently the encoding of a text file?" Tags="|character-encoding|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="20588" PostTypeId="2" ParentId="14485" CreationDate="2016-02-25T16:33:07.937" Score="5" Body="&lt;p&gt;I think your problem, that &lt;code&gt;dj&lt;/code&gt; deletes only a single line, is caused by the binding of &lt;code&gt;evil-next-visual-line&lt;/code&gt; to &lt;code&gt;j&lt;/code&gt;.  So, it could be solved by making &lt;code&gt;j&lt;/code&gt; call &lt;code&gt;evil-next-line&lt;/code&gt; instead only after an operator is input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be achieved by mapping &lt;code&gt;j&lt;/code&gt; to &lt;code&gt;evil-next-line&lt;/code&gt; in the operator state map, while we simultaneously bind &lt;code&gt;evil-next-visual-line&lt;/code&gt; to &lt;code&gt;j&lt;/code&gt; in the motion state map.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also had the same problem and the following configurations worked for me:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map   (kbd &quot;&amp;lt;remap&amp;gt; &amp;lt;evil-next-line&amp;gt;&quot;)     #'evil-next-visual-line)&#xA;(define-key evil-motion-state-map   (kbd &quot;&amp;lt;remap&amp;gt; &amp;lt;evil-previous-line&amp;gt;&quot;) #'evil-previous-visual-line)&#xA;(define-key evil-operator-state-map (kbd &quot;&amp;lt;remap&amp;gt; &amp;lt;evil-next-line&amp;gt;&quot;)     #'evil-next-line)&#xA;(define-key evil-operator-state-map (kbd &quot;&amp;lt;remap&amp;gt; &amp;lt;evil-previous-line&amp;gt;&quot;) #'evil-previous-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11233" LastEditorUserId="11233" LastEditDate="2016-02-27T15:13:03.060" LastActivityDate="2016-02-27T15:13:03.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20589" PostTypeId="2" ParentId="20586" CreationDate="2016-02-25T16:34:27.590" Score="10" Body="&lt;p&gt;As with many things in Org mode, &lt;code&gt;C-c C-c&lt;/code&gt; is context sensitive and does what you want it to do.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-02-25T16:34:27.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20590" PostTypeId="2" ParentId="20586" CreationDate="2016-02-25T16:45:58.527" Score="10" Body="&lt;p&gt;You can also use &lt;code&gt;,,&lt;/code&gt; in normal state if you are using the &lt;code&gt;vim&lt;/code&gt; mode.&lt;/p&gt;&#xA;" OwnerUserId="6662" LastActivityDate="2016-02-25T16:45:58.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20591" PostTypeId="1" CreationDate="2016-02-25T16:51:09.690" Score="1" ViewCount="458" Body="&lt;p&gt;I've got &lt;code&gt;er/expand-region&lt;/code&gt; behaving very strangely and I don't understand what I did wrong (besides upgrading to Emacs 25.1.50).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I've got this in an elisp file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(defun foo (p) (* 2 2) p)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(that piece of code is just an example)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I'm on the asterisk and start doing expand-region I get:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;*&quot;(OK)&lt;/li&gt;&#xA;&lt;li&gt;&quot;* 2 2&quot; (OK)&lt;/li&gt;&#xA;&lt;li&gt;&quot;* 2 2)&quot; (WRONG)&lt;/li&gt;&#xA;&lt;li&gt;&quot;(* 2 2)&quot; (kinda OK I guess)&lt;/li&gt;&#xA;&lt;li&gt;&quot;(* 2 2) p)&quot; (WRONG)&lt;/li&gt;&#xA;&lt;li&gt;&quot;(defun foo (p) (* 2 2) p)&quot; (kinda OK I guess)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've got the exact same problem with Clojure files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Previously &lt;code&gt;er/expand-region&lt;/code&gt; used to select things in between matching parenthesis. The problem is that now I need more keypresses to select what I want and I keep ending up with unbalanced elisp / Clojure code because I cut/kill non-balanced pieces of code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried both calling er/expand-region using the shortcut or calling it manually: same result. From my testing it looks like, say, when in Clojure the &lt;code&gt;clojure-mode-expansion&lt;/code&gt; list is used etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not familiar at all with how &lt;code&gt;er/expand-region&lt;/code&gt; works internally but it's as if something was called before &lt;code&gt;er/mark-inside-pairs&lt;/code&gt; and &lt;code&gt;er/mark-outside-pairs&lt;/code&gt; and that that thing was matching the right parenthesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea as to what went wrong and how I could fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried both my old er/expand-region and the latest ELPA one.&lt;/p&gt;&#xA;" OwnerUserId="11234" LastEditorUserId="105" LastEditDate="2016-03-13T21:58:48.027" LastActivityDate="2016-04-29T16:11:00.623" Title="er/expand-region not working as previously under Emacs 25.1" Tags="|region|clojure|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20592" PostTypeId="1" CreationDate="2016-02-25T17:29:43.097" Score="3" ViewCount="263" Body="&lt;p&gt;I always want the tab width to be 4 spaces, no matter what.  How do I do it?&lt;/p&gt;&#xA;" OwnerUserId="11235" LastEditorUserId="253" LastEditDate="2016-02-25T21:12:34.260" LastActivityDate="2016-02-25T21:12:34.260" Title="Set tab width with no exceptions" Tags="|indentation|tabs|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20593" PostTypeId="1" CreationDate="2016-02-25T18:48:39.057" Score="2" ViewCount="350" Body="&lt;p&gt;I've got a weird one for you. When all of the following are true:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm using org-mode&lt;/li&gt;&#xA;&lt;li&gt;My org-mode file has a code block&lt;/li&gt;&#xA;&lt;li&gt;I export the org file&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-src-fontify-natively&lt;/code&gt; is true&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then I get a leftover buffer with a name like &quot; org-src-fontification:clojure-mode&quot;. It's considered an &quot;invisible&quot; buffer, so it only shows up when listing buffers from Elisp code. It does not appear in the interactive buffer list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next time I refresh my magit-status, I get prompted to save a file. There's no option to skip it! If I save the file, it has the contents of the leftover internal buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I turn off &lt;code&gt;org-src-fontify-natively&lt;/code&gt; then this doesn't happen. But my exports also don't get nice fontification either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way to either discard that buffer, or convince magit to ignore it?&lt;/p&gt;&#xA;" OwnerDisplayName="user11238" LastActivityDate="2016-02-26T15:32:06.537" Title="Org-src-fontify-natively makes Magit think there are unsaved files" Tags="|org-mode|magit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20594" PostTypeId="1" AcceptedAnswerId="20595" CreationDate="2016-02-25T18:57:29.730" Score="0" ViewCount="408" Body="&lt;p&gt;I am running a tmux session on a server where I do my development work (this is where I run emacs). I have two monitors - how do I use both of them with the same emacs session? If I join the same tmux session, the monitors just mirror each other. If I am not in the same tmux session (and by extension a different emacs session) I will have to reread from disk everytime a file gets updated, and there can be differences between the different working versions of files. Any thoughts on how to use both monitors here?&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2016-02-25T19:48:42.210" Title="How can I use multiple monitors with a remote emacs session?" Tags="|ssh|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20595" PostTypeId="2" ParentId="20594" CreationDate="2016-02-25T19:48:42.210" Score="1" Body="&lt;p&gt;You can start two tmux sessions. In one you run an Emacs and start the &quot;Emacs server&quot; using &lt;code&gt;M-x emacs-server RET&lt;/code&gt;. In the other you can run &lt;code&gt;emacsclient -nw&lt;/code&gt;, this will create a second tty frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, you can use &lt;code&gt;emacsclient -nw&lt;/code&gt; to connect to a graphical Emacs, in case one in running on the machine.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-02-25T19:48:42.210" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20596" PostTypeId="1" AcceptedAnswerId="20597" CreationDate="2016-02-25T20:06:32.663" Score="5" ViewCount="1120" Body="&lt;p&gt;I'd like to add some navigation context to the modeline. I can figure out where I am just fine and give the name of my function, but I don't know how to run this every time point moves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;post-command-hook&lt;/code&gt; is the only thing I've found, but it sounds like it's overkill.  Is there anything more appropriate?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-02-26T09:23:43.883" Title="Is there a hook I can use to run my function when point moves?" Tags="|hooks|point|motion|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20597" PostTypeId="2" ParentId="20596" CreationDate="2016-02-25T21:08:58.843" Score="7" Body="&lt;p&gt;I think &lt;code&gt;post-command-hook&lt;/code&gt; is what you wish to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is run every time a &lt;em&gt;command&lt;/em&gt; has been run. And a command is basically any interactive action, such as clicking a mouse button, typing a letter (which runs &lt;code&gt;self-insert-command&lt;/code&gt;, or running a command using &lt;code&gt;M-x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may wish to make sure your hook is not run while you are typing in the minibuffer. I think wrapping the body in  &lt;code&gt;(unless (window-minibuffer-p) …)&lt;/code&gt; will care of that for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And possibly, you want your hook only to be active when you are editing certain files. In which case, you might consider making &lt;code&gt;post-command-hook&lt;/code&gt; buffer local: Using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook #'your-hook nil :local)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will take care of that for you. (&lt;strong&gt;Edited&lt;/strong&gt; to add this last point.)&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2016-02-26T09:23:43.883" LastActivityDate="2016-02-26T09:23:43.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20598" PostTypeId="2" ParentId="20574" CreationDate="2016-02-25T21:44:06.927" Score="10" Body="&lt;p&gt;After much digging, there does &lt;em&gt;not&lt;/em&gt; appear to be a built-in option to adjust this in Org or in general. The image system does not have any way to customize the default background, and org doesn't have a way to set the &lt;code&gt;:background&lt;/code&gt; property. However, it does look like most images support the &lt;code&gt;:background&lt;/code&gt; display property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added this functionality to Org by modifying (read: copy and paste into &lt;code&gt;.emacs.d&lt;/code&gt; with a 1-line change) &lt;code&gt;org-display-inline-images&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I won't reproduce the function here, because it is rather lengthy. Line 51 of the function reads:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq img (save-match-data (create-image file type nil :width width)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I defined a new customizable variable &lt;code&gt;org-inline-image-background&lt;/code&gt;, which can hold either &lt;code&gt;nil&lt;/code&gt; (transparent background) or a color:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom org-inline-image-background nil&#xA;  &quot;The color used as the default background for inline images.&#xA;  When nil, use the default face background.&quot;&#xA;  :group 'org&#xA;  :type '(choice color (const nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, I added it to line 51:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq img (save-match-data (create-image file type nil :width width &#xA;                                                       :background org-inline-image-background)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works beautifully and it can be customized using the color picker, so it satisfies all my requirements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sMZQI.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sMZQI.png&quot; alt=&quot;black text light background&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2016-02-25T21:44:06.927" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20601" PostTypeId="1" CreationDate="2016-02-26T07:24:49.617" Score="2" ViewCount="104" Body="&lt;p&gt;I am trying to convert my code to use lexical binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a function (&lt;code&gt;format-template&lt;/code&gt;) that calls a lambda function (let-bound to &lt;code&gt;replacer-inner&lt;/code&gt;) from a user-customizable list (&lt;code&gt;template-replace-functions&lt;/code&gt;) of functions based on a match-string. The replacer-inner function takes no arguments and returns a string, however, it &lt;em&gt;may&lt;/em&gt; need to use variables &lt;code&gt;foo&lt;/code&gt; &lt;code&gt;bar&lt;/code&gt; and/or &lt;code&gt;baz&lt;/code&gt;, which are passed as part of the argument &lt;code&gt;list&lt;/code&gt; to &lt;code&gt;format-template&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lexical-binding t)&#xA;&#xA;(defcustom template-replace-functions&#xA;  '((&quot;email&quot;&#xA;     (lambda () user-mail-address)&#xA;    (&quot;apples&quot;&#xA;     (lambda ()&#xA;       (cond ((= foo 1)&#xA;              &quot;one&quot;)&#xA;             ((= foo 2)&#xA;              &quot;two&quot;)&#xA;             ((= foo 3)&#xA;              &quot;three&quot;)&#xA;             (t &quot;four&quot;))))&#xA;    (&quot;bananas&quot;&#xA;     (lambda ()&#xA;       (if (eq bar 'move)&#xA;           &quot;movement&quot; &quot;sit still&quot;)))))&#xA;  &quot;Association list of replacement functions.&#xA;&#xA;For each STRING, the corresponding FUNCTION is called with no&#xA;arguments and must return a string.&quot;&#xA;  :type '(repeat (group string function))&#xA;  :group 'spice-girls)&#xA;&#xA;(defun format-template (list)&#xA;  (let* ((foo (nth 0 list))&#xA;         (bar (nth 1 list))&#xA;         (baz (nth 2 list))&#xA;         template&#xA;         (replacer-outer&#xA;          (lambda ()&#xA;            (replace-regexp-in-string&#xA;             &quot;\${\([^\s\t\n]*?\)}&quot;&#xA;             (lambda (match)&#xA;               (let* ((key (match-string 1 match))&#xA;                      (replacer-inner&#xA;                       (cadr (assoc key template-replace-functions))))&#xA;                 (if (and replacer-inner&#xA;                          (stringp (funcall replacer-inner)))&#xA;                     (funcall replacer-inner) &quot;&quot;)))&#xA;             template t t))))&#xA;    (setq template&#xA;          ...)&#xA;    (if template (funcall replacer-outer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, for example, &lt;code&gt;list&lt;/code&gt; contains three elements, which are let-bound to &lt;code&gt;foo&lt;/code&gt; &lt;code&gt;bar&lt;/code&gt; and &lt;code&gt;baz&lt;/code&gt;. The &lt;code&gt;key&lt;/code&gt; of the match-string is &lt;code&gt;&quot;bananas&quot;&lt;/code&gt; which associates to a function in &lt;code&gt;template-replace-functions&lt;/code&gt; and sets &lt;code&gt;replace-inner&lt;/code&gt; to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda ()&#xA;       (if (eq bar 'move)&#xA;           &quot;movement&quot; &quot;sit still&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At this point, the above lambda function needs to know &lt;code&gt;bar&lt;/code&gt;, which is fine using dynamic binding, but not so fine using lexical binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how do I do this to allow the lambda function bound to &lt;code&gt;replacer-inner&lt;/code&gt; take from the let-bound values of &lt;code&gt;foo&lt;/code&gt; &lt;code&gt;bar&lt;/code&gt; and &lt;code&gt;baz&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Just to confuse things, the &lt;code&gt;replace-outer&lt;/code&gt; function, which contains &lt;code&gt;replace-inner&lt;/code&gt;, is let-bound because it is called from one of two places in the real function. I could have written inline here but have included it this way in case it adds to the problem.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Halfway there...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lexical-binding t&#xA;  foo 0&#xA;  bar 0)&#xA;&#xA;(setq inline-fun-1&#xA;      '(lambda ()&#xA;         (setq return&#xA;               (if (eq foo 1)&#xA;                   &quot;Pass&quot; &quot;Fail&quot;))))&#xA;&#xA;(defmacro lex-fun ()&#xA;  `(let* ((foo 1)&#xA;          (bar 1)&#xA;          return)&#xA;     (funcall ,inline-fun-1)))&#xA;&#xA;(lex-fun)    ; -&amp;gt; &quot;Pass&quot;&#xA;&#xA;(defun inline-fun-2 ()&#xA;  (setq return&#xA;        (if (eq bar 1)&#xA;            &quot;Pass&quot; &quot;Fail&quot;)))&#xA;&#xA;(defmacro lex-fun ()&#xA;  `(let* ((foo 1)&#xA;          (bar 1)&#xA;          return)&#xA;     (funcall ,inline-fun-2)))&#xA;&#xA;(lex-fun)    ; -&amp;gt; Lisp error: (void-variable inline-fun-2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, expanding the lambda function within a macro appears to work, but not a named function. But I do want to allow the user lambda or named functions. How to get around this?&lt;/p&gt;&#xA;" OwnerUserId="2697" LastEditorUserId="105" LastEditDate="2016-03-13T21:58:10.977" LastActivityDate="2016-05-12T22:55:31.407" Title="Allow custom function to take from lexical environment" Tags="|lexical-scoping|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20602" PostTypeId="1" CreationDate="2016-02-26T07:58:39.067" Score="2" ViewCount="729" Body="&lt;p&gt;When I run Emacs in a terminal window, via emacs - nw or emacsclient, Emacs loads in the terminal but without transparency.   (My terminal windows are set around 50 percent transparency.)   What could be the problem?  I'm running xfce4.  Thanks&lt;/p&gt;&#xA;" OwnerUserId="10740" LastActivityDate="2016-02-27T13:12:45.773" Title="Emacs not inheriting transparency from terminal" Tags="|term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20603" PostTypeId="1" AcceptedAnswerId="20604" CreationDate="2016-02-26T09:04:12.920" Score="6" ViewCount="270" Body="&lt;p&gt;I have one file that needs to behave differently depending on whether Emacs is running in batch mode (non interactive) or normal mode.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if batch-mode-t &#xA;    a-func&#xA;  b-func)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I detect this?&lt;/p&gt;&#xA;" OwnerUserId="5292" LastEditorUserId="675" LastEditDate="2016-07-12T18:47:07.377" LastActivityDate="2016-07-12T18:47:07.377" Title="How to know if Emacs is running in batch mode" Tags="|batch-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20604" PostTypeId="2" ParentId="20603" CreationDate="2016-02-26T09:24:16.353" Score="8" Body="&lt;p&gt;You can look at the variable &lt;code&gt;noninteractive&lt;/code&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if noninteractive&#xA;    a&#xA;  b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-02-26T09:24:16.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20605" PostTypeId="1" AcceptedAnswerId="20634" CreationDate="2016-02-26T12:10:36.040" Score="0" ViewCount="628" Body="&lt;p&gt;I am unable to &lt;code&gt;:delight&lt;/code&gt; major mode strings (in the mode-line) from &lt;code&gt;use-package&lt;/code&gt; because I am intializing &lt;code&gt;powerline&lt;/code&gt; with &lt;code&gt;use-package&lt;/code&gt; itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that the &lt;code&gt;:delight&lt;/code&gt;'ing part occurs at the wrong time and &lt;code&gt;mode-line-format&lt;/code&gt; is set without the updated major mode strings (it works fine if &lt;code&gt;powerline&lt;/code&gt; is &lt;code&gt;:disabled&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a good approach to solve this issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my &lt;s&gt;&lt;a href=&quot;https://bitbucket.org/angrybacon/dotemacs/src/31ee2aff0277f51b8f1207ad34decb622ffa7825/lisp/init-mode-line.el?at=master&amp;amp;fileviewer=file-view-default&quot; rel=&quot;nofollow&quot;&gt;init-mode-line.el&lt;/a&gt;&lt;/s&gt; for reference. New link: &lt;a href=&quot;https://bitbucket.org/angrybacon/dotemacs/src/94a35d6bb2a5f1e007d40b644666a46071bd3f44/lisp/init-mode-line.el?at=master&amp;amp;fileviewer=file-view-default&quot; rel=&quot;nofollow&quot;&gt;init-mode-line.el&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="454" LastEditDate="2019-07-17T08:28:24.653" LastActivityDate="2019-07-17T08:28:24.653" Title="How to :delight major mode strings when using powerline with use-package?" Tags="|mode-line|powerline|mode-line-format|delight|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20606" PostTypeId="2" ParentId="20601" CreationDate="2016-02-26T12:22:26.480" Score="1" Body="&lt;p&gt;Short answer: you cannot. This is why this kind of binding is called &quot;lexical&quot; - it prevents variables from escaping their definition area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to address this problem: you could have passed some data-structure into the &quot;bananas&quot; function, where &quot;bananas&quot; would know how to extract values from it.  I.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom template-replace-functions&#xA;  '((&quot;bananas&quot; . (lambda (env) &#xA;                   (let ((x (gethash &quot;x&quot; env &quot;&quot;)))&#xA;                     (do-replacements-with x))))&#xA;    ...)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which assumes that &lt;code&gt;env&lt;/code&gt; is a hash-table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside: it's better to use &lt;code&gt;eql&lt;/code&gt; rather than &lt;code&gt;eq&lt;/code&gt;.  I don't think Emacs Lisp gives any useful guarantees as to how &lt;code&gt;eq&lt;/code&gt; behaves with almost any type of data (eg. I'm not sure that even interned symbols with the same name must be equal under &lt;code&gt;eq&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-02-26T12:22:26.480" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="20607" PostTypeId="2" ParentId="20593" CreationDate="2016-02-26T15:32:06.537" Score="1" Body="&lt;p&gt;One workaround is to advise the functions involved. For example, you could add &lt;code&gt;:after&lt;/code&gt; advice to &lt;code&gt;org-src-font-lock-fontify-block&lt;/code&gt; to kill the buffer it creates, perhaps like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-org-src-buffers (&amp;amp;rest args)&#xA;  &quot;Kill temporary buffers created by&#xA;org-src-font-lock-fontify-block so they don't interfere with&#xA;magit-mode.&quot;&#xA;  (dolist (b (buffer-list))&#xA;    (let ((bufname (buffer-name b)))&#xA;      (if (string-prefix-p &quot; org-src-fontification:&quot; bufname)&#xA;          (kill-buffer b)))))&#xA;&#xA;(advice-add 'org-src-font-lock-fontify-block&#xA;            :after #'kill-org-src-buffers)    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;kill-org-src-buffers&lt;/code&gt; iterates over all buffers, killing any that match the buffer name prefix that &lt;code&gt;org-src-font-lock-fontify-block&lt;/code&gt; uses for its &quot;temporary&quot; buffers. Alternatively, advising &lt;code&gt;magit-save-repository-buffers&lt;/code&gt; with &lt;code&gt;:before&lt;/code&gt; advice that takes a similar approach would likely work too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's a bug that &lt;code&gt;org-src-font-lock-fontify-block&lt;/code&gt; creates a buffer using &lt;code&gt;get-buffer-create&lt;/code&gt; to do work that appears to require only a temporary buffer; it should use &lt;code&gt;with-temp-buffer&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="11241" LastActivityDate="2016-02-26T15:32:06.537" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20608" PostTypeId="1" CreationDate="2016-02-26T15:36:17.617" Score="5" ViewCount="1942" Body="&lt;p&gt;I have Emacs 24.5.1, installed &lt;code&gt;zenburn-theme&lt;/code&gt; off of melpa-stable and loaded the theme in my &lt;code&gt;.emacs&lt;/code&gt; with &lt;code&gt;(load-theme 'zenburn)&lt;/code&gt;. I like all the colours except the background. It's a bit too bright.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I set the background colour to a darker colour?&lt;/p&gt;&#xA;" OwnerUserId="11244" LastEditorDisplayName="user227" LastEditDate="2016-03-02T07:10:48.920" LastActivityDate="2016-03-02T07:10:48.920" Title="How to use zenburn with a darker background?" Tags="|colors|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20609" PostTypeId="2" ParentId="19070" CreationDate="2016-02-26T16:54:58.977" Score="0" Body="&lt;p&gt;The fix is in upgrading to the newest version of cc-mode, which contains a bug fix for this issue.&lt;/p&gt;&#xA;" OwnerUserId="10593" LastActivityDate="2016-02-26T16:54:58.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20610" PostTypeId="2" ParentId="10875" CreationDate="2016-02-26T17:24:50.423" Score="2" Body="&lt;p&gt;You can try downloading the ESS tgz file, unpack it in a directory of choice (for example, I put it in &lt;code&gt;.emacs.d&lt;/code&gt;) and then add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/.emacs.d/ess-15.09-2/lisp/ess-site&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;code&gt;.emacs&lt;/code&gt; file. No need to recompile anything in this way.&lt;/p&gt;&#xA;" OwnerUserId="11232" LastActivityDate="2016-02-26T17:24:50.423" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20611" PostTypeId="2" ParentId="20608" CreationDate="2016-02-26T17:46:23.660" Score="1" Body="&lt;p&gt;You can change the color of the background by adding this to your .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; '(default ((t (:background &quot;blue&quot;))))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, the core bit here is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(default ((t (:background &quot;blue&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you might already have &lt;code&gt;custom-set-faces&lt;/code&gt; declared if you made any modifications previously.&lt;/p&gt;&#xA;" OwnerUserId="10045" LastActivityDate="2016-02-26T17:46:23.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20612" PostTypeId="2" ParentId="20608" CreationDate="2016-02-26T18:39:49.897" Score="9" Body="&lt;p&gt;You can modify zenburn's face definitions in your .emacs.  I use this to avoid mucking up the background of other themes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;zenburn-theme&quot;&#xA;  (zenburn-with-color-variables&#xA;    (custom-theme-set-faces&#xA;     'zenburn&#xA;     ;; original `(default ((t (:foreground ,zenburn-fg :background ,zenburn-bg))))&#xA;     `(default ((t (:foreground ,zenburn-fg :background ,zenburn-bg-1)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="372" LastActivityDate="2016-02-26T18:39:49.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20613" PostTypeId="1" CreationDate="2016-02-26T19:05:24.227" Score="8" ViewCount="573" Body="&lt;p&gt;My daily workflow uses multiple frames, and I have a frame that I want to dedicate to ERC buffers.  I've used &lt;code&gt;set-frame-parameter&lt;/code&gt; to give the frame the name &lt;code&gt;*ERC*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want &lt;code&gt;display-buffer&lt;/code&gt; to always display ERC buffers (identified by the regex &lt;code&gt;\`#&lt;/code&gt;) in this frame named &lt;code&gt;*ERC*&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist&#xA;     '(&quot;\\`#&quot;&#xA;       nil&#xA;       (inhibit-switch-frame)&#xA;       (reusable-frames . &quot;*ERC*&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But buffers still appear all over the place.  I've also tried replacing &lt;code&gt;*ERC*&lt;/code&gt; with &lt;code&gt;\\*ERC\\*&lt;/code&gt;.  Help?&lt;/p&gt;&#xA;" OwnerUserId="372" LastEditorUserId="372" LastEditDate="2016-09-24T22:44:31.957" LastActivityDate="2016-09-24T22:44:31.957" Title="How can I force display-buffer to use one specific frame?" Tags="|frames|display-buffer-alist|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20614" PostTypeId="1" AcceptedAnswerId="20616" CreationDate="2016-02-26T19:46:38.487" Score="1" ViewCount="199" Body="&lt;p&gt;Recently start exploring org-mode, find it awesome so far. &#xA;I use Emacs+Auctex for editing my tex file and tried to create a link that links to my tex file directly to the exact line in my org file.&#xA;I found some weird results as shown in the screenshot below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rHt64.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rHt64.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ridiculous thing is the search doesn't work for \begin{} but work for \end{}. Anybody knows how to fix it? Or is this a bug?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/5hAXc.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5hAXc.gif&quot; alt=&quot;GIF&quot;&gt;&lt;/a&gt;&#xA;Thanks for all the helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT1&lt;/strong&gt;: What I expect is that, when I click on the link, it will direct me to the relevant file at the EXACT line according to the search keyword after the :: after the link.&#xA;&lt;strong&gt;EDIT2&lt;/strong&gt; GIF included.&lt;/p&gt;&#xA;" OwnerUserId="10243" LastEditorUserId="10243" LastEditDate="2016-02-26T22:46:14.933" LastActivityDate="2016-02-26T23:04:35.793" Title="org-mode-external-link weird search results in Tex file, &quot;No Match&quot;" Tags="|org-mode|latex|osx|emacs24.4|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20615" PostTypeId="2" ParentId="20608" CreationDate="2016-02-26T21:08:21.887" Score="1" Body="&lt;p&gt;You might also want to look at the &lt;code&gt;hc-zenburn&lt;/code&gt; theme (&lt;code&gt;hc-zenburntheme&lt;/code&gt; on MELPA).  It probably changes more than just the background, but the darker background is all that I generally notice.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-02-26T21:08:21.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20616" PostTypeId="2" ParentId="20614" CreationDate="2016-02-26T23:04:35.793" Score="0" Body="&lt;p&gt;I'm 99% sure this is related to escape characters in regexes. &lt;code&gt;\b&lt;/code&gt; in a regexp means &quot;word boundary&quot;, not &quot;backslash, then a &lt;code&gt;b&lt;/code&gt;&quot;. In text.tex, if you delete the first character of the match, so the text is &lt;code&gt;egin{Document}&lt;/code&gt;, your search will work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to fix the existing link, escape the backslash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:~/target.txt::\\begin{Document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will search for a literal backslash. I'm assuming it's working for the &lt;code&gt;\end{Document}&lt;/code&gt; search because I don't think there's an escape character &lt;code&gt;\e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another cool thing you can do is to use org links that have short names. If you press &lt;code&gt;C-c C-l&lt;/code&gt;, org mode will prompt you for a link, and then a description. In the org buffer, it'll only show the description.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-02-26T23:04:35.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20617" PostTypeId="1" CreationDate="2016-02-26T23:19:46.067" Score="5" ViewCount="180" Body="&lt;p&gt;From the doc of &lt;code&gt;window-end&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Even if update is non-nil, window-end does not attempt to scroll the display if point has moved off the screen, the way real redisplay would do. It does  not alter the window-start value. In effect, it reports where the displayed  text will end if scrolling is not required. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since the &lt;code&gt;window-end&lt;/code&gt; only &lt;code&gt;reports where the displayed text will end if scrolling is not required&lt;/code&gt;, what should I do to get the correct &lt;code&gt;window-end&lt;/code&gt; after I call &lt;code&gt;next-line&lt;/code&gt; at the end of the current window, which causes the window to scroll by one line? Do I need something like forcing the window to redisplay before calling &lt;code&gt;window-end&lt;/code&gt; function?&lt;/p&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="105" LastEditDate="2016-03-13T21:57:15.113" LastActivityDate="2016-03-13T21:57:15.113" Title="How to get `window-end` when the window scrolls?" Tags="|window|scrolling|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20618" PostTypeId="2" ParentId="20577" CreationDate="2016-02-27T02:12:20.477" Score="9" Body="&lt;p&gt;This seems to do it for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(defadvice org-babel-execute-src-block (around load-language nil activate)&#xA;  &quot;Load language if needed&quot;&#xA;  (let ((language (org-element-property :language (org-element-at-point))))&#xA;    (unless (cdr (assoc (intern language) org-babel-load-languages))&#xA;      (add-to-list 'org-babel-load-languages (cons (intern language) t))&#xA;      (org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages))&#xA;    ad-do-it))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At least, it worked for gnuplot (after I installed the gnuplot package and executable).&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-02-27T02:12:20.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20619" PostTypeId="2" ParentId="20569" CreationDate="2016-02-27T02:16:24.480" Score="1" Body="&lt;p&gt;Here is what I use to add journal entries:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun journal-new-entry ()&#xA;  &quot;Add new entry to journal.&#xA;Add new day if necessary, otherwise, add to current day.&quot;&#xA;  (interactive)&#xA;  (find-file &quot;~/Dropbox/org-mode/journal.org&quot;)&#xA;  (let* ((date (calendar-current-date))&#xA;     (year (elt date 2))&#xA;     (month (elt date 0))&#xA;     (day (elt date 1)))&#xA;    (org-datetree-find-date-create (list month day year)))&#xA;  (save-restriction&#xA;    (org-narrow-to-subtree)&#xA;    (goto-char (point-max))&#xA;    (insert (format &quot;\n**** %s&quot; (format-time-string &quot;%H:%m&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is obviously specific to my journal file, but is otherwise pretty generic to org.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-02-27T02:16:24.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20620" PostTypeId="1" AcceptedAnswerId="20621" CreationDate="2016-02-27T03:53:56.433" Score="7" ViewCount="668" Body="&lt;p&gt;I use &lt;code&gt;hl-line-mode&lt;/code&gt; and I really like the built-in &lt;code&gt;misterioso&lt;/code&gt; theme. However, the way that lines are highlighted with this theme cancels out syntax highlighting or any other properties of the highlighted lines, as can be seen in this screenshot. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/h2JnA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/h2JnA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I keep the highlighting the same color, but avoid covering up the face properties of the highlighted text? I would be willing to compromise and change the color if necessary, but that doesn't seem to be the issue. I have tried changing the color, but still get the same effect. I have also tried &lt;a href=&quot;https://emacs.stackexchange.com/a/10463/8430&quot;&gt;this solution&lt;/a&gt;, but only succeeded in getting rid of highlighting altogether. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/10445/8430&quot;&gt;This question&lt;/a&gt; seems to be the same or similar to mine, but I am honestly not sure if it is the same. I tried the solution suggested there but couldn't get it to work. Rather than having a discussion in the comments of that question, I thought I would ask a new one, but my feelings will not be hurt if this gets marked as duplicate.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-02-27T15:23:42.410" Title="Line highlighting canceling out syntax highlighting" Tags="|font-lock|syntax-highlighting|overlays|highlighting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20621" PostTypeId="2" ParentId="20620" CreationDate="2016-02-27T05:47:09.777" Score="5" Body="&lt;p&gt;Basically, the &lt;code&gt;hl-line&lt;/code&gt; face is defining a &lt;code&gt;:foreground&lt;/code&gt; property, which is overriding the other foreground colors in your theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;misterioso&lt;/code&gt; defines &lt;code&gt;hl-line&lt;/code&gt; in terms of &lt;code&gt;highlight&lt;/code&gt; using inheritance, and because of an awkward issue (which I asked about &lt;a href=&quot;https://emacs.stackexchange.com/questions/19947/unset-inherited-face-attribute&quot;&gt;here&lt;/a&gt;), it's not possible AFAIK to directly inherit from a face, and override one of the properties to be unset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead, you'll need something like this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'hl-line nil&#xA;                    :inherit nil&#xA;                    :background (face-background 'highlight))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This may not be as clean as a hypothetical solution that could preserve the inheritance, but it works.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As noted by Stefan, another solution would be to remove the foreground from the &lt;code&gt;highlight&lt;/code&gt; face, which would fix this issue for other types of highlights as well.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-foreground 'highlight nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-02-27T15:23:42.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20622" PostTypeId="2" ParentId="19659" CreationDate="2016-02-27T08:28:23.880" Score="1" Body="&lt;p&gt;To complete latex symbol in org-mode you need an additional line.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq company-math-allow-latex-symbols-in-faces t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11248" LastEditorUserId="160" LastEditDate="2016-02-27T13:16:50.610" LastActivityDate="2016-02-27T13:16:50.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20623" PostTypeId="1" CreationDate="2016-02-27T11:37:58.827" Score="2" ViewCount="489" Body="&lt;p&gt;I'm using the latest version of Emacs on Linux. I'm having trouble saving and restoring various window layouts and buffer states across multiple projects.  For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Project A: 3 window layout / 3 specific buffers&lt;/li&gt;&#xA;&lt;li&gt;Project B: 4 window layout / 4 specific buffers&lt;/li&gt;&#xA;&lt;li&gt;Project C: 2 window layout / 2 specific buffers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've been using revive.el and I like that it saves and restores not only the window layout, but also the files I was working on in that project, including the last point I was at in those files. Unfortunately, revive only seems to recall just one window layout for one set of files (i.e., toggle on or off).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking for a complete solution, I found &lt;a href=&quot;https://www.emacswiki.org/emacs/WindowsMode&quot; rel=&quot;nofollow&quot;&gt;windows.el&lt;/a&gt; (seemingly bundled somehow with revive) but I'm not exactly clear what it does. It's not on melpa, looks rather dated, so I assume it's not even maintained. Then I found workgroups.el but it gives me all kinds of warnings after installing from melpa. I also tried workgroups2 but I have similar issues with warnings. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="11249" LastActivityDate="2016-02-27T11:37:58.827" Title="Saving and restoring mutiple window layouts" Tags="|project|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20624" PostTypeId="2" ParentId="20602" CreationDate="2016-02-27T13:12:45.773" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What could be the problem?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is some custom Emacs themes that, when used, can result to this kind of problem. Try with another theme, or tweak the used theme, until the expected transparency is back.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2016-02-27T13:12:45.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20625" PostTypeId="1" CreationDate="2016-02-27T16:09:40.733" Score="1" ViewCount="37" Body="&lt;p&gt;I want to add rectangle outside the text as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------+&#xA;|why there|&#xA;+---------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what I get is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------+&#xA;|hy there|&#xA;+--------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use C-c C-a r at the beginning of line which just above the character &quot;w&quot;&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2016-02-27T16:09:40.733" Title="insert picture without replacing the word in artist mode" Tags="|artist-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20626" PostTypeId="1" CreationDate="2016-02-27T17:07:39.147" Score="7" ViewCount="512" Body="&lt;p&gt;I want to be able to view C source code of Emacs functions. For example, I want to be able to do &lt;code&gt;M-: (find-function 'message)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs prompts me for directory the C sources, so it can set &lt;code&gt;find-function-C-source-directory&lt;/code&gt;. However, my distro (Arch Linux) has just done the usual &lt;code&gt;make; make install&lt;/code&gt; steps (see &lt;a href=&quot;https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/emacs&amp;amp;id=ea16e86ac1c92404023beedd7d1710515d0da539&quot;&gt;the package recipe here&lt;/a&gt;) so there are no C sources available without manually downloading them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I want to fix the packaging. My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are there configuration options Emacs' makefile that mean &lt;code&gt;make install&lt;/code&gt; copies the C sources too? I can't see anything obvious.&lt;/li&gt;&#xA;&lt;li&gt;What's the correct way to set &lt;code&gt;find-function-C-source-directory&lt;/code&gt; in the package? Create a &lt;code&gt;site-lisp&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Are there any distros or platforms that already do this?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="304" LastEditorUserId="454" LastEditDate="2016-11-30T02:23:16.663" LastActivityDate="2016-12-30T05:50:04.470" Title="How can I build/package Emacs so that the C source files are installed to a standard find-function-C-source-directory?" Tags="|c|site-lisp|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20627" PostTypeId="2" ParentId="20617" CreationDate="2016-02-27T17:08:12.160" Score="3" Body="&lt;p&gt;The best a user can achieve -- &lt;em&gt;without forcing a redisplay&lt;/em&gt; or &lt;em&gt;without modifying the C-source code&lt;/em&gt; -- is use the &lt;code&gt;window-end&lt;/code&gt; function with the optional second argument set to &lt;code&gt;t&lt;/code&gt; &lt;strong&gt;in conjunction with&lt;/strong&gt; the &lt;code&gt;window-scroll-functions&lt;/code&gt; hook that takes two arguments -- &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Hooks.html#Window-Hooks&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Hooks.html#Window-Hooks&lt;/a&gt;  [NOTE:  Forcing a redisplay may reveal to the naked eye (for a split second) an unfinished product -- e.g., perhaps the new overlays have not yet been removed/placed.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CAVEAT&lt;/strong&gt;:  Beware that the &lt;code&gt;window-scroll-functions&lt;/code&gt; hook fires sometimes more than once during each command loop (while redisplay performs its job), and the first values for &lt;code&gt;window-start&lt;/code&gt; and &lt;code&gt;window-end win t&lt;/code&gt; are not always correct, and the last values are not always correct either -- e.g., when inserting/yanking, or when using &lt;code&gt;goto&lt;/code&gt;.  [Fn 1.]  When the &lt;code&gt;window-scroll-functions&lt;/code&gt; hook runs multiple times, the function attached to the hook can cause significant performance issues depending upon the complexity of said function.  And, as mentioned, sometimes the user is simply out of luck -- i.e., correct values can never be obtained.  Using &lt;code&gt;pos-visible-in-window-p&lt;/code&gt; can be helpful as a workaround to set up some checks to prevent the function attached to the hook from fully running its course if &lt;code&gt;point&lt;/code&gt; is not yet fully visible; and, a variable can be set up to test for whether the function has already fully run one time during that command loop (so that it doesn't keep running).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written a draft proof concept patch to the C-source code that I am using for my own personal setup to always get the correct &lt;code&gt;window-start&lt;/code&gt; and &lt;code&gt;window-end&lt;/code&gt; &lt;em&gt;during&lt;/em&gt; redisplay; however, it may never make its way into the mainstream since I'm not a programmer and am the only person really motivated:  &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22404&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22404&lt;/a&gt;  It is called the &lt;code&gt;window-start-end-hook&lt;/code&gt; -- but it's only available if a user wants to experiment with the draft patch and build Emacs from source.  My draft patch works irrespective of window scrolling, e.g., it works when moving point within the visible window; it works when using &lt;code&gt;goto&lt;/code&gt;; it works when inserting/yanking; and, it works when scrolling.  Anyone interested in developing that concept should please feel free to submit a post to feature request 22404.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also these related threads:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/10763/how-to-update-window-start-without-calling-redisplay&quot;&gt;How to update window-start without calling redisplay?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/23923371/emacs-calculating-new-window-start-end-without-redisplay/24216247#24216247&quot;&gt;https://stackoverflow.com/questions/23923371/emacs-calculating-new-window-start-end-without-redisplay/24216247#24216247&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;:  Debugging functions that run during redisplay may require using a feature called &lt;code&gt;trace-redisplay&lt;/code&gt; (after launching Emacs from the command line) that is available when building Emacs from source with options such as:  &lt;code&gt;./configure --enable-checking='glyphs'&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Fn. 1.]&lt;/strong&gt;:  When working with Bug #22637,  Eli Z. on the Emacs development team explained that the reason the &lt;code&gt;window-scroll-functions&lt;/code&gt; hook does not yield correct results for inserting/yanking or &lt;code&gt;goto&lt;/code&gt; is because it was never designed for those scenarios:  &quot;&lt;em&gt;The reason window-scroll-functions aren't run in both of these test cases is that what happens there is not considered 'scrolling'. Scrolling is informally defined as either an explicit call to a function that scrolls the window, or a pseudo-scroll done by the display engine when it detects that some part of the window's previous display is still present, but in a different vertical position. Moving point to an arbitrary location is neither.&lt;/em&gt;&quot;  &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22637#35&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22637#35&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-02-27T19:01:31.627" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="20628" PostTypeId="1" CreationDate="2016-02-27T18:09:03.443" Score="1" ViewCount="114" Body="&lt;p&gt;Is there a way to configure emacs, so that when I hit M-backspace it would actually remove the whole variable? If I have a variable like &lt;code&gt;my_dummy_variable&lt;/code&gt; I need to hit M-backspace three times in order to remove the name?&lt;/p&gt;&#xA;" OwnerUserId="11251" LastEditorUserId="2642" LastEditDate="2016-02-28T01:05:45.503" LastActivityDate="2016-02-28T21:19:36.273" Title="Deleting whole variable name on M-backspace" Tags="|text-editing|symbols|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20629" PostTypeId="1" CreationDate="2016-02-27T18:15:15.273" Score="5" ViewCount="136" Body="&lt;p&gt;Assume that I have the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int x;&#xA;string s = &quot;some very long &quot;&#xA;           &quot; string&quot;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to have one command that swaps the order of these without ending up with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;string s = &quot;some very long&quot;&#xA;int x;&#xA;           &quot;string&quot;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do it?&lt;/p&gt;&#xA;" OwnerUserId="11251" LastActivityDate="2016-03-01T19:00:09.333" Title="Swap two statement on adjacent lines in C when one statement takes multiple lines" Tags="|c|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20630" PostTypeId="1" AcceptedAnswerId="20632" CreationDate="2016-02-27T18:27:29.157" Score="4" ViewCount="246" Body="&lt;p&gt;I'm using sparse trees (not in agenda view, but in &quot;normal&quot; tree view) to help me get a clear picture of what I have to do, at a glance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to create a sparse tree that shows all the tasks that have no deadlines, and whose parents also have no deadlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that possible with a search query? If not, how can I do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="11252" LastActivityDate="2016-02-28T16:51:05.530" Title="Org-mode find tasks with no deadlines, transitively" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20631" PostTypeId="2" ParentId="16731" CreationDate="2016-02-27T19:23:00.487" Score="1" Body="&lt;p&gt;I also had this problem and created an issue on the project GitHub account. Here is what I got back:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;That's because ESS is binding { to ess-electric-brace which stopped&#xA;  working at some point. This is historical and I think even precedes&#xA;  skeleton-pair. It should be working now. You can always fix such&#xA;  issues by unseting the keys in ess mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ess-mode-map (kbd &quot;{&quot;) nil)&#xA;(define-key ess-mode-map (kbd &quot;}&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I added this to my .emacs file and everything works fine now. Hope this helps you! &lt;/p&gt;&#xA;" OwnerUserId="11253" LastActivityDate="2016-02-27T19:23:00.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20632" PostTypeId="2" ParentId="20630" CreationDate="2016-02-27T19:31:10.097" Score="3" Body="&lt;p&gt;In case someone else is interested, I found out a way to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;trick&quot; is to make &lt;code&gt;DEADLINE&lt;/code&gt; an inherited property. While subtasks with only inherited deadlines will still not show up in the agenda (for those deadlines), search criteria involving deadlines will apply to them anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make &lt;code&gt;DEADLINE&lt;/code&gt; an inherited property, use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-use-property-inheritance (quote (&quot;DEADLINE&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then find tasks without a deadline with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c / m -DEADLINE={.}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or the full command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-match-sparse-tree nil &quot;-DEADLINE={.}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The following thread gave me the way to make DEADLINE inherited: &lt;a href=&quot;http://comments.gmane.org/gmane.emacs.orgmode/48932&quot; rel=&quot;nofollow&quot;&gt;http://comments.gmane.org/gmane.emacs.orgmode/48932&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The org-mode manual explains how search for tasks with not scheduled date: &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/advanced-searching.html#sec-7&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/advanced-searching.html#sec-7&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11252" LastEditorUserId="11252" LastEditDate="2016-02-28T16:51:05.530" LastActivityDate="2016-02-28T16:51:05.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20633" PostTypeId="1" CreationDate="2016-02-27T20:24:12.043" Score="4" ViewCount="1167" Body="&lt;p&gt;This seems a catch-22: I want to render code in an org-mode export (html or latex pdf) where the snippet below done as a &lt;code&gt;~&lt;/code&gt;code block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; (cons 1 nil) \to (1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;actually renders &lt;code&gt;\to&lt;/code&gt; as a proper right arrow (yields). Of course if I do the snippet as inline latex &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$&amp;gt; (cons 1 nil) \to (1)$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the properly rendered right arrow, but now it's not in the sans mono code font. What can I do to have my cake and eat it too?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2016-10-27T02:15:28.633" Title="Org-mode: How to render latex inside ~code~" Tags="|org-mode|latex|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20634" PostTypeId="2" ParentId="20605" CreationDate="2016-02-27T21:04:39.350" Score="2" Body="&lt;p&gt;The short answer is that &lt;code&gt;powerline&lt;/code&gt; and &lt;code&gt;delight&lt;/code&gt; are not directly compatible; but I've made a change to &lt;a href=&quot;https://www.emacswiki.org/emacs/DelightedModes&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;delight&lt;/code&gt;&lt;/a&gt; (new version 1.04) to make such integration possible in general, and I've added a &lt;a href=&quot;https://www.emacswiki.org/emacs/DelightedPowerLine&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;delight-powerline&lt;/code&gt;&lt;/a&gt; library which builds on top of that to handle powerline specifically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Original answer follows...&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Well I tried your config. My first comment is that you seem to be specifying the &lt;em&gt;default&lt;/em&gt; mode names in most of your :delight specs, which is kinda weird. e.g. org-mode &lt;em&gt;already&lt;/em&gt; uses &quot;Org&quot; as its mode-name -- there's surely very little point in using &lt;code&gt;:delight org-mode &quot;Org&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However&lt;/em&gt; I can confirm that delight is still working for major modes with powerline enabled, because if I visit an org-mode buffer and check &lt;code&gt;mode-name&lt;/code&gt; it tells me &lt;code&gt;(inhibit-mode-name-delight &quot;Org&quot; &quot;Org&quot;)&lt;/code&gt; (normally those two values wouldn't be identical, of course, but see above...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is delight's way of getting the mode line to show the delighted value without &lt;em&gt;also&lt;/em&gt; showing that custom value in other contexts (e.g. &lt;code&gt;M-x describe-mode&lt;/code&gt; which also displays &lt;code&gt;mode-name&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This suggests to me that powerline is calling &lt;code&gt;format-mode-line&lt;/code&gt; explicitly, which is delight's trigger (via advice) to show the &lt;em&gt;original&lt;/em&gt; version of the name. (n.b. It's slightly unintuitive, but &lt;code&gt;format-mode-line&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; called by the normal mode-line display code, but provided so that &lt;em&gt;other&lt;/em&gt; things can render mode line constructs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's an incompatibility between the two libraries, I'm afraid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;em&gt;disable&lt;/em&gt; delight's advice (after it has been loaded) like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(ad-disable-advice 'format-mode-line 'around 'delighted-modes-are-glum)&#xA;(ad-activate 'format-mode-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will fix your powerline output, but also means that anything else which displays a major mode's mode-name will also show the delighted version. That's probably still preferable for you, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better would be some advice to act &lt;em&gt;only&lt;/em&gt; when powerline is being called. This wasn't an option for the standard mode line rendering, but could certainly be done for cases like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've uploaded a &lt;a href=&quot;https://www.emacswiki.org/emacs/DelightedPowerLine&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;delight-powerline.el&lt;/code&gt; integration library&lt;/a&gt; to the EmacsWiki.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it requires the equally-new version 1.04 of &lt;a href=&quot;https://www.emacswiki.org/emacs/DelightedModes&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;delight.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-02-28T13:38:18.407" LastActivityDate="2016-02-28T13:38:18.407" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20635" PostTypeId="2" ParentId="20533" CreationDate="2016-02-28T12:00:14.223" Score="6" Body="&lt;p&gt;The command &lt;code&gt;org-time-sheet&lt;/code&gt; defined in the following code does &lt;strong&gt;almost&lt;/strong&gt; what you specified.&#xA;If you call it interactively with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;org-time-sheet&lt;/code&gt; you can also set the start and the end time. Only clock entries starting in this time range are included into the time sheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some words about &quot;&lt;strong&gt;almost&lt;/strong&gt;&quot;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You did not specify how you differentiate between efforts on different days. &lt;code&gt;org-time-sheet&lt;/code&gt; writes the date in the first column when it starts a new day.&lt;/li&gt;&#xA;&lt;li&gt;It is better to write out an org-table instead of inserting commas or tabs as separators. You can then put point into the table and call the menu-point &lt;code&gt;Tbl&lt;/code&gt; -&gt; &lt;code&gt;Export&lt;/code&gt; to export to whatever format is supported (e.g., csv-format).&lt;/li&gt;&#xA;&lt;li&gt;Currently, I also insert a start and a end timestamp into the first two columns of the table. This makes easier for you to check whether you get what you want. When you believe that you get what you want you can customize the function &lt;code&gt;org-time-sheet-time-formatter&lt;/code&gt;. Just remove the formatted &lt;code&gt;minutes-start&lt;/code&gt; and &lt;code&gt;minutes-end&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Time-spans for the same project in the same hour are now summed up by default. If you do call &lt;code&gt;org-time-sheet&lt;/code&gt; with prefix arg then these time-spans are listed separately.&lt;/li&gt;&#xA;&lt;li&gt;The time-sheet is inserted at point if you call &lt;code&gt;org-time-sheet&lt;/code&gt; interactively. Previously, the time-sheet was inserted after the next code-block.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-time-sheet-date-formatter&#xA;  (lambda (day month year) (format &quot;%4d-%02d-%02d&quot; year month day))&#xA;  &quot;Function to format date in time sheets.&#xA;It takes three numbers as arguments: day month year.&quot;&#xA;  :type 'function&#xA;  :group 'org-clock)&#xA;&#xA;(defcustom org-time-sheet-time-formatter&#xA;  (lambda (start end hour minutes headings)&#xA;    (list (format-time-string &quot;%F %R&quot; (apply 'encode-time minutes-start))&#xA;          (format-time-string &quot;%F %R&quot; (apply 'encode-time minutes-end))&#xA;          (format &quot;%2d00--%2d00&quot; hour (1+ hour)) (or (nth 1 headings) &quot;&quot;) (or (nth 2 headings) &quot;&quot;) minutes))&#xA;  &quot;Callback function returning one table line in a time sheet (as list).&#xA;The arguments of the function are:&#xA;START:    start time with format as in `decode-time'&#xA;END:     end time with format as in `decode-time'&#xA;MINUTES:  number of minutes between start time and end time&#xA;HEADINGS: the heading titles of the current entry and all its parents as a list starting with the top-parent.&quot;&#xA;  :type 'function&#xA;  :group 'org-clock)&#xA;&#xA;(eval-when-compile&#xA;  (require 'cl-lib))&#xA;(require 'org-element)&#xA;(require 'ob-core)&#xA;&#xA;(defun org-element-parent (element &amp;amp;optional type)&#xA;  &quot;Get parent of ELEMENT or nil if there is none.&#xA;If TYPE is non-nil get next parent of that type.&quot;&#xA;  (let* ((props (cadr element))&#xA;         (parent (plist-get props :parent)))&#xA;    (if type&#xA;        (when parent&#xA;          (if (eq (car parent) type)&#xA;              parent&#xA;            (org-element-parent parent type)))&#xA;      parent)))&#xA;&#xA;(defun org-element-timestamp-less-p (ts1 ts2 &amp;amp;optional end)&#xA;  &quot;Non-nil if timestamp TS1 is less than timestamp TS2.&#xA;TS1 and TS2 is timestamp data as returned by `org-element-timestamp-parser'.&#xA;If end is non-nil the end-time of TS1 and TS2 is compared else the start time.&quot;&#xA;  (cl-assert (eq (car ts1) 'timestamp) &quot;TS1 is not a timestamp&quot;)&#xA;  (cl-assert (eq (car ts2) 'timestamp) &quot;TS2 is not a timestamp&quot;)&#xA;  (let ((p1 (cadr ts1))&#xA;    (p2 (cadr ts2))&#xA;    (tests '(&quot;year&quot; &quot;month&quot; &quot;day&quot; &quot;hour&quot; &quot;minute&quot;))&#xA;    ret)&#xA;    (while (and (let* ((what (intern-soft (concat &quot;:&quot; (car tests) (if end &quot;-end&quot; &quot;-start&quot;))))&#xA;               (t1 (plist-get p1 what))&#xA;               (t2 (plist-get p2 what)))&#xA;          (cond&#xA;           ((&amp;lt; t1 t2)&#xA;            (setq ret t)&#xA;            nil)&#xA;           ((= t1 t2) t)))&#xA;        (setq tests (cdr tests))))&#xA;    ret))&#xA;&#xA;(defun time-day-month-year (time)&#xA;  &quot;Return the list (day month year) from TIME.&#xA;TIME may be the time as returned by `current-time' or by `decode-time'.&quot;&#xA;  (if (&amp;lt;= (length time) 4)&#xA;      (setq time (decode-time time)))&#xA;  (mapcar (lambda (el) (nth el time)) '(3 4 5)))&#xA;&#xA;(defun org-element-timestamp-to-time (timestamp &amp;amp;optional start/end encode)&#xA;  &quot;Convert start or end of TIMESTAMP returned by `org-element-timestamp-parser'&#xA;to time format as defined in the documentation of `decode-time'.&#xA;START/END is either the symbol 'start or 'end or nil which is equivalent to 'start.&#xA;If ENCODE is non-nil the return value is encoded as described in the documentation for `current-time'.&quot;&#xA;  (cl-assert (eq (car timestamp) 'timestamp) &quot;Argument is not a timestamp&quot;)&#xA;  (unless start/end (setq start/end 'start))&#xA;  (let* ((p (cadr timestamp))&#xA;     (ret (append&#xA;           '(0)&#xA;           (mapcar (lambda (what) (plist-get p (intern-soft (concat &quot;:&quot; what &quot;-&quot; (symbol-name start/end))))) '(&quot;minute&quot; &quot;hour&quot; &quot;day&quot; &quot;month&quot; &quot;year&quot;))&#xA;           (list 0 nil (car (current-time-zone))))))&#xA;    (if encode&#xA;    (apply #'encode-time ret)&#xA;      ret)))&#xA;&#xA;(defmacro decoded-time-complete-timezone (t1 t2)&#xA;  &quot;If only one of the time specifications T1 and T2 has time-zone information&#xA;append that to the other one.&quot;&#xA;  `(let ((n1 (length ,t1))&#xA;         (n2 (length ,t2)))&#xA;     (cond&#xA;      ((&amp;gt; n1 n2)&#xA;       (setq ,t2 (copy-sequence ,t2))&#xA;       (setf (nthcdr n2 ,t2) (nthcdr n2 ,t1)))&#xA;      ((&amp;lt; n1 n2)&#xA;       (setq ,t1 (copy-sequence ,t1))&#xA;       (setf (nthcdr n1 ,t1) (nthcdr n1 ,t2))))))&#xA;&#xA;(defun decoded-time-less-p (t1 t2)&#xA;  &quot;Like `time-less-p' but for decoded time values as `decode-time' returns.&quot;&#xA;  (decoded-time-complete-timezone t1 t2)&#xA;  (time-less-p (apply 'encode-time t1) (apply 'encode-time t2)))&#xA;&#xA;(defun decoded-time-advance (time dt)&#xA;  &quot;Return TIME advanced by DT but for decoded time values as `decode-time' returns.&#xA;The time zone information of time is used for the result.&quot;&#xA;  (decode-time (apply 'encode-time (append (cl-mapcar #'+ (butlast time (- (length time) 6)) (butlast dt (- (length dt) 6))) (nthcdr 6 time)))))&#xA;&#xA;(defun org-time-sheet (&amp;amp;optional tStart tEnd dont-sum)&#xA;  &quot;Create time sheet for time span from tStart to tEnd from current org buffer.&#xA;When called non-interactively each of the parameters tStart and tEnd may be nil&#xA;or must be decoded time (see `decode-time').&#xA;Do not sum up minutest of a project within an hour if dont-sum is non-nil.&#xA;Interactively do not sum if called with prefix arg.&quot;&#xA;   (interactive (list&#xA;                 (decode-time (org-read-date t t nil &quot;Start time:&quot; '(0 0)))&#xA;                 (decode-time (org-read-date t t nil &quot;End time:&quot;))&#xA;         current-prefix-arg))&#xA;   (org-time-sheet-shedule (org-time-sheet-collect tStart tEnd) (called-interactively-p 'any) dont-sum))&#xA;&#xA;(defun org-time-sheet-collect (tStart tEnd)&#xA;  &quot;Returns ordered time sheet collection of current buffer&#xA;for clocked items with start time within the range from tStart to tEnd.&quot;&#xA;  (if (&amp;gt; (length tStart) 4)&#xA;      (setq tStart (apply 'encode-time tStart)))&#xA;  (if (&amp;gt; (length tEnd) 4)&#xA;      (setq tEnd (apply 'encode-time tEnd)))&#xA;   (let ((tree (org-element-parse-buffer)))&#xA;     (cl-stable-sort &#xA;      (org-element-map tree 'clock&#xA;        (lambda (clock)&#xA;          ;; get the relevant data of the clocks&#xA;          (let* ((timestamp (plist-get (cadr clock) :value))&#xA;                 (parent clock)&#xA;                 (headers (nreverse (cl-loop while (setq parent (org-element-parent parent 'headline)) collect (car (plist-get (cadr parent) :title))))))&#xA;            (cl-assert timestamp nil &quot;Clock line without timestamp&quot;)&#xA;            (when (and (or (null tStart) (null (time-less-p (org-element-timestamp-to-time timestamp 'start t) tStart)))&#xA;                       (or (null tEnd) (time-less-p (org-element-timestamp-to-time timestamp 'end t) tEnd)))&#xA;              (list (org-element-timestamp-to-time timestamp 'start)&#xA;                    (org-element-timestamp-to-time timestamp 'end)&#xA;                    headers))&#xA;            )))&#xA;      #'time-less-p&#xA;      :key (lambda (clock) (apply 'encode-time (car clock))))))&#xA;&#xA;(defun org-time-sheet-shedule (clocks &amp;amp;optional interactive dont-sum)&#xA;  &quot;Creates time sheet shedule from ordered time sheet clock collection (see `org-time-sheet-collect').&quot;&#xA;     ;; sheduling&#xA;     (when clocks&#xA;       (setq clocks (cons nil clocks))&#xA;       (let* ((start (copy-sequence (caadr clocks)))&#xA;              (day-month-year (time-day-month-year start))&#xA;              (shedule (list (list (apply org-time-sheet-date-formatter day-month-year)))))&#xA;         (setf (nth 1 start) 0) ;; clear minutes&#xA;         (while (cdr clocks)&#xA;           (let ((end (decoded-time-advance start '(0 0 1 0 0 0)))&#xA;         project-alist&#xA;                 (iter clocks))&#xA;             (while (decoded-time-less-p (cl-caadr iter) end) ;; collect clocks starting before the end of current hour&#xA;               (let* ((start-time (cl-caadr iter))&#xA;                      (end-time (cl-cadadr iter))&#xA;                      (minutes-start (if (decoded-time-less-p start-time start) start start-time))&#xA;                      (minutes-end (if (decoded-time-less-p end end-time) end end-time))&#xA;              (minutes (/ (nth 1 (time-subtract (apply 'encode-time minutes-end) (apply 'encode-time minutes-start))) 60))&#xA;                      (headlines (nth 2 (cadr iter)))&#xA;              (project (assoc headlines project-alist)))&#xA;         (if (and project (null dont-sum))&#xA;             (setcdr project (list (+ (cadr project) minutes) minutes-start minutes-end))&#xA;           (setq project-alist (cons (list headlines minutes minutes-start minutes-end) project-alist)))&#xA;                 (if (decoded-time-less-p end end-time)&#xA;                     (setq iter (cdr iter))&#xA;                   ;; delete clock that also finishes in this hour:&#xA;                   (setcdr iter (cddr iter))) ;; delete clock entry&#xA;                 ))&#xA;         (setq project-alist (nreverse project-alist))&#xA;         ;; Compose shedule for hour:&#xA;         (while project-alist&#xA;           (let ((headlines (caar project-alist))&#xA;             (minutes (nth 1 (car project-alist)))&#xA;             (minutes-start (nth 2 (car project-alist)))&#xA;             (minutes-end (nth 3 (car project-alist))))&#xA;         (setq shedule (cons (funcall org-time-sheet-time-formatter minutes-start minutes-end (nth 2 start) minutes headlines) shedule)))&#xA;           (setq project-alist (cdr project-alist)))&#xA;             ;; calculate new time:&#xA;             (when (cdr clocks)&#xA;               (let ((next-hour-start-time (decoded-time-advance start '(0 0 1 0 0 0)))&#xA;                     (next-hour-end-time (decoded-time-advance start '(0 0 2 0 0 0))))&#xA;                 (setq start (copy-sequence (caadr clocks)))&#xA;                 (setf (nth 1 start) 0) ;; minutes&#xA;                 (when (decoded-time-less-p start next-hour-end-time)&#xA;                   (setq start next-hour-start-time))&#xA;                 (let ((new-day-month-year (time-day-month-year start)))&#xA;                   (unless (equal day-month-year new-day-month-year)&#xA;                     (setq shedule (cons (list (apply org-time-sheet-date-formatter new-day-month-year)) shedule)&#xA;                           day-month-year new-day-month-year)))))))&#xA;         (setq shedule (nreverse shedule))&#xA;         (when interactive&#xA;       (insert (with-temp-buffer&#xA;             (insert &quot;#+begin_src emacs-lisp\n#+end_src\n&quot;)&#xA;             (let ((pt (point)))&#xA;               (org-babel-insert-result shedule)&#xA;               (delete-region (point-min) pt))&#xA;             (buffer-string))))&#xA;         shedule)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You get the following output for your example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 2015-10-09       |                  |            |                       |                                |    |&#xA;| 2015-10-09 15:10 | 2015-10-09 16:00 | 1400--1500 | PU                    | Identify PU Open equella block | 50 |&#xA;| 2015-10-09 16:00 | 2015-10-09 17:00 | 1600--1700 | PU                    | Identify PU Open equella block | 60 |&#xA;| 2015-10-09 17:00 | 2015-10-09 17:06 | 1700--1800 | PU                    | Identify PU Open equella block |  6 |&#xA;| 2015-11-16       |                  |            |                       |                                |    |&#xA;| 2015-11-16 14:49 | 2015-11-16 15:00 | 1400--1500 | PU                    | Update UAT                     | 11 |&#xA;| 2015-11-17       |                  |            |                       |                                |    |&#xA;| 2015-11-17 09:12 | 2015-11-17 09:18 |  900--1000 | PU                    | Update UAT                     |  6 |&#xA;| 2016-01-12       |                  |            |                       |                                |    |&#xA;| 2016-01-12 11:00 | 2016-01-12 12:00 | 1100--1200 | Greenwich Consultancy |                                | 60 |&#xA;| 2016-01-12 12:00 | 2016-01-12 13:00 | 1200--1300 | Greenwich Consultancy |                                | 60 |&#xA;| 2016-01-12 13:00 | 2016-01-12 14:00 | 1300--1400 | Greenwich Consultancy |                                | 60 |&#xA;| 2016-01-12 14:00 | 2016-01-12 15:00 | 1400--1500 | Greenwich Consultancy |                                | 60 |&#xA;| 2016-01-12 15:00 | 2016-01-12 16:00 | 1500--1600 | Greenwich Consultancy |                                | 60 |&#xA;| 2016-01-12 16:00 | 2016-01-12 16:53 | 1600--1700 | Greenwich Consultancy |                                | 53 |&#xA;| 2016-01-13       |                  |            |                       |                                |    |&#xA;| 2016-01-13 14:48 | 2016-01-13 15:00 | 1400--1500 | Greenwich Consultancy |                                | 12 |&#xA;| 2016-01-13 15:00 | 2016-01-13 15:29 | 1500--1600 | Greenwich Consultancy |                                | 29 |&#xA;| 2016-01-29       |                  |            |                       |                                |    |&#xA;| 2016-01-29 12:27 | 2016-01-29 12:33 | 1200--1300 | PU                    | PSMD Block                     |  6 |&#xA;| 2016-02-02       |                  |            |                       |                                |    |&#xA;| 2016-02-02 16:39 | 2016-02-02 17:00 | 1600--1700 | PU                    | PSMD Block                     | 21 |&#xA;| 2016-02-03       |                  |            |                       |                                |    |&#xA;| 2016-02-03 09:39 | 2016-02-03 10:00 |  900--1000 | PU                    | PSMD Block                     | 21 |&#xA;| 2016-02-03 10:00 | 2016-02-03 10:24 | 1000--1100 | PU                    | PSMD Block                     | 24 |&#xA;| 2016-02-05       |                  |            |                       |                                |    |&#xA;| 2016-02-05 10:36 | 2016-02-05 10:53 | 1000--1100 | PU                    | PSMD Block                     | 17 |&#xA;| 2016-02-05 11:11 | 2016-02-05 12:00 | 1100--1200 | PU                    | PSMD Block                     | 49 |&#xA;| 2016-02-05 12:00 | 2016-02-05 12:02 | 1200--1300 | PU                    | PSMD Block                     |  2 |&#xA;| 2016-02-05 14:27 | 2016-02-05 15:00 | 1400--1500 | PU                    | PSMD Block                     | 33 |&#xA;| 2016-02-05 15:00 | 2016-02-05 16:00 | 1500--1600 | PU                    | PSMD Block                     | 60 |&#xA;| 2016-02-05 16:00 | 2016-02-05 16:36 | 1600--1700 | PU                    | PSMD Block                     | 36 |&#xA;| 2016-02-09       |                  |            |                       |                                |    |&#xA;| 2016-02-09 10:15 | 2016-02-09 10:58 | 1000--1100 | PU                    | PSMD Block                     | 43 |&#xA;| 2016-02-09 12:13 | 2016-02-09 13:00 | 1200--1300 | PU                    | PSMD Block                     | 47 |&#xA;| 2016-02-09 13:00 | 2016-02-09 13:01 | 1300--1400 | PU                    | PSMD Block                     |  1 |&#xA;| 2016-02-09 14:24 | 2016-02-09 15:00 | 1400--1500 | PU                    | PSMD Block                     | 36 |&#xA;| 2016-02-09 15:00 | 2016-02-09 15:02 | 1500--1600 | PU                    | PSMD Block                     |  2 |&#xA;| 2016-02-09 16:17 | 2016-02-09 16:31 | 1600--1700 | PU                    | PSMD Block                     | 14 |&#xA;| 2016-02-11       |                  |            |                       |                                |    |&#xA;| 2016-02-11 14:27 | 2016-02-11 14:47 | 1400--1500 | PU                    | PSMD Block                     | 20 |&#xA;| 2016-02-17       |                  |            |                       |                                |    |&#xA;| 2016-02-17 10:03 | 2016-02-17 10:16 | 1000--1100 | PU                    | Update UAT                     | 13 |&#xA;| 2016-02-18       |                  |            |                       |                                |    |&#xA;| 2016-02-18 10:40 | 2016-02-18 11:00 | 1000--1100 | Greenwich Consultancy |                                | 20 |&#xA;| 2016-02-18 11:00 | 2016-02-18 11:10 | 1100--1200 | Greenwich Consultancy |                                | 10 |&#xA;| 2016-02-25       |                  |            |                       |                                |    |&#xA;| 2016-02-25 11:19 | 2016-02-25 11:33 | 1100--1200 | PU                    | UAT PSMD Roamers problem       | 14 |&#xA;| 2016-02-25 16:56 | 2016-02-25 16:59 | 1600--1700 | PU                    | Server tidy                    |  3 |&#xA;| 2016-02-25 16:59 | 2016-02-25 17:00 | 1600--1700 | PU                    | Server tidy                    |  1 |&#xA;| 2016-02-25 17:00 | 2016-02-25 18:00 | 1700--1800 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-25 18:00 | 2016-02-25 19:00 | 1800--1900 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-25 19:00 | 2016-02-25 20:00 | 1900--2000 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-25 20:00 | 2016-02-25 21:00 | 2000--2100 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-25 21:00 | 2016-02-25 22:00 | 2100--2200 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-25 22:00 | 2016-02-25 23:00 | 2200--2300 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-25 23:00 | 2016-02-26 00:00 | 2300--2400 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26       |                  |            |                       |                                |    |&#xA;| 2016-02-26 00:00 | 2016-02-26 01:00 |  000-- 100 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 01:00 | 2016-02-26 02:00 |  100-- 200 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 02:00 | 2016-02-26 03:00 |  200-- 300 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 03:00 | 2016-02-26 04:00 |  300-- 400 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 04:00 | 2016-02-26 05:00 |  400-- 500 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 05:00 | 2016-02-26 06:00 |  500-- 600 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 06:00 | 2016-02-26 07:00 |  600-- 700 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 07:00 | 2016-02-26 08:00 |  700-- 800 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 08:00 | 2016-02-26 09:00 |  800-- 900 | PU                    | Server tidy                    | 60 |&#xA;| 2016-02-26 09:00 | 2016-02-26 09:22 |  900--1000 | PU                    | Server tidy                    | 22 |&#xA;| 2016-02-26 15:35 | 2016-02-26 16:00 | 1500--1600 | PU                    | Gradebook problem              | 25 |&#xA;| 2016-02-26 16:00 | 2016-02-26 16:26 | 1600--1700 | PU                    | Gradebook problem              | 26 |&#xA;| 2016-02-26 16:26 | 2016-02-26 16:53 | 1600--1700 | PU                    | PSMD Block                     | 27 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="7019" LastEditDate="2017-02-17T08:49:38.343" LastActivityDate="2017-02-17T08:49:38.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20636" PostTypeId="1" CreationDate="2016-02-28T13:48:00.673" Score="5" ViewCount="526" Body="&lt;p&gt;I have a tree of deeply nested keymaps, with many possible leaves (commands), too many for a human to remember. For simplicity, let's say each command is associated with a given file name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to display a help tool-tip as the user is walking down these keymaps, indicating which files/commands are bound to which keys. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I would like to associate with certain keymaps a short documentation, and display it whenever the user is &quot;on&quot; the keymap (perhaps using help-fns+.el or some other custom docstring). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2016-02-28T15:26:06.697" LastActivityDate="2016-02-29T22:33:02.387" Title="Displaying bindings for prefix keymaps" Tags="|keymap|prefix-keys|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20638" PostTypeId="2" ParentId="20628" CreationDate="2016-02-28T15:04:53.607" Score="2" Body="&lt;p&gt;You can use the built-in &lt;code&gt;backward-kill-sexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-DEL&quot;) 'backward-kill-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the unwanted effect of adding whatever was deleted to the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix this you can try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun backward-delete-sexp (arg)&#xA;     (interactive &quot;P&quot;)&#xA;     (delete-region (point)&#xA;            (progn (backward-sexp arg) (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2846" LastActivityDate="2016-02-28T15:04:53.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20639" PostTypeId="2" ParentId="20567" CreationDate="2016-02-28T15:21:46.440" Score="2" Body="&lt;p&gt;&lt;code&gt;C-h s&lt;/code&gt; (&lt;code&gt;describe-syntax&lt;/code&gt;) shows that &lt;code&gt;\&lt;/code&gt; indeed has &lt;em&gt;escape&lt;/em&gt; syntax.  You can change it with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/make-backslash-punctuation ()&#xA;  (modify-syntax-entry ?\\ &quot;.&quot;))&#xA;&#xA;(add-hook 'opascal-mode-hook #'my/make-backslash-punctuation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-02-28T15:21:46.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20640" PostTypeId="2" ParentId="20533" CreationDate="2016-02-28T15:25:47.087" Score="7" Body="&lt;p&gt;My solution is by no means shorter than the one by Tobias, and I probably would not have written it, had I not been interested in one of the side products: A function which collects me all clock ranges with full heading information in a certain time interval, which is the basis for further processing. Based on this function and some other helpers, I implement a dynamic block which you can use like a normal org clocktable block.&#xA;So, you just write the following, and upon hitting &lt;code&gt;C-c C-c&lt;/code&gt; on the BEGIN line, it will expand to the table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;  #+BEGIN: nagora-report :buffer &quot;nagora-example.org&quot; :day 2016-02-05&#xA;  #+END:&#xA;&#xA;  #+BEGIN: nagora-report :buffer &quot;nagora-example.org&quot; :day 2016-02-25&#xA;  #+END:&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These two blocks will expand to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;  #+BEGIN: nagora-report :buffer &quot;nagora-example.org&quot; :day 2016-02-05&#xA;  #+CAPTION: timesheet for day 2016-02-05&#xA;  |        Time | Customer | Task       | Minutes |&#xA;  |-------------+----------+------------+---------|&#xA;  | 10:00-11:00 | PU [2/2] | PSMD Block |      17 |&#xA;  | 11:00-12:00 | PU [2/2] | PSMD Block |      49 |&#xA;  | 12:00-13:00 | PU [2/2] | PSMD Block |       2 |&#xA;  | 14:00-15:00 | PU [2/2] | PSMD Block |      33 |&#xA;  | 15:00-16:00 | PU [2/2] | PSMD Block |      60 |&#xA;  | 16:00-17:00 | PU [2/2] | PSMD Block |      36 |&#xA;  |-------------+----------+------------+---------|&#xA;  |       TOTAL |          |            |     197 |&#xA;  #+TBLFM: @&gt;$&gt;=vsum(@I..@II)&#xA;  #+END:&#xA;&#xA;  #+BEGIN: nagora-report :buffer &quot;nagora-example.org&quot; :day 2016-02-25&#xA;  #+CAPTION: timesheet for day 2016-02-25&#xA;  |        Time | Customer | Task                          | Minutes |&#xA;  |-------------+----------+-------------------------------+---------|&#xA;  | 11:00-12:00 | PU [2/2] | UAT PSMD Roamers problem      |      14 |&#xA;  | 16:00-17:00 | PU [2/2] | STARTED Check TII code on UAT |       1 |&#xA;  | 16:00-17:00 | PU [2/2] | Update Coursework M26 branch  |       3 |&#xA;  | 17:00-18:00 | PU [2/2] | STARTED Check TII code on UAT |      60 |&#xA;  | 18:00-19:00 | PU [2/2] | STARTED Check TII code on UAT |      60 |&#xA;  | 19:00-20:00 | PU [2/2] | STARTED Check TII code on UAT |      60 |&#xA;  | 20:00-21:00 | PU [2/2] | STARTED Check TII code on UAT |      60 |&#xA;  | 21:00-22:00 | PU [2/2] | STARTED Check TII code on UAT |      60 |&#xA;  | 22:00-23:00 | PU [2/2] | STARTED Check TII code on UAT |      60 |&#xA;  |-------------+----------+-------------------------------+---------|&#xA;  |       TOTAL |          |                               |     378 |&#xA;  #+TBLFM: @&gt;$&gt;=vsum(@I..@II)&#xA;  #+END:&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The counters in brackets can be easily cleaned up if desired. Currently the dynamic block wants an open buffer (&lt;code&gt;:buffer&lt;/code&gt; argument) but it is trivial to change that to a file path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still wonder at this special timesheet reporting format, because it also is not translation invariant, so the same amount of work will look different, if you begin at the start of an hour or some time later. But sometimes it is shorter to implement such a function than discuss with management ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this is useful. It certainly can be cleaned up a bit and made more consistent.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dfeich/org-clock-get-tr-for-ivl (buffer tstart-str tend-str &amp;amp;optional limit)&#xA;  &quot;Return clocking information touching a given time interval.&quot;&#xA;  (cl-assert (and buffer (get-buffer buffer)) nil &quot;Error: :buffer must be defined&quot;)&#xA;  (with-current-buffer buffer&#xA;    (save-excursion&#xA;      (let ((re (concat &quot;^\\(\\*+[ \t]*.*\\)\\|^[ \t]*&quot;&#xA;            org-clock-string&#xA;            &quot;[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=&amp;gt;[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)&quot;))&#xA;        (counter 0)&#xA;        (tmphd &quot;BEFORE FIRST HEADING&quot;)&#xA;        (tstart (org-time-string-to-seconds tstart-str))&#xA;        (tend (org-time-string-to-seconds tend-str))&#xA;        (limit (or limit (point-max)))&#xA;        headings timelst&#xA;        lvl title result ts te)&#xA;    (goto-char (point-min))&#xA;    (cl-block myblock&#xA;      (while (re-search-forward re nil t)&#xA;        (cond&#xA;         ;; found a org heading&#xA;         ((match-end 1)&#xA;          (if (&amp;gt; (length timelst) 0)&#xA;          (setq result (nconc result (list (list&#xA;                            (copy-sequence headings)&#xA;                            timelst)))))&#xA;          (setq tmphd (org-heading-components)&#xA;            lvl (car tmphd)&#xA;            title (nth 4 tmphd)&#xA;            timelst nil)&#xA;          ;; maintain a list of the current heading hierarchy&#xA;          (cond&#xA;           ((&amp;gt; lvl (length headings))&#xA;        (setq headings  (nconc headings `(,title))))&#xA;           ((= lvl (length headings))&#xA;        (setf (nth (1- lvl) headings) title))&#xA;           ((&amp;lt; lvl (length headings))&#xA;        (setq headings (cl-subseq headings 0 lvl))&#xA;        (setf (nth (1- lvl) headings) title))))&#xA;         ;; found a clock line with 2 timestamps&#xA;         ((match-end 3)&#xA;          (setq ts (save-match-data (org-time-string-to-seconds&#xA;                     (match-string-no-properties 2)))&#xA;            te (save-match-data (org-time-string-to-seconds&#xA;                     (match-string-no-properties 3))))&#xA;          ;; the clock lines progress from newest to oldest. This&#xA;          ;; enables skipping the rest if this condition is true&#xA;          (if (&amp;gt; tstart te)&#xA;          (if (re-search-forward &quot;^\\(\\*+[ \t]*.*\\)&quot; nil t)&#xA;              (beginning-of-line)&#xA;            (goto-char (point-max)))&#xA;        (when (&amp;gt; tend ts)&#xA;          (setq timelst (nconc timelst (list&#xA;                        (list (match-string-no-properties 2)&#xA;                              (match-string-no-properties 3)))))))))&#xA;        (when (&amp;gt;= (point) limit)&#xA;          (cl-return-from myblock))))&#xA;    (if (&amp;gt; (length timelst) 0)&#xA;        (setq result (nconc result (list (list (copy-sequence headings)&#xA;                           timelst)))))&#xA;    result))))&#xA;&#xA;(defun dfeich/org-slice-tr (tstart-str tend-str cutstart-str cutend-str)&#xA;  &quot;Return time slice of a time range in minutes.&quot;&#xA;  (let ((tstart (org-time-string-to-seconds tstart-str))&#xA;    (tend (org-time-string-to-seconds tend-str))&#xA;    (cutstart (if (stringp cutstart-str)&#xA;              (org-time-string-to-seconds cutstart-str)&#xA;            cutstart-str))&#xA;    (cutend (if (stringp cutend-str)&#xA;            (org-time-string-to-seconds cutend-str)&#xA;          cutend-str))&#xA;    result)&#xA;    (setq result (max 0&#xA;              (/  (- (min tend cutend) (max tstart cutstart))&#xA;              60)))))&#xA;&#xA;(defun dfeich/org-clock-hourly-report (struct tstart-str tend-str)&#xA;  &quot;Return a structure containing a per hour report within an interval.&quot;&#xA;  (let* ((tstart (org-time-string-to-seconds tstart-str))&#xA;     (tend (org-time-string-to-seconds tend-str))&#xA;     (delta 3600)&#xA;     (intvls (cl-loop for tm from tstart to (- tend delta) by delta&#xA;              collect `(,tm ,(+ tm delta))))&#xA;     result)&#xA;    ;; iterate over the intervals for the final table&#xA;    (cl-loop for iv in intvls&#xA;         collect (list&#xA;              iv&#xA;              (let* ((cutstart (car iv))&#xA;                 (cutend (cadr iv))&#xA;                 (tmsum 0.0)&#xA;                 headings trlst)&#xA;            ;; iterate over the task structure&#xA;            (cl-loop&#xA;             for item in struct&#xA;             do (progn&#xA;                  (setq headings (car item)&#xA;                    trlst (cadr item)&#xA;                    ;; sum up the parts of the time&#xA;                    ;; ranges falling into this&#xA;                    ;; interval&#xA;                    tmsum (apply&#xA;                       #'+&#xA;                       (mapcar&#xA;                        (lambda (tr)&#xA;                          (dfeich/org-slice-tr (car tr)&#xA;                                   (cadr tr)&#xA;                                   cutstart&#xA;                                   cutend))&#xA;                        trlst))))&#xA;             if (&amp;gt; tmsum 0) collect `(,headings ,tmsum) into lst&#xA;             finally return lst))))))&#xA;&#xA;(defun org-dblock-write:nagora-report (params)&#xA; &quot;Fill in a dynamic timesheet reporting block.&quot;&#xA;  (let* ((buffer (plist-get params :buffer))&#xA;     (day (symbol-name (plist-get params :day)))&#xA;     (tstart (if (string-match-p &quot;^[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}$&quot; day)&#xA;             day&#xA;           (error &quot;Error: day format must be in YYYY-mm-dd format&quot;)))&#xA;     (tend (concat day &quot; 23:59&quot;))&#xA;     (table (dfeich/org-clock-hourly-report&#xA;         (dfeich/org-clock-get-tr-for-ivl buffer tstart tend)&#xA;         tstart tend)))&#xA;    (insert (format &quot;#+CAPTION: timesheet for day %s\n&quot; day))&#xA;    (insert &quot;|Time|Customer| Task |Minutes|\n|------\n&quot;)&#xA;    (cl-loop&#xA;     for item in table&#xA;     do (let ((ivl (car item))&#xA;          (entries (cadr item)))&#xA;      (cl-loop for e in entries&#xA;           do (let ((headings (car e))&#xA;                (minutes (cadr e)))&#xA;            (insert (concat&#xA;                 &quot;|&quot;&#xA;                 (format-time-string &quot;%H:%M&quot; (seconds-to-time&#xA;                                  (car ivl)))&#xA;                 &quot;-&quot;&#xA;                 (format-time-string &quot;%H:%M&quot; (seconds-to-time&#xA;                                  (cadr ivl)))&#xA;                 &quot;|&quot; (nth 1 headings)&#xA;                 &quot;|&quot; (car (last headings))&#xA;                 &quot;|&quot; (format &quot;%d&quot; minutes)&#xA;                 &quot;|\n&quot;))))))&#xA;    (insert &quot;|----\n|TOTAL||||\n#+TBLFM: @&amp;gt;$&amp;gt;=vsum(@I..@II)&quot;)&#xA;    (search-backward &quot;Time&quot;)&#xA;    (org-table-align)&#xA;    (org-table-recalculate '(16))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: The solution is inspired by the &lt;code&gt;org-clock-sum&lt;/code&gt; code and analogous to that function I chose not to invoke the full org parsers, but to use a probably more efficient direct parsing, since I'm only interested in headlines and clock lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regexp search function uses an interesting concept copied from &lt;code&gt;org-clock-sum&lt;/code&gt; involving an &quot;or&quot;-ed regexp which either matches a headline or a clock time range. That idea is kind of nice, since it allows one to implement a simple state machine with a single regexp in this way.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="2370" LastEditDate="2016-02-28T17:24:57.780" LastActivityDate="2016-02-28T17:24:57.780" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20641" PostTypeId="2" ParentId="20636" CreationDate="2016-02-28T15:55:14.433" Score="6" Body="&lt;p&gt;This sounds like exactly what the &lt;a href=&quot;https://github.com/justbur/emacs-which-key&quot; rel=&quot;noreferrer&quot;&gt;which-key&lt;/a&gt; package does.  When you type a prefix key, after a short pause, a list of keys in the keymap and the commands they are bound to is shown in a side window.  It's great for things you don't quit do often enough to have memorized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install it with &lt;code&gt;package-install which-key&lt;/code&gt; and activate it with &lt;code&gt;(which-key-mode)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-02-28T15:55:14.433" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20642" PostTypeId="2" ParentId="20636" CreationDate="2016-02-28T16:09:34.680" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Not sure I understand the question, but it sounds like &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Key_Completion&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;key completion&lt;/em&gt;&lt;/a&gt; will help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you have hit a prefix key (e.g. &lt;code&gt;C-x&lt;/code&gt; or &lt;code&gt;C-x 4&lt;/code&gt;), if you hit &lt;code&gt;S-TAB&lt;/code&gt; (by default) all of the bindings on that prefix key are displayed in buffer &lt;code&gt;*Completions*&lt;/code&gt; along with the commands they are bound to.  You can explore them (showing complete descriptions on demand or short descriptions just by cycling among them) -- and hit &lt;code&gt;C-g&lt;/code&gt; if you don't want to invoke any of them.  Or you can complete any of them and invoke it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works also for prefix keys that are on prefix keys, such as &lt;code&gt;C-x 4&lt;/code&gt;, which is in &lt;code&gt;C-x&lt;/code&gt;.  If you hit &lt;code&gt;C-x S-TAB&lt;/code&gt; then one of the candidates you see in &lt;code&gt;*Completions*&lt;/code&gt; is &lt;code&gt;4 = ...&lt;/code&gt;.  The &lt;code&gt;...&lt;/code&gt; here means that &lt;code&gt;4&lt;/code&gt; is itself a prefix key.  If you choose that candidate then &lt;code&gt;*Completions*&lt;/code&gt; is changed to show you the keys (and commands) bound on &lt;code&gt;C-x 4&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also navigate upward in the keymap hierarchy.  The first candidate in &lt;code&gt;*Completions*&lt;/code&gt; for a prefix keymap is &lt;code&gt;..&lt;/code&gt;.  Choosing that candidate moves you back up to the parent keymap.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is another library, &lt;a href=&quot;https://github.com/kai2nenobu/guide-key&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;guide-key&lt;/code&gt;&lt;/a&gt;, which some of what Icicles key completion does, if you are not interested in using Icicles in general.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Without Icicles or guide-key, you can at least use &lt;code&gt;C-h&lt;/code&gt; with vanilla Emacs to get a listing (in &lt;code&gt;*Help*&lt;/code&gt;) of the keys bound on a prefix key.  For example, &lt;code&gt;C-x C-h&lt;/code&gt; shows you the keys bound on prefix key &lt;code&gt;C-x&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-02-28T16:09:34.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20643" PostTypeId="1" CreationDate="2016-02-28T16:58:02.063" Score="3" ViewCount="189" Body="&lt;p&gt;How would one write a function that one could bind to, say, SUPER-f, which inserts the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for () {&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the buffer with my cursor being moved into the () parens for filling out the loop guard?&lt;/p&gt;&#xA;" OwnerUserId="11251" LastActivityDate="2016-03-30T23:41:34.270" Title="Command for inserting for-statement skeleton" Tags="|functions|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20644" PostTypeId="1" CreationDate="2016-02-28T17:36:21.363" Score="3" ViewCount="448" Body="&lt;p&gt;Let's assume I invoke EMACS (24.3.1) always with just one file name to visit.  How do I get the buffer for that file while in my .EMACS startup?  I tried it and the function (current-buffer) will return my &lt;em&gt;scratch&lt;/em&gt; buffer.  &lt;/p&gt;&#xA;" OwnerUserId="11260" LastActivityDate="2016-02-28T21:37:45.197" Title="how to get buffer for file specified on command line?" Tags="|init-file|buffers|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20646" PostTypeId="2" ParentId="20644" CreationDate="2016-02-28T19:36:57.807" Score="1" Body="&lt;p&gt;You can use the variable &lt;code&gt;command-line-args&lt;/code&gt; to get a list of elements making up the command line used to invoke emacs. If your command line consists of just two elements &amp;mdash; &lt;code&gt;&quot;emacs&quot;&lt;/code&gt; and the filename to visit &amp;mdash; you can get the buffer associated with the file visited like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-buffer (file-name-nondirectory (cadr command-line-args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this won't work in your &lt;code&gt;.emacs&lt;/code&gt; startup file because the buffer for the file being visited isn't available yet. Instead, you can add code to your &lt;code&gt;.emacs&lt;/code&gt; file to add something like the above to the &lt;code&gt;emacs-startup-hook&lt;/code&gt;, which is run after command line arguments are handled. For example, this code augments the hook to set a variable named &lt;code&gt;cmd-line-file-buffer&lt;/code&gt; to the buffer of the file being visited:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-startup-hook&#xA;      (lambda ()&#xA;        (if (= 2 (length command-line-args))&#xA;            (setq cmd-line-file-buffer&#xA;                  (get-buffer (file-name-nondirectory (cadr command-line-args)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11241" LastActivityDate="2016-02-28T19:36:57.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20647" PostTypeId="2" ParentId="20644" CreationDate="2016-02-28T19:37:26.537" Score="0" Body="&lt;p&gt;I guess this is because the init file is loaded and run before the file to visit is loaded.  You could use the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks.html#Hooks&quot; rel=&quot;nofollow&quot;&gt;hook&lt;/a&gt; &lt;code&gt;after-load-functions&lt;/code&gt; to run code just after the file to visit is loaded.  For example, put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-load-functions (lambda (f) (setq my-buffer (current-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-02-28T19:37:26.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20648" PostTypeId="2" ParentId="20628" CreationDate="2016-02-28T21:19:36.273" Score="1" Body="&lt;p&gt;I think you're looking for &lt;code&gt;superword-mode&lt;/code&gt;.  From its documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Superword mode is a buffer-local minor mode.  Enabling it remaps&#xA;  word-based editing commands to superword-based commands that&#xA;  treat symbols as words, e.g. &quot;this_is_a_symbol&quot;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The superword oriented commands activated in this minor mode&#xA;  recognize symbols as superwords to move between superwords and to&#xA;  edit them as words.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-02-28T21:19:36.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20649" PostTypeId="1" CreationDate="2016-02-28T21:33:12.760" Score="6" ViewCount="1162" Body="&lt;p&gt;Emacs noob here, I want to use &lt;code&gt;melpa-stable&lt;/code&gt; whenever possible for my packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;use-package&lt;/code&gt; has an option for this, &lt;code&gt;use-package-always-pin&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By default package.el prefers melpa over melpa-stable due to the versioning (&gt; evil-20141208.623 evil-1.0.9), so even if you are tracking only a single package from melpa, you will need to tag all the non-melpa packages with the appropriate archive. If this really annoys you, then you can set use-package-always-pin to set a default.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How am I supposed to set this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation for the variable is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;use-package-always-pin is a variable defined in `use-package.el'.&#xA;Its value is nil&#xA;&#xA;Documentation:&#xA;Treat every package as though it had specified `:pin SYM.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since you would &lt;code&gt;:pin&lt;/code&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package smooth-scrolling&#xA;  :pin melpa-stable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would assume that it would one of these&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq use-package-always-pin melpa-stable)&#xA;(setq use-package-always-pin 'melpa-stable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but either one (tried separately) gets me the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's value as variable is void: melpa-stable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I start emacs and then eval &lt;code&gt;(setq use-package-always-pin 'melpa-stable)&lt;/code&gt; it seems to work as expected. I would guess it was some kind of load order issue, but I'm pretty clueless about how that works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'use-package&#xA;  (setq use-package-always-pin 'melpa-stable))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No luck.&lt;/p&gt;&#xA;" OwnerUserId="11188" LastEditorUserId="105" LastEditDate="2016-02-28T21:54:59.687" LastActivityDate="2018-06-20T14:51:48.073" Title="How do I set use-package-always-pin?" Tags="|package|package-repositories|use-package|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20650" PostTypeId="2" ParentId="20644" CreationDate="2016-02-28T21:37:45.197" Score="1" Body="&lt;p&gt;There are two issues to solve: the &lt;code&gt;.emacs&lt;/code&gt; file is loaded too early, and there are multiple buffers in a running instance of Emacs, even just after startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first issue is solved by putting your code in &lt;code&gt;emacs-startup-hook&lt;/code&gt;, as pointed out in the other answers.  The second issue is solved by ignoring any buffers that don't have any associated files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-file-buffers ()&#xA;  (remove nil&#xA;          (mapcar #'(lambda (buffer) (and (buffer-file-name buffer) buffer))&#xA;                  (buffer-list))))&#xA;&#xA;(add-hook 'emacs-startup-hook&#xA;          #'(lambda ()&#xA;              (message &quot;The following buffers are interesting today: %s&quot;&#xA;                       (my-file-buffers))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-02-28T21:37:45.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20651" PostTypeId="1" AcceptedAnswerId="20655" CreationDate="2016-02-29T02:50:22.573" Score="8" ViewCount="666" Body="&lt;p&gt;When I am viewing my &lt;code&gt;org-agenda&lt;/code&gt;, whatever line I have the mouse point on is highlighted. Since I never act on these lines with the mouse, and since the line where point is is also highlighted, the extra highlighting is distracting and confusing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I disable highlighting the line under the mouse tip in &lt;code&gt;org-agenda&lt;/code&gt; views?&lt;/strong&gt; I am sure it is an easy fix, but I can't figure out the name of the relevant variable to customize. Thank you! &lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2023-05-29T19:23:51.867" Title="Turn off mouse highlighting in org-agenda" Tags="|org-agenda|mouse|highlighting|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20652" PostTypeId="1" AcceptedAnswerId="20683" CreationDate="2016-02-29T06:25:23.933" Score="1" ViewCount="415" Body="&lt;p&gt;Using org-babel source blocks, I can name a block and call it later. When I evaluate the block itself, I get a bare value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: demo&#xA;#+BEGIN_SRC python&#xA;return 5&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: demo&#xA;: 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I &lt;code&gt;call&lt;/code&gt; the block, the result is always in quotes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+call: demo()&#xA;&#xA;#+RESULTS:&#xA;: &quot;5&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How on &lt;em&gt;earth&lt;/em&gt; do you change this behavior? I've messed with &lt;code&gt;org-babel-inline-results-wrap&lt;/code&gt;, to no avail. &lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-03-01T21:08:30.510" Title="Org-babel's `call` functionality wraps all results in quotes" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20654" PostTypeId="2" ParentId="20633" CreationDate="2016-02-29T09:12:12.600" Score="0" Body="&lt;p&gt;From org mode &lt;a href=&quot;http://orgmode.org/manual/Emphasis-and-monospace.html#Emphasis-and-monospace&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can make words &lt;em&gt;bold&lt;/em&gt;, /italic/, &lt;em&gt;underlined&lt;/em&gt;, ‘=verbatim=’ and&#xA;  ‘~code~’, and, if you must, ‘+strike-through+’.  Text in the code and&#xA;  verbatim string is not processed for Org mode specific syntax, it is&#xA;  exported verbatim.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed &lt;code&gt;~&amp;gt; (cons 1 nil) \to (1)~&lt;/code&gt; is exported as LaTeX &lt;code&gt;\texttt{&amp;gt; (cons 1 nil) \textbackslash{}to (1)}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this does suggest a workaround for LaTeX: use an export &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html#Advanced-configuration&quot; rel=&quot;nofollow&quot;&gt;filter&lt;/a&gt; to undo the conversion of &lt;code&gt;\&lt;/code&gt; to &lt;code&gt;\textbackslash{}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-latex-filter-allow-latex-in-code (text backend info)&#xA;  &quot;Undo backslash escaping&quot;&#xA;  (when (org-export-derived-backend-p backend 'latex)&#xA;    (replace-regexp-in-string &quot;textbackslash{}&quot; &quot;&quot; text)))&#xA;&#xA;(add-to-list 'org-export-filter-code-functions&#xA;         #'my-latex-filter-allow-latex-in-code)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The export filter can be extended for handling html as well.  Here's a first draft handling only &lt;code&gt;\to&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-filter-allow-latex-in-code (text backend info)&#xA;  &quot;Allow LaTeX symbols in code&quot;&#xA;  (cond &#xA;   ((org-export-derived-backend-p backend 'latex)&#xA;    (replace-regexp-in-string &quot;textbackslash{}&quot; &quot;&quot; text))&#xA;   ((org-export-derived-backend-p backend 'html)&#xA;    ;; either extend this or find the html export function doing these conversions&#xA;    (replace-regexp-in-string &quot;\\\\to&quot; &quot;&amp;amp;rarr;&quot; text))))&#xA;&#xA;(add-to-list 'org-export-filter-code-functions&#xA;         #'my-filter-allow-latex-in-code)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-02-29T09:12:12.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20655" PostTypeId="2" ParentId="20651" CreationDate="2016-02-29T10:14:28.783" Score="6" Body="&lt;p&gt;I removed the mouse face as a whole in the agenda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-agenda-finalize-hook&#xA;      (lambda () (remove-text-properties&#xA;         (point-min) (point-max) '(mouse-face t)))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-02-29T10:14:28.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20656" PostTypeId="1" AcceptedAnswerId="20657" CreationDate="2016-02-29T10:25:10.103" Score="2" ViewCount="105" Body="&lt;p&gt;I often want to copy some text out of a Magit-buffer - part of a commit message, part of a diff, whatever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annoyingly &lt;kbd&gt;M-w&lt;/kbd&gt; in a Magit buffer inserts a sha1 into the kill ring (&lt;code&gt;magit-copy-buffer-revision&lt;/code&gt;), instead of the text between mark and point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is driving me insane.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there are configuration option or something to avoid this behaviour?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not using active regions (&lt;code&gt;transient-mark-mode&lt;/code&gt;), which seems to be what Magit was designed with in mind.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="306" LastEditDate="2016-08-31T10:53:38.630" LastActivityDate="2016-08-31T10:53:38.630" Title="Avoid hijacking of `M-w` in Magit buffers" Tags="|key-bindings|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20657" PostTypeId="2" ParentId="20656" CreationDate="2016-02-29T10:27:32.900" Score="1" Body="&lt;p&gt;After loading magit in my ~/.emacs/init.el, I have added this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key magit-mode-map (kbd &quot;M-w&quot;) 'kill-ring-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I regained a sanity point.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-02-29T10:27:32.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20658" PostTypeId="2" ParentId="20461" CreationDate="2016-02-29T14:57:45.330" Score="9" Body="&lt;p&gt;The string behind &lt;code&gt;::&lt;/code&gt; is actually a &lt;em&gt;search&lt;/em&gt;. In this context one understands the relevant comment in the source code of the function &lt;code&gt;org-html-link&lt;/code&gt; in the library file &lt;code&gt;ox-html.el&lt;/code&gt; (org 8.2.5).&#xA;It says:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  ;; Add search option, if any.  A search option can be&#xA;  ;; relative to a custom-id or a headline title.  Any other&#xA;  ;; option is ignored.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, you can either replace &lt;code&gt;my_anchor&lt;/code&gt; by &lt;code&gt;#my_anchor&lt;/code&gt; to form a custom-id or use a headline title starting with the character &lt;code&gt;*&lt;/code&gt;.&#xA;In the second case don't include spaces after the &lt;code&gt;*&lt;/code&gt;-character!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linking &lt;strong&gt;section headers&lt;/strong&gt; in other files &lt;strong&gt;only works when you publish org-mode projects&lt;/strong&gt;. Org-mode projects are defined as members of the variable &lt;code&gt;org-publish-project-alist&lt;/code&gt;. See the documentation of this variable and Section &lt;em&gt;13 Publishing&lt;/em&gt; of the org-mode manual for the details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;file &lt;code&gt;a.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* This is file a.org&#xA;  Some important notes.&#xA;&#xA;* Second Section&#xA;&#xA;* Section with a custom-id&#xA;&#xA;  Some text before the custom-id&#xA;&#xA;  &amp;lt;&amp;lt;#my-anchor&amp;gt;&amp;gt; Here we have the custom-id&#xA;&#xA;  Some text behind the custom-id.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Text in file &lt;code&gt;b.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* This is file b.org&#xA;  Some text.&#xA;&#xA;* b.org contains the link to my_anchor&#xA;  [[file:a.org::#my_anchor][My Link to the custom-id]]&#xA;&#xA;  [[file:a.org::*Second Section][My Link to the headline of the second section]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remark:&#xA;The reason that links to headers in other files only work with publishing is that they are fetched from &lt;code&gt;org-publish-cache&lt;/code&gt; in &lt;code&gt;org-publish-resolve-external-fuzzy-link&lt;/code&gt; which is used in &lt;code&gt;org-html-link&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Section header links are actually numbered links, such as &lt;code&gt;sec-1&lt;/code&gt;, &lt;code&gt;sec-2&lt;/code&gt; and the section headers are translated to the numbers 1,2,... via an association list in the variable &lt;code&gt;org-publish-cache&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I consider this a documentation bug.&lt;/strong&gt; The html-export of links of section headers in other files is not mentioned in Section &lt;em&gt;13.1.6 Links between published files&lt;/em&gt; of the org-mode manual. I can also not find any remark of the html-export of links to custom-id's across files in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've just discovered these things through reading the source code.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is what I got as an answer to my bug-report:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Thank you for the report.&#xA;&#xA;Unfortunately, this feature is very experimental, and actually quite&#xA;buggy. It's not ready for prime time, and therefore not documented.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="8431" LastEditDate="2016-04-28T14:28:19.530" LastActivityDate="2016-04-28T14:28:19.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20660" PostTypeId="1" CreationDate="2016-02-29T18:13:43.373" Score="2" ViewCount="371" Body="&lt;p&gt;I would like to be able to mark the current block scope. In other words, given some piece of code like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;if (1) {&#xA;  ...&#xA;}&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If my cursors was sitting somewhere inside the if-body, it would mark that area of code. I guess a quick and dirty solution would be to just have a script scan for the previous curly brace and select everything between it and its match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there's no existing command for this, would someone know how to implement it?&lt;/p&gt;&#xA;" OwnerUserId="11271" LastActivityDate="2016-02-29T22:18:20.523" Title="Selecting inner-most scope in C/C++" Tags="|mark|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20661" PostTypeId="1" CreationDate="2016-02-29T18:45:27.140" Score="3" ViewCount="1006" Body="&lt;p&gt;If I start GUI emacs in OSX (not from the terminal) it does not know about my user environment variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;exec-path-from-shell&lt;/code&gt; &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;package mostly solves this&lt;/a&gt;, but while you can explicitly initialize specific environment variables, I can't see a way to initialize &lt;em&gt;all&lt;/em&gt; environment variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use environment variables to supply secrets to my applications, so I tend to have a lot of them and would prefer not to have to add and remove them from my &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11188" LastEditorUserId="11188" LastEditDate="2016-02-29T18:50:48.860" LastActivityDate="2016-05-01T10:38:11.173" Title="How can I initialize all environment variables in OSX?" Tags="|osx|gui-emacs|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20662" PostTypeId="2" ParentId="20660" CreationDate="2016-02-29T18:49:11.973" Score="1" Body="&lt;p&gt;Does either &lt;code&gt;M-x mark-defun&lt;/code&gt; or &lt;code&gt;c-mark-function&lt;/code&gt; (&lt;code&gt;C-M-h&lt;/code&gt; in my setup) do what you want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;expand-region&lt;/code&gt;&lt;/a&gt; is another very good option (a video demo can be found &lt;a href=&quot;http://emacsrocks.com/e09.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). With that   package installed (it is available through MELPA) you can use the command &lt;code&gt;er/expand-region&lt;/code&gt; to expand the selected region by semantic units. It may not select the area you want on the first invocation, but repeated invocations will definitely get you what you want. That package is amazing, and will work intelligently with many different modes (i.e., what is considered a &quot;semantic unit&quot; will differ from mode to mode).   &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-02-29T19:12:36.303" LastActivityDate="2016-02-29T19:12:36.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20663" PostTypeId="2" ParentId="20629" CreationDate="2016-02-29T19:59:34.193" Score="1" Body="&lt;p&gt;I recommend using &lt;code&gt;smartparens&lt;/code&gt;. For non-lisp languages it has the useful notion of &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Hybrid-S-expressions&quot; rel=&quot;nofollow&quot;&gt;&quot;hybrid s-expression&quot;&lt;/a&gt;. Its command &lt;code&gt;sp-transpose-hybrid-sexp&lt;/code&gt; doesn't quite work directly on your example, but if you are willing to wrap those two string in parenthesis it does work (also, Emacs seems to indent much better with the added parenthesis). If you run it on the following text with the point any where in &lt;code&gt;string s =&lt;/code&gt; it will correctly swap the two declarations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int x;&#xA;string s = (&quot;some very long &quot;&#xA;            &quot; string&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2016-02-29T20:11:49.837" LastActivityDate="2016-02-29T20:11:49.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20664" PostTypeId="2" ParentId="20488" CreationDate="2016-02-29T20:12:47.857" Score="5" Body="&lt;p&gt;They key is to add a &lt;code&gt;:results raw&lt;/code&gt; header argument (&lt;a href=&quot;http://orgmode.org/manual/results.html&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;) to the &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; line to prevent org-mode from wrapping the results in &lt;code&gt;#+BEGIN_LaTeX&lt;/code&gt;/&lt;code&gt;#+END_LaTeX&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src latex :file fsa.pdf :packages '((&quot;&quot; &quot;tikz&quot;)) :border 1em :results raw&#xA;  % Define block styles&#xA;  \usetikzlibrary{shapes,arrows}&#xA;  \tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize, fill=blue!25]&#xA;  \tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize, fill=red!25]&#xA;&#xA;  \begin{tikzpicture}[-&amp;gt;,&amp;gt;=stealth', shorten &amp;gt;=1pt, auto, node distance=2.8cm, semithick]&#xA;    \node [astate] (1) at (0,0) {1};&#xA;    \node [astate] (2) at (1,0) {2};&#xA;    \node [rstate] (3) at (2,0) {3};&#xA;    \path (1) edge [bend left] node {b} (2)&#xA;          (2) edge node {b} (3)&#xA;          (2) edge [bend left] node {a} (1)&#xA;          (3) edge [loop above] node {(a, b)} (3);&#xA;  \end{tikzpicture}&#xA;#+end_src&#xA;#+CAPTION: tikz caption&#xA;#+LABEL: fig:tikz&#xA;#+RESULTS:&#xA;[[file:fsa.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6898" LastActivityDate="2016-02-29T20:12:47.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20665" PostTypeId="2" ParentId="20661" CreationDate="2016-02-29T20:17:03.230" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I can't see a way to initialize all environment variables.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((bim (shell-command-to-string &quot;. ~/.bashrc; echo -n $BIM&quot;)))&#xA;  (setenv &quot;BIM&quot; bim))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Something like this should do the trick. You'll probably want to add a loop.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2016-02-29T20:17:03.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20666" PostTypeId="1" AcceptedAnswerId="20670" CreationDate="2016-02-29T21:28:32.327" Score="4" ViewCount="400" Body="&lt;p&gt;I am writing an emacs mode that interfaces with a shell process. The shell process is expensive to start which means that I would like to do it once and then send commands to it from emacs as need be. How is it possible to do this asyncronous two way communication with an external program through emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I understand comint mode is close to what I need but it seems like that is only to be used for a major mode where the user supplies the input like interfacing with the python shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like the actual process and shell to be hidden from the end user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a reasonably easy way to do this? Or some resources on the subject&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="105" LastEditDate="2016-03-13T21:56:20.997" LastActivityDate="2016-03-13T21:56:20.997" Title="How does one create back and forth communication to a process" Tags="|process|subprocess|async|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20667" PostTypeId="2" ParentId="20660" CreationDate="2016-02-29T22:18:20.523" Score="1" Body="&lt;p&gt;The way I'd do it is: &lt;kbd&gt;M-C-u&lt;/kbd&gt; &lt;kbd&gt;M-C-SPC&lt;/kbd&gt;: the first moves &lt;code&gt;up-list&lt;/code&gt; and the second selects the next sexp.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-02-29T22:18:20.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20668" PostTypeId="2" ParentId="20636" CreationDate="2016-02-29T22:33:02.387" Score="2" Body="&lt;p&gt;There is an underused built-in functionality with a similar aim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see it in action by doing: &lt;code&gt;M-x smerg-mode RET&lt;/code&gt; and then &lt;kbd&gt;C-c ^ =&lt;/kbd&gt; which should immediately show you the possible options in that prefix keymap, along the lines of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Diff: = = mine-other, &amp;gt; = base-other, &amp;lt; = base-mine&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Being underused it's also rather primitive (the confusion between the &lt;kbd&gt;=&lt;/kbd&gt; key and the &lt;code&gt;=&lt;/code&gt; sign is rather annoying in the above example).  To get this, the main part of the code was (transliterated from the use of &lt;code&gt;easy-mmode-defmap&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key map [?=] (make-sparse-keymap &quot;Diff&quot;)&#xA;(define-key map [?= ?&amp;lt;] '(&quot;base-mine&quot; . smerge-diff-base-mine))&#xA;(define-key map [?= ?&amp;gt;] '(&quot;base-other&quot; . smerge-diff-base-other))&#xA;(define-key map [?= ?=] '(&quot;mine-other&quot; . smerge-diff-mine-other))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-02-29T22:33:02.387" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20669" PostTypeId="2" ParentId="20643" CreationDate="2016-02-29T22:42:12.263" Score="3" Body="&lt;p&gt;I think I'd do it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton my-for-statement&#xA;  &quot;Insert a for () {...} skeleton.&quot;&#xA;  nil&#xA;  \n &quot;for () {&quot; \n &amp;gt; _ &quot;}&quot; \n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;\n&lt;/code&gt; are for &quot;newlines&quot; (and the ones at beg/end are only added if needed).  The &lt;code&gt;_&lt;/code&gt; basically says that if you have selected a region before running the command, then this region will end up right where &lt;code&gt;_&lt;/code&gt; is (IOW, the region will be wrapped by the &quot;for&quot; statement).  And the &lt;code&gt;&amp;gt;&lt;/code&gt; in front causes this region (if any) to be re-indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then do &lt;code&gt;M-x my-for-statement&lt;/code&gt; and that will insert the statement.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-02-29T22:42:12.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20670" PostTypeId="2" ParentId="20666" CreationDate="2016-02-29T22:56:19.243" Score="4" Body="&lt;p&gt;The functionality used by comint mode is &lt;code&gt;start-process&lt;/code&gt;, so I think you might like to start with that.  You send data to the process with &lt;code&gt;process-send-string&lt;/code&gt;, and the process's output is &quot;automatically&quot; read by Emacs and passed to the process filter, which is a function you provide via &lt;code&gt;set-process-filter&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main difficulty is that you don't get to choose the size of the chunks you receive from the process, so your process filter function will usually want to process only part of what it received and keep the rest for later (e.g. so as to process the output one line at a time).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-02-29T22:56:19.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20671" PostTypeId="2" ParentId="20661" CreationDate="2016-03-01T00:12:35.650" Score="1" Body="&lt;p&gt;Here's what I could come up with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun source-file-and-get-envs (filename)&#xA;  (let* ((cmd (concat &quot;. &quot; filename &quot;; env&quot;))&#xA;         (env-str (shell-command-to-string cmd))&#xA;         (env-lines (split-string env-str &quot;\n&quot;))&#xA;         (envs (mapcar (lambda (s) (replace-regexp-in-string &quot;=.*$&quot; &quot;&quot; s)) env-lines)))&#xA;    (delete &quot;&quot; envs)))&#xA;&#xA;(exec-path-from-shell-copy-envs (source-file-and-get-envs &quot;~/.profile&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It sources the given file, then gets just the environment variable names from &lt;code&gt;env&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11188" LastEditorUserId="11188" LastEditDate="2016-03-02T09:08:08.227" LastActivityDate="2016-03-02T09:08:08.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20672" PostTypeId="1" AcceptedAnswerId="20699" CreationDate="2016-03-01T04:30:24.833" Score="2" ViewCount="101" Body="&lt;p&gt;I use double brackets heavily for links. Is there anyway to config smart autocompletion such that pressing brackets twice I get [[] instead of [[]], and once the prompt is at left of ] in [[], pressing ] again close the link, that is, produces the final [[]]?&lt;/p&gt;&#xA;" OwnerUserId="4052" LastActivityDate="2016-03-02T18:44:35.330" Title="How to cofigure smart double brackets for links?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20673" PostTypeId="1" CreationDate="2016-03-01T10:10:35.150" Score="1" ViewCount="39" Body="&lt;p&gt;I sometimes leave large blocks of comments in LaTeX source code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Text text text text.&#xA;&#xA;% Comments comments comments comments.&#xA;% Six lines of comments.&#xA;% More comments.&#xA;&#xA;% Separate comment block.&#xA;% Eight lines of comments.&#xA;% More comments.&#xA;&#xA;More text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Navigating within these comment blocks can be difficult, because emacs&#xA;acts as though they were not there at all; &lt;kbd&gt;C-up&lt;/kbd&gt;&#xA;(&lt;code&gt;backward-paragraph&lt;/code&gt;) and &lt;kbd&gt;C-down&lt;/kbd&gt; (&lt;code&gt;forward-paragraph&lt;/code&gt;) skip&#xA;past any number of comments and blank lines, and the cursor ends up past&#xA;the next block of text lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like emacs to treat such comment blocks exactly as it treats&#xA;normal text, so that C-up and C-down will stop on blank lines between&#xA;comment lines and regular text, or between comment lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at &lt;code&gt;tex-mode.el&lt;/code&gt;. There's a macro named &lt;code&gt;tex-search-noncomment&lt;/code&gt;&#xA;that seems related to this, but I'm not sure what to do about it. My&#xA;elisp-fu is very weak.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 23.4.1.&lt;/p&gt;&#xA;" OwnerUserId="2067" LastActivityDate="2016-03-01T10:10:35.150" Title="Navigation ignores comment blocks in (La)TeX mode" Tags="|latex|comment|navigation|tex-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20674" PostTypeId="1" AcceptedAnswerId="20888" CreationDate="2016-03-01T11:56:16.970" Score="6" ViewCount="2087" Body="&lt;p&gt;I'm running Emacs under PuTTY and this works better then I expected.&#xA;But since I sometimes use the mouse to focus the PuTTY window, I turned xterm-mouse-mode on. This way the focus in the text changes to where I click.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I can't past text into putty anymore.&#xA;Normally this is done by a right click and then putty sends the copied text.&#xA;But now Emacs receives a &lt;code&gt;mouse-3&lt;/code&gt; event first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to map &lt;code&gt;mouse-3&lt;/code&gt; to something so that the text after the mouse event is pasted to Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my current config: &lt;a href=&quot;https://github.com/r03/dotfiles/blob/master/.emacs.d/init.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/r03/dotfiles/blob/master/.emacs.d/init.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11278" LastEditorUserId="25" LastEditDate="2016-03-10T12:51:08.760" LastActivityDate="2016-03-10T12:51:08.760" Title="Emacs in PuTTY with xterm-mouse-mode: how to paste?" Tags="|terminal-emacs|mouse|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20675" PostTypeId="1" AcceptedAnswerId="20676" CreationDate="2016-03-01T15:00:43.780" Score="7" ViewCount="558" Body="&lt;p&gt;I'm trying to find out if there is way to schedule a mail for later delivery in Gnus. I am not trying to just queue a mail to be sent whenever a connection becomes available, but I am looking for a feature to define a date at which a mail is to be sent.&lt;/p&gt;&#xA;" OwnerUserId="11281" LastActivityDate="2016-03-01T16:30:24.820" Title="send mail later in Gnus" Tags="|gnus|email|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20676" PostTypeId="2" ParentId="20675" CreationDate="2016-03-01T16:30:24.820" Score="10" Body="&lt;p&gt;There is, you need to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Activate delayed messages:&#xA;(gnus-delay-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this is also handy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Remove date, so delayed messages (C-c C-j) don't get a date until&#xA;; sent &amp;lt;mailman.1180.1266014215.14305.info-gnus-english@gnu.org&amp;gt;:&#xA;(setq message-draft-headers '(References From))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;automated sending is activated by this (otherwise it will be sent the first time you fetch new email after time is up, I think):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Demon to send queued email every other minute:&#xA;(gnus-demon-add-handler 'gnus-delay-send-queue 1 nil)&#xA;(gnus-demon-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use it, write your email, and instead of pressing &lt;code&gt;C-c C-c&lt;/code&gt; to send it, you press &lt;code&gt;C-c C-j&lt;/code&gt; and are prompted for when you want the email sent (time, date, or delay).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The email will show up in a special group called &lt;code&gt;nndraft:delayed&lt;/code&gt; where you can delete or edit it if you change your mind.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-03-01T16:30:24.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20677" PostTypeId="1" CreationDate="2016-03-01T16:31:42.177" Score="7" ViewCount="422" Body="&lt;p&gt;I have a kinesis keyboard and would like to have the home key act as super in emacs without requiring me to remap my keyboard as well as edit my key bindings. Is there a simple way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="11282" LastEditorUserId="105" LastEditDate="2016-03-01T18:50:47.197" LastActivityDate="2016-03-04T00:36:44.620" Title="Set the home key to act as super?" Tags="|key-bindings|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20678" PostTypeId="1" AcceptedAnswerId="20709" CreationDate="2016-03-01T18:17:59.933" Score="11" ViewCount="1615" Body="&lt;p&gt;I am working on several projects right now. I want &lt;em&gt;a single&lt;/em&gt; instance of Emacs to handle them all. What I want is a tmux-like behavior wherein every 'window' (in the Emacs sense) corresponds to a projects which contains buffers of the files related to that project. There are several windows, with each corresponding to a project and I should be able to switch between them (something similar to &lt;code&gt;C-b w&lt;/code&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this functionality already present in some form? I guess it'll be cool to have as the other options are either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Have several instances of Emacs open.&lt;/li&gt;&#xA;&lt;li&gt;Have all files of all projects in a single instance which makes switching buffers a pain.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11284" LastEditorUserId="25" LastEditDate="2016-03-02T18:54:48.127" LastActivityDate="2016-03-09T00:42:46.627" Title="One window per project" Tags="|window|session|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20679" PostTypeId="1" AcceptedAnswerId="37476" CreationDate="2016-03-01T18:29:20.840" Score="2" ViewCount="642" Body="&lt;p&gt;How can I enable greek language spellchecking in Emacs to be the default spellchecking language, and how can change spellchecking between greek and english language?  (My system is Ubuntu 14.04 64bit).&lt;/p&gt;&#xA;" OwnerUserId="10809" LastActivityDate="2017-12-13T12:17:05.373" Title="Enable greek spellchecking" Tags="|spell-checking|ubuntu|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20680" PostTypeId="2" ParentId="20678" CreationDate="2016-03-01T18:32:39.743" Score="5" Body="&lt;p&gt;You can try &lt;a href=&quot;https://github.com/wasamasa/eyebrowse&quot;&gt;eyebrowse&lt;/a&gt; mode, which manages multiple (perhaps complicated) window layouts. You can switch between window configurations with keystrokes such as &lt;code&gt;C-c C-w 1&lt;/code&gt; and &lt;code&gt;C-c C-w 2&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2016-03-01T18:32:39.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20681" PostTypeId="1" CreationDate="2016-03-01T18:37:21.437" Score="3" ViewCount="166" Body="&lt;p&gt;I want to run &lt;code&gt;compile&lt;/code&gt; or &lt;code&gt;recompile&lt;/code&gt;, but I don't want to see the &lt;code&gt;*compilation*&lt;/code&gt; buffer pop up unless there's an error, or not at all. If the compilation succeeds, I should just see a notification in the echo area. This is how AUCTeX works; I want it for arbitrary compilation commands in arbitrary modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a small wheel to be sure, but I can't find it built in (as of Emacs 24.3). Before I go on about reinventing it, does this already exist somewhere?&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-01T18:37:21.437" Title="Compile quietly unless there are errors" Tags="|window|compilation|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20682" PostTypeId="2" ParentId="20629" CreationDate="2016-03-01T18:54:00.193" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/anchored-transpose.el&quot; rel=&quot;nofollow&quot;&gt;anchored-transpose&lt;/a&gt; may be another option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bind &lt;code&gt;anchored-transpose&lt;/code&gt; to &lt;code&gt;C-x t&lt;/code&gt;, then you can mark the first statement, press &lt;code&gt;C-x t&lt;/code&gt;, mark the second statement, press &lt;code&gt;C-x t&lt;/code&gt;, and these two statements are swapped. It seems &lt;strong&gt;NOT&lt;/strong&gt; very convenient at the first sight, so it's better if you use it with other packages which can quickly mark the statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I've just realized that &lt;code&gt;anchored-transpose&lt;/code&gt; may not be a good solution to this special case. If you quickly mark the region, you can just do a &lt;code&gt;C-w&lt;/code&gt; to kill the region then paste it. &lt;code&gt;anchored-transpose&lt;/code&gt; should fit some more general cases where there are no something like &lt;code&gt;sexp&lt;/code&gt; or &lt;code&gt;statement&lt;/code&gt;, just random texts.&lt;/p&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="5482" LastEditDate="2016-03-01T19:00:09.333" LastActivityDate="2016-03-01T19:00:09.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20683" PostTypeId="2" ParentId="20652" CreationDate="2016-03-01T21:08:30.510" Score="1" Body="&lt;p&gt;This turns out to be a side effect of &lt;code&gt;:results verbatim&lt;/code&gt; &lt;em&gt;specifically&lt;/em&gt; on &lt;code&gt;call&lt;/code&gt; blocks. Vis:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: demo&#xA;#+BEGIN_SRC python :results verbatim&#xA;return 5&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: demo&#xA;: 5&#xA;&#xA;#+call: demo() :results value&#xA;&#xA;#+RESULTS:&#xA;: 5&#xA;&#xA;#+call: demo() :results verbatim&#xA;&#xA;#+RESULTS:&#xA;: &quot;5&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Frankly, I've no idea why this is the case, but at least it's here in case anyone else runs in to it. (I use &lt;code&gt;:results verbatim&lt;/code&gt; very commonly on src blocks, so.)&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-03-01T21:08:30.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20684" PostTypeId="2" ParentId="635" CreationDate="2016-03-01T22:23:24.667" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Sometimes you need to actually close buffers that are in the modes who have had their configuration changed&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Calling &lt;code&gt;normal-mode&lt;/code&gt; is a useful way to re-trigger all the modes for a given buffer, if you've made changes to those or their associated hooks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;revert-buffer&lt;/code&gt; (which calls &lt;code&gt;normal-mode&lt;/code&gt;), which is sort of like reloading the file without discarding the undo history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can also reload a file with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-v&lt;/kbd&gt;, but that &lt;em&gt;will&lt;/em&gt; discard your undo history.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;ibuffer&lt;/code&gt; typing upper-case &lt;kbd&gt;V&lt;/kbd&gt; reverts all marked buffers, while upper-case &lt;kbd&gt;E&lt;/kbd&gt; and &lt;kbd&gt;W&lt;/kbd&gt; enable you to evaluate arbitrary elisp for all marked buffers.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-03-01T22:28:34.323" LastActivityDate="2016-03-01T22:28:34.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20687" PostTypeId="1" CreationDate="2016-03-02T06:40:01.150" Score="4" ViewCount="203" Body="&lt;p&gt;I have 2 files&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/user/myproject/myfile.el&#xA;/ssh:user@myserver.org:/home/user/myproject/myfile.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Content of both of them are same.  I want to make same change in both of them.  I can do it like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. Edit file in local machine.&#xA;2. Push the file to server.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, I'd like to connect both files to same buffer.&lt;/p&gt;&#xA;" OwnerUserId="11289" LastEditorUserId="25" LastEditDate="2016-03-10T12:44:21.443" LastActivityDate="2016-03-10T12:44:21.443" Title="Save a buffer to multiple files" Tags="|buffers|files|tramp|saving|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20690" PostTypeId="1" CreationDate="2016-03-02T10:47:39.143" Score="0" ViewCount="594" Body="&lt;p&gt;Following &lt;a href=&quot;https://stackoverflow.com/questions/127591/using-caps-lock-as-esc-in-mac-os-x&quot;&gt;https://stackoverflow.com/questions/127591/using-caps-lock-as-esc-in-mac-os-x&lt;/a&gt; I remapped &lt;strong&gt;caps lock&lt;/strong&gt; (51) to &lt;strong&gt;esc&lt;/strong&gt; (53).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it was actually esc + :&lt;br&gt;&#xA;(: is shift-; on qwerty but shift-p on colemak)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As a vim user,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I always hit &lt;strong&gt;caps lock&lt;/strong&gt; to exit insert or append mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Save was &lt;strong&gt;caps lock w return&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I would like  to send &lt;strong&gt;fd&lt;/strong&gt; to exit from append or insert mode in evil-spacemacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you tell me what to stick in .spacemacs user-config or in a private layer.el to make this happen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;linked question - &lt;a href=&quot;https://emacs.stackexchange.com/questions/12287/re-creating-vimrc-key-mappings-in-emacs?rq=1&quot;&gt;Recreating .vimrc in spacemacs&lt;/a&gt; more &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.vim-emulation/2000.&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vim Emulation&lt;/a&gt;&#xA;Why isn't there a nice webpage explaining how to rebind evil for all the vim to spacemacs migratory birds?&lt;/p&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-03-04T08:58:49.580" Title="colemak user :: spacemacs &lt;caps lock&gt; key-chord f d [hit f then d really fast]" Tags="|key-bindings|evil|spacemacs|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20691" PostTypeId="1" AcceptedAnswerId="22182" CreationDate="2016-03-02T13:21:45.927" Score="2" ViewCount="98" Body="&lt;p&gt;I'm new to Emacs.  How do I customize a setting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is actually a generic question inspired by the &lt;code&gt;org-mode&lt;/code&gt; manual:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Pmu4x.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Pmu4x.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this description, it says to &lt;code&gt;(setq org-clock-persist 'history)&lt;/code&gt;.  Where should I set this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a new user to Emacs, and I'm starting with &lt;code&gt;org-mode&lt;/code&gt;. If I need to set this in the &lt;code&gt;.emacs&lt;/code&gt; file, I do not know how to locate it and do it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step by step guidance would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="253" LastEditDate="2016-03-02T14:09:57.813" LastActivityDate="2016-05-10T17:19:37.920" Title="Customize a setting?" Tags="|org-mode|init-file|customize|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20692" PostTypeId="2" ParentId="9767" CreationDate="2016-03-02T14:23:52.673" Score="1" Body="&lt;p&gt;org-ref (&lt;a href=&quot;https://github.com/jkitchin/org-ref&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jkitchin/org-ref&lt;/a&gt;) handles this nicely in org-mode, and it recognizes \label, #+label, label: #+tblname, and more that can be used as a ref in LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-ref uses helm and helm-bibtex as completion tools by default, but it is possible to use reftex too.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-03-02T14:23:52.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20693" PostTypeId="2" ParentId="20687" CreationDate="2016-03-02T14:36:03.867" Score="1" Body="&lt;p&gt;You can try using Magnar's &lt;a href=&quot;https://github.com/magnars/multifiles.el&quot; rel=&quot;nofollow&quot;&gt;multifiles.el&lt;/a&gt;. You will find it on &lt;a href=&quot;http://melpa.org/#/multifiles&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like the README says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Bind a key to &lt;code&gt;mf/mirror-region-in-multifile&lt;/code&gt;, let's say &lt;code&gt;C-!&lt;/code&gt;. Now mark a&#xA;  part of the buffer and press it. A new &lt;em&gt;multifile&lt;/em&gt; buffer pops up.&#xA;  Mark some other part of another file, and press &lt;code&gt;C-!&lt;/code&gt; again. This is&#xA;  added to the &lt;em&gt;multifile&lt;/em&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can now edit the &lt;em&gt;multifile&lt;/em&gt; buffer, and watch the original files&#xA;  change. Or you can edit the original files and watch the &lt;em&gt;multifile&lt;/em&gt;&#xA;  buffer change.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Saving the &lt;em&gt;multifile&lt;/em&gt; buffer will save all the original files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2016-03-02T14:41:21.680" LastActivityDate="2016-03-02T14:41:21.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20694" PostTypeId="1" AcceptedAnswerId="20710" CreationDate="2016-03-02T15:28:08.980" Score="12" ViewCount="1393" Body="&lt;p&gt;I would like to generate tables that have headers from code blocks. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value table :table-header | First | Second |&#xA;  (identity '((a b) (c d)))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| First | Second |&#xA;|-------+--------|&#xA;| a     | b      |&#xA;| c     | d      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately something like &lt;code&gt;:table-header | First | Second |&lt;/code&gt; does not exist.  Or rather I am hoping that I am overlooking something. (Here I am using &lt;code&gt;(identity ...)&lt;/code&gt; as a placeholder for code which actually calculates a value.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This workaround doesn't quite do it for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value table&#xA;  (cons (list &quot;First&quot; &quot;Second&quot;)&#xA;        (identity '((a b) (c d))))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| First | Second |&#xA;| a     | b      |&#xA;| c     | d      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have to modify the content of the code block and the resulting header is not actually a header row, its a row like any other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related to this (but not 100% the same, above I would like to avoid having to put table setup instructions &lt;em&gt;inside&lt;/em&gt; the code block, below that is required), is there a special element that causes the insertion of a separator? Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value table&#xA;  (nconc (identity '((a b) (c d)))  ; calculated value A&#xA;         (list 'linebreak)          ; explicitly inserted linebreak&#xA;         (identity '((A B) (C D)))) ; calculated value B&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| a | b |&#xA;| c | d |&#xA;|---+---|&#xA;| A | B |&#xA;| B | D |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-03-03T07:40:00.883" Title="Generating tables with headers from code block" Tags="|org-mode|org-babel|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20696" PostTypeId="1" AcceptedAnswerId="20705" CreationDate="2016-03-02T16:32:45.460" Score="4" ViewCount="430" Body="&lt;p&gt;I am exporting a block of code &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_lstlisting&#xA;cut -d \' | grep http://&#xA;#+end_lstlisting&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the org export to latex replaces the backslash with &lt;code&gt;$\backslash$&lt;/code&gt; and the http:// string with &lt;code&gt;\url{http://}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried the export options &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: ^:nil -:nil tex:verbatim&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But they haven't done the trick. Any suggestions would be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using orgmode 8.2.10 on Emacs 25.1.50.2&lt;/p&gt;&#xA;" OwnerUserId="10117" LastEditorUserId="253" LastEditDate="2016-03-02T18:27:18.967" LastActivityDate="2016-03-07T18:53:51.630" Title="Orgmode character export to latex pdf" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20697" PostTypeId="1" AcceptedAnswerId="20698" CreationDate="2016-03-02T16:49:43.207" Score="0" ViewCount="100" Body="&lt;p&gt;&lt;em&gt;What is the key sequence for deleting from the current position to&#xA;the beginning of the buffer?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask not because I want to use the sequence but to prevent it from happening.   I always do this by mistake, often when I'm working too fast, and I don't realize it until later.  It happens only maybe four times per year, but sometimes, if I don't realize it soon enough, it can be devastating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could disable the function or sequence if I only knew what it was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I'll have to turn on some sort of keystroke log to find out exactly how I make this mistake?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've noticed that the problem occurs when I'm in &lt;code&gt;text-mode&lt;/code&gt;.  I'm using EMACS 24.3.1 on Windows 10, in case that's relevant.&lt;/p&gt;&#xA;" OwnerUserId="11260" LastEditorUserId="253" LastEditDate="2016-03-02T19:42:07.157" LastActivityDate="2016-03-02T20:18:33.770" Title="What key sequence is killing a large chunk of my buffer?" Tags="|key-bindings|logging|kill-text|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20698" PostTypeId="2" ParentId="20697" CreationDate="2016-03-02T18:12:35.497" Score="3" Body="&lt;p&gt;It is possible that that you're calling &lt;code&gt;kill-region&lt;/code&gt; which is bound to &lt;code&gt;C-w&lt;/code&gt;. This is what one would consider the cut command in other applications. If the region is not active it will kill from your point to where the last mark was, which could possibly be the beginning of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;view-lossage&lt;/code&gt; (bound to &lt;code&gt;C-h l&lt;/code&gt; or &lt;code&gt;&amp;lt;f1&amp;gt; l&lt;/code&gt;) displays the last 300 input keystrokes.&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="9995" LastEditDate="2016-03-02T20:18:33.770" LastActivityDate="2016-03-02T20:18:33.770" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20699" PostTypeId="2" ParentId="20672" CreationDate="2016-03-02T18:44:35.330" Score="4" Body="&lt;p&gt;My first thought is use org: C-c C-l, and type your link, with optional description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second thought, write a function like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-link (s)&#xA; (interactive &quot;sLink: &quot;)&#xA; (insert (format &quot;[[%s]&quot; s)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bind it to some key if you like. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third thought: look into yasnippet or skeleton.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-03-02T18:44:35.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20701" PostTypeId="2" ParentId="12843" CreationDate="2016-03-02T20:17:35.870" Score="38" Body="&lt;p&gt;Type &lt;code&gt;M-x projectile-invalidate-cache&lt;/code&gt; and you'll see the command with the bindings listed next to it. For me the bindings said &lt;code&gt;M-m p I&lt;/code&gt; which was correct, and should be the default I suspect for holy mode (&lt;code&gt;spc p I&lt;/code&gt; for evil mode).&lt;/p&gt;&#xA;" OwnerUserId="9588" LastActivityDate="2016-03-02T20:17:35.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20702" PostTypeId="1" CreationDate="2016-03-02T21:27:14.770" Score="4" ViewCount="171" Body="&lt;p&gt;I would like to automatically add spaces between braces and content when using emacs, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::vector&amp;lt;std::string&amp;gt; values{&quot;content&quot;, &quot;moreContent&quot;, &quot;andMoreContent&quot;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::vector&amp;lt;std::string&amp;gt; values{ &quot;content&quot;, &quot;moreContent&quot;, &quot;andMoreContent&quot; };&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when pressing &lt;code&gt;}&lt;/code&gt;. I'm already using &lt;code&gt;autopair-mode&lt;/code&gt; which automatically pairs braces and quotes.&#xA;Another example, when declaring variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int myVar{5};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int myVar{ 5 };&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I do this?&lt;/p&gt;&#xA;" OwnerUserId="11294" LastEditorUserId="253" LastEditDate="2016-03-02T21:58:42.333" LastActivityDate="2016-03-02T21:58:42.333" Title="Add spaces between braces and content" Tags="|formatting|balanced-parentheses|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20703" PostTypeId="2" ParentId="18644" CreationDate="2016-03-02T22:13:03.047" Score="3" Body="&lt;p&gt;That is a nice solution. I expanded this a bit here. It matches all the cite types and recolorizes the link. It doesn't do the manipulation to put @ and a space in, which can be done with the 'display property, but it add some complexity with extra managed properties that doesn't seem warranted to me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-ref-make-org-link-cite-key-visible (&amp;amp;rest _)&#xA;  &quot;Make the org-ref cite link visible in descriptive links.&quot;&#xA;&#xA;  (save-match-data&#xA;    (let ((s (match-string 1))&#xA;      (beg (match-beginning 0))&#xA;      (end (match-end 0))&#xA;      (cite-re (format &quot;^\\(%s:\\)&quot;&#xA;               (regexp-opt (-sort&#xA;                    (lambda (a b)&#xA;                      (&amp;gt; (length a) (length b)))&#xA;                    org-ref-cite-types))))&#xA;      cite-type)&#xA;&#xA;      (when (and s (string-match cite-re s))&#xA;    (setq cite-type (match-string 1 s))&#xA;    (remove-text-properties beg end&#xA;                '(invisible))&#xA;    (add-text-properties&#xA;     beg end&#xA;     `(face (:foreground ,org-ref-cite-color)))))))&#xA;&#xA;(advice-add 'org-activate-bracket-links :after #'org-ref-make-org-link-cite-key-visible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has been pushed to org-ref, so it should be default behavior now. Thanks for sharing your approach!&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-03-02T22:13:03.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20705" PostTypeId="2" ParentId="20696" CreationDate="2016-03-03T01:27:32.553" Score="4" Body="&lt;p&gt;Use a combination of &lt;code&gt;org code blocks&lt;/code&gt; and &lt;code&gt;noweb&lt;/code&gt; to get the results you expected.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a empty &lt;code&gt;org code block&lt;/code&gt; for &lt;code&gt;shell&lt;/code&gt; command &lt;kbd&gt;C-c&lt;/kbd&gt;  &lt;kbd&gt;C-v&lt;/kbd&gt;  &lt;kbd&gt;d&lt;/kbd&gt;  &lt;kbd&gt;org&lt;/kbd&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Assign a &lt;code&gt;#+NAME:&lt;/code&gt; to block then add &lt;code&gt;:results latex replace :exports none&lt;/code&gt; headers.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: latex-shell-script&#xA;#+BEGIN_SRC org :results latex replace :exports none&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add an empty line into org block and place cursor on empty line.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: latex-shell-script&#xA;#+BEGIN_SRC org :results latex replace :exports none&#xA;_&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open empty org code block for editing using &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;'&lt;/kbd&gt; then create &lt;code&gt;sh&lt;/code&gt; code block&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh&#xA;  cut -d \' | grep http://&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Save edited code with &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-s&lt;/kbd&gt; then close edit buffer with  &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;'&lt;/kbd&gt;&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: latex-shell-script&#xA;#+BEGIN_SRC org :results latex replace :exports none&#xA;  ,#+BEGIN_SRC sh&#xA;  cut -d \' | grep http://&#xA; ,#+END_SRC&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a empty &lt;code&gt;org code block&lt;/code&gt; for &lt;code&gt;1stlisting&lt;/code&gt; block &lt;kbd&gt;C-c&lt;/kbd&gt;  &lt;kbd&gt;C-v&lt;/kbd&gt;  &lt;kbd&gt;d&lt;/kbd&gt;  &lt;kbd&gt;org&lt;/kbd&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add &lt;code&gt;:noweb yes :results latex replace  :exports results&lt;/code&gt; headers to empty block&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org :noweb yes :results latex replace  :exports results &#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add an empty line into org block and place cursor on empty line.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org :noweb yes :results latex replace  :exports results &#xA;_&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open empty org code block for editing using &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;'&lt;/kbd&gt; then enter the following code.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_lstlisting&#xA;&amp;lt;&amp;lt;latex-shell-script()&amp;gt;&amp;gt;&#xA;#+end_lstlisting&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Save edited code with &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-s&lt;/kbd&gt; then close edit buffer with  &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;'&lt;/kbd&gt;&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org :noweb yes :results latex replace  :exports results &#xA;  ,#+begin_lstlisting&#xA;  &amp;lt;&amp;lt;latex-shell-script()&amp;gt;&amp;gt;&#xA;  ,#+end_lstlisting&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-e&lt;/kbd&gt; to export your code blocks to latex and you should see results similar to code listed below.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{lstlisting}&#xA;\begin{verbatim}&#xA;cut -d \' | grep http://&#xA;\end{verbatim}&#xA;\end{lstlisting}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Code Tested using&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  org-version: 8.3.2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-03-07T18:53:51.630" LastActivityDate="2016-03-07T18:53:51.630" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20706" PostTypeId="2" ParentId="20694" CreationDate="2016-03-03T01:51:42.850" Score="3" Body="&lt;p&gt;After adding the header row:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Assign &lt;code&gt;#+NAME:&lt;/code&gt; to code block.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: needs-a-table-header&#xA;#+BEGIN_SRC emacs-lisp :results value table &#xA;  (cons (list &quot;First&quot; &quot;Second&quot;)&#xA;        (identity '((a b) (c d))))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add &lt;code&gt;#+CALL:&lt;/code&gt; statement with &lt;code&gt;:colnames yes&lt;/code&gt; header&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CALL: needs-a-table-header() :colnames yes &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Run &lt;code&gt;#+CALL:&lt;/code&gt; statement using &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;| First | Second |&#xA;|-------+--------|&#xA;| a     | b      |&#xA;| c     | d      |&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Code Tested using&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  org-version: 8.3.2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastActivityDate="2016-03-03T01:51:42.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20707" PostTypeId="1" CreationDate="2016-03-03T03:42:21.253" Score="9" ViewCount="1804" Body="&lt;p&gt;I'm converting my dotfiles to org-babel files because I really enjoyed rewriting my Emacs configuration in it, and I have a function for the &lt;code&gt;init.org&lt;/code&gt; that automatically tangles it whenever I save. However, I haven't been successful in making the &lt;code&gt;.org&lt;/code&gt; files in say &lt;code&gt;~/.dotfiles&lt;/code&gt; to do the same automatically. I have this function currently:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/tangle-dotfiles ()&#xA;  &quot;If the current file is in '~/.dotfiles', the code blocks are tangled&quot;&#xA;  (when (equal (buffer-file-name)&#xA;               (expand-file-name &quot;~/.dotfiles/tmux.org&quot;))&#xA;    (org-babel-tangle)&#xA;    (message &quot;Dotfile tangled&quot;)))&#xA;&#xA;(add-hook 'after-save-hook #'my/tangle-dotfiles)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this only works for the specific file I name, not for any org file. Using &lt;code&gt;*.org&lt;/code&gt; doesn't work either, nor have I figured out how to extract the directory name from both the buffer and directory and do it that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also asked on the #emacs on Freenode but nobody answered me there. Any help or pointer on where to begin would be highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="11300" LastEditorUserId="105" LastEditDate="2016-03-03T05:14:19.713" LastActivityDate="2016-08-31T04:48:12.747" Title="Automatically tangle org files in a specific directory" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20708" PostTypeId="1" CreationDate="2016-03-03T03:49:17.060" Score="1" ViewCount="158" Body="&lt;p&gt;I want to run several programs one after another and display their output in a single buffer. I can do this by calling &lt;code&gt;call-process&lt;/code&gt; multiple times:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process &quot;cmd1&quot; nil &quot;*out*&quot; t)&#xA;(call-process &quot;cmd2&quot; nil &quot;*out*&quot; t)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that Emacs freezes until the last &lt;code&gt;call-process&lt;/code&gt; finishes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to execute several programs sequentially (one after another) without freezing Emacs?&lt;/p&gt;&#xA;" OwnerUserId="9464" LastActivityDate="2016-04-03T18:55:16.083" Title="How to run several programs one after another asynchronously" Tags="|process|async|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20709" PostTypeId="2" ParentId="20678" CreationDate="2016-03-03T04:03:34.950" Score="7" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/nex3/perspective-el&quot; rel=&quot;noreferrer&quot;&gt;perspective&lt;/a&gt; to manage projects. From its README:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;perspective.el provides multiple workspaces (or &amp;quot;perspectives&amp;quot;) for each Emacs frame. This makes it easy to work on many separate projects without getting lost in all the buffers.&lt;/p&gt;&#xA;&lt;p&gt;Each perspective is composed of a window configuration and a set of buffers. Switching to a perspective activates its window configuration, and when in a perspective only its buffers are available by default.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;There is also another version &lt;a href=&quot;https://github.com/Bad-ptr/persp-mode.el&quot; rel=&quot;noreferrer&quot;&gt;persp-mode&lt;/a&gt;, which is a little different from the original one. The perspectives are shared among frames and the states can be saved to the disk.&lt;/p&gt;&#xA;&lt;p&gt;If you're using &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;projectile&lt;/a&gt;, there is also a perspective &lt;a href=&quot;https://github.com/bbatsov/persp-projectile&quot; rel=&quot;noreferrer&quot;&gt;integration&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-03T04:03:34.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20710" PostTypeId="2" ParentId="20694" CreationDate="2016-03-03T07:40:00.883" Score="11" Body="&lt;p&gt;Just use &lt;code&gt;hline&lt;/code&gt; instead of &lt;code&gt;linebreak&lt;/code&gt;.&#xA;The following works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* test&#xA;#+BEGIN_SRC emacs-lisp :results value table&#xA;  '((&quot;First&quot; &quot;Second&quot;)&#xA;    hline&#xA;    (a b) (c d))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| First | Second |&#xA;|-------+--------|&#xA;| a     | b      |&#xA;| c     | d      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-03-03T07:40:00.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20711" PostTypeId="2" ParentId="20691" CreationDate="2016-03-03T08:12:59.250" Score="2" Body="&lt;p&gt;So your .emacs file is usually in a couple of places, unless it has been set up in an odd way. Your .emacs.el file is by default in  your home directory,or in a directory called .emacs.d. And your .emacs file should be called either .emacs.el or init.el. &#xA;As for customizing things, simply paste the customization into your init file. But depending on the mode you're working in there is a feature called &#xA;easy-customization that does a lot of this for you that you can get to from the menus or by calling with M-X. &#xA;I hope that helps!&lt;/p&gt;&#xA;" OwnerUserId="11045" LastActivityDate="2016-03-03T08:12:59.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20712" PostTypeId="1" CreationDate="2016-03-03T11:38:00.997" Score="10" ViewCount="741" Body="&lt;p&gt;I'd like to highlight code with various faces in a minor mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a screenshot that's close to what I want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GuwIk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GuwIk.png&quot; alt=&quot;python-syntax-highlight&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing that I'm missing is having the comment chars &lt;code&gt;#&lt;/code&gt; in&#xA;&lt;code&gt;font-lock-comment-face&lt;/code&gt;.  The idea is to have comments that &quot;belong&quot;&#xA;to an outline highlighted as plain text, so it's easier to read. While&#xA;having regular comments with their usual less prominent face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code that I used:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq-local font-lock-defaults&#xA;            '(python-font-lock-keywords&#xA;              nil nil nil nil&#xA;              (font-lock-syntactic-face-function&#xA;               . lpy-font-lock-syntactic-face-function)))&#xA;&#xA;(defun lpy-font-lock-syntactic-face-function (state)&#xA;  &quot;Return syntactic face given STATE.&#xA;Returns 'defalt face for comments that belong to an outline.&quot;&#xA;  (cond ((nth 3 state)&#xA;         (if (python-info-docstring-p state)&#xA;             font-lock-doc-face&#xA;           font-lock-string-face))&#xA;        ((save-excursion&#xA;           (while (and (&amp;gt; (point) (point-min))&#xA;                       (progn (move-beginning-of-line 0)&#xA;                              (eq (char-after) ?\#))))&#xA;           (forward-line 1)&#xA;           (looking-at &quot;#\\*+ &quot;))&#xA;         'default)&#xA;        (t&#xA;         font-lock-comment-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The thing is, I have no clue about the interface on which&#xA;&lt;code&gt;font-lock-syntactic-face-function&lt;/code&gt; operates, other than it receives a&#xA;complex data structure &lt;code&gt;state&lt;/code&gt;, has different point state, and returns&#xA;a face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone explain this interface? Is there a better one perhaps?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="105" LastEditDate="2016-03-13T21:55:54.607" LastActivityDate="2016-03-13T21:55:54.607" Title="How to add complex syntax highlighting in a minor mode?" Tags="|font-lock|syntax-highlighting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20713" PostTypeId="2" ParentId="20712" CreationDate="2016-03-03T12:46:53.610" Score="6" Body="&lt;p&gt;&lt;code&gt;font-lock-syntactic-face-function&lt;/code&gt; is a regular variable from Font Lock, more specifically from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntactic-Font-Lock.html#Syntactic-Font-Lock&quot; rel=&quot;nofollow noreferrer&quot;&gt;Syntactic Font Lock&lt;/a&gt; phase (emphasis mine):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;If this variable is non-nil, it should be a function to determine which face to use for a given syntactic element (a string or a comment). The value is normally set through an other-vars element in font-lock-defaults.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The function is called with one argument, the parse state at point returned by &lt;code&gt;parse-partial-sexp&lt;/code&gt;, and should return a face&lt;/strong&gt;. The default value returns font-lock-comment-face for comments and font-lock-string-face for strings (see Faces for Font Lock).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;parse-partial-sexp&lt;/code&gt; in turn returns a list which describes Emacs' current syntactic state, which is essentially the result of the application of the syntax table to the current buffer.  The list is rather complex, hence I'll spare it here; you can see the complete reference in the docstring of &lt;code&gt;parse-partial-sexp&lt;/code&gt;.  The purpose of this function is to change the face applied to a syntactic element under certain rules.  The beginning of your function demonstrates this: If the current string is a docstring, use a different face for it.&lt;/p&gt;&#xA;&lt;p&gt;However, the face always applies to the &lt;strong&gt;whole&lt;/strong&gt; syntactic element, i.e. the whole string or comment.  You can't highlight individual parts with this function, and you should only look at the given &lt;code&gt;state&lt;/code&gt; for this purpose—like &lt;code&gt;(python-info-docstring-p state)&lt;/code&gt; does in your code.  Do &lt;strong&gt;not&lt;/strong&gt; use point at this place; I'm not even sure whether the value of &lt;code&gt;point&lt;/code&gt; is properly defined at this stage of font-locking.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Putting the pieces together, you're using the wrong function for your purpose, which is why you can't get it to work.&lt;/p&gt;&#xA;&lt;p&gt;I haven't tried to implement your desired highlighting, but I think you dug way, way too deep for your purpose. If I understand things aright, you'd just like highlight outlines in a comment.&lt;/p&gt;&#xA;&lt;p&gt;If I'm right, then you just need &lt;code&gt;font-lock-keywords&lt;/code&gt; in a special way, namely:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(my/find-outline-in-comment-p 0 'outline-face t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;where &lt;code&gt;outline-face&lt;/code&gt; is the face you'd like to apply to the headline, &lt;code&gt;t&lt;/code&gt; means to override any prior font-locking at this place, and &lt;code&gt;my/find-outline-in-comment&lt;/code&gt; is a matcher function (see the docstring of &lt;code&gt;font-lock-defaults&lt;/code&gt;) which takes a position and searches for the first outline in a comment between &lt;code&gt;(point)&lt;/code&gt; and that position, returning the extents of the outline to be highlighted in the match data.&lt;/p&gt;&#xA;&lt;p&gt;To find the outline, you'd scan forward for comments (using &lt;code&gt;font-lock-comment-face&lt;/code&gt; or the syntactic state) and then uses &lt;code&gt;looking-at&lt;/code&gt; to check whether the comment has an outline.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="-1" LastEditorDisplayName="user227" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-03T21:53:18.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20714" PostTypeId="1" CreationDate="2016-03-03T15:51:28.547" Score="5" ViewCount="1374" Body="&lt;p&gt;I have searched the googlewebs, but I have been unable to find an emacs package that will automatically break long lines in a (Python) language conforming way.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    def _formatDependencyList(usedList):&#xA;        if len(usedList) == 0:&#xA;            return '(This thing does not use modules)'&#xA;        return ', '.join([_escapeUnderscores(_getBaseNameHead(s)) for s in usedList])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;s&lt;/code&gt; in the rightmost occurrence of &lt;code&gt;usedList&lt;/code&gt; is in column 80 in my file, and having gotten to the end of the line, I would like to issue a command, much like the &lt;code&gt;M-q&lt;/code&gt;/&lt;code&gt;fill-paragraph&lt;/code&gt; command, to 'fix' this one line and make it look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        return ', '.join([&#xA;                _escapeUnderscores(_getBaseNameHead(s)) for s in usedList])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this special case the &lt;code&gt;(&lt;/code&gt; and the &lt;code&gt;[&lt;/code&gt; that follow &lt;code&gt;join&lt;/code&gt; are adjacent, so I would break the line after &lt;code&gt;[&lt;/code&gt;.  (In the more typical case, I would break the line at the first &lt;code&gt;(&lt;/code&gt; or &lt;code&gt;[&lt;/code&gt; character.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to me like something that emacs could do, and probably does (somewhere), and it would save me a &lt;em&gt;whole lotta&lt;/em&gt; keystrokes.  Honestly, I do not know how people use editors that cannot fill paragraphs, and if I had this too I would likewise be unable to continue living without it.&lt;/p&gt;&#xA;" OwnerUserId="3950" LastActivityDate="2017-10-04T18:14:51.563" Title="How to break long lines automatically?" Tags="|python|formatting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20716" PostTypeId="1" AcceptedAnswerId="21414" CreationDate="2016-03-03T16:01:03.553" Score="5" ViewCount="1321" Body="&lt;p&gt;I want to have both &lt;code&gt;emmet-mode&lt;/code&gt; and &lt;code&gt;yasnippet&lt;/code&gt; trigger with the same key &lt;kbd&gt;C-return&lt;/kbd&gt;: in a &lt;code&gt;html-mode&lt;/code&gt; buffer, &lt;kbd&gt;C-return&lt;/kbd&gt; should first try &lt;code&gt;yas-expand&lt;/code&gt; and then &lt;code&gt;emmet-expand-line&lt;/code&gt; if no suitable snippet was found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems I am missing something about the binding keywords in &lt;code&gt;use-package&lt;/code&gt;. Currently only &lt;code&gt;emmet-mode&lt;/code&gt;'s bind is active in a HTML buffer.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;lisp/init-emmet.el&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package emmet-mode&#xA;  :defer t&#xA;  :init&#xA;  (add-hook 'css-mode-hook 'emmet-mode)&#xA;  (add-hook 'sgml-mode-hook 'emmet-mode)&#xA;  :config&#xA;  (setq-default&#xA;   emmet-move-cursor-between-quotes t&#xA;   emmet-preview-default nil)&#xA;  (unbind-key &quot;C-M-&amp;lt;left&amp;gt;&quot; emmet-mode-keymap)&#xA;  (unbind-key &quot;C-M-&amp;lt;right&amp;gt;&quot; emmet-mode-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;lisp/init-yasnippet.el&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package yasnippet&#xA;  :defer t&#xA;  :bind (:map yas-minor-mode-map (&quot;&amp;lt;C-return&amp;gt;&quot; . yas-expand))&#xA;  :init&#xA;  (add-hook 'js-mode-hook 'yas-minor-mode)&#xA;  (add-hook 'sgml-mode-hook 'yas-minor-mode)&#xA;  :config&#xA;  (setq-default yas-snippet-dirs '(&quot;~/.emacs.d/snippets&quot;))&#xA;  (yas-reload-all)&#xA;  (unbind-key &quot;TAB&quot; yas-minor-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2016-04-01T16:39:49.770" LastActivityDate="2016-04-04T09:19:08.510" Title="Conflict between emmet-mode and yasnippet, same trigger key" Tags="|key-bindings|keymap|use-package|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20717" PostTypeId="2" ParentId="9583" CreationDate="2016-03-03T16:09:51.310" Score="48" Body="&lt;p&gt;The following snippet will make Evil treat an Emacs &lt;em&gt;symbol&lt;/em&gt; as a word.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'evil&#xA;    (defalias #'forward-evil-word #'forward-evil-symbol)&#xA;    ;; make evil-search-word look for symbol rather than word boundaries&#xA;    (setq-default evil-symbol-word-search t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the advantage that it changes depending on the language:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo-bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is one symbol in &lt;code&gt;lisp-mode&lt;/code&gt; but two symbols (separated by &lt;code&gt;-&lt;/code&gt;) in &lt;code&gt;c-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2788" LastEditorUserId="2788" LastEditDate="2019-10-27T17:12:37.270" LastActivityDate="2019-10-27T17:12:37.270" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="20718" PostTypeId="1" CreationDate="2016-03-03T16:36:23.920" Score="4" ViewCount="448" Body="&lt;p&gt;I'm using Tramp with the scpx method to run the &lt;code&gt;compile&lt;/code&gt; command on a remote machine.  The build takes several minutes to run.  If I try to work on something else while that runs that ends up trying to use Tramp, Emacs hangs and then the compilation buffer appears to abort the build.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, one time I started the compilation and then went to a dired buffer of the remote machine and tried to navigate, and that caused this to happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another time, after starting the compilation, I tried to use &lt;code&gt;ido-find-file&lt;/code&gt; on a remote path, and the compilation buffer failed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm very new to Tramp and Emacs.  Should Tramp be able to handle multiple processes at the same time?  I wonder if I don't have something misconfigured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="11305" LastEditorUserId="11305" LastEditDate="2016-03-28T20:32:09.953" LastActivityDate="2016-03-28T20:32:09.953" Title="Compile with Tramp hangs or fails when using Tramp with another command" Tags="|tramp|compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20719" PostTypeId="1" AcceptedAnswerId="20867" CreationDate="2016-03-03T16:53:52.747" Score="6" ViewCount="321" Body="&lt;p&gt;I have some python code, that has some long string literals containing more python code. These strings should most of the time be uniformly colored, as happens by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I would like to be able to some times narrow my buffer to any of these strings, and then have emacs syntax highlight them as if they were code, not strings within code (i.e. as if the &lt;code&gt;&quot;&quot;&quot;&lt;/code&gt; weren't there in the original buffer)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to do that, that does not involve lots of elisp? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: I do not need to necessarily need narrowing, just seemed better to change the syntax highlighting like that, as in the full buffer it would be confusing...&lt;/p&gt;&#xA;" OwnerUserId="8659" LastEditorUserId="2710" LastEditDate="2016-03-10T07:04:09.493" LastActivityDate="2016-03-10T07:04:09.493" Title="Syntax highlight narrowed python string literals as code" Tags="|python|syntax-highlighting|narrowing|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20720" PostTypeId="1" AcceptedAnswerId="20978" CreationDate="2016-03-03T18:46:07.643" Score="12" ViewCount="1651" Body="&lt;p&gt;I would like to include figures with long comments in an org-mode file. The problem is that the #+CAPTION directive only recognizes the text on its same line. If you write many sentences in a very long line it becomes cumbersome to work with. Take a look at this example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum&#xA;#+NAME: fig01&#xA;[[file:./figs/fig01.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any work around to have multi-lines captions?&lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2017-09-10T22:26:50.377" Title="Figures with multiline captions in Org-Mode" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20722" PostTypeId="1" CreationDate="2016-03-03T19:33:16.750" Score="2" ViewCount="447" Body="&lt;p&gt;Deleting a chunk of text from the cursor causes the deleted contents to be copied into the kill ring, overwriting whatever I had stored there. How do I stop this from happening?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2016-03-03T20:59:29.187" Title="How to stop C-backspace or M-backspace from copying text?" Tags="|kill-ring|deletion|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20723" PostTypeId="1" CreationDate="2016-03-03T20:10:45.000" Score="3" ViewCount="3169" Body="&lt;p&gt;I want to add C auto-completion at least so that I can use Emacs on a regular basis as my C editor. I am new to Emacs, and I had already it installed in my system, because it came with the OS (I think). It's version is  22.1.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to follow the following tutorial:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=HTUE03LnaXA&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=HTUE03LnaXA&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To add auto-completion to Emacs, and we started by adding the following code to the &lt;code&gt;~/.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; start package.el with emacs&#xA;(require 'package)&#xA;; add MELPA to repository list&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;; initialize package.el&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I save the file &lt;code&gt;~/.emacs&lt;/code&gt; and start Emacs again, I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An error has occurred while loading `/Users/cell/.emacs':&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;File error: Cannot open load file, package&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To ensure normal operation, you should investigate and remove the&#xA;  cause of the error in your initialization file.  Start Emacs with the&#xA;  `--debug-init' option to view a complete error backtrace.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Loading find-func...done find-library-name: Can't find library package&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't know anything about Lisp, but from my understanding the problem is that the package called &lt;code&gt;'package&lt;/code&gt; does not exist. Indeed if I try to search it with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x find-library&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I type &lt;code&gt;package&lt;/code&gt;, it tells me:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can't find library package&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;According to this answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/20105967/emacs-marmalade-cannot-open-load-file-package&quot;&gt;https://stackoverflow.com/questions/20105967/emacs-marmalade-cannot-open-load-file-package&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It might be that my Emacs does not have &lt;code&gt;package&lt;/code&gt;. How can I solve this, and mostly, how can I add auto-completion to C programs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: I would prefer to stick with this version of Emacs terminal since it came with the OS, apparently. I've also installed another Emacs using a &lt;code&gt;.dmg&lt;/code&gt; file, but I would like to work on the terminal also (or mostly).&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user8802" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-03-03T21:24:00.867" Title="Emacs does not contain package &quot;package&quot;" Tags="|package|osx|c|install|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20726" PostTypeId="2" ParentId="20722" CreationDate="2016-03-03T20:59:29.187" Score="5" Body="&lt;p&gt;If you look at what &lt;code&gt;M-backspace&lt;/code&gt; calls using &lt;code&gt;C-h &amp;lt;M-backspace&amp;gt;&lt;/code&gt; you see that it calls &lt;code&gt;backward-kill-word&lt;/code&gt; that function simply calls &lt;code&gt;kill-word&lt;/code&gt; with a negative argument. The &lt;code&gt;kill-word&lt;/code&gt;  function is coded as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-word (arg)&#xA;  &quot;Kill characters forward until encountering the end of a word.&#xA;With argument ARG, do this that many times.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (kill-region (point) (progn (forward-word arg) (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If we write a function that does the same thing using &lt;code&gt;delete-region&lt;/code&gt; instead of &lt;code&gt;kill-region&lt;/code&gt; we'll get the desired result. Here is our new &lt;code&gt;delete-word&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-word (arg)&#xA;  &quot;Delete characters forward until encountering the end of a word.&#xA;With argument ARG, do this that many times.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (delete-region (point) (progn (forward-word arg) (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can now write our own &lt;code&gt;backward-delete-word&lt;/code&gt; using &lt;code&gt;backward-kill-work&lt;/code&gt; as an example like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun backward-delete-word (arg)&#xA;  &quot;Delete characters backward until encountering the beginning of a word.&#xA;With argument ARG, do this that many times.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (delete-word (- arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;afterwards all we need to do is bind this new function to &lt;code&gt;&amp;lt;M-backspace&amp;gt;&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any questions just let me know!&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-03-03T20:59:29.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20727" PostTypeId="2" ParentId="20723" CreationDate="2016-03-03T21:24:00.867" Score="8" Body="&lt;p&gt;OS-X comes with emacs 22, which is several years out of date. One easy way to get a current emacs is by downloading from &lt;a href=&quot;http://emacsformacosx.com/&quot;&gt;http://emacsformacosx.com/&lt;/a&gt;. This will give you package.&lt;/p&gt;&#xA;" OwnerUserId="10394" LastActivityDate="2016-03-03T21:24:00.867" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20729" PostTypeId="1" AcceptedAnswerId="20730" CreationDate="2016-03-03T21:39:48.430" Score="4" ViewCount="158" Body="&lt;p&gt;Is it possible to display a text file in two or more columns without changing the text file itself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I sometimes deal with a text file that contains a long list each of whose items are short. By default, if I had a list like below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA;* b&#xA;* c&#xA;* d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and if I have vertically extremely limited space on the screen, it'll be displayed like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA;* b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to make it displayed like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;window1 window2 &#xA;* a     * c&#xA;* b     * d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if I inserted a new org heading at the end of my list, it should be like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;window1 window2&#xA;* b     * d&#xA;* c     * _&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(_ is the point)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the whole text file should be like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* a&#xA;* b&#xA;* c&#xA;* d&#xA;* &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-03-13T21:55:29.353" LastActivityDate="2016-03-13T21:55:29.353" Title="Is it possible to display a text file in two or more columns without changing the text file itself?" Tags="|column|follow-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20730" PostTypeId="2" ParentId="20729" CreationDate="2016-03-03T21:41:16.947" Score="7" Body="&lt;p&gt;If I understood you correctly, you want &lt;code&gt;follow-mode&lt;/code&gt;. It comes with emacs.&#xA;First, show the same buffer in two side by side windows (Ctl-x 3).&#xA;Then turn on follow-mode. Page up and down, and watch the magic.&lt;/p&gt;&#xA;" OwnerUserId="10394" LastActivityDate="2016-03-03T21:41:16.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20731" PostTypeId="1" AcceptedAnswerId="20787" CreationDate="2016-03-03T22:20:55.420" Score="7" ViewCount="7679" Body="&lt;p&gt;I've been having trouble setting up ditaa to work in emacs,&#xA;I got my copy of the ditaa jar from &lt;a href=&quot;http://ditaa.sourceforge.net/&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;&#xA;And I've been trying to run this code block&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src ditaa :file hello.png :exports results &#xA;  +----------------+&#xA;  | Hello World!!! |&#xA;  |                |&#xA;  +----------------+&#xA;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I evaluate it with C-c C-c I  get&#xA;A blank png buffer and this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; Error: Unable to access jarfile /home/nalis/emacs-custom-packages/ditaa/ditaa.jar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;in a buffer called &lt;em&gt;Shell Command Output&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I've tried moving the jar files to shorter names, putting their location in my system path, and running ditaa outside of emacs to my success.&lt;/p&gt;&#xA;&lt;p&gt;My Current configurations for my org group are:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Org Ditaa Jar Path: ~/emacs-custom-packages/ditaa/ditaa.jar&#xA;Org Babel Ditaa Java Cmd: java&#xA;Org Ditaa Jar Option: -jar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And I am running:&#xA;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13) of 2015-06-23 on desktop-new&lt;/p&gt;&#xA;" OwnerUserId="11045" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2023-12-29T00:51:48.777" Title="Setting up Ditaa in Org-mode" Tags="|org-mode|org-babel|microsoft-windows|java|cygwin|" AnswerCount="5" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20732" PostTypeId="1" AcceptedAnswerId="20737" CreationDate="2016-03-03T23:43:35.727" Score="1" ViewCount="400" Body="&lt;p&gt;There doesn't seem to be any indentation in the default inferior scheme. At least, when I do &lt;code&gt;M-x run-scheme&lt;/code&gt; the resulting repl doesn't indent my code at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change this? Preferably without anything like geiser or other wrappers.&lt;/p&gt;&#xA;" OwnerUserId="11309" LastActivityDate="2016-03-06T00:50:11.140" Title="How do I enable indentation in an inferior scheme?" Tags="|indentation|scheme|inferior-buffer|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20733" PostTypeId="2" ParentId="20707" CreationDate="2016-03-04T00:00:01.147" Score="9" Body="&lt;p&gt;I figured out how to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/tangle-dotfiles ()&#xA;  &quot;If the current file is in '~/.dotfiles', the code blocks are tangled&quot;&#xA;  (when (equal (file-name-directory (directory-file-name buffer-file-name))&#xA;               (concat (getenv &quot;HOME&quot;) &quot;/.dotfiles/&quot;))&#xA;    (org-babel-tangle)&#xA;    (message &quot;%s tangled&quot; buffer-file-name)))&#xA;&#xA;(add-hook 'after-save-hook #'my/tangle-dotfiles)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11300" LastActivityDate="2016-03-04T00:00:01.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20734" PostTypeId="1" AcceptedAnswerId="20742" CreationDate="2016-03-04T00:20:04.487" Score="2" ViewCount="632" Body="&lt;h1&gt;summary&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If one captures &lt;code&gt;diff&lt;/code&gt; output to a file name=&lt;code&gt;*.diff&lt;/code&gt; and opens that file in a buffer, one gets nicely-formatted mode=&lt;code&gt;Diff&lt;/code&gt;. How to get that directly, without first capturing to a file?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;details&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;diff&lt;/code&gt; a lot, not only via &lt;code&gt;ediff-buffers&lt;/code&gt; (which I love) but also for more obscure purposes, like &lt;code&gt;diff&lt;/code&gt;ing outputs of processes. I've also been using Emacs for several decades, but continue to learn new aspects and uses. So I was not so much surprised as curious to find that, when I did (from the dir/folder of a local &lt;code&gt;git&lt;/code&gt; repo)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ git diff master origin/master &amp;gt; /tmp/foo__local_vs_remote.diff&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and opened the file in a buffer, it displayed in a nicely/usefully colorized (à la &lt;code&gt;ediff&lt;/code&gt;) mode=Diff. I had just never before simultaneously&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;captured &lt;code&gt;diff&lt;/code&gt; output to a file&lt;/li&gt;&#xA;&lt;li&gt;named the file &lt;code&gt;*.diff&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;opened the file in Emacs&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But now I'm trying to capture &lt;code&gt;diff&lt;/code&gt; output directly to a buffer &lt;em&gt;and&lt;/em&gt; get output like that of the happy mode=Diff, and am failing.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;seeking genericity&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Note also that, since I use &lt;code&gt;diff&lt;/code&gt; in lots of contexts, I'm looking for a solution to the general problem, and not, e.g., just to the &lt;code&gt;git diff&lt;/code&gt; problem (which I suspect Magit etc have solved). Seeking genericity, I'll test 3 usecases: &quot;normal&quot; file-vs-file &lt;code&gt;diff&lt;/code&gt;, &lt;code&gt;git diff&lt;/code&gt;, and process-substitution &lt;code&gt;diff&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;platform&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ lsb_release -ds&#xA;LMDE 2 Betsy&#xA;$ cat /etc/debian_version&#xA;8.3&#xA;$ uname -rv&#xA;3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29)&#xA;$ emacs --version&#xA;GNU Emacs 24.4.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;options&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;shell-command&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If I do the following (possibly after navigating to a buffer with an appropriate working directory)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-! &amp;lt;diff command/&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x b&lt;/code&gt; &lt;code&gt;*Shell Command Output*&lt;/code&gt; (where the output of &lt;code&gt;M-!&lt;/code&gt;==&lt;code&gt;M-x shell-command&lt;/code&gt; goes by default)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x diff-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;... I get the nicely-formatted output. Furthermore&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;this works for all 3 testcases&lt;/li&gt;&#xA;&lt;li&gt;if one runs &lt;code&gt;M-!&lt;/code&gt; with another &lt;code&gt;diff&lt;/code&gt; command, the new output just overwrites the old, but the buffer maintains &lt;code&gt;diff-mode&lt;/code&gt; without user intervention&lt;/li&gt;&#xA;&lt;li&gt;no keybinding changes (as with term-mode)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Chosen answer.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;shell-mode&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If I either&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x shell&lt;/code&gt;, goto the correct dir/folder, and run &lt;code&gt;git diff master origin/master&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;am in a buffer on the correct dir/folder, and run &lt;code&gt;M-&amp;amp; git diff master origin/master&lt;/code&gt; &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I get the dreaded &lt;code&gt;WARNING: terminal is not fully functional&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;term-mode&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;As &lt;a href=&quot;https://emacs.stackexchange.com/a/20736/5444&quot;&gt;Emacs User points out&lt;/a&gt;, &lt;code&gt;M-x term&lt;/code&gt; performs better for this usecase than &lt;code&gt;M-x shell&lt;/code&gt;: if I &lt;code&gt;M-x term&lt;/code&gt;, goto the correct dir/folder, and run &lt;code&gt;git diff master origin/master&lt;/code&gt;, I get nicely colorized output. It's not exactly mode=Diff, but it does the job. Unfortunately&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;That only works for &lt;code&gt;git diff&lt;/code&gt;: I get no colorization for either process-substitution or file &lt;code&gt;diff&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I find the &lt;a href=&quot;https://emacs.stackexchange.com/a/20736/5444&quot;&gt;term-mode keybinding changes&lt;/a&gt; highly annoying.&lt;/li&gt;&#xA;&lt;li&gt;I also found term-mode navigation odd: when editing history, my cursor would sometimes bounce around oddly.&#xA;solved).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-03-05T10:06:53.457" Title="how to properly capture `diff` output in buffer (without first opening a file)?" Tags="|process|diff|diff-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20735" PostTypeId="2" ParentId="20677" CreationDate="2016-03-04T00:36:44.620" Score="8" Body="&lt;p&gt;The closest thing to a solution I know of is to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;&amp;lt;home&amp;gt;&quot;) #'event-apply-super-modifier)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not &lt;em&gt;quite&lt;/em&gt; the same as turning &lt;code&gt;home&lt;/code&gt; into &lt;code&gt;super&lt;/code&gt; though. Specifically, if you press &lt;code&gt;home&lt;/code&gt;, release it, and then press e.g. &lt;code&gt;a&lt;/code&gt;, Emacs will interpret it as &lt;code&gt;s-a&lt;/code&gt; even though you released &lt;code&gt;home&lt;/code&gt; before pressing &lt;code&gt;a&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's not necessarily a bad thing (in fact, it can have ergonomic benefits), but it may not be what you want (and it can be a bit weird to have this one modifier work that way, if you don't configure the others to behave the same).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there are &lt;code&gt;event-apply-*-modifier&lt;/code&gt; functions for other modifiers as well. Modifiers that apply to keys after you've released them are sometimes referred to as &lt;a href=&quot;https://www.emacswiki.org/emacs/StickyModifiers&quot;&gt;&quot;sticky modifiers&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="621" LastActivityDate="2016-03-04T00:36:44.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20737" PostTypeId="2" ParentId="20732" CreationDate="2016-03-04T01:01:06.270" Score="2" Body="&lt;p&gt;I think the issue is that &lt;code&gt;RET&lt;/code&gt; is probably mapped to &lt;code&gt;comint-send-input&lt;/code&gt;, which doesn't do any indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do is map &lt;code&gt;C-j&lt;/code&gt; to &lt;code&gt;newline-and-indent&lt;/code&gt; and leave &lt;code&gt;RET&lt;/code&gt; mapped to &lt;code&gt;comint-send-input&lt;/code&gt;. So I press &lt;code&gt;C-j&lt;/code&gt; to enter a newline, and indent the new line, or &lt;code&gt;RET&lt;/code&gt; to actually send the form for evaluation. (Actually I map &lt;code&gt;C-j&lt;/code&gt; to &lt;code&gt;paredit-newline&lt;/code&gt;, but &lt;code&gt;newline-and-indent&lt;/code&gt; should work if you're not using Paredit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you could reverse those and use &lt;code&gt;RET&lt;/code&gt; for &lt;code&gt;newline-and-indent&lt;/code&gt; with &lt;code&gt;C-j&lt;/code&gt; for &lt;code&gt;comint-send-input&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example of mapping one of these keys, this will map &lt;code&gt;C-j&lt;/code&gt; to &lt;code&gt;newline-and-indent&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'cmuscheme&#xA;  (define-key inferior-scheme-mode-map (kbd &quot;C-j&quot;) #'newline-and-indent))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;cmuscheme&lt;/code&gt; is, for historical reasons, the name of the package that implements &lt;code&gt;inferior-scheme-mode&lt;/code&gt;, i.e. the Scheme REPL.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's something that seems to work, though I haven't tested it extensively:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comint-send-input-indent ()&#xA;  (interactive)&#xA;  (comint-send-input)&#xA;  (unless (save-excursion (forward-char -1)&#xA;                          (eq (field-at-pos (point)) 'output))&#xA;    (indent-for-tab-command)))&#xA;&#xA;(with-eval-after-load 'cmuscheme&#xA;  (define-key inferior-scheme-mode-map (kbd &quot;RET&quot;) #'comint-send-input-indent))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea is to call &lt;code&gt;comint-send-input&lt;/code&gt;, then check if point (the cursor) is immediately before the prompt. If it's not (because &lt;code&gt;comint-send-input&lt;/code&gt; just entered a newline), call &lt;code&gt;indent-for-tab-command&lt;/code&gt;, which indents the line appropriately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Another edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On second thought, I think this definition probably makes more sense:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comint-send-input-indent ()&#xA;  (interactive)&#xA;  (let ((parens (or (car (syntax-ppss)) 0)))&#xA;    (if (zerop parens)&#xA;        (comint-send-input)&#xA;      (newline-and-indent))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;C-h f syntax-ppss RET&lt;/code&gt; (and, better, &lt;code&gt;C-h f parse-partial-sexp RET&lt;/code&gt;) for more information. The short version is that they can tell us how deep the paren nesting is at point, so we can use that to decide whether to &lt;code&gt;newline-and-indent&lt;/code&gt; or &lt;code&gt;comint-send-input&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="621" LastEditorUserId="621" LastEditDate="2016-03-06T00:50:11.140" LastActivityDate="2016-03-06T00:50:11.140" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="20738" PostTypeId="2" ParentId="20731" CreationDate="2016-03-04T01:29:24.377" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I've tried moving the jar files to ... my system path&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;try lib path instead, or run this command at a terminal prompt to see if ditaa runs on your system without errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;java -jar ditaaXXX.jar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;adjust the path to the jar file, where xxx is the version number. If installed properly, you'd get the help screen for command line options.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-03-04T01:29:24.377" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20739" PostTypeId="2" ParentId="20734" CreationDate="2016-03-04T03:37:45.540" Score="3" Body="&lt;p&gt;You can always write a function to do all the repeated steps for you. This should get you started:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun diff-generic(command)&#xA;  (interactive &quot;sDiff command:&quot;)&#xA;  (let ((buffer (generate-new-buffer &quot;*diff-generic*&quot;)))&#xA;    (with-current-buffer buffer (diff-mode))&#xA;    (call-process-shell-command command nil buffer 0)&#xA;    (switch-to-buffer buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In general you can do &lt;code&gt;M-x diff&lt;/code&gt; to get that diff output for two arbitrary files. More info on that here: &lt;code&gt;(info &quot;(emacs) Diff Mode&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit does provide diff functionality, but take note that it uses it's own mode called &lt;code&gt;magit-diff-mode&lt;/code&gt;, that is different from generic emacs &lt;code&gt;diff-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also emacs bundled package &lt;code&gt;VC&lt;/code&gt; provides diff functionality for version control diffs. Unlike magit it works with backends other than git and uses &lt;code&gt;diff-mode&lt;/code&gt;, also you can use &lt;code&gt;ediff&lt;/code&gt;. Relevant manual: &lt;code&gt;(info &quot;(emacs) Old Revisions&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9143" LastEditorUserId="9143" LastEditDate="2016-03-05T04:03:51.357" LastActivityDate="2016-03-05T04:03:51.357" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20740" PostTypeId="1" CreationDate="2016-03-04T07:02:07.287" Score="1" ViewCount="290" Body="&lt;p&gt;I want to achieve something similar to &lt;a href=&quot;http://orgmode.org/manual/Tracking-TODO-state-changes.html#Tracking-TODO-state-changes&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; where entering a TODO or WAIT state allows you take note. Instead, I want to make a &lt;code&gt;PROPERTIES&lt;/code&gt; where the value is the heading. For example, if I have a heading called &quot;TODO A&quot; and if I mark it with &lt;code&gt;TODO&lt;/code&gt; state, is it possible for org-mode to create &lt;code&gt;PROPERTIES&lt;/code&gt; where the key is &lt;code&gt;TODO_NAME&lt;/code&gt; and the value would be &lt;code&gt;TODO A&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main purpose of doing this is because when I have a bunch of subtasks that need to be done, I would like to see to what task those subtasks belong in the agenda view. &lt;/p&gt;&#xA;" OwnerUserId="11295" LastActivityDate="2016-03-04T07:02:07.287" Title="Is it possible to set properties when entering a TODO in org-mode?" Tags="|org-mode|org-agenda|todo|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20741" PostTypeId="1" AcceptedAnswerId="20750" CreationDate="2016-03-04T07:29:40.380" Score="3" ViewCount="1199" Body="&lt;p&gt;I am trying to set up Gnus 5.13 to access a local maildir (created by OfflineIMAP) via Dovecot.  I know I could access OfflineIMAP's maildir directly, but as far as I know, this causes problems with syncing Gnus' flags.  So I set up OfflineIMAP (it works) and I have this in my ~/.gnus.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-select-method '(nnimap &quot;Mail&quot; (nnimap-stream shell)))&#xA;(setq nnimap-shell-program &quot;/usr/lib/dovecot/imap&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried this instead of the second line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq imap-shell-program &quot;/usr/lib/dovecot/imap&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I start Gnus, I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Couldn't open server on Mail&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Warning: Unable to open server nnimap+Mail due to: Buffer  *nnimap Mail &#xA;  nil  *nntpd** has no process&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to get this working or at least how to figure out what that error message means?&lt;/p&gt;&#xA;" OwnerUserId="11281" LastActivityDate="2016-03-04T12:19:02.977" Title="setting up Gnus 5.13 with OfflineIMAP and Dovecot" Tags="|gnus|email|imap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20742" PostTypeId="2" ParentId="20734" CreationDate="2016-03-04T07:40:02.923" Score="2" Body="&lt;p&gt;Try&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-! &amp;lt;your diff command/&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x b&lt;/code&gt; &lt;code&gt;*Shell Command Output*&lt;/code&gt; (where the output of &lt;code&gt;M-!&lt;/code&gt;==&lt;code&gt;M-x shell-command&lt;/code&gt; goes by default)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x diff-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10394" LastEditorUserId="5444" LastEditDate="2016-03-05T10:06:53.457" LastActivityDate="2016-03-05T10:06:53.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20743" PostTypeId="1" CreationDate="2016-03-04T08:28:14.340" Score="1" ViewCount="72" Body="&lt;p&gt;How can I view my week in org-agenda with the Days Backwards (Hebrew style)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;| March&lt;br&gt;&#xA;| 7         | 6         | 5         | 4             | 3         | 2         | 1     |&#xA;| Shabbat   | Friday    | Thursday  | Wednesday     | Tuesday   | Monday    | Sunday    |&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10898" LastActivityDate="2016-03-04T08:28:14.340" Title="org-agenda week view right-to-left Hebrew support (S-F-R-W-T-M-Sun) ordering" Tags="|org-mode|org-agenda|calendar|right-to-left|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20744" PostTypeId="1" CreationDate="2016-03-04T09:16:30.900" Score="2" ViewCount="877" Body="&lt;p&gt;Is there a package to log Emacs activity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been logging my productive activity with various tools, including shell and browser history.  More I use Emacs, it's hard to track what I do. Because more and more staff is done in Emacs without touching any other tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of &lt;a href=&quot;https://github.com/lewang/command-log-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;command-log-mode&lt;/code&gt;&lt;/a&gt;.  The latest version has &lt;a href=&quot;https://emacs.stackexchange.com/questions/12935/&quot;&gt;time-stamps and save capability&lt;/a&gt; but it does not log what file I am working on.  Maybe it is a good candidate for a starting point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also aware that you can time with &lt;a href=&quot;http://orgmode.org/manual/Clocking-work-time.html#Clocking-work-time&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-mode&lt;/code&gt;&lt;/a&gt;.  I'm using it but I always forget to switch to new work when I interrupted by my colleagues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, I'm not interested in &lt;em&gt;real&lt;/em&gt; life logging with Emacs.  I'm not looking for any extra gadget nor ways to &lt;em&gt;wear&lt;/em&gt; Emacs.  It sounds interesting but not for now.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-04T18:27:40.130" Title="How can I lifelog with Emacs?" Tags="|logging|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20745" PostTypeId="1" CreationDate="2016-03-04T10:01:14.630" Score="1" ViewCount="336" Body="&lt;p&gt;I installed LLVM on my Windows machine. And now I want Emacs tools to use it. I changed company-clang-executable to &quot;path/to/LLVM/bin/clang.exe&quot;. Now I think it finds Clang but somehow completions does not work. It only completes trivial things like main, double etc. I feel like I have to add some directories for company to look but I don't know how. I found ways of adding your own projet's directory but thats all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Here is what I did so far. I have;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;company&quot;&#xA;      (setq company-clang-arguments &quot;-I/c/msys64/include&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also ofcourse did standard things from manual beforehand to enable company-clang. I also checked with Emacs M-! that Emacs recognize executable named clang. But still no completion.&lt;/p&gt;&#xA;" OwnerUserId="11312" LastEditorUserId="11312" LastEditDate="2016-03-04T15:10:00.710" LastActivityDate="2016-03-04T15:10:00.710" Title="company-mode on Windows partially completes" Tags="|company-mode|c++|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20746" PostTypeId="2" ParentId="20712" CreationDate="2016-03-04T10:04:32.797" Score="1" Body="&lt;p&gt;Consider to define &lt;code&gt;font-lock-syntactic-face-function&lt;/code&gt; like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq font-lock-syntactic-face-function&#xA;      (lambda (state)&#xA;    (cond ((nth 3 state)&#xA;           font-lock-string-face)&#xA;          ((and (nth 4 state)(nth 8 state))&#xA;            MY-COMMENT-FACE&#xA;          (t  font-lock-comment-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This tested with python-mode.el, leaving a section starting with &quot;#*&quot; without comment-face:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq py--font-lock-syntactic-face-function&#xA;      (lambda (state)&#xA;    (cond ((nth 3 state)&#xA;           font-lock-string-face)&#xA;          ((and (nth 4 state)(nth 8 state)&#xA;            (progn (save-excursion&#xA;                 (goto-char (nth 8 state))&#xA;                 (looking-at (concat comment-start (regexp-quote &quot;*&quot;))))))&#xA;           nil)&#xA;          (t font-lock-comment-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While it's administered with the mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-syntactic-face-function&#xA;                    . py--font-lock-syntactic-face-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;code&gt;nil&lt;/code&gt;, any valid face should work.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-03-04T10:04:32.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20747" PostTypeId="2" ParentId="3747" CreationDate="2016-03-04T10:56:25.687" Score="1" Body="&lt;p&gt;I would have commented, but I don't have enough reputation, so I will just write it here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mirzhan Irkegulov's first expression worked, but the second one didn't work&#xA;&lt;code&gt;(add-hook 'text-mode-hook 'spacemacs/toggle-visual-line-navigation-on)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I had to use &lt;code&gt;(global-visual-mode t)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11295" LastActivityDate="2016-03-04T10:56:25.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20748" PostTypeId="1" AcceptedAnswerId="20776" CreationDate="2016-03-04T11:16:27.227" Score="1" ViewCount="451" Body="&lt;p&gt;Related to &lt;a href=&quot;https://emacs.stackexchange.com/questions/20712/how-to-add-complex-syntax-highlighting-in-a-minor-mode&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my current font lock setup for &lt;code&gt;python-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;(defconst lpy-font-lock-keywords&#xA;  '((&quot;^#\\(\\* .*\\)$&quot; 1 'org-level-1 prepend)&#xA;    (&quot;^#\\(\\*\\* .*\\)$&quot; 1 'org-level-2 prepend)&#xA;    (&quot;^#\\(\\*\\*\\* .*\\)$&quot; 1 'org-level-3 prepend)&#xA;    (&quot;^#\\(\\*\\*\\*\\* .*\\)$&quot; 1 'org-level-4 prepend)&#xA;    (&quot;^#\\(\\*\\*\\*\\*\\* .*\\)$&quot; 1 'org-level-5 prepend)&#xA;    (lpy-outline-comment-highlight 1 'default prepend)&#xA;    (&quot;`\\([^\n']+\\)'&quot; 1 font-lock-constant-face prepend)))&#xA;&#xA;(font-lock-add-keywords 'python-mode lpy-font-lock-keywords)&#xA;(defun lpy-outline-comment-highlight (limit)&#xA;  (when (re-search-forward &quot;^#\\(?:[^*]\\|$\\)&quot; limit t)&#xA;    (let* ((pt (point))&#xA;           (success (save-excursion&#xA;                      (and (re-search-backward &quot;^#\\*&quot; nil t)&#xA;                           (null (re-search-forward &quot;^[^#]&quot; pt t))))))&#xA;      (when success&#xA;        (set-match-data (list (line-beginning-position) (line-end-position)&#xA;                              (point) (line-end-position)))&#xA;        (end-of-line)&#xA;        t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code appears to do what I want (have comment bodies, but not&#xA;starters, in &lt;code&gt;default&lt;/code&gt; face for comments that belong to outlines), but&#xA;only for small buffers, or places that I modify.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For larger buffers (larger than one screen), &lt;code&gt;font-lock&lt;/code&gt; will be lazy&#xA;and not apply the required faces.  However, if I modify the text&#xA;around that region, it will be highlighted correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2jeT9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2jeT9.png&quot; alt=&quot;font-lock-lazy&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the image above, &lt;code&gt;font-lock&lt;/code&gt; is being lazy in the &quot;Multi-dimensional indexing outline&quot;.&#xA;So I moved a point there and entered a space - the highlight became correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I force &lt;code&gt;font-lock&lt;/code&gt; to highlight every line on the screen?&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-03-07T21:36:37.823" Title="How to prevent font-lock from being lazy?" Tags="|font-lock|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20749" PostTypeId="2" ParentId="20748" CreationDate="2016-03-04T11:55:00.260" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;font-lock-extend-region-functions&lt;/code&gt;. It contains a list of functions that extend the region that is rehighlighted. You can add your own function to it that extends the region to include the full comment, forcing your keywords to be applied correctly.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-03-04T11:55:00.260" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20750" PostTypeId="2" ParentId="20741" CreationDate="2016-03-04T12:19:02.977" Score="2" Body="&lt;p&gt;I was able to find the solution after all.  I figured out that the variable nnimap-shell-programm was always back to the default after starting gnus. And the process list showed&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;ssh Mail imapd&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The Gnus manual was only partially helpful because it says &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Customizing-the-IMAP-Connection.html#Customizing-the-IMAP-Connection&quot; rel=&quot;nofollow noreferrer&quot;&gt;this about nnimap-stream shell&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;shell&lt;/p&gt;&#xA;&lt;p&gt;If you need to tunnel via other systems to connect to the server, you can use this option, and customize nnimap-shell-program to be what you need.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Since the manual describes only options for nnimap, I figured that maybe nnimap-shell-programm was such an option as well.  So I tried the following in my ~/.gnus.el and it works:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-select-method '(nnimap &amp;quot;Mail&amp;quot;&#xA;                              (nnimap-stream shell)&#xA;                              (nnimap-shell-program &amp;quot;/usr/lib/dovecot/imap -o mail_location=maildir:~/Maildir/:LAYOUT=fs&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The other change about the call to the Dovecot preauth executable is just to make sure it finds the correct mail directory and so that it uses regular Maildir format (supported by OfflineIMAP) instead of Maildir++.&lt;/p&gt;&#xA;" OwnerUserId="11281" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-04T12:19:02.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20751" PostTypeId="2" ParentId="18755" CreationDate="2016-03-04T13:01:19.060" Score="1" Body="&lt;p&gt;Here is the code I have in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;prepare&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun advice:org-ctrl-c-ctrl-c (orig-func &amp;amp;rest args)&#xA;  (let (org-latex-fragment-image-overlays)&#xA;    (apply orig-func args)))&#xA;(advice-add 'org-ctrl-c-ctrl-c :around #'advice:org-ctrl-c-ctrl-c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the settings above, I can do things like this:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;use&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-toggle-preview-latex-fragment (arg)&#xA;  &quot;Toggle LaTeX fragments.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if org-latex-fragment-image-overlays&#xA;      (org-remove-latex-fragment-image-overlays)&#xA;      (org-preview-latex-fragment arg)))&#xA;(define-key org-mode-map (kbd &quot;C-c C-t&quot;) 'org-toggle-preview-latex-fragment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;(edited)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;At first I wrote myself a piece of code, but I have found a thread talking about this and found the workaround.&#xA;The second piece of code is due to John Kitchin. The idea of the workaround is due to Aaron Ecay.&#xA;You can see them at &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-07/msg00323.html&quot; rel=&quot;nofollow&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2014-07/msg00323.html&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;(edited on March 24, 2016)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Toggling of latex fragments is part of org-mode as of March 24, 2016.&#xA;Latex fragments can be previewed by calling &lt;code&gt;M-x org-toggle-latex-fragment&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I use the following setting in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c C-t&quot;) 'org-toggle-latex-fragment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11313" LastEditorUserId="11313" LastEditDate="2016-03-24T14:15:08.350" LastActivityDate="2016-03-24T14:15:08.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20752" PostTypeId="2" ParentId="20744" CreationDate="2016-03-04T14:51:21.840" Score="4" Body="&lt;p&gt;&lt;code&gt;M-x open-dribble-file&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Checklist.html&quot; rel=&quot;nofollow&quot;&gt;Checklist&lt;/a&gt; and the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Recording-Input.html&quot; rel=&quot;nofollow&quot;&gt;Recording Input&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Start writing all keyboard characters to a dribble file called FILE.&#xA;  If FILE is nil, close any open dribble file.&#xA;  The file will be closed when Emacs exits.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Be aware that this records ALL characters you type!&#xA;  This may include sensitive information such as passwords.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-04T14:51:21.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20753" PostTypeId="1" AcceptedAnswerId="20764" CreationDate="2016-03-04T15:18:19.187" Score="6" ViewCount="1249" Body="&lt;p&gt;I have a setup function that I want to run before I use &lt;code&gt;pdb&lt;/code&gt;/&lt;code&gt;gud&lt;/code&gt; to debug a Python script. I know about &lt;code&gt;gud-mode-hook&lt;/code&gt; which runs after the debugger starts (too late) and &lt;code&gt;change-major-mode-hook&lt;/code&gt; which, if I understand correctly, runs when you change major modes but &lt;em&gt;before&lt;/em&gt; the major mode hook for the new mode (early enough, but will run in cases I don't want it to). &lt;strong&gt;How can I have a function called &lt;em&gt;before&lt;/em&gt; a specific major mode is initialized?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for my particular use case the flow would be something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x pdb&lt;/code&gt; -&gt; &lt;code&gt;(my-setup-function)&lt;/code&gt; is called -&gt; &lt;code&gt;pdb&lt;/code&gt; starts (i.e., it's hooks are run etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have tried doing this with major mode hooks &lt;code&gt;pdb-mode-hook&lt;/code&gt; and &lt;code&gt;gud-mode-hook&lt;/code&gt; but then the setup doesn't happen in time, and is only available the &lt;em&gt;next&lt;/em&gt; time I run &lt;code&gt;pdb&lt;/code&gt;. At one point I tried to do it with advice as well, but was not successful (potentially, because I did it wrong). This is what I tried (though I am confused as to whether or not this counts as &lt;code&gt;advice&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-function :before (pdb) #'my-setup-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...which I based on a snippet from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;Emacs Lisp Reference manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-function :before (process-filter proc) #'my-tracing-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, I have not set this up right, and I get the message that &lt;code&gt;(pdb) is not a valid place expression&lt;/code&gt; when I evaluate it. Even though (because?) the documentation for &lt;code&gt;add-function&lt;/code&gt; is very detailed, I have a lot of trouble understanding how to use it properly.  &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="105" LastEditDate="2016-03-13T21:54:38.443" LastActivityDate="2018-12-07T16:59:08.613" Title="Call a function before a specific major mode starts" Tags="|hooks|advice|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20754" PostTypeId="1" AcceptedAnswerId="20767" CreationDate="2016-03-04T15:58:50.840" Score="10" ViewCount="591" Body="&lt;p&gt;I have a fork of popular repo, I want to be able to keep track of commits being push to that repo while also having my own personal commits to my fork. I don't really want my changes to be merged upstream so I'm fine with merging/rebasing every time someone commits to the upstream repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read about triangle workflow and Magit's support for it and thought it great. It does exactly what I need, except that it insists my local commits should be finally merged into the main repo thus displaying a list of my local commits under the section &lt;code&gt;Unmerged into upstream/master&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Head:     &amp;lt;local commit&amp;gt;&#xA;Merge:    upstream/master &amp;lt;upstream commit&amp;gt;&#xA;Push:     origin/master &amp;lt;local commit&amp;gt;&#xA;&#xA;Unpulled from upstream/master (1)&#xA;987ac90 upstream/master &amp;lt;upstream commit&amp;gt;&#xA;&#xA;Unmerged into upstream/master (1)&#xA;123baf8 master origin/master &amp;lt;local commit&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is fine if there are a couple of commits, but later my personal modifications will pile on and the list will grow.&#xA;Is there any way to set the section &lt;code&gt;Unmerged into upstream/master&lt;/code&gt; to be always hidden?&lt;/p&gt;&#xA;" OwnerUserId="399" LastActivityDate="2018-08-21T14:11:49.817" Title="Change the default visibility of a Magit section" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20755" PostTypeId="1" AcceptedAnswerId="23938" CreationDate="2016-03-04T18:15:56.023" Score="1" ViewCount="559" Body="&lt;p&gt;When I run code from a buffer in &lt;code&gt;python-mode&lt;/code&gt; for it to evaluate in a dedicated inferior ipython process emacs freezes. It freezes if, while the code is evaluating, I try to edit the buffer from which I sent the code. I am unable to move the point, am unable to change buffers, am unable to type, and the time in the mode-line does not update.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to stop this from happening? Could it be related to the settings of my python-shell-interpreter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my python init&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package python&#xA;  :mode (&quot;\\.py\\'&quot; . python-mode)&#xA;  :interpreter (&quot;ipython&quot; . python-mode)&#xA;  :demand&#xA;  :config&#xA;  (setq python-shell-interpreter &quot;ipython&quot;&#xA;    python-shell-interpreter-args &quot;-i&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-13T15:45:25.430" Title="Ipython hangup while running code" Tags="|python|ipython|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20756" PostTypeId="2" ParentId="20678" CreationDate="2016-03-04T18:17:29.897" Score="2" Body="&lt;p&gt;A &quot;barebones&quot; solution might to use &lt;code&gt;C-x r w&lt;/code&gt; to record the current window state and &lt;code&gt;C-x r j&lt;/code&gt; to get back to an earlier one.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-03-04T18:17:29.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20757" PostTypeId="2" ParentId="20708" CreationDate="2016-03-04T18:22:33.343" Score="3" Body="&lt;p&gt;You can start with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((proc1 (start-process &quot;myproc1&quot; t &quot;cmd1&quot;)))&#xA;  (set-process-sentinel proc1&#xA;    (lambda (proc1 _string)&#xA;      (with-current-buffer (process-buffer proc1)&#xA;        (let ((proc2 (start-process &quot;myproc2&quot; t &quot;cmd2&quot;)))&#xA;          (set-process-sentinel proc2&#xA;            (lambda (proc2 _string)&#xA;              (with-current-buffer (process-buffer proc2)&#xA;                (let ((proc3 (start-process &quot;myproc3&quot; t &quot;cmd3&quot;)))&#xA;                  ...)))))))))              &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-03-04T18:22:33.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20758" PostTypeId="2" ParentId="20744" CreationDate="2016-03-04T18:27:40.130" Score="-2" Body="&lt;p&gt;Does WakaTime meet your need? &lt;a href=&quot;https://wakatime.com/&quot; rel=&quot;nofollow&quot;&gt;https://wakatime.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From their website:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Get real-time metrics per project, file, branch, commit, feature, operating system, editor/IDE, language, etc.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11318" LastActivityDate="2016-03-04T18:27:40.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20759" PostTypeId="1" AcceptedAnswerId="20762" CreationDate="2016-03-04T19:52:08.987" Score="7" ViewCount="2314" Body="&lt;p&gt;&lt;code&gt;imenu&lt;/code&gt; can be used in &lt;code&gt;org-mode&lt;/code&gt; to quickly jump to a heading. It first prompts for the 1st level heading, and then asks for the 2nd level heading and so on untill the selected heading has no subheading and we are then taken to that last selected heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what I would rather like is &lt;code&gt;imenu&lt;/code&gt; to present the list of all headings and let me select directely the one I want to go to because&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it would be faster&lt;/li&gt;&#xA;&lt;li&gt;and it would allow jumping to a heading which &lt;em&gt;has&lt;/em&gt; subheadings&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I understand that this is not the case (at least by default) because org files may have several headings sharing the same name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in many situations, org headings do have unique names and therefore it would be very convinient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could this be done ?&lt;/p&gt;&#xA;" OwnerUserId="526" LastActivityDate="2018-09-12T17:25:38.937" Title="All org subheadings in imenu?" Tags="|org-mode|imenu|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20760" PostTypeId="2" ParentId="20753" CreationDate="2016-03-04T20:11:20.123" Score="4" Body="&lt;p&gt;This seems to work. Apparently, defadvice is old-fashioned, and we're supposed to use advice-add instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jk-advice ()&#xA;  (message &quot;Kilroy was here&quot;))&#xA;(advice-add 'python-mode :before #'jk-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10394" LastEditorUserId="10394" LastEditDate="2016-03-04T20:16:42.850" LastActivityDate="2016-03-04T20:16:42.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20761" PostTypeId="1" CreationDate="2016-03-04T20:18:09.660" Score="2" ViewCount="59" Body="&lt;p&gt;Prettify-symbols-mode is a very nice way to make source code more readable, especially in math-heavy languages. Unfortunately, exporting to HTML with html-fontify-buffer doesn't respect prettifications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be made to (I &lt;a href=&quot;https://github.com/cpitclaudel/.emacs.d/blob/master/lisp/htmlfontify/htmlfontify%2B.el&quot; rel=&quot;nofollow&quot;&gt;wrote the code&lt;/a&gt; for that), but it breaks copy-pasting (the prettified symbols are copied, not their unprettified equivalents).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, how can I export an Emacs lisp buffer to a webpage, while preserving prettifications and not breaking copy-paste?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-03-04T20:18:09.660" Title="How can I export compositions with html-fontify?" Tags="|display|htmlfontify|prettify-symbols-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20762" PostTypeId="2" ParentId="20759" CreationDate="2016-03-04T21:37:32.320" Score="8" Body="&lt;p&gt;Instead of using &lt;code&gt;imenu&lt;/code&gt;, you can use &lt;code&gt;org-goto&lt;/code&gt; with the following&#xA;settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-goto-interface 'outline-path-completionp)&#xA;(setq org-outline-path-complete-in-steps nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;,----[ C-h v org-goto-interface RET ]&#xA;| org-goto-interface is a variable defined in ‘org.el’.&#xA;| Its value is ‘outline-path-completionp’&#xA;| Original value was outline&#xA;|&#xA;| Documentation:&#xA;| The default interface to be used for ‘org-goto’.&#xA;| Allowed values are:&#xA;| outline                  The interface shows an outline of the relevant file&#xA;|                          and the correct heading is found by moving through&#xA;|                          the outline or by searching with incremental search.&#xA;| outline-path-completion  Headlines in the current buffer are offered via&#xA;|                          completion.  This is the interface also used by&#xA;|                          the refile command.&#xA;|&#xA;| You can customize this variable.&#xA;|&#xA;| [back]&#xA;`----&#xA;&#xA;,----[ C-h v org-outline-path-complete-in-steps RET ]&#xA;| org-outline-path-complete-in-steps is a variable defined in ‘org.el’.&#xA;| Its value is nil&#xA;| Original value was t&#xA;|&#xA;| Documentation:&#xA;| Non-nil means complete the outline path in hierarchical steps.&#xA;| When Org-mode uses the refile interface to select an outline path&#xA;| (see variable ‘org-refile-use-outline-path’), the completion of&#xA;| the path can be done in a single go, or it can be done in steps down&#xA;| the headline hierarchy.  Going in steps is probably the best if you&#xA;| do not use a special completion package like ‘ido’ or ‘icicles’.&#xA;| However, when using these packages, going in one step can be very&#xA;| fast, while still showing the whole path to the entry.&#xA;|&#xA;| You can customize this variable.&#xA;|&#xA;| [back]&#xA;`----&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2016-03-04T21:37:32.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20764" PostTypeId="2" ParentId="20753" CreationDate="2016-03-04T22:27:00.903" Score="3" Body="&lt;p&gt;Do exactly what you want!&#xA;That means define a function as follows and run this function instead of &lt;code&gt;pdb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mypdb ()&#xA;  &quot;Start `pdb' with my own setup.&quot;&#xA;  (interactive)&#xA;  (my-setup-function)&#xA;  (pdb))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That would be what the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Named-Functions.html#Advising-Named-Functions&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; suggests in another situation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you simply want to change what a particular key does, it may be better to write a new command, and remap the old command’s key bindings to the new one (see Remapping Commands).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-03-04T22:27:00.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20766" PostTypeId="1" AcceptedAnswerId="33207" CreationDate="2016-03-05T02:38:07.433" Score="15" ViewCount="1182" Body="&lt;p&gt;I'd like to display the recursive size (the value that would be reported by &lt;code&gt;du&lt;/code&gt;) of folder contents in-line in the dired buffer as an additional column or in place of the directory file size.  Is this already possible with dired/dired+ or a related package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done some digging and found some discussion of this sort of functionality, but nothing that integrates that size information back into the graphical interface of dired.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/DiredGetFileSize&quot; rel=&quot;noreferrer&quot;&gt;https://www.emacswiki.org/emacs/DiredGetFileSize&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://superuser.com/questions/462079/how-can-i-display-folder-sizes-in-emacs-dired&quot;&gt;https://superuser.com/questions/462079/how-can-i-display-folder-sizes-in-emacs-dired&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2024-01-25T14:17:47.370" Title="Display recursive folder sizes in-line in dired?" Tags="|dired|files|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20767" PostTypeId="2" ParentId="20754" CreationDate="2016-03-05T11:17:20.273" Score="9" Body="&lt;p&gt;While no such option existed when this question was asked, it now does: &lt;code&gt;magit-section-initial-visibility-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Old answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No option exists to do this easily, mostly because this feature hasn't been requested often. (I cannot remember that it ever was requested before, which I find a bit surprising.) I do intend to eventually add such an option, but not until I make other, more fundamental, changes to the section code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But a hook exists which can be used to do this. You'll have to write a bit of boilerplate though:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun local-magit-initially-hide-unmerged (section)&#xA;  (and (not magit-insert-section--oldroot)&#xA;       (eq (magit-section-type section) 'unpushed)&#xA;       (equal (magit-section-value section) &quot;@{upstream}..&quot;)&#xA;       'hide))&#xA;&#xA;(add-hook 'magit-section-set-visibility-hook&#xA;          'local-magit-initially-hide-unmerged)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If &lt;code&gt;magit-insert-section--oldroot&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; then the buffer is being first created (not being updated). We only want to return non-nil in that case.&lt;/li&gt;&#xA;&lt;li&gt;To get the value and type of a section use &lt;code&gt;M-x magit-describe-section&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The return value has to be &lt;code&gt;hide&lt;/code&gt;, &lt;code&gt;show&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; (let something else decide).&lt;/li&gt;&#xA;&lt;li&gt;Such functions have to come &lt;em&gt;before&lt;/em&gt; &lt;code&gt;magit-section-set-visibility-from-cache&lt;/code&gt; in the hook.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That's a bit rough around the edges, then again this was only intended for internal purposes.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2018-08-21T14:11:49.817" LastActivityDate="2018-08-21T14:11:49.817" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="20768" PostTypeId="1" AcceptedAnswerId="20800" CreationDate="2016-03-05T13:47:23.350" Score="5" ViewCount="183" Body="&lt;p&gt;I would like to sort the &lt;code&gt;dired&lt;/code&gt; buffer by a suffix in the file names. For instance, with the following buffer content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/nixos/nix/store:&#xA;total used in directory 140344 available 17530560&#xA;drwxrwxr-t 1612 root  30000  1810432 Mar  4 21:41 .&#xA;drwxr-xr-x    4 root  root      4096 Feb  4  2015 ..&#xA;dr-xr-xr-x    5 root  root      4096 Dec 31  1969 01l09wxficgyw6yhd812xzxldxrp4yma-pangomm-2.34.0&#xA;dr-xr-xr-x    5 root  root      4096 Dec 31  1969 03afp0sdvnvj9aj8k18s7ikkh4pnzlij-perl-HTTP-Message-6.06&#xA;dr-xr-xr-x    4 root  root      4096 Dec 31  1969 04yx1lnhzbiy4hkwkhnw7cw2i6zmfhf4-xmlto-0.0.26&#xA;dr-xr-xr-x    3 root  root      4096 Dec 31  1969 0534201di00hs189hzvx8gv8kxgbl2q1-unit-script&#xA;dr-xr-xr-x    2 root  root      4096 Dec 31  1969 06g99nk2q4pjq4xx3p6qw77zxmnyr5rn-kmod-blacklist-3ubuntu1&#xA;dr-xr-xr-x    4 root  root      4096 Dec 31  1969 06l8iksb8mndiis047z5f7b1zaqc1i4a-feh-2.14&#xA;dr-xr-xr-x    4 root  root      4096 Dec 31  1969 06s10661ji3s3cwsmrxc38kx856jds8i-nixos-system-jrm.no-ip.org-16.03pre77568.40c586b&#xA;dr-xr-xr-x    5 root  root      4096 Dec 31  1969 06wqzjsbjlhimn18g9ah04klhslj8b04-libkrb5-1.14&#xA;dr-xr-xr-x    7 root  root      4096 Dec 31  1969 06xdwfrhbjwhgxcsp2d2qlxhkv3ck01b-gcc-4.9.3&#xA;dr-xr-xr-x    3 root  root      4096 Dec 31  1969 079ix6d3aarvjjh83r7vcc6nk9pjcb25-mesa-noglu-11.1.1-drivers&#xA;dr-xr-xr-x    2 root  root      4096 Dec 31  1969 07k6b606sxwfib3f1srbdi1pifpb9gj3-unit-firewall.service&#xA;dr-xr-xr-x    5 root  root      4096 Dec 31  1969 07yqgv4n248xrigrnk9xn7ami5dyz3q8-lzo-2.09&#xA;dr-xr-xr-x    5 root  root      4096 Dec 31  1969 09i3xn0lbi268354l9y2nm8302qc5dhg-poppler-qt4-0.36.0&#xA;drwxr-xr-x    2 30001 30000     4096 Mar  4 20:39 09jszxa0cdd65g7yxb64fc87dq7ayy5s-jwm-s1406&#xA;dr-xr-xr-x    6 root  root      4096 Dec 31  1969 0ac359cfc4a8kw95g494z0x5vn37vrqa-libwacom-0.15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the file names consists of a hash sequence, followed by an &lt;code&gt;-&lt;/code&gt;, followed by a suffix (the really interesting part of the name). I want to sort by this last part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be achieved?&lt;/p&gt;&#xA;" OwnerUserId="157" LastEditorUserId="157" LastEditDate="2016-03-05T13:52:49.393" LastActivityDate="2016-03-08T20:24:27.240" Title="Sort by a suffix in file names in dired" Tags="|dired|sorting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20769" PostTypeId="1" AcceptedAnswerId="20771" CreationDate="2016-03-05T14:36:24.843" Score="7" ViewCount="371" Body="&lt;p&gt;If, in a function run from &lt;code&gt;before-save-hook&lt;/code&gt;, I want to &lt;em&gt;abort&lt;/em&gt; the saving of a file, so that the file is not saved and the user is signaled, how can I do that?  Is it possible (without rebinding &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; or doing &lt;code&gt;defadvice&lt;/code&gt; around &lt;code&gt;save-buffer&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It used to be, I think in Emacs 23, that all you had to do was &lt;code&gt;(error &quot;Bad!&quot;)&lt;/code&gt;, and the file save operation would be aborted.  But that does no longer work; any errors in a &lt;code&gt;before-save-hook&lt;/code&gt; are ignored.)&lt;/p&gt;&#xA;" OwnerUserId="2175" LastEditorUserId="2175" LastEditDate="2016-03-05T15:41:25.547" LastActivityDate="2016-03-05T16:16:00.763" Title="How to abort saving in a before-save-hook function?" Tags="|hooks|error-handling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20771" PostTypeId="2" ParentId="20769" CreationDate="2016-03-05T16:16:00.763" Score="3" Body="&lt;p&gt;Try using one of the hooks &lt;code&gt;write-file-functions&lt;/code&gt; or &lt;code&gt;write-contents-functions&lt;/code&gt; instead.  Your hook function can signal an error or just return non-nil, and in either case it will abort the save.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-03-05T16:16:00.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20773" PostTypeId="1" AcceptedAnswerId="20774" CreationDate="2016-03-05T19:27:11.347" Score="3" ViewCount="4045" Body="&lt;p&gt;I have a &lt;code&gt;pdflatex&lt;/code&gt; program located in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/local/texlive/2014/bin/i386-linux/pdflatex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I added it's folder to &lt;code&gt;$PATH&lt;/code&gt; both in .bashrc and .bash_profile:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PATH=$PATH:/usr/local/texlive/2014/bin/i386-linux/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run this command in ordinary shell: both in X and console, it works. I wanted to run pdflatex upon the current file in buffer using this elisp command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(start-process-shell-command&#xA;    &quot;pdflatex&quot;&#xA;    &quot;*async pdflatex*&quot;&#xA;    (concat &quot;pdflatex &quot; file-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works in Windows, worked in Linux previously. But now I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/bin/bash: pdflatex: command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to fix?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastEditorUserId="253" LastEditDate="2016-03-05T19:43:10.940" LastActivityDate="2016-03-05T19:59:30.683" Title="Trying to run a linux program in Emacs: command not found" Tags="|shell-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20774" PostTypeId="2" ParentId="20773" CreationDate="2016-03-05T19:59:30.683" Score="4" Body="&lt;p&gt;Let me start by guessing that you start emacs from your graphical environment, and not from a shell. If you start it from the shell, emacs will inherit PATH from the shell, and you should be able to run your program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to fix depends on what linux distro you are using. As for me, I am running Ubuntu (15.10), and emacs sees the environment defined in &lt;code&gt;.profile&lt;/code&gt;. In other words, try adding &lt;code&gt;/usr/local/texlive/2014/bin/i386-linux&lt;/code&gt; to your PATH in &lt;code&gt;.profile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10394" LastActivityDate="2016-03-05T19:59:30.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20775" PostTypeId="2" ParentId="20233" CreationDate="2016-03-05T20:22:33.360" Score="0" Body="&lt;p&gt;Here's a minimally tested bit of elisp that will swap two tab-separated values on each line in the buffer, ignoring lines that don't meet that criterion.  Note that there's a fair bit of boilerplate with the &lt;code&gt;save-...&lt;/code&gt; stuff.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun swaperooni ()&#xA;  &quot;Swap two tab-separated fields in each line in buffer.&quot;&#xA;  (interactive)&#xA;  (let ((re-1 &quot;\\(.+\\)\t\\(.+\\)&quot;) (re-2 &quot;\\2\t\\1&quot;))&#xA;    (save-restriction&#xA;      (save-excursion&#xA;        (save-match-data&#xA;          (widen)&#xA;          (goto-char (point-min))&#xA;          (while (not (eobp))&#xA;            (let ((line (buffer-substring (point-at-bol) (point-at-eol))))&#xA;              (when (string-match re-1 line)&#xA;                (delete-region (point-at-bol) (point-at-eol))&#xA;                (insert (replace-regexp-in-string re-1 re-2 line)))&#xA;              (forward-line 1))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-03-05T20:22:33.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20776" PostTypeId="2" ParentId="20748" CreationDate="2016-03-05T20:27:19.377" Score="3" Body="&lt;p&gt;[ Indeed, your rules are &quot;single line&quot;, so it's not among the problems described in &lt;code&gt;(elisp)Font Lock Multiline&lt;/code&gt;.  It really doesn't have anything to do with &quot;laziness&quot;.  ]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is quite simple: in your &lt;code&gt;lpy-outline-comment-highlight&lt;/code&gt; function, if you find a match but you decide that &lt;code&gt;success&lt;/code&gt; nil, then you return nil, which will tell font-lock to stop looking any further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW you need to replace your &lt;code&gt;when&lt;/code&gt; with a loop.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution:&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun lpy-outline-comment-highlight (limit)&#xA;  (catch 'done&#xA;    (while (re-search-forward &quot;^#\\(?:[^*\n]\\)&quot; limit t)&#xA;      (let* ((pt (point))&#xA;             (success (save-excursion&#xA;                        (and (re-search-backward &quot;^#\\*&quot; nil t)&#xA;                             (null (re-search-forward &quot;^[^#]&quot; pt t))))))&#xA;        (when success&#xA;          (set-match-data (list (line-beginning-position) (line-end-position)&#xA;                                (point) (line-end-position)))&#xA;          (end-of-line)&#xA;          (throw 'done t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="2094" LastEditDate="2016-03-07T21:36:37.823" LastActivityDate="2016-03-07T21:36:37.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20777" PostTypeId="1" AcceptedAnswerId="20815" CreationDate="2016-03-05T21:41:49.513" Score="2" ViewCount="327" Body="&lt;p&gt;I stumbled upon &lt;a href=&quot;http://tiborsimko.org/emacs-epydoc-snippets.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; feature for functions, and was eager to try it out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I ran into an error message, after trying the snippet in python-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[yas] elisp error: Symbol’s value as variable is void: text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From what I read on his blog, and seeing the others trying this snippet, it went propably without any problems for them. I couldn't figure out how I could bind any value to the text. Any suggestion?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-03-07T11:38:58.167" Title="Why is this snippet working properly, and not here?" Tags="|yasnippet|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20778" PostTypeId="1" AcceptedAnswerId="20831" CreationDate="2016-03-05T22:51:13.427" Score="4" ViewCount="1183" Body="&lt;p&gt;Coming from &lt;code&gt;helm&lt;/code&gt;, I am giving &lt;code&gt;swiper&lt;/code&gt; and &lt;code&gt;ivy-mode&lt;/code&gt; a shot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a way to highlight candidates in the way &lt;code&gt;hl-line-mode&lt;/code&gt; does: full width background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/eUXa7.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eUXa7.gif&quot; alt=&quot;hl-line&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2016-03-08T16:09:27.960" LastActivityDate="2016-03-08T16:09:27.960" Title="How to highlight ivy candidates in the manner of hl-line?" Tags="|swiper|ivy|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20779" PostTypeId="1" AcceptedAnswerId="20780" CreationDate="2016-03-05T23:09:52.393" Score="2" ViewCount="945" Body="&lt;p&gt;In normal mode I can't jump to definition with ternjs or cider modes.  I have to go to insert then hit M-.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that the evil way?  Should I have M-. bound to another function that checks what mode you are in and does the proper thing accordingly?&lt;/p&gt;&#xA;" OwnerUserId="9087" LastActivityDate="2016-11-01T06:13:00.177" Title="M-. and M-, in evil-mode" Tags="|evil|cider|tern|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20780" PostTypeId="2" ParentId="20779" CreationDate="2016-03-06T02:03:19.573" Score="1" Body="&lt;p&gt;Just found out you can use set-key-for-mode.  Seems to be just what I wanted.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (evil-leader/set-key-for-mode 'clojure-mode &quot;.&quot; 'cider-find-dwim&#xA;                                                &quot;,&quot; 'cider-pop-back&#xA;                                                &quot;&amp;lt;SPC&amp;gt;j&quot; 'cider-jack-in             &#xA;                                                &quot;&amp;lt;SPC&amp;gt;t&quot; 'cider-test-run-test&#xA;                                                &quot;er&quot; 'cider-eval-region&#xA;                                                &quot;ee&quot; 'cider-eval-last-sexp&#xA;                                                &quot;ex&quot; 'cider-eval-last-sexp-and-replace&#xA;                                                &quot;eb&quot; 'cider-eval-buffer&#xA;                                                &quot;&amp;lt;SPC&amp;gt;d&quot; 'cider-doc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9087" LastActivityDate="2016-03-06T02:03:19.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20781" PostTypeId="1" AcceptedAnswerId="21530" CreationDate="2016-03-06T03:07:08.040" Score="1" ViewCount="398" Body="&lt;p&gt;I'm editting &lt;a href=&quot;https://cassandra.apache.org/doc/cql/CQL.html&quot; rel=&quot;nofollow&quot;&gt;CQL(Cassandra Query Language)&lt;/a&gt; on emacs and came to wonder if there's any dedicated major mode for editting CQLs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there such one?&lt;/p&gt;&#xA;" OwnerUserId="9371" LastActivityDate="2016-04-09T07:46:23.263" Title="Is there major mode for editting CQL?" Tags="|major-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20782" PostTypeId="1" AcceptedAnswerId="20796" CreationDate="2016-03-06T04:23:53.333" Score="1" ViewCount="490" Body="&lt;p&gt;I'd like to execute an evil-ex command from another command. Specifically, I'd like to do &lt;code&gt;:'&amp;lt;,'&amp;gt;move'&amp;gt;+1&lt;/code&gt; but when I do, it doesn't quite do the right thing. Instead of moving the text down, it moves it one line from the top of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun evil-visual-move-line-down ()&#xA;  (interactive)&#xA;  (evil-ex-call-command&#xA;   (evil-ex-range (evil-ex-line (evil-ex-marker &quot;&amp;lt;&quot;) nil)&#xA;                  (evil-ex-line (evil-ex-marker &quot;&amp;gt;&quot;) nil)) &quot;move&quot; &quot;'&amp;gt;+1&quot;))&#xA;(define-key evil-visual-state-map (kbd &quot;J&quot;) 'evil-visual-move-line-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10355" LastActivityDate="2016-04-05T21:34:32.240" Title="Programmatically execute evil-ex move command" Tags="|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20783" PostTypeId="1" AcceptedAnswerId="20788" CreationDate="2016-03-06T06:07:18.910" Score="3" ViewCount="2057" Body="&lt;p&gt;I like to show date and time in the mode-line. I currently have this in my .emacs file: &#xA;&lt;code&gt;&#xA;(setq display-time-day-and-date t)&#xA;(setq display-time-format &quot;%I:%M %p %e %b %y %_5j&quot;)&#xA;(display-time)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I remove the cpu load average which always appears at the end of the time string? I've tried setting the variable &lt;code&gt;format-time-string&lt;/code&gt; without any change in the load average display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've combed through the docs and also looked at &lt;code&gt;global-mode-string&lt;/code&gt; without help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As phils points out below, &lt;code&gt;(setq display-time-default-load-average nil)&lt;/code&gt; addresses the issue.&lt;/p&gt;&#xA;" OwnerUserId="11327" LastEditorUserId="11327" LastEditDate="2016-03-07T03:50:49.880" LastActivityDate="2016-03-07T03:50:49.880" Title="Remove load average from time string displayed in mode-line" Tags="|mode-line-format|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20784" PostTypeId="1" AcceptedAnswerId="20797" CreationDate="2016-03-06T06:14:06.690" Score="2" ViewCount="421" Body="&lt;p&gt;I want the commands &lt;code&gt;\largerpage&lt;/code&gt; and &lt;code&gt;\addlines&lt;/code&gt; to be displayed in red (&lt;code&gt;font-latex-match-warning-keywords&lt;/code&gt;) but cannot figure out how to do this. I found several posts, but non of this seems to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; \font-latex-warning-face&#xA;(setq font-latex-match-warning-keywords&#xA;    '(&#xA;        (&quot;addlines&quot; &quot;&quot;) &#xA;    )&#xA;)&#xA;&#xA; (font-lock-add-keywords nil '((&quot;\\(addlines\\) \\(largerpage\\)&quot; &#xA;                                 0&#xA;                                 'font-latex-warning-face)))&#xA;&#xA;(font-lock-add-keywords 'latex-mode '((&quot;addlines&quot; &#xA;                                            0&#xA;                                            'font-latex-warning-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using GNU Emacs 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="2440" LastEditorUserId="25" LastEditDate="2016-03-07T21:43:01.793" LastActivityDate="2016-03-07T21:43:01.793" Title="Adding a command to latex-match-warning-keywords for tex-mode" Tags="|syntax-highlighting|tex-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20785" PostTypeId="1" CreationDate="2016-03-06T06:32:51.790" Score="3" ViewCount="644" Body="&lt;p&gt;What is the preferred method of building (viewing) a custom agenda without modifying &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;?  I am hoping that there is a function like &lt;code&gt;org-agenda-list&lt;/code&gt; or &lt;code&gt;org-todo-list&lt;/code&gt; that accepts a custom agenda command definition like those that would be added to `org-agenda-custom-commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;strong&gt;Essentially just bypassing the org-agenda dispatcher / stored custom commands&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example taken from the org-mode manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  '((&quot;O&quot; &quot;Office block agenda&quot;&#xA;     ((agenda &quot;&quot; ((org-agenda-ndays 1)))&#xA;      (tags-todo &quot;+PRIORITY=\&quot;A\&quot;&quot;)&#xA;      (tags-todo &quot;computer|office|phone&quot;)&#xA;      (tags &quot;project+CATEGORY=\&quot;elephants\&quot;&quot;)&#xA;      (tags &quot;review&quot; ((org-agenda-files '(&quot;~/org/circuspeanuts.org&quot;))))&#xA;      (todo &quot;WAITING&quot;))&#xA;     ((org-agenda-compact-blocks t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that org-agenda concatenates the results of individual sub-commands (like &lt;code&gt;org-tags-view&lt;/code&gt;) internally.  What I'm looking to do is skip the traditional org-agenda dispatcher and construct the agenda directly from an arbitrary definition like (from the above):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((agenda &quot;&quot; ((org-agenda-ndays 1)))&#xA;  (tags-todo &quot;+PRIORITY=\&quot;A\&quot;&quot;)&#xA;  (tags-todo &quot;computer|office|phone&quot;)&#xA;  (tags &quot;project+CATEGORY=\&quot;elephants\&quot;&quot;)&#xA;  (tags &quot;review&quot; ((org-agenda-files '(&quot;~/org/circuspeanuts.org&quot;))))&#xA;  (todo &quot;WAITING&quot;))&#xA; ((org-agenda-compact-blocks t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The key being that the definition is subject only to the constraints for &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;.  It could simply be a &lt;code&gt;tags&lt;/code&gt; agenda or a multipart one like that shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I originally thought that the user-defined function type that can be added to &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; might be the trick, but it looks like it's treated as a match predicate (it's not really mentioned in the documentation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm asking because I'd like to view an agenda that has a dynamically-generated definition.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-03-08T18:52:13.690" LastActivityDate="2016-03-08T18:52:13.690" Title="View custom org agendas without first storing in org-agenda-custom-commands?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20786" PostTypeId="1" CreationDate="2016-03-06T06:38:02.223" Score="9" ViewCount="1455" Body="&lt;p&gt;A custom multi-section agenda view can get quite long.  Is there a built-in mechanism to fold or collapse sections like the standard outline view of org files to help with readability?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in minimally being able to collapse individual sections of a multi-section agenda.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-03-08T19:10:21.940" LastActivityDate="2023-10-03T11:14:29.393" Title="Fold/collapse sections in org agenda?" Tags="|org-mode|org-agenda|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20787" PostTypeId="2" ParentId="20731" CreationDate="2016-03-06T07:51:47.207" Score="4" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Find full directory path where emacs expects ditaa.jar to be located.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code is copied from ob-ditaa.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src elisp&#xA;(expand-file-name&#xA;             &quot;ditaa.jar&quot;&#xA;      (file-name-as-directory&#xA;            (expand-file-name&#xA;                &quot;scripts&quot;&#xA;               (file-name-as-directory&#xA;                  (expand-file-name&#xA;                      &quot;../contrib&quot;&#xA;                     (file-name-directory (org-find-library-dir &quot;org&quot;)))))))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This path in your setup may be different, so you should run the code above to check then adjust the instructions to meet your specific path. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: /usr/share/emacs/24.5/lisp/contrib/scripts/ditaa.jar&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Copy &lt;code&gt;ditaa.jar&lt;/code&gt; and &lt;code&gt;DitaaEps.jar&lt;/code&gt; into expected directory, e.g. &lt;code&gt;/usr/share/emacs/24.5/lisp/contrib/scripts&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Windows specific step&lt;/strong&gt; - Confirm that &lt;code&gt;ditaa.jar&lt;/code&gt; and &lt;code&gt;DitaaEps.jar&lt;/code&gt; are unblocked otherwise Windows OS will block execution.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cygwin specific step&lt;/strong&gt; - Create &lt;code&gt;call-ditaa.sh&lt;/code&gt; wrapper script.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The Oracle JSE for Windows expects Windows paths not Cygwin paths, so we needed to convert using &lt;code&gt;cygpath&lt;/code&gt; command. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :tangle yes :shebang #!/usr/bin/env bash&#xA;&#xA;    #&#xA;    # Convert to windows file paths.&#xA;    #&#xA;&#xA;    java $1 $2 &quot;$(cygpath -w $3)&quot; &quot;$(cygpath -w $4)&quot; &quot;$(cygpath -w $5)&quot;&#xA;&#xA;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cygwin specific Step&lt;/strong&gt; - Customize org-mode to use wrapper script instead calling java directly.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I suggest putting &lt;code&gt;call-ditaa.sh&lt;/code&gt; script in same directory as &lt;code&gt;ditaa.jar&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org Babel Ditaa Java Cmd: /usr/share/emacs/24.5/lisp/contrib/scripts/call-ditaa.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize org-mode to &lt;code&gt;Org Ditaa Jar Path&lt;/code&gt; to expected path, e.g. &lt;code&gt;/usr/share/emacs/24.5/lisp/contrib/scripts/ditaa.jar&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Apply &amp;amp; Save customization&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Test Updated &lt;code&gt;ditaa&lt;/code&gt; Settings&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src ditaa :file ./helloworld.png&#xA;+----------------+&#xA;| Hello World!!! |&#xA;|                |&#xA;+----------------+&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;[[file:./helloworld.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="388" LastActivityDate="2016-03-06T07:51:47.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20788" PostTypeId="2" ParentId="20783" CreationDate="2016-03-06T08:02:35.080" Score="7" Body="&lt;p&gt;See the variable &lt;code&gt;display-time-default-load-average&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. I found that very quickly using &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;d&lt;/kbd&gt; to search for &quot;load average&quot;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-03-06T08:02:35.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20790" PostTypeId="1" CreationDate="2016-03-06T10:14:23.280" Score="7" ViewCount="3176" Body="&lt;p&gt;I'm trying to set mu4e to use for both personal and work gmail accounts. I successfully configured &lt;code&gt;offlineimap&lt;/code&gt; and fetched the mail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I tried setting mu4e, and according documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the recommended way to deal with multiple accounts is through mu4e’s built-in Contexts system&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Okay. I set the context values like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; mu4e-contexts&#xA;        `( ,(make-mu4e-context&#xA;             :name &quot;home&quot;&#xA;             :match-func (lambda (msg) (when msg (mu4e-message-contact-field-matches msg :to &quot;personal-email@gmail.com&quot;)))&#xA;             :vars '((mu4e-maildir           . &quot;~/.mail/personal&quot;)&#xA;                     (mu4e-trash-folder      . &quot;/[Gmail].Trash&quot;)))&#xA;           ,(make-mu4e-context&#xA;             :name &quot;work&quot;&#xA;             :match-func (lambda (msg) (when msg (mu4e-message-contact-field-matches msg :to &quot;work-email@gmail.com&quot;)))&#xA;             :vars '((mu4e-maildir           . &quot;~/.mail/work&quot;)&#xA;                     (mu4e-trash-folder      . &quot;/[Gmail].Bin&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;of course there's more than that, I'm showing you only the relevant piece.&lt;/em&gt; So the problem I'm having is have to do with deleting messages. Sometimes it works, other times it doesn't. And when it fails it throws messages like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  error in process filter: Error 70: error moving /Users/ag/.mail/personal/[Gmail].INBOX/cur/1457242634_2.42730.C02MT2ZDFH05,U=27933,FMD5=4b4b643246a6b95b2136ea99e0e5f614:2,S &#xA;to /Users/ag/.mail/[Gmail].Trash/cur/1457242634_2.42730.C02MT2ZDFH05,U=27933,FMD5=4b4b643246a6b95b2136ea99e0e5f614:2,ST&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You see that it picked file in &lt;code&gt;personal&lt;/code&gt; dir and trying to move to &lt;code&gt;[Gmail].Trash&lt;/code&gt; in root of &lt;code&gt;maildir&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actual directory tree looks more like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    /Users/ag/.mail&#xA;    ├── personal&#xA;    │   ├── INBOX&#xA;    │   ├── [Gmail].All\ Mail&#xA;    │   ├── [Gmail].Important&#xA;    │   ├── [Gmail].Sent\ Mail&#xA;    │   ├── [Gmail].Spam&#xA;    │   ├── [Gmail].Trash&#xA;    └── work&#xA;        ├── INBOX&#xA;        ├── [Gmail].All\ Mail&#xA;        ├── [Gmail].Bin&#xA;        ├── [Gmail].Important&#xA;        ├── [Gmail].Sent\ Mail&#xA;        ├── [Gmail].Spam&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;mu4e-trash-folder&lt;/code&gt; values are different for &lt;code&gt;personal&lt;/code&gt; and &lt;code&gt;work&lt;/code&gt;. Honestly I dunno why - I set &lt;code&gt;synclabels = yes&lt;/code&gt; in my &lt;code&gt;offlineimaprc&lt;/code&gt; and that's what I got.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me, mu4e fails to set correct value of &lt;code&gt;mu4e-trash-folder&lt;/code&gt; during context switching. Can someone help me fix that? Show me a piece of config where different folders being used for different contexts? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="8992" LastEditDate="2016-03-06T10:21:52.287" LastActivityDate="2016-06-14T07:16:51.327" Title="mu4e folders for multiple accounts (contexts)" Tags="|spacemacs|email|mu4e|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20791" PostTypeId="1" AcceptedAnswerId="20794" CreationDate="2016-03-06T13:17:34.090" Score="3" ViewCount="808" Body="&lt;p&gt;How to make colored some part of comment? Let comment be &lt;code&gt;;; This is James Bond diary&lt;/code&gt;. And I want to make &quot;James Bond&quot; in green.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There will be only a few such strings and no places where it will be repeated, so it is OK to define exact symbols-insertion in dot-emacs file.&lt;/p&gt;&#xA;" OwnerUserId="9686" LastEditorUserId="9686" LastEditDate="2016-03-06T13:42:57.153" LastActivityDate="2016-03-06T18:10:19.700" Title="how to define color for part of a comment?" Tags="|customize|colors|comment|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20792" PostTypeId="1" AcceptedAnswerId="20853" CreationDate="2016-03-06T14:06:14.160" Score="2" ViewCount="714" Body="&lt;p&gt;After doing an some emacs packages updates, every time a new file is opened the buffer has whitespace mode turned on. I see red on all the whitespace at the start of lines. I've tried disabling whitespace-mode, but can't change this behavior from happening on every new buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there someway to make sure whitespace-mode is disabled on new buffers?&lt;/p&gt;&#xA;" OwnerUserId="11330" LastEditorUserId="105" LastEditDate="2016-03-06T16:57:18.343" LastActivityDate="2021-05-06T15:59:55.183" Title="disable whitespace mode on new buffers" Tags="|whitespace-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20794" PostTypeId="2" ParentId="20791" CreationDate="2016-03-06T17:43:30.103" Score="3" Body="&lt;p&gt;This answer is just a slight modification of Lindydancer's answer in the following link:  &lt;a href=&quot;https://emacs.stackexchange.com/a/20228/2287&quot;&gt;https://emacs.stackexchange.com/a/20228/2287&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has been modified to highlight a double-quoted name -- e.g., &lt;code&gt;;; Hello &quot;James Bond&quot;.&lt;/code&gt;  The major-mode is &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defface drobnbobn-face&#xA;  '((t (:background &quot;black&quot; :foreground &quot;red&quot;)))&#xA;&quot;Face for `drobnbobn-face'.&quot;)&#xA;(defvar drobnbobn-face 'drobnbobn-face)&#xA;&#xA;(defun my-highlight-symbol-font-lock-keywords-matcher (limit)&#xA;  &quot;Search for doubled-quoted things in comments.&#xA;Match group 0 is the entire construct, 1 the symbol.&quot;&#xA;  (let (res)&#xA;    (while&#xA;        (and (setq res (re-search-forward &quot;\&quot;\\([a-zA-Z0-9\s_-]+\\)\&quot;&quot; limit t))&#xA;             (not (nth 4 (syntax-ppss)))))  ; Continue, unless in a comment&#xA;    res))&#xA;&#xA;(defun my-highlight-symbol-activate ()&#xA;  &quot;Highlight double-quoted things in comments.&quot;&#xA;  (font-lock-add-keywords nil&#xA;                          '((my-highlight-symbol-font-lock-keywords-matcher&#xA;                             (1 drobnbobn-face prepend)))))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook #'my-highlight-symbol-activate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-06T18:10:19.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20795" PostTypeId="1" AcceptedAnswerId="20798" CreationDate="2016-03-06T18:08:23.427" Score="5" ViewCount="183" Body="&lt;p&gt;I added a custom auto-insert to my init file and reloaded the .emacs file with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x load-file&#xA;~/.emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then later I revised the auto-insert instruction and reloaded.  Now I get strange behaviour because I have evaluated two similar auto-inserts.  How can I have only the most recent evaluation of my .emacs init file? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a bit more detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'autoinsert&#xA;  '(define-auto-insert '(&quot;\.c\'&quot; . &quot;C \&quot;script\&quot; hack&quot;)&#xA;  '( &quot;stuff&quot; \n )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;reloaded .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'autoinsert&#xA;  '(define-auto-insert '(&quot;\.c\'&quot; . &quot;C \&quot;script\&quot; hack&quot;)&#xA;  '( &quot;other stuff&quot; \n )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;reloaded .emacs file&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then I had problems.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="97" LastEditDate="2016-03-06T19:17:23.723" LastActivityDate="2016-03-06T21:19:22.617" Title="how to I UN-evaluate .emacs init file without restarting emacs?" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20796" PostTypeId="2" ParentId="20782" CreationDate="2016-03-06T18:45:20.723" Score="0" Body="&lt;p&gt;From Frank Fischer himself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-visual-state-map &quot;J&quot;&#xA;  (concat &quot;:m '&amp;gt;+1&quot; (kbd &quot;RET&quot;) &quot;gv=gv&quot;))&#xA;(define-key evil-visual-state-map &quot;K&quot;&#xA;  (concat &quot;:m '&amp;lt;-2&quot; (kbd &quot;RET&quot;) &quot;gv=gv&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10355" LastActivityDate="2016-03-06T18:45:20.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20797" PostTypeId="2" ParentId="20784" CreationDate="2016-03-06T19:21:41.690" Score="3" Body="&lt;p&gt;I found the solution: &lt;a href=&quot;https://www.emacswiki.org/emacs/AddKeywords&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/AddKeywords&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'latex-mode&#xA;                        '((&quot;addlines&quot; . font-lock-warning-face)&#xA;                          (&quot;largerpage&quot; . font-lock-warning-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2440" LastActivityDate="2016-03-06T19:21:41.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20798" PostTypeId="2" ParentId="20795" CreationDate="2016-03-06T21:13:58.900" Score="7" Body="&lt;p&gt;&lt;em&gt;In general&lt;/em&gt;, you can't. Your init file is unconstrained in its ability to manipulate the Emacs environment, and there is no such thing as &lt;em&gt;un&lt;/em&gt;-evaluating the code you've run. You could write new code which specifically reverses the effects of some particular old code, but only on a case-by-case basis. Restarting Emacs is the only general 'reset switch' there is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;em&gt;this&lt;/em&gt; instance, however, you have only modified a user option, and those &lt;em&gt;do&lt;/em&gt; remember their original values. Type the following, and use the &quot;Revert...&quot; button to get rid of your unwanted customizations, and then &quot;Apply&quot; the changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-option&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;auto-insert-alist&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-03-06T21:19:22.617" LastActivityDate="2016-03-06T21:19:22.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20799" PostTypeId="1" CreationDate="2016-03-06T22:19:50.333" Score="6" ViewCount="1957" Body="&lt;p&gt;I take a lot of different MOOC and each class declare own deadline relative to some time zone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any Emacs mode that show date/time in buffer for several selected time zones in same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect that mode should understand usual time zone names like &lt;code&gt;UTC+2&lt;/code&gt;, &lt;code&gt;EET&lt;/code&gt;. See &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations&quot; rel=&quot;noreferrer&quot;&gt;https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also mode should display time in different formats (ISO and American AM/PM). I miss one deadline on half hour just because I didn't know what is &lt;code&gt;12:59 AM&lt;/code&gt; (I think it should be at noon but actually it on deep night).&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2022-04-01T17:06:42.497" Title="Show time in different time zones" Tags="|time-date|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20800" PostTypeId="2" ParentId="20768" CreationDate="2016-03-07T00:06:50.797" Score="4" Body="&lt;p&gt;Dired relies on the &lt;code&gt;ls&lt;/code&gt; command to do the listing and the sorting. The options for sorting are limited to what the &lt;code&gt;ls&lt;/code&gt; command can do (via switches added with &lt;code&gt;C-u s&lt;/code&gt; (&lt;code&gt;dired-sort-toggle-or-edit&lt;/code&gt;)). On ELPA, I can find packages that make it easier to change the &lt;code&gt;ls&lt;/code&gt; switches, but not packages that allow the sort order to be customized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that the only way to customize the sort order is to invoke your own program instead of &lt;code&gt;ls&lt;/code&gt;. The program invoked is determined by the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Contents-of-Directories.html#index-insert_002ddirectory_002dprogram&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;insert-directory-program&lt;/code&gt;&lt;/a&gt; variable. So you could set it locally to a wrapper that calls &lt;code&gt;ls&lt;/code&gt; and then sorts the result. Here's a shell wrapper you can use; put that in a script, make it executable (&lt;code&gt;M-x chmod&lt;/code&gt; with the permission &lt;code&gt;+x&lt;/code&gt;), and set &lt;code&gt;insert-directory-program&lt;/code&gt; to that locally.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;ls_output=$(ls &quot;$@&quot;)&#xA;nl='&#xA;'&#xA;echo &quot;${ls_output%%&quot;$nl&quot;*}&quot; # The total... line&#xA;ls_output=${ls_output#*&quot;$nl&quot;}&#xA;# Isolate the //DIRED stuff, which must go last&#xA;case &quot;$ls_output&quot; in&#xA;  *&quot;$nl//DIRED&quot;*)&#xA;    dired_stuff=&quot;//DIRED${ls_output##*&quot;$nl//DIRED&quot;}$nl&quot;&#xA;    ls_output=&quot;${ls_output%&quot;$nl//DIRED&quot;*}&quot;;;&#xA;  *) dired_stuff=;;&#xA;esac&#xA;# Now sort, ignoring the first 8 fields (metadata) and the first 33 characters of the 9th field&#xA;printf '%s\n' &quot;$ls_output&quot; | sort -k 9.34&#xA;printf '%s' &quot;$dired_stuff&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (make-local-variable 'insert-directory-program) RET&#xA;M-: (setq insert-directory-program &quot;/path/to/wrapper&quot;) RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-03-08T20:24:27.240" LastActivityDate="2016-03-08T20:24:27.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20801" PostTypeId="2" ParentId="18721" CreationDate="2016-03-07T01:06:37.750" Score="2" Body="&lt;p&gt;I had the same problem with &lt;code&gt;use-package&lt;/code&gt;, when I switched my config to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll open an issue right now suggesting an improvement in the documentation. Basically, it tells you that &lt;code&gt;:mode&lt;/code&gt; accepts a list, but it's a macro, so it's not entirely clear what the desired input is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GOOD: &lt;code&gt;(use-package enh-ruby-mode :mode &quot;\\.rb&quot; &quot;Guardfile&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BAD: &lt;code&gt;(use-package enh-ruby-mode :mode (&quot;\\.rb&quot; &quot;Guardfile&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2016-03-07T01:06:37.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20802" PostTypeId="1" AcceptedAnswerId="20803" CreationDate="2016-03-07T04:33:58.353" Score="3" ViewCount="1853" Body="&lt;p&gt;Tramp hangs for several minutes every time I launch Emacs, giving me these errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for bin using scp...&#xA;Tramp: Sending command `exec ssh  -e none bin'&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Timeout reached, see buffer `*tramp/scp bin*' for details&#xA;Tramp: Waiting for prompts from remote shell...failed&#xA;Tramp: Opening connection for bin using scp...failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My tramp debug:&#xA;&lt;a href=&quot;https://gist.github.com/2dc7672fb5aa22f06b53&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/2dc7672fb5aa22f06b53&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe it's related to this:&#xA;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/1000&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-helm/helm/issues/1000&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this: &#xA;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/3422#issuecomment-148919047&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syl20bnr/spacemacs/issues/3422#issuecomment-148919047&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I followed &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/FAQ.org#why-is-spacemacs-hanging-on-startup&quot; rel=&quot;nofollow&quot;&gt;the directions from the Spacemacs FAQ&lt;/a&gt;, which suggests this solution: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq tramp-ssh-controlmaster-options&#xA;   &quot;-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This didn't have any effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq tramp-ssh-controlmaster-options nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...but I got the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FAQ suggests that if the above doesn't work, you can try to put these settings directly in &lt;code&gt;~/.ssh/config&lt;/code&gt;:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host *  &#xA;ControlMaster auto  &#xA;ControlPath ~/.ssh/master -%r@%h:%p  &#xA;ControlPersist = no `  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I did this, which caused the error message to change to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp failed to connect.&#xA;Garbage at the end of the line. -%r@%h:%p  &#xA;If this happens repeatedly, try M-x tramp-cleanup-this-connection&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I did also try &lt;code&gt;tramp-cleanup-this-connection&lt;/code&gt; also, but it too had no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get Emacs to stop hanging on startup?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2016-03-07T15:31:10.083" LastActivityDate="2016-03-07T15:31:10.083" Title="Tramp: Waiting for prompts from remote shell... Sending command `exec ssh -e none bin'" Tags="|tramp|spacemacs|ssh|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20803" PostTypeId="2" ParentId="20802" CreationDate="2016-03-07T05:25:59.497" Score="4" Body="&lt;p&gt;The message &lt;code&gt;Sending command 'exec ssh  -e none bin'&lt;/code&gt; is a clue that an error is occurring when &lt;code&gt;exec-path-from-shell&lt;/code&gt; reads the path from the shell environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I figured this out, I checked my &lt;code&gt;.bashrc&lt;/code&gt; and found the offending line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;export PATH=&quot;$PATH:$HOME/.rvm/bin&quot; # Add RVM to PATH for scripting&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Killing this line solved the Emacs launch problem.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-03-07T05:25:59.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20804" PostTypeId="1" AcceptedAnswerId="20818" CreationDate="2016-03-07T06:00:51.323" Score="3" ViewCount="409" Body="&lt;p&gt;Cider offers very useful debugger for clojure code. Once you enter the debugger, you can step through it with keys like (n)ext, (o)ut, etc., &lt;a href=&quot;http://endlessparentheses.com/cider-debug-a-visual-interactive-debugger-for-clojure.html&quot; rel=&quot;nofollow&quot;&gt;like so&lt;/a&gt;. Using evil, the problem is that if I enter this debugger in normal-state, those keypresses will never make it to cider-debug, as evil interprets them according to its own keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to reconcile this would be to automatically enter insert state when &lt;code&gt;cider-interactive-eval&lt;/code&gt; (how you enter the debugger) is called &lt;em&gt;and&lt;/em&gt; &lt;code&gt;cider--debug-mode&lt;/code&gt; is active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how I imagine it would be, but it doesn't work yet. How can I improve this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice cider-interactive-eval (after enter-insert-for-dbg activate)&#xA;  &quot;When cider-eval takes you to a dbg session, enter insert-state.&quot;&#xA;  (when (and (bound-and-true-p cider--debug-mode)&#xA;             (eq evil-state 'normal))&#xA;    (evil-insert 1)))&#xA;&#xA;(ad-activate 'cider-interactive-eval)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2207" LastActivityDate="2016-03-07T14:16:07.987" Title="Defining advice for cider-interactive-eval for evil compatibility" Tags="|evil|advice|cider|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20805" PostTypeId="2" ParentId="18373" CreationDate="2016-03-07T06:27:04.703" Score="2" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mu4e-compose-complete-only-personal nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, make sure you always launch mu4e with &lt;code&gt;M-x mu4e&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-03-07T06:27:04.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20806" PostTypeId="2" ParentId="20784" CreationDate="2016-03-07T06:56:57.257" Score="0" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/auctex/manual/auctex.html#Fontification-of-macros&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; suggests to use the customization group &lt;code&gt;font-lock-keywords&lt;/code&gt;.  First visit a latex file to ensure AUCTeX is loaded, then do &lt;code&gt;M-x customize-group font-latex-keywords&lt;/code&gt;, navigate to &lt;strong&gt;Font Latex Match Warning Keywords&lt;/strong&gt;, &lt;em&gt;INS&lt;/em&gt;ert your keywords, apply &lt;em&gt;Save for future sessions&lt;/em&gt; and restart emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the customization group is unknown, do &lt;code&gt;M-: (require 'font-latex)&lt;/code&gt; first. (It's not clear to me when/why it's necessary.)&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-03-07T06:56:57.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20807" PostTypeId="1" AcceptedAnswerId="20816" CreationDate="2016-03-07T07:32:08.183" Score="1" ViewCount="433" Body="&lt;p&gt;I have Gnus set up to get mail via nnimap and it works fine, except for one small problem:  It shows all directories twice, once with a slash as the separator, once with a dot as the separator.  So I have a list that looks roughly like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;12: Test/INBOX/Stackexchange&#xA; *: Test.INBOX.Stackexchange&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The directories with a dot as the separator are not subscribed, so at least I don't always see them, but they also cannot be opened (Emacs says they do not exist) and so they're pretty annoying.  Is there a way to get rid of them?  Maybe I need to delete some sort of cache to fix the problem.  I tried gnus-group-clear-data-on-native-groups, but that didn't help.&lt;/p&gt;&#xA;" OwnerUserId="11281" LastEditorUserId="11281" LastEditDate="2016-03-07T11:00:49.467" LastActivityDate="2016-03-07T13:06:28.583" Title="Gnus shows all mail directories twice" Tags="|gnus|email|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20808" PostTypeId="1" CreationDate="2016-03-07T09:34:03.813" Score="1" ViewCount="409" Body="&lt;p&gt;&lt;code&gt;smerge-mode&lt;/code&gt; doesn't always get enabled for git merge conflicts. I think this happens when I visit a file using &lt;code&gt;emacsclient&lt;/code&gt; which is already opened in a buffer. Something (maybe magit?) is causing the file to be auto-reverted from the filesystem, so the conflict markers appear, but unfortunately the presence of the conflict markers do not cause &lt;code&gt;smerge-mode&lt;/code&gt; to be activated. How can I make &lt;code&gt;smerge-mode&lt;/code&gt; be activated as soon as conflict markers appear in the file, regardless of whether it's freshly opened or just reverted?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-03-07T10:02:23.700" Title="Enable smerge-mode for already opened file" Tags="|magit|emacsclient|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20809" PostTypeId="2" ParentId="20799" CreationDate="2016-03-07T09:56:43.703" Score="6" Body="&lt;p&gt;I start typing different keywords in &lt;kbd&gt;M-x&lt;/kbd&gt; and see completion to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;display-time-world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is mostly what I look for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;display-time-world is an interactive autoloaded compiled Lisp function in&#xA;`time.el'.&#xA;&#xA;(display-time-world)&#xA;&#xA;Enable updating display of times in various time zones.&#xA;`display-time-world-list' specifies the zones.&#xA;To turn off the world time display, go to that window and type `q'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately &lt;code&gt;display-time-world-list&lt;/code&gt; is an alist &lt;code&gt;(TIMEZONE LABEL)&lt;/code&gt; and TIMEZONE should be in a format &lt;strong&gt;supported by your system&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is &lt;code&gt;timezone-world-timezones&lt;/code&gt;. Docs for that variable correctly states that TZ abbreviations are ambiguous (same abbreviation was used for different offsets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc (lambda (el) (add-to-list 'display-time-world-list el))&#xA;      '((&quot;EET&quot; &quot;EET&quot;)&#xA;        (&quot;PST&quot; &quot;PST&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have first part of requested. Unfortunately &lt;code&gt;%p&lt;/code&gt; formater (for AM/PM) always empty.&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2016-03-07T09:56:43.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20810" PostTypeId="1" AcceptedAnswerId="32521" CreationDate="2016-03-07T09:59:15.543" Score="4" ViewCount="756" Body="&lt;p&gt;&lt;code&gt;(format-time-string &quot;%p&quot;)&lt;/code&gt; is empty in my Emacs. How I can format date in AM/PM format?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That answer second part of &lt;a href=&quot;https://emacs.stackexchange.com/questions/20799/show-time-in-different-time-zones&quot;&gt;Show time in different time zones&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(length (format-time-string &quot;%p&quot;))  ; is 0&#xA;(getenv &quot;LC_TIME&quot;)                  ; is &quot;en_DK.utf8&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My default preferences (in &lt;code&gt;.emacs&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-time-24hr-format t)&#xA;(setq display-time-day-and-date nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2021-05-19T16:41:27.633" Title="Get time in AM/PM format" Tags="|time-date|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20811" PostTypeId="2" ParentId="20808" CreationDate="2016-03-07T10:02:23.700" Score="6" Body="&lt;p&gt;This is what I have in my init file :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun smerge-try-smerge ()&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (when (re-search-forward &quot;^&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; &quot; nil t)&#xA;      (require 'smerge-mode)&#xA;      (smerge-mode 1))))&#xA;(add-hook 'find-file-hook 'smerge-try-smerge t)&#xA;(add-hook 'after-revert-hook 'smerge-try-smerge t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The defun is suggested in smerge documentation, as well as the first hook. The second hook I can't remember if I saw it somewhere or just thought it was good, but all in all it seems that it Works For Me©.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-03-07T10:02:23.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20812" PostTypeId="2" ParentId="20062" CreationDate="2016-03-07T10:33:19.867" Score="13" Body="&lt;p&gt;You need the latex file to use &lt;code&gt;\usepackage[utf8x]{inputenc}&lt;/code&gt; rather than the default &lt;code&gt;\usepackage[utf8]{inputenc}&lt;/code&gt;.  This works with standard (pdf)latex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For org export to generate this you have to set the variable &lt;code&gt;org-latex-inputenc-alist&lt;/code&gt; accordingly.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-inputenc-alist '((&quot;utf8&quot; . &quot;utf8x&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the variable to be defined, you may need to &lt;code&gt;(require 'ox-latex)&lt;/code&gt; first. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this does support only a limited set of math letters. Much more can be supported by including &lt;code&gt;\usepackage[mathletters]{ucs}&lt;/code&gt;. This has to appear before the &lt;code&gt;inputenc&lt;/code&gt; stuff, so you can't just use a &lt;code&gt;#+latex_header:&lt;/code&gt;.  A way to do that is to add it at head  of &lt;code&gt;org-latex-default-packages-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-default-packages-alist (cons '(&quot;mathletters&quot; &quot;ucs&quot; nil) org-latex-default-packages-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;ucs&lt;/code&gt; documentation (usually available through &lt;code&gt;texdoc ucs&lt;/code&gt;) warns about the &lt;code&gt;mathletters&lt;/code&gt; option:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This option is disabled by default, because using math greek in a normal text does not look good.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want those settings to apply only to the current file rather than globally, you can define them as &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;noreferrer&quot;&gt;file local variables&lt;/a&gt;. Add the following near the end of the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# org-latex-inputenc-alist: ((&quot;utf8&quot; . &quot;utf8x&quot;))&#xA;# eval: (setq org-latex-default-packages-alist (cons '(&quot;mathletters&quot; &quot;ucs&quot; nil) org-latex-default-packages-alist))&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eval&lt;/code&gt; is a pseudo variable allowing to execute lisp code when the file is loaded.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-03-07T21:26:56.470" LastActivityDate="2016-03-07T21:26:56.470" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20813" PostTypeId="1" AcceptedAnswerId="20814" CreationDate="2016-03-07T10:42:46.517" Score="8" ViewCount="159" Body="&lt;p&gt;this feature would go nicely with emmet mode.&#xA;With emmet-mode, I can expand &lt;pre&gt;li*3&lt;/pre&gt; to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&#xA;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&#xA;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;effortlessly.&lt;br&gt;&#xA;But after i enter something in between first tags. i have to scroll to the right position on moving to next line which is inconvinient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This lock i'm looking for would do awesome job.&lt;/p&gt;&#xA;" OwnerUserId="10160" LastActivityDate="2016-03-07T10:58:00.073" Title="automatically move to n-th character on line after each C-n or C-p" Tags="|key-bindings|html|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20814" PostTypeId="2" ParentId="20813" CreationDate="2016-03-07T10:58:00.073" Score="11" Body="&lt;p&gt;&lt;code&gt;set-goal-column&lt;/code&gt; might be what you're looking for :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set-goal-column is an interactive compiled Lisp function in&#xA;`simple.el'.&#xA;&#xA;It is bound to C-x C-n.&#xA;&#xA;(set-goal-column ARG)&#xA;&#xA;Set the current horizontal position as a goal for C-n and C-p.&#xA;Those commands will move to this position in the line moved to&#xA;rather than trying to keep the same horizontal position.&#xA;With a non-nil argument ARG, clears out the goal column&#xA;so that C-n and C-p resume vertical motion.&#xA;The goal column is stored in the variable `goal-column'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-03-07T10:58:00.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20815" PostTypeId="2" ParentId="20777" CreationDate="2016-03-07T11:38:58.167" Score="3" Body="&lt;p&gt;The &lt;code&gt;text&lt;/code&gt; variable is the old version of the contents of the field you're currently expanding/writing. I guess the name was too generic so in later versions of &lt;code&gt;yasnippet&lt;/code&gt; it was replaced with the variable &lt;code&gt;yas-text&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should try replacing it with that and see if that helps.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2016-03-07T11:38:58.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20816" PostTypeId="2" ParentId="20807" CreationDate="2016-03-07T12:16:40.443" Score="1" Body="&lt;p&gt;Test.INBOX.Stackexchange is the cached directory item stored at ~/.newsrc.eld.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could delete the ~/.newsrc.eld and re-subscribe the mail folders from the scratch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I don't like ~/.newsrc.eld. I prefer explicitly specify the folders I want to subscribe in ~/.gnus.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there is another solution by using gnus topics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Insert below code into ~/.gnus.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)&#xA;(eval-after-load 'gnus-topic&#xA;  '(progn&#xA;     (setq gnus-message-archive-group '((format-time-string &quot;sent.%Y&quot;)))&#xA;     (setq gnus-topic-topology '((&quot;Gnus&quot; visible)&#xA;                                 ((&quot;misc&quot; visible))&#xA;                                 ((&quot;hotmail&quot; visible nil nil))&#xA;                                 ((&quot;gmail&quot; visible nil nil))))&#xA;&#xA;     (setq gnus-topic-alist '((&quot;hotmail&quot; ; the key of topic&#xA;                               &quot;nnimap+hotmail:Inbox&quot;&#xA;                               &quot;nnimap+hotmail:Drafts&quot;&#xA;                               &quot;nnimap+hotmail:Sent&quot;)&#xA;                              (&quot;gmail&quot; ; the key of topic&#xA;                               &quot;INBOX&quot;&#xA;                               &quot;[Gmail]/Sent Mail&quot;&#xA;                               &quot;Drafts&quot;)&#xA;                              (&quot;misc&quot; ; the key of topic&#xA;                               &quot;nnfolder+archive:sent.2015-12&quot;&#xA;                               &quot;nnfolder+archive:sent.2016&quot;&#xA;                               &quot;nndraft:drafts&quot;)&#xA;                              (&quot;Gnus&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, you can check &lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-03-07T13:06:28.583" LastActivityDate="2016-03-07T13:06:28.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20818" PostTypeId="2" ParentId="20804" CreationDate="2016-03-07T13:32:47.340" Score="2" Body="&lt;p&gt;You should be able to add &lt;code&gt;cider--debug-mode&lt;/code&gt; to the &lt;code&gt;evil-insert-state-modes&lt;/code&gt; list so that you automatically enter insert state when the debugger is triggered.  I tried the following but it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'evil-insert-state-modes 'cider--debug-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't dug into why this isn't working, but for the time being I'm using the &lt;code&gt;cider--debug-mode-hook&lt;/code&gt; which is called whenever you enter or leave the mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cider-debug-toggle-insert-state ()&#xA;  (if cider--debug-mode    ;; Checks if you're entering the debugger   &#xA;      (evil-insert-state)  ;; If so, turn on evil-insert-state&#xA;    (evil-normal-state)))  ;; Otherwise, turn on normal-state&#xA;&#xA;&#xA;(add-hook 'cider--debug-mode-hook 'my-cider-debug-toggle-insert-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This assumes you want to be in normal-state whenever you exit the debugger.&lt;/p&gt;&#xA;" OwnerUserId="11339" LastEditorUserId="11339" LastEditDate="2016-03-07T14:16:07.987" LastActivityDate="2016-03-07T14:16:07.987" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20819" PostTypeId="2" ParentId="20810" CreationDate="2016-03-07T14:32:17.087" Score="0" Body="&lt;p&gt;Inside the emacs manual there is this page: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Time-Display-Format.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Time-Display-Format.html&lt;/a&gt;. that talks about changing the time format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code should do what you want if I understand correctly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-time-24hr-format nil)&#xA;(setq display-time-string-forms&#xA;      '(12-hours &quot;:&quot; minutes am-pm))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-03-07T14:32:17.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20820" PostTypeId="2" ParentId="13832" CreationDate="2016-03-07T14:36:53.930" Score="3" Body="&lt;p&gt;As @Ryan says, what you want is a clock table. The key is that the clock table can include several files. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 4 :scope (&quot;todo.org&quot;&quot;journal.org&quot;) :block today&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you C-c C-c on that line, it'll generate a clocktable that sums time spent across the files &quot;todo.org&quot; and &quot;journal.org&quot;. Use :maxlevel to specify how detailed you want the output to be (summarized at the top level of each file? summaries for each headline? Summaries for each headline at depth 2? Etc.). But you'll get a total summed across all files at the top regardless.&lt;/p&gt;&#xA;" OwnerUserId="8654" LastActivityDate="2016-03-07T14:36:53.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20821" PostTypeId="1" AcceptedAnswerId="20832" CreationDate="2016-03-07T15:01:57.957" Score="2" ViewCount="1220" Body="&lt;p&gt;I use org-mode agendas to sum effort for a given day, so I know how much slack time I have in my schedule. However, I often have sub-trees in tasks that have been assigned to assistants (with the keyword &quot;ASSIGNED&quot;). I don't want to count the effort estimates for those tasks in my own effort estimates. However, I do want to keep the effort estimates for those tasks, since I generate separate reports for each of my assistants so I know how much work I've assigned to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it is possible to have column-view exclude archived tasks. However, archiving ASSIGNED tasks seems like a bad work-around! I also know how to exclude ASSIGNED tasks from my agenda. However, doing so does not affect the total time estimates I get using column-view on my agenda. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a method of excluding tasks based on a tag or keyword from Effort estimates?&lt;/p&gt;&#xA;" OwnerUserId="8654" LastActivityDate="2016-03-07T22:55:00.460" Title="Sum efforts in org-mode agenda, excluding specific tags" Tags="|org-mode|org-agenda|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20823" PostTypeId="2" ParentId="20580" CreationDate="2016-03-07T15:25:26.323" Score="1" Body="&lt;p&gt;I had many griefs with helm-git-grep and helm-ack but I did like the basic interface.  I've since switched to helm-grepint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/kopoli/helm-grepint&quot; rel=&quot;nofollow&quot;&gt;https://github.com/kopoli/helm-grepint&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11340" LastActivityDate="2016-03-07T15:25:26.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20824" PostTypeId="1" AcceptedAnswerId="20827" CreationDate="2016-03-07T15:33:27.920" Score="3" ViewCount="1062" Body="&lt;p&gt;I am looking for Emacs password manager, and &lt;a href=&quot;https://github.com/leafac/org-password-manager/blob/master/README.md&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-password-manager&lt;/a&gt; looks nice for my needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I am trying to open created &lt;code&gt;passwords.org.gpg&lt;/code&gt; file (I use symmetric encryption for more ease), Emacs each time show me a pop-up windows, asking my passphrase. Is it possible to use &lt;strong&gt;minibuffer&lt;/strong&gt; for this (instead of pop-up window)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iW5Lz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iW5Lz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;(setq use-dialog-box nil)&lt;/code&gt; in my .emacs file, but it does not help in this case.&lt;/p&gt;&#xA;" OwnerUserId="9686" LastEditorUserId="9686" LastEditDate="2016-03-07T16:10:31.233" LastActivityDate="2016-03-07T16:36:18.793" Title="how to use minibuffer instead of pop-up window for GPG files?" Tags="|org-mode|minibuffer|gpg|passwords|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="20826" PostTypeId="2" ParentId="18003" CreationDate="2016-03-07T16:22:04.547" Score="12" Body="&lt;p&gt;Apparently it can be done, but prepare for a lot of work. (or don't, because I'm gonna tackle it some weekend ;-).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *orig-read* (symbol-function 'read))&#xA;&#xA;(defun read (&amp;amp;optional in)&#xA;  (message &quot;reading from %s&quot; load-file-name)&#xA;  (funcall *orig-read* in))&#xA;&#xA;(setq load-read-function (symbol-function 'read))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &quot;all&quot; that's left to do is to implement a complete Lisp reader which supports everything that Elisp does and whatever you want more.  I think this could be used to provide CL-like &lt;code&gt;defpackage&lt;/code&gt; and package internal symbols, as one example.  Also, a special syntax for regexps is something I badly want to do (or more exactly, some string syntax that doesn't interpret backslashes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: here's a proof-of-concept implementation: &lt;a href=&quot;https://github.com/mishoo/elisp-reader.el&quot;&gt;https://github.com/mishoo/elisp-reader.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="46" LastEditorUserId="46" LastEditDate="2016-03-10T17:04:42.507" LastActivityDate="2016-03-10T17:04:42.507" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20827" PostTypeId="2" ParentId="20824" CreationDate="2016-03-07T16:36:18.793" Score="3" Body="&lt;p&gt;I am moving my comment to an answer explaining how &lt;code&gt;pinentry-emacs&lt;/code&gt; works because of formatting &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pinentry-emacs&lt;/code&gt; stops the window from popping up that asks for your password and insteads asks for your password through the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is super poorly documented and took me a bit of time to set up. From what I can tell I placed&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(pinentry-start)&#xA;(defun pinentry-emacs (desc prompt ok error)&#xA;  (let ((str (read-passwd (concat (replace-regexp-in-string &quot;%22&quot; &quot;\&quot;&quot; (replace-regexp-in-string &quot;%0A&quot; &quot;\n&quot; desc)) prompt &quot;: &quot;))))&#xA;    str))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into my init file and then I put&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pinentry-program /home/--name--/.emacs.d/dotEmacs/pinentry/pinentry-emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into ~/.gnupg/gpg-agent.conf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that you may need to restart your computer, or just the gpg-agent.&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-03-07T16:36:18.793" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20829" PostTypeId="1" CreationDate="2016-03-07T18:30:19.250" Score="1" ViewCount="86" Body="&lt;p&gt;I want to use helm-for-files to search for files on remote hosts. It would be great if I could use /ssh: like in helm-find-files to display all hosts in my ssh config file. After choosing one host I'd like to have the recent file and locate helm display like in helm-for-files instead of a dirtree.&lt;/p&gt;&#xA;" OwnerUserId="11341" LastActivityDate="2016-03-07T18:30:19.250" Title="how to locate files with helm-for-files using ssh" Tags="|helm|helm-for-files|" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20830" PostTypeId="2" ParentId="16728" CreationDate="2016-03-07T20:33:35.497" Score="3" Body="&lt;p&gt;There is the &lt;code&gt;org-latex-image-default-option&lt;/code&gt; variable.  Would that do for you?  I'm using a shell function for a fixed image width, perhaps you can use something similar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;orgexp()&#xA;{&#xA;    emacs  --batch -l ~/.emacs --eval \&#xA;           &quot;(progn&#xA;             (setq org-latex-image-default-width \&quot;.4cm\&quot;&#xA;                   org-export-allow-bind-keywords t&#xA;                   org-confirm-babel-evaluate nil)&#xA;             (find-file \&quot;$1\&quot;) (org-latex-export-to-pdf))&quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I simply call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;orgexp myorgfile.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to get a PDF where all images are .4 cm wide.&lt;/p&gt;&#xA;" OwnerUserId="11342" LastActivityDate="2016-03-07T20:33:35.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20831" PostTypeId="2" ParentId="20778" CreationDate="2016-03-07T21:43:41.127" Score="2" Body="&lt;p&gt;You probably want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ivy-format-function 'ivy-format-function-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-03-07T21:43:41.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20832" PostTypeId="2" ParentId="20821" CreationDate="2016-03-07T22:55:00.460" Score="2" Body="&lt;p&gt;This is a somewhat clunky work-around that accomplishes the desired effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used org-trigger-hook to have a switch of a keyword to ASSIGNED trigger a function that changes the property &quot;Effort&quot; to &quot;ASSIGNED_EFFORT&quot;. For good measure, if the keyword gets switched from ASSIGNED to TODO, the opposite happens:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jkh/org-effort-to-assigned (change-plist)&#xA;  (let* ((type (plist-get change-plist :type))&#xA;     (pos (plist-get change-plist :position))&#xA; (from (plist-get change-plist :from))&#xA; (to (plist-get change-plist :to))&#xA; (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger!&#xA; trigger triggers tr p1 kwd)&#xA;  (when (equal to &quot;ASSIGNED&quot;)&#xA;  ;; OK, we just switched to ASSIGNED state.&#xA;       ;; Lets see if this entry has an Effort property.&#xA;       (setq myeffort (org-entry-get pos &quot;Effort&quot;))&#xA;       (org-entry-put pos &quot;ASSIGNED_EFFORT&quot; myeffort)&#xA;       (org-entry-delete pos &quot;Effort&quot;)&#xA;       )&#xA;  (when (and (equal from &quot;ASSIGNED&quot;) (equal to &quot;TODO&quot;))&#xA;    (setq myeffort (org-entry-get pos &quot;ASSIGNED_EFFORT&quot;))&#xA;    (org-entry-put pos &quot;Effort&quot; myeffort)&#xA;    (org-entry-delete pos &quot;ASSIGNED_EFFORT&quot;))&#xA;  ))&#xA;&#xA;(add-hook 'org-trigger-hook 'jkh/org-effort-to-assigned)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, any effort assigned to that task will not be included in any summary of &quot;Effort&quot;, for the obvious reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I still want to see how much time I've assigned to a particular assistant. This requires three steps. First, I make sure that a switch to &quot;ASSIGNED&quot; also adds the tag &quot;ASSIGNED&quot;, and switching from &quot;ASSIGNED&quot; to &quot;TODO&quot; removes it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-state-tags-triggers&#xA;   (quote ((&quot;ASSIGNED&quot; (&quot;ASSIGNED&quot; . t))&#xA;           (&quot;TODO&quot; (&quot;ASSIGNED&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also add a tag to any assigned task saying who it was assigned to (e.g., &quot;Smith&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I have a custom agenda function that lets me look at things assigned to Smith:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  (quote ((&quot;S&quot; &quot;Smith&quot;&#xA;   ((tags-todo &quot;pMu+ASSIGNED&quot;&#xA;     ((org-agenda-overriding-header &quot;Assigned: Smith&quot;)&#xA;      (org-tags-match-list-sublevels nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last thing I need to do is adjust column-view defaults:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-columns-default-format &quot;%60ITEM(Task) %6Effort(Estim){:} %8ASSIGNED_EFFORT(Assigned){:}  %6CLOCKSUM(Clock)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if I use column-view on an agenda, I see a sum of my effort and a sum of assigned effort. If I'm looking at the default agenda, assigned effort should be 0. If I'm looking at my &quot;Smith&quot; agenda, I should only see assigned effort, whereas my effort will be 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two problems with this solution, though:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Column view always shows &lt;em&gt;both&lt;/em&gt; Effort and ASSIGNED_EFFORT, even though only one will be relevant for any particular agends.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the task has sub-tasks, I need to ASSIGN every sub-task as well. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am pretty sure that the solution to #2 lies somewhere in the methods used by this &lt;a href=&quot;https://github.com/amluto/org-mode/blob/master/contrib/lisp/org-depend.el&quot; rel=&quot;nofollow&quot;&gt;org-depend.el&lt;/a&gt;. However, I don't see a way around #1.&lt;/p&gt;&#xA;" OwnerUserId="8654" LastActivityDate="2016-03-07T22:55:00.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20833" PostTypeId="1" AcceptedAnswerId="20869" CreationDate="2016-03-07T23:15:15.703" Score="15" ViewCount="5225" Body="&lt;p&gt;I want to work easier with archives in Emacs dired-mode. And I think that my needs are not only mine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want? Two things in Dired:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;z&lt;/code&gt; to zip file or dir on cursor (or all marked files/dirs if marks are exists); the name of new archive should be changeable (but if one file/dir selected than name should be the same);&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Z&lt;/code&gt; to unarchive any type of archives (zip or gz or tar) at cursor; by default content should be placed in new directory with the same name. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How can one achieve that?&lt;/p&gt;&#xA;" OwnerUserId="9686" LastEditorUserId="9686" LastEditDate="2016-03-09T00:36:11.080" LastActivityDate="2016-03-09T20:07:33.937" Title="how to deal with ZIP archives in DIRED?" Tags="|dired|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20834" PostTypeId="1" AcceptedAnswerId="20835" CreationDate="2016-03-08T00:24:24.753" Score="3" ViewCount="1240" Body="&lt;p&gt;How can I manage with Emacs &lt;code&gt;dired-mode&lt;/code&gt; colors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I want to make column with file's last modified time and date to be red-colored.&lt;/p&gt;&#xA;" OwnerUserId="9686" LastActivityDate="2016-03-08T00:44:07.990" Title="how to color column in Dired?" Tags="|dired|colors|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20835" PostTypeId="2" ParentId="20834" CreationDate="2016-03-08T00:42:59.703" Score="3" Body="&lt;p&gt;As is typical in Emacs, you set &lt;code&gt;font-lock-keywords&lt;/code&gt; in the particular mode, in this case &lt;code&gt;dired-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; does this extensively for Dired mode. You can customize the faces that it provides, if you just want to change a color etc. from the default value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it does not already color things the way you want, then look at the &lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/a&gt; code for setting &lt;code&gt;font-lock-keywords&lt;/code&gt;, for inspiration.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-08T00:42:59.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20837" PostTypeId="2" ParentId="20785" CreationDate="2016-03-08T01:11:47.573" Score="1" Body="&lt;p&gt;Depending on exactly what kind of agenda you're trying to build, &lt;code&gt;org-tags-view&lt;/code&gt; may do what you want:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-tags-view &amp;amp;optional TODO-ONLY MATCH)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Show all headlines for all ‘org-agenda-files’ matching a TAGS criterion.&#xA;  The prefix arg TODO-ONLY limits the search to TODO entries.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This basically what a &lt;code&gt;tags&lt;/code&gt; or &lt;code&gt;tags-todo&lt;/code&gt; type entry in &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; does.  The rest of the custom command definition is just variable/value pairs that are &lt;code&gt;let&lt;/code&gt; bound when you call &lt;code&gt;org-tags-view&lt;/code&gt;.  For example, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((org-agenda-overriding-header &quot;Test&quot;))&#xA;  (org-tags-view nil &quot;+test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will find anything labeled &lt;code&gt;test&lt;/code&gt; and set the title of the agenda to &quot;Test&quot;.  Any other &lt;code&gt;org-agneda-*&lt;/code&gt; variable can be set similarly.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-03-08T01:11:47.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20838" PostTypeId="2" ParentId="20786" CreationDate="2016-03-08T01:16:39.877" Score="3" Body="&lt;p&gt;There is no such mechanism for org agendas.  However, there is &lt;code&gt;org-sparse-tree&lt;/code&gt; (&lt;code&gt;C-c /&lt;/code&gt;) which will do and agenda-like search and instead of creating a new agenda buffer, will fold your org file to show only matching entries.  However, your searches will be more limited than with &lt;code&gt;org-agenda&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-03-08T01:16:39.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20839" PostTypeId="1" AcceptedAnswerId="20841" CreationDate="2016-03-08T01:28:26.227" Score="7" ViewCount="4971" Body="&lt;p&gt;I am writing a report in org mode and would like to show some code blocks as seen in so many tutorials. Here is some &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/how-to-use-Org-Babel-for-R.html&quot; rel=&quot;noreferrer&quot;&gt;official documentation&lt;/a&gt;, however it was written for org-mode 6.xx back in 2011.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried all variations that I have found on my search so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R&#xA;  for(i in 1:19){&#xA;      print(i)&#xA;  }&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC R :exports code&#xA;  for(i in 1:19){&#xA;      print(i)&#xA;  }&#xA;#+END_SRC&#xA;&#xA;&#xA;#+BEGIN_SRC R :exports both&#xA;  for(i in 1:19){&#xA;      print(i)&#xA;  }&#xA;#+END_SRC&#xA;&#xA;#+begin_src R&#xA;  for(i in 1:19){&#xA;      print(i)&#xA;  }&#xA;#+end_src&#xA;&#xA;#+begin_src R :exports code&#xA;  for(i in 1:19){&#xA;      print(i)&#xA;  }&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4HwK3.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4HwK3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel this must therefore be an issue with my setup. Here are (as far as I know) the relevant parts of my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-fontify-natively t)&#xA;&#xA;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((R . t)&#xA;   (latex . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have org-version 8.2.10 and all my LaTeX packages are up to date.&#xA;I also have things setup for python, which also doesn't work, further pointing to a faulty setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most promising help I could find was &lt;a href=&quot;https://github.com/erikriverson/org-mode-R-tutorial/blob/master/org-mode-R-tutorial.org&quot; rel=&quot;noreferrer&quot;&gt;this great tutorial&lt;/a&gt;, which creates an environment for using org with Latex/HTML exports and my language of choice &lt;strong&gt;R&lt;/strong&gt;. It is all written in an &lt;strong&gt;org&lt;/strong&gt; file, however I still can't find my problem. The code blocks there, if I generate the .tex and pdf files still do not show up correctly.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Edit 1: TeX buffer output&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; % Created 2016-03-08 Tue 08:18&#xA;&#xA; \documentclass{article}&#xA; \usepackage[utf8]{inputenc}&#xA; \usepackage[T1]{fontenc}&#xA; \usepackage{fixltx2e} &#xA; \usepackage{graphicx} &#xA; \usepackage{longtable}&#xA; \usepackage{float} &#xA; \usepackage{wrapfig} &#xA; \usepackage{rotating}&#xA; \usepackage[normalem]{ulem}&#xA; \usepackage{amsmath} &#xA; \usepackage{textcomp}&#xA; \usepackage{marvosym} &#xA; \usepackage{wasysym}&#xA; \usepackage{amssymb}&#xA; \usepackage{hyperref} &#xA; \tolerance=1000&#xA; \usepackage{minted}&#xA; \author{user name} &#xA; \date{\today}&#xA; \title{Org-mode and R: An Introduction} &#xA; \hypersetup{   pdfkeywords={},   pdfsubject={},  pdfcreator={Emacs 24.5.1 (Org mode 8.2.10)}} &#xA; \begin{document}&#xA;&#xA; \maketitle &#xA; \setcounter{tocdepth}{2}&#xA; \tableofcontents&#xA;&#xA; \lstset{language=R,label= ,caption= ,numbers=none} &#xA; \begin{lstlisting}&#xA; for(i in 1:19){&#xA;     print(i) } &#xA; \end{lstlisting}&#xA;&#xA; \lstset{language=R,label= ,caption= ,numbers=none} &#xA; \begin{lstlisting}&#xA; for(i in 1:19){&#xA;     print(i) } &#xA; \end{lstlisting}&#xA;&#xA; \lstset{language=R,label= ,caption= ,numbers=none} &#xA; \begin{lstlisting}&#xA; for(i in 1:19){&#xA;     print(i) } &#xA; \end{lstlisting}&#xA;&#xA; \lstset{language=R,label= ,caption= ,numbers=none}&#xA; \begin{lstlisting}&#xA; for(i in 1:19){&#xA;     print(i) } &#xA; \end{lstlisting}&#xA;&#xA; \lstset{language=R,label= ,caption= ,numbers=none} &#xA; \begin{lstlisting}&#xA; for(i in 1:19){&#xA;     print(i) } &#xA; \end{lstlisting} % Emacs 24.5.1 (Org mode 8.2.10) &#xA; \end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Edit 2: Output from the &lt;code&gt;*Org PDF LaTeX Output*&lt;/code&gt; buffer&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)&#xA; restricted \write18 enabled.&#xA;entering extended mode&#xA;&#xA;(/path/to/this/file.tex&#xA;LaTeX2e &amp;lt;2016/02/01&amp;gt;&#xA;Babel &amp;lt;3.9q&amp;gt; and hyphenation patterns for 81 language(s) loaded.&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls&#xA;Document Class: article 2014/09/29 v1.4h Standard LaTeX document class&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/inputenc.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/utf8.def&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/t1enc.dfu)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ot1enc.dfu)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/omsenc.dfu)))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/fontenc.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/t1enc.def))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/fixltx2e.sty&#xA;&#xA;Package fixltx2e Warning: fixltx2e is not required with releases after 2015&#xA;(fixltx2e)                All fixes are now in the LaTeX kernel.&#xA;(fixltx2e)                See the latexrelease package for details.&#xA;&#xA;) (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphicx.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphics.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/trig.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/graphics.cfg)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/pdftex-def/pdftex.def&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/infwarerr.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/longtable.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/float/float.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/wrapfig/wrapfig.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/rotating/rotating.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ifthen.sty))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/ulem/ulem.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty&#xA;For additional information on amsmath, use the `?' option.&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/textcomp.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ts1enc.def&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ts1enc.dfu)))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/marvosym/marvosym.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/wasysym/wasysym.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amssymb.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/amsfonts.sty))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hyperref.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/auxhook.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/pd1enc.def)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/hyperref.cfg)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/url/url.sty))&#xA;&#xA;Package hyperref Message: Driver (autodetected): hpdftex.&#xA;&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hpdftex.def&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/minted/minted.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty&#xA;Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix &#xA;&amp;lt;2008/02/07&amp;gt; (tvz))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/calc.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/ifplatform/ifplatform.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/catchfile.sty)&#xA;&#xA;Package ifplatform Warning: &#xA;    shell escape is disabled, so I can only detect \ifwindows.&#xA;&#xA;) (/usr/local/texlive/2015/texmf-dist/tex/latex/etoolbox/etoolbox.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/xstring/xstring.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/xstring/xstring.tex))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/lineno/lineno.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/t1cmtt.fd))&#xA;&#xA;! Package minted Error: You must invoke LaTeX with the -shell-escape flag.&#xA;&#xA;See the minted package documentation for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.20 \author&#xA;            {user name}&#xA;&#xA;! Package minted Error: Missing Pygments output; \inputminted was&#xA;probably given a file that does not exist--otherwise, you may need &#xA;the outputdir package option, or may be using an incompatible build tool.&#xA;&#xA;See the minted package documentation for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.20 \author&#xA;            {user name}^^M&#xA;&#xA;! Package minted Error: You must have `pygmentize' installed to use this packag&#xA;e.&#xA;&#xA;See the minted package documentation for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.27 \begin{document}&#xA;&#xA;(.//delete_this.aux)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ts1cmr.fd)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/context/base/supp-pdf.mkii&#xA;[Loading MPS to PDF converter (version 2006.09.02).]&#xA;) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/grfext.sty)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/nameref.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))&#xA;(.//delete_this.out) (.//delete_this.out)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/xcolor/xcolor.sty&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/color.cfg))&#xA;&#xA;! Package minted Error: Missing Pygments output; \inputminted was&#xA;probably given a file that does not exist--otherwise, you may need &#xA;the outputdir package option, or may be using an incompatible build tool.&#xA;&#xA;See the minted package documentation for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.27 \begin{document}&#xA;                     ^^M&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/wasysym/uwasy.fd)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsa.fd)&#xA;(/usr/local/texlive/2015/texmf-dist/tex/latex/amsfonts/umsb.fd)&#xA;(.//delete_this.toc)&#xA;! Undefined control sequence.&#xA;l.33 \lstset&#xA;            {language=R,label= ,caption= ,numbers=none}&#xA;&#xA;! LaTeX Error: Environment lstlisting undefined.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.34 \begin{lstlisting}&#xA;&#xA;&#xA;! LaTeX Error: \begin{document} ended by \end{lstlisting}.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.38 \end{lstlisting}&#xA;&#xA;! Undefined control sequence.&#xA;l.40 \lstset&#xA;            {language=R,label= ,caption= ,numbers=none}&#xA;&#xA;! LaTeX Error: Environment lstlisting undefined.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.41 \begin{lstlisting}&#xA;&#xA;&#xA;! LaTeX Error: \begin{document} ended by \end{lstlisting}.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.45 \end{lstlisting}&#xA;&#xA;! Undefined control sequence.&#xA;l.48 \lstset&#xA;            {language=R,label= ,caption= ,numbers=none}&#xA;&#xA;! LaTeX Error: Environment lstlisting undefined.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.49 \begin{lstlisting}&#xA;&#xA;&#xA;! LaTeX Error: \begin{document} ended by \end{lstlisting}.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.53 \end{lstlisting}&#xA;&#xA;! Undefined control sequence.&#xA;l.55 \lstset&#xA;            {language=R,label= ,caption= ,numbers=none}&#xA;&#xA;! LaTeX Error: Environment lstlisting undefined.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.56 \begin{lstlisting}&#xA;&#xA;&#xA;! LaTeX Error: \begin{document} ended by \end{lstlisting}.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.60 \end{lstlisting}&#xA;&#xA;! Undefined control sequence.&#xA;l.62 \lstset&#xA;            {language=R,label= ,caption= ,numbers=none}&#xA;&#xA;! LaTeX Error: Environment lstlisting undefined.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.63 \begin{lstlisting}&#xA;&#xA;&#xA;! LaTeX Error: \begin{document} ended by \end{lstlisting}.&#xA;&#xA;See the LaTeX manual or LaTeX Companion for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.67 \end{lstlisting}&#xA;&#xA;[1{/usr/local/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]&#xA;(.//delete_this.aux) )&#xA;(see the transcript file for additional information){/usr/local/texlive/2015/te&#xA;xmf-dist/fonts/enc/dvips/cm-super/cm-super-t1.enc}&amp;lt;/usr/local/texlive/2015/texm&#xA;f-dist/fonts/type1/public/cm-super/sfbx1440.pfb&amp;gt;&amp;lt;/usr/local/texlive/2015/texmf-&#xA;dist/fonts/type1/public/cm-super/sfrm1000.pfb&amp;gt;&amp;lt;/usr/local/texlive/2015/texmf-di&#xA;st/fonts/type1/public/cm-super/sfrm1200.pfb&amp;gt;&amp;lt;/usr/local/texlive/2015/texmf-dist&#xA;/fonts/type1/public/cm-super/sfrm1728.pfb&amp;gt;&#xA;Output written on .//delete_this.pdf (1 page, 50965 bytes).&#xA;Transcript written on .//delete_this.log.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="253" LastEditDate="2016-03-08T10:40:06.680" LastActivityDate="2016-03-09T07:10:38.680" Title="Exporting code blocks to pdf via LaTeX" Tags="|org-mode|org-export|org-babel|r|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20840" PostTypeId="1" CreationDate="2016-03-08T01:38:54.157" Score="2" ViewCount="248" Body="&lt;p&gt;While working on a presentation in &lt;code&gt;org-beamer-mode&lt;/code&gt; today I accidentally hit some unintended sequence of keys. This produced an outline view of the presentation, where each item in the outline had numbers in parenthesis that appeared to represent the number of slides under that heading. I tried &lt;code&gt;view-lossage&lt;/code&gt; as soon as I realized what I had done, but still could not figure it out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What did I do?&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2016-03-08T01:38:54.157" Title="How to view outline with slide counts in org-beamer-mode?" Tags="|org-mode|beamer|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20841" PostTypeId="2" ParentId="20839" CreationDate="2016-03-08T10:56:06.507" Score="11" Body="&lt;p&gt;You have to tell org-mode to actually &lt;em&gt;use&lt;/em&gt; the &lt;code&gt;listings&lt;/code&gt; or &lt;code&gt;listingsutf8&lt;/code&gt; package in your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;listingsutf8&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you'll have a line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\usepackage{listings}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the exported TeX file and the pdfLaTeX run will give you the result you want to have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addition: For minted, I get a satisfying result when using the following &lt;code&gt;.emacs&lt;/code&gt; (using information from &lt;a href=&quot;https://stackoverflow.com/a/21007117/6024971&quot;&gt;https://stackoverflow.com/a/21007117/6024971&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;(require 'ox-latex)&#xA;(add-to-list 'org-latex-packages-alist '(&quot;&quot; &quot;minted&quot;))&#xA;(setq org-latex-listings 'minted) &#xA;&#xA;(setq org-latex-pdf-process&#xA;      '(&quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;))&#xA;&#xA;(setq org-src-fontify-natively t)&#xA;&#xA;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((R . t)&#xA;   (latex . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, the triple call to pdflatex is to get all the references (including TOC) in the document right.&lt;/p&gt;&#xA;" OwnerUserId="11342" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-03-09T07:10:38.680" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="20842" PostTypeId="1" AcceptedAnswerId="20846" CreationDate="2016-03-08T12:29:33.857" Score="13" ViewCount="4083" Body="&lt;p&gt;I'm having difficulty getting org-babel to evaluate this block of code with &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;emacs v24.5&lt;br/&gt;&#xA;  node v5.0.0&lt;br/&gt;&#xA;  babel-node v.6.6.5&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt; #+BEGIN_SRC js :cmd &quot;babel-node&quot;&#xA;&#xA;   let arr = [1, 2]; &#xA;   let [x, y] = arr;&#xA;&#xA;   console.log(x);&#xA;   console.log(y);&#xA;&#xA; #+END_SRC&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br /&gt;&#xA;The output looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;/tmp/babel-3700Vaq/js-script-37003RN:2&lt;br /&gt;&#xA;let arr = [1, 2];&#xA;^^^&#xA;&#xA;SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode&#xA;    at exports.runInThisContext (vm.js:53:16)&#xA;    at Module._compile (module.js:404:25)&#xA;    at loader (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:126:5)&#xA;    at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:136:7)&#xA;    at Module.load (module.js:356:32)&#xA;    at Function.Module._load (module.js:311:12)&#xA;    at Function.Module.runMain (module.js:457:10)&#xA;    at /usr/local/lib/node_modules/babel-cli/lib/_babel-node.js:161:27&#xA;    at Object. (/usr/local/lib/node_modules/babel-cli/lib/_babel-node.js:162:7)&#xA;    at Module._compile (module.js:425:26)*&#xA;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this source block seems fine&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA; #+BEGIN_SRC js :cmd &quot;babel-node&quot;&#xA; const numbers = [10,20,30,50];&#xA; const multiplyBy10 = numbers.map(a =&gt; a * 10);&#xA; console.log(multiplyBy10);&#xA;&#xA; #+END_SRC&#xA;&#xA; #+RESULTS:&#xA; | 100 | 200 | 300 | 500 |&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit:&#xA;  Added self executing function with &quot;use strict&quot; &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&#xA;#+BEGIN_SRC js :cmd &quot;babel-node&quot; &#xA;(function xy() {&#xA;&quot;use strict&quot;;&#xA;let arr = [1, 2];&#xA;let [x, y] = arr;&#xA;console.log(x);&#xA;console.log(y);&#xA;})()&#xA;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;/tmp/babel-13529OHt/js-script-13529MVq:6&#xA;    let [x, y] = arr;&#xA;        ^&#xA;&#xA;SyntaxError: Unexpected token [&#xA;    at exports.runInThisContext (vm.js:53:16)&#xA;    at Module._compile (module.js:404:25)&#xA;    at loader (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:126:5)&#xA;    at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:136:7)&#xA;    at Module.load (module.js:356:32)&#xA;    at Function.Module._load (module.js:311:12)&#xA;    at Function.Module.runMain (module.js:457:10)&#xA;    at /usr/local/lib/node_modules/babel-cli/lib/_babel-node.js:161:27&#xA;    at Object. (/usr/local/lib/node_modules/babel-cli/lib/_babel-node.js:162:7)&#xA;    at Module._compile (module.js:425:26)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit: Thanks to @ebpa i've managed to solve it with&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;npm install -g babel-preset-es2015&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br /&gt;&#xA;This is the output i'm getting after evaluating the default source block, which doesn't have a self executing function wrapper. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372&#xA;          throw new Error(&quot;Couldn't find preset &quot; + JSON.stringify(val) + &quot; relative to directory &quot; + JSON.stringify(dirname));&#xA;          ^&#xA;&#xA;Error: Couldn't find preset &quot;es2015&quot; relative to directory &quot;/tmp/babel-270346ez&quot;&#xA;    at /usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:372:17&#xA;    at Array.map (native)&#xA;    at OptionManager.resolvePresets (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)&#xA;    at OptionManager.mergePresets (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)&#xA;    at OptionManager.mergeOptions (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)&#xA;    at OptionManager.init (/usr/local/lib/node_modules/babel-cli/node_modules/babel-core/lib/transformation/file/options/option-manager.js:465:10)&#xA;    at compile (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:81:45)&#xA;    at loader (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:126:14)&#xA;    at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:136:7)&#xA;    at Module.load (module.js:356:32)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit: Fire up a terminal and ran babel-node &#xA;  &lt;br /&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&#xA;&gt; require('babel-preset-es2015');&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;Error: Cannot find module 'babel-preset-es2015'&#xA;    at Function.Module._resolveFilename (module.js:337:15)&#xA;    at Function.Module._load (module.js:287:25)&#xA;    at Module.require (module.js:366:17)&#xA;    at require (module.js:385:17)&#xA;    at repl:1:1&#xA;    at Object.exports.runInThisContext (vm.js:54:17)&#xA;    at _eval (/home/johnwind/.nvm/versions/node/v5.0.0/lib/node_modules/babel-cli/lib/_babel-node.js:102:26)&#xA;    at REPLServer.replEval (/home/johnwind/.nvm/versions/node/v5.0.0/lib/node_modules/babel-cli/lib/_babel-node.js:187:14)&#xA;    at bound (domain.js:280:14)&#xA;    at REPLServer.runBound [as eval] (domain.js:293:12)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit: A follow up to getting it up and running&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://rwx.io/posts/org-with-babel-node-updated/&quot; rel=&quot;noreferrer&quot;&gt;http://rwx.io/posts/org-with-babel-node-updated/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit: This post gave me some clue to this piece of to puzzle&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;https://phabricator.babeljs.io/T6723&quot; rel=&quot;noreferrer&quot;&gt;https://phabricator.babeljs.io/T6723&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://discuss.babeljs.io/t/error-parsing-jsx-with-global-installation-babel-preset-react/59/6&quot; rel=&quot;noreferrer&quot;&gt;http://discuss.babeljs.io/t/error-parsing-jsx-with-global-installation-babel-preset-react/59/6&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h2&gt;Edit: Finally got it working by installing a local copy&lt;/h2&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&#xA;$ mkdir local_babel&#xA;$ cd local_babel&#xA;$ npm init&#xA;$ npm install --save-dev babel-cli&#xA;$ npm install --save-dev babel-core&#xA;$ npm install --save-dev babel-preset-es2015&#xA;$ npm install --save-dev babel-preset-stage-0&#xA;$ npm install --save-dev babel-preset-stage-1&#xA;$ npm install --save-dev babel-preset-stage-2&#xA;$ npm install --save-dev babel-preset-stage-3&#xA;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;created a softlink for babel-node&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;$ cd /usr/local/bin&#xA;$ ln -s ~/local_babel/node_modules/babel-cli/bin/babel-node.js org-babel-node&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;.zshrc&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;export npm_config_prefix=$HOME/.node_modules&#xA;export PATH=$PATH:$HOME/.node_modules/bin&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Added this to my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(setenv &quot;NODE_PATH&quot;&#xA;    (concat&#xA;        &quot;/home/johnwind/local_babel/node_modules&quot; &quot;:&quot;&#xA;         (getenv &quot;NODE_PATH&quot;)&#xA;    )&#xA;)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&#xA;output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;#+BEGIN_SRC js :cmd &quot;org-babel-node --presets es2015&quot; &#xA;&#xA;let arr = [1, 2];&#xA;let [x, y] = arr;&#xA;&#xA;console.log(x);&#xA;console.log(y);&#xA;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 1&#xA;: 2&#xA;: undefined&#xA;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&#xA;For now I have both local and global copy of babel-cli, babel-core, babel-preset-es2015 . Which still couldn't quite wrap my head around this as it's kind of a waste of resources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it works.  &lt;/p&gt;&#xA;" OwnerUserId="11348" LastEditorUserId="13580" LastEditDate="2019-08-19T17:41:36.917" LastActivityDate="2019-08-19T17:41:36.917" Title="How to get org-babel source block working with ES6-7?" Tags="|org-babel|javascript|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="20843" PostTypeId="1" CreationDate="2016-03-08T19:48:23.433" Score="2" ViewCount="195" Body="&lt;p&gt;I'm curious if it's possible to define a yasnippet completion field with a default value specified to initially edit/modify the value rather than replace it.  For this elementary example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${1:defaultValue}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On completion when the point is at the beginning of the field anything typed will replace the value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; → &lt;code&gt;foo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moving the point allows modification of the default value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;→&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; → &lt;code&gt;dfooefaultValue&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For those about to check, moving it back results in the former behavior):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;→&lt;/kbd&gt;&lt;kbd&gt;←&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; → &lt;code&gt;foo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping to retain this observed behavior in general, but be able to change the behavior in an individual field.  So that this snippet (with some modification to the snippet definition of the second field) would yield the below behavior.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${1:thing} ${2:else}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;A&lt;/kbd&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;&lt;kbd&gt;B&lt;/kbd&gt; → &lt;code&gt;A Belse&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just a minimal example.  It would make sense in this case to simply move the default value outside the field like &lt;code&gt;${1:thing} $2else&lt;/code&gt;), but doing so doesn't allow modification of that value during completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once part of the contents of a field has been modified it is possible to modify from the beginning of that field.  I'm thinking this is the hack that is going to be necessary.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${1:defaultValue}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;→&lt;/kbd&gt;&lt;kbd&gt;A&lt;/kbd&gt;&lt;kbd&gt;Bksp&lt;/kbd&gt;&lt;kbd&gt;←&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; → &lt;code&gt;foodefaultValue&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The desired behavior would be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; → &lt;code&gt;foodefaultValue&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-03-08T19:48:23.433" Title="Set a field in yasnippet to edit/modify rather than replace default contents" Tags="|completion|yasnippet|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20844" PostTypeId="1" CreationDate="2016-03-08T20:11:04.570" Score="2" ViewCount="161" Body="&lt;p&gt;In Ubuntu, when I make change to directories or files outside emacs, it seems that emacs doesn't get the update. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, C-x C-f can't track the current directory which was just moved elsewhere outside emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example: in a shell created by C-x shell, the autocompletion of directory or file name doesn't work, if the current directory has been moved elsewhere outside emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I make emacs get the update made outside emacs? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2016-03-09T11:15:17.077" Title="Make emacs aware of updates to files and directories?" Tags="|linux|directories|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20845" PostTypeId="2" ParentId="14076" CreationDate="2016-03-08T20:16:33.933" Score="0" Body="&lt;p&gt;@xuchunyang helped me out on the github issue I filed. Here is the solution for posterity:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-buffer-switch-to-new-window (_candidate)&#xA;  &quot;Display buffers in new windows.&quot;&#xA;  ;; Select the bottom right window&#xA;  (require 'winner)&#xA;  (select-window (car (last (winner-sorted-window-list))))&#xA;  ;; Display buffers in new windows&#xA;  (dolist (buf (helm-marked-candidates))&#xA;    (select-window (split-window-right))&#xA;    (switch-to-buffer buf))&#xA;  ;; Adjust size of windows&#xA;  (balance-windows))&#xA;&#xA;(add-to-list 'helm-type-buffer-actions&#xA;             '(&quot;Display buffer(s) in new window(s) `M-o'&quot; .&#xA;               helm-buffer-switch-new-window) 'append)&#xA;&#xA;(defun helm-buffer-switch-new-window ()&#xA;  (interactive)&#xA;  (with-helm-alive-p&#xA;    (helm-quit-and-execute-action 'helm-buffer-switch-to-new-window)))&#xA;&#xA;(define-key helm-buffer-map (kbd &quot;M-o&quot;) #'helm-buffer-switch-new-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-03-08T20:16:33.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20846" PostTypeId="2" ParentId="20842" CreationDate="2016-03-08T20:27:35.427" Score="6" Body="&lt;p&gt;This is an issue with the Babel 6 transition to using plugins exclusively.  You need to install the es2015 preset plugin:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;npm install -g babel-preset-es2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and also require it in the invocation command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC js :cmd &quot;babel-node --presets es2015&quot;&#xA;let arr = [1, 2];&#xA;let [x, y] = arr;&#xA;&#xA;console.log(x);&#xA;console.log(y);&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-03-08T20:27:35.427" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20847" PostTypeId="1" AcceptedAnswerId="20848" CreationDate="2016-03-08T21:21:11.487" Score="4" ViewCount="41" Body="&lt;p&gt;How can I change the behavior of a function when the point is in an org-table? Is there a function like &quot;table-p&quot; that returns true when the point is in a table (like region-active-p returns true when a region is selected)?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-03-08T21:44:19.607" Title="Change the behavior of a function when the point is in a table" Tags="|org-table|functions|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20848" PostTypeId="2" ParentId="20847" CreationDate="2016-03-08T21:44:19.607" Score="4" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;org-at-table-p is a compiled Lisp function in ‘org.el’.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(org-at-table-p &amp;amp;optional TABLE-TYPE)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Return t if the cursor is inside an org-type table.&#xA;If TABLE-TYPE is non-nil, also check for table.el-type tables.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="160" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-08T21:44:19.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20849" PostTypeId="1" CreationDate="2016-03-08T21:52:06.060" Score="11" ViewCount="203" Body="&lt;p&gt;How can I avoid displaying &quot;=&gt;&quot; when a field is clipped in org-table? Those arrows dominate some narrow cells, and I can view the full field in a tool-tip window anyway, so I'd like to get rid of them.&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2018-11-22T21:03:20.763" Title="Avoid displaying &quot;=&gt;&quot; when a field is clipped in org-table?" Tags="|org-table|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20850" PostTypeId="1" AcceptedAnswerId="20871" CreationDate="2016-03-08T22:02:29.333" Score="2" ViewCount="103" Body="&lt;p&gt;I learned that I can edit the whole clipped field in a new window with org-table-edit-field, but it's kind of annoying to open a new window each time I want to edit each field. How can I edit those clipped fields by expanding them temporarily instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. expand this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|&amp;lt;3&amp;gt;|&amp;lt;3&amp;gt;|&#xA;|a=&amp;gt;|c=&amp;gt;|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|&amp;lt;3&amp;gt;|&amp;lt;3&amp;gt;|&#xA;|abra|cadabra|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-03-09T22:34:20.570" Title="Expand an org-table with clipped fields?" Tags="|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20851" PostTypeId="2" ParentId="20786" CreationDate="2016-03-08T22:09:42.033" Score="1" Body="&lt;p&gt;As erikstokes said, and as much as I know, you can not fold it (*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can - and probably should, given your apparent needs - filter by &lt;code&gt;:tag:&lt;/code&gt; (&lt;code&gt;/&lt;/code&gt;), or by &lt;code&gt;:CATEGORY:&lt;/code&gt; (&lt;code&gt;&amp;lt;&lt;/code&gt;), or by some of a few more criteria. Check it at WORG, org-mode's wiki: &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/agenda-filters.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/agenda-filters.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) well... you probably can code something, after all, it is Emacs, right? But I assume that is not the point here :-)&lt;/p&gt;&#xA;" OwnerUserId="2637" LastActivityDate="2016-03-08T22:09:42.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20853" PostTypeId="2" ParentId="20792" CreationDate="2016-03-08T22:22:21.910" Score="3" Body="&lt;p&gt;Prelude's own &lt;em&gt;prelude-whitespace&lt;/em&gt; was causing the behavior. You can disable it using:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-group RET prelude&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Set &lt;em&gt;Prelude Whitespace&lt;/em&gt; (&lt;code&gt;prelude-whitespace&lt;/code&gt;) to off/nil (default is on).&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;According to the &lt;a href=&quot;https://prelude.emacsredux.com/en/latest/configuration/#disabling-whitespace-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;prelude docs&lt;/a&gt; you can also set this variable in your configuration:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq prelude-whitespace nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11330" LastEditorUserId="33705" LastEditDate="2021-05-06T15:59:55.183" LastActivityDate="2021-05-06T15:59:55.183" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="20854" PostTypeId="2" ParentId="20580" CreationDate="2016-03-08T23:05:55.470" Score="2" Body="&lt;p&gt;try ivy-mode, here is a grep example written by ivy-mode's developer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://oremacs.com/2015/04/19/git-grep-ivy/&quot; rel=&quot;nofollow&quot;&gt;http://oremacs.com/2015/04/19/git-grep-ivy/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I turn to ivy-mode because helm is too slow.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-03-08T23:05:55.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20855" PostTypeId="2" ParentId="20678" CreationDate="2016-03-09T00:42:46.627" Score="2" Body="&lt;p&gt;I use a combination of a couple different packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most importantly, I use &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow&quot;&gt;Projectile&lt;/a&gt; for working on a &quot;project&quot; and fuzzy-finding files. I use multiple frames, one for each project I'm currently working on. You really only need to know &lt;code&gt;C-x 5 2&lt;/code&gt; and &lt;code&gt;C-x 5 0&lt;/code&gt; to create/kill a frame. To manage switching between projects and for storing the state of window configuration/splits, I use &lt;a href=&quot;https://github.com/tlh/workgroups.el&quot; rel=&quot;nofollow&quot;&gt;Workgroups for windows (for emacs)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like this setup because I can potentially swap out one package for another.&lt;/p&gt;&#xA;" OwnerUserId="9154" LastActivityDate="2016-03-09T00:42:46.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20856" PostTypeId="1" AcceptedAnswerId="20858" CreationDate="2016-03-09T01:06:13.240" Score="9" ViewCount="777" Body="&lt;p&gt;I'd like to always display one particular text file named &quot;table.txt&quot; in a monospaced font, while displaying all the other buffers in a variable-width font. How can I achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: the suggested link doesn't have the code block solution in the answer below, and the code block seems to work best for this purpose (&lt;strong&gt;always&lt;/strong&gt; displaying a particular buffer in some face), so I don't think this counts as a duplicate?  &lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="9995" LastEditDate="2016-03-14T06:13:07.117" LastActivityDate="2016-03-14T06:13:07.117" Title="Set font for a specific file?" Tags="|fonts|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20858" PostTypeId="2" ParentId="20856" CreationDate="2016-03-09T04:22:36.347" Score="13" Body="&lt;p&gt;Maybe use a buffer-local value for &lt;code&gt;face-remapping-alist&lt;/code&gt; to remap &lt;code&gt;default&lt;/code&gt; to something else in that one buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Face Remapping&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(face-remap-add-relative 'default :family &quot;Monospace&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or in a file-local variable block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; eval: (face-remap-add-relative 'default :family &quot;Monospace&quot;)&#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-03-09T10:39:17.110" LastActivityDate="2016-03-09T10:39:17.110" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20859" PostTypeId="1" AcceptedAnswerId="20864" CreationDate="2016-03-09T04:51:14.183" Score="2" ViewCount="128" Body="&lt;p&gt;I am very new to Emacs using AUCTeX + the minor mode CDLaTeX to type math documents. According to what I read in &lt;a href=&quot;https://www2.stat.duke.edu/courses/Fall11/sta244/computing/auctex-refcard.pdf&quot; rel=&quot;nofollow&quot;&gt;Auctex reference card&lt;/a&gt; the keybinding &lt;code&gt;`^&lt;/code&gt; should give me &lt;code&gt;\hat&lt;/code&gt; but this is giving &lt;code&gt;\uparrow&lt;/code&gt; instead, please help me to understand. Also please tell me how to get &lt;code&gt;\hat{.}&lt;/code&gt; (&lt;code&gt;.&lt;/code&gt; represents the cursor).&lt;/p&gt;&#xA;" OwnerUserId="9656" LastEditorUserId="25" LastEditDate="2016-03-09T09:52:33.347" LastActivityDate="2016-03-11T14:12:57.633" Title="`^ is giving \uparrow instead of \hat in AUCTeX with CDLaTeX" Tags="|key-bindings|auctex|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20860" PostTypeId="2" ParentId="20849" CreationDate="2016-03-09T09:58:23.017" Score="0" Body="&lt;p&gt;You can set &lt;code&gt;org-narrow-column-arrow&lt;/code&gt; to &lt;code&gt;&quot;&quot;&lt;/code&gt; with &lt;code&gt;(setq org-narrow-column-arrow &quot;&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-03-09T09:58:23.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20861" PostTypeId="2" ParentId="18433" CreationDate="2016-03-09T10:19:15.200" Score="2" Body="&lt;p&gt;I would prefer this, as it simply disables follow-link:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;point at eol should not follow link&#xA;(defun my/org-return ()&#xA;  &quot;disable org-return-follows-link if at bol or eol&quot;&#xA;  (interactive)&#xA;  (let* ((follow org-return-follows-link)&#xA;         (org-return-follows-link (and follow (not (or (bolp) (eolp))))))&#xA;    (org-return)))&#xA;(define-key org-mode-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) 'my/org-return)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, I just noticed that what I really want is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;C-m should always just edit text&#xA;(define-key org-mode-map (kbd &quot;C-m&quot;) 'newline-and-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2593" LastEditorUserId="2593" LastEditDate="2016-03-09T10:26:00.327" LastActivityDate="2016-03-09T10:26:00.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20862" PostTypeId="2" ParentId="20844" CreationDate="2016-03-09T11:15:17.077" Score="4" Body="&lt;p&gt;Well, Emacs is able to acknowledge changes outside, as  long as the result is a file / directory with the same name. This includes temporary deletion and renaming. A renaming of a file or directory outside of Emacs is not visible to Emacs, because it has no information what the renamed file / directory shall be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with Emacs 24.5, Emacs supports file notifications from the underlying OS for some platforms. This could be used to be aware of renaming a file / directory outside of Emacs. But this feature hasn't been implemented yet, as far as I am aware of.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-09T11:15:17.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20864" PostTypeId="2" ParentId="20859" CreationDate="2016-03-09T13:14:44.957" Score="1" Body="&lt;p&gt;From my comment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;auctex&lt;/code&gt; should give &lt;code&gt;\hat{.}&lt;/code&gt; from that keybinding. However, &lt;code&gt;cdlatex&lt;/code&gt; changes a number of bindings and its way to enter such an accent is via &lt;code&gt;'^&lt;/code&gt; &lt;em&gt;after&lt;/em&gt; the content you wish to put in the braces, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a'^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives &lt;code&gt;\hat{a}&lt;/code&gt;.  Examples such as &lt;code&gt;ab'^&lt;/code&gt; also work giving &lt;code&gt;\hat{ab}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the source file of &lt;code&gt;cdlatex&lt;/code&gt; at &lt;a href=&quot;http://github.com/cdominik/cdlatex&quot; rel=&quot;nofollow&quot;&gt;http://github.com/cdominik/cdlatex&lt;/a&gt; which documents this.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2016-03-11T14:12:57.633" LastActivityDate="2016-03-11T14:12:57.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20865" PostTypeId="2" ParentId="20585" CreationDate="2016-03-09T14:30:01.563" Score="3" Body="&lt;p&gt;I ran &lt;code&gt;emacs --debug-init&lt;/code&gt; and it pointed to the &lt;code&gt;helm-ls-git&lt;/code&gt; package calling &lt;code&gt;eieio-defclass-autoload&lt;/code&gt;. Removing &lt;code&gt;helm-ls-git&lt;/code&gt; in the package manager solved the problem&lt;/p&gt;&#xA;" OwnerUserId="9286" LastActivityDate="2016-03-09T14:30:01.563" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20866" PostTypeId="1" AcceptedAnswerId="20897" CreationDate="2016-03-09T16:15:51.133" Score="1" ViewCount="169" Body="&lt;p&gt;I have a single emacs server that I use for all of my work. It is located on a machine that I ssh into from every location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My 'browse-url is set to run a bash script that ssh's into the machine I am running emacsclient on and opens Chrome. However, this only works if I use emacs from one machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a method for my emacs server to change its behavior based on the emacs client (whether it is an environmental variable, a variable that gives the hostname of the client, or anything else). I can't seem to find anything right now.&lt;/p&gt;&#xA;" OwnerUserId="11362" LastActivityDate="2016-03-10T17:00:34.660" Title="Separate Environments for each emacsclient" Tags="|emacsclient|server|environment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20867" PostTypeId="2" ParentId="20719" CreationDate="2016-03-09T18:49:43.260" Score="4" Body="&lt;p&gt;This can be done with &lt;a href=&quot;https://github.com/vspinu/polymode/tree/master/modes&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;polymode&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'polymode)&#xA;(defcustom pm-host/python&#xA;  (pm-bchunkmode &quot;python&quot;&#xA;                 :mode 'python-mode&#xA;                 :font-lock-narrow nil)&#xA;  &quot;Python host chunkmode&quot;&#xA;  :group 'hostmodes&#xA;  :type 'object)&#xA;&#xA;(defcustom pm-inner/python&#xA;  (pm-hbtchunkmode &quot;python&quot;&#xA;                   :mode 'python-mode&#xA;                   :head-reg  &quot;\&quot;\&quot;\&quot;&quot;&#xA;                   :tail-reg  &quot;\&quot;\&quot;\&quot;&quot;)&#xA;  &quot;Python typical chunk.&quot;&#xA;  :group 'innermodes&#xA;  :type 'object)&#xA;&#xA;(defcustom pm-poly/python&#xA;  (pm-polymode-one &quot;python&quot;&#xA;                   :hostmode 'pm-host/python&#xA;                   :innermode 'pm-inner/python)&#xA;  &quot;Python typical polymode.&quot;&#xA;  :group 'polymodes&#xA;  :type 'object)&#xA;&#xA;(define-polymode poly-python-mode pm-poly/python)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;b&lt;/kbd&gt; &lt;code&gt;test.py&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;poly-python-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;With this mode, triple-quoted strings are highlighted as python code. (Not normally a good idea, but you can toggle it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5jIGC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5jIGC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, &lt;code&gt;polymode&lt;/code&gt; seems to have issues updating the font-locking. However, this should work in practice.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-03-10T03:37:55.987" LastActivityDate="2016-03-10T03:37:55.987" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="20869" PostTypeId="2" ParentId="20833" CreationDate="2016-03-09T20:07:33.937" Score="16" Body="&lt;h2&gt;emacs 25.x&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The emacs 25.1 release will have in-built support for handling different kinds of archives from within dired. Below is the relevant excerpt from the &lt;code&gt;NEWS&lt;/code&gt; file (&lt;code&gt;C-h C-n&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+++&#xA;*** The command `dired-do-compress' bound to `Z' now can compress&#xA;directories and decompress zip files.&#xA;&#xA;+++&#xA;*** New command `dired-do-compress-to' bound to `c' can be used to&#xA;compress many marked files into a single named archive.  The&#xA;compression command is determined from the new&#xA;`dired-compress-files-alist' variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;dired-do-compress&lt;/code&gt; | &lt;code&gt;Z&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Check out the &lt;code&gt;dired-compress-file-suffixes&lt;/code&gt; variable to get a list of supported compressed file formats. The correct program will be used to uncompress a file (or files) when using the &lt;code&gt;Z&lt;/code&gt; binding (&lt;code&gt;dired-do-compress&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;While the above will uncompress a wide range of formats, it will always compress using &lt;code&gt;gzip&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;dired-do-compress-to&lt;/code&gt; | &lt;code&gt;c&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Check out the &lt;code&gt;dired-compress-files-alist&lt;/code&gt; variable to get a list of supported file formats that can be compressed &lt;strong&gt;to&lt;/strong&gt; using the &lt;code&gt;c&lt;/code&gt; binding (&lt;code&gt;dired-do-compress-to&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of emacs 25.1, it supports compressing using &lt;code&gt;tar&lt;/code&gt; + (&lt;code&gt;gzip&lt;/code&gt;/&lt;code&gt;bzip2&lt;/code&gt;/&lt;code&gt;xz&lt;/code&gt;) or &lt;code&gt;zip&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-03-09T20:07:33.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20871" PostTypeId="2" ParentId="20850" CreationDate="2016-03-09T22:34:20.570" Score="1" Body="&lt;p&gt;You can save the below to you config, evaluate it and run &lt;code&gt;C-u M-x org-table-align&lt;/code&gt; with the point in the table. That will re-align the table without narrowing.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-table-align-maybe-narrow (orig-fun &amp;amp;rest args)&#xA;  &quot;Align org-table, but do not do narrowing if prefix argument&#xA;\\[universal-argument] is used before ORIG-FUN.&quot;&#xA;  (let ((org-table-do-narrow (null current-prefix-arg)))&#xA;    (apply orig-fun args)))&#xA;(advice-add 'org-table-align :around #'my/org-table-align-maybe-narrow)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is the example table from your question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;3&amp;gt; | &amp;lt;3&amp;gt; |&#xA;| abra | cadabra |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the point on the table, if you do &lt;code&gt;M-x org-table-align&lt;/code&gt;, you will get the below (as expected):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;3&amp;gt; | &amp;lt;3&amp;gt; |&#xA;| a=&amp;gt; | c=&amp;gt; |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, with the above elisp snippet evaluated, if you do &lt;code&gt;C-u M-x org-table-align&lt;/code&gt;, you will get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;3&amp;gt;  | &amp;lt;3&amp;gt;     |&#xA;| abra | cadabra |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And doing &lt;code&gt;M-x org-table-align&lt;/code&gt; again will give:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;3&amp;gt; | &amp;lt;3&amp;gt; |&#xA;| a=&amp;gt; | c=&amp;gt; |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you need to do this narrowing switching very frequently, you might want to have &lt;code&gt;org-table-align&lt;/code&gt; bound to some key. Below is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c C-|&quot;) #'org-table-align)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-03-09T22:34:20.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20872" PostTypeId="1" AcceptedAnswerId="20873" CreationDate="2016-03-09T22:48:18.140" Score="2" ViewCount="862" Body="&lt;p&gt;I am using org-mode to make a Beamer LaTeX presentation, which then gets rendered to PDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the part I am having trouble with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Vectors in Ruby (components)&#xA;- a Vector can be added to another vector&#xA;- a Vector can be multiplied by a scalar&#xA;#+begin_src ruby&#xA;class Vector&#xA;  def +(vector)&#xA;    Vector.new(components.zip(vector.components).map {|(vi,wi)| vi+wi })&#xA;  end&#xA;&#xA;  def *(scalar)&#xA;    Vector.new(components.map{|c| scalar*c })&#xA;  end&#xA;end&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run org-export-dispatch and render to PDF, here's what the methods look like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7Hp1A.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7Hp1A.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked in the intermediate .tex file and the &lt;code&gt;Vector&lt;/code&gt; lines have a tab indentation instead of space. It is inside a &lt;code&gt;\begin{minted}&lt;/code&gt; block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this indentation?&lt;/p&gt;&#xA;" OwnerUserId="8264" LastEditorUserId="8264" LastEditDate="2016-03-09T23:43:24.843" LastActivityDate="2016-03-10T00:15:37.123" Title="org-mode source code block using minted doesn't indent exported ruby correctly" Tags="|org-mode|org-export|beamer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20873" PostTypeId="2" ParentId="20872" CreationDate="2016-03-10T00:15:37.123" Score="2" Body="&lt;p&gt;In order to ensure that source code formatting is preserved in exports from Org-mode, set the variables &lt;code&gt;org-src-preserve-indentation&lt;/code&gt; to 't', and &lt;code&gt;indent-tabs-mode&lt;/code&gt; to 'nil' using &lt;strong&gt;customize-variable&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5184" LastActivityDate="2016-03-10T00:15:37.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20874" PostTypeId="1" CreationDate="2016-03-10T02:25:33.183" Score="3" ViewCount="192" Body="&lt;p&gt;I'm using emacs I downloaded from &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;http://emacsformacosx.com/&lt;/a&gt;, but it doesn't display the file type icon for some file types like plain text file, in the title bar. How can I make it appear?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean by &quot;file type icon&quot; is like the blue c++ icon in the title bar of the frame in &lt;a href=&quot;https://camo.githubusercontent.com/e6277aaf0447ba8d835cb27dcd1eb84f72925b26/68747470733a2f2f7261772e6769746875622e636f6d2f436f72736169722f656d6163732d64657669616e742d7468656d652f6d61737465722f73686f742d302e706e67&quot; rel=&quot;nofollow&quot;&gt;this picture&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-03-10T02:25:33.183" Title="File type icon in the title bar in osx" Tags="|osx|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20875" PostTypeId="1" AcceptedAnswerId="20890" CreationDate="2016-03-10T03:16:59.760" Score="5" ViewCount="378" Body="&lt;p&gt;Specifically, I want tags in org mode to be a variant of the color of the corresponding heading (e.g. less saturated or lighter). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each org mode heading level is a different color, so I can't just directly change the color for the org tag face. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5lYCw.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5lYCw.png&quot; alt=&quot;Screenshot of org customize options&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can clearly inherit a variant of the size, but there doesn't seem to be any way to inherit a variant of the color. Is it possible?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2016-03-10T13:59:19.327" Title="Can you describe a face color in terms of an inherited face color?" Tags="|org-mode|faces|customize|colors|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20876" PostTypeId="1" CreationDate="2016-03-10T04:18:03.820" Score="2" ViewCount="96" Body="&lt;p&gt;Is there a way I can collapse/expand &lt;strong&gt;regexp matches within a line?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. let's say I have this list and want to hide some parts of it temporarily: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple: fruit; red&#xA;* butter: dairy; yellow&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I set the regexp to &quot;:.*$&quot; and fold the matches, it should become something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple...&#xA;* butter...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I set the regexp to &quot;:.&lt;strong&gt;*;&quot; instead&lt;/strong&gt;, and fold the matches, it should become something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple... red&#xA;* butter... yellow&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when I expand the list, it should get back to the original view:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple: fruit; red&#xA;* butter: dairy; yellow&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, none of the methods I found so far doesn't seem to work this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;em&gt;folding mode&lt;/em&gt;, but it only worked for blocks of text, and &lt;strong&gt;it didn't work for string within a line.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. it doesn't work when I set it to hide things between &quot;:&quot; and &quot;;&quot; below. It doesn't do anything in that case. It only kind of works (but not really appropriately for my purpose) when I set it to hide things between &quot;:&quot; and &quot;:&quot; since they are placed across the lines. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to hide things between &quot;:&quot;, this &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple: fruit; red&#xA;* butter: dairy; yellow&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple: fruit; red...&#xA;: dairy; yellow&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(It might be not exactly like this: I tried this yesterday and I don't remember exactly except that it didn't work fine.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried &lt;em&gt;hs-hide-all&lt;/em&gt; with text like &quot;{this should be hidden}&quot; in both org mode and emacs lisp mode, but it didn't do anything. Is this function known to be tricky or something? I'm not even sure if this function is supposed to work for hiding text &lt;strong&gt;within a line&lt;/strong&gt; not across lines, or I'm misusing it. &lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="10707" LastEditDate="2016-03-11T01:44:40.890" LastActivityDate="2016-03-11T01:44:40.890" Title="Collapse regexp matches within a line" Tags="|code-folding|hideshow|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20877" PostTypeId="1" CreationDate="2016-03-10T06:14:39.967" Score="1" ViewCount="779" Body="&lt;p&gt;When I launch an &lt;code&gt;ansi-term&lt;/code&gt; in a remote (TRAMP) buffer, I'd like the resulting shell to reflect the current &lt;code&gt;default-directory&lt;/code&gt;. That is, I'd like &lt;code&gt;ansi-term&lt;/code&gt; to give me a remote shell, so I can do things in the directory of the current file.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-04-10T21:33:27.513" Title="Honor default-directory in ansi-term" Tags="|tramp|ansi-term|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20878" PostTypeId="1" AcceptedAnswerId="20881" CreationDate="2016-03-10T06:26:21.327" Score="4" ViewCount="2018" Body="&lt;p&gt;I am trying to define this seemingly innocuous function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(defun previous-window ()&#xA;  (interactive)&#xA;  (other-window -1))&#xA;(define-key evil-window-map (kbd &quot;o&quot;) 'previous-window)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I am running into this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-number-of-arguments (lambda nil (interactive) (other-window -1)) 3)&#xA;  previous-window(#&amp;lt;window 6 on *scratch*&amp;gt; nil nil)&#xA;  byte-code(...)&#xA;  #[(count &amp;amp;optional all-frames) &quot;...&quot;&#xA;  ad-Advice-other-window(#[(count &amp;amp;optional all-frames) &quot;...&quot;&#xA;  apply(ad-Advice-other-window #[(count &amp;amp;optional all-frames) &quot;...&quot;&#xA;  other-window(-1)&#xA;  previous-window()&#xA;  call-interactively(previous-window nil nil)&#xA;  command-execute(previous-window)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I change that &lt;code&gt;-1&lt;/code&gt; to &lt;code&gt;1&lt;/code&gt;, everything works fine. The documentation for &lt;code&gt;other-window&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;other-window is an interactive compiled Lisp function in `window.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to C-x o.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(other-window COUNT &amp;amp;optional ALL-FRAMES)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;:around advice: `ad-Advice-other-window'&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Select another window in cyclic ordering of windows. COUNT specifies&#xA;  the number of windows to skip, starting with the selected window,&#xA;  before making the selection.  If COUNT is positive, skip COUNT windows&#xA;  forwards.  If COUNT is negative, skip -COUNT windows backwards.  COUNT&#xA;  zero means do not skip any window, so select the selected window.  In&#xA;  an interactive call, COUNT is the numeric prefix argument.  Return&#xA;  nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;states clearly that negative arguments are used to cycle backwards. Therefore, this is really weird to me. Has it got anything to do with an interactive call? Can someone please explain what is going on here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;GNU Emacs 24.5.1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="9193" LastActivityDate="2016-03-10T09:28:34.950" Title="Weird error: wrong-number-of-arguments" Tags="|window|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20879" PostTypeId="1" CreationDate="2016-03-10T09:03:50.940" Score="4" ViewCount="121" Body="&lt;p&gt;If I use a command that begin a new block (according to &lt;code&gt;AUCTeX&lt;/code&gt;), e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\newcommand\Test{\begin{abstract}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I start my document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;AUCTeX will indent my code as if I typed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{abstract}&#xA;  \begin{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tell AUCTeX to &lt;strong&gt;not&lt;/strong&gt; consider command in &lt;code&gt;newcommand&lt;/code&gt; for indentation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: It may looks silly to declare a new command for &lt;code&gt;\begin{abstract}&lt;/code&gt; but my real code is not about such command (simplified for the example). Actually the problem occurred while using the &lt;code&gt;algorithm&lt;/code&gt; packages, and I wanted to define a new command such as &lt;code&gt;IfAny&lt;/code&gt; (&lt;code&gt;\newcommand\IfAny[1]{\If{\textbf{any} #1}&lt;/code&gt;) which does not really involved an environment.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full example code after &lt;kbd&gt;C-x h&lt;/kbd&gt; &lt;kbd&gt;M-x indent-region&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\newcommand\Test{\begin{abstract}}&#xA;&#xA;  \begin{document}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The exact command concerns the &lt;code&gt;algorithm&lt;/code&gt; and &lt;code&gt;algpseudocode&lt;/code&gt; packages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\newcommand\IfAny[1]{\If{\textbf{any }#1}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\IfAny{}&#xA;  \State ...&#xA;\EndIf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which cannot be made into an environment (&lt;code&gt;\newenvironment&lt;/code&gt;) unfortunately.&lt;/p&gt;&#xA;" OwnerUserId="11022" LastEditorUserId="11022" LastEditDate="2016-03-10T11:00:35.700" LastActivityDate="2016-03-10T11:00:35.700" Title="AUCTeX indenting after \newcommand" Tags="|indentation|auctex|" AnswerCount="0" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="20880" PostTypeId="1" CreationDate="2016-03-10T09:08:46.213" Score="4" ViewCount="109" Body="&lt;p&gt;I ran &lt;code&gt;ediff&lt;/code&gt; on file A and B, and then quit it to do a git commit. Then I want to reopen ediff (let's call it &lt;code&gt;rediff&lt;/code&gt;) with the same pair of files.&#xA;How do I do this? There is the &lt;code&gt;eregistry&lt;/code&gt; thing that I thought it is for this purpose.But I couldn't make it work. When I type &lt;code&gt;z&lt;/code&gt; and quit &lt;code&gt;ediff&lt;/code&gt;, there is nothing in the &lt;code&gt;eregistry&lt;/code&gt; when I do &lt;code&gt;M-x eregistry&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastActivityDate="2016-08-15T01:43:53.470" Title="How to quickly reopen ediff with the same files" Tags="|ediff|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20881" PostTypeId="2" ParentId="20878" CreationDate="2016-03-10T09:28:34.950" Score="3" Body="&lt;p&gt;The problem is that there's a function &lt;code&gt;previous-window&lt;/code&gt; that is called by &lt;code&gt;other-window&lt;/code&gt;.  Use another name:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-previous-window ()&#xA;  (interactive)&#xA;  (other-window -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-03-10T09:28:34.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20882" PostTypeId="1" AcceptedAnswerId="20893" CreationDate="2016-03-10T09:31:13.907" Score="3" ViewCount="604" Body="&lt;p&gt;When I click with &lt;code&gt;mouse-1&lt;/code&gt; in dired it will open a new frame with the selected file. When I press &lt;code&gt;return&lt;/code&gt; on the same file it will open the file in the same frame. How can I synchronize this behavior? I.e. I want &lt;code&gt;mouse-1&lt;/code&gt; to behave the same as &lt;code&gt;return&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore I have the following problem. The &lt;code&gt;mouse-1&lt;/code&gt; down event seems to work fine, but the up event seems to be registered as &lt;code&gt;mouse-2&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;down-mouse-1&amp;gt; at that spot runs the command mouse-drag-region, which is an interactive compiled Lisp function&#xA;in `mouse.el'.&#xA;&#xA;It is bound to &amp;lt;down-mouse-1&amp;gt;.&#xA;&#xA;(mouse-drag-region START-EVENT)&#xA;&#xA;Set the region to the text that the mouse is dragged over.&#xA;Highlight the drag area as you move the mouse.&#xA;This must be bound to a button-down mouse event.&#xA;In Transient Mark mode, the highlighting remains as long as the mark&#xA;remains active.  Otherwise, it remains until the next input event.&#xA;&#xA;If the click is in the echo area, display the `*Messages*' buffer.&#xA;&#xA;----------------- up-event ----------------&#xA;&#xA;&amp;lt;mouse-2&amp;gt; at that spot runs the command dired-mouse-find-file-other-window, which is an interactive compiled&#xA;Lisp function in `dired.el'.&#xA;&#xA;It is bound to &amp;lt;mouse-2&amp;gt;.&#xA;&#xA;(dired-mouse-find-file-other-window EVENT)&#xA;&#xA;In Dired, visit the file or directory name you click on.&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="759" LastEditorUserId="759" LastEditDate="2016-03-10T22:18:30.780" LastActivityDate="2016-03-10T22:18:30.780" Title="How to make mouse-1 behave the same as RET in dired?" Tags="|key-bindings|dired|mouse|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20884" PostTypeId="1" CreationDate="2016-03-10T10:46:11.330" Score="2" ViewCount="34" Body="&lt;p&gt;Is there a way to treat an inline picture (a link rendered as an image) as one character in org table?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I align an org table that has a small image in a field, the alignment gets really messy, since the link of that tiny picture is actually really long. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the &quot;o&quot; below is a tiny picture of an apple. The alignment gets weird like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|----------------------------------------------------------------+-------|&#xA;| o | apple |&#xA;|                                                                |       |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-03-10T10:46:11.330" Title="Is there a way to treat an inline picture (a link rendered as an image) as one character in org table?" Tags="|org-table|images|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20885" PostTypeId="1" CreationDate="2016-03-10T11:11:20.963" Score="0" ViewCount="460" Body="&lt;p&gt;I'm editing JSX files with web-mode and our project doesn't use semicolons at the end of the line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I press enter at the end of the line, web-mode is auto-indenting two spaces because the semicolon is missing. How can I prevent this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen that this &lt;a href=&quot;https://emacs.stackexchange.com/questions/13017/web-mode-indentation-is-misaligned-on-skipping-semicolons&quot;&gt;question&lt;/a&gt; has the same problem, but it didn't help me solve this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, there aren't any web-mode specific indentation rules in my emacs init.el, but to be on the safe side, here are all my web-mode settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'web-mode-hook&#xA;      (lambda ()&#xA;        (if (or (equal web-mode-content-type &quot;jsx&quot;) (equal web-mode-content-type &quot;javascript&quot;))&#xA;            (flymake-jslint-load))))&#xA;&#xA;(add-hook 'web-mode-hook&#xA;      (lambda ()&#xA;        ;; short circuit js mode and just do everything in jsx-mode&#xA;        (if (equal web-mode-content-type &quot;javascript&quot;)&#xA;            (web-mode-set-content-type &quot;jsx&quot;)&#xA;          (message &quot;now set to: %s&quot; web-mode-content-type))&#xA;&#xA;        (setq web-mode-markup-indent-offset 2)&#xA;        (setq web-mode-css-indent-offset 2)&#xA;        (setq web-mode-code-indent-offset 2)))&#xA;&#xA;(require 'flycheck)&#xA;(flycheck-add-mode 'javascript-eslint 'web-mode)&#xA;(setq-default flycheck-disabled-checkers&#xA;  (append flycheck-disabled-checkers&#xA;          '(javascript-jshint)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Update! I just realized that this happens in lines ending with functions, but not with lines that only have variable assignments. Here's a sample:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;console.log()&#xA;  cursor is here when I press enter&#xA;var blub = 2&#xA;cursor is here when I press enter.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I'm really confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&#xA;--chris&lt;/p&gt;&#xA;" OwnerUserId="8401" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-03-10T11:32:22.270" Title="web-mode javascript auto-indenting without semicolons" Tags="|indentation|web-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20886" PostTypeId="2" ParentId="20877" CreationDate="2016-03-10T11:13:38.273" Score="1" Body="&lt;p&gt;This is not exactly what you are searching for, but it gives you a very similar functionality, albeit outside of Emacs and not in ansi-term. So, I still decided to submit it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my own convenience (and because I still like the native OS shell a lot), I implemented the possibility to open a gnome-terminal set to the current &lt;code&gt;default-directory&lt;/code&gt;. Will be easy to adapt to any other shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also works with remote directories:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/dfeich/50ee86c3d4338dbc878b&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/dfeich/50ee86c3d4338dbc878b&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun dfeich/gnome-terminal (&amp;optional path)&#xA;  &quot;Opens a gnome terminal at PATH. If no PATH is given, it uses&#xA;the value of `default-directory'. PATH may be a tramp remote path.&quot;&#xA;  (interactive)&#xA;  (unless path (setq path default-directory))&#xA;  (if (tramp-tramp-file-p path)&#xA;      (let ((tstruct (tramp-dissect-file-name path)))&#xA;    (cond&#xA;     ((equal (tramp-file-name-method tstruct) &quot;ssh&quot;)&#xA;      (call-process &quot;/usr/bin/gnome-terminal&quot; nil nil nil&#xA;            &quot;-x&quot; &quot;sh&quot; &quot;-c&quot;&#xA;            (format &quot;ssh -t %s 'cd %s; exec bash'; exec bash&quot;&#xA;                (tramp-file-name-host tstruct)&#xA;                (tramp-file-name-localname tstruct))))&#xA;     (t (error &quot;not implemented for method%s&quot;&#xA;           (tramp-file-name-method tstruct)))))&#xA;    (call-process &quot;/usr/bin/gnome-terminal&quot; nil nil nil&#xA;          &quot;-x&quot; &quot;sh&quot; &quot;-c&quot;&#xA;          (format &quot;cd %s;exec bash&quot; path))))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2016-03-10T11:13:38.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20887" PostTypeId="2" ParentId="13532" CreationDate="2016-03-10T11:47:17.960" Score="2" Body="&lt;p&gt;I'm going to guess the warnings are coming from on-the-fly compilation of ELPA packages. Try running the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-package-recompile()&#xA;  &quot;Recompile all packages&quot;&#xA;  (interactive)&#xA;  (byte-recompile-directory &quot;~/.emacs.d/elpa&quot; 0 t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After M-x my-package-recompile switch the the &lt;em&gt;Compile-Log&lt;/em&gt; buffer and see if these warnings are replicated in there?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2016-03-10T11:47:17.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20888" PostTypeId="2" ParentId="20674" CreationDate="2016-03-10T12:50:29.070" Score="7" Body="&lt;p&gt;If &lt;a href=&quot;http://tartarus.org/~simon/putty-snapshots/htmldoc/Chapter4.html#config-features-mouse&quot; rel=&quot;noreferrer&quot;&gt;mouse reporting&lt;/a&gt; is on, then Shift+click is still interpreted by the terminal and not passed to the application. Thus, if a right-click pastes outside Emacs, and a straight right-click is passed through to Emacs, then Shift+right-click should paste in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://tartarus.org/~simon/putty-snapshots/htmldoc/Chapter4.html#config-mouseshift&quot; rel=&quot;noreferrer&quot;&gt;Passthrough of Shift+click can be disabled&lt;/a&gt;, check that it's enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This applies to PuTTY and many other terminal emulators. (I think they all follow suit from xterm, as is often the case.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-10T12:50:29.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20889" PostTypeId="2" ParentId="3866" CreationDate="2016-03-10T13:50:24.870" Score="7" Body="&lt;p&gt;For the records, support of kqueue has been added to the file notification libraries in the upcoming Emacs 25.1. This means, that you could use file notifications in Emacs under *BSD and OSX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For OSX, FSEvents might be better suited. But nobody has taken the ball, and offered an implementation for Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-10T13:50:24.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20890" PostTypeId="2" ParentId="20875" CreationDate="2016-03-10T13:59:19.327" Score="4" Body="&lt;p&gt;No, you cannot set a face to always be a certain amount lighter or darker than the inherited face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can not customize a face based on context either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would like org tags to change color based on their location in the org tree, you will need to use a custom font-lock keyword function that programmatically apply colors to org tags based on location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;code&gt;function&lt;/code&gt; and &lt;code&gt;(matcher . facespec)&lt;/code&gt; sections of this document specifically: &#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html&quot; rel=&quot;noreferrer&quot;&gt;Search Based Fontification&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-03-10T13:59:19.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20891" PostTypeId="1" CreationDate="2016-03-10T14:16:09.403" Score="4" ViewCount="189" Body="&lt;p&gt;I go across blog post: &lt;a href=&quot;http://blog.cdleary.com/2010/09/picing-on-javascript-for-fun-and-profit/&quot;&gt;http://blog.cdleary.com/2010/09/picing-on-javascript-for-fun-and-profit/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is about JS performance on accessing object properties and tricks that help reduce that time. Usual access require hash table lookup. Optimized solution makes type checks, if type is not changed we can use direct address from cache.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder is GNU ELisp require hash lookup for symbol? For:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun adjust-fill-column (val) (setq fill-column val))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(byte-compile 'adjust-fill-column)&#xA;&#xA;#[(val) &quot;^H\211^Q\207&quot; [val fill-column] 2]&#xA;&#xA;(disassemble (byte-compile 'adjust-fill-column))&#xA;&#xA;byte code:&#xA;  args: (val)&#xA;0       varref    val&#xA;1       dup       &#xA;2       varset    fill-column&#xA;3       return    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does that mean that on every call of &lt;code&gt;adjust-fill-column&lt;/code&gt; &lt;code&gt;varref&lt;/code&gt; and &lt;code&gt;varset&lt;/code&gt; do hash lookup? Is that done inside body or when &lt;code&gt;[val fill-column]&lt;/code&gt; array processed?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2022-09-18T17:36:53.027" LastActivityDate="2022-09-18T17:36:53.027" Title="Does Elisp replay on hash lookups every time code require access to symbol value?" Tags="|elisp|emacs-internals|hash-tables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20892" PostTypeId="2" ParentId="10900" CreationDate="2016-03-10T15:00:23.977" Score="38" Body="&lt;p&gt;&lt;strong&gt;Copy&lt;/strong&gt; from Emacs to OS X clipboard:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;select region then &lt;code&gt;M-| pbcopy RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Paste&lt;/strong&gt; from OS X clipboard to Emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-u M-| pbpaste RET&lt;/code&gt; (replaces current region if it exists)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Explanation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-|&lt;/code&gt; runs &lt;code&gt;shell-command-on-region&lt;/code&gt;, which as the name implies pipes the current region to a shell command. &lt;code&gt;C-u M-|&lt;/code&gt; does the same thing, but replaces the current region with the &lt;code&gt;stdout&lt;/code&gt; of the command being run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pbcopy&lt;/code&gt; and &lt;code&gt;pbpaste&lt;/code&gt; are OS X utilities for accessing the system clipboard.&lt;/p&gt;&#xA;" OwnerUserId="11369" LastActivityDate="2016-03-10T15:00:23.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20893" PostTypeId="2" ParentId="20882" CreationDate="2016-03-10T15:25:21.987" Score="3" Body="&#xA;&#xA;&lt;p&gt;Bind &lt;code&gt;mouse-1&lt;/code&gt; to the command you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key dired-mode-map [mouse-1] 'dired-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or bind it to a command that is like &lt;code&gt;dired-mouse-find-file-other-window&lt;/code&gt; but uses the same window.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-mouse-find-file (event)&#xA;  &quot;In Dired, visit the file or directory name you click on.&quot;&#xA;  (interactive &quot;e&quot;)&#xA;  (let (window pos file)&#xA;    (save-excursion&#xA;      (setq window (posn-window (event-end event))&#xA;            pos (posn-point (event-end event)))&#xA;      (if (not (windowp window))&#xA;      (error &quot;No file chosen&quot;))&#xA;      (set-buffer (window-buffer window))&#xA;      (goto-char pos)&#xA;      (setq file (dired-get-file-for-visit)))&#xA;    (if (file-directory-p file)&#xA;    (or (and (cdr dired-subdir-alist)&#xA;             (dired-goto-subdir file))&#xA;        (progn&#xA;          (select-window window)&#xA;          (dired-other-window file)))&#xA;      (select-window window)&#xA;      (find-file-window (file-name-sans-versions file t)))))&#xA;&#xA;(define-key dired-mode-map [mouse-1] 'dired-mouse-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="115" LastEditDate="2016-03-10T15:34:54.280" LastActivityDate="2016-03-10T15:34:54.280" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20895" PostTypeId="2" ParentId="14008" CreationDate="2016-03-10T16:06:37.580" Score="5" Body="&lt;p&gt;&lt;code&gt;(add-hook 'git-commit-mode-hook 'evil-insert-state)&lt;/code&gt; works&lt;/p&gt;&#xA;" OwnerUserId="11370" LastActivityDate="2016-03-10T16:06:37.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20896" PostTypeId="1" AcceptedAnswerId="20899" CreationDate="2016-03-10T16:27:13.750" Score="12" ViewCount="2065" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/27077770/how-do-i-disable-electric-indent-on-ret-but-still-keep-other-electric-characters&quot;&gt;https://stackoverflow.com/questions/27077770/how-do-i-disable-electric-indent-on-ret-but-still-keep-other-electric-characters&lt;/a&gt; asks and answers how to disable electric indent when pressing RET. All similar questions also seem to stop at &quot;disable electric-indent-mode&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Out-of-the-box, RET indents the previous line and the new line. For the new line this means that it simply adds enough whitespace to make the cursor appear at the correct position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like the second part of the behaviour but not the first, i.e. I never want it to indent the previous line. Is there a way to change it so it gives me enough whitespace on the new line but keeping the previous line untouched?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I actually don't need/want most of the electricity. A solution which involves turning off electric-indent-mode but somehow activating the &quot;add whitespace for new lines&quot; feature would be fine with me.&lt;/p&gt;&#xA;" OwnerUserId="11371" LastEditorUserId="105" LastEditDate="2019-11-25T14:29:52.357" LastActivityDate="2019-11-25T14:29:52.357" Title="Change the behaviour of RET (with electric indent) to only indent the new line, not the previous one" Tags="|indentation|electric-indent|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="20897" PostTypeId="2" ParentId="20866" CreationDate="2016-03-10T17:00:34.660" Score="2" Body="&lt;p&gt;You'll want to look at the &lt;code&gt;environment&lt;/code&gt; frame parameter, which the server.el code sets up whenever a frame is created for a particular client:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(frame-parameter nil 'environment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should then hold a list of strings, where some of those strings will be like &quot;SSH_CLIENT=IP PORT1 PORT2&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-03-10T17:00:34.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20898" PostTypeId="1" AcceptedAnswerId="31266" CreationDate="2016-03-10T17:10:24.843" Score="3" ViewCount="167" Body="&lt;p&gt;I wish to play certain music files, but from certain time. I find the seek forward/backward functions not the ones I need since they require me to fast forward/backward until I arrive at certain time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the correct way of navigating through the music file to certain time from where I wish to play it?&lt;/p&gt;&#xA;" OwnerUserId="684" LastActivityDate="2020-12-14T13:40:16.090" Title="Emms play at certain time" Tags="|emms|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20899" PostTypeId="2" ParentId="20896" CreationDate="2016-03-10T17:28:42.030" Score="7" Body="&lt;p&gt;I think you'll get what you want with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default electric-indent-inhibit t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This was meant as a variable for major-modes (rather than for users), but it should take care of your use-case as well.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-03-10T17:28:42.030" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20900" PostTypeId="1" AcceptedAnswerId="27169" CreationDate="2016-03-10T18:32:13.677" Score="15" ViewCount="898" Body="&lt;p&gt;I want to navigate between the lines of a file based on indentation. The file is structured by indentation: a line that's more indented than the previous line is a child of the previous line, a line that has the same indentation as the previous line is its sibling. I'm mostly looking for three commands:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Move to the next sibling, i.e. the next line with the same indentation, skipping lines that are more indented, but not skipping past a line that is less indented.&lt;/li&gt;&#xA;&lt;li&gt;Move to the previous sibling, i.e. the same thing in the other direction.&lt;/li&gt;&#xA;&lt;li&gt;Move to the parent, i.e. to the previous line with less indentation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The column position of the point should not change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are analogs for indentation-structured data to &lt;code&gt;forward-sexp&lt;/code&gt;, &lt;code&gt;backward-sexp&lt;/code&gt; and &lt;code&gt;backward-up-list&lt;/code&gt; for sexp-structured data. Indentation corresponds to program structure in languages such as Haskell and Python; these functions can be especially useful in this context but I am not looking for anything mode-specific (my primary use case is intendation-structured data inside another file format).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/3372/coloring-indentation-levels&quot;&gt;Coloring indentation levels&lt;/a&gt; can help to navigate manually with &lt;kbd&gt;Up&lt;/kbd&gt;/&lt;kbd&gt;Down&lt;/kbd&gt; but I want something automatic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://superuser.com/questions/1017094/emacs-jump-to-the-next-line-with-same-indentation&quot;&gt;This super user question&lt;/a&gt; is similar but with weaker requirements and does not currently have answers that meet my requirements.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-09-19T02:05:42.213" Title="Navigate by indentation" Tags="|indentation|motion|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20901" PostTypeId="2" ParentId="18591" CreationDate="2016-03-10T19:40:28.447" Score="5" Body="&lt;p&gt;I had the same problem with outline-minor-mode and the following line in my init.el was the culprit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq outline-minor-mode-prefix &quot;C-c C-o&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Seems like that was interpreting the first &quot;C&quot; as Shift-C instead of Control.&lt;/p&gt;&#xA;" OwnerUserId="11372" LastActivityDate="2016-03-10T19:40:28.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20902" PostTypeId="2" ParentId="20900" CreationDate="2016-03-10T19:44:32.910" Score="4" Body="&#xA;&#xA;&lt;p&gt;The following three commands, minimally tested, should allow for basic navigation by indented lines.  Apologies for the code repetition.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ind-forward-sibling ()&#xA;  &quot;Move forward to the next sibling line with the same indentation.&quot;&#xA;  (interactive)&#xA;  (save-match-data&#xA;    (let ((col (current-column))&#xA;          (pad (progn&#xA;                 (back-to-indentation)&#xA;                 (current-column))))&#xA;      (end-of-line 1)&#xA;      (re-search-forward (concat &quot;^\\s-\\{&quot;&#xA;                                 (number-to-string pad)&#xA;                                 &quot;\\}[^ ]&quot;) nil t)&#xA;      (move-to-column col))))&#xA;&#xA;(defun ind-backward-sibling ()&#xA;  &quot;Move backward to the next sibling line with the same indentation.&quot;&#xA;  (interactive)&#xA;  (save-match-data&#xA;    (let ((col (current-column))&#xA;          (pad (progn&#xA;                 (back-to-indentation)&#xA;                 (current-column))))&#xA;      (beginning-of-line 1)&#xA;      (re-search-backward (concat &quot;^\\s-\\{&quot;&#xA;                                 (number-to-string pad)&#xA;                                 &quot;\\}[^ ]&quot;) nil t)&#xA;      (move-to-column col))))&#xA;&#xA;(defun ind-up-parent ()&#xA;  &quot;Move up to parent line with less indentation.&quot;&#xA;  (interactive)&#xA;  (save-match-data&#xA;    (let ((col (current-column))&#xA;          (pad (progn&#xA;                 (back-to-indentation)&#xA;                 (current-column))))&#xA;      (when (&amp;gt; pad 0)&#xA;        (beginning-of-line 1)&#xA;        (re-search-backward (concat &quot;^\\s-\\{0,&quot;&#xA;                                    (number-to-string (1- pad))&#xA;                                    &quot;\\}[^ ]&quot;) nil t))&#xA;      (move-to-column col))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="25" LastEditDate="2016-03-14T14:25:51.660" LastActivityDate="2016-03-14T14:25:51.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20903" PostTypeId="1" AcceptedAnswerId="20904" CreationDate="2016-03-10T20:05:18.560" Score="7" ViewCount="20876" Body="&lt;p&gt;I'm in a situation where I have to ssh into a machine and do all of my coding on there. For a while I would ssh in and then use tmux and &lt;code&gt;emacs -nw&lt;/code&gt; mode. Recently, I discovered the &lt;code&gt;term&lt;/code&gt; command. Now instead of using tmux, I open up normal Emacs on my desktop and use &lt;code&gt;term&lt;/code&gt; to ssh in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I'm in, I run &lt;code&gt;emacs -nw&lt;/code&gt; from within &lt;code&gt;term&lt;/code&gt; within Emacs on my desktop. This works great, and I have all of my pretty colors. The only problem is, I can't figure out how to cleanly close the &lt;code&gt;emacs -nw&lt;/code&gt; within the Emacs on my desktop. &lt;code&gt;C-x C-c&lt;/code&gt; does not work, as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I close the innermost Emacs, and get back to &lt;code&gt;term&lt;/code&gt;?&lt;/strong&gt; Is there a better way to edit files via ssh?&lt;/p&gt;&#xA;" OwnerDisplayName="user8810" LastActivityDate="2016-03-10T22:37:16.060" Title="How can I quit Emacs from within a term within Emacs?" Tags="|terminal-emacs|ssh|term|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20904" PostTypeId="2" ParentId="20903" CreationDate="2016-03-10T20:08:20.840" Score="15" Body="&lt;p&gt;There are a few answers here.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Quitting Emacs without &lt;code&gt;C-x C-c&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;First, you can quit emacs by running the command that &lt;code&gt;C-x C-c&lt;/code&gt; is bound to: &lt;code&gt;M-x save-buffers-kill-terminal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Alternatives to recursive Emacs&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Emacs is able to edit files on remote servers, so you don't even need to ssh into the remote server, and you won't need an Emacs inside a term inside your original Emacs. This functionality is called &lt;a href=&quot;https://www.gnu.org/software/tramp/&quot;&gt;TRAMP&lt;/a&gt;, an acronym for &quot;Transparent Remote (file) Access, Multiple Protocol&quot;. To edit a file on a remote server, run &lt;code&gt;C-x C-f&lt;/code&gt; like normal, but instead of finding the file normally, use a &lt;a href=&quot;https://www.gnu.org/software/tramp/#File-name-Syntax&quot;&gt;special format for the file path&lt;/a&gt;: &lt;code&gt;/user@host:path/to.file&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to edit the file located at &lt;code&gt;/etc/hosts&lt;/code&gt; on the remote server &lt;code&gt;my-remote-machine&lt;/code&gt;, and you need to log in as &lt;code&gt;gragas&lt;/code&gt;, find the file this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f /gragas@my-remote-machine:/etc/hosts&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will prompt you for a password if one is required. It'll transparently save the file across the network, so absent a bit longer time it takes to save, you won't even notice it's a remote file.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2016-03-10T20:25:11.493" LastActivityDate="2016-03-10T20:25:11.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20905" PostTypeId="2" ParentId="20903" CreationDate="2016-03-10T20:43:21.583" Score="1" Body="&lt;pre class=&quot;lang-bash prettyprint-override&quot;&gt;&lt;code&gt;kill $(ps -o ppid= -p $$)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is a bit more general: when run from terminal started from Emacs it will look for the parent process of the current process (&lt;code&gt;$$&lt;/code&gt; is shell's way to get the process id of the current process).  And kill it.  You could put this in your bash profile as a function or alias to make it easier to type, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ekill() { kill $(ps -o ppid= -p $$) }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your &lt;code&gt;~/.bash_profile&lt;/code&gt; (on remote machine), and then you'd only need to type &lt;code&gt;ekill&lt;/code&gt; once you want to kill Emacs from inside &lt;code&gt;term&lt;/code&gt; run by Emacs.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-03-10T20:43:21.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20907" PostTypeId="2" ParentId="20896" CreationDate="2016-03-10T21:34:08.947" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I actually don't need/want most of the electricity. A solution which involves turning off electric-indent-mode but somehow activating the &quot;add whitespace for new lines&quot; feature would be fine with me.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This approach might be of interest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In programming modes I invariably want &lt;kbd&gt;RET&lt;/kbd&gt; to invoke &lt;code&gt;indent-new-comment-line&lt;/code&gt; or its mode-specific analogue, which always has a default binding of &lt;kbd&gt;M-j&lt;/kbd&gt;. These functions take care of indentation, and also comment continuation when you're inside one.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-coding-config ()&#xA;  ;; ...&#xA;  (local-set-key (kbd &quot;RET&quot;) (key-binding (kbd &quot;M-j&quot;)))&#xA;  (local-set-key (kbd &quot;&amp;lt;S-return&amp;gt;&quot;) 'newline)&#xA;  )&#xA;&#xA;(mapc&#xA; (lambda (language-mode-hook)&#xA;   (add-hook language-mode-hook 'my-coding-config))&#xA; '(prog-mode-hook&#xA;   ;; plus anything not derived from prog-mode:&#xA;   inferior-emacs-lisp-mode-hook&#xA;   css-mode-hook&#xA;   python-mode-hook))&#xA;&#xA;(add-hook 'js-mode-hook 'my-js-mode-hook)&#xA;(defun my-js-mode-hook ()&#xA;  ;; Fix M-j behaviour in block comments in js-mode&#xA;  (setq-local comment-multi-line t)&#xA;  (local-set-key [remap indent-new-comment-line] 'c-indent-new-comment-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-03-10T21:34:08.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20908" PostTypeId="1" CreationDate="2016-03-10T22:00:48.307" Score="1" ViewCount="202" Body="&lt;p&gt;I know this is a slightly odd request, but I'd like to make all the mode lines for windows within a frame identical. I'm using powerline with the default spacemacs theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if I have three windows open with three different active buffers, I'd like the mode lines for all three to show information about the buffer in the &lt;strong&gt;currently selected&lt;/strong&gt; window. (And if I select a new window, they should all change.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got the inactive/active styles to line up by redefining &lt;code&gt;powerline-selected-window-active&lt;/code&gt; to always return &lt;code&gt;t&lt;/code&gt;, but I can't figure out how to point them at the selected window's buffer rather than their own active buffer.&lt;/p&gt;&#xA;" OwnerUserId="10445" LastActivityDate="2016-03-10T22:00:48.307" Title="Powerline: display selected window's mode line in all windows" Tags="|mode-line|powerline|mode-line-format|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20910" PostTypeId="1" AcceptedAnswerId="20919" CreationDate="2016-03-11T01:20:28.930" Score="6" ViewCount="2863" Body="&lt;p&gt;that’s some time yet I began to use emacs as much as possible for quite everything (org-mode, Gnus, etc.), but I’m still maintaining a single file with a list of names, numbers, adresses, etc. manually… And I know there’s BBDB inside emacs, which seems to be linked to a lot of things… How to learn to use it? What is it supposed to do exactly? How? Why? etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now I just found the v2 manual (outdated it seems) and this post: &lt;a href=&quot;https://emacs.stackexchange.com/questions/16690/where-is-the-canonical-location-for-the-bbdb-manual&quot;&gt;Where is the canonical location for the BBDB manual?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11375" LastActivityDate="2016-03-11T09:10:24.583" Title="How to learn to use bbdb?" Tags="|gnus|bbdb|" AnswerCount="1" CommentCount="1" ClosedDate="2016-03-11T13:33:52.443" ContentLicense="CC BY-SA 3.0" />
  <row Id="20911" PostTypeId="2" ParentId="20891" CreationDate="2016-03-11T02:29:39.477" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Does that mean that on every call of &lt;code&gt;adjust-fill-column&lt;/code&gt; &lt;code&gt;varref&lt;/code&gt; and &lt;code&gt;varset&lt;/code&gt; do hash lookup? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No.  In Emacs Lisp, the hashing is only done by the reader to convert the strings into symbols (this is called interning).  After being read, the string names of the symbols are irrelevant because what gets evaluated is a list structure (or equivalent bytecode if you are byte-compiling) containing references to the symbols themselves, not their names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also have distinct symbols with the same name, for example the code below has two variables named &lt;code&gt;a-var&lt;/code&gt;, but both are different symbols with different values, so obviously it's no help to hash &lt;code&gt;a-var&lt;/code&gt; when calling &lt;code&gt;fun&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((var1 (make-symbol &quot;a-var&quot;))&#xA;       (var2 (make-symbol &quot;a-var&quot;))&#xA;       (fun `(lambda (val1 val2)&#xA;               (setq ,var1 val1)&#xA;               (setq ,var2 val2)&#xA;               (message &quot;var1(%S) = %S, var2(%S) = %S&quot;&#xA;                        ',var1 ,var1 ',var2 ,var2))))&#xA;  (disassemble fun)&#xA;  (funcall fun 1 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Prints the message &lt;code&gt;var1(a-var) = 1, var2(a-var) = 2&lt;/code&gt; with the disassembly&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;byte code:&#xA;  args: (val1 val2)&#xA;0       varref    val1&#xA;1       varset    a-var&#xA;2       varref    val2&#xA;3       varset    a-var&#xA;4       constant  message&#xA;5       constant  &quot;var1(%S) = %S, var2(%S) = %S&quot;&#xA;6       constant  a-var&#xA;7       varref    a-var&#xA;8       constant  a-var&#xA;9       varref    a-var&#xA;10      call      5&#xA;11      return    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you &lt;code&gt;(setq print-gensym t)&lt;/code&gt; then you will get &lt;code&gt;#:a-var&lt;/code&gt; instead of &lt;code&gt;a-var&lt;/code&gt;, which is a hint that the symbol is not part of the global &lt;code&gt;obarray&lt;/code&gt; (and is therefore not necessarily the same as other &lt;code&gt;#:a-var&lt;/code&gt;s you see).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2016-03-11T16:15:13.160" LastActivityDate="2016-03-11T16:15:13.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20912" PostTypeId="1" AcceptedAnswerId="20917" CreationDate="2016-03-11T02:57:18.197" Score="1" ViewCount="146" Body="&lt;p&gt;When exporting source code blocks in Org 8.2.10 to HTML, some programming languages (e.g. Java)  display the language name on hover, like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1gDJY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1gDJY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for other languages (e.g. Common Lisp), no name displays on hover.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/I9jLI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/I9jLI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this expected behavior, or a bug?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-03-11T08:18:01.750" Title="Org-babel Common Lisp as HTML" Tags="|org-export|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20913" PostTypeId="1" AcceptedAnswerId="20915" CreationDate="2016-03-11T06:12:11.853" Score="3" ViewCount="5174" Body="&lt;p&gt;I would like to have NeoTree automatically toggle-open upon Emacs start up. I have tried adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(neotree-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;under my:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'neotree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;line in &lt;code&gt;~/.spacemacs&lt;/code&gt; (and yes, I am using Spacemacs too, if that is somehow relevant) in order to get NeoTree to automatically toggle open upon startup, but it failed. It gives an error such that Spacemacs is not even loaded, see &lt;a href=&quot;https://i.stack.imgur.com/qIFOf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;this screenshot&lt;/a&gt; for further details, if relevant (&lt;a href=&quot;http://paste2.org/f1wCJ0NF&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; is the &lt;code&gt;~/.spacemacs&lt;/code&gt; file I was using when I got this error). I know that adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [f8] 'neotree-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;~/.spacemacs&lt;/code&gt; file, after the require line will cause it so that if I press &lt;kbd&gt;F8&lt;/kbd&gt; after Emacs startup it will toggle the NeoTree open, but I would like to rewrite my &lt;code&gt;~/.spacemacs&lt;/code&gt; file such that it toggles the NeoTree open automatically on startup, is this possible?&lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="11131" LastEditDate="2016-03-11T06:17:32.053" LastActivityDate="2016-03-11T07:40:11.117" Title="How to auto-toggle NeoTree on startup?" Tags="|start-up|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20914" PostTypeId="1" AcceptedAnswerId="20921" CreationDate="2016-03-11T06:51:52.100" Score="2" ViewCount="173" Body="&lt;p&gt;alchemist.el has functions for running tests. These functions use &lt;code&gt;display_buffer&lt;/code&gt; to show test results. Is there a way to ensure that all Alchemist test results open in a window that is the bottom-most window? In other words, if I have two windows, split vertically, one is the test file, when I run the test, it should create a 3rd window beneath the two that are split. &lt;/p&gt;&#xA;" OwnerUserId="10355" LastEditorUserId="105" LastEditDate="2016-03-13T21:53:08.653" LastActivityDate="2016-03-14T07:49:32.837" Title="How could I get alchemist to always open its test report in a window at the bottom?" Tags="|window-splitting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20915" PostTypeId="2" ParentId="20913" CreationDate="2016-03-11T07:18:50.180" Score="10" Body="&lt;p&gt;&lt;code&gt;neotree-mode&lt;/code&gt; is a major mode for the neotree buffer, and major mode functions do not take any arguments, so calling &lt;code&gt;(neotree-mode t)&lt;/code&gt; is an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You wouldn't want to invoke that mode yourself, though -- it's only intended to be called from neotree's own buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Unlike &lt;em&gt;minor&lt;/em&gt; modes -- it's very common to call a global minor mode directly from your init file, so you want to establish what sort of a mode any given &lt;code&gt;*-mode&lt;/code&gt; is before trying to use it. You can invariably do so by invoking &lt;code&gt;describe-function&lt;/code&gt;: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;neotree-mode&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; -- at minimum you will learn whether or not the function accepts any arguments.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you actually wanted to do here is call the command you were already calling via your keybinding, which is &lt;code&gt;neotree-toggle&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(neotree-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although I can see that there's actually a better function to call:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(neotree-show)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(which is the function called by the 'toggle' command when neotree is not currently visible.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Occasionally you might need to use &lt;code&gt;call-interactively&lt;/code&gt; to mimic a key binding more directly -- e.g.: &lt;code&gt;(call-interactively 'neotree-show)&lt;/code&gt; -- but that's not the case here.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;FYI, the different kinds of mode functions you'll encounter in Emacs are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Major modes: Every buffer is running a single major mode. If you call a different major mode in a buffer, it replaces the previous one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Buffer-local minor modes: These are enabled or disabled on a per-buffer basis. They are typically invoked via the &lt;em&gt;mode hook&lt;/em&gt; of another mode (often a major mode).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Global minor modes: These have a global state and so are either on or off for Emacs globally, and hence might be called directly in your init file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;'Globalized' minor modes: These are global minor modes which &lt;em&gt;control&lt;/em&gt; a separate buffer-local minor mode. When the globalized mode is enabled, it causes the buffer-local mode to be enabled en-masse in multiple buffers, and also arranges for it to be enabled in subsequent new buffers as appropriate. When the globalized mode is disabled, the buffer-local mode is also disabled en-masse.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-03-11T07:40:11.117" LastActivityDate="2016-03-11T07:40:11.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20916" PostTypeId="2" ParentId="20099" CreationDate="2016-03-11T07:45:35.040" Score="0" Body="&lt;p&gt;So, I solved this particular issue in both vanilla Emacs and Aquamacs by running &lt;code&gt;TERM=screen-256color&lt;/code&gt; before running &lt;code&gt;tmux&lt;/code&gt;. Apparently &lt;code&gt;$TERM&lt;/code&gt; was set to &lt;code&gt;eterm-color&lt;/code&gt;, thus causing the problem with &lt;code&gt;tmux&lt;/code&gt;. A caveat for &lt;code&gt;tmux&lt;/code&gt; in *macs, though: I did notice that sometimes I could see &lt;code&gt;tmux&lt;/code&gt; rendering things slowly because I could see the point cascading across the screen after some commands, which was mildly annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, I've tried out Melioratus's suggestion for using the &lt;a href=&quot;https://www.emacswiki.org/emacs/MultiTerm&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;multi-term&lt;/code&gt;&lt;/a&gt; package and have found that it works pretty well. Granted, it needs some configuration to work well with multiple windows (i.e., panes within a frame), but I've found that &lt;a href=&quot;https://www.emacswiki.org/emacs/WinnerMode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;winner-mode&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/WindMove&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;windmove&lt;/code&gt;&lt;/a&gt; might mitigate this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I found a blog post here which might help start off with &lt;code&gt;multi-term&lt;/code&gt; (but haven't read too much of it yet): &lt;a href=&quot;http://rawsyntax.com/blog/learn-emacs-zsh-and-multi-term/&quot; rel=&quot;nofollow&quot;&gt;http://rawsyntax.com/blog/learn-emacs-zsh-and-multi-term/&lt;/a&gt;. Personally, I'm not leaving &lt;code&gt;tmux&lt;/code&gt; for &lt;code&gt;multi-term&lt;/code&gt; for the time being, but I think that I'll be using both and leveraging the ability to use the terminal in *macs to see what good can come of it.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastActivityDate="2016-03-11T07:45:35.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20917" PostTypeId="2" ParentId="20912" CreationDate="2016-03-11T08:18:01.750" Score="2" Body="&lt;p&gt;Those lines in ox-html.el cause (among others) the hovering &quot;Java&quot; tag:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pre.src:hover:before { display: inline;}&#xA;pre.src-sh:before    { content: 'sh'; }&#xA;pre.src-bash:before  { content: 'sh'; }&#xA;pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }&#xA;pre.src-R:before     { content: 'R'; }&#xA;pre.src-perl:before  { content: 'Perl'; }&#xA;pre.src-java:before  { content: 'Java'; }&#xA;pre.src-sql:before   { content: 'SQL'; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Those are all languages defined, there is no &quot;Lisp&quot; or &quot;Common Lisp&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you test-add the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pre.src-lisp:before {content: 'Common Lisp'; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the exported CSS file, you'll see a &quot;Common Lisp&quot; hover.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't classify this as a bug, though you're right, a language name ought to be displayed for supported babel languages.&lt;/p&gt;&#xA;" OwnerUserId="11342" LastActivityDate="2016-03-11T08:18:01.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20918" PostTypeId="2" ParentId="16690" CreationDate="2016-03-11T09:00:55.960" Score="1" Body="&lt;p&gt;The canonical location of the BBDBv3 manual is in the &lt;a href=&quot;http://git.savannah.gnu.org/cgit/bbdb.git&quot; rel=&quot;nofollow&quot;&gt;source repo of BBDBv3&lt;/a&gt; at the savannah project page, i.e. at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/bbdb.git/tree/doc/bbdb.texi&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/cgit/bbdb.git/tree/doc/bbdb.texi&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11379" LastActivityDate="2016-03-11T09:00:55.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20919" PostTypeId="2" ParentId="20910" CreationDate="2016-03-11T09:10:24.583" Score="4" Body="&lt;p&gt;It's basically very simple:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just type &lt;code&gt;M-x bbdb RET RET&lt;/code&gt;. You'll end up in an empty contacts list, a BBDB buffer. Then start inserting contacts :-). Have a look at the menu. That should get you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have some contacts you can search for them, print or export them, use completion with them when sending mail, refer to them in org-mode buffers or even dial them using an external  sip client.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As with everything in Emacs the sky is the limit.&lt;/p&gt;&#xA;" OwnerUserId="11379" LastActivityDate="2016-03-11T09:10:24.583" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20921" PostTypeId="2" ParentId="20914" CreationDate="2016-03-11T16:53:28.123" Score="3" Body="&lt;p&gt;You can use the &lt;a href=&quot;https://github.com/m2ym/popwin-el&quot; rel=&quot;nofollow&quot;&gt;popwin.el&lt;/a&gt; or &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow&quot;&gt;shackle.el&lt;/a&gt; emacs package or the emacs native display-buffer &lt;a href=&quot;https://gist.github.com/tonini/0d3f9433b214044a870e&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/tonini/0d3f9433b214044a870e&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Display alchemist buffers always at the right side&#xA;;; Just change (side . right) with the position you would like 'bottom, 'top, 'right or 'left&#xA;;; Source: http://www.lunaryorn.com/2015/04/29/the-power-of-display-buffer-alist.html&#xA;(add-to-list 'display-buffer-alist&#xA;             `(,(rx bos (or &quot;*alchemist test report*&quot;&#xA;                            &quot;*alchemist mix*&quot;&#xA;                            &quot;*alchemist help*&quot;))&#xA;                    (display-buffer-reuse-window&#xA;                     display-buffer-in-side-window)&#xA;               (reusable-frames . visible)&#xA;               (side            . right)&#xA;               (window-width   . 0.5)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you need additional help call me on the #emacs-elixir channel on freenode irc. (Nick: tonini)&lt;/p&gt;&#xA;" OwnerUserId="2269" LastEditorUserId="2269" LastEditDate="2016-03-14T07:49:32.837" LastActivityDate="2016-03-14T07:49:32.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20922" PostTypeId="1" AcceptedAnswerId="20925" CreationDate="2016-03-11T19:09:15.180" Score="3" ViewCount="387" Body="&lt;p&gt;I want to combine the commands hs-hide-all and hs-show-all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be great if I'd have a function that detects the &quot;status&quot; of all blocks. If there are blocks that aren't hidden, the function should hide them, thus all blocks are hidden.&#xA;Applying it when all blocks are hidden, the function ought to show all of them.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-03-12T02:35:52.063" Title="hiding and showing all blocks with one binding" Tags="|hideshow|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20923" PostTypeId="1" AcceptedAnswerId="20924" CreationDate="2016-03-11T19:22:39.337" Score="1" ViewCount="44" Body="&lt;p&gt;I'm experienced with elisp, and I'm using emacs 24.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to modify how fill-paragraph works for a special application, and I'm trying to figure out which elisp code handles the case where a short word followed by a period always goes to the next line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, assume that some text looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Period at the end. And then blahblahblah and additional blahblahblah.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This text gets filled as follows (assume fill-column is 30):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Period at the&#xA;end. And then blahblahblah and&#xA;additional blahblahblah.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the word &quot;end&quot; gets moved to the next line, even though the text length hasn't reached the fill-column value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to find the elisp code that handles this, so I can write my own version of this which overrides this behavior. I want the result to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Period at the end. And then&#xA;blahblahblah and additional&#xA;blahblahblah.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could anyone point me to the 24.5 elisp code which handles this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="105" LastEditDate="2016-03-12T00:35:41.730" LastActivityDate="2016-03-12T00:35:41.730" Title="What module handles word+period within paragraph fill?" Tags="|fill-paragraph|sentences|wrapping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20924" PostTypeId="2" ParentId="20923" CreationDate="2016-03-11T19:28:51.143" Score="1" Body="&lt;p&gt;What you are looking at is called &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Sentences.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;sentence-end-double-space&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is quite a bit of flexibility there, so I will not rehash the manual here.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-03-11T19:28:51.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20925" PostTypeId="2" ParentId="20922" CreationDate="2016-03-11T19:43:59.353" Score="4" Body="&lt;p&gt;&lt;code&gt;hideshow&lt;/code&gt; uses overlays to hide text. Because of this you can make the semi-maybe-safe assumption that if the number of overlays in the current buffer doesn't increase after running &lt;code&gt;hs-hide-all&lt;/code&gt;, then all top level blocks must have been already hidden.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-hs-toggle-all ()&#xA;  &quot;If anything isn't hidden, run `hs-hide-all', else run `hs-show-all'.&quot;&#xA;  (interactive)&#xA;  (let ((starting-ov-count (length (overlays-in (point-min) (point-max)))))&#xA;    (hs-hide-all)&#xA;    (when (equal (length (overlays-in (point-min) (point-max))) starting-ov-count)&#xA;      (hs-show-all))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I couldn't see an obvious &quot;right&quot; way to do this in &lt;code&gt;hideshow&lt;/code&gt; but this hack seems to work.&lt;/p&gt;&#xA;" OwnerUserId="160" LastEditorUserId="160" LastEditDate="2016-03-12T02:35:52.063" LastActivityDate="2016-03-12T02:35:52.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20926" PostTypeId="2" ParentId="19071" CreationDate="2016-03-11T21:36:19.630" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/cofi/evil-leader&quot; rel=&quot;nofollow&quot;&gt;Per documentation on evil-leader Github site&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note: You should enable &lt;code&gt;global-evil-leader-mode&lt;/code&gt; before you enable&#xA;  &lt;code&gt;evil-mode&lt;/code&gt;, otherwise &lt;code&gt;evil-leader&lt;/code&gt; won’t be enabled in initial buffers&#xA;  (&lt;code&gt;*scratch*&lt;/code&gt;, &lt;code&gt;*Messages*&lt;/code&gt;, …).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11382" LastEditorUserId="35" LastEditDate="2016-06-10T02:55:57.487" LastActivityDate="2016-06-10T02:55:57.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20927" PostTypeId="1" CreationDate="2016-03-11T22:36:39.887" Score="2" ViewCount="2359" Body="&lt;p&gt;I'm trying to write something that will disable a certain mode (fci-mode) if a buffer's visible width is under a certain amount. I know about the &lt;code&gt;(window-width)&lt;/code&gt; function, however, that doesn't change if the window is vertically split (so the buffer is only half as wide).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a method I can call that gives the visible width of a buffer in characters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[EDIT] Stefan pointed out that &lt;code&gt;(window-width)&lt;/code&gt; &lt;em&gt;does&lt;/em&gt; change when a window is split. I was testing this incorrectly.&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="379" LastEditDate="2016-03-11T23:34:25.823" LastActivityDate="2018-10-10T11:54:40.733" Title="How to get the buffer's visible width?" Tags="|buffers|window|window-splitting|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20929" PostTypeId="1" CreationDate="2016-03-12T00:13:23.887" Score="1" ViewCount="798" Body="&lt;p&gt;&lt;a href=&quot;http://juanjoalvarez.net/es/detail/2014/sep/19/vim-emacsevil-chaotic-migration-guide/&quot; rel=&quot;nofollow noreferrer&quot;&gt;This blog post&lt;/a&gt; on migrating from vim to evil-mode in emacs gives code to make a single ESC quit/cancel &lt;code&gt;helm&lt;/code&gt; instead of 3.  It worked on Emacs.app (OS X) but doesn't work from Terminal.app (both emacs 24.x); that is, quitting &lt;code&gt;helm&lt;/code&gt; requires ESC ESC ESC in Terminal emacs but not in Emacs.app.  How can I get this functionality for emacs in Terminal.app?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the blog:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; esc quits&#xA;(defun minibuffer-keyboard-quit ()&#xA;  &quot;Abort recursive edit.&#xA;In Delete Selection mode, if the mark is active, just deactivate it;&#xA;then it takes a second \\[keyboard-quit] to abort the minibuffer.&quot;&#xA;  (interactive)&#xA;  (if (and delete-selection-mode transient-mark-mode mark-active)&#xA;      (setq deactivate-mark  t)&#xA;    (when (get-buffer &quot;*Completions*&quot;) (delete-windows-on &quot;*Completions*&quot;))&#xA;    (abort-recursive-edit)))&#xA;(define-key evil-normal-state-map [escape] 'keyboard-quit)&#xA;(define-key evil-visual-state-map [escape] 'keyboard-quit)&#xA;(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)&#xA;(global-set-key [escape] 'evil-exit-emacs-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to figure out the answer &lt;a href=&quot;https://emacs.stackexchange.com/questions/4062/evil-mode-make-helm-quit-with-the-escape-key&quot;&gt;here&lt;/a&gt;, but after looking at a number of tutorials on using &lt;code&gt;defun&lt;/code&gt; I'm stuck.  I have a number of arguments error as well as a free-variable error and I don't know what these things mean (that is, I don't understand the syntax of how the function is called nor do I understand what it is count&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I blindly tried something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-helm-quit-key ()                                 &#xA;  (define-key helm-map (kbd &quot;ESC&quot;) helm-keyboard-quit-key))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then &lt;code&gt;(add-hook 'after-init-hook 'my-helm-quit-key)&lt;/code&gt; but that didn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I later found another post about it &lt;a href=&quot;https://spwhitton.name/blog/entry/eviltricks/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, but after installing bind-key I still get the error &quot;reference to free variable &lt;code&gt;helm-map&lt;/code&gt;&quot;.  Where does &lt;code&gt;helm-map&lt;/code&gt; come from?  I believe I have the latest version of helm and helm-gtags and helm-core installed...  The stuff I used from that site is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; escape quits&#xA;(bind-key &quot;&amp;lt;escape&amp;gt;&quot; 'isearch-cancel isearch-mode-map)&#xA;(bind-key &quot;&amp;lt;escape&amp;gt;&quot; 'helm-keyboard-quit helm-map)&#xA;(bind-key &quot;&amp;lt;escape&amp;gt;&quot; 'helm-keyboard-quit helm-comp-read-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-03-12T10:08:57.203" Title="single escape to quit helm in terminal" Tags="|evil|term|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20930" PostTypeId="1" AcceptedAnswerId="20945" CreationDate="2016-03-12T11:08:23.870" Score="1" ViewCount="324" Body="&lt;p&gt;I like using python-shell-send-buffer, but I am annoyed of looking for the command's buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm looking for a function, that recognizes whether the buffer is already displayed. Since I use two windows on one frame, when coding in python, it would be nice if the function also checks if there are already two windows on the current frame. If not, it has to split the frame horizontally. Additionally I want the buffers to be automatically positioned, as I'm used to have my source code on the left side and the python shell with the output on the right side.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-10-09T18:02:58.247" Title="pop up buffer / window when using python-shell-send-buffer" Tags="|python|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20931" PostTypeId="1" AcceptedAnswerId="20979" CreationDate="2016-03-12T12:07:49.543" Score="5" ViewCount="1647" Body="&lt;p&gt;I'd like to use Emacs for XML editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A long, long time ago I recall using pSGML to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that I've returned to Emacs I'd like to have tag autocompletion and easy navigation in XML files. Unfortunately, pSGML has fallen into disrepair and I have to make do with nXML.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&lt;p&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&#xA; &#xA;&#xA;&#xA;&lt;/p&gt;&#xA;&#xA;&#xA;" OwnerUserId="10742" LastEditorUserId="10742" LastEditDate="2016-03-15T05:48:14.767" LastActivityDate="2016-03-15T06:28:15.880" Title="How do I edit an XML file in Emacs with tag autocompletion from a known XSD schema?" Tags="|nxml|xml|xml-schema|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20932" PostTypeId="1" AcceptedAnswerId="20933" CreationDate="2016-03-12T15:19:58.153" Score="2" ViewCount="2173" Body="&lt;p&gt;I am trying to insert images into an org-file using absolute paths (which include spaces) and a description, and then export them to PDF via LaTeX.&lt;/p&gt;&#xA;&lt;p&gt;I am entering the link using &lt;code&gt;C-c C-l&lt;/code&gt;, which &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2008-01/msg00372.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;should deal with the spaces itself&lt;/a&gt;, and I have tried it with and without the file: prefix - although that &lt;a href=&quot;http://orgmode.org/guide/External-links.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;shouldn't make a difference&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I have also tried inserting the link by &lt;a href=&quot;http://pragmaticemacs.com/emacs/org-mode-basics-iii-add-links-and-images-to-you-notes/&quot; rel=&quot;nofollow noreferrer&quot;&gt;selecting the file through emacs&lt;/a&gt; itself, using &lt;code&gt;C-u C-c C-l&lt;/code&gt;, but the results is the same.&lt;/p&gt;&#xA;&lt;p&gt;I have also tried changing the path to escape the spaces, and using a URL style path, all to no avail.&lt;/p&gt;&#xA;&lt;p&gt;The closest thing I can get to a solution so far is to not include a description, e.g. &lt;code&gt;[[[file:path/to/file.png]]]&lt;/code&gt;, which does insert the image, however it also inserts the full path as text, wrapped around the image.&lt;/p&gt;&#xA;&lt;h3&gt;Attempts so far:&lt;/h3&gt;&#xA;&lt;p&gt;Base link: &lt;code&gt;/Home/Images/Emojis once extracted/example.png&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[file:/Home/Images/Emojis once extracted/example.png][Test1]]&#xA;&#xA;[[file:/Home/Images/Emojis\ once\ extracted/example.png][Test2]]&#xA;&#xA;[[/Home/Images/Emojis\ once\ extracted/example.png][Test3]]&#xA;&#xA;[[file:///Home/Images/Emojis%20once%20extracted/example.png][Test4]]&#xA;&#xA;[[file:/Home/Images/Emojis\ once\ extracted/example.png]]    ## Test5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Here is a preview of the org buffer:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/G30hf.png&quot; alt=&quot;[preview of links in Emacs]&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have org-version &lt;strong&gt;8.2.10&lt;/strong&gt; running in &lt;strong&gt;Emacs 24.5&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h2&gt;Edit 1:&lt;/h2&gt;&#xA;&lt;p&gt;Using the org function &lt;code&gt;C-u C-c C-l&lt;/code&gt; (universal add link), and with no description, the image is placed in the pdf. However, if there are any spaces in the link to that file, then all characters following that space are also  inserted to the pdf alongside the image.&lt;/p&gt;&#xA;&lt;p&gt;Here is an example of the PDF output from this line of code in the org file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#CAPTION: A funny image&#xA;[[file:/path/to_file 4.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QY2gc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QY2gc.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2&gt;Edit 2:&lt;/h2&gt;&#xA;&lt;p&gt;If I escape the spaces in the path, there is an error (found in buffer: &lt;code&gt;*Org PDF LaTeX Output*&lt;/code&gt;, which is a package error, but says it cannot find the image and the following is produced in the PDF output:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LeN34.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LeN34.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2&gt;Edit 3:&lt;/h2&gt;&#xA;&lt;p&gt;@John Kitchin 's answer below worked well for me. I also came across a customisation of his for &lt;code&gt;drag-n-drop&lt;/code&gt; functionality that also solves this problem &lt;strong&gt;and&lt;/strong&gt; adds even better functionality. I recommend people check out &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2015/07/10/Drag-images-and-files-onto-org-mode-and-insert-a-link-to-them/&quot; rel=&quot;nofollow noreferrer&quot;&gt;the full-description  with code&lt;/a&gt; and &lt;a href=&quot;https://www.youtube.com/watch?v=ahqKXbBVjpQ&quot; rel=&quot;nofollow noreferrer&quot;&gt;the accompanying video&lt;/a&gt;!&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-15T16:39:52.313" Title="Adding links to locally stored images with a description to an org file" Tags="|org-mode|org-export|images|hyperlinks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20933" PostTypeId="2" ParentId="20932" CreationDate="2016-03-12T15:51:11.903" Score="4" Body="&lt;p&gt;I don't understand what you are hoping to get or expecting. I think if you have a description, you will get a hyperlink to the file, not the image itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of these two links, the first turns into the word test which is hyperlinked to the file, and the second is shown as the image in the pdf for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+latex_header: \usepackage[space]{grffile}&#xA;&#xA;[[file:emoji with space/scientist.png][test]]&#xA;&#xA;[[file:emoji with space/scientist.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It might make sense to generate the links with something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results org raw&#xA;(require 'f)&#xA;(let ((dir &quot;emoji with space&quot;))&#xA;  (mapconcat 'identity&#xA;         (cl-loop for img in (f-files dir)&#xA;do (message img)&#xA;              if (f-ext? img &quot;png&quot;)&#xA;              collect (format &quot;#+caption: %s\n[[%s]]&quot;&#xA;                      img (expand-file-name img dir)))&#xA;         &quot;\n\n&quot;))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2016-03-12T16:54:17.443" LastActivityDate="2016-03-12T16:54:17.443" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20934" PostTypeId="2" ParentId="20914" CreationDate="2016-03-12T16:23:29.473" Score="1" Body="&lt;p&gt;Here is how to do it with popwin:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(push '(&quot;*alchemist test report*&quot; :position bottom :noselect t)&#xA;    popwin:special-display-config)&#xA;(push '(&quot;*alchemist mix*&quot; :position bottom :noselect t)&#xA;    popwin:special-display-config)&#xA;(push '(&quot;*alchemist help*&quot; :position bottom :noselect t)&#xA;    popwin:special-display-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10355" LastActivityDate="2016-03-12T16:23:29.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20935" PostTypeId="1" AcceptedAnswerId="20937" CreationDate="2016-03-12T16:57:46.310" Score="0" ViewCount="75" Body="&lt;p&gt;first post :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wondered if anyone knew a way to quickly change the dired path of of the additional dired (in a split window) to the current dired path? like the traditional OFM synchronize panes?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="9995" LastEditDate="2016-03-12T17:19:27.663" LastActivityDate="2016-04-11T21:42:33.057" Title="Synchronize current dired path to next dired dir shown in a split window" Tags="|dired|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20936" PostTypeId="1" AcceptedAnswerId="21114" CreationDate="2016-03-12T20:52:54.807" Score="4" ViewCount="163" Body="&lt;p&gt;I use the auto-complete feature of LaTeX-environment often.  I'd like to be able to remove entries from the auto-complete list.  I usually need to use the packages amsmath and amsthm, which introduce lots of environments I don't use. I'd prefer not to have them in my auto-complete list (so that I can type fewer characters to find the environment I want).  Is there a way to have this happen automatically after I open a file?&lt;/p&gt;&#xA;" OwnerUserId="11389" LastEditorUserId="253" LastEditDate="2016-03-12T21:04:49.203" LastActivityDate="2016-03-20T19:42:36.873" Title="AUCTeX - removing an environment from auto-complete list" Tags="|latex|auctex|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20937" PostTypeId="2" ParentId="20935" CreationDate="2016-03-12T21:22:44.530" Score="2" Body="&lt;p&gt;Not sure what you want to do with that. You can duplicate the buffer as suggested by @lawlist but then you have both windows displaying the same buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If what you want is two separate dired buffers visiting the same directory (so that you can for example insert subdirs in one but not in the other) you can try this (this is quickly hacked code so it may have pitfalls but it seems to work).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/get-other-dired-directory ()&#xA;  &quot;find name and directory of another dired buffer&quot;&#xA;  (let ((bs (buffer-list))&#xA;        (here (current-buffer))&#xA;        this)&#xA;    (mapc (lambda (b) (unless (equal b here)&#xA;            (with-current-buffer b&#xA;              (if dired-directory&#xA;                  (setq this (cons (buffer-name) dired-directory)))))) bs)&#xA;    this))&#xA;&#xA;(defun my/set-dired-dir-to-other ()&#xA;  &quot;Change the dired directory to the one of another existing dired buffer&quot;&#xA;  (interactive)&#xA;  (let ((d (my/get-other-dired-directory)))&#xA;    (if d&#xA;        (progn&#xA;          (setq dired-directory (cdr d)&#xA;                default-directory (cdr d))&#xA;          (revert-buffer)&#xA;          (rename-buffer (generate-new-buffer-name (car d))))&#xA;      (message &quot;No other dired buffer&quot;))))&#xA;&#xA;(add-hook 'dired-mode-hook&#xA;      (lambda () (define-key dired-mode-map &quot;z&quot; #'my/set-dired-dir-to-other)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What this code does is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;find another dired buffer, get its name and directory,&lt;/li&gt;&#xA;&lt;li&gt;if found, change the directory of the current dired buffer, revert it (update content) and change its name (since the name is supposed to reflect the visited directory)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is bound to the &lt;code&gt;z&lt;/code&gt; key.  As usual, put this in your init file.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-03-12T21:22:44.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20938" PostTypeId="1" CreationDate="2016-03-12T23:17:45.613" Score="2" ViewCount="243" Body="&lt;p&gt;I installed &lt;a href=&quot;http://melpa.org/#/impatient-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;impatient-mode&lt;/code&gt; through MELPA&lt;/a&gt;, and I'm having some trouble with the CSS functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I create a directory called &lt;code&gt;temp&lt;/code&gt; with an HTML file and a CSS file inside:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;temp&#xA;├── index.html&#xA;└── stylesheet.css&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;index.html&lt;/code&gt; looks something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&#xA;&amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;&#xA;&amp;lt;title&amp;gt;Hello, world!&amp;lt;/title&amp;gt;&#xA;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;stylesheet.css&quot;&amp;gt;&#xA;&amp;lt;p&amp;gt;Hello, world!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then start &lt;code&gt;simple-httpd&lt;/code&gt; and &lt;code&gt;impatient-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f temp/index.html RET&#xA;M-x httpd-serve-directory RET RET&#xA;M-x impatient-mode RET&#xA;C-x C-f stylesheet.css RET&#xA;M-x impatient-mode RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and finally navigate to &lt;code&gt;http://localhost:8080/imp/live/index.html/&lt;/code&gt; in my browser, I can edit both &lt;code&gt;index.html&lt;/code&gt; and &lt;code&gt;stylesheet.css&lt;/code&gt; and see my changes in real time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I use an absolute path instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-html prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;/stylesheet.css&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the real-time view doesn't seem to work; I need to reload the HTML every time I edit the CSS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this behavior? Should I simply change the absolute paths to relative paths while I'm working on the CSS, or is there a more convenient solution? Should I submit this as an &lt;a href=&quot;https://github.com/netguy204/imp.el/issues&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastActivityDate="2016-03-12T23:17:45.613" Title="How can I use an absolute path to my CSS with impatient-mode?" Tags="|html|css|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20942" PostTypeId="1" CreationDate="2016-03-13T05:50:01.873" Score="3" ViewCount="1122" Body="&lt;p&gt;I'm currently using Flyspell to auto-correct the previous word as I type, which is convenient. However, the spell-checker I use, Hunspell, makes some strange decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the misspelled word &quot;hte&quot; is corrected in the following order:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;hate HT ht GTE the ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;when it's obvious (at least to me!) that the &lt;em&gt;first&lt;/em&gt; correction should be &quot;the&quot;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure whether this is a Flyspell problem or a Hunspell problem. Is it because Flyspell (which, as I understand it, uses &lt;code&gt;ispell&lt;/code&gt; behind the scenes) does not get enough context to do a better spell correction, or because the Hunspell dictionary is not good enough?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a better way to automatic spelling correction in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2019-03-29T13:59:00.377" Title="Improving spell correction" Tags="|flyspell|spell-checking|hunspell|" AnswerCount="4" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="20943" PostTypeId="1" CreationDate="2016-03-13T12:21:18.820" Score="1" ViewCount="370" Body="&lt;p&gt;I have proselint setup like &lt;a href=&quot;http://unconj.ca/blog/linting-prose-in-emacs.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-define-checker proselint&#xA;  &quot;A linter for prose.&quot;&#xA;  :command (&quot;proselint&quot; source-inplace)&#xA;  :error-patterns&#xA;  ((warning line-start (file-name) &quot;:&quot; line &quot;:&quot; column &quot;: &quot;&#xA;        (id (one-or-more (not (any &quot; &quot;))))&#xA;        (message) line-end))&#xA;  :modes (text-mode markdown-mode gfm-mode))&#xA;&#xA;(add-to-list 'flycheck-checkers 'proselint)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I extend it to &lt;code&gt;message-mode&lt;/code&gt;? Just adding &lt;code&gt;message-mode&lt;/code&gt; to the list of modes above is not enough. &lt;/p&gt;&#xA;" OwnerUserId="8930" LastActivityDate="2016-03-13T12:21:18.820" Title="proselint and message-mode" Tags="|flycheck|message-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20944" PostTypeId="1" CreationDate="2016-03-13T13:03:50.950" Score="1" ViewCount="19" Body="&lt;p&gt;The problem is: When I run C-c C-a (TeX-command-run-all) from the master file it goes well and produce the following output,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nFh7B.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nFh7B.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but then, when I edit other .tex file (abstract.tex for instance) and run again C-C C-a, it asks for setting the master file and everything goes smoothly except it renders the following result for the list of figures (and tables as well):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/JMG2a.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JMG2a.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if I undo the changes made, I cannot obtain the correct rendering again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to be a problem with auctex handling multiple files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: What does auctex do differently when running from a non-master file and if there is a solution for this overlapping label problem.&lt;/p&gt;&#xA;" OwnerUserId="11394" LastActivityDate="2016-03-13T13:03:50.950" Title="Overlapping table of figure (and tables) label when running auctex from a non master file" Tags="|auctex|reftex-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20945" PostTypeId="2" ParentId="20930" CreationDate="2016-03-13T13:25:00.057" Score="0" Body="&lt;p&gt;I've found a very simple solution(thx to helm). There's a function in elpy called elpy-shell-send-region-or-buffer. It provides everything I wanted except the buffer positioning.&#xA;I also like the possibility to run marked code. If nothing is marked, the whole buffer is sent to the python shell. Very nice :)&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-03-13T14:38:31.973" LastActivityDate="2016-03-13T14:38:31.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20946" PostTypeId="1" CreationDate="2016-03-13T14:18:55.890" Score="8" ViewCount="3073" Body="&lt;p&gt;I have Emacs.app version 24.5 (9.0) on a MacBook with Mac OS X 10.11.3 (15D21). How can I generate mouse-2 from my MacBook's trackpad? I've googled and found references to &lt;code&gt;mac-emulate-three-button-mouse&lt;/code&gt; (&lt;a href=&quot;https://stackoverflow.com/questions/10973000/emacs-23-4-mouse-2-behaviour-on-os-x-10-7&quot;&gt;this question&lt;/a&gt;) (not found in such Emacs version) and similar tricks that do not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to generate such an event, or there is some other way, like binding globally something like s-&amp;lt;mouse-1&amp;gt; to &amp;lt;mouse-2&amp;gt;, etc.?&lt;/p&gt;&#xA;" OwnerUserId="8680" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2019-02-23T20:48:33.913" Title="Generate mouse-2 event from MacBook trackpad" Tags="|osx|mouse|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20947" PostTypeId="1" AcceptedAnswerId="21009" CreationDate="2016-03-13T14:39:37.477" Score="14" ViewCount="4617" Body="&lt;p&gt;I want to create source blocks (in any language including LaTeX), then refer to these in the text using &lt;a href=&quot;http://orgmode.org/org.html#Internal-links&quot; rel=&quot;noreferrer&quot;&gt;internal links&lt;/a&gt;, with descriptions as shown below. This &lt;a href=&quot;https://emacs.stackexchange.com/questions/19105/how-to-reference-named-table-or-code-block-in-org-mode&quot;&gt;similar post&lt;/a&gt; is not working for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;a href=&quot;https://emacs.stackexchange.com/questions/12841/quickly-insert-source-blocks-in-org-mode&quot;&gt;easily&lt;/a&gt; been able to created many source blocks using the common structure, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python&#xA;  for i in 1:10:&#xA;      print i&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I added names to the blocks because I want to talk about them with internal links. Id did this by adding &lt;code&gt;#+NAME:&lt;/code&gt;, and so have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: some-source-code&#xA;#+BEGIN_SRC python&#xA;  for i in 1:10:&#xA;      print i&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the text block is somewhere within an org file (the same one in my case) and I want to insert a link to that code block above using &lt;code&gt;C-c C-l&lt;/code&gt;. I have tried this with and without a description, so ending up with both:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[some-source-code][my description]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[some-source-code]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but neither are recognised in the exported PDF file. I simply get a pair of question marks in the PDF file and in the &lt;code&gt;*Org PDF LaTeX output buffer*&lt;/code&gt; there is just a message stating:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hyper reference &lt;em&gt;some-source-code&lt;/em&gt; on page 6 undefined on input line 182.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Within the org-file itself, the links are shown and if I click on them I am taken to the code block as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;a href=&quot;http://org-babel.readthedocs.org/en/latest/eval/#calling-a-code-block&quot; rel=&quot;noreferrer&quot;&gt;babel documentation&lt;/a&gt; for such source blocks there was an unfinished-looking sentence regarding the  (which I assume to mean the name I provde for a source block), saying:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The name can be 20 characters long, and contain…XXX&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Are there actually rules regarding the &lt;code&gt;#+NAME: &amp;lt;label&amp;gt;&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I be including a specific #+LaTeX_HEADER in the org-file??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;strong&gt;am&lt;/strong&gt; able to create links to websites using &lt;code&gt;C-c C-l&lt;/code&gt;, with a description - and this is exported as expected to PDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have org-version 8.2.10, emacs version 24.5.&lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-03-17T00:20:49.920" Title="How to reference source blocks in org text" Tags="|org-mode|org-export|latex|hyperlinks|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20948" PostTypeId="2" ParentId="20946" CreationDate="2016-03-13T14:55:02.000" Score="7" Body="&lt;p&gt;After some more googling and reading of the manual, I have found a solution that works for me, by adding to the file &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;&amp;lt;s-mouse-1&amp;gt;&quot;) (kbd &quot;&amp;lt;mouse-2&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this way, I can generate &lt;code&gt;mouse-2&lt;/code&gt; events by pressing Command when clicking with the trackpad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;key-translation-map&lt;/code&gt; is a translation keymap (see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-key_002dtranslation_002dmap&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt;) that “... uses translation keymaps to translate certain event sequences into others.”&lt;/p&gt;&#xA;" OwnerUserId="8680" LastEditorUserId="795" LastEditDate="2017-10-20T16:23:47.287" LastActivityDate="2017-10-20T16:23:47.287" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20949" PostTypeId="1" AcceptedAnswerId="20997" CreationDate="2016-03-13T16:48:45.200" Score="4" ViewCount="2915" Body="&lt;p&gt;I want to include the output of inline code blocks in the LaTeX/PDF output of an org-mode document, but not in a monospaced font. I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The mean petal length is src_R[:exports results :results raw]{mean(iris$Petal.Length)}. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which gives me this output in the LaTeX file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The mean petal length is 3.758&#xA;. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The period in the sentence appears on a new line in the LaTeX file, which causes a space to appear between the code output and the period in the PDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VU4Y2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VU4Y2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can get the LaTeX output to appear all on one line so the PDF formatting is correct?&lt;/p&gt;&#xA;" OwnerUserId="7060" LastActivityDate="2016-03-16T17:55:00.510" Title="Formatting output of inline org-mode source blocks" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20951" PostTypeId="2" ParentId="20947" CreationDate="2016-03-13T18:16:10.897" Score="6" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: some-source-code&#xA;#+BEGIN_SRC python&#xA;  for i in 1:10:&#xA;      print i&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Method 1&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:::some-source-code]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This &lt;em&gt;should&lt;/em&gt; link back to &lt;code&gt;some-source-code&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Caveat:&lt;/strong&gt; &lt;code&gt;[[file:::some-source-code]]&lt;/code&gt; is performing a &lt;a href=&quot;http://orgmode.org/org.html#Search-options&quot; rel=&quot;noreferrer&quot;&gt;degenerate search&lt;/a&gt; and will look for &lt;code&gt;&amp;lt;&amp;lt;some-source-code&amp;gt;&amp;gt;&lt;/code&gt; links before &lt;code&gt;#+NAME: some-source-code&lt;/code&gt;. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h1&gt;Method 2&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:::/#\+name: +some-source-code/]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://orgmode.org/org.html#Search-options&quot; rel=&quot;noreferrer&quot;&gt;/regexp/&lt;/a&gt;&lt;br&gt;&#xA;  Do a regular expression search for regexp. This uses the Emacs command  occur to list all matches in a separate window. If the target file is in Org mode, org-occur is used to create a sparse tree with the matches.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h1&gt;Method 3&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;When exporting to PDF this should work. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LaTeX&#xA;\hypertarget{some-source-code}{} &#xA;#+END_LaTeX&#xA;#+NAME: some-source-code&#xA;#+BEGIN_SRC python&#xA;  for i in 1:10:&#xA;      print i&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC latex&#xA;  See \hyperlink{some-source-code}{some source code}.&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that helped!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This code was tested using&lt;br&gt;&#xA;  GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&#xA;   of 2014-12-25&lt;br&gt;&#xA;  org-mode: 8.3.2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-03-14T02:02:41.227" LastActivityDate="2016-03-14T02:02:41.227" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="20952" PostTypeId="1" CreationDate="2016-03-13T20:43:30.540" Score="0" ViewCount="81" Body="&lt;p&gt;I often work on remote hosts and I mostly need to be root, but I can't login as root. It would be convenient, if sudo -s is being executed automatically when I establish a connection with shell/eshell.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-03-14T09:51:08.720" Title="automatically run command when establishing ssh connection" Tags="|shell|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20953" PostTypeId="1" CreationDate="2016-03-13T21:44:32.837" Score="0" ViewCount="107" Body="&lt;p&gt;I am proficient in developing basic syntax highlighting modes based on &lt;code&gt;font-lock-defaults&lt;/code&gt; and regex (even with &lt;code&gt;font-lock-multiline&lt;/code&gt; and &lt;code&gt;font-lock-extend-region-functions&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I faced with format of natural language translation dictionary which look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;__&#xA;&#xA;begin&#xA;  [bɪˈgɪn]&#xA;  v1&#xA;began&#xA;  [bɪˈgæn]&#xA;  v2&#xA;begun&#xA;  [bɪˈgʌn]&#xA;  v3&#xA;&#xA;v&#xA;ru: начать&#xA;ua: починати&#xA;__&#xA;&#xA;smile&#xA;  [smaɪl]&#xA;&#xA;v&#xA;ru: улыбаться&#xA;&#xA;n&#xA;ru: улыбка&#xA;__&#xA;&#xA;e.g.&#xA;&#xA;abbr&#xA;en: for example&#xA;la: exempli gratia&#xA;__&#xA;&#xA;x-rays&#xA;&#xA;topic: sci&#xA;en: a kind of radiation that can pass through&#xA;  most solid materials, often used in medicine&#xA;__&#xA;&#xA;woman&#xA;  [ˈwʊmən]&#xA;  s&#xA;women&#xA;  [wɪmɪn]&#xA;  pl&#xA;&#xA;n&#xA;ru: женщина&#xA;ua: жінка&#xA;__&#xA;&#xA;colour&#xA;  gb&#xA;  ['kʌlə]&#xA;color&#xA;  us&#xA;  ['kʌlər]&#xA;&#xA;n&#xA;ru: цвет&#xA;ua: колір&#xA;__&#xA;&#xA;white&#xA;  [waɪt]&#xA;&#xA;adj&#xA;ant: black&#xA;ru: чорный&#xA;ua: чорний&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As easy to see indenting and new lines with special prefixes define syntax. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indenting in first part of entry used to separate word variances. Blank lines in second part of article separate different word meaning, lines should begin with defined prefixes and indenting is not allowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;regex is not context aware and can't be used to properly highlight such file format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;File format have property that is can be validated from any point of file with small lookup around for &lt;code&gt;^__$&lt;/code&gt; regex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I am interested in writing mode that &lt;em&gt;properly highlighted&lt;/em&gt; and &lt;em&gt;&quot;localy&quot; validated&lt;/em&gt; file (no need to validate far from screen several screens).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to develop code or mark text in buffer after parsing so in a few cases when intending necessary function for indenting (by TAB) would be easy to code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What API should I use to develop such mode myself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any good reference of existing code to follow?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-03-13T22:29:53.063" LastActivityDate="2016-03-13T22:49:59.663" Title="Programming syntax highlighting and validation when regex is not sufficient?" Tags="|font-lock|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20954" PostTypeId="1" AcceptedAnswerId="20964" CreationDate="2016-03-13T22:49:04.070" Score="2" ViewCount="659" Body="&lt;p&gt;I'm trying to map &lt;kbd&gt;F5&lt;/kbd&gt; to compile from a parent directory of the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/23715541/emacs-compile-command-find-makefile-in-superior-directory/23720929#23720929&quot;&gt;Emacs compile-command find makefile in superior directory&lt;/a&gt;&#xA; provides an excellent answer to achieve this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun compile-project ()&#xA;  (interactive)&#xA;  (let* ((make-directory (locate-dominating-file (buffer-file-name)&#xA;                                                  &quot;Makefile&quot;))&#xA;          (command (concat &quot;make -k -C &quot;&#xA;                           (shell-quote-argument make-directory))))&#xA;  (compile command)))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'compile-project)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Besides, &lt;a href=&quot;http://tuhdo.github.io/c-ide.html#orgheadline57&quot; rel=&quot;nofollow noreferrer&quot;&gt;C/C++ Development Environment for Emacs&lt;/a&gt; describes a way such that &lt;kbd&gt;F5&lt;/kbd&gt; does not prompt for the compile command every time, but if a prefix argument &lt;kbd&gt;C-u&lt;/kbd&gt; is provided, then &lt;code&gt;compile&lt;/code&gt; prompts for a compile command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) (lambda ()&#xA;                               (interactive)&#xA;                               (setq-local compilation-read-command nil)&#xA;                               (call-interactively 'compile)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How can I modify the &lt;code&gt;compile-project&lt;/code&gt; function, so that when a prefix command &lt;kbd&gt;C-u&lt;/kbd&gt; is provided, it shows the compilation command in the mini-buffer, including a default command of &lt;code&gt;make -k -C ...&lt;/code&gt; generated by the body of &lt;code&gt;let*&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10828" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2019-11-13T05:10:55.920" Title="Compile from parent directory in Emacs" Tags="|compilation|interactive|prefix-argument|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20955" PostTypeId="1" CreationDate="2016-03-13T22:49:46.160" Score="1" ViewCount="23" Body="&lt;p&gt;What's a good method of testing whether the current buffer contains at least one heading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the best solution that initially came to mind:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&amp;gt; (length (org-map-entries nil nil 'file)) 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-03-13T22:49:46.160" Title="Test whether current org buffer has at least one heading" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20956" PostTypeId="2" ParentId="20953" CreationDate="2016-03-13T22:49:59.663" Score="2" Body="&lt;p&gt;You need to use a function for finding the match data. I think this example could help &lt;a href=&quot;https://stackoverflow.com/questions/14668225/context-sensitive-font-locking-in-emacs&quot;&gt;https://stackoverflow.com/questions/14668225/context-sensitive-font-locking-in-emacs&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a little tricky but basically you can search forward and then search back and forward for context. Set the match data and leave the point at the end I think. &lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-03-13T22:49:59.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20957" PostTypeId="1" CreationDate="2016-03-13T23:52:29.183" Score="3" ViewCount="349" Body="&lt;p&gt;I recently got bitten by a  deprecated setting breaking a new package I was trying to use.&#xA;The same behaviour had been reported by a number of users before me,&#xA;but the authors were unable to reproduce the problem&#xA;and the prior reporters were unable to isolate the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any mechanism for detecting out of date settings and other constructs in elisp files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am primarily thinking about customization settings, but this really applies to elisp code in general&lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="105" LastEditDate="2016-03-14T00:30:21.383" LastActivityDate="2016-03-14T00:36:02.287" Title="detecting obsolete/deprecated settings in elisp files, particularly .emacs" Tags="|init-file|debugging|customize|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20958" PostTypeId="2" ParentId="20957" CreationDate="2016-03-14T00:17:49.447" Score="6" Body="&lt;p&gt;Others will no doubt add more info to help answer this.&#xA;I'll mention a few things that come to mind.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;`M-x customize-changed' shows you a Customize buffer that tells you about stuff that has changed since a given Emacs version:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Customize all settings whose meanings have changed in Emacs itself.&#xA;  This includes new user options and faces, and new customization&#xA;  groups, as well as older options and faces whose meanings or&#xA;  default values have changed since the previous major Emacs&#xA;  release.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With argument SINCE-VERSION (a string), customize all settings&#xA;  that were added or redefined since that version.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The help commands for a variable (including an option) or a function tell you whether it has been deprecated (is obsolete): &lt;code&gt;C-h v&lt;/code&gt; and &lt;code&gt;C-h f&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can &lt;code&gt;M-x rgrep&lt;/code&gt; the Emacs Lisp source code for things like &lt;code&gt;define-obsolete-function-alias&lt;/code&gt;, &lt;code&gt;define-obsolete-variable-alias&lt;/code&gt;, &lt;code&gt;define-obsolete-face-alias&lt;/code&gt;, &lt;code&gt;make-obsolete&lt;/code&gt;, &lt;code&gt;make-obsolete-variable&lt;/code&gt;, and &lt;code&gt;&quot;(declare (obsolete &quot;&lt;/code&gt;.  Or just grep for &lt;code&gt;obsolete&lt;/code&gt;.  (There are also some library-specific obsolete declarations, such as &lt;code&gt;semantic-varalias-obsolete&lt;/code&gt;, &lt;code&gt;semantic-alias-obsolete&lt;/code&gt;, &lt;code&gt;erc-make-obsolete&lt;/code&gt;, and &lt;code&gt;ex-cmd-obsolete&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That won't find everything, but it is a start.  Beyond that, you can use function &lt;code&gt;mapatoms&lt;/code&gt; with a function that gets and tests symbol properties like &lt;code&gt;byte-obsolete-variable&lt;/code&gt;, &lt;code&gt;byte-obsolete-info&lt;/code&gt;, and &lt;code&gt;command-execute-obsolete-warned&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-03-14T00:36:02.287" LastActivityDate="2016-03-14T00:36:02.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20959" PostTypeId="2" ParentId="102" CreationDate="2016-03-14T00:47:46.680" Score="3" Body="&lt;p&gt;Another alternative is to use John Wiegley's &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;use-package&lt;/a&gt;.&#xA;This provides a programmatic way to configure packages that plays nicely&#xA;with emacs 24+ package initialization process.&#xA;Here is an example of use from the readme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package color-moccur&#xA;  :commands (isearch-moccur isearch-all)&#xA;  :bind ((&quot;M-s O&quot; . moccur)&#xA;         :map isearch-mode-map&#xA;         (&quot;M-o&quot; . isearch-moccur)&#xA;         (&quot;M-O&quot; . isearch-moccur-all))&#xA;  :custom (isearch-lazy-highlight t)&#xA;  :config (use-package moccur-edit))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The point is that use package is a macro and does not evaluate its arguments immediately. The &lt;code&gt;:init&lt;/code&gt; and &lt;code&gt;:config&lt;/code&gt; parameters are evaluated at different stages of the initialization process, making it possible to have the configuration of each package in one place, but have each part execute at the appropriate stage of initialization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without something like &lt;code&gt;use-package&lt;/code&gt; some packages require part of their initialization code to go before &lt;code&gt;(package-initialize)&lt;/code&gt; and another part to go after. If you have many packegas like that then theire initializations would have to be interleaved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another benefit of &lt;code&gt;use-package&lt;/code&gt; is that it can automatically install missing packages from using package.el if you take you .emacs to a new machine or if you share your configuration with another user and all initialization can be deferred until a package actually need to be loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also additional keyword arguments that allow more control over the initialization process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that said, one big advantage of customize is that it shows you what there is to be configured in any given package. That is one reason I still use it for many of my packages.&lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="2706" LastEditDate="2019-02-20T10:37:59.030" LastActivityDate="2019-02-20T10:37:59.030" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="20960" PostTypeId="1" AcceptedAnswerId="20967" CreationDate="2016-03-14T00:57:27.053" Score="2" ViewCount="365" Body="&lt;p&gt;I am trying to start emacs with both eshell and the specified file, but displaying the buffer with the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I add the following line to emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-startup-hook (lambda () (eshell)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then eshell also loads on startup with the file, but eshell is shown instead of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to change the &lt;code&gt;initial-buffer-choice&lt;/code&gt; variable so that the file is shown instead, but am not sure what function to give to return the file specified in command line.&#xA;Can anyone please give me some ideas?&lt;/p&gt;&#xA;" OwnerUserId="11308" LastActivityDate="2016-03-14T15:15:22.093" Title="Starting emacs with eshell and file from command line argument" Tags="|init-file|buffers|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20962" PostTypeId="2" ParentId="20952" CreationDate="2016-03-14T09:51:08.720" Score="1" Body="&lt;p&gt;You can use Tramp's multi-hop feature. Open &lt;code&gt;C-x C-f /ssh:user@host|sudo:host:&lt;/code&gt;. Then you can call &lt;code&gt;M-x shell&lt;/code&gt; or &lt;code&gt;M-x eshell&lt;/code&gt;, and you work as root on host.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-14T09:51:08.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20963" PostTypeId="2" ParentId="4208" CreationDate="2016-03-14T12:08:05.877" Score="0" Body="&lt;p&gt;Upon further consideration, the indentation by SMIE makes sense. How it will look in Emacs 25.1:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-ruby prettyprint-override&quot;&gt;&lt;code&gt;it do&#xA;  is_expected.to match(/\[Error\]/)&#xA;                   .and match(/#{result}/)&#xA;                          .and match(/-+$/)&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a small change due to a recent fix, and it helps to show that the indentation reflects the expression's evaluation order. Which is right-to-left in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not to say we couldn't add a variable that would recognize this as a special case and do something different, but so far I don't know what would differentiate it from a simple case of paren-less function call with continuation in its first argument, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-ruby prettyprint-override&quot;&gt;&lt;code&gt;foo.bar tee&#xA;          .qux,&#xA;        aaa&#xA;          .bbb&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The non-SMIE indentation engine misindents this case. From what I have of the user feedback, it's more important than the infrequently-used compound expectations in RSpec.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can write them just a bit differently, and the indentation will become nicer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-ruby prettyprint-override&quot;&gt;&lt;code&gt;it do&#xA;  is_expected.to(match(/\[Error\]/))&#xA;    .and(match(/#{result}/))&#xA;    .and(match(/-+$/))&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-ruby prettyprint-override&quot;&gt;&lt;code&gt;it do&#xA;  is_expected.to match(/\[Error\]/) &amp;amp;&#xA;                 match(/#{result}/) &amp;amp;&#xA;                 match(/-+$/)&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="124" LastEditorUserId="124" LastEditDate="2016-03-14T20:16:46.600" LastActivityDate="2016-03-14T20:16:46.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20964" PostTypeId="2" ParentId="20954" CreationDate="2016-03-14T14:13:07.403" Score="2" Body="&lt;p&gt;I think that you almost had it. I modified your original &lt;code&gt;compile-project&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun compile-project ()&#xA;  (interactive)&#xA;  (let* ((mk-dir (locate-dominating-file (buffer-file-name) &quot;Makefile&quot;))&#xA;         (compile-command (concat &quot;make -k -C &quot; (shell-quote-argument mk-dir)))&#xA;         (compilation-read-command nil))&#xA;    (call-interactively 'compile)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only real difference is that the &lt;code&gt;compile&lt;/code&gt; function reads from &lt;code&gt;compilation-read-command&lt;/code&gt; to figure out how to read the compilation command &lt;em&gt;and&lt;/em&gt; &lt;code&gt;compile-command&lt;/code&gt;. If you set &lt;code&gt;compilation-read-command&lt;/code&gt; to nil, &lt;code&gt;compile&lt;/code&gt; will use the value of &lt;code&gt;compile-command&lt;/code&gt; instead of prompting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Also, all of this is available in &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;describe-function&lt;/code&gt; &lt;code&gt;compile&lt;/code&gt; if you need to look up something more.)&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2418" LastEditDate="2019-11-12T06:20:20.880" LastActivityDate="2019-11-12T06:20:20.880" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="20965" PostTypeId="2" ParentId="20900" CreationDate="2016-03-14T15:11:34.997" Score="6" Body="&lt;p&gt;This feature exists in Emacs. &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html#Outline-Mode&quot; rel=&quot;nofollow&quot;&gt;Outline mode&lt;/a&gt; describes a document as containing heading lines with a level, and has facilities to move among levels. We can define every line as a heading line with a level that reflects its indentation: set &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Format.html#index-outline_002dregexp&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;outline-regexp&lt;/code&gt;&lt;/a&gt; to the indentation. More precisely, the indentation plus the first non-whitespace character (and the beginning of the file is the uppermost level): &lt;code&gt;\`\|\s-+\S-&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x load-libray outline RET&#xA;M-: (make-local-variable 'outline-regexp) RET&#xA;M-: (setq outline-regexp &quot;\\`\\|\\s-+\\S-&quot;) RET&#xA;M-x outline-minor-mode RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs 22.1–24.3 you can simplify this to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x load-libray outline RET&#xA;M-1 M-x set-variable RET outline-regexp RET &quot;\\`\\|\\s-+\\S-&quot; RET&#xA;M-x outline-minor-mode RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Motion.html#Outline-Motion&quot; rel=&quot;nofollow&quot;&gt;outline motion commands&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-C @ C-f&lt;/code&gt; (&lt;code&gt;outline-forward-same-level&lt;/code&gt;) to move to the next sibling;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-C @ C-b&lt;/code&gt; (&lt;code&gt;outline-backward-same-level&lt;/code&gt;) to move to the previous sibling;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-C @ C-u&lt;/code&gt; (&lt;code&gt;outline-up-heading&lt;/code&gt;) to move to the parent.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One tab and one space count for the same amount of indentation. If you have a mix of tabs and spaces, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Just-Spaces.html#Just-Spaces&quot; rel=&quot;nofollow&quot;&gt;set &lt;code&gt;tab-width&lt;/code&gt; appropriately and call &lt;code&gt;untabify&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the current major mode has outline settings, they might conflict. In this case, you can use one of the many &lt;a href=&quot;https://www.emacswiki.org/emacs/MultipleModes&quot; rel=&quot;nofollow&quot;&gt;multiple major modes&lt;/a&gt; solution, the simplest being to create an &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html#Indirect-Buffers&quot; rel=&quot;nofollow&quot;&gt;indirect buffer&lt;/a&gt; and set it to Outline Major Mode. In Outline Major Mode, the default keyboard shortcuts are simpler to type: &lt;code&gt;C-c C-f&lt;/code&gt;, etc.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-09-17T10:42:22.000" LastActivityDate="2016-09-17T10:42:22.000" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20966" PostTypeId="2" ParentId="12487" CreationDate="2016-03-14T15:12:03.147" Score="1" Body="&lt;p&gt;Turns out it had nothing to do with &lt;code&gt;helm&lt;/code&gt; initialization (or little).&lt;/p&gt;&#xA;&lt;p&gt;In my everlasting quest to optimize Emacs' start-up time, I have moved all of &lt;em&gt;interface&lt;/em&gt; related things at the very beginning of my configuration. That includes the pseudo fullscreen that I use.&lt;/p&gt;&#xA;&lt;p&gt;Putting the corresponding line before any of the heavy lisp was loaded fixed my issue.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/angrybacon/dotemacs/blob/master/dotemacs.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here is my configuration for reference&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="9874" LastEditDate="2021-04-29T14:19:52.463" LastActivityDate="2021-04-29T14:19:52.463" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="20967" PostTypeId="2" ParentId="20960" CreationDate="2016-03-14T15:15:22.093" Score="1" Body="&lt;p&gt;Since &lt;code&gt;emacs-startup-hook&lt;/code&gt; is (docstring, obtained with &lt;code&gt;C-h v emacs-startup-hook&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;run after loading init files and handling the command line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;previous-buffer&lt;/code&gt; should do what you want.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In selected window switch to previous buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-startup-hook (lambda () (eshell) (previous-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-03-14T15:15:22.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20968" PostTypeId="1" AcceptedAnswerId="29192" CreationDate="2016-03-14T16:45:38.580" Score="2" ViewCount="96" Body="&lt;p&gt;Say that I'm looking at an email that's part of a chain in &lt;code&gt;mu4e&lt;/code&gt; and I want to find the next and previous emails. Is there an easy way to do that? &lt;/p&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="253" LastEditDate="2016-12-08T16:11:57.007" LastActivityDate="2016-12-08T16:11:57.007" Title="How to find previous and next emails in mu4e" Tags="|email|mu4e|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20969" PostTypeId="2" ParentId="19982" CreationDate="2016-03-14T17:25:26.933" Score="2" Body="&lt;p&gt;I compiled Emacs today (March 14, 2016) from git, version 25.1.50.1 for Windows 8.1, 64-bit. Run into the same issue. Found this answer by the indefatigable &lt;a href=&quot;http://gnu.emacs.bug.narkive.com/SafnPEMv/bug-19229-a-workaround-for-hunspell&quot; rel=&quot;nofollow&quot;&gt;Eli Zaretskii&lt;/a&gt; and shortened the code for hunspell to this lines in my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;C:/cygwin64/usr/local/bin&quot;)&#xA;(setq ispell-program-name (executable-find &quot;hunspell&quot;))&#xA;(ispell-change-dictionary &quot;de_DE&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OK, you see, hunspell was installed at the given path. I set the DICPATH variable to this locations as well. I set the DICTIONARY variable to &quot;de_DE&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was hard to find where hunspell stored the personal dictionary. I found it eventually at $HOME, the name of the file was &lt;code&gt;hunspell_de_DE&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it seems the whole installation is a lot easier nowadays. &lt;/p&gt;&#xA;" OwnerUserId="2334" LastActivityDate="2016-03-14T17:25:26.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20970" PostTypeId="1" AcceptedAnswerId="21425" CreationDate="2016-03-14T18:12:06.047" Score="1" ViewCount="414" Body="&lt;p&gt;I have a ThinkPad with a trackpad, and emacs exits from C-s and also from interactive replace using M-%, whenever I brush my hand over the trackpad while touch-typing - which happens far too often. With my previous laptop I worked around this problem by disabling the trackpad completely, but I can't do that here because the trackpad is an important fallback for when my erratic Bluetooth mouse stops working. How can I make C-s and M-% ignore touchpad scrolling?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; It's not caused by mouse movement as I originally thought, but by mouse scrolling, or something even more obscure. From &lt;code&gt;C-h l&lt;/code&gt; I can see that emacs is interpreting my brushing the touchpad as mouse-4/5/6/7, so I've tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;mouse-4&amp;gt;&quot;) (lambda () (interactive)))&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-5&amp;gt;&quot;) (lambda () (interactive)))&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-6&amp;gt;&quot;) (lambda () (interactive)))&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-7&amp;gt;&quot;) (lambda () (interactive)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that doesn't fix the problem, it just stops emacs complaining.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastEditorUserId="6790" LastEditDate="2016-04-04T18:39:20.200" LastActivityDate="2016-04-04T18:49:28.147" Title="Stop emacs treating touchpad scrolling like C-g in minibuffer" Tags="|mouse|isearch|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20971" PostTypeId="1" CreationDate="2016-03-14T18:34:48.397" Score="3" ViewCount="1119" Body="&lt;p&gt;I'm working on a project that doesn't play nice with clang. It also doesn't play nice with &lt;code&gt;ctags&lt;/code&gt; because the &lt;code&gt;TAGS&lt;/code&gt; file is ~180 MB and it chokes up whenever I do anything moderately intensive with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;ggtags&lt;/code&gt; set up with it brilliantly, however, and I would like to force &lt;code&gt;company&lt;/code&gt; to use only &lt;code&gt;ggtags&lt;/code&gt; for completion. The &lt;a href=&quot;https://github.com/leoliu/ggtags&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; for the &lt;code&gt;ggtags&lt;/code&gt; package says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;company&lt;/code&gt; can use &lt;code&gt;ggtags&lt;/code&gt; as completion source via &lt;code&gt;company-capf&lt;/code&gt; which is enabled by default.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but I really have no idea what that means. How can I use the two together?&lt;/p&gt;&#xA;" OwnerUserId="10368" LastActivityDate="2016-03-14T18:34:48.397" Title="How can I use ggtags as a company-mode backend?" Tags="|completion|company-mode|gtags|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20972" PostTypeId="2" ParentId="20970" CreationDate="2016-03-14T19:12:05.457" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I make C-s and M-% ignore mouse movement?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For just disabling accidental clicks, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (k '([mouse-1] [down-mouse-1] [drag-mouse-1] [double-mouse-1] [triple-mouse-1]))&#xA;(global-unset-key k))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-03-14T19:12:05.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20974" PostTypeId="1" AcceptedAnswerId="20988" CreationDate="2016-03-14T21:30:21.957" Score="9" ViewCount="701" Body="&lt;p&gt;I am trying to bind a key in &lt;code&gt;minibuffer-local-map&lt;/code&gt; to a command which uses&#xA;&lt;code&gt;abort-recursive-edit&lt;/code&gt; or &lt;code&gt;exit-minibuffer&lt;/code&gt; and then proceeds executing more elisp code. So I want to exit the minibuffer and then continue from the context before. The only solution I have found so far is to use &lt;code&gt;run-with-timer&lt;/code&gt; like in this contrived example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun example ()&#xA;  (interactive)&#xA;  ;; This is my current workaround&#xA;  ;; (run-with-timer 0.1 nil 'split-window-vertically)&#xA;  (abort-recursive-edit) &#xA;  ;; This code won't be executed&#xA;  (split-window-vertically))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a cleaner/better way to do something like this? I could try to setup everything with &lt;code&gt;with-current-window&lt;/code&gt; and stuff like that and exit the minibuffer in the last instruction but maybe there is a better alternative? &lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2016-03-16T10:56:32.847" LastActivityDate="2024-03-18T00:30:02.727" Title="Exit minibuffer and execute a command afterwards?" Tags="|minibuffer|commands|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20975" PostTypeId="2" ParentId="19018" CreationDate="2016-03-14T21:42:44.357" Score="2" Body="&lt;p&gt;An alternative to @tarsius's solution:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cl-remove-if-not #'identity (list 1 2 3 nil)) =&amp;gt; '(1 2 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-03-14T21:42:44.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20976" PostTypeId="1" AcceptedAnswerId="21127" CreationDate="2016-03-14T22:46:25.607" Score="5" ViewCount="2163" Body="&lt;p&gt;I'm working on developing a new Emacs feature for all three Window systems supported by Emacs, and would like a complete working installation of Emacs built &lt;code&gt;--with-x --with-x-toolkit=no&lt;/code&gt;.  The welcome screen is not displaying the Emacs logo image that I am used to seeing.  I'm running it on &lt;strong&gt;X11 / XTERM&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  What package do I need from let's say macports or building from source that will enable images on the Welcome screen in Emacs for X?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Where should the build process find the source code?    .&#xA;What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2&#xA;Should Emacs use the GNU version of malloc?             no&#xA;  (The GNU allocators don't work with this system configuration.)&#xA;Should Emacs use a relocating allocator for buffers?    no&#xA;Should Emacs use mmap(2) for buffer allocation?         no&#xA;What window system should Emacs use?                    x11&#xA;What toolkit should Emacs use?                          none&#xA;Where do we find X Windows header files?                Standard dirs&#xA;Where do we find X Windows libraries?                   Standard dirs&#xA;Does Emacs use -lXaw3d?                                 no&#xA;Does Emacs use -lXpm?                                   yes&#xA;Does Emacs use -ljpeg?                                  yes&#xA;Does Emacs use -ltiff?                                  yes&#xA;Does Emacs use a gif library?                           yes -lgif&#xA;Does Emacs use a png library?                           yes -lpng16&#xA;Does Emacs use -lrsvg-2?                                yes&#xA;Does Emacs use cairo?                                   no&#xA;Does Emacs use imagemagick?                             no&#xA;Does Emacs support sound?                               no&#xA;Does Emacs use -lgpm?                                   no&#xA;Does Emacs use -ldbus?                                  yes&#xA;Does Emacs use -lgconf?                                 no&#xA;Does Emacs use GSettings?                               yes&#xA;Does Emacs use a file notification library?             yes (kqueue)&#xA;Does Emacs use access control lists?                    yes &#xA;Does Emacs use -lselinux?                               no&#xA;Does Emacs use -lgnutls?                                no&#xA;Does Emacs use -lxml2?                                  yes&#xA;Does Emacs use -lfreetype?                              yes&#xA;Does Emacs use -lm17n-flt?                              no&#xA;Does Emacs use -lotf?                                   no&#xA;Does Emacs use -lxft?                                   yes&#xA;Does Emacs directly use zlib?                           yes&#xA;Does Emacs have dynamic modules support?                no&#xA;Does Emacs use toolkit scroll bars?                     no&#xA;Does Emacs support Xwidgets (requires gtk3)?            no&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/emacsx.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.960" LastActivityDate="2018-06-14T03:53:18.293" Title="X11 -- Why is the Emacs logo image missing on the Welcome screen?" Tags="|x11|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20977" PostTypeId="1" AcceptedAnswerId="21126" CreationDate="2016-03-14T23:50:09.643" Score="0" ViewCount="167" Body="&lt;p&gt;Here is an example .org file displayed with the solarized-dark theme:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QwZ81.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QwZ81.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now here's what happens when I switch the theme to leuven:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ov0YA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ov0YA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar things happen in some other themes (like wombat). Looking at other files, it appears that the fifth headline is printed, but it's way off to the right and takes up the entire screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.spacemacs&lt;/code&gt; file contains no modifications apart from a few key bindings. Has anyone seen this problem before?&lt;/p&gt;&#xA;" OwnerUserId="11407" LastActivityDate="2016-03-21T03:02:31.507" Title="Headlines broken in org themes" Tags="|org-mode|themes|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20978" PostTypeId="2" ParentId="20720" CreationDate="2016-03-15T02:59:39.610" Score="9" Body="&lt;p&gt;You can use &lt;code&gt;visual-line-mode&lt;/code&gt; to show wrapping without breaking the actual line. &lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="1979" LastEditDate="2017-09-10T22:26:50.377" LastActivityDate="2017-09-10T22:26:50.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20979" PostTypeId="2" ParentId="20931" CreationDate="2016-03-15T06:19:11.267" Score="1" Body="&lt;p&gt;Turns out the hardest part has to be done outside Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install &lt;code&gt;auto-complete&lt;/code&gt; and &lt;code&gt;auto-complete-nxml&lt;/code&gt; from MELPA (easy).&lt;/li&gt;&#xA;&lt;li&gt;Note: don't use &lt;code&gt;genrnc&lt;/code&gt; from MELPA 'cause it does not fit the bill...&lt;/li&gt;&#xA;&lt;li&gt;Ensure that &lt;code&gt;xsltproc&lt;/code&gt; is installed on the system (easy for Linux/Unix/OSX users).&lt;/li&gt;&#xA;&lt;li&gt;Add the following customization into the user's &lt;code&gt;~/.emacs&lt;/code&gt; file (easy):&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (require 'auto-complete-nxml)&#xA; ;; Keystroke to popup help about something at point.&#xA; (setq auto-complete-nxml-popup-help-key &quot;C-:&quot;)&#xA; ;; Keystroke to toggle on/off automatic completion.&#xA; (setq auto-complete-nxml-toggle-automatic-key &quot;C-c C-t&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Get the XSD schema for the XML format in use (easy)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Convert the XSD file into a RELAX NG Compact format file usable by nXML (&lt;strong&gt;hard&lt;/strong&gt;!)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Approach #1&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;get &lt;a href=&quot;https://github.com/epiasini/xsdtorng&quot; rel=&quot;nofollow&quot;&gt;XSDtoRNG&lt;/a&gt; converter stylesheet (easy)&lt;/li&gt;&#xA;&lt;li&gt;run &lt;code&gt;xsltproc XSDtoRNG.xsl MySchema.xsd &amp;gt; MySchema.rng&lt;/code&gt; (easy)&lt;/li&gt;&#xA;&lt;li&gt;get &lt;a href=&quot;https://web.archive.org/web/20070622050100/http://www.pantor.com/RngToRnc-1_4.tgz&quot; rel=&quot;nofollow&quot;&gt;RngToRnc&lt;/a&gt; (mostly future-proof)&lt;/li&gt;&#xA;&lt;li&gt;run &lt;code&gt;xsltproc RngToRncClassic.xsl MySchema.rng &amp;gt; MySchema.rnc&lt;/code&gt; (easy)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Approach #2&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;find &lt;code&gt;trang&lt;/code&gt; and &lt;code&gt;rngconv&lt;/code&gt; utilities&lt;/li&gt;&#xA;&lt;li&gt;...work in progress...&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Load the XML file into Emacs. Major mode should be nXML, minor mode should be AC.&lt;/li&gt;&#xA;&lt;li&gt;XML &gt; Set Schema &gt; File ... and choose &lt;code&gt;MySchema.rnc&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Manually edit &lt;code&gt;MySchema.rnc&lt;/code&gt; when Emacs complains (&lt;strong&gt;hard&lt;/strong&gt;!), save it, and repeat the previous step.&lt;/li&gt;&#xA;&lt;li&gt;Use autocompletion (&lt;code&gt;ESC-TAB&lt;/code&gt;) when needed. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;" OwnerUserId="10742" LastEditorUserId="10742" LastEditDate="2016-03-15T06:28:15.880" LastActivityDate="2016-03-15T06:28:15.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20980" PostTypeId="2" ParentId="20974" CreationDate="2016-03-15T07:15:09.077" Score="8" Body="&lt;p&gt;I wrote &lt;a href=&quot;http://oremacs.com/2015/07/16/callback-quit/&quot; rel=&quot;noreferrer&quot;&gt;about this&lt;/a&gt; once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defmacro ivy-quit-and-run (&amp;amp;rest body)&#xA;  &quot;Quit the minibuffer and run BODY afterwards.&quot;&#xA;  `(progn&#xA;     (put 'quit 'error-message &quot;&quot;)&#xA;     (run-at-time nil nil&#xA;                  (lambda ()&#xA;                    (put 'quit 'error-message &quot;Quit&quot;)&#xA;                    ,@body))&#xA;     (minibuffer-keyboard-quit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-03-15T07:15:09.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20981" PostTypeId="1" AcceptedAnswerId="28039" CreationDate="2016-03-15T07:31:35.197" Score="1" ViewCount="82" Body="&lt;p&gt;I wrote &lt;a href=&quot;https://github.com/kanaka/mal/tree/master/elisp&quot; rel=&quot;nofollow&quot;&gt;an interpreter&lt;/a&gt; by leveraging &lt;code&gt;--batch&lt;/code&gt;, &lt;code&gt;read-from-minibuffer&lt;/code&gt; and &lt;code&gt;princ&lt;/code&gt;.  Now, reading input is relatively limited, you can type consecutive characters, erase the last character with &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt;, send a line with &lt;code&gt;RET&lt;/code&gt; and cancel input with &lt;code&gt;C-d&lt;/code&gt; (or &lt;code&gt;C-c&lt;/code&gt;, but that aborts the entire program).  This is good enough for testing, but I'd like to shoot for more readline-like editing.  Is it possible to intercept individual control keys before printing them and how?&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-10-23T09:48:12.090" Title="Readline emulation in batch mode" Tags="|key-bindings|batch-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20982" PostTypeId="1" CreationDate="2016-03-15T15:20:39.670" Score="2" ViewCount="243" Body="&lt;p&gt;I am writing a statistical report using &lt;code&gt;.Rnw&lt;/code&gt; buffer and enjoying the very nice &lt;code&gt;ess-noweb-mode&lt;/code&gt;, which I see very promising indeed, but what struck me is the strange behavior when I hit the keybinding to insert a new chunk &lt;kbd&gt;M&lt;/kbd&gt;-&lt;kbd&gt;n&lt;/kbd&gt; &lt;kbd&gt;i&lt;/kbd&gt; it will introduce an extra &lt;code&gt;@&lt;/code&gt; symbol at the very beginning of the chunk, is this an expected behavior or am I missing some point here? your input would be much appreciated.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@ &#xA;&amp;lt;&amp;lt;anyChunkName&amp;gt;&amp;gt;=&#xA;R code goes here&#xA;@ %def &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had to delete that leading &lt;code&gt;@&lt;/code&gt; each time writing an R chunk to appear like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;&amp;lt;anyChunkName&amp;gt;&amp;gt;=&#xA;R code goes here&#xA;@ %def &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&#xA;I am using ESS vesrion 15.09-2 patched&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2016-03-15T18:29:27.670" LastActivityDate="2017-09-09T08:28:34.423" Title="Why does inserting a new R chunk inside `ess-noweb-mode` give me a leading @ symbol?" Tags="|key-bindings|ess|r|literate-programming|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20983" PostTypeId="1" CreationDate="2016-03-15T16:52:34.897" Score="8" ViewCount="3090" Body="&lt;p&gt;If I export the following document as a PDF through &lt;code&gt;C-c C-e l p&lt;/code&gt; I get a PDF with a table of contents as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Hello                                                                                                                                      &#xA;&#xA;  This is a test.                                                                                                                            &#xA;&#xA;* World                                                                                                                                      &#xA;&#xA;  Of org mode section numbering.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but if I add &lt;code&gt;num:nil&lt;/code&gt; to the options (to disable section numbering) like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: num:nil                                                                                                                           &#xA;* Hello                                                                                                                                      &#xA;&#xA;  This is a test.                                                                                                                            &#xA;&#xA;* World                                                                                                                                      &#xA;&#xA;  Of org mode section numbering.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my table of contents becomes empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to have a table of contents but without all the section numbers.  Is there any way to do that?  I've tried adding &lt;code&gt;toc:2&lt;/code&gt; as well but that didn't help.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The first one (without the &lt;code&gt;num:nil&lt;/code&gt;) looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/e0kPK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/e0kPK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the second one (with the &lt;code&gt;num:nil&lt;/code&gt;) looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/InCjV.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/InCjV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a rather useless table of contents...)&lt;/p&gt;&#xA;" OwnerUserId="573" LastActivityDate="2017-05-18T21:00:56.297" Title="Disabling section numbering causes Table of Contents to disappear in org mode Latex export" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20984" PostTypeId="1" AcceptedAnswerId="21599" CreationDate="2016-03-15T18:01:35.207" Score="2" ViewCount="2298" Body="&lt;p&gt;I'm trying to set up magit to work nicely with evil mode. Ideally I'd be able to open the &lt;code&gt;magit-status-mode&lt;/code&gt; buffer in normal mode and be able to stage/commit from that buffer with vim-like keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To open &lt;code&gt;magit-status&lt;/code&gt; in normal mode, I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-set-initial-state 'magit-status-mode 'normal)&#xA;(evil-define-key 'normal magit-status-mode-map&#xA;  &quot;j&quot; 'magit-goto-next-section&#xA;  &quot;k&quot; 'magit-goto-previous-section)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to add keybindings to this map for staging/committing files?    Or a better way to accomplish my stated goal above than this approach altogether?&lt;/p&gt;&#xA;" OwnerUserId="11415" LastEditorUserId="306" LastEditDate="2016-08-31T10:53:14.747" LastActivityDate="2016-08-31T10:53:14.747" Title="What's a good setup for integrating magit with evil mode?" Tags="|magit|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20985" PostTypeId="2" ParentId="17753" CreationDate="2016-03-15T19:46:06.647" Score="1" Body="&lt;p&gt;You can start a local python console by executing &lt;code&gt;run-python&lt;/code&gt; while in a local buffer (&lt;code&gt;*scratch*&lt;/code&gt; will do). The problem is that python interaction will not work for remote files then without some additional hacking.&#xA;Generally you need the python process to be running on the same machine that the files reside on&#xA;since emacs communicates with the python process vial the file system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example &lt;code&gt;python-shell-send-buffer&lt;/code&gt; saves a copy of the buffer in /tmp for the process to read.&#xA;With a remote file and a local python process the buffer will get saved to on the remote machine and python will try to read from the same path on the local one and fail to find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make python interaction work with files on a different machine from where the python shell is running would require tweaking the code to put temporary files on the machine where the python is running, regardless of where the file is, or where you are running emacs.&#xA;&lt;em&gt;I would be interested to know how to do that myself.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="2706" LastEditDate="2016-03-16T21:34:13.473" LastActivityDate="2016-03-16T21:34:13.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20986" PostTypeId="1" AcceptedAnswerId="29870" CreationDate="2016-03-15T20:06:57.667" Score="4" ViewCount="145" Body="&lt;p&gt;I want to add Russian holidays to variable &lt;code&gt;holiday-local-holidays&lt;/code&gt; formatted like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((holiday-fixed 1 1 &quot;New Year's Day&quot;)&#xA; (holiday-float 1 1 3 &quot;Martin Luther King Day&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any list I can use or do I need to start from scratch?&lt;/p&gt;&#xA;" OwnerUserId="5462" LastEditorUserId="675" LastEditDate="2016-03-15T21:04:32.283" LastActivityDate="2017-01-07T22:10:19.423" Title="Is there a list of Russian holidays?" Tags="|variables|calendar|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20987" PostTypeId="1" AcceptedAnswerId="37330" CreationDate="2016-03-15T21:31:23.433" Score="10" ViewCount="668" Body="&lt;p&gt;I'm using the package &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot;&gt;Multiple Cursors&lt;/a&gt; in an html file and it's awesome for a few cursors but if I create more than 30 or 50 cursors it gets terribly slow and it takes about five or six seconds just to move the cursors.&lt;br&gt;&#xA;Am I using it wrong or it just that it's not prepared for creating that many cursors?.&lt;br&gt;&lt;/p&gt;&#xA;" OwnerUserId="7006" LastActivityDate="2018-02-20T21:53:38.493" Title="Multiple cursors package makes emacs run slow" Tags="|multiple-cursors|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20988" PostTypeId="2" ParentId="20974" CreationDate="2016-03-15T21:35:15.543" Score="5" Body="&lt;p&gt;I don't know of a way to do what you request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you say in your question, and as @abo-abo shows, a workaround is to use a &lt;em&gt;timer&lt;/em&gt; to execute the code you want run after the minibuffer is exited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more typical approach is to execute the code from the minibuffer (i.e., before exiting).  To do that, you need to set up and use the proper context, which in your case means select the window that you want to split. But your question was how to avoid doing this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you cannot (as far as I know) exit the minibuffer and then invoke the remaining code in your command is that exiting the minibuffer performs a &lt;em&gt;non-local exit&lt;/em&gt;, by &lt;code&gt;throw&lt;/code&gt;ing to a &lt;code&gt;catch&lt;/code&gt; tag outside the command's invocation stack (typically tag &lt;code&gt;exit&lt;/code&gt;, but you can also exit to the &lt;code&gt;top-level&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-15T21:35:15.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20989" PostTypeId="2" ParentId="20987" CreationDate="2016-03-15T22:28:18.083" Score="-1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;... more than 30 or 50 cursors it gets terribly slow ....&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here's a temp solution: adjust this variable&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mc/max-cursors&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to a value less than 30 as a workaround. The default is nil, which means no limit. The actual number to restore the speed depends on the buffer type, fonts used, and whatever else is running at the time. In any case, the problem you are having has been widely reported.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-03-15T22:28:18.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20990" PostTypeId="2" ParentId="20986" CreationDate="2016-03-15T22:33:55.663" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there any list I can use or do I need to start from scratch?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Public_holidays_in_Russia&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; has a list; there's also a short list &lt;a href=&quot;https://en.wikipedia.org/wiki/Public_holidays_in_the_Soviet_Union&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. You may have to scrape those dates off an HTML table.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-03-15T22:33:55.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20991" PostTypeId="1" AcceptedAnswerId="21010" CreationDate="2016-03-15T23:56:51.597" Score="0" ViewCount="383" Body="&lt;p&gt;I am working with python code on a remote machine using tramp. Once I start the start the remote python shell, the editor window starts to freeze up for around/under a second second at a time, but very frequently. All I am doing is moving around in the code file. It happens with both python and ipython shells.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When this happens messages flash by in the mini-buffer indicating communication with the python shell. Some messages indicate that documentation is being retrieved, even though I am not requesting it. These messages are not recorded in any other buffer like &lt;code&gt;*Messages*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I reduce/stop this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My .ssh/config already has:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host *&#xA; ControlPath ~/.ssh/master-%r@%h:%p&#xA; ControlMaster auto&#xA; ControlPersist yes&#xA; ServerAliveInterval 3&#xA; ServerAliveCountMax 50&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="2706" LastEditDate="2016-03-16T22:16:40.247" LastActivityDate="2016-04-16T00:44:51.023" Title="communication with remote inferior python shell slowing down code editing" Tags="|python|tramp|ssh|subprocess|inferior-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20993" PostTypeId="1" CreationDate="2016-03-16T14:40:37.343" Score="2" ViewCount="313" Body="&lt;p&gt;When I write JavaScript code, company does not toggle when prefix is &lt;code&gt;$&lt;/code&gt;, how to fix it?&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-idle-delay 0)&#xA;(setq company-minimum-prefix-length 0)&#xA;(setq company-auto-complete t)&#xA;(setq company-require-match nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9773" LastEditorUserId="6701" LastEditDate="2021-05-09T12:12:07.737" LastActivityDate="2024-01-24T19:07:35.903" Title="How to toggle company-mode with $ prefix?" Tags="|company-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="20995" PostTypeId="1" AcceptedAnswerId="21083" CreationDate="2016-03-16T16:31:52.800" Score="3" ViewCount="874" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt;, I distinguish between two scenarios:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;AUCTeX is not available. Then I load my customizations for the basic TeX mode — let's call that &lt;code&gt;(my-tex-mode-customizations)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;AUCTeX is available. Then I load my AUCTeX customizations — let's call that &lt;code&gt;(my-auctex-customizations)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I currently check this by testing whether &lt;code&gt;(require 'tex-site)&lt;/code&gt; succeeds. This worked fine in the good old days, and still works when AUCTeX is installed system-wide or manually with &lt;code&gt;tex-site&lt;/code&gt; somewhere in &lt;code&gt;load-path&lt;/code&gt;, but it fails when AUCTeX is installed through Emacs's package mechanism, because then &lt;code&gt;tex-site&lt;/code&gt; is loaded during package initialization which happens after the init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If AUCTeX is available as a package, I want to load my AUCTeX customizations. Furthermore, if AUCTeX is both available as a package and provided system-wide, then &lt;code&gt;tex-site&lt;/code&gt; is already loaded by the time my init file runs, but I'd like to unload it and load the one available through the package mechanism instead. More precisely, ideally, I'd like to use the most recent AUCTeX version in this situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my code might look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun auctex-is-available ()&#xA;  (condition-case nil&#xA;      (progn&#xA;        (require 'tex-site)&#xA;        AUCTeX-version)&#xA;    nil))&#xA;(defun use-auctex-package-p ()&#xA;  ;; Test if AUCTeX is available as a package.&#xA;  ;; Preferably, if AUCTeX is also available by loading `tex-site'&#xA;  ;; from elsewhere, only use the package if it's more recent.&#xA;  ???)&#xA;(cond&#xA; ((use-auctex-package-p)&#xA;  (if (featurep 'tex-site) (unload-feature 'tex-site))&#xA;  (eval-after-load 'tex-site '(my-auctex-customizations)))&#xA; ((auctex-is-available)&#xA;  (my-auctex-customizations)&#xA; (t&#xA;  (my-tex-mode-customizations)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in &lt;code&gt;.emacs&lt;/code&gt;, how do I test for available package versions? If I do that in a post-init hook, which one, keeping in mind that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if AUCTeX is both present as a package and installed system-wide then the package must be used (at least if it's more recent);&lt;/li&gt;&#xA;&lt;li&gt;if AUCTeX is not present as a package then an attempt must be made to load &lt;code&gt;tex-site&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;if there's no AUCTeX anywhere then &lt;code&gt;my-tex-mode-customizations&lt;/code&gt; must get executed;&lt;/li&gt;&#xA;&lt;li&gt;if AUCTeX is loaded from anywhere then &lt;code&gt;my-auctex-customizations&lt;/code&gt; must get executed after the final &lt;code&gt;tex-site&lt;/code&gt; has been loaded;&lt;/li&gt;&#xA;&lt;li&gt;all of this must happen before &lt;code&gt;desktop&lt;/code&gt; loads my saved session;&lt;/li&gt;&#xA;&lt;li&gt;this must work on all Emacs versions that have a package facility (I'll fill in the &lt;code&gt;(fboundp 'package-…)&lt;/code&gt; to cope with older versions).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-19T15:24:09.310" Title="Detect whether a package (AUCTeX) is installed from .emacs" Tags="|init-file|package|auctex|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20996" PostTypeId="2" ParentId="20524" CreationDate="2016-03-16T16:47:59.273" Score="5" Body="&lt;p&gt;I have found a work-around! Admittedly it is a bit hacky, and uses woman&#xA;rather than man, but I think this might just work for me. Essentially,&#xA;&lt;code&gt;woman-find-file&lt;/code&gt; is tramp aware, so if we can pass it the path to the remote&#xA;man page it will open it just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Passing the &lt;code&gt;--path&lt;/code&gt; flag to &lt;code&gt;man&lt;/code&gt; will output the path of the manpage rather than open the manpage itself. Woman doesn't like pre-formatted man pages, so pass the &lt;code&gt;-c&lt;/code&gt; flag to ignore those. Now we can execute the &lt;em&gt;remote&lt;/em&gt; man command (by prefixing &lt;code&gt;man&lt;/code&gt; with &lt;code&gt;*&lt;/code&gt;) to find the path to the &lt;code&gt;foo&lt;/code&gt; man page thus: &lt;code&gt;*man -c --path foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following function takes a path from the above and checks if it is a&#xA;remote path. If it is, it prepends the tramp method, user &amp;amp; host to the local&#xA;file name. Then it invokes the &lt;code&gt;woman-find-file&lt;/code&gt; function on the result. Put&#xA;it in your &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun tramp-aware-woman (man-page-path)&#xA;  (interactive)&#xA;  (let ((dir (eshell/pwd)))&#xA;    (woman-find-file&#xA;     (if (file-remote-p dir)&#xA;         (let ((vec (tramp-dissect-file-name dir)))&#xA;           (tramp-make-tramp-file-name&#xA;            (tramp-file-name-method vec)&#xA;            (tramp-file-name-user vec)&#xA;            (tramp-file-name-host vec)&#xA;            man-page-path))&#xA;       man-page-path))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we can create an alias that invokes our function for a bit of ux sugar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias man 'tramp-aware-woman ${*man -c --path $1}'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The new command should work from eshell both locally and remote, though you&#xA;will now get woman's rendering. You may want to choose a different name for&#xA;the alias if you want to retain the existing behaviour of man for local man&#xA;pages.&lt;/p&gt;&#xA;" OwnerUserId="10625" LastEditorUserId="10625" LastEditDate="2017-02-04T17:37:58.123" LastActivityDate="2017-02-04T17:37:58.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20997" PostTypeId="2" ParentId="20949" CreationDate="2016-03-16T17:55:00.510" Score="6" Body="&lt;p&gt;One way to do this is to change the variable &lt;code&gt;org-babel-inline-result-wrap&lt;/code&gt; from &lt;code&gt;=%s=&lt;/code&gt;, which formats the output, to just &lt;code&gt;%s&lt;/code&gt;, which does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this with a non-exporting lisp code block somewhere in your file if you don't want to change it globally.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC lisp :exports none&#xA;  (setq org-babel-inline-result-wrap &quot;%s&quot;)&#xA;#+END_SRC&#xA;&#xA;This is a test of text: 4 and code: src_R{2+2}.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11424" LastActivityDate="2016-03-16T17:55:00.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20998" PostTypeId="1" AcceptedAnswerId="21000" CreationDate="2016-03-16T18:34:44.733" Score="1" ViewCount="985" Body="&lt;p&gt;I just spent at least 10m writing a &lt;code&gt;trim-space&lt;/code&gt; function in Emacs lisp:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun trim-space (string)&#xA;  (let ((regex &quot;\\`[ \n\t\r]*\\(\\(.\\|\n\\)*?\\)[ \n\t\r]*\\'&quot;))&#xA;    (string-match regex string)&#xA;    (match-string 1 string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is after several iterations. There are several gotchas that I ran into:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;^&lt;/code&gt; matches beginning of line, not beginning of string. Likewise for &lt;code&gt;$&lt;/code&gt;. Documentation on this is not easy to find within Emacs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;.&lt;/code&gt; (dot) doesn't match newline&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[:space:]&lt;/code&gt; class doesn't include newline????&lt;/li&gt;&#xA;&lt;li&gt;I also don't like that I have to mess with match-data, giving this function side effects&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Finally:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (trim-space &quot;   deb   ian-&#xA;mini&quot;)&#xA;&quot;deb   ian-\nmini&quot;&#xA;ELISP&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, using Python:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-python prettyprint-override&quot;&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import re; &#xA;&amp;gt;&amp;gt;&amp;gt; re.findall(&quot;(?s)^\\s*(.*?)\\s*$&quot;, &quot;   deb   ian-\nmini  &quot;)&#xA;['deb   ian-\nmini']&#xA;&amp;gt;&amp;gt;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is much simpler and clean and makes much more sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why shouldn't Emacs lisp look more like Python here? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I know about &lt;code&gt;string-trim&lt;/code&gt; in Emacs 24. Emacs regular expression syntax is still unintuitive and ugly and non-standard.&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2016-03-16T21:52:10.247" LastActivityDate="2016-03-16T21:52:10.247" Title="why is this trim-space function so complicated/ugly in emacs lisp?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="6" ClosedDate="2016-03-17T15:25:55.797" ContentLicense="CC BY-SA 3.0" />
  <row Id="20999" PostTypeId="1" AcceptedAnswerId="21004" CreationDate="2016-03-16T18:40:15.310" Score="0" ViewCount="398" Body="&lt;p&gt;According to &lt;a href=&quot;https://emacs.stackexchange.com/a/410/9686&quot;&gt;emacs.SE answer&lt;/a&gt; I am trying to make Emacs (version 25.0.92) autoload packages if they are not already installed on my computer. At my &lt;code&gt;.emacs&lt;/code&gt; file now I have only:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;(require 'package)&#xA;&#xA;(setq package-archives '((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))&#xA;&#xA;(setq my-package-list '(nyan-mode dired+))&#xA;&#xA;(mapc #'package-install my-package-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But have an an error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;error: Package ‘auctex-’ is unavailable&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What I am doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="9686" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-03-16T22:20:11.450" Title="autoload list of packages in Emacs 25.0.92" Tags="|package|error-handling|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21000" PostTypeId="2" ParentId="20998" CreationDate="2016-03-16T18:47:16.673" Score="1" Body="&#xA;&#xA;&lt;p&gt;Here's one way to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-chomp (str)&#xA;    &quot;Trim leading and trailing whitespace from STR.&quot;&#xA;    (replace-regexp-in-string &quot;\\(\\`[[:space:]\n]*\\|[[:space:]\n]*\\'\\)&quot; &quot;&quot; str))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's a &lt;code&gt;let&lt;/code&gt; form to quickly test it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((str &quot;   deb   ian-&#xA;mini    &quot;))&#xA;  (defun my-chomp (str)&#xA;    &quot;Trim leading and trailing whitespace from STR.&quot;&#xA;    (replace-regexp-in-string &quot;\\(\\`[[:space:]\n]*\\|[[:space:]\n]*\\'\\)&quot; &quot;&quot; str))&#xA;&#xA;  (message &quot;%S&quot; str)&#xA;  (message &quot;%S&quot; (my-chomp str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jrblevin/deft/blob/2dd64ddc798a009e62289d65abfa621735461b7a/deft.el#L823-L825&quot; rel=&quot;nofollow&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-03-16T18:47:16.673" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21001" PostTypeId="2" ParentId="20999" CreationDate="2016-03-16T19:30:21.123" Score="0" Body="&lt;p&gt;Auctex is not in the melpa package archive it is in the gnu package archive instead of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives '((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;try &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;         'APPEND)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will keep the gnu package repo in the list of package archives&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="11272" LastEditDate="2016-03-16T22:04:55.733" LastActivityDate="2016-03-16T22:04:55.733" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="21002" PostTypeId="1" CreationDate="2016-03-16T20:47:41.390" Score="1" ViewCount="165" Body="&lt;p&gt;Years ago I saw a feature in XCode where nested code blocks (delimited by {}) containing my cursor had graded background shades, with the lightest at my cursor, and the darkest at the outer level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;.e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;//Very Dark Grey bg&#xA;if(true){ // Dark Grey bg&#xA;    Velociraptor:&#xA;    for(i=0;i&amp;lt;foo;i++){ // Grey bg&#xA;        bar();&#xA;        while(true){// Light Grey bg&#xA;            do{// White bg&#xA;                // cursor here (ominous, isn't it)&#xA;                goto Velociraptor;&#xA;            }while()&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it would dynamically change to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// Dark Grey bg&#xA;if(true){ // Grey bg&#xA;    Velociraptor:&#xA;    for(i=0;i&amp;lt;foo;i++){ // Light Grey bg&#xA;        bar();&#xA;        // cursor here&#xA;        while(true){// White bg&#xA;            do{// White bg&#xA;                goto Velociraptor;&#xA;            }while()&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a package for this in Emacs / can it be done?&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2016-03-16T20:47:41.390" Title="Dynamic background colour for code blocks" Tags="|syntax-highlighting|highlighting|programming|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21003" PostTypeId="2" ParentId="17753" CreationDate="2016-03-16T21:07:08.707" Score="2" Body="&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun run-python-locally (&amp;amp;rest args)&#xA;  (interactive (progn (require 'nadvice)&#xA;                      (advice-eval-interactive-spec&#xA;                       (cadr (interactive-form #'run-python)))))&#xA;  (let ((default-directory user-emacs-directory))&#xA;    (apply #'run-python args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;(This uses the trick from &lt;a href=&quot;https://emacs.stackexchange.com/a/19242/2642&quot;&gt;this answer&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Additionally, if you'd like to use &lt;code&gt;python-shell-send-string&lt;/code&gt;, &lt;code&gt;python-shell-send-region&lt;/code&gt; and company, you'll need this fix:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'cl-lib))&#xA;(defun nadvice/python-shell-send-string/fix-local-process&#xA;    (old-fun string &amp;amp;optional process)&#xA;  (cl-letf* ((old-psstf (symbol-function #'python-shell--save-temp-file))&#xA;             ((symbol-function #'python-shell--save-temp-file)&#xA;              (lambda (string)&#xA;                (let ((default-directory&#xA;                        ;; if buffer is a remote file, but the process is not&#xA;                        ;; save the temp file locally, instead of remotely&#xA;                        (if (and buffer-file-name&#xA;                                 (file-remote-p buffer-file-name)&#xA;                                 (not (plist-get (process-plist process)&#xA;                                                 'remote-tty)))&#xA;                            user-emacs-directory&#xA;                          default-directory)))&#xA;                  (funcall old-psstf string)))))&#xA;    (funcall old-fun string process)))&#xA;&#xA;(advice-add 'python-shell-send-string :around&#xA;            #'nadvice/python-shell-send-string/fix-local-process)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="12168" LastEditDate="2021-01-19T23:42:15.447" LastActivityDate="2021-01-19T23:42:15.447" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="21004" PostTypeId="2" ParentId="20999" CreationDate="2016-03-16T21:11:37.630" Score="1" Body="&#xA;&#xA;&lt;p&gt;As @JulesTamagnan said, you should not use &lt;code&gt;setq&lt;/code&gt; as that will totally replace the default value of &lt;code&gt;package-archives&lt;/code&gt;. You do not need to add Melpa if you are doing it only to install &lt;code&gt;auctex&lt;/code&gt;. But if you want to add Melpa, use &lt;code&gt;add-to-list&lt;/code&gt; as he suggested.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second missing piece is the call to &lt;code&gt;package-refresh-contents&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;&#xA;;; Load emacs packages and activate them&#xA;;; This must come before configurations of installed packages.&#xA;;; Don't delete this line.&#xA;(package-initialize)&#xA;;; `package-initialize' call is required before any of the below&#xA;;; can happen&#xA;&#xA;(defvar my-packages '()) ; POPULATE YOUR TO-BE-INSTALLED PACKAGE LIST HERE&#xA;&#xA;;; Auto install the required packages&#xA;;; https://github.com/bbatsov/prelude/blob/master/core/prelude-packages.el&#xA;;; http://toumorokoshi.github.io/emacs-from-scratch-part-2-package-management.html&#xA;(defvar modi/missing-packages '()&#xA;  &quot;List populated at each startup that contains the list of packages that need&#xA;to be installed.&quot;)&#xA;&#xA;(dolist (p my-packages)&#xA;  (when (not (package-installed-p p))&#xA;    (add-to-list 'modi/missing-packages p)))&#xA;&#xA;(when modi/missing-packages&#xA;  (message &quot;Emacs is now refreshing its package database...&quot;)&#xA;  (package-refresh-contents)&#xA;  ;; Install the missing packages&#xA;  (dolist (p modi/missing-packages)&#xA;    (message &quot;Installing `%s' ..&quot; p)&#xA;    (package-install p))&#xA;  (setq modi/missing-packages '()))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-03-16T21:11:37.630" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21007" PostTypeId="1" CreationDate="2016-03-17T00:08:34.657" Score="4" ViewCount="3683" Body="&lt;p&gt;I'm still trying to wrap my head around how the agenda can work, and I'd like to get a few other people's approaches to it.  What I'd like is to be able to take a task, say writing a paper.  I know that will take about 6-8 hours, and I'm not going to write it in one sitting.  So, I need to set aside three or four 2 hour blocks to work on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the &lt;a href=&quot;http://orgmode.org/guide/Deadlines-and-scheduling.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt;, Deadlines are for the time something must be done by.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEADLINE: &amp;lt;2016-03-16 Wed&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Simple enough.  Scheduling allows you to set a time to start, so I can schedule the paper two weeks before it's due to start it.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SCHEDULED: &amp;lt;2016-03-02&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far so good, but it hasn't actually given me specific times to work on the task.  &lt;a href=&quot;https://emacs.stackexchange.com/questions/10504/understanding-scheduled-in-org-mode&quot;&gt;This question&lt;/a&gt; suggests scheduling an item, and letting it appear on the agenda until it's done, but that still leaves the problem that a large task can only be scheduled once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could assign several timestamps to it, one for every day I want to work on it.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2016-03-04&#xA;&amp;lt;2016-03-06 7pm&amp;gt;&#xA;&amp;lt;2016-03-08&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to be a popular solution, but the agenda and todo views don't seem to have an easy way to manipulate timestamps, as they do for deadlines and scheduled dates, with &lt;code&gt;C-c C-d&lt;/code&gt; and &lt;code&gt;C-c C-s&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other option is to break up the task into a number of subtasks (e.g., research paper, write body, write conclusion, write intro), and schedule those individually.  But, there seem to be many tasks that breaking it up just wouldn't make sense, or where the smallest subtask will still take several hours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, have I misunderstood how to schedule things?  Is there a simple way to manipulate timestamps in agenda view, or do I just need to plan my projects out to the point every scheduled item can be done in a few hours?  What approaches are have worked for you?&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-17T22:38:14.733" Title="Org-mode: scheduling time to work on tasks" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21008" PostTypeId="1" AcceptedAnswerId="21069" CreationDate="2016-03-17T00:14:01.607" Score="2" ViewCount="711" Body="&lt;p&gt;I am trying to make graphical tooltips appear over some words in Emacs. Here is the code I have developed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun image-tooltip (window object position)&#xA;  (save-excursion&#xA;    (goto-char position)&#xA;    (let* ((img-file (format &quot;%s.png&quot; (thing-at-point 'word)))&#xA;       (s (propertize &quot;Look in the minbuffer&quot;&#xA;              'display (create-image (expand-file-name img-file)))))&#xA;      (message &quot;%s&quot; s))))&#xA;&#xA;(font-lock-add-keywords&#xA; nil&#xA; '((&quot;\\&amp;lt;kiwi\\&amp;gt;\\|\\&amp;lt;grapes\\&amp;gt;\\|strawberry&quot; 0 '(face font-lock-keyword-face&#xA;                              help-echo image-tooltip))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The kiwi.png and other images are stored on disk, and they work fine (you can see it here &lt;a href=&quot;https://www.youtube.com/watch?v=uX_hAPb9NOc&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=uX_hAPb9NOc&lt;/a&gt;)&#xA;It works fine to put an image in the minibuffer, but the tooltip itself just says Look in minibuffer, and I thought it would instead show the image. Am I missing something in here?&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-03-18T19:39:50.360" Title="Graphical tooltips in Emacs not working as expected" Tags="|tooltip|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21009" PostTypeId="2" ParentId="20947" CreationDate="2016-03-17T00:20:49.920" Score="13" Body="&lt;p&gt;If you use org-ref (&lt;a href=&quot;https://github.com/jkitchin/org-ref&quot;&gt;https://github.com/jkitchin/org-ref&lt;/a&gt;), you can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+caption: test label:some-source-code&#xA;#+BEGIN_SRC python&#xA;  for i in 1:10:&#xA;      print i&#xA;#+END_SRC&#xA;&#xA;&#xA;See Listing ref:some-source-code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This exports to PDF and HTML with active links.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-03-17T00:20:49.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21010" PostTypeId="2" ParentId="20991" CreationDate="2016-03-17T00:29:15.470" Score="1" Body="&lt;p&gt;The problem is eldoc. Emacs ships with &lt;code&gt;global-eldoc-mode&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt; and &lt;code&gt;eldoc-idle-delay&lt;/code&gt; set to 0.5 seconds. If you are moving around in a file you can generate an awful lot of eldoc calls, which can make emacs unusable over slow or multi-hop ssh connections.&lt;/p&gt;&#xA;" OwnerUserId="2706" LastActivityDate="2016-03-17T00:29:15.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21011" PostTypeId="1" AcceptedAnswerId="21055" CreationDate="2016-03-17T02:53:40.380" Score="2" ViewCount="53" Body="&lt;p&gt;I just installed icicles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use ido-mode for the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a &lt;code&gt;dired&lt;/code&gt; buffer, when I press &lt;code&gt;+&lt;/code&gt; (bound to &lt;code&gt;dired-create-directory&lt;/code&gt;), here is what happens:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the first time, the error &lt;code&gt;icicle-restore-other-keymap-keys: Key sequence M-s M-s starts with non-prefix key M-s&lt;/code&gt; comes up&lt;/li&gt;&#xA;&lt;li&gt;the second time and onward, the minibufferproperly comes up, but there's a twist. It says &lt;code&gt;Create directory: [current dir]&lt;/code&gt; the first time as expected, then &lt;code&gt;Create directory: [current dir][current dir]&lt;/code&gt; the next, etc. etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And after that, even other minibuffer interactions like define-variable would have &lt;code&gt;[current dir][current dir]...&lt;/code&gt; in them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My icicle configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package icicles&#xA;  :config (icy-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My dired config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired-x)&#xA;&#xA;(add-hook 'dired-mode-hook 'dired-hide-details-mode)&#xA;&#xA;(setq global-auto-revert-non-file-buffers t)&#xA;(setq auto-revert-verbose nil)&#xA;&#xA;(setq dired-dwim-target t)&#xA;&#xA;(setq ls-lisp-use-insert-directory-program nil)&#xA;(require 'ls-lisp)&#xA;&#xA;  (require 'dired)&#xA;  (defun dired-back-to-top ()&#xA;    (interactive)&#xA;    (beginning-of-buffer)&#xA;    (next-line 2))&#xA;&#xA;  (define-key dired-mode-map&#xA;    (vector 'remap 'beginning-of-buffer) 'dired-back-to-top)&#xA;&#xA;  (defun dired-jump-to-bottom ()&#xA;    (interactive)&#xA;    (end-of-buffer)&#xA;    (next-line -1))&#xA;&#xA;  (define-key dired-mode-map&#xA;    (vector 'remap 'end-of-buffer) 'dired-jump-to-bottom)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know enough about how icicles to know what's going on. I need some help.&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="105" LastEditDate="2016-03-18T14:31:40.383" LastActivityDate="2016-03-18T14:31:40.383" Title="`+` in dired-mode with icicles and ido enabled raises an error" Tags="|dired|ido|icicles|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21013" PostTypeId="2" ParentId="14342" CreationDate="2016-03-17T03:45:55.017" Score="8" Body="&lt;p&gt;You need to have your table block return an array (or vector or list, etc...) like this. You can get horizontal lines with None, or nil or whatever equivalent type in clojure.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: upper_air&#xA;#+BEGIN_SRC python :results value&#xA;return [[&quot;:m&quot;, &quot;:degree&quot;,&quot;:meter/second&quot;, &quot;:degC&quot;, &quot;:millibar&quot;],&#xA;        None,&#xA;        [1545.0, 175.0, 12.36, 15.40001, 850.0],&#xA;        [3162.0, 265.0, 6.69, 4.8, 700.0]]&#xA;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: upper_air&#xA;|     :m | :degree | :meter/second |    :degC | :millibar |&#xA;|--------+---------+---------------+----------+-----------|&#xA;| 1545.0 |   175.0 |         12.36 | 15.40001 |     850.0 |&#xA;| 3162.0 |   265.0 |          6.69 |      4.8 |     700.0 | &#xA;&#xA;&#xA;#+BEGIN_SRC python :results value  :var data=upper_air&#xA;import numpy as np&#xA;&#xA;arr = np.array(data)&#xA;p = arr[:,4]&#xA;return p&#xA;#+END_SRC  &#xA;&#xA;#+RESULTS:&#xA;| 850 | 700 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-03-17T03:45:55.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21014" PostTypeId="2" ParentId="21007" CreationDate="2016-03-17T04:01:00.270" Score="2" Body="&lt;p&gt;Here are some built-in functions -- org-mode version 8.2.10 and &lt;strong&gt;perhaps&lt;/strong&gt; earlier (but untested) -- for changing the date in &lt;code&gt;org-agenda-mode&lt;/code&gt; that the original poster may find useful -- they are available in the drop-down menu or certain mouse pop-up context menus, and some of them have keyboard shortcuts already defined:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;Change Date +1 day&quot; org-agenda-date-later&#xA;&#xA;&quot;Change Date -1 day&quot; org-agenda-date-earlier&#xA;&#xA;&quot;Change Time +1 hour&quot; org-agenda-do-date-later -- &quot;C-u S-right&quot;&#xA;&#xA;&quot;Change Time -1 hour&quot; org-agenda-do-date-earlier --&quot;C-u S-left&quot;&#xA;&#xA;&quot;Change Time +  min&quot; org-agenda-date-later -- &quot;C-u C-u S-right&quot;&#xA;&#xA;&quot;Change Time -  min&quot; org-agenda-date-earlier -- &quot;C-u C-u S-left&quot;&#xA;&#xA;&quot;Change Date to ...&quot; org-agenda-date-prompt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the section of the manual:  &lt;a href=&quot;http://orgmode.org/manual/Agenda-commands.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Agenda-commands.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to jump to the master org-mode file, and change relevant portions of the time-stamp with &lt;code&gt;Shift+up&lt;/code&gt; / &lt;code&gt;Shift+down&lt;/code&gt; / &lt;code&gt;Shift+right&lt;/code&gt; / &lt;code&gt;Shift+left&lt;/code&gt; -- and then redo the agenda buffer.  For more information on those features type:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-function RET org-shiftup RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-function RET org-shiftdown RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-function RET org-shiftright RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-function RET org-shiftleft RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The three main functions used to create org-agenda buffers are &lt;code&gt;org-agenda-list&lt;/code&gt;; &lt;code&gt;org-tags-view&lt;/code&gt;; and &lt;code&gt;org-search-view&lt;/code&gt;.  Consider putting them on speed-dial with global keyboard shortcuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider programmatically organizing the master org-mode file with functions such as &lt;code&gt;org-sort-entries&lt;/code&gt;, and using the outline collapse features to make everything more readable.  See also the section of the manual relating to creating sparstrees (a collapsed outline based on a search criteria):  &lt;a href=&quot;http://orgmode.org/manual/Sparse-trees.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Sparse-trees.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-03-17T04:16:13.957" LastActivityDate="2016-03-17T04:16:13.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21015" PostTypeId="1" CreationDate="2016-03-17T04:36:28.247" Score="12" ViewCount="1764" Body="&lt;p&gt;When should I use macro in my program or not to?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is inspired by &lt;a href=&quot;https://emacs.stackexchange.com/questions/16375/#16377&quot;&gt;an informative answer&lt;/a&gt; by @tarsius.  I believe many have great experiences to share others.  I hope this question become one of &lt;a href=&quot;http://blog.stackoverflow.com/2010/09/good-subjective-bad-subjective/#guidelines-for-great-subjective-questions&quot;&gt;Great Subjective Questions&lt;/a&gt; and help Emacs programmers.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2021-02-24T16:55:41.067" Title="When to use macro or not to use" Tags="|elisp-macros|" AnswerCount="3" CommentCount="0" ClosedDate="2016-03-17T21:33:27.860" ContentLicense="CC BY-SA 3.0" />
  <row Id="21016" PostTypeId="2" ParentId="16468" CreationDate="2016-03-17T04:55:24.810" Score="1" Body="&lt;p&gt;Give &lt;a href=&quot;https://www.emacswiki.org/emacs/redshift-indent.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/redshift-indent.el&lt;/a&gt; a try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;C-h f redshift-indent&lt;/code&gt; for usage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't use this version if you use tabs for indentation (although unless you're mixing spaces and tabs, you didn't have a problem to begin with, as for the tabs-only approach you can simply adjust &lt;code&gt;tab-width&lt;/code&gt; to suit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're indenting with spaces exclusively, I believe this will be fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wasn't planning to release it until I'd followed up on a text property bug report (which is waiting for me to provide more details of the scenarios in which things don't work), but you might find it works for you regardless. I decided to pop it on the Wiki as-is on account of seeing another question &lt;a href=&quot;https://emacs.stackexchange.com/questions/13274/view-code-with-different-indentation-than-saved-to-disk&quot;&gt;View code with different indentation than saved to disk&lt;/a&gt; -- before I realised that the other question wasn't actually a duplicate after all... whereupon I figured I should just post an answer to the proper question...&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-03-17T10:50:17.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21017" PostTypeId="2" ParentId="19570" CreationDate="2016-03-17T08:17:51.550" Score="4" Body="&lt;p&gt;&lt;code&gt;[[citep:Fong:2006][p. 1445]]&lt;/code&gt; is exported to latex as &lt;code&gt;\citep[p. 1445]{Fong:2006}&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10902" LastActivityDate="2016-03-17T08:17:51.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21019" PostTypeId="1" AcceptedAnswerId="21060" CreationDate="2016-03-17T10:37:07.450" Score="1" ViewCount="534" Body="&lt;p&gt;I am looking for a way to ignore case when discovering packages through company's completion with &lt;a href=&quot;https://github.com/Wilfred/pip-requirements.el/blob/master/pip-requirements.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;pip-requirements.el&lt;/a&gt; only.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Edit:&lt;/h3&gt;&#xA;&lt;p&gt;Using &lt;code&gt;completion-ignore-case&lt;/code&gt;, &amp;quot;breaks&amp;quot; the highlight of candidates:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AZkvF.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AZkvF.gif&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-18T15:32:50.323" Title="How can I use company's ignore-case with pip-requirements.el" Tags="|company-mode|pip-requirements|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21020" PostTypeId="5" CreationDate="2016-03-17T10:39:44.950" Score="0" Body="&lt;p&gt;Major mode for editing pip (Python package installer) requirements files.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Wilfred/pip-requirements.el&quot; rel=&quot;nofollow&quot;&gt;Home page and code repository&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="25" LastEditDate="2016-03-17T13:14:40.450" LastActivityDate="2016-03-17T13:14:40.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21021" PostTypeId="4" CreationDate="2016-03-17T10:39:44.950" Score="0" Body="Major mode for editing pip (Python package installer) requirements files" OwnerUserId="2397" LastEditorUserId="25" LastEditDate="2016-03-17T13:14:40.450" LastActivityDate="2016-03-17T13:14:40.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21022" PostTypeId="1" AcceptedAnswerId="21025" CreationDate="2016-03-17T11:26:50.943" Score="5" ViewCount="576" Body="&lt;p&gt;How can I visually truncate the lines of a buffer at a specific column instead at the last column of the buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this even possible in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, so, is it possible to also choose at which column the line starts, so that when I have a big Emacs window (let's say with 200 columns), the text occupies only the central (80 columns)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT: Error message with debug on after trying JEanPierre answer:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)&#xA;  +(4 nil 198)&#xA;  (- (+ cur-l cur-r cur-width) width)&#xA;  (let* ((cur-width (window-width)) (cur-m (window-margins)) (cur-l (if (and cur-m (car cur-m)) (car cur-m) 0)) (cur-r (if (and cur-m (car cur-m)) (cdr cur-m) 0)) (lr (- (+ cur-l cur-r cur-width) width)) (left (/ lr 2)) (right (if (= 0 (% lr 2)) left (1+ left)))) (set-window-margins nil (max left 0) (max right 0)))&#xA;  (if (= 0 width) (set-window-margins nil 0 0) (let* ((cur-width (window-width)) (cur-m (window-margins)) (cur-l (if (and cur-m (car cur-m)) (car cur-m) 0)) (cur-r (if (and cur-m (car cur-m)) (cdr cur-m) 0)) (lr (- (+ cur-l cur-r cur-width) width)) (left (/ lr 2)) (right (if (= 0 (% lr 2)) left (1+ left)))) (set-window-margins nil (max left 0) (max right 0))))&#xA;  my/change-window-width(80)&#xA;  call-interactively(my/change-window-width record nil)&#xA;  command-execute(my/change-window-width record)&#xA;  helm-M-x(nil &quot;my/change-window-width&quot;)&#xA;  call-interactively(helm-M-x nil nil)&#xA;  command-execute(helm-M-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10423" LastEditorUserId="10423" LastEditDate="2016-03-17T20:23:37.050" LastActivityDate="2016-03-17T21:12:22.723" Title="Truncate lines at a specific visual column instead of truncating in the last visual column" Tags="|spacemacs|line-break|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21023" PostTypeId="2" ParentId="21015" CreationDate="2016-03-17T12:03:11.497" Score="14" Body="&lt;h1&gt;Rule of thumb&lt;/h1&gt;&#xA;&lt;p&gt;Use macros for &lt;strong&gt;syntax&lt;/strong&gt;, but &lt;strong&gt;never&lt;/strong&gt; for semantics.&lt;/p&gt;&#xA;&lt;p&gt;It's fine to use a macro for some syntactic sugar, but it's a bad idea to put logic into a macro body regardless of whether it's in the macro itself or in the expansion.  If you feel the need to do that, write a function instead, and a &amp;quot;companion macro&amp;quot; for the syntactic sugar.  Simply speaking, if you've got a &lt;code&gt;let&lt;/code&gt; in your macro you're looking for trouble.&lt;/p&gt;&#xA;&lt;h1&gt;Why?&lt;/h1&gt;&#xA;&lt;p&gt;Macros have an awful lot of drawbacks:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;They expand at compilation time and thus must be written carefully to maintain &lt;strong&gt;binary compatibility&lt;/strong&gt; across multiple versions.  For instance, removing a function or variable used in the expansion of a macro will break the byte code of all dependent packages that were using this macro.  In other words, if you change the implementation of a macro in an incompatible way, all dependent packages must be recompiled.  And binary compatibility isn't always obvious…&lt;/li&gt;&#xA;&lt;li&gt;You must take care to maintain an &lt;strong&gt;intuitive evaluation order&lt;/strong&gt;.  It's all too easy to write a macro that evaluates a form too often, or at the wrong time, or in the wrong place, etc…&lt;/li&gt;&#xA;&lt;li&gt;You must watch out for &lt;strong&gt;binding semantics&lt;/strong&gt;: Macros inherit their binding context from the &lt;em&gt;expansion site&lt;/em&gt;, which means that you don't know a priori what lexical variables exist, and whether lexical binding is even available.  A macro must work with both binding semantics.&lt;/li&gt;&#xA;&lt;li&gt;Related to this, you must watch out when writing macros that &lt;strong&gt;create closures&lt;/strong&gt;.  Remember, you get the bindings from the expansion site, not from the lexical definition, so watch out for what you close over and how you create the closure (remember, you don't know whether lexical binding is active at the expansion site and whether you even have closures available).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="29560" LastEditDate="2021-02-24T16:55:41.067" LastActivityDate="2021-02-24T16:55:41.067" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="21024" PostTypeId="2" ParentId="20995" CreationDate="2016-03-17T13:22:52.317" Score="3" Body="&lt;p&gt;It is strongly recommended to initialize ELPA packages early by adding&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;somewhere at the beginning of your &lt;code&gt;~/.emacs&lt;/code&gt; file.  The initialization that's done after loading the .emacs file is just a fallback behavior.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually in Emacs-25.1, the &lt;code&gt;(package-initialize)&lt;/code&gt; call will be added automatically for you in some cases.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-03-17T13:22:52.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21025" PostTypeId="2" ParentId="21022" CreationDate="2016-03-17T13:51:31.580" Score="2" Body="&lt;p&gt;You can do that by setting &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Margins.html#Display-Margins&quot; rel=&quot;nofollow&quot;&gt;display margins&lt;/a&gt;.  The following code is an attempt at that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/change-window-width (width)&#xA;  &quot;Adjust margins so that window is centered&quot;&#xA;  (interactive &quot;NWindow width: &quot;)&#xA;  (if (= 0 width)&#xA;      (set-window-margins nil 0 0)&#xA;    (let* ((cur-width (window-width))&#xA;           (cur-m (window-margins))&#xA;           (cur-l (if (and cur-m (car cur-m)) (car cur-m) 0))&#xA;           (cur-r (if (and cur-m (cdr cur-m)) (cdr cur-m) 0))&#xA;           (lr (- (+ cur-l cur-r cur-width) width))&#xA;           (left (/ lr 2))&#xA;           (right (if (= 0 (% lr 2)) left (1+ left))))&#xA;      (set-window-margins nil (max left 0) (max right 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Giving 0 as width means remove the margins.  Giving too large a width has the same effect.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-03-17T21:12:22.723" LastActivityDate="2016-03-17T21:12:22.723" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21026" PostTypeId="1" CreationDate="2016-03-17T14:31:18.207" Score="0" ViewCount="286" Body="&lt;p&gt;The default tramp history file is /dev/null, which is a big problem because tramp recreates its history file as a regular file when it hits history limit, which is rather annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to override the path variable for the history file with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;(require 'tramp)&#xA;(defvar tramp-histfile-override &quot;~/.tramp_history&quot; &quot;Prevent tramp from using /dev/null and recreating it as a regular file when history size is reached.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;according to: &lt;a href=&quot;https://emacs.stackexchange.com/questions/12904/tramp-history-files&quot;&gt;.tramp_history files&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used defvar because there is no such a variable as tramp-histfile-override &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and it is not working. Well the funny thing is that I know a solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change the HISTFILE value from /dev/null to something more sane in tramp-sh.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@@ -3865,7 +3865,7 @@ file exists and nonzero exit status otherwise.&quot;&#xA;       ;; the prompt in /bin/bash, it must be discarded as well.&#xA;       (tramp-send-command&#xA;        vec (format&#xA;-       &quot;exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s&quot;&#xA;+       &quot;exec env ENV='' HISTFILE=~/.tramp_history PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s&quot;&#xA;        (tramp-shell-quote-argument tramp-end-of-output)&#xA;        shell (or extra-args &quot;&quot;))&#xA;        t))&#xA;@@ -4587,7 +4587,7 @@ connection if a previous connection has died for some reason.&quot;&#xA;        (delete-process p))&#xA;          (setenv &quot;TERM&quot; tramp-terminal-type)&#xA;          (setenv &quot;LC_ALL&quot; &quot;en_US.utf8&quot;)&#xA;-         (setenv &quot;HISTFILE&quot; &quot;/dev/null&quot;)&#xA;+         (setenv &quot;HISTFILE&quot; &quot;~/.tramp_history&quot;)&#xA;          (setenv &quot;PROMPT_COMMAND&quot;)&#xA;          (setenv &quot;PS1&quot; tramp-initial-end-of-output)&#xA;          (let* ((target-alist (tramp-compute-multi-hops vec))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Question: Are there any other ways without modifying the Emacs source code?&lt;/p&gt;&#xA;" OwnerUserId="10978" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-17T16:23:36.243" Title="Tramp recreates /dev/null as a regular file" Tags="|tramp|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21027" PostTypeId="2" ParentId="19493" CreationDate="2016-03-17T14:39:17.467" Score="2" Body="&lt;p&gt;The easiest way is to parametrize the call &lt;code&gt;slime-eval&lt;/code&gt;, using funcall and a &lt;code&gt;defvar&lt;/code&gt;/&lt;code&gt;defcustom&lt;/code&gt; and take advantage use of sly's &lt;a href=&quot;https://github.com/capitaomorte/sly/blob/master/contrib/slynk-retro.lisp&quot; rel=&quot;nofollow&quot;&gt;retro contrib&lt;/a&gt;, which allows the user to refer to the slynk pacage by the name of swank. Besides the replacing &lt;code&gt;(slime-eval ...)&lt;/code&gt; with &lt;code&gt;(funcall org-babel-lisp-eval-fn ...)&lt;/code&gt; the other thing we must do is to require slime or sly when appropiate. I'm using pcase but there may be a more appropriate string-case in emacs lisp.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom org-babel-lisp-eval-fn&#xA;  '(&quot;slime-eval&quot; &quot;sly-eval&quot;)&#xA;   &quot;The function to be called to evaluate code on the lisp side.&quot;&#xA;   :group 'org-babel&#xA;   :version &quot;24.1&quot;&#xA;   :type listp)&#xA;&#xA;(defun org-babel-execute:lisp (body params)&#xA;  &quot;Execute a block of Common Lisp code with Babel.&quot;&#xA;  (pcase org-babel-lisp-eval-fn&#xA;    (&quot;slime-eval&quot; (require 'slime))&#xA;    (&quot;sly-eval&quot; (require 'sly)))&#xA;  (org-babel-reassemble-table&#xA;   (let ((result&#xA;      (funcall (if (member &quot;output&quot; (cdr (assoc :result-params params)))&#xA;               #'car #'cadr)&#xA;           (with-temp-buffer&#xA;             (insert (org-babel-expand-body:lisp body params))&#xA;             (funcall org-babel-lisp-eval-fn&#xA;                              `(swank:eval-and-grab-output&#xA;                                ,(let ((dir (if (assoc :dir params)&#xA;                                                (cdr (assoc :dir params))&#xA;                                              default-directory)))&#xA;                                   (format&#xA;                                    (if dir (format org-babel-lisp-dir-fmt dir)&#xA;                                      &quot;(progn %s\n)&quot;)&#xA;                                    (buffer-substring-no-properties&#xA;                                     (point-min) (point-max)))))&#xA;                              (cdr (assoc :package params)))))))&#xA;     (org-babel-result-cond (cdr (assoc :result-params params))&#xA;       result&#xA;       (condition-case nil&#xA;           (read (org-babel-lisp-vector-to-list result))&#xA;         (error result))))&#xA;   (org-babel-pick-name (cdr (assoc :colname-names params))&#xA;            (cdr (assoc :colnames params)))&#xA;   (org-babel-pick-name (cdr (assoc :rowname-names params))&#xA;            (cdr (assoc :rownames params)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2395" LastActivityDate="2016-03-17T14:39:17.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21028" PostTypeId="1" CreationDate="2016-03-17T14:53:36.850" Score="4" ViewCount="798" Body="&lt;p&gt;Suppose I have a file opened called &quot;analysis-evaluation.tex&quot; and I'd like to create a new buffer called &quot;eval&quot;.  When using Ido, I would press &lt;code&gt;C-j&lt;/code&gt; to create a new buffer rather than switching to an existing buffer; does such a functionality exist with &lt;code&gt;ivy-switch-buffer&lt;/code&gt; too?&lt;/p&gt;&#xA;" OwnerUserId="4026" LastEditorUserId="11272" LastEditDate="2016-03-17T15:46:12.997" LastActivityDate="2016-03-17T15:46:12.997" Title="How to create a new buffer with ivy-switch-buffer that shares a substring with an existing buffer?" Tags="|ido|ivy|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21029" PostTypeId="2" ParentId="21028" CreationDate="2016-03-17T15:28:57.910" Score="9" Body="&lt;p&gt;You can use &lt;code&gt;C-M-j&lt;/code&gt; which calls &lt;code&gt;ivy-immediate-done&lt;/code&gt; to force the output to be exactly what you typed instead of having it complete to the the nearest match&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This and more information can be found in the ivy manual &lt;a href=&quot;http://oremacs.com/swiper/#key-bindings-for-single-selection-action-then-exit-minibuffer&quot; rel=&quot;noreferrer&quot;&gt;ivy-manual &lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="11272" LastEditDate="2016-03-17T15:34:19.833" LastActivityDate="2016-03-17T15:34:19.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21030" PostTypeId="1" AcceptedAnswerId="21031" CreationDate="2016-03-17T16:05:31.567" Score="1" ViewCount="495" Body="&lt;p&gt;A friend sent me an email with a JPEG photo in the middle of the text. The picture is so big, most of it is outside the screen and I want to view it with an outside image viewer and not in Gnus. How do I save an image that is included in the email in Gnus, if it's not just an ordinary attachment?&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-03-17T16:05:31.567" Title="How to extract an image from an email in Gnus?" Tags="|gnus|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21031" PostTypeId="2" ParentId="21030" CreationDate="2016-03-17T16:05:31.567" Score="2" Body="&lt;p&gt;The command you need is &lt;a href=&quot;http://gnus.org/manual/gnus_49.html#index-X-m-_0028Summary_0029&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-summary-save-parts&lt;/code&gt;&lt;/a&gt;. You have an &lt;em&gt;inline&lt;/em&gt; image, which implies that you received an HTML mail. An inline image is an instance of a so-called &lt;a href=&quot;https://en.wikipedia.org/wiki/MIME&quot; rel=&quot;nofollow&quot;&gt;MIME&lt;/a&gt; part, where MIME is an Internet standard governing email-related things such as non-text attachments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To read more on how to work with MIME parts in Gnus, read Gnus manual chapters &lt;a href=&quot;http://gnus.org/manual/gnus_49.html#MIME-Commands&quot; rel=&quot;nofollow&quot;&gt;3.19 MIME Commands&lt;/a&gt;, &lt;a href=&quot;http://gnus.org/manual/gnus_65.html#Using-MIME&quot; rel=&quot;nofollow&quot;&gt;4.2 Using MIME&lt;/a&gt;, and also EmacsWiki page &lt;a href=&quot;https://www.emacswiki.org/emacs/MimeTypesWithGnus&quot; rel=&quot;nofollow&quot;&gt;Mime Types With Gnus&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-03-17T16:05:31.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21032" PostTypeId="1" AcceptedAnswerId="22450" CreationDate="2016-03-17T16:39:19.757" Score="4" ViewCount="292" Body="&lt;p&gt;I'm using a small script like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;for d in $HOME/Repository/* ; do&#xA;   if [[ -n &quot;$(git -C $d status -s)&quot; ]] ; then &#xA;        emacsclient --eval &quot;(magit-status $d)&quot; &#xA;   fi&#xA;done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to open repositories that need intervention. But I would like to see this info in a buffer in Emacs, preferably a summary of multiple repositories to show which files need merge/commit along with incoming/outgoing info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a package/configuration for this? &lt;/p&gt;&#xA;" OwnerUserId="2569" LastEditorUserId="2569" LastEditDate="2016-03-17T20:55:46.760" LastActivityDate="2016-05-23T12:04:13.533" Title="Is there a way to view summaries of multiple repositories" Tags="|magit|git|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21033" PostTypeId="2" ParentId="17246" CreationDate="2016-03-17T18:50:53.217" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://emacs.stackexchange.com/a/17364/93&quot;&gt;answer by legends2k&lt;/a&gt; is correct.  However, if you want to fix the issue without having to modify your local emacs installation, you can also work around the issue by adding the following lines to your personal .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;cc-mode&quot;&#xA;  (progn&#xA;    (require 'cc-mode)&#xA;    (put 'c-electric-paren 'delete-selection nil)&#xA;    (put 'c-electric-brace 'delete-selection nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-18T05:18:08.743" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21034" PostTypeId="1" AcceptedAnswerId="21061" CreationDate="2016-03-17T18:57:56.170" Score="23" ViewCount="3990" Body="&lt;p&gt;The Emacs Lisp Reference Manual's &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html&quot; rel=&quot;noreferrer&quot;&gt;Appendix D.7&lt;/a&gt; mentions some comment tips:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Single semicolons (&lt;code&gt;;&lt;/code&gt;) should be used for inline comments.&lt;/li&gt;&#xA;&lt;li&gt;Double semicolons (&lt;code&gt;;;&lt;/code&gt;) should be used for line comments.&lt;/li&gt;&#xA;&lt;li&gt;Triple semicolons (&lt;code&gt;;;;&lt;/code&gt;) should be used for &quot;comments which should be considered a heading by Outline minor mode&quot;.&lt;/li&gt;&#xA;&lt;li&gt;Quadruple semicolons (&lt;code&gt;;;;;&lt;/code&gt;) should be used for headings of major sections of a program.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The single and double semicolon use cases are clear, but there does not seem to be a sharp delineation between triple and quadruple semicolons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, the standard documentation for Emacs packages provided by &lt;code&gt;auto-insert&lt;/code&gt; uses triple semicolons, never quadruple semicolons, even for the highest-level headings like file name and major sections. See example below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; test.el --- A test file.                         -*- lexical-binding: t; -*-&#xA;&#xA;;; Copyright (C) 2016&#xA;&#xA;;; Author:  John Smith&#xA;;; Keywords: &#xA;&#xA;;; This program is free software; you can redistribute it and/or modify&#xA;;; it under the terms of the GNU General Public License as published by&#xA;;; the Free Software Foundation, either version 3 of the License, or&#xA;;; (at your option) any later version.&#xA;&#xA;;; This program is distributed in the hope that it will be useful,&#xA;;; but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&#xA;;; GNU General Public License for more details.&#xA;&#xA;;; You should have received a copy of the GNU General Public License&#xA;;; along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&#xA;&#xA;;;; Commentary:&#xA;&#xA;;; &#xA;&#xA;;;; Code:&#xA;&#xA;&#xA;&#xA;(provide 'test)&#xA;;;; test.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What are the best practices for triple and quadruple semicolons?    &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/a/21061/10269&quot;&gt;Stefan's answer&lt;/a&gt;, I have filed a bug report and made the following suggestion:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I suggest that the description for three semicolons be changed to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Comments that start with three semicolons, ‘;;;’, are considered&#xA;top-level headings by Outline minor mode.&#xA;&#xA;Four or more semicolons can be used as subheadings in hierarchical&#xA;fashion. E.g.&#xA;&#xA;;;; Main heading&#xA;;;;; Sub heading&#xA;;;;;; Sub sub heading&#xA;;;;; Another sub heading&#xA;;;; Next main heading&#xA;&#xA;These comments should be used to break Emacs Lisp code into sections.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;A link to &quot;Outline minor mode&quot; in the Emacs manual would be useful:&#xA;  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Mode.html&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The section for four semicolons can be elided.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-03-19T03:53:29.920" Title="Emacs Lisp comment conventions" Tags="|elisp|comment|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21035" PostTypeId="2" ParentId="21015" CreationDate="2016-03-17T19:04:31.380" Score="7" Body="&lt;p&gt;From my experience reading, debugging and modifying my and others' Elisp code I'd suggest to avoid macros as much as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious thing about macros is that they don't evaluate their arguments. Which means that if you have a complex expression wrapped in a macro, you have no idea if it will be evaluated or not, and in which context, unless you look up the macro definition. This might be not a big deal for yourself, since you know the definition of your own macro (currently, probably not a few years later).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This disadvantage doesn't apply to functions: all args are evaluated before the function call. Which means you can build up the eval complexity in an unknown debugging situation.  You can even straight up skip the definitions of the functions unknown to you, as long as they return straightforward data, and you assume that they don't touch the global state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reword it in another way, macros become the part of the language. If you're reading a code with unknown macros, you're almost reading a code in a language that you don't know.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Exceptions to the above reservations:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The standard macros like &lt;code&gt;push&lt;/code&gt;, &lt;code&gt;pop&lt;/code&gt;, &lt;code&gt;dolist&lt;/code&gt; do really a lot for you, and are known to other programmers. They're basically part of the language spec. But it's practically impossible to standardize your own macro. Not only it's hard to come up with something simple and useful like the above examples, but even harder is to convince every programmer to learn it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I don't mind macros like &lt;code&gt;save-selected-window&lt;/code&gt;: they store and restore state and evaluate their args the same way &lt;code&gt;progn&lt;/code&gt; does. Pretty straightforward, actually makes code simpler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example of OK macros can be stuff like &lt;code&gt;defhydra&lt;/code&gt; or &lt;code&gt;use-package&lt;/code&gt;. These macros basically come with their own mini-language.  And they still either treat simple data, or act like &lt;code&gt;progn&lt;/code&gt;.  Plus they're usually at top level, so there are no variables on the call stack for the macro arguments to depend on, making it a bit simpler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of a bad macro, in my opinion, is &lt;code&gt;magit-section-action&lt;/code&gt; and &lt;code&gt;magit-section-case&lt;/code&gt; in Magit. The first one was already removed, but the second still remains.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-03-17T19:04:31.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21037" PostTypeId="2" ParentId="21015" CreationDate="2016-03-17T20:17:10.917" Score="5" Body="&lt;p&gt;I'll be blunt: I don't understand what &quot;use for syntax, not for semantics&quot; means.  This is why part of this answer will deal with &lt;a href=&quot;https://emacs.stackexchange.com/users/227/lunaryorn&quot;&gt;lunaryon&lt;/a&gt;'s answer, and the other part will be my attempt at answering the original question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the word &quot;semantics&quot; used in programming, it refers to the way the author of the language chose to interpret their language.  This typically boils down to a set of formulas which transform grammar rules of the language into some other rules the reader is assumed to be familiar with.  For example, Plotkin in his book &lt;a href=&quot;http://homepages.inf.ed.ac.uk/gdp/publications/sos_jlap.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Structural Approach to Operational Semantics&lt;/a&gt; uses logical derivation language to explain what abstract syntax evaluates to (what does it mean to run a program).  In other words, if syntax is what constitutes the programming language on some level, then it has to have some semantics, otherwise it's, well... not a programming language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, let's for the moment forget the formal definitions, after all, it's important to understand the intention.  So, it seems like lunaryon would encourage his readers to use macros when no new meaning is to be added to the program, but just some sort of abbreviation.  To me this sounds strange and in stark contrast to how macros are actually used.  Below are examples which clearly create new meanings:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;defun&lt;/code&gt; and friends, which are an essential part of the language cannot be described in the same terms you would describe function calls.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;setf&lt;/code&gt; the rules describing how functions work are inadequate to describe the effects of an expression like &lt;code&gt;(setf (aref x y) z)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;with-output-to-string&lt;/code&gt; also changes the semantics of the code inside the macro.  Similarly, &lt;code&gt;with-current-buffer&lt;/code&gt; and a bunch of other &lt;code&gt;with-&lt;/code&gt; macros.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;dotimes&lt;/code&gt; and similar cannot be described in terms of functions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;ignore-errors&lt;/code&gt; changes the semantics of the code it wraps.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There's a whole bunch of macros defined in &lt;code&gt;cl-lib&lt;/code&gt; package, &lt;code&gt;eieio&lt;/code&gt; package and some other almost ubiquitous libraries used in Emacs Lisp which, while may look like function forms have different interpretations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So, if anything, macros are the tool to introduce new semantics into a language.  I cannot think of an alternative way of doing that (at least not in Emacs Lisp).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When I wouldn't use macros:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When they don't introduce any new constructs, with new semantics (i.e. the function would do the job just as good).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When this is just a sort of convenience (i.e. creating a macro named &lt;code&gt;mvb&lt;/code&gt; which expands into &lt;code&gt;cl-multiple-value-bind&lt;/code&gt; just to make it shorter).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When I expect a lot of error handling code to be hidden by the macro (as has been noted, macros are difficult to debug).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When I would strongly prefer macros over functions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When domain-specific concepts are obscured by function calls.  For example, if one needs to pass the same &lt;code&gt;context&lt;/code&gt; argument to a bunch of functions that need to be called in succession, I would prefer to wrap them in a macro, where the &lt;code&gt;context&lt;/code&gt; argument is hidden.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When generic code in function form is overly verbose (bare iteration constructs in Emacs Lisp are too verbose to my taste and needlessly expose the programmer to the low-level implementation details).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Illustration&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Below is the watered down version intended to give one an intuition as to what is meant by semantics in computer science.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have an extremely simple programming language with just these syntax rules:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;variable := 1 | 0&#xA;operation := +&#xA;expression := variable | (expression operation expression)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with this language we can construct &quot;programs&quot; like &lt;code&gt;(1+0)+1&lt;/code&gt; or &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;((0+0))&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But as long as we didn't provide semantic rules, these &quot;programs&quot; are meaningless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we now equip our language with the (semantic) rules:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0+0  0+1  1+0  1+1  (exp)&#xA;---, ---, ---, ---, -----&#xA; 0   1+0   1    0    exp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we can actually compute using this language.  That is, we can take the syntactical representation, understand it abstractly (in other words, convert it into abstract syntax), then use semantic rules to manipulate this representation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we talk about Lisp family of languages, the basic semantic rules of function evaluation are roughly those of lambda-calculus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(f x)  (lambda x y)   x&#xA;-----, ------------, ---&#xA; fx        ^x.y       x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Quoting and macro-expansion mechanisms are also known as meta-programming tools, i.e. they allow one to talk &lt;em&gt;about&lt;/em&gt; the program, instead of just programming.  They achieve this by creating new semantics using the &quot;meta layer&quot;.  The example of such a simple macro is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(a . b)&#xA;-------&#xA;(cons a b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is not actually a macro in Emacs Lisp, but it could have been.  I chose only for simplicity sake.  Notice that none of the semantic rules defined above would apply to this case since the closest candidate &lt;code&gt;(f x)&lt;/code&gt; interprets &lt;code&gt;f&lt;/code&gt; as a function, while &lt;code&gt;a&lt;/code&gt; isn't necessarily a function.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-17T22:29:54.447" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21038" PostTypeId="1" CreationDate="2016-03-17T20:35:06.957" Score="6" ViewCount="3043" Body="&lt;p&gt;I am trying &lt;code&gt;mu4u&lt;/code&gt; for Gmail and an Exchange account. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Mail directory shortcuts&#xA;  (setq mu4e-maildir-shortcuts&#xA;        '((&quot;/Gmail/INBOX&quot; . ?g)&#xA;          (&quot;/Exchange/INBOX&quot; . ?a)))&#xA;&#xA;;;; Bookmarks&#xA;  (setq mu4e-bookmarks&#xA;        `((&quot;flag:unread AND NOT flag:trashed AND NOT (maildir:/[Gmail].Trash OR maildir:/Trash)&quot; &quot;Unread messages&quot; ?u)&#xA;          (&quot;date:today..now&quot; &quot;Today's messages&quot; ?t)&#xA;          (&quot;date:7d..now&quot; &quot;Last 7 days&quot; ?w)&#xA;          (&quot;mime:image/*&quot; &quot;Messages with images&quot; ?p)&#xA;          (,(mapconcat 'identity&#xA;                       (mapcar&#xA;                        (lambda (maildir)&#xA;                          (concat &quot;maildir:&quot; (car maildir)))&#xA;                        mu4e-maildir-shortcuts) &quot; OR &quot;)&#xA;           &quot;All inboxes&quot; ?i)))&#xA;&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On &lt;code&gt;mu4e&lt;/code&gt; main view, hitting &lt;code&gt;bu&lt;/code&gt; brings me unread email from all over places including Trash folders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I change it so that I don't see messages that are trashed in Trash folders or marked spam?&lt;/p&gt;&#xA;" OwnerUserId="8937" LastActivityDate="2017-10-28T20:23:18.843" Title="mu4e bookmarks: how to hide messages for folders like Trash and Spam?" Tags="|mu4e|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21039" PostTypeId="2" ParentId="20982" CreationDate="2016-03-17T21:01:55.257" Score="2" Body="&lt;p&gt;In my emacs and ess, I just typed &quot;&amp;lt;&quot; then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;=&#xA;@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;comes out automatically.&lt;/p&gt;&#xA;" OwnerUserId="9745" LastActivityDate="2016-03-17T21:01:55.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21041" PostTypeId="1" AcceptedAnswerId="21070" CreationDate="2016-03-17T21:56:50.207" Score="1" ViewCount="3024" Body="&lt;p&gt;How can I programmatically convert a Windows OS path containing spaces to one without spaces that uses the &lt;em&gt;tilde&lt;/em&gt; format?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BEFORE:   &lt;code&gt;c:/Documents and Settings/Administrator/Desktop&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AFTER:   &lt;code&gt;&quot;c:/docume~1/admini~1/desktop&quot;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="25" LastEditDate="2016-03-18T20:33:31.780" LastActivityDate="2016-03-18T20:33:31.780" Title="Convert a MS Windows path to short filename / 8.3 filename / SFN" Tags="|microsoft-windows|path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21042" PostTypeId="1" AcceptedAnswerId="21046" CreationDate="2016-03-17T22:14:05.093" Score="13" ViewCount="6523" Body="&lt;p&gt;I am trying to disable a minor mode (flycheck) for the latex major mode. This is what I have so far.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun disable-flycheck-in-tex-src-block ()&#xA;  (flycheck-mode -1))&#xA;&#xA;(add-hook 'latex-mode-hook 'disable-flycheck-in-tex-src-block)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, after I put this into my init.el, flycheck is still enabled when I open a .tex file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Steve Purcell's emacs configuration here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/purcell/emacs.d&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/purcell/emacs.d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have added the disable code into &lt;code&gt;lisp/init-local.el&lt;/code&gt;, which I thought runs after all the default configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the init.el, there is a &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'init-flycheck)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then there is a file called &lt;code&gt;lisp/init-flycheck.el&lt;/code&gt;, that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (maybe-require-package 'flycheck)&#xA;  (add-hook 'after-init-hook 'global-flycheck-mode)&#xA;&#xA;  ;; Override default flycheck triggers&#xA;  (setq flycheck-check-syntax-automatically '(save idle-change mode-enabled)&#xA;        flycheck-idle-change-delay 0.8)&#xA;&#xA;  (setq flycheck-display-errors-function #'flycheck-display-error-messages-unless-error-list))&#xA;&#xA;&#xA;(provide 'init-flycheck)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6584" LastEditorUserId="6584" LastEditDate="2016-03-18T01:13:42.080" LastActivityDate="2016-03-19T14:47:56.477" Title="Disable Minor Mode in Major Mode" Tags="|flycheck|minor-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21043" PostTypeId="2" ParentId="21042" CreationDate="2016-03-17T22:28:06.223" Score="2" Body="&#xA;&#xA;&lt;p&gt;The variables are CaSe-SeNsItIvE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook #'disable-flycheck-in-tex-src-block)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I figured out that exact hook name by doing &lt;code&gt;C-h v&lt;/code&gt; followed by checking what was available.. &lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-03-17T22:28:06.223" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21044" PostTypeId="2" ParentId="21007" CreationDate="2016-03-17T22:38:14.733" Score="2" Body="&lt;p&gt;Scheduled tasks can have repeaters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Write paper&#xA;  SCHEDULED: &amp;lt;2016-03-17 18:00 +2d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this example, &quot;Write paper&quot; will appear on the agenda every 2 days.  Each time it appears, you do it and mark it as &lt;code&gt;DONE&lt;/code&gt;.  The schedule will then advance by 2 days, hiding the completed task from today's agenda.  This only works, of course, if you work on it periodically.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-03-17T22:38:14.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21045" PostTypeId="1" AcceptedAnswerId="21141" CreationDate="2016-03-18T00:23:43.837" Score="1" ViewCount="663" Body="&lt;p&gt;All the documentation I can find says this should be returning the index of the first of the three x's but instead it returns nil:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;x\{3\}&quot; &quot;string with 3 x's repeating: xxx&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aiigE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aiigE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;update: I had to escape the backslashes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;x\\{3\\}&quot; &quot;string with 3 x's repeating: xxx&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11436" LastEditorUserId="11436" LastEditDate="2016-03-18T01:46:06.460" LastActivityDate="2016-03-21T20:54:28.300" Title="Regex Quantifier not working in string-match" Tags="|regular-expressions|string|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21046" PostTypeId="2" ParentId="21042" CreationDate="2016-03-18T01:49:33.120" Score="12" Body="&lt;p&gt;As per comments, this is because you're using a globalized minor mode: &lt;a href=&quot;https://stackoverflow.com/questions/6837511/automatically-disable-a-global-minor-mode-for-a-specific-major-mode&quot;&gt;https://stackoverflow.com/questions/6837511/automatically-disable-a-global-minor-mode-for-a-specific-major-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;global-flycheck-mode&lt;/code&gt; led me to&lt;br&gt;&#xA;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;flycheck-may-enable-mode&lt;/code&gt; and&lt;br&gt;&#xA;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;flycheck-global-modes&lt;/code&gt; which tells me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;flycheck-global-modes is a variable defined in `flycheck.el'.&#xA;Its value is t&#xA;&#xA;  This variable may be risky if used as a file-local variable.&#xA;&#xA;Documentation:&#xA;Modes for which `flycheck-mode' is turned on by `global-flycheck-mode'.&#xA;&#xA;If t, Flycheck Mode is turned on for all major modes.  If a list,&#xA;Flycheck Mode is turned on for all `major-mode' symbols in that&#xA;list.  If the `car' of the list is `not', Flycheck Mode is turned&#xA;on for all `major-mode' symbols _not_ in that list.  If nil,&#xA;Flycheck Mode is never turned on by `global-flycheck-mode'.&#xA;&#xA;Note that Flycheck is never turned on for modes whose&#xA;`mode-class' property is `special' (see Info node `(elisp)Major&#xA;Mode Conventions'), regardless of the value of this option.&#xA;&#xA;You can customize this variable.&#xA;&#xA;This variable was introduced, or its default value was changed, in&#xA;version 0.23 of the flycheck package.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So while it's not too flexible, if your current value is &lt;code&gt;t&lt;/code&gt; then the following is what you need to exclude only these specific modes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq flycheck-global-modes '(not LaTeX-mode latex-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-03-19T14:47:56.477" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21047" PostTypeId="1" AcceptedAnswerId="21056" CreationDate="2016-03-18T04:39:59.983" Score="6" ViewCount="1895" Body="&lt;p&gt;I am creating a document by exporting a specific heading via &lt;code&gt;C-c C-e C-s&lt;/code&gt;. I want to specify a title for that exported doc (which is not the text of the heading). I also want to be able to export a parent heading or the whole doc, and in that case I just want the heading to be what it would be without setting a title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I do this somehow, perhaps by setting a particular property?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2016-04-17T21:44:51.677" Title="How can I change the title for the export of a heading in org mode?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21048" PostTypeId="1" AcceptedAnswerId="21058" CreationDate="2016-03-18T05:58:51.250" Score="3" ViewCount="888" Body="&lt;p&gt;I'm writing a Lilypond typesetting tutorial in Org to be published on a web page. I would like to exclude the line with &lt;em&gt;set-default-paper-size&lt;/em&gt; from html export, cause it doesn't belong to the tutorial but is needed to shrink the size of the resulting png. How could this be done?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src lilypond :file c-major.png :exports both&#xA;#(set-default-paper-size &quot;a9&quot; 'landscape) % How to exclude this line from export???&#xA;&#xA;{ c d e f g a b c }&#xA;#+end_src&#xA;#+results:&#xA;[[file:c-major.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An alternative would be if babel could invoke lilypond with the -e option when evaluating the code block. Any other ideas how to hide specific code lines are appreciated as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;The following solution works fine for a single code block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src lilypond :file c-major.png :exports both :prologue &quot;#(set-default-paper-size \&quot;a8landscape\&quot;)&quot;&#xA;{ c d e f g a b c }&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All I have to do is to escape the double quotes. Now I try the same for a default setting in .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-babel-default-header-args:lilypond&#xA;             '((:prologue . &quot;#(set-default-paper-size \&quot;a8landscape\&quot;)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the following error message is thrown:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-babel-exp process lilypond at line 38...&#xA;Wrong type argument: stringp, (:prologue . &quot;#(set-default-paper-size \&quot;a8landscape\&quot;)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the full backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function stringp\?)&#xA;  (stringp\? &quot;#(set-default-paper-size \&quot;a8landscape\&quot;)&quot;)&#xA;  eval((stringp\? &quot;#(set-default-paper-size \&quot;a8landscape\&quot;)&quot;) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11403" LastEditorUserId="11403" LastEditDate="2016-03-19T18:25:37.870" LastActivityDate="2016-03-19T18:25:37.870" Title="Org-Mode: Exclude specific code line from html export" Tags="|org-export|org-babel|html|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21049" PostTypeId="1" AcceptedAnswerId="21052" CreationDate="2016-03-18T09:19:12.080" Score="1" ViewCount="311" Body="&lt;p&gt;I need to compare from time to time the contents (source code) of a remote directory with a local one.  And I would like to mark for hiding those files/subdirs that are identical (that is, use the &lt;code&gt;=h&lt;/code&gt; command).  But in the list of diff sessions, the remote files are marked as &lt;code&gt;*remote file*&lt;/code&gt; instead of appearing the time stamp, and &lt;code&gt;=h&lt;/code&gt; does simply nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a hack in the web, to try to handle this situation (in fact, to handle tramp and ediff interaction).  The code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ediff-listable-file (file-name)&#xA;  (let ((handler (find-file-name-handler file-name 'file-local-copy)))&#xA;    (or (null handler) (eq handler 'dired-handler-fn) (eq handler 'tramp-file-name-handler))))&#xA;&#xA;(defun ediff-same-file-contents (f1 f2)&#xA;  &quot;Return t if files F1 and F2 have identical contents.&quot;&#xA;  (if (and (not (file-directory-p f1))&#xA;           (not (file-directory-p f2)))&#xA;      (let ((res&#xA;         (apply 'call-process ediff-cmp-program nil nil nil&#xA;            (append ediff-cmp-options&#xA;                            (list (if (tramp-tramp-file-p f1)&#xA;                                      (tramp-handle-file-local-copy f1)&#xA;                                    f1)&#xA;                                  (if (tramp-tramp-file-p f2)&#xA;                                      (tramp-handle-file-local-copy f2)&#xA;                                    f2))))))&#xA;    (and (numberp res) (eq res 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with this code is that with command &lt;code&gt;=h&lt;/code&gt; I get now the error message &lt;code&gt;Symbol's function definition is void: tramp-handle-file-local-copy&lt;/code&gt;, meaning that the mentioned function is not existing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anybody please help me with this?  I'm using &lt;strong&gt;GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)&lt;/strong&gt; (with &lt;strong&gt;Prelude&lt;/strong&gt; Emacs configuration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As pointed out by the selected answer contributor, the problem is the &lt;strong&gt;Prelude&lt;/strong&gt; environment.  I have tried to find out were to touch without generating a disaster, and I found that &lt;strong&gt;Projectile&lt;/strong&gt; might be the problem.  But, after updating the &lt;strong&gt;Prelude&lt;/strong&gt; configuration system (with a simple &lt;code&gt;git update&lt;/code&gt; in &lt;code&gt;.emacs.d&lt;/code&gt;), everything seems to work nicely, including the &lt;code&gt;ediff-directories&lt;/code&gt; and the &lt;code&gt;=h&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry, I shoud have tried that first!&lt;/p&gt;&#xA;" OwnerUserId="11089" LastEditorUserId="105" LastEditDate="2016-03-18T14:34:00.743" LastActivityDate="2016-03-18T14:34:00.743" Title="Ediff directories with remote path (and Prelude?)" Tags="|tramp|ediff|remote|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21050" PostTypeId="1" CreationDate="2016-03-18T10:04:08.813" Score="4" ViewCount="205" Body="&lt;p&gt;I want to find the IP addresses of all network interfaces in an elisp program.  I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (mapcar&#xA;   (lambda (if)&#xA;     (cons (car if) (network-interface-info (car if))))&#xA;   (network-interface-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when a network interface has both an IPv4 and an IPv6 address, the above only lists the IPv4 address.  Is there a way to access the IPv6 address from elisp? (I'd rather avoid parsing the output of &lt;code&gt;ifconfig&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="105" LastEditDate="2016-06-22T20:05:29.797" LastActivityDate="2016-06-22T20:05:29.797" Title="Find IPv6 address of network interface" Tags="|networking|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21052" PostTypeId="2" ParentId="21049" CreationDate="2016-03-18T11:20:16.827" Score="0" Body="&lt;p&gt;Strange. I can compare two directories (local and remote), after starting &lt;code&gt;emacs -Q&lt;/code&gt;. In the ediff buffer it shows me &lt;code&gt;*remote file*&lt;/code&gt;, but it shows all files also which can be hidden after calling &lt;code&gt;=h&lt;/code&gt;. Btw, I call usually &lt;code&gt;=hx&lt;/code&gt;, in order to hide the superfluous files immediately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe your environment is in the way? Have you tried it with &lt;code&gt;emacs -Q&lt;/code&gt;? My Emacs version is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.16.6)  of&#xA;  2015-09-17 on lgw01-52, modified by Debian&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-18T11:20:16.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21053" PostTypeId="1" AcceptedAnswerId="21299" CreationDate="2016-03-18T13:01:30.390" Score="1" ViewCount="768" Body="&lt;p&gt;I would like to toggle input method in emacs with OS key binding, i.e. &lt;code&gt;ctrl-shift&lt;/code&gt;, so it behaves like a normal desktop application. In other words I want to rebind &lt;code&gt;C-\&lt;/code&gt; to just &lt;code&gt;C-S&lt;/code&gt; without any extra keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My keypoints are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I am on Linux&lt;/li&gt;&#xA;&lt;li&gt;I want all key bindings to work regardless of current language, including &lt;code&gt;evil&lt;/code&gt;-ones.&lt;/li&gt;&#xA;&lt;li&gt;Switching languages should be done on key release (&lt;code&gt;C-S-%&lt;/code&gt; should not switch language)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I tried to write XKB-interceptor on C, which is listens &lt;a href=&quot;http://www.x.org/releases/X11R7.6/doc/libX11/specs/XKB/xkblib.html#actions_for_generating_messages&quot; rel=&quot;nofollow&quot;&gt;XkbActionMessages&lt;/a&gt;&#xA;and sends it back to emacs. It works, but due to &lt;a href=&quot;https://bugs.freedesktop.org/show_bug.cgi?id=865&quot; rel=&quot;nofollow&quot;&gt;XKB Bug 865&lt;/a&gt; it switches&#xA;languages on key press, not release. So it messes with &lt;code&gt;C-S-x&lt;/code&gt; key bindings.&#xA;There is a patch to workaround this bug, but it not covers &lt;code&gt;XkbActionMessages&lt;/code&gt;&#xA;message. Extending that patch is too much for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe there is easier way to accomplish my goal?&lt;/p&gt;&#xA;" OwnerUserId="10958" LastEditorUserId="10958" LastEditDate="2016-03-18T15:48:34.063" LastActivityDate="2017-03-26T05:13:28.157" Title="How to toggle input methods with just ctrl-shift?" Tags="|key-bindings|linux|input-method|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21055" PostTypeId="2" ParentId="21011" CreationDate="2016-03-18T14:29:45.667" Score="2" Body="&lt;p&gt;Turn off &lt;code&gt;ido-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ido takes over the minibuffer, imposing its own, radically different key bindings and behavior.  Ido is not compatible with Icicles or with the vanilla Emacs minibuffer key bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Ido_and_IswitchB&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for the relation between Ido and Icicles and how to get more Ido-like behavior using Icicles, if you like Ido behavior.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-18T14:29:45.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21056" PostTypeId="2" ParentId="21047" CreationDate="2016-03-18T14:54:50.770" Score="9" Body="&lt;p&gt;I think you can use an &lt;code&gt;:EXPORT_TITLE:&lt;/code&gt; property as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; * Heading to be exported with C-c C-e C-s...&#xA;   :PROPERTIES:&#xA;   :EXPORT_TITLE: Title of the document when subtree is exported &#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some other properties can be useful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:EXPORT_DATE:&lt;/code&gt; &lt;code&gt;:EXPORT_AUTHOR:&lt;/code&gt; &lt;code&gt;:EXPORT_TITLE:&lt;/code&gt; &lt;code&gt;:EXPORT_OPTIONS:&lt;/code&gt; &lt;code&gt;:EXPORT_FILE_NAME:&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are discussed at the end of the &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html#Export-settings&quot; rel=&quot;noreferrer&quot;&gt;Export Settings&lt;/a&gt; section of Org manual.&lt;/p&gt;&#xA;" OwnerUserId="9245" LastEditorUserId="9995" LastEditDate="2016-04-17T21:44:51.677" LastActivityDate="2016-04-17T21:44:51.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21057" PostTypeId="1" AcceptedAnswerId="21072" CreationDate="2016-03-18T14:58:33.237" Score="1" ViewCount="1775" Body="&lt;p&gt;I was given a directory of files in which I was asked to make some systematic changes. Because it was a one-off task, and because there were only a few hundred files I thought I'd use an Emacs keyboard macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My macro, in addition to making the desired changes, placed a bunch of &lt;code&gt;!&lt;/code&gt; in the buffer (since I was trying to answer a query about whether to replace an instance of pattern match with a declaration tell emacs to replace all instances, and if no instances were found it just inserted an &lt;code&gt;!&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a nice simple way of getting rid of all these &lt;code&gt;!&lt;/code&gt; using another keyboard macro and/or some simple &lt;code&gt;elisp&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="25" LastEditDate="2016-03-18T20:33:10.403" LastActivityDate="2016-03-23T00:45:01.563" Title="How to delete all instances of a character in a bunch of files?" Tags="|files|text-editing|replace|keyboard-macros|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21058" PostTypeId="2" ParentId="21048" CreationDate="2016-03-18T15:12:39.457" Score="5" Body="&lt;p&gt;Take a look at the &lt;a href=&quot;http://orgmode.org/manual/prologue.html#prologue&quot; rel=&quot;noreferrer&quot;&gt;prologue&lt;/a&gt; header argument for Babel source blocks. You can use it to prepend some text to a code block prior to execution, and, like any other header argument, it isn't included in HTML export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: prologue-example.sh&#xA;#+BEGIN_SRC sh :prologue &quot;echo yep; exit 0&quot;&#xA;echo &quot;nope&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: prologue-example.sh&#xA;: yep&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2016-03-18T15:12:39.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21059" PostTypeId="2" ParentId="21057" CreationDate="2016-03-18T15:22:01.990" Score="1" Body="&lt;p&gt;From your question, I'll assume you already can run a macro in all the files, if not, a handy trick is to create a list of files in one buffer, and create a macro that opens an item in the list and ends with the cursor at the next item.  A simple search and replace removing &lt;code&gt;!&lt;/code&gt; would leave you with the same problem, since any file without &lt;code&gt;!&lt;/code&gt; would get one inserted.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple solution is to replace &lt;code&gt;!&lt;/code&gt; with &lt;code&gt;!&lt;/code&gt;, which ensures that the character exists in every file, then run search and replace to remove it completely.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2016-03-18T15:22:01.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21060" PostTypeId="2" ParentId="21019" CreationDate="2016-03-18T15:32:50.323" Score="2" Body="&lt;p&gt;Using &lt;code&gt;completion-ignore-case&lt;/code&gt; is the way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The input match highlighting should be fixed in &lt;a href=&quot;https://github.com/company-mode/company-mode/commit/9b89556880e326ec3391cfda2a87eada101eaaae&quot; rel=&quot;nofollow&quot;&gt;9b895568&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-03-18T15:32:50.323" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21061" PostTypeId="2" ParentId="21034" CreationDate="2016-03-18T15:40:59.670" Score="17" Body="&lt;p&gt;Actually, 3-and-more semi-colons stand for headings, where the more semi-colons you put the deeper the nesting of the heading.  So it should look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Main heading&#xA;;;;; Sub heading&#xA;;;;;; Sub sub heading&#xA;;;;; Another sub heading&#xA;;;; Next main heading&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-03-18T15:40:59.670" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21062" PostTypeId="2" ParentId="21041" CreationDate="2016-03-18T15:43:34.880" Score="0" Body="&lt;p&gt;The following is a MS Windows solution that shells-out to &lt;code&gt;cmd.exe&lt;/code&gt; to make path conversion.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun convert-path-to-short-filename (path)&#xA;&quot;Convert path to a short filename aka 8.3 filename aka SFN&quot;&#xA;(interactive)&#xA;  (unless (eq system-type 'windows-nt)&#xA;    (error &quot;This function has only been tested on Windows XP SP-3.&quot;))&#xA;  (setq path (concat &quot;cmd /c for %A in (\&quot;&quot; path &quot;\&quot;) do @echo %~sA&quot;))&#xA;  (setq path (car (split-string (shell-command-to-string path) &quot;\n&quot;)))&#xA;  (setq path (replace-regexp-in-string &quot;\\\\&quot; &quot;/&quot; path))&#xA;  (setq path (replace-regexp-in-string &quot;\\\\$&quot; &quot;&quot; path)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sample usage -- &lt;strong&gt;cmd.exe&lt;/strong&gt; displays a short filename in all capital letters, but it also recognizes lowercase letters:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(convert-path-to-short-filename &quot;c:/Documents and Settings/Administrator/Desktop&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output looks like this:  &lt;code&gt;C:/DOCUME~1/ADMINI~1/Desktop&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-03-18T15:57:40.567" LastActivityDate="2016-03-18T15:57:40.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21064" PostTypeId="1" AcceptedAnswerId="21068" CreationDate="2016-03-18T17:08:59.840" Score="2" ViewCount="383" Body="&lt;p&gt;How do I extract the names for all of the keymaps in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use English layout for programming.   However I sometimes have to use a Hungarian layout, and I want preserve my keybindings in a physical form, not a symbolic one.  I find &lt;code&gt;quail&lt;/code&gt; rather uncomfortable, because it is impossible to make a perfect transition: there are more characters in the Hungarian layout than the English one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of converting the OS configured English layout characters to Hungarian inside Emacs, I want to translate all of the keymaps to the physical layout of a Hungarian keyboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully, I can write an elisp script for that.  However, what I do not know is: how do I extract all of the global, minor, and major mode keymaps from Emacs?&lt;/p&gt;&#xA;" OwnerUserId="10978" LastEditorUserId="105" LastEditDate="2016-03-18T19:23:16.227" LastActivityDate="2016-03-18T21:09:22.510" Title="Names of all the keymaps for multilanguage remapping purposes" Tags="|key-bindings|keymap|input-method|keyboard-layout|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21065" PostTypeId="2" ParentId="21064" CreationDate="2016-03-18T17:39:42.107" Score="1" Body="&lt;p&gt;Here's a function that will extract all of the keymaps from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Symbols.html&quot; rel=&quot;nofollow&quot;&gt;global &lt;code&gt;obarray&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-all-the-keymaps ()&#xA;  &quot;Return list of all the keymaps in the global obarray.&quot;&#xA;  (let (maps)&#xA;    (mapatoms (lambda (x)&#xA;                (when (keymapp x)&#xA;                  (push x maps)))&#xA;              obarray)&#xA;    maps))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's another version that uses the heuristic that any symbol ending in &lt;code&gt;...-map&lt;/code&gt; is a keymap:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun really-get-all-the-keymaps ()&#xA;  &quot;Return list of all the keymaps in the global obarray.&quot;&#xA;  (let (maps)&#xA;    (mapatoms (lambda (x)&#xA;                (when (string-match &quot;.*-map$&quot; (symbol-name x))&#xA;                  (push x maps)))&#xA;              obarray)&#xA;    maps))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just a heads-up: there's a lot of maps.  For example, running it on my machine returns 90 keymaps with the first function, and 624 with the second.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-03-18T19:14:05.963" LastActivityDate="2016-03-18T19:14:05.963" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21066" PostTypeId="1" CreationDate="2016-03-18T18:48:41.923" Score="22" ViewCount="15807" Body="&lt;p&gt;I am very new to LaTeX and exporting org-mode files to pdf. When I run the command &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt; it adds a title, author name, and date to the top of the exported pdf. Looking at the generated LaTeX, I assume that comes from the lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\author{Ethan Skinner}&#xA;\date{\today}&#xA;\title{My Title}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I export a pdf without these properties? I have tried using both the&#xA;&lt;code&gt;VISIBLE-ONLY&lt;/code&gt; and &lt;code&gt;BODY-ONLY&lt;/code&gt; arguments to &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt;, but this didn't work for me&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2024-02-17T22:26:37.993" Title="Hide \author, \date, and \title when exporting to pdf with org-latex-export-to-pdf" Tags="|org-mode|latex|pdf|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21068" PostTypeId="2" ParentId="21064" CreationDate="2016-03-18T19:35:51.160" Score="2" Body="&lt;p&gt;The question is flawed:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A keymap does &lt;em&gt;not&lt;/em&gt; necessarily have a name.  A keymap can be a &lt;em&gt;list&lt;/em&gt; - see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Format-of-Keymaps.html&quot; rel=&quot;nofollow&quot;&gt;Format of Keymaps&lt;/a&gt; - and there need not be any name associated with the list.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For those keymaps that might be said to &quot;have a name&quot;, there are two different meanings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Symbols whose &lt;code&gt;symbol-value&lt;/code&gt; is a keymap (i.e., keymap &lt;em&gt;variables&lt;/em&gt;).&#xA;For these, you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapatoms (lambda (m) (and (boundp m)  (keymapp (symbol-value m))))&#xA;          obarray)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;Symbols whose &lt;code&gt;symbol-function&lt;/code&gt; is a keymap (so the symbol itself is also a keymap).&#xA;For these you can use just &lt;code&gt;(mapatoms #'keymapp obarray)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-18T19:35:51.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21069" PostTypeId="2" ParentId="21008" CreationDate="2016-03-18T19:39:50.360" Score="1" Body="&lt;p&gt;You should return the propertized string in your &lt;code&gt;image-tooltip&lt;/code&gt; code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun image-tooltip (window object position)&#xA;  (save-excursion&#xA;    (goto-char position)&#xA;    (let ((img-file (format &quot;%s.png&quot; (thing-at-point 'word))))&#xA;       (propertize &quot;Look in the minbuffer&quot;&#xA;              'display (create-image (expand-file-name img-file))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code works fine in my Emacs(version 24.5, Arch Linux).&lt;/p&gt;&#xA;" OwnerUserId="5482" LastActivityDate="2016-03-18T19:39:50.360" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21070" PostTypeId="2" ParentId="21041" CreationDate="2016-03-18T20:04:02.997" Score="3" Body="&lt;p&gt;The Windows build of Emacs provides a function for this, &lt;code&gt;w32-short-file-name&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(w32-short-file-name &quot;C:/path with space (and parens)/&quot;) ; =&amp;gt; &quot;c:/PATHWI~1/&quot;`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w32-short-file-name is a built-in function in `C source code'.&#xA;&#xA;(w32-short-file-name FILENAME)&#xA;&#xA;Return the short file name version (8.3) of the full path of FILENAME.&#xA;If FILENAME does not exist, return nil.&#xA;All path elements in FILENAME are converted to their short names.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-03-18T20:04:02.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21071" PostTypeId="2" ParentId="21066" CreationDate="2016-03-18T20:25:00.523" Score="32" Body="&lt;p&gt;OK, thanks to @wvxvw putting me on the right track I figured it out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get rid of the author and date with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: author:nil date:nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The Org Manual says that you can also toggle title with &lt;code&gt;title:nil&lt;/code&gt; (&lt;code&gt;org-export-with-title&lt;/code&gt;). However, this option didn't get rid of the title, and I couldn't find a variable or command &lt;code&gt;org-export-with-title&lt;/code&gt;. However, from &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg01189.html&quot;&gt;this thread&lt;/a&gt; I found that I can get rid of the title simply by adding: &lt;code&gt;#+TITLE:&lt;/code&gt; and not entering a title. This does add an extra line to my document, and it seems like it would make more sense to do it in the &lt;code&gt;#+OPTIONS&lt;/code&gt;, but this will do.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-03-18T20:25:00.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21072" PostTypeId="2" ParentId="21057" CreationDate="2016-03-18T20:32:42.773" Score="7" Body="&lt;p&gt;Unless you &lt;em&gt;want&lt;/em&gt; an interactive confirmation, which you presumably don't since you're automatic the replacement of all occurrences, call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Unconditional-Replace.html#index-replace_002dstring&quot;&gt;&lt;code&gt;replace-string&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html#index-replace_002dregexp&quot;&gt;&lt;code&gt;replace-regexp&lt;/code&gt;&lt;/a&gt; instead of &lt;code&gt;query-replace-string&lt;/code&gt; or &lt;code&gt;query-replace-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you don't need a macro at all to perform the same replacement in several files. Open the directory containing the files in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html#Dired&quot;&gt;Dired&lt;/a&gt; (just use the normal way you open files, and select the directory). If there are several directories, you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-and-Find.html#Dired-and-Find&quot;&gt;&lt;code&gt;find-dired&lt;/code&gt; or one of its variants&lt;/a&gt;, or &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Subdirectories-in-Dired.html#Subdirectories-in-Dired&quot;&gt;press &lt;code&gt;i&lt;/code&gt; to insert a subdirectory&lt;/a&gt;. Mark the files where you want to perform the replacements: you can use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Marks-vs-Flags.html#index-m-_0028Dired_0029&quot;&gt;&lt;code&gt;m&lt;/code&gt;&lt;/a&gt; to mark the current file, or other commands such as &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Marks-vs-Flags.html#index-dired_002dmark_002dfiles_002dregexp&quot;&gt;&lt;code&gt;% m&lt;/code&gt;&lt;/a&gt; to mark the files based on a regular expression for their name. Then press &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Operating-on-Files.html#index-Q-_0028Dired_0029&quot;&gt;&lt;code&gt;Q&lt;/code&gt;&lt;/a&gt; to perform a regexp replacement in all the files. This is interactive, but you can press &lt;code&gt;Y&lt;/code&gt; to validate the replacement in all files.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-18T20:32:42.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21073" PostTypeId="1" CreationDate="2016-03-18T21:25:16.863" Score="1" ViewCount="75" Body="&lt;p&gt;As far as coding so far I have only used emacs for R (using ESS). Now I am trying it with js and may use it for more languages. I wonder if there are default keybindings for evaluating code? &#xA;Using ESS I mostly use C-c to send a code block and C-Ret for sending the current line. Now looking at sites regarding js, people seem to use C-x C-r for region for example.&#xA;Is it wise to adhere to a &quot;standard&quot;, or just set them up as you go?&lt;/p&gt;&#xA;" OwnerUserId="11444" LastEditorUserId="11444" LastEditDate="2016-03-19T07:53:29.097" LastActivityDate="2016-03-19T07:53:29.097" Title="Default keybindings for evaluating code?" Tags="|key-bindings|" AnswerCount="0" CommentCount="3" ClosedDate="2019-01-16T06:39:39.087" ContentLicense="CC BY-SA 3.0" />
  <row Id="21074" PostTypeId="1" CreationDate="2016-03-19T00:12:29.707" Score="0" ViewCount="553" Body="&lt;p&gt;I'm trying to create the new empty file&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Tried 'c'&lt;/li&gt;&#xA;&lt;li&gt;Tried C-x C-f&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;when I type &quot;mixins.py&quot; Find file always suggest me to open the file in other directory with the same name, so I'm forced to create the file in shell and then reload dired with 'g'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this becomes very annoying. How to fix it? I still like the ability for emacs to suggest me the path based on file name, but I also want to create empty files when needed.&lt;/p&gt;&#xA;" OwnerUserId="10547" LastActivityDate="2016-03-19T03:16:15.017" Title="cant' create file with the same name in different directory in dired" Tags="|dired|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21075" PostTypeId="2" ParentId="21074" CreationDate="2016-03-19T03:16:15.017" Score="2" Body="&lt;p&gt;It is possible that you have &lt;code&gt;ido-mode&lt;/code&gt; enabled, which would cause this problem.  You can find out by pressing &lt;code&gt;C-h c C-x C-f&lt;/code&gt; to find out what command &lt;code&gt;C-x C-f&lt;/code&gt; is bound to.  If it is bound to &lt;code&gt;ido-find-file&lt;/code&gt;, then try this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-f&lt;/code&gt;  to run ido-find-file.&lt;/li&gt;&#xA;&lt;li&gt;Type the directory where you want to create the file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-f&lt;/code&gt; to fallback to the non-ido version of &lt;code&gt;find-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Type the filename (ie mixins.py) and press enter&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-03-19T03:16:15.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21076" PostTypeId="1" AcceptedAnswerId="21122" CreationDate="2016-03-19T05:50:52.127" Score="0" ViewCount="63" Body="&lt;p&gt;In Evil mode, after I enter &lt;code&gt;visual-state&lt;/code&gt;, I can use &lt;code&gt;f&lt;/code&gt; to expand the selection by jumping to a character. Now if I've pressed &lt;code&gt;f&lt;/code&gt; after entering &lt;code&gt;visual-state&lt;/code&gt;, Emacs asks me to input a character to jump to, which I think is implemented using &lt;code&gt;read-key-sequence&lt;/code&gt;. What I want to do is to call some external process before I enter the character, so I advise the &lt;code&gt;read-key-sequence&lt;/code&gt; function(below is a simplified version):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (orig-func &amp;amp;rest args)&#xA;  (with-temp-buffer&#xA;    (call-process &quot;ls&quot; nil t))&#xA;  (apply orig-func args))&#xA;&#xA;(advice-add 'read-key-sequence :around 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I enter the &lt;code&gt;visual-state&lt;/code&gt;, press &lt;code&gt;f&lt;/code&gt;, enter the character, jump to it, and nothing is shown selected, i.e., the region is not active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I just change the parameter of &lt;code&gt;call-process&lt;/code&gt; by setting the fourth argument(&lt;code&gt;destination&lt;/code&gt;) to be &lt;code&gt;nil&lt;/code&gt;, i.e., using the following version of &lt;code&gt;foo&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (orig-func &amp;amp;rest args)&#xA;  (with-temp-buffer&#xA;    (call-process &quot;ls&quot;))&#xA;  (apply orig-func args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works fine, exactly like without adding advice to &lt;code&gt;read-key-sequence&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, is there something I did wrong, or something of &lt;code&gt;call-process&lt;/code&gt; and Evil implementation will magically change the state of the region? &lt;/p&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="105" LastEditDate="2016-06-22T20:04:55.043" LastActivityDate="2016-06-22T20:04:55.043" Title="Problem about `evil-visual-state` and advising `read-key-sequence` with `call-process`" Tags="|evil|process|advice|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21078" PostTypeId="1" AcceptedAnswerId="21079" CreationDate="2016-03-19T07:53:43.173" Score="3" ViewCount="1780" Body="&lt;p&gt;I figured the following would tell emacs to recognize files starting with &quot;Makefile&quot; and start makefile-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\`Makefile&quot; . makefile-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;\\`&lt;/code&gt; indicates the start of the string. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't work though. Can someone please explain why and how this can be fixed?&lt;/p&gt;&#xA;" OwnerUserId="11244" LastActivityDate="2016-03-19T08:41:38.643" Title="How to have emacs recognize Makefile as a prefix for makefile-mode?" Tags="|major-mode|makefile-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21079" PostTypeId="2" ParentId="21078" CreationDate="2016-03-19T08:19:31.613" Score="5" Body="&lt;p&gt;There is already an entry &lt;code&gt;(&quot;[Mm]akefile\\'&quot; . makefile-gmake-mode)&lt;/code&gt; in &lt;code&gt;auto-mode-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I figure that you actually wanted to delete the end &lt;code&gt;\\'&lt;/code&gt; of the regular expression.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The entry for &lt;code&gt;xinit&lt;/code&gt; shows how to handle the beginning of a file name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'&quot; . sh-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main aspect here is that your regular expression must match the full absolute path of the file sans backup-suffixes and remote-file identifications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I propose you use something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\(/\\|\\`\\)[Mm]akefile&quot; . makefile-gmake-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't need to care about the existing entry for makefiles since the first matching entry is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to replace the existing entry even if this is not required you can also use the following statement:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcar (assoc-string &quot;[Mm]akefile\\'&quot; auto-mode-alist) &quot;\\(/\\|\\`\\)[Mm]akefile&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if you are afraid that the default entry disappears some time in the future you can act in dependence of its existence in &lt;code&gt;auto-mode-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((existing-entry (assoc-string &quot;[Mm]akefile\\'&quot; auto-mode-alist)))&#xA;  (if existing-entry (setcar existing-entry &quot;\\(/\\|\\`\\)[Mm]akefile&quot;)&#xA;    (add-to-list 'auto-mode-alist '(&quot;\\(/\\|\\`\\)[Mm]akefile&quot; . makefile-gmake-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-03-19T08:41:38.643" LastActivityDate="2016-03-19T08:41:38.643" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21080" PostTypeId="1" CreationDate="2016-03-19T12:55:25.040" Score="3" ViewCount="939" Body="&lt;p&gt;I have been using gocode with emacs and it gives completions of functions. Is there any way to get emacs to show the documentation of those functions in a pop up too. I am using auto-complete with go-mode.&lt;/p&gt;&#xA;" OwnerUserId="11447" LastActivityDate="2016-09-17T03:57:49.310" Title="How to configure emacs to show documentation alongside completions while using gocode?" Tags="|auto-complete-mode|documentation|golang|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21081" PostTypeId="2" ParentId="18931" CreationDate="2016-03-19T14:44:02.113" Score="1" Body="&lt;p&gt;One partial fix would be to export the only the table to latex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;highlight the table -&gt; &lt;code&gt;C-e l L&lt;/code&gt; to get the org-table converted into latex. Then you can preview the latex table with &lt;code&gt;C-c-x l&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course the idea would be to do it automatically but I don't know how costly it would be. &lt;/p&gt;&#xA;" OwnerUserId="9340" LastActivityDate="2016-03-19T14:44:02.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21082" PostTypeId="1" CreationDate="2016-03-19T15:02:46.850" Score="1" ViewCount="220" Body="&lt;p&gt;I have been trying to do my resume in org-mode and export it to pdf with &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt;. I have almost gotten it just the way I want it, but for some reason whenever I try to add a hyperlink to the resume (to a github project, for example), and run the export command, I get a message in the echo area:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Process completed with errors: Runaway argument&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I go to the &lt;code&gt;Org PDF LaTeX Output&lt;/code&gt; buffer, I see a bunch of warnings like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):&#xA;(hyperref)                removing `\&amp;lt;let&amp;gt;-command' on input line 97.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There are many lines like this all from the same input line (the line with the hyperlink) but with a different &lt;code&gt;removing...&lt;/code&gt; message. I have been using org-mode and Emacs for a little while now, but I just started learning LaTeX yesterday, so the errors are a little difficult for me to debug. Any idea what is going wrong here?&lt;/p&gt;&#xA;&lt;h1&gt;Update:&lt;/h1&gt;&#xA;&lt;p&gt;Here is the line in the generated &lt;code&gt;.tex&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;\subsection{EmacsBehavior - \url{https://kivy.org/docs/api-kivy.uix.behaviors.emacs.html}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;generated from this line in the &lt;code&gt;.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;*** EmacsBehavior - https://kivy.org/docs/api-kivy.uix.behaviors.emacs.html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-19T15:42:37.817" Title="&quot;Runaway argument&quot; when running exporting to PDF with hyperlinks" Tags="|org-export|latex|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21083" PostTypeId="2" ParentId="20995" CreationDate="2016-03-19T15:24:09.310" Score="2" Body="&lt;p&gt;Calling &lt;code&gt;package-initialize&lt;/code&gt; from &lt;code&gt;.emacs&lt;/code&gt; is the right way to go. The only reason Emacs does it after the init file rather than before is to give the user the opportunity to customize or disable it in the init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid mixing up the system-wide AUCTeX installation with the ELPA package when both are present, unload &lt;code&gt;tex-site&lt;/code&gt; before initializing the package system, and load it again afterwards. This causes an unnecessary unload/load sequence if AUCTeX is installed system-wide and not as a package, but that's not a big deal.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (fboundp 'package-initialize)&#xA;  ;; If AUCTeX is both provided by the system and installed as a package, I&#xA;  ;; want to use the package version. If `tex-site' is already loaded, that&#xA;  ;; causes `auctex-autoloads' to depend on the system-provided `tex-site'. So&#xA;  ;; unload `tex-site'; I'll try to load it again later anyway. With&#xA;  ;; `tex-site' now unloaded, if a package is present, it gets to be ahead of&#xA;  ;; the system version in `load-path' and so the package is loaded.&#xA;  (if (featurep 'tex-site)&#xA;      (unload-feature 'tex-site))&#xA;  (package-initialize)&#xA;&#xA;(if (require 'tex-site nil t)&#xA;    (my-auctex-customizations)&#xA;  (my-tex-mode-customizations))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This always prefers a package installation to a non-package installation, but that's not a real problem: the package installation is a user-level installation, so it's under my control, and it would normally be the latest stable version anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are style files generated system-wide that I want to use, I might want to keep &lt;code&gt;TeX-style-global&lt;/code&gt; around from the system-wide installation.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-19T15:24:09.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21084" PostTypeId="1" CreationDate="2016-03-19T16:31:42.717" Score="10" ViewCount="324" Body="&lt;p&gt;When multiple cursors has marked multiple points in a buffer you can use &lt;code&gt;C-v&lt;/code&gt; (&lt;code&gt;mc/cycle-forward&lt;/code&gt;) to cycle through and look through all cursors while typing for all cursors.  I'm wondering how to enter different text at each cursor point while retaining the &lt;code&gt;mc/cycle-forward&lt;/code&gt; cycling behavior or working with mc as seamlessly as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A rough use case (possibly positioning #5 after #7):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;mc/mark-all-like-this&lt;/code&gt; or equivalent to create multiple cursors&lt;/li&gt;&#xA;&lt;li&gt;[usual mc interaction with all cursors]&lt;/li&gt;&#xA;&lt;li&gt;[some action to indicate interaction with a single cursor]&lt;/li&gt;&#xA;&lt;li&gt;enter text at current cursor&lt;/li&gt;&#xA;&lt;li&gt;hit &lt;code&gt;C-v&lt;/code&gt; an arbitrary number of times to select a different cursor&lt;/li&gt;&#xA;&lt;li&gt;enter text / move point of a now different current cursor&lt;/li&gt;&#xA;&lt;li&gt;[some action to restore standard mc behavior]&lt;/li&gt;&#xA;&lt;li&gt;[resume interaction with all cursors] &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I currently use &lt;code&gt;isearch-forward&lt;/code&gt; to fill in for this (for example to fill in different section headers in an html document), but this drops me out of mc and forces me to re-mark.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-03-20T15:43:52.400" LastActivityDate="2016-03-20T15:43:52.400" Title="Cycle through multiple cursors to enter different text at each point?" Tags="|multiple-cursors|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21085" PostTypeId="2" ParentId="21080" CreationDate="2016-03-19T17:10:53.110" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then you can use &lt;code&gt;C-M-RET&lt;/code&gt; (or &lt;code&gt;C-M-mouse-2&lt;/code&gt;) to see the full doc string (in &lt;code&gt;*Help*&lt;/code&gt;) of any completion candidates. You can use the arrow keys &lt;code&gt;C-M-down&lt;/code&gt; and &lt;code&gt;C-M-up&lt;/code&gt; to cycle among candidates, showing their doc the same way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the first line of the doc string is shown in the mode-line, so just cycling among candidates using &lt;code&gt;down&lt;/code&gt; etc. shows you that much, at least. (Dunno whether using &lt;code&gt;auto-complete-mode&lt;/code&gt; at the same time as Icicles is a problem or is useful.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_A_Propos_d&amp;#39;Apropos#GetHelpOnCandidates&quot; rel=&quot;nofollow&quot;&gt;Icicles - Get Help on Completion Candidates&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-19T17:10:53.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21086" PostTypeId="1" AcceptedAnswerId="21087" CreationDate="2016-03-19T17:22:09.970" Score="3" ViewCount="2274" Body="&lt;p&gt;I am trying to write a docstring that follows Google's style guide such that it looks something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def testFunction(a, b):&#xA;    &quot;&quot;&quot;&#xA;    Args:&#xA;        a (str):&#xA;        b (str):&#xA;&#xA;    Returns:&#xA;        Description of return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am doing this through a &lt;code&gt;yasnippet&lt;/code&gt; following the &lt;a href=&quot;https://emacs.stackexchange.com/questions/19422/library-for-automatically-inserting-python-docstring-in-google-style&quot;&gt;accepted answer to this question&lt;/a&gt;, and everything works except for the indentation of the &quot;return description&quot; because my &lt;code&gt;emacs&lt;/code&gt; isn't allowing an indentation beyond the first level within the docstring using &lt;code&gt;TAB&lt;/code&gt;. Using &lt;code&gt;indent&lt;/code&gt; within a &lt;code&gt;lisp&lt;/code&gt; function gives the correct indentation (under &lt;code&gt;Args:&lt;/code&gt;), but using &lt;code&gt;TAB&lt;/code&gt; within the buffer (or in the snippet) does not. As such my docstring looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def testFunction(a, b):&#xA;    &quot;&quot;&quot;&#xA;    Args:&#xA;        a (str):&#xA;        b (str):&#xA;&#xA;    Returns:&#xA;    Description of return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas to overcome the general problem of not being able to force another layer of indent within the docstring using &lt;code&gt;TAB&lt;/code&gt; in &lt;code&gt;python-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried making a barebones &lt;code&gt;init.el&lt;/code&gt; to avoid loading anything that may create this behavior but still get the same issue. I am using &lt;code&gt;emacs&lt;/code&gt; version 24.5.1, in case that provides any clues.&lt;/p&gt;&#xA;" OwnerUserId="8972" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2019-04-18T06:44:56.483" Title="Python docstrings only allow two indent levels" Tags="|indentation|python|yasnippet|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21087" PostTypeId="2" ParentId="21086" CreationDate="2016-03-19T17:45:58.053" Score="3" Body="&lt;p&gt;I had this issue for quite a while and I couldn't figure out how to change it. It didn't affect me much during my day to day work however, so I usually fixed it manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did however find a fix recently however. It is detailed here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jorgenschaefer/elpy/issues/498&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jorgenschaefer/elpy/issues/498&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I now use the &lt;code&gt;mmm-mode&lt;/code&gt;-package to make all docstrings behave as they are in &lt;code&gt;rst-mode&lt;/code&gt;. This may be overkill for the Google style, but you could use almost the same configuration but change the sub-mode to use e.g., &lt;code&gt;text-mode&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The configuration I'm using can be seen below (using &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package mmm-mode&#xA;  :ensure t&#xA;  :defer t&#xA;  :commands mmm-mode&#xA;  :init&#xA;  (add-hook 'python-mode-hook 'mmm-mode)&#xA;  :config&#xA;&#xA;  ;; Add python + rst major mode configuration.&#xA;  (defun rst-python-statement-is-docstring (begin)&#xA;    &quot;Return true if beginning of statement is BEGIN.&quot;&#xA;    (save-excursion&#xA;      (save-match-data&#xA;        (python-nav-beginning-of-statement)&#xA;        (looking-at-p begin))))&#xA;&#xA;  (defun rst-python-front-verify ()&#xA;    &quot;Verify that we're looking at a python docstring.&quot;&#xA;    (rst-python-statement-is-docstring (match-string 0)))&#xA;&#xA;  (setq mmm-parse-when-idle 't)&#xA;  (add-to-list 'mmm-save-local-variables 'adaptive-fill-regexp)&#xA;  (add-to-list 'mmm-save-local-variables 'fill-paragraph-function)&#xA;&#xA;  (mmm-add-classes&#xA;   '((rst-python-docstrings&#xA;      :submode rst-mode&#xA;      :face mmm-comment-submode-face&#xA;      :front &quot;u?\\(\&quot;\&quot;\&quot;\\|\'\'\'\\)&quot;&#xA;      :front-verify rst-python-front-verify&#xA;      :back &quot;~1&quot;&#xA;      :end-not-begin t&#xA;      :save-matches 1&#xA;      :insert ((?d embdocstring nil @ &quot;u\&quot;\&quot;\&quot;&quot; @ _ @ &quot;\&quot;\&quot;\&quot;&quot; @))&#xA;      :delimiter-mode nil)))&#xA;&#xA;  (mmm-add-mode-ext-class 'python-mode nil 'rst-python-docstrings))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I should note that mixing major modes in this fashion is usually frowned upon (as you can read in the github thread) and it may introduce various subtle issues. Personally however, I haven't run into any issues yet.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2653" LastEditDate="2016-03-19T18:40:00.597" LastActivityDate="2016-03-19T18:40:00.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21088" PostTypeId="1" AcceptedAnswerId="21089" CreationDate="2016-03-19T20:29:40.563" Score="8" ViewCount="1047" Body="&lt;p&gt;I want to know how do you use Emacs lisp to check the content of the current buffer, specially to know if certain string exists within the current buffer.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="105" LastEditDate="2016-08-10T22:29:32.880" LastActivityDate="2016-08-10T22:29:32.880" Title="How to check if a string exists in the current buffer?" Tags="|search|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21089" PostTypeId="2" ParentId="21088" CreationDate="2016-03-19T20:45:39.820" Score="10" Body="&lt;p&gt;I think the easiest approach would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-excursion&#xA;    (goto-char (point-min))&#xA;    (search-forward string nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will return non-nil if the given string is in the current buffer.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="2526" LastEditDate="2016-03-19T20:56:31.060" LastActivityDate="2016-03-19T20:56:31.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21090" PostTypeId="1" CreationDate="2016-03-19T21:44:57.323" Score="0" ViewCount="207" Body="&lt;p&gt;I have installed GNU Go 3.8 and am trying to use it in emacs. I have downloaded &lt;code&gt;gnugo.el&lt;/code&gt; from &lt;a href=&quot;https://www.emacswiki.org/emacs/gnugo.el&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and have copied &lt;code&gt;gnugo-big-xmps.el&lt;/code&gt; from my &lt;code&gt;gnugo-3.8/interface&lt;/code&gt; directory, putting both in my &lt;code&gt;.emacs.d&lt;/code&gt;. I have the following two lines in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'gnugo &quot;gnugo&quot; &quot;GNU GO&quot; t)&#xA;(autoload 'gnugo-xpms &quot;gnugo-big-xpms&quot; &quot;GNU GO&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can use &lt;code&gt;M-x gnugo&lt;/code&gt;, and am prompted for &lt;code&gt;GNU Go options:&lt;/code&gt;, but when I press &lt;code&gt;RET&lt;/code&gt;, I get the error &lt;code&gt;Searching for program: no such file or directory, gnugo&lt;/code&gt;. I don't think that this is a problem with my installation of GNU Go, since it works fine from the command line. Can anyone help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.5.1 on OS X El Capitan, 10.11.3.&lt;/p&gt;&#xA;" OwnerUserId="8561" LastActivityDate="2016-06-18T23:40:42.610" Title="Problem with loading GNU Go mode" Tags="|init-file|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21091" PostTypeId="2" ParentId="21088" CreationDate="2016-03-19T21:58:51.510" Score="0" Body="&lt;p&gt;You can also do this on a way which probably looks familiar from other languages using &lt;a href=&quot;https://github.com/magnars/s.el#s-present-s&quot; rel=&quot;nofollow&quot;&gt;s.el&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;some_buffer&quot;&#xA;      (s-contains? &quot;some string&quot;&#xA;            (buffer-substring-no-properties (point-min) (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-03-19T21:58:51.510" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21093" PostTypeId="2" ParentId="19330" CreationDate="2016-03-20T00:38:41.593" Score="7" Body="&lt;p&gt;In my &lt;code&gt;.vimrc&lt;/code&gt; I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nnoremap &amp;lt;leader&amp;gt;v '[V']&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to do exactly this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amazingly, the sequence &lt;code&gt;'[V']&lt;/code&gt; works in &lt;code&gt;evil&lt;/code&gt; just fine. To have a shortcut in Emacs, I wrote the following function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/evil-select-pasted ()&#xA;  (interactive)&#xA;  (let ((start-marker (evil-get-marker ?\[))&#xA;        (end-marker (evil-get-marker ?\])))&#xA;        (evil-visual-select start-marker end-marker)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function can be bound to e.g. &lt;code&gt;&amp;lt;leader&amp;gt;v&lt;/code&gt; using &lt;code&gt;evil-leader&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-leader/set-key &quot;v&quot; 'my/evil-select-pasted)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm relatively new to Emacs, so this might not be ideal, but it works for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How I got there:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h k '&lt;/code&gt; shows that &lt;code&gt;'&lt;/code&gt; runs &lt;code&gt;evil-goto-mark-line&lt;/code&gt;. Looking at the source in &lt;code&gt;evil-commands.el&lt;/code&gt; shows that &lt;code&gt;evil-goto-mark-line&lt;/code&gt; uses &lt;code&gt;evil-goto-mark&lt;/code&gt;, which itself makes use of the &lt;code&gt;evil-get-marker&lt;/code&gt; function. Looking at &lt;code&gt;evil-states.el&lt;/code&gt;, found with &lt;code&gt;C-h k V&lt;/code&gt;, leads to the &lt;code&gt;evil-visual-select&lt;/code&gt; function.&lt;/p&gt;&#xA;" OwnerUserId="11449" LastEditorUserId="15748" LastEditDate="2018-02-09T18:16:14.820" LastActivityDate="2018-02-09T18:16:14.820" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21094" PostTypeId="1" AcceptedAnswerId="21102" CreationDate="2016-03-20T03:37:59.407" Score="2" ViewCount="133" Body="&lt;p&gt;In Emacs 24.5.50.1, dismissing the &lt;code&gt;calendar&lt;/code&gt; window with &lt;code&gt;calendar-exit&lt;/code&gt; works fine when there is a single window. However, when the window is split, the &lt;code&gt;calendar&lt;/code&gt; buffer disappears, but the window remains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is reproducible with &lt;code&gt;emacs -Q&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZsTfJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZsTfJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should this be considered a bug and reported?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-03-20T06:24:35.467" Title="Dismissing Calendar window" Tags="|window|calendar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21095" PostTypeId="1" AcceptedAnswerId="21098" CreationDate="2016-03-20T03:42:22.617" Score="5" ViewCount="784" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dz7Ne.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dz7Ne.png&quot; alt=&quot;A tabified file showing spaces and tabs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what &lt;code&gt;javascript-mode&lt;/code&gt; generates with standard tabbing (I never hit the space key when making it). I'd like to have the files contain no tab characters. I can't seem to find any option in the Easy Customization mode.&lt;/p&gt;&#xA;" OwnerUserId="10655" LastEditorUserId="105" LastEditDate="2016-03-20T06:09:07.637" LastActivityDate="2016-03-20T06:09:07.637" Title="How do I make javascript-mode not turn all 8 spaces into tabs?" Tags="|javascript|whitespace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21096" PostTypeId="1" CreationDate="2016-03-20T04:22:46.917" Score="1" ViewCount="258" Body="&lt;p&gt;I heard &lt;a href=&quot;https://emacs.stackexchange.com/questions/102/advantages-of-setting-variables-with-setq-instead-of-custom-el/106#106&quot;&gt;it’s better to use &lt;code&gt;Customize&lt;/code&gt; to define variables/settings instead of just some &lt;code&gt;setq&lt;/code&gt;&lt;/a&gt; inside &lt;code&gt;.emacs.d&lt;/code&gt;… because it autoloads when loading packages, because it’s more consistent, more checked/restricted, better updated, etc. I heard the only case where it could be better not to use Customize is setting programmatically variables. Like depending upon context or other variables with functions, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is it really always the case or is there even with Customize some way of doing it? Especially, is there a way to define a variable within Customize, that would depend upon another? like &lt;code&gt;org-agenda-files&lt;/code&gt; depending on &lt;code&gt;org-directory&lt;/code&gt; (&lt;code&gt;(setq org-agenda-files (concat org-directory &quot;agenda.org&quot;))&lt;/code&gt;)? Because I’d like it to being updated wether I update &lt;code&gt;org-directory&lt;/code&gt;. And I’d like for consistency being able to set everything within &lt;code&gt;setq&lt;/code&gt; or &lt;code&gt;Customize&lt;/code&gt;, and I don’t know how to do it programmatically within &lt;code&gt;Customize&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT : also, if that’s not possible, I’d like to know at least how to make &lt;code&gt;setq&lt;/code&gt; acts &lt;em&gt;after&lt;/em&gt; the definition of a variable by customize. To take again the previous example: &lt;code&gt;org-directory&lt;/code&gt; get defined only when &lt;code&gt;org&lt;/code&gt; is loaded, so I can’t define &lt;code&gt;org-agenda-files&lt;/code&gt; before in my &lt;code&gt;.emacs.d&lt;/code&gt;: what’s the proper solution? &lt;code&gt;(eval-after-load 'org […])&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11375" LastEditorUserId="11375" LastEditDate="2016-03-20T14:28:14.137" LastActivityDate="2018-02-10T12:36:11.757" Title="How to make a Customize setting depend on another? or make a `setq` depend over a Customize setting?" Tags="|customize|programming|custom|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21097" PostTypeId="1" CreationDate="2016-03-20T04:28:25.850" Score="5" ViewCount="1980" Body="&lt;p&gt;Like a lot of people I think I activated &lt;code&gt;inhibit-startup-screen&lt;/code&gt; because it’s ugly and tedious to always have your emacs horizontally split when you open a file with half taken by an useless startup screen… But I notice I find it better/more beautifull/helpfull/useful than just an unique void scratch buffer when I open Emacs without opening a file…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there a way so that this startup screen shows up only when there’s nothing else to show up? as when the scratch buffer is displayed at startup? instead of it? and not to show up if I open a file or run a command like &lt;code&gt;gnus&lt;/code&gt; or &lt;code&gt;erc&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11375" LastEditorUserId="11375" LastEditDate="2016-03-20T14:14:21.007" LastActivityDate="2016-03-20T15:19:24.657" Title="How to show startup screen instead of scratch, when no file is opened?" Tags="|start-up|programming|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21098" PostTypeId="2" ParentId="21095" CreationDate="2016-03-20T05:41:27.420" Score="7" Body="&lt;p&gt;The buffer-local &lt;code&gt;indent-tabs-mode&lt;/code&gt; variable controls this (in general, for any mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;javascript-mode&lt;/code&gt; is an &lt;em&gt;alias&lt;/em&gt; for &lt;code&gt;js-mode&lt;/code&gt;, so there isn't a &lt;code&gt;javascript-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-js-mode-hook ()&#xA;  &quot;Custom `js-mode' behaviours.&quot;&#xA;  (setq indent-tabs-mode nil))&#xA;&#xA;(add-hook 'js-mode-hook 'my-js-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-03-20T05:41:27.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21099" PostTypeId="1" AcceptedAnswerId="21100" CreationDate="2016-03-20T05:49:56.393" Score="3" ViewCount="471" Body="&lt;p&gt;I've run into a very strange issue with Org-mode 8.2.10 footnotes. Given the following text, where &lt;code&gt;|&lt;/code&gt; represents point and &lt;code&gt;[empty-line]&lt;/code&gt; represents an empty line,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;[empty-line]&lt;/p&gt;&#xA;&lt;p&gt;Foo bar baz =$= | foo bar baz&lt;/p&gt;&#xA;&lt;p&gt;[empty-line]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It is not possible to insert a footnote at point, any position on the line after point, or on the immediately following line. &lt;code&gt;Cannot insert a footnote here&lt;/code&gt; is displayed when typing&lt;code&gt;C-c C-x f&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If the &lt;code&gt;=&lt;/code&gt;'s are removed, inserting footnotes works fine.&lt;/p&gt;&#xA;&lt;p&gt;Has anyone encountered this before? I'm guessing that it has something to do with the &lt;code&gt;$&lt;/code&gt; being a &lt;a href=&quot;http://orgmode.org/manual/LaTeX-fragments.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;LaTeX operator&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-03-20T09:33:51.147" Title="Org-mode: footnotes with dollar sign" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21100" PostTypeId="2" ParentId="21099" CreationDate="2016-03-20T05:53:57.957" Score="2" Body="&lt;p&gt;It seems to work in Org Mode 8.3.4 without any problems.&lt;/p&gt;&#xA;" OwnerUserId="11452" LastActivityDate="2016-03-20T05:53:57.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21102" PostTypeId="2" ParentId="21094" CreationDate="2016-03-20T06:15:39.003" Score="3" Body="&lt;p&gt;Yes, there is a &lt;code&gt;FIXME&lt;/code&gt; comment in the code of that function for this very issue, so check and see if there's an existing bug logged for it, and if not then go ahead and report it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; FIXME: replace this cruft with the `quit-restore' window property&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: This exists as &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=11140&quot; rel=&quot;nofollow&quot;&gt;bug #11140&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=11140&quot; rel=&quot;nofollow&quot;&gt;most recent message&lt;/a&gt; suggests that the proposal has most likely been forgotten about, so you should certainly follow this up and see if you can get the change made.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-03-20T06:24:35.467" LastActivityDate="2016-03-20T06:24:35.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21103" PostTypeId="2" ParentId="19637" CreationDate="2016-03-20T08:44:59.693" Score="-1" Body="&lt;p&gt;These answers are wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should use (vc-git-registered (file)). Returns t or nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(vc-state (file)) returns state of repository. Not a state of a single file.&#xA;vc-state returns 'up-to-date on file which is not under version control but it's located in directory which us under control of GIT.&lt;/p&gt;&#xA;" OwnerUserId="11453" LastActivityDate="2016-03-20T08:44:59.693" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21104" PostTypeId="2" ParentId="21099" CreationDate="2016-03-20T09:33:51.147" Score="1" Body="&lt;p&gt;Indeed, it is discussed in this &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg00549.html&quot; rel=&quot;nofollow&quot;&gt;message&lt;/a&gt; from 2011:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For what it's worth, this not directly related to footnotes.  It's&#xA;  a weakness in `org-inside-LaTeX-fragment-p', which returns a non-nil&#xA;  value after =\begin{document}= instead of nil.  And, obviously, one&#xA;  cannot add a footnote inside a LaTeX fragment...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I didn't find any mention of this problem in the commit logs but I suspect this has been fixed by commit &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=176681bc65b5c787dc0737ccd523afd19b7ea4c0&quot; rel=&quot;nofollow&quot;&gt;176681bc65b5c787dc0737ccd523afd19b7ea4c0&lt;/a&gt; (2015-02-15) where the call to &lt;code&gt;org-footnote-in-valid-context-p&lt;/code&gt; has been replaced by one to the new function &lt;code&gt;org-footnote--allow-reference-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround before upgrading, you can temporarily add a space between $ and =, insert the footnote, then remove the space.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-03-20T09:33:51.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21105" PostTypeId="1" CreationDate="2016-03-20T09:52:17.783" Score="1" ViewCount="954" Body="&lt;p&gt;I played around with &lt;code&gt;elpy&lt;/code&gt; and after following the tutorial, it changed the emacs theme to a black background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When trying to revert this, I managed to get a white font on a white background persistently after startup :-) .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I revert all colour- and theme- settings back to the default emacs theme? I am unable to find any relevant changes in my &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the emacs 25 snapshot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used this &lt;a href=&quot;https://realpython.com/blog/python/emacs-the-best-python-editor/&quot; rel=&quot;nofollow&quot;&gt;turorial&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11454" LastEditorUserId="5213" LastEditDate="2016-04-30T09:30:24.647" LastActivityDate="2016-04-30T09:30:24.647" Title="Restore default colors (black text on a white background)" Tags="|themes|colors|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21106" PostTypeId="2" ParentId="21097" CreationDate="2016-03-20T10:35:07.103" Score="1" Body="&lt;p&gt;I did a bit of research on this and this snippet seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-after-init-hook ()&#xA;  &quot;Test.&quot;&#xA;  (print command-line-args)&#xA;  (when (= 1 (length command-line-args))&#xA;    (setq initial-buffer-choice #'gnus)))&#xA;(add-hook 'after-init-hook 'my-after-init-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not too fond of the conditional in there since that might easily break when you add different command-line arguments, but I'm afraid I couldn't find any other checks that are valid when running the &lt;code&gt;after-init-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a different initial buffer, simply change &lt;code&gt;#'gnus&lt;/code&gt; in the above snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found some other similar questions which may be of interest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/9674/customize-startup-screen-text?rq=1&quot;&gt;Customize startup screen text&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/13721/how-can-i-override-initial-buffer-choice-if-i-specify-a-filename-at-command-line?rq=1&quot;&gt;How can I override initial-buffer-choice if I specify a filename at command line?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/15081/programming-of-initial-buffer-choice?rq=1&quot;&gt;Programming of Initial-buffer-choice&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-03-20T10:35:07.103" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21108" PostTypeId="2" ParentId="21097" CreationDate="2016-03-20T15:19:24.657" Score="2" Body="&lt;p&gt;Ok, so no custom setting allow that behavior, so here a function to put in the &lt;code&gt;after-init-hook&lt;/code&gt; as proposed by Xaldew.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun maybe-splash-screen ()&#xA;  &quot;Open display-splash-screen instead of *scratch* buffer.&quot;&#xA;  (when (and (string= &quot;*scratch*&quot; (buffer-name)) (not (buffer-file-name)))&#xA;    (display-splash-screen)))&#xA;(add-hook 'after-init-hook 'maybe-splash-screen)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11375" LastActivityDate="2016-03-20T15:19:24.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21110" PostTypeId="1" AcceptedAnswerId="21402" CreationDate="2016-03-20T17:00:43.157" Score="2" ViewCount="361" Body="&lt;p&gt;Currently in Emacs Lisp files I have the following behavior when I run &lt;code&gt;evil-forward-word-begin&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|some-lisp-function&#xA;some|-lisp-function&#xA;some-|lisp-function&#xA;some-lisp|-function&#xA;some-lisp-|function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words, dash is treated as it's own word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like it to be this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|some-lisp-function&#xA;some-|lisp-function&#xA;some-lisp-|function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Under syntax table dash is listed as a symbol, so I fugired if I changed dash to &lt;code&gt;whitespace&lt;/code&gt; in the syntax table, it would be skipped:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?- &quot; &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However that accomplished nothing. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="10263" LastEditorUserId="10263" LastEditDate="2016-03-20T17:18:41.653" LastActivityDate="2017-02-28T10:33:35.020" Title="Changing evil-forward-word behavior by modifying a syntax table" Tags="|evil|syntax-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21112" PostTypeId="1" CreationDate="2016-03-20T18:29:24.887" Score="1" ViewCount="1747" Body="&lt;p&gt;After installing the required dependencies with homebrew, I was able to compile pdf-tools . But I cannot make it work (I cannot see the pdf on emacs after compiling)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if somebody can post its .emacs config to make pdf-tools work since I have not been able to make it happen. I have tried several options, like the following (copy from somebody else):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;pdf-tools&quot;) ;;&#xA;(setq output-pdf &quot;PDF Tools&quot;) ;;          &#xA;(pdf-tools-install)                                                   &#xA;(setq TeX-view-program-selection '((output-dvi &quot;Okular&quot;)              &#xA;                                   (output-pdf &quot;PDF Tools&quot;) ;;        &#xA;                                   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or also&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Use pdf-tools to open PDF files&#xA;(setq TeX-view-program-selection '((output-pdf &quot;PDF Tools&quot;))&#xA;      TeX-source-correlate-start-server t)&#xA;&#xA;;; Update PDF buffers after successful LaTeX runs&#xA;(add-hook 'TeX-after-TeX-LaTeX-command-finished-hook&#xA;           #'TeX-revert-document-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, after compiling a tex file (with C-c C-c with Auctex) and trying to see the pdf with the same command (and selecting View), I always get the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unknown PDF Tools viewer. Check the Tex-view-program-selection variable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am sure I am missing a key config for making pdf-tools available or known to auctex/emacs, but cannot figure it out. Could you please post your config to get an inspiration from it? I have already checked &lt;a href=&quot;https://emacs.stackexchange.com/questions/13314/install-pdf-tools-on-emacs-macosx/21109?noredirect=1#comment32647_21109&quot;&gt;install-pdf-tools-on-emacs-macosx&lt;/a&gt;, &lt;a href=&quot;https://emacs.stackexchange.com/questions/19472/how-to-let-auctex-open-pdf-with-pdf-tools&quot;&gt;how-to-let-auctex-open-pdf-with-pdf-tools&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/19686/how-to-use-pdf-tools-pdf-view-mode-in-emacs&quot;&gt;how-to-use-pdf-tools-pdf-view-mode-in-emacs&lt;/a&gt; without success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Making already visited links more explicit.&lt;/p&gt;&#xA;" OwnerUserId="11458" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2023-12-10T10:05:25.607" Title="Making pdf-tools work after successful compiling on mac os x" Tags="|latex|auctex|preview-latex|pdf-tools|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21113" PostTypeId="2" ParentId="20376" CreationDate="2016-03-20T19:18:39.343" Score="2" Body="&lt;p&gt;Have a look at Gnus Parameters. The one you are looking for is &lt;code&gt;gcc-self&lt;/code&gt;. I also use that to keep replies in the folder I reply from, not just the inbox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnus.org/manual/gnus_21.html#Group-Parameters&quot; rel=&quot;nofollow&quot;&gt;http://www.gnus.org/manual/gnus_21.html#Group-Parameters&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2016-03-20T19:18:39.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21114" PostTypeId="2" ParentId="20936" CreationDate="2016-03-20T19:42:36.873" Score="2" Body="&lt;p&gt;You can declare macros and environments you don't need using &lt;code&gt;TeX-declare-expert-macros&lt;/code&gt; and &lt;code&gt;LaTeX-declare-expert-environments&lt;/code&gt; and then set &lt;code&gt;TeX-complete-expert-commands&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2016-03-20T19:42:36.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21115" PostTypeId="1" AcceptedAnswerId="21121" CreationDate="2016-03-20T20:48:16.510" Score="0" ViewCount="281" Body="&lt;p&gt;This program aims to restore the guile REPL session dump (see input file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I added the while loop, ELISP stated giving me this error when the end of the file is reacher:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Scan error: &quot;Containing expression ends prematurely&quot;, 715, 716&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please tell me what the problem is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the program:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;PROGRAM&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun retore-guile-session()&#xA;  (interactive)&#xA;  (save-excursion &#xA;  (while (progn (re-search-forward &quot;scheme@(guile-user)&quot; (point-max) t))&#xA;     (append-to-buffer &quot;scratch&quot; (find-start-of-sexp)&#xA;                                 (find-end-of-sexp)))))&#xA;&#xA;&#xA;&#xA;(defun find-start-of-sexp ()&#xA;&#xA;   (re-search-forward &quot;(&quot; (point-max) t)&#xA;   (backward-char) &#xA;   (point-marker))&#xA;&#xA;&#xA;(defun find-end-of-sexp ()&#xA;  (forward-sexp)&#xA;  (point-marker))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this is the input file?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;INPUT FILE&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;GNU Guile 2.0.11&#xA;Copyright (C) 1995-2014 Free Software Foundation, Inc.&#xA;&#xA;Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.&#xA;This program is free software, and you are welcome to redistribute it&#xA;under certain conditions; type `,show c' for details.&#xA;&#xA;Enter `,help' for help.&#xA;scheme@(guile-user)&amp;gt; &#xA;scheme@(guile-user)&amp;gt; &#xA;scheme@(guile-user)&amp;gt; &#xA;scheme@(guile-user)&amp;gt; (+ 1 2)&#xA;$2 = 3&#xA;scheme@(guile-user)&amp;gt; &#xA;scheme@(guile-user)&amp;gt; &#xA;scheme@(guile-user)&amp;gt; (+1 2)&#xA;ERROR: In procedure 1:&#xA;ERROR: Wrong type to apply: 1&#xA;&#xA;Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.&#xA;scheme@(guile-user) [1]&amp;gt; &#xA;scheme@(guile-user) [1]&amp;gt; &#xA;scheme@(guile-user) [1]&amp;gt; (+ 1 2 (*&#xA;                 2 3))&#xA;$3 = 9&#xA;scheme@(guile-user) [1]&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone please tell me, why is ELISP giving me error &lt;code&gt;Scan error: &quot;Containing expression ends prematurely&quot;, 715, 716&lt;/code&gt; when the while loop reaches the end of the file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="105" LastEditDate="2016-06-22T20:04:08.807" LastActivityDate="2016-06-22T20:04:08.807" Title="Looping through re-seach-forward gives error" Tags="|search|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21116" PostTypeId="1" AcceptedAnswerId="21119" CreationDate="2016-03-20T20:57:51.853" Score="11" ViewCount="2634" Body="&lt;p&gt;I tried using &lt;a href=&quot;https://attic-backup.org&quot; rel=&quot;noreferrer&quot;&gt;attic&lt;/a&gt; with a passphrase to backup my files from inside &lt;code&gt;M-x shell&lt;/code&gt;. The shell exposed the passphrase as plain text in the buffer and made it available by typing &lt;code&gt;M-r&lt;/code&gt; as well as by looking through the shell input history with &lt;code&gt;C-c C-l&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I closed the shell and re-opened the input history, I saw that at least it disappeared. Presumably, because the shell reads it's initial history from &lt;code&gt;.bash_history&lt;/code&gt; and at least &lt;code&gt;bash&lt;/code&gt; had the good sense not to write my &lt;code&gt;passphrase&lt;/code&gt; there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I really need to leave &lt;code&gt;emacs&lt;/code&gt; to perform my &lt;code&gt;attic&lt;/code&gt; backups, or is there a way I can configure it not to be careless?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to reproduce the issue with a fresh &lt;code&gt;emacs -Q&lt;/code&gt; session. I was confused before because Emacs correctly hides the passphrase in all cases except when I call &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; attic create --stats /path/to/backup::name ~/folders ~/backed ~/up&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;attic&lt;/code&gt; prompts as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enter passphrase for /path/to/backup::name:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The issue can be reproduced with this Python one-liner:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python -c 'import getpass; getpass.getpass(&quot;Hello&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the password prompt string is &lt;code&gt;&quot;Password:&quot;&lt;/code&gt; then Emacs sees a password prompt, but not if the string is anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make Emacs recognize at least attic's password prompts?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="25" LastEditDate="2016-03-20T22:51:11.707" LastActivityDate="2016-03-20T23:35:35.843" Title="How to prevent Emacs from showing passphrase in `M-x shell`?" Tags="|shell|passwords|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21118" PostTypeId="2" ParentId="21090" CreationDate="2016-03-20T21:38:19.410" Score="1" Body="&lt;p&gt;The solution was:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Add &lt;code&gt;gnugo-3.8/interface&lt;/code&gt; to my &lt;code&gt;.emacs.d&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Add this directory to &lt;strong&gt;both&lt;/strong&gt; the &lt;code&gt;load-path&lt;/code&gt; and the &lt;code&gt;exec-path&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My problem was that the directory I added to the &lt;code&gt;exec-path&lt;/code&gt; contained directories that contained &lt;code&gt;gnugo&lt;/code&gt;, rather than containing &lt;code&gt;gnugo&lt;/code&gt; directly.&lt;/p&gt;&#xA;" OwnerUserId="8561" LastActivityDate="2016-03-20T21:38:19.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21119" PostTypeId="2" ParentId="21116" CreationDate="2016-03-20T23:35:35.843" Score="16" Body="&lt;p&gt;In Shell mode, Emacs detects password prompts based on the prompt. If it sees &lt;code&gt;Password:&lt;/code&gt; (or &lt;code&gt;Enter new password:&lt;/code&gt;, or &lt;code&gt;Passwort:&lt;/code&gt;, or &lt;code&gt;Wachtwoord:&lt;/code&gt; or a number of variations), it assumes that you're prompted to enter a password and reads a string from the minibuffer (repeating the prompt); this string is not echoed and is not entered in any history list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Emacs doesn't recognize a prompt, you can achieve the same effect by calling &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html#index-send_002dinvisible&quot;&gt;&lt;code&gt;M-x send-invisible&lt;/code&gt;&lt;/a&gt; (not bound to any key by default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can teach Emacs to recognize the password prompts you do see by customizing &lt;code&gt;comint-password-prompt-regexp&lt;/code&gt;. Note that this regexp is &lt;em&gt;searched&lt;/em&gt; on the current line, so it should start with &lt;code&gt;^&lt;/code&gt; if you want to match text at the left margin, and it should end with &lt;code&gt;\'&lt;/code&gt; if you don't want to allow arbitrary text afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add another prompt format, add &lt;code&gt;\|^…\'&lt;/code&gt; at the end of the existing regexp. For example, you could add this to your init file (remember to double backslashes between double quotes):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comint-password-prompt-regexp&#xA;      (concat comint-password-prompt-regexp&#xA;              &quot;\\|^Enter passphrase for .*:\\s *\\'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-20T23:35:35.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21120" PostTypeId="2" ParentId="19664" CreationDate="2016-03-20T23:55:10.487" Score="2" Body="&lt;p&gt;You can customize skipping specific entries in &lt;code&gt;org-agenda&lt;/code&gt; by using a &lt;a href=&quot;http://orgmode.org/manual/Special-agenda-views.html&quot; rel=&quot;nofollow&quot;&gt;skip function&lt;/a&gt;.  This is a function (or lisp form) that will be evaluated at each headline and should return &lt;code&gt;nil&lt;/code&gt; (to not skip the headline) or the point of the next headline to consider (which is typically the next headline, but could be, for example the next sibling to speed the search up).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, we just need a function to skip the headline if it has a certain tag (get those with &lt;code&gt;org-get-tags-at&lt;/code&gt;) and the &lt;code&gt;(current-time)&lt;/code&gt; is after a certain hour:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun skip-tag-after (tag hour)&#xA;  (let* ((next-headline (save-excursion&#xA;                          (or (outline-next-heading) (point-max))))&#xA;        (current-headline (or (and (org-at-heading-p)&#xA;                                   (point))&#xA;                              (save-excursion (org-back-to-heading))))&#xA;        ;; (now (decode-time (current-time)))&#xA;        (target (decode-time (current-time)))&#xA;        (day (nth 6 target))&#xA;        )&#xA;    (setcar (last target 7) hour)&#xA;    (setcar (last target 8) 0)&#xA;    (if (and (member tag (org-get-tags-at current-headline))&#xA;             (or (eq day 0)&#xA;                 (eq day 6)&#xA;                 (time-less-p (apply #'encode-time target) (current-time))))&#xA;            next-headline&#xA;            nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't consider the weekday, but that logic&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either &lt;code&gt;(setq (setq org-agenda-skip-function-global '(skip-tag-after &quot;WORK&quot; 17))&lt;/code&gt; to skip such headlines globally in every agenda, or set it set &lt;code&gt;org-agenda-skip-function&lt;/code&gt; locally inside a &lt;code&gt;org-agenda-custom-command&lt;/code&gt; to affect just that agenda.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-03-20T23:55:10.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21121" PostTypeId="2" ParentId="21115" CreationDate="2016-03-21T00:52:41.283" Score="2" Body="&lt;p&gt;You specified &lt;code&gt;t&lt;/code&gt; for the no-error argument of &lt;code&gt;re-search-forward&lt;/code&gt; in &lt;code&gt;find-start-of-sexp&lt;/code&gt;. This is the case where &lt;code&gt;re-search-forward&lt;/code&gt; just returns &lt;code&gt;nil&lt;/code&gt; if there is no match. Note, that point is &lt;em&gt;not&lt;/em&gt; moved in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last occurrence of &lt;code&gt;scheme@(guile-user)&lt;/code&gt; is not followed by a sexp embraced by parenthesis. Therefore, the search for &lt;code&gt;(&lt;/code&gt; fails and point remains behind &lt;code&gt;scheme@(guile-user)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the search you go one char backwards in &lt;code&gt;find-start-of-sexp&lt;/code&gt; and end up before the &lt;code&gt;)&lt;/code&gt; of &lt;code&gt;scheme@(guile-user)&lt;/code&gt;. Therefore, the next &lt;code&gt;forward-sexp&lt;/code&gt; naturally fails and gives the scan error you wonder about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One easy cure of the problem would be to replace &lt;code&gt;t&lt;/code&gt; in &lt;code&gt;re-search-forward&lt;/code&gt; by some other non-nil symbol like &lt;code&gt;'noerr&lt;/code&gt;. In this case point would be placed at end of buffer if the search fails. But, I wonder whether this is what you really want. For an example: What happens with the first occurrences of &lt;code&gt;scheme@(guile-user)&lt;/code&gt;? The next pair of parenthesis are the argument delimiters of the next &lt;code&gt;scheme@(guile-user)&lt;/code&gt;!&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-03-21T00:59:41.940" LastActivityDate="2016-03-21T00:59:41.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21122" PostTypeId="2" ParentId="21076" CreationDate="2016-03-21T01:03:39.343" Score="0" Body="&lt;p&gt;It turns out this is a very simple question...Setting the fourth argument of &lt;code&gt;call-process&lt;/code&gt;, i.e. &lt;code&gt;destination&lt;/code&gt;, to &lt;code&gt;t&lt;/code&gt; will insert the output into the buffer, which sets the variable &lt;code&gt;deactivate-mark&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. Therefore, the mark is deactivated afterwards. The solution is to bind &lt;code&gt;deactivate-mark&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; before the &lt;code&gt;call-process&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (orig-func &amp;amp;rest args)&#xA;  (let (deactivate-mark)&#xA;    (with-temp-buffer&#xA;      (call-process &quot;ls&quot; nil t)))&#xA;  (apply orig-func args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5482" LastActivityDate="2016-03-21T01:03:39.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21123" PostTypeId="1" CreationDate="2016-03-21T01:27:24.410" Score="1" ViewCount="192" Body="&lt;p&gt;I use gdb-mi in order to have access to gdb-many-windows functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to access gdb's ability to attach a list of &lt;a href=&quot;https://sourceware.org/gdb/current/onlinedocs/gdb/Break-Commands.html#Break-Commands&quot; rel=&quot;nofollow&quot;&gt;commands to execute once a breakpoint gets hit&lt;/a&gt;.  Documentation suggests that the gdb/mi protocol supports this via the &lt;a href=&quot;https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html#GDB_002fMI-Breakpoint-Commands&quot; rel=&quot;nofollow&quot;&gt;-break-commands&lt;/a&gt; verb.  That said, there is a cryptic suggestion of a &lt;a href=&quot;https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Compatibility-with-CLI.html#GDB_002fMI-Compatibility-with-CLI&quot; rel=&quot;nofollow&quot;&gt;rough edge&lt;/a&gt; earlier in that same documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So am I just out of luck or is there some magic emacs or gud incantation that will grant me access to -break-commands functionality?&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2017-08-25T02:59:05.283" Title="Under gdb-mi can I attach a command to a breakpoint?" Tags="|gdb|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21124" PostTypeId="1" AcceptedAnswerId="21128" CreationDate="2016-03-21T01:35:11.607" Score="8" ViewCount="3247" Body="&lt;p&gt;I only want to turn off the warnings for certain source block languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find an answer to this anywhere, only how to turn off the confirmation requests for all languages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-confirm-babel-evaluate nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a super easy question for someone who knows e-lisp. It should be included with the documentation in my opinion, but there is only one language in &lt;a href=&quot;http://orgmode.org/manual/Code-evaluation-security.html&quot; rel=&quot;noreferrer&quot;&gt;the example&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I extend this to include more languages?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-confirm-babel-evaluate (lang body)&#xA;            (not (string= lang &quot;ditaa&quot;)))  ; don't ask for ditaa&#xA;          (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9558" LastActivityDate="2016-03-22T08:14:31.297" Title="Execute org-mode source blocks without security confirmation" Tags="|org-mode|org-babel|security|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21125" PostTypeId="2" ParentId="21096" CreationDate="2016-03-21T01:42:35.470" Score="0" Body="&lt;p&gt;Ok, I found the solution: actually &lt;code&gt;custom-set-variables&lt;/code&gt; does &lt;code&gt;eval&lt;/code&gt; the setting values just before to set them, and you just have to modify by-hand the code within &lt;code&gt;custom-file&lt;/code&gt;: you unquote the value and put your programmatically computed value. It just works. Although you need not to open the customize parameter, change it a bit, and save it again, because it will overwrite the programmed computation and will just save the constant raw precomputed value (so most of time the “clean” solution would be, in the packages code, to either make the setting accepts a function as value, or if it’s a filename and you actually just need to &lt;code&gt;concat&lt;/code&gt;, make this file name relative by default to the directory you want).&lt;/p&gt;&#xA;" OwnerUserId="11375" LastActivityDate="2016-03-21T01:42:35.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21126" PostTypeId="2" ParentId="20977" CreationDate="2016-03-21T03:02:31.507" Score="0" Body="&lt;p&gt;The problem was caused by my changing the default font to Terminess Powerline. The usual default of Source Code Pro displays org-mode correctly.&lt;/p&gt;&#xA;" OwnerUserId="11407" LastActivityDate="2016-03-21T03:02:31.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21127" PostTypeId="2" ParentId="20976" CreationDate="2016-03-21T05:11:49.787" Score="5" Body="&lt;p&gt;I tracked down the problem to the last line of &lt;code&gt;use-fancy-splash-screens-p&lt;/code&gt;, which erroneously returns &lt;code&gt;nil&lt;/code&gt;.  If we change the last number from 19 to 17, the Emacs logo appears as expected.  The revised function can be placed in the &lt;code&gt;.emacs&lt;/code&gt; file and it is detected before the splash screen is displayed.  Here is the open bug report:  &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23074&quot; rel=&quot;noreferrer&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23074&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun use-fancy-splash-screens-p ()&#xA;  &quot;Return t if fancy splash screens should be used.&quot;&#xA;  (when (and (display-graphic-p)&#xA;             (or (and (display-color-p)&#xA;          (image-type-available-p 'xpm))&#xA;                 (image-type-available-p 'pbm)))&#xA;    (let ((frame (fancy-splash-frame)))&#xA;      (when frame&#xA;  (let* ((img (create-image (fancy-splash-image-file)))&#xA;         (image-height (and img (cdr (image-size img nil frame))))&#xA;         ;; We test frame-height so that, if the frame is split&#xA;         ;; by displaying a warning, that doesn't cause the normal&#xA;         ;; splash screen to be used.&#xA;         (frame-height (1- (frame-height frame))))&#xA;   ;; The original value added to the `image-height' for the test was 19; however,&#xA;   ;; that causes the test to fail on X11 by about 1.5 -- so use 17 instead.&#xA;    (&amp;gt; frame-height (+ image-height 17)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-03-21T05:11:49.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21128" PostTypeId="2" ParentId="21124" CreationDate="2016-03-21T08:33:11.647" Score="16" Body="&lt;p&gt;While I personally don't use babel much, going from the example, this should simply be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-confirm-babel-evaluate (lang body)&#xA;  (not (member lang '(&quot;C&quot; &quot;clojure&quot; &quot;sh&quot;))))&#xA;&#xA;(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;C&lt;/code&gt;, &lt;code&gt;clojure&lt;/code&gt; and &lt;code&gt;sh&lt;/code&gt; should be replaced by the languages you don't want the confirmation for.&lt;/p&gt;&#xA;" OwnerUserId="2677" LastEditorUserId="2677" LastEditDate="2016-03-22T08:14:31.297" LastActivityDate="2016-03-22T08:14:31.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21130" PostTypeId="1" AcceptedAnswerId="21139" CreationDate="2016-03-21T13:35:21.730" Score="1" ViewCount="42" Body="&lt;p&gt;While trying to use highlight-symbol in coffee mode (especially, cjsx), it interprets &lt;code&gt;Something&lt;/code&gt; and &lt;code&gt;&amp;lt;Something&lt;/code&gt; as two different symbols, while I expect &lt;code&gt;&amp;lt;&lt;/code&gt; to be not part of a symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tried to trace the problem, and found that this is probably due to thighatpt symbol receives incorrect data from  syntax table for coffee mode. How to fix coffee mode's syntax table to allow highlighting all symbols correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(but maybe I am totally wrong with the assessment, and highlight-symbol somehow adds &lt;code&gt;&amp;lt;&lt;/code&gt; to the symbol by itself. But at least in C mode it handles &quot;less than&quot; correctly)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.3.1, Coffee mode 0.6.2, highlight-symbol 20160102.1209&lt;/p&gt;&#xA;" OwnerUserId="11466" LastActivityDate="2016-03-21T22:29:03.780" Title="How to fix coffee mode symbol?" Tags="|syntax-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21131" PostTypeId="1" AcceptedAnswerId="21714" CreationDate="2016-03-21T14:04:52.383" Score="10" ViewCount="142" Body="&lt;p&gt;I call &lt;code&gt;count-words-region&lt;/code&gt; (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;=&lt;/kbd&gt;) on US/RU/IPA string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;HelloПривheləʊ&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following message is printed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Region has 1 line, 4 words, and 14 characters.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All symbols have &lt;code&gt;w&lt;/code&gt; syntax, but differ in script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(char-syntax ?H) ; ?w&#xA;(char-syntax ?П) ; ?w&#xA;(char-syntax ?ʊ) ; ?w&#xA;(aref char-script-table ?H)  ; script: latin&#xA;(aref char-script-table ?П)  ; script: cyrillic&#xA;(aref char-script-table ?ʊ)  ; script: phonetic&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does that mean that word boundary is defined not only by &lt;strong&gt;char syntax&lt;/strong&gt; but also by &lt;strong&gt;char script&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to disable this behavior for selected modes in order to be able to navigate across words but not across scripts. How can this be achieved?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24405&quot; rel=&quot;nofollow&quot;&gt;Useful further discussion on debbugs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-09-11T11:59:14.877" LastActivityDate="2016-09-11T11:59:14.877" Title="Does word syntax take script into account?" Tags="|syntax|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21132" PostTypeId="1" AcceptedAnswerId="21134" CreationDate="2016-03-21T14:49:02.957" Score="1" ViewCount="310" Body="&lt;p&gt;By trial and error I have found that in org-agenda &lt;code&gt;(org-agenda-todo 'done)&lt;/code&gt; marks the entry at point as &quot;DONE&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you explain why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I modify the argument to the &lt;code&gt;org-agenda-todo&lt;/code&gt; function (or which other function should I use) to mark the entry some other state, e.g. &quot;WAITING&quot;?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="105" LastEditDate="2016-06-22T20:03:34.630" LastActivityDate="2016-06-22T20:03:34.630" Title="How does (org-agenda-todo arg) work? What does the argument mean?" Tags="|org-mode|org-agenda|documentation|todo|arguments|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21134" PostTypeId="2" ParentId="21132" CreationDate="2016-03-21T15:22:41.440" Score="2" Body="&lt;p&gt;&lt;code&gt;org-agenda-todo&lt;/code&gt; calls the &lt;code&gt;org-todo&lt;/code&gt; function interactively and in doing so, the it passes its own argument as it is to &lt;code&gt;org-todo&lt;/code&gt;&lt;sup&gt;1&lt;/sup&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h f org-todo&lt;/code&gt;, you will get a complete understanding of what the values of ARG mean to &lt;code&gt;org-todo&lt;/code&gt; (and &lt;code&gt;org-agenda-todo&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-todo is an interactive compiled Lisp function in `org.el'.&#xA;&#xA;(org-todo &amp;amp;optional ARG)&#xA;&#xA;Change the TODO state of an item.&#xA;The state of an item is given by a keyword at the start of the heading,&#xA;like&#xA;     *** TODO Write paper&#xA;     *** DONE Call mom&#xA;&#xA;The different keywords are specified in the variable ‘org-todo-keywords’.&#xA;By default the available states are &quot;TODO&quot; and &quot;DONE&quot;.&#xA;So for this example: when the item starts with TODO, it is changed to DONE.&#xA;When it starts with DONE, the DONE is removed.  And when neither TODO nor&#xA;DONE are present, add TODO at the beginning of the heading.&#xA;&#xA;With C-u prefix arg, use completion to determine the new state.&#xA;With numeric prefix arg, switch to that state.&#xA;With a double C-u prefix, switch to the next set of TODO keywords (nextset).&#xA;With a triple C-u prefix, circumvent any state blocking.&#xA;With a numeric prefix arg of 0, inhibit note taking for the change.&#xA;With a numeric prefix arg of -1, cancel repeater to allow marking as DONE.&#xA;&#xA;When called through ELisp, arg is also interpreted in the following way:&#xA;‘none’             -&amp;gt; empty state&#xA;&quot;&quot;(empty string)  -&amp;gt; switch to empty state&#xA;‘done’             -&amp;gt; switch to DONE&#xA;‘nextset’          -&amp;gt; switch to the next set of keywords&#xA;‘previousset’      -&amp;gt; switch to the previous set of keywords&#xA;&quot;WAITING&quot;         -&amp;gt; switch to the specified keyword, but only if it&#xA;                     really is a member of ‘org-todo-keywords’.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; I learned the above by looking at the source code of &lt;code&gt;org-agenda-todo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it might be useful to email &lt;code&gt;emacs-orgmode@gnu.org&lt;/code&gt; with a request to add more information to the doc-string of &lt;code&gt;org-agenda-todo&lt;/code&gt;.. Something along the lines of &quot;Refer to the documentation of &lt;code&gt;org-todo&lt;/code&gt; to learn how ARG is used.&quot;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-03-21T15:22:41.440" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21135" PostTypeId="2" ParentId="21123" CreationDate="2016-03-21T15:29:50.180" Score="1" Body="&lt;p&gt;Given the &quot;&lt;a href=&quot;https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Compatibility-with-CLI.html#GDB_002fMI-Compatibility-with-CLI&quot; rel=&quot;nofollow&quot;&gt;rough edge&lt;/a&gt;&quot; I referenced in my original question I decided to investigate prompt handling in gud.el.  Based on nothing more than a hunch I tried changing the two lines (~783 in function gud-gdb) from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq comint-prompt-regexp &quot;^(.*gdb[+]?) *&quot;)&#xA;  (setq paragraph-start comint-prompt-regexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq comint-prompt-regexp &quot;^&amp;gt;|((.*gdb[+]?) *)&quot;)&#xA;  (setq paragraph-start &quot;^(.*gdb[+]?) *&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the effect of preserving paragraph separation according to the original regex prompt pattern while allowing stripping of the single leading '&gt;' prompt that gdb uses when collecting a commands list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amazingly it seems to work!  Though &lt;strong&gt;info br&lt;/strong&gt; shows breakpoint associated commands lists the gdb-many-windows Breakpoints window gives no indication of their existence.  But that is a small nit.  For now I am happy.&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2016-03-21T15:29:50.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21136" PostTypeId="1" CreationDate="2016-03-21T15:47:45.893" Score="0" ViewCount="360" Body="&lt;p&gt;is there a way to set the font attributes on per file basis? I'm surprised this is not a main feature... I don't want my todo lists to look the same as my articles or journal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IF there is such a thing is there also something like importing? e.g. &lt;code&gt;import 'article_style'&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following without success&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; eval: '(org-level-1 ((t (:weight thin :height 1.6 :family &quot;Helvetica Neue&quot;))))&#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user11468" LastEditorDisplayName="user11468" LastEditDate="2016-03-22T14:57:50.103" LastActivityDate="2016-03-22T14:57:50.103" Title="Orgmode set font face on per file basis" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21137" PostTypeId="1" CreationDate="2016-03-21T16:35:35.497" Score="5" ViewCount="1921" Body="&lt;p&gt;Is there any way to get emacs to actually check the contents of files on disk when determining this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if I have some unsaved changes to a file, and temporarily switch source control branches (to make changes to other files), then switch back again, I want to be able to continue editing where I left off without this prompt. (the prompt would be much more trustworthy and useful if it only warned me when the file had really changed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it currently goes by timestamp or something.&lt;/p&gt;&#xA;" OwnerUserId="9779" LastActivityDate="2016-08-24T07:41:49.167" Title="Fix 'changed on disk'/'Reread from disk' when file has not changed" Tags="|saving|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21138" PostTypeId="2" ParentId="20584" CreationDate="2016-03-21T18:50:55.963" Score="0" Body="&lt;p&gt;I found that using the function &lt;code&gt;org-agenda-maybe-redo&lt;/code&gt; worked instead of &lt;code&gt;org-agenda-redo&lt;/code&gt;. &#xA;So my renew function now looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun renewOrgBuffer ()&#xA;  (interactive)&#xA;  (dolist (buffer (buffer-list))&#xA;    (with-current-buffer buffer&#xA;      (when (derived-mode-p 'org-agenda-mode)&#xA;    (org-agenda-maybe-redo))))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I made a timer to renew the agenda buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-idle-timer 3 1000 #'renewOrgBuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;comparing &lt;code&gt;org-agenda-redo&lt;/code&gt; and &lt;code&gt;org-agenda-maybe-redo&lt;/code&gt;, it appears that maybe my issue was that I wasn't using the &lt;code&gt;get-buffer-window&lt;/code&gt; function. &lt;/p&gt;&#xA;" OwnerUserId="10117" LastActivityDate="2016-03-21T18:50:55.963" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21139" PostTypeId="2" ParentId="21130" CreationDate="2016-03-21T19:47:08.137" Score="1" Body="&lt;p&gt;Put the cursor just before the &lt;code&gt;&amp;lt;&lt;/code&gt; in &lt;code&gt;&amp;lt;symbol&lt;/code&gt; and hit &lt;code&gt;C-u C-x =&lt;/code&gt;. Look at the &lt;code&gt;*Help*&lt;/code&gt; output - search for &quot;syntax&quot;. If it says this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;syntax: _   which means: symbol&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the character &lt;code&gt;&amp;lt;&lt;/code&gt; has symbol syntax.  And yes, you will need to change its syntax in coffee mode, to make it something else (e.g. so that &lt;code&gt;C-u C-x =&lt;/code&gt; says something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;syntax: (&amp;gt;  which means: open, matches &amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html&quot; rel=&quot;nofollow&quot;&gt;Syntax Tables&lt;/a&gt; and its subnodes for details about setting the syntax the way you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add a function to the coffee mode hook (probably &lt;code&gt;coffee-mode-hook&lt;/code&gt;) that invokes &lt;code&gt;modify-syntax-entry&lt;/code&gt; to change the syntax of character &lt;code&gt;?&amp;lt;&lt;/code&gt;. (You might want to also change the syntax of &lt;code&gt;&amp;gt;&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (modify-syntax-entry ?&amp;lt; &quot;(&amp;gt;  &quot;)   ; &amp;lt; opens, closed by &amp;gt;&#xA;  (modify-syntax-entry ?&amp;gt; &quot;)&amp;lt;  &quot;))  ; &amp;gt; closes, opened by &amp;lt;&#xA;&#xA;(add-hook 'coffee-mode-hook 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-03-21T22:29:03.780" LastActivityDate="2016-03-21T22:29:03.780" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21140" PostTypeId="1" AcceptedAnswerId="21143" CreationDate="2016-03-21T20:18:24.210" Score="3" ViewCount="118" Body="&lt;p&gt;For example, lets say a package defines a variable &lt;code&gt;foo&lt;/code&gt;: &lt;code&gt;(A B C)&lt;/code&gt;, but through customize, I remove &lt;code&gt;C&lt;/code&gt; from the list. Now the variable &lt;code&gt;foo&lt;/code&gt; is &lt;code&gt;(A B)&lt;/code&gt;. What happens if later, the package maintainers change the variable &lt;code&gt;foo&lt;/code&gt; so that it is now &lt;code&gt;(A B C D)&lt;/code&gt;. Will my setting in &lt;code&gt;customize&lt;/code&gt; continue to be respected? If so, how will I ever no that this list now includes more members?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that was a little too unclear, here is the actual use case: I have removed &lt;code&gt;elpy-module-yasnippet&lt;/code&gt; from the list &lt;code&gt;elpy-modules&lt;/code&gt; as suggested in the comments to &lt;a href=&quot;https://emacs.stackexchange.com/q/19346/8430&quot;&gt;this question&lt;/a&gt;. Since the list of modules is now explicitly defined in my customizations file, does this mean that if &lt;code&gt;elpy&lt;/code&gt; someday adds new and exciting modules, by default I will not have them?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-03-21T21:01:06.903" Title="What happens if variable changed through customize is later changed by package maintainers?" Tags="|init-file|customize|variables|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21141" PostTypeId="2" ParentId="21045" CreationDate="2016-03-21T20:54:28.300" Score="0" Body="&lt;p&gt;Backslashes need to be escaped in strings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(string-match &quot;x\\{3\\}&quot; &quot;string with 3 x's repeating: xxx&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11436" LastActivityDate="2016-03-21T20:54:28.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21142" PostTypeId="2" ParentId="21050" CreationDate="2016-03-21T20:58:46.017" Score="2" Body="&lt;p&gt;No, this is not possible directly from Elisp at the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please open a bug report, so that this feature can be added (it won't be in time for Emacs 25, but it may make it to the next version).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime, depending on your platform, you can call out to external programs such as &lt;a href=&quot;https://superuser.com/questions/389766/linux-bash-how-to-get-interfaces-ipv6-address&quot;&gt;&lt;code&gt;ip -6 addr&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2016-03-21T21:12:39.110" LastActivityDate="2016-03-21T21:12:39.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21143" PostTypeId="2" ParentId="21140" CreationDate="2016-03-21T21:01:06.903" Score="6" Body="&lt;p&gt;The answer to your question is: Yes, you won't hear about the new and exciting modules. But you can write: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo (remq 'c foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to remove c from foo. Or clone the repository and use standard version control tools for making any changes to the source you want.&lt;/p&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2016-03-21T21:01:06.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21144" PostTypeId="1" AcceptedAnswerId="21152" CreationDate="2016-03-21T21:16:04.327" Score="3" ViewCount="91" Body="&lt;p&gt;What/where is the logic that determines whether tramp reuses its current connection in order to execute a process or creates a new connection?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it as simple as spawning a process synchronously vs async?&lt;/p&gt;&#xA;" OwnerUserId="7151" LastActivityDate="2016-03-22T09:20:52.643" Title="When does tramp create a new connection for a process?" Tags="|tramp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21145" PostTypeId="1" AcceptedAnswerId="21146" CreationDate="2016-03-21T21:22:41.127" Score="1" ViewCount="13036" Body="&lt;p&gt;I'm trying to use &lt;code&gt;M-x replace-regex&lt;/code&gt; to find and replace the first space on each line.  What regex would I use to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything I've tried either finds no matches or every space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lines never start with a space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, if my line consisted of &lt;code&gt;What did the fox say?&lt;/code&gt; I would like to replace the space between &lt;code&gt;What&lt;/code&gt; and &lt;code&gt;did&lt;/code&gt;.  I would not like to match the &lt;code&gt;What&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10562" LastEditorUserId="962" LastEditDate="2016-03-22T15:08:45.537" LastActivityDate="2016-03-22T17:32:26.293" Title="How do I replace only the first space on a line?" Tags="|regular-expressions|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21146" PostTypeId="2" ParentId="21145" CreationDate="2016-03-21T21:40:42.193" Score="6" Body="&lt;p&gt;You can use the regexp “&lt;code&gt;^\([^ ]*\)&lt;/code&gt;”. &lt;em&gt;Please note&lt;/em&gt; that it ends with a space. There is also a single space character inside &lt;code&gt;[^ ]&lt;/code&gt;. Specify that one, and replace with “&lt;code&gt;\1X&lt;/code&gt;” (where the &lt;code&gt;X&lt;/code&gt; stands for whatever you want to replace the space with).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is what you type. Below, spaces are not to be typed in, but the string SPACE is to be typed as a single space character, and RET as a return. Ready? Here we go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-M-% ^\([^ SPACE ]*\) SPACE RET \1 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that there can be no regexp that matches the first space character on the line. Therefore, the above solution matches all text up to &lt;em&gt;and including&lt;/em&gt; the first space, then remembers the leading part by putting it inside &lt;code&gt;\(…\)&lt;/code&gt;. The &lt;code&gt;\1&lt;/code&gt; in the replacement text will match this part, so the net effect is just to remove the space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;strong&gt;Heavily edited&lt;/strong&gt; to explain more fully.)&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2016-03-22T09:59:13.857" LastActivityDate="2016-03-22T09:59:13.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21147" PostTypeId="2" ParentId="19823" CreationDate="2016-03-21T22:31:30.377" Score="2" Body="&lt;p&gt;Here is what I have come up with. Pretty simple.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq&#xA;    org-todo-keywords&#xA;     '((sequence &quot;TODO(t)&quot; &quot;|&quot; &quot;DONE(d!)&quot; &quot;SKIP(k!)&quot; &quot;CNCL(c@)&quot;)))&#xA;&#xA;  (define-key org-agenda-mode-map &quot;K&quot;&#xA;    (lambda () (interactive) (org-agenda-todo '&quot;SKIP&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What this does is temporarily mark the item as &lt;code&gt;SKIP&lt;/code&gt; and then immediately mark it as &lt;code&gt;TODO&lt;/code&gt; again, while advancing the &lt;code&gt;SCHEDULED:&lt;/code&gt; and &lt;code&gt;DEADLINE:&lt;/code&gt; timestamps as if it was &lt;code&gt;DONE&lt;/code&gt; and making a record about the fact in the &lt;code&gt;:LOGBOOK:&lt;/code&gt; along the way.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2016-03-21T22:31:30.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21148" PostTypeId="2" ParentId="21137" CreationDate="2016-03-22T00:31:22.033" Score="3" Body="&lt;p&gt;When Emacs detects that a file has changed , it calls &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Modification-Time.html#index-ask_002duser_002dabout_002dsupersession_002dthreat&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ask-user-about-supersession-threat&lt;/code&gt;&lt;/a&gt;. The default implementation of this function shows the “FILENAME changed on disk; \&#xA;really edit the buffer?” prompt. The call is made from C code, so you can't customize the way it's called, but you can make the function examine the situation more closely and not prompt in certain cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't very efficient, but you can open the file in a temporary buffer and compare the contents with the contents of the current buffer. Untested code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun compare-buffer-with-file (filename)&#xA;  &quot;Compare the content of the current buffer with the content of FILENAME.&#xA;Return t if they are identical, nil if they differ.&quot;&#xA;  (save-restriction&#xA;    (widen)&#xA;    (let ((original-buffer (current-buffer))&#xA;          (original-size (point-max)))&#xA;      (with-temp-buffer&#xA;        (insert-file-contents filename)&#xA;        (zerop (compare-buffer-substrings original-buffer 1 original-size&#xA;                                          (current-buffer) 1 (point-max)))))))&#xA;(defadvice ask-user-about-supersession-threat&#xA;  (around ask-only-if-contents-differ activate)&#xA;  &quot;Ask only if the contents of the file has actually changed.&#xA;Otherwise silently allow editing the buffer.&quot;&#xA;  (or (compare-buffer-with-file fn)&#xA;      ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-08-24T07:41:49.167" LastActivityDate="2016-08-24T07:41:49.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21149" PostTypeId="1" AcceptedAnswerId="21154" CreationDate="2016-03-22T02:30:15.450" Score="4" ViewCount="657" Body="&lt;p&gt;Is there a way to make switch-to-buffer more dwim in this regard? Let's say I have two windows with foo.el and bar.el open. With my point in foo.el, if I switch-to-buffer and open bar.el, I'd like to just be taken to the other window, rather than be left with two windows of bar.el.&lt;/p&gt;&#xA;" OwnerUserId="2207" LastActivityDate="2016-03-22T18:47:47.483" Title="Let switch-to-buffer to already open buffer switch to that window, rather than open it in this one" Tags="|buffers|window|window-splitting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21150" PostTypeId="1" CreationDate="2016-03-22T03:18:07.543" Score="2" ViewCount="645" Body="&lt;p&gt;This entry was showing alright in org-agenda in Org 7.8, if I remember correctly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Dinner&#xA;&amp;lt;2016-02-26 Fri 12:00-13:30&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not any more in Org 8.2.&#xA;Now, it seems I need to have it this way to show up in org-agenda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO Dinner&#xA;&amp;lt;2016-02-26 Fri 12:00-13:30&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How could I show appointments (items without a TODO keyword) in new versions of org-agenda?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2016-03-23T15:17:04.573" Title="How to show appointments in org-agenda in Org v.8?" Tags="|org-mode|org-agenda|todo|upgrade|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21152" PostTypeId="2" ParentId="21144" CreationDate="2016-03-22T09:20:52.643" Score="3" Body="&lt;p&gt;Yes, it is sync vs async. Emacs offers two basic functions for creating a new process on a remote machine, &lt;code&gt;process-file&lt;/code&gt; and &lt;code&gt;start-file-process&lt;/code&gt;. The former function creates a new synchronous process (reusing an existing connection), and the latter function creates a new asynchronous process (opening a new connection).&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-22T09:20:52.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21153" PostTypeId="1" CreationDate="2016-03-22T10:58:55.730" Score="0" ViewCount="55" Body="&lt;p&gt;I want to comment out all environments say &lt;code&gt;myenv&lt;/code&gt; in a tex-file. I can find them with the regexp:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\\begin{myenv}\(.\|\n\).*?\\end{myenv}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(instead of &lt;code&gt;\n&lt;/code&gt; I had do type &lt;code&gt;C-q C-j&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what would be the correct regexp for replacing? How to reverse it, i.e. uncomment all environments &lt;code&gt;myenv&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-03-22T14:00:34.033" LastActivityDate="2016-05-21T20:24:01.107" Title="Query replace and commenting out" Tags="|auctex|regular-expressions|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21154" PostTypeId="2" ParentId="21149" CreationDate="2016-03-22T12:27:38.813" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-switch-to-buffer (buffer)&#xA;  &quot;Display BUFFER in the selected window.&#xA;If BUFFER is displayed in an existing window, select that window instead.&quot;&#xA;  (interactive&#xA;   (list (get-buffer (read-buffer&#xA;                      &quot;Switch to buffer: &quot;&#xA;                      (other-buffer (current-buffer))))))&#xA;  (if-let ((win (get-buffer-window buffer)))&#xA;      (select-window win)&#xA;    (switch-to-buffer buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update: while defining a new command is a clear and clean solution, advising &lt;code&gt;switch-to-buffer&lt;/code&gt; will make &lt;code&gt;switch-to-buffer&lt;/code&gt; and other commands which call &lt;code&gt;switch-to-buffer&lt;/code&gt; (such as &lt;code&gt;ido-switch-buffer&lt;/code&gt; and &lt;code&gt;helm-buffers-list&lt;/code&gt;) have the new behavior.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun switch-to-buffer--hack (orig-fun &amp;amp;rest args)&#xA;  (if-let ((win (get-buffer-window (car args))))&#xA;      (select-window win)&#xA;    (apply orig-fun args)))&#xA;&#xA;(advice-add 'switch-to-buffer :around #'switch-to-buffer--hack)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(This doesn't work with Ivy's &lt;code&gt;ivy-switch-buffer&lt;/code&gt; for some reason)&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-03-22T18:47:47.483" LastActivityDate="2016-03-22T18:47:47.483" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21155" PostTypeId="2" ParentId="21153" CreationDate="2016-03-22T13:59:18.780" Score="1" Body="&lt;p&gt;I think, for what you are doing, the comment by Tobias provides a superior solution.  And  &lt;a href=&quot;https://tex.stackexchange.com/questions/87303/multi-line-block-comments-in-latex&quot;&gt;this question&lt;/a&gt; gives quite a few options for commenting out chunks of code.  That said, I'll assume this is an issue with using emacs, rather than latex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make your entire regex match a group &lt;code&gt;\(regex\)&lt;/code&gt;, then the regex to replace it will be similar to &lt;code&gt;\\iffalse \1 \\fi&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An easier solution would be to write a keyboard macro that finds the begin\end environment commands and inserts the comment code there. &lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-03-22T13:59:18.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21156" PostTypeId="1" AcceptedAnswerId="21162" CreationDate="2016-03-22T15:29:49.353" Score="2" ViewCount="292" Body="&lt;p&gt;I have following text which are expressed in level 5&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;***** It's better to be first than it is to be better.&#xA;***** The basic issue in marketing is creating a category you can be first in. It’s the law of leadership: It’s&#xA;      better to be first than it is to be better.&#xA;***** It’s much easier to get into the mind first than to try to convince someone you have a better product than the&#xA;      one that did get there first.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;........&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to change into list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;00001 It's better to be first than it is to be better.&#xA;00002 The basic issue in marketing is creating a category you can be first in. It’s the law of leadership: It’s&#xA;      better to be first than it is to be better.&#xA;00003 It’s much easier to get into the mind first than to try to convince someone you have a better product than the&#xA;      one that did get there first.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any quick way to do that?&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="5213" LastEditDate="2016-04-30T14:30:01.457" LastActivityDate="2016-04-30T14:30:01.457" Title="Change level into list in org mode" Tags="|org-mode|list|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21157" PostTypeId="2" ParentId="16903" CreationDate="2016-03-22T16:15:51.530" Score="0" Body="&lt;p&gt;Here's the workaround that I use:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;set a hotkey for &lt;code&gt;neotree-toggle&lt;/code&gt;: &lt;code&gt;(global-set-key (kbd &quot;M-n&quot;) 'neotree-toggle)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;open 2 or 3 windows side by side: &lt;code&gt;C-x 3&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;make them the same size: &lt;code&gt;C-x +&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;open neotree: &lt;code&gt;M-n&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Additionally, I started using &lt;a href=&quot;https://www.emacswiki.org/emacs/WinnerMode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;winner-mode&lt;/code&gt;&lt;/a&gt;, mainly for maximizing windows: &lt;code&gt;C-x 1&lt;/code&gt;, then revert to previous window configuration &lt;code&gt;C-c &amp;lt;left&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Emacs version: &lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin15.0.0) of 2015-09-13 on elcapitanvm.local&lt;/code&gt;, config file: &lt;a href=&quot;https://github.com/andreis/cfg/blob/master/emacs.el&quot; rel=&quot;nofollow&quot;&gt;emacs.el&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="11369" LastEditorUserId="11369" LastEditDate="2016-03-22T16:24:37.510" LastActivityDate="2016-03-22T16:24:37.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21158" PostTypeId="1" CreationDate="2016-03-22T16:39:22.113" Score="0" ViewCount="100" Body="&lt;p&gt;if anyone can help me that would be much appreciated. I may be in the wrong place for this but it's a major roadblock for my research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a folder with about 1700 folders. I have a list of numbers in excel which correlates to a subset of these folders which I am interested in (about 1300). The folder labels contain(but are not the same as) these numbers from excel. I need to copy 1 out of the 2 files in each folder(out of the 1700). The file I need to copy contains a unique ending _dc_brain_FA.nii (compared to the other file in each folder). I would like to copy these files into a single folder containing the 1300 or so _dc_brain_FA.nii* files.&lt;/p&gt;&#xA;" OwnerUserId="11485" LastEditorUserId="105" LastEditDate="2016-03-22T20:17:01.390" LastActivityDate="2016-03-23T09:34:48.997" Title="Emacs beginner. Need basic script for copying files" Tags="|files|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21159" PostTypeId="2" ParentId="21153" CreationDate="2016-03-22T16:46:50.280" Score="0" Body="&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;re-search-forward&lt;/code&gt; &lt;kbd&gt;RET &lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MY_REGEXP  &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;followed by&#xA; &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;comment-dwim&lt;/code&gt;  &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;;;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;comment-dwim&lt;/code&gt; is at &lt;kbd&gt;M-;&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;re-search-forward&lt;/code&gt; the region should be visible.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not  &lt;kbd&gt;C-x &lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; resp.  &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;exchange-point-and-mark&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-03-22T16:46:50.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21160" PostTypeId="2" ParentId="21145" CreationDate="2016-03-22T17:32:26.293" Score="0" Body="&lt;p&gt;This is the idea: capture all non-space characters from the beginning of the line in the regex in one set of parenthesis, and then the first space, replacing with the first capture plus something instead of the space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is that shown as a function you can run, rather than a direct command (easier to read and test):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun asjo-test-rr ()&#xA;    (interactive)&#xA;    (replace-regexp &quot;^\\([^ ]+\\)\\( \\)&quot; &quot;\\1ABBA&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if you evaluate that function (put your cursor after the last parenthesis and go &lt;code&gt;C-c C-e&lt;/code&gt;), and then you go to a line, say your example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;What did the fox say?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and you type &lt;code&gt;M-x asjo-test-rr&lt;/code&gt;, the result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;WhatABBAdid the fox say?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. the first and only the first space has been replaced (with &quot;ABBA&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course type in the regexp and replacement string in the &lt;code&gt;M-%&lt;/code&gt; prompt, if you're not afraid of leaning toothpick syndrome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Although I've got to admit, I can't make it work doing that right now.)&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-03-22T17:32:26.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21162" PostTypeId="2" ParentId="21156" CreationDate="2016-03-22T20:28:32.803" Score="2" Body="&lt;p&gt;You can use the in-built &lt;code&gt;query-replace-regexp&lt;/code&gt; function to do this kind of text manipulation. By default, it is bound to &lt;code&gt;C-M-%&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you would do &lt;code&gt;C-M-%&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;enter &quot;&lt;code&gt;^\*+\(\s-+.*\)&lt;/code&gt;&quot; in the &lt;em&gt;Query replace regexp:&lt;/em&gt; field, and &lt;/li&gt;&#xA;&lt;li&gt;&quot;&lt;code&gt;\,(format (concat &quot;%0&quot; (number-to-string (org-current-level)) &quot;d&quot;) (1+ \#))\1&lt;/code&gt;&quot; in the &lt;em&gt;with:&lt;/em&gt; field.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Above will convert&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* abc&#xA;** def&#xA;*** ghi&#xA;**** jkl&#xA;***** mno&#xA;****** pqr&#xA;******* stu&#xA;******** vwx&#xA;********* yz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 abc&#xA;02 def&#xA;003 ghi&#xA;0004 jkl&#xA;00005 mno&#xA;000006 pqr&#xA;0000007 stu&#xA;00000008 vwx&#xA;000000009 yz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: If you want to deal with only level-5 headings, you can have the search regexp and replace strings as &quot;&lt;code&gt;^\*\{5\}\(\s-+.*\)&lt;/code&gt;&quot; and &quot;&lt;code&gt;\,(format &quot;%05d&quot; (1+ \#))\1&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When applying either of the above two solutions on your example, the result is the exact same as you have in the question.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-03-22T20:28:32.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21163" PostTypeId="2" ParentId="14423" CreationDate="2016-03-22T20:59:04.537" Score="0" Body="&lt;p&gt;You can also generate the tags with the following command to command to be read by ggtags &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gtags --gtagslabel=ctags&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above command should be helpful of any language not supported by gtags but supported by ctags.&lt;/p&gt;&#xA;" OwnerUserId="948" LastActivityDate="2016-03-22T20:59:04.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21164" PostTypeId="1" CreationDate="2016-03-22T22:18:03.440" Score="14" ViewCount="4883" Body="&lt;p&gt;I just upgraded to the newest version of Magit having used the old version for years. All the improvements are great after a little searching around and figuring out the differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I'm just trying to do the simplest (non-interactive) rebase in &lt;code&gt;magit&lt;/code&gt; and I can't figure out how to do it. This example is from &lt;a href=&quot;https://git-scm.com/docs/git-rebase&quot; rel=&quot;noreferrer&quot;&gt;https://git-scm.com/docs/git-rebase&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git checkout topic&#xA;git rebase master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Hit &lt;kbd&gt;r&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;?&lt;/li&gt;&#xA;&lt;li&gt;My topic branch is rebased with the newest changes from master.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11488" LastEditorUserId="253" LastEditDate="2016-04-13T14:33:44.507" LastActivityDate="2016-04-13T14:33:44.507" Title="Simple rebase from master with magit?" Tags="|magit|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21165" PostTypeId="1" AcceptedAnswerId="21166" CreationDate="2016-03-22T22:51:37.520" Score="3" ViewCount="344" Body="&lt;p&gt;In C++ mode there is the following behavior of the indentation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HxBZK.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HxBZK.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this happening? How can I fix it?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2016-03-23T14:59:11.990" Title="Weird indentation behavior in C++ mode" Tags="|indentation|c++|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21166" PostTypeId="2" ParentId="21165" CreationDate="2016-03-22T23:03:51.047" Score="6" Body="&lt;p&gt;It's not weird; &lt;code&gt;std:&lt;/code&gt; could be a label and until you type the second &lt;code&gt;:&lt;/code&gt; it doesn't know otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I forgot to mention, but you can customize &lt;code&gt;c-default-style&lt;/code&gt; to choose a different indentation style, and you can add your own entries to &lt;code&gt;c-style-alist&lt;/code&gt; to make one that's exactly to your liking.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2016-03-23T14:59:11.990" LastActivityDate="2016-03-23T14:59:11.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21167" PostTypeId="2" ParentId="20451" CreationDate="2016-03-23T00:19:55.290" Score="0" Body="&lt;p&gt;I'm confused.  Are you benefiting from centering the text in Emacs?  As Dan points out, that can break a lot of Org's parsing assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can accept a solution that leaves the headlines left-aligned in Org but centers the text in the exported ODT, have a look at &lt;a href=&quot;http://orgmode.org/manual/Applying-custom-styles.html#Applying-custom-styles&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; part of the manual.  Paraphrasing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create a sample example.org file and export it to ODT.&lt;/li&gt;&#xA;&lt;li&gt;Open the example.odt using LibreOffice. &lt;/li&gt;&#xA;&lt;li&gt;Use the Stylist (F11 on my system) to locate the target styles—you probably want &lt;code&gt;Heading&lt;/code&gt; (for all headings) or &lt;code&gt;Heading N&lt;/code&gt; (for some depth N)—and modify those to be center-aligned. &lt;/li&gt;&#xA;&lt;li&gt;Save the modified file either as an OpenDocument Text (.odt) or OpenDocument Template (.ott) file.&lt;/li&gt;&#xA;&lt;li&gt;Back in Emacs, if you want to center headlines in every exported file by default, customize the variable &lt;code&gt;org-odt-styles-file&lt;/code&gt; and point it to the newly created file.  If you only want to center headlines in a few files, insert &lt;code&gt;#+ODT_STYLES_FILE: &quot;new file&quot;&lt;/code&gt; at the top of just the files you want to affect.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="372" LastActivityDate="2016-03-23T00:19:55.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21168" PostTypeId="2" ParentId="21057" CreationDate="2016-03-23T00:38:56.687" Score="2" Body="&lt;pre&gt;&lt;code&gt;man tr&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your entire task is a one-line bash command. &#xA;I wouldn't bother using Emacs for it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for f in * ; do mv $f tmp ; tr -d '!' &amp;lt; tmp &amp;gt; $f ; done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2016-03-23T00:45:01.563" LastActivityDate="2016-03-23T00:45:01.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21171" PostTypeId="1" AcceptedAnswerId="21173" CreationDate="2016-03-23T02:16:15.577" Score="8" ViewCount="4576" Body="&lt;p&gt;Org mode has completion for all keywords via &lt;code&gt;pcomplete&lt;/code&gt;, as noted by &lt;a href=&quot;https://emacs.stackexchange.com/a/5865/10269&quot;&gt;Andrew Swann&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Company does not seem to pick up on these keywords. Calling &lt;code&gt;company-complete&lt;/code&gt; on the following, where &lt;code&gt;|&lt;/code&gt; represents point, brings up a list of English vocabulary words instead of Org keywords:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible for Company to do Org-specific completion &lt;em&gt;in addition to&lt;/em&gt; the helpful textual completion that it normally does? &lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2019-04-20T17:10:08.943" Title="Company-mode completion for Org keywords" Tags="|org-mode|company-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21172" PostTypeId="2" ParentId="20451" CreationDate="2016-03-23T03:02:01.087" Score="0" Body="&lt;p&gt;The solution to center the title in exported odt file,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;open the exporting odt file with Emacs, in the opened buffer, select content.xml and press &lt;code&gt;Enter&lt;/code&gt; key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In content.xml, say you want to center the level 1 heading, find text &lt;code&gt;text:h text:style-name=&quot;Heading_20_1&quot;&lt;/code&gt; search and replace it with &lt;code&gt;&quot;text:h text:style-name=&quot;NewHeading_1&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then scroll back, move the focus inside tag &lt;code&gt;&amp;lt;office:automatic-styles&amp;gt;&lt;/code&gt;, insert below code,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;style:style style:name=&quot;NewHeading_1&quot; style:family=&quot;paragraph&quot; style:parent-style-name=&quot;Heading_20_1&quot;&amp;gt;&#xA;  &amp;lt;style:paragraph-properties fo:text-align=&quot;center&quot; style:justify-single-word=&quot;false&quot;/&amp;gt;&#xA;&amp;lt;/style:style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Save and exit Emacs.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-03-23T06:01:35.370" LastActivityDate="2016-03-23T06:01:35.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21173" PostTypeId="2" ParentId="21171" CreationDate="2016-03-23T03:16:58.120" Score="10" Body="&lt;p&gt;&lt;code&gt;company-mode&lt;/code&gt; has &lt;code&gt;company-capf&lt;/code&gt;. So the easiest way is adding &lt;code&gt;pcomplete-completions-at-point&lt;/code&gt; to &lt;code&gt;completion-at-point-functions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-mode-hook ()&#xA;  (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t))&#xA;(add-hook 'org-mode-hook #'my-org-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make sure &lt;code&gt;company-capf&lt;/code&gt; is in the list of &lt;code&gt;company-backends&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5482" LastActivityDate="2016-03-23T03:16:58.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21174" PostTypeId="1" AcceptedAnswerId="21884" CreationDate="2016-03-23T03:56:17.243" Score="5" ViewCount="459" Body="&lt;p&gt;I have a book list contained which will be read or had done. Like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* English books [0/2]&#xA;  - [ ] bible&#xA;  - [ ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use C-c C-c to check, is it possible to add date behind or add low level automatically.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* English books [1/2]&#xA;  - [X] bible   :03/22/2016&#xA;  - [ ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* English books [1/2]&#xA;  - [X] bible&#xA;     - DONE:03/22/2016&#xA;  - [ ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* English books [1/2]&#xA;  - [X] bible&#xA;   :PROPERTIES:&#xA;   :DONE:03/22/2016&#xA;   :END: &#xA;  - [ ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="5213" LastEditDate="2016-04-26T21:19:07.773" LastActivityDate="2016-04-26T21:19:07.773" Title="Check box add date in org mode" Tags="|org-mode|list|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21175" PostTypeId="1" AcceptedAnswerId="21176" CreationDate="2016-03-23T04:31:17.137" Score="2" ViewCount="417" Body="&lt;p&gt;I use Gnus for mail with &lt;code&gt;nnmail&lt;/code&gt; backend. I was in Gnus &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Group-Buffer.html#Group-Buffer&quot; rel=&quot;nofollow&quot;&gt;group buffer&lt;/a&gt; and accidentally pressed &lt;kbd&gt;C-k&lt;/kbd&gt;, which called &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Subscription-Commands.html#index-S-k-_0028Group_0029&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-group-kill-group&lt;/code&gt;&lt;/a&gt;. Did I just mindlessly deleted important mail? How do I restore my mail?&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-03-23T04:31:17.137" Title="Accidentally killed a Gnus group, how do I restore it?" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21176" PostTypeId="2" ParentId="21175" CreationDate="2016-03-23T04:31:17.137" Score="3" Body="&lt;p&gt;Killing groups doesn't mean deleting them completely with all the mail, it means unsubscribing from a group and making it invisible. Read subsection &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Group-Levels.html#Group-Levels&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Group levels&lt;/em&gt;&lt;/a&gt; of Gnus manual to understand subscribedness to groups better. To restore killed groups first list them by &lt;kbd&gt;A k&lt;/kbd&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Listing-Groups.html#index-A-k-_0028Group_0029&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-group-list-killed&lt;/code&gt;&lt;/a&gt;) or &lt;kbd&gt;L&lt;/kbd&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Listing-Groups.html#index-L-_0028Group_0029&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-group-list-all-groups&lt;/code&gt;&lt;/a&gt;), then subscribe back by &lt;kbd&gt;u&lt;/kbd&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Subscription-Commands.html#index-u-_0028Group_0029&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-group-unsubscribe-current-group&lt;/code&gt;&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-03-23T04:31:17.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21177" PostTypeId="2" ParentId="21158" CreationDate="2016-03-23T08:35:04.527" Score="1" Body="&lt;p&gt;The &lt;code&gt;defun&lt;/code&gt;-form below defines a new interactive command that does the job.&#xA;If you need this functionality more often you can put this &lt;code&gt;defun&lt;/code&gt;-form into your initialization file &lt;code&gt;~/.emacs&lt;/code&gt;. If you need it only once you can put it into your &lt;code&gt;*scratch*&lt;/code&gt; buffer place point behind the last closing parenthesis and evaluate it with the key sequence &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-e&lt;/kbd&gt;. Note, this evaluates just the definition but not the command itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first argument of &lt;code&gt;defun&lt;/code&gt; is the name of the newly defined command -- &lt;code&gt;James-move-files&lt;/code&gt; in our case.&#xA;You can call this command with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;James-move-files&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;. The &lt;code&gt;interactive&lt;/code&gt; form in the command definition causes that the command interactively asks you for all the needed arguments of the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second argument of &lt;code&gt;James-move-files&lt;/code&gt; is the list of the arguments of this command.&#xA;The third argument is the comment string. This comment string is presented to you when you type &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;James-move-files&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;. You can use the key sequence &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;f&lt;/kbd&gt; on any of the keywords in the definition of &lt;code&gt;James-move-files&lt;/code&gt; to learn more about its functionality.&#xA;There is more detailed help in the &lt;code&gt;elisp&lt;/code&gt;-info files &lt;kbd&gt;C-h i&lt;/kbd&gt; &lt;kbd&gt;m&lt;/kbd&gt; &lt;code&gt;elisp&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;. You can search that manual with the incremental search &lt;kbd&gt;C-s&lt;/kbd&gt; &lt;code&gt;foo&lt;/code&gt;. Even if tells you &lt;code&gt;Failing search: ... [end of node]&lt;/code&gt; press &lt;kbd&gt;C-s&lt;/kbd&gt; again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that the help string of &lt;code&gt;James-move-files&lt;/code&gt; is good enough for you to use this function.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun James-move-files (pattern-file path-with-folders folder-name-pattern file-name-pattern target-dir)&#xA;  &quot;Copy files matching a regular expression from a series of folders from a given path. The folders are identified by IDs collected from a pattern file.&#xA;The arguments of this command are:&#xA;&#xA;PATTERN-FILE: Ascii file containing IDs. Separator&#xA;may be spaces, form feeds, tabs, line feeds, carry returns, or&#xA;vertical tabs&#xA;&#xA;PATH-WITH-FOLDERS: Path where to find the folders with names marked by the IDs.&#xA;&#xA;FOLDER-NAME-PATTERN: Regular expression matching a folder name with ID as first group. You can use \\([0-9]+\\) as group part of the regular expression if you want to match numbers.&#xA;&#xA;FILE-NAME-PATTERN: Regular expression that matches the file to copy from the folder. Example: .*_dc_brain_FA\\.nii&#xA;&#xA;TARGET-DIR: Target directory for the files to copy.&#xA;&quot;&#xA;  (interactive &quot;fPattern file:\nDPath with folders:\nsFolder name pattern:\nsFile name pattern:\nDTarget directory:&quot;)&#xA;  (with-current-buffer (find-file pattern-file)&#xA;    (let* ((list-of-patterns (split-string (buffer-string) nil t))&#xA;       (path (directory-file-name path-with-folders))) ; without trailing slash /&#xA;      (mapc (lambda (folder)&#xA;          (when (and (file-directory-p folder)&#xA;             (string-match folder-name-pattern folder)&#xA;             (member (match-string 1 folder) list-of-patterns))&#xA;        (mapc (lambda (file)&#xA;            (copy-file file target-dir))&#xA;              (directory-files (concat path &quot;/&quot; folder) t file-name-pattern))))&#xA;        (directory-files path)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-03-23T08:56:46.690" LastActivityDate="2016-03-23T08:56:46.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21178" PostTypeId="2" ParentId="21158" CreationDate="2016-03-23T09:34:48.997" Score="0" Body="&lt;p&gt;Like wvxvw and Tyler, I'd use other tools for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the following shell command would do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;find SOURCEDIR -name &quot;*_dc_brain_FA.nii&quot; | grep -f PATTERNFILE | xargs -d &quot;\n&quot; cp -t TARGETDIR&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where SOURCEDIR is where the files are now; TARGETDIR is the directory you want the files to end up in; and PATTERNFILE is the name of a file containing the patterns to grep for (one per line) derived from the csv file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would, of course, need to ensure that each pattern can match only one of the files; so the patterns should &lt;em&gt;probably&lt;/em&gt; not just be numbers! (Perhaps the numbers wrapped by underscores would be suitable?)&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-03-23T09:34:48.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21179" PostTypeId="1" CreationDate="2016-03-23T09:41:48.387" Score="8" ViewCount="494" Body="&lt;p&gt;Currently I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(checkdoc)&#xA;(byte-compile-file (buffer-file-name))&#xA;(package-buffer-info)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to validate Elisp code. This takes me some stupid errors and it is easy to resolve them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code intending can be checked via &lt;kbd&gt;C-x h&lt;/kbd&gt; &lt;kbd&gt;C-M-\&lt;/kbd&gt; &lt;kbd&gt;C-x C-s&lt;/kbd&gt; &lt;kbd&gt;M-x vc-diff&lt;/kbd&gt; if file under VCS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What methods should I use to validate Elisp code for common errors?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-03-23T09:47:25.730" LastActivityDate="2016-03-23T09:55:02.937" Title="Validating / linting Elisp code" Tags="|package-development|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21180" PostTypeId="1" AcceptedAnswerId="21184" CreationDate="2016-03-23T09:42:58.990" Score="10" ViewCount="3084" Body="&lt;p&gt;Is there some way to download and show a file from a URI/URL?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now I can use &lt;code&gt;wget&lt;/code&gt; and then open the downloaded file and I guess I could even try to write myself a small function to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But most likely someone did before me so is there a function/package that will let me get a file from the internets (would be great if it did not save the file somewhere first) and open it in a new buffer?&lt;/p&gt;&#xA;" OwnerUserId="11024" LastEditorUserId="5213" LastEditDate="2016-04-30T11:36:05.033" LastActivityDate="2021-02-05T22:17:39.600" Title="Is there a way to show/open a file from a URI/URL" Tags="|find-file|url|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21181" PostTypeId="2" ParentId="21179" CreationDate="2016-03-23T09:55:02.937" Score="6" Body="&lt;p&gt;There are a couple of other options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;elint-defun&lt;/code&gt;, &lt;code&gt;elint-file&lt;/code&gt;, and friends which are built-in to Emacs.  elint mainly looks for undefined variables, misspellings, and wrong function calls.  I found it of little use, since the byte compiler nowadays catches most (if not all) of these errors too.  It's also painfully slow since it analyses all dependent libraries as well, and even worse, regularly chokes on macros.  For instance, applying elint on code that makes heavy use of &lt;code&gt;pcase&lt;/code&gt; delivers an awful lot of false positives.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/purcell/flycheck-package&quot;&gt;flycheck-package&lt;/a&gt; provides some nice lints beyond the byte compiler and checkdoc.  MELPA maintainers use it to check submitted packages as far as I know, and I myself use it in my packages to protect against formatting flaws in package headers.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other than that, though, there's nothing on the linting table for Emacs Lisp.  Particularly, we miss linters that catch for unidiomatic code, wrong API use, missing things, etc.  For instance, there's nothing that tells you that you should replace references to &lt;code&gt;~/.emacs.d&lt;/code&gt; in your Elisp code with &lt;code&gt;user-emacs-directory&lt;/code&gt; or even better &lt;code&gt;locate-user-emacs-file&lt;/code&gt;, or warns about &lt;code&gt;defcustom&lt;/code&gt;s with missing &lt;code&gt;:type&lt;/code&gt; or &lt;code&gt;:group&lt;/code&gt;, etc.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-03-23T09:55:02.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21182" PostTypeId="1" AcceptedAnswerId="21186" CreationDate="2016-03-23T09:56:01.167" Score="6" ViewCount="249" Body="&lt;p&gt;Cycling through indentation levels in &lt;code&gt;python.el&lt;/code&gt; &lt;a href=&quot;https://stackoverflow.com/questions/25838448/cycling-through-possible-indentations-in-python-el-in-emacs&quot;&gt;1&lt;/a&gt; can be achieved by pressing &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; repeatedly, which is bound to &lt;code&gt;indent-for-tab-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, consider:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun malb/my-indent (&amp;amp;optional arg)&#xA;    (interactive &quot;P&quot;)&#xA;    (indent-for-tab-command arg))&#xA;(bind-key &quot;C-&amp;lt;tab&amp;gt;&quot; #'malb/my-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, pressing &lt;code&gt;C-&amp;lt;tab&amp;gt;&lt;/code&gt; repeatedly does not lead to cycling through indentation levels. On the other hand,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key &quot;C-&amp;lt;tab&amp;gt;&quot; #'indent-for-tab-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does lead to the desired outcome. Hence, somehow, calling &lt;code&gt;indent-for-tab-command&lt;/code&gt; from another function behaves differently from calling it directly. Can anyone explain why that is?&lt;/p&gt;&#xA;" OwnerUserId="8930" LastEditorUserId="5213" LastEditDate="2016-04-30T10:11:44.767" LastActivityDate="2016-04-30T10:11:44.767" Title="Python cycling through indentation" Tags="|indentation|python|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21184" PostTypeId="2" ParentId="21180" CreationDate="2016-03-23T11:32:37.177" Score="17" Body="&lt;pre&gt;&lt;code&gt;M-x url-handler-mode&#xA;C-x C-f http://emacs.stackexchange.com/questions/21180/is-there-a-way-to-show-open-a-file-from-a-uri-url&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This opens the HTML file of this stackexchange question in your Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-23T11:32:37.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21185" PostTypeId="2" ParentId="21150" CreationDate="2016-03-23T15:17:04.573" Score="1" Body="&lt;p&gt;This seems to be a bug (or a feature) in Org 8.2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Removing &lt;code&gt;org-agenda-max-todos&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; &lt;code&gt;org-agenda-max-entries&lt;/code&gt; options fixes it, restoring display of appointments &lt;em&gt;and&lt;/em&gt; the time grid.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2016-03-23T15:17:04.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21186" PostTypeId="2" ParentId="21182" CreationDate="2016-03-23T16:32:38.050" Score="6" Body="&lt;p&gt;If you follow through the code of &lt;code&gt;indent-for-tab-command&lt;/code&gt;, you'll see the indentation is actually done by a &lt;code&gt;indent-line-function&lt;/code&gt;. In Python mode, this is &lt;code&gt;python-indent-line-function&lt;/code&gt;. The help for this function indicates that the cycling behaviour is only triggered if the previous command is in the list &lt;code&gt;python-indent-trigger-commands&lt;/code&gt;. &lt;code&gt;malb/myindent&lt;/code&gt; isn't in that list of course, so it doesn't work as you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can fix this by adding your function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'python-indent-trigger-commands 'malb/my-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-03-23T16:32:38.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21187" PostTypeId="2" ParentId="21182" CreationDate="2016-03-23T16:56:31.697" Score="3" Body="&lt;p&gt;The &lt;a href=&quot;https://emacs.stackexchange.com/a/21186/93&quot;&gt;answer by Tyler&lt;/a&gt; is correct.  I wanted to point out an alternative (but inferior) way to solve the problem.  If it weren't for the variable &lt;code&gt;python-indent-trigger-commands&lt;/code&gt; that Tyler pointed out, you might be stuck with finding a way of letting your command &lt;code&gt;malb/my-indent&lt;/code&gt; masquerade as &lt;code&gt;intend-for-tab-command&lt;/code&gt;.  One way to achieve that would be as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-indent (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (if (not (called-interactively-p))&#xA;      (indent-for-tab-command arg)&#xA;    (setq this-command 'indent-for-tab-command)&#xA;    (call-interactively 'indent-for-tab-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This allows your wrapper layer to be more of a transparent pass-through.  In your specific case, the use of &lt;code&gt;call-interactively&lt;/code&gt; is not strictly necessary to achieve the desired effect, but it is in many other cases where you want to provide a wrapper around an existing command.  That is because many commands behave differently depending on whether they were called interactively or called from lisp.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-03-23T16:56:31.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21188" PostTypeId="1" AcceptedAnswerId="21201" CreationDate="2016-03-23T17:44:35.310" Score="9" ViewCount="1820" Body="&lt;p&gt;When using &lt;code&gt;use-package&lt;/code&gt;, is there a way to associate more than one file extension with a particular mode in one place instead of multiple locations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case in point is that I would like to associate both &lt;code&gt;js&lt;/code&gt; and &lt;code&gt;jsx&lt;/code&gt; files with js2-mode. Currently what I have is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package js2-mode&#xA;  :mode &quot;\\.js\\'&quot;&#xA;  :init&#xA;  (setq js2-highlight-level 3) &#xA;  (add-hook 'js2-mode-hook (lambda () (auto-revert-mode)&#xA;                                      (setq auto-revert-interval 0.1)))&#xA;  :ensure t)&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.jsx\\'&quot; . js2-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... which I don't like as the extensions are specified in two different places.&lt;/p&gt;&#xA;" OwnerUserId="4003" LastEditorUserId="7045" LastEditDate="2016-04-30T13:54:39.463" LastActivityDate="2021-10-07T17:14:11.233" Title="How to associate more than one file extension with a given mode in `use-package`" Tags="|major-mode|use-package|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21189" PostTypeId="1" CreationDate="2016-03-23T17:56:56.377" Score="6" ViewCount="243" Body="&lt;p&gt;Given the following org data :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* PROJECT NAME&#xA;** task 1&#xA;  CLOCK: [2016-03-21 Mon 09:50]--[2016-03-21 Mon 10:03] =&amp;gt;  0:13&#xA;my comment on task1&#xA;** task 2                               &#xA;mycomment on task2&#xA;  CLOCK: [2016-03-21 Mon 11:00]--[2016-03-21 Mon 12:00] =&amp;gt;  1:00&#xA;** task 3                                &#xA;  CLOCK: [2016-03-22 Tue 12:00]--[2016-03-22 Tue 13:30] =&amp;gt;  1:30&#xA;my comment on task3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to have a clocktable with &quot;CLOCKED&quot; timestamps, such as this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable  :scope file :block month :timestamp t&#xA;| Timestamp                                      | Headline     | Time   |      |&#xA;|------------------------------------------------+--------------+--------+------|&#xA;|                                                | *Total time* | *2:43* |      |&#xA;|------------------------------------------------+--------------+--------+------|&#xA;|                                                | PROJECT NAME | 2:43   |      |&#xA;| [2016-03-21 Mon 10:50]--[2016-03-21 Mon 11:03] | \_  task 1   |        | 0:13 |&#xA;| [2016-03-21 Mon 11:00]--[2016-03-21 Mon 12:00] | \_  task 2   |        | 1:00 |&#xA;| [2016-03-22 Tue 12:00]--[2016-03-22 Tue 13:30] | \_  task 3   |        | 1:30 |&#xA;#+END&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem : &lt;code&gt;timestamp :t&lt;/code&gt; in the clocktable command looks for&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;SCHEDULED, DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order (as per the manual)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Not for &lt;code&gt;CLOCK&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I get the clock data inside the clocktable?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formulas obviously come to mind, but could not find one to do the trick. &lt;a href=&quot;http://orgmode.org/manual/Special-properties.html&quot;&gt;Special properties&lt;/a&gt; don't do the trick either. I'm stuck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="11476" LastActivityDate="2016-03-23T17:56:56.377" Title="CLOCK timestamp field in clocktable" Tags="|org-mode|org-clock-table|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21190" PostTypeId="2" ParentId="17249" CreationDate="2016-03-23T18:00:32.747" Score="5" Body="&lt;p&gt;Like Mark said, Terminal and iTerm 2 invoke shells as login shells by default, so that Bash reads &lt;code&gt;~/.bash_profile&lt;/code&gt; but not &lt;code&gt;~/.bashrc&lt;/code&gt;, but &lt;code&gt;M-x shell&lt;/code&gt; and &lt;code&gt;M-x term&lt;/code&gt; invoke shells as non-login shells, so that Bash reads &lt;code&gt;~/.bashrc&lt;/code&gt; but not &lt;code&gt;~/.bash_profile&lt;/code&gt;. Either add &lt;code&gt;. ~/.bash_profile&lt;/code&gt; to &lt;code&gt;~/.bashrc&lt;/code&gt; and keep using &lt;code&gt;~/.bash_profile&lt;/code&gt; as your Bash configuration file, or add &lt;code&gt;. ~/.bashrc&lt;/code&gt; to &lt;code&gt;~/.bash_profile&lt;/code&gt; and start using &lt;code&gt;~/.bashrc&lt;/code&gt; as your Bash configuration file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make &lt;code&gt;shell-command&lt;/code&gt; and &lt;code&gt;shell-command-on-region&lt;/code&gt; read &lt;code&gt;~/.bash_profile&lt;/code&gt;, add &lt;code&gt;-l&lt;/code&gt; to &lt;code&gt;shell-command-switch&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shell-command-switch &quot;-lc&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can set an OS X wide default path by for example saving a property list like this as &lt;code&gt;~/Library/LaunchAgents/startup.plist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&#xA;&amp;lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&amp;gt;&#xA;&amp;lt;plist version=&quot;1.0&quot;&amp;gt;&#xA;&amp;lt;dict&amp;gt;&#xA;  &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;&#xA;  &amp;lt;string&amp;gt;startup&amp;lt;/string&amp;gt;&#xA;  &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;&#xA;  &amp;lt;array&amp;gt;&#xA;    &amp;lt;string&amp;gt;sh&amp;lt;/string&amp;gt;&#xA;    &amp;lt;string&amp;gt;-c&amp;lt;/string&amp;gt;&#xA;    &amp;lt;string&amp;gt;launchctl setenv PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin&amp;lt;/string&amp;gt;&#xA;  &amp;lt;/array&amp;gt;&#xA;  &amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;&#xA;  &amp;lt;true/&amp;gt;&#xA;&amp;lt;/dict&amp;gt;&#xA;&amp;lt;/plist&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The new path should be shown in terminal applications, Emacs, and other applications after you log out and back in. This method does not change the path in applications that are opened as login items or that are reopened at login after a forced shutdown. If you have Emacs, a terminal application, or other applications where you want to change the path in login items, you'll have to remove them.&lt;/p&gt;&#xA;" OwnerUserId="11170" LastActivityDate="2016-03-23T18:00:32.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21191" PostTypeId="1" AcceptedAnswerId="21196" CreationDate="2016-03-23T18:54:43.277" Score="1" ViewCount="490" Body="&lt;p&gt;I am using &lt;a href=&quot;https://github.com/milkypostman/powerline&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; powerline and have trouble modifying the theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my config for powerline:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; My theme and setting for powerline&#xA;&#xA;;; include original powerline&#xA;(require 'powerline)&#xA;;; theme&#xA;;; (powerline-default-theme) ;; old theme&#xA;;; (powerline-center-evil-theme)&#xA;&#xA;&#xA;;; handle different color based on mode&#xA;(defun MCSH-get-color ()&#xA;  &quot;Get the collor for current mode&quot;&#xA;  (interactive)&#xA;  (setq MCSH-evil-mode (symbol-name evil-state))&#xA;  (cond&#xA;   ((eq MCSH-evil-mode &quot;normal&quot;) &quot;goldenrod&quot;)&#xA;   ((eq MCSH-evil-mode &quot;insert&quot;) &quot;blue&quot;)&#xA;   (t &quot;grey11&quot;) ;; Default&#xA;   ))&#xA;&#xA;&#xA;(defface MCSH-evil-active-face-default '((t (:background &quot;grey11&quot;                                            :inherit mode-line)))&#xA;  &quot;Powerline face1.&quot;&#xA;  :group 'powerline)&#xA;&#xA;(defface MCSH-evil-inactive-face-default&#xA;  '((t (:background &quot;grey11&quot; :inherit mode-line-inactive)))&#xA;  &quot;Powerline face 1.&quot;&#xA;  :group 'powerline)&#xA;&#xA;(defun MCSH-evil-face (active)&#xA;  (interactive)&#xA;  &quot;Get face for current mode&quot;&#xA;  (let* ((face (intern (concat &quot;MCSH-evil-&quot; (if active &quot;active&quot;     &quot;inactive&quot;) &quot;-&quot; (symbol-name evil-state) ))))&#xA;    (if (facep face) face (intern (concat &quot;MCSH-evil-&quot; (if active     &quot;active&quot; &quot;inactive&quot;)  &quot;-default&quot;)))&#xA;  ))&#xA;&#xA;;; my custom theme&#xA;(defun powerline-evil-MCSH-theme ()&#xA;  &quot;Setup a mode-line with major, evil, and minor modes centered.&quot;&#xA;  (interactive)&#xA;  (setq-default mode-line-format&#xA;        '(&quot;%e&quot;&#xA;          (:eval&#xA;           (let* ((active (powerline-selected-window-active))&#xA;              (mode-line (if active 'mode-line 'mode-line-inactive))&#xA;              (face1 (if active 'powerline-active1 'powerline-    inactive1))&#xA;              (face2 (if active 'powerline-active2 'powerline-    inactive2))&#xA;              (facemode (MCSH-evil-face active))&#xA;              ;;(facemode face1)&#xA;              (separator-left (intern (format &quot;powerline-%s-%s&quot;&#xA;                              (powerline-current-separator)&#xA;                              (car powerline-default-separator-    dir))))&#xA;              (separator-right (intern (format &quot;powerline-%s-%s&quot;&#xA;                               (powerline-current-separator)&#xA;                               (cdr powerline-default-separator-    dir))))&#xA;              (lhs (list (powerline-raw &quot;%*&quot; nil 'l)&#xA;                     (powerline-buffer-size nil 'l)&#xA;                     (powerline-buffer-id nil 'l)&#xA;                     (powerline-raw &quot; &quot;)&#xA;                     (funcall separator-left mode-line face1)&#xA;                     (powerline-narrow face1 'l)&#xA;                     (powerline-vc face1)))&#xA;              (rhs (list (powerline-raw global-mode-string face1 'r)&#xA;                     (powerline-raw &quot;%4l&quot; face1 'r)&#xA;                     (powerline-raw &quot;:&quot; face1)&#xA;                     (powerline-raw &quot;%3c&quot; face1 'r)&#xA;                     (funcall separator-right face1 mode-line)&#xA;                     (powerline-raw &quot; &quot;)&#xA;                     (powerline-raw &quot;%6p&quot; nil 'r)&#xA;                     (powerline-hud face2 face1)&#xA;                     ))&#xA;              (center (append (list (powerline-raw &quot; &quot; face1)&#xA;                        (funcall separator-left face1 face2)&#xA;                        (when (and (boundp 'erc-track-minor-mode)     erc-track-minor-mode)&#xA;                          (powerline-raw erc-modified-channels-    object face2 'l))&#xA;                        (powerline-major-mode face2 'l)&#xA;                        (powerline-process face2)&#xA;                        (powerline-raw &quot; &quot; face2))&#xA;                      (if (split-string (format-mode-line minor-    mode-alist))&#xA;                          (append (if evil-mode&#xA;                              (list (funcall separator-right face2     facemode)&#xA;                                (powerline-raw evil-mode-line-tag facemode 'l)&#xA;                                (powerline-raw &quot; &quot; facemode)&#xA;                                (funcall separator-left facemode face2)))&#xA;                              (list (powerline-minor-modes face2 'l)&#xA;                                (powerline-raw &quot; &quot; face2)&#xA;                                (funcall separator-right face2 face1)))&#xA;                        (list (powerline-raw evil-mode-line-tag face2)&#xA;                          (funcall separator-right face2 face1))))))&#xA;             (concat (powerline-render lhs)&#xA;                 (powerline-fill-center face1 (/ (powerline-width center) 2.0))&#xA;                 (powerline-render center)&#xA;                 (powerline-fill face1 (powerline-width rhs))&#xA;                 (powerline-render rhs)))))))&#xA;&#xA;(powerline-evil-MCSH-theme)&#xA;&#xA;(provide 'powerline-MCSH)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this doesn't render properly: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice the gray line at the botton:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ZA8Xu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZA8Xu.png&quot; alt=&quot;Notice the gray line at bottom&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I un-comment this line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;(facemode face1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which would basically do what the original powerline-center-evil-theme does, the result would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice the bottom:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/pduTa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pduTa.png&quot; alt=&quot;Notice the bottom&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I want to change background of the face based on the evil state. But this doesn't seem to work. (as of now, only one other background is implemented but that should work because if there isn't any face it would use the default one)&lt;/p&gt;&#xA;" OwnerUserId="11496" LastEditorUserId="160" LastEditDate="2016-03-24T01:17:17.383" LastActivityDate="2016-03-24T01:17:17.383" Title="Powerline not rendering after adding another face" Tags="|init-file|evil|faces|powerline|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21192" PostTypeId="2" ParentId="21188" CreationDate="2016-03-23T19:05:22.717" Score="15" Body="&lt;p&gt;The following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(use-package js2-mode&#xA;  :mode ((&quot;\\.js\\'&quot; . js2-mode)&#xA;         (&quot;\\.jsx\\'&quot; . js2-mode))&#xA;  ...&#xA;  :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8379" LastEditorUserId="160" LastEditDate="2016-03-24T01:20:04.977" LastActivityDate="2016-03-24T01:20:04.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21193" PostTypeId="1" CreationDate="2016-03-23T19:55:24.550" Score="3" ViewCount="460" Body="&lt;p&gt;I was searching whether is is possible to edit a document from ShareLaTeX using Emacs in real time. Up to now I haven't find anything to do the job. So my question is if there is a good and reliable way to do that.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2016-03-23T20:03:25.957" LastActivityDate="2016-03-23T20:03:25.957" Title="Edit ShareLaTeX document using Emacs" Tags="|latex|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21196" PostTypeId="2" ParentId="21191" CreationDate="2016-03-23T23:18:56.703" Score="1" Body="&lt;p&gt;Okay, I can not believe I made this mistake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a &lt;code&gt;-face&lt;/code&gt; in the names, which (being new to emacs) I thought is necessary, but apparently it is part of the name (I must have misinterpreted some docs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Removing them solved the problem.&lt;/p&gt;&#xA;" OwnerUserId="11496" LastActivityDate="2016-03-23T23:18:56.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21197" PostTypeId="1" AcceptedAnswerId="21198" CreationDate="2016-03-24T08:06:06.253" Score="0" ViewCount="389" Body="&lt;p&gt;I want to replace helm-projectile-grep with helm-projectile-ag without using default binding (C-c p s s). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if I use helm-projectile-switch-project (C-c p p), then in the helm window I press C-s, then it will invoke helm-projectile-grep, but I want to use helm-projectile-ag instead because it's faster. I don't know what other search action will invoke helm-projectile-grep, but whenever I call the function, I want it to call helm-projectile-ag instead. Is it possible, how can I map it in my .emacs?&lt;/p&gt;&#xA;" OwnerUserId="11298" LastEditorUserId="5213" LastEditDate="2016-03-24T12:52:15.303" LastActivityDate="2016-03-24T12:52:15.303" Title="How can I map helm-projectile-grep to helm-projectile-ag?" Tags="|helm|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21198" PostTypeId="2" ParentId="21197" CreationDate="2016-03-24T10:02:36.420" Score="0" Body="&lt;p&gt;Maybe you can try to redefine &lt;code&gt;helm-projectile-grep&lt;/code&gt; to meet your need. In order to avoid confusion, use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow&quot;&gt;Advising&lt;/a&gt; instead of a plain &lt;code&gt;defun&lt;/code&gt; here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-advice helm-projectile-grep (:override (&amp;amp;optional dir) ag)&#xA;  (helm-do-ag (or dir (projectile-project-root))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;define-advice&lt;/code&gt; macro was added to Emacs recently, if you don't have it, then use &lt;code&gt;advice-add&lt;/code&gt;. Since Emacs can advice a function without know it, you can put this anywhere in your Emacs initialization file.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-03-24T10:02:36.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21200" PostTypeId="1" CreationDate="2016-03-24T11:18:58.800" Score="0" ViewCount="274" Body="&lt;p&gt;I have Slime configured with fuzzy completion and it works perfectly when I'm using it in X11 mode (&lt;kbd&gt;M-TAB&lt;/kbd&gt;, list of completions pops up in a separate buffer, &lt;kbd&gt;C-n/p&lt;/kbd&gt; allows to choose the right completion, &lt;kbd&gt;TAB&lt;/kbd&gt; makes use of chosen completion). However, when I run Emacs in TTY mode (&lt;code&gt;-nw&lt;/code&gt; option), that last step fails, i.e. I get a list of completions, can navigate across them, but pressing &lt;kbd&gt;TAB&lt;/kbd&gt; on my choice does not select it. I am, however, able to select it by pressing &lt;kbd&gt;Enter&lt;/kbd&gt;, but this also results in a newline being inserted, which is annoying. Any idea why there is such a discrepancy between those two modes? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs version &lt;code&gt;26.0.50.2&lt;/code&gt; (but this also happened in previous versions - 24 and 25). My Slime version is &lt;code&gt;20161109.640&lt;/code&gt; (installed from MELPA). Below is the part of the config relevant to Slime:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;;;;;;;;;;;;;;;&#xA;;; Common Lisp ;;&#xA;;;;;;;;;;;;;;;;;;&#xA;&#xA;(setq auto-mode-alist&#xA;      (append auto-mode-alist&#xA;          '((&quot;\\.cl\\'&quot; . lisp-mode)&#xA;        (&quot;\\.lsp\\'&quot; . lisp-mode))))&#xA;(slime-setup '(slime-fancy&#xA;           slime-media&#xA;           slime-asdf&#xA;           slime-tramp))&#xA;(setq slime-enable-evaluate-in-emacs t)&#xA;(add-to-list 'slime-contribs 'slime-autodoc)&#xA;(add-to-list 'slime-contribs 'slime-trace-dialog)&#xA;(setq slime-complete-symbol*-fancy t)&#xA;(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5198" LastEditorUserId="5198" LastEditDate="2016-12-20T14:48:37.583" LastActivityDate="2016-12-20T14:48:37.583" Title="Slime fuzzy completion not working correctly in TTY mode" Tags="|terminal-emacs|x11|slime|common-lisp|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21201" PostTypeId="2" ParentId="21188" CreationDate="2016-03-24T13:46:29.493" Score="10" Body="&lt;p&gt;Use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:mode &quot;\\.jsx?\\'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remember: all those backslashes are there because it's a regexp, so you really want to take advantage of it when you can, otherwise you're just suffering through those backslashes for nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also write it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:mode &quot;\\.\\(js\\|jsx\\)\\'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or many other ways, of course.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-03-24T15:22:37.157" LastActivityDate="2016-03-24T15:22:37.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21204" PostTypeId="2" ParentId="4253" CreationDate="2016-03-24T21:21:39.307" Score="2" Body="&lt;p&gt;Here is a little script based on @Phil's answer and comment about changing the &lt;code&gt;HOME&lt;/code&gt; environment variable, and then restoring it within Emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-bash prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/bash&#xA;&#xA;# Use it like this:&#xA;#   /path/to/this/script  EMACS_USER_DIRECTORY  [OTHER EMACS ARGS]&#xA;&#xA;# You can never be too careful&#xA;set -e&#xA;&#xA;# First arg = emacs user directory&#xA;#   (get a canonical, absolute path)&#xA;EMACS_USER_DIRECTORY=$(readlink -f &quot;$1&quot;)&#xA;shift&#xA;if [ ! -d &quot;${EMACS_USER_DIRECTORY}&quot; ]; then&#xA;    echo &quot;Non-existent directory: '${EMACS_USER_DIRECTORY}'&quot;&#xA;    exit 1&#xA;fi&#xA;&#xA;# Bootstrap directory&#xA;BOOTSTRAP=$(mktemp --directory --tmpdir .emacs-bootstrap.XXXXXX)&#xA;mkdir &quot;${BOOTSTRAP}/.emacs.d&quot;&#xA;&#xA;# Bootstrap init file&#xA;cat &amp;gt;&quot;${BOOTSTRAP}/.emacs.d/init.el&quot; &amp;lt;&amp;lt;EOF&#xA;  ;; # Correctly set-up emacs-user-directory&#xA;  (setq user-emacs-directory &quot;${EMACS_USER_DIRECTORY}/&quot;)&#xA;  (setq user-init-file (concat user-emacs-directory &quot;init.el&quot;))&#xA;&#xA;  ;; # Reset the HOME environment variable&#xA;  (setenv &quot;HOME&quot; &quot;${HOME}&quot;)&#xA;&#xA;  ;; # Load the real init file and clean-up afterwards&#xA;  (unwind-protect (load user-init-file)&#xA;    (delete-directory &quot;${BOOTSTRAP}&quot; :recursive))&#xA;EOF&#xA;&#xA;# Forward remaining arguments to emacs&#xA;exec env HOME=&quot;${BOOTSTRAP}&quot; emacs &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="221" LastActivityDate="2016-03-24T21:21:39.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21205" PostTypeId="1" AcceptedAnswerId="21207" CreationDate="2016-03-24T22:16:24.193" Score="25" ViewCount="4868" Body="&lt;p&gt;A lot of projects I work on install eslint as a dev dependency, with a custom set of eslint plugins. Right now, flycheck uses the globally installed version of eslint rather than the version of eslint installed with each project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to make flycheck point to node_modules/eslint/bin/eslint.js instead. The full path should depend on the path of the current buffer's file so I can be working on multiple projects at the same time with each buffer using a potentially different eslint executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? Any suggestions for how I would go about doing this?&lt;/p&gt;&#xA;" OwnerUserId="11517" LastActivityDate="2019-11-22T22:41:13.630" Title="Flycheck with file relative eslint executable" Tags="|flycheck|" AnswerCount="6" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21206" PostTypeId="1" CreationDate="2016-03-24T22:20:26.133" Score="4" ViewCount="2066" Body="&lt;p&gt;I know this may have been answered before, but the point is these questions seems to be asked by people who have experience with emacs, lisp, and org mode but not for beginner. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, sorry for such a simple question. But can anyone explain in detail on the steps required to end up producing latex preview on my .org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is super confusing to me when the org-mode document explains things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Previewing-LaTeX-fragments.html#Previewing-LaTeX-fragments&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Previewing-LaTeX-fragments.html#Previewing-LaTeX-fragments&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) In the above link, it says &quot;You can customize the variables org-format-latex-options and org-format-latex-header to influence some aspects of the preview.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where and how exactly can I do this. I am so confused. Not sure if I need it though&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)  #+STARTUP: latexpreview&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting this at the top of my file doesn't help to preview latex. I already have dvipng installed on my system (it is Mac)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) When should I use M-x bla_bla_bla and when should I use commands (C-c C-c etc.) instead? Are these commands just the shortcuts for the long phrase bla-bla-bla?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) I have also added the following in my .emacs file.&#xA;(setq org-latex-create-formula-image-program 'dvipng)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) If I do C-c C-c within the code block, I get the error saying &quot;No org-babel-execute function for latex!&quot;. I do have &quot;latex . t&quot; in my .emacs. That is not the reason I guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) For example the following link tells about packages in latex. But where do I put those things? in .org or in .emacs. if so how?&#xA;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-preview.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/org-latex-preview.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following is what I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: latexpreview&#xA;* COMMENT Testings&#xA;\[&#xA;e^{i\pi} = -1&#xA;\]&#xA;#+BEGIN_SRC latex                                                                                                                                                                                                                                                             &#xA;\documentclass{article}                                                                                                                                                                                                                                                       &#xA;&#xA;\begin{document}                                                                                                                                                                                                                                                              &#xA;&#xA;\[                                                                                                                                                                                                                                                                            &#xA;e^{i\pi} = -1                                                                                                                                                                                                                                                                 &#xA;\]                                                                                                                                                                                                                                                                            &#xA;&#xA;\[                                                                                                                                                                                                                                                                            &#xA;\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}                                                                                                                                                                                                                              &#xA;\]                                                                                                                                                                                                                                                                            &#xA;&#xA;\end{document}                                                                                                                                                                                                                                                                &#xA;&#xA;#+END_SRC                                                                                                                                                                                                                                                                     &#xA;&#xA;#+BEGIN_SRC latex                                                                                                                                                                                                                                                             &#xA;\begin{equation}                                                                                                                                                                                                                                                              &#xA;x=\sqrt{b}                                                                                                                                                                                                                                                                    &#xA;\end{equation}                                                                                                                                                                                                                                                                &#xA;#+END_SRC &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;.emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-install)&#xA;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((python . t) (sh . t) (latex . t))&#xA; )&#xA;(setq org-latex-create-formula-image-program 'dvipng)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11518" LastEditorUserId="5213" LastEditDate="2016-04-30T14:12:52.870" LastActivityDate="2016-04-30T14:12:52.870" Title="Latex rendering and details" Tags="|org-mode|latex|terminal-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21207" PostTypeId="2" ParentId="21205" CreationDate="2016-03-24T22:31:39.520" Score="35" Body="&lt;p&gt;You can programmatically change &lt;code&gt;flycheck-javascript-eslint-executable&lt;/code&gt;, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/use-eslint-from-node-modules ()&#xA;  (let* ((root (locate-dominating-file&#xA;                (or (buffer-file-name) default-directory)&#xA;                &quot;node_modules&quot;))&#xA;         (eslint&#xA;          (and root&#xA;               (expand-file-name &quot;node_modules/.bin/eslint&quot;&#xA;                                 root))))&#xA;    (when (and eslint (file-executable-p eslint))&#xA;      (setq-local flycheck-javascript-eslint-executable eslint))))&#xA;&#xA;(add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code looks for a &lt;code&gt;node_modules&lt;/code&gt; directory in any parent of the buffer's directory and configures Flycheck to use an eslint executable from that directory if any exists.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="2506" LastEditDate="2019-03-28T06:56:54.600" LastActivityDate="2019-03-28T06:56:54.600" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="21208" PostTypeId="1" AcceptedAnswerId="21209" CreationDate="2016-03-24T22:39:27.760" Score="5" ViewCount="1040" Body="&lt;p&gt;I have following content in a org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* test&#xA;[[file:foo1.pdf][test file1]]&#xA;[[file:foo2.pdf][test file2]]&#xA;[[file:foo3.pdf][test file3]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Normally, the file name (eg &lt;code&gt;foo1.pdf&lt;/code&gt;) is folded and invisible. And when I do a search for &lt;code&gt;foo&lt;/code&gt; (with &lt;code&gt;ctrl-s&lt;/code&gt;), I can't find anything... How can I enable the isearch for those invisible text? I tried &lt;code&gt;M-s i&lt;/code&gt; on the isearch command and it does not work.&lt;/p&gt;&#xA;" OwnerUserId="6885" LastEditorUserId="5213" LastEditDate="2016-04-30T14:11:59.430" LastActivityDate="2016-04-30T14:11:59.430" Title="Search and replace invisible url link in org-mode" Tags="|org-mode|isearch|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21209" PostTypeId="2" ParentId="21208" CreationDate="2016-03-24T23:19:30.430" Score="7" Body="&lt;p&gt;Try &lt;code&gt;M-x org-toggle-link-display&lt;/code&gt; or the menu item &lt;code&gt;Org -&amp;gt; Hyperlinks -&amp;gt; Literal Links&lt;/code&gt; before using &lt;code&gt;isearch&lt;/code&gt; or &lt;code&gt;query-replace&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code does that automagically for you when you use &lt;code&gt;isearch&lt;/code&gt; or &lt;code&gt;query-replace&lt;/code&gt;/&lt;code&gt;query-replace-regexp&lt;/code&gt;. It restores the old state when you are done with searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code is tested with Emacs 25.1.50.2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Added &lt;code&gt;(setq-local search-invisible t)&lt;/code&gt; to search in texts that are hidden by the &lt;code&gt;invisible&lt;/code&gt; text property.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local org-descriptive-links-isearch nil&#xA;  &quot;Backup of the original value `org-descriptive-links' before isearch.&quot;)&#xA;&#xA;(defun org-isearch-mode-hook-function ()&#xA;  &quot;Save value of `org-descriptive-links' before isearch.&quot;&#xA;  (setq org-descriptive-links-isearch org-descriptive-links))&#xA;&#xA;(defun org-isearch-mode-end-hook-function ()&#xA;  &quot;Restore original value of `org-descriptive-links' after isearch.&quot;&#xA;  (unless (eq org-descriptive-links-isearch org-descriptive-links)&#xA;    (org-toggle-link-display)))&#xA;&#xA;(defun org-mode-isearch-filter (found)&#xA;  &quot;Toggle to literal links if match is found within a string that is hidden in the target of descriptive links.&quot;&#xA;  (when (and found&#xA;         (text-property-any (match-beginning 0) (match-end 0) 'invisible 'org-link)&#xA;         org-descriptive-links)&#xA;    (org-toggle-link-display))&#xA;  found)&#xA;&#xA;(defun org-query-replace-isearch-wrapper (oldfun &amp;amp;rest args)&#xA;  &quot;Toggle to literal links if match is found within a string that is hidden in the target of descriptive links.&quot;&#xA;  (org-isearch-mode-hook-function)&#xA;  (prog1 (apply oldfun args)&#xA;    (org-isearch-mode-end-hook-function)))&#xA;&#xA;(defun org-mode-setup-isearch ()&#xA;  &quot;Setup some specials for isearch in org-mode.&#xA;1. Toggle descriptive links if necessary.&quot;&#xA;  (setq-local search-invisible t)&#xA;  (add-hook 'isearch-mode-hook 'org-isearch-mode-hook-function)&#xA;  (add-hook 'isearch-mode-end-hook 'org-isearch-mode-end-hook-function)&#xA;  (add-function :filter-return (local 'isearch-filter-predicate) #'org-mode-isearch-filter)&#xA;  (advice-add 'query-replace :around #'org-query-replace-isearch-wrapper)&#xA;  (advice-add 'query-replace-regexp :around #'org-query-replace-isearch-wrapper))&#xA;&#xA;(add-hook 'org-mode-hook 'org-mode-setup-isearch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9605" LastEditorUserId="2370" LastEditDate="2016-03-25T19:14:34.720" LastActivityDate="2016-03-25T19:14:34.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21210" PostTypeId="1" CreationDate="2016-03-24T23:21:08.580" Score="5" ViewCount="1742" Body="&lt;p&gt;In many editors it is standard to move selected text by dragging and dropping it with the mouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs dragging selection with the mouse starts a new selection by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is extremely annoying, as normally (everywhere else) such a behavior is achieved by clicking mouse to deselect text first. Besides, I cannot imagine a single use case for this emacs behavior - starting a new selection immediately after the first one without doing anything with the first selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure emacs to drag existing selection like in all other editors?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="105" LastEditDate="2016-03-25T02:55:58.663" LastActivityDate="2019-03-19T12:26:50.067" Title="Drag selected text with the mouse" Tags="|text-editing|mouse|drag-and-drop|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21211" PostTypeId="2" ParentId="14463" CreationDate="2016-03-25T00:42:13.533" Score="52" Body="&lt;p&gt;As of magit 2.11.0 this is possible directly from the reset dispatcher (&lt;code&gt;X f&lt;/code&gt; and you may specify the revision and file):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LBMld.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LBMld.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be done programmatically within magit using &lt;code&gt;magit-file-checkout&lt;/code&gt; which accepts a version spec and the filename (thanks to @Emoses' feature request and @Kyle Meyer's implementation).  Previously the function was named &lt;code&gt;magit-checkout-file&lt;/code&gt; (from v2.3.0 - v2.9.0).  &lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2017-05-01T22:00:19.887" LastActivityDate="2017-05-01T22:00:19.887" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21212" PostTypeId="1" AcceptedAnswerId="21237" CreationDate="2016-03-25T03:06:19.157" Score="0" ViewCount="200" Body="&lt;p&gt;I enjoy using Jim Blandy's &lt;code&gt;dired-tar&lt;/code&gt; library for Emacs built on &lt;code&gt;*nix&lt;/code&gt; systems:  &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredTar&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/DiredTar&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am seeking to modify that library to support both &lt;code&gt;*nix&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; MS Windows -- i.e., when &lt;code&gt;eq system-type 'windows-nt&lt;/code&gt;.  [Any assistance in adding that support would be greatly appreciated.]&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-03-26T19:42:31.510" LastActivityDate="2016-03-27T00:22:59.003" Title="Modification of Jim Blandy's `dired-tar` -- Emacs for MS Windows" Tags="|dired|microsoft-windows|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21213" PostTypeId="2" ParentId="21212" CreationDate="2016-03-25T05:04:55.017" Score="0" Body="&lt;p&gt;Isn't the new compression support in Emacs 25 a superset of this feature? See &lt;a href=&quot;http://oremacs.com/2015/10/23/dired-compress/&quot; rel=&quot;nofollow&quot;&gt;http://oremacs.com/2015/10/23/dired-compress/&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, please clarify which parts of dired-tar do not work on Windows systems.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-03-25T05:04:55.017" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21214" PostTypeId="1" AcceptedAnswerId="21221" CreationDate="2016-03-25T06:36:47.687" Score="1" ViewCount="113" Body="&lt;p&gt;According to the docu of &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+&lt;/a&gt; this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bmkp-dired-jump BOOKMARK-NAME &amp;amp;optional FLIP-USE-REGION-P)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should allow to quickly jump to a dired buffer that has been bookmarked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to eval &lt;code&gt;(bmkp-dired-jump d_zh_tmp)&lt;/code&gt;&lt;br&gt;&#xA;thinking it should jump to a bookmark called &lt;code&gt;d_zh_tmp&lt;/code&gt; but instead I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eval-buffer: Symbol's value as variable is void: d_zh_tmp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any clue what I'm missing here?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2016-06-22T20:03:01.363" LastActivityDate="2016-06-22T20:03:01.363" Title="Jump to a bookmark+ dired bookmark from Lisp code" Tags="|debugging|variables|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21215" PostTypeId="1" CreationDate="2016-03-25T07:19:08.990" Score="1" ViewCount="36" Body="&lt;p&gt;On my Emacs (Aquamacs on OSX, latest version) the command Edit -&gt; Spelling -&gt; Mark All Misspellings goes through the whole file (from 0% to 100%) and then starts again at 0%, and continues ad infinitum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The menu item runs the command flyspell-buffer&#xA;(found in global-map), which is an interactive autoloaded compiled Lisp&#xA;function in ‘flyspell.el’.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot do anything else and have to abort Emacs to stop the command. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="11521" LastEditorUserId="-1" LastEditDate="2016-03-25T18:42:18.090" LastActivityDate="2016-03-25T18:42:18.090" Title="&quot;Mark all Misspellings&quot; never stops" Tags="|text-editing|spell-checking|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21216" PostTypeId="1" AcceptedAnswerId="21217" CreationDate="2016-03-25T07:41:34.013" Score="4" ViewCount="823" Body="&lt;p&gt;I would like to make a few changes to a package installed via &lt;code&gt;package-install&lt;/code&gt;. What's the canonical way to do so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that it would probably involve:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Uninstalling the package via &lt;code&gt;list-packages&lt;/code&gt;. (Is this necessary?)&lt;/li&gt;&#xA;&lt;li&gt;Place the package files manually somewhere under &lt;code&gt;~/.emacs.d&lt;/code&gt; (e.g. by cloning the Git repository)&lt;/li&gt;&#xA;&lt;li&gt;Tell Emacs to load the package from the new location. (How?)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6695" LastActivityDate="2016-03-25T14:27:04.383" Title="Edit/fork packages installed via package-install" Tags="|package|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21217" PostTypeId="2" ParentId="21216" CreationDate="2016-03-25T07:51:13.800" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Uninstalling the package via list-packages. (Is this necessary?)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Not at all. Just make sure that the git clone is ahead of ELPA on &lt;code&gt;load-path&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Place the package files manually somewhere under ~/.emacs.d (e.g. by cloning the Git repository)&#xA;  Tell Emacs to load the package from the new location. (How?)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have a dedicated &lt;code&gt;git/&lt;/code&gt; directory in my &lt;code&gt;site-lisp&lt;/code&gt;. And just clone there. This code will put all packages in &lt;code&gt;git/&lt;/code&gt; ahead of ELPA on the &lt;code&gt;load-path&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;(let ((emacs-git (expand-file-name &quot;git/&quot; emacs-d)))&#xA;  (mapc (lambda (x)&#xA;          (add-to-list 'load-path (expand-file-name x emacs-git)))&#xA;        (delete &quot;..&quot; (directory-files emacs-git))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-03-25T07:51:13.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21219" PostTypeId="2" ParentId="21216" CreationDate="2016-03-25T09:53:12.710" Score="4" Body="&lt;p&gt;If you wish to use the package manager for this (which is entirely reasonable -- it will take care of byte-compilation, ensure all the autoloads are processed, etc), then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Copy the package (somewhere that isn't in your Emacs &lt;code&gt;load-path&lt;/code&gt;) and make whatever changes you wish to make.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If it is a simple package built from a single &lt;code&gt;.el&lt;/code&gt; file (ignoring &lt;code&gt;*.elc&lt;/code&gt;, &lt;code&gt;*-pkg.el&lt;/code&gt;, and &lt;code&gt;*-autoloads.el&lt;/code&gt; files):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Update the version string in the &lt;code&gt;.el&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Invoke &lt;code&gt;package-install-file&lt;/code&gt; on the modified &lt;code&gt;.el&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If it is a complex package built from multiple files:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Update the version string in the &lt;code&gt;*-pkg.el&lt;/code&gt; file&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you're running Emacs 25+, invoke &lt;code&gt;package-install-file&lt;/code&gt; on the directory.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you're running Emacs 24, create a tar file of the directory (include the directory itself; not just its contents), and invoke &lt;code&gt;package-install-file&lt;/code&gt; on the tar file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You should be able to safely delete the unnecessary files from your modified source for the package (e.g. &lt;code&gt;*.elc&lt;/code&gt;, &lt;code&gt;*-autoloads.el&lt;/code&gt;, and for the simple package case, &lt;code&gt;*-pkg.el&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Packaging&lt;/code&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-03-25T10:06:02.183" LastActivityDate="2016-03-25T10:06:02.183" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21220" PostTypeId="1" AcceptedAnswerId="21227" CreationDate="2016-03-25T10:20:23.207" Score="7" ViewCount="2043" Body="&lt;p&gt;Is it possible to schedule something in Org for the 2nd Sunday of every month, or some criteria like this?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-03-25T14:43:32.690" Title="Schedule repeating Org event for day of month" Tags="|org-mode|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21221" PostTypeId="2" ParentId="21214" CreationDate="2016-03-25T11:04:51.560" Score="1" Body="&lt;p&gt;The bmkp-dired-jump function evaluates its argument; the literal bookmark name therefore needs to be enclosed in quotation marks. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bmkp-dired-jump &quot;d_zh_tmp&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could set the argument equal to a variable, whose value is that string.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq d_zh_tmp_var &quot;d_zh_tmp&quot;)&#xA;(bmkp-dired-jump d_zh_tmp_var)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2016-03-25T11:04:51.560" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21223" PostTypeId="2" ParentId="21206" CreationDate="2016-03-25T13:54:33.203" Score="3" Body="&lt;p&gt;Try this in &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;(require 'ox-latex)&#xA;(setq org-latex-create-formula-image-program 'dvipng)&#xA;(org-babel-do-load-languages 'org-babel-load-languages '((latex . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this as an example org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Org latex example&#xA;#+STARTUP: latexpreview&#xA;&#xA;* Introduction&#xA;&#xA;Here is an equation:&#xA;\[&#xA;e^{i\pi} = -1&#xA;\]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some answers to your questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You set those variables in your .emacs file using either code you write or the customization interface.&lt;/li&gt;&#xA;&lt;li&gt;There is a bug in recent org mode releases, so this appears to be currently broken. Type &lt;code&gt;C-c C-x C-l&lt;/code&gt; with your cursor over the latex code to see the image.&lt;/li&gt;&#xA;&lt;li&gt;Personal preference. If you can remember the keybindings, it's less typing (but more work to memorize).&lt;/li&gt;&#xA;&lt;li&gt;That is correct.&lt;/li&gt;&#xA;&lt;li&gt;You need to &lt;code&gt;require&lt;/code&gt; &lt;code&gt;ox-latex&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You can load latex packages either from your org file if you only want them for that file, or always by setting up some variables in your .emacs.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2016-03-25T13:54:33.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21224" PostTypeId="1" CreationDate="2016-03-25T13:59:13.470" Score="1" ViewCount="115" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;: I am using systemd to run my emacs server and my usual workflow always involves invoking emacsclient. Both server and client are on the same computer running Debian Jessie. The method is explained in the following links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsAsDaemon#toc8&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/EmacsAsDaemon#toc8&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blog.refu.co/?p=1296&quot; rel=&quot;nofollow&quot;&gt;http://blog.refu.co/?p=1296&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3b0qpa/if_you_cant_beat_em_join_em_using_systemd_to/&quot; rel=&quot;nofollow&quot;&gt;https://www.reddit.com/r/emacs/comments/3b0qpa/if_you_cant_beat_em_join_em_using_systemd_to/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: When I work on a Latex document, the view function for AuCTeX used to jump to the pdf document and show a nice redbox; a Ctrl-mouse click successfully performed an inverse search. However, after implementing emacs server as a systemd unit, inverse search does not work any more. In addition, the C-c C-v which is the view function no longer displays the nice red box in the pdf document. How can I fix this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="9303" LastActivityDate="2016-03-25T13:59:13.470" Title="Running emacs server via systemd prevents inverse search and nice view" Tags="|auctex|emacsclient|emacs24.4|server|system-environment|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21225" PostTypeId="2" ParentId="20718" CreationDate="2016-03-25T14:18:36.680" Score="1" Body="&lt;p&gt;Tramp is able to run several compile processes in parallel. It is the &lt;code&gt;compile&lt;/code&gt; command which prevents this due to the hard-coded buffer name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the docstring of &lt;code&gt;compile&lt;/code&gt; by &lt;code&gt;C-h f compile&lt;/code&gt;. There you see&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To run more than one compilation at once, start one then rename the&#xA;  ‘&lt;em&gt;compilation&lt;/em&gt;’ buffer to some other name with M-x rename-buffer. &#xA;  Then &lt;em&gt;switch buffers&lt;/em&gt; and start the new compilation. It will create a&#xA;  new ‘&lt;em&gt;compilation&lt;/em&gt;’ buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-25T14:18:36.680" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21226" PostTypeId="2" ParentId="21216" CreationDate="2016-03-25T14:27:04.383" Score="1" Body="&lt;p&gt;Or install &lt;code&gt;use-package&lt;/code&gt;, and explicitly supply the load path this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package example&#xA;  :load-path &quot;/directory/of/your/package&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2016-03-25T14:27:04.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21227" PostTypeId="2" ParentId="21220" CreationDate="2016-03-25T14:43:32.690" Score="9" Body="&lt;p&gt;According to the answers provided here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/13555385/org-mode-how-to-schedule-repeating-tasks-for-the-first-saturday-of-every-month&quot;&gt;https://stackoverflow.com/questions/13555385/org-mode-how-to-schedule-repeating-tasks-for-the-first-saturday-of-every-month&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Every 2nd Sunday! SCHEDULED: &amp;lt;%%(diary-float t 0 2)&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2807" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-03-25T14:43:32.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21228" PostTypeId="1" CreationDate="2016-03-25T16:45:07.677" Score="2" ViewCount="341" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8T8JG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8T8JG.png&quot; alt=&quot;configuration code in .emacs file&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OS windows7 64bit | GNU emacs 24.3.1&lt;/p&gt;&#xA;" OwnerUserId="11530" LastActivityDate="2016-03-25T16:45:07.677" Title="fill-column-indicator mode doesn't show a straight vertical line" Tags="|init-file|fill-column|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21230" PostTypeId="1" AcceptedAnswerId="21231" CreationDate="2016-03-25T23:10:21.737" Score="4" ViewCount="414" Body="&lt;p&gt;I'm working on several files in sequence and want to build a buffer of file names to log my progress.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2016-03-25T23:11:19.600" Title="Can I yank the names of all marked files from a dired buffer?" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21231" PostTypeId="2" ParentId="21230" CreationDate="2016-03-25T23:11:19.600" Score="3" Body="&lt;p&gt;This is the first time I've seen Emacs use &quot;copy&quot; internally, rather than &quot;yank&quot;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dired-copy-filename-as-kill&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2016-03-25T23:11:19.600" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21232" PostTypeId="1" AcceptedAnswerId="21240" CreationDate="2016-03-26T12:29:24.060" Score="9" ViewCount="3307" Body="&lt;p&gt;I'm trying to construct a regular expression that would match symbols, that&#xA;is, things like function names and the like, according to current major mode&#xA;settings (it's called syntax table if I remember correctly). After some&#xA;investigation, I have found these useful regexps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;\_&amp;lt;&lt;/code&gt; matches beginning of a symbol&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;\_&amp;gt;&lt;/code&gt; matches end of a symbol&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now I think I need to find out how to represent symbol-constituent&#xA;character. We have &lt;code&gt;\w&lt;/code&gt; for word-constituent characters, but I cannot find&#xA;anything for symbols. Regexp to match symbols should be something like&#xA;(assuming that &lt;code&gt;\s&lt;/code&gt; matches on symbol-constituent characters):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\_&amp;lt;\s+\_&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I missing something? How to match on symbols?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that matching on words does not work for me. Trivial example is&#xA;something like &lt;code&gt;foo-bar&lt;/code&gt; that is a symbol in Emacs Lisp mode, but not a word&#xA;(because &lt;code&gt;-&lt;/code&gt; is not a word-constituent character).&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2016-03-26T22:28:18.087" Title="How to match symbol in regexp?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21233" PostTypeId="1" AcceptedAnswerId="21249" CreationDate="2016-03-26T15:28:26.590" Score="2" ViewCount="625" Body="&lt;p&gt;From the Ivy manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Customizability is about being able to use different methods and interfaces of completion to tailor the selection process. For example, adding a custom display function that points to a selected candidate with -&gt;, instead of highlighting the selected candidate with the ivy-current-match&gt;&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've tried to customize the face to look like the one in IDO, with the &quot;-&gt;&quot;, but to no avail. I can only seem to change the background and font of the face with (ivy-current-match), not manipulate the actual string.  Does anyone know?&lt;/p&gt;&#xA;" OwnerUserId="11537" LastEditorUserId="105" LastEditDate="2016-03-26T17:05:23.580" LastActivityDate="2016-03-27T17:52:59.940" Title="Change face for ivy-custom-match" Tags="|ivy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21234" PostTypeId="1" CreationDate="2016-03-26T17:54:15.997" Score="2" ViewCount="36" Body="&lt;p&gt;I just started setting up polymode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got ESS and r going nicely with markdown.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package markdown-mode)&#xA;(use-package polymode)&#xA;(require 'poly-R)&#xA;(require 'poly-markdown)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was able to put r code blocks inside a markdown file, and send lines one at a time to the r interactive window&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, I want to do the same for f#.&#xA;Here is my markdown document&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Title&#xA;&#xA;```{fsharp}&#xA;let x = 5&#xA;x&#xA;```&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when I start poly-markdown-mode, it automatically picks up on the fsharp mode, and I get the keybindingd I usually use for fsharp mode.  I tried sending the first line to the interactive process, and it worked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I tried sending the second line (just &lt;code&gt;x&lt;/code&gt;), and it gave me an error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;path/to/file.md(6,1): error FS0010: Unexpected reserved keyword in interaction&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I understand correctly, polymode splits the file into virtual buffers or something and splices them back together.  It seems that somehow there is something at the end of the fsharp virtual buffer that I can't see, but is messing the interpreter up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried adding a blank line to the end of the code block, but the result was the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;fsharp mode has a function for sending the current region; when I use that, it actually works.  This seems to confirm my diagnosis. Now, I could just select the last line any time I need to evaluate it, but that is inconvenient. Is there a way to solve this problem&lt;/p&gt;&#xA;" OwnerUserId="11539" LastActivityDate="2016-03-26T17:54:15.997" Title="polymode with fsharp-mode has trouble sending last line in code block to interactive" Tags="|markdown-mode|polymode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21235" PostTypeId="1" AcceptedAnswerId="21282" CreationDate="2016-03-26T18:35:42.010" Score="4" ViewCount="2291" Body="&lt;p&gt;I am writing an org-mode file with links like &lt;code&gt;[[./files/article.pdf]]&lt;/code&gt;. If I export this to HTML, it works as expected, creating a blue underlined text hyperlink to the file. But if I export to PDF via LaTeX instead, I get a full-sized image of the first page of the PDF embedded in my document. How to get what I want instead?&lt;/p&gt;&#xA;" OwnerUserId="874" LastActivityDate="2017-06-20T03:24:14.500" Title="How to include hyperlinks to PDF files when exporting LaTeX from org-mode?" Tags="|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21236" PostTypeId="1" CreationDate="2016-03-26T19:13:39.607" Score="1" ViewCount="44" Body="&lt;p&gt;I've got a superior heading and text under it, which is nicely indented. Then I added a sub-heading and put in text, which is also nicely indented even more to the right. Now, I want to get back to entering text indented at the superior heading's level with appropriate indenting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* heading1&#xA; Some text...&#xA;&#xA; ** heading2&#xA;    Some text&#xA;&#xA; continuation of heading1 text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't seem to get org-mode to let me go back to the superior heading's indentation column; it wants everything to remain at the sub-heading's indentation column.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="5213" LastEditDate="2016-04-30T14:13:24.810" LastActivityDate="2016-04-30T14:13:24.810" Title="Org mode paragraph promotion" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ClosedDate="2016-03-29T16:13:48.083" ContentLicense="CC BY-SA 3.0" />
  <row Id="21237" PostTypeId="2" ParentId="21212" CreationDate="2016-03-26T19:42:59.447" Score="-1" Body="&lt;p&gt;@lawlist has not yet tested the built-in options for handling &lt;code&gt;tar.gz&lt;/code&gt; files as of Emacs 25.  That may be a valid option, but it differs from the call of the original question posed by @lawlist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following has been tested with &lt;code&gt;Emacs -Q&lt;/code&gt; using the master branch (March 26, 2016) versions of Emacs built for OSX (10.6.8) and Windows (XP SP-3).  The tests performed related to tar-gzipping a directory into &lt;strong&gt;filename.tar.gz&lt;/strong&gt; and then extracting it back to its original state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[The primary changes made by @lawlist have to do with the &lt;code&gt;shell-file-name&lt;/code&gt; (which on Windows is &lt;code&gt;cmdproxy.exe&lt;/code&gt; instead of &lt;code&gt;/bin/sh&lt;/code&gt;) and the paths (which on Windows needs to contain backslashes instead of forward slashes when using &lt;code&gt;cmd.exe&lt;/code&gt; -- e.g., cannot &lt;code&gt;cd&lt;/code&gt; to a directory containing forward slashes).  And, @lawlist prefers to use absolute paths when dealing with executables.]&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;;;  dired-tar.el -- written by Jim Blandy, and modified by @lawlist.&#xA;;;&#xA;;;  As to packing/unpacking on a Windows box, @lawlist has chosen to use bsdtar&#xA;;;  from libarchive:  http://gnuwin32.sourceforge.net/packages/libarchive.htm&#xA;;;&#xA;;;  The decision to use bsdtar was made because gzip sometimes complains about&#xA;;;  broken pipes when used in conjunction with tar on a Windows box.  There is a&#xA;;;  mention in the Emacs manual about said problems:&#xA;;;    http://www.gnu.org/software/emacs/manual/html_mono/efaq-w32.html&#xA;;;    You may see many messages from tar complaining about being unable to change&#xA;;;    the modification time on directories, and from gzip complaining about a&#xA;;;    broken pipe. These messages are usually harmless, caused by incomplete&#xA;;;    ports that are not fully aware of the limitations of Windows. &#xA;;;&#xA;;;  USAGE:  In a `dired-mode' buffer, place point on the compressed tar-gzipped&#xA;;;  file or directory to be tar-gzipped, and type:  M-x jim-blandy-pack-unpack&#xA;&#xA;(require 'compile)&#xA;&#xA;;;;; Variables.&#xA;(defvar jim-blandy-should-gzip t&#xA;  &quot;*t if jim-blandy-pack-unpack should gzip the files it creates, by default.&#xA;nil if it should leave them alone.&quot;)&#xA;&#xA;(defvar jim-blandy-gzip-extension &quot;.tar.gz&quot;&#xA;  &quot;*File name extension to use for gzipped tar files.&#xA;By default, this is \&quot;.tar.gz\&quot;, but some people may like to use \&quot;.tgz\&quot;.&quot;)&#xA;&#xA;(defvar jim-blandy-gzip-command&#xA;  (cond&#xA;    ((eq system-type 'darwin)&#xA;      &quot;/Users/HOME/.0.data/.0.emacs/macports/bin/gzip --best --stdout&quot;)&#xA;    ((eq system-type 'windows-nt)&#xA;      &quot;c:\\progra~1\\GnuWin32\\bin\\gzip.exe --best --stdout&quot;))&#xA;  &quot;*A shell command which gzips its standard input to its standard output.&quot;)&#xA;&#xA;(defvar jim-blandy-ungzip-command&#xA;  (cond&#xA;    ((eq system-type 'darwin)&#xA;      &quot;/Users/HOME/.0.data/.0.emacs/macports/bin/gzip --decompress --stdout&quot;)&#xA;    ((eq system-type 'windows-nt)&#xA;      &quot;c:\\progra~1\\GnuWin32\\bin\\gzip.exe --decompress --stdout&quot;))&#xA;  &quot;*A shell command which ungzips its standard input to its standard output.&quot;)&#xA;&#xA;(defvar jim-blandy-tar-command&#xA;  (cond&#xA;    ((eq system-type 'darwin)&#xA;      &quot;/Users/HOME/.0.data/.0.emacs/macports/bin/gnutar&quot;)&#xA;    ((eq system-type 'windows-nt)&#xA;      &quot;c:\\progra~1\\GnuWin32\\bin\\bsdtar.exe&quot;))&#xA;  &quot;The tar executable.&quot;)&#xA;&#xA;(defvar jim-blandy-shell-file-name&#xA;  (cond&#xA;    ((eq system-type 'darwin)&#xA;      &quot;/bin/sh&quot;)&#xA;    ((eq system-type 'windows-nt)&#xA;      shell-file-name)) ;; absolute path to `cmdproxy.exe'&#xA;  &quot;The name of the shell to use to run the tar command.&#xA;The default is /bin/sh, which should work for all Unix users; I'm told&#xA;Windows users may want to use \&quot;4NT\&quot;, but I know nothing about Windows.&quot;)&#xA;&#xA;(defvar jim-blandy-cmd-switches &quot;vf&quot;&#xA;  &quot;Flags to pass to the tar program, in addition to the command charcaters.&#xA;This is concatenated with command characters (\&quot;x\&quot; or \&quot;c\&quot; or&#xA;whatever).  The default is 'vf'; I'm told Windows users should use&#xA;\&quot;mvf\&quot;.&quot;)&#xA;&#xA;(defvar jim-blandy-result nil&#xA;  &quot;For internal use by jim-blandy-dired-tar functions.&#xA;This variable is made local to the buffer in which we run the tar&#xA;process, and holds the name of the file created or affected.  The&#xA;process-termination sentinal uses this to update the dired listing&#xA;when the process completes its work, or dies.&quot;)&#xA;&#xA;(defconst jim-blandy-tarfile-regexp&#xA;  (format &quot;\\(%s\\)\\'&quot;&#xA;    (mapconcat 'regexp-quote&#xA;         '(&quot;.tar&quot; &quot;.tar.z&quot; &quot;.tar.gz&quot; &quot;.tar.Z&quot; &quot;.tgz&quot;)&#xA;         &quot;\\|&quot;))&#xA;  &quot;Regular expression matching plausible filenames for tar files.&quot;)&#xA;&#xA;(defconst jim-blandy-gzipped-tarfile-regexp&#xA;  (format &quot;\\(%s\\)\\'&quot;&#xA;    (mapconcat 'regexp-quote&#xA;         '(&quot;.tar.z&quot; &quot;.tar.gz&quot; &quot;.tar.Z&quot; &quot;.tgz&quot;)&#xA;         &quot;\\|&quot;))&#xA;  &quot;Regular expression matching plausible filenames for compressed tar files.&quot;)&#xA;&#xA;(defun jim-blandy-get-buffer ()&#xA;  &quot;Choose a buffer to run a tar process in.&#xA;Tar output buffers have names like *Tar*, *Tar*&amp;lt;2&amp;gt;, *Tar*&amp;lt;3&amp;gt;, ...&#xA;We return the lowest-numbered buffer that doesn't have a live tar&#xA;process in it.  We delete any other buffers whose processes have&#xA;deleted.&quot;&#xA;  ;; Kill all completed tar buffers.&#xA;  (let ((number 1))&#xA;    (while number&#xA;      (let* (&#xA;          (name&#xA;            (if (&amp;lt;= number 1)&#xA;              &quot;*Tar*&quot;&#xA;              (format &quot;*Tar*&amp;lt;%d&amp;gt;&quot; number)))&#xA;           (buf (get-buffer name)) )&#xA;        (if (null buf)&#xA;          (setq number nil)&#xA;          (save-excursion&#xA;            (set-buffer buf)&#xA;            (if (let ((process (get-buffer-process buf)))&#xA;                  (not (and process (eq (process-status process) 'run))))&#xA;              (kill-buffer buf)))&#xA;          (setq number (1+ number))))))&#xA;  ;; Make us a fresh buffer.&#xA;  (generate-new-buffer &quot;*Tar*&quot;))&#xA;&#xA;(defun jim-blandy-operation-done (buf message)&#xA;  &quot;Internal function for use by the jim-blandy-dired-tar package.&#xA;This function is run when the tar operation completes.  It tries to&#xA;update the dired listing by looking at jim-blandy-result.&quot;&#xA;  (cond&#xA;    ((null jim-blandy-result))&#xA;    ((file-directory-p jim-blandy-result)&#xA;      (save-excursion&#xA;        (mapcar&#xA;          (function (lambda (buf) (set-buffer buf)))&#xA;          (dired-buffers-for-dir jim-blandy-result))))&#xA;    ((file-exists-p jim-blandy-result)&#xA;      (dired-relist-file jim-blandy-result)) ))&#xA;&#xA;(defun jim-blandy-pack (directory _prefix-arg)&#xA;  &quot;Internal function for use by the jim-blandy-dired-tar package.&#xA;Create a gzipped tar file from the contents of DIRECTORY.&#xA;The archive is named after the directory, and the files are stored in&#xA;the archive with names relative to DIRECTORY's parent.&#xA;  We use `jim-blandy-gzip-extension' as the suffix for the filenames we&#xA;create.&#xA;  For example, (jim-blandy-pack \&quot;/home/blandy/womble/\&quot;) would produce a&#xA;tar file named \&quot;/home/blandy/womble.tar.gz\&quot;, whose contents had&#xA;names like \&quot;womble/foo\&quot;, \&quot;womble/bar\&quot;, etcetera.&#xA;  The second argument PREFIX-ARG is ignored.&quot;&#xA;  (let* (&#xA;      (dir&#xA;        (cond&#xA;          ((eq system-type 'darwin)&#xA;           (directory-file-name directory))&#xA;          ((eq system-type 'windows-nt)&#xA;            (replace-regexp-in-string &quot;/&quot; &quot;\\\\&quot;&#xA;              (w32-short-file-name directory)))))&#xA;      (absolute-compressed-file-name&#xA;        (if jim-blandy-should-gzip&#xA;          (concat dir jim-blandy-gzip-extension)&#xA;          (format &quot;%s.tar&quot; dir)))&#xA;      (filename&#xA;        (if jim-blandy-should-gzip&#xA;          (concat (file-name-nondirectory (directory-file-name directory))&#xA;            jim-blandy-gzip-extension)&#xA;          (format &quot;%s.tar&quot;&#xA;            (file-name-nondirectory (directory-file-name directory)))))&#xA;      (parent-name&#xA;        (cond&#xA;          ((eq system-type 'darwin)&#xA;            (file-name-directory dir))&#xA;          ((eq system-type 'windows-nt)&#xA;            (replace-regexp-in-string &quot;/&quot; &quot;\\\\&quot; (file-name-directory dir)))))&#xA;      (content-name (file-name-nondirectory (directory-file-name directory))) )&#xA;    (jim-blandy-run-command&#xA;      (if jim-blandy-should-gzip&#xA;        (cond&#xA;          ((eq system-type 'darwin)&#xA;            (format &quot;%s cvf - %s | %s &amp;gt; %s&quot;&#xA;              jim-blandy-tar-command&#xA;              content-name&#xA;              jim-blandy-gzip-command&#xA;              filename))&#xA;          ((eq system-type 'windows-nt)&#xA;            (format &quot;%s -zcvf %s %s&quot;&#xA;              jim-blandy-tar-command&#xA;              filename&#xA;              content-name)))&#xA;        (format &quot;%s cvf %s %s&quot;&#xA;          jim-blandy-tar-command&#xA;          filename&#xA;          content-name))&#xA;      parent-name&#xA;      absolute-compressed-file-name)))&#xA;&#xA;(defun jim-blandy-unpack (tar-file prefix-arg)&#xA;  &quot;Internal function for use by the jim-blandy-dired-tar package.&#xA;Unpack TAR-FILE into the directory containing it.&#xA;If PREFIX-ARG is non-nil, just list the archive's contents without&#xA;unpacking it.&quot;&#xA;  (let* (&#xA;      (filename&#xA;        (if (eq system-type 'windows-nt)&#xA;          (replace-regexp-in-string &quot;/&quot; &quot;\\\\&quot;&#xA;            (w32-short-file-name tar-file))&#xA;          tar-file))&#xA;      (dir&#xA;        (cond&#xA;          ((eq system-type 'darwin)&#xA;            (file-name-directory filename))&#xA;          ((eq system-type 'windows-nt)&#xA;            (replace-regexp-in-string &quot;/&quot; &quot;\\\\&quot;&#xA;              (file-name-directory filename)))&#xA;          (t&#xA;            (file-name-directory filename))))&#xA;      (action (if prefix-arg &quot;t&quot; &quot;x&quot;)) )&#xA;    (jim-blandy-run-command&#xA;     (cond&#xA;      ;; Does this look like a tar file at all?&#xA;      ((not (string-match jim-blandy-tarfile-regexp tar-file))&#xA;        (error &quot;bug: jim-blandy-unpack should only be passed tar file names.&quot;))&#xA;      ;; Does it look like a compressed tar file?&#xA;      ((string-match jim-blandy-gzipped-tarfile-regexp tar-file)&#xA;        (cond&#xA;          ((eq system-type 'darwin)&#xA;             (format &quot;%s &amp;lt; %s | %s %s%s -&quot;&#xA;               jim-blandy-ungzip-command&#xA;               filename&#xA;               jim-blandy-tar-command&#xA;               action&#xA;               jim-blandy-cmd-switches))&#xA;          ((eq system-type 'windows-nt)&#xA;             ;; (format &quot;%s &amp;lt; %s | %s %s%s -&quot;&#xA;             ;;   jim-blandy-ungzip-command&#xA;             ;;   filename&#xA;             ;;   jim-blandy-tar-command&#xA;             ;;   action&#xA;             ;;   jim-blandy-cmd-switches)&#xA;             (format &quot;%s %sz%s %s&quot;&#xA;               jim-blandy-tar-command&#xA;               action&#xA;               jim-blandy-cmd-switches&#xA;               filename))))&#xA;      ;; Okay, then it must look like an uncompressed tar file.&#xA;      (t&#xA;       (format &quot;%s %svf %s&quot; jim-blandy-tar-command action filename)))&#xA;     dir&#xA;     ;; If we're just unpacking the archive, don't bother updating the&#xA;     ;; dired listing.&#xA;     (if prefix-arg nil dir))))&#xA;&#xA;(defun jim-blandy-run-command (command directory result)&#xA;  &quot;Internal function for use by the jim-blandy-dired-tar package.&#xA;Run COMMAND asynchronously in its own window, like a compilation.&#xA;Use DIRECTORY as the default directory for the command's execution.&#xA;RESULT is the name of the tar file which will be created, or the&#xA;name of the directory into which the tar file was unpacked.&quot;&#xA;  (let ((buf (jim-blandy-get-buffer)))&#xA;    (save-excursion&#xA;      (set-buffer buf)&#xA;      (setq buffer-read-only nil)&#xA;      (widen)&#xA;      (erase-buffer)&#xA;      (goto-char (point-min))&#xA;      (insert &quot;cd &quot; directory)&#xA;      (newline)&#xA;      (insert command)&#xA;      (newline)&#xA;      (setq buffer-read-only t&#xA;        mode-name &quot;Tar-Output&quot;&#xA;        default-directory directory)&#xA;      (set (make-local-variable 'jim-blandy-result) result)&#xA;      (set (make-local-variable 'mode-line-process) '(&quot;: %s&quot;))&#xA;      (set (make-local-variable 'compilation-finish-function)&#xA;        'jim-blandy-operation-done)&#xA;      (let ((process&#xA;             (let ((shell-file-name jim-blandy-shell-file-name))&#xA;               (start-process-shell-command &quot;*Tar*&quot; buf command))))&#xA;        (set-process-sentinel&#xA;          process&#xA;          (lambda (p e) (when (= 0 (process-exit-status p))&#xA;            (let ((buffer (process-buffer p)))&#xA;              (if (null (buffer-name buffer))&#xA;                ;; buffer killed&#xA;                (set-process-buffer p nil)&#xA;                (with-current-buffer buffer&#xA;                  ;; Write something in the compilation buffer&#xA;                  ;; and hack its mode line.&#xA;                  (compilation-handle-exit (process-status p)&#xA;                         (process-exit-status p)&#xA;                         e)&#xA;                  ;; Since the buffer and mode line will show that the&#xA;                  ;; process is dead, we can delete it now.  Otherwise it&#xA;                  ;; will stay around until M-x list-processes.&#xA;                  (delete-process p))&#xA;                (when (get-buffer-window buffer)&#xA;                  (sit-for 2)&#xA;                  (delete-window (get-buffer-window buffer)))&#xA;                (kill-buffer buffer))&#xA;              (setq compilation-in-progress (delq p compilation-in-progress)))&#xA;            (if (eq major-mode 'dired-mode)&#xA;              (revert-buffer))))))&#xA;      ;; The window will be deleted at the end if everything went okay.&#xA;      (display-buffer buf))))&#xA;&#xA;(defun jim-blandy-pack-unpack (prefix-arg)&#xA;  &quot;Create or unpack a tar archive for the file on the current line.&#xA;If the file on the current line is a directory, make a gzipped tar&#xA;file out of its contents.&#xA;  If the file on the current line is a tar archive, unpack it.  If the&#xA;archive appears to be gzipped or compressed, expand it first.  With a&#xA;prefix argument, just list the tar archive's contents, and don't&#xA;unpack it.  The file's name must end in \&quot;.tar\&quot;, \&quot;.tar.gz\&quot;, or&#xA;\&quot;.tar.Z\&quot; or else this command will assume it's not a tar file.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((filename (dired-get-filename)))&#xA;    (cond&#xA;      ((file-directory-p filename)&#xA;        (jim-blandy-pack filename prefix-arg))&#xA;      ((string-match jim-blandy-tarfile-regexp filename)&#xA;        (jim-blandy-unpack filename prefix-arg))&#xA;     (t&#xA;        (error &quot;%s is neither a tar file nor a directory&quot; filename)))))&#xA;&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-03-27T00:22:59.003" LastActivityDate="2016-03-27T00:22:59.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21238" PostTypeId="2" ParentId="598" CreationDate="2016-03-26T20:47:50.137" Score="2" Body="&lt;p&gt;In my Emacs setup I have a mode with custom fontification, i.e. where I set &lt;code&gt;font-lock-defaults&lt;/code&gt;. A single page down would use 30 seconds to display part of 30000 character line. This slow down was fixed by reducing regexp backtracking. Instead of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;  (&quot;.* ended with an incomplete command*&quot; 0 font-lock-comment-face)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;do this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;  (&quot;^.\{1,80\} ended with an incomplete command*&quot; 0 font-lock-comment-face)&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="11335" LastActivityDate="2016-03-26T20:47:50.137" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21239" PostTypeId="1" AcceptedAnswerId="21246" CreationDate="2016-03-26T21:07:17.553" Score="19" ViewCount="7912" Body="&lt;p&gt;Is there an option which changes default title of table of contents in Org mode?&lt;br&gt;&#xA;My document is not in English so I want to translate table of content's title.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As JeanPierre said, It's about export settings. You can set &lt;code&gt;LANGUAGE&lt;/code&gt; at the top of your &lt;code&gt;org&lt;/code&gt; document this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: fr&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And French will be used as default language of all strings that &lt;code&gt;org&lt;/code&gt; produces during export.&lt;br&gt;&#xA;The constant responsible for translation mappings is &lt;code&gt;org-export-dictionary&lt;/code&gt; in &lt;code&gt;ox.el&lt;/code&gt; and if your language is not supported you can drop it there and then &lt;code&gt;eval-defun&lt;/code&gt; to let change take place. In my case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst org-export-dictionary &#xA;    ...   &#xA;    (&quot;Table of Contents&quot;&#xA;         ...&#xA;         (&quot;sr&quot; :html &quot;Sadr&amp;amp;#382;aj&quot; :utf-8 &quot;Sadržaj&quot;)&#xA;         ...)&#xA;    ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've wrote a naive function which can be useful in &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-export-translate-to-lang (term-translations &amp;amp;optional lang)&#xA;  &quot;Adds desired translations to `org-export-dictionary'.&#xA;   TERM-TRANSLATIONS is alist consisted of term you want to translate&#xA;   and its corresponding translation, first as :default then as :html and&#xA;   :utf-8. LANG is language you want to translate to.&quot;&#xA;  (dolist (term-translation term-translations)&#xA;    (let* ((term (car term-translation))&#xA;           (translation-default (nth 1 term-translation))&#xA;           (translation-html (nth 2 term-translation))&#xA;           (translation-utf-8 (nth 3 term-translation))&#xA;           (term-list (assoc term org-export-dictionary))&#xA;           (term-langs (cdr term-list)))&#xA;      (setcdr term-list (append term-langs&#xA;                                (list&#xA;                                 (list lang&#xA;                                       :default translation-default&#xA;                                       :html translation-html&#xA;                                       :utf-8 translation-utf-8)))))))&#xA;&#xA;(org-export-translate-to-lang '((&quot;Table of Contents&quot;&#xA;                                 &quot;Sadržaj&quot;&#xA;                                 &quot;Sadr&amp;amp;#382;aj&quot;&#xA;                                 &quot;Sadržaj&quot;)&#xA;                                (&quot;Another term&quot;&#xA;                                 &quot;coilogji&quot;))&#xA;                              &quot;sr&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Disclaimer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It doesn't work if you want to export via Latex (Latex is used when Org exports to PDF). Look at Tyler's answer and comments.&lt;/p&gt;&#xA;" OwnerUserId="6551" LastEditorUserId="1985" LastEditDate="2016-07-27T14:56:44.850" LastActivityDate="2018-11-08T11:24:38.857" Title="Change table of contents title in Org mode according to document language" Tags="|org-mode|org-export|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21240" PostTypeId="2" ParentId="21232" CreationDate="2016-03-26T22:28:18.087" Score="7" Body="&lt;p&gt;What is wrong with &#xA;&lt;code&gt;\_&amp;lt;.*?\_&amp;gt;&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="11528" LastActivityDate="2016-03-26T22:28:18.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21241" PostTypeId="2" ParentId="21239" CreationDate="2016-03-26T22:31:53.787" Score="5" Body="&lt;p&gt;If you are exporting to PDF, org-mode will be calling LaTeX to do the conversion. In that case, you should be able to insert the LaTeX command to change the TOC heading with the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \renewcommand*{\contentsname}{My Table of Contents Header}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put that at the top of your file and try the export. &lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-03-30T15:19:13.363" LastActivityDate="2016-03-30T15:19:13.363" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21242" PostTypeId="1" AcceptedAnswerId="21270" CreationDate="2016-03-27T06:34:43.417" Score="1" ViewCount="87" Body="&lt;p&gt;I am trying to emulate buffer-specific keybindings using minor modes as described &lt;a href=&quot;https://emacs.stackexchange.com/questions/519/key-bindings-specific-to-a-buffer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an arbitrary buffer, I am trying to call this function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun buffer-set-keys ()&#xA;  (interactive)&#xA;  (cl-flet ((foo () (insert &quot;a&quot;)))&#xA;    (define-minor-mode this-buffer-local-mode&#xA;      :init-value nil&#xA;      :key-map '((kbd &quot;M-_&quot;) . foo))&#xA;    (this-buffer-local-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure I'm doing something wrong, and in any case when I try &lt;code&gt;M-_&lt;/code&gt; I get that &quot;&lt;code&gt;M-_&lt;/code&gt; is not defined&quot;. How can I get this right?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-04-30T13:55:15.577" Title="Defining buffer keybindings" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21243" PostTypeId="1" CreationDate="2016-03-27T07:05:48.400" Score="16" ViewCount="2984" Body="&lt;p&gt;In blogs, textbooks, etc, it's really common to display the results of some code as comments, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 1 1) ;=&amp;gt; 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to display results like this automatically using Org-Mode's Babel feature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, what I'd like is to be able to specify a header such that this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src scheme &amp;lt;some headers&amp;gt;&#xA;(+ 1 1)&#xA;(/ 4 (* 2 2))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would turn into the following when I &lt;code&gt;C-c C-c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src scheme &amp;lt;some headers&amp;gt;&#xA;(+ 1 1) ;=&amp;gt; 2&#xA;(/ 4 (* 2 2)) ;=&amp;gt; 1&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then if I made some changes, like so...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src scheme &amp;lt;some headers&amp;gt;&#xA;(+ 1 5) ;=&amp;gt; 2&#xA;(/ 8 (* 2 2)) ;=&amp;gt; 1&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and &lt;code&gt;C-c C-c&lt;/code&gt;, it would replace the comments with updated ones:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src scheme &amp;lt;some headers&amp;gt;&#xA;(+ 1 5) ;=&amp;gt; 6&#xA;(/ 8 (* 2 2)) ;=&amp;gt; 2&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, short of what I've dreamed up above, is there an easy way to have results displayed by github's org file renderer, so the following would be visible (ideally with formatting that I specify at the document level):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11542" LastActivityDate="2018-02-01T21:10:11.750" Title="Can org-babel results be output as code comments?" Tags="|org-mode|org-export|org-babel|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21245" PostTypeId="1" AcceptedAnswerId="21247" CreationDate="2016-03-27T13:27:55.043" Score="18" ViewCount="7760" Body="&lt;p&gt;Byte compilation of my mode:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun dict-setup-expansions ()&#xA;  &amp;quot;Add `dict-mode' specific expansions.&amp;quot;&#xA;  (set (make-local-variable 'er/try-expand-list) (list #'dict-mark-article)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;gives warning:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Warning: assignment to free variable `er/try-expand-list'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is normal situation because &lt;code&gt;er/try-expand-list&lt;/code&gt; is defined in external library &lt;code&gt;expand-region&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;My mode register extension to &lt;code&gt;expand-region&lt;/code&gt; library but it is ok to run my mode without &lt;code&gt;expand-region&lt;/code&gt; mode.&lt;/p&gt;&#xA;&lt;p&gt;I think that proper way to deal with warning is to add declaration:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defvar er/try-expand-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;defvar&lt;/code&gt; docs say:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;The `defvar' form also declares the variable as &amp;quot;special&amp;quot;,&#xA;so that it is always dynamically bound even if `lexical-binding' is t.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I use &lt;code&gt;-*- lexical-binding: t -*-&lt;/code&gt;. Does that mean that without &lt;code&gt;defvar&lt;/code&gt; variable &lt;code&gt;er/try-expand-list&lt;/code&gt; be in lexical scope and I have real bug?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2020-12-25T17:57:43.220" LastActivityDate="2020-12-25T17:57:43.220" Title="Dealing with &quot;Warning: assignment to free variable&quot; when certain libraries can be missing by design" Tags="|byte-compilation|package-development|warning|lexical-scoping|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="21246" PostTypeId="2" ParentId="21239" CreationDate="2016-03-27T13:56:45.767" Score="5" Body="&lt;p&gt;Org &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html#Export-settings&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; says this about export settings (you should be able to browse it in emacs info &lt;code&gt;C-h i m Org m exporting&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;‘LANGUAGE’&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The language used for translating some strings&#xA;       (‘org-export-default-language’).  E.g., ‘#+LANGUAGE: fr’ will tell&#xA;       Org to translate &lt;em&gt;File&lt;/em&gt; (english) into &lt;em&gt;Fichier&lt;/em&gt; (french) in the&#xA;       clocktable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I haven't tried it but I expect it should do what you want.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-03-27T13:56:45.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21247" PostTypeId="2" ParentId="21245" CreationDate="2016-03-27T14:33:02.287" Score="11" Body="&lt;p&gt;No, &lt;code&gt;set&lt;/code&gt; and &lt;code&gt;setq&lt;/code&gt; do not declare lexical variables.  Only &lt;code&gt;let&lt;/code&gt; does.  Had you used &lt;code&gt;let&lt;/code&gt; here you'd have a bug, but this is fine.  The warning exists mostly to catch typos when using dynamic variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the warning go away use &lt;code&gt;defvar&lt;/code&gt; as in your question, but do &lt;strong&gt;not&lt;/strong&gt; quote the symbol.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-03-27T14:33:02.287" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21249" PostTypeId="2" ParentId="21233" CreationDate="2016-03-27T17:52:59.940" Score="3" Body="&lt;p&gt;If you want the selected match to be displayed as an arrow, you should customize &lt;code&gt;ivy-format-function&lt;/code&gt;, here's the definition:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defcustom ivy-format-function 'ivy-format-function-default&#xA;  &quot;Function to transform the list of candidates into a string.&#xA;This string is inserted into the minibuffer.&quot;&#xA;  :type '(choice&#xA;          (const :tag &quot;Default&quot; ivy-format-function-default)&#xA;          (const :tag &quot;Arrow prefix&quot; ivy-format-function-arrow)&#xA;          (const :tag &quot;Full line&quot; ivy-format-function-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The option that you want is thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ivy-format-function 'ivy-format-function-arrow)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you insist on having &lt;code&gt;-&amp;gt;&lt;/code&gt; instead of the default &lt;code&gt;&amp;gt;&lt;/code&gt;, look up the definition:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun ivy-format-function-arrow (cands)&#xA;  &quot;Transform CAND-PAIRS into a string for minibuffer.&quot;&#xA;  (ivy--format-function-generic&#xA;   (lambda (str)&#xA;     (concat &quot;&amp;gt; &quot; (ivy--add-face str 'ivy-current-match)))&#xA;   (lambda (str)&#xA;     (concat &quot;  &quot; str))&#xA;   cands&#xA;   &quot;\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Copy-paste into your own function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun my-ivy-format-function-arrow (cands)&#xA;  &quot;Transform CAND-PAIRS into a string for minibuffer.&quot;&#xA;  (ivy--format-function-generic&#xA;   (lambda (str)&#xA;     (concat &quot;-&amp;gt; &quot; (ivy--add-face str 'ivy-current-match)))&#xA;   (lambda (str)&#xA;     (concat &quot;   &quot; str))&#xA;   cands&#xA;   &quot;\n&quot;))&#xA;(setq ivy-format-function 'my-ivy-format-function-arrow)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're not very experienced with Elisp, I recommend to go through &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-group&lt;/code&gt; &lt;code&gt;ivy&lt;/code&gt; and use the GUI to play around with the parameters.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-03-27T17:52:59.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21250" PostTypeId="1" CreationDate="2016-03-27T18:40:02.413" Score="1" ViewCount="175" Body="&lt;p&gt;I have two files.  A main file, say, &lt;code&gt;main.tex&lt;/code&gt; which has all the boiler plate and structure, and &lt;code&gt;section.tex&lt;/code&gt;, which has content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside &lt;code&gt;main.tex&lt;/code&gt; I have &lt;code&gt;\include{section}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I edit &lt;code&gt;section.tex&lt;/code&gt;, because that's where the content is, and so when I use  &lt;code&gt;latex-preview-pane-mode&lt;/code&gt; it gives an error, because it is trying to compile &lt;code&gt;section.tex&lt;/code&gt; which has none of the necessary preamble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway I can point the preview pane towards &lt;code&gt;main.tex&lt;/code&gt;, or some other way of achieving what I want: the ability to preview modular latex documents within Emacs?  Preferably it would be within a frame, rather than having to open an external application, and updates automatically in the way that &lt;code&gt;latex-preview-pane-mode&lt;/code&gt; does.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise I will have to use a monolithic document once again and use C-c = with reftex, I suppose.&lt;/p&gt;&#xA;" OwnerUserId="11532" LastActivityDate="2016-03-27T18:40:02.413" Title="How to point latex preview to another file?" Tags="|latex|preview-latex|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21251" PostTypeId="2" ParentId="21243" CreationDate="2016-03-27T18:49:49.780" Score="4" Body="&lt;p&gt;The closest that I've been able to accomplish with existing Babel functionality is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I define an emacs-lisp function to prepend results with &lt;code&gt;&quot;;=&amp;gt; &quot;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: commentify&#xA;#+begin_src emacs-lisp :var result=&quot;&quot; :exports none&#xA;(concat &quot;;=&amp;gt; &quot; (format &quot;%s&quot; result))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I process results using the &lt;code&gt;:post&lt;/code&gt; header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src scheme :post commentify(*this*) :results code :exports both&#xA;(+ 5 7)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns the following on &lt;code&gt;C-c C-c&lt;/code&gt;, which does display on github due to the &lt;code&gt;:exports both&lt;/code&gt; header, but it's in a separate code block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_SRC scheme&#xA;;=&amp;gt; 12&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think this strategy leaves the org file too cluttered to be worth it, though. And, unless I disable the code evaluation confirm, I have to accept two &quot;Are you sure you want to evaluate code?&quot; prompts (one for the Scheme block and one for the elisp &lt;code&gt;commentify&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="11542" LastEditorUserId="11542" LastEditDate="2016-03-27T19:00:15.467" LastActivityDate="2016-03-27T19:00:15.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21252" PostTypeId="1" AcceptedAnswerId="21259" CreationDate="2016-03-28T00:00:56.150" Score="1" ViewCount="164" Body="&lt;p&gt;In VC Directory Mode, how do I ignore multiple files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My use case is that I have a LaTeX repository (in SVN, but that should not matter) with over 15 &lt;code&gt;*.aux&lt;/code&gt; files in a subdirectory.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Attempt 1&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Mark a couple of files in VC Directory Mode, then run &lt;code&gt;C-x v G&lt;/code&gt; (&lt;code&gt;vc-ignore&lt;/code&gt;).  The command still asks me for a file, so it does not use the marks.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Attempt 2&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;C-x v G&lt;/code&gt; (&lt;code&gt;vc-ignore&lt;/code&gt;) and fill in a Wildcard, e.g., &lt;code&gt;sections/*.aux&lt;/code&gt;.  This does not exclude any files from the VC Directory Mode buffer (refreshed with &lt;code&gt;g&lt;/code&gt;), but it does add the wildcard to SVN.  I.e., when I do &lt;code&gt;svn propedit svn:ignore .&lt;/code&gt; then a buffer opens with the &lt;code&gt;sections/*.aux&lt;/code&gt; line in there.&lt;/p&gt;&#xA;" OwnerUserId="8488" LastEditorUserId="8488" LastEditDate="2016-03-28T09:04:24.533" LastActivityDate="2016-03-28T11:23:00.203" Title="Ignore multiple files in VC mode" Tags="|vc|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21253" PostTypeId="2" ParentId="18722" CreationDate="2016-03-28T00:53:23.573" Score="2" Body="&lt;p&gt;Try running &quot;xcompmgr -n &amp;amp;&quot;. (See &lt;a href=&quot;https://michaelheap.com/google-chrome-stealing-focus-repainting-in-xmonad/&quot; rel=&quot;nofollow&quot;&gt;https://michaelheap.com/google-chrome-stealing-focus-repainting-in-xmonad/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This finally fixed emacs for me, but, ironically, it has slowed google-chrome down in the current session I am in.&lt;/p&gt;&#xA;" OwnerUserId="10992" LastActivityDate="2016-03-28T00:53:23.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21254" PostTypeId="1" AcceptedAnswerId="34133" CreationDate="2016-03-28T01:13:43.677" Score="2" ViewCount="476" Body="&lt;p&gt;i use currently &lt;code&gt;melpa&lt;/code&gt; for managing my emacs packages, but I'm not satisfied with that. &lt;code&gt;Melpa&lt;/code&gt; seems to manage the packages by dumping them into my &lt;code&gt;emacs.d&lt;/code&gt; - which i don't want to store inside my dotfiles git repo. But still, i want to be able to easily reinstall my emacs without much interaction (ideally just executing an update command)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most Plugin Managers of vim provided a very neat way of solving that issue. They dump also the packages inside my .vim, but mainly manage them by a list inside the main vim config file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call plug#begin('~/.dotfiles/nvim/autoload/plugged')&#xA;&#xA;&quot; Languages&#xA;Plug '0robustus1/vim-tmux-conf'&#xA;Plug 'hrother/offlineimaprc.vim'&#xA;Plug 'LaTeX-Box-Team/LaTeX-Box'&#xA;Plug 'Matt-Deacalion/vim-systemd-syntax'&#xA;&#xA;&quot; Editing&#xA;Plug 'tpope/vim-surround'&#xA;Plug 'scrooloose/nerdcommenter'&#xA;&#xA;&#xA;&quot; git helpers&#xA;Plug 'jreybert/vimagit'&#xA;Plug 'airblade/vim-gitgutter'&#xA;Plug 'tpope/vim-fugitive'&#xA;Plug 'vim-scripts/gitdiff.vim'&#xA;&#xA;&quot; other useful stuff&#xA;Plug 'tyru/open-browser.vim'&#xA;Plug 'godlygeek/tabular'&#xA;&#xA;call plug#end()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The packages there are basically listed as 'github-user/repo', therefore e.g. the url for &lt;code&gt;'godlygeek/tabular'&lt;/code&gt; is &lt;code&gt;https://github.com/godlygeek/tabular&lt;/code&gt;. This way, i can completely ignore the content of my plugin directory. After reinstalling my vim, i can just execute &lt;code&gt;':PlugInstall'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear what i search for: I don't care where my emacs installs its packages from (e.g. github, from the melpa servers, etc.). I just want to know a method how i can list all packages i want to install inside my emacs config file (like the vim solution).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;is there sth similar for emacs?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="5213" LastEditDate="2016-04-30T13:55:11.907" LastActivityDate="2017-07-13T04:12:14.067" Title="Manage packages completely inside emacs config file, not inside the Emacs directory?" Tags="|package|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21255" PostTypeId="2" ParentId="21254" CreationDate="2016-03-28T01:55:43.197" Score="4" Body="&lt;p&gt;First, to get the packages out of &lt;code&gt;.emacs.d&lt;/code&gt;, set the variable &lt;code&gt;package-user-dir&lt;/code&gt;.  You might need to reinstall your existing packages or move them by hand, but once that's set, new packages will go there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the problem of declaring packages for auto-install, I think you're looking for the &lt;code&gt;:ensure&lt;/code&gt; option for &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;.  From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can use &lt;code&gt;use-package&lt;/code&gt; to load packages from ELPA with &lt;code&gt;package.el&lt;/code&gt;. This is particularly useful if you share your &lt;code&gt;.emacs&lt;/code&gt; among several machines; the relevant packages are downloaded automatically once declared in your &lt;code&gt;.emacs&lt;/code&gt;. The &lt;code&gt;:ensure&lt;/code&gt; keyword causes the package(s) to be installed automatically if not already present on your system (set &lt;code&gt;(setq use-package-always-ensure t)&lt;/code&gt; if you wish this behavior to be global for all packages)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that the one package &lt;code&gt;use-package&lt;/code&gt; can't install for you is itself.  I use this code to handle that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;(require 'use-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-03-28T01:55:43.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21256" PostTypeId="1" AcceptedAnswerId="21267" CreationDate="2016-03-28T06:44:33.090" Score="4" ViewCount="3323" Body="&lt;p&gt;How can I get a graph back in my org-babel results for R code?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R :results output latex &#xA;boxplot(islands)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Islands is a baked in dataset for R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you do it with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+resname:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and org-auto-load-images = T in your .emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://eschulte.github.io/org-scraps/scraps/2009-11-20-asymptote.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;resname example&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OPpMa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OPpMa.png&quot; alt=&quot;Perfect Answer&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="10898" LastEditDate="2016-04-03T18:28:06.703" LastActivityDate="2016-04-03T18:28:06.703" Title="graphing R in org-babel" Tags="|org-mode|org-babel|ess|r|literate-programming|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21257" PostTypeId="1" AcceptedAnswerId="22310" CreationDate="2016-03-28T07:51:16.780" Score="2" ViewCount="2013" Body="&lt;p&gt;How can I define vars in one org-babel code block and use them in a second?  This closely follows the tutorial section block-to-block &#xA;variable passing linked in the first answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# file test.org&#xA;* try a session.&#xA;#+name: section1&#xA;#+begin_src R :results output both :session&#xA;x &amp;lt;- c(1:10)&#xA;y &amp;lt;- x^2&#xA;mat &amp;lt;- cbind(x,y)&#xA;mat&#xA;#+end_src &#xA;&#xA;#this is outputted into the MWE after you press C-c C-c&#xA;#+RESULTS: section1&#xA;#+begin_example&#xA;       x   y&#xA; [1,]  1   1&#xA; [2,]  2   4&#xA; [3,]  3   9&#xA; [4,]  4  16&#xA; [5,]  5  25&#xA; [6,]  6  36&#xA; [7,]  7  49&#xA; [8,]  8  64&#xA; [9,]  9  81&#xA;[10,] 10 100&#xA;#+end_example&#xA;&#xA;&#xA;&#xA;#+name: section2&#xA;#+BEGIN_SRC R :file example2.png :results graphics mat=section1&#xA;plot(mat)&#xA;#+END_SRC&#xA;&#xA;#this is outputted into the MWE after you press C-c C-c&#xA;#+RESULTS: section2&#xA;here is a white box with the phrase&#xA;object 'mat' not found&#xA;when it is named section 2 the white box appears in the first results &#xA;#+begin_example section and the matrix of numbers disappears.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="10898" LastEditDate="2016-05-17T04:19:35.093" LastActivityDate="2016-05-17T09:23:12.047" Title="Reference a variable in a 2nd org-babel code block" Tags="|org-mode|org-babel|ess|r|literate-programming|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21258" PostTypeId="1" AcceptedAnswerId="21264" CreationDate="2016-03-28T11:02:27.233" Score="4" ViewCount="330" Body="&lt;p&gt;&lt;code&gt;insert-char&lt;/code&gt; provides a very convenient way to enter Unicode code points using their names and even search for code point names.  Unfortunately, GNU Emacs 24.3 and Unicode 8 were released at roughly the same time, so the new code points are not available from the list provided by &lt;code&gt;insert-char&lt;/code&gt;.  How can I add them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I implemented &lt;a href=&quot;https://emacs.stackexchange.com/users/2162/aaron-miller&quot;&gt;Aaron's&lt;/a&gt; solution (albeit in a lazy manner) and it works.  I used the emoji list from &lt;a href=&quot;http://emojipedia.org/unicode-7.0/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emojipedia.org/unicode-7.0/&lt;/a&gt; and &lt;a href=&quot;http://emojipedia.org/unicode-8.0/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emojipedia.org/unicode-8.0/&lt;/a&gt; (Emacs 24.3 lacks the Unicode 7 code points too, by the way)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ucs-names)&#xA;(nconc ucs-names&#xA;       '((&quot;SLIGHTLY SMILING FACE&quot; . ?)&#xA;         (&quot;SLIGHTLY FROWNING FACE&quot; . ?)&#xA;         (&quot;SLEUTH OR SPY&quot; . ?)&#xA;         (&quot;SPEAKING HEAD IN SILHOUETTE&quot; . ?)&#xA;         (&quot;MAN IN BUSINESS SUIT LEVITATING&quot; . ?)&#xA;         (&quot;REVERSED HAND WITH MIDDLE FINGER EXTENDED&quot; . ?)&#xA;         (&quot;RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS&quot; . ?)&#xA;         (&quot;RAISED HAND WITH FINGERS SPLAYED&quot; . ?)&#xA;         (&quot;EYE&quot; . ?)&#xA;         (&quot;HOLE&quot; . ?)&#xA;         ;; and so on&#xA;           ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11553" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-03-29T09:24:01.723" Title="How can I add Unicode 8 support to Emacs 24.3?" Tags="|unicode|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21259" PostTypeId="2" ParentId="21252" CreationDate="2016-03-28T11:23:00.203" Score="1" Body="&lt;p&gt;Indeed, for some reason &lt;code&gt;vc-dir-ignore&lt;/code&gt; operates only on a single file. But this should be easy to remedy:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/vc-ignore-multiple-files ()&#xA;  (interactive)&#xA;  (mapcar 'vc-ignore (vc-dir-marked-files)))&#xA;&#xA;(define-key vc-dir-mode-map &quot;a&quot; 'my/vc-ignore-multiple-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now marking several files and then pressing &lt;kbd&gt;a&lt;/kbd&gt; will ignore all of them.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-03-28T11:23:00.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21260" PostTypeId="1" AcceptedAnswerId="21266" CreationDate="2016-03-28T12:37:42.617" Score="1" ViewCount="673" Body="&lt;p&gt;Tools &gt; Version control &gt; Git &gt; Status produces nice interactive output to browse the repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way however to have full path names of the modified files, which can be textually copy-pasted somewhere else, or is the only option to run &lt;code&gt;git status&lt;/code&gt; from the command line and copy paste from there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The use case is that I want to store the paths for later in a text file, visit them (I have file at point automation, making go to file hypertext experience) possibly while in another branch, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, something analogous to C-x C-b list for the currently open buffers.&lt;/p&gt;&#xA;" OwnerUserId="11466" LastActivityDate="2016-03-28T18:40:13.857" Title="View for version control (git) status with full file names" Tags="|files|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21261" PostTypeId="2" ParentId="21066" CreationDate="2016-03-28T13:19:48.537" Score="14" Body="&lt;p&gt;You can also redefine LaTeX's &lt;code&gt;\maketitle&lt;/code&gt; to do nothing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: Test title&#xA;#+Author: Test Author&#xA;#+Date: [2016-03-28 Mon]&#xA;&#xA;#+LATEX_HEADER: \renewcommand\maketitle{}&#xA;&#xA;* hello&#xA;test text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-03-28T13:19:48.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21262" PostTypeId="2" ParentId="21257" CreationDate="2016-03-28T17:26:40.660" Score="3" Body="&lt;p&gt;A standard feature of babel blocks is each block is executed in a new interpreter. Often this is good as changes in one block doesn't mess up others.&#xA;I have two ideas for you...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this particular case, you could break up the first block in two, so that the first block called the &lt;code&gt;c&lt;/code&gt; function and spit out its results in a table that has the name, &lt;code&gt;&amp;lt;named_block&amp;gt;&lt;/code&gt;. The other block would use that table output as a &lt;code&gt;:var&lt;/code&gt; can call &lt;code&gt;summary&lt;/code&gt; on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third block would also set a &lt;code&gt;:var&lt;/code&gt; and pass that to &lt;code&gt;mean&lt;/code&gt;. That seems to me to be the most idiomatic approach. For details, see the &lt;a href=&quot;http://howardism.org/Technical/Emacs/literate-programming-tutorial.html#sec-11&quot; rel=&quot;nofollow&quot;&gt;Variables section in my Literate Programming tutorial&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach is to set the &lt;code&gt;:session&lt;/code&gt; parameter to some name, then each block that uses that same named session would share the same R interpreter, so setting variables in one block would then be accessible in the next. For details on this, see the &lt;a href=&quot;http://howardism.org/Technical/Emacs/literate-programming-tutorial.html#sec-8-3&quot; rel=&quot;nofollow&quot;&gt;Session section&lt;/a&gt; in the same tutorial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck.&lt;/p&gt;&#xA;" OwnerUserId="173" LastActivityDate="2016-03-28T17:26:40.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21263" PostTypeId="1" AcceptedAnswerId="21265" CreationDate="2016-03-28T17:49:05.857" Score="0" ViewCount="635" Body="&lt;p&gt;If I have marked a couple files in different directories using &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;Dired+&lt;/a&gt; is there a way to see the &lt;code&gt;diff&lt;/code&gt;?  I was looking at &lt;code&gt;dired-diff&lt;/code&gt; and &lt;code&gt;diredp-diff&lt;/code&gt;, but they both take the file at point.  Granted that isn't a whole lot harder, but I was wondering if there is a way to mark the files first and diff them?  &lt;/p&gt;&#xA;" OwnerUserId="8597" LastEditorUserId="105" LastEditDate="2016-03-28T19:51:52.553" LastActivityDate="2016-03-28T19:51:52.553" Title="diff marked files in Dired+" Tags="|dired|diff|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21264" PostTypeId="2" ParentId="21258" CreationDate="2016-03-28T18:04:10.247" Score="4" Body="&lt;p&gt;Names and code points used by &lt;code&gt;insert-char&lt;/code&gt; come from the value of &lt;code&gt;ucs-names&lt;/code&gt;, which is a (very long) alist of Unicode names and code points originating ultimately from C code. This list isn't populated during init, because doing so can take a little while, but during the first call to the function &lt;code&gt;(ucs-names)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all you want to do is make Unicode 8 code points available in &lt;code&gt;insert-char&lt;/code&gt;, you should be able to do so by manually adding them to &lt;code&gt;ucs-names&lt;/code&gt; &lt;em&gt;after&lt;/em&gt; calling &lt;code&gt;(ucs-names)&lt;/code&gt; once to populate it. (If &lt;code&gt;ucs-names&lt;/code&gt; is non-nil when that first call occurs, the function will assume that what's there is what should be there, and won't add anything - so whatever you added will be all you have available. This probably will break a lot of things, so you'll want to ensure it doesn't happen.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;ucs-names&lt;/code&gt; is an alist, you can just &lt;code&gt;push&lt;/code&gt; into it; its members are of form &lt;code&gt;(&quot;CODE POINT NAME&quot; . &amp;lt;code point&amp;gt;)&lt;/code&gt;, where &lt;strong&gt;code point&lt;/strong&gt; is the decimal representation. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(push '(&quot;BOTTLE WITH POPPING CORK&quot; . 127870) ucs-names)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;would make available in &lt;code&gt;insert-char&lt;/code&gt; an emoji which presumably would be useful for, I don't know, chatting about a wedding or the christening of a ship or something. Whether it'll show up in your buffers as an emoji, or in the same form Emacs uses to represent any other un-renderable character, is a different question; if you use a fontset including a font with that code point defined, it should render, but I can't be certain of that because I don't actually have such a font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at &lt;a href=&quot;https://github.com/iqbalansari/emacs-emojify&quot;&gt;emojify&lt;/a&gt;, which uses images to display emoji in Emacs installations without an emoji font available, it appears to include BOTTLE WITH POPPING CORK, and I would expect it to be correctly displayed. Unfortunately, emojify 0.3 from Melpa Stable appears to be broken, or at least it's broken on my machine, so I can't say for certain there either. It's definitely worth a shot, though.&lt;/p&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2016-03-28T18:04:10.247" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21265" PostTypeId="2" ParentId="21263" CreationDate="2016-03-28T18:14:06.053" Score="1" Body="&lt;p&gt;Not that I know of. But be clear about what you are trying to diff. Do you want to compare each marked file in one dir with some marked file in the other dir? Or do you want to compare the directory listings and not the file contents? Not clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to compare directory listings, and you want to compare only the listings of the marked files, then you can do that by using command &lt;code&gt;diredp-marked&lt;/code&gt; to show only the marked files in a Dired buffer.  Do that for both Dired buffers, and then use command &lt;code&gt;ediff-buffers&lt;/code&gt; to compare those listings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Command &lt;code&gt;diredp-marked-other-window&lt;/code&gt; is bound to &lt;code&gt;C-M-*&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-28T18:14:06.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21266" PostTypeId="2" ParentId="21260" CreationDate="2016-03-28T18:40:13.857" Score="2" Body="&lt;p&gt;If you're open to a new tool, &lt;a href=&quot;https://github.com/magit/magit&quot; rel=&quot;nofollow&quot;&gt;Magit&lt;/a&gt; has this baked in. If you invoke &lt;code&gt;magit-status&lt;/code&gt; while visiting a file that's part of a git repo, Magit's default view will show you the path from the project root of each modified file (I believe this is customizable). If you put point on a modified file and hit &lt;code&gt;C-w&lt;/code&gt;, the path will be added to the kill ring. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach to storing paths for later would probably be based around &lt;a href=&quot;https://github.com/emacsattic/org-magit&quot; rel=&quot;nofollow&quot;&gt;magit integration with Org&lt;/a&gt;, particularly &lt;code&gt;org-store-link&lt;/code&gt; or &lt;code&gt;org-capture&lt;/code&gt;. (Full disclosure, I have not set this up myself yet -- and it would require both Magit and Org Mode, so may not suit your use case. &lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-03-28T18:40:13.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21267" PostTypeId="2" ParentId="21256" CreationDate="2016-03-28T18:50:38.237" Score="6" Body="&lt;p&gt;You're very close! Two changes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the R code, you'll need a few more headers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R :results output graphics :file test.png&#xA;  library(&quot;ggplot2&quot;)&#xA;  ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, color = Species)) +&#xA;  geom_point()&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that the headers change slightly depending on whether you want to use base R, as in your example, or something like ggplot2, as in mine. See the docs &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html#orgheadline4&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; for more exposition on this. TL;DR: include &lt;code&gt;output&lt;/code&gt; if you want to use &lt;code&gt;ggplot2&lt;/code&gt; et al.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To display the image, you've got a couple choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-toggle-inline-images&lt;/code&gt; will switch inline image display on and off&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-startup-with-inline-images&lt;/code&gt; is a variable which can be set in your config files (&lt;code&gt;init.el&lt;/code&gt; / &lt;code&gt;.emacs.d&lt;/code&gt; / whathaveyou). If non-nil, images will be shown by default on buffer load. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also useful is &lt;code&gt;org-redisplay-inline-images&lt;/code&gt;, for refreshing an image that's changed on disk if org doesn't auto-reload it. &lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-03-28T18:50:38.237" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21268" PostTypeId="2" ParentId="3427" CreationDate="2016-03-28T20:07:08.583" Score="2" Body="&lt;p&gt;there is an option to run all the tests in all the projects namespaces&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x cider-test-run-project-tests&lt;/code&gt; or &lt;code&gt;C-c C-t C-p&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the link to additional options for running tests&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cider.readthedocs.org/en/latest/extended_workflow/#running-tests&quot; rel=&quot;nofollow&quot;&gt;http://cider.readthedocs.org/en/latest/extended_workflow/#running-tests&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11559" LastActivityDate="2016-03-28T20:07:08.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21269" PostTypeId="1" AcceptedAnswerId="21273" CreationDate="2016-03-28T20:12:48.023" Score="0" ViewCount="263" Body="&lt;p&gt;I am using Ubuntu 15.10 and Emacs 24. but recently when i open a Python source file in Emacs or create a new one, i get an error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;symbol's function definition is void: format-message&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The file is opened as a Fundamental.&lt;/p&gt;&#xA;" OwnerUserId="10397" LastEditorUserId="253" LastEditDate="2016-03-28T20:22:47.453" LastActivityDate="2016-03-28T22:02:05.140" Title="Emacs Python-mode format-message error" Tags="|python|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21270" PostTypeId="2" ParentId="21242" CreationDate="2016-03-28T20:28:48.263" Score="2" Body="&lt;p&gt;I'm going to suggest that defining a minor mode within a function is not the right way to approach this problem. Something like this will do what you are after:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo () (interactive) (insert &quot;a&quot;))&#xA;(defun bar () (interactive) (insert &quot;b&quot;))&#xA;&#xA;(defvar my-buffer-local-mode-map (make-sparse-keymap)&#xA;  &quot;Special keymap used to apply specific buffer-local bindings&quot;)&#xA;&#xA;(let ((map my-buffer-local-mode-map))&#xA;  (define-key map (kbd &quot;M-_&quot;) 'foo)&#xA;  (define-key map (kbd &quot;M-+&quot;) 'bar))&#xA;&#xA;(define-minor-mode my-buffer-local-mode&#xA;  &quot;An ad-hoc mode for providing a buffer-local keymap&quot;&#xA;  nil nil my-buffer-local-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then use &lt;code&gt;M-x my-buffer-local-mode&lt;/code&gt; to enable the mode in any buffer, or else add the following file-local eval to the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; eval: (my-buffer-local-mode 1)&#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-03-28T20:28:48.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21271" PostTypeId="1" AcceptedAnswerId="21272" CreationDate="2016-03-28T20:33:43.517" Score="5" ViewCount="1270" Body="&lt;p&gt;I want to move the point to the end of a window using elisp.&#xA;The following code snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-buffer &quot;buffer-name&quot;)&#xA;(goto-char (point-min))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does not visually change the location of the cursor on the window visiting the buffer &quot;buffer-name&quot;. This is because windows and buffers are separate concepts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the function &lt;code&gt;set-window-point&lt;/code&gt; documented at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html&lt;/a&gt;, but I am not able to use it. Its signature is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set-window-point window position&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What does the first argument, &lt;code&gt;window&lt;/code&gt; mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried running the command &lt;code&gt;(set-window-point &quot;buffer-name&quot; (point-min))&lt;/code&gt;, but it returns the error &lt;code&gt;Wrong type argument: window-live-p, &quot;buffer-name&quot;&lt;/code&gt;, which I guess, means that the window named &quot;buffer-name&quot; is not showing on the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; I have multiple &lt;code&gt;eshell&lt;/code&gt; windows on the screen that are logged in via &lt;code&gt;ssh&lt;/code&gt; to remote machines and I have written an elisp function to run a single command on all the eshell buffers. I am able to run the command, but can't see the output because the windows do not auto-scroll. I have to switch to the windows and scroll down.&lt;/p&gt;&#xA;" OwnerUserId="10971" LastEditorUserId="105" LastEditDate="2016-04-05T03:40:47.653" LastActivityDate="2016-04-05T03:40:47.653" Title="Move point to the end of a live window using elisp" Tags="|window|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21272" PostTypeId="2" ParentId="21271" CreationDate="2016-03-28T21:01:18.310" Score="4" Body="&lt;p&gt;Unless you have a reason not to have the eshell buffers scroll automatically on output, I think that using &lt;code&gt;eshell-scroll-to-bottom-on-output&lt;/code&gt; (check out &lt;code&gt;M-x customize-apropos RET eshell&lt;/code&gt; to see related variables) will be a much more elegant and reliable solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following function should do what you are asking for though.  One caveat (of many) is that it will only scroll one window that is showing this buffer, if you happen to have more than one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-scroll-buffer-to-bottom (buf)&#xA;  (with-current-buffer buf&#xA;    (set-window-point&#xA;     (get-buffer-window (current-buffer) 'visible)&#xA;     (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-03-28T21:01:18.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21273" PostTypeId="2" ParentId="21269" CreationDate="2016-03-28T22:02:05.140" Score="0" Body="&lt;p&gt;I asked the question in some IRC group's and came up with an answer...&#xA;it seemed that elpa Python.el package, tries to load a file that is not python and is C++...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just had to delete the file and it worked again.&lt;/p&gt;&#xA;" OwnerUserId="10397" LastActivityDate="2016-03-28T22:02:05.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21274" PostTypeId="1" CreationDate="2016-03-28T23:38:13.710" Score="2" ViewCount="380" Body="&lt;p&gt;After updating my Emacs packages, org capture templates fail with &lt;code&gt;Capture template `a': outline-show-all&lt;/code&gt;, where &lt;code&gt;a&lt;/code&gt; is the capture keystroke.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Capture template `a': outline-show-all&quot;)&#xA;  signal(error (&quot;Capture template `a': outline-show-all&quot;))&#xA;  error(&quot;Capture template `%s': %s&quot; &quot;a&quot; outline-show-all)&#xA;  byte-code(&quot;\301p!\203�\302\303\304 \&quot;\203�\305p!\210\306\307\310!!\210\300\311\307\312!A@#\207&quot; [error buffer-base-buffer string-match &quot;\\`CAPTURE-&quot; buffer-name kill-buffer set-window-configuration org-capture-get :return-to-wconf &quot;Capture template `%s': %s&quot; :key] 4)&#xA;  org-capture(nil)&#xA;  #&amp;lt;subr call-interactively&amp;gt;(org-capture nil nil)&#xA;  ad-Advice-call-interactively(#&amp;lt;subr call-interactively&amp;gt; org-capture nil nil)&#xA;  apply(ad-Advice-call-interactively #&amp;lt;subr call-interactively&amp;gt; (org-capture nil nil))&#xA;  call-interactively(org-capture nil nil)&#xA;  command-execute(org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am also getting &lt;code&gt;org-agenda-change-all-lines: Symbol's function definition is void: org-get-at-eol&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried recompiling all packages with &lt;code&gt;M-: (byte-recompile-directory package-user-dir nil 'force)&lt;/code&gt;, but no improvement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 24.5.1 and Org version 8.2.10.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2016-03-29T00:39:12.990" LastActivityDate="2016-03-29T00:39:12.990" Title="Capture template `a': outline-show-all" Tags="|org-mode|package|org-capture|" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21275" PostTypeId="1" AcceptedAnswerId="21287" CreationDate="2016-03-28T23:59:39.110" Score="1" ViewCount="481" Body="&lt;p&gt;I was trying to fix the annoying red output in slime. It's OK on light backgrounds but on the dark backgrounds it gets on my nerves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some themes fix it. Quick experiment with aurora-theme reveals that &lt;strong&gt;slime-repl-inputed-output-face&lt;/strong&gt; is responsible for the colour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix it I wrote a little function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun repl-theme-fix ()&#xA;  &quot;Fix REPL theme issues concerning the red annoying text.&quot;&#xA;  (interactive)&#xA;  (print &quot;going to change repl buffer&quot;)&#xA;  (print (current-buffer))&#xA;  (load-theme-buffer-local 'hamburg (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is I have to run M-x repl-theme-fix each time I start the REPL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tired to experiment with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'lisp-interaction-mode-hook (lambda () (some code here)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But couldn't make it work not knowing the current-buffer argument needed by the theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be fixing the theme instead of replacing it with hamburg-theme. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to fix a theme in emacs startup file?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Searching&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In slime repl, when I move cursor on colourized output and press&#xA;    C-u C-x =&#xA;I get more detailed information, which contains hyperlink to a file where the font for slime-repl-inputed-output-face is defined.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/quicklisp/dists/quicklisp/software/slime-2.14/contrib/slime-presentations.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In that file I have found the right code fragment and replaced foreground color with Yellow.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface slime-repl-inputed-output-face&#xA;  '((((class color) (background light)) (:foreground &quot;Red&quot;))&#xA;    (((class color) (background dark)) (:foreground &quot;Yellow&quot;))&#xA;    (t (:slant italic)))&#xA;  &quot;Face for the result of an evaluation in the SLIME REPL.&quot;&#xA;  :group 'slime-repl)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does what I want to do. When theme does not change the colour I still get nice default for dark backgrounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But still do not know how to do it in the init file. What is the best way of fixing it?&lt;/p&gt;&#xA;" OwnerUserId="8952" LastEditorUserId="8952" LastEditDate="2016-03-29T01:04:38.723" LastActivityDate="2016-03-29T17:10:45.470" Title="Looking for a better theme fix in Slime" Tags="|themes|slime|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21276" PostTypeId="1" AcceptedAnswerId="21278" CreationDate="2016-03-29T01:56:17.620" Score="19" ViewCount="22855" Body="&lt;p&gt;I've used &lt;code&gt;git config --global core.editor emacs&lt;/code&gt; to set my git editor as emacs but when I do that and commit something the editor opens up a new window instead of opening emacs within the terminal. I want to use emacs as if -nw were given to it but writing this -&gt; &lt;code&gt;git config --global core.editor emacs -nw&lt;/code&gt; is not the solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do need to use basic git for now.&lt;/p&gt;&#xA;" OwnerUserId="11561" LastActivityDate="2016-03-31T09:27:34.513" Title="How can I use emacs with git within the terminal?" Tags="|git|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21277" PostTypeId="2" ParentId="18722" CreationDate="2016-03-29T02:45:15.387" Score="-1" Body="&lt;p&gt;use firefox instead. chrome is buggy. besides, keysnail is a great firefox ONLY addon to convert firefox to emacs&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-03-29T02:45:15.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21278" PostTypeId="2" ParentId="21276" CreationDate="2016-03-29T04:30:07.633" Score="37" Body="&lt;p&gt;When you run &lt;code&gt;git config --global core.editor emacs -nw&lt;/code&gt;, your shell splits the command line into words before invoking git. Git thus sees &quot;emacs -nw&quot; as two separate arguments. It only needs one to put into the config file, so the other is ignored. (Actually, that's a lie but you can check the man page for details.) You can put quotes around a series of words to tell your shell not to break them up: &lt;code&gt;git config --global core.editor &quot;emacs -nw&quot;&lt;/code&gt; will give &quot;emacs -nw&quot; to git as a single argument which will do what you want.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-03-29T04:30:07.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21279" PostTypeId="2" ParentId="21243" CreationDate="2016-03-29T05:37:36.170" Score="12" Body="&lt;p&gt;try this&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Use named code blocks and &lt;code&gt;noweb&lt;/code&gt; header to turn your code into a literate program.&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: my-code&#xA;#+BEGIN_SRC elisp :exports none &#xA;(+ 1 1)&#xA;#+END_SRC&#xA;&#xA;#+NAME: my-other-code &#xA;#+BEGIN_SRC elisp :exports none &#xA;(/ 4 (* 2 2))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Create an &lt;code&gt;org&lt;/code&gt; code block to format your code with your result&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org :results drawer replace :noweb yes :exports results &#xA;&#xA;  ,#+NAME: my-code-with-answer&#xA;  ,#+BEGIN_SRC elisp  :exports code &#xA;  &amp;lt;&amp;lt;my-code&amp;gt;&amp;gt; ;=&amp;gt; &amp;lt;&amp;lt;my-code()&amp;gt;&amp;gt;&#xA;  &amp;lt;&amp;lt;my-other-code&amp;gt;&amp;gt; ;=&amp;gt; &amp;lt;&amp;lt;my-other-code()&amp;gt;&amp;gt;&#xA;  ,#+END_SRC&#xA;&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Do a &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt; on &lt;code&gt;org&lt;/code&gt; code block and you should see results similar to the code below:&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;:RESULTS:&#xA;&#xA;#+NAME: my-code-with-answer&#xA;#+BEGIN_SRC elisp  :exports code &#xA;(+ 1 1) ;=&amp;gt; 2&#xA;(/ 4 (* 2 2)) ;=&amp;gt; 1&#xA;#+END_SRC&#xA;&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;If you post code to Github, you should see&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 1 1) ;=&amp;gt; 2&#xA;(/ 4 (* 2 2)) ;=&amp;gt; 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This code was tested with&lt;br&gt;&#xA;  GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  Org-Mode Version: 8.3.2&lt;br&gt;&#xA;  and github.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastActivityDate="2016-03-29T05:37:36.170" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21280" PostTypeId="1" AcceptedAnswerId="21283" CreationDate="2016-03-29T09:54:40.547" Score="2" ViewCount="539" Body="&lt;p&gt;How can I make Emacs break on an error, even if the error is being handled somewhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my current scenario, the setup of a major mode is modifying the buffer and I want to find out why (and then fix it). I made a buffer read-only, ran &lt;code&gt;edebug-defun&lt;/code&gt; on the major mode function and set &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, but running the major mode function still proceeds until it aborts with a “Buffer is read-only” error. How do I get it to break on error, so that I know where it is raised and can examine the environment? Or at the very least how do I get a backtrace?&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-29T11:51:09.080" Title="Break on all errors in edebug" Tags="|error-handling|edebug|backtrace|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21282" PostTypeId="2" ParentId="21235" CreationDate="2016-03-29T11:30:15.897" Score="3" Body="&lt;p&gt;Org will treat links without explicitly specified names as if they were images it needs to embed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot; rel=&quot;nofollow&quot;&gt;Manual&lt;/a&gt; mentions this in the section &lt;strong&gt;Images in LaTeX export&lt;/strong&gt;.  The way to side-step this, is to give a link a name, for example: &lt;code&gt;[[./files/article.pdf][./files/article.pdf]]&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-03-29T11:30:15.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21283" PostTypeId="2" ParentId="21280" CreationDate="2016-03-29T11:51:09.080" Score="2" Body="&lt;p&gt;Setting edebug options doesn't actually help here. Errors that are listed in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html#index-debug_002dignored_002derrors&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;debug-ignored-errors&lt;/code&gt;&lt;/a&gt; are ignored &lt;em&gt;even while executing under Edebug&lt;/em&gt;. This isn't mentioned in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Trapping-Errors.html#Trapping-Errors&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; (as of Emacs 24.5) but it is mentioned in the docstring of &lt;code&gt;debug-on-error&lt;/code&gt; (for which &lt;code&gt;edebug-on-error&lt;/code&gt; is just a proxy). (I don't understand why &lt;code&gt;debug-ignored-errors&lt;/code&gt; has any influence on Edebug: it only makes sense to me as errors for which the debugger should not trigger during normal operation, not while debugging.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So remove the problematic error from &lt;code&gt;debug-ignored-errors&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq debug-ignored-errors (delq 'buffer-read-only debug-ignored-errors))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or just set &lt;code&gt;debug-ignored-errors&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; while doing any debugging. This plus setting &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; is enough to break on the error and get a backtrace.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-29T11:51:09.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21284" PostTypeId="1" AcceptedAnswerId="21294" CreationDate="2016-03-29T13:12:37.173" Score="0" ViewCount="129" Body="&lt;p&gt;Recently I did some shit within Gnus: I deleted a lot (thousands) of mails, trying to respool them in another group and rename it to the first group after having deleted it (i.e. to prepend an old mailing-list group to the new one that changed name)… but well I got a backup but quite old… and since it’s mailing-lists I hope to get back some mails asking to other people subscribed to send them to me…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Waiting for that, what interest me now are recent mails: and I just noticed that I still have a &lt;em&gt;lot&lt;/em&gt; of &lt;code&gt;Incoming&amp;lt;code&amp;gt;&lt;/code&gt; within my &lt;code&gt;~/mail&lt;/code&gt;, and I think that could make a backup: do someone know how to “re-receive them”? aka exctract from these digests the mails of theses groups and respool them into them? I tried to open groups like &lt;code&gt;nnmbox:Incoming&amp;lt;code&amp;gt;&lt;/code&gt; but it doesn’t work (“No such group”).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how to open/respool that? It should be easy it’s just a digest of a lot of MIME messages…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I also tried to see what does functions like &lt;code&gt;nnmail-split-incoming&lt;/code&gt; but couldn’t figure out how to use it.&lt;/p&gt;&#xA;" OwnerUserId="11375" LastActivityDate="2016-03-29T16:19:26.770" Title="How to open a message/mime digest (within Gnus?), like ~/mail/Incoming&lt;code&gt;" Tags="|gnus|email|message|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21285" PostTypeId="1" AcceptedAnswerId="21311" CreationDate="2016-03-29T13:15:51.710" Score="26" ViewCount="8684" Body="&lt;p&gt;I would like to know how to start troubleshooting the following: &#xA;&lt;strong&gt;&lt;code&gt;C-SPC&lt;/code&gt; is not doing anything.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not appearing in the mini-buffer when I type it but when I look at &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;set-mark-command&lt;/code&gt;it's showing as bound to &lt;code&gt;C-SPC&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Environment&lt;/strong&gt;&lt;br/&gt;&#xA;I've installed GNU Emacs (24.5.1) via Homebrew and my &lt;code&gt;.emacs.d&lt;/code&gt;is based off of &lt;a href=&quot;http://www.braveclojure.com/basic-emacs/&quot; rel=&quot;noreferrer&quot;&gt;Clojure for the Brave and True&lt;/a&gt; with some additional packages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Steps taken so far&lt;/strong&gt;&lt;br/&gt;&#xA;I firstly tried deleting and reinstalling with no affect so what steps can I take to pin-point what's going on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional Info&lt;/strong&gt;&lt;br/&gt;&#xA;A list of all installed packages is in screenshot below:&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZIljQ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZIljQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8618" LastEditorUserId="29255" LastEditDate="2020-12-10T09:09:32.043" LastActivityDate="2020-12-10T09:09:32.043" Title="set-mark-command (C-SPC) not recognised/broken" Tags="|key-bindings|osx|mark|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21287" PostTypeId="2" ParentId="21275" CreationDate="2016-03-29T14:35:08.043" Score="3" Body="&lt;p&gt;You should be able to permanently change the face via the customization facility. Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-face slime-repl-inputed-output-face&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can change the foreground color directly, and if you save the changes (&lt;code&gt;Apply and Save&lt;/code&gt;), the changes will be stored for future use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this requires that slime is already started before you can make the change. After that, it should stick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can specify different faces for different types of display, such as dark and light backgrounds, terminals or GUI windows. To do this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;select the &lt;code&gt;[ State ]&lt;/code&gt; option, and set it to &lt;code&gt;For All Kinds of Displays&lt;/code&gt; by pressing &lt;code&gt;9&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then &lt;code&gt;[INS]&lt;/code&gt; a rule for each kind of display you want.&lt;/li&gt;&#xA;&lt;li&gt;For each rule, set the &lt;code&gt;Display&lt;/code&gt; option to a specific delay.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the example in the question, the result will look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Slime Repl Inputed Output Face:[sample]&#xA;   [ State ]: EDITED, shown value does not take effect until you set or save it.&#xA;   Face for the result of an evaluation in the SLIME REPL.&#xA;[INS] [DEL] Display: [ ] Type: [ ] X [ ] PM [ ] W32 [ ] NS [ ] DOS [ ] TTY&#xA;                     [X] Class: [X] Color [ ] Grayscale [ ] Monochrome&#xA;                     [ ] Minimum number of colors: 0&#xA;                     [X] Background brightness: [X] Light [ ] Dark&#xA;                     [ ] Supports attributes:&#xA;                           -- Empty face --&#xA;                        Show All Attributes&#xA;               [X] Foreground: red        [ Choose ]  (sample)&#xA;               Show All Attributes&#xA;[INS] [DEL] Display: [ ] Type: [ ] X [ ] PM [ ] W32 [ ] NS [ ] DOS [ ] TTY&#xA;                     [X] Class: [X] Color [ ] Grayscale [ ] Monochrome&#xA;                     [ ] Minimum number of colors: 0&#xA;                     [X] Background brightness: [ ] Light [X] Dark&#xA;                     [ ] Supports attributes:&#xA;                           -- Empty face --&#xA;                        Show All Attributes&#xA;               [X] Foreground: yellow     [ Choose ]  (sample)&#xA;               Show All Attributes&#xA;[INS]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-03-29T17:10:45.470" LastActivityDate="2016-03-29T17:10:45.470" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21288" PostTypeId="1" AcceptedAnswerId="21290" CreationDate="2016-03-29T14:39:10.437" Score="2" ViewCount="494" Body="&lt;p&gt;It should be nice to write yasnippets, which ask for filepath interactively using helm, predefining starting directory should be fine too.&lt;/p&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2018-02-23T11:21:01.087" Title="Find files interactively with a snippet" Tags="|helm|yasnippet|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21289" PostTypeId="2" ParentId="21285" CreationDate="2016-03-29T15:19:42.770" Score="7" Body="&lt;p&gt;One of the installed packages you have there may be overriding the C-SPC keybinding for something else. Try starting emacs without loading your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now try doing the key combination:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-h k C-SPC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you should see a buffer telling you what it is mapped to. If you don't then the problem is external to Emacs. In that case, one of the other programs you are running is either capturing the C-SPC keystroke and/or preventing it from getting to Emacs. This would be a case of closing all other programs before starting Emacs and also checking for custom keyboard combinations in system settings.&lt;/p&gt;&#xA;" OwnerUserId="11567" LastActivityDate="2016-03-29T15:19:42.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21290" PostTypeId="2" ParentId="21288" CreationDate="2016-03-29T15:36:35.383" Score="3" Body="&lt;p&gt;If the list is always the same you should be able to use the &lt;code&gt;yasnippet-choose-value&lt;/code&gt; function as described in the &lt;a href=&quot;http://capitaomorte.github.io/yasnippet/snippet-development.html#sec-3-8&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also do a snippet like this if you want the search through all of the files like you would when opening any file normally&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: test&#xA;# key: test&#xA;# --&#xA;My File: ${1:$$(unless yas-modified-p (completing-read &quot;File: &quot; 'read-file-name-internal))}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you have any questions or it doesn't work perfectly just let me know!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A function to use a predefined directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-yas-insert-file-name (dir)&#xA;  &quot;Insert absolute path inside yassnipets from given directory&quot;&#xA;  (let ((default-directory dir))&#xA;    (unless yas-modified-p&#xA;      (expand-file-name (completing-read &quot;File: &quot; 'read-file-name-internal)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="10978" LastEditDate="2016-03-30T14:28:32.127" LastActivityDate="2016-03-30T14:28:32.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21291" PostTypeId="1" CreationDate="2016-03-29T15:44:30.970" Score="7" ViewCount="3488" Body="&lt;p&gt;I would like to change the behavior of &lt;code&gt;C-c C-x i&lt;/code&gt; so that it creates a &quot;date created&quot; timestamp i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO New Task&#xA;   :LOGBOOK:&#xA;   CREATED: [2016-03-29 Tue 11:41]&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I basically want to log the age of tasks, but I'm not interested in tracking the time spent on a task. Is there a strait forward way to do this?&lt;/p&gt;&#xA;" OwnerUserId="11088" LastActivityDate="2017-08-28T15:48:06.513" Title="Add &quot;created&quot; timestamp to LOGBOOK" Tags="|org-mode|org-clock|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21292" PostTypeId="2" ParentId="21291" CreationDate="2016-03-29T16:03:33.333" Score="6" Body="&lt;p&gt;You can accomplish this by &lt;a href=&quot;http://orgmode.org/manual/Tracking-TODO-state-changes.html&quot; rel=&quot;noreferrer&quot;&gt;tracking TODO state changes&lt;/a&gt;. Specifically, if you add a timestamp to the &lt;code&gt;TODO&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords&#xA;   '((sequence &quot;TODO(t!)&quot; &quot;WAIT(w@/!)&quot; &quot;|&quot; &quot;DONE(d!)&quot; &quot;CANCELED(c@)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will add timestamps (indicated by the &lt;code&gt;!&lt;/code&gt;) when you create a new TODO, change it to WAIT, or change it to DONE. See the linked manual page for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get this timestamp entered into your LOGBOOK drawer, you need to set the variable &lt;code&gt;org-log-into-drawer&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; (or the name you want to use for the drawer if it isn't &quot;LOGBOOK&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will produce the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO My Task&#xA;   :LOGBOOK:&#xA;   - State &quot;TODO&quot;       from &quot;NEW&quot;        [2016-01-18 Mon 13:36]&#xA;   :END:&#xA;   Update stackexchange answer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think this is the closest you can get to the requested &lt;code&gt;CREATED:&lt;/code&gt; timestamp using orgmodes built-in features. To further change the formatting would require some custom elisp I think.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-03-29T17:21:43.867" LastActivityDate="2016-03-29T17:21:43.867" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21293" PostTypeId="1" CreationDate="2016-03-29T16:03:45.533" Score="9" ViewCount="975" Body="&lt;p&gt;My intention is to write Arabic document using org-mode. Please consider the following MWE, given that my configuration in &lt;code&gt;init.el&lt;/code&gt; has below code to enable writing of Arabic script from right to left (rtl) instead of left to right (ltr) default behavior:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; for right-to-left direction in org-mode&#xA;(defun set-bidi-env ()&#xA;  &quot;interactive&quot;&#xA;  (setq bidi-paragraph-direction 'nil))&#xA;(add-hook 'org-mode-hook 'set-bidi-env)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MWE.org buffer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: org -*-&#xA;#+OPTIONS: toc:1&#xA;#+LANGUAGE: ar&#xA;#+CREATOR: Emacs 25.1.50.2 (Org mode 8.3.4)&#xA;&#xA;* تعريف بالارقام الهندية او الشرقية ١، ٢، ٣&#xA;* هذه النقطة الان باللغة العربية &#xA;&#xA;* ما هو الحل؟&#xA;* النهاية&#xA;&#xA;* Introducing Hindi or estern numbers 1, 2, 3&#xA;&#xA;* This point now in Arabic&#xA;&#xA;* How to solve it?&#xA;&#xA;* The end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last four points in English are translation of the first four bullets in Arabic. So now if I export it to &lt;code&gt;HTML&lt;/code&gt; format by hitting &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;e&lt;/kbd&gt; &lt;kbd&gt;h&lt;/kbd&gt; &lt;kbd&gt;o&lt;/kbd&gt; I get this output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HZ5xm.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HZ5xm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Issues&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;Table of Contents&lt;/code&gt; was not translated into Arabic as would be normally expected when language was set to &lt;code&gt;ar&lt;/code&gt;. How to make org-mode aware of these Arabic equivalents of any document structure, e.g. TOC, chapter, figure, table, etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;This now is fixed. I updated the &lt;code&gt;ox.el&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-smart-quotes-alist): add &quot;ar&quot; to the list&#xA;&#xA;(org-export-dictionary): add Arabic equivalents to template keywords&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so I would put only the relevant code to &lt;code&gt;table of contents&lt;/code&gt; which is enough for the current MWE:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;Table of Contents&quot;&#xA; (&quot;ar&quot; :default &quot;قائمة المحتويات&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/I12vO.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/I12vO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;List numbers were in Arabic format &lt;code&gt;1,2,3&lt;/code&gt; (yeah very counter-intuitive I know but bear with me please), while I wanted to appear in Hindi (see 1st list bullet in the output image). I want Hindi in Arabic language instead of &lt;em&gt;1, 2, 3&lt;/em&gt; numbers. This applies to table of content also. How to achieve this customization?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;These are the hindi equivalent for arabic digits:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                 (&quot;0&quot; &quot;\u0660&quot;)&#xA;                 (&quot;1&quot; &quot;\u0661&quot;)&#xA;                 (&quot;2&quot; &quot;\u0662&quot;)&#xA;                 (&quot;3&quot; &quot;\u0663&quot;)&#xA;                 (&quot;4&quot; &quot;\u0664&quot;)&#xA;                 (&quot;5&quot; &quot;\u0665&quot;)&#xA;                 (&quot;6&quot; &quot;\u0666&quot;)&#xA;                 (&quot;7&quot; &quot;\u0667&quot;)&#xA;                 (&quot;8&quot; &quot;\u0668&quot;)&#xA;                 (&quot;9&quot; &quot;\u0669&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this would come in handy to get it exported in case of Arabic language.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Finally, as you can see in the output, the direction of the first four list items were from left to right not like what is expected in Arabic language from right to left. How to change direction depending on the context of script used (Arabic/English)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Your help would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2016-04-02T06:55:26.140" LastActivityDate="2022-11-22T09:01:55.333" Title="How to get org-mode fully support Arabic language for export?" Tags="|org-mode|org-export|html|right-to-left|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21294" PostTypeId="2" ParentId="21284" CreationDate="2016-03-29T16:19:26.770" Score="1" Body="&lt;p&gt;The IncomingXXXXX-files are backups of incoming email (typically only enabled in development versions of Gnus). The variable &lt;code&gt;mail-source-delete-incoming&lt;/code&gt; controls the behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can open an mbox file using the command &lt;code&gt;G f&lt;/code&gt; (gnus-group-make-doc-group) which prompts you for a file name. You can then copy the emails from the new group corresponding to the file to whatever group you want them in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Another way is to copy the IncomingXXXXX-files into /var/mail/YOURLOGIN, if you have configured Gnus to fetch email from there, but with &lt;code&gt;G f&lt;/code&gt; you have more control over the process.)&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-03-29T16:19:26.770" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21295" PostTypeId="2" ParentId="19801" CreationDate="2016-03-29T16:23:42.570" Score="0" Body="&lt;p&gt;One viable alternative is to create a message with a &lt;code&gt;Lisp_Object&lt;/code&gt; instead, but beware that passing raw numbers without using functions like &lt;code&gt;make_number&lt;/code&gt; or &lt;code&gt;make_float&lt;/code&gt; will cause Emacs to crash.  This is not technically speaking the answer to the question, but it permits seeing values within Emacs and is not subject to the limitations of &lt;code&gt;GLYPH_DEBUG&lt;/code&gt; (which cannot print a &lt;code&gt;Lisp_Object&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lisp_Object my_object_one = make_float (0.1);&#xA;AUTO_STRING (my_string_one, &quot;This is the value of `my_object_one':  %s&quot;);&#xA;CALLN (Fmessage, my_string_one, my_object_one);&#xA;&#xA;Lisp_Object my_object_two = make_number (777);&#xA;AUTO_STRING (my_string_two, &quot;This is the value of `my_object_two':  %s&quot;);&#xA;CALLN (Fmessage, my_string_two, my_object_two);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following examples use &lt;code&gt;fprintf&lt;/code&gt; to generate output to STDERR (seen from a separate terminal that launched Emacs), converting &lt;code&gt;Lisp_Object&lt;/code&gt; into usable information with &lt;code&gt;SSDATA&lt;/code&gt;.  The usual formats apply. e.g., &lt;code&gt;%f&lt;/code&gt; for float, &lt;code&gt;%d&lt;/code&gt; for integer, &lt;code&gt;%s&lt;/code&gt; for a string, etc.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fprintf (stderr, &quot;My lisp object:  %s\n&quot;, SSDATA (Fchar_to_string (make_number (101))));&#xA;&#xA;fprintf (stderr, &quot;string: %s | int: %d\n&quot;, SSDATA (build_string (&quot;foo&quot;)), 69);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2018-06-18T14:13:30.260" LastActivityDate="2018-06-18T14:13:30.260" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21296" PostTypeId="1" CreationDate="2016-03-29T17:12:41.147" Score="1" ViewCount="1088" Body="&lt;p&gt;I like to use variable-pitch mode when working with prose in org-mode, but I have to turn it off when I involve tables or code blocks. Using answers found elsewhere, such as &lt;a href=&quot;https://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables&quot;&gt;https://stackoverflow.com/questions/3758139/variable-pitch-for-org-mode-fixed-pitch-for-tables&lt;/a&gt; I can obtain what I am looking for in vanilla Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My issue is that this does not work with the code blocks in Spacemacs. Spacemacs seems to add font-lock'd faces to code blocks, and I do not know how to make only these faces stay fixed-pitch while the rest of the buffer is in variable-pitch-mode. Would anyone have any advice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently use the following Spacemacs layers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; auto-completion&#xA; better-defaults&#xA; emacs-lisp&#xA; git&#xA; markdown&#xA; org&#xA; (shell :variables&#xA;        shell-default-height 30&#xA;        shell-default-position 'bottom)&#xA; spell-checking&#xA; syntax-checking&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZLBdg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZLBdg.png&quot; alt=&quot;A screenshot of Spacemacs entirely in fixed-pitch mode.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OZUl9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OZUl9.png&quot; alt=&quot;A screenshot of Spacemacs entirely in variable-pitch mode.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11569" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-03-29T19:09:23.297" Title="How to get fixed-pitch code blocks in variable-pitch Spacemacs org-mode?" Tags="|org-mode|fonts|spacemacs|font-lock|literate-programming|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21297" PostTypeId="2" ParentId="21296" CreationDate="2016-03-29T19:09:23.297" Score="1" Body="&lt;p&gt;You can configure the faces &lt;code&gt;org-block-background&lt;/code&gt; and &lt;code&gt;org-table&lt;/code&gt;, respectively, and set a fixed-width font foundry.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-03-29T19:09:23.297" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21298" PostTypeId="1" AcceptedAnswerId="21306" CreationDate="2016-03-29T19:55:04.827" Score="3" ViewCount="236" Body="&lt;p&gt;I'm trying to make &lt;a href=&quot;https://github.com/pashinin/workgroups2&quot; rel=&quot;nofollow noreferrer&quot;&gt;Workgroups2&lt;/a&gt; more convenient by displaying a list of workgroups in the mini-buffer on pressing the prefix key (&lt;kbd&gt;C-c z&lt;/kbd&gt;), e.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FZqvr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FZqvr.png&quot; alt=&quot;List of workgroups&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes it convenient to use the index &lt;kbd&gt;0&lt;/kbd&gt;-&lt;kbd&gt;9&lt;/kbd&gt; to switch workgroups:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar wg-prefixed-map&#xA;  (wg-fill-keymap&#xA;   (make-sparse-keymap)&#xA;&#xA;   ;; workgroup switching&#xA;   (kbd &quot;C-j&quot;)        'wg-switch-to-workgroup-at-index&#xA;   (kbd &quot;j&quot;)          'wg-switch-to-workgroup-at-index&#xA;   (kbd &quot;0&quot;)          'wg-switch-to-workgroup-at-index-0&#xA;   (kbd &quot;1&quot;)          'wg-switch-to-workgroup-at-index-1&#xA;   (kbd &quot;2&quot;)          'wg-switch-to-workgroup-at-index-2&#xA;   (kbd &quot;3&quot;)          'wg-switch-to-workgroup-at-index-3&#xA;   (kbd &quot;4&quot;)          'wg-switch-to-workgroup-at-index-4&#xA;   (kbd &quot;5&quot;)          'wg-switch-to-workgroup-at-index-5&#xA;   (kbd &quot;6&quot;)          'wg-switch-to-workgroup-at-index-6&#xA;   (kbd &quot;7&quot;)          'wg-switch-to-workgroup-at-index-7&#xA;   (kbd &quot;8&quot;)          'wg-switch-to-workgroup-at-index-8&#xA;   (kbd &quot;9&quot;)          'wg-switch-to-workgroup-at-index-9&#xA; )&#xA;&quot;The keymap that sits on `wg-prefix-key'.&quot;)&#xA;&#xA;(defun wg-fill-keymap (keymap &amp;amp;rest binds)&#xA;  &quot;Return KEYMAP after defining in it all keybindings in BINDS.&quot;&#xA;  (while binds&#xA;    (define-key keymap (car binds) (cadr binds))&#xA;    (setq binds (cddr binds)))&#xA;  keymap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The list can be generated with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(wg-fontified-message&#xA;   (wg-workgroup-list-display))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;br&gt;&#xA;Given &lt;kbd&gt;C-c z&lt;/kbd&gt; as the prefix key for &lt;a href=&quot;https://github.com/pashinin/workgroups2&quot; rel=&quot;nofollow noreferrer&quot;&gt;Workgroups2&lt;/a&gt;, is it possible to bind it to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(wg-fontified-message&#xA;   (wg-workgroup-list-display))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that it displays the list of workgroups in the mini-buffer? &lt;kbd&gt;C-c z&lt;/kbd&gt; should still be the prefix after the binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;&#xA;This question is similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/16696/can-the-prefix-of-a-key-sequence-have-an-effect&quot;&gt;Can the prefix of a key-sequence have an effect?&lt;/a&gt;. The comments suggest &lt;code&gt;set-transient-map&lt;/code&gt; or &lt;code&gt;keymapp&lt;/code&gt;. If either of these is useful, please kindly show how the above code can be modified to implement the function. Thank you.&lt;/p&gt;&#xA;" OwnerUserId="10828" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-03-30T00:33:03.067" Title="Bind function to the prefix key of Workgroups2" Tags="|key-bindings|prefix-keys|" AnswerCount="1" CommentCount="9" ClosedDate="2016-04-03T22:07:28.580" ContentLicense="CC BY-SA 3.0" />
  <row Id="21299" PostTypeId="2" ParentId="21053" CreationDate="2016-03-29T20:06:45.123" Score="1" Body="&lt;p&gt;I ended up with this &lt;a href=&quot;https://github.com/lislon/emacs-switch-lang&quot; rel=&quot;nofollow&quot;&gt;solution&lt;/a&gt; on python, which parses xinput and sends a key to emacs window.&lt;/p&gt;&#xA;" OwnerUserId="10958" LastEditorUserId="10958" LastEditDate="2016-04-29T20:34:21.070" LastActivityDate="2016-04-29T20:34:21.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21300" PostTypeId="2" ParentId="20542" CreationDate="2016-03-29T21:37:27.043" Score="3" Body="&lt;p&gt;Do you have clojure mode installed? Try &lt;code&gt;M-x install-package clojure-mode&lt;/code&gt; if not and then run &lt;code&gt;cider-jack-in&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11559" LastActivityDate="2016-03-29T21:37:27.043" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21301" PostTypeId="1" AcceptedAnswerId="36874" CreationDate="2016-03-29T21:53:34.070" Score="19" ViewCount="2595" Body="&lt;p&gt;Is there a good general customization of org-babel to run asynchronously?&#xA;Recently I plan to use MATLAB via org-babel, but I would like it in an async manner, since some calculations do take time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not wish to customize ob-matlab only. This is because I think it should be done in the level of framework instead of an application. In other words, a same modification should enable async feature for other language extensions e.g. R language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a good solution?&#xA;So far I have tried &lt;code&gt;async.el&lt;/code&gt; as well as &lt;code&gt;deferred.el&lt;/code&gt; to modify &lt;code&gt;org-babel-execute-safely-maybe&lt;/code&gt; that can be found in &lt;code&gt;ob-core.el&lt;/code&gt; at the moment.&lt;/p&gt;&#xA;" OwnerUserId="11313" LastActivityDate="2017-11-14T11:28:08.877" Title="Async execution in org babel" Tags="|org-babel|matlab|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21302" PostTypeId="2" ParentId="21291" CreationDate="2016-03-29T22:18:23.513" Score="9" Body="&lt;p&gt;Instead of adding it to the LOGBOOK, it might work better to add it a property.  In particular, it's easier to get the created time out that way.  This function sets a &lt;code&gt;CREATED&lt;/code&gt; property with the current time in an inactive time stamp.  It will not alter any existing &lt;code&gt;CREATED&lt;/code&gt; property.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar org-created-property-name &quot;CREATED&quot;&#xA;  &quot;The name of the org-mode property that stores the creation date of the entry&quot;)&#xA;&#xA;(defun org-set-created-property (&amp;amp;optional active NAME)&#xA;  &quot;Set a property on the entry giving the creation time.&#xA;&#xA;By default the property is called CREATED. If given the `NAME'&#xA;argument will be used instead. If the property already exists, it&#xA;will not be modified.&quot;&#xA;  (interactive)&#xA;  (let* ((created (or NAME org-created-property-name))&#xA;         (fmt (if active &quot;&amp;lt;%s&amp;gt;&quot; &quot;[%s]&quot;))&#xA;         (now  (format fmt (format-time-string &quot;%Y-%m-%d %a %H:%M&quot;))))&#xA;    (unless (org-entry-get (point) created nil)&#xA;      (org-set-property created now))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're using &lt;code&gt;org-capture&lt;/code&gt; to create entries, you can call this automatically by adding it to a hook: &lt;code&gt;(add-hook 'org-capture-before-finalize-hook #'org-set-created-property)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="15477" LastEditDate="2017-08-28T15:48:06.513" LastActivityDate="2017-08-28T15:48:06.513" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21303" PostTypeId="1" CreationDate="2016-03-29T22:19:37.060" Score="4" ViewCount="549" Body="&lt;p&gt;I'm a big fan of &lt;strong&gt;rainbow-delimiters&lt;/strong&gt;. Even when I do not code in Lisp I can quickly and easily find matching bracket just looking at the code. My method works better on dark backgrounds, but can be tweaked to work on light backgrounds as well. The thing that still needs doing is automatic change of bracket colours after the theme change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My code so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'color)&#xA;(defun hsl-to-hex (h s l)&#xA;  &quot;Convert H S L to hex colours.&quot;&#xA;  (let (rgb)&#xA;    (setq rgb (color-hsl-to-rgb h s l))&#xA;    (color-rgb-to-hex (nth 0 rgb)&#xA;                      (nth 1 rgb)&#xA;                      (nth 2 rgb))))&#xA;&#xA;(defun bracket-colors ()&#xA;  &quot;Calculate the bracket colours based on background.&quot;&#xA;  (let (hexcolors lightvals)&#xA;    (if (&amp;gt;= (color-distance  &quot;white&quot;&#xA;                             (face-attribute 'default :background))&#xA;            (color-distance  &quot;black&quot;&#xA;                             (face-attribute 'default :background)))&#xA;        (setq lightvals (list 0.65 0.55))&#xA;      (setq lightvals (list 0.35 0.30)))&#xA;&#xA;    (concatenate 'list&#xA;                 (dolist (n'(.71 .3 .11 .01))&#xA;                   (push (hsl-to-hex (+ n 0.0) 1.0 (nth 0 lightvals)) hexcolors))&#xA;                 (dolist (n '(.81 .49 .17 .05))&#xA;                   (push (hsl-to-hex (+ n 0.0) 1.0 (nth 1 lightvals)) hexcolors)))&#xA;    (reverse hexcolors)))&#xA;&#xA;&#xA;(defun colorise-brackets ()&#xA;  &quot;Apply my own colours to rainbow delimiters.&quot;&#xA;  (require 'rainbow-delimiters)&#xA;  (custom-set-faces&#xA;   ;; or use (list-colors-display)&#xA;   `(rainbow-delimiters-depth-1-face ((t (:foreground &quot;#888&quot;))))&#xA;   `(rainbow-delimiters-depth-2-face ((t (:foreground ,(nth 0 (bracket-colors))))))&#xA;   `(rainbow-delimiters-depth-3-face ((t (:foreground ,(nth 1 (bracket-colors))))))&#xA;   `(rainbow-delimiters-depth-4-face ((t (:foreground ,(nth 2 (bracket-colors))))))&#xA;   `(rainbow-delimiters-depth-5-face ((t (:foreground ,(nth 3 (bracket-colors))))))&#xA;   `(rainbow-delimiters-depth-6-face ((t (:foreground ,(nth 4 (bracket-colors))))))&#xA;   `(rainbow-delimiters-depth-7-face ((t (:foreground ,(nth 5 (bracket-colors))))))&#xA;   `(rainbow-delimiters-depth-8-face ((t (:foreground ,(nth 6 (bracket-colors))))))&#xA;   `(rainbow-delimiters-depth-9-face ((t (:foreground ,(nth 7 (bracket-colors))))))&#xA;   `(rainbow-delimiters-unmatched-face ((t (:foreground &quot;white&quot; :background &quot;red&quot;))))&#xA;   `(highlight ((t (:foreground &quot;#ff0000&quot; :background &quot;#888&quot;))))&#xA;   ))&#xA;&#xA;(colorise-brackets)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After changing from dark to light theme, or vice versa I need to manually eval following in the scratch buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(colorise-brackets)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I make it automatic? What other improvements would you suggest?&lt;/p&gt;&#xA;" OwnerUserId="8952" LastActivityDate="2016-03-29T22:19:37.060" Title="Looking for a better way of tweaking rainbow delimiters" Tags="|themes|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21304" PostTypeId="1" AcceptedAnswerId="21305" CreationDate="2016-03-29T22:35:55.930" Score="3" ViewCount="387" Body="&lt;p&gt;I'm making some functions to interact with Mercurial.  Many Mercurial commands take a repository as an argument, and that argument can be specified either by a path to the root of the repository or by a repo name.  These repo names can be configured in the user's &lt;code&gt;.hgrc&lt;/code&gt; file, and it is easy to get a list of the names that are defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to make a completing read function that dynamically completes a path to a directory &lt;strong&gt;&lt;em&gt;or&lt;/em&gt;&lt;/strong&gt; an item from a list.  I'd like it to work just like &lt;code&gt;ido-read-directory-name&lt;/code&gt;, but with the items from a list also offered as options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been digging through the documentation, and also through &lt;code&gt;mini_buffer.el&lt;/code&gt; and &lt;code&gt;ido.el&lt;/code&gt;.  The only hint I have so far is that I can override the variable &lt;code&gt;read-file-name-function&lt;/code&gt;, but it seems like I'd end up reimplementing a lot of functionality for dynamically completing directory names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any guidance for me?  Or perhaps an example?&lt;/p&gt;&#xA;" OwnerUserId="11305" LastEditorUserId="105" LastEditDate="2016-06-22T19:58:38.420" LastActivityDate="2016-06-22T19:58:38.420" Title="Completing read a directory or an element from a list" Tags="|completion|ido|completing-read|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21305" PostTypeId="2" ParentId="21304" CreationDate="2016-03-29T23:23:16.553" Score="4" Body="&lt;p&gt;You can try something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((dir-table (apply-partially #'completion-table-with-predicate&#xA;                                 #'completion-file-name-table&#xA;                                 #'file-directory-p&#xA;                                 'strict))&#xA;       (my-table&#xA;        (completion-table-in-turn &amp;lt;reponamesfromhg&amp;gt; dir-table)))&#xA;  (completing-read &quot;Foo:&quot; my-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-03-30T15:02:55.317" LastActivityDate="2016-03-30T15:02:55.317" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21306" PostTypeId="2" ParentId="21298" CreationDate="2016-03-30T00:33:03.067" Score="2" Body="&lt;p&gt;One way to do it is, instead of binding &lt;code&gt;C-c z&lt;/code&gt; to a prefix key, bind it to a command that displays what you want and then calls &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html#index-set_002dtransient_002dmap&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;set-transient-map&lt;/code&gt;&lt;/a&gt; to read a key sequence and interpret it in another map. Any key that isn't bound in the other map will be interpreted in the global map, so rather than &lt;code&gt;wg-prefixed-map&lt;/code&gt;, you should provide a keymap where unknown bindings are made undefined.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wg-prefix-show-information ()&#xA;  &quot;Display information and read a key from \\[wg-filled-map].&#xA;&#xA;\\{wg-filled-map}&quot;&#xA;  (interactive)&#xA;  (message …)&#xA;  (set-transient-map `(keymap (t . undefined) ,@wg-filled-map)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This isn't ideal because it doesn't integrate well with help. For example &lt;code&gt;C-h C-c z&lt;/code&gt; will say that &lt;code&gt;wg-prefix-show-information&lt;/code&gt; is that function above, hence the prominent mention of &lt;code&gt;wg-filled-map&lt;/code&gt; in the function's docstring. Also &lt;code&gt;C-c z C-h&lt;/code&gt; will not propose a list of bindings (I think this can be fixed by setting &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Help-Functions.html#index-help_002dform&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;help-form&lt;/code&gt;&lt;/a&gt; but I haven't investigated further). If the user types a multi-key sequence slowly, they'll be shown the keys they typed not including the initial &lt;code&gt;C-c z&lt;/code&gt; which might be confusing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all you need to do is display something in the echo area, an alternative approach would be to leverage the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Format-of-Keymaps.html#index-keymap-prompt-string&quot; rel=&quot;nofollow&quot;&gt;prompt string&lt;/a&gt; of a keymap. This can only be a constant string, but if it only needs to be regenerated due to a few events as opposed to recomputed on the fly, you can make those events change the keymap object:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar wg-filled-map&#xA;    (let ((map (make-sparse-key-map &quot;nothing going on&quot;)))&#xA;      …))&#xA;(defun wg-something-changed-hook ()&#xA;  (setcdr wg-filled-map (format &quot;the system state is …&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want some fancier processing, an alternative approach is to switch to the minibuffer or to a new, transient buffer where &lt;code&gt;wg-prefix-map&lt;/code&gt; is the local map. This is what isearch does, for example (with a much more complex use case as one typically enters many keys, not just one). Another package that uses this kind of approach is &lt;a href=&quot;https://github.com/magit/magit/blob/master/lisp/magit-popup.el&quot; rel=&quot;nofollow&quot;&gt;magit&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-03-30T00:33:03.067" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21307" PostTypeId="1" AcceptedAnswerId="21318" CreationDate="2016-03-30T05:57:16.037" Score="1" ViewCount="284" Body="&lt;p&gt;So I, like many others, use org-mode to implement GTD to manage my life. One thing that happens since I'm in school is long-term projects, which have milestones. In and of themselves these milestones are strictly sequential events, and within these milestones even usually there are strictly sequential events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it stands now, I mark all the items that are blocked because of the current &lt;code&gt;NEXTACTION&lt;/code&gt; as &lt;code&gt;TODO&lt;/code&gt;. Whenever I finish a task and mark it &lt;code&gt;DONE&lt;/code&gt;, I have the mental burden of then reviewing my project support materials to determine what becomes the new &lt;code&gt;NEXTACTION&lt;/code&gt;. This is fine, but inefficient if I already &lt;em&gt;know&lt;/em&gt; the order of events. Is there a way to automatically change the next item down (in a list, actual next line, any way) to &lt;code&gt;NEXTACTION&lt;/code&gt; when I mark an item &lt;code&gt;DONE&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="9315" LastActivityDate="2016-03-31T07:48:34.673" Title="When setting item to DONE, how do I automatically change following item to NEXTACTION?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21308" PostTypeId="1" CreationDate="2016-03-30T06:50:04.397" Score="1" ViewCount="225" Body="&lt;p&gt;Title says it all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to have a search query which matches all messages whose &lt;em&gt;Subject&lt;/em&gt; starts with &lt;code&gt;[Spam]&lt;/code&gt;.  So far, I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[Spam]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[spam]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\[Spam\]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\[Spam\]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\\[Spam\\]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\\[Spam\\]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'd appreciate any pointer in the right direction ...&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2017-09-22T02:53:37.590" Title="How to escape brackets in mu4e search queries?" Tags="|search|mu4e|escape|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21309" PostTypeId="1" CreationDate="2016-03-30T07:22:56.230" Score="4" ViewCount="180" Body="&lt;p&gt;I'm using &lt;em&gt;org-contacts&lt;/em&gt; as mu4e address book.  When I start typing an address in, say, the &lt;em&gt;To:&lt;/em&gt; field and press &lt;code&gt;TAB&lt;/code&gt;, I get a &lt;em&gt;Helm&lt;/em&gt; buffer with possible completions, ordered alphabetically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can make mu4e/Helm &lt;strong&gt;learn&lt;/strong&gt; which addresses I use most often and order the matches by usage frequency?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2018-01-03T13:12:14.490" Title="Can Helm/mu4e learn which selection/contacts I use most often?" Tags="|helm|spacemacs|mu4e|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21310" PostTypeId="1" AcceptedAnswerId="24007" CreationDate="2016-03-30T08:57:43.983" Score="3" ViewCount="184" Body="&lt;p&gt;Is there a way to use ido to select tasks from the &lt;code&gt;org-clock-select-task&lt;/code&gt; list? Having to read through the list to find the right task and then look at the number makes me lose my flow :)&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="5213" LastEditDate="2016-04-30T14:12:16.760" LastActivityDate="2017-03-23T09:58:47.803" Title="Can I use ido-mode for org-clock-select-task?" Tags="|org-mode|ido|org-clock|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21311" PostTypeId="2" ParentId="21285" CreationDate="2016-03-30T12:43:31.310" Score="47" Body="&lt;p&gt;&lt;strong&gt;System Preferences &gt; Keyboard &gt; Shortcuts &gt; Input Sources &gt; Select the previous input source and &lt;em&gt;uncheck&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/users/11567/saltycraig&quot;&gt;saltycraig&lt;/a&gt;'s tip on &lt;code&gt;C-h k C-SPC&lt;/code&gt; did nothing when I typed it. So, thanks to &lt;a href=&quot;https://emacs.stackexchange.com/users/115/kaushal-modi&quot;&gt;Kaushal Modi&lt;/a&gt; for pointing towards the OS level. Saved many hours of messing around with all my packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completeness I run it as a GUI app (so will need to go and investigate how to start it with &lt;code&gt;emacs -Q&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks everyone!&lt;br/&gt;&lt;br/&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/55IHK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/55IHK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8618" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-03-30T12:56:03.740" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21312" PostTypeId="1" AcceptedAnswerId="21316" CreationDate="2016-03-30T13:14:48.807" Score="2" ViewCount="9700" Body="&lt;p&gt;I want code completion for C/C++ functions and variables from headers. I tried to install Auto-complete and Company, but C/C ++ functions/variables aren't complemented. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the relevant portion of my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Auto-complete (AC)&#xA;(require 'auto-complete)&#xA;&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11575" LastEditorUserId="675" LastEditDate="2016-03-31T18:37:17.210" LastActivityDate="2016-03-31T18:37:17.210" Title="Auto-complete C/C++ functions" Tags="|auto-complete-mode|c|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21315" PostTypeId="1" AcceptedAnswerId="21333" CreationDate="2016-03-30T14:42:17.540" Score="6" ViewCount="250" Body="&lt;p&gt;Using Aquamacs 3.2 on Mac OSX Yosemite. I run with &lt;code&gt;delete-selection-mode&lt;/code&gt; set, and it mostly works as advertised. However, if I'm in TeX mode (AucTeX), make a selection, and then type &lt;code&gt;$&lt;/code&gt;, the selection is cleared and the &lt;code&gt;$&lt;/code&gt; appended. So for example if I select &lt;code&gt;foobar&lt;/code&gt; in &lt;code&gt;xyzfoobarxyz&lt;/code&gt; and type &lt;code&gt;$&lt;/code&gt;, I get &lt;code&gt;xyzfoobar$xyz&lt;/code&gt; instead of the desired &lt;code&gt;xyz$xyz&lt;/code&gt;. Is this known/documented behavior, or a bug? If it's a bug, is it an AucTeX or an Aquamacs issue (or an Emacs issue)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: In response to Tobias' comment below, &lt;code&gt;C-h k $&lt;/code&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$ runs the command TeX-insert-dollar, which is an interactive compiled&#xA;  Lisp function in `tex.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to $.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(TeX-insert-dollar &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Insert dollar sign.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If current math mode was not entered with a dollar, refuse to insert&#xA;  one.  Show matching dollar sign if this dollar sign ends the TeX math&#xA;  mode and 'blink-matching-paren' is non-nil. When outside math mode,&#xA;  the behavior is controlled by the variable 'TeX-electric-math'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With raw ^U prefix, insert exactly one dollar sign.  With optional&#xA;  ARG, insert that many dollar signs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And, the function &lt;code&gt;delete-selection-mode&lt;/code&gt; is defined in &lt;code&gt;delsel.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm far from LISP-literate. Perhaps the &lt;code&gt;TeX-insert-dollar&lt;/code&gt; function does not take the delete selection mode into account (either by design or by omission)?&lt;/p&gt;&#xA;" OwnerUserId="11578" LastEditorUserId="5296" LastEditDate="2016-04-01T13:56:13.773" LastActivityDate="2016-04-01T13:56:13.773" Title="delete-selection-mode and $" Tags="|auctex|delete-selection-mode|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="21316" PostTypeId="2" ParentId="21312" CreationDate="2016-03-30T16:56:43.803" Score="5" Body="&lt;p&gt;A vanilla company install wont quite get you where you want; you'll need to use use something like the &lt;code&gt;company-c-headers&lt;/code&gt; package. Tuhdo has written an &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;noreferrer&quot;&gt;excellent document&lt;/a&gt; on using Emacs as a C/C++ IDE, which has instructions on setting up &lt;code&gt;company-c-headers&lt;/code&gt;, along with a lot of other stuff. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know what Emacs version you're using, but in 24.5 with Company, you'd do something like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install the &lt;code&gt;company-c-headers&lt;/code&gt; package from MELPA -- &lt;code&gt;M-x package-install company-c-headers&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add this to your emacs config file (&lt;code&gt;init.el&lt;/code&gt; / &lt;code&gt;.emacs.d&lt;/code&gt; / whathaveyou)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'company)&#xA;(add-hook 'global-init-hook 'global-company-mode)&#xA;(add-to-list 'company-backends 'company-c-headers)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;company-c-headers&lt;/code&gt; by default only searches two paths for headers. If you want it to search others, you'll need to add them yourself. (For more on that, see &lt;a href=&quot;http://tuhdo.github.io/c-ide.html#orgheadline16&quot; rel=&quot;noreferrer&quot;&gt;Tuhdo&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="10319" LastEditorUserId="563" LastEditDate="2016-03-31T10:35:42.487" LastActivityDate="2016-03-31T10:35:42.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21317" PostTypeId="2" ParentId="21308" CreationDate="2016-03-30T17:52:22.017" Score="1" Body="&lt;p&gt;To the best of my knowledge, you cannot search for special characters like &lt;code&gt;[&lt;/code&gt; in mu/mu4e/Xapian (the underlying database mu-find queries). The best I know of is to use the &lt;code&gt;subject&lt;/code&gt; (&lt;code&gt;s&lt;/code&gt;) flag, with a query that starts like so:&lt;code&gt;s:spam&lt;/code&gt; (mu searches are always case-insensitive). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is, admittedly, a little less precise than you might like, but is a side-effect of mu's &quot;be as eager as possible in matching&quot; approach, I believe.&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-03-30T17:52:22.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21318" PostTypeId="2" ParentId="21307" CreationDate="2016-03-30T23:43:30.433" Score="2" Body="&lt;p&gt;You can use &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-depend.html&quot; rel=&quot;nofollow&quot;&gt;org-depend&lt;/a&gt; (from the &lt;code&gt;org-plus-contrib&lt;/code&gt; package) to do exactly this.  Make sure it's loaded by adding &lt;code&gt;(add-to-list 'org-modules 'org-depend)&lt;/code&gt; to your init file.  Then just set the &lt;code&gt;TRIGGER&lt;/code&gt; property to &lt;code&gt;chain-siblings(NEXTACTION)&lt;/code&gt;.  When this entry is marked done, the next sibling will be set to &lt;code&gt;NEXTACTION&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; it gets the same &lt;code&gt;TRIGGER&lt;/code&gt; property, so you can continue the chain.  More complex methods for selecting the &quot;next&quot; item are possible.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="11510" LastEditDate="2016-03-31T07:48:34.673" LastActivityDate="2016-03-31T07:48:34.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21319" PostTypeId="2" ParentId="21038" CreationDate="2016-03-31T02:23:31.340" Score="10" Body="&lt;p&gt;You can skip specific maildir from indexing for search, using .noindex file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from mu-index(1):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If  there is a file called .noindex in a directory, the contents of that directory and all of its subdirectories&#xA;  will be ignored. This can be useful to exclude certain directories from the indexing process, for example direc‐&#xA;  tories with spam-messages.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;ex. $ touch ~/Maildir/Gmail/[Gmail].Trash/.noindex &amp;amp;&amp;amp; mu index&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-03-31T02:23:31.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21320" PostTypeId="2" ParentId="21276" CreationDate="2016-03-31T09:27:34.513" Score="3" Body="&lt;p&gt;You do not specify what's wrong with opening a new GUI emacs window. If the problem is the long startup time you may consider using emacsclient as your editor. In a nutshell you run &lt;code&gt;(server-start)&lt;/code&gt; in your emacs init file and keep your regular GUI emacs open, and then tell git to use an editor called emacsclient. What happens is that the edited file pops up in a new buffer in your running emacs. After you are done with it you press &lt;code&gt;C-x #&lt;/code&gt; to finish the emacsclient session and then git (or other shell process that started the editor) knows that the editor &quot;emacsclient&quot; is done with the file and continues with its thing. (&quot;emacsclient&quot; is also one word, so it solves your immediate problem too)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even when your editing has to be done in the terminal window you can run &lt;code&gt;emacsclient -nw&lt;/code&gt; and eliminate the long startup time. There are more possibilities, &lt;code&gt;man emacsclient&lt;/code&gt; is a good read.&lt;/p&gt;&#xA;" OwnerUserId="7119" LastActivityDate="2016-03-31T09:27:34.513" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21321" PostTypeId="1" AcceptedAnswerId="21325" CreationDate="2016-03-31T11:00:26.733" Score="1" ViewCount="287" Body="&lt;p&gt;I'm using Emacs (v 24.5.1) on Windows 7. I have a .org file containing some todos. I read &lt;a href=&quot;http://orgmode.org/worg/orgcard.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and in various tutorials that &lt;code&gt;C-c C-v&lt;/code&gt; is for &quot;View TODO items in a sparse tree&quot; (for the current buffer). But for me it does nothing, it only waits for another argument to be provided. How can I get this to work?&lt;/p&gt;&#xA;" OwnerUserId="10677" LastActivityDate="2016-03-31T13:19:08.567" Title="&quot;C-c C-v&quot; for &quot;View TODO items in a sparse tree&quot; not working" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21322" PostTypeId="1" AcceptedAnswerId="21329" CreationDate="2016-03-31T11:57:05.120" Score="4" ViewCount="256" Body="&lt;p&gt;I have two org subtrees that look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Subtree A [2016-03-31 Thu 07:11] &#xA;This is subtree A.&#xA;* Subtree B [2016-03-31 Thu 07:12] &#xA;This is subtree B.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;M-x org-cut-subtree&lt;/code&gt; with my cursor at the beginning of Subtree A and then immediately run it again (at the beginning of Subtree B), what I end up with is a single kill-ring entry that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Subtree A [2016-03-31 Thu 07:11] &#xA;This is subtree A.&#xA;* Subtree B [2016-03-31 Thu 07:12] &#xA;This is subtree B.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want only the subtree I'm cutting to end up in each kill ring; I don't want subsequent cuts to be appended. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've spent a good amount of time trying to figure this out (I'm relatively new to Emacs) and I believe the reason for this appending behavior is the following: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;two or more kill commands in a row combine their text into a single&#xA;  entry, so that a single C-y yanks all the text as a unit, just as it&#xA;  was before it was killed.&#xA;  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Appending-Kills.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Appending-Kills.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What I want is to only push the currently cut subtree onto the ring, not append. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;org-cut-subtree&lt;/code&gt; in a function that I run repeatedly while reviewing my &lt;code&gt;refile.org&lt;/code&gt;. I run the function to refile each subtree once I've reviewed it, however this &lt;em&gt;appending to existing kill ring&lt;/em&gt; behavior is causing duplicate entries to be refiled whenever I run the command more than once (the second call ends up refiling a copy of both the previous &lt;em&gt;and&lt;/em&gt; the current subtree).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent this from happening? I noticed if I run &lt;code&gt;M-SPC&lt;/code&gt; to set a new mark before calling &lt;code&gt;org-cut-subtree&lt;/code&gt; again, the issue seems to get resolved, but I haven't been able to figure out how to do that from within my function. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For a little context, here's the function where I'm using &lt;code&gt;org-cut-subtree&lt;/code&gt; (to refile journal entries from &lt;code&gt;refile.org&lt;/code&gt; into my main journal file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-refile-to-journal ()&#xA;  &quot;Refile an entry to journal file's date-tree&quot;&#xA;  (interactive)&#xA;  (require 'org-datetree)&#xA;  (let ((journal (expand-file-name &quot;journal-2016.org&quot; org-directory))&#xA;    post-date)&#xA;    (setq post-date (or (org-entry-get (point) &quot;TIMESTAMP_IA&quot;)&#xA;            (org-entry-get (point) &quot;TIMESTAMP&quot;)))&#xA;    (setq post-date (nthcdr 3 (parse-time-string post-date)))&#xA;    (setq post-date (list (cadr post-date)&#xA;              (car post-date)&#xA;              (caddr post-date)))&#xA;    (org-cut-subtree)&#xA;    (with-current-buffer (or (find-buffer-visiting journal)&#xA;                 (find-file-noselect journal))&#xA;      (save-excursion&#xA;    (org-datetree-file-entry-under (current-kill 0) post-date)&#xA;    (bookmark-set &quot;org-refile-last-stored&quot;)))&#xA;    (message &quot;Refiled to %s&quot; journal)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Answer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As @lawlist explained in a comment to his answer below, adding &lt;code&gt;(setq this-command 'my/org-refile-to-journal)&lt;/code&gt; to the end of my function does exactly what I wanted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A review of the source for &lt;code&gt;kill-region&lt;/code&gt; (which &lt;code&gt;org-cut-subtree&lt;/code&gt; uses to cut) reveals that &lt;code&gt;kill-region&lt;/code&gt; will only append to an existing ring if &lt;code&gt;this-command&lt;/code&gt; is set to a kill-related function (i.e., if the previous command was a kill-related function). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;'my/org-refile-to-journal&lt;/code&gt; is not a kill-related function, setting &lt;code&gt;this-command&lt;/code&gt; to that function effectively temporarily disables the append-to-kill-ring behavior when running my function multiple times in a row.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, here's my updated function that is working as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-refile-to-journal ()&#xA;  &quot;Refile an entry to journal file's date-tree&quot;&#xA;  (interactive)&#xA;  (require 'org-datetree)&#xA;  (let ((journal (expand-file-name &quot;journal-2016.org&quot; org-directory))&#xA;    post-date)&#xA;    (setq post-date (or (org-entry-get (point) &quot;TIMESTAMP_IA&quot;)&#xA;            (org-entry-get (point) &quot;TIMESTAMP&quot;)))&#xA;    (setq post-date (nthcdr 3 (parse-time-string post-date)))&#xA;    (setq post-date (list (cadr post-date)&#xA;              (car post-date)&#xA;              (caddr post-date)))&#xA;    (org-cut-subtree)&#xA;    (with-current-buffer (or (find-buffer-visiting journal)&#xA;                 (find-file-noselect journal))&#xA;      (save-excursion&#xA;    (org-datetree-file-entry-under (current-kill 0) post-date)&#xA;    (bookmark-set &quot;org-refile-last-stored&quot;)))&#xA;    (message &quot;Refiled to %s&quot; journal))&#xA;  (setq this-command 'my/org-refile-to-journal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8494" LastEditorUserId="8494" LastEditDate="2016-04-01T10:46:06.340" LastActivityDate="2016-04-01T14:13:44.227" Title="Preventing org-cut-subtree from appending subsequent cuts to previous kill ring entry" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21323" PostTypeId="2" ParentId="21301" CreationDate="2016-03-31T12:20:26.553" Score="7" Body="&lt;p&gt;I have so far discovered that spawning a new Emacs process is a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have done.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;1. Add a function to start an external emacs process.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;init.el&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my/async-emacs-repl-org-babel-init-file &quot;~/.emacs.d/org-babel-async-init&quot; &quot;File to load on executing async babel evaluation.&quot;)&#xA;&#xA;(defun my/async-emacs-repl--start (process-name init-file)&#xA;  &quot;Start a new Emacs process as a REPL server.&quot;&#xA;  (async-shell-command (concat&#xA;                        &quot;TERM=vt200 emacs --batch -nw&quot;&#xA;                        &quot; --eval '(load \&quot;&quot; init-file &quot;\&quot;)'&quot;&#xA;                        &quot; --eval '(while t (print (eval (read))))'&quot;&#xA;                        )&#xA;                       process-name))&#xA;&#xA;(defun my/async-emacs-repl--org-babel--start-server ()&#xA;  &quot;Starts an Emacs process for async org-babel execution.&quot;&#xA;  (my/async-emacs-repl--start &quot;*org-babel-async*&quot; my/async-emacs-repl-org-babel-init-file))&#xA;&#xA;(defun my/async-emacs-repl--org-babel--start-if-not-exists ()&#xA;  &quot;Starts an Emacs process if the process does not exist.&quot;&#xA;  (if (not (get-buffer-process &quot;*org-babel-async*&quot;)) (my/async-emacs-repl--org-babel--start-server)))&#xA;&#xA;(defun my/async-emacs-repl--org-babel--execute--build-command (file-name line-number)&#xA;  &quot;Build the command for executing `org-babel-execute-src-block'.&quot;&#xA;  (concat&#xA;   &quot;(progn&quot;&#xA;   &quot; (find-file \&quot;&quot; file-name &quot;\&quot;)&quot;&#xA;   &quot; (revert-buffer t t)&quot;&#xA;   &quot; (goto-line &quot; (number-to-string line-number) &quot;)&quot;&#xA;   &quot; (org-babel-execute-src-block t)&quot;&#xA;   &quot; (save-buffer)&quot;&#xA;   &quot;)&quot;&#xA;   &quot;\n&quot;))&#xA;&#xA;(defun my/async-emacs-repl--org-babel--execute (process-name file-name line-number)&#xA;  &quot;Sends the command to the server to run the code-block the cursor is at.&quot;&#xA;  (process-send-string&#xA;   process-name&#xA;   (my/async-emacs-repl--org-babel--execute--build-command file-name line-number)))&#xA;&#xA;(defun my/async-emacs-repl-org-babel-do-execute ()&#xA;  &quot;Run org babel execution at point.&quot;&#xA;  (my/async-emacs-repl--org-babel--execute &quot;*org-babel-async*&quot; (buffer-file-name) (line-number-at-pos)))&#xA;&#xA;(defun my/async-emacs-repl-org-babel-execute ()&#xA;  &quot;Run by the user. Executes command. Starts buffer if not exists.&quot;&#xA;  (interactive)&#xA;  (save-buffer)&#xA;  (my/async-emacs-repl--org-babel--start-if-not-exists)&#xA;  (my/async-emacs-repl-org-babel-do-execute))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;2. Add a config file to load in the new emacs process.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The function above starts emacs in the &lt;code&gt;--batch&lt;/code&gt; mode.&#xA;Thus the normal init.el will not be loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, we want to create a shorter configuration file (to load paths and so on).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The path to our new config file is stored in &lt;code&gt;async-emacs-repl-org-babel-init-file&lt;/code&gt; in the snippet above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;org-babel-async-init.el&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; 1&#xA;(package-initialize)&#xA;&#xA;;; 2&#xA;(setq org-confirm-babel-evaluate nil)&#xA;&#xA;;; 3&#xA;(let ((my/org-babel-evaluated-languages&#xA;       '(emacs-lisp&#xA;         ditaa&#xA;         python&#xA;         ruby&#xA;         C&#xA;         matlab&#xA;         clojure&#xA;         sh&#xA;         dot&#xA;         plantuml)))&#xA;  (org-babel-do-load-languages&#xA;   'org-babel-load-languages&#xA;   (mapcar (lambda (lang)&#xA;             (cons lang t))&#xA;           my/org-babel-evaluated-languages)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here we ...&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Add package paths.&lt;/li&gt;&#xA;&lt;li&gt;Tell org-mode to not ask whether to execute code block.&lt;/li&gt;&#xA;&lt;li&gt;Tell org-babel which languages are necessary.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Footnote 1: Without this setting, the evaluation will fail with &lt;code&gt;&quot;No org-babel-execute function for $lang!&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Footnote 2: Of course you can load the normal init.el instead of creating a new config file, if you wish. Do that by adding &lt;code&gt;(setq org-babel-async-init-file &quot;~/.emacs.d/init&quot;)&lt;/code&gt; to your &lt;code&gt;init.el&lt;/code&gt;. But I think creating a configuration file for this task is more straightforward.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;3. Additionally...&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Add to &lt;strong&gt;init.el&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This will stop the new process buffer from getting focus.&#xA;(setq display-buffer-alist (append display-buffer-alist '((&quot;*org-babel-async*&quot; display-buffer-no-window))))&#xA;&#xA;;; This will automatically show the result section.&#xA;(global-auto-revert-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add to &lt;strong&gt;org-babel-async-init.el&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This will skip the &quot;Save anyway?&quot; confirmation of automatically saving the file when you also edited the buffer from Emacs while an asynchronous process is running.&#xA;(defun advice:verify-visited-file-modtime (orig-func &amp;amp;rest args) t)&#xA;(advice-add 'verify-visited-file-modtime :around 'advice:verify-visited-file-modtime)&#xA;&#xA;;; This will skip the &quot;Select coding system&quot; prompt that appears when the result is inserted. This may vary among environments.&#xA;(setq coding-system-for-write 'utf-8)&#xA;&#xA;;; This will skip the &quot;changed on disk; really edit the buffer?&quot; checking.&#xA;(defun ask-user-about-supersession-threat (fn) &quot;blatantly ignore files that changed on disk&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add to &lt;strong&gt;org-babel-async-init.el&lt;/strong&gt; (you may not need these. These are for MATLAB)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This will set MATLAB cli path.&#xA;(setq-default matlab-shell-command &quot;/Applications/MATLAB_R2016a.app/bin/matlab&quot;)&#xA;;; The MATLAB cli path can be obtained by running `fullfile(matlabroot, 'bin')` in your MATLAB.&#xA;&#xA;;; This will stop MATLAB from showing the splash (the MATLAB logo) at the beginning.&#xA;(setq-default matlab-shell-command-switches '(&quot;-nodesktop&quot; &quot;-nosplash&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add to &lt;strong&gt;org-babel-async-init.el&lt;/strong&gt; (you may not need these. These are for Julia, R and other languages that use ESS.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This will enable :session header in Julia and other languages that use ESS (Emacs speaks statistics).&#xA;(load &quot;/path/to/ess-site&quot;)&#xA;;; This will suppress ESS from prompting for session directory.&#xA;(setq ess-ask-for-ess-directory nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;4. Usage&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;(After the setup above.)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Move cursor to the code snippet you want to execute.&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x my/async-emacs-repl-org-babel-execute&lt;/code&gt; (instead of doing &lt;code&gt;C-c C-c&lt;/code&gt;). This will start an external Emacs process as a REPL server if needed, and then execute the source block you are at.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Acknowledgments&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I have learned the idea of starting an emacs process for org-babel evaluation from &lt;a href=&quot;http://www.draketo.de/english/emacs/parallel-babel&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt;. I would like to thank the author.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Comments for customization&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The idea here is simple. Start a new emacs process as a REPL for Elisp, do &lt;code&gt;find-file&lt;/code&gt; to the same .org file we are editing, &lt;code&gt;goto-line&lt;/code&gt; to the same cursor point, run &lt;code&gt;org-babel-execute-src-block&lt;/code&gt;, &lt;code&gt;save-buffer&lt;/code&gt;. Stop exiting until the user stops the process (Otherwise, graphs would disappear immediately after they are shown).&#xA;One can naturally think about extending this by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Using org-mode's &lt;code&gt;C-c C-c&lt;/code&gt; instead of running functions by hand / setting a new keybind (which can be achieved by advices).&lt;/li&gt;&#xA;&lt;li&gt;Conditionally switching process name according to :session variable and the language&lt;/li&gt;&#xA;&lt;li&gt;Conditionally switching init files based on the language.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In fact, the success of this approach seems to me to be showing a general way of developing async features in Emacs. Creating a &quot;commands&quot; layer, add scripts to do tasks, and have a framework for starting and reusing emacs processes. Just like Symfony framework of PHP (PHP doesn't have threads) has Command features.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Edit history&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Refactored code (2016-04-02).&#xA;Solution now reuses an Emacs process (2016-04-02).&#xA;Solution now simplified and has only one &lt;code&gt;interactive&lt;/code&gt; command to run (2016-04-02.&#xA;Added configuration (2016-04-12).&lt;/p&gt;&#xA;" OwnerUserId="11313" LastEditorUserId="11313" LastEditDate="2016-04-30T00:26:15.840" LastActivityDate="2016-04-30T00:26:15.840" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="21324" PostTypeId="1" AcceptedAnswerId="21326" CreationDate="2016-03-31T12:30:18.487" Score="2" ViewCount="737" Body="&lt;p&gt;I really like the emacs terminal but each time I use it to log into my server. I don't know how to use emacs to edit files on the server. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or it is not possible to do it? I can only edit files on server via ssh edit? However, in the latter case, how can I edit file as root user?&lt;/p&gt;&#xA;" OwnerUserId="8407" LastActivityDate="2016-03-31T13:36:02.217" Title="How can I use Emacs in a SSH sever that I logged in through emacs terminal?" Tags="|ssh|editing|remote|server|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21325" PostTypeId="2" ParentId="21321" CreationDate="2016-03-31T13:19:08.567" Score="2" Body="&lt;p&gt;You are using the wrong command. To view TODO items in a sparse tree, you need to use &lt;code&gt;C-c / t&lt;/code&gt;. The tutorial to refer to does show it correctly. &lt;code&gt;C-c C-v&lt;/code&gt; is meant for working with code. &lt;/p&gt;&#xA;" OwnerUserId="11510" LastActivityDate="2016-03-31T13:19:08.567" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21326" PostTypeId="2" ParentId="21324" CreationDate="2016-03-31T13:36:02.217" Score="5" Body="&lt;p&gt;There is Tramp. You can edit a file on another machine using the syntax &lt;code&gt;/ssh:user@machine:/path/to/file&lt;/code&gt;. If you take &lt;code&gt;sudo&lt;/code&gt; instead of &lt;code&gt;ssh&lt;/code&gt;, and empty &lt;code&gt;user&lt;/code&gt; and &lt;code&gt;machine&lt;/code&gt;, you can edit a local file as root. Like &lt;code&gt;/sudo::/path/to/file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-03-31T13:36:02.217" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21327" PostTypeId="2" ParentId="4253" CreationDate="2016-03-31T13:56:00.297" Score="4" Body="&lt;p&gt;I found this neat solution from &lt;a href=&quot;https://www.emacswiki.org/emacs/InitFile&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsWiki&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -q -l ~/my-init-file.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(not exactly using a custom directory, but works nicely because you most likely have a single entry file anyway)&lt;/p&gt;&#xA;" OwnerUserId="9284" LastActivityDate="2016-03-31T13:56:00.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21328" PostTypeId="2" ParentId="21322" CreationDate="2016-03-31T14:59:35.430" Score="1" Body="&lt;p&gt;Sorry, I misunderstood your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-cut-subtree&lt;/code&gt; is calling &lt;code&gt;org-copy-subtree&lt;/code&gt;, which then calls &lt;code&gt;kill-region&lt;/code&gt;. As you've discovered, this will result in a series of kills getting appended together. @lawlist has provide a workaround, and it should be ok if you don't mind not having the kills available in your kill-ring beyond the duration of the function itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative, you could use a modified version of &lt;code&gt;org-copy-subtree&lt;/code&gt; to force each kill to be treated as a distinct unit, and not appended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-cut-trees1 ()&#xA;  &quot;Cut subtrees using org defaults&quot;&#xA;  (interactive)&#xA;  (org-cut-subtree))&#xA;&#xA;(defun my-cut-trees2 ()&#xA;  &quot;Cut subtrees without appending kills&quot;&#xA;  (interactive)&#xA;  (my-org-copy-subtree nil 'cut))&#xA;&#xA;(defun my-org-copy-subtree (&amp;amp;optional n cut force-store-markers nosubtrees)&#xA;  &quot;org-copy-subtree, but without appending adjacent kills&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let (beg end folded (beg0 (point)))&#xA;    (if (org-called-interactively-p 'any)&#xA;        (org-back-to-heading nil) ; take what looks like a subtree&#xA;      (org-back-to-heading t)) ; take what is really there&#xA;    (setq beg (point))&#xA;    (skip-chars-forward &quot; \t\r\n&quot;)&#xA;    (save-match-data&#xA;      (if nosubtrees&#xA;          (outline-next-heading)&#xA;        (save-excursion (outline-end-of-heading)&#xA;                        (setq folded (outline-invisible-p)))&#xA;        (ignore-errors (org-forward-heading-same-level (1- n) t))&#xA;        (org-end-of-subtree t t)))&#xA;    ;; Include the end of an inlinetask&#xA;    (when (and (featurep 'org-inlinetask)&#xA;               (looking-at-p (concat (org-inlinetask-outline-regexp)&#xA;                                     &quot;END[ \t]*$&quot;)))&#xA;      (end-of-line))&#xA;    (setq end (point))&#xA;    (goto-char beg0)&#xA;    (when (&amp;gt; end beg)&#xA;      (setq org-subtree-clip-folded folded)&#xA;      (when (or cut force-store-markers)&#xA;        (org-save-markers-in-region beg end))&#xA;&#xA;      ;; MODIFICATION HERE&#xA;      ;; replace kill-region with kill-new/delete-region &#xA;      (if cut (progn (kill-new (buffer-substring beg end))&#xA;                     (delete-region beg end))&#xA;      ;; end modification&#xA;&#xA;        (copy-region-as-kill beg end))&#xA;      (setq org-subtree-clip (current-kill 0))&#xA;      (message &quot;%s: Subtree(s) with %d characters&quot;&#xA;               (if cut &quot;Cut&quot; &quot;Copied&quot;)&#xA;               (length org-subtree-clip)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try this on your org file: &lt;code&gt;my-cut-trees1&lt;/code&gt;, which calls &lt;code&gt;org-cut-subtree&lt;/code&gt; will append kills, but &lt;code&gt;my-cut-trees2&lt;/code&gt;, which uses my modified &lt;code&gt;org-copy-subtree&lt;/code&gt; instead won't. Maybe that will solve your problem.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-03-31T19:37:40.520" LastActivityDate="2016-03-31T19:37:40.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21329" PostTypeId="2" ParentId="21322" CreationDate="2016-03-31T17:19:36.477" Score="2" Body="&lt;p&gt;Under certain kill-related circumstances, the kill-related function(s) expressly set &lt;code&gt;this-command&lt;/code&gt; to &lt;code&gt;kill-region&lt;/code&gt;.  The function &lt;code&gt;kill-region&lt;/code&gt; looks at the value of the previous command -- which becomes &lt;code&gt;last-command&lt;/code&gt; -- and &lt;em&gt;appends&lt;/em&gt; subsequent kills to prior kills &lt;code&gt;(if (eq last-command 'kill-region) . . .&lt;/code&gt;  One way of preventing the &lt;em&gt;append&lt;/em&gt; behavior is to modify the value of &lt;code&gt;this-command&lt;/code&gt; at the tail end of the current function (which was modified by &lt;code&gt;kill-region&lt;/code&gt;).  For example, the original poster could place the following snippet at the tail end of his current function:  &lt;code&gt;(setq this-command 'my/org-refile-to-journal)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The following snippet achieves a different result -- i.e., it merely preserves the prior values of &lt;code&gt;kill-ring&lt;/code&gt; and &lt;code&gt;kill-ring-yank-pointer&lt;/code&gt;.  For example, a user may wish to run a series of cut/paste operations that rely upon the &lt;code&gt;kill-ring&lt;/code&gt;, but the user may nevertheless desire that his/her &lt;code&gt;kill-ring&lt;/code&gt; remain the same as it was before running those cut/paste operations.  To the extent that the user wishes to preserve his/her system clipboard in its original state, the following variables can also be set temporarily to &lt;code&gt;nil&lt;/code&gt; by let-binding them: &lt;code&gt;interprogram-cut-function&lt;/code&gt; and &lt;code&gt;interprogram-paste-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl) ;; for `copy-list'&#xA;&#xA;(defun hello-world ()&#xA;&quot;doc-string&quot;&#xA;(interactive)&#xA;(let* (&#xA;    (original-kill-ring (copy-list kill-ring))&#xA;    (original-kill-ring-yank-pointer (copy-list kill-ring-yank-pointer))&#xA;    [INSERT ANYTHING ELSE THAT NEEDS LET-BINDING] )&#xA;  [INSERT CUSTOM STUFF HERE]&#xA;  (setq kill-ring original-kill-ring)&#xA;  (setq kill-ring-yank-pointer original-kill-ring-yank-pointer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I see that the original poster is programmatically reorganizing org-mode files.  Although not needed to answer the question, the following link contains another method to accomplish something similar using &lt;code&gt;org-archive-subtree&lt;/code&gt; which can cut/paste things to different locations (including other files):  &lt;a href=&quot;https://stackoverflow.com/a/22232709/2112489&quot;&gt;https://stackoverflow.com/a/22232709/2112489&lt;/a&gt; -- the variables &lt;code&gt;org-archive-location&lt;/code&gt; and &lt;code&gt;org-archive-save-context-info&lt;/code&gt; facilitate that process.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-04-01T14:13:44.227" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21330" PostTypeId="1" AcceptedAnswerId="21332" CreationDate="2016-03-31T17:56:51.220" Score="1" ViewCount="269" Body="&lt;p&gt;I want to rename file in &lt;code&gt;dired&lt;/code&gt; by replacing underscores with spaces. I hit &#xA;&lt;kbd&gt;R&lt;/kbd&gt; &lt;kbd&gt;Down&lt;/kbd&gt; (&lt;code&gt;dired-do-rename&lt;/code&gt;) and after typing &lt;kbd&gt;M-%&lt;/kbd&gt; (&lt;code&gt;query-replace&lt;/code&gt;) I got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;query-replace-read-to: Command attempted to use minibuffer while in minibuffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to makes replaces in minibufer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Recursive-Edit.html&quot; rel=&quot;nofollow&quot;&gt;Recursive Edit&lt;/a&gt; here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; I recall &lt;kbd&gt;% r&lt;/kbd&gt; &lt;code&gt;dired-do-rename-regexp&lt;/code&gt; but I ask about replacing in minibufer. Please do not count this workaround.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-03-31T18:02:56.533" LastActivityDate="2016-03-31T20:50:31.780" Title="query-replace-read-to: Command attempted to use minibuffer while in minibuffer" Tags="|minibuffer|replace|query-replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21331" PostTypeId="1" AcceptedAnswerId="21376" CreationDate="2016-03-31T20:44:34.893" Score="1" ViewCount="195" Body="&lt;p&gt;Sometimes when in e.g. a Python or SQL buffer I accidentally evaluate something that outputs e.g. multiple megabytes of text into the buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; zps = _read_zipfile_container(br.response().read(), br.geturl())&#xA;&amp;gt;&amp;gt;&amp;gt; len(zps)&#xA;1&#xA;&amp;gt;&amp;gt;&amp;gt; zps[0]  # oops&#xA;\xfc\xc0H\x19#\x15\x8a\xb4XN\xb5\x9b\xd2\xfeT\x9a\xbeL\xe7a\x90l\xb3Y\xfbL&#xA;\xf2Pq\x84\x941R\xa1H\xdb\x82\xe5T\x15\xb7]\xcd\xddk\xd2\xd9\x19$;\tHcW\x8&#xA;4\x83\xc1d\x06S\x10\xcc\xb60\xd9T\x89m=\xba\'\x1ay\x0b\x83d\x0bR\xfae\xd1F&#xA;H\x19#x15\x8a\xb4-XNUq\xdb]\xdeF\xdf\xde\xc2 \x99\x85A\x1a\x9b!\x1c\x9b!\x&#xA;&#xA;... all one line, but rendered increasingly slowly to many &#xA;                            tens of thousands of continuation lines ... &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At the moment I can either kill the process, or else wait for it to all render to the buffer and then delete it manually (might take a half hour, particularly when the output string has no linebreaks). I usually have to choose the latter option to avoid losing work in progress. Is there any way to discard the text without losing the buffer?&lt;/p&gt;&#xA;" OwnerUserId="9779" LastEditorUserId="105" LastEditDate="2016-08-10T22:28:58.317" LastActivityDate="2016-08-10T22:28:58.317" Title="Cancel printing of long string in buffer" Tags="|buffers|performance|rendering|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21332" PostTypeId="2" ParentId="21330" CreationDate="2016-03-31T20:50:31.780" Score="1" Body="&lt;p&gt;Not sure exactly what you are trying to do. But if you want to use &lt;code&gt;M-%&lt;/code&gt; in the active minibuffer then yes, you need to first set &lt;code&gt;enable-recursive-minibuffers&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt;. By default, the value of that variable is &lt;code&gt;nil&lt;/code&gt;, which prevents you being prompted for another command when you are already being prompted for a different command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But please explain what you are &lt;em&gt;really&lt;/em&gt; trying to do. I'm guessing there is an easier and more straightforward way to do it, whatever it is.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-03-31T20:50:31.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21333" PostTypeId="2" ParentId="21315" CreationDate="2016-03-31T22:26:48.637" Score="5" Body="&lt;p&gt;AUCTeX provides the &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#Dollar-Signs&quot;&gt;feature&lt;/a&gt; to wrap opening and closing inline equation markers around active region on pressing &lt;code&gt;$&lt;/code&gt;, when &lt;code&gt;TeX-electric-math&lt;/code&gt; is non-nil (and this isn't the default).  In order to have this, the &lt;code&gt;delete-selection&lt;/code&gt; property had to &lt;a href=&quot;http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=d59628f1ee02abccc179c463214baddb5a17bf71&quot;&gt;be removed&lt;/a&gt;.  Actually, its behavior can be dynamically determined by a function, so that&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(put 'TeX-insert-dollar 'delete-selection (lambda () (null TeX-electric-math)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;enables or disables it depending on the value of &lt;code&gt;TeX-electric-math&lt;/code&gt;.  Thanks to this discussion, the above line is now &lt;a href=&quot;http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=da88a3eca3107372131aa26930e548c039fe1b51&quot;&gt;present&lt;/a&gt; also in development version of AUCTeX.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-03-31T22:26:48.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21335" PostTypeId="1" AcceptedAnswerId="21336" CreationDate="2016-04-01T01:50:03.317" Score="9" ViewCount="910" Body="&lt;p&gt;Folding gets in the way when merging two org files using ediff, so I'm trying to disable all folding in org-mode buffers created by ediff.  Non-ediff folding behavior should remain unaffected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naively I think that something akin to the following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (add-hook 'ediff-mode-hook&#xA;        (lambda ()&#xA;          (set (make-local-variable 'org-inhibit-startup-visibility-stuff) t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm fairly certain that this is the org variable to modify (rather than &lt;code&gt;org-startup-folded&lt;/code&gt; or &lt;code&gt;org-agenda-inhibit-startup&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried various hooks to no avail (mainly &lt;code&gt;ediff-mode-hook&lt;/code&gt;, &lt;code&gt;ediff-before-setup-hook&lt;/code&gt;, &lt;code&gt;ediff-meta-mode-hook&lt;/code&gt;, and &lt;code&gt;ediff-prepare-buffer-hook&lt;/code&gt;- which is probably too late) hoping that the interned variable will be inherited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's quite possible that I'm using make-local-variable incorrectly; the pattern is just borrowed from what I've widely seen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only setting the value globally has been effective (but that's not what I'm shooting for).  Should I be (ab)using the advice mechanism?&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2019-06-15T16:18:05.773" Title="Prevent folding org files opened by ediff" Tags="|org-mode|hooks|ediff|local-variables|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21336" PostTypeId="2" ParentId="21335" CreationDate="2016-04-01T02:38:33.010" Score="11" Body="&lt;p&gt;It sounds like your goal is to have &lt;code&gt;org-mode&lt;/code&gt; files &lt;em&gt;always&lt;/em&gt; show everything when in &lt;code&gt;ediff&lt;/code&gt;.  The simplest solution is probably to avoid the local variables approach and just put &lt;code&gt;show-all&lt;/code&gt; in the relevant hook, &lt;code&gt;ediff-prepare-buffer-hook&lt;/code&gt; which is run after buffers A, B, &amp;amp; C are set up:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt; (with-eval-after-load 'outline&#xA;   (add-hook 'ediff-prepare-buffer-hook #'org-show-all))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Despite the name, &lt;code&gt;org-show-all&lt;/code&gt; also works in &lt;code&gt;outline-mode&lt;/code&gt; which &lt;code&gt;org-mode&lt;/code&gt; is built on top of. Unlike &lt;code&gt;outline-show-all&lt;/code&gt;, it shows property drawers and blocks like &lt;code&gt;#+begin_src ... #+end_src&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-show-all&lt;/code&gt; has been added in Org 9.1.6. In earlier versions you can use &lt;code&gt;outline-show-all&lt;/code&gt; or &lt;code&gt;show-all&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note, according to a comment, that &lt;code&gt;show-all&lt;/code&gt; is marked obsolete in Emacs 25.1 in favor of &lt;code&gt;outline-show-all&lt;/code&gt;.  The latter symbol is not bound in 24.5.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="2788" LastEditDate="2019-06-15T16:18:05.773" LastActivityDate="2019-06-15T16:18:05.773" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="21337" PostTypeId="2" ParentId="10648" CreationDate="2016-04-01T13:17:07.527" Score="0" Body="&lt;p&gt;No other way (that I know of) than writing a custom mode-line customizing &lt;code&gt;mode-line-format&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bitbucket.org/angrybacon/dotemacs/src/7f41cb37b6ce314450afcaf59b855a16e6d51181/lisp/init-mode-line.el?at=master&amp;amp;fileviewer=file-view-default#init-mode-line.el-95&quot; rel=&quot;nofollow&quot;&gt;Here is how I did it&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And to strip the backend string (&quot;Git&quot; from &quot;Git:master&quot;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice vc-mode-line (after me/vc-mode-line () activate)&#xA;  &quot;Strip backend from the VC information.&quot;&#xA;  (when (stringp vc-mode)&#xA;    (let ((vc-text (replace-regexp-in-string &quot;^ Git.&quot; &quot;:&quot; vc-mode)))&#xA;      (setq vc-mode vc-text))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-04-01T13:17:07.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21338" PostTypeId="1" CreationDate="2016-04-01T13:27:07.070" Score="4" ViewCount="2236" Body="&lt;p&gt;I'm a novice at emacs use in general, and new to spacemacs, so I'm hoping this is just a case of missing a trick or two. I am working in a symlinked app on Mac OSX, not in the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a pretty much stock config of spacemacs, added a few extra layers, in evil-mode. I'm trying to do some work with HTML, using web-mode, and it isn't behaving entirely as described:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;&amp;lt;li&lt;/code&gt; I get a dropdown menu that completes words, but doesn't complete the open/close tag (is this intended behaviour, or is it supposed to complete your selection if you make one?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;&amp;lt;li&amp;gt;&amp;lt;/&lt;/code&gt; it will autocomplete properly to &lt;code&gt;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&lt;/code&gt;, matching indicated behaviour. I have tried setting &lt;code&gt;web-mode-tag-auto-close-style&lt;/code&gt; to &lt;code&gt;2&lt;/code&gt; in &lt;code&gt;dotspacemacs/userconfig ()&lt;/code&gt; per &lt;a href=&quot;https://stackoverflow.com/questions/23402326/turning-off-automatic-tag-closing-in-emacs-web-mode&quot;&gt;this&lt;/a&gt; answer to allow completion at opening tag closure instead of closure tag opening (i.e. &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; --&gt; &lt;code&gt;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&lt;/code&gt;) but have had no luck getting it to work. Am I putting it in the wrong place or using the wrong syntax?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type &lt;code&gt;d/s/&lt;/code&gt; as in the &lt;a href=&quot;http://web-mode.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;example&lt;/a&gt; it results in &lt;code&gt;&amp;lt;d/&amp;gt;&lt;/code&gt; instead of the indicated &lt;code&gt;&amp;lt;div&amp;gt;&amp;lt;span&amp;gt;|&amp;lt;/div&amp;gt;&amp;lt;/span&amp;gt;&lt;/code&gt;. Yet if I type &lt;code&gt;d&lt;/code&gt; &lt;code&gt;TAB&lt;/code&gt; &lt;code&gt;s&lt;/code&gt; &lt;code&gt;TAB&lt;/code&gt; it produces &lt;code&gt;&amp;lt;d&amp;gt;s&amp;lt;/d&amp;gt;|&lt;/code&gt; and if I then scroll back to &lt;code&gt;s&lt;/code&gt; and hit &lt;code&gt;TAB&lt;/code&gt; again, it produces &lt;code&gt;&amp;lt;d&amp;gt;&amp;lt;s&amp;gt;&amp;lt;/s&amp;gt;&amp;lt;/d&amp;gt;&lt;/code&gt; I have not been able to find more detailed information about this function of web-mode, am I using it incorrectly?&lt;/p&gt;&#xA;" OwnerUserId="8636" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-08-01T14:28:30.207" Title="HTML tag auto open/close/expand/quote problem" Tags="|spacemacs|web-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21339" PostTypeId="2" ParentId="21239" CreationDate="2016-04-01T13:38:37.947" Score="15" Body="&lt;p&gt;As JeanPierre answer pointed, you need to specify the language export setting. For French the next line does the work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: fr&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No all languages are supported and, as you said, is possible to see which ones are viewing the &lt;code&gt;org-latex-export-dictionary&lt;/code&gt; variable (you can use the emacs command &lt;code&gt;C-h v&lt;/code&gt; then write the variable name). Some languages might be only partially supported or not supported at all like Serbian. If you want it to work with an unsupported language add the translated strings to the variable  and preferably send them to the devs so it ends up org-mode.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;LaTex and PDF&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you are exporting to LaTex and want to let Babel change the text use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: fr&#xA;#+LATEX_HEADER: \usepackage[AUTO]{babel}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will work in both HTML and latex as the AUTO keyword will be substituted by the corresponding Babel language name. To view which languages are supported view the &lt;code&gt;org-latex-babel-language-alist&lt;/code&gt; variable. Not all languages available in Babel are there but Serbian is and works (tested it and &quot;Contents&quot; appears as &quot;Sadržaj&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your language is not in &lt;code&gt;org-latex-babel-language-alist&lt;/code&gt; but is available in babel, like Breton, use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: br&#xA;#+LATEX_HEADER: \usepackage[breton]{babel}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As Breton is not in &lt;code&gt;org-latex-export-dictionary&lt;/code&gt; the&lt;code&gt;LANGUAGE&lt;/code&gt; variable won't do anything for HTML export, it will be in English, but is necessary. That's because what will end up in the LaTex file will be &lt;code&gt;\usepackage[breton, &amp;lt;default-lang&amp;gt;]{babel}&lt;/code&gt; where &lt;code&gt;default-lang&lt;/code&gt; will be English if &lt;code&gt;LANGUAGE&lt;/code&gt; is not present and the last language is considered the default by Babel. As &lt;code&gt;br&lt;/code&gt; is not in &lt;code&gt;org-latex-babel-language-alist&lt;/code&gt; we end up with &lt;code&gt;\usepackage[breton, ]{babel}&lt;/code&gt;, there Breton is the default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Breton is added to &lt;code&gt;org-latex-babel-language-alist&lt;/code&gt; it will work anyway (&lt;code&gt;\usepackage[breton, breton]{babel}&lt;/code&gt;). If Breton is included in &lt;code&gt;org-latex-export-dictionary&lt;/code&gt; it will now work in HTML too. If Breton wasn't supported by babel it will work anyway but be in English, so this configuration is the one who gives you as much in the specified language as possible with English as a fall back. I rather use &lt;code&gt;AUTO&lt;/code&gt; if available as there is only one place to put the language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't like what Babel puts as &quot;Contents&quot; but still want to use it you can do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: en&#xA;#+LATEX_HEADER: \usepackage[AUTO]{babel}&#xA;#+LATEX_HEADER: \addto\captionsenglish{\renewcommand\contentsname{Outline}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is like the Tyler's answer but for Babel.&lt;/p&gt;&#xA;" OwnerUserId="11596" LastActivityDate="2016-04-01T13:38:37.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21341" PostTypeId="1" CreationDate="2016-04-01T14:30:09.640" Score="0" ViewCount="793" Body="&lt;p&gt;I mean by adding an entry to the .emacs file.&lt;/p&gt;&#xA;" OwnerUserId="10919" LastActivityDate="2016-04-03T08:30:33.333" Title="How to configure Auctex to automatically use pdflatex for all Latex files?" Tags="|init-file|latex|auctex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21342" PostTypeId="1" CreationDate="2016-04-01T14:36:21.557" Score="6" ViewCount="377" Body="&lt;p&gt;I have &lt;code&gt;save-place&lt;/code&gt; and &lt;code&gt;save-visited-files&lt;/code&gt; installed however whenever I start emacs first a directory list shows (result of another setting in .emacs), I close it and then a few message buffers show up and it's after closing all of them that I get to the file I was working on last time.&#xA;How can I configure emacs to show the file from last session when started?&lt;/p&gt;&#xA;" OwnerUserId="10919" LastActivityDate="2016-09-28T21:17:14.760" Title="How to configure emacs to show the file I was working on when I open emacs?" Tags="|init-file|start-up|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21343" PostTypeId="1" AcceptedAnswerId="21344" CreationDate="2016-04-01T15:15:03.980" Score="2" ViewCount="278" Body="&lt;p&gt;I have multiple files with drill items. Many of them have additional tags to further categorize the drill question. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There are times where I don't want to drill all due items but just the ones that are tagged a specific word (e.g. :spanish:)&lt;/li&gt;&#xA;&lt;li&gt;Other times, I would like to get drilled in order (e.g., first drill all items that are additionally to :drill: also tagged :python:, then continue with :cpp:, etc.). I don't like mixing completely different drill items, but they are mixed in my files for different reasons.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;org-drill does provide the custom variable &lt;code&gt;org-drill-question-tag&lt;/code&gt; to change the name of the tag which org-drill looks for, but I don't want to change this variable in my .emacs file every time I use org-drill. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve my two requirements? Are there already any kind of functions in place that I can use?&lt;/p&gt;&#xA;" OwnerUserId="11510" LastActivityDate="2016-04-01T15:15:03.980" Title="Drill user specified tags with org-drill" Tags="|org-mode|org-drill|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21344" PostTypeId="2" ParentId="21343" CreationDate="2016-04-01T15:15:03.980" Score="2" Body="&lt;p&gt;I haven't found any in-place function that could do any of my two requirements, but I defined a function for my first requirement. Hopefully, somebody else finds this useful (or has even a better solution):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(defun custom/org-drill-tag(tag)&#xA;  &quot;Start org-drill with a user chosen question tag.&quot;&#xA;  (interactive &quot;sInput the tag to drill: &quot;)&#xA;  (custom-set-variables&#xA;   '(org-drill-question-tag tag))&#xA;  (org-drill)&#xA;  (custom-set-variables&#xA;   '(org-drill-question-tag &quot;drill&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't figured out how to achieve my second requirement though.&lt;/p&gt;&#xA;" OwnerUserId="11510" LastActivityDate="2016-04-01T15:15:03.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21345" PostTypeId="1" CreationDate="2016-04-01T15:28:37.273" Score="4" ViewCount="622" Body="&lt;p&gt;I've been running tmux inside of my &lt;code&gt;term&lt;/code&gt; buffer but when I do that there are some issues and the buffer often becomes messed up, with the cursor being in the wrong spot and overwriting text or other various small issues. These issues arise from scrolling, typing the clear command or a variety of other inputs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anybody been able to find a way around this? A way to have tmux play nicely with term mode? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The end goal is to have persistent shells that I can interact with within emacs and that will last even after I inevitably crash emacs. Any way to do this would be greatly appreciated, I was simply trying with tmux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-04-01T15:28:37.273" Title="Tmux and term-mode" Tags="|ansi-term|term|multi-term|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21346" PostTypeId="2" ParentId="21342" CreationDate="2016-04-01T15:31:30.567" Score="1" Body="&lt;p&gt;Add the following snippet to your init file to open the &lt;em&gt;last&lt;/em&gt; file you were working on:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'recentf)&#xA;(recentf-mode 1)&#xA;(add-hook 'after-init-hook&#xA;           (lambda ()&#xA;              (recentf-open-most-recent-file 1)) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This enables &lt;code&gt;recentf&lt;/code&gt;, which tracks the list of recent files you have opened. Then, you instruct Emacs to open the most recent file after initialization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: If you use the &lt;code&gt;sync-recentf&lt;/code&gt; package, then on starting Emacs, your first item will probably be &lt;code&gt;/tmp/sync-recentf-marker&lt;/code&gt;. In that case, you might want to open the second-most recent file, or use a conditional checking for the file name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you always want to open a fixed file, then you can also set &lt;code&gt;initial-buffer-choice&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Added an optional third argument to the argument list of &lt;code&gt;add-hook&lt;/code&gt; in order to append the hook to the end of the initialization based on suggestions from Tobias.&lt;/p&gt;&#xA;" OwnerUserId="2292" LastEditorUserId="2370" LastEditDate="2016-04-01T16:42:59.810" LastActivityDate="2016-04-01T16:42:59.810" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21347" PostTypeId="1" AcceptedAnswerId="21350" CreationDate="2016-04-01T16:23:49.637" Score="4" ViewCount="68" Body="&lt;p&gt;On running &lt;code&gt;(package-install &amp;lt;some-pkg-name&amp;gt;)&lt;/code&gt;, I am seeing a long list of messages of the form &lt;code&gt;Checking /some/path/to/a/file&lt;/code&gt;. What are these checks that &lt;code&gt;package-install&lt;/code&gt; does? How can I exclude certain locations that I see are irrelevant and have no &lt;code&gt;.el&lt;/code&gt; files?&lt;/p&gt;&#xA;" OwnerUserId="2536" LastActivityDate="2016-04-01T17:22:15.083" Title="package-install is &quot;checking&quot; a lot of files" Tags="|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21348" PostTypeId="2" ParentId="17347" CreationDate="2016-04-01T16:33:58.093" Score="5" Body="&lt;p&gt;To evaluate code only on compilation stage use &lt;code&gt;eval-when&lt;/code&gt; macros which is dated by RMS in 1993-07-30.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cl-eval-when&lt;/code&gt; appeared in 2012-06-03 from Stefan Monnier and it is not available for Emacs 22.x (if you care, I do).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example you like to get rid of &lt;code&gt;Warning: assignment to free variable&lt;/code&gt; in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-revert-interval 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;just add above that line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when 'compile (require 'autorevert))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this is useful only for byte compilation of &lt;code&gt;.emacs&lt;/code&gt; file. If you develop a library you should do &lt;code&gt;require&lt;/code&gt; or split library file into separate and load only required features.&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2016-04-01T16:33:58.093" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21350" PostTypeId="2" ParentId="21347" CreationDate="2016-04-01T16:57:01.823" Score="5" Body="&lt;p&gt;This is not &lt;code&gt;package.el&lt;/code&gt;.  Grepping sources reveals it's  &lt;code&gt;bytecomp.el&lt;/code&gt; generating that message in &lt;code&gt;byte-recompile-directory&lt;/code&gt;.  If you consider the usecase of that (interactive) function, it makes a lot of sense to display every directory and subdirectory containing recompilable files:  It is typically used during development and Emacs bootstrapping to have an idea what generates warnings and fails compiling cleanly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to &lt;code&gt;package.el&lt;/code&gt;.  I consider reusing &lt;code&gt;byte-recompile-directory&lt;/code&gt; for the installation of a package plain wrong.  An user does not care about how lenient the developer of a package has been with regards to warnings and does not need a compilation buffer to pop up at them.  It would have been better to reconsider how one would properly solve that usecase and write a better abstraction for it, but that hasn't happened yet.  After all, &lt;code&gt;package.el&lt;/code&gt; works well enough, save the occasional bug...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you strongly care about these messages, I recommend discussing it on &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/&quot; rel=&quot;nofollow&quot;&gt;emacs-devel&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-04-01T17:22:15.083" LastActivityDate="2016-04-01T17:22:15.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21351" PostTypeId="2" ParentId="21341" CreationDate="2016-04-01T18:31:52.030" Score="1" Body="&lt;p&gt;In order to enable &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#Processor-Options&quot; rel=&quot;nofollow&quot;&gt;PDF mode&lt;/a&gt; by default in all *TeX buffers add the following line to your init file:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;tex&quot;&#xA;  (TeX-global-PDF-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this is the default in AUCTeX &lt;a href=&quot;https://gnu.org/software/auctex/manual/auctex.html#News-in-11_002e88&quot; rel=&quot;nofollow&quot;&gt;since version 11.88&lt;/a&gt;, so if you a have a recent version of the package you don't need it to change this by hand.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;with-eval-after-load&lt;/code&gt; has been introduced in Emacs 24.4.  If you're running older versions of the program you have to use this syntax instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;tex&quot;&#xA;  '(TeX-global-PDF-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2016-04-03T08:30:33.333" LastActivityDate="2016-04-03T08:30:33.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21352" PostTypeId="1" AcceptedAnswerId="21449" CreationDate="2016-04-01T18:38:30.550" Score="1" ViewCount="744" Body="&lt;p&gt;I'm trying to get org-capture and mu4e working together nicely. Org-capture is already correctly set up; I can capture links to source code files with the following template:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;          '((&quot;t&quot; &quot;Todo&quot; entry (file+headline &quot;&quot; &quot;General To-Dos&quot;)&#xA;             &quot;** TODO %?\n %i\n %A\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to capture links to emails in &lt;code&gt;mu4e&lt;/code&gt;. I have &lt;code&gt;org-mu4e&lt;/code&gt; required, and &lt;code&gt;org-capture-link&lt;/code&gt; works as expected in the mu4e message view. Great so far. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I try to use the same template to use org capture an email. This always fails with the error, &lt;code&gt;Capture abort: (args-out-of-range 99)&lt;/code&gt; (The number varies; I assume this is a code point, but cannot get it to render as anything other than a fairly opaque number). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the debugger, I've traced this error to the following code block in &lt;code&gt;org-capture-fill-template&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; Simple %-escapes&#xA;  (goto-char (point-min))&#xA;  (while (re-search-forward &quot;%\\([tTuUaliAcxkKInfF]\\)&quot; nil t)&#xA;(unless (org-capture-escaped-%)&#xA;  (when (and initial (equal (match-string 0) &quot;%i&quot;))&#xA;    (save-match-data&#xA;      (let* ((lead (buffer-substring&#xA;            (point-at-bol) (match-beginning 0))))&#xA;    (setq v-i (mapconcat 'identity&#xA;                 (org-split-string initial &quot;\n&quot;)&#xA;                 (concat &quot;\n&quot; lead))))))&#xA;  (replace-match (or (eval (intern (concat &quot;v-&quot; (match-string 1)))) &quot;&quot;)&#xA;         t t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As best as I can tell, everything up to &lt;code&gt;replace-match&lt;/code&gt; is working perfectly. The error occurs when &lt;code&gt;replace-match&lt;/code&gt; tries to replace a template character (using any of the link characters &lt;code&gt;%a&lt;/code&gt;, &lt;code&gt;%A&lt;/code&gt;, &lt;code&gt;%l&lt;/code&gt;) with the captured link to the mu4e message. Instead of correctly doing the replace, &lt;code&gt;args-out-of-range&lt;/code&gt; is thrown. Normally, I'd assume there was no correctly set &lt;code&gt;match&lt;/code&gt; for &lt;code&gt;replace-match&lt;/code&gt; to act on -- but &lt;code&gt;match-string&lt;/code&gt; returns a correct match result, as does inspecting the match in the debugger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.5.1, Org 8.3.4, and mu4e 0.9.16. I've tried this on two different Macs and a Fedora 22 machine; the behavior is absolutely consistent. &lt;/p&gt;&#xA;" OwnerUserId="10319" LastEditorUserId="105" LastEditDate="2016-04-01T19:28:04.963" LastActivityDate="2016-04-05T22:27:57.780" Title="org-capture + mu4e failures" Tags="|org-mode|mu4e|org-capture|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21353" PostTypeId="1" AcceptedAnswerId="21356" CreationDate="2016-04-01T18:48:25.163" Score="10" ViewCount="4259" Body="&lt;p&gt;For example, say I have a buffer that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Org-Mode&#xA;&#xA;This is a document written in Org-Mode&#xA;&#xA;** This is a subheading below that&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to narrow the buffer to just &quot;This is a document written in Org-Mode&quot; and continue on then come back to the full buffer, excluding the subheading below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Edited to clarify regarding subheadings)  &lt;/p&gt;&#xA;" OwnerUserId="10730" LastEditorUserId="10730" LastEditDate="2016-04-01T19:07:56.123" LastActivityDate="2016-04-01T20:55:02.630" Title="In Org-Mode, is there a way to narrow the buffer to just the text under a heading?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21354" PostTypeId="1" CreationDate="2016-04-01T18:54:11.917" Score="1" ViewCount="2325" Body="&lt;p&gt;Emacs seems to use the 16 colors which were defined in a color scheme inside the terminal emulator as default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works well, I would not want to switch to a whole emacs color profile. &#xA;E.g I can specify the color of a &quot;component&quot; in emacs with a fixed color name or value like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-background 'mode-line &quot;purple&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it also possible to tell Emacs to use one of the 16 defaults for this?&#xA;like &quot;color01&quot; or sth.?&lt;/p&gt;&#xA;" OwnerUserId="11364" LastEditorUserId="5213" LastEditDate="2016-04-30T14:12:45.387" LastActivityDate="2016-04-30T14:12:45.387" Title="Use colors specified in terminal emulator for emacs" Tags="|colors|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21355" PostTypeId="2" ParentId="21353" CreationDate="2016-04-01T18:57:29.673" Score="25" Body="&lt;p&gt;&lt;code&gt;org-narrow-to-subtree&lt;/code&gt; (C-x n s) will display only the current heading. It does however include the heading itself, not &lt;em&gt;just&lt;/em&gt; the text. Maybe that is OK for you?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;widen&lt;/code&gt; (C-x n w) will widen the view again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for example: &lt;a href=&quot;https://stackoverflow.com/questions/17156595/in-emacs-org-mode-how-to-narrow-display-to-two-subtrees-in-two-separate-files&quot;&gt;https://stackoverflow.com/questions/17156595/in-emacs-org-mode-how-to-narrow-display-to-two-subtrees-in-two-separate-files&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9716" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-04-01T18:57:29.673" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21356" PostTypeId="2" ParentId="21353" CreationDate="2016-04-01T19:32:10.197" Score="11" Body="&lt;p&gt;Perhaps this does what you want?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-narrow-to-here ()&#xA;   (interactive)&#xA;   (org-narrow-to-subtree)&#xA;   (save-excursion&#xA;     (org-next-visible-heading 1)&#xA;     (narrow-to-region (point-min) (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; If you really really want to exclude the current heading, this more elaborate variant:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-narrow-to-here ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (narrow-to-region&#xA;     (progn (unless (org-at-heading-p) (org-next-visible-heading -1))&#xA;            (forward-line)&#xA;            (point))&#xA;     (progn (org-next-visible-heading 1)&#xA;            (point)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2016-04-01T20:55:02.630" LastActivityDate="2016-04-01T20:55:02.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21357" PostTypeId="1" AcceptedAnswerId="21370" CreationDate="2016-04-01T19:34:32.513" Score="2" ViewCount="433" Body="&lt;p&gt;I want to concatenate two ascii tables (one below the other) that share some but not all column headings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Table 1&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Head1 HeadA&#xA;1     a&#xA;2     b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Table 2&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;HeadA HeadFoo&#xA;c     bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the result would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Head1 HeadA HeadFoo&#xA;1     a&#xA;2     b&#xA;c           bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a babel library which does not quite do this, but it may have some helper functions (which I can't locate in emacs 24.5, but I guess I could copy paste the lisp into a file and read it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the answers: Both Gastove and Tobias' answers work correctly.  I chose Tobias only because it is more &quot;pure&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="14825" LastEditDate="2022-11-05T01:16:33.993" LastActivityDate="2022-11-05T01:16:33.993" Title="Concatenate ascii/org tables with some different headings" Tags="|org-mode|org-babel|org-table|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21358" PostTypeId="1" AcceptedAnswerId="21362" CreationDate="2016-04-01T20:23:12.257" Score="1" ViewCount="268" Body="&lt;p&gt;How can I make Emacs24's mode-line to show like how its displayed in Mac version of Emacs?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any package or script or config for this?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean like this image:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/W7doK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/W7doK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I know this has nothing with Mac but the &lt;code&gt;brew install&lt;/code&gt; version in there is like this &amp;amp; I just to explain myself;&lt;/p&gt;&#xA;" OwnerUserId="11603" LastEditorUserId="105" LastEditDate="2016-04-01T21:30:41.690" LastActivityDate="2016-04-01T21:46:16.540" Title="Theming Emacs's mode-line like Mac version in Linux" Tags="|mode-line|themes|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21360" PostTypeId="1" AcceptedAnswerId="21364" CreationDate="2016-04-01T21:20:12.467" Score="2" ViewCount="1976" Body="&lt;p&gt;I am trying to bind &lt;code&gt;CTRL-B&lt;/code&gt; to perform the Evil command &lt;code&gt;:buffers&lt;/code&gt;. The reason I am doing this is because I want to scroll through the open buffers with &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; and then press &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt; to make the selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I tried was adding the following code to my configuration file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Switch Evil-mode buffers&#xA;(define-key evil-normal-state-map (kbd &quot;C-B&quot;) &quot;:buffers&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result of reloading this configuration (&lt;code&gt;:eval-buffer&lt;/code&gt;) and then pressing &lt;code&gt;CTRL-B&lt;/code&gt; leads to:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;After 0 kbd macro iterations: Can't find &quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can we bind to an Ex-mode command?&lt;/p&gt;&#xA;" OwnerUserId="11605" LastEditorUserId="11605" LastEditDate="2016-04-02T13:49:12.410" LastActivityDate="2016-04-02T13:49:12.410" Title="Bind Ex-mode command in Evil" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21361" PostTypeId="1" CreationDate="2016-04-01T21:24:34.150" Score="1" ViewCount="496" Body="&lt;p&gt;I would like a helm replacement for &lt;code&gt;find-file-other-window&lt;/code&gt;—one that acts like &lt;code&gt;helm-find-files&lt;/code&gt; but has &lt;code&gt;helm-find-files-other-window&lt;/code&gt; as the default action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2701" LastEditorUserId="105" LastEditDate="2017-05-16T22:36:47.397" LastActivityDate="2017-05-16T22:36:47.397" Title="`helm-find-files` with other window as default action" Tags="|helm|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21362" PostTypeId="2" ParentId="21358" CreationDate="2016-04-01T21:46:16.540" Score="2" Body="&lt;p&gt;That particular mode line can be installed using &lt;code&gt;power-line&lt;/code&gt; project and my horrid Lisp configuration code in my &lt;a href=&quot;https://github.com/howardabrams/dot-files/blob/master/emacs-mode-line.org&quot; rel=&quot;nofollow&quot;&gt;dot-files&lt;/a&gt; project on Github.&lt;/p&gt;&#xA;" OwnerUserId="173" LastActivityDate="2016-04-01T21:46:16.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21363" PostTypeId="2" ParentId="21357" CreationDate="2016-04-01T23:02:16.270" Score="1" Body="&lt;p&gt;My answer is an R-in-org-babel approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: first_tab&#xA;| Head1 | HeadA |&#xA;|     1 | a     |&#xA;|     2 | b     |&#xA;&#xA;#+name: second_tab&#xA;| HeadA | HeadFoo |&#xA;| c     | bar     |&#xA;&#xA;#+BEGIN_SRC R :var a=first_tab b=second_tab :colnames t&#xA;  dfa &amp;lt;- data.frame(a)&#xA;  dfb &amp;lt;- data.frame(b)&#xA;&#xA;  ## Get all names&#xA;  allnames &amp;lt;- union(names(dfa), names(dfb))&#xA;&#xA;  addmissing &amp;lt;- function(df, namevec) {&#xA;    missing &amp;lt;- setdiff(namevec, names(df))&#xA;    for (n in missing) {&#xA;      df[, n] &amp;lt;- NA&#xA;    }&#xA;    return(df)&#xA;  }&#xA;&#xA;  newdfa &amp;lt;- addmissing(dfa, allnames)&#xA;  newdfb &amp;lt;- addmissing(dfb, allnames)&#xA;&#xA;  res &amp;lt;- rbind(newdfa, newdfb)&#xA;&#xA;  return(res)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| Head1 | HeadA | HeadFoo |&#xA;|-------+-------+---------|&#xA;|     1 | a     | nil     |&#xA;|     2 | b     | nil     |&#xA;|   nil | c     | bar     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-04-01T23:02:16.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21364" PostTypeId="2" ParentId="21360" CreationDate="2016-04-01T23:17:41.763" Score="4" Body="&lt;p&gt;From the &lt;a href=&quot;https://github.com/emacsmirror/evil/blob/cd005aa50ab056492752c319b5105c38c79c2fd0/evil-maps.el#L442&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;evil&lt;/code&gt; source&lt;/a&gt;, we can see:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-ex-define-cmd &quot;buffers&quot; 'buffer-menu)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, I'd recommend binding to the command directly, instead of going through the &lt;code&gt;ex&lt;/code&gt; interface.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;C-B&quot;) #'buffer-menu)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if you find that you absolutely must, you can use a keyboard macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;C-B&quot;) (kbd &quot;:buffers&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-04-02T00:21:54.443" LastActivityDate="2016-04-02T00:21:54.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21365" PostTypeId="1" CreationDate="2016-04-01T23:37:50.230" Score="4" ViewCount="103" Body="&lt;p&gt;The function &lt;code&gt;other-frame&lt;/code&gt; cycles through the open frames in a fixed order. This can be pretty inconvenient for example when the compiling log of LaTeX comes to the front, I want to switch back to my &lt;code&gt;.tex&lt;/code&gt; document and I have plenty of other frame opened at the same time. On the major GUIs I know the window or application switching command switch between the most recent ones (and on can access the other ones by repeating the command).&lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2020-09-03T17:32:41.907" Title="How can I switch to the most recent frame with other-frame?" Tags="|frames|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21366" PostTypeId="1" CreationDate="2016-04-02T02:45:05.347" Score="8" ViewCount="2564" Body="&lt;p&gt;First post. I'd like to confirmation whether I sucessfully troubleshooted an install of Emacs, and, if I didn't, direction on where and how to proceed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My setup:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs 24.5&lt;/li&gt;&#xA;&lt;li&gt;Macbook Pro Core Duo (mid-2010)&lt;/li&gt;&#xA;&lt;li&gt;OSX El Cap (10.11.4)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I recently installed Emacs along with Kierian Healy's [&lt;a href=&quot;https://kieranhealy.org/resources/emacs-starter-kit/](social&quot; rel=&quot;noreferrer&quot;&gt;https://kieranhealy.org/resources/emacs-starter-kit/](social&lt;/a&gt; science starter kit). When I first launched Emacs after the installation I received an error (below) that as far as I could tell, didn't prevent anything from working—although, given that I'm new to Emacs one can never be sure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once installed, I received the follwing error message at launch:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading     &#xA;`/Users/lmp/.emacs.d/init.el':&#xA;&#xA;File error: Cannot open load file, no such file or directory, ob-shell&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I launched Emacs from the terminal into debug mode but couldn't for the life of me figure out the backtrace. So I commented out sections of my init.el file until I found the problem line of code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-load-file (expand-file-name &quot;starter-kit.org&quot; dotfiles-dir)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I opened the starter-kit.org file and do the same which leads me to the following code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA;'org-babel-load-languages&#xA;'((emacs-lisp . t)&#xA;(shell . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After searching the org-mode website and a few forums, I tried the following that cleared the error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA;'org-babel-load-languages&#xA;'((emacs-lisp . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's my understanding that the &lt;code&gt;. t&lt;/code&gt; part of the code is a true/false signifier. But whether removing it from the file was wise or foolish, is what I want to know. Or, to state my question in the clearest of terms: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Did I successfully fix the problem? If not, why not? &lt;/li&gt;&#xA;&lt;li&gt;Is there anything I should have done instead, or should do in addition to removing the &lt;code&gt;(shell . t)&lt;/code&gt;? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11607" LastActivityDate="2017-12-21T02:51:13.083" Title="Should I have removed `(shell . t)` to clear an ob-shell initialization error?" Tags="|init-file|shell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21367" PostTypeId="2" ParentId="21361" CreationDate="2016-04-02T05:20:03.217" Score="3" Body="&lt;p&gt;The first action is the default action, so you can change the first element of &lt;code&gt;helm-find-files-actions&lt;/code&gt; to &lt;code&gt;helm-find-files-other-window&lt;/code&gt;, use e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'helm-files&#xA;  (push '(&quot;Find file other window `C-c o'&quot; . helm-find-files-other-window)&#xA;        helm-find-files-actions)&#xA;  (delete-dups helm-find-files-actions))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use Emacs's custom system, you can also use &lt;code&gt;M-x customise-variable helm-find-files-actions&lt;/code&gt;, this way should require less emacs lisp knowledge.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Personally, I use &lt;code&gt;helm-find-files-other-window&lt;/code&gt; a lot as well. However, instead of making it as the default action, I just bind a shorter key (&lt;code&gt;M-o&lt;/code&gt;) to it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-find-files-map [?\M-o] #'helm-ff-run-switch-other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-02T05:20:03.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21368" PostTypeId="2" ParentId="21366" CreationDate="2016-04-02T06:13:40.517" Score="7" Body="&lt;p&gt;Did you successfully fix the problem? Sure! &lt;code&gt;ob-shell&lt;/code&gt; was flipping out and you stopped loading it. That is, in some sense, a fix! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said: the chunk of code you found and commented out controls which languages are loaded by &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/&quot; rel=&quot;noreferrer&quot;&gt;org babel&lt;/a&gt;, which is a pretty powerful function within org. If you've got any interest in using/evaluating shell code blocks, you'll want to fix the error you got a different way. You're right -- &lt;code&gt;. t&lt;/code&gt; associates truth with a value. In this case, it indicates that org should load the shell backend for org source blocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All this said: if you want the shell backend running, there isn't reeeeeally enough information in your original post to diagnose what's wrong with it. I can tell you my config file doesn't have &lt;code&gt;(shell . t)&lt;/code&gt;, but rather &lt;code&gt;(sh . t)&lt;/code&gt;. One thing to double-check is that you're using a version of Org Mode greater than 8, which you can do with &lt;code&gt;M-x org-version&lt;/code&gt;. Beyond that, I've very little to suggest at time of writing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So! Do you want to use shell source blocks? If yes: more problem solving ahead! If no: you fixed it! &lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-04-02T06:13:40.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21369" PostTypeId="2" ParentId="21354" CreationDate="2016-04-02T06:56:56.187" Score="4" Body="&lt;p&gt;If you run &lt;code&gt;emacs -nw&lt;/code&gt;, you can list all valid color names that can be used in the terminal.  Here's an extract from &lt;code&gt;M-x list-colors-display&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;black                                                     #000000&#xA;red                                                       #cd0000&#xA;green                                                     #00cd00&#xA;yellow                                                    #cdcd00&#xA;blue                                                      #0000ee&#xA;magenta                                                   #cd00cd&#xA;cyan                                                      #00cdcd&#xA;white                                                     #e5e5e5&#xA;brightblack                                               #7f7f7f&#xA;brightred                                                 #ff0000&#xA;brightgreen                                               #00ff00&#xA;brightyellow                                              #ffff00&#xA;brightblue                                                #5c5cff&#xA;brightmagenta                                             #ff00ff&#xA;brightcyan                                                #00ffff&#xA;brightwhite                                               #ffffff&#xA;color-16                                                  #000000&#xA;...                                                       ...&#xA;color-255                                                 #eeeeee&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, for some reason only colors 16 to 255 are numbered. Colors 0 to 15 use some take on the standard names of the 16-color terminal palette.  To make use of them, use the identifiers above when customizing a theme.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you're not in a terminal emulator, but would like to use its colors in a GUI Emacs, try the &lt;a href=&quot;https://github.com/cqql/xresources-theme&quot; rel=&quot;nofollow&quot;&gt;xresources-theme&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-04-02T06:56:56.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21370" PostTypeId="2" ParentId="21357" CreationDate="2016-04-02T07:17:12.100" Score="1" Body="&lt;p&gt;I just add an emacs-lisp version to Gastove's answer.&#xA;The code block is executed when you put point on the &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; line and input &lt;kbd&gt;C-c C-c&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Table 1&#xA;  #+name: first_tab&#xA;  | Head1 | HeadA |&#xA;  |     1 | a     |&#xA;  |     2 | b     |&#xA;&#xA;  Table 2&#xA;  #+name: second_tab&#xA;  | HeadA | HeadFoo |&#xA;  | c     | bar     |&#xA;&#xA;  #+BEGIN_SRC emacs-lisp :var first_tab=first_tab second_tab=second_tab&#xA;(require 'cl-lib)&#xA;(let ((combined-header (cl-union (car second_tab) (car first_tab) :test 'string-equal))&#xA;      (tbl-rearrange (lambda (new-header tab)&#xA;               (let ((old-header (car tab)))&#xA;             ;; TODO: Consider 'hline.&#xA;             (cl-loop&#xA;              for row in (cdr tab)&#xA;              collect (let ((alist (cl-mapcar 'cons old-header row)))&#xA;                    (mapcar&#xA;                     (lambda (col) (or (cdr (assoc col alist)) &quot;&quot;))&#xA;                     new-header)))))))&#xA;  (append&#xA;   (list combined-header)&#xA;   (funcall tbl-rearrange combined-header first_tab)&#xA;   (funcall tbl-rearrange combined-header second_tab)))&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS:&#xA;  | Head1 | HeadA | HeadFoo |&#xA;  |     1 | a     |         |&#xA;  |     2 | b     |         |&#xA;  |       | c     | bar     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-04-02T11:18:43.963" LastActivityDate="2016-04-02T11:18:43.963" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21373" PostTypeId="1" CreationDate="2016-04-02T13:32:58.643" Score="1" ViewCount="81" Body="&lt;p&gt;I would like my emacs to call&#xA;&lt;code&gt;&#xA;dropbox status&#xA;&lt;/code&gt;&#xA;every 30 seconds and display whether Dropbox is up-to-date at the bottom of the buffer (where info such as the line-number and file name is).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT to add:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my linux (with dropbox installed), the command line &lt;code&gt;dropbox status&lt;/code&gt; returns the Dropbox status:&#xA;&lt;code&gt;&#xA;$ dropbox status&#xA;Up to date&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately it seems like this doesn't work on OSX (&lt;a href=&quot;https://superuser.com/questions/678925/using-dropbox-from-the-command-line-on-osx&quot;&gt;https://superuser.com/questions/678925/using-dropbox-from-the-command-line-on-osx&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="11611" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2016-04-02T17:50:45.830" Title="Display dropbox status" Tags="|mode-line|shell-command|mode-line-format|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="21374" PostTypeId="1" AcceptedAnswerId="21375" CreationDate="2016-04-02T13:50:42.600" Score="7" ViewCount="4721" Body="&lt;p&gt;I wrote a very simple function to properly restart ipython console with elpy when evaluating the buffer or region:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-restart-python-console ()&#xA;  &quot;Restart python console before evaluate buffer or region to avoid various uncanny conflicts, like not reloding modules even when they are changed&quot;&#xA;  (interactive)&#xA;  (kill-process &quot;Python&quot;)&#xA;  (kill-buffer &quot;*Python*&quot;)&#xA;  (elpy-shell-send-region-or-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Itt works but always ask confirmation, because &quot;*Python*&quot; has a running process, however I kill the process before killing the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fun part:&#xA;If I evaluate the function body line by line it works...&lt;/p&gt;&#xA;" OwnerUserId="10978" LastEditorUserId="105" LastEditDate="2016-06-22T19:58:13.420" LastActivityDate="2019-08-29T13:11:33.437" Title="Function to restart python console" Tags="|python|elpy|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21375" PostTypeId="2" ParentId="21374" CreationDate="2016-04-02T13:56:14.960" Score="5" Body="&lt;p&gt;Well I figured it out:&#xA;kill-process kills the process as a side effect, so it returns before that is really killed. So a function like this works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-restart-python-console ()&#xA;  &quot;Restart python console before evaluate buffer or region to avoid various uncanny conflicts, like not reloding modules even when they are changed&quot;&#xA;  (interactive)&#xA;  (kill-process &quot;Python&quot;)&#xA;  (sleep-for 0.05)&#xA;  (kill-buffer &quot;*Python*&quot;)&#xA;  (elpy-shell-send-region-or-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-04-02T13:56:14.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21376" PostTypeId="2" ParentId="21331" CreationDate="2016-04-02T14:06:31.207" Score="1" Body="&lt;p&gt;For large output, the process filter function (&lt;code&gt;comint-output-filter&lt;/code&gt; in this case) is called many times. So the simple solution is to replace the process filter function as below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you print a large object, then please call &lt;code&gt;my-ignore-output&lt;/code&gt; in the process buffer. It replaces the process filter by &lt;code&gt;my-ignore-output--filter-func&lt;/code&gt;. The process filter prints a number in the echo area. It indicates how many times the filter function (&lt;code&gt;my-ignore-output--filter-func&lt;/code&gt;) is called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the number stops increasing, then please call &lt;code&gt;my-ignore-output-cleanup&lt;/code&gt;. It restores the original filter function and deletes the previous output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use the following code, I recommend byte-compiling the code for performance. I tested this in the inferior python buffer but not in SQL buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;(require 'comint)&#xA;&#xA;(defvar my-ignore-output--counter nil)&#xA;(defvar my-ignore-ouptut--original-filter nil)&#xA;(defvar my-ignore-output--last-input-end nil)&#xA;&#xA;(defun my-ignore-output--filter-func (_proc _output)&#xA;  (cl-incf my-ignore-output--counter)&#xA;  (let ((message-log-max nil))&#xA;    (message &quot;%d&quot; my-ignore-output--counter)))&#xA;&#xA;(defun my-ignore-output ()&#xA;  (interactive)&#xA;  (let ((proc (get-buffer-process (current-buffer))))&#xA;    (unless (equal (process-filter proc) #'my-ignore-output--filter-func)&#xA;      (setq my-ignore-ouptut--original-filter (process-filter proc)&#xA;            my-ignore-output--counter 0&#xA;            my-ignore-output--last-input-end (marker-position comint-last-input-end))&#xA;      (set-process-filter proc #'my-ignore-output--filter-func))))&#xA;&#xA;(defun my-ignore-output-cleanup ()&#xA;  (interactive)&#xA;  (let ((proc (get-buffer-process (current-buffer)))&#xA;        (inhibit-read-only t))&#xA;    (delete-region my-ignore-output--last-input-end&#xA;                   (marker-position (process-mark proc)))&#xA;    (set-process-filter proc my-ignore-ouptut--original-filter)&#xA;    ;; Print the prompt&#xA;    (comint-simple-send proc &quot;\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9471" LastActivityDate="2016-04-02T14:06:31.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21377" PostTypeId="1" AcceptedAnswerId="21397" CreationDate="2016-04-02T14:11:59.717" Score="1" ViewCount="37" Body="&lt;p&gt;I have been compiling my C++ project using &lt;code&gt;M-x compile&lt;/code&gt; which I like because it provides highlighted links to my errors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aVaCa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aVaCa.png&quot; alt=&quot;highlighted compile errors&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However after adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path&#xA;         &quot;~/.emacs.d/plugins/yasnippet&quot;)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my .emacs file this no longer works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/B4YSa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/B4YSa.png&quot; alt=&quot;compile errors not highlighted&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd really like to use yasnippet and have my compile errors highlighted, anyone have any idea how to fix this? I'm using GNU Emacs 24.3.1&lt;/p&gt;&#xA;" OwnerUserId="11599" LastActivityDate="2016-04-03T14:19:11.730" Title="Yasnippet stops compile error highlighting" Tags="|yasnippet|compilation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21378" PostTypeId="1" AcceptedAnswerId="21379" CreationDate="2016-04-02T15:28:26.553" Score="20" ViewCount="8897" Body="&lt;p&gt;How can I use multiple dictionaries with the Emacs spell checker? Specifically I want to use a British English dictionary and a medical English dictionary at the same time.&lt;/p&gt;&#xA;" OwnerUserId="7018" LastActivityDate="2023-07-23T17:48:55.727" Title="Spell check with multiple dictionaries" Tags="|ispell|spell-checking|hunspell|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21379" PostTypeId="2" ParentId="21378" CreationDate="2016-04-02T15:28:26.553" Score="21" Body="&lt;p&gt;&lt;a href=&quot;https://hunspell.github.io&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hunspell&lt;/a&gt; can spell check with multiple dictionaries, and you can configure this to work with Emacs. This is how I do it on OS X 10.11, with Emacs 25.0. It will not work with older Emacsen.&lt;/p&gt;&#xA;&lt;p&gt;Install Hunspell&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;brew install hunspell&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Download Hunspell dictionaries from &lt;a href=&quot;http://extensions.libreoffice.org/extension-center&quot; rel=&quot;nofollow noreferrer&quot;&gt;LibreOffice&lt;/a&gt; and &lt;a href=&quot;http://e-medtools.com/openmedspel.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;OpenMedSpel&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;cd ~/Downloads/&#xA;&#xA;curl http://extensions.libreoffice.org/extension-center/english-dictionaries/releases/2016.04.01/dict-en.oxt &amp;gt; dict-en.oxt&#xA;unzip dict-en.oxt en_GB.aff en_GB.dic&#xA;&#xA;curl -L https://addons.mozilla.org/en-US/firefox/downloads/latest/6526/addon-6526-latest.xpi &amp;gt; openmedspel.xpi&#xA;unzip openmedspel.xpi dictionaries/OpenMedSpel.{aff,dic}&#xA;mv dictionaries/OpenMedSpel.dic en_US-med.dic&#xA;mv dictionaries/OpenMedSpel.aff en_US-med.aff&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Put the dictionaries in &lt;code&gt;~/Library/Spelling/&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;mv *.aff *.dic ~/Library/Spelling/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Add this to &lt;code&gt;~/.emacs/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (with-eval-after-load &amp;quot;ispell&amp;quot;&#xA;      (setq ispell-program-name &amp;quot;hunspell&amp;quot;)&#xA;      (setq ispell-dictionary &amp;quot;en_GB,en_US-med&amp;quot;)&#xA;      ;; ispell-set-spellchecker-params has to be called&#xA;      ;; before ispell-hunspell-add-multi-dic will work&#xA;      (ispell-set-spellchecker-params)&#xA;      (ispell-hunspell-add-multi-dic &amp;quot;en_GB,en_US-med&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7018" LastEditorUserId="26970" LastEditDate="2021-03-09T15:18:10.653" LastActivityDate="2021-03-09T15:18:10.653" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="21380" PostTypeId="1" CreationDate="2016-04-02T15:55:21.657" Score="4" ViewCount="2069" Body="&lt;p&gt;I would like to show sum of efforts for all tasks for a day in Org-Agenda day title. E.g. for a week agenda there would be 7 sums for each of the day, in their respective titles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this could be done somehow by manipulating the &lt;code&gt;org-agenda-format-date&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, this variable points to a builtin function &lt;code&gt;org-agenda-format-date-aligned&lt;/code&gt;, but I suppose it can be reset to point to a custom function to include the sum of efforts in the date line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please help me define such a function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I would like to use a predefined &lt;code&gt;Effort&lt;/code&gt; value for all tasks lacking the &lt;code&gt;Effort&lt;/code&gt; property.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="2590" LastEditDate="2016-04-03T23:56:51.320" LastActivityDate="2019-08-28T00:57:42.433" Title="Show sum of efforts for a day in Org-Agenda day title" Tags="|org-mode|org-agenda|time-date|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21381" PostTypeId="1" AcceptedAnswerId="21383" CreationDate="2016-04-02T17:37:23.477" Score="5" ViewCount="496" Body="&lt;p&gt;looks like Emacs tries to be smart, switching to an annoying &lt;code&gt;change-log-mode&lt;/code&gt; often when i am editing a changelog file. I would like to disable it, but i just find info about how to interactively disable a mode while editing a buffer, or how to enable a mode when a file matches a pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot find any info about &lt;strong&gt;how to disable a major mode totally and in any case&lt;/strong&gt;. Ideally i would even remove it from my installation, as i will be never using it&lt;/p&gt;&#xA;" OwnerUserId="11563" LastActivityDate="2016-04-02T18:15:15.957" Title="How to never have a major mode enabled automatically" Tags="|init-file|major-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21382" PostTypeId="2" ParentId="21381" CreationDate="2016-04-02T18:05:36.040" Score="2" Body="&lt;p&gt;Here are two sledgehammer approaches:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun change-log-mode () t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which redefines &lt;code&gt;change-log-mode&lt;/code&gt; to do nothing, and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'change-log-mode (symbol-function 'fundamental-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which makes &lt;code&gt;change-log-mode&lt;/code&gt; turn on fundamental mode instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third approach might be to use an overriding advice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And a somewhat less drastic approach is to remove all mention of the offending mode from &lt;code&gt;auto-mode-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;(setq auto-mode-alist&#xA;      (remove-if (lambda (pair) (eq (cdr pair) 'change-log-mode))&#xA;                 auto-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way, you are not disabling the mode altogether, but it should never be automatically applied (unless some other mechanism turns it on).&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="962" LastEditDate="2016-04-02T18:11:15.600" LastActivityDate="2016-04-02T18:11:15.600" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21383" PostTypeId="2" ParentId="21381" CreationDate="2016-04-02T18:07:19.443" Score="10" Body="&lt;p&gt;Emacs keeps a list of regexp-mode pairs in an alist called &lt;code&gt;auto-mode-alist&lt;/code&gt;. Any file you open has it's name matched against the nodes in the alist; every match activates a mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what you want to do, it sounds like, is purge &lt;code&gt;change-log-mode&lt;/code&gt; from &lt;code&gt;auto-mode-alist&lt;/code&gt;, which you can do in your &lt;code&gt;init.el&lt;/code&gt;/&lt;code&gt;.emacs.d&lt;/code&gt;/etc like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rassq-delete-all 'change-log-mode auto-mode-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-04-02T18:07:19.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21384" PostTypeId="2" ParentId="21374" CreationDate="2016-04-02T18:12:20.677" Score="4" Body="&lt;p&gt;If you're using &lt;code&gt;ipython&lt;/code&gt;, why not just use the baked-in &lt;a href=&quot;https://ipython.org/ipython-doc/3/interactive/magics.html#magic-reset&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;%reset&lt;/code&gt;&lt;/a&gt; magic command? You can also use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%load_ext autoreload&#xA;%autoreload&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To automatically reload imported modules on change. &lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-04-02T18:12:20.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21385" PostTypeId="2" ParentId="21381" CreationDate="2016-04-02T18:15:15.957" Score="1" Body="&lt;p&gt;You need to modify the &lt;code&gt;auto-mode-alist&lt;/code&gt; variable. This is “alist of&#xA;filename patterns vs corresponding major mode functions”. Its value looks&#xA;like this (at least for me):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&#xA; …&#xA; (&quot;[cC]hange\\.?[lL]og?\\'&quot; . change-log-mode)&#xA; (&quot;[cC]hange[lL]og[-.][0-9]+\\'&quot; . change-log-mode)&#xA; (&quot;\\$CHANGE_LOG\\$\\.TXT&quot; . change-log-mode)&#xA; …&#xA; (&quot;[cC]hange[lL]og[-.][-0-9a-z]+\\'&quot; . change-log-mode)&#xA; …&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, you just need to either push something that matches these regexps on top&#xA;of the list or remove these items. I think pushing is a better idea because&#xA;you don't need to traverse all contents of the list, so here we go:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(&quot;[cC]hange\\.?[lL]og?\\'&quot; . text-mode) auto-mode-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here I “disabled” the first regexp, so plain &lt;code&gt;text-mode&lt;/code&gt; will be used for&#xA;files that match it from now on (this method has the additional benefit that&#xA;you can specify which mode to use instead because &lt;code&gt;fundamental-mode&lt;/code&gt; may be&#xA;not very interesting). You can do the same to the other regexps.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2016-04-02T18:15:15.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21386" PostTypeId="1" CreationDate="2016-04-02T18:36:18.943" Score="4" ViewCount="2292" Body="&lt;p&gt;So, in Mac OSX,  I'm trying to switch to using Emacs in Terminal.app, but things like &lt;code&gt;C-M-SPC&lt;/code&gt; and &lt;code&gt;C-M-%&lt;/code&gt; don't work. After a bit of googling I came across this (mostly) unanswered question&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://superuser.com/questions/83166/using-c-m-to-do-a-query-replace-regexp-in-emacs-running-in-mac-terminal&quot;&gt;https://superuser.com/questions/83166/using-c-m-to-do-a-query-replace-regexp-in-emacs-running-in-mac-terminal&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other discussions such as &lt;a href=&quot;https://emacs.stackexchange.com/questions/14000/why-doesnt-c-c-or-c-work-in-a-terminal-emulator-os-x-terminal-i&quot;&gt;this one&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/questions/11110801/why-does-ctrl-not-work-when-i-bind-it-to-a-command-in-emacs/11118511#11118511&quot;&gt;this one&lt;/a&gt; point out that this is basically the &lt;em&gt;terminal emulator's fault&lt;/em&gt;, which I can understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is there really no workaround? The last answer in the superuser question &lt;a href=&quot;https://superuser.com/a/84008/218146&quot;&gt;https://superuser.com/a/84008/218146&lt;/a&gt;, seems promising, but I don't understand it fully. Can you really make Emacs read those events? Perhaps a working (if probably elaborate) hack could be developed on top of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, I could use another terminal emulator. The only requirement is that I can keep using the &quot;Option/Alt&quot; key as the Meta key. Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I just found out that the &quot;esc&quot; key works, i.e., I can input C-M-SPC perfectly with it. So a more than reasonable hack for me would be to remap Left Option to ESC in Terminal.app. Anyone know how to do that?&#xA;EDIT2: I spoke too soon: I tried out Karabiner (&lt;a href=&quot;https://pqrs.org/osx/karabiner/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://pqrs.org/osx/karabiner/&lt;/a&gt;) and remapped LeftOption to ESC. A single C-M-SPC works alright, but multiple SPC's after that don't. So it's mostly useless... :-(&lt;/p&gt;&#xA;" OwnerUserId="2478" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-29T11:43:13.973" Title="OS X Terminal.app C-M-commands" Tags="|key-bindings|osx|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21388" PostTypeId="1" CreationDate="2016-04-02T20:04:22.143" Score="14" ViewCount="1319" Body="&lt;p&gt;I clock my time in org-mode. Because projects in my line of work can last for several years, I'd like clock reports that extend over a long period of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that it's annoying to keep completed subtasks in my todo files. I'd like to be able to put those in the archive. However, this destroys the clocktable structure. Anything in the archive is listed separately (it's a different file), and there's no longer any hierarchical structure to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like is to be able to automagically merge information from the archive and the main file when the clocktable is compiled.&lt;/p&gt;&#xA;" OwnerUserId="8654" LastActivityDate="2020-11-17T02:06:50.817" Title="including archives in org-mode clock-table" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21389" PostTypeId="1" CreationDate="2016-04-02T20:08:51.107" Score="7" ViewCount="1803" Body="&lt;p&gt;I would prefer to have the &lt;code&gt;*compilation*&lt;/code&gt; buffer always stay in its own frame. However, currently if I run &lt;code&gt;M-x compile&lt;/code&gt; from another frame/window, the buffer pops up in a new window there as well. How can I cause emacs to instead only raise the existing frame which is displaying the &lt;code&gt;*compilation*&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="9459" LastActivityDate="2016-05-03T18:12:31.183" Title="How can I pin the *compilation* buffer to never leave a single frame/window" Tags="|window|frames|compilation|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21390" PostTypeId="1" CreationDate="2016-04-02T23:34:58.357" Score="6" ViewCount="189" Body="&lt;p&gt;I am using org-mode to track effort. I would like to be able to see, in column view, the sum total of time remaining on a project (that is, Effort - CLOCKSUM). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't had much luck so far. &lt;a href=&quot;http://thread.gmane.org/gmane.emacs.orgmode/61459/focus=61555&quot; rel=&quot;noreferrer&quot;&gt;This&lt;/a&gt; provides some code but requires a lot of dependencies I haven't been able to track down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a very old discussion of how to use custom formulas for columns in org-mode &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2009-03/msg00350.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. However, perhaps this pertains to org tables, rather than column view, since I can't get even the example in the email to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:COLUMNS:  %25ITEM %2d{`(,(or curval 0) 0)} %f{`(,(or curval 0) 0)} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;%2fd{`(,(+ $f $d) 0)}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, something like %f{FUBAR} returns the value of property 'f' regardless of what code I replace FUBAR with.&lt;/p&gt;&#xA;" OwnerUserId="8654" LastActivityDate="2016-04-02T23:34:58.357" Title="Calculating time remaining in org-mode" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21391" PostTypeId="1" CreationDate="2016-04-02T23:53:56.100" Score="1" ViewCount="123" Body="&lt;p&gt;Desktop-save-mode seems to save all windows &lt;em&gt;except&lt;/em&gt; neotree - When I restart emacs, the neotree window is always gone. Why is this window different from the others? Is it possible for neotree's state to persist like everything else?&lt;/p&gt;&#xA;" OwnerUserId="11140" LastEditorUserId="105" LastEditDate="2016-04-03T01:31:26.200" LastActivityDate="2016-04-03T01:31:26.200" Title="Why doesn't desktop-save-mode persist neotree?" Tags="|window|desktop|persistence|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21392" PostTypeId="2" ParentId="21386" CreationDate="2016-04-03T00:00:35.663" Score="3" Body="&lt;p&gt;So, I'm going to answer my own question. This is a reasonable workaround for me:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;edit Terminal.app's preference plist. it's a binary plist so you have to convert it first to text&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ plutil -convert xml1 ~/Library/Preferences/com.apple.Terminal.plist`&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, find the &lt;code&gt;keyMapBoundKeys&lt;/code&gt; section, should have stuff like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;key&amp;gt;keyMapBoundKeys&amp;lt;/key&amp;gt;&#xA;    &amp;lt;dict&amp;gt;&#xA;        &amp;lt;key&amp;gt;$F702&amp;lt;/key&amp;gt;&#xA;        &amp;lt;string&amp;gt;[1;2D&amp;lt;/string&amp;gt;&#xA;        ...&#xA;    &amp;lt;/dict&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add the keybinding you're missing in Emacs. How? See &lt;a href=&quot;http://heisencoder.net/2008/04/fixing-up-mac-key-bindings-for-windows.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://heisencoder.net/2008/04/fixing-up-mac-key-bindings-for-windows.html&lt;/a&gt;.&#xA;To add &lt;code&gt;C-M-SPC&lt;/code&gt;, I had to use &lt;code&gt;&amp;lt;key&amp;gt;~^0020&amp;lt;/key&amp;gt;&lt;/code&gt; (&lt;code&gt;0020&lt;/code&gt; is ASCII 32, or space, in hex. In the &lt;code&gt;&amp;lt;string&amp;gt;&lt;/code&gt; portion, use a sequence of escapes. I used &quot;double escape space&quot;, or &lt;code&gt;&amp;lt;string&amp;gt;\033\033 &amp;lt;/string&amp;gt;&lt;/code&gt; but perhaps something else would be smarter.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In terminal emacs, your keybinding is now recognized finally, but emacs sees it as something else, in this case &lt;code&gt;ESC M-SPC&lt;/code&gt;. No problem, I bind that to &lt;code&gt;mark-sexp&lt;/code&gt; and done!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;1-3 could have been avoided if Terminal.app provided a decent interface to add keybindings. As I write this only keybindings to function keys can be added via the Terminal.app's Preferences dialog.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, 4 can probably be done a lot better: &lt;a href=&quot;https://emacs.stackexchange.com/questions/1020/problems-with-keybindings-when-using-terminal?lq=1&quot;&gt;Problems with keybindings when using terminal&lt;/a&gt; explains that one should use a special keymap for this and maybe follow some standard for escape sequences. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for the moment, I'm good&lt;/p&gt;&#xA;" OwnerUserId="2478" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-04-03T00:00:35.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21393" PostTypeId="2" ParentId="21389" CreationDate="2016-04-03T01:37:11.277" Score="5" Body="&lt;p&gt;Make buffer &lt;em&gt;compilation&lt;/em&gt; always have a dedicated window. One way to do this is to customize option &lt;code&gt;special-display-buffer-names&lt;/code&gt;, to include &lt;code&gt;&quot;*compilation*&quot;&lt;/code&gt;. Another is to customize option &lt;code&gt;special-display-regexps&lt;/code&gt;, to include a regexp that matches that buffer name. (I include the regexp &lt;code&gt;&quot;[ ]?[*][^*]+[*]&quot;&lt;/code&gt;, which matches all buffers whose names are &lt;code&gt;*...*&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See also option &lt;code&gt;special-display-frame-alist&lt;/code&gt;, which you can use to specify the behavior and characteristics of the frame used for such special-display buffers.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs will tell you that these &quot;special-display buffer&quot; options are &quot;obsolete&quot;, but thank goodness they are still supported. They offer a simple way to do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to suffer through what Emacs prefers you do now, then customize option &lt;code&gt;display-buffer-alist&lt;/code&gt; instead. The idea is essentially the same (it's just an uglier and more complicated user option).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-03T01:37:11.277" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21394" PostTypeId="1" AcceptedAnswerId="21395" CreationDate="2016-04-03T01:51:02.600" Score="13" ViewCount="2147" Body="&lt;p&gt;Basically I would like to have (custom-set-variables ...) in a seperate file and for me to load that file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just for the purpose of organisation of my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the default location of custom-set-variables?&lt;/p&gt;&#xA;" OwnerUserId="8716" LastActivityDate="2020-02-11T23:24:21.320" Title="How can I change where the customize puts custom-set-variables" Tags="|customize|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21395" PostTypeId="2" ParentId="21394" CreationDate="2016-04-03T02:18:01.817" Score="11" Body="&lt;p&gt;Set the &lt;code&gt;custom-file&lt;/code&gt; variable in your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;custom-file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-04-03T02:18:01.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21396" PostTypeId="1" AcceptedAnswerId="21401" CreationDate="2016-04-03T02:59:07.357" Score="1" ViewCount="106" Body="&lt;p&gt;I use &lt;code&gt;mouse-2&lt;/code&gt; quite often for &lt;code&gt;mouse-yank-primary&lt;/code&gt;. However, if I am at the start of an org-mode headline, instead of yanking from my cut buffer, it toggles the level of the headline. For example, if I have the cursor at the start of a level 1 headline(&lt;code&gt;|&lt;/code&gt; used to represent cursor):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;mouse-2&lt;/code&gt; and it becomes: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...instead of yanking the text I want as the headline. Then if I press &lt;code&gt;mouse-2&lt;/code&gt; again, it becomes a level 1 headline again, and will keep toggling between the two on subsequent presses. How can I change this behavior to yank instead of changing the headline level? Normally I can figure these things out on my own, but I have had trouble in the past when it comes to changing the behavior of mouse buttons.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;describe-key&lt;/code&gt; before asking this question, and it seemed like &lt;code&gt;mouse-2&lt;/code&gt; should do what I want, but I just noticed at the bottom of the &lt;code&gt;describe-key&lt;/code&gt; description for the&lt;code&gt;up-event&lt;/code&gt; it says: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;&amp;lt;mouse-2&amp;gt;&lt;/code&gt; at that spot runs the command (lambda (e) (interactive &quot;e&quot;)&#xA;  (mouse-set-point e) (org-cycle)), which is an interactive Lisp function.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;&amp;lt;mouse-2&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(anonymous E)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Not documented. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I assume this is what is causing my issue, but it doesn't seem clear to me where this is coming from.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-04-03T14:48:55.713" LastActivityDate="2016-04-03T17:30:43.373" Title="Make mouse-2 yank in org headlines" Tags="|org-mode|mouse|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21397" PostTypeId="2" ParentId="21377" CreationDate="2016-04-03T14:19:11.730" Score="0" Body="&lt;p&gt;As mentioned in the issue &lt;a href=&quot;https://github.com/capitaomorte/yasnippet/issues/672&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, this was fixed by updating yasnippet to the version from github. The version on the GNU ELPA repo (0.8.0) is quite old.&lt;/p&gt;&#xA;" OwnerUserId="11599" LastActivityDate="2016-04-03T14:19:11.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21398" PostTypeId="1" CreationDate="2016-04-03T16:40:45.827" Score="5" ViewCount="115" Body="&lt;p&gt;Is there a way to have &lt;code&gt;describe-variable&lt;/code&gt; show characters instead of numbers where it makes sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's for example output of &lt;code&gt;describe-variable word-separating-categories&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;word-separating-categories is a variable defined in `C source code'.&#xA;  Its value is ((72 . 75))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: List of pair (cons) of categories to determine word&#xA;  boundary. See the documentation of the variable&#xA;  `word-combining-categories'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It would help if instead ((72 . 75)) it would show something meaningful.&lt;/p&gt;&#xA;" OwnerUserId="10263" LastActivityDate="2016-04-03T22:15:54.643" Title="describe-variable show characters instead of numbers" Tags="|keymap|variables|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21399" PostTypeId="2" ParentId="21338" CreationDate="2016-04-03T16:41:37.527" Score="5" Body="&lt;h1&gt;Auto-closing&lt;/h1&gt;&#xA;&lt;p&gt;I'm not sure what's going on with &lt;code&gt;(setq web-mode-tag-auto-close-style 2)&lt;/code&gt;, but you can get auto-closing with &lt;code&gt;&amp;lt;/&lt;/code&gt; as you noted, and also with the &lt;kbd&gt;TAB&lt;/kbd&gt; key via emmet-mode (see below).&lt;/p&gt;&#xA;&lt;h3&gt;&lt;em&gt;Emmet-mode auto-closing&lt;/em&gt;&lt;/h3&gt;&#xA;&lt;p&gt;You can get &lt;code&gt;&amp;lt;div&amp;gt;|&amp;lt;/div&amp;gt;&lt;/code&gt; with either&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;div&lt;/code&gt;&lt;kbd&gt;TAB&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;div&amp;gt;&lt;/code&gt;&lt;kbd&gt;TAB&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;...but not with &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;&lt;kbd&gt;TAB&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;h1&gt;Expanders&lt;/h1&gt;&#xA;&lt;p&gt;To get the behaviour you want with &lt;code&gt;d/s/&lt;/code&gt;, you need to include the following setup code in your config:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &amp;quot;web-mode&amp;quot;&#xA;  '(setq web-mode-enable-auto-expanding t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h1&gt;Emmet-mode&lt;/h1&gt;&#xA;&lt;p&gt;Note that the Spacemacs html-layer includes &lt;a href=&quot;https://github.com/smihica/emmet-mode&quot; rel=&quot;noreferrer&quot;&gt;emmet-mode&lt;/a&gt; (&amp;quot;zencoding&amp;quot;) as well as web-mode, which gives you convenient shortcuts.&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;sub&gt;&lt;strong&gt;1&lt;/strong&gt;   The web-mode expanders will change the behaviour of emmet-mode shortcuts slightly, I doubt it will cause any problems.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="8578" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-04-03T16:41:37.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21400" PostTypeId="2" ParentId="21389" CreationDate="2016-04-03T17:26:13.090" Score="6" Body="&lt;p&gt;Normally, Emacs considers the selected frame the only reusable frame.&#xA;In other words, normally Emacs only searches the current (&quot;selected&quot;) frame for windows that already contain the buffer-to-display (&quot;reusable windows&quot;). What you need is for Emacs to consider the compilation buffer's frame as a reusable frame:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(push '(&quot;\\*compilation\\*&quot; . (nil (reusable-frames . t))) display-buffer-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above snippet will make all the frames reusable when &lt;code&gt;display-buffer&lt;/code&gt; displays the &lt;code&gt;*compilation*&lt;/code&gt; buffer. Look at the documentation of &lt;code&gt;display-buffer-reuse-window&lt;/code&gt; to learn what other values &lt;code&gt;reusable-frames&lt;/code&gt; can receive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this doesn't take care of the other direction - opening a code buffer from the compilation window. For example, if you open a buffer by pressing a link in the compilation buffer, Emacs will open the buffer in the same frame as the compilation window. Changing that is another matter. I don't know how the behavior compares with the &lt;code&gt;special-display-buffer-names&lt;/code&gt; solution.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-04-03T17:26:13.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21401" PostTypeId="2" ParentId="21396" CreationDate="2016-04-03T17:30:43.373" Score="1" Body="&lt;p&gt;A &lt;a href=&quot;https://www.google.de/search?client=ubuntu&amp;amp;channel=fs&amp;amp;q=%28lambda+%28e%29+%28interactive+%22e%22%29+%28mouse-set-point+e%29+%28org-cycle%29%29&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;gfe_rd=cr&amp;amp;ei=fVIBV_PFEfCP8Qe1tZeIDA&quot; rel=&quot;nofollow&quot;&gt;search for the binding&lt;/a&gt; delivers: &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/lisp/org-bullets.el;hb=HEAD&quot; rel=&quot;nofollow&quot;&gt;org-bullets.el&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the documentation of &lt;code&gt;org-bullets-bullet-map&lt;/code&gt;. There you find:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Should this be undesirable, one can remove them with (setcdr org-bullets-bullet-map nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They propertize the bullets with this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put-text-property (match-beginning 0) (match-end 0)&#xA;                   'keymap org-bullets-bullet-map)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-04-03T17:30:43.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21402" PostTypeId="2" ParentId="21110" CreationDate="2016-04-03T18:08:27.493" Score="2" Body="&lt;p&gt;Turns out looking at the syntax table had little merit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution that I've found is to just advice the &lt;code&gt;evil-word&lt;/code&gt; functions to skip over the dash.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun skip-dash-backward (n &amp;amp;rest foo)&#xA;    (if (eq (char-before (point)) ?-)&#xA;        (backward-char))&#xA;    (message &quot;Skipped dash&quot;))&#xA;&#xA;  (defun skip-dash-forward (n &amp;amp;rest foo)&#xA;    (if (eq (char-after (point)) ?-)&#xA;        (forward-char))&#xA;    (message &quot;Skipped dash&quot;))&#xA;&#xA;  (defun skip-dash-forward-end (n &amp;amp;rest foo)&#xA;    (if (eq (char-after (+ 1 (point))) ?-)&#xA;        (forward-char))&#xA;    (message &quot;Skipped dash&quot;))&#xA;&#xA;  (advice-add 'evil-forward-word-begin :after #'skip-dash-forward)&#xA;  (advice-add 'evil-forward-word-end :before #'skip-dash-forward-end)&#xA;  (advice-add 'evil-backward-word-begin :before #'skip-dash-backward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10263" LastEditorUserId="10263" LastEditDate="2016-04-03T18:29:31.910" LastActivityDate="2016-04-03T18:29:31.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21403" PostTypeId="1" CreationDate="2016-04-03T19:40:16.727" Score="2" ViewCount="150" Body="&lt;p&gt;I've changed the keybinding &lt;code&gt;C-s&lt;/code&gt; to save buffer, but when I'm writing code and &lt;code&gt;autocomplete&lt;/code&gt; is visible, it rebinds this key to search for a pattern:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pJz47.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pJz47.png&quot; alt=&quot;Hitting C-S when autocomplete is open&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to use &lt;code&gt;C-h k&lt;/code&gt; to find out which function is bound to &lt;code&gt;C-s&lt;/code&gt;, even with the &lt;code&gt;autocomplete&lt;/code&gt; open, emacs tells me it's save buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find out what is overwriting the &lt;code&gt;C-s&lt;/code&gt; keybinding, and how to avoid it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.5.1 on RHEL Linux, the active modes are Python Flymake AC.&lt;/p&gt;&#xA;" OwnerUserId="11621" LastEditorUserId="253" LastEditDate="2016-04-03T20:12:41.323" LastActivityDate="2016-05-03T21:13:03.900" Title="How to prevent autocomplete from overriding my keybindings?" Tags="|key-bindings|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21404" PostTypeId="2" ParentId="21403" CreationDate="2016-04-03T21:06:57.927" Score="1" Body="&lt;p&gt;I don't use auto-complete. But looking in (an old version of ) the source code I see this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar ac-completing-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;     ...&#xA;     (define-key map &quot;\C-s&quot; 'ac-isearch)&#xA;  ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you probably just need to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key ac-completing-map &quot;\C-s&quot; nil)&#xA;(define-key ac-completing-map SOME-OTHER-KEY 'ac-isearch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd also suggest that you send a bug report to the auto-complete maintainer, asking for an easy way to discover the keys during completion. &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-03T21:06:57.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21405" PostTypeId="2" ParentId="21398" CreationDate="2016-04-03T21:15:50.233" Score="2" Body="&lt;p&gt;In Emacs a character &lt;strong&gt;&lt;em&gt;is&lt;/em&gt;&lt;/strong&gt; an integer.  There is no way for &lt;code&gt;describe-variable&lt;/code&gt; to know that the value of this variable is a list that contains conses with car and cdr that you want to see rendered as characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapcar (lambda (cs)&#xA;          (cons (format &quot;%c&quot; (car cs)) (format &quot;%c&quot; (cdr cs))))&#xA;        word-separating-categories)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-03T21:15:50.233" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21406" PostTypeId="1" CreationDate="2016-04-03T21:22:16.940" Score="3" ViewCount="210" Body="&lt;p&gt;Is there any way to easily find all the modes that derive from a mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I can get is to use &lt;code&gt;M-x apropros&lt;/code&gt; and search for &lt;code&gt;-mode$&lt;/code&gt; and manually comb through all defuns with the property &lt;code&gt;derived-mode-parent&lt;/code&gt; and peek at them to see if they derive from the mode I am interested in. I suppose I could write a routine to do that quickly, but I'd rather not if I can help it.&lt;/p&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2016-04-03T21:22:16.940" Title="Find all modes derived from a mode" Tags="|major-mode|derived-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21407" PostTypeId="2" ParentId="21398" CreationDate="2016-04-03T22:15:54.643" Score="0" Body="&lt;p&gt;&lt;code&gt;print1-to-string&lt;/code&gt; is used during making display string of the variable's value, so maybe you can try to hijack that, use, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun display-in-char-p (var val)&#xA;  (or (eq 'word-separating-categories var)&#xA;      (numberp val)&#xA;      (and (listp val) (ignore-errors (seq-every-p #'numberp val)))))&#xA;&#xA;(defun describe-variable-hack (orig-fun &amp;amp;rest args)&#xA;  (when (display-in-char-p (car args) (symbol-value (car args)))&#xA;    (advice-add 'prin1-to-string :filter-return&#xA;                (defun prin1-to-string-hack (rtv)&#xA;                  (replace-regexp-in-string&#xA;                   &quot;[0-9]+&quot;&#xA;                   (lambda (match) (string (string-to-number match)))&#xA;                   rtv))))&#xA;  (unwind-protect (apply orig-fun args)&#xA;    (advice-remove 'prin1-to-string #'prin1-to-string-hack)))&#xA;&#xA;(advice-add 'describe-variable :around #'describe-variable-hack)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-03T22:15:54.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21408" PostTypeId="1" AcceptedAnswerId="21410" CreationDate="2016-04-03T22:15:56.660" Score="6" ViewCount="2475" Body="&lt;p&gt;For example, I have the following content in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;123&#xA;1234&#xA;12345&#xA;123456&#xA;1234567&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To match the 4 numbers, I need the regular expression of &lt;code&gt;\d{4}&lt;/code&gt;.&#xA;I would like to do the same in Emacs, when I press &lt;kbd&gt;C-s&lt;/kbd&gt; and type the regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm looking in the documentation of Emacs regexp, many various regexp, Emacs own regexp, applications in Emacs Lisp, and so on, it's intensively documented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want to have interactive search, type the regexp &lt;code&gt;\d{4}&lt;/code&gt; and find the match. How could I apply that? The documentation gave no directly answer on this.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-04-04T14:09:40.720" LastActivityDate="2016-04-04T14:09:40.720" Title="How to use the regexp for digits with an interactive search?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21409" PostTypeId="1" CreationDate="2016-04-03T22:42:11.490" Score="2" ViewCount="1182" Body="&lt;p&gt;Whenever I double-click files on finder to open them using emacs, they open in existing buffers. Instead I would like them to open in separate frames by default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems as though many others have also queried this issue on StackExchange but I still haven't been able to find a satisfactory answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been trying to use display-buffer-alist and display-buffer-pop-up-frame but the documentation for this is very confusing and I couldn't find the right phrasing for my init.el file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using OS X El Capitan 10.11.3, and Emacs 24.5.1 with this version: &lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot; rel=&quot;nofollow&quot;&gt;https://github.com/railwaycat/emacs-mac-port&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11624" LastActivityDate="2016-04-03T22:42:11.490" Title="Always open files in new frame (osx)" Tags="|frames|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21410" PostTypeId="2" ParentId="21408" CreationDate="2016-04-04T00:25:13.593" Score="8" Body="&lt;p&gt;As far as I can tell, there is no &lt;code&gt;\d&lt;/code&gt; in &lt;a href=&quot;https://www.emacswiki.org/emacs/RegularExpression&quot;&gt;Emacs regular&#xA;expressions&lt;/a&gt;.&#xA;So, @Tobias's comment is (mostly) correct, except that you need to&#xA;escape the curly brackets.  Either of the following will work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`C-M-s` =&amp;gt; [0-9]\{4\}&#xA;`C-M-s` =&amp;gt; [[:digit:]]\{4\}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-04-04T00:25:13.593" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21412" PostTypeId="1" CreationDate="2016-04-04T00:45:39.767" Score="2" ViewCount="1012" Body="&lt;p&gt;I open a terminal and type &lt;code&gt;fg&lt;/code&gt; like it says but it says no current process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried %emacs and got the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on trusty tahr 14.04, anyone else got this?&#xA;*edit: I was following the built-in tutorial.&lt;/p&gt;&#xA;" OwnerDisplayName="user11626" LastEditorDisplayName="user11626" LastEditDate="2018-12-05T02:28:57.617" LastActivityDate="2018-12-05T02:28:57.617" Title="Why won't &quot;fg&quot; reopen emacs after C-z?" Tags="|ubuntu|" AnswerCount="1" CommentCount="5" ClosedDate="2016-04-04T20:12:01.573" ContentLicense="CC BY-SA 4.0" />
  <row Id="21413" PostTypeId="1" AcceptedAnswerId="21450" CreationDate="2016-04-04T07:51:22.047" Score="5" ViewCount="1071" Body="&lt;p&gt;I have a few tasks in my agenda that I'd like to complete every day, e.g. &lt;code&gt;SCHEDULED: &amp;lt;2016-04-04 Mon 16:30 +1d&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously I like to see them in the daily agenda, and that works fine. Here's what I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      `(&#xA;        ;; ...&#xA;        (&quot;d&quot; &quot;Daily Action List&quot;&#xA;             ((agenda &quot;&quot;&#xA;                      ((org-agenda-ndays 1)&#xA;                       (org-agenda-sorting-strategy&#xA;                        (quote ((agenda time-up priority-down tag-up))))&#xA;                       (org-deadline-warning-days 0)))))))&#xA;&#xA;(defun orfu-agenda-day ()&#xA;  (interactive)&#xA;  (org-agenda nil &quot;d&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I switch to the weekly view (with &lt;kbd&gt;w&lt;/kbd&gt;), the daily tasks obscure the whole thing, since each of them is now repeated 7 times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I hide all tasks that have &lt;code&gt;+1d&lt;/code&gt; in them from the weekly view? If it helps, I could tag the headings they are in with e.g. &lt;code&gt;:daily:&lt;/code&gt; and then the problem would simplify to hiding a single tag from the weekly agenda.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-04-05T22:41:42.727" Title="How to show the daily tasks in day's agenda but not in week's agenda?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21414" PostTypeId="2" ParentId="20716" CreationDate="2016-04-04T09:19:08.510" Score="4" Body="&lt;p&gt;I ended up using &lt;code&gt;hippie-expand&lt;/code&gt; which is built-in to Emacs (24+?).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;emmet-mode&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package emmet-mode&#xA;  :defer t&#xA;  :init&#xA;  (add-hook 'css-mode-hook 'emmet-mode)&#xA;  (add-hook 'sgml-mode-hook 'emmet-mode)&#xA;  :config&#xA;  (setq-default emmet-move-cursor-between-quote t)&#xA;  (unbind-key &quot;&amp;lt;C-return&amp;gt;&quot; emmet-mode-keymap)&#xA;  (unbind-key &quot;C-M-&amp;lt;left&amp;gt;&quot; emmet-mode-keymap)&#xA;  (unbind-key &quot;C-M-&amp;lt;right&amp;gt;&quot; emmet-mode-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;hippie-expand&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package hippie-exp&#xA;  :ensure nil&#xA;  :defer t&#xA;  :bind (&quot;&amp;lt;C-return&amp;gt;&quot; . hippie-expand)&#xA;  :config&#xA;  (setq-default hippie-expand-try-functions-list&#xA;                '(yas-hippie-try-expand emmet-expand-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;yasnippet&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package yasnippet&#xA;  :defer t&#xA;  :init&#xA;  (add-hook 'js-mode-hook 'yas-minor-mode)&#xA;  (add-hook 'sgml-mode-hook 'yas-minor-mode)&#xA;  :config&#xA;  (setq-default yas-snippet-dirs '(&quot;~/.emacs.d/snippets&quot;))&#xA;  (yas-reload-all)&#xA;  (unbind-key &quot;TAB&quot; yas-minor-mode-map)&#xA;  (unbind-key &quot;&amp;lt;tab&amp;gt;&quot; yas-minor-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-04-04T09:19:08.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21416" PostTypeId="1" CreationDate="2016-04-04T12:57:36.797" Score="8" ViewCount="1682" Body="&lt;p&gt;I normally have my main Emacs frame split vertically into two side-by-side windows (as one gets with &lt;code&gt;split-window-right&lt;/code&gt;, better known as &lt;code&gt;C-x 3&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For as long as I can remember, whenever the need arose for a temporary &lt;code&gt;*Completions*&lt;/code&gt; buffer, the inactive one of the two side-by-side windows would be used to hold this buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know what changed but now this is no longer what happens.  Instead, a &lt;em&gt;third&lt;/em&gt; window appears holding the &lt;code&gt;*Completions*&lt;/code&gt; buffer, and running horizontally the full width of the Emacs frame.  (So I now see the two original side-by-side windows on top, and one wide window for the transient &lt;code&gt;*Completions*&lt;/code&gt; buffer along the bottom.  IOW, the frame window &lt;em&gt;topology&lt;/em&gt; looks similar to what it would look like if one ran the sequence &lt;code&gt;C-x 1&lt;/code&gt; &lt;code&gt;C-x 2&lt;/code&gt; &lt;code&gt;C-x 3&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't like this at all.  I have a fairly wide monitor, which makes it uncomfortable to read completion options that are spread out along its full width.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to customize this behavior?&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2016-04-04T13:05:38.290" LastActivityDate="2016-04-09T17:26:39.210" Title="How to force completions buffer to appear in a side window?" Tags="|completion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21417" PostTypeId="1" AcceptedAnswerId="21419" CreationDate="2016-04-04T14:14:14.457" Score="3" ViewCount="1168" Body="&lt;p&gt;Is it possible to embed an html file within an html exported from org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't mean to &quot;quote&quot; the source of the file (which is possible with &lt;code&gt;#+INCLUDE: &quot;someFile.html&quot; src html&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My use case is: I have a standalone html containing a simple D3 visualization. I'd love to link somehow to this html within org-mode so that once I export the org file, the visualization would dispay in the output html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current workarounds: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;simple linking to the standalone html &lt;code&gt;[[file:...]]&lt;/code&gt; so the visualization opens when user clicks on it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Alternative is is to manually copy the code into the output html from org-mode - but this is highly impractical.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="5237" LastEditorUserId="5237" LastEditDate="2016-04-04T14:56:37.737" LastActivityDate="2019-03-04T22:03:51.827" Title="Embbed html/javascript in org-mode html export" Tags="|org-mode|html|javascript|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21418" PostTypeId="1" AcceptedAnswerId="21420" CreationDate="2016-04-04T14:27:11.627" Score="22" ViewCount="2633" Body="&lt;p&gt;How do I undo the effects of &lt;code&gt;edebug-defun&lt;/code&gt;?  In other words, how do I rescind the directive that causes &lt;code&gt;edebug&lt;/code&gt; to enter debugging mode when a particular function is invoked?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I'd really like to know where the answer to this question is in the documenation.  I've looked for it far longer than one would think would be necessary...&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2023-06-08T16:51:01.720" Title="How to cancel `edebug-defun`?" Tags="|debugging|edebug|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21419" PostTypeId="2" ParentId="21417" CreationDate="2016-04-04T14:30:20.540" Score="4" Body="&lt;p&gt;&lt;code&gt;#+INCLUDE: &quot;someFile.html&quot; html&lt;/code&gt; should result in an included rendered version of the html file and not just &quot;quote the source file&quot;.&lt;/p&gt;&#xA;" OwnerUserId="11510" LastEditorUserId="11510" LastEditDate="2016-04-04T15:23:25.353" LastActivityDate="2016-04-04T15:23:25.353" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21420" PostTypeId="2" ParentId="21418" CreationDate="2016-04-04T14:49:03.477" Score="21" Body="&lt;p&gt;From &lt;code&gt;(info &quot;(elisp) Instrumenting&quot;)&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   To remove instrumentation from a definition, simply re-evaluate its&#xA;definition in a way that does not instrument.  There are two ways of&#xA;evaluating forms that never instrument them: from a file with `load',&#xA;and from the minibuffer with `eval-expression' (`M-:').&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;IOW, the easy way is to use &lt;code&gt;C-M-x&lt;/code&gt; without prefix argument (or with a prefix argument, if you have &lt;code&gt;edebug-all-defs&lt;/code&gt; set).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-04-04T14:49:03.477" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21422" PostTypeId="1" AcceptedAnswerId="21432" CreationDate="2016-04-04T16:54:47.407" Score="5" ViewCount="496" Body="&lt;p&gt;If I run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq some-variable (shell-command-to-string some-command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and the execution of the command in &lt;code&gt;some-command&lt;/code&gt; results in some output sent to &lt;code&gt;stderr&lt;/code&gt;, this &lt;code&gt;stderr&lt;/code&gt; output ends up in &lt;code&gt;some-variable&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I discard the &lt;code&gt;stderr&lt;/code&gt; output, so that the result consists exclusively of the output sent to &lt;code&gt;stdout&lt;/code&gt;?  (Better yet would be to capture the &lt;code&gt;stdout&lt;/code&gt; and &lt;code&gt;stderr&lt;/code&gt; outputs in separate variables.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it is not enough to add something like &lt;code&gt;2&amp;gt;/dev/null&lt;/code&gt; to the command in &lt;code&gt;some-command&lt;/code&gt;, because the &lt;code&gt;stderr&lt;/code&gt; output may come from a shell initialization file (e.g. &lt;code&gt;.bashrc&lt;/code&gt;), and thus would not be captured by the &lt;code&gt;2&amp;gt;/dev/null&lt;/code&gt; redirection.&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2016-04-05T13:51:20.467" Title="How to discard stderr when running a shell function?" Tags="|shell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21423" PostTypeId="2" ParentId="21418" CreationDate="2016-04-04T17:18:56.190" Score="10" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In other words, how do I rescind the directive that causes edebug to enter debugging mode when a particular function is invoked?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can get this effect without removing instrumentation by setting &lt;code&gt;edebug-initial-mode&lt;/code&gt; to &lt;code&gt;go&lt;/code&gt;.  This way, you will only get stopped in edebug if there is a breakpoint set.  As of Emacs 25.1, you can do this quickly with &lt;code&gt;edebug-set-initial-mode&lt;/code&gt;: &lt;kbd&gt;&lt;kbd&gt;C-x C-a C-m&lt;/kbd&gt; g&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Edebug-Execution-Modes.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(info &quot;(elisp) Edebug Execution Modes&quot;)&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;‘g’&#xA;     Go: run until the next breakpoint (‘edebug-go-mode’).  *Note&#xA;     Breakpoints::.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;When you enter a new Edebug level, the initial execution mode comes&#xA;from the value of the variable ‘edebug-initial-mode’ (*note Edebug&#xA;Options::).  By default, this specifies step mode.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Command: edebug-set-initial-mode&#xA;&#xA;This command, bound to C-x C-a C-m, sets edebug-initial-mode. It&#xA;prompts you for a key to indicate the mode. You should enter one of&#xA;the eight keys listed above, which sets the corresponding mode.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2017-05-31T13:59:02.560" LastActivityDate="2017-05-31T13:59:02.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21424" PostTypeId="2" ParentId="20970" CreationDate="2016-04-04T18:37:32.877" Score="1" Body="&lt;p&gt;I worked around it by disabling touchpad scrolling in the operating system settings (disabling it just within emacs didn't help). But this isn't ideal.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-04-04T18:37:32.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21425" PostTypeId="2" ParentId="20970" CreationDate="2016-04-04T18:49:28.147" Score="1" Body="&lt;p&gt;It turns out that customising &lt;code&gt;search-exit-option&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; will make isearch much more resilient to random inputs from the mouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behaviour of isearch is now a bit odd - I can happily navigate around in emacs with the cursor keys and still be in isearch - but it does what I wanted!&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-04-04T18:49:28.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21426" PostTypeId="1" CreationDate="2016-04-04T18:56:10.350" Score="2" ViewCount="127" Body="&lt;p&gt;A minimal example can be found in &lt;a href=&quot;http://orgmode.org/manual/A-Beamer-Example.html#A-Beamer-Example&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain the following line funtion?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) %8BEAMER_OPT(Opt)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/worg/exporters/beamer/presentation.org.html&quot; rel=&quot;nofollow&quot;&gt;worg&lt;/a&gt; says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;for a column view of options and configurations for the individual frames&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But a sentence can't make me understand.&#xA;To do a test, I change the number in it but finding the output frame doesn't change.&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="5213" LastEditDate="2016-04-30T14:30:17.147" LastActivityDate="2016-04-30T14:30:17.147" Title="Export settings question from Beamer example written by org-mode" Tags="|org-mode|org-export|beamer|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21427" PostTypeId="2" ParentId="21412" CreationDate="2016-04-04T19:46:54.827" Score="3" Body="&lt;p&gt;The &lt;strong&gt;fg&lt;/strong&gt; job control command should work if you run from the &lt;strong&gt;same&lt;/strong&gt; terminal where you entered Control-z. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find out what processes are available to be placed in the fore ground use the &lt;strong&gt;jobs&lt;/strong&gt; command. If jobs does not list your Emacs process, you're in the wrong shell.&lt;/p&gt;&#xA;" OwnerUserId="9450" LastActivityDate="2016-04-04T19:46:54.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21428" PostTypeId="1" AcceptedAnswerId="21430" CreationDate="2016-04-04T19:51:27.603" Score="1" ViewCount="1069" Body="&lt;p&gt;I am trying to use following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rust-save-and-build (mode)&#xA;  (interactive)&#xA;  (save-buffer)&#xA;&#xA;  (setq tmp (shell-command-to-string (format &quot;cygpath.exe -m %s&quot;&#xA;                     (buffer-file-name)))&#xA;&#xA;(if (locate-dominating-file buffer-file-name &quot;Cargo.toml&quot;)&#xA;        (compile mode)&#xA;&#xA;  (compile&#xA;   (format &quot;rustc %s %s.exe&quot;&#xA;       tmp&#xA;       (file-name-sans-extension tmp))))))&#xA;&#xA;&#xA;&#xA;(defun rust-cmd-run ()&#xA;  (interactive)&#xA;  (rust-save-and-build &quot;cargo run&quot;))&#xA;&#xA;(defun rust-cmd-build ()&#xA;  (interactive)&#xA;  (rust-save-and-build &quot;cargo build&quot;))&#xA;&#xA;(defun rust-cmd-test ()&#xA;  (interactive)&#xA;  (rust-save-and-build &quot;cargo test&quot;))&#xA;&#xA;&#xA;&#xA;(add-hook 'rust-mode-hook&#xA;  (lambda ()&#xA;    (define-key rust-mode-map (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'rust-cmd-run)))&#xA;&#xA;(add-hook 'rust-mode-hook&#xA;  (lambda ()&#xA;    (define-key rust-mode-map (kbd &quot;&amp;lt;f6&amp;gt;&quot;) 'rust-cmd-build)))&#xA;&#xA;(add-hook 'rust-mode-hook&#xA;  (lambda ()&#xA;    (define-key rust-mode-map (kbd &quot;&amp;lt;f7&amp;gt;&quot;) 'rust-cmd-test)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but get &quot;Wrong type argument: symbolp&quot; error when use f-keys. The debug message is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Debugger entered--Lisp error: (wrong-type-argument symbolp (if (locate-dominating-file buffer-file-name &quot;Cargo.toml&quot;) (compile mode) (compile (format &quot;rustc %s %s.exe&quot; tmp (file-name-sans-extension tmp)))))&#xA; (setq tmp (shell-command-to-string (format &quot;cygpath.exe -m %s&quot; (buffer-file-name))) (if (locate-dominating-file buffer-file-name &quot;Cargo.toml&quot;) (compile mode) (compile (format &quot;rustc %s %s.exe&quot; tmp (file-name-sans-extension tmp)))))&#xA;  rust-save-and-build(&quot;cargo run&quot;)&#xA;  rust-cmd-run()&#xA;  call-interactively(rust-cmd-run nil nil)&#xA;  command-execute(rust-cmd-run)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB&lt;/strong&gt; that &lt;code&gt;rust-save-and-build&lt;/code&gt; function works perfectly without argument.&lt;/p&gt;&#xA;" OwnerUserId="10793" LastEditorUserId="105" LastEditDate="2016-04-04T21:10:20.617" LastActivityDate="2016-04-04T21:10:20.617" Title="&quot;Wrong type argument: symbolp&quot; on function usage" Tags="|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21429" PostTypeId="1" CreationDate="2016-04-04T20:37:41.600" Score="1" ViewCount="239" Body="&lt;p&gt;When I try to start &lt;code&gt;multi-term&lt;/code&gt;, I these two errors which prevent the buffer from taking input:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;error in process filter: face-attribute: Invalid face: unspecified&#xA;error in process filter: Invalid face: unspecified&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Spacemacs, if that helps.&lt;/p&gt;&#xA;" OwnerUserId="4038" LastActivityDate="2016-04-04T20:37:41.600" Title="Error when opening multi-term: error in process filter: Invalid face: unspecified" Tags="|multi-term|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21430" PostTypeId="2" ParentId="21428" CreationDate="2016-04-04T21:05:54.797" Score="2" Body="&lt;p&gt;Indent your code properly and you will see that you did not close your &lt;code&gt;setq&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun rust-save-and-build (mode)&#xA;  (interactive)&#xA;  (save-buffer)&#xA;&#xA;  (setq tmp (shell-command-to-string (format &quot;cygpath.exe -m %s&quot;&#xA;                                             (buffer-file-name)))&#xA;&#xA;        (if (locate-dominating-file buffer-file-name &quot;Cargo.toml&quot;)&#xA;            (compile mode)&#xA;&#xA;          (compile&#xA;           (format &quot;rustc %s %s.exe&quot;&#xA;                   tmp&#xA;                   (file-name-sans-extension tmp))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You probably wanted something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun rust-save-and-build (mode)&#xA;  (interactive)&#xA;  (save-buffer)&#xA;&#xA;  (setq tmp (shell-command-to-string (format &quot;cygpath.exe -m %s&quot;&#xA;                                             (buffer-file-name))))&#xA;&#xA;  (if (locate-dominating-file buffer-file-name &quot;Cargo.toml&quot;)&#xA;      (compile mode)&#xA;&#xA;    (compile&#xA;     (format &quot;rustc %s %s.exe&quot;&#xA;             tmp&#xA;             (file-name-sans-extension tmp)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remember that &lt;code&gt;show-paren-mode&lt;/code&gt; is your friend, as are &lt;code&gt;TAB&lt;/code&gt; and &lt;code&gt;C-M-q&lt;/code&gt;. Get to know the keys bound in Emacs-Lisp mode - use &lt;code&gt;C-h m&lt;/code&gt; and &lt;code&gt;C-h b&lt;/code&gt; in a buffer with that mode. Or if you are doing this in another mode (e.g. in buffer &lt;code&gt;*scratch*&lt;/code&gt;) then use them there, to the same effect.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-04T21:05:54.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21431" PostTypeId="2" ParentId="20849" CreationDate="2016-04-05T04:47:26.070" Score="1" Body="&lt;p&gt;The answer to the following &lt;a href=&quot;https://emacs.stackexchange.com/questions/726/truncate-beginning-of-right-aligned-column-in-org-table&quot;&gt;stackexchange question&lt;/a&gt; pretty much leads the way to how to fulfill your requirement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Copy the &lt;code&gt;org-table-align&lt;/code&gt; command (from org-table.el -&gt; &lt;code&gt;M-x find-library RET org-table&lt;/code&gt;) to one of your init files. Then delete the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-text-properties&#xA;  (if (&amp;gt;= (string-width (substring x (1- f2) f2)) 2) (1- f2)&#xA;    (- f2 2))&#xA;  f2&#xA;  (list 'display org-narrow-column-arrow)&#xA;  x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11510" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-04-05T04:47:26.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21432" PostTypeId="2" ParentId="21422" CreationDate="2016-04-05T07:29:32.750" Score="5" Body="&lt;p&gt;Use the following form instead of &lt;code&gt;(shell-command-to-string some-command)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-output-to-string&#xA;    (with-current-buffer&#xA;      standard-output&#xA;      (process-file shell-file-name nil '(t nil)  nil shell-command-switch some-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is essentially what &lt;code&gt;shell-command-to-string&lt;/code&gt; does with the only change that it does discard &lt;code&gt;stderr&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also substitute the &lt;code&gt;nil&lt;/code&gt; in &lt;code&gt;'(t nil)&lt;/code&gt; for some file name to re-direct stderr into that file.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-04-05T13:51:20.467" LastActivityDate="2016-04-05T13:51:20.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21433" PostTypeId="1" AcceptedAnswerId="21438" CreationDate="2016-04-05T08:00:14.067" Score="3" ViewCount="85" Body="&lt;p&gt;Is there a way to get abbrev expansion on a lower case abbrev but not on its upper case version?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.: I have &quot;r&quot; expanding to &quot;are&quot;. I'd like &quot;R&quot; to stay &quot;R&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't necessarily want to get rid of capitalization completely, so I'd still like &quot;Btw&quot; to expand to &quot;By the way&quot;, but if there is no other option I'd take it.&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2016-04-05T12:09:19.970" Title="Prevent abbrev expansion on capitalization" Tags="|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21434" PostTypeId="2" ParentId="608" CreationDate="2016-04-05T08:23:14.460" Score="2" Body="&lt;h1&gt;Some vim-style keybinding functions.&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Here are some functions I've got defined to allow vim-style binding in the global map and various evil-states, as well as two general functions that take either an arbitrary key-map or arbitrary binding function. I've put these functions in a &lt;a href=&quot;https://gist.github.com/troyp/6b4c9e1c8670200c04c16036805773d8&quot; rel=&quot;nofollow&quot;&gt;gist&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kbd+ (keyrep &amp;amp;optional need-vector)&#xA;  (if (vectorp keyrep) keyrep (edmacro-parse-keys keyrep need-vector)))&#xA;&#xA;(defun gmap (keyrep defstr)&#xA;  &quot;Vim-style global keybinding. Uses the `global-set-key' binding function.&quot;&#xA;  (global-set-key (kbd+ keyrep) (edmacro-parse-keys defstr t)))&#xA;&#xA;(defun fmap (keybind-fn keyrep defstr)&#xA;  &quot;Vim-style keybinding using the key binding function KEYBIND-FN.&quot;&#xA;  (call keybind-fn (kbd+ keyrep) (edmacro-parse-keys defstr t)))&#xA;&#xA;(defun xmap (keymap keyrep defstr)&#xA;  &quot;Vim-style keybinding in KEYMAP. Uses the `define-key' binding function.&quot;&#xA;  (define-key keymap (kbd+ keyrep) (edmacro-parse-keys defstr t)))&#xA;&#xA;(defun nmap (keyrep defstr) &quot;Vim-style keybinding for `evil-normal-state.' Uses the `define-key' binding function.&quot;&#xA;      (xmap evil-normal-state-map keyrep defstr))&#xA;(defun imap (keyrep defstr) &quot;Vim-style keybinding for `evil-insert-state'. Uses the `define-key' binding function.&quot;&#xA;      (xmap evil-insert-state-map keyrep defstr))&#xA;(defun vmap (keyrep defstr) &quot;Vim-style keybinding for `evil-visual-state'. Uses the `define-key' binding function.&quot;&#xA;      (xmap evil-visual-state-map keyrep defstr))&#xA;(defun mmap (keyrep defstr) &quot;Vim-style keybinding for `evil-motion-state'. Uses the `define-key' binding function.&quot;&#xA;      (xmap evil-motion-state-map keyrep defstr))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In general, it's better to only use these functions for keyboard-macro-style bindings (like the use-case in the question), and to use emacs-style keybinding for everything else.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;notes&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;bind-key&lt;/code&gt;&lt;/a&gt; macro from the &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; package is an excellent and versatile key-binding function. &lt;/li&gt;&#xA;&lt;li&gt;If you want to replace one command with another, you can use Emacs' &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Remapping-Commands.html#Remapping-Commands&quot; rel=&quot;nofollow&quot;&gt;remapping commands&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If you do use these for regular key-bindings, keep in mind that there are no &quot;noremap&quot; versions, so if the bindings in your definition change, so will your user-defined bindings.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Binding &lt;kbd&gt;C-]&lt;/kbd&gt; to &lt;kbd&gt;M-.&lt;/kbd&gt;.&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Note that in normal-state, you'll want to bind to &lt;kbd&gt;\&lt;/kbd&gt;&lt;kbd&gt;M-.&lt;/kbd&gt; to access the emacs binding, since normal-state binds &lt;kbd&gt;M-.&lt;/kbd&gt; to &lt;code&gt;'evil-repeat-pop-next&lt;/code&gt;. So a normal-state binding can be defined with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nmap &quot;C-]&quot; &quot;\\ M-.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or (rebinding any &lt;code&gt;evil-jump-to-tag&lt;/code&gt; key in normal-state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nmap [remap evil-jump-to-tag] &quot;\\ M-.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8578" LastActivityDate="2016-04-05T08:23:14.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21435" PostTypeId="1" CreationDate="2016-04-05T09:33:40.327" Score="2" ViewCount="68" Body="&lt;p&gt;The title says it quite straight, what I am looking for is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;while *this* is bold, `that` should appear in a custom format&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; This question is no duplicate of &lt;a href=&quot;https://emacs.stackexchange.com/questions/5889/how-to-highlight-text-permanently-in-org-mode&quot;&gt;that&lt;/a&gt; although the answer is hidden there &lt;a href=&quot;https://emacs.stackexchange.com/questions/5889/how-to-highlight-text-permanently-in-org-mode#comment8917_5892&quot;&gt;in a comment&lt;/a&gt;. As I think it is worth to be found, I repeat it here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2013-02/msg00405.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;impossible&lt;/a&gt; to use self-defined delimiter symbols.&lt;/p&gt;&#xA;" OwnerUserId="11642" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-04-17T17:25:29.550" Title="Can one define custom delimiters for inline formatting in org mode?" Tags="|org-mode|formatting|" AnswerCount="0" CommentCount="1" ClosedDate="2016-04-05T22:55:32.407" ContentLicense="CC BY-SA 3.0" />
  <row Id="21437" PostTypeId="1" AcceptedAnswerId="21439" CreationDate="2016-04-05T11:57:16.467" Score="2" ViewCount="201" Body="&lt;p&gt;I was wondering if are existing tools or package to write C++ (or other langage) code from lisp.&lt;/p&gt;&#xA;&lt;p&gt;For example, this afternoon I needed to create 4 basic classes:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;    class D{&#xA;    public:&#xA;        D(){&#xA;        }&#xA;    };&#xA;    &#xA;    class C{&#xA;    public:&#xA;        C(){&#xA;        }&#xA;    };&#xA;    &#xA;    class B{&#xA;    public:&#xA;        B(){&#xA;        }&#xA;    };&#xA;    &#xA;    class A{&#xA;    public:&#xA;        A(){&#xA;        }&#xA;    };&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Using lisp it would be fairly easy to create a function that takes as an argument the class name and generate the template code from one instance:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;    class $TAG{&#xA;    public:&#xA;        $TAG(){&#xA;        }&#xA;    };&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;where $TAG is going to be replaced by the class name.&lt;/p&gt;&#xA;&lt;p&gt;I am not really looking at the exact lisp code to produce this because I can code it myself but rather at a package about this philosophy and with extra stuff I haven't thought of.&lt;/p&gt;&#xA;" OwnerUserId="9675" LastEditorUserId="105" LastEditDate="2024-03-09T02:35:21.940" LastActivityDate="2024-03-09T02:35:21.940" Title="Writing C++ (or other) code using lisp" Tags="|c++|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21438" PostTypeId="2" ParentId="21433" CreationDate="2016-04-05T12:09:19.970" Score="5" Body="&lt;p&gt;Yes: just put a non-nil value for the &lt;code&gt;:case-fixed&lt;/code&gt; property.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev my-foo-abbrev-table &quot;r&quot; &quot;EmacsRocks&quot; nil&#xA;               :case-fixed t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;C-h v define-abbrev RET&lt;/code&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-04-05T12:09:19.970" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21439" PostTypeId="2" ParentId="21437" CreationDate="2016-04-05T12:33:01.790" Score="9" Body="&lt;p&gt;It sounds like a job for &lt;a href=&quot;https://capitaomorte.github.io/yasnippet/&quot;&gt;YASnippet&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The philosophy behind it is to shorten the amount of keystrokes to enter frequently used structures and to not repeat yourself while writing the boilerplate code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;YASnippet comes with a lot of useful snippets preloaded for many major modes. In case of C++ it means that you can type for example &lt;code&gt;cls&lt;/code&gt; and &lt;code&gt;Tab&lt;/code&gt; and it will expand to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Name&#xA;{&#xA;public:&#xA;  Name();&#xA;  virtual ~Name();&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The cursor will be positioned on &lt;code&gt;Name&lt;/code&gt; and as you type your name it will replace all occurrences of &lt;code&gt;Name&lt;/code&gt; to create a valid C++ class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To initialize YASnippet I use the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package yasnippet&#xA;  :ensure    yasnippet&#xA;  :init      (setq yas-verbosity 1)&#xA;  :config    (progn&#xA;               (yas-global-mode 1)&#xA;               (let* ((yas-elpa-snippets-folder (car (file-expand-wildcards&#xA;                                                      (concat user-emacs-directory &quot;elpa/yasnippet-*/snippets&quot;))))&#xA;                      (yas-folder-candidates  `(,yas-elpa-snippets-folder&#xA;                                                ,(concat user-emacs-directory &quot;snippets&quot;))))&#xA;&#xA;                 (cl-loop for p in yas-folder-candidates&#xA;                          unless (file-exists-p p)&#xA;                          do (cl-delete p yas-folder-candidates))&#xA;&#xA;                 (setq yas-snippet-dirs yas-folder-candidates))&#xA;               (yas-reload-all)&#xA;               (define-key yas-minor-mode-map (kbd &quot;C-c &amp;lt;tab&amp;gt;&quot;) 'yas/insert-snippet))&#xA;  :diminish  yas-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've adapted it from what I found on the internet, probably from &lt;a href=&quot;https://github.com/rimerosolutions/emacs-rimero-setup/blob/master/emacs.d/modules/ers-snippets.el&quot;&gt;emacs-rimero-setup&lt;/a&gt;. It uses the wonderful &lt;code&gt;use-package&lt;/code&gt; to install and initialize YASnippet.&lt;/p&gt;&#xA;" OwnerUserId="7119" LastEditorUserId="7119" LastEditDate="2016-04-05T19:23:19.900" LastActivityDate="2016-04-05T19:23:19.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21440" PostTypeId="1" AcceptedAnswerId="21448" CreationDate="2016-04-05T12:44:58.077" Score="2" ViewCount="228" Body="&lt;p&gt;Is there a way to get a shell source block to be invoked once for each line in&#xA;a table? Take for example the following input table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+tblname: instances-tbl&#xA;| Instance | Topic               |&#xA;|----------+---------------------|&#xA;| i-fi     | arn:aws:sns:...:fa  |&#xA;| i-fa     | arn:aws:sns:...:fum |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently I do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :var instances=instances-tbl :results output&#xA;  foo () {&#xA;      instance=$1&#xA;      topic=$2&#xA;&#xA;      echo aws cloudwatch put-metric-alarm [...] --dimensions &quot;'Name=InstanceId,Value=$instance'&quot; --alarm-actions $topic&#xA;  }&#xA;&#xA;  echo &quot;$instances&quot; | while read line; do&#xA;      foo $line&#xA;  done&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which produces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aws cloudwatch put-metric-alarm [...] --dimensions 'Name=InstanceId,Value=i-fi' --alarm-actions arn:aws:sns:...:fa&#xA;aws cloudwatch put-metric-alarm [...] --dimensions 'Name=InstanceId,Value=i-fa' --alarm-actions arn:aws:sns:...:fum&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it &lt;em&gt;sort of works&lt;/em&gt;, but it is full of code not really related to what I&#xA;want to do and it is fragile. (Spaces in the column values will break it.)&#xA;Ideally I would like the column names of the table bound to the values of each&#xA;row in turn, something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :vars-from=instances-tbl :results output&#xA;echo aws cloudwatch put-metric-alarm [...] --dimensions &quot;'Name=InstanceId,Value=$Instance'&quot; --alarm-actions $Topic&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is something like this possible today? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, can I do it with emacs-lisp / python rather than shell snippets? I'm even happy with do it more or less the way I now do, if I could at least cut down some of the boilerplate somehow... Suggestions welcome!&lt;/p&gt;&#xA;" OwnerUserId="10625" LastActivityDate="2016-04-05T21:27:42.127" Title="Org babel invoke shell snippet once for each line in input table" Tags="|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21441" PostTypeId="2" ParentId="18528" CreationDate="2016-04-05T13:30:28.107" Score="4" Body="&lt;p&gt;This isn't an solution on how to use async features, but one which will also satisfy your needs, i think.&lt;/p&gt;&#xA;&lt;p&gt;Basically, you can move the fetching part to an external application, and just read the mails with emacs. Therefore, emacs doesn't have to download them, which should conclude in a non-blocking gnus/emacs. After you've set up the email-retriever, you can just &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Mail-Source-Specifiers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;change&lt;/a&gt; the way &lt;code&gt;gnus&lt;/code&gt; gets its emails to a local path.&lt;/p&gt;&#xA;&lt;h1&gt;IMAP&lt;/h1&gt;&#xA;&lt;p&gt;If you want to use IMAP, I'd suggest to use &lt;a href=&quot;http://www.offlineimap.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;offlineimap&lt;/code&gt;&lt;/a&gt;. It's a small python script, which downloads your mail to a local folder. The &lt;a href=&quot;https://wiki.archlinux.org/index.php/OfflineIMAP&quot; rel=&quot;nofollow noreferrer&quot;&gt;ArchWiki&lt;/a&gt; has also a quite comprehensive documentation for configuring &lt;code&gt;offlineimap&lt;/code&gt;. An alternative would be &lt;a href=&quot;http://isync.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;isync&lt;/code&gt;&lt;/a&gt; (which has also an &lt;a href=&quot;https://wiki.archlinux.org/index.php/Isync#External_Links&quot; rel=&quot;nofollow noreferrer&quot;&gt;entry&lt;/a&gt; in the ArchWiki)&lt;/p&gt;&#xA;&lt;p&gt;Additionally, this &lt;a href=&quot;http://nakkaya.com/2010/04/10/using-offlineimap-with-gnus/&quot; rel=&quot;nofollow noreferrer&quot;&gt;guide&lt;/a&gt; provides an example configuration file for both &lt;code&gt;gnus&lt;/code&gt; and &lt;code&gt;offlineimap&lt;/code&gt;.  (I use Mutt, so this is not my &lt;code&gt;gnus&lt;/code&gt; config, and can't vouch directly for it.)&lt;/p&gt;&#xA;&lt;h1&gt;POP3&lt;/h1&gt;&#xA;&lt;p&gt;For POP3, I found &lt;a href=&quot;http://pyropus.ca/software/getmail/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;getmail&lt;/code&gt;&lt;/a&gt;, but i have no experience with that.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;Additinally&lt;/strong&gt; I'd like to point you to this &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Asynchronous-Fetching.html#Asynchronous-Fetching&quot; rel=&quot;nofollow noreferrer&quot;&gt;Gnus Manual entry&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-04-12T13:04:52.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21442" PostTypeId="2" ParentId="406" CreationDate="2016-04-05T14:14:16.083" Score="1" Body="&lt;p&gt;Put the following advices into your init-file and restart emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In auctex buffers with preview the preview-icon is replaced with the last preview-image so you can see the last generated preview while you edit the equation.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'preview)&#xA;&#xA;(defadvice preview-inactive-string (around preview-show-old nil activate)&#xA;  &quot;Show old preview when editing source code.&quot;&#xA;  (declare (special preview-icon)) ;; preview-icon is a local variable defined by preview-mode&#xA;  (when (overlay-get ov 'preview-state)&#xA;    (let ((preview-icon (or (car-safe (overlay-get ov 'preview-image)) preview-icon)))&#xA;      (overlay-put ov 'preview-old-image preview-icon)&#xA;      ad-do-it&#xA;      )))&#xA;&#xA;(defadvice preview-disabled-string (around preview-show-old nil activate)&#xA;  &quot;Show old preview when editing source code.&quot;&#xA;  (declare (special preview-icon))&#xA;  (when (overlay-get ov 'preview-state)&#xA;    (let ((preview-icon (or (overlay-get ov 'preview-old-image) preview-icon)))&#xA;      ad-do-it&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-04-05T14:14:16.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21445" PostTypeId="1" AcceptedAnswerId="21446" CreationDate="2016-04-05T16:37:49.810" Score="5" ViewCount="1074" Body="&lt;p&gt;I know &lt;a href=&quot;https://github.com/Fanael/relative-line-numbers&quot; rel=&quot;nofollow noreferrer&quot;&gt;this plugin&lt;/a&gt; for relative numbers, which works fine (with the option &lt;code&gt;(global-relative-line-numbers-mode)&lt;/code&gt;. I also know this elisp code, which gives me perfectly working absolute numbers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'find-file-hook (lambda () (linum-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, i don't know how i can have absolute line numbers on the current and relative line numbers on all other lines (both on the left margin like displayed in the picture below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/p5gTJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/p5gTJ.png&quot; alt=&quot;this picture of my vim&quot;&gt;&lt;/a&gt; This picute of my vim shows what i want. Therefore, i don't search for line numbers in the mode line.&lt;/p&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="5213" LastEditDate="2016-04-30T14:12:07.617" LastActivityDate="2016-04-30T14:12:07.617" Title="Absolute line numbers on the current and relative line numbers on all other lines?" Tags="|line-numbers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21446" PostTypeId="2" ParentId="21445" CreationDate="2016-04-05T17:12:06.113" Score="5" Body="&lt;p&gt;If you're using &lt;code&gt;relative-line-numbers-mode&lt;/code&gt;, you can customize the formatting to get what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun relative-abs-line-numbers-format (offset)&#xA;  &quot;The default formatting function.&#xA;Return the absolute value of OFFSET, converted to string.&quot;&#xA;  (if (= 0 offset)&#xA;      (number-to-string (line-number-at-pos))&#xA;    (number-to-string (abs offset))))&#xA;&#xA;(setq relative-line-numbers-format 'relative-abs-line-numbers-format)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This format will then apply to any buffers in &lt;code&gt;relative-line-number-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-04-05T17:18:30.990" LastActivityDate="2016-04-05T17:18:30.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21447" PostTypeId="1" CreationDate="2016-04-05T18:02:37.813" Score="4" ViewCount="129" Body="&lt;p&gt;I noticed that Emacs has &lt;em&gt;many&lt;/em&gt; font files open on my system. At least 95 .ttf and .otf files total. Why would it need to keep this many files open?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a full list: &lt;a href=&quot;https://gist.github.com/landaire/2a4346b97792f2987c4ac39bcd7295f6&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/landaire/2a4346b97792f2987c4ac39bcd7295f6&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some info about my setup:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;OS: darwin&lt;/li&gt;&#xA;&lt;li&gt;Emacs: 25.1.50.1 (from a recent &lt;code&gt;brew install emacs --HEAD --with-cocoa&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Spacemacs: 0.105.16&lt;/li&gt;&#xA;&lt;li&gt;Spacemacs branch: master (rev. cf8563b)&lt;/li&gt;&#xA;&lt;li&gt;Graphic display: t&lt;/li&gt;&#xA;&lt;li&gt;Distribution: spacemacs&lt;/li&gt;&#xA;&lt;li&gt;Editing style: vim&lt;/li&gt;&#xA;&lt;li&gt;Completion: helm&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Layers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auto-completion better-defaults emacs-lisp git org&#xA;                 (shell :variables shell-default-height 30 shell-default-position 'bottom)&#xA;                 syntax-checking version-control semantic c-c   d go rust swift yaml latex markdown gtags osx spacemacs-layouts themes-megapack&#xA;                 (colors :variables colors-enable-rainbow-identifiers nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11644" LastEditorUserId="25" LastEditDate="2016-04-30T14:39:41.040" LastActivityDate="2016-04-30T14:39:41.040" Title="Emacs has many font file handles" Tags="|osx|spacemacs|fonts|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21448" PostTypeId="2" ParentId="21440" CreationDate="2016-04-05T21:27:42.127" Score="6" Body="&lt;p&gt;I have come up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: put-metric-alarm&#xA;#+BEGIN_SRC sh :results silent :var instance=&quot;&quot; topic=&quot;&quot;&#xA; echo aws cloudwatch put-metric-alarm [...] \&#xA;      --dimensions &quot;Name=InstanceId,Value=$instance&quot; \&#xA;      --alarm-actions $topic &amp;gt; /dev/null &amp;amp;&amp;amp; echo ok || echo failed&#xA;#+END_SRC&#xA;&#xA;| Instance | Topic               | Status |&#xA;|----------+---------------------+--------|&#xA;| i-fi     | arn:aws:sns:...:fo  | ok     |&#xA;| i-fa     | arn:aws:sns:...:fum | ok     |&#xA;#+TBLFM: $3='(org-sbe put-metric-alarm (instance $$1) (topic $$2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main obstacle here was reading the documentation properly and realise that&#xA;I needed to use the extra &lt;code&gt;$&lt;/code&gt; in front of the reference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the &quot;bonus question&quot; part of my question&amp;#x2014;using the column names as&#xA;variable names&amp;#x2014;that's possible too! Org mode does actually allow you to use&#xA;named variables, by putting a &lt;code&gt;!&lt;/code&gt; in the first column of the row that contains&#xA;the names. So, we can do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ! | Instance | Topic               | Status |&#xA;|---+----------+---------------------+--------|&#xA;|   | i-fi     | arn:aws:sns:...:fo  | ok     |&#xA;|   | i-fa     | arn:aws:sns:...:fum | ok     |&#xA;#+TBLFM: $4='(org-sbe put-metric-alarm (instance $$Instance) (topic $$Topic))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although in this particular case I don't think that gives us anything, so  I didn't end up using it.&lt;/p&gt;&#xA;" OwnerUserId="10625" LastActivityDate="2016-04-05T21:27:42.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21449" PostTypeId="2" ParentId="21352" CreationDate="2016-04-05T22:27:57.780" Score="3" Body="&lt;p&gt;To my overwhelming exasperation, the problem has turned out to be: &lt;code&gt;emoji-cheat-sheet-plus-display-mode&lt;/code&gt;, and the order in which it was activated in org mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a hook like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun text-settings ()&#xA;  (emoji-cheat-sheet-plus-display-mode))&#xA;&#xA;(add-hook 'org-mode-hook 'text-settings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Somehow -- and I have &lt;em&gt;no idea&lt;/em&gt; how -- this was causing the horrible &lt;code&gt;args-out-of-range&lt;/code&gt; error above. Removing &lt;code&gt;emoji-cheat-sheet-plus-display-mode&lt;/code&gt; from org has fixed everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion: how do computers even work?&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-04-05T22:27:57.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21450" PostTypeId="2" ParentId="21413" CreationDate="2016-04-05T22:41:42.727" Score="5" Body="&lt;p&gt;Conveniently, &lt;code&gt;org-mode&lt;/code&gt; has a function to get just the repeat out of an entry's timestamp: &lt;code&gt;org-get-repeat&lt;/code&gt;.  We just have to put that in a function appropriate for &lt;code&gt;org-agenda-skip-function&lt;/code&gt;, that is, it should test if &lt;code&gt;(org-get-repeat)&lt;/code&gt; is equal to &quot;+1d&quot; for each headline.  IF it is, return the next headline, otherwise return &lt;code&gt;nil&lt;/code&gt; to not skip.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun skip-daily-tasks () &#xA;  (let ((next-headline (save-excursion (or (outline-next-heading) (point-max))))&#xA;        (headline (or (and (org-at-heading-p) (point))&#xA;                      (save-excursion (org-back-to-heading)))))&#xA;    (if (string= (org-get-repeat) &quot;+1d&quot;)&#xA;        next-headline&#xA;      nil)))&#xA;&#xA;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;w&quot; &quot;Weekly&quot;&#xA;               agenda &quot;&quot;&#xA;               ((org-agenda-span 'week)&#xA;                (org-agenda-skip-function 'skip-daily-tasks))&#xA;               ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-04-05T22:41:42.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21452" PostTypeId="2" ParentId="17919" CreationDate="2016-04-06T00:08:21.393" Score="1" Body="&lt;p&gt;First, please use stable version (24.3, 24.4, 24.5), many people reported v25 snapshot has weird bug. Don't use 25 until it's official released on &lt;a href=&quot;http://ftp.gnu.org/gnu/emacs/&quot; rel=&quot;nofollow&quot;&gt;http://ftp.gnu.org/gnu/emacs/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, make sure GnuTLS and OpenSSH are installed. They should be installed on ubuntu by default. but it never hurts to double check.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, read my &lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&lt;/a&gt;. It includes all the information to use Gmail in Gnus. At minimum, you need check my sample ~/.gnus.el and ~/.authinfo.gpg&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-04-06T01:58:24.653" LastActivityDate="2016-04-06T01:58:24.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21453" PostTypeId="1" CreationDate="2016-04-06T00:14:21.343" Score="8" ViewCount="3449" Body="&lt;p&gt;What are some resources for learning to write a major mode for a programming language such as Haskell? I know such things exist but I would like to learn how to do it, it seems like a fun and interesting project.&lt;/p&gt;&#xA;" OwnerUserId="11647" LastActivityDate="2016-04-06T01:21:57.010" Title="Writing a Major Mode" Tags="|major-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21454" PostTypeId="1" AcceptedAnswerId="21456" CreationDate="2016-04-06T01:05:33.333" Score="5" ViewCount="1265" Body="&lt;p&gt;I am trying to use &lt;code&gt;sudo emacs&lt;/code&gt; with no luck so far. When I run with &lt;code&gt;--debug-init&lt;/code&gt; I get the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;no such file or directory &quot;web-mode&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why would it be different when I am using &lt;code&gt;sudo emacs&lt;/code&gt;? Regular &lt;code&gt;emacs&lt;/code&gt; runs fine.&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2021-09-03T13:23:43.733" Title="&quot;sudo emacs&quot; Doesn't Work" Tags="|sudo|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21455" PostTypeId="2" ParentId="21453" CreationDate="2016-04-06T01:21:57.010" Score="9" Body="&lt;p&gt;There is a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Major-Mode-Conventions.html&quot; rel=&quot;noreferrer&quot;&gt;section of the Elisp manual&lt;/a&gt; specifically about this. I'd recommend that you start by reading that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, I'd recommend that you look at the code for some simple major modes that come with Emacs. Emulating such code is a good way to start out, and to learn.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd also recommend that you read the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Major-Modes.html&quot; rel=&quot;noreferrer&quot;&gt;parent section of that section&lt;/a&gt;, and other sibling sections (other subsections of the parent).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you will see this in that parent node (Major Modes):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The standard GNU Emacs Lisp directory tree contains the code for&#xA;  several major modes, in files such as &lt;code&gt;text-mode.el&lt;/code&gt;, &lt;code&gt;texinfo.el&lt;/code&gt;,&#xA;  &lt;code&gt;lisp-mode.el&lt;/code&gt;, and &lt;code&gt;rmail.el&lt;/code&gt;.  You can &lt;strong&gt;&lt;em&gt;study these libraries to see&#xA;  how modes are written&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-06T01:21:57.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21456" PostTypeId="2" ParentId="21454" CreationDate="2016-04-06T02:32:12.567" Score="11" Body="&lt;p&gt;&lt;code&gt;sudo emacs&lt;/code&gt; runs as the root user. One consequence is Emacs won't look for your .emacs in the home directory of your normal user, it will look in root's home directory instead. So none of your config will be loaded, and you don't have access to any packages installed by your normal user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in a comment, you should run Emacs as your normal user, and use tramp to open files as root. If you're trying something more arcane, we'll need more info to help you.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-06T02:32:12.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21457" PostTypeId="1" AcceptedAnswerId="21465" CreationDate="2016-04-06T04:11:41.183" Score="1" ViewCount="89" Body="&lt;p&gt;I've created a generic mode for emacs, but I have trouble matching the file names I want the generic mode to be on, right now I'm using &lt;code&gt;proguard-*&lt;/code&gt; but I would like to match only file names with &lt;code&gt;proguard-*.txt&lt;/code&gt; and &lt;code&gt;proguard-*.pro&lt;/code&gt;. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="9288" LastEditorUserId="9995" LastEditDate="2016-04-06T16:33:38.687" LastActivityDate="2016-04-06T16:33:38.687" Title="Files for which to activate generic mode" Tags="|regular-expressions|major-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21458" PostTypeId="2" ParentId="21416" CreationDate="2016-04-06T05:04:00.393" Score="2" Body="&lt;p&gt;I googled around and found this:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/4195666/display-compilation-in-inactive-buffer&quot;&gt;https://stackoverflow.com/questions/4195666/display-compilation-in-inactive-buffer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested the code and the behavior seems to be what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code for convenience:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun display-on-side (buffer &amp;amp;optional not-this-window frame)&#xA;  (let* ((window (or (minibuffer-selected-window)&#xA;                     (selected-window)))&#xA;         (display-buffer-function nil)&#xA;         (pop-up-windows nil))&#xA;    (with-selected-window (or window (error &quot;display-on-side&quot;))&#xA;      (when (one-window-p t)&#xA;        (split-window-horizontally))&#xA;      (display-buffer buffer not-this-window frame))))&#xA;&#xA;(setq display-buffer-function 'display-on-side)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11649" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-04-06T05:04:00.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21459" PostTypeId="1" AcceptedAnswerId="21472" CreationDate="2016-04-06T09:45:50.527" Score="9" ViewCount="1918" Body="&lt;p&gt;How one can programmatically read and set a buffer-wide org-mode property?&lt;/p&gt;&#xA;&lt;p&gt;I am aware of &lt;a href=&quot;https://emacs.stackexchange.com/questions/14572/how-do-i-programmatic-add-delete-and-update-org-mode-properties-from-entries&quot;&gt;this&lt;/a&gt;, which points to&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(org-entry-put POM &amp;quot;PWE-1&amp;quot; &amp;quot;47&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;but it does not seem useful in case of buffer global properties.&lt;/p&gt;&#xA;&lt;h3&gt;Details:&lt;/h3&gt;&#xA;&lt;p&gt;If a file has buffer global properties, like,&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: PWE-1 42&#xA;#+PROPERTY: Cite &amp;quot;Silmarillon 1984&amp;quot;&#xA;#+PROPERTY: my/common-list (1 &amp;quot;two&amp;quot; (1 2 3 5 7))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;How could one fetch, for example, the buffer-wide property PWE-1, or any other?&lt;/p&gt;&#xA;&lt;p&gt;How would one set it, ie, write a different value, say&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: PWE-1 2197&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;so that the buffer will &lt;em&gt;keep the updated value as stored in the file, available at next load&lt;/em&gt;?&lt;/p&gt;&#xA;&lt;p&gt;Where could I look up similar information in detail? Is there a detailed list of org-mode's API?&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="105" LastEditDate="2021-04-30T20:45:01.990" LastActivityDate="2021-04-30T21:05:22.277" Title="Programmatically read and set buffer-wide org-mode property" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="21460" PostTypeId="2" ParentId="21335" CreationDate="2016-04-06T12:05:36.163" Score="4" Body="&lt;p&gt;Another option can be found on the &lt;a href=&quot;http://orgmode.org/worg/org-hacks.html#orgheadline96&quot; rel=&quot;nofollow&quot;&gt;worg&lt;/a&gt; page. The basic &lt;a href=&quot;http://article.gmane.org/gmane.emacs.orgmode/75222&quot; rel=&quot;nofollow&quot;&gt;idea&lt;/a&gt; is to use &lt;code&gt;ediff-select-hook&lt;/code&gt; to unfold an element whenever given region is selected in ediff and folding them back in the &lt;code&gt;ediff-unselect-hook&lt;/code&gt;. I am posting the code here for completeness&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Check for org mode and existence of buffer&#xA;(defun f-ediff-org-showhide (buf command &amp;amp;rest cmdargs)&#xA;  &quot;If buffer exists and is orgmode then execute command&quot;&#xA;  (when buf&#xA;    (when (eq (buffer-local-value 'major-mode (get-buffer buf)) 'org-mode)&#xA;      (save-excursion (set-buffer buf) (apply command cmdargs)))))&#xA;&#xA;(defun f-ediff-org-unfold-tree-element ()&#xA;  &quot;Unfold tree at diff location&quot;&#xA;  (f-ediff-org-showhide ediff-buffer-A 'org-reveal)  &#xA;  (f-ediff-org-showhide ediff-buffer-B 'org-reveal)  &#xA;  (f-ediff-org-showhide ediff-buffer-C 'org-reveal))&#xA;&#xA;(defun f-ediff-org-fold-tree ()&#xA;  &quot;Fold tree back to top level&quot;&#xA;  (f-ediff-org-showhide ediff-buffer-A 'hide-sublevels 1)  &#xA;  (f-ediff-org-showhide ediff-buffer-B 'hide-sublevels 1)  &#xA;  (f-ediff-org-showhide ediff-buffer-C 'hide-sublevels 1))&#xA;&#xA;(add-hook 'ediff-select-hook 'f-ediff-org-unfold-tree-element)&#xA;(add-hook 'ediff-unselect-hook 'f-ediff-org-fold-tree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="247" LastActivityDate="2016-04-06T12:05:36.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21461" PostTypeId="2" ParentId="21457" CreationDate="2016-04-06T12:48:10.763" Score="1" Body="&lt;p&gt;I expect that something like this should do what you want?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;^proguard-.*\\.txt$&quot; . generic-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;^proguard-.*\\.pro$&quot; . generic-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace &lt;code&gt;generic-mode&lt;/code&gt; by the actual name of your mode, of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strings are regular expressions, or regexps for short. You may read about them in the elisp manual.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-04-06T12:48:10.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21462" PostTypeId="1" AcceptedAnswerId="21463" CreationDate="2016-04-06T13:20:45.057" Score="3" ViewCount="788" Body="&lt;p&gt;One of the options when installing emacs in OSX (through homebrew) is support for glib.  It's not included by default.  What does it buy me to install?  Any downsides?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10055" LastActivityDate="2016-04-06T13:50:41.237" Title="Do I need glib (OSX)?" Tags="|osx|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21463" PostTypeId="2" ParentId="21462" CreationDate="2016-04-06T13:50:41.237" Score="6" Body="&lt;p&gt;No, I don't think you need glib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;code&gt;brew cat emacs&lt;/code&gt;, the &lt;code&gt;--glib&lt;/code&gt; option actually means &lt;code&gt;--with-file-notification=gfile&lt;/code&gt;, and run &lt;code&gt;./configure --help&lt;/code&gt; inside Emacs source root directory tells:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--with-file-notification=LIB&#xA;                      use a file notification library (LIB one of: yes,&#xA;                      inotify, kqueue, gfile, w32, no)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my experience, &lt;code&gt;kqueue&lt;/code&gt; is used on OSX by default (as long as you don't set the option by yourself).&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-06T13:50:41.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21464" PostTypeId="1" CreationDate="2016-04-06T15:57:41.040" Score="10" ViewCount="1648" Body="&lt;p&gt;NB: The post &lt;a href=&quot;https://emacs.stackexchange.com/questions/12342/how-to-move-point-to-the-end-of-another-buffer-using-with-current-buffer-and&quot;&gt;How to move point to the end of another buffer, using `with-current-buffer` and `goto-char`?&lt;/a&gt; presumably asks the same question as this one, but the answers given to it do not readily apply to my case here.  E.g. those answers involve inserting text in the other buffer, etc.  The question I'm asking here is considerably simpler, and I expect the answer to it should be correspondingly simple as well.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Suppose that&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the Emacs frame is split into two windows, where one of the windows holds a buffer called &lt;code&gt;*whatever*&lt;/code&gt; and the other one holds the standard &lt;code&gt;*scratch*&lt;/code&gt; buffer;&lt;/li&gt;&#xA;&lt;li&gt;the &lt;code&gt;*whatever*&lt;/code&gt; buffer contains several lines of text;&lt;/li&gt;&#xA;&lt;li&gt;the cursor in the &lt;code&gt;*whatever*&lt;/code&gt; buffer is at the beginning of that buffer (i.e. at its &lt;code&gt;(point-min)&lt;/code&gt;);&lt;/li&gt;&#xA;&lt;li&gt;the &lt;code&gt;*scratch*&lt;/code&gt; buffer is the current one;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;If I now evaluate any of the following in the &lt;code&gt;*scratch*&lt;/code&gt; buffer, the position of the cursor in the &lt;code&gt;*whatever*&lt;/code&gt; buffer remains unchanged:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer &amp;quot;*whatever*&amp;quot;&#xA;  (goto-char (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer &amp;quot;*whatever*&amp;quot;&#xA;  (end-of-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion&#xA;  (set-buffer &amp;quot;*whatever*&amp;quot;)&#xA;  (goto-char (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion&#xA;  (set-buffer &amp;quot;*whatever*&amp;quot;)&#xA;  (end-of-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I figure that, whatever &lt;code&gt;(goto-char (point-max))&lt;/code&gt; or &lt;code&gt;(end-of-buffer)&lt;/code&gt; does to &lt;code&gt;*whatever*&lt;/code&gt;'s cursor's position gets subsequently discarded.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How must I modify any of the snippets above so that the &lt;code&gt;*whatever*&lt;/code&gt; buffer's &lt;em&gt;cursor&lt;/em&gt; gets positioned (persistently!) at the end of that buffer.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What should I have done to answer this question myself using the Emacs docs?  I tried everything I could think of.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;After reading &lt;a href=&quot;https://emacs.stackexchange.com/a/21466/882&quot;&gt;Jules Tamagnan's illuminating answer&lt;/a&gt; I realized that I need make a further stipulation explicit:&lt;/p&gt;&#xA;&lt;p&gt;I'm looking for a solution that will work &lt;em&gt;irrespective of whether the buffer in question is visible in a window or not.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;After all, if I view buffer &lt;em&gt;B&lt;/em&gt; in a window &lt;em&gt;W&lt;/em&gt;, move the cursor to a particular location &lt;em&gt;L&lt;/em&gt;, then view some other buffer &lt;em&gt;C&lt;/em&gt; in the same window &lt;em&gt;W&lt;/em&gt;, and finally point &lt;em&gt;W&lt;/em&gt; back to buffer &lt;em&gt;B&lt;/em&gt;, I expect to see the cursor at the same location &lt;em&gt;L&lt;/em&gt; where I left it.  IOW, there must be a way for a buffer to remember where its point is, irrespective of whether it is associated with a window or not.&lt;/p&gt;&#xA;&lt;p&gt;What about the case where the target buffer is currently visible in &lt;em&gt;two or more&lt;/em&gt; windows (&lt;em&gt;W1&lt;/em&gt;, &lt;em&gt;W2&lt;/em&gt;, &lt;em&gt;W3&lt;/em&gt;, ...)?  There are many reasonable possibilities for this case.  The proposed solution could, for example, change the position of the cursor&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in the most recently active window among &lt;em&gt;W1&lt;/em&gt;, &lt;em&gt;W2&lt;/em&gt;, &lt;em&gt;W3&lt;/em&gt;, ...;&lt;/li&gt;&#xA;&lt;li&gt;in &lt;em&gt;all&lt;/em&gt; the windows &lt;em&gt;W1&lt;/em&gt;, &lt;em&gt;W2&lt;/em&gt;, &lt;em&gt;W3&lt;/em&gt;, ...; &lt;em&gt;or&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;etc., etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;(I don't have a strong opinion on this corner case, since I expect it to be extremely rare in practice.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="15606" LastEditDate="2024-03-26T14:18:16.840" LastActivityDate="2024-03-26T14:18:16.840" Title="How to persistently move the cursor in a buffer other than the current one?" Tags="|buffers|cursor|motion|window-point|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="21465" PostTypeId="2" ParentId="21457" CreationDate="2016-04-06T16:31:30.313" Score="1" Body="&lt;p&gt;The rules for selecting a major mode are a bit complex, the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; says this about choosing based on the file name :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fourth—if Emacs still hasn’t found a suitable major mode—it looks at&#xA;  the file’s name.  The correspondence between file names and major modes&#xA;  is controlled by the variable ‘auto-mode-alist’.  Its value is a list in&#xA;  which each element has this form,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(REGEXP . MODE-FUNCTION)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;or this form,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(REGEXP MODE-FUNCTION FLAG)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What it doesn't say explicitely (nor the docstring for &lt;code&gt;auto-mode-alist&lt;/code&gt;) is that what is matched against the regexp is the &lt;strong&gt;full pathname&lt;/strong&gt; of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The syntax of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html#Regexps&quot; rel=&quot;nofollow&quot;&gt;regexps&lt;/a&gt; is also decribed in the manual.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-04-06T16:31:30.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21466" PostTypeId="2" ParentId="21464" CreationDate="2016-04-06T16:45:11.503" Score="11" Body="&lt;p&gt;This was a pretty cool question, I learned a lot that I didn't know while trying to figure this out. What I learned was that each window has its own value for &lt;code&gt;point&lt;/code&gt;. This is important because it means that the point is not associated with the buffer but instead the actual window. As we've seen this makes a big difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we need to do then is set the the value of the point in the window, the function for that is &lt;code&gt;set-window-point&lt;/code&gt; (I found this though google, I find that if I don't know where to start looking in the build in emacs-docs looking on google may shed some light). We then need to tell &lt;code&gt;set-window-point&lt;/code&gt; which window to select. To do that I used &lt;code&gt;get-buffer-window&lt;/code&gt; (once again I used google to find this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code will only work if the buffer is open in a window. Another version should be able to be made where you open the buffer in a window, set the point and then go back to the original window configuration. The code below though is much simpler.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-window-point (get-buffer-window &quot;*whatever*&quot;) (point-max))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this helps, if you have any other questions or if it doesn't work exactly how you want, just let me know.&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-04-06T16:45:11.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21467" PostTypeId="1" AcceptedAnswerId="45817" CreationDate="2016-04-06T18:07:00.557" Score="3" ViewCount="526" Body="&lt;p&gt;I have a file which is encoded in utf-8. But for some reason, each time I open it in Emacs, I get no-conversion (nil) encoding, and all the non-ascii characters can't display correctly. If I run &lt;code&gt;revert-buffer-with-coding-system&lt;/code&gt; and choose utf-8 then they are rendered correctly, but even if I edit and save the file this time, the next time I open it, the same problem occurs. I'm not sure what went wrong and what I should do to fix it.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2018-11-22T01:03:41.727" Title="Getting no-conversion (nil) encoding each time when opening a file (which should be in utf-8)" Tags="|character-encoding|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21468" PostTypeId="1" AcceptedAnswerId="21489" CreationDate="2016-04-06T18:29:21.337" Score="2" ViewCount="106" Body="&lt;p&gt;When filtering the results of &lt;code&gt;helm-buffers-list&lt;/code&gt; or &lt;code&gt;helm-for-files&lt;/code&gt;, as soon as I type a forward slash, Helm seems to switch from filtering results as expected to showing &lt;em&gt;all&lt;/em&gt; buffers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://dump.thecybershadow.net/d752c50030e999e2440939a67088eba1/recorded.gif&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to highlight some letters in the buffers list, but I don't see any logic or pattern behind this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why this happens. Is it a bug? Is it some special syntax I'm not aware of? Fuzzy matching is off as far as I can tell.&lt;/p&gt;&#xA;" OwnerUserId="6695" LastEditorUserId="6695" LastEditDate="2019-01-12T23:04:48.140" LastActivityDate="2019-01-12T23:04:48.140" Title="Odd behavior of forward slashes in helm-buffers-list patterns" Tags="|helm|helm-for-files|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="21469" PostTypeId="2" ParentId="18528" CreationDate="2016-04-06T19:07:00.960" Score="1" Body="&lt;p&gt;One work around is to have the demon only do stuff when Emacs is idle; I use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Demon to fetch email every 5 minutes when Emacs has been idle for 5 minutes:&#xA;(gnus-demon-add-handler 'gnus-demon-scan-news 5 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will, of course, have to go &lt;code&gt;g&lt;/code&gt; compulsively in Gnus yourself when Emacs is not idle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other thing I do, is that I have one Emacs for Gnus, and another for everything else, i.e. normal editing. (Well, actually, I have a separate Emacs for jabber.el as well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is one of the few operating systems in use without &quot;real&quot; multitasking.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-04-06T19:07:00.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21470" PostTypeId="1" CreationDate="2016-04-06T19:17:01.767" Score="4" ViewCount="455" Body="&lt;p&gt;What would cause emacs to &quot;mostly&quot; freeze when creating an org agenda?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I say &quot;mostly&quot; because when you type &lt;code&gt;C-g&lt;/code&gt;, it does show &quot;Quit&quot; in the minibuffer, and the time logging number in the minibuffer still increments. Nothing else seems to respond though that I could think of. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was only able to get emacs to respond by getting the emacs pid with &lt;code&gt;ps aux | grep emacs&lt;/code&gt; and then running &lt;code&gt;kill -SIGUSR2 {PID}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, emacs opened a buffer with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (quit)&#xA;  redisplay_internal\ \(C\ function\)()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What can I do to prevent this behavior?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastEditorUserId="105" LastEditDate="2016-04-07T01:28:28.560" LastActivityDate="2024-03-28T19:06:35.963" Title="Why is emacs freezing and how can I prevent it? (likely involving org agenda)" Tags="|org-mode|org-agenda|debugging|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21471" PostTypeId="1" CreationDate="2016-04-06T19:31:23.787" Score="4" ViewCount="761" Body="&lt;p&gt;Earlier today I added gwene as a backend for gnus.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'gnus-secondary-select-methods '(nntp &quot;news.gwene.org&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then added a few feeds that I wanted to read and keep up to date on. One of which was &lt;code&gt;gmane.emacs.devel.&lt;/code&gt; This group has over 200,000 articles/messages and every time I want to read an article it seems to download all 200,000. This takes an incredible amount of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read about how gnus can cache articles and that seems very promising. The manual though said that it was bad practice, but I went ahead and tried the code that they suggested &lt;code&gt;(setq gnus-use-cache t)&lt;/code&gt;. This had no effect though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short my question is: how can I save an offline copy of a mailing list for fast access and offline use, using gwene or something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="11272" LastEditDate="2016-04-06T20:32:52.763" LastActivityDate="2016-04-07T00:44:24.387" Title="How to save offline copy articles in gnus; Speed up large groups" Tags="|gnus|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21472" PostTypeId="2" ParentId="21459" CreationDate="2016-04-06T19:46:06.167" Score="10" Body="&lt;p&gt;You could just do a text search for &lt;code&gt;#+PROPERTY: ...&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use the following functions.&#xA;These functions take into account that values can be accumulated via &lt;code&gt;+&lt;/code&gt; and it is an error if the first &lt;code&gt;PROPERTY&lt;/code&gt; key has a &lt;code&gt;+&lt;/code&gt;. (Is that true?)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun org-global-props-key-re (key)&#xA;  &quot;Construct a regular expression matching key and an optional plus and eating the spaces behind.&#xA;Test for existence of the plus: (match-beginning 1)&quot;&#xA;  (concat &quot;^&quot; (regexp-quote key) &quot;\\(\\+\\)?[[:space:]]+&quot;))&#xA;&#xA;(defun org-global-props (&amp;amp;optional buffer)&#xA;  &quot;Get the plists of global org properties of current buffer.&quot;&#xA;  (with-current-buffer (or buffer (current-buffer))&#xA;    (org-element-map (org-element-parse-buffer) 'keyword (lambda (el) (when (string-equal (org-element-property :key el) &quot;PROPERTY&quot;) (nth 1 el))))))&#xA;&#xA;(defun org-global-prop-value (key)&#xA;  &quot;Get global org property KEY of current buffer.&#xA;Adding up values for one key is supported.&quot;&#xA;  (let ((key-re (org-global-props-key-re key))&#xA;    (props (org-global-props))&#xA;    ret)&#xA;    (cl-loop with val for prop in props&#xA;         when (string-match key-re (setq val (plist-get prop :value))) do&#xA;         (setq&#xA;          val (substring val (match-end 0))&#xA;          ret (if (match-beginning 1)&#xA;              (concat ret &quot; &quot; val)&#xA;            val)))&#xA;    ret))&#xA;&#xA;(defun org-global-prop-set (key value)&#xA;  &quot;Set the value of the first occurence of&#xA;#+PROPERTY: KEY&#xA;add it at the beginning of file if there is none.&quot;&#xA;  (save-excursion&#xA;    (let* ((key-re (org-global-props-key-re key))&#xA;       (prop (cl-find-if (lambda (prop)&#xA;                   (string-match key-re (plist-get prop :value)))&#xA;                 (org-global-props))))&#xA;      (if prop&#xA;      (progn&#xA;        (assert (null (match-beginning 1)) &quot;First occurence of key %s is followed by +.&quot; key)&#xA;        (goto-char (plist-get prop :begin))&#xA;        (kill-region (point) (plist-get prop :end)))&#xA;    (goto-char 1))&#xA;      (insert &quot;#+PROPERTY: &quot; key &quot; &quot; value &quot;\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-04-06T19:46:06.167" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21473" PostTypeId="1" CreationDate="2016-04-06T19:55:02.537" Score="12" ViewCount="7910" Body="&lt;p&gt;I just moved to spacemacs from vim and am a complete newbie with emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot figure out how to expand yasnippets while in evil-insert-mode. I know yasnippet is available because I can choose from the available snippets using &lt;code&gt;Spc i s&lt;/code&gt;. However I'd like to be able to &lt;code&gt;&amp;lt;Tab&amp;gt;&lt;/code&gt; expand them.  What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="11654" LastActivityDate="2018-04-10T13:54:13.583" Title="Expanding Snippets in evil-insert-mode" Tags="|spacemacs|yasnippet|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21474" PostTypeId="2" ParentId="21471" CreationDate="2016-04-06T20:07:00.853" Score="2" Body="&lt;p&gt;Do you use Spacemacs? It has a quite bad setting for Gnus in connection with big newsgroups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/19143/possible-to-cache-newsgroup-message-headers-in-gnus&quot;&gt;Possible to cache newsgroup message headers in Gnus&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure not to set &lt;code&gt;gnus-fetch-old-headers&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, as per the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;This feature can seriously impact performance it ignores all locally cached header entries. Setting it to t for groups for a server that doesn't expire articles (such as news.gmane.org), leads to very slow summary generation.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The same goes for &lt;code&gt;news.gwene.org&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-04-06T20:14:52.793" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21475" PostTypeId="1" AcceptedAnswerId="21526" CreationDate="2016-04-06T20:14:38.423" Score="2" ViewCount="666" Body="&lt;p&gt;The feature is more or less as the same as the navigation bar in most modern browsers: if it is a URL, load it; if not, use the default search engine to search the web for it. How can I achieve that in Emacs, such as modifying the default behavior of &lt;code&gt;browse-url&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2022-05-06T01:02:43.837" Title="browse-url: How to search the web for the keyword if the word under cursor (or selected) is not an URL?" Tags="|web|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21476" PostTypeId="1" AcceptedAnswerId="21477" CreationDate="2016-04-06T20:26:19.860" Score="1" ViewCount="179" Body="&lt;p&gt;I have a minor mode that declare a customizable variable as its keymap prefix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom mymode-keymap-prefix &quot;C-c *&quot;&#xA;  &quot;Prefix for `mymode-mode'.&quot;&#xA;  :group 'mymode)&#xA;&#xA;(defvar mymode-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map (kbd mymode-keymap-prefix) some-mymode-command-map)&#xA;    map))&#xA;&#xA;(define-minor-mode mymode-mode&#xA;  &quot;Mymode.&quot;&#xA;  nil&#xA;  &quot; mymode&quot;&#xA;  mymode-mode-map&#xA;  :group 'mymode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;init.el&lt;/code&gt; somewhere I have &lt;code&gt;(require 'mymode-mode)&lt;/code&gt;. I want to make this keymap prefix customizable for user.&lt;br&gt;&#xA;This customization must be done before mode is loaded, after that it's too late, mode keymap is already made.&lt;br&gt;&#xA;I've tried to open customization buffer with &lt;code&gt;customize-variable mymode-keymap-prefix&lt;/code&gt; and change it but it doesn't work in my case.&#xA;When I query the variable after all is loaded it really have value I've put in it but my mode keymap still starts with old prefix as if nothing had happened.&#xA;Only approach that work for me is to put &lt;code&gt;(setq mymode-keymap-prefix &amp;lt;new_value&amp;gt;)&lt;/code&gt; before &lt;code&gt;(require 'mymode-mode)&lt;/code&gt; in &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-04-06T23:55:16.503" Title="When Emacs loads variable customization?" Tags="|customize|minor-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21477" PostTypeId="2" ParentId="21476" CreationDate="2016-04-06T20:46:38.473" Score="2" Body="&lt;p&gt;Customizations can be loaded at different times, depending on what your users have in their init file. By default, the customizations are appended to the end of the init file (&lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;.emacs.d/init.el&lt;/code&gt;). If this is the case, you'll need to add your require after the customization code in this file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Customizations may also be stored in a separate file, set in the variable &lt;code&gt;custom-file&lt;/code&gt;. If this is the case, they will be loaded explicitly with the command &lt;code&gt;(load custom-file)&lt;/code&gt;. In this case, your &lt;code&gt;require&lt;/code&gt; should come after the &lt;code&gt;(load custom-file)&lt;/code&gt; line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given different users will have different setups, it might be easiest to not to use the customization system for this variable, and just put &lt;code&gt;(setq mymode-keymap-prefix &amp;lt;value&amp;gt;)&lt;/code&gt; in their init before the &lt;code&gt;(require 'mymode-mode)&lt;/code&gt; - as you've already discovered.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-06T20:46:38.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21478" PostTypeId="2" ParentId="21464" CreationDate="2016-04-06T21:04:57.113" Score="7" Body="&lt;p&gt;(&lt;a href=&quot;https://emacs.stackexchange.com/a/21466&quot;&gt;Jules Tamagnan's answer&lt;/a&gt; identifies the problem, I'll expand on it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your solutions with &lt;code&gt;save-excursion&lt;/code&gt; or &lt;code&gt;save-excursion&lt;/code&gt; do in fact work! You can see it by checking the value of &lt;code&gt;(point)&lt;/code&gt; in that buffer afterwards, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (with-current-buffer &quot;*whatever*&quot;&#xA;    (goto-char 42))&#xA;  (with-current-buffer &quot;*whatever*&quot;&#xA;    (point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;always returns 42 (provided that it's a valid position in the buffer. That's even mentioned as a gotcha in the documentation of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Excursions.html#index-save_002dexcursion&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;save-excursion&lt;/code&gt;&lt;/a&gt;: it restores only the position in the original buffer, not the position in any other buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you find that the buffer position isn't the one you set, that's because something else is changing it, and that thing is most likely a window (or a hook somewhere, but most hooks have no business messing with the point — still, it could be a e.g. process output hook). In the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Point.html#Point&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation about point&lt;/a&gt;, there's a note:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each buffer has its own value of point, which is independent of the value of point in other buffers. Each window also has a value of point, which is independent of the value of point in other windows on the same buffer. This is why point can have different values in various windows that display the same buffer. When a buffer appears in only one window, the buffer’s point and the window’s point normally have the same value, so the distinction is rarely important. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html#Window-Point&quot; rel=&quot;nofollow noreferrer&quot;&gt;Window Point&lt;/a&gt;, for more details.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If the buffer is shown in a window, then the buffer's point is updated to the window's point every time the point changes or the window is redisplayed. As a consequence, setting the point basically only lasts as long as your Lisp code lasts: as soon as the toplevel command loop takes control, the window is redisplayed (even if it isn't visible, as far as I can tell) and the buffer position is overridden. In effect, the user's chosen position trumps the program-chosen position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to also update the point of any window that displays the buffer, you can call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Buffers-and-Windows.html#index-get_002dbuffer_002dwindow_002dlist&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;get-buffer-window-list&lt;/code&gt;&lt;/a&gt; to enumerate the windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;*whatever*&quot;&#xA;  (goto-char …)&#xA;  (cl-dolist (window (get-buffer-window-list nil nil t))&#xA;    (set-window-point window (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But consider that if the user was visiting the buffer, they might not appreciate having the point changed under their nose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know Emacs doesn't track when windows were selected (that's “active” in Emacs terminology), you can only know whether they are currently selected. If you start caring about selected windows, beware that each frame has a selected window, and Emacs doesn't always know when frames are selected (&lt;code&gt;(selected-frame)&lt;/code&gt; doesn't completely match the end user experience, especially with frames inside terminal emulators since Emacs has no way to know when the user has the terminal emulator window active).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-04-06T21:04:57.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21479" PostTypeId="1" AcceptedAnswerId="21495" CreationDate="2016-04-06T22:29:31.113" Score="0" ViewCount="191" Body="&lt;p&gt;I have a few different configuration files for Gnus. I don't fully understand best practice here, but I'd like to move them out of my user home directory so that my path is &lt;code&gt;~/.emacs.d/gnus/gnus&lt;/code&gt;, &lt;code&gt;~/.emacs.d/gnus/profile&lt;/code&gt;, etc... how do I configure this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="11015" LastEditorUserId="11015" LastEditDate="2016-04-06T22:53:25.157" LastActivityDate="2016-04-07T17:26:58.033" Title="Overriding configuration folder defaults" Tags="|init-file|gnus|config|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21480" PostTypeId="1" AcceptedAnswerId="21481" CreationDate="2016-04-06T22:39:42.367" Score="0" ViewCount="71" Body="&lt;p&gt;I have a lot of occurances of something &lt;code&gt;=like_this=&lt;/code&gt; and I need to replace the both equals signs with this character: &lt;code&gt;`&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After looking at &lt;a href=&quot;https://emacs.stackexchange.com/questions/5977/emacs-regex-replace-while-re-using-part-of-the-expression-in-the-replacement&quot;&gt;this question&lt;/a&gt; I thought the following would do it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x query-replace-regex =\(.*\)?= RET `\1`&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That doesn't seem to do it, though. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-04-06T22:49:53.150" Title="Regex replacement of outer symbols" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21481" PostTypeId="2" ParentId="21480" CreationDate="2016-04-06T22:47:22.973" Score="2" Body="&lt;p&gt;To create a capture group, you need to backslash the parentheses &lt;code&gt;\(...\)&lt;/code&gt;. That's convenient in Emacs, because you often process Elisp, and you don't have to backslash its parentheses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that the question mark follows the asterisk immediately, as it modifies its greediness.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=\(.*?\)=&#xA;`\1`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2526" LastEditorUserId="2526" LastEditDate="2016-04-06T22:49:38.313" LastActivityDate="2016-04-06T22:49:38.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21482" PostTypeId="2" ParentId="21471" CreationDate="2016-04-06T23:50:14.830" Score="1" Body="&lt;p&gt;Press &lt;code&gt;C-u the-number-of-articles-to-cache !&lt;/code&gt;. &lt;code&gt;gnus-use-cache&lt;/code&gt; specify what algorithm Gnus will use when you &lt;strong&gt;manually&lt;/strong&gt; cache the articles. The cached articles are always readable when offline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the text quoted from &lt;a href=&quot;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Go to the “Summary Buffer”.&#xA;&#xA;You need mark the mails by press ! or M-x gnus-summary-tick-article-forward.&#xA;&#xA;The marked mails enter the disk cache. They can be read offline.&#xA;&#xA;You may remove it from the disk cache by M-x gnus-summary-put-mark-as-read.&#xA;&#xA;You also need insert below code into ~/.emacs,&#xA;&#xA;(setq gnus-use-cache t)&#xA;&#xA;Above code set gnus-use-cache to true to use the cache to the full extent by “wasting” tens of megabytes disk space.&#xA;&#xA;The disk cache is located at “~/News/cache/”. You can back it up with Github’s private repository&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-04-07T00:44:24.387" LastActivityDate="2016-04-07T00:44:24.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21483" PostTypeId="2" ParentId="21476" CreationDate="2016-04-06T23:55:16.503" Score="2" Body="&lt;p&gt;By loading packages with &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt; instead of &lt;code&gt;require&lt;/code&gt; you can specify code to run &lt;em&gt;before&lt;/em&gt; the package is loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package mymode-mode&#xA;  :init ;; Runs before loading&#xA;  (setq mymode-keymap-prefix &amp;lt;new_value&amp;gt;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Essentially all this does is put &lt;code&gt;(setq mymode-keymap-prefix &amp;lt;new_value&amp;gt;)&lt;/code&gt; before the require as the other answer suggests, but it's a convienty way to bundle the &quot;pre-loading&quot; config with the the rest.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-04-06T23:55:16.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21484" PostTypeId="1" CreationDate="2016-04-07T00:36:46.943" Score="3" ViewCount="1173" Body="&lt;p&gt;First, let me say that I tried to search around for an answer to this (and I will clarify where those failed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my problem is that when I enter the daily for for agenda, &lt;code&gt;M-x Org-Agenda a&lt;/code&gt;, I see duplicated tasks for what I believe is anything with a deadline or scheduled timestamp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5FGVT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5FGVT.png&quot; alt=&quot;All tasks shown in view have a timestamp&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tested this, and it seems normal TODOs get neglected where as anything with a timestamp, with a TODO or without, get presented twice in my daily agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IuNyg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IuNyg.png&quot; alt=&quot;Removed deadline from study guide, no longer shown as result&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried using &lt;code&gt;M-x customize variable org-agenda-todo-ignore-timestamp&lt;/code&gt;, which successfully eliminates duplicates at the cost of not showing any items with a scheduled/deadline time stamp, which I would still like to see in my agenda view. Though it doesn't apply here, I also checked to see if &lt;code&gt;M-x customize variable org-agenda-todo-list-sublevels&lt;/code&gt; was responsible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? I'm fairly new to org-mode and its various related functions/minor modes, so I very well could just be misusing the agenda function. I am currently using emacs24.5 but experienced it also while using emacs24.3. I'm also attaching the only code in my init.el file that involves org-mode directly besides some capture templates and use-package declarations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really appreciate the help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;init.el code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;---------key bindings---------------------------&#xA;&#xA;(define-key global-map &quot;\C-cc&quot; 'org-capture)&#xA;&#xA;;--------------org mode----------------------------&#xA;(desktop-save-mode 1)&#xA;(setq org-agenda-files '(&quot;&quot;))&#xA;(setq org-agenda-files&#xA;  (mapcar 'abbreviate-file-name&#xA;      (split-string&#xA;    (shell-command-to-string &quot;find ~/Tresors/Personal/org-mode -name \&quot;*.org\&quot;&quot;) &quot;\n&quot;)))&#xA;(setq line-spacing '0.25)&#xA;(setq org-log-done 'time)&#xA;(setq org-default-notes-file (concat &quot;~/Tresors/Personal/org-mode/notes.org&quot;))&#xA;(setq org-journal-dir &quot;~/Tresors/Personal/journal/&quot;); note, org mode takes CcCj, CcCf,CcCb (i think as mode specific only, but fyi incase universal)&#xA;(setq org-startup-indented t)&#xA;(setq org-hide-leading-stars t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11660" LastEditorUserId="11660" LastEditDate="2016-04-07T01:37:38.917" LastActivityDate="2016-04-07T01:37:38.917" Title="Org-Agenda Daily View Duplicates Time Stamped Tasks" Tags="|org-mode|init-file|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21486" PostTypeId="2" ParentId="21484" CreationDate="2016-04-07T01:32:20.090" Score="7" Body="&lt;p&gt;solved my problem myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I had duplicate &lt;code&gt;setq org-agenda-files&lt;/code&gt;, which obviously isn't good to start with. That wasn't the core of the problem, however. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, &lt;strong&gt;org-agenda doesn't search all sub-directories for .org files&lt;/strong&gt;, so I tried that function as a work around. For further clarification, the documentation on &lt;a href=&quot;http://orgmode.org/manual/Agenda-files.html&quot; rel=&quot;noreferrer&quot;&gt;orgmode.org&lt;/a&gt; states specifically&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The information to be shown is normally collected from all agenda files, the files listed in the variable org-agenda-files. &lt;strong&gt;If a directory is part of this list&lt;/strong&gt;, all files with the extension .org &lt;strong&gt;in this directory&lt;/strong&gt; will be part of the list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The immediate cause of my problem was using a recursive function to search for .org files. This just caused weirdness to happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; You can set multiple directories for the &lt;code&gt;org-agenda-files&lt;/code&gt; variable one after the other in quotes separated only with a space, which I implemented as such:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files '(&quot;~/Parent/Parent/org-mode/notes&quot; &quot;~/Parent/Parent/org-mode/to-dos&quot; &quot;~/Parent/Parent/org-mode/references&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All directories are now accounted for and are showing their relevant tasks on my agenda without duplicates! Hope this helps anyone else who bumps into the same silly mistake.&lt;/p&gt;&#xA;" OwnerUserId="11660" LastActivityDate="2016-04-07T01:32:20.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21487" PostTypeId="1" CreationDate="2016-04-07T07:19:45.370" Score="4" ViewCount="666" Body="&lt;p&gt;I am aware that it is a good idea to have one blank line at the end of each file.  I am also aware that extra white space in a file is bad.  Currently in my .emacs file I have &lt;code&gt;(add-hook 'before-save-hook 'delete-trailing-whitespace)&lt;/code&gt;  so that whitespace is removed during saving.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, despite what &lt;a href=&quot;https://www.emacswiki.org/emacs/DeletingWhitespace#toc3&quot; rel=&quot;nofollow&quot;&gt;the wiki&lt;/a&gt; says, this also deletes the final newline from my file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried setting &lt;code&gt;'(require-final-newline (quote visit-save))&lt;/code&gt; but that had no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way that I can force a newline to be added and all other extra whitespace removed?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2016-04-07T07:19:45.370" Title="How to delete all white space during save except for final new line" Tags="|whitespace|newlines|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21488" PostTypeId="1" CreationDate="2016-04-07T10:18:58.680" Score="10" ViewCount="730" Body="&lt;p&gt;I have entries in my org file similar to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Birthdays&#xA;:PROPERTIES:&#xA;:CATEGORY: birthday&#xA;:END:&#xA;%%(org-anniversary 1981 1 2) Harry (%d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I would like is for these to appear in the agenda (say) 2 weeks before they're due, similar to how a deadline works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that possible?&lt;/p&gt;&#xA;" OwnerUserId="727" LastEditorUserId="105" LastEditDate="2016-08-14T21:12:50.247" LastActivityDate="2020-05-08T18:21:11.203" Title="Highlighting upcoming dates in org mode agenda" Tags="|org-mode|syntax-highlighting|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21489" PostTypeId="2" ParentId="21468" CreationDate="2016-04-07T13:20:09.687" Score="1" Body="&lt;p&gt;Turns out &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/1462#issuecomment-206889312&quot; rel=&quot;nofollow&quot;&gt;it was a bug&lt;/a&gt;, &lt;a href=&quot;https://github.com/emacs-helm/helm/commit/9722df2be9ebcacf1f782bf8ee8f9c4b757c238d&quot; rel=&quot;nofollow&quot;&gt;now fixed&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6695" LastActivityDate="2016-04-07T13:20:09.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21490" PostTypeId="1" CreationDate="2016-04-07T14:28:14.957" Score="4" ViewCount="212" Body="&lt;p&gt;If command &lt;code&gt;command&lt;/code&gt; is bound to 2 keys &lt;code&gt;kb1&lt;/code&gt; and &lt;code&gt;kb2&lt;/code&gt;, and if I remap like this &lt;code&gt;(define-key somemap [remap command] #'some-other-command)&lt;/code&gt;, which of &lt;code&gt;kb1&lt;/code&gt; and &lt;code&gt;kb2&lt;/code&gt; is now bound to &lt;code&gt;some-other-command&lt;/code&gt; in &lt;code&gt;somemap&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2222" LastActivityDate="2016-04-09T14:46:45.117" Title="When rebinding command with [remap ...] which key is bound?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21491" PostTypeId="2" ParentId="21490" CreationDate="2016-04-07T14:56:18.440" Score="3" Body="&lt;p&gt;The first command (&lt;code&gt;command&lt;/code&gt;) is remapped to &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; of the keys bound to the second command (&lt;code&gt;some-other-command&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Remapping-Commands.html&quot; rel=&quot;nofollow&quot;&gt;Remapping Commands&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;, to try to answer your question in your comment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether &lt;code&gt;some-other-command&lt;/code&gt; (which is typically just a symbol here) is already a command bound to some keys, or is even already defined as a command, is irrelevant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What the &lt;code&gt;[remap...]&lt;/code&gt; does is create a key binding for &lt;code&gt;command&lt;/code&gt;, so that &lt;em&gt;IF&lt;/em&gt; &lt;code&gt;some-other-command&lt;/code&gt; does become defined and bound to some key(s) &lt;em&gt;THEN&lt;/em&gt; it will have its key(s) remapped so they invoke &lt;code&gt;command&lt;/code&gt; instead. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The binding that is created for &lt;code&gt;command&lt;/code&gt; is special.  It just holds the information that &quot;&lt;strong&gt;&lt;em&gt;any keys bound to &lt;code&gt;some-other-command&lt;/code&gt; are to be rerouted to  invoke &lt;code&gt;command&lt;/code&gt; instead.&lt;/em&gt;&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of this binding as being a &quot;&lt;strong&gt;Detour&lt;/strong&gt;&quot; sign on the road that would normally lead to &lt;code&gt;some-other-command&lt;/code&gt;.  When you hit the key Emacs follows the detour sign and ends up at &lt;code&gt;command&lt;/code&gt; instead of &lt;code&gt;some-other-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Remap&quot; means to use &lt;code&gt;some-other-command&lt;/code&gt; as a pointer (indirection), so that key lookup goes past/through &lt;code&gt;some-other-command&lt;/code&gt; to finally end up invoking &lt;code&gt;command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if this is still not clear, and I'll try to explain better.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-04-09T14:46:45.117" LastActivityDate="2016-04-09T14:46:45.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21492" PostTypeId="1" CreationDate="2016-04-07T15:03:54.957" Score="0" ViewCount="636" Body="&lt;p&gt;I've run into a bit of an issue that I'm having trouble resolving.  I use quite a few packages, one of which is ESS.  The latest update to ESS seems to run into issues when trying to install.  All I get is a blank window  when I try to start it.  I can start Emacs with &lt;code&gt;-Q&lt;/code&gt;, but &lt;code&gt;--debug-init&lt;/code&gt; doesn't help at all.  I've tried using melpa-stable instead, but I rely on too many packages from melpa to make that jump.  I've also tried deleting all elpa packages and letting them reinstall, but it gets stuck at installing ESS.  I can't interact with the window at all, and it's stayed blank like that for at least 30 minutes.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Windows 10&lt;/li&gt;&#xA;&lt;li&gt;Emacs 25.0.50 (Emacs w64)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lJ4Qv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lJ4Qv.png&quot; alt=&quot;blank Emacs window&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2016-04-07T17:17:07.920" LastActivityDate="2016-04-07T17:17:07.920" Title="Troubleshooting a blank window" Tags="|microsoft-windows|start-up|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21494" PostTypeId="2" ParentId="21473" CreationDate="2016-04-07T16:55:19.513" Score="13" Body="&lt;p&gt;&lt;code&gt;M-/&lt;/code&gt; is the default binding to expand snippets not &lt;code&gt;TAB&lt;/code&gt;.  You can find this out with &lt;code&gt;Spc ?&lt;/code&gt; then searching for &lt;code&gt;yas&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11654" LastActivityDate="2016-04-07T16:55:19.513" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21495" PostTypeId="2" ParentId="21479" CreationDate="2016-04-07T17:26:58.033" Score="0" Body="&lt;p&gt;By default, gnus config is placed in &lt;code&gt;~/.gnus&lt;/code&gt;. You can change this to another value via customize: &lt;code&gt;M-x customize-variable gnus-init-file&lt;/code&gt;. Perhaps you'd like to set this to &lt;code&gt;~/.emacsd/gnus/gnus&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can load other files from the &lt;code&gt;gnus&lt;/code&gt; file, so if you put &lt;code&gt;profile&lt;/code&gt; in &lt;code&gt;~/.emacs.d/gnus/profile&lt;/code&gt;, you could add this to &lt;code&gt;gnus&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-path 'load-path &quot;~/.emacs.d/gnus&quot;)&#xA;(load &quot;profile&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also put that in your init.el file.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-07T17:26:58.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21496" PostTypeId="1" CreationDate="2016-04-07T17:49:55.797" Score="4" ViewCount="1794" Body="&lt;p&gt;I have recently started using ansible, and &lt;code&gt;yaml-mode&lt;/code&gt; seemed the logical choice for editing playbooks. However, the indentation does not quite work correctly. For example, I might start a task definition like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- name: install packages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adding the next line, it needs to be indented as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- name: install packages&#xA;  apt: name=emacs24 state=present&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, what &lt;code&gt;yaml-mode&lt;/code&gt; wants to do is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- name: install packages&#xA;    apt: name=emacs24 state=present&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I tab again:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- name: install packages&#xA;apt: name=emacs24 state=present&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words, in order to get the correct indentation, I need to manually enter the correct number of spaces instead of using the tab key. &lt;strong&gt;Is there a mode where I can get the correct behavior, or a way to configure &lt;code&gt;yaml-mode&lt;/code&gt; to do what I want?&lt;/strong&gt; Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2018-12-18T03:42:47.620" Title="Minor mode for editing ansible playbooks" Tags="|indentation|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21497" PostTypeId="1" AcceptedAnswerId="21498" CreationDate="2016-04-07T19:22:32.313" Score="3" ViewCount="241" Body="&lt;p&gt;Is there a function that finds which Emacs window within a frame the mouse pointer is over without clicking or moving the mouse?  I know that &lt;code&gt;(mouse-position)&lt;/code&gt; includes the frame the mouse is over, but I can't find a function that gives the window.  Searching the web, stackexchange, etc, hasn't brought up any possibilities, either.&lt;/p&gt;&#xA;" OwnerUserId="11667" LastActivityDate="2016-04-07T21:22:00.797" Title="How to find the window under the mouse pointer" Tags="|window|mouse|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21498" PostTypeId="2" ParentId="21497" CreationDate="2016-04-07T19:59:42.963" Score="3" Body="&lt;p&gt;This should do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(window-at (cadr (mouse-position))&#xA;           (cddr (mouse-position))&#xA;           (car (mouse-position)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual section &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Coordinates-and-Windows.html&quot; rel=&quot;nofollow&quot;&gt;(elisp) Coordinates and Windows&lt;/a&gt; for more details. &lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-04-07T21:22:00.797" LastActivityDate="2016-04-07T21:22:00.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21499" PostTypeId="1" AcceptedAnswerId="21500" CreationDate="2016-04-07T20:14:51.890" Score="2" ViewCount="280" Body="&lt;p&gt;Since I &lt;a href=&quot;https://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/&quot; rel=&quot;nofollow&quot;&gt;learned&lt;/a&gt; how to colorize man pages using &lt;code&gt;LESS_TERMCAP&lt;/code&gt; I find them much more easy to read.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to achieve the same with Info pages in emacs. For example, colorize function names, variables, example ELISP code, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;customize-face RET info- TAB&lt;/code&gt; but I did not find any suitable option. &lt;/p&gt;&#xA;" OwnerUserId="11669" LastActivityDate="2017-07-19T00:47:57.167" Title="How does one colorize keywords in Info pages like in man?" Tags="|customize|colors|info|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21500" PostTypeId="2" ParentId="21499" CreationDate="2016-04-07T20:59:22.287" Score="3" Body="&lt;p&gt;(Expanding from the commentary on the question:)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're not actually colorizing &lt;em&gt;keywords&lt;/em&gt; in manual pages that way; you're just colorizing bold, underlined, or &quot;standout&quot; mode text, which styles are by convention used for things like program names. The same isn't done in e.g. the Emacs Lisp manual, so the same technique won't work. On the other hand, there are reasonably reliable conventions for how variables, functions, macros, etc. are introduced, so you could key off those instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of how you might do that. If you're new to Emacs, this may look a little weird, but a lot of things are done this way: instead of relying on complex and fragile regular expressions or parsing an AST out of the buffer contents, you just use more or less the same editing commands you would if you were making your desired changes by hand, and wrap them in a &lt;code&gt;save-excursion&lt;/code&gt; form so that Emacs puts the cursor (point), scroll, current buffer, and so forth back how they were before you started. It takes a little getting used to, but it's a lot easier than any other way I've ever tried.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bindings for &lt;code&gt;type-face&lt;/code&gt;, &lt;code&gt;name-face&lt;/code&gt;, and &lt;code&gt;args-face&lt;/code&gt; can be changed to any face that's defined; I just picked these off the top of my head. The &lt;code&gt;font-lock-*&lt;/code&gt; faces in particular might be of interest to you, since those are used in most programming modes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun niceify-info nil&#xA;  &quot;Highlight function, variable, macro, etc. description headers&#xA;in Info with arbitrary faces.&quot;&#xA;  (let ((type-face 'italic)&#xA;        (name-face 'bold)&#xA;        (args-face 'italic)&#xA;        (what-it-was inhibit-read-only))&#xA;    (unwind-protect&#xA;         (let (from to line-start)&#xA;           (setq inhibit-read-only t)&#xA;           (save-match-data&#xA;             (save-excursion&#xA;               (beginning-of-buffer)&#xA;               (while (re-search-forward &quot;^ -- &quot; nil t)&#xA;                 (save-excursion&#xA;                   (beginning-of-line)&#xA;                   (setq line-start (point)))&#xA;&#xA;                 (setq from (point))&#xA;                 (re-search-forward &quot;:&quot; nil t)&#xA;                 (setq to (point))&#xA;                 (add-face-text-property from to type-face)&#xA;&#xA;                 (re-search-forward &quot; &quot; nil t)&#xA;                 (setq from (point))&#xA;                 (re-search-forward &quot; &quot; nil t)&#xA;                 (setq to (point))&#xA;                 (add-face-text-property from to name-face)&#xA;&#xA;                 (setq from (point))&#xA;                 (end-of-line)&#xA;                 (add-face-text-property from (point) args-face)))))&#xA;      (set-buffer-modified-p nil)&#xA;      (setq inhibit-read-only what-it-was))))&#xA;&#xA;;; apply this function whenever an info page is selected&#xA;(add-hook 'Info-selection-hook&#xA;          #'niceify-info)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE WELL:&lt;/strong&gt; The preceding is a hack. I tossed it off in a few minutes, and while it works for me and I think it'll work for you, I can't guarantee it will work well, or at all, for anyone. Use it at your own risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bonus points&lt;/strong&gt;: Add another hook, or expand this one, to identify and mark up instances of the &lt;code&gt;`name'&lt;/code&gt; convention, used to call out the names of interesting things like functions or variables. Link them to documentation of the things they name, the same way that's already done in Help buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More bonus points&lt;/strong&gt;: Use the type of thing described on a line (function, variable, etc.) to select the face applied to its name (&lt;code&gt;font-lock-function-name-face&lt;/code&gt;, &lt;code&gt;font-lock-variable-name-face&lt;/code&gt;, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More bonus points still&lt;/strong&gt;: Link those names to their corresponding documentation, too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;All the bonus points&lt;/strong&gt;: Extend this into a reliable, configurable minor mode, and distribute it as an Emacs package via MELPA. (Unless I beat you to it.)&lt;/p&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2016-04-07T20:59:22.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21502" PostTypeId="1" CreationDate="2016-04-07T22:32:54.077" Score="1" ViewCount="998" Body="&lt;p&gt;What I want is when the buffer asks me  a value for property , I can also  replace property name with some alternatives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following code, but fails&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;      '((&quot;R&quot; &quot;Reference&quot; entry (file+datetree &quot;~/Dropbox/org/reference.org&quot;)&#xA;         &quot;* %? (one sentence each&#xA;part)\n%^{^{Conclusion|default|come1}}p%^{Detail}p%^{Reason}p%^{Good_for_me}p\nEntered on %U\n %i\n&quot; :prepend t&#xA;:kill-buffer t)&#xA;        )&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="5213" LastEditDate="2016-04-30T13:55:18.360" LastActivityDate="2016-10-29T01:04:36.940" Title="Use `%^{prop}p` `%^{prompt}` together in org-capture-templates" Tags="|org-mode|template|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21503" PostTypeId="2" ParentId="21473" CreationDate="2016-04-07T23:27:49.047" Score="3" Body="&lt;p&gt;&lt;code&gt;M-x yas-expand&lt;/code&gt;, you can &lt;code&gt;C-h f yas-expand&lt;/code&gt; to check which hotkey is assigned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;company&lt;/code&gt; is an auto-completion framework which supports many backends. &lt;code&gt;company-yasnippet&lt;/code&gt; could be its backend. If you use company-yasnippet, please check &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/492&quot; rel=&quot;nofollow&quot;&gt;https://github.com/company-mode/company-mode/issues/492&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use yasnippets independently and assign global hotkey &lt;code&gt;M-j&lt;/code&gt; to &lt;code&gt;yas-expand&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-04-07T23:27:49.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21504" PostTypeId="1" AcceptedAnswerId="21512" CreationDate="2016-04-08T04:32:34.770" Score="2" ViewCount="2164" Body="&lt;p&gt;In my &lt;code&gt;init.el&lt;/code&gt; file I have the following line: &lt;code&gt;(global-linum-mode 1)&lt;/code&gt;.  I want &lt;code&gt;linum-mode&lt;/code&gt; enabled for every file, but not for other buffers.  I.e. Is there a way to enable linum mode globally for all buffers with an extension?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frequently my buffer list looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file.js  js2-mode&#xA;init.el   Emacs-Lisp&#xA;ansi-term Term:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case I would like to have it enabled for everything but &lt;code&gt;ansi-term&lt;/code&gt;. Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermode, just for ansi term I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'term-mode-hook (lambda () (linum-mode -1)))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But even that did not work.  If someone could tell me why that would be great but enabling it just for files would be ideal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2016-04-08T18:00:12.743" Title="Enable Linum Mode for all files (with extension) but not other buffers?" Tags="|linum-mode|global-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21505" PostTypeId="2" ParentId="18754" CreationDate="2016-04-08T05:01:12.263" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/railwaycat/emacs-mac-port&quot; rel=&quot;nofollow&quot;&gt;https://github.com/railwaycat/emacs-mac-port&lt;/a&gt; this will actually help you . &#xA;It has retina display build in support in the doc-view-mode.&lt;/p&gt;&#xA;" OwnerUserId="11677" LastActivityDate="2016-04-08T05:01:12.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21506" PostTypeId="2" ParentId="21504" CreationDate="2016-04-08T05:16:19.097" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;https://www.emacswiki.org/emacs/linum-off.el&quot; rel=&quot;nofollow&quot;&gt;linum-off.el&lt;/a&gt; file by Matthew Fidler should be what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a copy of his code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'linum)&#xA;&#xA;(defcustom linum-disabled-modes-list '(eshell-mode wl-summary-mode compilation-mode org-mode text-mode dired-mode doc-view-mode image-mode)&#xA;  &quot;* List of modes disabled when global linum mode is on&quot;&#xA;  :type '(repeat (sexp :tag &quot;Major mode&quot;))&#xA;  :tag &quot; Major modes where linum is disabled: &quot;&#xA;  :group 'linum&#xA;)&#xA;(defcustom linum-disable-starred-buffers 't&#xA;  &quot;* Disable buffers that have stars in them like *Gnu Emacs*&quot;&#xA;  :type 'boolean&#xA;  :group 'linum)&#xA;&#xA;(defun linum-on ()&#xA;  &quot;* When linum is running globally, disable line number in modes defined in `linum-disabled-modes-list'. Changed by linum-off. Also turns off numbering in starred modes like *scratch*&quot;&#xA;&#xA;  (unless (or (minibufferp)&#xA;              (member major-mode linum-disabled-modes-list)&#xA;              (string-match &quot;*&quot; (buffer-name))&#xA;              (&amp;gt; (buffer-size) 3000000)) ;; disable linum on buffer greater than 3MB, otherwise it's unbearably slow&#xA;    (linum-mode 1)))&#xA;&#xA;(provide 'linum-off)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11510" LastActivityDate="2016-04-08T05:16:19.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21507" PostTypeId="1" AcceptedAnswerId="24532" CreationDate="2016-04-08T08:18:04.313" Score="3" ViewCount="1229" Body="&lt;p&gt;&lt;strong&gt;how to export &lt;code&gt;dir=&quot;rtl&quot;&lt;/code&gt; into HTML file from an org buffer?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TL;DR:&#xA;I want to export this simple org-buffer written in Arabic into HTML. The direction should be from right to left. I have this setting in &lt;code&gt;.emacs&lt;/code&gt; relevant to the language just to enable writing from right to left in org-mode, but this is only a convenient way for writing and should not be necessary to try out the MWE below, so feel free to skip this setting if you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; for right-to-left direction in org-mode&#xA;(defun set-bidi-env ()&#xA;  &quot;interactive&quot;&#xA;  (setq bidi-paragraph-direction 'nil))&#xA;(add-hook 'org-mode-hook 'set-bidi-env) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MWE&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: العنوان بالعربية&#xA;#+AUTHOR: اسم المؤلف&#xA;#+EMAIL: username@accountname.com&#xA;#+OPTIONS: toc:nil num:nil&#xA;#+LANGUAGE: ar&#xA;#+ATTR_HTML: :dir rtl&#xA;#+CREATOR: Emacs 25.1.50.2 (Org mode 8.3.4)&#xA;&#xA;* تعريف بالارقام الهندية او الشرقية ١، ٢، ٣&#xA;&#xA;** النقطة الاولى&#xA;&#xA;** الثانية&#xA;&#xA;** الثالثة&#xA;&#xA;** وهكذا&#xA;* النهاية&#xA;&#xA;#+CAPTION: المواد المطلوبة&#xA;#+NAME: tab:items&#xA;&#xA;| تسلسل | المادة  | العدد      |&#xA;|-------+---------+------------|&#xA;| ١     | طحين    | ٥ كيلوغرام |&#xA;| ٢     | رز      | ٣ كيلوغرام |&#xA;| ٣     | بطيخ    | ٢ كيلوغرام |&#xA;| ٤     | قرنابيط | ٢ كيلوغرام |&#xA;|-------+---------+------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To export org-buffer into HTML and open it in the default browser, one has to hit: &lt;kbd&gt;C-c C-e h o&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exported &lt;code&gt;.html&lt;/code&gt; file should be generated in the working directory:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Exported HTML&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&#xA;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;&#xA;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;&#xA;&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;ar&quot; xml:lang=&quot;ar&quot;&amp;gt;&amp;lt;!-- change here! --&amp;gt;&#xA;&amp;lt;head&amp;gt;&#xA;&amp;lt;!-- 2016-04-08 Fri 10:52 --&amp;gt;&#xA;&amp;lt;meta  http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=utf-8&quot; /&amp;gt;&#xA;&amp;lt;meta  name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot; /&amp;gt;&#xA;&amp;lt;title&amp;gt;العنوان بالعربية&amp;lt;/title&amp;gt;&#xA;&amp;lt;meta  name=&quot;generator&quot; content=&quot;Org-mode&quot; /&amp;gt;&#xA;&amp;lt;meta  name=&quot;author&quot; content=&quot;اسم المؤلف&quot; /&amp;gt;&#xA;&amp;lt;style type=&quot;text/css&quot;&amp;gt;&#xA; &amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/&#xA;  .title  { text-align: center;&#xA;             margin-bottom: .2em; }&#xA;  .subtitle { text-align: center;&#xA;              font-size: medium;&#xA;              font-weight: bold;&#xA;              margin-top:0; }&#xA;  .todo   { font-family: monospace; color: red; }&#xA;  .done   { font-family: monospace; color: green; }&#xA;  .priority { font-family: monospace; color: orange; }&#xA;  .tag    { background-color: #eee; font-family: monospace;&#xA;            padding: 2px; font-size: 80%; font-weight: normal; }&#xA;  .timestamp { color: #bebebe; }&#xA;  .timestamp-kwd { color: #5f9ea0; }&#xA;  .org-right  { margin-left: auto; margin-right: 0px;  text-align: right; }&#xA;  .org-left   { margin-left: 0px;  margin-right: auto; text-align: left; }&#xA;  .org-center { margin-left: auto; margin-right: auto; text-align: center; }&#xA;  .underline { text-decoration: underline; }&#xA;  #postamble p, #preamble p { font-size: 90%; margin: .2em; }&#xA;  p.verse { margin-left: 3%; }&#xA;  pre {&#xA;    border: 1px solid #ccc;&#xA;    box-shadow: 3px 3px 3px #eee;&#xA;    padding: 8pt;&#xA;    font-family: monospace;&#xA;    overflow: auto;&#xA;    margin: 1.2em;&#xA;  }&#xA;  pre.src {&#xA;    position: relative;&#xA;    overflow: visible;&#xA;    padding-top: 1.2em;&#xA;  }&#xA;  pre.src:before {&#xA;    display: none;&#xA;    position: absolute;&#xA;    background-color: white;&#xA;    top: -10px;&#xA;    right: 10px;&#xA;    padding: 3px;&#xA;    border: 1px solid black;&#xA;  }&#xA;  pre.src:hover:before { display: inline;}&#xA;  pre.src-sh:before    { content: 'sh'; }&#xA;  pre.src-bash:before  { content: 'sh'; }&#xA;  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }&#xA;  pre.src-R:before     { content: 'R'; }&#xA;  pre.src-perl:before  { content: 'Perl'; }&#xA;  pre.src-java:before  { content: 'Java'; }&#xA;  pre.src-sql:before   { content: 'SQL'; }&#xA;&#xA;  table { border-collapse:collapse; }&#xA;  caption.t-above { caption-side: top; }&#xA;  caption.t-bottom { caption-side: bottom; }&#xA;  td, th { vertical-align:top;  }&#xA;  th.org-right  { text-align: center;  }&#xA;  th.org-left   { text-align: center;   }&#xA;  th.org-center { text-align: center; }&#xA;  td.org-right  { text-align: right;  }&#xA;  td.org-left   { text-align: left;   }&#xA;  td.org-center { text-align: center; }&#xA;  dt { font-weight: bold; }&#xA;  .footpara { display: inline; }&#xA;  .footdef  { margin-bottom: 1em; }&#xA;  .figure { padding: 1em; }&#xA;  .figure p { text-align: center; }&#xA;  .inlinetask {&#xA;    padding: 10px;&#xA;    border: 2px solid gray;&#xA;    margin: 10px;&#xA;    background: #ffffcc;&#xA;  }&#xA;  #org-div-home-and-up&#xA;   { text-align: right; font-size: 70%; white-space: nowrap; }&#xA;  textarea { overflow-x: auto; }&#xA;  .linenr { font-size: smaller }&#xA;  .code-highlighted { background-color: #ffff00; }&#xA;  .org-info-js_info-navigation { border-style: none; }&#xA;  #org-info-js_console-label&#xA;    { font-size: 10px; font-weight: bold; white-space: nowrap; }&#xA;  .org-info-js_search-highlight&#xA;    { background-color: #ffff00; color: #000000; font-weight: bold; }&#xA;  /*]]&amp;gt;*/--&amp;gt;&#xA;&amp;lt;/style&amp;gt;&#xA;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&#xA;/*&#xA;@licstart  The following is the entire license notice for the&#xA;JavaScript code in this tag.&#xA;&#xA;Copyright (C) 2012-2013 Free Software Foundation, Inc.&#xA;&#xA;The JavaScript code in this tag is free software: you can&#xA;redistribute it and/or modify it under the terms of the GNU&#xA;General Public License (GNU GPL) as published by the Free Software&#xA;Foundation, either version 3 of the License, or (at your option)&#xA;any later version.  The code is distributed WITHOUT ANY WARRANTY;&#xA;without even the implied warranty of MERCHANTABILITY or FITNESS&#xA;FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.&#xA;&#xA;As additional permission under GNU GPL version 3 section 7, you&#xA;may distribute non-source (e.g., minimized or compacted) forms of&#xA;that code without the copy of the GNU GPL normally required by&#xA;section 4, provided you include this license notice and a URL&#xA;through which recipients can access the Corresponding Source.&#xA;&#xA;&#xA;@licend  The above is the entire license notice&#xA;for the JavaScript code in this tag.&#xA;*/&#xA;&amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/&#xA; function CodeHighlightOn(elem, id)&#xA; {&#xA;   var target = document.getElementById(id);&#xA;   if(null != target) {&#xA;     elem.cacheClassElem = elem.className;&#xA;     elem.cacheClassTarget = target.className;&#xA;     target.className = &quot;code-highlighted&quot;;&#xA;     elem.className   = &quot;code-highlighted&quot;;&#xA;   }&#xA; }&#xA; function CodeHighlightOff(elem, id)&#xA; {&#xA;   var target = document.getElementById(id);&#xA;   if(elem.cacheClassElem)&#xA;     elem.className = elem.cacheClassElem;&#xA;   if(elem.cacheClassTarget)&#xA;     target.className = elem.cacheClassTarget;&#xA; }&#xA;/*]]&amp;gt;*///--&amp;gt;&#xA;&amp;lt;/script&amp;gt;&#xA;&amp;lt;/head&amp;gt;&#xA;&amp;lt;body&amp;gt;&#xA;&amp;lt;div id=&quot;content&quot;&amp;gt;&#xA;&amp;lt;h1 class=&quot;title&quot;&amp;gt;العنوان بالعربية&amp;lt;/h1&amp;gt;&#xA;&#xA;&amp;lt;div id=&quot;outline-container-orgheadline5&quot; class=&quot;outline-2&quot;&amp;gt;&#xA;&amp;lt;h2 id=&quot;orgheadline5&quot;&amp;gt;تعريف بالارقام الهندية او الشرقية ١، ٢، ٣&amp;lt;/h2&amp;gt;&#xA;&amp;lt;div class=&quot;outline-text-2&quot; id=&quot;text-orgheadline5&quot;&amp;gt;&#xA;&amp;lt;/div&amp;gt;&amp;lt;div id=&quot;outline-container-orgheadline1&quot; class=&quot;outline-3&quot;&amp;gt;&#xA;&amp;lt;h3 id=&quot;orgheadline1&quot;&amp;gt;النقطة الاولى&amp;lt;/h3&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&#xA;&amp;lt;div id=&quot;outline-container-orgheadline2&quot; class=&quot;outline-3&quot;&amp;gt;&#xA;&amp;lt;h3 id=&quot;orgheadline2&quot;&amp;gt;الثانية&amp;lt;/h3&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&#xA;&amp;lt;div id=&quot;outline-container-orgheadline3&quot; class=&quot;outline-3&quot;&amp;gt;&#xA;&amp;lt;h3 id=&quot;orgheadline3&quot;&amp;gt;الثالثة&amp;lt;/h3&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&#xA;&amp;lt;div id=&quot;outline-container-orgheadline4&quot; class=&quot;outline-3&quot;&amp;gt;&#xA;&amp;lt;h3 id=&quot;orgheadline4&quot;&amp;gt;وهكذا&amp;lt;/h3&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;div id=&quot;outline-container-orgheadline6&quot; class=&quot;outline-2&quot;&amp;gt;&#xA;&amp;lt;h2 id=&quot;orgheadline6&quot;&amp;gt;النهاية&amp;lt;/h2&amp;gt;&#xA;&amp;lt;div class=&quot;outline-text-2&quot; id=&quot;text-orgheadline6&quot;&amp;gt;&#xA;&amp;lt;table border=&quot;2&quot; cellspacing=&quot;0&quot; cellpadding=&quot;6&quot; rules=&quot;groups&quot; frame=&quot;hsides&quot;&amp;gt;&#xA;&#xA;&#xA;&amp;lt;colgroup&amp;gt;&#xA;&amp;lt;col  class=&quot;org-left&quot; /&amp;gt;&#xA;&#xA;&amp;lt;col  class=&quot;org-left&quot; /&amp;gt;&#xA;&#xA;&amp;lt;col  class=&quot;org-left&quot; /&amp;gt;&#xA;&amp;lt;/colgroup&amp;gt;&#xA;&amp;lt;thead&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&amp;gt;تسلسل&amp;lt;/th&amp;gt;&#xA;&amp;lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&amp;gt;المادة&amp;lt;/th&amp;gt;&#xA;&amp;lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&amp;gt;العدد&amp;lt;/th&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;/thead&amp;gt;&#xA;&amp;lt;tbody&amp;gt;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;١&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;طحين&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;٥ كيلوغرام&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;٢&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;رز&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;٣ كيلوغرام&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;٣&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;بطيخ&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;٢ كيلوغرام&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&#xA;&amp;lt;tr&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;٤&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;قرنابيط&amp;lt;/td&amp;gt;&#xA;&amp;lt;td class=&quot;org-left&quot;&amp;gt;٢ كيلوغرام&amp;lt;/td&amp;gt;&#xA;&amp;lt;/tr&amp;gt;&#xA;&amp;lt;/tbody&amp;gt;&#xA;&amp;lt;/table&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;div id=&quot;postamble&quot; class=&quot;status&quot;&amp;gt;&#xA;&amp;lt;p class=&quot;author&quot;&amp;gt;تأليف: اسم المؤلف&amp;lt;/p&amp;gt;&#xA;&amp;lt;p class=&quot;date&quot;&amp;gt;Created: 2016-04-08 Fri 10:52&amp;lt;/p&amp;gt;&#xA;&amp;lt;p class=&quot;validation&quot;&amp;gt;&amp;lt;a href=&quot;http://validator.w3.org/check?uri=referer&quot;&amp;gt;Validate&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/lkHgf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lkHgf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now everything was exported as expected except for the direction! If I want to change direction from INSIDE the generated html file, I have to change one line (marked in the code above) to this:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;ar&quot; xml:lang=&quot;ar&quot;, dir=&quot;rtl&quot;&amp;gt;&amp;lt;!-- change here --&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I hit &lt;kbd&gt;C-c C-v&lt;/kbd&gt; from inside the edited html buffer, it will be  correctly displayed in browser from right to left. So it seems that all I need is to tell org-mode to export this little parameter &lt;code&gt;dir=&quot;rtl&quot;&lt;/code&gt; and everything will be just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Output -- the desired one&lt;/strong&gt;&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/G20Ec.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/G20Ec.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In org manual, I found &lt;code&gt;#+ATTR_HTML:&lt;/code&gt; but my trial of &lt;code&gt;#+ATTR_HTML: :dir rtl&lt;/code&gt; was unsuccessful, my question to org-mode users how to export this html parameter from org buffer &lt;em&gt;correctly&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;as amitp pointed out, this is my best solution for time being just put this in th org mode file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML: &amp;lt;style&amp;gt; body {direction: rtl} &amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2017-05-19T12:01:27.050" LastActivityDate="2017-05-19T12:01:27.050" Title="How to org-export this tag into HTML?" Tags="|org-mode|org-export|html|right-to-left|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21508" PostTypeId="1" CreationDate="2016-04-08T08:55:08.617" Score="2" ViewCount="1718" Body="&lt;p&gt;I want to purge emacs from debian in order to install the newer version from git but when I do &lt;code&gt;apt-get purge emacs&lt;/code&gt; and then &lt;code&gt;emacs&lt;/code&gt;it still runs. Any idea on how to get rid of emacs ?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastEditorUserId="262" LastEditDate="2016-04-08T15:45:44.130" LastActivityDate="2016-04-08T15:55:50.950" Title="Can't uninstall emacs on Debian" Tags="|debian|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21509" PostTypeId="2" ParentId="21508" CreationDate="2016-04-08T08:59:14.933" Score="-1" Body="&lt;p&gt;&lt;code&gt;apt-get purge emacs*&lt;/code&gt; did the trick even tho it didn't really purge the config files (̀&lt;code&gt;.emacs.d&lt;/code&gt; still present...)&lt;/p&gt;&#xA;" OwnerUserId="11673" LastActivityDate="2016-04-08T08:59:14.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21512" PostTypeId="2" ParentId="21504" CreationDate="2016-04-08T11:04:48.593" Score="7" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Enable Linum Mode for all files [...] but not other buffers?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How about:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'find-file-hook 'linum-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-04-08T11:04:48.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21515" PostTypeId="2" ParentId="21507" CreationDate="2016-04-08T13:43:15.217" Score="-1" Body="&lt;p&gt;Your syntax seems to be wrong. Instead of &lt;code&gt;#+ATTR_HTML: :dir:rtl&lt;/code&gt; try &lt;code&gt;#+ATTR_HTML: :dir rtl&lt;/code&gt;, that should work.&lt;/p&gt;&#xA;" OwnerUserId="11510" LastActivityDate="2016-04-08T13:43:15.217" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21516" PostTypeId="1" AcceptedAnswerId="21517" CreationDate="2016-04-08T14:46:47.650" Score="3" ViewCount="244" Body="&lt;p&gt;According to &lt;code&gt;match-string&lt;/code&gt; help:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Value is nil if NUMth pair didn't match&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In fact:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;\\(hullo\\)&quot; &quot;hello&quot;)&#xA;(match-string 1 &quot;hello&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, a &lt;code&gt;NUM&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Zero means the entire text matched by the whole regexp or whole string.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Therefore, given:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-match &quot;hullo&quot; &quot;hello&quot;)&#xA;(match-string 0 &quot;hello&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd expect a &lt;code&gt;nil&lt;/code&gt;, as above, since since the 0-th pair didn't match.&lt;br&gt;&#xA;Instead, I get the Lisp error &lt;code&gt;args-out-of-range&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-04-08T15:25:54.317" Title="Match regexp groups or entire text" Tags="|regular-expressions|search|string|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21517" PostTypeId="2" ParentId="21516" CreationDate="2016-04-08T15:25:54.317" Score="3" Body="&lt;p&gt;The documentation of &lt;code&gt;string-match&lt;/code&gt; states that you can use &lt;code&gt;match-string&lt;/code&gt; to extract &lt;strong&gt;substrings matched by the parenthesis constructions&lt;/strong&gt;. There is no mention of the whole string.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;string-match is a built-in function in `C source code'.&#xA;&#xA;(string-match REGEXP STRING &amp;amp;optional START)&#xA;&#xA;Return index of start of first match for REGEXP in STRING, or nil.&#xA;Matching ignores case if `case-fold-search' is non-nil.&#xA;If third arg START is non-nil, start search at that index in STRING.&#xA;For index of first char beyond the match, do (match-end 0).&#xA;`match-end' and `match-beginning' also give indices of substrings&#xA;matched by parenthesis constructs in the pattern.&#xA;&#xA;You can use the function `match-string' to extract the substrings&#xA;matched by the parenthesis constructions in REGEXP.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation of &lt;code&gt;match-string&lt;/code&gt;is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;match-string is a compiled Lisp function in `subr.el'.&#xA;&#xA;(match-string NUM &amp;amp;optional STRING)&#xA;&#xA;Return string of text matched by last search.&#xA;NUM specifies which parenthesized expression in the last regexp.&#xA; Value is nil if NUMth pair didn't match, or there were less than NUM pairs.&#xA;Zero means the entire text matched by the whole regexp or whole string.&#xA;STRING should be given if the last search was by `string-match' on STRING.&#xA;If STRING is nil, the current buffer should be the same buffer&#xA;the search/match was performed in.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There &lt;code&gt;whole string&lt;/code&gt; refers to the case that you search with &lt;code&gt;search-forward&lt;/code&gt; instead of &lt;code&gt;re-search-forward&lt;/code&gt;. It does not refer to the case that you used &lt;code&gt;string-match&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get the behaviour described in your question by &lt;code&gt;(when (string-match &quot;hullo&quot; str) (match-string str))&lt;/code&gt;. This returns &lt;code&gt;nil&lt;/code&gt; on &lt;code&gt;(setq str &quot;hello&quot;)&lt;/code&gt; and &lt;code&gt;&quot;hullo&quot;&lt;/code&gt; on &lt;code&gt;(setq str &quot;hullo&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;You are right. The documentation could be more clear about this!&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-04-08T15:25:54.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21518" PostTypeId="2" ParentId="21508" CreationDate="2016-04-08T15:55:50.950" Score="3" Body="&lt;p&gt;The Debian package &lt;code&gt;emacs&lt;/code&gt; is a metapackage. &lt;a href=&quot;https://www.debian.org/doc/manuals/debian-handbook/sect.package-meta-information.en.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;These are empty packages that only describe dependencies.&lt;/a&gt; As such, they don't actually contain any programs, just links to other packages to install. Further, removing a metapackage does not result in its dependencies being removed.&lt;/p&gt;&#xA;&lt;p&gt;This feature allows package managers to use transitional metapackages to more-or-less gracefully move users from using one package to another with a different name.&lt;/p&gt;&#xA;&lt;p&gt;So, removing the &lt;code&gt;emacs&lt;/code&gt; package didn't actually remove any programs. That's why you needed to remove the rest of the emacs packages (&lt;code&gt;apt-get purge emacs*&lt;/code&gt;) to get rid of emacs on your system.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.debian.org/doc/manuals/debian-handbook/sect.package-meta-information.en.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Regarding the &lt;code&gt;--purge&lt;/code&gt; flag to apt-get&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;When a Debian package is removed, the configuration files are retained in order to facilitate possible re-installation. Likewise, the data generated by a daemon (such as the content of an LDAP server directory, or the content of a database for an SQL server) are usually retained.&lt;/p&gt;&#xA;&lt;p&gt;To remove all data associated with a package, it is necessary to “purge” the package with the command, dpkg -P package, apt-get remove --purge package or aptitude purge package.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Thus, purge only removes system-installed config files (such as you might find in &lt;code&gt;/etc/&lt;/code&gt; or &lt;code&gt;/var/&lt;/code&gt;), not user-generated config (usually somewhere in &lt;code&gt;/home/&amp;lt;user&amp;gt;/&lt;/code&gt;. It would be a very bad thing if the package manager erased user-generated files!&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-04-08T15:55:50.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21519" PostTypeId="1" AcceptedAnswerId="21522" CreationDate="2016-04-08T17:55:45.383" Score="2" ViewCount="2100" Body="&lt;p&gt;It is clear to me how to programmatically replace all instances of regex in a buffer with some text, something like (pardon my naive code):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/regex-global-replace (regex subst-text)&#xA; &quot;Globally replace `regex' with `subst-text' in current buffer&quot;&#xA; (goto-char (point-min))&#xA; (while (re-search-forward regex nil t)&#xA; (replace-match subst-text)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I can't figure it out how to do a similar global replace when using capture groups and sub-matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of &lt;a href=&quot;https://stackoverflow.com/questions/16243159/emacs-lisp-get-sub-matches-from-a-regexp-match&quot;&gt;this answer&lt;/a&gt; and the &lt;a href=&quot;https://www.emacswiki.org/emacs/ElispCookbook#toc34&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cookbook entry&lt;/a&gt;, but it does not help me much, since it is not clear how I could use the sub-matches to replace text globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could one write a broader version of the code above, so that it deals with sub-matches, something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/regex-global-replace (regex1 regex2)&#xA; &quot;Replace `regex1' with `regex2' in a buffer.&quot;&#xA; (goto-char (point-min))&#xA; (while (re-search-forward regex1 nil t)&#xA; (replace-match regex2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where regex1 may contain a certain number of capture groups, like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq regex1 &quot;some text \\([[:digit:]]+\\)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and regex2 a related sub-match, the equivalent of PCRE's &lt;code&gt;$1&lt;/code&gt; or &lt;code&gt;\1&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Example&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;As an example, say I have a buffer with content,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Some text 123&#xA;Some more text 456&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to programmatically run a global search-and-replace that would, as example, change text but keep the numbers,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Changed text, keep digits 123&#xA;Changed text, keep digits 456&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In some other languages (Perl comes to mind), I would create a search regex with a capture group, and a replace expression using the sub-matches, something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s/(\w+\s+)+(\d+)\n/Changed text, keep digits \2\n/gim&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="249" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-06-22T19:57:42.530" Title="Programmatically replace all instances of regex with capture groups and sub-matches in buffer" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21520" PostTypeId="2" ParentId="21504" CreationDate="2016-04-08T18:00:12.743" Score="5" Body="&lt;p&gt;A solution covering nearly every file would be making use of the fact that nearly all buffers for these are derived from &lt;code&gt;text-mode&lt;/code&gt; and &lt;code&gt;prog-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook 'linum-mode)&#xA;(add-hook 'prog-mode-hook 'linum-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-04-08T18:00:12.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21521" PostTypeId="1" AcceptedAnswerId="21562" CreationDate="2016-04-08T18:21:18.907" Score="2" ViewCount="355" Body="&lt;p&gt;I've been having this trouble for a little while.  Whenever I open a new file in spacemacs, it always opens in fundamental mode.  I'm on a clean install of spacemacs on windows 10 if that matters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see what the content of auto-mode-alist was, I opened the scratch buffer, started an inferior emacs lisp, typed the variable name, and pressed enter.  I saw a lot of output, the first of which was the association of *.el files with emacs-lisp-mode.  So I tried opening a new .el file, but I still got fundamental mode.  I then set auto-mode-alist to contain just the association of *.el files with emacs-lisp-mode.  I opened another new file, but I got the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is a question: is there a way to disable the auto mode choosing of emacs? Is there a setting that could possible interfere with it that I might have accidentally somehow set (but I'm on a clean spacemacs, so I don't know how it would happen)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, non-spacemacs emacs works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should also note that when I open a file with windows line endings, I see lovely ^M characters at the end of all the lines.  Without spacemacs, emacs picks up on the line endings and acts appropriately by hiding them.&lt;/p&gt;&#xA;" OwnerUserId="11539" LastEditorUserId="11539" LastEditDate="2016-04-08T20:16:35.570" LastActivityDate="2016-04-10T20:55:33.763" Title="Spacemacs auto-mode-alist appears to be disabled" Tags="|spacemacs|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21522" PostTypeId="2" ParentId="21519" CreationDate="2016-04-08T19:20:45.527" Score="2" Body="&lt;p&gt;I think you are asking for a fairly standard use of replace-match. Capture both groups, and use the one you want to keep in the replacement text: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq regex1 &quot;\\([^0-9]+ \\)\\([[:digit:]]+\\)$&quot;)&#xA;(setq regex2 &quot;Changed text, keep digits \\2\n&quot;)&#xA;&#xA;(defun my/regex-global-replace (regex1 regex2)&#xA; &quot;Replace `regex1' with `regex2' in a buffer.&quot;&#xA; (goto-char (point-min))&#xA; (while (re-search-forward regex1 nil t)&#xA; (replace-match regex2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-04-08T19:50:24.890" LastActivityDate="2016-04-08T19:50:24.890" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21523" PostTypeId="1" AcceptedAnswerId="21524" CreationDate="2016-04-08T20:16:37.210" Score="2" ViewCount="595" Body="&lt;p&gt;Stupid question, but: how to press &lt;code&gt;C-(&lt;/code&gt; (this is a default bind in Prelude Emacs for Smartparens's &lt;code&gt;sp-backward-slurp-sexp&lt;/code&gt;)? On my keyboard i have such bracket only in same key with &lt;code&gt;9&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11619" LastActivityDate="2016-04-09T16:41:10.880" Title="Confused about key bind &quot;C-(&quot;" Tags="|key-bindings|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21524" PostTypeId="2" ParentId="21523" CreationDate="2016-04-08T20:44:33.140" Score="6" Body="&lt;p&gt;This is a convention when describing key bindings in text. &lt;code&gt;C&lt;/code&gt; indicates the control key, &lt;code&gt;M&lt;/code&gt; the meta key (the alt key on most keyboards), and &lt;code&gt;S&lt;/code&gt; indicates the shift key. The shift key is not normally listed explicitly. Instead, you would refer to the symbol that you get when holding the shift key. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, the command &lt;code&gt;set-mark-command&lt;/code&gt; is bound to &lt;code&gt;C-@&lt;/code&gt;. To actually type this key, you would press &lt;code&gt;C-S-2&lt;/code&gt;. Or in your example, &lt;code&gt;C-(&lt;/code&gt; is entered by pressing &lt;code&gt;C-S-9&lt;/code&gt;. (this assumes you're using a US keyboard, where &lt;code&gt;@&lt;/code&gt; is on the &lt;code&gt;2&lt;/code&gt; key, and &lt;code&gt;(&lt;/code&gt; is on the &lt;code&gt;9&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One other note: for key combinations that combine the control key and a letter, the shifted letters do the same thing as the unshifted letter by default. That is, &lt;code&gt;C-S-a&lt;/code&gt; (&lt;code&gt;C-A&lt;/code&gt;) is the same as &lt;code&gt;C-a&lt;/code&gt;. The same is true for meta. Meta + a shifted letter (eg. &lt;code&gt;M-S-a&lt;/code&gt;) does the same as meta + the unshifted letter (e.g., &lt;code&gt;M-a&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you wish you can change this by explicitly binding the shifted letter to a different command. See the manual section &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html&quot; rel=&quot;nofollow&quot;&gt;(emacs) Modifier Keys&lt;/a&gt; for more details on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that all of this is in reference to how we &lt;em&gt;communicate&lt;/em&gt; about key bindings. As @KaushalModi points out, when it comes time to actually &lt;em&gt;make&lt;/em&gt; a keybinding in your init file, you don't include the &lt;code&gt;S-&lt;/code&gt;, you actually enter the shifted key. That is, you use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(kbd &quot;C-(&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and not&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(kbd &quot;C-S-9&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-04-09T16:41:10.880" LastActivityDate="2016-04-09T16:41:10.880" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="21525" PostTypeId="2" ParentId="10033" CreationDate="2016-04-09T01:29:52.993" Score="3" Body="&lt;p&gt;I'm not sure whether you're still looking for an answer or not but this was the only result I got on Google while trying to do this myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyways for whatever reason Emacs calls this &lt;code&gt;distant-foreground&lt;/code&gt; so the only thing you really need to do is add &lt;code&gt;:distant-foreground $colour-of-choice&lt;/code&gt; to your face.&lt;/p&gt;&#xA;" OwnerUserId="11685" LastActivityDate="2016-04-09T01:29:52.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21526" PostTypeId="2" ParentId="21475" CreationDate="2016-04-09T02:01:21.563" Score="3" Body="&lt;p&gt;This mostly does what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-search-or-browse ()&#xA;  &quot;If selected region, or thing at point, is a url, go there. Otherwise,&#xA;use region/thing as a keyword for a google search.&quot;&#xA;  (interactive)&#xA;  (let ((target&#xA;         (if (use-region-p)&#xA;             (buffer-substring (region-beginning) (region-end))&#xA;           (thing-at-point 'symbol))))&#xA;    (if (ffap-url-p target)&#xA;        (browse-url target)&#xA;      (browse-url (concat &quot;http://www.google.com/search?q=&quot;&#xA;                          (url-hexify-string target))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will only recognize actual URLs, with the &lt;code&gt;http://&lt;/code&gt; prefix. Plain addresses like &lt;code&gt;www.example.com&lt;/code&gt; will be treated like keywords. I haven't found any built-in functions that would distinguish between actual urls of the form &lt;code&gt;google.com&lt;/code&gt; and other strings with periods in them.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-09T02:01:21.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21528" PostTypeId="2" ParentId="3432" CreationDate="2016-04-09T05:59:13.423" Score="0" Body="&lt;p&gt;I have the similar problem at markdown-mode ,when I want to display images in xxx.md alive. I just glance at the iimage.el , And I find out &lt;code&gt;(iimage-mode-buffer iimage-mode)&lt;/code&gt; this works fine for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-md-screenshot ()&#xA;   &quot;Take a screenshot into a time stamped unique-named file in the&#xA;same directory as the org-buffer and insert a link to this file.&quot;&#xA;(interactive)&#xA;(setq filename&#xA;    (concat&#xA;     (make-temp-name&#xA;      (concat (file-name-base)&#xA;              &quot;_&quot;&#xA;              (format-time-string &quot;%Y%m%d_%H%M%S_&quot;)) ) &quot;.png&quot;))&#xA;(call-process-shell-command &quot;screencapture&quot; nil nil nil&#xA;                          (concat &quot; -i ~/public/img/&quot; filename))&#xA;(insert (concat &quot;![image](/public/img/&quot; filename &quot;)&quot;))&#xA;(iimage-mode-buffer iimage-mode)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11677" LastActivityDate="2016-04-09T05:59:13.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21529" PostTypeId="1" CreationDate="2016-04-09T06:36:08.100" Score="5" ViewCount="2561" Body="&lt;p&gt;I am using &lt;code&gt;Ubuntu 14.04LTS 64bit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I encounter this problem when I opened too many files by a emacs function.&#xA;Error is signaled as a message and prevent me from opening more files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked my &lt;code&gt;ulimit -a&lt;/code&gt; which shows my &lt;code&gt;open files&lt;/code&gt; limit is &lt;code&gt;1024&lt;/code&gt;.&#xA;So I changed the files limit to &lt;code&gt;4096&lt;/code&gt; by this &lt;a href=&quot;https://askubuntu.com/questions/162229/how-do-i-increase-the-open-files-limit-for-a-non-root-user&quot;&gt;method&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, when I tried to open files more than &lt;code&gt;1024&lt;/code&gt;, emacs quit instantly without signaling any error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion to this problem?&lt;/p&gt;&#xA;" OwnerUserId="10417" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2016-04-09T06:36:08.100" Title="Emacs hitting &quot;too many files open&quot;" Tags="|files|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21530" PostTypeId="2" ParentId="20781" CreationDate="2016-04-09T07:46:23.263" Score="3" Body="&lt;p&gt;As @Xaldew mentioned, it seems there were no existing package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I started making one myself. -&gt; &lt;a href=&quot;https://github.com/Yuki-Inoue/cql-mode&quot; rel=&quot;nofollow&quot;&gt;cql-mode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9371" LastActivityDate="2016-04-09T07:46:23.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21531" PostTypeId="1" AcceptedAnswerId="21532" CreationDate="2016-04-09T11:02:35.467" Score="1" ViewCount="1087" Body="&lt;p&gt;In most cases, if Emacs is used to edit a file in a git repository, it is advisable to commit within Emacs and use magit to write the commit message. However, if Emacs is not used to edit the files (such as only &lt;code&gt;git mv&lt;/code&gt; on the command line is used to move files around, or maybe just adding some image files), what should the config of git and Emacs be such that the correct magit mode is turned on when Emacs was fired up to edit the commit message, instead of the default plain text mode?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-04-09T13:30:00.647" Title="git commit on the command line: how to use magit for editing the commit message?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21532" PostTypeId="2" ParentId="21531" CreationDate="2016-04-09T13:30:00.647" Score="1" Body="&lt;p&gt;Make sure &lt;code&gt;global-git-commit-mode&lt;/code&gt; is enabled by putting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-git-commit-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your init file. (Actually, this mode will be enabled automatically once &lt;code&gt;git-commit.el&lt;/code&gt; is loaded, so you can also call &lt;code&gt;(require 'git-commit)&lt;/code&gt; instead. I prefer the more readable way). BTW, I am assuming you are using Emacs' built-in package manager &lt;code&gt;package.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I like doing all complex git operation within Magit, I define a shell function for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;magit () {&#xA;    emacsclient --eval &quot;(call-interactively #'magit-status)&quot;&#xA;    open -a Emacs&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;em&gt;I use GUI Emacs on Mac and start Emacs server with &lt;code&gt;(server-start)&lt;/code&gt;&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then after type &lt;code&gt;magit&lt;/code&gt; from terminal, Emacs will jump out and Magit is ready to go. &lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-09T13:30:00.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21533" PostTypeId="2" ParentId="20877" CreationDate="2016-04-09T14:52:03.047" Score="1" Body="&lt;p&gt;You can't do this &lt;em&gt;directly&lt;/em&gt; with the &lt;code&gt;ansi-term&lt;/code&gt; command, but you can define an equivalent command using the approach demonstrated by dfeich, which might look something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-ansi-term (command &amp;amp;optional name)&#xA;  &quot;Runs COMMAND in a `term' buffer.&quot;&#xA;  (interactive&#xA;   (let ((shell (or explicit-shell-file-name&#xA;                    (getenv &quot;ESHELL&quot;)&#xA;                    (getenv &quot;SHELL&quot;)&#xA;                    &quot;/bin/sh&quot;))&#xA;         suggestion&#xA;         name)&#xA;     (if (tramp-tramp-file-p default-directory)&#xA;         (let ((tstruct (tramp-dissect-file-name default-directory)))&#xA;           (when (string= (tramp-file-name-method tstruct) &quot;ssh&quot;)&#xA;             (setq suggestion&#xA;                   (apply #'format &quot;ssh -t %s@%s -p %s cd %s; exec %s&quot;&#xA;                          (mapcar #'shell-quote-argument&#xA;                                  (list (tramp-file-name-user tstruct)&#xA;                                        (tramp-file-name-host tstruct)&#xA;                                        (number-to-string&#xA;                                         (tramp-file-name-port tstruct))&#xA;                                        (tramp-file-name-localname tstruct)&#xA;                                        shell))))&#xA;             (setq name (concat &quot;ansi-term: &quot; default-directory))))&#xA;       (setq suggestion shell&#xA;             name &quot;ansi-term&quot;))&#xA;     (list (read-from-minibuffer &quot;Run program: &quot; suggestion)&#xA;           name)))&#xA;  (let* ((name (or name command))&#xA;         (switches (split-string-and-unquote command))&#xA;         (command (pop switches))&#xA;         (termbuf (apply 'make-term name command nil switches)))&#xA;    (set-buffer termbuf)&#xA;    (term-mode)&#xA;    (term-char-mode)&#xA;    (switch-to-buffer termbuf)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tramp almost certainly provides a better way to generate the ssh command line from the parsed filename, but I couldn't find something appropriate. Also, assuming the local shell is valid for the remote host is clearly not correct in all situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, this function doesn't account for all use-cases by any means; but I would guess that it probably works for most.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-04-09T15:35:56.533" LastActivityDate="2016-04-09T15:35:56.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21534" PostTypeId="1" AcceptedAnswerId="21539" CreationDate="2016-04-09T14:55:54.503" Score="0" ViewCount="561" Body="&lt;p&gt;If I start Spacemacs, I don't see the homescreen. I saw it for a while after my first install, so I think it might be something I've changed it my dotfile. However, the only values I found that seem to match the startup screen should be enabled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-startup-banner 'official&#xA;dotspacemacs-startup-lists '(recents projects)&#xA;dotspacemacs-startup-recent-list-size 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there anything else in my dotfile that could be messing with this? I posted my dotfile for reference at &lt;a href=&quot;https://gist.github.com/JuanCaicedo/9dd65f7c06618ca0b5409f5dcc18215f&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/JuanCaicedo/9dd65f7c06618ca0b5409f5dcc18215f&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10940" LastActivityDate="2016-04-09T18:35:08.700" Title="Spacemacs home buffer not showing?" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21535" PostTypeId="1" AcceptedAnswerId="21565" CreationDate="2016-04-09T15:47:35.070" Score="3" ViewCount="500" Body="&lt;p&gt;I previously had the following script in a file called .emacs.d/emerge-for-git:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;emacs -Q $*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And In my .gitconfig:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[merge]&#xA;  tool = emerge&#xA;[mergetool &quot;emerge&quot;]&#xA;  path = /home/rovanion/.emacs.d/emerge-for-git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But wishing to improve upon that so that it would connect to the already running emacsclient  I ended up with the following lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;emacsclient -nw  --eval &quot;(emerge-files nil \&quot;$3\&quot; \&quot;$4\&quot; \&quot;${4}.out\&quot;)&quot;&quot;\&quot;)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that ended up saving the merged file to &lt;code&gt;source/path/path&lt;/code&gt; instead of &lt;code&gt;source/path&lt;/code&gt;. So to save myself some grey hairs, and posterity of course, I decided to ask you instead:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you hook up git to your emacsclient?&lt;/p&gt;&#xA;" OwnerUserId="2325" LastActivityDate="2018-01-12T12:48:00.403" Title="How do you hook up git to emerge through emacsclient?" Tags="|emacsclient|git|emerge|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21536" PostTypeId="2" ParentId="12927" CreationDate="2016-04-09T16:21:57.807" Score="7" Body="&lt;p&gt;I was a happy user of &lt;a href=&quot;http://www.mew.org/en/&quot; rel=&quot;noreferrer&quot;&gt;mew&lt;/a&gt; for many years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't used emacs for reading and writing mail for a long time now, so this information may well be outdated. Hopefully, more recent mew users can fill it in. For now, consider this answer a stub. (I'll make it community wiki, so others can edit it more freely.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First and foremost, in my experience, mew was &lt;em&gt;fast&lt;/em&gt;. I had no difficulty handling mailing lists with enormous traffic using mew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting up mew was a bit involved, especially as it uses (used?) &lt;code&gt;stunnel&lt;/code&gt; for creating encrypted connections to SMTP and IMAP servers. But basically, it just involves editing a file &lt;code&gt;~/.mew.el&lt;/code&gt; and setting up a directory for mew to keep its data in. Apart from &lt;code&gt;stunnel&lt;/code&gt; (and emacs, of course), it has no dependencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation seems adequate, though I often found myself looking in the wrong section. Maintenance seems to have slowed to a trickle, though. There are some bug fixes now and then, but no new features that I have noticed for a while.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-04-09T16:21:57.807" CommentCount="3" CommunityOwnedDate="2016-04-09T16:21:57.807" ContentLicense="CC BY-SA 3.0" />
  <row Id="21537" PostTypeId="2" ParentId="21416" CreationDate="2016-04-09T17:26:39.210" Score="4" Body="&lt;p&gt;You can change how the &lt;code&gt;*Completions*&lt;/code&gt; buffer is displayed by adding an entry to &lt;code&gt;display-buffer-alist&lt;/code&gt;. With the following snippet, Emacs will display the completions buffer in an existing non-current window, or failing that it will create a new window (if possible). In the scenario of 2 side-by-side windows, it will display the completions buffer in the inactive window.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(push '(&quot;\\*Completions\\*&quot;&#xA;        (display-buffer-use-some-window display-buffer-pop-up-window)&#xA;        (inhibit-same-window . t))&#xA;      display-buffer-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, your desired behavior is what I already get by default when running stock emacs 24.5 (e.g. &lt;code&gt;emacs-24.5 -Q -nw&lt;/code&gt;). If you're using Emacs 25, then maybe it is a deliberate change (just a guess). Otherwise, you should check if which part of your configuration changes the original behavior. For example, the package Popwin can cause it. Checking the value of &lt;code&gt;display-buffer-alist&lt;/code&gt; might point to the culprit.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-04-09T17:26:39.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21538" PostTypeId="2" ParentId="20877" CreationDate="2016-04-09T17:58:12.363" Score="1" Body="&lt;p&gt;As it turns out, this can be achieved by modifying &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/d6e164af0211eb18fad654d777549a019776e9ba/lisp/term.el#L1452-L1489&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;term-exec-1&lt;/code&gt;&lt;/a&gt;. (comments removed for brevity) &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nadvice/term-exec-1 (name buffer command switches)&#xA;  (let* ((environment&#xA;          (list&#xA;           (format &quot;TERM=%s&quot; term-term-name)&#xA;           (format &quot;TERMINFO=%s&quot; data-directory)&#xA;           (format term-termcap-format &quot;TERMCAP=&quot;&#xA;                   term-term-name term-height term-width)&#xA;           (format &quot;EMACS=%s (term:%s)&quot; emacs-version term-protocol-version)&#xA;           (format &quot;INSIDE_EMACS=%s,term:%s&quot; emacs-version term-protocol-version)&#xA;           (format &quot;LINES=%d&quot; term-height)&#xA;           (format &quot;COLUMNS=%d&quot; term-width)))&#xA;         (process-environment&#xA;          (append environment&#xA;                  process-environment))&#xA;         (tramp-remote-process-environment&#xA;          (append environment&#xA;                  tramp-remote-process-environment))&#xA;         (process-connection-type t)&#xA;         (coding-system-for-read 'binary))&#xA;    (apply 'start-file-process name buffer&#xA;       &quot;/bin/sh&quot; &quot;-c&quot;&#xA;       (format &quot;stty -nl echo rows %d columns %d sane 2&amp;gt;/dev/null;\&#xA;if [ $1 = .. ]; then shift; fi; exec \&quot;$@\&quot;&quot;&#xA;           term-height term-width)&#xA;       &quot;..&quot;&#xA;       command switches)))&#xA;&#xA;(advice-add 'term-exec-1 :override #'nadvice/term-exec-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As phils notes, this still has some issues (such as not correctly detecting the remote shell under certain circumstances), but it's more robust overall. For example, it should work with all &lt;code&gt;tramp&lt;/code&gt; methods that support asynchronous processes, which includes, &lt;code&gt;su&lt;/code&gt; and &lt;code&gt;sudo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Caveat&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should note that I did need to remove &lt;code&gt;(inhibit-eol-conversion t)&lt;/code&gt; from the &lt;code&gt;let&lt;/code&gt;, because the newlines were being incorrectly displayed in remote sessions. So far, I haven't seen anything break, but makes me ill-at-ease.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Path forward&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like this is generic enough to be submitted as a patch with a bit more work, but I'd honestly like to get &lt;a href=&quot;https://lists.gnu.org/archive/html/bug-gnu-emacs/2014-12/msg01005.html&quot; rel=&quot;nofollow&quot;&gt;bug#19455&lt;/a&gt; (which I submitted a patch for) squared away first.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-04-10T21:33:27.513" LastActivityDate="2016-04-10T21:33:27.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21539" PostTypeId="2" ParentId="21534" CreationDate="2016-04-09T18:35:08.700" Score="2" Body="&lt;p&gt;There is an error in your dotfile:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map [down-mouse-1] 'silence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should be in the &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; function instead of &lt;code&gt;dotspacemacs/user-init&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dotspacemacs/user-init&lt;/code&gt; function is called before any package is actually loaded whereas &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; is called after. In your case you need the variable &lt;code&gt;evil-motion-state-map&lt;/code&gt; to be defined so you have to put the expression in &lt;code&gt;user-config&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes due to lazy loading even in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; the variable may not be available, in those cases you have to use the macro &lt;code&gt;eval-after-load&lt;/code&gt; or &lt;code&gt;with-eval-after-load&lt;/code&gt; (if you are using emacs 24.4+).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To detect the error open the messages buffer with &lt;code&gt;SPC b b mess RET&lt;/code&gt; and search for &lt;code&gt;error&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2016-04-09T18:35:08.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21540" PostTypeId="1" CreationDate="2016-04-09T20:57:24.640" Score="6" ViewCount="1776" Body="&lt;p&gt;I'd like to completely disable my mouse in Spacemacs. Following the advice in &lt;a href=&quot;https://emacs.stackexchange.com/questions/21534/spacemacs-home-buffer-not-showing/21539#21539&quot;&gt;this answer&lt;/a&gt;, I set up the following in my .spacemacs file as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA;This function is called at the very end of Spacemacs initialization after&#xA;layers configuration. You are free to put any user code.&quot;&#xA;  ;;(add-hook 'after-change-major-mode-hook 'fci-mode)&#xA;  (add-hook 'change-major-mode-after-body-hook 'fci-mode)&#xA;  (neotree-show)&#xA;  (with-eval-after-load FILE&#xA;    ;; don't jump the cursor around in the window on clicking&#xA;    (define-key evil-motion-state-map [down-mouse-1] 'silence)&#xA;    ;; also avoid any '&amp;lt;mouse-1&amp;gt; is undefined' when setting to 'undefined&#xA;    (define-key evil-motion-state-map [mouse-1] 'silence)&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see this in the Help menu that &lt;code&gt;FILE&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;FILE is normally a feature name, but it can also be a file name,&#xA;  in case that file does not provide any feature.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But I'm not sure what value I should use here.&lt;/p&gt;&#xA;" OwnerUserId="10940" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2018-05-15T06:16:54.833" Title="How to disable mouse in Spacemacs" Tags="|spacemacs|mouse|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21541" PostTypeId="1" AcceptedAnswerId="21542" CreationDate="2016-04-09T21:54:12.103" Score="1" ViewCount="220" Body="&lt;p&gt;gitk has a feature where you select one commit, then right-click another and can choose to either &quot;Diff this -&gt; selected&quot; or &quot;Diff selected -&gt; this&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is something like this possible in &lt;code&gt;magit-log&lt;/code&gt;? Meaning, place point on a commit, press something, place point on another commit, and get a diff between the two commits?&lt;/p&gt;&#xA;" OwnerUserId="6695" LastActivityDate="2016-04-09T22:35:54.337" Title="magit equivalent of gitk's &quot;Diff this -&gt; selected&quot;" Tags="|magit|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21542" PostTypeId="2" ParentId="21541" CreationDate="2016-04-09T22:35:54.337" Score="2" Body="&lt;p&gt;Press &lt;kbd&gt;C-SPC&lt;/kbd&gt; (&lt;code&gt;set-mark-command&lt;/code&gt;), move to the other commit, and press &lt;kbd&gt;d d&lt;/kbd&gt;. Many other command that normally act on the thing at point, act on the things in the region instead when that is active. E.g. you could cherry-pick all commits in the region or stage all files in the region. &lt;kbd&gt;d d&lt;/kbd&gt; is actually a special case because it only does something with the commits &quot;at the edges of the region&quot; instead of all the commits in the region.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-04-09T22:35:54.337" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21544" PostTypeId="2" ParentId="21540" CreationDate="2016-04-10T06:33:06.633" Score="1" Body="&lt;p&gt;The variable &lt;code&gt;evil-motion-state-map&lt;/code&gt; turns out to be defined in &lt;code&gt;&quot;evil-state.el&quot;&lt;/code&gt;, as you have discovered. So you need to ensure that your code is run after that file is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;with-eval-after-load&lt;/code&gt; is just a thin wrapper around &lt;code&gt;eval-after-load&lt;/code&gt;. The latter documents the use of the &lt;code&gt;FILE&lt;/code&gt; argument more carefully. If you read it, you will realize that using &lt;code&gt;&quot;evil-states&quot;&lt;/code&gt; is more likely to succeed than using &lt;code&gt;&quot;evil-states.el&quot;&lt;/code&gt;. Even better, however, is to use &lt;code&gt;'evil-states&lt;/code&gt; (note the single quote). For, looking at &lt;a href=&quot;https://bitbucket.org/lyro/evil/src/41aa7c5943d9ecd3e19ff6e91b4339c929fb2b1f/evil-states.el?fileviewer=file-view-default&quot; rel=&quot;nofollow&quot;&gt;the source&lt;/a&gt;, I notice the expected line &lt;code&gt;(provide 'evil-states)&lt;/code&gt; at the bottom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To expand a bit on this, it is likely that the file is going to be loaded via &lt;code&gt;(require 'evil-states)&lt;/code&gt;. This will in turn become a call to &lt;code&gt;(load &quot;evil-states&quot;)&lt;/code&gt; – note the lack of the &lt;code&gt;.el&lt;/code&gt; extension. The code reponsible for loading will then look for code to run in the variable &lt;code&gt;after-load-alist&lt;/code&gt;. It will look for entries specified with the file name &lt;em&gt;as provided&lt;/em&gt;, namely &lt;code&gt;&quot;evil-states&quot;&lt;/code&gt;, and it will look for entries with the symbol &lt;code&gt;evil-states&lt;/code&gt;, because the file executed &lt;code&gt;(provide 'evil-states)&lt;/code&gt;. But it will &lt;em&gt;not&lt;/em&gt; look for &lt;code&gt;&quot;evil-states.el&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-04-10T06:33:06.633" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21545" PostTypeId="1" AcceptedAnswerId="21546" CreationDate="2016-04-10T09:00:29.690" Score="0" ViewCount="593" Body="&lt;p&gt;I am trying to run my python script with spacemacs + ipython on my remote machine.&#xA;I found this and works:&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/13385/running-ipython-remotely?newreg=8105e4277ba0483681c28e7ab483f966&quot;&gt;Running ipython remotely&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But with this approach, everytimes when I lose connection with remote machine ,the Python Buffer just dead(shows no process in this buffer). Then I have to re-open a python buffer, and re-run what I have run in previous python buffer. &#xA;This is kind of wasting time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to preserve Python buffer and automatic reconnect to it when network is reachable?&lt;/p&gt;&#xA;" OwnerUserId="11693" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-04-10T12:01:03.070" Title="Spacemacs with iPython remotely" Tags="|python|spacemacs|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21546" PostTypeId="2" ParentId="21545" CreationDate="2016-04-10T12:01:03.070" Score="0" Body="&lt;p&gt;No, it is not possible to reconnect to a remote process when the connection has disappeared. This would require to use mosh or similar instead of ssh for remote connection. Tramp does not support this.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-04-10T12:01:03.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21547" PostTypeId="1" AcceptedAnswerId="21553" CreationDate="2016-04-10T12:03:00.773" Score="0" ViewCount="1623" Body="&lt;p&gt;I recently installed Arch Linux on my new laptop. Shortly, afterwards, I also installed the X Window System and Emacs 24. I like the DejaVu Sans Mono font so I added it  to my &lt;code&gt;.Xresources&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;URxvt.font: xft:DejaVu Sans Mono:size=12&#xA;emacs.font: xft:DejaVu Sans Mono:size=12&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The font works perfectly for my terminal emulator URxvt, however when I start emacs this message popped up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs&#xA;     Font `xft:DejaVu Sans Mono:size=12` is not defined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Apparently Emacs was built with xft, as shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ldd `which emacs` | grep libXft&#xA;     libXft.so.2 =&amp;gt; /usr/lib/libXft.so.2 (0x00007f8498c37000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can the font not be defined in emacs?&lt;/p&gt;&#xA;" OwnerUserId="9638" LastEditorUserId="253" LastEditDate="2016-04-10T14:39:33.473" LastActivityDate="2016-04-10T16:05:38.733" Title="How do I select a default font?" Tags="|init-file|fonts|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21548" PostTypeId="2" ParentId="21547" CreationDate="2016-04-10T13:12:32.100" Score="0" Body="&lt;p&gt;You're confusing the font backend for the font naming syntax, probably because programs like &lt;code&gt;urxvt&lt;/code&gt; require you to prepend &lt;code&gt;xft:&lt;/code&gt; for specifying fonts by their family name.  See its manual for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs only accepts &lt;a href=&quot;https://en.wikipedia.org/wiki/X_logical_font_description&quot; rel=&quot;nofollow&quot;&gt;XLFD&lt;/a&gt;s in that file, so try &lt;code&gt;-*-DejaVu Sans Mono-*-*-*-*-12-*-*-*-*-*-*&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-04-10T13:12:32.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21549" PostTypeId="2" ParentId="21547" CreationDate="2016-04-10T14:38:33.520" Score="0" Body="&lt;p&gt;You can set the default font by customizing your &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Initial-Parameters.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;default-frame-alist&lt;/code&gt;&lt;/a&gt;.  In your &lt;code&gt;.emacs&lt;/code&gt; file, add the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist&#xA;             '(font . &quot;DejaVu Sans Mono-12&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-04-10T14:38:33.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21550" PostTypeId="1" CreationDate="2016-04-10T15:09:45.580" Score="1" ViewCount="84" Body="&lt;p&gt;I am using Ibuffer for better buffer management and the display format is set to elide long buffer names. This is good but sometimes I would also like to see the full name (like when positioning the point over the buffer entry). Is there a way to ask IBuffer to display the full name (non elided), lets say, in the minibuffer when the point is over a buffer line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of posts around on how to change the ibuffer format string to accommodate longer buffer names but this is not exactly the same thing: sometimes the buffer names (or the paths for example) are so long that they cannot reasonably fit the screen so leaving lots of space for them in the format string would be counter productive. However having a way to quickly see the full name would be great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; After some searching around: when the line below (where the minibuffer appears) is used to display a message then it is called &lt;em&gt;echo area&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a special &lt;em&gt;text property&lt;/em&gt; that is called &lt;em&gt;help-echo&lt;/em&gt; that is made especially for tool-tip style applications as described in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual&lt;/a&gt;. The hint assigned by ibuffer to these entries is the tool-tip that gets displayed on mouse hover:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mouse-1: mark this buffer&#xA;mouse-2: select this buffer&#xA;mouse-3: operate on this buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As described once again by the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Help-Echo.html&quot; rel=&quot;nofollow&quot;&gt;Emacs Manual&lt;/a&gt; this can be automatically displayed in the &lt;em&gt;echo area&lt;/em&gt; by setting &lt;strong&gt;help-at-pt-display-when-idle&lt;/strong&gt; to &lt;em&gt;t&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this would ruin mouse tool-tips; maybe one could/should implement this as a configurable option. Another option would be the &lt;strong&gt;point-entered&lt;/strong&gt; text property. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have only a very approximate idea of how to actually implement this change. Any suggestions are welcome.&lt;/p&gt;&#xA;" OwnerUserId="11692" LastEditorUserId="11692" LastEditDate="2016-04-10T23:08:49.217" LastActivityDate="2016-04-10T23:08:49.217" Title="Be able to see elided Ibuffer entries" Tags="|ibuffer|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21551" PostTypeId="1" CreationDate="2016-04-10T15:31:52.670" Score="8" ViewCount="200" Body="&lt;p&gt;When editing lisp code, I often end up with trailing parentheses scattered around (assuming &lt;code&gt;|&lt;/code&gt; is point):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun example-function ()&#xA;  (let ((x (+ 1 1)))&#xA;    (when x&#xA;      (message x)|&#xA;      )&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are there any convenience commands for fixing this? Either in core Emacs, paredit/smartparens, or other packages?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can press &lt;code&gt;)&lt;/code&gt; and &lt;code&gt;paredit-close-round&lt;/code&gt; will fix the next parenthesis, but I want to fix all of them in one command.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2016-04-10T16:34:50.853" LastActivityDate="2016-04-11T08:23:56.750" Title="Is there a command for tidying trailing parentheses?" Tags="|smartparens|paredit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21552" PostTypeId="1" CreationDate="2016-04-10T15:36:10.110" Score="6" ViewCount="430" Body="&lt;p&gt;Calling &lt;code&gt;org-preview-latex-fragment&lt;/code&gt; blocks user input for a second or two depending on the size of your fragment, and with universal args, converting all fragments in buffer can take minutes. It would be nice to have this be async, so I could continue to type while the conversion happens. I was pointed toward &lt;a href=&quot;https://github.com/jwiegley/emacs-async&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; package, but my elisp-fu is not up to par. What would it take to make this function work asynchronously?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-preview-latex-fragment (&amp;amp;optional subtree)&#xA;  &quot;Preview the LaTeX fragment at point, or all locally or globally.&#xA;If the cursor is in a LaTeX fragment, create the image and overlay&#xA;it over the source code.  If there is no fragment at point, display&#xA;all fragments in the current text, from one headline to the next.  With&#xA;prefix SUBTREE, display all fragments in the current subtree.  With a&#xA;double prefix arg \\[universal-argument] \\[universal-argument], or when \&#xA;the cursor is before the first headline,&#xA;display all fragments in the buffer.&#xA;The images can be removed again with \\[org-ctrl-c-ctrl-c].&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (unless buffer-file-name&#xA;    (user-error &quot;Can't preview LaTeX fragment in a non-file buffer&quot;))&#xA;  (when (display-graphic-p)&#xA;    (org-remove-latex-fragment-image-overlays)&#xA;    (save-excursion&#xA;      (save-restriction&#xA;        (let (beg end at msg)&#xA;          (cond&#xA;           ((or (equal subtree '(16))&#xA;                (not (save-excursion&#xA;                       (re-search-backward org-outline-regexp-bol nil t))))&#xA;            (setq beg (point-min) end (point-max)&#xA;                  msg &quot;Creating images for buffer...%s&quot;))&#xA;           ((equal subtree '(4))&#xA;            (org-back-to-heading)&#xA;            (setq beg (point) end (org-end-of-subtree t)&#xA;                  msg &quot;Creating images for subtree...%s&quot;))&#xA;           (t&#xA;            (if (setq at (org-inside-LaTeX-fragment-p))&#xA;                (goto-char (max (point-min) (- (cdr at) 2)))&#xA;              (org-back-to-heading))&#xA;            (setq beg (point) end (progn (outline-next-heading) (point))&#xA;                  msg (if at &quot;Creating image...%s&quot;&#xA;                        &quot;Creating images for entry...%s&quot;))))&#xA;          (message msg &quot;&quot;)&#xA;          (narrow-to-region beg end)&#xA;          (goto-char beg)&#xA;          (org-format-latex&#xA;           (concat org-latex-preview-ltxpng-directory (file-name-sans-extension&#xA;                                                       (file-name-nondirectory&#xA;                                                        buffer-file-name)))&#xA;           default-directory 'overlays msg at 'forbuffer&#xA;           org-latex-create-formula-image-program)&#xA;          (message msg &quot;done.  Use `C-c C-c' to remove images.&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2207" LastActivityDate="2016-04-10T15:36:10.110" Title="How can I wrap org-preview-latex-fragment to be async?" Tags="|org-mode|latex|preview-latex|async|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21553" PostTypeId="2" ParentId="21547" CreationDate="2016-04-10T16:05:38.733" Score="1" Body="&lt;p&gt;Stupid me, I had not installed the &lt;code&gt;ttf-dejavu&lt;/code&gt; package in Arch Linux. I got sidetracked by the fact that urxvt did not give me an error message, which lead me to believe that it was something wrong with emacs. &lt;/p&gt;&#xA;" OwnerUserId="9638" LastActivityDate="2016-04-10T16:05:38.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21554" PostTypeId="1" CreationDate="2016-04-10T17:09:52.517" Score="6" ViewCount="1918" Body="&lt;p&gt;I have a program which can run as a command in bash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I run the program in emacs, in some way similar to run emacs' command (i.e.M-x , e.g. M-x occur), instead of first explicitly running a shell in a buffer of emacs and then running the program in the shell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2016-04-12T09:34:28.617" Title="Run shell commands in emacs by something similar to M-x ...?" Tags="|commands|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21555" PostTypeId="2" ParentId="21554" CreationDate="2016-04-10T17:18:57.293" Score="14" Body="&lt;p&gt;&lt;code&gt;M-!&lt;/code&gt; runs the command &lt;code&gt;shell-command&lt;/code&gt;. This will prompt you for the actual command to run in the minibuffer, which then runs. You can run it in the background by putting a &lt;code&gt;&amp;amp;&lt;/code&gt; at the end, just as you would in a terminal. alternatively, you can use &lt;code&gt;M-&amp;amp;&lt;/code&gt;, &lt;code&gt;async-shell-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output from the shell command will be placed in a temporary buffer. If you want it inserted in the current buffer, use a prefix argument. (i.e., &lt;code&gt;C-u M-!&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very useful related function is &lt;code&gt;shell-command-on-region&lt;/code&gt;, bound to &lt;code&gt;M-|&lt;/code&gt; by default. This will run a shell command on the contents of the region. The output will go in a temporary buffer, or, as with &lt;code&gt;M-!&lt;/code&gt;, if you use a prefix argument the selected region will be replaced by the output of the shell command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://ftp.gnu.org/old-gnu/Manuals/emacs/html_node/emacs_443.html&quot;&gt;(emacs) Single Shell&lt;/a&gt; in the manual for more details.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-04-10T20:16:18.950" LastActivityDate="2016-04-10T20:16:18.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21556" PostTypeId="1" CreationDate="2016-04-10T17:53:20.383" Score="26" ViewCount="24786" Body="&lt;p&gt;I have an org-mode file, some sub-sections have some big paragraphs.&#xA;When I export as html the whole paragraphs are displayed as single lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that I have to put a '\\' on every line, a bit PITA, its around 4000 lines there. Is there any way, a parameter perhaps, that forces new line to each line that sits between paragraphs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;thx&lt;/p&gt;&#xA;" OwnerUserId="11696" LastActivityDate="2022-02-12T13:58:17.860" Title="org-mode , export , how to 'force' newline on lines between paragraphs?" Tags="|org-mode|org-export|newlines|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21557" PostTypeId="2" ParentId="21556" CreationDate="2016-04-10T18:31:08.110" Score="9" Body="&lt;p&gt;To separate paragraphs by a single line all you need is to add an empty line between each paragraph in your org-file like following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;First paragraph&#xA;&#xA;Second paragraph&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\\&lt;/code&gt; is only required to add additional empty lines.&lt;/p&gt;&#xA;" OwnerUserId="11510" LastActivityDate="2016-04-10T18:31:08.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21558" PostTypeId="1" AcceptedAnswerId="21767" CreationDate="2016-04-10T18:45:39.230" Score="1" ViewCount="248" Body="&lt;p&gt;I'm new to org mode and have been using &lt;a href=&quot;https://github.com/tbanel/orgaggregate&quot; rel=&quot;nofollow&quot;&gt;Orgtbl Aggregate&lt;/a&gt; for tables.  I import space-separated files as org tables, add an hline to make the first row into a header, name them with #+NAME (aside: is there a better way to name a table than to just write this tag by hand above it?) and then I use &lt;code&gt;org-insert-dblock:aggregate&lt;/code&gt; to aggregate data in a new table below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My header-names have periods in them because they are LaTeX pgfplots-friendly.  I can't use spaces, dashes, or underscores.  The MWE below shows that Aggregate doesn't like the periods, and exhibits unpredictable behaviour when I try escaped quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can/should aggregate dblock work with the periods (how) or should I simply clean my headers first (this is what I ended up doing)?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: mwe-table                                                                 |&#xA;| A | b.b | cc  |                                                                 |&#xA;|---+-----+-----|                                                                 |&#xA;| 1 |   3 |   4 |                                                                 |&#xA;| 1 |   4 |   5 |                                                                 |&#xA;| 2 |   6 |   7 |                                                                 |&#xA;| 2 |   8 |   9 |                                                                 |&#xA;#+BEGIN: aggregate :table &quot;mwe-table&quot; :cols &quot;A mean(b.b) mean('b.b') mean(\&quot;b.b\&quot;)&quot;&#xA;| A | mean(b.b)                 | mean('b.b')                    |   mean(&quot;b.b&quot;) ||&#xA;|---+---------------------------+--------------------------------+---------------||&#xA;| 1 | error(7, '&quot;Expected `)'&quot;) | error(6, '&quot;Expected a number&quot;) | 80.6666666667 ||&#xA;| 2 | error(7, '&quot;Expected `)'&quot;) | error(6, '&quot;Expected a number&quot;) | 80.6666666667 ||&#xA;#+END:                                                                            |&#xA;#+BEGIN: aggregate :table &quot;mwe-table&quot; :cols &quot;A mean(cc) mean(bb) mean(\'b.b\')&quot;   |&#xA;| A | mean(cc) | mean(bb)  | mean('b.b')                    |                     |&#xA;|---+----------+-----------+--------------------------------|                     |&#xA;| 1 |      4.5 | vmean(bb) | error(6, '&quot;Expected a number&quot;) |                     |&#xA;| 2 |        8 | vmean(bb) | error(6, '&quot;Expected a number&quot;) |                     |&#xA;#+END:                                                                            |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="2065" LastEditDate="2016-04-10T18:53:16.247" LastActivityDate="2016-04-21T21:00:25.930" Title="orgtbl-aggregate: how to handle periods (.) in column header names" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21559" PostTypeId="1" AcceptedAnswerId="21561" CreationDate="2016-04-10T19:35:23.597" Score="2" ViewCount="112" Body="&lt;p&gt;I know you can customize settings or set environmental variables to get emacs to use other shells in shell-mode (&lt;a href=&quot;https://emacs.stackexchange.com/questions/20254/how-can-i-use-a-different-shell-in-emacs-shell&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;https://masteringemacs.org/article/running-shells-in-emacs-overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;2&lt;/a&gt;). Is it possible to simply start a shell specifying which shell you want to use interactively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like: &lt;code&gt;M-x other-shell RET /path/to/csh RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or set up something in your init file to let you use other shells fairly easily without changing the default?&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2020-03-05T00:37:17.540" Title="Specify and use inferior shell only once" Tags="|shell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21561" PostTypeId="2" ParentId="21559" CreationDate="2016-04-10T20:04:30.553" Score="3" Body="&lt;p&gt;This appears to do the job:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun other-shell (explicit-shell-file-name)&#xA;  (interactive &quot;f&quot;)&#xA;  (if (called-interactively-p)&#xA;      (call-interactively #'shell)&#xA;    (shell)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This relies on &lt;code&gt;shell&lt;/code&gt; using the variable &lt;code&gt;explicit-shell-file-name&lt;/code&gt; as a first choice of the shell to be used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also relies on &lt;em&gt;not&lt;/em&gt; using lexical scoping.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-04-10T20:04:30.553" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21562" PostTypeId="2" ParentId="21521" CreationDate="2016-04-10T20:55:33.763" Score="1" Body="&lt;p&gt;Wow, this is embarrassing.  I was pressing &lt;code&gt;SPC f l&lt;/code&gt;, but apparently that is the problem.  &lt;code&gt;SPC f f&lt;/code&gt; is the correct keypress to find files. &lt;code&gt;SPC f l&lt;/code&gt; is for opening files in fundamental mode to reduce lag caused by syntax highlighting.&lt;/p&gt;&#xA;" OwnerUserId="11539" LastActivityDate="2016-04-10T20:55:33.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21563" PostTypeId="1" AcceptedAnswerId="21568" CreationDate="2016-04-11T02:22:51.010" Score="3" ViewCount="86" Body="&lt;p&gt;In emacs, i have a small text selected as shown in the picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RC3y2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RC3y2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i do &lt;code&gt;eval-buffer&lt;/code&gt;, i like the &lt;code&gt;kill-region&lt;/code&gt; to remove only the highlighted text. But this code empties the buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;this is a simple comment....&#xA;(message &quot;%s&quot; (region-active-p))&#xA;(kill-region (region-beginning) (region-end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doesn't &lt;code&gt;region-end&lt;/code&gt; retun the selection region's end?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2016-04-11T15:30:06.110" Title="kill-region deletes entire buffer content instead of selected text" Tags="|region|kill-ring|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21564" PostTypeId="2" ParentId="21551" CreationDate="2016-04-11T08:23:56.750" Score="7" Body="&lt;p&gt;&lt;kbd&gt;i&lt;/kbd&gt; (&lt;code&gt;lispy-tab&lt;/code&gt;) from &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;noreferrer&quot;&gt;lispy&lt;/a&gt; does just that. Below is a screenshot of an ERT test visualization (using &lt;kbd&gt;xv&lt;/kbd&gt; (&lt;code&gt;lispy-view-test&lt;/code&gt;)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UyJUG.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UyJUG.png&quot; alt=&quot;lispy-tab&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-04-11T08:23:56.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21565" PostTypeId="2" ParentId="21535" CreationDate="2016-04-11T12:54:05.160" Score="1" Body="&lt;p&gt;I got a somewhat working solution going. In my .gitconfig I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[mergetool &quot;emerge&quot;]&#xA;    prompt = false&#xA;    cmd = emerge &quot;$LOCAL&quot; &quot;$REMOTE&quot; &quot;$BASE&quot; &quot;$MERGED&quot;&#xA;trustExitCode = true&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in .local/bin/emerge&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;set -e&#xA;&#xA;local=$(readlink -f &quot;$1&quot;)&#xA;remote=$(readlink -f &quot;$2&quot;)&#xA;base=$(readlink -f &quot;$3&quot;)&#xA;merged=$(readlink -f &quot;$4&quot;)&#xA;&#xA;emacsclient -nw --eval &quot;(emerge-files-with-ancestor nil \&quot;$local\&quot; \&quot;$remote\&quot; \&quot;$base\&quot; \&quot;$merged\&quot;)&quot;&#xA;&#xA;! egrep -q '^(&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;|=======$|&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;|####### Ancestor)' &quot;$merged&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The remaining issue is that the emacsclient is not automatically killed when q is pressed.&lt;/p&gt;&#xA;" OwnerUserId="2325" LastEditorUserId="2325" LastEditDate="2018-01-12T12:48:00.403" LastActivityDate="2018-01-12T12:48:00.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21566" PostTypeId="1" AcceptedAnswerId="21576" CreationDate="2016-04-11T13:31:40.467" Score="6" ViewCount="4971" Body="&lt;pre&gt;&lt;code&gt;#+attr_latex: placement=[!htpb]&#xA;#+CAPTION: Some caption&#xA;[[../some-image.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;exports as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{figure}[htb]&#xA;\centering&#xA;\includegraphics[width=.9\linewidth]{../some-image.pdf}&#xA;\caption{Some caption}&#xA;\end{figure}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I end up having to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+latex:\begin{table}[!htpb]&#xA;[[../some-image.pdf]]&#xA;#+latex:\caption{Some caption}&#xA;#+latex:\end{table}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is kind of silly&lt;/p&gt;&#xA;" OwnerUserId="68" LastActivityDate="2016-04-12T08:01:55.383" Title="Placement option in org mode for tables and figures does not work" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21567" PostTypeId="1" CreationDate="2016-04-11T14:06:59.840" Score="0" ViewCount="44" Body="&lt;p&gt;When I do &lt;code&gt;org-insert-link&lt;/code&gt; and input a link description the space before the description gets deleted. Can this be prevented?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I type: &lt;strong&gt;&quot;see &quot;&lt;/strong&gt; (i.e. with space), then hit &lt;code&gt;C-c C-l&lt;/code&gt;, insert link, description: &lt;strong&gt;&quot;here&quot;&lt;/strong&gt;. &#xA;The result is:&#xA;&lt;strong&gt;&quot;seehere&quot;&lt;/strong&gt; instead of intended &lt;strong&gt;&quot;see here&quot;&lt;/strong&gt; (with space between the words).&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2016-04-11T14:06:59.840" Title="Don't delete leading space after org-insert-link" Tags="|org-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21568" PostTypeId="2" ParentId="21563" CreationDate="2016-04-11T15:30:06.110" Score="6" Body="&lt;p&gt;As the comments suggest, &lt;code&gt;eval-buffer&lt;/code&gt; manipulates the position of point, so that by the time you call &lt;code&gt;kill-region&lt;/code&gt;, &lt;code&gt;region-beginning&lt;/code&gt; and &lt;code&gt;region-end&lt;/code&gt; are no longer what they were when you started. The position of point is 'preserved', as @ColinBell points out, but in this case that means that point is moved during &lt;code&gt;eval-buffer&lt;/code&gt;, and then restored to it's original value when it's done. So from the user's perspective, it doesn't change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eval-buffer&lt;/code&gt; really doesn't make sense for code that is intended to modify the buffer itself. There's almost certainly a more appropriate way to do what you want.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-11T15:30:06.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21569" PostTypeId="2" ParentId="27" CreationDate="2016-04-11T15:31:45.193" Score="2" Body="&lt;p&gt;I have a tiny script in my path on the remote host at &lt;code&gt;~/bin/ec&lt;/code&gt;, shorthand for emacsclient.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;&#xA;params=()&#xA;for p in &quot;$@&quot;; do&#xA;  if [ &quot;$p&quot; == &quot;-n&quot; ]; then&#xA;    params+=( &quot;$p&quot; )&#xA;  elif [ &quot;${p:0:1}&quot; == &quot;+&quot; ]; then&#xA;    params+=( &quot;$p&quot; )&#xA;  else&#xA;    params+=( &quot;/ssh:z:&quot;$(readlink -f $p) )&#xA;  fi&#xA;done&#xA;emacsclient --server-file=$HOME/.emacs.d/server/server &quot;${params[@]}&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This script passes &lt;code&gt;-n&lt;/code&gt; and &lt;code&gt;+&lt;/code&gt; args unchanged to emacsclient, otherwise args are treated as files for your local Emacs to open. Each file is prefixed with the TRAMP protocol and host so Emacs knows how to open it. You might be able to change &lt;code&gt;ssh:&lt;/code&gt; to a different TRAMP protocol if you prefer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You must replace &lt;code&gt;z&lt;/code&gt; with the hostname of your remote machine. This is used by local Emacs to connect via TRAMP. (You might be able to use &lt;code&gt;hostname&lt;/code&gt; here for generality. I prefer to use tiny entries like &lt;code&gt;z&lt;/code&gt; in my local &lt;code&gt;ssh_config&lt;/code&gt; for brevity, and the remote has no idea I'm doing this. Try it!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;ec file&lt;/code&gt; in the remote shell opens file in local Emacs and waits&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ec -n file&lt;/code&gt; in the remote shell opens file in local Emacs and returns&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;export EDITOR=~/bin/ec&lt;/code&gt; in remote &lt;code&gt;.bashrc&lt;/code&gt; makes the magic happen&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To ensure my &lt;code&gt;server&lt;/code&gt; file is good I have this in my local &lt;code&gt;.emacs&lt;/code&gt;, again using the tiny hostname &lt;code&gt;z&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq server-use-tcp t&#xA;      server-port    9999)&#xA;(defun server-start-and-copy ()&#xA;  &quot;Start server and copy server file to remote box.&quot;&#xA;  (interactive)&#xA;  (server-start)&#xA;  (copy-file &quot;~/.emacs.d/server/server&quot; &quot;/z:.emacs.d/server/server&quot; t)&#xA;  (chmod &quot;/z:.emacs.d/server/server&quot; (string-to-number &quot;644&quot; 8))&#xA;  )&#xA;(add-hook 'emacs-startup-hook 'server-start-and-copy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Port 9999 is a RemoteForward. I put this in my local &lt;code&gt;~/.ssh/ssh_config&lt;/code&gt; to automate the forwarding, plus the ControlMaster stuff for speed.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host z&#xA;HostName dev.example.com&#xA;User dev&#xA;ControlMaster auto&#xA;ControlPath ~/.ssh/z.sock&#xA;RemoteForward 9999 localhost:9999&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, make sure TRAMP knows about your &lt;code&gt;ssh_config&lt;/code&gt; if you use it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;(tramp-set-completion-function &quot;ssh&quot;&#xA;  '((tramp-parse-sconfig &quot;~/.ssh/config&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11707" LastEditorUserId="11707" LastEditDate="2016-04-11T15:39:14.307" LastActivityDate="2016-04-11T15:39:14.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21570" PostTypeId="1" CreationDate="2016-04-11T17:43:51.657" Score="1" ViewCount="1530" Body="&lt;p&gt;I've been upgraded at work to a Windows 10 machine, from Windows 7. Apparently, this has caused problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, eshell doesn't seem to be able to launch windows processes anymore. I get &quot;Spawning child process: Exec format error&quot;. Googling around doesn't seem to give me anything useful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, when I compile, I launch an external command into a build system, which actually runs a batch file in the end. For some annoying reason, this is opening a cmd window with the output, instead of it being captured in emacs' compile buffer (all I get in the compile buffer is the command being issued, and then the error code). That means I don't get a chance to parse the output and see what broke. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried running with no init file, but the same behaviour persists, so at the very least, my .emacs is not interfering, but it's certainly not making things better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Interesting note--some executables can't be run by cygwin in windows 10. They don't have a usable set of permissions, and even after I &quot;chmod 777&quot;, bash claims that permission is denied when I try to run them. Related? Not sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've included a chunk of my .emacs that might be pertinent.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;SHELL&quot; &quot;d:/Utilities/cygwin-64/bin/bash.exe&quot;) &#xA;(setenv &quot;PATH&quot; &quot;d:/Utilities/cygwin-64/bin;d:/Utilities/gnuwin/bin;~/bin;d:/Utilities/emacs-24.5/bin;d:/Utilities/Everything;c:/Windows/System32;c:/ubiperl/script;c:/Perl/bin;d:/Utilities/gnuGlobal/bin;d:/Utilities/sift&quot;) &#xA;(setenv &quot;MANPATH&quot; &quot;d:/Utilities/cygwin-64/usr/man/&quot;) &#xA;(setenv &quot;GTAGSFORCECPP&quot; &quot;&quot;)&#xA;(setq exec-path (append exec-path '(&quot;d:/Utilities/cygwin-64/bin&quot;)))&#xA;(setq exec-path (append exec-path '(&quot;d:/Utilities/Everything&quot;)))&#xA;(setq exec-path (append exec-path '(&quot;d:/Utilities/gnuwin/bin&quot;)))&#xA;(setq exec-path (append exec-path '(&quot;d:/Utilities/gnuGlobal/bin&quot;)))&#xA;(setq exec-path (append exec-path '(&quot;d:/Utilities/emacs-24.5/bin&quot;)))&#xA;(setq exec-path (append exec-path '(&quot;d:/Utilities/sift&quot;)))&#xA;(setq project-grep-path '(&quot;e:/assassin/ace/dev/source/scimitar&quot;) )&#xA;&#xA;(setq using-unix-filesystems t) &#xA;(setq shell-file-name &quot;cmdproxy&quot;) &#xA;(setq explicit-shell-file-name &quot;bash.exe&quot;) &#xA;(setq shell-command-switch &quot;/C&quot;) &#xA;(setq archive-zip-use-pkzip nil) &#xA;;;(setq w32-quote-process-args ?\&quot;) &#xA;(setq w32-enable-italics t) &#xA;(setq comint-process-echoes nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8254" LastEditorUserId="8254" LastEditDate="2016-04-11T18:45:34.313" LastActivityDate="2019-05-05T07:15:23.263" Title="Windows 10 + Emacs shell--can't run processes from eshell; unwanted cmd windows open" Tags="|microsoft-windows|shell|eshell|process|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21571" PostTypeId="1" AcceptedAnswerId="21583" CreationDate="2016-04-11T19:02:30.113" Score="1" ViewCount="4024" Body="&lt;p&gt;I can execute the function &lt;code&gt;neotree-toggle&lt;/code&gt; with M-x. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, none of these result in opening neotree, like described &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/Keybindings.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html#Init-Rebinding&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-e&quot; ) 'neotree-toggle)&#xA;(global-set-key &quot;C-e&quot; 'neotree-toggle)&#xA;(global-set-key (kbd &quot;\C-e&quot; ) 'neotree-toggle)&#xA;(global-set-key &quot;\C-e&quot; 'neotree-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where is my mistake? I don't see it.&lt;/p&gt;&#xA;" OwnerUserId="11174" LastActivityDate="2016-04-12T13:36:06.590" Title="Why does my keybinding not work?" Tags="|key-bindings|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21572" PostTypeId="2" ParentId="21571" CreationDate="2016-04-11T19:35:01.267" Score="0" Body="&lt;p&gt;I had some problems with gtags mode map at some point. I wanted to override the keybinding and use the helm-gtags key instead. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ggtags-mode-map (kbd &quot;M-.&quot;) 'helm-gtags-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since what you've tried to do isn't working with a global setting, it may be shadowed by a local setting or a local map. If you find that it's just a local binding, you can use local-set-key in a mode hook to override it. If it's in a mode specific map, you can use the code above as a template for your rebinding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: changed the answer based on the culprit more likely being a local binding shadowing the new global setting.&lt;/p&gt;&#xA;" OwnerUserId="8254" LastEditorUserId="8254" LastEditDate="2016-04-11T22:57:27.193" LastActivityDate="2016-04-11T22:57:27.193" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21573" PostTypeId="1" CreationDate="2016-04-11T20:56:54.597" Score="1" ViewCount="93" Body="&lt;p&gt;I have my classes scheduled using diary style time intervals like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 10:30-13:00 Classes&#xA;    &amp;lt;%%(and (diary-block 3 7 2016 6 29 2016) (= 3 (calendar-day-of-week date)) (not (diary-block 3 25 2016 4 1 2016)) (not (calendar-date-equal '(4 6 2016) date)))&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They are shown in agenda correctly like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;school:    10:30-13:00 Classes                                    :tag1:tag2::&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to count its repetitions and make repetition count visible in agenda view this way (or similar):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;school:    (12/23): 10:30-13:00 Classes                           :tag1:tag2::&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By the way, this wanted format in agenda is already available when you make an event that extends over few days in a row. So, this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some&#xA;  &amp;lt;2016-04-10 sun&amp;gt;--&amp;lt;2016-04-13 wed&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will show up in agenda just like I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;school:   (3/4):  Some&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to make my classes event show its repetition count in agenda view?&lt;/p&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-04-11T20:56:54.597" Title="Count repetitions of repetitive events in org mode agenda" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21574" PostTypeId="1" AcceptedAnswerId="21580" CreationDate="2016-04-12T05:56:18.903" Score="1" ViewCount="119" Body="&lt;p&gt;In my company we use a Git extension which has command-line interface that requires interaction (answering prompt).  I would like to extend Magit to be able to deal with our extension.  Unlike most of Magit functionality, this has to actually interact with the Git process by collecting users' input (this is company's policy, something to prevent automatic submissions, questionable as it may be, isn't a subject to change).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, in the future, I'd write a proper extension with a dedicated buffer and, font-faces and key-bindings, but for now, I'd be happy with just the ability to answer yes/no to the prompt. &lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-04-12T09:46:53.470" Title="Can magit-git-command use Emacs mini-buffer when prompted?" Tags="|magit|shell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21575" PostTypeId="1" AcceptedAnswerId="21578" CreationDate="2016-04-12T05:58:18.543" Score="15" ViewCount="2106" Body="&lt;p&gt;The variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html#Safe-File-Variables&quot;&gt;&lt;code&gt;safe-local-variable-values&lt;/code&gt;&lt;/a&gt; can store name/value pairs that are safe as file-local or directory-local. However sometimes I want to say &lt;em&gt;any&lt;/em&gt; value is valid for a given variable. The manual page I linked to says that any integer value is considered safe for &lt;code&gt;fill-column&lt;/code&gt;. Is there a way to do this for my own variables?&lt;/p&gt;&#xA;" OwnerUserId="5347" LastActivityDate="2016-04-12T08:44:07.153" Title="Mark a local variable safe for any value" Tags="|file-local-variables|local-variables|buffer-local|directory-local-variables|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21576" PostTypeId="2" ParentId="21566" CreationDate="2016-04-12T08:01:55.383" Score="9" Body="&lt;p&gt;&lt;code&gt;#+ATTR_LaTeX:&lt;/code&gt; syntax differs among Org-mode versions.&#xA;You don't need &lt;code&gt;=&lt;/code&gt; in org-mode ver 8.&#xA;I hope following works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: Some caption&#xA;#+NAME: Some-label-here&#xA;#+ATTR_LaTeX: :height 5cm :placement [!htpb]&#xA;#+ATTR_HTML: :width 480&#xA;file:images/some-image.pdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8634" LastActivityDate="2016-04-12T08:01:55.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21577" PostTypeId="1" AcceptedAnswerId="21581" CreationDate="2016-04-12T08:31:06.970" Score="0" ViewCount="96" Body="&lt;p&gt;I am trying to run tests for a project called omnisharp-emacs. When I do so the following warning appears:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning: Lisp directory `/usr/local/Cellar/emacs/24.5/share/emacs/24.5/lisp/emacs-parallel': No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs was installed on MacOsX using brew, and is up to date. I have not idea what is that emacs-parallel. Haven't found any information, on searches, and doesn't appear on elpa, melpa, melpa stable, or marmalade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anybody explain me what it is (or point to where it is explained), and how to install it?&lt;/p&gt;&#xA;" OwnerUserId="10490" LastActivityDate="2016-04-12T11:52:27.650" Title="emacs-parallel not found" Tags="|osx|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21578" PostTypeId="2" ParentId="21575" CreationDate="2016-04-12T08:44:07.153" Score="22" Body="&lt;p&gt;Set the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Local-Variables.html#index-safe-local-variable&quot;&gt;&lt;code&gt;safe-local-variable&lt;/code&gt; property&lt;/a&gt; to a function that validates the value. For example, &lt;code&gt;fill-column&lt;/code&gt; has a &lt;code&gt;safe-local-variable&lt;/code&gt; property set to &lt;code&gt;integerp&lt;/code&gt;. Use &lt;code&gt;(lambda (x) t)&lt;/code&gt; as the validation function if any value is valid.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-variable-with-any-safe-value …)&#xA;(put 'my-variable-with-any-safe-value 'safe-local-variable&#xA;     (lambda (x) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom my-variable-with-any-safe-value …&#xA;  :safe (lambda (x) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Having &lt;em&gt;any&lt;/em&gt; valid value is pretty rare. It's far more common to restrict to a specific type, e.g. &lt;code&gt;integerp&lt;/code&gt;, &lt;code&gt;stringp&lt;/code&gt;, etc.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-04-12T08:44:07.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21579" PostTypeId="2" ParentId="21554" CreationDate="2016-04-12T09:34:28.617" Score="3" Body="&lt;p&gt;As mentioned in another answer, &lt;code&gt;shell-command&lt;/code&gt; and&#xA;&lt;code&gt;async-shell-command&lt;/code&gt; are the generic way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are also a few tools that can be better in specific contexts.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;counsel-linux-app&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This one will give you a completion similar to your DE's start menu,&#xA;allowing to start a usually graphical application, provided it has a&#xA;configured &lt;code&gt;*.desktop&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Available from the &lt;code&gt;counsel&lt;/code&gt; package on MELPA and &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;make-it-so&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you have a complicated recipe for transforming a file or a set of&#xA;files into other files,&#xA;&lt;a href=&quot;https://github.com/abo-abo/make-it-so&quot; rel=&quot;nofollow&quot;&gt;make-it-so&lt;/a&gt; might be useful&#xA;for you. It's on MELPA as well.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-04-12T09:34:28.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21580" PostTypeId="2" ParentId="21574" CreationDate="2016-04-12T09:46:53.470" Score="2" Body="&lt;p&gt;magit already look for prompt that ask yes/no question to let user answer them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It need the prompt to end by something like &quot; [Yes/No]:&quot;, &quot; (Yes|No)?: &quot; or &quot;[y|n]:&quot;. Look at the regexp in &lt;code&gt;magit-process-yes-or-no-prompt-regexp&lt;/code&gt; for prompt that will be handle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you want to change magit-process-yes-or-no-prompt-regexp, you have to be extra careful, because magit use groups in the regexp to find if it must answer &quot;yes&quot; or &quot;y&quot; to the process.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastActivityDate="2016-04-12T09:46:53.470" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21581" PostTypeId="2" ParentId="21577" CreationDate="2016-04-12T11:52:27.650" Score="1" Body="&lt;p&gt;Most likely, the package assumes that you have the external package &lt;code&gt;emacs-parallel&lt;/code&gt; installed. You can get it from &lt;a href=&quot;https://github.com/daimrod/emacs-parallel&quot; rel=&quot;nofollow&quot;&gt;its GitHUB page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-04-12T11:52:27.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21582" PostTypeId="1" AcceptedAnswerId="21593" CreationDate="2016-04-12T12:59:48.133" Score="1" ViewCount="267" Body="&lt;p&gt;I am using multi-term and would like to create a helm source which displays all my open terminals. There is a list of all terminal buffers called &quot;multi-term-buffer-list&quot;, but I can't get this list into the candidates for the helm source. I tried several combinations along these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq some-helm-source&#xA;  '((name . &quot;Terminal Buffers&quot;)&#xA;    (candidates . multi-term-buffer-list)))&#xA;&#xA;(helm :sources '(some-helm-source))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to do this?&lt;/p&gt;&#xA;" OwnerUserId="11713" LastActivityDate="2016-04-14T15:35:19.963" Title="Create helm source containing multi-term buffers" Tags="|helm|multi-term|helm-sources|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21583" PostTypeId="2" ParentId="21571" CreationDate="2016-04-12T13:36:06.590" Score="0" Body="&lt;p&gt;I honestly don't know why, but &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\M-e&quot; 'neotree-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works, but&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-e&quot; 'neotree-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;not, when executed inside my &lt;code&gt;init.el&lt;/code&gt;. This effect is clearly reproducible, even when &lt;code&gt;global-set-key&lt;/code&gt; is manually executed. @Tyler suggested to use &lt;code&gt;C-h C-e&lt;/code&gt; which said for the second method at some time, its not defined. Unfortunately, i can't reproduce that and &lt;code&gt;C-h C-e&lt;/code&gt; just shows nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks anyways.&lt;/p&gt;&#xA;" OwnerUserId="11174" LastActivityDate="2016-04-12T13:36:06.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21584" PostTypeId="1" CreationDate="2016-04-12T14:11:32.180" Score="4" ViewCount="644" Body="&lt;p&gt;GNU Screen and Tmux can make processes survive user's logging out, and resume when logging back again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can Emacs be used for the same purpose, and how?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="11941" LastEditDate="2017-02-08T20:37:09.310" LastActivityDate="2017-02-10T07:15:45.993" Title="Can emacs be used for the same purpose of GNU Screen and Tmux?" Tags="|process|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21585" PostTypeId="1" AcceptedAnswerId="21591" CreationDate="2016-04-12T14:46:57.157" Score="1" ViewCount="442" Body="&lt;p&gt;I'm a happy Magit user, and at commit time, I am accustomed to editing a commit message and then finishing the edit with &lt;code&gt;C-c C-c&lt;/code&gt;.  But sometimes that key sequence winds up bound to the &lt;code&gt;compile&lt;/code&gt; function, as indeed my emacs init file contains the line &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-c\C-c&quot; 'compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My init file also sets that key locally in a number of modes including &lt;code&gt;c-mode&lt;/code&gt;, &lt;code&gt;sml-mode&lt;/code&gt;, &lt;code&gt;lua-mode&lt;/code&gt;, and so on.  &lt;em&gt;However&lt;/em&gt;, none of those modes is displayed on the mode line in the commit-edit window.  And when emacs is working correctly, &lt;code&gt;C-c C-c&lt;/code&gt; finishes the edit and returns to git as expected.  However, every so often it gets wacky and insists on being bound to &lt;code&gt;compile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following a trail of emacs lisp leads a very short distance to where Magit invokes git with &lt;code&gt;$EMACSCLIENT&lt;/code&gt; set appropriately.  Beyond that point I have been unable to diagnose how that buffer is created or where its keybindings are determined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I'm trying to solve is to &lt;strong&gt;set the keybindings in the commit-message edit buffer so that &lt;code&gt;C-c C-c&lt;/code&gt; terminates the edit and returns control to git.&lt;/strong&gt;   At the moment, the only way I can do this is to exit emacs and start over.  That workaround doesn't last long, and it grows tiresome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would welcome answers to any or all of the following questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Where are the keybindings set for that window?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What function is &lt;code&gt;C-c C-c&lt;/code&gt; bound to by default?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a mode or other hook where I can just reach in with a hammer and bind &lt;code&gt;C-c C-c&lt;/code&gt; to the right function?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Addendum: the buffer's major mode is &lt;code&gt;text-mode&lt;/code&gt;. Here is the response to &lt;code&gt;C-h v major-mode RET&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Its value is text-mode&#xA;Original value was fundamental-mode&#xA;Local in buffer COMMIT_EDITMSG; global value is fundamental-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9343" LastEditorUserId="105" LastEditDate="2016-04-13T02:05:51.127" LastActivityDate="2016-04-13T02:05:51.127" Title="What determines key bindings in the Magit commit window?" Tags="|key-bindings|magit|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21586" PostTypeId="2" ParentId="21584" CreationDate="2016-04-12T15:18:03.427" Score="1" Body="&lt;p&gt;You can run emacs in server mode, and then connect and disconnect clients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each client you start (either graphic or on a terminal) will produce a new frame, normally opening a new file or buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is similar to screen or tmux in the sense that you have the emacs process persistent across client connections. But you won't get the exact screen rendering each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally use screen, and launch emacs clients as needed.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-04-12T15:18:03.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21588" PostTypeId="1" AcceptedAnswerId="21590" CreationDate="2016-04-12T15:32:31.687" Score="2" ViewCount="1358" Body="&lt;p&gt;Basically, i want my emacs to run &lt;code&gt;latex-preview-pane-mode&lt;/code&gt; (which is a emacs function, provided by &lt;a href=&quot;https://github.com/jsinglet/latex-preview-pane&quot; rel=&quot;nofollow&quot;&gt;this package&lt;/a&gt;) instead of executing the external application &lt;code&gt;evince&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading &lt;a href=&quot;http://www.gnu.org/software/auctex/manual/auctex.html#Viewing&quot; rel=&quot;nofollow&quot;&gt;the acutex docs about this&lt;/a&gt;, i have now this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; '(TeX-view-program-list&#xA;   (quote&#xA;    ((&quot;preview-pane-mode&quot;&#xA;      (latex-preview-pane-mode)&#xA;      nil))))&#xA; '(TeX-view-program-selection&#xA;   (quote&#xA;    (((output-dvi has-no-display-manager)&#xA;      &quot;dvi2tty&quot;)&#xA;     ((output-dvi style-pstricks)&#xA;      &quot;dvips and gv&quot;)&#xA;     (output-dvi &quot;xdvi&quot;)&#xA;     (engine-omega &quot;Atril&quot;)&#xA;     (output-pdf &quot;Evince&quot;)&#xA;     (output-html &quot;xdg-open&quot;)))))&#xA;(custom-set-faces))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The part after &lt;code&gt;'(TeX-view-program-selection&lt;/code&gt; works fine, it's the not-changed default. However, i don't know how to proceed, because obviously &lt;code&gt;evince&lt;/code&gt; is a actual binary program and &lt;code&gt;latex-preview-pane-mode&lt;/code&gt; a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After changing &lt;code&gt;(output-pdf &quot;Evince&quot;)&lt;/code&gt; to &lt;code&gt;(output-pdf 'latex-preview-pane-mode)&lt;/code&gt;, i receive the error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TeX-view-command-raw: Unknown latex-preview-pane-mode viewer. Check the&#xA;`TeX-view-program-selection' variable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When i change it to &lt;code&gt;(output-pdf &quot;preview-pane-mode&quot;)&lt;/code&gt; and execute it, my emacs is hanging.&lt;/p&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="5213" LastEditDate="2016-04-30T12:49:44.630" LastActivityDate="2016-04-30T12:49:44.630" Title="Set latex-preview-pane-mode as default pdf-viewer for acutex" Tags="|auctex|preview-latex|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21589" PostTypeId="2" ParentId="21558" CreationDate="2016-04-12T17:47:57.800" Score="1" Body="&lt;p&gt;Funny column names have just not been anticipated. This can be a useful&#xA;new feature. Your proposed syntax (single or double quotes) seems the&#xA;way to go. I will look at how to implement that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The unexpected behavior you see when computing &lt;code&gt;mean(\&quot;b.b\&quot;)&lt;/code&gt; is&#xA;actually &lt;code&gt;mean([98,46,98])&lt;/code&gt;, which happen to be the ascii codes of &lt;code&gt;b . b&lt;/code&gt;.&#xA;Of course, this is hardly the expected result).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The author of orgtbl-aggregate&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="11716" LastActivityDate="2016-04-12T17:47:57.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21590" PostTypeId="2" ParentId="21588" CreationDate="2016-04-12T17:50:09.057" Score="2" Body="&lt;p&gt;From docstring of &lt;code&gt;TeX-view-program-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The second element can be a command line to be run as a process or a Lisp function to be executed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you have to specify the name of the function (&lt;code&gt;latex-preview-pane-mode&lt;/code&gt;), not a function call (&lt;code&gt;(latex-preview-pane-mode)&lt;/code&gt;).  This is the specification for &lt;code&gt;&quot;preview-pane-mode&quot;&lt;/code&gt; you have to use:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(&quot;preview-pane-mode&quot;&#xA;    latex-preview-pane-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To avoid confusion, the full code you can add to your init file to add this entry to &lt;code&gt;TeX-view-program-list&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;tex&quot;&#xA;  '(add-to-list&#xA;    'TeX-view-program-list&#xA;    '(&quot;preview-pane-mode&quot;&#xA;      latex-preview-pane-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in &lt;code&gt;TeX-view-program-selection&lt;/code&gt; pick up &lt;code&gt;&quot;preview-pane-mode&quot;&lt;/code&gt;, not &lt;code&gt;'latex-preview-pane-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2016-04-13T20:49:06.147" LastActivityDate="2016-04-13T20:49:06.147" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21591" PostTypeId="2" ParentId="21585" CreationDate="2016-04-12T18:09:07.727" Score="1" Body="&lt;p&gt;Thanks to commenters, this is what I was able to learn:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Some keybindings were set by an overeager &lt;code&gt;after-change-major-mode-hook&lt;/code&gt;, which doubtless was a workaround for a legacy bug somewhere.  (The question of where the &lt;em&gt;correct&lt;/em&gt; keybinding is set remains unanswered.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The function bound by default is &lt;code&gt;with-editor-finish&lt;/code&gt;, which I eventually discovered by starting with &lt;code&gt;emacs -q&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I reached in with the hammer of &lt;code&gt;after-change-major-mode-hook&lt;/code&gt;, or rather, I made the hammer that I already found there hit with a little less force.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Of the resources named in the comments, &lt;a href=&quot;https://emacs.stackexchange.com/questions/653/how-can-i-find-out-in-which-keymap-a-key-is-bound&quot;&gt;How can I find out in which keymap a key is bound?&lt;/a&gt; provided no useful information&amp;mdash;lots of things were set to &lt;code&gt;nil&lt;/code&gt;.   But looking at the major and minor modes were most excellent hints!&lt;/p&gt;&#xA;" OwnerUserId="9343" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-04-12T18:09:07.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21592" PostTypeId="1" CreationDate="2016-04-12T18:57:08.253" Score="7" ViewCount="102" Body="&lt;p&gt;Is there a way to create something similar to the location pane from win merge in ediff?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QhDsD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QhDsD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not having this is about the only reason I use win merged instead of ediff.&lt;/p&gt;&#xA;" OwnerUserId="10739" LastEditorUserId="304" LastEditDate="2016-07-27T00:14:40.757" LastActivityDate="2016-07-27T00:14:40.757" Title="Ediff location pane" Tags="|window|ediff|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21593" PostTypeId="2" ParentId="21582" CreationDate="2016-04-13T00:23:06.437" Score="2" Body="&lt;p&gt;First, check out the &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki/Developing&quot; rel=&quot;nofollow&quot;&gt;wiki on developing for Helm&lt;/a&gt;. If you find anything unclear, be sure to create an issue and explain it clearly so others can benefit!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use &lt;code&gt;multi-term&lt;/code&gt;, but it seems that the problem is that &lt;code&gt;multi-term-buffer-list&lt;/code&gt; returns a list of buffers. Helm needs a list of strings to display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you need is a list of candidates of the form &lt;code&gt;(display . candidate)&lt;/code&gt;, where &lt;code&gt;display&lt;/code&gt; is a string to display and &lt;code&gt;candidate&lt;/code&gt; is the actual object (in this case, a process) to take actions on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(helm :sources&#xA;      (helm-build-sync-source &quot;Multi-term buffers&quot;&#xA;        :candidates (mapcar (lambda (buffer)&#xA;                              (cons (buffer-name buffer) buffer))&#xA;                            multi-term-buffer-list)&#xA;        :action '((&quot;Switch to buffer&quot; . switch-to-buffer))))                     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="3889" LastEditDate="2016-04-13T04:48:21.000" LastActivityDate="2016-04-13T04:48:21.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21594" PostTypeId="1" CreationDate="2016-04-13T06:39:25.593" Score="2" ViewCount="83" Body="&lt;p&gt;So I'm fairly competent with org-mode, and I make constant use of custom templates. I'm just now exploring the idea of integrating capture into my programming work flow so I can whip up skeletons quickly and worry about details later. That being said, I've devised a template as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;p&quot; &quot;Programming TODO&quot; entry&#xA;            (file+headline &quot;~/orgfiles/personalorg.org&quot; &quot;Tasks&quot;)&#xA;            &quot;* %^{Description} &#xA;             %i%a&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to be working pretty well, except that whenever I try to click on the link it generates, I get a coderef error if there's real data there, or whatever the first match was if I capture on something like a comment. Since I can't seem to anchor the captures back to a point in the file, it's not very much more useful than just putting &quot;TODO&quot;s into the comments near the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain what's going on here, and how I should work around this?&lt;/p&gt;&#xA;" OwnerUserId="9315" LastActivityDate="2016-04-13T06:39:25.593" Title="Trouble with link to position in current file when capturing" Tags="|org-mode|org-capture|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21595" PostTypeId="1" CreationDate="2016-04-13T08:04:23.470" Score="1" ViewCount="324" Body="&lt;p&gt;I setup flymake with pep8 to validate style of python files&#xA;with the following configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (load &quot;flymake&quot; t)&#xA; (defun flymake-pylint-init ()&#xA;   (let* ((temp-file (flymake-init-create-temp-buffer-copy&#xA;                      'flymake-create-temp-inplace))&#xA;          (local-file (file-relative-name&#xA;                       temp-file&#xA;                       (file-name-directory buffer-file-name))))&#xA;         (list &quot;pep8&quot; (list &quot;--repeat&quot; local-file))))&#xA;&#xA; (add-to-list 'flymake-allowed-file-name-masks&#xA;              '(&quot;\\.py\\'&quot; flymake-pylint-init)))&#xA;&#xA;(defun my-flymake-show-help ()&#xA;  (when (get-char-property (point) 'flymake-overlay)&#xA;    (let ((help (get-char-property (point) 'help-echo)))&#xA;      (if help (message &quot;%s&quot; help)))))&#xA;&#xA;(add-hook 'python-mode-hook&#xA;      '(lambda() (flymake-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It worked fine from the start. I just evaluated it in a &lt;em&gt;scratch&lt;/em&gt; buffer&#xA;and worked for several weeks, then I suddenly closed Emacs and&#xA;after that restart messages are not shown when you navigate to&#xA;a problem line, but these lines are still highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(message &quot;DDD&quot;) - works&lt;/p&gt;&#xA;&#xA;&lt;p&gt;pep8 works fine too in a terminal&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? I think I forgot some step.&lt;/p&gt;&#xA;" OwnerUserId="3866" LastActivityDate="2016-09-10T10:00:10.470" Title="flymake python pep8 error messages disappeared" Tags="|python|flymake|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21596" PostTypeId="2" ParentId="21595" CreationDate="2016-04-13T08:08:07.817" Score="1" Body="&lt;p&gt;At last I found that missing line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook 'my-flymake-show-help)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3866" LastActivityDate="2016-04-13T08:08:07.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21597" PostTypeId="1" AcceptedAnswerId="21598" CreationDate="2016-04-13T08:23:58.077" Score="24" ViewCount="10523" Body="&lt;p&gt;I normally use only a few git commands each time I want to commit changes to a repository:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ git add --all .&#xA;$ git commit -m &quot;update.&quot;&#xA;$ git push -u origin master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can magit be useful in this regard? &lt;code&gt;M-x magit-status&lt;/code&gt; seems helpful but I am not fulling understanding the language of &quot;staging/unstaging&quot; &quot;hunks&quot; etc. from &lt;a href=&quot;https://www.emacswiki.org/emacs/Magit&quot; rel=&quot;noreferrer&quot;&gt;ref1&lt;/a&gt; &lt;a href=&quot;https://www.masteringemacs.org/article/introduction-magit-emacs-mode-git&quot; rel=&quot;noreferrer&quot;&gt;ref2&lt;/a&gt; &lt;a href=&quot;https://magit.vc/manual/magit/Staging-and-unstaging.html&quot; rel=&quot;noreferrer&quot;&gt;ref3&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What might be the equivalent commands in &lt;code&gt;magit&lt;/code&gt;? Thanks in advance -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; This &lt;a href=&quot;http://jr0cket.co.uk/2012/12/driving-git-with-emacs-pure-magic-with.html.html&quot; rel=&quot;noreferrer&quot;&gt;page&lt;/a&gt; seems to speak better to my level but is &lt;code&gt;C-u s&lt;/code&gt; the equivalent of &lt;code&gt;git add --all .&lt;/code&gt;? Though that page says it does not work.&lt;/p&gt;&#xA;" OwnerUserId="2421" LastActivityDate="2021-05-24T16:43:20.550" Title="Using magit for the most basic add, commit, push" Tags="|magit|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21598" PostTypeId="2" ParentId="21597" CreationDate="2016-04-13T09:08:28.077" Score="44" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;S&lt;/kbd&gt; stages all files&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;c c&lt;/kbd&gt; initiates a commit. Write the message and then press &lt;kbd&gt;C-c C-c&lt;/kbd&gt; to actually create the commit.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;P u&lt;/kbd&gt; pushes to the upstream branch. In the popup that appears after you have pressed &lt;kbd&gt;P&lt;/kbd&gt; you can see the upstream. If the upstream is not set yet, then you can still use &lt;kbd&gt;P u&lt;/kbd&gt;. You'll be asked for a branch which is then configured as the upstream before pushing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-04-13T09:08:28.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21599" PostTypeId="2" ParentId="20984" CreationDate="2016-04-13T09:52:06.017" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/justbur/evil-magit&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;evil-magit&lt;/code&gt;&lt;/a&gt; is certainly a good choice. It is well maintained.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-04-16T18:53:11.110" LastActivityDate="2016-04-16T18:53:11.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21600" PostTypeId="1" CreationDate="2016-04-13T10:18:45.270" Score="1" ViewCount="156" Body="&lt;p&gt;I'm working on fulfilling a feature request for my package &lt;a href=&quot;https://github.com/aaron-em/ten-hundred-mode.el&quot; rel=&quot;nofollow&quot;&gt;ten-hundred-mode&lt;/a&gt; - specifically, that it provide a &quot;permissive&quot; option where it merely highlights impermissible words, rather than immediately removing them in the fashion of &lt;a href=&quot;https://github.com/mortenjust/cleartext-mac&quot; rel=&quot;nofollow&quot;&gt;Cleartext&lt;/a&gt;. I thought Flycheck would be a good method of doing this highlighting, and indeed it didn't take much effort to write a checker. But then I ran into some trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, it is not clear to me that a method exists of enabling this checker while not affecting whatever other checkers the user currently has active. That's important because I want to fulfill the same use case as &lt;code&gt;flyspell-prog-mode&lt;/code&gt;, and provide a minor mode which can identify and operate on only comments, strings, and docstrings in source code. To do that with a Flycheck checker, I need to be able to activate it without in any way modifying whatever collection of checkers, or none, the user has configured for herself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can see several ways of activating my checker when someone activates my minor mode. I haven't been able to find one which I'm certain will do so without potentially breaking the user's configuration. No doubt many people here know more than I do about Flycheck's internals. (That's not a high bar to clear.) If a way exists, perhaps such a person will point me in its direction.&lt;/p&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2018-12-01T04:05:31.050" Title="(De)activate a flycheck checker without disturbing those currently active" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21601" PostTypeId="1" AcceptedAnswerId="21692" CreationDate="2016-04-13T10:42:49.930" Score="1" ViewCount="70" Body="&lt;p&gt;In the course of writing a Flycheck checker for &lt;a href=&quot;https://github.com/aaron-em/ten-hundred-mode.el&quot; rel=&quot;nofollow&quot;&gt;ten-hundred-mode&lt;/a&gt;'s new (and as yet inchoate) permissive mode, I noticed that the checker's overlay behavior was influenced by the currently active syntax table in a way that didn't work out well for my purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Now they've done it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&quot;They've&quot; is not one of the thousand most commonly used words, and my checker will report it as an error at line 1, column 5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In text-mode, or a major mode which uses a syntax table derived from &lt;code&gt;text-mode-syntax-table&lt;/code&gt;, Flycheck will overlay as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Now &lt;strong&gt;they've&lt;/strong&gt; done it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is, of course, the correct behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a mode whose syntax table &lt;em&gt;doesn't&lt;/em&gt; derive from text-mode's, though -- notably, any programming mode -- Flycheck instead does this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Now they'&lt;strong&gt;ve&lt;/strong&gt; done it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This appears to occur because &lt;code&gt;'&lt;/code&gt; is a word-constituent character in text-mode-syntax-table and its derivatives, but not in the syntax tables of programming modes. I'm not certain why this affects overlay positioning, but my surmise is that Flycheck's method of inferring where a given overlay should end makes use of syntax classes. In any case, it's trivial to produce both correct and incorrect behavior by switching the syntax table or major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Since &quot;they&quot; is a permissible word, it's reasonable to suspect that the problem here lies with the checker's matching behavior, and not with Flycheck's overlaying behavior. Indeed, that was my initial suspicion, and I spent a couple of hours looking for a bug in my own code and not finding it, before being reluctantly forced to the conclusion that the problem lay elsewhere.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since my checker code only controls what problems are reported to Flycheck, and not how Flycheck chooses to overlay them, I'm somewhat at a loss for how to proceed here. In private code I could advise &lt;code&gt;flycheck-error-region-for-mode&lt;/code&gt; to conditionally wrap it in &lt;code&gt;with-syntax-table&lt;/code&gt;, or something like that, but this is a publicly distributed module, so advice is off the table. Unfortunately, I'm not seeing any other way to get the behavior I need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone with more knowledge of Flycheck's internals suggest a way in which I can produce correct overlay behavior regardless of the currently active syntax table?&lt;/p&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2016-04-18T15:59:29.280" Title="Flycheck and syntax tables: erroneous behavior I'm unsure how to fix" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21602" PostTypeId="2" ParentId="21164" CreationDate="2016-04-13T13:21:38.790" Score="24" Body="&lt;ol&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;r&lt;/kbd&gt; &lt;em&gt;(rebase)&lt;/em&gt; in Magit status buffer. This will display a pop-up buffer with more options.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;e&lt;/kbd&gt; &lt;em&gt;(elsewhere)&lt;/em&gt; to start rebasing on a different branch.&lt;/li&gt;&#xA;&lt;li&gt;Select the branch to rebase on by answering the prompt &lt;em&gt;(note: the selected branch is not modified, the current branch is)&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The rebase process will start and you will now have more options in rebase menu: &lt;kbd&gt;r&lt;/kbd&gt; to continue &lt;em&gt;(after resolving conflicts)&lt;/em&gt;, &lt;kbd&gt;a&lt;/kbd&gt; to abort &lt;em&gt;(the whole rebase process will be rewound back to before rebase)&lt;/em&gt; and &lt;kbd&gt;s&lt;/kbd&gt; to skip &lt;em&gt;(sometimes Git gets confused, for example, when your commit appears not to introduce any change, which may happen when your current branch and the target branch both added the same modification)&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Your commits will be applied to the commits in the target branch. If they don't apply smoothly, you will be shown the progress and the conflicts in the Magit status buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-04-13T13:21:38.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21604" PostTypeId="1" CreationDate="2016-04-13T15:58:30.713" Score="1" ViewCount="422" Body="&lt;p&gt;I have the following line in my &lt;code&gt;.init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ansi-term &quot;/usr/bin/bash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, because I &lt;strong&gt;usually&lt;/strong&gt; like to have a terminal running in my emacs. The problem is that &lt;strong&gt;sometimes&lt;/strong&gt; I don't, for instance, when I just do some quick edit, like when I &lt;code&gt;git commit&lt;/code&gt;. In this case, exiting emacs involves prompts about running processes, and &lt;strong&gt;usually&lt;/strong&gt; I like these safety warnings. I know I can create an &lt;code&gt;alias&lt;/code&gt; something along the lines of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias emax='emacs --eval &quot;(ansi-term \&quot;/usr/bin/bash\&quot;)&quot;'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This leaves the normal &lt;code&gt;emacs&lt;/code&gt; command unchanged and everything would be fine, if I &lt;strong&gt;only&lt;/strong&gt; start emacs from terminals. If I want to start it from the &quot;Start&quot; menu however, then I'm out of luck again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the question is, is there some clever mechanism, where emacs &lt;strong&gt;usually&lt;/strong&gt; starts with an &lt;code&gt;ansi-term&lt;/code&gt;, but somehow knows, when I don't want one. One such possibility would be creating something like a custom &lt;code&gt;emax.desktop&lt;/code&gt; file, but I'd also have to use the &lt;code&gt;alias&lt;/code&gt; above and I'd like to avoid maintaining code in two different places.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So hopefully this question is understandable. I'm open to any linuxy hints, but simpler is better of course.&lt;/p&gt;&#xA;" OwnerUserId="8401" LastEditorUserId="8401" LastEditDate="2016-04-14T07:51:01.783" LastActivityDate="2016-04-14T07:51:01.783" Title="&quot;smart&quot; ansi-term on start-up?" Tags="|start-up|ansi-term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21605" PostTypeId="1" CreationDate="2016-04-13T16:10:22.980" Score="0" ViewCount="640" Body="&lt;p&gt;As ansi-term doku tells us: any key which is not in use by emacs will be passed down to shell running inside term-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example - I have a screen session running inside ansi-term and configured to respond to &quot;C-o&quot; (&lt;code&gt;escape ^Oo&lt;/code&gt; in ~/.screenrc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;C-o&quot; is not in-use by emacs, at least not in term-raw-map, so I have no trouble controlling my screen inside ansi-term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand - &lt;code&gt;&amp;lt;M-(arrow keys)&amp;gt;&lt;/code&gt; are in use by emacs and I want to not have those defined in term-raw-map only, otherwise I would like to keep the original mapping, even in term-line-map.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my thinking went - Let's undefine the offending key in term-raw-map, so that it could be passed down to whatever is running inside ansi-term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the little piece of code, that demonstrates my conundrum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I tried to define-key to &lt;code&gt;nil&lt;/code&gt;, then tried to use a built-in &lt;code&gt;local-unset-key&lt;/code&gt;, neither of those methods helped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if I just redefine the keys to anything else, they work as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My knowledge of emacs is currently insufficient to understand how to proceed to get the desired behavior.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; For expediency I'm using only &amp;lt;M-left&amp;gt; and not all the arrow keys&#xA;;; to test - comment out one of the lines:&#xA;(defun my-local/term-hook ()&#xA;;; This does NOT work:&#xA;  (define-key term-raw-map (kbd &quot;&amp;lt;M-left&amp;gt;&quot;) nil)&#xA;  ;; Neither does this:&#xA;  (local-unset-key (kbd &quot;&amp;lt;M-left&amp;gt;&quot;))&#xA;&#xA;  ;; It does work flawlessly if redefined:&#xA;  (define-key term-raw-map (kbd &quot;&amp;lt;M-left&amp;gt;&quot;) 'left-word))&#xA;&#xA;(add-hook 'term-mode-hook 'my-local/term-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, to recap the question:&#xA;How to change the term-raw-map in such a way, that keys already defined in other maps would be undefined in term-raw-map?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, in my particular case, I'm trying to have &lt;code&gt;&amp;lt;M-(arrow keys)&amp;gt;&lt;/code&gt; uninterpreted by emacs current active keymap and passed down to shell, as is the case with &quot;C-o&quot;.&lt;/p&gt;&#xA;" OwnerUserId="11708" LastEditorUserId="11708" LastEditDate="2016-04-14T08:55:09.457" LastActivityDate="2016-04-14T09:54:56.743" Title="term-raw-map and local-unset-key - Need to pass &lt;M-(left,right,up,down)&gt; to shell" Tags="|keymap|ansi-term|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21606" PostTypeId="2" ParentId="21604" CreationDate="2016-04-13T18:36:46.177" Score="2" Body="&lt;p&gt;Paste this script into bash and you are ready to roll:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;EMAX_DIR=/usr/local/bin&#xA;EMAX=$EMAX_DIR/emax&#xA;mkdir -p $EMAX_DIR&#xA;cat &amp;gt; $EMAX &amp;lt;&amp;lt;EOF&#xA;#!/bin/bash&#xA;exec emacs \$* --eval &quot;(ansi-term \&quot;/usr/bin/bash\&quot;)&quot;&#xA;EOF&#xA;chmod +x $EMAX&#xA;hash -r&#xA;&#xA;SHORTCUT=$HOME/.local/share/applications/emacs-with-ansi-term.desktop&#xA;sed -e &quot;s,EMAX,$EMAX,&quot; &amp;gt; $SHORTCUT &amp;lt;&amp;lt;EOF&#xA;[Desktop Entry]&#xA;Name=Emacs with Ansi Terminal&#xA;GenericName=Text Editor&#xA;Comment=Edit text&#xA;MimeType=text/english;text/plain;&#xA;Exec=EMAX %F&#xA;Icon=emacs&#xA;Type=Application&#xA;Terminal=false&#xA;Categories=Development;TextEditor;&#xA;StartupWMClass=Emacs&#xA;Encoding=UTF-8&#xA;Keywords=emax;emacs;Text;Editor;Terminal&#xA;EOF&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This assumes that you are using a freedesktop.org-compliant desktop like GNOME.  It will make the &lt;code&gt;emax&lt;/code&gt; bash script and also create the desktop shortcut for invoking it.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2016-04-13T18:49:13.073" LastActivityDate="2016-04-13T18:49:13.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21607" PostTypeId="2" ParentId="21597" CreationDate="2016-04-13T19:00:50.990" Score="2" Body="&lt;p&gt;This one is also quite easy technique without learning shortcuts of magit by using &lt;code&gt;hydra&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defhydra yt-hydra/help (:color blue :hint nil)&#xA;  &amp;quot;&#xA;_mp_ magit-push #_mc_ magit-commit #_md_ magit diff #_mla_ magit diff #_mla_ magit status&#xA;&amp;quot;&#xA;  ;;Magit part&#xA;  (&amp;quot;mp&amp;quot; magit-push)&#xA;  (&amp;quot;mc&amp;quot; magit-commit)&#xA;  (&amp;quot;md&amp;quot; magit-diff)&#xA;  (&amp;quot;mla&amp;quot; magit-log-all)&#xA;  (&amp;quot;ms&amp;quot; magit-status)&#xA;  )&#xA;(global-set-key (kbd &amp;quot;&amp;lt;f1&amp;gt;&amp;quot;) 'yt-hydra/help/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8426" LastEditorUserId="8426" LastEditDate="2021-01-09T07:25:03.427" LastActivityDate="2021-01-09T07:25:03.427" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21609" PostTypeId="1" CreationDate="2016-04-13T22:00:56.973" Score="0" ViewCount="337" Body="&lt;p&gt;I use Company mode as completion. I like the gratification of instant completion popups. So I set the following setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-idle-delay 0.0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So basically no delay before the pop-up appears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I noticed someone said it would slow down the text input. When Googling around, I found no way to determine how this will delay the input of text. Any suggestion in order to determine the setting above will really delay the text input?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-04-13T23:23:06.660" Title="How to determine if there is really any delay in text input with company completion?" Tags="|company-mode|text-editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21611" PostTypeId="2" ParentId="21609" CreationDate="2016-04-13T23:23:06.660" Score="1" Body="&lt;p&gt;It will slow down your typing as much as the backends you use are &quot;slow&quot; (use expensive processing inside Emacs, or even do that mostly outside Emacs but produce completions synchronously).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test, try mashing your keyboard under different values of &lt;code&gt;company-idle-delay&lt;/code&gt;, and see if there is a noticeable difference in how quickly the characters get inserted.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-04-13T23:23:06.660" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21612" PostTypeId="1" AcceptedAnswerId="21615" CreationDate="2016-04-14T05:24:25.520" Score="3" ViewCount="542" Body="&lt;p&gt;I am receiving the above error when trying to compile a LaTeX document in emacs 24.5, using auctex 11.89.3. Previously, I would get either &quot;Run LaTeX again&quot;, or &quot;Compiled successfully&quot;. This happened after I updated some packages yesterday, and I am unable to fix it. I did not pay attention to which packages were updated, and I also deleted the obsolete packages immediately, so I do not know what is causing this. Any suggestions? &lt;/p&gt;&#xA;" OwnerUserId="10050" LastEditorUserId="25" LastEditDate="2016-04-14T19:16:37.030" LastActivityDate="2016-04-14T19:16:37.030" Title="Error in process sentinel: No error or warning to show" Tags="|auctex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21613" PostTypeId="2" ParentId="21600" CreationDate="2016-04-14T06:13:41.407" Score="1" Body="&lt;p&gt;Add your syntax checker to the end of &lt;code&gt;flycheck-checkers&lt;/code&gt; to make it available for Flycheck's automatic syntax checker discovery and selection.  Flycheck will then automatically pick your checker if its executable is present and if the major mode matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more fine-grained control add a custom &lt;code&gt;:predicate&lt;/code&gt; function to your syntax checker, for instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-define-checker …&#xA;   :predicate (lambda () (bound-and-true-p ten-hundred-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Flycheck looks at this predicate before trying to use a checker.  This predicate tells Flycheck that it may only use the syntax checker if &lt;code&gt;ten-hundred-mode&lt;/code&gt; is loaded and enabled.  If the user disables the syntax checker Flycheck will silently skip it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a custom predicate function please also add a custom &lt;code&gt;:verify&lt;/code&gt; function to tell the user why the syntax checker is disabled when they use &lt;code&gt;M-x flycheck-verify-setup&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at Flycheck's source for examples, for instance in the &lt;code&gt;go vet&lt;/code&gt; syntax checker.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-04-14T06:13:41.407" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21614" PostTypeId="2" ParentId="21612" CreationDate="2016-04-14T06:21:35.637" Score="0" Body="&lt;p&gt;I noticed the same behaviour after updating AUCTeX to version 11.89.3. As a workaround I disabled the option TeX-error-overview-open-after-TeX-run. &lt;/p&gt;&#xA;" OwnerUserId="11725" LastActivityDate="2016-04-14T06:21:35.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21615" PostTypeId="2" ParentId="21612" CreationDate="2016-04-14T08:24:17.737" Score="2" Body="&lt;p&gt;The error you reported was probably triggered by having &lt;code&gt;TeX-error-overview-open-after-TeX-run&lt;/code&gt; set to non-nil and &lt;code&gt;TeX-debug-warnings&lt;/code&gt; and/or &lt;code&gt;TeX-debug-bad-boxes&lt;/code&gt; set to nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be fixed now in development version of AUCTeX:  &lt;a href=&quot;http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=88fbf8021c7da3c2bf14a646663bd0eb0ccc1448&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=88fbf8021c7da3c2bf14a646663bd0eb0ccc1448&lt;/a&gt;  It'll go live in next ELPA release.  If you want to keep &lt;code&gt;TeX-error-overview-open-after-TeX-run&lt;/code&gt; set to non-nil, as a workaround (but I find this a good practice in general) you can activate parsing of warnings and bad-boxes:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-debug-warnings t&#xA;      TeX-debug-bad-boxes t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Background on the origin of the error: in AUCTeX 11.89.3 has been introduced the possibility to ignore certain warnings that can be considered too noisy.  This is controlled by two options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;TeX-ignore-warnings&lt;/code&gt;: this controls which warnings should be ignored (usually it's a regexp)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;TeX-suppress-ignored-warnings&lt;/code&gt;: this tells AUCTeX whether to actually ignore those warnings.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In this way one can interactively toggle visibility of ignored warnings with &lt;kbd&gt;x&lt;/kbd&gt; in TeX error overview (and toggle visibility of all warnings and bad-boxes with &lt;kbd&gt;w&lt;/kbd&gt; and &lt;kbd&gt;b&lt;/kbd&gt;, respectively), but this also requires building of the error/warning list to be shown on-the-fly. Instead, before the fix mentioned above TeX sentinels were looking to the static full list of errors and warnings.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2016-04-14T17:14:08.537" LastActivityDate="2016-04-14T17:14:08.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21616" PostTypeId="2" ParentId="21605" CreationDate="2016-04-14T08:54:07.113" Score="2" Body="&lt;p&gt;So, after reading excellent commentary for the original question, I was able to solve my problem in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-term-hook ()&#xA;  (define-key term-raw-map (kbd &quot;&amp;lt;M-left&amp;gt;&quot;)&#xA;    (lambda () (interactive) (term-send-raw-string &quot;\e[1;3D&quot;)))&#xA;  (define-key term-raw-map (kbd &quot;&amp;lt;M-right&amp;gt;&quot;)&#xA;    (lambda () (interactive) (term-send-raw-string &quot;\e[1;3C&quot;)))&#xA;  (define-key term-raw-map (kbd &quot;&amp;lt;M-up&amp;gt;&quot;)&#xA;    (lambda () (interactive) (term-send-raw-string &quot;\e[1;3A&quot;)))&#xA;  (define-key term-raw-map (kbd &quot;&amp;lt;M-down&amp;gt;&quot;)&#xA;    (lambda () (interactive) (term-send-raw-string &quot;\e[1;3B&quot;)))&#xA;  )&#xA;&#xA;(add-hook 'term-mode-hook 'my-term-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If someone knows of a better/cleaner way, please let everyone know!&lt;/p&gt;&#xA;" OwnerUserId="11708" LastEditorUserId="454" LastEditDate="2016-04-14T09:54:56.743" LastActivityDate="2016-04-14T09:54:56.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21617" PostTypeId="1" AcceptedAnswerId="21618" CreationDate="2016-04-14T12:04:18.327" Score="7" ViewCount="642" Body="&lt;p&gt;I am using paredit. Sometimes I accidentely wrap something in curly braces or I have a situation where I want unwrap something for some other reason? What ist the right command to use when undo does not work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a command which turns something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hello) world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hello world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while the cursor is at the front.&lt;/p&gt;&#xA;" OwnerUserId="11606" LastActivityDate="2016-04-14T13:09:25.797" Title="What is the reverse command to paredit-wrap-around?" Tags="|paredit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21618" PostTypeId="2" ParentId="21617" CreationDate="2016-04-14T12:31:34.010" Score="7" Body="&lt;p&gt;I think &lt;code&gt;paredit-splice&lt;/code&gt;, &lt;code&gt;M-s&lt;/code&gt;, will do that. Point may need to be inside the expression you want to 'unwrap'.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-14T12:31:34.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21619" PostTypeId="2" ParentId="21617" CreationDate="2016-04-14T13:09:25.797" Score="0" Body="&lt;p&gt;I have the following function bound to &lt;code&gt;M-D&lt;/code&gt;. Hitting M-D RET makes a pair of brackets disappear.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yf/replace-or-delete-pair (open)&#xA;  &quot;Replace pair at point by OPEN and its corresponding closing character.&#xA;The closing character is lookup in the syntax table or asked to&#xA;the user if not found.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (read-char&#xA;     (format &quot;Replacing pair %c%c by (or hit RET to delete pair):&quot;&#xA;             (char-after)&#xA;             (save-excursion&#xA;               (forward-sexp 1)&#xA;               (char-before))))))&#xA;  (if (memq open '(?\n ?\r))&#xA;      (delete-pair)&#xA;    (let ((close (cdr (aref (syntax-table) open))))&#xA;      (when (not close)&#xA;        (setq close&#xA;              (read-char&#xA;               (format &quot;Don't know how to close character %s (#%d) ; please provide a closing character: &quot;&#xA;                       (single-key-description open 'no-angles)&#xA;                       open))))&#xA;      (yf/replace-pair open close))))&#xA;&#xA;(defun yf/replace-pair (open close)&#xA;  &quot;Replace pair at point by respective chars OPEN and CLOSE.&#xA;If CLOSE is nil, lookup the syntax table. If that fails, signal&#xA;an error.&quot;&#xA;  (let ((close (or close&#xA;                   (cdr-safe (aref (syntax-table) open))&#xA;                   (error &quot;No matching closing char for character %s (#%d)&quot;&#xA;                          (single-key-description open t)&#xA;                          open)))&#xA;        (parens-require-spaces))&#xA;    (insert-pair 1 open close))&#xA;  (delete-pair)&#xA;  (backward-char 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-04-14T13:09:25.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21620" PostTypeId="2" ParentId="21582" CreationDate="2016-04-14T15:35:19.963" Score="1" Body="&lt;p&gt;Actually I ended up using a slightly different solution. Doing it like it was shown in the answer in &lt;a href=&quot;https://emacs.stackexchange.com/questions/13440/decomposing-helm-source-buffers-list-in-two-parts&quot;&gt;this post&lt;/a&gt; I get a terminal list with additional information about the terminals.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defclass my-helm-source-terminal-buffers-class (helm-source-buffers)&#xA;   ((candidates :initform&#xA;               (lambda ()&#xA;                 (mapcar 'buffer-name multi-term-buffer-list)))))&#xA;&#xA;(setq my-helm-source-terminal-buffers-list&#xA;      (helm-make-source &quot;Terminals&quot; 'my-helm-source-terminal-buffers-class))&#xA;&#xA;(defun my-helm-terminal-buffers ()&#xA;  (interactive)&#xA;  (helm :sources 'my-helm-source-terminal-buffers-list&#xA;        :buffer &quot;*helm terminals*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I really need to learn emacs lisp, at the moment I have no clue what I am really doing...&lt;/p&gt;&#xA;" OwnerUserId="11713" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-04-14T15:35:19.963" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21622" PostTypeId="2" ParentId="21475" CreationDate="2016-04-15T05:29:20.353" Score="1" Body="&lt;p&gt;Some useful information are available at &lt;a href=&quot;https://www.emacswiki.org/emacs/BrowseAproposURL&quot; rel=&quot;nofollow&quot;&gt;BrowseAproposURL&lt;/a&gt; to address this issue. One important package is &lt;a href=&quot;https://github.com/keyword-search/keyword-search&quot; rel=&quot;nofollow&quot;&gt;keyword-search&lt;/a&gt;, which is available on MELPA. After installing the package, the command &lt;code&gt;keyword-search&lt;/code&gt; will be available, which will search a keyword or visit the URL depending on the text.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-04-15T05:29:20.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21624" PostTypeId="1" AcceptedAnswerId="21625" CreationDate="2016-04-15T09:08:12.707" Score="0" ViewCount="1239" Body="&lt;p&gt;I am currently using &lt;code&gt;visual-fill-column-mode&lt;/code&gt; and &lt;code&gt;visual-line-mode&lt;/code&gt; in emacs with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'visual-line-mode-hook 'visual-fill-column-mode)&#xA;(global-visual-line-mode t)&#xA;(define-key visual-line-mode-map [remap kill-line] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This enable both mode everywhere, but I would like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;visual-line-mode&lt;/code&gt; to be enable everywhere &lt;strong&gt;but&lt;/strong&gt; in terminal (e.g. &lt;code&gt;ansi-term&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;visual-fill-column-mode&lt;/code&gt; to be enable only in &quot;text&quot; and &quot;programming&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Currently I have the following hook for &lt;code&gt;ansi-term&lt;/code&gt; but it does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-term-hook ()&#xA;  (visual-fill-column-mode nil)&#xA;  (visual-line-mode nil))&#xA;(add-hook 'term-load-hook 'my-term-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I don't on which hook I could bind those mode to enable them in all programming mode (I know about &lt;code&gt;text-mode-hook&lt;/code&gt; for text mode)?&lt;/p&gt;&#xA;" OwnerUserId="11022" LastEditorUserId="11022" LastEditDate="2016-04-15T22:50:45.197" LastActivityDate="2016-04-15T22:50:45.197" Title="Enable visual-fill-column-mode only in text and programming mode" Tags="|hooks|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21625" PostTypeId="2" ParentId="21624" CreationDate="2016-04-15T10:47:47.683" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;text-mode-hook&lt;/code&gt; for all text modes and &lt;code&gt;prog-mode-hook&lt;/code&gt; for all programming language modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, &quot;all&quot; should be takes with a grain of salt. Some modes does not inherit from the standard modes, in which case please contact the maintainer and report that as a bug.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-04-15T10:47:47.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21626" PostTypeId="1" AcceptedAnswerId="21635" CreationDate="2016-04-15T12:20:31.397" Score="13" ViewCount="2456" Body="&lt;p&gt;I've read the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Call.html&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; on how to make interactive calls from within Elisp, but I still can't figure out how to pass the universal argument when using &lt;code&gt;call-interactively&lt;/code&gt; on a command that recognizes the universal argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I want to implement a function that, under certain conditions, should call the &lt;code&gt;shell&lt;/code&gt; command interactively &lt;em&gt;with the universal argument&lt;/em&gt;, so that, as a result, the prompt&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Shell buffer (default *shell*): &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will be visible in the minibuffer, and, once this prompt gets a response, the specified buffer will be created (if it doesn't exist already), and made the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;FWIW, I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(universal-argument)&#xA;(call-interactively 'shell)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq prefix-arg (list 4))&#xA;(call-interactively 'shell)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but I never saw the prompt &lt;code&gt;Shell buffer (default *shell*):&lt;/code&gt;; instead, in all cases, the &lt;code&gt;shell&lt;/code&gt; command ran exactly as if it had been called &lt;em&gt;without&lt;/em&gt; the universal argument.  (I really don't know what I'm doing here, so my blind attempts above were made with conscious disregard of the documentation's prescient &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html#index-universal_002dargument&quot; rel=&quot;noreferrer&quot;&gt;advice&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-06-22T19:57:17.827" LastActivityDate="2016-06-22T19:57:17.827" Title="How to apply `call-interactively` to an interactive command that accepts the universal argument?" Tags="|interactive|prefix-argument|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21627" PostTypeId="1" AcceptedAnswerId="21629" CreationDate="2016-04-15T12:40:10.267" Score="7" ViewCount="164" Body="&lt;p&gt;I want to write a function where the only two valid values for the input argument are &lt;code&gt;&quot;dag&quot;&lt;/code&gt; or &lt;code&gt;&quot;rulegraph&quot;&lt;/code&gt;. Is there a way to specify that only these two arguments are accepted this in the &lt;code&gt;elisp&lt;/code&gt; function header?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is not possible, I'd accept an idiomatic way of handling this.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="105" LastEditDate="2016-06-22T19:56:47.937" LastActivityDate="2016-06-22T19:56:47.937" Title="Is there a way to only accept certain arguments to a function?" Tags="|arguments|conditionals|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21628" PostTypeId="1" CreationDate="2016-04-15T13:08:37.393" Score="0" ViewCount="530" Body="&lt;p&gt;I am using Evil-mode which creates a vi-layer in Emacs. This means you have different modes (e.g., NORMAL; INSERT; VISUAL). Unfortunately this also happens at times when I do not want to be in NORMAL mode. For example when an error pops up in the Cider REPL I want to be able to press &lt;code&gt;q&lt;/code&gt; and exit the buffer immediately. Not &lt;code&gt;iq&lt;/code&gt; (change to insert mode and quit). Same for the NeoTree navigation where I want to press &lt;code&gt;ENTER&lt;/code&gt; to open a directory structure. Instead I have to press &lt;code&gt;i ENTER&lt;/code&gt; (change to insert mode and open directory).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example where I want to press ENTER on the left side, but I have to enter insert mode :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/62w76.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/62w76.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure Emacs/Evil-mode in such a way that in the case of non text-editing Windows (like NeoTree navigation, REPL or Cider Errors) I can press the normal commands without having to switch to INSERT mode first?&lt;/p&gt;&#xA;" OwnerUserId="11605" LastEditorUserId="253" LastEditDate="2016-04-15T13:24:26.820" LastActivityDate="2016-04-15T17:43:29.650" Title="Use default keybindings in Evil in non-text-editing buffers?" Tags="|key-bindings|evil|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21629" PostTypeId="2" ParentId="21627" CreationDate="2016-04-15T13:12:36.720" Score="3" Body="&lt;p&gt;Standard elisp does not allow you to put restrictions on the arguments in the header in the way you're specifying, but you may wish to check out &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/Argument-Lists.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;cl-defun&lt;/code&gt; in the Common Lisp extension library&lt;/a&gt; to get more options in your &lt;code&gt;defun&lt;/code&gt;s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime, a fairly simple way to handle your use case is to do a preliminary check before you get into the body of the function.  Here's a stripped down example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fnx (arg)&#xA;  (unless (member arg '(&quot;dag&quot; &quot;rulegraph&quot;))&#xA;    (error &quot;Argument must be either \&quot;dag\&quot; or \&quot;rulegraph\&quot;&quot;))&#xA;  (message &quot;Nice argument&quot;))&#xA;&#xA;(fnx &quot;dag&quot;)                             ; =&amp;gt; &quot;Nice argument&quot;&#xA;(fnx &quot;rulegraph&quot;)                       ; =&amp;gt; &quot;Nice argument&quot;&#xA;(fnx &quot;kittens&quot;)                         ; =&amp;gt; (ERROR)&#xA;(fnx 1)                                 ; =&amp;gt; (ERROR)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="2223" LastEditDate="2016-04-17T19:41:23.120" LastActivityDate="2016-04-17T19:41:23.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21630" PostTypeId="2" ParentId="21628" CreationDate="2016-04-15T13:23:19.750" Score="2" Body="&lt;p&gt;You can assign initial states to different modes with the variables:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-emacs-state-modes&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-normal-state-modes&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-insert-state-modes&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;... and so on&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you'd like to maintain the default keybindings in a certain mode without Evil getting in the way, you may wish to assign that mode to Emacs state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'evil-emacs-state-modes 'my-interesting-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-04-15T13:23:19.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21631" PostTypeId="1" CreationDate="2016-04-15T13:24:45.610" Score="0" ViewCount="37" Body="&lt;p&gt;If you start &lt;code&gt;emacs --daemon -q&lt;/code&gt; and then connect two &lt;code&gt;emacsclients&lt;/code&gt; to it. If you press &lt;code&gt;C-x C-f&lt;/code&gt; or anything that activates the minibuffer - no input to the other emacsclients will be accepted until that minibuffer is closed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to prevent this from happening?&lt;/p&gt;&#xA;" OwnerUserId="2325" LastActivityDate="2016-04-15T13:24:45.610" Title="Emacsclients locks up on mini-buffer use" Tags="|emacsclient|minibuffer|" AnswerCount="0" CommentCount="3" ClosedDate="2016-04-20T11:35:48.990" ContentLicense="CC BY-SA 3.0" />
  <row Id="21632" PostTypeId="1" CreationDate="2016-04-15T13:41:27.477" Score="5" ViewCount="445" Body="&lt;p&gt;I have a repo for my dotfiles and update it here and there on various computers. Sometimes I forget to &lt;code&gt;git pull&lt;/code&gt; before editting and &lt;code&gt;git push&lt;/code&gt;. This creates conflicts or trigger &lt;code&gt;git merge&lt;/code&gt;, or I just forget that I wrote a new feature somewhere else already. So, how do I do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;check every &lt;code&gt;n&lt;/code&gt; minutes for remote repo changes and give a message&#xA;to the current frame so I can pull the changes before doing something&#xA;else.&lt;/li&gt;&#xA;&lt;li&gt;When opening (&lt;code&gt;find-file&lt;/code&gt;) on the repo, do the same check changes and notification.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(expansion for other use cases) if I am not working on the repo, but I still want to get notitfy about changes on a list of repos something like this:&#xA;&lt;code&gt;&#xA;((repo1 &quot;git@host:/path/to/repo1&quot;)&#xA;(repo2 &quot;git@github.com:user/repo2&quot;))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if there are changes on &lt;code&gt;repo1&lt;/code&gt; then I will get a notification saying &lt;code&gt;&quot;There are changes on repo1. Check it out!&quot;&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="5213" LastEditDate="2016-04-30T14:12:57.763" LastActivityDate="2016-04-30T14:12:57.763" Title="Notify about upstream git repo changes?" Tags="|magit|git|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21633" PostTypeId="1" AcceptedAnswerId="21634" CreationDate="2016-04-15T13:46:45.103" Score="1" ViewCount="1519" Body="&lt;p&gt;I have the path to a pdf file or a png file (whichever is easiest to show, but bonus points for showing both).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I show the image in a new buffer? (It makes no sense to show it inline since it is a graph representation of the makefile I am writing.)&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2017-09-11T04:02:21.610" Title="How do I view an image in a new buffer in emacs?" Tags="|images|pdf|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21634" PostTypeId="2" ParentId="21633" CreationDate="2016-04-15T13:56:42.530" Score="3" Body="&lt;p&gt;You should be able to open the file directly - &lt;code&gt;C-x C-f&lt;/code&gt;, and Emacs will display it as you expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're running GNU/Linux, the &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;nofollow&quot;&gt;pdf-tools&lt;/a&gt; package provides a much-improved experience for viewing pdfs than the built-in Emacs viewer. pdf-tools isn't available for Windows, and I think may require some extra work on to get it running on Macs (?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this in an elisp program, use the function &lt;code&gt;(find-file &amp;lt;path&amp;gt;)&lt;/code&gt;, where  is the path to your file, as a string. e.g., &lt;code&gt;(find-file &quot;~/.emacs.d/init.el&quot;)&lt;/code&gt; will open your init file.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-04-15T14:42:17.910" LastActivityDate="2016-04-15T14:42:17.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21635" PostTypeId="2" ParentId="21626" CreationDate="2016-04-15T14:27:46.197" Score="14" Body="&lt;p&gt;According to &lt;code&gt;shell&lt;/code&gt;'s interactive form, as long as &lt;code&gt;current-prefix-arg&lt;/code&gt; is non-nil, &lt;code&gt;shell&lt;/code&gt; will ask user a buffer to use, so you can set &lt;code&gt;current-prefix-arg&lt;/code&gt; to non-nil (4 is used in following as an example):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((current-prefix-arg 4))&#xA;  (call-interactively 'shell))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or simulate executing &lt;code&gt;shell&lt;/code&gt; with a prefix 4 (&lt;kbd&gt;M-4 M-x shell&lt;/kbd&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(execute-extended-command 4 &quot;shell&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-15T14:27:46.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21636" PostTypeId="1" CreationDate="2016-04-15T15:30:05.843" Score="3" ViewCount="3756" Body="&lt;p&gt;After I type &lt;code&gt;C-x /remote.server.com TAB /&lt;/code&gt;, the prompt changes to spinning bar and nothing more happens. After around a minute of waiting I get the same prompt I was entering, i.e. &lt;code&gt;/remote.server.com:&lt;/code&gt;. There’s also a buffer &lt;code&gt;*tramp/scp remote.server.com&lt;/code&gt; opened, but it’s empty. In the Messages buffer I can see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for remote.server.com using scp...&#xA;Tramp: Sending command `exec ssh   -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none remote.server.com'&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Timeout reached, see buffer `*tramp/scp remote.server.com*' for details&#xA;Tramp: Waiting for prompts from remote shell...failed&#xA;Tramp: Opening connection for remote.server.com using scp...failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Autocompletion for &lt;code&gt;ssh remote.server.com:/&lt;/code&gt; works in a regular terminal, and shows in a couple of seconds. The server in question uses options from &lt;code&gt;~/.ssh/config&lt;/code&gt;, such as User, Port, HostName, IdentityFile to connect.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Debug output: &lt;a href=&quot;http://sprunge.us/MFig&quot; rel=&quot;nofollow&quot;&gt;http://sprunge.us/MFig&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Debug output after changing remote PS1 to ‘#’: &lt;a href=&quot;http://sprunge.us/DLcH&quot; rel=&quot;nofollow&quot;&gt;http://sprunge.us/DLcH&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6672" LastEditorUserId="6672" LastEditDate="2016-04-15T20:52:51.677" LastActivityDate="2018-03-28T13:37:42.490" Title="TRAMP hangs after timeout on trying to connect" Tags="|tramp|ssh|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21637" PostTypeId="2" ParentId="21636" CreationDate="2016-04-15T16:01:30.310" Score="3" Body="&lt;p&gt;Pls set &lt;code&gt;(setq tramp-verbose 10)&lt;/code&gt; and rerun the test. There will be a debug buffer, which you shall show us.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you don't want to show it publicly, send it to me via email.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-04-15T16:01:30.310" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21638" PostTypeId="1" AcceptedAnswerId="21639" CreationDate="2016-04-15T16:15:23.753" Score="3" ViewCount="622" Body="&lt;p&gt;I have some custom elisp functions that need to run shell scripts using &lt;code&gt;shell-command&lt;/code&gt;. I would like to use a relative path to the script, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command &quot;./run.sh&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than an absolute one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command &quot;~/blah/blah/blah/run.sh&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the relative path will only work if the working directory contains the script. I don't want to use an absolute path, because the path to the shell script might change. However, the shell script will always be in the same directory as the &lt;code&gt;.el&lt;/code&gt; file where the function is defined, so I thought I could leverage that fact, and use a relative path instead, I just can't figure out how to do it. I know that I can change the &lt;code&gt;default-directory&lt;/code&gt;, but I don't know how to do that without using an absolute path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for me to tell the function to use the directory that contains its &lt;code&gt;.el&lt;/code&gt; file as the &lt;code&gt;default-directory&lt;/code&gt;, or is there maybe a better solution?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="105" LastEditDate="2016-06-22T19:56:13.670" LastActivityDate="2016-06-22T19:56:13.670" Title="Set default-directory relative to the place an Elisp function is defined" Tags="|shell-command|directory|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21639" PostTypeId="2" ParentId="21638" CreationDate="2016-04-15T16:21:27.080" Score="4" Body="&lt;p&gt;You can define a variable in the script that records the directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-shell-directory&#xA;  (if load-file-name&#xA;      (file-name-directory load-file-name)&#xA;    default-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then use it in your own functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-shell-command (cmd)&#xA;  (shell-command (expand-file-name cmd my-shell-directory)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastEditorUserId="2223" LastEditDate="2016-04-17T19:39:43.837" LastActivityDate="2016-04-17T19:39:43.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21640" PostTypeId="1" AcceptedAnswerId="21649" CreationDate="2016-04-15T16:33:36.713" Score="4" ViewCount="275" Body="&lt;p&gt;This has been driving me crazy, I can't get this to work. I want to link the on-off status of a handful of minor modes, in particular evil-mode, evil-quickscope-mode, hl-paren-mode, and a few others. I don't necessarily want evil globally, but once I turn on evil-mode I want the other modes to also turn on (and correspondingly turn off once evil turns off). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to accomplish this cleanly? The closest I've come involved using mode-hooks, but somehow the modes always got out of sync (evil on, others off. others on, evil off. etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Posting the relevant mode-hooks section of my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Evil Mode Setup&#xA;(require 'evil-leader)&#xA;(evil-leader/set-leader &quot;,&quot;)&#xA;(evil-leader/set-key &quot;q&quot; 'kill-buffer-and-window)&#xA;(evil-leader/set-key &quot;b&quot; 'ibuffer)&#xA;&#xA;(defun after-all-loads () (require 'evil))&#xA;(add-hook 'after-init-hook 'after-all-loads)&#xA;(define-key global-map &quot;\C-xv&quot; 'evil-mode)&#xA;(add-hook 'evil-mode-hook 'hl-paren-mode)&#xA;(add-hook 'evil-mode-hook 'evil-visual-mark-mode)&#xA;(add-hook 'evil-mode-hook 'evil-quickscope-mode)&#xA;(add-hook 'evil-mode-hook 'evil-leader-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11734" LastEditorUserId="11734" LastEditDate="2016-04-15T18:42:55.873" LastActivityDate="2016-04-16T03:16:01.437" Title="Bind several minor modes together" Tags="|evil|minor-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21641" PostTypeId="2" ParentId="21628" CreationDate="2016-04-15T17:43:29.650" Score="1" Body="&lt;p&gt;The easiest way of getting that behaviour is unbinding &lt;code&gt;RET&lt;/code&gt; in the map where it's defined, that way Emacs will fall back to the otherwise active binding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-maps&#xA;  '(define-key evil-motion-state-map (kbd &quot;RET&quot;) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-04-15T17:43:29.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21642" PostTypeId="1" AcceptedAnswerId="21644" CreationDate="2016-04-15T17:48:05.157" Score="3" ViewCount="1198" Body="&lt;p&gt;I want to convert&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.waitForVisible('.someselector')&#xA;.click();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.waitAndClick('.someselector');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Automatically in a lot of files. So I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hhaamm-replace-regexp-in-buffer (from to)&#xA;  (goto-char (point-min))&#xA;  (while (search-forward-regexp from nil t)&#xA;    (replace-match to nil nil))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I'm calling it in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hhaamm-replace-regexp-in-buffer &quot;waitForVisible(.*)[\t&#xA; ]*\.click()&quot; &quot;waitAndClick(\1)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'm getting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.waitAndClick(^A);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The expected result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.waitAndClick('.someselector');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why the regexp group is not being replaced with the first matching group?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried with &lt;code&gt;\0&lt;/code&gt; and it didn't work either.&lt;/p&gt;&#xA;" OwnerUserId="2300" LastEditorUserId="25" LastEditDate="2016-04-15T18:13:52.553" LastActivityDate="2016-04-15T18:32:22.430" Title="Regular expression matching group replacement not working" Tags="|regular-expressions|replace|string|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21643" PostTypeId="1" AcceptedAnswerId="21645" CreationDate="2016-04-15T18:14:46.993" Score="64" ViewCount="19517" Body="&lt;p&gt;What should I do when Emacs stops responding? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current &quot;emacs-is-frozen&quot; protocol looks like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Spam &lt;code&gt;C-g&lt;/code&gt; (it sometimes works)&lt;/li&gt;&#xA;&lt;li&gt;Wait for a while.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;pkill -9 emacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What alternate steps could I try to avoid losing work that hasn't been autosaved yet?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anything, could I attach GDB to know what the likely issue is?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="25" LastEditDate="2017-02-22T13:40:03.807" LastActivityDate="2017-02-22T13:40:03.807" Title="What do I do when Emacs is frozen?" Tags="|debugging|error-handling|quitting|frozen-emacs|" AnswerCount="2" CommentCount="3" ClosedDate="2017-02-22T13:39:24.220" ContentLicense="CC BY-SA 3.0" />
  <row Id="21644" PostTypeId="2" ParentId="21642" CreationDate="2016-04-15T18:21:34.030" Score="4" Body="&lt;p&gt;The backslash character is special both in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-for-Strings.html#Syntax-for-Strings&quot; rel=&quot;nofollow&quot;&gt;string literals&lt;/a&gt; (strings typed in Emacs Lisp, surrounded by double quotes) and in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-of-Regexps.html#Syntax-of-Regexps&quot; rel=&quot;nofollow&quot;&gt;regular expressions&lt;/a&gt; as well as &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Replacing-Match.html#Replacing-Match&quot; rel=&quot;nofollow&quot;&gt;replacement specifications&lt;/a&gt;. Backslash followed by 1–3 octal digits stands for the character with this value, that's why you're seeing &lt;code&gt;^A&lt;/code&gt; (it's the character with the value 1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you want the replacement specification&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;waitAndClick(\1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you need to write it as a string literal as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;waitAndClick(\\1)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. surrounded by double quotes, and with a backslash before each backslash or double quote in the replacement specification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly your regular expression&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;waitForVisible(.*)[ &#xA; ]*\.click()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;needs to have a backslash before the backslash character, otherwise the regexp contains &lt;code&gt;.&lt;/code&gt; which matches any character (except a newline). Also you can make the Lisp source more readable by using the &lt;code&gt;\n&lt;/code&gt; syntax instead of a literal newline inside the string. Furthermore your regexp doesn't contain a group; you wanted what's inside the parentheses, so put &lt;code&gt;.*&lt;/code&gt; in a group:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;waitForVisible(\\(.*\\))[\t\n ]*\\.click()&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Your function seems to be reinventing &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Operating-on-Files.html#index-dired_002ddo_002dquery_002dreplace_002dregexp&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt;&lt;/a&gt;: open the directory containing the files, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Marks-vs-Flags.html#Marks-vs-Flags&quot; rel=&quot;nofollow&quot;&gt;mark&lt;/a&gt; them (&lt;code&gt;m&lt;/code&gt; to mark one file, &lt;code&gt;% m&lt;/code&gt; to mark files whose name matches a regexp, etc.) and then press &lt;code&gt;Q&lt;/code&gt; and enter the regexp and replacement.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-04-15T18:32:22.430" LastActivityDate="2016-04-15T18:32:22.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21645" PostTypeId="2" ParentId="21643" CreationDate="2016-04-15T18:21:46.517" Score="80" Body="&lt;p&gt;When &lt;code&gt;C-g&lt;/code&gt; doesn't work, you can sometimes get control back with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pkill -SIGUSR2 emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @Archenoth points out, sending the &lt;code&gt;SIGUSR2&lt;/code&gt; signal to Emacs turns on debug-on-quit. This can be useful, but you'll want to turn it off again at some point (possibly immediately). To do this, call &lt;code&gt;M-x toggle-debug-on-quit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information on using SIGUSR1 and SIGUSR2 are found in the elisp manual, particularly &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Misc-Events.html#Misc-Events&quot; rel=&quot;noreferrer&quot;&gt;(elisp) Misc Events&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Event-Examples.html#Event-Examples&quot; rel=&quot;noreferrer&quot;&gt;(elisp) Event Examples&lt;/a&gt;, with related discussion of debugging in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html#Error-Debugging&quot; rel=&quot;noreferrer&quot;&gt;(elisp) Error Debugging&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="2039" LastEditDate="2016-04-18T14:53:38.577" LastActivityDate="2016-04-18T14:53:38.577" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21646" PostTypeId="1" CreationDate="2016-04-15T18:35:28.423" Score="2" ViewCount="267" Body="&lt;p&gt;if I have an org file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;this is [[heading]]&#xA;* Heading&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can follow &quot;Heading&quot; with 'C-c C-o' so the link and the target are case insensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if I try to export this org file to html (org-export-to-html) I get this error: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;user-error: Unable to resolve link &quot;heading&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which means that for html exporter the link and the target are case sensitive. Is there a way to make it case insensitive?&lt;/p&gt;&#xA;" OwnerUserId="11177" LastActivityDate="2016-04-15T18:35:28.423" Title="org html exporter case sensitivity of links" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21647" PostTypeId="1" CreationDate="2016-04-15T19:39:36.870" Score="0" ViewCount="183" Body="&lt;p&gt;This question was completely rewritten, see the &lt;a href=&quot;https://emacs.stackexchange.com/revisions/21647/5&quot;&gt;previous version&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I have this XeLaTeX file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{fontspec}&#xA;&#xA;\begin{document}&#xA;\thispagestyle{empty}&#xA;\pagestyle{empty}  &#xA;&#xA;äätewää--llll&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which produces the (intended) image when compiled with &lt;code&gt;C-c C-a&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OCy7W.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OCy7W.png&quot; alt=&quot;result&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my &lt;code&gt;init.el&lt;/code&gt; used for that is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(dolist (source '((&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;                  (&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;)&#xA;                  ))&#xA;  (add-to-list 'package-archives source t))&#xA;(package-initialize)&#xA;(when (not package-archive-contents)&#xA;  (package-refresh-contents))&#xA;(defvar tmtxt/packages&#xA;  '( auctex))&#xA;(dolist (p tmtxt/packages)&#xA;  (when (not (package-installed-p p))&#xA;    (package-install p)))&#xA;&#xA;(setq-default TeX-engine 'xetex)&#xA;(setq-default TeX-PDF-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;all the above is expected so far&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;However, if i change my &lt;code&gt;init.el&lt;/code&gt; to use a different viewer (latex-preview-pane-mode):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(dolist (source '((&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;                  (&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;)&#xA;                  ))&#xA;  (add-to-list 'package-archives source t))&#xA;(package-initialize)&#xA;(when (not package-archive-contents)&#xA;  (package-refresh-contents))&#xA;(defvar tmtxt/packages&#xA;  '( auctex))&#xA;(dolist (p tmtxt/packages)&#xA;  (when (not (package-installed-p p))&#xA;    (package-install p)))&#xA;&#xA;(setq-default TeX-engine 'xetex)&#xA;(setq-default TeX-PDF-mode t)&#xA;&#xA;(custom-set-variables&#xA; '(TeX-view-program-list&#xA;   (quote ((&quot;preview-pane-mode&quot; latex-preview-pane-mode))))&#xA;&#xA; '(TeX-view-program-selection&#xA;   (quote&#xA;    (((output-dvi has-no-display-manager)&#xA;      &quot;dvi2tty&quot;)&#xA;     ((output-dvi style-pstricks)&#xA;      &quot;dvips and gv&quot;)&#xA;     (output-dvi &quot;xdvi&quot;)&#xA;     (engine-omega &quot;Atril&quot;)&#xA;     (output-pdf &quot;preview-pane-mode&quot;)&#xA;     (output-html &quot;xdg-open&quot;))))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i receive with the same XeLaTeX source as above the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;!...............................................  &#xA;! For immediate help type H &amp;lt;return&amp;gt;.&#xA;! &#xA;! See the fontspec documentation for further information.&#xA;! &#xA;! instead of plain &quot;latex&quot; or &quot;pdflatex&quot;.&#xA;! You must change your typesetting engine to, e.g., &quot;xelatex&quot; or &quot;lualatex&quot;&#xA;! &#xA;! The fontspec package requires either XeTeX or LuaTeX to function.&#xA;! &#xA;! Fatal fontspec error: &quot;cannot-use-pdftex&quot;&#xA;!&#xA;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-04-30T12:50:47.460" Title="Changing AUCTeX viewer results in errors claiming TeX-engine is wrongly set, although it is set correctly" Tags="|auctex|" AnswerCount="0" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="21648" PostTypeId="2" ParentId="21640" CreationDate="2016-04-15T21:13:33.383" Score="2" Body="&lt;p&gt;Just define your own minor mode that does what you want. It can turn on/off any number of modes when you turn it on/off. It can set variables, set up key bindings, and do pretty much anything you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, you make a super-minor-mode that encapsulates whatever you want, including a bunch of other minor modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turn on your new minor mode whenever you want - in your init file or on some hook or just interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f define-minor-mode&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-15T21:13:33.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21649" PostTypeId="2" ParentId="21640" CreationDate="2016-04-16T02:37:20.637" Score="1" Body="&lt;p&gt;You need to be aware of whether a minor mode is global or buffer-local before you can reliably enable or disable it along with other modes. (See the list of mode types at the bottom of &lt;a href=&quot;https://emacs.stackexchange.com/a/20915&quot;&gt;https://emacs.stackexchange.com/a/20915&lt;/a&gt; )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(FYI, all of the following information was ascertained by checking the definitions of the various functions with &lt;code&gt;M-x find-function&lt;/code&gt; -- although it helps to know what you're looking for, of course.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;evil-quickscope-mode&lt;/code&gt; and &lt;code&gt;evil-leader-mode&lt;/code&gt; are buffer-local, so you can enable or disable them along with other buffer-local minor modes. I'm not sure where your &lt;code&gt;hl-paren-mode&lt;/code&gt; is from, but I'll assume that's also buffer-local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;evil-visual-mark-mode&lt;/code&gt; is a &lt;em&gt;global&lt;/em&gt; minor mode, so attempting to toggle it in specific buffers is wrong. You can probably enable this once and then not touch it (being a global mode, I would presume that it knows when &lt;code&gt;evil&lt;/code&gt; is or isn't active). Assuming it's autoloaded:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'evil&#xA;  '(evil-visual-mark-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;evil-mode&lt;/code&gt; itself is a &lt;em&gt;globalized&lt;/em&gt; minor mode. That means it's a global mode which &lt;em&gt;controls&lt;/em&gt; a buffer-local mode (this one is named &lt;code&gt;evil-local-mode&lt;/code&gt;), and probably all of the interesting functionality is managed by the buffer-local mode. As such, I imagine you &lt;em&gt;actually&lt;/em&gt; want to tie your other buffer-local minor modes to &lt;code&gt;evil-local-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom my-evil-minor-modes&#xA;  '(evil-leader-mode&#xA;    evil-quickscope-mode&#xA;    hl-paren-mode)&#xA;  &quot;Buffer-local minor modes to enable or disable with `evil-local-mode'.&quot;&#xA;  :type  '(repeat symbol)&#xA;  :group 'evil)&#xA;&#xA;(defun my-evil-local-mode-hook ()&#xA;  &quot;Enable or disable all of `my-evil-minor-modes' with `evil-local-mode'.&quot;&#xA;  (let ((state (if evil-local-mode 1 0)))&#xA;    (mapc (lambda (mode) (funcall mode state))&#xA;          my-evil-minor-modes)))&#xA;&#xA;(add-hook 'evil-local-mode-hook 'my-evil-local-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You &lt;em&gt;could&lt;/em&gt; copy and modify that for &lt;code&gt;evil-mode-hook&lt;/code&gt; in order to enable/disable the global &lt;code&gt;evil-visual-mark-mode&lt;/code&gt; along with the also-global &lt;code&gt;evil-mode&lt;/code&gt;, but I don't think you actually want that, because you can enable &lt;code&gt;evil-local-mode&lt;/code&gt; without enabling &lt;code&gt;evil-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-04-16T03:16:01.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21650" PostTypeId="1" CreationDate="2016-04-16T03:15:16.050" Score="3" ViewCount="423" Body="&lt;p&gt;I often use emacs to edit oozie workflow/coordinator definitions and nxml mode is pretty handy for that. I never bothered much to get more than basic xml validation since schema-based validation seemed too complex to set up for me. But it turns out once I figured how to convert the provided xsd schemas to rnc (with the help of &lt;a href=&quot;http://debeissat.nicolas.free.fr/XSDtoRNG.php&quot; rel=&quot;nofollow&quot;&gt;http://debeissat.nicolas.free.fr/XSDtoRNG.php&lt;/a&gt; and &lt;a href=&quot;http://www.thaiopensource.com/relaxng/trang.html&quot; rel=&quot;nofollow&quot;&gt;trang&lt;/a&gt; and some hand editing) it's actually quite easy by adding the correct path to the &lt;code&gt;schema.xml&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. I can add this line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;namespace ns=&quot;uri:oozie:workflow:0.1&quot; uri=&quot;workflow-0.1.rnc&quot;/&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and so every xml which has the &lt;code&gt;xmlns&lt;/code&gt; attribute &lt;code&gt;uri:oozie:workflow:0.1&lt;/code&gt; gets validated with the &lt;code&gt;workflow-0.1.rnc&lt;/code&gt; schema. The sad thing is that this is only working for root elements, but oozie supports &quot;Actions Extensions&quot; with its one namespace and schema. E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[...]&#xA;&amp;lt;action name=&quot;sendFailureEmail&quot;&amp;gt;&#xA;    &amp;lt;email xmlns=&quot;uri:oozie:email-action:0.1&quot;&amp;gt;&#xA;        &amp;lt;to&amp;gt;${toEmailAlias}&amp;lt;/to&amp;gt;&#xA;        &amp;lt;subject&amp;gt;...&amp;lt;/subject&amp;gt;&#xA;        &amp;lt;body&amp;gt;...&amp;lt;/body&amp;gt;&#xA;    &amp;lt;/email&amp;gt;&#xA;    &amp;lt;ok to=&quot;fail&quot;/&amp;gt;&#xA;    &amp;lt;error to=&quot;fail&quot;/&amp;gt;&#xA;&amp;lt;/action&amp;gt;&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All three subelements of &lt;code&gt;email&lt;/code&gt; (&lt;code&gt;to&lt;/code&gt;, &lt;code&gt;subject&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt;) are marked as &quot;invalid&quot; in nxml because they are not specified in the workflow-0.1.rnc schema. I also generated the rnc version of the email-action schema and put in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;namespace ns=&quot;uri:oozie:email-action:0.1&quot; uri=&quot;email-action-0.1.rnc&quot;/&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into my &lt;code&gt;schema.xml&lt;/code&gt; but that doesn't help since it only applies for root elements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to get nxml to recognize nested namespaces for validation or is this simply an unsupported feature?&lt;/p&gt;&#xA;" OwnerUserId="468" LastEditorUserId="468" LastEditDate="2016-04-26T17:57:25.163" LastActivityDate="2016-04-26T17:57:25.163" Title="How to validate nested xml namespaces with associated schemata in nxml?" Tags="|nxml|xml|xml-schema|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21651" PostTypeId="1" AcceptedAnswerId="21653" CreationDate="2016-04-16T08:29:06.157" Score="2" ViewCount="719" Body="&lt;p&gt;I would like to have &lt;code&gt;split-window-sensibly&lt;/code&gt; splitting the window horizontally if the width is larger than height, or vertically otherwise. How can I achieve this? &lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-04-16T10:27:23.210" Title="When split-window-sensibly is called, how to make the decision depend on the width height ratio?" Tags="|window-splitting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21652" PostTypeId="2" ParentId="21651" CreationDate="2016-04-16T10:07:27.643" Score="0" Body="&lt;p&gt;In a graphic Emacs, &lt;code&gt;window-pixel-width&lt;/code&gt; and &lt;code&gt;window-pixel-height&lt;/code&gt; can return window's width and height in pixels, so if you only use graphic Emacs, these two functions should be sufficient, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-split-window ()&#xA;  (interactive)&#xA;  (if (&amp;gt; (window-pixel-width) (window-pixel-height))&#xA;      (split-window-horizontally)&#xA;    (split-window-vertically)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In a terminal Emacs, it seems that &lt;code&gt;window-width / window-pixel-width&lt;/code&gt; is almost a constant:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (display-graphic-p)&#xA;  (let ((w1 (window-width))&#xA;        (h1 (window-height))&#xA;        (w2 (window-pixel-width))&#xA;        (h2 (window-pixel-height)))&#xA;    (cons (/ (+ w2 .0) w1)&#xA;          (/ (+ h2 .0) h1))))&#xA;    ⇒ (8.112994350282486 . 16.93877551020408)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so we can get window-width in pixel base on this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq display-resolution-ration '(8.112994350282486 . 16.93877551020408))&#xA;&#xA;(defun window-width&amp;gt;height-p ()&#xA;  (if (display-graphic-p)&#xA;      (&amp;gt; (window-pixel-width)&#xA;         (window-pixel-height))&#xA;    (&amp;gt; (* (window-width) (car display-resolution-ration))&#xA;       (* (window-height) (cdr display-resolution-ration)))))&#xA;&#xA;(defun my-another-split-window ()&#xA;  (interactive)&#xA;  (if (window-width&amp;gt;height-p)&#xA;      (split-window-horizontally)&#xA;    (split-window-vertically)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-16T10:07:27.643" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21653" PostTypeId="2" ParentId="21651" CreationDate="2016-04-16T10:27:23.210" Score="2" Body="&lt;p&gt;The function &lt;code&gt;split-window-sensibly&lt;/code&gt; isn't really customizable. Instead, you need to set &lt;code&gt;split-window-preferred-function&lt;/code&gt; to your own function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here is a naive attempt to split horizontally if the width is larger than height, and vertically otherwise.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-sensible-window-split (&amp;amp;optional window)&#xA;  (cond&#xA;    ((and (&amp;gt; (window-width window)&#xA;             (window-height window))&#xA;          (window-splittable-p window 'horizontal))&#xA;      (with-selected-window window&#xA;        (split-window-right)))&#xA;    ((window-splittable-p window)&#xA;      (with-selected-window window&#xA;        (split-window-below)))))&#xA;&#xA;(setq split-window-preferred-function #'my-sensible-window-split)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A few notes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want a different height/width ratio than 1:1, since the height of one line is actually larger than the width of one column. For a 1:2 ratio, you should use this condition:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(&amp;gt; (window-width window)&#xA;   (* 2 (window-height window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;window-splittable-p&lt;/code&gt; takes into account &lt;code&gt;split-height-threshold&lt;/code&gt; and &lt;code&gt;split-width-threshold&lt;/code&gt;, in addition to the allowed minimal window sizes, you may want to change their default value. A value of 0 means no threshold. The default values (on my machine) are 80 and 160:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq split-height-threshold 0)&#xA;(setq split-width-threshold 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-04-16T10:27:23.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21654" PostTypeId="1" AcceptedAnswerId="21668" CreationDate="2016-04-16T12:44:13.137" Score="1" ViewCount="240" Body="&lt;p&gt;I've installed auto-complete inside emacs using elpa and have used M-x auto-complete-mode to check that it is enabled. However when I write the following short C code in emacs and put my cursor in front of the v and press the TAB key nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this not the correct key or is there something wrong with my setup?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main(void){&#xA;  varA = 5;&#xA;  varB = 7;&#xA;&#xA; v&#xA;&#xA; return 0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contents of my .emacs.d/elpa/ directory are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;archives&lt;/li&gt;&#xA;&lt;li&gt;auto-complete-20160329.2321&lt;/li&gt;&#xA;&lt;li&gt;popup-20160409.2133&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And my emacs.d/init.el contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(inhibit-startup-screen t))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&#xA;(require 'auto-complete)&#xA;(global-auto-complete-mode t)&#xA;&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11742" LastActivityDate="2016-04-17T14:52:24.580" Title="Having trouble using auto-complete in emacs" Tags="|auto-complete-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21655" PostTypeId="2" ParentId="21643" CreationDate="2016-04-16T13:06:22.733" Score="5" Body="&lt;p&gt;It also sometimes helps to &lt;code&gt;abort-recursive-edit&lt;/code&gt; with &lt;kbd&gt;C-]&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="719" LastActivityDate="2016-04-16T13:06:22.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21656" PostTypeId="1" AcceptedAnswerId="21674" CreationDate="2016-04-16T18:39:16.293" Score="3" ViewCount="1748" Body="&lt;p&gt;Here is my problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often copy text from a PDF (let's say one that is nicely formatted or scanned cleanly) and like to post it in an active org-mode file I have for academic research. However, pasting it with &lt;code&gt;C-y&lt;/code&gt; typically inherits a lot of the new lines that PDF text tends to carry, requiring me to fix the text manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've checked around for a solution to this problem, but the closest I found was a &lt;a href=&quot;https://stackoverflow.com/a/5194494&quot;&gt;previous question&lt;/a&gt; on overflow, but it only works partially. It requires that I select the newly pasted text with &lt;code&gt;C-x C-x&lt;/code&gt;, call &lt;code&gt;replace-string&lt;/code&gt; with &lt;code&gt;C-q C-j RET RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This typically removes most of the new lines effectively, but will often eliminate the space between two words that were on the end of the previous line and the first on the next (example would be 'betweentwo' in this sentence).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any common fix to this? If possible, I would like a general solution that allows me to paste text from any source as simply plain text. I'm using Linux and emacs 24.5 for clarification. I don't think any of my own configurations are in conflict, but if my init file is wanted, I can post that on request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Pictures to show the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's sample text of a pdf I want to copy. It's either a direct PDF export or a very clean scan, so I have no problem copying text accurately to my clipboard (No incorrect words, symbols, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vff3L.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vff3L.png&quot; alt=&quot;Sample Text&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what it looks like pasted &lt;code&gt;C-y&lt;/code&gt; in emacs (org-mode on). Notice how it doesn't just let the lines wrap naturally. This is actually a cleaner yank than most, but the problem is still present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SM2qH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SM2qH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what it looks like after I use the make-shift method I linked in the original post. As of now, I'm re-highlight the region with &lt;code&gt;C-x C-x&lt;/code&gt; and then use &lt;code&gt;ispell-region&lt;/code&gt; to methodically correct the words combined together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zExyc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zExyc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: YoungFrog's answer below clarified my problem. TL;DR, &lt;code&gt;M-q&lt;/code&gt;, fill-column, does well to reformat the text I yank from PDFs into paragraphs of length determined by emacs' &lt;code&gt;fill-column&lt;/code&gt; (70 by default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, I was using &lt;code&gt;visual-line-mode&lt;/code&gt;, which can make &lt;code&gt;fill-column&lt;/code&gt; look like it's not working right since the minor-mode is intended to visually wrap text with &quot;soft new lines&quot;, as YoungFrog also pointed out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A useful package that combines &lt;code&gt;visual-line-mode&lt;/code&gt; with the formatting benefits of &lt;code&gt;fill-column&lt;/code&gt; is &lt;code&gt;visual-fill-column&lt;/code&gt;, &lt;a href=&quot;http://melpa.org/#/visual-fill-column&quot; rel=&quot;nofollow noreferrer&quot;&gt;available on MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11660" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-04-17T21:32:32.483" Title="Copy and Paste From PDF to Emacs as Plain Text" Tags="|org-mode|copy-paste|pdf|yank|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="21658" PostTypeId="1" CreationDate="2016-04-16T20:46:57.950" Score="1" ViewCount="486" Body="&lt;p&gt;I would like the Python inferior process to start (if it is not already running) whenever I create a &lt;code&gt;python-mode&lt;/code&gt; buffer (for example, by visiting a .py file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some functions in anaconda-mode etc. depend on an inferior Python process running.  Also, I want to be able to &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt; and see the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything works fine if I create the &lt;code&gt;python-mode&lt;/code&gt; buffer, then manually run &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;kbd&gt;run-python&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I run &lt;code&gt;(add-hook 'python-mode-hook 'run-python)&lt;/code&gt;, then create a &lt;code&gt;python-mode&lt;/code&gt; buffer, I get no inferior Python process but this error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Wrong number of arguments: (1 . 3), 0&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if it's relevant, but I have this in my &lt;code&gt;custom.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar python-shell-interpreter &quot;ipython&quot;)&#xA;(defvar python-shell-interpreter-args &quot;-i&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had thought that &lt;a href=&quot;https://emacs.stackexchange.com/questions/10167/how-to-automatically-run-inferior-process-when-loading-major-mode-for-the-first&quot;&gt;this question&lt;/a&gt; would help but it doesn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please could you advise how to create an inferior Python process if it is not already running?  Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Versions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs 24.5.1 (i686-pc-mingw32)&lt;/li&gt;&#xA;&lt;li&gt;prelude latest at time of writing&lt;/li&gt;&#xA;&lt;li&gt;Python 3.5.1 (Anaconda 2.5.0 64-bit)&lt;/li&gt;&#xA;&lt;li&gt;Windows 10&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11324" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-04-16T22:09:06.137" Title="run-python does not work if added to python-mode-hook" Tags="|python|hooks|process|ipython|inferior-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21659" PostTypeId="2" ParentId="21658" CreationDate="2016-04-16T22:09:06.137" Score="3" Body="&lt;p&gt;Check the arguments that &lt;code&gt;run-python&lt;/code&gt; requires, and supply them in your hook function that calls it (use a lambda with &lt;code&gt;interactive&lt;/code&gt; or a named command that you defined). Otherwise, if you want to interact with it then use &lt;code&gt;call-interactively&lt;/code&gt; in the mode-hook function.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-16T22:09:06.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21660" PostTypeId="1" CreationDate="2016-04-17T03:21:07.140" Score="2" ViewCount="86" Body="&lt;p&gt;&lt;code&gt;company-transform&lt;/code&gt; seems can be used to apply function on candidates.&#xA;How to uppercase all SQL keywords which are in company complete candidates?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;only apply this transform function in SQL/NoSQL buffers, like some modes: &lt;code&gt;redis&lt;/code&gt;, &lt;a href=&quot;https://github.com/kiwanami/emacs-edbi&quot; rel=&quot;nofollow&quot;&gt;edbi&lt;/a&gt;, etc.&lt;/li&gt;&#xA;&lt;li&gt;use SQL keywords resource from somewhere like &lt;a href=&quot;https://github.com/Trevoke/sqlup-mode.el&quot; rel=&quot;nofollow&quot;&gt;sqlup-mode&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;show uppercased SQL keywords candidates in company popup menu.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-04-17T03:21:07.140" Title="How to use company-transform to uppercase SQL keywords" Tags="|company-mode|sql|capitalization|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21661" PostTypeId="1" CreationDate="2016-04-17T06:59:13.763" Score="5" ViewCount="313" Body="&lt;p&gt;How can I randomize headers in org mode? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. If I had a list like this, : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple&#xA;  1&#xA;* lemon&#xA;  2&#xA;* banana&#xA;* orange&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I randomize those headers and get lists like these?:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* lemon&#xA;  2&#xA;* apple&#xA;  1&#xA;* orange&#xA;* banana&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* orange&#xA;* lemon&#xA;  2&#xA;* banana&#xA;* apple&#xA;  1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I'm planning to randomize a much longer list.)&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-06-22T19:55:14.850" LastActivityDate="2023-05-31T14:08:15.443" Title="Randomize headers in Org mode" Tags="|sorting|header-line|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21662" PostTypeId="2" ParentId="21661" CreationDate="2016-04-17T07:12:50.070" Score="4" Body="&lt;p&gt;I found the answer &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2011-01/msg01226.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. All I had to do was creating a function and call it once I got into org-sort f(function).&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-04-17T07:12:50.070" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21663" PostTypeId="2" ParentId="19065" CreationDate="2016-04-17T10:37:29.660" Score="4" Body="&lt;p&gt;That was fixed in &lt;code&gt;v2.6.0&lt;/code&gt;, see &lt;a href=&quot;https://emacsair.me/2016/03/29/magit-2.6&quot; rel=&quot;nofollow&quot;&gt;the release announcement&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Hm, actually after looking at the screenshot a little more carefully, I think this might not actually be enough in your case. This is very strange and I am guessing that &quot;something&quot; is terribly misconfigured. (And it's not Magit. Magit does not &quot;appends ^M where it shouldn't&quot;. Instead it does &quot;not make any attempt to remove ^M, because there aren't supposed to be any in the first place&quot;.)&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-04-17T12:05:19.723" LastActivityDate="2016-04-17T12:05:19.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21664" PostTypeId="1" AcceptedAnswerId="21666" CreationDate="2016-04-17T10:40:00.690" Score="28" ViewCount="6303" Body="&lt;p&gt;If flycheck-mode is enabled for my init.el, I got the following kinds of errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The first line should be of the form: &quot;;;; package --- Summary&quot; (emacs-lisp-checkdoc)&#xA;...&#xA;The footer should be: (provide 'init)\n;;; init.el ends here (emacs-lisp-checkdoc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I stop flycheck from treating my init.el as a package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to following minimal start up file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; flycheck-mode&#xA;(require 'flycheck)&#xA;(global-flycheck-mode)&#xA;&#xA;(setq-default flycheck-disabled-checker '(emacs-lisp-checkdoc))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Only flycheck and its dependencies are enabled. &lt;code&gt;emacs-lisp-checkdoc&lt;/code&gt; is in the disabled checker list but flycheck still lists errors:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;0     warning         The first line should be of the form: &quot;;;; package --- Summary&quot; (emacs-lisp-checkdoc)&#xA;0     warning         You should have a section marked &quot;;;; Commentary:&quot; (emacs-lisp-checkdoc)&#xA;2   1 error           Cannot open load file: no such file or directory, flycheck (emacs-lisp)&#xA;3     warning         You should have a section marked &quot;;;; Code:&quot; (emacs-lisp-checkdoc)&#xA;5     warning         The footer should be: (provide 'test)\n;;; test.el ends here (emacs-lisp-checkdoc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.5.1 and the latest flycheck in the git repository (26snapshot).&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-04-20T00:19:28.567" LastActivityDate="2021-01-24T10:16:06.660" Title="How to prevent flycheck from treating my init.el as a package file?" Tags="|flycheck|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21665" PostTypeId="2" ParentId="19268" CreationDate="2016-04-17T11:07:31.157" Score="5" Body=" &#xA;&#xA;&lt;p&gt;When using &lt;code&gt;diff-hl&lt;/code&gt; and &lt;code&gt;magit&lt;/code&gt; =&gt; &lt;code&gt;v2.4.0&lt;/code&gt; you have to add this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as the information in the mode-line is concerned, I would recommend just ignoring that (or even removing it completely). The function which updates that is actually fairly inefficient, so one could say it is a good thing it isn't called more often.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit once contained a function which updated the VC mode-line information whenever it updated its own buffers. That was more efficient than the original, but still rather slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the definition.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun magit-refresh-vc-mode-line ()&#xA;  &quot;Update the information displayed by `vc-mode' in the mode-line.&#xA;Like `vc-mode-line' but simpler, more efficient, and less buggy.&quot;&#xA;  (setq vc-mode&#xA;        (if vc-display-status&#xA;            (magit-with-toplevel&#xA;              (let* ((rev (or (magit-get-current-branch)&#xA;                              (magit-rev-parse &quot;--short&quot; &quot;HEAD&quot;)))&#xA;                     (msg (cl-letf (((symbol-function #'vc-working-revision)&#xA;                                     (lambda (&amp;amp;rest _) rev)))&#xA;                            (vc-default-mode-line-string&#xA;                             'Git buffer-file-name))))&#xA;                (propertize&#xA;                 (concat &quot; &quot; msg)&#xA;                 'mouse-face 'mode-line-highlight&#xA;                 'help-echo (concat (get-text-property 0 'help-echo msg)&#xA;                                    &quot;\nCurrent revision: &quot; rev&#xA;                                    &quot;\nmouse-1: Version Control menu&quot;)&#xA;                 'local-map vc-mode-line-map)))&#xA;          &quot; Git&quot;))&#xA;  (force-mode-line-update))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There no longer is a hook which is run for every file-visiting buffer belonging to a repository for which Magit is refreshing its own buffers, so you would have to write a function which you could add to &lt;code&gt;magit-post-refresh-hook&lt;/code&gt;, which would then call &lt;code&gt;magit-refresh-vc-mode-line&lt;/code&gt; in the appropriate buffers. &lt;code&gt;diff-hl-margin-post-refresh&lt;/code&gt; might serve as inspiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But see &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/4c0mi3/the_biggest_performance_improvement_to_emacs_ive/&quot;&gt;The biggest performance improvement to Emacs I've made in years&lt;/a&gt;. Refreshing VC's mode-line information even more often might very well achieve the opposite. ;-)&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-04-17T11:07:31.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21666" PostTypeId="2" ParentId="21664" CreationDate="2016-04-17T11:10:44.470" Score="16" Body="&lt;p&gt;Add &lt;code&gt;emacs-lisp-checkdoc&lt;/code&gt; to &lt;code&gt;flycheck-disabled-checkers&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2016-04-20T05:09:43.847" LastActivityDate="2016-04-20T05:09:43.847" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="21667" PostTypeId="2" ParentId="21632" CreationDate="2016-04-17T11:26:00.357" Score="1" Body="&lt;p&gt;I would recommend against setting up some mechanism to automatically pull. Personally I avoid even pulling manually. What I usually do instead is to first only fetch. Once I have done that I can see what new commits, if any, were &quot;created elsewhere&quot;. I can then inspect those changes and decide, on a case by case basis, whether it is appropriate to merge or to rebase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually I rebase, which can be done using &lt;kbd&gt;r&lt;/kbd&gt;, followed by &lt;kbd&gt;u&lt;/kbd&gt; or &lt;kbd&gt;e &amp;lt;branch&amp;gt; RET&lt;/kbd&gt; as appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If after doing it explicitly like this for a while, you find that you always rebase (and I would assume that for dotfile repositories this might actually be the case), you can also configure pull to always rebase. To do so type &lt;kbd&gt;b&lt;/kbd&gt; to bring up the branch configuration popup and then type &lt;kbd&gt;M-r&lt;/kbd&gt; until &lt;code&gt;true&lt;/code&gt; is highlighted on the &lt;code&gt;pull.rebase&lt;/code&gt; line (i.e. set the repository-local value of &lt;code&gt;pull.rebase&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;). Alternatively you can configure just the current branch to be always rebase, using the same popup.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-04-18T00:46:37.807" LastActivityDate="2016-04-18T00:46:37.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21668" PostTypeId="2" ParentId="21654" CreationDate="2016-04-17T14:52:24.580" Score="1" Body="&lt;p&gt;Drew helped me solve it, you need to type more than 1 character for the auto-complete window to appear, it is installed ok, just wasn't using it correctly. This makes sense since you might be wanting to type &lt;code&gt;int&lt;/code&gt; or something and wouldn't want a window to come up every time you typed a single character.&lt;/p&gt;&#xA;" OwnerUserId="11742" LastActivityDate="2016-04-17T14:52:24.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21669" PostTypeId="1" AcceptedAnswerId="21857" CreationDate="2016-04-17T15:30:16.770" Score="4" ViewCount="174" Body="&lt;p&gt;I'd like to find a way to organize and access my (Latex) templates within Emacs and so far, I didn't find a satisfying solution. (&lt;a href=&quot;https://stackoverflow.com/questions/19335434/how-do-you-create-automatically-inserted-latex-template-with-emacsauctex&quot;&gt;This post&lt;/a&gt; is related, but doesn't solve my question.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that I want to typeset some article. Optimally, I would be able to create a template for a folder that contains several relevant files (and folders) and specify which of them should be opened in new buffers once I create a new project from this template. It might also be desirable that the generated file names follow a specified naming scheme relative to my project name (e.g. creating a project &quot;x&quot; should result in a new folder &quot;x&quot; containing files &quot;x_main.tex&quot;, &quot;x_coverpage.tex&quot;, &quot;x_options.tex&quot;, ... and folders &quot;images/&quot;, ... ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any plugin that suits my purposes? What about other solutions?&lt;/p&gt;&#xA;" OwnerUserId="10886" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-04-26T08:13:46.920" Title="Yet another request for Emacs templates" Tags="|latex|template|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21670" PostTypeId="1" CreationDate="2016-04-17T17:36:35.323" Score="1" ViewCount="137" Body="&lt;p&gt;In my code I have the following to delimit regions that initiate/end &lt;code&gt;whatevz-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'mmm-mode)&#xA;(setq mmm-global-mode 'maybe)&#xA;&#xA;(mmm-add-classes&#xA;  '((whatevz&#xA;          :submode whatevz-mode&#xA;          :front &quot;.*whatevz\(\&quot;\&quot;\&quot;&quot;&#xA;          :back &quot;.*\&quot;\&quot;\&quot;\)&quot;)))&#xA;&#xA;(mmm-add-mode-ext-class 'whatevz-mode nil 'whatevz)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to add several possible snippets that delimit &lt;code&gt;whatevz-mode&lt;/code&gt; (The above only shows &lt;code&gt;whatevz(&quot;&quot;&quot;&lt;/code&gt;). Do I have to add that to the &lt;code&gt;add-classes&lt;/code&gt;   above - creating a much more advanced regex - or can I call &lt;code&gt;mmm-add-classes&lt;/code&gt; again with another simple regex? &lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="25" LastEditDate="2016-09-07T21:20:38.807" LastActivityDate="2016-09-07T21:20:38.807" Title="In mmm-mode can you have several classes for the same mode?" Tags="|minor-mode|mmm-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21671" PostTypeId="2" ParentId="21670" CreationDate="2016-04-17T18:09:46.020" Score="1" Body="&lt;p&gt;Yes, the latter is possible. You can have two different add-classes for the same embedded language, but you must name them differently.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2016-04-17T18:09:46.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21672" PostTypeId="1" AcceptedAnswerId="21677" CreationDate="2016-04-17T18:57:13.873" Score="8" ViewCount="2266" Body="&lt;p&gt;I have a UI element in my mode-line provided by which-func-mode. I also have it in my header-line, pictured below (the blue &quot;render&quot; text):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rRIsK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rRIsK.png&quot; alt=&quot;Image of element I would like to style&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find out which face this is so I can style it to make it easier to read?&lt;/p&gt;&#xA;" OwnerUserId="10430" LastEditorUserId="105" LastEditDate="2016-04-17T20:51:43.853" LastActivityDate="2016-04-18T05:40:23.370" Title="How can I find out what face I need to change in the mode-line?" Tags="|faces|themes|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21673" PostTypeId="2" ParentId="21672" CreationDate="2016-04-17T19:42:53.007" Score="5" Body="&lt;p&gt;On your current buffer, make sure you have no text selected and issue &lt;code&gt;M-x customize-face&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If no faces are selected, it should prompt you with &lt;code&gt;Customize face (default `all faces')&lt;/code&gt;. Hit &lt;code&gt;RET&lt;/code&gt; and you will load the &lt;code&gt;*Customize Faces*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your buffer will then list every single face used in your emacs config by every mode (I believe), including mode-line! Searching for faces related to &quot;mode&quot; with &lt;code&gt;C-s&lt;/code&gt; gave me the following:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/fkRNa.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fkRNa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are quite a few faces in my emacs config, so I had to hit &lt;code&gt;C-s&lt;/code&gt; at least 10 or so times before I got to the actual mode-line faces, so make sure you check exhaustively if you don't see them at first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, just click on the arrow for the face you'd like to edit and you'll see the current configurations displayed like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QhDSJ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QhDSJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can modify your faces in all sorts of ways besides just color/background by clicking &lt;code&gt;show all attributes&lt;/code&gt;, but be mindfull of how such changes can goof with other modes and customizations like your current theme. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I chose to edit the base &lt;code&gt;Mode Line&lt;/code&gt; face. Here's what it looked like after changing its color and saving the changes (I chose Magenta. It was previously white, which you can see in the previous screenshot):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3Y7MT.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3Y7MT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can make changes last only for the current session, the buffer, or permanently. &lt;/p&gt;&#xA;" OwnerUserId="11660" LastEditorUserId="11660" LastEditDate="2016-04-17T19:53:16.923" LastActivityDate="2016-04-17T19:53:16.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21674" PostTypeId="2" ParentId="21656" CreationDate="2016-04-17T20:35:36.737" Score="3" Body="&lt;p&gt;You're looking for &lt;code&gt;M-q&lt;/code&gt; (which runs the command &lt;code&gt;fill-paragraph&lt;/code&gt;) : it will refill the paragraph according to the current value of &lt;code&gt;fill-column&lt;/code&gt; by removing/adding hard newlines at the right spots for you.  You can use &lt;code&gt;C-x f&lt;/code&gt; to change the value of &lt;code&gt;fill-column&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you prefer to avoid hard newlines at all (e.g. because you rely on &lt;code&gt;visual-line-mode&lt;/code&gt; and &lt;code&gt;word-wrap&lt;/code&gt;), you can set &lt;code&gt;fill-column&lt;/code&gt; to a ridiculously large value (like 99999), or let &lt;code&gt;unfill-paragraph&lt;/code&gt; or &lt;code&gt;unfill-region&lt;/code&gt; do that for you. Those functions are available on emacswiki as you already noticed in a comment :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/UnfillParagraph&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/UnfillParagraph&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/UnfillRegion&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/UnfillRegion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-04-17T20:35:36.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21675" PostTypeId="1" AcceptedAnswerId="21681" CreationDate="2016-04-17T21:16:38.050" Score="0" ViewCount="187" Body="&lt;p&gt;I would like to auto-revert some remote image/pdf files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have activated the option &#xA;&lt;code&gt;(setq auto-revert-remote-files t)&lt;/code&gt; and see that the file effectively auto-revert. Yet the image does not update. I need to go to the image buffer and toggle between editing or viewing the &lt;code&gt;C-c C-c&lt;/code&gt; to see the changes. &#xA;Is there a way to avoid the last step?&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="5213" LastEditDate="2016-04-30T11:26:08.650" LastActivityDate="2016-04-30T11:26:08.650" Title="Emacs auto-revert remote image file" Tags="|auto-revert-mode|revert-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21676" PostTypeId="2" ParentId="21627" CreationDate="2016-04-17T22:05:31.103" Score="6" Body="&lt;p&gt;Emacs Lisp doesn't have any support for automatic type checking, whether in the byte compiler or at runtime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idiomatic way to report an error at runtime is to check the argument against a &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Type-Predicates.html#Type-Predicates&quot;&gt;predicate function&lt;/a&gt;, and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Signaling-Errors.html#Signaling-Errors&quot;&gt;signal&lt;/a&gt; the error &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Type-Predicates.html#index-wrong_002dtype_002dargument&quot;&gt;`wrong-type-argument&lt;/a&gt; if it doesn't match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, to express a choice between a small, fixed number of items, the idiomatic method is to use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Symbols.html#Symbols&quot;&gt;symbols&lt;/a&gt;, not strings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun graph-type-p (object)&#xA;  &quot;Return t if OBJECT is a graph type.&#xA;&#xA;The possible graph types are `dag' and `rulegraph'.&quot;&#xA;  (memq object '(dag rulegraph)))&#xA;&#xA;(defun build-graph (graph-type data)&#xA;  &quot;…&quot;&#xA;  (unless (graph-type-p graph-type)&#xA;    (signal 'wrong-type-argument (list 'graph-type-p graph-type)))&#xA;  …)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-04-17T22:05:31.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21677" PostTypeId="2" ParentId="21672" CreationDate="2016-04-18T01:21:09.117" Score="10" Body="&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x list-faces-display&lt;/code&gt;&lt;/strong&gt; shows you all of the faces currently defined, including those with names &lt;code&gt;mode-line*&lt;/code&gt;. It shows you the appearance of each face. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it lets you &lt;em&gt;customize&lt;/em&gt; any of them - just click the face name. (See @Zaile's nice &lt;a href=&quot;https://emacs.stackexchange.com/a/21673/105&quot;&gt;answer&lt;/a&gt; about using Customize to customize a face.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum, it gives you a WYSIWYG way to find out what faces are involved and customize them.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-04-18T01:21:09.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21678" PostTypeId="1" AcceptedAnswerId="21761" CreationDate="2016-04-18T03:13:10.537" Score="4" ViewCount="299" Body="&lt;p&gt;How can I force all the letters go left to right including the characters from right-to-left languages in all buffers? Currently it displays the lines with right-to-left characters bidirectionally.&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2020-11-01T12:59:33.850" Title="Forcing the left-to-right order in all buffers" Tags="|bidirectional-support|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21679" PostTypeId="2" ParentId="21672" CreationDate="2016-04-18T05:02:46.467" Score="2" Body="&lt;p&gt;The fact pattern of this particular question is somewhat unique -- i.e., relating to changing a face from the built-in library &lt;code&gt;which-func.el&lt;/code&gt;.  The author(s) of the library at issue chose to assign the &lt;code&gt;which-func&lt;/code&gt; face to &lt;code&gt;:group 'which-func&lt;/code&gt;.  Neither the name of the face, nor the name of the group, contain the term &lt;code&gt;mode-line&lt;/code&gt;.  If we knew the name of the group ahead of time, we could customize that group -- e.g., &lt;code&gt;M-x customize-group RET which-func RET&lt;/code&gt;.  We can locate the library with &lt;code&gt;M-x find-library RET which-func RET&lt;/code&gt;.  This particular library has only one face, so word-searching for the word &lt;code&gt;defface&lt;/code&gt; takes us directly to the face named &lt;code&gt;which-func&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eval-expression RET (require 'which-func) RET&#xA;&#xA;M-x customize-face RET which-func RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Depending upon whether an author has endeavored to adhere to standard practices when defining faces and groups, it may be necessary in some cases to inspect the variables &lt;code&gt;mode-line-format&lt;/code&gt; or &lt;code&gt;header-line-format&lt;/code&gt; for additional clues.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-04-18T05:40:23.370" LastActivityDate="2016-04-18T05:40:23.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21680" PostTypeId="1" AcceptedAnswerId="21686" CreationDate="2016-04-18T06:20:26.660" Score="3" ViewCount="280" Body="&lt;p&gt;Emacs manuals (such as the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/elisp.html&quot; rel=&quot;nofollow&quot;&gt;Emacs Lisp Reference Manual&lt;/a&gt; are provided at a &lt;code&gt;.../emacs/manual/&amp;lt;manual-name&amp;gt;.html&lt;/code&gt; URL. Surprisingly, the version number that the manual applies to is not part of the URL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, Emacs-specific manuals are versioned alongside Emacs itself (e.g. there is an Emacs Lisp Reference Manual for Emacs 24.5, one for Emacs 25.0, etc.). &lt;strong&gt;Where can older manuals be found&lt;/strong&gt;? The &lt;a href=&quot;http://open-source-box.org/emacs/&quot; rel=&quot;nofollow&quot;&gt;Emacs download mirror&lt;/a&gt; contains a single Emacs Lisp reference from 2002.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it'd be a good idea for the &lt;code&gt;.../emacs/manual/&amp;lt;manual-name&amp;gt;.html&lt;/code&gt; site to always refer to the newest manual, but for older version to be available at &lt;code&gt;...emacs/&amp;lt;version-number&amp;gt;/manual/&amp;lt;manual-name&amp;gt;.html&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="9995" LastEditDate="2016-04-27T19:20:54.657" LastActivityDate="2016-04-27T19:20:54.657" Title="Older versions of manuals" Tags="|manual|version-support|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21681" PostTypeId="2" ParentId="21675" CreationDate="2016-04-18T06:55:39.520" Score="0" Body="&lt;p&gt;This sounds similar to Emacs bug 21598, &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21598&quot; rel=&quot;nofollow&quot; title=&quot;here&quot;&gt;see here&lt;/a&gt;. Could you pls check whether it is the same problem?&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-04-18T06:55:39.520" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21682" PostTypeId="1" AcceptedAnswerId="21683" CreationDate="2016-04-18T07:00:21.433" Score="0" ViewCount="133" Body="&lt;p&gt;I'm using &lt;code&gt;web-mode&lt;/code&gt; to edit my &lt;code&gt;erb&lt;/code&gt; files. When I type &lt;code&gt;&amp;lt;%&lt;/code&gt; emacs (or &lt;code&gt;web-mode&lt;/code&gt;) adds a closing &lt;code&gt;%&amp;gt;&lt;/code&gt; bracket. But when I type a space &lt;em&gt;after&lt;/em&gt; the percent sign (i.e. &lt;code&gt;%&lt;/code&gt;), an additional &lt;code&gt;%&amp;gt;&lt;/code&gt; bracket is added. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;prelude&lt;/code&gt; so there's a clue in &lt;code&gt;prelude-web.el&lt;/code&gt; but I'm not sure how to interpret it. The relevant looking code looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-with-modes '(web-mode)                                                                                                           &#xA;  (sp-local-pair &quot;%&quot; &quot;%&quot;                                                                                                             &#xA;                 :unless '(sp-in-string-p)                                                                                           &#xA;                 :post-handlers '(((lambda (&amp;amp;rest _ignored)                                                                          &#xA;                                     (just-one-space)                                                                                &#xA;                                     (save-excursion (insert &quot; &quot;)))                                                                  &#xA;                                   &quot;SPC&quot; &quot;=&quot; &quot;#&quot;)))                                                                                  &#xA;  (sp-local-pair &quot;&amp;lt;% &quot;  &quot; %&amp;gt;&quot; :insert &quot;C-c %&quot;)                                                                                       &#xA;  (sp-local-pair &quot;&amp;lt;%= &quot; &quot; %&amp;gt;&quot; :insert &quot;C-c =&quot;)                                                                                       &#xA;  (sp-local-pair &quot;&amp;lt;%# &quot; &quot; %&amp;gt;&quot; :insert &quot;C-c #&quot;)                                                                                       &#xA;  (sp-local-tag &quot;%&quot; &quot;&amp;lt;% &quot;  &quot; %&amp;gt;&quot;)                                                                                                    &#xA;  (sp-local-tag &quot;=&quot; &quot;&amp;lt;%= &quot; &quot; %&amp;gt;&quot;)                                                                                                    &#xA;  (sp-local-tag &quot;#&quot; &quot;&amp;lt;%# &quot; &quot; %&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I configure emacs to stop adding these additional characters?&lt;/p&gt;&#xA;" OwnerUserId="653" LastEditorUserId="653" LastEditDate="2016-04-18T07:11:22.403" LastActivityDate="2016-05-18T07:25:54.983" Title="How do I configure emacs to stop adding an extra closing bracket when hitting space?" Tags="|web-mode|prelude|ruby|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21683" PostTypeId="2" ParentId="21682" CreationDate="2016-04-18T07:18:23.907" Score="0" Body="&lt;p&gt;Here's a solution. Hopefully it will get pulled into &lt;code&gt;prelude&lt;/code&gt; main branch soon. You can edit the file cited above:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/prelude/pull/805&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bbatsov/prelude/pull/805&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="653" LastActivityDate="2016-04-18T07:18:23.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21684" PostTypeId="1" CreationDate="2016-04-18T07:36:28.680" Score="0" ViewCount="294" Body="&lt;p&gt;I'm having trouble hiding the display of &lt;code&gt;which-func&lt;/code&gt; from powerline. I'm successfully showing it in the header, but it stubbornly won't be removed from powerline. I've tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-format (delete (assoc 'which-func-mode&#xA;                                      mode-line-format) mode-line-format))&#xA;&#xA;(setq mode-line-misc-info (delete (assoc 'which-func-mode&#xA;                                         mode-line-misc-info) mode-line-misc-info)&#xA;&#xA;(setq mode-line-format (assq-delete-all 'which-func-mode mode-line-format))&#xA;&#xA;(setq mode-line-misc-info (assq-delete-all 'which-func-mode mode-line-misc-info))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also tried the following, hooking into various points around both powerline and which-func:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(powerline-which-func 'which-func nil)&#xA;(powerline-raw which-func-format nil 'l)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've had this working in the past, but no joy this time round.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Halp?&lt;/p&gt;&#xA;" OwnerUserId="10430" LastEditorUserId="10430" LastEditDate="2016-04-20T07:08:58.497" LastActivityDate="2016-04-20T07:08:58.497" Title="How do I hide which-func from powerline in 24.5?" Tags="|mode-line|powerline|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21685" PostTypeId="1" AcceptedAnswerId="21695" CreationDate="2016-04-18T08:40:06.467" Score="0" ViewCount="476" Body="&lt;p&gt;I am using jedi and auto-complete to provide some help during my Python coding session. As advertised in the &lt;a href=&quot;http://tkf.github.io/emacs-jedi/latest/&quot; rel=&quot;nofollow noreferrer&quot;&gt;jedi's website&lt;/a&gt;, completion and documentation are shown correctly as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yugiM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yugiM.png&quot; alt=&quot;Popup window with a large frame&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when the frame is barely larger than the function's name and basic info (the first popup, in gray), then the documentation popup (the second one, in yellow) is crammed so it's not larger than the frame that contained the code. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kPNRA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kPNRA.png&quot; alt=&quot;Popup window with a smaller frame&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior also happens when you have several nested scopes in your code and your function is near the left border of the frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible for the popup to be bigger than the containing frame? Does anyone know another solution for this behavior?&lt;/p&gt;&#xA;" OwnerUserId="864" LastActivityDate="2016-04-18T17:51:10.450" Title="Jedi popup window: how to make it larger than its parent frame" Tags="|auto-complete-mode|popup|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21686" PostTypeId="2" ParentId="21680" CreationDate="2016-04-18T08:41:42.370" Score="1" Body="&lt;p&gt;I'm not aware of any official archive. Some very old versions (up to 21.2) are in the &lt;a href=&quot;ftp://ftp.gnu.org/old-gnu/emacs/&quot; rel=&quot;nofollow&quot;&gt;old-gnu directory&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most versions since 21.4 (as well as a few &lt;a href=&quot;http://snapshot.debian.org/package/elisp-manual/&quot; rel=&quot;nofollow&quot;&gt;older ones&lt;/a&gt;) are availble in the &lt;a href=&quot;http://snapshot.debian.org/package/?cat=e&quot; rel=&quot;nofollow&quot;&gt;Debian snapshot archive&lt;/a&gt;, in the package &lt;code&gt;emacs&lt;em&gt;NN&lt;/em&gt;-non-dfsg&lt;/code&gt; (&lt;a href=&quot;http://snapshot.debian.org/package/emacs22-non-dfsg/&quot; rel=&quot;nofollow&quot;&gt;22&lt;/a&gt;, &lt;a href=&quot;http://snapshot.debian.org/package/emacs23-non-dfsg/&quot; rel=&quot;nofollow&quot;&gt;23&lt;/a&gt;, &lt;a href=&quot;http://snapshot.debian.org/package/emacs24-non-dfsg/&quot; rel=&quot;nofollow&quot;&gt;24&lt;/a&gt;, &lt;a href=&quot;http://snapshot.debian.org/package/emacs25-non-dfsg/&quot; rel=&quot;nofollow&quot;&gt;25&lt;/a&gt;). The file &lt;code&gt;emacs&lt;em&gt;NN&lt;/em&gt;-non-dsfg_&lt;em&gt;VERSION&lt;/em&gt;.orig.tar.gz&lt;/code&gt; contains the sources, and the file &lt;code&gt;emacs&lt;em&gt;NN&lt;/em&gt;-non-dsfg_&lt;em&gt;VERSION&lt;/em&gt;_all.deb&lt;/code&gt; contains the info file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not all systems support deb files out of the box. They can be extracted on Debian and derivatives with &lt;code&gt;dpkg -L …&lt;/code&gt;. In Emacs, you can open them with &lt;code&gt;deb-view.el&lt;/code&gt; from the &lt;a href=&quot;https://alioth.debian.org/scm/viewvc.php/?root=pkg-goodies-el&quot; rel=&quot;nofollow&quot;&gt;Debian emacs-goodies compilation&lt;/a&gt;. On a Unix command line, use &lt;code&gt;ar p ….deb data.tar.xz | xzcat | tar -xf -&lt;/code&gt; (replace &lt;code&gt;.tar.xz | xzcat&lt;/code&gt; by &lt;code&gt;.tar.gz | zcat&lt;/code&gt; for older versions) (&lt;code&gt;ar&lt;/code&gt; is part of the &lt;code&gt;binutils&lt;/code&gt; collection).&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-04-18T08:41:42.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21687" PostTypeId="2" ParentId="21684" CreationDate="2016-04-18T08:50:24.393" Score="1" Body="&lt;p&gt;This works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((which-func '(which-func-mode (&quot;&quot; which-func-format &quot; &quot;))))&#xA;   (setq-default mode-line-format (remove which-func mode-line-format))&#xA;   (setq-default mode-line-misc-info (remove which-func mode-line-misc-info))&#xA;   (setq-default header-line-format which-func))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It removes &lt;code&gt;which-func&lt;/code&gt; from the mode-line, and place it in the header.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2016-04-18T08:50:24.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21688" PostTypeId="2" ParentId="19654" CreationDate="2016-04-18T09:46:07.307" Score="2" Body="&lt;p&gt;Apparently if a line is not properly (newline-) terminated it is ignored in output.  The following example shows it:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ocaml :results output&#xA;print_string &amp;quot;hello\nagain&amp;quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I would tend to call this a bug since the &lt;a href=&quot;http://orgmode.org/manual/Results-of-evaluation.html#Results-of-evaluation&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt; says (emphasis mine):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;14.9.1.2 ‘:results output’&lt;/p&gt;&#xA;&lt;p&gt;The code is passed to the interpreter as an external process, and &lt;strong&gt;the&#xA;contents of the standard output stream&lt;/strong&gt; are returned as text.  (In&#xA;certain languages this also contains the error output stream; this is an&#xA;area for future work.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;However, see an interesting loosely related discussion on &lt;a href=&quot;https://unix.stackexchange.com/questions/18743/whats-the-point-in-adding-a-new-line-to-the-end-of-a-file/18789#18789&quot;&gt;unix SE&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A text file, under unix, consists of a series of lines, each of which ends with a newline character (\n). A file that is not empty and does not end with a newline is therefore not a text file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-04-18T09:46:07.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21689" PostTypeId="1" AcceptedAnswerId="21731" CreationDate="2016-04-18T10:22:52.083" Score="1" ViewCount="44" Body="&lt;p&gt;Consider the following in an .org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Meetings&#xA;** TODO Meeting Thing                      :meeting:&#xA;   DEADLINE: &amp;lt;2016-04-15 Fri 11:00 +1w -5d&amp;gt;&#xA;   :PROPERTIES:&#xA;   :LOGGING: nil&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I typically use &lt;code&gt;C-c C-t&lt;/code&gt; a few times to mark such entries to &lt;code&gt;DONE&lt;/code&gt;, after which Org will reschedule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in this case, Org is rescheduling the entry with an empty date, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEADLINE: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs (snapshot) version is 25.1.50.2. Org version is 8.3.3.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="5345" LastEditDate="2016-04-20T11:22:28.400" LastActivityDate="2016-04-20T11:29:27.673" Title="Org DEADLINE empty for repeated task" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21690" PostTypeId="2" ParentId="2710" CreationDate="2016-04-18T15:44:46.717" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/louiskottmann/zygospore.el&quot; rel=&quot;nofollow&quot;&gt;Zygospore&lt;/a&gt; provides a quick fix for the situation where you have multiple windows open, and want to temporarily maximize one of them. It modifies the behaviour of &lt;code&gt;C-x 1&lt;/code&gt;. When you have multiple windows open, it behaves like the default &lt;code&gt;delete-other-windows&lt;/code&gt;, and removes all the windows except for the one you are viewing. When you hit it again, it restores the other windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Winner-mode provides a more general solution, but zygospore is great for temporarily zooming in on a single window in a frame. The best thing is it doesn't use any new keybindings - it re-defines &lt;code&gt;C-x 1&lt;/code&gt; in a very intuitive way, so there are no new bindings to learn.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-18T15:44:46.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21691" PostTypeId="1" AcceptedAnswerId="21962" CreationDate="2016-04-18T15:49:02.630" Score="0" ViewCount="283" Body="&lt;p&gt;I just cloned the source and try to build Emacs under my debian Jessie, but has some problems:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[23:31:04 coeus]$ ./autogen.sh all&#xA;Checking whether you have the necessary tools...&#xA;(Read INSTALL.REPO for more details on building Emacs)&#xA;Checking for autoconf (need at least version 2.65)...&#xA;ok&#xA;Checking for automake (need at least version 1.11)...&#xA;ok&#xA;Your system has the required tools.&#xA;Running 'autoreconf -fi -I m4' ...&#xA;Configuring local git repository...&#xA;cp: cannot stat ‘--git-common-dir/config’: No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;May I know what I have missed? I didn't do this for a while, but I did successfully build emacs from master branch in past. any help will be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coeus&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2016-04-30T15:40:32.143" Title="Emacs build error when use &quot;autogen.sh all&quot; to generate configure for master branch" Tags="|git|build|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21692" PostTypeId="2" ParentId="21601" CreationDate="2016-04-18T15:59:29.280" Score="2" Body="&lt;p&gt;You cannot easily fix this issue.  It's a consequence of how we highlight errors in Flycheck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently Flycheck can only receive a single position from a syntax checker, as a pair of line and column.  A single character highlight is all too easy to overlook, however, so Flycheck tries to be smart and expand the highlighting region reasonably.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact behaviour is controlled by &lt;code&gt;flycheck-highlighting-mode&lt;/code&gt; whose default &lt;code&gt;symbols&lt;/code&gt;—which you see here—expands the highlighting to symbol boundaries around the column position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbol boundaries are defined by the syntax table, but there's only one for the entire buffer.  If the syntax table turns &lt;code&gt;'&lt;/code&gt; into punctuation this behaviour spills into comments even though these are typically free text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the behaviour you see here: The symbol around the column reported by your syntax checker simply ends at &lt;code&gt;'&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At some point we will support &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/527&quot; rel=&quot;nofollow&quot;&gt;error ranges&lt;/a&gt; in Flycheck which let syntax checkers explicitly specify the whole region for the highlight, but that's still far off.  At this point we'll also provide a &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/774&quot; rel=&quot;nofollow&quot;&gt;more flexible API to add Flycheck highlights&lt;/a&gt; to the current buffer which will let you programmatically add errors to the current buffer without the additional indirection of a syntax checker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But meanwhile you simply have to accept this behaviour.  Other than advising as you suggested there's nothing that you can do.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-04-18T15:59:29.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21694" PostTypeId="1" AcceptedAnswerId="21776" CreationDate="2016-04-18T16:46:01.947" Score="4" ViewCount="513" Body="&lt;p&gt;If I try and use emacs &lt;code&gt;C-u align-regexp&lt;/code&gt; on the below with &lt;code&gt;\(\s-*\)|&lt;/code&gt; and 1 and 1 and y I get an incorrectly formatted result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Foobar Foobar foobar| foobar foobar |&#xA;         ||&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Incorrectly formatted result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Foobar Foobar foobar                  | foobar foobar |&#xA;                                      |               |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the large amount of whitespace before the &lt;code&gt;|&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using a non &lt;code&gt;C-u&lt;/code&gt; modified &lt;code&gt;align-regexp&lt;/code&gt; works as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain what's going on? Can someone also explain the dash in the &lt;code&gt;\(\s-*\)&lt;/code&gt; part of the regexp? Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="5199" LastEditorUserId="5213" LastEditDate="2016-04-30T14:12:38.823" LastActivityDate="2016-04-30T14:12:38.823" Title="How to make Emacs align-regexp work with leading spaces" Tags="|align|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21695" PostTypeId="2" ParentId="21685" CreationDate="2016-04-18T17:51:10.450" Score="1" Body="&lt;p&gt;I've decided to do some looking around for you on the &lt;a href=&quot;https://github.com/auto-complete/popup-el/issues&quot; rel=&quot;nofollow&quot;&gt;github popup.el issues&lt;/a&gt;. What I found was &lt;a href=&quot;https://github.com/auto-complete/popup-el/issues/21&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt; which seems to say that if there is a scroll bar the window won't go over it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There also seems to be a &lt;code&gt;max-width&lt;/code&gt; variable which you can set to limit how large the grey portion of the popup is. That is talked about in &lt;a href=&quot;https://github.com/auto-complete/popup-el/pull/29&quot; rel=&quot;nofollow&quot;&gt;this pull request&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-04-18T17:51:10.450" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21696" PostTypeId="1" CreationDate="2016-04-18T18:02:11.130" Score="4" ViewCount="2964" Body="&lt;p&gt;Is there a way to open multiple buffers that are open at the same time? &#xA;The idea is to be able to refactor code and variable names in multiple files at once. I know that &lt;code&gt;dired-do-find-regexp-and-replace&lt;/code&gt; exists but I was hopeing for a way where I could more clearly see what was happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps something related to &lt;code&gt;multi-occur&lt;/code&gt;. Or allowing me to have multiple files open in one buffer and then using &lt;code&gt;multiple-cursors&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="105" LastEditDate="2018-11-10T23:50:13.623" LastActivityDate="2019-10-11T13:11:47.763" Title="How to edit multiple files at once?" Tags="|files|multiple-cursors|refactoring|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="21697" PostTypeId="2" ParentId="21696" CreationDate="2016-04-18T18:09:57.863" Score="5" Body="&lt;p&gt;You can give &lt;a href=&quot;https://github.com/magnars/multifiles.el&quot; rel=&quot;noreferrer&quot;&gt;multifiles&lt;/a&gt; a try. From its README:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Bind a key to mf/mirror-region-in-multifile, let's say C-!. Now mark a part of the buffer and press it. A new &lt;em&gt;multifile&lt;/em&gt; buffer pops up. Mark some other part of another file, and press C-! again. This is added to the &lt;em&gt;multifile&lt;/em&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can now edit the &lt;em&gt;multifile&lt;/em&gt; buffer, and watch the original files&#xA;  change. Or you can edit the original files and watch the &lt;em&gt;multifile&lt;/em&gt;&#xA;  buffer change.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Saving the &lt;em&gt;multifile&lt;/em&gt; buffer will save all the original files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2016-04-18T18:09:57.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21698" PostTypeId="1" AcceptedAnswerId="21701" CreationDate="2016-04-18T18:56:32.087" Score="1" ViewCount="298" Body="&lt;p&gt;I wanted to look up the different &lt;code&gt;hs-special-mode-alist&lt;/code&gt; &lt;code&gt;forward-sexp&lt;/code&gt; functions for inspiration to create my own and this is what the &lt;code&gt;python&lt;/code&gt; &lt;code&gt;forward-sexp&lt;/code&gt; looks like on my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; (MODE START END COMMENT-START FORWARD-SEXP-FUNC ADJUST-BEG-FUNC)&#xA;&#xA;((python-mode &quot;^\\s-*\\(?:def\\|class\\)\\&amp;gt;&quot; nil &quot;#&quot;&#xA;  #[257 &quot;\300 \207&quot;&#xA;                    [python-nav-end-of-defun]&#xA;  2 &quot;\n\n(fn ARG)&quot;]&#xA; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The thing that starts with &lt;code&gt;#[257 &quot;\300 \207&quot;&lt;/code&gt; and ends with &lt;code&gt;ARG&quot;]&lt;/code&gt; is supposed to be a function for moving forward with &lt;code&gt;forward-sexp&lt;/code&gt;. What the h is it showing? Is that valid elisp? Is it compiled code? Just gibberish?&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2016-04-18T20:21:55.420" Title="How does this forward-sexp-function in hs-special-mode-alist work?" Tags="|hideshow|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21699" PostTypeId="1" CreationDate="2016-04-18T19:07:40.857" Score="2" ViewCount="2708" Body="&lt;p&gt;I am having a hard time getting GPG to work in Emacs under Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The configuration options I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq epg-gpg-program &quot;c:/Program Files/GNU/GnuPG/gpg2.exe&quot;)&#xA;&#xA;  (setq epg-gpg-home-directory &quot;C:/Documents and Settings/user/My Documents/.gnupg&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Upon opening a .gpg file with Emacs 25 for Windows I get the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;epg-context--make: GPG error: &quot;no usable configuration&quot;, OpenPGP&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With Emacs 24.3 the error is&#xA;epa-file--find-file-not-found-function: Opening input file: Decryption failed, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need some special version of GnuPG?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional configuration options?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2017-10-13T02:56:05.990" Title="How to configure EasyPG with Gpg4win or any other Windows GPG version?" Tags="|microsoft-windows|gpg|encryption|pgp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21700" PostTypeId="2" ParentId="21131" CreationDate="2016-04-18T19:48:21.773" Score="2" Body="&lt;p&gt;Indeed, &lt;code&gt;forward-word&lt;/code&gt; and &lt;code&gt;backward-word&lt;/code&gt; also show there are several words here.  It does make sense to me that characters from different scripts can't be in the same word, but the documentation should be made explicit about that (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Word-Motion.html#Word-Motion&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).  I suggest &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to move accross &quot;words&quot; ignoring script, you can use &lt;code&gt;skip-syntax-forward&lt;/code&gt; and &lt;code&gt;skip-syntax-backward&lt;/code&gt; (described &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Motion-and-Syntax.html#Motion-and-Syntax&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-04-18T19:48:21.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21701" PostTypeId="2" ParentId="21698" CreationDate="2016-04-18T20:21:55.420" Score="1" Body="&lt;p&gt;The &lt;code&gt;#[...]&lt;/code&gt; is &lt;em&gt;byte code&lt;/em&gt;, which comes from byte-compiling the Lisp source code.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to use &lt;code&gt;C-h f&lt;/code&gt; for the Python &lt;code&gt;forward-sexp&lt;/code&gt; command, and then visit its Lisp definition (by clicking the file link) to see what it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't know what the Python &lt;code&gt;forward-sexp&lt;/code&gt; function is called, use &lt;code&gt;C-h k C-M-f&lt;/code&gt; in Python mode. (That will also give you a link to the source code.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-18T20:21:55.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21702" PostTypeId="1" AcceptedAnswerId="21705" CreationDate="2016-04-18T21:11:56.030" Score="5" ViewCount="491" Body="&lt;p&gt;When you run Emacs in daemon mode and then connect to it with emacsclient it doesn't show the start screen (&lt;code&gt;*GNU Emacs*&lt;/code&gt;) but instead puts you into the &lt;code&gt;*scratch*&lt;/code&gt; buffer, which is normally fine. But if I decide I want to see the start screen at some time, I can't just change the buffer to get into it because in daemon mode it seems it was never created in the first place. I'm sure there must be a function I can call with m-x, but I guess my emacs knowledge is still to low for me know what to search for to find it, because I haven't been able to find the answer.&lt;/p&gt;&#xA;" OwnerUserId="11746" LastActivityDate="2016-04-19T00:32:24.447" Title="How to load start up screen (*GNU Emacs*) f it hasn't already been created?" Tags="|emacsclient|start-up|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21704" PostTypeId="1" AcceptedAnswerId="21706" CreationDate="2016-04-18T22:28:01.737" Score="1" ViewCount="81" Body="&lt;p&gt;I registered a focus-in-hook that generates an error. Now any time I try to execute a command in the minibuffer I get an error and am then unable to execute the &lt;code&gt;load-file&lt;/code&gt; that would be required to resolve the error. How can I remove this hook or otherwise recover from this situation?&lt;/p&gt;&#xA;" OwnerUserId="11760" LastActivityDate="2016-04-18T23:09:48.207" Title="how to recover from error in focus-in-hook" Tags="|hooks|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21705" PostTypeId="2" ParentId="21702" CreationDate="2016-04-18T22:32:16.280" Score="4" Body="&lt;p&gt;Adding the following to your init will allow you to show the startup screen any time by pressing &lt;code&gt;C-h j&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun show-fancy-startup-screen ()&#xA;  (interactive)&#xA;  (fancy-startup-screen))&#xA;(global-set-key &quot;\C-hj&quot; 'show-fancy-startup-screen)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-04-18T22:32:16.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21706" PostTypeId="2" ParentId="21704" CreationDate="2016-04-18T23:09:48.207" Score="1" Body="&lt;p&gt;A simple test seems to suggest that you would still be able to evaluate a lisp expression with &lt;code&gt;eval-expression&lt;/code&gt; (bound to &lt;code&gt;M-:&lt;/code&gt;) in this situation.  If so, then try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (remove-hook 'focus-in-hook 'my-func)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;my-func&lt;/code&gt; is the name of the offending function. You can then make the necessary corrections and re-set the hook.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-04-18T23:09:48.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21707" PostTypeId="1" CreationDate="2016-04-18T23:12:41.297" Score="2" ViewCount="755" Body="&lt;p&gt;I currently have my php-mode configuration like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'php-mode)&#xA;(add-hook 'php-mode-hook&#xA;          (lambda ()&#xA;             (require 'ac-php-company)&#xA;             (company-mode t)&#xA;             (setq c-syntactic-indentation nil)&#xA;             (setq indent-tabs-mode t)&#xA;             (setq tab-width 4)&#xA;             (setq c-basic-indent 4)&#xA;             (c-set-offset 'topmost-intro 4)&#xA;             (c-set-offset 'cpp-macro -4)&#xA;             (add-to-list 'company-backends 'company-ac-php-backend)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to use this configuration to start using web-mode and have php in web-mode use this configuration, however I can't seem to figure out how to configure php in web-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I use this configuration for php in web-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should probably clarify a little better what I am trying to achieve for the PHP portion of web-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I do in php-mode is have it configured to indent my PHP code inside the &lt;code&gt;&amp;lt;?php&lt;/code&gt; block like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php&#xA;&#xA;    echo &quot;hello world&quot;;&#xA;    do_some_func();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is one of the main things I would like to do in web-mode, along with use company as my auto-complete engine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anyone be able to provide me with examples or point me in the direction of solving this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to the comment by phils I was able to get my indentation set up correctly, however I still can't figure out how to set up company php in web mode, and googling doesn't seem to provide me with any answers. Any help would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for not being as clear originally.&lt;/p&gt;&#xA;" OwnerUserId="11763" LastEditorUserId="11763" LastEditDate="2016-04-19T01:17:48.807" LastActivityDate="2023-12-18T07:07:05.867" Title="Migrate php-mode configuration to web-mode" Tags="|web-mode|php-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21708" PostTypeId="2" ParentId="21707" CreationDate="2016-04-19T00:07:40.747" Score="0" Body="&lt;p&gt;For indentation,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq indent-tabs-mode t)&#xA;(setq web-mode-markup-indent-offset 4) ; web-mode, html tag in html file&#xA;(setq web-mode-css-indent-offset 4) ; web-mode, css in html file&#xA;(setq web-mode-code-indent-offset 4) ; web-mode, js code in html file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, I don't think you need mix auto-complete and company-mode, just stick to company. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For code completion, see my answer for another question,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/23999/php-completion-with-company-does-not-work-on-local-variables&quot;&gt;PHP completion with Company does not work on local variables&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2019-12-09T00:26:31.597" LastActivityDate="2019-12-09T00:26:31.597" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="21709" PostTypeId="2" ParentId="21702" CreationDate="2016-04-19T00:32:24.447" Score="4" Body="&lt;p&gt;You can try to use the menu: &lt;code&gt;Help =&amp;gt; About Emacs&lt;/code&gt;, or you can use &lt;kbd&gt;C-h C-a&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-04-19T00:32:24.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21711" PostTypeId="2" ParentId="2710" CreationDate="2016-04-19T03:23:00.223" Score="2" Body="&lt;p&gt;This is a interesting question. Several years ago I investigated all the solutions. Only workgroups2.el is heavy weight enough to cover all the corner cases.&lt;/p&gt;&#xA;&lt;p&gt;But workgroups2 UI is a disaster. For example, if you enable worksgroup-mode (as its README suggested), the previous layout will be automatically loaded during emacs startup. That make startup extremely slow EVERY time.&lt;/p&gt;&#xA;&lt;p&gt;My solution is to treat workgroups2 as a collection of API instead a usable tool out of box. So I change its default UI interaction by using ivy-mode (&lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/swiper&lt;/a&gt;) from @abo-abo&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zX9Sb.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zX9Sb.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Toggle full window is easy, use APIs from winner-mode is enough.&lt;/p&gt;&#xA;&lt;p&gt;Here is the complete code (I only use &lt;code&gt;M-x toggle-full-window&lt;/code&gt;, &lt;code&gt;M-x wg-create-workgroup&lt;/code&gt; and &lt;code&gt;M-x my-wg-switch-workgroup&lt;/code&gt;, you also need install swiper, as I mentioned above),&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun toggle-full-window()&#xA;  &amp;quot;Toggle the full view of selected window&amp;quot;&#xA;  (interactive)&#xA;  ;; @see http://www.gnu.org/software/emacs/manual/html_node/elisp/Splitting-Windows.html&#xA;  (if (window-parent)&#xA;      (delete-other-windows)&#xA;    (winner-undo)))&#xA;&#xA;(setq wg-use-default-session-file nil)&#xA;;; don't open last workgroup automatically in `wg-open-session',&#xA;;; I only want to check available workgroups! Nothing more.&#xA;(setq wg-load-last-workgroup nil)&#xA;(setq wg-open-this-wg nil)&#xA;&#xA;;(workgroups-mode 1) ; put this one at the bottom of .emacs&#xA;;; by default, the sessions are saved in &amp;quot;~/.emacs_workgroups&amp;quot;&#xA;(autoload 'wg-create-workgroup &amp;quot;workgroups2&amp;quot; nil t)&#xA;&#xA;(defun my-wg-switch-workgroup ()&#xA;  (interactive)&#xA;  (let (group-names selected-group)&#xA;    (unless (featurep 'workgroups2)&#xA;      (require 'workgroups2))&#xA;    (setq group-names&#xA;          (mapcar (lambda (group)&#xA;                    ;; re-shape list for the ivy-read&#xA;                    (cons (wg-workgroup-name group) group))&#xA;                  (wg-session-workgroup-list (read (f-read-text (file-truename wg-session-file))))))&#xA;    (ivy-read &amp;quot;work groups&amp;quot; group-names&#xA;              :action (lambda (group)&#xA;                        (wg-find-session-file wg-default-session-file)&#xA;                        (wg-switch-to-workgroup group)))))&#xA;&#xA;(eval-after-load 'workgroups2&#xA;  '(progn&#xA;     ;; make sure wg-create-workgroup always success&#xA;     (defadvice wg-create-workgroup (around wg-create-workgroup-hack activate)&#xA;       (unless (file-exists-p (wg-get-session-file))&#xA;         (wg-reset t)&#xA;         (wg-save-session t))&#xA;&#xA;       (unless wg-current-session&#xA;         ;; code extracted from `wg-open-session'.&#xA;         ;; open session but do NOT load any workgroup.&#xA;         (let ((session (read (f-read-text (file-truename wg-session-file)))))&#xA;           (setf (wg-session-file-name session) wg-session-file)&#xA;           (wg-reset-internal (wg-unpickel-session-parameters session))))&#xA;       ad-do-it&#xA;       ;; save the session file in real time&#xA;       (wg-save-session t))&#xA;&#xA;     (defadvice wg-reset (after wg-reset-hack activate)&#xA;       (wg-save-session t))&#xA;&#xA;     ;; I'm fine to to override the original workgroup&#xA;     (defadvice wg-unique-workgroup-name-p (around wg-unique-workgroup-name-p-hack activate)&#xA;       (setq ad-return-value t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;UPDATE：&#xA;I'm the maintainer of workgroups2 now. You don't need above hack any more.&lt;/p&gt;&#xA;&lt;p&gt;Use &lt;code&gt;wg-create-workgroup&lt;/code&gt; to create a new work group and save it, use &lt;code&gt;wg-open-workgroup&lt;/code&gt; to open saved workgroup.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2021-04-26T13:15:52.853" LastActivityDate="2021-04-26T13:15:52.853" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21712" PostTypeId="1" AcceptedAnswerId="21717" CreationDate="2016-04-19T05:45:31.177" Score="7" ViewCount="138" Body="&lt;p&gt;I wish to distribute an elisp package that uses json.el (&lt;a href=&quot;http://edward.oconnor.cx/2006/03/json.el&quot;&gt;http://edward.oconnor.cx/2006/03/json.el&lt;/a&gt;). I need this to work for versions of emacs that do not come with json pre-installed (such as OSX, which ships with emacs 22.1). Is there a recommended way for me to ship a third party package like json with my package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am going to be distributing this in source form directly to clients.&lt;/p&gt;&#xA;" OwnerUserId="11760" LastActivityDate="2016-04-19T23:04:07.960" Title="How should I bundle json with my elisp package?" Tags="|package|" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21713" PostTypeId="1" AcceptedAnswerId="21715" CreationDate="2016-04-19T06:02:37.297" Score="10" ViewCount="5187" Body="&lt;p&gt;Is it possible to get property values from org file headers? For example, I have a file named &lt;code&gt;something.org&lt;/code&gt; with following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Awesome File&#xA;#+AUTHOR: My Name&#xA;#+XYZ: xyz&#xA;&#xA;/content/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How could one get title or &lt;code&gt;XYZ&lt;/code&gt;? I want to get those values for some buffer-local variables. &lt;/p&gt;&#xA;" OwnerUserId="5161" LastActivityDate="2021-02-01T01:53:03.490" Title="How to get property values from org file headers" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21714" PostTypeId="2" ParentId="21131" CreationDate="2016-04-19T07:43:09.300" Score="8" Body="&lt;p&gt;This specific behaviour of &lt;code&gt;forward-word&lt;/code&gt; can be controlled by the variables &lt;code&gt;word-combining-categories&lt;/code&gt; and &lt;code&gt;word-separating-categories&lt;/code&gt;. If you want to ignore the script completely, it is sufficient to add the pair (nil . nil) to the first list, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((word-combining-categories (cons '(nil . nil)&#xA;                                       word-combining-categories)))&#xA;  (forward-word))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also change that variable with &lt;code&gt;setq-local&lt;/code&gt; if you want the effect in a specific buffer.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-04-19T07:43:09.300" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21715" PostTypeId="2" ParentId="21713" CreationDate="2016-04-19T08:09:29.127" Score="11" Body="&lt;p&gt;You could use a slight modification of &lt;a href=&quot;https://emacs.stackexchange.com/questions/21459/programmatically-read-and-set-buffer-wide-org-mode-property&quot;&gt;the answer to another question&lt;/a&gt;.&#xA;After trying the full stuff in some org-file you can put &lt;code&gt;https://emacs.stackexchange.com/questions/21459/programmatically-read-and-set-buffer-wide-org-mode-property&lt;/code&gt; into your init file and just use &lt;code&gt;org-global-props&lt;/code&gt; in your org-file.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;#+TITLE: Awesome File&#xA;#+AUTHOR: My Name&#xA;#+XYZ: xyz&#xA;&#xA;  /content/&#xA;  #+BEGIN_SRC emacs-lisp&#xA;;; Definition of `org-global-props' that could go into your init file:&#xA;(defun org-global-props (&amp;amp;optional property buffer)&#xA;  &quot;Get the plists of global org properties of current buffer.&quot;&#xA;  (unless property (setq property &quot;PROPERTY&quot;))&#xA;  (with-current-buffer (or buffer (current-buffer))&#xA;    (org-element-map (org-element-parse-buffer) 'keyword (lambda (el) (when (string-match property (org-element-property :key el)) el)))))&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;;; Stuff for your org-file:&#xA;(mapcar (lambda (prop)&#xA;      (list (org-element-property :key prop)&#xA;        (org-element-property :value prop)))&#xA;    (org-global-props &quot;\\(AUTHOR\\|TITLE\\|XYZ\\)&quot;))&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS:&#xA;  | TITLE  | Awesome File |&#xA;  | AUTHOR | My Name      |&#xA;  | XYZ    | xyz          |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to get value of first property with &lt;code&gt;key&lt;/code&gt; you can use following function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-global-prop-value (key)&#xA;  &quot;Get global org property KEY of current buffer.&quot;&#xA;  (org-element-property :value (car (org-global-props key))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;(org-global-prop-value &quot;author&quot;)&lt;/code&gt; returns &lt;code&gt;My Name&lt;/code&gt;. Keep in mind, that &lt;code&gt;key&lt;/code&gt; respects case sensitivity rules for search. &lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-04-19T13:25:51.577" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21716" PostTypeId="1" AcceptedAnswerId="21718" CreationDate="2016-04-19T11:19:01.420" Score="9" ViewCount="5562" Body="&lt;p&gt;I'd like to make changes to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; that change my key bindings for clojure/cider mode and re-evaluate these changes without having to quit/restart emacs. This would make it easy to iteratively test new keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mention clojure/cider specifically, but I haven't gotten this to work with modes other than emacs-lisp mode (i.e. org mode).&lt;/p&gt;&#xA;" OwnerUserId="11415" LastEditorUserId="105" LastEditDate="2016-06-22T19:54:52.633" LastActivityDate="2016-06-22T19:54:52.633" Title="How to re-evaluate and apply init.el?" Tags="|key-bindings|init-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21717" PostTypeId="2" ParentId="21712" CreationDate="2016-04-19T11:24:04.323" Score="7" Body="&lt;p&gt;As others have pointed out if you're targeting Emacs 23 or even 22 you don't have a “package” but only a library.  “Packages” don't exist in Emacs prior to Emacs 24 when the package manager was added.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Bundling with a library&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bundle it.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there's no standard way to install libraries before packages you can bundle json.el into whatever you give to your users—some kind of an archive I presume.  They'll have to install it manually anyway and can thus pick whatever files they need:  Just your library for Emacs 24/25 users, your library + json.el for those with older versions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as you document this it won't cause any trouble.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Bundling with a package&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Do absolutely not bundle it.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you build a proper package for Emacs 24 and upwards you &lt;strong&gt;must not include &lt;code&gt;json.el&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package manager will happily install your bundled copy of &lt;code&gt;json.el&lt;/code&gt; along with your actual library. Since packages come first in &lt;code&gt;load-path&lt;/code&gt; your bundled copy of &lt;code&gt;json.el&lt;/code&gt; will now override the built-in one, causing all sorts of trouble for packages that expect a more recent version of &lt;code&gt;json.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The way to go (in my opinion)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Create two distributions of your package:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A proper Emacs package for Emacs 24 and above, e.g. a TAR with the corresponding package metadata.  You could even host a small package repository with your package to distribute updates to Emacs 24 users automatically.&lt;/li&gt;&#xA;&lt;li&gt;A TAR file with your library and &lt;code&gt;json.el&lt;/code&gt;, but &lt;em&gt;without&lt;/em&gt; package metadata for users of older Emacs versions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The only thing that you need to watch out for is when users of older Emacs versions update to Emacs 24.  In this case they'll have to manually remove the previous installation of your library along with &lt;code&gt;json.el&lt;/code&gt; and install the proper Emacs 24 package again.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;An alternative&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you don't want to maintain two different distributions you can bundle &lt;code&gt;json.el&lt;/code&gt;, but under a different name, e.g. &lt;code&gt;my-library-json-compat.el&lt;/code&gt;.  With a different name your bundle copy of &lt;code&gt;json.el&lt;/code&gt; will never override the built-in one.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the functions and symbols in the bundled copy would still conflict with the built-in one, you must take care not to load your bundled copy when the real &lt;code&gt;json.el&lt;/code&gt; is available, but this is easy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (require 'json nil 'no-error)&#xA;  (require 'json &quot;my-library-json-compat&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs will try to load &lt;code&gt;json.el&lt;/code&gt;, and failing that fall back to your bundled copy under a different name.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The real way to go (in my opinion)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Tell your users to update to Emacs 24. The last release of Emacs 22 is eight(!) years ago, the last release of Emacs 23 still four years ago.  Both versions are outdated and lack a lot of features, and many packages (e.g. Magit) only support Emacs 24 nowadays.  Emacs 22/23 are a dead end and there's no way forward from them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updating to Emacs 24 is easy enough:  Most modern Linux distribution include at least Emacs 24.1 in their package repositories.  For OS X &lt;a href=&quot;https://emacsformacosx.com&quot; rel=&quot;nofollow&quot;&gt;pre-built App bundles&lt;/a&gt; are available, and the latest stable Emacs 24 is included in the popular OS X package manager Homebrew.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2016-04-19T23:04:07.960" LastActivityDate="2016-04-19T23:04:07.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21718" PostTypeId="2" ParentId="21716" CreationDate="2016-04-19T11:27:31.823" Score="20" Body="&lt;p&gt;To reevaluate the entire init file type &lt;code&gt;M-x eval-buffer&lt;/code&gt; in a buffer visiting it, or &lt;code&gt;M-: (load-file user-init-file)&lt;/code&gt; to reload without visiting it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if your intention is to iteratively add new keybindings or code to your running Emacs session I recommend not to evaluate the entire buffer but instead use &lt;code&gt;C-M-x&lt;/code&gt; (aka &lt;code&gt;eval-defun&lt;/code&gt;) to evaluate only the current function or top-level definition or &lt;code&gt;M-x eval-region&lt;/code&gt; to evaluate selected code.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorDisplayName="user227" LastEditDate="2016-04-19T13:33:34.060" LastActivityDate="2016-04-19T13:33:34.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21719" PostTypeId="2" ParentId="10450" CreationDate="2016-04-19T16:13:14.170" Score="3" Body="&lt;p&gt;I added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'redraw-display)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my .emacs file so that I could quickly recover from a very similar issue. (In my case, entire regions of the emacs window display correctly for several seconds after emacs receives the focus, then major sections go blank and the (icon bar?) across the top gets muddled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens whether I have focus-follows-mouse (through a registry mod, arranged so the window is not raised when it has focus) or click-to-focus (which also raises the window above the obscuring window.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From C-h C-a: GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570)&#xA;On various Dell laptops running Windows 7&lt;/p&gt;&#xA;" OwnerUserId="9131" LastEditorUserId="9131" LastEditDate="2016-04-19T19:35:29.720" LastActivityDate="2016-04-19T19:35:29.720" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21720" PostTypeId="1" AcceptedAnswerId="21721" CreationDate="2016-04-19T17:10:38.983" Score="5" ViewCount="534" Body="&lt;p&gt;How can I reset the default behavior of no prepending (but still being able to use -nw) and not having the bottom half of my terminal be black space. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having emacs test.py -nw -Q doesn't solve the issue, emacs test.py -Q doesn't result in the characters but it does produce a window that I'd rather not have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs within a python jupyter shell, my version is GNU emacs 23.1.1, echo $TERM returns xterm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As additional clarification, if I fully expand my terminal window, the emacs editor will only fill about half of the space. It isn't being filled with the &quot;help editor&quot; as sometimes happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pSm6B.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pSm6B.png&quot; alt=&quot;Example behavior&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11776" LastEditorUserId="11776" LastEditDate="2016-04-19T20:31:57.617" LastActivityDate="2016-04-19T20:31:57.617" Title="Everytime I open emacs with -nw my file is prepended with 0;276;0c. My screen realestate is also being cut in half" Tags="|display|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21721" PostTypeId="2" ParentId="21720" CreationDate="2016-04-19T20:14:11.027" Score="4" Body="&lt;p&gt;The file &lt;code&gt;etc/PROBLEMS&lt;/code&gt; (part of emacs) has some information on this problem.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;** Unexpected characters inserted into the buffer when you start Emacs. See e.g. http://debbugs.gnu.org/11129&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This can happen when you start Emacs in -nw mode in an Xterm. For&#xA;  example, in the &lt;em&gt;scratch&lt;/em&gt; buffer, you might see something like:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;0;276;0c&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This is more likely to happen if you are using Emacs over a slow&#xA;  connection, and begin typing before Emacs is ready to respond.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This occurs when Emacs tries to query the terminal to see what&#xA;  capabilities it supports, and gets confused by the answer. To avoid&#xA;  it, set xterm-extra-capabilities to a value other than 'check' (the&#xA;  default).  See that variable's documentation (in term/xterm.el) for&#xA;  more details.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Even if you connection is not slow, it can also happen that the value of your TERM variable doesn't match the actual capabilities of your terminal emulator — the result is still that emacs is confused.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-04-19T20:14:11.027" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21723" PostTypeId="1" AcceptedAnswerId="24430" CreationDate="2016-04-19T23:47:14.830" Score="8" ViewCount="2487" Body="&lt;p&gt;As I'm composing mail, mu4e automatically saves drafts to the &lt;code&gt;mu4e-drafts-folder&lt;/code&gt;.  When I send the mail, these drafts persist.  I expected mu4e to delete from the folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm unable to find any documentation in the mu4e manual, and I'm afraid I'm still too new to this codebase to see how to hack together what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a user option to enable deletion on send?  Or an obvious function I can drop into, say, &lt;code&gt;message-sent-hook&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2021-02-01T05:03:42.353" Title="How can I delete mu4e drafts on successfully sending the mail?" Tags="|mu4e|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21724" PostTypeId="2" ParentId="18282" CreationDate="2016-04-20T00:30:49.467" Score="0" Body="&lt;pre&gt;&lt;code&gt;(setq c-default-style &quot;linux&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could tweak indentation of individaul &lt;code&gt;c-syntactic-context&lt;/code&gt; by manipulating the variable &lt;code&gt;c-offsets-alist&lt;/code&gt;. Read wiki and documentation. Usually that's enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More advanced method is reading the original Lisp code if Emacs itself has issue. Here is step by step guide &lt;a href=&quot;http://blog.binchen.org/posts/ccjava-code-indentation-in-emacs.html&quot; rel=&quot;nofollow&quot;&gt;http://blog.binchen.org/posts/ccjava-code-indentation-in-emacs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I strongly suggesting reading the article to understand why at first. Then insert below code into your ~/.emacs &lt;strong&gt;if ad only if&lt;/strong&gt; changing &lt;code&gt;c-default-style&lt;/code&gt; does NOT solve the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fix-c-indent-offset-according-to-syntax-context (key val)&#xA;  ;; remove the old element&#xA;  (setq c-offsets-alist (delq (assoc key c-offsets-alist) c-offsets-alist))&#xA;  ;; new value&#xA;  (add-to-list 'c-offsets-alist '(key . val)))&#xA;&#xA;(add-hook 'c-mode-common-hook&#xA;          (lambda ()&#xA;            (when (derived-mode-p 'c-mode 'c++-mode 'java-mode)&#xA;              ;; indent&#xA;              (fix-c-indent-offset-according-to-syntax-context 'func-decl-cont 0))&#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-04-20T00:41:29.393" LastActivityDate="2016-04-20T00:41:29.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21725" PostTypeId="1" AcceptedAnswerId="21738" CreationDate="2016-04-20T06:16:35.700" Score="3" ViewCount="2086" Body="&lt;p&gt;The first function works when executed on or in the body of an org headline. The second function doesn't return anything even though more than one headline in my set of agenda files has the org properties noted in the doc string to the first function. Perhaps I should use org-element-map instead? Please help me get this working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 's)  ; s.el string library for s-split&#xA;(defun my-org-task-schedule-warn-func ()&#xA;  &quot;Use org properties such as&#xA;&#xA;  :PROPERTIES:&#xA;  :COMPLETE-BEFORE: &amp;lt;2016-04-19 Tue 19:55&amp;gt;&#xA;  :Effort:   1:00&#xA;  :END:&#xA;&#xA;  on an org headline to generate scheduling warnings, ala Watership Planner.&quot;&#xA;&#xA;  ;; Only match headlines with the COMPLETE-BEFORE and EFFORT properties.&#xA;  (if (and (assoc &quot;COMPLETE-BEFORE&quot; (org-entry-properties))&#xA;          (assoc &quot;EFFORT&quot; (org-entry-properties)))&#xA;      (let* ((props (org-entry-properties)) ; Get the properties for the&#xA;                                            ; current headline.&#xA;            (complete-before-string&#xA;              (cdr (assoc &quot;COMPLETE-BEFORE&quot; props)))&#xA;            (complete-before&#xA;              (org-read-date nil t&#xA;                            complete-before-string nil))&#xA;            (effort-string&#xA;              (cdr (assoc &quot;EFFORT&quot; props)))   ; Using h:mm format.&#xA;            (effort-string-components (s-split &quot;:&quot; effort-string))&#xA;            (effort-hours  (string-to-int (first effort-string-components)))&#xA;            ;; Turn org-mode effort format into minutes.&#xA;            (effort-minutes&#xA;              (+ (* effort-hours 60)&#xA;                (string-to-int (second effort-string-components))))&#xA;            (time-buffer-minutes 15) ; Amount of warning time (in minutes) within&#xA;                                      ; which to start notifying user that&#xA;                                      ; they might not meet their scheduling&#xA;                                      ; objective. This would ideally be a&#xA;                                      ; customizable value.&#xA;            (current-time-plus-effort&#xA;              (time-add (current-time)&#xA;                        (seconds-to-time (* effort-minutes 60))))&#xA;            (current-time-plus-effort-plus-buffer&#xA;              (time-add&#xA;              current-time-plus-effort&#xA;              (seconds-to-time (* time-buffer-minutes 60)))))&#xA;        (print (current-time-string complete-before))&#xA;        (print (current-time-string current-time-plus-effort-plus-buffer))&#xA;        (if (time-less-p complete-before current-time-plus-effort-plus-buffer)&#xA;            (progn&#xA;              (let ((msg (nth 4 (org-heading-components))))&#xA;                (print&#xA;                (concat&#xA;                  &quot;Warning! You are in danger of not completing the task titled: &quot;&#xA;                  msg))&#xA;                (if (fboundp 'my-org-task-schedule-warn)&#xA;                    ;; Pop up an OS X notifier window with msg and play warning sound&#xA;                    (my-org-task-schedule-warn&#xA;                    &quot;Schedule warning for task:&quot;&#xA;                    msg))))&#xA;          (print &quot;You are still ok.&quot;)))))&#xA;&#xA;;;; TODO: It'd be nice to set the MATCH to only those headlines with&#xA;;;; the COMPLETE-BEFORE and EFFORT properties at the level of&#xA;;;; org-map-entries instead of inside my-org-task-schedule-warn.&#xA;(defun my-org-check-schedule-warnings ()&#xA;  (org-map-entries&#xA;  (my-org-task-schedule-warn-func) nil 'agenda))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;UPDATE: Responding to @lawlist's request below, for the curious, I can say this is just a germinal idea toward implementing a small bit of functionality available in the Windows scheduling app named 'Watership Planner'. It doesn't compete with org agenda or any other features of org. Watership Planner has this nice feature (for my purposes - especially with org habits) whereby you can say that you want to complete a task before a certain time of day. WP looks at the duration you have specified for the task and if the current time is such that you are getting close to running out of time to start the task in order to finish by the completion time then it will warn you with a notification and sound. It is sort of like having a personal scheduling assistant since you don't specify exactly when you want to do something, just a window of time on a given day and the WP agent notifies you when your window is elapsing without completion. The first hack I have here does just that but it doesn't work like Watership Planner's version of this feature yet. If you are still curious, you can download Watership Planner demo and run it for free to see what I am talking about. Again, it is only this feature that I am exploring, not other aspects of Watership Planner, many of which would be redundant with org mode.&lt;/p&gt;&#xA;" OwnerUserId="8353" LastEditorUserId="8353" LastEditDate="2016-04-20T17:08:56.823" LastActivityDate="2016-04-20T17:15:18.837" Title="Need help using org-map-entries" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21726" PostTypeId="1" CreationDate="2016-04-20T07:44:18.753" Score="1" ViewCount="1032" Body="&lt;p&gt;Specifically, I want the binding 'C-x C-a' to do 'C-x C-s' then 'C-c C-a'. (Context: I'd like to save my TeX document, then have AUCTeX render it.) How can I do this? I don't want to map 'C-x C-a' to any specific command, or to re-bind it to exactly one other thing, which is what most of the Google results turn up.&lt;/p&gt;&#xA;" OwnerUserId="11781" LastActivityDate="2016-04-21T00:57:59.693" Title="How can I set a key binding to run two other key bindings?" Tags="|key-bindings|auctex|commands|" AnswerCount="2" CommentCount="9" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21731" PostTypeId="2" ParentId="21689" CreationDate="2016-04-20T11:29:27.673" Score="1" Body="&lt;p&gt;A discussion &lt;a href=&quot;http://comments.gmane.org/gmane.emacs.orgmode/106344&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; indicates that this is related to a change/bug in a Emacs commit c23c965bb9d0. Updating Org (as discussed in the thread) solved this.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastActivityDate="2016-04-20T11:29:27.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21732" PostTypeId="1" AcceptedAnswerId="21737" CreationDate="2016-04-20T12:15:58.713" Score="1" ViewCount="64" Body="&lt;p&gt;I am doing a bit of keyboard rebinding and I have found that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-todo &quot;DONE&quot;)&#xA;(org-todo &quot;TODO&quot;)&#xA;(org-todo &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;all work, but in the documentation, it says that I should be able to also use the symbols &lt;code&gt;nextset&lt;/code&gt; and &lt;code&gt;previousset&lt;/code&gt; as such:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-todo 'nextset)&#xA;(org-todo 'previousset)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have searched the source code of &lt;code&gt;org-mode.el&lt;/code&gt; and some of the &lt;code&gt;require&lt;/code&gt; files too, but I cannot find the definition of &lt;code&gt;nextset&lt;/code&gt; or &lt;code&gt;previousset&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-support-shift-select 'always)&#xA;&#xA;(defun org-mode-todo-done-cycling-replacements ()&#xA;  (define-key org-mode-map (kbd &quot;M-9&quot;) (lambda ()&#xA;                     (interactive)&#xA;                     (org-call-with-arg 'org-todo 'previousset)))&#xA;  (define-key org-mode-map (kbd &quot;M-0&quot;) 'org-todo))&#xA;&#xA;(add-hook 'org-mode-hook 'org-mode-todo-done-cycling-replacements)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-0&lt;/code&gt; works but &lt;code&gt;M-9&lt;/code&gt; does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I supposed to &lt;code&gt;require&lt;/code&gt; a library before? (Org-mode version is 8.3.3).&lt;/p&gt;&#xA;" OwnerUserId="11094" LastEditorUserId="105" LastEditDate="2016-04-20T15:05:05.523" LastActivityDate="2016-04-20T15:05:05.523" Title="Org Mode: Where are `previousset`, `nextset` etc defined?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21733" PostTypeId="2" ParentId="21726" CreationDate="2016-04-20T13:23:29.337" Score="6" Body="&lt;p&gt;For this special case (save a *TeX buffer before running the compiler), you don't need to define a binding, or advice a function, but just set &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#index-TeX_002dsave_002dquery&quot;&gt;&lt;code&gt;TeX-save-query&lt;/code&gt;&lt;/a&gt; to nil:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-save-query nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-04-20T13:23:29.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21734" PostTypeId="1" CreationDate="2016-04-20T13:32:40.967" Score="2" ViewCount="110" Body="&lt;p&gt;After a recent version change, my Emacs 24.5 is now making its initial frame (window) &quot;sticky&quot; on launch.  I am having to unstick it manually, which is a royal pain.  I tried using the Emacs variable &lt;code&gt;initial-frame-alist&lt;/code&gt; to make it not sticky, but this does not seem to work.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what &lt;code&gt;C-h v&lt;/code&gt; says about the variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;initial-frame-alist is a variable defined in `frame.el'.&#xA;Its value is ((sticky) (vertical-scroll-bars))&#xA;Original value was nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;(sticky)&lt;/code&gt; means &lt;code&gt;(sticky . nil)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some more diagnostic information:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When I launch my normal emacs with init file, the resulting window is sticky&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When I launch using &lt;code&gt;emacs -q&lt;/code&gt; (no init file), then run the init file (either with &lt;code&gt;M-x eval-buffer&lt;/code&gt; or with &lt;code&gt;M-x load-file&lt;/code&gt;), the resulting window is &lt;em&gt;not&lt;/em&gt; sticky.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am running &lt;code&gt;desktop-save-mode&lt;/code&gt;.  When I launch a second emacs while the first is running, the initial frame opens with the initial settings, and it prompts me that the desktop file is already in use by another process&amp;mdash;should I use it?  At that point the window is not sticky.  But after I respond &lt;code&gt;n&lt;/code&gt; and the initialization process finishes, the window then becomes sticky.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'd appreciate any help diagnosing the source of the stickiness and putting a stop to it.  My &lt;code&gt;.emacs&lt;/code&gt; file is shown at &lt;a href=&quot;http://pastebin.com/6tdc0dPM&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/6tdc0dPM&lt;/a&gt;.  Please treat it gently; it's the result of over 30 years of accretion.&lt;/p&gt;&#xA;" OwnerUserId="9343" LastActivityDate="2016-06-21T11:16:30.000" Title="Why is initial frame sticky on launch? How can I stop it?" Tags="|init-file|frames|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21735" PostTypeId="1" CreationDate="2016-04-20T13:38:59.510" Score="5" ViewCount="84" Body="&lt;p&gt;org-customize has a node for &lt;code&gt;startup folded&lt;/code&gt;, with options &lt;code&gt;no fold&lt;/code&gt;, &lt;code&gt;fold&lt;/code&gt;, &lt;code&gt;content&lt;/code&gt;, and &lt;code&gt;show everything&lt;/code&gt;. There doesn't seem to be an option for &quot;remember last folded state&quot;. For such a customisable major mode, I think this is a glaring omission. I was even pointed toward the undocumented var &lt;code&gt;org-inhibit-startup-visibility-stuff&lt;/code&gt;, but this just gives the completely open mode.&lt;/p&gt;&#xA;" OwnerUserId="2207" LastActivityDate="2016-10-22T19:22:18.373" Title="What mix of customisations are required to have org files always open exactly as they were closed?" Tags="|org-mode|start-up|code-folding|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21736" PostTypeId="2" ParentId="21726" CreationDate="2016-04-20T13:43:03.730" Score="5" Body="&lt;p&gt;The general way to link multiple key-bindings to a single binding is a Keyboard Macro (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html#Keyboard-Macros&quot; rel=&quot;nofollow&quot;&gt;(emacs) Keyboard Macros&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keyboard macros can either be 'recorded' interactively, or written in elisp (in string or vector format). The easiest way to produce the latter is to use the &lt;code&gt;kbd&lt;/code&gt; function, so that you can write the keystrokes using the familiar syntax Emacs uses to display them (i.e. the same as you see when using &lt;code&gt;C-h c&lt;/code&gt; or &lt;code&gt;C-h k&lt;/code&gt; to ask about a key sequence).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@youngfrog has provided an example of this approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key LaTeX-mode-map (kbd &quot;C-x C-a&quot;) (kbd &quot;C-x C-s C-c C-a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this form, the first &lt;code&gt;kbd&lt;/code&gt; describes the key sequence to bind the command to, and the second &lt;code&gt;kbd&lt;/code&gt; provides the keyboard macro command that will be called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Giordano points out, you need to make sure this form gets run &lt;em&gt;after&lt;/em&gt; AucTex is loaded. You can do this by adding it to your &lt;code&gt;LaTeX-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'my-latex-mode-hook)&#xA;&#xA;(defun my-latex-mode-hook ()&#xA;  (define-key LaTeX-mode-map&#xA;    (kbd &quot;C-x C-a&quot;)&#xA;    (kbd &quot;C-x C-s C-c C-a&quot;))&#xA;  ;; and other customizations here...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also wrap the &lt;code&gt;define-key&lt;/code&gt; form in &lt;code&gt;(eval-after-load &quot;latex&quot; '(define-key ...))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Interactively defining keyboard macros&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Keyboard macros are commonly defined ('recorded') interactively. This is often more convenient (especially for cases where no long-term keybinding is required, but you can still do that if you wish to).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To record a keyboard macro:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Press &lt;code&gt;&amp;lt;f3&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Enter your commands (i.e., &lt;code&gt;C-x C-s&lt;/code&gt; &lt;code&gt;C-x C-a&lt;/code&gt;) [maybe you actually want &lt;code&gt;M-x TeX-save-document&lt;/code&gt; here instead of &lt;code&gt;C-x C-s&lt;/code&gt;?]&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;&amp;lt;f4&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can then repeat this command by pressing &lt;code&gt;&amp;lt;f4&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to save this macro for future use, first give it a name:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;enter &lt;code&gt;C-x C-k n&lt;/code&gt;, and enter a name, eg. &quot;my-tex-run&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can then insert the macro code in your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x insert-kbd-macro&lt;/code&gt;, and enter the name of the macro&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now you have the code necessary to rebuild your macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'my-tex-run&#xA;   (lambda (&amp;amp;optional arg) &quot;Keyboard macro.&quot; (interactive &quot;p&quot;)&#xA;       (kmacro-exec-ring-item (quote (&quot;&quot; 0 &quot;%d&quot;)) arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then use this function in a keybinding command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key LaTeX-mode-map (kbd &quot;C-x C-a&quot;) 'my-tex-run)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine for putting together quick combinations of commands. However, if you can use customization variables (like the answer @Giordano gave), or use actual elisp code, it will be easier to modify your macro if you want to tweak it beyond just duplicating the raw keypresses.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="454" LastEditDate="2016-04-21T00:57:59.693" LastActivityDate="2016-04-21T00:57:59.693" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21737" PostTypeId="2" ParentId="21732" CreationDate="2016-04-20T13:44:49.770" Score="2" Body="&lt;p&gt;If what you want is simply replace the keyword with the next one, &lt;code&gt;(org-todo)&lt;/code&gt; does it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-todo-keyword&lt;/code&gt; can contain several sequences (or &lt;em&gt;sets&lt;/em&gt;) of keywords:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-todo-keywords is a variable defined in `org.el'.&#xA;  Its value is ((sequence &quot;TODO&quot; &quot;DONE&quot;))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  List of TODO entry keyword sequences and their interpretation.&#xA;  This is a list of sequences.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I understand correctly, &lt;code&gt;nextset&lt;/code&gt; and &lt;code&gt;previousset&lt;/code&gt; are intended to select one of these sets.  So in your example &lt;code&gt;M-9&lt;/code&gt; &lt;strong&gt;does&lt;/strong&gt; work, it's just by default there's only one set of keywords.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nextset&lt;/code&gt; and &lt;code&gt;previousset&lt;/code&gt; do not have to be defined anywhere, since they're just symbols.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-04-20T13:44:49.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21738" PostTypeId="2" ParentId="21725" CreationDate="2016-04-20T17:15:18.837" Score="7" Body="&lt;p&gt;&lt;code&gt;org-map-entries&lt;/code&gt; requires a function as first argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You wrote&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-map-entries (my-org-task-schedule-warn-func) nil 'agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but &lt;code&gt;(my-org-task-schedule-warn-func)&lt;/code&gt; does not return a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You actually wanted to use &lt;code&gt;my-org-task-schedule-warn-func&lt;/code&gt; as the function.&#xA;So you should replace the function call &lt;code&gt;(my-org-task-schedule-warn-func)&lt;/code&gt; with the function symbol &lt;code&gt;#'my-org-task-schedule-warn-func&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-map-entries #'my-org-task-schedule-warn-func nil 'agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-04-20T17:15:18.837" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21739" PostTypeId="1" AcceptedAnswerId="29066" CreationDate="2016-04-20T17:25:41.433" Score="4" ViewCount="3485" Body="&lt;p&gt;In &lt;code&gt;.spacemacs&lt;/code&gt; I am trying to define a few custom, major mode mappings, that can be accesed using &lt;code&gt;SPC m&lt;/code&gt;. This is working fine for &lt;code&gt;org-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (evil-leader/set-key-for-mode 'org-mode &quot;l&quot; 'org-insert-link)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when I define it for a different mode it doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (evil-leader/set-key-for-mode 'sclang-mode &quot;sl&quot; 'sclang-eval-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;SPC m&lt;/code&gt;  just returns &lt;code&gt;SPC m is undefined&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode is part of a package that I used following &lt;a href=&quot;http://www.rockhoppertech.com/blog/supercollider-with-emacs-on-osx/&quot; rel=&quot;nofollow&quot;&gt;these instructions&lt;/a&gt;. In my .spacemacs file I have added these lines to make it work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/sc/el&quot;)&#xA;(require 'sclang)&#xA;(setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:/Applications/SuperCollider/SuperCollider.app/Contents/Resources&quot;))&#xA;(setq exec-path (append exec-path '(&quot;/Applications/SuperCollider&quot;  &quot;/Applications/SuperCollider/SuperCollider.app/Contents/Resources&quot; )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It also required to move a folder in the &lt;code&gt;.emacs.d&lt;/code&gt; folder (and I need to remove it temporarily before every &lt;code&gt;spacemacs&lt;/code&gt; update...) so yes, definitely not even close to an official layer.&lt;/p&gt;&#xA;" OwnerUserId="11442" LastEditorUserId="11442" LastEditDate="2016-05-19T15:51:25.583" LastActivityDate="2016-12-02T09:55:24.847" Title="Why is this custom spacemacs major mode keybinding not working?" Tags="|spacemacs|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21740" PostTypeId="1" AcceptedAnswerId="21746" CreationDate="2016-04-20T18:49:20.497" Score="1" ViewCount="115" Body="&lt;p&gt;I've never used emacs, but am interested in to try it for its 'org-mode'...&#xA;I understand that its now possible to view images inline - but can GIFS be viewed inline?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then, is it possible to view video, audio, pdf, web, etc with emacs OWN viewer? If not (especially for uncommon file types), via a relevant application of choice (excel, chrome, etc) that opens in a separate PANE, but same window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so - are these hard to implement?&lt;/p&gt;&#xA;" OwnerUserId="11788" LastActivityDate="2016-04-20T20:43:55.000" Title="Insert and view GIF INLINE? Insert and view SVG, video, audio, OTHER files in side pane?" Tags="|attachment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21741" PostTypeId="1" CreationDate="2016-04-20T18:55:17.463" Score="3" ViewCount="85" Body="&lt;p&gt;Is there a way to gather all the tags used in an &lt;code&gt;org-mode&lt;/code&gt; file, &#xA;and it displays these on a dedicated side pane?&lt;/p&gt;&#xA;" OwnerUserId="11788" LastEditorUserId="2274" LastEditDate="2016-10-03T22:56:27.977" LastActivityDate="2018-01-27T08:17:01.120" Title="Tags own pane that is auto generated?" Tags="|org-tags|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21742" PostTypeId="1" AcceptedAnswerId="21744" CreationDate="2016-04-20T19:05:43.853" Score="4" ViewCount="92" Body="&lt;p&gt;Is it possible to clone a part of a document in another part of the document? So that changing one, changes both?&lt;/p&gt;&#xA;" OwnerUserId="11788" LastActivityDate="2016-04-20T19:26:48.677" Title="Clone content in another part of document?" Tags="|text|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21744" PostTypeId="2" ParentId="21742" CreationDate="2016-04-20T19:26:48.677" Score="5" Body="&lt;p&gt;Yes: there's for example &lt;code&gt;text-clone-create&lt;/code&gt; which can be used for that (typically used for small chunks of text such as the tag names in XML's tag pairs), as well as the &lt;a href=&quot;https://github.com/phillord/lentic&quot;&gt;lentic&lt;/a&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-04-20T19:26:48.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21745" PostTypeId="1" AcceptedAnswerId="21748" CreationDate="2016-04-20T19:28:26.487" Score="3" ViewCount="378" Body="&lt;p&gt;I'm setting up a remote editing capability through Tramp from my Mac OS X laptop to an Ubuntu box, and have defined the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tramp-default-user &quot;myusername&quot;&#xA;      tramp-default-host &quot;myhostname&quot;)&#xA;(setq tramp-default-method &quot;ssh&quot;)&#xA;&#xA;;;Open a file on my linux box&#xA;(defun remote-find-file (file-name)&#xA;  &quot;Like find file, but opens the file on my box&quot;&#xA;  (interactive &quot;FRemote Find File: &quot;)&#xA;  (let ((tramp-file-name (expand-file-name file-name)))&#xA;    (find-file tramp-file-name)))&#xA;(global-set-key (kbd &quot;C-x C-u&quot;) 'remote-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The issue I have is that &lt;code&gt;expand-file-name&lt;/code&gt; is expanded using the Mac OS X conventions, so that &lt;code&gt;~&lt;/code&gt; turns into &lt;code&gt;/Users/myusername&lt;/code&gt; instead of &lt;code&gt;/home/myusername&lt;/code&gt;. I suspect there's a way to fix this using file name completion, but I can't figure it out from the Tramp documentation.&lt;/p&gt;&#xA;" OwnerUserId="11578" LastActivityDate="2016-04-20T23:12:10.213" Title="OS X ~ vs Linux ~ in Tramp" Tags="|tramp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21746" PostTypeId="2" ParentId="21740" CreationDate="2016-04-20T20:43:55.000" Score="0" Body="&lt;p&gt;First, in Emacs, what the rest of the world calls 'windows' are called 'frames', and what you refer to as 'panes' are called 'windows'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can open images, pdfs, and webpages in an Emacs window (pane). Open images as you would any other file, and any recognized format is displayed as you would expect. Emacs has its own viewer for PDFs, and if you are on Linux, an even better one is available called &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;nofollow&quot;&gt;pdf-tools&lt;/a&gt;. Emacs has a built-in web browser, although it displays pages in a pretty basic way relative to Firefox or Chrome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot open Excel, Chrome, or other GUI apps in an Emacs window, but you can launch them (or any other program) from Emacs, and have it run in its own frame. When opening links to external files from org-mode, Emacs will try to find an appropriate program. So if you have a link to an Excel file in your org file, the command &lt;code&gt;org-open-at-point&lt;/code&gt; will open that file in Excel. (you may require some configuration depending on the file type and how your operating system is set up. The details are in the &lt;a href=&quot;http://orgmode.org/manual/Handling-links.html&quot; rel=&quot;nofollow&quot;&gt;org-mode manual&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-20T20:43:55.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21747" PostTypeId="1" AcceptedAnswerId="21766" CreationDate="2016-04-20T21:56:22.887" Score="2" ViewCount="1005" Body="&lt;p&gt;How can I have a progress bar so I can drag to specific point of a song in emms? With a progress bar, it gives a more straight sense on how much the music has been played.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-04-21T19:14:11.313" Title="Emms: How can I have a progress bar?" Tags="|emms|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21748" PostTypeId="2" ParentId="21745" CreationDate="2016-04-20T23:12:10.213" Score="1" Body="&lt;p&gt;&lt;code&gt;expand-file-name&lt;/code&gt; doesn't use any convention, it asks your operating system what the home directory of the user is. It can't guess that you want the home directory of a user with the same name but on a different machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, your function doesn't do anything useful as it stands. To open a file in your home directory on the remote machine, type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/myhostname:path/to/file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put a slash after &lt;code&gt;/myhostname:&lt;/code&gt; to give an absolute path on the remote host.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can abbreviate &lt;code&gt;myhostname&lt;/code&gt; by defining an alias in your SSH configuration (&lt;a href=&quot;https://unix.stackexchange.com/questions/11881/is-it-possible-to-use-one-ssh-key-per-account-for-each-account-on-a-given-remote/11883#11883&quot;&gt;example&lt;/a&gt;), so you'd have very little to type — with a one-letter alias, you'd just need to type &lt;code&gt;C-x C-f /r:&lt;/code&gt; and then the file name to open a remote file. So I don't think the command you're trying to define is useful anyway.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-04-20T23:12:10.213" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21749" PostTypeId="1" CreationDate="2016-04-21T07:56:05.693" Score="2" ViewCount="612" Body="&lt;p&gt;I'm just getting started with tcl; what sort of beautifier, or prettifier, or formatter, is there for tcl with emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main interest would be to fix existing scripts so that particularly the indenting is consistent and the braces, brackets and parenthesis line up nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't have to be perfect.  Perhaps it's the nature of tcl that this is more difficult than for Java?&lt;/p&gt;&#xA;" OwnerUserId="6603" LastActivityDate="2016-04-21T07:56:05.693" Title="Can emacs beautify existing tcl source code?" Tags="|formatting|code-folding|programming|icicles|prettify-symbols-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21750" PostTypeId="1" CreationDate="2016-04-21T09:29:35.393" Score="1" ViewCount="445" Body="&lt;p&gt;Is there a way to export to latex in a way that the German 'ß' (&quot;scharfes S&quot;, &quot;eszett&quot;) character stays? I'm using utf-8 input encoding, and Umlauts get exported well, but ß appears as capital SS in my documents, although it gets exported to html fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I just found out, when changing the inputencoding to utf8x, it works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+latex_header: \usepackage[utf8x]{inputenc}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11797" LastActivityDate="2016-04-21T09:29:35.393" Title="org-mode latex export: German ß character" Tags="|org-mode|org-export|latex|utf-8|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21751" PostTypeId="1" AcceptedAnswerId="21758" CreationDate="2016-04-21T11:02:04.243" Score="14" ViewCount="890" Body="&lt;p&gt;It is a usual shell display:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ME@mycomputer: ~$ echo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I do backspace several times It becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ME@mycompu&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to prevent the system word from deleting&lt;/p&gt;&#xA;" OwnerUserId="10417" LastEditorUserId="10" LastEditDate="2016-04-21T11:35:34.427" LastActivityDate="2016-04-21T15:17:44.983" Title="How to prevent backspace from deleting my shell prompt?" Tags="|shell|shell-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21752" PostTypeId="1" CreationDate="2016-04-21T12:59:52.677" Score="0" ViewCount="1035" Body="&lt;p&gt;Not being very LISP-literate, I am having trouble figuring out from the documentation &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/tramp/Multi_002dhops.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; how to set up a shortcut to allow me to edit a remote file as root. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've successfully set up an ssh-config file to allow pretty low-overhead entry for remote editing (see &lt;a href=&quot;https://emacs.stackexchange.com/questions/21745/os-x-vs-linux-in-tramp&quot;&gt;this question&lt;/a&gt; for the background), and would like a similar approach for editing remotely as root.&lt;/p&gt;&#xA;" OwnerUserId="11578" LastActivityDate="2016-04-22T02:33:30.830" Title="Setting up shortcut using tramp-default-proxies-alist" Tags="|tramp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21753" PostTypeId="1" AcceptedAnswerId="21756" CreationDate="2016-04-21T13:13:49.850" Score="3" ViewCount="81" Body="&lt;p&gt;I've been working on align-rules for Fortran 90 so that the built-in &lt;strong&gt;align&lt;/strong&gt; and &lt;strong&gt;align-current&lt;/strong&gt; functions do something useful. What would be the best way to make this code available for others?&lt;/p&gt;&#xA;" OwnerUserId="10585" LastActivityDate="2016-04-21T13:57:59.830" Title="How to contribute align rules" Tags="|align|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21754" PostTypeId="1" AcceptedAnswerId="33063" CreationDate="2016-04-21T13:16:25.370" Score="6" ViewCount="1277" Body="&lt;p&gt;How to automatically save all org files after marking a repeating item as DONE in the org agenda? I'm using this to automatically save my org buffers after every change to TODO status:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-todo :after (η #'org-save-all-org-buffers))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Where &lt;code&gt;η&lt;/code&gt; ignores all arguments and calls the given function.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This however doesn't work for repeating tasks, scheduled like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SCHEDULED: &amp;lt;2016-04-22 Fri +1d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The org document is still modified after changing the state from TODO to DONE. I've tried a number of hook variables and methods, all without success.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="2487" LastEditDate="2017-05-26T08:00:26.833" LastActivityDate="2017-12-02T14:45:54.667" Title="How to automatically save all org files after marking a repeating item as DONE in the org agenda?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21755" PostTypeId="1" CreationDate="2016-04-21T13:30:18.827" Score="3" ViewCount="4891" Body="&lt;p&gt;I'd like to use PDFView mode as the default PDF reader when editing LaTeX code in AucTeX, using Emacs 24. For example, after compiling with C-c C-c, redoing this command would open the PDF file in a second buffer in the same window, using PDFView mode instead of Doc View.&lt;/p&gt;&#xA;" OwnerUserId="11799" LastEditorUserId="105" LastEditDate="2016-04-21T13:54:08.110" LastActivityDate="2016-04-21T20:54:07.257" Title="Use PDFView as default AucTex PDF Viewer" Tags="|auctex|pdf-tools|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21756" PostTypeId="2" ParentId="21753" CreationDate="2016-04-21T13:57:59.830" Score="2" Body="&lt;p&gt;You can send the code and any instructions to Emacs for its inclusion, using &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;. Sending a patch is preferred. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can make the code available from a GIT repository or at &lt;a href=&quot;https://www.emacswiki.org/emacs/ElispArea&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt;. At Emacs Wiki you can just copy+paste the code into your web browser - no need to set anything up locally etc.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-21T13:57:59.830" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21757" PostTypeId="2" ParentId="21752" CreationDate="2016-04-21T14:53:17.337" Score="2" Body="&lt;p&gt;Tramp remembers your settings over a session. Open one time &lt;code&gt;/ssh:host|sudo:host:/path/to/file&lt;/code&gt;. From now on, Tramp knows that it needs an ssh connection prior to sudo for that host, and you can symply use &lt;code&gt;/sudo:host:/path/to/file&lt;/code&gt;. With all abbreviations discussed the other question.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-04-21T14:53:17.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21758" PostTypeId="2" ParentId="21751" CreationDate="2016-04-21T15:17:44.983" Score="16" Body="&lt;p&gt;I think you're looking for &lt;code&gt;comint-prompt-read-only&lt;/code&gt;.  E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comint-prompt-read-only t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should take care of it.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-04-21T15:17:44.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21759" PostTypeId="1" CreationDate="2016-04-21T15:41:08.193" Score="12" ViewCount="5224" Body="&lt;p&gt;Within Visual Studio and Notepad++, when I select a symbol (using the shift key or mouse), other occurrences of it within the buffer are also highlighted in another color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When editing JavaScript or AutoHotkey or any other dynamic language where you can use variables without defining them, it is very useful to be able to select some text and find all occurances of that string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am struggling particularly with Notepad++ and AutoHotkey, which highlights word matches, but I want to be able to select half of a symbol, for example within &lt;code&gt;Suggest_ShowToolTip&lt;/code&gt;, I can even just select &lt;code&gt;ToolTip&lt;/code&gt; and it should show the matches of &lt;code&gt;ToolTip&lt;/code&gt; anywhere in the buffer, even if it part of a larger symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does such a feature exist?  Is it easy to implement?&lt;/p&gt;&#xA;" OwnerUserId="11094" LastActivityDate="2016-04-22T07:49:50.363" Title="Hightlighting all occurances of selected text" Tags="|text-editing|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21760" PostTypeId="2" ParentId="21759" CreationDate="2016-04-21T16:11:37.027" Score="3" Body="&lt;p&gt;&lt;code&gt;C-s&lt;/code&gt; then type what you want to see matched. Or &lt;code&gt;C-s&lt;/code&gt; followed by &lt;code&gt;C-w&lt;/code&gt; (possibly repeated), to match words at the cursor. See the Emacs manual (&lt;code&gt;C-h r&lt;/code&gt;), node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Incremental-Search.html&quot; rel=&quot;nofollow&quot;&gt;Incremental Search&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-21T16:11:37.027" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21761" PostTypeId="2" ParentId="21678" CreationDate="2016-04-21T17:12:33.173" Score="2" Body="&lt;p&gt;Bidi reordering is controlled by the buffer-local variable &lt;code&gt;bidi-paragraph-direction&lt;/code&gt;.  You make it default to L2R by adding the following incantation to your init file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default bidi-paragraph-direction 'left-to-right)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;(There is also &lt;code&gt;bidi-display-reordering&lt;/code&gt;, but that can lead to crashes and &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00294.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;should &lt;em&gt;not&lt;/em&gt; be changed unless you're debugging Emacs itself&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="730" LastEditDate="2020-11-01T12:59:33.850" LastActivityDate="2020-11-01T12:59:33.850" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21762" PostTypeId="2" ParentId="21747" CreationDate="2016-04-21T17:33:07.607" Score="0" Body="&lt;p&gt;You should implement one!  (AFAIK emms doesn't have progress bar)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emms provides the &lt;code&gt;emms-playing-time&lt;/code&gt; variable which gives you the time elapsed for the current track and you can find the track length with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(emms-track-get (emms-playlist-current-selected-track) 'info-playing-time)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(IMHO this should probably be exposed as an emms variable as well)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can seek using the &lt;code&gt;emms-seek-*&lt;/code&gt; functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the progress bar itself one package that comes to mind is neato-bar-graph (&lt;a href=&quot;https://gitlab.com/RobertCochran/neato-graph-bar&quot; rel=&quot;nofollow&quot;&gt;https://gitlab.com/RobertCochran/neato-graph-bar&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe other users here can suggest other code you should look at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking forward to using what you build!  ;-)&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-04-21T17:33:07.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21763" PostTypeId="1" CreationDate="2016-04-21T17:52:01.270" Score="1" ViewCount="106" Body="&lt;p&gt;Email mail clients such as mu4e are not perfectly suited to view HTML emails.  I usually try to view it in Emacs (using Emacs' own HTML redinging enging shr) but revert to opening the email in a browser if it is not readable.  However, one problem with this approach is that the browser will load images, java scripts, and other remote resources references in the HTML potentially compromising my privacy.  The question is: how can I prevent remote resources from being loaded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I considered to filter the HTML to remove java script and images but it turns out that there are so many different ways to load remote material that filtering is not feasible (CSS, Adobe Flash, ...).  So I think it would be better to open the HTML in a browser (tab?) that doesn't connect to the internet.  Is there a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2016-04-21T17:52:01.270" Title="Open HTML email in browser but preventing loading of images and scripts" Tags="|email|html|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21764" PostTypeId="2" ParentId="21755" CreationDate="2016-04-21T19:12:05.190" Score="4" Body="&lt;p&gt;I just set this up yesterday so all you need in your init file is.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; to use pdfview with auctex&#xA; (setq TeX-view-program-selection '((output-pdf &quot;PDF Tools&quot;))&#xA;    TeX-view-program-list '((&quot;PDF Tools&quot; TeX-pdf-tools-sync-view))&#xA;    TeX-source-correlate-start-server t) ;; not sure if last line is neccessary&#xA;&#xA; ;; to have the buffer refresh after compilation&#xA; (add-hook 'TeX-after-compilation-finished-functions&#xA;        #'TeX-revert-document-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;kbd&gt; C-c C-a&lt;/kbd&gt; to compile and view at the same time. It also compiles bibtech if applicable. Its faster to press than &lt;kbd&gt; C-c C-c&lt;/kbd&gt; &lt;kbd&gt; C-c C-c&lt;/kbd&gt;. I ended up inverting the two keybindings&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Update 1:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In respons to: why is &lt;code&gt;tex-view-program-list&lt;/code&gt; not defined for me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That variable is defined in the &lt;code&gt;auctex&lt;/code&gt; package. It is essentially essential to using latex in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is not installed you should &lt;code&gt;package-install auctex&lt;/code&gt; and then place &lt;code&gt;(require 'latex)&lt;/code&gt;. &lt;s&gt; if you use &lt;code&gt;use-package&lt;/code&gt; you can add &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package tex-site&#xA;  :ensure auctex&#xA;  :init&#xA;  (require 'latex)&#xA;  ;; to use pdfview with auctex&#xA;  (setq TeX-view-program-selection '((output-pdf &quot;PDF Tools&quot;))&#xA;        TeX-view-program-list '((&quot;PDF Tools&quot; TeX-pdf-tools-sync-view))&#xA;        TeX-source-correlate-start-server t) ;; not sure if last line is neccessary&#xA;&#xA;  ;; to have the buffer refresh after compilation&#xA;  (add-hook 'TeX-after-compilation-finished-functions&#xA;            #'TeX-revert-document-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;/s&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Update 2: Strikeout due to suggestion in comments&lt;/h3&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="11272" LastEditDate="2016-04-21T20:54:07.257" LastActivityDate="2016-04-21T20:54:07.257" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21765" PostTypeId="2" ParentId="21759" CreationDate="2016-04-21T19:14:06.803" Score="0" Body="&lt;p&gt;Here's some code to make isearch smarter about regions.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun isearch-region-dwim-helper ()&#xA;  (when (region-active-p)&#xA;    (let* ((beg (min (mark) (point)))&#xA;           (end (max (mark) (point)))&#xA;           (search-text (buffer-substring-no-properties beg end))&#xA;           (symbol-bounds (bounds-of-thing-at-point 'symbol)))&#xA;      (when (and search-text&#xA;                 ;; Assume that multi-line regions should be extended,&#xA;                 ;; not searched literally.&#xA;                 (= (line-number-at-pos beg)&#xA;                    (line-number-at-pos end)))&#xA;        (deactivate-mark)&#xA;        (setq isearch-regexp t&#xA;              ;; If region is a subregion of the current symbol, then&#xA;              ;; limit it to the contents of symbols in the current buffer&#xA;              isearch-string (if (and (car symbol-bounds)&#xA;                                      (&amp;gt;= beg (car symbol-bounds))&#xA;                                      (&amp;lt;= end (cdr symbol-bounds)))&#xA;                                 (concat &quot;\\_&amp;lt;&quot;&#xA;                                         ;; If the region matches the&#xA;                                         ;; beginning or end of a symbol&#xA;                                         ;; anchor it there.&#xA;                                         (if (= beg (car symbol-bounds)) &quot;&quot;&#xA;                                           &quot;\\(\\s_\\|\\sw\\)*&quot;)&#xA;                                         (regexp-quote search-text)&#xA;                                         (if (= end (cdr symbol-bounds)) &quot;&quot;&#xA;                                           &quot;\\(\\s_\\|\\sw\\)*&quot;)&#xA;                                         &quot;\\_&amp;gt;&quot;)&#xA;                               (regexp-quote search-text))&#xA;              isearch-message (mapconcat #'isearch-text-char-description&#xA;                                         isearch-string&#xA;                                         &quot;&quot;))))))&#xA;&#xA;(add-hook 'isearch-mode-hook #'isearch-region-dwim-helper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Multiline regions are always extended&lt;/li&gt;&#xA;&lt;li&gt;Within-line regions are searched&lt;/li&gt;&#xA;&lt;li&gt;Regions within symbols (inclusive) are constrained to be within symbols&lt;/li&gt;&#xA;&lt;li&gt;Regions at the beginning/end of symbols are anchored to the beg/end of symbols&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Combining this with &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;expand-region&lt;/code&gt;&lt;/a&gt; turns out to be pretty awesome.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-04-21T19:20:13.510" LastActivityDate="2016-04-21T19:20:13.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21766" PostTypeId="2" ParentId="21747" CreationDate="2016-04-21T19:14:11.313" Score="3" Body="&lt;p&gt;You can display some text (something looks like process bar) in the echo area to indicate the music has been played after seeking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pThrg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pThrg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun chunyang-emms-indicate-seek (_sec)&#xA;  (let* ((total-playing-time (emms-track-get&#xA;                              (emms-playlist-current-selected-track)&#xA;                              'info-playing-time))&#xA;         (elapsed/total (/ (* 100 emms-playing-time) total-playing-time)))&#xA;    (with-temp-message (format &quot;[%-100s] %2d%%&quot;&#xA;                               (make-string elapsed/total ?=)&#xA;                               elapsed/total)&#xA;      (sit-for 2))))&#xA;&#xA;(add-hook 'emms-player-seeked-functions #'chunyang-emms-indicate-seek 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, &lt;a href=&quot;https://github.com/dbrock/bongo&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bongo&lt;/a&gt; (another music player for Emacs) provides similar function, but its looks more beautiful and more useful. &lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-21T19:14:11.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21767" PostTypeId="2" ParentId="21558" CreationDate="2016-04-21T21:00:25.930" Score="0" Body="&lt;p&gt;A new version of orgtbl-aggregate is available on Melpa and &lt;a href=&quot;https://github.com/tbanel/orgaggregate&quot; rel=&quot;nofollow&quot;&gt;https://github.com/tbanel/orgaggregate&lt;/a&gt;. Column names can now contain arbitrary characters (space, dot, semicolon, etc.). Just quote them with single or double quotes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: funnynames&#xA;| first column | observed;number | computed/expected |&#xA;|--------------+-----------------+-------------------|&#xA;| a/experiment |             2.3 |               2.4 |&#xA;| a/experiment |            15.4 |              12.1 |&#xA;| b/test       |           -98.7 |               0.0 |&#xA;....&#xA;&#xA;#+BEGIN: aggregate :table &quot;funnynames&quot; :cols &quot;\&quot;first column\&quot; mean('observed;number');%.3f mean('computed/expected');%.4f&quot; :cond (&amp;gt;= (string-to-number &quot;observed;number&quot;) 0)&#xA;| 'first column' | mean('observed;number') | mean('computed/expected') |&#xA;|----------------+-------------------------+---------------------------|&#xA;| a/experiment   |                   8.633 |                    7.1333 |&#xA;| b/test         |                   3.350 |                    3.1500 |&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To install from Melpa, add this to your &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then type &lt;code&gt;M-x package-list&lt;/code&gt; and search for &lt;code&gt;orgtbl-aggregate&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11716" LastActivityDate="2016-04-21T21:00:25.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21768" PostTypeId="1" CreationDate="2016-04-21T22:36:47.087" Score="2" ViewCount="423" Body="&lt;p&gt;I run compilation processes that, in a terminal, list what was built all on the same line. In emacs shell they are all on separate lines, filling my shell buffer with unwanted output. I realize I could run the terminal emulator in emacs, but there are lots of reasons why I prefer to use emacs shell. If I could get emacs shell to handle the control sequences correctly (that is, in this case, handle \r by going to the beginning of the same line and erase the line on further output) that would be fantastic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea if this is possible?&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2016-04-21T22:36:47.087" Title="How to enable control character (e.g. carriage return) handling in emacs shell" Tags="|shell|term|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21769" PostTypeId="1" CreationDate="2016-04-21T23:45:36.297" Score="0" ViewCount="27" Body="&lt;p&gt;Minimal example code, run it from &lt;code&gt;emacs -Q&lt;/code&gt;.  Note the use of unicode RIGHT SINGLE QUOTATION MARK (’) not APOSTROPHE (').&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?’ &quot;w p&quot; text-mode-syntax-table) ; that's the same syntax as '&#xA;(progn&#xA;  (switch-to-buffer &quot;test&quot;)&#xA;  (text-mode)&#xA;  (insert &quot;this isn’t a word character?&quot;)&#xA;  (goto-char (point-min))&#xA;  (forward-word 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my Emacs (version 24.5.1) this leaves point on the RIGHT SINGLE QUOTATION MARK in “isn’t”.  Why?  Shouldn't it move point between “isn’t” and “a” instead?&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2016-04-21T23:45:36.297" Title="Why does forward-word stop at this quotation mark?" Tags="|syntax|emacs-internals|emacs24|" AnswerCount="0" CommentCount="2" ClosedDate="2016-04-22T15:10:51.913" ContentLicense="CC BY-SA 3.0" />
  <row Id="21770" PostTypeId="1" CreationDate="2016-04-22T01:35:00.520" Score="10" ViewCount="2403" Body="&lt;p&gt;Is there a way to automatically switch focus to any new windows? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I &lt;code&gt;C-h f some-function&lt;/code&gt;, that creates a new window. But the focus remains where I was, so when I'm done reading and hit &lt;code&gt;q&lt;/code&gt;, I just type a &lt;code&gt;q&lt;/code&gt; in whatever buffer I was in previously. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd like to always switch focus to a new window whenever one is created. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas?&lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2021-03-06T13:58:58.287" Title="Automatically switch focus to new window" Tags="|window|focus|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21771" PostTypeId="2" ParentId="21752" CreationDate="2016-04-22T02:33:30.830" Score="4" Body="&lt;p&gt;I follow Michael Albinus advice for long paths. Tramp remembers the hosts and protocols and you can use Tramp's built-in completion to speed up revisiting the same remote files. However, for some long files that I edit every now and then, I setup a bookmark using Emacs's bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While in the remote editing buffer, I bookmark the remote Tramp location with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x r m &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Later when I need to get back to that location, I list all bookmarks with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x r l&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then select the file I want to edit. I like this approach for two other reasons. Bookmarks is a built-in feature and no need for installing additional packages. The second reason is that now I can copy that bookmark file to other machines as needed. I actually sync it to many machines so I have the same bookmarks no matter which machine I'm currently using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have lots of remote files to edit, you can look into editing bookmark files directly. You can also use sorting and filtering options, in case you want to group the bookmarks by location/task/machine/etc.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-04-22T02:33:30.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21772" PostTypeId="2" ParentId="17223" CreationDate="2016-04-22T02:34:59.963" Score="0" Body="&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src shell :noweb yes :tangle somefile.sh&#xA;  $ &amp;lt;&amp;lt;prefix-stuff&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&#xA;#+name: prefix-stuff&#xA;#+begin_src shell&#xA;  thing-you-wanted-prefixed-here&#xA;  with-as-many-lines-as-you-like&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Export with &lt;code&gt;C-x v t&lt;/code&gt;. If you use noweb, orgmode will repeat the prefix for all the lines in the sub-block.&lt;/p&gt;&#xA;" OwnerUserId="11808" LastActivityDate="2016-04-22T02:34:59.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21773" PostTypeId="2" ParentId="21759" CreationDate="2016-04-22T03:40:08.293" Score="15" Body="&lt;p&gt;Functionality built-in to emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With point on the word in question, type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-s h .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to highlight all occurrences. Note that this matches the entire word, not substrings. Repeat this multiple times, each is assigned a unique color. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-s h u&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;allows you to select which word to un-highlight. There are a few other highlighting commands, type &lt;code&gt;M-s h C-h&lt;/code&gt; for a list. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For what it's worth, here is how I search for occurrences of a word. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For a quick overview, use &lt;a href=&quot;https://github.com/abo-abo/swiper&quot;&gt;swiper&lt;/a&gt;. It's quick and very good at giving you a overview of the word across the entire document, but is transient:  once you use it to traverse to another occurrence, you have to engage swiper again to traverse elsewhere. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I-search. Still the most flexible search tool, and built-in to boot. Can easily search for substrings. Once you've found another occurrence, is quicker than swiper to find next (or prior) occurrence. You're still only seeing matches that currently fit on the screen, however.  Has plenty of time-saving commands, which I only found out after years of using it, when I bothered to read the manual. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;occur-mode. Pretty awesome, and built-in: &lt;code&gt;M-s o&lt;/code&gt;. Provides a persistent record of all matches for any regexp. May be the best option if you want to see and traverse through a list of all occurrences in a buffer. Easy to go back &lt;code&gt;M-g p&lt;/code&gt;and forward &lt;code&gt;M-g n&lt;/code&gt;, or jump to another occurrence. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Honorable mention goes to &lt;a href=&quot;https://github.com/victorhge/iedit&quot;&gt;iedit&lt;/a&gt;. I don't use it often, but always enjoy it when I do.  Hit the shortcut, and all matching occurrences are highlighted. Here's the bonus: start typing, and all occurrences are changed, not just the one where the cursor is. That's its basic idea. There are some fancy options, but I've not found the readme very clear about those. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll also mention &lt;a href=&quot;https://github.com/nonsequitur/idle-highlight-mode/blob/master/idle-highlight-mode.el&quot;&gt;idle-highlight&lt;/a&gt;. I've not used it, but it does advertise as doing what you describe. (Highlights other occurrences when cursor has been idle for a time.)  Though I don't know if it handles substrings. &lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2016-04-22T03:40:08.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21775" PostTypeId="1" AcceptedAnswerId="21784" CreationDate="2016-04-22T06:07:30.917" Score="1" ViewCount="603" Body="&lt;p&gt;I got 2 monitors, but emacs can only use one, can I use both of them, so that I could split windows cross both monitors? so If I want to create 2 windows, then each monitor could show me one windows.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2016-04-26T16:27:25.197" Title="I am using emacs on window OS, possible to use multiple monitor?" Tags="|emacsclient|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21776" PostTypeId="2" ParentId="21694" CreationDate="2016-04-22T07:16:48.090" Score="3" Body="&lt;p&gt;It turns out that the behavior of a given regexp is dependent upon the syntax table of the buffer in which it is being run.  So in your case, the &lt;code&gt;\s-&lt;/code&gt; matches any character that is part of the whitespace syntax class &lt;em&gt;in that buffer&lt;/em&gt;.  If the newline characters is part of that syntax class, then you have the possibility of getting matches that span multiple lines.  Unfortunately, there seems to be a built-in assumption to the function &lt;code&gt;align-region&lt;/code&gt; that matches will be confined to a single line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following function provides a wrapper around &lt;code&gt;align-regexp&lt;/code&gt; which creates a temporary syntax table, if needed, based on the current syntax table of the buffer.  It then modifies the temporary table to make sure that the newline character is not part of the whitespace syntax class:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Source: http://emacs.stackexchange.com/a/21776/93&#xA;(defun my-align-regexp ()&#xA;  &quot;Wrapper around align-regexp which works around issues that&#xA;can occur when newlines are included in the whitespace syntax&#xA;class. [bug #23339]&quot;&#xA;  (interactive)&#xA;  (setq this-command 'align-regexp)&#xA;  (if (eq ?\s (char-syntax ?\n))&#xA;      (let ((table (copy-syntax-table (syntax-table))))&#xA;        (modify-syntax-entry ?\n &quot;&amp;gt;&quot; table)&#xA;        (with-syntax-table table&#xA;          (call-interactively 'align-regexp)))&#xA;    (call-interactively 'align-regexp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume you could achieve the same result with advice, but I tend to avoid advice unless it is unavoidable.  I have submitted a bug report for this issue &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23339&quot; rel=&quot;nofollow&quot;&gt;[#23339]&lt;/a&gt;, so hopefully this will get fixed in a future release.  &lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-04-22T07:16:48.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21777" PostTypeId="2" ParentId="21759" CreationDate="2016-04-22T07:49:50.363" Score="0" Body="&lt;p&gt;The current answers mention only highlighting, which isn't very useful on it's own. Why not modify all occurrences of the highlighted thing in the whole buffer at once?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how to do it: install &lt;code&gt;iedit&lt;/code&gt; and bind it to e.g. &lt;kbd&gt;M-i&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-i&quot;) 'iedit-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to highlight modify only withing the current function, use &lt;kbd&gt;C-u M-i&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then simply edit within any of the green fields and the changes will propagate everywhere. You can also cycle between the fields with &lt;kbd&gt;TAB&lt;/kbd&gt; and &lt;kbd&gt;S-TAB&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One last thing: to toggle the highlight off, press &lt;kbd&gt;M-i&lt;/kbd&gt; again.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-04-22T07:49:50.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21778" PostTypeId="2" ParentId="10159" CreationDate="2016-04-22T08:24:28.450" Score="1" Body="&lt;p&gt;And of course you have the &lt;code&gt;orgtbl-aggregate&lt;/code&gt; package (available on Melpa). It uses Calc as its backend engine. The &lt;code&gt;vcorr&lt;/code&gt; function is the one to use, as &lt;em&gt;wvxvw&lt;/em&gt; and &lt;em&gt;RUserPassingBy&lt;/em&gt; put it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: aggregate :table &quot;MY-TABLE&quot; :cols &quot;vcorr(sleep,productivity)&quot;&#xA;| vcorr(sleep,productivity) |&#xA;|---------------------------|&#xA;|            0.898477918389 |&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11716" LastActivityDate="2016-04-22T08:24:28.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21779" PostTypeId="2" ParentId="20451" CreationDate="2016-04-22T09:50:09.483" Score="9" Body="&lt;p&gt;Although you cannot center headings (lines starting from *'s), &lt;code&gt;#+BEGIN_CENTER&lt;/code&gt; ~ &lt;code&gt;#+END_CENTER&lt;/code&gt; can center parts of the document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usage:&#xA;test.org&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Test&#xA;&#xA;#+BEGIN_CENTER&#xA;- [ ] Hoge&#xA;- [X] Fuga&#xA;#+END_CENTER&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then export to ODT in your workflow.&#xA;This will result in the bullet points being centered in the produced ODT file.&lt;/p&gt;&#xA;" OwnerUserId="11313" LastActivityDate="2016-04-22T09:50:09.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21780" PostTypeId="1" CreationDate="2016-04-22T13:07:42.000" Score="0" ViewCount="240" Body="&lt;p&gt;After using a emacs for a while all I see is &lt;code&gt;Garbage collecting...done&lt;/code&gt; in the modeline.  At this point emacs is constantly garbage collecting but can't free any memory and has to be restarted.  Emacs is sluggish in general on this machine, even after a fresh restart, as it's constantly garbage collecting so something is clearly wrong.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried all builds I could think of for emacs.  I've installed 24.5 and 25.1 from brew.  I've tried the binaries same binaries from emacsforosx.com. Right now I'm running the version at &lt;a href=&quot;https://github.com/railwaycat/mirror-emacs-mac&quot; rel=&quot;nofollow&quot;&gt;https://github.com/railwaycat/mirror-emacs-mac&lt;/a&gt;, as a last try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everyone I've talked to is happily using emacs on a mac so it's clearly nothing wrong with emacs itself.  How can I find out which package / function is causing this nightmare?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on a brand new macbook pro running the latest version of el capitan.&lt;/p&gt;&#xA;" OwnerUserId="6859" LastActivityDate="2016-04-22T13:07:42.000" Title="Debugging a crippling memory leak" Tags="|debugging|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21782" PostTypeId="1" CreationDate="2016-04-22T16:54:27.250" Score="3" ViewCount="612" Body="&lt;p&gt;The default git behavior is to show only unstaged changes (ignoring stuff that I have staged/git added). How do I do that in Magit?&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2016-04-25T12:05:25.357" Title="How do I make Magit only show diff for unstaged changes?" Tags="|magit|git|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21783" PostTypeId="2" ParentId="21782" CreationDate="2016-04-22T17:14:01.883" Score="6" Body="&lt;p&gt;Try &lt;code&gt;M-x magit-diff-unstaged&lt;/code&gt;, also available in the diff popup (&lt;kbd&gt;d u&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you've globally bound &lt;code&gt;magit-dispatch-popup&lt;/code&gt; to some key,then you can use that followed by &lt;kbd&gt;d u&lt;/kbd&gt; to get to the unstaged diffs without having to go through the status buffer.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="306" LastEditDate="2016-04-25T12:05:25.357" LastActivityDate="2016-04-25T12:05:25.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21784" PostTypeId="2" ParentId="21775" CreationDate="2016-04-22T17:19:57.913" Score="4" Body="&lt;p&gt;If I'm understanding the question, try &lt;code&gt;C-x 5 2&lt;/code&gt; (the default binding for &lt;code&gt;make-frame-command&lt;/code&gt;) to create a new frame. You can have several frames and position them on your various monitors however you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;C-x 5&lt;/code&gt; prefix has several other commands for dealing with frames. Try &lt;code&gt;C-x 5 C-h&lt;/code&gt; for a list. See the Emacs manual section on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Frames.html&quot; rel=&quot;nofollow&quot;&gt;Frames&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-04-22T19:41:44.330" LastActivityDate="2016-04-22T19:41:44.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21785" PostTypeId="1" AcceptedAnswerId="21795" CreationDate="2016-04-22T18:17:44.323" Score="3" ViewCount="990" Body="&lt;p&gt;I just started working with &lt;code&gt;rx&lt;/code&gt; and was able to achieve the opposite of the regex I wanted:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rx-to-string `(: (or&#xA;  (: line-start (not ,comment-start))&#xA;  (: line-start (zero-or-more whitespace) line-end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, notting this regex was not as straightforward as I had hoped. I have tried many different variations with not, none of them working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would appreciate it if you could also show how to invert this regex too, so people looking up this q will get a simple example first:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rx-to-string `(: line-start ,comment-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks a bunch!&lt;/p&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2016-04-24T22:16:03.463" Title="How do I use not in rx-to-string?" Tags="|regular-expressions|rx|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21786" PostTypeId="1" CreationDate="2016-04-22T18:59:06.647" Score="1" ViewCount="178" Body="&lt;p&gt;When a function documentation page tells me that a function has advice, is there any way to find out where that piece of advice is defined?  This is advice that was created using the &lt;code&gt;defadvice&lt;/code&gt; facility.  I was eventually able to find it by grepping &lt;code&gt;defadvice the-func-name&lt;/code&gt; in all lisp folders, but is there a more direct way to locate a given &lt;code&gt;defadvice&lt;/code&gt; statement?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-04-22T18:59:06.647" Title="Find where advice is defined (defadvice)" Tags="|advice|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21787" PostTypeId="1" AcceptedAnswerId="21852" CreationDate="2016-04-22T21:05:27.947" Score="1" ViewCount="897" Body="&lt;p&gt;Emacs 24.5 on openSuse Tumbleweed. *.org file with a link to a pdf:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[.\somefile.pdf::2][myfile p 2]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using the PDF Tools to display a PDF in Emacs. What I expect is that page 2 of the PDF will be shown. But it always opens on page 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea, what could be wrong. I &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2016-04/msg00506.html&quot; rel=&quot;nofollow&quot;&gt;asked&lt;/a&gt; on the orgmode-mailinglist, &lt;a href=&quot;https://github.com/markus1189/org-pdfview/issues/10&quot; rel=&quot;nofollow&quot;&gt;as well&lt;/a&gt; as the maintainer of org-pdfview.el -- without any success. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I'm lacking of lisp skills. How could I debug e.g. org-pdfview.el and find out, why it does not provide a pagenumber to PDF-Tools? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I open org-pdfview.el, M-x eval-buffer, point the cursor inside a function and &quot;instrument&quot; it: C-u S-M-C-x. But how can I change to an org-mode buffer containing a link like given above? If I just change the buffer and open a link &lt;code&gt;C-c C-o&lt;/code&gt;, I never get any reaction inside the buffer of org-pdfview.el. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, I ran out of ideas. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my .emacs there are these commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'org '(require 'org-pdfview))&#xA;(delete '(&quot;\\.pdf\\'&quot; . default) org-file-apps)&#xA;(add-to-list 'org-file-apps '(&quot;\\.pdf\\'&quot; . org-pdfview-open))&#xA;(add-to-list 'org-file-apps '(&quot;\\.pdf::\\([[:digit:]]+\\)\\'&quot; . org-pdfview-open))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2334" LastEditorUserId="2334" LastEditDate="2016-04-26T07:44:09.620" LastActivityDate="2016-04-26T07:44:09.620" Title="Debug org-mode link to PDF displayed with PDF-Tools" Tags="|org-mode|debug|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21789" PostTypeId="1" CreationDate="2016-04-22T22:18:18.247" Score="7" ViewCount="1832" Body="&lt;p&gt;Is it possible to make blank lines at the end of tree part of that tree? So I can heave two headings like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading1&#xA;* Heading2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;without space between them, but when Heading1 is expanded there is a blank line at the end that does not propagate upwards. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading1&#xA;&#xA;  * Subheading1&#xA;  * Subheading2&#xA;&#xA;* Heading2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It find it visually pleasing to have a blank line between Subheading2 and Heading2 but when Heading1 is collapsed I do not want to have a blank line between Heading1 and Heading2 ( I use org-indent-mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I can have only the version without blank line at the end and without blank line between Heading1 and Heading2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading1&#xA;&#xA;  * Subheading1&#xA;  * Subheading2&#xA;* Heading2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or version with blank line at the end of expanded Heading1 BUT that blank line propagates upwards and it appears between Heading1 and Heading2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading1&#xA;&#xA;* Heading2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11826" LastActivityDate="2018-03-03T07:45:01.363" Title="Org-mode blank line at the end of tree" Tags="|org-mode|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21791" PostTypeId="1" AcceptedAnswerId="21801" CreationDate="2016-04-23T05:51:55.827" Score="1" ViewCount="50" Body="&lt;p&gt;How can I tell Emacs than whenever it tries to open file &lt;code&gt;/a/b/c/foo.txt&lt;/code&gt;, it should instead open &lt;code&gt;/d/e/f/foo.txt&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a few projects and libraries which are accessible via multiple paths on the filesystem. This is mostly done by symlinks, but not only - sometimes I use bind mounts (some software, e.g. git, treats symlinks differently), and sometimes the files will simply always be identical copies of some other files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although when manually opening files, I always open them at their canonical location, following error messages and using &quot;go-to-definition&quot; actions will often open files under aliased paths, and I will end up with multiple buffers pointing to the same file. As such, I'd like to define a rule set of how to rewrite paths of all files it attempts to open. What would be the way to do this?&lt;/p&gt;&#xA;" OwnerUserId="6695" LastActivityDate="2016-04-23T16:28:16.150" Title="Rewrite paths of opened files" Tags="|files|path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21792" PostTypeId="1" AcceptedAnswerId="21798" CreationDate="2016-04-23T06:02:18.070" Score="0" ViewCount="1222" Body="&lt;p&gt;I'm trying to insert a string pathname into a buffer on a Windows machine. The variable holding the string has the right number of backslashes (two) in the directory pathname. I know this because when I &quot;Eval: mypathname&quot; in the minibuffer, the double backslashes are visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT.. it seems that whenever Emacs evaluates the pathname variable in a function (such as concat, or insert-string), one level of backslashes is stripped out. So what starts out as C:\good\path\slashes in the variable turns into &quot;C:\bad\path\slashes&quot; in the inserted (or concatenated) string in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote a small function to try to double the slashes, but all manner of regexp expressions failed for me. I tried doubles, and quadruples, rx-to-string, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my code and a debugger trace and execution trace taken from running the function in a &lt;em&gt;scratch&lt;/em&gt; lisp-interaction-mode buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that when the variable value is returned by the function, it still has the right number of slashes. But when I try to use the variable anywhere (in a concat, or in the insert-string calls in the trace, only one slash shows up. And I need TWO slashes to show up in the inserted string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas would be appreciated. Thank you&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(defun ct-u-path-redouble (path)&#xA;;;;  This line gives an error:&#xA;;;;  (setq foo (replace-regexp-in-string &quot;\\&quot; &quot;\\\\&quot; path))&#xA;;;;&#xA;;;;  Debugger entered--Lisp error: (invalid-regexp &quot;Trailing backslash&quot;)&#xA;;;;  string-match(&quot;\\&quot; &quot;C:\\joe\\blow&quot; 0)&#xA;;;;  replace-regexp-in-string(&quot;\\&quot; &quot;\\\\&quot; &quot;C:\\joe\\blow&quot;)&#xA;;;;  (setq foo (replace-regexp-in-string &quot;\\&quot; &quot;\\\\&quot; path))&#xA;;;;  ct-u-path-redouble(&quot;C:\\joe\\blow&quot;)&#xA;;;;  eval((ct-u-path-redouble &quot;C:\\joe\\blow&quot;) nil)&#xA;  (insert-string &quot;\n&quot;)&#xA;  (insert-string (concat &quot;\nAfter concat: &quot; path &quot;\n&quot;))&#xA;  path)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ct-u-path-redouble &quot;C:\joe\blow&quot;)&#xA;After concat: C:joelow  (the weird one-slashified ctl chars don't show here)&#xA;Returned ==&gt; &quot;C:joelow&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ct-u-path-redouble &quot;C:\\joe\\blow&quot;)&#xA;After concat: C:\joe\blow&#xA;Returned ==&gt; &quot;C:\\joe\\blow&quot;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="105" LastEditDate="2016-06-22T19:53:28.147" LastActivityDate="2016-06-22T19:53:28.147" Title="elisp trying to double backslashes in windows pathname - concat strips a slash escape" Tags="|regular-expressions|microsoft-windows|string|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21793" PostTypeId="2" ParentId="21792" CreationDate="2016-04-23T06:06:10.463" Score="2" Body="&lt;p&gt;&lt;code&gt;(ct-u-path-redouble &quot;C:\joe\blow&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This looks like your error. Escape characters in strings are processed when the string is read in the source code by emacs, not when the string is passed to one function or another. Thus you need to have double-backslashes here, and it becomes &lt;code&gt;(ct-u-path-redouble &quot;C:\\joe\\blow&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-04-23T06:06:10.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21794" PostTypeId="2" ParentId="21791" CreationDate="2016-04-23T06:10:41.517" Score="0" Body="&lt;p&gt;I don't know off-hand of a better way to do it, but you might use &lt;code&gt;defadvice&lt;/code&gt; on the &lt;code&gt;find-file&lt;/code&gt; function. Your advice could rewrite the file path as needed before passing it in to &lt;code&gt;find-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="105" LastEditDate="2016-04-23T16:28:16.150" LastActivityDate="2016-04-23T16:28:16.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21795" PostTypeId="2" ParentId="21785" CreationDate="2016-04-23T06:47:39.007" Score="5" Body="&lt;p&gt;The documented possible uses of &lt;code&gt;not&lt;/code&gt; are&lt;sup&gt;*&lt;/sup&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(not (any SET ...))&#xA;     matches any character not in SET ...&#xA;(not (syntax SYNTAX))&#xA;     matches a character that doesn't have syntax SYNTAX.&#xA;(not (category CATEGORY))&#xA;     matches a character that doesn't have category CATEGORY.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All of which operate on a single character, whereas &lt;code&gt;comment-start&lt;/code&gt; is a string of arbitrary length (or nil), so that's not something you can necessarily use directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;*&lt;/sup&gt; There's also &lt;code&gt;(not word-boundary)&lt;/code&gt; which is equivalent to &lt;code&gt;not-word-boundary&lt;/code&gt;, and seems to be something of an anomaly. The latter is more consistent with the other &lt;code&gt;rx&lt;/code&gt; forms.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-04-23T06:53:43.043" LastActivityDate="2016-04-23T06:53:43.043" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21796" PostTypeId="1" AcceptedAnswerId="30838" CreationDate="2016-04-23T13:58:57.093" Score="3" ViewCount="2145" Body="&lt;p&gt;&lt;code&gt;openwith&lt;/code&gt; seems to kill replying in &lt;code&gt;mu4e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar/alternative solution for easy defining default apps per extensions in &lt;code&gt;dired&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-04-23T16:52:32.013" LastActivityDate="2024-01-30T09:09:12.960" Title="dired alternative to openwith: how to open file per extension?" Tags="|dired|openwith|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21797" PostTypeId="1" CreationDate="2016-04-23T14:29:17.240" Score="4" ViewCount="345" Body="&lt;p&gt;How can I define two separate directories, create a virtual directory out of them in &lt;code&gt;dired&lt;/code&gt;, and also bookmark that?  I want to launch the bookmark and get the combined view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know &lt;a href=&quot;https://superuser.com/a/807979&quot;&gt;&lt;code&gt;dired+&lt;/code&gt; has something close&lt;/a&gt;, but as far as I can tell, this gives you a list of directories.  Iwant the &lt;em&gt;content&lt;/em&gt; of these directories instead.&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2016-04-23T22:40:59.290" Title="Combine two directories into a virtual directory and bookmark it?" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21798" PostTypeId="2" ParentId="21792" CreationDate="2016-04-23T15:02:12.067" Score="0" Body="&lt;p&gt;I finally gave up on regexp's for this problem, and just wrote a little loop that &quot;manually&quot; doubled each slash in the input pathname.  Here's my solution, in case someone can use it one day... (I have manually doubled slashes for the website, so what you see is what I actually see on my screen).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(defun double-slash (path)&#xA;  (let ((limit (length path))&#xA;        i curchar result)&#xA;  (setq i 0)&#xA;  (while (&amp;lt; i limit)                    ;for each char in input string&#xA;    (setq curchar (substring path i (1+ i))) &#xA;    (cond ((equal curchar &quot;\\&quot;)         ;double each slash&#xA;           (setq result (concat result &quot;\\&quot; curchar))) &#xA;          (t                            ;else just copy it over&#xA;           (setq result (concat result curchar))))&#xA;    (setq i (1+ i)))&#xA;  result))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on Drew's comment above, that used 4 slashes in each of the match and replacement (at least visually in his posting), I tried a regexp using 4 to match, and 8 to replace, and it worked. Here is what I see on my screen (I manually added slashes (8 and 16) to get it to look right here). This is a second solution that works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(insert-string (concat (replace-regexp-in-string &quot;\\\\&quot; &quot;\\\\\\\\&quot; &quot;C:\\joe\\blow&quot;) &quot;--hi there&quot;))&#xA;C:\\joe\\blow--hi therenil&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had tried various combinations of regexp slashes before I first posted (2x2, 2x4, 4x2, 4x4), but I quit after permutations involving up to 4 slashes. I should have kept going, because 4 (match) and 8 (replace) was the combination that worked. Thank you to everyone.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-04-24T00:45:02.887" LastActivityDate="2016-04-24T00:45:02.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21799" PostTypeId="2" ParentId="21797" CreationDate="2016-04-23T15:26:54.947" Score="5" Body="&lt;p&gt;&lt;strong&gt;A. Wrt the Dired union buffer part of your question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, take another look at &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;, in particular, &lt;strong&gt;&lt;code&gt;C-x D&lt;/code&gt;&lt;/strong&gt; (command &lt;code&gt;diredp-dired-union&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have some Dired buffers whose contents you want to combine, say &lt;code&gt;dirbuf1&lt;/code&gt;, &lt;code&gt;dirbuf2&lt;/code&gt;, and &lt;code&gt;dirbuf3&lt;/code&gt;, then use: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x D my-union-dired-buf RET dirbuf1 RET dirbuf2 RET dirbuf3 RET C-g&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;my-union-dired-buf&lt;/code&gt; to name the Dired buffer to use.  (You can also add the contents of dirs to an existing Dired buffer.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;dirbuf1&lt;/code&gt;, &lt;code&gt;dirbuf2&lt;/code&gt;, and &lt;code&gt;dirbuf3&lt;/code&gt; to specify the Dired buffers whose contents you want to combine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-g&lt;/code&gt; to say you're done.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you do not have existing Dired buffers, and you want to create a Dired buffer whose contents combines the contents of multiple directories, say &lt;code&gt;dir1&lt;/code&gt;, &lt;code&gt;dir2&lt;/code&gt; and &lt;code&gt;dir3&lt;/code&gt;, then use a negative prefix arg with &lt;code&gt;C-x D&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-- C-x D my-union-dired-buf RET dir1/* RET dir2/* RET C-g&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M--&lt;/code&gt; to tell &lt;code&gt;diredp-dired-union&lt;/code&gt; you will specify dirs to include (not necessarily dirs in Dired buffers).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;my-union-dired-buf&lt;/code&gt; to name the Dired buffer to use.  (You can also add the contents of dirs to an existing Dired buffer.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;dir1/*&lt;/code&gt;, &lt;code&gt;dir2/*&lt;/code&gt;, and &lt;code&gt;dir3/*&lt;/code&gt; to specify that you want the contents of those directories.  (Specify the directories either relative to the current &lt;code&gt;default-directory&lt;/code&gt; or as absolute names.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-g&lt;/code&gt; to say you're done.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In this example, if you used, say, &lt;code&gt;dir2&lt;/code&gt; instead of &lt;code&gt;dir2/*&lt;/code&gt; then you would get a Dired buffer with the contents of &lt;code&gt;dir1&lt;/code&gt; and &lt;code&gt;dir3&lt;/code&gt; and a single line for directory &lt;code&gt;dir2/&lt;/code&gt;.  The glob pattern &lt;code&gt;dir2/*&lt;/code&gt; means all files and subdirectories in directory &lt;code&gt;dir2&lt;/code&gt; (directly, as children, not recursively, as descendants).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f diredp-dired-union&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;diredp-dired-union is an interactive compiled Lisp function in&#xA;      &lt;code&gt;dired+.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to menu-bar subdir diredp-dired-union, C-x D.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(diredp-dired-union DIRED-NAME DIRBUFS &amp;amp;optional SWITCHES EXTRA)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Create a Dired buffer that is the union of some existing Dired buffers.&#xA;      With a non-negative prefix arg, you are prompted for &lt;code&gt;ls&lt;/code&gt; switches.&#xA;      With a non-positive prefix arg, you are prompted for file and dir&#xA;      names to add to the listing - see below.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You are prompted for the name of the Dired union buffer.  Completion&#xA;      against names of existing Dired buffers is available, but you can&#xA;      enter any other name to create a new Dired buffer of that name.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the union buffer name you choose names an existing Dired buffer,&#xA;      then what happens depends on whether that buffer is an ordinary Dired&#xA;      directory listing or a list of arbitrary file names.  That is, it&#xA;      depends on whether &lt;code&gt;dired-directory&lt;/code&gt; is a directory name or a cons of&#xA;      a Dired buffer name plus file names.&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;If the buffer is an ordinary Dired listing, then it is converted to&#xA;    an explicit list of absolute file names, just as if these had been&#xA;    chosen individually.  The existing buffer and window are replaced by&#xA;    new ones that show the explicit listing.  (This replacement is&#xA;    necessary because the list of files contained in an ordinary Dired&#xA;    listing cannot be modified.)&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;If the buffer lists arbitrary file names explicitly, then it is&#xA;    updated to include also the files from any Dired buffers and any&#xA;    additional files that you specify.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the union buffer name you choose does not name an existing Dired&#xA;  buffer, then its &lt;code&gt;default-directory&lt;/code&gt; is the same as the&#xA;  &lt;code&gt;default-directory&lt;/code&gt; before invoking the command.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If you use a non-positive prefix arg, then you can next choose&#xA;  additional file and directory names to add to the listing.  Use &lt;code&gt;C-g&lt;/code&gt;&#xA;  when done choosing them.  Any directory names you choose this way are&#xA;  included as single entries in the listing - the directory contents are&#xA;  not included (these directories are not unioned).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You are then prompted for the Dired buffers to union.  Use &lt;code&gt;C-g&lt;/code&gt; when&#xA;  done choosing them.  These Dired listings to union are included in the&#xA;  order that you chose them, and each entry is listed only once in the&#xA;  new Dired buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The new Dired listing respects the markings, subdirectory insertions,&#xA;  and hidden subdirectories of the selected Dired listings.  However, in&#xA;  case of conflict between marked or unmarked status for the same entry,&#xA;  the entry is marked.  Similarly, in case of conflict over an included&#xA;  subdirectory between it being hidden or shown, it is hidden, but its&#xA;  contained files are also listed.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;From Lisp:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;DIRED-NAME&lt;/code&gt; is the name of the resulting Dired union buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;DIRBUFS&lt;/code&gt; is a list of the names of Dired buffers to union.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;SWITCHES&lt;/code&gt; is a string of &lt;code&gt;ls&lt;/code&gt; switches.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;EXTRA&lt;/code&gt; is a list of files &amp;amp; directories to be included in the listing.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B. Wrt the bookmarking part of your question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt; then you can bookmark the result of creating such a Dired buffer (see part &lt;strong&gt;A&lt;/strong&gt;), by using a &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#FunctionSequenceVarlistBookmarks&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;function bookmark&lt;/em&gt;&lt;/a&gt;. The function to invoke when the bookmark is &quot;jumped to&quot; would invoke &lt;code&gt;diredp-dired-union&lt;/code&gt; to accomplish what is described in part &lt;strong&gt;A&lt;/strong&gt;.  Just define a function &lt;code&gt;foo&lt;/code&gt; that invokes &lt;code&gt;diredp-dired-union&lt;/code&gt; with the proper arguments, and then create a function bookmark that invokes &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added this command to &lt;strong&gt;Bookmark+&lt;/strong&gt;, to do what you request:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun bmkp-set-dired-bookmark-for-files (bookmark-name dired-name to-add &amp;amp;optional switches msg-p)&#xA;  &quot;Create a Dired bookmark for a set of files and directories.&#xA;You are prompted for the Dired buffer name and the file or directory&#xA;entries to include.  With a prefix arg, you are also prompted for the&#xA;`ls' switches.&#xA;&#xA;Use `C-g' when done choosing file and directory names.  Any directory&#xA;names you choose this way are included as single entries in the&#xA;listing - the directory contents are not included.  To instead include&#xA;the contents of a directory, use a glob pattern: put `/*' after the&#xA;directory name.&#xA;&#xA;You need library `Dired+' for this command.&quot;&#xA;  (interactive&#xA;   (let* ((_IGNORE             (unless (require 'dired+ nil t)&#xA;                                 (error &quot;You need library `Dired+' for this command&quot;)))&#xA;          (current-prefix-arg  (if current-prefix-arg 0 -1))&#xA;          (all                 (diredp-dired-union-interactive-spec&#xA;                                &quot;add files/dirs &quot;&#xA;                                'NO-DIRED-BUFS&#xA;                                'READ-EXTRA-FILES-P)))&#xA;     (list (bmkp-completing-read-lax &quot;Bookmark&quot;) (nth 0 all) (nth 3 all) (nth 2 all) 'MSG)))&#xA;  (bmkp-make-function-bookmark&#xA;   bookmark-name&#xA;   `(lambda () (diredp-add-to-dired-buffer ',dired-name ',to-add ',switches))&#xA;   msg-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="25" LastEditDate="2016-04-23T22:40:59.290" LastActivityDate="2016-04-23T22:40:59.290" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21800" PostTypeId="2" ParentId="21796" CreationDate="2016-04-23T16:01:06.373" Score="2" Body="&lt;p&gt;Yes, vanilla Dired has help for this, and &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; provides some more help.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use &lt;code&gt;!&lt;/code&gt; on a file (or marked files) to run a shell program on it. Use &lt;code&gt;M-n&lt;/code&gt; to cycle among possible commands.  These commands to choose from come from the MIME type of the file (see non-option variable &lt;code&gt;mailcap-mime-data&lt;/code&gt;).  They can also come from entries that you make in user option &lt;strong&gt;&lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt;&lt;/strong&gt; (you will need to load standard library &lt;code&gt;dired-x.el&lt;/code&gt; for this).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use Emacs on MS Windows and you have both &lt;strong&gt;Dired+&lt;/strong&gt; and library &lt;a href=&quot;https://www.emacswiki.org/emacs/w32-browser.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;w32-browser.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; (see &lt;a href=&quot;https://www.emacswiki.org/emacs/MsShellExecute&quot; rel=&quot;nofollow&quot;&gt;Ms Shell Execute&lt;/a&gt;) then you can use &lt;code&gt;M-RET&lt;/code&gt; in Dired to open a file or directory using its Windows file association (i.e., its &quot;open&quot; program).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-23T16:01:06.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21801" PostTypeId="2" ParentId="21791" CreationDate="2016-04-23T16:27:16.557" Score="1" Body="&lt;p&gt;Try using Emacs file-name aliases. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Aliases.html&quot; rel=&quot;nofollow&quot;&gt;File Aliases&lt;/a&gt;. See, in particular, option &lt;strong&gt;&lt;code&gt;directory-abbrev-alist&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-23T16:27:16.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21802" PostTypeId="2" ParentId="9413" CreationDate="2016-04-23T20:05:49.187" Score="1" Body="&lt;p&gt;Yes it can.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;org-set-font-lock-defaults&lt;/code&gt; sets font lock defaults for org mode buffers for all the types of org faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not only the contents itself is important but also the order in which it is defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, I will show pieces of code from the actual function (org version 8.3.4):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This block takes care of fontifing links. The type of link you are interested in is fourth line ('bracket).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Links&#xA;(if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))&#xA;(if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t)))&#xA;(if (memq 'plain lk) '(org-activate-plain-links (0 'org-link t)))&#xA;(if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))&#xA;(if (memq 'radio lk) '(org-activate-target-links (1 'org-link t)))&#xA;(if (memq 'date lk) '(org-activate-dates (0 'org-date t)))&#xA;(if (memq 'footnote lk) '(org-activate-footnote-links))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The comment lines (meta lines) are taken care by following piece of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Blocks and meta lines&#xA;'(org-fontify-meta-lines-and-blocks))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The most easy (but maybe also a hacky) way to do it is remove the &quot;bracket&quot; s-expression from the list &lt;code&gt;org-font-lock-extra-keywords&lt;/code&gt; and add it to the end of the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do so using a hook named &lt;code&gt;org-font-lock-set-keywords-hook&lt;/code&gt; to &quot;swap&quot; these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now using this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vlk/org-font-links-in-comments ()&#xA;  ;; get bracket link s-expression for the font lock&#xA;  (let ((bracket-link-face (nth 12 org-font-lock-extra-keywords)))&#xA;    ;; remove the font lock from the list&#xA;    (delete bracket-link-face org-font-lock-extra-keywords)&#xA;    ;; add it to the end&#xA;    (add-to-list 'org-font-lock-extra-keywords bracket-link-face t)))&#xA;&#xA;(org-add-hook 'org-font-lock-set-keywords-hook 'vlk/org-font-links-in-comments)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It certainly can be improved but it is functional for me so far.&lt;/p&gt;&#xA;" OwnerUserId="11828" LastActivityDate="2016-04-23T20:05:49.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21803" PostTypeId="1" AcceptedAnswerId="21806" CreationDate="2016-04-24T00:25:42.443" Score="8" ViewCount="161" Body="&lt;p&gt;Every time when I change something in a buffer, and then I decided to install a package from packages.el, Emacs is repeatingly asking me if I want to save the other buffers, because it's changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fail to understand the relation between this buffer and the installation of a package. On the internet I found no suitable answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone care to explain the logic behind this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-04-24T16:47:13.953" LastActivityDate="2016-04-24T16:47:13.953" Title="Why is Emacs asking me to save changed buffers, when I install a package?" Tags="|package|byte-compilation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21804" PostTypeId="1" AcceptedAnswerId="21816" CreationDate="2016-04-24T02:19:38.350" Score="3" ViewCount="260" Body="&lt;p&gt;I'm running emacs 24.5.1, with the built in ido-mode. I enable &lt;code&gt;(setq ido-mode-flex-matching t)&lt;/code&gt; and &lt;code&gt;(ido-mode 1)&lt;/code&gt;in my startup file, and ido matching (at least the prefix and substring types of matching) work fine in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &quot;flex matching&quot; (as I understand it, perhaps incorrectly) should allow me to type &quot;psw&quot; to match a file named Pro-Something-Windows or program-swift-wings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried combinations such as psw, p-s-w, etc, but without success. Am I doing something wrong, or do I understand flex matching incorrectly? I've search the net, youtube, SO, and various IDO articles and help files, but came away with nothing (except youtube demonstrated the matching behavior that I don't get with my setup...)  Thank you&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-04-24T13:50:13.133" Title="ido flex matching doesn't seem to work, or works partially" Tags="|ido|ido-find-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21806" PostTypeId="2" ParentId="21803" CreationDate="2016-04-24T03:08:01.540" Score="8" Body="&lt;p&gt;There isn't a lot of logic behind this. At least, not in the sense of a conscious decision. It's more of a feature of the compilation process that really doesn't apply to package management but nobody has bothered to fix it yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever Emacs is about to compile something it asks you if you want to save edited buffers. That's actually something very useful, and makes perfect sense when you're compiling some code you're working on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, this applies to the byte compiler, which compiles Elisp files. And one of the steps of installing a package is to byte compile it. When this happens, Emacs will do its usual routine of asking you to save stuff, even though it doesn't really matter here. &lt;/p&gt;&#xA;" OwnerUserId="50" LastActivityDate="2016-04-24T03:08:01.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21807" PostTypeId="1" AcceptedAnswerId="21951" CreationDate="2016-04-24T03:17:03.183" Score="0" ViewCount="50" Body="&lt;p&gt;I just upgraded to modified Emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://vgoulet.act.ulaval.ca/en/emacs/mac/&quot; rel=&quot;nofollow&quot;&gt;http://vgoulet.act.ulaval.ca/en/emacs/mac/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I used to work in R files, &lt;code&gt;#'&lt;/code&gt; was recognized by &lt;code&gt;ess-mode&lt;/code&gt; such that hitting &lt;code&gt;[Enter]&lt;/code&gt; at the end of a line that began with &lt;code&gt;#'&lt;/code&gt; would start the next line with &lt;code&gt;#'&lt;/code&gt;. After the upgrade, it does not seem to recognize &lt;code&gt;#'&lt;/code&gt; as a special form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what variable I need to set?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastActivityDate="2016-04-30T00:50:42.760" Title="Making ESS recognize #'" Tags="|ess|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21808" PostTypeId="2" ParentId="21796" CreationDate="2016-04-24T08:38:08.593" Score="5" Body="&lt;p&gt;On Debian, this is how I do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mu-open-in-external-app ()&#xA;  &quot;Open the file where point is or the marked files in Dired in external&#xA;app. The app is chosen from your OS's preference.&quot;&#xA;  (interactive)&#xA;  (let* ((file-list&#xA;          (dired-get-marked-files)))&#xA;    (mapc&#xA;     (lambda (file-path)&#xA;       (let ((process-connection-type nil))&#xA;         (start-process &quot;&quot; nil &quot;xdg-open&quot; file-path))) file-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key dired-mode-map (kbd &quot;C-&amp;lt;return&amp;gt;&quot;) #'mu-open-in-external-app)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind &lt;code&gt;RET&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key dired-mode-map (kbd &quot;RET&quot;) #'mu-open-in-external-app)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2016-04-24T08:38:08.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21810" PostTypeId="1" AcceptedAnswerId="21811" CreationDate="2016-04-24T10:22:12.340" Score="0" ViewCount="236" Body="&lt;p&gt;smex won't work without evoking the command.&#xA; When I run &lt;code&gt;M-x smex&lt;/code&gt; it will work just for that command&#xA;If press &lt;code&gt;M-x&lt;/code&gt; again I will not work,  will have to press &lt;code&gt;M-x smex&lt;/code&gt; again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using centos 7.&#xA;Here is my &lt;code&gt;.emacs&lt;/code&gt; file(sorry don't have github), the smex configuration is in bold:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;enter ;; init.el --- Emacs configuration&#xA;&#xA;;; INSTALL PACKAGES&#xA;;; --------------------------------------&#xA;&#xA;(require 'package)&#xA;&#xA;(add-to-list 'package-archives&#xA;       '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;&#xA;(defvar myPackages&#xA;  '(better-defaults&#xA;    elpy ;; add the elpy package&#xA;    flycheck ;; add the flycheck package&#xA;    material-theme))&#xA;(elpy-enable)&#xA;&#xA;;; realtime python checking&#xA;(when (require 'flycheck nil t)&#xA;  (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))&#xA;  (add-hook 'elpy-mode-hook 'flycheck-mode))&#xA;&#xA;&#xA;&#xA;(mapc #'(lambda (package)&#xA;    (unless (package-installed-p package)&#xA;      (package-install package)))&#xA;      myPackages)&#xA;&#xA;;; BASIC CUSTOMIZATION&#xA;;; --------------------------------------&#xA;&#xA;(setq inhibit-startup-message t) ;; hide the startup message&#xA;(load-theme 'solarized-dark t) ;; load material theme&#xA;(global-linum-mode t) ;; enable line numbers globally&#xA;&#xA;(require 'ido)&#xA;    (ido-mode t)&#xA;&#xA;**(require 'smex)&#xA;(smex-initialize)**&#xA;&#xA;;; setting up python&#xA;;; install elpy&#xA;&#xA;;; init.el ends here&#xA;&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA;)&#xA;&#xA;&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA;&#xA; '(default ((t (:inherit nil :stipple nil :background &quot;#002b36&quot; :foreground &quot;#839496&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 105 :width normal :foundry &quot;unknown&quot; :family &quot;VL Gothic&quot;))))&#xA;&#xA; '(font-lock-comment-face ((t (:foreground &quot;#3f7f5f&quot;))))&#xA;&#xA; '(org-level-1 ((t (:inherit variable-pitch :foreground &quot;#cb4b16&quot; :height 1.03))) t)&#xA;&#xA; '(org-level-2 ((t (:inherit variable-pitch :foreground &quot;#859900&quot; :height 1.02))) t)&#xA;&#xA; '(org-level-3 ((t (:inherit variable-pitch :foreground &quot;#268bd2&quot; :height 1.01))) t)&#xA;&#xA; '(org-level-4 ((t (:inherit variable-pitch :foreground &quot;#b58900&quot; :height 1.01))) t))&#xA;&#xA;(require 'undo-tree)&#xA;(global-undo-tree-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11832" LastEditorUserId="2710" LastEditDate="2016-04-24T10:58:24.937" LastActivityDate="2016-04-24T10:58:24.937" Title="smex only works when i invoke it" Tags="|init-file|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21811" PostTypeId="2" ParentId="21810" CreationDate="2016-04-24T10:56:29.627" Score="1" Body="&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; is a key, which runs the command &lt;code&gt;execute-extended-command&lt;/code&gt; by default. If you want it to run the command &lt;code&gt;smex&lt;/code&gt;, you need to bind it to &lt;code&gt;smex&lt;/code&gt; by yourself, for example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-x&quot;) 'smex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-24T10:56:29.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21812" PostTypeId="1" AcceptedAnswerId="21835" CreationDate="2016-04-24T11:38:18.083" Score="2" ViewCount="198" Body="&lt;p&gt;I have the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am in a comment or the empty lines after or within the comment. I want to get to the first line of the comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So no matter where I am in this commented block, I want to get to the beginning of line &lt;code&gt;;; blah blah&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x butterfly&#xA;&#xA;;; blah blah &#xA;&#xA;;; spoon&#xA;&#xA;;; blah blah blah&#xA;&#xA;&#xA;;; swordfish&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think I have solved it, albeit clumsily:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun beginning-of-comment ()&#xA;      (interactive)&#xA;      (while&#xA;          (progn&#xA;            (beginning-of-line)&#xA;            (looking-at (rx-to-string (or&#xA;              `(: line-start (zero-or-more whitespace) (one-or-more ,comment-start))&#xA;              `(: line-start (zero-or-more whitespace) line-end))))))&#xA;      (previous-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Problem is, I cannot use the solution above, because it makes my emacs crash (and would presumably make other's emacs' with the same OS/emacs version crash too if I were to PR it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There must be a more idiomatic, less verbose way to get to the beginning of a comment from within it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ninja edit: I thought of one more, but this also crashes emacs (becomes totally unresponsive):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun testing ()&#xA;  (interactive)&#xA;  (while (comment-forward) (progn (previous-line) (previous-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ps. I want this to work in as many modes as possible, so please use &lt;code&gt;comment-start&lt;/code&gt;, do not hardcode the comment variable.&lt;/p&gt;&#xA;" OwnerUserId="3863" LastEditorUserId="3863" LastEditDate="2016-04-24T11:49:11.950" LastActivityDate="2016-04-25T14:45:04.377" Title="If I am in a comment (including empty lines), how do I get to the beginning of the comment?" Tags="|comment|motion|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21813" PostTypeId="2" ParentId="21812" CreationDate="2016-04-24T12:55:17.680" Score="0" Body="&lt;p&gt;Here's an example I could think of, not sure it will handle all corner cases (maybe some modes use different faces for eg.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/move-beginning-of-comment ()&#xA;  (interactive)&#xA;  (while (member (get-char-property (point) 'face)&#xA;                 (list font-lock-comment-face&#xA;                       font-lock-comment-delimiter-face))&#xA;    (backward-char)&#xA;    (skip-chars-backward &quot; \t\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Below is a slightly shorter way to write the same function Lindydancer posted:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-comment-start-position ()&#xA;  &quot;The position of the start of the current comment, or nil.&quot;&#xA;  (save-excursion&#xA;    (let (pos)&#xA;      (while (let* ((parse (syntax-ppss))&#xA;                    (move (and (nth 4 parse) (nth 8 parse))))&#xA;               (when move (goto-char (setq pos move))))&#xA;        (skip-chars-backward &quot; \t\n&quot;))&#xA;    (or pos (point)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2016-04-25T14:45:04.377" LastActivityDate="2016-04-25T14:45:04.377" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21814" PostTypeId="1" CreationDate="2016-04-24T13:01:39.040" Score="2" ViewCount="76" Body="&lt;p&gt;&lt;code&gt;TeX-error-overview&lt;/code&gt; provides a nice overview of errors when compiling a TeX document, however the buffer does not get reused when calling it a second time. Moreover, it would be nice if it would automatically show up. How can I achieve that?&lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2016-04-24T13:01:39.040" Title="How can I keep the TeX-error-overview buffer automatically being updated in particular frame in AUCTeX?" Tags="|auctex|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21815" PostTypeId="1" AcceptedAnswerId="21854" CreationDate="2016-04-24T13:03:18.523" Score="0" ViewCount="282" Body="&lt;p&gt;When compiling a TeX document I would like to have two buffers containing the LaTeX output and &lt;code&gt;TeX-error-overview&lt;/code&gt; in separate frames which are positioned relative to the current frame (the error overview in a shallow frame at the bottom and the output on the right side). How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="600" LastEditDate="2016-04-24T16:53:38.437" LastActivityDate="2016-05-26T16:55:35.673" Title="How can I arrange several frames at fixed, relative positions?" Tags="|frames|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21816" PostTypeId="2" ParentId="21804" CreationDate="2016-04-24T13:15:01.747" Score="3" Body="&lt;p&gt;With yet even more searching on the net and forums, I saw a single lonely reference to &lt;code&gt;(setq ido-enable-flex-matching t)&lt;/code&gt;, which is slightly different than the &lt;em&gt;many&lt;/em&gt; references to &lt;code&gt;(setq ido-mode-flex-matching t)&lt;/code&gt; on the net.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sure enough, the ido-enable-flex-matching variable was the proper one to set for Emacs 24.5.1 on my machine, so now my flex matching works properly. Hopefully someone can benefit from this post. I don't know why there are so many refs to the other variable, or why it works for those other people (like the Youtube video that demonstrates both setq vars for initializing (using the variable that did not work for me), and proper flex match operation. &lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="10" LastEditDate="2016-04-24T13:50:13.133" LastActivityDate="2016-04-24T13:50:13.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21817" PostTypeId="1" AcceptedAnswerId="21818" CreationDate="2016-04-24T13:26:34.243" Score="2" ViewCount="162" Body="&lt;p&gt;I use &lt;code&gt;desktop-save&lt;/code&gt; and &lt;code&gt;desktop-change-dir&lt;/code&gt; a lot. Recently, I upgraded my hardware and now have a screen with way more DPI. This forced me to increase the font size in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, all my desktop files contain a font definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq desktop-saved-frameset [frameset 1 (22300 50983 182648 566000) (desktop . &quot;206&quot;) &quot;horazont@sinistra.sotecware.net&quot; nil nil ((((font-backend xft x) (font . &quot;-unknown-DejaVu Sans Mono-normal-normal-normal-*-11-*-*-*-m-0-iso10646-1&quot;) (font-parameter) […]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make emacs ignore the font from desktop files, and ideally, not store it there at all?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could hack up a sed-call to fix my desktop files, but I really would prefer emacs not to save the font at all.&lt;/p&gt;&#xA;" OwnerUserId="11834" LastActivityDate="2016-04-24T13:34:03.963" Title="How to not load font faces from desktop files?" Tags="|fonts|desktop|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21818" PostTypeId="2" ParentId="21817" CreationDate="2016-04-24T13:34:03.963" Score="0" Body="&lt;p&gt;One way to do it is to hook &lt;code&gt;desktop-after-read-hook&lt;/code&gt; in &lt;code&gt;~/.emacs&lt;/code&gt; to set the desired face after loading a desktop file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun fix-face ()&#xA;  &quot;fix the face after desktop-change-dir&quot;&#xA;  (custom-set-faces&#xA;   '(default ((t (:inherit nil :stipple nil :background &quot;white&quot; :foreground &quot;black&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 100 :width normal :foundry &quot;unknown&quot; :family &quot;Hack&quot;)))))&#xA;  )&#xA;(add-hook 'desktop-after-read-hook 'fix-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This duplicates setting the face and is not found by &lt;code&gt;customize-variable&lt;/code&gt;, so unfortunately it requires manual fiddling with the .emacs file whenever the default face has to be changed.&lt;/p&gt;&#xA;" OwnerUserId="11834" LastActivityDate="2016-04-24T13:34:03.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21819" PostTypeId="1" AcceptedAnswerId="21846" CreationDate="2016-04-24T15:57:53.733" Score="0" ViewCount="100" Body="&lt;p&gt;I have scoured the source code of Wanderlust and Elmo, but have not found a mechanism to save/restore queued operations across Emacs sessions -- e.g., delete certain items from the Inbox, move certain items to Spam, etc.  I'd like to do work offline and kill Emacs and then open Emacs at a later date and process the queued operations.  How can this be achieved?&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-04-25T17:46:01.737" Title="Wanderlust: save/restore queued operations accross sessions" Tags="|wanderlust|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21821" PostTypeId="1" AcceptedAnswerId="21836" CreationDate="2016-04-24T16:24:29.220" Score="1" ViewCount="150" Body="&lt;p&gt;I'm hoping to see summarized diff stats (number of files changed and total insertions/deletions) inline in the magit log view.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently if the diffstats option is enabled the log is rendered with each commit spanning multiple lines like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 17ec06b dotemacs move media bindings&#xA;| &#xA;|  .emacs.d/ebpa.org | 18 +++++++++---------&#xA;|  1 file changed, 9 insertions(+), 9 deletions(-)&#xA;|  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm curious if it is currently possible to see/add summarized diff stats inline with the commit message.  Perhaps as an additional column like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* 17ec06b dotemacs move media bindings                         (1 file, +9, -9)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The compactness would help in visually scanning the log to identify commits which should be rebased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Judging from the discussion on &lt;a href=&quot;https://emacs.stackexchange.com/questions/14483/magit-log-dates&quot;&gt;Magit log dates&lt;/a&gt; I'm guessing this is not easily done yet.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-04-25T12:02:50.310" Title="magit log view showing summarized diffstats inline?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21822" PostTypeId="1" AcceptedAnswerId="30292" CreationDate="2016-04-24T16:32:48.473" Score="4" ViewCount="908" Body="&lt;p&gt;I'm asking this question because I'm personally confused on how &lt;code&gt;org-clock&lt;/code&gt; works in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;org-clock-save.el&lt;/code&gt; file only has one line, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; org-persist.el - PCNAMEHERE at &amp;lt;2016-04-24 Sun 11:16&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From what I understand, the only thing the file is doing is telling emacs/org-mode to save my clock times across sessions. Furthermore, the only changes I see is that it updates the time stamp and the last computer that used it whenever it gets saved. Is this true?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, then where does org-mode save my clock times?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use github to sync my .emacs.d file across two computers, so there are some files I put in my .gitignore files so that packages and other files get installed and set locally. Would it be safe to add my &lt;code&gt;org-clock-save.el&lt;/code&gt; file to this now? For clarity, I've already pushed and pulled &lt;code&gt;org-clock-save.el&lt;/code&gt; a few times between PCs, so there is a file on each pc saying this with the only difference being the time stamp between pulls/pushes. &lt;/p&gt;&#xA;" OwnerUserId="11660" LastActivityDate="2017-01-30T14:06:18.587" Title="Function of org-clock-save.el file and Git related question" Tags="|org-mode|git|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21823" PostTypeId="2" ParentId="21812" CreationDate="2016-04-24T17:35:19.563" Score="-1" Body="&lt;p&gt;More robust, but also more verbose:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun beginning-of-comment ()&#xA;  &quot;When within a comment block - including empty lines - iterates backwards until the beginning.&quot;&#xA;  (interactive)&#xA;  (progn&#xA;    (while&#xA;        (progn&#xA;          (beginning-of-line)&#xA;          (or&#xA;           ;; Not working to use ?\n in rx-to-string for some reason&#xA;           (looking-at (rx (zero-or-more whitespace) ?\n))&#xA;           (looking-at (rx-to-string&#xA;                        `(: line-start (zero-or-more whitespace) (one-or-more ,comment-start))))))&#xA;      (previous-line))&#xA;    ;; If we end up in a code line, move one line forward.&#xA;    (unless&#xA;        (looking-at (rx (zero-or-more whitespace) line-end))&#xA;      (next-line)&#xA;      (beginning-of-line))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3863" LastActivityDate="2016-04-24T17:35:19.563" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21824" PostTypeId="1" CreationDate="2016-04-24T19:01:18.437" Score="2" ViewCount="693" Body="&lt;p&gt;As I using a non us keyboard, I want to map the capslock key as super key in emacs. I use Seil and Karabiner to map the capslock to the combination Ctrl-Alt-Cmd-Shift, which is recognized in Emacs as &lt;code&gt;C-M-s&lt;/code&gt;. I've tried to use &lt;code&gt;(define-key local-function-key-map &quot;\C-M-s&quot; [(super ?\ )])&lt;/code&gt; but it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I map the sequence, so emacs recognizes it as Super key?&lt;/p&gt;&#xA;" OwnerUserId="11837" LastActivityDate="2016-04-25T18:19:59.860" Title="Map Super to Capslock" Tags="|osx|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21825" PostTypeId="2" ParentId="7996" CreationDate="2016-04-24T19:22:33.893" Score="18" Body="&lt;p&gt;Another way to achieve the same effect more permanently is to modify &lt;code&gt;org-latex-packages-alist&lt;/code&gt; to add the &lt;code&gt;geometry&lt;/code&gt; package, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-packages-alist '((&quot;margin=2cm&quot; &quot;geometry&quot; nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8475" LastActivityDate="2016-04-24T19:22:33.893" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21827" PostTypeId="2" ParentId="21785" CreationDate="2016-04-24T22:16:03.463" Score="4" Body="&lt;p&gt;&lt;code&gt;rx-to-string&lt;/code&gt; is an alternate concrete syntax for regular expressions. It translates its argument to a regular expression piece by piece. There is no negation operator in regular expressions, so there is no general negation operator in &lt;code&gt;rx-to-string&lt;/code&gt; either. The &lt;code&gt;not&lt;/code&gt; operator only recognizes a few specific constructs; for example, character sets can be negated easily, e.g. &lt;code&gt;[abcdef]&lt;/code&gt; to &lt;code&gt;[^abcdef]&lt;/code&gt; and vice versa, so rx supports &lt;code&gt;not&lt;/code&gt; on character sets. Similarly &lt;code&gt;\sX&lt;/code&gt; can be negated to &lt;code&gt;\SX&lt;/code&gt;, &lt;code&gt;\b&lt;/code&gt; to &lt;code&gt;\B&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle, it would be possible to implement &lt;code&gt;not&lt;/code&gt;, since the complement of the language recognized by a regular expression can also be recognized by a regular expression. However, this requires a complete structural change in the regular expression, and in general the size of the regular expression for the negation is exponential in size compared to the original expression, so this may require a very long calculation and a large amount of memory, in addition to the coding effort. This is why regular expression engines don't provide negation, or only a restricted form of it (e.g. Perl's negative lookahead and lookbehind assertions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual workaround when you need to negate something is to put the part you want to match in a group, and use code to analyze the matched group afterwards.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (string-match &quot;stuff and \\(.*\\) and more&quot; mystring)&#xA;    (let ((could-be-anything (match-group 1)))&#xA;      (if (not (save-match-data (string-match &quot;not this&quot; mystring))&#xA;          …)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-04-24T22:16:03.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21828" PostTypeId="1" AcceptedAnswerId="21830" CreationDate="2016-04-24T22:34:50.530" Score="1" ViewCount="997" Body="&lt;p&gt;Can I perhaps add a hook via local variables in the file header?&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="306" LastEditDate="2016-04-25T11:56:37.713" LastActivityDate="2019-03-12T17:58:01.823" Title="How can I enable git auto-commit on a per-file basis?" Tags="|git|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21829" PostTypeId="1" CreationDate="2016-04-25T00:31:33.690" Score="1" ViewCount="386" Body="&lt;p&gt;I am using spacemacs and I am wondering how I can set TAB to Control Key inside of emacs only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have set TAB to CTRL on my laptop in the OS, but I want to use TAB in other applications.  So, in only Emacs, I want to use TAB to be CTRL.  How I can do that?&lt;/p&gt;&#xA;" OwnerUserId="11839" LastEditorUserId="5213" LastEditDate="2016-04-27T15:44:20.063" LastActivityDate="2016-04-29T14:55:07.047" Title="How to set TAB to CTRL inside Emacs only?" Tags="|key-bindings|spacemacs|" AnswerCount="1" CommentCount="3" ClosedDate="2016-04-30T10:36:37.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="21830" PostTypeId="2" ParentId="21828" CreationDate="2016-04-25T01:10:49.573" Score="1" Body="&lt;p&gt;Here is what I use to auto-commit files in 2 directories (for my notes):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun egh:maybe-git-auto-commit-mode ()&#xA;  (let* ((bfn (buffer-file-name))&#xA;         (root (and bfn (vc-git-root bfn)))&#xA;         (full-root (and root (expand-file-name root))))&#xA;    (if (or (string-equal full-root &quot;/home/egh/c/notes/h/&quot;)&#xA;            (string-equal full-root &quot;/home/egh/c/notes/w/&quot;))&#xA;        (git-auto-commit-mode +1))))&#xA;(add-hook 'org-mode-hook #'egh:maybe-git-auto-commit-mode)&#xA;(setq-default gac-automatically-push-p t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will commit org files when the git root is &lt;code&gt;/home/egh/c/notes/{c,w}&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="838" LastEditorUserId="306" LastEditDate="2016-04-25T12:01:00.393" LastActivityDate="2016-04-25T12:01:00.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21831" PostTypeId="1" AcceptedAnswerId="21832" CreationDate="2016-04-25T02:17:03.160" Score="0" ViewCount="43" Body="&lt;p&gt;I am trying to get the string value of a variable defined in a Python file and assign it to an elisp variable. The value is held in the variable &lt;code&gt;org_file&lt;/code&gt; in a file &lt;code&gt;config.py&lt;/code&gt; in the same directory as my elisp file. In the elisp file I have the following variable declaration (&lt;code&gt;corgi&lt;/code&gt; is the name of the Python package):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar corgi-org-file-path&#xA;    (shell-command-to-string &quot;python -c \&quot;from config import org_file; print org_file\&quot;&quot;)&#xA;    &quot;Path to org file retrieved from python config file&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I evaluate the &lt;code&gt;shell-command-to-string&lt;/code&gt; call alone, it returns the string path that I want. However, if I evaluate &lt;code&gt;corgi-org-file-path&lt;/code&gt; after it is defined, I get a Python Traceback in the messages buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Traceback (most recent call last):&#xA;  File \&quot;&amp;lt;string&amp;gt;\&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;ImportError: No module named config&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am not really sure what is happening here. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-04-25T04:11:29.707" Title="Unexpected behavior when defining variable" Tags="|shell-command|defvar|" AnswerCount="1" CommentCount="1" ClosedDate="2016-04-25T13:57:08.397" ContentLicense="CC BY-SA 3.0" />
  <row Id="21832" PostTypeId="2" ParentId="21831" CreationDate="2016-04-25T04:03:18.407" Score="1" Body="&lt;p&gt;The cwd for that shell command will be based on the &lt;code&gt;default-directory&lt;/code&gt; for the active buffer at the time your file is loaded; not the directory in which the loaded file resides.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to utilise the &lt;code&gt;load-file-name&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((default-directory (file-name-directory load-file-name)))&#xA;  (shell-command-to-string ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-04-25T04:11:29.707" LastActivityDate="2016-04-25T04:11:29.707" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21834" PostTypeId="1" AcceptedAnswerId="21900" CreationDate="2016-04-25T06:58:22.310" Score="2" ViewCount="612" Body="&lt;p&gt;When selecting a newsgroup to read, &lt;code&gt;gnus&lt;/code&gt; prompts for the number of articles to fetch. The value it shows is the number of articles in the group.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recall that there was a way to specify a default value, such that &lt;code&gt;gnus&lt;/code&gt; would prompt to load only the most recent, say, 500 articles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="5345" LastActivityDate="2018-01-05T10:58:19.577" Title="Specify default number of articles to fetch" Tags="|gnus|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21835" PostTypeId="2" ParentId="21812" CreationDate="2016-04-25T08:20:19.150" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;syntax-ppss&lt;/code&gt; to find out if the point is in a comment or not. When it is, it also provides information about where the comment started. The following code wraps this into a loop, skipping empty lines etc.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-comment-start-position ()&#xA;  &quot;The position of the start of the current comment, or nil.&quot;&#xA;  (save-excursion&#xA;    (let ((res nil))&#xA;      (while (progn&#xA;               (skip-chars-backward &quot; \t\n&quot;)&#xA;               (let ((state (syntax-ppss)))&#xA;                 (if (nth 4 state)&#xA;                     (let ((start (nth 8 state)))&#xA;                       (setq res start)&#xA;                       (goto-char start)&#xA;                       t)&#xA;                   nil))))&#xA;      res)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code is more robust than looking at regexp:s, since it handles difficult languages where the comment syntax must be defined programatically using a &lt;code&gt;syntax-propertize-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it is more robust than checking the &lt;code&gt;face&lt;/code&gt; property:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Some users don't like syntax highlighting and disable font-lock&lt;/li&gt;&#xA;&lt;li&gt;font-lock isn't active in batch mode&lt;/li&gt;&#xA;&lt;li&gt;font-lock only highlights visible parts of the buffer&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;face&lt;/code&gt; property doesn't have to contain a single symbol (see below), code reading it must handle all cases. (This happens, for example, when highlighing additional things inside comments.)&lt;/li&gt;&#xA;&lt;li&gt;Badly written font-lock keywords sometimes &lt;em&gt;replace&lt;/em&gt; the existing face rather than prepending or appending&lt;/li&gt;&#xA;&lt;li&gt;Some comments may be highlighted using another face, e.g. if you have javadoc-style comments &lt;code&gt;font-lock-doc-face&lt;/code&gt; is used.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From the elisp manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;‘face’&#xA;&#xA;The ‘face’ property controls the appearance of the character (*note&#xA;Faces::).  The value of the property can be the following:&#xA;&#xA;   • A face name (a symbol or string).&#xA;&#xA;   • An anonymous face: a property list of the form ‘(KEYWORD VALUE&#xA;     …)’, where each KEYWORD is a face attribute name and VALUE is&#xA;     a value for that attribute.&#xA;&#xA;   • A list of faces.  Each list element should be either a face&#xA;     name or an anonymous face.  This specifies a face which is an&#xA;     aggregate of the attributes of each of the listed faces.&#xA;     Faces occurring earlier in the list have higher priority.&#xA;&#xA;   • A cons cell of the form ‘(foreground-color . COLOR-NAME)’ or&#xA;     ‘(background-color . COLOR-NAME)’.  This specifies the&#xA;     foreground or background color, similar to ‘(:foreground&#xA;     COLOR-NAME)’ or ‘(:background COLOR-NAME)’.  This form is&#xA;     supported for backward compatibility only, and should be&#xA;     avoided.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2016-04-25T11:03:55.163" LastActivityDate="2016-04-25T11:03:55.163" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="21836" PostTypeId="2" ParentId="21821" CreationDate="2016-04-25T12:02:50.310" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Judging from the discussion on Magit log dates I'm guessing this is not easily done yet.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm afraid that's correct.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-04-25T12:02:50.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21838" PostTypeId="2" ParentId="15185" CreationDate="2016-04-25T13:34:26.610" Score="4" Body="&lt;p&gt;As a workaround for the use of an hline-relative LHS formulas for in-table subtotals. I had the same problem as the OP, but found a reasonably flexible workaround using named fields. MWE:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   | Breakfast                  |      Price |&#xA;|---+----------------------------+------------|&#xA;|   | Spam, eggs, and spam       |       2.35 |&#xA;|   | Spam, spam, eggs, and spam |       2.85 |&#xA;|---+----------------------------+------------|&#xA;|   | Breakfast Menu Total       |        5.2 |&#xA;| ^ |                            | bkfst_totl |&#xA;|---+----------------------------+------------|&#xA;|   | Lunch                      |      Price |&#xA;|---+----------------------------+------------|&#xA;|   | Spam sandwich              |       4.75 |&#xA;|   | Spam chunk                 |       3.50 |&#xA;|---+----------------------------+------------|&#xA;|   | Lunch Menu Total           |       8.25 |&#xA;| ^ |                            | lunch_totl |&#xA;|---+----------------------------+------------|&#xA;|   | Total                      |      13.45 |&#xA;#+TBLFM: $bkfst_totl=vsum(@I..@II) :: $lunch_totl=vsum(@IIII..IIIII) :: @&amp;gt;$&amp;gt;=$bkfst_totl+$lunch_totl&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11820" LastActivityDate="2016-04-25T13:34:26.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21839" PostTypeId="2" ParentId="9426" CreationDate="2016-04-25T13:40:34.107" Score="9" Body="&lt;p&gt;While &lt;code&gt;quelpa&lt;/code&gt; and &lt;code&gt;use-package&lt;/code&gt; have no direct relation with each other, there now is a package, &lt;a href=&quot;https://github.com/quelpa/quelpa-use-package&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;quelpa-use-package&lt;/code&gt;&lt;/a&gt;, which adds a &lt;code&gt;quelpa&lt;/code&gt; handler to &lt;code&gt;use-package&lt;/code&gt;. This allows one to use &lt;code&gt;use-package&lt;/code&gt; with a  &lt;code&gt;quelpa&lt;/code&gt; source package name or recipe, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package flycheck-pony&#xA;  :quelpa (flycheck-pony :fetcher github :repo &quot;rmloveland/flycheck-pony&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11846" LastActivityDate="2016-04-25T13:40:34.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21840" PostTypeId="1" CreationDate="2016-04-25T14:27:19.633" Score="5" ViewCount="4351" Body="&lt;p&gt;My vim-using co-worker came by, and since he wanted to do something with files on my PC, I installed evil-mode to allow him to do this more efficiently (vim user trying to accomplish anything in emacs is a sad view). Now I've got a problem: I don't know how to quit evil-mode! I want to turn it off; how can I do that?&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2016-06-25T01:51:19.443" Title="How to quit evil mode?" Tags="|evil|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21841" PostTypeId="2" ParentId="21840" CreationDate="2016-04-25T14:37:04.057" Score="4" Body="&lt;p&gt;Finally, I'm free! To exit evil-mode, you need to press &lt;code&gt;:&lt;/code&gt; (so that you go into command mode, or whatever it's called), and input &lt;code&gt;evil-mode&lt;/code&gt;, then RET. So, just input &lt;code&gt;:evil-mode&lt;/code&gt; and press enter. Voila!&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2016-04-25T14:37:04.057" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21842" PostTypeId="1" AcceptedAnswerId="27687" CreationDate="2016-04-25T15:05:36.170" Score="1" ViewCount="152" Body="&lt;p&gt;When using Spacemacs and neotree, I often see this message pop up&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File not found in root path, do you want to change root? (y or n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I say &lt;code&gt;y&lt;/code&gt;, it moves neotree to the directory of whatever buffer I was on at the time that it popped up. However, I rarely want to do this and would rather not see the message. Is there a flag I can disable to achieve this? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This message is printed by the Neotree package [&lt;a href=&quot;https://github.com/jaypei/emacs-neotree/blob/543b75943b573d9c8b3a22476bdabb331306fd68/neotree.el#L1612&quot; rel=&quot;nofollow&quot;&gt;reference&lt;/a&gt;]&lt;/p&gt;&#xA;" OwnerUserId="10940" LastEditorUserId="115" LastEditDate="2016-04-25T22:47:42.527" LastActivityDate="2016-10-10T07:00:51.397" Title="Stop &quot;File not found in root path, do you want to change root?&quot; message" Tags="|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21843" PostTypeId="2" ParentId="21834" CreationDate="2016-04-25T16:02:42.370" Score="1" Body="&lt;p&gt;Set gnus-large-newsgroup to 500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Selecting-a-Group.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/gnus/Selecting-a-Group.html&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The &lt;em&gt;gnus-large-newsgroup&lt;/em&gt; variable says what Gnus should consider to be a big group. If it is nil, no groups are considered big. The default value is 200. If the group has more (unread and/or ticked) articles than this, Gnus will query the user before entering the group. The user can then specify how many articles should be fetched from the server. If the user specifies a negative number (-n), the n oldest articles will be fetched. If it is positive, the n articles that have arrived most recently will be fetched&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9357" LastActivityDate="2016-04-25T16:02:42.370" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21846" PostTypeId="2" ParentId="21819" CreationDate="2016-04-25T17:46:01.737" Score="1" Body="&lt;p&gt;Wanderlust does what you want out of the box:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;operations performed when offline are stored in a queue;&lt;/li&gt;&#xA;&lt;li&gt;when starting Wanderlust online, queued operations are executed;&lt;/li&gt;&#xA;&lt;li&gt;you can manually switch between online and offline using &lt;code&gt;M-t&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Messages to be sent are saved in your &lt;code&gt;wl-queue-folder&lt;/code&gt;, which must be local (&lt;code&gt;+queue&lt;/code&gt; is good, &lt;code&gt;%Queue&lt;/code&gt; isn't); queued actions are saved in the file &lt;code&gt;.elmo/queue&lt;/code&gt;.  Automatic flushing is controlled by the variable &lt;code&gt;wl-auto-flush-queue&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The low-level code is in &lt;code&gt;elmo-dop.el&lt;/code&gt;, the high-level interface is spread across &lt;code&gt;wl.el&lt;/code&gt;, &lt;code&gt;wl-folder.el&lt;/code&gt; and &lt;code&gt;wl-draft.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-04-25T17:46:01.737" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21847" PostTypeId="1" CreationDate="2016-04-25T17:49:19.487" Score="5" ViewCount="804" Body="&lt;p&gt;When I switched to Emacs from Vim, I really loved the extensibility of Emacs. But compared with Vim, Emacs still feels somewhat sluggish. Especially when I moved my pointer/cursor around, and typing something.It's still my biggest issue with Emacs. Every time when I try Vim again, then I know again why I like to be inside Vim. It feels so snappy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it seems there is a proof about my experiences with Emacs as not being so snappy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://pavelfatin.com/typing-with-pleasure/&quot; rel=&quot;nofollow&quot;&gt;https://pavelfatin.com/typing-with-pleasure/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume the latency has something to do with the font locking and Elisp in Emacs? This is a general question, not to be specific to a culprit. Emacs in overall feels less 'snappier' than Vim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any suitable approach to make Emacs more 'snappier'? Like if we could compile our extensive dot-Emacs into a compiled version of personal customized emacs in binary code? Would that make Emacs feel snappy? Or are there another ways to make Emacs feeling more 'snappy' like with Vim?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Xubuntu 16.04 on SSD with GUI Emacs version 25.1&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="6915" LastEditDate="2016-04-26T08:14:40.970" LastActivityDate="2016-04-26T08:14:40.970" Title="Ways to make Emacs feel snappy as Vim?" Tags="|font-lock|performance|" AnswerCount="0" CommentCount="8" ClosedDate="2016-04-26T06:20:59.697" ContentLicense="CC BY-SA 3.0" />
  <row Id="21848" PostTypeId="2" ParentId="12119" CreationDate="2016-04-25T17:52:15.147" Score="1" Body="&lt;p&gt;Just say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq wl-draft-config-alist&#xA;      '((t (mime-edit-pgp-processing . '(sign)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See Section 7.1.4 of the Wanderlust manual, &lt;em&gt;Dynamic Modification of Messages&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-04-25T17:52:15.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21849" PostTypeId="2" ParentId="21824" CreationDate="2016-04-25T18:19:59.860" Score="2" Body="&#xA;&#xA;&lt;h2&gt;tl;dr&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Your best option would be to find a way to bind &lt;kbd&gt;CapsLock&lt;/kbd&gt; directly to &lt;kbd&gt;Super&lt;/kbd&gt; at the Operating System level.  Assuming that is not possible, you can create a &quot;sticky&quot; super modifier key that will allow you to use keybindings requiring a super modifier.  As an example, try &lt;code&gt;C-x @ s&lt;/code&gt; followed by some other key.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What you are trying to do is more difficult than you might expect.  The reason is that Emacs most likely does not even see the modifier keys until they have actually &lt;em&gt;modified&lt;/em&gt; a key.  In other words, you can't bind a raw &lt;kbd&gt;Ctrl&lt;/kbd&gt; to anything in Emacs, because the OS does not even notify Emacs that &lt;kbd&gt;Ctrl&lt;/kbd&gt; has been pressed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand part of the reason for this, look at the difference between pressing &lt;kbd&gt;z&lt;/kbd&gt; and pressing &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt;.  The first one sends the ascii code 122, while the second one sends ascii code 26.  Note that it does not send &lt;em&gt;two codes&lt;/em&gt; in the second case, rather the &lt;kbd&gt;Ctrl&lt;/kbd&gt; key &lt;em&gt;modified&lt;/em&gt; what was sent when pressing &lt;kbd&gt;z&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One potential workaround to your problem is to create a &quot;sticky&quot; modifier key.  This will work much like the &lt;code&gt;ESC&lt;/code&gt; key does now. If you press &lt;kbd&gt;ESC&lt;/kbd&gt; followed by &lt;kbd&gt;z&lt;/kbd&gt;, Emacs will interpret it as &lt;code&gt;M-z&lt;/code&gt;.  The code below turns &lt;code&gt;C-]&lt;/code&gt; into a &quot;sticky&quot; super key, so that pressing &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;]&lt;/kbd&gt; followed by &lt;kbd&gt;z&lt;/kbd&gt; will be interpreted as &lt;code&gt;s-z&lt;/code&gt; (also known as &lt;kbd&gt;Super&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Turn `C-]' into a sticky &quot;super&quot; modifier.&#xA;(define-key local-function-key-map [?\C-\]] 'event-apply-super-modifier)&#xA;;; Move the global binding for C-] to C-s-]&#xA;(define-key global-map [?\C-\s-\]] (lookup-key global-map [?\C-\]] t))&#xA;(define-key global-map [?\C-\]] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(It turns out that such a binding to &lt;code&gt;event-apply-super-modifier&lt;/code&gt; already exists using &lt;code&gt;C-x @ s&lt;/code&gt;.  You can try that out to get a feel for how a sticky super modifier might behave.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you could make CapsLock work as a sticky &quot;super&quot; key by defining it at the Operating System level (with Seil and Karabiner in your case), to something that &lt;em&gt;is&lt;/em&gt; available for binding by Emacs. For example, &lt;code&gt;&amp;lt;pause&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;Scroll_Lock&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-04-25T18:19:59.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21850" PostTypeId="2" ParentId="7457" CreationDate="2016-04-25T19:23:13.653" Score="-1" Body="&lt;p&gt;I wrote my own scripted screenshot taker:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/gracjan/gifcast.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/gracjan/gifcast.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5213" LastActivityDate="2016-04-25T19:23:13.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21851" PostTypeId="2" ParentId="395" CreationDate="2016-04-25T20:13:44.313" Score="7" Body="&#xA;&#xA;&lt;p&gt;You can apply a super modifier with &lt;code&gt;C-x @ s&lt;/code&gt;.  So to type &lt;kbd&gt;Super&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt;, you woule press &lt;code&gt;C-x @ s z&lt;/code&gt;.  If you find the &lt;code&gt;C-x @ s&lt;/code&gt; combo too cumbersome, then you can bind it to something easier to type.  Here is an example of binding it to &lt;code&gt;C-]&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Turn `C-]' into a sticky &quot;super&quot; modifier.&#xA;(define-key local-function-key-map [?\C-\]] 'event-apply-super-modifier)&#xA;;; Move the global binding for C-] to C-s-]&#xA;(define-key global-map [?\C-\s-\]] (lookup-key global-map [?\C-\]] t))&#xA;(define-key global-map [?\C-\]] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;C-]&lt;/code&gt; is most likely already bound to something (&lt;code&gt;abort-recursive-edit&lt;/code&gt; by default), I also move whatever is bound to &lt;code&gt;C-]&lt;/code&gt; in the global map to &lt;code&gt;C-s-]&lt;/code&gt;.  You can then invoke &lt;code&gt;abort-recursive-edit&lt;/code&gt; when needed by typing &lt;code&gt;C-]&lt;/code&gt; twice.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-04-25T20:13:44.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21852" PostTypeId="2" ParentId="21787" CreationDate="2016-04-25T22:54:10.710" Score="1" Body="&lt;p&gt;are you sure you are using the right link? It looks like you need: pdfview:./somefile.pdf::2 to me, at least based on &lt;a href=&quot;https://github.com/markus1189/org-pdfview/blob/master/org-pdfview.el#L39&quot; rel=&quot;nofollow&quot;&gt;https://github.com/markus1189/org-pdfview/blob/master/org-pdfview.el#L39&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-04-25T22:54:10.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21854" PostTypeId="2" ParentId="21815" CreationDate="2016-04-26T02:51:47.893" Score="1" Body="&lt;p&gt;Setting up frames (at least the first two) is pretty easy. Here's my code below for doing that. The first set of numbers positions the first initial frame, and the default positions &quot;all the other ones&quot; (I only have two frames running). If you're going to have 3 frames, then you'll have to use make-frame as lawlist said. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also wondering if you mean &quot;windows&quot; instead of frames...  But in case you really do mean frames, here's my positioning code to get you started.  A frame can have any number of windows, split horizontally or vertically, as you please..) Good luck.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-vesta-setup-funs ()&#xA;  (set-vesta-frame-size))&#xA;&#xA;(defun set-vesta-frame-size ()&#xA;  (setq initial-frame-alist&#xA;        '((top . 0)&#xA;          (left . 420)&#xA;          (width . 180)&#xA;          (height . 60)&#xA;          (cursor-color . &quot;black&quot;) (cursor-type . box)&#xA;          (foreground-color . &quot;black&quot;)&#xA;          (background-color . &quot;grey80&quot;)))) ; need at least grey75 on mac&#xA;;; (background-color . &quot;antique white&quot;)&#xA;;; (font . &quot;--Lucida Console-normal-r---11-82---c--*-#204-&quot;)&#xA;&#xA;(setq default-frame-alist&#xA;      (append default-frame-alist&#xA;              '((top . 10)&#xA;                (left . 10)&#xA;                (width . 180)&#xA;                (height . 55)&#xA;                (cursor-type . box)&#xA;                (cursor-color . &quot;black&quot;)&#xA;                (foreground-color . &quot;black&quot;)&#xA;                (background-color . &quot;grey80&quot;)))) ; need at least grey75 on mac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="253" LastEditDate="2016-04-26T16:17:02.633" LastActivityDate="2016-04-26T16:17:02.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21855" PostTypeId="2" ParentId="21669" CreationDate="2016-04-26T03:05:07.380" Score="1" Body="&lt;p&gt;It seems to me that you could do all that with some elisp programming. It doesn't sound too hard to me (mostly some keys bound to defuns that will copy / open / insert / write-out the files that you are talking about. Maybe with a comint call to the operating system, if need be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here's my code that I use for fetching / inserting various code, checklist, or process templates in my own work. It might be a starting point for you. I bind the defun to a key, then it prompts me for a template type (c/l/p), then prompts for a file read using the appropriate directory for the type of template that I want to work with.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-snippet-at-point ()&#xA;  &quot;Prompt user for a snippet name, and insert it at the point.&quot;&#xA;  (interactive)&#xA;  (let ((prompt nil) (type nil) (dir nil))&#xA;    (setq prompt &quot;Type to insert (c=code, l=checklist, p=process): &quot;)&#xA;    (setq type (read-from-minibuffer prompt))&#xA;    (cond ((equal type &quot;c&quot;)                ;code&#xA;           (setq dir ctkb-v-code-dir))&#xA;          ((equal type &quot;k&quot;)&#xA;           (setq dir ctkb-v-checklist-dir))&#xA;          ((equal type &quot;p&quot;)                ;lisp process frags&#xA;           (setq dir ctkb-v-procs-dir))&#xA;          (t&#xA;           (setq dir ctkb-v-code-dir)))&#xA;    (setq fn (read-file-name &quot;Insert filename: &quot; dir))&#xA;    (insert-string (file-get-contents fn))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="2710" LastEditDate="2016-04-26T08:12:52.773" LastActivityDate="2016-04-26T08:12:52.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21856" PostTypeId="1" AcceptedAnswerId="21858" CreationDate="2016-04-26T03:23:03.900" Score="1" ViewCount="496" Body="&lt;p&gt;I have a problem that I suspect is a general Emacs problem. If I run a certain package, simple-rtm, and then try and use M-x to run any command, I get the error in the bottom line of the screen: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's chain of function indirections contains a &#xA;  loop: def-rtm-authenticated-scalar-method&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I understand at a superficial level what this means - simple-rtm calls rtm, and in rtm.el there is a function def-rtm-authenticated-scalar-method and it has an infinite loop. Given enough time I will learn enough Lisp to work out why and fix it. But that might take me a while. Meanwhile I would like to just continue using Emacs for other things, but I find the only way I can use M-x after running simple-rtm is to exit Emacs and run it again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question therefore is: is there a simple Emacs command I can use to break out of the function indirection loop so I can use M-x again?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version is 24.5.1 running on Windows 10.&lt;/p&gt;&#xA;" OwnerUserId="11853" LastEditorUserId="11853" LastEditDate="2016-04-26T06:09:32.787" LastActivityDate="2016-04-26T06:40:13.857" Title="How to break out of function indirection loop" Tags="|functions|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21857" PostTypeId="2" ParentId="21669" CreationDate="2016-04-26T03:28:28.870" Score="1" Body="&lt;p&gt;I don't know how much elisp you know, so I'll post this for whoever can use it. I have not tested this code, but here's another defun (modelled after the one above) that will copy N of your favorite templates into a new project directory, creating xxx_main.tex, xxx_coverpage.tex, etc.  There are more flexible and sophisticated ways of doing this, but I just made up this code to be simple, to get someone started.  Code for handling templates often reflects the conceptual models of template organization and use, and that varies from person to person.  I hope this code is useful enough to get someone started... :-)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-templates ()&#xA;  &quot;Copy a few templates into a new project directory.&quot;&#xA;  (interactive)&#xA;  (let (prompt template-dir destination-dir)&#xA;    (setq prompt &quot;Template directory to use: (c=code, l=checklist, p=process): &quot;)&#xA;    (setq template-dir (read-from-minibuffer prompt))&#xA;    (setq prompt &quot;Destination directory to use: &quot;)&#xA;    (setq destination-dir (read-from-minibuffer prompt))&#xA;    (setq prompt &quot;Base name of new project xxx: &quot;)&#xA;    (setq base (read-from-minibuffer prompt))&#xA;    ;; copy and rename the template files you want to use&#xA;    (copy-file (concat (file-name-directory template-dir) &quot;template1.tex&quot;)&#xA;               (concat (file-name-directory destination-dir)&#xA;                       (concat base &quot;_main.tex&quot;)))&#xA;    (copy-file (concat (file-name-directory template-dir) &quot;template2.tex&quot;)&#xA;               (concat (file-name-directory destination-dir)&#xA;                       (concat base &quot;_whatever.tex&quot;)))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="2710" LastEditDate="2016-04-26T08:13:46.920" LastActivityDate="2016-04-26T08:13:46.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21858" PostTypeId="2" ParentId="21856" CreationDate="2016-04-26T04:10:42.050" Score="1" Body="&lt;p&gt;Function indirection refers to the ability for a symbol's function cell to contain another symbol as its value, rather than a function object. In that case, the function cell of the latter symbol is used (which might be yet another symbol, etc...) until a function object is found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus if symbol A points to symbol B in this way, and symbol B points back to symbol A, there is a function indirection loop, and any attempt to call either A or B as a function cannot succeed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's very difficult to suggest exactly what you should do without seeing the code in question. You could prevent the loop by explicitly redefining one of the functions involved (as an actual function), but I can't guess at the &lt;em&gt;correct&lt;/em&gt; solution without seeing the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;edit:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, I looked at the &lt;code&gt;rtm&lt;/code&gt; package via Melpa, and it contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'def-rtm-authenticated-scalar-method 'def-rtm-authenticated-scalar-method)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is setting a symbol's function cell to its &lt;em&gt;own&lt;/em&gt; symbol! I don't know what that was &lt;em&gt;intended&lt;/em&gt; to be, but that's the cause of the problem. Log a bug report with the author, if you're able.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try the following...&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Re-evaluate the initial definition (type &lt;code&gt;C-x C-e&lt;/code&gt; with point after the closing parenthesis)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(def-rtm-macro def-rtm-authenticated-scalar-method&#xA;               rtm-call-authenticated rtm-get-scalar-from-response)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Comment out the bad code from rtm.el and save the file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; (defalias 'def-rtm-authenticated-scalar-method 'def-rtm-authenticated-scalar-method)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; (put 'def-rtm-authenticated-scalar-method 'lisp-indent-function 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Byte-compile the file with &lt;code&gt;M-x byte-compile-file&lt;/code&gt; (assuming that's now working again since step 1), or use &lt;code&gt;B&lt;/code&gt; in dired.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;edit 2&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI if I manufacture the same basic error in Emacs 24.5, Emacs does not get stuck in an infinite loop. It detects the problem, reports it, and returns control to me. I certainly don't lose the ability to use &lt;code&gt;M-x&lt;/code&gt;. So there's likely some compounding factor at work here which is making a normally-recoverable error less so.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-04-26T06:40:13.857" LastActivityDate="2016-04-26T06:40:13.857" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21859" PostTypeId="1" CreationDate="2016-04-26T05:25:51.807" Score="1" ViewCount="3089" Body="&lt;p&gt;I'm having the following problem: In emacs the tool bar icons are invisible &lt;a href=&quot;https://i.stack.imgur.com/vZKRm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;as can be seen here&lt;/a&gt;. There should be icons like &lt;code&gt;visit new file&lt;/code&gt;, &lt;code&gt;save buffer&lt;/code&gt; etc below the menu at the top and above the buffer. By the way, they aren't missing, I can still click them. The icons are just blank. I can even hover over them or press them, it all works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea why this happened, nor do I know how to fix it. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="11309" LastEditorUserId="11309" LastEditDate="2016-04-26T07:10:55.203" LastActivityDate="2016-08-24T22:20:49.360" Title="Tool-bar icons are invisible" Tags="|tool-bar|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21860" PostTypeId="1" AcceptedAnswerId="21924" CreationDate="2016-04-26T07:07:56.523" Score="0" ViewCount="80" Body="&lt;p&gt;When I exit emacs while my music is playing using afplay -- music keeps playing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the right way of stopping/killing afplay process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I use exit hooks or is there emms built-in setting I can tinker?&lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-04-28T12:45:48.320" Title="Gracefully exiting emacs while afplay is running" Tags="|osx|emms|exit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21862" PostTypeId="1" CreationDate="2016-04-26T09:22:43.927" Score="1" ViewCount="1080" Body="&lt;p&gt;I use &lt;code&gt;helm&lt;/code&gt; to do the common stuff and I have my &quot;helm minibuffer&quot; on top of the helm buffers. Therefore I don't really need the regular minibuffer anymore, except when I have to pass arguments to commands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm looking for a way to dynamically display the minibuffer, when I'm using &lt;code&gt;M-x&lt;/code&gt;. In other words, I don't want the minibuffer to be displayed, except I am really using it.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="2710" LastEditDate="2016-04-27T15:27:58.153" LastActivityDate="2016-05-02T07:01:22.330" Title="How to display minibuffer only when using m-x?" Tags="|minibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21863" PostTypeId="1" CreationDate="2016-04-26T11:52:23.227" Score="9" ViewCount="6961" Body="&lt;p&gt;I've tried to configure whitespace-mode to do what I want but with no luck. I'm trying to achieve the following (see image).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hslEm.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hslEm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8586" LastActivityDate="2016-05-01T18:50:43.820" Title="How can I visualize trailing whitespace like this?" Tags="|whitespace|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21864" PostTypeId="1" AcceptedAnswerId="21880" CreationDate="2016-04-26T11:55:55.290" Score="1" ViewCount="703" Body="&lt;p&gt;When i use grep in eshell, like 'cat test.txt | grep test', grep opens it's own buffer with the result. Is it possible to capture the output of grep in the eshell buffer?&lt;/p&gt;&#xA;" OwnerUserId="11537" LastActivityDate="2016-04-26T19:32:55.900" Title="Possible to use grep in eshell without opening a *grep* buffer?" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21865" PostTypeId="2" ParentId="21863" CreationDate="2016-04-26T11:58:23.680" Score="12" Body="&lt;p&gt;Ignoring &lt;code&gt;whitespace-mode&lt;/code&gt;, there's always:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default show-trailing-whitespace t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-face&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;trailing-whitespace&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which might not give you that exact visualisation, but &lt;em&gt;will&lt;/em&gt; let you visualise trailing whitespace nevertheless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have a keybinding for this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-show-trailing-whitespace ()&#xA;  &quot;Toggle `show-trailing-whitespace'.&quot;&#xA;  (interactive)&#xA;  (setq show-trailing-whitespace (not show-trailing-whitespace)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For &lt;code&gt;whitespace-mode&lt;/code&gt; ensure you have &lt;code&gt;trailing&lt;/code&gt; included in &lt;code&gt;whitespace-style&lt;/code&gt;, and once again there's a specific face:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-face&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;whitespace-trailing&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either case, I don't know how you'll get spaces to appear as dots &lt;em&gt;for that face only&lt;/em&gt;, unless you can specify a font which has dots for spaces? Someone else might know otherwise.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-04-26T12:09:24.050" LastActivityDate="2016-04-26T12:09:24.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21867" PostTypeId="1" AcceptedAnswerId="30720" CreationDate="2016-04-26T12:16:45.730" Score="2" ViewCount="47" Body="&lt;p&gt;I use emacs 24.5.1 and i use this hotkeys for navigate in my buffers, but I need navigate only in *.py files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-;&quot;) 'next-buffer)&#xA;(global-set-key (kbd &quot;C-'&quot;) 'previous-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just started learning Lisp, I have no idea how I can do this. Thanks for any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPD:&#xA;I want same as &lt;em&gt;next-buffer&lt;/em&gt; but only in *.py files. For example, I have this buffers: &lt;em&gt;file.txt, file.el, file.py&lt;/em&gt; and &lt;em&gt;next-buffer&lt;/em&gt;, &lt;em&gt;previous-buffer&lt;/em&gt; leafing through them all, but I need only in .py files and ignore any other.&lt;/p&gt;&#xA;" OwnerUserId="11847" LastEditorUserId="11847" LastEditDate="2016-04-26T13:29:31.117" LastActivityDate="2017-02-14T23:02:42.273" Title="How i can navigate in buffers in specific .py files" Tags="|key-bindings|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21868" PostTypeId="1" AcceptedAnswerId="21913" CreationDate="2016-04-26T13:51:25.470" Score="4" ViewCount="1921" Body="&lt;p&gt;I'm using Emacs 25.1.50 (9.0) on OS X and am starting to get annoyed with the automatic removal of trailing whitespace. I have tried solutions from &lt;a href=&quot;https://stackoverflow.com/questions/14164292/my-emacs-deletes-trailing-white-space-how-can-i-disable-this-behaviour&quot;&gt;here&lt;/a&gt;, but to no avail as my &lt;code&gt;write-file-functions&lt;/code&gt; and &lt;code&gt;before-save-hook&lt;/code&gt; variables are &lt;code&gt;nil&lt;/code&gt; to begin with. I've also tried setting &lt;code&gt;delete-trailing-lines&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, but that still hasn't fixed my issue. I also found &lt;a href=&quot;https://superuser.com/questions/465504/disable-removal-of-whitespace-at-the-end-of-an-empty-line-in-sublime-text-2&quot;&gt;this exact issue that I'm having for Sublime Text&lt;/a&gt;, but also found a fix for it. I imagine that if the issue was able to be fixed so easily there, it should be simple to do in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per @Drew's request, I've decided to add some more info since I admittedly initially wrote this in a hurry. Upon starting Emacs 25 with the &lt;code&gt;-Q&lt;/code&gt; flag, I notice the same issue being demonstrated as in my usual, customized Emacs. &lt;a href=&quot;http://cl.ly/1R102M1M242J&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here is a demo of the issue in &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/a&gt; As you can see, in certain major modes that do auto-indentation, when I press &lt;code&gt;RET&lt;/code&gt; on a line that I haven't written anything on, the line loses its whitespace formatting as my point goes on to the next line. This is irritating when I want to leave that whitespace formatting in between lines.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2021-01-14T16:26:40.877" Title="Disable removal of trailing whitespace in Emacs" Tags="|whitespace|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21869" PostTypeId="1" AcceptedAnswerId="21870" CreationDate="2016-04-26T14:11:54.850" Score="14" ViewCount="1346" Body="&lt;p&gt;Both &lt;code&gt;=foo=&lt;/code&gt; and &lt;code&gt;~foo~&lt;/code&gt; seem to be used in org for inline bits of code. How do they differ? Which should I use, and when?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, from the &lt;code&gt;ORG-NEWS&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If you want to exclude a headline from export while using its contents&#xA;for setting options, use =:noexport:= (see =org-export-exclude-tags=.)&#xA;&#xA;...&#xA;&#xA;The key sequences =C-c C-n= and =C-c C-p= are now bound to&#xA;~org-next-visible-heading~ and ~org-previous-visible-heading~ respectively,&#xA;rather than the =outline-mode= versions of these functions.  The Org&#xA;version of these functions skips over inline tasks (and even-level&#xA;headlines when ~org-odd-levels-only~ is set).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There isn't an obvious pattern here: &lt;code&gt;org-export-exclude-tags&lt;/code&gt; and &lt;code&gt;org-odd-levels-only&lt;/code&gt; are both variables, and &lt;code&gt;org-next-visible-heading&lt;/code&gt; and &lt;code&gt;outline-mode&lt;/code&gt; are both functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do either of these syntaxes support jumping to &lt;code&gt;*Help*&lt;/code&gt; buffers the way &lt;code&gt;`foo'&lt;/code&gt; does in docstrings?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-04-27T15:28:59.003" Title="What's the relationship between ~foo~ and =foo= in org-mode?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21870" PostTypeId="2" ParentId="21869" CreationDate="2016-04-26T14:29:48.477" Score="8" Body="&lt;p&gt;From the Org info page on &quot;Emphasis and monospace&quot; we have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`=verbatim=' and `~code~'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your examples the functions and variables are pieces of elisp code, so &lt;code&gt;~...~&lt;/code&gt; is appropriate.  The uses of &lt;code&gt;=...=&lt;/code&gt; you cite are for key sequences and text for the user to place in the &lt;code&gt;org&lt;/code&gt; buffer, i.e. markup rather than code.  However, the markup of &lt;code&gt;=outline-mode=&lt;/code&gt; is borderline between the two categories.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2016-04-27T15:28:59.003" LastActivityDate="2016-04-27T15:28:59.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21871" PostTypeId="2" ParentId="21867" CreationDate="2016-04-26T14:36:59.053" Score="2" Body="&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then &lt;code&gt;C-x b&lt;/code&gt; with plain &lt;code&gt;C-u&lt;/code&gt; or with a zero prefix arg provides as candidates only buffers whose mode is derived from (&lt;code&gt;C-u&lt;/code&gt;) or is the same as (&lt;code&gt;C-0&lt;/code&gt;) the mode of the current buffer. Whether or not you bother to display the buffer names in &lt;code&gt;*Completions*&lt;/code&gt;, you can cycle among them using &lt;code&gt;C-down&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Buffer-Name_Input&quot; rel=&quot;nofollow&quot;&gt;Icicles - Buffer-Name Input&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-26T14:36:59.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21872" PostTypeId="2" ParentId="12369" CreationDate="2016-04-26T15:24:55.717" Score="3" Body="&lt;p&gt;This seems pretty close. I set this up to work on sections with an AUTOCLOCK property. I don't know a more elegant way to do it than the post-command-hook.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(defun action-1 ()&#xA;  &amp;quot;hook function to run in headings with a clock&amp;quot;&#xA;  (and (eq major-mode 'org-mode)&#xA;       (not (org-before-first-heading-p)))&#xA;  (if (org-entry-get (point) &amp;quot;AUTOCLOCK&amp;quot;)&#xA;      (org-clock-in)&#xA;    (when (marker-buffer org-clock-marker) (org-clock-out))))&#xA;&#xA;(add-hook 'post-command-hook 'action-1)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;EDIT 12-17-2020 The solution above seems to have quit working at some time. Here is a more sophisticated approach that seems to work today.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun in-same-heading-as-clock-p ()&#xA;  &amp;quot;Check if the cursor is in the same heading as the current clock.&#xA;That means:&#xA;1. There is a current clock&#xA;2. The cursor is in the same buffer as that clock.&#xA;3. The cursor is in the same heading as that clock.&amp;quot;&#xA;  (let ((cb (current-buffer))&#xA;    (clockb (marker-buffer org-clock-marker))&#xA;    clock-hb&#xA;    cursor-hb)&#xA;&#xA;    (when (and&#xA;       clockb             ; clock buffer&#xA;       ;; clock buffer is the same as this buffer&#xA;       (eq cb clockb))&#xA;      (setq clock-hb (save-excursion&#xA;               (goto-char (marker-position org-clock-marker))&#xA;               (org-back-to-heading t)&#xA;               (point))&#xA;        cursor-hb (save-excursion&#xA;            (org-back-to-heading t)&#xA;            (point)))&#xA;      (= cursor-hb clock-hb))))&#xA;&#xA;(defun action-1 ()&#xA;  (cond&#xA;   ;; clock is running in this heading, do nothing&#xA;   ((in-same-heading-as-clock-p)&#xA;    nil)&#xA;&#xA;   ;; clock is running in another heading. IF this heading has autoclock&#xA;   ((and (marker-buffer org-clock-marker)&#xA;     (not (in-same-heading-as-clock-p)))&#xA;    ;; first clock out&#xA;    (org-clock-out)&#xA;    (when (org-entry-get (point) &amp;quot;AUTOCLOCK&amp;quot;)&#xA;      (org-clock-in)))&#xA;   ;; no clock is running, and &#xA;   ((and (null (marker-buffer org-clock-marker))&#xA;     (org-entry-get (point) &amp;quot;AUTOCLOCK&amp;quot;))&#xA;    (org-clock-in))))&#xA;&#xA;&#xA;(add-hook 'post-command-hook 'action-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2020-12-17T14:05:20.723" LastActivityDate="2020-12-17T14:05:20.723" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="21873" PostTypeId="2" ParentId="21868" CreationDate="2016-04-26T16:13:24.377" Score="0" Body="&lt;p&gt;Here is how I turn on deletion of trailing whitespace on Mac OSX, so maybe you could reverse what I do to leave your whitespace on. Notice that I set the variable &amp;quot;delete-trailing-WHITESPACE&amp;quot; (not -trailing-lines).&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default show-trailing-whitespace t)&#xA;(add-hook 'before-save-hook 'delete-trailing-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11477" LastEditDate="2021-01-14T16:26:40.877" LastActivityDate="2021-01-14T16:26:40.877" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="21875" PostTypeId="2" ParentId="21770" CreationDate="2016-04-26T16:32:37.007" Score="2" Body="&lt;p&gt;Here is how to solve the problem. The problem you describe has two parts, really. One part is to change focus (like you describe), so the &quot;q&quot; is sent to the &lt;em&gt;Help&lt;/em&gt; window. The second part is to get back to your original window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I solved the issue by forcing the &lt;em&gt;Help&lt;/em&gt; window to pop up over top of my current window, so that I can just type &quot;q&quot; to dispatch the help window and return to my original buffer.  The method shown below can be extended to any of the usual &lt;em&gt;whatever&lt;/em&gt; Apropos, Help, etc windows.  Good luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(add-to-list 'display-buffer-alist&#xA;             '(&quot;*Apropos*&quot; display-buffer-same-window))&#xA;(add-to-list 'display-buffer-alist&#xA;             '(&quot;*Help*&quot; display-buffer-same-window))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-04-26T16:32:37.007" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21876" PostTypeId="1" CreationDate="2016-04-26T18:03:53.430" Score="1" ViewCount="588" Body="&lt;p&gt;I have just started using emacs, after coming from using Xcode.&#xA;I would like to get code completion for C++, however there are a whole bunch of things that don't really explain what they do (at least not to someone who is used to things just working)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at irony-mode and company but can't seem to get them to work, and the documentation seems to be awful for irony-mode, I'm not even sure what it does. Company-mode seems to be responsible for displaying the small popup rather than jarringly opening a new frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what backend I need for company, I'd have though clang would be enough, but while I'm not sure if I enabled that correctly, no matter what I did I couldn't get the completion popup to show.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found helm, and have no idea what that does differently to eithe rof the two above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simply guide, or just &lt;em&gt;any&lt;/em&gt; documentation for irony-mode that will help me. I really feel like I'm missing something obvious because it can't be this complicated to get code completion when every IDE has it out of the box.&lt;/p&gt;&#xA;" OwnerUserId="11855" LastActivityDate="2016-04-26T18:03:53.430" Title="Code completion for C++" Tags="|company-mode|c++|c|" AnswerCount="0" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="21878" PostTypeId="2" ParentId="21869" CreationDate="2016-04-26T18:59:35.743" Score="3" Body="&lt;p&gt;It's suitable to interpretation. I've been redefining e.g. &lt;code&gt;~C-f~&lt;/code&gt; to&#xA;export to &lt;code&gt;&amp;lt;kbd&amp;gt;C-f&amp;lt;/kbd&amp;gt;&lt;/code&gt; in HTML, and e.g. &lt;code&gt;=forward-char=&lt;/code&gt; to&#xA;&lt;code&gt;&amp;lt;code&amp;gt;forward-char&amp;lt;/code&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(setq org-html-text-markup-alist&#xA;      '((bold . &quot;&amp;lt;b&amp;gt;%s&amp;lt;/b&amp;gt;&quot;)&#xA;        (code . &quot;&amp;lt;kbd&amp;gt;%s&amp;lt;/kbd&amp;gt;&quot;)&#xA;        (italic . &quot;&amp;lt;i&amp;gt;%s&amp;lt;/i&amp;gt;&quot;)&#xA;        (strike-through . &quot;&amp;lt;del&amp;gt;%s&amp;lt;/del&amp;gt;&quot;)&#xA;        (underline . &quot;&amp;lt;span class=\&quot;underline\&quot;&amp;gt;%s&amp;lt;/span&amp;gt;&quot;)&#xA;        (verbatim . &quot;&amp;lt;code&amp;gt;%s&amp;lt;/code&amp;gt;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But their default names are indeed &lt;code&gt;code&lt;/code&gt; and &lt;code&gt;verbatim&lt;/code&gt;, just like the other answer says.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-04-26T18:59:35.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21880" PostTypeId="2" ParentId="21864" CreationDate="2016-04-26T19:32:55.900" Score="4" Body="&lt;p&gt;In Eshell, &lt;code&gt;grep&lt;/code&gt; is a built-in command, which is a lisp function and works like Emacs's &lt;code&gt;M-x grep&lt;/code&gt;. To use the external &lt;code&gt;grep&lt;/code&gt; command, you need to use &lt;code&gt;*grep&lt;/code&gt; instead. If you want to type just &lt;code&gt;grep&lt;/code&gt; , you can declare an alias, i.e.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ $ alias grep '*grep $*'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;alias&lt;/code&gt; here is a built-in command as well, unlike shell's, it creates a persistent alias. If you want to cancel this alias, you have to delete corresponding entry from your &lt;code&gt;eshell-aliases-file&lt;/code&gt; manually. Eshell doesn't provide a &lt;code&gt;unalias&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you consult the Eshell manual, especially &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/eshell/Built_002dins.html&quot; rel=&quot;nofollow&quot;&gt;(eshell) Built-ins&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-04-26T19:32:55.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21881" PostTypeId="1" CreationDate="2016-04-26T19:46:06.140" Score="3" ViewCount="63" Body="&lt;p&gt;I'm trying to find a way to implement ERT tests for performance of some elisp code. For that to work I need to have a stable performance metric.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a stable performance metric I could use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is okay if Emacs version is fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt is here: &lt;a href=&quot;https://github.com/haskell/haskell-mode/pull/1259/commits/581dc7b31931710da00c592f3ce049ef579de04b&quot; rel=&quot;nofollow&quot;&gt;https://github.com/haskell/haskell-mode/pull/1259/commits/581dc7b31931710da00c592f3ce049ef579de04b&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-04-27T00:37:00.220" LastActivityDate="2016-04-27T00:37:00.220" Title="Emacs Lisp performance regression testing" Tags="|testing|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21882" PostTypeId="1" CreationDate="2016-04-26T19:58:06.203" Score="0" ViewCount="65" Body="&lt;p&gt;What is the practice of mutation testing in Emacs Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source file in question is &lt;a href=&quot;https://github.com/haskell/haskell-mode/blob/master/haskell-indentation.el&quot; rel=&quot;nofollow&quot;&gt;haskell-indentation.el&lt;/a&gt;  with test suite in &lt;a href=&quot;https://github.com/haskell/haskell-mode/blob/master/tests/haskell-indentation-tests.el&quot; rel=&quot;nofollow&quot;&gt;haskell-indentation-tests.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are quite some strings in &lt;code&gt;haskell-indentation.el&lt;/code&gt; and I'd like to have an overview how many of those are actually tested properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that we have line coverage already in place in &lt;a href=&quot;https://coveralls.io/builds/5925167/source?filename=haskell-indentation.el&quot; rel=&quot;nofollow&quot;&gt;coveralls.io&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-04-27T00:37:21.143" LastActivityDate="2016-04-27T00:37:21.143" Title="Mutation testing for Emacs Lisp" Tags="|testing|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21883" PostTypeId="2" ParentId="14234" CreationDate="2016-04-26T20:05:22.277" Score="2" Body="&lt;p&gt;Here is a fairly long bit of code that uses invisibility to do what you want I think. There are two functions to hide non-verse and non-lilypad stuff, and two to show the non-verse/lilypad stuff. Basically it finds all those elements, and constructs invisible overlays and then removes them.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(require 'cl)&#xA;&#xA;; http://stackoverflow.com/questions/969067/name-of-this-function-in-built-in-emacs-lisp-library&#xA;(defun flatten (LIST)&#xA;  &quot;flattens LIST&quot;&#xA;  (cond&#xA;   ((atom LIST) (list LIST))&#xA;   ((null (cdr LIST)) (flatten (car LIST)))&#xA;   (t (append (flatten (car LIST)) (flatten (cdr LIST))))))&#xA;&#xA;(defvar non-verse-overlays '() &quot;overlays  to hide non-verse text&quot;)&#xA;(defvar non-lilypad-overlays '() &quot;overlays  to hide non-lilypad blocks&quot;)&#xA;&#xA;(defun hide-non-verse ()&#xA;  &quot;Hide everything but the verse blocks.&quot;&#xA;  (interactive)&#xA;  ;; make sure we are wide open.&#xA;  (org-cycle '(64))&#xA;  (add-to-invisibility-spec '(non-verse-block . t))&#xA;  (let ((p (append&#xA;        (list (point-min))&#xA;        (flatten (org-element-map (org-element-parse-buffer) 'verse-block&#xA;               (lambda (vb) (list (org-element-property :begin vb)&#xA;                      (org-element-property :end vb)))))&#xA;        (list (point-max)))))&#xA;&#xA;    (loop for start in p by 'cddr&#xA;      for end in (cdr p) by 'cddr&#xA;      do&#xA;      (let ((ov (make-overlay start end)))&#xA;        (add-to-list 'non-verse-overlays ov)&#xA;        (overlay-put ov 'invisible '(non-verse-block . t))))))&#xA;&#xA;(defun show-non-verse ()&#xA;  &quot;Show the non-verse&quot;&#xA;  (interactive)&#xA;  (mapc 'delete-overlay non-verse-overlays)&#xA;  (setq non-verse-overlays '()))&#xA;&#xA;(defun hide-non-lilypad ()&#xA;  &quot;Hide everything but the verse blocks.&quot;&#xA;  (interactive)&#xA;  ;; make sure we are wide open.&#xA;  (org-cycle '(64))&#xA;  (add-to-invisibility-spec 'non-lilypad-block)&#xA;  (let ((p (append&#xA;        (list (point-min))&#xA;        (flatten (org-element-map (org-element-parse-buffer) 'src-block&#xA;               (lambda (sb)&#xA;             (when (string= &quot;lilypond&quot; (org-element-property :language sb))&#xA;               (list (org-element-property :begin sb)&#xA;                 (org-element-property :end sb))))))&#xA;        (list (point-max)))))&#xA;&#xA;    (loop for start in p by 'cddr&#xA;      for end in (cdr p) by 'cddr&#xA;      do&#xA;      (let ((ov (make-overlay start end)))&#xA;        (add-to-list 'non-lilypad-overlays ov)&#xA;        (overlay-put ov 'invisible 'non-lilypad-block)))))&#xA;&#xA;(defun show-non-lilypad ()&#xA;  (interactive)&#xA;  (mapc 'delete-overlay non-lilypad-overlays)&#xA;  (setq non-lilypad-overlays '()))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-04-26T20:05:22.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21884" PostTypeId="2" ParentId="21174" CreationDate="2016-04-26T20:11:37.360" Score="2" Body="&lt;p&gt;Here is one solution.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun date-hook-fn ()&#xA;  (goto-char (line-end-position))&#xA;  (insert (format-time-string &quot; :%m/%d/%Y&quot;)))&#xA;&#xA;(add-hook 'org-checkbox-statistics-hook 'date-hook-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="675" LastEditDate="2016-04-26T21:04:38.617" LastActivityDate="2016-04-26T21:04:38.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21885" PostTypeId="2" ParentId="21859" CreationDate="2016-04-26T20:16:47.840" Score="1" Body="&lt;p&gt;You are probably using an outdated gtk3 theme, try the default adwaita. The latest gtk update was breaking for many existing themes, see for example &lt;a href=&quot;https://bugs.kde.org/show_bug.cgi?id=361066&quot; rel=&quot;nofollow&quot;&gt;https://bugs.kde.org/show_bug.cgi?id=361066&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2245" LastActivityDate="2016-04-26T20:16:47.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21887" PostTypeId="2" ParentId="21868" CreationDate="2016-04-26T21:25:18.683" Score="7" Body="&lt;p&gt;This is a feature of &lt;code&gt;electric-indent-mode&lt;/code&gt; (which is on by default in recent versions of Emacs). The behaviour is hard-coded in &lt;code&gt;electric-indent-post-self-insert-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that very few people would actually want what you're asking for (i.e. that trailing whitespace is introduced automatically, and then left there). It's rather more common for people to want to get rid of trailing whitespace, not to find new ways to create it!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So disable &lt;code&gt;electric-indent-mode&lt;/code&gt;. You'll need to indent manually, or find some alternative approach to automated indentation which leaves whitespace-only lines alone.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-04-27T03:10:18.980" LastActivityDate="2016-04-27T03:10:18.980" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21889" PostTypeId="2" ParentId="16935" CreationDate="2016-04-27T07:21:38.503" Score="3" Body="&lt;p&gt;From &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/1603#issuecomment-213553034&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/issues/1603#issuecomment-213553034&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;smartparens-global-mode is a global mode. If it is enabled you get smartparens-mode in every buffer. Turning it off does not prevent you from turning on smartparens-mode anywhere. (That would be silly, because if that were true there would be no way to selectively enable smartparens. It would be either everywhere or nowhere, depending on that mode.) In fact smartparens-global-mode is off by default already.&lt;/p&gt;&#xA;&lt;p&gt;Spacemacs enables smartparens-mode in all programming buffers by switching it on in the hook. Therefore you have to remove the function from prog-mode-hook.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;To remove the function from the &lt;code&gt;prog-mode-hook&lt;/code&gt;, add the following line to &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; in &lt;code&gt;.spacemacs&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(remove-hook 'prog-mode-hook #'smartparens-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you don't have smartparens-mode disabled by default, you can also add the following line:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(spacemacs/toggle-smartparens-globally-off)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that if you exclude the &lt;code&gt;smartparens&lt;/code&gt; package as suggested in another answer, you'll lose some other features such as &lt;code&gt;SPC j n&lt;/code&gt; (&lt;code&gt;sp-newline&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="11815" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-04-27T07:21:38.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21890" PostTypeId="1" CreationDate="2016-04-27T08:03:43.457" Score="1" ViewCount="4063" Body="&lt;p&gt;I have 2 operating systems: Windows XP and Linux Slackware.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both operating systems I have the following text in &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host beta&#xA;HostName &amp;lt;server IP&amp;gt;&#xA;User beta&#xA;Port 22&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can connect to ssh directly from shells, using the command: &lt;code&gt;ssh beta&lt;/code&gt;. When I run &lt;code&gt;C-x C-f&lt;/code&gt; and then &lt;code&gt;/ssh:beta:/home/beta&lt;/code&gt; in Linux it works, the directory is opened in dired. On Windows it hangs. In &lt;code&gt;*Messages*&lt;/code&gt; buffer I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for beta using ssh...&#xA;Tramp: Sending command `ssh   -o ControlMaster=auto -o ControlPath='tramp.%r@%h:%p' -o ControlPersist=no -e none beta &amp;amp;&amp;amp; exit || exit'&#xA;Tramp: Waiting for prompts from remote shell...failed&#xA;Tramp: Opening connection for beta using ssh...failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to fix?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2019-08-27T05:46:31.653" Title="Can't connect to remote ssh host using tramp on Windows" Tags="|tramp|ssh|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21892" PostTypeId="1" AcceptedAnswerId="21894" CreationDate="2016-04-27T13:07:53.143" Score="6" ViewCount="2375" Body="&lt;p&gt;I often use the &lt;code&gt;M-x&lt;/code&gt; command. Is it possible to bind it to my right shift (just the right shift, because I like my left shift the way it is)?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alright, big thanks to the chosen answer. I solved the problem this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Issued whenever the keyboard layout is changed.&#xA;xmodmap -e &quot;keycode 62 = F13&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, in my Emacs config, I bind &lt;code&gt;#'smex&lt;/code&gt; to &lt;code&gt;&amp;lt;f13&amp;gt;&lt;/code&gt;.  If you use the standard &lt;code&gt;#'execute-extended-command&lt;/code&gt;, use the first (commented) line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; (global-set-key (kbd &quot;&amp;lt;f13&amp;gt;&quot;) (function execute-extended-command))&#xA;(global-set-key (kbd &quot;&amp;lt;f13&amp;gt;&quot;) (function smex))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9473" LastEditorUserId="9473" LastEditDate="2016-05-03T08:21:33.847" LastActivityDate="2016-05-03T08:21:33.847" Title="Bind a modifier key (like right shift) to a command?" Tags="|key-bindings|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21894" PostTypeId="2" ParentId="21892" CreationDate="2016-04-27T14:23:42.397" Score="8" Body="&lt;p&gt;No, it is not possible, at least purely within Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.emacswiki.org/emacs/ModifierKeys&quot;&gt;modifier keys&lt;/a&gt; (like &lt;kbd&gt;shift&lt;/kbd&gt;) have to modify something before Emacs actually sees the keys. As an alternative, you can change the shift key to something else at the OS level (&lt;a href=&quot;https://wiki.archlinux.org/index.php/xmodmap&quot;&gt;&lt;code&gt;xmodmap&lt;/code&gt;&lt;/a&gt; for Linux, &lt;a href=&quot;https://pqrs.org/osx/karabiner/&quot;&gt;&lt;code&gt;karabiner&lt;/code&gt;&lt;/a&gt; for OSX, etc.) and then map &lt;em&gt;that&lt;/em&gt; key to the desired command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: at the OS level, you could map your key to something that Emacs knows about but does not actually exist on your keyboard (say, &lt;kbd&gt;f20&lt;/kbd&gt;), and then bind &lt;kbd&gt;f20&lt;/kbd&gt; to your command within Emacs.  The downside, of course, is that &lt;em&gt;every&lt;/em&gt; program you use, not just Emacs, sees your key as &lt;kbd&gt;f20&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-04-27T14:23:42.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21895" PostTypeId="2" ParentId="8205" CreationDate="2016-04-27T14:36:56.323" Score="0" Body="&lt;p&gt;When your helm prompt reads &quot;Find Files or URL:&quot; and you want the other helm way of finding/filtering you can hit C-c / and you should get the prompt &quot;pattern:&quot; with the more normal helm find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also use this in when C-x C-f in dired goes to a funny helm prompt.&lt;/p&gt;&#xA;" OwnerUserId="9974" LastEditorUserId="9974" LastEditDate="2016-04-27T14:47:22.967" LastActivityDate="2016-04-27T14:47:22.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21896" PostTypeId="1" AcceptedAnswerId="21974" CreationDate="2016-04-27T14:52:44.000" Score="4" ViewCount="937" Body="&lt;p&gt;I have a TAGS file, generated by Projectile, its size ~1Gb and when i accidentally switch current buffer to TAGS, Emacs freeze for long. Is there way to prevent TAGS buffer from opening?&lt;/p&gt;&#xA;" OwnerUserId="11619" LastActivityDate="2016-05-01T23:14:31.430" Title="Prevent TAGS file from opening in buffer" Tags="|buffers|window|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21897" PostTypeId="1" AcceptedAnswerId="21914" CreationDate="2016-04-27T14:59:18.433" Score="5" ViewCount="1518" Body="&lt;p&gt;I'm trying to write a custom block agenda that simply lists all items with priority B:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;b&quot; &quot;Priority=B&quot;&#xA;  ((tags-todo &quot;+PRIORITY=B&quot;&#xA;   ((org-agenda-overriding-header &quot;Priority B&quot;)&#xA;    (org-tags-match-list-sublevels nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason, this returns an agenda with all of my TODOs. I actually currently don't have anything marked priority B. A custom agenda looking for PRIORITY=A or PRIORITY=C works just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the same problem if I just do a standard agenda filter (C-c a m PRIORITY=B). Again, priority A and C work just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know why this is happening? Sorry, it's hard to make a minimal working example, since that requires an org file.&lt;/p&gt;&#xA;" OwnerUserId="8654" LastEditorUserId="1985" LastEditDate="2016-04-29T21:11:57.030" LastActivityDate="2016-04-29T21:11:57.030" Title="Org-mode filtering PRIORITY=B retrieves all items" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21900" PostTypeId="2" ParentId="21834" CreationDate="2016-04-27T17:36:25.603" Score="3" Body="&lt;p&gt;Set the group parameter &lt;code&gt;large-newsgroup-initial&lt;/code&gt; to 500 for &quot;All&quot; (default is nil), and you should get what you want - a prompt if there are more than &lt;code&gt;gnus-large-newsgroup&lt;/code&gt; unread articles, where the prompt defaults to 500 (instead of the number of unread articles).&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-04-27T17:36:25.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21901" PostTypeId="1" AcceptedAnswerId="21906" CreationDate="2016-04-27T19:43:48.000" Score="5" ViewCount="2511" Body="&lt;p&gt;It seems that emacs appends a newline to the return value for &lt;code&gt;shell-command-to-string&lt;/code&gt;. For example, the return value for &lt;code&gt;(shell-command-to-string &quot;pwd&quot;)&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;/path/to/directory&#xA;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While the return value for &lt;code&gt;(pwd)&lt;/code&gt; is &lt;code&gt;&quot;/path/to/directory&quot;&lt;/code&gt;. In other words:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string= (shell-command-to-string &quot;pwd&quot;) (pwd))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will return &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is the reason for this?&lt;/li&gt;&#xA;&lt;li&gt;What would be an idiomatic way to remove the newline from the output so that &lt;code&gt;(string= (shell-command-to-string &quot;pwd&quot;) (pwd))&lt;/code&gt; would return &lt;code&gt;t&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="1982" LastEditDate="2016-04-28T11:08:44.110" LastActivityDate="2023-03-21T00:34:09.490" Title="Why is there a newline in the result of `shell-command-to-string`?" Tags="|shell-command|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21902" PostTypeId="2" ParentId="21380" CreationDate="2016-04-27T20:00:28.560" Score="4" Body="&lt;p&gt;So far as I know, this is not possible. You can get an effort sum using column view, though only for one day at a time. Set column format as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-columns-default-format &quot;%60ITEM(Task) %6Effort(Estim){:}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, when in agenda view, restrict your view to a single day using 'd' and then turn on column view (C-c C-x C-c).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will get you what you want. Though there seems to be a bug such that this will not work properly if you use more than one agenda file.&lt;/p&gt;&#xA;" OwnerUserId="8654" LastActivityDate="2016-04-27T20:00:28.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21903" PostTypeId="1" AcceptedAnswerId="21911" CreationDate="2016-04-27T20:42:18.167" Score="13" ViewCount="913" Body="&lt;p&gt;I love the ability to select word/symbol at point which I currently do with double mouse click.  I would like to be able to do it from the keyboard, and so I'd like to bind it to a keystroke (or maybe it already is?), so I need the name of the function.  I assume the function must already exist, but I cannot figure out what it's name is.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;C-h k&lt;/code&gt; but then when I double click the mouse the help for &lt;code&gt;&amp;lt;down-mouse-1&amp;gt;&lt;/code&gt; shows up (I assume the help system doesn't wait for the second click or something).  I also searched the documentation where this functionality is defined in section 21.2, but it does not say the name of the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: For typical keybinding I suppose it is the equivalent to &lt;code&gt;&amp;lt;C-left&amp;gt;&lt;/code&gt; followed by &lt;code&gt;&amp;lt;C-S-right&amp;gt;&lt;/code&gt; which are &lt;code&gt;left-word&lt;/code&gt; and &lt;code&gt;right-word&lt;/code&gt; respectively, although the shift key is held for the latter.  (I do not fully understand the relationship between keyboard designations with the shift key and their mapping to functions, the help for &lt;code&gt;&amp;lt;C-S-right&amp;gt;&lt;/code&gt; translates it to &lt;code&gt;&amp;lt;C-right&amp;gt;&lt;/code&gt; before it identifies it as &lt;code&gt;right-word&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="11865" LastEditorUserId="2710" LastEditDate="2016-04-28T09:59:58.107" LastActivityDate="2016-04-28T16:55:46.713" Title="What is the select word/symbol function bound to &lt;double-mouse-1&gt;" Tags="|key-bindings|mouse|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21904" PostTypeId="1" CreationDate="2016-04-27T21:57:42.310" Score="1" ViewCount="138" Body="&lt;p&gt;When I read a file into R, and the file contain characters like  &quot;ç&quot; or &quot;é&quot; (latin characters) in a string, the ess-buffer shows meaninless (to me) numbers. For example, the string &quot;ações&quot; is displayed &quot;a\307\325es&quot;. Do you know how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="4052" LastEditorUserId="105" LastEditDate="2016-04-29T13:14:37.787" LastActivityDate="2016-07-28T15:56:58.570" Title="How to fix latin character (e.g. ç, é) incorrectly displayed in emacs ess-buffer?" Tags="|character-encoding|ess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21905" PostTypeId="1" CreationDate="2016-04-27T22:04:31.540" Score="1" ViewCount="414" Body="&lt;p&gt;Recently on startup I started getting an OpenSSH dialog warning me of an unknown host key.  I then allowed it to store the key, and now I get a a password window at startup.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So then I went and cleared every known cache I could find, including recentf, .ido.last, and everything in my .emacs.d/savefile directory and it keeps bringing up of that OpenSSH password pop-up.  What's even weirder is that the host it originally complained about not knowing the key for doesn't exist in my .ssh/known_hosts file, nor is there a system wide /etc/ssh/known_hosts file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can solve the problem of the pop-up from coming up every time by following the &lt;a href=&quot;http:///questions/18438/emacs-suspend-at-startup-ssh-connection-issue&quot; rel=&quot;nofollow&quot;&gt;instructions here&lt;/a&gt; but I'm still quite miffed that I can't find the source of what file tramp is trying stat.  It seems as if there is some other file I don't know about that's 1) caching some file on that host, and 2) some other unusual place that's caching the host's key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other details: I'm running a &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow&quot;&gt;prelude&lt;/a&gt; based emacs installation.  Recently updated from Ubuntu 15.10 to 16.04 and wondering if that has anything to do with it.&lt;/p&gt;&#xA;" OwnerUserId="11864" LastEditorUserId="5213" LastEditDate="2016-04-28T10:00:14.450" LastActivityDate="2016-04-28T10:00:14.450" Title="Where does tramp store ssh hosts?" Tags="|tramp|ssh|prelude|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21906" PostTypeId="2" ParentId="21901" CreationDate="2016-04-28T00:11:52.417" Score="8" Body="&lt;p&gt;Shell commands usually terminate their output with a newline.  &lt;code&gt;shell-command-to-string&lt;/code&gt; doesn't add a newline, it merely stores the contents of the output of the shell command — including the final newline, if any — in a string.  Compare&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string &quot;echo hello&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which contains the final newline generated by &lt;code&gt;echo&lt;/code&gt;, and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string &quot;echo -n hello&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which doesn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can postprocess the returned string to get rid of the newline, for example with the following function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun string-trim-final-newline (string)&#xA;  (let ((len (length string)))&#xA;    (cond&#xA;      ((and (&amp;gt; len 0) (eql (aref string (- len 1)) ?\n))&#xA;       (substring string 0 (- len 1)))&#xA;      (t string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-04-28T00:11:52.417" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21907" PostTypeId="5" CreationDate="2016-04-28T00:26:41.753" Score="0" Body="&lt;p&gt;Wanderlust is a fast and powerful mail reader for Emacs that can store its mail on an IMAP server or locally (in MH or Maildir format).  It has good support for multiple accounts, for internationalisation, and for composing and reading MIME-formatted e-mail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wanderlust is best installed from MELPA.  It is maintained at &lt;a href=&quot;http://github.com/wanderlust/wanderlust&quot; rel=&quot;nofollow&quot;&gt;http://github.com/wanderlust/wanderlust&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2016-04-28T01:50:50.860" LastActivityDate="2016-04-28T01:50:50.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21908" PostTypeId="4" CreationDate="2016-04-28T00:26:41.753" Score="0" Body="Wanderlust is a mail reader for Emacs." OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2016-04-28T01:51:23.063" LastActivityDate="2016-04-28T01:51:23.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21909" PostTypeId="5" CreationDate="2016-04-28T00:30:59.660" Score="0" Body="&lt;p&gt;IMAP, the Internet Message Access Protocol, is used by mailers such as Gnus and Wanderlust to access mail stored on a remote server.  Most mail providers provide IMAP access.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2016-04-28T01:51:07.893" LastActivityDate="2016-04-28T01:51:07.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21910" PostTypeId="4" CreationDate="2016-04-28T00:30:59.660" Score="0" Body="IMAP is a protocol used for accessing mail stored on a remote server.  " OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2016-04-28T01:51:12.267" LastActivityDate="2016-04-28T01:51:12.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21911" PostTypeId="2" ParentId="21903" CreationDate="2016-04-28T02:06:57.540" Score="9" Body="&lt;p&gt;It's actually a bit complicated. When you double-click &lt;code&gt;mouse-1&lt;/code&gt; there are multiple actions. &lt;code&gt;&amp;lt;down-mouse-1&amp;gt;&lt;/code&gt; occurs first, when you press the button. Then &lt;code&gt;mouse-1&lt;/code&gt; occurs, when you release the button.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;down-mouse-1&amp;gt;&lt;/code&gt; is bound to command &lt;code&gt;mouse-drag-region&lt;/code&gt;, and that command calls &lt;code&gt;mouse-drag-track&lt;/code&gt;.  That function counts the mouse-button clicks and keeps track of any mouse movement (if you double-click that means that you did not move the mouse). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mouse-drag-track&lt;/code&gt; calls function &lt;code&gt;mouse-start-end&lt;/code&gt;  to determine the range of text to select.  It passes to &lt;code&gt;mouse-start-end&lt;/code&gt; the position where you clicked for, the first two args, and the click count, as the third arg.  This is &lt;code&gt;mouse-start-end&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mouse-start-end is a compiled Lisp function in `mouse.el'.&#xA;&#xA;(mouse-start-end START END MODE)&#xA;&#xA;Return a list of region bounds based on START and END according to MODE.&#xA;If MODE is 0 then set point to (min START END), mark to (max START END).&#xA;If MODE is 1 then set point to start of word at (min START END),&#xA;mark to end of word at (max START END).&#xA;If MODE is 2 then do the same for lines.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The click-count passed as the third arg (&lt;code&gt;MODE&lt;/code&gt;) is 1 for a double-click.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You won't be able to just call some of this code from a keyboard key sequence, but examining the code might help you write a keyboard key-bindable command to do what you want.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-04-28T02:06:57.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21912" PostTypeId="2" ParentId="21901" CreationDate="2016-04-28T02:16:24.530" Score="5" Body="&lt;p&gt;As already explained, the newline is coming from the shell command output.&lt;/p&gt;&#xA;&lt;p&gt;You can eliminate that by making the shell command format its output with &lt;code&gt;printf&lt;/code&gt; (which is portable and reliable when it comes to displaying newlines, unlike &lt;code&gt;echo&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string &amp;quot;printf %s \&amp;quot;$(pwd)\&amp;quot;&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Alternatively...&lt;/p&gt;&#xA;&lt;p&gt;If you don't actually &lt;em&gt;need&lt;/em&gt; to run the program via your shell, than another convenient option (suggested in the comments by another user, but never converted to an answer) is to use &lt;code&gt;process-lines&lt;/code&gt;, which starts the specific program directly via &lt;code&gt;call-process&lt;/code&gt; and (quoting the manual) &amp;quot;waits for it to finish, and returns its output as a list of strings.  Each string in the list holds a single line of text output by the program; the end-of-line characters are stripped from each line.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;So using that, you can simply take the first list item:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(car (process-lines &amp;quot;pwd&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;No shell is involved here but, as newlines are stripped, this approach can also resolve scenarios where you are obtaining unwanted trailing newlines from the program itself.&lt;/p&gt;&#xA;&lt;p&gt;Note that using &lt;code&gt;process-lines&lt;/code&gt; to take a single line from a &lt;em&gt;large&lt;/em&gt; amount of output would be inadvisable, as the entire output will be converted to a list regardless of how much of it you use, which could be very inefficient.  If you can't tell the program to limit its output then it may be preferable to use the shell approach, as you can then pipe the program's output through &lt;code&gt;head&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2023-03-21T00:34:09.490" LastActivityDate="2023-03-21T00:34:09.490" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21913" PostTypeId="2" ParentId="21868" CreationDate="2016-04-28T02:57:27.860" Score="6" Body="&lt;p&gt;After a good bit of digging and learning some features of Emacs Lisp, I managed to make a hack which produces the effect that I desire. I imagine that I'm not the only one who wants to leave trailing whitespace (at least in some scenarios), so here it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Hack to leave trailing whitespace&#xA;(eval-after-load 'electric '(fset 'electric-indent-post-self-insert-function (lambda ()&#xA;  &quot;Function that `electric-indent-mode' adds to `post-self-insert-hook'.&#xA;This indents if the hook `electric-indent-functions' returns non-nil,&#xA;or if a member of `electric-indent-chars' was typed; but not in a string&#xA;or comment.&quot;&#xA;  ;; FIXME: This reindents the current line, but what we really want instead is&#xA;  ;; to reindent the whole affected text.  That's the current line for simple&#xA;  ;; cases, but not all cases.  We do take care of the newline case in an&#xA;  ;; ad-hoc fashion, but there are still missing cases such as the case of&#xA;  ;; electric-pair-mode wrapping a region with a pair of parens.&#xA;  ;; There might be a way to get it working by analyzing buffer-undo-list, but&#xA;  ;; it looks challenging.&#xA;  (let (pos)&#xA;    (when (and&#xA;           electric-indent-mode&#xA;           ;; Don't reindent while inserting spaces at beginning of line.&#xA;           (or (not (memq last-command-event '(?\s ?\t)))&#xA;               (save-excursion (skip-chars-backward &quot; \t&quot;) (not (bolp))))&#xA;           (setq pos (electric--after-char-pos))&#xA;           (save-excursion&#xA;             (goto-char pos)&#xA;             (let ((act (or (run-hook-with-args-until-success&#xA;                             'electric-indent-functions&#xA;                             last-command-event)&#xA;                            (memq last-command-event electric-indent-chars))))&#xA;               (not&#xA;                (or (memq act '(nil no-indent))&#xA;                    ;; In a string or comment.&#xA;                    (unless (eq act 'do-indent) (nth 8 (syntax-ppss))))))))&#xA;      ;; For newline, we want to reindent both lines and basically behave like&#xA;      ;; reindent-then-newline-and-indent (whose code we hence copied).&#xA;      (let ((at-newline (&amp;lt;= pos (line-beginning-position))))&#xA;        (when at-newline&#xA;          (let ((before (copy-marker (1- pos) t)))&#xA;            (save-excursion&#xA;              (unless (or (memq indent-line-function&#xA;                                electric-indent-functions-without-reindent)&#xA;                          electric-indent-inhibit)&#xA;                ;; Don't reindent the previous line if the indentation function&#xA;                ;; is not a real one.&#xA;                (goto-char before)&#xA;                (indent-according-to-mode))&#xA;              ;; We are at EOL before the call to indent-according-to-mode, and&#xA;              ;; after it we usually are as well, but not always.  We tried to&#xA;              ;; address it with `save-excursion' but that uses a normal marker&#xA;              ;; whereas we need `move after insertion', so we do the&#xA;              ;; save/restore by hand.&#xA;              (goto-char before))))&#xA;        (unless (and electric-indent-inhibit&#xA;                     (not at-newline))&#xA;          (indent-according-to-mode))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is just a slightly different version of the &lt;code&gt;electric-indent-post-self-insert-function&lt;/code&gt; which is defined in &lt;code&gt;electric.el&lt;/code&gt;. The only difference is that I removed the following code from the hacked version of the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;(when (eolp)&#xA;            ;; Remove the trailing whitespace after indentation because&#xA;            ;; indentation may (re)introduce the whitespace.&#xA;            (delete-horizontal-space t))...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cl.ly/2Z2i1N0L1g1g&quot; rel=&quot;nofollow&quot;&gt;Here is my hack in action&lt;/a&gt; (I'm not running it in &lt;code&gt;emacs -Q&lt;/code&gt;, since that seems to strip away my hack).&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2016-09-28T03:27:19.587" LastActivityDate="2016-09-28T03:27:19.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21914" PostTypeId="2" ParentId="21897" CreationDate="2016-04-28T03:38:10.483" Score="5" Body="&lt;p&gt;Even if you don't set the priority, every entry still has one: &lt;code&gt;org-default-priority&lt;/code&gt;.  Unless you change it, the default priority is &quot;B&quot;.  So if your agenda is returning everything &lt;em&gt;without&lt;/em&gt; an explicitly set priority, it is behaving correctly&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-04-28T03:38:10.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21916" PostTypeId="2" ParentId="21904" CreationDate="2016-04-28T05:11:54.827" Score="1" Body="&lt;p&gt;It seems file coding system was not detected properly. To open a file with a specific coding system in Emacs use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x RET c coding-system RET C-x C-f filename RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;coding-system&lt;/code&gt; should be the one used by R.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastActivityDate="2016-04-28T05:11:54.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21918" PostTypeId="2" ParentId="21905" CreationDate="2016-04-28T06:24:57.683" Score="2" Body="&lt;p&gt;Cached Tramp data will be removed by &lt;code&gt;M-x tramp-cleanup-all-connections&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-04-28T06:24:57.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21921" PostTypeId="1" CreationDate="2016-04-28T09:16:21.960" Score="6" ViewCount="792" Body="&lt;p&gt;In org mode &lt;code&gt;/word/&lt;/code&gt; will display the word in &lt;em&gt;italic&lt;/em&gt;. For me on Linux, that works for some fonts like Liberation or DejaVu but doesn't work for others, like Monaco, Noto, Inconsolata. I think fonts were installed correctly since I can use them in other applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use Monaco on an OS X in org-mode &lt;em&gt;italic&lt;/em&gt; works just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what might be wrong? Is the problem likely to do with the fonts or some org mode configuration?&lt;/p&gt;&#xA;" OwnerUserId="10595" LastActivityDate="2016-04-28T09:16:21.960" Title="Org mode italic does not work with some popular fonts in Linux" Tags="|org-mode|fonts|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21922" PostTypeId="2" ParentId="21903" CreationDate="2016-04-28T09:50:31.647" Score="2" Body="&lt;p&gt;Here's a function that I extracted from &lt;code&gt;mouse-set-region&lt;/code&gt; that does the marking when you double click:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun ora-mark-like-double-mouse-1 ()&#xA;  (interactive)&#xA;  (let ((bnd (mouse-start-end (point) (point) 1)))&#xA;    (goto-char (car bnd))&#xA;    (push-mark)&#xA;    (set-mark (point))&#xA;    (goto-char (cadr bnd))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-04-28T09:50:31.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21923" PostTypeId="1" AcceptedAnswerId="21925" CreationDate="2016-04-28T12:11:10.063" Score="1" ViewCount="152" Body="&lt;p&gt;I want to speedup compilation by instructing org-mode/latex/beamer to ignore everything coming after it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My document takes a bit of time to process code with pigment and the like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do so ?&lt;/p&gt;&#xA;" OwnerUserId="4043" LastActivityDate="2016-04-28T13:17:33.633" Title="Having org-mode beamer / latex to ignore below a certain tag" Tags="|org-mode|latex|beamer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21924" PostTypeId="2" ParentId="21860" CreationDate="2016-04-28T12:45:48.320" Score="1" Body="&lt;p&gt;I have come up with adding a kill emacs hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'kill-emacs-hook 'emms-stop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it solves the problem for me.&lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-04-28T12:45:48.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21925" PostTypeId="2" ParentId="21923" CreationDate="2016-04-28T13:17:33.633" Score="2" Body="&lt;p&gt;You can mark headings with tags, and set options for &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot; rel=&quot;nofollow&quot;&gt;including and excluding&lt;/a&gt; tags from export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+EXCLUDE_TAGS: slow&#xA;&#xA;* My work&#xA;** This section takes time   :slow:&#xA;** This other section is OK&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-04-28T13:17:33.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21926" PostTypeId="2" ParentId="18547" CreationDate="2016-04-28T13:23:00.580" Score="0" Body="&lt;p&gt;You said&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(Like in the Org Manual)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Just so you do not go down that route, wasting your time: &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/doc/org.texi&quot; rel=&quot;nofollow&quot;&gt;The Org manual (source link)&lt;/a&gt; seems to &lt;strong&gt;not&lt;/strong&gt; be &lt;strong&gt;written in org-mode&lt;/strong&gt;, but in &lt;a href=&quot;https://de.wikipedia.org/wiki/Texinfo&quot; rel=&quot;nofollow&quot;&gt;Texinfo&lt;/a&gt; instead. While it might be possible to do what you want, the manual source does not show a way to do this. For example, &lt;a href=&quot;http://orgmode.org/org.html#Activation&quot; rel=&quot;nofollow&quot;&gt;the section&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There are compatibility issues between Org mode and some other Elisp packages, please take the time to check the list (see &lt;a href=&quot;http://orgmode.org/org.html#Conflicts&quot; rel=&quot;nofollow&quot;&gt;Conflicts&lt;/a&gt;). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/doc/org.texi#n956&quot; rel=&quot;nofollow&quot;&gt;generated by&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;There are compatibility issues between Org mode and some other Elisp&#xA;packages, please take the time to check the list (@pxref{Conflicts}).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8431" LastActivityDate="2016-04-28T13:23:00.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21927" PostTypeId="2" ParentId="16587" CreationDate="2016-04-28T13:53:12.983" Score="1" Body="&lt;p&gt;In an &lt;code&gt;org&lt;/code&gt; file I have several named code blocks, some of them generate (&lt;code&gt;#+RESULTS&lt;/code&gt;) named tables.  Whenever I want to regenerate the tables in the file, I run &lt;code&gt;org-babel-execute-buffer&lt;/code&gt;, and then I end up in a situation pretty much similar to yours, that is with unaligned tabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, I should say I &quot;would&quot; end up in such situation, but in fact the latest code block in the file does the alignment for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results output silent&#xA;  (org-table-map-tables 'org-table-align)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This block applies in fact what is used in the selected answer.  By including this block at the end, after generating all the tables they are automatically re-aligned.&lt;/p&gt;&#xA;" OwnerUserId="11089" LastActivityDate="2016-04-28T13:53:12.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21928" PostTypeId="1" CreationDate="2016-04-28T15:26:18.747" Score="3" ViewCount="261" Body="&lt;p&gt;I've been building and running Emacs 25 prereleases on a recent Fedora system that I usually access via ssh. I usually run this emacs in a terminal, and I'm fond of using ansi-term inside it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've noticed something frustrating when using ansi-term sessions inside this emacs 25-in-a-terminal-ansi-term: newlines generated by the shell in ansi-term often get eaten, particularly when I use readline interaction in the sub-terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q -nw # either over ssh or in a virtual terminal in an X environment&#xA;M-x ansi-term &amp;lt;enter&amp;gt; &amp;lt;enter&amp;gt; # runs /bin/bash for me&#xA;&amp;lt;ansi-term prompt&amp;gt; $ ls # works fine&#xA;# normal ls output, newlines intact&#xA;&amp;lt;ansi-term prompt&amp;gt; $ &amp;lt;ctrl-r&amp;gt; l s &amp;lt;enter&amp;gt; # r-search, causes problem&#xA;# output rendered on same line, followed by prompt overwriting the output&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I diagnose the problem as emacs rendering all of the newlines from the shell as \r. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ctrl-l inside the terminal seems to fix this, and I don't believe I've seen it happen unless I use the readline commands in bash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't notice this in Emacs 24.5, which is what I used prior to this. I'm currently on emacs-25.0.93 and have been following development some to see if this is fixed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not able to reproduce it without -nw (i.e. in an X frame of emacs); things work as expected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a fiddly, specific case, but it's something that I affects me and I don't know enough about comint and emacs internals to diagnose myself. Any thoughts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: solved! I built a newer version and it works. Didn't bisect for the changeset. Thanks, folks.&lt;/p&gt;&#xA;" OwnerUserId="2689" LastEditorUserId="2689" LastEditDate="2016-05-27T16:24:04.313" LastActivityDate="2016-05-27T16:24:04.313" Title="Emacs 25 + comint + -nw = eaten newlines" Tags="|terminal-emacs|ansi-term|comint|bash|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21929" PostTypeId="2" ParentId="21903" CreationDate="2016-04-28T16:55:46.713" Score="7" Body="&lt;p&gt;@Drew has explained some of the complexity associated with events bound to mouse actions. As for your ultimate goal of marking the word at point using the keyboard, you might be interested in &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot;&gt;expand-region&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;expand-region&lt;/code&gt; allows you to manipulate the region by semantic units. For example, when no region is active, calling &lt;code&gt;er/expand-region&lt;/code&gt; (typically bound to &lt;code&gt;C-=&lt;/code&gt;) will mark the current word. Calling it again expands the region to the current sentence. And then the paragraph, section etc. The actual units will depend on the mode you're in, so in lisp modes they would be symbol, expression enclosing the symbol, expression enclosing that expression etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The linked page has further explanation and a video demonstrating this.  &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-28T16:55:46.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21930" PostTypeId="1" CreationDate="2016-04-28T18:02:02.400" Score="4" ViewCount="438" Body="&lt;p&gt;If I create a file with &lt;code&gt;{{{input-file}}}&lt;/code&gt; as contents and export to HTML, the default macro is correctly evaluated to the filename. However, if I write &lt;code&gt;[[file:{{{input-file}}}.alternative][Alternative version]]&lt;/code&gt; the macro is &lt;em&gt;not&lt;/em&gt; evaluated. However, if I place the macro on the other part of the link: &lt;code&gt;[[file:manual.html.alternative][{{{input-file}}}.alternative]]&lt;/code&gt; then it works!&#xA;If I use it in a &lt;code&gt;#+BEGIN_HTML #+END_HTML&lt;/code&gt; session instead of in a link the macro isn't evaluated either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="10713" LastEditorUserId="454" LastEditDate="2016-05-10T03:51:12.913" LastActivityDate="2022-04-14T04:06:55.590" Title="org-mode macro not evaluated inside link?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21932" PostTypeId="1" CreationDate="2016-04-28T19:56:14.253" Score="0" ViewCount="1320" Body="&lt;p&gt;I've never tried IPython Notebook so I thought I would try EIN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed &lt;code&gt;ipython&lt;/code&gt; via &lt;code&gt;dnf&lt;/code&gt; on &lt;code&gt;Fedora 23&lt;/code&gt; with all of the dependencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I installed &lt;code&gt;ein&lt;/code&gt; via &lt;code&gt;M-x list-packages&lt;/code&gt; through &lt;code&gt;elpa&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I added &lt;code&gt;(require 'ein)&lt;/code&gt; to my &lt;code&gt;init.el&lt;/code&gt; I am getting the following error running emacs with &lt;code&gt;--debug-init&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot $&#xA;  require(ein)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/myusername$&#xA;  load-with-code-conversion(&quot;/home/myusername/.ema$&#xA;  load(&quot;/home/myusername/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;^H\205\262^@     \306=\203^Q^@\307^H\310Q\2$&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what to look into to help me debug this. I saw a few compilation errors during installation of &lt;code&gt;ein&lt;/code&gt; with &lt;code&gt;elpa&lt;/code&gt; but when I relaunched and looked at &lt;code&gt;M-x list-packages&lt;/code&gt; then it says it is installed. Is that somtehing I should be worried about?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastEditorUserId="9540" LastEditDate="2016-04-28T20:46:06.953" LastActivityDate="2017-05-28T16:13:39.487" Title="Can't use Emacs IPython Notebook?" Tags="|ipython|ein|" AnswerCount="2" CommentCount="1" ClosedDate="2017-05-28T19:21:02.947" ContentLicense="CC BY-SA 3.0" />
  <row Id="21933" PostTypeId="2" ParentId="21932" CreationDate="2016-04-28T20:00:53.273" Score="2" Body="&lt;p&gt;I believe the line should be &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ein)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastActivityDate="2016-04-28T20:00:53.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21934" PostTypeId="1" CreationDate="2016-04-28T20:43:20.940" Score="0" ViewCount="587" Body="&lt;p&gt;I have made sure that &lt;code&gt;dvipng&lt;/code&gt; is installed on my system and have upgraded to the most recent version of &lt;code&gt;org-mode&lt;/code&gt; but I cannot preview &lt;code&gt;LaTeX&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x org-version&lt;/code&gt; shows &lt;code&gt;8.3.4&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried typing some Latex before running the command (executed via both &lt;code&gt;C-c C-x C-l&lt;/code&gt; and &lt;code&gt;M-x org-toggle-latex-fragment&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{equation} &#xA;x = \sqrt{b} &#xA;\end{equation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nothing renders, I just see the text still.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something I am doing wrong? Maybe I upgraded org-mode improperly? I just merged/overwrote over my &lt;code&gt;contrib&lt;/code&gt; and &lt;code&gt;lisp&lt;/code&gt; folders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;Fedora 23&lt;/code&gt;. I also tried the instructions &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-preview.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and the conversions work but I still cannot preview. I tried using &lt;code&gt;dvipng&lt;/code&gt; and &lt;code&gt;imagemagick&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9540" LastEditorUserId="9540" LastEditDate="2016-05-01T15:28:59.167" LastActivityDate="2016-05-01T15:28:59.167" Title="org-toggle-latex-fragment Not Working" Tags="|org-mode|latex|" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="21935" PostTypeId="1" AcceptedAnswerId="21937" CreationDate="2016-04-28T22:02:21.877" Score="1" ViewCount="744" Body="&lt;p&gt;I love that I can insert raw LaTeX fragments in my Org files, and the HTML exporter handles them automatically &lt;a href=&quot;http://orgmode.org/manual/Math-formatting-in-HTML-export.html#Math-formatting-in-HTML-export&quot; rel=&quot;nofollow&quot;&gt;(either leaving them for MathJax to display, or processing them to images)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working on a file where I want to wrap my fragments in &lt;code&gt;src&lt;/code&gt; blocks—&lt;code&gt;#+BEGIN_SRC latex&lt;/code&gt; / &lt;code&gt;#+END_SRC&lt;/code&gt;—mainly for ease of tangling them all together.  Unfortunately, the HTML exporter—after processing these to &lt;code&gt;#+BEGIN_LaTeX&lt;/code&gt; / &lt;code&gt;#+END_LaTeX&lt;/code&gt;—now skips right over them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize this is by design, per &lt;a href=&quot;http://orgmode.org/manual/Quoting-LaTeX-code.html#Quoting-LaTeX-code&quot; rel=&quot;nofollow&quot;&gt;the manual on quoted latex code&lt;/a&gt;, but I’d like to switch it up for this particular file.  Is there a setting I can configure?  Alternatively, which function should I advise to get the behavior I want?&lt;/p&gt;&#xA;" OwnerUserId="372" LastEditorUserId="372" LastEditDate="2016-04-29T03:26:36.497" LastActivityDate="2017-11-09T11:17:04.140" Title="Can I export latex source blocks to html?" Tags="|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21937" PostTypeId="2" ParentId="21935" CreationDate="2016-04-29T01:58:09.937" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a setting I can configure? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;These headers give me the raw LaTeX code in my html output when I use the normal HTML backend:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC latex :noweb yes :exports code&#xA;\begin{test}&#xA;Everything in this block prints in HTML when printed with C-c C-e h o&#xA;\end{test}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;UPDATE: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I want the html exporter to process the code the same way it would if I typed it raw into the org file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you need to process the latex src block, then use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC latex :file img.png&#xA;\begin{figure}&#xA;C-c C-c in this block to see link created below&#xA;This png file will then be inserted in your html output&#xA;For more control of the output look into imagemagick headers that &#xA;you can add to this src block. See the org-babel manual for details.  &#xA;\end{figure}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-04-29T05:14:02.687" LastActivityDate="2016-04-29T05:14:02.687" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21938" PostTypeId="1" AcceptedAnswerId="31806" CreationDate="2016-04-29T03:38:31.213" Score="1" ViewCount="181" Body="&lt;p&gt;I'm using web-mode 13.1.25, but was until today on 12.x with the same issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems I need to continually choose &lt;code&gt;Highlight buffer (C-c C-h)&lt;/code&gt; as otherwise, certain functions misbehave.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These steps demonstrate the problem:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Adding &lt;code&gt;&amp;lt;p&amp;gt;Foo&lt;/code&gt; into the body...&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;body&amp;gt;&#xA;    &amp;lt;p&amp;gt;Foo&#xA; &amp;lt;/body&amp;gt;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;When beginning to type the closing tag&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;body&amp;gt;&#xA;    &amp;lt;p&amp;gt;Foo&amp;lt;/&#xA; &amp;lt;/body&amp;gt;&#xA;&lt;/code&gt;&#xA;3. It completes to the wrong tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;body&amp;gt;&#xA;    &amp;lt;p&amp;gt;Foo&amp;lt;/body&amp;gt;&#xA; &amp;lt;/body&amp;gt;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, I type &lt;code&gt;&amp;lt;p&amp;gt;Foo&lt;/code&gt;, then type &lt;code&gt;C-C C-h&lt;/code&gt; to update highlighting, then when typing the closing tag it auto-completes correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have the current region or the entire buffer's syntax highlighting auto-updated when entering text or a tag?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some setting I'm missing? Is there a recommended workflow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9311" LastActivityDate="2020-08-12T15:05:40.753" Title="How to auto highlight buffer or region in web-mode?" Tags="|syntax-highlighting|web-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21939" PostTypeId="2" ParentId="21829" CreationDate="2016-04-29T08:23:10.927" Score="0" Body="&lt;p&gt;For TAB to CTRL just in Emacs, install Karabiner and configure TAB key under emacs mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then for CTRL in all apps, goto OSX system preferences, keyboard, modifier keys, and then change it as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other operating systems, look into similar utilities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updated: some solutions may require using both solutions together. For example, you can re-assign TAB to be become Left Control key in Karabiner and then in system preferences enable/disable that Ctrl key's behavior as needed. This is one way to tweak laptop keyboards besides using any extended fn keys.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-04-29T14:55:07.047" LastActivityDate="2016-04-29T14:55:07.047" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21940" PostTypeId="1" CreationDate="2016-04-29T13:07:06.113" Score="2" ViewCount="87" Body="&lt;p&gt;Is there a smart way to keep locally enabled minor modes enabled when changing/restarting major modes without adding it to the mode hook or enable it globally?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if I usually don't use &lt;code&gt;paredit&lt;/code&gt;, but decide one day I want to try it out, but then want to change my major mode from &lt;code&gt;emacs-lisp-mode&lt;/code&gt; to &lt;code&gt;lisp-interaction-mode&lt;/code&gt;. How can I do this without &lt;code&gt;paredit&lt;/code&gt; being disabled?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically I want this to be the case with an extension I am writing for &lt;code&gt;org-mode&lt;/code&gt;, where I want a variable to be updated when &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt; is run, but because &lt;code&gt;org-mode&lt;/code&gt; in some contexts restarts and thus disables my minor mode, it is unable to do this without &lt;strong&gt;always&lt;/strong&gt; being enabled with &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2016-04-29T13:07:06.113" Title="Avoid minor modes from turning off when changing/restarting major mode" Tags="|org-mode|minor-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21941" PostTypeId="2" ParentId="20591" CreationDate="2016-04-29T13:10:10.753" Score="2" Body="&lt;p&gt;I think this is related to some breaking changes in Emacs 25.0.*&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/magnars/expand-region.el/issues/160&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magnars/expand-region.el/issues/160&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still running 25.0.* and solved the problem by installing &lt;code&gt;expand-region&lt;/code&gt; from MELPA where a fix to workaround Emacs versions 25+ has been implemented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: Do not use the version (0.10.0) in MELPA &lt;strong&gt;stable&lt;/strong&gt; since it does not work.&lt;/p&gt;&#xA;" OwnerUserId="11873" LastEditorUserId="11873" LastEditDate="2016-04-29T16:11:00.623" LastActivityDate="2016-04-29T16:11:00.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21943" PostTypeId="2" ParentId="20591" CreationDate="2016-04-29T14:16:02.493" Score="1" Body="&lt;p&gt;The latest official Emacs release is 24.5, and the developer of expand-region is &lt;a href=&quot;https://github.com/magnars/expand-region.el/issues/186&quot; rel=&quot;nofollow&quot;&gt;not supporting development versions&lt;/a&gt; (i.e., 25+). This is not unreasonable, as there are frequent changes in the Emacs 25 branch that break and un-break &lt;code&gt;expand-region&lt;/code&gt;, such as demonstrated in the question here. Keeping up with them would be a big job for little benefit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solutions to the problem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;stick to an official Emacs release (i.e., 24.5)&lt;/li&gt;&#xA;&lt;li&gt;if you use a development version of Emacs, stick to a specific release that works with expand-region. Test builds of new versions before you replace your old versions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-04-29T14:16:02.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21945" PostTypeId="2" ParentId="10707" CreationDate="2016-04-29T15:40:31.433" Score="7" Body="&lt;p&gt;I tried to add this to the answer from @Andrew, but it was too long for a comment...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really liked his solution, except that it moved the cursor. (Technically I guess it moved the point. Anyway...) Fortunately, it was easy to add &lt;code&gt;save-excursion&lt;/code&gt; to avoid that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun afs/org-replace-link-by-link-description ()&#xA;  &quot;Replace an org link by its description or if empty its address&quot;&#xA;  (interactive)&#xA;  (if (org-in-regexp org-bracket-link-regexp 1)&#xA;      (save-excursion&#xA;        (let ((remove (list (match-beginning 0) (match-end 0)))&#xA;              (description (if (match-end 3) &#xA;                               (org-match-string-no-properties 3)&#xA;                             (org-match-string-no-properties 1))))&#xA;          (apply 'delete-region remove)&#xA;          (insert description)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6594" LastActivityDate="2016-04-29T15:40:31.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21946" PostTypeId="1" CreationDate="2016-04-29T17:37:47.497" Score="2" ViewCount="308" Body="&lt;p&gt;I've currently got a custom function that I use to grep through files in helm.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Search for the thing that the cursor is on or that's already hilighted. If there's nothing,&#xA;;; switch back to searching for text interactively.&#xA;(defun search-for-region-or-word()&#xA;  &quot;Uses helm to search for the currently marked region, or the word under the cursor.&quot;&#xA;  (interactive)&#xA;  (require 'helm-files)  &#xA;&#xA;  (let ((search-text nil))&#xA;&#xA;    ;; If the region isn't active, activated it by selecting the word under the cursor.&#xA;    (if (not (region-active-p))&#xA;        (setq search-text (thing-at-point 'word 1))&#xA;      (setq search-text (buffer-substring-no-properties (region-beginning) (region-end)))&#xA;      )&#xA;&#xA;    (deactivate-mark)&#xA;&#xA;    (if (not (string= search-text &quot;&quot;))&#xA;        (helm-do-grep-1 (list &quot;e:/path/to-files/&quot;) '(4) nil '(&quot;*.cpp&quot; &quot;*.h&quot; &quot;*.foop&quot; &quot;*.moo&quot;) nil search-text)&#xA;      (project-search)&#xA;      )&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to keep using helm-do-grep-1, but I'd like to use sift or ag instead of grep. helm-do-ag doesn't seem to have support for feeding it arguments like the search text non-interactively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried swapping the other search methods in, but all I ever end up with is a blank search that never terminates on its own, so I suspect that I'm giving helm-grep output in a way that it can't parse properly. (Alternately, I'd take advice on how to make helm-do-ag do what I want. It's not a very well documented extension, unfortunately, and I don't really want to pick apart the elisp myself. :P)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;Here's the grep command:   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;grep -a -d recurse %e -n%cH -e %p %f  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's what I'm trying for the sift command:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sift -ars --line-numbers --nogroup --stats -e %p -f %f  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've also tried:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sift -ars --line-numbers --nogroup --stats %s %s (this works in helm-do-ag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8254" LastActivityDate="2016-04-29T17:37:47.497" Title="How can I replace grep with sift or ag in helm-grep? (Not helm-do-ag)" Tags="|helm|search|grep|helm-grep|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21947" PostTypeId="1" AcceptedAnswerId="27011" CreationDate="2016-04-29T18:36:19.800" Score="4" ViewCount="2725" Body="&lt;p&gt;How can I make all done (e.g. DONE) org-mode items &quot;invisible&quot;?  I'm using org-mode's &quot;visibility&quot; terminology here, but what I'm referring to is collapsing (folding) those items closed, not making them literally invisible.  I don't want to use org's sparse trees for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have multiple custom done states (including SKIP, for example).  I want items to be collapsed if they are in any of those states.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2024-04-06T13:39:04.270" Title="Make all done org-mode items invisible (collapsed)" Tags="|org-mode|todo|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21948" PostTypeId="1" AcceptedAnswerId="27395" CreationDate="2016-04-29T20:13:42.417" Score="0" ViewCount="1690" Body="&lt;p&gt;I'm on Windows, for what it's worth.  Just to make sure that it wasn't something that I did, I fired up emacs using -Q to avoid loading my init.el and attempted to run some python with a breakpoint set inside one of my unit tests.  For the record, this works perfectly fine from Command Prompt -- I can debug there to my heart's content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xOVJD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xOVJD.png&quot; alt=&quot;emacs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, (I'm using emacs 24.5.1 32-bit in Windows 7 and) the breakpoint is hit and no output from pdb is displayed.  What on earth could the issue be?  My colleague is running emacs as well and he can debug from pdb without problems.  Any thoughts on how to rectify this?&lt;/p&gt;&#xA;" OwnerUserId="598" LastEditorUserId="598" LastEditDate="2016-04-30T16:22:31.747" LastActivityDate="2017-05-18T17:49:39.967" Title="Can't see pdb output from shell-mode" Tags="|python|shell|debugging|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21949" PostTypeId="1" CreationDate="2016-04-29T20:31:20.103" Score="6" ViewCount="3952" Body="&lt;p&gt;I have a quite extensive &lt;code&gt;org-agenda-files&lt;/code&gt;, so the first time I load an agenda view after starting the Emacs process, I have to wait ~20sec.  I'm using Emacs in daemon mode (via systemd user service).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I have Emacs initialize the org-agenda on daemon startup, so that once I'm in Emacs, I don't have to wait when displaying an agenda for the first time?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2023-08-21T15:14:19.523" Title="How to initialize org agenda on Emacs startup?" Tags="|org-mode|org-agenda|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21950" PostTypeId="2" ParentId="21949" CreationDate="2016-04-29T21:15:12.877" Score="4" Body="&lt;p&gt;Add this to your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-init-hook 'org-agenda-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="675" LastEditDate="2016-04-29T21:45:14.813" LastActivityDate="2016-04-29T21:45:14.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21951" PostTypeId="2" ParentId="21807" CreationDate="2016-04-30T00:50:42.760" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;I commented out &lt;code&gt;(require 'ess-site)&lt;/code&gt; in &lt;code&gt;/Applications/Emacs.app/Contents/Resources/site-lisp/site-start.el&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Installed the package from ELPA.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt;, I included the statements:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(require 'ess-site)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2421" LastActivityDate="2016-04-30T00:50:42.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21952" PostTypeId="2" ParentId="21947" CreationDate="2016-04-30T01:43:31.803" Score="2" Body="&lt;p&gt;You can &lt;a href=&quot;http://orgmode.org/manual/Internal-archiving.html&quot; rel=&quot;nofollow&quot;&gt;archive&lt;/a&gt; all items you want folded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Archived items (i.e. items marked with the &lt;code&gt;ARCHIVE&lt;/code&gt; tag) will always remain folded unless explicitly unfolded via &lt;code&gt;org-force-cycle-archived&lt;/code&gt; (&lt;kbd&gt;C-TAB&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do a bulk archiving on all DONE items, there is an example &lt;a href=&quot;http://orgmode.org/manual/Using-the-mapping-API.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; on how to proceed. Something like the following (untested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-map-entries&#xA;  '(org-toggle-tag &quot;ARCHIVE&quot; 'on )&#xA;  &quot;/+DONE&quot; 'file 'archive 'comment)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This adds the ARCHIVE tag to all headings in the file having the DONE state (excluding commented and archived trees).&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-04-30T01:43:31.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21953" PostTypeId="2" ParentId="21947" CreationDate="2016-04-30T03:05:57.997" Score="1" Body="&lt;p&gt;The following command, minimally tested, will hide/fold all entries marked with one of the DONE keywords:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-fold-all-done-entries ()&#xA;  &quot;Close/fold all entries marked DONE.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-max))&#xA;    (while (outline-previous-heading)&#xA;      (when (org-entry-is-done-p)&#xA;        (hide-entry)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;outline&lt;/code&gt; commands may be changing prefixes.  If so, you may wish to change the &lt;code&gt;hide-entry&lt;/code&gt; line to &lt;code&gt;outline-hide-entry&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-04-30T03:05:57.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21954" PostTypeId="1" CreationDate="2016-04-30T07:21:24.383" Score="3" ViewCount="68" Body="&lt;p&gt;In the Wolfram language, special characters such as ∂, ∫ and ζ can be displayed nicely in Mathematica and in the source, appear as &lt;code&gt;\[PartialD]&lt;/code&gt;, &lt;code&gt;\[Integral]&lt;/code&gt; and &lt;code&gt;\[Zeta]&lt;/code&gt;.  In &lt;a href=&quot;https://github.com/kawabata/wolfram-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;wolfram mode&lt;/code&gt;&lt;/a&gt;, the special characters are supported through font locking, but otherwise the syntax table does not account for them which is the cause of some bugs since &lt;code&gt;]&lt;/code&gt; is marked as a delimiter (and was &lt;a href=&quot;https://github.com/kawabata/wolfram-mode/issues/4&quot; rel=&quot;nofollow&quot;&gt;reported&lt;/a&gt; a while ago).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to create a pull-request to amend the syntax-table so that &lt;code&gt;\[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt; are matched delimiters; however, it seems like the syntax table can only allow a single character at a time to be defined, and multiple character sequences are only possible for comments.  So is it possible have &lt;code&gt;\[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt; be matched delimiters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried looking for a way to tell emacs to treat &lt;code&gt;\[...]&lt;/code&gt; as a single &quot;unit&quot; so that the &lt;code&gt;]&lt;/code&gt; at the end doesn't cause new issues; but to be honest I don't really know how to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS:  As far as I know, the elided text inside &lt;code&gt;\[...]&lt;/code&gt; always consists of the set &lt;code&gt;[A-Za-z0-9]&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11884" LastEditorUserId="11884" LastEditDate="2016-05-02T01:03:59.927" LastActivityDate="2016-05-02T01:03:59.927" Title="Treating \[...] nicely in Wolfram mode" Tags="|syntax-table|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21955" PostTypeId="1" AcceptedAnswerId="21956" CreationDate="2016-04-30T08:51:52.260" Score="15" ViewCount="6086" Body="&lt;p&gt;I'm trying to activate flycheck-mode by default when opening any file in my project's directory. I'm a bit of an elisp newbie, my .dir-locals.el file looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . (mode . flycheck-mode))&#xA; ((cmake-ide-dir . &quot;~/workspace/Samira3D&quot;))&#xA; ((cmake-ide-build-dir . &quot;~/workspace/Samira3D/build/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the error I'm getting is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid function: (nil mode . flycheck-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would I go about solving this?&lt;/p&gt;&#xA;" OwnerUserId="11885" LastEditorUserId="105" LastEditDate="2016-06-22T19:53:00.630" LastActivityDate="2016-06-22T19:53:00.630" Title="Calling functions in .dir-locals in Emacs" Tags="|directory-local-variables|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21956" PostTypeId="2" ParentId="21955" CreationDate="2016-04-30T10:55:53.317" Score="27" Body="&lt;ol&gt;&#xA;&lt;li&gt;Your list nesting is wrong.&lt;/li&gt;&#xA;&lt;li&gt;You need to use the &lt;code&gt;eval&lt;/code&gt; pseudo-variable to evaluate expressions / call functions.&lt;/li&gt;&#xA;&lt;li&gt;Using &lt;code&gt;mode&lt;/code&gt; to set a minor mode is deprecated. That's now for major modes only, and minor modes are enabled via &lt;code&gt;eval&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think you wanted this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((nil . ((eval . (flycheck-mode 1))&#xA;         (cmake-ide-dir . &quot;~/workspace/Samira3D&quot;)&#xA;         (cmake-ide-build-dir . &quot;~/workspace/Samira3D/build/&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also have a read of this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Dotted Pair Notation&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes you'll see examples of .dir-locals.el files using fewer dots and parentheses, and the difference (or indeed equivalence) between the different ways of formatting them might be confusing, so that will &lt;em&gt;hopefully&lt;/em&gt; clarify the matter.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-04-30T11:03:27.057" LastActivityDate="2016-04-30T11:03:27.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21957" PostTypeId="1" CreationDate="2016-04-30T12:49:23.637" Score="2" ViewCount="376" Body="&lt;p&gt;I would like to make flycheck work with checkers installed via Bundler, and I've read that in order to do that, I have to implement the &lt;a href=&quot;https://github.com/flycheck/flycheck/blob/master/flycheck.el#L426&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;flycheck-command-wrapper-function&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it should do is prepend &lt;code&gt;command&lt;/code&gt; with &lt;code&gt;bundle exec&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/travisbhartwell/nix-emacs/blob/master/README.org#flycheck&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; is an implementation of such a wrapper for Haskell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a total newbie when it comes to Lisp, so I could only come up with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq flycheck-command-wrapper-function&#xA;      (lambda (command) (funcall &quot;bundle exec &quot; command))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which doesn't seem to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="11509" LastActivityDate="2018-03-22T05:46:34.650" Title="flycheck wrapper function for bundler" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21958" PostTypeId="2" ParentId="21957" CreationDate="2016-04-30T13:26:36.213" Score="1" Body="&lt;p&gt;Well, it'd be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq flycheck-command-wrapper-function&#xA;      (lambda (command)&#xA;        (append '(&quot;bundle&quot; &quot;exec&quot;) command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that there's a misunderstanding here, and I see that &lt;code&gt;command&lt;/code&gt; is quite a confusing name here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't use &lt;code&gt;funcall&lt;/code&gt; here because &lt;code&gt;command&lt;/code&gt; is not an Emacs Lisp interactive command—i.e. what you'd execute with &lt;code&gt;M-x&lt;/code&gt;—in this case.  It's a list of strings that constitute an executable command for the operating system.  Essentially it's what you'd type into your shell to run a syntax checker, although Flycheck does not use the shell to run its commands for safety and efficiency reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right before it's about to execute such a command for a syntax checker Flycheck gives to whole command as argument to &lt;code&gt;flycheck-command-wrapper-function&lt;/code&gt;.  The function must then return another, potentially entirely different, list which is the command that Flycheck will subsequently execute without any further checks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To run a syntax checker through bundle we just need to return the command with &lt;code&gt;bundle exec&lt;/code&gt; prepended.  Mind you, Flycheck doesn't use the shell so you need to pass &lt;code&gt;bundle exec&lt;/code&gt; as &lt;em&gt;two&lt;/em&gt; separate list items.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that this clears up things a little bit.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-04-30T13:26:36.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21961" PostTypeId="2" ParentId="21863" CreationDate="2016-04-30T14:18:28.910" Score="8" Body="&lt;p&gt;The documentation in the emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html#Useless-Whitespace&quot;&gt;manual&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Whitespace mode is a buffer-local minor mode that lets you&#xA;  “visualize” many kinds of whitespace in the buffer, by either drawing&#xA;  the whitespace characters with a special face or displaying them as&#xA;  special glyphs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The relevant docstrings contain more information.  So let's say we&#xA;want do display spaces as ·:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq whitespace-display-mappings '((space-mark 32 [?·])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note we could add an entry for &lt;code&gt;tab-mark&lt;/code&gt; for this to apply to tabs&#xA;as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this is only applied if &lt;code&gt;whitespace-style&lt;/code&gt; contains &lt;code&gt;space-mark&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq whitespace-style '(space-mark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is we can't specify different glyphs for different kinds&#xA;of spaces (in your case, trailing versus other spaces), but what we&#xA;can specify for each kind is a &lt;strong&gt;face&lt;/strong&gt; to be used, so we instead do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq whitespace-style '(face trailing spaces space-mark))   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that is in addition of using the · glyph, we want both &lt;em&gt;trailing&#xA;spaces&lt;/em&gt; and &lt;em&gt;(non trailing, I guess) spaces&lt;/em&gt; to be displayed by faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we have to &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-face&lt;/code&gt; &lt;code&gt;whitespace-space&lt;/code&gt; to a &quot;non visible&quot; face by setting both its &lt;code&gt;Foreground&lt;/code&gt; and &lt;code&gt;Background&lt;/code&gt; attributes to&#xA;our background color ; and &lt;code&gt;whitespace-trailing&lt;/code&gt; to whatever we want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;whitespace-mode&lt;/code&gt; has to be restarted for changes to these&#xA;variables to take effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, non trailing whitespaces will be visible as a · when point is&#xA;there if the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Cursor-Parameters.html#Cursor-Parameters&quot;&gt;&lt;code&gt;cursor-type&lt;/code&gt;&lt;/a&gt; is a &lt;code&gt;box&lt;/code&gt;, or when in highlighted region, that can be annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After all, this is a bit convoluted:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;there's a space in the buffer there,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;but it is displayed as a · glyph,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;but its face &quot;hides&quot; it, making it look like a space.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Additionnaly, trailing white spaces are not shown when point is at line end, after these spaces; this is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html#Useless-Whitespace&quot;&gt;by design&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This feature does not apply when point is at the end of the line containing the whitespace. Strictly speaking, that is “trailing whitespace” nonetheless, but displaying it specially in that case looks ugly while you are typing in new text. In this special case, the location of point is enough to show you that the spaces are present. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you really want to change this, here is how it's implemented in &lt;code&gt;whitespace.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun whitespace-trailing-regexp (limit)&#xA;  &quot;Match trailing spaces which do not contain the point at end of line.&quot;&#xA;  (let ((status t))&#xA;    (while (if (re-search-forward whitespace-trailing-regexp limit t)&#xA;               (= whitespace-point (match-end 1)) ;; loop if point at eol&#xA;             (setq status nil)))          ;; end of buffer&#xA;    status))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can redefine this function in your init file, removing the end of line test:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun whitespace-trailing-regexp (limit)&#xA;  &quot;Match all trailing spaces. This overloads the definition in whitespace.el.&quot;&#xA;  (let ((status t))&#xA;    (while (unless (re-search-forward whitespace-trailing-regexp limit t)&#xA;             (setq status nil)))          ;; end of buffer&#xA;    status))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, all of this must be done &lt;em&gt;after&lt;/em&gt; &lt;code&gt;whitespace&lt;/code&gt; has been loaded, which can be ensured by including &lt;code&gt;(require 'whitespace)&lt;/code&gt; first.  Another possibility would be to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html#Advising-Functions&quot;&gt;advise&lt;/a&gt; the function, I'm not sure what's the prefered way here.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-05-01T18:50:43.820" LastActivityDate="2016-05-01T18:50:43.820" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21962" PostTypeId="2" ParentId="21691" CreationDate="2016-04-30T15:40:32.143" Score="0" Body="&lt;p&gt;Since there is no answer yet - I post my solution here as I mentioned in above comments - am I the only one who encounter this question?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go to the Emacs source folder, and run the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; $export git_common_dir=.git/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now edit autogen.sh file, and comment both 280 &amp;amp; 281. Then use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; $./autogen.sh all&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It should work now.&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2016-04-30T15:40:32.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21963" PostTypeId="1" AcceptedAnswerId="21966" CreationDate="2016-04-30T17:10:50.553" Score="1" ViewCount="68" Body="&lt;p&gt;I have both of these folders for my load paths, what is the difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/.emacs.d/contrib/lisp/&lt;/code&gt; vs &lt;code&gt;~/.emacs.d/lisp/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I use one versus the other?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2016-04-30T18:52:12.633" Title="What is the difference between contrib/lisp and lisp?" Tags="|directories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21964" PostTypeId="1" CreationDate="2016-04-30T17:30:04.187" Score="2" ViewCount="364" Body="&lt;p&gt;I think I must be missing something silly. I am trying to use &lt;code&gt;ob-ipython&lt;/code&gt; in my &lt;code&gt;org-mode&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;code&gt;C-c C-c&lt;/code&gt; I get &lt;code&gt;Process Python not running&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to startup some process or something before I can use the installation? I have followed the directions as best as I could and double checked my steps.&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2016-08-08T17:01:51.390" Title="Process Python not running on ob-ipython" Tags="|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21965" PostTypeId="1" AcceptedAnswerId="21991" CreationDate="2016-04-30T18:04:43.580" Score="1" ViewCount="732" Body="&lt;p&gt;I am using spacemacs (I don't think it should matter though) mu/mu4e and mbsync&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &quot;move to folder&quot; followed by &quot;execute mark&quot;, I expect the &quot;movement of message from Inbox to Archive&quot; to be reflected on the IMAP server. &lt;strong&gt;But it doesn't&lt;/strong&gt; :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The message is &quot;moved&quot; from mu4e interface (I think that means mbsync locally considers the message moved) but this is not reflected on the server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;code&gt;(setq mu4e-change-filenames-when-moving t)&lt;/code&gt; in my &lt;code&gt;.spacemacs&lt;/code&gt; there is an &lt;em&gt;appearance&lt;/em&gt; of the movement (i.e. Message appears in the &lt;code&gt;Archive&lt;/code&gt; folder, but it is a &lt;strong&gt;copy&lt;/strong&gt;. i.e. Message is still in the &lt;code&gt;Inbox&lt;/code&gt; and the &lt;em&gt;move&lt;/em&gt; created a copy into the &lt;code&gt;Archive&lt;/code&gt; folder. I definitely &lt;strong&gt;don't&lt;/strong&gt; want that. So I have commented the above config setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not even sure whether this is supported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, how do I fix this ? Pointer to documentation/URL should be OK too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: Additional info, part of my &lt;code&gt;.mbsyncrc&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Automatically create missing mailboxes, both locally and on the server&#xA;Create Both&#xA;# Save the synchronization state files in the relevant directory&#xA;SyncState *&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am not using gmail. I'm using &lt;a href=&quot;https://www.zoho.com/mail/help/imap-access.html&quot; rel=&quot;nofollow&quot;&gt;Zoho IMAP server&lt;/a&gt;, if it matters.&lt;/p&gt;&#xA;" OwnerUserId="11877" LastEditorUserId="11877" LastEditDate="2016-04-30T18:11:44.500" LastActivityDate="2016-06-01T07:13:05.600" Title="mu4e does not sync the &quot;move to folder&quot; action to the IMAP server" Tags="|spacemacs|email|mu4e|imap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21966" PostTypeId="2" ParentId="21963" CreationDate="2016-04-30T18:52:12.633" Score="4" Body="&lt;p&gt;To Emacs there's no difference between these.  In fact these aren't even Emacs' paths.  Emacs enforces no structure upon &lt;code&gt;~/.emacs.d/&lt;/code&gt;; everything that's in there is a matter of your personal configuration.  In other words, if you're having these paths on &lt;code&gt;load-path&lt;/code&gt; then only because &lt;em&gt;your&lt;/em&gt; configuration added them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the only one who can tell the difference between these, is you :)  And if you don't know, chances are that you don't actually need both :)&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-04-30T18:52:12.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21967" PostTypeId="1" CreationDate="2016-04-30T21:40:42.850" Score="4" ViewCount="380" Body="&lt;p&gt;Given the following structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| A |  |  |  |&#xA;| B |  |  |  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|A |  |   |  |&#xA;|  |  | B |  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Question:&#xA;Is there a way to move single elements between columns?&#xA;What I know right now I can only move whole columns.&lt;/p&gt;&#xA;" OwnerUserId="10814" LastEditorUserId="10814" LastEditDate="2016-04-30T22:59:37.313" LastActivityDate="2016-05-03T15:59:09.740" Title="Moving one item in Org Table from col 1 to col 2 problem" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21968" PostTypeId="2" ParentId="21734" CreationDate="2016-04-30T21:48:02.273" Score="1" Body="&lt;p&gt;It turns out that the &lt;code&gt;sticky&lt;/code&gt; property was set in my saved desktop, and that executing &lt;code&gt;(desktop-save-mode 1)&lt;/code&gt; was enough to turn it on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I solved the problem by using &lt;code&gt;emacs -q&lt;/code&gt; to edit the desktop save file to remove the &lt;code&gt;(sticky . t)&lt;/code&gt; from a property list.&lt;/p&gt;&#xA;" OwnerUserId="9343" LastActivityDate="2016-04-30T21:48:02.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21969" PostTypeId="1" AcceptedAnswerId="21973" CreationDate="2016-05-01T00:01:13.970" Score="4" ViewCount="217" Body="&lt;p&gt;I see Emacs use &lt;code&gt;#$&lt;/code&gt; in autoload files, but I don't known if there are any difference between &lt;code&gt;#$&lt;/code&gt; and &lt;code&gt;load-file-name&lt;/code&gt;. When I use them in a file, they looks like the same and when I print them by &lt;code&gt;M-:&lt;/code&gt; they are both &lt;code&gt;nil&lt;/code&gt;. So I did some test but only get more confused. Does &lt;code&gt;#$&lt;/code&gt; behave more like &lt;code&gt;__FILE__&lt;/code&gt; in Python?&lt;/p&gt;&#xA;" OwnerUserId="11890" LastEditorUserId="675" LastEditDate="2016-05-01T00:39:29.153" LastActivityDate="2016-05-01T05:06:38.877" Title="Is the sharp dollar (#$) sign the same as load-file-name in Emacs?" Tags="|syntax|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21970" PostTypeId="1" CreationDate="2016-05-01T00:38:12.337" Score="1" ViewCount="381" Body="&lt;p&gt;I'm trying to read a directory path using &lt;code&gt;ido-read-directory-name&lt;/code&gt;to prompt in the minibuffer. I have &lt;code&gt;(ido-everywhere t)&lt;/code&gt;and &lt;code&gt;(ido-enable-flex-matching t)&lt;/code&gt; enabled, and I'm running emacs 24.5.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect &lt;code&gt;ido-read-directory-name&lt;/code&gt;to behave like &lt;code&gt;ido-read-file-name&lt;/code&gt;, by showing all possible flex matches in the minibuffer. I expect it to show me ONLY directory name matches (not file name matches), since I'm reading for directory names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But instead of showing matches in the minibuffer, it shows only &lt;code&gt;[.]&lt;/code&gt;after the current directory match, like so &lt;code&gt;/usr/bin/[.]&lt;/code&gt;, which is not what I want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I hit TAB once, potential directory matches are displayed in a regular emacs buffer (named &quot;&lt;em&gt;Ido Completions&lt;/em&gt;&quot;), as emacs normally does for Apropos, Help, describe-function matches, etc. The buffer says &quot;Potential matches: &quot; and displays a lonely single dot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I hit TAB a second time, the single dot is replaced with a full list of potential directory matches, and is displayed in the &quot;&lt;em&gt;Ido Completions&lt;/em&gt;&quot; buffer as Emacs normally does. Seeing that, I can start typing a desired match, and the minibuffer will eventually match it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes if I type a single letter in the minibuffer, and then backspace to erase it, the usual (nice) flex match display shows up, with something like this &lt;code&gt;../blah/blah/dir/{. | match1/ | match2/ | ...}&lt;/code&gt;showing. From this, I'm thinking that &lt;code&gt;ido-read-directory-name&lt;/code&gt;knows how to properly show directory matches in the minibuffer, but for some reason is not doing it by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why doesn't &lt;code&gt;ido-read-directory-name&lt;/code&gt;display the possible directory matches in the minibuffer? Is there some variable that I might have set wrong? (I looked at the 50? possible ido-* variables with describe-variable, but couldn't see anything. Ditto for searching the SO forums, and the net.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I love &lt;code&gt;ido-read-file-name&lt;/code&gt;, but ido-read-directory seems to exhibit very different behavior for me. Ideas to try, anyone? Thanks&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-05-01T00:56:23.163" LastActivityDate="2017-08-25T02:01:16.397" Title="ido-read-directory-name does not show matches in minibuffer" Tags="|completion|ido|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21972" PostTypeId="2" ParentId="21892" CreationDate="2016-05-01T04:24:50.007" Score="2" Body="&lt;p&gt;My Windows-&lt;strong&gt;Menu&lt;/strong&gt; key runs &lt;code&gt;execute-extended-command&lt;/code&gt; (as &lt;code&gt;M-x&lt;/code&gt; does).&#xA;&lt;br/&gt;It's very close to the Shift key.&#xA;It can be changed too...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;menu&amp;gt;&quot;) 'find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7037" LastEditorUserId="675" LastEditDate="2016-05-01T15:44:01.637" LastActivityDate="2016-05-01T15:44:01.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21973" PostTypeId="2" ParentId="21969" CreationDate="2016-05-01T05:06:38.877" Score="6" Body="&lt;p&gt;Ask Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x elisp-index-search RET #$ RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Internally, the dynamic loading of documentation strings is&#xA;  accomplished by writing compiled files with a special Lisp reader&#xA;  construct, ‘#@COUNT’.  This construct skips the next COUNT characters.&#xA;  It also uses the ‘#$’ construct, which stands for “the name of this&#xA;  file, as a string”.  Do not use these constructs in Lisp source files;&#xA;  they are not designed to be clear to humans reading the file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-01T05:06:38.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21974" PostTypeId="2" ParentId="21896" CreationDate="2016-05-01T05:20:45.767" Score="1" Body="&lt;p&gt;I guess you mean when opening the TAGS file, not when showing the tags buffer in a window?  My emacs (24.5) has variable &lt;strong&gt;large-file-warning-threshold&lt;/strong&gt; set to 10000000, and if I say find-tag, or otherwise visit a large TAGS file (any large file), I get a message and have to confirm the open:&#xA;&lt;p&gt; File TAGS is large (size), really open?&lt;/p&gt;&#xA;" OwnerUserId="7037" LastActivityDate="2016-05-01T05:20:45.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21975" PostTypeId="2" ParentId="21967" CreationDate="2016-05-01T06:42:55.593" Score="3" Body="&lt;p&gt;I solved it by using narrowing, just narrow the table to the single row with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt;&lt;kbd&gt;e&lt;/kbd&gt; and apply &lt;code&gt;M-&amp;lt;Right&amp;gt;&lt;/code&gt; and then widen with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt;&lt;kbd&gt;w&lt;/kbd&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For another solution check &lt;a href=&quot;http://orgmode.org/worg/org-hacks.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; explaining why this is not in Org mode and how to add custom functions to add it self.&lt;/p&gt;&#xA;" OwnerUserId="10814" LastEditorUserId="675" LastEditDate="2016-05-03T15:59:09.740" LastActivityDate="2016-05-03T15:59:09.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21976" PostTypeId="1" AcceptedAnswerId="22004" CreationDate="2016-05-01T07:00:11.477" Score="1" ViewCount="151" Body="&lt;p&gt;In Common Lisp, there is a function called &lt;code&gt;function-lambda-expression&lt;/code&gt;, which returns the LAMBDA form that defines a function (or &lt;code&gt;NIL&lt;/code&gt; on implementations that compile everything to native code). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a function in ELisp that does something similar?&lt;/p&gt;&#xA;" OwnerUserId="11891" LastEditorUserId="105" LastEditDate="2016-08-22T21:43:15.790" LastActivityDate="2016-08-22T21:43:15.790" Title="Elisp equivalent of FUNCTION-LAMBDA-EXPRESSION?" Tags="|symbol-function|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21977" PostTypeId="1" CreationDate="2016-05-01T09:23:10.360" Score="2" ViewCount="562" Body="&lt;p&gt;OS: Windows XP, Emacs: 24.5.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed bookmark+ package using Melpa. It was put into directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d/elpa/bookmark+-20151107.847&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I put &lt;code&gt;(require 'bookmark+)&lt;/code&gt; to the end of ~/.emacs, I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `.emacs':&#xA;&#xA;File error: Cannot open load file, no such file or directory, bookmark+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But after Emacs is fully loaded, if I evaluate form &lt;code&gt;(require 'bookmark+)&lt;/code&gt; --- it loads the appropriate module.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, it seems, that it doesn't search for the library in &lt;code&gt;~/.emacs.d/elpa/bookmark+-20151107.847&lt;/code&gt; directory while &lt;code&gt;.emacs&lt;/code&gt; is being loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to fix?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2017-06-27T15:27:28.757" Title="Emacs doesn't search inside elpa directory while loading" Tags="|init-file|package-repositories|load-path|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21978" PostTypeId="1" CreationDate="2016-05-01T09:27:56.707" Score="2" ViewCount="978" Body="&lt;p&gt;I have &lt;kbd&gt;C-RET&lt;/kbd&gt; set to &lt;code&gt;other-window&lt;/code&gt; globally. For modes that would override this I manually add a hook to the mode's key map, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'magit-log-mode-hook (lambda () (local-unset-key (kbd &quot;&amp;lt;C-return&amp;gt;&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work for &lt;code&gt;magit-status-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key magit-status-mode-map (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which has no effect either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I tell &lt;code&gt;magit-status-mode-hook&lt;/code&gt; to not interfere with my global setting?&lt;/p&gt;&#xA;" OwnerUserId="281" LastEditorUserId="281" LastEditDate="2016-05-02T13:32:22.063" LastActivityDate="2016-05-02T13:32:22.063" Title="Remove key binding in magit-status-mode" Tags="|key-bindings|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21979" PostTypeId="2" ParentId="21978" CreationDate="2016-05-01T10:18:35.307" Score="6" Body="&lt;p&gt;First a general remark about un-/setting key bindings. Don't use a hook, instead do it on &quot;library load time&quot;. That way you only do it once, which also helps if you later change the binding interactively for the current session. If you had used the hook to change the binding in your configuration, then that binding would be re-established every time you open a new buffer which uses the same major-mode, overriding your other binding again. Also &lt;code&gt;local-unset-key&lt;/code&gt; is mostly intended for interactive use, I think. So use&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'magit-log&#xA;  (define-key magit-log-mode-map (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason unbinding &lt;kbd&gt;C-RET&lt;/kbd&gt; doesn't appear to work in the status buffer is that Magit also uses text-property key bindings, bindings that only have an effect for certain parts of the buffer and that are established in keymap different from the mode keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you will need to search the source for keymaps that establish such bindings. Of course different syntaxes can be used for this particular key binding, but I think I used &lt;code&gt;[C-return]&lt;/code&gt; in all cases (but did not double check). Which leads to the keymaps &lt;code&gt;magit-file-section-map&lt;/code&gt; and &lt;code&gt;magit-hunk-section-map&lt;/code&gt;, both defined in &lt;code&gt;magit-diff.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-05-01T10:41:03.873" LastActivityDate="2016-05-01T10:41:03.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21980" PostTypeId="1" CreationDate="2016-05-01T11:09:08.320" Score="1" ViewCount="738" Body="&lt;p&gt;I'm using Emacs (24.4+1-5) and org mode for writing prose, which means that I need some mechanism for line wrapping that just works, and preferably the same way each time. At the moment I'm using visual-line-mode with fill-column set to 80. However, opening an old text file (having ascertained that org-mode, visual-line-mode, and the fill-column parameter are all set) and entering some additional text, the lines easily exceed 80 characters and have to be re-wrapped manually using M-q. What am I not getting here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq sentence-end-double-space nil)&#xA;&#xA;(add-hook 'text-mode-hook 'visual-line-mode)&#xA;&#xA;(menu-bar-mode -1)&#xA;&#xA;(defun margins ()&#xA;&#xA;(setq left-margin-width 20)&#xA;&#xA;(setq right-margin-width 20))&#xA;&#xA;(add-hook 'text-mode-hook 'margins)&#xA;&#xA;(setq-default fill-column 80)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11892" LastActivityDate="2016-05-31T17:51:27.120" Title="Unpredictable fill-column behavior" Tags="|org-mode|fill-column|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21981" PostTypeId="2" ParentId="21970" CreationDate="2016-05-01T14:59:45.287" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For clarification, all you want &lt;code&gt;ido&lt;/code&gt; is to present you with possible sub-directory names?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;From my interpretation, what you want is ido-dired with &lt;code&gt;C-x d&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This allows you to use dired mode in tandem with ido mode. Here's what that looks like for me when executed in a blank buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/f6CYv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/f6CYv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that command, I can navigate around my directories (only, no file names) and choose the directory.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Here's a post on overflow where someone has a problem similar to yours. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The solution offered is one I personally use, which is &lt;code&gt;ido-ubiquitous&lt;/code&gt;, a package that attempts to implement &lt;code&gt;ido&lt;/code&gt; functionality basically in any buffer possible 'without breaking anything.' It's on &lt;a href=&quot;https://github.com/DarwinAwardWinner/ido-ubiquitous&quot; rel=&quot;nofollow noreferrer&quot;&gt;Github&lt;/a&gt; and &lt;a href=&quot;https://stable.melpa.org/#/ido-ubiquitous&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt;. It is a really powerful package that can do a lot more than what I use it for, so I personally highly recommend it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Together with normal &lt;code&gt;ido&lt;/code&gt;, I am able to have near universal buffer completion with just the following three commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ido-mode 1) &#xA;(ido-everywhere 1)&#xA;(ido-ubiquitous-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Installing &lt;a href=&quot;https://github.com/nonsequitur/smex&quot; rel=&quot;nofollow noreferrer&quot;&gt;Smex&lt;/a&gt; also enhances navigating any &lt;code&gt;M-&lt;/code&gt; related commands, and only requires &lt;code&gt;(smex-initialize)&lt;/code&gt; and rebinding &lt;code&gt;M-x&lt;/code&gt; and &lt;code&gt;M-X&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a lot of emacs minor and major modes, there are various configurations with minor differences so if you don't choose the right one from the start, it can cause confusion/look like it doesn't work. Additionally, if you try to combine modes that &lt;em&gt;theoretically&lt;/em&gt; should work together, it goes without saying that they still might not for obscure reasons down in the code itself. At minimum, I hope this answer put you in the right direction.&lt;/p&gt;&#xA;" OwnerUserId="11660" LastActivityDate="2016-05-01T14:59:45.287" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21982" PostTypeId="2" ParentId="21980" CreationDate="2016-05-01T15:14:00.303" Score="1" Body="&lt;p&gt;Here's the &lt;a href=&quot;https://emacs.stackexchange.com/a/21674/11660&quot;&gt;answer to a post where&lt;/a&gt; I struggled with a similar problem concering &lt;code&gt;visual-line-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/21656/copy-and-paste-from-pdf-to-emacs-as-plain-text/21674#comment33560_21656&quot;&gt;@YoungFrog describes&lt;/a&gt; how &lt;code&gt;visual-line-mode&lt;/code&gt; works pretty well in a comment. Long story short, &lt;code&gt;visual-line-mode&lt;/code&gt; involves only 'soft' new lines, i.e. it does not actually edit the formatting of your text at all, it only makes it look like your text is a certain line length. Further, it will allow you to modify the text as if the placement of the text, as presented by &lt;code&gt;visual-line-mode&lt;/code&gt;, was real. However, the moment you turn &lt;code&gt;visual-line-mode&lt;/code&gt; off, open a file without &lt;code&gt;visual-line-mode&lt;/code&gt;, etc, you will see the true formatting of your text (read: messy, no new lines, ridiculous column lengths).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very useful mode I discovered to overcome this while still keeping the nice formatting of &lt;code&gt;visual-line-mode&lt;/code&gt; was a &lt;a href=&quot;http://melpa.org/#/visual-fill-column&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA package called &lt;code&gt;visual-line-column-mode&lt;/code&gt;&lt;/a&gt; that makes visual-line-mode wrap at fill-column when reached AND at the edge of the window. Together, you still get the visual benefit of visual-line-mode while also maintaining a healthy column length/formatting. In other words, visual line mode will now format your text according to 1) your column length and the 2) the edge of your screen. Set your column length to whatever you want, and it will handle the rest.&lt;/p&gt;&#xA;" OwnerUserId="11660" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-05-01T15:14:00.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21983" PostTypeId="1" AcceptedAnswerId="22008" CreationDate="2016-05-01T16:02:33.937" Score="3" ViewCount="493" Body="&lt;p&gt;When I run &lt;code&gt;magit-status&lt;/code&gt; I see the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fUSjw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fUSjw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And when I run git status at the terminal I see the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mbjOp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mbjOp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What gives? I'm unable to 'stage' the modified file for commit. When I try to commit with magit, I'm told that there is nothing staged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, I've added my git config&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# all the color&#xA;[color]&#xA;    ui = always&#xA;[color &quot;diff&quot;]&#xA;    meta = yellow bold&#xA;    commit = green bold&#xA;    frag = magenta bold&#xA;    old = red bold&#xA;    new = green bold&#xA;    whitespace = red reverse&#xA;[color &quot;diff-highlight&quot;]&#xA;    oldNormal = red bold&#xA;    oldHighlight = &quot;red bold 52&quot;&#xA;    newNormal = &quot;green bold&quot;&#xA;    newHighlight = &quot;green bold 22&quot;&#xA;[color &quot;branch&quot;]&#xA;    current = yellow reverse&#xA;    local = yellow&#xA;    remote = green&#xA;[color &quot;status&quot;]&#xA;    added = yellow&#xA;    changed = green&#xA;    untracked = cyan&#xA;&#xA;# correct typos&#xA;[help]&#xA;    autocorrect = 1&#xA;&#xA;# aliases&#xA;[alias]&#xA;  c = commit&#xA;  b = branch&#xA;  up = pull&#xA;  p = push&#xA;  s = status -s&#xA;  sclone = clone --depth=1&#xA;  co = checkout&#xA;  df = diff --color --color-words --abbrev&#xA;  lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&amp;lt;%an&amp;gt;%Creset' --abbrev-commit --&#xA;&#xA;  # Show the diff between the latest commit and the current state&#xA;  d = !&quot;git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat&quot;&#xA;&#xA;  reup = rebase-update # depot_tools specific&#xA;&#xA;[user]&#xA;    email = nland@authen2cate.com&#xA;    name = Nicholas Land&#xA;&#xA;[core]&#xA;    editor = nvim&#xA;    autocrlf = input&#xA;    pager = diff-highlight | diff-so-fancy | less -r&#xA;&#xA;[push]&#xA;    default = simple&#xA;&#xA;[difftool &quot;kdiff3&quot;]&#xA;  trustExitCode = false&#xA;[difftool]&#xA;  prompt = false&#xA;[diff]&#xA;  tool = kdiff3&#xA;&#xA;[mergetool &quot;kdiff3NoAuto&quot;]&#xA;  trustExitCode = false&#xA;[mergetool]&#xA;  keepBackup = false&#xA;[merge]&#xA;  tool = kdiff3NoAuto&#xA;[mergetool &quot;kdiff3NoAuto&quot;]&#xA;    cmd = kdiff3 --L1 \&quot;$MERGED (Base)\&quot; --L2 \&quot;$MERGED (Local)\&quot; --L3 \&quot;$MERGED (Remote)\&quot; -o \&quot;$MERGED\&quot; \&quot;$BASE\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot;&#xA;&#xA;[credential]&#xA;    helper = osxkeychain&#xA;&#xA;[filter &quot;lfs&quot;]&#xA;    clean = git-lfs clean %f&#xA;    smudge = git-lfs smudge %f&#xA;    required = true&#xA;&#xA;[commit]&#xA;    template = /Users/nick/.gitCommitMessage&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11895" LastEditorUserId="25" LastEditDate="2016-05-02T19:47:10.960" LastActivityDate="2016-05-02T19:47:10.960" Title="Magit fails, status contains weird characters" Tags="|magit|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21984" PostTypeId="2" ParentId="21180" CreationDate="2016-05-01T17:31:26.657" Score="3" Body="&lt;p&gt;If you want the file &quot;rendered&quot;, you can use the web browser eww - just do &lt;code&gt;M-x eww RET url RET&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-05-01T17:31:26.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21985" PostTypeId="2" ParentId="21502" CreationDate="2016-05-01T18:15:42.040" Score="2" Body="&lt;p&gt;You can't do this with the t&lt;code&gt;%^&lt;/code&gt; template format strings.  You can however call &lt;code&gt;org-set-property&lt;/code&gt; when your template is constructed using the &lt;code&gt;%(func)&lt;/code&gt; syntax.  When called interactively &lt;code&gt;org-set-property&lt;/code&gt; prompts for both the property and the value.  Here's a simple example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;  '((&quot;P&quot; &quot;Property&quot; entry&#xA;     &quot;* %? %(call-interactively #'org-set-property)&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-05-01T18:15:42.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21986" PostTypeId="1" CreationDate="2016-05-01T18:26:32.530" Score="2" ViewCount="410" Body="&lt;p&gt;I have a problem with my org-agendas. I have tried to sort my todo's&#xA;in each agenda view after their scheduled date, but that does not&#xA;function. I use the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '(&#xA;     (&quot;d&quot; &quot;daily &quot;(&#xA;        (tags-todo &quot;TODO={TODO}+SCHEDULED&amp;lt;=\&quot;&amp;lt;today&amp;gt;\&quot;+PRIORITY={B} &quot;  (&#xA;        (org-agenda-sorting-strategy '(scheduled-down))&#xA;        ))&#xA;  ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The todo's does not get sorted after scheduled date, but are listen totally unrelated to it. Can anybody tell me why my code does not sort after scheduled date? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance :)&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2016-05-03T20:32:56.917" Title="How to sort my todo's in org-agenda based on scheduled date?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21987" PostTypeId="2" ParentId="18707" CreationDate="2016-05-01T18:36:01.030" Score="1" Body="&lt;p&gt;There is a package on Melpa that may be useful:&#xA;&lt;code&gt;orgtbl-show-header&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11716" LastActivityDate="2016-05-01T18:36:01.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21988" PostTypeId="1" AcceptedAnswerId="22062" CreationDate="2016-05-01T19:23:42.890" Score="4" ViewCount="3340" Body="&lt;p&gt;I want to use org-agenda to show todo's with scheduled date or deadline date within at certain time interval. For instance, I want to show todo's with deadline between today and one week ahead (today +7d). I have tried to do this by the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq org-agenda-custom-commands '(&#xA;   (&quot;d&quot; &quot;daily &quot;(&#xA;     (tags-todo &quot;+DEADLINE&amp;gt;=\&quot;&amp;lt;today&amp;gt;\&quot; +DEADLINE&amp;lt;=\&quot;&amp;lt;today + 7d&amp;gt;\&quot; (&#xA;        (org-agenda-sorting-strategy '(todo-state-down))&#xA;        ))&#xA;  ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the code does not give what I want, instead my agenda show all todo's with deadline in the future, not only those with deadline between today and one week forward. How can I make org-agenda only show todo's for a certain time interval? Thanks for any answer :)&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2016-05-04T21:57:46.023" Title="Org-agenda: how to show todo's with scheduled date within a time interval?" Tags="|org-mode|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21990" PostTypeId="2" ParentId="21896" CreationDate="2016-05-01T23:05:26.433" Score="2" Body="&lt;p&gt;Emacs utilises TAGS files by visiting them and searching through their contents for the tag you're looking for. So no, you can't avoid visiting the TAGS file if you're utilising it. (If you're not, then just don't generate it; but I assume you want it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider using GNU Global instead, which queries its database with an external tool, and therefore does not require the database to be visited by Emacs. If it's compatible with your project, it will undoubtedly be faster and more convenient than dealing with a TAGS file of that size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Failing that, you might be able to usefully reduce the size of your TAGS file if you don't actually need to index everything that is currently being indexed. You'll need to read the etags/ctags documentation to determine what you can do in this respect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also several options for ctags itself -- GNU etags/ctags which comes with Emacs; Exuberant Ctags (which I've long used in preference to the GNU version); and these days there is &lt;a href=&quot;https://ctags.io&quot; rel=&quot;nofollow&quot;&gt;https://ctags.io&lt;/a&gt; which sounds to me like it's the best maintained successor to Exuberant Ctags (although I've yet to try it myself). These may offer varying options for limiting what you index.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-05-01T23:14:31.430" LastActivityDate="2016-05-01T23:14:31.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21991" PostTypeId="2" ParentId="21965" CreationDate="2016-05-02T06:31:51.467" Score="2" Body="&lt;p&gt;I realize I am answering my own question. But leaving it here so that it is helpful for someone in the future.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It turns out it was a quirk with the IMAP server I was using. (URL in the question)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had to turn on &quot;Expunge immediately&quot; option in the Server settings for the changes from mu4e to reflect on the server.&lt;/p&gt;&#xA;" OwnerUserId="11877" LastActivityDate="2016-05-02T06:31:51.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21992" PostTypeId="1" CreationDate="2016-05-02T06:43:28.357" Score="4" ViewCount="329" Body="&lt;p&gt;Possibly a bug: When using &lt;code&gt;:EXPORT_LATEX_HEADER:&lt;/code&gt; in a subtree's &lt;code&gt;:PROPERTIES:&lt;/code&gt; it overrides all the buffer-level &lt;code&gt;#+LATEX_HEADER:&lt;/code&gt; commands as well as everything given in an external file with &lt;code&gt;#+SETUPFILE:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when having something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SETUPFILE: setup.org&#xA;#+LATEX_HEADER: \command1&#xA;&#xA;* Headline&#xA;  :PROPERTIES:&#xA;  :EXPORT_LATEX_HEADER: \command2&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All you get in the exported .tex file is &lt;code&gt;\command2&lt;/code&gt; in the header, without &lt;code&gt;\command1&lt;/code&gt; and nothing from the setup file. Feature or bug, and if feature, how to unfeature it?&lt;/p&gt;&#xA;" OwnerUserId="10460" LastActivityDate="2016-05-02T06:43:28.357" Title="Prevent :EXPORT_LATEX_HEADER: in a subtree from overriding all buffer #+LATEX_ lines" Tags="|org-mode|org-export|latex|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21993" PostTypeId="1" CreationDate="2016-05-02T06:54:13.597" Score="1" ViewCount="127" Body="&lt;p&gt;Whenever the R process redirect new output to the process buffer, Emacs move the point to the end of the buffer. This is annoy when user want to check previous commands or output that are outside of the window. How to stop Emacs doing this? Could the solution applied to all the shell process, like python, shell etc? &lt;/p&gt;&#xA;" OwnerUserId="4044" LastEditorUserId="253" LastEditDate="2016-05-04T21:23:36.343" LastActivityDate="2016-05-04T21:23:36.343" Title="ESS - stop move point to end when the buffer is updated" Tags="|ess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21995" PostTypeId="2" ParentId="21862" CreationDate="2016-05-02T07:01:22.330" Score="1" Body="&lt;p&gt;As far as I undertood your question you want to hide the minibuffer while helm is active. To do that you have to set &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq helm-echo-input-in-header-line t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can hide the minibuffer while helm is active by using the following&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun helm-hide-minibuffer-maybe () &#xA;  &quot;https://www.reddit.com/r/emacs/comments/3asbyn/new_and_very_useful_helm_feature_enter_search/&quot;&#xA;  (when (with-helm-buffer helm-echo-input-in-header-line)&#xA;    (let ((ov (make-overlay (point-min) (point-max) nil nil t)))&#xA;      (overlay-put ov 'window (selected-window))&#xA;      (overlay-put ov 'face (let ((bg-color (face-background 'default nil)))&#xA;                              `(:background ,bg-color :foreground ,bg-color)))&#xA;      (setq-local cursor-type nil))))&#xA;&#xA;(add-hook 'helm-minibuffer-set-up-hook 'helm-hide-minibuffer-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2016-05-02T07:01:22.330" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21996" PostTypeId="1" CreationDate="2016-05-02T08:51:18.680" Score="4" ViewCount="420" Body="&lt;p&gt;I search for a solution to reference (preferably automatically) radio targets, which are used in plural form in text blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, given the radio target &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;message&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt;, uses of &lt;code&gt;message&lt;/code&gt; in the text are automatically linked to the radio target. However, the plural form &lt;code&gt;messages&lt;/code&gt; will not be linked. I tried to use internal links &lt;code&gt;[[message]]s&lt;/code&gt; with no success (the link can resolved, but why is this so?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only workaround I can think of is explicitly addin a link target &lt;code&gt;&amp;lt;&amp;lt;messages&amp;gt;&amp;gt;&lt;/code&gt;. However, I still have to insert the link manually.&#xA;What makes thins worse is, that the link works in org-mode, but after html export the link references to a random footnote.&#xA;Exports to odt are better, however the text is replaced by a number. So i would have to insert &lt;code&gt;[[messages][messages]]&lt;/code&gt;. That looks ugly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would dream of haveing the ability to note plural version in radio target, e.g. &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;message|messages&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; with only message being inserted visually.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2022-08-23T07:28:03.687" Title="Use org-mode radio targets plural" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21997" PostTypeId="1" CreationDate="2016-05-02T08:58:23.937" Score="4" ViewCount="420" Body="&lt;p&gt;I want to have line number at buffer, but when I use Emacs server, the Message buffer display the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid face reference: font-lock-comment-delimiter-face [2 times]&#xA;Invalid face reference: linum&#xA;Invalid face reference: font-lock-comment-face&#xA;Invalid face reference: font-lock-comment-delimiter-face&#xA;Invalid face reference: font-lock-comment-face&#xA;Invalid face reference: font-lock-comment-delimiter-face&#xA;Invalid face reference: font-lock-comment-face&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I found out linum is designed to use after frame is created. So I add such hook in my &lt;code&gt;.emacs&lt;/code&gt; file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-turn-on-linum-mode (frame)&#xA;  &quot;My function to turn on linum mode.&quot;&#xA;  (with-selected-frame frame&#xA;    (linum-mode 1))) &#xA;&#xA;(if (daemonp)&#xA;    (progn&#xA;      (add-hook 'after-make-frame-functions 'my-turn-on-linum-mode))&#xA;  (global-linum-mode 1)) ;;; if not daemon, just do it&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then if I start with &lt;code&gt;emacs --daemon&lt;/code&gt; and open clients, it works fine for the first client I open, either graphic or terminal mode. It also works good no matter how many times when I open graphic frames. However, if I open client in terminal mode for the second time, the same error emergences. The error continues to show up if I open client in terminal mode further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm really frustrated after 10 hours' digging. Maybe I should learn Lisp seriously? Any suggestions are appreciated!&lt;/p&gt;&#xA;" OwnerUserId="10356" LastEditorUserId="10356" LastEditDate="2016-05-02T09:03:32.150" LastActivityDate="2016-05-02T09:03:32.150" Title="&quot;Invalid face reference: linum&quot; even load linum after make frame" Tags="|faces|font-lock|term|linum-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21998" PostTypeId="2" ParentId="21993" CreationDate="2016-05-02T09:30:58.067" Score="4" Body="&lt;p&gt;This behavior is controlled by &lt;code&gt;comint-scroll-to-bottom-on-output&lt;/code&gt;. It's &lt;code&gt;nil&lt;/code&gt; by default. You probably configured it to a different value accidentally.&lt;/p&gt;&#xA;" OwnerUserId="5497" LastActivityDate="2016-05-02T09:30:58.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21999" PostTypeId="1" AcceptedAnswerId="22007" CreationDate="2016-05-02T10:04:55.013" Score="1" ViewCount="990" Body="&lt;p&gt;I want hs-minor-mode features, I chose it amongst many options I reviewed. How to make it work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only package I have atm is web-mode. I put this line in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(hs-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error on Emacs startup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Fundamental Mode doesn't support Hideshow Minor Mode&quot;)&#xA;  signal(error (&quot;Fundamental Mode doesn't support Hideshow Minor Mode&quot;))&#xA;  error(&quot;%s Mode doesn't support Hideshow Minor Mode&quot; &quot;Fundamental&quot;)&#xA;  hs-grok-mode-type()&#xA;  hs-minor-mode()&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/Miguel/.emacs&quot; nil t)  ; Reading at buffer position 1759&#xA;  load-with-code-conversion(&quot;/home/Miguel/.emacs&quot; &quot;/home/Miguel/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11856" LastActivityDate="2016-05-02T16:00:19.240" Title="Fundamental mode doesn't support HideShow minor mode" Tags="|code-folding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22000" PostTypeId="2" ParentId="4279" CreationDate="2016-05-02T10:51:10.280" Score="37" Body="&lt;p&gt;You should customize &lt;code&gt;org-export-backends&lt;/code&gt; and enable the markdown backend.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x customize-option&lt;/code&gt; and then &lt;code&gt;org-export-backends&lt;/code&gt; and then arrow down to the checkbox to the left of 'md' and press enter to enable it (or just click on it, if running emacs graphically). Then arrow back up and over to 'Apply and Save' (or click on it).&lt;/p&gt;&#xA;&lt;p&gt;After customizing, run &lt;code&gt;M-x org-md-export-to-markdown&lt;/code&gt;. Now you should have a new markdown file in the same directory which is an export of the original org mode file.&lt;/p&gt;&#xA;" OwnerUserId="934" LastEditorUserId="15597" LastEditDate="2021-03-18T16:33:55.587" LastActivityDate="2021-03-18T16:33:55.587" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="22001" PostTypeId="1" AcceptedAnswerId="52022" CreationDate="2016-05-02T11:12:46.240" Score="3" ViewCount="110" Body="&lt;p&gt;Is there a way to configure the imenu integration in ESS-mode so that it recognizes assignment by the equal sign &quot;=&quot;, not only by arrow &quot;&amp;lt;-&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm switching between R and python so I've switched to &quot;=&quot; to decrease the cognitive load, but this way I loose the imenu functionality...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2019-08-06T12:42:14.283" Title="imenu in ess-mode: recognize assignment with &quot;=&quot;" Tags="|ess|imenu|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22002" PostTypeId="1" CreationDate="2016-05-02T11:19:24.110" Score="2" ViewCount="172" Body="&lt;p&gt;I'm editing an XML with nXML-mode. The file represents a document and has internal links of the form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Follow &amp;lt;linktag docref=&quot;foo&quot;&amp;gt;this link&amp;lt;/linktag&amp;gt; to&#xA;see &amp;lt;anchortag docref=&quot;foo&quot;&amp;gt;this text&amp;lt;/anchortag&amp;gt;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where linktag is one of &lt;code&gt;toc1, toc2, toc 3, a&lt;/code&gt;, and anchortag is one of &lt;code&gt;document, page&lt;/code&gt; (possibly others, I'd need to check).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a good way to navigate between back and forth between an anchored text and the various links that point to it ?&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-05-02T11:19:24.110" Title="Navigating in an nXML buffer" Tags="|navigation|nxml|xml|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22004" PostTypeId="2" ParentId="21976" CreationDate="2016-05-02T12:17:13.637" Score="2" Body="&lt;p&gt;&lt;code&gt;symbol-function&lt;/code&gt; can return an actual function object for the&#xA;argument symbol, which would be displayed as its printed&#xA;representation (either a lambda form or compiled byte-code -- but&#xA;you could load the uncompiled version of the library to avoid the&#xA;latter).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely, it returns the value of the symbol's function&#xA;cell. Besides a function object, other common values are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;auto-load objects: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Autoload Type&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;symbols: &lt;code&gt;(elisp) Function Indirection&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;keyboard macros: &lt;code&gt;(elisp) Keyboard Macros&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Strictly speaking, I believe a function cell can contain &lt;em&gt;any&lt;/em&gt; value,&#xA;but some types are rather more expected than others.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-02T12:17:13.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22005" PostTypeId="1" CreationDate="2016-05-02T12:58:26.603" Score="1" ViewCount="326" Body="&lt;p&gt;Is there a way to limit the targets that are offered for &lt;code&gt;org-refile&lt;/code&gt; to the currently visible sub-tree in a buffer that has been created with &lt;code&gt;org-tree-to-indirect&lt;/code&gt; or &lt;code&gt;org-narrow-to-subtree&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to make re-organizing entries easier in a file with several large sub-trees.&lt;/p&gt;&#xA;" OwnerUserId="9481" LastActivityDate="2016-05-02T21:03:58.053" Title="Limit targets for org-refile in narrowed/indirect buffers" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22006" PostTypeId="1" AcceptedAnswerId="22254" CreationDate="2016-05-02T15:10:21.747" Score="2" ViewCount="1899" Body="&lt;p&gt;I'm currently struggling to set up error checking for rust in emacs.&#xA;  Flycheck seems to work fine with other languages (C, Python, Ruby, eLisp) but doesn't appear to do anything in rust-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't noticed any error messages, but when I run flycheck-verify-setup, I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Syntax checkers for buffer state.rs in rust-mode:&#xA;&#xA;  rust-cargo&#xA;    - predicate:  nil&#xA;    - executable: Not found&#xA;&#xA;  rust&#xA;    - predicate:  nil&#xA;    - executable: Not found&#xA;&#xA;Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled&#xA;checkers.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried manually setting the executable but wasn't sure about the predicate, and was concerned that I'd be interfering with flycheck-rust-setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The current configuration code I have written concerning this is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq exec-path (append exec-path '(&quot;/Users/jac32/.cargo/bin&quot;)))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.rs\\'&quot; . rust-mode))&#xA;&#xA;;; Set path to racer binary &#xA;(setq racer-cmd &quot;/usr/local/bin/racer&quot;)&#xA;&#xA;;; Set path to rust src directory&#xA;(setq racer-rust-src-path &quot;/Users/jac32/.rust/src/&quot;)&#xA;&#xA;(add-hook 'rust-mode-hook #'racer-mode)&#xA;(add-hook 'racer-mode-hook #'eldoc-mode)&#xA;(add-hook 'rust-mode-hook&#xA;     (lambda ()&#xA;         (setq flycheck-mode-hook #'flycheck-rust-setup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And my current setup loads all of the following packages:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar required-packages&#xA;  '(&#xA;     base16-theme&#xA;     company&#xA;     company-racer&#xA;     evil&#xA;     flycheck&#xA;     flycheck-rust&#xA;     helm&#xA;     magit&#xA;     rainbow-delimiters&#xA;     rust-mode&#xA;     racer&#xA;     yasnippet&#xA;  ) &quot;a list of packages to ensure are installed at launch.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you for any and all help on this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;update&lt;/em&gt;&#xA;Just discovered that the rustc and cargo executables were not located anywhere within the exec-path variable. Under flycheck-verify-setup, both checker executables are found and the predicate for rust-cargo is t. However, resetting flycheck-mode now causes the following message to appear:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Suspicious state from syntax checker rust-cargo: Checker rust-cargo&#xA;returned non-zero exit code 101, but no errors from output: Could not             &#xA;execute process `rustc -vV` (never executed)&#xA;&#xA;Caused by:&#xA; No such file or directory (os error 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11903" LastEditorUserId="675" LastEditDate="2016-05-02T15:52:08.670" LastActivityDate="2016-06-12T21:52:42.563" Title="Flycheck and Rust" Tags="|init-file|flycheck|rust|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22007" PostTypeId="2" ParentId="21999" CreationDate="2016-05-02T16:00:19.240" Score="5" Body="&lt;p&gt;&lt;code&gt;hs-minor-mode&lt;/code&gt; is a minor mode. Like most minor modes, it is buffer-specific and should be activated in each buffer where you want it. The error message you have is because the code you added to your init file activates (or tries to activate) &lt;code&gt;hideshow&lt;/code&gt; when your init file loads, which is way too early : at that moment, the current buffer is most certainly some temporary buffer, and it doesn't make sense to activate &lt;code&gt;hideshow&lt;/code&gt; there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your actual question is : how do I activate &lt;code&gt;hideshow&lt;/code&gt; ? The answer depends a bit on when you want to activate it. You probably want to activate it for some specific files/buffers, e.g. all emacs-lisp buffers. Then you would add the following to your init file :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-05-02T16:00:19.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22008" PostTypeId="2" ParentId="21983" CreationDate="2016-05-02T16:32:35.250" Score="7" Body="&lt;p&gt;Git has the ability to detect in many cases whether its output is being printed to a terminal, or piped to another process.  When it is being printed to a terminal, you have the option of using ascii escape sequences to provide text formatting and coloring.  However, most programs are not set up to handle these escape sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By specifying the &lt;code&gt;--color=always&lt;/code&gt; argument or setting &lt;code&gt;color.ui = always&lt;/code&gt; in your config, you are telling git to &lt;em&gt;always&lt;/em&gt; add the ascii escape sequences for coloring.  Since magit does not know how to parse these sequences, it stops working properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, use the &lt;code&gt;--color=auto&lt;/code&gt; argument or set &lt;code&gt;color.ui = auto&lt;/code&gt; in your config file to tell git to apply coloring, &lt;em&gt;but only in cases where it makes sense&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-05-02T16:32:35.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22009" PostTypeId="1" AcceptedAnswerId="22011" CreationDate="2016-05-02T16:36:17.263" Score="4" ViewCount="756" Body="&lt;p&gt;I have a fresh install of Emacs 24.5.1 on OS X 10.11.2 and when I install prelude (&lt;a href=&quot;https://github.com/bbatsov/prelude&quot;&gt;https://github.com/bbatsov/prelude&lt;/a&gt;) via the recommended auto-magic way (curl -L &lt;a href=&quot;https://git.io/epre&quot;&gt;https://git.io/epre&lt;/a&gt; | sh) then open emacs I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/Users/caseyallred/.emacs.d/init.el':&#xA;&#xA;error: Package `anzu-' is unavailable&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If i then run &lt;code&gt;M-x list-packages&lt;/code&gt; it says that it &lt;code&gt;Failed to download `melpa` archive&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a bit of Emacs noob and I have no idea how to fix it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="11904" LastActivityDate="2016-05-02T17:11:31.107" Title="Fresh install of emacs 24.5.1 and Prelude not working because melpa wont download on OS X 10.11.2" Tags="|package-repositories|prelude|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22010" PostTypeId="2" ParentId="22009" CreationDate="2016-05-02T17:09:16.560" Score="4" Body="&lt;p&gt;MELPA is apparently having &lt;a href=&quot;https://github.com/melpa/melpa/issues/3833&quot; rel=&quot;nofollow&quot;&gt;issues&lt;/a&gt; at the moment.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-02T17:09:16.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22011" PostTypeId="2" ParentId="22009" CreationDate="2016-05-02T17:11:31.107" Score="5" Body="&lt;p&gt;It seems that it's not a problem of your install but an issue on the Melpa side.&#xA;I've tracked the issue down as far as that the file &quot;archive-contents&quot; that Emacs tries to download from Melpa is currently corrupt / truncated:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://melpa.org/packages/archive-contents&quot;&gt;http://melpa.org/packages/archive-contents&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Guess we'll have to wait until the Melpa guys do something about it.&lt;/p&gt;&#xA;" OwnerUserId="11905" LastActivityDate="2016-05-02T17:11:31.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22012" PostTypeId="2" ParentId="21949" CreationDate="2016-05-02T21:00:54.070" Score="-1" Body="&lt;p&gt;This has been covered before:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/2010539/how-can-i-show-the-org-mode-agenda-on-emacs-start-up&quot;&gt;https://stackoverflow.com/questions/2010539/how-can-i-show-the-org-mode-agenda-on-emacs-start-up&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The top answer on that occasion was the answer posted by Emacs User.&lt;/p&gt;&#xA;" OwnerUserId="737" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-05-02T21:00:54.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22013" PostTypeId="2" ParentId="22005" CreationDate="2016-05-02T21:03:58.053" Score="1" Body="&lt;p&gt;I don't believe this is possible, alas. Setting &lt;code&gt;org-refile-targets&lt;/code&gt; to something like &lt;code&gt;((nil . (:maxlevel . 5)))&lt;/code&gt; will make sure you're only offered targets from the original buffer, but both the indirect buffer and the narrowed view source their completion headings from the source buffer, alas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you haven't already changed the value of &lt;code&gt;org-refile-targets&lt;/code&gt;, then the configuration I mention above will be very much like the default of &lt;code&gt;((nil . (:level . 1)))&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My best suggestion, frankly, is &lt;code&gt;helm&lt;/code&gt; -- perhaps you are already using it? With helm fuzzy-matching, I find it very fast to narrow my subtree selection to a given path, even with a large number of large subtrees available.&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-05-02T21:03:58.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22014" PostTypeId="2" ParentId="9815" CreationDate="2016-05-02T21:11:09.620" Score="2" Body="&lt;p&gt;There is &lt;a href=&quot;https://github.com/baohaojun/org-jira&quot; rel=&quot;nofollow&quot;&gt;org-jira&lt;/a&gt; which got recently support for the REST API in a separate &lt;a href=&quot;https://github.com/baohaojun/org-jira/commits/restapi&quot; rel=&quot;nofollow&quot;&gt;restapi branch&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Haven't had the time to test it myself yet, though.  Just happened to be looking for something like this some time ago.&lt;/p&gt;&#xA;" OwnerUserId="9309" LastActivityDate="2016-05-02T21:11:09.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22015" PostTypeId="1" AcceptedAnswerId="22019" CreationDate="2016-05-02T21:36:10.493" Score="2" ViewCount="474" Body="&lt;p&gt;I'm using &lt;code&gt;use-package&lt;/code&gt; and I want my &lt;code&gt;fill-column&lt;/code&gt; to be set to &lt;code&gt;100&lt;/code&gt; for files edited with &lt;code&gt;js2-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to do so in the &lt;code&gt;:config&lt;/code&gt; part, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package js2-mode&#xA;  :config&#xA;  (setq fill-column 100))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(among other configuration) but it didn't work, &lt;code&gt;fill-column&lt;/code&gt; was still &lt;code&gt;70&lt;/code&gt; after loading a JS file (which activated &lt;code&gt;js2-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I made it work was by setting &lt;code&gt;fill-column&lt;/code&gt; inside a hook like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package js2-mode&#xA;  :preface&#xA;  (defun me/js2-hook ()&#xA;    (setq fill-column 100))&#xA;  :config&#xA;  (add-hook 'js2-mode-hook #'me/js2-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, my question is, what was wrong with setting &lt;code&gt;fill-column&lt;/code&gt; straight into &lt;code&gt;:config&lt;/code&gt;?  Why is the hook required?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9309" LastActivityDate="2016-05-03T04:19:11.183" Title="use-package and js2-mode: setting fill-column" Tags="|use-package|js2-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22016" PostTypeId="1" AcceptedAnswerId="22017" CreationDate="2016-05-02T23:00:17.293" Score="0" ViewCount="261" Body="&lt;p&gt;Is there a way to specify seconds when starting the orgmode countdown timer? I've tried using fractions of a minute, such as 1.5, but it disregards anything after the first digit.&lt;/p&gt;&#xA;" OwnerUserId="11908" LastActivityDate="2016-05-03T00:03:17.187" Title="Orgmode Countdown Timer Seconds" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22017" PostTypeId="2" ParentId="22016" CreationDate="2016-05-03T00:03:17.187" Score="0" Body="&lt;p&gt;With Org version 8.3* you can specify time as &lt;code&gt;hh:mm:ss&lt;/code&gt;, letting&#xA;you enter, say, &lt;code&gt;:30&lt;/code&gt; for 30 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;* Specifically commit 93cc5fb (org-timer.el: hh:mm:ss format for&#xA;  setting a timer, 2015-06-02)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2016-05-03T00:03:17.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22018" PostTypeId="2" ParentId="21386" CreationDate="2016-05-03T01:25:48.900" Score="-2" Body="&lt;p&gt;Install evil, evil-leader, and set up your commands' key bindings to use leader key as much as possible. This solution works &lt;em&gt;everywhere&lt;/em&gt; (mintty/cygwin on windows, xterm/rxvt on Linux, terminal.app on OSX). spacemacs uses similar leader key solution, so the easiest way is use spacemacs.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-05-03T01:25:48.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22019" PostTypeId="2" ParentId="22015" CreationDate="2016-05-03T04:19:11.183" Score="2" Body="&lt;p&gt;&lt;code&gt;fill-column&lt;/code&gt; immediately becomes buffer-local when set. So, when your config is evaluated, that buffer's &lt;code&gt;fill-column&lt;/code&gt; is set... but then nothing else happens. If you set it with a hook, then &lt;code&gt;fill-column&lt;/code&gt; will be set any time that hook is fired -- that is, every time a new buffer is created in &lt;code&gt;js2-mode&lt;/code&gt;, and then &lt;code&gt;fill-column&lt;/code&gt; will be set for that buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can, if you want, change the global &lt;em&gt;default&lt;/em&gt; value of &lt;code&gt;fill-column&lt;/code&gt; from 70 (which is silly) to another number, outside of &lt;code&gt;use-package&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default fill-column 79)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-05-03T04:19:11.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22020" PostTypeId="1" CreationDate="2016-05-03T05:55:24.303" Score="2" ViewCount="905" Body="&lt;p&gt;My 1st question on Stack (＞﹏＜)!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I write my homework in org-mode, I want to use the literate programming with org-babel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I use python as the major language to calculate the results I need in the org file. I use inline call(&lt;code&gt;#+call:&lt;/code&gt; or &lt;code&gt;call_&amp;lt;function-name&amp;gt;&lt;/code&gt;) with different arguments to realize different functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I find that &lt;code&gt;#+call:&lt;/code&gt; adds an extra newline between in the results block. To avoid that , I use &lt;code&gt;call_&amp;lt;function-name&amp;gt;&lt;/code&gt; as an inline call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But my functions take time to execute, so I want to cache the results of function calls to avoid delays. &lt;strong&gt;But with the call, &lt;code&gt;call_&amp;lt;function-name&amp;gt;[:cache yes]&lt;/code&gt;, the results are not cached.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is the original function: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: Daoqiex00&#xA;#+begin_src python :var R0=10 N=19 :exports none :results value :cache yes&#xA;import numpy as np&#xA;return np.cosh(1/(N-1)*np.arccosh(R0))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the inline call is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;We will find \(x_{0}=\) call_Daoqiex00(R0=10,N=19)[:results value raw :cache yes].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make this inline call cache the results? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This has been tested on emacs 24.5, using org 8.2.10)&lt;/p&gt;&#xA;" OwnerUserId="11809" LastEditorUserId="7045" LastEditDate="2016-05-03T06:38:44.950" LastActivityDate="2016-05-03T17:20:07.500" Title="How to use &quot;cache&quot; argument in inline-call of org-babel?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22021" PostTypeId="2" ParentId="22020" CreationDate="2016-05-03T06:29:44.297" Score="3" Body="&lt;p&gt;Caching is not possible for inline functions as per the remarks the in the org-babel manual (see excerpt):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In order for caching to work (i.e., no evaluation when triggered either interactively or during export), the results of the code block must be present in the Org mode file: you must first evaluate it manually, leaving the results (with the hash tag) saved within the Org mode file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One workaround is to make another src block with your function that stores the result. Then use an inline function to call this src block, which will be faster because there is no re-calculation, just re-reading the result. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: cachedFunction&#xA;#+BEGIN_SRC python :cache yes&#xA;x = 18&#xA;return x&#xA;#+END_SRC&#xA;&#xA;#+name: uncachedFunction&#xA;#+BEGIN_SRC python :var x=cachedFunction&#xA;return int(x)&#xA;#+END_SRC&#xA;&#xA;Now any calls to call_uncachedFunction() will get the cached value from cachedFunction.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the block I use for just those org files that need caching:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src emacs-lisp :cache yes&#xA;   (setq org-babel-default-header-args '((:session . &quot;none&quot;)&#xA;                                         (:results . &quot;replace&quot;)&#xA;                                         (:exports . &quot;code&quot;)&#xA;                                         (:cache)))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Lastly, when caching works, you will see the hash tag with the results line, below the src block, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS[84d9...]:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-05-03T17:20:07.500" LastActivityDate="2016-05-03T17:20:07.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22023" PostTypeId="2" ParentId="21977" CreationDate="2016-05-03T08:24:05.590" Score="2" Body="&lt;p&gt;Add the following line to your &lt;code&gt;init.el&lt;/code&gt; file before you require the package &lt;code&gt;(require 'bookmark+)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11809" LastEditorUserId="1979" LastEditDate="2016-07-27T21:30:44.527" LastActivityDate="2016-07-27T21:30:44.527" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22025" PostTypeId="1" AcceptedAnswerId="22027" CreationDate="2016-05-03T10:12:03.047" Score="2" ViewCount="683" Body="&lt;p&gt;I have (somewhat) successfully installed and configured &lt;code&gt;web-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But one thing doesn't work /w (react.js) JSX: I'm doing a project that requires the files to have the suffix &lt;code&gt;'.js'&lt;/code&gt; and I'm trying to override the built-in &lt;code&gt;js-mode&lt;/code&gt; assigned to them. I have gotten to having &lt;code&gt;web-mode&lt;/code&gt; loaded for them (mode part of modeline says &lt;code&gt;(Web ARev yas Trim)&lt;/code&gt;), but tag coloring and indentation doesn't work for &lt;code&gt;.js&lt;/code&gt; suffixed files, but does for &lt;code&gt;.jsx&lt;/code&gt; suffixed ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;web-mode&lt;/code&gt; loading and configuration currently looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'web-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.js\\'&quot; . web-mode)) ;; Override?&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.jsx\\'&quot; . web-mode))&#xA;&#xA;(defun my-web-mode-hook ()&#xA;  &quot;web-mode settings&quot;&#xA;  (setq web-mode-markup-indent-offset 2)&#xA;  (setq web-mode-css-indent-offset 2)&#xA;  (setq web-mode-code-indent-offset 2))&#xA;(add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anything obviously wrong? (Perhaps naively) it looks to me like the &lt;code&gt;js-mode&lt;/code&gt; major mode is loaded first, and only afterwards &lt;code&gt;web-mode&lt;/code&gt;, which doesn't manage to &quot;take over&quot; the buffer completely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I could look at the system sources and erase all configuration of &lt;code&gt;js-mode&lt;/code&gt; from there, but that sounds too heavy-handed in my ears, so I'd prefer to avoid that, and I'm not even sure my theory about loading order is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.5.1 on OS X installed via Homebrew.&lt;/p&gt;&#xA;" OwnerUserId="708" LastEditorUserId="708" LastEditDate="2016-05-03T10:25:51.353" LastActivityDate="2016-05-03T11:02:02.827" Title="web-mode for .js suffixed files" Tags="|web-mode|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22026" PostTypeId="1" AcceptedAnswerId="22029" CreationDate="2016-05-03T10:21:19.273" Score="4" ViewCount="134" Body="&lt;p&gt;I start a tramp dired session to a remote host with &lt;code&gt;C-x d /ssh:user@host:/&lt;/code&gt; and then start eshell with &lt;code&gt;M-x eshell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This places me at the dired path on the remote host, however as soon as I try to &lt;code&gt;cd&lt;/code&gt; or get path autocompletion my session then changes to my localhost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the intended functionality? How can I make eshell remain on the remote host?&lt;/p&gt;&#xA;" OwnerUserId="11159" LastActivityDate="2016-05-03T11:53:46.270" Title="remote tramp eshell session changes to localhost" Tags="|tramp|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22027" PostTypeId="2" ParentId="22025" CreationDate="2016-05-03T11:02:02.827" Score="1" Body="&lt;p&gt;you can use this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq web-mode-content-types-alist&#xA;  '((&quot;jsx&quot;  . &quot;/some/react/path/.*\\.js[x]?\\'&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="197" LastActivityDate="2016-05-03T11:02:02.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22028" PostTypeId="1" CreationDate="2016-05-03T11:06:18.097" Score="5" ViewCount="205" Body="&lt;p&gt;I have a couple of background processes that I regularly run, such as mu4e and jabber-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These, and other, processes provide updates to the minibuffer. Unfortunately, they do so when I'm already interacting with the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent this happening, or at least dismiss the message so I can continue interacting with the minibuffer?&lt;/p&gt;&#xA;" OwnerUserId="11159" LastEditorUserId="105" LastEditDate="2016-08-15T01:09:46.170" LastActivityDate="2016-08-15T01:09:46.170" Title="How to stop background processes interrupting minibuffer" Tags="|minibuffer|echo-area|message|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22029" PostTypeId="2" ParentId="22026" CreationDate="2016-05-03T11:53:46.270" Score="3" Body="&lt;p&gt;When you apply &lt;code&gt;cd&lt;/code&gt; in eshell, it uses the Lisp function &lt;code&gt;eshell/cd&lt;/code&gt;. All file names that you give are therefore interpreted like file names in Emacs. Absolute file names, without the remote prefix, correspond to the local file system, therefore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to navigate on the remote host, use relative file names like &lt;code&gt;cd ../foo&lt;/code&gt;. You could use even file name completion in eshell, like &lt;code&gt;cd ../ &amp;lt;TAB&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-05-03T11:53:46.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22031" PostTypeId="1" AcceptedAnswerId="22036" CreationDate="2016-05-03T12:56:08.867" Score="0" ViewCount="2658" Body="&lt;p&gt;I would like to bind &lt;code&gt;M-S-up&lt;/code&gt; to &lt;code&gt;C-u 7 S-up&lt;/code&gt; to move a timestamp a week forward (and &lt;code&gt;down&lt;/code&gt; for back). A modification of &lt;a href=&quot;https://emacs.stackexchange.com/a/21736/5345&quot;&gt;this&lt;/a&gt; answer resulted in a &quot;Symbol is void&quot; error in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried modifying the &lt;code&gt;define-keys&lt;/code&gt; command, but was not successful, as Emacs then stated that &quot;-up&quot; could not follow after &quot;M-S&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure a keybinding in my &lt;code&gt;~/.emacs&lt;/code&gt; file to execute &lt;code&gt;C-u 7 S-up&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I placed the following, modified from the answer linked above, in the scratch buffer and evaluated it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-map (kbd &quot;C-u 7 S-up&quot;) (kbd &quot;M-S-up&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs returned &lt;code&gt;Symbol's value as variable is void: my-map&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-05-03T20:50:07.010" Title="Configuring multiple key bindings" Tags="|key-bindings|keyboard-macros|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22032" PostTypeId="1" AcceptedAnswerId="22038" CreationDate="2016-05-03T13:16:05.087" Score="4" ViewCount="125" Body="&lt;p&gt;I have a keymap which uses &lt;code&gt;[t]&lt;/code&gt; to bind a default command which should be executed if any key not bound in the map is pressed. This is described in the documentation of &lt;code&gt;define-key&lt;/code&gt; and it works for the most part. &lt;strong&gt;BUT&lt;/strong&gt; if I bind a Meta combination in that map, any other Meta key combination will skip this default command from there on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example Code to illustrate the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((map (make-sparse-keymap)))&#xA;  (define-key map (kbd &quot;M-a&quot;) 'some-command)&#xA;  (define-key map [t] (lambda ()&#xA;                        (interactive)&#xA;                        (message &quot;this will be skipped by Meta combinations&quot;)))&#xA;  (set-transient-map map))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to be able to bind a command to a Meta combination, but let other Meta combinations still run the default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to do that?&lt;/p&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2016-05-03T19:06:03.260" LastActivityDate="2016-05-03T21:36:45.117" Title="Respect default action in keymap with Meta keys?" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22034" PostTypeId="1" AcceptedAnswerId="22035" CreationDate="2016-05-03T16:10:49.903" Score="7" ViewCount="2701" Body="&lt;p&gt;I am currently using the normal Evil keybindings (defaults). How do I enter unicode characters such as U+21d2 ⇒ ? In routine applications such as Gedit or Firefox, we can use &lt;code&gt;Ctrl+Shift+U 2 1 d 2&lt;/code&gt; or in Vim, we can use &lt;code&gt;Ctrl+V u 2 1 d 2&lt;/code&gt;. What is the equivalent in Spacemacs? I've tried &lt;code&gt;Ctrl+V u 2 1 d 2&lt;/code&gt; as well as &lt;code&gt;Ctrl+V 2 1 d 2&lt;/code&gt;. The first one just doesn't work whereas the second one stops after two letters.&lt;/p&gt;&#xA;" OwnerUserId="10986" LastActivityDate="2016-05-03T16:10:49.903" Title="How do you enter unicode characters in Spacemacs?" Tags="|spacemacs|unicode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22035" PostTypeId="2" ParentId="22034" CreationDate="2016-05-03T16:10:49.903" Score="8" Body="&lt;p&gt;This answer is written for Spacemacs 0.105.19 with default keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you already know that &lt;code&gt;Ctrl+v&lt;/code&gt; might be one way to do it, you can look at the documentation to understand what it does. In &lt;code&gt;Insert&lt;/code&gt; mode, type &lt;code&gt;Ctrl+h&lt;/code&gt; (help) then &lt;code&gt;k&lt;/code&gt; (for &lt;code&gt;describe-key&lt;/code&gt;) and then &lt;code&gt;Ctrl+v&lt;/code&gt;. Amongst other things, this points out that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The variable `read-quoted-char-radix' specifies the radix for this feature;&#xA;  set it to 10 or 16 to use decimal or hex instead of octal.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can click on &lt;code&gt;read-quoted-char-radix&lt;/code&gt; and it will show you the current value and the default (which is &lt;code&gt;8&lt;/code&gt;). Click on &lt;code&gt;customize&lt;/code&gt; to change the value: set it to &lt;code&gt;16&lt;/code&gt; for hex codes and &lt;code&gt;10&lt;/code&gt; for decimal codes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you've set &lt;code&gt;read-quoted-char-radix&lt;/code&gt; to &lt;code&gt;16&lt;/code&gt;, you can use &lt;code&gt;Ctrl+v 2 1 d 2 RET&lt;/code&gt;  in &lt;code&gt;Insert&lt;/code&gt; mode to put in the ⇒ arrow. Using &lt;code&gt;SPC&lt;/code&gt; instead of &lt;code&gt;RET&lt;/code&gt; will give an extra space unlike other applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In normal editing mode (i.e., not &lt;code&gt;Insert&lt;/code&gt; mode), you can also do a reverse lookup using &lt;code&gt;SPC i u&lt;/code&gt; and typing say &quot;rightwards double arrow&quot; will give you several options such as ⇒ (rightwards double arrow), ⟹ (long rightwards double arrow) etc. You can pick an option and the character will be inserted at the cursor position.&lt;/p&gt;&#xA;" OwnerUserId="10986" LastActivityDate="2016-05-03T16:10:49.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22036" PostTypeId="2" ParentId="22031" CreationDate="2016-05-03T20:32:15.100" Score="2" Body="&lt;p&gt;You can't set a key in a keymap that doesn't exist. In order to use &lt;code&gt;define-key&lt;/code&gt;, you need to know the name of the keymap you're trying to modify. To add a keybinding to the global keymap, you can use &lt;code&gt;global-set-key&lt;/code&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-S-&amp;lt;up&amp;gt;&quot;) (kbd &quot;C-u 7 S-&amp;lt;up&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to modify the keybinding only for org-mode, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;org-mode&quot;&#xA;  '(define-key org-mode-map (kbd &quot;M-S-&amp;lt;up&amp;gt;&quot;) (kbd &quot;C-u 7 S-&amp;lt;up&amp;gt;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-hook ()&#xA;  (local-set-key (kbd &quot;M-S-&amp;lt;up&amp;gt;&quot;) (kbd &quot;C-u 7 S-&amp;lt;up&amp;gt;&quot;)))&#xA;&#xA;(add-hook 'org-mode-hook 'my-org-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-05-03T20:38:55.837" LastActivityDate="2016-05-03T20:38:55.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22037" PostTypeId="2" ParentId="22031" CreationDate="2016-05-03T20:40:48.633" Score="2" Body="&lt;p&gt;The typical approach would be to bind the key to a command, rather than another key sequence. In your case you want to call &lt;code&gt;org-shiftup&lt;/code&gt; with an argument. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;&amp;lt;M-S-up&amp;gt;&quot;)&#xA;   (lambda () (interactive) (org-shiftup 7)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can bind one key sequence to another as in the example you cited. This works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;&amp;lt;M-S-up&amp;gt;&quot;) (kbd &quot;C-u 7 &amp;lt;S-up&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As @Tyler pointed out, when defining keys for a specific mode you generally want to use a mode hook or &lt;code&gt;eval-after-load&lt;/code&gt; so that the key is not defined until the mode's keymap has been defined. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few general tips:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;code&gt;C-h k&lt;/code&gt; to find that S-up is bound to &lt;code&gt;org-shiftup&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;C-h f define-key&lt;/code&gt; to read the doc for &lt;code&gt;define-key&lt;/code&gt;. It looks like you swapped the arguments and may not be familiar with keymaps. &lt;/li&gt;&#xA;&lt;li&gt;As noted in the comments, use &lt;code&gt;C-h k&lt;/code&gt; to see the appropriate key syntax -- when using &lt;code&gt;up&lt;/code&gt;, you need the &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;To really understand key maps and key bindings, refer to the Elisp &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Keymaps.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;. There is also a great overview on &lt;a href=&quot;https://www.masteringemacs.org/article/mastering-key-bindings-emacs&quot; rel=&quot;nofollow&quot;&gt;Mastering Emacs&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-05-03T20:50:07.010" LastActivityDate="2016-05-03T20:50:07.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22038" PostTypeId="2" ParentId="22032" CreationDate="2016-05-03T21:36:45.117" Score="4" Body="&lt;p&gt;For historical reasons, &lt;code&gt;M-key&lt;/code&gt; and &lt;code&gt;ESC key&lt;/code&gt; are mostly treated as equivalent. Physical terminals, and terminal emulators, communicate with the application by sending characters, and there's no character for “meta &lt;em&gt;character&lt;/em&gt;” (whereas &lt;a href=&quot;https://en.wikipedia.org/wiki/ASCII&quot;&gt;ASCII&lt;/a&gt; includes control characters corresponding to &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;letter&lt;/kbd&gt; and a few punctuation characters). Two conventions exist to encode &lt;kbd&gt;Meta&lt;/kbd&gt;+&lt;kbd&gt;character&lt;/kbd&gt;: set the 8th bit on &lt;kbd&gt;character&lt;/kbd&gt; (which is only applicable with a 7-bit character set), or send the &lt;code&gt;ESC&lt;/code&gt; character followed by the character from the keychord.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Graphical terminals send keychords to the application, so they can encode &lt;kbd&gt;Meta&lt;/kbd&gt;+&lt;kbd&gt;character&lt;/kbd&gt; and more generally &lt;kbd&gt;Meta&lt;/kbd&gt;+&lt;kbd&gt;key&lt;/kbd&gt; just fine. However, to preserve compatibility with text terminals, Emacs internally translates &lt;kbd&gt;Meta&lt;/kbd&gt;+&lt;kbd&gt;key&lt;/kbd&gt; to &lt;code&gt;ESC&lt;/code&gt; &lt;kbd&gt;key&lt;/kbd&gt; (or more generally &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Functions-for-Key-Lookup.html#index-meta_002dprefix_002dchar&quot;&gt;&lt;code&gt;meta-prefix-char&lt;/code&gt;&lt;/a&gt; &lt;kbd&gt;key&lt;/kbd&gt; but I suspect that changing &lt;code&gt;meta-prefix-char&lt;/code&gt; would break a lot of modes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, if you're defining a fallback binding in a keymap, include that binding for &lt;code&gt;ESC&lt;/code&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((map (make-sparse-keymap)))&#xA;  (define-key map [?\e t] (lambda ()&#xA;             (interactive)&#xA;             (message &quot;this will be triggered by Meta combinations&quot;)))&#xA;  (define-key map (kbd &quot;M-a&quot;) 'some-command)&#xA;  (define-key map [t] (lambda ()&#xA;                        (interactive)&#xA;                        (message &quot;this will be skipped by Meta combinations&quot;)))&#xA;  (set-transient-map map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-03T21:36:45.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22039" PostTypeId="2" ParentId="14536" CreationDate="2016-05-03T21:48:31.593" Score="0" Body="&lt;p&gt;&lt;code&gt;C-SPC C-f C-insert&lt;/code&gt; does the same thing with more keychords but less modifier shuffling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm struggling to see why you're using this so much:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For characters that you use often, set up a suitable &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Input-Methods.html#Input-Methods&quot; rel=&quot;nofollow&quot;&gt;input method&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;For characters that you use rarely, there's &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Inserting-Text.html#index-insert_002dchar&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;insert-char&lt;/code&gt;&lt;/a&gt;, bound to &lt;code&gt;C-x 8 RET&lt;/code&gt; by default (but a good candidate for a simpler binding such as &lt;code&gt;C-c c&lt;/code&gt; or &lt;code&gt;f8&lt;/code&gt; if you use it often). Inserting a recently-inserted character again is easy by navigating the history.&lt;/li&gt;&#xA;&lt;li&gt;For whole words, you can use &lt;code&gt;M-@ M-w&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;For whole words that start with something easy to type, there's &lt;code&gt;M-/&lt;/code&gt; and &lt;code&gt;C-M-/&lt;/code&gt; (&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Dynamic-Abbrevs.html#Dynamic-Abbrevs&quot; rel=&quot;nofollow&quot;&gt;dynamic abbrevs&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-03T21:48:31.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22040" PostTypeId="2" ParentId="17902" CreationDate="2016-05-04T00:25:51.373" Score="5" Body="&lt;p&gt;The following Emacs mailers are written entirely in Emacs Lisp:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;RMAIL;&lt;/li&gt;&#xA;&lt;li&gt;Gnus;&lt;/li&gt;&#xA;&lt;li&gt;Wanderlust;&lt;/li&gt;&#xA;&lt;li&gt;VM.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following Emacs mailers are mostly written in Lisp, but use some components written in C:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Notmuch;&lt;/li&gt;&#xA;&lt;li&gt;mu4e;&lt;/li&gt;&#xA;&lt;li&gt;MH-E;&lt;/li&gt;&#xA;&lt;li&gt;Mew.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-05-04T00:25:51.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22041" PostTypeId="1" AcceptedAnswerId="22047" CreationDate="2016-05-04T00:31:36.447" Score="1" ViewCount="1059" Body="&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Highlight text that matches the marked region, without the use of any key, but just by having a region marked. Then have two commands to directly move across the highlighted text, forward and backward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; For example if I mark &quot;hello&quot;, automatically highlight all the occurrences that are equal to &quot;hello&quot;. If I mark &quot;hello w&quot;, highlight all the occurrences equal to &quot;hello w&quot;. Then use two keys to move forward and backward respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third key to toggle between three options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Search&lt;/strong&gt; (default): take marked region as the &lt;em&gt;search for&lt;/em&gt; parameter.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Search and replace&lt;/strong&gt;: preserve &lt;em&gt;search for&lt;/em&gt; parameter and prompt for the &lt;em&gt;replace with&lt;/em&gt; parameter.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Search and replace with regexp&lt;/strong&gt;: preserve &lt;em&gt;replace with&lt;/em&gt; parameter and prompt the &lt;em&gt;search for&lt;/em&gt; parameter as the starting point of the regexp.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A basic option would be a command to turn on/off the &quot;on the fly&quot; behavior. A more advanced option would be to use the &quot;on the fly&quot; behavior only for words/symbols/expressions marked in its entirety, or tweak minimum/maximum criteria required to perform automatic search, so that for example making it necessary that the mark have three or more characters, and no more than one line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already use such tool, but not to work the way mentioned (&quot;on the fly&quot;). Such tool is isearch. The best solution would be to use that same tool, but if not, then maybe there is a package or code that implement it in another way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully it does not mess up with multiple cursors, so that multiple cursors have the highlight precedence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is no complete solution, the most approaching is welcomed.&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2016-05-04T19:54:04.247" LastActivityDate="2016-05-05T04:53:33.897" Title="Highlight text equivalent to the marked region and search and replace on the fly" Tags="|search|replace|region|automation|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22042" PostTypeId="2" ParentId="22041" CreationDate="2016-05-04T02:29:17.180" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt; provides these features.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Optional &lt;strong&gt;restriction of search to the active region&lt;/strong&gt;, controlled by option &lt;code&gt;isearchp-restrict-to-region-flag&lt;/code&gt;. Deactivation of the active region is controlled by option &lt;code&gt;isearchp-deactivate-region-flag&lt;/code&gt;. Both of these are available for Emacs 24.3 and later. You can use &lt;strong&gt;&lt;code&gt;C-x n&lt;/code&gt;&lt;/strong&gt; (command &lt;code&gt;isearchp-toggle-region-restriction&lt;/code&gt;) during search to toggle &lt;code&gt;isearchp-restrict-to-region-flag&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;That applies literal search and regexp search.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you also use library &lt;a href=&quot;https://www.emacswiki.org/emacs/ModeLinePosition&quot; rel=&quot;nofollow&quot;&gt;Mode-Line Position&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/modeline-posn.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;modeline-posn.el&lt;/code&gt;&lt;/a&gt;) then not only can you restrict Isearch to the active region but you can keep that restriction when you invoke a query-replacement command from Isearch (e.g. &lt;code&gt;M-%&lt;/code&gt; from Isearch, to use &lt;code&gt;query-replace&lt;/code&gt;). The main job of that library is to show information about the active region in the mode line. And whenever you invoke a replacement command or Isearch for the active region, that region information is highlighted specially. See &lt;a href=&quot;https://www.emacswiki.org/emacs/ModeLinePosition&quot; rel=&quot;nofollow&quot;&gt;Mode-Line Position&lt;/a&gt; for screenshots and more info.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With just Isearch+, you can replace on demand while searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you visit a search hit, you can perform an &lt;em&gt;action&lt;/em&gt; on it. Use &lt;strong&gt;&lt;code&gt;C-M-RET&lt;/code&gt;&lt;/strong&gt; (command &lt;strong&gt;&lt;code&gt;isearchp-act-on-demand&lt;/code&gt;&lt;/strong&gt;) to invoke the action function that is the value of option &lt;code&gt;isearchp-on-demand-action-function&lt;/code&gt;. That function is passed the current search-hit string and its start and end positions in the buffer. Search moves to the next hit in the same search direction, so just &lt;em&gt;repeating &lt;code&gt;C-M-RET&lt;/code&gt; carries out the action on subsequent hits&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default value of &lt;code&gt;isearchp-on-demand-action-function&lt;/code&gt; is function &lt;strong&gt;&lt;code&gt;isearchp-replace-on-demand&lt;/code&gt;&lt;/strong&gt;, which &lt;em&gt;replaces the search hit&lt;/em&gt;. This means that you can replace (or delete) chosen search hits on demand. By default, the replacement string is empty, so with no prefix argument the action is to delete the search hit (replace it with nothing).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With a &lt;em&gt;prefix argument&lt;/em&gt;, &lt;code&gt;isearchp-replace-on-demand&lt;/code&gt; (&lt;code&gt;C-M-RET&lt;/code&gt;) &lt;em&gt;prompts for the replacement&lt;/em&gt;, which is used thereafter until you again use a prefix arg. Since you can use a prefix arg at any time, you can provide &lt;em&gt;different replacements for different search hits&lt;/em&gt;.  When prompted, if you clear the minibuffer and hit &lt;code&gt;RET&lt;/code&gt;, hit replacement just becomes search-hit &lt;em&gt;deletion&lt;/em&gt;. [NOTE: To use a prefix arg within Isearch, you must set &lt;code&gt;isearch-allow-prefix&lt;/code&gt; (if available) or &lt;code&gt;isearch-allow-scroll&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt;.]&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;With a &lt;em&gt;plain&lt;/em&gt; prefix arg (&lt;code&gt;C-u&lt;/code&gt;) or a numeric prefix arg of value 1 (e.g. &lt;code&gt;C-1&lt;/code&gt;), &lt;code&gt;isearchp-replace-on-demand&lt;/code&gt; &lt;em&gt;replaces only the current&lt;/em&gt; search hit.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With a &lt;em&gt;negative&lt;/em&gt; prefix arg (e.g. &lt;code&gt;M--&lt;/code&gt; or &lt;code&gt;C--&lt;/code&gt;), &lt;code&gt;isearchp-replace-on-demand&lt;/code&gt; &lt;em&gt;toggles automatic replacement by just searching&lt;/em&gt;. Automatic replacement means that each time you use a search key (e.g. &lt;code&gt;C-s&lt;/code&gt;) to visit a search hit, the hit is automatically replaced, without your needing to hit &lt;code&gt;C-M-RET&lt;/code&gt;. Using a prefix arg again with &lt;code&gt;C-M-RET&lt;/code&gt; cancels this (as does quitting and restarting Isearch).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With a &lt;em&gt;positive&lt;/em&gt; prefix arg &lt;strong&gt;&lt;em&gt;N&lt;/em&gt;&lt;/strong&gt; (e.g. &lt;code&gt;C-8&lt;/code&gt; or &lt;code&gt;C-u 200&lt;/code&gt;), &lt;code&gt;isearchp-replace-on-demand&lt;/code&gt; &lt;em&gt;replaces&lt;/em&gt; &lt;strong&gt;&lt;em&gt;N&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;search hits&lt;/em&gt; (but it stops at the search limit, if reached).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With a &lt;em&gt;zero&lt;/em&gt; prefix arg (e.g. &lt;code&gt;C-0&lt;/code&gt;), &lt;code&gt;isearchp-replace-on-demand&lt;/code&gt; &lt;em&gt;replaces all remaining search hits&lt;/em&gt; (up to the search limit).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When you use on-demand replacement (with &lt;code&gt;C-M-RET&lt;/code&gt;) the replacement text can be either inserted literally, as is, or &lt;em&gt;interpreted as in &lt;code&gt;query-replace-regexp&lt;/code&gt;&lt;/em&gt;. In the latter case, you can use &lt;strong&gt;&lt;code&gt;\&amp;amp;&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;\=\N&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;\#&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;\,&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;\?&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For example, suppose you use a regexp-search pattern of &lt;code&gt;\(e\)\|a&lt;/code&gt; and a replacement pattern of &lt;code&gt;\,(if \1 &quot;a&quot; &quot;e&quot;)&lt;/code&gt;. Each &lt;code&gt;C-M-RET&lt;/code&gt; will then swap &lt;code&gt;e&lt;/code&gt; for &lt;code&gt;a&lt;/code&gt; and vice versa.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;See the doc for &lt;code&gt;query-replace-regexp&lt;/code&gt; and node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html&quot; rel=&quot;nofollow&quot;&gt;Regexp Replace&lt;/a&gt; of the Emacs manual for more information.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(Note that &lt;code&gt;\?&lt;/code&gt; is supported, but it is not very useful in this context, because it prompts you to edit the result each time you hit &lt;code&gt;C-M-RET&lt;/code&gt;. Instead, use &lt;code&gt;C-u C-M-RET&lt;/code&gt; whenever you want to change (edit) the replacement pattern.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use &lt;strong&gt;&lt;code&gt;C-M-`&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;isearchp-toggle-literal-replacement&lt;/code&gt;) anytime during Isearch to toggle whether replacement text is used literally or interpreted per the special regexp-replacement constructs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Note that the use of the special regexp replacement patterns is unrelated to the kind of incremental search: literal string search or regexp search. Just remember that the way to switch on/off the special behavior of &lt;code&gt;\&amp;amp;&lt;/code&gt; and so on is to use &lt;code&gt;C-M-`&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Sorry, but I don't understand this part of your request:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;If the marked region changes, start over with search (default). This is the automatic aspect that I mean.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also, perhaps I misunderstand your requested use of the region.  If you do not mean that you want to &lt;em&gt;search only the region&lt;/em&gt;, but you instead want to &lt;em&gt;search (the whole buffer) for the text that is in the region&lt;/em&gt;, then that is easily accomplished (even in vanilla Isearch), by using &lt;code&gt;M-w&lt;/code&gt; to save the region to the &lt;code&gt;kill-ring&lt;/code&gt; and then &lt;code&gt;M-y&lt;/code&gt; during Isearch to yank it onto the search string.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;After your comment and your edit, to clarify what you want -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This command will give you what you are apparently looking for: automatically search for the text that is in the active region.  Just bind it to a key.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (let ((str  (if mark-active&#xA;                  (buffer-substring (region-beginning) (region-end))&#xA;                &quot;&quot;)))&#xA;    (isearch-forward nil 1)&#xA;    (isearch-yank-string str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-04T03:53:58.407" LastActivityDate="2016-05-04T03:53:58.407" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22043" PostTypeId="1" CreationDate="2016-05-04T03:41:20.640" Score="2" ViewCount="1096" Body="&lt;p&gt;I would like to create a table like so.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| field 1 | field 2    | field 3        | field 4 |&#xA;|         |------+-----|-----+-----+----|         |&#xA;|         | sub 1|sub2 | xx  | yy  | zz |         |&#xA;|---------+------+-----+-----+-----+----+---------|&#xA;|         |      |     |     |     |    |         |&#xA;|         |      |     |     |     |    |         |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way that emacs org mode to create such a table.?&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="14825" LastEditDate="2022-11-05T01:14:35.227" LastActivityDate="2022-11-05T01:14:35.227" Title="how can i split a cell in org-mode table" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="0" ClosedDate="2016-07-12T17:06:56.497" ContentLicense="CC BY-SA 3.0" />
  <row Id="22044" PostTypeId="1" AcceptedAnswerId="22045" CreationDate="2016-05-04T04:45:05.480" Score="2" ViewCount="218" Body="&lt;p&gt;I am trying to get &lt;code&gt;js-mode&lt;/code&gt; to highlight a &quot;shebang&quot; (&lt;code&gt;#!/usr/bin/env node&lt;/code&gt;) as a comment, but my code is not working. Instead, the entire buffer is colored like a comment. I've read the documentation for &lt;code&gt;modify-syntax-entry&lt;/code&gt; carefully but am still not getting anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried these calls and several similar combinations, but without success:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?# &quot;&amp;lt; 1&quot; js-mode-syntax-table)&#xA;(modify-syntax-entry ?! &quot;&amp;lt; 2&quot; js-mode-syntax-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2017-05-12T14:57:13.520" Title="Treat shebang as a comment" Tags="|syntax-highlighting|syntax-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22045" PostTypeId="2" ParentId="22044" CreationDate="2016-05-04T05:57:47.503" Score="5" Body="&lt;p&gt;Try&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(modify-syntax-entry ?# &quot;. 1&quot; js-mode-syntax-table)&#xA;(modify-syntax-entry ?! &quot;. 2b&quot; js-mode-syntax-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Flags.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11912" LastEditorUserId="719" LastEditDate="2017-05-12T14:57:13.520" LastActivityDate="2017-05-12T14:57:13.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22046" PostTypeId="2" ParentId="22043" CreationDate="2016-05-04T06:37:22.903" Score="0" Body="&lt;p&gt;There is a table.el program written by takota that was cited as a solution to this problem on January of 2015 &lt;a href=&quot;https://emacs.stackexchange.com/questions/7299/multicolumn-cells-in-org-mode-tables/7313#7313&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried it out, and it seemed to be closer to working in emacs 22 than in emacs 24. I'm on a mac, so I have both versions installed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been messing around with it for over an hour and I'm not sure what I'm doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;table.el can be downloaded from &lt;a href=&quot;https://sourceforge.net/projects/table/files/&quot; rel=&quot;nofollow noreferrer&quot;&gt;sourceforge&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11918" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-04T06:37:22.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22047" PostTypeId="2" ParentId="22041" CreationDate="2016-05-04T08:41:45.907" Score="2" Body="&lt;p&gt;I'm mostly trying to address the &quot;automatically highlight text matching region&quot; part in this answer : I don't know if it exists, but it seemed pretty straightforward to write an initial rudimentary version, so I did just that. The idea is simply to use &lt;code&gt;activate-mark-hook&lt;/code&gt; to highlight region when mark gets activated using &lt;code&gt;highlight-region&lt;/code&gt;. Here's the result :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(also available at &lt;a href=&quot;https://github.com/YoungFrog/highlight-region&quot; rel=&quot;nofollow&quot;&gt;https://github.com/YoungFrog/highlight-region&lt;/a&gt; -- updates to the code, if any, will only go to the repo)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local highlight-region--highlighted-text &quot;&quot;)&#xA;&#xA;(define-minor-mode highlight-region-mode&#xA;  &quot;Automatically highlight current region when mark is active.&quot;&#xA;  nil nil nil&#xA;  (highlight-region--unhighlight-region)&#xA;  (remove-hook 'activate-mark-hook #'highlight-region--highlight-region t)&#xA;  ;; as for GNU Emacs 25.0.93.1 (i686-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2016-05-03&#xA;  ;; it seems that the following behaviour of activate-mark-hook described in its dosctring :&#xA;  ;; &amp;gt;&amp;gt; It is also run at the end of a command, if the mark is active and&#xA;  ;; &amp;gt;&amp;gt; it is possible that the region may have changed.&#xA;  ;; actually doesn't work. Thus let's add ourselves to post-command-hook...&#xA;  (remove-hook 'post-command-hook #'highlight-region--highlight-region t)&#xA;  (remove-hook 'deactivate-mark-hook #'highlight-region--unhighlight-region t)&#xA;  (when highlight-region-mode&#xA;    (add-hook 'activate-mark-hook #'highlight-region--highlight-region nil t)&#xA;    (add-hook 'post-command-hook #'highlight-region--highlight-region nil t)&#xA;    (add-hook 'deactivate-mark-hook #'highlight-region--unhighlight-region nil t)))&#xA;&#xA;(defun highlight-region--highlight-region ()&#xA;  &quot;Highlight currently active region&quot;&#xA;  (when (use-region-p)&#xA;    (let ((str (buffer-substring-no-properties (region-beginning) (region-end))))&#xA;      (unless (or (string= &quot;&quot; str)&#xA;                  (string= str highlight-region--highlighted-text))&#xA;        (highlight-region--unhighlight-region)&#xA;        (setq highlight-region--highlighted-text str)&#xA;        ;; TODO: add a face `highlight-region' and use it.&#xA;        (highlight-regexp (regexp-quote str))))))&#xA;&#xA;(defun highlight-region--unhighlight-region nil&#xA;  (unhighlight-regexp (regexp-quote highlight-region--highlighted-text))&#xA;  (setq highlight-region--highlighted-text &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to also mention &lt;code&gt;selected.el&lt;/code&gt; (&lt;a href=&quot;https://github.com/Kungsgeten/selected.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Kungsgeten/selected.el&lt;/a&gt;) which defines a keymap that is active when the region is active. This will let you define key bindings that act on the region specifically.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2016-05-05T04:53:33.897" LastActivityDate="2016-05-05T04:53:33.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22048" PostTypeId="1" AcceptedAnswerId="22070" CreationDate="2016-05-04T09:19:23.467" Score="0" ViewCount="584" Body="&lt;p&gt;I am trying to launch Emacs through a keyboard shortcut on my Debian/xmonad system. Relevant lines from my &lt;code&gt;xmonad.hs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~$ cat .xmonad/xmonad.hs&#xA;import XMonad&#xA;&#xA;...&#xA;&#xA;main =&#xA;  xmonad =&amp;lt;&amp;lt; xmobar&#xA;  (defaultConfig {modMask = mod4Mask, terminal=&quot;gnome-terminal&quot;}&#xA;   `additionalKeysP`&#xA;   [ (&quot;M-e&quot;, spawn &quot;emacs&quot;),&#xA;     ...&#xA;   ])&#xA;...&#xA;&#xA;~$ xmonad --recompile&#xA;~$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(and even restart, I'm just proving minimal sanity here)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use the keyboard shortcut, nothing happens and if I inspect my &lt;code&gt;.xsession-errors&lt;/code&gt; I can see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~$ tail -n1 .xsession-errors &#xA;emacs: standard input is not a tty&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I just start Emacs from the terminal I go in &quot;terminal mode&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~$ echo $DISPLAY&#xA;:0.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I further debug this?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Further version info:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ apt-cache policy emacs&#xA;emacs:&#xA;  Installed: 46.1&#xA;  Candidate: 46.1&#xA;  Version table:&#xA; *** 46.1 995&#xA;        995 http://ftp.se.debian.org/debian testing/main amd64 Packages&#xA;[...]&#xA;$ apt-cache policy emacs-nox&#xA;emacs-nox:&#xA;  Installed: (none)&#xA;  Candidate: 46.1&#xA;  Version table:&#xA;     46.1 995&#xA;        995 http://ftp.se.debian.org/debian testing/main amd64 Packages&#xA;[...]&#xA;$ emacs --version&#xA;GNU Emacs 24.5.1&#xA;Copyright (C) 2015 Free Software Foundation, Inc.&#xA;GNU Emacs comes with ABSOLUTELY NO WARRANTY.&#xA;You may redistribute copies of Emacs&#xA;under the terms of the GNU General Public License.&#xA;For more information about these matters, see the file named COPYING.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11920" LastEditorUserId="11920" LastEditDate="2016-05-04T22:22:32.337" LastActivityDate="2016-05-05T12:11:14.377" Title="How can I run GUI emacs (using a shortcut) in a very light xmonad installation?" Tags="|linux|" AnswerCount="1" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="22049" PostTypeId="1" AcceptedAnswerId="22057" CreationDate="2016-05-04T11:56:47.837" Score="16" ViewCount="12767" Body="&lt;p&gt;I can run the Bash shell that comes with Git for Windows. I put this in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun git-bash () (interactive)&#xA;  (let ((explicit-shell-file-name &quot;D:/Program Files/git/bin/bash&quot;))&#xA;    (call-interactively 'shell)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;git-bash&lt;/code&gt; and voila, bash is running but with some weirdness:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash: cannot set terminal process group (-1): Inappropriate ioctl for device&#xA;bash: no job control in this shell&#xA;^[]0;MINGW64:/c/Users/M??rton^G&#xA;MĂĄrton@Marci MINGW64 /c/Users/MĂĄrton&#xA;$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it prints that line, beginning with &lt;code&gt;^[]&lt;/code&gt;, after every command I run. Also the encoding is messed up. How can I fix this in &lt;code&gt;.emacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="5363" LastActivityDate="2017-03-29T10:20:45.937" Title="Git Bash in emacs on Windows" Tags="|microsoft-windows|shell|bash|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22050" PostTypeId="1" CreationDate="2016-05-04T12:46:35.077" Score="1" ViewCount="725" Body="&lt;p&gt;So I'm using Emacs in Windows (Emacs 24.5.1, Windows 10). I've set a default margin width of 20 on both sides for text-mode, but occasionally I like to resize the window in half (Windows+left or right arrow) so that I can quote something from a browser window or the like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a good way to have Emacs detect this behavior and adjust the margins appropriately (as it is, there's just a thin slit of text when the window is halved), maybe to 5 or 3 characters on each side?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, how could I program a function I could issue that would do this manually? I can't even work out how to do it by issuing setq left-margin-width xx from within a running instance. Heeelp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the relevant parts of my current .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook 'visual-line-mode)&#xA;&#xA;(defun margins ()&#xA;(setq left-margin-width 20)&#xA;(setq right-margin-width 20))&#xA;&#xA;(add-hook 'text-mode-hook 'margins)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11892" LastEditorUserId="11892" LastEditDate="2016-05-04T12:52:01.920" LastActivityDate="2019-08-20T02:02:55.380" Title="Automatically toggling margin width on resizing" Tags="|init-file|window|frames|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22051" PostTypeId="2" ParentId="22049" CreationDate="2016-05-04T13:03:25.583" Score="1" Body="&lt;p&gt;This error points to a mismatched switch. It is probably set to &lt;code&gt;-ic&lt;/code&gt; and you need just &lt;code&gt;-c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shell-command-switch &quot;-c&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The other option is to provide tty to git-bash with a command similar to (whatever is windows equivalent):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/sbin/getty -l bash -n 38400 tty0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-05-04T13:03:25.583" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22053" PostTypeId="1" CreationDate="2016-05-04T14:55:12.117" Score="1" ViewCount="28" Body="&lt;p&gt;I am running cyginw's native w32 emacs program on Windows 7.  If I edit a file in emacs, and don't save changes, when I shut down Windows, the emacs session is killed without asking to save edited files.  Is there a fix for this?  I realize I can manually quit emacs before shutting down, but it would be better to not have to think about this.&lt;/p&gt;&#xA;" OwnerUserId="10788" LastActivityDate="2016-05-04T14:55:12.117" Title="cygwin emacs w32 does not ask to save edited files when shutting down windows" Tags="|cygwin|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22054" PostTypeId="1" AcceptedAnswerId="22058" CreationDate="2016-05-04T15:11:35.937" Score="1" ViewCount="200" Body="&lt;p&gt;If I create a string from the output of a shell command, using shell-command-to-string, I sometimes see ^H characters in the string, when I guess those characters were supposed to result in backspacing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I can produce such a result on my Debian-stable machine by doing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string &quot;fortune -m MacKay&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for that particular fortune, the result contains the following substring &lt;code&gt;The subspace _^HW inherits&lt;/code&gt; (where I've replaced a &quot;non-printing character&quot; by the string &quot;^H&quot;, because that is what I &quot;see&quot; in Emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I just do &lt;code&gt;fortune -m MacKay&lt;/code&gt; in a terminal (e.g. in eshell) the result contains instead the substring &lt;code&gt;The subspace W inherits&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert (shell-command-to-string &quot;fortune -m MacKay&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the &lt;code&gt;*scratch*&lt;/code&gt; buffer, and then do &quot;M-x describe-string&quot; with point on the non-printing character (which - as I said earlier - appears in emacs as ^H) it is (unsuprisingly) described as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             position: 1442 of 2745 (52%), column: 15&#xA;            character: C-h (displayed as C-h) (codepoint 8, #o10, #x8)&#xA;    preferred charset: ascii (ASCII (ISO646 IRV))&#xA;code point in charset: 0x08&#xA;               script: latin&#xA;               syntax: _    which means: symbol&#xA;             to input: type &quot;C-x 8 RET 8&quot; or &quot;C-x 8 RET BACKSPACE&quot;&#xA;          buffer code: #x08&#xA;            file code: #x08 (encoded by coding system prefer-utf-8-unix)&#xA;              display: no font available&#xA;       hardcoded face: escape-glyph&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What should I do to make shell-command-to-string &quot;treat these deletion characters correctly?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I doubt this has much to do with the Emacs version, but anyhow I'm using Emacs 25.1.50.18&lt;/p&gt;&#xA;" OwnerUserId="383" LastEditorUserId="2223" LastEditDate="2016-05-04T19:21:55.950" LastActivityDate="2016-05-04T19:21:55.950" Title="shell-command and C-h" Tags="|shell|characters|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22057" PostTypeId="2" ParentId="22049" CreationDate="2016-05-04T18:46:39.067" Score="18" Body="&lt;p&gt;The &lt;code&gt;^[]&lt;/code&gt; noise is coming from various terminal control characters in your shell prompt. Try &lt;code&gt;echo $PS1&lt;/code&gt; to see the full sequence, and try e.g. &lt;code&gt;export PS1='$ '&lt;/code&gt; to see that a simpler prompt string removes that particular problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the encoding, you might try making utf-8 your preferred encoding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Setting up the prompt&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs sets the INSIDE_EMACS variable so you could create a .bash_profile that sets PS1 only when running in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Testing on my machine, the first line of the prompt has the problematic control characters. I created a ~/.bash_profile with this. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [ -n &quot;$INSIDE_EMACS&quot; ]; then&#xA;    export PS1='\[\033[32m\]\u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This sets the prompt based on what git-bash was setting by default, but I removed the first line (up to the \n line break). I also removed the $MSYSTEM which puts MINGW64 in the prompt -- I don't need to see that. What remains is the user@host, current directory, and git repo. The control characters set colors which Emacs displays properly for me. (For details on setting up your prompt, refer to the bash &lt;a href=&quot;http://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs I set the shell to git-bash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq explicit-shell-file-name &quot;C:/git-for-windows/bin/bash.exe&quot;)&#xA;(setq explicit-bash.exe-args '(&quot;--login&quot; &quot;-i&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setup I'm still seeing the initial ioctl error message, but otherwise things work as expected and the encoding is utf-8.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-05-05T14:03:06.213" LastActivityDate="2016-05-05T14:03:06.213" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22058" PostTypeId="2" ParentId="22054" CreationDate="2016-05-04T18:55:16.837" Score="3" Body="&lt;p&gt;On old &lt;a href=&quot;https://en.wikipedia.org/wiki/Teleprinter&quot; rel=&quot;nofollow&quot;&gt;teletypewriters&lt;/a&gt;, the BS control character, written &lt;code&gt;^H&lt;/code&gt;, &lt;code&gt;\008&lt;/code&gt; or &lt;code&gt;\b&lt;/code&gt;, would backspace the print head by one character position.  Underlining could be achieved by overstriking a character with an underline (&lt;code&gt;_^HH_^Hi&lt;/code&gt;), and bolding could be achieved by overstriking a character with itself (&lt;code&gt;B^HBy^Hye^He&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Teletypewriters no longer exist, but a number of Unix commands (such as &lt;code&gt;nroff&lt;/code&gt; and &lt;code&gt;man&lt;/code&gt;) still produce this kind of sequences, and they are embedded in old text files (such as the &lt;code&gt;fortune&lt;/code&gt; data files).  Unix pagers (&lt;code&gt;more&lt;/code&gt;, &lt;code&gt;less&lt;/code&gt;) interpret them by converting to the right terminal control sequences for underline and bold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, the simplest solution would be to discard the overstriking by removing the character preceding the BS and the BS itself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string &quot;.\008&quot; &quot;&quot; string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A better solution would be to interpret the overstriking and generate text properties for bold and underline.  There are examples of that in the Emacs sources, e.g. &lt;code&gt;Man-fontify-manpage&lt;/code&gt; in &lt;code&gt;man.el&lt;/code&gt; or &lt;code&gt;woman-man-buffer&lt;/code&gt; in &lt;code&gt;woman.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-05-04T18:55:16.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22060" PostTypeId="2" ParentId="22050" CreationDate="2016-05-04T20:27:56.250" Score="1" Body="&lt;p&gt;There may be more elegant solutions, but here's a function that sets the margins based on the width of the frame:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun reset-margins (&amp;amp;optional arg)&#xA;  &quot;Reset the buffer margins based on the width of the frame.&#xA;  Has no effect when the frame contains multiple windows. By&#xA;  default, only adjust the margins if they are already&#xA;  non-zero. Use a prefix ARG to force the resize.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (unless (window-parent)&#xA;(when (or arg (&amp;gt; left-margin-width 0))&#xA;  (let ((width (if (&amp;lt; (frame-width) 100) 5 20)))&#xA;    (unless (= left-margin-width width)&#xA;      (setq left-margin-width width)&#xA;      (setq right-margin-width width)&#xA;      (set-window-buffer nil (current-buffer)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The left/right margin variables are buffer-local and are not actually applied until you set the window buffer, so here I'm calling &lt;code&gt;set-window-buffer&lt;/code&gt; with the current buffer to pick up the change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simplify things this function checks that the frame has exactly one window (i.e. there is no window-parent). It's using margins of 5 and 20 depending on whether the frame is wider or narrow than 100. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can call this function automatically when the frame is resized using this hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'window-configuration-change-hook 'reset-margins)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default this function only sets the margins if they are already non-zero. It can be called with an argument to force the change, so that you can also use it from a mode hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook (lambda () (reset-margins t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That way when you first enable text-mode the margins will be adjusted from 0 to either 5 or 20, and then when you resize the frame they will automatically narrow or widen accordingly. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-05-05T14:33:32.823" LastActivityDate="2016-05-05T14:33:32.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22062" PostTypeId="2" ParentId="21988" CreationDate="2016-05-04T21:57:46.023" Score="4" Body="&lt;p&gt;I don't think that &lt;code&gt;&amp;lt;today + 7d&amp;gt;&lt;/code&gt; is a valid time specification — you meant to say &lt;code&gt;&amp;lt;+7d&amp;gt;&lt;/code&gt;.  Additionally, there's no need to use an embedded list for just one condition.  Finally, you're missing a pair of parantheses around the settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  '((&quot;d&quot; &quot;daily&quot;&#xA;     tags-todo &quot;DEADLINE&amp;gt;=\&quot;&amp;lt;today&amp;gt;\&quot;&amp;amp;DEADLINE&amp;lt;=\&quot;&amp;lt;+7d&amp;gt;\&quot;&quot;&#xA;     ((org-agenda-sorting-strategy '(todo-state-down))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-05-04T21:57:46.023" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22063" PostTypeId="2" ParentId="10504" CreationDate="2016-05-04T22:32:51.750" Score="3" Body="&lt;p&gt;Just to add, &lt;code&gt;SCHEDULED&lt;/code&gt; is especially useful to implement the concept of &lt;code&gt;tickler&lt;/code&gt; of GTD. If you have a task that cannot be completed today, but you know that you can get started next week, you can mark it to sometime next week and not worry about it since you already have marked in the system. For example, if you have a school assignment that will be released in two days, you can &lt;code&gt;SCHEDULE&lt;/code&gt; it to two days later so that it will show up on your agenda on time. &lt;/p&gt;&#xA;" OwnerUserId="11295" LastActivityDate="2016-05-04T22:32:51.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22064" PostTypeId="2" ParentId="22050" CreationDate="2016-05-05T04:15:56.193" Score="0" Body="&lt;p&gt;&lt;code&gt;sublimity-attractive&lt;/code&gt; in the &lt;a href=&quot;http://github.com/zk-phi/sublimity&quot; rel=&quot;nofollow&quot;&gt;sublimity package&lt;/a&gt; tries to keep the window width to a specified width, by managing margins.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(require 'sublimity-attractive)&#xA;(setq sublimity-attractive-centering-width 110)&#xA;(sublimity-mode 1)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11931" LastActivityDate="2016-05-05T04:15:56.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22066" PostTypeId="1" AcceptedAnswerId="22088" CreationDate="2016-05-05T09:16:33.420" Score="2" ViewCount="1003" Body="&lt;p&gt;In &lt;code&gt;~/.emacs.d/layers/.../any-given-layer&lt;/code&gt; there is almost always a &lt;code&gt;README&lt;/code&gt; documenting this layer's functionality. Is there a key binding, or function that opens the &lt;code&gt;README&lt;/code&gt; associated with a given layer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find this necessary because layers bundle functionality from various packages, e.g. a repl package, package for the major mode of the language, snippets, etc., and I often need to reference the &lt;code&gt;README&lt;/code&gt; to see what's in the layer and how to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;chris&lt;/p&gt;&#xA;" OwnerUserId="8401" LastActivityDate="2016-05-05T23:28:13.467" Title="Spacemacs layer documentation" Tags="|spacemacs|documentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22067" PostTypeId="2" ParentId="19259" CreationDate="2016-05-05T09:33:19.437" Score="0" Body="&lt;p&gt;You can simply disable the &lt;code&gt;python-flake8&lt;/code&gt; checker. This will make the next checker which is &lt;code&gt;python-pylint&lt;/code&gt; to be used. You can do this by using the command &lt;code&gt;flycheck-disable-checker&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before this verify if the &lt;code&gt;pylint&lt;/code&gt; is configured by using command &lt;code&gt;flycheck-verify-setup&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11935" LastActivityDate="2016-05-05T09:33:19.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22068" PostTypeId="2" ParentId="10062" CreationDate="2016-05-05T10:23:54.773" Score="6" Body="&lt;p&gt;@Juancho's answer is nice if you want to exclude a specific table from export.  If you want to exclude all tables, you can simply set the &lt;code&gt;|:&lt;/code&gt; option:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: |:nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Note that the value &lt;em&gt;false&lt;/em&gt; is to be denoted by &lt;code&gt;nil&lt;/code&gt; not &lt;code&gt;f&lt;/code&gt;!&lt;/p&gt;&#xA;&lt;p&gt;This sets the variable &lt;code&gt;org-export-with-tables&lt;/code&gt; whose docstring is:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;org-export-with-tables is a variable defined in `ox.el'.&#xA;Its value is t&lt;/p&gt;&#xA;&lt;p&gt;Documentation:&#xA;Non-nil means export tables.&#xA;This option can also be set with the OPTIONS keyword,&#xA;e.g. &amp;quot;|:nil&amp;quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-05-05T10:23:54.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22070" PostTypeId="2" ParentId="22048" CreationDate="2016-05-05T12:11:14.377" Score="2" Body="&lt;p&gt;Managed to find a solution with the help of some comments, so here's an answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@YoungFrog suggested I check the value of &lt;code&gt;system-configuration-options&lt;/code&gt; (with &lt;code&gt;C-h v&lt;/code&gt;) which revealed that the Emacs version I was running was configured with the &lt;code&gt;--with-x=no&lt;/code&gt; option. This is a global setting, not related to the fact that I was reading the variable from the console.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This prompted me to try and reinstall the package, and I found out that @phils was right all along, as it turns out I had &lt;code&gt;emacs24-nox&lt;/code&gt; (but not the metapackage &lt;code&gt;emacs-nox&lt;/code&gt;) installed. Why was this one preferred over the plain &lt;code&gt;emacs24&lt;/code&gt; eludes me... Removing &lt;code&gt;emacs24-nox&lt;/code&gt; automatically selected &lt;code&gt;emacs24&lt;/code&gt; and the problem was resolved.&lt;/p&gt;&#xA;" OwnerUserId="11920" LastActivityDate="2016-05-05T12:11:14.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22071" PostTypeId="1" AcceptedAnswerId="45423" CreationDate="2016-05-05T13:36:31.757" Score="2" ViewCount="292" Body="&lt;p&gt;When you go to Google or to the address bar, and type your search query, you see various completion candidates for your query as suggested ed by google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought it would be great if you could fire Helm with a shortcut key, and then type your query. The candidates are delivered by the autocompletion suggestions from Google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I planned to develop a Helm source, in order to get this working. To find a way to connect Emacs/Helm with Google API for their search autocompletion, I found this: &lt;a href=&quot;https://webmasters.googleblog.com/2015/07/update-on-autocomplete-api.html&quot; rel=&quot;nofollow&quot;&gt;https://webmasters.googleblog.com/2015/07/update-on-autocomplete-api.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the CSE is a paid service, I wonder if there are any Emacs packages that succesfully connects with Google's API/CSE? Then I could figure out how they did it.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2018-10-17T09:12:18.833" Title="Is anyone combining Google Search Autocompletion with Emacs/Helm?" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22073" PostTypeId="1" AcceptedAnswerId="22076" CreationDate="2016-05-05T14:55:34.093" Score="3" ViewCount="63" Body="&lt;p&gt;As I understood from the documentation of Eshell, every time that a command will be executed, it will be executed internally in Eshell/Emacs. When it gives an error code, then the command will be passed to the real shell, and the output of that command will be passed to Eshell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I began to wonder why the command &lt;code&gt;type&lt;/code&gt; is not working in Eshell? In the terminal emulator, &lt;code&gt;type sh&lt;/code&gt; gives me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sh is /bin/sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in Eshell, it gives me the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;sh&quot;): command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the command is not found, it would be passed anyway to the real shell, right? I fail to understand why this gets stucked. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-05-05T15:40:51.140" Title="Why is the 'type'-command not accepted in Eshell?" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22074" PostTypeId="1" CreationDate="2016-05-05T15:01:19.900" Score="0" ViewCount="249" Body="&lt;p&gt;What is the proper way to bind &lt;code&gt;S-;&lt;/code&gt; to &lt;code&gt;execute-extended-command&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this &lt;code&gt;(bind-key* &quot;S-;&quot; 'execute-extended-command)&lt;/code&gt; but doesn't work. &lt;code&gt;bind-key&lt;/code&gt; is a function from &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;evil&lt;/code&gt; mode.&lt;/p&gt;&#xA;" OwnerUserId="11939" LastEditorUserId="11939" LastEditDate="2016-05-05T15:29:35.663" LastActivityDate="2016-05-06T18:37:45.093" Title="bind Shift-; to execute-extended-command" Tags="|key-bindings|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22076" PostTypeId="2" ParentId="22073" CreationDate="2016-05-05T15:40:51.140" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;When it gives an error code, then the command will be passed to the real shell&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, eshell &lt;em&gt;is&lt;/em&gt; the &quot;real shell&quot;.  If there no such internal command, then eshell will look for an external command of the same name (this is what all shells do).  &lt;code&gt;type&lt;/code&gt; is not an external command, it's an internal command of some other shells (try running &lt;code&gt;type type&lt;/code&gt; in your terminal emulator).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-05-05T15:40:51.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22077" PostTypeId="1" AcceptedAnswerId="22089" CreationDate="2016-05-05T17:17:29.417" Score="4" ViewCount="3532" Body="&lt;p&gt;Is it possible to make the agenda views to only show tasks with a deadline, hence skipping all tasks containing only scheduled time? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for this question is that I am NOT using scheduled time for when to start on a task, like having an appointment with my self, but instedad I am using scheduled time only for determining when a task will be visible in my task list. Hence I typically work on tasks that have their scheduled time days or weeks back in time. Of this reason, it is only the deadline-tasks I want to see in my agenda views. Is that possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any suggestions, hints or help.&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2016-05-05T23:35:23.767" Title="org agenda: how to show only todo's with deadline?" Tags="|org-agenda|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22078" PostTypeId="1" CreationDate="2016-05-05T17:18:19.300" Score="8" ViewCount="1300" Body="&lt;p&gt;I've an huge org file &lt;code&gt;HUGE.org&lt;/code&gt; with this structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* ID-HEAD-1 Title1 :TAG:&#xA;bla bla bla&#xA;&#xA;* ID-HEAD-2 Title2 :TAG:&#xA;bla bla bla&#xA;&#xA;...&#xA;&#xA;* ID-HEAD-N TitleN :TAG:&#xA;bla bla bla&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to split &lt;code&gt;HUGE.org&lt;/code&gt; into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ID-HEAD-1.org&#xA;ID-HEAD-2.org&#xA;...&#xA;ID-HEAD-N.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the content of each &lt;code&gt;ID-HEAD-i.org&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* ID-HEAD-i Titlei :TAG:&#xA;bla bla bla&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suggestions?&lt;/p&gt;&#xA;" OwnerUserId="11940" LastEditorUserId="105" LastEditDate="2016-06-22T19:51:51.343" LastActivityDate="2022-01-04T16:46:27.567" Title="How to split a long org file into separate org files?" Tags="|org-mode|files|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22079" PostTypeId="1" AcceptedAnswerId="22149" CreationDate="2016-05-05T18:09:11.913" Score="6" ViewCount="1145" Body="&lt;p&gt;How does one write assertions in Emacs Lisp?  I know that &lt;code&gt;cl-macs.el&lt;/code&gt; has &lt;code&gt;cl-assert&lt;/code&gt; and &lt;code&gt;cl-check-type&lt;/code&gt;, but I'm wondering if there's a native Emacs way to perform something that basic.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="105" LastEditDate="2022-09-18T17:36:13.890" LastActivityDate="2022-09-18T17:36:13.890" Title="How to write assertions" Tags="|debugging|elisp|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22080" PostTypeId="1" CreationDate="2016-05-05T18:19:23.183" Score="4" ViewCount="571" Body="&lt;p&gt;When I use helm-bibtex, I get a screen showing some of the properties of the articles in my .bib file. For example, I get some sort of table where the columns are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|author | title | year | articletype|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was wondering if I could edit this so that I could remove the last column and replace it with some other property of my choosing, such as a tags property.&lt;/p&gt;&#xA;" OwnerUserId="11887" LastActivityDate="2023-01-24T20:35:07.557" Title="Possible to view more options in helm-bibtex?" Tags="|helm|bibtex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22081" PostTypeId="1" CreationDate="2016-05-05T18:28:26.897" Score="0" ViewCount="77" Body="&lt;p&gt;I've been interested in trying out &lt;a href=&quot;http://www.neilvandyke.org/quack/&quot; rel=&quot;nofollow&quot;&gt;Quack mode&lt;/a&gt; in my Scheme environment recently, but have been running into some problems with its keyword documentation. According to &lt;a href=&quot;http://www.neilvandyke.org/quack/quack.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;quack.el&lt;/code&gt;&lt;/a&gt;, invoking &lt;code&gt;quack-view-keyword-docs&lt;/code&gt; should allow me to view the manual documentation for a given keyword, although it currently only works for PLT manuals. Nonetheless, when I do invoke said function with a given keyword, say &lt;code&gt;xml&lt;/code&gt;, I get the following series of errors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Quack Warning: Manual plt-mzscheme has no HTML.&#xA;Quack Warning: Manual plt-mzlib has no HTML.&#xA;Quack Warning: Manual plt-mred has no HTML.&#xA;Quack Warning: Manual plt-framework has no HTML.&#xA;Quack Warning: Manual plt-drscheme has no HTML.&#xA;Quack Warning: Manual plt-insidemz has no HTML.&#xA;Quack Warning: Manual plt-tools has no HTML.&#xA;Quack Warning: Manual plt-mzc has no HTML.&#xA;Quack Warning: Manual plt-r5rs has no HTML.&#xA;Sorry, no documentation found for keyword &quot;xml&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This isn't making sense to me since I have supplied the &lt;code&gt;quack-pltcollect-dirs&lt;/code&gt; variable with my &lt;code&gt;collects&lt;/code&gt; directory like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(quote (&quot;/Applications/Racket v6.5/collects&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I did this as per the instructions in &lt;a href=&quot;http://www.neilvandyke.org/quack/quack.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;quack.el&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note to PLT Scheme users: If you do not already have the PLT manuals installed, they can be downloaded from  &lt;code&gt;http://download.plt-scheme.org/doc/&lt;/code&gt; and installed in your PLT &lt;code&gt;doc&lt;/code&gt; collection.  If Quack is not finding installed PLT manuals, then be sure that the &lt;code&gt;quack-pltcollect-dirs&lt;/code&gt; variable contains the appropriate collection directory (if it does not, then either set the &lt;code&gt;PLTHOME&lt;/code&gt; and/or &lt;code&gt;PLTCOLLECTS&lt;/code&gt; environment variables appropriately, or set &lt;code&gt;quack-pltcollect-dirs&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm not exactly sure what I'm missing here that is causing Quack mode to fail every time I try to look up the docs for a keyword. Btw, I am using Emacs 25.1 on OS X 10.11.4.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2016-05-07T21:05:37.873" LastActivityDate="2016-05-07T21:05:37.873" Title="Quack mode is unable to find local manuals" Tags="|osx|scheme|manual|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22082" PostTypeId="2" ParentId="22079" CreationDate="2016-05-05T18:31:52.583" Score="6" Body="&lt;p&gt;Here's an assert macro in elisp based on an expert's advice on emacs mailing list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro assert (test-form)&#xA;  `(when (not ,test-form)&#xA;     (error &quot;Assertion failed: %s&quot; (format &quot;%s&quot; ',test-form))))&#xA;&#xA;(assert (equal t nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="10" LastEditDate="2016-05-06T01:34:33.130" LastActivityDate="2016-05-06T01:34:33.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22083" PostTypeId="1" AcceptedAnswerId="22086" CreationDate="2016-05-05T18:52:14.627" Score="1" ViewCount="1455" Body="&lt;p&gt;How to fold arbitrary blocks of text?&#xA;&lt;p&gt;Something like #BEGIN_SRC org .. but don't edit in another mode... using &amp;lt;language&amp;gt; 'org' doesn't really work, for example, enter on a &lt;code&gt;[[link]]&lt;/code&gt; fails.  Drawers don't seem to work except after a heading. BEGIN _EXAMPLE, or _VERSE _QUOTE all have issues.  I want something like a heading with an end marker (that isn't another header).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org&#xA;whatever text... edit etc the same as all other org text&#xA;but allow folding this block &#xA;(and enter on '[[link]]' should still work)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7037" LastActivityDate="2016-05-06T05:35:34.333" Title="org-mode How to fold an arbitrary block of text" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22084" PostTypeId="1" AcceptedAnswerId="22087" CreationDate="2016-05-05T19:37:32.413" Score="3" ViewCount="1811" Body="&lt;p&gt;I want to have it enabled every time I open emacs and not type &lt;code&gt;M-x ido-mode&lt;/code&gt; each time I open it.&lt;/p&gt;&#xA;" OwnerUserId="11942" LastActivityDate="2016-05-05T22:28:41.917" Title="How to enable ido-mode forever?" Tags="|ido|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22086" PostTypeId="2" ParentId="22083" CreationDate="2016-05-05T20:35:30.967" Score="1" Body="&lt;p&gt;The &lt;code&gt;quote&lt;/code&gt; block will do some of what you want. You can get a quote block through the templating system -- type &lt;code&gt;&amp;lt;q&lt;/code&gt;, then hit &lt;code&gt;&amp;lt;TAB&amp;gt;&lt;/code&gt;, to make a quote block. Quote blocks are foldable and respect org's markup syntax, so links still work. They &lt;em&gt;do&lt;/em&gt; get incredibly strange if you try to insert a header inside one, so maybe give that a miss.&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-05-05T20:35:30.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22087" PostTypeId="2" ParentId="22084" CreationDate="2016-05-05T20:36:25.890" Score="4" Body="&lt;p&gt;I've decided to answer my question as some other noobs like me could have the same problem. Just follow the following steps(everything that I'm going to say is on these links &lt;a href=&quot;https://www.emacswiki.org/emacs/InteractivelyDoThings&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/InteractivelyDoThings&lt;/a&gt; or &lt;a href=&quot;https://www.emacswiki.org/emacs/InitFile&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/InitFile&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open your init file (for GnuEmacs it's ~/.emacs or ~/.emacs.d/init.el)&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In that file add this code and save the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ido)&#xA;(ido-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Restart emacs, or to avoid restarting for current session, select the above two lines, and use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eval-region &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then do &lt;code&gt;M-x customize-group RET ido RET&lt;/code&gt; and configure ido-mode&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also don't forget that ido-mode doesn't work while on ibuffer like I did.&#xA;&lt;strong&gt;Thanks to @dan&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="11942" LastEditorUserId="7045" LastEditDate="2016-05-05T22:28:41.917" LastActivityDate="2016-05-05T22:28:41.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22088" PostTypeId="2" ParentId="22066" CreationDate="2016-05-05T23:01:53.457" Score="4" Body="&lt;p&gt;As of May 2016, for &lt;code&gt;develop&lt;/code&gt; branch of Spacemacs, the command is &lt;code&gt;helm-spacemacs-help-layers&lt;/code&gt; under &lt;kbd&gt;Space h l&lt;/kbd&gt; (assuming &lt;kbd&gt;Space&lt;/kbd&gt; is your &lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION#orgheadline54&quot; rel=&quot;nofollow&quot;&gt;leader key&lt;/a&gt;). It will open a &lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION#orgheadline87&quot; rel=&quot;nofollow&quot;&gt;Helm&lt;/a&gt; buffer with all layers available in your Spacemacs. Choose a layer, press &lt;kbd&gt;Enter&lt;/kbd&gt;, and you will end up in the layer's README file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, while still browsing the list of layers in Helm, press &lt;kbd&gt;Ctrl+z&lt;/kbd&gt; (this switches from list of completions to list of actions) and you can choose another action to do with that layer. E.g. you can open this layer's &lt;code&gt;package.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For stable version 0.105 of Spacemacs you can just call &lt;kbd&gt;Space h Space&lt;/kbd&gt; (&lt;code&gt;helm-spacemacs&lt;/code&gt;), and you'll see the list of layers along other documentation-related entries. You can use &lt;kbd&gt;Ctrl+z&lt;/kbd&gt; here as well, and you can use &lt;kbd&gt;Space h Space&lt;/kbd&gt; in &lt;code&gt;develop&lt;/code&gt; branch as well.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastEditorUserId="3972" LastEditDate="2016-05-05T23:28:13.467" LastActivityDate="2016-05-05T23:28:13.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22089" PostTypeId="2" ParentId="22077" CreationDate="2016-05-05T23:35:23.767" Score="8" Body="&lt;p&gt;There is more than one way to accomplish the task outlined in the quesition of this thread.  My preferred method is to use &lt;code&gt;org-agenda-list&lt;/code&gt; with the &lt;code&gt;org-agenda-entry-types&lt;/code&gt; set to &lt;code&gt;:deadline&lt;/code&gt; only, which serves to exclude &lt;code&gt;:scheduled&lt;/code&gt;.  Note that &lt;code&gt;org-agenda-entry-types&lt;/code&gt; is a list that can be more than one element -- for additional information on that variable, type &lt;code&gt;M-x describe-variable RET org-agenda-entry-types RET&lt;/code&gt;.  The following is a sample entry in the &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; that will cause &lt;code&gt;org-agenda-list&lt;/code&gt; to activate using (in part) the specified criteria -- I prefaced &lt;em&gt;in part&lt;/em&gt; because certain variables can be globally set elsewhere (either by default or by custom setup) that will affect the behavior of &lt;code&gt;org-agenda-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-custom-commands '(&#xA;  (&quot;1&quot; &quot;Events&quot; agenda &quot;display deadlines and exclude scheduled&quot; (&#xA;    (org-agenda-span 'month)&#xA;    (org-agenda-time-grid nil)&#xA;    (org-agenda-show-all-dates nil)&#xA;    (org-agenda-entry-types '(:deadline)) ;; this entry excludes :scheduled&#xA;    (org-deadline-warning-days 0) ))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-05-05T23:35:23.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22090" PostTypeId="1" CreationDate="2016-05-06T00:14:48.947" Score="2" ViewCount="160" Body="&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I figured it out. It seems to be an emacs bug. My walk-through of the bug is below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just now found out about &lt;code&gt;emacs-show-diff-output&lt;/code&gt;, which is bound to &lt;kbd&gt;D&lt;/kbd&gt; by default in an ediff session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I make changes to a buffer without saving the file and then run &lt;code&gt;M-x ediff-current-file&lt;/code&gt; to start an ediff session for the changes that haven't been saved, if I then press &lt;kbd&gt;D&lt;/kbd&gt;, a new frame pops up with a buffer named &lt;code&gt;*ediff-custom-diff*&lt;/code&gt;, but it's empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;*Messages*&lt;/code&gt; buffer shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Computing differences between ediff100678ZHa and built-in.el ...&#xA;Buffer A: Processing difference region 0 of 1&#xA;Buffer B: Processing difference region 0 of 1&#xA;Processing difference regions ... done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried searching around but couldn't find anything related to &lt;code&gt;ediff-show-diff-output&lt;/code&gt;. Anyone have any idea as to what may be happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I've noticed that if I do it from an ediff session initiated from magit with &lt;code&gt;E w&lt;/code&gt; (ediff of the working tree changes), then &lt;kbd&gt;D&lt;/kbd&gt; works fine. It seems to be when I do it via &lt;code&gt;M-x ediff-current-file&lt;/code&gt; that it results in an empty diff. My guess would be that perhaps the file isn't found or something but the &lt;code&gt;*Messages*&lt;/code&gt; output seems to show that it &lt;em&gt;is&lt;/em&gt; working? It's just not ending up in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I've been stepping through the function &lt;code&gt;ediff-compute-custom-diffs-maybe&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This function operates only from an ediff control buffer&#xA;(defun ediff-compute-custom-diffs-maybe ()&#xA;  (let ((buf-A-file-name (buffer-file-name ediff-buffer-A))&#xA;    (buf-B-file-name (buffer-file-name ediff-buffer-B))&#xA;    file-A file-B)&#xA;    (unless (and buf-A-file-name&#xA;         (file-exists-p buf-A-file-name)&#xA;         (not (ediff-file-remote-p buf-A-file-name)))&#xA;      (setq file-A (ediff-make-temp-file ediff-buffer-A)))&#xA;    (unless (and buf-B-file-name&#xA;         (file-exists-p buf-B-file-name)&#xA;         (not (ediff-file-remote-p buf-B-file-name)))&#xA;      (setq file-B (ediff-make-temp-file ediff-buffer-B)))&#xA;    (or (ediff-buffer-live-p ediff-custom-diff-buffer)&#xA;    (setq ediff-custom-diff-buffer&#xA;          (get-buffer-create&#xA;           (ediff-unique-buffer-name &quot;*ediff-custom-diff&quot; &quot;*&quot;))))&#xA;    (ediff-with-current-buffer ediff-custom-diff-buffer&#xA;                   (setq buffer-read-only nil)&#xA;                   (erase-buffer))&#xA;    (ediff-exec-process&#xA;     ediff-custom-diff-program ediff-custom-diff-buffer 'synchronize&#xA;     ediff-custom-diff-options&#xA;     (or file-A buf-A-file-name)&#xA;     (or file-B buf-B-file-name))&#xA;    ;; put the diff file in diff-mode, if it is available&#xA;    (if (fboundp 'diff-mode)&#xA;    (with-current-buffer ediff-custom-diff-buffer&#xA;      (diff-mode)))&#xA;    (and file-A (file-exists-p file-A) (delete-file file-A))&#xA;    (and file-B (file-exists-p file-B) (delete-file file-B))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's go through it a bit at a time. First here's an outline of what I believe is occurring in the first few lines:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;get the file paths backing the buffers being compared&lt;/li&gt;&#xA;&lt;li&gt;the one for which there is no file path is the one for which ediff needs to create a temporary file for with the contents of the buffer, the unchanged file can simply be read from disk&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So first it tries to get the file name of each buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (let ((buf-A-file-name (buffer-file-name ediff-buffer-A))&#xA;    (buf-B-file-name (buffer-file-name ediff-buffer-B))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you run &lt;code&gt;M-x ediff-current-file&lt;/code&gt;, the left buffer (A) represents the unmodified file on disk and it's called &lt;code&gt;FILE=/path/to/file&lt;/code&gt;. The buffer representing the unsaved changes is on the right (B) and it's named after the file on disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what ends up happening here is that, perhaps because buffer A has a &lt;code&gt;FILE=&lt;/code&gt; prefix, &lt;code&gt;buffer-file-name&lt;/code&gt; fails so that &lt;code&gt;buf-A-file-name&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;. Meanwhile, buffer B which again represents the dirty unsaved buffer &lt;em&gt;does&lt;/em&gt; succeed on &lt;code&gt;buffer-file-name&lt;/code&gt; and sets &lt;code&gt;buf-B-file-name&lt;/code&gt; to the file path to the underlying file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (unless (and buf-A-file-name&#xA;         (file-exists-p buf-A-file-name)&#xA;         (not (ediff-file-remote-p buf-A-file-name)))&#xA;      (setq file-A (ediff-make-temp-file ediff-buffer-A)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This part then executes if &lt;code&gt;buf-A-file-name&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, which it is, so it proceeds to set &lt;code&gt;file-A&lt;/code&gt; to a temporary file that it creates from the contents of buffer A. &lt;strong&gt;In effect&lt;/strong&gt; this creates a temporary file with the same contents as the &lt;em&gt;unchanged file&lt;/em&gt; on disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it's B's turn:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (unless (and buf-B-file-name&#xA;         (file-exists-p buf-B-file-name)&#xA;         (not (ediff-file-remote-p buf-B-file-name)))&#xA;      (setq file-B (ediff-make-temp-file ediff-buffer-B)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case &lt;code&gt;buf-B-file-name&lt;/code&gt; is not &lt;code&gt;nil&lt;/code&gt;, the file does exist, and it's not a remote file, so it &lt;em&gt;doesn't&lt;/em&gt; create a temporary file for buffer B, instead it'll simply read the &lt;em&gt;unchanged file&lt;/em&gt; on disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So at this point we now have:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a temporary file with the contents of the unchanged file&lt;/li&gt;&#xA;&lt;li&gt;the unchanged file on the disk&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;These are clearly equivalent, so running &lt;code&gt;diff&lt;/code&gt; on them produces no output, hence the empty buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've &lt;strong&gt;confirmed&lt;/strong&gt; that this is the problem by &quot;fixing&quot; the visited files of the ediff buffers. So I focus buffer A and run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-visited-file-name &quot;/path/to/file&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I focus buffer B and run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-visited-file-name &quot;DIRTY=/path/to/file&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I press &lt;kbd&gt;D&lt;/kbd&gt; again (&lt;code&gt;M-x ediff-show-diff-output&lt;/code&gt;) and &lt;a href=&quot;https://i.imgur.com/S4KbHcz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;IT WORKS!!&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to recap, I believe the problem is that the &lt;code&gt;FILE=&lt;/code&gt; prefix added to buffer A which represents the file on disk makes ediff think that it's actually the dirty buffer for which it needs to create a temporary file, albeit with the contents of buffer A which is the contents of the file. &lt;em&gt;Then&lt;/em&gt; it goes on to buffer B and it determines that the file backing that buffer is the unchanged file on disk, when really it should actually determine that it's the dirty buffer and create a temporary file with the contents of the dirty buffer. In the end we end up with a temporary file and the unchanged file both with the same contents, so diff produces no output and thus an empty buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to go about solving this. Perhaps I can change the names with a setup-hook but that may be fragile.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="8941" LastEditDate="2016-05-09T18:56:49.450" LastActivityDate="2016-05-09T18:56:49.450" Title="emacs-show-diff-output produces empty buffer" Tags="|ediff|diff|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22091" PostTypeId="1" AcceptedAnswerId="22094" CreationDate="2016-05-06T00:17:14.990" Score="5" ViewCount="1100" Body="&lt;p&gt;I use evil-mode with Emacs and would like to accomplish this via evil-mode, but would be fine with doing it in an Emacs-centric way too. The subject line explains it well, but here is a post in which a Vim user posted the same question as mine and received the Vim-centric answer (several actually): &lt;a href=&quot;https://vi.stackexchange.com/questions/120/how-do-i-move-vertically-until-reaching-a-non-whitespace-character&quot;&gt;How do I move vertically until reaching a non-whitespace character?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Another useful link, similar to that provided above: &lt;a href=&quot;https://stackoverflow.com/questions/20882722/move-to-the-next-row-which-has-non-white-space-character-in-the-same-column-in-v&quot;&gt;Move to the next row which has non-white space character in the same column in VIM?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&lt;p&gt;UPDATE: I decided I'd write a function to do this and it was surprisingly easy:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun jump-down-to-non-whitespace-char-in-same-column ()&#xA;  (interactive)&#xA;  (next-line)&#xA;  (while (or (= (char-after (point)) 32)&#xA;             (= (char-after (point)) 10))&#xA;    (next-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I guess I'd still like to know if there is a way to do it with evil-mode anyway just because I am curious, so I won't answer my own question yet.&lt;/p&gt;&#xA;&lt;p&gt;UPDATE 2: I prefer the following version instead as now I use evil-next-line and evil-previous-line which behave more consistently the way I want:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun jump-down-to-non-whitespace-char-in-same-column ()&#xA;  (interactive)&#xA;  (evil-next-line)&#xA;  (while (or (= (char-after (point)) 32)&#xA;            (= (char-after (point)) 10))&#xA;    (evil-next-line)))&#xA;&#xA;(defun jump-up-to-non-whitespace-char-in-same-column ()&#xA;  (interactive)&#xA;  (evil-previous-line)&#xA;  (while (or (= (char-after (point)) 32)&#xA;            (= (char-after (point)) 10))&#xA;    (evil-previous-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then in my evil-leader config I use &amp;quot;c d&amp;quot; &lt;code&gt;jump-down-to-non-whitespace-char-in-same-column&lt;/code&gt; and &amp;quot;c u&amp;quot; &lt;code&gt;jump-up-to-non-whitespace-char-in-same-column&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8353" LastEditorUserId="17852" LastEditDate="2022-09-09T04:28:48.420" LastActivityDate="2022-09-09T04:28:48.420" Title="How to jump up or down to first non-whitespace character in same column" Tags="|evil|search|motion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="22092" PostTypeId="1" AcceptedAnswerId="22093" CreationDate="2016-05-06T00:43:17.440" Score="4" ViewCount="3363" Body="&lt;p&gt;Whenever, I export my org-documents to html, I notice that by default, &#xA;my source code snippets get placed inside a box, which is good. I don't see the same behavior when I export my org documents as pdfs via latex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So given a paragraph of text, not necessarily source code, how would I place a box around the text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would imagine the solution would look like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_BOX -- how to do this? Any other solution also will do&#xA;&#xA;The quick brown dog jumped over the lazy fox.&#xA;#+BEGIN_SRC python&#xA; print &quot;Hello World&quot;&#xA;#+END_SRC &#xA;&#xA;#+END_BOX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Creates a box around the text and source code after exporting. &lt;/p&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2021-05-27T16:13:46.540" Title="How to place a box around a piece of text in Org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22093" PostTypeId="2" ParentId="22092" CreationDate="2016-05-06T01:49:48.603" Score="4" Body="&lt;p&gt;I use &lt;code&gt;#+BEGIN_mdframed&lt;/code&gt;, and in my LaTeX export use,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER_EXTRA:  \usepackage{mdframed}&#xA;#+LATEX_HEADER_EXTRA: \BeforeBeginEnvironment{minted}{\begin{mdframed}}&#xA;#+LATEX_HEADER_EXTRA: \AfterEndEnvironment{minted}{\end{mdframed}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-05-06T01:49:48.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22094" PostTypeId="2" ParentId="22091" CreationDate="2016-05-06T05:19:41.807" Score="4" Body="&lt;p&gt;I use the following :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun next-line-non-empty-column (arg)&#xA;  &quot;Find next line, on the same column, skipping those that would&#xA;end up leaving point on a space or newline character.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let* ((hpos (- (point) (point-at-bol)))&#xA;         (re (format &quot;^.\\{%s\\}[^\n ]&quot; hpos)))&#xA;    (cond ((&amp;gt; arg 0)&#xA;           (forward-char 1) ; don't match current position (can only happen at column 0)&#xA;           (re-search-forward re))&#xA;          ((&amp;lt; arg 0)&#xA;           (forward-char -1)           ; don't match current position.&#xA;           (re-search-backward re)&#xA;           (goto-char (match-end 0))))&#xA;    ;; now point is after the match, let's go back one column.&#xA;    (forward-char -1)))&#xA;(defun previous-line-non-empty-column (arg)&#xA;  &quot;&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (next-line-non-empty-column (- arg)))&#xA;(global-set-key (kbd &quot;C-S-n&quot;) 'next-line-non-empty-column)&#xA;(global-set-key (kbd &quot;C-S-p&quot;) 'previous-line-non-empty-column)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;IIRC I went for the regexp way because of performance reasons. Not saying that this is the best implementation, but it was better than my previous one (don't remember what it was).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-05-06T05:19:41.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22095" PostTypeId="2" ParentId="22083" CreationDate="2016-05-06T05:35:34.333" Score="2" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/mrkkrp/vimish-fold&quot; rel=&quot;nofollow&quot;&gt;vimish-fold&lt;/a&gt; package to achieve arbitrary code folding in any mode in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2016-05-06T05:35:34.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22096" PostTypeId="1" CreationDate="2016-05-06T10:22:58.723" Score="0" ViewCount="311" Body="&lt;p&gt;Trying to make a small example on how to do IPC with Elisp using Python for the server. My source of information is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Processes.html#Processes&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;&#xA;Here is the code I have right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my-process.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((process-connection-type nil)&#xA;      (arguments (list &quot;./server.py&quot;)))&#xA;  (apply 'start-process &quot;my-process&quot; &quot;*my-process-buffer*&quot; &quot;python&quot; arguments)&#xA;  (set-process-filter (get-process &quot;my-process&quot;) 'my-callback))&#xA;&#xA;(defun my-callback (process msg)&#xA;  (message msg))&#xA;&#xA;(defun kill-my-process ()&#xA;  (interactive)&#xA;  (delete-process &quot;my-process&quot;))&#xA;&#xA;(defun send-to-my-process (msg)&#xA;  (interactive &quot;sEnter message: &quot;)&#xA;  (process-send-string &quot;my-process&quot; (concat msg &quot;\n&quot;)))&#xA;&#xA;(provide my-process)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;server.py&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import sys&#xA;&#xA;sys.stdout.write(&quot;STARTING MY PROCESS!&quot;)&#xA;sys.stdout.flush()&#xA;for line in sys.stdin:&#xA;    sys.stdout.write(line)&#xA;    sys.stdout.flush()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem I have is that the process starts ok, but I can only see &quot;STARTING MY PROCESS!&quot; printed nothing when I do &lt;code&gt;send-to-my-process&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, what do I need to change in order for messaging to work in the above example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;Added suggested fixes.&lt;/p&gt;&#xA;" OwnerUserId="10814" LastEditorUserId="105" LastEditDate="2016-06-22T19:51:14.230" LastActivityDate="2016-06-22T19:51:14.230" Title="Python server with Elisp Emacs client" Tags="|python|emacsclient|subprocess|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22097" PostTypeId="2" ParentId="21741" CreationDate="2016-05-06T10:25:05.380" Score="1" Body="&lt;p&gt;I use this to generate a table of clickable links:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: all-tags&#xA;#+BEGIN_SRC emacs-lisp&#xA;(let ((new (list)))&#xA;  (dolist (tag (org-global-tags-completion-table))&#xA;    (setq tag (car tag))&#xA;    (push (concat &quot;[[tag:&quot; tag &quot;][&quot; tag &quot;]]\n&quot;) new))&#xA;  (sort new 'string&amp;lt;))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: all-tags&#xA;| [[tag:3d][3d]]      |&#xA;| [[tag:Android][Android]] |&#xA;| [[tag:Apple][Apple]]   |&#xA;| [[tag:Arch][Arch]]    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;along with this link style:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-add-link-type &quot;tag&quot; &#xA;  (lambda (tag) &quot;Show tag&quot; org-tags-view nil tag)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It shouldn't be too hard to make that open in a separate frame.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2016-05-06T10:25:05.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22098" PostTypeId="2" ParentId="9464" CreationDate="2016-05-06T11:16:04.553" Score="2" Body="&lt;p&gt;I recommend you having look at emacs-eclim. It uses Eclipse as a backend and provides many feature you'd want, like context aware auto-completion, correction-suggestions, documentation lookup and source navigation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you an overview: So to set it up with an existing project, do &lt;code&gt;$ mvn eclipse:eclipse&lt;/code&gt; inside your project, then open up Eclipse and do a &quot;import existing java project&quot;. Then quit Eclipse, start eclimd in a shell (it'll use the Eclipse workspace you just created) and go back to your happy place (aka Emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've written up how I set it up, as well as several screenshots here: &lt;a href=&quot;http://skybert.net/emacs/java/&quot; rel=&quot;nofollow&quot;&gt;http://skybert.net/emacs/java/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck.&lt;/p&gt;&#xA;" OwnerUserId="9721" LastActivityDate="2016-05-06T11:16:04.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22099" PostTypeId="2" ParentId="22080" CreationDate="2016-05-06T13:03:29.477" Score="1" Body="&lt;p&gt;Not by default, as those column headings are wired into the code of &lt;code&gt;bibtex-completion-candidates-formatter&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you can use the &lt;code&gt;org-ref&lt;/code&gt; package, which redefines that function to display the keywords for each entry.&lt;/p&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2016-05-06T13:03:29.477" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22101" PostTypeId="1" AcceptedAnswerId="25017" CreationDate="2016-05-06T14:16:57.980" Score="14" ViewCount="6969" Body="&lt;p&gt;I've recently switched over from &lt;a href=&quot;https://eclipse.org/cdt/&quot;&gt;Eclipse CDT&lt;/a&gt; to &lt;a href=&quot;http://spacemacs.org&quot;&gt;Spacemacs&lt;/a&gt; with the &lt;a href=&quot;http://spacemacs.org/layers/+lang/c-c++/README.html&quot;&gt;C++ layer&lt;/a&gt; as my development environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far... awesome! However, one of the things I miss about Eclipse is its &lt;a href=&quot;http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fconcepts%2Fcdt_c_indexer.htm&quot;&gt;indexer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I'm using &lt;a href=&quot;https://www.gnu.org/software/global/&quot;&gt;GNU Global&lt;/a&gt; with the &lt;a href=&quot;http://spacemacs.org/layers/gtags/README.html&quot;&gt;gtags&lt;/a&gt; layer. The problem with gtags is that it's a &lt;strong&gt;tagging&lt;/strong&gt; system, not an indexer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching for references for a function called &lt;code&gt;set&lt;/code&gt; in  class &lt;code&gt;Field&lt;/code&gt; returns 165 references in my codebase, only one of which is actually a reference to &lt;code&gt;Field::set&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching for references to &lt;code&gt;set&lt;/code&gt; in CDT returns 1 result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better indexing solution I can use in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching online I found &lt;a href=&quot;http://clang.llvm.org/docs/ExternalClangExamples.html&quot;&gt;this page&lt;/a&gt; where 3 clang based indexers are listed.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Andersbakken/rtags/&quot;&gt;&lt;strong&gt;&lt;code&gt;rtags&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rprichard.github.com/sourceweb/&quot;&gt;&lt;strong&gt;&lt;code&gt;sourceweb&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/exclipy/clang_indexer&quot;&gt;&lt;strong&gt;&lt;code&gt;clang-indexer&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Will any of these offer a better indexing experience?&lt;/li&gt;&#xA;&lt;li&gt;Any suggestion on which to use?&lt;/li&gt;&#xA;&lt;li&gt;Is there a better alternative not listed?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also been using &lt;a href=&quot;https://github.com/Rip-Rip/clang_complete&quot;&gt;&lt;code&gt;clang-complete&lt;/code&gt;&lt;/a&gt; for code completion, but have found it is &lt;strong&gt;very&lt;/strong&gt; slow. Unusably slow. (&lt;a href=&quot;https://www.google.com/search?q=clang_complete+slow&amp;amp;oq=clang_complete+slow&quot;&gt;I am not the only one to experience this&lt;/a&gt;) If any indexing solution suffered from the same problem, it wouldn't work.&lt;/p&gt;&#xA;" OwnerUserId="10922" LastActivityDate="2016-08-02T10:05:32.270" Title="Best C++ indexer?" Tags="|c++|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22102" PostTypeId="2" ParentId="22096" CreationDate="2016-05-06T14:22:41.103" Score="1" Body="&lt;p&gt;On the elisp side, you should send a final newline to the client:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(process-send-string &quot;my-process&quot; (concat msg &quot;\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the python side, you need to flush the output since you're using a pipe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sys.stdout.flush()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-05-06T14:22:41.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22104" PostTypeId="1" CreationDate="2016-05-06T17:05:05.377" Score="0" ViewCount="188" Body="&lt;p&gt;I was wondering if anyone knew a way to mark some files/folder in dired and then colorize (change face for BG/FG) them. this would also need to be saved even after Emacs restarts.&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-05-06T18:02:18.600" LastActivityDate="2016-05-06T18:51:17.453" Title="Dired, colorize (change face) marked files/folder and save between sessions" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22105" PostTypeId="1" CreationDate="2016-05-06T18:09:56.140" Score="2" ViewCount="575" Body="&lt;p&gt;Similar to this &lt;a href=&quot;https://emacs.stackexchange.com/questions/10426/org-mode-link-to-open-directory-in-dired&quot;&gt;Org-mode-link-to-open-directory-in-dired&lt;/a&gt;, however open the link in either:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;new terminal window (e.g. &lt;code&gt;gnome-terminal&lt;/code&gt;, or &lt;code&gt;konsole&lt;/code&gt;) or&lt;/li&gt;&#xA;&lt;li&gt;built-in-shell-emulator-inside-emacs-buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I often need to run additional shell commands to run calculations or view jupyter notebooks and afaik thits is impossible from dired.&lt;/p&gt;&#xA;&lt;p&gt;A small workaround is to open the link in dired and run &lt;code&gt;M-x shell&lt;/code&gt; (&lt;code&gt;SPC '&lt;/code&gt; in spacemacs), but obviously this requires an additional step I would like to avoid.&lt;/p&gt;&#xA;" OwnerUserId="11949" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-05-06T18:09:56.140" Title="Org mode open directory link in Terminal" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22106" PostTypeId="2" ParentId="22074" CreationDate="2016-05-06T18:37:45.093" Score="2" Body="&lt;p&gt;To figure out how to define a key binding that emacs can understand, simply do &lt;code&gt;C-h c&lt;/code&gt; or &lt;code&gt;C-h k&lt;/code&gt; following by pressing the keys you intend to bind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, doing &lt;code&gt;C-h c&lt;/code&gt; followed by &lt;code&gt;Shift+;&lt;/code&gt; gives &lt;code&gt;:&lt;/code&gt;. So you need to bind the command to &lt;code&gt;:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So taking your example, it should be,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-key* &quot;:&quot; #'execute-extended-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-05-06T18:37:45.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22107" PostTypeId="2" ParentId="22104" CreationDate="2016-05-06T18:51:17.453" Score="2" Body="&lt;p&gt;Not limited to Dired, but you can apply faces to any text using library &lt;a href=&quot;https://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow&quot;&gt;Highlight&lt;/a&gt;, and you can ensure that font-lock will respect your highlighting and not override it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can write a command for Dired that highlights, say, the file name of the current line.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-06T18:51:17.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22108" PostTypeId="1" CreationDate="2016-05-06T20:10:48.100" Score="5" ViewCount="658" Body="&lt;p&gt;I would like to use more than two spaces for list indentation. I've had a look at the documentation, but I couldn't find a variable for that. Instead of this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; - First&#xA;   - First&#xA;   - Second&#xA; - Second&#xA;   - First&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;… I would prefer this indentation for better legibility of the indentation levels:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; - First&#xA;     - First&#xA;     - Second&#xA; - Second&#xA;     - First&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="600" LastEditorUserId="600" LastEditDate="2016-05-06T20:20:06.490" LastActivityDate="2016-05-07T10:04:38.813" Title="How can I increase the identation in org-mode lists?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22109" PostTypeId="1" AcceptedAnswerId="22111" CreationDate="2016-05-06T20:15:44.883" Score="9" ViewCount="1833" Body="&lt;p&gt;Here is an illustration of the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; - First item. Pressing M-RET...&#xA; - Another item at the correct position. Now a blank line:&#xA;&#xA; - Next item after blank line. Now press M-RET again...&#xA;&#xA; - .. but now I'm down here!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="600" LastEditorUserId="600" LastEditDate="2016-05-06T20:24:04.630" LastActivityDate="2016-05-07T03:37:59.073" Title="How can I prevent empty lines between lists from causing org-mode to insert blank lines before new items?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22110" PostTypeId="1" AcceptedAnswerId="22174" CreationDate="2016-05-06T20:23:54.843" Score="4" ViewCount="606" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt;, I would like to ensure that the &lt;code&gt;s&lt;/code&gt; package, version 1.10.0 or newer, is installed. If I use &lt;code&gt;(use-package s :ensure t)&lt;/code&gt; it will not upgrade the installation on systems with older versions of &lt;code&gt;s&lt;/code&gt;. How do I ensure that the minimum version is present?&lt;/p&gt;&#xA;" OwnerUserId="2701" LastEditorUserId="2701" LastEditDate="2016-05-06T22:15:14.940" LastActivityDate="2016-05-10T05:47:52.940" Title="Ensuring a minimum version with use-package" Tags="|package|use-package|version-support|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22111" PostTypeId="2" ParentId="22109" CreationDate="2016-05-06T20:49:26.040" Score="10" Body="&lt;p&gt;You can configure that using the &lt;code&gt;org-blank-before-new-entry&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have set that to &lt;code&gt;'((heading) (plain-list-item))&lt;/code&gt; so that such blank lines are not auto-inserted after &lt;code&gt;M-RET&lt;/code&gt; for headings and list items.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also set just the &lt;code&gt;cdr&lt;/code&gt; of the element with &lt;code&gt;plain-list-item&lt;/code&gt; to nil to get exactly what want by doing:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setcdr (assoc 'plain-list-item org-blank-before-new-entry) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Have a look at &lt;code&gt;C-h v org-blank-before-new-entry&lt;/code&gt; output.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Should &lt;code&gt;org-insert-heading&lt;/code&gt; leave a blank line before new heading/item? &#xA;  The value is an alist, with &lt;code&gt;heading&lt;/code&gt; and &lt;code&gt;plain-list-item&lt;/code&gt; as CAR, &#xA;  and a boolean flag as CDR.  The cdr may also be the symbol &lt;code&gt;auto&lt;/code&gt;, in &#xA;  which case Org will look at the surrounding headings/items and try to &#xA;  make an intelligent decision whether to insert a blank line or not.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's default value is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((heading . auto) (plain-list-item . auto))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what are are seeing is expected.. as you had a blank line before the &quot;- Next item after blank line. Now press M-RET again...&quot; list item, it inserted a blank line before &quot;- .. but now I'm down here!&quot; too.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-07T03:37:59.073" LastActivityDate="2016-05-07T03:37:59.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22112" PostTypeId="2" ParentId="10954" CreationDate="2016-05-06T20:59:13.727" Score="2" Body="&lt;p&gt;You may want to have a look at the &lt;code&gt;orgtbl-aggregate&lt;/code&gt; package on Melpa or here: &lt;a href=&quot;https://github.com/tbanel/orgaggregate&quot; rel=&quot;nofollow&quot;&gt;https://github.com/tbanel/orgaggregate&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: aggregate :table &quot;tbl1&quot; :cols &quot;Name count() vsum((Value)&quot;&#xA;| Name | count() | vsum((Value) |&#xA;|------+---------+--------------|&#xA;| A    |       2 |            4 |&#xA;| B    |       1 |            2 |&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Aggregation is made on the &lt;code&gt;NAME&lt;/code&gt; column&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;count()&lt;/code&gt; stands for &lt;code&gt;Frequency&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;vsum(Value)&lt;/code&gt; column contains the desired sums.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11716" LastActivityDate="2016-05-06T20:59:13.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22113" PostTypeId="1" CreationDate="2016-05-06T22:02:35.887" Score="10" ViewCount="1917" Body="&lt;p&gt;I am trying to configure Emacs to save UTF-8 files with a Byte Order Mark. (Yes, I know that the &lt;a href=&quot;http://www.php-fig.org/psr/psr-1/#2-2-character-encoding&quot; rel=&quot;noreferrer&quot;&gt;BOM is evil&lt;/a&gt; and &lt;a href=&quot;http://www.unicode.org/versions/Unicode5.0.0/ch02.pdf#page=30&quot; rel=&quot;noreferrer&quot;&gt;unnecessary&lt;/a&gt; &lt;a href=&quot;https://stackoverflow.com/a/2223926/2747593&quot;&gt;for UTF-8&lt;/a&gt; files. However, &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/windows/desktop/dd374101%28v=vs.85%29.aspx&quot; rel=&quot;noreferrer&quot;&gt;Microsoft has decided&lt;/a&gt; &lt;a href=&quot;https://stackoverflow.com/a/4655335/2747593&quot;&gt;they know better&lt;/a&gt;, so I want to make sure I'm able to save files with BOM.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for some reason my choice of &lt;code&gt;utf-8-with-signature&lt;/code&gt; for &lt;code&gt;buffer-file-coding-system&lt;/code&gt; won't stick when I save the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.5.1 on Windows 10. To reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs -Q&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Open a file (optionally one that already has a BOM).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(setq buffer-file-coding-system 'utf-8-with-signature)&lt;/code&gt; (Or &lt;code&gt;M-x set-buffer-file-coding-system RET utf-8-with-signature RET&lt;/code&gt;.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-s&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v buffer-file-coding-system&lt;/code&gt;. It is now set to &lt;code&gt;utf-8-dos&lt;/code&gt;. I also verified that the existing BOM was removed from the file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Why is this happening, and how can I fix it?&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-10-19T00:03:52.863" Title="How can I save UTF-8 files with a Byte Order Mark?" Tags="|character-encoding|unicode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22114" PostTypeId="1" CreationDate="2016-05-07T02:24:03.950" Score="2" ViewCount="713" Body="&lt;p&gt;I have rust-mode installed on my Emacs 24.4. The tab indentation I have is 2 whitespaces, however in Rust mode it's different. I want to setup  the tab indentation size for rust-mode, how can I do that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And actually, not only for rust mode, for other languages such as Python too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or I think it's better for me to setup it globally regardless of the setting for each **-mode package. &lt;/p&gt;&#xA;" OwnerUserId="11957" LastActivityDate="2016-05-07T06:51:06.977" Title="How can I setup the tab indentation size for ***-mode (Rust, Python, Ruby, etc)?" Tags="|indentation|rust|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22115" PostTypeId="1" AcceptedAnswerId="22126" CreationDate="2016-05-07T04:55:34.533" Score="4" ViewCount="2348" Body="&lt;p&gt;I can only set color and font-face for Level between 1 to 8. Is there a way to set heading color for Org Level 9 and beyond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZP9Ia.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZP9Ia.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AX0xX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AX0xX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9931" LastEditorUserId="105" LastEditDate="2016-05-07T05:08:32.103" LastActivityDate="2020-10-06T14:35:57.033" Title="How to set Org-mode heading color for level after 8?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22116" PostTypeId="2" ParentId="22114" CreationDate="2016-05-07T06:51:06.977" Score="2" Body="&lt;p&gt;In general, you can do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook '&amp;lt;foo&amp;gt;-mode-hook (lambda () (setq tab-width 4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you have a single global default you prefer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default tab-width &amp;lt;number you like&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-05-07T06:51:06.977" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22118" PostTypeId="1" AcceptedAnswerId="22153" CreationDate="2016-05-07T07:02:24.440" Score="1" ViewCount="311" Body="&lt;p&gt;I'm using pdftools when displaying pdfs and it would be nice if emacs could bookmark the pdf with the default filename when I kill that buffer. I've got something like this, but it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Set a bookmark on kill&#xA;(add-hook 'kill-buffer-hook `bookmark-set)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've remarked out all my configuration apart from the add-hook line above. When I open up a pdf file which I want to test with bookmarking on exit I get the following error;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bookmark-buffer-file-name: Buffer not visiting a file or directory&#xA;Making completion list... [2 times]&#xA;File Linux-Voice-Issue-027.pdf is large (73.0M), really open? (y or n) y&#xA;File mode specification error: (error &quot;Buffer not visiting a file or directory&quot;)&#xA;bookmark-buffer-file-name: Buffer not visiting a file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After putting the code 'chen bin' has suggested I'm getting a lot further. However now when I commit a change using Magit I get the following error and the commit buffer doesn't close, although the commit happens.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Type C-c C-c to finish, or C-c C-k to cancel&#xA;Saving file /home/map7/testgit/.git/COMMIT_EDITMSG...&#xA;Wrote /home/map7/testgit/.git/COMMIT_EDITMSG&#xA;string=: Wrong type argument: char-or-string-p, nil&#xA;Git finished&#xA;(No files need saving)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now understand that I also need to test if my buffer file I'm closing has an extension.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-buffer-hook-setup ()&#xA;  (if (and buffer-file-name&#xA;           (file-name-extension buffer-file-name)&#xA;           (string= (downcase (file-name-extension buffer-file-name)) &quot;pdf&quot;)&#xA;           (yes-or-no-p &quot;Set bookmark with current file name?&quot;))&#xA;      (bookmark-set (file-name-nondirectory buffer-file-name) nil)))&#xA;(add-hook 'kill-buffer-hook 'kill-buffer-hook-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9463" LastEditorUserId="9463" LastEditDate="2016-05-09T10:46:45.110" LastActivityDate="2016-05-09T11:27:20.507" Title="bookmark on kill-buffer-hook" Tags="|buffers|hooks|bookmarks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22119" PostTypeId="1" CreationDate="2016-05-07T07:16:33.237" Score="2" ViewCount="150" Body="&lt;p&gt;I have a directory &lt;code&gt;~/foo/&lt;/code&gt; containing lots of  &lt;code&gt;.org&lt;/code&gt; files. These files are generated by a script and I want to export them to &lt;code&gt;.txt&lt;/code&gt; files. I currently use &lt;a href=&quot;https://github.com/fniessen/orgmk&quot; rel=&quot;nofollow&quot;&gt;orgmk&lt;/a&gt; (specifically &lt;code&gt;org2txt&lt;/code&gt;) to do this. My script is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for file in ~/foo/*.org; do&#xA;    org2txt ${file}&#xA;done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that this is &lt;em&gt;slow&lt;/em&gt;. The documentation for orgmk mentions something about orgmk scripts having the capability to export all org documents under a directory recursively but I can't seem to figure out the commands to do this. Does anyone know how to speed up my script?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2017-10-04T17:24:13.940" Title="Can orgmk scripts accept multiple arguments?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22120" PostTypeId="2" ParentId="22108" CreationDate="2016-05-07T10:04:38.813" Score="4" Body="&lt;p&gt;I've overlooked the variable that controls it: &lt;code&gt;org-list-indent-offset&lt;/code&gt;. I've added this now to my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default org-list-indent-offset 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="600" LastActivityDate="2016-05-07T10:04:38.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22121" PostTypeId="2" ParentId="20720" CreationDate="2016-05-07T12:05:44.627" Score="18" Body="&lt;p&gt;You can use as many captions as you like, one after the other:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: Lorem ipsum dolor sit amet, consectetur adipiscing elit, &#xA;#+CAPTION: sed do eiusmod tempor incididunt ut labore et dolore magna&#xA;#+CAPTION: aliqua. Ut enim ad minim veniam, quis nostrud exercitation &#xA;#+NAME: fig01&#xA;[[file:./figs/fig01.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11172" LastActivityDate="2016-05-07T12:05:44.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22122" PostTypeId="1" AcceptedAnswerId="22123" CreationDate="2016-05-07T14:40:51.577" Score="0" ViewCount="118" Body="&lt;p&gt;I want to insert a timestamp under &lt;code&gt;org-mode&lt;/code&gt;. As stated in the official tutorial of org-mode, &lt;code&gt;C-c .&lt;/code&gt; should be enough for inserting a timestamp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I type &lt;code&gt;C-c .&lt;/code&gt;, it shows &lt;code&gt;C-c .-&lt;/code&gt; and is waiting for one more input. If I then type other keyboards, Emacs says that this command is undefined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start Emacs with &lt;code&gt;emacs -Q&lt;/code&gt; and type &lt;code&gt;C-c .&lt;/code&gt;, I get &lt;code&gt;C-c . is undefined&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is going on, and what am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="11959" LastEditorUserId="253" LastEditDate="2016-05-07T23:16:33.420" LastActivityDate="2016-05-07T23:16:33.420" Title="Why there is a dash after I type C-c . (period)?" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22123" PostTypeId="2" ParentId="22122" CreationDate="2016-05-07T14:58:45.813" Score="4" Body="&lt;p&gt;If it's waiting for more keys, then &lt;code&gt;C-c .&lt;/code&gt; is a &lt;em&gt;prefix binding&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;C-h&lt;/code&gt; next (or alternatively &lt;code&gt;&amp;lt;f1&amp;gt;&lt;/code&gt;), and Emacs will show you what is available under that prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default (in Emacs 24.5) &lt;code&gt;C-c .&lt;/code&gt; is indeed bound directly to &lt;code&gt;org-time-stamp&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; buffers; so something in your own config has clobbered that binding, by the sounds of it.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-07T14:58:45.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22124" PostTypeId="1" CreationDate="2016-05-07T15:09:49.927" Score="4" ViewCount="256" Body="&lt;p&gt;This is a bit of an esoteric request so I will try to phrase it clearly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently beginning to learn colemak and doing so through a series of transitional layouts that go by the group name of tarmak. On top of that, I use evil-mode so the spacial relationship between different keybindings is important. Since these tarmak layouts are only temporary, It would be nice to not have to rebind everything repeatedly as I get gradually closer and closer to full colemak.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a emacs package or snippet of code that can remap keys depending on the current keyboard layout of the computer such that the spacial position of keybindings does not change?&lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2021-04-27T17:09:00.970" Title="Generate dynamic keybindings depending on keyboard layout" Tags="|key-bindings|evil|keyboard-layout|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22125" PostTypeId="1" CreationDate="2016-05-07T15:14:28.437" Score="0" ViewCount="53" Body="&lt;p&gt;Does anyone know or has coded some mechanism (using helm/swiper/other) to quickly insert complex commands when issuing &lt;code&gt;dired-do-async-shell-command&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I want to stand on a folder and issue:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;filebot -script fn:amc --output &quot;~/ZH_tmp/fbt/&quot; --action copy -non-strict &quot;DIRED FOLDERFILE&quot; --log-file amc.log --def excludeList=amc.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hate to manually enter it or paste it each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking it could be cool to press &amp;amp; (with a prefix or a function) and then be presented with a list of command I can quick filter via helm/swiper and enter into dired.&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="675" LastEditDate="2016-05-08T18:12:09.330" LastActivityDate="2016-05-08T18:12:09.330" Title="quick insert pre stored commands to dired-do-async-shell-command" Tags="|dired|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22126" PostTypeId="2" ParentId="22115" CreationDate="2016-05-07T15:26:13.597" Score="6" Body="&lt;p&gt;As you can guess from your screenshot, the face for level 9 is the same as the face for level 1. You can confirm this by hitting &lt;code&gt;C-u C-x =&lt;/code&gt; with your cursor on a level 9 headline which shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;There are text properties here:&#xA;  face                 org-level-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;AFAICT, if you want a different face for level 9 (and further), it involves adding one or more new faces (with e.g. &lt;code&gt;defface&lt;/code&gt;), changing the defconst &lt;code&gt;org-level-faces&lt;/code&gt; (add your new face(s) there) and change the value of &lt;code&gt;org-n-level-faces&lt;/code&gt;. e.g. the following should work (only lightly tested) :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(progn&#xA;  (defface org-level-9 ;; originally copied from org-level-8&#xA;    (org-compatible-face nil ;; not inheriting from outline-9 because that does not exist&#xA;      '((((class color) (min-colors 16) (background light)) (:foreground &quot;RosyBrown&quot;))&#xA;        (((class color) (min-colors 16) (background dark)) (:foreground &quot;LightSalmon&quot;))&#xA;        (((class color) (min-colors 8)) (:foreground &quot;green&quot;))))&#xA;    &quot;Face used for level 9 headlines.&quot;&#xA;    :group 'org-faces)&#xA;  (setq org-level-faces (append org-level-faces (list 'org-level-9)))&#xA;  (setq org-n-level-faces (length org-level-faces)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-05-07T15:26:13.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22128" PostTypeId="1" AcceptedAnswerId="22133" CreationDate="2016-05-07T18:09:59.850" Score="6" ViewCount="2550" Body="&lt;p&gt;I use org-refile quite a bit, but for my use-case, I want to refile my org-mode subtrees not to an org-agenda file, but to the current file or another file I'm currently visiting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a way of doing this that was working correctly, but now has stopped working. I'm not sure what I changed that broke it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code I'm using for org-refile:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-outline-path-complete-in-steps nil) ; Refile in a single go &#xA;(setq org-completion-use-ido nil) &#xA;(setq org-refile-use-outline-path t) ; Show full paths for refiling &#xA;(setq org-refile-allow-creating-parent-nodes (quote confirm)) ; allow refile to create parent tasks with confirmation&#xA;&#xA;(defun my-org-files-list ()&#xA; (mapcar (lambda (buffer)&#xA;   (buffer-file-name buffer))&#xA;   (org-buffer-list 'files t))) &#xA;&#xA;(setq org-refile-targets '((my-org-files-list :maxlevel . 3))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again, this used to work. But now when I run org-refile, I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  get-file-buffer(nil)&#xA;  org-find-base-buffer-visiting(nil)&#xA;  org-get-agenda-file-buffer(nil)&#xA;  org-refile-get-targets(nil (#(&quot;this&quot; 0 4 (fontified t face org-level-1))))&#xA;  org-refile-get-location(&quot;Refile subtree \&quot;this\&quot; to&quot; nil confirm nil)&#xA;  org-refile(nil)&#xA;  call-interactively(org-refile record nil)&#xA;  command-execute(org-refile record)&#xA;  execute-extended-command(nil &quot;org-refile&quot;)&#xA;  call-interactively(execute-extended-command nil nil)&#xA;  command-execute(execute-extended-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to fix this? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-05-07T22:33:15.873" Title="how to org-refile to a target within the current file?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22130" PostTypeId="1" AcceptedAnswerId="22131" CreationDate="2016-05-07T19:24:46.303" Score="2" ViewCount="743" Body="&lt;p&gt;So currently I have this preamble for all my org files. Does anyone know how to make org-mode default to the above settings whenever I open a .org file? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: latexpreview&#xA;#+LATEX_HEADER: \usepackage{tcolorbox}&#xA;#+LATEX_HEADER: \usepackage{amsmath}&#xA;#+LATEX_HEADER: \newcommand{\vsp}{\vspace{4mm}}&#xA;#+LATEX_HEADER: \newcommand{\la}{\leftarrow}&#xA;#+LATEX_HEADER: \newcommand{\ra}{\rightarrow}&#xA;#+LATEX_HEADER: \newcommand{\ua}{\uparrow}&#xA;#+LATEX_HEADER: \newcommand{\da}{\downarrow}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2016-05-07T20:03:00.183" Title="How to change org-mode settings to always include a certain preamble" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22131" PostTypeId="2" ParentId="22130" CreationDate="2016-05-07T20:03:00.183" Score="5" Body="&lt;p&gt;I think you can achieve this through &lt;code&gt;M-x org-customize&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Entry &lt;code&gt;Org startup / Org startup with latex preview&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Entry &lt;code&gt;Org Export LaTeX / Org Latex Packages Alist&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alist of packages to be inserted in every LaTeX header&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Entry &lt;code&gt;Org Export LaTeX / Org Latex Classes&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alist of LaTeX classes and associated header and structure&#xA;  [...]&#xA;  The HEADER-STRING is the header that will be inserted into the&#xA;  LaTeX file. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-05-07T20:03:00.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22132" PostTypeId="1" AcceptedAnswerId="22139" CreationDate="2016-05-07T21:34:20.847" Score="4" ViewCount="1933" Body="&lt;p&gt;I'm looking for something similar to Eldoc mode (hover over a function and the parameter list appears in the minibuffer), only I'd like to have a help buffer appear, as if I had just run &lt;code&gt;describe-function&lt;/code&gt;.  Is there a minor mode that will do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having the help buffer be in a separate frame would be ideal, but I can figure that out at a later point.  Funnily enough, I think I saw something like this for SLIME, but I haven't been able to find it again.&lt;/p&gt;&#xA;" OwnerDisplayName="user2267" LastActivityDate="2020-02-24T22:58:20.290" Title="Help Buffer on Hover Possible?" Tags="|point|documentation|slime|help|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22133" PostTypeId="2" ParentId="22128" CreationDate="2016-05-07T22:33:15.873" Score="5" Body="&lt;p&gt;The eventual list of targets derived from the variable &lt;code&gt;org-refile-targets&lt;/code&gt; by &lt;code&gt;org-refile-get-targets&lt;/code&gt; needs to be valid buffers or files, or else &lt;code&gt;org-get-agenda-file-buffer&lt;/code&gt; will complain when it uses &lt;code&gt;org-find-base-buffer-visiting&lt;/code&gt;.  The original custom function &lt;code&gt;my-org-files-list&lt;/code&gt; will return one or more &lt;code&gt;nil&lt;/code&gt; entries in the list when there are non-file-visiting-buffers in &lt;code&gt;org-mode&lt;/code&gt;.  The solution is to delete the &lt;code&gt;nil&lt;/code&gt; entries from the list using &lt;code&gt;delq&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-files-list ()&#xA;  (delq nil&#xA;    (mapcar (lambda (buffer)&#xA;      (buffer-file-name buffer))&#xA;      (org-buffer-list 'files t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-05-07T22:33:15.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22134" PostTypeId="1" AcceptedAnswerId="22135" CreationDate="2016-05-08T03:58:59.740" Score="2" ViewCount="3576" Body="&lt;p&gt;I'm trying to enable agenda-view and use agenda features under &lt;code&gt;org-mode&lt;/code&gt;.&lt;br&gt;&#xA;As per the org-mode manual - &lt;a href=&quot;http://orgmode.org/org.html#Agenda-files&quot; rel=&quot;nofollow&quot;&gt;Agenda section&lt;/a&gt; pressing the key sequence &lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;c&lt;/kbd&gt; + &lt;kbd&gt;a&lt;/kbd&gt; followed by &lt;kbd&gt;a&lt;/kbd&gt; &lt;code&gt;to create calendar like agenda&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this and it did not work. Then I saw the link for &lt;a href=&quot;http://orgmode.org/org.html#Activation&quot; rel=&quot;nofollow&quot;&gt;Activation&lt;/a&gt; to activate agenda view and also updated the &lt;code&gt;.emacs&lt;/code&gt; file as shown below  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is for org-mode agenda view activation&#xA; '(add-to-list 'auto-mode-alist '(&quot;\\.org\\'&quot; . org-mode))&#xA; ;; This is for key bindings to invoke agenda mode (see line-2)&#xA; '(global-set-key &quot;\C-cl&quot; 'org-store-link)&#xA; '(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA; '(global-set-key &quot;\C-cc&quot; 'org-capture)&#xA; '(global-set-key &quot;\C-cb&quot; 'org-iswitchb)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I restarted emacs twice. But nothing seems to work. I was following this &lt;a href=&quot;https://www.youtube.com/watch?v=fgizHHd7nOo&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; video in order to see if I can make use of agenda feature in org-mode  &lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="10936" LastEditDate="2016-05-08T12:06:43.087" LastActivityDate="2016-05-08T12:06:43.087" Title="How to enable agenda view in org mode" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22135" PostTypeId="2" ParentId="22134" CreationDate="2016-05-08T04:15:28.730" Score="9" Body="&lt;p&gt;You are quoting those lists, so they won't actually do anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try removing the leading &quot;&lt;code&gt;'&lt;/code&gt;&quot;s like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is for org-mode agenda view activation&#xA; (add-to-list 'auto-mode-alist '(&quot;\\.org\\'&quot; . org-mode))&#xA; ;; This is for key bindings to invoke agenda mode (see line-2)&#xA; (global-set-key &quot;\C-cl&quot; 'org-store-link)&#xA; (global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA; (global-set-key &quot;\C-cc&quot; 'org-capture)&#xA; (global-set-key &quot;\C-cb&quot; 'org-iswitchb)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In ELISP, when a list is quoted like this, nothing inside of it gets evaluated. This is handy when you want to pass around literal lists, but serves your purpose poorly in this case.&lt;/p&gt;&#xA;" OwnerUserId="2039" LastActivityDate="2016-05-08T04:15:28.730" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22136" PostTypeId="1" AcceptedAnswerId="22137" CreationDate="2016-05-08T04:56:35.810" Score="2" ViewCount="1187" Body="&lt;p&gt;I often color in red some key-words in my latex-notes taken in Org-mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I often end up using &lt;code&gt;\textcolor{pink}{Blah Blah}&lt;/code&gt; all over my notes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to bind &lt;code&gt;Alt+F12&lt;/code&gt; to automatically expand into this snippet&#xA;with the cursor positioned on the second pair-of braces ready for input. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would we do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Spacemacs wrapped around emacs-24.5&lt;/p&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2016-05-08T05:48:42.403" Title="Keybinding to insert a snippet of text." Tags="|key-bindings|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22137" PostTypeId="2" ParentId="22136" CreationDate="2016-05-08T05:46:52.810" Score="4" Body="&lt;p&gt;Not sure it's the best way to do that, but that works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/insert-pink ()&#xA;  (interactive)&#xA;  (insert &quot;\\textcolor{pink}{}&quot;)&#xA;  (backward-char))&#xA;&#xA;(defun my/add-org-pink-binding ()&#xA;   (local-set-key (kbd &quot;&amp;lt;M-f12&amp;gt;&quot;) #'my/insert-pink))&#xA;&#xA;(add-hook 'org-mode-hook #'my/add-org-pink-binding)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-05-08T05:46:52.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22138" PostTypeId="2" ParentId="22136" CreationDate="2016-05-08T05:48:42.403" Score="1" Body="&lt;pre&gt;&lt;code&gt;(defun my-insert-snippet ()&#xA;  &quot;Insert snippet and move point.&quot;&#xA;  (interactive)&#xA;  (insert &quot;\\textcolor{pink}{Blah Blah}&quot;)&#xA;  (backward-word 2))&#xA;(global-set-key (kbd &quot;M-&amp;lt;f12&amp;gt;&quot;) 'my-insert-snippet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="890" LastActivityDate="2016-05-08T05:48:42.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22139" PostTypeId="2" ParentId="22132" CreationDate="2016-05-08T09:21:45.370" Score="3" Body="&lt;p&gt;For years I've used the &lt;code&gt;rgr/context-help&lt;/code&gt; solution from the &lt;a href=&quot;https://www.emacswiki.org/emacs/ElDoc&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsWiki&lt;/a&gt; for this, with some slight tweaks. A few aspects still bothered me, though, so this question inspired me to write a new variant of that as a global minor mode. Among other differences, this utilises &lt;code&gt;help-xref-interned&lt;/code&gt; to display &lt;em&gt;all&lt;/em&gt; (variable, function, face) kinds of help for a symbol instead of arbitrarily choosing between &lt;code&gt;describe-function&lt;/code&gt; and &lt;code&gt;describe-variable&lt;/code&gt; when both cells are defined.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode my-contextual-help-mode&#xA;  &quot;Show help for the elisp symbol at point in the current *Help* buffer.&#xA;&#xA;Advises `eldoc-print-current-symbol-info'.&quot;&#xA;  :lighter &quot; C-h&quot;&#xA;  :global t&#xA;  (require 'help-mode) ;; for `help-xref-interned'&#xA;  (when (eq this-command 'my-contextual-help-mode)&#xA;    (message &quot;Contextual help is %s&quot; (if my-contextual-help-mode &quot;on&quot; &quot;off&quot;)))&#xA;  (and my-contextual-help-mode&#xA;       (eldoc-mode 1)&#xA;       (if (fboundp 'eldoc-current-symbol)&#xA;           (eldoc-current-symbol)&#xA;         (elisp--current-symbol))&#xA;       (my-contextual-help :force)))&#xA;&#xA;(defadvice eldoc-print-current-symbol-info (before my-contextual-help activate)&#xA;  &quot;Triggers contextual elisp *Help*. Enabled by `my-contextual-help-mode'.&quot;&#xA;  (and my-contextual-help-mode&#xA;       (derived-mode-p 'emacs-lisp-mode)&#xA;       (my-contextual-help)))&#xA;&#xA;(defvar-local my-contextual-help-last-symbol nil&#xA;  ;; Using a buffer-local variable for this means that we can't&#xA;  ;; trigger changes to the help buffer simply by switching windows,&#xA;  ;; which seems generally preferable to the alternative.&#xA;  &quot;The last symbol processed by `my-contextual-help' in this buffer.&quot;)&#xA;&#xA;(defun my-contextual-help (&amp;amp;optional force)&#xA;  &quot;Describe function, variable, or face at point, if *Help* buffer is visible.&quot;&#xA;  (let ((help-visible-p (get-buffer-window (help-buffer))))&#xA;    (when (or help-visible-p force)&#xA;      (let ((sym (if (fboundp 'eldoc-current-symbol)&#xA;                     (eldoc-current-symbol)&#xA;                   (elisp--current-symbol))))&#xA;        ;; We ignore keyword symbols, as their help is redundant.&#xA;        ;; If something else changes the help buffer contents, ensure we&#xA;        ;; don't immediately revert back to the current symbol's help.&#xA;        (and (not (keywordp sym))&#xA;             (or (not (eq sym my-contextual-help-last-symbol))&#xA;                 (and force (not help-visible-p)))&#xA;             (setq my-contextual-help-last-symbol sym)&#xA;             sym&#xA;             (save-selected-window&#xA;               (help-xref-interned sym)))))))&#xA;&#xA;(defun my-contextual-help-toggle ()&#xA;  &quot;Intelligently enable or disable `my-contextual-help-mode'.&quot;&#xA;  (interactive)&#xA;  (if (get-buffer-window (help-buffer))&#xA;      (my-contextual-help-mode 'toggle)&#xA;    (my-contextual-help-mode 1)))&#xA;&#xA;(my-contextual-help-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2020-02-24T22:58:20.290" LastActivityDate="2020-02-24T22:58:20.290" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="22140" PostTypeId="1" AcceptedAnswerId="22148" CreationDate="2016-05-08T09:45:28.920" Score="4" ViewCount="448" Body="&lt;p&gt;When I typed &lt;code&gt;git diff&lt;/code&gt; in &lt;code&gt;eshell&lt;/code&gt;, it has weird attribute such like print &lt;code&gt;:&lt;/code&gt; in every single line, cannot scroll back, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this is because the default eshell env PAGER is set as &lt;code&gt;less&lt;/code&gt;, and I checked with typing &lt;code&gt;echo $PAGER&lt;/code&gt; which returns a result, &lt;code&gt;less&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as I wrote &lt;code&gt;(setenv &quot;VISUAL&quot; &quot;emacsclient&quot;)&lt;/code&gt; in my &lt;code&gt;init.el&lt;/code&gt;, I added &lt;code&gt;(setenv &quot;PAGER&quot; &quot;emacsclient&quot;)&lt;/code&gt; line. However, it failed and I found that &lt;code&gt;emacsclient&lt;/code&gt; doesn't support pipe, which means &lt;code&gt;echo aaaa | emacsclient&lt;/code&gt; ended with an error. and I heard about magit, but I don't think it is a general solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any solution to set $PAGER to work properly with &lt;code&gt;eshell&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or How can I make &lt;code&gt;emacsclient&lt;/code&gt; to support pipe in eshell?&lt;/p&gt;&#xA;" OwnerUserId="11968" LastActivityDate="2016-05-08T18:01:06.080" Title="How can I use 'emacsclient' as $PAGER in eshell with pipe? or any better PAGER which works well with eshell?" Tags="|eshell|environment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22142" PostTypeId="1" CreationDate="2016-05-08T10:46:49.533" Score="3" ViewCount="1972" Body="&lt;p&gt;I am trying to install &lt;a href=&quot;https://github.com/ralesi/ranger.el&quot; rel=&quot;nofollow&quot; title=&quot;ranger&quot;&gt;ranger&lt;/a&gt; in emacs and&#xA;added this one to my &lt;strong&gt;.emacs&lt;/strong&gt; file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ranger.el)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/lisp/ranger/&quot;)&#xA;(load 'ranger')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following error when I open Emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Cannot open load file, ranger.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I tried to &lt;a href=&quot;https://github.com/ralesi/ranger.el/blob/master/tests/compile.bat&quot; rel=&quot;nofollow&quot; title=&quot;compile&quot;&gt;compile&lt;/a&gt; the byte code I get the following error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Entering directory `c:/Users/nneel/.emacs.d/lisp/ranger/'&#xA;`ranger.el:84:1:Error: Cannot open load file: subr-x`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using GNU Emacs 24.3.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now what am I supposed to do to rectify this error?&lt;/p&gt;&#xA;" OwnerUserId="11969" LastEditorUserId="306" LastEditDate="2016-05-08T11:42:17.783" LastActivityDate="2016-05-08T11:48:21.257" Title="cannot open load file: subr-x" Tags="|init-file|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22143" PostTypeId="2" ParentId="22142" CreationDate="2016-05-08T11:48:21.257" Score="3" Body="&lt;p&gt;Ranger requires &lt;a href=&quot;https://github.com/ralesi/ranger.el/blob/9db73d61de2e4b9caeca50f220c1f4a8a1e7cfb6/ranger.el#L9&quot; rel=&quot;nofollow&quot;&gt;Emacs 24.4 or newer&lt;/a&gt; and does simply not support Emacs 24.3 anymore.  You'll need to upgrade your Emacs version to use this extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Had you followed &lt;a href=&quot;https://github.com/ralesi/ranger.el#installation&quot; rel=&quot;nofollow&quot;&gt;ranger's installation instructions&lt;/a&gt; Emacs' built-in package manager would have told you that ranger doesn't support your version of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you install packages manually it's &lt;strong&gt;your responsibility&lt;/strong&gt; to check their version requirements and make sure that your Emacs version is supported.  &lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-05-08T11:48:21.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22144" PostTypeId="1" CreationDate="2016-05-08T12:37:01.070" Score="2" ViewCount="100" Body="&lt;p&gt;I am using my capslock key as a prefix key and have already set &quot;capslock-v&quot; to 'helm-show-kill-ring. This however does not work with copying outside code into emacs so now I want a set up as such:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;capslock-v (wait 1 sec) 'helm-show-kill-ring&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;capslock-vv 'yank&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do this? Here is the relevant portion of my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq w32-enable-caps-lock nil)&#xA;&#xA;(progn&#xA;  ;; define a prefix keymap&#xA;  (define-prefix-command 'my-modes-key-map)&#xA;&#xA;  (define-key my-modes-key-map (kbd &quot;v&quot;) 'helm-show-kill-ring)  &#xA;  (key-chord-define my-modes-key-map (kbd &quot;vv&quot;) 'yank) &#xA;&#xA;  )&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;capslock&amp;gt;&quot;) my-modes-key-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11955" LastActivityDate="2016-05-08T12:37:01.070" Title="using prefix binding along with Key-chord binding" Tags="|key-bindings|keymap|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22146" PostTypeId="1" CreationDate="2016-05-08T16:58:40.227" Score="1" ViewCount="537" Body="&lt;p&gt;So, I'm trying out spaceline, I have a few problems I can't figure out.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;My segments does not display correctly, there is a weird display conflict that look like small boxes between each segment, is this a bug or can it be fixed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/glxv5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/glxv5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't know what is the &quot;Mod&quot; next to &quot;Git:master&quot;. How do I get rid of this? I tried switching off most of the segments, does not seem to have any effect on the &quot;Mod&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I want to force spaceline to always show buffer-position and hud. When I navigate blocks of text, I'll sometimes see the hud and buffer-position, but mostly I see &quot;ALL&quot; or &quot;END&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a way to change the highlight color in the modeline from orange to custom color?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 01:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;MOD&quot; at the end of &quot;Git:master&quot; is controlled by the version-control variable, I think it indicates a modification on current branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there no way to turn that off?&lt;/p&gt;&#xA;" OwnerUserId="11976" LastEditorDisplayName="user227" LastEditDate="2016-05-08T20:43:23.413" LastActivityDate="2016-05-08T20:43:23.413" Title="Some spaceline questions" Tags="|spacemacs|mode-line|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22147" PostTypeId="2" ParentId="19843" CreationDate="2016-05-08T16:59:22.930" Score="7" Body="&lt;p&gt;As you mentioned in your updated question, &lt;code&gt;org-after-todo-statistics-hook&lt;/code&gt; isn't what you want. What you want is &lt;code&gt;org-checkbox-statistics-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this function to do what you describe (they should really get this functionality into org-mode):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-checkbox-todo ()&#xA;  &quot;Switch header TODO state to DONE when all checkboxes are ticked, to TODO otherwise&quot;&#xA;  (let ((todo-state (org-get-todo-state)) beg end)&#xA;    (unless (not todo-state)&#xA;      (save-excursion&#xA;    (org-back-to-heading t)&#xA;    (setq beg (point))&#xA;    (end-of-line)&#xA;    (setq end (point))&#xA;    (goto-char beg)&#xA;    (if (re-search-forward &quot;\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]&quot;&#xA;                   end t)&#xA;        (if (match-end 1)&#xA;        (if (equal (match-string 1) &quot;100%&quot;)&#xA;            (unless (string-equal todo-state &quot;DONE&quot;)&#xA;              (org-todo 'done))&#xA;          (unless (string-equal todo-state &quot;TODO&quot;)&#xA;            (org-todo 'todo)))&#xA;          (if (and (&amp;gt; (match-end 2) (match-beginning 2))&#xA;               (equal (match-string 2) (match-string 3)))&#xA;          (unless (string-equal todo-state &quot;DONE&quot;)&#xA;            (org-todo 'done))&#xA;        (unless (string-equal todo-state &quot;TODO&quot;)&#xA;          (org-todo 'todo)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'org-checkbox-statistics-hook 'my/org-checkbox-todo)&lt;/code&gt; will it call it every time you toggle a checkbox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does require you have a statistics cookie (the thing you get with &lt;code&gt;[/]&lt;/code&gt; or &lt;code&gt;[%]&lt;/code&gt; then &lt;code&gt;C-c C-c&lt;/code&gt;) in the header.&lt;/p&gt;&#xA;" OwnerUserId="11973" LastActivityDate="2016-05-08T16:59:22.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22148" PostTypeId="2" ParentId="22140" CreationDate="2016-05-08T18:01:06.080" Score="3" Body="&lt;p&gt;One option would be to disable the &lt;code&gt;PAGER&lt;/code&gt; entirely:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setenv &quot;PAGER&quot; &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This dumps all output directly to the eshell buffer, so you can use normal Emacs navigation commands to navigate the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can even disable it for an individual command by running the command as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PAGER=&quot;&quot; &amp;lt;command&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="675" LastActivityDate="2016-05-08T18:01:06.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22149" PostTypeId="2" ParentId="22079" CreationDate="2016-05-08T18:51:12.340" Score="3" Body="&lt;p&gt;I've looked through the Lisp code bundled with Emacs, and I've found that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;most files use &lt;code&gt;cl-assert&lt;/code&gt; after doing &lt;code&gt;(eval-when-compile (require 'cl-lib))&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;some files use &lt;code&gt;assert&lt;/code&gt; after doing &lt;code&gt;(eval-when-compile (require 'cl))&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;there are a small number of specialised assertion macros in the Emacs library, notably &lt;code&gt;check-face&lt;/code&gt; and &lt;code&gt;check-coding-system&lt;/code&gt;, but they don't seem to be used much;&lt;/li&gt;&#xA;&lt;li&gt;only a very few packages define their own specialised assertion macros, e.g. &lt;code&gt;ibuffer-assert-ibuffer-mode&lt;/code&gt; or &lt;code&gt;tramp-check-proper-method-and-host&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One thing that wasn't obvious to me is that &lt;code&gt;cl-assert&lt;/code&gt; only requires &lt;code&gt;cl-lib&lt;/code&gt; at compile time — in Emacs 25 it expands into a call to &lt;code&gt;cl--assertion-failed&lt;/code&gt; which is preloaded, while in Emacs 24 it expands into calls to &lt;code&gt;error&lt;/code&gt; and &lt;code&gt;signal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My conclusion is therefore that one should depend on &lt;code&gt;cl-lib&lt;/code&gt; at compile time and use &lt;code&gt;cl-assert&lt;/code&gt;, or write specialised macros that expand into &lt;code&gt;cl-assert&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2016-05-08T19:05:53.033" LastActivityDate="2016-05-08T19:05:53.033" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22150" PostTypeId="1" AcceptedAnswerId="22170" CreationDate="2016-05-08T19:40:04.770" Score="2" ViewCount="584" Body="&lt;p&gt;As suggested by the &lt;a href=&quot;http://orgmode.org/manual/Link-abbreviations.html&quot; rel=&quot;nofollow&quot; title=&quot;Org-mode Manual&quot;&gt;Org-mode Manual&lt;/a&gt;, I've customized &lt;code&gt;org-link-abbrev-alist&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-link-abbrev-alist&#xA;       '(;; Abbreviations for websites&#xA;         (&quot;google&quot;         . &quot;https://www.google.com/#q=&quot;)&#xA;         (&quot;github&quot;         . &quot;https://www.github.com/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is convenient because I can easily insert a link with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[google:cat pictures][Google Search for cat pictures]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is useful because if the URL changes, I can just updated &lt;code&gt;org-link-abbrev-alist&lt;/code&gt;. However, there are instances in the past where I've used the entire non-abbreviated link or decided, after visiting a website enough times, to create an abbreviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I write a function to use &lt;code&gt;org-link-abbrev-alist&lt;/code&gt; to turn long form links in all org-mode files (say, all files in &lt;code&gt;org-agenda-files&lt;/code&gt; to abbreviated links? For example, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[https://www.google.com/#q=cat pictures][Google search for cat pictures]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[google:cat pictures][Google search for cat pictures]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd also like to integrate this function with &lt;code&gt;org-mode-hook&lt;/code&gt; so that it happens automatically on either save or startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, I'd also like a function that does the reverse and replaces the abbreviation with the long form link.&lt;/p&gt;&#xA;" OwnerUserId="804" LastActivityDate="2016-05-12T00:50:40.683" Title="Function to Replace org-links with Abbreviations" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22151" PostTypeId="1" AcceptedAnswerId="33060" CreationDate="2016-05-08T23:34:45.273" Score="1" ViewCount="531" Body="&lt;p&gt;When in a dired buffer, I use &lt;code&gt;R&lt;/code&gt; or &lt;code&gt;dired-do-rename&lt;/code&gt; to move files from one directory to another (typically my &quot;refile&quot; directory to where the file(s) actually belong(s)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this I'd like to store an org-link using &lt;code&gt;org-store-link&lt;/code&gt; to the &quot;refiled&quot; document(s) in it's/their new location preferable using th prefix argument, &lt;code&gt;C-u&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how to accomplish this? Ideally it would work for a single or multiple files marked with &lt;code&gt;m&lt;/code&gt;. If performing this action on multiple files, all links should be stored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine this is possible with &lt;code&gt;defadvice&lt;/code&gt; since I can't find any obvious hooks but don't have the experience to implement it.&lt;/p&gt;&#xA;" OwnerUserId="804" LastActivityDate="2017-05-25T21:15:41.977" Title="Run org-store-link after renaming file with dired?" Tags="|org-mode|dired|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22152" PostTypeId="2" ParentId="10933" CreationDate="2016-05-09T00:43:34.263" Score="1" Body="&lt;p&gt;See &lt;a href=&quot;https://github.com/jkitchin/org-ref/blob/651d24df5f52bb3f0d31c71ebdb604ce356fe674/org-ref.el#L484&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jkitchin/org-ref/blob/651d24df5f52bb3f0d31c71ebdb604ce356fe674/org-ref.el#L484&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use that code to change the appearance of links in org-ref using font lock at &#xA;&lt;a href=&quot;https://github.com/jkitchin/org-ref/blob/651d24df5f52bb3f0d31c71ebdb604ce356fe674/org-ref.el#L742&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jkitchin/org-ref/blob/651d24df5f52bb3f0d31c71ebdb604ce356fe674/org-ref.el#L742&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="8234" LastEditDate="2020-05-26T17:36:59.480" LastActivityDate="2020-05-26T17:36:59.480" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22153" PostTypeId="2" ParentId="22118" CreationDate="2016-05-09T05:51:15.173" Score="2" Body="&lt;p&gt;You got typo and didn't cover corner cases.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-buffer-hook-setup ()&#xA;  (if (and buffer-file-name&#xA;           (file-name-extension buffer-file-name)&#xA;           (string= (downcase (file-name-extension buffer-file-name)) &quot;pdf&quot;)&#xA;           (yes-or-no-p &quot;Set bookmark with current file name?&quot;))&#xA;    (bookmark-set (file-name-nondirectory buffer-file-name) nil)))&#xA;(add-hook 'kill-buffer-hook 'kill-buffer-hook-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-05-09T11:27:20.507" LastActivityDate="2016-05-09T11:27:20.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22155" PostTypeId="2" ParentId="16682" CreationDate="2016-05-09T10:26:34.673" Score="3" Body="&lt;p&gt;Terminal.app has slight margins on the each end. This works fine for terminal commands, but it also adds an unwanted margin to your &quot;full-screen&quot; terminal applications. I don't think there is any preference to remove these margins in Terminal.app&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution is to use a patched copy of iTerm2. You can download the source from iTerm2's github repository, and apply &lt;a href=&quot;https://gist.github.com/anuragm/ab71c54508cb4e7667abe60e482b2210&quot; rel=&quot;nofollow&quot;&gt;this patch&lt;/a&gt;. Adjust the margin to your liking. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is to set the Terminal.app background color to match your Emacs theme background color. &lt;/p&gt;&#xA;" OwnerUserId="11981" LastActivityDate="2016-05-09T10:26:34.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22157" PostTypeId="1" CreationDate="2016-05-09T11:10:38.960" Score="1" ViewCount="884" Body="&lt;p&gt;I want to add a hook that reads the first line of the file/buffer when it opens. &#xA;I want to do this so that I can rename the buffer that opens notes from simplenote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, how do I read the first line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I was kind of vague in my question. But exactly what I wanted to do was to read the first line when opening notes via simplenote.el since the buffer gets named to a hash of 76 char that does not tell anything about the contents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This kind of failed since opening a simplenote file it defaults to text mode so no hook possible there. But it could be useful for org-mode notes in simplenote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun read-first-line ()&#xA;    (save-excursion&#xA;    (goto-char (point-min))&#xA;    (setq b (point))&#xA;    (setq e (- (search-forward &quot;-*-&quot; (line-end-position)) 4))&#xA;    (buffer-substring-no-properties b e)))&#xA;&#xA;&#xA;;(add-hook 'org-mode-hook&#xA;      ;(lambda () (rename-buffer (read-first-line))))&#xA;&#xA;(add-hook 'org-mode-hook&#xA;     (lambda () ((let (str (read-first-line))&#xA;              (if (not (string= &quot;&quot; str))&#xA;                  (rename-buffer str))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I cannot get the conditional lambda to work.&#xA;And what is the difference with let and setq inside a function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;Fixed the org-mode-hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;      (lambda ()&#xA;        (let ((str (read-first-line)))&#xA;          (if (not (string= &quot;&quot; str))&#xA;          (rename-buffer str)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11982" LastEditorUserId="105" LastEditDate="2016-06-22T19:50:42.213" LastActivityDate="2017-03-30T04:43:24.120" Title="Read first line of file when opening to rename buffer" Tags="|hooks|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22159" PostTypeId="1" AcceptedAnswerId="22160" CreationDate="2016-05-09T13:34:48.713" Score="7" ViewCount="348" Body="&lt;p&gt;I'm looking for functionality that can do source-to-source transformation of elisp programs given a set of rewriting rules. For example, given a rule like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable (quote ?var) ?value)) =&amp;gt; &#xA;   (setq-local ?var ?value)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will find all occurrences of the pattern and replace it with replacement. A welcome feature would be to do minimum amount of changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I found this &lt;a href=&quot;http://www.informatik.uni-bremen.de/st/lehre/Arte-fakt/Seminar/papers/06/Formal/pattern-language-for-refactoring.pdf&quot;&gt;http://www.informatik.uni-bremen.de/st/lehre/Arte-fakt/Seminar/papers/06/Formal/pattern-language-for-refactoring.pdf&lt;/a&gt; sadly no implementation.&lt;/p&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-06-22T19:48:27.513" LastActivityDate="2016-06-22T19:48:27.513" Title="How to refactor elisp programs using pattern matching on sexps with replacement?" Tags="|replace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22160" PostTypeId="2" ParentId="22159" CreationDate="2016-05-09T13:59:02.553" Score="7" Body="&lt;p&gt;I believe you're looking for the &lt;code&gt;el-search&lt;/code&gt; package, available in the GNU ELPA repository.&#xA;It lets you match using &lt;code&gt;pcase&lt;/code&gt; patterns and does implement the search&amp;amp;replace functionality that you're describing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'd use &lt;code&gt;el-search-query-replace&lt;/code&gt; and provide the pattern&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(set (make-local-variable ',var) ,val)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and replace it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(setq-local ,var ,val)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="2710" LastEditDate="2016-05-09T15:33:53.140" LastActivityDate="2016-05-09T15:33:53.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22161" PostTypeId="1" CreationDate="2016-05-09T15:08:34.350" Score="3" ViewCount="2126" Body="&lt;p&gt;Using the GUI version of emacs, I would like to the fonts to match the rest of my system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have changed my the font to the same as my terminal font, but the anti-aliasing makes it look much different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway to disable anti-aliasing from emacs for the X server version?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do I need to look into &lt;code&gt;fonts.conf&lt;/code&gt; or something similar? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;Fedora 23&lt;/code&gt; and &lt;code&gt;emacs-24.5&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2017-09-11T12:26:11.940" Title="Disabling anti-aliasing on emacs GUI?" Tags="|fonts|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22162" PostTypeId="1" AcceptedAnswerId="22166" CreationDate="2016-05-09T15:15:39.817" Score="9" ViewCount="1353" Body="&lt;p&gt;The normal behavior of Emacs when transient-mark-mode is active is that when you make a shift-selection, then if the next command is a non-shift movement, the mark is deactivated. For example, after the commands &lt;code&gt;M-l&lt;/code&gt; (to mark the current line with the function below) and &lt;code&gt;C-f&lt;/code&gt;, the mark is deactivated. How to emulate that behavior from elisp after &lt;code&gt;(set-mark-command nil)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-mark-current-line ()&#xA;  (interactive)&#xA;  (beginning-of-line)&#xA;  (set-mark-command nil)&#xA;  (end-of-line)&#xA;  (forward-char))&#xA;&#xA;(global-set-key (kbd &quot;M-l&quot;) 'my-mark-current-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now do M-l C-f and the region will grow, but instead, I want the default behavior, i.e. the region to deactivate when C-f, and grow with C-S-f.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: should use a function different to set-mark-command that allows this? I couldn't find any.&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="105" LastEditDate="2016-06-22T19:47:54.887" LastActivityDate="2016-06-22T19:47:54.887" Title="How to set mark in elisp and have shift selection?" Tags="|mark|mark-ring|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22163" PostTypeId="2" ParentId="22157" CreationDate="2016-05-09T16:12:46.157" Score="-1" Body="&lt;p&gt;EDIT: Whoever edited my answer, way to go asshole. Now it's fucking meaningless. Next time just delete the reply. That way the asker won't be confused by a non-working answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand how or why you want to rename&#xA;the buffer, or if it can be done programatically.&#xA;You'll have to suppy more details about your&#xA;intended applications and expected results.&#xA;Therefore this code is designed to demonstrate&#xA;one approach which will require tailoring to&#xA;fit your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function must accept a single argument!&#xA;The argument is the number of characters inserted.&#xA;This function must return the number of characters&#xA;remaining in the buffer after processing. We don't&#xA;change the buffer contents after insertion, so the&#xA;original argument will be passed back unchanged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function must not return a string or any value&#xA;other than the number of characters remaining!&#xA;The best we can do is print the line, or&#xA;insert it in another buffer, or perform other side&#xA;effects. I have chosen to print the line to&#xA;demonstrate that this works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When this function is called, &lt;code&gt;point&lt;/code&gt; will initially&#xA;be set to &lt;code&gt;(point-min)&lt;/code&gt;. That is why the function&#xA;operates on the &quot;current line&quot;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-print-this-line (n)&#xA;  &quot;Print current line to *Messages*.&quot;&#xA;  (message &quot;%s&quot;&#xA;       (buffer-substring-no-properties (line-beginning-position)&#xA;                       (line-end-position)))&#xA;  n)&#xA;;; =&amp;gt; my-print-this-line&#xA;(setq after-insert-file-functions '(my-print-this-line))&#xA;:: =&amp;gt; (my-print-this-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Format-Conversion-Piecemeal.html#Format-Conversion-Piecemeal&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Format-Conversion-Piecemeal.html#Format-Conversion-Piecemeal&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="890" LastEditorUserId="890" LastEditDate="2017-01-29T03:59:34.697" LastActivityDate="2017-01-29T03:59:34.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22164" PostTypeId="2" ParentId="22159" CreationDate="2016-05-09T16:41:48.323" Score="1" Body="&lt;p&gt;Lisp &lt;strong&gt;&lt;em&gt;macro expansion&lt;/em&gt;&lt;/strong&gt; is exactly that: a mapping from Lisp sexps to Lisp sexps. Your friends for this are &lt;code&gt;defmacro&lt;/code&gt; or -- more especially -- &lt;strong&gt;&lt;code&gt;macrolet&lt;/code&gt;&lt;/strong&gt; (aka &lt;code&gt;cl-macrolet&lt;/code&gt; for Emacs Lisp) and &lt;strong&gt;&lt;code&gt;macroexpand&lt;/code&gt;&lt;/strong&gt; (also &lt;code&gt;macroexpand-all&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I am &lt;em&gt;not&lt;/em&gt; referring to macro expansion followed by &lt;em&gt;evaluation&lt;/em&gt; of the resulting Lisp code, which is how Lisp macros are usually used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, you do not want to evaluate the result of macro expansion.  You want only to &lt;em&gt;&quot;expand&quot;&lt;/em&gt; an input Lisp sexp to produce a different Lisp sexp.  (In computer science and logic this is sometimes called &quot;reduction&quot; or &quot;rewriting&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Of course, to deal with sexps that are not lists you will need to also provide mappings between known symbols and the like.  But macro expansion takes care of most sexp-pattern mappings.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-09T17:10:43.793" LastActivityDate="2016-05-09T17:10:43.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22165" PostTypeId="1" AcceptedAnswerId="22167" CreationDate="2016-05-09T18:43:29.480" Score="3" ViewCount="344" Body="&lt;p&gt;I use emacs (v 25.0.93.1) on windows 10, and I am impressed by all the funtionality of dired+. One function I use often is peep-dired, so I can preview my text files when scrolling down my files in dired. For some reason jpg files are also previewed, not as code, but as a picture. Is it possible to preview pdf, doc, docx, and xls files also, not as their code, but readable for humans?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="8348" LastEditDate="2016-05-09T18:54:40.930" LastActivityDate="2016-05-09T19:44:18.783" Title="Can pdf be previewed in dired+/peep-dired in the same way as jpg?" Tags="|dired|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22166" PostTypeId="2" ParentId="22162" CreationDate="2016-05-09T19:01:20.083" Score="10" Body="&#xA;&#xA;&lt;p&gt;Because shift translation and temporary activation of the mark is handled by the command loop, you will need to call the interactive versions of the movement functions in order to get the appropriate shift selection behavior from them:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; (source: http://emacs.stackexchange.com/a/22166/93)&#xA;(defun my-mark-current-line ()&#xA;  (interactive)&#xA;  (beginning-of-line)&#xA;  (setq this-command-keys-shift-translated t)&#xA;  (call-interactively 'end-of-line)&#xA;  (call-interactively 'forward-char))&#xA;&#xA;(global-set-key (kbd &quot;M-l&quot;) 'my-mark-current-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Update:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Since writing the above answer, I took the time to learn a little more about how shift selection really works under the hood.  It sets the symbol value of &lt;code&gt;transient-mark-mode&lt;/code&gt; to be a cons cell of the form &lt;code&gt;(only . OLDVAL)&lt;/code&gt;, where &lt;code&gt;OLDVAL&lt;/code&gt; is the value prior to shift selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution below avoids the use of &lt;code&gt;call-interactively&lt;/code&gt; by activating the mark as needed, and setting the appropriate value of &lt;code&gt;transient-mark-mode&lt;/code&gt;. Basically, I consider this solution to be less of a hack than the first one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a bonus, it now has an optional repeat count, and will extend the current selection in either direction if the mark is already active.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; (source: http://emacs.stackexchange.com/a/22166/93)&#xA;(defun my-mark-current-line (&amp;amp;optional arg)&#xA;  &quot;Uses shift selection to select the current line.&#xA;When there is an existing shift selection, extends the selection&#xA;in the appropriate direction to include current line.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((oldval (or (cdr-safe transient-mark-mode) transient-mark-mode))&#xA;        (backwards (and mark-active (&amp;gt; (mark) (point))))&#xA;        (beg (and mark-active (mark-marker))))&#xA;    (unless beg&#xA;      (if backwards (end-of-line) (beginning-of-line))&#xA;      (setq beg (point-marker)))&#xA;    (if backwards (end-of-line (- 1 arg)) (beginning-of-line (+ 1 arg)))&#xA;    (unless mark-active&#xA;      (push-mark beg nil t))&#xA;    (setq transient-mark-mode (cons 'only oldval))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2016-05-10T21:40:58.043" LastActivityDate="2016-05-10T21:40:58.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22167" PostTypeId="2" ParentId="22165" CreationDate="2016-05-09T19:39:08.157" Score="1" Body="&lt;p&gt;Customize option &lt;code&gt;auto-mode-alist&lt;/code&gt; so that it has an entry that assigns &lt;code&gt;.pdf&lt;/code&gt; to the mode you use for visualizing PDF files.  E.g., if that mode is &lt;code&gt;my-pdf-mode&lt;/code&gt; then add an entry such as this to option &lt;code&gt;auto-mode-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;\\.pdf$&quot; . my-pdf-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Normally, you can use &lt;code&gt;doc-view-mode&lt;/code&gt; for this (i.e., &lt;code&gt;(&quot;\\.pdf$&quot; . doc-view-mode)&lt;/code&gt;, after loading library &lt;code&gt;doc-view&lt;/code&gt;), provided your Emacs build supports it. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html&quot; rel=&quot;nofollow&quot;&gt;Document View&lt;/a&gt;, including &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html#FOOT15&quot; rel=&quot;nofollow&quot;&gt;this footnote&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-09T19:44:18.783" LastActivityDate="2016-05-09T19:44:18.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22168" PostTypeId="1" CreationDate="2016-05-09T19:44:51.290" Score="4" ViewCount="1134" Body="&lt;p&gt;I often use python scripts to parse information stored in many of my org tables. To get python to read these tables I have a &lt;a href=&quot;https://emacs.stackexchange.com/questions/16640/can-i-export-a-specific-table-in-an-org-file-to-csv-from-the-command-line&quot;&gt;script&lt;/a&gt; that exports specific tables from a specified org document to csv. I then use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;csv.DictReader(open('/path/to/csv/table.csv'))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to parse the information with python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It recently dawned on me that python could (more or less) read the org tables themselves with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;csv.DictReader(open('/path/to/org/doc.org'), delimiter='|')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this would require &lt;code&gt;doc.org&lt;/code&gt; to consist solely of an org table. I'm curious if anyone has come across a tool for python that can search an org document for a specified table and parse the table as if it were a csv file. Does such a tool exist?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-05-10T11:01:59.083" Title="Is there a python tool for parsing org-mode tables?" Tags="|org-mode|python|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22169" PostTypeId="2" ParentId="22168" CreationDate="2016-05-09T20:01:01.640" Score="2" Body="&lt;p&gt;One solution is to have a Python Babel block in the Org document that parses the table and writes a CSV. You can then call that Babel block from outside Org (using &lt;code&gt;emacsclient&lt;/code&gt;?) to produce the CSV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, not surprisingly, John Kitchen has solved this closer to the way you want: &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2014/08/11/Using-org-mode-outside-of-Emacs-sort-of/&quot; rel=&quot;nofollow&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2014/08/11/Using-org-mode-outside-of-Emacs-sort-of/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="91" LastEditorUserId="91" LastEditDate="2016-05-10T11:01:59.083" LastActivityDate="2016-05-10T11:01:59.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22170" PostTypeId="2" ParentId="22150" CreationDate="2016-05-09T22:26:44.103" Score="5" Body="&lt;p&gt;After a bit of research, I encountered &lt;a href=&quot;https://stackoverflow.com/questions/8682079/batch-replace-a-bunch-of-strings-in-a-text-file-with-emacs&quot;&gt;this answer&lt;/a&gt; and adopted it to answer my question above. The following function and hook will replace all links in an org-mode file with their corresponding abbreviations on save.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Create abbreviations&#xA;(defun my/create-org-link-abbreviations ()&#xA;  &quot;Replace all long form links in current file with their corresponding abbreviations in `org-link-abbrev-alist'.&quot;&#xA;  (interactive)&#xA;  (dolist (pair org-link-abbrev-alist)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (search-forward (concat &quot;[[&quot; (cdr pair)) nil t)&#xA;        (replace-match (concat &quot;[[&quot; (car pair) &quot;:&quot;))))))&#xA;&#xA;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (add-to-list 'write-file-functions 'my/create-org-link-abbreviations)))&#xA;&#xA;;; Remove abbreviations&#xA;(defun my/remove-org-link-abbreviations ()&#xA;  &quot;Replace all link abbreviations in current file with their long form counterparts in `org-link-abbrev-alist'.&quot;&#xA;  (interactive)&#xA;  (dolist (pair org-link-abbrev-alist)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (search-forward (concat &quot;[[&quot; (car pair) &quot;:&quot;) nil t)&#xA;        (replace-match (concat &quot;[[&quot; (cdr pair)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="804" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-05-12T00:50:40.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22171" PostTypeId="1" CreationDate="2016-05-10T03:13:45.577" Score="12" ViewCount="564" Body="&lt;p&gt;I have &lt;code&gt;linum-mode&lt;/code&gt; enabled as well as &lt;code&gt;truncate-lines&lt;/code&gt;.  Works fine as long as Emacs displays column 0:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/O1s1p.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O1s1p.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;The line number is  showed  on left (OK)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But as soon as the window is scrolled horizontally, the line numbers disappear:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4Kw5W.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4Kw5W.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;The line number is not showed on left&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make it so the line numbers (on the left) stay displayed when I move along a long logical line ?&lt;/p&gt;&#xA;" OwnerUserId="11721" LastEditorUserId="1979" LastEditDate="2016-05-10T03:38:28.013" LastActivityDate="2017-04-04T11:52:25.473" Title="How do I enable line numbers (on the left) every time when line is the long logical line" Tags="|line-numbers|wrapping|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22172" PostTypeId="1" AcceptedAnswerId="22173" CreationDate="2016-05-10T04:37:42.837" Score="1" ViewCount="334" Body="&lt;p&gt;How can I setup Emacs &gt;= 24.4 so that it saves at least the current file I'm working on automatically, say, each 5 seconds, so that I don't have to press &lt;code&gt;C-x C-s&lt;/code&gt; each time to save my changes?&lt;/p&gt;&#xA;" OwnerUserId="11957" LastActivityDate="2016-05-10T05:08:27.107" Title="How can I get Emacs to save the changes automatically each X seconds?" Tags="|auto-save|saving|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22173" PostTypeId="2" ParentId="22172" CreationDate="2016-05-10T05:01:23.590" Score="4" Body="&lt;p&gt;You probably do not want it to save every N sec but to do that only after Emacs has been idle for N sec. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do that, customize user option &lt;code&gt;auto-save-timeout&lt;/code&gt; to the number of seconds, and turn on &lt;code&gt;auto-save-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual (&lt;code&gt;C-h r&lt;/code&gt;), node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save.html&quot; rel=&quot;nofollow&quot;&gt;Auto Save&lt;/a&gt; and its children, especially node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save-Control.html&quot; rel=&quot;nofollow&quot;&gt;Auto Save Control&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Auto_002dSaving.html#Auto_002dSaving&quot; rel=&quot;nofollow&quot;&gt;Auto-Saving&lt;/a&gt;, which details the user options and functions used for auto-saving.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-10T05:08:27.107" LastActivityDate="2016-05-10T05:08:27.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22174" PostTypeId="2" ParentId="22110" CreationDate="2016-05-10T05:40:04.260" Score="3" Body="&#xA;&#xA;&lt;p&gt;This solution does not invoke &lt;code&gt;use-package&lt;/code&gt;, but instead uses the included &lt;code&gt;package.el&lt;/code&gt; functionality.  Either way it should get the job done:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; (source: http://emacs.stackexchange.com/a/22174/93)&#xA;(defun package-update (package &amp;amp;optional version)&#xA;  &quot;Update a package from the package archives.&#xA;If VERSION is nil, update the package to the most recent version&#xA;available.  Otherwise, VERSION should be a version string, or a&#xA;list of the type returned by `version-to-list'. The package will&#xA;be updated only if the currently installed version is less than&#xA;the version specified, even if a newer version is available.&quot;&#xA;  (unless package--initialized&#xA;    (package-initialize t))&#xA;  (unless package-archive-contents&#xA;    (package-refresh-contents))&#xA;  (let* ((current (cadr (assoc package package-alist)))&#xA;         (current-version (if current (package-desc-version current) '(-1)))&#xA;         (pkg-desc (cadr (assoc package package-archive-contents)))&#xA;         (pkg-version (and pkg-desc (package-desc-version pkg-desc)))&#xA;         (target-version (or (and (stringp version) (version-to-list version))&#xA;                             version&#xA;                             pkg-version)))&#xA;    (when (version-list-&amp;lt; current-version target-version)&#xA;      (if (null pkg-desc)&#xA;        (error &quot;Package `%s' not found in package archives&quot; package))&#xA;      (if (version-list-&amp;lt; pkg-version target-version)&#xA;        (error &quot;A suitable version of `%s' is not available&quot; package))&#xA;      (package-install pkg-desc)&#xA;      (if current&#xA;          (package-delete current)))&#xA;    nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that function defined, you could add the following to your init&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-update 's '(1 10 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to ensure that your currently-installed version of the &lt;code&gt;s&lt;/code&gt; package is at least version 1.10.0&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2016-05-10T05:47:52.940" LastActivityDate="2016-05-10T05:47:52.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22176" PostTypeId="1" AcceptedAnswerId="22181" CreationDate="2016-05-10T07:18:41.200" Score="0" ViewCount="1493" Body="&lt;p&gt;I strugle to give my emacs access to ghostscript (to make doc-view show me pdf previews), and seem lost in a&#xA;plethora of internet advises about how to install gs. Here is what I have done, and&#xA;it does not work yet:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I have installed ghostscript at &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;C:\Program Files (x86)\gs\gs9.09\bin\gswin32.exe&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;I have set the environmental PATH to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;C:\Program Files (x86)\gs\gs9.09\bin&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In my emacs init file I have the following code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(add-to-list 'load-path &quot;C:/Program Files (x86)/gs/gs9.09/bin/&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(add-to-list 'load-path &quot;C:/Program Files (x86)/gs/gs9.09/lib/&quot;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When I give the following shell command from emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; M-! gsview32 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;gsview32&quot; is not recognized as an internal or external command,&#xA;operable program or batch file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is lacking in my setup above (and what is not needed)?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2016-05-10T16:32:03.387" Title="How to give my emacs access to ghostscript?" Tags="|docview|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22177" PostTypeId="1" CreationDate="2016-05-10T10:58:25.613" Score="1" ViewCount="547" Body="&lt;p&gt;I was just fooled by an old org info file that was hanging around in my info dir.  I assumed that when I call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package wanderlust&#xA;  :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That the current info file would be installed automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following from the elisp manual would indicate that this is so:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the content directory contains a file named ‘dir’, this is assumed&#xA;  to be an Info directory file made with ‘install-info’.  *Note Invoking&#xA;  install-info: (texinfo)Invoking install-info.  The relevant Info files&#xA;  should also be present in the content directory.  In this case, Emacs&#xA;  will automatically add the content directory to ‘Info-directory-list’&#xA;  when the package is activated.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yet, they do not show up.  Is there something else to do in my init.el file to make this work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&lt;/p&gt;&#xA;" OwnerUserId="10291" LastActivityDate="2016-05-11T05:47:36.330" Title="Info manuals from packages not showing up in info" Tags="|package|info|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22179" PostTypeId="1" AcceptedAnswerId="22180" CreationDate="2016-05-10T14:02:54.917" Score="7" ViewCount="7865" Body="&lt;p&gt;I'm new to emacs, org-mode. I have an org file which, every time I open, I have to enable the minor modes: &lt;code&gt;visual-line-mode&lt;/code&gt; and &lt;code&gt;org-indent-mode&lt;/code&gt; by hand using the &lt;code&gt;M-x&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw this &lt;a href=&quot;https://stackoverflow.com/questions/5058963/how-do-i-associate-a-minor-mode-to-a-particular-file-or-a-set-of-files-based-on&quot;&gt;question&lt;/a&gt; in stackoverflow and tried the following code in my &lt;code&gt;.emacs&lt;/code&gt; file only to see an error when emacs loads.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(require 'org-mode)  &#xA;(defun turn-on-visual-line-mode () (visual-line-mode 1))  &#xA;(add-hook 'org-mode-hook 'turn-on-visual-line-mode)  &#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Error&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;Warning (initialization): An error occurred while loading ‘c:/Users/Prasanna Rajaram/AppData/Roaming/.emacs’:&#xA;&#xA;File error: Cannot open load file, No such file or directory, org-mode&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the ‘--debug-init’ option to view a complete error backtrace.&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I did not try the &lt;code&gt;org-indent-mode&lt;/code&gt; as I did not know how to turn on multiple minor modes with &lt;code&gt;defun()&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-05-10T16:08:54.417" Title="Enable visual-line-mode and org-indent-mode when opening org files" Tags="|org-mode|init-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22180" PostTypeId="2" ParentId="22179" CreationDate="2016-05-10T16:02:17.623" Score="20" Body="&lt;p&gt;The culprit here is that you are doing &lt;code&gt;(require 'org-mode)&lt;/code&gt; instead of &lt;code&gt;(require 'org)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But here's an alternative way to enable the minor modes that you need for org files (below is tested to work in an &lt;code&gt;emacs -Q&lt;/code&gt; session):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; `with-eval-after-load' macro was introduced in Emacs 24.x&#xA;;; In older Emacsen, you can do the same thing with `eval-after-load'&#xA;;; and '(progn ..) form.&#xA;(with-eval-after-load 'org       &#xA;  (setq org-startup-indented t) ; Enable `org-indent-mode' by default&#xA;  (add-hook 'org-mode-hook #'visual-line-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Recommendation&lt;/strong&gt;: You should not directly &lt;code&gt;require&lt;/code&gt; a package (even though doing so will also work). Doing so will make emacs load that whole package at startup and could result in slower startup. Instead, you should allow the &lt;code&gt;org&lt;/code&gt; package to get automatically loaded as configured in the package itself, and then do org-specific setup in the &lt;code&gt;with-eval-after-load&lt;/code&gt; or &lt;code&gt;eval-after-load&lt;/code&gt; form.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-10T16:08:54.417" LastActivityDate="2016-05-10T16:08:54.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22181" PostTypeId="2" ParentId="22176" CreationDate="2016-05-10T16:32:03.387" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;doc-view-ghostscript-program&lt;/code&gt; is customizable:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq doc-view-ghostscript-program &quot;C:/Program Files (x86)/gs/gs9.09/bin/gswin32.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-05-10T16:32:03.387" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="22182" PostTypeId="2" ParentId="20691" CreationDate="2016-05-10T17:19:37.920" Score="1" Body="&lt;p&gt;I just wanted to post this straight forward answer which I find will be more relevant.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In Windows(10):&lt;/strong&gt;&lt;br&gt;&#xA;&lt;code&gt;C:\Users\$USERNAME\AppData\Roaming\.emacs&lt;/code&gt;&lt;br&gt;&#xA;Here &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;\AppData\Roaming&lt;/code&gt; are hidden folders, so type them in the address&#xA;bar and Windows will show them to you as you type.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;$USERNAME&lt;/code&gt; is your username in your computer for your login.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In Ubuntu(Linux)&lt;/strong&gt;&lt;br&gt;&#xA;&lt;code&gt;home\$USERNAME\.emacs&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-05-10T17:19:37.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22183" PostTypeId="2" ParentId="22177" CreationDate="2016-05-10T19:06:26.067" Score="0" Body="&lt;p&gt;My understanding is that you would need the &lt;code&gt;wanderlust&lt;/code&gt; devs to change the structure in which their package is installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By studying the below code in &lt;code&gt;package.el&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Add info node.&#xA;(when (file-exists-p (expand-file-name &quot;dir&quot; pkg-dir))&#xA;  ;; FIXME: not the friendliest, but simple.&#xA;  (require 'info)&#xA;  (info-initialize)&#xA;  (push pkg-dir Info-directory-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;.. and few packages (like &lt;code&gt;debbugs&lt;/code&gt;, &lt;code&gt;ivy&lt;/code&gt;, &lt;code&gt;magit&lt;/code&gt;) that have their Info documents added to the &lt;code&gt;Info-directory-list&lt;/code&gt; correctly, the structure of files has to be as follows in your &lt;code&gt;elpa/&lt;/code&gt; dir:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;elpa/&#xA;  pkg-version/&#xA;    dir # not a directory but a file that describes &#xA;        # where that Info document sits in the hierarchy&#xA;    pkg.info&#xA;    pkg.el&#xA;    pkg.elc&#xA;    ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For example, this is what the &lt;code&gt;dir&lt;/code&gt; file looks like for the &lt;a href=&quot;https://github.com/magit/magit&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;magit&lt;/code&gt;&lt;/a&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is the file .../info/dir, which contains the&#xA;topmost node of the Info hierarchy, called (dir)Top.&#xA;The first time you invoke Info you start off looking at this node.&#xA;&#xA;File: dir,      Node: Top       This is the top of the INFO tree&#xA;&#xA;  This (the Directory node) gives a menu of major topics.&#xA;  Typing &quot;q&quot; exits, &quot;?&quot; lists all Info commands, &quot;d&quot; returns here,&#xA;  &quot;h&quot; gives a primer for first-timers,&#xA;  &quot;mEmacs&amp;lt;Return&amp;gt;&quot; visits the Emacs manual, etc.&#xA;&#xA;  In Emacs, you can click mouse button 2 on a menu item or cross reference&#xA;  to select it.&#xA;&#xA;* Menu:&#xA;&#xA;Emacs&#xA;* Magit: (magit).               Using Git from Emacs with Magit.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-10T19:16:30.753" LastActivityDate="2016-05-10T19:16:30.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22184" PostTypeId="1" AcceptedAnswerId="22185" CreationDate="2016-05-10T19:18:58.660" Score="1" ViewCount="591" Body="&lt;p&gt;How can I create a key binding for specific &lt;code&gt;org-export&lt;/code&gt; commands?&lt;/p&gt;&#xA;&lt;p&gt;E.g. I'd like to bind to &lt;code&gt;F9&lt;/code&gt; exporting to an html file. Currently I need to hit &lt;code&gt;C-c C-e h h&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;eety&lt;/p&gt;&#xA;" OwnerUserId="5237" LastEditorUserId="105" LastEditDate="2021-12-20T00:13:03.383" LastActivityDate="2021-12-20T00:13:03.383" Title="Key binding for org-exporters" Tags="|org-mode|key-bindings|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22185" PostTypeId="2" ParentId="22184" CreationDate="2016-05-10T19:30:59.270" Score="3" Body="&lt;p&gt;You can figure out what commands are bound to the keys in the &lt;code&gt;org-export-dispatch&lt;/code&gt; menu (&lt;code&gt;C-c C-e&lt;/code&gt; in org-mode) by looking at the &lt;code&gt;:menu-entry&lt;/code&gt; section of that backend's &lt;code&gt;(org-export-define-backend ..)&lt;/code&gt; form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;ox-html.el&lt;/code&gt;, from the &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/ox-html.el?id=8127b3c30d8a2217468068a73f23bfa4945573dc#n107&quot; rel=&quot;nofollow&quot;&gt;source&lt;/a&gt; (org-mode git master branch), we get this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; -- snip --&#xA;:menu-entry&#xA;'(?h &quot;Export to HTML&quot;&#xA;     ((?H &quot;As HTML buffer&quot; org-html-export-as-html)&#xA;      (?h &quot;As HTML file&quot; org-html-export-to-html)&#xA;      (?o &quot;As HTML file and open&quot;&#xA;          (lambda (a s v b)&#xA;            (if a (org-html-export-to-html t s v b)&#xA;              (org-open-file (org-html-export-to-html nil s v b)))))))&#xA;;; -- snip --&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you can bind &lt;code&gt;F9&lt;/code&gt; to &lt;code&gt;org-html-export-to-html&lt;/code&gt;. That is what is called when you do &lt;code&gt;C-c C-e h h&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-05-10T19:30:59.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22186" PostTypeId="1" CreationDate="2016-05-10T20:41:26.700" Score="7" ViewCount="2833" Body="&lt;p&gt;One of the biggest things I miss from other editors (e.g. Sublime, Intellij) is the ability to see the project structure, and expand/minimize directories as needed so I can see what I care about. Is there something like Org mode hierarchy where I can use a hotkey to expand a subdirectory as needed?&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2016-06-02T21:02:21.350" Title="Expanding Dired to show subdirectories/files?" Tags="|dired|directories|ide|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22187" PostTypeId="2" ParentId="22186" CreationDate="2016-05-10T21:18:35.873" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://cedet.sourceforge.net/speedbar.shtml&quot; rel=&quot;nofollow&quot;&gt;http://cedet.sourceforge.net/speedbar.shtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Speedbar is an Emacs Lisp program which allows you to create a special skinny frame with a specialized directory listing in it. This listing will have both directories and filtered files in it. You can then load files into your emacs frame, or expand the files to display all the tags that are in them and jump to those tags. You can also expand multiple directories into your speedbar frame.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="890" LastActivityDate="2016-05-10T21:18:35.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22188" PostTypeId="2" ParentId="22186" CreationDate="2016-05-10T21:38:29.887" Score="11" Body="&lt;p&gt;In Dired you can include a subdirectory using &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt;, with the cursor on the subdir line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do likewise on a subdir line within a subdir listing, so you can list any number of levels of any number of subdirs in the same Dired buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;$&lt;/code&gt;&lt;/strong&gt; on a subdir-listing header line hides/shows that subdir listing. So it corresponds more or less with the expand/contract feature you requested. With a prefix arg (e.g. &lt;code&gt;C-u $&lt;/code&gt;) it shows/hides everything, which basically gets you back to a clean slate, but with listing header lines where you can apply &lt;code&gt;$&lt;/code&gt; to selectively show their listings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Know too that &lt;code&gt;C-x C-v RET&lt;/code&gt; will refresh the main directory listing for a given Dired buffer. In other words, it starts over, reading the directory anew - no included subdir listings etc.  On the other hand, &lt;code&gt;g&lt;/code&gt; just refreshes the currently displayed listings, picking up any changes made outside Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the same &lt;code&gt;ls&lt;/code&gt; switches for any given subdir listing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dired does not provide a &quot;tree&quot; view of the directory hierarchy. But it is still quite useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use add-on library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt; then you get quite a bit more functionality, including commands that operate on marked files and marked files of marked subdirs, ... found recursively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Dired+, even just &lt;code&gt;i&lt;/code&gt; is more useful - use it to bounce back and forth between a subdir line in a parent listing and the listing of that subdir.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dired+ also makes it easy to use multiple Dired buffers, including separate buffers for different parts of a tree (e.g. different subdirs). And it lets you easily create listings of files and directories from anywhere, i.e., not from the same directory at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To explore and discover what you can do, use the menu-bar menus, starting with menu &lt;code&gt;Dir&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-10T21:50:28.280" LastActivityDate="2016-05-10T21:50:28.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22189" PostTypeId="1" AcceptedAnswerId="22190" CreationDate="2016-05-10T22:22:31.880" Score="4" ViewCount="638" Body="&lt;p&gt;I am currently using the &lt;code&gt;diredp-toggle-find-file-reuse-dir&lt;/code&gt; feature of &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dired+&lt;/a&gt; so that selecting a directory in a dired buffer opens the directory in the current buffer as described &lt;a href=&quot;https://emacs.stackexchange.com/a/1041/93&quot;&gt;here&lt;/a&gt;.  However, it seems that I only get this &quot;re-use&quot; functionality with &lt;code&gt;&amp;lt;S-down-mouse-2&amp;gt;&lt;/code&gt;.  Pressing &lt;code&gt;&amp;lt;down-mouse-1&amp;gt;&lt;/code&gt; still causes directories to be opened in their own buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried doing the (seemingly) obvious thing of setting the key binding directly&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key dired-mode-map [down-mouse-1] 'diredp-mouse-find-file-reuse-dir)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I got strange behavior that basically looked as though I had clicked twice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do I need to do so that  a single mouse click reuses the current dired buffer when opening a directory?&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2019-04-20T15:49:40.943" Title="Dired reuse buffer on mouse click" Tags="|dired|mouse|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22190" PostTypeId="2" ParentId="22189" CreationDate="2016-05-10T22:37:58.917" Score="3" Body="&lt;pre&gt;&lt;code&gt;(define-key dired-mode-map (kbd &quot;&amp;lt;mouse-2&amp;gt;&quot;) 'diredp-mouse-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you did &lt;code&gt;C-h k&lt;/code&gt; and then clicked &lt;code&gt;mouse-1&lt;/code&gt; on a file or directory it would have told you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;&amp;lt;down-mouse-1&amp;gt;&lt;/code&gt; at that spot runs the command &lt;code&gt;mouse-drag-region&lt;/code&gt;, which...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;&amp;lt;mouse-2&amp;gt;&lt;/code&gt; at that spot runs the command&#xA;  &lt;code&gt;dired-mouse-find-file-other-window&lt;/code&gt;, which is an interactive Lisp&#xA;  function in &lt;code&gt;dired+.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;&amp;lt;mouse-2&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(It talks about &lt;code&gt;mouse-2&lt;/code&gt; because that is the binding. But by default option &lt;code&gt;mouse-1-click-follows-link&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt;.  So your &lt;code&gt;mouse-1&lt;/code&gt; acts like &lt;code&gt;mouse-2&lt;/code&gt; on a link. That's vanilla Emacs. And no, the help is not as helpful as it should be.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dired+ chooses to have the mouse open stuff in another window, by default. The key binding above will change that. (There are other ways to accomplish the same thing.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I rolled back your edit. In general, it should be &lt;strong&gt;&lt;code&gt;mouse-2&lt;/code&gt;&lt;/strong&gt; that you bind here, not &lt;code&gt;mouse-1&lt;/code&gt;. Links work with &lt;code&gt;mouse-2&lt;/code&gt; clicks.  They can &lt;em&gt;additionally&lt;/em&gt; work with &lt;code&gt;mouse-1&lt;/code&gt; clicks, if option &lt;code&gt;mouse-1-click-follows-link&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt;, which it is by default.  But the proper key binding is for &lt;code&gt;mouse-2&lt;/code&gt;, and the proper way to extend this to &lt;code&gt;mouse-1&lt;/code&gt; is to use the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(FWIW, I turn off &lt;code&gt;mouse-1-click-follows-link&lt;/code&gt;, because I prefer the original Emacs behavior of &lt;code&gt;mouse-2&lt;/code&gt; (only) for links. I want &lt;code&gt;mouse-1&lt;/code&gt; to always act like &lt;code&gt;mouse-1&lt;/code&gt;, even on links. I don't want to have to wait a moment, just to set point in the middle of a link.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-10T22:51:23.040" LastActivityDate="2016-05-10T22:51:23.040" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22193" PostTypeId="1" AcceptedAnswerId="22212" CreationDate="2016-05-11T05:43:07.227" Score="5" ViewCount="663" Body="&lt;p&gt;I am trying to create a simple function for dired where I would be able to call the function on current (or marked) files and then quick move the current (or marked) files to a pre-defined directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I need to write a function and use &lt;code&gt;dired-do-rename&lt;/code&gt; but I am unclear of other steps (I have zero coding skills :))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun z/dired-move-2home ()&#xA;  (interactive)&#xA;  (dired-do-rename FILE/MARKED FILES &quot;~/Downloads&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="454" LastEditDate="2016-05-11T21:41:22.653" LastActivityDate="2016-05-11T22:16:42.440" Title="How to move marked files or file under point in dired to a pre-defined directory?" Tags="|dired|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22194" PostTypeId="2" ParentId="22177" CreationDate="2016-05-11T05:47:36.330" Score="1" Body="&lt;p&gt;I came up with this addition to my init file to deal with the problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'f)&#xA;(require 'dash)&#xA;&#xA;(defun pack-info-add-directories ()&#xA;  (let ((old-info-dirs Info-directory-list))&#xA;    (setq Info-directory-list nil)&#xA;    (setq Info-directory-list&#xA;          (-concat&#xA;           (--filter (file-exists-p (expand-file-name &quot;dir&quot; it))&#xA;                     (f-directories package-user-dir))&#xA;           old-info-dirs))))&#xA;(add-hook 'after-init-hook 'pack-info-add-directories)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This adds the package directories with dir files to the front of the&#xA;Info-directory-list.  I invoke in the after-init-hook so it picks up any&#xA;packages installed later on in the init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that I also had to delete the stock org info file from the system info&#xA;dir in order for the current version to show up.  I used this shell command to&#xA;do so.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo ginstall-info --delete /usr/local/share/info/org.info.gz /usr/local/share/info/dir&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this helps someone.  Better, someone can explain the canonical way to&#xA;achieve the same thing.&lt;/p&gt;&#xA;" OwnerUserId="10291" LastActivityDate="2016-05-11T05:47:36.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22196" PostTypeId="1" AcceptedAnswerId="22198" CreationDate="2016-05-11T08:21:20.800" Score="1" ViewCount="297" Body="&lt;p&gt;I have a block like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results org&#xA;  stuff&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the output looking like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_SRC org&#xA;&#xA;,* Heading&#xA;,** sub heading&#xA;Text&#xA;&#xA;etc.&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get rid of the leading commas?&lt;/p&gt;&#xA;" OwnerUserId="5463" LastEditorUserId="9995" LastEditDate="2016-05-11T16:39:15.963" LastActivityDate="2016-05-11T16:39:15.963" Title="How to remove leading commas from org mode src block results" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22197" PostTypeId="2" ParentId="22186" CreationDate="2016-05-11T10:51:45.223" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/dired-hacks/blob/master/dired-subtree.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;dired-subtree&lt;/a&gt; is an option and looks as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/67xPy.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/67xPy.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If using &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;use-package&lt;/a&gt;, you can enable in your init.el and bind to TAB and SHIFT-TAB with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package dired-subtree :ensure t&#xA;  :after dired&#xA;  :config&#xA;  (bind-key &quot;&amp;lt;tab&amp;gt;&quot; #'dired-subtree-toggle dired-mode-map)&#xA;  (bind-key &quot;&amp;lt;backtab&amp;gt;&quot; #'dired-subtree-cycle dired-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wrote a little about it &lt;a href=&quot;http://xenodium.com/#drill-down-emacs-dired-with-dired-subtree&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11991" LastEditorUserId="11991" LastEditDate="2016-06-02T21:02:21.350" LastActivityDate="2016-06-02T21:02:21.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22198" PostTypeId="2" ParentId="22196" CreationDate="2016-05-11T11:40:58.713" Score="1" Body="&lt;p&gt;You can't get rid of them in a block. That is an escaping mechanism. You can use :results raw in the src block header to get rid of the results block though. &lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-05-11T11:40:58.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22199" PostTypeId="1" AcceptedAnswerId="22204" CreationDate="2016-05-11T12:38:51.503" Score="0" ViewCount="85" Body="&lt;p&gt;I am working on adding some functionality to &lt;a href=&quot;https://github.com/nlamirault/phpunit.el/blob/master/phpunit.el&quot; rel=&quot;nofollow&quot;&gt;phpunit.el&lt;/a&gt; such as selecting from a list of functions found in the current buffer (populated in Helm).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is that I can't get Helm to be populated, even though I can find all the matches and when I dump out the list into the mini-buffer it shows (&quot;test1&quot; &quot;test2&quot; &quot;functionA&quot; &quot;functionB&quot;) which is expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My code can be found here: &lt;a href=&quot;https://github.com/eric-hansen/phpunit.el/blob/minor-mode/phpunit.el#L169-190&quot; rel=&quot;nofollow&quot;&gt;https://github.com/eric-hansen/phpunit.el/blob/minor-mode/phpunit.el#L169-190&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also checked out the multi-term question that was asked on here but didn't help me very much.&lt;/p&gt;&#xA;" OwnerUserId="11992" LastActivityDate="2016-05-11T16:23:04.563" Title="How to populate helm-source by regexp" Tags="|helm|helm-sources|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22200" PostTypeId="1" CreationDate="2016-05-11T14:14:59.723" Score="7" ViewCount="1371" Body="&lt;p&gt;i am using a mode, but am not used to its key-bindings: some of them conflict to the emacs global ones. so, i want to add a prefix key-binding to all its existing keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for example, if &lt;em&gt;my-mode&lt;/em&gt; defines key-binding &lt;kbd&gt;M-]&lt;/kbd&gt; for &lt;em&gt;my-mode-shot&lt;/em&gt;, i am looking for some ways as following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-for-mode 'my-mode (kbd &quot;C-c m&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the key-binding for &lt;em&gt;my-mode-shot&lt;/em&gt; now is &lt;kbd&gt;C-c m M-]&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;how should one add a prefix key-binding to all available key-bindings of a specific mode?&lt;/p&gt;&#xA;" OwnerUserId="8622" LastEditorUserId="8622" LastEditDate="2016-05-12T16:12:52.477" LastActivityDate="2016-05-12T20:12:58.650" Title="how to add a prefix key to all keybindings of a specific mode?" Tags="|key-bindings|keymap|prefix-keys|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22201" PostTypeId="2" ParentId="22199" CreationDate="2016-05-11T14:35:06.423" Score="0" Body="&lt;p&gt;Does it work if you remove the &lt;a href=&quot;https://github.com/eric-hansen/phpunit.el/blob/minor-mode/phpunit.el#L189&quot; rel=&quot;nofollow&quot;&gt;quote for the source&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-05-11T14:35:06.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22202" PostTypeId="2" ParentId="22200" CreationDate="2016-05-11T14:53:40.010" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;Define a prefix key for the mode's keymap.&lt;/li&gt;&#xA;&lt;li&gt;Undefine the other keys that bother you, from that keymap.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Suppose that mode &lt;code&gt;foo-mode&lt;/code&gt; binds key &lt;code&gt;C-x o&lt;/code&gt; to &lt;code&gt;foo-it&lt;/code&gt;, and you don't like that.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key foo-mode-map (kbd &quot;C-x o&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And suppose you want &lt;code&gt;foo-mode-map&lt;/code&gt; on prefix key &lt;code&gt;&amp;lt;f9&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-prefix-command 'foo-mode-map)&#xA;(define-key global-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) 'foo-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-11T14:53:40.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22203" PostTypeId="2" ParentId="22200" CreationDate="2016-05-11T15:03:45.780" Score="4" Body="&lt;p&gt;One way to &lt;em&gt;move&lt;/em&gt; -mode's keybindings could be with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((origmap &amp;lt;foo&amp;gt;-mode-map)&#xA;      (newmap (make-sparse-keymap)))&#xA;  (define-key newmap &amp;lt;prefix&amp;gt; origmap)&#xA;  (setq &amp;lt;foo&amp;gt;-mode-map newmap))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this code will fail if run before foo-mode is run.  And it will have no effect if run after the mode is entered.  So you'll probably have to do it within `(with-eval-after-load '-mode ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if it's a minor mode, the above code won't have any effect either, because you additionally have to do something like (within the above &lt;code&gt;let&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcdr (assq '&amp;lt;foo&amp;gt;-mode minor-mode-map-alist) newmap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="93" LastEditDate="2016-05-11T18:13:29.983" LastActivityDate="2016-05-11T18:13:29.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22204" PostTypeId="2" ParentId="22199" CreationDate="2016-05-11T16:23:04.563" Score="0" Body="&lt;p&gt;I ran into this problem myself when I was writing a similar function.  The problem is that your generating function isn't getting called in the right buffer.  (I can't remember which buffer it's actually getting called in--maybe the Helm buffer itself?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the fix is to wrap the generating function in &lt;code&gt;with-helm-current-buffer&lt;/code&gt;, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun phpunit-helm-get-all-test-candidates ()&#xA;  &quot;&quot;&#xA;  (with-helm-current-buffer&#xA;    (let ((test-functions '())) &#xA;      (save-excursion&#xA;        (beginning-of-buffer)&#xA;        (while (search-forward-regexp php-beginning-of-defun-regexp nil t)&#xA;          (add-to-list 'test-functions&#xA;                       (format &quot;%S&quot; (match-string-no-properties 1)))))&#xA;      (message &quot;test-functions found ZOMG: %s&quot; test-functions)&#xA;      test-functions)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-05-11T16:23:04.563" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22205" PostTypeId="1" AcceptedAnswerId="22209" CreationDate="2016-05-11T16:47:13.047" Score="2" ViewCount="73" Body="&lt;p&gt;How do I declare custom completions for command arguments to AUCTeX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a LaTeX package that defines a number of macros. I'm writing the Elisp style support manually as some of the TeX code is rather hairy. One of the macros is &lt;code&gt;\ref&lt;/code&gt;-like, so in the style support file, I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(TeX-add-symbols '(&quot;myref&quot; TeX-arg-ref))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I insert &lt;code&gt;\ref&lt;/code&gt; or &lt;code&gt;\myref&lt;/code&gt; with &lt;code&gt;TeX-insert-macro&lt;/code&gt;, I get prompted for a label with completion. If I type &lt;code&gt;\ref{&lt;/code&gt; and press &lt;code&gt;M-TAB&lt;/code&gt; (&lt;code&gt;TeX-complete-symbol&lt;/code&gt;), I get completions of labels. But if I type &lt;code&gt;\myref{&lt;/code&gt; and press &lt;code&gt;M-TAB&lt;/code&gt;, I only get the fallback to dictionary words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I tell AUCTeX that the first argument of &lt;code&gt;\myref&lt;/code&gt; should be completed as a label?&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-05-11T20:35:14.707" LastActivityDate="2016-05-11T20:35:14.707" Title="Declaring custom completions to AUCTeX" Tags="|auctex|completion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22206" PostTypeId="1" AcceptedAnswerId="22207" CreationDate="2016-05-11T16:47:18.633" Score="2" ViewCount="72" Body="&lt;p&gt;Is it possible to force an Emacs buffer to place any new text it receives at the end of the buffer, instead of at the mouse point? I mean all of: keystrokes, yanks, mouse paste. I'm thinking in particular of buffers such as &lt;code&gt;*IPython*&lt;/code&gt;, where the moment you press enter, the line is actually echoed and executed at the end of the buffer. But in general, the issue applies to all terminal-like buffers, where it doesn't make sense to paste text anywhere but at the end.&lt;/p&gt;&#xA;" OwnerUserId="11995" LastActivityDate="2016-05-11T22:07:28.030" Title="Force append to buffer instead of at point" Tags="|buffers|ipython|yank|keystrokes|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22207" PostTypeId="2" ParentId="22206" CreationDate="2016-05-11T17:37:49.907" Score="1" Body="&lt;p&gt;You could hook into &lt;code&gt;before-change-functions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'before-change-functions #'(lambda (_b _e) (goto-char (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastEditorUserId="2223" LastEditDate="2016-05-11T22:07:28.030" LastActivityDate="2016-05-11T22:07:28.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22208" PostTypeId="2" ParentId="4150" CreationDate="2016-05-11T18:13:27.687" Score="0" Body="&lt;h3&gt;Modifying selected files in &lt;code&gt;dired&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The below solution needs installation of the &lt;a href=&quot;https://www.emacswiki.org/emacs/dired+.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;dired+&lt;/code&gt;&lt;/a&gt; package, which is available on Melpa.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First of all, convert your keyboard macro to an elisp function. &lt;a href=&quot;https://emacs.stackexchange.com/q/70/115&quot;&gt;Here's a related emacs.SE QnA&lt;/a&gt; (How to save a keyboard macro as a Lisp function?). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's even quicker if you know how you want to modify all the files using an elisp function directly. Let's say you want to add &quot;-*- mode: org -*-&quot; at the beginning of all the selected files in dired.&lt;sup&gt;1&lt;/sup&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, running the below elisp function in each of the selected files would work.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/set-org-mode ()&#xA;  (goto-char (point-min))&#xA;  (insert &quot;-*- mode: org -*-\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So just evaluate the above function for now; it will come to use at a later step below.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x dired&lt;/code&gt; and open the directory containing the files in which you want to run the above function.&lt;/li&gt;&#xA;&lt;li&gt;Mark all such files using the &lt;code&gt;m&lt;/code&gt; key (bound to &lt;code&gt;dired-mark&lt;/code&gt; in &lt;code&gt;dired&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;*magic step*&lt;/strong&gt;: Do &lt;code&gt;C-u @&lt;/code&gt; and select the name of the function you evaluated in Step 1 (&lt;code&gt;my/set-org-mode&lt;/code&gt;). &lt;em&gt;&lt;code&gt;@&lt;/code&gt; is bound to &lt;code&gt;diredp-do-apply-function&lt;/code&gt; which is defined in &lt;code&gt;dired+.el&lt;/code&gt;.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Boom! The &quot;-*- mode: org -*-&quot; line will be added at the top of all the marked files. But things are not saved yet. You can review what all changed if you want to and then hit &lt;code&gt;C-x s !&lt;/code&gt; to save all the modified files in one go.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;: &lt;em&gt;Inspired from &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/4iszn8/easy_way_to_add_mode_org_to_my_notes_files/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this question on reddit&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-05-11T18:13:27.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22209" PostTypeId="2" ParentId="22205" CreationDate="2016-05-11T18:50:33.273" Score="2" Body="&lt;p&gt;Add entries to &lt;code&gt;TeX-complete-list&lt;/code&gt;. This isn't documented in the manual, but there are examples in the support files distributed with AUCTeX.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq TeX-complete-list&#xA;        (append '(&#xA;                  (&quot;\\\\myref{\\([^{}\n&#xA;\\%,]*\\)&quot; 1 LaTeX-label-list &quot;}&quot;)&#xA;                  ) TeX-complete-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each element of &lt;code&gt;TeX-complete-list&lt;/code&gt; is a list consisting of a regexp to complete after, e.g. the command name followed by an opening brace and the already-existing element content in a group, followed by either:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The number of the group that contains the text to be completed.&lt;/li&gt;&#xA;&lt;li&gt;A function that is called with no arguments and returns a completion alist.&lt;/li&gt;&#xA;&lt;li&gt;A string to add after a completion.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;or:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A function of no arguments that is called to perform the completion.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-11T18:50:33.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22210" PostTypeId="1" CreationDate="2016-05-11T21:30:29.147" Score="5" ViewCount="456" Body="&lt;p&gt;I am looking for a solution (a function) that evaluates all the tables in the org file/buffer. I should be then simply able to add that to the local value of &lt;code&gt;before-save-hook&lt;/code&gt; in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I need to remember to &lt;code&gt;C-u C-c C-c&lt;/code&gt; on all the tables before exporting to ensure that the calculated values in all tables are current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or am I missing some org variable, setting which should take care of this?&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-12T02:01:10.793" LastActivityDate="2019-12-19T16:30:03.010" Title="Auto-update org tables before each export" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22211" PostTypeId="2" ParentId="22078" CreationDate="2016-05-11T22:01:37.713" Score="7" Body="&lt;p&gt;I use a function of my own. It moves a subtree to a new org file, and replaces it with a link to this new file. Specify the name of the file through the parameter or interactively at the prompt.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-move-tree (filename)&#xA;  &amp;quot;move the sub-tree which contains the point to a file,&#xA;and replace it with a link to the newly created file&amp;quot;&#xA;  (interactive &amp;quot;F&amp;quot;)&#xA;  (org-mark-subtree)&#xA;  (let&#xA;      ((name (buffer-substring (region-beginning)&#xA;                               (save-excursion (end-of-line) (point))))&#xA;       (xxx (buffer-substring (region-beginning) (region-end))))&#xA;    (setq name (replace-regexp-in-string &amp;quot;^[*]+ *&amp;quot; &amp;quot;&amp;quot; name))&#xA;    (delete-region (region-beginning) (region-end))&#xA;    (insert (format &amp;quot;[[file:%s][%s]]\n&amp;quot; filename name))&#xA;    (find-file-other-window filename)&#xA;    (insert xxx)&#xA;    (save-buffer)))&#xA;&#xA;(provide 'org-move-tree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11716" LastEditorUserId="28451" LastEditDate="2022-01-04T16:46:27.567" LastActivityDate="2022-01-04T16:46:27.567" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22212" PostTypeId="2" ParentId="22193" CreationDate="2016-05-11T22:16:42.440" Score="4" Body="&lt;p&gt;Below solution temporarily overrides the &lt;code&gt;dired-dwim-target-directory&lt;/code&gt; to simply return whatever value you set to the temporary variable &lt;code&gt;default-dest-dir&lt;/code&gt;. In this example, that value is set to &lt;code&gt;&quot;/my/default/to/dir&quot;&lt;/code&gt;. You will need to set that to your default destination directory.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/dired-do-rename (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (cl-letf* ((default-dest-dir &quot;/my/default/to/dir&quot;)&#xA;             ((symbol-function 'dired-dwim-target-directory)&#xA;              (lambda ()&#xA;                default-dest-dir)))&#xA;    (call-interactively #'dired-do-rename)))&#xA;(define-key dired-mode-map (kbd &quot;;&quot;) #'my/dired-do-rename)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;How to use this&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Mark the files in dired that you need to move to &lt;code&gt;default-dest-dir&lt;/code&gt;, using the &lt;code&gt;m&lt;/code&gt; key.&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;;&lt;/code&gt;, which is bound to &lt;code&gt;my/dired-do-rename&lt;/code&gt; above.&lt;/li&gt;&#xA;&lt;li&gt;You will see the minibuffer field pre-filled with the &lt;code&gt;default-dest-dir&lt;/code&gt; value.&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;RET&lt;/code&gt; to continue (or tweak the pre-filled directory if needed).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-05-11T22:16:42.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22213" PostTypeId="1" CreationDate="2016-05-11T23:13:33.987" Score="1" ViewCount="65" Body="&lt;p&gt;Currently, it seems like &lt;code&gt;describe-package&lt;/code&gt; will only show the contents of the 'commentary' section for packages that are builtin. For example &lt;code&gt;(describe-package 'python)&lt;/code&gt; show a detailed description of the package, however &lt;code&gt;(describe-package 'persp-mode)&lt;/code&gt; only shows the small amount of meta data present for all packages. This despite the fact that it has a &quot;Commentary&quot; section: &lt;a href=&quot;https://github.com/Bad-ptr/persp-mode.el/blob/master/persp-mode.el#L29&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the source of package.el, this seems to be intentional: &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/emacs-lisp/package.el#L2383&quot; rel=&quot;nofollow&quot;&gt;package.el link&lt;/a&gt;, however the GNU docs certainly suggest that the usage of the commentary section as the long description is not specific to built-in packages. Specifically, &quot;If the file has a ‘;;; Commentary:’ section, this section is used as the long description.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain what's going on here?&lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2016-05-11T23:13:33.987" Title="describe-package commentary for non built-in packages" Tags="|package|package-development|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22214" PostTypeId="2" ParentId="14466" CreationDate="2016-05-11T23:18:21.390" Score="3" Body="&lt;p&gt;Here's an alternative solution:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom after-save-interactively-hook nil&#xA;  &quot;Normal hook that is run after a buffer is saved interactively to its file.&#xA;  See `run-hooks'.&quot;&#xA;  :group 'files&#xA;  :type 'hook)&#xA;&#xA;(defun save-buffer-and-call-interactive-hooks (&amp;amp;optional arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (save-buffer arg)&#xA;  (when (called-interactively-p 'all)  ;; run post-hooks only if called interactively&#xA;    (run-hooks 'after-save-interactively-hook)))&#xA;&#xA;(global-set-key [(control x) (control s)] 'save-buffer-and-call-interactive-hooks)&#xA;&#xA;(defun run-mode-specific-after-save-interactively-buffer-hooks ())&#xA;&#xA;(add-hook 'after-save-interactively-hook 'run-mode-specific-after-save-interactively-buffer-hooks t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that I use.&lt;/p&gt;&#xA;" OwnerUserId="12001" LastActivityDate="2016-05-11T23:18:21.390" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22215" PostTypeId="2" ParentId="22210" CreationDate="2016-05-12T04:02:22.133" Score="8" Body="&lt;p&gt;I found the function you need (with a tiny bit of luck). You just have to add the following function to your &lt;code&gt;before-save-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-table-recalculate-buffer-tables&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming you have no other hooks, this means just to set.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'before-save-hook 'org-table-recalculate-buffer-tables)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Feel free to adjust it to your needs.&lt;/p&gt;&#xA;" OwnerUserId="8289" LastEditorUserId="2370" LastEditDate="2019-12-19T16:30:03.010" LastActivityDate="2019-12-19T16:30:03.010" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="22216" PostTypeId="2" ParentId="22119" CreationDate="2016-05-12T07:25:16.810" Score="1" Body="&lt;p&gt;If anyone's interested, the following bash script speeds up the process a bit.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;&#xA;find $1 -type f -iname &quot;*.org&quot; -print0 | parallel -0 org2txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Per @Joafigue's recommendation this script runs &lt;code&gt;orgmk&lt;/code&gt; for each file concurrently. Consequently it requires &lt;a href=&quot;http://www.gnu.org/software/parallel/&quot; rel=&quot;nofollow&quot;&gt;GNU Parallel&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effectively, the script searches for all org files in the given path and runs the command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ parallel org2txt ::: first.org second.org third.org ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously this is rather hackish, but I'm now significantly less bothered. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd still love to see orgmk gain the capability to process many files at once!&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2016-05-12T07:56:37.307" LastActivityDate="2016-05-12T07:56:37.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22217" PostTypeId="1" AcceptedAnswerId="22218" CreationDate="2016-05-12T07:44:01.080" Score="1" ViewCount="289" Body="&lt;p&gt;I installed the &lt;code&gt;flx-ido&lt;/code&gt; package from MELPA, and added the following two lines of code to my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'flx-ido)&#xA;(flx-ido-mode 1)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs startup fails with the following error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;File error: Cannot open load file, no such file or directory, flx-ido&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, after I see the error, I can type &lt;code&gt;M-x flx-ido-mode&lt;/code&gt; and the flx-ido-mode operations start to work fine. So the flx-ido files must have been loaded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand how this behavior is possible. Does anyone have some ideas that I might try to solve the problem?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="25" LastEditDate="2016-05-12T08:04:59.320" LastActivityDate="2016-05-12T08:04:59.320" Title="(require 'flx-ido) fails, but &quot;M-x flx-ido-mode&quot; succeeds" Tags="|package|libraries|require|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22218" PostTypeId="2" ParentId="22217" CreationDate="2016-05-12T08:04:49.647" Score="2" Body="&lt;p&gt;Emacs initializes the package system &lt;em&gt;after&lt;/em&gt; loading &lt;code&gt;.emacs&lt;/code&gt;, not before. (See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html#Startup-Summary&quot; rel=&quot;nofollow noreferrer&quot;&gt;Startup Summary&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Packaging-Basics.html#Packaging-Basics&quot; rel=&quot;nofollow noreferrer&quot;&gt;Packaging Basisc&lt;/a&gt;.) I think the reason is to allow you to configure (or even disable) the package loading process from &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add &lt;code&gt;flx-ido-mode&lt;/code&gt; to &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Init-File.html#index-after_002dinit_002dhook&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;after-init-hook&lt;/code&gt;&lt;/a&gt;. Or you can follow the &lt;a href=&quot;https://emacs.stackexchange.com/a/21024&quot;&gt;officious advice&lt;/a&gt; which is to call &lt;code&gt;package-initialize&lt;/code&gt; from your init file. After that point, you can load packages. &lt;code&gt;flx-ido-mode&lt;/code&gt; should be autoloaded, there's no need to load the package explicitly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;…&#xA;(flx-ido-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-12T08:04:49.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22219" PostTypeId="1" CreationDate="2016-05-12T08:12:28.350" Score="3" ViewCount="88" Body="&lt;p&gt;How can I display all Internet connections that are used during startup? Sometimes I work in a low speed Internet environment and I would like to remove all the Internet connection code during startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: strace shows that Emacs stucks when it tries to connect to dbus, but I have no idea why...&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-05-18T04:12:29.170" LastActivityDate="2016-05-18T04:12:29.170" Title="Display all internet connections during startup" Tags="|debugging|networking|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22220" PostTypeId="2" ParentId="735" CreationDate="2016-05-12T10:24:06.600" Score="1" Body="&lt;p&gt;In Emacs 22 or later just type &lt;code&gt;M-x irc&lt;/code&gt; to start &lt;a href=&quot;https://www.emacswiki.org/emacs/rcirc&quot; rel=&quot;nofollow&quot;&gt;rcirc&lt;/a&gt;. Using the default configuration will connect to Freenode and join #rcirc. If you don't want to use the default configuration, type &lt;code&gt;C-u M-x irc&lt;/code&gt; instead. Otherwise you can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/rcirc/Configuration.html#Configuration&quot; rel=&quot;nofollow&quot;&gt;configure rcirc&lt;/a&gt; in your init file.&lt;/p&gt;&#xA;" OwnerUserId="890" LastActivityDate="2016-05-12T10:24:06.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22221" PostTypeId="2" ParentId="22210" CreationDate="2016-05-12T15:48:55.420" Score="1" Body="&lt;p&gt;Thanks to the hint to the correct function by &lt;strong&gt;Joafigue&lt;/strong&gt;, I solved the question by adding this to my config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Recalculate all org tables in the buffer when saving.&#xA;(defvar-local modi/org-table-enable-buffer-wide-recalculation t&#xA;  &quot;When non-nil, all the org tables in the buffer will be recalculated when&#xA;saving the file.&#xA;&#xA;This variable is buffer local.&quot;)&#xA;;; Mark `modi/org-table-enable-buffer-wide-recalculation' as a safe local&#xA;;; variable as long as its value is t or nil. That way you are not prompted&#xA;;; to add that to `safe-local-variable-values' in custom.el.&#xA;(put 'modi/org-table-enable-buffer-wide-recalculation 'safe-local-variable #'booleanp)&#xA;&#xA;(defun modi/org-table-recalculate-buffer-tables (&amp;amp;rest args)&#xA;  &quot;Wrapper function for `org-table-recalculate-buffer-tables' that runs&#xA;that function only if `modi/org-table-enable-buffer-wide-recalculation' is&#xA;non-nil.&#xA;&#xA;Also, this function has optional ARGS that is needed for any function that is&#xA;added to `org-export-before-processing-hook'. This would be useful if this&#xA;function is ever added to that hook.&quot;&#xA;  (when modi/org-table-enable-buffer-wide-recalculation&#xA;    (org-table-recalculate-buffer-tables)))&#xA;&#xA;(defun modi/org-table-recalculate-before-save ()&#xA;  &quot;Recalculate all org tables in the buffer before saving.&quot;&#xA;  (add-hook 'before-save-hook #'modi/org-table-recalculate-buffer-tables nil :local))&#xA;(add-hook 'org-mode-hook #'modi/org-table-recalculate-before-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-13T17:00:39.163" LastActivityDate="2016-05-13T17:00:39.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22222" PostTypeId="1" CreationDate="2016-05-12T15:49:13.200" Score="5" ViewCount="69" Body="&lt;p&gt;In my custom style support file, I would like to add custom code to parse an environment. That is, my LaTeX code looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{foobar}&#xA;  some complex stuff&#xA;\end{foobar}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I don't want to capture &lt;code&gt;some complex stuff&lt;/code&gt; in a regexp, it's too complex for that, but I do want to analyze it. I can't use generic entries to parse &lt;code&gt;some complex stuff&lt;/code&gt; because they would have a ridiculous amount of false positives outside the &lt;code&gt;foobar&lt;/code&gt; environment. I can capture the beginning of the environment in an entry in &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Hacking-the-Parser.html#Hacking-the-Parser&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;TeX-auto-regexp-list&lt;/code&gt;&lt;/a&gt;, but what am I supposed to put in my function?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun TeX-parse-foobar-environment (match)&#xA;  (let ((name (TeX-match-buffer match))&#xA;        (start ???) (end ???))&#xA;    (parse-foobar-region start end)))&#xA;(TeX-auto-add-regexp '(&quot;\\\\begin{\\(foobar\\)}&quot; 1 TeX-parse-foobar-environment))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't see anything about this in the manual. Should I call &lt;code&gt;LaTeX-find-matching-begin&lt;/code&gt; then &lt;code&gt;LaTeX-find-matching-end&lt;/code&gt; to determine where the environment starts and ends? How does this generalize to examples other than environments? I could find out empirically where the point is, but can I count on that being the same in all versions of AUCTeX?&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2023-12-07T20:41:55.677" Title="AUCTeX automatic extraction: beyond regexps" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22223" PostTypeId="1" AcceptedAnswerId="22224" CreationDate="2016-05-12T16:21:19.117" Score="8" ViewCount="2202" Body="&lt;p&gt;I want to use &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals&quot;&gt;ES6 template string literals&lt;/a&gt; e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`string text line 1&#xA; string text line 2&#xA; string text ${expression}`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However emacs doesn't recognize that their contents are a string, so syntax highlighting, indentation, etc. don't work. How can I tell emacs that backticks are string delimiters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs version 24.5, and the built in &lt;code&gt;js-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="237" LastEditorUserId="237" LastEditDate="2016-05-12T18:38:53.457" LastActivityDate="2016-05-12T21:52:01.187" Title="How can I make emacs support javascript ES6 template string literals?" Tags="|javascript|syntax-table|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22224" PostTypeId="2" ParentId="22223" CreationDate="2016-05-12T16:21:19.117" Score="9" Body="&lt;p&gt;You need to add backticks as a string delimiter to the &lt;code&gt;js-mode&lt;/code&gt; syntax table like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?` &quot;\&quot;&quot; js-mode-syntax-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More information &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsSyntaxTable&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="237" LastActivityDate="2016-05-12T16:21:19.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22225" PostTypeId="2" ParentId="22223" CreationDate="2016-05-12T19:40:44.420" Score="7" Body="&lt;p&gt;For the record,  ES6 template string literals are supported out-of-the-box in &lt;a href=&quot;https://github.com/mooz/js2-mode&quot;&gt;&lt;code&gt;js2-mode&lt;/code&gt;&lt;/a&gt;, complete with font-locking for the interpolated variables as well. &lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-05-12T21:16:19.467" LastActivityDate="2016-05-12T21:16:19.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22226" PostTypeId="1" AcceptedAnswerId="22229" CreationDate="2016-05-12T20:02:49.893" Score="2" ViewCount="1485" Body="&lt;p&gt;I have&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;C-x-right&amp;gt;&quot;) 'other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use this keymap, I am able to switch the window one time. When I hit the right arrow key again nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I have to denote the keymap to that I can use it like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x&lt;/code&gt; *pressed and held*&lt;/li&gt;&#xA;&lt;li&gt;*press right* to change window&lt;/li&gt;&#xA;&lt;li&gt;*press right again* change window&lt;/li&gt;&#xA;&lt;li&gt;*press right again* change window and so on&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12007" LastEditorUserId="675" LastEditDate="2016-05-12T20:22:14.083" LastActivityDate="2016-05-14T03:36:15.193" Title="Holding down &lt;C-x-left/right&gt; to switch between windows" Tags="|key-bindings|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22228" PostTypeId="2" ParentId="22200" CreationDate="2016-05-12T20:12:58.650" Score="1" Body="&lt;p&gt;You can modify the mode's keymap directly to move all the bindings under your chosen prefix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcdr my-mode-map&#xA;  `(keymap (?\C-c keymap (?m keymap . ,(cdr my-mode-map)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-12T20:12:58.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22229" PostTypeId="2" ParentId="22226" CreationDate="2016-05-12T20:24:41.670" Score="2" Body="&#xA;&#xA;&lt;h1&gt;Solution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Using the &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;hydra&lt;/code&gt;&lt;/a&gt; package (also available from Melpa/GNU Elpa) could be one of the solutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below hydra-binding style does not take over the whole &lt;code&gt;C-x&lt;/code&gt; map.&lt;sup&gt;1&lt;/sup&gt; The hydra hints will show up only after you hit &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt; or &lt;code&gt;C-x &amp;lt;left&amp;gt;&lt;/code&gt; for the first time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After evaluating the below code (or adding it to your config and restarting emacs),&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can now do &lt;code&gt;C-x &amp;lt;right&amp;gt; &amp;lt;right&amp;gt; &amp;lt;right&amp;gt; &amp;lt;left&amp;gt; &amp;lt;right&amp;gt; &amp;lt;left&amp;gt; &amp;lt;left&amp;gt;&lt;/code&gt; ..&lt;/li&gt;&#xA;&lt;li&gt;Whenever you want to get out of that hydra, hit &lt;code&gt;C-g&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Original&lt;/h3&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defhydra hydra-other-window&#xA;  (global-map &quot;C-x&quot;&#xA;              :color red)&#xA;  &quot;other window&quot;&#xA;  (&quot;&amp;lt;right&amp;gt;&quot; other-window &quot;→&quot;)&#xA;  (&quot;&amp;lt;left&amp;gt;&quot; (lambda () (interactive) (other-window -1)) &quot;←&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Alternative without hints&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If you do not want to see any hints, even the &quot;hydra title window&quot; (known as &lt;code&gt;lv&lt;/code&gt; in the &lt;code&gt;hydra&lt;/code&gt; package), add the below &lt;code&gt;hydra-set-property&lt;/code&gt; form&lt;sup&gt;2&lt;/sup&gt; in addition to the above hydra definition [&lt;a href=&quot;https://github.com/abo-abo/hydra/issues/196&quot; rel=&quot;nofollow&quot;&gt;Reference&lt;/a&gt;].&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(hydra-set-property 'hydra-other-window :verbosity 0) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; That is the &quot;Don't mess with the prefix&quot; style described &lt;a href=&quot;https://github.com/abo-abo/hydra/wiki/Binding-Styles&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; If you get an error saying that &lt;code&gt;hydra-set-property&lt;/code&gt; is undefined, ensure that you have the latest version of &lt;code&gt;hydra&lt;/code&gt; installed from Melpa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This is possibly one of the simplest hydras possible. Check out &lt;a href=&quot;https://github.com/abo-abo/hydra/wiki&quot; rel=&quot;nofollow&quot;&gt;its wiki&lt;/a&gt; for more hydra application examples. :)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-13T17:43:00.527" LastActivityDate="2016-05-13T17:43:00.527" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22230" PostTypeId="2" ParentId="22226" CreationDate="2016-05-12T20:25:54.683" Score="2" Body="&lt;p&gt;(Function &lt;code&gt;repeat-command&lt;/code&gt;, shown here, is also defined in library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt;, but &lt;em&gt;you do not need any library or package&lt;/em&gt; outside vanilla Emacs for this simple question.  This answer makes use of standard Emacs library &lt;code&gt;repeat.el&lt;/code&gt;, but nothing else.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use function &lt;strong&gt;&lt;code&gt;repeat-command&lt;/code&gt;&lt;/strong&gt; to &quot;repeatify&quot; any nonrepeatable command.  Here it is used to repeatify `other-window'.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun repeat-command (command)&#xA;  &quot;Repeat COMMAND.&quot;&#xA;  (let ((repeat-message-function  'ignore))&#xA;    (setq last-repeatable-command  command)&#xA;    (repeat nil)))&#xA;&#xA;(defun next-window-repeat (count)&#xA;  &quot;Select the next window.&#xA;With a prefix arg N, select the Nth next window.&#xA;A negative prefix arg reverses the direction.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (require 'repeat)&#xA;  (repeat-command `(lambda () (interactive) (other-window ',count))))&#xA;&#xA;(defun previous-window-repeat (count)&#xA;  &quot;Select the previous window.&#xA;With a prefix arg N, select the Nth previous window.&#xA;A negative prefix arg reverses the direction.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (require 'repeat)&#xA;  (repeat-command `(lambda () (interactive) (other-window ',(- count)))))&#xA;&#xA;(global-set-key (kbd &quot;C-x &amp;lt;C-right&amp;gt;&quot;) 'next-window-repeat)&#xA;(global-set-key (kbd &quot;C-x &amp;lt;C-left&amp;gt;&quot;)  'previous-window-repeat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with what you did is that you bind &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt; to &lt;code&gt;other-window&lt;/code&gt;, and &lt;code&gt;other-window&lt;/code&gt; does not read any key after it has switched you to the other window - it is done. So you have to hit &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt; again, to invoke &lt;code&gt;other-window&lt;/code&gt; again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In command &lt;code&gt;other-window-repeat&lt;/code&gt;, &lt;code&gt;repeat-command&lt;/code&gt; invokes &lt;code&gt;other-window&lt;/code&gt;, and then if the last key is hit again, it invokes &lt;code&gt;other-window&lt;/code&gt; again...&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-14T01:43:51.823" LastActivityDate="2016-05-14T01:43:51.823" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22231" PostTypeId="2" ParentId="22223" CreationDate="2016-05-12T21:52:01.187" Score="3" Body="&lt;p&gt;Or you just wait for Emacs 25.1 to come out. It's fixed there.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-05-12T21:52:01.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22232" PostTypeId="1" AcceptedAnswerId="24089" CreationDate="2016-05-12T22:10:22.997" Score="1" ViewCount="565" Body="&lt;pre&gt;&lt;code&gt;Assume a structure like this:&#xA;2014&#xA;...&#xA;2015&#xA; CustomerfolderA&#xA;  ConfigfileDeviceA_2015_01_01_0800.txt&#xA;  ConfigfileDeviceA_2015_01_02_0800.txt&#xA;  ...&#xA;  ConfigfileDeviceB_2015_01_01_0800.txt&#xA;  ...&#xA;  ConfigfileDeviceC_2015_01_01_0800.txt&#xA;  ...&#xA;  MiscCustomerInfos.txt&#xA;  Bla.txt&#xA;  BlaBla.txt&#xA;  ...&#xA; CustomerfolderB&#xA; ...&#xA;2016&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want is to convert all the text-files of a folder to one org mode file per folder. The org headings should contain the name of the orginating text files and below should be the content of the orginating text files. What would be the exact commands to reach that goal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find in combination with Pandoc should be a solution. I found the releated thread about markdown-file conversion below, but the altering is too difficult for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/5465/how-to-migrate-markdown-files-to-emacs-org-mode-format&quot;&gt;How to migrate Markdown files to Emacs org mode format&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11055" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-09-19T13:32:36.843" Title="Mass conversion of text files in a folder to one .org file" Tags="|org-mode|files|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22234" PostTypeId="2" ParentId="22226" CreationDate="2016-05-13T00:26:46.667" Score="0" Body="&lt;p&gt;Another approach -- Use any key (e.g., &lt;code&gt;C-x o&lt;/code&gt;) for a command that reads the up/down arrow keys to move among the windows.  For this you will need library &lt;a href=&quot;https://www.emacswiki.org/emacs/DoReMi&quot; rel=&quot;nofollow&quot;&gt;Do Re Mi&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/doremi.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;doremi.el&lt;/code&gt;&lt;/a&gt;).  (This code is also in &lt;a href=&quot;https://www.emacswiki.org/emacs/download/doremi-cmd.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;doremi-cmd.el&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun doremi-windows+ ()&#xA;  &quot;Use up and down arrow keys to cycle among windows of selected frame.&#xA;You can use `C-g' to quit and return to the originally selected window.&quot;&#xA;  (interactive)&#xA;  (unless (require 'doremi) (error &quot;You need library `doremi.el' for this command&quot;)) &#xA;  (let ((sel-win  (selected-window)))&#xA;    (condition-case nil&#xA;        (doremi-windows-1)&#xA;      (quit (select-window sel-win)))))&#xA;&#xA;(defun doremi-windows-1 ()&#xA;  &quot;Helper-function for `doremi-windows+'.&quot;&#xA;  (doremi (lambda (newval) (select-window newval 'norecord) newval)&#xA;          (selected-window)&#xA;          nil&#xA;          nil&#xA;          (reverse (window-list))))&#xA;&#xA;(global-set-key (kbd &quot;C-x o&quot;) 'doremi-windows+)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-13T00:26:46.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22236" PostTypeId="2" ParentId="8043" CreationDate="2016-05-13T01:11:37.833" Score="1" Body="&lt;p&gt;I am trying to get the local variables aspect of &lt;code&gt;update-file-autoloads&lt;/code&gt; working, but have encountered difficulties. In particular, I have the following results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my local variables declaration at the bottom of my simple lisp file that contains the autoload cookie:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Local Variables:&#xA;;; generated-autoload-file: &quot;~/my-autoloads.el&quot;&#xA;;; End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this fails with all of these forms executed in lisp-interaction-mode in the my-lisp-file.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(update-file-autoloads &quot;my-lisp-file.el&quot;)&#xA;(update-file-autoloads &quot;~/my-lisp-file.el&quot;)&#xA;(update-file-autoloads &amp;lt;as above&amp;gt; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The forms below all work, but they don't use the Local Variables method. An absolute pathname is always required for the output &lt;code&gt;my-autoloads.el&lt;/code&gt; file. Either a relative or absolute pathname works for the input file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(update-file-autoloads &quot;~/my-lisp-file.el&quot; t &quot;~/my-autoloads.el&quot;)&#xA;(update-file-autoloads &quot;my-lisp-file.el&quot; t &quot;~/my-autoloads.el&quot;)&#xA;&#xA;(let ((generated-autoload-file &quot;~/my-autoloads.el&quot;))&#xA;  (update-file-autoloads &quot;~/my-lisp-file.el&quot;))&#xA;(let ((generated-autoload-file &quot;~/my-autoloads.el&quot;))&#xA;  (update-file-autoloads &quot;my-lisp-file.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In summary, I could not get the local variables method to work at all, using the syntax I showed earlier, with any of the command forms shown above. Typically I would receive an error like this when trying to make use of the Local Variables method.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  file-name-directory(nil)&#xA;  autoload-file-load-name(&quot;~/my-lisp-file.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone see anything wrong with my Local Variables syntax (esp since it looks exactly like the original poster's syntax, which apparently worked for him, and which follows the Emacs doc?  Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. I'm running Emacs 24.5.1 on OSX.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-05-13T01:28:09.547" LastActivityDate="2016-05-13T01:28:09.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22237" PostTypeId="2" ParentId="17287" CreationDate="2016-05-13T01:20:32.977" Score="1" Body="&lt;p&gt;I was getting similar backtraces when trying to open any buffer with inline images. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following wasamasa's comment I ran emacs under GDB. While I am not able to fix the bug right now, I found it is related to libpng12 and my openCL runtime (intel). Removing libpng12 solved the issue for me.&lt;/p&gt;&#xA;" OwnerUserId="12011" LastActivityDate="2016-05-13T01:20:32.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22238" PostTypeId="1" AcceptedAnswerId="22239" CreationDate="2016-05-13T01:20:54.543" Score="2" ViewCount="208" Body="&lt;p&gt;I try to execute &lt;code&gt;echo ${GOPATH}&lt;/code&gt; with &lt;code&gt;call-process&lt;/code&gt; as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process &quot;echo&quot; nil t nil &quot;${GOPATH}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it only output &quot;${GOPATH}&quot; not the value of that value. Would anyone please let me know what the correct way to do it?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="105" LastEditDate="2016-06-22T19:46:59.303" LastActivityDate="2016-06-22T19:46:59.303" Title="How to call &quot;echo ${GOPATH}&quot; with call-process?" Tags="|shell|call-process|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22239" PostTypeId="2" ParentId="22238" CreationDate="2016-05-13T02:04:09.093" Score="5" Body="&lt;p&gt;You're looking for &lt;code&gt;(call-process-shell-command &quot;echo ${GOPATH}&quot; nil t nil)&lt;/code&gt;. In this case, &lt;code&gt;${PATH}&lt;/code&gt; is syntax defined by a shell, not a native call, so you'll need to invoke a shell to interpret it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you may be interested in &lt;code&gt;(insert (getenv &quot;GOPATH&quot;))&lt;/code&gt; which is considerably more direct, as it simply reads the environment instead of spawning a shell to read the environment in its stead.&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-05-13T02:04:09.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22240" PostTypeId="2" ParentId="21378" CreationDate="2016-05-13T02:33:45.483" Score="4" Body="&lt;p&gt;Suppose you already downloaded en_US-med.dic and en_US-med.aff and installed hunspell&lt;/p&gt;&#xA;&lt;p&gt;Step 1, run &lt;code&gt;hunspell -D&lt;/code&gt; in shell, which will tell the directory where hunspell  searches for dictionaries, copy en_US-med.dic and en_US-med.aff to that directory.&lt;/p&gt;&#xA;&lt;p&gt;Step 2, insert below code into ~/.emacs,&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (setq ispell-program-name &amp;quot;hunspell&amp;quot;)&#xA;    ;; you could set `ispell-dictionary` instead but `ispell-local-dictionary' has higher priority&#xA;    (setq ispell-local-dictionary &amp;quot;en_US&amp;quot;)&#xA;    (setq ispell-local-dictionary-alist '((&amp;quot;en_US&amp;quot; &amp;quot;[[:alpha:]]&amp;quot; &amp;quot;[^[:alpha:]]&amp;quot; &amp;quot;[']&amp;quot; nil (&amp;quot;-d&amp;quot; &amp;quot;en_US,en_US-med&amp;quot;) nil utf-8)))&#xA;    ;; new variable `ispell-hunspell-dictionary-alist' is defined in Emacs&#xA;    ;; If it's nil, Emacs tries to automatically set up the dictionaries.&#xA;    (when (boundp 'ispell-hunspell-dictionary-alist)&#xA;      (setq ispell-hunspell-dictionary-alist ispell-local-dictionary-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;We actually pass the option &amp;quot;-d en_US,en_US-med&amp;quot; to the hunspell CLI so it can use &lt;strong&gt;TWO  dictionary &amp;quot;en_US&amp;quot; and &amp;quot;en_US-med&amp;quot;&lt;/strong&gt; at the same time.&lt;/p&gt;&#xA;&lt;p&gt;The &amp;quot;-d&amp;quot; options is documented in hunspell manual (&lt;code&gt;man hunspell&lt;/code&gt; in shell)&lt;/p&gt;&#xA;&lt;p&gt;Here is the quoted text from hunspell manual:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;-d en_US,en_geo,en_med,de_DE,de_med&#xA;&#xA;       en_US  and  de_DE  are  base dictionaries, they consist of aff and dic&#xA;       file pairs: en_US.aff, en_US.dic and  de_DE.aff,  de_DE.dic.   En_geo,&#xA;       en_med,  de_med  are  special dictionaries: dictionaries without affix&#xA;       file. Special dictionaries are optional extension of the base  dictio‐&#xA;       naries  usually  with  special (medical, law etc.)  terms. There is no&#xA;       naming convention for special dictionaries, only the &amp;quot;.dic&amp;quot; extension:&#xA;       dictionaries  without affix file will be an extension of the preceding&#xA;       base dictionary (right order of the parameter list needs for good sug‐&#xA;       gestions). First item of -d parameter list must be a base dictionary.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Tested on Emacs 24.3, Debian 7 with the word &amp;quot;fibrochondritis&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;Should &lt;strong&gt;work at Emacs 23+ on any OS&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Please note on Windows the easiest way to let hunspell know the search path is to setup environment variable &lt;code&gt;DICPATH&lt;/code&gt; (it's documented in hunspell manual).&lt;/p&gt;&#xA;&lt;p&gt;BTW, it's very possible &lt;strong&gt;the hunspell executable from Cygwin/MSYS2 only recognises path in UNIX format&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="2264" LastEditDate="2023-07-23T17:48:55.727" LastActivityDate="2023-07-23T17:48:55.727" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="22241" PostTypeId="1" AcceptedAnswerId="22244" CreationDate="2016-05-13T09:11:03.240" Score="0" ViewCount="73" Body="&lt;p&gt;When using &lt;code&gt;C-x C-F&lt;/code&gt; to open a file, pressing &lt;kbd&gt;⇧&lt;/kbd&gt; (up arrow) will iterate over the files I have recently opened. I believe the relevant lines from my &lt;code&gt;~/.emacs&lt;/code&gt; file are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'recentf)&#xA;(recentf-mode 1)&#xA;(setq recentf-max-menu-items 50)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In any case, removing those lines empties my history (although the &lt;kbd&gt;⇧&lt;/kbd&gt; is still there, it complains about no items in history). If those are not the correct lines, you can see my entire &lt;code&gt;.emacs&lt;/code&gt; file &lt;a href=&quot;http://pastebin.com/9mtXFqdB&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I configure this so that if, after &lt;code&gt;C-x C-F&lt;/code&gt;, I type &lt;code&gt;foo&lt;/code&gt; and press &lt;kbd&gt;⇧&lt;/kbd&gt;, only those files in my history whose name starts with &lt;code&gt;foo&lt;/code&gt; are displayed. In *nix shells, this can be done by adding the following lines to &lt;code&gt;~/.inputrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\e[A&quot;: history-search-backward&#xA;&quot;\e[B&quot;: history-search-forward&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get emacs to do the same?&lt;/p&gt;&#xA;" OwnerUserId="241" LastActivityDate="2016-05-13T13:21:55.273" Title="Show only file names starting with the given string in emacs history" Tags="|completion|history|recentf|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22242" PostTypeId="1" AcceptedAnswerId="22268" CreationDate="2016-05-13T09:14:13.117" Score="5" ViewCount="1818" Body="&lt;p&gt;I have recently &lt;a href=&quot;http://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml&quot; rel=&quot;noreferrer&quot;&gt;found a way to have a floating capture window&lt;/a&gt;, with this setting I can create a floating capture window using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -n -e '(make-capture-frame)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My knowledge of elisp and org-mode internals being close to 0, I did not find a way to have the same behaviour via the org-protocol. What I would like is that when a call happen using the org-protocol, I have a nice floating capture window in front of me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I'm not attach to use this specific code to create a floating capture window, but that is my current starting point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code I'm currently using:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;&#xA;;; Capture floating frame&#xA;;;&#xA;;; taken from: http://www.windley.com/archives/2010/12/capture_mode_and_emacs.shtml&#xA;;;;&#xA;&#xA;(defadvice org-capture-finalize&#xA;    (after delete-capture-frame activate)&#xA;  &quot;Advise capture-finalize to close the frame&quot;&#xA;  (if (equal &quot;capture&quot; (frame-parameter nil 'name))&#xA;      (delete-frame)))&#xA;&#xA;(defadvice org-capture-destroy&#xA;    (after delete-capture-frame activate)&#xA;  &quot;Advise capture-destroy to close the frame&quot;&#xA;  (if (equal &quot;capture&quot; (frame-parameter nil 'name))&#xA;      (delete-frame)))&#xA;&#xA;;; make the frame contain a single window. by default org-capture&#xA;;; splits the window.&#xA;(add-hook 'org-capture-mode-hook&#xA;          'delete-other-windows)&#xA;&#xA;(defadvice org-switch-to-buffer-other-window&#xA;  (after supress-window-splitting activate)&#xA;  &quot;Delete the extra window if we're in a capture frame&quot;&#xA;  (if (equal &quot;capture&quot; (frame-parameter nil 'name))&#xA;      (delete-other-windows)))&#xA;&#xA;(defun make-capture-frame ()&#xA;  &quot;Create a new frame and run org-capture.&quot;&#xA;  (interactive)&#xA;  (make-frame '((name . &quot;capture&quot;)&#xA;                (width . 120)&#xA;                (height . 15)))&#xA;  (select-frame-by-name &quot;capture&quot;)&#xA;  (setq word-wrap 1)&#xA;  (setq truncate-lines nil)&#xA;  (org-capture))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6720" LastActivityDate="2016-05-14T16:46:19.350" Title="Using org-protocol with a floating capture window?" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22243" PostTypeId="1" AcceptedAnswerId="22269" CreationDate="2016-05-13T09:54:15.437" Score="2" ViewCount="499" Body="&lt;p&gt;I'm a newbie to eshell and I want to find the list function(s) which &quot;find ./&quot; calls. For the ls command I can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;which ls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which conveniently tells me where eshell/ls is, and links to the underlying function. On the other hand&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;which find&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find is an alias for `cl-find` in `cl.el`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but as far as I can see, there is no cl-find in cl.el, and clicking the link only takes me to the top of the cl.el file. How can I find the code which is evaluated by the find command? Is there any kind of convenient, general way of seeing the functions which get called by an eshell command?&lt;/p&gt;&#xA;" OwnerUserId="12015" LastEditorUserId="105" LastEditDate="2016-06-22T19:46:40.117" LastActivityDate="2016-06-22T19:46:40.117" Title="Where is the find alias in eshell?" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22244" PostTypeId="2" ParentId="22241" CreationDate="2016-05-13T10:42:58.273" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;previous-complete-history-element&lt;/code&gt; and &lt;code&gt;next-complete-history-element&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To map to the Up and Down keys, use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key minibuffer-local-completion-map (kbd &quot;&amp;lt;up&amp;gt;&quot;) 'previous-complete-history-element)&#xA;(define-key minibuffer-local-completion-map (kbd &quot;&amp;lt;down&amp;gt;&quot;) 'next-complete-history-element)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="241" LastEditDate="2016-05-13T13:21:55.273" LastActivityDate="2016-05-13T13:21:55.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22245" PostTypeId="1" AcceptedAnswerId="22252" CreationDate="2016-05-13T08:20:23.257" Score="4" ViewCount="1345" Body="&lt;p&gt;In general I want Emacs to save a backup file for me, except in some special directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to define a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Directory Local Variables&lt;/a&gt;, and add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((make-backup-files . nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it seem it won't take effect. I think it is because &lt;code&gt;make-backup-files&lt;/code&gt; is a global variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a equivalent local variable to control the backup creation function?&lt;/p&gt;&#xA;" OwnerUserId="12018" OwnerDisplayName="davidshen84" LastEditorUserId="105" LastEditDate="2022-04-04T15:42:57.250" LastActivityDate="2022-04-04T15:42:57.250" Title="How to stop auto backup in some directory in Emacs" Tags="|directory-local-variables|backup|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22246" PostTypeId="1" CreationDate="2016-05-13T13:57:07.127" Score="2" ViewCount="365" Body="&lt;p&gt;I tried to change both &lt;code&gt;org-code&lt;/code&gt; and &lt;code&gt;org-verbatim&lt;/code&gt; without success. Here is the relevant part of my theme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(org-verbatim ((nil (:inherit 'fixed-pitch))))&#xA;'(org-code ((nil (:inherit 'fixed-pitch))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The setting for checkboxes does get applied however &lt;code&gt;'(org-checkbox ((nil (:inherit 'fixed-pitch))))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2016-05-13T13:57:07.127" Title="How can I change the font face for source code blocks in org-mode?" Tags="|org-mode|themes|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22247" PostTypeId="1" CreationDate="2016-05-13T14:41:12.577" Score="1" ViewCount="278" Body="&lt;p&gt;I've setup the indentation for tabs in Rust to be 2 whitespaces. That's what I want. And in my config it looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'rust-mode-hook&#xA;  (lambda ()&#xA;    (setq indent-tabs-mode nil)&#xA;    (setq tab-width 2)&#xA;    (setq rust-indent-offset 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the difference between &lt;code&gt;tab-width&lt;/code&gt; and &lt;code&gt;rust-indent-offset&lt;/code&gt; or &lt;code&gt;&amp;lt;lang&amp;gt;-indent-offset&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11957" LastEditorUserId="124" LastEditDate="2016-05-14T22:25:11.380" LastActivityDate="2016-05-14T22:25:11.380" Title="tab-width and &lt;lang&gt;-indent-offset difference" Tags="|tabs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22248" PostTypeId="2" ParentId="22247" CreationDate="2016-05-13T15:44:55.453" Score="1" Body="&lt;p&gt;&lt;code&gt;tab-width&lt;/code&gt; is the width used to &lt;em&gt;display&lt;/em&gt; a TAB character. It also has an effect when &lt;code&gt;indent-tabs-mode&lt;/code&gt; is non-nil, in which case Emacs uses &lt;code&gt;tab-width&lt;/code&gt; to decide when to replace so many spaces with one TAB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ruby-indent-offset&lt;/code&gt; and similar variables control by how many spaces to indent.&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorUserId="1979" LastEditDate="2016-05-14T13:58:16.403" LastActivityDate="2016-05-14T13:58:16.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22250" PostTypeId="1" AcceptedAnswerId="22261" CreationDate="2016-05-13T17:39:37.827" Score="3" ViewCount="358" Body="&lt;p&gt;For my main package loading, I want to use &lt;code&gt;melpa-stable&lt;/code&gt;. There's at least one package (&lt;code&gt;dash&lt;/code&gt;) that I know breaks my config if I use the &lt;code&gt;melpa&lt;/code&gt; version. That's fine - I've no problem using &lt;code&gt;melpa-stable&lt;/code&gt; as my default archive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there are some packages I need to get from &lt;code&gt;melpa&lt;/code&gt; - specifically &lt;code&gt;sublime-themes&lt;/code&gt;. Obviously I could download that package manually and install it somewhere in my load-path, but I'd prefer to use the package manager (and I'd &lt;em&gt;also&lt;/em&gt; like to do so from elisp, so I can have my &lt;code&gt;init.el&lt;/code&gt; install it if it's not present, for when I go to a new machine).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to say &quot;use this archive for this package, but don't use it for other packages&quot;?&lt;/p&gt;&#xA;" OwnerUserId="12019" LastActivityDate="2016-05-15T12:45:24.910" Title="Can I load a single package from a different archive?" Tags="|package|package-repositories|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22251" PostTypeId="1" CreationDate="2016-05-13T17:46:56.033" Score="0" ViewCount="297" Body="&lt;p&gt;I am using Emacs 24.5.1 for writing something in pygame in python 2.7.11. Very often (precisely speaking every second time!) when I try to evaluate the buffer (the whole file) with &lt;code&gt;C-c C-c&lt;/code&gt; everything crashes and in the shell I get this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Process Python[/path/to/the/file.py] segmentation fault (core dumped)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is this happening and what is the way to get rid of it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should also mention that this only happens when I try things in Emacs, if I run the program in terminal or other editors like geany every thing works fine. But I would like to work in Emacs on my python projects. I am using Ubuntu 16.04 LTS.&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastEditorUserId="675" LastEditDate="2016-05-13T17:54:33.680" LastActivityDate="2016-05-13T17:54:33.680" Title="Emacs+Python+Pygame segmentation fault (core dumped)" Tags="|python|terminal-emacs|ubuntu|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22252" PostTypeId="2" ParentId="22245" CreationDate="2016-05-13T18:24:22.220" Score="3" Body="&lt;p&gt;Backup decisions seem to pass through the function &lt;code&gt;normal-backup-enable-predicate&lt;/code&gt;, via the variable &lt;code&gt;backup-enable-predicate&lt;/code&gt; which is set to this by default. You can provide your own function to return &lt;code&gt;nil&lt;/code&gt; if no backup is to be done. &#xA;For example, &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-backup-enable-predicate (name)&#xA;  (let (found)&#xA;    (dolist (specialdir '(&quot;/somedir/&quot; &quot;/some/other/&quot;) found)&#xA;      (if (string-prefix-p specialdir name)&#xA;          (setq found t)))&#xA;    (if found&#xA;        nil&#xA;      (normal-backup-enable-predicate name))))&#xA;&#xA;(setq backup-enable-predicate #'my-backup-enable-predicate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This tests if the provided full pathname begins with one of the listed directories (&lt;code&gt;/somedir/&lt;/code&gt; or &lt;code&gt;/some/other/&lt;/code&gt; in this example) and if so returns nil, otherwise calls the usual backup test function.  The final line make emacs use your function. To go back to the real function use&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq backup-enable-predicate #'normal-backup-enable-predicate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I reread your question and realised I hadn't answered it. To allow you to set &lt;code&gt;make-backup-files&lt;/code&gt; in your &lt;code&gt;.dir-locals.el&lt;/code&gt; I think all you need is to make it buffer local in your startup file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(make-variable-buffer-local 'make-backup-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation says &quot;Buffer-local bindings are normally cleared&#xA;while setting up a new major mode, unless they have a 'permanent-local'&#xA;property.&quot;. You can set this property with&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(put 'make-backup-files 'permanent-local 't)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8633" LastEditorUserId="8633" LastEditDate="2016-05-24T07:15:52.487" LastActivityDate="2016-05-24T07:15:52.487" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22253" PostTypeId="2" ParentId="22250" CreationDate="2016-05-13T20:26:40.197" Score="2" Body="&lt;p&gt;Yes you can! It is called pinning. If you use &lt;code&gt;use-package&lt;/code&gt; its as easy as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package sublime-themes&#xA;       :ensure t&#xA;       :pin melpa-stable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;otherwise you can set &lt;code&gt;package-pinned-packages&lt;/code&gt; to &lt;code&gt;((sublime-themes . &quot;melpa-stable&quot;))&lt;/code&gt; more info can be found &lt;a href=&quot;http://www.lonecpluspluscoder.com/2014/11/25/using-elpa-pinned-packages-gnu-emacs-24-4/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-05-13T20:26:40.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22254" PostTypeId="2" ParentId="22006" CreationDate="2016-05-13T21:13:25.473" Score="3" Body="&lt;p&gt;I had very similar problem. I use OSX and both &lt;strong&gt;cargo&lt;/strong&gt; and &lt;strong&gt;rustc&lt;/strong&gt; weren't in exec-path. Because I see you have &lt;code&gt;/Users&lt;/code&gt; path - I assume u run emacs on OSX too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution was &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;exec-path-from-shell&lt;/strong&gt;&lt;/a&gt; plugin. I added to my &lt;code&gt;init.el&lt;/code&gt; something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(req-package exec-path-from-shell&#xA;    :config&#xA;    (if (eq system-type 'darwin)&#xA;        (exec-path-from-shell-initialize)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And remember to run &lt;code&gt;cargo build&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://marc-bowes.com/2013/12/30/hello-rust.html&quot; rel=&quot;nofollow&quot;&gt;This article&lt;/a&gt; was very helpful when I was looking for a solution.&lt;/p&gt;&#xA;" OwnerUserId="12023" LastActivityDate="2016-05-13T21:13:25.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22255" PostTypeId="1" AcceptedAnswerId="22256" CreationDate="2016-05-13T22:03:09.153" Score="0" ViewCount="75" Body="&lt;p&gt;Version: GNU Emacs 25.1.50.2 (GTK+ Version 3.18.9).&#xA;Gnome terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type in terminal emulator: &lt;code&gt;vim foo/bar.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I close the Vim session with &lt;kbd&gt;:wq&lt;/kbd&gt;, I see the content of my Vim screen in the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type in terminal emulator: &lt;code&gt;emacsclient -nw foo/bar.el&lt;/code&gt;. And save it and close Emacsclient, I do not see the content of my previous Emacsclient session in the terminal. An example what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3yN2m.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3yN2m.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As illustrated in this screenshot above, the output from my Vim session is visible in terminal. With the Emacsclient, it's not the case after closing Emacsclient. Makes me to wonder why? It's basically the same output in Terminal with both editors.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-05-14T00:30:46.347" Title="Output of emacsclient not visible in terminal, in contrast to Vim" Tags="|terminal-emacs|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22256" PostTypeId="2" ParentId="22255" CreationDate="2016-05-14T00:30:46.347" Score="0" Body="&lt;p&gt;This question (or rather the answer to it), has nothing to do with emacs or vim specifically, but to how they interact with the terminal. Emacs simply instructs the terminal to be cleared (or initialized, at any rate) as it exits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see similar behavior with other, simpler, programs as well. Try comparing the result of &lt;code&gt;less foo/bar.el&lt;/code&gt; and &lt;code&gt;less -X foo/bar.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-05-14T00:30:46.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22258" PostTypeId="2" ParentId="22226" CreationDate="2016-05-14T03:36:15.193" Score="0" Body="&lt;p&gt;Yet another approach -- Similar to the behavior of the answer that uses library &lt;a href=&quot;https://www.emacswiki.org/emacs/DoReMi&quot; rel=&quot;nofollow&quot;&gt;Do Re Mi&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/doremi.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;doremi.el&lt;/code&gt;&lt;/a&gt;), but using library &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow&quot;&gt;Multi-command&lt;/a&gt; &lt;code&gt;icicle-select-window&lt;/code&gt; lets you move among windows by cycling using the up/down arrow keys, but by default you need to hold &lt;code&gt;Control&lt;/code&gt; pressed while doing that.  (And you need to hit &lt;code&gt;RET&lt;/code&gt; to end the command to choose the last window selected.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is this: &lt;em&gt;You can also select windows by name&lt;/em&gt;, using completion. Each window is given the name of its buffer (windows showing the same buffer are uniquified with a numerical suffix).  And besides completing a name you can cycle among the names (completion candidates) using the arrow keys (without &lt;code&gt;Control&lt;/code&gt;). So: arrow keys to cycle among names; &lt;code&gt;Control&lt;/code&gt; + arrow keys to cycle among them and select the windows at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can bind, say, &lt;code&gt;C-x o&lt;/code&gt; in &lt;code&gt;icicle-mode-map&lt;/code&gt; to command &lt;code&gt;icicle-select-window&lt;/code&gt;, then use &lt;code&gt;C-x o C-&amp;lt;down&amp;gt; C-&amp;lt;down&amp;gt; C-&amp;lt;down&amp;gt;...&lt;/code&gt; to successively select windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I said &quot;by default&quot; for the use of &lt;code&gt;Control&lt;/code&gt; because you can use &lt;code&gt;M-g&lt;/code&gt; in the minibuffer to flip its use, so that instead of needing to use &lt;code&gt;Control&lt;/code&gt; + arrow key to act on a completion candidate you can use just the arrow key, and instead of using just the arrow key to cycle among window names you use &lt;code&gt;Control&lt;/code&gt; + arrow key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, you would use just &lt;code&gt;C-x o &amp;lt;down&amp;gt; &amp;lt;down&amp;gt; &amp;lt;down&amp;gt;...&lt;/code&gt; (the same as for Do Re Mi).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can roll this alternative behavior into its own command this way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-icy-select-window ()&#xA;  &quot;Same as `icicle-select-window' but act without holding `Control'.&quot;&#xA;  (interactive)&#xA;  (let ((orig  icicle-use-C-for-actions-flag))&#xA;    (when orig (icicle-toggle-C-for-actions))   ; Same as `M-g`&#xA;    (icicle-select-window)&#xA;    (when orig (icicle-toggle-C-for-actions)))) ; Same as `M-g`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To bind &lt;code&gt;C-x o&lt;/code&gt; (or any other key) to, say, &lt;code&gt;my-icy-select-window&lt;/code&gt; you customize user option &lt;code&gt;icicle-top-level-key-bindings&lt;/code&gt; to add an entry for it. (Do not try to use &lt;code&gt;define-key&lt;/code&gt; with &lt;code&gt;icicle-mode-map&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-14T03:36:15.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22261" PostTypeId="2" ParentId="22250" CreationDate="2016-05-14T11:46:07.493" Score="3" Body="&lt;p&gt;There is a feature in Emacs 25.1 that does what I want, by allowing you to set priorities for the archives you specify. So you can say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archive-priorities&#xA;      '((&quot;melpa-stable&quot; . 20)&#xA;        (&quot;marmalade&quot; . 20)&#xA;        (&quot;gnu&quot; . 10)&#xA;        (&quot;melpa&quot; . 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will then install packages from the highest-priority archive they are available in. So with the above, &lt;code&gt;melpa&lt;/code&gt; will only be used if a package can't be found in any of the other archives.&lt;/p&gt;&#xA;" OwnerUserId="12019" LastEditorUserId="12019" LastEditDate="2016-05-15T12:45:24.910" LastActivityDate="2016-05-15T12:45:24.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22264" PostTypeId="1" AcceptedAnswerId="22299" CreationDate="2016-05-14T14:50:29.423" Score="2" ViewCount="406" Body="&lt;p&gt;I run Emacs in batch mode to execute some scripting actions. I'd like to get paths of files relative to where Emacs got started in batch mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file-relative-name (buffer-file-name) directory-where-emacs-was-started)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not know how to find out &lt;code&gt;directory-where-emacs-was-started&lt;/code&gt;. &lt;code&gt;default-directory&lt;/code&gt; does not work because it defaults to buffer file directory and &lt;code&gt;(default-value 'default-directory)&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to find out what I'm looking for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: clarification, I need as elisp variable the value that &lt;code&gt;pwd&lt;/code&gt; will print just before running Emacs in shell invocation like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pwd &amp;amp;&amp;amp; emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="105" LastEditDate="2016-06-22T19:46:07.613" LastActivityDate="2016-06-22T19:46:07.613" Title="Current directory of Emacs in batch mode" Tags="|start-up|directories|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22265" PostTypeId="2" ParentId="22264" CreationDate="2016-05-14T15:44:48.763" Score="0" Body="&lt;p&gt;If by &quot;directory-where-emacs-was-started&quot; you mean the directory where Emacs is located, then it is the value of this variable: &lt;strong&gt;&lt;code&gt;invocation-directory&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The directory in which the Emacs executable was found, to run it.&#xA;  The value is nil if that directory's name is not known.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Depending on what you mean, you might also want to look at &lt;code&gt;exec-directory&lt;/code&gt; or even the value of &lt;code&gt;default-directory&lt;/code&gt; immediately after Emacs starts.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-14T15:44:48.763" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22266" PostTypeId="1" AcceptedAnswerId="22267" CreationDate="2016-05-14T16:02:01.427" Score="13" ViewCount="3295" Body="&lt;p&gt;Using Crtl+Backspace or Ctrl+Del adds the deleted text to the kill ring.&lt;br&gt;&#xA;How can I prevent this from happening? I do not need to have every single piece of text sent to the kill ring when it gets deleted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Side question: &#xA;What's the purpose of this default setting anyway? :)&lt;/p&gt;&#xA;" OwnerUserId="12007" LastEditorUserId="20728" LastEditDate="2019-04-03T16:39:08.087" LastActivityDate="2020-12-18T19:11:48.740" Title="Backspace without adding to kill ring" Tags="|kill-ring|deletion|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="22267" PostTypeId="2" ParentId="22266" CreationDate="2016-05-14T16:23:35.093" Score="12" Body="&lt;p&gt;According to the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;&amp;lt;C-delete&amp;gt;&lt;/code&gt; runs the command kill-word (found in global-map), which is&#xA;  an interactive compiled Lisp function in &lt;code&gt;‘simple.el’&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;&amp;lt;C-delete&amp;gt;, M-d&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(kill-word ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Kill characters forward until encountering the end of a word. With&#xA;  argument ARG, do this that many times.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, let's browse the source code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kill-word (arg)                                                                                                     &#xA;  &quot;Kill characters forward until encountering the end of a word.                                                           &#xA;With argument ARG, do this that many times.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (kill-region (point) (progn (forward-word arg) (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, inside the documentation for the &lt;code&gt;kill-region&lt;/code&gt; function we find:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Kill (&quot;cut&quot;) text between point and mark.&lt;br&gt;&#xA;  &lt;code&gt;This deletes the text from the buffer and saves it in the kill ring&lt;/code&gt;.&#xA;  The command [yank] can retrieve it from there. (If you want to save&#xA;  the region without killing it, use [kill-ring-save].)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Lisp programs should use this function for killing text. (To delete&#xA;  text, use &lt;code&gt;delete-region&lt;/code&gt;.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, if you want to go further, this is some function you can use, for deleting without copying to kill-ring:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-delete-word (arg)&#xA;  &quot;Delete characters forward until encountering the end of a word.&#xA;With argument, do this that many times.&#xA;This command does not push text to `kill-ring'.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (delete-region&#xA;   (point)&#xA;   (progn&#xA;     (forward-word arg)&#xA;     (point))))&#xA;&#xA;(defun my-backward-delete-word (arg)&#xA;  &quot;Delete characters backward until encountering the beginning of a word.&#xA;With argument, do this that many times.&#xA;This command does not push text to `kill-ring'.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (my-delete-word (- arg)))&#xA;&#xA;(defun my-delete-line ()&#xA;  &quot;Delete text from current position to end of line char.&#xA;This command does not push text to `kill-ring'.&quot;&#xA;  (interactive)&#xA;  (delete-region&#xA;   (point)&#xA;   (progn (end-of-line 1) (point)))&#xA;  (delete-char 1))&#xA;&#xA;(defun my-delete-line-backward ()&#xA;  &quot;Delete text between the beginning of the line to the cursor position.&#xA;This command does not push text to `kill-ring'.&quot;&#xA;  (interactive)&#xA;  (let (p1 p2)&#xA;    (setq p1 (point))&#xA;    (beginning-of-line 1)&#xA;    (setq p2 (point))&#xA;    (delete-region p1 p2)))&#xA;&#xA;; bind them to emacs's default shortcut keys:&#xA;(global-set-key (kbd &quot;C-S-k&quot;) 'my-delete-line-backward) ; Ctrl+Shift+k&#xA;(global-set-key (kbd &quot;C-k&quot;) 'my-delete-line)&#xA;(global-set-key (kbd &quot;M-d&quot;) 'my-delete-word)&#xA;(global-set-key (kbd &quot;&amp;lt;M-backspace&amp;gt;&quot;) 'my-backward-delete-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_kill-ring.html&quot; rel=&quot;noreferrer&quot;&gt;ErgoEmacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2016-05-14T16:35:01.050" LastActivityDate="2016-05-14T16:35:01.050" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22268" PostTypeId="2" ParentId="22242" CreationDate="2016-05-14T16:46:19.350" Score="3" Body="&lt;p&gt;I have devised a &quot;hacky&quot; solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have rewrite the &lt;code&gt;make-capture-frame&lt;/code&gt; to support an optional argument, and directly call &lt;code&gt;org-protocol-capture&lt;/code&gt; with this argument if it exist.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun make-capture-frame (&amp;amp;optional capture-url)&#xA;  &quot;Create a new frame and run org-capture.&quot;&#xA;  (interactive)&#xA;  (make-frame '((name . &quot;capture&quot;)&#xA;                (width . 120)&#xA;                (height . 15)))&#xA;  (select-frame-by-name &quot;capture&quot;)&#xA;  (setq word-wrap 1)&#xA;  (setq truncate-lines nil)&#xA;  (if capture-url (org-protocol-capture capture-url) (org-capture)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus I can call emacs like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -n -e '(make-capture-frame)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -n -e '(make-capture-frame-test &quot;x/test/test&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;x/test/test&lt;/code&gt; being the org-protocol url without the &lt;code&gt;org-protocol://capture://&lt;/code&gt; part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this is working, it is not as generic as the org-protocol allow. Thus to support any new subprotocol I have to add a specific function.&lt;/p&gt;&#xA;" OwnerUserId="6720" LastActivityDate="2016-05-14T16:46:19.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22269" PostTypeId="2" ParentId="22243" CreationDate="2016-05-14T17:25:46.153" Score="1" Body="&lt;p&gt;&lt;code&gt;cl-seq.el&lt;/code&gt; contains &lt;code&gt;cl-find&lt;/code&gt;. The &lt;code&gt;cl.el&lt;/code&gt; library contains a &lt;code&gt;dolist&lt;/code&gt; with a bunch of names and a &lt;code&gt;defalias&lt;/code&gt; for the list -- one of the entries is &lt;strong&gt;find&lt;/strong&gt;: &lt;code&gt;(dolist (fun '(. . . find-if-not find-if find nsubstitute-if-not . . .)) (let ((new (if (consp fun) (prog1 (cdr fun) (setq fun (car fun))) (intern (format &quot;cl-%s&quot; fun))))) (defalias fun new)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two examples to illustrate whether the &lt;code&gt;eshell&lt;/code&gt; library is working behind the scenes running &lt;code&gt;elisp&lt;/code&gt; code when a user types either &lt;code&gt;find&lt;/code&gt; or &lt;code&gt;which&lt;/code&gt; at the command prompt in an &lt;code&gt;*eshell*&lt;/code&gt; buffer.  To experiment with these examples it is necessary to first ensure the &lt;code&gt;eshell&lt;/code&gt; and &lt;code&gt;cl&lt;/code&gt; libraries are loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (require 'eshell)&#xA;  (require 'cl))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first example tests the &lt;strong&gt;find&lt;/strong&gt; command and the code being evaluated will return &lt;code&gt;nil&lt;/code&gt; because there is no built-in &lt;code&gt;elisp&lt;/code&gt; function that is &lt;em&gt;specially&lt;/em&gt; called &lt;em&gt;by default&lt;/em&gt; when a user types &lt;strong&gt;find&lt;/strong&gt; in an &lt;code&gt;*eshell*&lt;/code&gt; buffer at the command prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eshell-invoke-directly&#xA;  '(eshell-commands&#xA;    (progn&#xA;      (run-hooks (quote eshell-pre-command-hook))&#xA;      (catch&#xA;        (quote top-level)&#xA;          (progn&#xA;            (eshell-trap-errors&#xA;              (eshell-named-command &quot;find&quot;))))&#xA;      (run-hooks (quote eshell-post-command-hook)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second example tests the &lt;strong&gt;which&lt;/strong&gt; command and the code being evaluated will return &lt;code&gt;t&lt;/code&gt; because there &lt;strong&gt;is&lt;/strong&gt; a built-in &lt;code&gt;elisp&lt;/code&gt; function that is &lt;em&gt;specially&lt;/em&gt; called &lt;em&gt;by default&lt;/em&gt; when a user types &lt;strong&gt;which&lt;/strong&gt; in an &lt;code&gt;*eshell*&lt;/code&gt; buffer at the command prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eshell-invoke-directly&#xA;  '(eshell-commands&#xA;    (progn&#xA;      (run-hooks (quote eshell-pre-command-hook))&#xA;      (catch&#xA;        (quote top-level)&#xA;          (progn&#xA;            (eshell-trap-errors&#xA;              (eshell-named-command &quot;which&quot;))))&#xA;      (run-hooks (quote eshell-post-command-hook)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following is a list of some built-in &lt;code&gt;elisp&lt;/code&gt; functions that are called when a user types just the suffix (i.e., the word after the forward-slash of the name of the function) at the command prompt in an &lt;code&gt;*eshell*&lt;/code&gt; buffer -- this list was obtained using &lt;code&gt;describe-function&lt;/code&gt; and the tab completion buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eshell/.&#xA;eshell/addpath&#xA;eshell/agrep&#xA;eshell/alias&#xA;eshell/basename&#xA;eshell/cat&#xA;eshell/cd&#xA;eshell/clear&#xA;eshell/clear-scrollback&#xA;eshell/cp&#xA;eshell/date&#xA;eshell/define&#xA;eshell/diff&#xA;eshell/dirname&#xA;eshell/dirs&#xA;eshell/du&#xA;eshell/echo&#xA;eshell/egrep&#xA;eshell/env&#xA;eshell/eshell-debug&#xA;eshell/exit&#xA;eshell/export&#xA;eshell/fgrep&#xA;eshell/glimpse&#xA;eshell/grep&#xA;eshell/history&#xA;eshell/info&#xA;eshell/jobs&#xA;eshell/kill&#xA;eshell/listify&#xA;eshell/ln&#xA;eshell/locate&#xA;eshell/ls&#xA;eshell/make&#xA;eshell/man&#xA;eshell/mkdir&#xA;eshell/mv&#xA;eshell/occur&#xA;eshell/popd&#xA;eshell/printnl&#xA;eshell/pushd&#xA;eshell/pwd&#xA;eshell/rm&#xA;eshell/rmdir&#xA;eshell/setq&#xA;eshell/source&#xA;eshell/time&#xA;eshell/umask&#xA;eshell/unset&#xA;eshell/wait&#xA;eshell/which&#xA;eshell/whoami&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also the variable &lt;code&gt;eshell-complex-commands&lt;/code&gt;, whose default value is &lt;code&gt;'(&quot;ls&quot;)&lt;/code&gt; -- the doc-string for said variable is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  &quot;A list of commands names or functions, that determine complexity.&#xA;That is, if a command is defined by a function named eshell/NAME,&#xA;and NAME is part of this list, it is invoked as a complex command.&#xA;Complex commands are always correct, but run much slower.  If a&#xA;command works fine without being part of this list, then it doesn't&#xA;need to be.&#xA;&#xA;If an entry is a function, it will be called with the name, and should&#xA;return non-nil if the command is complex.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-05-14T17:36:03.973" LastActivityDate="2016-05-14T17:36:03.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22271" PostTypeId="1" AcceptedAnswerId="22272" CreationDate="2016-05-14T17:42:01.743" Score="3" ViewCount="1682" Body="&lt;p&gt;Emacs 25.1.50, GTK+ version 3.18.9 on GNU/Linux, version 4.4.&#xA;Gnome-terminal as xterm terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using clipboard (as in, I copy some text from my operating system/browser), and paste it in Emacs GUI version, it works fine. The GUI Emacs works in pair with the clipboard manager, which is supported by many X desktop environments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I'm using Emacs with &lt;code&gt;emacs -nw&lt;/code&gt;, the clipboard seems to be inaccesible from the terminal version of Emacs. When reading the Emacs documentation about clipboard, I tried to let the console Emacs communicate with the clipboard with the following settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; x-select-enable-clipboard t&#xA; x-select-enable-primary t&#xA; x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)&#xA; x-stretch-cursor t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Without any luck. Other packages like &lt;code&gt;simpleclip&lt;/code&gt; will not work in terminal Emacs too. So I'm out of ideas. I'm not sure if this is related with the terminal itself of the console-based Emacs.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-05-14T20:41:18.627" Title="Clipboard manager will not work in terminal Emacs" Tags="|clipboard|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22272" PostTypeId="2" ParentId="22271" CreationDate="2016-05-14T18:00:53.963" Score="3" Body="&lt;p&gt;The NEWS for 25.1 says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Killing text now also sets the CLIPBOARD/PRIMARY selection&#xA;in the surrounding GUI (using the OSC-52 escape sequence).  This only works&#xA;if your xterm supports it and enables the 'allowWindowOps' options (disabled&#xA;by default at least in Debian, for security reasons).&#xA;&#xA;Similarly, you can yank the CLIPBOARD/PRIMARY selection (using the OSC-52&#xA;escape sequence) if your xterm has the feature enabled but for that you&#xA;additionally need to add 'getSelection' to 'xterm-extra-capabilities'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you probably need to set &lt;code&gt;allowWindowOps&lt;/code&gt; in your xterm's options (e.g. via xrdb).  For other terminal emulators than &lt;code&gt;xterm&lt;/code&gt; itself, your mileage will vary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to attack the problem is with the &lt;code&gt;xclip&lt;/code&gt; package, available in GNU ELPA, which uses an external program called &lt;code&gt;xclip&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-05-14T20:41:18.627" LastActivityDate="2016-05-14T20:41:18.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22273" PostTypeId="1" AcceptedAnswerId="22410" CreationDate="2016-05-14T19:47:10.540" Score="0" ViewCount="1476" Body="&lt;p&gt;&lt;strong&gt;Version&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 25.1.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Xubuntu 16.04, Linux kernel 4.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; I have the following settings&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(unless (server-running-p)&#xA;(server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call &lt;code&gt;emacsclient -c -a emacs&lt;/code&gt;, it works like a charm. When there is no Emacs instance running in background or in another workspace, Emacs will be called. Otherwise, emacsclient will be called.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I want to have Emacs running in the background. For that, I use the Emacs daemon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When calling &lt;code&gt;emacs --daemon&lt;/code&gt;, I see my &lt;code&gt;dot-emacs&lt;/code&gt; being loaded in the terminal. After that, I call &lt;code&gt;emacsclient -c&lt;/code&gt; or &lt;code&gt;emacsclient&lt;/code&gt;, but it cannot detect the Emacs daemon/server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Googling around, I found this answer: &lt;a href=&quot;http://www.tychoish.com/posts/getting-emacs-daemon-to-work-right/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.tychoish.com/posts/getting-emacs-daemon-to-work-right/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I added it to my commands that it will be called on startup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -u renefroger(my username) --daemon --eval &quot;(setq default-frame-alist \ '((font-backend . \&quot;xft\&quot;) (font . \&quot;[FONT]-[SIZE]\&quot;)))&quot; -l ~/.emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After a restart, I call &lt;code&gt;emacsclient -nw&lt;/code&gt; but it makes it somewhat unusable. I got sometimes the message  &lt;code&gt;Error reading from stdin&lt;/code&gt; when I do sometihing like &lt;kbd&gt;M-x Helm&lt;/kbd&gt;, and the colors are not right, while they're fine the console Emacs with the Emacs server instead of daemon. So I'm puzzled what's going on with the Emacs daemon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I get Emacs daemon working properly?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="15477" LastEditDate="2017-06-17T13:23:09.210" LastActivityDate="2017-06-17T13:23:09.210" Title="Emacs daemon not working properly, Emacs server runs fine" Tags="|daemon|server|emacs-daemon|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22275" PostTypeId="1" AcceptedAnswerId="22281" CreationDate="2016-05-14T22:29:36.740" Score="5" ViewCount="1008" Body="&lt;p&gt;I have a particular buffer that collects statistics from my emacs sessions. I could write the buffer every time I update the statistics, but that's not efficient. I want to auto-write the buffer whenever I quit emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have normal auto-saving turned off. (And besides, auto-saving is not the same as save-automatically-on-exit.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read up on things like &lt;code&gt;kill-emacs-hook&lt;/code&gt; and &lt;code&gt;kill-buffer-hook&lt;/code&gt; and even &lt;code&gt;local-write-files-hook&lt;/code&gt;, but none of them do the job and fire at the right time. In particular, I get the usual &quot;Buffer XX is modified do you want to save it?&quot; prompt &lt;strong&gt;before&lt;/strong&gt; the &lt;code&gt;kill-emacs-hook&lt;/code&gt; is run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would rather catch and save the buffer before those exit prompts run, but I could also attach a local hook to the stats file when I first read it into my session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any recommended way to do this kind of thing (save on an exit event, or get ahead of that prompt, rather than auto-save-on-a-timer)?  Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the kind of thing I'm looking for, but this is for shell process buffers, not for normal buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; don't prompt me when I try to quit a shell buffer&#xA;(add-hook 'comint-exec-hook&#xA;      (lambda ()&#xA;        (set-process-query-on-exit-flag (get-buffer-process (current-buffer)) nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-05-14T22:36:08.980" LastActivityDate="2016-05-15T10:06:10.007" Title="save a particular buffer without prompting on emacs exit?" Tags="|hooks|auto-save|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22276" PostTypeId="1" CreationDate="2016-05-14T22:47:38.410" Score="5" ViewCount="1153" Body="&lt;p&gt;I want to replace all occurrences of a word in the whole buffer. What i do is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-string RET word-to-be-replaced RET new-word&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with this is that it also changes the &lt;code&gt;word-to-be-replaced&lt;/code&gt; even if its only part of another word (for example wanting to change &lt;em&gt;mod&lt;/em&gt; to &lt;strong&gt;off_mod&lt;/strong&gt; results also changing &lt;em&gt;set_mode&lt;/em&gt; to set_&lt;strong&gt;off_mod&lt;/strong&gt;e). How can i change it only in cases it exists exactly as a whole word  and not also as parts of other words?&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastEditorUserId="1982" LastEditDate="2016-05-15T11:57:58.223" LastActivityDate="2016-05-15T11:57:58.223" Title="Replace whole words only" Tags="|emacs24.4|ubuntu|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22277" PostTypeId="2" ParentId="22276" CreationDate="2016-05-14T23:31:37.697" Score="13" Body="&lt;p&gt;If you provide the universal argument to &lt;code&gt;replace-string&lt;/code&gt;, that is by pressing &lt;code&gt;C-u&lt;/code&gt; before &lt;code&gt;M-x replace-string&lt;/code&gt;, it only replaces matches that are surrounded by word boundaries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for example, a buffer containing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mod&#xA;set_mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would be become after &lt;code&gt;C-u&lt;/code&gt; &lt;code&gt;M-x replace-string RET mod RET off_mod&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;off_mod &#xA;set_mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;hr&gt;&#xA;You can find this information by looking in the manual: &lt;code&gt;C-h i&lt;/code&gt; (to get the &lt;code&gt;info&lt;/code&gt; index) &lt;code&gt;m Emacs RET&lt;/code&gt; (to open the Emacs user manual section) and finding &quot;replace-string&quot; through the topic index by doing &lt;code&gt;i replace-string RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could look-up the function's documentation by doing &lt;code&gt;C-h f&lt;/code&gt; &lt;code&gt;replace-string&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11973" LastEditorUserId="11973" LastEditDate="2016-05-15T11:17:02.347" LastActivityDate="2016-05-15T11:17:02.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22278" PostTypeId="1" CreationDate="2016-05-15T01:03:11.393" Score="3" ViewCount="1024" Body="&lt;p&gt;How to move to previous or next buffer in a fixed &amp;amp; arbitrary order? I am using C-&amp;lt;left&amp;gt; and C-&amp;lt;right&amp;gt; but they move in a variable order, depending on the last viewed buffer, but if I want to switch back and forth between the two last files I worked in, with C-x b RET, then C-&amp;lt;left&amp;gt; and C-&amp;lt;right&amp;gt; would be always setting the two last viewed files in the ring, making it pointless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When moving with next/previous, the idea is to have different alternatives: a manually sorted ring, last viewed ring, and other sorts (alphabetical, size, etc.). This by preserving or integrating the option of moving back and forth between the two last viewed the way C-x b RET does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Individually sorting buffers is maybe too much, but is kind of important, since the typical tab system of ordinary editors allow for manually sorting the tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully the sorting work for picking the buffers with ido-mode too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need to install a library or not necessary?&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2016-06-03T08:56:04.920" LastActivityDate="2017-02-26T16:38:07.913" Title="Next/previous buffer in arbitrary order" Tags="|buffers|navigation|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22279" PostTypeId="2" ParentId="22275" CreationDate="2016-05-15T05:05:09.500" Score="1" Body="&lt;p&gt;After thinking about this all day, I finally realized that I can rebind the normal &lt;code&gt;ctrl-x ctrl-c&lt;/code&gt; emacs exit keybinding to my own function, which could save the buffer and then continue with the usual &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt; function that is the default keybinding. (I also wondered why it took me so long to arrive at this simple idea.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not really the answer the I was looking for, but I could see how this one would work ok for my purposes. Maybe adding advice to &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt; could accomplish the same goal. I've never used advice, but it would be doing essentially the same thing that rebinding to my own function wold accomplish.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-05-15T05:05:09.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22281" PostTypeId="2" ParentId="22275" CreationDate="2016-05-15T10:06:10.007" Score="5" Body="&lt;p&gt;When Emacs exits, it saves buffers by calling &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Saving-Buffers.html#index-save_002dsome_002dbuffers&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;save-some-buffers&lt;/code&gt;&lt;/a&gt;. This is the function that does the prompting. You can turn off the prompting in a buffer by setting the buffer-local variable &lt;code&gt;buffer-save-without-query&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will also save the buffer without asking if you press &lt;code&gt;C-x s&lt;/code&gt; or when some other code calls &lt;code&gt;save-some-buffers&lt;/code&gt;, which is probably desirable.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-15T10:06:10.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22282" PostTypeId="1" CreationDate="2016-05-15T12:01:43.687" Score="4" ViewCount="216" Body="&lt;p&gt;I heavily rely on &lt;code&gt;helm-git-grep&lt;/code&gt; to find stuff.&lt;br&gt;&#xA;When there are just too many results though, I'd like to narrow the results down with file name. (possibly with helm-swoop)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I do for the above situation.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I run &lt;code&gt;helm-git-grep&lt;/code&gt; then,&lt;br&gt;&#xA;save it to wgrep buffer using &lt;code&gt;helm-get-grep-run-save-buffer&lt;/code&gt;,&lt;br&gt;&#xA;isearch or helm-swoop on this buffer to narrow down.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;helm-git-grep&lt;/code&gt; and find too many results.&#xA;quit &lt;code&gt;helm-git-grep&lt;/code&gt; and run &lt;code&gt;helm-browse-project&lt;/code&gt; to filter on files first,&lt;br&gt;&#xA;then run &lt;code&gt;helm-ls-git-run-grep&lt;/code&gt; on filtered files to narrow down.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I feel these two options are subpar and wonder if there's a better way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do &lt;code&gt;helm-git-grep&lt;/code&gt; then try to run &lt;code&gt;helm-swoop&lt;/code&gt; I get &lt;code&gt;helm: Error: Trying to run helm within a running helm session&lt;/code&gt; error.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2016-05-15T12:01:43.687" Title="helm-git-grep and helm-swoop at the same time" Tags="|helm|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22283" PostTypeId="1" AcceptedAnswerId="22289" CreationDate="2016-05-15T14:36:03.837" Score="3" ViewCount="787" Body="&lt;p&gt;Is there a way to make dired group directories &lt;em&gt;and symlinks to directories&lt;/em&gt; first? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I add --group-directories, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-listing-switches &quot;--group-directories-first -al&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then it groups directories first, but symlinks still get sorted under files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I also add --dereference, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-listing-switches &quot;--group-directories-first --dereference -al&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then symlinks get resolved, and the directories do all show up together. But there's no indication anymore that they are symlinks anymore. I'd like them to be still displayed as symlinks, but get grouped first too.&lt;/p&gt;&#xA;" OwnerDisplayName="user358" LastActivityDate="2016-05-17T11:40:36.870" Title="Dired: group directories and symlinks to directories first" Tags="|dired|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22284" PostTypeId="1" CreationDate="2016-05-15T15:13:52.663" Score="9" ViewCount="437" Body="&lt;p&gt;Org manual's solution for syntax highlighting of org-babel code blocks is to turn on native fontification with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-fontify-natively t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works well for LaTeX code enclosed in blocks with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC latex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but not for blocks with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LATEX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zI6yv.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zI6yv.png&quot; alt=&quot;See sample image&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make both types of LaTeX source blocks use the same LaTeX syntax highlighting scheme/setting? &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2023-06-16T22:11:15.760" LastActivityDate="2023-06-16T22:11:15.760" Title="Make consistent syntax highlighting of LaTeX source blocks" Tags="|latex|org-babel|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22285" PostTypeId="1" AcceptedAnswerId="22297" CreationDate="2016-05-15T15:43:46.827" Score="2" ViewCount="188" Body="&lt;p&gt;In the spacemacs documentation for &lt;a href=&quot;http://spacemacs.org/doc/LAYERS.html&quot; rel=&quot;nofollow&quot;&gt;writing layers&lt;/a&gt;, it says that &quot;[o]nly one layer may own a package&quot;. This has the consequence, that if you write a layer that requires a package, you have to know whether you can claim ownership of it by writing a &lt;code&gt;&amp;lt;layer&amp;gt;/init-&amp;lt;package&amp;gt;&lt;/code&gt; function, or if you have to use the &lt;code&gt;post-init&lt;/code&gt; function for the package to avoid seizing &quot;ownership of a package that was owned by a previously enabled layer&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a function in spacemacs, that takes a package name and tells you if it is owned by any standard spacemacs layer? I know that you technically only need to know if the package is owned by a previously &lt;strong&gt;enabled&lt;/strong&gt; layer, but such a function would also help prevent writing unnecessary code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case it's of interest, in my particular case, I'm interested in &lt;code&gt;polymode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8401" LastEditorUserId="253" LastEditDate="2016-05-15T16:49:33.150" LastActivityDate="2016-05-16T13:22:54.043" Title="Spacemacs package ownership" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22286" PostTypeId="1" CreationDate="2016-05-15T15:48:56.473" Score="10" ViewCount="4707" Body="&lt;p&gt;I installed a package that changes emacs windows using Shift+arrow, and it works in various modes I use but not in org-mode.  Is there a reason why org-mode shadows this command?&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2019-11-26T07:57:09.597" Title="Shift+arrow to change window does not work in org-mode" Tags="|org-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22287" PostTypeId="1" AcceptedAnswerId="22296" CreationDate="2016-05-15T16:52:32.760" Score="3" ViewCount="555" Body="&lt;p&gt;I'm trying to open the edict2.gz file from &lt;a href=&quot;http://www.edrdg.org/jmdict/edict_doc.html&quot; rel=&quot;nofollow&quot;&gt;http://www.edrdg.org/jmdict/edict_doc.html&lt;/a&gt; which is a japanese-&gt;english dictionary so first I changed the extension to .txt. Currently there are many characters represented as \217\264\321 for example instead of the actually kanji character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next I try M-x revert-buffer-with-coding-system and different coding systems such as utf-8 (doesn't help at all), japanese-shift-jis-2004 (helps but there are still a few characters left as \362 etc, so I think this is out of date, and japanese-iso-8bit works! (is this the right one to use?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I always open this file with the proper coding system so that I don't have to run the M-x revert-buffer-with-coding-system each time? Is there a special file ending (.jp or something) that will automatically invoke that coding system? I plan to parse it later similar to how Josh does it in his presentation here &lt;a href=&quot;https://www.youtube.com/watch?v=uraPXeLfWcM&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=uraPXeLfWcM&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="105" LastEditDate="2016-05-15T18:29:16.517" LastActivityDate="2016-05-16T23:01:31.803" Title="How can I always open a file with a certain coding system?" Tags="|character-encoding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22289" PostTypeId="2" ParentId="22283" CreationDate="2016-05-15T18:21:10.820" Score="0" Body="&lt;p&gt;Yes, that is what you get if you load standard library &lt;strong&gt;&lt;code&gt;ls-lisp.el&lt;/code&gt;&lt;/strong&gt; and you customize option &lt;strong&gt;&lt;code&gt;ls-lisp-dirs-first&lt;/code&gt;&lt;/strong&gt; to non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If the value of option &lt;code&gt;ls-lisp-emulation&lt;/code&gt; is &lt;code&gt;MS-Windows&lt;/code&gt; then &lt;code&gt;ls-lisp-dirs-first&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt; by default.  This is the case if you use Emacs on MS Windows, but you can set it this way on any platform.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you also use library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredSortMenu&quot; rel=&quot;nofollow&quot;&gt;Dired Sort Menu&lt;/a&gt; then you get a &lt;code&gt;S-mouse-2&lt;/code&gt; popup menu in Dired (and a menu-bar menu) that provides all of the &lt;code&gt;ls-lisp.el&lt;/code&gt; sorting possibilities.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-15T18:27:35.827" LastActivityDate="2016-05-15T18:27:35.827" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22290" PostTypeId="2" ParentId="2856" CreationDate="2016-05-15T18:30:04.383" Score="1" Body="&lt;p&gt;There's a couple of utility vars defined in later versions of org-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-file-apps-defaults-gnu&#xA;org-file-apps-default-macosx&#xA;org-file-apps-default-windowsnt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that should set up reasonable defaults for those environments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use them like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-file-apps org-file-apps-defaults-macosx)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12033" LastActivityDate="2016-05-15T18:30:04.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22291" PostTypeId="1" CreationDate="2016-05-15T19:48:31.987" Score="1" ViewCount="487" Body="&lt;p&gt;Basically, I would like GUI emacs to replicate the terminal behavior, where a new frame is opened within the same (OS) window. This would work similar to vim's tabs, which are just a way to move around different window configurations within the same session.&lt;/p&gt;&#xA;" OwnerUserId="12034" LastEditorUserId="105" LastEditDate="2016-05-15T19:51:07.973" LastActivityDate="2016-05-15T21:30:48.377" Title="In non-terminal Emacs, how do I make new frame open within the same OS window?" Tags="|frames|gui-emacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22292" PostTypeId="1" AcceptedAnswerId="22324" CreationDate="2016-05-15T19:55:46.783" Score="7" ViewCount="2121" Body="&lt;p&gt;I have a checklist of daily tasks like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Brush Teeth&#xA;SCHEDULED: &amp;lt;2016-05-15 +1d&amp;gt;&#xA;&#xA;* TODO Exercise&#xA;SCHEDULED: &amp;lt;2016-05-15 +1d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Normally, if I mark an item as done, org-mode increments the date counter, logs the item as done and keeps the items marked as TODO.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Brush Teeth&#xA;DEADLINE: &amp;lt;2016-05-16 Mon +1d&amp;gt;&#xA;:PROPERTIES:&#xA;:LAST_REPEAT: [2016-05-15 Sun 15:37]&#xA;:END:&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2016-05-15 Sun 15:37]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to keep an item marked as DONE until the next day?&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-05-17T14:23:13.370" Title="Org-Mode: Keep a daily, repeated task marked as done until the next day" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22293" PostTypeId="2" ParentId="22291" CreationDate="2016-05-15T21:30:48.377" Score="1" Body="&lt;p&gt;In emacs, a frame is always a separate graphical window (and as you know, in emacs the frame is divided into windows, making the terminology somewhat confusing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you can save window configurations to registers, and restore them later; see the &quot;Configuration Registers&quot; page of the emacs manual (&lt;code&gt;M-: (info &quot;(emacs)Configuration Registers&quot;)&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of emacs packages which give you a tab bar, such as &lt;a href=&quot;https://www.emacswiki.org/emacs/TabBarMode&quot; rel=&quot;nofollow&quot;&gt;TabBarMode&lt;/a&gt;, but I'm not aware of any off-hand where the tab buttons switch window layouts, rather than which buffer is visible. Maybe you can find one, or you could modify one to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is to do this not in emacs, but in your window manager. &lt;a href=&quot;http://i3wm.org/&quot; rel=&quot;nofollow&quot;&gt;i3&lt;/a&gt;, for instance, can stack windows into a &lt;a href=&quot;http://i3wm.org/docs/userguide.html#_changing_the_container_layout&quot; rel=&quot;nofollow&quot;&gt;tabbed container&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-05-15T21:30:48.377" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22295" PostTypeId="2" ParentId="7952" CreationDate="2016-05-16T02:37:38.953" Score="2" Body="&lt;p&gt;Setting &lt;code&gt;comint-input-ring-separator&lt;/code&gt; so that the whole timestamp is treated as part of the command separator worked for me. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;; Remember lots of previous commands in shell-mode&#xA;(setq comint-input-ring-size 100000)&#xA;(add-hook 'shell-mode-hook 'my-shell-mode-hook)&#xA;(defun my-shell-mode-hook ()&#xA;  (setq comint-input-ring-file-name &quot;~/.zsh_history&quot;)&#xA;  ; Ignore timestamps in history file.  Assumes that zsh&#xA;  ; EXTENDED_HISTORY option is in use.&#xA;  (setq comint-input-ring-separator &quot;\n: \\([0-9]+\\):\\([0-9]+\\);&quot;)&#xA;  (comint-read-input-ring t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12037" LastEditorUserId="675" LastEditDate="2016-05-16T15:46:37.470" LastActivityDate="2016-05-16T15:46:37.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22296" PostTypeId="2" ParentId="22287" CreationDate="2016-05-16T02:47:06.043" Score="5" Body="&lt;p&gt;If you can edit the file, you can specify the pseudo-variable &lt;code&gt;coding&lt;/code&gt; as a &lt;a href=&quot;https://www.emacswiki.org/emacs/FileLocalVariables&quot; rel=&quot;nofollow&quot;&gt;file-local variable&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.: &lt;code&gt;-*- coding: japanese-iso-8bit; -*-&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can't (or don't want to) edit the file, but this is only needed for yourself, then the &quot;Using Directory Local Variable classes for individual files&quot; trick described on that same page would be an option; but using &lt;code&gt;file-coding-system-alist&lt;/code&gt; is probably a better one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(push (cons (regexp-quote (expand-file-name &quot;/path/to/file&quot;))&#xA;            'japanese-iso-8bit)&#xA;      file-coding-system-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;file-coding-system-alist&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-05-16T23:01:31.803" LastActivityDate="2016-05-16T23:01:31.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22297" PostTypeId="2" ParentId="22285" CreationDate="2016-05-16T03:07:27.770" Score="2" Body="&lt;p&gt;There is no such function available. You can get this information in two ways.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Programmatically&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can retrieve the current owner of a package with this function (it requires &lt;code&gt;helm&lt;/code&gt; layer to be used, it can be easily transposed to &lt;code&gt;ivy&lt;/code&gt; layer for ivy users).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-package-owner (pkg-symbol)&#xA;  &quot;Return the layer owner of the package with name PKG-SYMBOL.&#xA;Assumes that the `helm' layer is used (develop branch or version 0.200+ of Spacemacs)&quot;&#xA;  (require 'helm-spacemacs-help)&#xA;  (helm-spacemacs-help//init)&#xA;  (let ((pkg (object-assoc pkg-symbol :name helm-spacemacs-help-all-packages)))&#xA;    (when pkg (oref pkg :owner))))&#xA;&#xA;(get-package-owner 'flycheck) ; =&amp;gt; syntax-checking&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Manually&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;To get this information non programmatically there is Spacemacs help available on &lt;code&gt;SPC h SPC&lt;/code&gt; or more specifically here &lt;code&gt;SPC h p&lt;/code&gt; for just the packages source (it requires either the &lt;code&gt;helm&lt;/code&gt; or &lt;code&gt;ivy&lt;/code&gt; layer to be used).&lt;/p&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2016-05-16T13:22:54.043" LastActivityDate="2016-05-16T13:22:54.043" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22298" PostTypeId="1" CreationDate="2016-05-16T07:28:18.007" Score="3" ViewCount="110" Body="&lt;p&gt;In a log buffer with multiple branches (using the &lt;kbd&gt;lL&lt;/kbd&gt; command, with any &lt;kbd&gt;=o&lt;/kbd&gt; option), a commit and its immediate parent or child may be shown far apart on the view and is difficult to trace back and forth among the commits in a branch. (All the current traverse keys will step onto every log line in the view).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to confine my traverse to a selected branch or creating short-cut keys (such as &lt;kbd&gt;M-p&lt;/kbd&gt;, &lt;kbd&gt;M-n&lt;/kbd&gt;) to jump to immediate parent/child?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the &lt;kbd&gt;-D&lt;/kbd&gt; and &lt;kbd&gt;-f&lt;/kbd&gt; options but I often found that I need very detail history to correctly doing the merge or rebase operation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="12039" LastEditorUserId="306" LastEditDate="2016-08-31T10:51:11.313" LastActivityDate="2016-08-31T10:51:11.313" Title="In Magit log buffer, is there key bindings for traversing in a branch?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22299" PostTypeId="2" ParentId="22264" CreationDate="2016-05-16T11:48:21.300" Score="5" Body="&lt;p&gt;You can use &lt;code&gt;command-line-default-directory&lt;/code&gt;, it is intended when using Emacs in batch mode, or when processing command line options:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Default directory to use for command line arguments.&#xA;  This is normally copied from `default-directory' when Emacs starts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It retains its value throughout the session.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-05-16T11:48:21.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22300" PostTypeId="1" AcceptedAnswerId="22302" CreationDate="2016-05-16T15:06:41.893" Score="0" ViewCount="135" Body="&lt;p&gt;I would like org-capture template to capture time at creation so I can use this recorded time later for routine cleaning of old tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I use this template with the &lt;code&gt;%t&lt;/code&gt; expansion.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;  '((&quot;p&quot; &quot;PRIVAT-TODO&quot; entry (file+headline &quot;/home/max/org/organizer.org&quot; &quot;Private&quot;)&#xA;     &quot;* TODO %? %^g\n %t&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But org uses timestamp to schedule and not for recording capture time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the proper way to record when an item was captured?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I then us the time to sort in todo list views.&lt;/p&gt;&#xA;" OwnerUserId="536" LastEditorUserId="7045" LastEditDate="2016-05-16T20:15:25.057" LastActivityDate="2016-05-16T20:15:25.057" Title="What is the proper way to record when an item is captured?" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22301" PostTypeId="1" CreationDate="2016-05-16T16:35:16.317" Score="0" ViewCount="170" Body="&lt;p&gt;i just installed &lt;strong&gt;Emacs 24.4&lt;/strong&gt; and i get this weird default theme with big fonts &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IOd6q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IOd6q.png&quot; alt=&quot;image one&quot;&gt;&lt;/a&gt;&#xA;When I install spacemacs theme, I get this&#xA;&lt;a href=&quot;https://i.stack.imgur.com/YGCnX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YGCnX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12042" LastEditorUserId="7045" LastEditDate="2016-05-16T21:31:51.330" LastActivityDate="2016-05-16T21:31:51.330" Title="Why does Emacs display with big fonts?" Tags="|spacemacs|fonts|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22302" PostTypeId="2" ParentId="22300" CreationDate="2016-05-16T16:38:10.337" Score="3" Body="&lt;p&gt;You can refer to the documentation for &lt;code&gt;org-capture-templates&lt;/code&gt; (try &lt;code&gt;C-h v org-capture-templates&lt;/code&gt;) for all the supported %-escapes. The relevant bit for your question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  %t          Time stamp, date only.&#xA;  %T          Time stamp with date and time.&#xA;  %u, %U      Like the above, but inactive time stamps.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You want to use &lt;code&gt;%u&lt;/code&gt; rather than &lt;code&gt;%t&lt;/code&gt; if you want the time stamp to be inactive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://orgmode.org/manual/Timestamps.html#Timestamps&quot; rel=&quot;nofollow&quot;&gt;Org manual&lt;/a&gt; for more detail on the the different kinds of time stamps. A plain time stamp (&lt;code&gt;%t&lt;/code&gt;) affects how Org displays the entry in agenda views, while an inactive time stamp (&lt;code&gt;%u&lt;/code&gt;) does not.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-05-16T16:45:50.920" LastActivityDate="2016-05-16T16:45:50.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22303" PostTypeId="1" CreationDate="2016-05-16T17:25:54.553" Score="1" ViewCount="784" Body="&lt;p&gt;I recently upgraded to (K)ubuntu 16.04 which includes Emacs 24.5.1. Since the upgrade, Emacs stalls for more than three minutes when opening any Python file. The problem occurs when opening a new Python file as well as on existing files. I tried eg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs --no-init-file example.py&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the file can be a literal hello world program, non existing or any small Python script. The problem also occurs when opening a Python file after editing other files or when using dired to open the file. I left no extensions installed on that system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CPU load and memory footprint are normal while Emacs stalls (below 1% on my system). Ctrl+G allows circumventing the problem. Once the first Python file has loaded, all other Python files load normally w/out delay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried removing all configuration files&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rm -r .emacs*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that did not help either (note that I could not reproduce the problem on other (K)Ubuntu systems). The only message I get from Emacs is likely not related: &quot;Warning: no abbrev-file found, customize `abbrev-file-name' in order to make mode-specific abbrevs work.&quot;. How can I get Emacs to be usable for editing Python files again?  Any hints are welcome. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="10616" LastEditorUserId="10616" LastEditDate="2016-05-16T17:31:32.407" LastActivityDate="2016-05-16T20:24:47.950" Title="Emacs stalls when opening Python files" Tags="|python|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22304" PostTypeId="1" CreationDate="2016-05-16T18:01:26.450" Score="4" ViewCount="1537" Body="&lt;p&gt;I'm using an Intel Edison, and I want to edit files on there with Emacs.  I can connect to the device with tramp, using several methods and explore using dired.  But trying to visit a file gives an error &quot;Invalid base64 data&quot;.&lt;/p&gt;&#xA;" OwnerUserId="651" LastEditorUserId="651" LastEditDate="2016-12-13T22:12:03.773" LastActivityDate="2016-12-13T22:12:03.773" Title="&quot;Invalid base64 data&quot; error when using tramp" Tags="|tramp|ssh|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22305" PostTypeId="2" ParentId="22304" CreationDate="2016-05-16T18:01:26.450" Score="4" Body="&lt;p&gt;The Edison didn't have some of the utilities tramp needs (base64, uuencode).  Apparently tramp sends a perl script if it can't find them, but it did not work.  It turns out that even when using methods like &lt;code&gt;scp&lt;/code&gt;, tramp tries to do inline transfers when the file is below a size threshold, &lt;code&gt;tramp-copy-size-limit&lt;/code&gt;.  I can do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tramp-copy-size-limit nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to force &quot;external copy&quot; (i.e. using &lt;code&gt;scp&lt;/code&gt;) always.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;New problem: multi-hops don't allow &lt;code&gt;scp&lt;/code&gt;.  E.g. &lt;code&gt;/ssh:proxy|scp:user@remote:file&lt;/code&gt; is invalid, which in turn means that external copy is not used for multi-hops.  I guess I'll have to set up an ssh proxy for that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host dev # the edison, on another network&#xA;User root # on dev&#xA;HostName 10.251.1.112 # LAN IP of dev&#xA;# nc must be installed on proxy&#xA;ProxyCommand ssh -Aq jpkotta@proxy &quot;nc -q 1 %h %p&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;/scp:dev:file&lt;/code&gt; or &lt;code&gt;/ssh:dev:file&lt;/code&gt; with &lt;code&gt;tramp-copy-size-limit&lt;/code&gt; set to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="651" LastEditorUserId="651" LastEditDate="2016-12-13T22:10:22.100" LastActivityDate="2016-12-13T22:10:22.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22306" PostTypeId="1" CreationDate="2016-05-16T18:21:53.227" Score="8" ViewCount="3109" Body="&lt;p&gt;After some pause (a few seconds) of idle I start typing and emacs does some network activities and because of my slow connection this looks like everything is slow and hanging all the time. I disabled all extra modes but this still happens, any idea what is going on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what i get in tramp debug buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;21:57:55.654206 tramp-do-file-attributes-with-stat (5) # file attributes with stat: /home/u/f.htm&#xA;21:57:55.654709 tramp-send-command (6) # echo are you awake&#xA;21:57:57.373233 tramp-wait-for-regexp (6) # &#xA;are you awake&#xA;///966dcbf73a99f3becae06a545679cb59#$&#xA;21:57:57.373649 tramp-send-command (6) # ( (test -e /home/u/f.htm || test -h /home/u/f.htm) &amp;amp;&amp;amp; (\stat -c '((/////%N/////) %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 /////%A///// t %ie0 -1)' /home/u/f.htm | sed -e 's/&quot;/\\&quot;/g' -e 's/\/\/\/\/\//&quot;/g') || echo nil) 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2686" LastEditorUserId="421" LastEditDate="2016-06-17T21:12:58.873" LastActivityDate="2016-07-18T04:43:25.063" Title="Working with tramp mode on slow connection, emacs does network trip when I start typing" Tags="|tramp|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22307" PostTypeId="2" ParentId="22306" CreationDate="2016-05-16T18:48:13.433" Score="5" Body="&lt;p&gt;When you start to type, Emacs starts to think about auto-saving. This could (or could not) include some checks on the remote side. Change the auto-save file location to your local directories, see the Tramp manual for recipes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to see in more detail what happens on the remote side, apply &lt;code&gt;(setq tramp-verbose 6)&lt;/code&gt;. There will be a Tramp debug buffer. Follow the lines which include the string &lt;code&gt;(6)&lt;/code&gt;, they show you the commands Tramp sends to the remote, and the command's output.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-05-16T18:48:13.433" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22308" PostTypeId="2" ParentId="22301" CreationDate="2016-05-16T18:48:47.530" Score="1" Body="&lt;p&gt;it looks like it's the X server  which renders the fonts. After further digging,&#xA;the solution is right  &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1896584&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&#xA;create a file &#xA; ~/.Xdefaults with the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs*font: 7x14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then running&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xrdb -merge ~/.Xdefaults&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12042" LastActivityDate="2016-05-16T18:48:47.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22309" PostTypeId="2" ParentId="22303" CreationDate="2016-05-16T20:24:47.950" Score="1" Body="&lt;p&gt;To resolve this issue, I first ruled out the configuration and local elpa packages. After making sure that the same issue does not reproduce on other installations w/ the same emacs version, the remaining cause could only be buried in the system configuration. After re-installing all emacs related packages and removing all emacs related python extensions from the system (there were yasnippets, emacs-goodies-el, pylint etc.), the problem was resolved. Unfortunately, I don't know which of the packages caused the problem.&lt;/p&gt;&#xA;" OwnerUserId="10616" LastActivityDate="2016-05-16T20:24:47.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22310" PostTypeId="2" ParentId="21257" CreationDate="2016-05-16T21:22:23.493" Score="1" Body="&lt;pre&gt;&lt;code&gt;* my.org&#xA;&#xA;#+TITLE:TEST&#xA;#+AUTHOR:Benyomin&#xA;#+STARTUP: inlineimages&#xA;&#xA;** This MWE graphs with a variable from an earlier code-block&#xA;#+begin_src R :results output :session&#xA;nums &amp;lt;- (seq(1,10))&#xA;nums&#xA;#+end_src&#xA;&#xA;#+BEGIN_SRC R :file example.png :results graphics&#xA;plot(nums)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what happens after you hit C-c C-c both code blocks to execute the R code.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/7zVcg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7zVcg.png&quot; alt=&quot;MWE after code execution&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="10898" LastEditDate="2016-05-17T04:54:55.070" LastActivityDate="2016-05-17T04:54:55.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22311" PostTypeId="2" ParentId="14952" CreationDate="2016-05-17T00:23:39.200" Score="7" Body="&lt;p&gt;Emacs setup:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq ispell-program-name &amp;quot;c:/what-ever-path/hunspell&amp;quot;)&#xA;&#xA;;; &amp;quot;en_US&amp;quot; is key to lookup in `ispell-local-dictionary-alist'.&#xA;;; Please note it will be passed as default value to hunspell CLI `-d` option&#xA;;; if you don't manually setup `-d` in `ispell-local-dictionary-alist`&#xA;(setq ispell-local-dictionary &amp;quot;en_US&amp;quot;) &#xA;&#xA;(setq ispell-local-dictionary-alist&#xA;      '((&amp;quot;en_US&amp;quot; &amp;quot;[[:alpha:]]&amp;quot; &amp;quot;[^[:alpha:]]&amp;quot; &amp;quot;[']&amp;quot; nil (&amp;quot;-d&amp;quot; &amp;quot;en_US&amp;quot;) nil utf-8)))&#xA;&#xA;;; new variable `ispell-hunspell-dictionary-alist' is defined in Emacs&#xA;;; If it's nil, Emacs tries to automatically set up the dictionaries.&#xA;(when (boundp 'ispell-hunspell-dictionary-alist)&#xA;  (setq ispell-hunspell-dictionary-alist ispell-local-dictionary-alist))&#xA;&#xA;;; With Emacs 28.2 may also need to set hunspell-default-dict&#xA;(setq hunspell-default-dict &amp;quot;en_US&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Hunspell dictionary setup:&lt;/p&gt;&#xA;&lt;p&gt;Run &lt;code&gt;hunspell -D&lt;/code&gt; in dos window which will list the directories hunspell searching for dictionaries. Copy your dictionaries to that directory. This is the minimum setup you need.&lt;/p&gt;&#xA;&lt;p&gt;See &lt;a href=&quot;http://blog.binchen.org/posts/what-s-the-best-spell-check-set-up-in-emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blog.binchen.org/posts/what-s-the-best-spell-check-set-up-in-emacs.html&lt;/a&gt; for more technical details.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="17463" LastEditDate="2023-07-28T00:28:53.707" LastActivityDate="2023-07-28T00:28:53.707" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="22313" PostTypeId="1" CreationDate="2016-05-17T07:33:24.833" Score="3" ViewCount="142" Body="&lt;p&gt;&lt;code&gt;diff-mode&lt;/code&gt; shows differences by lines. I'm looking for a mode that could show a diff knowing that the diffed files are elisp sources, so they are full of sexps and therefore more specialized diff highlight could be used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a mode to show a diff between two sexps or better between two files that are elisp sources?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of what I have in mind, instead of the usual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- (unless foo bar baz)&#xA;+ (when (foo bar) baz)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;structural diff:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+when+-unless- +(+foo bar+)+ baz)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5213" LastEditorUserId="5213" LastEditDate="2016-05-17T09:53:49.240" LastActivityDate="2016-05-17T20:46:07.367" Title="Sexp-diff like mode for elisp source diffing" Tags="|diff-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22314" PostTypeId="1" AcceptedAnswerId="22320" CreationDate="2016-05-17T09:54:47.530" Score="2" ViewCount="122" Body="&lt;p&gt;Is it possible to reference a local variable inside the definition of a function? Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an alist &lt;code&gt;text-alist&lt;/code&gt; consisting of keys and text snippets. I want each text snippet bound to a key in the prefix map &lt;code&gt;my-text-prefix-map&lt;/code&gt;. The code below doesn't work, I guess because when the functions in &lt;code&gt;my-text-prefix-map&lt;/code&gt; are run, the value of &lt;code&gt;text&lt;/code&gt; is unknown. Is there any way to remedy this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc (lambda (text)&#xA;        (define-key my-text-prefix-map (kbd (car text))&#xA;          (lambda ()&#xA;            (interactive)&#xA;            (insert (cdr text)))))&#xA;      text-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="105" LastEditDate="2016-06-22T19:45:31.907" LastActivityDate="2016-06-22T19:45:31.907" Title="How to reference a local variable inside the definition of a function?" Tags="|local-variables|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22315" PostTypeId="2" ParentId="14952" CreationDate="2016-05-17T09:58:16.710" Score="1" Body="&lt;p&gt;Assuming you're using a recent version of Emacs (24.4 or above, as I recall) then all you need to do is make sure you're using the correct dictionary name, and Emacs will do the rest automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem is that Windows uses a different language description format, for example British English is called &lt;strong&gt;ENG&lt;/strong&gt;, and US English is &lt;strong&gt;ENU&lt;/strong&gt;. This means your dictionary files should be called &lt;em&gt;ENU.dic&lt;/em&gt; and &lt;em&gt;ENU.aff&lt;/em&gt; for US English, and &lt;em&gt;ENG.dic&lt;/em&gt; and &lt;em&gt;ENG.aff&lt;/em&gt; for British English.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may also be necessary to have a &quot;default&quot; dictionary or hunspell may not be too happy. You can also set the &lt;em&gt;DICTIONARY&lt;/em&gt; environment variable to force a default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I can't work out what your Norwegian dictionary should be called. If you're using the Norwegian locale in Windows, you should be able to check within Emacs by evaluating:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(getenv &quot;LANG&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will show you the setting that Emacs is using.&lt;/p&gt;&#xA;" OwnerUserId="7069" LastActivityDate="2016-05-17T09:58:16.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22316" PostTypeId="2" ParentId="18484" CreationDate="2016-05-17T10:03:40.627" Score="0" Body="&lt;p&gt;my humble guess is your &lt;code&gt;2.2.3&lt;/code&gt; is your ruby version. you can remove it by removing the following variable in your &lt;code&gt;.spacemacs&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs-configuration-layers ()&#xA;   '((ruby :variables ruby-version-manager 'rvm)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9211" LastActivityDate="2016-05-17T10:03:40.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22317" PostTypeId="1" AcceptedAnswerId="22322" CreationDate="2016-05-17T11:05:15.537" Score="3" ViewCount="2752" Body="&lt;p&gt;I use an org file for storing bookmarks. In each org-headline I have a short description of and a link to the file or location I want to open, like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* ...&#xA;* my notes [[file:c:/users/myname/Dropbox/notes]]&#xA;* my projects [[file:c:/users/myname/Dropbox/projects]]&#xA;* ...&#xA;* ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When scrolling up and down this list (C-n and C-p, respectively) I like to locate point to the far left of the window. This is visually clearest for me. However, when I want to open the link in a particular headline, I then have to move the point to the right (C-f or M-f) until point overlaps with the link, and then press C-c C-o to open the link at point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This opening process is unpractical. Therefor, I would like an interactive function that let me jump from the leftside of a headline (or from anywhere inside the headline), into the link, and opening it. How would such a function look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any suggestions and help!&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2016-05-21T16:34:24.713" Title="How to quickly open links in org-mode headlines" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22318" PostTypeId="1" AcceptedAnswerId="22321" CreationDate="2016-05-17T11:16:56.697" Score="13" ViewCount="2948" Body="&lt;p&gt;Org-table has a very convenient property, it expands the width of a table column if needed to show all your text in a cell. Alternatively, you can set a fixed width for a table column and let your text be truncated (the not-shown text representet as ...). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, sometimes it would have been practical to apply a fixed width on a table column, and instead of showing the text truncated, showing it as multiple lines automatically wrapped inside the table cell (thererby expanding the number of lines in the row of the table where your table cell is located).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is autmoatic line wrapping possible within an org table?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2023-09-30T19:20:43.797" Title="Org-table: is it possible to have automatic line wrapping inside org-tables?" Tags="|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22319" PostTypeId="2" ParentId="22283" CreationDate="2016-05-17T11:33:21.037" Score="0" Body="&lt;p&gt;The &lt;code&gt;ls-lisp&lt;/code&gt; solution is portable and straightforward, but unfortunately lacks some important (to me) flags and is considerably slower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead, one can also modify &lt;code&gt;ls&lt;/code&gt; directly. Because I wanted the same feature in &lt;code&gt;ls&lt;/code&gt; in the terminal anyway, &lt;a href=&quot;https://github.com/muflax/coreutils/tree/ls-dirs&quot; rel=&quot;nofollow&quot;&gt;I wrote a patch for the &lt;code&gt;ls&lt;/code&gt; in GNU's coreutils&lt;/a&gt;. That's certainly a lot less portable, but it was a much smaller and more desirable change than extending &lt;code&gt;ls-lisp&lt;/code&gt; with the missing flags. (Still, &lt;code&gt;ls-lisp&lt;/code&gt; can be used as a fallback as well.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This patch for coreutils (8.25) sorts symlinked directories like directories when &lt;code&gt;--group-directories-first&lt;/code&gt; is provided:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff --git a/src/ls.c b/src/ls.c&#xA;index 3572060..8dd6395 100644&#xA;--- a/src/ls.c&#xA;+++ b/src/ls.c&#xA;@@ -2969,10 +2969,10 @@ gobble_file (char const *name, enum filetype type, ino_t inode,&#xA;               || is_colored (C_STICKY_OTHER_WRITABLE)))&#xA;       /* When dereferencing symlinks, the inode and type must come from&#xA;          stat, but readdir provides the inode and type of lstat.  */&#xA;-      || ((print_inode || format_needs_type)&#xA;+      || ((print_inode || format_needs_type || directories_first)&#xA;           &amp;amp;&amp;amp; (type == symbolic_link || type == unknown)&#xA;           &amp;amp;&amp;amp; (dereference == DEREF_ALWAYS&#xA;-              || color_symlink_as_referent || check_symlink_color))&#xA;+              || color_symlink_as_referent || check_symlink_color || directories_first))&#xA;       /* Command line dereferences are already taken care of by the above&#xA;          assertion that the inode number is not yet known.  */&#xA;       || (print_inode &amp;amp;&amp;amp; inode == NOT_AN_INODE_NUMBER)&#xA;@@ -3113,7 +3113,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,&#xA;         }&#xA;&#xA;       if (S_ISLNK (f-&amp;gt;stat.st_mode)&#xA;-          &amp;amp;&amp;amp; (format == long_format || check_symlink_color))&#xA;+          &amp;amp;&amp;amp; (format == long_format || check_symlink_color || directories_first))&#xA;         {&#xA;           struct stat linkstats;&#xA;&#xA;@@ -3123,7 +3123,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,&#xA;           /* Avoid following symbolic links when possible, ie, when&#xA;              they won't be traced and when no indicator is needed.  */&#xA;           if (linkname&#xA;-              &amp;amp;&amp;amp; (file_type &amp;lt;= indicator_style || check_symlink_color)&#xA;+              &amp;amp;&amp;amp; (file_type &amp;lt;= indicator_style || check_symlink_color || directories_first)&#xA;               &amp;amp;&amp;amp; stat (linkname, &amp;amp;linkstats) == 0)&#xA;             {&#xA;               f-&amp;gt;linkok = true;&#xA;@@ -3131,7 +3131,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,&#xA;               /* Symbolic links to directories that are mentioned on the&#xA;                  command line are automatically traced if not being&#xA;                  listed as files.  */&#xA;-              if (!command_line_arg || format == long_format&#xA;+              if (!command_line_arg || format == long_format || directories_first&#xA;                   || !S_ISDIR (linkstats.st_mode))&#xA;                 {&#xA;                   /* Get the linked-to file's mode for the filetype indicator&#xA;@@ -3251,6 +3251,15 @@ is_directory (const struct fileinfo *f)&#xA;   return f-&amp;gt;filetype == directory || f-&amp;gt;filetype == arg_directory;&#xA; }&#xA;&#xA;+/* Return true if F refers to a directory or a symlink pointing at a directory.  */&#xA;+static bool&#xA;+is_directory_or_symlink_to_directory (const struct fileinfo *f)&#xA;+{&#xA;+  return f-&amp;gt;filetype == directory&#xA;+    || f-&amp;gt;filetype == arg_directory&#xA;+    || (f-&amp;gt;filetype == symbolic_link &amp;amp;&amp;amp; S_ISDIR(f-&amp;gt;linkmode));&#xA;+}&#xA;+&#xA; /* Put the name of the file that FILENAME is a symbolic link to&#xA;    into the LINKNAME field of 'f'.  COMMAND_LINE_ARG indicates whether&#xA;    FILENAME is a command-line argument.  */&#xA;@@ -3396,8 +3405,8 @@ typedef int (*qsortFunc)(V a, V b);&#xA; #define DIRFIRST_CHECK(a, b)                       \&#xA;   do                                   \&#xA;     {                                  \&#xA;-      bool a_is_dir = is_directory ((struct fileinfo const *) a);  \&#xA;-      bool b_is_dir = is_directory ((struct fileinfo const *) b);  \&#xA;+      bool a_is_dir = is_directory_or_symlink_to_directory ((struct fileinfo const *) a); \&#xA;+      bool b_is_dir = is_directory_or_symlink_to_directory ((struct fileinfo const *) b);  \&#xA;       if (a_is_dir &amp;amp;&amp;amp; !b_is_dir)                   \&#xA;         return -1;         /* a goes before b */           \&#xA;       if (!a_is_dir &amp;amp;&amp;amp; b_is_dir)                   \&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user358" LastEditorDisplayName="user358" LastEditDate="2016-05-17T11:40:36.870" LastActivityDate="2016-05-17T11:40:36.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22320" PostTypeId="2" ParentId="22314" CreationDate="2016-05-17T12:37:35.790" Score="7" Body="&lt;p&gt;You can use backquotes and commas to build functions dynamically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(lambda ()&#xA;   (interactive)&#xA;   (insert ,(cdr text)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you can also enable lexical-binding to make function closures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information on Backquotes can be found in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot; rel=&quot;nofollow&quot;&gt;Emacs manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12049" LastEditorUserId="5161" LastEditDate="2016-05-26T17:23:43.460" LastActivityDate="2016-05-26T17:23:43.460" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22321" PostTypeId="2" ParentId="22318" CreationDate="2016-05-17T13:15:10.137" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is autmoatic line wrapping possible within an org table?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. The limitation apparently comes from the &lt;code&gt;field&lt;/code&gt; in a column has to be on a single line. I don't know if such limitations can be removed. However, there are two other related techniques for wrapping in cells that you may have already seen in the manual: &lt;code&gt;narrow columns&lt;/code&gt; and &lt;code&gt;C-c C-q&lt;/code&gt; to &lt;code&gt;wrap several fields in a column&lt;/code&gt;. Both have their uses.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-05-17T13:15:10.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22322" PostTypeId="2" ParentId="22317" CreationDate="2016-05-17T13:31:28.370" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How would such a function look like?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One approach would be to add a hook to org-mode-map to remap the familiar C-n or C-p (or any other pair you want) to go to the next link, if any. Here's a suggestion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-load-hook&#xA;     (lambda ()&#xA;          (define-key org-mode-map &quot;\C-n&quot; 'org-next-link)&#xA;          (define-key org-mode-map &quot;\C-p&quot; 'org-previous-link)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then once you are on that link, open as usual or write a function that calls org-next-link first, followed by org-open-at-point. You can of course combine the two functionalities into one function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you'd rather not go through org-mode-map, then consider the built-in: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u C-c C-o&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on an headline anywhere will offer links under that headline as choices to select from. Look in the manual if you want to further customize this list.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The last approach is not general enough...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your definition of general conflates the heading line with the heading. They are not the same. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;it only works on folder links, not on file links.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Wrong. It works on all org link types: &lt;a href=&quot;http://orgmode.org/manual/Internal-links.html#Internal-links&quot; rel=&quot;nofollow&quot;&gt;internal&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/manual/External-links.html#External-links&quot; rel=&quot;nofollow&quot;&gt;external&lt;/a&gt;, or any future link types you might define. Check your installation or the &lt;a href=&quot;http://orgmode.org/manual/Handling-links.html#Handling-links&quot; rel=&quot;nofollow&quot;&gt;key bindings&lt;/a&gt; to make sure you are not using something non-standard.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Where should your &quot;add-hook&quot; code be placed in my init file?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Before loading org-mode. This is true for all hooks, not just this one. You always &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html&quot; rel=&quot;nofollow&quot;&gt;load the hook&lt;/a&gt; before you need the hood to run.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-05-21T16:34:24.713" LastActivityDate="2016-05-21T16:34:24.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22323" PostTypeId="2" ParentId="20942" CreationDate="2016-05-17T13:37:17.750" Score="0" Body="&lt;p&gt;I've been having the same issue, but all I can do is explain the &quot;strange decisions&quot;: you're getting the alternatives in alphabetical order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only &quot;better way&quot; I've found is that once I know the things are in alphabetical order, I can use &lt;code&gt;C-;&lt;/code&gt; to blitz through the alternatives really quickly, and if I go past the one I want, I use &lt;code&gt;C-/&lt;/code&gt; to undo.&lt;/p&gt;&#xA;" OwnerUserId="9343" LastActivityDate="2016-05-17T13:37:17.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22324" PostTypeId="2" ParentId="22292" CreationDate="2016-05-17T14:23:13.370" Score="7" Body="&lt;p&gt;Try enabling the &lt;code&gt;org-habit&lt;/code&gt; module, and then set the &lt;code&gt;SCHEDULED&lt;/code&gt; property to &lt;code&gt;SCHEDULED: &amp;lt;2016-05-16 Mon .+1d&amp;gt;&lt;/code&gt; (note the &lt;code&gt;.&lt;/code&gt; in front of the &lt;code&gt;+&lt;/code&gt;). See the &lt;a href=&quot;http://orgmode.org/manual/Tracking-your-habits.html&quot;&gt;Tracking your habits&lt;/a&gt; docs for more info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And don't forget to brush your teeth!&lt;/p&gt;&#xA;" OwnerUserId="10878" LastActivityDate="2016-05-17T14:23:13.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22325" PostTypeId="1" AcceptedAnswerId="22336" CreationDate="2016-05-17T14:44:54.800" Score="5" ViewCount="1907" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How to disable plantUML inserting the images automatically?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Code block inside a org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: fig:1&#xA;#+CAPTION: IETF-draft&#xA;[[./draft.png]]&#xA;&#xA;#+begin_src plantuml :file draft.png&#xA;  Alice -&amp;gt; Bob: Authentication Request&#xA;  Bob --&amp;gt; Alice: Authentication Response&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;export to latex : -&gt;C-c C-e l l&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Produces two images: &#xA;1. As the result of [[./draft.png]] together with CAPTION, NAME.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{figure}[htb]&#xA;\centering&#xA;\includegraphics[height=0.6\textheight,keepaspectratio,width=.9\linewidth]{./pbk.png}&#xA;\caption{\label{fig:pbk-draft}PBK-framework-IETF-draft}&#xA;\end{figure}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;2. The following img is inserted by plantUML automatically ( I want to disable this, how to do this ? }&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\includegraphics[height=0.6\textheight,keepaspectratio,width=.9\linewidth]{draft.png} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/o73Be.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o73Be.png&quot; alt=&quot;the two images inserted in the PDF &quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- Edited following the request from @Emacs User--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code block inside a org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: fig:1&#xA;#+CAPTION: IETF-draft&#xA;#+begin_src plantuml :file draft.png&#xA;  Alice -&amp;gt; Bob: Authentication Request&#xA;  Bob --&amp;gt; Alice: Authentication Response&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;export to latex : -&gt;C-c C-e l l&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Produces just the second image and &lt;strong&gt;I lose the control over the CAPTION, FIG NAME references&lt;/strong&gt;; the latex code is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\includegraphics[height=0.6\textheight,keepaspectratio,width=.9\linewidth]{draft.png}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12051" LastEditorUserId="12051" LastEditDate="2016-05-19T15:17:11.437" LastActivityDate="2016-05-19T16:45:08.747" Title="Org mode export to Latex: #+CAPTION: not working as plantUML inserts \includegraphics" Tags="|org-export|latex|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22326" PostTypeId="1" AcceptedAnswerId="22327" CreationDate="2016-05-17T15:15:04.250" Score="1" ViewCount="64" Body="&lt;p&gt;Launch Emacs with &lt;code&gt;emacs -Q&lt;/code&gt;, insert a line contains only a &lt;code&gt;\t&lt;/code&gt; (&lt;code&gt;|&lt;/code&gt; represents the cursor):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\t|&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x whitespace-mode&lt;/code&gt;, it should looks like (&lt;code&gt;_&lt;/code&gt; represents visual space):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;»________$&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Insert 2 spaces at the beginning of the line, it should now looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;··»______$&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what i want is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;··»________$&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a little confused why Emacs doesn't display the &lt;code&gt;\t&lt;/code&gt; and 2 spaces before separately. Is the before 2 spaces really inserted? Can anyone help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I encounter this problem when using &lt;code&gt;whitespace-mode&lt;/code&gt; to show tab mark. The details can be found &lt;a href=&quot;https://emacs.stackexchange.com/questions/22357/whitespace-mode-tab-mark-disturb-my-indentation&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11890" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-18T22:47:20.480" Title="Space before \t is really inserted?" Tags="|whitespace|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22327" PostTypeId="2" ParentId="22326" CreationDate="2016-05-17T15:44:57.767" Score="2" Body="&lt;p&gt;Tabs are not displayed as a fixed amount of spaces but as &lt;em&gt;whitespace stretching up to the next tab stop&lt;/em&gt;. The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Usual-Display.html#Usual-Display&quot; rel=&quot;nofollow&quot;&gt;elisp manual&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The tab character (character code 9) displays as whitespace&#xA;       stretching up to the next tab stop column.  *Note (emacs)Text&#xA;       Display::.  The variable ‘tab-width’ controls the number of spaces&#xA;       per tab stop (see below).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h v&lt;/kbd&gt;&lt;code&gt;tab-width&lt;/code&gt; says (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  &lt;strong&gt;Distance between tab stops&lt;/strong&gt; (for display of tab characters), in columns.&#xA;  NOTE: This controls the display width of a TAB character, and not&#xA;  the size of an indentation step.&#xA;  This should be an integer greater than zero.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-05-17T15:51:10.300" LastActivityDate="2016-05-17T15:51:10.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22329" PostTypeId="1" CreationDate="2016-05-17T19:28:45.163" Score="1" ViewCount="67" Body="&lt;p&gt;Is it possible for a variable to be set to an expression that will be evaluated each time that variable is accessed? The idea would be that a user could then set the variable to be either a string or a function that returns a string. Perhaps something like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq test-variable (lambda () (if (string= (buffer-name) &quot;*scratch*&quot;) &quot;true&quot; &quot;false&quot;)))&#xA;(message &quot;%s&quot; test-variable) ;; prints true if in scratch buffer else print false&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would even be great if there were a way to evaluate something in the same way that the &lt;code&gt;global-mode-line&lt;/code&gt; variable gets evaluated &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq test-variable '(:eval (if (string= (buffer-name) &quot;*scratch*&quot;) &quot;true&quot; &quot;false&quot;)))&#xA;(message &quot;%s&quot; test-variable) ;; prints true if in scratch buffer else print false&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would also be work if all it took was some simple wrapper&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq test-variable '(:eval (if (string= (buffer-name) &quot;*scratch*&quot;) &quot;true&quot; &quot;false&quot;)))&#xA;(message &quot;%s&quot; (test-wrapper test-variable)) ;; prints true if in scratch buffer else print false&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you,  &lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="105" LastEditDate="2016-06-22T19:44:57.310" LastActivityDate="2016-06-22T19:44:57.310" Title="Expression as var" Tags="|functions|variables|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22330" PostTypeId="1" CreationDate="2016-05-17T19:44:45.580" Score="1" ViewCount="62" Body="&lt;p&gt;I have a fairly long startup for Emacs 24.4 on Microsoft Windows 7. I try to move the frame where I want it during startup, but it snaps back after all the startup code is done running. I don't appear to have any Emacs settings in the Registry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest way to reproduce this is to run &lt;code&gt;emacs -Q --eval '(sleep-for 3)'&lt;/code&gt; and move the frame with the mouse during the sleep time. After three seconds it snaps back to its initial location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to figure out at what point in Emacs startup this movement occurs by starting up normally (no &lt;code&gt;-Q&lt;/code&gt;) with the following in init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook (lambda () (message-box &quot;after-init&quot;)))&#xA;(add-hook 'emacs-startup-hook (lambda () (message-box &quot;emacs-startup&quot;)))&#xA;(add-hook 'window-setup-hook (lambda () (message-box &quot;window-setup&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I do this, I get all three message boxes before the frame moves back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to keep the frame where I move it during startup?&lt;/p&gt;&#xA;" OwnerUserId="2701" LastActivityDate="2016-05-17T19:44:45.580" Title="If I move frame during Emacs startup, it moves back at the end of startup" Tags="|frames|microsoft-windows|start-up|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22331" PostTypeId="2" ParentId="22317" CreationDate="2016-05-17T20:25:52.437" Score="1" Body="&lt;p&gt;This function could just call &lt;code&gt;org-next-link&lt;/code&gt; followed by &lt;code&gt;org-open-at-point&lt;/code&gt;, enclosed in &lt;code&gt;save-excursion&lt;/code&gt; so that point is not changed. In addition, it can check that the link is on the same line than point.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/follow-header-link ()&#xA;   &quot;Follow the next link on the same line&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (let ((e (save-excursion (end-of-line) (point))))&#xA;      (org-next-link)&#xA;      (if (&amp;lt; (point) e)&#xA;          (org-open-at-point)&#xA;        (message &quot;no link on current line&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-05-17T20:25:52.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22332" PostTypeId="1" CreationDate="2016-05-17T20:29:29.893" Score="0" ViewCount="245" Body="&lt;p&gt;I've started to write a package and excessive use of the interactive &lt;code&gt;eval-*&lt;/code&gt; functions has become a pain point for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I make a change re-evaluating entire file or package is almost always appropriate.  &lt;code&gt;eval-buffer&lt;/code&gt; is usually sufficient and usually what I run.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I'm an emacser with the &lt;em&gt;C-x C-s Tourette-esque tic&lt;/em&gt; eval'ing the buffer would be something I'd like to happen automatically on save.  I'm writing elisp, but I can imagine other circumstances where the same workflow would be useful.  Eval'ing the entire project (i.e. &lt;code&gt;(require 'my-package)&lt;/code&gt;) would often also be sufficient in cases that the package is in &lt;code&gt;load-path&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've started to use .dir-locals.el files in these projects which add a buffer-local &lt;code&gt;after-save-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((emacs-lisp-mode&#xA;   (eval add-hook 'before-save-hook 'eval-buffer nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What would be a better way to accommodate this sort of workflow / What other ways have people implemented this workflow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wishing there's something in the realm of zero-configuration &quot;Do what I mean&quot; to figure out / track which projects/directories/files I want eval'd on save and do it.  I happen to use projectile, but am still curious about broader possibilities which may or may not be usable with projectile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few thoughts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/jfeltz/projectile-load-settings&quot; rel=&quot;nofollow&quot;&gt;projectile-load-settings&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;global hook conditioned on a file (&quot;Cask&quot;?) existing in the project root&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-05-17T20:29:29.893" Title="Recommendations for eval on save workflow for projects?" Tags="|hooks|projectile|package-development|eval|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22333" PostTypeId="2" ParentId="22313" CreationDate="2016-05-17T20:46:07.367" Score="1" Body="&lt;p&gt;I find that the built-in &lt;code&gt;ediff&lt;/code&gt; serves great for diffing sexps. As soon as you ignore whitespace, the changes in sexps become very clear.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ediff-diff-options &quot;-w --text&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A nice command to start with is &lt;code&gt;ediff-regions-wordwise&lt;/code&gt;, which can be used to narrow the bounds of the stuff you diff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to diff two sexps very quickly in terms of keys pressed, in &lt;code&gt;lispy-mode&lt;/code&gt; you can select the first sexp with &lt;kbd&gt;xB&lt;/kbd&gt; and compare them with &lt;kbd&gt;B&lt;/kbd&gt; from the second sexp.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-05-17T20:46:07.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22334" PostTypeId="2" ParentId="22317" CreationDate="2016-05-17T20:46:21.357" Score="1" Body="&lt;p&gt;This should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun open-org-link-in-heading ()&#xA;  &quot;Open first link in the org-mode heading at current line.&#xA;Only works when at the beginning of the line.&quot;&#xA;  (interactive)&#xA;  (when (and (looking-at &quot;^\\*&quot;)&#xA;             (re-search-forward org-any-link-re (line-end-position) t))&#xA;    (org-open-at-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For an easy keybinding, you could add it to &lt;code&gt;org-metareturn-hook&lt;/code&gt; and use it with &lt;code&gt;M-RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="9695" LastEditDate="2016-05-17T20:57:50.747" LastActivityDate="2016-05-17T20:57:50.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22335" PostTypeId="1" CreationDate="2016-05-17T20:51:39.910" Score="3" ViewCount="376" Body="&lt;p&gt;Related: &lt;a href=&quot;https://stackoverflow.com/a/21475047/52310&quot;&gt;https://stackoverflow.com/a/21475047/52310&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to write something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. foo&#xA;2. bar&#xA;&#xA;intervening text&#xA;&#xA;3. baz&#xA;4. quux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The two easy almost-solutions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Make &quot;intervening text&quot; part of the first list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. foo&#xA;2. bar&#xA;&#xA;    intervening text&#xA;&#xA;3. baz&#xA;4. quux&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Explicitly set the second list's number:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. foo&#xA;2. bar&#xA;&#xA;intervening text&#xA;&#xA;3. [@3] baz&#xA;4. quux&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm exporting to LaTeX, but I'd prefer to avoid using anything LaTeX-specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this, but it didn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    1. foo&#xA;    2. bar &amp;lt;&amp;lt;list-end&amp;gt;&amp;gt;&#xA;&#xA;    intervening text&#xA;&#xA;    3. [@[[list-end]]] baz&#xA;    4. quux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6761" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-05-17T20:51:39.910" Title="How to get org-mode to resume list numbering from where it left off" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22336" PostTypeId="2" ParentId="22325" CreationDate="2016-05-17T20:58:56.320" Score="4" Body="&lt;p&gt;Name and label the results block, not the source block: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC plantuml :file draft.png&#xA;Alice -&amp;gt; Bob: Authentication Request&#xA;Bob --&amp;gt; Alice: Authentication Response&#xA;#+END_SRC&#xA;&#xA;#+NAME: fig:draft&#xA;#+CAPTION: IETF-draft&#xA;#+RESULTS:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To refer to this output in the document, you would use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;See figure [[fig:draft]].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the order of name, caption, and results. Also, use names instead of numbers in labels since numbering is provided automatically by the exporter backend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to avoid creating draft.png file, then look into creating a separate \begin{figure} environment in the org file and to contain the UML. That's a longer solution but there are many examples on SO.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-05-19T16:45:08.747" LastActivityDate="2016-05-19T16:45:08.747" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22337" PostTypeId="1" CreationDate="2016-05-17T22:12:30.453" Score="1" ViewCount="257" Body="&lt;p&gt;Is there any easy way (or maybe a package) which provides &lt;code&gt;Ctrl-Del/Backspace&lt;/code&gt; behavior like in Sublime?&#xA;The default rule of sublime is &lt;code&gt;delete-to-next-word-boundary&lt;/code&gt;. I did not find similar options. Emacs kinda delete too much for my taste.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Sublime Text Example&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;C-h&quot; . neotree-hidden-file-toggle)&#xA;(&quot;&amp;lt; |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;Ctrl-Backspace&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;C-h&quot; . neotree-hidden-file-toggle)&#xA;|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;Ctrl-Backspace&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;C-h&quot; . neotree-hidden-file-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Emacs Example&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;C-h&quot; . neotree-hidden-file-toggle)&#xA;(&quot;&amp;lt; | &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;Ctrl-Backspace&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;C-h&quot; . neotree-hidden-file-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12007" LastEditorUserId="115" LastEditDate="2016-05-18T04:00:29.687" LastActivityDate="2016-05-18T04:00:29.687" Title="Sublime Text like Ctrl-Delete/Backspace" Tags="|functions|defun|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22338" PostTypeId="1" AcceptedAnswerId="22441" CreationDate="2016-05-17T23:33:56.963" Score="3" ViewCount="1319" Body="&lt;p&gt;I have several hundred lines of customization code for org-mode in a private layer.  In Spacemacs, customization code typically goes in a function called &lt;code&gt;$LAYER/init-$PACKAGE&lt;/code&gt; or in my case, &lt;code&gt;joe/post-init-org&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this adds three layers of indentation and is annoying to re-eval code segments when modifying a config.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun joe/post-init-org ()&#xA;  &quot;Init org.&quot;&#xA;  (use-package org&#xA;    :config&#xA;    (progn&#xA;      ;; Extensive list of customization...&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a proper way to do this in Spacemacs?  Or should I just do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun joe/post-init-org ()&#xA;  &quot;Init org.&quot;&#xA;  (use-package org&#xA;    :config&#xA;    (progn&#xA;      (load &quot;~/path/to/my/file&quot;)&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-05-24T00:20:11.700" Title="Spacemacs - move org-mode customization to separate file" Tags="|spacemacs|load-path|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22339" PostTypeId="1" AcceptedAnswerId="22340" CreationDate="2016-05-17T23:57:48.223" Score="3" ViewCount="57" Body="&lt;p&gt;I'm trying to understand this value assignment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mouse-wheel-scroll-amount '(2 ((shift) . 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that &lt;code&gt;shift&lt;/code&gt; is a bitwise shift. But I don't understand what is the result of this operation here (what is the value of &lt;code&gt;mouse-wheel-scroll-amount&lt;/code&gt;). And for that matter, why did the coder decide to use this operation rather than giving a decimal value here.&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="105" LastEditDate="2016-06-22T19:44:08.493" LastActivityDate="2016-06-22T19:44:08.493" Title="What does this 'shift' do here?" Tags="|mouse|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22340" PostTypeId="2" ParentId="22339" CreationDate="2016-05-18T00:13:51.233" Score="6" Body="&lt;p&gt;&lt;code&gt;shift&lt;/code&gt; in this case is a symbol, not a function. Note that the variable is given a quoted list, so nothing inside is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation of this variable (which you can access via &lt;code&gt;describe-variable&lt;/code&gt;), you can give different amounts of scrolling for different (keyboard) modifiers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the normal scroll is 2 lines, or 1 if &lt;kbd&gt;SHIFT&lt;/kbd&gt; is pressed.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-05-18T00:13:51.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22341" PostTypeId="1" AcceptedAnswerId="22343" CreationDate="2016-05-18T01:17:46.383" Score="0" ViewCount="203" Body="&lt;p&gt;When I create a new file in a (currently) non-existent directory, the echo area displays:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Use M-x make-directory RET RET to create the directory and its parents&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I plan on doing as soon as skeletons, etc. are inserted.  However, before I have a chance to do so, Tramp decides to make an uninvited entrance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Password for /sudo:root@localhost: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the only way to stop it from asking is to use &lt;code&gt;C-g&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to tell Tramp to stop doing this?  I don't want to disable Tramp entirely (though I think I did do this at one point until I needed Tramp for something).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.emacs.d&lt;/code&gt; can be found &lt;a href=&quot;https://github.com/ivan-m/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6599" LastEditorUserId="25" LastEditDate="2016-05-18T20:40:19.117" LastActivityDate="2016-05-18T20:40:19.117" Title="Tramp and non-existent directories" Tags="|tramp|directory|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22342" PostTypeId="1" AcceptedAnswerId="22483" CreationDate="2016-05-18T01:23:42.563" Score="2" ViewCount="3105" Body="&lt;p&gt;I'm using magit 20160517.838, Emacs 25.0.50.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just upgraded magit from 20160320 to 20160517 and when I try to stash I now get this issue;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;magit-stash-create: Cannot save the current index state&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can still manually stash on the command line with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git stash&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've put the debug into my init.el file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq magit-git-debug t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I restarted emacs and tried stashing again but no debug console is displayed. I get the following error in my *magit-process file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;128 git … commit-tree --no-gpg-sign -m index on master: 917b40b Revert &quot;electric-pair-mode failed with python files.&quot; -p HEAD 8e2cbf3020c9c4d509f98a1924f3d43ba0ed4f12&#xA;fatal: Not a valid object name --no-gpg-sign&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think I require updating my git as I'm running an old version '1.9.1'&lt;/p&gt;&#xA;" OwnerUserId="9463" LastEditorUserId="9463" LastEditDate="2016-05-23T23:19:49.690" LastActivityDate="2019-05-14T03:10:10.113" Title="magit-stash-create: Cannot save the current index state" Tags="|magit|git|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22343" PostTypeId="2" ParentId="22341" CreationDate="2016-05-18T05:16:32.310" Score="1" Body="&lt;p&gt;Tramp must check whether the directory, you intend to create the new file in, does exist. This can be done only by checking on the remote host. Asking for the password is part of the connection to the remote host.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-05-18T05:16:32.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22345" PostTypeId="2" ParentId="22298" CreationDate="2016-05-18T07:10:50.973" Score="1" Body="&lt;p&gt;No, there currently is no such key binding. (You may wish to open a feature request.)&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-05-18T07:17:36.453" LastActivityDate="2016-05-18T07:17:36.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22346" PostTypeId="1" AcceptedAnswerId="22348" CreationDate="2016-05-18T07:32:41.757" Score="4" ViewCount="332" Body="&lt;p&gt;I'm aware of and use whitespace-mode to great effect. I don't show a glyph/character for spaces because I think it's too noisy and unnecessary. I do highlight trailing spaces red which is great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from that, I was thinking that it may be useful to specify a glyph such as &lt;code&gt;·&lt;/code&gt;, if it were possible, for inner consecutive spaces. This means that it excludes trailing whitespace as well as indentation, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print(&quot;one·····two&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print(&quot;one     two&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But again, this wouldn't apply to leading/indentation whitespace nor trailing whitespace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I tried setting &lt;code&gt;whitespace-regexp-search&lt;/code&gt; as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq whitespace-space-regexp &quot;[^ ]\\( \\{2,\\}\\)[^ ]&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;spaces&lt;/code&gt; and &lt;code&gt;space-mark&lt;/code&gt; in my &lt;code&gt;whitespace-style&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq whitespace-style&#xA;      '(face indentation trailing empty spaces space-after-tab&#xA;        space-before-tab tab-mark space-mark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it seems like the &lt;code&gt;whitespace-space-regexp&lt;/code&gt; is only for the &lt;code&gt;spaces&lt;/code&gt; face highlighting, and isn't used for setting the &lt;code&gt;space-mark&lt;/code&gt;. Here's the effect:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/1DpVKZN.png&quot; alt=&quot;img&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that all other spaces are still showing the space-mark, even though what I'd like is for consecutive spaces of 2 or more to show it. The inner consecutive spaces are indeed being highlighted differently, but I only did that to show the difference between what's being matched by &lt;code&gt;whitespace-space-regexp&lt;/code&gt; and the &lt;code&gt;space-mark&lt;/code&gt; character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact I just noticed that even the numberline is showing the space-mark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like the &lt;code&gt;space-mark&lt;/code&gt; is simply matched based on a character, which I guess makes sense, so perhaps this isn't possible after all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: As outlined in my post, I recognize that this isn't possible via whitespace itself, what I'm curious about is whether it's possible to do at all. I found some uses of font-locking such as &lt;a href=&quot;http://oremacs.com/2015/01/11/pretty-elisp-regex/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this one&lt;/a&gt; which accomplish replacing pattern matches with a character. I'm wondering if it would be possible to use something like this but have it replace the spaces in the region matched with the middle dot for example.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="8941" LastEditDate="2016-05-19T07:24:04.240" LastActivityDate="2016-05-19T07:24:04.240" Title="distinguish inner consecutive spaces" Tags="|whitespace|whitespace-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22347" PostTypeId="1" CreationDate="2016-05-18T08:41:18.313" Score="0" ViewCount="1816" Body="&lt;p&gt;Given;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq whole '(group1 group2(element1 element2(suba subb subc)         &#xA;   element3) group3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would to print some list of that list, like element2 sublist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i do it?&lt;/p&gt;&#xA;" OwnerUserId="12062" LastEditorUserId="11941" LastEditDate="2016-09-24T14:11:32.607" LastActivityDate="2016-09-24T14:11:32.607" Title="how to access/print a list of a list?" Tags="|list|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22348" PostTypeId="2" ParentId="22346" CreationDate="2016-05-18T10:56:37.783" Score="3" Body="&lt;p&gt;Indeed you can't specify different glyphs for different kinds of spaces because this feature makes use of a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Tables.html#Display-Tables&quot; rel=&quot;nofollow noreferrer&quot;&gt;display table&lt;/a&gt;. The relevant values in variable &lt;code&gt;whitespace-style&lt;/code&gt; are (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html#Useless-Whitespace&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs manual&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;space-mark&#xA;      Draw space and non-breaking characters with a special glyph.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;tab-mark&#xA;      Draw tab characters with a special glyph.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;newline-mark&#xA;      Draw newline characters with a special glyph. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;All other values specify &lt;em&gt;highlights&lt;/em&gt;, so all other distinctions can only be made through the use of faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See my answer on a &lt;a href=&quot;https://emacs.stackexchange.com/questions/21863/how-can-i-visualize-trailing-whitespace-like-this/21961#21961&quot;&gt;related question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-05-18T11:54:05.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22350" PostTypeId="1" CreationDate="2016-05-18T15:04:44.533" Score="1" ViewCount="1023" Body="&lt;p&gt;I really really like the default (dark) color scheme in 16 colors terminal/tty emacs (&lt;code&gt;TERM=xterm&lt;/code&gt;), but with some plugins like powerline, 16 colors doesn't cut it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence I need to switch to 256colors (&lt;code&gt;TERM=xterm-256color&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, all the default colors get really ugly in 256 colors, not only when editing c/c++ source files but also in the minibuffer, when selecting regions etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have a link to a theme or a piece of code to get the good old 8 colors scheme back in 256 colors ?&lt;/p&gt;&#xA;" OwnerUserId="11911" LastActivityDate="2016-07-17T17:52:51.303" Title="Terminal: get 16-colors default color scheme in 256color mode" Tags="|terminal-emacs|colors|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22351" PostTypeId="2" ParentId="22347" CreationDate="2016-05-18T15:15:32.367" Score="1" Body="&lt;p&gt;Welcome to the Emacs StackExchange site!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;List Structure Clarification&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect you made an error in notating your lisp object.  It looks like you were maybe trying to add an identifier to the second group? Check out &lt;a href=&quot;https://www.emacswiki.org/emacs/AlistVsPlist&quot; rel=&quot;nofollow&quot;&gt;alists and plists&lt;/a&gt; for helpful list structures with keys.  They may be correspond to the object you had in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe this will help clarify things.  Your list object:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(group1 group2(element1 element2(suba subb subc) element3) group3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Should, at a minim, have spaces to make it clear that it is indeed lisp code (and not a mutant child of Scheme and JavaScript):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(group1 group2 (element1 element2 (suba subb subc) element3) group3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In an expanded form for readability (with newlines and indentation) expresses exactly the same structure which may not be what you intended:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;(Preserving the symbol names in the original post; 'group1' 'group2'    are misnomers)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(&#xA;   group1 ; first element of the list (accessed by (elt whole 0) since lists are indexed from zero)&#xA;   group2 ; second element (another way of accessing is (nth 1 whole) which is functionally the same as (elt whole 1)&#xA;   ( ; third element - is the list you were talking about accessing&#xA;     element1 ; first element of your nested list&#xA;     element2 ; second element of your nested list&#xA;     ( ; third element of the third element&#xA;       suba ; first element of the third element of the third element&#xA;       subb&#xA;       subc&#xA;       )&#xA;     element3&#xA;     )&#xA;   group3 ; fourth element of the top-level list&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Accessing lists&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to &lt;code&gt;elt&lt;/code&gt; and &lt;code&gt;nth&lt;/code&gt; you should also look at using &lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt;.  Once you understand these and their many variations you should have a strong grasp of how lists work in lisp.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(car whole) ; evaluates to the 'group1 symbol you have&#xA;(cdr whole) ; evaluates to the rest of the list after 'group1&#xA;(cadr whole) ; evaluates to the 'group2 symbol you have&#xA;(cddr whole) ; evaluates to the 'group2 symbol you have&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Printing&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For printing elements of uncertain type you might want to consider using &lt;code&gt;prin1&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-05-18T15:21:15.350" LastActivityDate="2016-05-18T15:21:15.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22352" PostTypeId="2" ParentId="22350" CreationDate="2016-05-18T16:47:58.333" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Does anybody have a link to a theme...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/sellout/emacs-color-theme-solarized&quot; rel=&quot;nofollow&quot;&gt;Solarized theme&lt;/a&gt; has options for lower terminal colors and degrade from 256 colors. Perhaps you can tweak that.  &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-05-18T16:47:58.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22353" PostTypeId="1" CreationDate="2016-05-18T18:00:47.057" Score="1" ViewCount="681" Body="&lt;p&gt;Given the following buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo bar&#xA;&#xA;    nee nope&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I place point on the 2nd line and execute&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(just-one-space -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the result will be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo bar nee nope&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to modify the behavior such that the newline after 'bar' will be kept, e.g. with this result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo bar&#xA;neee nope&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do I have to write my own function for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance,&#xA;Tom&lt;/p&gt;&#xA;" OwnerUserId="12067" LastEditorUserId="12067" LastEditDate="2016-05-19T18:45:51.147" LastActivityDate="2016-05-19T18:45:51.147" Title="Delete all spaces+newlines but the first" Tags="|whitespace|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22354" PostTypeId="2" ParentId="22353" CreationDate="2016-05-18T19:13:34.473" Score="1" Body="&lt;p&gt;The command &lt;code&gt;delete-blank-lines&lt;/code&gt; (bound to &lt;code&gt;C-x C-o&lt;/code&gt; by default) does what you want, at least in this case.  Of course, it doesn't act like &lt;code&gt;just-one-space&lt;/code&gt; in other cases, so you may want to write a function that dispatches appropriately for your preferences.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-05-18T19:13:34.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22355" PostTypeId="1" CreationDate="2016-05-18T19:30:07.090" Score="3" ViewCount="250" Body="&lt;p&gt;I would like to use org-mode to maintain a simple website that is a collection of notes organized by topic.  I understasnd the basics of publishing -- i.e., using &lt;code&gt;C-x C-e P p&lt;/code&gt; to publish all the files in the current project -- but these files are all independent of one another and I have to manually link with &lt;code&gt;[[file:nexttopic.org][the next topic]]&lt;/code&gt; to make the different topics &quot;aware&quot; of one another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to make org-mode aware of the structure of the topics and have it automatically generate a single page that is a table of contents as well as link to the next/previous topics?&lt;/p&gt;&#xA;" OwnerUserId="12069" LastActivityDate="2016-10-21T19:39:49.067" Title="Publishing multifile org-mode projects" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22356" PostTypeId="2" ParentId="18179" CreationDate="2016-05-18T22:30:38.427" Score="2" Body="&lt;p&gt;Here's a simple solution with the built-in org filtering commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only works if the headline is tagged explicitly. It does not work if the tag is &lt;a href=&quot;https://orgmode.org/manual/Tag-inheritance.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;inherited&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(agenda &quot;&quot;&#xA;        ((org-agenda-skip-function&#xA;          '(org-agenda-skip-entry-if 'regexp &quot;:work:&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastEditorUserId="15750" LastEditDate="2018-03-13T23:43:30.320" LastActivityDate="2018-03-13T23:43:30.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22357" PostTypeId="1" AcceptedAnswerId="22367" CreationDate="2016-05-18T22:37:45.023" Score="6" ViewCount="975" Body="&lt;p&gt;I encounter this issue when i set &lt;code&gt;whitespace-style&lt;/code&gt; to &lt;code&gt;(face tabs trailing tab-mark)&lt;/code&gt; and turn on &lt;code&gt;whitespace-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;whitespace-mode&lt;/code&gt; is turned off, everything looks well:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DjX3n.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DjX3n.png&quot; alt=&quot;before-turn-on-whitespace-mode&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;whitespace-mode&lt;/code&gt; is turned on, it seems as if a tab mark &lt;code&gt;»&lt;/code&gt; are actually inserted before tab char and the indentation looks strange:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/S0PlK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/S0PlK.png&quot; alt=&quot;after-turn-on-whitespace-mode&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Is this a bug of &lt;code&gt;whitespace-mode&lt;/code&gt;? How can i solve it?&lt;/p&gt;&#xA;" OwnerUserId="11890" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2022-01-17T05:28:16.623" Title="Whitespace-mode tab mark disturb my indentation" Tags="|indentation|whitespace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22358" PostTypeId="1" CreationDate="2016-05-18T22:47:48.950" Score="0" ViewCount="112" Body="&lt;p&gt;When I run &lt;code&gt;M-! enter shell command enter&lt;/code&gt; in org mode, I expect the output to be inserted into the buffer I have active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, emacs opens a second buffer (splitting the window in two) and inserts the output there. How can I make it insert the result in the buffer I am working?&lt;/p&gt;&#xA;" OwnerUserId="9320" LastActivityDate="2016-05-18T23:15:16.710" Title="`M-! enter shell command enter` in org mode does not insert output in current buffer" Tags="|org-mode|shell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22359" PostTypeId="2" ParentId="22358" CreationDate="2016-05-18T23:11:40.363" Score="3" Body="&lt;p&gt;You can do that by typing &lt;code&gt;C-u M-! command RET&lt;/code&gt;.  Checking the help on &lt;code&gt;M-!&lt;/code&gt; explains why it works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-! runs the command shell-command, which is an interactive compiled&#xA;Lisp function in `simple.el'.&#xA;&#xA;It is bound to s-L, M-!, &amp;lt;menu-bar&amp;gt; &amp;lt;tools&amp;gt; &amp;lt;shell&amp;gt;.&#xA;&#xA;(shell-command COMMAND &amp;amp;optional OUTPUT-BUFFER ERROR-BUFFER)&#xA;&#xA;Execute string COMMAND in inferior shell; display output, if any.&#xA;With prefix argument, insert the COMMAND's output at point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2467" LastActivityDate="2016-05-18T23:11:40.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22360" PostTypeId="2" ParentId="22358" CreationDate="2016-05-18T23:15:16.710" Score="4" Body="&lt;p&gt;This is the normal behaviour for &lt;code&gt;shell-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Single-Shell.html#Single-Shell&quot; rel=&quot;nofollow&quot;&gt;If you want the output inserted into the current buffer&lt;/a&gt;, you must supply an argument (like &lt;code&gt;C-u M-!&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-05-18T23:15:16.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22361" PostTypeId="2" ParentId="21739" CreationDate="2016-05-18T23:35:35.660" Score="0" Body="&lt;p&gt;Try using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spacemacs/set-leader-keys-for-major-mode 'sclang-mode &quot;sl&quot; 'sclang-eval-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using that on several of my modes and all is displayed properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** UPDATE **&#xA;The problem you are having is most likely because you are not creating a spacemacs layer, and instead are trying to use the traditional Emacs way of configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add this to your configuration, you need to create a custom layer. This is the &lt;code&gt;Spacemacs&lt;/code&gt; way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look here for help: &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/LAYERS.org&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syl20bnr/spacemacs/blob/master/doc/LAYERS.org&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12070" LastEditorUserId="12070" LastEditDate="2016-05-20T00:17:44.040" LastActivityDate="2016-05-20T00:17:44.040" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22362" PostTypeId="1" AcceptedAnswerId="22365" CreationDate="2016-05-19T01:50:05.573" Score="0" ViewCount="108" Body="&lt;p&gt;Is there a way to differentiate between different numbers of raw prefix arguments (e.g. &lt;code&gt;C-u&lt;/code&gt; vs. &lt;code&gt;C-u C-u&lt;/code&gt;) aside from checking whether the argument is &lt;code&gt;(4)&lt;/code&gt;, &lt;code&gt;(16)&lt;/code&gt;, etc.?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to be what packages like &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;Smartparens&lt;/a&gt; do, albeit with thin wrapper functions.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-05-19T06:20:09.837" Title="Differentiating between raw prefix arguments" Tags="|prefix-argument|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22363" PostTypeId="1" AcceptedAnswerId="23790" CreationDate="2016-05-19T01:55:26.737" Score="12" ViewCount="1928" Body="&lt;p&gt;I use &lt;code&gt;browse-url&lt;/code&gt;/&lt;code&gt;browse-url-firefox&lt;/code&gt; to open links in Firefox from within Emacs 24.5.1 under Linux (Fedora 23) which in essence executes the &lt;code&gt;firefox&lt;/code&gt; executable with the URL by &lt;code&gt;start-process&lt;/code&gt;.  If there is already a Firefox instance running, this will in turn cause the URL to be opened in a new tab and terminate the &lt;code&gt;firefox&lt;/code&gt; executable spawned from Emacs, but otherwise a new Firefox instance will be running as a process child of Emacs (for testing purposes, this is equivalent to &lt;code&gt;M-! sleep 1h &amp;amp; RET&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I then want to exit Emacs, it asks me &quot;Active processes exist; kill them and exit anyway?&quot; with the option to either kill the Firefox instance or, well, leave Emacs running.  Instead I would like to &quot;detach&quot; the &lt;code&gt;firefox&lt;/code&gt; process from the Emacs parent so that I can exit Emacs while keeping the Firefox instance running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to spawn processes from Emacs that &quot;survive&quot; exiting Emacs, or must all spawned processes die when Emacs exits?&lt;/p&gt;&#xA;" OwnerUserId="12068" LastEditorUserId="12068" LastEditDate="2016-05-19T04:20:08.060" LastActivityDate="2021-05-27T15:32:20.813" Title="Possible to &quot;detach&quot; a child process?" Tags="|linux|process|exit|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22365" PostTypeId="2" ParentId="22362" CreationDate="2016-05-19T02:53:07.343" Score="2" Body="&lt;p&gt;No, you have to do exactly that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Prefix Command Arguments&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;find-function&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;universal-argument-more&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;edit: That said, &lt;a href=&quot;https://emacs.stackexchange.com/a/4181&quot;&gt;converting 4^n to n&lt;/a&gt; is just maths.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-05-19T06:20:09.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22367" PostTypeId="2" ParentId="22357" CreationDate="2016-05-19T06:41:23.040" Score="4" Body="&lt;p&gt;This is a known problem as made evident in a comment in &lt;code&gt;whitespace.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom whitespace-display-mappings&#xA;  '(&#xA;    (space-mark   ?\     [?\u00B7]     [?.])        ; space - centered dot&#xA;    (space-mark   ?\xA0  [?\u00A4]     [?_])        ; hard space - currency&#xA;    ;; NEWLINE is displayed using the face `whitespace-newline'&#xA;    (newline-mark ?\n    [?$ ?\n])          ; eol - dollar sign&#xA;    ;; (newline-mark ?\n    [?\u21B5 ?\n] [?$ ?\n]) ; eol - downwards arrow&#xA;    ;; (newline-mark ?\n    [?\u00B6 ?\n] [?$ ?\n]) ; eol - pilcrow&#xA;    ;; (newline-mark ?\n    [?\u00AF ?\n]  [?$ ?\n])    ; eol - overscore&#xA;    ;; (newline-mark ?\n    [?\u00AC ?\n]  [?$ ?\n])    ; eol - negation&#xA;    ;; (newline-mark ?\n    [?\u00B0 ?\n]  [?$ ?\n])    ; eol - degrees&#xA;    ;;&#xA;    ;; WARNING: the mapping below has a problem.&#xA;    ;; When a TAB occupies exactly one column, it will display the&#xA;    ;; character ?\xBB at that column followed by a TAB which goes to&#xA;    ;; the next TAB column.&#xA;    ;; If this is a problem for you, please, comment the line below.&#xA;    (tab-mark     ?\t    [?\u00BB ?\t] [?\\ ?\t])   ; tab - left quote mark&#xA;    )&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Considering that a display mapping introduces an extra preceding character, I don't see any way of solving this with whitespace-mode's current mode of operation.  Try using the described workaround instead.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-05-19T06:41:23.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22368" PostTypeId="2" ParentId="22363" CreationDate="2016-05-19T07:29:14.197" Score="1" Body="&lt;p&gt;Here's a command that does what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun ora-dired-start-process (cmd &amp;amp;optional file-list)&#xA;  (interactive&#xA;   (let ((files (dired-get-marked-files&#xA;                 t current-prefix-arg)))&#xA;     (list&#xA;      (unless (eq system-type 'windows-nt)&#xA;        (dired-read-shell-command &quot;&amp;amp; on %s: &quot;&#xA;                                  current-prefix-arg files))&#xA;      files)))&#xA;  (if (eq system-type 'windows-nt)&#xA;      (dolist (file file-list)&#xA;        (w32-shell-execute &quot;open&quot; (expand-file-name file)))&#xA;    (let (list-switch)&#xA;      (start-process&#xA;       cmd nil shell-file-name&#xA;       shell-command-switch&#xA;       (format&#xA;        &quot;nohup 1&amp;gt;/dev/null 2&amp;gt;/dev/null %s \&quot;%s\&quot;&quot;&#xA;        (if (and (&amp;gt; (length file-list) 1)&#xA;                 (setq list-switch&#xA;                       (cadr (assoc cmd ora-dired-filelist-cmd))))&#xA;            (format &quot;%s %s&quot; cmd list-switch)&#xA;          cmd)&#xA;        (mapconcat #'expand-file-name file-list &quot;\&quot; \&quot;&quot;))))))&#xA;&#xA;(define-key dired-mode-map &quot;r&quot; 'ora-dired-start-process)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The key thing here is to use &lt;code&gt;nohup&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the source &lt;a href=&quot;https://github.com/abo-abo/oremacs/blob/github/modes/ora-dired.el#L60&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-05-19T07:29:14.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22369" PostTypeId="1" AcceptedAnswerId="22370" CreationDate="2016-05-19T07:36:23.540" Score="3" ViewCount="1092" Body="&lt;p&gt;I am trying to use cl-labels, but i have run into errors i do not understand. Here is elisp code i am using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun nthelt (N ARRAY)&#xA;  &quot;Behaves like nth but for arrays&quot;&#xA;  (if (and (&amp;gt;= N 0)&#xA;           (&amp;lt; N (length ARRAY)))&#xA;      (elt ARRAY N)&#xA;    nil))&#xA;&#xA;(defvar *neraser-board*&#xA;     [(*sync* . 7)&#xA;      (*cell* . 3)&#xA;      (*cell* . 2)&#xA;      (*cell* . 2)])&#xA;&#xA;(defun neraser-check-victory ()&#xA;  &quot;Check if victory or loss condition (weak) has been reached&quot;&#xA;  (cl-labels ((victory-key (board-elem)&#xA;                           (cond&#xA;                            ((eq (car board-elem) '*c-sync*)&#xA;                             (nthelt 0 (cdr board-elem)))&#xA;                            ((eq (car board-elem) '*sync*)&#xA;                             (cdr board-elem))&#xA;                            (t 0))))&#xA;    (let ((victory-index (position 0 *neraser-board*&#xA;                                   :key 'victory-key&#xA;                                   :test-not 'eq)))&#xA;      (if (null victory-index)&#xA;          (message &quot;Congratulations!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When i try to run &lt;code&gt;neraser-check-victory&lt;/code&gt;, i get this error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Debugger entered--Lisp error: (void-function victory-key)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can i resolve this error?&lt;/p&gt;&#xA;" OwnerUserId="11047" LastEditorUserId="105" LastEditDate="2016-05-19T13:42:16.953" LastActivityDate="2016-05-19T13:42:16.953" Title="How to use cl-labels?" Tags="|common-lisp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22370" PostTypeId="2" ParentId="22369" CreationDate="2016-05-19T07:53:11.500" Score="4" Body="&lt;p&gt;Use &lt;code&gt;#'&lt;/code&gt; for quoting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  (cl-labels ((square (x) (* x x)))&#xA;    (mapcar #'square '(1 2 3))))&#xA;(test)&#xA;;; =&amp;gt;&#xA;;; (1 4 9)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-05-19T07:53:11.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22371" PostTypeId="1" CreationDate="2016-05-19T09:07:13.420" Score="5" ViewCount="1143" Body="&lt;p&gt;I love org-mode. It's main reason why i switched from vim.&#xA;It's really interesting to write reports using Literate Programming.&#xA;I try to use TODO, agenda etc. to be more productive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to make it nice, and clean with org-bullets and other fancy stuff...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...but there is one thing left - encoding. I really want to use UTF-8, so i have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle yes&#xA;(setq utf-translate-cjk-mode nil)&#xA;(set-locale-environment &quot;pl_PL.UTF-8&quot;)&#xA;(set-language-environment 'utf-8)&#xA;(setq locale-coding-system 'utf-8)&#xA;(set-default-coding-systems 'utf-8)&#xA;(set-terminal-coding-system 'utf-8)&#xA;(unless (eq system-type 'windows-nt)&#xA;  (progn&#xA;    (set-selection-coding-system 'utf-8)&#xA;    (set-keyboard-coding-system 'utf-8-mac)))&#xA;(prefer-coding-system 'utf-8)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it works in most cases. But when I use for example Deadline or Timestamp, and it's &lt;strong&gt;Wednesday&lt;/strong&gt; (in polish &lt;em&gt;Środa&lt;/em&gt;) i got this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEADLINE: &amp;lt;2016-05-18 \234r.&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It should be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEADLINE: &amp;lt;2016-05-18 śr.&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because there is &lt;code&gt;\234&lt;/code&gt;, Emacs can't save buffer as utf-8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So. My question is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how to setup Emacs to use english locales.&lt;/li&gt;&#xA;&lt;li&gt;or how to setup Emacs org-mode to use utf-8 &quot;ś&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I use GNU Emacs 24.5.1 (x86_64-w64-mingw32)&lt;/p&gt;&#xA;" OwnerUserId="12023" LastActivityDate="2016-09-12T10:20:02.077" Title="Org-mode timestamps encoding" Tags="|org-mode|org-agenda|character-encoding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22372" PostTypeId="1" CreationDate="2016-05-19T09:58:45.217" Score="3" ViewCount="57" Body="&lt;p&gt;How do I find out if compilation was successful or not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have a variable &lt;code&gt;compilation-no-error&lt;/code&gt; set to true after successful compilation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at variables and functions starting with &lt;code&gt;compilation-...&lt;/code&gt;, but I could not find a simple solution.&lt;/p&gt;&#xA;" OwnerUserId="6966" LastEditorUserId="7045" LastEditDate="2016-05-19T13:55:32.457" LastActivityDate="2016-05-19T13:55:32.457" Title="Was compilation successful or not?" Tags="|compilation|compilation-mode|" AnswerCount="0" CommentCount="3" ClosedDate="2016-05-20T00:06:32.453" ContentLicense="CC BY-SA 3.0" />
  <row Id="22373" PostTypeId="2" ParentId="22325" CreationDate="2016-05-19T15:11:21.340" Score="0" Body="&lt;p&gt;I'm using this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC plantuml :exports both :file tryout.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to have only one figure.&#xA;Depends also on what you expect from UML - maybe insert only one transition, not both.&lt;/p&gt;&#xA;" OwnerUserId="12075" LastEditorUserId="2710" LastEditDate="2016-05-19T16:16:42.760" LastActivityDate="2016-05-19T16:16:42.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22374" PostTypeId="2" ParentId="22353" CreationDate="2016-05-19T18:45:25.050" Score="0" Body="&lt;p&gt;Here's what I came up with so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun viking--kill-space()&#xA;  &quot;Kill space around point, including newline(s), but the first.&quot;&#xA;  (interactive)&#xA;  (let* ((lineA 0) (lineB 0)&#xA;         (beg (save-excursion&#xA;                (skip-chars-backward &quot; \t\r\n&quot;)&#xA;                (cond ((looking-at &quot;\r\n&quot;)&#xA;                       (forward-char 2))&#xA;                      ((looking-at &quot;\n&quot;)&#xA;                       (forward-char 1)))&#xA;                (setq lineA (line-number-at-pos))&#xA;                (point)))&#xA;         (end (save-excursion&#xA;                (skip-chars-forward &quot; \t\r\n&quot;)&#xA;                (setq lineB (line-number-at-pos))&#xA;                (point)))&#xA;         )&#xA;    (viking--blink-region beg end)&#xA;    (if (= lineA lineB)&#xA;        (just-one-space)&#xA;      (delete-region beg end))&#xA;    (message &quot;spaces cleared&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This accomplishes the job, it could a little bit more efficient though.&lt;/p&gt;&#xA;" OwnerUserId="12067" LastActivityDate="2016-05-19T18:45:25.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22375" PostTypeId="1" AcceptedAnswerId="22378" CreationDate="2016-05-20T01:59:27.890" Score="0" ViewCount="381" Body="&lt;p&gt;Is there a package to export an Org file to S5?  I've found a couple stand-alone scripts, but (a) it's difficult to know which one to use and (b) it would be nice to have a package instead of a stand-alone script.  If there is no package, is there a &quot;canonical&quot; script to use?&lt;/p&gt;&#xA;" OwnerUserId="9713" LastActivityDate="2016-05-20T07:01:36.563" Title="Export Org to S5?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22376" PostTypeId="1" AcceptedAnswerId="36177" CreationDate="2016-05-20T03:46:23.520" Score="12" ViewCount="202" Body="&lt;p&gt;I've been working with some org export engine code which passes around some rather large and complex list objects.  It's rather tedious to explore an object by reading through a long word-wrapped printed representation of an object or iteratively writing and evaluating accessors in the scratch buffer.  I and am wondering if there are any good methods for interactively examining values.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take for example: many IDE's that present object values in an interactive tree view which permits incrementally expanding keys/values.  The object is persistently shown on the screen and can be examined without much concern about the value types being viewed.  A random screenshot of Chrome developer tools as illustration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KfBgC.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KfBgC.png&quot; alt=&quot;Chrome developer tools object view&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other tools present values as navigable popovers (functionally very similar).  A random screenshot from Visual Studio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/eUFya.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eUFya.png&quot; alt=&quot;Visual Studio datatip&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything similar for emacs lisp?  Perhaps something built into edebug or provided by another package?  Or is this just waiting to be developed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: I discovered &lt;a href=&quot;https://github.com/typester/emacs/blob/master/lisp/emacs-lisp/pp.el&quot; rel=&quot;noreferrer&quot;&gt;pp&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/pp+.el&quot; rel=&quot;noreferrer&quot;&gt;pp+&lt;/a&gt; shortly after posting this question.  The formatting is incredibly helpful in visually navigating object structure.  It saves needing to modify &lt;code&gt;print-length&lt;/code&gt; and &lt;code&gt;print-depth&lt;/code&gt; to extreme values and formatting the output in a separate buffer.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2016-05-20T04:54:30.170" LastActivityDate="2017-10-15T20:35:23.057" Title="Methods for examining large/complicated lisp objects" Tags="|hideshow|interactive-development|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22377" PostTypeId="1" AcceptedAnswerId="22401" CreationDate="2016-05-20T04:13:25.913" Score="1" ViewCount="1089" Body="&lt;p&gt;I'm trying to run tramp in Emacs 24.3 in Ubuntu 14.04. The tramp hangs even without prompting for passcode (RSA Token). I'm able to connect to the remote host from terminal and also from &lt;code&gt;M-x shell&lt;/code&gt; in Emacs. I set &lt;code&gt;(setq tramp-verbose 10)&lt;/code&gt; in my .emacs file and the data present in &lt;code&gt;*debug tramp/ssh host*&lt;/code&gt; is shown below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; GNU Emacs: 24.3.1 Tramp: 2.2.6-24.3 -*- mode: outline; -*-&#xA;08:16:56.703770 tramp-maybe-open-connection (3) # Opening connection for ssh using scp...&#xA;08:16:56.704715 tramp-get-connection-property (7) # process-name nil&#xA;08:16:56.705305 tramp-get-connection-property (7) # process-buffer nil&#xA;08:16:56.707019 tramp-set-connection-property (7) # vector [scp nil ssh rbala@titan.ccs.ornl.gov nil]&#xA;08:16:56.707540 tramp-maybe-open-connection (6) # /bin/sh -i&#xA;08:16:56.707809 tramp-get-connection-property (7) # check-remote-echo nil&#xA;08:16:56.708036 tramp-get-connection-property (7) # check-remote-echo nil&#xA;08:16:56.708297 tramp-accept-process-output (10) # *tramp/scp ssh* run&#xA;08:16:56.708606 tramp-accept-process-output (10) # &#xA;#$ &#xA;08:16:56.708825 tramp-get-connection-property (7) # check-remote-echo nil&#xA;08:16:56.709043 tramp-get-connection-property (7) # check-remote-echo nil&#xA;08:16:56.709276 tramp-wait-for-regexp (6) # &#xA;#$ &#xA;08:16:56.709512 tramp-get-file-property (8) #  gateway nil&#xA;08:16:56.709795 tramp-set-connection-property (7) # temp-file /tmp/tramp.3232TWr&#xA;08:16:56.710451 tramp-maybe-open-connection (3) # Sending command `exec ssh   -e none ssh'&#xA;08:16:56.710721 tramp-get-connection-property (7) # process-name nil&#xA;08:16:56.710958 tramp-get-connection-property (7) # remote-echo nil&#xA;08:16:56.711172 tramp-send-command (6) # exec ssh   -e none ssh&#xA;08:16:56.711419 tramp-get-connection-property (7) # process-name nil&#xA;08:16:56.711657 tramp-get-connection-property (7) # chunksize nil&#xA;08:16:56.711886 tramp-set-connection-property (7) # last-cmd-time (22335 56 711814 288000)&#xA;08:16:56.712110 tramp-send-string (10) # exec ssh   -e none ssh&#xA;08:16:56.712320 tramp-get-connection-property (7) # process-buffer nil&#xA;08:16:56.712667 tramp-set-connection-property (7) # first-password-request t&#xA;08:16:56.713063 tramp-process-actions (3) # Waiting for prompts from remote shell&#xA;08:16:56.713389 tramp-accept-process-output (10) # *tramp/scp ssh* run&#xA;08:16:57.714433 tramp-accept-process-output (10) # &#xA;08:16:57.714759 tramp-process-one-action (5) # Looking for regexp &quot;\(.*ogin\( .*\)?: *\)\'&quot; from remote shell&#xA;08:16:57.715121 tramp-get-connection-property (7) # check-remote-echo nil&#xA;08:16:57.715497 tramp-get-connection-property (7) # check-remote-echo nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm able to use tramp to connect to remote hosts where ssh-keys are created. However for this particular host, I cannot use ssh-keys and I need to provide a passcode everytime I need to login&#xA;My &lt;code&gt;.emacs&lt;/code&gt; contains the following values&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;;;(setq tramp-default-method &quot;ssh&quot;)&#xA;(setq tramp-shell-prompt-pattern &quot;^[^$&amp;gt;\n]*[#$%&amp;gt;] *\\(\[[0-9;]*[a-zA-Z] *\\)*&quot;)&#xA;(setq tramp-verbose 10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&#xA;Upgrading to Emacs 24.5 solved this issue.&lt;/p&gt;&#xA;" OwnerUserId="8683" LastEditorUserId="8683" LastEditDate="2016-05-21T17:41:12.573" LastActivityDate="2016-05-21T17:41:12.573" Title="Tramp hangs even without prompting passcode" Tags="|tramp|ssh|passwords|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22378" PostTypeId="2" ParentId="22375" CreationDate="2016-05-20T04:33:07.670" Score="2" Body="&lt;p&gt;From &lt;a href=&quot;https://github.com/eschulte/org-S5&quot; rel=&quot;nofollow&quot;&gt;https://github.com/eschulte/org-S5&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For new versions of Org-mode (&gt;8.0) use the ox-S5.el export backend&#xA;  now distributed in the contrib/ directory of the Org-mode repository.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It looks like you should just install &lt;code&gt;org-plus-contrib&lt;/code&gt; and just require the s5 export engine with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox-s5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To install &lt;code&gt;org-plus-contrib&lt;/code&gt;, first add the &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow&quot;&gt;Org Emacs lisp Package Archive&lt;/a&gt; to your &lt;code&gt;package-archives&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="9713" LastEditDate="2016-05-20T07:01:36.563" LastActivityDate="2016-05-20T07:01:36.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22379" PostTypeId="1" CreationDate="2016-05-20T07:17:26.690" Score="1" ViewCount="312" Body="&lt;p&gt;I have a building environment/setup that contains &lt;code&gt;ncurses&lt;/code&gt;, and I am looking to build Emacs master branch &lt;strong&gt;without&lt;/strong&gt; that library.  I did not see any obvious option in the &lt;code&gt;.configure --help&lt;/code&gt; dialog, or by Googling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How, please, can I tell Emacs during the &lt;code&gt;configure&lt;/code&gt; process to forget about &lt;code&gt;ncurses&lt;/code&gt; -- i.e., pretend that it doesn't exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:  When the building environment contains &lt;code&gt;ncurses&lt;/code&gt;, an Emacs version built from that environment will always look for it when it launches.  If &lt;code&gt;ncurses&lt;/code&gt; is not there, Emacs fails to launch.  I would like to build Emacs that does not look for &lt;code&gt;ncurses&lt;/code&gt; each time it launches.  &lt;code&gt;gdb&lt;/code&gt; confirms that Emacs is looking for &lt;code&gt;ncurses&lt;/code&gt;.  The only workaround I have found is to remove &lt;code&gt;ncurses&lt;/code&gt; entirely from my building environment, which is not an ideal solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried excluding everything I can think of, but Emacs is still looking for &lt;code&gt;ncurses&lt;/code&gt; when it launches:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure \&#xA;--with-ns \&#xA;--without-dbus \&#xA;--without-gconf \&#xA;--without-gif \&#xA;--without-gnutls \&#xA;--without-gpm \&#xA;--without-imagemagick \&#xA;--without-jpeg \&#xA;--without-libotf \&#xA;--without-makeinfo \&#xA;--without-m17n-flt \&#xA;--without-png \&#xA;--without-rsvg \&#xA;--without-gsettings \&#xA;--without-sound \&#xA;--without-tiff \&#xA;--without-x \&#xA;--without-xaw3d \&#xA;--without-xft \&#xA;--without-xml2 \&#xA;--without-xpm \&#xA;--without-zlib \&#xA;--with-file-notification=no \&#xA;--disable-acl \&#xA;--enable-checking='glyphs' \&#xA;--without-compress-install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-07-19T12:29:24.253" Title="How to exclude ncurses when building Emacs from source" Tags="|build|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22380" PostTypeId="2" ParentId="22379" CreationDate="2016-05-20T09:55:13.663" Score="1" Body="&lt;p&gt;I'm sure someone better acquainted will have a definitive answer, but a quick isearch through the &lt;code&gt;configure&lt;/code&gt; script suggests the &lt;code&gt;LIBS_TERMCAP&lt;/code&gt; environment variable controls this, and alternative values are &lt;code&gt;LIBS_TERMCAP=&quot;-ltinfo&quot;&lt;/code&gt; or &lt;code&gt;LIBS_TERMCAP=&quot;-ltermcap&quot;&lt;/code&gt; and that you may or may not also need &lt;code&gt;TERMINFO=no&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-20T09:55:13.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22381" PostTypeId="1" AcceptedAnswerId="22383" CreationDate="2016-05-20T13:23:53.340" Score="0" ViewCount="349" Body="&lt;p&gt;Could you help me with smarter way of handling package-archives?&#xA;At the moment I have the following in my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is dumb but...&#xA;(if (eq system-type 'windows-nt)&#xA;    (setq package-archives '((&quot;elpa&quot; .  &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                             (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))&#xA;  (setq package-archives '((&quot;elpa&quot; .  &quot;https://elpa.gnu.org/packages/&quot;)&#xA;                           (&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I make it more DRY?&#xA;Like this one (doesn't work):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar package-protocol &quot;https://&quot;)&#xA;(if (eq system-type 'windows-nt) (setq package-protocol &quot;http://&quot;))&#xA;(setq package-archives '((&quot;elpa&quot; .  (concat package-protocol &quot;elpa.gnu.org/packages/&quot;))&#xA;                         (&quot;melpa&quot; . (concat package-protocol &quot;melpa.org/packages/&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;thx, combined from the answers, using local variable:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Set up packaging system&#xA;(let ((package-protocol (if (eq system-type 'windows-nt) &quot;http://&quot; &quot;https://&quot;)))&#xA;  (setq package-archives `((&quot;elpa&quot; .  ,(concat package-protocol &quot;elpa.gnu.org/packages/&quot;))&#xA;                           (&quot;melpa&quot; . ,(concat package-protocol &quot;melpa.org/packages/&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10063" LastEditorUserId="10063" LastEditDate="2016-05-20T14:59:07.627" LastActivityDate="2016-05-20T14:59:07.627" Title="Combine setq and concat" Tags="|local-variables|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22382" PostTypeId="2" ParentId="22381" CreationDate="2016-05-20T13:40:27.007" Score="1" Body="&lt;p&gt;This might help you get set up, you can change it afterwards&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((package-protocol (if (eq system-type 'windows-nt) &quot;http://&quot; &quot;https://&quot;))&#xA;      (package-suffix &quot;.org/packages/&quot;)&#xA;      (archives-to-use '(&quot;elpa.gnu&quot; &quot;melpa&quot;)))&#xA;  (setq package-archives&#xA;    (cl-loop for cur-archive in archives-to-use&#xA;    collect (cons (first (split-string cur-archive &quot;\\.&quot;)) &#xA;                  (concat package-protocol cur-archive package-suffix)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It lets the package protocol, and then the suffix. It then loops&#xA;through our list of archives and appends the suffix and prefix to&#xA;each element. It sets that collected list to package-archives&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="11272" LastEditDate="2016-05-20T14:00:39.097" LastActivityDate="2016-05-20T14:00:39.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22383" PostTypeId="2" ParentId="22381" CreationDate="2016-05-20T13:40:31.633" Score="1" Body="&lt;p&gt;Easy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives &#xA;      (list (cons &quot;elpa&quot; (concat package-protocol &quot;elpa.gnu.org/packages/&quot;))&#xA;            (cons &quot;melpa&quot; (concat package-protocol &quot;melpa.org/packages/&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or use backquote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives &#xA;      `((&quot;elpa&quot; .  ,(concat package-protocol &quot;elpa.gnu.org/packages/&quot;))&#xA;        (&quot;melpa&quot; . ,(concat package-protocol &quot;melpa.org/packages/&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-05-20T13:40:31.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22384" PostTypeId="1" CreationDate="2016-05-20T13:46:32.677" Score="1" ViewCount="457" Body="&lt;p&gt;Is there a way to delete opening and closing html tags in &lt;code&gt;web-mode&lt;/code&gt;? I have tried using &lt;code&gt;sgml-delete-tag&lt;/code&gt; from within &lt;code&gt;web-mode&lt;/code&gt; but can't get it to work properly (I get an error message &lt;code&gt;sgml-lexical-context: Wrong type argument: stringp, nil&lt;/code&gt;). Is there a way to delete matching tags in &lt;code&gt;web-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-05-20T18:20:46.360" Title="Delete opening and closing tag in web-mode" Tags="|html|web-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22385" PostTypeId="1" CreationDate="2016-05-20T14:05:03.857" Score="3" ViewCount="121" Body="&lt;p&gt;I know that Emacs can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Displaying-Boundaries.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;display the buffer boundaries in the fringe&lt;/a&gt;, by displaying angles at the boundaries, and arrows where the buffer can be scrolled. Is there some way to display these boundaries, and scroll status, at the top and bottom of a buffer? I’m hoping for an effect like that seen in Symbolics Genera. Take a look at this screenshot of Genera’s Document Examiner for an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/d3fXf.png&quot; alt=&quot;Symbolics Genera Document Examiner&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main Document Examiner window is scrolled part way through the document, with neither the top nor bottom boundaries visible. As such, both the top and bottom of the window display a torn-sheet effect, similar to a string of tilde characters ie. &lt;code&gt;~~~~~~~~~~&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12087" LastEditorUserId="105" LastEditDate="2016-08-10T21:56:15.137" LastActivityDate="2016-08-10T21:56:15.137" Title="Can buffer boundaries be displayed at the top and bottom of windows?" Tags="|window|scrolling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22386" PostTypeId="2" ParentId="22385" CreationDate="2016-05-20T14:31:13.087" Score="1" Body="&lt;p&gt;Technically, Emacs can display one line at the top of each window (the header line) and one at the bottom (the mode line). By default the header line isn't used for anything but some packages make use of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be possible to configure the header line and (parts of) the mode line to display a suitable character depending on which portions of the window is visible. For example, the mode line already contains an identifier displaying &quot;Top&quot;, &quot;NN%&quot;, or &quot;Bot&quot;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-05-20T14:31:13.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22387" PostTypeId="1" AcceptedAnswerId="22388" CreationDate="2016-05-20T15:27:38.013" Score="2" ViewCount="91" Body="&lt;p&gt;After running &lt;code&gt;M-x occur&lt;/code&gt;, the commands &lt;code&gt;next-error&lt;/code&gt; and &lt;code&gt;previous-error&lt;/code&gt; let me navigate between hits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to &lt;code&gt;M-x compile&lt;/code&gt; my program and then keep browsing through the same &lt;code&gt;*Occur*&lt;/code&gt; results. But if I compile then &lt;code&gt;next-error&lt;/code&gt; and &lt;code&gt;previous-error&lt;/code&gt; navigate the compilation errors, which makes perfect sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to run &lt;code&gt;M-x occur&lt;/code&gt; again because I'd lose my place. What I want is to navigate occur results independently of compilation results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I define &lt;code&gt;next-occur&lt;/code&gt; and &lt;code&gt;previous-occur&lt;/code&gt; commands that do this? (Note that this is not &lt;code&gt;occur-next&lt;/code&gt; and &lt;code&gt;occur-prev&lt;/code&gt;, which operate in the &lt;code&gt;*Occur*&lt;/code&gt; buffer. I want to bind these to keys in the buffer that's being searched.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus: I'd prefer &lt;code&gt;grep&lt;/code&gt; to be classified like &lt;code&gt;occur&lt;/code&gt;, so I can also navigate grep results independently from compilation errors.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-20T17:18:50.117" Title="Previous/next occur result, independently from compilation errors" Tags="|compilation|navigation|occur|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22388" PostTypeId="2" ParentId="22387" CreationDate="2016-05-20T17:18:50.117" Score="2" Body="&lt;p&gt;Looking at the source of &lt;code&gt;occur-mode&lt;/code&gt;, I found this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (setq next-error-function 'occur-next-error))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This suggests &lt;code&gt;occur-next-error&lt;/code&gt; is the function &lt;code&gt;next-error&lt;/code&gt; calls in a &quot;occured&quot; buffer. And indeed, it seems that calling &lt;code&gt;occur-next-error&lt;/code&gt; (with a negative arg to go backward) does work even after &lt;code&gt;M-x compile&lt;/code&gt;. I have not tested this extensively, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it would seem you just need to define a &lt;code&gt;occur-prev-error&lt;/code&gt; command calling &lt;code&gt;occur-next-error&lt;/code&gt; with arg -1 and use it along with &lt;code&gt;occur-next-error&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-05-20T17:18:50.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22389" PostTypeId="1" AcceptedAnswerId="22392" CreationDate="2016-05-20T17:30:36.927" Score="2" ViewCount="2142" Body="&lt;p&gt;I am running emacs on Windows. I've been using the right alt key as my meta key for just about everything and it works except for &lt;code&gt;M-&amp;lt;&lt;/code&gt; and &lt;code&gt;M-&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I attempt &lt;code&gt;M-&amp;lt;&lt;/code&gt; I get a message in the mini-buffer that says &quot;Marker stack is empty&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-&amp;gt;&lt;/code&gt; seems to initiate a prompt of some kind for a tags related command &quot;Visit tags table (default TAGS):&quot; and I then have to C-g out of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like I'm missing something really simple but I haven't turned up anything on here or google based on the results I'm getting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="12092" LastEditorUserId="25" LastEditDate="2016-05-20T20:31:12.617" LastActivityDate="2016-05-20T20:31:12.617" Title="M-&lt; and M-&gt; don't appear to work" Tags="|key-bindings|keyboard-layout|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22390" PostTypeId="1" CreationDate="2016-05-20T18:15:59.363" Score="8" ViewCount="3964" Body="&lt;p&gt;Is there some sort of gantt chart view package/feature for org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to view my headings in the gantt chart (rather then as we see it in agenda), and at least interactively modify those schedule by following operations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;change the start or end date.&lt;/li&gt;&#xA;&lt;li&gt;shift the time range by not changing its length.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9371" LastActivityDate="2020-07-30T23:22:20.153" Title="Is there org-mode gantt view feature/package?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22392" PostTypeId="2" ParentId="22389" CreationDate="2016-05-20T19:19:58.143" Score="4" Body="&lt;p&gt;Sounds like either something has bound those keys to some other commands, or else emacs is actually seeing something other the M-&amp;lt; and M-&gt; when you press the keys on your keyboard.  To find out which, try C-h k (ie, `describe-key'), then press the combination you think is M-&amp;lt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On an emacs that's working normally, you'd see:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;M-&amp;lt; runs the command beginning-of-buffer, which is an interactive&#xA;  compiled Lisp function in `simple.el'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I suspect you'll see either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;emacs thinks you've typed something other than M-&amp;lt;.  In which case, look for other things in the OS or other plugins that might be trying to handle hotkeys or do other clever things between the keyboard and emacs&lt;/li&gt;&#xA;&lt;li&gt;M-&amp;lt; is simply bound to a different function for you.  In which case take a look at your emacs configuration to hunt down what is re-assigning those keys.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Either way you should have a good hint as to what the problem is.&lt;/p&gt;&#xA;" OwnerUserId="12094" LastActivityDate="2016-05-20T19:19:58.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22393" PostTypeId="1" CreationDate="2016-05-20T19:28:03.870" Score="3" ViewCount="300" Body="&lt;p&gt;I use  &lt;code&gt;M-!&lt;/code&gt; to run the command &lt;code&gt;shell-command&lt;/code&gt;. The output will open the buffer in a new window at the bottom. Can I configure it to appear on the right?&lt;/p&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="105" LastEditDate="2016-08-10T21:55:35.663" LastActivityDate="2024-04-03T11:05:55.667" Title="Define the window location of the output of shell command" Tags="|window|shell-command|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22394" PostTypeId="2" ParentId="22390" CreationDate="2016-05-20T19:52:34.543" Score="3" Body="&lt;p&gt;You can export Org to TaskJuggler and do the Gantt chart there. Other alternative is python-gantt, but I never tried it.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-taskjuggler.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/org-taskjuggler.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2015-01/msg00243.html&quot; rel=&quot;nofollow&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2015-01/msg00243.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10321" LastActivityDate="2016-05-20T19:52:34.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22395" PostTypeId="2" ParentId="22329" CreationDate="2016-05-20T20:04:56.937" Score="1" Body="&lt;p&gt;It sounds like what you want is a function rather than a variable -- evaluating something every time it's accessed is exactly what a function is for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can pass around the symbol for a function, and then apply it later, which I think gets at using it like a variable too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this do what you're asking?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun is-scratch ()&#xA;  (string= (buffer-name) &quot;*scratch*&quot;))&#xA;&#xA;(setq message-generator 'is-scratch)&#xA;&#xA;(message &quot;%s&quot; (apply message-generator nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12094" LastActivityDate="2016-05-20T20:04:56.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22396" PostTypeId="1" AcceptedAnswerId="22398" CreationDate="2016-05-20T20:45:26.293" Score="6" ViewCount="1168" Body="&lt;p&gt;When exporting, links are converted to the relevant format. Is it possible to tell org to simply ignore links and only export their text? (that is, &lt;em&gt;completely&lt;/em&gt; ignoring the link, not including it as plain text)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My case is for exporting to Markdown, but I believe a solution should apply to all export back-ends.&lt;/p&gt;&#xA;" OwnerUserId="10460" LastActivityDate="2016-06-20T04:50:47.207" Title="Export without links" Tags="|org-mode|org-export|hyperlinks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22397" PostTypeId="2" ParentId="18273" CreationDate="2016-05-20T21:00:20.280" Score="-3" Body="&lt;p&gt;Use instead: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_example&#xA;  Foo.&#xA;#+end_example&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you would be able to do &lt;code&gt;org-edit-special&lt;/code&gt; inside the block. &lt;/p&gt;&#xA;" OwnerUserId="12097" LastActivityDate="2016-05-20T21:00:20.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22398" PostTypeId="2" ParentId="22396" CreationDate="2016-05-21T01:32:00.640" Score="4" Body="&lt;p&gt;If there were a general org export option to do so I would expect to see it documented here: &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html#Export-settings&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Export-settings.html#Export-settings&lt;/a&gt;.  Looking directly at the source I don't see an option in the markdown export engine to do so either.  Some options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quick-and-Dirty Solution™&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for the Quick-and-Dirty Solution™.  You can redefine the &lt;code&gt;org-md-link&lt;/code&gt; function.  The function can be trivially simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-md-link (link contents info) contents)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If that breaks something else in your output (unlikely) you can at the very least directly revise the output formatting lines like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;[%s](%s)&quot; contents path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(format &quot;%s&quot; contents path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to preserve the original behavior of the export engine in some circumstances you can register a derived export engine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-define-derived-backend 'my-md 'md&#xA;    :menu-entry&#xA;     '(?M &quot;Export to Markdown without links&quot; (lambda (a s v b) (org-md-export-to-markdown a s v)))&#xA;    :translate-alist '((link . my-org-md-link)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Add a filter which removes the links generated by ox-md (both better and worse)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The org export engine does have a mechanism that allows you a degree of flexibility to control the output of an export.  See &lt;a href=&quot;http://orgmode.org/worg/exporters/filter-markup.html&quot; rel=&quot;nofollow&quot;&gt;Filter Markup&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html&quot; rel=&quot;nofollow&quot;&gt;Advanced Configuration&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun custom-md-link-filter (link backend info)&#xA;  &quot;Rewrite markdown links in export to preserve link text only.&quot;&#xA;  (if (eq backend 'md)&#xA;      (replace-regexp-in-string &quot;\\[\\([^]]*\\)\\]([^)]*)&quot; &quot;\\1&quot; link)&#xA;    link)&#xA;(add-to-list 'org-export-filter-link-functions&#xA;              'custom-md-link-filter)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I agree with you; a potential general org export option would be useful and would appropriately belong in the core export engine, so the translator of the selected export engine wouldn't even get called.  Kudos to you if you submit a feature request (I would +1 that).  If you do submit one-- post a link here for others to track it&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-05-21T03:29:49.207" LastActivityDate="2016-05-21T03:29:49.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22399" PostTypeId="1" AcceptedAnswerId="22403" CreationDate="2016-05-21T03:46:00.257" Score="0" ViewCount="70" Body="&lt;p&gt;I'm having trouble finding where the problem here is exactly. The result I'd like returned is a string that looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. (n,adj-no) occupation&#xA;2. business&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My function is here and it looks like something is supposed to be a list but isn't.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun japanese-get-definition (dictentry)&#xA;  &quot;Get a definition from a dictionary entry.&quot;&#xA;  (let* (index 1)&#xA;    (save-match-data&#xA;      (and (string-match &quot;/\\(.*?\\)$&quot; dictentry)&#xA;           (setq definitions (split-string (match-string 1 dictentry) &quot;/&quot; t))&#xA;           (dolist (definition definitions)&#xA;             (setq definition (concat (int-to-string index) &quot;. &quot; definition))&#xA;             (setq index (+ index 1)))&#xA;           (mapconcat 'identity&#xA;                      definitions&#xA;                      &quot;\n&quot;))&#xA;      )&#xA;    )&#xA;  )&#xA;(japanese-get-definition &quot;職業 [しょくぎょう] /(n,adj-no) occupation/business/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="105" LastEditDate="2016-05-21T06:04:29.647" LastActivityDate="2016-05-21T06:22:35.457" Title="Having trouble pinpointing this error wrong argument listp 1" Tags="|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22400" PostTypeId="1" CreationDate="2016-05-21T04:40:26.133" Score="9" ViewCount="1871" Body="&lt;p&gt;I want Emacs to auto-save a buffer or buffers so that I don't have to press &lt;code&gt;C-x C-s&lt;/code&gt; each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;auto-save&lt;/code&gt; turned on, I see the label &lt;code&gt;&quot;Auto-saving.... Done&quot;&lt;/code&gt;, which appears once in 30 seconds or so.  But why is the document still not saved? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the label &lt;code&gt;&quot;Auto-saving.... Done&quot;&lt;/code&gt; appears, there are still &lt;code&gt;**&lt;/code&gt; which means the buffer I am working on has not been saved. If so, then what is &lt;code&gt;&quot;Auto-saving.... Done&quot;&lt;/code&gt; really saving?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/19Gs3.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/19Gs3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11957" LastEditorUserId="7045" LastEditDate="2016-05-22T15:41:10.627" LastActivityDate="2016-05-22T15:41:10.627" Title="How to autosave a buffer to the original file on disk?" Tags="|auto-save|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22401" PostTypeId="2" ParentId="22377" CreationDate="2016-05-21T05:09:36.367" Score="1" Body="&lt;p&gt;The issue seems to be the inability of Emacs 24.3 to handle RSA token passcode request. To solve this issue I upgraded to Emacs 24.5 employing &lt;a href=&quot;http://linuxbrew.sh/&quot; rel=&quot;nofollow&quot;&gt;Linuxbrew&lt;/a&gt; as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install linuxbrew/xorg/xorg&#xA;brew install emacs --with-x11 --with-gnutls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This enabled the installation of Emacs 24.5 in the &lt;code&gt;~/.linuxbrew&lt;/code&gt; path which now prompts for the passcode and in turn is able to access the remote files.&lt;/p&gt;&#xA;" OwnerUserId="8683" LastActivityDate="2016-05-21T05:09:36.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22402" PostTypeId="2" ParentId="22400" CreationDate="2016-05-21T05:51:06.363" Score="5" Body="&lt;p&gt;From the Emacs manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Auto-saving does not normally save in the files that you visited,&#xA;  because it can be very undesirable to save a change that you did not&#xA;  want to make permanent.  Instead, auto-saving is done in a different&#xA;  file called the &quot;auto-save file&quot;, and the visited file is changed only&#xA;  when you request saving explicitly (such as with ‘C-x C-s’).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, auto-saving saves a &lt;em&gt;copy&lt;/em&gt; of your work (your buffer), under a different file name. It does not save the buffer you are editing to the disk file it is visiting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read the sections of the manual about this to understand more, starting with node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save.html&quot; rel=&quot;noreferrer&quot;&gt;Auto Save&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find this information yourself, by &lt;em&gt;asking Emacs&lt;/em&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h r&lt;/code&gt;&lt;/strong&gt; opens the Emacs manual. Then &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt; searches the index, using completion, for index entries you type. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, &lt;code&gt;i auto save RET&lt;/code&gt; takes you directly to node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save.html&quot; rel=&quot;noreferrer&quot;&gt;Auto Save&lt;/a&gt;. But &lt;code&gt;i auto TAB&lt;/code&gt; shows you all of the index entries that start with &lt;code&gt;auto&lt;/code&gt;. Besides the entry &lt;code&gt;Auto Save Mode&lt;/code&gt; (and some entries that have nothing to do with auto-saving) you see several entries that start with &lt;code&gt;auto-save&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;auto-save for remote files&#xA;auto-save-default&#xA;auto-save-file-name-transforms &#xA;auto-save-interval&#xA;auto-save-list-file-prefix&#xA;auto-save-mode&#xA;auto-save-timeout &#xA;auto-save-visited-file-name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Choose any of them to visit the relevant manual node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Experiment a bit to get familiar with using &lt;code&gt;i&lt;/code&gt;.  You can also search the entire manual using &lt;code&gt;C-s&lt;/code&gt; (incremental search).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-21T06:01:49.120" LastActivityDate="2016-05-21T06:01:49.120" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22403" PostTypeId="2" ParentId="22399" CreationDate="2016-05-21T06:05:31.093" Score="3" Body="&lt;p&gt;You have the wrong syntax for &lt;code&gt;let*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;(let* ((index 1))...)&lt;/code&gt; to bind variable &lt;code&gt;index&lt;/code&gt; to the value &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-h f let* RET&lt;/code&gt; to see a description of &lt;code&gt;let*&lt;/code&gt;.  Use &lt;code&gt;C-h S let* RET&lt;/code&gt; to read more about it in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And always read (and report) the exact error message that you get. It's meant to help you.  If you get a debugger backtrace, report that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize option &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; to enter the debugger automatically when an error occurs. Use &lt;code&gt;C-h S debug-on-error&lt;/code&gt; to read about this in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the error message told you that Emacs was expecting a list (tested by predicate &lt;code&gt;listp&lt;/code&gt;), and instead it received the number &lt;code&gt;1&lt;/code&gt;. That is a hint that you are using the wrong syntax. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;let*&lt;/code&gt; comes a list of bindings or implicit bindings (to &lt;code&gt;nil&lt;/code&gt;).  You have a list, whose first element is the symbol &lt;code&gt;index&lt;/code&gt;. This is interpreted as an implicit binding of variable &lt;code&gt;index&lt;/code&gt; to the value &lt;code&gt;nil&lt;/code&gt;. The second element of your list is the number &lt;code&gt;1&lt;/code&gt;, which is neither a symbol (an implicit binding to &lt;code&gt;nil&lt;/code&gt; of the symbol as a variable) nor a list (an explicit binding of a symbol to an explicit value).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-21T06:22:35.457" LastActivityDate="2016-05-21T06:22:35.457" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22404" PostTypeId="2" ParentId="2294" CreationDate="2016-05-21T10:17:38.403" Score="1" Body="&lt;p&gt;I use make-buffer-sticky() function of @itsjeyd and change something. Here are i did:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I make new face by: &lt;code&gt;(make-face 'mode-line-sticky-face)&lt;/code&gt;&#xA;Then, in make-buffer-sticky() function i change to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-buffer-sticky ()&#xA;  &quot;Make the current window always display this buffer.&quot;&#xA;  (interactive)&#xA;  (let* ((window (get-buffer-window (current-buffer)))&#xA;         (dedicated? (window-dedicated-p window)))&#xA;    (if (not dedicated?)&#xA;        (progn&#xA;          (face-remap-add-relative 'mode-line-sticky-face&#xA;                                   '(:foreground &quot;#8BE03C&quot;))&#xA;          (message &quot;Window '%s' is sticky now&quot; (current-buffer))&#xA;          )&#xA;      (progn&#xA;        (face-remap-add-relative 'mode-line '(:background &quot;#0D1011&quot;))&#xA;        (message &quot;window '%s' is normal&quot; (current-buffer))&#xA;        ))&#xA;    (set-window-dedicated-p window (not dedicated?))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a customization mode line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA; '(&#xA;   ;; Sticked mode line&#xA;   (:eval&#xA;    (let* ((window (get-buffer-window (current-buffer)))&#xA;           (sticky? (window-dedicated-p window)))&#xA;      (cond (sticky?&#xA;             (propertize &quot;  ⚡&quot; 'face 'mode-line-sticky-face))&#xA;            (t &quot;&quot;))))&#xA;   ;; Position, including warning for 78 columns&#xA;   (:propertize &quot;%4l :&quot; face mode-line-position-face)&#xA;   (:eval (propertize &quot;%3c &quot; 'face&#xA;                      (if (&amp;gt; (current-column) 78)&#xA;                          'mode-line-78col-face&#xA;                        'mode-line-position-face)))&#xA;   ;; emacsclient [default -- keep?]&#xA;   mode-line-client&#xA;   &quot;  &quot;&#xA;   ;; read-only or modified status&#xA;   (:eval&#xA;    (cond (buffer-read-only&#xA;           (propertize &quot; RO &quot; 'face 'mode-line-read-only-face))&#xA;          ((buffer-modified-p)&#xA;           (propertize &quot; ** &quot; 'face 'mode-line-modified-face))&#xA;          (t &quot;      &quot;)))&#xA;   &quot;    &quot;&#xA;   ;; directory and buffer/file name&#xA;   (:propertize (:eval (shorten-directory default-directory 30))&#xA;                face mode-line-folder-face)&#xA;   (:propertize &quot;%b&quot;&#xA;                face mode-line-filename-face)&#xA;   ;; narrow [default -- keep?]&#xA;   &quot; %n &quot;&#xA;   ;; mode indicators: vc, recursive edit, major mode, minor modes, process, global&#xA;   (vc-mode vc-mode)&#xA;   &quot;  %[&quot;&#xA;   (:propertize mode-name&#xA;                face mode-line-mode-face)&#xA;   &quot;%] &quot;&#xA;   (:eval (propertize (format-mode-line minor-mode-alist)&#xA;                      'face 'mode-line-minor-mode-face))&#xA;   (:propertize mode-line-process&#xA;                face mode-line-process-face)&#xA;   (global-mode-string global-mode-string)&#xA;   &quot;    &quot;&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see detail at the commit in my repo at &lt;a href=&quot;https://github.com/NgaNguyenDuy/emacs/commit/fd04627fd6ff93e75a27aeca31552444fd786928&quot; rel=&quot;nofollow noreferrer&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Screenshot&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sticky:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/tAI0w.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tAI0w.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Sticky:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/h7rwi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/h7rwi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helped. :-)&lt;/p&gt;&#xA;" OwnerUserId="9658" LastEditorUserId="9658" LastEditDate="2016-05-21T10:24:00.080" LastActivityDate="2016-05-21T10:24:00.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22405" PostTypeId="1" AcceptedAnswerId="22413" CreationDate="2016-05-21T11:39:22.040" Score="4" ViewCount="1888" Body="&lt;p&gt;When I have executed &lt;code&gt;(org-narrow-to-subtree)&lt;/code&gt;, how can move between subtrees of the same level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;next/previous heading                             C-c C-n/p&#xA;next/previous heading, same level                 C-c C-f/b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But they don't recognize the same levels as the narrowed subtree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Tree 1&#xA;** Sub 1&#xA;** Sub 2&#xA;* Tree 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If i am at &lt;code&gt;* Tree 1&lt;/code&gt; and do &lt;code&gt;C-x C-n s&lt;/code&gt; is there a way to jump between &lt;code&gt;* Tree 1&lt;/code&gt; and &lt;code&gt;* Tree 2&lt;/code&gt; without first doing &lt;code&gt;C-x C-n w&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2016-05-21T19:24:40.327" LastActivityDate="2019-03-28T16:30:36.747" Title="After executing org-narrow-to-subtree, how do I move between subtrees of the same level?" Tags="|org-mode|navigation|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22406" PostTypeId="1" AcceptedAnswerId="24837" CreationDate="2016-05-21T14:12:39.490" Score="4" ViewCount="2515" Body="&lt;p&gt;For a long long time, my Emacs font definition in &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html#X-Resources&quot; rel=&quot;nofollow&quot;&gt;X Resources&lt;/a&gt; has always been:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;! -------------------------------------------------------------- &amp;amp;ss ---&#xA;! ............................................................ fonts ...&#xA;!Emacs.font:                            6x13&#xA;Emacs.Font:                             fixed&#xA;&#xA;Emacs.Font: fontset-gbsimsun&#xA;Emacs.Fontset-0: -*-*-medium-r-normal--12-*-*-*-*-*-fontset-gbsimsun,\&#xA;ascii:-misc-fixed-medium-r-semicondensed--13-120-75-75-*-60-iso8859-1, \&#xA;chinese-gb2312:-*-simsun-medium-r-normal--12-*-*-*-*-*-gb2312.1980-*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That was set more than 15 years ago, and had never changed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, Emacs has modernized dramatically since, and X is using fontconfig to define fonts, and Chinese encoding has changed from gb2312 to UTF8 as default as well. So, I'm wondering what's the modern fontsets setting for Emacs is to work with Chinese properly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;when give the example, please try not generalize but as specific as possible, assuming that I'm having all the MS default fonts in the system. I.e., please don't give example as &lt;code&gt;&amp;lt;your_font_here&amp;gt;&lt;/code&gt;, but real thing like &lt;code&gt;Microsoft YaHei&lt;/code&gt; etc.&lt;/li&gt;&#xA;&lt;li&gt;the &lt;a href=&quot;http://ergoemacs.org/emacs_manual/elisp/Fontsets.html&quot; rel=&quot;nofollow&quot;&gt;Fontsets from ergoemacs&lt;/a&gt; is still giving gb2312 as the example. &lt;/li&gt;&#xA;&lt;li&gt;yet I can't get much from &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Fontsets.html&quot; rel=&quot;nofollow&quot;&gt;GNU fontset docs&lt;/a&gt; either&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;PS. I'm currently configuring my &lt;em&gt;new&lt;/em&gt; &lt;strong&gt;Ubuntu 16.04 LTS Xenial&lt;/strong&gt; environment, and for the first time, I've come to the point to be satisfied with my &lt;a href=&quot;https://gist.github.com/suntong/a532d5136713a7f1c67a3f118cc0d51c#file-ubuntu-md&quot; rel=&quot;nofollow&quot;&gt;Ubuntu 中文设置&lt;/a&gt;. My Emacs is the last problem to conquer. &lt;/p&gt;&#xA;" OwnerUserId="4089" LastEditorUserId="253" LastEditDate="2016-07-25T14:42:15.473" LastActivityDate="2017-02-27T10:13:54.483" Title="How to set Chinese fonts in modern Emacs" Tags="|fonts|utf-8|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22407" PostTypeId="1" AcceptedAnswerId="22495" CreationDate="2016-05-21T15:36:48.463" Score="4" ViewCount="1082" Body="&lt;p&gt;I have long paths and filenames showing in my helm session and I want to quickly look at one and then go back to the normal view.  You can see my long paths and filenames below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qqsOv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qqsOv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several related things that helm will do.  One of them is &lt;code&gt;C-] Toggle Details&lt;/code&gt;, which gives toggles the view (starting with the above) shown below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hbRPJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hbRPJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only shows the full filenames though, and I also want to view the paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option in GUI emacs is to mouseover a result, but the path is so long that the hover text goes off the screen ('fml', nothing worse than thinking you've been saved by contextual hover menu/text, which then jumps off the screen anyway :D)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you can both &lt;a href=&quot;https://emacs.stackexchange.com/questions/485/how-to-widen-helm-buffer-names-in-helm-buffers-list&quot;&gt;widen columns&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/490/how-to-truncate-buffer-information-in-helm-list&quot;&gt;toggle truncated lines&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That last one is important, because what I want to do, ideally, is toggle truncation for a selection of lines (or just the current line) with a key command.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2022-09-08T18:41:01.713" Title="View a whole file name or path in helm buffer" Tags="|helm|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22408" PostTypeId="1" AcceptedAnswerId="22414" CreationDate="2016-05-21T15:58:39.233" Score="1" ViewCount="1105" Body="&lt;p&gt;I'm trying to prepend each substring of &lt;code&gt;split-string&lt;/code&gt; with numbering (1.,2.,3.,..) then return all the substrings concatenated with a newline &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun japanese-get-definition (dictentry)&#xA;  &quot;Get a definition from a dictionary entry.&quot;&#xA;  (let* ((index 1)&#xA;         (definitions))&#xA;    (save-match-data&#xA;      (and (string-match &quot;/\\(.*?\\)$&quot; dictentry)&#xA;           (setq definitions (split-string (match-string 1 dictentry) &quot;/&quot; t))&#xA;           (dolist (definition definitions)&#xA;             (setq definition (concat (int-to-string index) &quot;. &quot; definition))&#xA;             (setq index (+ index 1)))&#xA;           (mapconcat 'identity&#xA;                      definitions&#xA;                      &quot;\n&quot;))&#xA;      )&#xA;    )&#xA;  )&#xA;&#xA;(japanese-get-definition &quot;職業 [しょくぎょう] /(n,adj-no) occupation/business/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the result would looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. (n,adj-no) occupation&#xA;2. business&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently though the function is returning nil. Is dolist the right function to use? This would probably be very easy if I just use a new list, but I'm hoping to use learn the best way to do this (which I &lt;em&gt;think&lt;/em&gt; (could be wrong) is modifying the existing list so less memory is used)&lt;/p&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="105" LastEditDate="2022-09-18T17:34:58.113" LastActivityDate="2022-09-18T17:34:58.113" Title="Dolist not modifying the list" Tags="|elisp|list|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22410" PostTypeId="2" ParentId="22273" CreationDate="2016-05-21T16:49:10.660" Score="0" Body="&lt;p&gt;After bisecting my Emacs configuration, I found the culprit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remove the &lt;code&gt;(setq server-socket-dir &quot;your-path&quot;)&lt;/code&gt; from your configuration.&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-05-21T16:49:10.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22411" PostTypeId="2" ParentId="22232" CreationDate="2016-05-21T17:57:30.660" Score="0" Body="&lt;p&gt;Well I have a &quot;good-enough-until-I-get-something-better&quot; solution. The solution is a batch file, that when executed in a folder puts the foldername at the first level of an org-file and the name of the contained text files in the second level. Under every name of a text file is the content of it. Batch is mostly written by somebody else, for some other merging purpose, but I managed to alter it that it works a bit the way I need it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Any improvement/fix/better solution still more than welcomed.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for %%* in (.) do (echo * %%~nx* &amp;gt;&amp;gt; output.org)&#xA;for /r %%i in (*.txt , *.cfg) do (&#xA;if not %%~nxi == output.org (&#xA;echo ** %%~nxi &amp;gt;&amp;gt; output.org&#xA;type &quot;%%i&quot; &amp;gt;&amp;gt; output.org&#xA;echo. &amp;gt;&amp;gt; output.org&#xA;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11055" LastActivityDate="2016-05-21T17:57:30.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22412" PostTypeId="1" AcceptedAnswerId="24390" CreationDate="2016-05-21T18:18:02.437" Score="1" ViewCount="620" Body="&lt;p&gt;I invested a lot of time to get a Windows file association working with cygwin emacsclient-w32. But every &quot;solution&quot; has some dead end that I can't solve. Any help really appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want is a simple file association for .cfg and .txt files to be opened by cygwin emacsclient-w32 (gui-version). The association has to work for local drive pathes and UNC pathes. What command will do the job?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start at the basic. Command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;C:\cygwin64\bin\run.exe&quot; emacsclient-w32 &quot;%1&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Gets me &lt;code&gt;/cygdrive/c/Users/MYUSERNAME/Desktop/C:\Users\MYUSERNAME\Desktop\myfile.cfg&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Drag and dropping files works. Doesn't result in the path problem above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I even tried cygpath. Problem there was that for UNC pathes there was one missing leading slash. When I add it local files were broken. The cygpath try looked like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C:\cygwin64\bin\bash.exe -c &quot;emacsclient-w32 $(cygpath -u '%L')&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11055" LastActivityDate="2016-07-18T17:16:16.760" Title="File association with cygwin emacs-w32" Tags="|microsoft-windows|cygwin|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22413" PostTypeId="2" ParentId="22405" CreationDate="2016-05-21T19:44:28.040" Score="6" Body="&lt;p&gt;If what you want to &lt;strong&gt;move the narrowing&lt;/strong&gt; along with point to the next subtree, you can define a command that does that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-narrow-forward ()&#xA;  &quot;Move to the next subtree at same level, and narrow to it.&quot;&#xA;  (interactive)&#xA;  (widen)&#xA;  (org-forward-heading-same-level 1)&#xA;  (org-narrow-to-subtree))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess you could also simply define a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html#Keyboard-Macros&quot; rel=&quot;noreferrer&quot;&gt;keyboard macro&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-05-21T19:44:28.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22414" PostTypeId="2" ParentId="22408" CreationDate="2016-05-21T21:12:28.803" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;dolist&lt;/code&gt; can have no effect on &lt;code&gt;definitions&lt;/code&gt;. If you remove it from your function you will see that you get a result (but not exactly what you wanted). The &lt;code&gt;mapconcat&lt;/code&gt; is evaluated and does not return &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The result of &lt;code&gt;(setq definitions (split-string (match-string 1 dictentry) &quot;/&quot; t))&lt;/code&gt; in your test example is &lt;code&gt;(&quot;(n,adj-no) occupation&quot; &quot;business&quot;)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;mapconcat&lt;/code&gt; applied to that would give &lt;code&gt;&quot;(n,adj-no) occupation\nbusiness&quot;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;dolist&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, so the &lt;code&gt;mapconcat&lt;/code&gt; is never evaluated.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you wrap your &lt;code&gt;dolist&lt;/code&gt; with &lt;code&gt;(progn ... t)&lt;/code&gt; then the &lt;code&gt;mapconcat&lt;/code&gt; will be evaluated.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But your main problem is thinking that &lt;code&gt;dolist&lt;/code&gt; modifies the original list. As explained in the &lt;a href=&quot;https://stackoverflow.com/a/36209218/729907&quot;&gt;post you cited&lt;/a&gt; in your other question, you can use &lt;code&gt;dolist&lt;/code&gt; to modify individual elements of the list but not the list itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the list had particular strings or lists as its elements, you could modify those individual objects.  (The individual elements of the list must of course be modifiable, for you to modify them. You cannot modify numbers, for example.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in your case you want to modify the list itself.  You want to replace a given element with a completely different value -- that is, replace it &lt;strong&gt;&lt;em&gt;in the list&lt;/em&gt;&lt;/strong&gt;.  That's not the same as modifying an element (which changes the value globally).  You cannot do that with &lt;code&gt;dolist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's one quick, ugly-hacky way to do what you want.  It doesn't change your code much.  It just replaces the &lt;code&gt;dolist&lt;/code&gt; by some code that modifies &lt;code&gt;definitions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun japanese-get-definition (dictentry)&#xA;  &quot;Get a definition from a dictionary entry.&quot;&#xA;  (let* ((index 1)&#xA;         (definitions))&#xA;    (save-match-data&#xA;      (and (string-match &quot;/\\(.*?\\)$&quot; dictentry)&#xA;           (setq definitions (split-string (match-string 1 dictentry) &quot;/&quot; t))&#xA;           (let ((defs  definitions))&#xA;             (while defs&#xA;               (setcar defs (concat (int-to-string index) &quot;. &quot; (car defs)))&#xA;               (setq index  (1+ index)&#xA;                     defs   (cdr defs)))&#xA;             t)&#xA;           (mapconcat 'identity definitions &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is slightly simpler, but still not very pretty:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun japanese-get-definition (dictentry)&#xA;  &quot;Get a definition from a dictionary entry.&quot;&#xA;  (let* ((index       1)&#xA;         (definitions ()))&#xA;    (save-match-data&#xA;      (when (string-match &quot;/\\(.*?\\)$&quot; dictentry)&#xA;        (setq definitions  (split-string (match-string 1 dictentry) &quot;/&quot; t))&#xA;        (let ((defs  definitions))&#xA;          (while defs&#xA;            (setcar defs (concat (int-to-string index) &quot;. &quot; (car defs)))&#xA;            (setq index  (1+ index)&#xA;                  defs   (cdr defs))))&#xA;        (mapconcat 'identity definitions &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-05-21T21:35:11.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22416" PostTypeId="2" ParentId="22408" CreationDate="2016-05-21T21:48:57.653" Score="2" Body="&lt;p&gt;Thank you Drew for the explanation on what I was doing wrong. Another way to approach the problem (thanks tali713) is with a lambda in mapconcat&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun japanese-get-definition (dictentry)&#xA;  &quot;Get a definition from a dictionary entry.&quot;&#xA;  (let ((index 0))&#xA;    (mapconcat (lambda (str) (format &quot;%s. %s&quot; (incf index) str))&#xA;               (split-string dictentry &quot;/&quot; t)&#xA;               &quot;\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for a much cleaner solution.&lt;/p&gt;&#xA;" OwnerUserId="11700" LastActivityDate="2016-05-21T21:48:57.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22417" PostTypeId="1" CreationDate="2016-05-22T00:52:21.897" Score="4" ViewCount="141" Body="&lt;p&gt;Let's say, If I have a directory variable named &lt;code&gt;a-directory&lt;/code&gt; with its value. Also I have another variable named &lt;code&gt;b-directory&lt;/code&gt; which gets its value from the previous variable. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq a-directory &quot;C:/Users/Paper&quot;)&#xA;(setq b-directory (expand-file-name &quot;org-mode.org&quot; a-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Every time when I change the value of &lt;code&gt;a-directory&lt;/code&gt;, I need to &lt;code&gt;eval&lt;/code&gt; the &lt;code&gt;b-directory&lt;/code&gt; again to get its new value. So here comes the question: How can I get the updated value without evaling &lt;code&gt;b-directory&lt;/code&gt; when changing the value of &lt;code&gt;a-directory&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="105" LastEditDate="2016-05-22T13:48:31.853" LastActivityDate="2016-05-23T02:53:54.670" Title="Update variable value without eval again" Tags="|variables|" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22418" PostTypeId="1" CreationDate="2016-05-22T02:05:25.457" Score="0" ViewCount="611" Body="&lt;p&gt;I updated magit today using el-get.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I defined a function,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;c&quot; &#xA;  (lambda () (interactive) (call-interactively 'self-insert-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I couldn't use &lt;code&gt;c c&lt;/code&gt; magit status buffer to commit. I get the following *message* buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;funcall-interactively: Buffer is read-only: #&amp;lt;buffer *magit-commit-popup*&amp;gt;&#xA;enter code here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a proper way for user defined functions in magit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that defining minor-mode doesn't solve my problem as I want to bind functions in global map.&lt;/p&gt;&#xA;" OwnerUserId="8530" LastEditorUserId="306" LastEditDate="2016-05-22T17:57:16.637" LastActivityDate="2016-05-22T17:57:16.637" Title="In magit, is there a way to use user defined functions on global-map?" Tags="|key-bindings|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22419" PostTypeId="1" CreationDate="2016-05-22T03:29:46.867" Score="11" ViewCount="1809" Body="&lt;p&gt;How do &lt;code&gt;git commit -p&lt;/code&gt; in magit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not have this section in man page &lt;/p&gt;&#xA;" OwnerUserId="12106" LastActivityDate="2021-05-11T09:27:28.990" Title="Use `git commit -p` or `git add -p` with magit" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22420" PostTypeId="2" ParentId="22419" CreationDate="2016-05-22T04:15:56.557" Score="12" Body="&lt;p&gt;The status buffer will show the unstaged changes.  Move point to the&#xA;changes that you want to stage, and call &lt;code&gt;magit-stage&lt;/code&gt; (&lt;kbd&gt;s&lt;/kbd&gt;).&#xA;If you want to stage a subset of changes within a single hunk, you can&#xA;select the lines with the region before calling &lt;code&gt;magit-stage&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://magit.vc/manual/magit/Staging-and-Unstaging.html#Staging-and-Unstaging&quot; rel=&quot;nofollow noreferrer&quot;&gt;&amp;quot;Staging and unstaging&amp;quot; section&lt;/a&gt; of the manual for more&#xA;information.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="15342" LastEditDate="2021-05-11T09:27:28.990" LastActivityDate="2021-05-11T09:27:28.990" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22421" PostTypeId="2" ParentId="22418" CreationDate="2016-05-22T11:07:42.947" Score="2" Body="&lt;p&gt;When you press &lt;kbd&gt;c c&lt;/kbd&gt; to create a commit from inside a Magit buffer, this is what happens:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first &lt;kbd&gt;c&lt;/kbd&gt; constitutes a complete key binding, established in &lt;code&gt;magit-mode-map&lt;/code&gt;. The bound command is &lt;code&gt;magit-commit-popup&lt;/code&gt;, which shows the commit popup in a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second &lt;kbd&gt;c&lt;/kbd&gt; also is a complete key binding. It is invoked while the popup buffer is already the current buffer, and it is established in &lt;code&gt;magit-popup-mode-map&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key magit-popup-mode-map [remap self-insert-command]&#xA;  'magit-invoke-popup-action)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I.e. whenever a key would be bound to &lt;code&gt;self-insert-command&lt;/code&gt; without this binding, then bind it to &lt;code&gt;magit-invoke-popup-action&lt;/code&gt; instead. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Remapping-Commands.html&quot; rel=&quot;nofollow&quot;&gt;Remapping Commands&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because you have mutilated &lt;kbd&gt;c&lt;/kbd&gt;'s binding in &lt;code&gt;global-mode&lt;/code&gt;, that doesn't work anymore. Binding &lt;kbd&gt;c&lt;/kbd&gt; to that lambda has absolutely no benefit. It does the same thing as using &lt;code&gt;self-insert-command&lt;/code&gt; directly would. And that's even the default binding, so binding to that lambda does not even change the behavior in normal circumstances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But using a lambda causes the binding to lose its &quot;identity&quot;, which results in Magit, and all other packages that do remap &lt;code&gt;self-insert-command&lt;/code&gt; (e.g. &lt;code&gt;isearch&lt;/code&gt;) to something else, to break.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should &lt;em&gt;never&lt;/em&gt; override a &lt;code&gt;self-insert-command&lt;/code&gt; binding in &lt;code&gt;global-map&lt;/code&gt;, certainly not for alphanumeric keys.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that defining minor-mode doesn't solve my problem&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Depending on what you actually want to do (please explain what it is), this might be your only option. Sorry.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-05-22T16:27:47.617" LastActivityDate="2016-05-22T16:27:47.617" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22423" PostTypeId="1" CreationDate="2016-05-22T14:19:59.670" Score="1" ViewCount="277" Body="&lt;p&gt;I have made a hierarchial list of headlines in skeleton, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-skeleton myskel-list&#xA;&quot;Insert claim block&quot;  nil&#xA;&quot;* Heading a\n&quot;&#xA;&quot;** Heading aa\n&quot;&#xA;&quot;* Heading b\n&quot;&#xA;&quot;** Heading bb\n&quot;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to insert this skeleton inside a an allready existing headline hierarchy in such av way that the skeleton headings becomes subheadings at the pont I insert it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence if my existing headline hierarchy look like this &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My book&#xA;** Chapter 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I insert my skeleton under &quot;Chapter 1&quot; the result should look like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My book&#xA;** Chapter 1&#xA;*** headline a\n&#xA;**** headline aa\n&#xA;*** headline b\n&#xA;**** headline bb\n &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence, the levels in the skeleton (level 1 and 2) must be added the level of the insert point, in this case level 2, so that &quot;heading a&quot; ends on level 1+2=3, &quot;heading aa&quot; ends up at level 2+2=4, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how can I make a skeleton that add its heading levels to the heading level at the point I insert it? What must be changed in my skeleton code to accomplish this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any suggestings and help.&lt;/p&gt;&#xA;" OwnerUserId="8348" LastActivityDate="2016-06-20T09:10:47.177" Title="Org: how to insert a skeleton with hierarchial list at the right level?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22424" PostTypeId="1" AcceptedAnswerId="22431" CreationDate="2016-05-22T14:53:14.857" Score="2" ViewCount="768" Body="&lt;p&gt;EMMS seems to be completely unaware of any tag / metadata in my music files.  I tried configuring it with mp3info (I no longer want this anyway), and now with libtag, checking that they work in command line, and I have deleted and recreated the cache at &quot;~/.emacs.d/emms/cache&quot; to no avail.  The emms-browser categorises everything as misc and seems to know nothing more than the file names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll detail my configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My init.el has&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;emms configuration&#xA;(require 'emms)&#xA;(require 'emms-setup)&#xA;(emms-all)&#xA;(emms-default-players)&#xA;(setq emms-source-file-default-directory &quot;/Volumes/Seabeam HD/Music/&quot;)&#xA;(require 'emms-info-libtag)&#xA;(setq emms-info-functions '(emms-info-libtag))&#xA;(autoload 'emms-smart-browse &quot;emms-browser.el&quot; &quot;Browse with EMMS&quot; t)&#xA;(global-set-key [(f7)] 'emms-smart-browse)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I installed emms from elpa.  I also cloned the emms git repo and did &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make emms-print-metadata&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and put the binary in my path and tested it  (I also did &lt;code&gt;sudo make install&lt;/code&gt; from here, and hopefully did not mess things up now that I'm running off the elpa version).  It prints id3 tags and other metadata as expected.  In installed &lt;code&gt;mp3info&lt;/code&gt; from macports and tested that too.  Reads id3v1 tags, as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I'm using GUI Emacs.app, so I have &lt;code&gt;exec-path-from-shell&lt;/code&gt; to ensure that emacs finds commands it needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EMMS makes a directory, &quot;~/.emacs.d/emms/&quot; where it stores history, cache, etc.  I deleted this after setting things up for libtag and have also restarted emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read the &lt;a href=&quot;http://www.gnu.org/software/emms/manual/#Using-TagLib&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; and this other &lt;a href=&quot;https://emacs.stackexchange.com/questions/3667/what-are-the-options-to-play-music-from-within-emacs&quot;&gt;emacs.SE&lt;/a&gt; on it...&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2022-11-27T06:26:03.593" Title="EMMS is not displaying tag info with libtag" Tags="|emms|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22425" PostTypeId="2" ParentId="22400" CreationDate="2016-05-22T15:02:37.077" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;So how to make it save a file?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Put this in your init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-save-visited-file-name t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so the saved file and the buffer file are the same. But this increases the risk of losing the file due to failures in autosave. You negate the redundancy gained from autosave. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-05-22T15:02:37.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22426" PostTypeId="1" AcceptedAnswerId="22427" CreationDate="2016-05-22T15:25:26.403" Score="2" ViewCount="1119" Body="&lt;p&gt;I wanted to display a list of strings in the emacs completing-read style, which displays a list of completion strings in a nicely aligned multi-column display. But I could not find an easy answer or example on the web. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, tracing the source of &lt;code&gt;describe-function&lt;/code&gt; I ended up in C code. (I used &lt;code&gt;ESC-x describe-function &quot;table-&quot; TAB TAB&lt;/code&gt; to show a multi-column display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across this SO posting on &lt;a href=&quot;https://emacs.stackexchange.com/questions/7340/reshape-a-list-into-rows/7352#7352&quot;&gt;align-regexp&lt;/a&gt;, which was useful, but it only spoke about keyboard macros. I needed an elisp function for use in code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end I wrote my own function to do the job, after hours spent learning about align-regexp and doing experiments with various args. It always feels like I took too much time to learn something so simple, when I look at the final code. Anyhow, I post my answer here in case someone else can use it one day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I want to solve is to take a 1-column list of strings in a buffer, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;one&#xA;two&#xA;one&#xA;three&#xA;four&#xA;three&#xA;five&#xA;xix&#xA;boxy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and turn it into 2 or more aligned columns like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;one   two&#xA;one   three&#xA;four  three&#xA;five  xix&#xA;boxy &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;one    two   one&#xA;three  four  three&#xA;five   xix   boxy &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would be nice to space out the columns to fill the buffer width better, but that's a separate problem.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-23T22:59:45.330" Title="function to reshape a 1-column buffer list into N-columns with align-regexp" Tags="|text-editing|align|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22427" PostTypeId="2" ParentId="22426" CreationDate="2016-05-22T15:29:30.740" Score="2" Body="&lt;p&gt;Here's my elisp function that shows how to make multiple columns out of a single column. Limitations include list elements cannot have whitespaces, and the width of the columns cannot be adjusted. My elisp code is probably not optimal either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But at least it will be a useful start for the next person who has the problem. It would have saved me quite a few hours if I had found it at the front of my search effort... :-)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun buffer-list-to-columns (ncolumns)&#xA;  &quot;Modify a 1-column stringlist in current buffer into NCOLUMNS aligned columns.&#xA;List of items must begin in buffer column 0, and must not contain&#xA;whitespaces.&quot;&#xA;  (interactive)&#xA;  (let ((cols (1- ncolumns)) result)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (dotimes (i cols)&#xA;        (join-line 1))&#xA;      (while (= 0 (forward-line 1))&#xA;        (dotimes (i cols)&#xA;          (join-line 1)))&#xA;      ;; for N columns, the args are:&#xA;      ;; regexp align whitespace followed by any word character&#xA;      ;; group=1, spacing=nil, repeat for the whole line=t&#xA;      (align-regexp (point-min) (point-max) &quot;\\(\\s-*\\) \\w&quot; 1 nil t)&#xA;      (setq result (buffer-string)))&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-05-22T16:06:16.330" LastActivityDate="2016-05-22T16:06:16.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22428" PostTypeId="1" AcceptedAnswerId="22447" CreationDate="2016-05-22T15:29:53.043" Score="5" ViewCount="4478" Body="&lt;p&gt;I have a piece of legacy code in Python that uses inconsistent tabs - 2 spaces in some instances and 4 in others.  I have my defaults set in my .emacs file to use 4 spaces, but in this case emacs finds the inconsistent spacing and uses a tab width of 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working to update the file in other ways, and I'd like to set the tab width, in this specific file, to 4.  How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12108" LastActivityDate="2020-04-25T03:02:07.830" Title="change python indent in a specific file" Tags="|indentation|python|tabs|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22430" PostTypeId="1" AcceptedAnswerId="22545" CreationDate="2016-05-22T16:37:05.520" Score="2" ViewCount="462" Body="&lt;p&gt;In org mode, i can not use the &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt;&#xA;I have try to rebind it in my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c C-c&quot;) 'org-babel-execute-src-block-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also try &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;    (define (kbd &quot;C-c C-c&quot;) 'org-babel-execute-src-block-maybe))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when i hit the keys in a code block in org mode, nothing (the keybind is not bind to anything).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i hit &lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt; org-babel-execute-src-block-maybe, everything works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;All the &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt; are unbind in org-mode I simply would like to rebind it to its original function.&lt;/p&gt;&#xA;" OwnerUserId="12109" LastEditorUserId="12109" LastEditDate="2016-05-23T10:10:18.677" LastActivityDate="2016-05-25T23:03:09.923" Title="Rebind org-babel-execute-src-block-maybe to C-c C-c" Tags="|org-mode|key-bindings|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22431" PostTypeId="2" ParentId="22424" CreationDate="2016-05-22T20:01:51.167" Score="2" Body="&lt;p&gt;I fixed this by removing &lt;code&gt;~/.emacs.d/elpa/emms-*&lt;/code&gt; and &lt;code&gt;~/.emacs.d/elpa/emms&lt;/code&gt; and installing from the git repo instead of elpa.  I don't know why the method in my original question didn't work but here is a tutorial for how I got the metadata to work.  It basically follows instructions from the &lt;a href=&quot;https://www.gnu.org/software/emms/manual/#Quickstart-Guide&quot; rel=&quot;nofollow noreferrer&quot;&gt;Manual's Quickstart Guide&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;With the same contents of init.el I did &lt;code&gt;git clone git://git.sv.gnu.org/emms.git&lt;/code&gt; in &lt;code&gt;~/.emacs.d/lisp/&lt;/code&gt; and ran &lt;code&gt;make&lt;/code&gt; and &lt;code&gt;sudo make install&lt;/code&gt;.  Previously I had compiled and put the binary for &lt;code&gt;emms-print-metadata&lt;/code&gt; in my executable path variable, and ensured that emacs knows about the same path variable.  I also installed mplayer to play files.&lt;/p&gt;&#xA;&lt;p&gt;Since this is not an elpa package I had to tell emacs where to find it by adding  &lt;code&gt;(add-to-list 'load-path &amp;quot;~/.emacs.d/lisp/emms/lisp/&amp;quot;)&lt;/code&gt; to my init file.  I'll repeat the other part of the configuration with comments to help the next person:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;;;emms configuration ;;; elisp comment ;)&#xA;(require 'emms)      ;;; load emms from &amp;quot;~/.emacs.d/lisp/emms/lisp/&amp;quot;&#xA;                     ;;; i.e., the core functionality&#xA;(require 'emms-setup);;; load some functions that will set some preferences&#xA;                     ;;; it's worth looking at this file&#xA;(emms-all)           ;;; load all stable features of emms, defined in emms-setup&#xA;(emms-default-players);; load a list of default players (like mplayer) installed defined in emms-setup&#xA;(setq emms-source-file-default-directory &amp;quot;/Volumes/Seabeam HD/Music/&amp;quot;)&#xA;(require 'emms-info-libtag) ;;; load functions that will talk to emms-print-metadata which in turn talks to libtag and gets metadata&#xA;(setq emms-info-functions '(emms-info-libtag)) ;;; make sure libtag is the only thing delivering metadata&#xA;;;; below is a nice key command for toggling the music browser&#xA;(autoload 'emms-smart-browse &amp;quot;emms-browser.el&amp;quot; &amp;quot;Browse with EMMS&amp;quot; t)&#xA;(global-set-key [(f7)] 'emms-smart-browse) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I then reloaded init.el / restarted emacs and did &lt;code&gt;M-x emms-add-directory-tree RET RET&lt;/code&gt; (I didn't need to change the default because of emms-source-file-default-directory).  I waited a while and emms playlist buffer started updating tracks as it found the metadata.  Finally I opened emms-browser (f7) and could browse by artist, album, title, etc, and my metadata was all there.&lt;/p&gt;&#xA;&lt;p&gt;I hope this helps someone!&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="2065" LastEditDate="2022-11-27T06:26:03.593" LastActivityDate="2022-11-27T06:26:03.593" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="22432" PostTypeId="2" ParentId="22417" CreationDate="2016-05-22T23:33:37.273" Score="-1" Body="&lt;p&gt;Described behavior similar to &lt;a href=&quot;https://en.wikipedia.org/wiki/Reactive_programming&quot; rel=&quot;nofollow&quot;&gt;reactive programming&lt;/a&gt;, you may found &lt;a href=&quot;https://github.com/inlinestyle/lifted.el&quot; rel=&quot;nofollow&quot;&gt;some&lt;/a&gt; implementations for elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have no experience with them yet. Please, feel free to add usage examples bellow.&lt;/p&gt;&#xA;" OwnerUserId="210" LastEditorUserId="210" LastEditDate="2016-05-23T02:53:54.670" LastActivityDate="2016-05-23T02:53:54.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22433" PostTypeId="1" CreationDate="2016-05-22T23:38:48.500" Score="0" ViewCount="85" Body="&lt;p&gt;I want to evaluate some elisp with batch mode, but it only works in a certain (type-of) buffer.  Specifically&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &quot;(emms-playlist-mode-play-smart)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This command only works on an emms-playlist-mode buffer, so I'd like it to locate one in the current emacs server and execute there.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2016-05-22T23:38:48.500" Title="how do I evaluate elisp in a certain buffer from batch mode?" Tags="|emms|batch-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22434" PostTypeId="1" AcceptedAnswerId="22438" CreationDate="2016-05-22T23:40:41.860" Score="0" ViewCount="339" Body="&lt;p&gt;When accessing remote ftp server with tramp&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x C-f /ftp:user@host#port/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tramp asks me for password. I also use auth-password-store to store passwords in a &lt;code&gt;pass&lt;/code&gt;-compatibale fashion, that is, host is specified in a filename of a gpg-encrypted file containing password on its first line. However, tramp (or maybe it's AngeFtp?) keeps asking for password, even though I've created a &lt;code&gt;host.gpg&lt;/code&gt; file in my password store.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I tried symlinking &lt;code&gt;ftp:user@host.gpg&lt;/code&gt; to the password file.&lt;/li&gt;&#xA;&lt;li&gt;I tried symlinking &lt;code&gt;host#port.gpg&lt;/code&gt; as well as &lt;code&gt;ftp:user@host.gpg&lt;/code&gt; and &lt;code&gt;ftp:user@host#port.gpg&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;auth-password-store and tramp work fine together for &lt;code&gt;C-x C-f /sudo::/&lt;/code&gt; command, that is, it does find the appropriate file in my password-store and requests my gpg password then&lt;/li&gt;&#xA;&lt;li&gt;auth-password-store works fine with symlinks to genuine password files (which is to be expected, I guess?)&lt;/li&gt;&#xA;&lt;li&gt;I tried adding &lt;code&gt;protocol: ftp&lt;/code&gt; record to password file&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How do I make tramp recognise my password-store password? Should I file an issue to tramp, or maybe to AngeFtp developers?&lt;/p&gt;&#xA;" OwnerDisplayName="user12111" LastActivityDate="2019-12-18T13:15:31.370" Title="auth-password-store for ftp over tramp" Tags="|tramp|passwords|ftp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22435" PostTypeId="1" AcceptedAnswerId="22533" CreationDate="2016-05-23T01:56:14.903" Score="6" ViewCount="516" Body="&lt;p&gt;The GitHub page for &lt;code&gt;emacs-racer&lt;/code&gt; shows function signatures in company completion results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Twnl4.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Twnl4.png&quot; alt=&quot;https://github.com/racer-rust/emacs-racer/raw/master/images/racer_completion.png&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My results display &quot;Function&quot; and nothing beyond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hIr4Q.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hIr4Q.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched through &lt;code&gt;customize-group company&lt;/code&gt; and can't find any variables that seem to be relevant. How can I achieve the advertised behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not believe the problem is with the &lt;code&gt;racer&lt;/code&gt; command itself. It works as expected when invoked from the command line, and &lt;code&gt;eldoc-mode&lt;/code&gt; displays correct signatures.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="594" LastEditDate="2016-05-23T16:48:04.717" LastActivityDate="2016-05-25T17:38:24.710" Title="Display documentation in Company results" Tags="|company-mode|rust|racer|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22436" PostTypeId="1" AcceptedAnswerId="22497" CreationDate="2016-05-23T04:01:37.060" Score="2" ViewCount="235" Body="&lt;p&gt;The following works in a separate program terminal window (to copy multiple specified files in the same directory), but the command does not work in Eshell (&lt;strong&gt;No such file or directory&lt;/strong&gt;).  Is there an alternative way of accomplishing this task using Eshell?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cp /Users/HOME/.0.data/.0.emacs/.0.sources/emacs/\&#xA;{buffer.c,\&#xA;buffer.h,\&#xA;dispextern.h,\&#xA;keyboard.c,\&#xA;nsterm.m,\&#xA;w32term.c,\&#xA;window.h,\&#xA;xdisp.c,\&#xA;xterm.c} \&#xA;/Users/HOME/Desktop/emacs/src/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:  What did I try?  I blocked and copied the above text and pasted/yanked it at the command prompt in an &lt;code&gt;*eshell*&lt;/code&gt; buffer, and then I pressed the enter/return key.  What happened?  I received an error message:  &lt;strong&gt;No such file or directory&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-05-23T04:30:10.570" LastActivityDate="2016-05-24T17:36:59.797" Title="How to copy multiple specified files in eshell" Tags="|eshell|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22437" PostTypeId="1" CreationDate="2016-05-23T05:37:19.753" Score="0" ViewCount="127" Body="&lt;p&gt;I'm very new to emacs, but from what I understand it should be able to do almost anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something I have wanted in my IDE for a long time, is a bunch of open files, based on a git branch. I do dev work on a large software project and use feature branches. I constantly switch between different branches, and I will usually close all the open files that are not associated with the current thing I'm working on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, when I switch back to a branch to do some more work, I can never remember what files I was working with. Basically I am after something like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I am working on some branch X&lt;/li&gt;&#xA;&lt;li&gt;I switch to some other branch Y. At this point all the files I had open are closed, and their names are saved ~somewhere~&lt;/li&gt;&#xA;&lt;li&gt;I do some work on Y and switch back to X. All the files I was working on are closed and names saved&lt;/li&gt;&#xA;&lt;li&gt;When branch X is checked out, all the files I had open from the last time I was working on X are opened&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is something like this possible with emacs? Does it already exists? Would it be hard to implement?&lt;/p&gt;&#xA;" OwnerUserId="12113" LastActivityDate="2016-05-23T07:35:18.023" Title="Open set of buffers based on git branch" Tags="|buffers|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22438" PostTypeId="2" ParentId="22434" CreationDate="2016-05-23T06:05:17.810" Score="0" Body="&lt;p&gt;Tramp forwards all ftp-related requests to &lt;code&gt;ange-ftp&lt;/code&gt;. This uses the native ftp client on your local machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, passwords can be stored only in &lt;code&gt;~/.netrc&lt;/code&gt;. I doubt that this will be changed in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastEditorUserId="1979" LastEditDate="2019-12-18T13:15:31.370" LastActivityDate="2019-12-18T13:15:31.370" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22439" PostTypeId="1" AcceptedAnswerId="22449" CreationDate="2016-05-23T06:51:43.733" Score="3" ViewCount="163" Body="&lt;p&gt;For the longest time I have been ignoring a face change at column 80 in my Java code.  The text switches to a pinkish color as shown below.  Now it is sufficiently bothersome that I would like to chase down the cause and fix it to essentially match fill mode column (I use 100, the Google Android convention).  My first question is: is this particular face change controlled by a variable or by elisp code?  Simple searching (within Emacs and external) and experimenting does not reveal the culprit.  My second question, and the more difficult (I believe), is: given a piece of text in Emacs using different faces, how do I find the origin of the font-lock expression controlling that text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9mC0G.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9mC0G.png&quot; alt=&quot;Code with face switch to pink at column 80&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9933" LastActivityDate="2016-05-23T14:14:11.527" Title="How do I find the variable or lisp code controlling a face at a particular column?" Tags="|faces|cc-mode|java|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22441" PostTypeId="2" ParentId="22338" CreationDate="2016-05-23T07:26:14.683" Score="1" Body="&lt;p&gt;AFAIK, there is no 'proper' way of doing this. What I use in such cases is not &lt;code&gt;load&lt;/code&gt; but &lt;code&gt;require&lt;/code&gt;. Every private layer that has such configurations files (features / packages) has a folder named &lt;code&gt;extra&lt;/code&gt;. And I just add that folder to load path using &lt;code&gt;add-to-load-path&lt;/code&gt;. After that I use &lt;code&gt;require&lt;/code&gt; to load configurations inside of &lt;code&gt;:config&lt;/code&gt; just like you use &lt;code&gt;load&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that this might sound like a total overhead, but Spacemacs is about lazy loading and such approach doesn't break this principle. If you don't care about lazy loading - you can force load org and configure without any indentations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it's pretty easy to automate the step where you add &lt;code&gt;extra&lt;/code&gt; folder to &lt;code&gt;load-path&lt;/code&gt; using following snippet.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun d12-layers/add-extra-to-load-path (layer)&#xA;  &quot;Add 'extra' folder to `load-path' for a given LAYER.&#xA;&#xA;Load-path is modified only when such folder exists.&quot;&#xA;  (let* ((layer-path (configuration-layer/get-layer-path layer))&#xA;         (layer-root (format &quot;%s%s/&quot; layer-path layer))&#xA;         (extra-path (concat layer-root &quot;extra/&quot;)))&#xA;    (when (file-exists-p extra-path)&#xA;        (add-to-load-path extra-path))))&#xA;&#xA;(mapc #'d12-layers/add-extra-to-load-path (configuration-layer/get-layers-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This saves you from using layer name somewhere except of list of layers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forgot to say, how to use this. Just put declaration of &lt;code&gt;d12-layers/add-extra-to-load-path&lt;/code&gt; function somewhere in &lt;code&gt;.spacemacs&lt;/code&gt; or &lt;code&gt;$SPACEMACSDIR/init.el&lt;/code&gt; (based on what you're using) and then place following snippet in your &lt;code&gt;dotspacemacs/user-init&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(configuration-layer//declare-layers)&#xA;(mapc #'d12-layers/add-extra-to-load-path&#xA;      (configuration-layer/get-layers-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand that using 'private' &lt;code&gt;configuration-layer//declare-layers&lt;/code&gt; function is far from good, but it's better to setup &lt;code&gt;load-path&lt;/code&gt; &lt;strong&gt;before&lt;/strong&gt; layers are loaded, so we can &lt;code&gt;require&lt;/code&gt; in &lt;code&gt;config.el&lt;/code&gt; and &lt;code&gt;funcs.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5161" LastEditorUserId="5161" LastEditDate="2016-05-23T10:10:34.163" LastActivityDate="2016-05-23T10:10:34.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22442" PostTypeId="2" ParentId="22437" CreationDate="2016-05-23T07:35:18.023" Score="2" Body="&lt;p&gt;I don't have the rep for a comment so sorry for the not really an answer answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd recommend looking into &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html&quot; rel=&quot;nofollow&quot;&gt;sessions&lt;/a&gt; since you then can save (and load) your different sessions and name them after the branch you're working on. That will solve the problem with remembering which files you had open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I tend to not close emacs but just refresh the file after I've done a branch switch. Might not be applicable for you if you have a whole lot of files open.&lt;/p&gt;&#xA;" OwnerUserId="12114" LastActivityDate="2016-05-23T07:35:18.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22443" PostTypeId="2" ParentId="22439" CreationDate="2016-05-23T07:47:24.220" Score="2" Body="&lt;p&gt;How embarrassing.  A few minutes after asking the question, the solution came to me. I might make the case that the asking of the question led to the solution, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, the answer that came to me is that I should find the face description using a character in the pinkish text.  This led to using &lt;code&gt;M-x describe-face&lt;/code&gt; which put a query into the minibuffer: &lt;code&gt;Describe face (default 'whitespace-line'):&lt;/code&gt; Using the default yielded:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Face: whitespace-line (sample) (customize this face)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Documentation:&#xA;Face used to visualize &quot;long&quot; lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See ‘whitespace-line-column’.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Defined in ‘whitespace.el’.&#xA;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;whitespace-line-column&lt;/code&gt; is the variable I was looking for, but do not let this stop you from posting an even better answer.&lt;/p&gt;&#xA;" OwnerUserId="9933" LastActivityDate="2016-05-23T07:47:24.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22444" PostTypeId="2" ParentId="22439" CreationDate="2016-05-23T08:47:03.173" Score="2" Body="&lt;p&gt;I saw that you already solved this, but I thought that I could share the following anyway:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;https://github.com/Lindydancer/font-lock-studio&quot; rel=&quot;nofollow&quot;&gt;Font-lock studio&lt;/a&gt; (an interactive debugger for font-lock keywords) to single step each font-lock rule using the &lt;code&gt;n&lt;/code&gt; command. That way, you can easily see which one caused the problem. If you are lucky and the rule contains a function call (instead of a plain regexp) you have found the culprit. Otherwise, you will have to look through the sources for the package that add the rule.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-05-23T08:47:03.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22445" PostTypeId="1" AcceptedAnswerId="22448" CreationDate="2016-05-23T10:48:46.717" Score="11" ViewCount="1422" Body="&lt;p&gt;A while ago, I installed Emacs from the Ubuntu repositories, and have been using it occasionally. Recently, just for fun, I installed &lt;a href=&quot;http://vrms.alioth.debian.org/&quot;&gt;vrms&lt;/a&gt;, a tool designed to detect non-free software according to the Debian definitions. My system was relatively clean, with only a few packages flagged. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the package &lt;code&gt;emacs24-common-non-dfsg&lt;/code&gt; was among them. This seems a bit odd. As far as I know, Emacs was written by RMS himself, so this confuses me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there indeed ethical issues connected to this package? If so, what are the recommended free replacements?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case there is no reason for this package to be flagged, what are possible causes for the flag?&lt;/p&gt;&#xA;" OwnerUserId="12116" LastEditorUserId="25" LastEditDate="2016-05-23T17:37:26.940" LastActivityDate="2016-05-23T17:37:26.940" Title="A non-free package in Emacs?" Tags="|package|licensing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22446" PostTypeId="1" CreationDate="2016-05-23T11:01:02.913" Score="0" ViewCount="348" Body="&lt;p&gt;Sometimes I can't deactivate the mode of selecting text which is &lt;code&gt;C-SPC&lt;/code&gt;. Even if I press it a second time and move the cursor, the text still gets selected. I press &lt;code&gt;C-SPC&lt;/code&gt; one more time, it activates and selects the text as I move the cursor. Then if I press &lt;code&gt;C-SPC&lt;/code&gt; again and nothing changes except the label says &quot;Mark deactivated&quot; but really it's not. In order to really deactivate, I have to click somewhere in a buffer by mouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug?&lt;/p&gt;&#xA;" OwnerUserId="11957" LastEditorUserId="105" LastEditDate="2016-05-23T14:08:13.047" LastActivityDate="2016-10-21T18:29:25.270" Title="Unable to deactivate the selection mode with C-SPC" Tags="|region|mark|delete-selection-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22447" PostTypeId="2" ParentId="22428" CreationDate="2016-05-23T11:03:14.990" Score="5" Body="&lt;p&gt;One method of setting variables on a per-file basis is to write a local variable specification in the first line of the file.  The details for doing this are in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;noreferrer&quot;&gt;§48.2.4.1 ‘Specifying File Variables’ of the Emacs manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A local variable specification takes the following form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: MODENAME; VAR: VALUE; ... -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can repeat &lt;code&gt;VAR: VALUE;&lt;/code&gt; for as many variables as you want to set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you are using &lt;code&gt;python-mode&lt;/code&gt;, you need to set the variable &lt;code&gt;python-indent-offset&lt;/code&gt; to 4.  Don’t forget to comment out the specification so that the Python interpreter doesn’t attempt to parse it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: python-mode; python-indent-offset: 4 -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can do this by hand, or use &lt;kbd&gt;M&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; &lt;code&gt;add-file-local-variable-prop-line&lt;/code&gt; and Emacs will prompt you for a variable and its value.  It will also take care of commenting out the specification.&lt;/p&gt;&#xA;" OwnerUserId="12087" LastActivityDate="2016-05-23T11:03:14.990" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22448" PostTypeId="2" ParentId="22445" CreationDate="2016-05-23T11:38:07.977" Score="20" Body="&lt;p&gt;You can find information about &lt;a href=&quot;https://packages.debian.org/sid/emacs24-common-non-dfsg&quot;&gt;this package&lt;/a&gt; on the Debian webpage, which includes this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This package contains the architecture independent infrastructure that is not compliant with the Debian Free Software Guidelines. In particular, this includes some of the GNU Emacs info pages, as they are covered under the GFDL, and specify invariant sections.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That is followed by a link to a document which discusses why the GFDL is not compliant with &lt;strong&gt;Debian's&lt;/strong&gt; Free Software Guidelines. &lt;a href=&quot;https://www.debian.org/vote/2006/vote_001&quot;&gt;General Resolution: Why the GNU Free Documentation License is not suitable for Debian main&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The summary from that second page is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The GFDL conflicts with traditional requirements for free software in a variety of ways, some of which are expanded upon below. As a copyleft license, one of the consequences of this is that it is not possible to include content from a document directly into free software under the GFDL.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but you should read the whole thing.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;By the way, I can confirm that the above is an issue. I had to rewrite the Magit v2 manual from scratch because I wanted to be able to freely copy between the manual and doc-strings in the source code, but that would have violated the GFDL used for the Magit v1 manual. This has caused my a lot of unnecessary work and I suggest you don't use GFDL for your own documentation.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-05-23T11:38:07.977" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22449" PostTypeId="2" ParentId="22439" CreationDate="2016-05-23T12:01:57.080" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;describe-char&lt;/code&gt; or &lt;code&gt;C-u C-x =&lt;/code&gt; (= &lt;code&gt;what-cursor-position&lt;/code&gt; with a prefix arg) to obtain a buffer giving as much information as possible about the character at point : font, syntax, properties and, of course, faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not too unlucky, the name of the face will give you the library name that added it.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-05-23T12:01:57.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22450" PostTypeId="2" ParentId="21032" CreationDate="2016-05-23T12:04:13.533" Score="4" Body="&lt;p&gt;I have implement a command that lists known local repositories in a separate buffer on a feature branch, see &lt;a href=&quot;https://github.com/magit/magit/pull/2660&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; pull request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will probably be a while until I finish the documentation and merge this branch into &lt;code&gt;master&lt;/code&gt;, but I think it is quite usable already.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-05-23T12:04:13.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22451" PostTypeId="2" ParentId="22446" CreationDate="2016-05-23T13:59:57.920" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is this a bug?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. To deactivate you have to use &lt;code&gt;C-g&lt;/code&gt; or use one of the commands that operate on the region and deactivate as a side effect. This is described in the manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Whenever the mark is active, you can deactivate it by typing C-g (see Quitting). Most commands that operate on the region also automatically deactivate the mark, like C-x C-u ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="12895" LastEditDate="2016-10-21T18:29:25.270" LastActivityDate="2016-10-21T18:29:25.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22453" PostTypeId="2" ParentId="22439" CreationDate="2016-05-23T14:14:11.527" Score="1" Body="&lt;p&gt;In addition to what @YoungFrog offered, you can often find what a given face is at places where you cannot put the cursor, by using &lt;code&gt;M-x list-faces-display&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will show you &lt;strong&gt;all&lt;/strong&gt; faces currently defined, WYSIWYG, and that will usually enable you to narrow the list of faces that it could be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can become a bit more complicated when faces are merged (combined) or other things are going on. But this should be your second reflex way to check for a face you see, if you cannot use the method mentioned by YoungFrog.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-23T14:14:11.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22454" PostTypeId="1" AcceptedAnswerId="22482" CreationDate="2016-05-23T14:29:51.797" Score="31" ViewCount="2612" Body="&lt;p&gt;The &lt;a href=&quot;https://magit.vc/manual/magit/Stashing.html&quot; rel=&quot;noreferrer&quot;&gt;Magit user manual&lt;/a&gt; includes two sets of &quot;stashing&quot; commands: lower-case commands save a &lt;em&gt;stash&lt;/em&gt;, and upper-case commands save a &lt;em&gt;snapshot&lt;/em&gt;.  After consulting Google and Stack Overflow and the &lt;code&gt;git-stash(1)&lt;/code&gt; man page, I still don't know what the difference is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the difference?&lt;/p&gt;&#xA;" OwnerUserId="9343" LastActivityDate="2018-06-16T16:39:40.910" Title="In Magit, what is the difference between a 'stash' and a 'snapshot'?" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22455" PostTypeId="2" ParentId="22428" CreationDate="2016-05-23T14:55:00.893" Score="3" Body="&lt;p&gt;Unfortunately, you can't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider this piece of code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 0&#xA;if True:&#xA;    x += 1&#xA;  x += 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can't programmatically decide if that block should become this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 0&#xA;if True:&#xA;    x += 1&#xA;    x += 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 0&#xA;if True:&#xA;    x += 1&#xA;x += 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's almost impossible to fix inconsistent spaces with a program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However you can write a simple function to change indentation level of file, say all 2 spaces can be converted to 4 spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I faced the &lt;a href=&quot;https://github.com/jorgenschaefer/elpy/issues/565&quot; rel=&quot;nofollow&quot;&gt;exact problem a year back&lt;/a&gt;. I just indented entire file to 4 spaces using &lt;code&gt;M-x indent-region&lt;/code&gt;. After that I have manually fixed lines which are incorrectly indented.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2016-05-23T14:55:00.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22456" PostTypeId="2" ParentId="12351" CreationDate="2016-05-23T15:09:31.597" Score="1" Body="&#xA;&#xA;&lt;p&gt;Recently I have come up with a cleaner approach that does not need the 1 second delay before checking available fonts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs sessions with frames launched via a daemon (&lt;code&gt;emacsclient -c -a''&lt;/code&gt;), the user emacs config is evaluated &lt;strong&gt;first&lt;/strong&gt; and then the frame is created. The font setup is done by emacs only after the frame is created. So the user cannot have any font check code that is evaluated at the same time when the config is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt;.. there is one hook, &lt;code&gt;focus-in-hook&lt;/code&gt; that is bound to be run when GUI emacs (with frame) is run, whether that frame is created by &lt;code&gt;emacs&lt;/code&gt; or &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below solution is a 3-part solution: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You need to create a &lt;code&gt;setup-font-check.el&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Add some code to your &lt;code&gt;init.el&lt;/code&gt; that requires that font check code only when &lt;code&gt;focus-in-hook&lt;/code&gt; is run.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;(with-eval-after-load 'setup-font-check ..)&lt;/code&gt; when you need to do something font specific in your config.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h1&gt;(1) Font check&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Font Check -- setup-font-check.el   &#xA;(defvar font-symbola-p nil&#xA;  &quot;If non-nil, Symbola font is available on the system. This font is required&#xA;for emoji and other Unicode 6+ display.&quot;)    &#xA;&#xA;(when (find-font (font-spec :name &quot;Symbola&quot;))&#xA;  ;; Manually choose a fallback font for Unicode&#xA;  ;; http://endlessparentheses.com/manually-choose-a-fallback-font-for-unicode.html&#xA;  (set-fontset-font &quot;fontset-default&quot; nil (font-spec :size 20 :name &quot;Symbola&quot;))&#xA;  (setq font-symbola-p t))&#xA;&#xA;(provide 'setup-font-check)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;(2) Requiring &lt;code&gt;setup-font-check&lt;/code&gt; in &lt;code&gt;focus-in-hook&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/font-check ()&#xA;  &quot;Do font check, then remove self from `focus-in-hook'; need to run this just once.&quot;&#xA;  (require 'setup-font-check)&#xA;  (remove-hook 'focus-in-hook #'modi/font-check))&#xA;;; For non-daemon, regular emacs launches, the frame/fonts are loaded *before*&#xA;;; the emacs config is read. But when emacs is launched as a daemon (using&#xA;;; emacsclient, the fonts are not actually loaded until the point when the&#xA;;; `after-make-frame-functions' hook is run. But even at that point, the frame&#xA;;; is not yet selected (for the daemon case). Without a selected frame, the&#xA;;; `find-font' will not work correctly. So we do the font check in&#xA;;; `focus-in-hook' instead by which all the below are true:&#xA;;;  - Fonts are loaded (in both daemon and non-daemon cases).&#xA;;;  - The frame is selected and so `find-font' calls work correctly.&#xA;(add-hook 'focus-in-hook #'modi/font-check)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;(3) And here is how you use that setup in your config&lt;/h1&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Example of customizing the new `Info-quoted' face in emacs 25+&#xA;(with-eval-after-load 'setup-font-check&#xA;  (when font-symbola-p&#xA;    ;; Do something that needs the Symbola font&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;PS: You can also use &lt;code&gt;after-make-frame-functions&lt;/code&gt; hook instead of &lt;code&gt;focus-in-hook&lt;/code&gt;. But that hook is run only when you run &lt;code&gt;emacsclient&lt;/code&gt;, not when you run non-daemon &lt;code&gt;emacs&lt;/code&gt;. Also you need to have &lt;code&gt;(select-frame frame)&lt;/code&gt; in the function you add to that hook.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-05-23T15:09:31.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22457" PostTypeId="2" ParentId="17376" CreationDate="2016-05-23T16:38:42.203" Score="3" Body="&#xA;&#xA;&lt;p&gt;This solution requires installing the &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;bind-key&lt;/code&gt;&lt;/a&gt; package (available on Melpa and also installed as dependency if you install &lt;code&gt;use-package&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concept of &quot;context-aware&quot; bindings is used here. The below code binds &lt;code&gt;C-c SPC&lt;/code&gt; to &lt;code&gt;org-table-blank-field&lt;/code&gt; in the &lt;code&gt;org-mode-map&lt;/code&gt;; &lt;strong&gt;but only&lt;/strong&gt; if &lt;code&gt;org-at-table-p&lt;/code&gt; returns a non-nil value (i.e. when the point is inside an org table). You can learn more about context-aware bindings from &lt;a href=&quot;http://endlessparentheses.com/define-context-aware-keys-in-emacs.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-keys&#xA; :map org-mode-map&#xA; :filter (org-at-table-p)&#xA;  (&quot;C-c SPC&quot; . org-table-blank-field))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I would even go ahead and bind almost all &lt;code&gt;org-table&lt;/code&gt; specific bindings using this &lt;code&gt;:filter&lt;/code&gt; arg:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-keys&#xA; :map org-mode-map&#xA; :filter (org-at-table-p)&#xA;  (&quot;C-c ?&quot; . org-table-field-info)&#xA;  (&quot;C-c SPC&quot; . org-table-blank-field)&#xA;  (&quot;C-c +&quot; . org-table-sum)&#xA;  (&quot;C-c =&quot; . org-table-eval-formula)&#xA;  (&quot;C-c `&quot; . org-table-edit-field)&#xA;  (&quot;C-#&quot; . org-table-rotate-recalc-marks)&#xA;  (&quot;C-c }&quot; . org-table-toggle-coordinate-overlays)&#xA;  (&quot;C-c {&quot; . org-table-toggle-formula-debugger))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-05-23T16:38:42.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22458" PostTypeId="2" ParentId="22436" CreationDate="2016-05-23T16:46:49.880" Score="0" Body="&lt;p&gt;Here is a draft solution based on the helpful comment of @Tobias, which suggests the possibility of using an &lt;code&gt;elisp&lt;/code&gt; form to create the list of files to be copied.  [I added the &lt;code&gt;-p&lt;/code&gt; argument to preserve the filestamps of the files being copied.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I may decide to either turn this into a saved function with arguments for the root directory and a list for the files within that directory; or, I may decide to create a new special eshell function named something like &lt;code&gt;eshell/cp&lt;/code&gt; which can do regular copy stuff or something special if it finds a familiar form of arguments.  [I can't accept my own answer until about 36 hours after posting a question and it's only been about 12 hours so far, so I'll check back.]&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;cp -p&#xA;  (let* (&#xA;      result&#xA;      (basename (file-name-as-directory &quot;/Users/HOME/.0.data/.0.emacs/.0.sources/emacs/&quot;))&#xA;      (files '(buffer.c buffer.h dispextern.h keyboard.c nsterm.m w32term.c window.h xdisp.c xterm.c)) )&#xA;    (dolist (file files)&#xA;      (push (concat basename (format &quot;%s&quot; file)) result))&#xA;    result) /Users/HOME/Desktop/emacs/src/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-05-23T16:46:49.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22459" PostTypeId="1" AcceptedAnswerId="22487" CreationDate="2016-05-23T16:59:38.687" Score="3" ViewCount="710" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/roman/golden-ratio.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;golden-ratio&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;ediff&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want &lt;code&gt;golden-ratio-mode&lt;/code&gt; turned off when using &lt;code&gt;ediff&lt;/code&gt; and turned on after I finish merging with &lt;code&gt;magit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot figure out a way to evenly balance Ediff's windows (A, B and C).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package ediff&#xA;  :ensure nil&#xA;  :init&#xA;  (add-hook 'ediff-before-setup-windows-hook&#xA;            (lambda ()&#xA;              (golden-ratio-mode -1)&#xA;              (balance-windows)))&#xA;  (add-hook 'ediff-cleanup-hook (lambda () (golden-ratio-mode 1)))&#xA;  :config&#xA;  (setq-default&#xA;   ediff-split-window-function 'split-window-horizontally))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2016-05-24T07:51:22.277" LastActivityDate="2016-05-24T22:12:43.077" Title="How can I resize certain windows evenly when using the golden-ratio library?" Tags="|window|ediff|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22460" PostTypeId="1" CreationDate="2016-05-23T17:27:24.030" Score="1" ViewCount="67" Body="&lt;p&gt;Does this functionality exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to add missing metadata top files in my music library, similar to how itunes does it (with Gracenote's CDDB or freedb).&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2016-05-23T17:27:24.030" Title="EMMS fetch music track data from online database like freedb or cddb?" Tags="|emms|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22462" PostTypeId="1" CreationDate="2016-05-23T17:30:09.283" Score="0" ViewCount="85" Body="&lt;p&gt;currently, to narrow down the buffers withshell mode, I'd invoke helm-mini, and then type &quot;shell&quot;. I wonder&#xA;   how can I narrow down the selections using lisp? So I could have a&#xA;   function with a list pre-defined groups for quickly jumps between buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be handy if I work in a R/Python projects.&lt;/p&gt;&#xA;" OwnerUserId="4044" LastActivityDate="2016-05-23T17:30:09.283" Title="helm-mini - narrow down to buffers selection with specified major mode" Tags="|helm|helm-sources|helm-selection|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22463" PostTypeId="5" CreationDate="2016-05-23T17:40:49.693" Score="0" Body="&lt;p&gt;Use this tag for the legalities of using, distributing and modifying code, documentation and other materials of Emacs itself and Emacs packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some questions about these issues may be better suited to &lt;a href=&quot;http://opensource.stackexchange.com/&quot;&gt;Open Source&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-05-23T17:40:49.693" LastActivityDate="2016-05-23T17:40:49.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22464" PostTypeId="4" CreationDate="2016-05-23T17:40:49.693" Score="0" Body="Licensing of Emacs and packages" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-05-23T17:40:49.693" LastActivityDate="2016-05-23T17:40:49.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22465" PostTypeId="1" AcceptedAnswerId="22466" CreationDate="2016-05-23T17:54:12.140" Score="3" ViewCount="240" Body="&lt;p&gt;I want to know what happens if I click on a button (a link) in an Emacs buffer, so I type &lt;code&gt;C-h c&lt;/code&gt; (&lt;code&gt;describe-key-briefly&lt;/code&gt;) and click the button, but all I'm told is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;mouse-2&amp;gt; (translated from &amp;lt;down-mouse-2&amp;gt; &amp;lt;mouse-2&amp;gt;) at that spot runs the command push-button&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h k&lt;/code&gt; (&lt;code&gt;describe-key&lt;/code&gt;) shows me the documentation of &lt;code&gt;push-button&lt;/code&gt;, which is not what I'm after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find out what actually happens when I click, I need to perform the same lookup that &lt;code&gt;push-button&lt;/code&gt; does, and then look at its documentation rather than invoking the function. That is to say, look at the text's &lt;code&gt;action&lt;/code&gt; (or &lt;code&gt;mouse-action&lt;/code&gt; for a mouse click), and run &lt;code&gt;describe-function&lt;/code&gt; on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a &lt;em&gt;convenient&lt;/em&gt; way to do that? Ideally, I'd like &lt;code&gt;describe-key&lt;/code&gt; to show the description of the action in addition to (or even instead of) the description of &lt;code&gt;push-button&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-23T17:56:18.370" Title="Documentation of the action of a button" Tags="|help|buttons|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22466" PostTypeId="2" ParentId="22465" CreationDate="2016-05-23T17:56:18.370" Score="3" Body="&lt;p&gt;Quick and dirty, minimally tested in 24.3 (and probably fails in ancient and future versions because it makes some assumptions about how &lt;code&gt;describe-key&lt;/code&gt; works internally). The following code appends the description of the action to the description of &lt;code&gt;push-button&lt;/code&gt; in the help buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice describe-key&#xA;  (around describe-key-button-action activate compile)&#xA;  &quot;When describing a key that invokes a button, describe the effect of the button.&quot;&#xA;  (let (also-describe-action)&#xA;    (let ((defn (key-binding key t))&#xA;          (is-mouse (and (vectorp key) (mouse-event-p (aref key 0)))))&#xA;      (when (eq defn 'push-button)&#xA;        (setq also-describe-action&#xA;              (let ((button (if is-mouse&#xA;                                (let* ((posn (event-start (aref key 0)))&#xA;                                       (buffer (window-buffer (posn-window posn))))&#xA;                                  (with-current-buffer buffer&#xA;                                    (button-at (posn-point posn))))&#xA;                              (button-at (point)))))&#xA;                (or (and is-mouse (button-get button 'mouse-action))&#xA;                    (button-get button 'action))))))&#xA;    ad-do-it&#xA;    (when (functionp also-describe-action)&#xA;      (with-current-buffer (help-buffer)&#xA;        (save-excursion&#xA;          (goto-char (point-max))&#xA;          (forward-line -1)&#xA;          (let ((standard-output (current-buffer))&#xA;                (buffer-read-only nil))&#xA;            (princ &quot;\f\nPushing the button runs the command &quot;)&#xA;            (princ also-describe-action)&#xA;            (princ &quot;, which is &quot;)&#xA;            (describe-function-1 also-describe-action)&#xA;            (princ &quot;\n\n&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-23T17:56:18.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22467" PostTypeId="2" ParentId="14876" CreationDate="2016-05-23T19:45:40.737" Score="0" Body="&lt;p&gt;There is a trick:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;init.el file&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'comint-highlight-prompt nil&#xA;                    :inherit nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and the trick:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;init_bash.sh file&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PS1=&quot;\[\e[00;32m\]\u\[\e[00m\]@\[\e[00;36m\]\h\[\e[00m\]:\[\e[00;34m\]\w\[\e[00m\]\n\$(printf \&quot;[\[\e[01;31m\]%.*s\[\e[00m\]]\&quot; \$? \$?) \$ &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The trick is the newline. Emacs only erase last line colors.&lt;/p&gt;&#xA;" OwnerUserId="12123" LastActivityDate="2016-05-23T19:45:40.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22468" PostTypeId="1" AcceptedAnswerId="22484" CreationDate="2016-05-23T19:54:17.143" Score="4" ViewCount="5883" Body="&lt;p&gt;In my init file &lt;code&gt;~\AppData\Roaming\.emacs.d&lt;/code&gt; that I created using &lt;code&gt;C-x C-f ~/.emacs.d/init.el RET&lt;/code&gt;&#xA;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives '((&quot;gnu&quot; . &quot;https://elpa.gnu.org/packages/&quot;)&#xA;                         (&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;)&#xA;                         (&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t) ; Org-mode's repository&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;using both https:// and http:// &lt;a href=&quot;https://melpa.org/#/getting-started&quot; rel=&quot;nofollow&quot;&gt;since the Melpa website states there are issues with windows and https&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each time I have edited and saved the file and afterwards (re-)started Emacs.&#xA;Still after &lt;code&gt;C-x list-packages RET&lt;/code&gt; I seem to get the ELPA list only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd really appreciate some help, because I have no idea what I'm doing wrong.&lt;/p&gt;&#xA;" OwnerUserId="12122" LastEditorUserId="35" LastEditDate="2016-05-23T20:14:31.787" LastActivityDate="2016-05-24T14:12:50.877" Title="How do I get MELPA working on my Windows 8 laptop" Tags="|package-repositories|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22469" PostTypeId="2" ParentId="22468" CreationDate="2016-05-23T20:13:17.153" Score="1" Body="&lt;p&gt;I would recommend for Windows (as long as you have 64-bit) downloading the &lt;a href=&quot;https://sourceforge.net/projects/emacsbinw64/&quot; rel=&quot;nofollow&quot;&gt;emacs-w64&lt;/a&gt; distribution as it comes bundled with all of the extra libraries you need to make things like ssl and images work.  Failing that, you can download the latest in &lt;code&gt;gnutls&lt;/code&gt; &lt;a href=&quot;ftp://ftp.gnutls.org/gcrypt/gnutls/w3&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and place the contents of the &lt;code&gt;/bin&lt;/code&gt; directory in the same folder as &lt;code&gt;emacs.exe&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2016-05-23T20:13:17.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22470" PostTypeId="2" ParentId="19386" CreationDate="2016-05-23T20:24:42.147" Score="1" Body="&lt;p&gt;An alternative way. I have been using the following form in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spacemacs|use-package-add-hook org-mode&#xA;  :post-config&#xA;  (progn&#xA;      (setq org-agenda-files '(&quot;c:/Users/USERNAME/Dropbox/Notes/&quot;)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use this form for almost all the layers that I need to customize. It helps to separate my customizations instead of stuffing them all in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;. Perhaps &lt;code&gt;with-eval-after-load&lt;/code&gt; has some advantages, but I do not know.&lt;/p&gt;&#xA;" OwnerUserId="12070" LastActivityDate="2016-05-23T20:24:42.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22471" PostTypeId="2" ParentId="19793" CreationDate="2016-05-23T20:27:38.123" Score="2" Body="&lt;p&gt;You can get rid of the &quot;original value&quot; with &lt;code&gt;(put 'exec-path 'standard-value nil)&lt;/code&gt;.  To discover this, I looked at the source of &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/help-fns.el?id=emacs-24.5#n615&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;describe-variable&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun describe-variable (variable &amp;amp;optional buffer frame)&#xA;  ...&#xA;          (let* ((sv (get variable 'standard-value))&#xA;                 (origval (and (consp sv)&#xA;                               (condition-case nil&#xA;                                   (eval (car sv))&#xA;                                 (error :help-eval-error)))))&#xA;            (when (and (consp sv)&#xA;                       (not (equal origval val))&#xA;                       (not (equal origval :help-eval-error)))&#xA;              (princ &quot;\nOriginal value was \n&quot;)&#xA;              (setq from (point))&#xA;              (pp origval)&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-05-23T20:27:38.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22472" PostTypeId="1" CreationDate="2016-05-23T20:37:18.433" Score="1" ViewCount="256" Body="&lt;p&gt;My org-mode TODO keywords are set as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords&#xA;      '((sequence &quot;NITPICKING(!)&quot; &quot;NITS_SENT(!)&quot; &quot;NITS_DONE(!)&quot; &quot;PROOFS_SENT(!)&quot;&#xA;          &quot;PROOFS_RECEIVED(!)&quot; &quot;ACS_RECEIVED(!)&quot; &quot;ACS_ASSIGNED(!)&quot;&#xA;          &quot;ACS_DONE(!)&quot; &quot;|&quot; &quot;READY(!)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a headline that starts in the &lt;code&gt;NITPICKING&lt;/code&gt; state. Here is what happens:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I press &lt;code&gt;C-c C-t&lt;/code&gt; to call &lt;code&gt;org-todo&lt;/code&gt;. State changes from &lt;code&gt;NITPICKING&lt;/code&gt; to &lt;code&gt;NITS_SENT&lt;/code&gt;, as it should, but syntax highlighting gets lost for that headline. &lt;/li&gt;&#xA;&lt;li&gt;I press &lt;code&gt;C-c C-t&lt;/code&gt; again, it puts me back in the &lt;code&gt;NITPICKING&lt;/code&gt; state, with correct highlighting.&lt;/li&gt;&#xA;&lt;li&gt;I press &lt;code&gt;C-c C-t&lt;/code&gt; again, it puts me in the &lt;code&gt;NITS_SENT&lt;/code&gt; state, now with correct highlighting.&lt;/li&gt;&#xA;&lt;li&gt;Further calls to &lt;code&gt;org-todo&lt;/code&gt; work correctly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So it's just the first transition that's getting screwed up. Here is what the timestamps look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  - State &quot;NITS_SENT&quot;  from &quot;NITPICKING&quot; [2016-05-23 Mon 13:27]&#xA;  - State &quot;NITPICKING&quot; from &quot;&quot;           [2016-05-23 Mon 13:26]&#xA;  - State &quot;NITS_SENT&quot;  from &quot;NITPICKING&quot; [2016-05-23 Mon 13:25]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works properly if I use buffer-local keywords instead of defining &lt;code&gt;org-todo-keywords&lt;/code&gt; in my init file. But this is the global setup that I need, and I'd prefer to do it the way I've done it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something wrong with my code? Why would only get messed up for a single state?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit (in response to @nispio):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior occurs even when I start emacs with &lt;code&gt;emacs -q&lt;/code&gt; and then manually evaluate the &lt;code&gt;setq&lt;/code&gt; command above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some further experimentation, it also seems that the same behavior occurs regardless of the starting state. So, for instance, if I open a &lt;code&gt;.org&lt;/code&gt; file with a headline in the &lt;code&gt;ACS_RECEIVED&lt;/code&gt; state and execute &lt;code&gt;org-todo&lt;/code&gt;, it puts me in the next (&lt;code&gt;ACS_ASSIGNED&lt;/code&gt;) state, but without syntax highlighting; the next execution of &lt;code&gt;org-todo&lt;/code&gt; puts me in the initial (&lt;code&gt;NITPICKING&lt;/code&gt;) state, with proper syntax highlighting, and it works correctly from there.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Further edit: the problem is that the headlines were empty apart from the TODO state. I wanted the headline to be empty to make my agenda view cleaner, since the name of the org file together with the TODO state is all the info I need at a glance. But it seems that having an empty headline means that the TODO state is interpreted as the title, which is why the first call to &lt;code&gt;org-todo&lt;/code&gt; sets me in the initial state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I would like to refine my question to the following: is there any way to have headlines that are empty apart from the TODO state?&lt;/p&gt;&#xA;" OwnerUserId="6692" LastEditorUserId="6692" LastEditDate="2016-05-25T17:30:19.067" LastActivityDate="2016-05-25T17:30:19.067" Title="org-mode TODO items not recognized first time" Tags="|org-mode|todo|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22473" PostTypeId="1" CreationDate="2016-05-23T21:40:56.387" Score="1" ViewCount="104" Body="&lt;p&gt;I generally use auctex to generate PDF documents. However, I now need to generate an RTF file to integrate my contribution into a collaborative Word document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using org-mode, I would like to use natbib citation syntax while I write. I then want to export a document as RTF with a reference list, possibly formatted as they would for a PDF file generated with auctex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I use natbib-style citations and export to RTF?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastEditorUserId="253" LastEditDate="2016-05-23T22:33:13.277" LastActivityDate="2016-05-24T16:42:50.247" Title="Can I combine natbib syntax and export as RTF?" Tags="|org-mode|org-export|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22474" PostTypeId="2" ParentId="22426" CreationDate="2016-05-23T22:59:45.330" Score="3" Body="&lt;p&gt;If you are on a UNIX-type system (Linux, BSD, OSX) you can use the &lt;code&gt;paste&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Select the region in Emacs, then call &lt;code&gt;shell-command-on-region&lt;/code&gt; with an argument (to replace the selection with the result).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, to format into 3 columns, type:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u M-|&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;paste - - -&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-05-23T22:59:45.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22475" PostTypeId="2" ParentId="22338" CreationDate="2016-05-24T00:20:11.700" Score="0" Body="&lt;p&gt;Below is the way set up all my customizations for layers. I am using the &lt;code&gt;.spacemacs.d&lt;/code&gt; directory and the &lt;code&gt;init.el&lt;/code&gt;, but this should also work fine in &lt;code&gt;.spacemacs&lt;/code&gt; file. It does not separate them into their own files, but I like to keep mine all in the init file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spacemacs|use-package-add-hook org-mode&#xA;  :post-config&#xA;  (progn&#xA;      ;; custom settings follow&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12070" LastActivityDate="2016-05-24T00:20:11.700" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22476" PostTypeId="1" AcceptedAnswerId="49075" CreationDate="2016-05-24T00:25:08.593" Score="4" ViewCount="2027" Body="&lt;p&gt;I would like to use org-publish to generate files for a website. I would prefer to do this using the &lt;a href=&quot;https://github.com/kawabata/ox-pandoc&quot; rel=&quot;nofollow&quot;&gt;ox-pandoc&lt;/a&gt; exporter rather than org-mode's own publishing exporters. But I can't quite seem to see how this is done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The org-publish function requires a &lt;code&gt;function (plist filename pub-dir)&lt;/code&gt; format&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun org-pandoc-publish-to-html (plist filename pub-dir)&#xA; &quot;Publish an org file to html using ox-pandoc. Return output file name.&quot;&#xA; (org-publish-org-to 'org-pandoc-export-to-html filename &quot;.html&quot; plist pub-dir))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure what's wrong with the above, but it doesn't work. Specifically, with &lt;code&gt;:publishing-function (org-pandoc-publish-to-html)&lt;/code&gt; set I get the message: &lt;code&gt;unknown &quot;nil&quot; back-end: Aborting export&lt;/code&gt; with no output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: when I change the setting to &lt;code&gt;:publishing-function (org-pandoc-export-to-html)&lt;/code&gt; I get a different message: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Publishing file /Users/Roambot/test/source/pubtest.org using `org-pandoc-export-to-html'&#xA;Initializing asynchronous export process&#xA;Publishing file /Users/Roambot/test/source/pubtest.org using `org-pandoc-export-to-html'&#xA;Process `org-export-process' exited abnormally&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;Org Export Process buffer&lt;/code&gt; reads: &lt;code&gt;Before first headline at position 1 in buffer  *temp*&lt;/code&gt;. I'm not sure what this means.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, publishing works fine for other export functions like &lt;code&gt;org-html-publish-to-html&lt;/code&gt; and ox-pandoc works independently of org-publish.&lt;/p&gt;&#xA;" OwnerUserId="11934" LastEditorUserId="11934" LastEditDate="2016-05-24T16:06:27.497" LastActivityDate="2019-04-23T08:03:36.423" Title="How can I use ox-pandoc as a publishing backend for org files?" Tags="|org-export|org-publish|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22479" PostTypeId="1" AcceptedAnswerId="22488" CreationDate="2016-05-24T07:33:15.803" Score="3" ViewCount="1064" Body="&lt;p&gt;I use most of the setup of &lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot; rel=&quot;nofollow&quot;&gt;http://doc.norang.ca/org-mode.html&lt;/a&gt;. Now I want to clock in to a task by default after startup. Reason/workflow is as follows: every morning I turn on my computer and Emacs starts automatically (via GNOME autostart). In the meantime I get a coffee. And when I'm back at my desk I forget to clock in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried simply calling&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-idle-timer 5 nil 'bh/clock-in-organization-task-as-default)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it doesn't work and throws me an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;byte-code: Before first headline at position 1 in buffer *scratch*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2037" LastEditorUserId="2037" LastEditDate="2016-05-24T11:38:15.717" LastActivityDate="2016-05-24T12:30:06.470" Title="org-mode: automatically clock in to a task with idle-timer" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22482" PostTypeId="2" ParentId="22454" CreationDate="2016-05-24T10:17:47.183" Score="37" Body="&lt;p&gt;Both the &quot;stash&quot; and &quot;snapshot&quot; variants create the same stash objects. The difference is that when you create a snapshot, then the stashed changes are &lt;em&gt;not&lt;/em&gt; removed from the files in the working tree and/or the index. (Just like when you take a snapshot of your friends having a good time - that doesn't cause them to disappear either ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is intended as a backup mechanism of sorts. Say you are performing some complicated refactoring and you just tested and the modified code still appears to work but you are not done yet. Now would be a good time to create a snapshot, so that you have something to go back to if you mess it up later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you could just create a temporary &quot;wip&quot; commit, right on the branch you are working on, to accomplish the same. That's usually what I do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can also automate the process of recording work-in-progress by enabling the &lt;a href=&quot;https://magit.vc/manual/magit/Wip-Modes.html#Wip-Modes&quot; rel=&quot;noreferrer&quot;&gt;Wip modes&lt;/a&gt;. I do have these modes enabled as a safety net, but I still create wip commits directly on the current branch or create a snapshot. Those are easier to work with than the wip refs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Magit comes with its own stash implementation written in Elisp. That was necessary to implement the snapshot variants and the worktree-only and index-only stash variants. Git doesn't provide any of these variants.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="730" LastEditDate="2018-06-16T16:39:40.910" LastActivityDate="2018-06-16T16:39:40.910" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="22483" PostTypeId="2" ParentId="22342" CreationDate="2016-05-24T10:20:01.667" Score="1" Body="&lt;p&gt;Indeed &lt;a href=&quot;https://magit.vc/manual/magit/I-am-using-a-Git-release-older-than-v194.html&quot; rel=&quot;nofollow&quot;&gt;Magit does require at least Git v1.9.4&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-05-24T10:20:01.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22484" PostTypeId="2" ParentId="22468" CreationDate="2016-05-24T10:58:29.743" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=Cf6tRBPbWKs&quot; rel=&quot;noreferrer&quot;&gt;this video&lt;/a&gt; gave me the clue to solve my problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-group RET package RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Expand &quot;Package Archives&quot; then INS&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fill in:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Archive Name: &lt;code&gt;melpa&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and URL or directory name: &lt;code&gt;http://melpa.org/packages/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apply and Save&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(https didn't work)&lt;/p&gt;&#xA;" OwnerUserId="12122" LastEditorUserId="12122" LastEditDate="2016-05-24T11:04:19.507" LastActivityDate="2016-05-24T11:04:19.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22485" PostTypeId="1" AcceptedAnswerId="22486" CreationDate="2016-05-24T11:24:04.783" Score="1" ViewCount="1638" Body="&lt;p&gt;When I export my documents to pdf (as pdf file and open &lt;code&gt;C-c l o&lt;/code&gt;) I get pdf file opened in separate application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pandoc export to docx I do the 'same' (to docx and open &lt;code&gt;C-c p x&lt;/code&gt;) but result file is opened in emacs itself with binary data and all the inner stuff of that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell emacs to open it in msword instead?&lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-05-24T11:41:47.600" Title="org-mode pandoc export to docx and open" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22486" PostTypeId="2" ParentId="22485" CreationDate="2016-05-24T11:41:47.600" Score="6" Body="&lt;p&gt;Well, before asking a question I was searching for about 20 min with no luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right after it was posted I've found an answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; open docx files in default application (ie msword)&#xA;(setq org-file-apps&#xA;      '((&quot;\\.docx\\'&quot; . default)&#xA;        (&quot;\\.mm\\'&quot; . default)&#xA;        (&quot;\\.x?html?\\'&quot; . default)&#xA;        (&quot;\\.pdf\\'&quot; . default)&#xA;        (auto-mode . emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-05-24T11:41:47.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22487" PostTypeId="2" ParentId="22459" CreationDate="2016-05-24T11:53:04.807" Score="4" Body="&lt;p&gt;In fact the code at &lt;a href=&quot;https://github.com/roman/golden-ratio.el/wiki&quot; rel=&quot;nofollow&quot;&gt;https://github.com/roman/golden-ratio.el/wiki&lt;/a&gt; for handling ediff mostly worked; I suspect it was just a little out of date with the current version of &lt;code&gt;golden-ratio&lt;/code&gt;. It's updated now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's using &lt;code&gt;golden-ratio-inhibit-functions&lt;/code&gt; to allow arbitrary elisp to determine whether to resize a given window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In simpler cases than this, one of the following user options would often suffice:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;golden-ratio-exclude-buffer-names&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;golden-ratio-exclude-buffer-regexp&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;golden-ratio-exclude-modes&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-05-24T22:12:43.077" LastActivityDate="2016-05-24T22:12:43.077" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22488" PostTypeId="2" ParentId="22479" CreationDate="2016-05-24T12:30:06.470" Score="3" Body="&lt;p&gt;From knowing that configuration, a good check would be to make sure that &lt;code&gt;bh/organization-task-id&lt;/code&gt; is set to the GUID for your &quot;default task&quot; so that the &lt;code&gt;bh/clock-in-organization-task-as-default&lt;/code&gt; function can correctly find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a test, check that the &quot;ID&quot; property within the &quot;PROPERTIES&quot; drawer in your default task matches the ID in the &lt;code&gt;bh/organization-task-id&lt;/code&gt; variable and ensure that the ID is actually unique. If that ID property is not set then it can be created with &lt;code&gt;M-x org-id-copy&lt;/code&gt; when the point is in the default task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you can make sure that Org-mode can find your default task by that ID by running &lt;code&gt;M-x org-id-goto&lt;/code&gt; and providing that same ID. If it works then the point should jump to your default task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the comment above by the question poster, if the ID is found not to be unique then rebuilding the ID locations cache may be required. That can be accomplished with &lt;code&gt;M-x org-id-update-id-locations&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2016-05-24T12:30:06.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22489" PostTypeId="1" AcceptedAnswerId="22492" CreationDate="2016-05-24T13:00:41.727" Score="7" ViewCount="599" Body="&lt;p&gt;I'm trying to mark a set of files (including subdirectories' files) in dired matching a regex, so I do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-U C-x d&lt;/code&gt; &lt;code&gt;-alR&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt; &lt;code&gt;e:/&lt;/code&gt; &lt;code&gt;RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Followed by &lt;code&gt;%m&lt;/code&gt; and enter my regex.  No matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, I enter the same regex on a &quot;normal&quot; dired (i.e. no -R switch) then the regex matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I doing something wrong?  I've tried with &lt;code&gt;emacs -Q&lt;/code&gt; and get the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems the actual regex is significant; entering &lt;code&gt;\.mp3$&lt;/code&gt; works as expected, but if I try to anchor the regex using &lt;code&gt;^music&lt;/code&gt; marks  everything under the &lt;code&gt;e:/music&lt;/code&gt; folder.&lt;/p&gt;&#xA;" OwnerUserId="727" LastEditorUserId="727" LastEditDate="2016-05-24T13:36:58.923" LastActivityDate="2016-05-28T14:45:46.023" Title="Marking files in dired with subdirectories" Tags="|dired|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22491" PostTypeId="2" ParentId="22468" CreationDate="2016-05-24T14:12:50.877" Score="0" Body="&lt;p&gt;Since you mentioned you can accept http connection without security concern,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives&#xA;        '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;          (&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;)&#xA;          (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-05-24T14:12:50.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22492" PostTypeId="2" ParentId="22489" CreationDate="2016-05-24T14:17:40.343" Score="6" Body="&lt;p&gt;I think this is a bug in Dired (and also in Dired+).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've just fixed it in &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;&#xA;(&lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;).  Please download the latest (or wait up to a day to pick it up in MELPA).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked this quickly, so it's possible that there was a good reason for the (longstanding) existing behavior, but for now at least, I think it was a bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for reporting it.  After I've checked it out a bit more, I'll report it as an Emacs bug. Or you can do so now, if you like: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, things are more interesting (i.e., more complicated).  I'm busy at the moment, but will update this in a short while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suffice it to say that there are advantages to different ways to define the &quot;file names&quot; that are matched.  If you grab the current (updated this morning) version of &lt;code&gt;dired+.el&lt;/code&gt; then it will do as you expected: match file names with no subdirs as prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it can also be useful to match against the subdirs plus the file names.  That way, for example, you can match the same file name in multiple subdirs -- or not, au choix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will likely change &lt;strong&gt;&lt;code&gt;%m&lt;/code&gt;&lt;/strong&gt; (in Dired+) so that a certain kind of prefix arg gives you different, alternative matching behaviors.  (Right now, a prefix arg unmarks instead of marks.  I might change it so that the numeric sign governs whether to unmark and what kind of matching to do.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to experiment yourself, just grab the definition of &lt;code&gt;dired-mark-files-regexp&lt;/code&gt;, together with the definition of macro &lt;code&gt;dired-mark-if&lt;/code&gt;, from &lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;, and change the value of the first arg to &lt;code&gt;dired-get-filename&lt;/code&gt; (&lt;code&gt;LOCALP&lt;/code&gt;).  There are several matching possibilities, governed by that argument value.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;UPDATE 2&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK, I've updated &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;&#xA;(&lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;) now to provide more flexibility in this regard. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can now mark/unmark matching file names that are considered in different ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Relative&lt;/em&gt;&lt;/strong&gt; (no directory part, which is what you were incorrectly assuming you were matching).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this, you use a negative prefix arg (e.g. &lt;strong&gt;&lt;code&gt;M--&lt;/code&gt;&lt;/strong&gt;) to mark and a zero prefix arg (e.g. &lt;strong&gt;&lt;code&gt;M-0&lt;/code&gt;&lt;/strong&gt;) to unmark.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Relative to the &lt;code&gt;default-directory&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt; of the Dired buffer.  This means the file name is constructed the name relative to &lt;code&gt;default-directory&lt;/code&gt;.  For an entry in an inserted subdir listing, this means prefix the relative file name (no directory part) with the subdir name relative to &lt;code&gt;default-directory&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this, you use a positive arg (e.g. &lt;strong&gt;&lt;code&gt;M-+&lt;/code&gt;&lt;/strong&gt;) to mark and a double plain prefix arg (&lt;strong&gt;&lt;code&gt;C-u C-u&lt;/code&gt;&lt;/strong&gt;) to unmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what you were &lt;em&gt;actually&lt;/em&gt; matching, which explains why you saw what you saw.  With this behavior you would have needed to provide a regexp that matched the name relative to the &lt;code&gt;default-directory&lt;/code&gt; of the buffer. Your use of &lt;strong&gt;&lt;code&gt;^&lt;/code&gt;&lt;/strong&gt; in the regexp was trying to match the beginning of this name, not the nondirectory name.  This is same behavior as vanilla Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Absolute&lt;/em&gt;&lt;/strong&gt; (full name, including all directory parts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this, you use &lt;strong&gt;&lt;em&gt;no&lt;/em&gt;&lt;/strong&gt; prefix arg to mark and a plain prefix arg (&lt;strong&gt;&lt;code&gt;C-u&lt;/code&gt;&lt;/strong&gt;) to unmark.  This is thus the &lt;em&gt;default&lt;/em&gt; behavior now for &lt;strong&gt;Dired+&lt;/strong&gt;.  I think it is probably a better default behavior than what is used by vanilla Emacs (names relative to &lt;code&gt;default-directory&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-28T14:45:46.023" LastActivityDate="2016-05-28T14:45:46.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22493" PostTypeId="1" AcceptedAnswerId="22527" CreationDate="2016-05-24T14:41:27.780" Score="0" ViewCount="363" Body="&lt;p&gt;I use &lt;code&gt;hippie-expand&lt;/code&gt; with &lt;a href=&quot;https://github.com/smihica/emmet-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;emmet&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/joaotavora/yasnippet&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;yasnippet&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package emmet-mode&#xA;  :init&#xA;  (add-hook 'css-mode-hook 'emmet-mode)&#xA;  (add-hook 'sgml-mode-hook 'emmet-mode)&#xA;  :config (unbind-key &quot;&amp;lt;C-return&amp;gt;&quot; emmet-mode-keymap))&#xA;&#xA;(use-package hippie-exp&#xA;  :bind (&quot;&amp;lt;C-return&amp;gt;&quot; . hippie-expand)&#xA;  :config&#xA;  (setq-default&#xA;   hippie-expand-try-functions-list '(yas-hippie-try-expand emmet-expand-line)))&#xA;&#xA;(use-package yasnippet&#xA;  :init&#xA;  (add-hook 'emacs-lisp-mode 'yas-minor-mode)&#xA;  (add-hook 'js-mode-hook 'yas-minor-mode)&#xA;  (add-hook 'org-mode-hook 'yas-minor-mode)&#xA;  (add-hook 'sgml-mode-hook 'yas-minor-mode)&#xA;  :config (yas-reload-all))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It works fine with &lt;code&gt;js-mode&lt;/code&gt;, &lt;code&gt;org-mode&lt;/code&gt; and with &lt;code&gt;html-mode&lt;/code&gt;. But with &lt;code&gt;emacs-lisp-mode&lt;/code&gt; and with &lt;code&gt;lisp-interaction-mode&lt;/code&gt;, &lt;code&gt;hippie-expand&lt;/code&gt; always delegate completion to &lt;code&gt;emmet-expand-line&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Emmet completion is still available in non-emmet'ified buffers after an emmet'ified one has been opened (&lt;code&gt;css-mode-hook&lt;/code&gt; and &lt;code&gt;sgml-mode-hook&lt;/code&gt;). Is the right way to fix this to change &lt;code&gt;hippie-expand-try-functions-list&lt;/code&gt; on &lt;code&gt;prog-mode-hook&lt;/code&gt; depending on the current major mode?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How can I setup &lt;code&gt;hippie-expand&lt;/code&gt; with &lt;code&gt;emmet&lt;/code&gt; and &lt;code&gt;yasnippet&lt;/code&gt; to fix these 2 issues?&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-05-25T15:07:45.020" Title="Hippie doesn't use yasnippet and fallback to emmet with emacs-lisp-mode" Tags="|hooks|yasnippet|hippie-expand|emmet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22494" PostTypeId="1" CreationDate="2016-05-24T16:26:49.647" Score="0" ViewCount="126" Body="&lt;p&gt;Using Aquamacs&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Aquamacs 3.2 GNU Emacs 24.4.51.2&#xA;  (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&#xA;   of 2014-11-07 (Aquamacs-3.2) on watson.local&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;trying to install Flycheck from stable.melpa.org; I get this message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://stable.melpa.org/packages/flycheck-20160519.303.tar&quot; rel=&quot;nofollow&quot;&gt;https://stable.melpa.org/packages/flycheck-20160519.303.tar&lt;/a&gt;: Not found&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've tried using package-mode, and also the temporary install method (eval-buffer including (package-install 'flycheck), and I keep getting this message. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="12131" LastActivityDate="2016-05-25T05:51:05.877" Title="Flycheck installation to aquamacs from melpa failing" Tags="|flycheck|aquamacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22495" PostTypeId="2" ParentId="22407" CreationDate="2016-05-24T16:37:44.447" Score="4" Body="&lt;p&gt;&lt;code&gt;(helm-toggle-truncate-line)&lt;/code&gt; is bound to &lt;code&gt;C-c &amp;gt;&lt;/code&gt;.  I found this out by searching for &lt;code&gt;toggle&lt;/code&gt; in the helm help page, accessed during a helm session with &lt;code&gt;C-h m&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2016-05-24T16:37:44.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22496" PostTypeId="2" ParentId="22473" CreationDate="2016-05-24T16:42:50.247" Score="1" Body="&lt;p&gt;I've used &lt;a href=&quot;http://latex2rtf.sourceforge.net/&quot; rel=&quot;nofollow&quot; title=&quot;Latex2rtf&quot;&gt;Latex2rtf&lt;/a&gt; on LaTeX documents generated using natbib. I don't use org-mode for this, but I imagine there is a latex file produced at some point, so I would try running latex2rtf on that. &lt;/p&gt;&#xA;" OwnerUserId="12131" LastActivityDate="2016-05-24T16:42:50.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22497" PostTypeId="2" ParentId="22436" CreationDate="2016-05-24T16:58:02.067" Score="2" Body="&lt;p&gt;Eshell accepts ksh-like syntax. Amog others you can specify a group of files by &lt;code&gt;(file1|file2|...|fileN)&lt;/code&gt;. But, that is a bit tricky since parentheses also indicate lisp forms to be evaluated (for an example see the &lt;a href=&quot;https://emacs.stackexchange.com/a/22458/2370&quot;&gt;answer&lt;/a&gt; by &lt;a href=&quot;https://emacs.stackexchange.com/users/2287/lawlist&quot;&gt;lawlist&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, there are also predicates in parenthesis. The predicates come as last thing of a path specification.&#xA;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo *(/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;prints a list of directories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To differentiate groups from lisp forms and predicates you must append something to the group string. Maybe, you want to append something anyway.&#xA;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo (file1|file2).txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a last resort you can just append an empty string &lt;code&gt;''&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo (file1|file2)''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The solution to the original-posters problem would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cp /Users/HOME/.0.data/.0.emacs/.0.sources/emacs/(buffer.c|buffer.h|dispextern.h|ke‌​‌​yboard.c|nsterm.m|w32term.c|window.h|xdisp.c|xterm.c)'' ~/Desktop/emacs/src/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In the following I cite the help strings &lt;code&gt;eshell-predicate-help-string&lt;/code&gt; and &lt;code&gt;eshell-modifier-help-string&lt;/code&gt; as an add-on to the answer.&#xA;Maybe the modifiers and predicates are not so well known even if they are a quite powerful system. (At least I did not know about them until I answered this question.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eshell predicate quick reference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  -  follow symbolic references for predicates after the `-'&#xA;  ^  invert sense of predicates after the `^'&#xA;&#xA;FILE TYPE:&#xA;  /  directories              s  sockets&#xA;  .  regular files            p  named pipes&#xA;  *  executable (files only)  @  symbolic links&#xA;&#xA;  %x  file type == `x' (as by ls -l; so `c' = char device, etc.)&#xA;&#xA;PERMISSION BITS (for owner/group/world):&#xA;  r/A/R  readable    s  setuid&#xA;  w/I/W  writable    S  setgid&#xA;  x/E/X  executable  t  sticky bit&#xA;&#xA;OWNERSHIP:&#xA;  U               owned by effective uid&#xA;  u(UID|'user')   owned by UID/user&#xA;  g(GID|'group')  owned by GID/group&#xA;&#xA;FILE ATTRIBUTES:&#xA;  l[+-]N                 +/-/= N links&#xA;  a[Mwhms][+-](N|'FILE') access time +/-/= N months/weeks/hours/mins/secs&#xA;             (days if unspecified) if FILE specified,&#xA;             use as comparison basis; so a+'file.c'&#xA;             shows files accessed before file.c was&#xA;             last accessed&#xA;  m[Mwhms][+-](N|'FILE') modification time...&#xA;  c[Mwhms][+-](N|'FILE') change time...&#xA;  L[kmp][+-]N            file size +/-/= N Kb/Mb/blocks&#xA;&#xA;EXAMPLES:&#xA;  *(^@)         all non-dot files which are not symlinks&#xA;  .#*(^@)       all files which are not symbolic links&#xA;  **/.#*(*)     all executable files, searched recursively&#xA;  ***/*~f*(-/)  recursively (though not traversing symlinks),&#xA;        find all directories (or symlinks referring to&#xA;        directories) whose names do not begin with f.&#xA;  e*(*Lk+50)    executables 50k or larger beginning with 'e'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Eshell modifier quick reference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FOR SINGLE ARGUMENTS, or each argument of a list of strings:&#xA;  E  evaluate again&#xA;  L  lowercase&#xA;  U  uppercase&#xA;  C  capitalize&#xA;  h  dirname&#xA;  t  basename&#xA;  e  file extension&#xA;  r  strip file extension&#xA;  q  escape special characters&#xA;&#xA;  S       split string at any whitespace character&#xA;  S/PAT/  split string at each occurrence of PAT&#xA;&#xA;FOR LISTS OF ARGUMENTS:&#xA;  o  sort alphabetically&#xA;  O  reverse sort alphabetically&#xA;  u  uniq list (typically used after :o or :O)&#xA;  R  reverse list&#xA;&#xA;  j       join list members, separated by a space&#xA;  j/PAT/  join list members, separated by PAT&#xA;  i/PAT/  exclude all members not matching PAT&#xA;  x/PAT/  exclude all members matching PAT&#xA;&#xA;  s/pat/match/  substitute PAT with MATCH&#xA;  g/pat/match/  substitute PAT with MATCH for all occurrences&#xA;&#xA;EXAMPLES:&#xA;  *.c(:o)  sorted list of .c files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-05-24T17:36:59.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22498" PostTypeId="1" CreationDate="2016-05-24T17:11:37.623" Score="1" ViewCount="1323" Body="&lt;p&gt;I have a working C IDE without Semantic (too slow for me), from instructions &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, with completion provided by company-gtags (I think.  Maybe clang does something too?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Completion at point works for functions throughout the project, but not for variable names.  I.e., if &lt;code&gt;param_n&lt;/code&gt; is a global variable, I get no completions for &lt;code&gt;param&lt;/code&gt;, even when I force completions.  I expect that gtags knows about &lt;code&gt;param_n&lt;/code&gt;, because it shows all of the references to it when I call &lt;code&gt;global -sx param_n&lt;/code&gt; from the command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get completion, without Semantic, for local and global variables, whenever they are in scope?&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2018-03-19T20:34:49.747" Title="Completion for variables in C using company-gtags, or not Semantic" Tags="|company-mode|c|semantic-mode|cedet|gtags|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22499" PostTypeId="1" CreationDate="2016-05-24T17:20:28.210" Score="8" ViewCount="2013" Body="&lt;p&gt;When looking up documentation with &lt;code&gt;describe-function&lt;/code&gt;, Emacs display the docstring in a temporary help buffer. I want this buffer to replace current window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I've customized &lt;code&gt;help-window-select&lt;/code&gt; but it only affect the focus.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-05-24T17:58:03.110" Title="How can I tell Emacs to always open help buffers in the current window?" Tags="|window|window-splitting|help-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22502" PostTypeId="2" ParentId="22499" CreationDate="2016-05-24T17:58:03.110" Score="11" Body="&lt;p&gt;If you don't like how help-window-select works you can simply use this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist&#xA;             '(&quot;*Help*&quot; display-buffer-same-window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can change &lt;code&gt;&quot;*Help*&quot;&lt;/code&gt; with a regexp matching other buffer names if you want to also affect apropos windows or shell&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-05-24T17:58:03.110" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22503" PostTypeId="1" AcceptedAnswerId="22525" CreationDate="2016-05-24T18:33:21.433" Score="6" ViewCount="1324" Body="&lt;p&gt;I'm writing some code where I have to identify the command for the last key pressed. Sometimes I need to look up a combination of this key with another one. I use the &lt;code&gt;key-binding&lt;/code&gt; function for that. It works most of the time but not for all keys. For example it does not work for the backspace key:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (read-key)&#xA;  (key-binding (vector last-input-event))) ;; &amp;gt; nil for backspace&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can work around this by checking for backspace manually but I wonder if there is a more reliable way that works for all/most situations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;last-input-event&lt;/code&gt; because it is after exiting a keymap through the default binding &lt;code&gt;[t]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the accepted answer I'm using something like the following which seems to work very well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (read-key)&#xA;  (key-binding (kbd (edmacro-format-keys (vector last-input-event)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2016-05-26T12:26:52.750" LastActivityDate="2016-05-26T12:26:52.750" Title="Reliable method to get the command for last pressed key?" Tags="|key-bindings|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22504" PostTypeId="1" AcceptedAnswerId="22541" CreationDate="2016-05-24T18:41:11.407" Score="1" ViewCount="258" Body="&lt;p&gt;In &lt;code&gt;dired-mode&lt;/code&gt;, I use an external quicklook tool on OSX called &lt;code&gt;qlmanage&lt;/code&gt;, which pops open a window displaying a human readable image of the file with mouse scrolling capabilities.  If I hit the space bar, &lt;code&gt;qlmanage&lt;/code&gt; either displays the file or the process is deleted -- e.g., essentially an on/off switch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having trouble figuring out how to move up or down in a &lt;code&gt;dired-mode&lt;/code&gt; buffer, such that &lt;code&gt;qlmanage&lt;/code&gt; will automatically display an image of the current line -- &lt;strong&gt;if&lt;/strong&gt; an image is already being displayed -- but &lt;em&gt;only&lt;/em&gt; do so &lt;strong&gt;after&lt;/strong&gt; the previous process has successfully been killed with &lt;code&gt;delete-process&lt;/code&gt;.  A successful kill of the &lt;code&gt;qlmanage&lt;/code&gt; process will return a &lt;code&gt;process-exit-status&lt;/code&gt; of &lt;code&gt;9&lt;/code&gt; or the event string will equal &lt;code&gt;killed\n&lt;/code&gt;.  I believe it is necessary to spawn a new process and sentinel when &lt;code&gt;(= 9 (process-exit-status p)&lt;/code&gt;; however, I am still confused by the nesting despite having had a few cups of coffee.  I would like to have one function &lt;code&gt;dired-qlmanage&lt;/code&gt; that serves both purposes -- i.e., on/off with the space bar, or show next image if one is already displayed when moving up or down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CAVEAT&lt;/strong&gt;:  The goal is to &lt;em&gt;avoid&lt;/em&gt; having more than one active &lt;code&gt;qlmanage&lt;/code&gt; process at any given moment in time, which is why I am using a &lt;code&gt;sentinel&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FYI&lt;/strong&gt;:  &quot;Deleting a running process sends a signal to terminate it (and its child processes, if any), &lt;strong&gt;and calls the process sentinel&lt;/strong&gt;.&quot;  [Emphasis added.]  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Deleting-Processes.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Deleting-Processes.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired)&#xA;(require 'cl)&#xA;&#xA;(defun dired-kill-last-process-named (name)&#xA;&quot;Function initially written by @wvxvw, and revised by @lawlist.&quot;&#xA;  (let (p)&#xA;    (cl-loop with name-re = &#xA;             (format &quot;^%s\\(?:&amp;lt;\\([[:digit:]]+\\)&amp;gt;\\)?&quot; (regexp-quote name))&#xA;     for process in (process-list)&#xA;     for pname = (process-name process)&#xA;     if (string-match name-re pname)&#xA;     collect (cons (string-to-number (or (match-string 1 pname) &quot;0&quot;)) process)&#xA;     into processes&#xA;     finally&#xA;      (let ((process (cdar (cl-sort processes '&amp;gt; :key 'car))))&#xA;        (when (and process (get-process process))&#xA;          (delete-process process)&#xA;          (setq p process)))) p))&#xA;&#xA;(defun dired-qlmanage ()&#xA;(interactive)&#xA;  (unless (dired-kill-last-process-named &quot;qlmanage&quot;)&#xA;    (let ((current-node (dired-get-file-for-visit)))&#xA;        (set-process-sentinel&#xA;          (start-process &quot;qlmanage&quot; nil &quot;/usr/bin/qlmanage&quot; &quot;-p&quot; current-node)&#xA;          (lambda (p e)&#xA;            (setq e (replace-regexp-in-string &quot;\n$&quot; &quot;&quot; e))&#xA;            (cond&#xA;              ((= 9 (process-exit-status p))&#xA;                ;; Should we spawn a new process with sentinel here?&#xA;                (message &quot;killed (9):  %s | %s | %s&quot; p e (process-exit-status p)))&#xA;              ((= 0 (process-exit-status p))&#xA;                (message &quot;finished (0):  %s | %s | %s&quot; p e (process-exit-status p)))&#xA;              (t&#xA;                (message &quot;unknown (?):  %s | %s | %s&quot; p e (process-exit-status p)))))))))&#xA;&#xA;(defun my-dired-previous-line (arg)&#xA;(interactive &quot;^p&quot;)&#xA;  (dired-previous-line arg)&#xA;  (dired-qlmanage))&#xA;&#xA;(defun my-dired-next-line (arg)&#xA;(interactive &quot;^p&quot;)&#xA;  (dired-next-line arg)&#xA;  (dired-qlmanage))&#xA;&#xA;(defun my-dired-quicklook ()&#xA;(interactive)&#xA;  (dired-qlmanage))&#xA;&#xA;(eval-after-load &quot;dired&quot; '(progn&#xA;  (define-key dired-mode-map [down] 'my-dired-next-line)&#xA;  (define-key dired-mode-map [up] 'my-dired-previous-line)&#xA;  (define-key dired-mode-map (kbd &quot;SPC&quot;) 'my-dired-quicklook)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-05-24T19:17:53.023" LastActivityDate="2019-06-29T18:24:52.600" Title="Quicklook in dired-mode using a process/sentinel with external viewer" Tags="|dired|process|subprocess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22505" PostTypeId="2" ParentId="14643" CreationDate="2016-05-24T18:44:56.293" Score="5" Body="&lt;p&gt;&lt;code&gt;color-identifiers-mode&lt;/code&gt; does this for variables, if I understand your question correctly.  &lt;code&gt;rainbo-identifiers-mode&lt;/code&gt; too, I think.  Screenshot is from the former one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LaFTe.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LaFTe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2016-05-24T18:44:56.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22508" PostTypeId="1" CreationDate="2016-05-24T21:20:28.450" Score="1" ViewCount="234" Body="&lt;p&gt;Running windows 8.1, package intallation went fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enabling with &lt;code&gt;M-x ergoemacs-mode&lt;/code&gt; works like a charm, but doing this every time I start up Emacs gets quite tiresome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ergoemacs-theme nil) ;; Uses Standard Ergoemacs keyboard theme&#xA;(setq ergoemacs-keyboard-layout &quot;us&quot;) ;; Assumes QWERTY keyboard layout&#xA;(ergoemacs-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to &lt;code&gt;~/.emacs&lt;/code&gt; as advised &lt;a href=&quot;https://ergoemacs.github.io/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; gets me the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `c:/Users/UserName/AppData/Roaming/.emacs':&#xA;&#xA;Symbol's function definition is void: ergoemacs-mode&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't have a clue about how to do this debug mode properly (get No Match in return), but in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq/Debugging-a-customization-file.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; I found how to evaluate each expression. using &lt;code&gt;C-x C-e&lt;/code&gt; Evaluating first two of the added lines give me &lt;code&gt;nil&lt;/code&gt; and &lt;code&gt;&quot;us&quot;&lt;/code&gt;, and evaluating the last line enables ergoemacs-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;~/.emacs&lt;/code&gt; I also found this block of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(ergoemacs-ctl-c-or-ctl-x-delay 0.2)&#xA; '(ergoemacs-handle-ctl-c-or-ctl-x (quote both))&#xA; '(ergoemacs-ini-mode t)&#xA; '(ergoemacs-keyboard-layout &quot;us&quot;)&#xA; '(ergoemacs-mode nil)&#xA; '(ergoemacs-smart-paste nil)&#xA; '(ergoemacs-theme &quot;standard&quot;)&#xA; '(ergoemacs-theme-options nil)&#xA; '(ergoemacs-use-menus t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Neither changing &lt;code&gt;'(ergoemacs-mode nil)&lt;/code&gt; to &lt;code&gt;(ergoemacs-mode 1)&lt;/code&gt;, removing that line OR changing &lt;code&gt;'(ergoemacs-mode nil)&lt;/code&gt; to &lt;code&gt;(ergoemacs-mode 1)&lt;/code&gt; and &#xA;removing the other 3 lines works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please advise.&lt;/p&gt;&#xA;" OwnerUserId="12122" LastActivityDate="2016-05-24T21:20:28.450" Title="How do I get ergoemacs-mode set to default without &quot;Symbol's function definition is void: ergoemacs-mode&quot; error" Tags="|ergoemacs|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22509" PostTypeId="2" ParentId="19401" CreationDate="2016-05-24T22:41:34.917" Score="1" Body="&lt;p&gt;There are two (three) things that, in my experience, can cause EMMS to fail to get tags from mp3info.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Your $PATH variable in Emacs is different from your shell's $PATH variable.  This can happen especially on Mac OS X gui emacs.  You can check Emacs' path variable with &lt;code&gt;M-x getenv RET&lt;/code&gt;, and choosing PATH from a list.  A solution is to use the package &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;exec-path-from-shell&lt;/code&gt;&lt;/a&gt;, which can be installed via the melpa package manager in emacs.  If installed manually you'll need &lt;code&gt;(require 'exec-path-from-shell)&lt;/code&gt;.  In any case, after installing, add &lt;code&gt;(exec-path-from-shell-initialize)&lt;/code&gt; to your init file.   Do &lt;code&gt;which mp3info&lt;/code&gt; or whatever to verify whether the executable lies within Emacs' $PATH.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Install EMMS via git and not via ELPA.  It appears that some users (i.e., myself) found that elpa EMMS does not interface with any tag program, but that cleaning the elpa EMMS out and installing from the git repository does work.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(3.) I don't think this is a problem for the original question, but &lt;code&gt;mp3info&lt;/code&gt; only works with id3v1 tags, whereas many MP3s may only have id3v2.* tags.  I suggest you use libtag for compatability with all tags and other non-MP3 file formats.  To setup with libtag follow &lt;a href=&quot;https://emacs.stackexchange.com/questions/22424/emms-is-not-displaying-tag-info-with-libtag&quot;&gt;instructions in my other answer about this&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To keep mp3info follow the same instructions but remove the libtag stuff from the init configuration.  I have done that below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/lisp/emms/lisp/&quot;);;add the emms elisp path&#xA;;;emms configuration ;;; elisp comment ;)&#xA;(require 'emms)      ;;; load emms from &quot;~/.emacs.d/lisp/emms/lisp/&quot;&#xA;                     ;;; i.e., the core functionality&#xA;(require 'emms-setup);;; load some functions that will set some preferences&#xA;                     ;;; it's worth looking at this file&#xA;(emms-all)           ;;; load all stable features of emms, defined in emms-setup&#xA;(emms-default-players);; load a list of default players (like mplayer) installed defined in emms-setup&#xA;(setq emms-source-file-default-directory &quot;/Volumes/Seabeam HD/Music/&quot;)&#xA;;;; below is a nice key command for toggling the music browser&#xA;(autoload 'emms-smart-browse &quot;emms-browser.el&quot; &quot;Browse with EMMS&quot; t)&#xA;(global-set-key [(f7)] 'emms-smart-browse) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-25T15:06:28.940" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22510" PostTypeId="1" AcceptedAnswerId="22511" CreationDate="2016-05-25T03:29:58.893" Score="0" ViewCount="113" Body="&lt;p&gt;Why are some global minor modes applicable before package initialize while some are not? e.g. In init file &lt;code&gt;global-linum-mode&lt;/code&gt; works but  &lt;code&gt;projectile-global-mode&lt;/code&gt; doesn't. Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, why is there no &lt;code&gt;global-helm-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12139" LastActivityDate="2016-05-25T05:43:44.023" Title="Global Modes not consistent?" Tags="|helm|projectile|global-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22511" PostTypeId="2" ParentId="22510" CreationDate="2016-05-25T05:43:44.023" Score="6" Body="&lt;p&gt;Your main question isn't really about global modes at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;global-linum-mode&lt;/code&gt; is (auto) loaded in Emacs by default, and so is available to all Emacs users at all times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;projectile-global-mode&lt;/code&gt; is in a third-party package you've installed via the package manager, and therefore unavailable until your ELPA packages have been initialized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your second question (and please don't post multiple questions together), &quot;why is there no &lt;code&gt;global-helm-mode&lt;/code&gt;?&quot; the answer is surely &quot;because no such mode has been written&quot;. I suspect you are under a misapprehension that buffer-local minor modes are automatically accompanied by global variants? This is not the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minor modes can be separated into:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;buffer-local minor modes&lt;/li&gt;&#xA;&lt;li&gt;global minor modes&lt;/li&gt;&#xA;&lt;li&gt;globalized minor modes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(The last type defines a global mode which &lt;em&gt;controls&lt;/em&gt; a (pre-defined) buffer-local mode.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All three types are defined independently. If they're not defined, they don't exist.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-25T05:43:44.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22512" PostTypeId="2" ParentId="22494" CreationDate="2016-05-25T05:51:05.877" Score="1" Body="&lt;p&gt;Your package archive index appears to be outdated.  Please run &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; and try again.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Besides please note that Flycheck only supports GNU Emacs.  Use with Aquamacs at your own risk.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-05-25T05:51:05.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22513" PostTypeId="1" AcceptedAnswerId="22515" CreationDate="2016-05-25T05:59:04.493" Score="5" ViewCount="577" Body="&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; I'm looking for way to detect when an Emacs frame has been moved from one monitor to another in a multi-monitor setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have code in my &lt;code&gt;~/.emacs&lt;/code&gt; which sets the default font size for all displayed buffers in a frame based on the physical size and resolution of the monitor hosting the Emacs frame. In a multi-monitor setup, I would like to execute the font-sizing logic when a frame is moved from one monitor to another with possibly different rez + physical dimensions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've not found a way to do this in stock Emacs (have been looking mostly at available hooks) nor have I found any community code which might, say, add a hook for monitor change events.&lt;/p&gt;&#xA;" OwnerUserId="12079" LastEditorUserId="253" LastEditDate="2016-05-25T10:15:10.993" LastActivityDate="2016-05-25T10:15:10.993" Title="Is there a way to detect change of monitor in Emacs / Elisp?" Tags="|hooks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22514" PostTypeId="1" CreationDate="2016-05-25T07:00:52.787" Score="0" ViewCount="1317" Body="&lt;p&gt;Am new to Emacs and am using Spacemacs, Emacs mode. After following the basic Emacs tutorial, I create an html file and try to use emacs for code editing. So I installed the html layer, after activating emmet-mode, it still stuck at web-mode. And I got any autocompletion. Like typing :&lt;code&gt;.my-class&lt;/code&gt; + TAB don't generate any code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1wIup.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1wIup.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11979" LastEditorUserId="11979" LastEditDate="2016-05-25T15:01:26.437" LastActivityDate="2016-05-25T15:13:24.923" Title="having issues using Emmet-mode" Tags="|spacemacs|emmet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22515" PostTypeId="2" ParentId="22513" CreationDate="2016-05-25T07:49:55.367" Score="5" Body="&lt;p&gt;One way to do this is to save the original monitor for each frame (using &lt;code&gt;frame-monitor-attributes&lt;/code&gt;) and then run a timer, where you check the current monitor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you run an idle timer and run it a few timed every second, I don't think it will slow down Emacs much at the same time it will be almost instant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your question you said that your code &quot;sets the default font size for all displayed buffers in a frame&quot;. I don't think this is a good approach, as a buffer can be made visible in more than one frame. A better solution would be to change the default font of the frame itself using &lt;code&gt;set-default-font&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A different approach would be to define a function to move the frame for you, and at the same time change the font size etc.)&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-05-25T07:49:55.367" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22516" PostTypeId="1" AcceptedAnswerId="22517" CreationDate="2016-05-25T10:32:43.193" Score="3" ViewCount="887" Body="&lt;p&gt;I want to be able to jump to definition with control left click when editing c++ code. I tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key c++-mode-map [C-mouse-1] 'rtags-find-symbol-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not seem to work because emacs (24.5.1) already define a global behavior for C-mouse-1 (buffer navigation in graphical mode). The contextual window opens, but rtags-find-symbol-at-point is not called.&#xA;Any way to make this work ?&lt;/p&gt;&#xA;" OwnerUserId="2401" LastActivityDate="2020-03-25T13:42:31.673" Title="Bind control left click" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22517" PostTypeId="2" ParentId="22516" CreationDate="2016-05-25T10:38:02.817" Score="2" Body="&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key c++-mode-map [C-down-mouse-1] 'rtags-find-symbol-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-05-25T10:38:02.817" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22519" PostTypeId="2" ParentId="20543" CreationDate="2016-05-25T11:34:46.793" Score="1" Body="&lt;p&gt;There are a few solutions: &lt;a href=&quot;http://wikemacs.org/wiki/Markdown#Live_preview_as_you_type&quot; rel=&quot;nofollow&quot;&gt;http://wikemacs.org/wiki/Markdown#Live_preview_as_you_type&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Flymd&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/mola-T/flymd&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mola-T/flymd&lt;/a&gt; This may be the simplest. Install this package with package.el (on MELPA), call the mode with &lt;code&gt;M-x flymd-flyit&lt;/code&gt;. It opens a browser window.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Impatient-mode&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/skeeto/impatient-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/skeeto/impatient-mode&lt;/a&gt; This one needs a bit more setup (explained in wikemacs) but it works out of the box for html live rendering. &lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2016-05-25T11:34:46.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22520" PostTypeId="1" AcceptedAnswerId="22628" CreationDate="2016-05-25T13:03:08.860" Score="2" ViewCount="230" Body="&lt;p&gt;I still feel a strong disturbance when it comes to &lt;code&gt;auto-complete&lt;/code&gt; in &lt;code&gt;emacs&lt;/code&gt;.&lt;br&gt;&#xA;From what I have read in the &lt;a href=&quot;http://auto-complete.org/doc/manual.html&quot; rel=&quot;nofollow&quot;&gt;docs&lt;/a&gt;, you can easily extend &lt;code&gt;auto-complete&lt;/code&gt; by any syntax you like. Looking through (M)ELPA there are many packages named &lt;code&gt;ac-[...]&lt;/code&gt;, like &lt;code&gt;ac-html-bootstrap&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After installing some of these packages, I am not sure if there is any difference, since &lt;code&gt;auto-complete&lt;/code&gt; already shifts with various syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;General Question:&lt;br&gt;&#xA;What is the general &lt;em&gt;cookbook recipe&lt;/em&gt; for installing &lt;strong&gt;3rd party&lt;/strong&gt; syntax packages for &lt;code&gt;auto-compete&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In more details:&lt;br&gt;&#xA;&lt;strong&gt;(i)&lt;/strong&gt; How does &lt;code&gt;auto-complete&lt;/code&gt; get notified about 3rd party syntax packages in general? Does it scan the directory or do I need to specify it in my &lt;code&gt;.emacs&lt;/code&gt; file?&lt;br&gt;&#xA;&lt;strong&gt;(ii)&lt;/strong&gt; How is it hooked to a certain mode or file extension? Is this provided by the syntax package itself or do I have to specify it?&lt;br&gt;&#xA;&lt;strong&gt;(iii)&lt;/strong&gt; How do I make sure, a package is correctly working? How do I tell the difference between the state without and with the package?&lt;/p&gt;&#xA;" OwnerUserId="12007" LastEditorUserId="12007" LastEditDate="2016-05-26T07:12:43.527" LastActivityDate="2016-05-29T20:40:33.907" Title="Sources for Auto-Complete" Tags="|init-file|package|package-repositories|auto-complete-mode|config|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22521" PostTypeId="1" AcceptedAnswerId="22522" CreationDate="2016-05-25T13:59:36.320" Score="0" ViewCount="65" Body="&lt;p&gt;Suppose I have defined the following macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro mymacro (a) &quot;&quot; (eval a))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I then use &lt;code&gt;eval-last-sexp&lt;/code&gt; (i.e. &lt;code&gt;C-x C-e&lt;/code&gt;) to evaluate the following,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun somefcn (b) &quot;&quot; (mymacro b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the error &lt;code&gt;(void-variable b)&lt;/code&gt;. However, if I evaluate the definition another way (e.g. using &lt;code&gt;eval-expression&lt;/code&gt;), it evaluates fine and works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the following expression evaluates without a problem &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun somefcn (a) &quot;&quot; (mymacro a))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is going on?&lt;/p&gt;&#xA;" OwnerUserId="12148" LastActivityDate="2016-05-25T14:26:46.843" Title="eval-last-sexp produces unnecessary void-variable error when using a macro containing eval" Tags="|interactive|defun|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22522" PostTypeId="2" ParentId="22521" CreationDate="2016-05-25T14:26:46.843" Score="3" Body="&lt;p&gt;After looking through the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/elisp.html&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs Lisp Reference Manual&lt;/a&gt;, I realized that there is a subsection of &quot;Common Problems Using Macros&quot; called &quot;Evaluating Macro Arguments in Expansion&quot; which explains this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic problem is that, when a macro is compiled as opposed to interpreted, the first evaluation of the macro is inserted into function definitions in place of the macro. Thus, my macro is actually calling &lt;code&gt;eval&lt;/code&gt; on the not-defined variable &lt;code&gt;b&lt;/code&gt;, hence returning an error. Basically, one should avoid using &lt;code&gt;eval&lt;/code&gt; in the initial part of macro evaluations.&lt;/p&gt;&#xA;" OwnerUserId="12148" LastActivityDate="2016-05-25T14:26:46.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22523" PostTypeId="2" ParentId="22503" CreationDate="2016-05-25T14:34:40.373" Score="0" Body="&lt;p&gt;backspace and a lot of other keys are &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Function-Keys.html#Function-Keys&quot; rel=&quot;nofollow&quot;&gt;function keys&lt;/a&gt; for which, the event is a symbol so there is nothing in the keymaps for it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (read-key)&#xA;  (cond&#xA;    ((symbolp last-input-event) last-input-event)&#xA;    (t (key-binding (vector last-input-event)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above still doesn't get you the function for the symbol of the function key. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let (( key (read-key-sequence &quot;hit a key:&quot;)) &#xA;     (message &quot;key %s was fun %s &quot; key ( key-binding key t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that uses read-key-sequence and it seems like you want to use last-input-event. Maybe take a look at the definition of describe-key in help.el&lt;/p&gt;&#xA;" OwnerUserId="9974" LastActivityDate="2016-05-25T14:34:40.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22524" PostTypeId="1" CreationDate="2016-05-25T14:56:26.550" Score="0" ViewCount="998" Body="&lt;p&gt;I can toggle &lt;code&gt;org-indent-mode&lt;/code&gt; with &lt;code&gt;M-x org-indent-mode&lt;/code&gt;, however I don't want it on by default. I tried, on my config file, &lt;code&gt;(org-indent-mode -1)&lt;/code&gt;, but I get a &quot;undefined symbol&quot; error. I also tried using &lt;code&gt;setq&lt;/code&gt; instead, despite Emacs' wiki saying to use the function not the variable. I also tried &lt;code&gt;(setq auto-indent-start-org-indent nil)&lt;/code&gt; because a website said this was the way, but it also didn't work. I am using Emacs 24.4.1 on Debian.&lt;/p&gt;&#xA;" OwnerUserId="12151" LastActivityDate="2016-05-25T15:01:19.830" Title="Permanently disable `org-indent-mode`?" Tags="|org-mode|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22525" PostTypeId="2" ParentId="22503" CreationDate="2016-05-25T15:00:47.573" Score="3" Body="&lt;p&gt;You can repurpose part of the kbd-macro infrastructure for this, specifically &lt;code&gt;edmacro-format-keys&lt;/code&gt;. It already handles &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/1ee91bf89176251f6e399c8436dca0248cdd6f6b/lisp/edmacro.el#L423&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;a lot&lt;/em&gt; of edge cases&lt;/a&gt; for you. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(edmacro-format-keys (kbd &quot;DEL&quot;) t) &#xA;=&amp;gt; &quot;DEL         ;; backward-delete-char-untabify&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(edmacro-format-keys (kbd &quot;C-x C-s&quot;) t)&#xA;=&amp;gt; &quot;C-x C-s         ;; save-buffer&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12147" LastActivityDate="2016-05-25T15:00:47.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22526" PostTypeId="2" ParentId="22524" CreationDate="2016-05-25T15:01:19.830" Score="2" Body="&lt;p&gt;In your init file, you might have to require the library first:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-indent)&#xA;(org-indent-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-05-25T15:01:19.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22527" PostTypeId="2" ParentId="22493" CreationDate="2016-05-25T15:07:45.020" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;It works fine with &lt;code&gt;js-mode&lt;/code&gt;, &lt;code&gt;org-mode&lt;/code&gt; and with &lt;code&gt;html-mode&lt;/code&gt;. But with &lt;code&gt;emacs-lisp-mode&lt;/code&gt; and with &lt;code&gt;lisp-interaction-mode&lt;/code&gt;, &lt;code&gt;hippie-expand&lt;/code&gt; always delegate completion to &lt;code&gt;emmet-expand-line&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's a typo in your config: you're adding to &lt;code&gt;emacs-lisp-mode&lt;/code&gt; instead of &lt;code&gt;emacs-lisp-mode-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emmet completion is still available in non-emmet'ified buffers after an emmet'ified one has been opened (&lt;code&gt;css-mode-hook&lt;/code&gt; and &lt;code&gt;sgml-mode-hook&lt;/code&gt;). Is the right way to fix this to change &lt;code&gt;hippie-expand-try-functions-list&lt;/code&gt; on &lt;code&gt;prog-mode-hook&lt;/code&gt; depending on the current major mode?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That should work.  Alternatively you could use a function that only operates when &lt;code&gt;emmet-mode&lt;/code&gt; is enabled:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun emmet-hippie-try-expand-line (args)&#xA;  (interactive &quot;P&quot;)&#xA;  (when emmet-mode&#xA;    (emmet-exand-line args)))&#xA;(setq-default hippie-expand-try-functions-list&#xA;              '(yas-hippie-try-expand&#xA;                emmet-hippie-try-expand-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-05-25T15:07:45.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22528" PostTypeId="2" ParentId="22514" CreationDate="2016-05-25T15:13:24.923" Score="1" Body="&lt;p&gt;You need to enable/configure &lt;code&gt;auto-completion&lt;/code&gt; mode perhaps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/auto-completion&quot; rel=&quot;nofollow&quot;&gt;Spacemacs Autocompletion&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12070" LastActivityDate="2016-05-25T15:13:24.923" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22529" PostTypeId="1" CreationDate="2016-05-25T15:38:11.993" Score="1" ViewCount="59" Body="&lt;p&gt;In my &lt;code&gt;org-mode&lt;/code&gt; document I use both src blocks and inline code blocks. When exporting to LaTeX, is there a way to set &lt;code&gt;:exports both&lt;/code&gt; for the src blocks, but &lt;code&gt;:exports results&lt;/code&gt; for the inline code? Right now, the exported document looks a weird when exporting e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R&#xA;datafile &amp;lt;- &quot;some/file.csv&quot;&#xA;#+end_src&#xA;We use the file src_R{datafile}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because the text will read &quot;We use the file datafile some/file.csv&quot;. Of course I can manually add the exports statements to the inline code like this&#xA;&lt;code&gt;src_R[:exports results]{datafile}&lt;/code&gt;, but that becomes tedious very quickly. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2016-05-25T15:38:11.993" Title="Can `:exports` be set independently for inline org-babel code blocks?" Tags="|org-mode|org-export|org-babel|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22530" PostTypeId="2" ParentId="22430" CreationDate="2016-05-25T15:44:30.180" Score="4" Body="&lt;p&gt;First of all, I would like to correct my mistake in my earlier answer (now deleted). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;s&gt;&lt;em&gt;When the point is in the source blocks, the org-src-mode-map is active.&lt;/em&gt;&lt;/s&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Actually the &lt;code&gt;org-src-mode-map&lt;/code&gt; is active in the temporary buffer that pops up after you hit &lt;code&gt;C-c '&lt;/code&gt; (bound to &lt;code&gt;org-edit-special&lt;/code&gt;) when the point is in a source block like below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(message &quot;Hi&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So please disregard my earlier answer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Tested solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The solution that might work for your case is to advise the &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt; function. This is the function bound to &lt;code&gt;C-c C-c&lt;/code&gt; by default in &lt;code&gt;org-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below advice will made the &lt;code&gt;org-babel-execute-src-block-maybe&lt;/code&gt; if the point is in an org source block when you hit &lt;code&gt;C-c C-c&lt;/code&gt;. Otherwise, the &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt; function will run as usual.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/advice-org-ctrl-c-ctrl-c (&amp;amp;rest args)&#xA;  &quot;Run `org-babel-execute-src-block-maybe' if point is in an org source block.&quot;&#xA;  (let ((do-not-run-orig-fn (org-in-src-block-p)))&#xA;    (when do-not-run-orig-fn&#xA;      (call-interactively #'org-babel-execute-src-block-maybe))&#xA;    do-not-run-orig-fn))&#xA;(advice-add 'org-ctrl-c-ctrl-c :before-until #'my/advice-org-ctrl-c-ctrl-c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Above solution is tested using &lt;code&gt;emacs -Q&lt;/code&gt; (version 25.0.94) and latest build of org from its &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/log/&quot; rel=&quot;nofollow&quot;&gt;git master&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Warning!&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;By doing this, you will be overriding the default behavior of &lt;code&gt;C-c C-c&lt;/code&gt; in source blocks. Below is a snippet from the documentation we get on doing &lt;code&gt;C-h f org-ctrl-c-ctrl-c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;If the cursor is on a code block, evaluate it.  The variable&#xA;  ‘org-confirm-babel-evaluate’ can be used to control prompting&#xA;  before code block evaluation, by default every code block&#xA;  evaluation requires confirmation.  Code block evaluation can be&#xA;  inhibited by setting ‘org-babel-no-eval-on-ctrl-c-ctrl-c’.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-05-25T15:54:58.320" LastActivityDate="2016-05-25T15:54:58.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22531" PostTypeId="1" AcceptedAnswerId="22552" CreationDate="2016-05-25T15:59:06.307" Score="6" ViewCount="949" Body="&lt;p&gt;I have enabled org-indent-mode in all org files as such:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook 'org-indent-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want to diminish the &quot;Ind&quot; minor mode, which seems to be beyond my abilities. I know the diminish package is loading and working properly, as other diminishes work as expected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I managed to find &lt;code&gt;(add-hook 'org-mode-hook '(diminish 'org-indent-mode))&lt;/code&gt;, which actually diminishes the mode, but also shows &lt;code&gt;File mode specification error: (invalid-function (diminish (quote org-indent-mode)))&lt;/code&gt; in messages, which seems like I'm doing something wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A list of other things I've tried that don't work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;org&quot; '(diminish 'org-indent-mode))&#xA;&#xA;(diminish 'org-indent-mode)&#xA;&#xA;(add-hook 'org-mode-hook&#xA;      (lambda ()&#xA;      (diminish 'org-indent-mode))&#xA;&#xA;(defun dim-org-ind-mode ()&#xA;    &quot;Hah, this doesn't work either.&quot;&#xA;    (interactive)&#xA;    (diminish 'org-indent-mode))&#xA;(add-hook 'org-mode-hook 'dim-org-ind-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;M-x diminish&lt;/code&gt; works fine with no errors in messages.&lt;/p&gt;&#xA;" OwnerUserId="12136" LastEditorUserId="675" LastEditDate="2016-05-25T17:03:54.020" LastActivityDate="2021-08-16T05:32:43.040" Title="Diminish org-indent-mode" Tags="|org-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22532" PostTypeId="2" ParentId="22531" CreationDate="2016-05-25T16:49:50.197" Score="1" Body="&lt;p&gt;You're very close! &lt;code&gt;add-hook&lt;/code&gt; expects that you're going to add a &lt;em&gt;function&lt;/em&gt; to a hook, not the evaluation of an expression. You just need to wrap your call to diminish in a lambda, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-indent-mode-hook (lambda () (diminish 'org-indent-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastEditorUserId="10319" LastEditDate="2019-05-17T23:05:29.257" LastActivityDate="2019-05-17T23:05:29.257" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="22533" PostTypeId="2" ParentId="22435" CreationDate="2016-05-25T17:38:24.710" Score="6" Body="&lt;p&gt;This issue occurs if &lt;code&gt;emacs-racer&lt;/code&gt; and &lt;code&gt;company-racer&lt;/code&gt; are both installed. They are distinct packages and are not compatible. Install only &lt;code&gt;emacs-racer&lt;/code&gt; and the function signatures show up as expected.&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2016-05-25T17:38:24.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22534" PostTypeId="1" AcceptedAnswerId="22540" CreationDate="2016-05-25T18:35:22.660" Score="4" ViewCount="2580" Body="&lt;p&gt;Given the following org-mode text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;  :PROPERTIES:&#xA;  :CATEGORY: demo&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it's collapsed, I can cycle between these two states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;  :PROPERTIES:...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I can't see any way of expanding PROPERTIES whilst point is on &lt;code&gt;* Heading&lt;/code&gt;. I can only expand PROPERTIES when point is on that line. This is unlike subheadings, which I can expand even when point is on the toplevel heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want visibility cycling to include PROPERTIES. How can I expand PROPERTIES here?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-05-25T20:13:09.027" Title="How do I expand org sections that only contain properties?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22535" PostTypeId="1" AcceptedAnswerId="22536" CreationDate="2016-05-25T18:55:55.493" Score="2" ViewCount="383" Body="&lt;p&gt;This must be very simple, but I haven't been able to find an answer.&#xA;How can I have org-babel output the results of multiple statements?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ex.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC scheme :exports both&#xA;(define square (lambda (x) (* x x)))&#xA;(define (smallest-divisor n)&#xA;  (define (divides? a b)&#xA;    (= (remainder b a) 0))&#xA;  (define (find-divisor n test-divisor)&#xA;    (cond ((&amp;gt; (square test-divisor) n) n)&#xA;          ((divides? test-divisor n) test-divisor)&#xA;          (else (find-divisor n (+ test-divisor 1)))))&#xA;  (find-divisor n 2))&#xA;&#xA;;; 3 statements follow:&#xA;(smallest-divisor 199)&#xA;(smallest-divisor 1999)&#xA;(smallest-divisor 19999)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like results to give me all values, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;199&#xA;1999&#xA;7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please point me to an answer, should this question happen to be a duplicate.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2016-05-25T19:11:29.290" Title="Org babel - return results of multiple statements" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22536" PostTypeId="2" ParentId="22535" CreationDate="2016-05-25T19:11:29.290" Score="1" Body="&lt;p&gt;The nice thing about org babel is that it has some understanding about the data types for the languages it supports. The solution is to have your scheme code return a list. This seems to work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC scheme :results list&#xA;(define square (lambda (x) (* x x)))&#xA;(define (smallest-divisor n)&#xA;  (define (divides? a b)&#xA;    (= (remainder b a) 0))&#xA;  (define (find-divisor n test-divisor)&#xA;    (cond ((&amp;gt; (square test-divisor) n) n)&#xA;          ((divides? test-divisor n) test-divisor)&#xA;          (else (find-divisor n (+ test-divisor 1)))))&#xA;  (find-divisor n 2))&#xA;&#xA;;; 3 statements follow:&#xA;(list&#xA;  (smallest-divisor 199)&#xA;  (smallest-divisor 1999)&#xA;  (smallest-divisor 19999))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;- 199&#xA;- 1999&#xA;- 7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12157" LastActivityDate="2016-05-25T19:11:29.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22537" PostTypeId="2" ParentId="22534" CreationDate="2016-05-25T19:36:43.853" Score="0" Body="&lt;p&gt;From &lt;code&gt;org-cycle&lt;/code&gt;s doc string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;With a triple C-u prefix argument, show the entire buffer, including any drawers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The info docs don't mention any other way to open or close drawers without moving there. If you want more, it's time to write some elisp!&lt;/p&gt;&#xA;" OwnerUserId="12157" LastActivityDate="2016-05-25T19:36:43.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22538" PostTypeId="2" ParentId="14246" CreationDate="2016-05-25T19:39:45.023" Score="3" Body="&lt;p&gt;Two-and-a-half answers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://endlessparentheses.com/disable-mouse-only-inside-emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Artur Malabarba's init.el code&lt;/a&gt;. The blog post has useful comments.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/4906698/915044&quot;&gt;Victor Deryagin's init.el code&lt;/a&gt; from which Malabarba derived his.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My third &quot;answer&quot; probably only applies to touchpads, but since most folks who have the need to turn off &quot;the mouse&quot; are actually using laptops and are accidentally touching their touchpad, I'll throw it in. (Along with an invitation to anyone who can extend the following to handle the mouse, in which case this post will actually provide 3 answers :-) Though this answer also relies on &lt;code&gt;init.el&lt;/code&gt; code, it is more OS-oriented and X-oriented (and probably Linux-only: &lt;code&gt;OS + X != OSX&lt;/code&gt;), another reason why I'm listing it last.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach calls &lt;a href=&quot;https://wiki.archlinux.org/index.php/Touchpad_Synaptics#Synclient&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;synclient&lt;/code&gt;&lt;/a&gt; or &lt;a href=&quot;http://www.linux.org/threads/cool-tricks-with-xinput-device.6178/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;xinput&lt;/code&gt;&lt;/a&gt; depending on which works for you. First, some details:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;synclient&lt;/code&gt; is the newer/better way to control touchpads, so you should probably prefer it if you have it or can install it. &lt;code&gt;synclient&lt;/code&gt; defines properties which you can set at runtime. The relevant property here is &lt;code&gt;TouchpadOff&lt;/code&gt; which you can check (from a shell) with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;synclient -l | fgrep -e TouchpadOff&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1&lt;/code&gt;==off (think &lt;code&gt;TouchpadOff==true&lt;/code&gt;), &lt;code&gt;0&lt;/code&gt;==on. Unfortunately on my 10-year-old laptop, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ synclient -l | fgrep -e TouchpadOff&#xA;    TouchpadOff             = 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which apparently means &quot;it don't work,&quot; because empirically I can do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;synclient TouchpadOff=1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and nothing happens--my touchpad continues to work. Fortunately I (and perhaps you) can use the {older, less flexible, more likely to break on kernel/configuration change} &lt;code&gt;xinput&lt;/code&gt;. First, check the ID of your touchpad: in my case, it's&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ xinput --list | fgrep -ie touchpad&#xA;⎜   ↳ SynPS/2 Synaptics TouchPad                    id=11   [slave  pointer  (2)]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note you can also do something very similar for your mouse, if you've got one, and control it via the obvious extension of the following procedure. However I'm not discussing that here because &lt;code&gt;synclient&lt;/code&gt; does not--IIUC--provide similar functionality.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can then do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xinput --disable 11&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which actually WFM, and likewise&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xinput --enable 11&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how to wrap all this for &lt;code&gt;init.el&lt;/code&gt;? I defer to any elisp experts who can improve the following--I am certainly lacking in elisp-fu--but here goes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst XINPUT-TOUCHPAD-ID &quot;11&quot;) ; if using xinput, SET TO VALUE APPROPRIATE FOR YOUR DEVICE!&#xA;(defconst XINPUT-DISABLE-TOUCHPAD (concat &quot;xinput --disable &quot; XINPUT-TOUCHPAD-ID))&#xA;(defconst XINPUT-ENABLE-TOUCHPAD  (concat &quot;xinput --enable &quot; XINPUT-TOUCHPAD-ID))&#xA;(defconst SYNCLIENT-DISABLE-TOUCHPAD &quot;synclient TouchpadOff=1&quot;)&#xA;(defconst SYNCLIENT-ENABLE-TOUCHPAD  &quot;synclient TouchpadOff=0&quot;)&#xA;&#xA;;;; TEST YOUR DEVICE before you choose to use `synclient` (preferred) or `xinput`&#xA;(defconst DISABLE-TOUCHPAD XINPUT-DISABLE-TOUCHPAD)&#xA;(defconst ENABLE-TOUCHPAD  XINPUT-ENABLE-TOUCHPAD)&#xA;&#xA;(defun touchpad-off (&amp;amp;optional frame)&#xA;  (interactive)&#xA;  (shell-command DISABLE-TOUCHPAD))&#xA;&#xA;(defun touchpad-on (&amp;amp;optional frame)&#xA;  (interactive)&#xA;  (shell-command ENABLE-TOUCHPAD))&#xA;&#xA;(add-hook 'focus-in-hook #'touchpad-off)&#xA;(add-hook 'focus-out-hook #'touchpad-on)&#xA;(add-hook 'delete-frame-functions #'touchpad-on)&#xA;&#xA;;;; and don't forget to enable the touchpad when you exit Emacs:&#xA;(add-hook 'kill-emacs-hook #'touchpad-on)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once enabled from your &lt;code&gt;init.el&lt;/code&gt;, the above code should turn your touchpad off when any GUI Emacs (errr ... dunno if this works for XEmacs) frame gains focus, and back on when an Emacs frame loses focus.&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-05-26T17:28:19.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22539" PostTypeId="2" ParentId="14246" CreationDate="2016-05-25T19:56:19.513" Score="2" Body="&lt;p&gt;Complementary to the answer that TomRoche provided, you might want to enable &lt;code&gt;mouse-avoidance-mode&lt;/code&gt; which makes sure that the mouse pointer doesn't get in your way, in boring or more entertaining ways. Have fun!&lt;/p&gt;&#xA;" OwnerUserId="12157" LastActivityDate="2016-05-25T19:56:19.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22540" PostTypeId="2" ParentId="22534" CreationDate="2016-05-25T20:06:50.410" Score="8" Body="&lt;p&gt;&lt;code&gt;org-show-subtree&lt;/code&gt; is actually doing its job when cycling. It shows the contents of the drawer (like &lt;code&gt;:PROPERTIES:&lt;/code&gt;). But, &lt;code&gt;org-cycle-hide-drawers&lt;/code&gt; in &lt;code&gt;org-cycle-hook&lt;/code&gt; hides the drawers again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good thing is that you can customize &lt;code&gt;org-cycle-hook&lt;/code&gt; and remove &lt;code&gt;org-cycle-hide-drawers&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just cite the customization page for this option here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org Cycle Hook:&#xA;INS DEL org-cycle-hide-archived-subtrees&#xA;INS DEL org-cycle-hide-drawers&#xA;INS DEL org-cycle-show-empty-lines&#xA;INS DEL org-optimize-window-after-visibility-change&#xA;INS&#xA;    State : STANDARD.&#xA;   Hook that is run after ‘org-cycle’ has changed the buffer visibility. Hide&#xA;   The function(s) in this hook must accept a single argument which indicates&#xA;   the new state that was set by the most recent ‘org-cycle’ command.  The&#xA;   argument is a symbol.  After a global state change, it can have the values&#xA;   ‘overview’, ‘contents’, or ‘all’.  After a local state change, it can have&#xA;   the values ‘folded’, ‘children’, or ‘subtree’.&#xA;Groups: Org Cycle&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively you could bind another key (e.g., &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;s&lt;/kbd&gt;) for showing the full subtree:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda ()&#xA;                           (local-set-key (kbd &quot;C-c s&quot;) 'org-show-subtree)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-05-25T20:13:09.027" LastActivityDate="2016-05-25T20:13:09.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22541" PostTypeId="2" ParentId="22504" CreationDate="2016-05-25T21:24:14.967" Score="1" Body="&lt;p&gt;&lt;code&gt;qlmanage&lt;/code&gt; is a command-line utility built-in to OSX, so this answer only relates to using &lt;code&gt;dired-mode&lt;/code&gt; with Emacs on OSX.  I have left in the messages to help me better see what is happening, but they are not needed for this answer to work properly.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired)&#xA;(require 'cl)&#xA;&#xA;(defvar my-dired-spawn nil)&#xA;(make-variable-buffer-local 'my-dired-spawn)&#xA;&#xA;;; http://stackoverflow.com/a/20023781/2112489&#xA;(defun my-dired-kill-last-process-named (name)&#xA;&quot;Function initially written by @wvxvw, and revised by @lawlist.&quot;&#xA;  (let (p)&#xA;    (cl-loop with name-re = &#xA;             (format &quot;^%s\\(?:&amp;lt;\\([[:digit:]]+\\)&amp;gt;\\)?&quot; (regexp-quote name))&#xA;     for process in (process-list)&#xA;     for pname = (process-name process)&#xA;     if (string-match name-re pname)&#xA;     collect (cons (string-to-number (or (match-string 1 pname) &quot;0&quot;)) process)&#xA;     into processes&#xA;     finally&#xA;      (let ((process (cdar (cl-sort processes '&amp;gt; :key 'car))))&#xA;        (when (and process (get-process process))&#xA;          (delete-process process)&#xA;          (setq p process)))) p))&#xA;&#xA;(defun my-dired-qlmanage ()&#xA;(interactive)&#xA;  (unless (my-dired-kill-last-process-named &quot;qlmanage&quot;)&#xA;    (let* ((current-node (dired-get-file-for-visit)))&#xA;      (set-process-sentinel&#xA;        (start-process &quot;qlmanage&quot; nil &quot;/usr/bin/qlmanage&quot; &quot;-p&quot; current-node)&#xA;        (lambda (p e)&#xA;          (setq e (replace-regexp-in-string &quot;\n$&quot; &quot;&quot; e))&#xA;          (cond&#xA;            ((and (null my-dired-spawn) (= 9 (process-exit-status p)))&#xA;              (message &quot;OFF: my-dired-qlmanage (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e))&#xA;            ((and my-dired-spawn (= 9 (process-exit-status p)))&#xA;              (message &quot;OFF/ON: my-dired-qlmanage (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e)&#xA;              (my-dired-kill-spawn))&#xA;            ((= 0 (process-exit-status p))&#xA;              (message &quot;OFF (mouse clicked): my-dired-qlmanage (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e))&#xA;            (t&#xA;              (message &quot;ABNORMAL: my-dired-qlmanage (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e))))))))&#xA;&#xA;(defun my-dired-kill-spawn ()&#xA;&quot;This is essentially a three level incursion, starting with `my-dired-qlmanage'&#xA;and then calling `my-dired-kill-spawn' twice.&quot;&#xA;(interactive)&#xA;  (let* ((current-node (dired-get-file-for-visit)))&#xA;    (set-process-sentinel&#xA;      (start-process &quot;qlmanage&quot; nil &quot;/usr/bin/qlmanage&quot; &quot;-p&quot; current-node)&#xA;      (lambda (p e)&#xA;        (setq e (replace-regexp-in-string &quot;\n$&quot; &quot;&quot; e))&#xA;        (cond&#xA;          ((and (null my-dired-spawn) (= 9 (process-exit-status p)))&#xA;            (message &quot;OFF: my-dired-kill-spawn (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e))&#xA;          ((and my-dired-spawn (= 9 (process-exit-status p)))&#xA;            (message &quot;OFF/ON: my-dired-kill-spawn (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e)&#xA;            (my-dired-kill-spawn))&#xA;          ((= 0 (process-exit-status p))&#xA;            (message &quot;OFF (mouse clicked): my-dired-kill-spawn (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e))&#xA;          (t&#xA;            (message &quot;ABNORMAL: my-dired-kill-spawn (%s) | %s | %s&quot;&#xA;              (process-exit-status p) p e)))))))&#xA;&#xA;(defun my-dired-previous-line (arg)&#xA;(interactive &quot;^p&quot;)&#xA;  (dired-previous-line arg)&#xA;  (let ((my-dired-spawn t))&#xA;    (my-dired-kill-last-process-named &quot;qlmanage&quot;)))&#xA;&#xA;(defun my-dired-next-line (arg)&#xA;(interactive &quot;^p&quot;)&#xA;  (dired-next-line arg)&#xA;  (let ((my-dired-spawn t))&#xA;    (my-dired-kill-last-process-named &quot;qlmanage&quot;)))&#xA;&#xA;(defun my-dired-quicklook ()&#xA;(interactive)&#xA;  (my-dired-qlmanage))&#xA;&#xA;(eval-after-load &quot;dired&quot; '(progn&#xA;  (define-key dired-mode-map [down] 'my-dired-next-line)&#xA;  (define-key dired-mode-map [up] 'my-dired-previous-line)&#xA;  (define-key dired-mode-map (kbd &quot;SPC&quot;) 'my-dired-quicklook)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/dired_qlmanage_a.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2019-06-29T18:24:52.600" LastActivityDate="2019-06-29T18:24:52.600" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="22542" PostTypeId="1" AcceptedAnswerId="22550" CreationDate="2016-05-25T21:33:02.157" Score="10" ViewCount="1005" Body="&lt;p&gt;This causes an error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-destructuring-bind &#xA;    (&amp;amp;key a b) &#xA;    '(:a &quot;foo&quot; :b 13 :c &quot;bar&quot;) &#xA;  (list a b)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because the &lt;code&gt;:c&lt;/code&gt; key/value is not handled in the pattern match. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often I find myself wanting to extract some subset of keys/values from a plist, but &lt;code&gt;cl-destructuring-bind&lt;/code&gt; isn't appropriate because of this limitation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make &lt;code&gt;cl-destructuring-bind&lt;/code&gt; simply ignore unmatched keys in the EXPR? I'm not sure what the official common lisp behaviour is supposed to be here, is the error in the spec? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the dash library has some support for a similar destructuring with &lt;code&gt;-let&lt;/code&gt;, but that requires some boilerplate to assign a symbol to each key. A &lt;a href=&quot;https://github.com/magnars/dash.el/issues/111&quot; rel=&quot;nofollow&quot;&gt;fix has been proposed&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking Stefan's answer into account, this works well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro plist-bind (args expr &amp;amp;rest body)&#xA;  &quot;`destructuring-bind' without the boilerplate for plists.&quot;&#xA;  `(cl-destructuring-bind&#xA;       (&amp;amp;key ,@args &amp;amp;allow-other-keys)&#xA;       ,expr&#xA;     ,@body))&#xA;&#xA;(plist-bind&#xA;  (a b)&#xA; '(:a &quot;foo&quot; :b 13 :c &quot;bar&quot;)&#xA; (list a b)) =&amp;gt; (&quot;foo&quot; 13)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="5142" LastEditDate="2016-05-29T09:12:53.830" LastActivityDate="2022-02-24T15:15:02.263" Title="cl-destructuring-bind on partial plist?" Tags="|common-lisp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22543" PostTypeId="1" CreationDate="2016-05-25T21:38:47.067" Score="2" ViewCount="242" Body="&lt;p&gt;There is some support for &lt;code&gt;defclass&lt;/code&gt;es as alists in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eieio/&quot; rel=&quot;nofollow&quot;&gt;EIEIO&lt;/a&gt; but I was wondering if there is any support to read/write a &lt;code&gt;defclass&lt;/code&gt; as a property list (plist)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. using the example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defclass record () ; No superclasses&#xA;  ((name :initarg :name&#xA;         :initform &quot;&quot;&#xA;         :type string&#xA;         :custom string&#xA;         :documentation &quot;The name of a person.&quot;)&#xA;   (birthday :initarg :birthday&#xA;             :initform &quot;Jan 1, 1970&quot;&#xA;             :custom string&#xA;             :type string&#xA;             :documentation &quot;The person's birthday.&quot;)&#xA;   (phone :initarg :phone&#xA;          :initform &quot;&quot;&#xA;          :documentation &quot;Phone number.&quot;))&#xA;  &quot;A single record for tracking people I know.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it would be good to be able to create an instance of this class and then be able to marshall it into a plist (e.g. for over-the-wire transfer)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:name &quot;Sam&quot; :birthday &quot;Jan 1, 1980&quot; :phone &quot;0123456789&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and be able to do the opposite: take a plist (and the class name &lt;code&gt;'record&lt;/code&gt;) and turn it into an instance of &lt;code&gt;record&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some ambiguity around using the slot name, initarg, or accessor name,  so I'd suggest just using the initarg for everything to be consistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When there is a hierarchy involved, it would be good to include the name of the class in the plist, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:type 'record :name &quot;Sam&quot; :birthday &quot;Jan 1, 1980&quot; :phone &quot;0123456789&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am only really looking for support for Algebraic Data Types: products (simple classes) and coproducts (children of a parent, sealed traits in scala terms).&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="14920" LastEditDate="2018-09-08T21:27:15.133" LastActivityDate="2018-09-08T21:27:15.133" Title="EIEIO defclasses as plists" Tags="|property-lists|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22544" PostTypeId="1" CreationDate="2016-05-25T21:42:02.083" Score="0" ViewCount="108" Body="&lt;p&gt;common lisp has a &lt;a href=&quot;http://www.gigamonkeys.com/book/object-reorientation-classes.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;with-accessors&lt;/code&gt;&lt;/a&gt; macro which is pretty useful but it is still prone to lots of code duplication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a convenient let/binding macro that makes all accessors from a &lt;code&gt;defclass&lt;/code&gt; available as variables without having to name them all in advance? It would require a magical lookup of the class accessor definition at macro expansion time and I'm not sure if that's possible.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="105" LastEditDate="2016-05-25T22:49:35.160" LastActivityDate="2016-05-25T22:49:35.160" Title="with-accessors for all accessors?" Tags="|elisp-macros|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22545" PostTypeId="2" ParentId="22430" CreationDate="2016-05-25T23:03:09.923" Score="1" Body="&lt;p&gt;The problem was that in my .emacs I had&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ace-jump-mode&#xA;   :ensure t&#xA;   :defer t&#xA;   :bind* ((&quot;C-c SPC&quot; . ace-jump-mode)&#xA;           (&quot;C-c C-c SPC&quot; . ace-jump-mode-pop-mark))&#xA;   :config (ace-jump-mode-enable-mark-sync))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &quot;C-c C-c&quot; default behaviour was overridden by &quot;C-c C-c SPC&quot;. I changed it and the default behaviour Is BACK :D.&#xA;Thanks for the help&lt;/p&gt;&#xA;" OwnerUserId="12109" LastActivityDate="2016-05-25T23:03:09.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22547" PostTypeId="1" AcceptedAnswerId="22594" CreationDate="2016-05-26T00:13:57.650" Score="5" ViewCount="299" Body="&lt;p&gt;While writing in org mode for export to Beamer, I've found myself creating empty headings to control structure. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* &#xA;Aliquam erat volutpat.  Nunc eleifend leo vitae magna.  In id erat non orci commodo lobortis. &#xA;* &#xA;Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus.&#xA;** &#xA;Sed diam.  Praesent fermentum tempor tellus.  Nullam tempus. &#xA;** &#xA;Mauris ac felis vel velit tristique imperdiet.  Donec at pede.&#xA;* &#xA;Etiam vel neque nec dui dignissim bibendum.  Vivamus id enim.&#xA;** &#xA;Phasellus neque orci, porta a, aliquet quis, semper a, massa.  Phasellus purus.  Pellentesque tristique imperdiet tortor.  Nam euismod tellus id erat.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine, but if the headlines have tags, the tags are treated as the title (this occurs when adding beamer properties). For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* :lorem:&#xA;Aliquam erat volutpat.  Nunc eleifend leo vitae magna.  In id erat non orci commodo lobortis. &#xA;* :ipsum:&#xA;Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus.&#xA;** :dolor:&#xA;Sed diam.  Praesent fermentum tempor tellus.  Nullam tempus. &#xA;** :sit:&#xA;Mauris ac felis vel velit tristique imperdiet.  Donec at pede.&#xA;* :amet:&#xA;Etiam vel neque nec dui dignissim bibendum.  Vivamus id enim.&#xA;** :whatever:&#xA;Phasellus neque orci, porta a, aliquet quis, semper a, massa.  Phasellus purus.  Pellentesque tristique imperdiet tortor.  Nam euismod tellus id erat.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this intended behavior? Is there a setting?&lt;/p&gt;&#xA;" OwnerUserId="6761" LastActivityDate="2016-05-27T21:35:51.780" Title="Org mode: export empty heading with tags" Tags="|org-mode|org-export|beamer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22548" PostTypeId="2" ParentId="21840" CreationDate="2016-05-26T00:52:35.987" Score="12" Body="&lt;p&gt;You should also be able to &lt;code&gt;C-z&lt;/code&gt; to enter normal emacs mode, and then another &lt;code&gt;C-z&lt;/code&gt; to go back to evil. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2016-05-26T00:52:35.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22550" PostTypeId="2" ParentId="22542" CreationDate="2016-05-26T01:18:44.153" Score="11" Body="&lt;p&gt;Since &lt;code&gt;cl-destructuring-bind&lt;/code&gt; uses CommonLisp's arglist convention, you should be able to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-destructuring-bind &#xA;    (&amp;amp;key a b &amp;amp;allow-other-keys) &#xA;    '(:a &quot;foo&quot; :b 13 :c &quot;bar&quot;) &#xA;  (list a b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-05-26T01:18:44.153" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22552" PostTypeId="2" ParentId="22531" CreationDate="2016-05-26T08:32:47.397" Score="7" Body="&lt;p&gt;Your &lt;code&gt;eval-after-load&lt;/code&gt; is close to correct. Check out &lt;code&gt;C-h f org-indent-mode&lt;/code&gt; (after Org is loaded):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;org-indent-mode is an interactive autoloaded compiled Lisp function in `org-indent.el'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Diminish hacks directly into the variable &lt;code&gt;minor-mode-alist&lt;/code&gt;, so the call to it must occur after &lt;code&gt;org-indent.el&lt;/code&gt; has been loaded, not just &lt;code&gt;org.el&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'org-indent&#xA;  (require 'diminish)&#xA;  (diminish 'org-indent-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9314" LastEditorUserId="2274" LastEditDate="2021-08-16T05:32:43.040" LastActivityDate="2021-08-16T05:32:43.040" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22554" PostTypeId="1" CreationDate="2016-05-26T12:04:52.797" Score="1" ViewCount="1184" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/dominikh/go-mode.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;go-mode&lt;/a&gt;, inside a rune hitting the tab key doesn't add the tab character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var foobar = `&#xA;If I place the point at the start of this line and press tab it wouldn't add the tab character :(&#xA;`&#xA;var barfoo = 1 // I expect the tab character not to be added if I do the same  here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying what's proposed &lt;a href=&quot;https://emacs.stackexchange.com/a/19807/8223&quot;&gt;here&lt;/a&gt; doesn't do it.&lt;/p&gt;&#xA;" OwnerUserId="8223" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-05-26T12:12:26.973" Title="How to add tab character while inside a rune (or string) in go-mode?" Tags="|golang|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22555" PostTypeId="1" CreationDate="2016-05-26T12:20:04.343" Score="3" ViewCount="120" Body="&lt;p&gt;Using 24.5.1 on OpenBSD 5.9. OpenBSD's sndiod listens for XF86AudioLowerVolume and the rest, but if emacs is running in graphical mode with either GTK2 or GTK3 (I haven't tried lucid/AWT, but I will if somebody thinks that will make a difference) instead of sndiod receiving that keypress, emacs writes &quot;&amp;lt;XF86AudioLowerVolume&amp;gt; is undefined&quot; in the echo area and sndiod never receives the key, so if I want to change the volume I have to un-focus emacs (which can be problematic in a tiling wm). It works fine in terminal mode, presumably because the controlling terminal knows to ignore the event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tell emacs to ignore certain keypresses when it has focus?&lt;/p&gt;&#xA;" OwnerUserId="12176" LastActivityDate="2016-05-26T12:20:04.343" Title="How can I tell emacs to ignore the XF86AudioFoo keys?" Tags="|keystrokes|x11|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22556" PostTypeId="1" AcceptedAnswerId="22570" CreationDate="2016-05-26T13:24:55.090" Score="0" ViewCount="2258" Body="&lt;p&gt;I installed the &lt;a href=&quot;https://github.com/mooz/auto-complete-c-headers&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;auto-complete-c-headers&lt;/code&gt; package&lt;/a&gt; and added the following in my Emacs configuration file&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;; start auto-complete with emacs&#xA;(require 'auto-complete)&#xA;; do default config for auto-complete&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;; let's define a function which initializes auto-complete-c-headers and gets called for c/c++ hooks&#xA;(defun my:ac-c-header-init ()&#xA;(require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-headers)&#xA;  (add-to-list 'achead:include-directories '&amp;quot;/usr/include/c++/4.8&#xA; /usr/include/x86_64-linux-gnu/c++/4.8&#xA; /usr/include/c++/4.8/backward&#xA; /usr/lib/gcc/x86_64-linux-gnu/4.8/include&#xA; /usr/local/include&#xA; /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed&#xA; /usr/include/x86_64-linux-gnu&#xA; /usr/include&#xA;&amp;quot;))&#xA;; now let's call this funcion from c/c++ hooks&#xA;(add-hook 'c++-mode-hook 'my:ac-c-header-init)&#xA;(add-hook 'c-mode-hook 'my:ac-c-header-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I included the directories listed by the command &lt;code&gt;gcc -xc++ -E -v -&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The autocomplete works fine with C header files, but does nothing with the C++ ones.&lt;/p&gt;&#xA;" OwnerDisplayName="user12177" LastEditorUserId="29861" LastEditorDisplayName="user12177" LastEditDate="2020-09-23T18:18:48.513" LastActivityDate="2020-09-23T18:19:08.833" Title="auto-complete-c-headers just works with C. No result with C++" Tags="|init-file|auto-complete-mode|c|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22557" PostTypeId="1" AcceptedAnswerId="22565" CreationDate="2016-05-26T13:39:01.757" Score="71" ViewCount="17363" Body="&lt;p&gt;I have 2 commits, A then B, ready to be pushed. I realize I forgot to add something in A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I add this change to A using Magit? I don't even know which part of the Git documentation I should look at.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2016-05-26T17:02:54.263" LastActivityDate="2022-03-15T15:33:33.503" Title="Add change to a previous commit with Magit" Tags="|magit|git|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22558" PostTypeId="2" ParentId="22557" CreationDate="2016-05-26T13:56:30.167" Score="3" Body="&lt;p&gt;&lt;code&gt;git commit --amend –C HEAD&lt;/code&gt; is the Git command you want to be looking for, and you can do amends in Magit with &lt;code&gt;C-c C-a&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2016-05-26T13:56:30.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22559" PostTypeId="2" ParentId="22557" CreationDate="2016-05-26T14:55:27.200" Score="3" Body="&lt;p&gt;So one workflow is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;make your change&lt;/li&gt;&#xA;&lt;li&gt;c (commit) f (fixup - select commit your fixing)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;r (rebase) -a (autosquash, can be defaulted) i (interactive)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The autosquash will automatically move all !fixup commits to the right place and set them to be squashed on the re-base.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2016-05-26T14:55:27.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22560" PostTypeId="2" ParentId="17010" CreationDate="2016-05-26T15:51:11.480" Score="2" Body="&lt;p&gt;&lt;strong&gt;Scenario 1:&lt;/strong&gt; You are editing your own files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, and if possible, it's better to identify the kind of HTML file you are editing by a unique extension: .djhtml for django files, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Scenario 2:&lt;/strong&gt; You are editing your own files, but for some reason you are obliged to use the generic .html extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add a comment to your .html file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php /* -*- engine:php -*- */ ?&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Scenario 3:&lt;/strong&gt; You are editing (or just browsing) someone else's files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now you are unable to change the file extension or to introduce a comment line in each file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-engines-alist '((&quot;php&quot; . &quot;\\.html\\'&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your .emacs, but beware that you are now in &quot;php-only mode&quot;, in the sense that if you view/edit a .html file that contains, say, django markups, it will still be interpreted as php.&lt;/p&gt;&#xA;" OwnerUserId="3922" LastActivityDate="2016-05-26T15:51:11.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22561" PostTypeId="1" CreationDate="2016-05-26T16:29:59.740" Score="2" ViewCount="1937" Body="&lt;p&gt;When I write, for example, &lt;code&gt;(format &quot;The value is %d.&quot; fill-column)&lt;/code&gt; and type &lt;code&gt;C-c p&lt;/code&gt; after it, it outputs a result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I do the same with a shell command? That is, to run a shell command within a emacs buffer in org-mode and insert the result in the same buffer? &lt;/p&gt;&#xA;" OwnerUserId="9320" LastEditorUserId="105" LastEditDate="2016-06-22T19:43:23.927" LastActivityDate="2016-06-22T19:43:23.927" Title="Run a shell command as lisp" Tags="|shell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22563" PostTypeId="2" ParentId="22557" CreationDate="2016-05-26T17:01:13.730" Score="1" Body="&lt;p&gt;For amending the last commit, it's &amp;quot;c a&amp;quot;. Fixup is for amending some older commit.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="14825" LastEditDate="2022-03-15T15:33:33.503" LastActivityDate="2022-03-15T15:33:33.503" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="22564" PostTypeId="2" ParentId="22561" CreationDate="2016-05-26T17:04:45.673" Score="8" Body="&lt;p&gt;Interactively, &lt;code&gt;C-u M-!&lt;/code&gt; (i.e., &lt;code&gt;shell-command&lt;/code&gt; with the universal argument prefix) will prompt you for a shell command and insert the output in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this from elisp code, see the comment from @lawlist&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; also has fairly sophisticated methods of its own for evaluating code, including both inline code and code blocks. First, you need to activate the languages you wish to use by setting the variable &lt;code&gt;org-babel-load-languages&lt;/code&gt;. For bash scripts, you need to activate the language &lt;code&gt;sh&lt;/code&gt;. After that, you can refer to bash code inline, as &lt;code&gt;src_sh{&amp;lt;your code&amp;gt;}&lt;/code&gt;, or in separate code blocks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC bash&#xA;&amp;lt;your code here&amp;gt;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then have the results of evaluating the code by typing &lt;code&gt;C-c C-c&lt;/code&gt; while point is in the block. The result looks like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here's an inline call to ~pwd~: src_sh{pwd} {{{results(=/home/tws/scratch=)}}}      &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;And here's a short bash script as a code block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC bash&#xA;ls&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| clean-defun.el |&#xA;| find           |&#xA;| helm-test.el   |&#xA;| helm-test.el~  |&#xA;| #tmp.org#      |&#xA;| tmp.org        |&#xA;| tmp.org~       |&#xA;| tmp.pwd        |&#xA;| tmp.R          |&#xA;| tmp.R~         |&#xA;| tmp.txt        |&#xA;| tmp.txt~       |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See its manual &lt;a href=&quot;http://orgmode.org/manual/Evaluating-code-blocks.html&quot;&gt;(org) Evaluating code blocks&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-05-27T00:38:26.763" LastActivityDate="2016-05-27T00:38:26.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22565" PostTypeId="2" ParentId="22557" CreationDate="2016-05-26T19:55:42.843" Score="128" Body="&lt;p&gt;Let's pretend for a moment that you want to add something to the &lt;code&gt;HEAD&lt;/code&gt; commit, i.e. &quot;the second commit B&quot; in your example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The commit popup on &lt;kbd&gt;c&lt;/kbd&gt; features a binding &quot;&lt;kbd&gt;a&lt;/kbd&gt; Amend&quot;. Pressing that key will &quot;amend&quot; the staged changes to the &lt;code&gt;HEAD&lt;/code&gt; commit. Since commits are not mutable in Git, this will actually replace the old commit with a new commit. A buffer with the old commit message will pop up, so that you can modify it in case the added change also requires that you adjust the message. As always, press &lt;kbd&gt;C-c C-c&lt;/kbd&gt; when you are done editing the message. This is equivalent to running &lt;code&gt;git commit --amend&lt;/code&gt; on the command line.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;a&lt;/kbd&gt; &lt;strong&gt;Amend&lt;/strong&gt; -- add the staged changes to &lt;code&gt;HEAD&lt;/code&gt; and edit its commit message&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Because it often happens that you only have to adjust the change &lt;em&gt;or&lt;/em&gt; the message, Magit provides two additional variants:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;e&lt;/kbd&gt; &lt;strong&gt;Extend&lt;/strong&gt; -- add the staged changes to &lt;code&gt;HEAD&lt;/code&gt; without editing the commit message&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;w&lt;/kbd&gt; &lt;strong&gt;Reword&lt;/strong&gt;-- change the message of &lt;code&gt;HEAD&lt;/code&gt; without adding the staged changes to it&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When you want to edit a commit that isn't &lt;code&gt;HEAD&lt;/code&gt;, then the above won't work. These commands always &quot;modify&quot; (i.e. replace) the &lt;code&gt;HEAD&lt;/code&gt; commit. Git doesn't provide a single command for modifying a commit other than &lt;code&gt;HEAD&lt;/code&gt; so this is a bit more involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit &lt;em&gt;does&lt;/em&gt; provide such a command, but because there are situations in which it is preferable to do this in multiple steps, we will discuss that first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modifying a commit other than &lt;code&gt;HEAD&lt;/code&gt; can be broken down into three steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Temporarily make that other commit (&lt;code&gt;A&lt;/code&gt;) the &lt;code&gt;HEAD&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Modify the &lt;code&gt;HEAD&lt;/code&gt; (as described above), resulting in commit &lt;code&gt;A'&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Tell Git to reapply the commits that followed &lt;code&gt;A&lt;/code&gt;, but on top of &lt;code&gt;A'&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This can be done using an interactive rebase. Type &lt;kbd&gt;r&lt;/kbd&gt; to show the rebase popup. Then type &lt;kbd&gt;m&lt;/kbd&gt; to invoke the &quot;edit a commit&quot; rebase variant. A buffer with recent commits appears. Move to the commit you want to modify and type &lt;kbd&gt;C-c C-c&lt;/kbd&gt; to select it. Git then rewinds history to that commit and shows information about the ongoing rebase in the status buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modify &lt;code&gt;HEAD&lt;/code&gt; as described above. Then tell Git that you are done by typing &lt;kbd&gt;r r&lt;/kbd&gt;. If &lt;code&gt;A'&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; conflict then rebase will stop at &lt;code&gt;B&lt;/code&gt; and you have to resolve the conflict. After you have done so press &lt;kbd&gt;r r&lt;/kbd&gt; to continue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know that your changes to &lt;code&gt;A&lt;/code&gt; will result in conflicts with &lt;code&gt;B&lt;/code&gt;, then proceed as describe above, otherwise use the following approach.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Git allows creating &quot;fixup commits&quot; using &lt;code&gt;git commit --fixup A&lt;/code&gt;. This creates a &lt;em&gt;new&lt;/em&gt; commit, which records changes which &quot;should have been made in another commit&quot;. That commit becomes the new &lt;code&gt;HEAD&lt;/code&gt;. There also exists a &lt;code&gt;--squash&lt;/code&gt; variant. For information about the differences see the &lt;code&gt;git-commit&lt;/code&gt; man page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To actually combine the &lt;code&gt;A&lt;/code&gt; commit and the new commit &lt;code&gt;A'&lt;/code&gt; and then reapply &lt;code&gt;B&lt;/code&gt; on top of that you have to use rebase. Magit provides a convenient command for doing so on &lt;kbd&gt;r f&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main difference to the above approach is that here we first create a new commit and &lt;em&gt;then&lt;/em&gt; we rebase to combine that with the &quot;target&quot; and reapply &lt;code&gt;B&lt;/code&gt;. Above we began with rebasing instead of committing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Magit both the &lt;code&gt;--fixup&lt;/code&gt; and the &lt;code&gt;--squash&lt;/code&gt; variants are available from the commit popup, on &lt;kbd&gt;f&lt;/kbd&gt; and &lt;kbd&gt;s&lt;/kbd&gt;. But Magit also provides &quot;instant&quot; variants of the fixup and squash commands on &lt;kbd&gt;F&lt;/kbd&gt; and &lt;kbd&gt;S&lt;/kbd&gt;. These variants create a new commit like the &quot;non-instant&quot; variants, but then they instantly combine the fixup commit with the target commit using rebase, without you having to invoke another command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;Instant fixup&quot; (&lt;kbd&gt;c F&lt;/kbd&gt;) is essentially the same thing as &quot;extend &lt;code&gt;HEAD&lt;/code&gt;&quot; (&lt;kbd&gt;c e&lt;/kbd&gt;), except that it works for any commit, not just &lt;code&gt;HEAD&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Further reading:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://git-scm.com/docs/git-commit&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;git-commit(1)&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://git-scm.com/docs/git-rebase&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;git-rebase(1)&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://magit.vc/manual/magit/Initiating-a-commit.html&quot; rel=&quot;noreferrer&quot;&gt;Initiating a commit&lt;/a&gt; node&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://magit.vc/manual/magit/Rebasing.html&quot; rel=&quot;noreferrer&quot;&gt;Rebasing&lt;/a&gt; node&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/magit/magit/wiki/History-Manipulation&quot; rel=&quot;noreferrer&quot;&gt;History Manipulation&lt;/a&gt; wiki page&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-01-25T09:49:56.040" LastActivityDate="2017-01-25T09:49:56.040" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22566" PostTypeId="2" ParentId="3923" CreationDate="2016-05-26T19:56:08.843" Score="2" Body="&lt;p&gt;Have a look at the package : &lt;a href=&quot;https://github.com/ludwigpacifici/modern-cpp-font-lock&quot; rel=&quot;nofollow&quot;&gt;&quot;Modern C++&quot; font-lock for Emacs&lt;/a&gt;. It is also available on &lt;a href=&quot;http://melpa.org/#/modern-cpp-font-lock&quot; rel=&quot;nofollow&quot;&gt;Melpa&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Syntax highlighting support for &quot;Modern C++&quot; - until C++17 and&#xA;  Technical Specification. This package aims to provide a simple&#xA;  highlight of the C++ language without dependency.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is recommended to use it in addition with the c++-mode major mode&#xA;  for extra highlighting (user defined types, functions, etc.) and&#xA;  indentation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am the maintainer of this minor mode. Any feedback is appreciated.&lt;/p&gt;&#xA;" OwnerDisplayName="user12181" LastEditorDisplayName="user12181" LastEditDate="2016-06-09T14:54:59.300" LastActivityDate="2016-06-09T14:54:59.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22567" PostTypeId="1" AcceptedAnswerId="22572" CreationDate="2016-05-27T00:32:18.243" Score="0" ViewCount="74" Body="&lt;p&gt;I'm using the windmove package to move my cursor between windows. In addition, I want to define a function to move twice, e.g. down first and right second. The following function only do the &quot;down&quot; move but not the &quot;right&quot; move. Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun windmove-diagonal ()&#xA;    (interactive)&#xA;    (windmove-down)&#xA;    (windmove-right)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12186" LastActivityDate="2016-05-27T05:09:22.147" Title="windmove: write a function to move two times (e.g. down and right)?" Tags="|functions|motion|window-point|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22568" PostTypeId="2" ParentId="22567" CreationDate="2016-05-27T00:43:19.850" Score="0" Body="&lt;p&gt;Your code works for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect what's happening is that the position of the cursor after moving &quot;down&quot; is &lt;em&gt;not&lt;/em&gt; such that you can reach the next desired window by moving &quot;right&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to compare by performing the commands manually (without moving point in any of the affected buffers).&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-27T00:43:19.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22569" PostTypeId="1" AcceptedAnswerId="22571" CreationDate="2016-05-27T01:37:32.703" Score="1" ViewCount="1715" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I use &lt;code&gt;y-or-n-p&lt;/code&gt; -- &lt;em&gt;instead of&lt;/em&gt; &lt;code&gt;yes-or-no-p&lt;/code&gt; -- when calling &lt;code&gt;kill-buffer&lt;/code&gt; for just the duration of a particular function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I want the behavior of &lt;code&gt;(fset 'yes-or-no-p 'y-or-n-p)&lt;/code&gt; but only for the duration of a particular function without any lasting effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CAVEAT&lt;/strong&gt;:  I would like to please avoid using &lt;code&gt;(fset 'yes-or-no-p 'y-or-n-p)&lt;/code&gt; at the outset and &lt;code&gt;(fset 'yes-or-no-p 'yes-or-no-p)&lt;/code&gt; at the tail end of the function, just in case I decide to exit out of the function with a &lt;code&gt;'quit&lt;/code&gt; signal such as &lt;code&gt;C-g&lt;/code&gt;, in which case the effect would become long-lasting rather than merely temporary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a test snippet to start with:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let* (&#xA;    (filename &quot;/private/tmp/foofile&quot;)&#xA;    (buf (get-buffer-create &quot;*foo*&quot;)))&#xA;  (with-current-buffer buf&#xA;    (write-file filename)&#xA;    (insert &quot;Every good boy deserves fudge.&quot;))&#xA;  (kill-buffer buf)&#xA;  (delete-file filename))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-05-27T01:44:23.360" LastActivityDate="2016-05-27T14:21:28.510" Title="kill-buffer with y-or-n-p instead of yes-or-no-p" Tags="|kill-buffer|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22570" PostTypeId="2" ParentId="22556" CreationDate="2016-05-27T04:17:29.987" Score="0" Body="&lt;p&gt;It looks like you are incorrectly adding the C++ headers to &lt;code&gt;achead:include-directories&lt;/code&gt;.  Each header should be a separate item in the list, not the Heredoc-like syntax you're using.  You are prepending just one string with embedded newlines, which of course does not exist on disk.  Instead of:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-headers)&#xA;  (add-to-list 'achead:include-directories '&amp;quot;/usr/include/c++/4.8&#xA; /usr/include/x86_64-linux-gnu/c++/4.8&#xA; /usr/include/c++/4.8/backward&#xA; /usr/lib/gcc/x86_64-linux-gnu/4.8/include&#xA; /usr/local/include&#xA; /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed&#xA; /usr/include/x86_64-linux-gnu&#xA; /usr/include&#xA;&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-headers)&#xA;  (setq achead:include-directories&#xA;   (append '(&amp;quot;/usr/include/c++/4.8&amp;quot;&#xA;             &amp;quot;/usr/include/x86_64-linux-gnu/c++/4.8&amp;quot;&#xA;             &amp;quot;/usr/include/c++/4.8/backward&amp;quot;&#xA;             &amp;quot;/usr/lib/gcc/x86_64-linux-gnu/4.8/include&amp;quot;&#xA;             &amp;quot;/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed&amp;quot;&#xA;             &amp;quot;/usr/include/x86_64-linux-gnu&amp;quot;)&#xA;             achead:include-directories)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The C header files probably work because by default, the package adds &lt;code&gt;/usr/include&lt;/code&gt; and &lt;code&gt;/usr/local/include&lt;/code&gt; to &lt;code&gt;achead:include-directories&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6615" LastEditorUserId="29861" LastEditDate="2020-09-23T18:19:08.833" LastActivityDate="2020-09-23T18:19:08.833" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="22571" PostTypeId="2" ParentId="22569" CreationDate="2016-05-27T04:53:22.887" Score="3" Body="&lt;p&gt;Advice &lt;code&gt;kill-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yes-or-no-p-&amp;gt;-y-or-n-p (orig-fun &amp;amp;rest r)&#xA;  (cl-letf (((symbol-function 'yes-or-no-p) #'y-or-n-p))&#xA;    (apply orig-fun r)))&#xA;&#xA;(advice-add 'kill-buffer :around #'yes-or-no-p-&amp;gt;-y-or-n-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or advice &lt;code&gt;yes-or-no-p&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yes-or-no-p@maybe-just-y-or-n-p (orig-fun prompt)&#xA;  (funcall&#xA;   (if (eq this-command 'kill-buffer)&#xA;       #'y-or-n-p&#xA;     #'yes-or-no-p)&#xA;   prompt))&#xA;&#xA;(advice-add 'yes-or-no-p :around #'yes-or-no-p@maybe-just-y-or-n-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-05-27T05:09:00.447" LastActivityDate="2016-05-27T05:09:00.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22572" PostTypeId="2" ParentId="22567" CreationDate="2016-05-27T05:09:22.147" Score="1" Body="&lt;p&gt;After reading the code in the windmove.el, I found following solution. Thanks for your suggestion, @lawlist &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun windmove-diagonal (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (windmove-jump 'left 'down arg))&#xA;&#xA;&#xA;(defun windmove-jump (dir dir2 &amp;amp;optional arg window)&#xA;  (let* ((other-window (windmove-find-other-window dir arg window))&#xA;        (other-window2 (windmove-find-other-window dir2 arg other-window)))&#xA;&#xA;    (cond ((null other-window2)&#xA;       (error &quot;No window %s from selected window&quot; dir))&#xA;      ((and (window-minibuffer-p other-window)&#xA;            (not (minibuffer-window-active-p other-window)))&#xA;       (error &quot;Minibuffer is inactive&quot;))&#xA;      (t&#xA;       (select-window other-window2)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12186" LastActivityDate="2016-05-27T05:09:22.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22573" PostTypeId="2" ParentId="22569" CreationDate="2016-05-27T06:01:24.400" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;just in case I decide to exit out of the function with a 'quit signal such as C-g, in which case the effect would become long-lasting rather than merely temporary.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This can be solved with &lt;code&gt;unwind-protect&lt;/code&gt;. The following function always restores &lt;code&gt;yes-or-no-p&lt;/code&gt;'s definition at the end even if you quit in the middle of it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/kill-buffer ()&#xA;  (interactive)&#xA;  (let ((yes-or-no-def (symbol-function 'yes-or-no-p)))&#xA;    (unwind-protect&#xA;        (progn&#xA;          (fset 'yes-or-no-p 'y-or-n-p)&#xA;          (call-interactively #'kill-buffer))&#xA;      (fset 'yes-or-no-p yes-or-no-def))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9314" LastActivityDate="2016-05-27T06:01:24.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22574" PostTypeId="1" CreationDate="2016-05-27T07:06:04.830" Score="18" ViewCount="1651" Body="&lt;p&gt;Currently my orgmode (v8.3.4), when exporting to LaTeX (and maybe other formats but I haven't checked), generates a new line for a comment line or a block of consecutive comment lines. This is undesirable because in LaTeX, that will create a new paragraph. When I write, I often need to comment a line or two in the middle of a paragraph but don't want to split that paragraph into two. Currently, because of this behavior of orgmode, I have to move those commented lines to after the paragraph, which may be confusing when I revise the text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a minimal example. The orgmode source is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;First sentence.&#xA;# Commented sentence.&#xA;Last sentence.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is exported to LaTeX by orgmode as (omitting the preamble):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{document}&#xA;\tableofcontents&#xA;&#xA;First sentence.&#xA;&#xA;Last sentence.&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is an empty line between the first and last sentences, which results in two paragraphs instead of one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to stop this behavior of orgmode? A comment line, or a block of comment lines, should be exported to 0 byte / character, not even a new line. This is the behavior of LaTeX when processing comments.&lt;/p&gt;&#xA;" OwnerUserId="12188" LastActivityDate="2019-09-08T21:53:59.273" Title="Orgmode export: how to prevent a new line for comment lines" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22576" PostTypeId="1" CreationDate="2016-05-27T09:49:13.673" Score="0" ViewCount="220" Body="&lt;p&gt;I have a multi monitor setup and I typically have two Emacs frames, each filling a monitor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;display-buffer-reuse-window (reusable-frames . T)&lt;/code&gt; as my only customisation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing bugs me in my workflow, I call &lt;code&gt;next-error&lt;/code&gt; a lot and it will move the point to the next error in the compile buffer, and open the bad code in the window that I started in, but the focus remains in the compile buffer!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make the focus change frame when calling &lt;code&gt;next-error&lt;/code&gt;? (when it needs to)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I need to type &lt;code&gt;C-x 5 o&lt;/code&gt; after every &lt;code&gt;next-error&lt;/code&gt; when I'm using two monitors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried adding advice to go to the other frame after, but it doesn't seem to have any effect.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="5142" LastEditDate="2016-05-27T09:58:53.920" LastActivityDate="2016-05-27T09:58:53.920" Title="next-error and multiple frames" Tags="|frames|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22577" PostTypeId="2" ParentId="17718" CreationDate="2016-05-27T12:00:55.833" Score="1" Body="&lt;p&gt;This bug (&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20906&quot; rel=&quot;nofollow&quot;&gt;debbugs#20906&lt;/a&gt;) has been fixed in the emacs-25 branch. The fix will be effective in the next stable release of emacs (as of writing this on May 27, 2016).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get that fix earlier, you can try out the latest available &lt;a href=&quot;ftp://alpha.gnu.org/gnu/emacs/pretest&quot; rel=&quot;nofollow&quot;&gt;pre-test for emacs 25.1&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-05-27T12:00:55.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22578" PostTypeId="1" CreationDate="2016-05-27T12:03:47.400" Score="1" ViewCount="137" Body="&lt;p&gt;I want to use Emacs for Android development, so I installed &lt;a href=&quot;https://github.com/remvee/android-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;android-mode&lt;/code&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I get an error.  I entering path, package, activity names and I get &quot;can't find project root&quot; error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Ubuntu 16.04&lt;/p&gt;&#xA;" OwnerUserId="8736" LastEditorUserId="253" LastEditDate="2016-11-20T23:24:12.277" LastActivityDate="2016-11-20T23:24:12.277" Title="android-mode can't find project root error" Tags="|android|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22580" PostTypeId="1" CreationDate="2016-05-27T12:59:02.313" Score="1" ViewCount="2785" Body="&lt;p&gt;I use &lt;code&gt;flycheck-mode&lt;/code&gt; as my syntax checker/linter for Python. It works great for the most part, however I can't get it to warn me when I have gone over a specified line length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;flake8&lt;/code&gt; as my checker for Python, and have confirmed this with &lt;code&gt;flycheck-verify-setup&lt;/code&gt;. The output from this command in a &lt;code&gt;python-mode&lt;/code&gt; buffer is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Syntax checkers for buffer config.py in python-mode:&#xA;&#xA;python-flake8&#xA;- predicate:  t&#xA;- executable: Found at /usr/bin/flake8&#xA;&#xA;python-pylint&#xA;- predicate:  nil&#xA;- executable: Not found&#xA;&#xA;python-pycompile&#xA;- predicate:  t&#xA;- executable: Found at /usr/bin/python&#xA;&#xA;The following checker is explicitly selected for this buffer:&#xA;&#xA;python-flake8&#xA;- major mode: `python-mode' supported&#xA;- predicate:  t&#xA;- executable: Found at /usr/bin/flake8&#xA;&#xA;Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled&#xA;checkers.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The checking works in general, so if I have the following Python code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import re&#xA;long_string = &quot;foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo&quot;&#xA;class Foo():&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get two warnings from &lt;code&gt;flycheck&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'re' imported but unused [F401]&#xA;expected 2 blank lines, found 0 [E302]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not, however, get a warning that &lt;code&gt;long_string&lt;/code&gt; is too long. I have tried setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default flycheck-flake8-maximum-line-length 79)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my init file as suggested &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/378&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. I have tried configuring &lt;code&gt;flake8&lt;/code&gt; with a &lt;code&gt;flake8&lt;/code&gt; file in my &lt;code&gt;~/.config/&lt;/code&gt; directory, as described &lt;a href=&quot;http://flake8.readthedocs.io/en/latest/config.html#global&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, which I assume &lt;code&gt;flycheck&lt;/code&gt; is supposed to respect, based on &lt;a href=&quot;https://emacs.stackexchange.com/a/18889/8430&quot;&gt;this answer&lt;/a&gt;. I have also tried setting the value of &lt;code&gt;flycheck-flake8rc&lt;/code&gt; to point to that &lt;code&gt;flake8&lt;/code&gt; file. I have tried using a local configuration file within a project as described &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/721&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. None of these have worked for me. Instead, &lt;code&gt;flycheck&lt;/code&gt; seems to ignore any &lt;code&gt;flake8&lt;/code&gt; config I try to give it, and will not warn about line length. This is the case even when I use &lt;code&gt;emacs -Q&lt;/code&gt;, initialize packages, and enable &lt;code&gt;global-flycheck-mode&lt;/code&gt; - although, in this case the output of &lt;code&gt;flycheck-verify-setup&lt;/code&gt; is the same. Any suggestions how I might be able to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Get &lt;code&gt;flycheck-mode&lt;/code&gt; to respect my &lt;code&gt;flake8&lt;/code&gt; configuration file?&lt;/li&gt;&#xA;&lt;li&gt;Get &lt;code&gt;flycheck-mode&lt;/code&gt; to warn me about going over a specified line length?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Question 2 would be solved, in theory, by any solution to question 1, because I could set, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[flake8]&#xA;max-line-length = 79&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my configuration file, but I would be satisfied with a solution to question 2 alone. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-06-01T13:02:27.783" Title="Make flycheck mode respect flake8 config and warn for long lines" Tags="|python|flycheck|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="22581" PostTypeId="2" ParentId="22580" CreationDate="2016-05-27T14:17:05.973" Score="1" Body="&lt;p&gt;I don't use flymake mode directly. But I use &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;nofollow noreferrer&quot;&gt;elpy&lt;/a&gt; which uses flymake internally and works well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install using &lt;code&gt;M-x package-install elpy&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next time, when you open a python file, you will get a warning like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gO8J1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gO8J1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2016-05-27T14:17:05.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22582" PostTypeId="2" ParentId="22569" CreationDate="2016-05-27T14:21:28.510" Score="3" Body="&lt;p&gt;I think the best way to handle this is to use &lt;code&gt;cl-letf&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;(cl-letf (((symbol-function 'yes-or-no-p) #'y-or-n-p))&#xA;  (let* ((filename &quot;~/private/tmp/foofile&quot;)&#xA;         (buf (get-buffer-create &quot;*foo*&quot;)))&#xA;    (with-current-buffer buf&#xA;      (write-file filename)&#xA;      (insert &quot;Every good boy deserves fudge.&quot;))&#xA;    (kill-buffer buf)&#xA;    (delete-file filename)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is in principle similar to whacka's answer, but avoids requiring an explicit &lt;code&gt;unwind-protect&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-05-27T14:21:28.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22583" PostTypeId="1" CreationDate="2016-05-27T16:17:41.417" Score="5" ViewCount="1225" Body="&lt;h2&gt;Context&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Editing an arbitrary XML file in &lt;code&gt;nxml-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Need&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's say I have a structure like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;a&amp;gt;&#xA;  &amp;lt;b&amp;gt;...&amp;lt;/b&amp;gt;&#xA;&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say the cursor is at the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;.&#xA;I'm looking for &lt;strong&gt;one shortcut&lt;/strong&gt; that brings the cursor directly from &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; to &lt;code&gt;&amp;lt;/a&amp;gt;&lt;/code&gt;, &lt;strong&gt;and back if called again&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Search before you ask&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This question requests one-way jump and gets an answer: &lt;code&gt;C-M-n&lt;/code&gt; to jump forward,  &lt;code&gt;C-u -1 C-M-n&lt;/code&gt; to jump backwards -- &lt;a href=&quot;https://stackoverflow.com/questions/7022556/emacs-nxhtml-how-to-highlight-or-jump-to-the-closing-html-tag&quot;&gt;Emacs, nxhtml how to highlight or jump to the closing html tag? - Stack Overflow&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is inconvenient because to jump back one has to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;position the cursor exactly at end of closing tag, and&lt;/li&gt;&#xA;&lt;li&gt;use a long and convoluted key shortcut &lt;code&gt;C-u -1 C-M-n&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There's room for more convenience: &lt;strong&gt;one&lt;/strong&gt; shortcut to do &lt;strong&gt;both directions&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How to do that?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If this does not already exists, I'd like to it. I'm a seasoned developer in a number of languages and environments but not proficient enough in emacs-lisp to make my own solution.  Still, it might be easy enough to do for an emacs-lisp wizard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically, &lt;strong&gt;one function&lt;/strong&gt; with this behavior would do the trick:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;when cursor is on an opening tag, jump forwards (call &lt;code&gt;(nxml-forward-element 1)&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;when cursor is on a closing tag, jump backwards (call &lt;code&gt;(nxml-forward-element -1)&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;bonus points if, when cursor is anywhere between &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; (not only just before &lt;code&gt;&amp;lt;&lt;/code&gt; as &lt;code&gt;nxml-forward-element&lt;/code&gt; requires), the function still works&lt;/li&gt;&#xA;&lt;li&gt;bonus points if, when cursor is anywhere inside text or whatever, then jump backwards to opening tag.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10614" LastEditorUserId="10614" LastEditDate="2016-06-28T05:30:15.977" LastActivityDate="2016-06-28T06:46:09.357" Title="One key shortcut to jump two-ways between matching opening/closing tags in nxml mode?" Tags="|key-bindings|motion|nxml|xml|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22584" PostTypeId="1" AcceptedAnswerId="22585" CreationDate="2016-05-27T16:49:48.977" Score="11" ViewCount="8918" Body="&lt;p&gt;I am using org-mode on Macintosh GNU Emacs version 24.5.1 in GUI mode and the headers are enlarged. I would like to disable this feature so they rendered in the default font size.&lt;/p&gt;&#xA;&lt;p&gt;I have tried this...&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &amp;quot;monokai-theme&amp;quot;&#xA;  (custom-theme-set-faces&#xA;    'monokai&#xA;    '(org-level-1 ((t (:weight semi-bold :height 1.0))))&#xA;    '(org-level-2 ((t (:weight semi-bold :height 1.0))))&#xA;    '(org-level-3 ((t (:weight semi-bold :height 1.0))))&#xA;    '(org-level-4 ((t (:weight semi-bold :height 1.0))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Though this clobbers the theme and the colors are no loner rendered.&lt;/p&gt;&#xA;&lt;p&gt;Should I accomplish it a different way?&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="11477" LastEditDate="2020-08-23T11:17:31.627" LastActivityDate="2020-08-23T11:17:31.627" Title="Disable enlarged org-mode header appearance" Tags="|org-mode|fonts|faces|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="22585" PostTypeId="2" ParentId="22584" CreationDate="2016-05-27T17:13:32.633" Score="8" Body="&lt;p&gt;Org headings are controlled by the faces &lt;code&gt;org-level-1&lt;/code&gt;, &lt;code&gt;org-level-2&lt;/code&gt; etc. You can get to them via &lt;code&gt;M-x customize-face&lt;/code&gt;. Unselecting the &lt;code&gt;height&lt;/code&gt; attribute should set them to the default font size.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-05-27T17:13:32.633" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22586" PostTypeId="1" AcceptedAnswerId="22598" CreationDate="2016-05-27T17:19:03.083" Score="3" ViewCount="1858" Body="&lt;p&gt;I'm running a fresh install of Arch Linux and if I try to view a pdf file in doc-view or pdf-view, I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;No PNG support is available, or some conversion utility for pdf files is missing.&#xA;  Unable to render file.  View extracted text instead&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A quick web search didn't provide any leads as how to resolve this issue - actually, I don't even know what exactly the issue is.&lt;/p&gt;&#xA;" OwnerUserId="10886" LastActivityDate="2020-11-28T01:07:48.587" Title="doc view PNG support" Tags="|pdf|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22587" PostTypeId="1" CreationDate="2016-05-27T17:53:51.830" Score="1" ViewCount="139" Body="&lt;p&gt;How can I convert a number of lines with text into a list?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;line one&#xA;line two&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I want to mark the lines and after executing a function it should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&#xA;  &amp;lt;li&amp;gt;line one&amp;lt;/li&amp;gt;&#xA;  &amp;lt;/li&amp;gt;line two&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know I can use &lt;code&gt;web-mode-element-wrap&lt;/code&gt; to wrap the lines with the &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; tags, but I'm not sure, how to iterate over the lines in a region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there already some built-in way to do this in web-mode?&lt;/p&gt;&#xA;" OwnerUserId="12067" LastActivityDate="2017-01-24T10:54:44.107" Title="Convert lines into list in web-mode" Tags="|web-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22588" PostTypeId="2" ParentId="22587" CreationDate="2016-05-27T18:11:46.353" Score="1" Body="&lt;p&gt;Depending on how much of it you want automated you can use a macro or write your own function. I think a macro is easiest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/KeyboardMacros&quot; rel=&quot;nofollow&quot;&gt;macro&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To set up this macro you can go to the beginning of the first line and hit &lt;kbd&gt; f3 &lt;/kbd&gt; you can then type &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; hit &lt;kbd&gt; C-e &lt;/kbd&gt; and then type &lt;code&gt;&amp;lt;/li&amp;gt;&lt;/code&gt; and finally hit &lt;kbd&gt; C-n C-a &lt;/kbd&gt;. To end the macro hit &lt;kbd&gt; f4 &lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can hit &lt;kbd&gt; f4 &lt;/kbd&gt; and it will wrap each line. You can hit it many times, give a prefix arg, or you can highlight every line and press &lt;kbd&gt; M-x apply-macro-to-region-lines&lt;/kbd&gt; (also bound to &lt;kbd&gt; C-x C-k r &lt;/kbd&gt;) this will apply your macro to every line. TADA!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function is harder to write and will only be useful for this one use so pick your poison!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt; then a whole different world of possibilities opens ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if this wasn't very clear&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-05-27T18:11:46.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22589" PostTypeId="2" ParentId="22584" CreationDate="2016-05-27T18:23:13.713" Score="15" Body="&lt;p&gt;Okay I found a solution that worked for me.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-mode-hook ()&#xA;  &amp;quot;Stop the org-level headers from increasing in height relative to the other text.&amp;quot;&#xA;  (dolist (face '(org-level-1&#xA;                  org-level-2&#xA;                  org-level-3&#xA;                  org-level-4&#xA;                  org-level-5))&#xA;  (set-face-attribute face nil :weight 'semi-bold :height 1.0)))&#xA;&#xA;(add-hook 'org-mode-hook #'my/org-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This preserved the other &lt;code&gt;face-attributes&lt;/code&gt; and did not clobber the theme like my original attempt. Also as a bonus it is not dependent on a single theme.&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="1979" LastEditDate="2020-08-22T20:20:28.367" LastActivityDate="2020-08-22T20:20:28.367" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22590" PostTypeId="1" CreationDate="2016-05-27T18:23:38.927" Score="2" ViewCount="84" Body="&lt;p&gt;As a new Emacs user, I decided to start using Gnus. I achieved to configure it, but I didn't manage to send mail properly. Indeed, when I use either &lt;code&gt;C-c C-c&lt;/code&gt; or &lt;code&gt;M-x message-send-and-exit&lt;/code&gt;, it loads KMail (my default mail reader on Fedora 23 KDE) fulfilled with my mail specificities. Is there a way so I could send mail from Emacs itself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=========================================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fixed it using another emacs configuration on github (&lt;a href=&quot;https://github.com/eschulte/emacs24-starter-kit/&quot; rel=&quot;nofollow&quot;&gt;https://github.com/eschulte/emacs24-starter-kit/&lt;/a&gt;). I guess it's too soon for me to make my own configuration :)&lt;/p&gt;&#xA;" OwnerUserId="12196" LastEditorUserId="12198" LastEditDate="2016-05-28T15:18:34.647" LastActivityDate="2016-05-28T15:18:34.647" Title="Composing a message in Gnus runs Kmail" Tags="|gnus|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22591" PostTypeId="2" ParentId="13314" CreationDate="2016-05-27T19:13:39.197" Score="14" Body="&lt;p&gt;For me, as of April 13, 2017, a reliable way to install &lt;code&gt;pdf-tools&lt;/code&gt; on OS X (Mavericks/Sierra) is to use the following &lt;code&gt;pdf-tools&lt;/code&gt; config and directions (in the comments):&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; Install epdfinfo via 'brew install pdf-tools --HEAD' and then install the&#xA;;;; pdf-tools elisp via the use-package below. To upgrade the epdfinfo&#xA;;;; server, just do 'brew upgrade pdf-tools' prior to upgrading to newest&#xA;;;; pdf-tools package using Emacs package system. If things get messed&#xA;;;; up, just do 'brew uninstall pdf-tools', wipe out the elpa&#xA;;;; pdf-tools package and reinstall both as at the start.&#xA;&#xA;(use-package pdf-tools&#xA;      :ensure t&#xA;      :config&#xA;      (custom-set-variables&#xA;        '(pdf-tools-handle-upgrades nil)) ; Use brew upgrade pdf-tools instead.&#xA;     (setq pdf-info-epdfinfo-program &amp;quot;/usr/local/bin/epdfinfo&amp;quot;))&#xA;     (pdf-tools-install)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Of course, you don't have to use &lt;code&gt;use-package&lt;/code&gt;. You can just require &lt;code&gt;pdf-tools&lt;/code&gt; after installing it via Emacs package system and then require it, but you do still have to define the path to &lt;code&gt;epdfinfo&lt;/code&gt; as in the code above.&lt;/p&gt;&#xA;" OwnerUserId="8353" LastEditorUserId="11477" LastEditDate="2021-01-05T07:21:35.747" LastActivityDate="2021-01-05T07:21:35.747" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="22592" PostTypeId="2" ParentId="22590" CreationDate="2016-05-27T19:26:26.213" Score="2" Body="&lt;p&gt;You need to configure emacs to use smtp. In my config file I have the&#xA;following. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smtpmail)&#xA;(setq message-send-mail-function 'smtpmail-send-it&#xA;      starttls-use-gnutls t&#xA;      smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; 587 nil nil))&#xA;      smtpmail-auth-credentials (expand-file-name &quot;~/.authinfo.gpg&quot;)&#xA;      smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-service 587&#xA;      smtpmail-debug-info t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That should be everthing you need, hopefully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have the following which you may need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-posting-styles '(((header &quot;to&quot; &quot;jtamagnan@gmail.com&quot;)&#xA;                 (address &quot;jtamagnan@gmail.com&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let me know if you find success!&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-05-27T19:26:26.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22594" PostTypeId="2" ParentId="22547" CreationDate="2016-05-27T21:35:51.780" Score="4" Body="&lt;p&gt;That certainly is an edge case.  Some might argue that you can't have a heading without some content in the heading, but your use case seems like a reasonable use of the outline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-element-headline-parser&lt;/code&gt; isn't written to accommodate your use-case.  You can change the regular expression that matches the tag portion from&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-re &quot;[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-re &quot;[ \t]*\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(just the first quantifier is different)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't done any testing on that change.  Chances are it breaks something else!  If it works: great :-)  Otherwise you might try adding a non-breaking space in your headlines with &lt;code&gt;C-q M-SPC&lt;/code&gt; as a workaround.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-05-27T21:35:51.780" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22595" PostTypeId="1" AcceptedAnswerId="22602" CreationDate="2016-05-27T22:38:59.880" Score="3" ViewCount="633" Body="&lt;p&gt;According to &lt;code&gt;indent-tabs-mode&lt;/code&gt;, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Indentation can insert tabs if this is non-nil.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nil&lt;/code&gt; means indentation cannot use tabs. I need the opposite of this option, prevent indentation from using spaces as tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need this to match a formatting convention (eclipse) where tabs are mandatory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the simplest way to achieve this? I'm using plain &lt;code&gt;java-mode&lt;/code&gt;, whose tab is bound to &lt;code&gt;(c-indent-line-or-region &amp;amp;optional ARG REGION)&lt;/code&gt;, which seems to use &lt;code&gt;(symbol-function 'indent-according-to-mode)&lt;/code&gt;, which eventually uses &lt;code&gt;c-shift-line-indentation&lt;/code&gt;, but I don't see any options to configure using tabs only. Am I looking in the wrong place?&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="105" LastEditDate="2016-05-27T23:41:57.210" LastActivityDate="2016-05-29T06:10:02.583" Title="inverse of 'indent-tabs-mode'" Tags="|indentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22596" PostTypeId="1" AcceptedAnswerId="22615" CreationDate="2016-05-27T22:55:32.007" Score="4" ViewCount="877" Body="&lt;p&gt;I'm trying to use spacemacs (basically a thin layer with nice defaults around emacs) at work, but it wants to connect to elpa and melpa to download stuff - and is basically unusable without getting those packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I set up spacemacs the way I like it on my linux laptop at home, and it's all in elisp and self-contained, would the directory work at work on my Windows desktop?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should, shouldn't it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Follow-on question: If I use version control, is there anything I should avoid tracking that's dynamically created?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is .emacs.d portable across platforms?&lt;/p&gt;&#xA;" OwnerUserId="591" LastActivityDate="2016-05-29T00:17:54.513" Title="Is .emacs.d portable across platforms?" Tags="|init-file|spacemacs|package-repositories|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22598" PostTypeId="2" ParentId="22586" CreationDate="2016-05-28T01:32:27.543" Score="2" Body="&lt;p&gt;The two possibilities that I see based on the error message are:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Emacs was not compiled with png support&lt;/li&gt;&#xA;&lt;li&gt;You do not have a program to convert from pdf to png installed&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The ways to check each of these are:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Try to open a png in Emacs if you see a picture in image mode (you may need to hit &lt;code&gt;C-c C-c&lt;/code&gt; or something) then you have png support.&lt;/li&gt;&#xA;&lt;li&gt;Open a terminal and run &lt;code&gt;gs&lt;/code&gt;. if this program is installed then you should be good. Otherwise, install Ghostscript&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If you don't have png support them I don't really know what you can do easily. You may be able to find some distro specific instructions for a more complete installation or you may have to build Emacs yourself.&lt;/p&gt;&#xA;&lt;p&gt;I should probably add that if you get docview working then you should look into pdftools as it can give you some more advanced pdf-specific features&lt;/p&gt;&#xA;" OwnerUserId="8435" LastEditorUserId="8435" LastEditDate="2020-11-28T01:07:48.587" LastActivityDate="2020-11-28T01:07:48.587" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="22599" PostTypeId="2" ParentId="2644" CreationDate="2016-05-28T01:58:51.760" Score="4" Body="&lt;p&gt;Not a deep answer to the original question, but I wrote a bit of code in response to a different question that shows how to make multiple columns out of a single column:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/22427/5137&quot;&gt;https://emacs.stackexchange.com/a/22427/5137&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It may contribute to understanding how the parameters work by demonstrating their use in code.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="5137" LastEditDate="2021-03-19T21:18:21.190" LastActivityDate="2021-03-19T21:18:21.190" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="22600" PostTypeId="1" CreationDate="2016-05-28T06:30:27.057" Score="2" ViewCount="291" Body="&lt;p&gt;This happens on the Emacs splash page primarily. I can move back to the end of the previous line with &lt;code&gt;M-b&lt;/code&gt; but cannot move onto the beginning of the next with &lt;code&gt;M-f&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an experiment, I'm going through and replacing some vim emulation commands in evil-mode with their vanilla emacs equivalents.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives &#xA;      '((&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;)&#xA;        (&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;&#xA;(require 'package)&#xA;(package-initialize)&#xA;&#xA;(require 'evil)&#xA;(evil-mode +1)&#xA;&#xA;;; experiment with rebinding the normal state keys.&#xA;(define-key evil-normal-state-map (kbd &quot;w&quot;) #'forward-word)&#xA;(define-key evil-normal-state-map (kbd &quot;b&quot;) #'backward-word)&#xA;(define-key evil-normal-state-map (kbd &quot;W&quot;) #'forward-sexp)&#xA;(define-key evil-normal-state-map (kbd &quot;B&quot;) #'backward-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I noticed that &lt;code&gt;M-f&lt;/code&gt; and &lt;code&gt;M-b&lt;/code&gt; (and &lt;code&gt;w&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;) no longer move onto the next line and I'm wondering why that is. The help text for &lt;code&gt;M-f&lt;/code&gt; seems to suggest that the value of &lt;code&gt;inhibit-field-text-motion&lt;/code&gt; may play a role, but it's &lt;code&gt;nil&lt;/code&gt; regardless of whether &lt;code&gt;evil-mode&lt;/code&gt; is enabled.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-f runs the command forward-word, which is an interactive built-in&#xA;function in `syntax.c'.&#xA;&#xA;It is bound to w, M-f, ESC &amp;lt;right&amp;gt;.&#xA;&#xA;(forward-word &amp;amp;optional ARG)&#xA;&#xA;Move point forward ARG words (backward if ARG is negative).&#xA;If ARG is omitted or nil, move point forward one word.&#xA;Normally returns t.&#xA;If an edge of the buffer or a field boundary is reached, point is left there&#xA;and the function returns nil.  Field boundaries are not noticed if&#xA;`inhibit-field-text-motion' is non-nil.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still confused, I checked the source code to see how &lt;code&gt;forward-word&lt;/code&gt; is actually implemented and to see what variable or bit of emacs state might be changing to influence the behavior of &lt;code&gt;forward-word&lt;/code&gt;. The source code is here &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/c8874e2113221a08252113b6d46ecc7066c62c8c/src/syntax.c&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-mirror/emacs/blob/c8874e2113221a08252113b6d46ecc7066c62c8c/src/syntax.c&lt;/a&gt; (reproduced below for convenience).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEFUN (&quot;forward-word&quot;, Fforward_word, Sforward_word, 0, 1, &quot;^p&quot;,&#xA;       doc: /* Move point forward ARG words (backward if ARG is negative).&#xA;If ARG is omitted or nil, move point forward one word.&#xA;Normally returns t.&#xA;If an edge of the buffer or a field boundary is reached, point is&#xA;left there and the function returns nil.  Field boundaries are not&#xA;noticed if `inhibit-field-text-motion' is non-nil.&#xA;The word boundaries are normally determined by the buffer's syntax&#xA;table, but `find-word-boundary-function-table', such as set up&#xA;by `subword-mode', can change that.  If a Lisp program needs to&#xA;move by words determined strictly by the syntax table, it should&#xA;use `forward-word-strictly' instead.  */)&#xA;  (Lisp_Object arg)&#xA;{&#xA;  Lisp_Object tmp;&#xA;  ptrdiff_t orig_val, val;&#xA;&#xA;  if (NILP (arg))&#xA;    XSETFASTINT (arg, 1);&#xA;  else&#xA;    CHECK_NUMBER (arg);&#xA;&#xA;  val = orig_val = scan_words (PT, XINT (arg));&#xA;  if (! orig_val)&#xA;    val = XINT (arg) &amp;gt; 0 ? ZV : BEGV;&#xA;&#xA;  /* Avoid jumping out of an input field.  */&#xA;  tmp = Fconstrain_to_field (make_number (val), make_number (PT),&#xA;                 Qnil, Qnil, Qnil);&#xA;  val = XFASTINT (tmp);&#xA;&#xA;  SET_PT (val);&#xA;  return val == orig_val ? Qt : Qnil;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it looks like the logic that could be making the behavior of &lt;code&gt;foward-word&lt;/code&gt; differ in evil normal state and vanilla emacs must be contained within &lt;code&gt;scan-words&lt;/code&gt; (&lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/c8874e2113221a08252113b6d46ecc7066c62c8c/src/syntax.c#L1417&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-mirror/emacs/blob/c8874e2113221a08252113b6d46ecc7066c62c8c/src/syntax.c#L1417&lt;/a&gt;). This function is really long so I won't paste it here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering how exactly evil-mode is changing the behavior of &lt;code&gt;forward-word&lt;/code&gt; and how to prevent it from doing that? It seems unlikely that messing with the syntax tables would enable or disable line-wrapping for &lt;code&gt;forward-word&lt;/code&gt;, but I'm really not sure.&lt;/p&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="8921" LastEditDate="2016-05-28T06:44:15.440" LastActivityDate="2021-03-15T02:03:35.377" Title="`M-f` doesn't move to next line in evil-mode" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22601" PostTypeId="1" AcceptedAnswerId="22610" CreationDate="2016-05-28T07:09:00.670" Score="4" ViewCount="470" Body="&lt;p&gt;I'd like to know if there is a way to define the indentation for a custom macro within the clojure source file.  It is possible to define the indentation using clojure-mode, but as far as I can tell, it has to be done using elisp as described &lt;a href=&quot;https://github.com/clojure-emacs/clojure-mode#indentation-of-macro-forms&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is there a way to do this from within a clojure source file?&lt;/em&gt;  For example, in an elisp source file, one can do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro mac (arg)&#xA;  (declare (indent 1))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does the combination of clojure and clojure-mode support something like this?&lt;/p&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="253" LastEditDate="2016-05-28T09:28:27.210" LastActivityDate="2016-05-28T22:06:22.303" Title="Custom indentation for clojure macros in *.clj files" Tags="|clojure|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22602" PostTypeId="2" ParentId="22595" CreationDate="2016-05-28T09:49:12.147" Score="4" Body="&lt;p&gt;&lt;em&gt;Ultimately&lt;/em&gt; it's up to the individual mode to decide how it indents things, but &lt;code&gt;indent-tabs-mode&lt;/code&gt; is &lt;em&gt;generally&lt;/em&gt; respected, and all you need do is set it to a non-nil value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The canonical non-nil value is &lt;code&gt;t&lt;/code&gt; when no other value is more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;indent-tabs-mode&lt;/code&gt; is automatically buffer-local, and you can use the mode hook for &lt;code&gt;java-mode&lt;/code&gt; to set it in any buffer using that mode.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'java-mode-hook 'my-java-mode-hook)&#xA;&#xA;(defun my-java-mode-hook ()&#xA;  &quot;Custom behaviours for `java-mode-hook'.&quot;&#xA;  (setq indent-tabs-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Provided java-mode only ever indents to multiples of &lt;code&gt;tab-width&lt;/code&gt;, this ought to give you tab-only indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, you would need to determine how to control the level of indentation in java-mode so that you can set that (and/or tab-width -- another buffer-local value) to coincide, so that only tabs will be required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturally if there are circumstances when java-mode needs to indent to a column which is &lt;em&gt;not&lt;/em&gt; an exact tab-width multiple, it won't be possible for it to use only tabs.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-28T09:49:12.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22603" PostTypeId="2" ParentId="22596" CreationDate="2016-05-28T13:42:25.973" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;h1&gt;Is .emacs.d portable across platforms?&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes it is, semantically speaking, assuming the same emacs version.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Is everything in it cross-platform?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Not necessarily. If any of it uses system calls that are system specific or hard-codes the location of files with absolute paths, it is likely to not work on a Windows system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a very large .emacs.d (thanks to spacemacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the directory structure of &lt;em&gt;my&lt;/em&gt; .emacs.d:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d$ tree -d&#xA;.&#xA;├── assets&#xA;├── auto-save-list&#xA;├── core&#xA;│   ├── aprilfool&#xA;│   ├── banners&#xA;│   │   └── img&#xA;│   ├── info&#xA;│   │   └── release-notes&#xA;│   ├── libs&#xA;│   └── templates&#xA;├── doc&#xA;│   └── img&#xA;├── elpa&#xA;│   ├── ace-jump-helm-line-20160329.1218&#xA;│   ├── ace-link-20160326.620&#xA;│   ├── ace-window-20160225.819&#xA;│   ├── ac-ispell-20151031.1926&#xA;│   ├── adaptive-wrap-0.5&#xA;│   ├── aggressive-indent-20160404.1021&#xA;│   ├── alert-20151123.759&#xA;│   ├── anaconda-mode-20160221.1123&#xA;│   ├── anzu-20160130.1855&#xA;│   ├── archives&#xA;│   │   ├── gnu&#xA;│   │   ├── marmalade&#xA;│   │   ├── melpa&#xA;│   │   └── org&#xA;│   ├── async-20160223.146&#xA;│   ├── auto-compile-20160321.932&#xA;│   ├── auto-complete-20160329.2321&#xA;│   │   └── dict&#xA;│   ├── auto-highlight-symbol-20130313.243&#xA;│   ├── auto-yasnippet-20160223.308&#xA;│   ├── avy-20160402.1049&#xA;│   ├── bind-key-20160227.48&#xA;│   ├── bind-map-20160309.525&#xA;│   ├── bracketed-paste-20140222.1801&#xA;│   ├── buffer-move-20160108.708&#xA;│   ├── clean-aindent-mode-20150816.2029&#xA;│   ├── cmm-mode-20150224.2346&#xA;│   ├── company-20160325.1650&#xA;│   ├── company-anaconda-20160222.837&#xA;│   ├── company-cabal-20151216.720&#xA;│   ├── company-ghc-20160315.710&#xA;│   ├── company-quickhelp-20160211.718&#xA;│   ├── company-statistics-0.2.2&#xA;│   ├── ctable-20140304.1659&#xA;│   ├── cython-mode-20140705.1229&#xA;│   ├── dash-20160306.1222&#xA;│   ├── define-word-20150709.1223&#xA;│   ├── diminish-20151215.915&#xA;│   ├── elisp-slime-nav-20160128.1109&#xA;│   ├── epl-20150517.433&#xA;│   ├── ess-20160404.1414&#xA;│   │   ├── etc&#xA;│   │   │   ├── ESSR&#xA;│   │   │   │   └── R&#xA;│   │   │   ├── icons&#xA;│   │   │   ├── other&#xA;│   │   │   │   └── S-spread&#xA;│   │   │   └── pkg1&#xA;│   │   │       ├── man&#xA;│   │   │       └── R&#xA;│   │   └── lisp&#xA;│   ├── ess-R-data-view-20130509.458&#xA;│   ├── ess-R-object-popup-20130302.336&#xA;│   ├── ess-smart-equals-20150201.2201&#xA;│   ├── eval-sexp-fu-20131230.1351&#xA;│   ├── evil-20160403.2352&#xA;│   ├── evil-anzu-20150124.1609&#xA;│   ├── evil-args-20140329.1429&#xA;│   ├── evil-escape-20160313.1205&#xA;│   ├── evil-exchange-20160117.2002&#xA;│   ├── evil-iedit-state-20160313.1156&#xA;│   ├── evil-indent-plus-20151109.1106&#xA;│   ├── evil-lisp-state-20160403.1948&#xA;│   ├── evil-magit-20160324.1838&#xA;│   ├── evil-matchit-20151120.335&#xA;│   ├── evil-mc-20160331.844&#xA;│   ├── evil-nerd-commenter-20160209.49&#xA;│   ├── evil-numbers-20140606.551&#xA;│   ├── evil-search-highlight-persist-20151215.238&#xA;│   ├── evil-surround-20160331.821&#xA;│   ├── evil-tutor-20150102.2250&#xA;│   ├── evil-visualstar-20160222.1648&#xA;│   ├── exec-path-from-shell-20160112.2246&#xA;│   ├── expand-region-20150902.558&#xA;│   ├── f-20160306.447&#xA;│   ├── fancy-battery-20150101.404&#xA;│   ├── fill-column-indicator-20151030.1233&#xA;│   ├── flx-20151030.1112&#xA;│   ├── flx-ido-20151030.1112&#xA;│   ├── flycheck-20160403.803&#xA;│   ├── flycheck-haskell-20160413.131&#xA;│   ├── flycheck-pos-tip-20160323.129&#xA;│   ├── ghc-20160108.701&#xA;│   ├── gh-md-20151207.940&#xA;│   ├── gitattributes-mode-20160319.302&#xA;│   ├── git-commit-20160329.858&#xA;│   ├── gitconfig-mode-20160319.302&#xA;│   ├── gitignore-mode-20160319.302&#xA;│   ├── git-messenger-20160121.1842&#xA;│   ├── git-timemachine-20160323.1240&#xA;│   ├── gntp-20141024.1950&#xA;│   ├── gnupg&#xA;│   ├── gnuplot-20141231.1337&#xA;│   ├── golden-ratio-20150819.420&#xA;│   ├── google-translate-20160111.654&#xA;│   ├── goto-chg-20131228.659&#xA;│   ├── haskell-mode-20160419.752&#xA;│   ├── haskell-snippets-20160121.1458&#xA;│   │   └── snippets&#xA;│   │       └── haskell-mode&#xA;│   ├── helm-20160404.840&#xA;│   ├── helm-ag-20160330.0&#xA;│   ├── helm-company-20151216.9&#xA;│   ├── helm-core-20160403.2307&#xA;│   ├── helm-c-yasnippet-20151231.10&#xA;│   ├── helm-descbinds-20160108.1947&#xA;│   ├── helm-flx-20160227.1652&#xA;│   ├── helm-gitignore-20150517.2056&#xA;│   ├── helm-make-20160331.754&#xA;│   ├── helm-mode-manager-20151124.138&#xA;│   ├── helm-projectile-20160330.131&#xA;│   ├── helm-pydoc-20151008.724&#xA;│   ├── helm-swoop-20160131.533&#xA;│   ├── helm-themes-20151008.2321&#xA;│   ├── help-fns+-20151215.637&#xA;│   ├── highlight-20151231.1337&#xA;│   ├── highlight-indentation-20150307.208&#xA;│   ├── highlight-numbers-20150531.607&#xA;│   ├── highlight-parentheses-20151107.2316&#xA;│   ├── hindent-20151113.24&#xA;│   ├── hl-todo-20151025.1220&#xA;│   ├── htmlize-20130207.1202&#xA;│   ├── hungry-delete-20151203.1314&#xA;│   ├── hydra-20160415.423&#xA;│   ├── hy-mode-20151025.543&#xA;│   ├── ido-vertical-mode-20151003.1833&#xA;│   ├── iedit-20150915.2022&#xA;│   ├── indent-guide-20151119.717&#xA;│   ├── info+-20151231.1403&#xA;│   ├── julia-mode-20160327.225&#xA;│   ├── let-alist-1.0.4&#xA;│   ├── leuven-theme-20160319.819&#xA;│   ├── linum-relative-20160117.2200&#xA;│   ├── log4e-20150105.505&#xA;│   ├── lorem-ipsum-20140911.1408&#xA;│   ├── macrostep-20151213.145&#xA;│   ├── magit-20160402.2219&#xA;│   ├── magit-gitflow-20160318.700&#xA;│   ├── magit-popup-20160329.858&#xA;│   ├── markdown-mode-20160404.923&#xA;│   ├── markdown-toc-20160227.308&#xA;│   ├── mmm-mode-20150828.1716&#xA;│   ├── move-text-20160211.1847&#xA;│   ├── neotree-20160306.730&#xA;│   │   └── icons&#xA;│   ├── open-junk-file-20130130.2320&#xA;│   ├── org-20160404&#xA;│   │   └── etc&#xA;│   │       └── styles&#xA;│   ├── org-bullets-20140918.1137&#xA;│   ├── orgit-20160119.1424&#xA;│   ├── org-plus-contrib-20160404&#xA;│   │   └── etc&#xA;│   │       └── styles&#xA;│   ├── org-pomodoro-20151217.553&#xA;│   │   └── resources&#xA;│   ├── org-present-20141109.1756&#xA;│   ├── org-repo-todo-20160307.1029&#xA;│   ├── package-build-20160326.1852&#xA;│   ├── packed-20160321.36&#xA;│   ├── page-break-lines-20160109.1813&#xA;│   ├── paradox-20160323.1210&#xA;│   ├── parent-mode-20150824.1600&#xA;│   ├── pcre2el-20151213.234&#xA;│   ├── persp-mode-20151209.1949&#xA;│   ├── pip-requirements-20160131.926&#xA;│   ├── pkg-info-20150517.443&#xA;│   ├── popup-20151222.1339&#xA;│   ├── popwin-20150315.600&#xA;│   ├── pos-tip-20150318.813&#xA;│   ├── powerline-20160224.2052&#xA;│   ├── projectile-20160331.2219&#xA;│   ├── pyenv-mode-20160221.1123&#xA;│   ├── pytest-20160330.647&#xA;│   ├── python-20120402&#xA;│   ├── pythonic-20160221.1123&#xA;│   ├── pyvenv-20160108.28&#xA;│   ├── quelpa-20160325.629&#xA;│   ├── rainbow-delimiters-20150320.17&#xA;│   ├── request-20160108.33&#xA;│   ├── restart-emacs-20151203.835&#xA;│   ├── s-20160313.2240&#xA;│   ├── seq-2.15&#xA;│   │   └── tests&#xA;│   ├── shm-20160211.1154&#xA;│   ├── smartparens-20160324.1541&#xA;│   ├── smeargle-20151013.2242&#xA;│   ├── smooth-scrolling-20160227.1715&#xA;│   ├── solarized-theme-20160505.133&#xA;│   ├── spaceline-20160229.1115&#xA;│   ├── spacemacs-theme-20160310.1337&#xA;│   ├── spinner-1.7.1&#xA;│   ├── toc-org-20160308.2340&#xA;│   ├── undo-tree-20140509.522&#xA;│   ├── use-package-20160403.1129&#xA;│   ├── vi-tilde-fringe-20141027.1942&#xA;│   ├── volatile-highlights-20160221.212&#xA;│   ├── which-key-20160331.1313&#xA;│   ├── window-numbering-20150228.1247&#xA;│   ├── with-editor-20160223.1155&#xA;│   ├── ws-butler-20150126.759&#xA;│   └── yasnippet-20160403.830&#xA;│       └── snippets&#xA;│           ├── antlr-mode&#xA;│           ├── applescript-mode&#xA;│           ├── cc-mode&#xA;│           ├── chef-mode&#xA;│           ├── clojure-mode&#xA;│           ├── cmake-mode&#xA;│           ├── c-mode&#xA;│           ├── c++-mode&#xA;│           ├── conf-unix-mode&#xA;│           ├── cperl-mode&#xA;│           ├── cpp-omnet-mode&#xA;│           ├── csharp-mode&#xA;│           ├── css-mode&#xA;│           ├── dix-mode&#xA;│           ├── elixir-mode&#xA;│           ├── emacs-lisp-mode&#xA;│           ├── erc-mode&#xA;│           ├── erlang-mode&#xA;│           ├── f90-mode&#xA;│           ├── faust-mode&#xA;│           ├── fundamental-mode&#xA;│           ├── git-commit-mode&#xA;│           ├── go-mode&#xA;│           ├── groovy-mode&#xA;│           ├── haskell-mode&#xA;│           ├── html-mode&#xA;│           ├── java-mode&#xA;│           ├── js-mode&#xA;│           ├── latex-mode&#xA;│           ├── lisp-interaction-mode&#xA;│           ├── lisp-mode&#xA;│           ├── lua-mode&#xA;│           ├── m4-mode&#xA;│           ├── makefile-automake-mode&#xA;│           ├── makefile-bsdmake-mode&#xA;│           ├── makefile-gmake-mode&#xA;│           ├── makefile-mode&#xA;│           ├── malabar-mode&#xA;│           ├── markdown-mode&#xA;│           ├── ned-mode&#xA;│           ├── nesc-mode&#xA;│           ├── nix-mode&#xA;│           ├── nsis-mode&#xA;│           ├── nxml-mode&#xA;│           ├── octave-mode&#xA;│           ├── org-mode&#xA;│           ├── perl-mode&#xA;│           ├── prog-mode&#xA;│           ├── python-mode&#xA;│           ├── rst-mode&#xA;│           ├── ruby-mode&#xA;│           ├── scala-mode&#xA;│           ├── sh-mode&#xA;│           ├── snippet-mode&#xA;│           ├── sql-mode&#xA;│           ├── text-mode&#xA;│           ├── tuareg-mode&#xA;│           ├── udev-mode&#xA;│           └── yaml-mode&#xA;├── layers&#xA;│   ├── auto-completion&#xA;│   │   └── snippets&#xA;│   │       └── emacs-lisp-mode&#xA;│   ├── better-defaults&#xA;│   │   └── img&#xA;│   ├── chinese&#xA;│   │   └── img&#xA;│   ├── chrome&#xA;│   │   └── img&#xA;│   ├── colors&#xA;│   │   ├── extensions&#xA;│   │   │   └── nyan-mode&#xA;│   │   │       ├── img&#xA;│   │   │       └── mus&#xA;│   │   └── img&#xA;│   ├── +config-files&#xA;│   │   ├── ansible&#xA;│   │   │   └── img&#xA;│   │   ├── dockerfile&#xA;│   │   │   └── img&#xA;│   │   ├── puppet&#xA;│   │   │   └── img&#xA;│   │   ├── salt&#xA;│   │   │   └── img&#xA;│   │   └── terraform&#xA;│   │       └── img&#xA;│   ├── cscope&#xA;│   │   └── img&#xA;│   ├── deft&#xA;│   ├── +distribution&#xA;│   │   ├── spacemacs&#xA;│   │   │   └── local&#xA;│   │   │       ├── centered-cursor&#xA;│   │   │       ├── paradox&#xA;│   │   │       └── zoom-frm&#xA;│   │   └── spacemacs-base&#xA;│   │       └── local&#xA;│   │           ├── evil-evilified-state&#xA;│   │           ├── helm-spacemacs&#xA;│   │           ├── holy-mode&#xA;│   │           └── hybrid-mode&#xA;│   ├── +email&#xA;│   │   ├── gnus&#xA;│   │   │   └── img&#xA;│   │   └── mu4e&#xA;│   ├── finance&#xA;│   │   └── img&#xA;│   ├── floobits&#xA;│   │   └── img&#xA;│   ├── +frameworks&#xA;│   │   ├── django&#xA;│   │   │   └── img&#xA;│   │   ├── react&#xA;│   │   │   └── img&#xA;│   │   └── ruby-on-rails&#xA;│   │       └── img&#xA;│   ├── +fun&#xA;│   │   ├── emoji&#xA;│   │   │   └── img&#xA;│   │   ├── games&#xA;│   │   │   ├── extensions&#xA;│   │   │   │   └── helm-games&#xA;│   │   │   └── img&#xA;│   │   ├── selectric&#xA;│   │   │   └── img&#xA;│   │   └── xkcd&#xA;│   │       └── img&#xA;│   ├── geolocation&#xA;│   │   └── img&#xA;│   ├── gtags&#xA;│   ├── ibuffer&#xA;│   ├── +irc&#xA;│   │   ├── erc&#xA;│   │   │   └── extensions&#xA;│   │   │       ├── erc-sasl&#xA;│   │   │       ├── erc-tex&#xA;│   │   │       └── erc-yank&#xA;│   │   └── rcirc&#xA;│   │       ├── img&#xA;│   │       └── local&#xA;│   │           ├── helm-rcirc&#xA;│   │           ├── rcirc-late-fix&#xA;│   │           └── rcirc-reconnect&#xA;│   ├── jabber&#xA;│   │   └── img&#xA;│   ├── +keyboard-layouts&#xA;│   │   └── bepo&#xA;│   │       └── img&#xA;│   ├── +lang&#xA;│   │   ├── agda&#xA;│   │   ├── asciidoc&#xA;│   │   ├── autohotkey&#xA;│   │   │   └── img&#xA;│   │   ├── c-c++&#xA;│   │   │   └── img&#xA;│   │   ├── clojure&#xA;│   │   │   └── img&#xA;│   │   ├── common-lisp&#xA;│   │   │   └── img&#xA;│   │   ├── csharp&#xA;│   │   │   └── img&#xA;│   │   ├── d&#xA;│   │   │   └── img&#xA;│   │   ├── elixir&#xA;│   │   │   └── img&#xA;│   │   ├── elm&#xA;│   │   │   └── img&#xA;│   │   ├── emacs-lisp&#xA;│   │   │   └── img&#xA;│   │   ├── erlang&#xA;│   │   │   └── img&#xA;│   │   ├── ess&#xA;│   │   │   └── img&#xA;│   │   ├── extra-langs&#xA;│   │   ├── fsharp&#xA;│   │   │   └── img&#xA;│   │   ├── go&#xA;│   │   │   ├── extensions&#xA;│   │   │   │   └── go-rename&#xA;│   │   │   └── img&#xA;│   │   ├── haskell&#xA;│   │   │   └── img&#xA;│   │   ├── html&#xA;│   │   │   └── img&#xA;│   │   ├── idris&#xA;│   │   │   └── img&#xA;│   │   ├── ipython-notebook&#xA;│   │   │   └── img&#xA;│   │   ├── java&#xA;│   │   │   └── img&#xA;│   │   ├── javascript&#xA;│   │   │   └── img&#xA;│   │   ├── latex&#xA;│   │   │   └── img&#xA;│   │   ├── lua&#xA;│   │   │   └── img&#xA;│   │   ├── markdown&#xA;│   │   │   └── img&#xA;│   │   ├── nim&#xA;│   │   │   └── img&#xA;│   │   ├── ocaml&#xA;│   │   │   └── img&#xA;│   │   ├── octave&#xA;│   │   │   └── img&#xA;│   │   ├── php&#xA;│   │   │   └── img&#xA;│   │   ├── purescript&#xA;│   │   │   └── img&#xA;│   │   ├── python&#xA;│   │   │   ├── img&#xA;│   │   │   └── local&#xA;│   │   │       ├── nose&#xA;│   │   │       └── pylookup&#xA;│   │   ├── racket&#xA;│   │   │   └── img&#xA;│   │   ├── ruby&#xA;│   │   │   └── img&#xA;│   │   ├── rust&#xA;│   │   │   └── img&#xA;│   │   ├── scala&#xA;│   │   │   └── img&#xA;│   │   ├── scheme&#xA;│   │   ├── shell-scripts&#xA;│   │   │   └── img&#xA;│   │   ├── sml&#xA;│   │   │   └── img&#xA;│   │   ├── sql&#xA;│   │   │   └── img&#xA;│   │   ├── swift&#xA;│   │   │   └── img&#xA;│   │   ├── typescript&#xA;│   │   │   └── img&#xA;│   │   ├── vimscript&#xA;│   │   ├── windows-scripts&#xA;│   │   │   ├── extensions&#xA;│   │   │   │   └── dos&#xA;│   │   │   └── img&#xA;│   │   └── yaml&#xA;│   ├── nixos&#xA;│   │   └── img&#xA;│   ├── org&#xA;│   │   ├── extensions&#xA;│   │   │   ├── evil-org&#xA;│   │   │   └── ox-gfm&#xA;│   │   └── img&#xA;│   ├── osx&#xA;│   │   └── img&#xA;│   ├── prodigy&#xA;│   │   └── img&#xA;│   ├── restclient&#xA;│   ├── search-engine&#xA;│   │   └── img&#xA;│   ├── semantic&#xA;│   ├── shell&#xA;│   │   └── img&#xA;│   ├── smex&#xA;│   │   └── img&#xA;│   ├── +source-control&#xA;│   │   ├── git&#xA;│   │   │   └── img&#xA;│   │   ├── github&#xA;│   │   │   └── img&#xA;│   │   ├── perforce&#xA;│   │   │   └── img&#xA;│   │   └── version-control&#xA;│   ├── speed-reading&#xA;│   ├── spell-checking&#xA;│   ├── spotify&#xA;│   │   └── img&#xA;│   ├── syntax-checking&#xA;│   │   └── img&#xA;│   ├── themes-megapack&#xA;│   ├── theming&#xA;│   ├── +tools&#xA;│   │   ├── command-log&#xA;│   │   ├── dash&#xA;│   │   │   └── img&#xA;│   │   ├── elfeed&#xA;│   │   │   └── img&#xA;│   │   ├── evernote&#xA;│   │   │   └── img&#xA;│   │   ├── fasd&#xA;│   │   ├── pandoc&#xA;│   │   ├── ranger&#xA;│   │   ├── tmux&#xA;│   │   │   └── extensions&#xA;│   │   │       └── tmux&#xA;│   │   ├── vagrant&#xA;│   │   │   └── img&#xA;│   │   ├── wakatime&#xA;│   │   │   └── img&#xA;│   │   └── ycmd&#xA;│   ├── typography&#xA;│   ├── +vim&#xA;│   │   ├── evil-cleverparens&#xA;│   │   ├── evil-commentary&#xA;│   │   ├── evil-snipe&#xA;│   │   │   └── img&#xA;│   │   ├── unimpaired&#xA;│   │   ├── vim-empty-lines&#xA;│   │   │   └── extensions&#xA;│   │   │       └── vim-empty-lines-mode&#xA;│   │   ├── vim-powerline&#xA;│   │   │   └── local&#xA;│   │   │       └── vim-powerline&#xA;│   │   └── vinegar&#xA;│   └── +window-management&#xA;│       ├── eyebrowse&#xA;│       │   └── img&#xA;│       └── spacemacs-layouts&#xA;├── private&#xA;│   ├── local&#xA;│   └── snippets&#xA;└── tests&#xA;    ├── core&#xA;    │   └── data&#xA;    └── layers&#xA;        └── +distribution&#xA;            ├── spacemacs&#xA;            └── spacemacs-base&#xA;&#xA;536 directories&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After looking through it, it looks like a lot of it is written in a flexible way, using relative directory structure, and I cannot find any system-specific system calls. I think there's a good chance it will work for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only practical way to tell is to test it.&lt;/p&gt;&#xA;" OwnerUserId="591" LastEditorUserId="591" LastEditDate="2016-05-29T00:17:54.513" LastActivityDate="2016-05-29T00:17:54.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22604" PostTypeId="1" AcceptedAnswerId="22605" CreationDate="2016-05-28T14:43:28.347" Score="3" ViewCount="1138" Body="&lt;p&gt;I installed the &lt;code&gt;magit&lt;/code&gt; package via Marmalade. When I run M-x magit-status it takes a long time to run and complete (about 30 seconds). How can I speed this up?&lt;/p&gt;&#xA;" OwnerDisplayName="user12201" LastActivityDate="2016-05-28T15:10:09.303" Title="Magit Status Runs Very Slowly" Tags="|magit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22605" PostTypeId="2" ParentId="22604" CreationDate="2016-05-28T15:10:09.303" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I installed the &lt;code&gt;magit&lt;/code&gt; package via Marmalade.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;magit&lt;/code&gt; package on Marmalade is no longer being updated, because the maintainer of Marmalade has stopped actually maintaining it. Before I gave up on Marmalade, I had some technical issues when trying to upload new releases and it was very hard to get the maintainer to help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last release that is available from Marmalade is &lt;code&gt;v2.4.1&lt;/code&gt; but the current release is &lt;code&gt;v2.7.0&lt;/code&gt;. Furthermore I believe the manuals are missing from the &lt;code&gt;v2.4.1&lt;/code&gt; tarball available from Marmalade, because Marmalade decided that the original tarball was to large and I had to remove the documentation to make it smaller. Otherwise I would not have been able to upload a new tarball at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That was the final straw and I decided to no longer attempt to upload new releases to Marmalade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that many other packages also are no longer being updated on Marmalade. While it is still possible to upload new releases and (probably) new packages, that is only the case if you already have a Marmalade account. If you want to create a new account to be able to upload new packages, then you are out of luck - the maintainer does not respond to such (or any other) requests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Marmalade is dying a slow death and you should move to Melpa or Melpa stable.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I speed this up?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Updating to &lt;code&gt;v2.7.0&lt;/code&gt; should help. Performance has improved since &lt;code&gt;v2.4.1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not enough, then see &lt;a href=&quot;https://magit.vc/manual/magit/Performance.html&quot;&gt;the info node dedicated to performance issues&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-05-28T15:10:09.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22606" PostTypeId="2" ParentId="22583" CreationDate="2016-05-28T15:18:53.727" Score="0" Body="&lt;p&gt;Try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun nxml-jump-to-closing-tag ()&#xA;  (interactive)&#xA;  (forward-char 2)&#xA;  (if (search-backward &quot;&amp;lt;&quot; nil t)&#xA;      (nxml-forward-element)&#xA;    (message &quot;No more elements&quot;)&#xA;    )&#xA;  )&#xA;&#xA;(defun nxml-jump-to-openning-tag ()&#xA;  (interactive)&#xA;  (backward-char 2)&#xA;  (if (search-forward &quot;&amp;gt;&quot; nil t)&#xA;      (nxml-backward-element)&#xA;    (message &quot;No more elements&quot;)&#xA;    )&#xA;  )&#xA;&#xA;(define-key nxml-mode-map (kbd &quot;&amp;lt;C-M-right&amp;gt;&quot;) 'nxml-jump-to-closing-tag)&#xA;(define-key nxml-mode-map (kbd &quot;&amp;lt;C-M-left&amp;gt;&quot;)  'nxml-jump-to-openning-tag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;C-M-←&lt;/code&gt;. Press &lt;code&gt;C-M-→&lt;/code&gt; to get back.&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2016-05-28T15:50:17.713" LastActivityDate="2016-05-28T15:50:17.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22607" PostTypeId="1" CreationDate="2016-05-28T16:25:46.573" Score="4" ViewCount="2333" Body="&lt;p&gt;How can I control the background color of my LaTex fragments in Org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the &lt;code&gt;badwolf-theme&lt;/code&gt; package, and this is what I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/S0dlR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/S0dlR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like the background color of my formulas to match the background color of my org buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my current &lt;code&gt;org-format-latex-options&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wx3yq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wx3yq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2016-05-29T00:03:38.853" LastActivityDate="2022-10-21T08:38:11.040" Title="Background color of LaTeX fragments in Org mode" Tags="|latex|colors|org-mode|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22608" PostTypeId="2" ParentId="22543" CreationDate="2016-05-28T19:02:52.557" Score="1" Body="&lt;p&gt;EIEIO does come with some support for marshalling/unmarshalling, since that was needed for CEDET (the main drive behind the implementation of EIEIO, AFAIK).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The base function for that is &lt;code&gt;object-write&lt;/code&gt;.  And it seems that &lt;code&gt;eieio-persistent-convert-list-to-object&lt;/code&gt; will convert it back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, EIEIO objects are represented as Elisp vectors which you can print&amp;amp;read like any other Elisp data, so you may not need anything special to do (un)marshalling.  Tho admittedly, this is more brittle since this internal representation can change (e.g. it is different in Emacs-25, and it would be different if you change the definition of &lt;code&gt;record&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-05-30T21:27:15.987" LastActivityDate="2016-05-30T21:27:15.987" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22609" PostTypeId="1" CreationDate="2016-05-28T20:41:56.053" Score="2" ViewCount="301" Body="&lt;p&gt;Often I type a command like &lt;code&gt;C-x C-f&lt;/code&gt; and then want to cancel it by pressing &lt;code&gt;C-g&lt;/code&gt;. In normal emacs this was never a problem, but with &lt;code&gt;helm&lt;/code&gt; I get a big minibuffer that says &lt;code&gt;Quit&lt;/code&gt; and then shows some weird stuff. Pressing &lt;code&gt;C-g&lt;/code&gt; more times doesn't fix anything. (If it matters, I'm using spacemacs in holy-mode, but I'm convinced this is a &lt;code&gt;helm&lt;/code&gt;-specific issue).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Demo&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After pressing &lt;code&gt;C-x C-f&lt;/code&gt;:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/0chVG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0chVG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After pressing &lt;code&gt;C-g&lt;/code&gt; to cancel, the minibuf says &lt;code&gt;Quit&lt;/code&gt; at the top and then displays:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/KnPvk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KnPvk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I press &lt;code&gt;C-g&lt;/code&gt; more times I just get more &lt;code&gt;[No match]&lt;/code&gt;s at the bottom. The only solution is to press &lt;code&gt;RET&lt;/code&gt; until it opens some random file, which is of course undesirable behavior. This happens for all commands, not just &lt;code&gt;C-x C-f&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5376" LastActivityDate="2016-05-28T20:41:56.053" Title="helm-M-x freezes and leaves large minibuffer after C-g" Tags="|helm|spacemacs|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22610" PostTypeId="2" ParentId="22601" CreationDate="2016-05-28T22:06:22.303" Score="3" Body="&lt;p&gt;CIDER offers &lt;a href=&quot;http://cider.readthedocs.io/en/latest/indent_spec/&quot; rel=&quot;nofollow&quot;&gt;that functionality&lt;/a&gt;.  Instead of using an extra declaration form, one puts the indentation info into the function's metadata:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro comment&#xA;  &quot;Ignores body, yields nil&quot;&#xA;  {:style/indent 1}&#xA;  [&amp;amp; body])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-05-28T22:06:22.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22611" PostTypeId="1" AcceptedAnswerId="22614" CreationDate="2016-05-28T22:15:15.897" Score="6" ViewCount="751" Body="&lt;p&gt;I've seen many different ways of specifying key combinations for setting or unsetting key bindings in emacs.  Some are quoted, others are bracketed, some are escaped, others are not.  Do they all work in all contexts?  Is there a best practice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples from my init file which may or may not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;&amp;lt;M-S-right&amp;gt;&quot;) nil)&#xA;(define-key evil-normal-state-map (kbd &quot;C-k&quot;) (foo))&#xA;(define-key global-map (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;(global-set-key [(C-f4)] 'bury-buffer)&#xA;(global-set-key [(f6)] 'emms-playlist-mode-go)&#xA;(define-key c-mode-map  [(tab)] 'company-complete)&#xA;(define-key ggtags-mode-map (kbd &quot;C-c g s&quot;) 'ggtags-find-other-symbol)&#xA;(setq helm-gtags-prefix-key &quot;\C-cg&quot;)&#xA;(define-key evil-normal-state-map [escape] 'keyboard-quit)&#xA;(bind-key &quot;&amp;lt;escape&amp;gt;&quot; 'isearch-cancel isearch-mode-map)&#xA;(global-unset-key &quot;\M-:&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a canonical way to define key combinations?  If so, where can I read about it, especially for a list of special and modifier keys (tab, escape, return, meta, ctrl, shift, super, Fn, delete)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: This question and the answers below go a lot deeper than the similar question &lt;a href=&quot;https://emacs.stackexchange.com/questions/14992/is-there-a-standard-recommended-syntax-for-defining-a-keyboard-binding&quot;&gt;asked here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-05-29T12:35:25.620" Title="is there a canonical way of representing key combinations in elisp? what is it?" Tags="|key-bindings|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22612" PostTypeId="1" AcceptedAnswerId="22620" CreationDate="2016-05-28T22:34:35.513" Score="2" ViewCount="66" Body="&lt;p&gt;I'm trying to compare &lt;code&gt;(quote foo)&lt;/code&gt; with &lt;code&gt;'foo&lt;/code&gt; using equal, but the equality is failing. Here is a trace of what is happening with my code. I don't understand why the comparison fails -- does it have something to do with the reader, or chained evaluation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can write the code to make the comparison succeed?  Thanks&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(plist-get (gethash &quot;key&quot; table) 'type)&#xA;(quote ctkb)&#xA;&#xA;(equal 'ctkb (quote ctkb))&#xA;t&#xA;&#xA;(equal 'ctkb (plist-get (gethash &quot;key&quot; table) 'type))&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-05-29T04:13:23.793" Title="Comparison of quoted symbols fails using equal" Tags="|quote|eval|equality|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22613" PostTypeId="2" ParentId="22611" CreationDate="2016-05-28T22:56:55.223" Score="7" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There is no &quot;canonical&quot; representation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want an external, i.e., source-code representation that is applicable generally and easy to read, then use &lt;strong&gt;&lt;code&gt;kbd&lt;/code&gt;&lt;/strong&gt;. The manual and &lt;code&gt;C-h k&lt;/code&gt; will tell you the external representation for a given key, and you can pass that to &lt;code&gt;kbd&lt;/code&gt; in a string.  The value returned is an internal representation of the key sequence.  Similarly, you can use function &lt;strong&gt;&lt;code&gt;key-description&lt;/code&gt;&lt;/strong&gt; as an approximate inverse of &lt;code&gt;kbd&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in the example you gave of using &lt;code&gt;[(C-f4)]&lt;/code&gt; you could just as easily used the external representation &lt;code&gt;C-&amp;lt;f4&amp;gt;&lt;/code&gt;, wrapping that as a string with &lt;code&gt;kbd&lt;/code&gt;: &lt;code&gt;(kbd &quot;C-&amp;lt;f4&quot;)&lt;/code&gt; -- that returns &lt;code&gt;[C-f4]&lt;/code&gt; which is equivalent to &lt;code&gt;[(C-f4)]&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To see how a given key binding might be represented internally, you can also examine a keymap where it is bound (using, for example, &lt;code&gt;C-h v&lt;/code&gt; with a keymap variable, such as &lt;code&gt;ctl-x-map&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The doc for &lt;code&gt;kbd&lt;/code&gt; tells you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function converts the text KEYSEQ-TEXT (a string constant)&#xA;       into a key sequence (a string or vector constant).  The contents of&#xA;       KEYSEQ-TEXT should use the same syntax as in the buffer invoked by&#xA;       the &lt;code&gt;C-x C-k &amp;lt;RET&amp;gt;&lt;/code&gt; (&lt;code&gt;kmacro-edit-macro&lt;/code&gt;) command; in particular,&#xA;       you must surround function key names with &lt;code&gt;&amp;lt;…&amp;gt;&lt;/code&gt;. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Edit-Keyboard-Macro.html&quot;&gt;(emacs)Edit&#xA;       Keyboard Macro&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Key-Bindings.html&quot;&gt;Key Bindings&lt;/a&gt; and its subnodes, and the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Keymaps.html&quot;&gt;Keymaps&lt;/a&gt; and its subnodes.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-28T23:10:51.940" LastActivityDate="2016-05-28T23:10:51.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22614" PostTypeId="2" ParentId="22611" CreationDate="2016-05-28T23:14:59.523" Score="8" Body="&lt;p&gt;The internal representation of a key sequence is as a vector of &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Input-Events.html#Input-Events&quot;&gt;events&lt;/a&gt;. The internal representation is anything that the built-in primitives &lt;code&gt;define-key&lt;/code&gt; and &lt;code&gt;lookup-key&lt;/code&gt; recognize, and all the other functions based on them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An individual event can be a character (for characters, possibly with modifiers), a symbol (for any event, possibly with modifiers) or a list (containing modifiers and a base event). There can be more than one representation of an event, e.g. &lt;code&gt;(meta ?a)&lt;/code&gt; and &lt;code&gt;?\M-a&lt;/code&gt; are the same event. I don't think that there is one representation of events that is officially declared canonical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to compare events (but you probably don't, because input processing is complicated — let the keymap code handle that), you can call &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Classifying-Events.html#index-event_002dmodifiers&quot;&gt;&lt;code&gt;event-modifiers&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Classifying-Events.html#index-event_002dbasic_002dtype&quot;&gt;&lt;code&gt;event-basic-type&lt;/code&gt;&lt;/a&gt; to decompose an event, or contrariwise &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Classifying-Events.html#index-event_002dconvert_002dlist&quot;&gt;&lt;code&gt;event-convert-list&lt;/code&gt;&lt;/a&gt; to pack the event into a single symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html#index-kbd&quot;&gt;&lt;code&gt;kbd&lt;/code&gt;&lt;/a&gt; function turns a “human-friendly” key sequence representation into an internal event representation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When defining a keymap, use whatever syntax you prefer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some events that are normally mapped to the same binding, via &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#Translation-Keymaps&quot;&gt;translation keymaps&lt;/a&gt;. If you're defining a package, you should steer away from those translation keymaps; these are to some extent terminal-dependent and to some extent a user preference. Here a few things to be aware of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Some function keys are mapped to a control character:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[escape]&lt;/code&gt; → &lt;code&gt;(kbd &quot;ESC&quot;)&lt;/code&gt; = &lt;code&gt;?\e&lt;/code&gt; = &lt;code&gt;?\C-\[&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[return]&lt;/code&gt; → &lt;code&gt;(kbd &quot;RET&quot;)&lt;/code&gt; = &lt;code&gt;?\r&lt;/code&gt; = &lt;code&gt;?\C-m&lt;/code&gt; (and &lt;code&gt;[linefeed]&lt;/code&gt; to &lt;code&gt;?\C-j&lt;/code&gt; but few keyboards have that)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[tab]&lt;/code&gt; → &lt;code&gt;(kbd &quot;TAB&quot;)&lt;/code&gt; = &lt;code&gt;?\t&lt;/code&gt; = &lt;code&gt;?\C-i&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[backspace]&lt;/code&gt; → &lt;code&gt;(kbd &quot;DEL&quot;)&lt;/code&gt; = &lt;code&gt;?\C-?&lt;/code&gt; (with additional complications relating to &lt;code&gt;?\C-h&lt;/code&gt; that I won't go into)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Don't define bindings for those function keys, define bindings for the corresponding character instead.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ESC&lt;/code&gt; is very special. &lt;code&gt;ESC &lt;em&gt;key&lt;/em&gt;&lt;/code&gt; is normally equivalent to &lt;code&gt;(meta &lt;em&gt;key&lt;/em&gt;)&lt;/code&gt;. On text terminals, most function keys are mapped to character sequences that start with &lt;code&gt;ESC&lt;/code&gt;. So never define a binding for &lt;code&gt;ESC&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;A mouse click has the mouse button going down, then up, with the mouse possibly moving in between. This generates a flurry of different events. In addition rapid repeated clicks (double click, etc.) are recognized as such. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Mouse-Events.html#Mouse-Events&quot;&gt;Mouse Events&lt;/a&gt; and subsequent sections in the manual.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-05-28T23:14:59.523" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22615" PostTypeId="2" ParentId="22596" CreationDate="2016-05-28T23:24:52.213" Score="5" Body="&lt;p&gt;Yes, if they're running the same version of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The byte compilation format is portable across platforms (it depends neither on the processor architecture nor on the operating system). It's also mostly portable across minor versions of Emacs; see &lt;a href=&quot;https://emacs.stackexchange.com/questions/3418/portability-of-bytecode-between-emacs-versions&quot;&gt;Portability of bytecode between Emacs versions&lt;/a&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you start mixing Emacs versions, or versions of third-party packages, then you may run into incompatibilities with bytecode not due to the bytecode format, but due to changes in macros. For example, suppose package A defines a macro &lt;code&gt;m&lt;/code&gt; and function &lt;code&gt;f&lt;/code&gt;, and package B uses both &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;f&lt;/code&gt;, and version 1 and version 2 of package A have changed the way &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;f&lt;/code&gt; work; if you compile package B against bytecode from version 1 of package A and then run it with version 2 of package A, then package B will be using &lt;code&gt;m&lt;/code&gt; version 1 and &lt;code&gt;f&lt;/code&gt; version A, which can break things. This is only an issue if you mix different versions of Lisp code (either with Emacs itself or from third-party packages). If you install the same version of Emacs everywhere and copy your whole &lt;code&gt;.emacs.d&lt;/code&gt; including all the third-party packages, you'll be fine on this count.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is occasionally Lisp code that depends on the system, but this should be determined at runtime. It's technically possible that the installation of a package does something system-dependent, or that a macro is compiled into something that is system-dependent, but for the most part that would be a sign of a badly-written package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few packages that deliberately analyze your system when you install them, but this is should be rare and should be obvious from the description of the package. For example, AUCTeX can parse locally-installed TeX files to provide package-specific assistance; but given that TeX itself should remain compatible, the files generated on one machine should work anywhere else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I don't know anything about Spacemacs, I can't vouch for it.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-05-28T23:24:52.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22616" PostTypeId="1" AcceptedAnswerId="22623" CreationDate="2016-05-28T23:51:13.097" Score="2" ViewCount="150" Body="&lt;p&gt;I have a favorite function that contains several levels of &lt;code&gt;set-process-sentinel&lt;/code&gt; and &lt;code&gt;lambda&lt;/code&gt; sentinels.  I have been using &lt;code&gt;lexical-let&lt;/code&gt;, but would like to see if it is possible to use dynamically bound variables using a backtick / comma to penetrate several levels deep.  In my testing, I see that a variable dynamically bound using a backtick / comma only pentetrates a couple of levels before the variable becomes &lt;code&gt;void&lt;/code&gt;.  Is there a way to increase the levels of penetration when using the backtick?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example with &lt;code&gt;lexical-let&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun example-lexical-fn ()&#xA;&quot;Doc-string&quot;&#xA;(interactive)&#xA;  (lexical-let* ((test-variable &quot;Hello-world!&quot;))&#xA;    (set-process-sentinel&#xA;      (start-process &quot;process-one&quot; &quot;*one*&quot; &quot;echo&quot; test-variable)&#xA;      (lambda (p e) (when (= 0 (process-exit-status p))&#xA;        (set-process-sentinel&#xA;          (start-process &quot;process-two&quot; &quot;*two*&quot; &quot;echo&quot; test-variable)&#xA;          (lambda (p e) (when (= 0 (process-exit-status p))&#xA;            (start-process &quot;process-three&quot; &quot;*three*&quot; &quot;echo&quot; test-variable)&#xA;            (set-process-sentinel&#xA;              (start-process &quot;process-four&quot; &quot;*four*&quot; &quot;echo&quot; test-variable)&#xA;              (lambda (p e) (when (= 0 (process-exit-status p))&#xA;                (set-process-sentinel&#xA;                  (start-process &quot;process-five&quot; &quot;*five*&quot; &quot;echo&quot; test-variable)&#xA;                  (lambda (p e) (when (= 0 (process-exit-status p))&#xA;                    (message &quot;test-variable:  %s&quot; test-variable)))))))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The dynamic binding putters-out and the &lt;code&gt;test-variable&lt;/code&gt; becomes a &lt;code&gt;void-variable&lt;/code&gt; at the section labeled &quot;process-three&quot;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun example-dynamic-fn ()&#xA;&quot;Doc-string&quot;&#xA;(interactive)&#xA;  (let* ((test-variable &quot;Hello-world!&quot;))&#xA;    (set-process-sentinel&#xA;      (start-process &quot;process-one&quot; &quot;*one*&quot; &quot;echo&quot; test-variable)&#xA;      `(lambda (p e) (when (= 0 (process-exit-status p))&#xA;        (set-process-sentinel&#xA;          (start-process &quot;process-two&quot; &quot;*two*&quot; &quot;echo&quot; ,test-variable)&#xA;          `(lambda (p e) (when (= 0 (process-exit-status p))&#xA;            (start-process &quot;process-three&quot; &quot;*three*&quot; &quot;echo&quot; ,test-variable)&#xA;            (set-process-sentinel&#xA;              (start-process &quot;process-four&quot; &quot;*four*&quot; &quot;echo&quot; ,test-variable)&#xA;              `(lambda (p e) (when (= 0 (process-exit-status p))&#xA;                (set-process-sentinel&#xA;                  (start-process &quot;process-five&quot; &quot;*five*&quot; &quot;echo&quot; ,test-variable)&#xA;                  `(lambda (p e) (when (= 0 (process-exit-status p))&#xA;                    (message &quot;test-variable:  %s&quot; ,test-variable)))))))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is the working example based on the helpful answer of zk_phi:  &quot;&lt;em&gt;Change all backticks to quote (') except for the first one . . . .&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun example-dynamic-fn ()&#xA;&quot;Doc-string&quot;&#xA;(interactive)&#xA;  (let ((test-variable &quot;Hello-world!&quot;))&#xA;    (set-process-sentinel&#xA;      (start-process &quot;process-one&quot; &quot;*one*&quot; &quot;echo&quot; test-variable)&#xA;      `(lambda (p e) (when (= 0 (process-exit-status p))&#xA;        (set-process-sentinel&#xA;          (start-process &quot;process-two&quot; &quot;*two*&quot; &quot;echo&quot; ,test-variable)&#xA;          '(lambda (p e) (when (= 0 (process-exit-status p))&#xA;            (start-process &quot;process-three&quot; &quot;*three*&quot; &quot;echo&quot; ,test-variable)&#xA;            (set-process-sentinel&#xA;              (start-process &quot;process-four&quot; &quot;*four*&quot; &quot;echo&quot; ,test-variable)&#xA;              '(lambda (p e) (when (= 0 (process-exit-status p))&#xA;                (set-process-sentinel&#xA;                  (start-process &quot;process-five&quot; &quot;*five*&quot; &quot;echo&quot; ,test-variable)&#xA;                  '(lambda (p e) (when (= 0 (process-exit-status p))&#xA;                    (message &quot;test-variable:  %s&quot; ,test-variable)))))))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2018-06-21T19:41:42.847" LastActivityDate="2018-06-22T02:23:35.737" Title="Increase the level of dynamic binding with backtick / comma" Tags="|lexical-scoping|let-binding|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="22617" PostTypeId="1" AcceptedAnswerId="22638" CreationDate="2016-05-29T00:19:30.500" Score="2" ViewCount="320" Body="&lt;p&gt;To get a process buffer an eshell buffer I thought I used to be able to run: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-buffer-process (current-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs 25 this no longer works. Specifically &quot;GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2015-11-30&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I do. I start an eshell with &lt;code&gt;M-x eshell&lt;/code&gt;. Then with that as the only window or buffer around I run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eval&#xA;&#xA;Eval: (get-buffer-process (current-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the result is &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using this in the code for realgud, an emacs front-end to various debuggers. It needs to interact with the debugger like see if the debugger is running or has terminated, send commands to it and run hooks when output appears. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I do this? &lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2016-05-31T15:51:19.507" LastActivityDate="2016-05-31T15:51:19.507" Title="getting a process buffer for an eshell buffer" Tags="|eshell|process|realgud|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22620" PostTypeId="2" ParentId="22612" CreationDate="2016-05-29T03:45:47.833" Score="2" Body="&lt;p&gt;It looks like you're comparing &lt;code&gt;'ctkb&lt;/code&gt; with &lt;code&gt;'(quote ctkb)&lt;/code&gt; -- or &lt;code&gt;(quote (quote ctkb))&lt;/code&gt; if you prefer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. Evaluating &lt;code&gt;'(quote ctkb)&lt;/code&gt; returns the value &lt;code&gt;(quote ctkb)&lt;/code&gt;, exactly like your &lt;code&gt;plist-get&lt;/code&gt; return value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(equal 'ctkb (quote ctkb))&lt;/code&gt; is certainly true, but &lt;code&gt;(equal 'ctkb '(quote ctkb))&lt;/code&gt; isn't the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I presume that &lt;code&gt;(equal 'ctkb (cadr (plist-get (gethash &quot;key&quot; table) 'type)))&lt;/code&gt; holds (and indeed &lt;code&gt;eq&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To say anything more, we'd need to see the code you're using to populate the values -- I don't see any unexpected quoting being introduced when I set up a similar structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq table (make-hash-table))&#xA;(setq pl nil)&#xA;(setq pl (plist-put pl 'type 'ctkb))&#xA;(puthash 'k pl table)&#xA;(eq (plist-get (gethash 'k table) 'type) 'ctkb)&#xA;t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-05-29T04:13:23.793" LastActivityDate="2016-05-29T04:13:23.793" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22621" PostTypeId="1" CreationDate="2016-05-29T04:12:56.173" Score="1" ViewCount="70" Body="&lt;p&gt;I want to cut/copy some code with this method:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;setting a mark with &lt;kbd&gt;C-SPC&lt;/kbd&gt;,&lt;/li&gt;&#xA;&lt;li&gt;searching with &lt;kbd&gt;C-s&lt;/kbd&gt;,&lt;/li&gt;&#xA;&lt;li&gt;then cutting/copying the selection. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Check the following image:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1uUj3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1uUj3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can copy selected code with &lt;kbd&gt;M-w&lt;/kbd&gt; or cut (kill) it with &lt;kbd&gt;S-Del&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since I am using CUA-mode, I would prefer to use its keybindings.&lt;br&gt;&#xA;Copying with &lt;kbd&gt;C-c&lt;/kbd&gt; works but cutting with &lt;kbd&gt;C-x&lt;/kbd&gt; fails.&lt;br&gt;&#xA;Is it possible to tweak &lt;kbd&gt;C-x&lt;/kbd&gt; to make it work in this situation?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-05-30T23:17:51.410" Title="Cutting selection with CUA-mode bindings after searching" Tags="|key-bindings|mark|cua-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22622" PostTypeId="1" CreationDate="2016-05-29T04:42:09.537" Score="6" ViewCount="782" Body="&lt;p&gt;Spellcheck in Aquamacs works much better than either the default &lt;code&gt;aspell&lt;/code&gt; or the improved &lt;code&gt;hunspell&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example typo: &lt;code&gt;whtehr&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the suggestions provided by the various engines when I do &lt;code&gt;flyspell-auto-correct-word&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aspell: &lt;code&gt;Corrections: whiter water watery whet White where white whatever whitener whets waiter&lt;/code&gt; etc. (i.e. it never gets to &lt;code&gt;whether&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hunspell: &lt;code&gt;Corrections: Tehran&lt;/code&gt; (i.e. it never gets to &lt;code&gt;whether&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aquamacs: &lt;code&gt;Corrections: whether&lt;/code&gt; (i.e. it gets to &lt;code&gt;whether&lt;/code&gt; on the first try)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://aquamacs.org/spelling.shtml&quot; rel=&quot;noreferrer&quot;&gt;this page&lt;/a&gt;, &quot;Aquamacs 2.0 and onwards uses the Mac OSX spell-checking system.&quot; It's not clear from the page whether the Mac OSX spell-checking system in question is CocoAspell, or if CocoAspell is recommended for version 1.9 and below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how do I direct GNU Emacs to use the same spellchecker that Aquamacs uses?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2016-05-30T15:03:02.277" LastActivityDate="2018-04-07T12:51:52.397" Title="how to install Aquamacs' OSX spellchecker (NSSpellChecker) in GNU Emacs?" Tags="|flyspell|ispell|spell-checking|aquamacs|hunspell|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22623" PostTypeId="2" ParentId="22616" CreationDate="2016-05-29T05:10:07.250" Score="1" Body="&lt;p&gt;You have too many backticks in the expression. If you nest n backticks, then you need n commas before the expression you want to splice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;highlight-stages&lt;/code&gt; package shows which parts in a expression are quoted (not evaluated), FYI.&lt;/p&gt;&#xA;" OwnerUserId="12049" LastActivityDate="2016-05-29T05:10:07.250" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22624" PostTypeId="2" ParentId="22595" CreationDate="2016-05-29T06:03:52.440" Score="0" Body="&lt;p&gt;TLDR: &lt;code&gt;(setf tab-width 4)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was seeing the unwanted behavior of 4 spaces being inserted despite &lt;code&gt;indent-tabs-mode&lt;/code&gt; being &lt;code&gt;t&lt;/code&gt;. Thankfully, emacs is free software, so I was able to follow my &lt;code&gt;TAB&lt;/code&gt; key press all the way down to the C source:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`TAB-&amp;gt;c-indent-line-or-region-&amp;gt;(symbol-function 'indent-according-to-mode)-&amp;gt;c-shift-line-indentation-&amp;gt;indent-to`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;indent-to is defined in C source. the relevant portion is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (indent_tabs_mode)&#xA;{&#xA;  Lisp_Object n;&#xA;  XSETFASTINT (n, mincol / tab_width - fromcol / tab_width);&#xA;  if (XFASTINT (n) != 0)&#xA;{&#xA;  Finsert_char (make_number ('\t'), n, Qt);&#xA;&#xA;  fromcol = (mincol / tab_width) * tab_width;&#xA;}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;clearly n was being 0. This is because &lt;code&gt;mincol / tab_width&lt;/code&gt; was &lt;code&gt;4 / 8&lt;/code&gt;, because tab-width was too big. Setting &lt;code&gt;(setf tab-width 4)&lt;/code&gt; allows the function to indent using a tab, and no spaces are needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'java-mode-hook (lambda () (setf tab-width 4)))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2016-05-29T06:10:02.583" LastActivityDate="2016-05-29T06:10:02.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22625" PostTypeId="1" AcceptedAnswerId="22626" CreationDate="2016-05-29T08:21:04.863" Score="12" ViewCount="952" Body="&lt;p&gt;Emacs docs say that when doc string is put inside of &lt;code&gt;lambda&lt;/code&gt; or &lt;code&gt;defun&lt;/code&gt; it's “stored directly in the function object”. However, we can change docs of named functions like this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(put 'my-function-name 'function-documentation &quot;Blah.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the same trick doesn't work with lambdas. Is there a way to add documentation to lambda? Or somehow dynamically generate doc-string literal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify, imagine the following situation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((foo 1)&#xA;      (bar 2))&#xA;  (lambda ()&#xA;    (+ foo bar)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like the lambda to have a doc string that mentions values of &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2487" LastEditorUserId="105" LastEditDate="2022-09-18T17:34:30.283" LastActivityDate="2022-09-18T17:34:30.283" Title="Is it possible to attach generated doc string to a lambda?" Tags="|doc-strings|lambda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22626" PostTypeId="2" ParentId="22625" CreationDate="2016-05-29T09:14:15.990" Score="13" Body="&lt;p&gt;Well lambdas can have regular docstrings just like any other function definition:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(lambda ()&#xA;   &quot;I'm a docstring!&quot;&#xA;   (+ foo bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you could use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((foo 1)&#xA;      (bar 2))&#xA;  `(lambda ()&#xA;     ,(format &quot;Function which sums foo=%s and bar=%s&quot; foo bar)&#xA;     (+ foo bar)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why you want a docstring on an anonymous function is another question, which might affect the approach you take.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance if you're planning to bind it to a key and you want &lt;code&gt;C-h k&lt;/code&gt; to display that help, you could use this approach, but of course the help will still also display the function object itself (docstring included), which isn't so great; nevertheless you could do this and you &lt;em&gt;would&lt;/em&gt; (also) see the nicely-formatted version:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key&#xA; (kbd &quot;C-c a&quot;)&#xA; (let ((foo 1)&#xA;       (bar 2))&#xA;   `(lambda ()&#xA;      ,(format &quot;Function which sums foo=%s and bar=%s&quot; foo bar)&#xA;      (interactive)&#xA;      (+ foo bar))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may prefer to use a symbol, however. You can pair an anonymous function with an &lt;em&gt;uninterned&lt;/em&gt; symbol, and not worry about it conflicting with any other symbols of the same name. This makes the help cleaner, as it will display the symbol name rather than the function object. In this instance we have the option of passing the docstring to &lt;code&gt;defalias&lt;/code&gt; instead of embedding it in the lambda form.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key&#xA; (kbd &quot;C-c a&quot;)&#xA; (let ((foo 1)&#xA;       (bar 2))&#xA;   (defalias (make-symbol &quot;a-foo-bar-function&quot;)&#xA;     (lambda ()&#xA;       (interactive)&#xA;       (+ foo bar))&#xA;     (format &quot;Function which sums foo=%s and bar=%s&quot; foo bar))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or (and this is very much the same thing) you could capture the uninterned symbol, and set the symbol property directly, as per your original code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key&#xA; (kbd &quot;C-c a&quot;)&#xA; (let ((foo 1)&#xA;       (bar 2)&#xA;       (sym (make-symbol &quot;a-foo-bar-function&quot;)))&#xA;   (put sym 'function-documentation&#xA;        (format &quot;Function which sums foo=%s and bar=%s&quot; foo bar))&#xA;   (defalias sym&#xA;     (lambda ()&#xA;       (interactive)&#xA;       (+ foo bar)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a side note, be aware that this function is &lt;em&gt;only&lt;/em&gt; going to be summing the let-bound values for &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt; if you're using &lt;code&gt;lexical-binding: t&lt;/code&gt; for your library. If foo and bar are dynamically bound, the docstrings I've generated would most likely not be accurate at run-time. We can actually cater to that situation with &lt;em&gt;dynamic&lt;/em&gt; docstrings, though. Info node &lt;code&gt;(elisp) Accessing Documentation&lt;/code&gt; says of &lt;code&gt;documentation-property&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the property value isn’t ‘nil’, isn’t a string, and doesn’t refer to text in a file, then it is evaluated as a Lisp expression to obtain a string.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So with any of the symbol-based approaches, we could quote the documentation form in order to have it evaluated at call time:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defalias (make-symbol &quot;a-foo-bar-function&quot;)&#xA;   (lambda ()&#xA;     (interactive)&#xA;     (+ foo bar))&#xA;   '(format &quot;Function which sums foo=%s and bar=%s&quot; foo bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-05-30T01:43:01.063" LastActivityDate="2016-05-30T01:43:01.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22627" PostTypeId="2" ParentId="22625" CreationDate="2016-05-29T15:16:31.563" Score="16" Body="&lt;p&gt;In Emacs-25, there's a new feature exactly for that purpose:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((foo 1)&#xA;      (bar 2))&#xA;  (lambda ()&#xA;    (:documentation (format &quot;Return the sum of %d and %d.&quot; foo bar))&#xA;    (+ foo bar)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-05-29T15:16:31.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22628" PostTypeId="2" ParentId="22520" CreationDate="2016-05-29T20:40:33.907" Score="0" Body="&lt;p&gt;I posted this question on &lt;a href=&quot;https://github.com/auto-complete/auto-complete/issues/444&quot; rel=&quot;nofollow&quot;&gt;GitHub&lt;/a&gt; and received a nice answer by &lt;a href=&quot;https://github.com/syohex&quot; rel=&quot;nofollow&quot;&gt;syohex&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;(i) How does auto-complete get notified about 3rd party syntax packages in general? Does it scan the directory or do I need to specify it in my .emacs file?  &lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;  &#xA;  &lt;p&gt;Load 3rd party package in your configuration file. For example,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(require 'ac-html-bootstrap)&lt;/code&gt;  &lt;/p&gt;&#xA;  &#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;(ii) How is it hooked to a certain mode or file extension? Is this provided by the syntax package itself or do I have to specify it?&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;  &#xA;  &lt;p&gt;Add 3rd party source to ac-sources in specific mode hook(eg, python-mode-hook, ruby-mode-hook, etc). For example,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(require 'ac-c-headers)&#xA;  (defun my/c-mode-hook ()&#xA;    (add-to-list 'ac-sources 'ac-source-c-headers))&#xA;  (add-hook 'c-mode-hook 'my/c-mode-hook)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;ac-sources&lt;/code&gt; is a buffer local variable so above configuration does not affect other major-mode buffers.&lt;/p&gt;&#xA;  &#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;(iii) How do I make sure, a package is correctly working? How do I tell the difference between the state without and with the package?&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;  &#xA;  &lt;p&gt;You can get expected candidates then it looks working correctly. For example if you use go-autocomplete, then you should get candidates of Go methods, variable names, functions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2016-05-29T20:40:33.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22629" PostTypeId="1" CreationDate="2016-05-29T21:48:49.183" Score="2" ViewCount="424" Body="&lt;p&gt;I've been trying to find a navigation package that allows backwards/forwards navigation across and within buffers. I have found a lot of solutions out there but none of them seem to solve the whole problem. Here are the requirements:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Should work &lt;em&gt;across&lt;/em&gt; buffers. This means locations within a buffer AND the in other buffers. Kind of like if the global mark ring merged all local buffer mark rings. I'd like the navigation between the two to be seamless and not require using separate commands for each one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Records marks on any meaningful cursor movement, but minimizes noise ala this &lt;a href=&quot;https://stackoverflow.com/q/13564506/3166303&quot;&gt;question&lt;/a&gt; description.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Has some sane bounds on the number of positions recorded and ideally is configurable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Should be able to go backwards AND forwards.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;https://stackoverflow.com/a/27661338/3166303&quot;&gt;answer&lt;/a&gt; gets close, but doesn't seem to work consistently with navigating within the local buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something out there that meets all these requirements or do I need to roll my own?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I've missed a solution somewhere else that meets these requirements, please let me know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think what i'm looking for is something like &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/2aaerb/eviljumper_jump_like_vimmers_do/&quot; rel=&quot;nofollow noreferrer&quot;&gt;evil-jumper&lt;/a&gt; but without the evil part :) There is &lt;a href=&quot;https://github.com/emacsmirror/jumpc&quot; rel=&quot;nofollow noreferrer&quot;&gt;jumpc&lt;/a&gt;, but it seems to only insert jumps on edits, not other navigation points.&lt;/p&gt;&#xA;" OwnerUserId="11397" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-05-30T12:26:42.003" Title="Back/forward navigation that works like IntelliJ/Eclipse" Tags="|navigation|mark-ring|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22631" PostTypeId="2" ParentId="22629" CreationDate="2016-05-29T23:52:49.830" Score="1" Body="&lt;p&gt;[First, I'll say up front that this answer does not satisfy your second requirement, which is to use more than just markers as points to visit.  I mention it anyway, because I think it could help, if you combine it with code that automatically creates markers at the stopping points you want (however you might happen to define those).  It is up to you how and when to create the markers.  If you want that to be done automatically or semi-automatically, that is possible, but this answer does not address that.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt; has command &lt;strong&gt;&lt;code&gt;icicle-goto-any-marker&lt;/code&gt;&lt;/strong&gt;, bound by default (in Icicle mode) to &lt;code&gt;C-SPC&lt;/code&gt; with a zero prefix arg (e.g. &lt;strong&gt;&lt;code&gt;C-0 C-SPC&lt;/code&gt;&lt;/strong&gt;).  It lets you visit any marker location, local or global.  You can cycle among locations in various orders (including buffer-position order) and in either direction for a given order.  You can visit locations directly, choosing them by the surrounding text (used as completion candidates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default (non-&lt;code&gt;nil&lt;/code&gt; option &lt;strong&gt;&lt;code&gt;icicle-show-multi-completion-flag&lt;/code&gt;&lt;/strong&gt;), completion candidates are two-part &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Multi-Completions&quot; rel=&quot;nofollow noreferrer&quot;&gt;multi-completions&lt;/a&gt;: (1) the buffer name and (2) the text at the marker. You can complete against either or both parts.  If &lt;code&gt;icicle-show-multi-completion-flag&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; then the buffer name is not included.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;icicle-goto-any-marker&lt;/code&gt;&lt;/strong&gt; was not specifically mentioned in the Icicles &lt;a href=&quot;https://stackoverflow.com/a/7132607/729907&quot;&gt;answer&lt;/a&gt; to the question you cite.  The commands described there were for local and global markers separately.  But all of the details provided in that answer apply equally to &lt;strong&gt;&lt;code&gt;icicle-goto-any-marker&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-05-29T23:52:49.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22633" PostTypeId="2" ParentId="22498" CreationDate="2016-05-30T00:54:56.840" Score="1" Body="&lt;p&gt;I have followed the directions at &lt;a href=&quot;http://syamajala.github.io/c-ide.html&quot; rel=&quot;nofollow&quot;&gt;this blog which supplements the C ide stuff by Tudho&lt;/a&gt; to install rtags and irony (as suggested by Dmitry) and it provides the features I asked for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll expand with a summary of steps I had to take to get it all working on a Mac:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install a recent version of the clang compiler with macports (likely optional)&lt;/li&gt;&#xA;&lt;li&gt;Set environment variable CC=clang so that the most basic cmake files will call clang&lt;/li&gt;&#xA;&lt;li&gt;make and install rtags v2.3 from &lt;a href=&quot;https://github.com/Andersbakken/rtags&quot; rel=&quot;nofollow&quot;&gt;rtags the repository&lt;/a&gt;.  Detailed instructions and quick start guide worked but not with Apple XCode's clang (which lacked a link to libclang).  follow instructions at the repository to check it works.  Not clear to me whether you need to install rtags package in emacs from melpa, but I did that too.&lt;/li&gt;&#xA;&lt;li&gt;write a very basic cmake file.  If you are a cmake newbie like me you might have a simple C project with no libraries, with a root directory structured like this:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;~~~~&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% tree . &#xA;└── src&#xA;    ├── bar&#xA;    │   ├── bar.c&#xA;    │   └── bar.h&#xA;    └── foo&#xA;        ├── foo.c&#xA;        └── foo.h&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, perhaps the following cmake file will work for you.  Call it CMakeLists.txt and put it in the top directory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cmake_minimum_required(VERSION 3.5)&#xA;project(myProjectName)&#xA;file(GLOB_RECURSE SRC_FILES src/*.c)&#xA;add_executable(myProjectName ${SRC_FILES})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put build commands for the project in the directory ./build by calling &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cmake -H. -Bbuild&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then export the compile command to a file that rtags will use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cmake build -DCMAKE_EXPORT_COMPILE_COMMANDS=1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And build the project&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cmake --build build&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, to make sure things are working cleanly, clear projects and quit the rdm daemon if it was running with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rc -C&#xA;rc -q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and restart the daemon&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rdm &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and read that .json file you exported from cmake&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rc -J build&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should see output like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% rc -J build                                                                                                                                                         Cprogrammingglanguage/wtf (hcn ⚡) alejandro&#xA;[Server] Compilation database loading...&#xA; % [  3%] 1/35 23:40:23 ~/Google Drive/Work Cloud/... in 211ms. (549 syms, 780 symNames, 28 includes, 17 of 22 files, symbols: 792 of 1445, 1840 cursors, 21 queried 86ms) (37/111/49ms). (priority 0)&#xA;[  6%] 2/35 23:40:24 ~/Google Drive/Work Cloud/.../code/main/src/inrflow/reporting.c in 226ms. (1354 syms, 521 symNames, 15 includes, 6 of 87 files, symbols: 1714 of 4676, 7220 cursors, 5 queried 2ms) (119/61/25ms). (priority 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the following pitfall: can't have spaces in the path to the project.  I worked around this by symlinking to the project folder from a space-less path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Now&lt;/em&gt; you are finally able to start following the rest of the instructions in &lt;a href=&quot;http://syamajala.github.io/c-ide.html&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt; about configuring &lt;code&gt;rtags&lt;/code&gt;, &lt;code&gt;company-rtags&lt;/code&gt;, rtags + helm, &lt;code&gt;irony-mode&lt;/code&gt;, &lt;code&gt;company-irony&lt;/code&gt;, &lt;code&gt;company-irony-c-headers&lt;/code&gt;, and &lt;code&gt;flycheck-rtags&lt;/code&gt;, and &lt;code&gt;cmake-ide&lt;/code&gt;, which mostly follows the documentation for each package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to fumble through these things and would like to help other users, so constructive comments are welcome.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="2065" LastEditDate="2016-05-30T10:12:24.837" LastActivityDate="2016-05-30T10:12:24.837" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22634" PostTypeId="1" AcceptedAnswerId="22635" CreationDate="2016-05-30T01:29:32.900" Score="15" ViewCount="1834" Body="&lt;p&gt;I'm really confused with the &lt;code&gt;.&lt;/code&gt; notation. Is &lt;code&gt;'(a . b)&lt;/code&gt; a list?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(listp '(a . b))&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt; but when I want to know its length &lt;code&gt;(length '(a . b))&lt;/code&gt; gives an error &lt;code&gt;Wrong type argument: listp, b&lt;/code&gt;. The same is for other functions as &lt;code&gt;nth,mapcar&lt;/code&gt; etc. they all give the same error&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any function which can I distinguish between &lt;code&gt;'(a b)&lt;/code&gt; and &lt;code&gt;'(a . b)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Context:&lt;/strong&gt; I encountered this problem when I wanted to implement recursive version of &lt;code&gt;mapcar&lt;/code&gt;. Here is my implementation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun true-listp (object)&#xA;&quot;Return non-`nil' if OBJECT is a true list.&quot;&#xA;(and (listp object)  (null (cdr (last object)))))&#xA;&#xA;(defun recursive-mapcar (func list)&#xA;&quot;Evaluates func on elements of the list, then on elements of elements  of the list and so forth.&quot; &#xA;(let ((output nil))&#xA;(flet ((comp (a b) nil)&#xA;       (call-fun-and-save (x) (add-to-list 'output (funcall func x) t 'comp))&#xA;       (recursion (l)&#xA;                  (mapcar&#xA;                   (lambda (x)&#xA;                     (call-fun-and-save x)&#xA;                     (if (and (true-listp x))  ;; HERE I use true-listp, testing for list or cons is not sufficient&#xA;                         (recursion x)))&#xA;                    l)))&#xA;   (recursion list))&#xA;  output))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use this to extract all specific tags from parsed html. Example of &lt;code&gt;html&lt;/code&gt; to parse&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; buffer 'html'&#xA;&amp;lt;html&amp;gt;&#xA;&amp;lt;body&amp;gt;&#xA;&amp;lt;table style=&quot;width:100%&quot;&amp;gt;&#xA;  &amp;lt;tr&amp;gt;  &amp;lt;td&amp;gt;Jill&amp;lt;/td&amp;gt;  &amp;lt;td&amp;gt;Smith&amp;lt;/td&amp;gt;  &amp;lt;td&amp;gt;50&amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&#xA;  &amp;lt;tr&amp;gt;  &amp;lt;td&amp;gt;Eve&amp;lt;/td&amp;gt;   &amp;lt;td&amp;gt;Jackson&amp;lt;/td&amp;gt;   &amp;lt;td&amp;gt;94&amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&#xA;&amp;lt;/table&amp;gt;&#xA;&amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I extract all &lt;code&gt;&amp;lt;td&amp;gt;&lt;/code&gt; as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (get-buffer &quot;html&quot;)&#xA;  (let ((data (libxml-parse-html-region (point-max) (point-min))))&#xA;&#xA;    ;; gat only &amp;lt;td&amp;gt; tags&#xA;    (-non-nil&#xA;     (recursive-mapcar&#xA;      (lambda(x) (and (consp x) (equal 'td (car x)) x))&#xA;      data))&#xA;    data&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6966" LastEditorUserId="6966" LastEditDate="2016-06-02T06:40:34.187" LastActivityDate="2016-06-02T06:40:34.187" Title="Is '(a . b) really a list?" Tags="|list|association-lists|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22635" PostTypeId="2" ParentId="22634" CreationDate="2016-05-30T01:56:22.177" Score="22" Body="&lt;p&gt;It satisfies &lt;code&gt;listp&lt;/code&gt;, so in that sense it is a list.  &lt;code&gt;listp&lt;/code&gt; just tests whether something is a cons or &lt;strong&gt;&lt;code&gt;nil&lt;/code&gt;&lt;/strong&gt; (aka &lt;strong&gt;&lt;code&gt;()&lt;/code&gt;&lt;/strong&gt;), on the one hand, or something else, on the other hand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;em&gt;proper list&lt;/em&gt; or &lt;em&gt;true list&lt;/em&gt; (or a list that is not a dotted list or a circular list) is something that is &lt;code&gt;listp&lt;/code&gt; and also has &lt;code&gt;nil&lt;/code&gt; as its last cdr.&#xA;That is, a list &lt;code&gt;XS&lt;/code&gt; is &lt;em&gt;proper&lt;/em&gt; if &lt;code&gt;(cdr (last XS))&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; (and that is how you distinguish it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to put this is that &lt;strong&gt;a proper list has a proper list as its cdr&lt;/strong&gt;. This is the way the data type (proper) &lt;strong&gt;List&lt;/strong&gt; is defined in typed languages.  It is a generic and recursive type definition: The generic part says that the first argument to the non-empty list constructor (often called &lt;code&gt;cons&lt;/code&gt;, BTW) can be of any type. The recursive part says that its second argument is an instance of type (proper) &lt;strong&gt;List&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, you check whether a given &lt;code&gt;listp&lt;/code&gt; is a proper list using &lt;code&gt;(cdr (last XS))&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.  In order to check whether the cdr of the critter is itself a proper list, you must continue checking its cdr, down to the end - the last cons, to see whether it is &lt;code&gt;nil&lt;/code&gt;.  You could define a predicate for this as follows, if you wanted to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun true-listp (object)&#xA;  &quot;Return non-`nil' if OBJECT is a true list.&quot;&#xA;  (and (listp object)  (null (cdr (last object)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although a circular list has no end, Emacs (starting with Emacs 24) is smart enough to check &lt;code&gt;last&lt;/code&gt; correctly, so this code works even for a circular list (but only for Emacs 24.1 and later; for earlier versions you get an &quot;infinite&quot; recursion until stack overflow).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use functions such as &lt;code&gt;length&lt;/code&gt; only on proper lists and other sequences. See also function &lt;code&gt;safe-length&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Cons-Cells.html&quot;&gt;Cons Cells&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for notation, &lt;code&gt;(a b)&lt;/code&gt; is just syntactic sugar for &lt;code&gt;(a . (b . nil))&lt;/code&gt; -- see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Dotted-Pair-Notation.html&quot;&gt;Dotted Pair Notation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-05-30T15:16:57.013" LastActivityDate="2016-05-30T15:16:57.013" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22637" PostTypeId="1" CreationDate="2016-05-30T03:10:21.690" Score="1" ViewCount="87" Body="&lt;p&gt;i have a bunch of tags i define via:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:startgroup)&#xA;(&quot;Where?&quot;)&#xA;(:grouptags)&#xA; (&quot;@home&quot; . ?h)&#xA; (&quot;@work&quot; . ?w)&#xA; (&quot;@pc&quot; . ?p)&#xA; (&quot;@family&quot; . ?f)&#xA; (&quot;@shop&quot; . ?s)&#xA; (:endgroup)&#xA; (:startgrouptag)&#xA;(&quot;people&quot;)&#xA;(:grouptags)&#xA;(&quot;allan&quot; . ?a)&#xA;(&quot;bob&quot; . ?o)&#xA;(&quot;joel&quot; . ?j)&#xA;(&quot;david&quot; . ?d)&#xA;(&quot;boris&quot; . ?b)&#xA;(&quot;massimo&quot; . ?s)&#xA;(:endgrouptag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;anyone know of a way to quick add tags via a helm/avy interface?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;right now its quite cumbersome to press C-c then C-c to see a list of all tags. also some tags have the same key (?a) and then its impossible to select the 2nd one&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-05-30T03:10:21.690" Title="orgmode- assign tags via helm/avy?" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22638" PostTypeId="2" ParentId="22617" CreationDate="2016-05-30T06:34:10.987" Score="3" Body="&lt;p&gt;Eshell has not a process-id of its own. It is solely running on the base of emacs-lisp functions within emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, you can start processes from an eshell buffer.&#xA;The eshell buffer becomes the process-buffer for the started processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following eshell session shows what is going on with processes in the eshell buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Welcome to the Emacs shell&#xA;&#xA;~ $ emacs-version &#xA;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&#xA; of 2015-06-23 on desktop-new&#xA;~ $ get-buffer-process (current-buffer)&#xA;~ $ /usr/bin/xterm &amp;amp;&#xA;[xterm&amp;lt;1&amp;gt;] 5168&#xA;~ $ get-buffer-process (current-buffer)&#xA;#&amp;lt;process xterm&amp;lt;1&amp;gt;&amp;gt;&#xA;~ $ /usr/local/bin/xpdf.exe &amp;amp;&#xA;[xpdf.exe] 6464&#xA;~ $ get-buffer-process (current-buffer)&#xA;#&amp;lt;process xpdf.exe&amp;gt;&#xA;~ $ process-buffer (get-process &quot;xpdf.exe&quot;)&#xA;#&amp;lt;buffer *eshell*&amp;gt;&#xA;~ $ process-buffer (get-process &quot;xterm&amp;lt;1&amp;gt;&quot;)&#xA;#&amp;lt;buffer *eshell*&amp;gt;&#xA;~ $ remove-if-not #'(lambda (proc) (equal (process-buffer proc) (current-buffer))) (process-list)&#xA;(#&amp;lt;process xpdf.exe&amp;gt; #&amp;lt;process xterm&amp;lt;1&amp;gt;&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, that I have deleted some lines that may only cause confusion (e.g., font messages for the started processes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Side note&lt;/em&gt;: It is rather interesting that both started background processes have the same eshell buffer as process buffer, i.e., the process of a process buffer is &lt;strong&gt;not unique&lt;/strong&gt;. It looks like &lt;code&gt;get-buffer-process&lt;/code&gt; gets only the &lt;strong&gt;last&lt;/strong&gt; started process for the buffer.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-05-30T06:51:29.597" LastActivityDate="2016-05-30T06:51:29.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22639" PostTypeId="1" AcceptedAnswerId="22641" CreationDate="2016-05-30T08:44:32.723" Score="3" ViewCount="387" Body="&lt;p&gt;Let's say I'd like to know how many .png images I have in a folder. In shell I'd run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls -1 | grep .png | wc -l&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to achieve this in emacs (preferably not just reading in from a shell output)?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="105" LastEditDate="2016-05-30T15:23:10.560" LastActivityDate="2018-02-09T08:35:04.600" Title="Count number of files with specific extension on a folder?" Tags="|files|directories|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22640" PostTypeId="1" AcceptedAnswerId="22645" CreationDate="2016-05-30T09:06:12.760" Score="7" ViewCount="1702" Body="&lt;p&gt;I'm using default javascript mode and the switch..case look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    switch (component) {&#xA;    case 'action-message':&#xA;        result = actionMessage(response);&#xA;        break;&#xA;&#xA;    case 'action-confirmation':&#xA;        result = actionConfirmation(response);&#xA;        break;&#xA;&#xA;    case 'action-error':&#xA;        result = actionError(response);&#xA;        break;&#xA;&#xA;    case 'field-error':&#xA;        result = fieldError(response);&#xA;        break;&#xA;&#xA;    default:&#xA;        result = undefined;&#xA;        break;&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make it look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    switch (component) {&#xA;        case 'action-message':&#xA;            result = actionMessage(response);&#xA;            break;&#xA;&#xA;        case 'action-confirmation':&#xA;            result = actionConfirmation(response);&#xA;            break;&#xA;&#xA;        case 'action-error':&#xA;            result = actionError(response);&#xA;            break;&#xA;&#xA;        case 'field-error':&#xA;            result = fieldError(response);&#xA;            break;&#xA;&#xA;        default:&#xA;            result = undefined;&#xA;            break;&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10438" LastActivityDate="2016-07-29T14:33:29.087" Title="How to indent 4 spaces for case in switch in javascript mode" Tags="|javascript|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22641" PostTypeId="2" ParentId="22639" CreationDate="2016-05-30T09:09:15.587" Score="7" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(length (directory-files &quot;~/Pictures&quot; nil &quot;\\.png\\'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;directory-files&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-05-30T09:09:15.587" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22642" PostTypeId="1" AcceptedAnswerId="22643" CreationDate="2016-05-30T12:15:54.757" Score="1" ViewCount="84" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9Pua9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9Pua9.png&quot; alt=&quot;package-menu&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to get rid of these extra spaces that is in the left.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried the following after reading a bit on propertize:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-local header-line-format&#xA;            (propertize header-line-format 'display '((space :align-to 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-05-31T12:36:59.027" Title="What causes these extra spaces in front of the package menu header?" Tags="|package|header-line|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22643" PostTypeId="2" ParentId="22642" CreationDate="2016-05-30T14:24:53.403" Score="2" Body="&lt;p&gt;The 2-space padding is hard implemented as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq tabulated-list-padding 2)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;package-menu-mode&lt;/code&gt;.&#xA;The documentation string of &lt;code&gt;tabulated-list-padding&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Number of characters preceding each Tabulated List mode entry.&#xA;  By default, lines are padded with spaces, but you can use the&#xA;  function `tabulated-list-put-tag' to change this.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The end of &lt;code&gt;package-menu-mode&lt;/code&gt; reads:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  ...&#xA;  (setq tabulated-list-padding 2)&#xA;  (setq tabulated-list-sort-key (cons &quot;Status&quot; nil))&#xA;  (add-hook 'tabulated-list-revert-hook 'package-menu--refresh nil t)&#xA;  (tabulated-list-init-header))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is no customization option and no hook to change &lt;code&gt;tabulated-list-padding&lt;/code&gt; between the &lt;code&gt;(setq tabulated-list-padding 2)&lt;/code&gt; and &lt;code&gt;(tabulated-list-init-header)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes the modification of &lt;code&gt;tabulated-list-padding&lt;/code&gt; in &lt;code&gt;package-menu-mode&lt;/code&gt; a bit hard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/22642/what-causes-these-extra-spaces-in-front-of-the-package-menu-header/22643?noredirect=1#comment35199_22642&quot;&gt;Phils comment&lt;/a&gt; points out that customization of the padding makes little sense since those two one-character columns are used for marking packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to modify it and you do not like to overwrite &lt;code&gt;package-menu-mode&lt;/code&gt; completely you need the following advices:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun package-menu-header-advice (&amp;amp;rest args)&#xA;  (setq tabulated-list-padding 0))&#xA;&#xA;(defun package-header-avoid-padding (old-function &amp;amp;rest args)&#xA;  &quot;Avoid padding in `package-menu-mode'.&quot;&#xA;  (unwind-protect&#xA;      (progn&#xA;    (advice-add 'tabulated-list-init-header :before #'package-menu-header-advice)&#xA;    (apply old-function args))&#xA;    (advice-remove 'tabulated-list-init-header #'package-menu-header-advice)))&#xA;&#xA;(advice-add 'package-menu-mode :around #'package-header-avoid-padding)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-05-31T12:36:59.027" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22645" PostTypeId="2" ParentId="22640" CreationDate="2016-05-30T15:20:34.597" Score="13" Body="&lt;p&gt;You can set the variable &lt;code&gt;js-switch-indent-offset&lt;/code&gt; to 4.&lt;/p&gt;&#xA;" OwnerUserId="10479" LastActivityDate="2016-05-30T15:20:34.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22647" PostTypeId="1" AcceptedAnswerId="22652" CreationDate="2016-05-30T17:28:01.560" Score="1" ViewCount="79" Body="&lt;p&gt;I have this function that reload a file but it don't work when I have same buffer opened in 2 different windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun reload ()&#xA;  &quot;Reload a file&#xA;&#xA;it will kill buffer, open file again and jump to position where cursor when called&quot;&#xA;  (interactive)&#xA;  (let ((filename buffer-file-name)&#xA;        (postion (point)))&#xA;    (if filename&#xA;        (progn&#xA;          (kill-buffer)&#xA;          (find-file filename)&#xA;          (goto-char postion)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="105" LastEditDate="2017-05-16T22:36:16.177" LastActivityDate="2017-05-16T22:36:16.177" Title="Reload single file in every window" Tags="|buffers|files|kill-buffer|revert-buffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22648" PostTypeId="2" ParentId="22622" CreationDate="2016-05-30T17:34:57.240" Score="5" Body="&lt;p&gt;The patches (referred to below) were created by @lawlist from select portions of the Aquamacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/davidswelt/aquamacs-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/davidswelt/aquamacs-emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To enable native spellchecking on OSX in the vanilla/generic version of Emacs, it is necessary to patch the C-source-code prior building, and a few lisp files also need to be modified.  The patch is too big to post in an answer on stackexchange.com.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following procedure assumes the necessary tools have already been installed on OSX to build and patch, etc. -- e.g., git, recent versions of &lt;code&gt;automake&lt;/code&gt; and &lt;code&gt;autoconf&lt;/code&gt;, xcode, etc.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EMACS-25 BRANCH -- NOVEMBER 1, 2016&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following patch and &lt;em&gt;minimal&lt;/em&gt; testing was performed on the &lt;strong&gt;emacs-25 branch&lt;/strong&gt; built &lt;code&gt;--with-ns&lt;/code&gt; as of commit dated November 1, 2016:  &lt;code&gt;5043e0a7e06dbf6507a59736e55bdde69d9a2a4e&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;git clone -b emacs-25 git://git.sv.gnu.org/emacs.git&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visit:  &lt;a href=&quot;https://gist.github.com/lawlist/dfc75240cc06c66f19f48eaa3e570d7c&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/lawlist/dfc75240cc06c66f19f48eaa3e570d7c&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Click the &quot;&lt;strong&gt;Download ZIP&lt;/strong&gt;&quot; button, and save the zipped patch file somewhere on your computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extract the &lt;strong&gt;ZIP&lt;/strong&gt; archive you just downloaded and save &lt;code&gt;nsspellchecker_emacs25.diff&lt;/code&gt; to the &lt;code&gt;.../emacs&lt;/code&gt; root source-code directory that was cloned in the first step above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, &lt;code&gt;cd&lt;/code&gt; over to the root &lt;code&gt;.../emacs&lt;/code&gt; source-code directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; The patch may become outdated, so this example includes a hard reset to go back to November 1, 2016.  [Certain bug fixes are still being made to Emacs 25 by the development team, which may cause the patch to become outdated.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;git reset --hard 5043e0a7e06dbf6507a59736e55bdde69d9a2a4e&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; After performing a hard reset successfully, the message in the terminal will say:  &quot;&lt;strong&gt;HEAD is now at 5043e0a Fix documentation for 'eudc-options-file'&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;git apply nsspellchecker_emacs25.diff&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;./autogen.sh&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;./configure --with-ns&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;make&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;make install&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; With Finder.app, navigate over to &lt;code&gt;.../emacs/nextstep&lt;/code&gt; and try out your new Emacs.app&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; Open your new Emacs.app and type &lt;code&gt;M-x eval-expression RET (require 'flyspell) RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; In a &lt;code&gt;*scratch*&lt;/code&gt; buffer, type something spelled correctly and something spelled wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; Type:  &lt;code&gt;M-x ns-start-spellchecker&lt;/code&gt; or &lt;code&gt;M-x ispell-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; Play a little with the pop-up spellchecker and have fun.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; Custom words are saved to:  &lt;code&gt;~/Library/Spelling/LocalDictionary&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Previous answer that applies to the &lt;code&gt;master&lt;/code&gt; branch as of May 29, 2016&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following patch and &lt;em&gt;minimal&lt;/em&gt; testing was performed on &lt;strong&gt;master branch&lt;/strong&gt; built &lt;code&gt;--with-ns&lt;/code&gt; as of commit dated May 29, 2016:  &lt;code&gt;76fb19b359dec8556dc66dbac3ad3d333feea3c3&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;git clone -b master git://git.sv.gnu.org/emacs.git&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visit:  &lt;a href=&quot;https://gist.github.com/lawlist/6a9b281870fcc114ad3c6c1dca121f95&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/lawlist/6a9b281870fcc114ad3c6c1dca121f95&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Click the &quot;&lt;strong&gt;Download ZIP&lt;/strong&gt;&quot; button, and save the zipped patch file somewhere on your computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extract the &lt;strong&gt;ZIP&lt;/strong&gt; archive you just downloaded and save &lt;code&gt;nsspellchecker.diff&lt;/code&gt; to the &lt;code&gt;.../emacs&lt;/code&gt; root source-code directory that was cloned in the first step above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, &lt;code&gt;cd&lt;/code&gt; over to the root &lt;code&gt;.../emacs&lt;/code&gt; source-code directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; The patch will soon become outdated, so this example includes a hard reset to go back to May 29, 2016.  [I will not be updating/maintaining the patch as Emacs &lt;strong&gt;master branch&lt;/strong&gt; changes several times each day.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;git reset --hard 76fb19b359dec8556dc66dbac3ad3d333feea3c3&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;; After performing a hard reset successfully, the message in the terminal will say:  &quot;&lt;strong&gt;HEAD is now at 76fb19b * lisp/wid-edit.el (link): Remove :follow-link property (bug#22434)&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a terminal, type:  &lt;code&gt;git apply nsspellchecker.diff&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-04T04:13:39.030" LastActivityDate="2016-11-04T04:13:39.030" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22649" PostTypeId="2" ParentId="22647" CreationDate="2016-05-30T17:38:56.010" Score="0" Body="&lt;p&gt;I came up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun reload ()&#xA;  &quot;Reload a file&#xA;&#xA;it will kill buffer, open file again and jump to position where cursor when called&quot;&#xA;  (interactive)&#xA;  (let* ((filename buffer-file-name)&#xA;        (name (buffer-name))&#xA;        (postion (point))&#xA;        (windows (remove-if-not (lambda (window)&#xA;                                  (equal name (buffer-name (window-buffer window))))&#xA;                                (get-buffer-window-list))))&#xA;    (if filename&#xA;        (progn&#xA;          (kill-buffer)&#xA;          (find-file filename)&#xA;          (goto-char postion)&#xA;          (let ((buffer (get-buffer (buffer-name))))&#xA;            (save-current-buffer&#xA;              (dolist (window windows)&#xA;                (set-window-buffer window buffer)&#xA;                (set-buffer (window-buffer window)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10438" LastActivityDate="2016-05-30T17:38:56.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22650" PostTypeId="1" CreationDate="2016-05-30T18:01:29.857" Score="6" ViewCount="129" Body="&lt;p&gt;There is a function &lt;code&gt;org-emphasize&lt;/code&gt;, which wraps selected text in &lt;code&gt;org-emphasis&lt;/code&gt; markers. (Though I personally use a similar function called &lt;a href=&quot;https://github.com/rejeep/wrap-region.el&quot; rel=&quot;noreferrer&quot;&gt;wrap-region&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a function &lt;code&gt;org-deemphasize&lt;/code&gt; (or analogously, &lt;code&gt;unwrap-string-at-point&lt;/code&gt;) that will remove &lt;code&gt;org-emphasis&lt;/code&gt; markers before and after point? (Without my having to manually select the exact region?) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should refer to &lt;code&gt;org-emphasis-alist&lt;/code&gt; For example, my customized org-emphasis alist looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;*&quot; bold)&#xA;(&quot;/&quot; italic)&#xA;(&quot;_&quot; underline)&#xA;(&quot;=&quot; org-code verbatim)&#xA;(&quot;~&quot; flyspell-incorrect)&#xA;(&quot;+&quot;&#xA;(:strike-through t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2017-11-07T05:07:55.917" Title="how to automatically remove org-emphasis markers, i.e. org-deemphasize?" Tags="|org-emphasis|wrap-region|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22651" PostTypeId="1" CreationDate="2016-05-30T18:26:57.743" Score="0" ViewCount="1182" Body="&lt;p&gt;I'm trying to change the &lt;code&gt;mode-line&lt;/code&gt; face &lt;code&gt;box&lt;/code&gt; attribute to be the same color as the evil emacs state face, obviously updating it each time the mode changes. I've seen some things about using a post-command-hook, but frankly am not sure how to do so. I'm using spaceline, so hopefully there would be a way to get the current evil state face as well, or else it would get even messier. I'm not sure if such a thing is even possible.&lt;/p&gt;&#xA;" OwnerUserId="12218" LastActivityDate="2020-08-09T03:04:55.497" Title="Changing mode-line face when evil state changes" Tags="|evil|hooks|spacemacs|faces|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22652" PostTypeId="2" ParentId="22647" CreationDate="2016-05-30T18:31:56.427" Score="1" Body="&lt;p&gt;It's not very clear to me just what you are looking for.  I get the impression that you just want to revert the buffer and then restore the position from before reverting.  If so, that's this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun revert+restore-pos ()&#xA;  &quot;Revert buffer, then restore previous position.&quot;&#xA;  (interactive)&#xA;  (let ((pt  (point)))&#xA;    (revert-buffer t t)&#xA;    (goto-char pt)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That also restores the &lt;code&gt;window-point&lt;/code&gt; to where it was in each window showing the buffer.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-05-30T18:31:56.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22653" PostTypeId="1" AcceptedAnswerId="22654" CreationDate="2016-05-30T19:11:39.530" Score="3" ViewCount="266" Body="&lt;p&gt;I've been using &lt;a href=&quot;http://github.com/kyagi/shell-pop-el&quot; rel=&quot;nofollow&quot;&gt;shell-pop&lt;/a&gt; recently, and it's nice how I can pop to default-directory in term immediately. For the times I'd rather use a dedicated terminal, is it possible to create an equivalent for OSX's Terminal.app? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want is to call one function in emacs and launch Terminal.app cd'd automatically to default-directory.&lt;/p&gt;&#xA;" OwnerUserId="2207" LastActivityDate="2017-07-16T17:52:37.910" Title="How to launch terminal.app from elisp" Tags="|osx|shell|term|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22654" PostTypeId="2" ParentId="22653" CreationDate="2016-05-30T19:25:15.233" Score="4" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-applescript-fn ()&#xA;&quot;Open the Terminal.app, wait a second, and CD to the Emacs default-directory&#xA;of current buffer.&quot;&#xA;(interactive)&#xA;(do-applescript&#xA;  (format&#xA;    &quot;tell application \&quot;Terminal\&quot;&#xA;    activate&#xA;    delay 1&#xA;    try&#xA;    do script with command \&quot;cd %s\&quot; in window 1&#xA;    on error&#xA;    beep&#xA;    end try&#xA;    end tell&quot; default-directory)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-05-30T19:25:15.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22655" PostTypeId="2" ParentId="22651" CreationDate="2016-05-30T19:51:53.853" Score="1" Body="&lt;p&gt;This is how Spaceline chooses the faces in the modeline:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/TheBB/spaceline#other-faces&quot; rel=&quot;nofollow&quot;&gt;https://github.com/TheBB/spaceline#other-faces&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the preceding section about the highlight face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can override the default with an arbitrary function of your choice, so there's no limit to creativity. It sounds like you want to make one new face for each of the four basic faces and for each of the evil states, set the box attribute (and other attributes) according to how you make them, and write a function that picks from these faces according to however you'd like to do it. You can get the evil state from &lt;code&gt;evil-state&lt;/code&gt; variable, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;a href=&quot;https://github.com/TheBB/spaceline/blob/master/spaceline.el#L124-L139&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; is how Spaceline defines the highlight faces for each evil state. I would link you to the function where Spaceline chooses which one to use, too, but Stackexchange won't let me post more than two links, so you're going to have to find that one on your own (it's a few lines further down).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here is a function that chooses based on active and evil state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-face-func (face active)&#xA;  (let ((act (if active &quot;active&quot; &quot;inactive&quot;)))&#xA;    (intern (format &quot;my-face-%s-%s-%s&quot; face act evil-state))))&#xA;&#xA;(setq spaceline-face-func 'my-face-func)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then all you need is to define all the faces &lt;code&gt;my-face-X-Y-Z&lt;/code&gt; where &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;X&lt;/code&gt; is one of &lt;code&gt;face1&lt;/code&gt;, &lt;code&gt;face2&lt;/code&gt;, &lt;code&gt;line&lt;/code&gt; and &lt;code&gt;highlight&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Y&lt;/code&gt; is one of &lt;code&gt;active&lt;/code&gt; and &lt;code&gt;inactive&lt;/code&gt;; and&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Z&lt;/code&gt; is one of &lt;code&gt;normal&lt;/code&gt;, &lt;code&gt;insert&lt;/code&gt;, &lt;code&gt;visual&lt;/code&gt;, and so on.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Of course that's a lot of faces, which is partially why the default implementation of that face function picks from a more limited set.&lt;/p&gt;&#xA;" OwnerUserId="12220" LastEditorUserId="12220" LastEditDate="2016-05-30T19:58:48.840" LastActivityDate="2016-05-30T19:58:48.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22656" PostTypeId="1" AcceptedAnswerId="22732" CreationDate="2016-05-30T21:29:51.107" Score="3" ViewCount="1137" Body="&lt;p&gt;I have Installed from Melpa ob-ipython on Ubuntu Xenial with Emacs 24. If I try to evaluate a source code like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ipython :session&#xA;%matplotlib inline&#xA;importmatplotlib.pyplot as plt&#xA;inport numpy as np&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No org-babel-execute function for ipython&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What can I do to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="7199" LastActivityDate="2016-06-03T10:16:39.730" Title="ob-ipython error" Tags="|org-mode|ipython|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22657" PostTypeId="1" AcceptedAnswerId="22725" CreationDate="2016-05-30T22:03:02.833" Score="6" ViewCount="722" Body="&lt;p&gt;My AUCTeX setup isn't loading any local per-package auto-generated style files.  Suppose I have a simple package &lt;code&gt;doc-preamble.sty&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;% doc-preamble.sty&#xA;\usepackage{cleveref}&#xA;\newcommand*{\mycmd}[1]{Hello, #1!}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I use that in &lt;code&gt;doc-main.tex&lt;/code&gt; (in the same directory):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;% doc-main.tex&#xA;\documentclass{article}&#xA;&#xA;\usepackage{doc-preamble}&#xA;&#xA;\usepackage{url}&#xA;\newcommand*{\myothercmd}[1]{Goodbye, #1!}&#xA;&#xA;\begin{document}&#xA;&#xA;This is a test.&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, when working in &lt;code&gt;doc-main.tex&lt;/code&gt;, the configuration for &lt;code&gt;doc-preamble.sty&lt;/code&gt; isn't loaded.  In this case, that means that &lt;code&gt;\cref&lt;/code&gt; (from &lt;code&gt;cleveref&lt;/code&gt;) and &lt;code&gt;\mycmd&lt;/code&gt; don't show up as autocomplete results for &lt;code&gt;TeX-insert-macro&lt;/code&gt; (&lt;kbd&gt;C-c C-m&lt;/kbd&gt;), the &lt;code&gt;\cref&lt;/code&gt; reference style isn't available to RefTeX, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The configuration for &lt;code&gt;doc-main.tex&lt;/code&gt;, on the other hand, &lt;em&gt;is&lt;/em&gt; available, so configuration in general works: commands like &lt;code&gt;\url&lt;/code&gt;, as well as &lt;code&gt;\myothercmd&lt;/code&gt;, are both available from &lt;code&gt;TeX-insert-macro&lt;/code&gt; (&lt;kbd&gt;C-c C-m&lt;/kbd&gt;), and &lt;code&gt;\url&lt;/code&gt; is correctly formatted as a verbatim command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of &lt;code&gt;TeX-active-styles&lt;/code&gt; in &lt;code&gt;doc-main.tex&lt;/code&gt; is, strangely,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;url&quot; &quot;doc-preamble&quot; &quot;art10&quot; &quot;article&quot; &quot;latex2e&quot; &quot;doc-main&quot; &quot;LATEX&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So AUCTeX knows that &lt;code&gt;doc-preamble&lt;/code&gt; is being used, but not what to do when using it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relatedly, the AUCTeX &lt;code&gt;.el&lt;/code&gt; files &lt;em&gt;are&lt;/em&gt; being generated, so that's not the issue. They even look right:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; doc-preamble.el&#xA;(TeX-add-style-hook&#xA; &quot;doc-preamble&quot;&#xA; (lambda ()&#xA;   (TeX-run-style-hooks&#xA;    &quot;cleveref&quot;)&#xA;   (TeX-add-symbols&#xA;    '(&quot;mycmd&quot; 1)))&#xA; :latex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; doc-main.el&#xA;(TeX-add-style-hook&#xA; &quot;doc-main&quot;&#xA; (lambda ()&#xA;   (add-to-list 'LaTeX-verbatim-macros-with-braces-local &quot;url&quot;)&#xA;   (add-to-list 'LaTeX-verbatim-macros-with-braces-local &quot;path&quot;)&#xA;   (add-to-list 'LaTeX-verbatim-macros-with-delims-local &quot;url&quot;)&#xA;   (add-to-list 'LaTeX-verbatim-macros-with-delims-local &quot;path&quot;)&#xA;   (TeX-run-style-hooks&#xA;    &quot;latex2e&quot;&#xA;    &quot;article&quot;&#xA;    &quot;art10&quot;&#xA;    &quot;doc-preamble&quot;&#xA;    &quot;url&quot;)&#xA;   (TeX-add-symbols&#xA;    '(&quot;myothercmd&quot; 1)))&#xA; :latex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;doc-preamble.el&lt;/code&gt; file simply isn't being loaded as far as I can tell.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/users/620/giordano&quot;&gt;giordano&lt;/a&gt;, I was able to find a possible reason for this behavior.  (This reason is still a symptom of whatever the underlying problem is.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My AUCTeX configuration includes the line &lt;code&gt;(setq TeX-auto-local &quot;.auctex-auto&quot;)&lt;/code&gt;.  And while this variable retains its value, when I query &lt;code&gt;TeX-style-path&lt;/code&gt; with &lt;kbd&gt;C-h C-v&lt;/kbd&gt;, I get (reformatted)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TeX-style-path is a variable defined in `tex.el'.&#xA;Its value is&#xA;(&quot;/usr/local/var/auctex&quot; &quot;/Users/antal/.emacs.d/elpa/auctex-11.89.4/style&quot;&#xA; &quot;/Users/antal/.emacs.d/auctex/auto&quot; &quot;/Users/antal/.emacs.d/auctex/style&quot;&#xA; &quot;auto&quot; &quot;style&quot;)&#xA;&#xA;Original value was &#xA;(&quot;/usr/local/var/auctex&quot; &quot;/Users/antal/.emacs.d/elpa/auctex-11.89.4/style&quot;&#xA; &quot;/Users/antal/.emacs.d/auctex/auto&quot; &quot;/Users/antal/.emacs.d/auctex/style&quot;&#xA; &quot;.auctex-auto&quot; &quot;style&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that, somehow, my setting for &lt;code&gt;TeX-auto-local&lt;/code&gt; (which correctly has the value &lt;code&gt;&quot;.auctex-auto&quot;&lt;/code&gt;) is being overwritten in &lt;code&gt;TeX-style-path&lt;/code&gt;: the new value uses &lt;code&gt;&quot;auto&quot;&lt;/code&gt; where the original used &lt;code&gt;&quot;.auctex-auto&quot;&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, &lt;code&gt;TeX-auto-local&lt;/code&gt; is being overridden, but &lt;em&gt;not&lt;/em&gt; changed!  This pushes the question back to &quot;why is this happening&quot;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm using AUCTeX 11.89.4.  I'm not sure if I'm doing something wrong, if I've got a bug in my configuration, or what, so I'm not sure which parts of my configuration are important, but here are some potentially relevant pieces of my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'tex)&#xA;(require 'latex)&#xA;(require 'reftex)&#xA;&#xA;(setq TeX-auto-save  t&#xA;      TeX-parse-self t)&#xA;&#xA;(add-hook 'LaTeX-mode-hook #'reftex-mode)&#xA;(setq reftex-plug-into-AUCTeX '(nil t t t t))&#xA;&#xA;(setq TeX-auto-local &quot;.auctex-auto&quot;)&#xA;&#xA;(TeX-global-PDF-mode t)&#xA;&#xA;(add-hook 'LaTeX-mode-hook #'auto-fill-mode)&#xA;(add-hook 'LaTeX-mode-hook #'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's also some custom advice that I don't think is relevant, but I've included the &lt;code&gt;advice-add&lt;/code&gt; calls below in case one of those functions is dangerous to advise (the definitions of the advice functions are available if necessary):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(advice-add #'LaTeX-indent-calculate-last&#xA;            :around #'LaTeX-indent-calculate-last--outdent-label)&#xA;(advice-add #'TeX-command-sequence-sentinel&#xA;            :after #'TeX-sentinel-manage-error-buffer)&#xA;(advice-add #'reftex-reference&#xA;            :around #'reftex-reference-negatable-prompt&#xA;            '((depth . -50)))&#xA;(advice-add #'reftex-format-special&#xA;            :filter-return #'reftex-format-special-handle-cleveref)&#xA;(advice-add #'reftex-ref-style-list&#xA;            :filter-return #'reftex-ref-style-list-maybe-preferentially)&#xA;(advice-add #'reftex-reference&#xA;            :around #'reftex-reference-no-promt-preferentially)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5295" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2018-07-27T13:14:15.813" Title="AUCTeX isn't loading local per-package style files, is ignoring `TeX-auto-local`" Tags="|auctex|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22658" PostTypeId="2" ParentId="22621" CreationDate="2016-05-30T23:17:51.410" Score="1" Body="&lt;p&gt;It seems @Drew already answered in the comments of the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key isearch-mode-map (kbd &quot;C-x&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;He deserves the merit.&#xA;I just copy the solution here for better reading ;-)&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-05-30T23:17:51.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22659" PostTypeId="1" CreationDate="2016-05-31T00:16:19.310" Score="3" ViewCount="2243" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Manishearth/rust-clippy&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;rust-clippy&lt;/code&gt;&lt;/a&gt; is a linter for Rust. Is there an existing package or idiom that integrates it into an Emacs Rust workflow, the way &lt;code&gt;emacs-racer&lt;/code&gt; integrates &lt;code&gt;racer&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2021-02-09T20:11:10.823" Title="Integrate rust-clippy into Emacs Rust development" Tags="|rust|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22660" PostTypeId="2" ParentId="22656" CreationDate="2016-05-31T01:09:56.450" Score="2" Body="&lt;p&gt;You need to update &lt;code&gt;org-babel-load-languages&lt;/code&gt;. Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages 'org-babel-load-languages &#xA;                             '((emacs-lisp . t)&#xA;                               (ipython . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is described in the &lt;a href=&quot;http://orgmode.org/org.html#Languages&quot; rel=&quot;nofollow&quot;&gt;Org Manual&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9605" LastActivityDate="2016-05-31T01:09:56.450" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22662" PostTypeId="1" CreationDate="2016-05-31T03:01:35.440" Score="2" ViewCount="139" Body="&lt;p&gt;As an example say, I run &lt;code&gt;M-x org-drill&lt;/code&gt; on the spanish.org and mark all of them as 5 for how well I did. All of the drills are rescheduled for 5 days. If I try to run org-drill again I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I did not find any pending drill items.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and none of the tests will run again. I get that message running &lt;code&gt;org-drill-cram&lt;/code&gt; as well. How would I run all the tests regardless of how well I did. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related question but regarding the philosophy for org-drill, am I suppose to remind myself to check back to the org file on the scheduled date? Or will org-drill prompt me to retest on the scheduled date. (Looking to get some input on other people's workflows with org-drill if possible)&lt;/p&gt;&#xA;" OwnerUserId="11700" LastActivityDate="2016-05-31T03:01:35.440" Title="Org-drill How can you retest yourself on completed / rescheduled drills?" Tags="|org-mode|org-drill|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22663" PostTypeId="1" CreationDate="2016-05-31T03:44:42.617" Score="0" ViewCount="1534" Body="&lt;p&gt;I've used the toggle-transparency function from &lt;a href=&quot;https://www.emacswiki.org/emacs/TransparentEmacs&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/TransparentEmacs&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (eval-when-compile (require 'cl))&#xA; (defun toggle-transparency ()&#xA;   (interactive)&#xA;   (if (/=&#xA;        (cadr (frame-parameter nil 'alpha))&#xA;        100)&#xA;       (set-frame-parameter nil 'alpha '(100 100))&#xA;     (set-frame-parameter nil 'alpha '(85 50))))&#xA; (global-set-key (kbd &quot;C-c t&quot;) 'toggle-transparency)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but although this makes the transparency less, it does not completely remove transparency for me (for some reason). I'm on Ubuntu 14.04.&lt;/p&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="105" LastEditDate="2016-05-31T15:35:41.327" LastActivityDate="2016-05-31T16:24:37.757" Title="How can transparency be toggled?" Tags="|frames|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22664" PostTypeId="1" CreationDate="2016-05-31T04:16:57.353" Score="2" ViewCount="269" Body="&lt;p&gt;Does there exist anything like awesomewm window configurations in emacs? For example, having custom layouts for two windows, maybe 1, 2, and 3, the first being even vertical split, the second even horizontal split, and the third being something like 1/3-2/3 vertical split. And so on for three windows and above. I've looked but have yet to find anything having this functionality.&lt;/p&gt;&#xA;" OwnerUserId="12218" LastEditorUserId="454" LastEditDate="2016-05-31T05:00:05.067" LastActivityDate="2016-05-31T05:00:05.067" Title="Emacs window configuration like awesome wm" Tags="|window|window-splitting|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22665" PostTypeId="1" AcceptedAnswerId="22667" CreationDate="2016-05-31T11:23:18.920" Score="6" ViewCount="1818" Body="&lt;p&gt;Until very recently, I've been able to build emacs from source in a docker container using &lt;a href=&quot;https://github.com/ensime/ensime-docker/blob/v1.x/Dockerfile&quot; rel=&quot;noreferrer&quot;&gt;this recipe&lt;/a&gt;. However as of last week, all my builds have been failing with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning: Your system has a gap between BSS and the&#xA;heap (32188607 bytes).  This usually means that exec-shield&#xA;or something similar is in effect.  The dump may&#xA;fail because of this.  See the section about&#xA;exec-shield in etc/PROBLEMS for more information.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've read the &lt;code&gt;etc/PROBLEMS&lt;/code&gt; and it doesn't make any sense to me. Does anybody know how to interpret this for a docker container and what I can do to get emacs building again on &lt;code&gt;hub.docker.com&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat 0 &amp;gt; /proc/sys/kernel/exec-shield&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I don't think that is really the problem, it doesn't exist in the container.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;cross-posted to &lt;a href=&quot;https://stackoverflow.com/questions/37544423&quot;&gt;https://stackoverflow.com/questions/37544423&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;upstream bug report &lt;a href=&quot;https://github.com/docker/docker/issues/22801&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/docker/docker/issues/22801&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2018-04-09T15:34:21.587" Title="building emacs in a docker container" Tags="|build|docker|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22666" PostTypeId="1" AcceptedAnswerId="22714" CreationDate="2016-05-31T12:03:47.693" Score="0" ViewCount="1597" Body="&lt;p&gt;I need to indent my code with &lt;code&gt;(add-hook 'php-mode-hook 'php-enable-symfony2-coding-style)&lt;/code&gt; but using tabs for indenting (and spaces for aligning, see &lt;a href=&quot;https://www.emacswiki.org/emacs/SmartTabs&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/SmartTabs&lt;/a&gt;). Apparently the coding styles of php-mode overrides emacs tab settings, because I have the next code in my emacs init file, but the spacebar indenting prevails nonetheless:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tab-always-indent 'complete)&#xA;(setq-default indent-tabs-mode t)&#xA;(setq indent-tabs-mode t)&#xA;(setq tab-width 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tabs were working before using php-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of the indentation I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// Indenting with tabs&#xA;if (false&#xA;    || true&#xA;    || true&#xA;) {&#xA;    $hi = [&#xA;        'la',&#xA;        'do' =&amp;gt; 5,&#xA;    ];&#xA;&#xA;    $foo&#xA;        -&amp;gt; mi(&#xA;            54,&#xA;            57&#xA;        )&#xA;&#xA;        -&amp;gt; fa()&#xA;    ;&#xA;} else {&#xA;    $lala =&#xA;        (new lala)&#xA;            -&amp;gt; hey()&#xA;            -&amp;gt; ho()&#xA;    ;&#xA;&#xA;    $sup = work([&#xA;        'it' =&amp;gt; 1,&#xA;        'faster' =&amp;gt; 6,&#xA;    ]);&#xA;&#xA;    // Aligning with spaces&#xA;    $a··· = 1;&#xA;    $ab·· = 2;&#xA;    $abcd = 4;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;(add-hook 'php-mode-hook 'php-enable-symfony2-coding-style)&lt;/code&gt; because it is the most similar amongst the php-mode available styles. Maybe I should turn off php-mode indentation and use other indentation?&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2016-06-01T22:08:09.253" LastActivityDate="2016-06-02T01:41:19.787" Title="How to indent with tabs in php-mode?" Tags="|indentation|tabs|php-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22667" PostTypeId="2" ParentId="22665" CreationDate="2016-05-31T13:09:43.273" Score="6" Body="&lt;p&gt;This question is also being answered here (since you already found my github bug report):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23529&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23529&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the moment, and likely it will be this way until the emacs build system changes, the only valid solutions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Don't build with a Dockerfile and build in a running container that has a seccomp profile that allows the personality syscall. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;docker run --rm -it --security-opt seccomp=unconfined emacs-builder-image&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Disable /proc/sys/kernel/randomize_va_space before building:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;echo 0 &amp;gt; /proc/sys/kernel/randomize_va_space; docker build .&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I maintain docker images at &lt;a href=&quot;https://hub.docker.com/r/silex/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://hub.docker.com/r/silex/emacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="790" LastEditorUserId="790" LastEditDate="2018-04-09T15:34:21.587" LastActivityDate="2018-04-09T15:34:21.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22668" PostTypeId="2" ParentId="22663" CreationDate="2016-05-31T13:38:16.607" Score="1" Body="&lt;p&gt;I do not know whether the following does resolve your problem. Your code has some flaws. Maybe, these cause the dysfunction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last sentence of the following section of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Font-and-Color-Parameters.html&quot; rel=&quot;nofollow&quot;&gt;frame parameter documentation&lt;/a&gt; says that the associated value of &lt;code&gt;alpha&lt;/code&gt; can also be a number or &lt;code&gt;nil&lt;/code&gt; (when the window manager should handle transparency).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;‘alpha’&#xA;      This parameter specifies the opacity of the frame, on graphical&#xA;      displays that support variable opacity.  It should be an integer&#xA;      between 0 and 100, where 0 means completely transparent and 100&#xA;      means completely opaque. It can also have a ‘nil’ value, which&#xA;      tells Emacs not to set the frame opacity (leaving it to the window&#xA;      manager).&#xA;      ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your code will error-out in those cases since &lt;code&gt;cadr&lt;/code&gt; expects a list and &lt;code&gt;\=&lt;/code&gt; expects numbers as arguments. It handles only the case of the following subsequent section in the doc:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The alpha frame parameter can also be a cons cell(‘active’ . ‘inactive’),&#xA;     where ‘active’ is the opacity of the frame when it is selected,&#xA;     and ‘inactive’ is the opacity when it is not selected. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There follows a modified function &lt;code&gt;toggle-transparency&lt;/code&gt; that regards the doc.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-transparency ()&#xA;  (interactive)&#xA;  (let ((alpha (frame-parameter nil 'alpha)))&#xA;    (if (eq&#xA;     (if (numberp alpha)&#xA;         alpha&#xA;       (cdr alpha)) ; may also be nil&#xA;     100)&#xA;    (set-frame-parameter nil 'alpha '(85 . 50))&#xA;      (set-frame-parameter nil 'alpha '(100 . 100)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-05-31T16:24:37.757" LastActivityDate="2016-05-31T16:24:37.757" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22669" PostTypeId="1" CreationDate="2016-05-31T14:24:45.490" Score="0" ViewCount="97" Body="&lt;p&gt;When using &lt;code&gt;#Begin_Src R&lt;/code&gt; blocks one can change the code in blocks and then rerun all the code blocks in a document. Great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if one does this with inline src, such as, &lt;code&gt;src_R[:session *myRSession* :exports results :results raw value]{length(unique(someDataFrame$SomeVariable[someDataFrame$conditionVariable == &quot;1&quot;]))}&lt;/code&gt;  one will get an output as text following this, e.g. 12. If one repeatedly evaluates all the code blocks in the file one gets an ever growning string of text &quot;12 12 12 12 ...&quot; Which results in one having to go in manually afterwords to clean it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The challenge is that in using orgmode and orgbabel to practice reproducible research by writing a technical manuscript one can have a lot of these inline statements (e.g. for every statistical test, p-values, degrees of freedom and so on).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone solved this, or have any suggestions? I have used knitr with an .Rtex file as an alternative. While this solves the in-line issue it has it's own challenges, and ideally I would like to settle on one markup format for all papers that blend code with text (and would prefer that that markup language be orgmode). &lt;/p&gt;&#xA;" OwnerUserId="8231" LastActivityDate="2016-06-01T21:06:49.460" Title="How to avoid redundant output from inline orgbabel code?" Tags="|org-mode|org-babel|r|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22670" PostTypeId="2" ParentId="22663" CreationDate="2016-05-31T15:11:51.053" Score="1" Body="&lt;p&gt;It turns out while I was trying different ways to set transparency, one being CompizConfig which is a Ubuntu program, I had set a rule that emacs would be 96 transparent (4% transparency) so the max emacs could go was that high. After removing the rule I was able to toggle transparency completely.&lt;/p&gt;&#xA;" OwnerUserId="11700" LastActivityDate="2016-05-31T15:11:51.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22671" PostTypeId="1" AcceptedAnswerId="22680" CreationDate="2016-05-31T16:02:00.967" Score="9" ViewCount="1485" Body="&lt;p&gt;I've opened a file in Emacs. I'd like to view information about that file such as creation date, size, etc. within Emacs. Is there a key shortcut or any Emacs command for that? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2784" LastEditorUserId="9995" LastEditDate="2016-05-31T17:27:35.290" LastActivityDate="2016-05-31T18:44:07.807" Title="Can I view within Emacs the properties of a file which I already opened?" Tags="|files|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22672" PostTypeId="1" AcceptedAnswerId="22684" CreationDate="2016-05-31T16:24:11.020" Score="0" ViewCount="60" Body="&lt;p&gt;If I insert &lt;code&gt;\SI{50}{\m}&lt;/code&gt; into a latex file with auctex and &lt;code&gt;LaTeX-environment&lt;/code&gt; doesn't insert the backslash before &lt;code&gt;m&lt;/code&gt;, i.e. &lt;code&gt;\SI{50}{m}&lt;/code&gt; instead of &lt;code&gt;\SI{50}{\m}&lt;/code&gt;. However the backslash is required such that things like &lt;code&gt;\SI{50}{\m\per\s}&lt;/code&gt; work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug or do I use this function in the wrong way? In the first case: is there a workaround? In the second case: Why does this behaviour make sense and how is the correct use in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My auctex-version is 11.88.6 and my emacs version 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-06-01T00:24:42.417" Title="Auctex's siunitx macro absorbs a backslash" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22673" PostTypeId="1" AcceptedAnswerId="22679" CreationDate="2016-05-31T16:40:10.743" Score="5" ViewCount="2364" Body="&lt;p&gt;I am new to Emacs and trying to learn the basics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am writing a few C programs and I noticed that the default brace indentation is as follows:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;for(i = 0; i &amp;lt; 10; ++i)&#xA;    {&#xA;        // code &#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would I go about modifying this behaviour to achieve the following instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;for(i = 0; i &amp;lt; 10; ++i)&#xA;{&#xA;    // code&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12230" LastEditorUserId="675" LastEditDate="2016-05-31T23:30:33.647" LastActivityDate="2016-06-01T05:19:56.217" Title="C brace indentation" Tags="|indentation|c|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22674" PostTypeId="2" ParentId="22671" CreationDate="2016-05-31T16:44:26.150" Score="11" Body="&lt;p&gt;There doesn't seem to be a command to get this info interactively, although you can use dired as @jrm suggests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get this information with the following elisp code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file-attributes (buffer-file-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will return a list like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(nil 1 &quot;lh&quot; &quot;users&quot;&#xA;  (20614 64019 50040 152000)&#xA;  (20000 23 0 0)&#xA;  (20614 64555 902289 872000)&#xA;  122295 &quot;-rw-rw-rw-&quot;&#xA;  t (5888 2 . 43978)&#xA;  (15479 . 46724))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first line gives you the UID &quot;lh&quot; and GID &quot;users&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next three lines are the last access, modification and status change times, formatted as lists. You can convert those to human-readable strings with &lt;code&gt;current-time-string&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(current-time-string '(20614 64019 50040 152000))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, the return value is &quot;Tue Oct 23 16:12:03 2012&quot;. With that, you can build your own function to extract whichever bits your interested in. If you just want to see the meta data in the minibuffer, this will display it for you:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun file-metadata ()&#xA;  (interactive)&#xA;  (let* ((fname (buffer-file-name))&#xA;         (data (file-attributes fname))&#xA;         (access (current-time-string (nth 4 data)))&#xA;         (mod (current-time-string (nth 5 data)))&#xA;         (change (current-time-string (nth 6 data)))&#xA;         (size (nth 7 data))&#xA;         (mode (nth 8 data)))&#xA;    (message&#xA;     &quot;%s:&#xA;  Accessed: %s&#xA;  Modified: %s&#xA;  Changed: %s&#xA;  Size: %s bytes&#xA;  Mode: %s&quot;&#xA;     fname access mod change size mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling this interactively produces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/tws/org/hk.org:&#xA;  Accessed: Mon May 30 09:38:29 2016&#xA;  Modified: Thu Apr 21 11:59:06 2016&#xA;  Changed: Wed May 18 16:09:31 2016&#xA;  Size: 7508 bytes&#xA;  Mode: -rwxr-xr-x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More details in the manual &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Attributes.html&quot;&gt;(elisp) File Attributes.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="675" LastEditDate="2016-05-31T18:44:07.807" LastActivityDate="2016-05-31T18:44:07.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22675" PostTypeId="1" CreationDate="2016-05-31T16:58:35.313" Score="0" ViewCount="489" Body="&lt;p&gt;I'm trying to use inferior python shell to run ipython commands interactively. I am able to connect but it doesn't print the results of my statements except when I use print statements&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [1]: a = 10&#xA;&#xA;In [5]: a&#xA;&#xA;In [6]: a.real&#xA;&#xA;In [12]: print &quot;hello&quot;&#xA;hello&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using the latest version of spacemacs with the Python layer and the following user configuration settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-completion-native-enable nil)&#xA;(setq python-shell-interpreter &quot;ipython&quot;)&#xA;(setq python-shell-interpreter &quot;python.exe&quot;&#xA;    python-shell-interpreter-args&#xA;    &quot;-i c:\\Users\\me\\AppData\\Local\\Continuum\\Anaconda2\\Scripts\\ipython-script.py&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="12231" LastActivityDate="2020-03-12T12:13:56.900" Title="Inferior Python Shell - Windows - not printing results" Tags="|python|spacemacs|microsoft-windows|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22676" PostTypeId="1" CreationDate="2016-05-31T17:44:27.647" Score="3" ViewCount="68" Body="&lt;p&gt;I use &lt;code&gt;mutt&lt;/code&gt; for email (outside of emacs) and set my &lt;code&gt;EDITOR&lt;/code&gt; to an &lt;code&gt;emacsclient&lt;/code&gt; invocation. Thus, &lt;code&gt;mutt&lt;/code&gt; spawns &lt;code&gt;emacsclient&lt;/code&gt; in the same terminal when I want to compose an E-mail, then catches the output file when I quit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This buffer operates in &lt;code&gt;Fundamental Server&lt;/code&gt; mode. Most things are satisfactory; however, when I use &lt;code&gt;fill-paragraph&lt;/code&gt; on a paragraph with a semicolon in it (used as in ordinary English), it interprets the semicolon for some reason and fills badly. Thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is a sentence containing enough text to overflow the fill-column; when I try to fill, it fails.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;fill-column&lt;/code&gt; at 80, this should fill to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is a sentence containing enough text to overflow the fill-column; when I&#xA;try to fill, it fails.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, it becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is a sentence containing enough text to overflow the fill-column; when I&#xA;                                                                     ; try to&#xA;                                                                     ; fill, it&#xA;                                                                     ; fails.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is obviously not very useful. The same behavior occurs in &lt;code&gt;text-mode&lt;/code&gt;. I assume emacs is parsing the semicolon as a comment delimiter, or something of that nature; however, it's unclear to me why this should occur in either &lt;code&gt;fundamental-mode&lt;/code&gt; or &lt;code&gt;text-mode&lt;/code&gt;, which shouldn't accomodate specific programming languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get rid of this behavior?&lt;/p&gt;&#xA;" OwnerUserId="7095" LastActivityDate="2016-05-31T17:44:27.647" Title="fill-paragraph chokes on semicolons" Tags="|fill-paragraph|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="22677" PostTypeId="2" ParentId="22669" CreationDate="2016-05-31T17:49:38.270" Score="-1" Body="&lt;p&gt;Doesn't the &lt;code&gt;{{{result (...)}}}&lt;/code&gt; construct fix your problem? &lt;/p&gt;&#xA;" OwnerUserId="12232" LastEditorUserId="25" LastEditDate="2016-06-01T19:57:39.297" LastActivityDate="2016-06-01T19:57:39.297" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22679" PostTypeId="2" ParentId="22673" CreationDate="2016-05-31T18:15:03.403" Score="5" Body="&lt;p&gt;As mentioned in &lt;a href=&quot;//stackoverflow.com/a/2542054/2747593&quot; rel=&quot;nofollow&quot;&gt;this answer on SO&lt;/a&gt;, you can do:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq c-default-style &quot;bsd&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set the style for &lt;strong&gt;all&lt;/strong&gt; C-based modes. If you want to set it only for one, do e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'c-default-style '(c-mode &quot;bsd&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, setting &lt;code&gt;c-default-style&lt;/code&gt; will change various other style settings, which may not be what you want. To only change the post-for-loop-brace indentation, do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'c-offsets-alist '(substatement-open . 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(This will shadow the old value, which AFAIK shouldn't cause any problems. See &lt;a href=&quot;//stackoverflow.com/q/10063195/2747593&quot; rel=&quot;nofollow&quot;&gt;this question&lt;/a&gt; and its answers for possible ways to actually replace the old value.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now to generalize: how do you find the specific syntactic symbol in the &lt;code&gt;c-offsets-alist&lt;/code&gt; that you need to modify?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the line that has faulty indentation (in this case, the one with the &lt;code&gt;{&lt;/code&gt; after the &lt;code&gt;for&lt;/code&gt; loop), and move the point to that line. Then do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;M-x c-show-syntactic-information&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(or &lt;code&gt;C-c C-s&lt;/code&gt;). This will give you e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;Syntactic analysis: ((substatement-open 16))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another option is to do &lt;code&gt;M-x c-set-offset&lt;/code&gt; (or &lt;code&gt;C-c C-o&lt;/code&gt;), which will give you the following prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;Syntactic symbol to change: |substatement-open&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here the &lt;code&gt;|&lt;/code&gt; marks the position of the cursor, with the relevant symbol auto-filled for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;//emacs.stackexchange.com/users/93/nispio&quot; rel=&quot;nofollow&quot;&gt;@nispio&lt;/a&gt; for the info!&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2016-06-01T05:19:56.217" LastActivityDate="2016-06-01T05:19:56.217" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22680" PostTypeId="2" ParentId="22671" CreationDate="2016-05-31T18:16:49.567" Score="9" Body="&lt;p&gt;Here is a command that uses &lt;code&gt;dired&lt;/code&gt; with verbose file flags for the &lt;code&gt;ls&lt;/code&gt; command.  You may want to customize those flags depending on your operating system.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun file-info ()&#xA;  (interactive)&#xA;  (let ((dired-listing-switches &quot;-alh&quot;))&#xA;    (dired-other-window buffer-file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Create a keybinding to your liking.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c d&quot;) 'file-info)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10479" LastEditorUserId="2287" LastEditDate="2016-05-31T18:33:45.143" LastActivityDate="2016-05-31T18:33:45.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22682" PostTypeId="2" ParentId="10033" CreationDate="2016-05-31T21:10:31.013" Score="1" Body="&lt;p&gt;This is a variation of the other answers, with this one distinguishing between active and inactive windows.  If a buffer is visible in more than one window, only the active window will have &lt;code&gt;ml-active-window-face&lt;/code&gt; and the other windows will all have &lt;code&gt;ml-inactive-window-face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar ml-selected-window nil)&#xA;&#xA;(defun ml-record-selected-window ()&#xA;  (setq ml-selected-window (selected-window)))&#xA;&#xA;(defun ml-update-all ()&#xA;  (force-mode-line-update t))&#xA;&#xA;(add-hook 'post-command-hook 'ml-record-selected-window)&#xA;&#xA;(add-hook 'buffer-list-update-hook 'ml-update-all)&#xA;&#xA;(defface ml-active-window-face&#xA;   '((t (:foreground &quot;red&quot;)))&#xA;   &quot;Face for active buffer identification.&quot;)&#xA;&#xA;(defface ml-inactive-window-face&#xA;   '((t (:foreground &quot;green&quot;)))&#xA;   &quot;Face for inactive buffer identification.&quot;)&#xA;&#xA;(defun ml-propertized-buffer-identification (fmt)&#xA;  &quot;Return a list suitable for `mode-line-buffer-identification'.&#xA;FMT is a format specifier such as \&quot;%12b\&quot;.  This function adds&#xA;text properties for face, help-echo, and local-map to it.&quot;&#xA;  (list (propertize fmt&#xA;        'face&#xA;          (if (eq ml-selected-window (selected-window))&#xA;            'ml-active-window-face&#xA;            'ml-inactive-window-face)&#xA;        'help-echo&#xA;        (purecopy &quot;Buffer name&#xA;mouse-1: Previous buffer\nmouse-3: Next buffer&quot;)&#xA;        'mouse-face 'mode-line-highlight&#xA;        'local-map mode-line-buffer-identification-keymap)))&#xA;&#xA;(setq-default mode-line-buffer-identification&#xA;  '(:eval (ml-propertized-buffer-identification &quot;%12b&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://www.lawlist.com/images/active_inactive_modeline.png&quot; alt=&quot;Example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:49.983" LastActivityDate="2016-06-03T04:44:17.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22684" PostTypeId="2" ParentId="22672" CreationDate="2016-06-01T00:24:42.417" Score="1" Body="&lt;p&gt;This was a known bug (due to a breaking change on Emacs's side), see &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19504&quot; rel=&quot;nofollow&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19504&lt;/a&gt;, but it should have been fixed in AUCTeX 11.89&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-06-01T00:24:42.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22686" PostTypeId="1" AcceptedAnswerId="26325" CreationDate="2016-06-01T01:22:52.827" Score="8" ViewCount="1428" Body="&lt;p&gt;I would like to set several face variables for use with any theme in my personal init-file. Is there a hook I could use to insure it is theme independent?&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="105" LastEditDate="2016-08-15T01:08:11.827" LastActivityDate="2016-08-17T01:46:22.130" Title="Is there a universal 'after-theme-load' hook?" Tags="|init-file|hooks|themes|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22687" PostTypeId="1" CreationDate="2016-06-01T02:22:49.887" Score="0" ViewCount="262" Body="&lt;p&gt;I have &lt;code&gt;alias msexcel (w32-browser &quot;C:/program files/microsoft office/office12/excel.exe&quot;)&lt;/code&gt; and this means I can do &lt;code&gt;msexcel&lt;/code&gt; from eshell and an asynchronous MS Excel will begin to run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for ways to do &lt;code&gt;msexcel &quot;C:\\documents\ and\ settings\\me\my\ documents\\book.xlsx&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;alias msexcel (w32-browser (format &quot;C:/program files/microsoft office/office12/excel.exe /r %s&quot; $1))&lt;/code&gt; returns the error message &lt;code&gt;(void-variable $1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I send Excel a file name through this eshell alias?&lt;/p&gt;&#xA;" OwnerUserId="10924" LastActivityDate="2017-06-01T08:56:16.643" Title="Windows eshell alias command line arguments.. how?" Tags="|microsoft-windows|eshell|subprocess|async|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22688" PostTypeId="1" CreationDate="2016-06-01T03:38:39.383" Score="2" ViewCount="1659" Body="&lt;h2&gt;Configuration&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MacOSX 10.11.5&#xA;emacs version 24.5.1&#xA;brew 0.9.9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I want to have the following behavior in my emacs setup:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;At login, automatically start an emacs server process.&lt;/li&gt;&#xA;&lt;li&gt;Running the &lt;code&gt;/Application/Emacs.app&lt;/code&gt; executable opens a frame to a running emacs server. If the server is not running, then run it and try again (i.e. &lt;code&gt;emacsclient -a ''&amp;amp;&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;When executed from the command-line, have this behavior but use the current terminal instance to host the emacs session (i.e. &lt;code&gt;emacsclient -nw -a ''&amp;amp;&lt;/code&gt;). &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are several pages that cover this information, albeit incompletely:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://blog.haberkucharsky.com/tech/2015/01/26/emacs-on-osx.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blog.haberkucharsky.com/tech/2015/01/26/emacs-on-osx.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://korewanetadesu.com/emacs-on-os-x.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://korewanetadesu.com/emacs-on-os-x.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/8169/how-can-i-run-emacs-24-x-app-on-mac-os-x-in-daemon-mode?rq=1&quot;&gt;How can I run Emacs 24.x app on Mac OS X in daemon mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;What I've Tried&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I was able to accomplish (1) by installing the homebrew launch-agent. See &lt;code&gt;brew info emacs&lt;/code&gt; for more detail.&lt;/li&gt;&#xA;&lt;li&gt;Once (1) is running, it was easy enough to get (3) working.&lt;/li&gt;&#xA;&lt;li&gt;The problem with the above links was that the my version of &lt;code&gt;homebrew&lt;/code&gt; (0.9.9) doesn't have &lt;code&gt;emacsclient&lt;/code&gt; in a subdirectory of the app bundle. That's not too big of a deal, I was able to locate the correct binary at &lt;code&gt;/usr/local/Cellar/emacs/24.5/bin/emacsclient&lt;/code&gt; and modify the scripts appropriately.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I created an AppleScript app to replace the standard link to the &lt;code&gt;Emacs.app&lt;/code&gt; in &lt;code&gt;/Applications&lt;/code&gt;. The AppleScript has the following code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tell application &quot;Terminal&quot;&#xA;    try&#xA;        do shell script &quot;/usr/local/bin/emacsclient -c -n -a ''&amp;amp;&quot;&#xA;        tell application &quot;Emacs&quot; to activate&#xA;    on error&#xA;        do shell script &quot;/usr/local/bin/emacsclient -c -n -a ''&amp;amp;&quot;&#xA;    end try&#xA;end tell&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are two problems here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;code&gt;try&lt;/code&gt; block doesn't do anything; it doesn't error out (i.e. throw an exception). &lt;/li&gt;&#xA;&lt;li&gt;Even though the shell script command works on the command-line, running it from AppleScript doesn't respawn the server process.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My main problem is the sometimes I accidentally kill the server process. Trying to activate the &lt;code&gt;Emacs.app&lt;/code&gt; GUI frame doesn't work until I manually go to the command line and run &lt;code&gt;emacsclient -a ''&amp;amp;&lt;/code&gt;. At that point I am able to use Emacs from the GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Using the vanilla emacs provided by homebrew, how do I setup a system where activating &lt;code&gt;Emacs.app&lt;/code&gt; restarts the server if it's been terminated?&lt;/strong&gt; I suspect it has something to do with the way AppleScript sets up its environment to call &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="653" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-08-30T07:37:47.603" Title="How do I configure home-brew-provisioned emacs to run a GUI-based emacsclient properly?" Tags="|emacsclient|gui-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22689" PostTypeId="1" AcceptedAnswerId="22690" CreationDate="2016-06-01T03:40:51.270" Score="1" ViewCount="43" Body="&lt;p&gt;In my config file i have the following lines to fix faces for Scala-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-face-bold scala-font-lock:lazy-face)&#xA;(make-face-bold scala-font-lock:final-face)&#xA;(make-face-bold scala-font-lock:private-face)&#xA;(make-face-bold scala-font-lock:implicit-face)&#xA;(make-face-bold scala-font-lock:abstract-face)&#xA;(make-face-bold scala-font-lock:override-face)&#xA;(make-face-bold scala-font-lock:sealed-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That i would really like to simplify to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapc&#xA;  (lambda (kw) (make-face-bold (make-symbol (format &quot;scala-font-lock:%s-face&quot; kw))))&#xA;  '(&quot;final&quot; &quot;private&quot; &quot;implicit&quot; &quot;abstract&quot; &quot;override&quot; &quot;sealed&quot; &quot;lazy&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it complains with &lt;code&gt;(error &quot;Invalid face&quot; scala-font-lock:final-face)&lt;/code&gt;. How can i make it work, i.e refer to the face using constructed string?&lt;/p&gt;&#xA;" OwnerUserId="2361" LastEditorUserId="105" LastEditDate="2016-06-01T15:40:06.587" LastActivityDate="2016-06-01T15:40:06.587" Title="Modify face by its string name" Tags="|faces|symbols|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22690" PostTypeId="2" ParentId="22689" CreationDate="2016-06-01T03:56:30.390" Score="4" Body="&lt;p&gt;&lt;code&gt;(intern &quot;name&quot;)&lt;/code&gt; returns the interned symbol &lt;code&gt;name&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;make-symbol&lt;/code&gt; returns a new &lt;em&gt;uninterned&lt;/em&gt; symbol, which is entirely distinct from the symbol with the face properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Creating Symbols&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-01T04:07:39.023" LastActivityDate="2016-06-01T04:07:39.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22691" PostTypeId="2" ParentId="22688" CreationDate="2016-06-01T04:42:00.130" Score="3" Body="&lt;p&gt;Use the following script, compiled as an application (via ScriptEditor):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tell application &quot;Terminal&quot;&#xA;    try&#xA;        -- Tests if Emacs running already; throws error otherwise&#xA;        do shell script &quot;pgrep Emacs&quot;&#xA;        -- Emacs is already running, is it an actual process?&#xA;        do shell script &quot;/usr/local/bin/emacsclient -c -n &amp;amp;&quot;&#xA;    on error&#xA;        do shell script &quot;launchctl start homebrew.mxcl.emacs&quot;&#xA;        -- Give Emacs some time to load&#xA;        delay 5&#xA;        do shell script &quot;/usr/local/bin/emacsclient -c -n &amp;amp;&quot;&#xA;    end try&#xA;end tell&#xA;tell application &quot;Emacs&quot; to activate&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Assumptions &amp;amp; Caveats&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If an Emacs process is running, it's in daemon mode. &lt;/li&gt;&#xA;&lt;li&gt;The homebrew provided Launch Agent is being used.&lt;/li&gt;&#xA;&lt;li&gt;This script creates a new window EVERY time it is called. This behavior is a bit different than a typical MacOSX application, where activating the application after it is already running just returns the user to the application. This script can be modified to have that behavior (i.e. after the &lt;code&gt;pgrep&lt;/code&gt; check, check to see if Emacs is registered as a SystemProcess and do something appropriate).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="653" LastEditorUserId="653" LastEditDate="2016-06-01T06:05:58.597" LastActivityDate="2016-06-01T06:05:58.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22692" PostTypeId="1" AcceptedAnswerId="22695" CreationDate="2016-06-01T07:37:00.993" Score="3" ViewCount="508" Body="&lt;p&gt;Suppose I set two idle timers&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-idle-timer 3 nil #'function1)&#xA;(run-with-idle-timer 3 nil #'function2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the effect?  After roughly 3 seconds will emacs run &lt;code&gt;function1&lt;/code&gt; and then wait 3 further seconds, or will there be no second delay before running &lt;code&gt;function2&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have browsed through the &lt;code&gt;timer.el&lt;/code&gt; code and could not see what action to expect.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update/Conclusion&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Thanks to phils' answer I tried evaluating&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-idle-timer 2 nil #'message &quot;Function 1&quot;)&#xA;(run-with-idle-timer 3 nil #'message &quot;Function 2&quot;)&#xA;(run-with-idle-timer 3 nil #'message &quot;Function 3&quot;)&#xA;(run-with-idle-timer 4 nil #'message &quot;Function 4&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the &lt;code&gt;*scratch*&lt;/code&gt; buffer and consistently get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function 1&#xA;Function 3&#xA;Function 2&#xA;Function 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;printed in the &lt;code&gt;*Messages*&lt;/code&gt; buffer after 4 seconds idle time, demonstrating exactly the behaviour he describes.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2016-06-02T16:17:24.223" LastActivityDate="2016-06-02T16:17:24.223" Title="Effect of multiple idle timers" Tags="|idle-timer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22693" PostTypeId="1" CreationDate="2016-06-01T07:52:42.220" Score="0" ViewCount="361" Body="&lt;p&gt;I'm using emacs &quot;25.0.92.1&quot;, with Prelude customization on Windows 7. I mainly use org-mode.&#xA;I found that org-mode takes long delay to save buffer &lt;code&gt;(save-buffer)&lt;/code&gt;, as long as the edit is more than &#xA;several dozen characters. It may take as long as 10 seconds, not able to continue editing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried even with emacs -Q, it will still takes about 5 seconds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I also noticed that it takes long time to open and load org file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The file in question has about 500 lines, some of the lines may be long of about 200 hundred characters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried to increase gc-cons-threshold, but seems not effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only have last option to go back to version 24.x to try my luck. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please your insights or experience. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, &lt;/p&gt;&#xA;" OwnerUserId="6845" LastEditorUserId="6845" LastEditDate="2016-06-01T14:27:03.160" LastActivityDate="2016-06-01T14:27:03.160" Title="org-mode saving buffer has long delay, how to tune it?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22694" PostTypeId="2" ParentId="22693" CreationDate="2016-06-01T09:32:59.343" Score="4" Body="&lt;p&gt;Try to profile your emacs configurations as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x profiler-start&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Edit your &lt;code&gt;.org&lt;/code&gt; file for a while;&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x profiler-report&lt;/code&gt; to see the detailed time consumption of each function;&lt;/li&gt;&#xA;&lt;li&gt;Locate the package which the function that takes the most CPU time belongs to;&lt;/li&gt;&#xA;&lt;li&gt;Uninstall the package or comment out the configurations of that specific package&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2799" LastActivityDate="2016-06-01T09:32:59.343" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22695" PostTypeId="2" ParentId="22692" CreationDate="2016-06-01T09:36:13.093" Score="3" Body="&lt;p&gt;After three seconds of idleness, both timers will be triggered (and experimentally it is likely to be the second function which runs first, although I'm not sure if that's always going to be the case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Executing an idle timer function does not cause Emacs to cease to be idle! That requires user input:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs becomes &quot;idle&quot; when it starts waiting for user input, and it remains idle until the user provides some input.  If a timer is set for five seconds of idleness, it runs approximately five seconds after Emacs first becomes idle.  Even if REPEAT is non-‘nil’, this timer will not run again as long as Emacs remains idle, because the duration of idleness will continue to increase and will not go down to five seconds again.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Idle Timers&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-01T09:43:26.050" LastActivityDate="2016-06-01T09:43:26.050" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22696" PostTypeId="1" AcceptedAnswerId="22697" CreationDate="2016-06-01T11:12:45.327" Score="1" ViewCount="505" Body="&lt;p&gt;Is there a standard emacs-lisp function replacement for&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun collect-if (PREDICATE LIST)&#xA;  (loop for el in LIST if (funcall PREDICATE el) collect el))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Example toy application: Extract the odd numbers from a list of numbers&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(collect-if (lambda (x) (/= 0 (% x 2))) '(1 2 3 4 5))&#xA;(1 3 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="105" LastEditDate="2016-08-22T21:40:38.867" LastActivityDate="2016-08-22T21:40:38.867" Title="Standard emacs lisp function for &quot;collect-if&quot;" Tags="|filtering|iteration|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22697" PostTypeId="2" ParentId="22696" CreationDate="2016-06-01T11:19:42.270" Score="2" Body="&lt;p&gt;Okay &lt;code&gt;remove-if-not&lt;/code&gt; makes a copy of the list it operates on. So this is the equivalent to &lt;code&gt;collect-if&lt;/code&gt; above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my perspective &lt;code&gt;remove-if-not&lt;/code&gt; is a really tricky name for something like &lt;code&gt;collect-if&lt;/code&gt; or &lt;code&gt;sub-list&lt;/code&gt; (&lt;strong&gt;not&lt;/strong&gt; with the meaning of &lt;code&gt;cl-sublis&lt;/code&gt; but with the meaning of sub-list). There should be an alias saying more directly what that function does.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-06-01T11:26:17.917" LastActivityDate="2016-06-01T11:26:17.917" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22698" PostTypeId="1" AcceptedAnswerId="22700" CreationDate="2016-06-01T11:38:57.653" Score="4" ViewCount="1681" Body="&lt;p&gt;Is there a way in org-mode to setup &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_quote&#xA;my quote here&#xA;#+end_quote&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to be expanded in latex export as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{quoting}&#xA;...&#xA;\end{quoting}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to use quoting latex package to style quote blocks.&lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2021-11-17T14:22:05.667" Title="org-mode quote block environment" Tags="|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22699" PostTypeId="1" AcceptedAnswerId="22737" CreationDate="2016-06-01T12:50:35.887" Score="0" ViewCount="869" Body="&lt;p&gt;I use colorized output in &lt;code&gt;ghci&lt;/code&gt;. And if run it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in &lt;code&gt;comint-mode&lt;/code&gt;, or in &lt;code&gt;eshell&lt;/code&gt;, then colors displayed&#xA;fine, but a lot of escape sequences displayed like &lt;code&gt;^A^Bλ ^A^B&amp;gt; ^A^B^B&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;in &lt;code&gt;ansi-term&lt;/code&gt;, then I got much better result like &lt;code&gt;λ &amp;gt; ^B&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;in &lt;code&gt;tmux&lt;/code&gt; in &lt;code&gt;ansi-term&lt;/code&gt; it displayed perfect (like colored &lt;code&gt;λ &amp;gt;&lt;/code&gt;) but except performance.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Why output speed reduced so significant in this case?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Not sure if this information may be helpful:&lt;/em&gt; &lt;code&gt;emacs&lt;/code&gt; launched under &lt;code&gt;tmux&lt;/code&gt; (surely, it in different &lt;code&gt;tmux&lt;/code&gt;session, than that in &lt;code&gt;ansi-term&lt;/code&gt; with &lt;code&gt;ghci&lt;/code&gt;) in &lt;code&gt;rxvt-unicode&lt;/code&gt; terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPD:&lt;/strong&gt; prompt example &lt;code&gt;:set prompt &quot;\001\ESC[33m\002λ \001\ESC[01;34m\002&amp;gt; \001\ESC[m\002\STX&quot;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="210" LastEditorUserId="210" LastEditDate="2016-06-03T13:39:02.117" LastActivityDate="2016-06-03T13:48:13.480" Title="why tmux under ansi-term so slow?" Tags="|eshell|ansi-term|performance|comint|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22700" PostTypeId="2" ParentId="22698" CreationDate="2016-06-01T12:53:48.030" Score="5" Body="&lt;p&gt;The simplest way to do this is to use a special block. In your case:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_quoting&#xA;my quote here&#xA;#+end_quoting&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Will be exported as&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;\begin{quoting}&#xA;my quote here&#xA;\end{quoting}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can also modify the attributes of an example block to accomplish the same thing:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_LATEX: :environment quoting&#xA;#+BEGIN_EXAMPLE&#xA;My quote here&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The relevant manual page is &lt;a href=&quot;https://orgmode.org/org.html#Example-blocks-in-LaTeX-export&quot; rel=&quot;nofollow noreferrer&quot;&gt;(org) LaTeX specific attributes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="13157" LastEditDate="2021-11-17T14:22:05.667" LastActivityDate="2021-11-17T14:22:05.667" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22701" PostTypeId="1" AcceptedAnswerId="22704" CreationDate="2016-06-01T14:19:08.980" Score="2" ViewCount="118" Body="&lt;p&gt;I am reading through &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/eintr.html&quot; rel=&quot;nofollow&quot;&gt;An Introduction to Programming in Emacs Lisp&lt;/a&gt; in an emacs buffer. I get to the file through &lt;code&gt;C-h i&lt;/code&gt; and navigated to &lt;code&gt;Emacs Lisp Intro&lt;/code&gt;. If I kill the buffer and return the same way, it takes me back to the table of contents. I have save-place enabled in my init file with the following code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default save-place t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I save my place in an info file?&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="105" LastEditDate="2016-06-01T15:36:16.530" LastActivityDate="2016-06-01T15:36:16.530" Title="Can I save my place in an info file?" Tags="|info|persistence|saveplace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22702" PostTypeId="2" ParentId="10785" CreationDate="2016-06-01T15:06:56.300" Score="19" Body="&lt;p&gt;If you're just looking to see what minor modes are being used in a buffer, but don't need to use the list programmatically use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-mode&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This command will open a new buffer that begins with a full list of your minor modes, as well as giving a brief description of the major modes, and any parent modes that may have been run.&lt;/p&gt;&#xA;" OwnerUserId="12244" LastActivityDate="2016-06-01T15:06:56.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22703" PostTypeId="1" AcceptedAnswerId="22707" CreationDate="2016-06-01T15:14:34.647" Score="2" ViewCount="1709" Body="&lt;p&gt;I currently begin to write a org-mode backend for a custom file format, so I can export from org-file to that format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I need to apply properties (or attributes) to headings. My prolbem is now, how I could solve this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have the following headline function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-mine-headline (headline contents info)&#xA;  (let ((full-text&#xA;         (substring-no-properties&#xA;          (org-export-data (org-element-property :title headline) info)))&#xA;        (p (org-element-property nil headline))&#xA;        (a (org-export-read-attribute :attr_mine headline)))&#xA;    (format &quot;%s: [%s] %s&quot; full-text p contents)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which gives me with the following org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* H1&#xA;#+PROPERTY: findme a&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;H1: [nil] foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like it to become something like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;H1: [(:findme &quot;a&quot;)] foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried attributes with no success:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* H1&#xA;#+ATTR_MINE: :findme a&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2017-05-19T21:19:11.973" LastActivityDate="2017-05-19T21:19:11.973" Title="Org-mode backend: access properties in heading" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22704" PostTypeId="2" ParentId="22701" CreationDate="2016-06-01T15:20:25.650" Score="5" Body="&lt;p&gt;You can set a bookmark to where you are. Normally it is bound to &lt;kbd&gt;C-x r m&lt;/kbd&gt;, and you can give it a name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see the list of bookmarks, &lt;kbd&gt;C-x r l&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-06-01T15:20:25.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22705" PostTypeId="1" AcceptedAnswerId="22708" CreationDate="2016-06-01T15:43:41.427" Score="3" ViewCount="628" Body="&lt;p&gt;I have a file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 = &quot;go 1&quot;&#xA;2 = &quot;go 2&quot;&#xA;3 = &quot;go 3&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want duplicate the last line and increase both numbers. The needed amount of lines is very high (approximately 90), so I want to automate a little.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result should look like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 = &quot;go 1&quot;&#xA;2 = &quot;go 2&quot;&#xA;3 = &quot;go 3&quot;&#xA;4 = &quot;go 4&quot;&#xA;5 = &quot;go 5&quot;&#xA;6 = &quot;go 6&quot;&#xA;&#xA;[...]&#xA;&#xA;88 = &quot;go 88&quot;&#xA;89 = &quot;go 89&quot;&#xA;90 = &quot;go 90&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="11174" LastEditDate="2016-06-01T16:26:29.640" LastActivityDate="2016-06-01T17:39:54.893" Title="quickly duplicate line and increase number for lots of lines" Tags="|key-bindings|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22706" PostTypeId="2" ParentId="22705" CreationDate="2016-06-01T16:54:54.873" Score="4" Body="&lt;p&gt;You can use keyboard macros.  Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;f3&amp;gt;                    ;; (start macro)&#xA;&#xA;&amp;lt;f3&amp;gt;                    ;; (insert counter)&#xA;SPC                     ;; self-insert-command&#xA;=                       ;; self-insert-command&#xA;SPC                     ;; self-insert-command&#xA;&quot;go                     ;; self-insert-command * 3&#xA;SPC                     ;; self-insert-command&#xA;C-u C-x C-k C-a         ;; (reset counter to previous value)&#xA;&amp;lt;f3&amp;gt;                    ;; (insert counter)&#xA;&quot;                       ;; self-insert-command&#xA;C-e                     ;; move-end-of-line&#xA;RET                     ;; newline&#xA;&#xA;&amp;lt;f4&amp;gt;                    ;; (end macro)&#xA;C-u 99 &amp;lt;f4&amp;gt;             ;; (repeat macro 99 times)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will create lines starting with &lt;code&gt;0 = &quot;go 0&quot;&lt;/code&gt; all the way through &lt;code&gt;99 = &quot;go 99&quot;&lt;/code&gt;.  If you wanted to start at a different number, you could press &lt;code&gt;C-u 42 C-x C-k C-c&lt;/code&gt; before recording the macro to start the counter at 42 instead of 0.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2016-06-01T17:21:15.700" LastActivityDate="2016-06-01T17:21:15.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22707" PostTypeId="2" ParentId="22703" CreationDate="2016-06-01T17:24:02.123" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;org-element-map&lt;/code&gt; to convert the properties in the section following the heading into a string of values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There follows an example which should run in the scratch buffer.&#xA;I have commented out some lines of your code to make this example independent from the org exporter.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org-element)&#xA;&#xA;(defun org-mine-headline (headline contents info)&#xA;  (let ((full-text&#xA;         (substring-no-properties&#xA;          ;;(org-export-data (org-element-property :title headline) info))&#xA;      &quot;\nfull-text\n&quot;))&#xA;    (vals (org-element-map headline 'keyword (lambda (key)&#xA;                           (when (string= (org-element-property :key key) &quot;PROPERTY&quot;)&#xA;                             (org-element-property :value key)))))&#xA;    ;;(p (org-element-property nil headline))&#xA;    ;;(a (org-export-read-attribute :attr_mine headline))&#xA;    )&#xA;    (format &quot;%s: [%s] %s&quot; full-text (mapconcat #'identity vals &quot;,&quot;) contents)))&#xA;&#xA;;; test:&#xA;&#xA;(let ((headline '(headline (:raw-value nil) (section (:begin 436 :end 1516 :contents-begin 436 :contents-end 1516 :post-blank 0 :post-affiliated 436 :parent nil) (keyword (:key &quot;PROPERTY&quot; :value &quot;findme a&quot; :begin 436 :end 459 :post-blank 0 :post-affiliated 436 :parent nil)) (keyword (:key &quot;PROPERTY&quot; :value &quot;findother b&quot; :begin 459 :end 486 :post-blank 1 :post-affiliated 459 :parent nil))))))&#xA;  (org-mine-headline headline &quot; contents &quot; nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-06-01T17:24:02.123" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22708" PostTypeId="2" ParentId="22705" CreationDate="2016-06-01T17:28:43.703" Score="4" Body="&lt;p&gt;Another option is to use the &lt;a href=&quot;https://github.com/abo-abo/tiny&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;tiny&lt;/code&gt;&lt;/a&gt; package (also available from Melpa).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m1\n90|%d = &quot;go %d&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Simply type the above and do &lt;code&gt;M-x tiny-expand&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below linked reference to another emacs.SE Q&amp;amp;A provides details on how to use this &lt;em&gt;tiny&lt;/em&gt; syntax.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://i.stack.imgur.com/NeBkz.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NeBkz.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &lt;a href=&quot;https://emacs.stackexchange.com/a/17886/115&quot;&gt;Solution to &lt;em&gt;Enumerating with multiple cursors?&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-06-01T17:39:54.893" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22709" PostTypeId="1" AcceptedAnswerId="22711" CreationDate="2016-06-01T18:16:17.487" Score="9" ViewCount="468" Body="&lt;p&gt;I am trying to use &lt;code&gt;C-h k&lt;/code&gt; to describe the function to which a key is bound. But when I use it with a key chord like &lt;code&gt;C-u C-e C-x&lt;/code&gt; it retrieves the documentation for &lt;code&gt;C-u&lt;/code&gt; before I can finish typing the chord. What is the correct way to describe this type of chord?&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="105" LastEditDate="2024-01-01T17:39:44.077" LastActivityDate="2024-01-01T17:39:44.077" Title="How to describe a key sequence that starts with `C-u`?" Tags="|key-bindings|help|prefix-argument|universal-argument|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22710" PostTypeId="1" CreationDate="2016-06-01T19:27:58.833" Score="1" ViewCount="52" Body="&lt;p&gt;I want to use RefTex with newclude. In particular I want Reftex to recognize \include* as a legitimate include file command. I've already added include* in Reftex include file command but it doesn't seem to effect anything. In particular I still get empty reference select buffer. When I change \include* to \include, it finds the references. How can I make Reftex recognize \include* ?&lt;/p&gt;&#xA;" OwnerUserId="12246" LastActivityDate="2016-06-01T19:27:58.833" Title="Reftex compatibility with newclude" Tags="|auctex|reftex-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22711" PostTypeId="2" ParentId="22709" CreationDate="2016-06-01T20:59:55.970" Score="11" Body="&lt;p&gt;Prefix keys like C-u may be described in the function body. You should therefore ignore such prefix keys when using C-h k to describe a function.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-06-01T20:59:55.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22712" PostTypeId="2" ParentId="22669" CreationDate="2016-06-01T21:06:49.460" Score="1" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_R[:session *myRSession* :exports results :results raw value replace]{length(unique(someDataFrame$SomeVariable[someDataFrame$conditionVariable == &quot;1&quot;]))}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will &lt;code&gt;replace&lt;/code&gt; the &lt;code&gt;results&lt;/code&gt; on each run. You should see &lt;code&gt;12&lt;/code&gt; only once no matter how many times you evaluate that inline function.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-06-01T21:06:49.460" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22713" PostTypeId="1" AcceptedAnswerId="22715" CreationDate="2016-06-01T22:02:07.003" Score="0" ViewCount="198" Body="&lt;p&gt;php-mode is not indenting delimiter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php&#xA;// Not indenting PHP delimiter&#xA;&#xA;if (true) {&#xA;    echo 'foo';&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to indent delimiter?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php&#xA;    // Indenting PHP delimiter&#xA;&#xA;    if (true) {&#xA;        echo 'foo';&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tryed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-php-indent-setup ()&#xA;  (c-set-offset 'cpp-macro '+))&#xA;&#xA;(add-hook 'php-mode-hook 'my-php-indent-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But does nothing, and if I do it manually &lt;code&gt;C-c C-o RET cpp-macro RET + RET&lt;/code&gt; it doesn't exactly do what I expected. I also tryed &lt;code&gt;topmost-intro&lt;/code&gt; instead &lt;code&gt;cpp-macro&lt;/code&gt;, but neither do what I expected.&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2016-06-01T23:51:32.633" LastActivityDate="2016-06-02T03:48:31.107" Title="How to indent php delimiter in php-mode?" Tags="|indentation|php-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22714" PostTypeId="2" ParentId="22666" CreationDate="2016-06-02T01:41:19.787" Score="1" Body="&lt;p&gt;Ok I was leaning how &lt;em&gt;php-mode&lt;/em&gt; handles indentation, and also I looked into &lt;code&gt;php-mode.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem was that &lt;code&gt;(add-hook 'php-mode-hook 'php-enable-symfony2-coding-style)&lt;/code&gt; sets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq indent-tabs-mode nil&#xA;        fill-column 78&#xA;        c-indent-comments-syntactically-p t&#xA;        require-final-newline t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... before &lt;code&gt;(c-set-style &quot;symfony2&quot;)&lt;/code&gt;, so it is overriding how you configured &lt;code&gt;indent-tabs-mode&lt;/code&gt; before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve the problem, you can just discard &lt;code&gt;php-enable-symfony2-coding-style&lt;/code&gt; and use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'php-mode-hook '(lambda ()&#xA;                            (setq tab-width 4&#xA;                                  indent-tabs-mode t)&#xA;                            (c-set-style &quot;symfony2&quot;)&#xA;                            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11856" LastActivityDate="2016-06-02T01:41:19.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22715" PostTypeId="2" ParentId="22713" CreationDate="2016-06-02T03:33:16.510" Score="1" Body="&lt;p&gt;This worked for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-php-indent-setup ()&#xA;    (c-set-offset 'topmost-intro '+) ; Does not affect &amp;lt;?php (but affects ?&amp;gt;)&#xA;    (c-set-offset 'inclass 0))       ; Gets the inside of class{} back to normal&#xA;&#xA;(add-hook 'php-mode-hook 'my-php-indent-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the closing tag &lt;code&gt;?&amp;gt;&lt;/code&gt; will not be indented in the same level as &lt;code&gt;&amp;lt;?php&lt;/code&gt; does, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php&#xA;    // Indenting PHP delimiter&#xA;&#xA;    if (true) {&#xA;        echo 'foo';&#xA;    }&#xA;&#xA;    ?&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyways some PHP coding standards recommend to not include &lt;code&gt;?&amp;gt;&lt;/code&gt; in pure PHP files.&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2016-06-02T03:48:31.107" LastActivityDate="2016-06-02T03:48:31.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22716" PostTypeId="2" ParentId="10033" CreationDate="2016-06-02T04:21:30.477" Score="1" Body="&lt;p&gt;Here's a variation on another &lt;a href=&quot;https://emacs.stackexchange.com/a/14658/780&quot;&gt;answer&lt;/a&gt; that might help. This example remaps &lt;code&gt;mode-line-buffer-id&lt;/code&gt; to be green in inactive buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun toggle-mode-line-buffer-id-face (window)&#xA;  &quot;Update the `mode-line-buffer-id' face in WINDOW dependening on&#xA;whether the window is selected.&quot;&#xA;  (with-current-buffer (window-buffer window)&#xA;(if (eq (current-buffer) (window-buffer (selected-window)))&#xA;    (face-remap-reset-base 'mode-line-buffer-id)&#xA;  (face-remap-set-base 'mode-line-buffer-id '(:foreground &quot;green&quot;)))))&#xA;&#xA;(add-hook 'buffer-list-update-hook (lambda () (walk-windows #'toggle-mode-line-buffer-id-face nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt;  As noted in the comments, this does not entirely solve the problem. When you have several visible windows visiting the same buffer, they will all share the same face.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-06-02T13:04:26.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22717" PostTypeId="1" AcceptedAnswerId="22718" CreationDate="2016-06-02T05:45:26.833" Score="27" ViewCount="16535" Body="&lt;p&gt;I just began using emacs a few days ago and I read somewhere that &lt;code&gt;(require 'package-name)&lt;/code&gt; is not needed when the said package is installed using package-install. But why, what does &lt;code&gt;(require 'package-name)&lt;/code&gt; actually do and how does it differ from &lt;code&gt;load-file&lt;/code&gt; or &lt;code&gt;load&lt;/code&gt; procedures ?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-10-18T08:29:03.903" LastActivityDate="2016-10-18T08:29:03.903" Title="What does (require 'package) mean for emacs and how does it differ from load-file?" Tags="|package|libraries|require|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22718" PostTypeId="2" ParentId="22717" CreationDate="2016-06-02T06:16:56.687" Score="28" Body="&lt;p&gt;If you &lt;code&gt;load&lt;/code&gt; a library repeatedly, that file will be read and its code evaluated repeatedly (each and every time you load it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you &lt;code&gt;require&lt;/code&gt; a library repeatedly, it will &lt;code&gt;load&lt;/code&gt; the library once (at most -- and not at all if the library had already been loaded).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;require&lt;/code&gt; provides this efficiency even if &lt;code&gt;require&lt;/code&gt; wasn't used to load the library initially, because (the vast majority of) libraries contain the code &lt;code&gt;(provide 'FEATURE)&lt;/code&gt; for their particular &lt;code&gt;FEATURE&lt;/code&gt; name. That code is evaluated when the library is loaded, &lt;em&gt;regardless&lt;/em&gt; of how it was loaded, and at that time it updates the data which &lt;code&gt;require&lt;/code&gt; checks when deciding whether it needs to do anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Mostly&lt;/em&gt; you want to use &lt;code&gt;require&lt;/code&gt; in your own code, if you need to ensure that a given library has been loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you often don't need to do this with ELPA packages is that the package manager automatically processes any &lt;em&gt;autoload cookies&lt;/em&gt; in the package, and generates a file of autoloads for that package. When the package system is initialised when you start Emacs, the autoload file for each package is evaluated, which identifies all of the autoloaded functions. When an autoloaded function is called, the library which contains the &lt;em&gt;real&lt;/em&gt; definition of the function is automatically loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Package authors can add an autoload cookie to each function which the user might be expected to call directly and so, provided that their expectations were correct, you will not need to call &lt;code&gt;require&lt;/code&gt; or otherwise explicitly load the package in order to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can also define your own custom autoloads. See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Autoload&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; and also &lt;code&gt;(elisp) Hooks for Loading&lt;/code&gt; if you wish to use custom lazy-loading and deferred configuration of libraries in your own config. (The latter to say &quot;don't evaluate this code until this library has been loaded&quot;, which ties in nicely with the &quot;don't load this library until it's needed&quot; autoload mechanism).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-02T07:33:42.953" LastActivityDate="2016-06-02T07:33:42.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22719" PostTypeId="2" ParentId="14643" CreationDate="2016-06-02T08:11:29.773" Score="-1" Body="&lt;p&gt;&lt;code&gt;zjl-hl.el&lt;/code&gt; on &lt;a href=&quot;https://www.emacswiki.org/emacs/JianliZhao&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/JianliZhao&lt;/a&gt; exactly matches your need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The current default color theme is designed to be used with a white background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3N6O6.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3N6O6.jpg&quot; alt=&quot;zjl-hl screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12253" LastEditorUserId="97" LastEditDate="2018-03-13T21:30:16.660" LastActivityDate="2018-03-13T21:30:16.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22720" PostTypeId="1" AcceptedAnswerId="22721" CreationDate="2016-06-02T10:54:47.680" Score="2" ViewCount="819" Body="&lt;p&gt;I started to use emacs a few days ago and still getting the hang of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;desktop-save-mode is really handy at times as I don't have to reopen all the files that I had already opened in my previous session. But, I wouldn't want emacs to remember the open buffers every time I quit a session. So, is there a way to make emacs prompt to ask yes or no to invoke desktop-save-mode before quitting ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="105" LastEditDate="2016-08-10T21:53:53.407" LastActivityDate="2016-08-10T21:53:53.407" Title="How to make emacs prompt yes or no to save the session when desktop-save-mode is on?" Tags="|desktop|session|quitting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22721" PostTypeId="2" ParentId="22720" CreationDate="2016-06-02T11:20:49.433" Score="3" Body="&lt;p&gt;My answer at &lt;a href=&quot;https://stackoverflow.com/a/4485083/324105&quot;&gt;https://stackoverflow.com/a/4485083/324105&lt;/a&gt; might be of interest (even though this is almost the opposite to what you actually asked for).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the custom &lt;code&gt;my-desktop&lt;/code&gt; command, I only load my desktop file when I &lt;em&gt;want&lt;/em&gt; to do that. Once loaded, I &lt;em&gt;do&lt;/em&gt; automatically save it (but to my mind, if I loaded a desktop file, why wouldn't I want to save it?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point being that if you start Emacs and don't want to load and save your desktop file, then you simply don't call &lt;code&gt;my-desktop&lt;/code&gt;, and no desktop file is written when you exit.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-06-02T11:20:49.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22722" PostTypeId="1" AcceptedAnswerId="22729" CreationDate="2016-06-02T14:14:38.163" Score="1" ViewCount="835" Body="&lt;p&gt;I use this function for tangling my init.el file&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun tangle-init ()&#xA;    &quot;If the current buffer is 'init.org' the code-blocks are tangled, and the tangled file is compiled.&quot;&#xA;    (when (equal (buffer-file-name) (expand-file-name (concat user-emacs-directory &quot;init.org&quot;)))&#xA;      (let ((prog-mode-hook nil)) ;; Avoid running hooks when tangling.&#xA;        (org-babel-tangle-file buffer-file-name (concat user-emacs-directory &quot;init.el&quot;) &quot;emacs-lisp&quot;)&#xA;        (byte-compile-file (concat user-emacs-directory &quot;init.el&quot;)))))&#xA;(add-hook 'after-save-hook 'tangle-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That code works well but it take a lot of time. So I would like to execute this function with async librairie (&lt;a href=&quot;https://github.com/jwiegley/emacs-async&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jwiegley/emacs-async&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried something like this but doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'async)&#xA;  (defun tangle-init-async ()&#xA;    &quot;If the current buffer is 'init.org' the code-blocks are tangled, and the tangled file is compiled.&quot;&#xA;    (when (equal (buffer-file-name) (expand-file-name (concat user-emacs-directory &quot;init.org&quot;)))&#xA;      (async-start&#xA;       (lambda ()&#xA;         (let ((prog-mode-hook nil)) ;; Avoid running hooks when tangling.&#xA;           (org-babel-tangle-file buffer-file-name (concat user-emacs-directory &quot;init.el&quot;) &quot;emacs-lisp&quot;)&#xA;           (byte-compile-file (concat user-emacs-directory &quot;init.el&quot;)))))))&#xA;  (add-hook 'after-save-hook 'tangle-init-async)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any help appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2016-06-02T14:47:01.840" LastActivityDate="2016-06-03T07:44:37.010" Title="tangle init file async" Tags="|async|org-mode|tangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22724" PostTypeId="1" AcceptedAnswerId="23891" CreationDate="2016-06-02T18:48:13.753" Score="2" ViewCount="286" Body="&lt;p&gt;I use the function &lt;code&gt;bbdb&lt;/code&gt; or &lt;code&gt;bbdb-name&lt;/code&gt; to search for a particular record in my database using a regexp.  Due to muscle-memory, I routinely hit the &lt;code&gt;tab&lt;/code&gt; key inside the mini-buffer expecting to have auto-completion, but that feature appears to be lacking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  Is there an alternative function that would enable auto-completion to help locate records matching a particular regexp?  If not, a suggested modification of the source code to achieve that goal would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-06-04T19:11:31.797" LastActivityDate="2016-06-12T19:28:13.693" Title="bbdb -- searching for a name by regex with tab auto-completion" Tags="|bbdb|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22725" PostTypeId="2" ParentId="22657" CreationDate="2016-06-02T23:06:55.293" Score="5" Body="&#xA;&#xA;&lt;p&gt;The problem was that I did&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'tex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-auto-local &quot;.auctex-auto&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In AUCTeX, the definition of &lt;code&gt;TeX-style-path&lt;/code&gt; is via a &lt;code&gt;defcustom&lt;/code&gt; form, which sets &lt;code&gt;TeX-style-path&lt;/code&gt; to the result of evaluating an expression that builds up a list by referring to the values of &lt;code&gt;TeX-auto-local&lt;/code&gt; and similar variables.  &lt;code&gt;(require 'tex)&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; setting &lt;code&gt;TeX-auto-local&lt;/code&gt;, the value of &lt;code&gt;TeX-style-path&lt;/code&gt; got set to a value that referenced the &lt;em&gt;old&lt;/em&gt; value of &lt;code&gt;TeX-auto-local&lt;/code&gt;, and was never reinitialized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remove the &lt;code&gt;(require 'tex)&lt;/code&gt;, or simply move &lt;code&gt;(setq TeX-auto-local &quot;.auctex-auto&quot;)&lt;/code&gt; before it (there are later parts of my config that require it to be loaded), then everything works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to &lt;a href=&quot;https://emacs.stackexchange.com/a/3024/5295&quot;&gt;re-initialize &lt;code&gt;TeX-style-path&lt;/code&gt;&lt;/a&gt;, about which see the next section.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;One piece of the mysteriousness, though, is that &lt;code&gt;describe-variable&lt;/code&gt; (&lt;kbd&gt;C-h v&lt;/kbd&gt;) for &lt;code&gt;TeX-style-path&lt;/code&gt; claimed (reformatted):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;TeX-style-path is a variable defined in `tex.el'.&#xA;Its value is&#xA;(&quot;/usr/local/var/auctex&quot; &quot;/Users/antal/.emacs.d/elpa/auctex-11.89.4/style&quot;&#xA; &quot;/Users/antal/.emacs.d/auctex/auto&quot; &quot;/Users/antal/.emacs.d/auctex/style&quot;&#xA; &quot;auto&quot; &quot;style&quot;)&#xA;&#xA;Original value was &#xA;(&quot;/usr/local/var/auctex&quot; &quot;/Users/antal/.emacs.d/elpa/auctex-11.89.4/style&quot;&#xA; &quot;/Users/antal/.emacs.d/auctex/auto&quot; &quot;/Users/antal/.emacs.d/auctex/style&quot;&#xA; &quot;.auctex-auto&quot; &quot;style&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why was the &quot;original value&quot; different if nothing had ever changed &lt;code&gt;TeX-style-path&lt;/code&gt;?  The answer is that &lt;code&gt;defcustom&lt;/code&gt; stores, not the initial value of a variable, but the initial &lt;em&gt;expression&lt;/em&gt; that created it, and re-&lt;code&gt;eval&lt;/code&gt;s it to see if the &quot;original value&quot; was different.  Since one of the variables that &lt;code&gt;TeX-style-path&lt;/code&gt;'s definition referenced was the now-changed &lt;code&gt;TeX-auto-local&lt;/code&gt;, the &quot;original value&quot; was &lt;em&gt;inaccurate&lt;/em&gt; upon recomputation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is also why it's possible to &lt;a href=&quot;https://emacs.stackexchange.com/a/3024/5295&quot;&gt;reset the value of &lt;code&gt;TeX-style-path&lt;/code&gt; to its &quot;default&quot; value&lt;/a&gt;, as mentioned above.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For reference, the &lt;code&gt;defcustom&lt;/code&gt; form that sets &lt;code&gt;TeX-style-path&lt;/code&gt; to its default value in AUCTeX version 11.89.4:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defcustom TeX-style-path&#xA;  (let ((path))&#xA;    ;; Put directories in an order where the more local files can&#xA;    ;; override the more global ones.&#xA;    (mapc (lambda (file)&#xA;            (when (and file (not (member file path)))&#xA;              (setq path (cons file path))))&#xA;          (append (list TeX-auto-global TeX-style-global)&#xA;                  TeX-auto-private TeX-style-private&#xA;                  (list TeX-auto-local TeX-style-local)))&#xA;    (nreverse path))&#xA;  &quot;List of directories to search for AUCTeX style files.&#xA;Per default the list is built from the values of the variables&#xA;`TeX-auto-global', `TeX-style-global', `TeX-auto-private',&#xA;`TeX-style-private', `TeX-auto-local', and `TeX-style-local'.&quot;&#xA;  :group 'TeX-file&#xA;  :type '(repeat (file :format &quot;%v&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As we can see, it references &lt;code&gt;TeX-auto-local&lt;/code&gt;, and this is the &lt;em&gt;only&lt;/em&gt; place that &lt;code&gt;TeX-style-path&lt;/code&gt; is set.&lt;/p&gt;&#xA;" OwnerUserId="5295" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-06-02T23:06:55.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22726" PostTypeId="2" ParentId="22687" CreationDate="2016-06-03T04:33:16.777" Score="1" Body="&lt;p&gt;I have been trying out things since posting the question.  I came up with what works for me.  eshell alias felt too complicated.  Perhaps even this is too complicated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (eq system-type 'windows-nt)&#xA;  (defun eshell/w32-launch (&amp;amp;rest args)&#xA;    (w32-browser (if (eq nil args)&#xA;                     &quot;.&quot;&#xA;                     (car args)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10924" LastActivityDate="2016-06-03T04:33:16.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22727" PostTypeId="1" CreationDate="2016-06-03T07:24:40.183" Score="4" ViewCount="783" Body="&lt;p&gt;I'm using some &lt;code&gt;VBA&lt;/code&gt; scripts which copy Text in &lt;code&gt;MS Outlook&lt;/code&gt; from an e-mail message and send it to the clipboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I then paste the clipboard content with &lt;code&gt;Ctrl-Y&lt;/code&gt; in &lt;code&gt;Emacs 24.5.1&lt;/code&gt; in &lt;code&gt;Windows 7&lt;/code&gt;, the linebreaks are missing and I see a red &lt;em&gt;^M&lt;/em&gt; instead in my emacs buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to directly insert linebreaks or convert the text in emacs to the &quot;normal&quot; encoding?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current settings in my .emacs file are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; file encoding utf-8 preferred&#xA;(prefer-coding-system 'utf-8)&#xA;(setq coding-system-for-read 'utf-8)&#xA;(setq coding-system-for-write 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;However:&lt;/strong&gt; If I copy a text from an e-Mail in &lt;code&gt;MS Outlook&lt;/code&gt; to the Clipboard with &lt;code&gt;Ctrl-C&lt;/code&gt; and paste it in an emacs-buffer with &lt;code&gt;Ctrl-Y&lt;/code&gt;, the linebreaks are ok.&lt;/p&gt;&#xA;" OwnerUserId="9258" LastEditorUserId="9258" LastEditDate="2016-09-30T11:58:51.457" LastActivityDate="2019-03-27T21:03:17.927" Title="Pasting Text from Clipboard - why ^M instead of linebreaks?" Tags="|microsoft-windows|character-encoding|copy-paste|line-break|clipboard|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22728" PostTypeId="1" AcceptedAnswerId="22730" CreationDate="2016-06-03T07:40:09.773" Score="13" ViewCount="887" Body="&lt;p&gt;When I have a buffer with unsaved changes, magit asks for each and every action to save that changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't save that changes on purpose, so is there a way to disable this behaviour? My Magit should simply ignore unsaved changes.&lt;/p&gt;&#xA;" OwnerUserId="2037" LastEditorUserId="2037" LastEditDate="2016-06-03T13:38:46.457" LastActivityDate="2016-07-02T23:23:17.753" Title="Magit: don't ask to save changes" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22729" PostTypeId="2" ParentId="22722" CreationDate="2016-06-03T07:44:37.010" Score="0" Body="&lt;p&gt;I find a solution adapt from  &lt;a href=&quot;https://github.com/bixuanzju/emacs.d/blob/master/emacs-init.org&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bixuanzju/emacs.d/blob/master/emacs-init.org&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/emacs-async/&quot;)&#xA;  (require 'async)&#xA;  (defun tangle-init-async ()&#xA;    &quot;If the current buffer is 'emacs-init.org' the code-blocks are tangled.&quot;&#xA;    (when (equal (buffer-file-name) (expand-file-name (concat user-emacs-directory &quot;init.org&quot;)))&#xA;      (async-start&#xA;       `(lambda ()&#xA;          (require 'org)&#xA;          (org-babel-tangle-file (expand-file-name (concat user-emacs-directory &quot;init.org&quot;)) (expand-file-name (concat user-emacs-directory &quot;init.el&quot;) &quot;emacs-lisp&quot;))&#xA;          )&#xA;       (lambda (result)&#xA;         (byte-compile-file (expand-file-name (concat user-emacs-directory &quot;init.el&quot;)))&#xA;         (message &quot;Tangled file compiled.&quot;)))))&#xA;  (add-hook 'after-save-hook 'tangle-init-async)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to bixuanzju (Jeremy Bi)&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-06-03T07:44:37.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22730" PostTypeId="2" ParentId="22728" CreationDate="2016-06-03T08:09:39.200" Score="17" Body="&lt;p&gt;Magit has a variable called &lt;code&gt;magit-save-repository-buffers&lt;/code&gt; that is by default set to &lt;code&gt;t&lt;/code&gt;. Try setting it to &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2016-06-03T08:09:39.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22731" PostTypeId="2" ParentId="22727" CreationDate="2016-06-03T08:37:44.800" Score="5" Body="&lt;p&gt;The linebreaks are missing because there is a conflict between your coding system on the desktop and your emacs setup. Emacs can be configured to have different coding systems for the terminal, keyboard and clipboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try to set your clipboard coding system and selection coding system to &lt;code&gt;utf-16-le&lt;/code&gt;, i.e.,:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (eq system-type 'windows-nt)&#xA;    (progn&#xA;      (set-clipboard-coding-system 'utf-16-le)&#xA;      (set-selection-coding-system 'utf-16-le))&#xA;  (set-selection-coding-system 'utf-8))&#xA;(setq locale-coding-system 'utf-8)&#xA;(set-terminal-coding-system 'utf-8)&#xA;(set-keyboard-coding-system 'utf-8)&#xA;(prefer-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2016-06-03T08:37:44.800" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22732" PostTypeId="2" ParentId="22656" CreationDate="2016-06-03T09:35:55.653" Score="3" Body="&lt;p&gt;It looks like adding &lt;code&gt;(package-initialize) (require 'ob-ipython)&lt;/code&gt; to my &lt;code&gt;.emacs&lt;/code&gt; solved the problem! &lt;/p&gt;&#xA;" OwnerUserId="7199" LastEditorUserId="7199" LastEditDate="2016-06-03T10:16:39.730" LastActivityDate="2016-06-03T10:16:39.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22733" PostTypeId="1" AcceptedAnswerId="26209" CreationDate="2016-06-03T11:38:19.147" Score="1" ViewCount="728" Body="&lt;p&gt;I have tramp configured to work automatically with SSH key and all, but I am having this message too often:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;byte-code: Args out of range: #&amp;lt;buffer *tramp/ssh gs*&amp;gt;, 60, 14056&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To solve it temporarily I just kill the tramp buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;* *tramp/ssh gs*         9994 Fundamental&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In *Buffer List* I apply D and X to kill this buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I just keep working, tramp will reconnect automatically when I save. In a matter of 5-30 minutes, the message reappears and I have to kill the tramp buffer again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I have a more fluent working without having to be killing the tramp buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to recover automatically each time the connection droops?&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2016-09-10T03:46:39.767" LastActivityDate="2016-09-10T03:46:39.767" Title="Emacs tramp &quot;args out of range&quot; too often, how to recover connection automatically?" Tags="|tramp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22735" PostTypeId="1" CreationDate="2016-06-03T12:48:04.920" Score="2" ViewCount="2149" Body="&lt;p&gt;I am using Org-mode in conjunction with an Android tablet. I have customized Org-mode and keep files in Dropbox. After sync the Android side is not implementing any customization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Copied this code to the head of the file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-log-into drawer &quot;LOGBOOK&quot;)&#xA;(setq org-use-fast-todo-selection '(prefix))&#xA;(SETQ ORG-todo-keywords&#xA;          '((sequence &quot;TODO(t!)&quot; &quot;|&quot; &quot;DONE(d!)&quot; &quot;REPEAT(r!)&quot;)))&#xA;(setq org-todo-keyword-faces&#xA;          '((&quot;TODO&quot; . org-warning)&#xA;            (&quot;DONE&quot; . &quot;yellow&quot;)&#xA;            (&quot;REPEAT&quot; . (:foreground &quot;blue&quot; :weight bold)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it does not get implemented in the Android side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="12265" LastEditorUserId="115" LastEditDate="2016-06-03T15:04:29.080" LastActivityDate="2016-06-05T02:21:46.430" Title="How to customise Org-mode per file (and sync with Orgzly)" Tags="|org-mode|files|customize|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22736" PostTypeId="1" AcceptedAnswerId="24580" CreationDate="2016-06-03T13:35:17.223" Score="3" ViewCount="1861" Body="&lt;p&gt;On &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 25.1.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2016-04-25&lt;br&gt;&#xA;  Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/25.1.50/lisp/org/)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;opening a pdf file link (f.ex. &lt;code&gt;[[./9.pdf]]&lt;/code&gt;) via &lt;kbd&gt;C-c C-o&lt;/kbd&gt;  automatically opens that file in docview-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can this be disabled?&lt;/strong&gt; (Or is this a bug? Where to submit?)&lt;/p&gt;&#xA;" OwnerUserId="8431" LastActivityDate="2019-10-28T11:18:23.157" Title="Org-mode: How to disable automatic doc-view on emacs-25" Tags="|org-mode|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22737" PostTypeId="2" ParentId="22699" CreationDate="2016-06-03T13:48:13.480" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt; twb knows all!  Tell your friends!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Thanks to helpful advises from @twb from #emacs IRC channel. Here's solution for such cases.&lt;/em&gt; Bug was in escape sequences which used use for &lt;code&gt;ghci&lt;/code&gt; promt. It was expect that terminal will be &lt;code&gt;xterm&lt;/code&gt;-compatible. But it don't. More proper way is to use &lt;code&gt;tput&lt;/code&gt; like &lt;code&gt;set_fg_red=$(tput setaf 1) reset=$(tput sgr0)&lt;/code&gt; or check &lt;code&gt;$TERM&lt;/code&gt; for compatibility (such like vt100, dumb, emacs).&lt;/p&gt;&#xA;" OwnerUserId="210" LastActivityDate="2016-06-03T13:48:13.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22738" PostTypeId="2" ParentId="22736" CreationDate="2016-06-03T15:13:29.077" Score="0" Body="&lt;p&gt;The thing that determines what mode a file opens in is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Auto-Major-Mode.html#index-auto_002dmode_002dalist&quot; rel=&quot;nofollow&quot;&gt;auto-mode-alist&lt;/a&gt;. So we just need to add something to that list that will tell Emacs to use a different mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What mode do you want .pdf files to open as? For this answer, I'll assume you want to use &lt;code&gt;fundamental-mode&lt;/code&gt;. This won't render the pdf well, but you will be able to view the contents of the pdf. Add this code to your init file, and eval it or restart Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.pdf\\'&quot; . fundamental-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As mentioned, you'll want to replace &lt;code&gt;fundamental-mode&lt;/code&gt; with the mode you want pdfs to open in.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-06-03T15:13:29.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22739" PostTypeId="1" CreationDate="2016-06-03T20:25:04.933" Score="2" ViewCount="391" Body="&lt;p&gt;I can't find a concise answer to this question, only big manuals for which I'm not sure reading them will give me the answer...&#xA;Spacemacs &amp;amp; haskell-mode are now giving me tag navigation by default (appeared with a MELPA upgrade, it's a feature I didn't have before).&#xA;I'm using it now, however each time I change folder with tag navigation, emacs is asking:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Keep current list of tags tables also? (y or n)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've seen &lt;a href=&quot;https://emacs.stackexchange.com/questions/14802/never-keep-current-list-of-tags-tables-also&quot;&gt;that other question&lt;/a&gt; and so I see that the &lt;code&gt;tags-add-tables&lt;/code&gt; setting is the way to go, however I honestly have no idea whether I want to answer yes or no... Is there a builtin emacs manual I can look at with brief information on the topic of tag tables, that would explain which is the compromise here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Honestly I would expect &lt;code&gt;spacemacs&lt;/code&gt;, or maybe &lt;code&gt;haskell-mode&lt;/code&gt; to make that decision for me :-(&lt;/p&gt;&#xA;" OwnerUserId="2592" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2020-02-13T14:06:50.697" Title="tags-add-tables / list of tag tables" Tags="|spacemacs|ctags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22740" PostTypeId="1" AcceptedAnswerId="26245" CreationDate="2016-06-03T20:33:05.947" Score="2" ViewCount="167" Body="&lt;p&gt;using &lt;code&gt;spacemacs&lt;/code&gt; in java mode, moving the mouse over an email address displays in the modeline the text &lt;code&gt;mouse-1, C-c RET: mail this address&lt;/code&gt;. And if I click on it, a blank email sending form is opened in emacs (strangely enough that doesn't happen in haskell mode or fundamental).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My issue is that while I don't use the mouse much when using emacs, I often use it to focus the emacs window. And if there's somehow an email address exactly where I click, I open that email compose buffer, which is never what I want, because (at this point) I don't use emacs for email sending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I disable that &quot;click to compose an email&quot; feature?&lt;/p&gt;&#xA;" OwnerUserId="2592" LastActivityDate="2016-08-13T12:20:47.747" Title="disable on-click mail sending in java mode" Tags="|spacemacs|gnus|java|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22741" PostTypeId="2" ParentId="22736" CreationDate="2016-06-03T23:04:43.190" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I wanted it to use the previous behavior: the system's pdf viewer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then restore the original value of the variable &lt;code&gt;org-file-apps&lt;/code&gt; to contain:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((auto-mode . emacs)&#xA; (&quot;\\.pdf\\'&quot; . default))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So whatever is the default viewer on your linux system will be used. To go back to doc-view, put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.pdf\\'&quot; . doc-view-mode-maybe))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In any case, as others have pointed out, you'll have to  bisect your init file to see what or where your defaults are being changed.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-06-03T23:10:53.237" LastActivityDate="2016-06-03T23:10:53.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22742" PostTypeId="1" AcceptedAnswerId="23866" CreationDate="2016-06-03T23:43:25.843" Score="1" ViewCount="299" Body="&lt;p&gt;I want to check if there is an update for the &lt;code&gt;org&lt;/code&gt; package every time my emacs daemon starts. I was looking at package.el for clues on how to check if the current version of a package was older than the version available in the package repository of GNU and Org, but I couldn't follow the code in &lt;code&gt;package-menu--find-upgrades&lt;/code&gt;, so I'm not sure how should I get the package version of the installed package and the version of the package available for the upgrade.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="105" LastEditDate="2016-06-10T04:41:29.683" LastActivityDate="2016-06-10T13:55:02.870" Title="How to guess what version of a package is available on Melpa?" Tags="|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22743" PostTypeId="1" CreationDate="2016-06-03T23:45:23.830" Score="2" ViewCount="625" Body="&lt;p&gt;In Emacs Lisp, how to write an Emacs Lisp function to convert a natural number from roman numerals representation to the equivalent Emacs Lisp integer value? The Emacs Lisp function should be callable from Emacs Lisp and return an Emacs Lisp integer object for further processing in an Emacs Lisp program. I would like to accomplish this with Emacs Lisp, so I'm not expecting answers written as keyboard macros, other Lisp dialects, or shell scripts. Answers written as one or more Emacs Lisp functions would be ideal, thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I gather data from all kinds of sources, and occasionally people use numbers written as roman numerals. Such numbers are not very useful for sorting and comparing with numbers in other forms. I decided it should be doable in Lisp, but if Emacs contains any function to do the conversion, I could not find it. (Maybe it is in an external library?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the most applicable solution I found via a general web search:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.rosettacode.org/wiki/Roman_numerals/Decode#Emacs_Lisp&quot; rel=&quot;nofollow&quot;&gt;https://www.rosettacode.org/wiki/Roman_numerals/Decode#Emacs_Lisp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this function expects the number to be encoded as one Emacs Lisp symbol per digit, or a list of such symbol encoded digits. When dealing with web data, file names, or most other sources the roman numerals will most likely be in an Emacs Lisp string object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution: Write a wrapper function to convert a string into symbol or list of symbols as required for the funciton linked above. (Is this really the best way?)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ro2ar (RN)&#xA;  &quot;translate a roman number RN into arabic number. &#xA;    Its argument RN is wether a symbol, wether a list. &#xA;    Returns the arabic number. (ro2ar 'C) gives 100, &#xA;    (ro2ar '(X X I V)) gives 24&quot; &#xA;  (cond &#xA;   ((eq RN 'M) 1000)&#xA;   ((eq RN 'D) 500)&#xA;   ((eq RN 'C) 100)&#xA;   ((eq RN 'L) 50)&#xA;   ((eq RN 'X) 10)&#xA;   ((eq RN 'V) 5)&#xA;   ((eq RN 'I) 1)&#xA;   ((null (cdr RN)) (ro2ar (car RN))) ;; stop recursion&#xA;   ((&amp;lt; (ro2ar (car RN)) (ro2ar (car (cdr RN)))) (- (ro2ar (cdr RN)) (ro2ar (car RN)))) ;; &quot;IV&quot; -&amp;gt; 5-1=4&#xA;   (t (+ (ro2ar (car RN)) (ro2ar (cdr RN)))))) ;; &quot;VI&quot; -&amp;gt; 5+1=6&#xA;=&amp;gt; ro2ar&#xA;&#xA;(defun roman-numerals-to-integer (rn)&#xA;  &quot;Return the integer value of the natural number represented by RN.&#xA;    RN may be a string, single digit symbol, or list of single digit&#xA;    symbols.&#xA;    URL `https://www.rosettacode.org/wiki/Roman_numerals/Decode#Emacs_Lisp'&quot;&#xA;&#xA;  (ro2ar&#xA;   (if (not (stringp rn))&#xA;       rn&#xA;     (mapcar&#xA;      (lambda (x)&#xA;    (intern (string x)))&#xA;      rn))))&#xA;=&amp;gt; roman-numerals-to-integer&#xA;&#xA;(mapcar 'roman-numerals-to-integer&#xA;    '(M D C L X V I))&#xA;=&amp;gt; (1000 500 100 50 10 5 1)&#xA;&#xA;(roman-numerals-to-integer '(M D C L X V I))&#xA;=&amp;gt; 1666&#xA;&#xA;(roman-numerals-to-integer &quot;MDCLXVI&quot;)&#xA;=&amp;gt; 1666&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="890" LastEditorUserId="105" LastEditDate="2016-06-10T13:18:28.930" LastActivityDate="2016-06-10T13:18:28.930" Title="In Emacs Lisp, how to convert roman numerals to an integer?" Tags="|string|symbols|numbers|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22745" PostTypeId="1" AcceptedAnswerId="23765" CreationDate="2016-06-04T04:16:34.647" Score="8" ViewCount="1098" Body="&lt;p&gt;After creating an org-capture with the %? to place the cursor, the cursor will be in command mode. Is there a variable for putting it into insert mode or does org-capture elisp code need to be directly editted?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;      '((&quot;e&quot; &quot;Example&quot; entry (file+headline &quot;~/org/notes.org&quot; &quot;Example&quot;)&#xA;         &quot;* TODO  %?\n  %u\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="105" LastEditDate="2016-06-10T04:40:56.003" LastActivityDate="2016-06-10T04:40:56.003" Title="Evil mode - How to go into Insert mode after Org-capture with %? cursor placement" Tags="|evil|org-capture|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22746" PostTypeId="1" AcceptedAnswerId="22747" CreationDate="2016-06-04T04:41:11.503" Score="4" ViewCount="525" Body="&lt;p&gt;When I'm writing a comment and press &lt;code&gt;M-j&lt;/code&gt; to continue the comment on the next line (using single-line comments), if I press it multiple times say because I want to leave the next comment line &quot;empty&quot; for separation, the cursor ends up appearing right after the comment delimiter. Instead, I always want the cursor to be separated from the comment delimiter by one space. I'd like this to be the case in every mode, globally if possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, if I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; comment|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I press &lt;code&gt;M-j&lt;/code&gt; I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; comment&#xA;;; |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's correctly separated from the comment delimiter by one space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If without doing anything else I press &lt;code&gt;M-j&lt;/code&gt; again, I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; comment&#xA;;;&#xA;;;|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So from then on there is no space added between the comment delimiter and the cursor. I want there to &lt;em&gt;always&lt;/em&gt; be a space of separation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By comparison, in c++-mode I &lt;em&gt;always&lt;/em&gt; get the space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know if there's a way to get this in other modes (or even all other modes) before I resort to hacking it in by wrapping the function myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I ended up advising &lt;code&gt;comment-indent-new-line&lt;/code&gt; to add one space if there aren't any spaces following the comment-start:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-advice comment-indent-new-line&#xA;    (:after (&amp;amp;optional soft) at-least-one-space)&#xA;  &quot;Ensure that at least one space is added after the comment-start.&quot;&#xA;  (let ((start (regexp-quote comment-start)))&#xA;    (when (and (nth 4 (syntax-ppss))&#xA;               (looking-back start (+ (point) (length start)))&#xA;               (not (looking-back &quot; &quot;  (+ (point) 1))))&#xA;      (insert &quot; &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="8941" LastEditDate="2016-06-11T05:38:46.953" LastActivityDate="2016-06-11T05:38:46.953" Title="add a space after the comment delimiter" Tags="|comment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22747" PostTypeId="2" ParentId="22746" CreationDate="2016-06-04T05:26:35.403" Score="2" Body="&lt;p&gt;I also ran into this issue.  It is caused because in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, &lt;code&gt;comment-start&lt;/code&gt; is &quot;;&quot; whereas in &lt;code&gt;c++-mode&lt;/code&gt;, it is &quot;// &quot; (note the space).  The obvious fix would be to add a space to &lt;code&gt;comment-start&lt;/code&gt; in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.  Unfortunately, this will break many lisp functions which assume that &lt;code&gt;comment-start&lt;/code&gt; does not contain a space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best solution I've found is to use this advice.  You should probably change it to use nadvice.el instead of the old advice system.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice comment-indent-new-line (after just-one-space-after-comment activate)&#xA;  &quot;Make sure that `comment-indent-new-line' does not insert extra spaces.&quot;&#xA;  (when (and (looking-back comment-start)&#xA;             (not (looking-back &quot; &quot;)))&#xA;    (just-one-space)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="7146" LastEditDate="2016-06-04T07:56:03.630" LastActivityDate="2016-06-04T07:56:03.630" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22748" PostTypeId="1" AcceptedAnswerId="22750" CreationDate="2016-06-04T06:23:37.023" Score="0" ViewCount="578" Body="&lt;p&gt;Certain &lt;code&gt;org-mode&lt;/code&gt; buffers seem to write to file automatically when left idle even for a second. I've tried disabling a few minor modes but to no avail. It makes it all the more difficult to debug this since it only happens with a few org-mode buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.1.0, Carbon Version 157 AppKit 1344.72)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Enabled Minor modes in the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Async-Bytecomp-Package Auto-Composition Auto-Fill&#xA;Auto-Revert Blink-Cursor Company Delete-Selection Diff-Auto-Refine Disable-Mouse&#xA;File-Name-Shadow Flx-Ido Font-Lock Global-Auto-Revert Global-Company&#xA;Global-Font-Lock Global-Git-Commit Global-Prettify-Symbols Helm Ido-Everywhere&#xA;Ido-Vertical Line-Number Mac-Mouse-Wheel Magit-Auto-Revert Org-Bullets&#xA;Org-Indent Override-Global Recentf Shell-Dirtrack Show-Paren Smartparens&#xA;Smartparens-Global Tooltip Transient-Mark Window-Numbering Yas Yas-Global&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My configuration is located at &lt;a href=&quot;https://github.com/kirang89/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;https://github.com/kirang89/.emacs.d&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be really awesome if someone could help me out on this one. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="953" LastActivityDate="2016-06-04T09:33:26.077" Title="Certain org-mode buffers keep saving automatically" Tags="|org-mode|auto-save|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22749" PostTypeId="1" CreationDate="2016-06-04T09:14:23.980" Score="3" ViewCount="142" Body="&lt;p&gt;I cannot make it show syntax in the org-mode ledger block. It is just shown with plain text. But if I bring it to the edit buffer, it displays the syntax properly. Can anyone help me to trace this problem?&lt;/p&gt;&#xA;" OwnerUserId="2437" LastActivityDate="2017-12-29T06:54:59.640" Title="No fontify in ledger source block" Tags="|font-lock|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22750" PostTypeId="2" ParentId="22748" CreationDate="2016-06-04T09:33:26.077" Score="2" Body="&lt;p&gt;According to the suggestion by @lawlist, I ran &lt;code&gt;M-x describe-variable RET timer-idle-list RET&lt;/code&gt; to find out that a function named &lt;code&gt;deft-auto-save&lt;/code&gt; ran instantly after Emacs went idle. Setting &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq deft-auto-save-interval 20)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;did the trick. Apparently, this interval matters only for org files that were launched by deft. This explains why the autosaving behaviour wasn't consistent across all org-mode buffers that I dealt with.&lt;/p&gt;&#xA;" OwnerUserId="953" LastActivityDate="2016-06-04T09:33:26.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22751" PostTypeId="2" ParentId="22371" CreationDate="2016-06-04T12:03:16.457" Score="0" Body="&lt;p&gt;I don't think I had problems with timestamps in other languages with non-ASCII characters (e.g. Spanish, Chinese), but sometimes I do encounter similar situations to yours in some buffers, especially on Windows. Maybe the encoding of your particular org-mode buffer was incorrect? You can try to run &lt;code&gt;M-x revert-buffer-with-coding-system&lt;/code&gt;, choose UTF-8, and see what happens. I was able to display the characters correctly in this way.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2016-06-04T12:03:16.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22753" PostTypeId="1" CreationDate="2016-06-04T14:10:28.447" Score="2" ViewCount="465" Body="&lt;p&gt;I have bound &lt;code&gt;TeX-command&lt;/code&gt; to a key &lt;code&gt;f7&lt;/code&gt; to compile my document with &lt;code&gt;latexmk&lt;/code&gt;. When I press it, and it needs to be compiled, it compiles it without asking. If not, views it, without asking (that's because of the -1 option):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f7&amp;gt;&quot;) 'my-run-latex)&#xA;&#xA;(defun my-run-latex ()&#xA;  (interactive)&#xA;  (if (equal current-buffer-hash&#xA;         (setq current-buffer-hash (secure-hash 'md5 (current-buffer))))&#xA;      (TeX-view)&#xA;    (setq TeX-save-query nil)&#xA;    (TeX-save-document (TeX-master-file))&#xA;    (TeX-command &quot;Latexmk&quot; 'TeX-master-file -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now this applies to the tex master file. How can I make it apply to the file in the current buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I also want to have this command bound to another key for compiling the master file. So it wouldn't be a solution to set the current buffer as master file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to replace &lt;code&gt;(TeX-command &quot;Latexmk&quot; 'TeX-master-file -1)&lt;/code&gt; by &lt;code&gt;(TeX-command-buffer &quot;Latexmk&quot;)&lt;/code&gt; which works but doesn't compile without asking. Then I tried to replace it with &lt;code&gt;(TeX-command &quot;Latexmk&quot; 'TeX-master-file -1)&lt;/code&gt; with returns an error message &quot;Wrong number of arguments buffer-file-name, 2&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-06-11T10:23:31.723" LastActivityDate="2016-06-11T10:23:31.723" Title="Run TeX-command on current buffer" Tags="|auctex|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22754" PostTypeId="2" ParentId="22659" CreationDate="2016-06-04T21:16:50.083" Score="2" Body="&lt;p&gt;Since &lt;code&gt;rust-clippy&lt;/code&gt; normally works at compile time, it should get integrated into whatever you are using for compiling Rust code in Emacs (e.g. &lt;code&gt;cargo-minor-mode&lt;/code&gt;). This is touched on &lt;a href=&quot;http://julienblanchard.com/2016/fancy-rust-development-with-emacs/&quot; rel=&quot;nofollow&quot;&gt;in this blog post&lt;/a&gt; on setting up Emacs for Rust, in case you have not seen it already.&lt;/p&gt;&#xA;" OwnerUserId="12275" LastActivityDate="2016-06-04T21:16:50.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22755" PostTypeId="1" CreationDate="2016-06-04T23:34:06.587" Score="7" ViewCount="5020" Body="&lt;p&gt;I use org-mode basically for handling TODO lists and taking notes.&#xA;Some time ago, I wrote some documentation using markdown-mode and exported to PDF using pandoc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am trying to export to PDF from org-mode. I basically write the org-mode file and use &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this org-mode file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kI8Ke.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kI8Ke.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I export it I get something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/I96AZ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/I96AZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get more separation space between paragraphs? &lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-07-27T18:55:13.940" Title="Separation between paragraphs when exporting to PDF from org-mode" Tags="|org-mode|org-export|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22756" PostTypeId="2" ParentId="22755" CreationDate="2016-06-04T23:51:22.983" Score="0" Body="&lt;p&gt;Well, I have no idea about LaTeX, but I could found this great &lt;a href=&quot;http://osl.ugr.es/CTAN/info/visualFAQ/visualFAQ.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Visual LaTeX FAQ&lt;/a&gt;, that when clicking in the proper separation paragraph redirect to &lt;a href=&quot;http://www.tex.ac.uk/FAQ-parskip.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zero paragraph indent&lt;/a&gt; section. Following those explanations and this blog entry &lt;a href=&quot;http://texblog.org/2013/02/27/on-paragraphs-in-texlatex/&quot; rel=&quot;nofollow noreferrer&quot;&gt;on TeX/LaTeX paragraphs&lt;/a&gt;, I could export it as I wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I quoted two lines of LaTeX code. First one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX: \setlength{\parskip}{\baselineskip} \setlength{\parindent}{0pt}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to set a bigger space between paragraphs, since it seems that 0pt is the default value. &lt;code&gt;{12pt}&lt;/code&gt; also works instead of &lt;code&gt;{\baselineskip}&lt;/code&gt;.&#xA;Moreover, setting &lt;code&gt;\parindent&lt;/code&gt; to &lt;code&gt;0pt&lt;/code&gt;, removes the default paragraph indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX: \setlength{\parskip}{0pt} \setlength{\parindent}{20pt}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to reset it back, so the following paragraphs have no separation in between. And they have indentation again set to &lt;code&gt;20pt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Image from org-mode file with quoted LaTeX:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9HV7W.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9HV7W.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And exported PDF file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2ko75.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2ko75.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's it!&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-06-04T23:51:22.983" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22757" PostTypeId="2" ParentId="22755" CreationDate="2016-06-04T23:52:44.377" Score="2" Body="&lt;p&gt;PDF output is generated by LaTeX, so you need to add the LaTeX code for increasing paragraph spacing. That's controlled by the \parskip variable, which is set in LaTeX like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\setlength{\parindent}{1cm}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To add that to your org source file, place the following line at the top of the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    #+LATEX_HEADER:\setlength{\parindent}{1cm}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use other units too, including &lt;code&gt;in&lt;/code&gt;, &lt;code&gt;pt&lt;/code&gt;, etc., and you can use decimal values like &lt;code&gt;1.2in&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-06-04T23:52:44.377" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22758" PostTypeId="2" ParentId="18808" CreationDate="2016-06-05T00:52:28.130" Score="1" Body="&lt;p&gt;I have similar issue before. My understanding is &lt;code&gt;emacs --daemon&lt;/code&gt; doesn't try to create a frame. But the &lt;code&gt;theme&lt;/code&gt; or &lt;code&gt;face&lt;/code&gt; configuration try to wait until the frame is created to apply it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current solution is (not perfect):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add you configuration to &lt;code&gt;after-make-frame-functions&lt;/code&gt; hook. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ec-theme-cfg ()&#xA;    ;; put your configuration here)&#xA;&#xA;(add-hook 'after-make-frame-functions #'ec-theme-cfg)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that change, &lt;code&gt;emacs --daemon&lt;/code&gt; can start properly and &lt;code&gt;emacsclient&lt;/code&gt; works well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there's an issue with this solution, after run &lt;code&gt;emacs --daemon&lt;/code&gt;, I have to at least create an Emacs frame (&lt;code&gt;emacsclient -c&lt;/code&gt;) before I can use &lt;code&gt;emacsclient -t&lt;/code&gt; from terminal.&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2016-06-05T00:52:28.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22759" PostTypeId="1" AcceptedAnswerId="23758" CreationDate="2016-06-05T01:45:56.787" Score="4" ViewCount="1934" Body="&lt;p&gt;I try to use Emacs in terminal mode, but when I try to checking available font &lt;code&gt;(font-family-list)&lt;/code&gt;, I go &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it anyway to check and set font in terminal mode?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2016-06-05T04:22:11.640" Title="How to configure font in terminal mode (none display graphic)?" Tags="|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23756" PostTypeId="2" ParentId="22735" CreationDate="2016-06-05T02:21:46.430" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.orgzly.com/&quot; rel=&quot;nofollow&quot;&gt;Orgzly&lt;/a&gt; doesn't execute elisp code in your org files, so it won't pick up the settings.  It also doesn't see per-file settings of todo keywords (the  &lt;code&gt;#+SEQ_TODO&lt;/code&gt; and &lt;code&gt;#+TYP_TODO&lt;/code&gt; keywords).  You can specify your todo keywords and which represent DONE states in Orgzly's settings.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-06-05T02:21:46.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23757" PostTypeId="2" ParentId="22753" CreationDate="2016-06-05T03:02:11.530" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I make it apply to the file in the current buffer?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In two ways. Either insert these lines at the bottom of the current file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%% Local Variables:&#xA;%%% TeX-master: &quot;thisFileName&quot;&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or set the tex-master in your &lt;code&gt;my-run-latex&lt;/code&gt; function by adding this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default TeX-master &quot;thisFileName&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &quot;thisFileName&quot; is the current buffer's file name. When you want to revert back to &quot;master&quot;, run &lt;code&gt;C-c _&lt;/code&gt; as described in the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Multifile.html&quot; rel=&quot;nofollow&quot;&gt;AucTeX manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-06-05T12:16:32.177" LastActivityDate="2016-06-05T12:16:32.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23758" PostTypeId="2" ParentId="22759" CreationDate="2016-06-05T04:22:11.640" Score="5" Body="&lt;p&gt;You can't change the Font from within emacs in terminal mode.&#xA;If you want to change the font you have to change your terminal font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming linux&#xA;If you are using the tty, you should change the virtual console font (see /etc/vconsole.conf  o man 5 vconsole.conf)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using xterm or similar you have to change it with your .Xresources for your particular terminal emulator (or through the menu of your terminal emulator if it has such as konsole)&lt;/p&gt;&#xA;" OwnerUserId="8289" LastActivityDate="2016-06-05T04:22:11.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23759" PostTypeId="1" CreationDate="2016-06-05T05:56:24.743" Score="1" ViewCount="282" Body="&lt;p&gt;I'm using fish as my default shell and spacemacs config layers in emacs. My default term is an ansi-term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does ansi-term support text background colours? Foreground (text) colours seem to work fine!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9K4GU.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9K4GU.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="9691" LastActivityDate="2016-06-05T05:56:24.743" Title="Fish &amp; ansi-term text background colour" Tags="|spacemacs|ansi-term|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23760" PostTypeId="1" AcceptedAnswerId="23761" CreationDate="2016-06-05T10:58:45.567" Score="0" ViewCount="94" Body="&lt;p&gt;I want to enter &lt;code&gt;tab&lt;/code&gt; literally by control + v . But, control + v is already emacs key-binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I invalidate a key-bindings temporally ?&lt;/p&gt;&#xA;" OwnerUserId="12282" LastActivityDate="2016-06-07T01:12:46.753" Title="temporal key-bindings invalidation" Tags="|key-bindings|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23761" PostTypeId="2" ParentId="23760" CreationDate="2016-06-05T11:26:16.243" Score="1" Body="&lt;p&gt;You don't need to invalidate a keybinding to reassign it. You can just assign it as normal, and there are many questions &amp;amp; answers here about how to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To change a key-binding 'temporarily' (actually locally), you have a few options: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Change the binding only for one buffer, via &lt;code&gt;(local-set-key ...)&lt;/code&gt;. This is a permanent change, but only for the buffer you call it in., &lt;/li&gt;&#xA;&lt;li&gt;Change it in a particular major or minor mode (such as &lt;code&gt;org-mode&lt;/code&gt;, &lt;code&gt;cc-mode&lt;/code&gt; etc) by using &lt;code&gt;(define-key KEYMAP KEY DEF)&lt;/code&gt;, where KEYMAP is the keymap for the mode you want to alter, KEY is the keybinding, and DEF is the function you want it to call. This is also a permanent change, which will be in effect only for buffers where that mode is used.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-06-05T11:26:16.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23762" PostTypeId="1" CreationDate="2016-06-05T12:44:30.253" Score="1" ViewCount="275" Body="&lt;p&gt;I am having difficulty with bibliography citations in HTML export.  I am able to generate two html files with citations, one from the standard html export from an org file, and another from exporting the org file to latex then compiling it with bibtex, again with latex, then with latex2html.  However the latex converted html file is not how I would like so now I am doing some post-processing to combine the two files.  I just want to replace the citations in the standard org html export with the citations in the latex2html export file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have been trying to do now is swap out the content inside all of the &lt;p&gt; &lt;/p&gt; tags from the latex exported html file to the other using emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have played with using (libxml-parse-html-region (point-min) (point-max)), which creates an output like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (body nil &quot;\n\n&quot;&#xA;        (h1 nil &quot;Sample HTML&quot;)&#xA;        &quot;\n\n&quot;&#xA;        (p nil &quot;Once upon a time... blab blab.&quot;)&#xA;        &quot;\n\n&quot;&#xA;        (p nil &quot;large text of other things here... &quot;)&#xA;        &quot;\n\n&quot;&#xA;        (p nil &quot;more complex non Q and A HTML code here.\ntest\n&quot;)&#xA;        &quot;\n\n&quot;&#xA;        (h2 nil &quot;Questions and Answers&quot;)&#xA;        &quot;\n\n&quot;&#xA;        (p&#xA;         ((class . &quot;q&quot;))&#xA;         &quot;Q: How Why What is this and that ...?&quot;)&#xA;        &quot;\n&quot;&#xA;        (p&#xA;         ((class . &quot;a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However I am not sure how to access, change, and swap the values between the two files.  I'm not finding anything on the internet how to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to swap these citations.&#xA;org html export makes incorrect formatted citations&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt; ...pri  [&amp;lt;a href=&quot;#article&quot;&amp;gt;Adams&amp;lt;/a&amp;gt;].&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;latex2html output correctly makes the citation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p class=&quot;noindent&quot; &amp;gt;ntegre inermis (&amp;lt;a href=&quot;#Xarticle&quot;&amp;gt;Adams&amp;lt;/a&amp;gt;,&amp;amp;#x00A0;&amp;lt;a href=&quot;#Xarticle&quot;&amp;gt;1993&amp;lt;/a&amp;gt;) V...ri stet omnes&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice how the latex2html citation is the correct format.  The org-export citation has a &quot;[Author]&quot; around all of them.  There is other stuff in the org latex export file that I want though and the latex2html puts in a lot of other stuff I don't want.&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="12170" LastEditorUserId="105" LastEditDate="2016-06-10T04:40:31.550" LastActivityDate="2017-11-13T09:18:30.490" Title="How do I replace html &lt;p&gt; tag contents from one html file to another html file" Tags="|org-export|latex|html|bibtex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23764" PostTypeId="1" CreationDate="2016-06-05T14:45:39.803" Score="0" ViewCount="183" Body="&lt;p&gt;how to add the ability to bind a hotkey to display the function's arguments? Is it even possible?&lt;/p&gt;&#xA;" OwnerUserId="12283" LastActivityDate="2017-12-08T10:16:01.480" Title="Extending Go function arguments show hotkey" Tags="|golang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23765" PostTypeId="2" ParentId="22745" CreationDate="2016-06-05T22:07:56.717" Score="11" Body="&lt;p&gt;Credits to awalker4 from reddit!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-capture-mode-hook 'evil-insert-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11700" LastActivityDate="2016-06-05T22:07:56.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23766" PostTypeId="1" CreationDate="2016-06-05T23:00:29.973" Score="1" ViewCount="210" Body="&lt;p&gt;Hope to try to filter some mail &lt;code&gt;from&lt;/code&gt; &quot;foo@example.com&quot; and the &lt;code&gt;subject&lt;/code&gt; contains &quot;sw-report&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to put this configure to my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (setq nnmail-split-methods 'nnmail-split-fancy&#xA;         nnmail-split-fancy&#xA;         '(any &quot;sw-report&quot;&#xA;               (from &quot;foo@example.com&quot; &quot;nnmaildir+COMPANY:INBOX.SWREPORT&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work. Nothing is filtered. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My inbox is locate at &lt;code&gt;nnmaildir+COMPANY:INBOX&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2016-10-04T05:22:00.383" Title="How to split mail according to both &quot;from&quot; and &quot;subject&quot;?" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23767" PostTypeId="2" ParentId="23766" CreationDate="2016-06-06T03:09:07.227" Score="1" Body="&lt;p&gt;&lt;code&gt;nnimap-split-fancy&lt;/code&gt; is actually a server variable rather than a global variable, so the right place to set it is as part of &lt;code&gt;gnus-secondary-select-methods&lt;/code&gt;. So something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-secondary-select-methods&#xA;      '((nnimap&#xA;        &quot;Work&quot;&#xA;        (nnimap-user &quot;bob@example.com&quot;)&#xA;        ;; Other server vars&#xA;        (nnimap-split-fancy&#xA;         (| (any &quot;sw-report&quot;&#xA;                 (from &quot;foo@example.com&quot; &quot;INBOX.SWREPORT&quot;))&#xA;            ;; other rules&#xA;            )))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(This is untested, and I always have trouble with splitting syntax, so it will probably require tweaking before it works.)&lt;/p&gt;&#xA;" OwnerUserId="8" LastActivityDate="2016-06-06T03:09:07.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23770" PostTypeId="1" CreationDate="2016-06-06T08:17:00.870" Score="1" ViewCount="78" Body="&lt;p&gt;I'm trying to find a way to run &lt;code&gt;.rb&lt;/code&gt; files that are in the &lt;code&gt;$PATH&lt;/code&gt; in Eshell by following the solution &lt;a href=&quot;http://help-gnu-emacs.gnu.narkive.com/JvqUGb2i/eshell-win32-executable-files&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. I added &lt;code&gt;&quot;.rb&quot;&lt;/code&gt; to &lt;code&gt;exec-suffixes&lt;/code&gt;, set &lt;code&gt;eshell-force-execution&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; and customized &lt;code&gt;eshell-interpreter-alist&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Regexp: \.rb&#xA;String: c:/programs/rails/Ruby1.9.3/bin/ruby.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run an .rb file in eshell I get an error:&#xA;&lt;code&gt;&#xA;c:\programs\rails\Ruby1.9.3\bin\ruby.exe: No such file or directory -- bill.rb (LoadError)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it works if I run the file in the directory where it is located or with a full path.&#xA;Seems like it is necessary to make interpreter in &lt;code&gt;eshell-interpreter-alist&lt;/code&gt; expand &lt;code&gt;bill.rb&lt;/code&gt; to its full path somehow to make it work, but I couldn't find a way to do that.&lt;/p&gt;&#xA;" OwnerUserId="9404" LastEditorUserId="9404" LastEditDate="2016-06-06T08:22:36.900" LastActivityDate="2016-07-09T08:55:32.670" Title="Running ruby files from $PATH in Eshell" Tags="|microsoft-windows|eshell|path|ruby|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23771" PostTypeId="2" ParentId="21467" CreationDate="2016-06-06T11:01:42.820" Score="-1" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-default-coding-systems 'utf-8)&#xA;(setq-default buffer-file-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;check they are in your .emacs&lt;/p&gt;&#xA;" OwnerUserId="12290" LastEditorUserId="8842" LastEditDate="2016-06-06T14:14:15.617" LastActivityDate="2016-06-06T14:14:15.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23773" PostTypeId="1" AcceptedAnswerId="23785" CreationDate="2016-06-06T13:27:00.977" Score="13" ViewCount="5068" Body="&lt;p&gt;I would like to make sure that scrollbars never show up on my windows, but I recently noticed that when I created a new frame with &lt;code&gt;C-x 5 2&lt;/code&gt; the new frame gets a scrollbar, even though the original frame does not. The lines that might be relevant from my &lt;code&gt;init.el&lt;/code&gt; are below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(scroll-bar-mode -1)&#xA;(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))&#xA;(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))&#xA;(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can still use &lt;code&gt;M-x toggle-scroll-bar&lt;/code&gt; to turn it off in the new frame, but I feel like that shouldn't be necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify, I'm using &lt;code&gt;emacsclient -c &amp;amp;&lt;/code&gt; to start Emacs on Ubuntu, and when I do this I get a scroll bar.  &lt;code&gt;C-h v scroll-bar-mode&lt;/code&gt; gives me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;scroll-bar-mode is a variable defined in `scroll-bar.el'.&#xA;Its value is nil&#xA;Original value was right&#xA;&#xA;Documentation:&#xA;Specify whether to have vertical scroll bars, and on which side.&#xA;Possible values are nil (no scroll bars), `left' (scroll bars on left)&#xA;and `right' (scroll bars on right).&#xA;To set this variable in a Lisp program, use `set-scroll-bar-mode'&#xA;to make it take real effect.&#xA;Setting the variable with a customization buffer also takes effect.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the value of &lt;code&gt;scroll-bar-mode&lt;/code&gt; is properly set to &lt;code&gt;nil&lt;/code&gt;, but somehow Emacs is ignoring this to give me a scroll bar anyway.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2016-06-06T20:37:02.610" LastActivityDate="2018-12-16T11:33:45.233" Title="Disable scrollbar on new frame" Tags="|frames|scroll-bars|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23774" PostTypeId="2" ParentId="23773" CreationDate="2016-06-06T14:09:11.373" Score="8" Body="&lt;p&gt;You can adjust the &lt;a href=&quot;https://ftp.gnu.org/old-gnu/Manuals/elisp-manual-21-2.8/html_node/elisp_451.html&quot; rel=&quot;noreferrer&quot;&gt;frame parameters&lt;/a&gt; in the &lt;code&gt;default-frame-alist&lt;/code&gt; to tell Emacs you never want scroll bars.  Add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist&#xA;             '(vertical-scroll-bars . nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-06-06T14:09:11.373" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23776" PostTypeId="1" AcceptedAnswerId="23782" CreationDate="2016-06-06T16:30:00.057" Score="2" ViewCount="1428" Body="&lt;p&gt;I am switching from vim to emacs and have evil installed. Mostly evil runs perfectly, but after starting emacs the first time and running ibuffer or dired I have to turn on evil-mode (C-z). This is really annoying as I often restart Emacs and assume that I can use vim-Bindings when opening dired or ibuffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I always have evil-mode turned on by default?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/10668/how-to-set-evil-mode-to-use-evil-emacs-state-mode-in-new-buffers&quot;&gt;This question&lt;/a&gt; seemed to be leading to the right direction, but I could not get it working.&lt;/p&gt;&#xA;" OwnerUserId="12284" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-06-06T20:06:51.650" Title="automatically use evil for ibuffer and dired" Tags="|evil|dired|ibuffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23777" PostTypeId="1" AcceptedAnswerId="23779" CreationDate="2016-06-06T18:00:09.583" Score="0" ViewCount="223" Body="&lt;p&gt;Apologies if this is poorly described, my emacs vocabulary is pretty limited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've set the following in my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;C-=&quot;) 'cider-find-var))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cider-find-var&lt;/code&gt; always wants confirmation though. For example if I press &lt;code&gt;C-=&lt;/code&gt; on the symbol &lt;code&gt;usage&lt;/code&gt; I see this in the bottom left corner:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/daddA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/daddA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to press enter to confirm. How can I automatically confirm this every time? A generic solution that works with other function calls is preferred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the help message for the function in question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;cider-find-var is an interactive compiled Lisp function in&#xA;  `cider-client.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to C-=.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(cider-find-var &amp;amp;optional ARG VAR LINE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Find definition for VAR at LINE.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Prompt according to prefix ARG and &lt;code&gt;cider-prompt-for-symbol&lt;/code&gt;.&#xA;  A single or double prefix argument inverts the meaning of&#xA;  &lt;code&gt;cider-prompt-for-symbol&lt;/code&gt;.  A prefix of &lt;code&gt;-&lt;/code&gt; or a double prefix argument causes&#xA;  the results to be displayed in a different window.  The default value is&#xA;  thing at point.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11188" LastEditorUserId="11188" LastEditDate="2016-06-06T19:11:53.717" LastActivityDate="2016-08-03T05:01:16.647" Title="How can I automatically confirm the default value to a function call?" Tags="|evil|cider|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23778" PostTypeId="2" ParentId="23776" CreationDate="2016-06-06T19:00:05.567" Score="0" Body="&lt;p&gt;Open your &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;init file&lt;/a&gt;, and put this in it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, every time Emacs is started, evil-mode will be turned on.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-06-06T19:00:05.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23779" PostTypeId="2" ParentId="23777" CreationDate="2016-06-06T19:11:26.573" Score="2" Body="&lt;p&gt;I don't use &lt;code&gt;cider&lt;/code&gt;, but looking at some of the documentation it looks like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can customize &lt;code&gt;cider-prompt-for-symbol&lt;/code&gt; to set the default behavior for prompts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When calling &lt;code&gt;cider-find-var&lt;/code&gt; you can use a prefix argument to invert the default prompt behavior. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So it sounds like you could use &lt;code&gt;M-x customize-option cider-prompt-for-symbol&lt;/code&gt; to change the default behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also keep the default setting but change your key binding to provide the argument -- one way to do that is to bind the key to a lambda such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;C-=&quot;) (lambda () (interactive) (cider-find-var t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That binds the key to a new function that calls &lt;code&gt;cider-find-var&lt;/code&gt; with an argument &lt;code&gt;t&lt;/code&gt;. From the function doc, a non-nil argument inverts the value of the the prompt option.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-06-06T19:21:36.263" LastActivityDate="2016-06-06T19:21:36.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23780" PostTypeId="2" ParentId="23760" CreationDate="2016-06-06T19:34:42.143" Score="1" Body="&lt;p&gt;As commented, &lt;code&gt;local-set-key&lt;/code&gt; changes the local map, which in most cases&#xA;is a map from some major mode.  If you really want a binding that&#xA;affects only the current buffer, you need to make sure that it has one&#xA;that is not used elsewhere.  AFAIK, there is no such function in Emacs,&#xA;but I've had the following hack for years to do it.  It defines a&#xA;&lt;code&gt;buffer-local-set-key&lt;/code&gt; command to get a truly buffer-local binding (and&#xA;a &lt;code&gt;buffer-local-unset-all&lt;/code&gt; to undo all such local bindings):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar buffer-local-keymap nil)&#xA;(make-variable-buffer-local 'buffer-local-keymap)&#xA;&#xA;(defun buffer-local-set-key (key command)&#xA;  &quot;Same as `local-set-key' but ensures the current buffer has its own map.&quot;&#xA;  (interactive &quot;KSet key buffer-locally: \nCSet key %s locally to command: &quot;)&#xA;  (unless buffer-local-keymap&#xA;    (setq buffer-local-keymap (make-sparse-keymap))&#xA;    (when (current-local-map)&#xA;      (set-keymap-parent buffer-local-keymap (current-local-map)))&#xA;    (use-local-map buffer-local-keymap)&#xA;    (message &quot;NOTE: buffer-local keymap in effect, %s&quot;&#xA;             &quot;local-key operations will use it from now&quot;))&#xA;  (local-set-key key command))&#xA;&#xA;(defun buffer-local-unset-all ()&#xA;  &quot;Undoes all bindings that `buffer-local-set-key' did in this buffer.&quot;&#xA;  (interactive)&#xA;  (message (if (not buffer-local-keymap)&#xA;             &quot;Wasn't using a local map.&quot;&#xA;             (progn (use-local-map (keymap-parent buffer-local-keymap))&#xA;                    (setq buffer-local-keymap nil)&#xA;                    &quot;Removed `buffer-local' bindings.&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9889" LastEditorUserId="675" LastEditDate="2016-06-07T01:12:46.753" LastActivityDate="2016-06-07T01:12:46.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23781" PostTypeId="1" CreationDate="2016-06-06T19:54:51.510" Score="3" ViewCount="1145" Body="&lt;p&gt;I'm very new to Emacs. I've installed AUCTeX version 11.89.4 using package manager (&lt;code&gt;list-packages&lt;/code&gt;, select &lt;code&gt;auctex&lt;/code&gt;, install it). It works, at least it shows compiled pdf result from test .tex file in local buffer after several &lt;code&gt;C-c C-c&lt;/code&gt; strokes. Now I want to do some customization -- for example, showing result in external evince program. However, the more tutorials and docs I read, the more it seems to me that my AUCTeX installation is somehow broken:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I know that &lt;code&gt;C-h v AUCTeX-version&lt;/code&gt; should give me AUCTeX version. However, I don't have such variable -- describe variable gives no match. I have learned that the version is 11.89.4 from the package manager.&lt;/li&gt;&#xA;&lt;li&gt;I don't have variable &lt;code&gt;TeX-view-program-list&lt;/code&gt;, which, as &lt;a href=&quot;https://tex.stackexchange.com/questions/106889/change-view-command-in-emacs-and-auctex-pdf-mode&quot;&gt;I've read&lt;/a&gt;, is used for setting view program. In fact, I have only three variables starting with &lt;code&gt;Tex&lt;/code&gt;, and all of them I've declared in &lt;code&gt;initl.el&lt;/code&gt; myself: &lt;code&gt;TeX-PDF-mode&lt;/code&gt;, &lt;code&gt;TeX-auto-save&lt;/code&gt;, &lt;code&gt;TeX-pase-self&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I don't have menu item &lt;code&gt;LaTeX&lt;/code&gt; which is &lt;a href=&quot;https://tex.stackexchange.com/questions/161797/how-to-configure-emacs-and-auctex-to-perform-forward-and-inverse-search&quot;&gt;mentioned here&lt;/a&gt;. I have only menu item &lt;code&gt;TeX&lt;/code&gt;, and there is no &quot;Customize AUCTeX&quot; submenu:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/y0xFf.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y0xFf.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;There is no key &lt;code&gt;C-c ~&lt;/code&gt; which is supposed to &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Mathematics.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;turn on math mode&lt;/a&gt;. There is no variable &lt;code&gt;LaTeX-math-abbrev-prefix&lt;/code&gt; and no function &lt;code&gt;LaTeX-math-mode&lt;/code&gt;, although I've added line &lt;code&gt;(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)&lt;/code&gt; to my &lt;code&gt;init.el&lt;/code&gt; and it had been read without any problems. &lt;/li&gt;&#xA;&lt;li&gt;some other things, but I think this should be enough to show the problem.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My OS is Ubuntu 14.04, GNU Emacs 24.5.1. This is version is still absent from Ubuntu repos, so I have built it from sources and installed via checkinstall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional info:&#xA;Ubuntu package auctex is not installed -- I just followed &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual instructions&lt;/a&gt; and it doesn't says anything about system-wide packages. I have no variable &lt;code&gt;TeX-lisp-directory&lt;/code&gt;; If I start Emacs without executing init.el (-q), and then run &lt;code&gt;M-x package-initialize&lt;/code&gt;, I get the following error: &lt;code&gt;(file-error &quot;Cannot open load file&quot; &quot;no such file or directory&quot; &quot;tex-site&quot;)&lt;/code&gt;. I don't know what it means right now, but it seems that google has something on this -- I will look into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another point which, as I think, should be made clear. As I have read in &lt;a href=&quot;https://www.emacswiki.org/emacs/ELPA&quot; rel=&quot;nofollow noreferrer&quot;&gt;EmacsWiki&lt;/a&gt; since Emacs 24 package initialization happens after loading init.el. However, I needed &lt;code&gt;package-installed-p&lt;/code&gt; function, so I forced loading packages in the beginning of init.el by inserting the following code (taken from &lt;a href=&quot;https://www.emacswiki.org/emacs/ELPA&quot; rel=&quot;nofollow noreferrer&quot;&gt;wiki&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-enable-at-startup nil)&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't noticed earlier, but in fact I get error &lt;code&gt;&quot;no such file or directory&quot; &quot;tex-site&quot;&lt;/code&gt; after running &lt;code&gt;package-initialize&lt;/code&gt; when calling in from &lt;code&gt;init.el&lt;/code&gt; too. It seems to me that the root of my problem is that I forgot to add the line &lt;code&gt;(require 'auctex)&lt;/code&gt;. After adding it, auctex finally works, I have &lt;code&gt;TeX-lisp-directory&lt;/code&gt; and other vars, however, now I see the following warning in Messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/ars/.emacs.d/init.el':&#xA;&#xA;error: Required feature `auctex' was not provided&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's wrong with this way of loading packages? Should I require them explicitly or not?&lt;/p&gt;&#xA;" OwnerUserId="12293" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-11-06T16:49:39.173" Title="Installing AUCTeX, GNU Emacs 24.5.1" Tags="|package|auctex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23782" PostTypeId="2" ParentId="23776" CreationDate="2016-06-06T20:06:51.650" Score="5" Body="&lt;p&gt;There are a few variables that determine the state in which Evil starts depending on the major-mode:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-emacs-state-modes&lt;/code&gt; for major-modes coming up in emacs state&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;evil-insert-state-modes&lt;/code&gt; for major-modes coming up in insert state&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and so on. By default &lt;code&gt;ibuffer-mode&lt;/code&gt; is part of &lt;code&gt;evil-emacs-state-modes&lt;/code&gt;, which you should remove&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-emacs-state-modes (delq 'ibuffer-mode evil-emacs-state-modes))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dired-mode&lt;/code&gt; should not come up in emacs state by default, though, but the principle is the same.&lt;/p&gt;&#xA;" OwnerUserId="7211" LastActivityDate="2016-06-06T20:06:51.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23783" PostTypeId="2" ParentId="22749" CreationDate="2016-06-06T20:45:03.270" Score="1" Body="&lt;p&gt;Make sure that &lt;code&gt;org-src-fontify-natively&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="3902" LastActivityDate="2016-06-06T20:45:03.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23785" PostTypeId="2" ParentId="23773" CreationDate="2016-06-07T03:32:02.730" Score="9" Body="&lt;p&gt;I also ran into this issue, until I added the following code.  (I believe I came across the snippet here on Stack Exchange, but sorry I don't recall the author.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/disable-scroll-bars (frame)&#xA;  (modify-frame-parameters frame&#xA;                           '((vertical-scroll-bars . nil)&#xA;                             (horizontal-scroll-bars . nil))))&#xA;(add-hook 'after-make-frame-functions 'my/disable-scroll-bars)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6615" LastEditorUserId="675" LastEditDate="2016-06-08T09:01:41.717" LastActivityDate="2016-06-08T09:01:41.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23786" PostTypeId="1" AcceptedAnswerId="23788" CreationDate="2016-06-07T08:51:02.293" Score="1" ViewCount="907" Body="&lt;p&gt;In my .emacs I have &lt;code&gt;(require 'sr-speedbar)&lt;/code&gt;. It works fine, but at startup I always see the compile-log-buffer with &lt;code&gt;Warning (bytecomp): reference to free variable 'helm-alive-p'&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://stackoverflow.com/questions/12432093/get-rid-of-reference-to-free-variable-byte-compilation-warnings&quot;&gt;this&lt;/a&gt; question it has to be some wrong definition somewhere, but where? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it has to be in the elisp code in the package, but there is also a .elc-File. I am a newbie to elisp, so I don't want to break anything. How do I get rid of this warning?&lt;/p&gt;&#xA;" OwnerUserId="12284" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-11-02T12:08:44.000" Title="sr-speedbar shows compilation warning at startup" Tags="|speedbar|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23788" PostTypeId="2" ParentId="23786" CreationDate="2016-06-07T10:38:26.520" Score="2" Body="&lt;p&gt;Maybe you have to install the helm package...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another 'solution' is adding this line to your .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq byte-compile-warnings '(not free-vars ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-06-07T10:38:26.520" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23789" PostTypeId="1" AcceptedAnswerId="23793" CreationDate="2016-06-07T12:10:20.863" Score="0" ViewCount="271" Body="&lt;p&gt;I found the following code &lt;a href=&quot;https://stackoverflow.com/a/7043786/6382059&quot;&gt;here&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sudo-find-file (file-name)&#xA;  &quot;Like find file, but opens the file as root.&quot;&#xA;  (interactive &quot;FSudo Find File: &quot;)&#xA;  (let ((tramp-file-name (concat &quot;/sudo::&quot; (expand-file-name file-name))))&#xA;    (find-file tramp-file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it tries to find the file is sudo mode in the current directory and I have to delete so many characters to reach root directory &lt;code&gt;/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I define the default opening path in the mentioned code?&lt;/p&gt;&#xA;" OwnerUserId="12300" LastActivityDate="2016-06-07T14:13:52.197" Title="change default tramp path for finding files" Tags="|key-bindings|tramp|sudo|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23790" PostTypeId="2" ParentId="22363" CreationDate="2016-06-07T13:23:33.347" Score="5" Body="&lt;p&gt;here's solution, shorting @abo-abo's answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA;     ((string-equal system-type &quot;windows-nt&quot;) ; Windows&#xA;      // ...&#xA;      )&#xA;     ((string-equal system-type &quot;gnu/linux&quot;)&#xA;      (start-process &quot;my-browse&quot;&#xA;                     nil &quot;setsid&quot;&#xA;                     &quot;firefox&quot;&#xA;                     (concat &quot;file://&quot; buffer-file-name ))&#xA;&#xA;      ;; (browse-url ξurl)&#xA;      )&#xA;     ((string-equal system-type &quot;darwin&quot;) ; Mac&#xA;                // ...&#xA;                ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that condition is necessary, because Mac doesn't have setsid.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-06-07T13:23:33.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23792" PostTypeId="1" CreationDate="2016-06-07T13:48:02.190" Score="1" ViewCount="243" Body="&lt;p&gt;I am trying to have configuration byte-compiled to improve performances further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original code works with no issue. However, adding the optional &lt;code&gt;compile&lt;/code&gt; argument:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ob-tangle)&#xA;(org-babel-load-file (expand-file-name &quot;dotemacs.org&quot; user-emacs-directory) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yields the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotemacs.el:79:17:Warning: reference to free variable `package-archives'&#xA;dotemacs.el:79:17:Warning: assignment to free variable `package-archives'&#xA;dotemacs.el:91:4:Error: Cannot open load file: no such file or directory, use-package&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is my &lt;a href=&quot;https://github.com/angrybacon/dotemacs/blob/fdd7b798671fcfadb749fa7ba80e9292424a4cc7/init.el#L33-34&quot; rel=&quot;nofollow&quot;&gt;init.el&lt;/a&gt;. And &lt;a href=&quot;https://github.com/angrybacon/dotemacs/blob/fdd7b798671fcfadb749fa7ba80e9292424a4cc7/dotemacs.org#6-initialize-melpa&quot; rel=&quot;nofollow&quot;&gt;here is the part that breaks&lt;/a&gt; in my &lt;code&gt;dotemacs.org&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="105" LastEditDate="2016-06-10T13:15:40.883" LastActivityDate="2016-06-10T13:15:40.883" Title="Compiled configuration cannot find package" Tags="|org-babel|byte-compilation|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23793" PostTypeId="2" ParentId="23789" CreationDate="2016-06-07T14:10:01.957" Score="0" Body="&lt;p&gt;Here an example with &quot;/&quot; as default directory:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun sudo-find-file (file-name)&#xA;  &quot;Like find file, but opens the file as root.&quot;&#xA;  (interactive&#xA;  (list (read-file-name &quot;sudo Find File: &quot; &quot;/&quot;)))&#xA;  (let ((tramp-file-name (concat &quot;/sudo::/&quot; (expand-file-name file-name))))&#xA;    (find-file tramp-file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-06-07T14:10:01.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23794" PostTypeId="2" ParentId="23789" CreationDate="2016-06-07T14:13:52.197" Score="0" Body="&lt;p&gt;Use double slashes &lt;code&gt;//&lt;/code&gt;. In the local case, a double slash in the minibuffer means to start at the root directory. In the remote case, a double slash in the minibuffer means to start at the root directory of the remote machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the discussion in the Tramp manual, section &quot;File name completion&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-06-07T14:13:52.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23795" PostTypeId="2" ParentId="23781" CreationDate="2016-06-07T14:44:20.607" Score="-2" Body="&lt;p&gt;If packages are initialized in &lt;code&gt;init.el&lt;/code&gt; by hand, it is necessary to load every used package explicitly. For auctex, loading the package is &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Loading-the-package&quot; rel=&quot;nofollow&quot;&gt;covered in the manual&lt;/a&gt;. One should also always check &lt;code&gt;*Messages*&lt;/code&gt; buffer before posting questions here...&lt;/p&gt;&#xA;" OwnerUserId="12293" LastEditorUserId="12293" LastEditDate="2016-06-09T13:12:29.730" LastActivityDate="2016-06-09T13:12:29.730" CommentCount="2" CommunityOwnedDate="2016-06-07T14:44:20.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="23797" PostTypeId="2" ParentId="2740" CreationDate="2016-06-07T16:06:10.317" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Priorities.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;The docs&lt;/a&gt; tell you to&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;please make sure that the highest priority is earlier in the alphabet than the lowest priority&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Apart from that, &lt;a href=&quot;https://emacs.stackexchange.com/a/17949/8431&quot;&gt;@Roger Mateer's suggestion&lt;/a&gt; to use &lt;a href=&quot;http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling&quot; rel=&quot;nofollow noreferrer&quot;&gt;deadlines and scheduling&lt;/a&gt; for urgency and &lt;a href=&quot;http://orgmode.org/manual/Priorities.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;priorities&lt;/a&gt; for importance seems to ring a bell. That is how &lt;a href=&quot;https://en.wikipedia.org/wiki/The_7_Habits_of_Highly_Effective_People&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stephen Covey&lt;/a&gt; differentiates it, for example: with two scales; one from important to unimportant. One from urgent to non-urgent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possibility would be to expand to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;#+PRIORITIES: A F D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;at the top of your file, with &lt;code&gt;A-C&lt;/code&gt; as important and &lt;code&gt;D-F&lt;/code&gt; as unimportant.&lt;/p&gt;&#xA;" OwnerUserId="8431" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-06-07T16:54:52.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23798" PostTypeId="1" CreationDate="2016-06-07T17:45:06.083" Score="0" ViewCount="167" Body="&lt;p&gt;While working with &lt;code&gt;term&lt;/code&gt; or &lt;code&gt;ansi-term&lt;/code&gt; in &lt;em&gt;term-line&lt;/em&gt; mode, I am not able to use &lt;code&gt;cua-mode&lt;/code&gt; bindings. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-06-07T17:45:06.083" Title="Enable cua-mode in term or ansi-term mode" Tags="|ansi-term|term|cua-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23799" PostTypeId="2" ParentId="23798" CreationDate="2016-06-07T17:45:06.083" Score="1" Body="&lt;p&gt;I was experiencing this from some time now, and never had the time/energy to look at it. But it seems it is pretty straightforward as it is described in &lt;a href=&quot;https://www.emacswiki.org/emacs/AnsiTermHints&quot; rel=&quot;nofollow&quot;&gt;AnsiTermHints&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; enable cua and transient mark modes in term-line-mode&#xA;(defadvice term-line-mode (after term-line-mode-fixes ())&#xA;  (set (make-local-variable 'cua-mode) t)&#xA;  (set (make-local-variable 'transient-mark-mode) t))&#xA;(ad-activate 'term-line-mode)&#xA;&#xA;;; disable cua and transient mark modes in term-char-mode&#xA;(defadvice term-char-mode (after term-char-mode-fixes ())&#xA;  (set (make-local-variable 'cua-mode) nil)&#xA;  (set (make-local-variable 'transient-mark-mode) nil))&#xA;(ad-activate 'term-char-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;cua-mode&lt;/code&gt; works in &lt;em&gt;term-line&lt;/em&gt; mode and does not in &lt;em&gt;term-char&lt;/em&gt; mode.&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-06-07T17:45:06.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23800" PostTypeId="1" AcceptedAnswerId="23801" CreationDate="2016-06-07T17:55:18.067" Score="1" ViewCount="257" Body="&lt;p&gt;I am working on a very old Emacs version (23.2.1). I am trying to  bind &lt;code&gt;C-C C-i&lt;/code&gt; to an interactive command without luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command selects code regions delimited between two lines that start with &lt;code&gt;##&lt;/code&gt;. It &lt;strong&gt;works well&lt;/strong&gt; when I call it interactively (&lt;code&gt;M-x python-select-cell&lt;/code&gt;), but the keybinding does &lt;strong&gt;not&lt;/strong&gt; work in Python buffers:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun python-inside-comment-p ()&#xA;  (save-excursion&#xA;    (beginning-of-line 1)&#xA;    (looking-at &quot;^#&quot;)))&#xA;&#xA;(defun python-select-cell ()&#xA;  (interactive)&#xA;  (goto-char&#xA;   (if (re-search-backward &quot;^\\s-*##[^#]&quot; nil t)&#xA;       (match-end 0)&#xA;     (point-min)))&#xA;  (while (and (python-inside-comment-p)&#xA;              (eq 0 (forward-line 1)))&#xA;    nil)&#xA;  (set-mark (point))&#xA;  (goto-char&#xA;   (if (re-search-forward &quot;^\\s-*\\(##[^#]\\)&quot; nil t)&#xA;       (- (match-beginning 1) 2)&#xA;     (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Global keybinding:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;# Binding&#xA;(global-set-key (kbd &quot;C-c C-i&quot;) 'python-select-cell)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also tried setting up a hook without luck&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;    #'(lambda ()&#xA;          (global-set-key (kbd &quot;C-C C-i&quot;) 'python-select-cell)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What could be going on?&lt;/p&gt;&#xA;" OwnerUserId="2038" LastEditorUserId="675" LastEditDate="2016-06-07T20:51:48.043" LastActivityDate="2016-06-07T20:51:48.043" Title="Emacs ignoring global keybindings" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23801" PostTypeId="2" ParentId="23800" CreationDate="2016-06-07T19:41:39.813" Score="6" Body="&lt;p&gt;Modes can define their own key bindings (and most do). Key bindings defined by a mode hide global bindings. Python mode binds &lt;code&gt;C-c C-i&lt;/code&gt; (to &lt;code&gt;python-find-imports&lt;/code&gt;), so its binding hides yours. This is explained in more detail in the manual in the section on &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Local-Keymaps.html#Local-Keymaps&quot;&gt;local keymaps&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check what a key does in the current context (e.g. in the current mode) by pressing &lt;code&gt;C-h c&lt;/code&gt; (&lt;code&gt;describe-key-briefly&lt;/code&gt;) or &lt;code&gt;C-h k&lt;/code&gt; (&lt;code&gt;describe-key&lt;/code&gt;) then typing the key (or key sequence). There's no easy way to look up where a particular binding was made, but you can list the bindings made by the current major mode and active minor modes with &lt;code&gt;C-h m&lt;/code&gt; (&lt;code&gt;describe-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are conventions for key bindings in Emacs. I can't find them in the Emacs manual, they're buried in the Elisp manual under &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Major-Mode-Conventions.html#Major-Mode-Conventions&quot;&gt;major mode conventions&lt;/a&gt;: &lt;code&gt;C-c&lt;/code&gt; is the prefix that is left free in Emacs; &lt;code&gt;C-c C-letter&lt;/code&gt; is conventionally for major modes, and &lt;code&gt;C-c letter&lt;/code&gt; is conventionally for the end-user. As the end-user, expect major modes to often override &lt;code&gt;C-c C-letter&lt;/code&gt; bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want your command to be bound globally, you should bind a different key, such as &lt;code&gt;C-c i&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want your command to be bound only in Python mode, you need to define it in the Python mode keymap, &lt;code&gt;python-mode-map&lt;/code&gt;. The keymap doesn't exist until Python mode is loaded, so you need to delay until this happens. Use &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks-for-Loading.html&quot;&gt;&lt;code&gt;eval-after-load&lt;/code&gt;&lt;/a&gt; (or the &lt;code&gt;with-eval-after-load&lt;/code&gt; wrapper in recent versions of Emacs):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun josh-after-load-python ()&#xA;  (define-key python-mode-map (kbd &quot;C-c C-i&quot;) 'python-select-cell))&#xA;(eval-after-load &quot;python&quot; '(josh-after-load-python))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will, of course, shadow the binding for &lt;code&gt;python-find-imports&lt;/code&gt;. If you care about that command, you may want to pick a different key.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-06-07T19:41:39.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23802" PostTypeId="1" AcceptedAnswerId="23803" CreationDate="2016-06-07T20:25:24.307" Score="3" ViewCount="481" Body="&lt;p&gt;Interesting bug in ruby-mode. When a variable called &lt;code&gt;index&lt;/code&gt; is followed by a slash &lt;code&gt;/&lt;/code&gt;, syntax highlighting breaks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a screenshot to show you what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AJGTW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AJGTW.png&quot; alt=&quot;fun syntax highlighting bug in ruby-mode&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure how to file a ticket on the ruby-mode repo since I've never used SVN. Anyone know where to go from here? &lt;/p&gt;&#xA;" OwnerUserId="12304" LastActivityDate="2023-12-09T17:59:08.517" Title="Division sometimes breaks syntax highlighting in ruby-mode" Tags="|spacemacs|syntax-highlighting|ruby-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23803" PostTypeId="2" ParentId="23802" CreationDate="2016-06-07T22:43:33.050" Score="3" Body="&lt;p&gt;Good news everyone!&lt;/p&gt;&#xA;&lt;p&gt;This is now fixed upstream, and will be in the next Emacs release (29.2).&lt;/p&gt;&#xA;" OwnerUserId="124" LastEditorUserId="124" LastEditDate="2023-12-09T17:59:08.517" LastActivityDate="2023-12-09T17:59:08.517" CommentCount="14" ContentLicense="CC BY-SA 4.0" />
  <row Id="23804" PostTypeId="1" AcceptedAnswerId="23805" CreationDate="2016-06-07T23:38:39.717" Score="1" ViewCount="126" Body="&lt;p&gt;I'm trying to use replace-regexp-in-string (see function below) and I need to detect the boundary between a lower case and upper case character. Apparently let-binding case-fold-search to nil doesn't work? I'm trying this in the latest pretest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 25.0.94.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1603)) of 2016-05-17&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as well as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2015-04-10 on builder10-9.porkrind.org&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(obviously on a Mac)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun spread-upcase-filename (filename)&#xA;  &quot;fooBar.h =&amp;gt; F O O  B A R . H&quot;&#xA;  (let ((case-fold-search nil)&#xA;        (str (replace-regexp-in-string &quot;\\([a-z0-9]\\)\\([A-Z]+\\)&quot;&#xA;                                       &quot;\\1\x01\\2&quot; filename t)))&#xA;    (setq str (mapconcat 'identity (split-string str &quot;&quot; t) &quot; &quot;))&#xA;    ;;(setq str (replace-regexp-in-string &quot;\x01&quot; &quot;&quot; str t))&#xA;    (upcase str)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the documentation I've seen so far, case-fold-search is supposed to be&#xA;dynamically-bound rather than lexically-bound, but it doesn't seem to have any effect.&lt;/p&gt;&#xA;" OwnerUserId="12306" LastEditorUserId="105" LastEditDate="2016-06-10T04:37:28.673" LastActivityDate="2016-06-10T04:37:28.673" Title="Using replace-regexp-in-string without case folding" Tags="|let-binding|case-folding|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23805" PostTypeId="2" ParentId="23804" CreationDate="2016-06-08T00:05:48.470" Score="0" Body="&lt;p&gt;Your problem is that you &lt;em&gt;haven't&lt;/em&gt; bound &lt;code&gt;case-fold-search&lt;/code&gt; in the scope of the the call to &lt;code&gt;replace-regexp-in-string&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the difference between &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;let&lt;/code&gt; and &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;let*&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-06-08T00:05:48.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23806" PostTypeId="2" ParentId="23802" CreationDate="2016-06-08T11:30:50.387" Score="0" Body="&lt;p&gt;FWIW, if you use &lt;code&gt;enh-ruby-mode&lt;/code&gt;, that problem doesn't occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/zenspider/enhanced-ruby-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/zenspider/enhanced-ruby-mode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2016-06-08T11:30:50.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23807" PostTypeId="1" AcceptedAnswerId="23809" CreationDate="2016-06-08T12:47:47.403" Score="1" ViewCount="240" Body="&lt;p&gt;Trying to run &lt;code&gt;telnet&lt;/code&gt; in Emacs shell I cannot figure out how to send &lt;code&gt;^]&lt;/code&gt; to terminate it.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-06-08T15:47:23.227" Title="Emacs shell send ^] (hat-right-sqare-bracket)" Tags="|shell|escape|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23808" PostTypeId="1" AcceptedAnswerId="23862" CreationDate="2016-06-08T13:01:10.300" Score="4" ViewCount="526" Body="&lt;p&gt;I've searched extensively online but have not found an easy solution. Maybe there is already an easy solution or some tips on doing this easily?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am clocking in the amount of time I spend on different projects. I can summarize the clocktable using &lt;code&gt;org-clock-report&lt;/code&gt;. However, I would like to visualize this data using either barplots for different projects (easiest), or a breakdown of how much time I spend on different projects as a function of the calendar year (most complicated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone already tried this? Is there an easy way to parse the timestamps into a file format that makes it easy to plot in standard software such as excel or R?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Analysis&#xA;    CLOCK: [2016-06-06 Mon 21:13]--[2016-06-06 Mon 22:29] =&amp;gt;  1:16&#xA;    CLOCK: [2016-06-06 Mon 14:20]--[2016-06-06 Mon 17:31] =&amp;gt;  3:11&#xA;    CLOCK: [2016-06-06 Mon 09:50]--[2016-06-06 Mon 12:15] =&amp;gt;  2:25&#xA;&#xA;*** Meeting&#xA;    CLOCK: [2016-06-07 Tue 09:07]--[2016-06-07 Tue 11:46] =&amp;gt;  2:39&#xA;    CLOCK: [2016-06-06 Mon 13:43]--[2016-06-06 Mon 14:20] =&amp;gt;  0:37&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea would be to wrangle these timestamps into a file format that would be easily amenable to plotting (excel or R).&lt;/p&gt;&#xA;" OwnerUserId="10523" LastActivityDate="2016-06-10T10:45:07.807" Title="How to plot summaries of timestamps of different projects clocking in and out?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23809" PostTypeId="2" ParentId="23807" CreationDate="2016-06-08T15:47:23.227" Score="4" Body="&lt;p&gt;You should be able to press &lt;kbd&gt; C-q &lt;/kbd&gt; to run &lt;code&gt;quoted-insert&lt;/code&gt; to insert any key chord you want. So pressing &lt;kbd&gt; C-q C-] &lt;/kbd&gt; will insert &lt;code&gt;^]&lt;/code&gt; into the buffer instead of running the command bound to &lt;kbd&gt; C-] &lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-08T15:47:23.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23810" PostTypeId="1" AcceptedAnswerId="23811" CreationDate="2016-06-08T16:08:12.063" Score="0" ViewCount="1153" Body="&lt;p&gt;I've started using the &lt;a href=&quot;http://flask.pocoo.org/&quot; rel=&quot;nofollow&quot;&gt;Flask&lt;/a&gt; Python framework, and I'm having trouble getting indentation to work properly in the template &lt;code&gt;.html&lt;/code&gt; files.  I use &lt;code&gt;web-mode&lt;/code&gt;, and it seems to really not want me to indent without opening a new html tag. For instance, this is the default indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!-- extend base layout --&amp;gt;&#xA;{% extends &quot;base.html&quot; %}&#xA;&#xA;{% block content %}&#xA;&amp;lt;h1&amp;gt;Sign in&amp;lt;/h1&amp;gt;&#xA;&amp;lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;login&quot;&amp;gt;&#xA;    {{ form.hidden_tag() }}&#xA;    &amp;lt;p&amp;gt;&#xA;        Please enter your OpenID:&amp;lt;br&amp;gt;&#xA;        {{ form.openid(size=80) }}&amp;lt;br&amp;gt;&#xA;        {% for error in form.openid.errors %}&#xA;        &amp;lt;span style=&quot;color: red;&quot;&amp;gt;[{{ error }}]&amp;lt;/span&amp;gt;&#xA;        {% endfor %}&#xA;    &amp;lt;/p&amp;gt;&#xA;    &amp;lt;p&amp;gt;{{ form.remember_me }} Remember me&amp;lt;/p&amp;gt;&#xA;    &amp;lt;p&amp;gt;&amp;lt;input type=&quot;submit&quot; value=&quot;Sign in&quot;&amp;gt;&amp;lt;/p&amp;gt;&#xA;&amp;lt;/form&amp;gt;&#xA;{% endblock %}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ideally I would indent code within the &lt;code&gt;for&lt;/code&gt; loop so that I can more clearly view the structure of my code, but &lt;code&gt;web-mode&lt;/code&gt; won't let me &lt;code&gt;Tab&lt;/code&gt; that line over, no matter how many times I try. I couldn't find any other packages for Flask, but maybe I'm in the wrong place.  Is there a way to get web-mode and Flask to play nicely?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2016-06-08T16:19:47.247" Title="Getting proper indentation for Python Flask templates" Tags="|indentation|python|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23811" PostTypeId="2" ParentId="23810" CreationDate="2016-06-08T16:19:47.247" Score="2" Body="&lt;p&gt;You can call the &lt;code&gt;web-mode-set-engine&lt;/code&gt; command from &lt;code&gt;M-x&lt;/code&gt; this will allow you to set which template you want to use. The engine that you want it &quot;django&quot; (yes even though you are using flask/jinja).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also set the variable &lt;code&gt;web-mode-engines-alist&lt;/code&gt; such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-engines-alist&#xA;             '((&quot;php&quot; . &quot;\\.phtml\\'&quot;)&#xA;               (&quot;jinja&quot; . &quot;\\.djhtml\\&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will make any file that I have open that matches the regexp on the right side use the engine on the left. The regexp can be anything this is simply my config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any questions or I wasn't clear ask away &lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-08T16:19:47.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23812" PostTypeId="1" CreationDate="2016-06-08T17:58:12.660" Score="4" ViewCount="889" Body="&lt;p&gt;I use Mu4e to do email and my emails are stored locally in a maildir.  People often send me emails with large attachments.  I'd like to keep the emails but not the attachments because I'm paying for storage and would like to keep cost low.  What's the best way to remove attachments from selected emails?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background: I'm using the development version of Emacs and Ubuntu 16.04.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2016-06-08T18:12:55.097" LastActivityDate="2022-03-17T20:17:39.363" Title="Remove attachments from emails" Tags="|email|mu4e|attachment|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23813" PostTypeId="1" CreationDate="2016-06-08T19:34:57.103" Score="1" ViewCount="556" Body="&lt;p&gt;I am trying to somehow use a local variable in org-mode for when I write my R code. So essentially in have this chunk that I want to automatically manage for each file. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R :file /Users/ashok/Documents/plots/wtdup.png&#xA;  pairs.panels(tmpDat.cpm.log[,c(1:4,17:20)],)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the chunk above I want to be able to replace the value for the :file with a path to the plots folder that could change. So I tried to use the local variable approach as below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; * LOCAL VARS&#xA;## Local Variables:&#xA;## mode: org&#xA;## plotfolder: &quot;/Users/DataAnalysis/FinalAnalysisMay2016/plots&quot;&#xA;## End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then replace the :file parameter with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R :file (eval 'plotfolder)&quot;/truseq_comp_logcpm_pairwise_wtdup.png&quot;&#xA;  pairs.panels(tmpDat.cpm.log[,c(5,7,8,21:23)], )&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I evaluate the chunk ( after reverting my buffer to make the local variable active), the result includes only the value of the plotfolder variable and not the concatenated version as I wanted. &#xA;in this case my results would show up as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS&#xA;/Users/DataAnalysis/FinalAnalysisMay2016/plots&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but what i really want is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS&#xA;/Users/DataAnalysis/FinalAnalysisMay2016/plots/truseq_comp_logcpm_pairwise_wtdup.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If anyone has any suggestions as to how I can go about this it would be great, since then I can move the same files between machines when I am working on cleaning up the results.&lt;/p&gt;&#xA;" OwnerUserId="9614" LastEditorUserId="2731" LastEditDate="2016-06-09T09:23:03.910" LastActivityDate="2016-07-09T14:56:26.603" Title="Use local variable with concatenation in Org mode" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23814" PostTypeId="1" CreationDate="2016-06-08T21:48:46.577" Score="3" ViewCount="155" Body="&lt;p&gt;I am trying to navigate a C project that has lots of preprocessor directives like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#ifdef SOME_COMPILE_TIME_VARIABLE&#xA;    for ( idx=0; idx&amp;lt;FOO; idx++ ) {&#xA;#else&#xA;    for ( idx=0; idx&amp;lt;BAR; idx++) {&#xA;#endif        &#xA;        var[idx] += data[idx];&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this seems to break many editor features.  By far the worst symptom is that indentation becomes broken from that point all the way to the bottom of the buffer because there &lt;em&gt;seems&lt;/em&gt; to be an unmatched open brace.  Other features that break include code folding and semantic navigation (e.g. &lt;code&gt;c-end-of-defun&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can imagine some ways of working around this problem by editing the code itself.  Like this for example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#ifdef SOME_COMPILE_TIME_VARIABLE&#xA;    for ( idx=0; idx&amp;lt;FOO; idx++ )&#xA;#else&#xA;    for ( idx=0; idx&amp;lt;BAR; idx++)&#xA;#endif&#xA;    {&#xA;        var[idx] += data[idx];&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But since the code does not belong to me, I do not have the option of editing the entire code base so that it plays nicely with my editor.  And in many cases, this would not be practical even it were permissible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to mitigate the negative effects of mismatched parentheses and braces like this, which are due to precompiler directives?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-06-08T21:48:46.577" Title="Working around preprocessor blocks" Tags="|c++|c|navigation|balanced-parentheses|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23815" PostTypeId="2" ParentId="23812" CreationDate="2016-06-08T22:07:16.123" Score="4" Body="&lt;p&gt;I found the solution hidden in a &lt;a href=&quot;https://github.com/djcb/mu/issues/790&quot; rel=&quot;nofollow noreferrer&quot;&gt;closed issue on GitHub&lt;/a&gt; (thanks to @mankoff):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-remove-attachment (msg num) &#xA;  &quot;Remove attachment.&quot; &#xA;  (let* ((attach (mu4e~view-get-attach msg num))&#xA;         (path (mu4e-msg-field msg :path))&#xA;         (filename (and attach (plist-get attach :name)))&#xA;         (cmd (format &quot;altermime --input='%s' --remove='%s'&quot;  path filename)))&#xA;    (when (and filename&#xA;               (yes-or-no-p&#xA;                (format &quot;Are you sure you want to remove '%s'?&quot; filename)))&#xA;      (shell-command cmd)&#xA;      (message cmd))))&#xA;&#xA;(add-to-list 'mu4e-view-attachment-actions&#xA;             '(&quot;remove-attachment&quot; . my-remove-attachment))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This adds a new &quot;attachment action&quot; in Mu4e.  When viewing an email, press &lt;code&gt;A&lt;/code&gt;, then &lt;code&gt;r&lt;/code&gt; to select the action defined above, then enter the number of the attachment.  The action will ask you for confirmation before deleting the attachment.  The header listing the attachments is not updates but when you leave the email and reopen it, the attachment is gone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code assumes that the tool altermime is installed.  To install it in Ubuntu, do &lt;code&gt;sudo apt-get install altermime&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2019-09-23T14:36:35.657" LastActivityDate="2019-09-23T14:36:35.657" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="23816" PostTypeId="2" ParentId="15029" CreationDate="2016-06-08T23:53:58.837" Score="1" Body="&#xA;&#xA;&lt;p&gt;In order for your derived mode to not modify the c-mode syntax table directly, you should define your own syntax table which is based on the c-mode syntax table.  Also, it is often helpful to modify the &lt;code&gt;comment-start&lt;/code&gt; and &lt;code&gt;comment-end&lt;/code&gt; variables to match the preferred comment style for the mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cc-langs)&#xA;&#xA;(defvar c-like-syntax-table&#xA;  (let ((table (make-syntax-table)))&#xA;    (c-populate-syntax-table table)&#xA;    (modify-syntax-entry ?- &quot;. 12b&quot; table)&#xA;    table)&#xA;  &quot;The syntax table for my mode called `c-like-mode'&quot;)&#xA;&#xA;(define-derived-mode c-like-mode c-mode &quot;C-Like&quot;&#xA;  &quot;Major mode that is like `c-mode' but with \&quot;--\&quot; as a comment&quot;&#xA;  :syntax-table c-like-syntax-table&#xA;  (setq comment-start &quot;-- &quot;)&#xA;  (setq comment-end &quot;&quot;))&#xA;&#xA;(provide 'c-like-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is worth noting that, given this syntax table, comments that start with &lt;code&gt;--&lt;/code&gt; are of the same comment style as comments that start with &lt;code&gt;//&lt;/code&gt;.  A side effect of this is that any combination of those characters will result in a comment.  In other words, &lt;code&gt;//&lt;/code&gt;, &lt;code&gt;--&lt;/code&gt;, &lt;code&gt;/-&lt;/code&gt;, and &lt;code&gt;-/&lt;/code&gt; will all mark the beginning of a comment.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-06-08T23:53:58.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23817" PostTypeId="2" ParentId="19757" CreationDate="2016-06-09T00:13:59.040" Score="1" Body="&lt;p&gt;You can also use &lt;a href=&quot;https://github.com/leoliu/ggtags&quot; rel=&quot;nofollow&quot;&gt;ggtags&lt;/a&gt;, a frontend GNU Global.&lt;br&gt;&#xA;It works pretty well and it is similar to the standard &lt;code&gt;etags&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;strong&gt;Usage&lt;/strong&gt; instructions:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Open any file in a project and type &lt;code&gt;M-x ggtags-mode&lt;/code&gt;. Use &lt;code&gt;M-.&lt;/code&gt;&#xA;  (&lt;code&gt;ggtags-find-tag-dwim&lt;/code&gt;) to find the tag at point. If the project has&#xA;  not been indexed (i.e. no &lt;code&gt;GTAGS&lt;/code&gt; file exists), &lt;code&gt;ggtags&lt;/code&gt; will ask for the&#xA;  project root directory and index it recursively.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, open &lt;code&gt;window.c&lt;/code&gt;, then type &lt;code&gt;M-x ggtags-mode&lt;/code&gt;.&lt;br&gt;&#xA;Place the cursor on &lt;code&gt;optional_new_start&lt;/code&gt; and hit &lt;code&gt;M-.&lt;/code&gt;.&lt;br&gt;&#xA;The first time you  will get a prompt (&lt;code&gt;ggtags-create-tags&lt;/code&gt;) to create the &lt;code&gt;GTAGS&lt;/code&gt; file needed.&lt;br&gt;&#xA;(In fact, it will create four files: &lt;code&gt;GPATH&lt;/code&gt;, &lt;code&gt;GTAGS&lt;/code&gt;, &lt;code&gt;GRTAGS&lt;/code&gt;, &lt;code&gt;GSYMS&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;RET&lt;/code&gt; and you will get a prompt like: &lt;code&gt;Use 'ctags' backend? (yes or no)&lt;/code&gt;.&lt;br&gt;&#xA;Type &lt;code&gt;yes&lt;/code&gt; and you are done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can jump to definitions, find references, etc...&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-06-09T00:13:59.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23818" PostTypeId="1" AcceptedAnswerId="23823" CreationDate="2016-06-09T00:15:48.670" Score="3" ViewCount="1044" Body="&lt;p&gt;Many languages have a mechanism to signal an attached debugger to pause or break.  For example in JavaScript this is done using the &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;debugger&lt;/code&gt; keyword&lt;/a&gt;.  In others like C# or Visual Basic the signal is generated by a &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break(v=vs.110).aspx&quot; rel=&quot;nofollow&quot;&gt;built-in function&lt;/a&gt;.  This functionality is useful in situations where it is difficult or impossible to set breakpoints using the debugger.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does elisp have an equivalent?&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2016-06-10T13:14:00.250" LastActivityDate="2016-06-10T13:14:00.250" Title="Signaling a breakpoint in Emacs Lisp" Tags="|debugging|edebug|debug|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23819" PostTypeId="1" CreationDate="2016-06-09T01:07:33.093" Score="4" ViewCount="1310" Body="&lt;p&gt;I have exactly this org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO EAT                                 :home:&#xA;** make &#xA;** me&#xA;** a&#xA;** sandwich&#xA;* TODO CODE                                :home:&#xA;** make&#xA;** me&#xA;** code&#xA;* TODO SLEEP                                :bed:&#xA;** dream with&#xA;** dragons&#xA;* TODO REPEAT                              :universe:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to filter it by tags, so I:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x + org-agenda&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;m&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;home&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then nothing. As if there wasn't any item tagged with home. Although, as you can see, there is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm I doing something wrong? I can not filter by anything, even the &quot;All TODO's&quot; option displays no items at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really want to get into org-mode. Please help me :(&lt;/p&gt;&#xA;" OwnerUserId="12317" LastActivityDate="2016-06-09T01:36:17.230" Title="Emacs org-mode agenda filter doesn't work. :(" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23820" PostTypeId="2" ParentId="23819" CreationDate="2016-06-09T01:36:17.230" Score="5" Body="&lt;p&gt;You are seeing that behavior because that org file needs to be in your agenda (&lt;code&gt;org-agenda-files&lt;/code&gt;) if you do an unrestricted match for the agenda.  You can specify what files (and directories) to include in your agenda by setting it to a list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files&#xA;  '(&quot;~/path/to/this.org&quot;&#xA;    &quot;~/path/to/another/file.org&quot;&#xA;    &quot;~/path/to/org-directory/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can use org-agenda without including files in your agenda by using the dispatcher to restrict the search to the current buffer or subtree (the current file needn't be in &lt;code&gt;org-agenda-files&lt;/code&gt;).  Type &lt;code&gt;&amp;lt;&lt;/code&gt; when you see the dispatcher to cycle among 'unrestricted', 'buffer', and 'subtree'.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-06-09T01:36:17.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23822" PostTypeId="1" CreationDate="2016-06-09T02:57:59.517" Score="0" ViewCount="624" Body="&lt;p&gt;As mentioned in this question, I can not use org mode properly within tmux. So, I would want to remap key bindings like &lt;code&gt;alt+RET&lt;/code&gt; for creating a new bullet item or &lt;code&gt;shift + left/right arrow&lt;/code&gt; to change an item hierarchy.&lt;/p&gt;&#xA;&lt;p&gt;How would I do that?&lt;/p&gt;&#xA;" OwnerUserId="12317" LastEditorUserId="105" LastEditDate="2021-12-19T23:59:55.983" LastActivityDate="2021-12-19T23:59:55.983" Title="How to Remap `org-mode` key bindings?" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="23823" PostTypeId="2" ParentId="23818" CreationDate="2016-06-09T04:00:43.207" Score="6" Body="&lt;p&gt;Add &lt;code&gt;(debug)&lt;/code&gt; and you'll be thrown into a buffer showing you the backtrace and where you can examine the current state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Explicit-Debug.html#Explicit-Debug&quot; rel=&quot;noreferrer&quot;&gt;Emacs Manual &quot;Explicit Entry to the Debugger&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="2731" LastEditDate="2016-06-09T09:22:39.520" LastActivityDate="2016-06-09T09:22:39.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23824" PostTypeId="1" CreationDate="2016-06-09T05:22:59.180" Score="5" ViewCount="1538" Body="&lt;p&gt;My org-agenda view is made out of 5-6 files. Can one define a different face (mainly color) per file?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorDisplayName="user8748" LastEditDate="2017-05-06T08:15:19.997" LastActivityDate="2017-07-25T21:37:58.633" Title="Defining different fonts (color) per file in org-agenda" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23828" PostTypeId="1" AcceptedAnswerId="24106" CreationDate="2016-06-09T07:05:02.677" Score="0" ViewCount="93" Body="&lt;p&gt;How can I linkify the following intranet links in org-mode?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;intra/link1-description&#xA;code/description&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By linkify, I mean the links should be fontified and clickable in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to add a custom link handler like &lt;code&gt;intra:&lt;/code&gt; because I often copy and paste links from the intranet.&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-06-22T13:53:21.017" Title="Org-mode custom intranet links like `intra/desc`" Tags="|org-mode|hyperlinks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23829" PostTypeId="2" ParentId="23770" CreationDate="2016-06-09T08:03:51.183" Score="1" Body="&lt;p&gt;I had to change &lt;code&gt;eshell-interpreter-alist&lt;/code&gt; to&#xA;&lt;code&gt;&#xA;Regexp: \.rb&#xA;Interpreter: eshell-run-ruby-command-from-path&#xA;&lt;/code&gt;&#xA;And provide the following function to make it work&#xA;&lt;code&gt;&#xA;(defun eshell-run-ruby-command-from-path (args)&#xA;  (eshell-named-command &quot;ruby.exe&quot; (list (eshell-search-path args))))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9404" LastActivityDate="2016-06-09T08:03:51.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23830" PostTypeId="1" CreationDate="2016-06-09T09:47:34.063" Score="0" ViewCount="213" Body="&lt;p&gt;Is there a way to make pdf-export of files named in russian?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use xelatex which is set up like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-pdf-process&#xA;      '(&quot;xelatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;xelatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;xelatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;latin named files are ok to be exported, but if I name it &lt;code&gt;Документ.org&lt;/code&gt; then there is an error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;*messages*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-latex-compile: PDF file ./Документ.pdf wasn't produced&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;*Org PDF LaTeX Output*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016/W32TeX) (preloaded format=xelatex)&#xA; \write18 enabled.&#xA;entering extended mode&#xA;! I can't find file `'&quot;c:/Users/user/org/work/Документ.tex&quot;''.&#xA;&amp;lt;*&amp;gt; .../work/Докуметн.tex&quot;'&#xA;&#xA;(Press Enter to retry, or Control-Z to exit)&#xA;Please type another input file name&#xA;! Emergency stop.&#xA;&amp;lt;*&amp;gt; .../work/Документ.tex&quot;'&#xA;&#xA;No pages of output.&#xA;Transcript written on .//texput.log.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-06-09T09:47:34.063" Title="org-mode russian filename pdf export" Tags="|org-export|latex|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23831" PostTypeId="2" ParentId="3900" CreationDate="2016-06-09T10:09:19.893" Score="3" Body="&lt;p&gt;Malabarba has &lt;a href=&quot;http://endlessparentheses.com/create-github-prs-from-emacs-with-magit.html&quot; rel=&quot;nofollow&quot;&gt;posted his approach&lt;/a&gt; on his blog.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun endless/visit-pull-request-url ()&#xA;  &quot;Visit the current branch's PR on Github.&quot;&#xA;  (interactive)&#xA;  (browse-url (format &quot;https://github.com/%s/pull/new/%s&quot;&#xA;                      (replace-regexp-in-string&#xA;                       &quot;\\`.+github\\.com:\\(.+\\)\\.git\\'&quot; &quot;\\1&quot;&#xA;                       (magit-get &quot;remote&quot; (magit-get-push-remote) &quot;url&quot;))&#xA;                      (magit-get-current-branch))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;By the way, I intend to add similar functionality (and a lot more ;-) to Magit itself, eventually.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-06-09T10:09:19.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23832" PostTypeId="1" AcceptedAnswerId="24265" CreationDate="2016-06-09T12:03:12.113" Score="2" ViewCount="293" Body="&lt;p&gt;I found Emacs has a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Dynamic-Libraries.html#Dynamic-Libraries&quot; rel=&quot;nofollow&quot;&gt;dynamic-library-alist&lt;/a&gt;. But there's no instruction about how to use the libraries after it is been loaded...any idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to acheive is to load a DLL on my Windows system and call the exposed function.&lt;/p&gt;&#xA;" OwnerUserId="12018" LastActivityDate="2016-06-29T13:22:04.957" Title="How to use dynamic-library-alist to load my own DLL?" Tags="|microsoft-windows|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23833" PostTypeId="2" ParentId="17280" CreationDate="2016-06-09T14:03:44.710" Score="1" Body="&lt;p&gt;In your &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;init file&lt;/a&gt;, add:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f3&amp;gt;&quot;) 'compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, when you press &lt;kbd&gt;F3&lt;/kbd&gt;, it will execute &lt;code&gt;make -k&lt;/code&gt; (or &lt;code&gt;--keep-going&lt;/code&gt; - &lt;a href=&quot;https://www.gnu.org/software/make/manual/html_node/Options-Summary.html&quot; rel=&quot;nofollow&quot;&gt;continue as much as possible after an error&lt;/a&gt;) in the directory where your file is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to allow the shortcut for a specific language (like C++), use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key c++-mode-map (kbd &quot;&amp;lt;f3&amp;gt;&quot;) #'compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The new buffer opened is called the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation-Mode.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;*compilation*&lt;/code&gt; buffer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user12181" LastEditorUserId="97" LastEditDate="2016-06-09T16:10:23.790" LastActivityDate="2016-06-09T16:10:23.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23834" PostTypeId="2" ParentId="23813" CreationDate="2016-06-09T14:50:02.813" Score="1" Body="&lt;p&gt;Got it i used the emacs concat function as suggested by @phils above but i had to figure out how it was evaluated. Here is the solution&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R :file (concat (eval plot folder) &quot;/truseq_comp_logcpm_pairwise_wtdup.png&quot;)&#xA;  pairs.panels(tmpDat.cpm.log[,c(5,7,8,21:23)], )&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To summarize. Say you wanted to specify a variable text in org-mode then in the example above add plotfolder to the local variables as mentioned and then use concat as above to add say prefixes or suffixes&lt;/p&gt;&#xA;" OwnerUserId="9614" LastActivityDate="2016-06-09T14:50:02.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23835" PostTypeId="2" ParentId="23777" CreationDate="2016-06-09T15:01:09.450" Score="2" Body="&lt;p&gt;Sometimes we want to find something in our clojure codebase that isn't readily at point (point is the emacs term for the location of your cursor). What is at point is the default that the command will search for.  What you are thinking of as &quot;confirmation&quot; is an opportunity to enter a different var to search for from that which is at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This same functionality exists for cider documentation lookup as well. Sometimes you may want to lookup documentation for a function to see if it does what you want, without first adding the function to your codebase - or having to spend the time navigating to an existing usage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a common convention in emacs, for example the built in emacs functions &lt;code&gt;describe-function&lt;/code&gt; (C-h f) and &lt;code&gt;describe-variable&lt;/code&gt; (C-h v) work this way, and you'll be well served by the versatility commands that follow this convention offer while working with elisp, or looking up emacs commands and settings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initially, cider did not follow this convention - but it has since adopted it.  At first I found it a little uncomfortable, based on my preconceived expectations and I worried that it would hamper my efficiency. I quickly found just the opposite, I habituated the additional key press and have found the flexibility it offers very useful when I need it.  I was also surprised to learn that navigating to what I was interested in usually took longer than typing the name - especially with the powers of tab-completion in the minibuffer thanks to the combination of auto-completion in &lt;code&gt;company-mode&lt;/code&gt; and the &lt;code&gt;helm&lt;/code&gt; narrowing framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would encourage you to try and use it as designed - even if only for a few days, in the long run it will likely make you a more proficient emacs user.&lt;/p&gt;&#xA;" OwnerUserId="12323" LastEditorUserId="12323" LastEditDate="2016-08-03T05:01:16.647" LastActivityDate="2016-08-03T05:01:16.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23837" PostTypeId="1" CreationDate="2016-06-09T15:31:11.223" Score="4" ViewCount="6468" Body="&lt;p&gt;I've tried to install Emacs on Windows (7) with msys2, however, I'm not sure if it worked. In any event, I can't find it on my machine. The install (following &lt;a href=&quot;https://www.gnu.org/software/emacs/download.html&quot; rel=&quot;nofollow&quot;&gt;these instructions&lt;/a&gt; seems to go fine -- but then no Emacs.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2022-12-10T16:40:35.407" Title="msys2 emacs install not working?" Tags="|microsoft-windows|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23839" PostTypeId="1" CreationDate="2016-06-09T16:50:34.927" Score="1" ViewCount="17" Body="&lt;p&gt;Every time I use pv in ansi-term it brokes my terminal. There are two possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;broken terminal clears every time i press enter and hides output&lt;/li&gt;&#xA;&lt;li&gt;it stops understand \n or something and writes output line by line in a bottom of a window, overwriting previous line by next.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How do I fix this? Why this doesn't happening in regular terminals like gnome-terminal? Is it a pv bug or something emacs-specific?&lt;/p&gt;&#xA;" OwnerUserId="10889" LastActivityDate="2016-06-09T16:50:34.927" Title="pv console utility brokes ansi-term" Tags="|ansi-term|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23840" PostTypeId="1" CreationDate="2016-06-09T17:18:30.963" Score="1" ViewCount="3657" Body="&lt;p&gt;Emacs has been favorite editor for more than twenty five years but it looks like one feature is missing. That one is text completion suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most of the editors once you start typing, it keeps suggesting the completions. Sometimes, these are based on previous sessions, sometimes based on common words applicable to the current mode. Notepad++ is one notable example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick search did not reveal any such feature package for emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think that you can suggest something? &lt;/p&gt;&#xA;" OwnerUserId="2557" LastEditorUserId="25" LastEditDate="2016-06-09T19:39:12.373" LastActivityDate="2016-06-09T19:39:12.373" Title="Text completion suggestion in emacs" Tags="|completion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23841" PostTypeId="1" CreationDate="2016-06-09T17:47:43.827" Score="1" ViewCount="1684" Body="&lt;p&gt;No *curses applications (like top, htop, Linux kernel's &lt;code&gt;make menuconfig&lt;/code&gt; and others) will work under emacs' different terms. However, the only one which seems to work is &lt;code&gt;git add -i&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It behaves the same under term, multi-term and ansi-term: output a lot of messy garbage. It does the same when not splitting frames and I reproduced this behavior without any configuration (moved .emacs and .emacs.d somewhere else).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I included a screenshot of when I tried a &lt;code&gt;make menuconfig&lt;/code&gt; in Linux kernel's base directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running &lt;code&gt;GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian&lt;/code&gt; in GUI on Ubuntu 16.04.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way of fixing this ? Is it just an isolated bug or related to emacs in general ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1SA9s.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1SA9s.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11911" LastEditorUserId="11911" LastEditDate="2016-06-10T13:01:40.187" LastActivityDate="2016-06-14T14:19:25.370" Title="ncurses-like based applications won't work in emacs terminals" Tags="|ansi-term|term|ubuntu|multi-term|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23842" PostTypeId="2" ParentId="22724" CreationDate="2016-06-09T17:58:02.610" Score="1" Body="&lt;p&gt;Try this out if you want. It lets you enter a regexp and then shows the records when you hit tab. when you are satisfied with the chosen records hit enter. The main function is jat/bbdb-search.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jat/minibuffer-text ()&#xA;  &quot;only works on one line&quot;&#xA;  (buffer-substring-no-properties&#xA;   (minibuffer-prompt-end)&#xA;   (line-end-position)))&#xA;&#xA;(defun jat/display-records (records regexp &amp;amp;optional layout)&#xA;  (message &quot;%s&quot; regexp)&#xA;  (if records&#xA;      (bbdb-display-records records layout nil t)&#xA;    (message &quot;No records matching '%s'&quot; regexp)))&#xA;&#xA;(defun jat/bbdb-search (&amp;amp;optional layout)&#xA;  (interactive)&#xA;  (let* ((regexp (read-from-minibuffer&#xA;              &quot;Regexp: &quot;&#xA;              nil&#xA;              (let ((map (make-sparse-keymap)))&#xA;            (set-keymap-parent map minibuffer-local-map)&#xA;            (define-key map (kbd &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;              (lambda ()&#xA;                (interactive)&#xA;                (save-selected-window&#xA;                  (let ((intext (jat/minibuffer-text)))&#xA;                (jat/display-records&#xA;                 (bbdb-search (bbdb-records) intext intext intext (cons '* intext) intext intext)&#xA;                 intext&#xA;                 layout)))))&#xA;            map)))&#xA;     (records (bbdb-search (bbdb-records) regexp regexp regexp (cons '* regexp) regexp regexp)))&#xA;    (jat/display-records records (jat/minibuffer-text) layout)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-09T17:58:02.610" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23843" PostTypeId="1" AcceptedAnswerId="23846" CreationDate="2016-06-09T18:03:35.553" Score="1" ViewCount="185" Body="&lt;p&gt;After so much research, I managed to get &lt;code&gt;alt + RET&lt;/code&gt; working. Learned so much!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appended to my ~/.emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;      (lambda ()&#xA;        (if window-system&#xA;            nil&#xA;          (progn&#xA;            (define-key org-mode-map &quot;\C-\M-j&quot; 'org-meta-return)&#xA;            (define-key org-mode-map &quot;\C-j&quot; 'org-insert-heading-respect-content\&#xA;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to remap more things, like &lt;code&gt;alt + right arrow&lt;/code&gt;. To do so, I could just add more &lt;code&gt;(define-key org-mode-map&lt;/code&gt; ... blocks, but:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I get the list of commands such as &lt;code&gt;'org-meta-return&lt;/code&gt; to create my mappings?&lt;/p&gt;&#xA;" OwnerUserId="12317" LastActivityDate="2016-06-09T19:25:25.053" Title="Where to get the list of org-mode commands as lisp variables?" Tags="|org-mode|key-bindings|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23844" PostTypeId="2" ParentId="23840" CreationDate="2016-06-09T18:15:12.747" Score="4" Body="&lt;p&gt;Look into &lt;a href=&quot;http://company-mode.github.io/&quot; rel=&quot;nofollow&quot;&gt;&quot;company mode&quot;&lt;/a&gt; perhaps. It is not built in but it will give you a dropdown of completions. You can choose how those completions are filled in by using different backends. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also dabbrev-expand which is built in and will autocomplete the text before the point with code that you had typed previously in the buffer by default it is bound to &lt;code&gt;M-/&lt;/code&gt; you can hit it multiple times to cycle through completetions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some modes also provide something called &lt;code&gt;completion-at-point&lt;/code&gt; which is bound to &lt;code&gt;C-M-i&lt;/code&gt; by default&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-09T18:15:12.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23845" PostTypeId="2" ParentId="23840" CreationDate="2016-06-09T18:16:01.693" Score="4" Body="&lt;p&gt;The most popular package seems to be &lt;a href=&quot;http://company-mode.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;company mode&lt;/a&gt;.  From the README:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Company is a modular completion mechanism.  Modules for retrieving completion candidates are called back-ends, modules for displaying them are front-ends.&lt;/p&gt;&#xA;&lt;p&gt;Company comes with many back-ends, e.g. `company-elisp'.  These are&#xA;distributed in separate files and can be used individually.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So depending on what types of files you are editing, you will need to grab the appropriate front-end/back-end tools that use the &lt;code&gt;company&lt;/code&gt; framework.  For example, for C/C++ you could look at &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;irony&lt;/a&gt; and its accompanying backend &lt;a href=&quot;https://github.com/Sarcasm/company-irony&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-irony&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-06-09T18:16:01.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23846" PostTypeId="2" ParentId="23843" CreationDate="2016-06-09T19:25:25.053" Score="2" Body="&lt;p&gt;You can use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;org&lt;/code&gt; &lt;kbd&gt;TAB&lt;/kbd&gt;. Then copy paste the commands from the pop-up window. There are hundreds of them though, so good luck with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a list of the commands that are currently bound to a key, press &lt;kbd&gt;C-h m&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-06-09T19:25:25.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23847" PostTypeId="1" CreationDate="2016-06-09T19:39:20.890" Score="0" ViewCount="210" Body="&lt;p&gt;As you all know when you hit C-x C-f and then TAB to auto-complete, an auto-completion window pops-up. But does anyone know how to get the list of files colored by type (eg. folder in blue, files in white or whatever) ? Like in the normal shell ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently it is possible to do it with Helm but I am not using helm myself (maybe I should try it though).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="9675" LastEditorUserId="105" LastEditDate="2016-06-10T13:07:26.960" LastActivityDate="2018-05-25T09:02:22.047" Title="Colored completion buffer when opening files" Tags="|completion|colors|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23848" PostTypeId="1" AcceptedAnswerId="23849" CreationDate="2016-06-09T20:34:19.277" Score="3" ViewCount="789" Body="&lt;p&gt;In Visual Studio and Intellij I can press Tab to select the highlighted auto-completion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Helm: Is there a way to give Tab the same behavior as Return?&lt;/p&gt;&#xA;" OwnerUserId="12284" LastActivityDate="2018-11-02T22:42:44.140" Title="Helm - select with Tab instead of Enter?" Tags="|helm|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23849" PostTypeId="2" ParentId="23848" CreationDate="2016-06-09T20:44:00.227" Score="5" Body="&lt;p&gt;&#xA;You could add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'helm&#xA;  (define-key helm-map (kbd &quot;TAB&quot;) #'helm-maybe-exit-minibuffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should work in all cases except where a given helm source binds something different than &lt;code&gt;helm-maybe-exit-minibuffer&lt;/code&gt; to &lt;code&gt;RET&lt;/code&gt;, but off the top of my head I can't think of any sources that do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you only want to apply this change for a specific source (rather than for all helm sources) you could see if that source has its own associated keymap, and bind it there instead.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2016-06-09T20:52:11.953" LastActivityDate="2016-06-09T20:52:11.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23850" PostTypeId="1" CreationDate="2016-06-09T21:25:31.393" Score="5" ViewCount="281" Body="&lt;p&gt;I'm exploring options for monkey-patching and I'm wondering if the following is within reason.&lt;/p&gt;&#xA;&lt;p&gt;I would like to override a particular function within some target function so that calls within the target function are overridden, but functions called directly by the target function are unaffected.&#xA;Whether the overridden function inherits the override isn't particularly important.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'noflet)&#xA;&#xA;(defun my-message (msg)&#xA;  (message (concat &amp;quot;**&amp;quot; msg &amp;quot;**&amp;quot;)))&#xA;&#xA;(defun unaffected-fn ()&#xA;  (my-message &amp;quot;Goodbye!&amp;quot;))&#xA;&#xA;(defun target-fn ()&#xA;  (my-message &amp;quot;Hello!&amp;quot;)&#xA;  (unaffected-fn))&#xA;&#xA;(noflet ((my-message (msg) (message (concat &amp;quot;@@&amp;quot; msg &amp;quot;@@&amp;quot;))))&#xA;  (target-fn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The output of this code is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;@@Hello!@@&#xA;@@Goodbye!@@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I would like to avoid &lt;code&gt;unaffected-fn&lt;/code&gt; inheriting this local override.  The output for the desired behavior would be:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;@@Hello!@@&#xA;**Goodbye!**&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Suggestions for clearer wording of this question are welcome.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="15606" LastEditDate="2024-03-05T21:23:36.130" LastActivityDate="2024-03-05T21:23:36.130" Title="Shallowly override functions within a target function" Tags="|advice|conditionals|monkey-patching|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="23851" PostTypeId="1" CreationDate="2016-06-09T23:46:08.740" Score="1" ViewCount="303" Body="&lt;p&gt;I checked my ess/lisp/ess-mode.el file and it has the line of code I'm expecting for this to work (below). Anyone know why this would happen? &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key map [(control return)] 'ess-eval-region-or-line-and-step)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12326" LastEditorUserId="253" LastEditDate="2016-06-11T15:08:11.403" LastActivityDate="2016-06-11T15:08:11.403" Title="Control-Enter doesn't work in ESS?" Tags="|ess|aquamacs|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23853" PostTypeId="2" ParentId="21112" CreationDate="2016-06-10T02:25:17.427" Score="0" Body="&lt;p&gt;The problem is that you need to add &quot;PDF Tools&quot; to the list of available PDF Tools. This must happen automagically for some people (or there would be more complaints about this on stackexchange!), but apparently not for you or me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(pdf-tools-install) ;; start server&#xA;(load &quot;pdf-tools&quot;) ;; not clear if this is needed.&#xA;&#xA;;; add &quot;PDF Tools&quot; to the list of possible PDF tools&#xA;(unless (assoc &quot;PDF Tools&quot; TeX-view-program-list&#xA;  (add-to-list 'TeX-view-program-list&#xA;           '(&quot;PDF Tools&quot; TeX-pdf-tools-sync-view)))&#xA;(add-to-list 'TeX-view-program-selection&#xA;          '(output-pdf &quot;PDF Tools&quot;))&#xA;&#xA;(setq TeX-view-program-selection '((output-pdf &quot;PDF Tools&quot;)))&#xA;&#xA;;; Update PDF buffers after successful LaTeX runs&#xA;(add-hook 'TeX-after-TeX-LaTeX-command-finished-hook&#xA;         'TeX-revert-document-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8654" LastEditorUserId="620" LastEditDate="2016-06-10T11:49:24.373" LastActivityDate="2016-06-10T11:49:24.373" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23854" PostTypeId="1" AcceptedAnswerId="23857" CreationDate="2016-06-10T04:45:42.237" Score="4" ViewCount="346" Body="&lt;p&gt;Are there reflection methods available in elisp to examine the stack without invoking the debugger?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Get the calling/callee function&lt;/li&gt;&#xA;&lt;li&gt;Get the function call stack&lt;/li&gt;&#xA;&lt;li&gt;Get the (longer) nested statement stack&lt;/li&gt;&#xA;&lt;li&gt;Get arguments for any of the above&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;An aside: In my search for applicable features/functions/variables I was surprised to learn that elisp does not (natively) perform tail call optimization!  Presumably elisp does then maintain a complete stack.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2016-06-10T13:02:10.290" LastActivityDate="2016-06-10T13:02:10.290" Title="Stack reflection in Emacs Lisp?" Tags="|elisp|debug|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23855" PostTypeId="1" CreationDate="2016-06-10T07:03:00.623" Score="0" ViewCount="41" Body="&lt;p&gt;i really would love to have the option to launch different apps for a specific file type. for example if i have a &lt;code&gt;.jpeg&lt;/code&gt; file i would want an option to launch in gimp, inkscape etc.&#xA;Ideally i would love to have a keybind that launches a menu (maybe using hydra?) that will present the launch options. if this could be dynamic based on a file type (extension maybe?) that would be amazing, but i'll also be glad with maybe just a general menu with all available actions.&#xA;any ideas?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="454" LastEditDate="2016-06-10T09:41:14.473" LastActivityDate="2016-06-10T09:41:14.473" Title="dired: different action from same bind based on file type (extension), maybe hydra?" Tags="|dired|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23856" PostTypeId="2" ParentId="23847" CreationDate="2016-06-10T07:08:04.423" Score="1" Body="&lt;p&gt;You can try this librairy: &lt;a href=&quot;https://github.com/vjohansen/emacs-config/blob/master/site-lisp/color-file-completion.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/vjohansen/emacs-config/blob/master/site-lisp/color-file-completion.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The biggest problem is that you lost &lt;code&gt;completions-first-difference&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-06-10T07:08:04.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23857" PostTypeId="2" ParentId="23854" CreationDate="2016-06-10T07:58:18.193" Score="3" Body="&lt;p&gt;Short answer : the function &lt;code&gt;backtrace-frame&lt;/code&gt; should be what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How did I find this ? Well, here are the steps :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;invoke the elisp info manual (my favourite way is &lt;code&gt;C-h r TAB RET&lt;/code&gt;), then&lt;/li&gt;&#xA;&lt;li&gt;search &lt;code&gt;stack&lt;/code&gt; in the index via &lt;code&gt;i stack RET&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The first result brings you to &lt;code&gt;(info &quot;(elisp) Internals of Debugger&quot;)&lt;/code&gt; which mentions &lt;code&gt;backtrace-frame&lt;/code&gt;. I think this has all you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also look at the implementation of the debugger in &lt;code&gt;debug.el&lt;/code&gt;, e.g. with &lt;code&gt;M-x find-function RET debug RET&lt;/code&gt; if you have the sources installed.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-06-10T07:58:18.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23858" PostTypeId="1" AcceptedAnswerId="24637" CreationDate="2016-06-10T08:35:19.403" Score="8" ViewCount="1350" Body="&lt;p&gt;I'm moving from vim to spacemacs, and the only little frustration I have at the moment is that in vim my workflow tends to involve quitting vim a lot (with :q). I find myself continually exiting spacemacs by mistake - and having to wait for it to restart. Habits die hard. How can I either remap ':q' to quit the buffer (and not spacemacs) or disable ':q' completely to force myself to learn to kill buffers the spacemacs way?&lt;/p&gt;&#xA;" OwnerUserId="12015" LastActivityDate="2016-07-16T08:38:27.387" Title="Spacemacs disable :q" Tags="|spacemacs|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23859" PostTypeId="2" ParentId="3874" CreationDate="2016-06-10T09:15:32.947" Score="4" Body="&lt;p&gt;I know this is an old question, but for if someone stumbles upon this: Try &lt;a href=&quot;https://sourceforge.net/projects/emacsbinw64/&quot; rel=&quot;nofollow&quot;&gt;emacsbinw64&lt;/a&gt; or &lt;a href=&quot;https://sourceforge.net/projects/emacs-bin/&quot; rel=&quot;nofollow&quot;&gt;emacsbin&lt;/a&gt;. They contain all required dlls and you don't have to resolve dependencies manually.&lt;/p&gt;&#xA;" OwnerUserId="12284" LastActivityDate="2016-06-10T09:15:32.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23861" PostTypeId="1" CreationDate="2016-06-10T10:21:53.920" Score="1" ViewCount="170" Body="&lt;p&gt;I wasn't sure where to post this question, but I count on the &lt;code&gt;Emax&lt;/code&gt; community when it comes to font-locking and fontification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We all know that AUCTeX is the way to go when writing a document in LaTeX, part of it due to the fontification this mode provides for the default LaTeX macros. But consider this MWE written with &lt;a href=&quot;http://wiki.contextgarden.net/Main_Page&quot; rel=&quot;nofollow noreferrer&quot;&gt;ConTeXt&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\setuplayout&#xA;  [header=2\lineheight,&#xA;   headerdistance=\lineheight]&#xA;&#xA;\setupbackgrounds[header][text][frame=off, bottomframe=on]&#xA;&#xA;\setupheader[style=bold]&#xA;\defineframed[headerframed]&#xA;             [frame=off,&#xA;              align=middle,&#xA;              width=fit]&#xA;\setupheadertexts[\headerframed{C \\ D}]&#xA;\setupheadertexts[\headerframed{A \\ B}][\headerframed{E \\ F}]&#xA;\starttext&#xA;\input knuth&#xA;\stoptext&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In ConTeXt the &lt;code&gt;\starttext&lt;/code&gt; and &lt;code&gt;\stoptext&lt;/code&gt; are the equivalents of &lt;code&gt;\begin{document}&lt;/code&gt; and &lt;code&gt;\end{document}&lt;/code&gt; commands. Yet, Emacs doesn't show any fontification for many of the commands in ConTeXt. I am using &lt;code&gt;moe-theme&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oMXDk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oMXDk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to enable that? is there any known package to do that for you? Do I need to setup that manually command by command? If yes, how?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastActivityDate="2016-06-10T10:21:53.920" Title="Fontification by AUCTeX is great, but font locking for ConTeXt code, any idea?" Tags="|latex|themes|font-lock|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23862" PostTypeId="2" ParentId="23808" CreationDate="2016-06-10T10:45:07.807" Score="4" Body="&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/worg/dev/org-element-api.html&quot; rel=&quot;nofollow&quot;&gt;Org Element API&lt;/a&gt; enables you to create an AST from an Org buffer. There are two options I know of to make use of it: Either create a JSON file as described in &lt;a href=&quot;https://gist.github.com/donlindsay/829d5ffb059aca232261&quot; rel=&quot;nofollow&quot;&gt;this gist&lt;/a&gt; and proceed in your preferred language, or filter the elements of interest in Emacs Lisp using Org-babel blocks and Org-table. Assuming I am in your example buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src elisp :results table&#xA;(nconc&#xA; '((&quot;month&quot; &quot;day&quot; &quot;clockin&quot; &quot;clockout&quot; &quot;duration&quot; &quot;status&quot; &quot;title&quot;))&#xA; '(hline)&#xA; (let ((ast (org-element-parse-buffer 'element)))&#xA;   (org-element-map ast 'clock&#xA;     (lambda (x)&#xA;       (let ((val (org-element-property :value x)))&#xA;     `(,(calendar-month-name (org-element-property :month-start val) t)&#xA;       ,(number-to-string (org-element-property :day-start val))&#xA;       ,(concat (number-to-string (org-element-property :hour-start val))&#xA;            &quot;:&quot;&#xA;            (format &quot;%02d&quot; (org-element-property :minute-start val)))&#xA;       ,(concat (number-to-string (org-element-property :hour-end val))&#xA;            &quot;:&quot;&#xA;            (format &quot;%02d&quot; (org-element-property :minute-end val)))&#xA;       ,(org-element-property :duration x)&#xA;       ,(org-element-property :status x)&#xA;       ,@(org-element-map&#xA;         (org-element-property :parent (org-element-property :parent x))&#xA;         'headline&#xA;           (lambda (x) (org-element-property :title x)))))))))&#xA;#+end_src&#xA;&#xA;#+results:&#xA;| month | day | clockin | clockout | duration | status | title    |&#xA;|-------+-----+---------+----------+----------+--------+----------|&#xA;| Jun   |   6 |   21:13 |    22:29 |     1:16 | closed | Analysis |&#xA;| Jun   |   6 |   14:20 |    17:31 |     3:11 | closed | Analysis |&#xA;| Jun   |   6 |    9:50 |    12:15 |     2:25 | closed | Analysis |&#xA;| Jun   |   7 |    9:07 |    11:46 |     2:39 | closed | Meeting  |&#xA;| Jun   |   6 |   13:43 |    14:20 |     0:37 | closed | Meeting  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To refer to another Org buffer, wrap the code with &lt;code&gt;(with-current-buffer BUFFER ...)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-06-10T10:45:07.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23863" PostTypeId="1" AcceptedAnswerId="23865" CreationDate="2016-06-10T12:03:16.057" Score="1" ViewCount="919" Body="&lt;p&gt;I've some minor mode that I want to hide so that it wouldn't clutter my mode line in my emacs config. But the problem is, even after I put the (diminish 'minor-mode) lines in my .emacs file, the minor modes aren't hidden in mode line. I've to manually evaluate the diminish-mode lines everytime I restart an emacs session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong ? Is there anyway I can fix this behaviour?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-06-10T12:29:14.127" Title="diminish-mode not working in .emacs files" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23865" PostTypeId="2" ParentId="23863" CreationDate="2016-06-10T12:29:14.127" Score="1" Body="&lt;p&gt;At a guess, you're probably trying to diminish a mode before it's been loaded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to the &lt;a href=&quot;https://www.emacswiki.org/emacs/DiminishedModes&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt; for an example of using diminish correctly with &lt;code&gt;eval-after-load&lt;/code&gt;. If you want to address lots of modes, &lt;a href=&quot;https://www.emacswiki.org/emacs/DelightedModes&quot; rel=&quot;nofollow&quot;&gt;delight&lt;/a&gt;'s more compact syntax may appeal.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-06-10T12:29:14.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23866" PostTypeId="2" ParentId="22742" CreationDate="2016-06-10T13:37:21.753" Score="1" Body="&lt;p&gt;Have a look at the package: &lt;a href=&quot;https://github.com/rranelli/auto-package-update.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-package-update&lt;/code&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This package provides functionality for automatically updating your&#xA;  Emacs packages periodically. It is specially useful for people that&#xA;  work in multiple machines and tend to forget to manually update&#xA;  packages from time to time.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The main idea is that you set a desired periodicity for the updates,&#xA;  and when you start Emacs, the packages will be automatically updated&#xA;  if enough days have passed since the last update.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/rranelli/auto-package-update.el/blob/master/auto-package-update.el#L220:L228&quot; rel=&quot;nofollow&quot;&gt;This snippet&lt;/a&gt; shows you if a package is up-to-date:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(let* ((newest-desc (cadr (assq package package-archive-contents)))&#xA;           (installed-desc (cadr (or (assq package package-alist)&#xA;                                     (assq package package--builtins))))&#xA;           (newest-version  (package-desc-version newest-desc))&#xA;           (installed-version (package-desc-version installed-desc)))&#xA;      (version-list-&amp;lt;= newest-version installed-version))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user12181" LastEditorDisplayName="user12181" LastEditDate="2016-06-10T13:55:02.870" LastActivityDate="2016-06-10T13:55:02.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23867" PostTypeId="1" AcceptedAnswerId="23876" CreationDate="2016-06-10T14:45:39.843" Score="5" ViewCount="200" Body="&lt;p&gt;I am currently working on a document for which I use a custom index style file. When I type &lt;code&gt;C-c C-c&lt;/code&gt; to compile my document, Emacs/AucTeX offers to run its &lt;code&gt;Index&lt;/code&gt; command (which I assume runs &lt;code&gt;makeindex&lt;/code&gt;). This works fine, except that the style is not applied. Is there a way to tell AucTeX that it should use a certain style file for this specific LaTeX file (i.e. that it should run &lt;code&gt;makeindex -s mystile.ist&lt;/code&gt;)? I looked around in AucTeX's customizations, but couldn't find any commands related to indexing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&#xA;It seems that the index command is defined in &lt;code&gt;TeX-command-list&lt;/code&gt;. Is there a way to overwrite this for a given file? For example, by adding something to the &lt;code&gt;Local Variables&lt;/code&gt; at the bottom of my &lt;code&gt;.tex&lt;/code&gt; file?&lt;/p&gt;&#xA;" OwnerUserId="421" LastEditorUserId="421" LastEditDate="2016-06-10T14:56:20.127" LastActivityDate="2016-06-10T20:03:48.623" Title="Inform AucTeX about index style file" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23868" PostTypeId="2" ParentId="23858" CreationDate="2016-06-10T15:13:41.323" Score="3" Body="&lt;p&gt;I've never used spacemacs before or evil mode but it would make sense to rebind the key to not do anything like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-ex-map &quot;q&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-10T15:13:41.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23869" PostTypeId="2" ParentId="20565" CreationDate="2016-06-10T15:16:15.017" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/TheBB/spaceline&quot; rel=&quot;nofollow&quot;&gt;Spaceline&lt;/a&gt; helped me customize the mode-line for Helm buffers (uses &lt;code&gt;helm-alive-p&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-06-10T15:16:15.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23870" PostTypeId="1" AcceptedAnswerId="23879" CreationDate="2016-06-10T16:30:20.103" Score="10" ViewCount="3261" Body="&lt;p&gt;I use org-babel to generate some reports which can't be automatically processed, and since org is a good outline format, I print the results in org to represent them as trees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've noticed that nesting org markup into &lt;code&gt;#+begin_example&lt;/code&gt; block makes emacs really slow (and the formatting of the results is off, too).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be really cool to have babel place the output of certain code blocks to a separate buffer (and open a window for it too), the same way as it handles errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked through documentation but it seems like there's no such option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I wrong? If I'm not, maybe someone has such a snippet around?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the slowness might be caused by some other options in my configuration, how's your experience with org formatted text nested into &lt;code&gt;example&lt;/code&gt;? Maybe I'm barking under the wrong tree here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="12333" LastEditorUserId="105" LastEditDate="2016-06-10T16:50:27.770" LastActivityDate="2016-09-19T15:04:27.993" Title="org-babel result to a separate buffer" Tags="|org-mode|buffers|org-babel|window|performance|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23871" PostTypeId="1" CreationDate="2016-06-10T17:03:49.800" Score="14" ViewCount="8984" Body="&lt;p&gt;I'd like to reduce the font size used for code blocks included in my Org-Mode/Beamer presenation.  What command(s) can I use so as only affect the content of the &lt;code&gt;src&lt;/code&gt; block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a minimal working example: the code block is near the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE:     &amp;lt;&amp;lt;title&amp;gt;&amp;gt;&#xA;#+AUTHOR:    Dave&#xA;#+EMAIL:     &#xA;#+DATE:      &amp;lt;&amp;lt;date&amp;gt;&amp;gt;&#xA;#+DESCRIPTION:&#xA;#+KEYWORDS:&#xA;#+LANGUAGE:  en&#xA;#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t &amp;lt;:t&#xA;#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc toc:nil \n:nil&#xA;#+INFOJS_OPT: view:nil toc:t ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js&#xA;#+EXPORT_SELECT_TAGS: export&#xA;#+EXPORT_EXCLUDE_TAGS: noexport&#xA;#+LINK_UP:   &#xA;#+LINK_HOME: &#xA;#+XSLT:&#xA;&#xA;&#xA;&#xA;&#xA;#+startup: beamer&#xA;#+LATEX_CLASS: beamer&#xA;#+LATEX_CLASS_OPTIONS: [bigger]&#xA;#+LATEX_HEADER: \usepackage{pgfpages}&#xA;#+LATEX_HEADER: \pgfpagesuselayout{resize to}[letterpaper,border shrink=5mm,landscape]&#xA;#+LATEX_HEADER: \usetheme{Dresden}&#xA;#+LATEX_HEADER: \usepackage[utf8x]{inputenc}&#xA;#+LATEX_HEADER: \setbeamertemplate{itemize items}[default]&#xA;#+LATEX_HEADER: \setbeamertemplate{enumerate items}[default]&#xA;#+LATEX_HEADER: \institute{} &#xA;&#xA;#+BEAMER_FRAME_LEVEL: 2&#xA;#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)&#xA;&#xA;&#xA;* Presentation&#xA;&#xA;** Code Example&#xA;*** Text&#xA;:PROPERTIES:&#xA;:BEAMER_env: ignoreheading &#xA;:BEAMER_col:0.5&#xA;:END:&#xA;&#xA;- Text describing code&#xA;- More text&#xA;&#xA;*** Graphics&#xA;:PROPERTIES:&#xA;:BEAMER_env: ignoreheading &#xA;:BEAMER_col:0.5&#xA;:END:&#xA;&#xA;% LOOK HERE!&#xA;% I want the text in this code block to be smaller&#xA;#+begin_src python&#xA;import sys&#xA;import os&#xA;import super_cool_module&#xA;&#xA;value=super_cool_module.evalauate(42)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12334" LastActivityDate="2018-09-08T10:14:47.647" Title="How to change font size in code listings in Org-Mode/Beamer" Tags="|org-mode|beamer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23872" PostTypeId="1" CreationDate="2016-06-10T17:14:17.923" Score="8" ViewCount="289" Body="&lt;p&gt;I would like to be able to have an org-mode file that looks like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some Heading     :ignore:noexport:&#xA;** Not exported&#xA;   Some stuff.&#xA;** Other not exported heading&#xA;   More stuff.&#xA;** Exported        :export:&#xA;   Other stuff.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What should get produced when exporting would look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Exported&#xA;--------&#xA;&#xA;Other Stuff.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:ignore:&lt;/code&gt; tag is used in conjunction with the &lt;code&gt;ox-extra&lt;/code&gt; package's &lt;em&gt;ignore-headlines&lt;/em&gt; functionality -- see &lt;a href=&quot;https://emacs.stackexchange.com/a/17677/8541&quot;&gt;this&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that the org-mode file above won't currently export -- &lt;strong&gt;is there a workaround that would allow this to work?&lt;/strong&gt;  It seems like the key here would be to make org-mode work so that the presence of an &lt;code&gt;:export:&lt;/code&gt; tag removes any inherited &lt;code&gt;:noexport:&lt;/code&gt; tag, and vice versa -- the presence of a &lt;code&gt;:noexport:&lt;/code&gt; tag should remove an inherited &lt;code&gt;:export:&lt;/code&gt; tag for the headline.&lt;/p&gt;&#xA;" OwnerUserId="8541" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-03-08T12:49:34.647" Title="How do I export some of the subheadings in a subtree marked as :noexport:?" Tags="|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23874" PostTypeId="1" CreationDate="2016-06-10T18:26:31.707" Score="2" ViewCount="641" Body="&lt;p&gt;In my &lt;code&gt;.bashrc&lt;/code&gt; file I've set the &lt;code&gt;PS1&lt;/code&gt; variable to this to customize my prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export PS1='[\D{%Y-%d-%m} \t \u@\h \W]\n$ '&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/bash/manual/bashref.html#Controlling-the-Prompt&quot; rel=&quot;nofollow&quot;&gt;The format strings are explained in the Bash manual.&lt;/a&gt;&#xA;  This one gives me a prompt that looks like this (in OS X terminal):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[2016-10-06 11:15:16 username@host ~]&#xA;$ &amp;lt;command goes here&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I fire up &lt;code&gt;M-x shell&lt;/code&gt; it doesn't display right:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[\D{-/Users/username/-hostname} \t \u@\h \W]\n$ &amp;lt;command here&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's going on here?  Searching for similar issues I mostly run into cases where people had problems with colorized shell output, but I'm not using that.  And my prompt doesn't really have anything that Emacs shouldn't be able to display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Environment info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2015-04-10 on builder10-9.porkrind.org&lt;/li&gt;&#xA;&lt;li&gt;GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;echo $TERM&lt;/code&gt;:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In OS X Terminal: &lt;code&gt;xterm-256color&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;In Emacs &lt;code&gt;shell&lt;/code&gt;: &lt;code&gt;dumb&lt;/code&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x terminal&lt;/code&gt; works fine, but I don't like &lt;code&gt;M-x terminal&lt;/code&gt;...&lt;/p&gt;&#xA;" OwnerUserId="12335" LastEditorUserId="12335" LastEditDate="2016-06-10T18:40:44.307" LastActivityDate="2016-06-10T18:40:44.307" Title="Custom Bash prompt doesn't display correctly in shell mode" Tags="|shell|shell-mode|" AnswerCount="0" CommentCount="5" ClosedDate="2017-05-20T11:24:13.800" ContentLicense="CC BY-SA 3.0" />
  <row Id="23875" PostTypeId="2" ParentId="23850" CreationDate="2016-06-10T18:46:47.263" Score="0" Body="&lt;p&gt;I don't know how to deal with this problem in generality, but if you know the identity of &lt;code&gt;unaffected-fn&lt;/code&gt; you can &quot;poke holes&quot; in your override like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(noflet&#xA;  ((my-message (msg) (message (concat &quot;@@&quot; msg &quot;@@&quot;)))&#xA;   (unaffected-fn () (noflet ((my-message (msg) (message (concat &quot;**&quot; msg &quot;**&quot;))))&#xA;                       (funcall this-fn))))&#xA;  (target-fn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want to explicitly repeat the definition of &lt;code&gt;my-message&lt;/code&gt; here, you could do this instead for the same effect:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((my-message-orig    (symbol-function 'my-message))&#xA;      (unaffected-fn-orig (symbol-function 'unaffected-fn)))&#xA;    (cl-letf&#xA;        (((symbol-function 'my-message)&#xA;          (lambda (msg) (message (concat &quot;@@&quot; msg &quot;@@&quot;))))&#xA;&#xA;         ((symbol-function 'unaffected-fn)&#xA;          (lambda ()&#xA;            (cl-letf (((symbol-function 'my-message) my-message-orig))&#xA;              (funcall unaffected-fn-orig)))))&#xA;      (target-fn)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, if you don't know exactly which functions are going to call &lt;code&gt;my-message&lt;/code&gt;, you might have to use something like &lt;a href=&quot;https://emacs.stackexchange.com/a/2312/8647&quot;&gt;this answer&lt;/a&gt; to actually inspect the call stack.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-06-10T21:55:31.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23876" PostTypeId="2" ParentId="23867" CreationDate="2016-06-10T20:03:48.623" Score="5" Body="&lt;p&gt;Very good question, it's strange that no one ever asked for this feature.  Luckily, AUCTeX allows you to expand it with a bit of Lisp code.  The trick is to add a new command to &lt;code&gt;TeX-command-list&lt;/code&gt; and a new expander to &lt;code&gt;TeX-expand-list&lt;/code&gt; (for more details see &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Selecting-a-Command&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(info &quot;(auctex)Selecting a command&quot;)&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;tex&quot;&#xA;  '(progn&#xA;     ;; Define a new safe buffer-local variable to change its value on a&#xA;     ;; per-file basis&#xA;     (defvar mg-TeX-index-options &quot;&quot;)&#xA;     (make-variable-buffer-local 'mg-TeX-index-options)&#xA;     (put 'mg-TeX-index-options 'safe-local-variable 'stringp)&#xA;     ;; Add new expansion string&#xA;     (add-to-list 'TeX-expand-list&#xA;          '(&quot;%(indexopts)&quot; (lambda () mg-TeX-index-options)))&#xA;     ;; Add new command.&#xA;     (add-to-list 'TeX-command-list&#xA;          '(&quot;MyIndex&quot;&#xA;            &quot;makeindex %(indexopts) %s&quot;&#xA;            TeX-run-index nil t&#xA;            :help &quot;Run makeindex to create index file&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Compile the index with &lt;code&gt;MyIndex&lt;/code&gt; command rather than &lt;code&gt;Index&lt;/code&gt; when you need to specify a style file, and add &lt;code&gt;mg-TeX-index-options&lt;/code&gt; as a file local variable, that is a string holding the options you want to pass to &lt;code&gt;makeindex&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;%%% Local Variables:&#xA;%%% mode: latex&#xA;%%% TeX-master: t&#xA;%%% mg-TeX-index-options: &quot;-s mystile.ist&quot;&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-06-10T20:03:48.623" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23877" PostTypeId="1" AcceptedAnswerId="23880" CreationDate="2016-06-11T01:03:47.370" Score="1" ViewCount="172" Body="&lt;p&gt;If I have a long line in a javascript file such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  let args = [options.loadRaw ? buffer : path.resolve(filePath)].concat(options.commands);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At some point when I keep adding to that line, it auto-formats into:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  let args = [options.loadRaw ? buffer :&#xA;              path.resolve(filePath)].concat(options.commands); // test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm trying to figure out what is causing this, because it's pretty jarring. I'd rather run this myself manually when I want to like with clang-format. I'm using js2-mode so I have a feeling it's that but I can't figure out what it may be or if it can be disabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it's pretty vague but I don't know what else to say. I'm mainly wondering if there's a way I can find out for myself. I did &lt;code&gt;C-h k&lt;/code&gt; before pressing the space key but it's just &lt;code&gt;self-insert-command&lt;/code&gt;, though I noticed that there's this in the help buffer for that function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;After insertion, the value of ‘auto-fill-function’ is called if the&#xA;‘auto-fill-chars’ table has a non-nil value for the inserted character.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I checked and &lt;code&gt;auto-fill-function&lt;/code&gt; is nil, otherwise that definitely seemed like the culprit. Then I saw this at the end of the help buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;At the end, it runs ‘post-self-insert-hook’.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whose value is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp--post-self-insert-hook-handler helm-find-files--reset-level-tree electric-pair-post-self-insert-function electric-indent-post-self-insert-function blink-paren-post-self-insert-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if this is correct, but I did &lt;code&gt;(setq post-self-insert-hook nil)&lt;/code&gt; in the buffer and then pressed space and it still re-formatted the line, so maybe it's something else? I'm entirely at a loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if this is related, but to see if it was js2-mode buffers I also just noticed some other behavior when in the &lt;code&gt;*stratch*&lt;/code&gt; buffer. If I type out a sexp with just &lt;code&gt;one&lt;/code&gt; repeated over and over, once I get to the fill-column it starts adding spaces, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(one one one one one one one one one one one one one one one one one one one one      one one one one one)&#xA;                                                                                ^ fill column here (column 80)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's certainly different from what happens in js2-mode buffers though, where the line is entirely re-formatted onto separate lines so that it fits within the fill-column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on emacs 25 in case that matters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Disabling auto-fill-mode fixes the issue. The problem is that I want to keep auto-fill-mode. It looks like &lt;code&gt;js2-line-break&lt;/code&gt; is the culprit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (set (make-local-variable 'comment-line-break-function) #'js2-line-break)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My configuration of auto-fill-mode is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun my-prog-auto-fill ()&#xA;    (setq-local comment-auto-fill-only-comments t)&#xA;    (auto-fill-mode 1))&#xA;&#xA;  (add-hook 'prog-mode-hook #'my-prog-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is why, if I setup auto-fill to only apply to comments, and the variable that js2-line-break is being assigned to is called &lt;code&gt;comment-line-break-function&lt;/code&gt; which gives the impression that it only applies when within a comment, why then is &lt;code&gt;js2-line-break&lt;/code&gt; being called despite not being within a comment?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastEditorUserId="8941" LastEditDate="2016-06-11T01:38:34.763" LastActivityDate="2016-06-11T05:06:51.883" Title="What is causing my javascript files to auto-format?" Tags="|debugging|js2-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23879" PostTypeId="2" ParentId="23870" CreationDate="2016-06-11T03:45:48.887" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I've looked through documentation but it seems like there's no such option.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Surprising that &lt;code&gt;org&lt;/code&gt; does not offer &lt;code&gt;:output buffer&lt;/code&gt; option. Maybe this is in the works for future &lt;code&gt;org&lt;/code&gt; versions. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... place the output of certain code blocks to a separate buffer...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here's one way to simulate that functionality: take the output of one source block and &lt;code&gt;stream&lt;/code&gt; it into a &lt;code&gt;new buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: mycontent&#xA;#+BEGIN_SRC emacs-lisp :results value :results raw :exports results&#xA;(print &quot;this content is streamed to a new buffer&quot;)&#xA;#+END_SRC&#xA;&#xA;#+NAME: mystream&#xA;#+BEGIN_SRC emacs-lisp :var c=mycontent :results none&#xA;(prin1 c (generate-new-buffer &quot;new&quot;))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because &lt;code&gt;mycontent&lt;/code&gt; source block feeds the content to &lt;code&gt;mystream&lt;/code&gt;, you will have to execute only the &lt;code&gt;mystream&lt;/code&gt; src block. That is, &lt;code&gt;C-c C-c&lt;/code&gt; on &lt;code&gt;mystream&lt;/code&gt; block. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you &lt;code&gt;C-c C-c&lt;/code&gt; on the &lt;code&gt;mycontent&lt;/code&gt; src block, then the results will be inserted in the same buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although &lt;code&gt;mycontent&lt;/code&gt; is shown as an emacs-lisp src block, this can be any valid org src block. You may have to adjust the &lt;code&gt;:results&lt;/code&gt; options based on the language. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:results none&lt;/code&gt; for the &lt;code&gt;mystream&lt;/code&gt; src block is counter-intuitive, but the magic that gets your content into a new buffer. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-06-11T03:45:48.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23880" PostTypeId="2" ParentId="23877" CreationDate="2016-06-11T05:06:51.883" Score="1" Body="&lt;p&gt;So this was due to auto-fill-mode. I was under the mistaken impression that &lt;code&gt;comment-auto-fill-only-comments&lt;/code&gt; would make auto-fill-mode only apply to comments, but actually it seems like it only applies to &lt;code&gt;comment-indent-new-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that in js2-mode this is set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'comment-line-break-function) #'js2-line-break)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;default-indent-new-line&lt;/code&gt; calls that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall comment-line-break-function soft)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;default-indent-new-line&lt;/code&gt; is called by &lt;code&gt;do-auto-fill&lt;/code&gt;, the default function used for filling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ended up fixing my setup so that auto-fill-mode only applies to comments. I'm not sure if this approach is correct, but it seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun my-fill-nobreak-predicate ()&#xA;    (not (nth 4 (syntax-ppss))))&#xA;&#xA;  (defun my-prog-auto-fill ()&#xA;    (setq-local fill-nobreak-predicate #'my-fill-nobreak-predicate)&#xA;    (auto-fill-mode 1))&#xA;&#xA;  (add-hook 'prog-mode-hook #'my-prog-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wish there was a separate built-in mode like auto-fill-prog-mode, so that I could still opt-in and toggle regular auto-fill-mode whenever I felt like it. But this will do for now I suppose.&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-06-11T05:06:51.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23881" PostTypeId="2" ParentId="23872" CreationDate="2016-06-11T07:22:28.427" Score="1" Body="&lt;p&gt;You should be able to turn off &lt;a href=&quot;http://orgmode.org/manual/Tag-inheritance.html&quot; rel=&quot;nofollow&quot;&gt;tag inheritance&lt;/a&gt; to get this behaviour, but it's unclear what would happen to the 'orphaned' heading. You can do this using &lt;a href=&quot;https://www.emacswiki.org/emacs/FileLocalVariables&quot; rel=&quot;nofollow&quot;&gt;local variables&lt;/a&gt; and setting the &lt;code&gt;org-tags-exclude-from-inheritance&lt;/code&gt; list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have access to emacs right now, but the following (untested!) snippet at the start of your org file might do it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; # -*- mode: org-mode; org-tags-exclude-from-inheritance: '(&quot;noexport&quot;); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2428" LastActivityDate="2016-06-11T07:22:28.427" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23883" PostTypeId="1" CreationDate="2016-06-11T13:29:27.967" Score="2" ViewCount="438" Body="&lt;p&gt;I'm trying to set up org-mobile, but I just get an error whenever I try to push:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Creating agendas...&#xA;Args out of range: 1, 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried both with a blank config and a config as below. EDIT5: Changing &lt;code&gt;org-agenda-files&lt;/code&gt; to use &lt;code&gt;quote&lt;/code&gt; rather than &lt;code&gt;list&lt;/code&gt; doesn't remove the error message.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-directory &quot;~/org&quot;)&#xA;(setq org-agenda-files (list &quot;~/org/notes.org&quot;&#xA;                            &quot;~/org/todo.org&quot;&#xA;                            &quot;~/org/work.org&quot;))&#xA;&#xA;(setq org-mobile-inbox-for-pull &quot;~/org/inbox.org&quot;)&#xA;(setq org-mobile-directory &quot;~/Dropbox/Apps/MobileOrg&quot;)&#xA;&#xA;(setq org-capture-templates&#xA;      '((&quot;t&quot; &quot;Todo&quot; entry (file+headline &quot;~/org/todo.org&quot; &quot;Tasks&quot;)&#xA;        &quot;* TODO %?\n  %i\n  %a&quot;)&#xA;        (&quot;w&quot; &quot;Work&quot; entry (file+datetree &quot;~/org/work.org&quot;)&#xA;        &quot;* %?\nEntered on %U\n  %i\n  %a&quot;)&#xA;        (&quot;n&quot; &quot;Notes&quot; entry (file+datetree &quot;~/org/notes.org&quot;)&#xA;        &quot;* %?\nEntered on %U\n  %i\n  %a&quot;)&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried both with empty org files and my filled org files, but I get the same error anyhow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have zero elisp skills, so I'm not even sure how I can start debugging this issue or get a stack-trace to see where the bug happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what I might be doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I think I managed to get a backtrace, but this looks like black magic.&#xA;EDIT2: I have removed a lot of text that contained special characters with the text STUFF WITH CONTROL CHARACTERS for it to render properly here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range 1 1)&#xA;  vertical-motion(37 nil)&#xA;  (1+ (vertical-motion (or max (buffer-size)) window))&#xA;  (save-restriction (widen) (narrow-to-region (min beg end) (if (and (not count-final-newline) (= 10 (char-before (max beg end)))) (1- (max beg end)) (max beg end))) (goto-char (point-min)) (1+ (vertical-motion (or max (buffer-size)) window)))&#xA;  (save-excursion (save-restriction (widen) (narrow-to-region (min beg end) (if (and (not count-final-newline) (= 10 (char-before (max beg end)))) (1- (max beg end)) (max beg end))) (goto-char (point-min)) (1+ (vertical-motion (or max (buffer-size)) window))))&#xA;  (if (= beg end) 0 (save-excursion (save-restriction (widen) (narrow-to-region (min beg end) (if (and (not count-final-newline) (= 10 (char-before ...))) (1- (max beg end)) (max beg end))) (goto-char (point-min)) (1+ (vertical-motion (or max (buffer-size)) window)))))&#xA;  (let (count-final-newline window) (if (= beg end) 0 (save-excursion (save-restriction (widen) (narrow-to-region (min beg end) (if (and (not count-final-newline) (= 10 ...)) (1- (max beg end)) (max beg end))) (goto-char (point-min)) (1+ (vertical-motion (or max (buffer-size)) window))))))&#xA;  vim-empty-lines-count-screen-lines(2760 5382 37)&#xA;  (1- (vim-empty-lines-count-screen-lines (window-start) (point-max) screen-height))&#xA;  (- screen-height (1- (vim-empty-lines-count-screen-lines (window-start) (point-max) screen-height)))&#xA;  (let ((screen-height (- (window-height) 1 (if header-line-format 1 0)))) (- screen-height (1- (vim-empty-lines-count-screen-lines (window-start) (point-max) screen-height))))&#xA;  (save-current-buffer (set-buffer (window-buffer)) (let ((screen-height (- (window-height) 1 (if header-line-format 1 0)))) (- screen-height (1- (vim-empty-lines-count-screen-lines (window-start) (point-max) screen-height)))))&#xA;  (progn (select-window (car save-selected-window--state) (quote norecord)) (save-current-buffer (set-buffer (window-buffer)) (let ((screen-height (- (window-height) 1 (if header-line-format 1 0)))) (- screen-height (1- (vim-empty-lines-count-screen-lines (window-start) (point-max) screen-height))))))&#xA;  (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (save-current-buffer (set-buffer (window-buffer)) (let ((screen-height (- (window-height) 1 (if header-line-format 1 0)))) (- screen-height (1- (vim-empty-lines-count-screen-lines (window-start) (point-max) screen-height)))))) (internal--after-with-selected-window save-selected-window--state))&#xA;  (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (save-current-buffer (set-buffer (window-buffer)) (let ((screen-height (- ... 1 ...))) (- screen-height (1- (vim-empty-lines-count-screen-lines ... ... screen-height)))))) (internal--after-with-selected-window save-selected-window--state)))&#xA;  (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (save-current-buffer (set-buffer (window-buffer)) (let ((screen-height ...)) (- screen-height (1- ...))))) (internal--after-with-selected-window save-selected-window--state))))&#xA;  (progn (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (save-current-buffer (set-buffer (window-buffer)) (let (...) (- screen-height ...)))) (internal--after-with-selected-window save-selected-window--state)))))&#xA;  (unwind-protect (progn (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (save-current-buffer (set-buffer ...) (let ... ...))) (internal--after-with-selected-window save-selected-window--state))))) (internal--after-save-selected-window save-selected-window--state))&#xA;  (save-current-buffer (unwind-protect (progn (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn (select-window ... ...) (save-current-buffer ... ...)) (internal--after-with-selected-window save-selected-window--state))))) (internal--after-save-selected-window save-selected-window--state)))&#xA;  (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (let ((save-selected-window--state (internal--before-with-selected-window window))) (save-current-buffer (unwind-protect (progn ... ...) (internal--after-with-selected-window save-selected-window--state))))) (internal--after-save-selected-window save-selected-window--state))))&#xA;  vim-empty-lines-nlines-after-buffer-end-aux(#&amp;lt;window 3 on *Backtrace*&amp;gt;)&#xA;  (if (and window-start (or (and (window-end) (= (point-max) (window-end))) (not (pos-visible-in-window-p (point-max) window)))) 0 (vim-empty-lines-nlines-after-buffer-end-aux window))&#xA;  (save-current-buffer (set-buffer (window-buffer window)) (if (and window-start (or (and (window-end) (= (point-max) (window-end))) (not (pos-visible-in-window-p (point-max) window)))) 0 (vim-empty-lines-nlines-after-buffer-end-aux window)))&#xA;  vim-empty-lines-nlines-after-buffer-end(#&amp;lt;window 3 on *Backtrace*&amp;gt; nil)&#xA;  (apply (quote max) (vim-empty-lines-nlines-after-buffer-end w window-start) (mapcar (quote vim-empty-lines-nlines-after-buffer-end) (remq w (get-buffer-window-list nil nil t))))&#xA;  (vim-empty-lines-update-overlay-aux (apply (quote max) (vim-empty-lines-nlines-after-buffer-end w window-start) (mapcar (quote vim-empty-lines-nlines-after-buffer-end) (remq w (get-buffer-window-list nil nil t)))))&#xA;  (progn (vim-empty-lines-update-overlay-aux (apply (quote max) (vim-empty-lines-nlines-after-buffer-end w window-start) (mapcar (quote vim-empty-lines-nlines-after-buffer-end) (remq w (get-buffer-window-list nil nil t))))) (move-overlay vim-empty-lines-overlay (point-max) (point-max)))&#xA;  (if (overlayp vim-empty-lines-overlay) (progn (vim-empty-lines-update-overlay-aux (apply (quote max) (vim-empty-lines-nlines-after-buffer-end w window-start) (mapcar (quote vim-empty-lines-nlines-after-buffer-end) (remq w (get-buffer-window-list nil nil t))))) (move-overlay vim-empty-lines-overlay (point-max) (point-max))))&#xA;  (let ((w (or window (let ((w (selected-window))) (and (window-valid-p w) w))))) (if (overlayp vim-empty-lines-overlay) (progn (vim-empty-lines-update-overlay-aux (apply (quote max) (vim-empty-lines-nlines-after-buffer-end w window-start) (mapcar (quote vim-empty-lines-nlines-after-buffer-end) (remq w (get-buffer-window-list nil nil t))))) (move-overlay vim-empty-lines-overlay (point-max) (point-max)))))&#xA;  vim-empty-lines-update-overlay(#&amp;lt;window 3 on *Backtrace*&amp;gt;)&#xA;  (progn (select-window (car save-selected-window--state) (quote norecord)) (vim-empty-lines-update-overlay w))&#xA;  (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (vim-empty-lines-update-overlay w)) (internal--after-with-selected-window save-selected-window--state))&#xA;  (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (vim-empty-lines-update-overlay w)) (internal--after-with-selected-window save-selected-window--state)))&#xA;  (let ((save-selected-window--state (internal--before-with-selected-window w))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (vim-empty-lines-update-overlay w)) (internal--after-with-selected-window save-selected-window--state))))&#xA;  (lambda (w) (let ((save-selected-window--state (internal--before-with-selected-window w))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (vim-empty-lines-update-overlay w)) (internal--after-with-selected-window save-selected-window--state)))))(#&amp;lt;window 3 on *Backtrace*&amp;gt;)&#xA;  mapc((lambda (w) (let ((save-selected-window--state (internal--before-with-selected-window w))) (save-current-buffer (unwind-protect (progn (select-window (car save-selected-window--state) (quote norecord)) (vim-empty-lines-update-overlay w)) (internal--after-with-selected-window save-selected-window--state))))) (#&amp;lt;window 3 on *Backtrace*&amp;gt;))&#xA;  (progn (mapc (function (lambda (w) (let ((save-selected-window--state (internal--before-with-selected-window w))) (save-current-buffer (unwind-protect (progn ... ...) (internal--after-with-selected-window save-selected-window--state)))))) (window-list (selected-frame) -1)))&#xA;  (unwind-protect (progn (mapc (function (lambda (w) (let ((save-selected-window--state ...)) (save-current-buffer (unwind-protect ... ...))))) (window-list (selected-frame) -1))) (internal--after-save-selected-window save-selected-window--state))&#xA;  (save-current-buffer (unwind-protect (progn (mapc (function (lambda (w) (let (...) (save-current-buffer ...)))) (window-list (selected-frame) -1))) (internal--after-save-selected-window save-selected-window--state)))&#xA;  (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (mapc (function (lambda (w) (let ... ...))) (window-list (selected-frame) -1))) (internal--after-save-selected-window save-selected-window--state))))&#xA;  (progn (select-frame (selected-frame) (quote norecord)) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (mapc (function (lambda ... ...)) (window-list (selected-frame) -1))) (internal--after-save-selected-window save-selected-window--state)))))&#xA;  (unwind-protect (progn (select-frame (selected-frame) (quote norecord)) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (mapc (function ...) (window-list ... -1))) (internal--after-save-selected-window save-selected-window--state))))) (if (frame-live-p old-frame) (progn (select-frame old-frame (quote norecord)))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer))))&#xA;  (let ((old-frame (selected-frame)) (old-buffer (current-buffer))) (unwind-protect (progn (select-frame (selected-frame) (quote norecord)) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (mapc ... ...)) (internal--after-save-selected-window save-selected-window--state))))) (if (frame-live-p old-frame) (progn (select-frame old-frame (quote norecord)))) (if (buffer-live-p old-buffer) (progn (set-buffer old-buffer)))))&#xA;  vim-empty-lines-update-overlay-windows()&#xA;  #&amp;lt;subr set-window-buffer&amp;gt;(nil #&amp;lt;buffer *SUMO*&amp;gt; nil)&#xA;  ad-Advice-set-window-buffer(#&amp;lt;subr set-window-buffer&amp;gt; nil #&amp;lt;buffer *SUMO*&amp;gt;)&#xA;  apply(ad-Advice-set-window-buffer #&amp;lt;subr set-window-buffer&amp;gt; (nil #&amp;lt;buffer *SUMO*&amp;gt;))&#xA;  set-window-buffer(nil #&amp;lt;buffer *SUMO*&amp;gt;)&#xA;  #[(buffer-or-name &amp;amp;optional norecord force-same-window) &quot;STUFF WITH CONTROL CHARACTERS&quot; [buffer-or-name buffer force-same-window norecord entry switch-to-buffer-preserve-window-point window-normalize-buffer-to-switch-to window-buffer window-minibuffer-p user-error &quot;Cannot switch buffers in minibuffer window&quot; pop-to-buffer window-dedicated-p t &quot;Cannot switch buffers in a dedicated window&quot; window-prev-buffers already-displayed get-buffer-window 0 set-window-buffer nil set-window-start selected-window set-window-point 2 select-window displayed] 5 2229158 (list (read-buffer-to-switch &quot;Switch to buffer: &quot;) nil (quote force-same-window))](#&amp;lt;buffer *SUMO*&amp;gt; nil nil)&#xA;  ad-Advice-switch-to-buffer(#[(buffer-or-name &amp;amp;optional norecord force-same-window) &quot;STUFF WITH CONTROL CHARACTERS&quot; [buffer-or-name buffer force-same-window norecord entry switch-to-buffer-preserve-window-point window-normalize-buffer-to-switch-to window-buffer window-minibuffer-p user-error &quot;Cannot switch buffers in minibuffer window&quot; pop-to-buffer window-dedicated-p t &quot;Cannot switch buffers in a dedicated window&quot; window-prev-buffers already-displayed get-buffer-window 0 set-window-buffer nil set-window-start selected-window set-window-point 2 select-window displayed] 5 2229158 (list (read-buffer-to-switch &quot;Switch to buffer: &quot;) nil (quote force-same-window))] #&amp;lt;buffer *SUMO*&amp;gt;)&#xA;  apply(ad-Advice-switch-to-buffer #[(buffer-or-name &amp;amp;optional norecord force-same-window) &quot;STUFF WITH CONTROL CHARACTERS&quot; [buffer-or-name buffer force-same-window norecord entry switch-to-buffer-preserve-window-point window-normalize-buffer-to-switch-to window-buffer window-minibuffer-p user-error &quot;Cannot switch buffers in minibuffer window&quot; pop-to-buffer window-dedicated-p t &quot;Cannot switch buffers in a dedicated window&quot; window-prev-buffers already-displayed get-buffer-window 0 set-window-buffer nil set-window-start selected-window set-window-point 2 select-window displayed] 5 2229158 (list (read-buffer-to-switch &quot;Switch to buffer: &quot;) nil (quote force-same-window))] #&amp;lt;buffer *SUMO*&amp;gt;)&#xA;  switch-to-buffer(#&amp;lt;buffer *SUMO*&amp;gt;)&#xA;  helm-switch-to-buffers(#&amp;lt;buffer *SUMO*&amp;gt;)&#xA;  helm-execute-selection-action-1()&#xA;  helm-execute-selection-action()&#xA;  #[0 &quot;STUFF WITH CONTROL CHARACTERS&quot; [(helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil &quot;*helm mini*&quot; nil nil nil nil mapcar #[257 &quot;STUFF WITH CONTROL CHARACTERS&quot; [] 3 &quot;\n\n(fn V)&quot;] funcall make-byte-code 0 &quot;STUFF WITH CONTROL CHARACTERS&quot; vconcat vector [nil helm-log &quot;restore variables&quot;] 5 &quot;\n\n(fn)&quot; helm-initialize helm-display-buffer helm--remap-mouse-mode 1 add-hook post-command-hook helm--maybe-update-keymap helm--update-header-line helm-log &quot;show prompt&quot; #[0 &quot;\300 \207&quot; [helm-cleanup] 1 &quot;\n\n(fn)&quot;] helm-read-pattern-maybe helm-execute-selection-action &quot;[End session] &quot; make-string 41 45 helm-buffer helm-quit helm-in-persistent-action helm-current-source helm-source-name helm-restored-variables helm-prevent-escaping-from-minibuffer] 9 &quot;\n\n(fn)&quot;]()&#xA;  funcall(#[0 &quot;STUFF WITH CONTROL CHARACTERS&quot; [(helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil &quot;*helm mini*&quot; nil nil nil nil mapcar #[257 &quot;STUFF WITH CONTROL CHARACTERS&quot; [] 3 &quot;\n\n(fn V)&quot;] funcall make-byte-code 0 &quot;STUFF WITH CONTROL CHARACTERS&quot; vconcat vector [nil helm-log &quot;restore variables&quot;] 5 &quot;\n\n(fn)&quot; helm-initialize helm-display-buffer helm--remap-mouse-mode 1 add-hook post-command-hook helm--maybe-update-keymap helm--update-header-line helm-log &quot;show prompt&quot; #[0 &quot;\300 \207&quot; [helm-cleanup] 1 &quot;\n\n(fn)&quot;] helm-read-pattern-maybe helm-execute-selection-action &quot;[End session] &quot; make-string 41 45 helm-buffer helm-quit helm-in-persistent-action helm-current-source helm-source-name helm-restored-variables helm-prevent-escaping-from-minibuffer] 9 &quot;\n\n(fn)&quot;])&#xA;  helm-internal((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil &quot;*helm mini*&quot; nil nil nil)&#xA;  apply(helm-internal ((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil &quot;*helm mini*&quot; nil nil nil))&#xA;  helm((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil &quot;*helm mini*&quot; nil nil nil)&#xA;  apply(helm ((helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) nil nil nil nil &quot;*helm mini*&quot; nil nil nil))&#xA;  helm(:sources (helm-source-buffers-list helm-source-recentf helm-source-buffer-not-found) :buffer &quot;*helm mini*&quot; :ff-transformer-show-only-basename nil :truncate-lines t)&#xA;  helm-mini()&#xA;  call-interactively(helm-mini nil nil)&#xA;  command-execute(helm-mini)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT3: I haven't set up email for emacs yet, and I have already opened this issue, so I'm waiting to contact the bug mailing list I found. Might still be useful to add the bug report information here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.6)&#xA; of 2016-06-04 on juergen&#xA;Package: Org-mode version 8.3.4 (8.3.4-79-gbd4948-elpaplus @ /home/simendsjo/.emacs.d/elpa/org-plus-contrib-20160606/)&#xA;&#xA;current state:&#xA;==============&#xA;(setq&#xA; org-id-locations-file &quot;/home/simendsjo/.emacs.d/.cache/.org-id-locations&quot;&#xA; org-tab-first-hook '(org-hide-block-toggle-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)&#xA; org-clock-persist-file &quot;/home/simendsjo/.emacs.d/.cache/org-clock-save.el&quot;&#xA; org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)&#xA; org-occur-hook '(org-first-headline-recenter)&#xA; org-metaup-hook '(org-babel-load-in-session-maybe)&#xA; org-html-format-drawer-function '(lambda (name contents) contents)&#xA; org-log-done 'time&#xA; org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function&#xA; org-confirm-shell-link-function 'yes-or-no-p&#xA; org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default&#xA; org-link-translation-function 'toc-org-unhrefify&#xA; org-present-mode-hook '(spacemacs//org-present-start)&#xA; org-agenda-restore-windows-after-quit t&#xA; org-latex-format-headline-function 'org-latex-format-headline-default-function&#xA; org-default-notes-file &quot;notes.org&quot;&#xA; org-startup-indented t&#xA; org-after-todo-state-change-hook '(org-clock-out-if-current)&#xA; org-latex-format-drawer-function '(lambda (name contents) contents)&#xA; org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)&#xA; org-agenda-before-write-hook '(org-agenda-add-entry-text)&#xA; org-babel-pre-tangle-hook '(save-buffer)&#xA; org-mode-hook '(#[nil &quot;\300\301\302\303\304$\207&quot; [org-add-hook change-major-mode-hook org-show-block-all append local] 5]&#xA;                 #[nil &quot;\300\301\302\303\304$\207&quot; [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5]&#xA;                 org-babel-result-hide-spec org-babel-hide-all-hashes spacemacs/load-yasnippet toc-org-enable org-bullets-mode&#xA;                 flyspell-mode spacemacs/add-org-surrounds evil-org-mode org-eldoc-load spacemacs//init-company-org-mode&#xA;                 company-mode)&#xA; org-archive-hook '(org-attach-archive-delete-maybe)&#xA; org-ascii-format-drawer-function '(lambda (name contents width) contents)&#xA; org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)&#xA; org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines&#xA;                  org-optimize-window-after-visibility-change)&#xA; org-plantuml-jar-path &quot;/opt/plantuml/plantuml.jar&quot;&#xA; org-present-mode-quit-hook '(spacemacs//org-present-end)&#xA; org-export-async-init-file &quot;/home/simendsjo/.emacs.d/layers/org/org-async-init.el&quot;&#xA; org-babel-tangle-lang-exts '((&quot;haskell&quot; . &quot;hs&quot;) (&quot;emacs-lisp&quot; . &quot;el&quot;) (&quot;elisp&quot; . &quot;el&quot;))&#xA; org-confirm-elisp-link-function 'yes-or-no-p&#xA; org-startup-with-inline-images t&#xA; org-metadown-hook '(org-babel-pop-to-session-maybe)&#xA; org-html-format-headline-function 'org-html-format-headline-default-function&#xA; org-mobile-directory &quot;~/Dropbox/Apps/MobileOrg&quot;&#xA; org-babel-load-languages '((emacs-lisp) (plantuml . t) (sql . t) (haskell . t) (sh . t))&#xA; org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function&#xA; org-fontify-whole-heading-line t&#xA; org-agenda-files '(&quot;~/org/notes.org&quot; &quot;~/org/todo.org&quot; &quot;~/org/work.org&quot;)&#xA; org-clock-out-hook '(org-clock-remove-empty-clock-drawer)&#xA; org-confirm-babel-evaluate 'simendsjo/org-confirm-babel-evaluate&#xA; org-mobile-inbox-for-pull &quot;~/org/inbox.org&quot;&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT4: Looking at the org-mobile.el, the error seems to be within this block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;Creating agendas...&quot;)&#xA;(let ((inhibit-redisplay t)&#xA;(org-agenda-files (mapcar 'car org-mobile-files-alist)))&#xA;  (org-mobile-create-sumo-agenda))&#xA;(message &quot;Creating agendas...done&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't become any smarter though :/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT6: Could it be something strange with this variable?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-mobile-files-alist is a variable defined in `org-mobile.el'.&#xA;Its value is ((&quot;~/org/notes.org&quot; . &quot;notes.org&quot;)&#xA;(&quot;~/org/todo.org&quot; . &quot;todo.org&quot;)&#xA;(&quot;~/org/work.org&quot; . &quot;work.org&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT7: I notice it creates the buffer &lt;code&gt;*SUMO*&lt;/code&gt; containing my agendas:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Week-agenda (W23):&#xA;Monday      6 June 2016 W23&#xA;Tuesday     7 June 2016&#xA;Wednesday   8 June 2016&#xA;Thursday    9 June 2016&#xA;Friday     10 June 2016&#xA;    todo:       Scheduled:  DONE some task here&#xA;Saturday   11 June 2016&#xA;    todo:       In   6 d.:  TODO some task :tag1:tag2:&#xA;Sunday     12 June 2016&#xA;&#xA;=======================================================================================================================================&#xA;Global list of TODO items of type: ALL&#xA;    notes:      TODO task&#xA;    todo:       TODO other task&#xA;    todo:       TODO ... more tasks&#xA;&#xA;=======================================================================================================================================&#xA;Week-agenda (W23):&#xA;more agenda views&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT8: With some tedious printf debugging I found the failing line. I still have no idea why it fails.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-store-agenda-views (&amp;amp;rest parameters)&#xA;  &quot;Store agenda views.&quot;&#xA;  (interactive)&#xA;  ; This line below is the one that fails&#xA;  (eval (list 'org-batch-store-agenda-views)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation for the function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-batch-store-agenda-views is an autoloaded Lisp macro in `org-agenda.el'.&#xA;&#xA;(org-batch-store-agenda-views &amp;amp;rest PARAMETERS)&#xA;&#xA;Run all custom agenda commands that have a file argument.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT9: I've further reduced it. It's a bit difficult for me to go deeper as I don't even know how I can print information about variables correctly. Look at the comment in the following code block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;###autoload&#xA;(defmacro org-batch-store-agenda-views (&amp;amp;rest parameters)&#xA;  &quot;Run all custom agenda commands that have a file argument.&quot;&#xA;  (let ((cmds (org-agenda-normalize-custom-commands org-agenda-custom-commands))&#xA;  (pop-up-frames nil)&#xA;  (dir default-directory)&#xA;  (pars (org-make-parameter-alist parameters))&#xA;  cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname)&#xA;    (save-window-excursion&#xA;      (while cmds&#xA;  (setq cmd (pop cmds)&#xA;        thiscmdkey (car cmd)&#xA;        thiscmdcmd (cdr cmd)&#xA;        match (nth 2 thiscmdcmd)&#xA;        bufname (if org-agenda-sticky&#xA;        (or (and (stringp match)&#xA;          (format &quot;*Org Agenda(%s:%s)*&quot; thiscmdkey match))&#xA;            (format &quot;*Org Agenda(%s)*&quot; thiscmdkey))&#xA;      org-agenda-buffer-name)&#xA;        cmd-or-set (nth 2 cmd)&#xA;        opts (nth (if (listp cmd-or-set) 3 4) cmd)&#xA;        files (nth (if (listp cmd-or-set) 4 5) cmd))&#xA;  (if (stringp files) (setq files (list files)))&#xA;  (when files&#xA;    (message &quot;BUG: The next statement crashes with '1+: Args out of range: 1, 1'&quot;)&#xA;    ; It seems it's the following thing that crashes within the eval call&#xA;    ; (org-agenda nil thiscmdkey)&#xA;    (org-eval-in-environment (append org-agenda-exporter-settings&#xA;            opts pars)&#xA;      (org-agenda nil thiscmdkey))&#xA;    ; We never get here&#xA;    (set-buffer bufname)&#xA;    (while files&#xA;      (org-eval-in-environment (append org-agenda-exporter-settings&#xA;              opts pars)&#xA;        (org-agenda-write (expand-file-name (pop files) dir) nil t bufname)))&#xA;    (and (get-buffer bufname)&#xA;        (kill-buffer bufname)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10624" LastEditorUserId="10624" LastEditDate="2016-06-11T15:24:13.837" LastActivityDate="2016-09-09T18:38:22.277" Title="org-mobile-push gives args out of range" Tags="|mobileorg|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23885" PostTypeId="1" CreationDate="2016-06-11T15:15:05.267" Score="5" ViewCount="1031" Body="&lt;p&gt;Using a simple keyboard macro, I copied the &lt;a href=&quot;http://fontawesome.io/cheatsheet/&quot; rel=&quot;noreferrer&quot;&gt;Font Awesome Cheat Sheet&lt;/a&gt; into an org table. However, I experience some weird inconsistencies when it comes to the formatting - see the picture below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QWeEd.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QWeEd.png&quot; alt=&quot;org table formatting issue&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how that happens and how to fix it? &lt;/p&gt;&#xA;" OwnerUserId="10886" LastActivityDate="2016-06-11T17:01:07.367" Title="org mode table formatting issue" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23886" PostTypeId="2" ParentId="5872" CreationDate="2016-06-11T15:24:32.813" Score="2" Body="&lt;p&gt;It appears that you can customize helm-type-file-actions to, ah, customize which actions are available for a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not appear to be possible to customize the actions offered for differing kinds of files.   Selected actions based based only on name of the files, well that would be fun but it's not in helm today.  Predicting the emacs mode for a file is subtle, it really requires visiting file.&lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="156" LastEditDate="2016-06-12T14:49:23.693" LastActivityDate="2016-06-12T14:49:23.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23887" PostTypeId="1" CreationDate="2016-06-11T15:43:00.227" Score="3" ViewCount="916" Body="&lt;p&gt;Is there a way to get a character by name (e.g. &lt;code&gt;GREEK SMALL LETTER LAMBDA&lt;/code&gt;) instead of by code point (&lt;code&gt;\uX3BB&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="2286" LastEditorUserId="15748" LastEditDate="2018-08-04T12:29:35.253" LastActivityDate="2018-08-04T12:29:35.253" Title="Is there a way to get a Unicode character by name?" Tags="|unicode|insert|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="23888" PostTypeId="2" ParentId="23883" CreationDate="2016-06-11T15:44:05.147" Score="2" Body="&lt;p&gt;I &quot;found&quot; the bug. The problem was the &lt;code&gt;vim-empty-lines&lt;/code&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="10624" LastActivityDate="2016-06-11T15:44:05.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23889" PostTypeId="2" ParentId="23887" CreationDate="2016-06-11T16:11:49.747" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;insert-char&lt;/code&gt; for interactive usage and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(cdr (assoc-string INPUT (ucs-names) t))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for usage in elisp programs. Thereby, &lt;code&gt;INPUT&lt;/code&gt; is the character name string, e.g.,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq INPUT &quot;GREEK SMALL LETTER LAMBDA&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please, see the doc strings of &lt;code&gt;insert-char&lt;/code&gt;, &lt;code&gt;ucs-names&lt;/code&gt;, and &lt;code&gt;assoc-string&lt;/code&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Remark:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;org-entities&lt;/code&gt; to input non-ascii characters. Many translations of LaTeX-sequences into utf8 are already implemented there. I added some more that I often need. Then I wrote a command &lt;code&gt;latex-to-utf8&lt;/code&gt; that translates a LaTeX control sequence before point into the corresponding utf8-character. I bound this command to &lt;kbd&gt;f8&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar latex-to-utf8-scripts)&#xA;(setq latex-to-utf8-scripts&#xA;      '((?+ ?⁺ ?₊)&#xA;    (?- ?⁻ ?₋)&#xA;    (?0 ?⁰ ?₀)&#xA;    (?1 ?¹ ?₁)&#xA;    (?2 ?² ?₂)&#xA;    (?3 ?³ ?₃)&#xA;    (?4 ?⁴ ?₄)&#xA;    (?5 ?⁵ ?₅)&#xA;    (?6 ?⁶ ?₆)&#xA;    (?7 ?⁷ ?₇)&#xA;    (?8 ?⁸ ?₈)&#xA;    (?9 ?⁹ ?₉)))&#xA;&#xA;(require 'org-entities)&#xA;(mapc (lambda (x) (add-to-list 'org-entities-user x)) '((&quot;bull&quot; &quot;\\bullet&quot; nil &quot;&amp;amp;bull;&quot; &quot;*&quot; &quot;*&quot; &quot;•&quot;)&#xA;                            (&quot;plusminus&quot; &quot;\\pm&quot; t &quot;&amp;amp;PlusMinus;&quot; &quot;+-&quot; &quot;+-&quot; &quot;±&quot;)&#xA;                            (&quot;sqrt&quot; &quot;\\sqrt&quot; t &quot;&amp;amp;Sqrt;&quot; &quot;sqrt&quot; &quot;sqrt&quot; &quot;√&quot;)&#xA;                            (&quot;lessless&quot; &quot;\\ll&quot; t &quot;&amp;amp;LessLess;&quot; &quot;&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;&quot; &quot;⪡&quot;)&#xA;                            (&quot;lesseq&quot; &quot;\\leq&quot; t &quot;&amp;amp;lesseq;&quot; &quot;&amp;lt;=&quot; &quot;&amp;lt;=&quot; &quot;≤&quot;)&#xA;                            (&quot;greatereq&quot; &quot;\\geq&quot; t &quot;&amp;amp;greatereq;&quot; &quot;&amp;gt;=&quot; &quot;&amp;gt;=&quot; &quot;≥&quot;)&#xA;                            (&quot;nbsp&quot; &quot;\\medspace&quot; t &quot;&amp;amp;nbsp;&quot; &quot; &quot; &quot; &quot; &quot; &quot;)&#xA;                            (&quot;greatergreater&quot; &quot;\\gg&quot; t &quot;&amp;amp;GreaterGreater;&quot; &quot;&amp;gt;&amp;gt;&quot; &quot;&amp;gt;&amp;gt;&quot; &quot;⪢&quot;)&#xA;                            (&quot;neg&quot; &quot;\\neg&quot; t &quot;&amp;amp;neg;&quot; &quot;/&quot; &quot;/&quot; &quot;¬&quot;)&#xA;                            (&quot;mapsto&quot; &quot;\\mapsto&quot; t &quot;&amp;amp;mapsto;&quot; &quot;|-&amp;gt;&quot;  &quot;|-&amp;gt;&quot; &quot;↦&quot;)&#xA;                            (&quot;times&quot; &quot;\\times&quot; t &quot;&amp;amp;times;&quot; &quot;x&quot; &quot;x&quot; &quot;×&quot;)))&#xA;&#xA;&#xA;&#xA;(defun latex-to-utf8 ()&#xA;  &quot;Replace latex symbol before point by corresponding utf8 symbol.&quot;&#xA;  (interactive)&#xA;  (cond&#xA;   ((looking-back &quot;\\\\[[:alpha:]]+&quot; (line-beginning-position))&#xA;    (let* ((latex-sym (match-string 0))&#xA;       (utf8-sym (loop for org-sym in (append org-entities-user org-entities)&#xA;               if (and (listp org-sym) (string-equal latex-sym (nth 1 org-sym))) return (nth 6 org-sym))))&#xA;      (if utf8-sym&#xA;      (replace-match utf8-sym))))&#xA;   ((looking-back &quot;\\([_^]\\)\\([+-]\\|[+-]?[0-9]+\\)&quot; (line-beginning-position))&#xA;    (let ((scr_idx (if (string-equal (match-string-no-properties 1) &quot;^&quot;) 1 2))&#xA;      (digits (string-to-list (match-string 2))))&#xA;      (replace-match &quot;&quot;)&#xA;      (loop for digit in digits do&#xA;        (insert (nth scr_idx (assoc digit latex-to-utf8-scripts)))&#xA;        )))))&#xA;&#xA;(global-set-key [f8] 'latex-to-utf8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-06-12T11:02:35.883" LastActivityDate="2016-06-12T11:02:35.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23890" PostTypeId="2" ParentId="23885" CreationDate="2016-06-11T17:01:07.367" Score="3" Body="&lt;p&gt;Org-mode table formatting assumes a true fixed-width font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many Unicode glyphs have odd sizes; check for example &lt;em&gt;fa-chevron-left&lt;/em&gt; by setting the cursor there and comparing its size to other standard characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally don't know of a fixed-width font across all characters.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-06-11T17:01:07.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23891" PostTypeId="2" ParentId="22724" CreationDate="2016-06-11T19:15:39.520" Score="2" Body="&lt;p&gt;The folowing solution was tested with bbdb version 2.35:  &lt;a href=&quot;http://bbdb.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;http://bbdb.sourceforge.net/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I gave the bounty-bonus to @Jules Tamagnan for his interesting approach to displaying the entire record as a potential completion candidate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following answer provides for tab-completion using the &lt;strong&gt;name&lt;/strong&gt; field of the database -- &lt;code&gt;completing-read&lt;/code&gt; does &lt;em&gt;not&lt;/em&gt; require a match because that optional argument has been omitted.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun bbdb-search-with-completion (elidep)&#xA;&quot;Display all entries in the BBDB matching the regexp STRING&#xA;in either the name(s), company, network address, or notes.&#xA;Press the tab key for possible name completions without requiring a match.&quot;&#xA;(interactive &quot;P&quot;)&#xA;  (let* (&#xA;      (bbdb-completion-type 'name)&#xA;      (ht (bbdb-hashtable))&#xA;      (completion-ignore-case 't)&#xA;      (string (completing-read &quot;bbdb (regexp):  &quot; ht 'bbdb-completion-predicate))&#xA;      (bbdb-display-layout (bbdb-grovel-elide-arg elidep))&#xA;      (notes (cons '* string))&#xA;      (records (bbdb-search (bbdb-records) string string string notes nil)))&#xA;    (if records&#xA;      (bbdb-display-records records)&#xA;      (message &quot;No records matching '%s'&quot; string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-06-12T19:28:13.693" LastActivityDate="2016-06-12T19:28:13.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23893" PostTypeId="1" AcceptedAnswerId="23973" CreationDate="2016-06-11T19:51:59.820" Score="11" ViewCount="1752" Body="&lt;p&gt;I have an org-mode document in which I wish to keep track of the number of days that have passed since a certain date. Is there a built in function for this, or will I be forced to write a custom elisp function to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="11467" LastActivityDate="2016-06-15T05:03:04.193" Title="Counting the number of days that have passed since a certain date" Tags="|org-mode|time-date|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23894" PostTypeId="2" ParentId="23893" CreationDate="2016-06-11T20:35:03.317" Score="6" Body="&lt;p&gt;The original poster may wish to have a look at the built-in function called &lt;code&gt;calendar-count-days-region&lt;/code&gt; described in the manual:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Counting-Days.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Counting-Days.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is a custom function that uses the &lt;code&gt;org-mode&lt;/code&gt; and &lt;code&gt;calendar-mode&lt;/code&gt; libraries.  Upon my examination of &lt;code&gt;calendar-count-days-region&lt;/code&gt;, I saw that the author included (in the count) the day at the end of the region (i.e., by programmatically adding one day).  In my line of work, counting the last day as part of the total is not permitted -- so I would use something like the following example instead (which does &lt;em&gt;not&lt;/em&gt; add an additional day to the total count).&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'calendar)&#xA;(require 'org)&#xA;&#xA;(defun count-calendar-days ()&#xA;&quot;Count the number of calendar days -- includes holidays, weekends, etc.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (d1 (org-read-date nil nil nil &quot;Insert First Date:  &quot;))&#xA;      (d1-parsed (org-parse-time-string d1))&#xA;      (d1-day (nth 3 d1-parsed))&#xA;      (d1-month (nth 4 d1-parsed))&#xA;      (d1-year (nth 5 d1-parsed))&#xA;      (d1-list (list d1-month d1-day d1-year))&#xA;      (d2 (org-read-date nil nil nil &quot;Insert Second Date:  &quot;))&#xA;      (d2-parsed (org-parse-time-string d2))&#xA;      (d2-day (nth 3 d2-parsed))&#xA;      (d2-month (nth 4 d2-parsed))&#xA;      (d2-year (nth 5 d2-parsed))&#xA;      (d2-list (list d2-month d2-day d2-year))&#xA;      (date1 (calendar-absolute-from-gregorian d1-list))&#xA;      (date2 (calendar-absolute-from-gregorian d2-list))&#xA;      (total-days&#xA;        (let* ((days (- (calendar-absolute-from-gregorian d1-list)&#xA;                        (calendar-absolute-from-gregorian d2-list)))&#xA;               (days (if (&amp;gt; days 0) days (- days))))&#xA;          days)) )&#xA;    (message &quot;%s (+/-) %s = %s&quot; d1 d2 total-days)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-06-12T20:49:37.713" LastActivityDate="2016-06-12T20:49:37.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23896" PostTypeId="1" AcceptedAnswerId="23898" CreationDate="2016-06-11T21:00:57.343" Score="3" ViewCount="476" Body="&lt;p&gt;In emacs --batch  (also, emacs --script),&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;My Message&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will print &quot;My Message&quot; to standard error (file descriptor 2) along with a trailing newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if I don't want the newline?  I see that theoretically,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(princ &quot;My Message&quot; standard-error)` &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would work, if &lt;code&gt;standard-error&lt;/code&gt; were defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Confusingly, &lt;code&gt;standard-output&lt;/code&gt; and &lt;code&gt;standard-input&lt;/code&gt; &lt;em&gt;are&lt;/em&gt; defined, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this even possible?&lt;/p&gt;&#xA;" OwnerUserId="12344" LastEditorUserId="12344" LastEditDate="2016-06-12T15:38:18.323" LastActivityDate="2016-06-12T15:38:18.323" Title="Can I print output to stderr in batch mode WITHOUT a trailing newline?" Tags="|files|batch-mode|print|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23897" PostTypeId="2" ParentId="20261" CreationDate="2016-06-11T21:08:27.777" Score="0" Body="&lt;p&gt;It looks like your &lt;code&gt;python-shell-interpreter&lt;/code&gt; variable is not set properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can examine this variable with &lt;code&gt;C-h C-v python-shell-interpreter&lt;/code&gt;. It should be a string containing the path to your Python interpreter. (On Linux &amp;amp; Mac OS you can check where your interpreter is with &lt;code&gt;which python&lt;/code&gt; on your command line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set it with &lt;code&gt;(setq python-shell-interpreter &amp;lt;path to your Python interpreter&amp;gt;)&lt;/code&gt;. A quick, permanent fix would be to set it in your &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;init.el&lt;/a&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="9063" LastActivityDate="2016-06-11T21:08:27.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23898" PostTypeId="2" ParentId="23896" CreationDate="2016-06-11T21:54:15.843" Score="5" Body="&lt;p&gt;According to the manual, anything printing a message in batch mode will use stderr for this.  The &lt;code&gt;print&lt;/code&gt;/&lt;code&gt;prin1&lt;/code&gt;/&lt;code&gt;princ&lt;/code&gt; family will continue printing to stdout unless you pass the optional argument for picking a different char printing function, therefore the following will work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(princ &quot;My Message&quot; 'external-debugging-output)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Apparently the Emacs developers consider stderr only for reporting errors and debug output ;)&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-06-11T21:54:15.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23900" PostTypeId="1" CreationDate="2016-06-12T04:53:14.133" Score="2" ViewCount="2541" Body="&lt;p&gt;I try to use &lt;code&gt;emacs --batch&lt;/code&gt; in Makefile to tangle my &lt;code&gt;.org&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my test org file (t.org)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Another Header&#xA;&#xA;  #+BEGIN_SRC emacs-lisp &#xA;    (message &quot;Hello&quot;)&#xA;  #+END_SRC&#xA;&#xA;* Header 1&#xA;&#xA;  #+BEGIN_SRC emacs-lisp :tangle yes&#xA;    (provide 't)&#xA;  #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use this command to try to tangle it to &lt;code&gt;lisp/t.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q --batch --eval 'require (quote org))' --eval '(org-babel-tangle-file &quot;t.org&quot; &quot;lisp/t.el&quot; &quot;emacs-lisp&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of get single file (lisp/t.el), I got 2 tangled files:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;t.el&lt;/code&gt; at current directory:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(provide 't)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;lisp/t.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(message &quot;Hello&quot;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is that the expect behaviour? How could I tangle all the source blocks to single file (&lt;code&gt;lisp/t.el&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs: 25.0.94.1 (Built from source)&#xA;Org-mode: 8.3.4&#xA;OS: Ubuntu 16.04&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2016-10-11T15:52:12.113" Title="Why org-babel-tangle-file tangles source blocks to different files?" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23901" PostTypeId="1" AcceptedAnswerId="23903" CreationDate="2016-06-12T05:01:47.237" Score="0" ViewCount="55" Body="&lt;p&gt;I am trying to load package depending on a user's login name&lt;br&gt;&#xA;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a user's login name is &quot;user_foo&quot;, I would like to &lt;code&gt;(require 'user_foo)&lt;/code&gt;. I don't want to hard code the user's login name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require user_login_name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I got `wrong type argument: symbolp, &quot;user_foo&quot;&lt;br&gt;&#xA;What's the right way to do it?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="105" LastEditDate="2016-06-12T14:07:20.677" LastActivityDate="2016-06-12T14:07:20.677" Title="How to require/provide a package name with the value of `user-login-name`, without hard coding it?" Tags="|package|require|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23902" PostTypeId="1" CreationDate="2016-06-12T05:34:23.940" Score="7" ViewCount="6570" Body="&lt;p&gt;I've been working hard to get emacs and org-mode working inside of my tmux workflow. And i've got a pretty decent setup. :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed org-bullets to get utf8 bullets, it worked. But even if I set into my emacs init file that I want the clean view it show the previous stars for every item. Also tried with the in-file solution but nothing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is specifically what I tried&lt;/p&gt;&#xA;&#xA;&lt;p&gt;on my init: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Hide leading stars&#xA;(setq org-startup-indented t&#xA;      org-hide-leading-stars t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On my org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: indent&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works perfectly on the windowed environment, buy inside my terminal&#xA;stars didn't disappear&lt;/p&gt;&#xA;" OwnerUserId="12317" LastActivityDate="2016-10-16T21:07:23.053" Title="How to hide leading stars in windowless emacs org-mode?" Tags="|org-mode|terminal-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23903" PostTypeId="2" ParentId="23901" CreationDate="2016-06-12T05:42:23.753" Score="5" Body="&lt;pre&gt;&lt;code&gt;(require (intern user-login-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;require&lt;/code&gt; needs a symbol as its argument, the value of &lt;code&gt;user-log-name&lt;/code&gt; is a string, &lt;code&gt;intern&lt;/code&gt; takes a string and returns a symbol.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-06-12T05:42:23.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23904" PostTypeId="2" ParentId="23902" CreationDate="2016-06-12T07:02:57.857" Score="8" Body="&lt;p&gt;The variable &lt;code&gt;org-hide-leading-stars&lt;/code&gt; just uses the face &lt;code&gt;org-hide&lt;/code&gt; behind the scenes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; (to get help on a variable) and then typing &lt;code&gt;org-hide-leading-stars&lt;/code&gt;&lt;kbd&gt;Enter&lt;/kbd&gt; will show you what you need to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation for the variable says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil means hide the first N-1 stars in a headline. This works by&#xA;  using the face &lt;code&gt;org-hide&lt;/code&gt; for these stars.  This face is white for a&#xA;  light background, and black for a dark background.  &lt;strong&gt;You may have to&#xA;  customize the face &lt;code&gt;org-hide&lt;/code&gt; to make this work.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emphasis mine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize the face by typing&#xA;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;code&gt;customize-face&lt;/code&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;code&gt;org-hide&lt;/code&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set the foreground color of the face to the colour of your background in tmux.&lt;/p&gt;&#xA;" OwnerUserId="294" LastActivityDate="2016-06-12T07:02:57.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23905" PostTypeId="2" ParentId="5872" CreationDate="2016-06-12T07:33:25.850" Score="2" Body="&lt;p&gt;You can add custom actions to the list by creating an eshell alias.&#xA;In the documentation on the &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki/Find-Files#eshell-command-on-files&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt;, it says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Completion is made on your Eshell aliases.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you can do it 2 ways&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create an alias in an eshell buffer by typing &lt;code&gt;alias foo cat \$1&lt;/code&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Creating a function in lisp, and then creating an alias for the function, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;(defun myaction2 (file)&#xA;  (message &#xA;    (concat &quot;My custom action with file: &quot; file)))&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;evaluate that function, then in an eshell buffer type &lt;code&gt;alias bar myaction2 \\$1&lt;/code&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now in you when you activate your helm-find-files, you can select a file, and your custom actions will be under the action &lt;em&gt;&quot;Eshell command on file(s)&quot;&lt;/em&gt;, or you can hit the shortcut &lt;kbd&gt;M-!&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="294" LastActivityDate="2016-06-12T07:33:25.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23907" PostTypeId="1" CreationDate="2016-06-12T09:55:59.440" Score="4" ViewCount="616" Body="&lt;p&gt;I'm trying to set my desktop environment to use emacsclient to open text files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like only one emacs x-window to be opened. Yet I don't know which command can be used to have an x-window created if and only if no emacs x-window already exists.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The command &lt;code&gt;emacsclient %F&lt;/code&gt; doesn't work when no x-window exists.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The command &lt;code&gt;emacsclient -c %F&lt;/code&gt; always creates a new x-window.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't know how to check for the existence of an emacs x-window.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Which command / script should I use ?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;By &lt;em&gt;x-window&lt;/em&gt; I mean 'what a window is for the window-manager'&lt;/p&gt;&#xA;" OwnerUserId="11516" LastEditorUserId="25" LastEditDate="2016-07-13T18:44:10.347" LastActivityDate="2016-07-13T18:44:10.347" Title="Get emacsclient to reuse exising X-window, iff any" Tags="|frames|emacsclient|x11|" AnswerCount="1" CommentCount="0" ClosedDate="2016-07-13T18:44:17.487" ContentLicense="CC BY-SA 3.0" />
  <row Id="23908" PostTypeId="1" AcceptedAnswerId="23944" CreationDate="2016-06-12T09:58:33.477" Score="3" ViewCount="892" Body="&lt;p&gt;I'm trying &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;o&quot;) nil)&#xA;(define-key evil-normal-state-map (kbd &quot;o&quot;) 'evil-end-of-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the key remains bound to &lt;code&gt;evil-open-below&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW I'm using &lt;code&gt;spacemacs&lt;/code&gt; on emacs 24.5.1&lt;/p&gt;&#xA;" OwnerUserId="12348" LastEditorUserId="253" LastEditDate="2017-03-11T15:12:38.973" LastActivityDate="2017-03-11T15:12:38.973" Title="Cannot remap key in evil-normal-state-map" Tags="|key-bindings|evil|spacemacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23909" PostTypeId="1" AcceptedAnswerId="23915" CreationDate="2016-06-12T10:30:23.700" Score="2" ViewCount="1410" Body="&lt;p&gt;For code editing, and maybe other things too (but not for modes where the tab key has a special behaviour, notably org-mode), I want the tab key to indent, even when in evil normal (or motion) state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently when I hit tab in evil normal mode in say lisp-mode, there is no effect (that would also be true for python-mode, except I have a special hack for that one case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU emacs 25 (not spacemacs)&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2016-06-12T16:36:18.693" LastActivityDate="2016-09-26T03:23:14.670" Title="Tab always indent even in evil normal mode?" Tags="|key-bindings|indentation|evil|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23911" PostTypeId="2" ParentId="23907" CreationDate="2016-06-12T10:45:14.647" Score="0" Body="&lt;pre&gt;&lt;code&gt;emacsclient -a /usr/bin/emacs %F&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you also want to use daemon mode, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/12894/make-emacsclient-create-a-frame-only-if-there-isnt-one-already&quot;&gt;Make emacsclient create a frame only if there isn&amp;#39;t one already&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-06-12T10:45:14.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23912" PostTypeId="1" CreationDate="2016-06-12T11:42:20.433" Score="6" ViewCount="443" Body="&lt;p&gt;My Emacs is running in foreground in terminal emulator, where I am also running some background processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs is garbled by the stdout and stderr output of the background process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides redirecting the stdout and stderr output of the background process to &lt;code&gt;/dev/null&lt;/code&gt;, is there another way to make my emacs not bothered by the background process? For example, can something be done on the emacs side?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2016-06-12T17:33:33.040" Title="Emacs is garbled by output of a background process running in the same terminal emulator" Tags="|shell|ubuntu|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23913" PostTypeId="2" ParentId="23912" CreationDate="2016-06-12T12:09:19.200" Score="6" Body="&lt;p&gt;No, there isn't, if you don't want to silence your background processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could use something like &lt;a href=&quot;https://tmux.github.io/&quot;&gt;tmux&lt;/a&gt; or &lt;a href=&quot;https://www.gnu.org/software/screen/&quot;&gt;GNU Screen&lt;/a&gt; for your background processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you could run them in another terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But Emacs has no way of knowing that some other process is outputting characters to the terminal, as far as I know.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2016-06-12T12:09:19.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23915" PostTypeId="2" ParentId="23909" CreationDate="2016-06-12T13:54:21.083" Score="3" Body="&lt;p&gt;If you don't care about &lt;code&gt;TAB&lt;/code&gt;/&lt;code&gt;C-i&lt;/code&gt; not being available (which would normally jump to the last location), just unbind it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'evil-maps&#xA;  (define-key evil-motion-state-map (kbd &quot;TAB&quot;) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, customize the user variable responsible for establishing the key binding &lt;em&gt;before&lt;/em&gt; loading Evil:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-want-C-i-jump nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-06-12T13:54:21.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23917" PostTypeId="1" AcceptedAnswerId="23919" CreationDate="2016-06-12T16:49:56.480" Score="33" ViewCount="5665" Body="&lt;p&gt;The manual's &lt;a href=&quot;https://magit.vc/manual/magit/Introduction.html#Introduction&quot;&gt;introduction&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Magit wraps and in many cases improves upon at least the following Git porcelain commands: add, am, bisect, blame, branch, checkout, cherry, cherry-pick, clean, clone, commit, config, describe, diff, fetch, format-patch, init, log, merge, merge-tree, &lt;strong&gt;mv&lt;/strong&gt;, notes, pull, rebase, reflog, remote, request-pull, reset, revert, rm, show, stash, submodule, and tag.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, I can't quite figure out how to actually move a file from it. Sure I can just run &lt;code&gt;git mv&lt;/code&gt;, but taking that to the logical extreme we might as well just use &lt;code&gt;git&lt;/code&gt; instead of Magit :P Considering the manual mentions &lt;code&gt;mv&lt;/code&gt;, I wonder if that's a mistake or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only found &lt;a href=&quot;https://stackoverflow.com/questions/17610365/how-to-use-git-mv-from-magit&quot;&gt;this old question&lt;/a&gt; but it's very old by Magit standards. Perhaps things have changed?&lt;/p&gt;&#xA;" OwnerUserId="8941" LastActivityDate="2016-08-31T10:48:52.063" Title="how to move/rename a file within Magit?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23918" PostTypeId="2" ParentId="23912" CreationDate="2016-06-12T17:33:33.040" Score="5" Body="&lt;p&gt;In emacs, Ctl-L will refresh the screen, removing any extra stuff written by your background process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the background process only emits stuff every once in a while, then you can just refresh each time.&lt;/p&gt;&#xA;" OwnerUserId="12345" LastActivityDate="2016-06-12T17:33:33.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23919" PostTypeId="2" ParentId="23917" CreationDate="2016-06-12T17:55:03.623" Score="39" Body="&lt;p&gt;&lt;code&gt;magit-file-rename&lt;/code&gt; is bound to &lt;kbd&gt;R&lt;/kbd&gt; in &lt;code&gt;magit-mode&lt;/code&gt; buffers.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="306" LastEditDate="2016-08-31T10:48:52.063" LastActivityDate="2016-08-31T10:48:52.063" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23920" PostTypeId="1" CreationDate="2016-06-12T18:08:28.013" Score="1" ViewCount="254" Body="&lt;p&gt;EDIT: My problem has been fixed or, more precisely, worked around, thanks to help in the comments below. Never figured out what exactly the issue was as it wasn't a problem with my Emacs configuration but with my Emacs installation (which I had originally done via Homebrew).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 25.0.5 on OS X 10.10.5. For some reason, Emacs displays &lt;code&gt;‘ ’&lt;/code&gt; and &lt;code&gt;“ ”&lt;/code&gt; only as &lt;code&gt;' '&lt;/code&gt; and &lt;code&gt;&quot; &quot;&lt;/code&gt;, respectively. The behavior persists in &lt;code&gt;typopunct-mode&lt;/code&gt; (from the &lt;a href=&quot;https://www.emacswiki.org/emacs/TypographicalPunctuationMarks&quot; rel=&quot;nofollow&quot;&gt;Typopunct package&lt;/a&gt;), although things like en- and em-dashes display correctly as distinct Unicode characters. The behavior also persists if I use a variable width typeface I am certain has glyphs for curly quotes.&lt;/p&gt;&#xA;" OwnerUserId="12311" LastEditorUserId="12311" LastEditDate="2016-06-13T18:01:52.370" LastActivityDate="2016-06-13T18:01:52.370" Title="How do I get curly quotation marks to show in Emacs on OS X?" Tags="|osx|faces|fonts|unicode|typography|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23921" PostTypeId="2" ParentId="23900" CreationDate="2016-06-12T19:41:30.737" Score="2" Body="&lt;p&gt;From org &lt;a href=&quot;http://orgmode.org/manual/Extracting-source-code.html#Extracting-source-code&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;:tangle no&lt;/strong&gt;&#xA;       The default.  The code block is not included in the tangled &#xA;  output.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;:tangle yes&lt;/strong&gt;&#xA;       Include the code block in the tangled output.  The output file name&#xA;       is the name of the org file with the extension ‘.org’ replaced by&#xA;       the extension for the block language.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And from &lt;code&gt;org-babel-tangle-file&lt;/code&gt; doc string (emphasis mine)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Optional argument TARGET-FILE can be used to specify a &lt;strong&gt;default&lt;/strong&gt;&#xA;  export file for all source blocks.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So your second block having &lt;code&gt;:tangle yes&lt;/code&gt; implicitly specify the filename to be used for this block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, my understanding (and this is not exactly obvious) is that the file name provided to &lt;code&gt;org-babel-tangle-file&lt;/code&gt; changes the default for the lack of a &lt;code&gt;:tangle&lt;/code&gt; argument from &lt;code&gt;:tangle no&lt;/code&gt; to &lt;code&gt;:tangle filename&lt;/code&gt; with the provided filename.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To tangle all your blocks to the same file, simply remove the &lt;code&gt;:tangle yes&lt;/code&gt; argument from the blocks that have it.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-06-12T19:41:30.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23922" PostTypeId="2" ParentId="23871" CreationDate="2016-06-12T19:49:00.807" Score="14" Body="&lt;p&gt;It depends on whether you load the &lt;code&gt;listings&lt;/code&gt; package in your &lt;code&gt;.emacs&lt;/code&gt; file. You can check the contents of the Emacs variable &lt;code&gt;org-latex-default-packages-alist&lt;/code&gt; (use the key combo &lt;code&gt;C-h v&lt;/code&gt; to see the help and contents of a variable). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the &lt;code&gt;listings&lt;/code&gt; package is not loaded, org-mode will use the &lt;code&gt;verbatim&lt;/code&gt; LaTeX environment to typeset the code. In that case you can use the &lt;code&gt;fancyvrb&lt;/code&gt; LaTeX package to typeset the code in a smaller font. For example, add the following to your org-mode file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \RequirePackage{fancyvrb}&#xA;#+LATEX_HEADER: \DefineVerbatimEnvironment{verbatim}{Verbatim}{fontsize=\scriptsize}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This redefines the default &lt;code&gt;verbatim&lt;/code&gt; environment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the &lt;code&gt;listings&lt;/code&gt; package is loaded, you can add the following LaTeX code to your org file to get a smaller font for the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX_HEADER: \lstset{basicstyle=\scriptsize\ttfamily}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set the style to use a monospaced font of size &lt;code&gt;\scriptsize&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\tiny&lt;/code&gt; is the smallest relative font size in LaTeX. In order of increasing size you could try: &lt;code&gt;\scriptsize&lt;/code&gt;, &lt;code&gt;\footnotesize&lt;/code&gt;, &lt;code&gt;\small&lt;/code&gt;, which are all smaller than &lt;code&gt;\normalsize&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2016-06-12T19:49:00.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23923" PostTypeId="1" CreationDate="2016-06-12T20:54:09.130" Score="0" ViewCount="508" Body="&lt;p&gt;I would like to use normal modes commands like &lt;code&gt;d&lt;/code&gt; &lt;code&gt;c&lt;/code&gt; &lt;code&gt;x&lt;/code&gt; etc without the content being copied to clipboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to make emacs so that only &lt;code&gt;y&lt;/code&gt; command will write anything to the clipboard. Other commands like &lt;code&gt;d&lt;/code&gt; should only delete the content without writing anything to the clipboard.&lt;/p&gt;&#xA;" OwnerUserId="12354" LastActivityDate="2020-10-11T07:00:36.877" Title="Change dd command in evil mode to not write to clipboard" Tags="|evil|clipboard|" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23924" PostTypeId="1" CreationDate="2016-06-12T20:56:04.670" Score="0" ViewCount="452" Body="&lt;p&gt;Because I used helm's helm-source-mac-spotlight I often get email files in my result lists.  This is great.  It often surfaces old discussions about the issue I'm working on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, these files have the raw message in them.  Plenty of headers and mime parts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't do my mail handling in emacs usually.  It's been decades since I last set up a reasonable system for doing that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm seeking a more friendly view the *.eml files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did notice that people often set the .eml files to have mail-mode or mail-message-mode, but neither of these appear to lead to a friendly end result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions?&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2016-06-12T20:56:04.670" Title="Seeking scheme for readonly viewing email messages, i.e. *.eml" Tags="|email|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23925" PostTypeId="1" AcceptedAnswerId="23942" CreationDate="2016-06-13T00:21:15.590" Score="7" ViewCount="4790" Body="&lt;p&gt;I am using elpy for my Python development, but I would like to set the per-line character limit to 120 instead of the default 80 used by PEP8. Any suggestions on how I can do this? Even better, it would be great if I can customize this setting on a per-project basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-group elpy&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-mode elpy-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-mode python-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but I can't seem to find the option that customizes the line character limit.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastActivityDate="2021-03-25T03:48:38.803" Title="How to customize the line character length in elpy?" Tags="|syntax|elpy|ide|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23926" PostTypeId="1" CreationDate="2016-06-13T02:07:55.487" Score="3" ViewCount="170" Body="&lt;p&gt;I just spent a significant amount of time debugging an issue that boils down to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-new-alist ()&#xA;  `((x . nil)))&#xA;&#xA;(setq a (my-new-alist))&#xA;(setq b (my-new-alist))&#xA;&#xA;(push 1 (alist-get 'x a))&#xA;b ;; ((x . 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expected &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; to be independent of each other (that is, I expected &lt;code&gt;my-new-alist&lt;/code&gt; to be pure. Instead, it seems to create a new list when the defun is executed, and always return a reference to that very list. Part of my confusion stems from comparing with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-new-list ()&#xA;  nil)&#xA;&#xA;(setq a (my-new-list))&#xA;(setq b (my-new-list))&#xA;&#xA;(push 1 a)&#xA;a ;; =&amp;gt; (1)&#xA;b ;; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note also that anti-quoting the nil part fixes the issue, it seems; that is, the following function doesn't exhibit the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-new-alist ()&#xA;  `((x . ,nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the significant difference between the list and alist examples? Which parts of the ELisp manual discuss this issue? Why does antiquoting the &lt;code&gt;nil&lt;/code&gt; part fix things?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is similar to, but not the same as, &lt;a href=&quot;https://emacs.stackexchange.com/questions/18444/proper-reinitialization-of-a-list-what-is-happening-under-the-hood&quot;&gt;Proper reinitialization of a list? What is happening under the hood?&lt;/a&gt;. The answers to that question doesn't discuss why using &lt;code&gt;nil&lt;/code&gt; isn't a problem, nor do they explain why antiquoting nil makes a difference. Additionally, I am looking for references in the Emacs lisp manual.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-06-13T03:23:56.827" Title="Why is this function not pure" Tags="|list|quote|mutability|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="23927" PostTypeId="2" ParentId="23926" CreationDate="2016-06-13T03:23:56.827" Score="2" Body="&lt;p&gt;This does require precision to state correctly; I'll give it a go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever a form is read in, &lt;code&gt;read&lt;/code&gt; is creating some lisp structure as it goes. The result of reading the text &quot;(defun my-new-alist () `((x . nil)))&quot; is a list of four elements, &lt;code&gt;'defun&lt;/code&gt;, &lt;code&gt;'my-new-alist&lt;/code&gt;, &lt;code&gt;nil&lt;/code&gt;, and finally &lt;code&gt;(quote ((x . nil)))&lt;/code&gt;. When you &lt;code&gt;eval&lt;/code&gt; this list, &lt;code&gt;eval&lt;/code&gt; creates a function object using the &lt;code&gt;caaar&lt;/code&gt; and &lt;code&gt;caaaar&lt;/code&gt; as the argument list and the body, and assigns it to the environment using the name in the &lt;code&gt;caar&lt;/code&gt;. This is straight forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when you call the function, it has to &lt;code&gt;eval&lt;/code&gt; the body in the environment created by extending the environment of the call site by creating new bindings for the formal paramters in the arglist and the values from the call (this is just dynamic scope, and isn't actually relevant here, since your arglist is nil). The first thing it evaluates here is the call to the &lt;code&gt;quote&lt;/code&gt; special form. &lt;code&gt;quote&lt;/code&gt; is a form and not a function, because it specifically returns its argument without evaluating it, whereas all the arguments to a function call are evaluated automatically. Thus all calls to &lt;code&gt;my-new-alist&lt;/code&gt; return a reference to the same list, in fact to the list that was created when this form was &lt;code&gt;read&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we look at &lt;code&gt;push&lt;/code&gt;. If we look in the ELisp manual, on the List Variables page (run &lt;code&gt;M-x (info &quot;(elisp)List Variables&quot;)&lt;/code&gt; to jump right to it), we see that &quot;[push] creates a new list whose CAR is ELEMENT and whose CDR is the list specified by LISTNAME, and saves that list in LISTNAME.&quot; We also see that &lt;code&gt;push&lt;/code&gt; is equivalent to &lt;code&gt;(setf LISTNAME (cons ELEMENT LISTNAME))&lt;/code&gt;. In this case, that's &lt;code&gt;(setf (alist-get 'x a) (cons 1 (alist-get 'x a))&lt;/code&gt;. This actually changes the value of the &lt;code&gt;cdr&lt;/code&gt; in your alist to point to the newly-created &lt;code&gt;cons&lt;/code&gt;. Anyone who has a reference to the alist will then see this new &lt;code&gt;cons&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-06-13T03:23:56.827" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23928" PostTypeId="2" ParentId="19850" CreationDate="2016-06-13T07:35:00.067" Score="2" Body="&lt;p&gt;According to the description of &lt;code&gt;(org-publish)&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-publish PROJECT &amp;amp;optional FORCE ASYNC)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Publish PROJECT.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;PROJECT is either a project name, as a string, or a project&#xA;  alist (see `org-publish-project-alist' variable).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So I created an emacs-lisp-script following this scheme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/emacs --script&#xA;&#xA;(package-initialize)&#xA;(require 'org)&#xA;&#xA;(setq subprojects '((&quot;foobar&quot;&#xA;             :base-directory &quot;./files/&quot;&#xA;             :base-extension &quot;org&quot;&#xA;             :publishing-directory &quot;./_pages/&quot;&#xA;             :publishing-function org-html-publish-to-html&#xA;             ;; :exclude &quot;regex-stuff to exlude&quot;&#xA;             :headline-levels 3&#xA;             :section-numbers nil&#xA;             :with-toc t)&#xA;&#xA;            (&quot;images&quot;&#xA;             :base-directory &quot;./images/&quot;&#xA;             :base-extension &quot;jpg\\|gif\\|png&quot;&#xA;             :publishing-directory &quot;./_pages/images/&quot;&#xA;             :publishing-function org-publish-attachement)))&#xA;&#xA;(mapc (lambda (project) (org-publish project t)) bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works quite well for me so far, except that you need to publish from command-line and can't do from the buffer anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only thing I'd like to improve is to be able to pass in the &lt;code&gt;FORCE&lt;/code&gt; parameter via command line and not having to edit the file all the time.&lt;/p&gt;&#xA;" OwnerUserId="9389" LastEditorUserId="9389" LastEditDate="2016-06-13T07:41:29.957" LastActivityDate="2016-06-13T07:41:29.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23929" PostTypeId="1" CreationDate="2016-06-13T08:31:51.690" Score="1" ViewCount="1222" Body="&#xA;&#xA;&lt;p&gt;Interspersed in a text file I have&#xA;&lt;code&gt;0:36Skip to 0 minutes and 36 seconds  blah blah&lt;/code&gt;,&#xA;always at the beginning of a line.&#xA;I am looking for a function to search and delete these. Failing, I have&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun mddtt ()&#xA;  (interactive)&#xA;  (re-search-forward &quot;[0-9]:&quot;)&#xA;  (goto-char (line-beginning-position))&#xA;  (push-mark nil 1 t)&#xA;  (search-forward &quot;seconds&quot;)&#xA;  (setq st (pop-mark))&#xA;  (setq en (point))&#xA;  (delete-region st en))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error is &lt;code&gt;mddtt: Wrong type argument: integer-or-marker-p, nil&lt;/code&gt;&#xA;(not sure where).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running this manually, I will introduce checking for failed searches, but I'm happy just to exit the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Improvements pleas?&lt;/p&gt;&#xA;" OwnerUserId="207" LastEditorUserId="5296" LastEditDate="2016-06-13T13:16:03.057" LastActivityDate="2016-06-17T18:06:14.937" Title="Elisp search and delete" Tags="|search|text|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23930" PostTypeId="1" CreationDate="2016-06-13T09:24:01.940" Score="1" ViewCount="1585" Body="&lt;p&gt;I'm creating some doxygen in Emacs and I can't find any mode for this purpose. The only mode I found is the below project which seems too old (last release from 2007!). Do you any alternatives to this mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://doxymacs.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;http://doxymacs.sourceforge.net/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version in use: GNU Emacs 25.1.50.2&lt;/p&gt;&#xA;" OwnerUserId="9962" LastActivityDate="2018-11-20T22:03:00.617" Title="Doxygen support" Tags="|documentation|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23931" PostTypeId="1" AcceptedAnswerId="24065" CreationDate="2016-06-13T10:58:16.647" Score="7" ViewCount="4029" Body="&lt;p&gt;Windows has an environment variable &lt;code&gt;HOME&lt;/code&gt; which is on a remote serve (say Y:/, set by administrator and suppose not to be changed) and I start Emacs on my local disk, say C:/. (Emacs becomes slow if I start from Y:/)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However &lt;code&gt;.gitconfig&lt;/code&gt; file locates on Y:/ by default and magit cannot find it so I don't have the right settings for user name and emails, even if I move &lt;code&gt;.gitconfig&lt;/code&gt; to C:/.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to set magic and git settings independently or read &lt;code&gt;.gitconfig&lt;/code&gt; from Y:/?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit version: Git 2.7.4.windows.1, Emacs 24.4.1, windows-nt&lt;/p&gt;&#xA;" OwnerUserId="12358" LastEditorUserId="306" LastEditDate="2016-08-31T10:47:39.957" LastActivityDate="2016-08-31T10:47:39.957" Title="Configure Magit user name and email" Tags="|magit|config|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="23932" PostTypeId="1" AcceptedAnswerId="24136" CreationDate="2016-06-13T11:52:51.097" Score="0" ViewCount="98" Body="&lt;p&gt;I have a specific request to all you regex wizards :) &#xA;I want to create a simple function that deletes or cleans out several parts of a text file based on predefined keywords (such as single capital letter, some changing phrases that start end with same words etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use the function to clean out references based on pre defined words/sentences. for example this is how the original (initial) reference will look:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;6.  F. NordioPD, A. ZanobbeiC, I. &amp;amp; J. D. SchwratzPI. 2015. Changing patterns of the temperature-mortality association by time and location in the US, and implications for climate change 81, 80-86. Environment International (3 Citations, IF= 5.559 ; Q1 Environmental Sciences , 8 of 221)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what i want is to clear out:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) all the added words to a name such as &lt;code&gt;NordioPD&lt;/code&gt; note the &lt;code&gt;PD&lt;/code&gt; part. the words that we use are 'PD' ,'C' or 'PI' based on the type of contributor and are attached in uppercase to the author last name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) in addition there is always a line at the end of the reference that looks like this&#xA;&lt;code&gt;(3 Citations, IF= 5.559 ; Q1 Environmental Sciences , 8 of 221)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the line always starts with &lt;code&gt;(X citations)&lt;/code&gt; where X can be any number and ends with the &lt;code&gt;)&lt;/code&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using the above example the reference i want to end up with will look something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;6.  F. Nordio, A. Zanobbei, I. &amp;amp; J. D. Schwratz. 2015. Changing patterns of the temperature-mortality association by time and location in the US, and implications for climate change 81, 80-86. Environment International.&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any regex wizard out there know how to deal with this?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11387" LastEditDate="2016-06-23T07:27:27.133" LastActivityDate="2016-06-25T07:09:42.907" Title="a function to clear out particular words/characters via regex" Tags="|regular-expressions|functions|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23933" PostTypeId="1" CreationDate="2016-06-13T11:59:01.180" Score="0" ViewCount="236" Body="&lt;p&gt;I want to create a new key binding that puts out a single letter with a key combination. For example: &lt;code&gt;M-E&lt;/code&gt; inserts an &quot;ê&quot; character. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="12361" LastEditorUserId="253" LastEditDate="2016-07-13T15:04:35.053" LastActivityDate="2016-11-10T17:41:50.943" Title="Key binding for letters with diacritics?" Tags="|key-bindings|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23935" PostTypeId="1" CreationDate="2016-06-13T14:54:19.787" Score="1" ViewCount="576" Body="&lt;p&gt;The &lt;code&gt;emacs&lt;/code&gt; command from emacs23-lucid under wheezy honors the&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-iconic -xrm '*iconX: 3350' -xrm '*iconY: 300' -xrm '*bitmapIcon: off'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;command-line arguments. But emacs from emacs24-gtk under jessie does not.&#xA;(The version from emacs24-gtk under jessie does handle &lt;code&gt;-geometry&lt;/code&gt; but handles&#xA;it incorrectly, or at least differently than emacs23-lucid under wheezy. It&#xA;doesn't handle the &lt;code&gt;-5&lt;/code&gt; in &lt;code&gt;-geometry 80x24-5+200&lt;/code&gt; correctly.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if this is a gtk-vs-lucid thing, a 23-vs-24 thing, or a&#xA;wheezy-vs-jessie thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this to create a panel of small Emacs icons with just the hostnames for&#xA;all of my machines on my desktop. (I run twm.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the gtk version of Emacs seems to be the future (and some machine that I&#xA;use only have the gtk version; I can't change that because I don't maintain&#xA;them), I'd like to migrate to the gtk version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one achieve the equivalent of the above command-line arguments with&#xA;the gtk version?&lt;/p&gt;&#xA;" OwnerUserId="12362" LastEditorUserId="675" LastEditDate="2016-06-13T21:45:36.550" LastActivityDate="2016-06-13T21:45:36.550" Title="emacs lucid vs. gtk and -iconic -xrm" Tags="|window|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23936" PostTypeId="1" CreationDate="2016-06-13T15:40:57.623" Score="2" ViewCount="114" Body="&lt;p&gt;I like the colors from these beautiful themes, but I wish I could disable the font resizing.&lt;a href=&quot;https://i.stack.imgur.com/JhSHv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JhSHv.png&quot; alt=&quot;Here&amp;#39;s an example.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12363" LastActivityDate="2017-01-10T00:16:20.817" Title="Some themes make my font multiple sizes. How can I disable this?" Tags="|fonts|themes|colors|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23937" PostTypeId="2" ParentId="17990" CreationDate="2016-06-13T15:43:10.690" Score="14" Body="&lt;p&gt;I had also a bad experience with company at the beginning, but in my setup I just put these lines.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq company-dabbrev-downcase 0)&#xA;(setq company-idle-delay 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first variable is used to skip the downcase that company does to the variables I autocomplete, the second one I think you already have.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun tab-indent-or-complete ()&#xA;  (interactive)&#xA;  (if (minibufferp)&#xA;      (minibuffer-complete)&#xA;    (if (or (not yas-minor-mode)&#xA;            (null (do-yas-expand)))&#xA;        (if (check-expansion)&#xA;            (company-complete-common)&#xA;          (indent-for-tab-command)))))&#xA;&#xA;(global-set-key [backtab] 'tab-indent-or-complete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also these lines are useful to trigger the completion pressing the key you want.&lt;/p&gt;&#xA;" OwnerUserId="6869" LastEditorUserId="675" LastEditDate="2016-06-13T21:45:54.067" LastActivityDate="2016-06-13T21:45:54.067" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23938" PostTypeId="2" ParentId="20755" CreationDate="2016-06-13T15:45:25.430" Score="0" Body="&lt;p&gt;Okay so I figured out what the problem was! I asked this over a month ago and recently solved it. If anybody else runs across this problem I want them to know that there is a solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem comes from &lt;code&gt;eldoc-mode&lt;/code&gt; and/or &lt;code&gt;global-eldoc-mode&lt;/code&gt;. &lt;code&gt;Global-eldoc-mode&lt;/code&gt; is on by default in emacs 25 and that is why it was not an issue in emacs 24 despite the fact that this has been a long lasting bug. The issue was that emacs would request the documentation from the process automatically because of eldoc-mode but would then hangup if the interpetter was busy. This issue is now fixed in the emacs-25 branch on git and it will be included in the next pretest and in the release of emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What emacs now does it simply timeout and stop eldoc mode from requesting the documentation if it ever times out. This feature can be configured with &lt;code&gt;python-eldoc-function-timeout&lt;/code&gt; &lt;code&gt;python-eldoc-get-doc&lt;/code&gt; and &lt;code&gt;python-eldoc-function-timeout-permanent&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-13T15:45:25.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23939" PostTypeId="2" ParentId="23936" CreationDate="2016-06-13T15:50:03.937" Score="0" Body="&lt;p&gt;I think the only way to do this is to set the &lt;code&gt;:height&lt;/code&gt; attribute for the faces that you want to use. for example I have something like this in my config. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar jat/default-font-size 100)&#xA;(set-face-attribute 'default nil :height jat/default-font-size)&#xA;(set-face-attribute 'org-document-title nil :height jat/default-font-size)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-13T15:50:03.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23940" PostTypeId="2" ParentId="17783" CreationDate="2016-06-13T15:50:23.750" Score="1" Body="&lt;p&gt;Maybe you can try to setup emacs-server so you can have a better experience. &#xA;Using this approach or running emacs as a daemon you can just use emacsclient to start new windows not loading another emacs instance. It is a nice approach. I have not tested it in Windows but here is link that explains how to use it. I hope it helps you man.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://wikemacs.org/wiki/Emacs_server#MS_Windows&quot; rel=&quot;nofollow&quot;&gt;Emacs Server&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6869" LastActivityDate="2016-06-13T15:50:23.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23941" PostTypeId="1" CreationDate="2016-06-13T15:55:34.703" Score="0" ViewCount="750" Body="&lt;p&gt;I'm trying to show assembly under the cursor in emacs (spacemacs, on mac os x) and although disaster.el does generate assembly with objdump, it fails to associate lines in source with lines in assembly.  Error: &quot;couldn't find corresponding assembly line&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;disaster.el has not been updated in 3 years either, so I'm wondering if there is another package for this, or if we can get disaster.el working?&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2018-04-20T08:29:38.590" Title="c/c++ disassembler for emacs and objdump" Tags="|c++|c|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23942" PostTypeId="2" ParentId="23925" CreationDate="2016-06-13T17:39:27.610" Score="9" Body="&lt;p&gt;If you want to customize per project basis, you can create a &lt;code&gt;setup.cfg&lt;/code&gt; with custom config like this&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[flake8]&#xA;max-line-length = 160&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you want to change this globally, you can change flake8 config as mentioned here &lt;a href=&quot;https://flake8.pycqa.org/en/latest/user/configuration.html#user-configuration&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://flake8.pycqa.org/en/latest/user/configuration.html#user-configuration&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2021-03-25T03:48:38.803" LastActivityDate="2021-03-25T03:48:38.803" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="23943" PostTypeId="1" CreationDate="2016-06-13T18:46:22.417" Score="2" ViewCount="246" Body="&lt;p&gt;I started using ranger and it's awesome, but one thing bothers me: It keeps every visited folder open in a buffer, so it floods my buffer list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two options that seem to be made to solve this problem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ranger Cleanup Eagerly&lt;/li&gt;&#xA;&lt;li&gt;Ranger Cleanup On Disable&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first one makes ranger unusable as I cannot open folders anymore in ranger-mode (could be a bug).&#xA;The second one sounds exactly like what I am looking for, but has no effect either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="12284" LastEditorUserId="454" LastEditDate="2016-06-23T10:45:30.553" LastActivityDate="2016-06-23T10:45:30.553" Title="Ranger: cleanup doesn't work" Tags="|dired|ranger|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23944" PostTypeId="2" ParentId="23908" CreationDate="2016-06-13T19:46:42.163" Score="5" Body="&lt;p&gt;To change definitions inside a keymap, it must be available at the time you access it.  In this case it would happen after Evil has been loaded which unless you've explicitly done that before that snippet will not be the case.  The cleanest way of deferring it until that point would be using &lt;code&gt;with-eval-after-load&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'evil-maps&#xA;  (define-key evil-normal-state-map (kbd &quot;o&quot;) 'evil-end-of-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-06-13T19:46:42.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23945" PostTypeId="2" ParentId="23929" CreationDate="2016-06-13T19:47:37.727" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Replace.html#Replace&quot; rel=&quot;nofollow&quot;&gt;Search and replace&lt;/a&gt; already exists in Emacs!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-M-% ^.*?[0-9]:.*?seconds RET RET .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-M-%&lt;/code&gt; invokes &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Query-Replace.html#index-query_002dreplace_002dregexp&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;query-replace-regexp&lt;/code&gt;&lt;/a&gt;. You enter a regular expression, then the replacement text (empty). The final &lt;code&gt;.&lt;/code&gt; says to perform one replacement only, you can press &lt;code&gt;Y&lt;/code&gt; instead to replace all remaining occurrences, &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;n&lt;/code&gt; to replace the current occurrence or not and move to the next one without stopping search-and-replace, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html&quot; rel=&quot;nofollow&quot;&gt;regular expression&lt;/a&gt; I wrote mimics what you do:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;start at the beginning of a line (&lt;code&gt;^&lt;/code&gt;);&lt;/li&gt;&#xA;&lt;li&gt;skip to the first occurrence of a digit followed by a colon (&lt;code&gt;.*?&lt;/code&gt; uses a shortest-match repeat operator so it stops at the first occurrence of what follows, &lt;code&gt;.*&lt;/code&gt; would skip to the last digit-colon that's followed by &lt;code&gt;seconds&lt;/code&gt; on the same line);&lt;/li&gt;&#xA;&lt;li&gt;skip to the first subsequent occurrence of &lt;code&gt;seconds&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;the whole match is deleted since the replacement text is empty.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In a Lisp program, you can write &lt;code&gt;(replace-regexp &quot;^.*?[0-9]:.*?seconds&quot; &quot;&quot;)&lt;/code&gt; to replace all occurrences from the point to the end of the buffer, but as the documentation of &lt;code&gt;replace-regexp&lt;/code&gt; tells you, most of the work of &lt;code&gt;replace-regexp&lt;/code&gt; is related to its interactive use, and in Lisp you're encouraged to write your own loop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while (re-search-forward &quot;^.*?[0-9]:.*?seconds&quot;)&#xA;  (replace-match &quot;&quot; nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you wanted to replace just one occurrence (like your function), that would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (re-search-forward &quot;^.*?[0-9]:.*?seconds&quot;)&#xA;    (replace-match &quot;&quot; nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Writing nontrivial Lisp code would be needed if your search pattern was too complex to be recognized by a regular expression. When you write Lisp code, don't use the mark: that's a user-level feature which is rarely appropriate for internal use. To store a position in a buffer, use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Local-Variables.html#Local-Variables&quot; rel=&quot;nofollow&quot;&gt;local variable&lt;/a&gt; defined by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Local-Variables.html#index-let&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;let&lt;/code&gt;&lt;/a&gt;. Always use &lt;code&gt;let&lt;/code&gt; to define variables that you use locally in a function, otherwise your calls to &lt;code&gt;setq&lt;/code&gt; pollute global variables. The current position is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Point.html#index-point-1&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(point)&lt;/code&gt;&lt;/a&gt;; this is a number that doesn't change if the buffer is subsequently modified. If you need a location that tracks when text is inserted or removed before it — which is not the case here — use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Markers.html#Markers&quot; rel=&quot;nofollow&quot;&gt;marker&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mddtt ()&#xA;  (interactive &quot;@*&quot;)&#xA;  (re-search-forward &quot;[0-9]:&quot;)&#xA;  (let ((st (line-beginning-position)))&#xA;    (search-forward &quot;seconds&quot;)&#xA;    (delete-region st (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To summarize:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Look for built-in features before reinventing the wheel.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;let&lt;/code&gt; for local variables.&lt;/li&gt;&#xA;&lt;li&gt;Don't use the mark for internal purposes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-06-17T18:06:14.937" LastActivityDate="2016-06-17T18:06:14.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23946" PostTypeId="1" AcceptedAnswerId="23947" CreationDate="2016-06-13T20:20:34.700" Score="21" ViewCount="5586" Body="&lt;p&gt;I have an org document that contains a lot of source code snippets in it. I want the results of the code to be exported when exporting to Html. On export Emacs asks me if I want to evaluate the code block on my system once for every bit of source code. This is a lot of questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to stop Emacs for asking for confirmation every time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact message is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Evaluate this goban code block on your system? (y or n)&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note goban is the babel language I am exporting. (It is actually an image of a go board).&lt;/p&gt;&#xA;" OwnerUserId="2194" LastEditorUserId="2194" LastEditDate="2016-06-13T20:27:38.430" LastActivityDate="2020-05-26T13:40:05.737" Title="How can I stop the confirmation to evaluate source code when exporting to html?" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23947" PostTypeId="2" ParentId="23946" CreationDate="2016-06-13T20:30:52.230" Score="23" Body="&lt;p&gt;&lt;code&gt;org-confirm-babel-evaluate&lt;/code&gt; can be set to &lt;code&gt;nil&lt;/code&gt; to disable confirmation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;http://orgmode.org/manual/Code-evaluation-security.html#Code-evaluation-security&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Source code blocks&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Source code blocks can be evaluated during export, or when pressing&#xA;       ‘C-c C-c’ in the block.  The most important thing to realize here&#xA;       is that Org mode files which contain code snippets are, in a&#xA;       certain sense, like executable files.  So you should accept them&#xA;       and load them into Emacs only from trusted sources—just like you&#xA;       would do with a program you install on your computer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Make sure you know what you are doing before customizing the&#xA;       variables which take off the default security brakes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-- User Option: org-confirm-babel-evaluate&#xA;      When t (the default), the user is asked before every code&#xA;      block evaluation.  When ‘nil’, the user is not asked.  When&#xA;      set to a function, it is called with two arguments (language&#xA;      and body of the code block) and should return t to ask and&#xA;      ‘nil’ not to ask.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As suggested by @Emmanuel Goldstein, the &lt;code&gt;:eval&lt;/code&gt; header argument can be used for finer control.  It can be set to refuse evaluation, ask confirmation, directly evaluate, for each source block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://orgmode.org/manual/Evaluating-Code-Blocks.html#index-eval_002c-header-argument&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The &lt;code&gt;:eval&lt;/code&gt; header argument can limit evaluation of specific code&#xA;  blocks.  It is useful for protection against evaluating untrusted &lt;code&gt;src&lt;/code&gt;&#xA;  code blocks by prompting for a confirmation.  This protection is&#xA;  independent of the ‘org-confirm-babel-evaluate’ setting.&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;‘never or no’&#xA;   Org will never evaluate this ‘src’ code block.&lt;/li&gt;&#xA;  &lt;li&gt;‘query’&#xA;   Org prompts the user for permission to evaluate this ‘src’ code&#xA;   block.&lt;/li&gt;&#xA;  &lt;li&gt;‘never-export or no-export’&#xA;   Org will not evaluate this ‘src’ code block when exporting, yet the&#xA;   user can evaluate this source block interactively.&lt;/li&gt;&#xA;  &lt;li&gt;‘query-export’&#xA;   Org prompts the user for permission to export this ‘src’ code&#xA;   block.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;:eval&lt;/code&gt; header argument is not set for a source block, then Org&#xA;  determines whether to evaluate from the &lt;code&gt;org-confirm-babel-evaluate&lt;/code&gt;&#xA;  variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2020-05-26T13:40:05.737" LastActivityDate="2020-05-26T13:40:05.737" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="23949" PostTypeId="2" ParentId="23936" CreationDate="2016-06-13T20:34:54.543" Score="1" Body="&#xA;&#xA;&lt;p&gt;If you really want to be heavy-handed about it, you could wipe out the &lt;code&gt;:height&lt;/code&gt; attribute of every defined font except for &lt;code&gt;default&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar face-height-whitelist nil&#xA;  &quot;List of faces for which the :height attribute should be&#xA;  preserved by the function `remove-face-heights'&quot;)&#xA;&#xA;;; source: http://emacs.stackexchange.com/a/23949/93&#xA;(defun remove-face-heights ()&#xA;  &quot;Unset the :height attribute for every face except for&#xA;`default' and any faces listed in `face-height-whitelist'&quot;&#xA;  (mapc&#xA;   (lambda (face)&#xA;     (unless (or (eq face 'default)&#xA;                 (memq face face-height-whitelist))&#xA;       (set-face-attribute face nil :height 'unspecified)))&#xA;   (face-list)))&#xA;&#xA;(add-hook 'after-init-hook 'remove-face-heights)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adding the above code to your init file would wipe out the &lt;code&gt;:height&lt;/code&gt; attribute on any faces that are defined after emacs is initialized.  If along the way you find out that there are some face heights that you want to preserve, you can add those faces to &lt;code&gt;face-height-whitelist&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'face-height-whitelist 'some-special-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-06-13T20:34:54.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23950" PostTypeId="2" ParentId="10274" CreationDate="2016-06-13T21:29:23.010" Score="2" Body="&lt;p&gt;You can do this by using lazy highlight in your .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lazy-highlight-cleanup nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9410" LastActivityDate="2016-06-13T21:29:23.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23951" PostTypeId="1" AcceptedAnswerId="23952" CreationDate="2016-06-13T21:54:06.277" Score="2" ViewCount="498" Body="&lt;p&gt;In the description of the function &lt;code&gt;goto-line&lt;/code&gt; in the built-in emacs documentation, I found the following at the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This function is usually the wrong thing to use in a Lisp program.&#xA;What you probably want instead is something like:&#xA;  (goto-char (point-min))&#xA;  (forward-line (1- N))&#xA;If at all possible, an even better solution is to use char counts&#xA;rather than line counts.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similarly, the &lt;code&gt;switch-to-buffer&lt;/code&gt; function's documentation says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;WARNING: This is NOT the way to work on another buffer temporarily&#xA;within a Lisp program!  Use `set-buffer' instead.  That avoids&#xA;messing with the window-buffer correspondences.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to know the non-interactive versions of frequent interactive functions like &lt;code&gt;save-buffer&lt;/code&gt;, &lt;code&gt;kill-line&lt;/code&gt; etc. or that these are efficient and do not have a non-interactive equivalent?&#xA;I did not find any relevant information about the two specific commands &lt;code&gt;save-buffer&lt;/code&gt; and &lt;code&gt;kill-line&lt;/code&gt; in the built-in documentation, so I would also like to know if that implies that these are okay for non-interactive use.&lt;/p&gt;&#xA;" OwnerUserId="10971" LastEditorUserId="105" LastEditDate="2016-06-13T22:39:49.897" LastActivityDate="2016-06-13T22:39:49.897" Title="how to find non-interactive function equivalents of elisp interactive functions" Tags="|interactive|documentation|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23952" PostTypeId="2" ParentId="23951" CreationDate="2016-06-13T22:24:47.713" Score="4" Body="&lt;p&gt;Most commands are absolutely fine for both interactive and non-interactive use, so a default position of &quot;if it doesn't say otherwise, it's ok for non-interactive use&quot; is going to be fine in the majority of cases (and if you find &lt;em&gt;undocumented&lt;/em&gt; cases where this is not so, you could submit a documentation bug report).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation aside, I don't believe there are any explicit pointers to other functions built into the code. You can always examine the source code for the command to see whether it looks like a wrapper around a simpler piece of code which you could be using instead, however.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-06-13T22:24:47.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23953" PostTypeId="1" AcceptedAnswerId="24006" CreationDate="2016-06-13T22:49:21.347" Score="9" ViewCount="1800" Body="&lt;p&gt;When using gdb with &lt;code&gt;M-x gdb&lt;/code&gt;, the &lt;code&gt;*input/output*&lt;/code&gt; buffer always pops up aggressively in any frame which has focus and isn't already displaying it. I would like the &lt;code&gt;*input/output*&lt;/code&gt; buffer to stay quietly in the background unless I manually bring it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a very simple example with &lt;code&gt;emacs -Q&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;run &lt;code&gt;M-x gdb&lt;/code&gt;. give a program of &lt;code&gt;bash&lt;/code&gt; and hit &lt;code&gt;Return&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the &lt;code&gt;*gud-bash*&lt;/code&gt; window, enter &lt;code&gt;run -c &quot;while true; do echo hi &amp;amp;&amp;amp; sleep 1; done&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice how the &lt;code&gt;*input/output of bash*&lt;/code&gt; window pops up. If you dismiss that buffer with &lt;code&gt;C-x 1&lt;/code&gt; from the &lt;code&gt;*gud-bash*&lt;/code&gt; window, it comes back as soon as gdb produces any more stdout. That's the behavior I don't want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, now run &lt;code&gt;M-x make-frame&lt;/code&gt; (from the &lt;code&gt;*gud-bash*&lt;/code&gt; window). Notice how in the new frame, &lt;code&gt;*input/output of bash*&lt;/code&gt; also pops up! So it demands one window out of every single emacs frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I almost forgot to add - emacs version of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.5.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.30)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9459" LastActivityDate="2018-10-05T12:59:45.867" Title="How can I prevent gdb *input/output* buffer from aggressively popping up in frame?" Tags="|window|frames|gud|gdb|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23954" PostTypeId="2" ParentId="20790" CreationDate="2016-06-14T07:16:51.327" Score="9" Body="&lt;p&gt;You can't set mu4e-maildir in contexts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cf. &lt;a href=&quot;http://www.djcbsoftware.nl/code/mu/mu4e/Contexts-example.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.djcbsoftware.nl/code/mu/mu4e/Contexts-example.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can set any kind of variable; including settings for mail servers etc. However, settings such as mu4e-maildir and mu4e-mu-home are not changeable after they have been set without quitting mu4e first.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, you should set as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mu4e-maildir &quot;~/.mail&quot;&#xA;      mu4e-contexts&#xA;    `( ,(make-mu4e-context&#xA;         :name &quot;home&quot;&#xA;         :match-func (lambda (msg) (when msg (mu4e-message-contact-field-matches msg :to &quot;personal-email@gmail.com&quot;)))&#xA;         :vars '((mu4e-trash-folder      . &quot;/personal/[Gmail].Trash&quot;)))&#xA;       ,(make-mu4e-context&#xA;         :name &quot;work&quot;&#xA;         :match-func (lambda (msg) (when msg (mu4e-message-contact-field-matches msg :to &quot;work-email@gmail.com&quot;)))&#xA;         :vars '((mu4e-trash-folder      . &quot;/work/[Gmail].Bin&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-06-14T07:16:51.327" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23955" PostTypeId="1" CreationDate="2016-06-14T08:41:03.697" Score="4" ViewCount="246" Body="&lt;p&gt;In git I run this command to show recently used branches: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git for-each-ref --sort=-committerdate --count=10 refs/heads&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do this in magit?&lt;/p&gt;&#xA;" OwnerUserId="12329" LastActivityDate="2022-11-29T17:04:12.973" Title="Show recently used branches" Tags="|magit|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23956" PostTypeId="1" CreationDate="2016-06-14T11:39:50.807" Score="1" ViewCount="353" Body="&lt;p&gt;How can I tell paredit-everywhere to use bindings from paredit, &#xA;so I can : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use paredit's keybinding without having to redeclare them&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Keep paredit-everywhere shortcuts the same as paredit if I change a shortcut in paredit &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/purcell/paredit-everywhere/blob/master/paredit-everywhere.el&quot; rel=&quot;nofollow&quot; title=&quot;paredit-everywhere&quot;&gt;paredit-everywhere.el&lt;/a&gt; and paredit use mode-map to define keys. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better way of formulate my question could be &quot;how to use some paredit mode-map keys in paredit-everywhere mode-map when mode is paredit-everywhere) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Inheritance-and-Keymaps.html&quot; rel=&quot;nofollow&quot;&gt;this manual page&lt;/a&gt; and came up with this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (package-installed-p 'paredit-everywhere)&#xA;  (require 'paredit-everywhere)&#xA;  (eval-after-load 'paredit-everywhere&#xA;    '(progn (set-keymap-parent paredit-everywhere-mode-map paredit-mode-map)&#xA;        (define-key paredit-everywhere-mode-map (kbd &quot;(&quot;) nil)&#xA;        (define-key paredit-everywhere-mode-map (kbd &quot;)&quot;) nil)&#xA;        (define-key paredit-everywhere-mode-map (kbd &quot;[&quot;) nil)&#xA;        (define-key paredit-everywhere-mode-map (kbd &quot;]&quot;) nil)))&#xA;  (add-hook 'prog-mode-hook 'paredit-everywhere-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works (but is kinda-hacky) it make the paredit-everywhere-mode-map parent's paredit-mode-map and set the parenthesis, bracet open,close to nil to avoid the extra space added by paredit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do not hesitate to share if you have a better solution thus&lt;/p&gt;&#xA;" OwnerUserId="12375" LastEditorUserId="12375" LastEditDate="2016-06-17T10:56:35.317" LastActivityDate="2016-06-17T10:56:35.317" Title="use paredit key bindings with paredit-everywhere" Tags="|paredit|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23957" PostTypeId="1" AcceptedAnswerId="23959" CreationDate="2016-06-14T11:50:56.987" Score="0" ViewCount="160" Body="&lt;p&gt;I have 5 rows of text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1   0%&#xA;2   от 1% до 20%&#xA;3   от 21% до 50%&#xA;4   от 51% до 100%&#xA;5   100%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I would like to copy everything after digits (1..5) to a table column &lt;code&gt;PRC&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| N | PRC|&#xA;|   |    |&#xA;|   |    |&#xA;|   |    |&#xA;|   |    |&#xA;|   |    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried different rectangle commands but was unable to select correct rectangle from 0% to 100% -- I only got part of text.&lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-06-14T12:50:16.643" Title="Copy rectangle text into org-table" Tags="|rectangle|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23958" PostTypeId="1" CreationDate="2016-06-14T11:59:41.580" Score="6" ViewCount="1237" Body="&lt;p&gt;I want to highlight the current symbol under the cursor as well as the current line, but with different background colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining &lt;code&gt;highlight-symbol-mode&lt;/code&gt; and &lt;code&gt;hl-line-mode&lt;/code&gt; only highlights the entire line with the hl-line-mode color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;a href=&quot;http://www.emacswiki.org/emacs/download/hl-line%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;hl-line+&lt;/code&gt;&lt;/a&gt; installed and have tried reducing the &lt;code&gt;hl-line-overlay-priority&lt;/code&gt; option but that does not seem to work. The entire line still get the same background color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other modes or settings I can set to make this work?&lt;/p&gt;&#xA;" OwnerUserId="698" LastEditorUserId="105" LastEditDate="2016-12-22T17:26:20.150" LastActivityDate="2016-12-22T17:26:20.150" Title="Combine highlight-symbol-mode and hl-line-mode" Tags="|colors|highlighting|hl-line-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23959" PostTypeId="2" ParentId="23957" CreationDate="2016-06-14T12:44:32.543" Score="1" Body="&lt;p&gt;I tried using your data, and the normal &lt;code&gt;C-x r&lt;/code&gt; rectangle commands work just fine?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I marked the corners (adding the necessary spaces) and copied the rectangle with &lt;code&gt;C-x r M-w&lt;/code&gt; and then yanked it into the table column (with point in the first data row for that column) with &lt;code&gt;C-x r y&lt;/code&gt; (and &lt;code&gt;TAB&lt;/code&gt; to tidy up the column lines).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: In fact, &lt;em&gt;all&lt;/em&gt; the rectangle editing options I know of work fine here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the above, I can mark the rectangle with &lt;code&gt;C-x SPC&lt;/code&gt;, copy with &lt;code&gt;M-w&lt;/code&gt;, and yank into the column with &lt;code&gt;C-y&lt;/code&gt;; and the same copy/yank works for &lt;code&gt;cua-selection-mode&lt;/code&gt;'s rectangle editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in Emacs 24.5.1 with Org 8.2.10&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-14T12:50:16.643" LastActivityDate="2016-06-14T12:50:16.643" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23961" PostTypeId="1" AcceptedAnswerId="23963" CreationDate="2016-06-14T13:44:26.413" Score="1" ViewCount="197" Body="&lt;p&gt;i have zero coding skills but somehow (mainly goggle) managed to write this script&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z/dired-shell-other-window-beets ()&#xA;  &quot;Open a shell with dired path in a new window and issue beet import on file at point &quot;&#xA;  (interactive)&#xA;  (let ((buf (shell)))&#xA;    (switch-to-buffer (other-buffer buf))&#xA;    (switch-to-buffer-other-window buf)&#xA;(insert (concat &quot;beet import &quot;  (dired-copy-filename-as-kill) ))&#xA;&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;what im trying to do is issue a interactive shell command (beet import) on the current folder point is on in dired&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i managed to get the beet import inserted to the new shell buffer thats opened but how do i follow that with the current dir name/path?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2016-06-14T20:37:56.563" LastActivityDate="2016-06-14T20:37:56.563" Title="help with dired function i wrote..how to insert current file at point into buffer?" Tags="|dired|shell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23962" PostTypeId="2" ParentId="23841" CreationDate="2016-06-14T14:19:25.370" Score="-1" Body="&lt;p&gt;Reddit just had a discussion on terminals. Try this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq eshell-visual-commands &#xA;      (cons eshell-visual-commands '(&quot;el&quot; &quot;elinks&quot; &quot;htop&quot; &quot;less&quot; &quot;ssh&quot; &quot;tmux&quot; &quot;top&quot; &quot;mbsync&quot; &quot;docker&quot; &quot;docker-compose&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.reddit.com/r/emacs/comments/4nwow3/emacs_shell_configuration_for_2016/d48n3t3&quot; rel=&quot;nofollow&quot;&gt;https://www.reddit.com/r/emacs/comments/4nwow3/emacs_shell_configuration_for_2016/d48n3t3&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11340" LastActivityDate="2016-06-14T14:19:25.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23963" PostTypeId="2" ParentId="23961" CreationDate="2016-06-14T14:32:11.897" Score="3" Body="&lt;p&gt;So there are already two keybindings that do something similar which we'll talk about and then we'll talk about making you're own command. First of all you can use &lt;code&gt;dired-do-async-shell-command&lt;/code&gt; which is bound to &lt;kbd&gt; &amp;amp; &lt;/kbd&gt; in dired. This will prompt for a command and will execute the command on the name of the filename that is marked or under your point. So you press &lt;kbd&gt; &amp;amp; &lt;/kbd&gt; and then type &quot;beet import&quot; this will run your command! In a similar vein there is also &lt;code&gt;dired-do-shell-command&lt;/code&gt; which is bound to &lt;kbd&gt; ! &lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last option is if you will be calling this very very often you can write your own function modeled after &lt;code&gt;dired-do-async-shell-command&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dired-do-beet-import (&amp;amp;optional arg file-list)&#xA;  (interactive&#xA;   (let ((files (dired-get-marked-files t current-prefix-arg)))&#xA;     (list&#xA;      current-prefix-arg&#xA;      files)))&#xA;  (dired-do-shell-command &quot;beet import&quot; arg file-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This version of the command opens a subshell to run the command in, it has less error checking and it only works for the file under the point and not for any files that are marked:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dired-do-beet-import ()&#xA;  (interactive)&#xA;  (let ((command (concat &quot;beet import &quot; (format &quot;%S&quot; (dired-get-filename)))))&#xA;    (with-current-buffer (shell)&#xA;      (insert command)&#xA;      (comint-send-input))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="11272" LastEditDate="2016-06-14T15:42:57.853" LastActivityDate="2016-06-14T15:42:57.853" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23964" PostTypeId="1" CreationDate="2016-06-14T15:08:29.153" Score="1" ViewCount="217" Body="&lt;p&gt;I am trying to write on org-mode backend to generate Jupyter Notebook, specifically optimized for producing slides using RISE (see &lt;a href=&quot;https://github.com/hkarl/org-juslides&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/hkarl/org-juslides&lt;/a&gt; if interested). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have a src-code block. How can I find out the tags of its enclosing headline (if any tags exist)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest thing I found is this &lt;a href=&quot;https://emacs.stackexchange.com/questions/8093/how-can-i-get-the-tags-for-a-headline-in-a-clock-report-formula?newreg=e6c2e67f97334c889bbb3b9d627f5a9f&quot;&gt;How can I get the tags for a headline in a clock report formula?&lt;/a&gt;, &#xA; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/22703/org-mode-backend-access-properties-in-heading&quot;&gt;Org-mode backend: access properties in heading&lt;/a&gt; - but they are after somewhat different problems. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to get at attributes of the src-block itself, but I'd rather not have to repeat a &quot;skipslide&quot; tag already set in the headline. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose it would be possible traversing org-element-lineage, but that seems like vast overkill. Is there any simpler option? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any pointers much appreciated! &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-juslides-src-block (src-block contents info)&#xA;  (let ( (code (org-export-format-code-default src-block info))&#xA;     (animate (org-export-read-attribute :attr_juslides src-block :animate))&#xA;     )&#xA;    (print &quot;src block&quot;)&#xA;    (print (org-element-lineage src-block '('heading) ))&#xA;    (print animate)&#xA;    (org-juslides-cell &quot;code&quot;&#xA;               (if animate&#xA;               &quot;fragment&quot;&#xA;             &quot;-&quot;)&#xA;               code)&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12378" LastEditorUserId="17852" LastEditDate="2019-09-03T16:19:49.867" LastActivityDate="2019-09-03T16:19:49.867" Title="org-mode backend: how to find tags of enclosing headline?" Tags="|org-mode|org-export|jupyter|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="23965" PostTypeId="2" ParentId="23958" CreationDate="2016-06-14T15:59:32.027" Score="8" Body="&lt;p&gt;&lt;code&gt;highlight-symbol-mode&lt;/code&gt; uses text properties, not an overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;hl-line-mode&lt;/code&gt; uses an overlay, not text properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Overlays always take precedence over text properties&lt;/strong&gt;, no matter how low the overlay priority is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So without some coding or code tweaking, I don't see a solution.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;However, if you use the &lt;a href=&quot;https://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Highlight&lt;/strong&gt;&lt;/a&gt; library (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;) then the solution is simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use command &lt;strong&gt;&lt;code&gt;hlt-highlight-symbol&lt;/code&gt;&lt;/strong&gt;.  It is bound by default to &lt;strong&gt;&lt;code&gt;C-x X h s&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(All of the commands in this library are bound in keymap &lt;code&gt;hlt-map&lt;/code&gt;, which is bound by default to prefix key &lt;code&gt;C-x X&lt;/code&gt;.  If you don't find &lt;code&gt;C-x X&lt;/code&gt; convenient, you can bind the keymap to another key.  Or if you want to use only some of the commands in the library, you can of course bind those individually to keys.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a screenshot, showing symbol &lt;code&gt;nb&lt;/code&gt; highlighted and hl-line mode turned on. I use &lt;a href=&quot;http://www.emacswiki.org/emacs/download/hl-line%2b.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;hl-line+.el&lt;/code&gt;&lt;/a&gt;, but that shouldn't matter here. I did nothing special -- no tweaking of overlay priorities etc.  I just loaded &lt;a href=&quot;https://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/download/hl-line%2b.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;hl-line+.el&lt;/code&gt;&lt;/a&gt;, turned on &lt;code&gt;hl-line-mode&lt;/code&gt;, and used &lt;code&gt;hlt-highlight-symbol&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XonBX.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XonBX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-06-17T14:58:39.380" LastActivityDate="2016-06-17T14:58:39.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23966" PostTypeId="1" AcceptedAnswerId="24983" CreationDate="2016-06-14T21:28:24.570" Score="3" ViewCount="232" Body="&lt;p&gt;I would like to manually edit the Git command run by a Magit popup. Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in &lt;code&gt;magit-log-popup&lt;/code&gt;, I want to add &lt;code&gt;--date default&lt;/code&gt; to the &lt;code&gt;git log&lt;/code&gt; command that Magit is going to run. The &lt;code&gt;--date&lt;/code&gt; option is not one of the options supported by the log popup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Feature request: &lt;a href=&quot;https://github.com/magit/magit/issues/2700&quot; rel=&quot;nofollow&quot;&gt;https://github.com/magit/magit/issues/2700&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9977" LastEditorUserId="9977" LastEditDate="2016-06-14T23:26:37.310" LastActivityDate="2016-08-01T15:39:22.787" Title="Magit: edit Git command before running it" Tags="|magit|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23967" PostTypeId="2" ParentId="23966" CreationDate="2016-06-14T21:39:40.147" Score="3" Body="&lt;p&gt;You can simply add your own option to the popup&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-option 'magit-log-popup&#xA;  ?D &quot;Date&quot; &quot;--date=&quot; #'read-from-minibuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when the popup is open and you press &lt;kbd&gt; =D &lt;/kbd&gt; you can enter the date option that you would like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can learn more on the &lt;a href=&quot;https://github.com/magit/magit/wiki/Additional-proposed-infix-arguments-and-suffix-commands&quot; rel=&quot;nofollow&quot;&gt;magit wiki&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-14T21:39:40.147" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23968" PostTypeId="1" CreationDate="2016-06-14T22:59:15.360" Score="0" ViewCount="27" Body="&lt;p&gt;I get the same error as this &lt;a href=&quot;https://stackoverflow.com/questions/116560/open-an-emacs-buffer-when-a-command-tries-to-open-an-editor-in-shell-mode#comment24452_116570&quot;&gt;Stack Overflow asker&lt;/a&gt; when trying to use a &lt;a href=&quot;https://stackoverflow.com/a/28553846/2023432&quot;&gt;wrapper script to tell OSX where the emacs server socket is&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think it's a bash issue, as the Emacs PID is correctly identified before the error log appears, and &lt;code&gt;echo $@&lt;/code&gt; returns the appropriate filename:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/ » ec installer.failurerequests&#xA;installer.failurerequests&#xA;Waiting for Emacs...&#xA;-emacs-pid 66202&#xA;-error Unknown&amp;amp;_command:&amp;amp;_//installer.failurerequests&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For reference, here is the bash code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash &#xA;&#xA;socket_file=$(lsof -c Emacs | grep server | tr -s &quot; &quot; | cut -d' ' -f8)&#xA;&#xA;if [[ $socket_file == &quot;&quot; ]]; then        &#xA;&#xA;    /Application/Emacs.app/Contents/MacOS/Emacs $@ &amp;amp;&#xA;&#xA;else&#xA;    ##### THIS IS THE BRANCH THAT IS RUN&#xA;    echo &quot;$@&quot;&#xA;    emacsclient --socket-name=$socket_file &quot;$@&quot;&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there some extra escaping needed on the emacs server side or something?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-06-14T22:59:15.360" Title="Odd filename parsing error when scripting emacsclient on OSX" Tags="|osx|emacsclient|server|bash|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23969" PostTypeId="2" ParentId="19850" CreationDate="2016-06-14T23:46:19.140" Score="5" Body="&lt;p&gt;This is going to be a long post, so bear with me. The only Emacs way I see so far is to use .dir-locals.el and keep it relatively clean so you don't have to approve evals every time you change something. Presumably you trust your repos:-) The rest is to give you an idea... from newb to newbs.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-emacs prettyprint-override&quot;&gt;&lt;code&gt;((org-mode&#xA;  (eval . (my-mega-project-setup))&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You got to define that function in dot emacs for &quot;default&quot; case. In most cases lisp code becomes stable fast, and only whatever you do changes from location to location on your filesystem. I mean for me it was not a big deal to hard code lisp path for interactive use.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-emacs prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/Dropbox/my-mega-project/lisp&quot;)&#xA;(autoload 'my-mega-project-setup &quot;megaproject&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course you got to customize &lt;em&gt;safe-local-variable-values&lt;/em&gt; with &lt;code&gt;(eval my-mega-project-setup)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have approximately the following hierarchy in my repo:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;root + topic1/&#xA;     + topic2/&#xA;     | ...&#xA;     + common - org_setup_template.org&#xA;     + assets - less, js stuff&#xA;     + lisp + batch.el&#xA;     |      + megaproject.el&#xA;     + publish.cmd&#xA;     + package.json with webpack and such for nodejs package manager&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's move now to &quot;dynamic&quot; part. The key here is to define&#xA;lots of stuff you want to be buffer-local in your &lt;code&gt;./lisp/megaproject.el&lt;/code&gt;. Mine is really huge at this point so I'll include only an excerpt to give you an idea. It is not meant to be final, e.g. missing functions etc.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;(require 'ox-html)&#xA;(require 'ox-latex)&#xA;(require 'ox-md)&#xA;(require 'ox-publish)&#xA;(require 'ox-twbs)&#xA;(require 'ox-odt)&#xA;(require 'ob-dot)&#xA;(require 'cl-lib)     ; cl-intersection to test for excluded headlines&#xA;&#xA;(defconst odt-schema-dir&#xA;  &quot;c:/ProgramData/Chocolatey/lib/emacs64/tools/emacs/share/emacs/24.5/etc/schema&quot;&#xA;  &quot;You might need to copy od-manifest-schema-v1.2-os.rnc &amp;amp; od-schema-v1.2-os.rnc off the web into there.&quot;)&#xA;&#xA;(defconst my-directory&#xA;  (let*                               ; TODO: search for .git/ instead&#xA;      ((d (dir-locals-find-file &quot;.&quot;)))&#xA;    (file-name-directory&#xA;     (if d&#xA;         (if (stringp d) d (car d))&#xA;       (directory-file-name&#xA;        (file-name-directory load-file-name)))))&#xA;  &quot;Absolute path to root folder.&quot;)&#xA;...&#xA;(defun my-mega-project-setup ()&#xA;  &quot;Called from .dir-locals.el to initialize things for the project.&quot;&#xA;  (set (make-local-variable 'org-twbs-format-headline-function) #'my-format-headline)&#xA;  (set (make-local-variable 'org-confirm-babel-evaluate) nil)&#xA;  (advice-add 'org-export--prepare-file-contents :around #'my-export--prepare-file-contents)&#xA;  (set (make-local-variable 'org-latex-classes)&#xA;       (cons `(&quot;my&quot;&#xA;               ,my-latex-head&#xA;               (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;               (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;               (&quot;\\subsubsection{%s\}&quot; . &quot;\\subsubsection*{%s}&quot;)&#xA;               (&quot;\\paragraph{%s}&quot; . &quot;\\paragraph*{%s}&quot;)&#xA;               (&quot;\\subparagraph{%s}&quot; . &quot;\\subparagraph*{%s}&quot;)) org-latex-classes))&#xA;  (set (make-local-variable 'org-babel-default-header-args:dot)&#xA;       (append '((:exports . &quot;results&quot;)&#xA;                 (:cache . &quot;yes&quot;)&#xA;                 (:cmdline . &quot;-Tpng -Gbgcolor=transparent&quot;))&#xA;               org-babel-default-header-args:dot))&#xA;  (set (make-local-variable 'org-babel-default-header-args:sh)&#xA;       (append '((:exports . &quot;both&quot;)&#xA;                 (:cache . &quot;yes&quot;)&#xA;                 (:results . &quot;verbatim&quot;))&#xA;               org-babel-default-header-args:sh))&#xA;  (set (make-local-variable 'org-use-property-inheritance) t)&#xA;  (set (make-local-variable 'org-latex-listings) 'minted)&#xA;  (set (make-local-variable 'org-latex-pdf-process) '(&quot;latexmk -shell-escape -pdf %f&quot;))&#xA;  (set (make-local-variable 'org-publish-timestamp-directory)&#xA;       (concat my-directory &quot;.org-timestamps/&quot;))&#xA;  (set (make-local-variable 'my-publishing-directory) ; otherwise needs to advise org-publish&#xA;       (expand-file-name &quot;my-out&quot;&#xA;                         (file-name-directory&#xA;                          (directory-file-name my-directory))))&#xA;  (set (make-local-variable 'org-structure-template-alist) (cons '(&quot;a&quot; &quot;#+BEGIN_assert\n?\n#+END_assert&quot;) org-structure-template-alist))&#xA;  (set (make-local-variable 'org-publish-project-alist) ;;; &amp;lt;&amp;lt;--- MAGIC HAPPENS HERE in alike statements&#xA;       `((&quot;my-notes&quot;&#xA;          ;; :makeindex t&#xA;          :base-directory ,my-directory&#xA;          :base-extension &quot;org&quot;&#xA;          :publishing-directory my-publishing-directory&#xA;          :recursive t&#xA;          :exclude &quot;common\\|lisp\\|\\(setup\\|snippets\\|all\\|readme\\)\\.org&quot;&#xA;          :publishing-function ((lambda (plist filename pub-dir)&#xA;                                  (let ((org-twbs-tag-class-prefix &quot;label label-default &quot;)&#xA;                                        (org-twbs-htmlize-output-type 'css)&#xA;                                        (org-twbs-footnotes-section my-footnotes-section)&#xA;                                        (org-twbs-todo-kwd-class-prefix &quot;label label-default &quot;))&#xA;                                    (org-publish-org-to 'my filename &quot;.html&quot; plist pub-dir))))&#xA;          :headline-levels 4&#xA;          :table-of-contents t&#xA;          :drawers nil&#xA;          :html-doctype &quot;html5&quot;&#xA;          :html-html5-fancy t&#xA;          :html-metadata-timestamp-format &quot;%Y-%m-%d %a&quot;&#xA;          :html-head-include-default-style nil&#xA;          :html-head-include-scripts nil&#xA;          :creator-info nil&#xA;          :html-preamble my-breadcrumbs&#xA;          :html-postamble ,my-postamble&#xA;          ;; :html-lightbox-enabled t        ; experimental patch https://github.com/marsmining/ox-twbs/issues/19&#xA;          :auto-sitemap nil ; t&#xA;          )&#xA;....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far we have a usable interactive setup. Now we need to furnish command line publishing stuff that would work from any location you checked your repo to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a batch file for the outer layer&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@echo off&#xA;rem Due to variation in user setups, consider this a sample file.&#xA;rem Modify to your needs and use it leaving this file unmodified.&#xA;&#xA;rem Path to pygments for syntax highlighting in PDFs&#xA;path C:\Miniconda3\envs\python27\Scripts;%PATH%&#xA;rem R for reproducible examples&#xA;path %ProgramFiles%\R\R-3.2.3\bin\i386;%PATH%&#xA;rem Where to find emacs&#xA;path %ChocolateyInstall%\lib\emacs64\tools\emacs\bin;%PATH%&#xA;rem LibreOffice's soffice path for odt to docx conversion&#xA;path %ProgramFiles%\LibreOffice 5\program;%PATH%&#xA;&#xA;emacs -Q --batch --script lisp/batch.el &amp;gt; publish.log 2&amp;gt;&amp;amp;1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And, finally, &lt;code&gt;./lisp/batch.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-emacs prettyprint-override&quot;&gt;&lt;code&gt;;; This is an alternative emacs init script to be used for batch publishing,&#xA;;; i.e. emacs -Q --batch --script &amp;lt;this-file.el&amp;gt;&#xA;&#xA;(defun ensure-org-above-8 ()&#xA;  &quot;Emacs comes with Org 7.9.3.&#xA;We can get Org 8+ from ELPA if user installed it.&quot;&#xA;  (require 'package)&#xA;  (add-to-list 'package-directory-list &quot;~/Dropbox/Personal/emacs/.emacs.d/elpa&quot;)&#xA;  (setq package-enable-at-startup nil)&#xA;  (package-initialize)&#xA;)&#xA;(ensure-org-above-8)&#xA;(require 'org)&#xA;(message &quot;Using Org version: %s&quot; org-version)&#xA;(if (string&amp;lt; org-version &quot;8.3&quot;) (error &quot;Incorrect version of Org is loaded!&quot;))&#xA;&#xA;(require 'ess-site)                     ; R code fontification&#xA;&#xA;(require 'ob-plantuml)&#xA;(setq org-plantuml-jar-path (concat (file-name-directory load-file-name) &quot;plantuml.jar&quot;))&#xA;(require 'ob-ditaa)&#xA;(setq org-ditaa-jar-path (concat (file-name-directory load-file-name) &quot;ditaa0_9.jar&quot;))&#xA;&#xA;(add-to-list 'load-path (file-name-directory load-file-name))&#xA;(require 'megaproject)&#xA;(load-theme 'zenburn t)&#xA;(add-to-list 'safe-local-eval-forms '(my-mega-project-setup))&#xA;(find-file &quot;index.org&quot;)&#xA;;; (update-all-in-one-org)&#xA;(org-publish-project &quot;all&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6665" LastEditorUserId="6665" LastEditDate="2016-06-14T23:56:34.243" LastActivityDate="2016-06-14T23:56:34.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23970" PostTypeId="1" CreationDate="2016-06-15T01:47:39.700" Score="2" ViewCount="104" Body="&lt;p&gt;How can I get the previous-or-equal single property change for a given property? For example, assume &lt;code&gt;AAA&lt;/code&gt;, &lt;code&gt;BBB&lt;/code&gt;, and &lt;code&gt;CCC&lt;/code&gt; below have different &lt;code&gt;face&lt;/code&gt;s.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AAABBBCCC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the return value that I would like to get for each position:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AAABBBCCC&#xA;111444777&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Contrast to what &lt;code&gt;previous-single-char-property-change&lt;/code&gt; returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AAABBBCCC&#xA;111144477&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Essentially, the problem is that &lt;code&gt;(previous-single-char-property-change (point-max) 'face)&lt;/code&gt; returns &lt;code&gt;4&lt;/code&gt; instead of &lt;code&gt;7&lt;/code&gt;. I thought I could just use &lt;code&gt;(previous-single-char-property-change (1+ (point) 'face)&lt;/code&gt; instead, but that breaks on &lt;code&gt;(point-max)&lt;/code&gt;, unfortunately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve get the previous-or-equal single char property change, taking into account the starting position?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some code to reproduce the example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (get-buffer-create &quot;*test*&quot;)&#xA;  (erase-buffer)&#xA;  (insert &quot;AAABBBCCC&quot;)&#xA;  (mapc #'delete-overlay (overlays-in (point-min) (point-max)))&#xA;  (overlay-put (make-overlay 1 4) 'face '(:background &quot;red&quot;))&#xA;  (overlay-put (make-overlay 4 7) 'face '(:background &quot;blue&quot;))&#xA;  (overlay-put (make-overlay 7 10) 'face '(:background &quot;green&quot;))&#xA;  (pop-to-buffer (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some background: for a major mode that I'm writing I need to read information from the overlay (if any) that precedes (and does not cover) the current point. &lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2016-06-15T23:00:00.943" LastActivityDate="2016-06-15T23:40:46.647" Title="How do I get the closest property change before a given point?" Tags="|search|text-properties|overlays|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23971" PostTypeId="2" ParentId="22390" CreationDate="2016-06-15T03:39:13.760" Score="5" Body="&lt;p&gt;org-gantt.el may be the project which you seek. It seems to be in early development, so let's give it a try :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/HeyFlash/emacs-stuff/tree/master/experiments&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/HeyFlash/emacs-stuff/tree/master/experiments&lt;/a&gt;&#xA;&lt;a href=&quot;http://comments.gmane.org/gmane.emacs.orgmode/98012&quot; rel=&quot;noreferrer&quot;&gt;http://comments.gmane.org/gmane.emacs.orgmode/98012&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-06-15T03:39:13.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23972" PostTypeId="2" ParentId="23970" CreationDate="2016-06-15T04:25:08.660" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I get the previous single property change for a given property?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You got it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no &lt;code&gt;face&lt;/code&gt; property change at position 7. The previous property change for &lt;code&gt;face&lt;/code&gt; is at position 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It's not clear why you want what you say you want, or even what it means.  This really smells like an &lt;a href=&quot;https://meta.stackexchange.com/q/66377/231821&quot;&gt;X-Y problem&lt;/a&gt;. Maybe say what you are really trying to do?)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2017-03-20T10:32:14.890" LastActivityDate="2016-06-15T04:25:08.660" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23973" PostTypeId="2" ParentId="23893" CreationDate="2016-06-15T05:03:04.193" Score="11" Body="&lt;p&gt;I write &quot;&amp;lt;2016-06-15 Wed&gt;--&amp;lt;2016-07-18 Mon&gt;&quot;  ...and then (with POINT somewhere over the dates) I press C-c C-y (org-evaluate-time-range) C-ucy will write the time-range after the dates like, &amp;lt;2016-06-15 Wed&gt;--&amp;lt;2016-07-18 Mon&gt; 33d&lt;/p&gt;&#xA;" OwnerUserId="911" LastActivityDate="2016-06-15T05:03:04.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23975" PostTypeId="2" ParentId="23964" CreationDate="2016-06-15T09:29:46.913" Score="1" Body="&lt;p&gt;Solved by rasmus, with kudos: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-get-tags (org-export-get-parent-headline src-block) info '(&quot;invalid&quot; &quot;tags&quot;) t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(or, in detail, to also consider the option to use an attribute in the src-block itself): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (let* ( &#xA;     (tags (org-export-get-tags (org-export-get-parent-headline src-block) info '(&quot;invalid&quot; &quot;tags&quot;) t))&#xA;     (skipslide (or (member &quot;skipslide&quot; tags)&#xA;            (org-export-read-attribute :attr_juslides src-block :skip)&#xA;            ))&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12378" LastActivityDate="2016-06-15T09:29:46.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23976" PostTypeId="1" CreationDate="2016-06-15T12:21:36.423" Score="3" ViewCount="1829" Body="&lt;p&gt;I am trying to setup emacs as server so that emacs (same instance) can be invoked from a file browser like nautilus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Results not satisfactory&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Attempt 1&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I have the foll. in &lt;code&gt;~/.local/share/applications/emacs.desktop&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Desktop Entry]&#xA;Name=EmacsClient&#xA;GenericName=Text Editor&#xA;Comment=Edit text&#xA;MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;&#xA;&#xA;Exec=emacsclient -n -a emacs %F&#xA;Icon=emacs&#xA;Type=Application&#xA;Terminal=false&#xA;Categories=Development;TextEditor;&#xA;StartupWMClass=Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Along with &lt;code&gt;(server-start)&lt;/code&gt; in my init&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try that I get two icons for emacs in ubuntu launcher -- one is 'fake' ie it does not respond to click&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Attempt 2&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;emacs started with --daemon&lt;/li&gt;&#xA;&lt;li&gt;emacs.desktop as earlier described&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However now closing a window with the 'X' does not prompt to save files&#xA;Nor at system shutdown time&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Attempt 3&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Following &lt;a href=&quot;https://stackoverflow.com/questions/1167484/how-to-gracefully-shutdown-emacs-daemon&quot;&gt;https://stackoverflow.com/questions/1167484/how-to-gracefully-shutdown-emacs-daemon&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tried adding this to my init&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun shutdown-emacs-server () (interactive)&#xA;   (when (not (eq window-system 'x))&#xA;   (message &quot;Initializing x windows system.&quot;)&#xA;   (x-initialize-window-system)&#xA;   (when (not x-display-name) (setq x-display-name (getenv &quot;DISPLAY&quot;)))&#xA;   (select-frame (make-frame-on-display x-display-name '((window-system . x)))))&#xA; (let ((last-nonmenu-event nil)(window-system &quot;x&quot;))(save-buffers-kill-emacs))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then an explicit shutdown command needs to be issued:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;$ emacsclient -e '(shutdown-emacs-server)'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is unreliable -- sometimes it pops up the save dialog, sometimes not&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So any suggestions on how to use emacs as a server?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Ubuntu xenial running unity]&lt;/p&gt;&#xA;" OwnerUserId="5223" LastEditorUserId="5223" LastEditDate="2020-01-28T07:15:42.830" LastActivityDate="2020-01-28T07:15:42.830" Title="Emacs as server (daemon) struggles" Tags="|emacsclient|server|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23977" PostTypeId="2" ParentId="23976" CreationDate="2016-06-15T13:04:27.190" Score="2" Body="&lt;p&gt;I think that your 2nd attempt is correct. You should, however, use &lt;code&gt;C-x C-c&lt;/code&gt; to quit Emacs and not close the frame created by &lt;code&gt;emacsclient&lt;/code&gt; directly through the GUI. I use &lt;code&gt;C-x C-c&lt;/code&gt; to quit Emacs and it always asks me whether I want to save my modified buffers even if they aren't the ones I'm using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, it's to be expected that Emacs won't prompt you to save your files at system shutdown because it exists as a daemon but even if it doesn't, it still won't prompt you. If you do close the frame directly, you can always open it again and check whether you have saved the changes in your buffers.&lt;/p&gt;&#xA;" OwnerUserId="11384" LastActivityDate="2016-06-15T13:04:27.190" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23978" PostTypeId="2" ParentId="14550" CreationDate="2016-06-15T13:34:53.577" Score="2" Body="&lt;p&gt;Use &lt;code&gt;-style=&amp;lt;string&amp;gt;&lt;/code&gt; of &lt;code&gt;clang-format&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Coding style, currently supports: LLVM, Google, Chromium, Mozilla,&#xA;  WebKit.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use -style=file to load style configuration from .clang-format&#xA;  file located in one of the parent directories of the source file (or&#xA;  current directory for stdin).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use -style=&quot;{key: value, ...}&quot; to set&#xA;  specific parameters, e.g.: -style=&quot;{BasedOnStyle: llvm, IndentWidth:&#xA;  8}&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Define a function with a &lt;code&gt;style&lt;/code&gt; forwarded to &lt;code&gt;clang-format-region&lt;/code&gt;. Then, bind it to a key:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun clang-format-region-mozilla (s e)&#xA;  (interactive&#xA;   (if (use-region-p)&#xA;       (list (region-beginning) (region-end))&#xA;     (list (point) (point))))&#xA;  (clang-format-region s e &quot;Mozilla&quot;))&#xA;&#xA;(define-key c++-mode-map (kbd &quot;C-&amp;lt;f10&amp;gt;&quot;) #'clang-format-region-mozilla)&#xA;&#xA;(defun clang-format-region-llvm (s e)&#xA;  (interactive&#xA;   (if (use-region-p)&#xA;       (list (region-beginning) (region-end))&#xA;     (list (point) (point))))&#xA;  (clang-format-region s e &quot;LLVM&quot;))&#xA;&#xA;(define-key c++-mode-map (kbd &quot;C-&amp;lt;f11&amp;gt;&quot;) #'clang-format-region-llvm)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The upper example maps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-F10&lt;/kbd&gt; to &lt;code&gt;clang-format-region&lt;/code&gt; with the &lt;code&gt;&quot;Mozilla&quot;&lt;/code&gt; style&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-F11&lt;/kbd&gt; to &lt;code&gt;clang-format-region&lt;/code&gt; with the &lt;code&gt;&quot;LLVM&quot;&lt;/code&gt; style&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Change the keys and the styles as it suits you.&lt;/p&gt;&#xA;" OwnerDisplayName="user12181" LastActivityDate="2016-06-15T13:34:53.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23980" PostTypeId="1" AcceptedAnswerId="23981" CreationDate="2016-06-15T14:24:13.547" Score="3" ViewCount="268" Body="&lt;p&gt;When working in &lt;code&gt;org-mode&lt;/code&gt;, I usually emphasize some key words.  For example, I usually write &lt;em&gt;Python&lt;/em&gt;, and when I do, I want &lt;code&gt;org-mode&lt;/code&gt; to use boldface automatically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python =&amp;gt; *python*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I set it up to make these changes automatic?&lt;/p&gt;&#xA;" OwnerUserId="12385" LastEditorUserId="253" LastEditDate="2016-06-15T16:39:29.230" LastActivityDate="2016-06-17T02:53:25.290" Title="Automatic emphasis of certain words?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23981" PostTypeId="2" ParentId="23980" CreationDate="2016-06-15T14:59:50.687" Score="9" Body="&lt;p&gt;You probably want to look at &lt;a href=&quot;https://www.emacswiki.org/emacs/AbbrevMode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;abbrev-mode&lt;/code&gt;&lt;/a&gt;.  Here's a &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_abbrev_mode.html&quot; rel=&quot;nofollow&quot;&gt;tutorial&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, with &lt;code&gt;abbrev-mode&lt;/code&gt;, you follow this procedure:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Turn on &lt;code&gt;abbrev-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;When you type a word the way you want it to appear, you then &lt;a href=&quot;http://ergoemacs.org/emacs_manual/emacs/Defining-Abbrevs.html&quot; rel=&quot;nofollow&quot;&gt;define an abbreviation&lt;/a&gt; for whatever you want emacs to recognize and auto-expand&lt;/li&gt;&#xA;&lt;li&gt;type away&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="61" LastEditorUserId="61" LastEditDate="2016-06-17T02:53:25.290" LastActivityDate="2016-06-17T02:53:25.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23982" PostTypeId="1" AcceptedAnswerId="24000" CreationDate="2016-06-15T17:37:18.660" Score="9" ViewCount="2908" Body="&lt;p&gt;I use org-mode to export PDF. It does it through LaTeX ; fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I get &lt;em&gt;.pdf&lt;/em&gt; file &lt;strong&gt;and&lt;/strong&gt; &lt;em&gt;.tex&lt;/em&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only the PDF is interesting to me. Any setting/way that org-mode cleanup the .tex files by itself (or store it in some temporary folder) ?&lt;/p&gt;&#xA;" OwnerUserId="9816" LastActivityDate="2024-02-14T13:39:32.000" Title="Cleanup org-mode export intermediary file" Tags="|org-mode|org-export|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23983" PostTypeId="2" ParentId="23982" CreationDate="2016-06-15T18:02:13.213" Score="1" Body="&lt;p&gt;You can put advice after the function to delete the intermediate file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-latex-compile :after #'delete-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-15T18:02:13.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23984" PostTypeId="2" ParentId="23982" CreationDate="2016-06-15T18:27:59.650" Score="2" Body="&lt;p&gt;This is a simple question but has not so simple answers. The temp files are used repeatedly in the production of pdf output. Neither AUCTeX nor ORG knows when it is safe to delete them. Hence they are left there for manual deletion after ascertaining if they are no longer needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few ways to speed up the manual deletion process. A simple shell command will do the job without too much fuss (add other extensions as needed):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun clear-latex-temp-files () (shell-command &quot;rm -rf *.tex *.prv preview.fmt&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use latexmk (instead of pdflatex) for generating your pdf so you can use the &lt;code&gt;-c&lt;/code&gt; option to delete the temp files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;latexmk -c &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then put the following line in this file &lt;code&gt;~\.latexmkrc&lt;/code&gt; so as to cover all temp files, not just &lt;code&gt;*.tex&lt;/code&gt; and &lt;code&gt;*.prv&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@generated_exts = qw(aux idx ind lof lot out toc acn acr alg glg glo gls ist);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can add other temp files (.synctex .gz .nav .vrb .snm .blg -blx .bib .bbl .run .xml) depending on your needs. This is the most customizable option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid this complication for simple org files, you can use the builtin &lt;code&gt;-output-directory&lt;/code&gt; option of pdflatex.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pdflatex -output-directory=target &amp;lt;file&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which will also put the pdf output there in the target directory. You can then move the pdf file out of there once you are satisfied it was generated properly. All the deletable files are all in one location that can be purged periodically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why not use a macro to &lt;code&gt;delete-file&lt;/code&gt; after &lt;code&gt;org-latex-compile&lt;/code&gt;? Because that may sometimes delete the temp files prematurely. You may end up with broken links, unlinked biblio entries, unlinked chapter headings in TOC, and unfinished indexes, list of tables, list of figures. See the org-mode documentation string for &lt;code&gt;C-h f org-latex-compile&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The reason why this is a list is that it usually takes several&#xA;  runs of ‘pdflatex’, maybe mixed with a call to ‘bibtex’.  Org&#xA;  does not have a clever mechanism to detect which of these&#xA;  commands have to be run to get to a stable result, and it also&#xA;  does not do any error checking.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-06-15T19:22:03.193" LastActivityDate="2016-06-15T19:22:03.193" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23985" PostTypeId="1" AcceptedAnswerId="23988" CreationDate="2016-06-15T18:34:21.663" Score="1" ViewCount="368" Body="&lt;p&gt;I have very long url,  for example,  &lt;a href=&quot;https://www.youtube.com/channel/UCGM8KgUXqsS4d8-4rgWRWKg/playlists&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/channel/UCGM8KgUXqsS4d8-4rgWRWKg/playlists&lt;/a&gt;, how can I tailor it into a shorter form?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like : &lt;a href=&quot;https://www.youtube.com/channel/UC&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/channel/UC&lt;/a&gt;... [here ... means there are still content here]&#xA;Remarks: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There is a package called &lt;em&gt;bitly&lt;/em&gt;, but I don't want to use;&lt;/li&gt;&#xA;&lt;li&gt;I do know this [[link][description]] stuff, I just want to display url.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Anyone has any ideas? Thanks!!!&lt;/p&gt;&#xA;" OwnerUserId="12385" LastActivityDate="2016-06-15T19:32:58.110" Title="shorten or control the length of url link in org mode without bitly packages" Tags="|org-mode|emacs24.4|hyperlinks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23986" PostTypeId="1" AcceptedAnswerId="23987" CreationDate="2016-06-15T18:50:48.190" Score="0" ViewCount="234" Body="&lt;p&gt;I am in bash and emacsclient is running. I would like to run a bash command to display a list of all open emacs buffers. The output of buffer-menu is fine.  These commands do not work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacsclient -e &quot;buffer-list&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;ERROR&lt;/em&gt;: Symbol's value as variable is void: buffer-list&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacsclient -e &quot;buffer-menu&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;ERROR&lt;/em&gt;: Symbol's value as variable is void: buffer-menu&lt;/p&gt;&#xA;" OwnerUserId="12387" LastActivityDate="2016-06-15T18:55:20.480" Title="Bash command to see a list of all open buffers" Tags="|bash|buffer-list|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23987" PostTypeId="2" ParentId="23986" CreationDate="2016-06-15T18:55:20.480" Score="3" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -e '(buffer-list)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-06-15T18:55:20.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23988" PostTypeId="2" ParentId="23985" CreationDate="2016-06-15T18:59:40.297" Score="3" Body="&lt;p&gt;So this may not be exactly what you want but it turns the section that is underneath your point into a link that should be shorter.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun compress-org-link (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((url (thing-at-point 'url))&#xA;    (bounds (bounds-of-thing-at-point 'url)))&#xA;    (kill-region (car bounds) (cdr bounds))&#xA;    (insert (format &quot;[[%s][%s]]&quot; url (truncate-string-to-width url (if arg (prefix-numeric-value arg) 40) nil nil &quot;...&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can change the constant 40 to be a more suitable url length default. You can also feed the function a prefix arg to set the length of the final string.&lt;/p&gt;&#xA;" OwnerUserId="11272" LastEditorUserId="11272" LastEditDate="2016-06-15T19:32:58.110" LastActivityDate="2016-06-15T19:32:58.110" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23989" PostTypeId="2" ParentId="23970" CreationDate="2016-06-15T19:54:59.603" Score="3" Body="&#xA;&#xA;&lt;p&gt;Something like this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun last-prop-change (prop &amp;amp;optional limit)&#xA;  (let ((pos+1 (min (1+ (point)) (point-max))))&#xA;    (previous-single-char-property-change pos+1 prop nil limit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is a more complete wrapper than the one given above in that it supports arbitrary positions within &lt;code&gt;object&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; source: http://emacs.stackexchange.com/a/23989/93&#xA;(defun last-single-char-property-change (position prop &amp;amp;optional object limit)&#xA;  &quot;Position of the last change of a property before or at POSITION.&#xA;&#xA;This function is just a thin wrapper around&#xA;`previous-single-char-property-change', with the POSITION&#xA;argument effectively becoming POSITION+1.  This means that if the&#xA;PROP property changes at POSITION, then POSITION is returned.&quot;&#xA;  (let (pos+1)&#xA;    (cond&#xA;     ((stringp object)&#xA;      (setq pos+1 (min (1+ position) (1- (length object)))))&#xA;     ((bufferp object)&#xA;      (with-current-buffer object&#xA;        (setq pos+1 (min (1+ position) (point-max)))))&#xA;     (t&#xA;      (setq pos+1 (min (1+ position) (point-max)))))&#xA;    (previous-single-char-property-change pos+1 prop object limit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2016-06-15T23:40:46.647" LastActivityDate="2016-06-15T23:40:46.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23990" PostTypeId="1" AcceptedAnswerId="23992" CreationDate="2016-06-15T20:30:38.140" Score="0" ViewCount="190" Body="&lt;p&gt;When I evaluate this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh&#xA;brew list&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result is good:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/o4aDq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o4aDq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh&#xA;brew info emacs&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get something weird:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9eMJT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9eMJT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why this happens?&lt;/p&gt;&#xA;" OwnerUserId="12385" LastEditorUserId="675" LastEditDate="2016-07-13T23:08:45.130" LastActivityDate="2016-07-13T23:08:45.130" Title="evaluate sh source code, output is not displayed well" Tags="|org-mode|org-babel|shell-command|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23991" PostTypeId="2" ParentId="23990" CreationDate="2016-06-15T20:46:20.047" Score="0" Body="&lt;p&gt;I think I figured out the reason. The result should be fine. It is the problem my screen size. Because the result is generated in the form of table. If the width of this table is bigger than the emacs window size, the table will reconstruct in another way just like in my screenshot 2.&lt;/p&gt;&#xA;" OwnerUserId="12385" LastActivityDate="2016-06-15T20:46:20.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23992" PostTypeId="2" ParentId="23990" CreationDate="2016-06-15T21:03:59.410" Score="3" Body="&lt;p&gt;Your file is simply wrapping try calling &lt;kbd&gt; M-x &lt;/kbd&gt; &lt;code&gt;toggle-truncate-lines&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2016-06-15T21:03:59.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23993" PostTypeId="1" AcceptedAnswerId="24005" CreationDate="2016-06-15T22:28:54.667" Score="3" ViewCount="1141" Body="&lt;p&gt;I am new to emacs.&#xA;I want to install paredit mode on emacs 24. I am using Melpa.&#xA;When i do &lt;code&gt;M-x package-install RET paredit RET&lt;/code&gt; or try to install it from &lt;code&gt;package-list-package&lt;/code&gt; i see the error in the minibuffer: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Cannot open load file: no such file or directory, paredit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What should i do to get it?&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastActivityDate="2016-06-16T16:47:56.827" Title="Cannot install Paredit" Tags="|paredit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23994" PostTypeId="1" AcceptedAnswerId="23995" CreationDate="2016-06-16T00:00:42.493" Score="1" ViewCount="871" Body="&lt;p&gt;Is it possible to change the speed in which the &lt;code&gt;company&lt;/code&gt; shows suggestions for completion? Per default it takes too long, so that it is still faster if one types the word himself than waiting for company suggestions.&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastActivityDate="2016-06-16T02:05:51.780" Title="Changing the completion speed in company" Tags="|company-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23995" PostTypeId="2" ParentId="23994" CreationDate="2016-06-16T02:05:51.780" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;M-x customize-group&lt;/li&gt;&#xA;&lt;li&gt;Company&lt;/li&gt;&#xA;&lt;li&gt;Company-idle-delay  (set this to a small value)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12385" LastActivityDate="2016-06-16T02:05:51.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23996" PostTypeId="1" AcceptedAnswerId="23997" CreationDate="2016-06-16T03:32:34.943" Score="0" ViewCount="327" Body="&lt;p&gt;Adding this for anyone who runs into this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;a href=&quot;https://github.com/ieure/ssh-el&quot; rel=&quot;nofollow&quot;&gt;SSH mode for emacs (ssh-el)&lt;/a&gt; on Windows and it just hangs there without connecting sometimes, usually after a crash.&lt;/p&gt;&#xA;" OwnerUserId="6571" LastActivityDate="2016-06-16T03:34:18.187" Title="Why does SSH mode for emacs (ssh-el) hang?" Tags="|microsoft-windows|ssh|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23997" PostTypeId="2" ParentId="23996" CreationDate="2016-06-16T03:34:18.187" Score="1" Body="&lt;p&gt;Open task manager and quit all ssh.exe processes you see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When emacs crashes on Windows and it's using ssh-el the ssh process keeps running and blocks emacs from connecting. Rebooting would probably also work.&lt;/p&gt;&#xA;" OwnerUserId="6571" LastActivityDate="2016-06-16T03:34:18.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23998" PostTypeId="1" AcceptedAnswerId="24009" CreationDate="2016-06-16T08:10:16.550" Score="1" ViewCount="1022" Body="&lt;p&gt;When I use, gotham-theme, it says that you can get the 256 colors by &lt;code&gt;(setq gotham-tty-extended-palette t)&lt;/code&gt; but I do not feel any difference between activating one and the other with only 16 colors; I think that I have activated the 256 color because with &lt;code&gt;list-colors-display&lt;/code&gt; and &lt;code&gt;list-faces-display&lt;/code&gt; I have many colors, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sNLCq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sNLCq.png&quot; alt=&quot;gotham 16&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cdNy9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cdNy9.png&quot; alt=&quot;gotham 256&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that with lush theme is more colorful&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iG7Kt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iG7Kt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is: it is well activated gotham theme with 256 colors, and how can I make my code more colorful?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FMcZ9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FMcZ9.png&quot; alt=&quot;list-colors-display&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8892" LastEditorUserId="454" LastEditDate="2016-06-17T01:19:43.143" LastActivityDate="2016-06-17T07:22:20.810" Title="Gotham theme with 256 colors" Tags="|themes|colors|display|coloring|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23999" PostTypeId="1" AcceptedAnswerId="24003" CreationDate="2016-06-16T08:36:40.407" Score="2" ViewCount="1994" Body="&lt;p&gt;I do have a strange issue when working on PHP files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have company-mode installed and it works for function completion but not for local variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For others languages such as Ruby or Lisp, everything is fine. But not for PHP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following gif, as you can see, I can complete functions that begins by &quot;str&quot; but not the local variable that begins by &quot;$tot&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2Q6Ul.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2Q6Ul.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is my very simplified config used for this example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Requires and internal modes settings&#xA;(require 'package)&#xA;&#xA;(ido-mode 1)&#xA;(show-paren-mode 1)&#xA;(transient-mark-mode 1)&#xA;&#xA;;; Internal vars&#xA;&#xA;(setq debug-on-error t&#xA;      case-fold-search t&#xA;      kill-whole-line t)&#xA;&#xA;(fset 'yes-or-no-p 'y-or-n-p)&#xA;&#xA;;; Use package&#xA;&#xA;(setq package-enable-at-startup nil&#xA;      package-archives '((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;                         (&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                         (&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)))&#xA;&#xA;(package-initialize)&#xA;&#xA;(when (not package-archive-contents) (package-refresh-contents))&#xA;(unless (package-installed-p 'use-package) (package-install 'use-package))&#xA;(eval-when-compile (require 'use-package))&#xA;&#xA;;; Package :: completion&#xA;&#xA;(use-package company :ensure t :init (global-company-mode 1))&#xA;&#xA;;; Packages :: web&#xA;&#xA;(use-package php-mode :ensure t)&#xA;(use-package php-extras :ensure t)&#xA;(use-package rainbow-mode :ensure t)&#xA;(use-package web-mode :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do you guys have any idea of what's going on ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v major-mode&lt;/code&gt; gives &lt;code&gt;php-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v company-backend&lt;/code&gt; gives &lt;code&gt;nil&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-h v company-backends&lt;/code&gt; gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its value is (php-extras-company company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files&#xA;            (company-dabbrev-code company-gtags company-etags company-keywords)&#xA;        company-oddmuse company-dabbrev)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Original value was &#xA;(company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files&#xA;          (company-dabbrev-code company-gtags company-etags company-keywords)&#xA;      company-oddmuse company-dabbrev)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10422" LastEditorUserId="10422" LastEditDate="2016-06-16T13:57:44.473" LastActivityDate="2016-06-17T06:36:07.587" Title="PHP completion with Company does not work on local variables" Tags="|company-mode|php-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24000" PostTypeId="2" ParentId="23982" CreationDate="2016-06-16T11:10:59.380" Score="11" Body="&lt;p&gt;You can simply customize the variable &lt;code&gt;org-latex-logfiles-extensions&lt;/code&gt; to let org to delete those auxiliary files after export automatically. i.e.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-logfiles-extensions (quote (&amp;quot;lof&amp;quot; &amp;quot;lot&amp;quot; &amp;quot;tex~&amp;quot; &amp;quot;aux&amp;quot; &amp;quot;idx&amp;quot; &amp;quot;log&amp;quot; &amp;quot;out&amp;quot; &amp;quot;toc&amp;quot; &amp;quot;nav&amp;quot; &amp;quot;snm&amp;quot; &amp;quot;vrb&amp;quot; &amp;quot;dvi&amp;quot; &amp;quot;fdb_latexmk&amp;quot; &amp;quot;blg&amp;quot; &amp;quot;brf&amp;quot; &amp;quot;fls&amp;quot; &amp;quot;entoc&amp;quot; &amp;quot;ps&amp;quot; &amp;quot;spl&amp;quot; &amp;quot;bbl&amp;quot;)))&#xA;    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Add the extension which you want to delete to the variable.&lt;/p&gt;&#xA;&lt;p&gt;Or, to avoid having to list all extensions (given that many may already be in there by default), use &lt;code&gt;(add-to-list...)&lt;/code&gt; instead of &lt;code&gt;(setq...)&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox-latex)  &#xA;(add-to-list 'org-latex-logfiles-extensions &amp;quot;tex&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In the above, the &lt;code&gt;(require 'ox-latex)&lt;/code&gt; is there to ensure that variable &lt;code&gt;org-latex-logfiles-extensions&lt;/code&gt; exists &lt;em&gt;before&lt;/em&gt; we try to add to it. (See comments to this answer below, in particular from @xeruf).&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="13787" LastEditDate="2024-02-14T13:39:32.000" LastActivityDate="2024-02-14T13:39:32.000" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="24001" PostTypeId="1" AcceptedAnswerId="24002" CreationDate="2016-06-16T13:05:45.310" Score="4" ViewCount="1254" Body="&lt;p&gt;I load a package that defines a list of radio stations with defvar&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(defvar default-list&#xA;'((station1) (station2)))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to redefine this list after loading the package (I am using &lt;code&gt;require&lt;/code&gt;) because a lot of the stations are defunct.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="105" LastEditDate="2016-06-16T13:12:40.103" LastActivityDate="2016-06-16T13:17:00.990" Title="change value of a defvar after loading package" Tags="|variables|defvar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24002" PostTypeId="2" ParentId="24001" CreationDate="2016-06-16T13:12:23.070" Score="4" Body="&lt;pre&gt;&lt;code&gt;(setq default-list  '((station1) (station99) (stationABC))) ; Redefine.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-list '(station23)) ; Add a station.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Take a look at &lt;code&gt;C-h i&lt;/code&gt;, &lt;code&gt;Emacs Lisp Intro&lt;/code&gt;.  See also the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Setting-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Setting Variables&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;setq&lt;/code&gt; or your own &lt;code&gt;defvar&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; that &lt;code&gt;defvar&lt;/code&gt; in the package is evaluated. That will prevent the package's &lt;code&gt;defvar&lt;/code&gt; from taking effect. See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Defining Variables&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-06-16T13:17:00.990" LastActivityDate="2016-06-16T13:17:00.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24003" PostTypeId="2" ParentId="23999" CreationDate="2016-06-16T13:59:16.430" Score="3" Body="&lt;p&gt;You only need &lt;code&gt;php-extras-company&lt;/code&gt; and &lt;code&gt;company-dabbrev&lt;/code&gt;, place them in the same group and at the BEGINNING of the &lt;code&gt;company-backends&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'php-mode-hook&#xA;            (lambda ()&#xA;              (set (make-local-variable 'company-backends)&#xA;                   '((php-extras-company company-dabbrev) company-capf company-files))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/182&quot; rel=&quot;nofollow&quot;&gt;https://github.com/company-mode/company-mode/issues/182&lt;/a&gt; @dgutov comments.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="10" LastEditDate="2016-06-17T06:36:07.587" LastActivityDate="2016-06-17T06:36:07.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24004" PostTypeId="1" CreationDate="2016-06-16T14:45:35.207" Score="1" ViewCount="38" Body="&lt;p&gt;How do I install an Irish (Gaeilge) dictionary for Emacs on Windows?&lt;/p&gt;&#xA;" OwnerUserId="12396" LastActivityDate="2016-06-16T14:45:35.207" Title="Irish (Gaeilge) dictionary Emacs on Windows" Tags="|microsoft-windows|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24005" PostTypeId="2" ParentId="23993" CreationDate="2016-06-16T16:47:56.827" Score="1" Body="&lt;p&gt;You should do &lt;code&gt;M-x list-packages&lt;/code&gt;. Then do &lt;code&gt;C-s&lt;/code&gt; to search for paredit. If it does not appear in the list, then your package source is not configured properly and you are not getting the list you are expecting. I just checked melpa on my local and paredit is present, so your invocation should have worked. &lt;/p&gt;&#xA;" OwnerUserId="2662" LastActivityDate="2016-06-16T16:47:56.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24006" PostTypeId="2" ParentId="23953" CreationDate="2016-06-16T17:42:29.610" Score="6" Body="&lt;p&gt;As soon as emacs 25 lands, there will be a variable &lt;code&gt;gdb-display-io-nopopup&lt;/code&gt; to fix this problem&lt;/p&gt;&#xA;" OwnerUserId="9459" LastActivityDate="2016-06-16T17:42:29.610" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24007" PostTypeId="2" ParentId="21310" CreationDate="2016-06-16T17:44:43.890" Score="4" Body="&lt;p&gt;I use the following snippet to select a recently clocked task with &lt;code&gt;ido&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-clock-in-select ()&#xA;  (interactive)&#xA;  (let (res)&#xA;    (dolist (i org-clock-history)&#xA;      (with-current-buffer&#xA;      (org-base-buffer (marker-buffer i))&#xA;    (org-with-wide-buffer&#xA;     (ignore-errors&#xA;       (goto-char (marker-position i))&#xA;       (push `(,(org-get-heading 'notags) . ,i) res)))))&#xA;    (let* ((l (reverse (mapcar 'car res)))&#xA;       (task (cdr (assoc (ido-completing-read &quot;Recent Clocks: &quot; l) res))))&#xA;      (when task&#xA;    (with-current-buffer&#xA;        (org-base-buffer (marker-buffer task))&#xA;      (org-with-wide-buffer&#xA;       (goto-char (marker-position task))&#xA;       (org-clock-in)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="730" LastEditDate="2016-06-17T09:36:09.930" LastActivityDate="2016-06-17T09:36:09.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24008" PostTypeId="2" ParentId="23976" CreationDate="2016-06-16T19:48:44.020" Score="6" Body="&lt;h2&gt;Closing The Client&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that when you are running an emacs daemon, the frame in which you are actually editing is simply a client of the server.  The file is not buffered in the client, it is buffered in the server.  When you close the client you are not killing the server process, nor is the file closed.  The file you were editing remains open in the server process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you open a new emacs client you can see this is the case by changing buffers &lt;code&gt;C-x b&lt;/code&gt; to the file you were editing earlier.  Even so, when I attempt to kill a client using &lt;code&gt;C-x C-c&lt;/code&gt; I am still prompted to save my work if I have not done so already.  If I don't save on exit, the work is still there when I open a new client, which is the important thing here.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Unsaved Work&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;When the server is killed with unsaved work in one or more buffers, you can usually recover at least some of that work by recovering the file.  Emacs will typically auto save your documents for you while you are working.  To recover a file from an auto save you essentially have two options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x recover-file&lt;/code&gt; prompts you for a file name from which to recover.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x recover-this-file&lt;/code&gt; searches for an auto save for the file currently read into the buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I realize these two functions are not a fix for your problem, but they have served me well in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, if you take care to save your work regularly, this becomes less of a problem, especially if your daemon is a long running process.  My kids used to accidentally turn my server off regularly before I disconnected the power button.  There was a time or two that a file had not been saved and I was able to recover my work with the above functions.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;A Couple Of Suggestions&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You could set up the emacs daemon to run as a service on your system if you always want it available.  This would also give you the flexibility of using a script as the exec command for restarting and shutting down.  You could add code there to ensure that everything saves before shutdown or restart.  That strikes me as more of a fun project than a practical one, though.  I very rarely kill my server process.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A more practical suggestion I can offer is to issue the emacs client command with an empty string as the alternate editor like so: &lt;code&gt;emacsclient -ca&quot;&quot;&lt;/code&gt;.  This causes emacs to attempt to create a daemon if one does not exist, then connect to it.  The 'c' option forces emacs to create a new frame, which can be helpful if you are using Xemacs.  From the man page regarding the &lt;code&gt;-a&lt;/code&gt; option: &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the value of EDITOR is the empty string, run `emacs --daemon' to start Emacs in daemon mode, and try to connect to it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If that last suggestion works for you, you can alias the command to something like &lt;code&gt;emax&lt;/code&gt;, as I have seen suggested elsewhere.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Emacs 26.1 now comes packaged with a systemd service file on some systems.  This eliminates the need to use the alternate-editor argument on the command line.  Simply make sure you start and enable the emacs service.&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11655" LastEditDate="2019-04-30T20:39:42.893" LastActivityDate="2019-04-30T20:39:42.893" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24009" PostTypeId="2" ParentId="23998" CreationDate="2016-06-17T07:22:20.810" Score="1" Body="&lt;p&gt;gotham-theme is my port of a Vim theme.  In the Vim world there's three different kinds of color palettes used for themes:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The original palette with an arbitrary amount of colors with the shades as the designer of the theme picked them.  This one will only work correctly in a GUI instance (or if you're extra lucky and have 24-bit color support in both your editor and your terminal, in the terminal, too).&lt;/li&gt;&#xA;&lt;li&gt;A user-set 16 color palette in the terminal.  This requires that the theme itself restricts itself to at most 16 colors and that it emits the correct ANSI color escapes that map to the user's terminal configuration.  In other words, while this allows the theme to look very close or identical to the first option, it requires the user to have configured their terminal for that theme specifically.&lt;/li&gt;&#xA;&lt;li&gt;The default 256 color palette in the terminal.  This obviously requires a terminal and that the user hasn't tampered with colors beyond the first 16 in its config.  The theme will emit ANSI color escapes that approximate the real colors used in the theme.  This kind of thing may go more or less well, depending on whether the approximation is automatic (like done for GUI-only themes when used in the terminal) or has been tweaked by the author (like with gotham-theme).  It is possible to forego the approximation entirely by designing a theme using the default 256 color palette, see zenburn and &lt;a href=&quot;https://github.com/wasamasa/punpun-theme&quot; rel=&quot;nofollow&quot;&gt;punpun-theme&lt;/a&gt; for examples.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I've made the second option default for terminals as it makes the theme look better with all prerequisites met.  In case they're not and you're willing to pick option 3, it is available with the customization option &lt;code&gt;gotham-tty-extended-palette&lt;/code&gt;.  Apparently it's a misleading name, so I'm considering to change it to something more obvious...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, if you're in the GUI, option 1 applies and you don't need to worry about color fidelity.  The theme will look just as the designer intended it to do.  Therefore I'm afraid you'll either have to look for a more colorful theme or tweak it yourself with &lt;code&gt;M-x customize-face&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-06-17T07:22:20.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24010" PostTypeId="1" CreationDate="2016-06-17T07:58:44.980" Score="0" ViewCount="386" Body="&lt;p&gt;I encounter this problem almost always when i am working on a python-pygame project. Every second time when i evaluate the whole buffer with &lt;code&gt;C-c C-c&lt;/code&gt; or with &lt;code&gt;C-c C-l&lt;/code&gt; the pygame window open for a very short time and then every thing crashes including the python interpreter, and i get this error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Process Python segmentation fault (core dumped)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what the reason is and how can i fix it? I am on ubuntu 16.04 and using the default python-mode of emacs24.&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastActivityDate="2016-06-17T20:49:33.530" Title="Problem working with python/pygame" Tags="|python|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24011" PostTypeId="1" AcceptedAnswerId="24014" CreationDate="2016-06-17T08:29:12.013" Score="6" ViewCount="400" Body="&lt;p&gt;When I run &lt;code&gt;save-buffers-kill-emacs&lt;/code&gt; or &lt;code&gt;projectile-kill-buffers&lt;/code&gt; I get asked to save changed buffers. But for me a lot of these buffers do not differ from the file on disk. Can I make Emacs diff the buffer and file and only ask if there are differences? It can assume &quot;no&quot; or &quot;yes&quot; if there are no differences (&quot;no&quot; is preferred but I'm not picky).&lt;/p&gt;&#xA;" OwnerUserId="698" LastEditorUserId="698" LastEditDate="2016-06-17T15:09:00.380" LastActivityDate="2016-06-17T15:17:33.087" Title="Make Emacs diff files before asking to save" Tags="|hooks|saving|diff|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24012" PostTypeId="1" CreationDate="2016-06-17T08:43:26.277" Score="0" ViewCount="636" Body="&lt;p&gt;Has anyone found or has an idea why Emacs hangs on start up. I see a lot of posts about this issue but it seems that this is not fixed yet. It also appears that this only happens to older machines, and specifically when many apps are running in the same time.&lt;/p&gt;&#xA;" OwnerUserId="12402" LastEditorUserId="16543" LastEditDate="2018-07-17T19:44:58.917" LastActivityDate="2018-07-17T19:44:58.917" Title="Emacs v24.4 hangs on start up" Tags="|osx|" AnswerCount="1" CommentCount="0" ClosedDate="2016-06-28T13:26:35.880" ContentLicense="CC BY-SA 4.0" />
  <row Id="24013" PostTypeId="2" ParentId="24012" CreationDate="2016-06-17T12:48:29.610" Score="3" Body="&lt;p&gt;This issue has been fixed in the upcoming Emacs 25 release.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was caused by input events arriving before the initialization had finished. The problem was worse when the machine was under heavy load, like when Emacs was launched after a reboot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has been reported a number of times by users, including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18849&quot; rel=&quot;nofollow&quot;&gt;#18849: 24.4; Crash on Mac OS X 10.10 when automatically launched at startup&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19879&quot; rel=&quot;nofollow&quot;&gt;#19879: 24.4; Hang on startup on OS X (GUI only)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20228&quot; rel=&quot;nofollow&quot;&gt;#20228: 24.4; Hanging process on OS X Yosemite when launching Cocoa built Emacs.app&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2016-06-21T10:58:59.530" LastActivityDate="2016-06-21T10:58:59.530" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24014" PostTypeId="2" ParentId="24011" CreationDate="2016-06-17T14:01:48.087" Score="4" Body="&lt;p&gt;I've used a function like this for something similar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun current-buffer-matches-file-p ()&#xA;  &quot;Return t if the current buffer is identical to its associated file.&quot;&#xA;  (autoload 'diff-no-select &quot;diff&quot;)&#xA;  (when buffer-file-name&#xA;    (diff-no-select buffer-file-name (current-buffer) nil 'noasync)&#xA;    (with-current-buffer &quot;*Diff*&quot;&#xA;      (and (search-forward-regexp &quot;^Diff finished \(no differences\)\.&quot; (point-max) 'noerror) t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my case I have a command to kill the current buffer that doesn't prompt if the buffer matches the file on disk, using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (when (current-buffer-matches-file-p)&#xA;    (set-buffer-modified-p nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before calling &lt;code&gt;kill-buffer&lt;/code&gt;. You could do something similar over the current buffer list and use it to advise the relevant save/exit commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun maybe-unset-buffer-modified ()&#xA;  &quot;Walk the buffer list and clear the modified flag for any&#xA;buffer marked modified that is identical to its corresponding&#xA;file on disk.&quot;&#xA;  (interactive)&#xA;  (dolist (buf (buffer-list))&#xA;    (with-current-buffer buf&#xA;      (when (and buffer-file-name (buffer-modified-p))&#xA;        (when (current-buffer-matches-file-p)&#xA;          (set-buffer-modified-p nil))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use advice to call this function before buffers are saved. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice save-some-buffers (before maybe-mark-unmodified activate)&#xA;  (maybe-unset-buffer-modified))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-06-17T15:17:33.087" LastActivityDate="2016-06-17T15:17:33.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24015" PostTypeId="2" ParentId="23850" CreationDate="2016-06-17T14:48:36.500" Score="2" Body="&lt;p&gt;Maybe you did not indicate the full problem you want to solve. But based only on your description, there are simpler ways to handle it.  Two obvious ones come to mind (see below).  You might want to specify your problem further, indicating why, for example, these obvious approaches might not be appropriate/sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use an optional argument:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-message (msg &amp;amp;optional vanillap)&#xA;  (message (if vanillap msg (concat &quot;**&quot; msg &quot;**&quot;))))&#xA;&#xA;(defun unaffected-fn ()&#xA;  (my-message &quot;Goodbye!&quot; t))&#xA;&#xA;(defun target-fn ()&#xA;  (my-message &quot;Hello!&quot;)&#xA;  (unaffected-fn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use a variable:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why Emacs Lisp has dynamic binding (in addition to lexical binding).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-msg-wrap &quot;**&quot;)&#xA;&#xA;(defun my-message (msg)&#xA;  (message (concat my-msg-wrap msg my-msg-wrap)))&#xA;&#xA;(defun unaffected-fn ()&#xA;  (let ((my-msg-wrap  &quot;&quot;))&#xA;    (my-message &quot;Goodbye!&quot;)))&#xA;&#xA;(defun target-fn ()&#xA;  (my-message &quot;Hello!&quot;)&#xA;  (unaffected-fn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-06-17T14:48:36.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24016" PostTypeId="1" CreationDate="2016-06-17T17:08:48.213" Score="1" ViewCount="43" Body="&lt;p&gt;&lt;code&gt;evil-indent&lt;/code&gt; does not work in &lt;code&gt;ein&lt;/code&gt;, it simply collapses all indentations of the selected region. Can I somehow tell Evil that it is dealing with Python code? &lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2016-06-17T17:08:48.213" Title="How can I tell evil which language mode to use for indentation?" Tags="|evil|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24017" PostTypeId="1" CreationDate="2016-06-17T18:24:12.683" Score="0" ViewCount="349" Body="&lt;p&gt;One of my modes uses the header line to display a progress bar/document summary, concatenating spaces with varying background colors and widths (using the &lt;code&gt;display&lt;/code&gt; attribute). To clarify the distinction between the header line and the document, I'd like to separate them with a solid line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I draw a thin solid line under the header line?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things I tried without success:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;'face (:box (:line-width -1 :color &quot;grey&quot;))&lt;/code&gt;: Shows a line all around the mode line, not just under it&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;'face (:underline (:color &quot;grey&quot;))&lt;/code&gt;: background color of header line shows below underline&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-11-15T02:04:20.477" Title="Draw a line between the header line and the text area" Tags="|display|header-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24018" PostTypeId="1" AcceptedAnswerId="24038" CreationDate="2016-06-17T19:09:51.040" Score="1" ViewCount="478" Body="&lt;p&gt;I have this code that used to work fine until today:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((newest-pkg (cadr (assq 'org package-archive-contents)))&#xA;       (installed-pkg (cadr (or (assq 'org package-alist)&#xA;                               (assq 'org package--builtins)))))&#xA;  (when (version-list-&amp;lt;= (package-desc-version newest-pkg) (package-desc-version installed-pkg))&#xA;    ;; Instalamos la nueva versión de org-mode&#xA;    ;;(package-install newest-pkg)&#xA;    (message (format &quot;Paquete «%s» actualizado de la versión %s a la versión %s&quot;&#xA;                     (package-desc-name newest-pkg)&#xA;                     (car (package-desc-version newest-pkg))&#xA;                     (car (package-desc-version installed-pkg))))&#xA;    ;;(delete-directory (package-desc-dir installed-pkg) t)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it is failing with this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp [nil nil &quot;Outline-based notes management and organizer&quot;])&#xA;  cadr((org . [nil nil &quot;Outline-based notes management and organizer&quot;]))&#xA;  (let* ((newest-pkg (cadr (assq (quote org) package-archive-contents))) (installed-pkg (cadr (or (assq (quote org) package-alist) (assq (quote org) package--builtins))))) (if (version-list-&amp;lt;= (progn (or (and (memq (aref newest-pkg 0) cl-struct-package-desc-tags)) (error &quot;%s accessing a non-%s&quot; (quote package-desc-version) (quote package-desc))) (aref newest-pkg 2)) (progn (or (and (memq (aref installed-pkg 0) cl-struct-package-desc-tags)) (error &quot;%s accessing a non-%s&quot; (quote package-desc-version) (quote package-desc))) (aref installed-pkg 2))) (progn (message (format &quot;Paquete «%s» actualizado de la versión %s a la versión %s&quot; (progn (or (and ...) (error &quot;%s accessing a non-%s&quot; ... ...)) (aref newest-pkg 1)) (car (progn (or ... ...) (aref newest-pkg 2))) (car (progn (or ... ...) (aref installed-pkg 2))))))))&#xA;  eval((let* ((newest-pkg (cadr (assq (quote org) package-archive-contents))) (installed-pkg (cadr (or (assq (quote org) package-alist) (assq (quote org) package--builtins))))) (if (version-list-&amp;lt;= (progn (or (and (memq (aref newest-pkg 0) cl-struct-package-desc-tags)) (error &quot;%s accessing a non-%s&quot; (quote package-desc-version) (quote package-desc))) (aref newest-pkg 2)) (progn (or (and (memq (aref installed-pkg 0) cl-struct-package-desc-tags)) (error &quot;%s accessing a non-%s&quot; (quote package-desc-version) (quote package-desc))) (aref installed-pkg 2))) (progn (message (format &quot;Paquete «%s» actualizado de la versión %s a la versión %s&quot; (progn (or (and ...) (error &quot;%s accessing a non-%s&quot; ... ...)) (aref newest-pkg 1)) (car (progn (or ... ...) (aref newest-pkg 2))) (car (progn (or ... ...) (aref installed-pkg 2)))))))) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; This is how I'm setting the package archive.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf package-enable-at-startup nil)&#xA;(package-initialize)&#xA;(setf package-archives '((&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)&#xA;                         (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)&#xA;                         (&quot;gnu&quot; . &quot;https://elpa.gnu.org/packages/&quot;)))&#xA;&#xA;(unless package-archive-contents&#xA;  (package-refresh-contents))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My Emacs version is GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 3.20.6) of 2016-06-04 on juergen.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="105" LastEditDate="2016-08-22T17:50:36.720" LastActivityDate="2016-08-22T17:50:36.720" Title="cadr wrong type argument listp" Tags="|package|debugging|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24019" PostTypeId="1" AcceptedAnswerId="24024" CreationDate="2016-06-17T19:16:39.137" Score="4" ViewCount="211" Body="&lt;p&gt;For example, the following case.&#xA;It seems the system mistakenly compare wrong paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to compare, for example, is the &lt;code&gt;public static...&lt;/code&gt; with &lt;code&gt;public static...&lt;/code&gt;.&#xA;How can I do that? Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NrnX3.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NrnX3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2016-06-18T04:55:56.160" Title="How to manual set the specified paragraph to compare in ediff" Tags="|ediff|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24020" PostTypeId="2" ParentId="23923" CreationDate="2016-06-17T20:24:15.547" Score="0" Body="&lt;p&gt;If you do &lt;code&gt;C-h k d&lt;/code&gt; you'll see that &lt;kbd&gt;d&lt;/kbd&gt; is bounded to &lt;code&gt;evil-delete&lt;/code&gt;, &lt;a href=&quot;https://www.emacswiki.org/emacs/Evil#toc13&quot; rel=&quot;nofollow noreferrer&quot;&gt;so&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;dd&quot; 'my/very-special-evil-delete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should do the work. There's a &quot;&lt;code&gt;/dev/null&lt;/code&gt;-ish&quot; (&lt;code&gt;blackhole&lt;/code&gt;) register in vim which probably &lt;code&gt;evil&lt;/code&gt; mocks.&lt;/p&gt;&#xA;" OwnerUserId="10785" LastEditorUserId="12354" LastEditDate="2017-06-01T15:25:49.480" LastActivityDate="2017-06-01T15:25:49.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24021" PostTypeId="2" ParentId="24010" CreationDate="2016-06-17T20:49:33.530" Score="1" Body="&lt;p&gt;This doesn't seem to be a problem with python-mode  but with your python instance. &#xA;This &lt;a href=&quot;https://stackoverflow.com/a/13654489/1748672&quot;&gt;link&lt;/a&gt; goes into more detail, but it boils down to something has crashed. From the description you've given it sounds like your python instance is the crashing element. Double check that your python installed right. Considering that it is ubuntu, it should be fine. Next try reinstalling pygame. If your code is using a c compiled module make sure that it compiled right, and reinstall it.&#xA;Sorry that this is rather vague answer, if you provide code for evaluation I can go more in depth.&lt;/p&gt;&#xA;" OwnerUserId="11045" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-06-17T20:49:33.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24022" PostTypeId="2" ParentId="24017" CreationDate="2016-06-17T22:15:31.923" Score="1" Body="&lt;p&gt;Here is one idea using underline and a filler that is underlined.  You can add &lt;code&gt;:eval&lt;/code&gt; so that the line length updates as the window width changes.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defface my-regular-underscore-face&#xA;  '((t (:inherit default :underline (:style line :color &quot;red&quot;))))&#xA;  &quot;Face for `my-regular-underscore-face'.&quot;)&#xA;&#xA;(defface my-filler-underscore-face&#xA;  '((t (:inherit default :underline (:style line :color &quot;yellow&quot;))))&#xA;  &quot;Face for `my-filler-underscore-face'.&quot;)&#xA;&#xA;(setq header-line-format&#xA;  (nconc&#xA;    (list&#xA;      (propertize&#xA;        &quot;Hello-world!.&quot;&#xA;        'face 'my-regular-underscore-face))&#xA;    (list&#xA;      (propertize&#xA;        (make-string (window-width) ?\ )&#xA;          'face 'my-filler-underscore-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-06-17T22:15:31.923" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24023" PostTypeId="1" AcceptedAnswerId="70458" CreationDate="2016-06-17T22:23:53.847" Score="1" ViewCount="50" Body="&lt;p&gt;I've got bunch of rss feeds in newsticker and it's nearly perfect but poorly documented. Sometimes people reinstall their blog software (wordpress is particular pile of crap in this regard) and as a result all the entries in their feed become &quot;new&quot;. I'm pretty sure there got to be some magic key combo in newsticker to mark entire feed read again, but was unable to find it so far. Ideally I'd like to mark all the entries which are older than (year, month whatever) automatically read.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2022-07-08T22:04:20.430" Title="How to mark all entries for particular feed as read in newsticker?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24024" PostTypeId="2" ParentId="24019" CreationDate="2016-06-18T00:02:48.670" Score="2" Body="&lt;p&gt;Type &lt;kbd&gt;=&lt;/kbd&gt; to invoke &lt;code&gt;ediff-inferior-compare-regions&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tell it that you &lt;em&gt;don't&lt;/em&gt; want to compare the current highlighted regions, and Ediff will ask you to select the regions that you &lt;em&gt;do&lt;/em&gt; want to compare.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After exiting the inferior ediff session, return to the ediff control buffer for the original session and type &lt;kbd&gt;C-l&lt;/kbd&gt; to resume it, and &lt;kbd&gt;!&lt;/kbd&gt; to recalculate the regions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(ediff) Quick Help Commands&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-18T04:55:56.160" LastActivityDate="2016-06-18T04:55:56.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24025" PostTypeId="1" AcceptedAnswerId="24055" CreationDate="2016-06-18T00:04:42.927" Score="4" ViewCount="1313" Body="&lt;p&gt;I am writing an org file that org babel will tangle into &quot;custom.el&quot;  as shown &lt;a href=&quot;https://github.com/sachac/.emacs.d/blob/83d21e473368adb1f63e582a6595450fcd0e787c/Sacha.org#org-agenda&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://github.com/danielmai/.emacs.d&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that on one machine the path to my agenda files is &lt;code&gt;C:/Users/Username/Dropbox/file.org&lt;/code&gt;  while on anther machine it is &lt;code&gt;C:/Users/DifferentUserName/Dropbox/file.org&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can setq the org-directory to the the correct path on different machines with: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-directory &#xA;  (car  ;; with car returned value is type 'string' witout car returned type is 'cons'  &#xA;      (delq nil&#xA;         (mapcar (lambda(x) (and (file-directory-p x) x))&#xA;                       '(&quot;c:/Users/marka/Dropbox/Apps/OrgMode&quot;&#xA;                         &quot;c:/Users/Mark/Dropbox/Apps/OrgMode&quot;&#xA;                         &quot;c:/Users/msmith/Dropbox/Apps/OrgMode&quot;)))))   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With a single agenda file, using concat &lt;code&gt;(concat org-directory &quot;/gtd_work.org&quot;)&lt;/code&gt; returns the desired path to the agenda file &lt;code&gt;&quot;c:/Users/Mark/Dropbox/Apps/OrgMode/gtd_work.org&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately multiple uses of  the &lt;code&gt;concat&lt;/code&gt; function when nested in the &lt;code&gt;setq&lt;/code&gt;  appears to stop functioning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;  (setq org-agenda-files                             &#xA;&amp;gt;             '((concat org-directory &quot;/gtd_work.org&quot;)&#xA;&amp;gt;               (concat org-directory &quot;/gtd_proging.org&quot;)&#xA;&amp;gt;               (concat org-directory &quot;/gtd_home.org&quot;)&#xA;&amp;gt;               (concat org-directory &quot;/DailyRoutine.org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;C-h v&lt;/code&gt; to find the value of &lt;code&gt;org-agenda-files&lt;/code&gt; yields: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-agenda-files is a variable defined in `org.el'.&#xA;Its value is ((concat org-directory &quot;/gtd_work.org&quot;)&#xA; (concat org-directory &quot;/gtd_proging.org&quot;)&#xA; (concat org-directory &quot;/gtd_home.org&quot;)&#xA; (concat org-directory &quot;/DailyRoutine.org&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally I have tried:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Removing the single quote in the &lt;code&gt;setq&lt;/code&gt;, this raises an &lt;code&gt;Invalid function: (concat org-directory &quot;/gtd_work.org&quot;)&lt;/code&gt; exception.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;mapcar&lt;/code&gt; and &lt;code&gt;mapc&lt;/code&gt; raise &lt;code&gt;Wrong type argument: stringp, (concat org-directory &quot;/gtd_work.org&quot;)&lt;/code&gt; exceptions.&lt;/li&gt;&#xA;&lt;li&gt;Using &lt;code&gt;~/file.org&lt;/code&gt; without concat returns nil &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am doing this in scratch right now as config.org is w.i.p.  Will org concat the path to the agenda files? Am I not using concat correctly?  If I write out the full path for each file on each computer and use &lt;code&gt;(mapcar (lambda (x) (and (file-exists-p x) x))&lt;/code&gt; it will correctly select the machine specific path, however, this results in the first world problem of having to specify 20~40 paths rather than 8~12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution by amitp below works for both the &lt;code&gt;setq&lt;/code&gt; and for the:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files&#xA;      (delq nil&#xA;            (mapcar (lambda (x) (and (file-exists-p x) x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks everyone for the help.&lt;/p&gt;&#xA;" OwnerUserId="12399" LastEditorUserId="12399" LastEditDate="2016-08-12T18:27:10.910" LastActivityDate="2016-08-12T18:27:10.910" Title="Synchronize org mode between different machines" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24026" PostTypeId="2" ParentId="23923" CreationDate="2016-06-18T04:59:58.100" Score="1" Body="&lt;p&gt;&lt;code&gt;(setq save-interprogram-paste-before-kill nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Separating the clipboard and kill-ring is more efficient for my workflow, for clipboard, I use &lt;a href=&quot;https://github.com/rolandwalker/simpleclip&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rolandwalker/simpleclip&lt;/a&gt; API &lt;code&gt;simpleclip-set-content&lt;/code&gt; and &lt;code&gt;simpleclip-get-content&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-06-18T04:59:58.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24028" PostTypeId="1" CreationDate="2016-06-18T09:50:18.177" Score="1" ViewCount="495" Body="&lt;p&gt;I'm new to emacs (spacemacs).  I've set up the &lt;code&gt;col-highlight&lt;/code&gt; package in my &lt;code&gt;.spacemacs&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(column-highlight-mode 1)&#xA;(set-face-attribute 'col-highlight nil :inherit 'hl-line :background)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in order to pick up the background of the current line for the current column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I set the same background for the column in long wrapped lines?&lt;/em&gt; The background of the current column of wrapped lines does not match and is an annoying contrasting white.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: should have mentioned that this is emacs/spacemacs in terminal mode. I now think this related to my .Xresources file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT2: see - &lt;a href=&quot;https://github.com/DougDavenport/spacemacs&quot; rel=&quot;nofollow&quot;&gt;https://github.com/DougDavenport/spacemacs&lt;/a&gt; for an image of the issue and my .Xresources file&lt;/p&gt;&#xA;" OwnerUserId="12412" LastEditorUserId="12412" LastEditDate="2016-06-18T17:47:31.493" LastActivityDate="2016-06-18T17:47:31.493" Title="How to set column highlight background color for wrapped lines in terminal mode?" Tags="|colors|column|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24029" PostTypeId="1" AcceptedAnswerId="24142" CreationDate="2016-06-18T12:23:55.237" Score="0" ViewCount="1103" Body="&lt;p&gt;I would like to copy a defined text-link to the clipboard by mouse-1 or C-c,C-o. Something like file+sys: that just does not open the file it should copy the following text to the clipboard. Is a function like that in org-mode or emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background story: I use Emacs on windows which is a nightmare itself, but due to external conditions I have to use windows. Some month ago I came to the conclusion that cygwin emacs-w32 has some advantages over ntemacs, like working pdf-tools, therfore I use that. But emacs-w32 sees cygwin as it's &quot;OS&quot;. This means a lot of w32-stuff like org-outlook gets broken. Fixing all that is beyond my abilities. Now I came to conclusion that a half-automatic, using a copy-text-to-clipboard-link which is pasted manually where I need it, is at least better than nothing at all.&lt;/p&gt;&#xA;" OwnerUserId="11055" LastActivityDate="2020-09-27T05:28:21.143" Title="Copy-text-to-clipboard-link" Tags="|org-mode|clipboard|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24030" PostTypeId="1" CreationDate="2016-06-18T15:18:30.463" Score="47" ViewCount="11913" Body="&lt;p&gt;This is a very basic but I have been unable to find the answer on the web.&#xA;Is it possible to &lt;code&gt;git rm&lt;/code&gt;, i.e. to remove a tracked file, from magit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="9675" LastEditorUserId="306" LastEditDate="2016-08-01T23:12:37.563" LastActivityDate="2019-11-22T10:06:19.853" Title="Git rm from magit" Tags="|magit|deletion|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24031" PostTypeId="1" AcceptedAnswerId="24037" CreationDate="2016-06-18T15:33:35.660" Score="8" ViewCount="2022" Body="&lt;p&gt;I sometimes want to display information in Help buffer style, so I have been using code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-help-window (help-buffer)&#xA;  (princ &quot;Type q to exit this help buffer.\n\n&quot;)&#xA;  (princ result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine, but the help window only uses half of my frame. I normally split my frame horizontally, to give two tall windows. The displayed help buffer uses one of the two windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would rather use the whole frame in some cases, to display more information and to reduce the number of times I need to page down through the displayed information. The problem to solve is how to temporarily use the whole frame for the &lt;code&gt;with-help-window&lt;/code&gt; call, and to automatically restore the original buffers/window sizes when I type &quot;q&quot; in the help window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I best achieve this goal?  I think I'm looking for something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-FULL-FRAME-help-window (help-buffer)&#xA;   ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've looked at winner-mode, bookmarks, saving layouts to registers, the various (and powerful, but complex) &lt;code&gt;(display-buffer ...)&lt;/code&gt; methods. Most of them seem slightly off-target to my desired intent because they tend to correct/restore a layout after a full frame display operation. And it seems to me that many of them require me to manually restore my window layout (which I would prefer not to do).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if anyone has heard of a way to solve this simply. I'm hoping for something simple like these possible approaches, where I can override something with a let frame...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((help-window-width-display-option fullwidth))&#xA;  (with-help-window (help-buffer)&#xA;    ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or this kind of approach, which I don't know how to do yet, and which looks somewhat difficult/tricky for my current skill level.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((save original configuration somehow)&#xA;  (delete-other-windows)&#xA;  (with-help-window (help-buffer)&#xA;     ...)&#xA;  ;; somehow, when I type &quot;q&quot; in the help buffer&#xA;  ;; - catch that action in code after the buffer is killed&#xA;  ;; - and restore the original window configuration&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems to me the key problem for me to solve is how to automatically restore the original window configuration when I type &quot;q&quot; in the temporary help-mode buffer. Thanks&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-06-20T19:19:42.783" Title="How to display a help buffer/window full frame size (not full screen)" Tags="|window|help-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24033" PostTypeId="1" CreationDate="2016-06-18T16:03:53.977" Score="2" ViewCount="452" Body="&lt;p&gt;I'm using iterm2 v3.0.2 with fishs hell and tmux in osx. When I'm opening file via emacsclient and closing buffer - I'm successfully returning to terminal, BUT iterm2 window has no focus, so I have to click on window to gain it. I tested behaviour inside tmux session and outside - the same behaviour. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My command to run emacsclient:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -a \&quot;\&quot; $argv&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2020-09-09T13:58:33.333" Title="When returning from emacsclient to iterm2, terminal not getting focus" Tags="|emacsclient|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24034" PostTypeId="2" ParentId="24033" CreationDate="2016-06-18T17:17:39.577" Score="1" Body="&lt;p&gt;Maybe you can try to switch to your terminal app explicitly when &lt;kbd&gt;C-x #&lt;/kbd&gt; (&lt;code&gt;server-edit&lt;/code&gt;, the command to tell emacsclient that you finish editing):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'server-done-hook&#xA;          (defun open-terminal ()&#xA;            (shell-command &quot;open -a Terminal&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You also need to replace &lt;code&gt;Terminal&lt;/code&gt; with &lt;code&gt;iTerm&lt;/code&gt; since you are using iTerm2, not the built-in Terminal. I don't have iTerm2 installed on my Mac, so I can't try it myself.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-06-19T08:56:15.753" LastActivityDate="2016-06-19T08:56:15.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24035" PostTypeId="2" ParentId="24025" CreationDate="2016-06-18T17:49:01.587" Score="3" Body="&lt;p&gt;Instead of using just the string value, perhaps use &lt;code&gt;expand-file-name&lt;/code&gt;? I believe this expands to the correct cross platform value on windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could define a user constant to make it easy to use in multiple places, just like &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/core/core-load-paths.el#L45&quot; rel=&quot;nofollow&quot;&gt;this bit from spacemacs core&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst user-home-directory&#xA;  (expand-file-name &quot;~/&quot;)&#xA;  &quot;User home directory (~/).&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12416" LastActivityDate="2016-06-18T17:49:01.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24036" PostTypeId="1" CreationDate="2016-06-18T18:40:37.033" Score="2" ViewCount="451" Body="&lt;p&gt;I wish to call man function in emacsclient when I typing &quot;man smth&quot; in terminal. When I open files from iterm via emacsclient - emacs gaining focus and when I kill buffer - terminal gaining focus back. But when I want not open file but evaluate &quot;man ls&quot; for example - its evaluating in emacs, but not switching to emacs and when I close man buffer its not switching back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my command to open man page from iterm in emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -e &quot;(man \&quot;ls\&quot;)&quot; -a &quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone point me what am I doing wrong plz? Thx.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-09-17T06:39:30.660" Title="Emacsclient not focusing if called with --eval argument from terminal" Tags="|emacsclient|command-line-arguments|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24037" PostTypeId="2" ParentId="24031" CreationDate="2016-06-18T19:55:56.683" Score="5" Body="&lt;p&gt;&lt;strong&gt;Example #1&lt;/strong&gt;:  The keyboard shortcut &lt;code&gt;q&lt;/code&gt; in the &lt;code&gt;help-mode&lt;/code&gt; buffer comes from the &lt;code&gt;special-mode-map&lt;/code&gt; that is incorporated into the &lt;code&gt;help-mode-map&lt;/code&gt;.  The default value is &lt;code&gt;quit-window&lt;/code&gt;, which offers only four (4) possible actions:  &quot;&lt;em&gt;According to information stored in WINDOW’s &lt;code&gt;quit-restore&lt;/code&gt; window parameter either (1) delete WINDOW and its frame, (2) delete WINDOW, (3) restore the buffer previously displayed in WINDOW, or (4) make WINDOW display some other buffer than the present one.  If non-nil, reset &lt;code&gt;quit-restore&lt;/code&gt; parameter to nil.&lt;/em&gt;&quot;  [See doc-string:  &lt;code&gt;M-x describe-function RET quit-window RET&lt;/code&gt;]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an outline of what this example does:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Let-bind the variable &lt;code&gt;help-window-select&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; so that the &lt;code&gt;*Help*&lt;/code&gt; window is selected.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Let-bind the current window configuration to a temporary variable called &lt;code&gt;config&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate the &lt;code&gt;*Help*&lt;/code&gt; window.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Store the previous window configuration -- &lt;code&gt;config&lt;/code&gt; -- in a local-variable called &lt;code&gt;my-stored-win-config&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Create a local key assignment for the letter &lt;code&gt;q&lt;/code&gt;, which is bound to &lt;code&gt;my-restore-win-config&lt;/code&gt;.  [This local assignment trumps/shadows the previous assignment of &lt;code&gt;quit-window&lt;/code&gt;.]&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Delete other windows.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press the letter &lt;code&gt;q&lt;/code&gt; to restore the prior window configuration, and kill the &lt;code&gt;*Help*&lt;/code&gt; buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-stored-win-config nil)&#xA;(make-variable-buffer-local 'my-stored-win-config)&#xA;&#xA;(defun my-restore-win-config ()&#xA;  (interactive)&#xA;  (when my-stored-win-config&#xA;    (set-window-configuration my-stored-win-config)&#xA;    (kill-buffer &quot;*Help*&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The following snippet is a sample usage, but is not a complete interactive function.  It can be evaluated in the &lt;code&gt;*scratch*&lt;/code&gt; buffer to see it in action.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((help-window-select t)&#xA;      (config (current-window-configuration)))&#xA;  (with-help-window (help-buffer)&#xA;    (princ &quot;Type q to kill this *Help* buffer and restore prior window configuration.&quot;))&#xA;  (with-current-buffer &quot;*Help*&quot;&#xA;    (setq my-stored-win-config config)&#xA;    (local-set-key &quot;q&quot; 'my-restore-win-config))&#xA;  (delete-other-windows))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example #2&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;p&gt;Here is a self-contained macro that does everything as the above example, which deals with three possible situations relating to existing hook values -- e.g., &lt;code&gt;nil&lt;/code&gt;, symbol, or, list of symbols.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro help-window-full-frame (buffer-name &amp;amp;rest body)&#xA;&quot;Doc-string.&quot;&#xA;  (declare (indent 1) (debug t))&#xA;  `(progn&#xA;    (set-marker help-window-point-marker nil)&#xA;      (let* (&#xA;          (help-window-select t)&#xA;          (foo&#xA;            (lambda ()&#xA;              (set (make-local-variable 'window-configuration)&#xA;                (current-window-configuration))&#xA;              (local-set-key &quot;q&quot;&#xA;                (lambda ()&#xA;                  (interactive)&#xA;                  (when window-configuration&#xA;                    ;; Record the `current-buffer' before it gets buried.&#xA;                    (let ((cb (current-buffer)))&#xA;                      (set-window-configuration window-configuration)&#xA;                      (kill-buffer cb)))))))&#xA;          ;; Preserve the original hook values by let-binding them in advance.&#xA;          ;; Otherwise, `add-to-list' would alter the global value.&#xA;          (temp-buffer-window-setup-hook temp-buffer-window-setup-hook)&#xA;          (temp-buffer-window-show-hook temp-buffer-window-show-hook)&#xA;          (temp-buffer-window-setup-hook&#xA;            (cond&#xA;              ((null temp-buffer-window-setup-hook)&#xA;                (list 'help-mode-setup foo))&#xA;              ((and&#xA;                  (not (null temp-buffer-window-setup-hook))&#xA;                  (listp temp-buffer-window-setup-hook))&#xA;                (add-to-list 'temp-buffer-window-setup-hook foo)&#xA;                (add-to-list 'temp-buffer-window-setup-hook 'help-mode-setup))&#xA;              ((and&#xA;                  (not (null temp-buffer-window-setup-hook))&#xA;                  (symbolp temp-buffer-window-setup-hook))&#xA;                (list 'help-mode-setup foo temp-buffer-window-setup-hook))))&#xA;          (temp-buffer-window-show-hook&#xA;            (cond&#xA;              ((null temp-buffer-window-show-hook)&#xA;                (list 'help-mode-finish 'delete-other-windows))&#xA;              ((and&#xA;                  (not (null temp-buffer-window-show-hook))&#xA;                  (listp temp-buffer-window-show-hook))&#xA;                (add-to-list 'temp-buffer-window-show-hook 'delete-other-windows)&#xA;                (add-to-list 'temp-buffer-window-show-hook 'help-mode-finish))&#xA;              ((and&#xA;                  (not (null temp-buffer-window-show-hook))&#xA;                  (symbolp temp-buffer-window-show-hook))&#xA;                (list&#xA;                  'help-mode-finish&#xA;                  'delete-other-windows&#xA;                  temp-buffer-window-show-hook)))) )&#xA;        (with-temp-buffer-window ,buffer-name nil 'help-window-setup (progn ,@body)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here is the sample snippet to evaluate in the &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(help-window-full-frame (help-buffer)&#xA;  (princ &quot;Type q to kill this *Help* buffer and restore prior window configuration.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-06-20T19:19:42.783" LastActivityDate="2016-06-20T19:19:42.783" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="24038" PostTypeId="2" ParentId="24018" CreationDate="2016-06-18T20:21:22.697" Score="2" Body="&#xA;&lt;p&gt;Looking at the documentation for the following three variables, they have slightly different formats:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;package-archive-contents&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is an alist mapping package names (symbols) to non-empty lists of `package-desc' structures.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;package-alist&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Each element has the form (PKG . DESCS), where PKG is a package name (a symbol) and DESCS is a non-empty list of `package-desc'structure, sorted by decreasing versions.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;package--builtins&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Each element has the form (PKG . PACKAGE-BI-DESC), where PKG is a package name (a symbol) and DESC is a `package--bi-desc' structure.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So &lt;code&gt;package--builtins&lt;/code&gt; needs to be handled a little differently because the &lt;code&gt;cdr&lt;/code&gt; of each element is not a list like the other two.  Instead, you should be able to make it work like this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((newest-pkg (car-safe (cdr (assq 'org package-archive-contents))))&#xA;       (new-ver (and newest-pkg (package-desc-version newest-pkg)))&#xA;       (builtin-pkg (cdr (assq 'org package--builtins)))&#xA;       (installed-pkg (car-safe (cdr (assq 'org package-alist))))&#xA;       (old-dir (and installed-pkg (package-desc-dir installed-pkg)))&#xA;       (old-ver (or (and installed-pkg (package-desc-version installed-pkg))&#xA;                    (and builtin-pkg (package--bi-desc-version builtin-pkg)))))&#xA;  (when (and new-ver (version-list-&amp;lt; old-ver new-ver))&#xA;    ;; Instalamos la nueva versión de org-mode&#xA;    ;;(package-install newest-pkg)&#xA;    (message (format &amp;quot;Paquete «%s» actualizado de la versión %s a la versión %s&amp;quot;&#xA;                     (package-desc-name newest-pkg) old-ver new-ver))&#xA;    ;; (when old-dir (delete-directory old-dir t))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="93" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-06-19T01:11:07.580" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24039" PostTypeId="1" AcceptedAnswerId="27685" CreationDate="2016-06-18T20:57:28.820" Score="1" ViewCount="803" Body="&lt;p&gt;I'd like to read a serial link from Emacs using &lt;code&gt;serial-term&lt;/code&gt;. The output looks wrong, like if the new line characters did not trigger carriage return:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;First line&#xA;          Second line&#xA;                     Third line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reading from this serial line using &lt;code&gt;ansi-term&lt;/code&gt; shows the expected output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A first line&#xA;A second line&#xA;Third line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to use &lt;code&gt;set-buffer-file-coding-system&lt;/code&gt; to &lt;code&gt;unix&lt;/code&gt; in the &lt;code&gt;serial-term&lt;/code&gt; buffer, but this did not change anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to get &lt;code&gt;serial-term&lt;/code&gt; to interpret new line characters as carriage return and a line feed? &lt;/p&gt;&#xA;" OwnerUserId="10314" LastActivityDate="2016-12-09T01:53:10.690" Title="Can serial-term interpret new line characters as CR LF?" Tags="|character-encoding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24040" PostTypeId="1" AcceptedAnswerId="24081" CreationDate="2016-06-18T21:11:57.963" Score="6" ViewCount="2327" Body="&lt;p&gt;Does anyone have a good way to produce LaTeX mathematics &lt;a href=&quot;https://en.wikibooks.org/wiki/LaTeX/Mathematics#Matrices_and_arrays&quot;&gt;matrices&lt;/a&gt;  from org-mode tables? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this &lt;a href=&quot;http://thread.gmane.org/gmane.emacs.orgmode/62570/focus=62685&quot;&gt;thread&lt;/a&gt; but it doesn't seem to have a ready-made solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gets me close.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX: \begin{equation}&#xA;#+LATEX: \begin{matrix}&#xA;| a | b |&#xA;| c | d |&#xA;#+LATEX: \end{matrix}&#xA;#+LATEX: \end{equation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which exports to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{equation}&#xA;\begin{matrix}&#xA;\begin{center}&#xA;\begin{tabular}{ll}&#xA;a &amp;amp; b\\&#xA;c &amp;amp; d\\&#xA;\end{tabular}&#xA;\end{center}&#xA;\end{matrix}&#xA;\end{equation}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I only have to take out the tabular and center directives.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="9019" LastEditDate="2016-06-20T13:41:35.447" LastActivityDate="2016-06-21T05:45:40.480" Title="Export org-mode tables to LaTeX mathematics matrices?" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24041" PostTypeId="2" ParentId="14246" CreationDate="2016-06-18T23:02:33.363" Score="1" Body="&lt;p&gt;I just published a package called &lt;a href=&quot;https://github.com/purcell/disable-mouse&quot; rel=&quot;nofollow&quot;&gt;disable-mouse&lt;/a&gt; which does this: it provides a global minor mode which swallows and ignores all mouse events.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2016-06-18T23:02:33.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24042" PostTypeId="2" ParentId="21540" CreationDate="2016-06-18T23:07:29.777" Score="2" Body="&lt;p&gt;You might want to try out my recently-published &lt;a href=&quot;https://github.com/purcell/disable-mouse&quot; rel=&quot;nofollow&quot;&gt;disable-mouse&lt;/a&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2016-06-18T23:07:29.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24043" PostTypeId="2" ParentId="24031" CreationDate="2016-06-19T00:00:26.553" Score="3" Body="&lt;p&gt;Based on the excellent answer by @lawlist, here are my completed functions for the next guy...&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; a tmp buffer-local place that gets destroyed with the help buffer&#xA;(defvar kwj-v-window-config-saved nil)&#xA;(make-variable-buffer-local 'kwj-v-window-config-saved)&#xA;&#xA;(defun kwj-help-window-full-frame (string)&#xA;  &quot;Show STRING in a help buffer using the full current frame.&quot;&#xA;  (let (original-layout)&#xA;    ;; set this before Help changes the config&#xA;    (setq original-layout (current-window-configuration))&#xA;    (with-help-window (help-buffer)&#xA;      (princ &quot;Type q to exit this help buffer.\n\n&quot;)&#xA;      (princ string))&#xA;    (with-current-buffer &quot;*Help*&quot;&#xA;      ;; save layout in buffer local var that gets deleted&#xA;      (setq kwj-v-window-config-saved original-layout)&#xA;      ;; bind key in BUFFER (not in help window above)&#xA;      ;; bind key *after* help buf is displayed&#xA;      (local-set-key &quot;q&quot; 'kwj-help-window-restore))&#xA;    (delete-other-windows)))&#xA;&#xA;(defun kwj-help-window-restore ()&#xA;  &quot;Restore original windows after a full frame help display.&quot;&#xA;  (interactive)&#xA;  (set-window-configuration kwj-v-window-config-saved)&#xA;  (kill-buffer &quot;*Help*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The long chain of comments above, with continued help from @lawlist, resulted in this version of a macro that doesn't require a buffer name, properly treats original setup/show hook lists, and that doesn't cause problems with the &quot;q&quot; key in other &lt;em&gt;Help&lt;/em&gt; mode buffers.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-help-window-full-frame (&amp;amp;rest body)&#xA;  &quot;Display text in a full-frame help window.&#xA;Execute BODY forms to put output into the window, with standard&#xA;output directed to the buffer.&quot;&#xA;  ;;tell indenter about this macro name&#xA;  (declare (indent 1))&#xA;  ;; must use a buffer string name here, not the buffer itself&#xA;  `(let ((mybuf ,(buffer-name (get-buffer-create &quot;Full Frame Help&quot;)))&#xA;         ;;`(let ((mybuf ,(help-buffer))&#xA;         mysetup tmpsetup tmpshow)&#xA;     ;; save a copy of original hooks&#xA;     (setq tmpsetup (copy-list temp-buffer-window-setup-hook))&#xA;     (setq tmpshow (copy-list temp-buffer-window-show-hook))&#xA;&#xA;     ;; create window config store and restore functions&#xA;     ;; credit to @lawlist on stackoverflow for this embedded setup&#xA;     (setq mysetup&#xA;           (lambda ()&#xA;             ;; store original window configuration&#xA;             (set (make-local-variable 'orig-win-config)&#xA;                  (current-window-configuration))&#xA;             ;; bind q to the window restore function&#xA;             (local-set-key&#xA;              &quot;q&quot;&#xA;              (lambda ()&#xA;                (interactive)&#xA;                ;; q is shared by all Help-mode buffers&#xA;                ;; so guard those that did not set up orig-win-config&#xA;                (when (boundp 'orig-win-config)&#xA;                  (set-window-configuration orig-win-config))&#xA;                (kill-buffer (current-buffer))))))&#xA;&#xA;     ;; Add to help setup hooks. Keep original hook functions if any&#xA;     ;; delete-dups destructively hacks our tmp copy, not original hooklists&#xA;     (push mysetup tmpsetup)          ;order critical here&#xA;     (push 'help-mode-setup tmpsetup) ;this must be first in hook&#xA;     (delete-dups tmpsetup)&#xA;&#xA;     (push 'help-mode-finish tmpshow) ;order not important here&#xA;     (push 'delete-other-windows tmpshow)&#xA;     (delete-dups tmpshow)&#xA;&#xA;     ;; shadow the original hooks with our copies for the display call&#xA;     (let ((temp-buffer-window-setup-hook tmpsetup)&#xA;           (temp-buffer-window-show-hook tmpshow))&#xA;&#xA;       ;; show buf with locally embedded window restore function&#xA;       (with-temp-buffer-window mybuf nil&#xA;                                'help-window-setup&#xA;                                (progn ,@body)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use the macro in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-help-window-full-frame&#xA;    (princ &quot;Type q to exit this buffer.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-06-19T13:46:23.597" LastActivityDate="2016-06-19T13:46:23.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24044" PostTypeId="1" AcceptedAnswerId="24045" CreationDate="2016-06-19T02:11:17.403" Score="3" ViewCount="175" Body="&lt;p&gt;This question is surprisingly difficult for me to formulate in a google-able way, but how can I stop eshell from correcting away my asterisks? For example, if I try &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ rm ./*~&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to remove auto-saved files in current working directory, eshell removes the statement when I type *, and with some lag, in fact, leaving me with this statement (visible just too late for me to stop myself from executing)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ rm ~&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is fortunately not as dangerous as it appears. But still, this seems like an accident waiting to happen, so what is exactly happening here, and how can I get it to go away?&lt;/p&gt;&#xA;" OwnerUserId="6554" LastActivityDate="2016-06-19T04:48:35.823" Title="Removing eshell automatic correction" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24045" PostTypeId="2" ParentId="24044" CreationDate="2016-06-19T04:48:35.823" Score="4" Body="&lt;p&gt;The problem is not Eshell, but &lt;code&gt;company-mode&lt;/code&gt; (maybe &lt;code&gt;autocomplete-mode&lt;/code&gt; as well, I'm not sure). Try turning &lt;code&gt;company-mode&lt;/code&gt; off and see if entering an asterisk (&lt;code&gt;*&lt;/code&gt;) still has the same behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This issue is &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/218&quot; rel=&quot;nofollow&quot;&gt;#128&lt;/a&gt; for &lt;code&gt;company-mode&lt;/code&gt; on GitHub.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround, you can enter an asterisk with &lt;code&gt;quoted-insert&lt;/code&gt; (&lt;kbd&gt;C-q&lt;/kbd&gt; by default).&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-06-19T04:48:35.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24046" PostTypeId="2" ParentId="24036" CreationDate="2016-06-19T05:10:37.267" Score="2" Body="&lt;p&gt;New windows not getting focus seems to be an &lt;a href=&quot;https://major.io/2015/07/06/allow-new-windows-to-steal-focus-in-gnome-3/&quot; rel=&quot;nofollow noreferrer&quot;&gt;issue with the OS/window manager&lt;/a&gt;, not Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot of search results suggesting various hacks at either the &lt;a href=&quot;https://stackoverflow.com/questions/3636694/emacsclient-window-focus&quot;&gt;Emacs&lt;/a&gt; or &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/485s8o/emacsclient_new_terminal_frame_does_not_get_focus/&quot; rel=&quot;nofollow noreferrer&quot;&gt;OS&lt;/a&gt; level, but my preferred solution is to use the &lt;a href=&quot;http://mjwall.com/blog/2013/10/04/how-i-use-emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;scripts suggested by MJ Wall&lt;/a&gt;. These have explicit &lt;code&gt;raise-frame&lt;/code&gt; actions.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-06-19T05:10:37.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24047" PostTypeId="1" AcceptedAnswerId="24052" CreationDate="2016-06-19T06:32:57.007" Score="4" ViewCount="369" Body="&lt;p&gt;If I have the following text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Name  Score&#xA;Bob    87 &#xA;Ted    99 &#xA;Mary   78&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know C-c | will covert it to org table. But how can I do the other way around?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a org table already, how can I convert it to text block? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I originally thought I could use multiple-cursor to delete, but this is not that effective if the table is huge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone any ideas? Thanks&lt;/p&gt;&#xA;" OwnerUserId="12385" LastActivityDate="2016-06-19T13:52:44.877" Title="How to delete org-mode table separator | quickly?" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24048" PostTypeId="1" CreationDate="2016-06-19T06:53:40.113" Score="1" ViewCount="1818" Body="&lt;p&gt;I have emacs25 build from source (25.0.95). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the only configure in my init.el is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(default ((t (:family &quot;Ubuntu Mono&quot; :foundry &quot;DAMA&quot; :slant normal :weight normal :height 241 :width normal)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I open &lt;code&gt;emacs&lt;/code&gt;, the font is not changed, if I eval that code manually after &lt;code&gt;emacs&lt;/code&gt; is opened, the font is changed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook (lambda ()&#xA;                 (if (display-graphic-p)&#xA;                 (custom-set-faces&#xA;                  ;; custom-set-faces was added by Custom.&#xA;                  ;; If you edit it by hand, you could mess it up, so be careful.&#xA;                  ;; Your init file should contain only one such instance.&#xA;                  ;; If there is more than one, they won't work right.&#xA;                  '(default ((t (:family &quot;Ubuntu Mono&quot; :foundry &quot;DAMA&quot; :slant normal :weight normal :height 241 :width normal))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The font is still not changed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tried solution from @ManuelUberti, still doesn't work for me. And I also notice when I open &lt;code&gt;emacs&lt;/code&gt;, screen has a quick flash which looks like the font is changed (bigger), but some how it seems changed back to default. &lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="4102" LastEditDate="2016-06-20T11:34:07.230" LastActivityDate="2016-10-19T17:26:58.353" Title="Can't change font" Tags="|fonts|" AnswerCount="3" CommentCount="2" ClosedDate="2016-10-19T17:57:33.770" ContentLicense="CC BY-SA 3.0" />
  <row Id="24049" PostTypeId="2" ParentId="24048" CreationDate="2016-06-19T09:09:47.563" Score="0" Body="&lt;p&gt;I build Emacs from sources too, but this also works on Emacs installed using the package manager on Fedora 23:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'default nil&#xA;                    :family &quot;Source Code Pro&quot;&#xA;                    :height 130)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5514" LastEditorUserId="5514" LastEditDate="2016-06-19T09:14:49.017" LastActivityDate="2016-06-19T09:14:49.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24050" PostTypeId="1" AcceptedAnswerId="27939" CreationDate="2016-06-19T11:20:20.927" Score="5" ViewCount="565" Body="&lt;p&gt;For some reason (which I can't understand, I did not change anything) emacs has become very slow - as in 2 min - at startup. I traced it down to the &lt;code&gt;require&lt;/code&gt; commands of ESS. This is what I have in the &lt;code&gt;.init&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-path (cons &quot;/usr/share/emacs/site-lisp/ess&quot; load-path))&#xA;(require 'ess-site)&#xA;(require 'ess-smart-underscore)&#xA;(setq ess-default-style 'DEFAULT)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ess-smart-underscore&lt;/code&gt; also loads &lt;code&gt;ess-site&lt;/code&gt; so eliminating the first &lt;code&gt;require&lt;/code&gt; does not change anything. From &lt;a href=&quot;https://emacs.stackexchange.com/questions/13885/ess-startup-is-very-slow/&quot;&gt;this question&lt;/a&gt; I tried to use &lt;code&gt;eval-after-load&lt;/code&gt;, but this does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'ess-smart-underscore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In general, I don't care to have ESS loading at startup. I'd be happy if it only loads when I open *.R or *.r files, but I'd like a reasonable startup time.&#xA;I am running emacs 24.5.1 and ESS 16.04 on Linux. Downgrading to the previous versions of either did not make a difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have now commented everything in &lt;code&gt;.emacs&lt;/code&gt; except for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-path (cons &quot;/usr/share/emacs/site-lisp/ess&quot; load-path))&#xA;(require 'ess-site)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I have reinstalled emacs, ESS, R and updated all the R packages: no difference. I noticed, however, that the first time emacs is launched it is a little bit faster then the following times, which seems odd to me.&lt;/p&gt;&#xA;" OwnerUserId="11232" LastEditorUserId="11232" LastEditDate="2016-06-22T09:01:35.273" LastActivityDate="2016-10-19T15:20:16.540" Title="Why is ESS causing my emacs to start so slowly?" Tags="|init-file|ess|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24051" PostTypeId="2" ParentId="24030" CreationDate="2016-06-19T13:03:44.030" Score="22" Body="&lt;p&gt;Magit doesn't support &lt;code&gt;git rm&lt;/code&gt;. Instead, delete the folder in dired, and then stage the change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;kbd&gt;!&lt;/kbd&gt; to launch any git command.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="306" LastEditDate="2016-08-01T22:52:59.570" LastActivityDate="2016-08-01T22:52:59.570" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24052" PostTypeId="2" ParentId="24047" CreationDate="2016-06-19T13:35:59.857" Score="4" Body="&lt;p&gt;Somewhat inspired by &lt;code&gt;org-table-transpose-table-at-point&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-table-strip-table-at-point ()&#xA;  (interactive)&#xA;  (let* ((table (delete 'hline (org-table-to-lisp)))&#xA;     (contents (orgtbl-to-generic&#xA;            table '(:sep &quot;\t&quot;))))&#xA;    (goto-char (org-table-begin))&#xA;    (re-search-forward &quot;|&quot;)&#xA;    (backward-char)&#xA;    (delete-region (point) (org-table-end))&#xA;    (insert contents)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2016-06-19T13:52:44.877" LastActivityDate="2016-06-19T13:52:44.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24053" PostTypeId="1" AcceptedAnswerId="24076" CreationDate="2016-06-19T15:05:41.223" Score="0" ViewCount="551" Body="&lt;p&gt;I've been switching my .emacs.d to load packages via package.el instead of using gitsubmodules but I'm unable to install magit because emacs-24.4 isn't available. Getting the emacs version gives me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -version   &#xA;GNU Emacs 24.5.1&#xA;Copyright (C) 2015 Free Software Foundation, Inc.&#xA;GNU Emacs comes with ABSOLUTELY NO WARRANTY.&#xA;You may redistribute copies of Emacs&#xA;under the terms of the GNU General Public License.&#xA;For more information about these matters, see the file named COPYING.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there anything I can do to work around this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Doing (package-install 'magit) in the scratch buffer gives me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Package `emacs-24.4' is unavailable&quot;)&#xA;  signal(error (&quot;Package `emacs-24.4' is unavailable&quot;))&#xA;  error(&quot;Package `%s-%s' is unavailable&quot; &quot;emacs&quot; &quot;24.4&quot;)&#xA;  (if pkg-desc nil (error &quot;Package `%s-%s' is unavailable&quot; (symbol-name next-pkg) (package-version-join next-version)))&#xA;  (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond ((eq hold nil) (error &quot;Required package '%s' is disabled&quot; (symbol-name next-pkg))) ((null (stringp hold)) (error &quot;Invalid element in `package-load-list'&quot;)) ((version-list-&amp;lt; (version-to-list hold) next-version) (error &quot;Package `%s' held at version %s, but version %s required&quot; (symbol-name next-pkg) hold (package-version-join next-version)))))) (if pkg-desc nil (error &quot;Package `%s-%s' is unavailable&quot; (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-&amp;lt;= next-version (package-desc-vers (cdr pkg-desc))) nil (error &quot;Need package `%s-%s', but only %s is available&quot; (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers (cdr pkg-desc))))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc)))))&#xA;  (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond ((eq hold nil) (error &quot;Required package '%s' is disabled&quot; (symbol-name next-pkg))) ((null (stringp hold)) (error &quot;Invalid element in `package-load-list'&quot;)) ((version-list-&amp;lt; (version-to-list hold) next-version) (error &quot;Package `%s' held at version %s, but version %s required&quot; (symbol-name next-pkg) hold (package-version-join next-version)))))) (if pkg-desc nil (error &quot;Package `%s-%s' is unavailable&quot; (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-&amp;lt;= next-version (package-desc-vers (cdr pkg-desc))) nil (error &quot;Need package `%s-%s', but only %s is available&quot; (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers (cdr pkg-desc))))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc))))))&#xA;  (let* ((next-pkg (car elt)) (next-version (cadr elt))) (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond ((eq hold nil) (error &quot;Required package '%s' is disabled&quot; ...)) ((null ...) (error &quot;Invalid element in `package-load-list'&quot;)) ((version-list-&amp;lt; ... next-version) (error &quot;Package `%s' held at version %s, but version %s required&quot; ... hold ...))))) (if pkg-desc nil (error &quot;Package `%s-%s' is unavailable&quot; (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-&amp;lt;= next-version (package-desc-vers (cdr pkg-desc))) nil (error &quot;Need package `%s-%s', but only %s is available&quot; (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers (cdr pkg-desc))))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc)))))))&#xA;  (while --dolist-tail-- (setq elt (car --dolist-tail--)) (let* ((next-pkg (car elt)) (next-version (cadr elt))) (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold (cadr hold)) (cond (... ...) (... ...) (... ...)))) (if pkg-desc nil (error &quot;Package `%s-%s' is unavailable&quot; (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-&amp;lt;= next-version (package-desc-vers (cdr pkg-desc))) nil (error &quot;Need package `%s-%s', but only %s is available&quot; (symbol-name next-pkg) (package-version-join next-version) (package-version-join (package-desc-vers ...)))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs (cdr pkg-desc))))))) (setq --dolist-tail-- (cdr --dolist-tail--)))&#xA;  (let ((--dolist-tail-- requirements) elt) (while --dolist-tail-- (setq elt (car --dolist-tail--)) (let* ((next-pkg (car elt)) (next-version (cadr elt))) (if (package-installed-p next-pkg next-version) nil (let ((pkg-desc (assq next-pkg package-archive-contents)) hold) (if (setq hold (assq next-pkg package-load-list)) (progn (setq hold ...) (cond ... ... ...))) (if pkg-desc nil (error &quot;Package `%s-%s' is unavailable&quot; (symbol-name next-pkg) (package-version-join next-version))) (if (version-list-&amp;lt;= next-version (package-desc-vers ...)) nil (error &quot;Need package `%s-%s', but only %s is available&quot; (symbol-name next-pkg) (package-version-join next-version) (package-version-join ...))) (if (memq next-pkg package-list) nil (setq package-list (cons next-pkg package-list))) (setq package-list (package-compute-transaction package-list (package-desc-reqs ...)))))) (setq --dolist-tail-- (cdr --dolist-tail--))))&#xA;  package-compute-transaction((magit) ((emacs (24 4)) (async (1 5)) (dash (2 12 1)) (with-editor (2 5 1)) (git-commit (2 6 2)) (magit-popup (2 6 2))))&#xA;  (package-download-transaction (package-compute-transaction (list name) (package-desc-reqs (cdr pkg-desc))))&#xA;  (let ((pkg-desc (assq name package-archive-contents))) (if pkg-desc nil (error &quot;Package `%s' is not available for installation&quot; (symbol-name name))) (package-download-transaction (package-compute-transaction (list name) (package-desc-reqs (cdr pkg-desc)))))&#xA;  package-install(magit)&#xA;  eval((package-install (quote magit)) nil)&#xA;  eval-last-sexp-1(t)&#xA;  eval-last-sexp(t)&#xA;  eval-print-last-sexp(nil)&#xA;  call-interactively(eval-print-last-sexp nil nil)&#xA;  command-execute(eval-print-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8664" LastEditorUserId="8664" LastEditDate="2016-06-19T22:25:10.203" LastActivityDate="2016-06-20T20:32:42.060" Title="Unable to install magit via package.el" Tags="|package|magit|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24054" PostTypeId="1" CreationDate="2016-06-19T16:38:53.683" Score="1" ViewCount="95" Body="&lt;p&gt;What's the name of that feature that auto indent the code when I press tab (Even fi the indentation is more to the right, the tab &quot;erases&quot; the abundany spaces) and how can I change the size of it?&lt;/p&gt;&#xA;" OwnerUserId="8958" LastActivityDate="2016-06-20T13:24:04.357" Title="What's the name of the auto indent code?" Tags="|indentation|automation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24055" PostTypeId="2" ParentId="24025" CreationDate="2016-06-19T17:07:49.990" Score="6" Body="&lt;p&gt;The single quote (&lt;code&gt;'&lt;/code&gt;) tells lisp not to evaluate(run) the thing, but to leave it as is. When you write &lt;code&gt;'((concat org-directory &quot;/gtd_work.org&quot;) …)&lt;/code&gt; it tells it &lt;em&gt;not&lt;/em&gt; to actually run the concat function, but instead leave the word &quot;concat&quot; in there. When you removed the &lt;code&gt;'&lt;/code&gt; it didn't work either because it didn't know that you wanted all those things put into a list. The good news is that it's easy to make them into a list: the function name is &lt;code&gt;list&lt;/code&gt; so you replace &lt;code&gt;'(…)&lt;/code&gt; with &lt;code&gt;(list …)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try changing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files&#xA;         '((concat org-directory &quot;/gtd_work.org&quot;)&#xA;           (concat org-directory &quot;/gtd_proging.org&quot;)&#xA;           (concat org-directory &quot;/gtd_home.org&quot;)&#xA;           (concat org-directory &quot;/DailyRoutine.org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-files&#xA;         (list&#xA;           (concat org-directory &quot;/gtd_work.org&quot;)&#xA;           (concat org-directory &quot;/gtd_proging.org&quot;)&#xA;           (concat org-directory &quot;/gtd_home.org&quot;)&#xA;           (concat org-directory &quot;/DailyRoutine.org&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-06-19T17:07:49.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24056" PostTypeId="1" AcceptedAnswerId="24057" CreationDate="2016-06-19T19:34:17.550" Score="1" ViewCount="302" Body="&lt;p&gt;I have the following macro&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro test-macro (arg)&#xA;  `(defun (intern (concat &quot;test-func-called&quot; ,arg)) ()&#xA;     (message &quot;I do nothing&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call to this macro&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(test-macro &quot;test&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It gives me the following error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: symbolp, (intern (concat &quot;test-func-called&quot; &quot;test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluating the following gives me &lt;code&gt;t&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbolp (intern (concat &quot;test-func-called&quot; &quot;test&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10263" LastEditorUserId="105" LastEditDate="2016-06-19T23:51:49.993" LastActivityDate="2016-06-19T23:51:49.993" Title="Weird behavior of defmacro and intern - symbolp error" Tags="|elisp-macros|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24057" PostTypeId="2" ParentId="24056" CreationDate="2016-06-19T20:00:57.180" Score="5" Body="&lt;p&gt;The way you test macros is with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Expansion.html&quot;&gt;&lt;code&gt;macroexpand&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(macroexpand-1 '(test-macro &quot;test&quot;))&#xA;==&amp;gt; (defun (intern (concat &quot;test-func-called&quot; &quot;test&quot;)) nil (message &quot;I do nothing&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This makes the error obvious: the function &lt;code&gt;intern&lt;/code&gt; should be called at&#xA;macroexpansion time, not at evaluation time (since &lt;code&gt;defun&lt;/code&gt; does not&#xA;evaluate its first argument).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the fix is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro test-macro (arg)&#xA;  `(defun ,(intern (concat &quot;test-func-called&quot; arg)) ()&#xA;     (message &quot;I do nothing&quot;)))&#xA;(macroexpand-1 '(test-macro &quot;test&quot;))&#xA;==&amp;gt; (defun test-func-calledtest nil (message &quot;I do nothing&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-06-19T20:00:57.180" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24058" PostTypeId="1" CreationDate="2016-06-19T21:33:32.237" Score="2" ViewCount="232" Body="&lt;p&gt;I get the following error when trying to clock into the agenda buffer. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;byte-code: Before first headline at position 406 in buffer *Org Agenda*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doesn't matter the location in the agenda buffer.  If I go to the org file &lt;code&gt;org-clock-in&lt;/code&gt; works fine.  Org clock out works fine from the agenda-buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This feature was working before just fine, I didn't add any new packages, or change my init file before it started, but I tried generating the agenda file off two different org files and see the same thing.&lt;/p&gt;&#xA;" OwnerUserId="11414" LastEditorUserId="675" LastEditDate="2016-06-20T05:10:02.170" LastActivityDate="2017-01-29T07:37:12.540" Title="Error when trying to clock in agenda buffer" Tags="|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24059" PostTypeId="1" CreationDate="2016-06-19T22:22:35.657" Score="1" ViewCount="202" Body="&lt;p&gt;I often got to work with projects organized as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;src/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;include/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Makefile&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to teach emacs' &quot;compile&quot; function to always use that top-level Makefile regardless which file I'm editing in the current buffer? For example it can be any of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;src/sub1/s1.c&lt;/p&gt;&#xA;&#xA;&lt;p&gt;include/protocol/p.h&lt;/p&gt;&#xA;&#xA;&lt;p&gt;src/x.c&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tests/test1/test_x.c&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In all those cases I want &quot;compile&quot; command to go as many times &quot;up&quot; in hierarchy as necessary to get into top-level directory (the one in the directory with 'src', 'include' and 'tests' entries) and run Makefile in there. Additional problem is that any of sub directories can have Makefiles of its own.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2016-06-19T22:22:35.657" Title="Smarter compile in emacs" Tags="|compilation|c|compilation-mode|ide|makefile-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24060" PostTypeId="1" AcceptedAnswerId="24062" CreationDate="2016-06-19T23:27:53.847" Score="4" ViewCount="1194" Body="&lt;p&gt;I have a yasnippet that is intended to create a footnote in org-mode format and automatically insert the contents of the clipboard.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: footnote&#xA;# key: fn &#xA;# --&#xA;[fn:: `(clipboard-yank)`]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This worked correctly until this week. Desired output is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[fn:: foo]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now when I do it, it truncates the contents and adds a Y, such that when the clipboard contains &lt;code&gt;foo&lt;/code&gt;, entering &lt;code&gt;fn &amp;lt;TAB&amp;gt;&lt;/code&gt; results in this output: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[fn:: ooY]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;UPDATE/CLARIFICATION&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;My yasnippet for org-mode footnotes actually uses not &lt;code&gt;clipboard-yank&lt;/code&gt; but my own custom function &lt;a href=&quot;https://github.com/incandescentman/Emacs-Settings/blob/master/gnu-emacs-startup.org#pasteboard-paste-no-spaces&quot; rel=&quot;nofollow&quot;&gt;pasteboard-paste-no-spaces&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: footnote&#xA;# key: fn &#xA;# --&#xA;[fn:: `(pasteboard-paste-no-spaces)`]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For simplicity, I mentioned &lt;code&gt;clipboard-yank&lt;/code&gt; since I tested it and it has the same problem. But since I use a custom function, switching to &lt;code&gt;current-kill&lt;/code&gt; won't work for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's &lt;code&gt;pasteboard-paste-no-spaces&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pasteboard-paste-no-spaces ()&#xA;  &quot;Paste from OS X system pasteboard via `pbpaste' to point.&quot;&#xA;  (interactive)&#xA;  (let ((start (point))&#xA;    (end (if mark-active&#xA;         (mark)&#xA;           (point))))&#xA;    (shell-command-on-region start end&#xA;                 &quot;pbpaste | perl -p -e 's/\r$//' | tr '\r' '\n'&quot;&#xA;                 nil t)&#xA;    (save-excursion&#xA;      )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;UPDATE #2&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Thanks for all the help. I'm having the same problem with &lt;a href=&quot;https://github.com/abo-abo/tiny/blob/master/tiny.el&quot; rel=&quot;nofollow&quot;&gt;tiny-expand&lt;/a&gt;. I tried using the &lt;code&gt;(with-temp-buffer)&lt;/code&gt; approach you suggested to create a new function &lt;code&gt;yas/tiny-expand&lt;/code&gt;, but it doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yas/tiny-expand (&amp;amp;rest args)&#xA; &quot;Return the string that `tiny-expand' would insert.&quot;&#xA; (with-temp-buffer&#xA; (apply #'tiny-expand args) &#xA; (buffer-string))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the relevant yasnippet where I tried to use &lt;code&gt;(with-temp-buffer)&lt;/code&gt;: &lt;a href=&quot;https://gist.github.com/5a799834ddf948ce65a7def95a834401&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/5a799834ddf948ce65a7def95a834401&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the original version:&#xA;&lt;a href=&quot;https://gist.github.com/1c947de20a1b7790d04d69ac39884f22&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/1c947de20a1b7790d04d69ac39884f22&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2016-06-20T18:06:02.027" LastActivityDate="2016-06-21T20:03:35.663" Title="yasnippet truncates clipboard contents" Tags="|org-mode|yasnippet|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24061" PostTypeId="1" CreationDate="2016-06-19T23:37:09.117" Score="2" ViewCount="70" Body="&lt;p&gt;There's &lt;a href=&quot;https://specifications.freedesktop.org/basedir-spec/latest/&quot; rel=&quot;nofollow&quot;&gt;freedesktop.org spec for config placement&lt;/a&gt;.&#xA;Most of the software adheres to it placing config files into &lt;code&gt;~/.config&lt;/code&gt;, cache files into &lt;code&gt;~/.cache&lt;/code&gt; etc. This greatly simplifies backups, config management etc. One of the few unfortunate exceptions is Emacs. Is there a way to force it to behave properly?&lt;/p&gt;&#xA;" OwnerUserId="9660" LastEditorUserId="25" LastEditDate="2016-07-25T07:35:55.680" LastActivityDate="2016-12-03T22:20:56.730" Title="Is there a way to make emacs adhere to fdo spec?" Tags="|init-file|configuration-files|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24062" PostTypeId="2" ParentId="24060" CreationDate="2016-06-20T00:03:24.027" Score="5" Body="&lt;p&gt;You should use &lt;code&gt;current-kill&lt;/code&gt; instead of &lt;code&gt;clipboard-yank&lt;/code&gt; because the latter works by side-effect.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: footnote&#xA;# key: fn &#xA;# --&#xA;[fn:: `(current-kill 0)`]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'm actually not using &lt;code&gt;clipboard-yank&lt;/code&gt; but my own custom function &lt;code&gt;pasteboard-paste-no-spaces&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You would need to modify your custom function to return a string value instead of inserting it directly, something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun pasteboard-without-spaces ()&#xA;  &quot;Return content of OS X system pasteboard via `pbpaste'.&quot;&#xA;  (shell-command-to-string &quot;pbpaste | perl -p -e 's/\r$//' | tr '\r' '\n'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I seem to be getting the same error with [...] &lt;code&gt;org-insert-time-stamp&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That function is more problematic since it weaves together inserting the string with generating it.  You can run it in a temp buffer to make it behave better:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yas/org-get-time-stamp (&amp;amp;rest args)&#xA;  &quot;Return the string that `org-insert-time-stamp' would insert.&quot;&#xA;  (with-temp-buffer&#xA;    (apply #'org-insert-time-stamp args)&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can apply this trick to any function that inserts content directly to the buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'm having the same problem with &lt;a href=&quot;https://github.com/abo-abo/tiny/blob/master/tiny.el&quot; rel=&quot;nofollow&quot;&gt;tiny-expand&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This functions also wants to read and delete other text in the buffer, to make it safe the text should be passed as a string instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun yas/tiny-expand (str)&#xA;  (with-temp-buffer&#xA;    (insert str)&#xA;    (goto-char (point-max)) ; tiny-expand works on text preceding point&#xA;    (tiny-expand)&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: jdw&#xA;# key: jdw&#xA;# --&#xA;&#xA;* week of `(yas/org-get-time-stamp (current-time))` [0%] &#xA;*** WEEKLIES - week of `(yas/org-get-time-stamp (current-time))` &#xA;***** TODO review weeklies&#xA;***** TODO $0&#xA;&#xA;*** DAILIES - week of `(yas/org-get-time-stamp (current-time))` &#xA;`(yas/tiny-expand &quot;m0\\n9|\\n***** COMMITTED &amp;lt;%(date \&quot;today\&quot; x)&amp;gt; [0%%]\\n******* TODO wake up 8:30am\\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 8:30am&amp;gt;\\n******* TODO blue light \\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 8:31am&amp;gt;\\n******* TODO meditate \\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 8:45am&amp;gt;\\n******* TODO write Wise Mind form or LIFE form\\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 9:00am&amp;gt; \\n******* TODO disable Internet\\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 9:15am&amp;gt; \\n******* TODO morning pages at a café or at The Writers' Room \\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 9:45am&amp;gt;\\n******* TODO go straight to The Writers' Room\\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 10:00am&amp;gt;\\n******* TODO review weeklies and calibrate with dailies \\n******* TODO submit dailies to Erika \\n DEADLINE: &amp;lt;%(date \&quot;today\&quot; x) 2:00pm&amp;gt; \\n******* TODO work on book 3 hours \\n******* TODO two lines of poetry \\n DEADLINE: &amp;lt;%(date \&quot;today\&quot; x) 8:00pm&amp;gt; \\n******* TODO lights out by 12:30am\\n SCHEDULED: &amp;lt;%(date \&quot;today\&quot; x) 11:59pm&amp;gt; \\n\\n&quot;)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the string param needs to be escaped for the Lisp reader (an easy way to do this quickly is to use &lt;code&gt;paredit-doublequote&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you don't feel like changing all your snippets right now, the latest release, 0.10.0 (available from MELPA stable and GNU ELPA), will work with your original snippet.  I plan to temporarily (i.e. at least until release 0.11.0) back out the change that breaks this and just issue a warning for snippets that do insertion by side-effect.  See also &lt;a href=&quot;https://github.com/joaotavora/yasnippet/issues/710&quot; rel=&quot;nofollow&quot;&gt;yasnippet issue #710&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2016-06-21T20:03:35.663" LastActivityDate="2016-06-21T20:03:35.663" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24063" PostTypeId="1" AcceptedAnswerId="24072" CreationDate="2016-06-20T05:21:59.450" Score="0" ViewCount="326" Body="&lt;p&gt;I saw a neat demo of the spacemacs layout feature:&#xA;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bwindow-management/spacemacs-layouts&quot; rel=&quot;nofollow noreferrer&quot;&gt;demo of the spacemacs layout feature&lt;/a&gt;, and &lt;a href=&quot;https://i.imgur.com/X5nYdlY.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;another one&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What package do they use to do that or another similar vanilla emacs package?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-06-20T13:17:51.430" LastActivityDate="2016-10-18T18:21:10.927" Title="what backend package does spacemacs use for layout managment?" Tags="|package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24064" PostTypeId="1" CreationDate="2016-06-20T06:45:38.307" Score="3" ViewCount="205" Body="&lt;p&gt;When Caps Lock is on, typing commands may bring surprising results, because the capital letters are used instead of what has been intended. In some modes it leads to deleting large chunks of texts, and is very irritating. On my keyboard caps lock is larger than any modifier key on the left (not sure what for).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are ways to rebound Caps Lock, but is there a way to ignore it only in the commands? If not, what is the best way to disable the influence of Caps Lock? Maybe, there is some way to re-use on-key LED, as a bonus?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Ubuntu Linux, if that matters.&lt;/p&gt;&#xA;" OwnerUserId="11466" LastActivityDate="2016-06-20T06:45:38.307" Title="How to ignore Caps Lock state for keyboard shortcuts?" Tags="|key-bindings|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24065" PostTypeId="2" ParentId="23931" CreationDate="2016-06-20T07:47:29.697" Score="5" Body="&lt;p&gt;Since Magit can't find my .gitconfig file even though it is in the &lt;code&gt;HOME&lt;/code&gt; path of Emacs, &lt;code&gt;git config --system&lt;/code&gt; can be used to change user name and email such that Magit can find them.&lt;/p&gt;&#xA;" OwnerUserId="12358" LastEditorUserId="12358" LastEditDate="2016-06-20T08:41:44.177" LastActivityDate="2016-06-20T08:41:44.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24066" PostTypeId="2" ParentId="22423" CreationDate="2016-06-20T09:10:47.177" Score="2" Body="&lt;p&gt;I use this setting to make yasnippet snippets behave like &lt;code&gt;org-paste-subtree&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my--yas-expand-org-snippet (orig content &amp;amp;optional start end expand-env)&#xA;;;  (require 'cl)&#xA;  (if (eq major-mode 'org-mode)&#xA;    (flet ((insert (content)&#xA;                   (org-paste-subtree nil content)))&#xA;      (funcall orig content start end expand-env))&#xA;    (funcall orig content start end expand-env)&#xA;    )&#xA;  )&#xA;(advice-add 'yas-expand-snippet :around 'my--yas-expand-org-snippet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-06-20T09:10:47.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24067" PostTypeId="1" AcceptedAnswerId="24069" CreationDate="2016-06-20T11:31:42.047" Score="2" ViewCount="648" Body="&lt;p&gt;I want to chnage input method by &lt;code&gt;M-x ru&lt;/code&gt;.&#xA;But I couldn't figure out how to alias a function with argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'ru '(set-input-method russian-computer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I alias a function with argument?&lt;/p&gt;&#xA;" OwnerUserId="10106" LastActivityDate="2016-06-20T12:14:51.357" Title="How to alias a function with argument by defalias" Tags="|input-method|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24068" PostTypeId="2" ParentId="16907" CreationDate="2016-06-20T11:54:28.277" Score="4" Body="&lt;p&gt;org-contacts has one format for birthdays &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;BDAY:%04d-%02d-%02d,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which means 4 digits of year dash two digits of month dash two digits to day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can suggest to edit the format of the anniversary agenda entry. By default the format is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Birthday: %l (%Y),&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where %l - Link to the heading and %Y - Number of year (ordinal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can put random year in the contact's birthday and edit line 110 in file &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/lisp/org-contacts.el;hb=HEAD&quot; rel=&quot;nofollow&quot;&gt;org-contacts&lt;/a&gt;: remove (%Y) and result will be &lt;strong&gt;Birthday: Contact Name&lt;/strong&gt; without years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way than org-contacts described in comments.&lt;/p&gt;&#xA;" OwnerUserId="10375" LastEditorUserId="10375" LastEditDate="2016-06-20T11:59:33.243" LastActivityDate="2016-06-20T11:59:33.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24069" PostTypeId="2" ParentId="24067" CreationDate="2016-06-20T12:14:51.357" Score="2" Body="&lt;p&gt;&lt;code&gt;defalias&lt;/code&gt; creates named aliases for &lt;em&gt;functions&lt;/em&gt;, so you must start with a function before you can create an alias for it; and you are starting with a &lt;em&gt;call&lt;/em&gt; to a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you could write a function which does what you want, and then create an alias to that function. You can even use an anonymous function, in order to avoid creating two names when you only wanted one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'ru (lambda ()&#xA;                &quot;Use the russian-computer input method.&quot;&#xA;                (interactive)&#xA;                (set-input-method 'russian-computer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However that is the same thing as this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ru ()&#xA;  &quot;Use the russian-computer input method.&quot;&#xA;  (interactive)&#xA;  (set-input-method 'russian-computer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is what I suggest you actually use.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-06-20T12:14:51.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24070" PostTypeId="2" ParentId="24054" CreationDate="2016-06-20T13:24:04.357" Score="1" Body="&lt;p&gt;As said in comments, the behaviour of &lt;em&gt;tab&lt;/em&gt; changes often depending on the mode you are using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you read more how the indentation works in Emacs in the &lt;a href=&quot;https://www.emacswiki.org/emacs/IndentationBasics&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Main variables are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;c-basic-offset&lt;/strong&gt;: The basic indentation offset in CC Mode, default is 2. For Perl, it is controlled by &lt;em&gt;cperl-indent-level.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;tab-width&lt;/strong&gt;: How wide a tab is, default is 8.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8563" LastActivityDate="2016-06-20T13:24:04.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24072" PostTypeId="2" ParentId="24063" CreationDate="2016-06-20T16:49:12.453" Score="0" Body="&lt;p&gt;The backend is &lt;a href=&quot;https://github.com/Bad-ptr/persp-mode.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;persp-mode.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-06-20T16:52:30.570" LastActivityDate="2016-06-20T16:52:30.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24073" PostTypeId="1" AcceptedAnswerId="24153" CreationDate="2016-06-20T17:41:13.007" Score="0" ViewCount="1393" Body="&lt;p&gt;What are the keystrokes for page up &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In Mac OS X, &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In Ubuntu installed in Virtualbox in Mac OS X?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;both alt-V and command-V don't perform page-up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running emacs in a terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2016-06-20T19:54:57.980" LastActivityDate="2016-06-23T19:59:26.677" Title="Page up in Mac OS X and in Ubuntu under Virtualbox in Mac OS X?" Tags="|key-bindings|osx|ubuntu|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24074" PostTypeId="2" ParentId="24073" CreationDate="2016-06-20T20:14:48.380" Score="1" Body="&lt;p&gt;You can ask emacs this question directly. Use &lt;code&gt;C-h f scroll-up-command RET&lt;/code&gt; to open the help for this function; it'll say also what key or keys it's bound to. It's probably &lt;code&gt;C-v&lt;/code&gt; and &lt;code&gt;&amp;lt;next&amp;gt;&lt;/code&gt; (useful should you have a keyboard with a 'next' key).&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-06-20T20:14:48.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24075" PostTypeId="1" CreationDate="2016-06-20T20:24:34.647" Score="1" ViewCount="29" Body="&lt;p&gt;I'm occasionally writing fanfiction-stories as plain-text files in emacs.  It would be great if emacs could add a &quot;header-section&quot; in the beginning of these documents, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;Title:&#xA;Author:&#xA;Chapter:&#xA;Series:&#xA;Rating:&#xA;Email:&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some fields - like Author and Email - could obviously be pre-filled...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;How could something like this be accomplished in emacs?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be the best way of doing it?  Would it be an idea to make a new major-mode - based on text-mode - called fanfic?  Or perhaps a new minor-mode (called fanfic) to be used with the text-major-mode?  A major/minor-mode could perhaps also set-up a few other things - like fly-spell-mode, auto-fill-mode and a suitable page-width...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completeness, I'd like to know how such a standard header could be added for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;All new files created with emacs (just curious...)&lt;/li&gt;&#xA;&lt;li&gt;All files of a certain type - eg. all &lt;em&gt;.txt-files.  (I guess it could be bound to the file-type (&lt;/em&gt;.txt) and/or the text-mode in emacs)&lt;/li&gt;&#xA;&lt;li&gt;Files created with a customized major/minor-mode&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've used emacs for a several years, but haven't really dived into customization or elisp much...  (why mess with perfection?  ;-)&lt;/p&gt;&#xA;" OwnerUserId="5248" LastEditorUserId="253" LastEditDate="2016-06-20T23:22:59.680" LastActivityDate="2016-06-20T23:22:59.680" Title="Including a header-section to text-file?" Tags="|file-header|" AnswerCount="0" CommentCount="2" ClosedDate="2016-06-21T03:20:12.313" ContentLicense="CC BY-SA 3.0" />
  <row Id="24076" PostTypeId="2" ParentId="24053" CreationDate="2016-06-20T20:32:42.060" Score="2" Body="&lt;p&gt;Turns out that I had an old version of package.el in my path which I was loading. Removing that load means I can now install magit fine!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moral of the story: Make sure you're not including the old versions of core code in your init.el!&lt;/p&gt;&#xA;" OwnerUserId="8664" LastActivityDate="2016-06-20T20:32:42.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24077" PostTypeId="1" AcceptedAnswerId="24188" CreationDate="2016-06-20T22:25:19.993" Score="2" ViewCount="343" Body="&lt;p&gt;I have several Javascript projects, where some projects use 2 spaces for indentation and other projects use 4 spaces for indentation. Is there a project-specific way to set the indentation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to manually resolve this issue for each project by running &lt;code&gt;(js2-basic-offset 2)&lt;/code&gt; or &lt;code&gt;(js2-basic-offset 4)&lt;/code&gt;, but can I configure this setting on a per-project basis? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps there is a dot-file that I can add to my project's root folder where I can configure settings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use js2-mode with tern-js if that helps. And for the record, I love it! But I would love to be able to customize this minor detail.&lt;/p&gt;&#xA;" OwnerUserId="2676" LastEditorUserId="2676" LastEditDate="2016-06-21T07:18:09.837" LastActivityDate="2016-06-26T17:57:29.177" Title="How to set project-specific javscript indentation using js2-mode" Tags="|formatting|js2-mode|tern|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24078" PostTypeId="2" ParentId="23762" CreationDate="2016-06-20T23:04:32.490" Score="1" Body="&lt;p&gt;It looks like I will have to export my org file as an HTML buffer, then export my org file to latex, then run bibtex, latex, and latex2html, then open the html file and copy the paragraphs with in text citations over to the html buffer.  I was trying to automate that process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like I will just need to export to html then go through and edit the HTML by hand and remove the [author] citations and replace them with the correct in-text citations, each time I export the file to HTML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless there is an upgrade to ox-bibtex that allows for it to export the \citet and \citep \citeauthor \citeyear, etc. citations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to make this any more clear.  ox-bibtex reads only \cite{key} citations and exports them all as &quot;[author]&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;latex2html generates the correct in-text citations but I lose some html content I put in the org file when I export it to latex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to extract the in-text citations from the latex2html html file and put them in the html file exported from my org file.&lt;/p&gt;&#xA;" OwnerUserId="12170" LastActivityDate="2016-06-20T23:04:32.490" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24079" PostTypeId="2" ParentId="15224" CreationDate="2016-06-21T01:44:45.103" Score="6" Body="&lt;p&gt;The bi-directional text support introduced in Emacs 24 interacts badly with term.el when large numbers of spaces or tabs are inserted, and many applications clear the screen (often drawing a new background colour) by writing WIDTHxHEIGHT spaces (which, if the terminal’s dimensions are sufficiently large, may take several seconds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The workaround is to prevent Emacs from guessing the text direction in term-mode, and simply enforce a left-to-right direction:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Terminal buffer configuration.&#xA;(add-hook 'term-mode-hook 'my-term-mode-hook)&#xA;(defun my-term-mode-hook ()&#xA;  ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20611&#xA;  (setq bidi-paragraph-direction 'left-to-right))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This workaround is enabled by default in &lt;code&gt;term-mode&lt;/code&gt; for Emacs 25.1 (and current pre-releases thereof), so manually configuring &lt;code&gt;term-mode-hook&lt;/code&gt; should only be necessary for Emacs 24.x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The root of the problem has been fixed in the Emacs master branch (such that the workaround is not needed at all). That fix should be included in either Emacs 25.2 or 25.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also updated &lt;a href=&quot;https://www.emacswiki.org/emacs/AnsiTermHints&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/AnsiTermHints&lt;/a&gt; with the same information.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;For the sake of searchability, here are the names of the applications I'm aware of which trigger this problem. These are mostly (if not all) curses- or ncurses-based -- presumably this method of screen refresh is a commonly-used curses function -- and so it is highly probable that many other curses applications will do the same thing.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;alsamixer&lt;/li&gt;&#xA;&lt;li&gt;dialog&lt;/li&gt;&#xA;&lt;li&gt;dpkg-reconfigure&lt;/li&gt;&#xA;&lt;li&gt;lynx&lt;/li&gt;&#xA;&lt;li&gt;mc (midnight commander)&lt;/li&gt;&#xA;&lt;li&gt;mutt&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-26T21:41:35.900" LastActivityDate="2016-06-26T21:41:35.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24080" PostTypeId="1" CreationDate="2016-06-21T05:21:55.367" Score="3" ViewCount="278" Body="&lt;p&gt;I'm trying to make a 'speedbar' layer that uses projectile-speedbar. The problem is projectile-speedbar won't compile unless sr-speedbar has already been compiled. Since spacemakes compiles the packages in alphabetical order, it tries to compile projectile-speedbar first and I get an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a packages.el for my layer in .emacs.d/private/speedbar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar speedbar-packages '(sr-speedbar projectile-speedbar))&#xA;&#xA;(defun speedbar/init-sr-speedbar ()&#xA;  (use-package sr-speedbar))&#xA;&#xA;(defun speedbar/init-projectile-speedbar ()&#xA;  (use-package projectile-speedbar&#xA;    :config (spacemacs/set-leader-keys&#xA;              &quot;ft&quot; 'projectile-speedbar-toggle)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to set this layer up so the sr-speedbar dependency is compiled first?&lt;/p&gt;&#xA;" OwnerUserId="12113" LastActivityDate="2016-06-21T06:49:11.627" Title="Spacemacs layer where package order matters" Tags="|package|spacemacs|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24081" PostTypeId="2" ParentId="24040" CreationDate="2016-06-21T05:45:40.480" Score="10" Body="&lt;p&gt;Take a look at &lt;code&gt;(info &quot;(org) LaTeX specific attributes&quot;)&lt;/code&gt;. The following table attributes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+attr_latex: :mode math :environment matrix&#xA;| a | b |&#xA;| c | d |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will export a LaTeX matrix in math mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-tex prettyprint-override&quot;&gt;&lt;code&gt;\[&#xA;\begin{matrix}&#xA; a &amp;amp; b \\&#xA; c &amp;amp; d \\&#xA;\end{matrix}&#xA;\]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-06-21T05:45:40.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24084" PostTypeId="2" ParentId="21723" CreationDate="2016-06-21T08:16:34.747" Score="-1" Body="&lt;p&gt;You should set &lt;code&gt;mu4e-sent-messages-behavior&lt;/code&gt; to the desired value (from the docs):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* `sent'    move the sent message to the Sent-folder (`mu4e-sent-folder')&#xA;* `trash'   move the sent message to the Trash-folder (`mu4e-trash-folder')&#xA;* `delete'  delete the sent message.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You probably want to do &lt;code&gt;(setq mu4e-sent-messages-behavior 'sent)&lt;/code&gt;, unless you use Gmail, in which case you want &lt;code&gt;'delete&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12439" LastActivityDate="2016-06-21T08:16:34.747" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24085" PostTypeId="1" CreationDate="2016-06-21T08:24:10.807" Score="3" ViewCount="1644" Body="&lt;p&gt;I would like to type source code comments of the form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{-                                                                                                                                                                                   &#xA; - Hello World                                                                                                                                                                       &#xA; -                                                                                                                                                                                   &#xA; - This program prints &quot;Hello World&quot;.                                                                                                                                                &#xA; -}  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where I would like emacs to automatically insert the leading &lt;code&gt;-&lt;/code&gt; for each line. Is there any way to teach emacs to do this?&lt;/p&gt;&#xA;" OwnerUserId="12440" LastActivityDate="2017-05-18T08:53:18.153" Title="How to get emacs to automatically insert block comment prefixes?" Tags="|comment|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24088" PostTypeId="1" AcceptedAnswerId="24091" CreationDate="2016-06-21T11:56:50.690" Score="12" ViewCount="4748" Body="&lt;p&gt;How could I make an interactive function to toggle in between two color themes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I have been able to find there is no variable set to what color theme is currently in use, in fact several can be loaded simultaneously?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in order to toggle you would need to first do &lt;code&gt;disable-theme&lt;/code&gt; for the currently loaded theme, to not make themes clash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to do that without knowing which theme is currently loaded?&lt;/p&gt;&#xA;" OwnerUserId="12446" LastActivityDate="2022-10-18T19:01:55.727" Title="Make a function to toggle themes" Tags="|themes|" AnswerCount="9" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24089" PostTypeId="2" ParentId="22232" CreationDate="2016-06-21T12:20:58.073" Score="1" Body="&lt;p&gt;You can use the following commands to create such kind of org files&#xA;for a given directory: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-dir-to-org (dir org-file)&#xA;  &quot;Create a file ORG-FILE which has all txt files in DIR as linked headlines&#xA;and the contents of the files below the headlines.&quot;&#xA;  (interactive &quot;DDirectory to convert: \nFFilename: &quot;)&#xA;  (let ((files (directory-files&#xA;                dir t &quot;.*\\.txt\\'&quot;)))                     &#xA;    (with-temp-file org-file&#xA;      (dolist (file files)&#xA;        (insert (concat &quot;* &quot; &quot;[[&quot; file &quot;][&quot; (file-name-nondirectory file) &quot;]]\n\n&quot;))&#xA;        (insert-file-contents file)&#xA;        (goto-char (point-max))&#xA;        (insert &quot;\n&quot;)))))&#xA;&#xA;(defun my-mass-conversion (source-dir target-dir)&#xA;  &quot;Create one org file per directory of SOURCE-DIR inside TARGET-DIR.&quot;&#xA;  (interactive &quot;DDirectory to convert: \nDTarget Directory:&quot;)&#xA;  (let ((dirs-full&#xA;         (remove-if-not #'file-directory-p&#xA;                        (directory-files&#xA;                         source-dir t&#xA;                         directory-files-no-dot-files-regexp))))&#xA;&#xA;    (mapc (lambda (dir)&#xA;            (my-dir-to-org dir&#xA;                           (concat target-dir&#xA;                                   (file-name-base dir) &quot;.org&quot;)))&#xA;          dirs-full)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2016-06-21T12:39:30.893" LastActivityDate="2016-06-21T12:39:30.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24090" PostTypeId="1" CreationDate="2016-06-21T12:29:13.327" Score="3" ViewCount="607" Body="&lt;p&gt;I have many latex snippets delimited by &lt;code&gt;$&lt;/code&gt; inside my org notes. I recently discovered &lt;code&gt;org-highlight-latex-and-related&lt;/code&gt;, which highlights latex snippets a certain face. However, I want to also apply the specially subscript/superscript faces, which shift the face up and diminish the size, as this helps distinguish things visually. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2207" LastActivityDate="2018-12-12T13:03:25.753" Title="How to fully fontify latex snippets including subscript and superscript within org-mode" Tags="|latex|font-lock|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24091" PostTypeId="2" ParentId="24088" CreationDate="2016-06-21T14:07:17.510" Score="6" Body="&lt;p&gt;I have made it but I switch 3 themes (My own kosmos, leuven and default)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check &lt;a href=&quot;https://github.com/habamax/.emacs.d/blob/master/lisp/haba-appearance.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/habamax/.emacs.d/blob/master/lisp/haba-appearance.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;excerpt from it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *haba-theme-dark* 'kosmos)&#xA;(defvar *haba-theme-light* 'leuven)&#xA;(defvar *haba-current-theme* *haba-theme-dark*)&#xA;&#xA;;; disable other themes before loading new one&#xA;(defadvice load-theme (before theme-dont-propagate activate)&#xA;  &quot;Disable theme before loading new one.&quot;&#xA;  (mapcar #'disable-theme custom-enabled-themes))&#xA;&#xA;&#xA;(defun haba/next-theme (theme)&#xA;  (if (eq theme 'default)&#xA;      (disable-theme *haba-current-theme*)&#xA;    (progn&#xA;      (load-theme theme t)))&#xA;  (setq *haba-current-theme* theme))&#xA;&#xA;(defun haba/toggle-theme ()&#xA;  (interactive)&#xA;  (cond ((eq *haba-current-theme* *haba-theme-dark*) (haba/next-theme *haba-theme-light*))&#xA;        ((eq *haba-current-theme* *haba-theme-light*) (haba/next-theme 'default))&#xA;        ((eq *haba-current-theme* 'default) (haba/next-theme *haba-theme-dark*))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then bind some key to haba/toggle-theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use emacs on 2 different machines and environments (day, late evening) so there is facility to save/restore current-theme on quit/load emacs. Which is handy :)&lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-06-21T14:07:17.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24093" PostTypeId="1" AcceptedAnswerId="24116" CreationDate="2016-06-21T18:51:33.407" Score="6" ViewCount="1343" Body="&lt;p&gt;I was playing around with my .emacs, and I cannot figure out why the following does not work with .tex files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'tex-mode-hook&#xA;  (lambda () &#xA;    (show-paren-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the following does work on elisp files.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook&#xA;  (lambda () &#xA;    (show-paren-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually, just having the elisp hook is sufficient to enable paren mode on .tex files. I'm not sure what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running 24.5.1 on OS X with auctex installed.&lt;/p&gt;&#xA;" OwnerUserId="9881" LastEditorUserId="9881" LastEditDate="2016-06-21T19:02:55.497" LastActivityDate="2016-06-22T14:48:06.850" Title="(la)tex-mode-hook doesn't work?" Tags="|hooks|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24094" PostTypeId="1" CreationDate="2016-06-21T21:00:43.853" Score="1" ViewCount="951" Body="&lt;p&gt;I'm seeing the following issue with emacs 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm confident there must be a workaround for this because I'm in the process of rewriting my emacs configuration, and my old, ugly configuration with the same version of emacs does not have this problem.  Still, while with some effort I've been able to create a minimal failing case (see below), I've not yet been able to create a minimal working case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody guess a workaround?  I suspect the problem is related to the fact that &lt;code&gt;monokai-theme&lt;/code&gt; configures the &lt;code&gt;whitespace-space&lt;/code&gt; face with some custom elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(By the way, I'd like to report this as a bug but I'm not sure if it's a &lt;code&gt;monokai-theme&lt;/code&gt; issue or an emacs issue: any pointers there?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;customize-face&lt;/code&gt; and &lt;code&gt;monokai-theme&lt;/code&gt; don't seem to be getting along for me with emacs 25:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; as quoted below and ensure no &lt;code&gt;~/.emacs&lt;/code&gt; exists&lt;/li&gt;&#xA;&lt;li&gt;Ensure &lt;code&gt;~/.emacs.d/custom-settings.el&lt;/code&gt; does not exist&lt;/li&gt;&#xA;&lt;li&gt;Start emacs (I'm using the daily emacs 25 snapshots from &lt;a href=&quot;https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa&quot; rel=&quot;nofollow&quot;&gt;https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa&lt;/a&gt; on ubuntu xenial)&lt;/li&gt;&#xA;&lt;li&gt;Open &lt;code&gt;init.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-face &amp;lt;RET&amp;gt; whitespace-space &amp;lt;RET&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Edit foreground colour and &quot;Save for future sessions&quot; (I had to edit the colour in &lt;code&gt;monokai-theme's&lt;/code&gt; lisp code to do this: that lisp code appears in the customize UI)&lt;/li&gt;&#xA;&lt;li&gt;All good in &lt;code&gt;custom-settings.el&lt;/code&gt;: my customization appears there&lt;/li&gt;&#xA;&lt;li&gt;Quit emacs&lt;/li&gt;&#xA;&lt;li&gt;Start emacs&lt;/li&gt;&#xA;&lt;li&gt;No errors in &lt;em&gt;Messages&lt;/em&gt; (and custom-settings.el is unchanged), but &lt;code&gt;whitespace-space&lt;/code&gt; text now looks the way it did before I customized it, so...&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-face &amp;lt;RET&amp;gt; whitespace-space &amp;lt;RET&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Edit foreground colour and &quot;Save for future sessions&quot; (this time, the foreground colour appears in the UI explicitly and the lisp code is gone)&lt;/li&gt;&#xA;&lt;li&gt;This time customize reports state &quot;THEMED&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;init.el&lt;/code&gt; buffer STILL lacks my customization&lt;/li&gt;&#xA;&lt;li&gt;On &quot;Save for future sessions&quot;, &lt;code&gt;custom-settings.el&lt;/code&gt; was reset to an empty state (and no I didn't hand edit it!)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;here is the &quot;empty state&quot; &lt;code&gt;custom-settings.el&lt;/code&gt; I refer to above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and here's the &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;(setq custom-file (concat user-emacs-directory &quot;custom-settings.el&quot;))&#xA;(load custom-file t)&#xA;(setq package-archives&#xA;      '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;        (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))&#xA;(package-initialize)&#xA;&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;(setq use-package-verbose t)&#xA;(setq use-package-always-ensure t)&#xA;(require 'use-package)&#xA;&#xA;(use-package monokai-theme)&#xA;&#xA;(use-package whitespace&#xA;  :init&#xA;  (global-whitespace-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2018-12-10T18:02:30.513" Title="customize-face and themes bug: workaround?" Tags="|themes|customize|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24095" PostTypeId="1" AcceptedAnswerId="24102" CreationDate="2016-06-21T21:13:41.067" Score="2" ViewCount="3090" Body="&lt;p&gt;I want to have .bashrc check to see if an emacs server is currently running, and if not, start one. I know how to start the server but I am not sure how to check whether it is already running - should I just grep the processes for Emacs? Curious if anyone has something like this set up.&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2016-06-24T22:14:20.090" Title="bashrc script to automatically create emacs server session on startup?" Tags="|server|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24096" PostTypeId="2" ParentId="24088" CreationDate="2016-06-21T21:24:32.337" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://bitbucket.org/apharris/emacs-init/src/befc11c29cd3d18355cfc140d8b3d74415c36b6f/multitheme.el?at=default&amp;amp;fileviewer=file-view-default&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; is the module I wrote for my own .emacs to solve this problem.  My basic approach seems to be similar in intent to Maxim Kim's solution (rotating through a list of themes), but I think mine is more modular and may therefore be more accessible to an outsider.  On the other hand, I don't have any of Kim's persistence features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the relevant code, leaving off variable declarations and package commentary:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(defun multitheme--enable (theme)&#xA;  &quot;As `enable-theme', but load the theme if necessary.&#xA;Respect `custom-safe-themes'.&quot;&#xA;  (if (custom-theme-p theme)&#xA;      (enable-theme theme)&#xA;    (load-theme theme)))&#xA;&#xA;(defun multitheme-cycle ()&#xA;  &quot;Cycle between the themes in `multitheme-base-theme-list'.&#xA;If none of these themes is currently active, instead enable the&#xA;first element of `multitheme-base-theme-list'.&#xA;&#xA;Also re-enable `multitheme-overtheme' so it remains \&quot;on top\&quot; of&#xA;the base theme.&#xA;&#xA;If a theme to be enabled is not yet defined, attempt to load it&#xA;first (using `load-theme').  Respect `custom-safe-themes'.&#xA;&#xA;After all theme changes have been made, run&#xA;`multitheme-base-change-hook'.&quot;&#xA;  (interactive)&#xA;  (when (require 'validate nil :noerror)&#xA;    (validate-variable 'multitheme-base-theme-list)&#xA;    (validate-variable 'multitheme-overtheme)&#xA;    (validate-variable 'multitheme-base-theme-change-hook))&#xA;  (let ((themes (-drop-while&#xA;                 (lambda (thm) (not (custom-theme-enabled-p thm)))&#xA;                 multitheme-base-theme-list)))&#xA;    ;; Cycle base theme&#xA;    (if (null themes)&#xA;        (multitheme--enable (car multitheme-base-theme-list))&#xA;      (disable-theme (car themes))&#xA;      (multitheme--enable (or (cadr themes)&#xA;                              (car multitheme-base-theme-list))))&#xA;    ;; Reassert overtheme&#xA;    (when multitheme-overtheme&#xA;      (multitheme--enable multitheme-overtheme))&#xA;    ;; Run hooks&#xA;    (run-hooks 'multitheme-base-theme-change-hook)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-06-21T21:24:32.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24097" PostTypeId="2" ParentId="24095" CreationDate="2016-06-21T22:44:26.233" Score="0" Body="&lt;p&gt;I recommend that you create a startup script, with the command &lt;code&gt;emacs --daemon&lt;/code&gt; at startup. Then there is no need to start Emacs server anymore. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsAsDaemon&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which Linux distro are you running? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-06-21T22:44:26.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24098" PostTypeId="2" ParentId="24085" CreationDate="2016-06-22T00:32:44.473" Score="0" Body="&lt;p&gt;This is only a quick hack, but it works well enough to show you how you might accomplish your goal. Hopefully the code is enough to get you started. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm guessing that you're new to Emacs, and I don't recognize the language comment style. So you might start by switching the suffixes in the example code below to the suffixes for the languages that you want the commenting action to work on.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar comment-prefix-start &quot;{- &quot;&#xA;  &quot;The start of the comment.&quot;)&#xA;&#xA;(defvar comment-prefix-continue &quot; - &quot;&#xA;  &quot;The continuation of the comment.&quot;)&#xA;&#xA;(defun my-return-key ()&#xA;  &quot;Return as usual, and then insert the comment-prefix.&quot;&#xA;  (interactive)&#xA;  (newline)&#xA;  (let (curpos (incomment nil))&#xA;    (cond &#xA;     ((equal &quot;.el&quot; (substring (buffer-name) -3))&#xA;      (save-excursion&#xA;        (forward-line -1)&#xA;        (goto-char (line-beginning-position))&#xA;        (if (or (looking-at comment-prefix-start)&#xA;                (looking-at comment-prefix-continue))&#xA;            (setq incomment t)))&#xA;      (if incomment&#xA;          (insert comment-prefix-continue)))&#xA;&#xA;     ;; repeat that block of code for other languages&#xA;&#xA;     )))&#xA;&#xA;(global-set-key (kbd &quot;C-m&quot;) 'my-return-key)&#xA;&#xA;;; Test this in the *scratch* buffer by pasting this code.&#xA;;; Start a comment the normal way, and&#xA;;; including the trailing spaces, if any.&#xA;;; Type return to see a new prefix inserted.&#xA;;;&#xA;;; To stop entering prefixes, backspace to remove a trailing&#xA;;; space, so emacs is not &quot;looking-at&quot; a full prefix string.&#xA;;;&#xA;;; Put this code into your Emacs startup file, or into a &#xA;;; separate file, and load that file, to load it each time.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-06-22T00:40:41.077" LastActivityDate="2016-06-22T00:40:41.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24099" PostTypeId="1" CreationDate="2016-06-22T01:01:29.977" Score="3" ViewCount="333" Body="&lt;p&gt;Is it there any way to yank in the search command (after press &quot;/&quot;) in evil-mode?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="105" LastEditDate="2016-06-22T15:51:14.373" LastActivityDate="2016-07-22T15:53:57.743" Title="How to yank text to search command (after &quot;/&quot;) in evil-mode?" Tags="|evil|search|yank|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24100" PostTypeId="2" ParentId="24099" CreationDate="2016-06-22T02:49:50.860" Score="1" Body="&lt;pre&gt;&lt;code&gt;(defadvice evil-search-forward (after evil-search-forward-after-hack activate)&#xA;  (if (and isearch-string&#xA;           (&amp;gt; (length isearch-string) 0)&#xA;           (not (string= isearch-string (format &quot;%s&quot; (car kill-ring)))))&#xA;           (kill-new isearch-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, the regex is also automatically inserted into &lt;code&gt;evil-search-forward-history&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-06-22T03:10:29.970" LastActivityDate="2016-06-22T03:10:29.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24101" PostTypeId="1" AcceptedAnswerId="24125" CreationDate="2016-06-22T03:55:32.673" Score="3" ViewCount="1178" Body="&lt;p&gt;for some reason i cant bind space in evil mode and get an error. all other keys work well. any clue? this is the bind that dosent seem to work&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;&amp;lt;SPC&amp;gt;&quot; 'hydra-leader/body)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is the error i get when launching emacs: &#xA;&lt;code&gt;Error (use-package): evil :config: Key sequence &amp;lt; S P C &amp;gt; starts with non-prefix key &amp;lt;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11387" LastEditDate="2016-06-22T06:44:49.550" LastActivityDate="2016-06-22T17:17:46.477" Title="Cant bind &lt;SPC&gt; in evil mode?" Tags="|evil|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24102" PostTypeId="2" ParentId="24095" CreationDate="2016-06-22T07:41:11.373" Score="9" Body="&lt;p&gt;The functionality is built into Emacs. Run &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Invoking-emacsclient.html#Invoking-emacsclient&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;emacsclient&lt;/code&gt;&lt;/a&gt; and pass it the &lt;code&gt;-a&lt;/code&gt; (long form &lt;code&gt;--alternate-editor&lt;/code&gt;) option with an empty argument, and it'll start Emacs (in daemon mode, i.e. initially without any window) if it isn't already running.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -a ''                    # in sh syntax&#xA;emacsclient --alternate-editor=      # anywhere whitespace-separated command and arguments work&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you always use this command to open files, Set the &lt;code&gt;EDITOR&lt;/code&gt; and &lt;code&gt;VISUAL&lt;/code&gt; environment variables to it in your &lt;code&gt;~/.profile&lt;/code&gt; or &lt;code&gt;~/.bash_profile&lt;/code&gt; or &lt;code&gt;~/.zprofile&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export VISUAL='emacsclient --alternate-editor='&#xA;export EDITOR='emacsclient --alternate-editor='&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and make an alias for it in your &lt;code&gt;~/.bashrc&lt;/code&gt; or &lt;code&gt;~/.zshrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias e='emacsclient --alternate-editor='&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add the option &lt;code&gt;-c&lt;/code&gt; if you want to open a new Emacs window to edit the file. With &lt;code&gt;emacsclient -c&lt;/code&gt;, if you don't pass a file name argument, you get a new Emacs window showing whatever buffer is at the front of the buffer list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, run &lt;code&gt;emacs --daemon&lt;/code&gt; as part of your session startup and use plain &lt;code&gt;emacsclient&lt;/code&gt; to open files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;~/.bashrc&lt;/code&gt; runs every time you open a terminal, not when you log in. On normal Unix systems, the file that runs when you log in is &lt;code&gt;~/.profile&lt;/code&gt; (or &lt;code&gt;~/.bash_profile&lt;/code&gt;, &lt;code&gt;~/.profile&lt;/code&gt;, etc. depending on your login shell), but &lt;a href=&quot;https://apple.stackexchange.com/questions/3030/how-can-i-run-stop-relaunch-an-application-automatically-at-boot-login-some-oth&quot;&gt;OSX does things differently&lt;/a&gt; (and actually runs &lt;code&gt;~/.bash_profile&lt;/code&gt; or &lt;code&gt;~/.profile&lt;/code&gt; and not &lt;code&gt;~/.bashrc&lt;/code&gt; when you open a terminal due to a combination of bad design in OSX and bad design in bash: OSX opens a login shell in each terminal and bash doesn't load &lt;code&gt;.bashrc&lt;/code&gt; in login shells — see &lt;a href=&quot;https://unix.stackexchange.com/questions/110998/missing-source-bashrc-mac-terminal-profile&quot;&gt;https://unix.stackexchange.com/questions/110998/missing-source-bashrc-mac-terminal-profile&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:30.630" LastActivityDate="2016-06-24T22:14:20.090" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24104" PostTypeId="1" AcceptedAnswerId="24109" CreationDate="2016-06-22T08:26:54.043" Score="1" ViewCount="92" Body="&lt;p&gt;What should I type in replace-regexp command to change the first list below into the second? I'd like to repeat each number at the beginning of line. To achieve that, I assume that I'll have to refer to each regexp match when I type what I'd like to replace each of them with, but how can I do that?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* apple&#xA;12&#xA;* banana&#xA;5&#xA;* grape&#xA;5&#xA;* watermelon&#xA;3&#xA;&#xA;&#xA;&#xA;* apple&#xA;12 12&#xA;* banana&#xA;5 5&#xA;* grape&#xA;5 5&#xA;* watermelon&#xA;3 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-06-22T09:45:59.393" Title="Using reference in replace-regexp" Tags="|regular-expressions|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24105" PostTypeId="1" AcceptedAnswerId="24111" CreationDate="2016-06-22T08:30:25.837" Score="3" ViewCount="1904" Body="&lt;p&gt;I am trying out &lt;a href=&quot;https://www.emacswiki.org/emacs/Evil&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;evil-mode&lt;/code&gt;&lt;/a&gt;, and it seems promising. Now I would like to get an overview of the keybindings introduced in &lt;code&gt;evil-normal-state-map&lt;/code&gt;. If I type &lt;code&gt;C-h v RET evil-normal-state-map&lt;/code&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Value: (keymap&#xA; (164 . evil-end-of-line)&#xA; (mouse-2 . mouse-yank-primary)&#xA; (18 . redo)&#xA; (117 . undo)&#xA; (remap keymap&#xA;        (yank-pop . evil-paste-pop)&#xA;        (cua-paste-pop . evil-paste-pop))&#xA; (escape . evil-force-normal-state)&#xA; (127 . evil-backward-char)&#xA; (90 keymap&#xA;     (81 . evil-quit)&#xA;     (90 . evil-save-modified-and-close))&#xA; (62 . evil-shift-right)&#xA; (60 . evil-shift-left)&#xA; (61 . evil-indent)&#xA; (126 . evil-invert-char)&#xA; (34 . evil-use-register)&#xA; (64 . evil-execute-macro)&#xA; (46 . evil-repeat)&#xA; (27 keymap&#xA;     (46 . evil-repeat-pop-next))&#xA; (67108910 . evil-repeat-pop)&#xA; (20 . pop-tag-mark)&#xA; (16 . evil-paste-pop)&#xA; (14 . evil-paste-pop-next)&#xA; (122 keymap&#xA;      (61 . ispell-word)&#xA;      (109 . evil-close-folds)&#xA;      (114 . evil-open-folds)&#xA;      (97 . evil-toggle-fold)&#xA;      (99 . evil-close-fold)&#xA;      (79 . evil-open-fold-rec)&#xA;      (111 . evil-open-fold))&#xA; (103 keymap&#xA;      (44 . goto-last-change-reverse)&#xA;      (59 . goto-last-change)&#xA;      (126 . evil-invert-case)&#xA;      (63 . evil-rot13)&#xA;      (70 . evil-find-file-at-point-with-line)&#xA;      (102 . find-file-at-point)&#xA;      (85 . evil-upcase)&#xA;      (117 . evil-downcase)&#xA;      (119 . evil-fill)&#xA;      (113 . evil-fill-and-move)&#xA;      (74 . evil-join-whitespace)&#xA;      (105 . evil-insert-resume)&#xA;      (97 . what-cursor-position)&#xA;      (56 . what-cursor-position)&#xA;      (38 . evil-ex-repeat-global-substitute))&#xA; (38 . evil-ex-repeat-substitute)&#xA; (89 . evil-yank-line)&#xA; (121 . evil-yank)&#xA; (deletechar . evil-delete-char)&#xA; (88 . evil-delete-backward-char)&#xA; (120 . evil-delete-char)&#xA; (83 . evil-change-whole-line)&#xA; (115 . evil-substitute)&#xA; (82 . evil-replace-state)&#xA; (114 . evil-replace)&#xA; (113 . evil-record-macro)&#xA; (80 . evil-paste-before)&#xA; (112 . evil-paste-after)&#xA; (79 . evil-open-above)&#xA; (111 . evil-open-below)&#xA; (109 . evil-set-marker)&#xA; (74 . evil-join)&#xA; (73 . evil-insert-line)&#xA; (insertchar . evil-insert)&#xA; (insert . evil-insert)&#xA; (105 . evil-insert)&#xA; (68 . evil-delete-line)&#xA; (100 . evil-delete)&#xA; (67 . evil-change-line)&#xA; (99 . evil-change)&#xA; (65 . evil-append-line)&#xA; (97 . evil-append))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I transform this into human-readable form? It would be nice if I could have the table in the format given by &lt;code&gt;describe-mode&lt;/code&gt;, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;key             binding&#xA;---             -------&#xA;&#xA;C-c             Prefix Command&#xA;C-d             elisp-edebug&#xA;  (that binding is currently shadowed by another mode)&#xA;ESC             Prefix Command&#xA;DEL             backward-delete-char-untabify&#xA;&#xA;....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2019-10-04T12:36:13.013" Title="How to list keybinding for a particular keymap (evil-mode)?" Tags="|evil|keymap|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24106" PostTypeId="2" ParentId="23828" CreationDate="2016-06-22T08:38:33.363" Score="1" Body="&lt;p&gt;If those are URLs you would put in the location bar at the top of a browser window, then they represent an implied &lt;code&gt;&quot;http://&quot;&lt;/code&gt; (or possibly &lt;code&gt;&quot;https://&quot;&lt;/code&gt;) protocol prefix. Try making that prefix explicit in the Org link. Is it correctly clickable now?&lt;/p&gt;&#xA;" OwnerUserId="12184" LastEditorUserId="105" LastEditDate="2016-06-22T13:53:21.017" LastActivityDate="2016-06-22T13:53:21.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24107" PostTypeId="1" AcceptedAnswerId="24108" CreationDate="2016-06-22T08:41:30.803" Score="4" ViewCount="1212" Body="&lt;p&gt;I am improving the C++ highlighting in Emacs with the minor mode: &lt;a href=&quot;https://github.com/ludwigpacifici/modern-cpp-font-lock&quot; rel=&quot;nofollow&quot;&gt;modern-cpp-font-lock&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider this following C++14 code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main() { int i = 1'2'3l; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://en.cppreference.com/w/cpp/language/integer_literal&quot; rel=&quot;nofollow&quot;&gt;cppreference.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Optional single quotes(') may be inserted between the digits as a&#xA;  separator. They are ignored by the compiler.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In modern-cpp-font-lock, I set &lt;code&gt;1'2'3&lt;/code&gt; to &lt;code&gt;font-lock-constant-face&lt;/code&gt; and I set the integer suffix &lt;code&gt;l&lt;/code&gt; to &lt;code&gt;font-lock-keyword-face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;fundamental-mode&lt;/code&gt; and &lt;code&gt;modern-c++-font-lock-mode&lt;/code&gt; activated, I see the expected result. However, with &lt;code&gt;c++-mode&lt;/code&gt; and &lt;code&gt;modern-c++-font-lock-mode&lt;/code&gt; activated, &lt;code&gt;'2'&lt;/code&gt; is highlighted as a string (&lt;code&gt;l&lt;/code&gt; is correctly font locked).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the highlighting rely on the principle &quot;first come first served&quot; - meaning rules will not apply on words already highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know if it is possible to override font-lock of a major mode? Or is it possible to change the order of rules to apply the font-lock (for example, longer rules first)?&lt;/p&gt;&#xA;" OwnerDisplayName="user12181" LastEditorUserId="897" LastEditDate="2016-06-22T15:26:40.000" LastActivityDate="2017-08-19T08:15:07.427" Title="Override c++-mode font lock" Tags="|font-lock|syntax-highlighting|c++|cc-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24108" PostTypeId="2" ParentId="24107" CreationDate="2016-06-22T09:10:30.350" Score="3" Body="&lt;p&gt;Font-lock use two phases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The syntactic phase. In this phase, Emacs determines things like strings and comments.&lt;/li&gt;&#xA;&lt;li&gt;The keyword phase, i.e. the normal font-lock rules.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to make Emacs ignore single quotes in digits, you have to do this in the first phase. Effectively, you will have to supply a custom &lt;code&gt;syntax-propertize-function&lt;/code&gt;, which should set a suitable &lt;code&gt;syntax-table&lt;/code&gt; text property on the quote character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.lunaryorn.com/2014/06/16/advanced-syntactic-fontification.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; on how to do this. Link broken, &lt;a href=&quot;https://web.archive.org/web/20150627183737/https://www.lunaryorn.com/2014/06/16/advanced-syntactic-fontification.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;archived version&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just remember that if you install your own syntax-propertize-function in a minor mode, you still have to ensure that the original function is executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I've noticed that there is some work being done on modern C++ on the Emacs master branch, maybe this has already been handled there.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="2418" LastEditDate="2017-08-19T08:15:07.427" LastActivityDate="2017-08-19T08:15:07.427" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24109" PostTypeId="2" ParentId="24104" CreationDate="2016-06-22T09:45:59.393" Score="1" Body="&lt;p&gt;Replace (i.e. &lt;code&gt;M-x query-replace-regexp&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^\([[:digit:]]+\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\1 \1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;viola. You can look up &lt;a href=&quot;https://www.emacswiki.org/emacs/RegularExpression&quot; rel=&quot;nofollow&quot;&gt;this decent reference&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12439" LastActivityDate="2016-06-22T09:45:59.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24111" PostTypeId="2" ParentId="24105" CreationDate="2016-06-22T10:06:43.837" Score="4" Body="&lt;p&gt;I don't know of any way to do this in vanilla Emacs without effective writing your own code, but the function &lt;code&gt;describe-keymap&lt;/code&gt; (&lt;code&gt;C-h M-k&lt;/code&gt;) in the &lt;a href=&quot;https://www.emacswiki.org/emacs/HelpPlus&quot; rel=&quot;noreferrer&quot;&gt;help-fns+.el&lt;/a&gt; package does exactly this.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;describe-keymap&lt;/code&gt; (&lt;code&gt;C-h M-k&lt;/code&gt;) – Describe the bindings in a keymap. Enter the keymap variable (e.g., &lt;code&gt;ctl-x-map&lt;/code&gt;) using completion. (Non-interactively, the argument can be a keymap itself or a keymap variable.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12439" LastActivityDate="2016-06-22T10:06:43.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24112" PostTypeId="1" CreationDate="2016-06-22T11:43:36.163" Score="0" ViewCount="26" Body="&lt;p&gt;How can I kill a buffer when closing a frame only if that's the only frame showing that buffer?  Is there a way to check if the buffer in the selected frame is not in any other frame?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-06-22T11:43:36.163" Title="Kill buffer when closing a frame only if that's the only frame showing that buffer?" Tags="|buffers|" AnswerCount="0" CommentCount="3" ClosedDate="2016-06-22T14:09:24.873" ContentLicense="CC BY-SA 3.0" />
  <row Id="24113" PostTypeId="1" AcceptedAnswerId="24132" CreationDate="2016-06-22T13:59:57.313" Score="1" ViewCount="689" Body="&lt;p&gt;I'd like to change the way org-links behave on clicking only when it's a text file etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. I'd like to have org-links opens up a new frame with the buffer of the link in it only when it's the link of a .txt, .el, or .png file. I already found &lt;a href=&quot;https://stackoverflow.com/questions/8881649/how-to-force-org-mode-to-open-a-link-in-another-frame&quot;&gt;a snippet below&lt;/a&gt; that basically does this, but I can't figure out how to assign this command to the left click so that it runs the command only when it's on org-links. How can I do that?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun zin/org-open-other-frame ()&#xA;  &quot;Jump to bookmark in another frame. See `bookmark-jump' for more.&quot;&#xA;  (interactive)&#xA;  (let ((org-link-frame-setup (acons 'file 'find-file-other-frame org-link-frame-setup)))&#xA;    (org-open-at-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-06-23T08:39:57.130" Title="Changing the way org-links behave on clicking only when it's a text file" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24115" PostTypeId="1" AcceptedAnswerId="24126" CreationDate="2016-06-22T14:27:08.707" Score="0" ViewCount="744" Body="&lt;p&gt;I have an file which is a research paper (&lt;a href=&quot;https://github.com/a-fent/microsim-ipf/tree/master/paper&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;); it contains numerous R blocks which produce tables and figures. Since these share common data and preliminary calculations, they are run as a org-babel session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, some of these tables and figures are reasonably time-consuming (a few seconds each), such that export becomes a somewhat lengthy proposition. A lot of the time at the end I am not changing the figures at all, just making minor amendments and corrections to the text, yet each re-render still takes a long time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Caching is what I would seem to want, but the &lt;a href=&quot;http://orgmode.org/manual/cache.html&quot; rel=&quot;nofollow&quot;&gt;org mode manual address this specifically&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that the :cache header argument will not attempt to cache results when the :session header argument is used, because the results of the code block execution may be stored in the session outside of the Org mode buffer. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question is - what does the second half of this sentence mean? Is this &quot;may be stored&quot; as in &quot;might be stored&quot; (so babel shouldn't) or as in &quot;can be stored&quot; (so babel needn't). Does anyone know if there's a technical org-internal reason that caching &lt;em&gt;won't&lt;/em&gt; work with session?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And above all - any solutions to caching long-ish R operations when using org-babel? And ideally, without writing a lot of unnatural code in the R blocks. I already do some thigns like &lt;code&gt;if ( ! exists(foo) ) foo &amp;lt;- read.delim(...)&lt;/code&gt; to avoid repeating the longest data-loading operations but this can be a bit error prone and muddies the R code.&lt;/p&gt;&#xA;" OwnerUserId="9716" LastActivityDate="2016-06-22T17:58:32.213" Title="Org babel caching for R when using session" Tags="|org-mode|org-babel|r|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24116" PostTypeId="2" ParentId="24093" CreationDate="2016-06-22T14:48:06.850" Score="8" Body="&lt;p&gt;If you have AUCTeX installed, then you're presumably using AUCTeX's modes, so the hooks you need to use have names of the form &lt;code&gt;TeX-mode-hook&lt;/code&gt; and &lt;code&gt;LaTeX-mode-hook&lt;/code&gt; (note the capitalization).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-06-22T14:48:06.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24117" PostTypeId="1" AcceptedAnswerId="24122" CreationDate="2016-06-22T15:30:37.680" Score="7" ViewCount="698" Body="&lt;p&gt;I'm trying to write a piece of code that runs a single ERT test programmatically. In the ERT manual, they show an example that creates a test body and then runs the body, like so:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(ert-deftest ert-test-record-backtrace ()&#xA;   (let ((test (make-ert-test :body (lambda () (ert-fail &quot;foo&quot;)))))&#xA;    (let ((result (ert-run-test test)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But... &lt;code&gt;(ert-run-test&lt;/code&gt; won't work with a normal &lt;code&gt;ert-deftest&lt;/code&gt; name such as the one shown above, &lt;code&gt;ert-test-record-backtrace&lt;/code&gt;. If I try doing that I see an error &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(ert-run-test 'ert-test-record-backtrace)&#xA;Debugger entered--Lisp error: (wrong-type-argument arrayp my-deftest)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code &lt;code&gt;(ert-run-tests-interactively)&lt;/code&gt; runs the usual ERT function that prompts for tests in the minibuffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I run one or more ERT tests programmatically? Is it even possible? I'm working on this kind of syntax right now, but it is not working. I think I need to extract the function body value of &lt;code&gt;my-deftest&lt;/code&gt;, but I don't know how to do that yet.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(ert-run-test (make-ert-test :body my-deftest))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Update: I tried to put my whole test function inside the &lt;code&gt;make-ert-test&lt;/code&gt; format shown in the example above, and was able to run the test. Not pretty code, because of the indenting. And the result was in square brackets, which I don't understand yet. But I can see the &lt;code&gt;value: t&lt;/code&gt; in there that I would like to extract. So I'm getting closer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq result&#xA;  (ert-run-test&#xA;   (make-ert-test :body&#xA;                  (lambda ()&#xA;                    ;; my ert test code here&#xA;                    (should (equal tcoll output))&#xA;                    ))))&#xA;&#xA;[cl-struct-ert-test-passed &quot;&quot; (((should ...) :form (equal ... ...) :value t :explanation nil))]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After more experimentation to dig the answer out of the &lt;code&gt;result&lt;/code&gt; returned (it was an array), here is the code that gets me to the &lt;code&gt;t&lt;/code&gt; that I could see.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq data (aref result 2))&#xA;(((should (equal tcoll output)) :form (equal ...)) :value t :explanation nil))&#xA;(nth 4 (car data))&#xA;t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, but it seems like a brute force approach because I have to copy my &lt;code&gt;ert-deftest&lt;/code&gt; code into a separate &lt;code&gt;lambda&lt;/code&gt; function as shown above. &lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-06-22T16:21:43.550" LastActivityDate="2017-09-18T22:31:33.307" Title="run a single ERT test programmatically" Tags="|ert|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24118" PostTypeId="2" ParentId="3359" CreationDate="2016-06-22T16:07:35.870" Score="1" Body="&lt;p&gt;You probably want to follow the tutorial &lt;a href=&quot;http://tuhdo.github.io/c-ide.html#sec-2&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and setup &lt;code&gt;company-clang&lt;/code&gt; to get better candidates.&lt;/p&gt;&#xA;" OwnerUserId="6859" LastActivityDate="2016-06-22T16:07:35.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24119" PostTypeId="2" ParentId="24117" CreationDate="2016-06-22T16:10:58.203" Score="5" Body="&lt;p&gt;You can try &lt;code&gt;ert-run-tests-batch&lt;/code&gt;, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-run-tests-batch 'ert-test-record-backtrace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the results are not returned as a value, but rather via messages in &lt;code&gt;*Messages*&lt;/code&gt; (or on stdout).  Otherwise, you can use &lt;code&gt;ert-run-tests&lt;/code&gt; which is a bit more complex to use because you need to provide a listener function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-run-tests 'ert-test-record-backtrace&#xA;               (lambda (event &amp;amp;rest args)&#xA;                 (message &quot;Test event %S: %S&quot; event args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-09-18T22:31:33.307" LastActivityDate="2017-09-18T22:31:33.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24120" PostTypeId="2" ParentId="18556" CreationDate="2016-06-22T16:14:15.043" Score="2" Body="&lt;p&gt;No, &lt;code&gt;ispell&lt;/code&gt; just works in batch mode AFAICT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend using the built-in &lt;code&gt;flyspell&lt;/code&gt;.  This will give you on-the-fly feedback and provide commands like &lt;code&gt;flyspell-check-next-higlighted-word&lt;/code&gt; and &lt;code&gt;flyspell-check-previous-highlighted-word&lt;/code&gt; to jump around.&lt;/p&gt;&#xA;" OwnerUserId="6859" LastActivityDate="2016-06-22T16:14:15.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24121" PostTypeId="2" ParentId="19157" CreationDate="2016-06-22T16:16:17.867" Score="1" Body="&lt;p&gt;While unused lexical bindings are already detected byte the byte compiler there's unfortunately no way to detect &lt;code&gt;defconst&lt;/code&gt; and &lt;code&gt;defvars&lt;/code&gt; that are unused (except manual use of &lt;code&gt;grep&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="6859" LastActivityDate="2016-06-22T16:16:17.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24122" PostTypeId="2" ParentId="24117" CreationDate="2016-06-22T16:18:37.470" Score="4" Body="&lt;p&gt;Let's use the example from the ERT manual:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(ert-deftest ert-test-record-backtrace ()&#xA;  (let ((test (make-ert-test :body (lambda () (ert-pass &quot;foo&quot;)))))&#xA;    (let ((result (ert-run-test test)))&#xA;      (should (ert-test-failed-p result)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The test should pass obviously. A list of symbols naming an ert-test object will be returned with&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(apropos-internal &quot;&quot; #'ert-test-boundp) ;⇒ (ert-test-record-backtrace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And finally show the number of available tests that passed as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(ert--stats-passed-expected (ert-run-tests 't (lambda (&amp;amp;rest args)))) ;⇒ 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The listener in &lt;code&gt;ert-run-tests&lt;/code&gt; may be an arbitrary function called for side-effects.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-06-22T16:18:37.470" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24123" PostTypeId="2" ParentId="13608" CreationDate="2016-06-22T16:43:30.397" Score="1" Body="&lt;p&gt;The problem is that &lt;code&gt;newline-and-indent&lt;/code&gt; (the function that &lt;code&gt;C-j&lt;/code&gt; is bound to) inserts a literal newline then whatever would be inserted by &lt;code&gt;TAB&lt;/code&gt;. What you want is to send the current input:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun send-input-and-indent ()&#xA;  (interactive)&#xA;  (comint-send-input)&#xA;  (indent-for-tab-command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, bind &lt;code&gt;send-input-and-indent&lt;/code&gt; to &lt;code&gt;C-j&lt;/code&gt; only when in inferior-python-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key inferior-python-mode-map (kbd &quot;C-j&quot;) 'send-input-and-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put both snippets in your initialization file and you're good to go.&lt;/p&gt;&#xA;" OwnerUserId="12451" LastEditorUserId="675" LastEditDate="2016-06-22T18:17:05.603" LastActivityDate="2016-06-22T18:17:05.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24124" PostTypeId="1" CreationDate="2016-06-22T17:12:39.250" Score="0" ViewCount="130" Body="&lt;p&gt;I can not figure out how to change current line bg in ranger - I'm unable to find customize group for that, is that possible at all? Maybe its inherited from other dired face, can somebody point me out to that face if its so? Thx.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-06-22T17:12:39.250" Title="How to change ranger current line face?" Tags="|dired|customize|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24125" PostTypeId="2" ParentId="24101" CreationDate="2016-06-22T17:17:46.477" Score="3" Body="&lt;p&gt;The error code shows that emacs believes you want to map a sequence of 3 keys (&lt;code&gt;S&lt;/code&gt; &lt;code&gt;P&lt;/code&gt; &lt;code&gt;C&lt;/code&gt;), the first one being &lt;code&gt;S&lt;/code&gt;, but it can't do that since &lt;code&gt;S&lt;/code&gt; is already used by itself (i.e. not a prefix key).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use either &lt;code&gt;(kbd &quot;SPC&quot;)&lt;/code&gt;, &lt;code&gt;[space]&lt;/code&gt; or simply &lt;code&gt;&quot; &quot;&lt;/code&gt; instead. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define-key evil-normal-state-map (kbd &quot;SPC&quot;) 'hydra-leader/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the right key syntax, see for example the &quot;How to find key syntax&quot; question at &lt;a href=&quot;http://ergoemacs.org/emacs/keyboard_shortcuts.html&quot; rel=&quot;nofollow&quot;&gt;this Xah tutorial page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(basically, use &lt;code&gt;C-h k&lt;/code&gt; with the key or key combination you want, in order to see how the output is formatted).&lt;/p&gt;&#xA;" OwnerUserId="8708" LastActivityDate="2016-06-22T17:17:46.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24126" PostTypeId="2" ParentId="24115" CreationDate="2016-06-22T17:58:32.213" Score="1" Body="&lt;p&gt;It means that side-effects may exist from a previous code block(s) evaluated that alter the results of the next evaluation. Consider this code in Python (because I'm not familiar with R):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: one&#xA;#+BEGIN_SRC python :session&#xA;  list = some_other_list_class&#xA;#+END_SRC&#xA;&#xA;#+name: two&#xA;#+BEGIN_SRC python :session&#xA;  list(foo)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result of &lt;code&gt;two&lt;/code&gt; will depend on whether or not &lt;code&gt;one&lt;/code&gt; was run in the same session; therefore simple caching doesn't give the whole story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two work-arounds I can think of:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Pass every variable explicitly&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Anytime you'd use a variable, create a named source block that just has that value, and use those as a &lt;code&gt;:var&lt;/code&gt; reference&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: one&#xA;#+BEGIN_SRC python&#xA;  range(3)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: one&#xA;| 0 | 1 | 2 |&#xA;&#xA;#+name: two&#xA;#+BEGIN_SRC python :var l=one&#xA;  map(lambda x: x*2, l)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: two&#xA;| 0 | 2 | 4 |&#xA;&#xA;#+name: three&#xA;#+BEGIN_SRC python :var a=one b=two&#xA;  import itertools&#xA;  list(itertools.product(a,b))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: three&#xA;| 0 | 0 |&#xA;| 0 | 2 |&#xA;| 0 | 4 |&#xA;| 1 | 0 |&#xA;| 1 | 2 |&#xA;| 1 | 4 |&#xA;| 2 | 0 |&#xA;| 2 | 2 |&#xA;| 2 | 4 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Evaluate manually on change, not on export&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Put &lt;code&gt;:eval no-export&lt;/code&gt; in your header arguments, and the processing won't happen on export, only when you manually call it with &lt;code&gt;C-c C-c&lt;/code&gt; or &lt;code&gt;M-x org-babel-execute-buffer&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12451" LastActivityDate="2016-06-22T17:58:32.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24127" PostTypeId="1" CreationDate="2016-06-22T18:06:03.770" Score="8" ViewCount="1238" Body="&lt;p&gt;I'm guessing that since Haskell's ghci is not a full-fledged REPL, you can't really use it for defining functions in orgmode source blocks, i.e.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src haskell &#xA;doubleMe x = x + x &#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;isn't allowed in the ghci. But then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src haskell &#xA;let doubleMe x = x + x &#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works, but &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src haskell&#xA;let doubleSmallNumber4 x = if x &amp;gt; 0&#xA;                            then x &#xA;                             else x*2 &#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;complains about parsing the &lt;code&gt;else&lt;/code&gt;. I'm assuming Haskell and orgmode simply don't play well together -- at least when it comes to using orgmode source blocks . . . or am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="8349" LastEditDate="2016-06-22T18:22:24.773" LastActivityDate="2020-05-12T01:20:44.443" Title="No &quot;full service&quot; Haskell org mode?" Tags="|org-mode|org-babel|haskell-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24128" PostTypeId="1" CreationDate="2016-06-22T18:46:31.983" Score="4" ViewCount="337" Body="&lt;p&gt;When org-mode html export parses an .org file and encounters a link to an image, as for example &lt;code&gt;[[file:/Users/user/nice_image.png]]&lt;/code&gt;, it properly converts the link into an html figure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to extend that behaviour to other image formats that aren't currently supported by org's publishing facilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more specific, if my .org file contains a link to medical images in, e.g., DICOM format, I'd like org-mode to &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;recognise that the link is pointing to a DICOM,&lt;/li&gt;&#xA;&lt;li&gt;run a shell command that creates a PNG file from the DICOM,&lt;/li&gt;&#xA;&lt;li&gt;export an html figure as if the link would've been pointing to the PNG file all along.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to do that?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-06-19T14:15:35.863" Title="Custom behaviour when exporting links (org-export)" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24130" PostTypeId="1" AcceptedAnswerId="24131" CreationDate="2016-06-22T20:12:23.380" Score="0" ViewCount="89" Body="&lt;p&gt;Emacs, like any Great Thing, is a journey.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First you start with learning to use &lt;kbd&gt;C-n&lt;/kbd&gt; and &lt;kbd&gt;C-p&lt;/kbd&gt; (or &lt;kbd&gt;j&lt;/kbd&gt; and &lt;kbd&gt;k&lt;/kbd&gt; in &lt;code&gt;evil&lt;/code&gt;) instead of the up and down arrows; then you need to progress to using searches and other more advanced motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you have a problem: your fingers are stuck in their old, inefficient ways! There is a solution though: to ‘undefine’ the more basic key sequences to something &lt;em&gt;really, really annoying!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To what intolerably annoying function would you suggest redefining these basic key sequences?&lt;/strong&gt; (In order to kick the habit of using them too much?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You might include: audio; freezing Emacs; an animation; or something more creative – or a combination of them all!)&lt;/p&gt;&#xA;" OwnerUserId="10948" LastActivityDate="2016-06-22T21:53:17.540" Title="Training my fingers" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ClosedDate="2016-06-22T23:34:06.610" ContentLicense="CC BY-SA 3.0" />
  <row Id="24131" PostTypeId="2" ParentId="24130" CreationDate="2016-06-22T21:53:17.540" Score="1" Body="&lt;p&gt;A fairly creative &quot;don't do that&quot; might be to start the tutorial (normally bound to &lt;kbd&gt;C-h t&lt;/kbd&gt;), as a side benefit it might be useful to reference it at that point.  Similarly starting info (&lt;kbd&gt;C-h i&lt;/kbd&gt;) is an idea.  If you want it to be really annoying start one of the hacks from the Other Amusements section of the manual, I particularly like &lt;code&gt;dissociated-press&lt;/code&gt;, but the &lt;code&gt;doctor&lt;/code&gt; may try to help.  YMMV. :-)&lt;/p&gt;&#xA;" OwnerUserId="11699" LastActivityDate="2016-06-22T21:53:17.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24132" PostTypeId="2" ParentId="24113" CreationDate="2016-06-22T22:06:38.790" Score="2" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;&#xA;(defun my-find-file-fn (file)&#xA;&quot;If the filename extension of FILE ends in `.txt' or `.el' or `.png', then use&#xA;`find-file-other-frame'; otherwise, use `find-file-other-window'.  The three file&#xA;extensions txt/el/png are hard-coded into the let-bound variable `regex'.&quot;&#xA;  (let* (&#xA;      ;; regexp-matchp-fn from:  https://github.com/kentaro/auto-save-buffers-enhanced&#xA;      ;; regexp-matchp-fn modified by @sds:  http://stackoverflow.com/a/20343715/2112489&#xA;      (regexp-matchp-fn&#xA;        (lambda (regexps string)&#xA;          (and string&#xA;             (catch 'matched&#xA;               (let ((inhibit-changing-match-data t))&#xA;                 (dolist (regexp regexps)&#xA;                   (when (string-match regexp string)&#xA;                     (throw 'matched t))))))))&#xA;      (ext (file-name-extension file))&#xA;      (regex '(&quot;txt&quot; &quot;el&quot; &quot;png&quot;)))&#xA;    (if (funcall regexp-matchp-fn regex ext)&#xA;      (find-file-other-frame file)&#xA;      (find-file-other-window file))))&#xA;&#xA;(setq org-link-frame-setup '(&#xA;  (vm . vm-visit-folder-other-frame)&#xA;  (vm-imap . vm-visit-imap-folder-other-frame)&#xA;  (gnus . org-gnus-no-new-news)&#xA;  (file . my-find-file-fn)&#xA;  (wl . wl-other-frame)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-06-23T05:39:57.773" LastActivityDate="2016-06-23T05:39:57.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24133" PostTypeId="1" AcceptedAnswerId="24135" CreationDate="2016-06-22T22:49:59.983" Score="8" ViewCount="2052" Body="&lt;p&gt;From the &lt;code&gt;save-excursion&lt;/code&gt; docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Save point, mark, and current buffer; execute BODY; restore those things.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My understanding was that the restored buffer would again be visible following the evaluation of the body, but that appears not to be the case.  A basic function demonstrating the behavior that I find surprising:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-excursion ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (find-file &quot;just-a-test&quot;))&#xA;  (insert &quot;blah&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On my system (using &lt;code&gt;emacs -q&lt;/code&gt;; running Debian version 24.5.1) interactively running this function using &lt;code&gt;M-x test-excursion&lt;/code&gt; I get most of the behavior I expect.  A new empty file buffer is created (there is no such file on disk) named &quot;just-a-test&quot; and &quot;blah&quot; is inserted in the scratch buffer that I happened to have open at the time.  &lt;strong&gt;However; the buffer that remains visible is &quot;just-a-test&quot; and not &quot;*scratch*&quot; which was &lt;code&gt;(current-buffer)&lt;/code&gt; at the time the command was invoked.&lt;/strong&gt;  No additional windows were created.  It is only apparent by switching back to &quot;*scratch*&quot; that the string was inserted as expected.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My memory may be inaccurate on this, but I recall using &lt;code&gt;save-excursion&lt;/code&gt; when writing a function and observing the alternate behavior (the restored buffer restored as visible).  Is there any chance that this behavior has changed or that there has been a regression in 24.5.1?  I know that the definition has changed in 25.  I checked on another system (also 24.5.1) and observed the same behavior as my system.  Evaluation non-interactively (via &lt;code&gt;eval-last-sexp&lt;/code&gt;) yields the same.  &lt;code&gt;switch-buffer&lt;/code&gt; and &lt;code&gt;save-current-buffer&lt;/code&gt; also yield the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that each window (in the emacs sense) has a current buffer (&lt;strong&gt;edit&lt;/strong&gt;: perhaps appropriately referred to simply as the &quot;displayed buffer&quot; and is returned by &lt;code&gt;current-buffer&lt;/code&gt; when the window has focus) which necessarily is visible and there are no other conceptions of a &quot;visible buffer&quot;.  If &lt;code&gt;save-excursion&lt;/code&gt; restores the current buffer then shouldn't it be visible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been scratching my head at this one for a while.  I hope someone can help me out.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-06-22T23:52:11.947" LastActivityDate="2017-02-01T13:49:58.257" Title="save-excursion doesn't restore the currently visible buffer?" Tags="|window|save-excursion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24134" PostTypeId="2" ParentId="24094" CreationDate="2016-06-22T22:55:22.650" Score="1" Body="&lt;p&gt;In the end I worked around this with this code in the &lt;code&gt;:config&lt;/code&gt; section in the &lt;code&gt;use-package&lt;/code&gt; declaration for &lt;code&gt;whitespace&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'whitespace-space nil :foreground &quot;#272822&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-06-22T22:55:22.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24135" PostTypeId="2" ParentId="24133" CreationDate="2016-06-22T23:01:43.393" Score="8" Body="&lt;p&gt;The current buffer need not be visible in a window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're looking for &lt;code&gt;save-window-excursion&lt;/code&gt; (or quite possibly a combination of the two).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; &lt;code&gt;^save-&lt;/code&gt; will point out all of the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;save-current-buffer&#xA;  Function: Record which buffer is current; execute BODY; make that&#xA;            buffer current.&#xA;&#xA;save-excursion&#xA;  Function: Save point, mark, and current buffer; execute BODY;&#xA;            restore those things.&#xA;&#xA;save-match-data&#xA;  Macro: Execute the BODY forms, restoring the global value of the&#xA;         match data.&#xA;&#xA;save-restriction&#xA;  Function: Execute BODY, saving and restoring current buffer's&#xA;            restrictions.&#xA;&#xA;save-selected-window&#xA;  Macro: Execute BODY, then select the previously selected window.&#xA;&#xA;save-window-excursion&#xA;  Macro: Execute BODY, then restore previous window configuration.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-06-22T23:01:43.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24136" PostTypeId="2" ParentId="23932" CreationDate="2016-06-22T23:59:56.860" Score="2" Body="&lt;p&gt;This works for the input you supplied. Select the text and call the function (I'm not sure what your preferred workflow would be so I used active region) If you find input it fails for let me know and I can update it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun cleanup-refs ()&#xA;&quot;Delete portions of reference section within region.&quot;&#xA;(interactive)&#xA;(let ((start (region-beginning)))&#xA;  (while (re-search-forward &quot; ?([0-9]+ Citations[\n -~]*?)&quot; (region-end) t) (replace-match &quot;&quot;))&#xA;  (goto-char start)&#xA;  (while (re-search-forward &quot;\\(C\\|PD\\|PI\\)\\&amp;gt;&quot; (region-end) t) (replace-match &quot;&quot;))&#xA;  (goto-char (region-end))&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2016-06-25T07:09:42.907" LastActivityDate="2016-06-25T07:09:42.907" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24138" PostTypeId="2" ParentId="24113" CreationDate="2016-06-23T08:39:57.130" Score="0" Body="&lt;p&gt;Try customizing either &lt;code&gt;display-buffer-alist&lt;/code&gt; (for an Emacs-wide setting) or &lt;code&gt;org-file-apps&lt;/code&gt; (for an Org-mode-only setting). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you want an Org-mode-only setting, try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ph/find-file-new-frame (filename)&#xA;  (select-frame (make-frame))&#xA;  (find-file filename))&#xA;&#xA;(add-to-list 'org-file-apps&#xA;  '(&quot;\\.\\(?:txt\\|el\\|png\\)\\'&quot; . (ph/find-file-new-frame file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-06-23T08:39:57.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24139" PostTypeId="1" CreationDate="2016-06-23T09:53:05.007" Score="1" ViewCount="1236" Body="&lt;p&gt;I have recently started using emacs under Windows as my python IDE. I had some struggle getting python convinced that it was allowed to output UTF-8 to my terminal emulator (&lt;code&gt;mintty&lt;/code&gt; does support unicode, after all) – setting &lt;code&gt;PYTHONIOENCODING=UTF-8&lt;/code&gt; did the trick – but my inferior python buffer still tries to force the “charmap” encoding onto python, even though emacs can deal with unicode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;  File &quot;p:/My Documents/test.py&quot;, line 33, in &amp;lt;module&amp;gt;&#xA;  File &quot;c:\[...]\Anaconda3\lib\encodings\cp1252.py&quot;, line 19, in encode&#xA;    return codecs.charmap_encode(input,self.errors,encoding_table)[0]&#xA;UnicodeEncodeError: 'charmap' codec can't encode character '\u03b5' in position 0: character maps to &amp;lt;undefined&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I tell emacs to tell python to just get on with it and use UTF-8?&lt;/p&gt;&#xA;" OwnerUserId="2702" LastActivityDate="2016-10-21T12:38:51.603" Title="UnicodeEncodeError in inferior python under windows" Tags="|python|character-encoding|environment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24140" PostTypeId="2" ParentId="24139" CreationDate="2016-06-23T09:53:05.007" Score="3" Body="&lt;p&gt;The solution is to just set the same environment variable to the same value as in your question. How that is done I was reminded of by an &lt;a href=&quot;https://emacs.stackexchange.com/a/9876/2702&quot;&gt;answer to a previous, similar question – which I asked myself, but had forgotten about&lt;/a&gt;: It's as simple as adding&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;PYTHONIOENCODING&quot; &quot;UTF-8&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your emacs startup file.&lt;/p&gt;&#xA;" OwnerUserId="2702" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-06-23T09:53:05.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24141" PostTypeId="2" ParentId="17744" CreationDate="2016-06-23T11:03:05.077" Score="14" Body="&lt;p&gt;A solution that doesn't depend on &lt;code&gt;org-export-filter-src-block-functions&lt;/code&gt; and gives you more flexibility is using the &lt;code&gt;:exports&lt;/code&gt; header argument (see &lt;code&gt;(info &quot;(org) Exporting code blocks&quot;)&lt;/code&gt;). Setting the argument to &lt;code&gt;:exports none&lt;/code&gt; results in neither the code block nor its results being exported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you prefer a backend specific rule, you may use a conditional as the argument:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;#+begin_src elisp :exports (when (eq org-export-current-backend 'html) &quot;none&quot;)&#xA;(+ 1 2)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-06-23T11:03:05.077" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24142" PostTypeId="2" ParentId="24029" CreationDate="2016-06-23T11:08:35.273" Score="1" Body="&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'anaphora) ; for the `awhen' macro&#xA;  (require 'dash)) ; for the `-&amp;gt;' &quot;threading&quot; macro&#xA;&#xA;(defun ph/org-extract-link-no-kill ()&#xA;  &quot;Extract the link location at point.&quot;&#xA;  (when (org-in-regexp org-bracket-link-regexp 1)&#xA;    (-&amp;gt;&#xA;      1&#xA;      org-match-string-no-properties&#xA;      org-link-unescape)))&#xA;&#xA;(defun ph/org-extract-link ()&#xA;  &quot;Extract the link location at point and put it on the killring.&quot;&#xA;  (interactive)&#xA;  (awhen (ph/org-extract-link-no-kill)&#xA;    (kill-new it)&#xA;    (message &quot;Copied \&quot;%s\&quot;.&quot; it)))&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-c o&quot;) #'ph/org-extract-link)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12184" LastEditorUserId="12184" LastEditDate="2016-06-23T11:18:10.227" LastActivityDate="2016-06-23T11:18:10.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24143" PostTypeId="2" ParentId="9391" CreationDate="2016-06-23T11:21:29.340" Score="1" Body="&lt;p&gt;As @Lindydancer said, a wrapper would work. Here's a simple example for Linux:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash -c 'echo ${0:1:-1}' $(emacsclient -e '(caar (make-frame-names-alist))')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use it to bring my emacs window into focus (I normally only have 1) by feeding its output to &lt;code&gt;wmctrl&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wmctrl -a $(bash -c 'echo ${0:1:-1}' $(emacsclient -e '(caar (make-frame-names-alist))'))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6594" LastEditorUserId="454" LastEditDate="2016-06-23T11:24:53.633" LastActivityDate="2016-06-23T11:24:53.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24144" PostTypeId="2" ParentId="9391" CreationDate="2016-06-23T11:42:04.913" Score="1" Body="&lt;p&gt;As you know the name of your server, I suspect the &lt;code&gt;server-eval-at&lt;/code&gt; function, called from a secondary Emacs instance running in batch mode, may be a workable solution (perhaps depending on how frequently you're planning on calling this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;emacs -Q --batch -l server --eval &quot;(princ (server-eval-at \&quot;my-server\&quot; '\&quot;Hello, world\&quot;))&quot;&#xA;&#xA;emacs -Q --batch -l server --eval &quot;(princ (server-eval-at \&quot;my-server\&quot; '(emacs-version)))&quot;&#xA;&#xA;emacs -Q --batch -l server --eval &quot;(prin1 (server-eval-at \&quot;my-server\&quot; 'load-path))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-23T12:59:39.440" LastActivityDate="2016-06-23T12:59:39.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24145" PostTypeId="2" ParentId="18978" CreationDate="2016-06-23T12:39:49.620" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I use &lt;a href=&quot;https://github.com/TheBB/spaceline&quot; rel=&quot;nofollow noreferrer&quot;&gt;spaceline&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically it's built on top of &lt;code&gt;powerline&lt;/code&gt; and let you build your mode-line by adding several segments one after the other (in both left and right sections).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, the following segment: &lt;code&gt;(major-mode :face highlight-face)&lt;/code&gt; will insert the current major mode and apply a special face to it. This face &lt;code&gt;highlight-face&lt;/code&gt; changes following several criterias. You can customize &lt;code&gt;spaceline-modified&lt;/code&gt;, &lt;code&gt;spaceline-read-only&lt;/code&gt; and &lt;code&gt;spaceline-unmodified&lt;/code&gt; faces to fix your issue.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you still want to use &lt;code&gt;powerline&lt;/code&gt;, you need to do what &lt;code&gt;spaceline&lt;/code&gt; already does. That is to check for buffer status and apply the face you want. See &lt;code&gt;buffer-read-only&lt;/code&gt; and &lt;code&gt;buffer-modified-p&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is how my mode-line looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Normal&lt;/em&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/HuaAl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HuaAl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;em&gt;Modified&lt;/em&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/P9mPV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/P9mPV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;em&gt;Read-only&lt;/em&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/L4rN9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/L4rN9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;em&gt;Helm&lt;/em&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/3OfHu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3OfHu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2016-06-23T13:59:16.180" LastActivityDate="2016-06-23T13:59:16.180" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24147" PostTypeId="1" CreationDate="2016-06-23T13:40:03.593" Score="2" ViewCount="714" Body="&lt;p&gt;Currently I am using eclipse to browse cross compiled C source code. I don't have back end cross compiler to actually compile and build the code. But eclipse create source browse tree.&#xA;I want to have similar setup in Emacs so that I can browse source code even though it may build or not.&lt;/p&gt;&#xA;" OwnerUserId="12464" LastActivityDate="2017-10-25T13:19:40.523" Title="C Source code browsing similar to eclipse" Tags="|ctags|ide|project|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24148" PostTypeId="1" AcceptedAnswerId="24149" CreationDate="2016-06-23T15:51:30.403" Score="2" ViewCount="526" Body="&lt;p&gt;I'm using Spacemacs with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --version&#xA;&amp;gt; GNU Emacs 24.5.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On OSX 10.10.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;C-x C-f&lt;/code&gt; to find files shows a minibuffer like:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/cz1rb.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cz1rb.png&quot; alt=&quot;minibuffer&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been able to get rid of the ugly green foreground color for highlighting the matching results by changing the face with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x set-face-foreground&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then searching for helm and selecting &lt;code&gt;helm-match&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't seem to find the correct face to modify to change the current directory displayed at the top. In the image, it's the &lt;code&gt;Find file: /&lt;/code&gt; bit I'm talking about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using 'C-c C-x =' when in the minibuffer in this mode only brings up a cursor position, but no information about the face. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my questions are: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) What is this particular face I need to modify?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) More generally, how would I find out which face this is?&lt;/p&gt;&#xA;" OwnerUserId="12467" LastEditorUserId="105" LastEditDate="2017-05-16T22:35:57.047" LastActivityDate="2017-05-16T22:35:57.047" Title="Helm find-file foreground face for interactive current directory in minibuffer" Tags="|spacemacs|helm|faces|interactive|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24149" PostTypeId="2" ParentId="24148" CreationDate="2016-06-23T16:42:55.567" Score="3" Body="&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x list-faces-display&lt;/code&gt;&lt;/strong&gt; is your friend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows you all faces currently defined. And you can click on a face name to open Customize for that face.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/FaceMenuPlus&quot; rel=&quot;nofollow&quot;&gt;Face-Menu+&lt;/a&gt; (code: &lt;a href=&quot;http://www.emacswiki.org/emacs/download/facemenu%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;facemenu+.el&lt;/code&gt;&lt;/a&gt;) then &lt;code&gt;list-faces-display&lt;/code&gt; is even more useful.  If you click the sample text shown for a given face then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If the region is active and non-empty in the buffer that was current before you used &lt;code&gt;M-x list-faces-display&lt;/code&gt; then the face you click is applied to the text in that region.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Otherwise, the face whose sample you clicked is applied to new text that you enter (in the buffer that was current before you used &lt;code&gt;M-x list-faces-display&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;IOW, &lt;code&gt;list-faces-display&lt;/code&gt; also gives you a &lt;em&gt;WYSIWYG way to apply a face&lt;/em&gt;, in addition to a WYSIWYG way to edit (customize) a face.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then these kinds of things are even easier. You can skip using &lt;code&gt;list-faces-display&lt;/code&gt; altogether, because commands that ask for a face name show the completion candidates using their faces (WYSIWYG).  &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Candidates_with_Text_Properties&quot; rel=&quot;nofollow&quot;&gt;Description and screenshots&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-06-23T16:57:02.730" LastActivityDate="2016-06-23T16:57:02.730" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24150" PostTypeId="1" AcceptedAnswerId="24164" CreationDate="2016-06-23T18:04:52.640" Score="2" ViewCount="274" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/noctuid/vertigo.el&quot; rel=&quot;nofollow&quot;&gt;vertigo&lt;/a&gt; with evil in the following way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-motion vertigo-j (count)&#xA;  &quot;Evil vertigo motion. Count has no effect.&quot;&#xA;  (vertigo--jump #'evil-next-line &quot;Jump down: &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and I map it to &lt;code&gt;j&lt;/code&gt; with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;j&quot;) #'vertigo-j)&#xA;(define-key evil-visual-state-map (kbd &quot;j&quot;) #'vertigo-j)&#xA;(define-key evil-motion-state-map (kbd &quot;j&quot;) #'vertigo-j)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works well enough for normal motion, but &lt;strong&gt;when I try to delete some lines&lt;/strong&gt; (with &lt;code&gt;dj&lt;/code&gt;), &lt;strong&gt;something strange happens&lt;/strong&gt;. I go from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1  It was on ▊a dreary&#xA;2  night of November that I&#xA;3  beheld the accomplishment&#xA;4  of my toils.  With an&#xA;5  anxiety that almost&#xA;6  amounted to agony, I&#xA;7  collected the instruments...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(where &lt;code&gt;▊&lt;/code&gt; is &lt;em&gt;point&lt;/em&gt;), and, by pressing &lt;code&gt;dj&lt;/code&gt; and &lt;code&gt;f&lt;/code&gt; (delete down 4 lines), I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1  It was on ▊at almost&#xA;2  amounted to agony, I&#xA;3  collected the instruments...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What should have happened&lt;/strong&gt; is that the &lt;em&gt;whole&lt;/em&gt; of the first line was deleted, along with the whole of line 5:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1  ▊amounted to agony, I&#xA;2  collected the instruments...    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is incorrect about my remapping, and how can I fix it to get the desired behaviour?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="10948" LastActivityDate="2016-06-24T19:01:41.533" Title="Vertigo doesn't work properly with evil motions" Tags="|evil|motion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24151" PostTypeId="1" AcceptedAnswerId="24157" CreationDate="2016-06-23T18:20:26.467" Score="7" ViewCount="1027" Body="&lt;p&gt;I want to list all &lt;code&gt;TODO&lt;/code&gt; entries which have specific property value.&lt;br&gt;&#xA;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have many &lt;code&gt;TODO&lt;/code&gt; entries which are listed beneath &lt;code&gt;Collage&lt;/code&gt; heading.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Collage&lt;/code&gt; heading have property &lt;code&gt;CATEGORY&lt;/code&gt; set to &lt;code&gt;school&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;There are multiple headers with corresponding value of &lt;code&gt;CATEGORY&lt;/code&gt; property in single &lt;code&gt;org&lt;/code&gt; file.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I currently know of two useful &lt;code&gt;org-mode&lt;/code&gt; functionalities which could help here.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I can make a sparse tree of all &lt;code&gt;collage&lt;/code&gt; headings using &lt;code&gt;M-x org-sparse-tree p CATEGORY collage&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Also know how to make list of all &lt;code&gt;TODO&lt;/code&gt; entries using &lt;code&gt;M-x org-agenda t&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How to combine those two?&lt;br&gt;&#xA;Or how to do it more elegant way?&lt;/p&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-06-23T23:20:01.083" Title="List TODOs which have specific property" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24152" PostTypeId="1" CreationDate="2016-06-23T19:48:51.487" Score="1" ViewCount="702" Body="&lt;p&gt;I run &lt;code&gt;emacs --daemon&lt;/code&gt; and &lt;code&gt;emacsclient&lt;/code&gt;. When I &lt;code&gt;C-x C-c&lt;/code&gt; from emacsclient, it will show the prompt &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Save file /dir/filename.txt? (y, n, !, ., q, C-r, d or C-h)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for each file that has changes that haven't been saved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I enter &lt;code&gt;n&lt;/code&gt;, emacsclient will exit, but then the next time I open emacsclient, it will ask me again if I want to save changes. Typically when I enter &lt;code&gt;n&lt;/code&gt; I want to disacard the changes so that next time I run emacsclient, that file will be reverted to its state on disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I discard all unsaved changes when exiting emacsclient?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current behavior:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;emacsclient -a &quot;&quot; -t filename.txt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Make changes&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Save file /dir/filename.txt? (y, n, !, ., q, C-r, d or C-h)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;n&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;emacsclient -a &quot;&quot; -t filename.txt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Save file /dir/filename.txt? (y, n, !, ., q, C-r, d or C-h)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;n&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Desired behavior:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;emacsclient -a &quot;&quot; -t filename.txt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Make changes&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Save file /dir/filename.txt? (y, n, !, ., q, C-r, d or C-h)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;n&lt;/kbd&gt; (changes are discarded)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;emacsclient -a &quot;&quot; -t filename.txt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-c&lt;/code&gt; (emacsclient exits)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12470" LastEditorUserId="675" LastEditDate="2016-06-23T21:21:07.357" LastActivityDate="2016-07-24T21:05:31.567" Title="emacsclient - discard unsaved changes on exit" Tags="|emacsclient|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24153" PostTypeId="2" ParentId="24073" CreationDate="2016-06-23T19:59:26.677" Score="0" Body="&lt;p&gt;Gnome terminal intercepts alt-V to pull down the menu for &quot;View&quot;.&#xA;This is completely an issue within emacs running inside Gnome Terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is to uncheck &quot;enable the menu access keys&quot; in gnome terminal's shortcut keys' settings. &lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2016-06-23T19:59:26.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24154" PostTypeId="1" CreationDate="2016-06-23T20:10:17.683" Score="0" ViewCount="1164" Body="&lt;p&gt;I am trying to install elpy on my machine (ubuntu 14.04), but getting the following issue. any comment, hint?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Requirement already satisfied (use --upgrade to upgrade): elpy in ./work/software/anaconda3/lib/python3.5/site-packages&#xA;Requirement already satisfied (use --upgrade to upgrade): importmagic in ./work/software/anaconda3/lib/python3.5/site-packages (from elpy)&#xA;Requirement already satisfied (use --upgrade to upgrade): flake8&amp;gt;=2.0 in ./work/software/anaconda3/lib/python3.5/site-packages (from elpy)&#xA;Requirement already satisfied (use --upgrade to upgrade): setuptools&amp;gt;=0.6b1 in ./work/software/anaconda3/lib/python3.5/site-packages/setuptools-20.3-py3.5.egg (from importmagic-&amp;gt;elpy)&#xA;Requirement already satisfied (use --upgrade to upgrade): pyflakes!=1.2.0,!=1.2.1,!=1.2.2,&amp;lt;1.3,&amp;gt;=0.8.1 in ./work/software/anaconda3/lib/python3.5/site-packages (from flake8&amp;gt;=2.0-&amp;gt;elpy)&#xA;Requirement already satisfied (use --upgrade to upgrade): pycodestyle&amp;lt;2.1,&amp;gt;=2.0 in ./work/software/anaconda3/lib/python3.5/site-packages (from flake8&amp;gt;=2.0-&amp;gt;elpy)&#xA;Requirement already satisfied (use --upgrade to upgrade): mccabe&amp;lt;0.6,&amp;gt;=0.2.1 in ./work/software/anaconda3/lib/python3.5/site-packages (from flake8&amp;gt;=2.0-&amp;gt;elpy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12471" LastActivityDate="2016-10-22T00:48:47.950" Title="Problem to install/setup elpy" Tags="|elpy|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24155" PostTypeId="2" ParentId="24152" CreationDate="2016-06-23T20:10:48.140" Score="1" Body="&lt;p&gt;When done with a file opened through emacsclient, close it with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;#&lt;/kbd&gt; (which runs &lt;code&gt;server-edit&lt;/code&gt;), not &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also define a function that closes all remaining server files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun close-all-server-files ()&#xA;  &quot;Close all server files&quot;&#xA;  (interactive)&#xA;  (while (not(server-edit))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just bind it to a key and run it when needed.&lt;/p&gt;&#xA;" OwnerUserId="2526" LastEditorUserId="2526" LastEditDate="2016-06-23T21:35:16.470" LastActivityDate="2016-06-23T21:35:16.470" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24156" PostTypeId="2" ParentId="24154" CreationDate="2016-06-23T21:12:34.987" Score="1" Body="&lt;p&gt;You need to install it in emacs as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x &amp;lt;RET&amp;gt; package-install &amp;lt;RET&amp;gt; elpy &amp;lt;RET&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then in your &lt;code&gt;init.el&lt;/code&gt; add &lt;code&gt;(elpy-enable)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when you open python files you should see the &lt;code&gt;elpy&lt;/code&gt; minor mode enabled&lt;/p&gt;&#xA;" OwnerUserId="3902" LastActivityDate="2016-06-23T21:12:34.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24157" PostTypeId="2" ParentId="24151" CreationDate="2016-06-23T23:20:01.083" Score="3" Body="&lt;p&gt;This is what &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html&quot; rel=&quot;nofollow&quot;&gt;org-agenda-custom-commands&lt;/a&gt; is for.  It lets you add additional agenda view to &lt;code&gt;org-agenda&lt;/code&gt;.  Here we attach &quot;S&quot; to a search for all &lt;code&gt;TODO&lt;/code&gt; items whose &lt;code&gt;CATEGORY&lt;/code&gt; is &lt;code&gt;school&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;S&quot; &quot;School&quot;&#xA;               tags-todo &quot;+CATEGORY=\&quot;school\&quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Access it with &lt;code&gt;M-x org-agenda S&lt;/code&gt;.  There are many, many options allowing you to customize exactly what get shown.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-06-23T23:20:01.083" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24158" PostTypeId="2" ParentId="21636" CreationDate="2016-06-23T23:37:53.050" Score="1" Body="&lt;p&gt;In my case this was due to rogue declaration of paths in my bash profile &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GOROOT=/Users/jay/work &#xA;PATH=$PATH:$GOROOT/bin &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I removed those lines from &lt;code&gt;.bashrc&lt;/code&gt; and the problem resolved. &lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-06-23T23:37:53.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24159" PostTypeId="1" CreationDate="2016-06-23T23:43:33.487" Score="6" ViewCount="9417" Body="&lt;p&gt;I added two new lines to my &lt;code&gt;.bashrc&lt;/code&gt; &lt;a href=&quot;https://stackoverflow.com/questions/28741651/how-to-set-gopath-in-mac-os-x-10-10&quot;&gt;so that Bash can find my Go programs&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GOROOT=/Users/jay/work &#xA;PATH=$PATH:$GOROOT/bin &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But as a result, when I launch Emacs, Emacs hangs for several minutes and I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Opening connection for bin using ssh...&#xA;Tramp: Sending command `exec ssh   -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none bin'&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Tramp failed to connect.  If this happens repeatedly, try&#xA;    `M-x tramp-cleanup-this-connection'&#xA;Tramp: Waiting for prompts from remote shell...failed&#xA;Tramp: Opening connection for bin using ssh...failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In a &lt;a href=&quot;https://emacs.stackexchange.com/questions/20802/tramp-waiting-for-prompts-from-remote-shell-sending-command-exec-ssh-e-non&quot;&gt;previous question&lt;/a&gt;, I found that a path declaration in my &lt;code&gt;.bashrc&lt;/code&gt; file caused Tramp to hang. The line was this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export PATH=&quot;$PATH:$HOME/.rvm/bin&quot; # Add RVM to PATH for scripting&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That time, I resolved the issue by simply removing the line, since it didn't seem necessary. But this time I kind of need these path declarations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I resolve this error without deleting this path declarations from my &lt;code&gt;.bashrc&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2022-09-18T23:30:31.290" Title="Tramp: Waiting for prompts from remote shell" Tags="|tramp|bash|exec-path|" AnswerCount="7" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24160" PostTypeId="1" CreationDate="2016-06-24T07:17:25.210" Score="2" ViewCount="2133" Body="&lt;p&gt;I have been using Emacs on Windows for decades now and it essentially always worked fine except for minor annoyances.  However, I recently had to buy a new machine with Windows 10 (the last Windows I used Emacs on was Win7) and now I'm in the strange situation that Emacs can't write to &lt;code&gt;~/.emacs&lt;/code&gt; anymore.  Whenever I try to do that, I get a message about wrong file permissions.  If I then close and restart Emacs, it can't even &lt;em&gt;read&lt;/em&gt; the file anymore, so I have to fix the permissions (which I usually do with Cygwin).  To be clear: The file permissions are fine &lt;em&gt;before&lt;/em&gt; Emacs tries to write to &lt;code&gt;~/.emacs&lt;/code&gt;, but then Emacs itself somehow messes up and as a result it can't read or write the file anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &quot;fixed&quot; the problem for now by renaming the file to &lt;code&gt;~/_emacs&lt;/code&gt;, but I'd like to know what the reason for this behavior is.  (And in the long run I'd like to get rid of the warning message that the underline is deprecated...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version is: GNU Emacs 25.0.94.2 (x86_64-w64-mingw32) of 2016-05-26&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm also using Emacs via a pretty old version of gnuserv in case that matters.)&lt;/p&gt;&#xA;" OwnerUserId="12475" LastActivityDate="2018-02-09T21:05:11.783" Title="Emacs can't write to its own init file on Windows 10" Tags="|init-file|microsoft-windows|files|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24161" PostTypeId="2" ParentId="24159" CreationDate="2016-06-24T08:56:10.243" Score="5" Body="&lt;p&gt;It looks like you've run the &lt;code&gt;exec-path-from-shell&lt;/code&gt; from a Tramp buffer, so when it runs the shell, it attempts to do its magic on the remote server and then set the environment variables in your local emacs instance. That's almost certainly not what you want, and it's not a case that &lt;code&gt;exec-path-from-shell&lt;/code&gt; is designed for. It looks like it's Tramp or your Tramp setup that's not working, though, because in theory any shell command we might execute locally should also work remotely, and that includes those issued by &lt;code&gt;exec-path-from-shell&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="111" LastActivityDate="2016-06-24T08:56:10.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24163" PostTypeId="1" AcceptedAnswerId="26204" CreationDate="2016-06-24T09:52:26.570" Score="3" ViewCount="137" Body="&lt;p&gt;I’m basically trying to run this command, but in Magit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git diff master..17 -- &quot;**/*.scala&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;… i.e. to view changes in all &lt;code&gt;*.scala&lt;/code&gt; files between &lt;code&gt;ref/heads/master&lt;/code&gt; and &lt;code&gt;ref/heads/17&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’ve tried setting &lt;code&gt;=f&lt;/code&gt; to this glob, but that doesn’t help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Same question applies to &lt;code&gt;git log&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="9817" LastActivityDate="2016-08-11T15:21:48.100" Title="Running diff in Magit, filtered to only some specific files" Tags="|magit|diff|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24164" PostTypeId="2" ParentId="24150" CreationDate="2016-06-24T10:55:07.663" Score="1" Body="&lt;p&gt;When defining a motion (&lt;code&gt;evil-define-motion&lt;/code&gt;), Evil's info manual (section 5.1) shows that you can also set its type, e.g. &lt;code&gt;type: line&lt;/code&gt; so that &quot;the range is expanded to linewise positions&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-motion vertigo-j (count)&#xA;  :type line&#xA;  :jump t&#xA;  &quot;Evil vertigo motion. Count has no effect.&quot;&#xA;    (vertigo-jump-down))&#xA;&#xA;;; example mapping&#xA;(define-key evil-motion-state-map (kbd &quot;g j&quot;) #'vertigo-j)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my case, I couldn't even use &lt;code&gt;vertigo--jump&lt;/code&gt; (?), so I simply relied on the example provided by the plugin author.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, something like &lt;code&gt;dgjaa&lt;/code&gt; will delete entire lines. Using &lt;code&gt;vgjaad&lt;/code&gt; will not delete entire lines though - but this is OK, since with visual mode, the user controls the type of selection (so, you can use &lt;code&gt;Vgjaad&lt;/code&gt; instead).&lt;/p&gt;&#xA;" OwnerUserId="8708" LastEditorUserId="8708" LastEditDate="2016-06-24T19:01:41.533" LastActivityDate="2016-06-24T19:01:41.533" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24165" PostTypeId="1" AcceptedAnswerId="24178" CreationDate="2016-06-24T10:57:53.057" Score="1" ViewCount="1897" Body="&lt;p&gt;I had recently started to get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): Unable to access `user-emacs-directory' (~/.emacs.d/). &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;message upon startup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Windows 7 (X64) &lt;/li&gt;&#xA;&lt;li&gt;using the latest x64 emacs-25.0.94.2 build &lt;/li&gt;&#xA;&lt;li&gt;and .21 spacemacs. &lt;/li&gt;&#xA;&lt;li&gt;My &lt;code&gt;$HOME&lt;/code&gt; is set to &lt;code&gt;C:\HOME&lt;/code&gt; (with the &quot;normal&quot; Windows environment variable way), and in which there is the .emacs.d directory and my not so tailored &lt;code&gt;.spacemacs&lt;/code&gt;, which gets processed upon startup, &lt;/li&gt;&#xA;&lt;li&gt;and I can access via &lt;code&gt;dired ~&lt;/code&gt; so I assume that it is set properly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Could someone point me in the right direction what should I do with it?&lt;/p&gt;&#xA;" OwnerUserId="473" LastEditorUserId="2055" LastEditDate="2016-06-26T04:41:15.163" LastActivityDate="2016-11-06T15:35:35.053" Title="`user-emacs-directory' directory is inaccessible" Tags="|init-file|spacemacs|microsoft-windows|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24166" PostTypeId="1" AcceptedAnswerId="24167" CreationDate="2016-06-24T12:05:50.967" Score="3" ViewCount="1245" Body="&lt;p&gt;Can I enter an org-mode list in a cell of an org-mode table?&lt;/p&gt;&#xA;" OwnerUserId="6732" LastActivityDate="2018-01-20T03:47:19.287" Title="How can I enter a list in a cell of an org-mode table?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24167" PostTypeId="2" ParentId="24166" CreationDate="2016-06-24T13:18:51.593" Score="4" Body="&lt;p&gt;No. Org does not support any list in a table cell.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-06-24T13:18:51.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24168" PostTypeId="1" AcceptedAnswerId="24171" CreationDate="2016-06-24T16:15:06.447" Score="2" ViewCount="70" Body="&lt;p&gt;When I invoke &lt;code&gt;elint-current-buffer&lt;/code&gt; on a buffer of Lisp code, Emacs starts dragging in 75 !! compressed .el.gz files, leaving me with a huge pile of unwanted active buffers containing those files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to set a config option (or do something else) to avoid this issue? I searched for elint doc, but could only find an empty EmacsWiki page, nothing in the Emacs/Elisp manuals, no meaningful doc on the web.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-06-24T18:46:14.010" Title="how to manage elint dragging in lots of .gz files" Tags="|style|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24169" PostTypeId="1" AcceptedAnswerId="24170" CreationDate="2016-06-24T16:35:26.950" Score="1" ViewCount="327" Body="&lt;p&gt;The byte compiler just gave me this message &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1103:24:Warning: assignment to free variable `orig-win-config&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on this bit of code:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt; ;; create window config store and restore functions&#xA; ;; credit to @lawlist on stackoverflow for this embedded setup&#xA; (setq mysetup&#xA;       (lambda ()&#xA;         ;; store original window configuration&#xA;         (set (make-local-variable 'orig-win-config)&#xA;              (current-window-configuration))&#xA;         ;; bind q to the window restore function&#xA;         (local-set-key&#xA;          &quot;q&quot;&#xA;          (lambda ()&#xA;            (interactive)&#xA;            ;; q is shared by all Help-mode buffers&#xA;            ;; so guard those that did not set up orig-win-config&#xA;            (when (boundp 'orig-win-config)&#xA;              (set-window-configuration orig-win-config))&#xA;            (kill-buffer (current-buffer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code runs in a &lt;code&gt;defmacro&lt;/code&gt; that displays a temporary buffer window in Help-mode. The code creates a local function variable &lt;code&gt;mysetup&lt;/code&gt; that can be called in the Help mode hook, to remember the original window configuration so the original configuration can be restored when the temporary help buffer is dispatched with &quot;q&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The byte compiler apparently thinks that the &lt;code&gt;(make-local-variable 'orig-win-config)&lt;/code&gt; statement creates a free variable that should not be assigned to this way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to change my syntax to keep the byte compiler happy, and to create/assign to the variable in a more correct way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/10394/scope-in-lambda&quot;&gt;This question&lt;/a&gt; seems similar, but is not quite the same because it works with a &lt;code&gt;(defun&lt;/code&gt; argument in the argument list, not a new variable in a &lt;code&gt;(defmacro&lt;/code&gt;. So I don't know what to make of the info in that question.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-06-24T17:14:28.983" Title="How to fix Warning: assignment to free (local) variable in lambda function" Tags="|variables|symbols|dynamic-scoping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24170" PostTypeId="2" ParentId="24169" CreationDate="2016-06-24T17:06:49.870" Score="2" Body="&lt;p&gt;As usual for this kind of thing, just put &lt;code&gt;(defvar orig-win-config)&lt;/code&gt; near the beginning of the same file. That declares &lt;code&gt;orig-win-config&lt;/code&gt; as a dynamic variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, the byte-compiler thinks that &lt;code&gt;(set-window-configuration orig-win-config)&lt;/code&gt; refers to an undefined variable.  (It is not that the compiler thinks that &lt;code&gt;(make-local-variable 'orig-win-config)&lt;/code&gt; &quot;creates a free variable&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point is that &lt;code&gt;orig-win-config&lt;/code&gt; is not bound in yourcode.  It really is a free variable.  By providing a declaration that it is a global variable, you let the compiler (and Emacs generally) know that it is a &lt;em&gt;dynamic&lt;/em&gt; variable: a symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A symbol has a &lt;code&gt;symbol-value&lt;/code&gt; property, whether or not it has a value when the file is compiled. A symbol can always be used as a variable, and  only a &lt;em&gt;runtime&lt;/em&gt; error can be raised if it does not have a value as a variable at a given time.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-06-24T17:14:00.920" LastActivityDate="2016-06-24T17:14:00.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24171" PostTypeId="2" ParentId="24168" CreationDate="2016-06-24T18:46:14.010" Score="1" Body="&lt;p&gt;This is somewhere between fully intentional and a bug.  I'm not sure towards which side this one leans to, so I'll just let the sources speak for themselves:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun elint-add-required-env (env name file)&#xA;  &quot;Augment ENV with the variables defined by feature NAME in FILE.&quot;&#xA;  (condition-case err&#xA;      (let* ((libname (if (stringp file)&#xA;              file&#xA;            (symbol-name name)))&#xA;&#xA;         ;; First try to find .el files, then the raw name&#xA;         (lib1 (locate-library (concat libname &quot;.el&quot;) t))&#xA;         (lib (or lib1 (locate-library libname t))))&#xA;    ;; Clear the messages :-/&#xA;    ;; (Messes up the &quot;Initializing elint...&quot; message.)&#xA;;;; (message nil)&#xA;    (if lib&#xA;        (with-current-buffer (find-file-noselect lib)&#xA;          ;; FIXME this doesn't use a temp buffer, because it&#xA;          ;; stores the result in buffer-local variables so that&#xA;          ;; it can be reused.&#xA;          (elint-update-env)&#xA;          (setq env (elint-env-add-env env elint-buffer-env)))&#xA;          ;;; (with-temp-buffer&#xA;          ;;;   (insert-file-contents lib)&#xA;          ;;;   (with-syntax-table emacs-lisp-mode-syntax-table&#xA;          ;;;     (elint-update-env))&#xA;          ;;;   (setq env (elint-env-add-env env elint-buffer-env))))&#xA;          ;;(message &quot;Elint processed (require '%s)&quot; name))&#xA;      (error &quot;%s.el not found in load-path&quot; libname)))&#xA;    (error&#xA;     (message &quot;Can't get variables from require'd library %s: %s&quot;&#xA;              name (error-message-string err))))&#xA;  env)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The crucial part here is &lt;code&gt;find-file-noselect&lt;/code&gt;.  To recapitulate, elint is a package that lints elisp files by a set of built-in rules and rules that are created by scanning both the source buffer and all required libraries.  The latter is done recursively to catch them all.  Now, if it were using temporary buffers to do this, you wouldn't ever know of it, but it doesn't and instead goes for the &lt;s&gt;horrific&lt;/s&gt;tried and true way of opening extra buffers, storing buffer-local data in them and keeping them around in case someone lints stuff again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm afraid there's no option to customize this behavior.  Hand in a bug or better, if you have an idea how to do better, a patch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I wouldn't bother.  Use &lt;code&gt;M-x byte-compile-file&lt;/code&gt; and look at the compilation buffer instead.  Its warnings cover everything elint does and unlike elint, the byte-compiler gets improved on a regular basis.  The excellent flycheck package hides this manual step for you and integrates the warnings right where they belong, into the source buffer in form of squiggly lines.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-06-24T18:46:14.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24175" PostTypeId="2" ParentId="19330" CreationDate="2016-06-25T06:06:38.127" Score="3" Body="&lt;p&gt;When using @andreas solution to select last pasted text and tried to change indentation on it and then repeating the indentation with &lt;code&gt;.&lt;/code&gt; (&lt;code&gt;evil-repeat&lt;/code&gt;) it gave me errors. I had to modify the function to be like this, which now works fine for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun evil-select-pasted ()&#xA;  &quot;Visually select last pasted text.&quot;&#xA;  (interactive)&#xA;  (evil-goto-mark ?\[)&#xA;  (evil-visual-char)&#xA;  (evil-goto-mark ?\]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12340" LastEditorUserId="15748" LastEditDate="2018-02-09T18:14:41.450" LastActivityDate="2018-02-09T18:14:41.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24176" PostTypeId="1" AcceptedAnswerId="24179" CreationDate="2016-06-25T06:45:11.023" Score="7" ViewCount="5418" Body="&lt;p&gt;I was watching &lt;a href=&quot;https://www.youtube.com/watch?v=8vdOrsywra0&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; video on someone's emacs configuration, and I noticed that his mode line seemed a lot better to look at than mine, but he didn't explain it in the video.  Is there a way to replicate the mode line in the video, or to remove the parentheses around the mode and increase the size of the status line?  Or is it some plugin.  Ive already tried all the themes in the powerline and smart mode line plugins, and I can't seem to find a way to replicate it.  Any help is appreciated, thanks.&lt;/p&gt;&#xA;" OwnerUserId="12482" LastEditorUserId="105" LastEditDate="2016-06-25T13:57:27.163" LastActivityDate="2016-06-26T12:42:11.050" Title="How to increase the size of the mode-line" Tags="|mode-line|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24177" PostTypeId="1" CreationDate="2016-06-25T09:00:23.753" Score="1" ViewCount="259" Body="&lt;p&gt;i would like to have a way to save a function every X hours and to a user defined directory&#xA;so far i have this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(defun z/save-meeting-to-ics ()&#xA;    &quot;If the current file is in '~/.dotfiles', the code blocks are tangled&quot;&#xA;    (when (equal (buffer-file-name)&#xA;                 (expand-file-name &quot;/home/zeltak/org/files/agenda/meetings.org&quot;))&#xA;      (org-icalendar-export-to-ics)&#xA;      (message &quot;exported to ics&quot;)))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this does save the org file &quot;meetings.org&quot; to an ICS file in the same &lt;/p&gt;&#xA;&#xA;&lt;p&gt;folder as the file. but i want to do 2 additional things:&#xA;1)save the resulting ICS file to a different directory&#xA;2)run this function every X hours (lets say every 2 hours)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any clue?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11387" LastEditDate="2016-06-26T15:40:17.997" LastActivityDate="2016-06-26T15:40:17.997" Title="auto export to ICS when specifc orgmode file is saved?" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24178" PostTypeId="2" ParentId="24165" CreationDate="2016-06-25T13:14:35.487" Score="2" Body="&lt;p&gt;Generally I set HOME to the traditional home directory &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C:\Documents and Settings\User&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which is a holdover from Windows XP. On Windows 7 and later you could presumably update this (although I haven't tried this) to &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C:\Users\User&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think either of these is a better idea than something in the root directory.&lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2016-06-25T13:14:35.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24179" PostTypeId="2" ParentId="24176" CreationDate="2016-06-25T15:27:18.787" Score="7" Body="&lt;p&gt;Set &lt;code&gt;mode-line&lt;/code&gt; with a &lt;code&gt;:box&lt;/code&gt; property which has a greater &lt;code&gt;line-width&lt;/code&gt;. The thing is you must set the &lt;code&gt;:background&lt;/code&gt; to have the same color as the &lt;code&gt;:color&lt;/code&gt; of the &lt;code&gt;:box&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this in my theme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(mode-line ((t (:background &quot;black&quot; :foreground &quot;gray70&quot; :box (:line-width 4 :color &quot;black&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you can set &lt;code&gt;mode-line&lt;/code&gt; in your .init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA;  '(mode-line ((t (:background &quot;black&quot; :foreground &quot;gray70&quot; :box (:line-width 4 :color &quot;black&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2016-06-26T12:42:11.050" LastActivityDate="2016-06-26T12:42:11.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24181" PostTypeId="1" CreationDate="2016-06-25T18:28:26.510" Score="1" ViewCount="2007" Body="&lt;p&gt;I'm having endless problems with the details of keymap binding syntax.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;This style works fine with &lt;code&gt;define-key&lt;/code&gt;, and &lt;code&gt;kbd&lt;/code&gt; on my own keymap name:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; make my own keymap, with prefix C-;&#xA;(define-prefix-command 'my-prefix)&#xA;(define-key global-map (kbd &quot;C-;&quot;) 'my-prefix-pairs)&#xA;(setq my-prefix-pairs&#xA;      '(&#xA;        ((kbd &quot;e&quot;)    function-1)&#xA;        ((kbd &quot;C-f&quot;)  function-2)&#xA;        ))&#xA;(dolist (pair my-prefix-pairs)&#xA;  (define-key my-prefix (eval (car pair)) (cadr pair)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This style also works fine, with &lt;code&gt;global-set-key&lt;/code&gt; and &lt;code&gt;mapc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; Control-C bindings, reserved by Emacs for personal bindings&#xA;(mapc&#xA; #'(lambda (x) (global-set-key (car x) (car (cdr x))))&#xA; '(&#xA;   (&quot;\C-ce&quot;          my-function-1)&#xA;   (&quot;\C-c\C-f&quot;       my-function-2)&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I just can't this style to work for &lt;code&gt;global-set-key&lt;/code&gt; and &lt;code&gt;kbd&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq my-prefix-pairs&#xA;      '(&#xA;        (&quot;e&quot;      function-1)&#xA;        (&quot;C-f&quot;    function-2)&#xA;        ))&#xA;(dolist (pair my-prefix-pairs)&#xA;  (global-set-key  (kbd (concat &quot;C-c &quot; (car pair))) (cadr pair)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong in the last style? What would work, to bind keys globally in the Control-X-prefix map? I've looked at other keybinding postings on SO, but didn't find anything that worked for this particular problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 1 for comment below&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very strange to hear from a poster below that this code works with &lt;code&gt;emacs -Q&lt;/code&gt;. I can't imagine why other styles work fine, but this style won't work with my init setup. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyhow, to answer his question, with the following binding at the top of the binding list,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;   (&quot;w&quot;    kill-ring-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get this error from the debugger:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Key sequence C-c w starts with non-prefix key C-c&quot;)&#xA;define-key((keymap #^[nil nil keymap ...&#xA;                   #^^[3 0 set-mark-command move-beginning-of-line ...&#xA;                   #^^[1 0 #^^[2 0 &#xA;&#xA;global-set-key(&quot;^Cw&quot; kill-ring-save))  ;;the ^C is a real ^C&#xA;(while --dolist-tail-- (setq pair (car --dolist-tail--))&#xA;     (global-set-key (kbd (concat &quot;C-c &quot; (car pair))) (cadr pair))&#xA;     (setq --dolist-tail-- (cdr --dolist-tail--)))&#xA;(let ((--dolist-tail-- kwj-ctl-c-pairs) pair)&#xA;  (while --dolist-tail-- (setq pair (car --dolist-tail--))&#xA;       (global-set-key (kbd (concat &quot;C-c &quot; (car pair))) (cadr pair))&#xA;       (setq --dolist-tail-- (cdr --dolist-tail--))))&#xA;eval((let ((--dolist-tail-- kwj-ctl-c-pairs) pair)&#xA;     (while --dolist-tail-- (setq pair (car --dolist-tail--))&#xA;            (global-set-key (kbd (concat &quot;C-c &quot; (car pair))) (cadr pair))&#xA;            (setq --dolist-tail-- (cdr --dolist-tail--)))) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And using &lt;code&gt;emacs -Q&lt;/code&gt; and pasting this code into the scratch buffer, I also get a debugger error:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq my-prefix-pairs&#xA;  '(&#xA;    (&quot;e&quot;      function-1)&#xA;    (&quot;C-f&quot;    function-2)&#xA;    ))&#xA;(dolist (pair my-prefix-pairs)&#xA;  (global-set-key  (kbd (concat &quot;C-c &quot; (car pair))) (cadr pair)))&#xA;&#xA;&#xA;Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p (concat &quot;C-c &quot; (car pai$&#xA;  read-kbd-macro((concat &quot;C-c &quot; (car pair)))&#xA;  #[(keys) &quot;\301^H!\207&quot; [keys read-kbd-macro] 2 1987665]((concat &quot;C-c &quot; (car pair)))&#xA;  (kbd (concat &quot;C-c &quot; (car pair)))&#xA;  (global-set-key (kbd (concat &quot;C-c &quot; ...)) (cadr pair))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2 after more comments and hacking&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After more hacking and the &quot;your code works for me&quot; comment below, I starting stripping everything down in my init, and trying to build up my keybindings from scratch. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running Gnu Emacs 24.5.1 as a .dmg app on a recent Mac OSX machine. (But the problem also occurs with the native OSX Emacs v 22.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one problematic line, for certain (Actually, I show two syntaxes for it). It causes the error if it is in, and I get no errors if it is out. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    ;;        (&quot;C- &quot;     set-mark-command)&#xA;    ;;        (&quot;C-SPC &quot;  set-mark-command)&#xA;&#xA;Debugger entered--Lisp error: &#xA;(error &quot;Key sequence C-c w starts with non-prefix key C-c&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Those lines both cause the error, even though a similar syntax &lt;code&gt;&quot;C-SPC&quot;&lt;/code&gt; in this line does not. (This line uses &lt;code&gt;define-key global-map&lt;/code&gt;, not &lt;code&gt;(global-set-key...&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-key global-map (kbd &quot;C-SPC&quot;) 'avy-goto-word-or-subword-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I would swear I've had this line in my init for months, with apparently no problem, but it won't work now. (I say this because my fingers automatically go to ctl-c ctl-spc to set the mark..) Neither version works now, and my finger-memory is protesting... :-)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(define-key global-map (kbd &quot;C-c C-SPC&quot;) 'set-mark-command)&#xA;(global-set-key (kbd &quot;C-c C-SPC&quot;) set-mark-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-06-26T00:55:41.473" LastActivityDate="2016-06-26T02:48:04.817" Title="Problems with global-set-key syntax" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24183" PostTypeId="2" ParentId="7159" CreationDate="2016-06-25T22:18:05.327" Score="1" Body="&lt;p&gt;I had this problem with emacs 24.3 on xubuntu running xfce 4.10,&#xA;even for completely trivial text files&#xA;It only appeared in the &quot;xemacs&quot; (gtk) version, it ran fine in a&#xA;command shell with the DISPLAY env var unset.&#xA;I used the xfce Settings / Window Manager Tweaks dialog&#xA;to switch display compositing ON and that fixed it!&lt;/p&gt;&#xA;" OwnerUserId="12486" LastActivityDate="2016-06-25T22:18:05.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24184" PostTypeId="1" AcceptedAnswerId="24186" CreationDate="2016-06-25T23:12:09.617" Score="0" ViewCount="145" Body="&lt;p&gt;Currently, buffers with &lt;strong&gt;*names like this*&lt;/strong&gt; do not bloat my &lt;code&gt;C-x C-b&lt;/code&gt; menu, but now that I'm using &lt;code&gt;multi-term&lt;/code&gt; it's important to be able to see these buffers and be able to select them (only the ones with terminal emulators preferably, but it is ok if others like *scratch* or *messages* show up). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using this to invoke the buffer menu:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x C-b&quot;) 'bs-show)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Really I don'n know how to engage this issue.&lt;/p&gt;&#xA;" OwnerUserId="12487" LastActivityDate="2017-06-27T15:00:24.177" Title="How to show *terminal* buffers in C-x C-b menu" Tags="|buffers|multi-term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24185" PostTypeId="2" ParentId="24181" CreationDate="2016-06-26T02:19:05.077" Score="1" Body="&lt;p&gt;Here's the ending story, hopefully expressed in a reproducible way for the Emacs maintainers. The big lesson is NOT to use &quot; &quot; space characters in keybinding syntaxes, even if you've been using &quot; &quot; space characters for many years successfully... :-)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; This is my ENTIRE .emacs file.&#xA;&#xA;(find-file &quot;~/.emacs&quot;)&#xA;&#xA;(global-set-key (kbd (concat &quot;C-c &quot; &quot;t&quot;)) 'ct-testregion-toggle)&#xA;;; This syntax works because it has no trailing whitespace, and a&#xA;;; non-white second keybinding (&quot;t&quot;). Other non-white bindings&#xA;;; in the second position such as &quot;C-k&quot; or &quot;C-SPC&quot; will work too.&#xA;&#xA;(setq my-prefix-pairs&#xA;  '(&#xA;    (&quot;w&quot;    kill-ring-save)&#xA;    ;; Control-C w&#xA;    ;; This syntax works because it is non-white&#xA;&#xA;    ;; (&quot; &quot;    this-syntax-messes-up-future-bindings)&#xA;    ;; Control-C &quot; &quot;&#xA;    ;; With this in the file, it messes up following attempts to bind&#xA;    ;; to C-c, as is done below in mapc. The error generated by the&#xA;    ;; mapc below will be the usual&#xA;    ;; &quot;Key sequence C-c SPC starts with non-prefix key C-c&quot;&#xA;    ;;&#xA;    ;; Global-set-key will apparently bind &quot;C-c&quot; to whatever function&#xA;    ;; is named in the binding. C-hk describe-key will show that&#xA;    ;; C-c is bound to whatever function is named in the binding.&#xA;    ;; For example, here is the line that messed up my bindings:&#xA;    ;; (&quot; &quot;   completion-at-point)&#xA;    ;; C-hk would report that C-c was bound to completion-at-point.&#xA;&#xA;    (&quot;C- &quot;    this-is-no-error-but-is-undefined)&#xA;    ;; Control-C Control-SPC&#xA;    ;; This won't cause a debug error, but it won't bind anything&#xA;    ;; either. Kind of a null operation.&#xA;&#xA;    (&quot;C-SPC&quot;  kbd-likes-this-syntax)&#xA;    ;; Control-C Control-SPC&#xA;    ;; This syntax works because it is non-white.&#xA;    ))&#xA;&#xA;(dolist (pair my-prefix-pairs)&#xA;  (global-set-key (kbd (concat &quot;C-c &quot; (car pair))) (cadr pair)))&#xA;&#xA;(mapc&#xA; '(lambda (x) (global-set-key (car x) (car (cdr x))))&#xA; '(&#xA;   (&quot;\C-c &quot;     this-syntax-binds-correctly)&#xA;   ;; Control-C &quot; &quot;&#xA;   ;; This syntax has worked fine for me over many years,&#xA;   ;; with several different Emacs implementations. I tried to&#xA;   ;; convert it to use with (kbd &quot; &quot;), and lost about 12 hours&#xA;   ;; of productivity running down the problems above.&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-06-26T02:48:04.817" LastActivityDate="2016-06-26T02:48:04.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24186" PostTypeId="2" ParentId="24184" CreationDate="2016-06-26T04:14:32.980" Score="1" Body="&lt;p&gt;The help for &lt;code&gt;bs-mode&lt;/code&gt; says that &lt;kbd&gt;a&lt;/kbd&gt; toggles all buffers, and &lt;kbd&gt;+&lt;/kbd&gt; then marks an entry to display in both views.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's insufficient I can also see the variable &lt;code&gt;bs-must-always-show-regexp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can add or edit a configuration in &lt;code&gt;bs-configurations&lt;/code&gt;, which you can select via &lt;kbd&gt;c&lt;/kbd&gt; or &lt;kbd&gt;C&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-06-26T04:19:51.553" LastActivityDate="2016-06-26T04:19:51.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24187" PostTypeId="2" ParentId="24147" CreationDate="2016-06-26T06:16:58.287" Score="1" Body="&lt;p&gt;I could think of two solutions as of now,&#xA;Speedbar mode - A separate frame pop-ups with the list of files/folders related to the current project. More Info (&lt;a href=&quot;https://www.emacswiki.org/emacs/SpeedBar&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/SpeedBar&lt;/a&gt;). Comes bundled with emacs. No extra tools needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GGtags mode - Generate tags for the project in the root directory, and navigate the source using M-., M-* etc. More Info (&lt;a href=&quot;https://github.com/leoliu/ggtags&quot; rel=&quot;nofollow&quot;&gt;https://github.com/leoliu/ggtags&lt;/a&gt;). Needs to have gnu global/ctags installed but it is easy to setup.&lt;/p&gt;&#xA;" OwnerUserId="9573" LastActivityDate="2016-06-26T06:16:58.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24188" PostTypeId="2" ParentId="24077" CreationDate="2016-06-26T06:29:51.890" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Perhaps there is a dot-file that I can add to my project's root folder where I can configure settings?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. It is called &quot;Per-Directory Local Variables&quot; aka &quot;.dir-locals.el&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create a file named .dir-locals.el in the project root directory and have project specific configurations in it. More info (&lt;a href=&quot;https://www.emacswiki.org/emacs/DirectoryVariables&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/DirectoryVariables&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should put ((js-mode&#xA;(js2-basic-offset . 2))) inside the .dir-locals.el file&lt;/p&gt;&#xA;" OwnerUserId="9573" LastEditorUserId="9573" LastEditDate="2016-06-26T17:57:29.177" LastActivityDate="2016-06-26T17:57:29.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24190" PostTypeId="1" CreationDate="2016-06-26T08:29:18.087" Score="4" ViewCount="765" Body="&lt;p&gt;Does anyone know if its possible to send the bash code in a orgmode sh block and run in in a new eshell/term buffer in emacs?&#xA;for example as a use case i would like to run/eval a code block like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh&#xA;sudo pacman -Syuu&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and have the command execute within emacs in term, eshell etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is that possible?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2021-12-14T14:47:35.367" Title="send orgmode sh babel block to eshell/term in emacs?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24191" PostTypeId="1" CreationDate="2016-06-26T08:43:42.317" Score="1" ViewCount="72" Body="&lt;p&gt;I'd like to know if Emacs has an option to highlight the portions of C++ source inside .diff files generated by e.g. &lt;code&gt;git diff HEAD~1&lt;/code&gt; or &lt;code&gt;git log -p&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I have to rename my .diff file to something like .diff.cpp or just use &lt;code&gt;M+x cpp-mode&lt;/code&gt; and use regular C++ highlighting which somewhat works. Can I get that in diff mode?  &lt;/p&gt;&#xA;" OwnerUserId="12491" LastEditorUserId="105" LastEditDate="2016-06-26T13:36:14.813" LastActivityDate="2016-06-26T13:36:14.813" Title="C++ source highlight in Diff mode" Tags="|c++|diff|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24192" PostTypeId="1" CreationDate="2016-06-26T11:12:14.900" Score="1" ViewCount="59" Body="&lt;p&gt;I have an elisp script that behaves differently between an interactive Emacs session and running Emacs with &lt;code&gt;--batch&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun call-fn-in-let (unused)&#xA;  (let (xx)&#xA;    (let (yy)&#xA;      (split-string &quot;foo&quot; &quot;bar&quot; nil))))&#xA;&#xA;(with-temp-buffer&#xA;  (insert &quot;foofoofoo\nbarbarbar&quot;)&#xA;  (let ((dd (let (aa)&#xA;              (let (bb)&#xA;                (let (cc)&#xA;                  (progn (call-fn-in-let nil)))))))&#xA;    (let (ee)&#xA;      (save-excursion&#xA;        (goto-char (point-min))&#xA;        (if t&#xA;            (progn&#xA;              (move-end-of-line nil)&#xA;              (message &quot;point is: %s&quot; (point))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;M-x eval-buffer&lt;/code&gt;, then &lt;code&gt;*Messages*&lt;/code&gt; shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;point is: 10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I run Emacs from the CLI, &lt;code&gt;end-of-line&lt;/code&gt; behaves differently, jumping straight to end the of the file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -batch -l test/pyimport-test.el&#xA;point is: 20&#xA;$ emacs --version&#xA;GNU Emacs 24.5.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm mystified why this is the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the most minimal example I can find. Even removing things like &lt;code&gt;if t&lt;/code&gt; or an unused let binding, changes the &lt;code&gt;-batch&lt;/code&gt; behaviour!&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2016-06-26T21:28:25.937" LastActivityDate="2016-06-26T21:28:25.937" Title="Why does end-of-line behave differently in --batch?" Tags="|let-binding|batch-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24193" PostTypeId="1" AcceptedAnswerId="24201" CreationDate="2016-06-26T11:36:15.637" Score="0" ViewCount="90" Body="&lt;p&gt;When having a nested list which is preceded by a &lt;code&gt;#+ATTR_LATEX&lt;/code&gt;, the parent list is split into two, contrary to the expected result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example the nested list is attributed to make it inline:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage{enumitem}&#xA;&#xA;1. 111&#xA;2. 222&#xA;#+ATTR_LATEX: :environment enumerate*&#xA;  1. 333&#xA;  2. 444&#xA;3. 555&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The desired result in latex-export would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{enumerate}&#xA;\item 111&#xA;\item 222&#xA;\begin{enumerate*}&#xA;\item 333&#xA;\item 444&#xA;\end{enumerate*}&#xA;\item 555&#xA;\end{enumerate}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;White the actual result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{enumerate}&#xA;\item 111&#xA;\item 222&#xA;\end{enumerate}     %undesired%&#xA;\begin{enumerate*}&#xA;\item 333&#xA;\item 444&#xA;\end{enumerate*}&#xA;\begin{enumerate}   %undesired%&#xA;\item 555&#xA;\end{enumerate}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10460" LastActivityDate="2016-06-26T19:01:29.303" Title="How to prevent attributed nested list from splitting the parent?" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24194" PostTypeId="2" ParentId="24190" CreationDate="2016-06-26T13:00:36.787" Score="1" Body="&lt;p&gt;I use the following to send the current line or selected region to the shell associated with a given buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kdm/sh-send-line-or-region () &#xA;(interactive)&#xA;(if (use-region-p) &#xA;  (append-to-buffer (get-buffer (directory-shell-buffer-name)) (mark)(point))&#xA;  (let (p1 p2)&#xA;    (setq p1 (line-beginning-position))&#xA;    (setq p2 (line-end-position))&#xA;    (append-to-buffer (get-buffer (directory-shell-buffer-name)) p1 p2)&#xA;  ))&#xA;  (let (b)&#xA;    (setq b (get-buffer (current-buffer)))&#xA;    (switch-to-buffer-other-window (get-buffer (directory-shell-buffer-name)))&#xA;    (execute-kbd-macro &quot;\C-m&quot;)&#xA;    (switch-to-buffer-other-window b)&#xA;    )&#xA;  )&#xA;&#xA;(global-set-key &quot;\M-s&quot; 'kdm/sh-send-line-or-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-06-26T13:00:36.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24195" PostTypeId="1" AcceptedAnswerId="24205" CreationDate="2016-06-26T14:17:53.473" Score="6" ViewCount="569" Body="&#xA;&#xA;&lt;p&gt;Is there any easy way to determine the purpose of a prefix key shown in&#xA;the output of &lt;code&gt;(describe-key Chk&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I walked through my &lt;code&gt;(kbd &quot;C-x &amp;lt;key&amp;gt;&quot;)&lt;/code&gt; and &lt;code&gt;(kbd &quot;C-x C-&amp;lt;key&amp;gt;&quot;)&lt;/code&gt; combinations &#xA;to find out what they are all bound to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method worked fine, except for prefix keys. Then, the Chk output in the minibuffer&#xA;just showed the prefix keys typed so far, without saying something like &quot;Prefix key for&#xA;xxx mode&quot;, or &quot;Prefix key for register actions (C-x r).&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at the output of &lt;code&gt;describe-prefix-bindings&lt;/code&gt; too, but for prefix keys, it just&#xA;said things like this, without saying anything about the source or purpose of the prefix.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;C-x RET         Prefix Command&#xA;C-x ESC         Prefix Command&#xA;C-x 8           Prefix Command&#xA;C-x r           Prefix Command&#xA;C-x n           Prefix Command&#xA;C-x             Prefix Command&#xA;C-h 4           Prefix Command&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I find out the purpose of a Prefix Command listed in the output of &lt;code&gt;describe-bindings&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-06-27T05:29:41.860" Title="Find out the purpose of a Prefix Command listed in describe-bindings" Tags="|key-bindings|prefix-keys|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24196" PostTypeId="1" CreationDate="2016-06-26T16:21:10.230" Score="1" ViewCount="114" Body="&lt;p&gt;is there a way to auto have entries in the property drawer for tracking header creation and last change of the header? anyone using something like this?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-06-27T01:20:28.407" LastActivityDate="2016-06-27T01:20:28.407" Title="A way to auto have entries in the property drawer to to track header creation and last change of the header?" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24197" PostTypeId="1" AcceptedAnswerId="24223" CreationDate="2016-06-26T17:48:23.783" Score="0" ViewCount="922" Body="&lt;p&gt;Expected behavior (demonstrated in vim): &lt;a href=&quot;http://zc.d.pr/1a7b1/2p5XiuwX&quot; rel=&quot;nofollow&quot;&gt;http://zc.d.pr/1a7b1/2p5XiuwX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect hitting &lt;kbd&gt;Enter&lt;/kbd&gt; should indent the pointer at the correct level with two spaces in, matching the surrounding syntax, without reflowing/reformatting any previous lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actual behavior, after manually switching to &lt;code&gt;web-mode&lt;/code&gt;, since it still seems to default to &lt;code&gt;javascript-mode&lt;/code&gt;: &lt;a href=&quot;http://zc.d.pr/V73w/2yuh0MsX&quot; rel=&quot;nofollow&quot;&gt;http://zc.d.pr/V73w/2yuh0MsX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Really struggling to figure this out (I'm a vim expat giving emacs a whirl). I found these two articles:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html&quot; rel=&quot;nofollow&quot;&gt;http://codewinds.com/blog/2015-04-02-emacs-flycheck-eslint-jsx.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cyrusinnovation.com/initial-emacs-setup-for-reactreactnative/&quot; rel=&quot;nofollow&quot;&gt;http://www.cyrusinnovation.com/initial-emacs-setup-for-reactreactnative/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But still have had no luck. You can find my emacs config here: &lt;a href=&quot;https://github.com/neezer/.emacs.d/blob/master/config.org#webmode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/neezer/.emacs.d/blob/master/config.org#webmode&lt;/a&gt; (been tweaking the config so it doesn't match exactly what's in those articles). &lt;/p&gt;&#xA;" OwnerUserId="12495" LastEditorUserId="12495" LastEditDate="2016-06-27T06:16:13.013" LastActivityDate="2016-06-27T17:37:43.207" Title="How to get two space indentation for JS/JSX?" Tags="|indentation|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24198" PostTypeId="1" AcceptedAnswerId="24202" CreationDate="2016-06-26T17:53:20.333" Score="5" ViewCount="3454" Body="&lt;p&gt;When I run &lt;code&gt;list-colors-display&lt;/code&gt; I get the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DSwWW.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DSwWW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which I think is a very small subset of colors that my Emacs supports, isn't it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I know Emacs supports other colors (gray20, blue15, etc). Why am I not seeing them as a result of the &lt;code&gt;list-colors-display&lt;/code&gt; command? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I see the full list?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case it matters, my version is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;GNU Emacs 25.0.95.1 (x86_64-apple-darwin15.5.0, NS appkit-1404.47 Version 10.11.5 (Build 15F34)) of 2016-06-20&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If I evaluate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defined-colors)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;alternateSelectedControlColor&quot; &quot;alternateSelectedControlTextColor&quot; &quot;controlBackgroundColor&quot; &quot;controlColor&quot; &quot;controlDarkShadowColor&quot; &quot;controlHighlightColor&quot; &quot;controlLightHighlightColor&quot; &quot;controlShadowColor&quot; &quot;controlTextColor&quot; &quot;disabledControlTextColor&quot; &quot;gridColor&quot; &quot;headerColor&quot; ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2016-06-26T19:11:11.013" LastActivityDate="2016-06-27T11:46:47.447" Title="Getting the full list of colors available in Emacs" Tags="|colors|display|commands|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24199" PostTypeId="2" ParentId="24160" CreationDate="2016-06-26T18:23:29.807" Score="2" Body="&lt;p&gt;I've been running Emacs 22 and 24.4 on Windows 10 for years, without problems writing the init file. The doc says that Emacs searches for ~/.emacs, ~/.emacs.el, and ~/.emacs.d/init.el, in that order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Windows, ~ (the HOME environment variable) is not defined by default, so you must define it through Control Panel, System, Environment Variables, if you want to use those locations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, by default, Emacs 22 and 24 will search in /Users/name/AppData/Roaming/ for .emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do know that trying to save files to Windows (all versions) from Emacs often requires using double backslashes in the pathnames that you formulate in code. I've found that double backslashes are the only trustworthy way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer your question, I can assert:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Windows 10 is capable of .emacs filenames, you don't require _emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Windows 10 is capable of .emacs, in both HOME=/users/name/.emacs form, and in the AppData/Roaming/.emacs form. I don't like the AppData/Roaming location, because /users/name/AppData is a hidden directory on Windows, which makes it awkward to work with.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You might check to see if you have a HOME environment variable defined, and what it points to (maybe a location with bad permissions?). You might check your /users/name/AppData/Roaming/.emacs path for permissions all the way down, too. (The original post doesn't exactly specify the HOME part of the ~/ references.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This might sound awful (but it has happened to me), but you might check to see that you have exactly 1 startup file, in exactly 1 location, and that your main init file code doesn't reference or reload any other .emacs files from any other places. I use three machines (win10, win10, Mac OSX, and share almost everything through Dropbox), and when installing new versions of Emacs I sometimes end up referencing old files, in old locations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One of the handiest tips I can pass on for this particular problem is to color the background a different color in the init file, as the first line. Then if you see unexpected colors, you will know you're not picking up (or trying to write out--yes, that's happened to me too) the wrong .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my policy is to have .emacs files with only 1 line in them -- and it loads the big shared init file where I look at machine types and do machine-specific setups. That might work for you too, since then your .emacs file won't change much at all, for the life of the machine.  Only the big shared (ie, secondary) init file will be regularly modified, and that can be located anywhere you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully some of this might help. Good luck!&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-06-26T18:23:29.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24200" PostTypeId="1" CreationDate="2016-06-26T18:37:34.633" Score="1" ViewCount="62" Body="&lt;p&gt;Opening up &lt;code&gt;helm-projectile-find-file&lt;/code&gt; keeps showing me this error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://zc.d.pr/16fh0/1Ryb9GGB+&quot; rel=&quot;nofollow noreferrer&quot;&gt;screenshot http://zc.d.pr/16fh0/1Ryb9GGB+&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone know how to get rid of this? Or what's causing it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs config here: &lt;a href=&quot;https://github.com/neezer/.emacs.d/blob/master/config.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/neezer/.emacs.d/blob/master/config.org&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12495" LastActivityDate="2016-06-26T18:37:34.633" Title="&quot;stdin isn't a terminal&quot; with helm-projectile?" Tags="|helm|projectile|helm-projectile|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24201" PostTypeId="2" ParentId="24193" CreationDate="2016-06-26T19:01:29.303" Score="1" Body="&lt;p&gt;Works as expected with proper indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. 111&#xA;2. 222&#xA;  #+ATTR_LATEX: :environment enumerate*&#xA;  1. 333&#xA;  2. 444&#xA;3. 555&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-06-26T19:01:29.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24202" PostTypeId="2" ParentId="24198" CreationDate="2016-06-26T20:03:47.323" Score="2" Body="&lt;p&gt;As @lawlist and @kevin commented, this was a problem with the nightly snapshot that I used. I re-installed Emacs: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --devel  --with-cocoa --with-gnutls  --with-librsvg --with-imagemagick&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the problem went away.&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2016-06-27T11:46:47.447" LastActivityDate="2016-06-27T11:46:47.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24203" PostTypeId="1" CreationDate="2016-06-26T20:21:51.430" Score="5" ViewCount="4736" Body="&lt;p&gt;I have a text file that I want to turn into a pdf. I found org-latex-export-to-pdf so I've saved the text file as an org file and when I run the command &lt;code&gt;M-x org-latex-export-to-pdf&lt;/code&gt; I get a pdf file but I want to go more into how to customize the look of the resulting pdf. Looking at the .tex (LaTex) file I see there there is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Created 2016-06-25 Sat 00:20&#xA;\documentclass[11pt]{article}&#xA;\usepackage[utf8]{inputenc}&#xA;\usepackage[T1]{fontenc}&#xA;\usepackage{fixltx2e}&#xA;\usepackage{graphicx}&#xA;\usepackage{grffile}&#xA;\usepackage{longtable}&#xA;\usepackage{wrapfig}&#xA;\usepackage{rotating}&#xA;\usepackage[normalem]{ulem}&#xA;\usepackage{amsmath}&#xA;\usepackage{textcomp}&#xA;\usepackage{amssymb}&#xA;\usepackage{capt-of}&#xA;\usepackage{hyperref}&#xA;\author{Me}&#xA;\date{\today}&#xA;\title{}&#xA;\hypersetup{&#xA; pdfauthor={Me},&#xA; pdftitle={},&#xA; pdfkeywords={},&#xA; pdfsubject={},&#xA; pdfcreator={Emacs 24.5.3 (Org mode 8.3.4)},&#xA; pdflang={English}}&#xA;\begin{document}&#xA;&#xA;\tableofcontents&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an emacs variable for setting the documentclass part of the latex file? Setting a default for org-latex-export-to-pdf so I don't have to include the headers defined &lt;a href=&quot;http://orgmode.org/manual/Header-and-sectioning.html#Header-and-sectioning&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; My goal is mainly changing textsize, font type, taking out page numbers, space after paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Side question as well, from the looking around I see that you can install external packages such as &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/examples/article-class.html&quot; rel=&quot;noreferrer&quot;&gt;org-article&lt;/a&gt;, &lt;a href=&quot;http://emacs-fu.blogspot.com/2011/04/nice-looking-pdfs-with-org-mode-and.html&quot; rel=&quot;noreferrer&quot;&gt;XeTex then follow this blog&lt;/a&gt; but what is the bare minimum to be able to make the above changes? Are those extra packages even needed? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: The usepackage lines I'll probably have to look at later but for now I'm mainly concerned with the documentclass. To start, I've tried adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_CLASS: article&#xA;#+LATEX_CLASS_OPTIONS: [44pt]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the font size doesn't seem to change in the resulting exported pdf file though I do see this at the top of the .tex file (the text in the pdf still looks like 11pt)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Created 2016-06-26 Sun 16:31&#xA;\documentclass[44pt]{article}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="11700" LastEditDate="2016-06-26T20:35:36.053" LastActivityDate="2021-08-17T16:55:11.977" Title="How to customize org-latex-export-to-pdf?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24204" PostTypeId="2" ParentId="24195" CreationDate="2016-06-26T20:36:21.310" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The first answer is that its purpose is to act as a prefix key to the keys that follow it; that is, to serve as a keymap for a certain number of key bindings. Those bindings are also shown in &lt;code&gt;describe-key&lt;/code&gt;. &lt;em&gt;Seriously&lt;/em&gt;; this &lt;em&gt;is&lt;/em&gt; the purpose: to group those keys and their commands. Now what that grouping might be about is another question (see next).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Beyond #1, yes.  A prefix key is bound to a keymap, and that can have its own doc string.  It is up to the creator of the keymap to provide a reasonable and useful doc string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see the doc for a keymap, use &lt;strong&gt;&lt;code&gt;C-h M-k&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;describe-keymap&lt;/code&gt;), from &lt;a href=&quot;http://www.emacswiki.org/emacs/download/help-fns%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what you see for &lt;code&gt;bookmark-map&lt;/code&gt;, for example (&lt;code&gt;manuals&lt;/code&gt; here is a link to the doc in the Emacs manuals):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bookmark-map&#xA;------------&#xA;&#xA;For more information check the manuals.&#xA;&#xA;Keymap containing bindings to bookmark functions.&#xA;It is not bound to any key by default: to bind it&#xA;so that you have a bookmark prefix, just use `global-set-key' and bind a&#xA;key of your choice to `bookmark-map'.  All interactive bookmark&#xA;functions have a binding in this keymap.&#xA;&#xA;key             binding&#xA;---             -------&#xA;&#xA;d               bookmark-delete&#xA;e               edit-bookmarks&#xA;f               bookmark-insert-location&#xA;g               bookmark-jump&#xA;i               bookmark-insert&#xA;j               bookmark-jump&#xA;l               bookmark-load&#xA;m               bookmark-set&#xA;o               bookmark-jump-other-window&#xA;r               bookmark-rename&#xA;s               bookmark-save&#xA;w               bookmark-write&#xA;x               bookmark-set&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But some keymaps have a more rudimentary doc string. The keymap &lt;code&gt;ctl-x-map&lt;/code&gt;, for instance, is general-purpose, so there is not much that can be said (beyond #1 above).  This is what you get with &lt;code&gt;C-h M-k ctl-x-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ctl-x-map&#xA;---------&#xA;&#xA;For more information check the manuals.&#xA;&#xA;Default keymap for C-x commands.&#xA;The normal global definition of the character C-x indirects to this keymap.&#xA;&#xA;key             binding&#xA;---             -------&#xA;&#xA;C-@             pop-global-mark&#xA;C-b             list-buffers&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, the doc string essentially just repeats #1 above: &lt;code&gt;Default keymap for C-x commands.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Wrt your comment: Non-interactively, the argument to &lt;code&gt;describe-keymap&lt;/code&gt; can be a keymap object instead of the name of a keymap variable. &lt;code&gt;C-h f describe-keymap&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;describe-keymap is an interactive Lisp function in `help-fns+.el'.&#xA;&#xA;It is bound to C-h M-k, f1 M-k, help M-k, menu-bar help-menu describe&#xA;describe-keymap.&#xA;&#xA;(describe-keymap KEYMAP &amp;amp;optional SEARCH-SYMBOLS-P)&#xA;&#xA;For more information check the manuals.&#xA;&#xA;Describe key bindings in KEYMAP.&#xA;Interactively, prompt for a variable that has a keymap value.&#xA;Completion is available for the variable name.&#xA;&#xA;Non-interactively:&#xA;* KEYMAP can be such a keymap variable or a keymap.&#xA;* Non-nil optional arg SEARCH-SYMBOLS-P means that if KEYMAP is not a&#xA;  symbol then search all variables for one whose value is KEYMAP.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-06-27T05:29:41.860" LastActivityDate="2016-06-27T05:29:41.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24205" PostTypeId="2" ParentId="24195" CreationDate="2016-06-26T20:43:56.613" Score="6" Body="&lt;p&gt;In most cases, you can type the prefix and then &lt;kbd&gt;C-h&lt;/kbd&gt; to get a list of all the bindings that begin with that prefix.  This won't directly tell you what the prefix &lt;em&gt;means&lt;/em&gt; and not all prefixes have a specific generic purpose.  But, you may be able to tell from the set of functions what the commonality is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason it's &quot;in most cases&quot; is that &lt;em&gt;if the prefix defines something for &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;/em&gt;, that's what will be called (most don't define it, but some do).  There's a generic handler for all prefixes that don't otherwise define &lt;kbd&gt;C-h&lt;/kbd&gt; that does the listing.  So, you may want to type it in some innocuous place, or try &lt;kbd&gt;C-h c&lt;/kbd&gt; on it first.&lt;/p&gt;&#xA;" OwnerUserId="11699" LastActivityDate="2016-06-26T20:43:56.613" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24206" PostTypeId="1" CreationDate="2016-06-26T20:54:22.157" Score="5" ViewCount="810" Body="&lt;p&gt;I'm struggling to run fzf in emacs but cannot figure out whats my problem. When I run fzf - and start typing - text gets mess up, similar to this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lG7iE.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lG7iE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;I tried run fzf in term, eshell, ansi-term, multi-term modes, with and without --color=no option, its all the same. Does anyone knows what is my problem could be? Thx.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2017-06-20T05:16:27.690" Title="FZF broken displaying in emacs terminal" Tags="|shell|eshell|ansi-term|term|multi-term|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24207" PostTypeId="1" AcceptedAnswerId="24211" CreationDate="2016-06-26T22:31:05.587" Score="0" ViewCount="625" Body="&lt;p&gt;I have remapped the &lt;code&gt;evil-normal-state&lt;/code&gt; command bound to &lt;code&gt;ESC&lt;/code&gt; in Evil Insert mode to &lt;code&gt;C-o&lt;/code&gt; since the escape key is more difficult to reach on my keyboard than typing &lt;code&gt;C-o&lt;/code&gt;. Now I want to use the original meaning of the &lt;code&gt;ESC&lt;/code&gt; key as a prefix key instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;ESC&quot;) 'ESC-prefix)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it does not work.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2016-06-26T22:59:15.333" LastActivityDate="2016-06-27T05:48:26.363" Title="How to revert evil insert state binding of the escape key?" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24208" PostTypeId="2" ParentId="24203" CreationDate="2016-06-27T02:15:27.233" Score="5" Body="&lt;p&gt;The &lt;code&gt;\documentclass&lt;/code&gt; part of the export is controlled by: &lt;code&gt;org-latex-classes&lt;/code&gt;, &lt;code&gt;org-latex-default-class&lt;/code&gt; and the class specified in the org file using &lt;code&gt;#+LATEX_CLASS&lt;/code&gt;.  Only classes listed in &lt;code&gt;org-latex-classes&lt;/code&gt; can be used in &lt;code&gt;org-latex-default-class&lt;/code&gt; or &lt;code&gt;#+LATEX_CLASS&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The class options are given in the second element of each &lt;code&gt;org-latex-classes&lt;/code&gt; entry.  If you want to add more classes you can modify the existing entries, changing only the class name and options.  &lt;code&gt;amsart&lt;/code&gt; is a common alternative to &lt;code&gt;article&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional packages can be added to &lt;code&gt;org-latex-packages-alist&lt;/code&gt; to have them included in every export.  In my opinion it is better not to modify this, as it hurts the portability of all your documents.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-06-27T02:15:27.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24209" PostTypeId="1" AcceptedAnswerId="24212" CreationDate="2016-06-27T03:46:52.680" Score="1" ViewCount="1155" Body="&lt;p&gt;I want to open a large file in the server environment with emacs, but there is error: Memory exhausted--use C-x s then exit and restart Emacs as shown in the following figure.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/TR6DI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TR6DI.png&quot; alt=&quot;open the large file with emacs&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/zLnMV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zLnMV.png&quot; alt=&quot;emacs error information&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please know that I intend to open the file with emacs in the server environment. The Linux is Centos. If your guys know this issue, please tell me in detail, use the figure to explain is the best. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12499" LastEditorUserId="105" LastEditDate="2016-06-27T05:31:00.267" LastActivityDate="2016-06-27T08:31:27.407" Title="Emac to open a large file error: Memory exhausted--use C-x s then exit and restart Emacs" Tags="|files|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24210" PostTypeId="1" AcceptedAnswerId="24437" CreationDate="2016-06-27T05:39:40.453" Score="3" ViewCount="324" Body="&lt;p&gt;I've just started to use Flycheck to improve the quality of my code, and I am grateful that it is helping me to do that by pointing out assignments to free variables, and by identifying possibly undefined functions on the last line of the error display. (Actually, these two are Warnings, not errors.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to see no warnings in my error display, of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there a way for me to tell Flycheck about the global variables that I use on my project, and that I reference in multiple files?  I have the appropriate defvar statements in one file, but not in all files. And I don't want to put defvar statements in every file that references them (I think, unless that's really the proper Emacs Lisp way...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And is there a way for me to tell Flycheck about all the functions (which are defined in other files) that I reference in many files? That way only the truly undefined functions will show up in the last line of the Flycheck output. (I have so many that I don't usually want to flog through the long list of functions that I already know are defined, just to find ones that are possibly not defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at the Flycheck manual on the home website, but it said nothing about this sort of thing. Neither could I see any sort of config variables for Lisp &quot;include&quot; or &quot;prefix&quot; files where I could point Flycheck to the file containing all my defvar statements...&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-06-28T16:21:02.920" LastActivityDate="2016-07-09T04:54:14.190" Title="Tell Flycheck about my global variables across multiple files?" Tags="|flycheck|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24211" PostTypeId="2" ParentId="24207" CreationDate="2016-06-27T05:48:26.363" Score="1" Body="&lt;p&gt;&lt;code&gt;ESC&lt;/code&gt; is the escape character, &lt;code&gt;&amp;lt;escape&amp;gt;&lt;/code&gt; is the symbol generated by pressing the ESC key &lt;strong&gt;in X&lt;/strong&gt;. The escape character is generated when pressing something key together with the meta-key like &lt;code&gt;M-x&lt;/code&gt;, that actually generates two key events, first the ESC event, second the &lt;code&gt;x&lt;/code&gt;. (actually, that's only true in terminal mode since in X &lt;code&gt;M-x&lt;/code&gt; generates a special event, but this event is mapped to &lt;code&gt;ESC x&lt;/code&gt;). The problem is that in terminal mode the escape key does not generate &lt;code&gt;&amp;lt;escape&amp;gt;&lt;/code&gt; but also &lt;code&gt;ESC&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, in order to have the escape key working correctly in terminal, Evil has to catch the ESC event and possibly translate it to &lt;code&gt;&amp;lt;escape&amp;gt;&lt;/code&gt; after some timeout (otherwise either bindings like &lt;code&gt;M-x&lt;/code&gt; or leaving insert state with &lt;code&gt;ESC&lt;/code&gt; would not work). In other words, the event &lt;code&gt;ESC&lt;/code&gt; typically never reaches those keymaps because it is translated to &lt;code&gt;&amp;lt;escape&amp;gt;&lt;/code&gt; before. The variable &lt;code&gt;evil-intercept-esc&lt;/code&gt; can be used to customize this behavior (but only in newly created frames).&lt;/p&gt;&#xA;" OwnerUserId="7211" LastActivityDate="2016-06-27T05:48:26.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24212" PostTypeId="2" ParentId="24209" CreationDate="2016-06-27T08:31:27.407" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/m00natic/vlfi&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;vlf&lt;/code&gt;&lt;/a&gt; package can help here. The acronym stands for &quot;Very Large Files&quot;, and it enables you to open such files in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install it from GNU ELPA via the package manager:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;package-install&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;vlf&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without a clever library like that, Emacs would &lt;em&gt;not&lt;/em&gt; be a good choice of tool for inspecting such a massive file. Emacs normally loads a copy of the whole file into memory, and it was just never intended to process files as large as that. &lt;code&gt;vlf&lt;/code&gt; facilitates it by only having &lt;em&gt;parts&lt;/em&gt; of the file loaded into the Emacs buffer at any given time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a final note, you say this is a log file? You might consider implementing a &lt;a href=&quot;https://en.wikipedia.org/wiki/Log_rotation&quot; rel=&quot;nofollow&quot;&gt;log rotation&lt;/a&gt; strategy in order to limit the possible size of any given log file. If your logs are never allowed to reach that kind of size, you will not run into problems when you try to open them.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-06-27T08:31:27.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24213" PostTypeId="1" CreationDate="2016-06-27T11:34:56.257" Score="3" ViewCount="1420" Body="&lt;p&gt;I have a table in Org mode that looks as shown below  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;| S.No. | Template       | V800A | V800B |&#xA;|-------+----------------+-------+-------|&#xA;|    1. | IFD03B         |    17 |     8 |&#xA;|    2. | Calcs          |     5 |     5 |&#xA;|    3. | ALM_4S_AX04B   |    20 |    16 |&#xA;|    4. | ALM_DX05B      |     7 |     2 |&#xA;|    5. | ALM_1S_HZD05B  |     2 |     1 |&#xA;|    6. | ALM_RERING03B  |     4 |     4 |&#xA;|    7. | ALM_DI_DO05B   |    17 |    16 |&#xA;|    8. | IS04B          |     2 |     2 |&#xA;|    9. | Step06B        |    12 |    14 |&#xA;|   10. | DO_INDEPEND06B |     8 |     8 |&#xA;|   11. | AO_PID13_01B   |     5 |     5 |&#xA;|-------+----------------+-------+-------|&#xA;|       | Total          |    99 |    81 |  &#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I paste this content within MS Outlook or MS Excel it looks as shown below.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/usO2U.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/usO2U.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does this behave in such a manner and what should I do to fix this?&lt;br&gt;&#xA;Presently, I'm using &lt;code&gt;Text to Columns&lt;/code&gt; option (in MS Excel) to convert this into a table and deleting the &lt;code&gt;|&lt;/code&gt; and it makes a clean excel table.&lt;br&gt;&#xA;For Outlook, I do not have such options to exercise.&lt;br&gt;&#xA;Are there any settings to be made into Emacs to fix this?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S:  I'm on Windows 7 with Emacs 24.5.1 installed. I will attempt this on Ubuntu (+open office) and update the question later.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="253" LastEditDate="2016-06-27T13:35:59.487" LastActivityDate="2023-07-11T18:54:25.127" Title="Copying and pasting org tables misaligned?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24214" PostTypeId="2" ParentId="24213" CreationDate="2016-06-27T13:35:12.287" Score="2" Body="&lt;p&gt;The problem is that &lt;code&gt;org&lt;/code&gt; is using space characters for whitespace in the table, and is assuming that you're using a monospace font.  If you look closely at your screenshot, you can see that it's using a non-monospace font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your simplest option to cut-and-paste into something like Outlook or Word would be to select the pasted table and change it's font to something monospaced, such as Courier New.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-06-27T13:35:12.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24215" PostTypeId="1" CreationDate="2016-06-27T13:37:38.047" Score="2" ViewCount="584" Body="&lt;p&gt;I am very new to Emacs and I am discovering the functionality of &quot;generic-mode&quot; for the first time.  I am trying to add a generic-mode to create basic syntax highlighting for an obscure programming language that I use.  It's very simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; BEGIN mtl-mode&#xA;(define-generic-mode&#xA;    ;; name of mode&#xA;    'mtl-mode&#xA;    ;; comments&#xA;    ;; '(&quot;(*&quot; . &quot;\*)&quot;) Opening comment is (* closing is *) but not sure how to do it!&#xA;    nil&#xA;    ;; keyword list&#xA;    '(&quot;ACV&quot; &quot;CONTACT&quot; &quot;DISCHARGE&quot; &quot;FOR&quot; &quot;MODULE&quot; &quot;REPEAT&quot; &quot;TESTMACRO&quot;&#xA;      &quot;TRANSF&quot; &quot;WITH&quot; &quot;BITS&quot; &quot;CONTINUE&quot; &quot;ELSE&quot; &quot;IF&quot; &quot;OPTO&quot; &quot;RES&quot;&#xA;      &quot;TESTPINS&quot; &quot;TYPEOF&quot; &quot;ZENER&quot; &quot;BREAK&quot; &quot;DCI&quot; &quot;IND&quot; &quot;PATGEN&quot;&#xA;      &quot;RETURN&quot; &quot;TESTMODULE&quot; &quot;UNTIL&quot; &quot;CAP&quot; &quot;DCV&quot; &quot;EXIT&quot; &quot;LED&quot; &quot;PIN&quot;&#xA;      &quot;TRACK&quot; &quot;CASE&quot; &quot;DIODE&quot; &quot;FET&quot; &quot;LINK&quot; &quot;PULSE&quot; &quot;TESTBLOCK&quot; &quot;TRAN&quot;&#xA;      &quot;WHILE&quot; &quot;PRINTF&quot; &quot;FFLUSH&quot; &quot;STDOUT&quot;&#xA;      )&#xA;    ;; font-lock list&#xA;    '()&#xA;    ;; auto-mode list&#xA;    '(&quot;.*mtl&quot;)&#xA;    ;; function list&#xA;    nil&#xA;    ;; documentation&#xA;    &quot;Mode for editing Aeroflex ICT MTL files&quot;)&#xA;;; END mtl-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine for a start, but the keywords are not actually case sensitive in MTL.  Is there a way to specify that they should not be treated as such? Or do I have to add separate keyword cases to the list for each common possibility (e.g. &quot;WHILE&quot; &quot;while&quot;)&lt;/p&gt;&#xA;" OwnerUserId="12230" LastActivityDate="2020-03-04T23:51:26.183" Title="Is it possible to create case-insensitive keywords in a generic-mode?" Tags="|syntax-highlighting|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24216" PostTypeId="2" ParentId="24210" CreationDate="2016-06-27T14:06:51.927" Score="3" Body="&lt;p&gt;For global variables, use &lt;code&gt;(defvar foo)&lt;/code&gt; (with no initial value).  See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Compiler-Errors.html&quot; rel=&quot;nofollow&quot;&gt;Compiler Errors&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For functions, use &lt;code&gt;(declare foo &quot;myfile.el&quot;)&lt;/code&gt;. See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Declaring-Functions.html&quot; rel=&quot;nofollow&quot;&gt;Declaring Functions&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-06-27T14:06:51.927" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="24217" PostTypeId="2" ParentId="24215" CreationDate="2016-06-27T14:24:24.407" Score="3" Body="&lt;p&gt;Font-lock provides a variable, &lt;code&gt;font-lock-keywords-case-fold-search&lt;/code&gt;, that controls whether keywords should be seen as case sensitive or not:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil means the patterns in &lt;code&gt;font-lock-keywords&lt;/code&gt; are case-insensitive.&#xA;  This is set via the function &lt;code&gt;font-lock-set-defaults&lt;/code&gt;, based on&#xA;  the CASE-FOLD argument of &lt;code&gt;font-lock-defaults&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Normally, when you add font-lock keywords the normal way (using &lt;code&gt;font-lock-defaults&lt;/code&gt;), you can specify it there. Using &lt;code&gt;define-generic-mode&lt;/code&gt; you don't have that option. Check if you can add a specific font-lock setup function in the &quot;function list&quot; to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have some keywords that are case sensitive and some that are not, things get more complicated. In that case you would have to replace some font-lock keywords regexp:s with your own search functions, that bind &lt;code&gt;case-fold-search&lt;/code&gt; and do the search using, for example, &lt;code&gt;search-forward-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-06-27T14:24:24.407" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24219" PostTypeId="2" ParentId="24213" CreationDate="2016-06-27T14:55:59.553" Score="4" Body="&lt;p&gt;You probably want to use &lt;code&gt;org-table-export&lt;/code&gt; which will take the table under the point and export it to a Tab separated file (which is then easy to copy and paste into excel).&lt;/p&gt;&#xA;&lt;p&gt;You could try wrapping it for convenience. For example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-table-as-tsv ()&#xA;(interactive)&#xA;(unless (org-at-table-p)&#xA;(user-error &amp;quot;No table at point&amp;quot;))&#xA;(let ((table (org-table-to-lisp&#xA;    (buffer-substring-no-properties (org-table-begin)  (org-table-end)))))&#xA;(kill-new (orgtbl-to-tsv table '()))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12147" LastEditorUserId="13752" LastEditDate="2023-07-11T18:54:25.127" LastActivityDate="2023-07-11T18:54:25.127" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="24220" PostTypeId="1" AcceptedAnswerId="24222" CreationDate="2016-06-27T15:10:24.263" Score="0" ViewCount="783" Body="&lt;p&gt;I'm using &lt;code&gt;multi-term&lt;/code&gt; right now in GUI cocoa emacs on OSX, and it works great in general. However, I'm running into a bit of an issue with my &lt;code&gt;TERM&lt;/code&gt; variable. I generally set it to &lt;code&gt;xterm-256color&lt;/code&gt; for iterm, but that causes odd behavior with terminal apps like htop in emacs &lt;code&gt;multi-term&lt;/code&gt;. However, htop and other terminal apps work perfectly in &lt;code&gt;multi-term&lt;/code&gt; when &lt;code&gt;TERM&lt;/code&gt; is set to &lt;code&gt;eterm-color&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result, I'm wondering if there is any way for me to have &lt;code&gt;xterm-256color&lt;/code&gt; as the default coded in my .bash_profile, but have emacs automatically run &lt;code&gt;TERM=eterm-color&lt;/code&gt; or a similar command when starting a new multi-term?&lt;/p&gt;&#xA;" OwnerDisplayName="user12502" LastActivityDate="2018-11-12T23:17:46.623" Title="Set specific TERM variable for only emacs terminals" Tags="|colors|term|multi-term|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24221" PostTypeId="1" CreationDate="2016-06-27T15:12:04.100" Score="0" ViewCount="48" Body="&lt;p&gt;I configured Gnus to fetch mails from gmail account, and it works well, I can send and receive messages. However, one thing I'd like to improve is ability to add &lt;code&gt;C-u 5 M-x gnus-group-list-all-groups&lt;/code&gt; command in my ~/.gnus so that I don't need to press the key combination every time I run Gnus. What should I add in config file to achieve this? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="12503" LastActivityDate="2016-07-01T16:05:06.397" Title="Emacs/Gnus 24.3 -- invisible groups" Tags="|gnus|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24222" PostTypeId="2" ParentId="24220" CreationDate="2016-06-27T17:31:22.077" Score="1" Body="&lt;p&gt;Terminals run inside of emacs set an environment variable, &lt;code&gt;INSIDE_EMACS&lt;/code&gt;, so you can test that inside of your &lt;code&gt;.bash_profile&lt;/code&gt; or &lt;code&gt;.bashrc&lt;/code&gt; to set the &lt;code&gt;TERM&lt;/code&gt; to something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(BTW on my system, &lt;code&gt;multi-term&lt;/code&gt; seems to be setting &lt;code&gt;TERM&lt;/code&gt; to &lt;code&gt;eterm-color&lt;/code&gt; automatically…)&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-06-27T17:31:22.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24223" PostTypeId="2" ParentId="24197" CreationDate="2016-06-27T17:37:43.207" Score="2" Body="&lt;p&gt;While in web mode, check the variables you've set by using &lt;code&gt;M-: web-mode-code-indent-offset&lt;/code&gt;. Is it 2 or 4?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your config is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package web-mode&#xA;  :ensure t&#xA;  :config&#xA;    '(setq web-mode-code-indent-offset 2)&#xA;    '(setq web-mode-markup-indent-offset 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe you're not supposed to quote those. Try this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package web-mode&#xA;  :ensure t&#xA;  :config&#xA;    (progn&#xA;      (setq web-mode-code-indent-offset 2)&#xA;      (setq web-mode-markup-indent-offset 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-06-27T17:37:43.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24224" PostTypeId="2" ParentId="20569" CreationDate="2016-06-27T17:41:44.567" Score="2" Body="&lt;p&gt;By default, org-journal uses a second window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom org-journal-find-file 'find-file-other-window&#xA;  &quot;The function to use when opening an entry. Set this to `find-file` if you don't want org-journal to split your window.&quot;&#xA;  :type 'function :group 'org-journal)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try setting that variable to &lt;code&gt;find-file&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-journal-find-file #'find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-06-27T17:41:44.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24226" PostTypeId="1" CreationDate="2016-06-27T19:49:29.630" Score="2" ViewCount="211" Body="&lt;p&gt;I wrote a terminal output to a plain text file and opened it in Emacs, and I see &quot;^[&quot; here and there. I'd like to change it to tabs in terminal before writing its output to the file, but I don't know how to refer to them. What does &quot;^[&quot; represent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They have &quot;[1m&quot; or &quot;[4m&quot; right after them.&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-06-27T21:53:41.763" LastActivityDate="2016-06-27T22:52:16.903" Title="What does &quot;^[&quot; represent?" Tags="|highlighting|characters|escape|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24228" PostTypeId="2" ParentId="24226" CreationDate="2016-06-27T20:11:00.257" Score="0" Body="&lt;p&gt;It turned out that they were color codes in Terminal. I managed to get rid of them by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sed -r &quot;s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed&quot; rel=&quot;nofollow&quot;&gt;http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-06-27T20:11:00.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24229" PostTypeId="1" AcceptedAnswerId="24416" CreationDate="2016-06-27T20:12:12.513" Score="5" ViewCount="635" Body="&lt;p&gt;Both of the following work to call a graphical/terminal eshell:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs -f eshell&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs -nw -f eshell&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Furthermore, this 2-step process also works:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;`emacsclient -t -a '' /some/real/file/name&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;Meta&lt;/kbd&gt;&lt;kbd&gt;x&lt;/kbd&gt; &lt;code&gt;eshell&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;BUT&lt;/em&gt;, this does not:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;emacsclient -t -a '' -f eshell&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and fails with this error after lots of normal startup messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: server did not start correctly&#xA;Error: Could not start the Emacs daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Note: On my system, I use &lt;code&gt;alias edt=&quot;emacsclient -t -a ''&lt;/code&gt; to make sure that I always end up in a daemon-backed emacs session server&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I, in one command,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;launch &lt;code&gt;emacsclient&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;launch and display a new &lt;code&gt;eshell&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;OR display an existing &lt;code&gt;eshell&lt;/code&gt; frame?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;If I could also suppress the top 2 &quot;Welcome to EShell&quot; lines, that would also be useful&lt;/sub&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I found this way of launching emacs with eval:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacsclient -t -a '' --eval '(eshell)'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, but this &lt;em&gt;always&lt;/em&gt; selects the pre-existing eshell. How would I then get a &quot;new&quot; one?&lt;/p&gt;&#xA;" OwnerUserId="12504" LastEditorUserId="12504" LastEditDate="2016-06-27T20:20:47.597" LastActivityDate="2016-07-07T02:04:00.580" Title="emacsclient directly start eshell command command line" Tags="|eshell|emacsclient|customize|command-line-arguments|emacs-daemon|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24230" PostTypeId="1" CreationDate="2016-06-27T21:47:44.720" Score="0" ViewCount="262" Body="&lt;p&gt;Is there an emacs library for managing packages on Ubuntu,&#xA;ie an emacs based alternative to &lt;code&gt;synaptic&lt;/code&gt; and &lt;code&gt;aptitude&lt;/code&gt;?&#xA;Presumably this would be an elisp wrapper around &lt;code&gt;apt&lt;/code&gt;, &lt;code&gt;dpkg&lt;/code&gt; and friends&#xA;and look something like the &lt;code&gt;packages&lt;/code&gt; interface ELPA.&lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="2706" LastEditDate="2016-06-27T22:00:39.707" LastActivityDate="2016-06-27T23:58:14.217" Title="emacs interface to ubuntu package management (apt, dpkg)" Tags="|package|linux|libraries|ubuntu|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24231" PostTypeId="2" ParentId="24226" CreationDate="2016-06-27T21:52:18.040" Score="1" Body="&lt;p&gt;&lt;code&gt;^[&lt;/code&gt; is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Escape_character&quot; rel=&quot;nofollow&quot;&gt;ASCII escape character&lt;/a&gt;, aka &lt;code&gt;ESC&lt;/code&gt;. It is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;octal: &lt;code&gt;\033&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;hexadecimal: &lt;code&gt;\x1B&lt;/code&gt; or &lt;code&gt;^[&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;decimal: &lt;code&gt;27&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The color codes (and other control codes) you mention each begin with the ASCII escape character.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-06-27T21:52:18.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24232" PostTypeId="1" CreationDate="2016-06-27T22:40:31.560" Score="0" ViewCount="52" Body="&lt;p&gt;How do I get Org-mode do this, similar to gmail's tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;** Header 1&#xA;*** Under header 1&#xA;*** Under header 1 and 2&#xA;    This content is synchronised&#xA;** Header 2&#xA;*** Under header 1 and 2&#xA;    This content is synchronised&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I edit anything under &lt;code&gt;Under header 1 and 2&lt;/code&gt;, then every instance of it should be changed, no matter where I edit it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usage case:  Large categorised list of items that sometimes fall under multiple categories.  Need to be able to find the item in any of its categories.&lt;/p&gt;&#xA;" OwnerUserId="2065" LastActivityDate="2016-06-27T22:40:31.560" Title="Org file with tag system like gmail, with item under multiple headers synchronised" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24233" PostTypeId="2" ParentId="24226" CreationDate="2016-06-27T22:52:16.903" Score="1" Body="&lt;p&gt;Characters represented with &lt;code&gt;^&lt;/code&gt; followed by another character (an uppercase letter or one of &lt;code&gt;@[\]^_?&lt;/code&gt;), with both characters in a different color (depending on the color scheme), are &lt;a href=&quot;https://en.wikipedia.org/wiki/Control_character&quot; rel=&quot;nofollow noreferrer&quot;&gt;control characters&lt;/a&gt;. &lt;code&gt;^[&lt;/code&gt; is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Escape_character#ASCII_escape_character&quot; rel=&quot;nofollow noreferrer&quot;&gt;escape character&lt;/a&gt;. You can get more information by pressing &lt;code&gt;C-x =&lt;/code&gt; (&lt;code&gt;what-cursor-position&lt;/code&gt;) while the cursor is on the character and even more information with &lt;code&gt;C-u C-x =&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, in output meant for a terminal, the escape character starts an &lt;a href=&quot;https://en.wikipedia.org/wiki/Escape_sequence&quot; rel=&quot;nofollow noreferrer&quot;&gt;escape sequence&lt;/a&gt;, specifically an &lt;a href=&quot;https://en.wikipedia.org/wiki/ANSI_escape_sequences&quot; rel=&quot;nofollow noreferrer&quot;&gt;ANSI escape sequence&lt;/a&gt; which is how the application tells the terminal to do something other than “display this character at the cursor location and move one position to the right”. Specifically, &lt;code&gt;^[[…m&lt;/code&gt; (also known as “CSI … m” because the two-character sequence &lt;code&gt;^[[&lt;/code&gt; is known as &lt;a href=&quot;https://en.wikipedia.org/wiki/ANSI_escape_sequences#CSI_codes&quot; rel=&quot;nofollow noreferrer&quot;&gt;CSI&lt;/a&gt;) change the text attributes for subsequet output. &lt;code&gt;^[[1m&lt;/code&gt; turns bold on, &lt;code&gt;^[[4m&lt;/code&gt; turns underline on, and &lt;code&gt;^[[0m&lt;/code&gt; turns all attributes off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing those characters to tabs makes no sense whatsoever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;https://unix.stackexchange.com/questions/14684/removing-control-chars-including-console-codes-colours-from-script-output/14707#14707&quot;&gt;this script&lt;/a&gt; to remove most terminal escape sequences.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-06-27T22:52:16.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24234" PostTypeId="2" ParentId="20417" CreationDate="2016-06-27T23:14:52.527" Score="2" Body="&lt;p&gt;Based on the coderef label syntax I use a &lt;code&gt;(hl:line)&lt;/code&gt; pseudo label that gets replaced by an org-export-filter afunction. Referenced lines are wrapped in a &lt;code&gt;div&lt;/code&gt; with a style attribute:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-html-hl-line (src backend info)&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (replace-regexp-in-string&#xA;     &quot;\\([^\n]+\\)(hl:line)\n&quot;&#xA;     &quot;&amp;lt;div style=\&quot;background-color: rgb(248, 238, 199);\&quot;&amp;gt;\\1\n&amp;lt;/div&amp;gt;&quot; src)))&#xA;&#xA;(add-to-list 'org-export-filter-src-block-functions&#xA;             'org-html-hl-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that labels have to be at the end of the line as shown in the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(functionp &amp;amp;rest form)           (hl:line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2016-06-28T05:31:12.653" LastActivityDate="2016-06-28T05:31:12.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24235" PostTypeId="2" ParentId="24230" CreationDate="2016-06-27T23:58:14.217" Score="1" Body="&lt;p&gt;A search for &quot;emacs apt wrapper&quot; revealed &lt;a href=&quot;https://github.com/xwl/ga&quot; rel=&quot;nofollow&quot;&gt;https://github.com/xwl/ga&lt;/a&gt;, &quot;generic apt(from Debian GNU/Linux) like wrapper over various package management tools&quot;. Another result was &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsForDebian&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/EmacsForDebian&lt;/a&gt;, which has even more options. &lt;/p&gt;&#xA;" OwnerUserId="12505" LastActivityDate="2016-06-27T23:58:14.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24236" PostTypeId="1" AcceptedAnswerId="24243" CreationDate="2016-06-28T00:00:35.747" Score="2" ViewCount="450" Body="&lt;p&gt;Is these a function that behaves like &lt;code&gt;file-truename&lt;/code&gt; on local files, but does not add the &lt;code&gt;/protocol:host:&lt;/code&gt; prefix on remote files?&#xA;Currently if I run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file-truename &quot;./file.ext&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while in a remote directory, I get &lt;code&gt;&quot;/ssh:host:/remote/path/file.ext&quot;&lt;/code&gt;. but&#xA;I just want  &lt;code&gt;&quot;/remote/path/file.ext&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that I am asking is that pdf export in org-mode does not work on remote file for me. I have tracked the problem down to the call&#xA;&lt;code&gt;(org-latex-compile &quot;./myfile.org&quot;)&lt;/code&gt;&#xA;which uses &lt;code&gt;file-truename&lt;/code&gt; to produce the actual file name that is supplied to the latex shell call. This causes problems on remote files because the tramp prefix is included in the shell call. I would like to write a patch for this.&lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="2706" LastEditDate="2016-06-28T00:18:26.383" LastActivityDate="2016-06-28T07:52:33.800" Title="file-truename and tramp" Tags="|org-mode|org-export|tramp|filenames|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24237" PostTypeId="1" CreationDate="2016-06-28T00:26:39.723" Score="3" ViewCount="1143" Body="&lt;p&gt;If I have outline structure like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Tasks&#xA;** First&#xA;** Second&#xA;** Third&#xA;** etc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is there a simple way to turn all tasks into TODO items or checkboxes? I can of course use &lt;code&gt;replace-string&lt;/code&gt; but maybe there's already a keybinding, since maybe it's seems to be done quite often?&lt;/p&gt;&#xA;" OwnerUserId="8992" LastActivityDate="2016-07-03T18:07:57.267" Title="Convert outline into todos/checkboxes" Tags="|org-mode|spacemacs|todo|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24238" PostTypeId="2" ParentId="22583" CreationDate="2016-06-28T00:34:09.957" Score="3" Body="&lt;p&gt;If you use evil-mode, you can install &lt;a href=&quot;https://github.com/redguardtoo/evil-matchit&quot; rel=&quot;nofollow&quot;&gt;https://github.com/redguardtoo/evil-matchit&lt;/a&gt; and press &lt;code&gt;%&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you prefer original Emacs,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(autoload 'sgml-skip-tag-backward &quot;sgml-mode&quot; nil t)&#xA;(autoload 'sgml-skip-tag-forward &quot;sgml-mode&quot; nil t)&#xA;(defun html-get-tag ()&#xA;  (let ((b (line-beginning-position))&#xA;        (e (line-end-position))&#xA;        (looping t)&#xA;        (html-tag-char (string-to-char &quot;&amp;lt;&quot;))&#xA;        (char (following-char))&#xA;        (p (point))&#xA;        (found_tag -1))&#xA;&#xA;    (save-excursion&#xA;      ;; search backward&#xA;      (unless (= char html-tag-char)&#xA;        (while (and looping (&amp;lt;= b (point)) (not (= char 60)))&#xA;          (setq char (following-char))&#xA;          (setq p (point))&#xA;          (if (= p (point-min))&#xA;              ;; need get out of loop anyway&#xA;              (setq looping nil)&#xA;            (backward-char))))&#xA;&#xA;      ;; search forward&#xA;      (if (not (= char html-tag-char))&#xA;          (save-excursion&#xA;            (while (and (&amp;gt;= e (point)) (not (= char 60)))&#xA;              (setq char (following-char))&#xA;              (setq p (point))&#xA;              (forward-char))))&#xA;&#xA;      ;; is end tag?&#xA;      (when (and (= char html-tag-char) (&amp;lt; p e))&#xA;        (goto-char p)&#xA;        (forward-char)&#xA;        (if (= (following-char) 47)&#xA;            (progn&#xA;              ;; &amp;lt;/&#xA;              (skip-chars-forward &quot;^&amp;gt;&quot;)&#xA;              (forward-char)&#xA;              (setq p (point))&#xA;              (setq found_tag 1))&#xA;          (progn&#xA;            ;; &amp;lt; , looks fine&#xA;            (backward-char)&#xA;            (setq found_tag 0)))))&#xA;    found_tag))&#xA;&#xA;(defun html-jump(&amp;amp;optional num)&#xA;  &quot;Jump forward from html open tag&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (unless num (setq num 1))&#xA;  ;; web-mode-forward-sexp is assigned to forward-sexp-function&#xA;  ;; it's buggy in web-mode v11, here is the workaround&#xA;  (let ((backup-forward-sexp-function forward-sexp-function))&#xA;    (if (= (html-get-tag) 0)&#xA;        (sgml-skip-tag-forward num)&#xA;      (sgml-skip-tag-backward num))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage: &lt;code&gt;M-x html-jump&lt;/code&gt;, it works in any html related major mode (php-mode, xml-mode, web-mode, nxml-mode ....)&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-06-28T06:46:09.357" LastActivityDate="2016-06-28T06:46:09.357" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24239" PostTypeId="2" ParentId="24236" CreationDate="2016-06-28T00:46:52.230" Score="1" Body="&lt;pre&gt;&lt;code&gt;(expand-file-name &quot;./file.ext&quot;)&#xA;=&amp;gt; &quot;/home/brian/file.ext&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12505" LastActivityDate="2016-06-28T00:46:52.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24240" PostTypeId="1" AcceptedAnswerId="24250" CreationDate="2016-06-28T02:41:51.427" Score="4" ViewCount="149" Body="&lt;p&gt;I have the following text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Local Variables:&#xA;eval: (face-remap-add-relative 'default :family &quot;AR PL KaitiM GB&quot; :foundry &quot;ARPH&quot;)&#xA;End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my document as a code sample. However, whenever I open the document, Emacs reads these lines as file-local variables and tries to apply them... They are neither the first nor the last in the document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any trick to prevent Emacs from parsing them?&lt;/p&gt;&#xA;" OwnerUserId="12018" LastEditorUserId="1982" LastEditDate="2016-06-29T13:21:40.363" LastActivityDate="2016-06-29T13:21:40.363" Title="How to prevent parsing file-local variables?" Tags="|file-local-variables|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24241" PostTypeId="1" AcceptedAnswerId="24248" CreationDate="2016-06-28T04:23:24.233" Score="2" ViewCount="406" Body="&lt;p&gt;I'm trying to have &lt;code&gt;whitespace-line-column&lt;/code&gt; set to &lt;code&gt;80&lt;/code&gt; in &lt;code&gt;prog-mode&lt;/code&gt; and &lt;code&gt;100&lt;/code&gt; in &lt;code&gt;web-mode&lt;/code&gt;, etc. However when using hooks seems to get ignored, as is always set to &lt;code&gt;80&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'whitespace)&#xA;(setq whitespace-style '(face trailing tab-mark lines-tail))&#xA;&#xA;(add-hook 'prog-mode-hook '(lambda ()&#xA;                             (interactive)&#xA;                             (whitespace-mode t)&#xA;                             (setq whitespace-line-column 80)))&#xA;&#xA;(add-hook 'web-mode-hook '(lambda ()&#xA;                            (interactive)&#xA;                            (whitespace-mode t)&#xA;                            (setq whitespace-line-column 100)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is the correct way to achieve this?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="12340" LastEditorUserId="675" LastEditDate="2016-07-14T23:14:42.103" LastActivityDate="2016-07-14T23:14:42.103" Title="How to set whitespace-line-colum per mode?" Tags="|major-mode|whitespace|whitespace-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24243" PostTypeId="2" ParentId="24236" CreationDate="2016-06-28T07:52:33.800" Score="4" Body="&lt;p&gt;The behavior as described by you is the intended one. If you want only the remote pathname, you must call&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(file-remote-p (file-truename &quot;./file.ext&quot;) 'localname)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-06-28T07:52:33.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24244" PostTypeId="1" AcceptedAnswerId="24245" CreationDate="2016-06-28T09:35:07.837" Score="5" ViewCount="2628" Body="&lt;p&gt;I want to pass variables/arguments to a shell script in org-mode babel code-block by using the &lt;code&gt;:var&lt;/code&gt; tag.  Instead of reading the value of the variable, shell is just getting the literal &lt;code&gt;x&lt;/code&gt;, which is empty (so &lt;code&gt;${x}=&amp;quot;&amp;quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;I would like the bash code block below in org-mode / org-babel to output &amp;quot;bar&amp;quot;.  How do I do that?&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+name: foo :var x=bar&#xA;#+begin_src bash &#xA;echo x&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2065" LastEditorUserId="17852" LastEditDate="2020-10-18T07:00:29.293" LastActivityDate="2020-10-18T07:00:29.293" Title="how do I use :var arguments in sh code for ob-shell in org-mode" Tags="|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24245" PostTypeId="2" ParentId="24244" CreationDate="2016-06-28T09:53:44.267" Score="8" Body="&lt;p&gt;I don't think you can put in the &lt;code&gt;#+name&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This should work:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+name: foo &#xA;#+begin_src bash :var x=&amp;quot;bar&amp;quot;  &#xA;echo $x&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="911" LastEditorUserId="17852" LastEditDate="2020-10-18T07:00:25.323" LastActivityDate="2020-10-18T07:00:25.323" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="24246" PostTypeId="1" CreationDate="2016-06-28T10:58:14.243" Score="2" ViewCount="3262" Body="&lt;p&gt;I am running Emacs version 25.0.92.1, Spacemacs 0.105.x, Windows 7. In my &lt;code&gt;.spacemacs&lt;/code&gt;, in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Org&#xA;;; Org-pomodoro&#xA;(setq org-pomodoro-length 25)&#xA;(setq org-pomodoro-short-break-length 5)&#xA;(setq org-pomodoro-long-break-length 15)&#xA;(setq org-pomodoro-play-sounds 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;.emacs.d\elpa\org-pomodoro-20151217.553\resources&lt;/code&gt; I have &lt;code&gt;bell.wav&lt;/code&gt;, &lt;code&gt;bell_multiple.wav&lt;/code&gt; and &lt;code&gt;tick.wav&lt;/code&gt;. When running a pomodoro it doesn't play any sounds. What do I need to change to get sounds working and what do I need to change to use my own sounds?&lt;/p&gt;&#xA;" OwnerUserId="9354" LastEditorUserId="35" LastEditDate="2016-09-29T18:47:46.250" LastActivityDate="2021-01-22T00:44:34.117" Title="Play Org-Pomodoro sounds" Tags="|org-mode|spacemacs|microsoft-windows|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24247" PostTypeId="1" AcceptedAnswerId="24254" CreationDate="2016-06-28T12:16:57.087" Score="13" ViewCount="2879" Body="&lt;p&gt;I try to pipe the output of one source block to the next source block as standard input.&#xA;Here an example of what I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Create stdin data:&#xA;#+header: :exports code&#xA;#+header: :results output&#xA;#+begin_src sh&#xA;echo &quot;That goes to the next&quot;&#xA;#+end_src&#xA;&#xA;#+name: piped&#xA;#+RESULTS:&#xA;: That goes to the next &#xA;&#xA;Use &quot;piped&quot; as stdin:&#xA;#+header: :exports results&#xA;#+header: :stdin piped&#xA;#+header: :results output&#xA;#+begin_src sh&#xA;VALUE=$(cat)&#xA;echo &quot;I got:&quot;&#xA;echo &quot;$VALUE&quot;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problems with this are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I have to manually create the result of the first block by hitting &lt;code&gt;C-c C-c&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the result must be included in org-buffer (large output not needed otherwise)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the result must be named manually&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there a workaround or better way to do this?&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-04T19:56:42.720" LastActivityDate="2022-10-18T09:06:08.230" Title="Org-mode: pipe source block output as stdin to next source block" Tags="|org-mode|org-babel|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24248" PostTypeId="2" ParentId="24241" CreationDate="2016-06-28T12:41:00.443" Score="2" Body="&lt;p&gt;You probably have to restart whitespace mode for the changes to take effect. Try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'prog-mode-hook '(lambda ()&#xA;                            (interactive)&#xA;                            (whitespace-mode 0)&#xA;                            (setq whitespace-line-column 80)&#xA;                            (whitespace-mode 1)))&#xA;&#xA;(add-hook 'web-mode-hook '(lambda ()&#xA;                           (interactive)&#xA;                           (whitespace-mode 0)&#xA;                           (setq whitespace-line-column 100)&#xA;                           (whitespace-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastEditorUserId="675" LastEditDate="2016-07-14T23:14:13.523" LastActivityDate="2016-07-14T23:14:13.523" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24249" PostTypeId="2" ParentId="24247" CreationDate="2016-06-28T12:46:27.977" Score="4" Body="&lt;p&gt;Call a src block from another using &quot;noweb&quot; references (see &lt;code&gt;(info &quot;(org) Noweb reference syntax&quot;)&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: input&#xA;#+header: :exports code&#xA;#+header: :results output&#xA;#+begin_src sh&#xA;echo &quot;That goes to the next&quot;&#xA;#+end_src&#xA;&#xA;#+header: :exports results&#xA;#+header: :results output :noweb no-export&#xA;#+begin_src sh&#xA;VALUE=$(&amp;lt;&amp;lt;input&amp;gt;&amp;gt;)&#xA;echo &quot;I got:&quot;&#xA;echo &quot;$VALUE&quot;&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: I got:&#xA;: That goes to the next&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-06-28T12:46:27.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24250" PostTypeId="2" ParentId="24240" CreationDate="2016-06-28T13:02:25.940" Score="4" Body="&lt;p&gt;If the format of your file allows it, you can use a new page character (insert it with &lt;code&gt;C-q C-l&lt;/code&gt; on its own line). Why it works is explained in the manual &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html&quot; rel=&quot;nofollow&quot;&gt;(info &quot;(emacs) Specifying File Variables&quot;)&lt;/a&gt;. The relevant bit is quoted here:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Apart from using a ‘-*-’ line, you can define file local variables&#xA;  using a “local variables list” near the end of the file.  The start of&#xA;  the local variables list should be no more than 3000 characters from&#xA;  the end of the file, and must be on the last page if the file is&#xA;  divided into pages.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-06-28T13:02:25.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24251" PostTypeId="1" CreationDate="2016-06-28T13:06:17.143" Score="1" ViewCount="353" Body="&lt;p&gt;I work on  ubuntu 14.04 with scilab installed. I put Alexander Vigodner's &lt;code&gt;scilab.el&lt;/code&gt; in my &lt;code&gt;init.el&lt;/code&gt; load path and I created a &lt;code&gt;scilab-startup.el&lt;/code&gt; file loaded by the init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how to interpret a &lt;code&gt;.sci&lt;/code&gt; file opened with emacs ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if there is only &lt;code&gt;2+2&lt;/code&gt; in &lt;code&gt;test.sci&lt;/code&gt;, when I have opened the file (emacs recognized it and loaded the scilab-mode), how to obtain &lt;code&gt;4&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="10056" LastActivityDate="2018-03-30T00:40:38.033" Title="scilab-mode : how to interpret a .sci file?" Tags="|shell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24252" PostTypeId="2" ParentId="24237" CreationDate="2016-06-28T13:32:57.687" Score="3" Body="&lt;p&gt;I don't think there's a built-in function for that, but you can create one and bind it yourself. I wrote this one, that will replace all outlines in region with &lt;code&gt;- [ ]&lt;/code&gt;. If no region is active, replace the outline in current line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-outline-to-checkbox ()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (replace-regexp &quot;^*+&quot; &quot;- [ ]&quot; nil (region-beginning) (region-end))&#xA;    (replace-regexp &quot;^*+&quot; &quot;- [ ]&quot; nil&#xA;                    (line-beginning-position)&#xA;                    (line-end-position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2016-06-28T13:32:57.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24254" PostTypeId="2" ParentId="24247" CreationDate="2016-06-28T14:07:42.027" Score="12" Body="&lt;p&gt;Here's a simple way to fix your code by naming the src block instead of results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: piped&#xA;#+header: :exports code&#xA;#+header: :results output&#xA;#+begin_src sh&#xA;echo &quot;That goes to the next&quot;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: That goes to the next &#xA;&#xA;#+header: :exports results&#xA;#+header: :stdin piped&#xA;#+header: :results output&#xA;#+begin_src sh&#xA;VALUE=$(cat)&#xA;echo &quot;I got:&quot;&#xA;echo &quot;$VALUE&quot;&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: I got:&#xA;: That goes to the next&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-06-28T14:19:56.053" LastActivityDate="2016-06-28T14:19:56.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24255" PostTypeId="1" AcceptedAnswerId="24256" CreationDate="2016-06-28T14:10:00.457" Score="3" ViewCount="50" Body="&lt;p&gt;How to have two different headers for two different modes with &lt;a href=&quot;http://www.emacswiki.org/emacs/download/header2.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;header2&lt;/code&gt;&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, to have a header like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% ----------&#xA;% File-name : &#xA;% ----------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I create a &lt;code&gt;.el&lt;/code&gt; file and a header like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# ----------&#xA;# Location :&#xA;# ----------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I create a &lt;code&gt;.R&lt;/code&gt; files.&lt;/p&gt;&#xA;" OwnerUserId="10056" LastEditorUserId="105" LastEditDate="2016-06-28T14:48:46.613" LastActivityDate="2016-06-28T14:48:46.613" Title="How to have two different headers for two different modes with header2?" Tags="|file-header|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24256" PostTypeId="2" ParentId="24255" CreationDate="2016-06-28T14:44:17.283" Score="3" Body="&lt;p&gt;From the Commentary of file &lt;a href=&quot;http://www.emacswiki.org/emacs/download/header2.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;header2.el&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;     Mode-specific headers:&#xA;;;     ---------------------&#xA;;;      Not all headers need look alike.  Suppose that you have a unix script mode&#xA;;;      and want it to have a shell specifier line that all other headers do not&#xA;;;      have.  To do this, Place the following line in a hook called when the&#xA;;;      mode is invoked or in the code that establishes the mode:&#xA;;;&#xA;;;         (add-hook 'make-header-hook 'header-shell nil t)&#xA;;;&#xA;;;      The header building blocks are sensitive to the different comment&#xA;;;      characters in different modes.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In addition, if you need to you can make any of the user options that define parts of the header buffer-local, i.e., specific to a given mode.  And if you really need to, you can do likewise for &lt;code&gt;make-header-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-06-28T14:44:17.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24258" PostTypeId="1" AcceptedAnswerId="24259" CreationDate="2016-06-28T16:18:48.403" Score="3" ViewCount="993" Body="&lt;p&gt;I've bound &lt;kbd&gt;C-c C-f&lt;/kbd&gt; to &lt;code&gt;helm-find-files&lt;/code&gt;. Since I am still getting used to helm, when looking at a file listing, I instinctively invoke &lt;kbd&gt;C-s&lt;/kbd&gt; (which starts helm grep in a helm session but starts search in dired-mode) to let me type part of the desired filename to bring the mark to the desired file. I know that I should instead simply start typing to do so instead of pressing &lt;kbd&gt;C-s&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But once I've entered helm grep, I don't know how to leave it other than &lt;kbd&gt;C-g&lt;/kbd&gt;, which drops me out of helm. I'd like to simply return to the helm find files screen, since I may have navigated to a different directory, but I haven't found the key combination to do so. Resuming helm (&lt;code&gt;helm-resume&lt;/code&gt;) after quitting just brings me to the helm grep screen.&lt;/p&gt;&#xA;" OwnerUserId="9881" LastEditorUserId="9881" LastEditDate="2016-06-28T17:32:43.643" LastActivityDate="2016-06-29T12:29:04.223" Title="How can I exit helm grep and return to helm window?" Tags="|helm|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24259" PostTypeId="2" ParentId="24258" CreationDate="2016-06-28T17:27:10.770" Score="4" Body="&lt;p&gt;I have &lt;code&gt;helm-resume&lt;/code&gt; bounded to &lt;kbd&gt;C-x C-b&lt;/kbd&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see all helm buffers I just pass it the universal argument &lt;kbd&gt;C-u C-x C-b&lt;/kbd&gt;. I can then pick the one that I want.&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2016-06-28T17:27:10.770" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24260" PostTypeId="1" CreationDate="2016-06-28T17:38:40.587" Score="1" ViewCount="46" Body="&lt;p&gt;In GNU Emacs 24.5.1, which comes with Ubuntu 16.04 Xenial Xerus the C-g does not abort the command like it used to do in earlier versions, which is annoying as it breaks the habit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is C-] command, which seemingly does the same thing, but keybindings help screen shows they are bound to the same command abort-recursive-edit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to return C-g it's previous behavior of aborting a command with input in minibuffer? Are there caveats in changing C-g?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: in &lt;code&gt;emacs -Q&lt;/code&gt;, press C-x C-f as if to find some file, but then press C-g to abandon the attempt. &quot;Quit&quot; is seen briefly, but &quot;Find file: ...&quot; message is still there in minibuffer, while it is expected to go away, like is the case with C-] command. Of coure, C-x C-f is only an example. Same happens with other commands as well.&lt;/p&gt;&#xA;" OwnerUserId="11466" LastEditorUserId="11466" LastEditDate="2016-06-29T07:20:08.267" LastActivityDate="2016-06-29T07:20:08.267" Title="Quitting minibufer works no more in 24.5.1?" Tags="|minibuffer|recursive-edit|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24261" PostTypeId="1" CreationDate="2016-06-28T17:55:42.660" Score="1" ViewCount="675" Body="&#xA;&#xA;&lt;p&gt;I'm trying to get Flycheck to load files containing declarations to resolve warnings to free variables etc. But Flycheck is not picking up the &lt;code&gt;(required&lt;/code&gt; files. I use &lt;code&gt;(require 'my-dcls)&lt;/code&gt; at the top of code files, and &lt;code&gt;(provide 'my-dcls)&lt;/code&gt; at the bottom of my declarations file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs 24.4 as an app on OSX, and using Flycheck 20160622. I've updated all my packages to the latest available versions using &lt;code&gt;ESC-x list-packages, U&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have learned that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Flycheck doesn't use the Emacs &lt;code&gt;load-path&lt;/code&gt;, by default policy.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;(setq-default flycheck-emacs-lisp-load-path 'inherit)&lt;/code&gt; in the Emacs init file should tell Flycheck to use the Emacs &lt;code&gt;load-path&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;All Flycheck variables are buffer local, so &lt;code&gt;(setq flycheck-emacs-lisp-load-path ..)&lt;/code&gt; won't work globally.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can &lt;code&gt;(setq-default flycheck-emacs-lisp-load-path (list &quot;dir1&quot; &quot;dir2&quot;))&lt;/code&gt; to create a specific load path to your custom files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, following all those guidelines,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I tried &lt;code&gt;(setq-default flycheck-emacs-lisp-load-path 'inherit)&lt;/code&gt; on line 1 of my init file, but without success. I can see the &lt;code&gt;inherit&lt;/code&gt; value in every code buffer that I visit when I evaluate &lt;code&gt;flycheck-emacs-lisp-load-path&lt;/code&gt; in the minibuffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I tried &lt;code&gt;(setq-default flycheck-emacs-lisp-load-path (list &quot;dir1&quot; &quot;dir2&quot;))&lt;/code&gt; on line 1 of my init file, but without success. I can see the &lt;code&gt;(&quot;dir1&quot; &quot;dir2&quot;)&lt;/code&gt; value in every code buffer that I visit when I evaluate &lt;code&gt;flycheck-emacs-lisp-load-path&lt;/code&gt; in the minibuffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In both of those cases, &lt;code&gt;(member 'my-dcls features)&lt;/code&gt; shows that my declarations file feature has been loaded, which means that Emacs (not necessarily Flycheck) has found and loaded the files successfully (so they do exist).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And still, Flycheck prints out free variable warnings to variables that are defined in my declarations file with &lt;code&gt;(defvar my-variable)&lt;/code&gt; statements. If I kill and yank those same &lt;code&gt;defvar&lt;/code&gt; statements from the declarations file into the current code buffer, Flycheck stops complaining.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm really at a loss to know what to do next. Everything seems in order, but the results say otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this related post &lt;a href=&quot;https://emacs.stackexchange.com/questions/10244/flycheck-could-not-find-file-under-load-path/10270#10270&quot;&gt;here&lt;/a&gt;, which is a near duplicate (except that the suggested answers don't work for me on my machine configuration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my &lt;em&gt;entire&lt;/em&gt; &lt;code&gt;.emacs&lt;/code&gt; init file, to make sure that nothing else interferes with Flycheck. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq-default flycheck-emacs-lisp-load-path&#xA;              (list &quot;/Users/me/Dropbox/emacs/&quot;))&#xA;&#xA;(when (&amp;gt;= emacs-major-version 24)&#xA;  (require 'package)&#xA;  (add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;  (package-initialize)&#xA;&#xA;  (use-package flycheck&#xA;    :ensure t&#xA;    :defer t))&#xA;&#xA;(require 'flycheck)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After starting Emacs, I read in a Lisp source file that contains &lt;code&gt;(require 'my-dcls)&lt;/code&gt;, where &lt;code&gt;my-dcls.el&lt;/code&gt; resides in the directory named in the &lt;code&gt;flycheck-emacs-lisp-load-path&lt;/code&gt; variable, &lt;code&gt;/Users/me/Dropbox/emacs/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the source file buffer, I can eval &lt;code&gt;flycheck-emacs-lisp-load-path&lt;/code&gt;, and can see the directory I loaded in there. Any ideas for further debugging to get Flycheck to pick up the load path are welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a look at the flycheck source, but it seemed beyond me for effective debugging (not sure I have the skills for that yet). Thanks.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-08-01T21:52:26.540" Title="Flycheck variable warnings despite flycheck load-path" Tags="|init-file|flycheck|load-path|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24262" PostTypeId="1" CreationDate="2016-06-28T18:23:32.767" Score="3" ViewCount="577" Body="&lt;p&gt;Is it possible to set a breakpoint on an arbitrary line while already established in &lt;code&gt;browser()&lt;/code&gt;? As a use-case: if I &lt;code&gt;debug(myfunc)&lt;/code&gt; and while in &lt;code&gt;Browse[2]&amp;gt; ...&lt;/code&gt; I realize that I need to jump forward to a point in the source file. My two current methods for dealing with this are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Exit the function, set the breakpoint where I want it, and re-enter the browser for the function.&lt;/li&gt;&#xA;&lt;li&gt;Continue line-by-line through the function, where my only way to speed things up a little is to use &lt;code&gt;f&lt;/code&gt;inish execution of the current loop (or function). (This can be arduous with functions that are hundreds of lines.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What I'd love to be able to do is:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Navigate to the line I want, tag it for debugging (&lt;code&gt;C-c C-t C-b&lt;/code&gt;, I think), then &lt;code&gt;c&lt;/code&gt;ontinue (&lt;code&gt;M-S-c&lt;/code&gt;) in the debugger, where it will then continue unabated until it encounters my just-set breakpoint.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;R-3.2.5-64, emacs-24.5.1 (i686-w64-mingw32), ess-16.04 (elpa: 20160602.203)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: &lt;code&gt;browser()&lt;/code&gt; is a debugger intended for in-environment inspection at breakpoints (either intentional or reactive) of uncompiled R code. This is specific to ESS, and more so to &lt;code&gt;ess-tracebug&lt;/code&gt; within it. (Heck, perhaps the answer is solely R, in which case I can migrate to SO.)&lt;/p&gt;&#xA;" OwnerUserId="5331" LastEditorUserId="5331" LastEditDate="2016-06-28T20:46:12.177" LastActivityDate="2016-06-28T20:46:12.177" Title="set breakpoint while in debugger?" Tags="|ess|r|debug|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24263" PostTypeId="1" CreationDate="2016-06-28T18:36:08.363" Score="4" ViewCount="638" Body="&lt;p&gt;The story here is that I use &lt;code&gt;magit&lt;/code&gt; at work, where our workflow involves the use of a preposterous number of branches on our central remote (used for various purposes, but most notably as part of our deploy and manual testing processes). For my local development purposes, I have no need to stay up-to-date on most of these extraneous references. Before adopting &lt;code&gt;magit&lt;/code&gt;, when using git porcelain I'd generally use specific &lt;code&gt;pull&lt;/code&gt; and &lt;code&gt;fetch&lt;/code&gt; commands, both to save time and to leave my repo un-cluttered. Whenever I wanted to update &lt;code&gt;master&lt;/code&gt;, for instance, I'd usually use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git checkout master&#xA;git pull origin master&#xA;git checkout -&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I adopted &lt;code&gt;magit&lt;/code&gt;, I was initially puzzled by how long pulling (using  &lt;code&gt;magit-pull-from-upstream&lt;/code&gt;) would take. As time went on I eventually discovered (using the &lt;code&gt;magit-process&lt;/code&gt; buffer) that &lt;code&gt;magit&lt;/code&gt; was using the command &lt;code&gt;git pull origin&lt;/code&gt; to update my &lt;code&gt;master&lt;/code&gt; branch. That command, in addition to updating master, fetches every remote branch under the sun (which is  lot of pointless references I don't need, remember).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've solved this issue for myself (i.e. I'm not looking for a solution here) by switching to using &lt;code&gt;magit-pull-from-pushremote&lt;/code&gt; instead, after configuring the push-to remote. That, evidently, uses &lt;code&gt;git pull origin master&lt;/code&gt; (as I expected I'd get from the other command).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for an explanation for the different behavior of these two commands. Why would one yield &lt;code&gt;git pull origin&lt;/code&gt; and one yield &lt;code&gt;git pull origin master&lt;/code&gt;? Why wouldn't both do the (in my opinion objectively more useful) &lt;code&gt;git pull origin master&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10256" LastEditorUserId="306" LastEditDate="2016-08-01T15:16:44.833" LastActivityDate="2020-06-12T21:57:20.333" Title="Why does the behavior of magit's pull operations differ?" Tags="|magit|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24264" PostTypeId="1" AcceptedAnswerId="24375" CreationDate="2016-06-28T20:00:01.847" Score="4" ViewCount="1232" Body="&lt;p&gt;I have customized &lt;code&gt;tramp-remote-path&lt;/code&gt; in my .emacs.d/init.el with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables  '(tramp-remote-path&#xA;    (quote&#xA;     (tramp-own-remote-path))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when tramp is loaded the value of tramp-remote-path is set to the default value. For example after I open a remote file the value of tramp-remote-path is &lt;code&gt;(tramp-default-remote-path   &quot;/bin&quot; &quot;/usr/bin&quot; &quot;/sbin&quot; &quot;/usr/sbin&quot; ...)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have verified this behaviour even when the above customization is the only code in init.el with both 24.5 and 25.0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does this happen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent it and make my customization stick?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;tramp-remote-path&lt;/code&gt; is defined using &lt;code&gt;defcustom&lt;/code&gt;, it seems like it should be customizable with &lt;code&gt;custom-set-variables&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="2706" LastEditDate="2016-06-28T21:18:18.787" LastActivityDate="2017-04-07T16:56:45.320" Title="loading tramp overrides tramp-remote-path customization back to default value" Tags="|init-file|tramp|customize|autoload|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24265" PostTypeId="2" ParentId="23832" CreationDate="2016-06-29T02:23:00.840" Score="1" Body="&lt;p&gt;Converting @wasamasa's comment to a answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dynamic-library-alist&lt;/code&gt; has nothing to do with loading DLL on Windows platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting its docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also note that this is not a generic facility for accessing external&#xA;  libraries; only those already known by Emacs will be loaded.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12018" LastEditorUserId="1982" LastEditDate="2016-06-29T13:22:04.957" LastActivityDate="2016-06-29T13:22:04.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24266" PostTypeId="1" AcceptedAnswerId="24268" CreationDate="2016-06-29T02:55:43.780" Score="4" ViewCount="1731" Body="&lt;p&gt;By using &lt;code&gt;toggle-input-method&lt;/code&gt;, I can disable input method when that is active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But sometimes I just want to disable it regardless the input method status.&#xA;I couldn't find the function for it. How can I do it?&lt;/p&gt;&#xA;" OwnerUserId="10106" LastActivityDate="2016-06-29T05:09:17.377" Title="How to disable input method" Tags="|input-method|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24267" PostTypeId="1" CreationDate="2016-06-29T03:01:40.947" Score="7" ViewCount="3025" Body="&lt;p&gt;I hoped to enable a virtualenv with org-babel source block before executing some python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to do something like &lt;a href=&quot;https://github.com/jorgenschaefer/pyvenv&quot; rel=&quot;noreferrer&quot;&gt;pyenv&lt;/a&gt; pyvenv-workon before it evaulates my code block. I didn't want to have to manually enable the virtualenv.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: elasticsearch_dsl_test&#xA;#+BEGIN_SRC: python :prologue &quot;(pyvenv-workon 'elasticsearch)&quot;&#xA;from elasticsearch import Elasticsearch&#xA;from elasticsearch_dsl import Search, Q&#xA;&#xA;client = Elasticsearch()&#xA;&#xA;search = Search(using=client, index=&quot;localdev-news-newsentry&quot;)&#xA;response = search.execute()&#xA;&#xA;print [&quot;No response&quot;, &quot;Was successfull&quot;][int(response.success())]&#xA;print &quot;Response took {0}ms.&quot;.format(response.took)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I couldn't quite get it working.&lt;/p&gt;&#xA;" OwnerUserId="10482" LastEditorUserId="5385" LastEditDate="2016-06-29T13:21:50.830" LastActivityDate="2018-01-11T23:43:39.453" Title="Using org-babel to enable virtualenv" Tags="|org-babel|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24268" PostTypeId="2" ParentId="24266" CreationDate="2016-06-29T05:09:17.377" Score="4" Body="&lt;p&gt;&lt;code&gt;M-x find-function toggle-input-method&lt;/code&gt; to read its source code,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun toggle-off-input-method ()&#xA;  (interactive)&#xA;  (if current-input-method (deactivate-input-method)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-06-29T05:09:17.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24269" PostTypeId="1" AcceptedAnswerId="24294" CreationDate="2016-06-29T06:53:03.773" Score="1" ViewCount="313" Body="&lt;p&gt;I'm toying around with font sizes in Emacs and I noticed that changing the font size to something huge, like, 160, creates a gap between the right end of the mode-line and the fringe:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RitWs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RitWs.png&quot; alt=&quot;screenshot of the issue&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code I ran on my scratch buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((faces '(mode-line&#xA;               mode-line-buffer-id&#xA;               mode-line-emphasis&#xA;               mode-line-highlight&#xA;               mode-line-inactive)))&#xA;  (set-face-attribute 'default nil :height (* 16 10))&#xA;  (mapc (lambda (face) (set-face-attribute face nil :height (* 9 10))) faces))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yes, I'm trying to keep the mode-line font size I currently use (900)&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2016-06-30T01:48:17.610" Title="What's this gap between the right end of the mode-line and the fringe when changing font's size?" Tags="|fonts|mode-line|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24270" PostTypeId="1" AcceptedAnswerId="24277" CreationDate="2016-06-29T07:09:04.487" Score="4" ViewCount="537" Body="&lt;p&gt;I want to select a random task from a subset of global org tasks from something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;d&quot; &quot;daily start&quot;&#xA; ((agenda &quot;&quot;&#xA;          ((org-agenda-span 'day)&#xA;           (org-agenda-skip-function&#xA;            '(org-agenda-skip-entry-if 'notregexp &quot;:start:&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I saw there's a command at &lt;a href=&quot;https://gist.github.com/tonyday567/4343164&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/tonyday567/4343164&lt;/a&gt; to pick from the global list.  Is there a way to narrow it down?&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-06-29T15:50:40.907" Title="Org Mode - pick random task from custom agenda view" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24272" PostTypeId="1" AcceptedAnswerId="24281" CreationDate="2016-06-29T11:14:44.527" Score="0" ViewCount="335" Body="&lt;p&gt;So I'm following this &lt;a href=&quot;https://www.youtube.com/watch?v=HTUE03LnaXA&quot; rel=&quot;nofollow&quot;&gt;guide&lt;/a&gt; and when I go to &lt;code&gt;M-x package-list-packages&lt;/code&gt; there is no auto-complete in the directory. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; start pacakage.el with emacs&#xA;(require 'package)&#xA;; add Melpa to repository list&#xA;(add-to-list 'package-archives '(&quot;melpa&quot;, &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;; initialise package.el&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is my &lt;code&gt;~/.emacs&lt;/code&gt; file. &lt;/p&gt;&#xA;" OwnerUserId="12518" LastEditorUserId="105" LastEditDate="2016-06-29T14:44:52.663" LastActivityDate="2016-06-29T16:47:22.350" Title="Can't find autocomplete on MELPA" Tags="|emacsclient|package-repositories|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24273" PostTypeId="2" ParentId="24258" CreationDate="2016-06-29T12:29:04.223" Score="1" Body="&lt;p&gt;&lt;kbd&gt;C-x C-f&lt;/kbd&gt; (&lt;code&gt;helm-quit-and-find-file&lt;/code&gt;) within any helm command will bring you to &lt;code&gt;helm-find-files&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-06-29T12:29:04.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24274" PostTypeId="1" AcceptedAnswerId="24302" CreationDate="2016-06-29T12:30:01.413" Score="1" ViewCount="971" Body="&lt;p&gt;I am writing some xelatex code with both English and Farsi (right to left direction) characters in it. Also I am using Emacs' input method (changing with key Ctrl + \) for changing between English and Farsi keyboards. It is great being able to use Emacs movement shortcuts and typing Farsi at the same time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I would like to be able to use Farsi input method in minibuffers, like the one opened by searching, too. The (Ctrl + \) key is not available there, and it is very inconvenient to have to change the system level input method two times whenever I want to type some Farsi character in some minibuffer (The whole point of Emacs' input method is to avoid scenarios like this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is this possible? If yes, I would like to know if it is possible to use Farsi characters with evil-mode commands (like f) or not. Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="11933" LastEditorUserId="105" LastEditDate="2016-06-29T14:43:34.647" LastActivityDate="2017-03-30T21:40:41.327" Title="How to use input methods in minibuffer?" Tags="|evil|minibuffer|input-method|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24275" PostTypeId="1" AcceptedAnswerId="24295" CreationDate="2016-06-29T14:05:39.450" Score="1" ViewCount="1242" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/M4P9q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/M4P9q.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, switching to the leuven theme makes my org-mode first level headlines bigger than the rest of the text. I don't like that, where can I change this behaviour? Where is the leuven-code that takes care of this modification? Is this even caused by the leuven theme?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why I don't like this feature is that I'm using my own &quot;first level headline&quot; (see &lt;em&gt;Allgemeines&lt;/em&gt;). So as an additional feature: How can I make my own Headings bigger instead of the org-mode headlines? (Maybe the answer to the first question will answer this question too.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: I don't want to change the leuven theme, because I like the colors!&lt;/p&gt;&#xA;" OwnerUserId="12284" LastActivityDate="2016-06-30T01:48:59.713" Title="Leuven Theme makes org-mode headline too big" Tags="|org-mode|themes|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24276" PostTypeId="1" CreationDate="2016-06-29T14:55:50.730" Score="2" ViewCount="942" Body="&lt;p&gt;I've followed everything &lt;a href=&quot;https://github.com/gregsexton/ob-ipython&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; in order to set up ipython in org mode. But I keep getting the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...executing Ipython code block...&#xA;apply: Searching for program: no such file or directory, ipython&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I try the sample code block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ipython :session myip&#xA;  %matplotlib inline&#xA;  import matplotlib.pyplot as plt&#xA;  import numpy as np&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Other samples don't work either. I've gotten ipython from Enthought, which should have all the necessities. Starting ipython from my (Ubuntu) terminal brings up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Python 2.7.11 | 64-bit | (default, Jun 11 2016, 10:32:30) &#xA;Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&#xA;IPython 4.1.2 -- An enhanced Interactive Python.&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as it is on my path. I even installed &lt;code&gt;exec-path-from-shell&lt;/code&gt; to make sure Emacs would see my path. Not sure how to proceed.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2016-06-30T13:54:20.840" Title="ipython not working in org mode" Tags="|org-mode|org-babel|ipython|install|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24277" PostTypeId="2" ParentId="24270" CreationDate="2016-06-29T15:50:40.907" Score="3" Body="&lt;p&gt;This isn't exactly what you're asking for, but it might do the trick (and I already had the code on hand).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This agenda block should display 5 entries, selected uniformly at random from those entries meeting your selection criteria.  Refreshing the agenda will reshuffle.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;'(&quot;d&quot; &quot;daily start&quot;&#xA;  ((agenda &quot;&quot;&#xA;           ((org-agenda-span             'day)&#xA;            (org-agenda-skip-function&#xA;             '(org-agenda-skip-entry-if  'notregexp &quot;:start:&quot;))&#xA;            (org-agenda-max-entries      5) &#xA;            (org-agenda-cmp-user-defined (org-compare-randomly))&#xA;            (org-compare-random-refresh  t)&#xA;            (org-agenda-sorting-strategy '(user-defined-up))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It uses this machinery to do the randomization:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; -*- lexical-binding: t; -*-&#xA;&#xA;(defun org-compare--get-marker (entry)&#xA;  &quot;Return the marker for ENTRY.&#xA;&#xA;This marker points to the location of the headline referenced by&#xA;ENTRY.&quot;&#xA;  (get-text-property 1 'org-marker entry))&#xA;&#xA;(defvar org-compare-random-refresh nil&#xA;  &quot;Whether `org-compare-randomly' should refresh its keys.&#xA;&#xA;See the docs for `org-compare-randomly' for more information.&quot;)&#xA;&#xA;(defun org-compare-randomly--update-sort-key (entry table generator)&#xA;  &quot;Return sort key for ENTRY in TABLE, generating it if necessary.&#xA;For internal use by `org-compare-randomly-by'.&quot;&#xA;  (let* ((marker    (org-compare--get-marker entry))&#xA;         (hash-key  `(,(marker-buffer marker) . ,(marker-position marker))))&#xA;    (or (gethash hash-key table)&#xA;        (puthash hash-key (funcall generator entry) table))))&#xA;&#xA;(defun org-compare-randomly-by (generator)&#xA;  &quot;Return a random comparator using GENERATOR.&#xA;&#xA;The comparator returned is like `org-compare-randomly', except&#xA;the distribution of random keys is controlled by GENERATOR and&#xA;may thus be non-uniform.&#xA;&#xA;The function GENERATOR is called with a single argument, an&#xA;agenda entry, when that entry lacks a sort key.  It should return&#xA;a number, which is then used for all comparisons until the key&#xA;list is cleared; see `org-compare-randomly' for more details on&#xA;this.&#xA;&#xA;Subsequent calls to `org-compare-randomly-by' produce comparators&#xA;with independent sets of sort keys.&quot;&#xA;  (let ((table (make-hash-table :test #'equal)))&#xA;    (lambda (x y) &#xA;      (when org-compare-random-refresh &#xA;        (clrhash table)&#xA;        (setq org-compare-random-refresh nil))&#xA;      (let ((x-val (org-compare-randomly--update-sort-key x table generator))&#xA;            (y-val (org-compare-randomly--update-sort-key y table generator)))&#xA;        (cond&#xA;         ((= x-val y-val)  nil)&#xA;         ((&amp;lt; x-val y-val)   -1)&#xA;         ((&amp;gt; x-val y-val)   +1))))))&#xA;&#xA;(defun org-compare-randomly ()&#xA;  &quot;Return a comparator implementing a random shuffle.&#xA;&#xA;When given distinct agenda entries X and Y, the resulting&#xA;comparator has an equal chance of returning +1 and -1 (and a&#xA;miniscule chance of returning nil).  Subsequent calls will produce&#xA;results consistent with a total ordering.&#xA;&#xA;To accomplish this, a hash table of randomly-generated sort keys&#xA;is maintained.  This table will persist until the comparator is&#xA;called when the variable `org-compare-random-refresh' is non-nil.&#xA;This means that setting this variable as part of a custom agenda&#xA;command using this comparator as `org-agenda-cmp-user-defined'&#xA;will cause the sort order to change whenever the agenda is&#xA;refreshed; otherwise, it will persist until Emacs is restarted.&#xA;&#xA;Note that if you don't want the sort order to change on refresh,&#xA;you need to be careful that the comparator is created when the&#xA;custom agenda command is defined, not when it's called, e.g.&#xA;&#xA;    (add-to-list&#xA;     'org-agenda-custom-commands&#xA;     `(\&quot;y\&quot; \&quot;Example Agenda\&quot;&#xA;       ((todo&#xA;         \&quot;\&quot;&#xA;         ((org-agenda-cmp-user-defined ',(org-compare-randomly))&#xA;          (org-agenda-sorting-strategy '(user-defined-up)))))))&#xA;&#xA;\(Notice the use of backquote.)&#xA;&#xA;Comparators resulting from different calls to this function have&#xA;independent key tables.&quot;&#xA;  (org-compare-randomly-by (lambda (_) (random))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-06-29T15:50:40.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24278" PostTypeId="1" CreationDate="2016-06-29T15:51:24.370" Score="4" ViewCount="950" Body="&lt;p&gt;Sometimes emacs takes a very long time (+ 30 seconds) to read from or save to the system (Linux) clipboard. The entire emacs session hangs while it does this and I can't cancel it with &lt;code&gt;C-g&lt;/code&gt; or &lt;code&gt;ESC ESC ESC&lt;/code&gt; or anything. This seems to happen at random, but whenever it does happen, it tends to happen more frequently until I restart emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could be causing this behavior? Where should I start? I haven't changed the default values of &lt;code&gt;x-select-enable-clipboard&lt;/code&gt; (t) or any other clipboard-related variables (to my knowledge)... &lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2016-06-29T15:51:24.370" Title="Emacs takes a very long time to read/save to the clipboard" Tags="|copy-paste|clipboard|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24279" PostTypeId="2" ParentId="24275" CreationDate="2016-06-29T15:56:54.947" Score="2" Body="&lt;p&gt;The code is in &lt;code&gt;leuven-theme.el&lt;/code&gt; in &lt;code&gt;/usr/local/share/emacs/24.5/etc/themes&lt;/code&gt; dir (if you use linux and version 24.5). I don't know the path for Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To change the org headlines:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-group&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;org-faces&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, then scroll to &lt;em&gt;Org Level 1&lt;/em&gt;, click on the arrow and then on &lt;em&gt;Show All Attributes&lt;/em&gt;. Change the &lt;code&gt;height&lt;/code&gt;, go to the beginning of the buffer and click &lt;strong&gt;Apply&lt;/strong&gt;. Repeat until you are happy with the result and then &lt;strong&gt;Apply and Save&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These changes will be saved in your &lt;code&gt;custom-file&lt;/code&gt;. To see the path for this file &lt;kbd&gt;C-h v&lt;/kbd&gt; &lt;code&gt;custom-file&lt;/code&gt;. You can also edit it manually but this is discouraged.&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2016-06-29T15:56:54.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24281" PostTypeId="2" ParentId="24272" CreationDate="2016-06-29T16:47:22.350" Score="0" Body="&lt;p&gt;Elements of &lt;code&gt;package-archives&lt;/code&gt; should be conses, which can be written as &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Dotted-Pair-Notation.html&quot; rel=&quot;nofollow&quot;&gt;dotted pairs&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;; add Melpa to repository list&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Commas are never used in lisp code except when paired with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot; rel=&quot;nofollow&quot;&gt;backquote&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-06-29T16:47:22.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24282" PostTypeId="1" AcceptedAnswerId="24289" CreationDate="2016-06-29T16:58:52.453" Score="0" ViewCount="900" Body="&lt;p&gt;Today I suddenly started getting the above error whenever I try to save a file in emacs 24.5 on Windows 10.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my full list of messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/flymake.el (source)...done&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el (source)...&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el&#xA;../site-lisp/csharp-mode.el: `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. [2 times]&#xA;../site-lisp/csharp-mode.el: (lambda (item) ...) quoted with ' rather than with #'&#xA;Done loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el (source)...done&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/desktop.el (source)...&#xA;Eager macro-expansion failure: (error &quot;(alist-get (quote display) filtered) is not a valid place expression&quot;)&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/desktop.el (source)...done&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/session.el (source)...done&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/xah-math-input.el (source)...done&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/unicode-fonts.el (source)...done&#xA;Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/php-mode.el (source)...done&#xA;zlib library not found&#xA;notes.txt has auto save data; consider M-x recover-this-file&#xA;Desktop: File &quot;c:/c&quot; no longer exists.&#xA;Can't guess python-indent-offset, using defaults: 4 [39 times]&#xA;Wrote c:/Users/Psalm3_3/.emacs.d/.emacs.desktop.lock&#xA;Desktop: 1 frame, 55 buffers restored, 1 failed to restore.&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;Saving file c:/Users/Psalm3_3/GDrive/Resources/Courses/StanMachLrn/notes.txt...&#xA;find-coding-systems-region: Loading charset map: no such file or directory, KOI8-T&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why would emacs suddenly want to use Cyrillic text?  Does anyone have any suggestions?  TIA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Started running from an older emacs setup that didn't have AUCTEX installed, which doesn't give me the error, so it appears to be a problem with this:  &lt;a href=&quot;https://www.gnu.org/software/auctex/&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/auctex/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9965" LastEditorUserId="9965" LastEditDate="2016-06-29T17:09:55.387" LastActivityDate="2016-06-30T16:16:13.183" Title="Loading charset map: no such file or directory, KOI8-T" Tags="|microsoft-windows|emacs24|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24283" PostTypeId="1" CreationDate="2016-06-29T17:03:36.093" Score="3" ViewCount="2378" Body="&lt;p&gt;I am testing out the Babel feature in org-mode, with this small block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :results verbatim :exports both                                                     &#xA;banner -w 35 e                                                                                                                  &#xA;#+END_SRC                                                                                                                          &#xA;&#xA;#+RESULTS:                                                                                                                         &#xA;:              #####                                                                                                               &#xA;:            #########                                                                                                             &#xA;:          ####  #   ###                                                                                                           &#xA;:          #     #     ##                                                                                                          &#xA;:         ##     #      #                                                                                                          &#xA;:          #     #     ##                                                                                                          &#xA;:          #     #   ###                                                                                                           &#xA;:            #   #####                                                                                                             &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(The &lt;code&gt;banner&lt;/code&gt; command writes an ASCII art heading. So in this example I'm just printing out an &lt;code&gt;e&lt;/code&gt;, sideways. The leading whitespace characters are all spaces.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to export this to TeX, and in the TeX file I see that some of the leading spaces have been replaced with tabs; namely any group of 8 spaces gets replaced with a tab. Therefore the lines don't show up properly when the TeX is exported to PDF. I had a look at the source code of &lt;code&gt;org&lt;/code&gt; and I found that it might be &lt;code&gt;org-trim&lt;/code&gt; causing this. There's also the option &lt;code&gt;org-src-preserve-indentation&lt;/code&gt;, but that doesn't seem to act on the output of the source code, only the source itself. Can I stop &lt;code&gt;org&lt;/code&gt; from converting the whitespaces to tabs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Just tried &lt;code&gt;sed 's/&amp;lt;tab-character&amp;gt;/        /g'&lt;/code&gt; on the TeX file to replace each tab with 8 spaces, and the problem is fixed immediately. So org must be changing them somewhere, I just need to know where...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT #2: Apparently there is some &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob;f=lisp/org-element.el;h=bf76bd40e2650b4d9cbea8e0b4f8c37be3095886;hb=96a9542ae1153a0c8003d9e80a48d1558b89b50a#l4566&quot; rel=&quot;nofollow&quot;&gt;normalizing&lt;/a&gt; going on that might be the issue. Listing here for reference.&lt;/p&gt;&#xA;" OwnerUserId="12422" LastEditorUserId="12422" LastEditDate="2016-06-30T06:14:21.647" LastActivityDate="2021-06-25T14:32:55.050" Title="Org mode converting spaces to tabs when evaluating source?" Tags="|org-mode|org-export|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24284" PostTypeId="1" CreationDate="2016-06-29T18:05:28.607" Score="2" ViewCount="2215" Body="&lt;p&gt;I have been interested in Emacs for a while, since I have seen some great articles on the Internet, which demonstrates the usage of Emacs as a C/C++ IDE. Those projects are awesome, yet they are not easy to be implemented by a novice Emacs user. I got problems with whichever of them I tried to implement. I searched the Internet a lot and a lot to solve my problems. One of my problems was solved accidentally by a coincidence, it was related to ELPA. After that new problems came out. I am really stuck right now. I want to use &lt;code&gt;cmake-ide&lt;/code&gt; package (&lt;a href=&quot;https://github.com/atilaneves/cmake-ide&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) or &lt;code&gt;cpputils-cmake&lt;/code&gt; package (&lt;a href=&quot;https://github.com/redguardtoo/cpputils-cmake&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). Could you demonstrate how to use them assuming I only have Emacs and those packages from MELPA installed, or provide some resources to know learn which are prerequisite for using them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;note1:&lt;/strong&gt; I am using &quot;GNU Emacs 24.5.1&quot; on ArchLinux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;note2:&lt;/strong&gt; I could have installed those packages. My problems start afterwards.&lt;/p&gt;&#xA;" OwnerUserId="12516" LastEditorUserId="12516" LastEditDate="2016-07-01T20:10:33.803" LastActivityDate="2018-06-22T12:47:34.297" Title="Configuring Emacs as a CMake based C/C++ IDE" Tags="|c++|compilation|ide|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24285" PostTypeId="1" AcceptedAnswerId="24301" CreationDate="2016-06-29T18:35:02.807" Score="1" ViewCount="420" Body="&lt;p&gt;I want to add keybinding to Dired mode for entering directory, and ONLY directory. By default enter key is bound to function &lt;code&gt;dired-find-file&lt;/code&gt;. The problem with it is that its or opening new dired buffer if it is directory under cursor, or open file for editing if its file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I added two shortcuts for going to parent directory and stepping in directory under cursor this way:&#xA;&lt;code&gt;&#xA;(define-key dired-mode-map (kbd &quot;&amp;lt;left&amp;gt;&quot;) 'dired-jump)&#xA;(define-key dired-mode-map (kbd &quot;&amp;lt;right&amp;gt;&quot;) 'dired-find-file)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you may guess the problem is in last - &lt;code&gt;dired-find-file&lt;/code&gt; will work on non-directories too, and I want it not to do anything. So my question - is there a specific function for stepping in directory under cursor or, if not - is there a way to check if there is directory under cursor in dired mode to construct my own function? Thx.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-06-30T10:06:48.280" Title="How to dired-find-file for ONLY directories in Dired?" Tags="|dired|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24286" PostTypeId="1" AcceptedAnswerId="24348" CreationDate="2016-06-29T19:03:02.533" Score="2" ViewCount="3245" Body="&lt;p&gt;&lt;a href=&quot;https://i.imgur.com/3wZ7XKs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://i.imgur.com/3wZ7XKs.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I turn off this highlighting of empty lines/spaces?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;spacemacs&lt;/code&gt;, so I would appreciate if answers could tell me how to disable the highlighting through the &lt;code&gt;spacemacs&lt;/code&gt; infrastructure rather than through vanilla Emacs.&lt;/p&gt;&#xA;" OwnerUserId="12507" LastEditorUserId="253" LastEditDate="2016-09-08T16:26:10.293" LastActivityDate="2016-09-08T16:26:10.293" Title="How can I turn of highlighting of empty lines/spaces?" Tags="|spacemacs|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24287" PostTypeId="1" CreationDate="2016-06-29T19:26:02.233" Score="5" ViewCount="1731" Body="&lt;p&gt;I'm able to use TRAMP fine for reading/writing files on a remote server. I only have to login to the server the first time I open a file, and from then on I can open files without being prompted to login again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I run commands through TRAMP, I have to login every time. For example, if I run &lt;code&gt;M-x grep ENTER grep -nH -r foo ENTER&lt;/code&gt;, I need to login every time I run that &lt;code&gt;grep&lt;/code&gt; command. I've tried increasing the TRAMP log level and even debugging through the TRAMP code, but I haven't been able to figure out why it can't reuse the same SSH connection to run commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is on OS X. Running &lt;code&gt;M-x version&lt;/code&gt; shows &lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0, NS apple-appkit-1348.17) of 2015-08-24&lt;/code&gt;. Note that I cannot simply make the login process easier by using keys or caching my password, because the server I'm connecting to uses 2fac auth.&lt;/p&gt;&#xA;" OwnerUserId="7059" LastActivityDate="2016-06-30T17:49:33.120" Title="Executing remote commands with TRAMP with a single SSH connection" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24288" PostTypeId="2" ParentId="24283" CreationDate="2016-06-29T22:31:32.907" Score="4" Body="&lt;p&gt;This usually fixes for me so LaTeX comes out fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-preserve-indentation nil &#xA;      org-edit-src-content-indentation 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, you could use this instead of sed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x untabify&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-06-29T22:31:32.907" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24289" PostTypeId="2" ParentId="24282" CreationDate="2016-06-29T22:34:51.470" Score="1" Body="&lt;p&gt;Somehow I had missed these files when moving emacs to a new directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CNS-3.map&#xA;CP1252.map &#xA;CP932-2BYTE.map &#xA;EBCDICUK.map &#xA;IBM1004.map &#xA;IBM290.map &#xA;IBM420.map &#xA;IBM861.map &#xA;IBM874.map &#xA;KOI8-T.map &#xA;MIK.map &#xA;TIS-620.map &#xA;calccard.pdf &#xA;fr-refcard.pdf &#xA;byte-opt.el &#xA;cconv.el &#xA;cl-macs.el &#xA;cl-seq.el cl.el &#xA;eieio-core.el &#xA;eieio-opt.el &#xA;ert-x.el &#xA;gv.el &#xA;package.el &#xA;timer.el &#xA;erc-match.el &#xA;Punct-b5.el &#xA;TONEPY.el &#xA;tsang-b5.el &#xA;ob-haskell.el &#xA;ob-io.el &#xA;org-bibtex.el &#xA;ox-man.el &#xA;url-nfs.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thankfully, this means that I can now use auctex again.&lt;/p&gt;&#xA;" OwnerUserId="9965" LastEditorUserId="9965" LastEditDate="2016-06-30T16:16:13.183" LastActivityDate="2016-06-30T16:16:13.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24290" PostTypeId="1" AcceptedAnswerId="24394" CreationDate="2016-06-29T22:41:31.713" Score="2" ViewCount="1242" Body="&lt;p&gt;I am using &lt;code&gt;:ensure t&lt;/code&gt; of &lt;code&gt;use-package&lt;/code&gt; to install &quot;go-prjectile&quot; package which depends on &quot;go-rename&quot;. But I would like to use a local version of &quot;go-rename&quot; and its path is already added to &lt;code&gt;load-path&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package go-rename&#xA;   :load-path &quot;lisp/go-rename&quot;)&#xA;&#xA;(use-package go-projectile&#xA;   :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But every time when &quot;go-projectile&quot; is installed, the &quot;go-rename&quot; is also installed from melpa too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to only install &quot;go-projectile&quot; without install its dependencies?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2020-05-22T22:58:07.577" Title="How to install package without install dependencies through &quot;package&quot;?" Tags="|package|use-package|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24291" PostTypeId="1" CreationDate="2016-06-29T22:47:15.920" Score="5" ViewCount="2425" Body="&lt;p&gt;I'm working with Emacs on several different projects with several different languages. I'm seeking for solution that could help manage project as &lt;code&gt;workspace&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meaning&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Understand language in use and load appropriate modes (to reduce startup time, I'm trying not to load all at start)&lt;/li&gt;&#xA;&lt;li&gt;Restore last buffers and their ordering (last workspace setup)&lt;/li&gt;&#xA;&lt;li&gt;Restore default buffers and their ordering (default workspace setup)&lt;/li&gt;&#xA;&lt;li&gt;Restore buffers and their ordering in pre-defined setup (special workspace setup, for debugging, for tracing)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Please suggest solutions or point to a way how can I achieve this&lt;/p&gt;&#xA;" OwnerUserId="10538" LastEditorUserId="10538" LastEditDate="2016-06-29T23:01:47.073" LastActivityDate="2016-06-30T01:10:40.940" Title="Workspace configuration" Tags="|buffers|window-splitting|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24292" PostTypeId="2" ParentId="24291" CreationDate="2016-06-29T23:49:46.710" Score="6" Body="&lt;p&gt;I use a combination of two different tools for project management:&lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;projectile&lt;/a&gt;, for switching between projects, and &lt;a href=&quot;https://github.com/nex3/perspective-el&quot; rel=&quot;noreferrer&quot;&gt;perspective&lt;/a&gt;, for managing frames within a given project. (The two also integrate well, allowing switching between project states.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that understanding the language in use, in Emacs, is always a function of the mode(s) Emacs loads for a given file, not for a &quot;project&quot; or &quot;workspace.&quot; For instance, one project might contain a README in markdown-mode, and also python source, and also SQL schema files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What neither of those will give you is any kind of save/restore functionality. For that, I believe you want &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html&quot; rel=&quot;noreferrer&quot;&gt;to save your session via desktop&lt;/a&gt;. This &lt;em&gt;should&lt;/em&gt; get you a good deal of what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reduce load time, I highly recommend &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;use-package&lt;/a&gt;; to make perspective/project switching more pleasant, I highly recommend &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;noreferrer&quot;&gt;helm&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-06-29T23:49:46.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24293" PostTypeId="2" ParentId="24291" CreationDate="2016-06-30T01:03:18.773" Score="3" Body="&lt;p&gt;Consider using Emacs bookmarks, with &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;, including, in particular:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#DesktopBookmarks&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Desktop&lt;/strong&gt;&lt;/a&gt;  bookmarks.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkFileBookmarks&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark-file&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#StateRestoration&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark-list&lt;/strong&gt;&lt;/a&gt; bookmarks.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dired&lt;/strong&gt; and &lt;strong&gt;Dired-tree&lt;/strong&gt; bookmarks. Search for &quot;dired&quot; in the &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+ doc&lt;/a&gt;. There are 100 hits, as there is great synergy between Dired - in particular &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;, and bookmarking.&lt;/li&gt;&#xA;&lt;li&gt;Bookmark &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;tags&lt;/strong&gt;&lt;/a&gt;. Ad hoc tags let you organize bookmarks, and hence the Emacs objects that they target, into sets, including set hierarchies and other set organizations. Tags are arbitrary strings, or strings with associated Lisp values (any values).&lt;/li&gt;&#xA;&lt;li&gt;Composite, or &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#FunctionSequenceVarlistBookmarks&quot; rel=&quot;nofollow&quot;&gt;sequence&lt;/a&gt;, bookmarks, which combine other bookmarks.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Support_for_Projects&quot; rel=&quot;nofollow&quot;&gt;Icicles support for projects&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-06-30T01:10:40.940" LastActivityDate="2016-06-30T01:10:40.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24294" PostTypeId="2" ParentId="24269" CreationDate="2016-06-30T01:48:17.610" Score="2" Body="&lt;p&gt;The mode-line gets filled from left to right.  Anything in the mode-line that is clearly skewed to the right is most likely occurring because a filler has been used -- e.g., &lt;code&gt;read-only column 22 line 13 filler filler filler filler stuff-on-right&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the filler is based on a particular font that becomes smaller, or if certain textual components of the mode-line become smaller due to a font change or font size reduction, then there may appear to be extra space on the right.  The original poster should research the contents of the &lt;code&gt;mode-line-format&lt;/code&gt; to see what else is present, and modify those aspects accordingly so that certain aspects appear to be better right-aligned (using additional filler).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, like many users, the original poster could try out the default behavior of the mode-line without using any filler.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-06-30T01:48:17.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24295" PostTypeId="2" ParentId="24275" CreationDate="2016-06-30T01:48:59.713" Score="3" Body="&lt;p&gt;Fabrice added a variable for this not too long ago: &lt;code&gt;leuven-scale-outline-headlines&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most importantly, you'll have to set it to &lt;code&gt;nil&lt;/code&gt; before the theme is loaded. One way to do that is to it through &lt;code&gt;M-x customize-variable&lt;/code&gt; and then restart Emacs.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-06-30T01:48:59.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24296" PostTypeId="1" CreationDate="2016-06-30T05:18:28.527" Score="0" ViewCount="38" Body="&lt;p&gt;I'd like Emacs to treat this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dollar$sign&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as one word. So I evaluated this line &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(modify-syntax-entry ?$ &quot;w&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to have Emacs treat dollar sign as a word constituent rather than a symbol. However, when I run forward-word from the beginning of the line below, it stops at the dollar sign when I'd like it to stop at the &quot;n&quot; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dollar$sign&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I define dollar sign as a word constituent and have forward-word ignore it just like when it sees alphabet?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-06-30T05:18:28.527" Title="Can't define a glyph as a word constituent" Tags="|syntax-table|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24297" PostTypeId="1" CreationDate="2016-06-30T06:38:13.903" Score="1" ViewCount="408" Body="&lt;p&gt;I've been recently persuaded and coached to take the jump from vi to emacs. But one question sits funny. Why would one prefer to use the &lt;code&gt;ESC&lt;/code&gt;- &lt;em&gt;sequence&lt;/em&gt; for Meta- commands rather than ALT-key combinations. The symmetry is compelling (to me) toward the ALT- side. In particular using ALT-{digits} for C-u {digit} seems really nice. Do ESC-apists use that shortcut?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm a deep retro-computing enthusiast. Difference Engine, ENIAC, pdp/1, 7904. But realistically, I expect be running in an xterm for the forseeable future. Is there advantage to using ESC &lt;em&gt;in preference&lt;/em&gt; to ALT as a habit-forming decision beyond the (seemingly remote) possibility of having to use an ALT-deficient setup sometime somewhere?&lt;/p&gt;&#xA;" OwnerUserId="11810" LastActivityDate="2016-07-01T11:01:19.180" Title="Is there an advantage to learning ESC- instead of ALT- beyond &quot;maybe you'll use a system someday ...&quot;?" Tags="|keystrokes|" AnswerCount="1" CommentCount="3" ClosedDate="2016-07-12T17:07:47.353" ContentLicense="CC BY-SA 3.0" />
  <row Id="24298" PostTypeId="1" AcceptedAnswerId="24303" CreationDate="2016-06-30T08:10:50.590" Score="2" ViewCount="1788" Body="&lt;p&gt;I have a variable say &lt;code&gt;some-var&lt;/code&gt;, its value is a string. I want to use its &lt;em&gt;value&lt;/em&gt; in a &lt;code&gt;quote&lt;/code&gt; expression.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(some-var &quot;some string&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function who is using the above expression reports error because it gets &lt;code&gt;some-var&lt;/code&gt; literally...not the value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any trick to eval &lt;code&gt;some-var&lt;/code&gt; inside a &lt;code&gt;quote&lt;/code&gt; expression?&lt;/p&gt;&#xA;" OwnerUserId="12018" LastEditorUserId="105" LastEditDate="2018-05-30T23:59:16.087" LastActivityDate="2018-05-30T23:59:16.087" Title="Can I eval a value in quote?" Tags="|quote|eval|backquote|" AnswerCount="1" CommentCount="0" ClosedDate="2018-06-01T10:07:50.833" ContentLicense="CC BY-SA 3.0" />
  <row Id="24299" PostTypeId="2" ParentId="24287" CreationDate="2016-06-30T08:15:28.257" Score="7" Body="&lt;p&gt;Emacs knows two basic commands for running external processes, &lt;code&gt;call-process&lt;/code&gt; for synchronous processes, and &lt;code&gt;start-process&lt;/code&gt; for asynchronous processes. For the remote case, these commands have been extended as &lt;code&gt;process-file&lt;/code&gt; and &lt;code&gt;start-file-process&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remote synchronous processes use always the same ssh connection Tramp uses for its internal commands. Asynchronous processes will not block Tramp doing its job, a new ssh connection is used therefore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you consult the &lt;code&gt;grep&lt;/code&gt; docstring, you'll read that it is called asynchronously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the second remote connection reuses the credentials of the first connection if possible. For this, ssh is called like &lt;code&gt;ssh -q -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none hostname&lt;/code&gt;. Doesn't this work for you?&lt;/p&gt;&#xA;" OwnerUserId="2427" LastEditorUserId="7045" LastEditDate="2016-06-30T17:49:33.120" LastActivityDate="2016-06-30T17:49:33.120" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24301" PostTypeId="2" ParentId="24285" CreationDate="2016-06-30T10:06:48.280" Score="2" Body="&lt;p&gt;That's an easy one to write:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-find-directory ()&#xA;  &quot;A `dired-find-file' which only works on directories.&quot;&#xA;  (interactive)&#xA;  (let ((find-file-run-dired t)&#xA;        (file (dired-get-file-for-visit)))&#xA;    (when (file-directory-p file)&#xA;      (find-file file))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-06-30T10:06:48.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24302" PostTypeId="2" ParentId="24274" CreationDate="2016-06-30T10:17:18.793" Score="1" Body="&lt;p&gt;In general you can toggle the input method in the minibuffer exactly like you can in any other buffer. However, as Drew points out in the comments, isearch &lt;em&gt;doesn't use the minibuffer&lt;/em&gt; (it is actually just using the &lt;em&gt;echo area&lt;/em&gt; to display information).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To &lt;em&gt;isearch&lt;/em&gt; in a different input method you must enable the input method &lt;em&gt;before&lt;/em&gt; you start searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you have already entered isearch mode, you can type &lt;kbd&gt;M-e&lt;/kbd&gt; to &lt;em&gt;edit the pattern in the minibuffer&lt;/em&gt;, at which point you can toggle the input method with &lt;kbd&gt;C-\&lt;/kbd&gt; as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use Evil, but chen bin confirms that it makes no difference (although the key bindings I've mentioned may be different under Evil).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-30T21:40:41.327" LastActivityDate="2017-03-30T21:40:41.327" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24303" PostTypeId="2" ParentId="24298" CreationDate="2016-06-30T11:33:30.023" Score="10" Body="&lt;p&gt;You have two options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Don't use quotes at all, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list some-var &quot;some-string&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) Use a backquote. They work like quotes, but part of an expression can be evaluated by using &lt;code&gt;,&lt;/code&gt; and &lt;code&gt;,@&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(,some-var &quot;some-string&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-06-30T11:33:30.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24304" PostTypeId="2" ParentId="24290" CreationDate="2016-06-30T12:35:52.650" Score="1" Body="&lt;p&gt;See &lt;a href=&quot;http://blog.binchen.org/posts/how-to-manage-emacs-packages-effectively.html&quot; rel=&quot;nofollow&quot;&gt;http://blog.binchen.org/posts/how-to-manage-emacs-packages-effectively.html&lt;/a&gt; which provides complete solution for Emacs 23.4, 24.3, 24.4, 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, the easiest way is to setup your own package repository &lt;code&gt;localelpa&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 1, create directory &lt;code&gt;~/.emacs.d/localelpa&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 2,  create file &lt;code&gt;~/.emacs.d/localelpa/archive-contents&lt;/code&gt; with below content&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(1&#xA; (go-rename . [(1 2 1) nil &quot;This is go-rename, blah blah&quot; single])&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Step 3, place go-rename-1.2.1.el at &lt;code&gt;~/.emacs.d/localelpa&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 4, insert below code into &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; and restart Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;localelpa&quot; . &quot;~/.emacs.d/localelpa&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you will see package goname-1.2.1 after &lt;code&gt;M-x list-packages&lt;/code&gt;, in Emacs 24.4 you can tweak &lt;code&gt;package-pinned-packages&lt;/code&gt; to pin that package (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about Emacs 24.3, 23.4? Well, why not change version from 1.2.1 to 99.9.9? ;)&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-06-30T12:35:52.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24305" PostTypeId="2" ParentId="24221" CreationDate="2016-06-30T13:38:10.930" Score="1" Body="&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'gnus-group&#xA;  (gnus-group-list-all-groups 5))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in modern GNU Emacs or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (eval-after-load 'gnus-group&#xA;   '(gnus-group-list-all-groups 5))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in outdated GNU Emacs older than 24.4 (your case).&lt;/p&gt;&#xA;" OwnerUserId="9893" LastEditorUserId="9893" LastEditDate="2016-07-01T16:05:06.397" LastActivityDate="2016-07-01T16:05:06.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24306" PostTypeId="2" ParentId="24276" CreationDate="2016-06-30T13:54:20.840" Score="1" Body="&lt;p&gt;You can try setting the python interpreter to ipython with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-babel-python-command &quot;ipython&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then just use python with begin_src:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session myip&#xA;  %matplotlib inline&#xA;  import matplotlib.pyplot as plt&#xA;  import numpy as np&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2016-06-30T13:54:20.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24307" PostTypeId="1" CreationDate="2016-06-30T13:56:06.860" Score="3" ViewCount="376" Body="&lt;p&gt;Previously when I selected text and type something or insert from buffer, the selected text would get overwritten. Now it gets appended, apparently I've change some setting. What is it?&lt;/p&gt;&#xA;" OwnerUserId="11957" LastEditorUserId="105" LastEditDate="2016-06-30T17:06:50.687" LastActivityDate="2016-06-30T17:06:50.687" Title="Overwrite selected text" Tags="|delete-selection-mode|overwrite|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24308" PostTypeId="2" ParentId="20239" CreationDate="2016-06-30T14:55:15.117" Score="3" Body="&lt;p&gt;Outside of Cider, there is &lt;a href=&quot;https://github.com/rags/toggle-test&quot; rel=&quot;nofollow&quot;&gt;toggle-test&lt;/a&gt;, which can switch between source and test buffers in a language agnostic way.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-06-30T14:55:15.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24309" PostTypeId="1" CreationDate="2016-06-30T16:04:48.673" Score="2" ViewCount="439" Body="&lt;p&gt;When using &lt;code&gt;flycheck&lt;/code&gt; or &lt;code&gt;flymake&lt;/code&gt;, it would be nice to have quick fix functionality which gives suggested fixes and automatically applies them when selected like most IDE's provide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far the only thing i've found that seems to do this is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/ulises/quickfix-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/ulises/quickfix-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it looks like it isn't commonly used or actively maintained and only supports a couple of languages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything else out there? or is there something built-in to some commonly used programming modes that I might be missing?&lt;/p&gt;&#xA;" OwnerUserId="11397" LastActivityDate="2024-01-07T22:00:35.067" Title="What options are out there for quick-fix type functionality in emacs?" Tags="|flycheck|flymake|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24311" PostTypeId="1" AcceptedAnswerId="24316" CreationDate="2016-06-30T20:18:12.753" Score="0" ViewCount="305" Body="&lt;p&gt;I have written the following bit of emacs lisp that allows hl-line to extend past end of buffer to the rest of the line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem is, this only works if I use (eval-buffer) after start-up and not when I have it saved inside my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also modified linum.el so that every line the cursor is on displays the line number (based on the relevant portion from emacs-wiki).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I doubt that could cause this sort of difficulty. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I am trying to make the current highlight line act more like contemporary editors.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defvar-local hl-line-after-cursor nil&#xA;  &quot;Overlay used by Global-Hl-Line mode to highlight the current line.&quot;)&#xA;&#xA;&#xA;(defun my-hl-line-after-current-line()  &#xA;    (if (eq (line-end-position) (point-max))&#xA;        (progn&#xA;            (setq hl-line-after-cursor (make-overlay (line-end-position) (line-end-position)))&#xA;                (overlay-put hl-line-after-cursor 'after-string&#xA;                     (propertize (make-string (- (- (window-text-width) (- (line-end-position) (line-beginning-position))) 2) (string-to-char &quot; &quot;))&#xA;                     'face hl-line-face 'cursor 1))&#xA;            (move-overlay hl-line-after-cursor (line-end-position) (line-end-position))&#xA;        ))) &#xA;&#xA;&#xA;&#xA;(defun my-hl-line-after-unhighlight ()&#xA;&quot;Deactivate the Hl-Line overlay on the current line.&quot;&#xA;(when hl-line-after-cursor&#xA;(delete-overlay hl-line-after-cursor)))&#xA;&#xA;(add-hook 'pre-command-hook #'my-hl-line-after-unhighlight nil t)&#xA;(add-hook 'post-command-hook #'my-hl-line-after-current-line nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(debug)&#xA;(setq user-full-name &quot;YOUR NAME&quot;)&#xA;(setq user-mail-address &quot;YOUR EMAIL ADDRESS&quot;)&#xA;&#xA;;;&#xA;;; Basic Setup&#xA;;;&#xA;(prefer-coding-system 'utf-8)&#xA;;; Shorten yes-or-no prompts&#xA;(fset 'yes-or-no-p 'y-or-n-p)&#xA;;; This code stashes backups in ~/.emacs.d/backups&#xA;(setq backup-directory-alist '((&quot;.&quot; . &quot;~/.emacs.d/backups&quot;)))&#xA;;; This code removes the ugly tool bar&#xA;(tool-bar-mode -1)&#xA;;; Matching parenthesis highlight&#xA;(show-paren-mode 1)&#xA;;; Show line numbers&#xA;(global-linum-mode 1)&#xA;;; Set window title to full file name  &#xA;(setq frame-title-format '(&quot;Emacs @ &quot; system-name &quot;: %b %+%+ %f&quot;))&#xA;;; Set up smooth scrolling&#xA;(setq redisplay-dont-pause t&#xA;      scroll-margin 1&#xA;      scroll-step 1&#xA;      scroll-conservatively 10000&#xA;      scroll-preserve-screen-position 1)&#xA;;; get rid of the scroll bar boxes&#xA;(scroll-bar-mode -1)&#xA;;; Set the tab width to 2 by default&#xA;(setq-default tab-width 2)&#xA;;; No dinging during exceptions&#xA;(setq visible-bell 1)&#xA;;; Enable keybinding to Caps Lock key&#xA;(setq w32-enable-caps-lock nil)&#xA;;; Highlight current line&#xA;(global-hl-line-mode +1)&#xA;&#xA;(require 'package)&#xA;(setq package-archives '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                        (&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;                        (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))&#xA;(package-initialize)&#xA;&#xA;(add-to-list 'custom-theme-load-path &quot;~/.emacs.d/themes/&quot;)&#xA;(load-theme 'solarized t)&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(custom-safe-themes&#xA;     (quote&#xA;        (&quot;a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0&quot; default))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&#xA;;; The default &quot;C-x c&quot; is quite close to &quot;C-x C-c&quot;, which quits Emacs.&#xA;;; Changed to &quot;C-c h&quot;. Note: We must set &quot;C-c h&quot; globally, because we&#xA;;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.&#xA;(global-set-key (kbd &quot;C-c h&quot;) 'helm-command-prefix)&#xA;(global-unset-key (kbd &quot;C-x c&quot;))&#xA;(global-set-key (kbd &quot;M-x&quot;) 'helm-M-x)&#xA;&#xA;&#xA;    ; (add-to-list 'load-path &quot;~/site-lisp/wolfram-mode-master/&quot;)   &#xA;    ; (require wolfram-mode)&#xA;     ; (autoload 'wolfram-mode &quot;wolfram-mode&quot; nil t)&#xA; ; (autoload 'run-wolfram &quot;wolfram-mode&quot; nil t)&#xA; ; (setq wolfram-program &quot;C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Wolfram Mathematica&quot;)&#xA; ; (add-to-list 'auto-mode-alist '(&quot;\\.m$&quot; . wolfram-mode))&#xA; ; (setq wolfram-path &quot;C:\Program Files\Wolfram Research\Mathematica\10.4&quot;)  ;; e.g. on Linux &quot;~/.Mathematica/Applications&quot;&#xA;&#xA;&#xA; ;(overlay-put (make-overlay (line-end-position) (point-max)) 'after-string (propertize &quot; &quot; 'face '(:background &quot;gray50&quot; :foreground &quot;black&quot;)))&#xA; (defvar-local hl-line-after-cursor nil&#xA;  &quot;Overlay used by Global-Hl-Line mode to highlight the current line.&quot;)&#xA;&#xA;&#xA;            (defun my-hl-line-after-current-line()  &#xA;            (if (eq (line-end-position) (point-max))&#xA;            (progn&#xA;                (setq hl-line-after-cursor (make-overlay (line-end-position) (line-end-position)))&#xA;                (overlay-put hl-line-after-cursor 'after-string&#xA;                     (propertize (make-string (- (- (window-text-width) (- (line-end-position) (line-beginning-position))) 2) (string-to-char &quot; &quot;))&#xA;                     'face hl-line-face 'cursor 1))&#xA;            (move-overlay hl-line-after-cursor (line-end-position) (line-end-position))&#xA;        ;(overlay-put hl-line-after-cursor 'priority -50)&#xA;        ))) &#xA;&#xA;&#xA;&#xA;        (defun my-hl-line-after-unhighlight ()&#xA;          &quot;Deactivate the Hl-Line overlay on the current line.&quot;&#xA;          (when hl-line-after-cursor&#xA;            (delete-overlay hl-line-after-cursor)))&#xA;&#xA;        (add-hook 'pre-command-hook #'my-hl-line-after-unhighlight nil t)&#xA;        (add-hook 'post-command-hook #'my-hl-line-after-current-line nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&#xA;Below is my best attempt, stefans tip definitely helped as did Drews but its not quite bullet-proof yet.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun my-hl-line-after-current-line()&#xA;    (unless (eq (current-buffer) (window-buffer (minibuffer-window)))&#xA;        ; (if (eq (car (window-margins)) nil)&#xA;        ; (setq linum/margin 0)&#xA;        ; (setq linum/margin (car (window-margins))))&#xA;    (setq hl-line-after-cursor (make-overlay (line-end-position) (line-end-position)))&#xA;    (let ((win (- (window-width) (if (= 0 (or (cdr fringe-mode) 1)) 1 0)))&#xA;    ;(let ((win (- (window-text-width) linum/margin))&#xA;    (line (- (line-end-position) (line-beginning-position))))&#xA;    (overlay-put hl-line-after-cursor 'after-string &#xA;    (if (&amp;gt; win line) &#xA;    (cond&#xA;        ((eq (line-end-position) (line-beginning-position)) ;; Sub-if-then&#xA;            (goto-char (line-beginning-position))&#xA;&#xA;            (propertize (make-string (- win line) (string-to-char &quot; &quot;))&#xA;            'face hl-line-face 'cursor 1)&#xA;            ) &#xA;        ((eq (line-end-position) (point-max))   ;; Sub-if-then&#xA;&#xA;            (propertize (make-string (- win line) (string-to-char &quot; &quot;))&#xA;            'face hl-line-face 'cursor 1)&#xA;&#xA;            ;(move-overlay hl-line-after-cursor (line-end-position) (line-end-position))&#xA;            )           &#xA;        (t  ;; Else     &#xA;            (propertize (make-string (- win line 1) (string-to-char &quot; &quot;))&#xA;            'face hl-line-face 'cursor 1)&#xA;&#xA;            )) &#xA;    nil&#xA;        )))&#xA;    ))&#xA;&#xA;    (defun my-hl-line-after-unhighlight ()&#xA;      &quot;Deactivate the Hl-Line overlay on the current line.&quot;&#xA;      (when hl-line-after-cursor&#xA;        (delete-overlay hl-line-after-cursor)))&#xA;&#xA;    (add-hook 'pre-command-hook #'my-hl-line-after-unhighlight)&#xA;    (add-hook 'post-command-hook #'my-hl-line-after-current-line) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had to utilize a &quot;cond&quot; statement to get around some weird issues that were popping up, I'd go into detail if my wife wasn't rushing me to pack. (to see it, just comment out the first block of the cond and look at the right margin). But the above works for the most part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things I have been unable to solve are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;proper scaling with text (zoom and un-zoom)&lt;/li&gt;&#xA;&lt;li&gt;automatically updating after a window size change.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;any help/suggestions for that part are greatly appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-update 2: I also noticed that typing &quot;f&quot; causes the line to bink for a moment, none of the other letters typed do this.&#xA;Also for whatever reason I notice that the above works in my spacemacs config on my usb drive but not my installed config on my laptop, (I have to comment out first part of &quot;cond&quot;)&lt;/p&gt;&#xA;" OwnerUserId="11955" LastEditorUserId="105" LastEditDate="2016-12-22T17:26:54.923" LastActivityDate="2016-12-22T17:26:54.923" Title="Eval-buffer works, init does not hl-line fix" Tags="|highlighting|overlays|line-numbers|hl-line-mode|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24313" PostTypeId="1" CreationDate="2016-06-30T22:10:25.097" Score="2" ViewCount="139" Body="&lt;p&gt;As of version 8.3 of org, numbering of subtrees in export &lt;a href=&quot;http://orgmode.org/Changes.html&quot; rel=&quot;nofollow&quot;&gt;can be toggled&lt;/a&gt; via the &lt;code&gt;:UNNUMBERED&lt;/code&gt; property.  This applies to subheadings &lt;em&gt;regardless of their own&lt;/em&gt; &lt;code&gt;:UNNUMBERED&lt;/code&gt; property value.  MWE:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;:PROPERTIES:&#xA;:UNNUMBERED: t&#xA;:END:&#xA;** Subheading&#xA;:PROPERTIES:&#xA;:UNNUMBERED: nil&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This generates for LaTeX export&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;\section*{Heading}&#xA;\label{sec:orgheadline2}&#xA;\subsection*{Subheading}&#xA;\label{sec:orgheadline1}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there some other way to toggle this at the subheading level?  I need a heading to be un-numbered when exported to LaTeX, but its child subheading to be numbered.  I.e. &lt;code&gt;\section*{Heading}&lt;/code&gt; and &lt;code&gt;\subsection{Subheading}&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8818" LastActivityDate="2016-06-30T22:10:25.097" Title="org mode: Numbered subtree whose parent has UNNUMBERED: t" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24314" PostTypeId="1" AcceptedAnswerId="24315" CreationDate="2016-07-01T00:23:03.337" Score="6" ViewCount="2018" Body="&lt;p&gt;I'm currenty using emacs line highlighting and I found it useful when doing my work in GUI version of emacs. However, I find it uncomfortable to have such mode during my work in terminal. The color of higlight there makes current line being edited almost impossible to read. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The line in my &lt;code&gt;.emacs&lt;/code&gt; file which is responsible for enabling this mode globally is: &lt;code&gt;(global-hl-line-mode t)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is:&lt;/strong&gt; is there a way to disable &lt;code&gt;hl-line-mode&lt;/code&gt; only in terminal? I'm using xfce4-terminal and guake.&lt;/p&gt;&#xA;" OwnerUserId="11470" LastActivityDate="2022-11-29T21:11:33.657" Title="Disable line highlighting in terminal" Tags="|terminal-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24315" PostTypeId="2" ParentId="24314" CreationDate="2016-07-01T03:02:07.030" Score="4" Body="&lt;p&gt;Enable highlight mode only in gui version of emacs by wrapping the command inside if window-system.&lt;/p&gt;&#xA;&lt;p&gt;The value of the window system variable is nil incase of terminals&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(if window-system (global-hl-line-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Reference &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Systems.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Systems.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;NOTE : use &lt;strong&gt;&lt;code&gt;(display-graphic-p)&lt;/code&gt;&lt;/strong&gt;  instead of &lt;code&gt;window-system&lt;/code&gt;. For more information refer the comments by Drew.&lt;/p&gt;&#xA;" OwnerUserId="9573" LastEditorUserId="39327" LastEditDate="2022-11-29T21:11:33.657" LastActivityDate="2022-11-29T21:11:33.657" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="24316" PostTypeId="2" ParentId="24311" CreationDate="2016-07-01T07:21:55.740" Score="1" Body="&lt;p&gt;The problem is coming from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'pre-command-hook #'my-hl-line-after-unhighlight nil t)&#xA;(add-hook 'post-command-hook #'my-hl-line-after-current-line nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;nil t&lt;/code&gt; at the end means that you only add those to the local part of the hook, i.e. it will only apply to commands executed in &quot;the current buffer&quot; where &quot;current&quot; means &quot;current when the &lt;code&gt;add-hook&lt;/code&gt; is executed, IOW current when the ~/.emacs is read (usually &lt;code&gt;*scratch*&lt;/code&gt;).  Just remove those &lt;code&gt;nil t&lt;/code&gt; and my crystal ball says it should work.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="304" LastEditDate="2016-07-01T10:43:51.800" LastActivityDate="2016-07-01T10:43:51.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24317" PostTypeId="2" ParentId="24297" CreationDate="2016-07-01T11:01:19.180" Score="4" Body="&lt;p&gt;Emacs has a &lt;em&gt;lot&lt;/em&gt; of keybindings. I have never used a system where some Emacs keybindings did not clash with the underlying system. Every window manager intercepts a different set of keybindings, so the keystrokes don't even reach Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using ESC is a fallback for when you can't type Alt-something directly in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-07-01T11:01:19.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24318" PostTypeId="2" ParentId="14571" CreationDate="2016-07-01T12:41:19.693" Score="3" Body="&lt;p&gt;as a workaround I make it invisible by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'flycheck-fringe-warning nil :foreground (face-attribute 'fringe :background ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;similarly, I removed the underline with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'flycheck-warning nil :underline nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12535" LastActivityDate="2016-07-01T12:41:19.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24319" PostTypeId="2" ParentId="24284" CreationDate="2016-07-01T15:45:26.800" Score="1" Body="&lt;p&gt;Both packages are available in &lt;a href=&quot;https://melpa.org/#/getting-started&quot; rel=&quot;nofollow&quot;&gt;melpa&lt;/a&gt;. You can follow instructions on how to add this repo:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then, you can &lt;code&gt;M-x list-packages&lt;/code&gt; and select them for installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FOLLOWUP:type &lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;x&lt;/kbd&gt;, then &lt;code&gt;install-packages&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, select the packages with &lt;kbd&gt;i&lt;/kbd&gt;, then execute the installation with &lt;kbd&gt;x&lt;/kbd&gt;. See &lt;a href=&quot;https://www.emacswiki.org/emacs/InstallingPackages#toc2&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for more info&lt;/p&gt;&#xA;" OwnerUserId="10785" LastEditorUserId="10785" LastEditDate="2016-07-01T19:09:32.093" LastActivityDate="2016-07-01T19:09:32.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24320" PostTypeId="2" ParentId="24264" CreationDate="2016-07-01T20:30:37.820" Score="2" Body="&lt;p&gt;Fascinating. I can exactly reproduce what you're running in to if I try to use the &lt;code&gt;customization&lt;/code&gt; interface. However! I can successfully change the value of &lt;code&gt;tramp-remote-path&lt;/code&gt; by skipping the &lt;code&gt;customization&lt;/code&gt; interface, either of two different ways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, tramp expects &lt;code&gt;tramp-remote-path&lt;/code&gt; to be a list, so my inclination is to do this (in my &lt;code&gt;init.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;(add-to-list 'tramp-remote-path &quot;/home/gastove/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, setting to a single directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;(setq tramp-remote-path '(&quot;/home/gastove&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-07-01T20:30:37.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24321" PostTypeId="1" CreationDate="2016-07-01T21:40:43.043" Score="2" ViewCount="867" Body="&lt;p&gt;I'm using &lt;code&gt;markdown-mode&lt;/code&gt;.  I followed these instructions to render LaTeX math strings: &lt;a href=&quot;http://jblevins.org/projects/markdown-mode/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://jblevins.org/projects/markdown-mode/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am rendering to HTML with &lt;code&gt;markdown-export&lt;/code&gt; and &lt;code&gt;markdown-live-preview-mode&lt;/code&gt;.  Have I assumed incorrectly that these LaTeX expressions can be rendered to HTML?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple LaTeX strings render fine:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;then the event ${ \tau \leq n }$ is just&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/drXYI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/drXYI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any LaTeX string with a function inside does not render:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;with probability $\frac{1}{2}$ and&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HbTBZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HbTBZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extra curly braces do not fix rendering:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;with probability ${\frac{1}{2}}$ and&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think I have the relevant Macports ports installed, and the relevant Emacs packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6682" LastActivityDate="2017-01-31T20:12:02.620" Title="`markdown-mode` only renders some, not all, LaTeX strings" Tags="|latex|html|markdown-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24322" PostTypeId="1" AcceptedAnswerId="30412" CreationDate="2016-07-02T08:27:20.297" Score="4" ViewCount="370" Body="&lt;p&gt;I use an asynchronous helm source (a process) to query a database and want to use helm search to restrict the matches.&#xA;Currently I start helm with something like that:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (helm :sources (helm-build-async-source &quot;query&quot;&#xA;               :candidates-process&#xA;               #'cc-query&#xA;               :candidate-transformer&#xA;               #'helm-cc--candidates-formatter&#xA;               :action&#xA;               '((&quot;find file&quot; . helm-cc--action-find-files)&#xA;                 (&quot;save results in buffer&quot; . helm-cc--action-save-buffer)&#xA;                 (&quot;compare&quot; . helm-cc--action-ediff-files)))&#xA;    :buffer &quot;*helm async source*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;cc-query&lt;/code&gt; is not much more than a &lt;code&gt;start-process&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That works so far, however, the query is very very slow and is restarted with each pattern change. Can I avoid this restart?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I use the asynchronous source, because I do not want to wait for the query to be finished.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2017-02-02T10:37:51.483" LastActivityDate="2017-02-03T05:56:33.393" Title="Asynchronous helm source without process restart" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24323" PostTypeId="1" AcceptedAnswerId="24420" CreationDate="2016-07-02T08:31:43.597" Score="1" ViewCount="1041" Body="&lt;p&gt;When I work on a &lt;code&gt;.py&lt;/code&gt; file a new buffer appear (&lt;code&gt;*Python Completions*&lt;/code&gt;) and sometimes auto-complete my code (every time in a wrong way !).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like this (on the right side, when I tiped &lt;code&gt;i&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9Sx7n.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9Sx7n.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is causing it and how may I disable it ?&lt;/p&gt;&#xA;" OwnerUserId="10056" LastActivityDate="2019-03-25T15:52:36.547" Title="How to disable *Python Completions*?" Tags="|python|completion|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24324" PostTypeId="2" ParentId="24246" CreationDate="2016-07-02T08:35:06.903" Score="1" Body="&lt;p&gt;Run &lt;code&gt;M-x customize-group&lt;/code&gt; and you should see a group called &lt;code&gt;org-pomodoro&lt;/code&gt;. All related options, including the sound, should be there.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2016-07-02T08:35:06.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24325" PostTypeId="1" CreationDate="2016-07-02T08:39:37.627" Score="0" ViewCount="142" Body="&lt;p&gt;vim has a really great feature for defining keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from the &lt;a href=&quot;https://neovim.io/doc/user/map.html#mapping&quot; rel=&quot;nofollow&quot;&gt;vim docs&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:cno[remap] {lhs} {rhs}     |mapmode-c| *:cno* *:cnoremap*&#xA;            Map the key sequence {lhs} to {rhs} for the modes&#xA;            where the map command applies.  Disallow mapping of&#xA;            {rhs}, to avoid nested and recursive mappings.  Often&#xA;            used to redefine a command.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically, the &lt;code&gt;:cnoremap&lt;/code&gt; command creates a keybinding, but forbids any further redefinitions of it. This made defining keybindings in vim always easy for me. However, in emacs i don't know such a command - currently I use commands like &lt;code&gt;(global-set-key [f8] 'my/copy-to-clipboard)&lt;/code&gt; to define my keybindings. Unfortunately, this is really a pain, because other packages can easily remap that (in my case, the &lt;code&gt;evil&lt;/code&gt; package). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can i define a keybinding in emacs, which can't be modified, once it is set?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Important edit&lt;/strong&gt;: I don't want to restrict what can be done to &lt;code&gt;lhs&lt;/code&gt; - I want just prevent a redefinition/modification of &lt;code&gt;rhs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="11174" LastEditDate="2016-07-02T12:24:38.377" LastActivityDate="2016-09-30T14:04:42.620" Title="How can i define a keybinding, which can't be modified, once it is set?" Tags="|key-bindings|" AnswerCount="1" CommentCount="9" ClosedDate="2016-09-30T18:56:17.170" ContentLicense="CC BY-SA 3.0" />
  <row Id="24327" PostTypeId="2" ParentId="24325" CreationDate="2016-07-02T11:36:08.953" Score="0" Body="&lt;p&gt;Thanks to the comment of @phils (especially for &lt;a href=&quot;https://stackoverflow.com/a/683575&quot;&gt;this stackoverflow answer&lt;/a&gt;), i found now a solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-keys-minor-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map [f8] 'my/copy-to-clipboard)&#xA;    (define-key map  [C-x b] 'helm-mini)&#xA;    map)&#xA;  &quot;my-keys-minor-mode keymap.&quot;)&#xA;&#xA;(define-minor-mode my-keys-minor-mode&#xA;  &quot;A minor mode so that my key settings override annoying major modes.&quot;&#xA;  :init-value t&#xA;  :lighter &quot; my-keys&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The keybinding style using &lt;code&gt;(define-key map (kbd &quot;C-x b&quot;) 'helm-mini)&lt;/code&gt; didn't work unfortunately - but &lt;code&gt;(define-key map  [C-x b] 'helm-mini)&lt;/code&gt; does now. (&lt;code&gt;C-x b&lt;/code&gt; was before bound to an evil command)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-07-02T11:36:08.953" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24328" PostTypeId="1" CreationDate="2016-07-02T12:08:01.050" Score="1" ViewCount="96" Body="&lt;p&gt;Currently, edebug doesn't understand the &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt; macro in dash.el.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (-&amp;gt;&amp;gt; (+ 1 1)&#xA;       (+ 2)&#xA;       (* 3)&#xA;       (format &quot;%s&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-u M-x edebug-eval-defun&lt;/code&gt; followed by &lt;code&gt;M-: (foo)&lt;/code&gt; does not step through the forms inside &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt;. It just shows the value of the whole &lt;code&gt;(-&amp;gt;&amp;gt; ...)&lt;/code&gt; expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Instrumenting-Macro-Calls.html&quot; rel=&quot;nofollow&quot;&gt;the docs for &lt;code&gt;declare&lt;/code&gt;&lt;/a&gt;, I don't think I can teach edebug about all the arguments to &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt;. However, the first argument is a form, so I would like to edebug to step through that. I tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro -&amp;gt;&amp;gt; (x &amp;amp;optional form &amp;amp;rest more)&#xA;  &quot;Thread the expr through the forms. ...&quot;&#xA;  (declare (debug (form &amp;amp;rest 0)))&#xA;   ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this gives me &quot;edebug-match-specs: Too deep - perhaps infinite loop in spec?&quot; when I try to call &lt;code&gt;edebug-eval-defun&lt;/code&gt; on &lt;code&gt;foo&lt;/code&gt; afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I annotate a macro so that the first argument is a form, but edebug skips the rest?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-07-02T12:08:01.050" Title="How do I teach edebug to only evaluate some macro arguments?" Tags="|elisp-macros|edebug|declare|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24329" PostTypeId="1" AcceptedAnswerId="24333" CreationDate="2016-07-02T12:23:37.913" Score="3" ViewCount="229" Body="&lt;p&gt;I want to add extra expressions to some JS code, but taking care of the correct element ID (in the example below, the ID is &lt;code&gt;scatter&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;document.getElementById(&quot;scatter&quot;).height=&quot;400&quot;; --&amp;gt;&#xA;document.getElementById(&quot;scatter&quot;).height=&quot;400&quot;; document.getElementById(&quot;scatter&quot;).style=&quot;visibility: visible&quot;; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My attempt so far has been:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-regexp RET &#xA;Id(&quot;\(\w+\)&quot;).height=&quot;400&quot;; RET &#xA;Id(&quot;\0&quot;).height=&quot;400&quot;; document.getElementById(&quot;\0&quot;).style=&quot;visibility: visible&quot;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;\(\w+\)&lt;/code&gt; grabs the element ID and &lt;code&gt;\0&lt;/code&gt; references it on the replacement string.&#xA;Unfortunately &lt;code&gt;replace-regexp&lt;/code&gt; is complaining that I'm using &lt;code&gt;\&lt;/code&gt;incorrectly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone point out what I'm doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2016-07-02T14:38:19.797" Title="Problem with replace-regexp - Invalid use of \ in replacement" Tags="|regular-expressions|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24330" PostTypeId="1" AcceptedAnswerId="24369" CreationDate="2016-07-02T13:08:38.860" Score="2" ViewCount="300" Body="&lt;p&gt;so i have this function i found on the interent&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (defun set-no-process-query-on-exit ()&#xA; (let ((proc (get-buffer-process (current-buffer))))&#xA;   (when (processp proc)&#xA;     (set-process-query-on-exit-flag proc nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(add-hook 'term-exec-hook 'set-no-process-query-on-exit)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it works great by disabling confirmation when you close a terminal. it works on multi-term, ansi-term, ehsell but for some bizzaro reason not on shell. any one knows why?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-07-02T16:25:04.937" LastActivityDate="2016-07-04T21:00:57.807" Title="have a function to disable close confirmation on terms. work on all terms but shell?" Tags="|term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24331" PostTypeId="1" AcceptedAnswerId="24341" CreationDate="2016-07-02T13:31:59.420" Score="1" ViewCount="1524" Body="&lt;p&gt;So, I've made a little batch file that simply compiles all the code I need and moves it to their right places. I've seen some people using the compile function  to launch something like the batch file I've made, but I can't seen to figure out how they do that. Also, I need the launch environment to be the same as the batch file is. This is the batch I have.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@echo off&#xA;mkdir ..\..\build&#xA;pushd ..\..\build&#xA;cl -Zi ..\alfa\code\win32_alfa.cpp user32.lib gdi32.lib&#xA;popd&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's also a second feature I would like to know if it's possible. Can I somewhat search the folders near where my code is and if it finds the build.bat, launch it?&lt;/p&gt;&#xA;" OwnerUserId="12538" LastEditorUserId="105" LastEditDate="2016-07-02T14:18:34.327" LastActivityDate="2016-07-02T23:21:51.120" Title="Run batch file from Emacs" Tags="|batch-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24332" PostTypeId="1" AcceptedAnswerId="24337" CreationDate="2016-07-02T14:29:49.973" Score="1" ViewCount="207" Body="&lt;p&gt;I have written this crappy code (i cant really code) to save a split orgmode agenda views with different agenda views.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z/buffers-restore-agenda-split   ()&#xA; (interactive)    &#xA; (org-agenda nil &quot;a&quot;)&#xA; (split-window-right)&#xA; (org-agenda nil &quot;ba&quot;)&#xA; (split-window-below)&#xA; (org-agenda nil &quot;bb&quot;)&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the function does split the windows correctly yet all the views get the last option (&quot;bb&quot;) instead of a different view in each window&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any clue why this happens?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-07-02T18:54:38.463" Title="create org split agenda view, problems with differnt agendas in split windows" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24333" PostTypeId="2" ParentId="24329" CreationDate="2016-07-02T14:38:19.797" Score="2" Body="&lt;p&gt;In a regexp replacement pattern, &lt;code&gt;\N&lt;/code&gt; matches a subgroup, and &lt;code&gt;\1&lt;/code&gt;, not &lt;code&gt;\0&lt;/code&gt; matches the first subgroup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just filed Emacs bug #&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23884&quot; rel=&quot;nofollow&quot;&gt;23884&lt;/a&gt; to help clarify the doc about this.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-02T14:38:19.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24334" PostTypeId="1" CreationDate="2016-07-02T15:26:00.397" Score="3" ViewCount="68" Body="&lt;p&gt;I was wondering if one can have a set of definitions in dired to sort (and maybe also filter) that are per directory. this would be also saved for all future sessions.&#xA;any one knows of such a method?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2016-07-02T19:58:24.817" LastActivityDate="2016-09-04T13:16:01.117" Title="Per-directory local settings in Dired, to sort folders differently" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24335" PostTypeId="1" AcceptedAnswerId="26070" CreationDate="2016-07-02T16:04:00.547" Score="2" ViewCount="522" Body="&lt;p&gt;I want to manipulate an org mode source block that is referenced with &lt;code&gt;noweb&lt;/code&gt; in an eLisp source block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: conceptmap&#xA;#+begin_src org :results value raw :exports results&#xA;(ONE) {TWO} (THREE)&#xA;(FOUR) {FIVE} (SIX)&#xA;#+end_src&#xA;&#xA;#+begin_src emacs-lisp :noweb yes :results output &#xA;(downcase (&amp;lt;&amp;lt;conceptmap()&amp;gt;&amp;gt;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The desired result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(one) {two} (three)&#xA;(four) {five} (six)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The actual result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(downcase ((ONE) {TWO} (THREE)&#xA;(downcase ((FOUR) {FIVE} (SIX))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is it that the function &lt;code&gt;downcase&lt;/code&gt; is not executed, and why is it that it is repeated? What is &lt;code&gt;&amp;lt;&amp;lt;conceptmap()&amp;gt;&amp;gt;&lt;/code&gt; in reality? Can it be treated like a string or text block?&lt;/p&gt;&#xA;" OwnerUserId="8928" LastActivityDate="2016-08-04T17:14:48.187" Title="Use noweb reference in eLisp code in source block in org-mode" Tags="|org-mode|literate-programming|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24336" PostTypeId="1" CreationDate="2016-07-02T18:27:34.060" Score="4" ViewCount="406" Body="&lt;p&gt;As a longtime git user, I'm familiar with the following workflow for collaborative projects: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;My private repository is where I make local changes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;My public repository is where I push changes that I have made that are ready for others to pull&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The project repository is where I pull centrally approved changes from.  (It's the one that is managed by gatekeepers.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In this workflow, I set the &quot;remote&quot; to the project repository, and that's where I pull form.  I set the &quot;push remote&quot; to my public repository, and that's where I push to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a recently arrived and very happy Magit user, I'm trying to figure out what corresponding workflows work well with Magit.  The ability to push to &lt;em&gt;two&lt;/em&gt; different remotes (&lt;kbd&gt;P p&lt;/kbd&gt; and &lt;kbd&gt;P u&lt;/kbd&gt;) has me baffled.  I'm not sure if these two correspond to the remotes that I'm used to, and I'm definitely not accustomed to push to more than one remote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read the &lt;a href=&quot;https://magit.vc/manual/magit/The-two-remotes.html#The-two-remotes&quot; rel=&quot;nofollow&quot;&gt;section on the two remotes&lt;/a&gt; in the Magit manual, but I am not enlightened.  Can anyone explain to me what are good workflows for Magit's &lt;em&gt;two&lt;/em&gt; remotes?  Or point me to an explanation written elsewhere that you like?&lt;/p&gt;&#xA;" OwnerUserId="9343" LastEditorUserId="306" LastEditDate="2016-08-31T10:45:36.360" LastActivityDate="2016-08-31T10:45:36.360" Title="In Magit, what are good workflows for the two remotes?" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24337" PostTypeId="2" ParentId="24332" CreationDate="2016-07-02T18:54:38.463" Score="1" Body="&lt;p&gt;The problem is that the default behaviour of &lt;code&gt;org-agenda&lt;/code&gt; is to &lt;em&gt;replace&lt;/em&gt; the contents of the agenda buffer rather than making new agenda buffer.  You can change this by setting the variable &lt;code&gt;org-agenda-sticky&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non-nil means agenda q key will bury agenda buffers.&#xA;  Agenda commands will then show existing buffer instead of generating new ones.&#xA;  When nil, ‘q’ will kill the single agenda buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can set this globally or just set it temporarily in your function using &lt;code&gt;let&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z/buffers-restore-agenda-split   ()&#xA;  (interactive)&#xA;  (let ((org-agenda-sticky t))&#xA;    (org-agenda nil &quot;a&quot;)&#xA;    (split-window-right)&#xA;    (org-agenda nil &quot;ba&quot;)&#xA;    (split-window-below)&#xA;    (org-agenda nil &quot;bb&quot;)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-07-02T18:54:38.463" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24339" PostTypeId="1" AcceptedAnswerId="24343" CreationDate="2016-07-02T22:19:26.797" Score="2" ViewCount="238" Body="&lt;p&gt;I have a function that gathers strings that looks like these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Example #1:   &lt;code&gt;:event:lawlist:HIGH:misc:&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Example #2:  &lt;code&gt;:LOW:&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Example #3:  &lt;code&gt;:MEDIUM:task:george:&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I created a monstrosity of a snippet that breaks the string down into various sub-components, adds text properties to each component, and then reconstructs the new string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  Is there a more sophisticated way to do this project?&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let* (&#xA;    new-list&#xA;    (string &quot;:event:lawlist:HIGH:misc:&quot;)&#xA;    (lst (delete &quot;&quot; (split-string string &quot;:&quot;)))&#xA;    (separator (propertize &quot;:&quot; 'face '(:foreground &quot;cyan&quot;))) )&#xA;  (dolist (e lst)&#xA;    (put-text-property 0 (length e) 'face&#xA;      (cond&#xA;        ((string= e &quot;event&quot;)&#xA;          '(:foreground &quot;red&quot;))&#xA;        ((string= e &quot;lawlist&quot;)&#xA;          '(:foreground &quot;blue&quot;))&#xA;        ((string= e &quot;HIGH&quot;)&#xA;          '(:foreground &quot;yellow&quot;))&#xA;        (t&#xA;          'default))&#xA;      e)&#xA;    (push e new-list))&#xA;  (concat separator (mapconcat 'identity (reverse new-list) separator) separator))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-07-03T06:57:20.843" Title="How to programmatically walk along string and add text properties" Tags="|text-properties|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24340" PostTypeId="1" CreationDate="2016-07-02T22:35:08.347" Score="2" ViewCount="68" Body="&lt;p&gt;I am writing a translation and I have found myself translating the same words again and again. I would like to have a file where I could write all the common substitutions I am doing (and hopefully have the ability to add a new substitution rule easily). For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;source code -&amp;gt; código fuente&#xA;computer -&amp;gt; ordenador&#xA;of the -&amp;gt; del&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And to have a command which could allow me to lookup the current word under the cursor on this file and to substitute it if it was found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to notice that the word's context is irrelevant to me and that the substitution rules could affect more than one word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I achieve this? Is there any built-in command or minor-mode doing exactly this?&lt;/p&gt;&#xA;" OwnerUserId="12208" LastEditorUserId="12208" LastEditDate="2016-07-03T09:00:57.797" LastActivityDate="2016-07-03T09:00:57.797" Title="Using a substitution rules file" Tags="|replace|translation|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24341" PostTypeId="2" ParentId="24331" CreationDate="2016-07-02T23:21:51.120" Score="0" Body="&lt;p&gt;Um, it's pretty simple, you use &lt;kbd&gt;M-x compile&lt;/kbd&gt;, it prompts you for a command to use and you specify your script.&lt;/p&gt;&#xA;" OwnerUserId="11699" LastActivityDate="2016-07-02T23:21:51.120" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24342" PostTypeId="2" ParentId="22728" CreationDate="2016-07-02T23:23:17.753" Score="3" Body="&lt;p&gt;Here is the documentation for the &lt;code&gt;magit-save-repository-buffers&lt;/code&gt; variable, which describes the behavior for values &lt;code&gt;t&lt;/code&gt;, &lt;code&gt;nil&lt;/code&gt;, and &lt;code&gt;'dontask&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation: Whether to save file-visiting buffers when appropriate.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If this is non-nil then all modified file-visiting buffers belonging&#xA;  to the current repository may be saved before running commands, before&#xA;  creating new Magit buffers, and before explicitly refreshing such&#xA;  buffers.  If this is `dontask' then this is done without user&#xA;  intervention, if it is t then the user has to confirm each save. &#xA;  `dontask' is the recommended setting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="594" LastActivityDate="2016-07-02T23:23:17.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24343" PostTypeId="2" ParentId="24339" CreationDate="2016-07-03T06:57:20.843" Score="2" Body="&lt;p&gt;The following is an alternative (but similar) method as described in the question above to walk (loop through) a string and add text properties:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun walk-string+add-face (str)&#xA;  (loop with start = 0&#xA;        with regexp = &quot;[a-zA-Z0-9]+&quot;&#xA;        with substring = nil&#xA;        with result = nil&#xA;        with separator = (propertize &quot;:&quot; 'face '(:foreground &quot;cyan&quot;))&#xA;        while (string-match regexp str start)&#xA;        do (setq substring (match-string 0 str))&#xA;        do (put-text-property 0 (length substring) 'face&#xA;             (cond&#xA;               ((string= substring &quot;event&quot;)&#xA;                 '(:foreground &quot;red&quot;))&#xA;               ((string= substring &quot;lawlist&quot;)&#xA;                 '(:foreground &quot;blue&quot;))&#xA;               ((string= substring &quot;HIGH&quot;)&#xA;                 '(:foreground &quot;yellow&quot;))&#xA;               (t&#xA;                 'default))&#xA;             substring)&#xA;        do (push substring result)&#xA;        do (setq start (match-end 0))&#xA;        finally return&#xA;          (concat&#xA;            separator&#xA;            (mapconcat 'identity (reverse result) separator)&#xA;            separator)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The usage is as follows:  &lt;code&gt;(walk-string+add-face &quot;:event:lawlist:HIGH:misc:&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-07-03T06:57:20.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24345" PostTypeId="1" CreationDate="2016-07-03T13:12:49.047" Score="3" ViewCount="785" Body="&lt;p&gt;I'm relatively new to tramp and despite being certain that it offers an elegant solution to my needs, I wasn't able to find one thus far. Let me briefly describe my workflow:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I connect to a server via tramp via ssh:user@host:path/ and there I usually edit a given text file. Commonly I have to upload a new document to the same file from my local machine. To achieve this, I (and this is the part I want to fix) open a separate eshell buffer in emacs and copy the file via scp to user@host:path/ . I then (which - again - is very undesirable) use this eshell buffer to connect (via ssh) a third time to the server to change the permissions of this newly uploaded file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, this workflow is ridiculously inefficient and in desperate need of improvement. Can someone help?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'd also like to disclaim that I searched for relevant questions on this side and found &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/13797/tramp-dired-transfers-files-inline-over-ssh-instead-of-using-scp-externaly&quot;&gt;Tramp/Dired transfers files inline over ssh instead of using scp externaly&lt;/a&gt;,&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/24287/executing-remote-commands-with-tramp-with-a-single-ssh-connection&quot;&gt;Executing remote commands with TRAMP with a single SSH connection&lt;/a&gt; and&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/22026/remote-tramp-eshell-session-changes-to-localhost&quot;&gt;remote tramp eshell session changes to localhost&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, I wasn't able to derive an answer of my question from them - probably due to the lacking knowledge on my part.&lt;/p&gt;&#xA;" OwnerUserId="10886" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-07-04T07:34:24.183" Title="Help me to fix my tramp (ssh/scp) workflow" Tags="|tramp|ssh|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24346" PostTypeId="1" CreationDate="2016-07-03T13:39:52.377" Score="1" ViewCount="1334" Body="&lt;p&gt;These lines in my &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;&#xA;(setq-default c-default-style &quot;linux&quot;)&#xA;(setq-default c-basic-offset 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;result in the following formatting of my c code (the &lt;code&gt;c-basic-offset&lt;/code&gt; of &lt;code&gt;4&lt;/code&gt; is respected by the style):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main(&#xA;    int argc,&#xA;    char argv&#xA;    ) {&#xA;    if (1 == 1 &amp;amp;&amp;amp;&#xA;        2 == 2&#xA;        ) {&#xA;        return 42;&#xA;    }&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At the same time, setting the style to &quot;gnu&quot;, makes the offsets different (9 and 4 spaces):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main(&#xA;         int argc,&#xA;         char argv&#xA;         ) {&#xA;    if (1 == 1 &amp;amp;&amp;amp;&#xA;        2 == 2&#xA;        ) {&#xA;        return 42;&#xA;    }&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is the same setting treated differently by different styles? Bonus quesition: what do I set up to move the closing &lt;code&gt;) {&lt;/code&gt; of the function and the if blocks to the left like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main(&#xA;    int argc,&#xA;    char argv&#xA;) {&#xA;    if (1 == 1 &amp;amp;&amp;amp;&#xA;        2 == 2&#xA;    ) {&#xA;        return 42;&#xA;    }&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8889" LastActivityDate="2016-07-03T13:39:52.377" Title="Why do &quot;gnu&quot; and &quot;linux&quot; `c-default-style` treat `c-basic-offset` differently?" Tags="|init-file|customize|c|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24347" PostTypeId="2" ParentId="24345" CreationDate="2016-07-03T15:02:28.803" Score="2" Body="&lt;p&gt;For copying files from the local to the remote machine or vice-versa, I connect to the remote machine with tramp: &#xA;&lt;kbd&gt;C-x d&lt;/kbd&gt; &lt;code&gt;/ssh:user@host:/path/of/remote/dir&lt;/code&gt;&#xA;I have the window split in two, on one side the local &lt;code&gt;dired&lt;/code&gt; buffer and on the other side the remote one. So, I use &lt;code&gt;dired-do-copy&lt;/code&gt; from &lt;code&gt;dired-aux&lt;/code&gt; package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; forgot to add as &lt;a href=&quot;https://emacs.stackexchange.com/users/454/phils&quot;&gt;phils&lt;/a&gt; suggested, you havet to set &lt;code&gt;dired-dwin-target&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-dwim-target t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2016-07-04T07:34:24.183" LastActivityDate="2016-07-04T07:34:24.183" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24348" PostTypeId="2" ParentId="24286" CreationDate="2016-07-03T15:37:39.887" Score="3" Body="&lt;h2&gt;How to disable whitespace highlight in Spacemacs&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;smartparens&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;smartparens&lt;/a&gt; is an Emacs package for intelligent manipulation of pairs of delimiters such as [], {}, (), &amp;lt;&gt;, &quot;&quot;, etc. It is enabled by default in Spacemacs. When you type an open delimiter such as {, it automatically adds a closing delimiter such as }. If you press Enter several times, the delimiters with all space between them including other characters will be highlighted. If you move cursor outside the delimiters, the highlight will disappear. It seems that this is your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use smartparens, so I don't know whether this highlighting is an important feature of smartparens that helps use it, so if somebody can explain why this highlighting may be important as a separate answer, that would be informative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, if this highlighting really annoys you, you can turn it off buy customizing a specific smartparens variable called &lt;code&gt;sp-highlight-pair-overlay&lt;/code&gt;. You can either set this variable to &lt;code&gt;nil&lt;/code&gt; manually, or use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html#Easy-Customization&quot; rel=&quot;nofollow&quot;&gt;easy customization interface&lt;/a&gt; (read more on how to use it by following the link).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To customize this variable, execute &lt;code&gt;customize-group&lt;/code&gt;, select smartparens, find an entry that says “Sp Highlight Pair Overlay”, and toggle the variable. Don't forget to save changes when customizing variables using &lt;code&gt;customize-group&lt;/code&gt; interface! The button to save is on top.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;whitespace-mode&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;There is another case of whitespace highlight that might bother you. If you have &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html#index-whitespace_002dmode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;whitespace-mode&lt;/code&gt;&lt;/a&gt; turned on, every whitespace character in your text buffer is replaced: space with centered dot, &lt;a href=&quot;https://en.wikipedia.org/wiki/Hard_space&quot; rel=&quot;nofollow&quot;&gt;non-breaking space&lt;/a&gt; with &lt;a href=&quot;https://en.wikipedia.org/wiki/Currency_sign_(typography)&quot; rel=&quot;nofollow&quot;&gt;currency sign&lt;/a&gt;, newline with dollar sign, tab with left quote mark. They also get different colors too. So it might look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data·Player·=$&#xA;»   {·health·::·Int$&#xA;»   ,·mana·::·Int$&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you just want to toggle this mode on/off in the particular buffer, just press &lt;kbd&gt;Space t w&lt;/kbd&gt; (&lt;code&gt;spacemacs/toggle-whitespace&lt;/code&gt;). If you want to toggle this mode globally so that it's always on/off every time you start Emacs, put &lt;code&gt;(spacemacs/toggle-whitespace-globally-on)&lt;/code&gt; or &lt;code&gt;(spacemacs/toggle-whitespace-globally-off)&lt;/code&gt; in your &lt;code&gt;.spacemacs&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to read more about different toggles, press &lt;kbd&gt;Space h Space&lt;/kbd&gt; and select “Spacemacs documentation”, this is the canonical way to read the docs for Spacemacs. If you want to see which toggles are currently on, press &lt;kbd&gt;Space h t&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;show-trailing-whitespace&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;There is another highlight for the so called trailing space, when you have extra space characters at the end of the line. In my theme it is highlighted somewhat dark cyan. It has to do with &lt;code&gt;show-trailing-whitespace&lt;/code&gt; variable that you can also read about in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Useless-Whitespace.html&quot; rel=&quot;nofollow&quot;&gt;Section “Useless Whitespace”&lt;/a&gt; of Emacs Manual. Something sets this variable to &lt;code&gt;t&lt;/code&gt; for most programming buffers and I don't know how to turn it off globally, but I guess it has to do with &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/b30c393b8d6cb9c9a57d5cbbaa59e27805f3ebb1/layers/%2Bdistributions/spacemacs-base/packages.el#L432&quot; rel=&quot;nofollow&quot;&gt;this snippet&lt;/a&gt; in &lt;code&gt;spacemacs-base&lt;/code&gt; layer.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastEditorUserId="3972" LastEditDate="2016-07-03T15:54:10.083" LastActivityDate="2016-07-03T15:54:10.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24349" PostTypeId="1" CreationDate="2016-07-03T16:26:36.967" Score="3" ViewCount="1047" Body="&lt;p&gt;I am trying to export an org file to PDF via LaTeX but in German.&#xA;I set &lt;code&gt;#+LATEX_HEADER: \usepackage[ngerman]{babel}&lt;/code&gt; but when exporting org-mode adds &lt;code&gt;english&lt;/code&gt; to the babel options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That causes all the automatic titles,i.e. references, table of contents, etc., to be in English.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to prevent the setting of the &lt;em&gt;english&lt;/em&gt; option in babel?&lt;/p&gt;&#xA;" OwnerUserId="9901" LastEditorUserId="9901" LastEditDate="2016-07-04T07:56:57.277" LastActivityDate="2016-11-05T16:19:37.363" Title="org-mode babel german" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24350" PostTypeId="2" ParentId="24237" CreationDate="2016-07-03T17:00:21.700" Score="2" Body="&lt;p&gt;Let's discuss low-level command that you need. &lt;a href=&quot;http://orgmode.org/manual/TODO-basics.html#index-org_002dtodo-539&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-todo&lt;/code&gt;&lt;/a&gt; cycles the headline your cursor is on through TODO states. &lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html#index-C_002dc-_002d-222&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-toggle-item&lt;/code&gt;&lt;/a&gt; turns headlines into lists, &lt;a href=&quot;http://orgmode.org/manual/Structure-editing.html#Structure-editing&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-toggle-heading&lt;/code&gt;&lt;/a&gt; turns lists into headlines. In standard Emacs they are mapped to &lt;kbd&gt;C-c C-t&lt;/kbd&gt;, &lt;kbd&gt;C-c -&lt;/kbd&gt;, &lt;kbd&gt;C-c *&lt;/kbd&gt; respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-todo&lt;/code&gt; doesn't work on regions, but it would be cool if we could put a TODO state on every heading that doesn't have a TODO (and doesn't have other states, including DONE). This is how we would do that.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun outline-to-checkboxes (from to)&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (with-undo-collapse&#xA;        (narrow-to-region from to)&#xA;        (end-of-buffer)&#xA;        (while (outline-previous-heading)&#xA;          (when (null (org-get-todo-state))&#xA;            (org-todo &quot;TODO&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason I go to the end of buffer and apply &lt;code&gt;outline-previous-heading&lt;/code&gt; instead of going from top forward is described in a &lt;a href=&quot;https://stackoverflow.com/a/13349772/596361&quot;&gt;StackOverflow answer&lt;/a&gt;: &lt;code&gt;while&lt;/code&gt; always calls the first argument at least once, and if you started at the beginning of your buffer starts with an Org heading, you'll skip it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/7560/3972&quot;&gt;&lt;code&gt;with-undo-collapse&lt;/code&gt;&lt;/a&gt; is a custom macro that allows you to undo the whole change in one action (follow the link to get the code).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, due to a &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-orgmode/2016-07/msg00041.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;bug&lt;/a&gt; in &lt;code&gt;org-toggle-list&lt;/code&gt;, changing headings to a list with checkboxes programmatically is difficult, so just go with the regex approach in Jesse's answer.&lt;/p&gt;&#xA;" OwnerUserId="3972" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-07-03T18:07:57.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24351" PostTypeId="1" AcceptedAnswerId="26153" CreationDate="2016-07-03T17:53:30.637" Score="1" ViewCount="202" Body="&lt;p&gt;To be honest, I'm very novice in Emacs, so is it possible somehow to bind TAB key in &lt;strong&gt;insert&lt;/strong&gt; state of &lt;em&gt;evil mode&lt;/em&gt; to shift text after the cursor right on current indentation amount of spaces at each key press. And how to do reverse process (shifting of  text after cursor to the left) on Shift+TAB pressing.&lt;/p&gt;&#xA;" OwnerUserId="12545" LastEditorUserId="105" LastEditDate="2016-07-03T22:25:50.867" LastActivityDate="2016-08-08T19:52:18.290" Title="How to make tab key shift test after cursor in evil mode insert state" Tags="|key-bindings|indentation|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24352" PostTypeId="2" ParentId="22696" CreationDate="2016-07-03T21:56:53.167" Score="2" Body="&lt;p&gt;Emacs 25 &lt;a href=&quot;https://github.com/NicolasPetton/seq.el&quot; rel=&quot;nofollow&quot;&gt;will include the &lt;code&gt;seq.el&lt;/code&gt;&lt;/a&gt; library, which will provide default functions to manipulate sequences. Right now you can download it from GNU ELPA for Emacs 24. The functions you are looking for are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(seq-filter (lambda (x) (/= 0 (% x 2))) '(1 2 3 4 5)) ; =&amp;gt; (1 3 5)&#xA;(seq-remove (lambda (x) (/= 0 (% x 2))) '(1 2 3 4 5)) ; =&amp;gt; (2 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-07-03T21:56:53.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24353" PostTypeId="2" ParentId="19812" CreationDate="2016-07-03T22:36:44.140" Score="3" Body="&lt;p&gt;I don't think there is an existing Elisp solution for that.  But if you look at how I implemented &lt;code&gt;smerge-refine-subst&lt;/code&gt; (also used in &lt;code&gt;diff-refine-hunk&lt;/code&gt;) it should give you some idea of how you can play with &lt;code&gt;diff&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW you should be able to run a single &lt;code&gt;diff&lt;/code&gt; process to handle all your lines at once, by concatenating them and adding &quot;synchronization lines&quot; in between.  Also, to prevent &lt;code&gt;diff&lt;/code&gt; from getting confused when lines from one pair match with lines from another pair, you'll probably want to prepend some text (unique to each pair) in front of every line.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-03T22:36:44.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24354" PostTypeId="2" ParentId="7272" CreationDate="2016-07-03T22:45:18.883" Score="2" Body="&lt;p&gt;You can use &lt;code&gt;quarter-plane-mode&lt;/code&gt; from the &lt;code&gt;quarter-plane&lt;/code&gt; package in GNU ELPA.  It aims to provide this kind of functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But note that it does it basically by reusing picture-mode's code, so it suffers from the same problem: it will add spaces/lines to your buffer when you move around (and then remove them when you leave the mode), so it will/may make changes to your files&amp;amp;buffers even if all you do is move around them without making any real modifications.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-03T22:45:18.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24355" PostTypeId="1" AcceptedAnswerId="24450" CreationDate="2016-07-04T00:06:24.940" Score="3" ViewCount="324" Body="&lt;p&gt;I use &lt;code&gt;grep-mode&lt;/code&gt; for a set of files and &lt;code&gt;wgrep&lt;/code&gt; (writable grep buffer) for editing them. The buffer usually looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lNyNu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lNyNu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to find a way to change the view like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/95tNQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/95tNQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;wgrep&lt;/code&gt; and &lt;code&gt;compile-goto-error&lt;/code&gt; should work as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upd. It works for &lt;code&gt;wgrep&lt;/code&gt; and &lt;code&gt;compile-goto-error&lt;/code&gt; now. Additional spaces for regexp are needed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcar (car grep-regexp-alist)&#xA;        &quot;^\\(.+?\\)\\(:[ \t]*\\)\\([1-9][0-9]*\\)[ \t]*\\2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It turns out &lt;code&gt;wgrep-default-line-header-regexp&lt;/code&gt; already had required additional spaces.&lt;/p&gt;&#xA;" OwnerUserId="2064" LastEditorUserId="2064" LastEditDate="2016-07-05T08:37:12.257" LastActivityDate="2016-07-08T11:21:53.567" Title="How to align grep output?" Tags="|align|compilation-mode|grep|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24356" PostTypeId="2" ParentId="13272" CreationDate="2016-07-04T05:04:58.143" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://chocolatey.org/&quot; rel=&quot;nofollow&quot;&gt;Chocolatey&lt;/a&gt; seems to have a 64 bit emacs package - I can't evaluate it yet as I'm downloading it now..&lt;/p&gt;&#xA;" OwnerUserId="12547" LastActivityDate="2016-07-04T05:04:58.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24357" PostTypeId="1" AcceptedAnswerId="24370" CreationDate="2016-07-04T06:18:40.980" Score="3" ViewCount="365" Body="&lt;p&gt;I would like to make a mode that would react to user changing the buffer. One way i know is to use hooks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What hooks, other then &lt;code&gt;post-self-insert-hook&lt;/code&gt;, should i use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What changes i am interested in:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;entering text&lt;/li&gt;&#xA;&lt;li&gt;changing indentation&lt;/li&gt;&#xA;&lt;li&gt;deleting text&lt;/li&gt;&#xA;&lt;li&gt;yanking&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And maybe, in future, so-to-sy:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;changes in cursor position&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In general, some way to react to changes in the buffer would be sufficient.&lt;/p&gt;&#xA;" OwnerUserId="11047" LastEditorUserId="105" LastEditDate="2016-07-04T15:45:22.987" LastActivityDate="2016-07-04T22:32:50.670" Title="How to track user changes in the buffer?" Tags="|buffers|hooks|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24358" PostTypeId="1" AcceptedAnswerId="24363" CreationDate="2016-07-04T10:57:20.267" Score="4" ViewCount="309" Body="&lt;p&gt;I have a document whose paragraphs start with a number like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;101 kjwdujd dkjcjiekrd wekdhehwrd kwedhiehrc wekdhchjedc kjdchhedch .&#xA;&#xA;99 dsjcoiedc wdhiwedc wedhiuwhediuhewdkdeh wedghiuwghediughedc wejgdugwed &#xA;&#xA;5 kdjewde3 diwedeoi.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to sort the paragraphs according to these numbers, so ideally the ordering should be 5, then 99 then 101. But given the fact that the function &lt;strong&gt;sort-paragraphs&lt;/strong&gt; sorts the paragraphs lexicographically, the sorting would be 101 then 5 then 9.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to sort the paragraphs by the paragraph numbers?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-07-04T14:33:41.450" LastActivityDate="2016-07-04T14:38:31.267" Title="sorting paragraphs of a document by paragraph numbers (not lexicographically)" Tags="|sorting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24359" PostTypeId="2" ParentId="20582" CreationDate="2016-07-04T11:28:31.583" Score="1" Body="&#xA;&#xA;&lt;p&gt;I use such workaround for the exact saving of &lt;code&gt;point&lt;/code&gt; position in the &lt;code&gt;compilation/grep&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eab/compile-goto-error ()&#xA;  (interactive)&#xA;  (let ((istc? truncate-lines))&#xA;    (toggle-truncate-lines t)&#xA;    (let ((buf (current-buffer))&#xA;          (line (- (count-lines (window-start) (point))&#xA;                   (if (eq (point) (point-at-bol)) 0 1)))&#xA;          (point (point)))&#xA;      (compile-goto-error)&#xA;      (run-with-timer 0.01 nil `(lambda ()&#xA;                                 (let ((cb (current-buffer)))&#xA;                                       (pop-to-buffer ,buf)&#xA;                                       (recenter ,line)&#xA;                                       (goto-char ,point)&#xA;                                       (toggle-truncate-lines ,istc?)&#xA;                                       (pop-to-buffer cb)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want simple centering of the &lt;code&gt;point&lt;/code&gt; in the &lt;code&gt;compilation/grep&lt;/code&gt; buffer, use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eab/next-error ()&#xA;  (interactive)&#xA;  (let ((buf (current-buffer)))&#xA;    (next-error)&#xA;    (run-with-timer 0.01 nil `(lambda ()&#xA;                             (let ((cb (current-buffer)))&#xA;                               (pop-to-buffer ,buf)&#xA;                               (recenter)&#xA;                               (pop-to-buffer cb))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;next-error&lt;/code&gt; instead of &lt;code&gt;compile-goto-error&lt;/code&gt; in the first example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upd. Emacs 25.1 is needed for non-zero time period.&lt;/p&gt;&#xA;" OwnerUserId="2064" LastEditorUserId="115" LastEditDate="2016-07-21T12:38:03.990" LastActivityDate="2016-07-21T12:38:03.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24360" PostTypeId="1" AcceptedAnswerId="24517" CreationDate="2016-07-04T11:34:42.133" Score="2" ViewCount="841" Body="&lt;p&gt;I compared two versions of loop in emacs and in C.&#xA;Emacs byte-compiled version gives 4.5 seconds, C version gives 0.22 seconds. Why so slow? How to optimize it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;&#xA;(defun test-me ()&#xA;  (let ((i 0) (j 0) (t1 (float-time)))&#xA;    (while (&amp;lt; i 100000000)&#xA;      (setq j (* i 7))&#xA;      (setq i (+ i 1)))&#xA;    (- (float-time) t1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;C version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;&#xA;#include &amp;lt;stdio.h&amp;gt;&#xA;#include &amp;lt;time.h&amp;gt;&#xA;&#xA;int main(int argc, char **argv) {&#xA;    int i = 0;&#xA;    int j = 0;&#xA;&#xA;    clock_t start = clock();&#xA;    while(i &amp;lt; 100000000) {&#xA;        j = i * 7;&#xA;        i = i + 1;&#xA;    }&#xA;&#xA;    clock_t end = clock();&#xA;    float seconds = (float)(end - start) / CLOCKS_PER_SEC;&#xA;    printf(&quot;%f\n&quot;, seconds);&#xA;&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9596" LastEditorUserId="105" LastEditDate="2016-08-22T21:39:53.117" LastActivityDate="2016-08-22T21:39:53.117" Title="Why emacs multiplication performance is so bad?" Tags="|performance|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24361" PostTypeId="1" CreationDate="2016-07-04T12:49:42.147" Score="7" ViewCount="4039" Body="&lt;p&gt;i know there are other posts out there but i couldnt find an answer to this. is there anyway with latest org (8.3) to add additional symbols to the org-emphasis-alist? i tried for example adding the &lt;code&gt;!&lt;/code&gt; symbol but i cant seem to get it to work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-emphasis-alist (quote ((&quot;!&quot;  (:foreground &quot;red&quot;) )&#xA;             (&quot;/&quot; italic &quot;&amp;lt;i&amp;gt;&quot; &quot;&amp;lt;/i&amp;gt;&quot;) &#xA;             (&quot;_&quot; underline &quot;&amp;lt;span style=\&quot;text-decoration:underline;\&quot;&amp;gt;&quot; &quot;&amp;lt;/span&amp;gt;&quot;)&#xA;             (&quot;-&quot; (:overline t) &quot;&amp;lt;span style=\&quot;text-decoration:overline;\&quot;&amp;gt;&quot; &quot;&amp;lt;/span&amp;gt;&quot;)&#xA;             (&quot;=&quot; org-code &quot;&amp;lt;code&amp;gt;&quot; &quot;&amp;lt;/code&amp;gt;&quot; verbatim)&#xA;             (&quot;*&quot; org-verbatim &quot;&amp;lt;code&amp;gt;&quot; &quot;&amp;lt;/code&amp;gt;&quot; verbatim) &#xA;            (&quot;+&quot; (:strike-through t) &quot;&amp;lt;del&amp;gt;&quot; &quot;&amp;lt;/del&amp;gt;&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;any clue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;alternatively, maybe another approach is to use perhaps the font-lock like this which i use now: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords&#xA; 'org-mode&#xA;'((&quot;\\(@[^@\n]+@\\)&quot; (0 '(:foreground &quot;#B40000&quot; :background &quot;#FFDDDD&quot; :weight bold) t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yet is there a way to hide the start-end symbols like in &lt;code&gt;org-hide-emphasis-markers&lt;/code&gt; option?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11387" LastEditDate="2016-07-04T12:58:40.953" LastActivityDate="2016-07-06T14:36:57.107" Title="org-emphasis-alist, add additional symbols?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ClosedDate="2016-07-06T20:34:59.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="24362" PostTypeId="2" ParentId="24358" CreationDate="2016-07-04T14:09:28.270" Score="1" Body="&lt;p&gt;For a short document, &lt;code&gt;sort-numeric-fields&lt;/code&gt; might work here, with two pre-requisites. First, you need each paragraph to be on a single line. This is not so awkward if you use &lt;code&gt;visual-line-mode&lt;/code&gt;. Then, you need to remove all blank lines. You can do this with &lt;code&gt;M-x flush-lines&lt;/code&gt;, and enter &lt;code&gt;^\s *$&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After this, &lt;code&gt;M-x sort-numeric-fields&lt;/code&gt; will reorder your lines according to the number at the beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, it would be much nicer to have this work on normally formatted paragraphs with blank lines between. I'm not sure that's available without writing your own functions.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-04T14:09:28.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24363" PostTypeId="2" ParentId="24358" CreationDate="2016-07-04T14:38:31.267" Score="4" Body="&lt;p&gt;Like &lt;code&gt;sort-paragraphs&lt;/code&gt; but set &lt;code&gt;sort-subr&lt;/code&gt;'s &lt;code&gt;PREDICATE&lt;/code&gt; argument to meet your needs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-sort-paragraphs (reverse beg end)&#xA;  (interactive &quot;P\nr&quot;)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (narrow-to-region beg end)&#xA;      (goto-char (point-min))&#xA;      (sort-subr reverse&#xA;                 (function&#xA;                  (lambda ()&#xA;                    (while (and (not (eobp)) (looking-at paragraph-separate))&#xA;                      (forward-line 1))))&#xA;                 'forward-paragraph nil nil&#xA;                 (lambda (a b)&#xA;                   (&amp;lt; (string-to-number (progn (goto-char (car a))&#xA;                                               (current-word)))&#xA;                      (string-to-number (progn (goto-char (car b))&#xA;                                               (current-word)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-07-04T14:38:31.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24364" PostTypeId="1" AcceptedAnswerId="24366" CreationDate="2016-07-04T18:46:35.000" Score="3" ViewCount="115" Body="&lt;p&gt;As I only use kill-ring-save after I used &lt;code&gt;set-mark-command&lt;/code&gt;, I wanted to try using its binding also for another command. However I'm not able to get this to work with an additional if. I don't know how to pass the arguments to &lt;code&gt;avy-goto-char-2&lt;/code&gt; with the interactive stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I determine if the mark is active, and use that information to pick a function to call?&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="105" LastEditDate="2016-08-22T00:57:29.093" LastActivityDate="2016-08-22T00:57:29.093" Title="How to use one binding to call different functions depending on whether the region is active?" Tags="|key-bindings|region|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24365" PostTypeId="1" AcceptedAnswerId="24367" CreationDate="2016-07-04T20:06:02.067" Score="4" ViewCount="275" Body="&lt;p&gt;I am using paredit. It terminates &lt;code&gt;(&lt;/code&gt; and &lt;code&gt;[&lt;/code&gt; and &lt;code&gt;&quot;&lt;/code&gt; fine, but does not close the &lt;code&gt;{&lt;/code&gt; in any modes. How can i configure it to do this too? I have emacs24.&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastActivityDate="2016-07-04T20:42:12.640" Title="Paredit doesn't close {" Tags="|paredit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24366" PostTypeId="2" ParentId="24364" CreationDate="2016-07-04T20:09:20.310" Score="3" Body="&lt;p&gt;The function &lt;code&gt;region-active-p&lt;/code&gt; will tell you if the region is active. You can use this to determine which function to call. Both of the functions you want behave differently when called interactively vs when called as lisp functions, so you need to tell Emacs to treat them as interactive function calls with the &lt;code&gt;(call-interactively ...)&lt;/code&gt; form. So:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-double ()&#xA;  (interactive)&#xA;  (if (region-active-p)&#xA;      (call-interactively 'kill-ring-save)&#xA;    (call-interactively 'avy-goto-char-2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-04T20:09:20.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24367" PostTypeId="2" ParentId="24365" CreationDate="2016-07-04T20:42:12.640" Score="7" Body="&lt;p&gt;The commands are defined, but not bound to a key by default. You can add them to the paredit map with this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'paredit&#xA;  '(progn&#xA;     (define-key paredit-mode-map (kbd &quot;{&quot;)&#xA;       'paredit-open-curly)&#xA;     (define-key paredit-mode-map (kbd &quot;}&quot;)&#xA;       'paredit-close-curly)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may prefer to add them to particular programming mode keymaps, rather than the paredit-mode-map; just modify accordingly.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-04T20:42:12.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24368" PostTypeId="1" CreationDate="2016-07-04T20:45:25.267" Score="3" ViewCount="2899" Body="&lt;p&gt;In org-mode org-capture templates, what is the way to insert current time timestamp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;code&gt;%U&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; org-capture-templates&#xA; (quote&#xA;  (&#xA;     (&quot;k&quot; &quot;Capture an item and schedule it for tomorrow&quot; entry&#xA;      (file+headline &quot;today.org&quot; &quot;_tomorrow&quot;)&#xA;      &quot;* TODO %^{Task Title} %^G&#xA;SCHEDULED: %t&#xA;Added: %U @ %a&quot; :immediate-finish t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the &lt;code&gt;%U&lt;/code&gt; shortcode always produces 00:00 time and the date is the same as the agenda view date at which the point is located at the time the &lt;code&gt;org-capture&lt;/code&gt; is invoked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I'd also like some suggestions on how to produce a &quot;tomorrow&quot; timestamp in the template, but that is probably a topic for another question.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2016-07-05T23:46:24.670" Title="Current time timestamp in org-capture-templates" Tags="|org-mode|org-agenda|time-date|org-capture|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24369" PostTypeId="2" ParentId="24330" CreationDate="2016-07-04T21:00:57.807" Score="2" Body="&lt;p&gt;&lt;code&gt;term-exec-hook&lt;/code&gt; is not called by &lt;code&gt;shell-mode&lt;/code&gt;. It uses a different approach for running a shell, via &lt;code&gt;comint&lt;/code&gt; rather than &lt;code&gt;term-exec&lt;/code&gt;. So you need to add your function to the &lt;code&gt;shell-mode-hook&lt;/code&gt; to get it applied to &lt;code&gt;shell-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'shell-mode-hook 'set-no-process-query-on-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-04T21:00:57.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24370" PostTypeId="2" ParentId="24357" CreationDate="2016-07-04T22:32:50.670" Score="7" Body="&lt;p&gt;To react to buffer changes, you generally want to use &lt;code&gt;after-change-functions&lt;/code&gt; (or sometimes &lt;code&gt;before-change-functions&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These hooks are run everytime some part of the buffer is modified, either by inserting or by deleting a chunk of text (or text-properties).  Be aware that some commands work by applying several modifications to the buffer, so those hooks can be run several (or even many) times in a single command.  So if you need to perform a a significant amount of work, it is often useful to use 2-step approach, where an &lt;code&gt;after-change-function&lt;/code&gt; only keeps track of the affected region, and then a post-command-hook uses that data to perform the heavy lifting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo-unhandled-changes nil)&#xA;(defun foo-after-change-function (beg end _len)&#xA;  &quot;Remember to fixup the text between BEG and END.&quot;&#xA;  (unless undo-in-progress&#xA;    (if foo-unhandled-changes&#xA;        (setq foo-unhandled-changes&#xA;              (cons (min beg (car foo-unhandled-changes))&#xA;                    (max end (cdr foo-unhandled-changes))))&#xA;      (setq foo-unhandled-changes (cons beg end)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then use &lt;code&gt;(add-hook 'after-change-functions #'foo-after-change-function nil t)&lt;/code&gt; where needed, plus a &lt;code&gt;post-command-hook&lt;/code&gt; which can use &lt;code&gt;foo-unhandled-changes&lt;/code&gt; to know which part of the buffer (if any) was modified since last time it was run (and which should reset &lt;code&gt;foo-unhandled-changes&lt;/code&gt; to nil).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-04T22:32:50.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24371" PostTypeId="1" CreationDate="2016-07-04T23:20:32.580" Score="15" ViewCount="3416" Body="&lt;p&gt;I wanted to indent my XML files with 4 spaces.&lt;br&gt;&#xA;I tried to google it, and found &lt;a href=&quot;https://stackoverflow.com/questions/1666513/how-to-indent-4-spaces-under-sgml-mode&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/IndentingHtml&quot; rel=&quot;noreferrer&quot;&gt;this one&lt;/a&gt;.&lt;br&gt;&#xA;But they seem pretty old and/or didn't help me.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/12492/pretty-printing-xml-files-on-emacs&quot;&gt;This post&lt;/a&gt; is great about how to pretty print XML files, but gives no hint how to set indent to a specific value. How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-07-05T01:41:46.397" Title="How to set indent to 4 spaces in nxml-mode?" Tags="|indentation|nxml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24372" PostTypeId="2" ParentId="24371" CreationDate="2016-07-04T23:22:02.683" Score="23" Body="&lt;p&gt;I finally found it in &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/5483&quot;&gt;this issue&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nxml-child-indent 4 nxml-attribute-indent 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2016-07-04T23:22:02.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24373" PostTypeId="1" AcceptedAnswerId="24374" CreationDate="2016-07-04T23:22:50.470" Score="2" ViewCount="376" Body="&lt;p&gt;Suppose I do a certain keystroke sequence in emacs, and nothing happens, even though I expect there to be a keybinding that would do something. This could be because:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The keybinding is not actually present.&lt;/li&gt;&#xA;&lt;li&gt;The keybinding is invoking the command, but for some reason the command isn't having the expected effect.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I tell which of these it is? (The specific example is that I'm doing meta-q, which is supposed to be bound to the command fill-paragraph, but nothing seems to happen.)&lt;/p&gt;&#xA;" OwnerDisplayName="user5457" LastActivityDate="2016-07-05T17:55:40.297" Title="How to debug lack of response to a certain set of keystrokes?" Tags="|key-bindings|debugging|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24374" PostTypeId="2" ParentId="24373" CreationDate="2016-07-04T23:29:11.100" Score="5" Body="&lt;p&gt;You can determine which command a keybinding calls with &lt;code&gt;C-h k&lt;/code&gt; then the keybinding.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, you would enter &lt;code&gt;C-h k M-q&lt;/code&gt;, which will tell you that &lt;code&gt;M-q&lt;/code&gt; runs &lt;code&gt;fill-paragraph&lt;/code&gt; (or at least it does by default in most modes).  If there's no command associated with the keybinding, Emacs will tell you so in the echo area.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-04T23:29:11.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24375" PostTypeId="2" ParentId="24264" CreationDate="2016-07-05T02:00:41.033" Score="5" Body="&lt;h3&gt;Short answer: Don't edit custom-set-variables form by hand.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Tramp must be loaded for &lt;code&gt;custom-set-variables&lt;/code&gt; to work. Either load tramp &lt;em&gt;before&lt;/em&gt; &lt;code&gt;custom-set-variables&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;(custom-set-variables  '(tramp-remote-path&#xA;    (quote&#xA;     (tramp-own-remote-path))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or see Michael's answer for a way to tell customize to load tramp first.  Note that using &lt;code&gt;M-x customize-variable RET tramp-remote-path RET&lt;/code&gt; creates a correct custom-set-variables entry, of the form suggested by Michael.&lt;/p&gt;&#xA;&#xA;&lt;hr /&gt;&#xA;&#xA;&lt;h3&gt;Longer answer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The root of the problem seems to be in tramp's custom &lt;code&gt;###;;;tramp-autoload&lt;/code&gt; annotation.  This tramp-specific mechanism more or less breaks basic &lt;code&gt;custom-set-variables&lt;/code&gt; forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In normal operation, when you run &lt;code&gt;customize-set-variables&lt;/code&gt;, Emacs does one of two things: if the variable already exists in context it sets it, and if it doesn't, it records the value (using &lt;code&gt;(set symbol value)&lt;/code&gt;), relying on the customize machinery to use that saved value after the variable is declared (through a defcustom).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, when Emacs evaluates the corresponding defcustom (when loading the corresponding package, for example), the customize machinery checks whether the symbol being &lt;code&gt;defcustom&lt;/code&gt;ed already has a value pending (using &lt;code&gt;(get symbol 'saved-value)&lt;/code&gt;), and sets the symbol to that value if so. If there is no such pending value, it uses the value provided by the defcustom form (the default value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an exception, however, the &lt;code&gt;defcustom&lt;/code&gt; implementation also checks that it isn't overriding an already set value. That is, if the variable has already been declared and given a value, then it's value is preserved. To check whether such a default value exists, &lt;code&gt;customize&lt;/code&gt; calls &lt;code&gt;default-toplevel-value&lt;/code&gt;. If there already is a default value set, it leaves the variable untouched.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function that does this is &lt;code&gt;custom-initialize-reset&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, in your case, the problem is precisely this exception. If you open &lt;code&gt;emacs/lisp/net/tramp-loaddefs.el&lt;/code&gt;, you'll see the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar tramp-remote-path '(tramp-default-remote-path &quot;/bin&quot; &quot;/usr/bin&quot; &quot;/sbin&quot; &quot;/usr/sbin&quot; &quot;/usr/local/bin&quot; &quot;/usr/local/sbin&quot; &quot;/local/bin&quot; &quot;/local/freeware/bin&quot; &quot;/local/gnu/bin&quot; &quot;/usr/freeware/bin&quot; &quot;/usr/pkg/bin&quot; &quot;/usr/contrib/bin&quot; &quot;/opt/bin&quot; &quot;/opt/sbin&quot; &quot;/opt/local/bin&quot;) &quot;\&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a way to forward declare &lt;code&gt;tramp-remote-path&lt;/code&gt;, but as a side effect it declares and gives a default value to &lt;code&gt;tramp-remote-path&lt;/code&gt;. That's fine as far as &lt;code&gt;custom-set-variables&lt;/code&gt; is concerned, but not as far as &lt;code&gt;defcustom&lt;/code&gt; is concerned. Thus, when the actual &lt;code&gt;defcustom&lt;/code&gt; for &lt;code&gt;tramp-remote-path&lt;/code&gt; is loaded, the aforementioned exception kicks in, and &lt;code&gt;customize&lt;/code&gt; politely preserves the value set by the &lt;code&gt;defvar&lt;/code&gt;, thereby ignoring your customization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can verify that this is the issue by adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar tramp-remote-path nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;code&gt;.emacs&lt;/code&gt;, before the actual call to &lt;code&gt;custom-set-variables&lt;/code&gt;. That should fix it (because now &lt;code&gt;custom-set-variable&lt;/code&gt; will think the variable exists), but I don't know enough about &lt;code&gt;customize&lt;/code&gt; to recommend this solution.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2017-04-07T16:56:45.320" LastActivityDate="2017-04-07T16:56:45.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24377" PostTypeId="1" AcceptedAnswerId="24585" CreationDate="2016-07-05T05:41:52.047" Score="7" ViewCount="1400" Body="&lt;p&gt;Currently, I use the &lt;code&gt;hs-minor-mode&lt;/code&gt; to collapse my python code and make it easier to work with - however, by default this only folds &lt;code&gt;def my_function():&lt;/code&gt; blocks. Is it possible to get it to work with &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;for&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt; etc. blocks as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, does anyone know a better option for code folding? I do use &lt;code&gt;C-s&lt;/code&gt; and &lt;code&gt;M-x occur&lt;/code&gt; to move around my code already, I just sometimes like to fold my code so I don't have so much to look at.&lt;/p&gt;&#xA;" OwnerUserId="10657" LastEditorUserId="10657" LastEditDate="2016-07-05T14:25:30.413" LastActivityDate="2021-03-20T05:30:53.863" Title="hs-minor-mode with python.el - hide if statements, for/while loops, etc" Tags="|python|code-folding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24378" PostTypeId="1" AcceptedAnswerId="24387" CreationDate="2016-07-05T11:24:19.290" Score="1" ViewCount="277" Body="&lt;p&gt;I want to have:&#xA;- a source code block fontified on export&#xA;- but not executed&#xA;- and used as input for another source code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can have it fontified in org-mode and not exported if I use a &lt;code&gt;begin_example&lt;/code&gt; block. But can I let it be fontified on export (to html or latex) es well? Or, vice versa, can I suppress a &lt;code&gt;begin_src&lt;/code&gt; from being executed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have so far is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: uninterpreted_sh&#xA;#+header: :exports code&#xA;#+begin_src sh&#xA;echo &quot;Direct&quot;&#xA;#+end_src&#xA;&#xA;#+name: uninterpreted&#xA;#+begin_example sh&#xA;echo &quot;Direct&quot;&#xA;#+end_example&#xA;&#xA;#+header: :exports both&#xA;#+header: :results output&#xA;#+begin_src sh :stdin uninterpreted&#xA;VALUE=$(cat)&#xA;echo &quot;I got: $VALUE&quot;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: I got: echo &quot;Direct&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There I can get &lt;code&gt;uninterpreted_sh&lt;/code&gt; fontified and can use &lt;code&gt;uninterpreted&lt;/code&gt; as stdin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A last resort might be to supress the &lt;code&gt;begin_example&lt;/code&gt; from beeing exported altogether?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: ther &lt;code&gt;results&lt;/code&gt; I get from the last source block is exactly what I want.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-07-05T18:41:08.773" LastActivityDate="2016-07-05T20:08:42.277" Title="Org-mode source code block not executed" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24379" PostTypeId="2" ParentId="24321" CreationDate="2016-07-05T14:07:09.640" Score="3" Body="&lt;p&gt;It depends on how exactly you are rendering the LaTeX fragments. I'm not sure if this is possible with the &lt;code&gt;markdown&lt;/code&gt; program, but it does work with &lt;a href=&quot;http://pandoc.org/index.html&quot; rel=&quot;nofollow&quot;&gt;Pandoc&lt;/a&gt;. To use this in &lt;code&gt;markdown-mode&lt;/code&gt;, customize &lt;code&gt;markdown-command&lt;/code&gt; (via &lt;code&gt;M-x customize-variable&lt;/code&gt;) to &lt;code&gt;pandoc -s --mathjax&lt;/code&gt;. This assumes you have pandoc installed, of course. There are other options available as well; see the &lt;a href=&quot;http://pandoc.org/README.html#math-rendering-in-html&quot; rel=&quot;nofollow&quot;&gt;Pandoc documentation&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-05T14:07:09.640" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24380" PostTypeId="1" CreationDate="2016-07-05T17:14:01.443" Score="2" ViewCount="604" Body="&lt;p&gt;Why is Emacs X11's display such bad quality, and how do I fix it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use Emacs Cocoa locally, I get a good visuals.  But when I use the X11 forwarding on my department's server, the quality is horrendous.  How do I fix the X11 version? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm doing this all on Mac OSX (El Capitan).  Here are some screenshots of the difference between the local, cocoa version and the X11 version:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs Cocoa locally:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/PAojw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PAojw.png&quot; alt=&quot;cocoa&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs X11 server version:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/fC5UW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fC5UW.png&quot; alt=&quot;X11&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12561" LastEditorUserId="25" LastEditDate="2016-07-05T20:22:06.427" LastActivityDate="2016-07-05T20:22:06.427" Title="X11 GUI low quality display when using server" Tags="|osx|fonts|display|server|x11|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24381" PostTypeId="1" CreationDate="2016-07-05T17:40:37.950" Score="1" ViewCount="87" Body="&lt;p&gt;Specifically, I want to sync an Rnoweb (Rnw) source with a PDF opened in either Skim or Evince using polymode. Note that I have no problem weaving or exporting Rnw files and viewing PDFs with Skim. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="12562" LastActivityDate="2016-07-05T17:40:37.950" Title="Does SyncTeX work with Emacs polymode?" Tags="|polymode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24382" PostTypeId="1" AcceptedAnswerId="24413" CreationDate="2016-07-05T17:42:01.197" Score="3" ViewCount="842" Body="&lt;p&gt;Lately my documents dissolve into misinterpreted Unicode, for example α becomes \316\261. What could be the cause for that?&lt;/p&gt;&#xA;" OwnerUserId="600" LastActivityDate="2016-07-06T23:30:30.053" Title="Unicode issues in Org-mode" Tags="|org-mode|unicode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24383" PostTypeId="2" ParentId="24380" CreationDate="2016-07-05T17:46:30.423" Score="1" Body="&lt;p&gt;It seems that X defaults to a font that looks bad, or at least just has bad size. Try customizing fonts to make them look good (Options &gt; Set Default font... from menu bar.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You add something like this in your config file to change fonts only when you're using X:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (eq window-system 'x)&#xA;  ;; your custom font settings here&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-07-05T17:46:30.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24384" PostTypeId="2" ParentId="24373" CreationDate="2016-07-05T17:55:40.297" Score="2" Body="&lt;p&gt;You can try using (view-lossage) (bound to C-h l by default) to see if your terminal even recognizes keystrokes. Some terminals might have problems with certain keystrokes. This shouldn't be an issue if you're using a graphical display for emacs, but your window manager might grab some key combinations, and Emacs won't even know about them.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-07-05T17:55:40.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24386" PostTypeId="2" ParentId="23976" CreationDate="2016-07-05T19:14:11.187" Score="0" Body="&lt;p&gt;The easiest way to do this is just to set up Emacs to start when you log in. On distros that use systemd this can be done in a way described here:&#xA;&lt;a href=&quot;https://wiki.archlinux.org/index.php/Emacs#As_a_systemd_unit&quot; rel=&quot;nofollow&quot;&gt;https://wiki.archlinux.org/index.php/Emacs#As_a_systemd_unit&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set up my .desktop file for Emacs to use &lt;code&gt;emacsclient -nc&lt;/code&gt;, but you shouldn't use the &quot;n&quot; flag in the EDITOR environment variable if you want to use Emacs when some program from command line wants you to edit some text (like git or something.)&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-07-05T19:14:11.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24387" PostTypeId="2" ParentId="24378" CreationDate="2016-07-05T20:08:42.277" Score="0" Body="&lt;p&gt;I have a solution, although it's not perfect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I advice the export function of the source block language in question:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-babel-execute-exports-code-around (org-fun &amp;amp;rest args)&#xA;  &quot;Do not execute code blocks that exports code.&quot;&#xA;  (let ((exports (cdr (assoc :exports (cadr args)))))&#xA;    (if (string= exports &quot;code&quot;)&#xA;        (car args)&#xA;      (apply org-fun args))))&#xA;(advice-add 'org-babel-execute:shell :around #'org-babel-execute-exports-code-around)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I get what I wanted with the following org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: uninterpreted_sh&#xA;#+header: :exports code&#xA;#+begin_src sh&#xA;echo &quot;Direct&quot;&#xA;#+end_src&#xA;&#xA;#+header: :exports both&#xA;#+header: :results output&#xA;#+begin_src sh :stdin uninterpreted_sh&#xA;VALUE=$(cat)&#xA;echo &quot;I got: $VALUE&quot;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: I got: echo &quot;Direct&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2016-07-05T20:08:42.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24388" PostTypeId="1" CreationDate="2016-07-05T20:12:50.810" Score="1" ViewCount="55" Body="&lt;p&gt;Does anyone know if it is possible to setup in the modeline globally the total number of unread messages in the Inbox with Wanderlust?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to be able to see any and all unread messages in my mailbox from any buffer.&lt;/p&gt;&#xA;" OwnerUserId="9833" LastEditorUserId="2223" LastEditDate="2016-07-11T01:30:22.837" LastActivityDate="2016-07-11T01:30:22.837" Title="Global message count in modeline in Wanderlust" Tags="|email|wanderlust|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24390" PostTypeId="2" ParentId="22412" CreationDate="2016-07-05T23:16:53.333" Score="2" Body="&lt;p&gt;I did this exercise today, and ended up with the following batch file (I named it runemacs.bat):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;setlocal enableextensions enabledelayedexpansion&#xA;set bin=C:\cygwin64\bin&#xA;IF &quot;%~1&quot; NEQ &quot;&quot; (&#xA;    for /f &quot;delims=&quot; %%i in ('%bin%\cygpath.exe %1') do set filepath=%%i&#xA;    %bin%\run.exe --quote %bin%\emacs-w32 &quot;!filepath!&quot;&#xA;) ELSE (&#xA;    %bin%\run.exe --quote %bin%\emacs-w32&#xA;)&#xA;endlocal&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The secret for the path parts is to use the &quot;--quote&quot; arguments of cygpath.exe. It seems to work well, except that for some reason the UI freezes a couple seconds shortly after launching Emacs (for me at least), which is annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This batch file can be associated to open any file you like.&lt;/p&gt;&#xA;" OwnerUserId="11807" LastEditorUserId="11807" LastEditDate="2016-07-18T17:16:16.760" LastActivityDate="2016-07-18T17:16:16.760" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24391" PostTypeId="2" ParentId="24368" CreationDate="2016-07-05T23:17:20.560" Score="3" Body="&lt;p&gt;According the help for &lt;code&gt;org-agenda-capture&lt;/code&gt; (bound to &lt;code&gt;k&lt;/code&gt; in agenda views)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Call ‘org-capture’ with the date at point.&#xA;  With a ‘C-1’ prefix, use the HH:MM value at point (if any) or the&#xA;  current HH:MM time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It works correctly &lt;em&gt;if&lt;/em&gt; you position the cursor on a line that has a time.  Otherwise the time seems to always get set to &quot;00:00&quot;.  The function responsible for getting the time is &lt;code&gt;org-get-cursor-date&lt;/code&gt;.  This function claims:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return the date at cursor in as a time.&#xA;  This works in the calendar and in the agenda, anywhere else it just&#xA;  returns the current time.&#xA;  If WITH-TIME is non-nil, returns the time of the event at point (in&#xA;  the agenda) or the current time of the day.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Everywhere &lt;em&gt;except&lt;/em&gt; in on a line in an agenda view that doesn't have time, the function behaves as advertised.  But if it doesn't find some kind of a timestamp, it defaults the current day at midnight.  The relevent piece of code is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq date (calendar-gregorian-from-absolute day)&#xA;        defd (encode-time 0 (or mod 0) (or hod 0)&#xA;                  (nth 1 date) (nth 0 date) (nth 2 date)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mod&lt;/code&gt; and &lt;code&gt;hod&lt;/code&gt; are the minute and hour, but aren't getting set and thus default to 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to contradict the stated intent of the function and is likely a bug rather than a feature.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2016-07-05T23:46:24.670" LastActivityDate="2016-07-05T23:46:24.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24393" PostTypeId="1" CreationDate="2016-07-06T01:30:35.840" Score="3" ViewCount="1014" Body="&lt;p&gt;Previously I posted this question to Stack Overflow regarding &lt;a href=&quot;https://stackoverflow.com/questions/23378271/how-do-i-display-ansi-color-codes-in-emacs-for-any-mode&quot;&gt;rendering ansi-colors&lt;/a&gt;. The tip worked but performance very bad; when I open a 15 MB log file, emacs just locks up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided to try installing &lt;code&gt;tty-format.el&lt;/code&gt;. This had the same result (i.e. poor performance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I tried to install &lt;a href=&quot;https://github.com/atomontage/xterm-color&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;xterm-color.el&lt;/code&gt;&lt;/a&gt; but I couldn't figure out how to make it work; the lisp file loaded but it's not clear to me how to make ANSI codes colorize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a solution for poor performance in rendering ANSI colors?&lt;/strong&gt; Thanks!&lt;/p&gt;&#xA;" OwnerUserId="653" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2018-07-03T14:36:45.413" Title="How can I improve ansi-color rendering performance?" Tags="|font-lock|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24394" PostTypeId="2" ParentId="24290" CreationDate="2016-07-06T01:35:17.233" Score="0" Body="&lt;p&gt;First thanks for the answer from @chenbin. All the following ideas from his answer and blog post. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I have some mis-understand on the 4 step way to create local elpa. For me to manually maintain it is painful (For example, package from git repo, keep updating).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some googling about &quot;local elpa&quot; I steal code (Makefile, package-build.el) from &quot;melpa&quot; which would build local elpa &lt;code&gt;packages&lt;/code&gt; and &lt;code&gt;archive-contents&lt;/code&gt; from &lt;code&gt;recipes&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I only need to maintain recipes something like below (use &lt;code&gt;ob-go&lt;/code&gt; as example)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ob-go&#xA; :fetcher github&#xA; :repo &quot;pope/ob-go&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The make file would cache the package from Github and create &lt;code&gt;archive-contents&lt;/code&gt; to &lt;code&gt;packages&lt;/code&gt; directory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I just need to add &lt;code&gt;(&quot;local-elpa&quot; . &quot;~/.emacs.d/packages&quot;)&lt;/code&gt; to &lt;code&gt;package-archives&lt;/code&gt; and pin it to &lt;code&gt;local-elpa&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If local elpa packages has updates, just make the packages and archive-contents, then update packages as usual.&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2016-07-06T01:35:17.233" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24395" PostTypeId="1" CreationDate="2016-07-06T03:46:33.380" Score="1" ViewCount="1266" Body="&lt;p&gt;I am using spacemacs with racket-mode, company-mode, and scheme-complete, to code in racket, and its pretty efficient.  But, in order to have completion for user defined variables and functions, I have to press tab to activate scheme-complete, since only scheme complete is aware of user defined variables/functions. And I don't know what Emacs thinks I want to type like I would if there was a drop down menu.  Is there any way to make company mode aware of the user-defined variables/functions that scheme complete is aware of, so that they appear in the drop down menu.  Currently it is only aware of built in functions like define, list, etc.  I am still relatively new to emacs/spacemacs so I might be doing something stupid.  Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: It seems like symbols become available after &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;racket run&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is executed, but that doesn't exactly solve the problem of convenience.&lt;/p&gt;&#xA;" OwnerUserId="12567" LastEditorUserId="12567" LastEditDate="2016-07-06T04:01:46.677" LastActivityDate="2016-09-04T12:15:48.130" Title="Is there a way to make auto-complete aware of user defined variables" Tags="|spacemacs|auto-complete-mode|scheme|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24397" PostTypeId="1" AcceptedAnswerId="32968" CreationDate="2016-07-06T08:26:36.437" Score="2" ViewCount="1048" Body="&#xA;&#xA;&lt;p&gt;How to ignore emacs backup (*~) files in projectile?&#xA;My code does not work.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package projectile&#xA;  :config&#xA;  (progn&#xA;    (setq projectile-globally-ignored-files&#xA;          (append '(&#xA;                &quot;*.pyc&quot;&#xA;                &quot;*.class&quot;&#xA;                &quot;*~&quot;&#xA;                )&#xA;              projectile-globally-ignored-files))&#xA;    (projectile-global-mode)&#xA;    (setq projectile-completion-system 'helm)&#xA;    (helm-projectile-on)&#xA;    (setq projectile-enable-caching t)&#xA;    (defconst projectile-mode-line-lighter &quot; P&quot;)&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call &lt;code&gt;helm-projectile-find-other-file&lt;/code&gt; I always see backup files which is quite annoying.&lt;/p&gt;&#xA;" OwnerUserId="9682" LastEditorUserId="15748" LastEditDate="2017-05-20T17:45:56.077" LastActivityDate="2017-05-20T17:45:56.077" Title="Ignore backup files in projectile" Tags="|projectile|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24398" PostTypeId="1" CreationDate="2016-07-06T08:33:34.023" Score="1" ViewCount="177" Body="&lt;p&gt;In Emacs 25 GUI, &#xA;1. Shell process loads environment variables,&#xA;2. Python process, started by &lt;em&gt;run-python&lt;/em&gt;, doesn't load environment variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run Emacs terminal mode in iTem2: Both shell and python process load environment variables. &lt;/p&gt;&#xA;" OwnerUserId="4044" LastActivityDate="2016-10-07T12:24:08.900" Title="python process failed to load environment variables in OSX" Tags="|python|terminal-emacs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24399" PostTypeId="1" AcceptedAnswerId="24411" CreationDate="2016-07-06T10:15:40.007" Score="8" ViewCount="10951" Body="&lt;p&gt;How can I copy from the command line and paste in Emacs in terminal mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I select the text with the mouse and paste it from the clipboard with the third button (the wheel) it is OK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I try to run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -nw file_name.sh (for example)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;emacs opens the file which I start editing, then I &lt;code&gt;C-z&lt;/code&gt; to go back to the terminal.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ recall a command from the history&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;go to the beginning of the line and press &lt;code&gt;C-k&lt;/code&gt; to kill it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ fg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;go back to Emacs and try to paste it with &lt;code&gt;C-y&lt;/code&gt; doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="8830" LastEditorUserId="253" LastEditDate="2016-07-06T14:02:30.523" LastActivityDate="2023-10-21T21:13:34.583" Title="copy from shell and paste in terminal-emacs" Tags="|terminal-emacs|copy-paste|bash|" AnswerCount="6" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24400" PostTypeId="2" ParentId="24334" CreationDate="2016-07-06T11:38:47.050" Score="1" Body="&lt;p&gt;There's a MELPA package for that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gitlab.com/xuhdev/dired-quick-sort#dired-quick-sort&quot; rel=&quot;nofollow&quot;&gt;https://gitlab.com/xuhdev/dired-quick-sort#dired-quick-sort&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-07-06T11:38:47.050" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24401" PostTypeId="2" ParentId="24399" CreationDate="2016-07-06T11:40:17.183" Score="2" Body="&lt;p&gt;If you want to copy-paste easily between a shell and Emacs, you can try using &lt;code&gt;M-x shell&lt;/code&gt; from Emacs, instead of running the shell independently. I haven't tried integrating my Emacs and Bash kill rings. &lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastEditorUserId="25" LastEditDate="2016-07-06T17:03:10.163" LastActivityDate="2016-07-06T17:03:10.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24402" PostTypeId="2" ParentId="24395" CreationDate="2016-07-06T11:43:04.370" Score="4" Body="&lt;p&gt;One of the most robust ways to get autocompletion is to use dabbrev. It's bound to M-/ by default. You can use it to autocomplete variables, functions and many other things. &lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-07-06T11:43:04.370" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24403" PostTypeId="1" CreationDate="2016-07-06T12:08:17.367" Score="3" ViewCount="1817" Body="&lt;p&gt;I'm using elpy with emacs and python3.  Here's the relevant part of my .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; PYTHON&#xA;(elpy-enable)&#xA;(setq elpy-rpc-python-command &quot;python3&quot;)&#xA;(elpy-use-ipython &quot;ipython3&quot;)&#xA;(autoload 'jedi:setup &quot;jedi&quot; nil t)&#xA;(add-hook 'python-mode-hook 'jedi:setup)&#xA;(add-hook 'pyvenv-mode-hook 'jedi:setup)&#xA;(setq jedi:setup-keys t)&#xA;(setq jedi:complete-on-dot t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if I create a class in a python file, auto completion works perfectly.  Then I try C-c C-c, and the class is loaded up in my ipython buffer, and I can play around with it.  So far so good.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunatly, this is where I really want auto-complete, but my autocomplete experience here is a little unsatisfactory.  Out of the box I can use tab to get completions in another window, but I'd like the &quot;on dot popup&quot; I get in python mode.   Executuing &lt;code&gt;jedi:setup&lt;/code&gt; gives me popups, but it's just builtins, and not my class methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get the same auto complete behavior in my ipython rpc buffer as I get in my python editing buffer?&lt;/p&gt;&#xA;" OwnerUserId="8576" LastActivityDate="2016-07-06T16:42:32.730" Title="elpy with ipython as rpc -- how to get good autocompletion" Tags="|auto-complete-mode|ipython|elpy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24404" PostTypeId="2" ParentId="24361" CreationDate="2016-07-06T14:36:57.107" Score="3" Body="&lt;p&gt;Make sure you've restarted Emacs. The docstring for &lt;code&gt;org-emphasis-alist&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You need to reload Org or to restart Emacs after customizing this.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-07-06T14:36:57.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24405" PostTypeId="2" ParentId="18688" CreationDate="2016-07-06T14:37:18.617" Score="2" Body="&lt;p&gt;You may consider putting your glossary in another format. For example, I use list definitions to accomplish what you are after, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* List of Acronyms&#xA;&#xA;- &amp;lt;&amp;lt;&amp;lt;ABI&amp;gt;&amp;gt;&amp;gt; :: Application Binary Interface&#xA;- &amp;lt;&amp;lt;&amp;lt;API&amp;gt;&amp;gt;&amp;gt; :: Application Programming Interface&#xA;- &amp;lt;&amp;lt;&amp;lt;DOR&amp;gt;&amp;gt;&amp;gt; :: Documentation Requirement&#xA;  :PROPERTIES:&#xA;  :TAGS: requirement&#xA;  :END:&#xA;  Anything related to documentation it self not the specific content like &quot;documents must be in a diff-able format&quot;.&#xA;- &amp;lt;&amp;lt;&amp;lt;HTML&amp;gt;&amp;gt;&amp;gt; :: HyperText Markup Language&#xA;  Almost everyone knows this nowadays :)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&#xA;This helps to avoid repeating the acronym as radio target.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You still can use the tip of @user2699 and &lt;code&gt;#+include&lt;/code&gt; your glossary file. The auto links to radio targes are inserted on export, but not in org mode.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-26T13:17:34.353" LastActivityDate="2016-08-26T13:17:34.353" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24406" PostTypeId="1" AcceptedAnswerId="24407" CreationDate="2016-07-06T15:42:51.500" Score="14" ViewCount="1104" Body="&lt;p&gt;This seems so obvious that I feel sure that I've just missed something in the manual. I frequently do a calculation and then want to use that calculation elsewhere. But let's say my stack is currently:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--- Emacs Calculator Mode ---&#xA;1:  42&#xA;    .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any way I've tried to copy the value &lt;code&gt;42&lt;/code&gt; with incantations of &lt;code&gt;M-w&lt;/code&gt;, what I get when I yank is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1:  42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;including the newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/calc/Killing-From-Stack.html&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Although a whole line is always deleted, C-k with no argument copies&#xA;  only the number itself into the kill ring, whereas C-k with a prefix&#xA;  argument of 1 copies the number with its trailing newline.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but that only works with &lt;code&gt;C-k&lt;/code&gt;, weirdly, not with &lt;code&gt;M-w&lt;/code&gt; (though otherwise the commands respond to arguments similarly), and still, that doesn't solve my problem, as I still get the stack number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amazingly, even moving the cursor, setting mark on &lt;code&gt;4&lt;/code&gt; and point after &lt;code&gt;2&lt;/code&gt; to set a region (which is highlighted, making me think this should work) doesn't get my the value: it still gives me the entire line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;code&gt;M-x quick-calc&lt;/code&gt;, which lets me enter an algebraic expression into the minibuffer whose result is placed into the kill ring, but that's not helpful if I'm doing a complex calculation or simply want to use the normal Calc RPN interface. (While there are methods described about how to move a &lt;code&gt;quick-calc&lt;/code&gt; result into the calculator stack, I don't see a way to gain access to the stack from &lt;code&gt;quick-calc&lt;/code&gt;. &lt;code&gt;$1&lt;/code&gt;, etc., refer to prior results of &lt;code&gt;quick-calc&lt;/code&gt; instead.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;calc-copy-to-buffer&lt;/code&gt; is bound conveniently to &lt;code&gt;y&lt;/code&gt;, but I often want to use the result in the minibuffer or even in another program via kill-ring/clipboard integration, so this isn't a solution, either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I can yank or copy to a buffer and then edit the result and re-kill the edited result, but I do this so frequently and again, it seems like such an obvious use case that I really think I'm just missing something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know there are Orgmode and database solutions for bulk transfer of Calc data, but I just want a single value to yank; it shouldn't be that hard.)&lt;/p&gt;&#xA;" OwnerUserId="8756" LastActivityDate="2019-11-16T23:09:02.503" Title="Calc: copy only a value, not stack number" Tags="|kill-ring|calc|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24407" PostTypeId="2" ParentId="24406" CreationDate="2016-07-06T15:42:51.500" Score="5" Body="&lt;p&gt;Just after posting this, I found a solution I'm surprised I didn't think of sooner: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Hit backtick (&lt;code&gt;calc-edit&lt;/code&gt;) to edit the stack value.&lt;/li&gt;&#xA;&lt;li&gt;Kill the line in the edit buffer with &lt;code&gt;C-w&lt;/code&gt; (editing it first if it suits your needs).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-c&lt;/code&gt; to close the buffer (if you killed everything, the value gets restored on the stack, so it's equivalent to hitting &lt;code&gt;C-c C-k&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Yank or paste wherever you please.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Not quite the single-key solution I was expecting, but it'll do.&lt;/p&gt;&#xA;" OwnerUserId="8756" LastActivityDate="2016-07-06T15:42:51.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24409" PostTypeId="2" ParentId="24403" CreationDate="2016-07-06T16:42:32.730" Score="3" Body="&lt;p&gt;Elpy doesn't require emacs jedi package. Also they won't work well when both are configured. I guess there is some conflict between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use only elpy and you should be able to get completion in rpc buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I created an empty file with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Foo:&#xA;    this = 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After sending this to python buffer with &lt;kbd&gt;C-C C-c&lt;/kbd&gt;, if i switch to python buffer and type &lt;code&gt;Foo.&lt;/code&gt; it gives completions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uPn0d.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uPn0d.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2016-07-06T16:42:32.730" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24410" PostTypeId="2" ParentId="24406" CreationDate="2016-07-06T16:48:07.550" Score="2" Body="&lt;p&gt;Here's some code to define a function to put the most recent thing in the calc stack into the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-calc-top ()&#xA;  &quot;Copy the thing at the top of the calc stack.&quot;&#xA;  (interactive)&#xA;  (let ((val (calc-top)))&#xA;    (kill-new (if (Math-scalarp val)&#xA;                  (math-format-number val)&#xA;                (math-format-flat-expr-fancy val 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And we can bind it to a key.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key calc-mode-map (kbd &quot;M-w&quot;) #'copy-calc-top)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think this should now work for most data types. It works for integers, floating point numbers, and dates.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2016-07-06T17:11:45.657" LastActivityDate="2016-07-06T17:11:45.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24411" PostTypeId="2" ParentId="24399" CreationDate="2016-07-06T17:18:07.147" Score="10" Body="&lt;p&gt;You can't copy-paste between Emacs and a shell without using a system-wide copy-paste facility. Text terminals in general do not provide a copy-paste facility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that you're running this terminal Emacs in a terminal window in a window environment. Window environments do provide copy-paste; that's what happens when you use the mouse. However, this happens outside the knowledge of Emacs and Bash: what you copy is the text that appears on the screen, and what you paste appears to the program as if you'd typed it very quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to integrate Bash's clipboard with the window environment's clipboard, you can use command line copy-paste tools: &lt;a href=&quot;http://www.vergenet.net/~conrad/software/xsel/&quot; rel=&quot;noreferrer&quot;&gt;xsel&lt;/a&gt; or &lt;a href=&quot;http://sourceforge.net/projects/xclip/&quot; rel=&quot;noreferrer&quot;&gt;xclip&lt;/a&gt; on X11, &lt;a href=&quot;https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/pbcopy.1.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;pbcopy&lt;/code&gt;&lt;/a&gt;/&lt;a href=&quot;https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/pbpaste.1.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;pbpaste&lt;/code&gt;&lt;/a&gt; on OS X, &lt;a href=&quot;https://stackoverflow.com/questions/1322594/cygwin-command-to-copy-to-windows-clipboard&quot;&gt;&lt;code&gt;/dev/clipboard&lt;/code&gt;&lt;/a&gt; on Cygwin. See &lt;a href=&quot;https://unix.stackexchange.com/questions/18701/share-the-clipboard-between-bash-and-x11&quot;&gt;Share the clipboard between bash and X11&lt;/a&gt; for the Bash side. You can do something similar on the Emacs side, though it doesn't make that much sense since you can run a window Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If no window environment is available, you can run both Bash and Emacs inside a terminal multiplexer such as &lt;a href=&quot;https://en.wikipedia.org/wiki/GNU_Screen&quot; rel=&quot;noreferrer&quot;&gt;Screen&lt;/a&gt; or &lt;a href=&quot;https://en.wikipedia.org/wiki/Tmux&quot; rel=&quot;noreferrer&quot;&gt;tmux&lt;/a&gt;. Their copy-paste facility suffers the same limitation as the mouse-based one: since it's provided by the terminal, it can only copy output that's on the terminal and provide input as if it came from the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to exchange data between Emacs and Bash, and no common clipboard is available (e.g. because the programs are running on a remote machine), use a temporary file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility is to run your shell within Emacs, &lt;a href=&quot;https://emacs.stackexchange.com/a/24401&quot;&gt;as suggested by DoMiNeLa10&#xA;&lt;/a&gt;. In that case, Emacs provides the copy-paste facility.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-06T17:18:07.147" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24413" PostTypeId="2" ParentId="24382" CreationDate="2016-07-06T23:30:30.053" Score="5" Body="&lt;p&gt;Emacs uses some heuristic to guess the encoding of the file. In this case it fails. No problem, just let Emacs know that the file uses &lt;code&gt;UTF-8&lt;/code&gt; encoding. You can do that after visiting the file with &lt;code&gt;C-x RET r&lt;/code&gt; or &lt;code&gt;M-x revert-buffer-with-coding-system&lt;/code&gt;.  See &lt;code&gt;(info &quot;(emacs) Specify Coding&quot;)&lt;/code&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2016-07-06T23:30:30.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24414" PostTypeId="1" CreationDate="2016-07-06T23:53:19.210" Score="2" ViewCount="473" Body="&lt;p&gt;I'm a longtime Emacs user, and I've decided to take the plunge and build it myself, because I can, and because maybe I'd like to choose a different graphical toolkit. By the by, is there any way, when compiling Emacs, to only compile certain portions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As in, I know I'm never going to use the IRC client, the mail client, the two browsers, etc. So is there a way for me to build Emacs without those components that I don't need and will only be taking up binary space?&lt;/p&gt;&#xA;" OwnerUserId="9315" LastEditorUserId="105" LastEditDate="2016-07-07T02:03:03.440" LastActivityDate="2016-07-07T02:03:03.440" Title="Building emacs without certain packages/components" Tags="|build|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24415" PostTypeId="2" ParentId="24414" CreationDate="2016-07-07T00:23:37.100" Score="6" Body="&lt;p&gt;The vast bulk of Emacs libraries are &lt;em&gt;not&lt;/em&gt; included in the &lt;code&gt;emacs&lt;/code&gt; executable; so if you never use them, they are merely taking up a little space on the filesystem. With modern hard disk sizes, I think it's &lt;em&gt;extremely&lt;/em&gt; unlikely to be worth your time deleting any of them to reclaim space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only elisp libraries which are directly included in the &lt;code&gt;emacs&lt;/code&gt; executable are the ones loaded by &lt;code&gt;loadup.el&lt;/code&gt; (see &lt;a href=&quot;https://emacs.stackexchange.com/a/16521&quot;&gt;https://emacs.stackexchange.com/a/16521&lt;/a&gt; for details).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-07-07T00:23:37.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24416" PostTypeId="2" ParentId="24229" CreationDate="2016-07-07T02:04:00.580" Score="5" Body="&lt;p&gt;Surprisingly (at least to me), the &lt;code&gt;-f&lt;/code&gt; flag means different things to emacs and emacsclient. To emacs, it means:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-f FUNCTION&lt;br&gt;&#xA;   --funcall=FUNCTION  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Call Lisp function FUNCTION.  If it is an interactive function (a&#xA;       command), it reads the arguments interactively just as if you had&#xA;       called the same function with a key sequence.  Otherwise, it calls&#xA;       the function with no arguments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Whereas for emacsclient:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-f SERVER-FILE&lt;br&gt;&#xA;  --server-file=SERVER-FILE   &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Specify a “server file” for connecting to an Emacs server via TCP.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So that's one problem solved. As for starting a new &lt;code&gt;eshell&lt;/code&gt; session, from the help (&lt;code&gt;C-h f eshell &amp;lt;return&amp;gt;&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(eshell &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Create an interactive Eshell buffer.&lt;br&gt;&#xA;  The buffer used for Eshell sessions is determined by the value of&#xA;  `eshell-buffer-name'.  If there is already an Eshell session active in&#xA;  that buffer, Emacs will simply switch to it.  Otherwise, a new session&#xA;  will begin.  A numeric prefix arg (as in `C-u 42 M-x eshell RET')&#xA;  switches to the session with that number, creating it if necessary.  &lt;strong&gt;A&#xA;  nonnumeric prefix arg means to create a new session.&lt;/strong&gt;  Returns the&#xA;  buffer selected (or created).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So we can get a fresh &lt;code&gt;eshell&lt;/code&gt; process in an emacsclient with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -e '(eshell t)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-07T02:04:00.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24417" PostTypeId="2" ParentId="24251" CreationDate="2016-07-07T02:57:02.567" Score="1" Body="&lt;p&gt;After opening the &lt;code&gt;sci&lt;/code&gt;-file start Scilab by the menu item &quot;Scilab&quot; -&gt; &quot;Start Scilab&quot;.&#xA;Afterwards you can use the key binding &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-b&lt;/kbd&gt; to run the command &lt;code&gt;scilab-shell-run-buffer&lt;/code&gt; for the file buffer of your &lt;code&gt;sci&lt;/code&gt;-file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT after comment of &lt;a href=&quot;https://emacs.stackexchange.com/users/10056/p-a&quot;&gt;p-a&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, sorry, I just noticed that &lt;code&gt;scilab-shell-run-buffer&lt;/code&gt; is a function defined in my setup. The corresponding lines are:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun scilab-shell-run-buffer ()&#xA;  &quot;Run scilab on buffer.&quot;&#xA;  (interactive)&#xA;  (scilab-shell-run-region (point-min) (point-max)))&#xA;&#xA;(add-hook 'scilab-mode-hook '(lambda ()&#xA;                   (local-set-key (kbd &quot;C-c C-c&quot;) 'scilab-shell-run-line)&#xA;                   (local-set-key (kbd &quot;C-c C-r&quot;) 'scilab-shell-run-region)&#xA;                   (local-set-key (kbd &quot;C-c C-b&quot;) 'scilab-shell-run-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-07-07T12:03:42.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24418" PostTypeId="1" CreationDate="2016-07-07T05:55:11.550" Score="1" ViewCount="521" Body="&lt;p&gt;I have installed the TeXLive distribution. From emacs running in cygwin mintty, the LaTeX binaries are visible from my &lt;code&gt;PATH&lt;/code&gt; environment variable. I installed AucTeX using the built in Emacs package manager with the package from Elpa.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ which latex&#xA;/cygdrive/c/texlive/2016/bin/win32/latex&#xA;$ which pdflatex&#xA;/cygdrive/c/texlive/2016/bin/win32/pdflatex&#xA;$ latex&#xA;This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/W32TeX) (preloaded format=latex)&#xA; restricted \write18 enabled.&#xA;**&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I try &lt;code&gt;C-c C-c&lt;/code&gt; from a LaTeX file, I get the following message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TeX-command: ERROR: AUCTeX cannot find a working TeX distribution.&#xA;Make sure you have one and that TeX binaries are in PATH environment variable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there some AucTeX variable I could customize to point it in the right direction to the TeX distribution? I am pretty confident my &lt;code&gt;PATH&lt;/code&gt; is set correctly.&lt;/p&gt;&#xA;" OwnerUserId="9302" LastActivityDate="2016-07-07T16:51:30.030" Title="Why can't AucTeX see my TeXLive binaries? (Cygwin on Windows 7 x64)" Tags="|auctex|path|cygwin|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24419" PostTypeId="1" AcceptedAnswerId="24422" CreationDate="2016-07-07T06:33:02.420" Score="4" ViewCount="955" Body="&lt;p&gt;Hi How can I use emacs find to list files without their detailed information?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-r--r--r-- user 3845 Apr 10 2014 ua.cpp&#xA;-r--r--r-- user 3845 Apr 10 2014 ub.cpp&#xA;-r--r--r-- user 3845 Apr 10 2014 uc.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ua.cpp ub.cpp uc.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="253" LastEditDate="2016-07-07T14:06:03.000" LastActivityDate="2016-07-08T07:09:06.447" Title="emacs list files with less information" Tags="|dired|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24420" PostTypeId="2" ParentId="24323" CreationDate="2016-07-07T07:36:51.647" Score="1" Body="&lt;p&gt;The problem came from the interaction between &lt;code&gt;jedi&lt;/code&gt; and &lt;code&gt;company&lt;/code&gt;. Both interact in a wrong way, as it is explained &lt;a href=&quot;https://github.com/syohex/emacs-company-jedi#installation&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, so company users must install &lt;code&gt;company-jedi&lt;/code&gt; instead of &lt;code&gt;jedi&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the solution was just to remove the &lt;code&gt;jedi&lt;/code&gt; package!&lt;/p&gt;&#xA;" OwnerUserId="10056" LastActivityDate="2016-07-07T07:36:51.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24421" PostTypeId="1" AcceptedAnswerId="24423" CreationDate="2016-07-07T07:39:30.223" Score="3" ViewCount="299" Body="&lt;p&gt;Is there a way to use isearch (only search i think that works in pdf-tools)? to search for either of two words at the same time? It would search in the pdf for 'eval' &lt;em&gt;or&lt;/em&gt; 'valid' and move forward in each occurrence of either word?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="2325" LastEditDate="2016-07-07T15:15:54.743" LastActivityDate="2016-07-08T07:06:22.607" Title="Search for either of two words using isearch" Tags="|isearch|pdf-tools|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24422" PostTypeId="2" ParentId="24419" CreationDate="2016-07-07T08:25:14.623" Score="5" Body="&lt;p&gt;M-x list-directory (key C-x C-d) is probably what you want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M-x dired, then&#xA;M-x dired-hide-details-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you always want to hide detail, add a hook. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'dired-mode-hook 'dired-hide-details-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you really want them all in a single line, M-x shell-command (M-!) and &lt;code&gt;ls -m&lt;/code&gt; is probably the best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, better I think is just M-x eshell, then do &lt;code&gt;ls&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-07-08T07:09:06.447" LastActivityDate="2016-07-08T07:09:06.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24423" PostTypeId="2" ParentId="24421" CreationDate="2016-07-07T08:33:24.130" Score="7" Body="&lt;p&gt;C-M-s to invoke &lt;code&gt;isearch-forward-regexp&lt;/code&gt; then type &lt;code&gt;aaa\|bbb&lt;/code&gt;, where aaa is your first word and bbb is your second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatives, just C-s to invoke &lt;code&gt;isearch&lt;/code&gt;, then press M-r to toggle to regex.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-07-08T07:06:22.607" LastActivityDate="2016-07-08T07:06:22.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24424" PostTypeId="1" AcceptedAnswerId="24425" CreationDate="2016-07-07T08:53:36.203" Score="1" ViewCount="392" Body="&lt;p&gt;In C/l-mode F1 v indent-tabs-mode prints:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;indent-tabs-mode is a variable defined in `C source code'.&#xA;Its value is nil&#xA;Original value was t&#xA;Local in buffer nir_types.cpp; global value is t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But pressing the tab key still replaces the spaces used for indentation with tabs.&lt;/p&gt;&#xA;" OwnerUserId="2325" LastActivityDate="2016-07-07T08:53:36.203" Title="Why is emacs indenting with tabs even though indent-tabs-mode is nil?" Tags="|indentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24425" PostTypeId="2" ParentId="24424" CreationDate="2016-07-07T08:53:36.203" Score="1" Body="&lt;p&gt;Turns out it was smart-tabs-mode which was making life miserable as I have it turned on by default in my init.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turning it off locally for the specific project solved all my troubles. I.e. in .dir-locals.el in the source code parent folder I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((prog-mode&#xA;  (indent-tabs-mode . nil)&#xA;  (smart-tabs-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2325" LastActivityDate="2016-07-07T08:53:36.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24426" PostTypeId="1" CreationDate="2016-07-07T09:40:12.490" Score="0" ViewCount="277" Body="&lt;p&gt;I am relatively new to emacs. I'm wanting to set up cc-mode. I'm having trouble with the process. When I initially viewed list-packages, a search brought up cc-mode, but something I've done means it is not there any more. I am using the default package source at elpa. I have downloaded and byte-compiled cc-mode into ~/.emacs.d/ and made sure it is in the load path (although I'm not confident I've done this correctly). I have tried the tests mentioned on &lt;a href=&quot;http://cc-mode.sourceforge.net/installation.php&quot; rel=&quot;nofollow&quot;&gt;http://cc-mode.sourceforge.net/installation.php&lt;/a&gt; and c-version isn't recognised, just as an incremental search does not recognise 'cc-'. I would be grateful for any help.&lt;/p&gt;&#xA;" OwnerUserId="12580" LastActivityDate="2016-07-07T10:37:16.900" Title="emacs cc-mode installation issue" Tags="|cc-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24427" PostTypeId="1" AcceptedAnswerId="24433" CreationDate="2016-07-07T10:35:22.997" Score="1" ViewCount="1945" Body="&lt;p&gt;I'm wondering if anyone knows of a clever way in Emacs when in a shell, can I directly open a file without having to open it in another Emacs instance. &lt;/p&gt;&#xA;" OwnerUserId="12579" LastEditorUserId="105" LastEditDate="2016-11-12T03:01:57.507" LastActivityDate="2016-11-12T03:01:57.507" Title="From eshell or ansi-term can I open a file in the same window without a new instance of Emacs?" Tags="|window|eshell|ansi-term|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24428" PostTypeId="2" ParentId="24426" CreationDate="2016-07-07T10:37:16.900" Score="1" Body="&lt;p&gt;&lt;code&gt;cc-mode&lt;/code&gt; comes bundled with Emacs[0]. No manual installation needed. To make sure that &lt;code&gt;cc-mode&lt;/code&gt; is available, just go to the scratch buffer and type &lt;code&gt;(require 'cc-mode)&lt;/code&gt; place the cursor at the end of the line and press &lt;code&gt;C-x C-e&lt;/code&gt;, it should echo &lt;code&gt;cc-mode&lt;/code&gt; in the mini buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer:&#xA;[0] : &lt;a href=&quot;http://cc-mode.sourceforge.net/compat.php&quot; rel=&quot;nofollow&quot;&gt;http://cc-mode.sourceforge.net/compat.php&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9573" LastActivityDate="2016-07-07T10:37:16.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24430" PostTypeId="2" ParentId="21723" CreationDate="2016-07-07T12:30:51.423" Score="7" Body="&lt;p&gt;If you use offlineimap (like I do) then your drafts likely accumulate because offlineimap syncs emacs' #autosave# files (kept in Drafts/cur folder). As offlineimap can only ignore files starting with '.' (and it's not configurable) the solution is to change the way draft autosaves are named:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun draft-auto-save-buffer-name-handler (operation &amp;amp;rest args)&#xA;&quot;for `make-auto-save-file-name' set '.' in front of the file name; do nothing for other operations&quot;  &#xA;(if&#xA;  (and buffer-file-name (eq operation 'make-auto-save-file-name))&#xA;  (concat (file-name-directory buffer-file-name)&#xA;            &quot;.&quot;&#xA;            (file-name-nondirectory buffer-file-name))&#xA; (let ((inhibit-file-name-handlers&#xA;       (cons 'draft-auto-save-buffer-name-handler&#xA;             (and (eq inhibit-file-name-operation operation)&#xA;                  inhibit-file-name-handlers)))&#xA;      (inhibit-file-name-operation operation))&#xA;  (apply operation args))))&#xA;&#xA;(add-to-list 'file-name-handler-alist '(&quot;Drafts/cur/&quot; . draft-auto-save-buffer-name-handler))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Other possible option would be to store all autosaves in a dedicated folder (check auto-save-file-name-transforms variable).&lt;/p&gt;&#xA;" OwnerUserId="12582" LastActivityDate="2016-07-07T12:30:51.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24432" PostTypeId="2" ParentId="24419" CreationDate="2016-07-07T13:54:50.243" Score="3" Body="&lt;p&gt;You can use whatever &lt;code&gt;ls&lt;/code&gt; switches (command-line options) you want, for any particular Dired listing, by using a prefix argument with the Dired commands.&#xA;For example: &lt;strong&gt;&lt;code&gt;C-u C-x d&lt;/code&gt;&lt;/strong&gt;.  You are prompted for the &lt;code&gt;ls&lt;/code&gt; switches to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can set your own preference for the &lt;code&gt;ls&lt;/code&gt; switches to use &lt;em&gt;by default&lt;/em&gt; each time, just by customizing user option &lt;strong&gt;&lt;code&gt;dired-listing-switches&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-option RET dired-listing-switches RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, each time you use Dired, you will get the kind of listing you prefer, and if you ever want to override your preference you just use a prefix argument (&lt;code&gt;C-u&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And whenever you are in Dired you can &lt;em&gt;toggle whether to show the details&lt;/em&gt; (whatever they are, as determined by the &lt;code&gt;ls&lt;/code&gt; switches), using &lt;strong&gt;&lt;code&gt;(&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-07T13:54:50.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24433" PostTypeId="2" ParentId="24427" CreationDate="2016-07-07T14:46:13.833" Score="2" Body="&lt;p&gt;I'm assuming you mean in the same window, not buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From eshell its simple. You can run emacs lisp functions by simply typing them into eshell. This means you can type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find-file file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to open file.txt. You could also make a nicer alias to this so you could do something like type &quot;emacs file.txt&quot; to do the same thing. The emacs wiki page on eshell aliases has several examples of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/EshellAlias&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/EshellAlias&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12583" LastActivityDate="2016-07-07T14:46:13.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24434" PostTypeId="1" AcceptedAnswerId="24442" CreationDate="2016-07-07T15:11:44.207" Score="0" ViewCount="191" Body="&lt;p&gt;I have Emacs installed with &lt;code&gt;brew install emacs-mac --HEAD --with-cocoa --with-gnutls --with-librsvg --with-imagemagick&lt;/code&gt;. I have the final &lt;code&gt;.app&lt;/code&gt; binary in the OS X Dock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I drag a file onto the Dock icon, the default behavior opens it in the last-activated frame, even if it is on a different desktop. I'd like files to open in a new frame in the current desktop when drag-and-dropped onto the icon. Is this behavior possible? Yes, because this is emacs. Can anyone suggest a place to begin implementing this?&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-07-07T19:16:40.557" Title="How can I get Emacs to launch new frame when a file is dropped onto the Dock icon?" Tags="|osx|emacs-mac-port|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24435" PostTypeId="2" ParentId="24261" CreationDate="2016-07-07T16:28:30.133" Score="1" Body="&lt;p&gt;The solution to this issue was not in the flycheck load path. Instead, the variable warnings were showing up because the contents of the &lt;code&gt;(require 'my-dcls)&lt;/code&gt; were not providing declarations that the byte-compiler liked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that the following syntax would work, as was suggested &lt;a href=&quot;https://emacs.stackexchange.com/questions/24210/tell-flycheck-about-my-global-variables-across-multiple-files&quot;&gt;in this earlier thread&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; a reference declaration, so no value was set&#xA;(defvar my-global-var)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in fact a value had to be declared in the &lt;code&gt;(require 'my-dcls)&lt;/code&gt; file to keep flycheck and the byte-compiler syntax checkers happy. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; flycheck warnings went away when a value was set&#xA;(defvar my-global-var nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I find this behaviour odd, because the first syntax works fine when it is embedded at the top of the file being checked by Flycheck. But at least I have a somewhat better understanding of what is going on, and will not expect the &lt;code&gt;(require 'my-dcls)&lt;/code&gt; method to make the warnings disappear.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-07T16:28:30.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24436" PostTypeId="1" AcceptedAnswerId="24583" CreationDate="2016-07-07T16:34:30.463" Score="0" ViewCount="417" Body="&lt;p&gt;I am working on a beamer presentation with AUCTeX on OS X. When I use preview &lt;code&gt;(C-c C-p C-b)&lt;/code&gt; on the following document the equation is displayed right after &lt;code&gt;\end{frame}&lt;/code&gt; and not in the line of the equation. When I use &lt;code&gt;\documentclass{article}&lt;/code&gt; the equation is displayed correctly. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{beamer} &#xA;\begin{document}&#xA;\begin{frame}&#xA;\begin{equation}&#xA;a^2 + b^2 = c^2&#xA;\end{equation}&#xA;\end{frame}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get Preview-Latex to work with beamer?&lt;/p&gt;&#xA;" OwnerUserId="12584" LastActivityDate="2020-04-18T11:53:52.343" Title="AUCTeX previews are not displayed correctly with beamer" Tags="|auctex|preview-latex|beamer|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24437" PostTypeId="2" ParentId="24210" CreationDate="2016-07-07T16:36:08.610" Score="1" Body="&lt;p&gt;The outcome of this whole issue is that &lt;code&gt;(defvar foo)&lt;/code&gt; syntax works fine if it is embedded in the source file being checked. But it fails if it is brought into the syntax check with a &lt;code&gt;(require 'my-dcls)&lt;/code&gt; reference to an external file containing &lt;code&gt;(defvar foo)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A value must be assigned to foo, such as &lt;code&gt;(defvar foo nil)&lt;/code&gt;, in the external file if the declaration is to remove free variable warnings in the source file being tested by Flycheck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for now, I conclude that there is no way in Emacs Lisp to &quot;include&quot; a reference list (with no values set in the declarations) of globally defined variables in each source file of a project. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the choices are to live with the free variable warnings, embed declarations into every source file on the project (ugh), or ensure that all my globals are defined -- with values set -- in the external declarations file brought in by the &lt;code&gt;(require 'my-dcls)&lt;/code&gt; statement. Of the three choices, #3 seems to be the best approach.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-07-09T04:54:14.190" LastActivityDate="2016-07-09T04:54:14.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24438" PostTypeId="1" CreationDate="2016-07-07T16:47:24.340" Score="1" ViewCount="188" Body="&lt;p&gt;When trying to define a macro in emacs and trying to expand key-chord in process its not working - its simply inputs letters instead. I saw explanation of this in key-chord.el but is there any workaround for this? Thx.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's explanation from key-chord.el:&#xA;&lt;code&gt;&#xA;;; When recording keyboard macros, the time between keyboard inputs are not&#xA;;; recorded. Thus, the key-chord-input-method cannot know for sure if two keys&#xA;;; in a macro was a chord or not. The current solution remembers the first key&#xA;;; of the chords typed during macro recording, and keys that match those (and&#xA;;; are defined as chords) are considered key-chords during macro execution.&#xA;;; This knowledge is not saved with `name-last-kbd-macro', so they may&#xA;;; execute wrong if they contain pair of keys that match defined chords.&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="454" LastEditDate="2016-07-08T00:04:45.720" LastActivityDate="2016-07-08T00:04:45.720" Title="key-chord not working with kmacro" Tags="|keyboard-macros|key-chord-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24439" PostTypeId="2" ParentId="24418" CreationDate="2016-07-07T16:51:30.030" Score="1" Body="&lt;p&gt;Turns out, I needed to delete the TeXLive distribution which I had installed manually using the TeXLive Windows installer and reinstall TeXLive with the Cygwin setup.exe. This will place everything in the correct places for emacs to be able to see them.&lt;/p&gt;&#xA;" OwnerUserId="9302" LastActivityDate="2016-07-07T16:51:30.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24440" PostTypeId="1" CreationDate="2016-07-07T17:16:06.770" Score="2" ViewCount="1022" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I detect/specify the monitor a frame is on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working off of a laptop that has an external monitor connected&#xA;to it.  I therefore have two monitors (call them INTERNAL and&#xA;EXTERNAL).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On occasion, I want to do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Adjust an existing frame's parameters based on the monitor&#xA; it's on &lt;/li&gt;&#xA;&lt;li&gt;Make a new frame on the other monitor&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think I can tell which monitor I'm &lt;em&gt;currently&lt;/em&gt; on with&#xA;&lt;code&gt;frame-monitor-attributes&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I don't know how to address point 2: &lt;strong&gt;given that I'm on&#xA;monitor EXTERNAL, how do I make a new frame on monitor INTERNAL&#xA;(and vice versa)?&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect I could rig something up by accessing the x location, but that seems hacky to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I've looked at &lt;code&gt;make-frame-on-display&lt;/code&gt;, but, unless I'm misunderstanding, &quot;display&quot; here means an X display or a terminal.&lt;/li&gt;&#xA;&lt;li&gt;Related threads that don't quite resolve point 2: &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/22513/is-there-a-way-to-detect-change-of-monitor-in-emacs-elisp&quot;&gt;Is there a way to detect change of monitor in Emacs / Elisp?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/14618/determine-whether-a-frame-is-shown-on-primary-display&quot;&gt;Determine whether a frame is shown on primary display&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-07-08T14:21:23.430" Title="Detect/specify the monitor a frame is on?" Tags="|frames|display|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24441" PostTypeId="1" CreationDate="2016-07-07T18:06:05.797" Score="1" ViewCount="293" Body="&lt;p&gt;I'm running Ubuntu 16.04. I installed XEmacs 21.4 (patch 22) I want to use org module BUT fail to install/configure it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case I don't use &lt;code&gt;.emacs&lt;/code&gt; but rather I have &lt;code&gt;~/.xemacs/custom.el&lt;/code&gt; where I keep all my settings. &lt;code&gt;org&lt;/code&gt; module did not exist originally hence I did this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone git://orgmode.org/org-mode.git &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This created org-mode directory. Then I added these 2 lines to &lt;code&gt;custom.el&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;/home/susja/org-mode/lisp&quot;) &#xA;(add-to-list 'load-path &quot;/home/susja/org-mode/contrib/lisp&quot; t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It did not load &lt;code&gt;org&lt;/code&gt; module. Then I ran &lt;code&gt;M-x list-packages&lt;/code&gt; and did NOT see &lt;code&gt;org&lt;/code&gt; package. Could someone please help me to configure &lt;code&gt;org&lt;/code&gt; module in order to handle &lt;code&gt;.org&lt;/code&gt; files?&lt;/p&gt;&#xA;" OwnerUserId="12586" LastEditorUserId="253" LastEditDate="2016-07-07T19:24:42.333" LastActivityDate="2016-07-08T18:09:54.560" Title="Install org module on XEmacs" Tags="|org-mode|xemacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24442" PostTypeId="2" ParentId="24434" CreationDate="2016-07-07T19:16:40.557" Score="0" Body="&lt;p&gt;Until someone suggest a better implementation, I over-write &lt;code&gt;dnd-open-local-file&lt;/code&gt; to open in a new frame instead of a new window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dnd-open-file-other-frame t)    &#xA;(defun dnd-open-local-file (uri _action)&#xA;  (let* ((f (dnd-get-local-file-name uri t)))&#xA;    (if (and f (file-readable-p f))&#xA;    (progn&#xA;      (if dnd-open-file-other-frame&#xA;          (find-file-other-frame f)&#xA;        (find-file f))&#xA;      'private)&#xA;      (error &quot;Can not read %s&quot; uri))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-07-07T19:16:40.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24443" PostTypeId="5" CreationDate="2016-07-08T00:14:23.157" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-07-08T00:14:23.157" LastActivityDate="2016-07-08T00:14:23.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24444" PostTypeId="4" CreationDate="2016-07-08T00:14:23.157" Score="0" Body="Emacs Lisp macros enable you to define new control constructs and other language features.  A macro is defined much like a function, but instead of telling how to compute a value, it tells how to compute another Lisp expression, which in turn is evaluated to compute the value.  We call this expression the &quot;expansion&quot; of the macro call. The macro call is first expanded and then evaluated, returning the value of that evaluation. " OwnerUserId="454" LastEditorUserId="105" LastEditDate="2016-07-08T05:52:58.833" LastActivityDate="2016-07-08T05:52:58.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24445" PostTypeId="5" CreationDate="2016-07-08T00:17:54.813" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-07-08T00:17:54.813" LastActivityDate="2016-07-08T00:17:54.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24446" PostTypeId="4" CreationDate="2016-07-08T00:17:54.813" Score="0" Body="A &quot;keyboard macro&quot; is a command defined by an Emacs user which represents a sequence of keys. Calling a keyboard macro is equivalent to typing that key sequence." OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-07-08T18:53:18.660" LastActivityDate="2016-07-08T18:53:18.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24447" PostTypeId="1" CreationDate="2016-07-08T05:15:44.993" Score="0" ViewCount="360" Body="&lt;p&gt;I have found on google these 2 config options:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-demon-add-handler 'gnus-demon-scan-mail 3 t)&#xA;(gnus-demon-add-handler 'gnus-demon-scan-news 2 t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as i know this should auto check and refresh the group view with new mails? yet this rarely work (i say rarely since occasionally it does work for some reason..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;am i doing things wrong? is there any other way to check why this isnt working?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-08-13T19:51:45.610" Title="gnus-demon wont auto reliably check emails?" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24448" PostTypeId="2" ParentId="24440" CreationDate="2016-07-08T09:56:33.280" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;display-monitor-attributes-list&lt;/code&gt;. It contains a list of displays and, for each display a list of properties. Properties of interest to you would be &lt;code&gt;frames&lt;/code&gt; which is a list of frames on that display and &lt;code&gt;geometry&lt;/code&gt; which specified the location and the size of the monitor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when you want to position a frame on a display, you will have to compensate for things like the borders, menus, window titles. etc. You can use &lt;code&gt;frame-geometry&lt;/code&gt; to determine them. (I think this is new as of Emacs 25.)&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-07-08T09:56:33.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24449" PostTypeId="1" CreationDate="2016-07-08T11:04:07.890" Score="1" ViewCount="116" Body="&lt;p&gt;I wanted to read the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/ido.html&quot; rel=&quot;nofollow&quot;&gt;Ido documentation&lt;/a&gt; offline from Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read in the &lt;code&gt;NEWS&lt;/code&gt; file of Emacs 24.5 that since the 24.4 version an &quot;&lt;em&gt;Ido user manual is now included&lt;/em&gt;&quot; (line 608). But it was not possible to find anything in the main manual about Ido.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, after searching more, I found out that the &lt;code&gt;info-display-manual&lt;/code&gt; command made possible to reach the &lt;code&gt;ido&lt;/code&gt; manual. I also found later that it was listed in the INFO tree (&lt;code&gt;M-x info-directory&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I admit that I should have known more about how to access &lt;code&gt;info-display-manual&lt;/code&gt; and the INFO tree, but why these kind of  packages (part of the vanilla Emacs) are not linked in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/emacs.html&quot; rel=&quot;nofollow&quot;&gt;main manual&lt;/a&gt; (as far as I know)?&lt;/p&gt;&#xA;" OwnerUserId="119" LastEditorUserId="119" LastEditDate="2016-07-08T13:44:50.687" LastActivityDate="2016-07-08T13:45:37.447" Title="Why some packages included with Emacs don't have their documentation in the main manual?" Tags="|ido|documentation|manual|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24450" PostTypeId="2" ParentId="24355" CreationDate="2016-07-08T11:21:53.567" Score="3" Body="&lt;p&gt;Here is the complete solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcar (car grep-regexp-alist)&#xA;        &quot;^\\(.+?\\)\\(:[ \t]*\\)\\([1-9][0-9]*\\)[ \t]*\\2&quot;)&#xA;&#xA;(defun eab/grep-align ()&#xA;  (interactive)&#xA;  (read-only-mode -1)&#xA;  (toggle-truncate-lines 1)&#xA;  (save-excursion&#xA;    (beginning-of-buffer)&#xA;    (compilation-next-error 1)&#xA;    (call-interactively 'set-mark-command)&#xA;    (end-of-buffer)&#xA;    (backward-paragraph)&#xA;    (align-regexp (region-beginning) (region-end) &quot;\\(:[0-9]+\\)\\(\\):&quot; 2 1 t))&#xA;  (read-only-mode 1))&#xA;&#xA;(defun eab/wgrep-change-to-wgrep-mode ()&#xA;  (interactive)&#xA;  (eab/grep-align)&#xA;  (call-interactively 'wgrep-change-to-wgrep-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2064" LastActivityDate="2016-07-08T11:21:53.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24451" PostTypeId="2" ParentId="24427" CreationDate="2016-07-08T13:33:26.503" Score="0" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/magit/with-editor&quot; rel=&quot;nofollow&quot;&gt;with-editor&lt;/a&gt; in order to do that but you have to be running emacs as a daemon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know a solution to do that without using emacs as a daemon, if you ever find out I really am interested as I haven't yet investigated further.&lt;/p&gt;&#xA;" OwnerUserId="11911" LastActivityDate="2016-07-08T13:33:26.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24452" PostTypeId="2" ParentId="24449" CreationDate="2016-07-08T13:45:37.447" Score="1" Body="&lt;p&gt;Good question! I see that &lt;code&gt;ido&lt;/code&gt; isn't listed in the index, nor does it appear anywhere outside the 'Acknowledgements' section of the Emacs manual. Presumably that's because the Emacs manual is already huge, and is meant to deal only with the core functions of Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of core components have their own manuals: RefTex, org-mode, CC mode etc. However, most of these are linked from the Emacs manual at appropriate locations. If you find a spot where it would make sense to link to the &lt;code&gt;ido&lt;/code&gt; manual, that may be worth submitting as a documentation bug.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-08T13:45:37.447" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24453" PostTypeId="1" AcceptedAnswerId="24572" CreationDate="2016-07-08T14:16:26.150" Score="41" ViewCount="8429" Body="&lt;p&gt;I just upgraded to the latest version of IPython and now something is wrong when using it in emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using it in a regular terminal it works fine (colors, tab-completion, etc.), however either in &lt;code&gt;M-x eshell&lt;/code&gt; or &lt;code&gt;M-x shell&lt;/code&gt;, instead of outputing &lt;code&gt;In [1]:&lt;/code&gt;, it actually outputs &lt;code&gt;[?12l[?25h&lt;/code&gt; and &lt;code&gt;Out[1]&lt;/code&gt; outputs to &lt;code&gt;[J[?7h[?12l[?25h[?2004l[?7hOut[1]:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it's some feature of the terminal not available on emacs used by IPython, but I'd like to know which one it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Terminal.app:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [1]: 2+2&#xA;Out[1]: 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[?12l[?25h2+2&#xA;[J[?7h[?12l[?25h[?2004l[?7hOut[1]: 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2020-10-14T18:18:06.963" Title="Weird shell output when using IPython 5" Tags="|shell|eshell|ipython|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24455" PostTypeId="2" ParentId="24440" CreationDate="2016-07-08T14:21:23.430" Score="1" Body="&lt;p&gt;Here's a quick function that does what I want: a new frame at the top-left of the laptop's screen.  (That is: I'm almost always on the external monitor, so the laptop screen is the &quot;other&quot; monitor.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything's hard-coded here (including the monitor name, &quot;eDP-1&quot;), but it should be easy enough to generalize.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-frame-on-laptop-screen ()&#xA;  &quot;Make a new frame on the top-left of the laptop screen.&quot;&#xA;  (interactive)&#xA;  (let ((dims (car (delete nil&#xA;                           (mapcar (lambda (monitor)&#xA;                                     (when (string-equal &quot;eDP-1&quot;&#xA;                                                         (cdr (assq 'name monitor)))&#xA;                                       (cdr (assq 'geometry monitor))))&#xA;                                   (display-monitor-attributes-list))))))&#xA;    (when dims&#xA;      (make-frame `((left . ,(nth 0 dims))&#xA;                    (top  . ,(nth 1 dims)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to @Lindydancer for pointing me to &lt;code&gt;display-monitor-attributes-list&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-08T14:21:23.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24456" PostTypeId="2" ParentId="24427" CreationDate="2016-07-08T15:27:45.550" Score="1" Body="&lt;p&gt;check out &lt;code&gt;dired-jump&lt;/code&gt;. It uses the current shell directory.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-07-08T15:27:45.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24457" PostTypeId="1" CreationDate="2016-07-08T15:31:54.567" Score="1" ViewCount="120" Body="&lt;p&gt;I'm currently trying to streamline my email/org workflow. I have a function which adds links to an org-buffer if a mail message contains DCO style signoff tags:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-dco-tag-re&#xA;  (rx (: bol (zero-or-more (in blank))                        ;; fresh line&#xA;         (any &quot;RSTA&quot;) (one-or-more (in alpha &quot;-&quot;)) &quot;-by: &quot;    ;; tag&#xA;         (one-or-more (in alpha blank &quot;&amp;lt;&amp;gt;@.&quot;))                ;; person&#xA;         eol))&#xA;  &quot;Regexp to match DCO style tag.&quot;)&#xA;&#xA;(defun my-capture-review-tags ()&#xA;  &quot;Return a list of tags for current buffer&quot;&#xA;  (let ((tags))&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward my-dco-tag-re (point-max) t)&#xA;        (add-to-list 'tags (match-string-no-properties 0))))&#xA;    tags))&#xA;&#xA;(defun my-org-maybe-capture-review-tag ()&#xA;  &quot;Check buffer for DCO tags and if found queue a review comment.&quot;&#xA;  (interactive)&#xA;  (when (my-capture-review-tags)&#xA;    (org-capture nil &quot;g&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works well enough. However I now want to programatically go through my org links and grab the tags from the messages on demand. Is there a way to visit an org-link without messing with the window configuration? I've tried the following so far to no avail:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-visit-link-and-snarf-tags ()&#xA;  &quot;Visit org-link-at-point and return a set of tags.&quot;&#xA;  (save-excursion&#xA;    (save-window-excursion&#xA;      (org-open-at-point t)&#xA;      (my-capture-review-tags))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2016-07-08T15:31:54.567" Title="Can I visit an org-link from a buffer without changing window configuration?" Tags="|org-mode|email|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24458" PostTypeId="1" CreationDate="2016-07-08T15:56:11.567" Score="3" ViewCount="806" Body="&lt;p&gt;I'm trying to configure org-export to replace LaTeX-def-macros while exporting to TeX or HTML. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current situation: the header &lt;code&gt;#+LATEX_HEADER: \def\R{\mathbb{R}}&lt;/code&gt; defines a macro that replaces &lt;code&gt;\R&lt;/code&gt; to &lt;code&gt;\mathbb{R}&lt;/code&gt; &lt;strong&gt;while compiling the TeX output.&lt;/strong&gt; (Essentially, this will add the &lt;code&gt;\def\R{\mathbb{R}}&lt;/code&gt; to the preamble of the TeX file---org-mode does not perform any macro-replacements)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, is there some way to make &lt;code&gt;org-export&lt;/code&gt; execute the macro-replacement, i.e., the exported TeX/HTML file should not contain &lt;code&gt;\R&lt;/code&gt; (instead it should be replaced by &lt;code&gt;\mathbb{R}&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Possible uses&lt;/em&gt;: LaTeX macros can be used and the exported output will be properly rendered when in HTML, markdown, etc.&lt;/p&gt;&#xA;" OwnerUserId="6924" LastActivityDate="2016-07-09T20:50:30.003" Title="Configuring org-export to replace LaTeX def macros" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24459" PostTypeId="1" AcceptedAnswerId="24461" CreationDate="2016-07-08T16:07:04.920" Score="15" ViewCount="4986" Body="&lt;p&gt;When working on a project under version control with git, I often want to do some things in a shell that affect many of my open files, then revert every buffer that I have open to make sure that I don't accidentally clobber the new version with whatever I had open. I know &lt;code&gt;magit&lt;/code&gt; can be helpful here, but I'm used to my workflow in the shell and I'd like to keep it for now. So instead, I'd like to revert all open buffers, and maybe close any that have stopped existing (e.g. because of a &lt;code&gt;git checkout&lt;/code&gt; of a branch that no longer has that file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following snippet of elisp that I grabbed from a Google search:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun revert-all-buffers ()&#xA;  &quot;Refreshes all open buffers from their respective files&quot;&#xA;  (interactive)&#xA;  (let* ((list (buffer-list))&#xA;         (buffer (car list)))&#xA;    (while buffer&#xA;      (when (and (buffer-file-name buffer) &#xA;                 (not (buffer-modified-p buffer)))&#xA;        (set-buffer buffer)&#xA;        (revert-buffer t t t))&#xA;      (setq list (cdr list))&#xA;      (setq buffer (car list))))&#xA;  (message &quot;Refreshed open files&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this breaks if it hits an error in one of my open files, i.e. when reverting &lt;code&gt;B1&lt;/code&gt;, &lt;code&gt;B2&lt;/code&gt;, &lt;code&gt;B3&lt;/code&gt;,...,&lt;code&gt;Bn&lt;/code&gt; an error while trying to revert &lt;code&gt;B2&lt;/code&gt; prevents &lt;code&gt;B3&lt;/code&gt;-&lt;code&gt;Bn&lt;/code&gt; from being reverted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell emacs to ignore any errors that pop up in this case? I don't want to use &lt;code&gt;global-auto-revert-mode&lt;/code&gt; because each revert triggers some heavy duty stuff like my auto-complete and syntax checker re-parsing the file, hanging emacs for a second or so.&lt;/p&gt;&#xA;" OwnerUserId="10368" LastEditorUserId="739" LastEditDate="2016-07-09T15:38:04.093" LastActivityDate="2022-11-01T10:20:17.043" Title="Revert all open buffers (and ignore errors)" Tags="|buffers|revert-buffer|" AnswerCount="5" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24460" PostTypeId="2" ParentId="24393" CreationDate="2016-07-08T16:21:05.470" Score="1" Body="&lt;p&gt;Your problem was way more fun than expected to look into !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function used in the solution described in your link,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(ansi-color-apply-on-region (point-min) (point-max))&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is the one to go for in my opinion as it is the function used in comint-mode itself, so I guess pretty &quot;low level&quot; and well integrated in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One idea would be to apply it only on the visible region by replacing &lt;code&gt;point-min&lt;/code&gt; and &lt;code&gt;point-max&lt;/code&gt; by &lt;code&gt;window-start&lt;/code&gt; and &lt;code&gt;window-end&lt;/code&gt; and putting it into the &lt;code&gt;window-scroll-functions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ansi-color)&#xA;&#xA;(defun my-colorize-buffer-window (win)&#xA;  (ansi-color-apply-on-region (window-start win) (window-end win t)))&#xA;&#xA;(defun my-colorize-buffer (win _start)&#xA;    (mapc #'my-colorize-buffer-window (get-buffer-window-list (window-buffer win) nil 'visible)))&#xA;&#xA;(add-hook 'window-scroll-functions 'my-colorize-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I copied the way &lt;code&gt;linum-mode&lt;/code&gt; updates line numbers)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though using that on a 323Mo log file seems to have good performance (smooth and no freeze when it works), I am still facing some issues with that solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;infinite loops that go away when resizing frame&lt;/li&gt;&#xA;&lt;li&gt;infinite loops that do not go away when resizing frame&lt;/li&gt;&#xA;&lt;li&gt;some ansi sequences do not decode right away but only on the second scroll showing them&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ansi-color-apply-on-region&lt;/code&gt; actually modifies the buffer's contents, whereas &lt;code&gt;format-decode-buffer&lt;/code&gt; with &lt;code&gt;tty-format&lt;/code&gt; doesnt. It might by worthy looking into that.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Have to go now, I might update later on !&lt;/p&gt;&#xA;" OwnerUserId="11911" LastActivityDate="2016-07-08T16:21:05.470" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24461" PostTypeId="2" ParentId="24459" CreationDate="2016-07-08T17:08:41.090" Score="13" Body="&#xA;&lt;h2&gt;Original&lt;/h2&gt;&#xA;&lt;p&gt;Here is my slightly improved version of the snippet in the question. Reviewing my VC history, I confirm that the below snippet started out as the snippet posted by the OP. So I do pay attribute to that.&lt;/p&gt;&#xA;&lt;p&gt;Here's the code that has been stable for me:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/revert-all-file-buffers ()&#xA;  &amp;quot;Refresh all open buffers from their respective files.&amp;quot;&#xA;  (interactive)&#xA;  (let* ((list (buffer-list))&#xA;         (buffer (car list)))&#xA;    (while buffer&#xA;      (let ((filename (buffer-file-name buffer)))&#xA;        ;; Revert only buffers containing files, which are not modified;&#xA;        ;; do not try to revert non-file buffers like *Messages*.&#xA;        (when (and filename&#xA;                   (not (buffer-modified-p buffer)))&#xA;          (if (file-exists-p filename)&#xA;              ;; If the file exists, revert the buffer.&#xA;              (with-current-buffer buffer&#xA;                (revert-buffer :ignore-auto :noconfirm :preserve-modes))&#xA;            ;; If the file doesn't exist, kill the buffer.&#xA;            (let (kill-buffer-query-functions) ; No query done when killing buffer&#xA;              (kill-buffer buffer)&#xA;              (message &amp;quot;Killed non-existing file buffer: %s&amp;quot; filename)))))&#xA;      (setq buffer (pop list)))&#xA;    (message &amp;quot;Finished reverting buffers containing unmodified files.&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&lt;p&gt;Here's an improved and a better documented version of above after looking at &lt;strong&gt;@Drew's&lt;/strong&gt; &lt;a href=&quot;https://emacs.stackexchange.com/a/24464/115&quot;&gt;solution&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/revert-all-file-buffers ()&#xA;  &amp;quot;Refresh all open file buffers without confirmation.&#xA;Buffers in modified (not yet saved) state in emacs will not be reverted. They&#xA;will be reverted though if they were modified outside emacs.&#xA;Buffers visiting files which do not exist any more or are no longer readable&#xA;will be killed.&amp;quot;&#xA;  (interactive)&#xA;  (dolist (buf (buffer-list))&#xA;    (let ((filename (buffer-file-name buf)))&#xA;      ;; Revert only buffers containing files, which are not modified;&#xA;      ;; do not try to revert non-file buffers like *Messages*.&#xA;      (when (and filename&#xA;                 (not (buffer-modified-p buf)))&#xA;        (if (file-readable-p filename)&#xA;            ;; If the file exists and is readable, revert the buffer.&#xA;            (with-current-buffer buf&#xA;              (revert-buffer :ignore-auto :noconfirm :preserve-modes))&#xA;          ;; Otherwise, kill the buffer.&#xA;          (let (kill-buffer-query-functions) ; No query done when killing buffer&#xA;            (kill-buffer buf)&#xA;            (message &amp;quot;Killed non-existing/unreadable file buffer: %s&amp;quot; filename))))))&#xA;  (message &amp;quot;Finished reverting buffers containing unmodified files.&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/kaushalmodi/.emacs.d/blob/d139c218d62c11994dbbe35d742f78b15ca84f90/setup-files/setup-windows-buffers.el#L210-L235&quot; rel=&quot;noreferrer&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-07-13T13:01:50.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24462" PostTypeId="2" ParentId="24459" CreationDate="2016-07-08T17:28:11.170" Score="1" Body="&lt;p&gt;I'd fix this with a &lt;code&gt;condition-case&lt;/code&gt; or &lt;code&gt;ignore-errors&lt;/code&gt; (docs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). I don't know exactly what you'll want it to &lt;em&gt;do&lt;/em&gt;; if you want to do something with errors, if you can use &lt;code&gt;condition-case&lt;/code&gt; to specify the outcome, or you can use &lt;code&gt;ignore-errors&lt;/code&gt; to just continue. Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun revert-all-buffers ()&#xA;  &quot;Refreshes all open buffers from their respective files&quot;&#xA;  (interactive)&#xA;  (let* ((list (buffer-list))&#xA;         (buffer (car list)))&#xA;    (while buffer&#xA;      (when (and (buffer-file-name buffer) &#xA;                 (not (buffer-modified-p buffer)))&#xA;        (set-buffer buffer)&#xA;        (ignore-errors (revert-buffer t t t)))&#xA;      (setq list (cdr list))&#xA;      (setq buffer (car list))))&#xA;  (message &quot;Refreshed open files&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastEditorUserId="2516" LastEditDate="2016-07-12T20:45:22.943" LastActivityDate="2016-07-12T20:45:22.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24463" PostTypeId="2" ParentId="24398" CreationDate="2016-07-08T17:32:14.283" Score="2" Body="&lt;p&gt;Under OSX, Emacs itself wont, by default, load the same environment as your user unless you either:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start emacs from the shell (in terminal or gui mode)&lt;/li&gt;&#xA;&lt;li&gt;Use the &lt;code&gt;exec-path-from-shell&lt;/code&gt; package, &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Manually assemble Emacs' path from your users' PATH in your init.el (not recommended)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-07-08T17:32:14.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24464" PostTypeId="2" ParentId="24459" CreationDate="2016-07-08T17:34:30.710" Score="6" Body="&lt;p&gt;Another:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun revert-all-no-confirm ()&#xA;  &quot;Revert all file buffers, without confirmation.&#xA;Buffers visiting files that no longer exist are ignored.&#xA;Files that are not readable (including do not exist) are ignored.&#xA;Other errors while reverting a buffer are reported only as messages.&quot;&#xA;  (interactive)&#xA;  (let (file)&#xA;    (dolist (buf  (buffer-list))&#xA;      (setq file  (buffer-file-name buf))&#xA;      (when (and file  (file-readable-p file))&#xA;        (with-current-buffer buf&#xA;          (with-demoted-errors &quot;Error: %S&quot; (revert-buffer t t)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-08T17:34:30.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24465" PostTypeId="2" ParentId="24441" CreationDate="2016-07-08T18:09:54.560" Score="2" Body="&lt;p&gt;Well my solution was simple :_&#xA;Based on comments I realized that org module is not supported in XEmacs hence I uninstalled XEmacs and installed GNU Emacs. After that I did not have any issues.&#xA;Thanks for help.&lt;/p&gt;&#xA;" OwnerUserId="12586" LastActivityDate="2016-07-08T18:09:54.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24466" PostTypeId="2" ParentId="24459" CreationDate="2016-07-08T19:08:18.870" Score="2" Body="&lt;p&gt;I accepted Kausal's answer since it was closest to what I wanted, but I grabbed part of Drew's solution, too. I wrapped &lt;code&gt;revert-buffer&lt;/code&gt; in &lt;code&gt;with-demoted-errors&lt;/code&gt; and dropped the &lt;code&gt;:preserve-modes&lt;/code&gt; parameter so that my syntax checker would re-parse all of my open files. I also let it kill modified files as well as unmodified, since I often get in trouble by accidentally &lt;code&gt;C-x s&lt;/code&gt;-ing after a &lt;code&gt;git checkout&lt;/code&gt; with a modified file open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final version is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun revert-all-buffers ()&#xA;  &quot;Refresh all open buffers from their respective files.&quot;&#xA;  (interactive)&#xA;  (let* ((list (buffer-list))&#xA;         (buffer (car list)))&#xA;    (while buffer&#xA;      (let ((filename (buffer-file-name buffer)))&#xA;        ;; Revert only buffers containing files, which are not modified;&#xA;        ;; do not try to revert non-file buffers like *Messages*.&#xA;        (when filename&#xA;          (if (file-exists-p filename)&#xA;              ;; If the file exists, revert the buffer.&#xA;              (with-demoted-errors &quot;Error: %S&quot;&#xA;                (with-current-buffer buffer&#xA;                  (revert-buffer :ignore-auto :noconfirm)))&#xA;            ;; If the file doesn't exist, kill the buffer.&#xA;            (let (kill-buffer-query-functions) ; No query done when killing buffer&#xA;              (kill-buffer buffer)&#xA;              (message &quot;Killed non-existing file buffer: %s&quot; buffer))))&#xA;        (setq buffer (pop list)))))&#xA;  (message &quot;Finished reverting non-file buffers.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10368" LastEditorUserId="105" LastEditDate="2016-07-08T22:49:31.800" LastActivityDate="2016-07-08T22:49:31.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24469" PostTypeId="1" CreationDate="2016-07-08T19:46:07.280" Score="6" ViewCount="4911" Body="&lt;p&gt;In &lt;a href=&quot;http://tuhdo.github.io/c-ide.html#orgheadline2&quot; rel=&quot;noreferrer&quot;&gt;http://tuhdo.github.io/c-ide.html#orgheadline2&lt;/a&gt; which is about &quot;Prerequisite&quot;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Or, helm + helm-gtags.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What does &quot;Or&quot; imply as the alternative to the combination &quot;helm + helm+gtags&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the alternative &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Global&lt;/li&gt;&#xA;&lt;li&gt;GNU Global + ggtags&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What are the relations between GNU Global and helm?&#xA;Are GNU Global and helm  alternatives to each other? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ggtags is a frontend of GNU Global, and is helm-gtags a frontend of helm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I install according to the link?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it okay to install both combinations GNU Global + ggtags and helm + helm+gtags, and to use them both in the future?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2016-07-08T19:51:42.557" LastActivityDate="2016-12-21T15:54:46.517" Title="GNU Global + ggtags and helm + helm+gtags" Tags="|helm|development|gtags|global-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24470" PostTypeId="1" AcceptedAnswerId="24471" CreationDate="2016-07-08T20:02:40.087" Score="9" ViewCount="1673" Body="&lt;p&gt;When I use yasnippet, I keep getting this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (yasnippet): `foo-snippet' modified buffer in a backquote expression.&#xA;To hide this warning, add (yasnippet backquote-change) to `warning-suppress-types'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I added this line to my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq warning-suppress-types (quote ((\(yasnippet\ backquote-change\))))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't seem to have worked.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2018-12-29T11:27:23.413" Title="Warning (yasnippet): modified buffer in a backquote expression" Tags="|yasnippet|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24471" PostTypeId="2" ParentId="24470" CreationDate="2016-07-08T20:35:43.037" Score="14" Body="&lt;p&gt;&lt;code&gt;warning-suppress-types&lt;/code&gt; is a list defined in the &lt;code&gt;warnings&lt;/code&gt; package.  You first need to load this package with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'warnings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and after this, add the warning using &lt;code&gt;add-to-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'warning-suppress-types '(yasnippet backquote-change))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10319" LastEditorUserId="8541" LastEditDate="2018-12-29T11:27:23.413" LastActivityDate="2018-12-29T11:27:23.413" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="24472" PostTypeId="1" AcceptedAnswerId="24477" CreationDate="2016-07-08T20:53:22.067" Score="11" ViewCount="2927" Body="&lt;p&gt;&lt;code&gt;M-x eww&lt;/code&gt; prompts for url or keywords and opens a new &lt;code&gt;*eww*&lt;/code&gt; buffer.  In &lt;code&gt;eww-mode&lt;/code&gt;, &lt;code&gt;G&lt;/code&gt; is bound to &lt;code&gt;eww&lt;/code&gt;, which replaces the content of the single eww buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make multiple buffers for different webpages, I've resorted to creating a new buffer, setting &lt;code&gt;eww-mode&lt;/code&gt; manually, then pressing &lt;code&gt;G&lt;/code&gt; (or &lt;code&gt;M-x eww&lt;/code&gt;) to visit a URL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can easily write a function that does all this for me, but I'm surprised this functionality isn't just built-in.  Am I just missing it?&lt;/p&gt;&#xA;" OwnerUserId="618" LastActivityDate="2019-03-22T12:17:57.087" Title="Simple method for creating multiple eww buffers" Tags="|buffers|eww|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24473" PostTypeId="2" ParentId="24470" CreationDate="2016-07-08T21:02:55.043" Score="2" Body="&lt;p&gt;Alternate answer is to fix &lt;code&gt;foo-snippet&lt;/code&gt; so that it no longer modifies the buffer in backquote expression.  See &lt;a href=&quot;https://emacs.stackexchange.com/a/24062/5296&quot;&gt;https://emacs.stackexchange.com/a/24062/5296&lt;/a&gt; for some examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that there was a bug causing yasnippet to issue this warning even when &lt;em&gt;other&lt;/em&gt; buffers were being modified, so make sure you have the latest yasnippet (or else the current stable release (0.10) which doesn't have this warning at all).  See &lt;a href=&quot;https://github.com/joaotavora/yasnippet/issues/716&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/joaotavora/yasnippet/issues/716&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-08T21:02:55.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24474" PostTypeId="2" ParentId="24469" CreationDate="2016-07-08T21:11:34.093" Score="6" Body="&lt;p&gt;Hope this clears up the confusion ..&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Non-emacs software&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/global/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Global (&lt;code&gt;gtags&lt;/code&gt; + &lt;code&gt;global&lt;/code&gt; executables)&lt;/a&gt; - A software for generating tags, like &lt;a href=&quot;https://ctags.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Universal &lt;code&gt;ctags&lt;/code&gt;&lt;/a&gt;. &lt;em&gt;I actually use &lt;a href=&quot;https://www.gnu.org/software/global/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;gtags&lt;/code&gt;&lt;/a&gt; for binary database generation but have configured it to use &lt;a href=&quot;https://ctags.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ctags&lt;/code&gt;&lt;/a&gt; as backend because &lt;a href=&quot;https://ctags.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ctags&lt;/code&gt;&lt;/a&gt; supports tag parsing for many more languages.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;It is mandatory to install GNU Global if you want to use either of the below 2 packages.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Emacs packages&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/leoliu/ggtags&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ggtags&lt;/code&gt;&lt;/a&gt; - A front-end for accessing the &lt;code&gt;gtags&lt;/code&gt;-generated tags.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/syohex/emacs-helm-gtags&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-gtags&lt;/code&gt;&lt;/a&gt; - &lt;strong&gt;Another&lt;/strong&gt; front-end for accessing the &lt;code&gt;gtags&lt;/code&gt;-generated tags, but this one uses an alternative list-completion mechanism called &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm&lt;/code&gt;&lt;/a&gt;. So you will need to install &lt;code&gt;helm&lt;/code&gt; for &lt;code&gt;helm-gtags&lt;/code&gt; to work (or it will be auto-installed if you use the Emacs &lt;code&gt;package.el&lt;/code&gt; to install packages). &lt;em&gt;If you haven't used &lt;code&gt;helm&lt;/code&gt;, then it's safe to say that &lt;code&gt;ggtags&lt;/code&gt; will work just fine for you.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Installation combinations&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;GNU Global + &lt;code&gt;ggtags&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;GNU Global + &lt;code&gt;helm&lt;/code&gt; + &lt;code&gt;helm-gtags&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;As &lt;code&gt;ggtags&lt;/code&gt; and &lt;code&gt;helm-gtags&lt;/code&gt; are independent, you can even have both of the above combinations installed and see what setup works the best for you.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="115" LastEditorUserId="14319" LastEditDate="2016-12-21T15:54:46.517" LastActivityDate="2016-12-21T15:54:46.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24475" PostTypeId="1" CreationDate="2016-07-08T21:18:47.483" Score="5" ViewCount="5591" Body="&lt;p&gt;I want to install &lt;a href=&quot;https://github.com/syohex/emacs-helm-gtags&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/syohex/emacs-helm-gtags&lt;/a&gt;, and here is the installation instruction:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;helm-gtags is available on MELPA and MELPA stable&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can install helm-gtags with the following command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install [RET] helm-gtags [RET]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But after &lt;code&gt;M-x package-install [RET] helm-gtags [RET]&lt;/code&gt;, I got &quot;no match&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How shall I solve this problem? Thanks.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Running &lt;code&gt;M-x package-refresh-contents [RET]&lt;/code&gt; will stay at &quot;Contacting host: elpa.gnu.org:80&quot; forever, so doesn't seem to solve the problem. Why doesn't finish running? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Even without waiting for &quot;Contacting host: elpa.gnu.org:80&quot;  to go away, running &lt;code&gt;package-install&lt;/code&gt; on &lt;code&gt;helm-gtags&lt;/code&gt; still results in &quot;no match&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Do I need to add the repository of &lt;code&gt;helm-gtags&lt;/code&gt; somewhere, and what is its repository?&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2016-07-09T01:12:59.493" LastActivityDate="2019-01-17T19:21:14.667" Title="&quot;no match&quot; error after `M-x package-install` on a package" Tags="|package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24476" PostTypeId="2" ParentId="24475" CreationDate="2016-07-08T21:23:50.540" Score="3" Body="&lt;p&gt;&lt;code&gt;M-x package-refresh-contents [RET] M-x package-install [RET] helm-gtags [RET]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x package-list-packages [RET] C-s helm-gtags [RET] i x&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="3902" LastActivityDate="2016-07-08T21:23:50.540" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24477" PostTypeId="2" ParentId="24472" CreationDate="2016-07-08T21:29:24.747" Score="7" Body="&#xA;&#xA;&lt;p&gt;You are correct that &lt;code&gt;eww&lt;/code&gt; does not automatically create new buffers for you. But I have been using this trick from &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_eww_web_browser.html&quot; rel=&quot;noreferrer&quot;&gt;ergoemacs.org&lt;/a&gt; and it works great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the below eval'ed, each time you do &lt;code&gt;M-x eww&lt;/code&gt; from a &lt;strong&gt;non-eww&lt;/strong&gt; buffer, a unique eww buffer will be created.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Auto-rename new eww buffers&#xA;(defun xah-rename-eww-hook ()&#xA;  &quot;Rename eww browser's buffer so sites open in new page.&quot;&#xA;  (rename-buffer &quot;eww&quot; t))&#xA;(add-hook 'eww-mode-hook #'xah-rename-eww-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you'd like to spawn a new eww buffer while being in an eww buffer, eval the below advice (you will still need to eval the above so that new &lt;code&gt;eww&lt;/code&gt; buffers are assigned unique names).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; C-u M-x eww will force a new eww buffer&#xA;(defun modi/force-new-eww-buffer (orig-fun &amp;amp;rest args)&#xA;  &quot;When prefix argument is used, a new eww buffer will be created,&#xA;regardless of whether the current buffer is in `eww-mode'.&quot;&#xA;  (if current-prefix-arg&#xA;      (with-temp-buffer&#xA;        (apply orig-fun args))&#xA;    (apply orig-fun args)))  &#xA;(advice-add 'eww :around #'modi/force-new-eww-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-07-08T22:17:14.763" LastActivityDate="2016-07-08T22:17:14.763" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24478" PostTypeId="2" ParentId="24427" CreationDate="2016-07-08T21:31:22.430" Score="0" Body="&lt;p&gt;I'm not sure if this is exactly what you're asking, but I have an eshell alias to open up files the same way I would in a terminal&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias emacs find-file $1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then from eshell, if I want to open up a file I just need to type &lt;code&gt;emacs $FILENAME&lt;/code&gt; and it will open the file in a new buffer.&lt;/p&gt;&#xA;" OwnerUserId="3902" LastActivityDate="2016-07-08T21:31:22.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24479" PostTypeId="2" ParentId="24472" CreationDate="2016-07-08T22:30:49.650" Score="3" Body="&#xA;&#xA;&lt;p&gt;It seems &lt;code&gt;eww&lt;/code&gt; is designed to avoid this behavior.  This function, &lt;code&gt;eww-new&lt;/code&gt;, can be called when a new eww buffer is desired:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eww-new ()&#xA;  (interactive)&#xA;  (let ((url (read-from-minibuffer &quot;Enter URL or keywords: &quot;)))&#xA;    (switch-to-buffer (generate-new-buffer &quot;eww&quot;))&#xA;    (eww-mode)&#xA;    (eww url)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="618" LastActivityDate="2016-07-08T22:30:49.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24480" PostTypeId="2" ParentId="2191" CreationDate="2016-07-09T00:37:10.157" Score="2" Body="&lt;p&gt;I liked what @Gilles wrote. I modifed what @Gilles wrote to ask the user what mode they would like to use. You can edit what I wrote to provide whatever modes you prefer or even alter the call to completing read so that it will allow you to provide a mode not provided in the default list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun edit-region-in-mode (beg end)&#xA;  &quot;Create an indirect buffer cloned from the current buffer and&#xA;  narrowed to the highlighted region. The cloned indirect buffer&#xA;  will have org-mode active. Changes to the indirect buffer will&#xA;  be updated in real time in the originating buffer. This is&#xA;  useful, for instance, when you are in a non-org-mode mode and&#xA;  want to edit table data or in a non-emacs-lisp mode and want to&#xA;  write some elisp utilizing code formatting and highlighting.&quot;&#xA;  (interactive &quot;@r&quot;)&#xA;  (let ((new-buffer (clone-indirect-buffer nil t)))&#xA;    (narrow-to-region beg end)&#xA;    (funcall&#xA;     (intern&#xA;      (completing-read&#xA;       &quot;Choose the mode you want to use when editing the highlighted region: &quot;&#xA;       '(org-mode emacs-lisp-mode lisp-mode haskell-mode julia-mode&#xA;          python-mode mathematica-mode matlab-mode c++-mode))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8353" LastActivityDate="2016-07-09T00:37:10.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24481" PostTypeId="1" CreationDate="2016-07-09T01:05:16.740" Score="2" ViewCount="63" Body="&lt;p&gt;I am using Org mode to write some tutorials for myself on a topic where I weave the explanation and code samples into the same document. This document will then be exported to HTML to distribute to some colleagues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I am able to export my org file to HTML and get syntax highlighting for code snippets. However, I don't like the default syntax highlighting provided in the exported HTML file. The background is white, the string color is a pale pink which tends to be indistinguishable from the white background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Wdzci.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Wdzci.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change this color scheme? I would like to have a scheme similar to the one used on, say, &lt;a href=&quot;http://learnyouahaskell.com/starting-out#babys-first-functions&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; page. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I want the syntax highlighting customized in the exported HTML and not inside an Emacs buffer itself which I am perfectly happy with,. &lt;/p&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2016-07-09T01:05:16.740" Title="Change the syntax highlighting when exporting to HTML" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ClosedDate="2016-07-10T20:38:34.470" ContentLicense="CC BY-SA 3.0" />
  <row Id="24482" PostTypeId="1" CreationDate="2016-07-09T01:15:23.047" Score="4" ViewCount="343" Body="&lt;p&gt;I often find that, using an agenda in block-mode, that my tasks (which are smaller bits of work) are mixed in with my projects (which are larger chunks.) I've wondered if there was a way for a block agenda to list my TODO projects in one block and my tasks (subprojects) in another block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using the :PROJECT: tag. The problem is that when I do a regexp for everything that &lt;em&gt;doesn't&lt;/em&gt; have a :PROJECT: tag I get things that I also don't want (like deadlines that shouldn't yet show up in the agenda, for example.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One could define a PROJ state but that seems inelegant -- because it's not exactly a state, but a label. A &quot;project&quot; tag (or property) seems more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm open to any ideas and I hope this helps other people who may have had the same question.&lt;/p&gt;&#xA;" OwnerUserId="12598" LastActivityDate="2016-07-09T01:15:23.047" Title="What's a good workflow for separating projects from subprojects in org-mode?" Tags="|org-mode|" AnswerCount="0" CommentCount="3" ClosedDate="2016-07-09T13:45:55.373" ContentLicense="CC BY-SA 3.0" />
  <row Id="24484" PostTypeId="1" AcceptedAnswerId="24663" CreationDate="2016-07-09T04:52:26.930" Score="1" ViewCount="74" Body="&lt;p&gt;I just saw this line near the top of the file &lt;code&gt;use-package.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(declare-function package-installed-p 'package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can &lt;code&gt;'package&lt;/code&gt; be a useful 2nd argument, when the doc for &lt;code&gt;declare-function&lt;/code&gt; says that the third argument should be a filename?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-07-18T16:51:00.307" Title="Using 'package as a filename in a declare-function statement?" Tags="|package|declare|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24486" PostTypeId="2" ParentId="24475" CreationDate="2016-07-09T09:26:44.267" Score="9" Body="&lt;p&gt;&lt;code&gt;helm-gtags&lt;/code&gt; is not available in &lt;a href=&quot;http://elpa.gnu.org/packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;elpa&lt;/a&gt; repository. You should add &lt;code&gt;melpa&lt;/code&gt; repository to your packages archives to install &lt;code&gt;helm-gtags&lt;/code&gt;. Add the following code in your emacs init file,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives '((&quot;gnu&quot; . &quot;https://elpa.gnu.org/packages/&quot;)&#xA;                     (&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then press &lt;code&gt;C-x C-s&lt;/code&gt; to save and &lt;code&gt;M-x eval-buffer&lt;/code&gt; for the changes to apply. Then try to refresh packages and search for &lt;code&gt;helm-gtags&lt;/code&gt; package. More information about emacs packages repository can be found in &lt;a href=&quot;https://www.emacswiki.org/emacs/ELPA&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Wiki&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9573" LastEditorUserId="21372" LastEditDate="2019-01-17T19:21:14.667" LastActivityDate="2019-01-17T19:21:14.667" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="24487" PostTypeId="1" AcceptedAnswerId="24490" CreationDate="2016-07-09T13:12:06.080" Score="0" ViewCount="278" Body="&lt;p&gt;I was thinking about this question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/24458/configuring-org-export-to-replace-latex-def-macros&quot;&gt;Configuring org-export to replace LaTeX def macros&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like you should be able to convert latex macros in org export using an export filter. e.g., in the linked question, convert &lt;code&gt;\R&lt;/code&gt; to &lt;code&gt;\mathbb{R}&lt;/code&gt;. However, I can't figure out the syntax. I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox)&#xA;(defun my-latex-filter-r-macro (text backend info)&#xA;  &quot;Replace \\R with \\mathbb{R}&quot;&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (replace-regexp-in-string &quot;\\\\R&quot; &quot;\\\\mathbb{R}&quot; text)))&#xA;&#xA;(add-to-list 'org-export-filter-plain-text-functions&#xA;             'my-latex-filter-r-macro)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then exported the following org file to html:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* This is a headline&#xA;  Here I refer to \R in normal text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the \R is not altered in export. I've tried different numbers of backslashes, with no success - 0, 1, 2 or 3 backslashes, and every &lt;code&gt;r&lt;/code&gt; except for the escaped &lt;code&gt;\R&lt;/code&gt; is converted to &lt;code&gt;\mathbb{r}&lt;/code&gt;. With 4 or more backslashes, none of the &lt;code&gt;r&lt;/code&gt; characters gets converted. So it looks like escaped characters are protected from export filters - is this so? Is ther anyway to pre-process escaped characters in org export?&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-08-24T07:27:03.673" Title="org export filter on escaped characters" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24488" PostTypeId="1" CreationDate="2016-07-09T14:12:12.903" Score="5" ViewCount="603" Body="&lt;p&gt;I am trying to line up a text table using align-regexp. A table, before alignment, looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Alpha | Bravo | Charlie |&#xA;|-------|-------|---------|&#xA;| Delta | Echo | Foxtrot |&#xA;| Golf | Hotel | India |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and after alignment should look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Alpha | Bravo | Charlie |&#xA;|-------|-------|---------|&#xA;| Delta | Echo  | Foxtrot |&#xA;| Golf  | Hotel | India   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The best result I've gotten is &lt;code&gt;C-u M-x align-regexp&lt;/code&gt;, then &lt;code&gt;\(\s-*\)|&lt;/code&gt; as regexp, then repeat throughout line. What I get is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                        | Alpha  | Bravo  | Charlie  |&#xA;                        |------- |------- |--------- |&#xA;                        | Delta  | Echo   | Foxtrot  |&#xA;                        | Golf   | Hotel  | India    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The pipes line up, but now it's indented some random number of spaces that seems to be dependent on the content of the table. The problem with this is that markdown, the format of the document, now treats it as code because its indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My quick, but tedious, fix is to un-indent it, but I'd like to find out the right incantation for &lt;code&gt;align-regexp&lt;/code&gt; to make this indentation work properly.&lt;/p&gt;&#xA;" OwnerUserId="12440" LastActivityDate="2016-07-09T21:13:01.153" Title="How to get align-regexp to help line up Markdown tables properly?" Tags="|align|markdown-mode|markdown|table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24490" PostTypeId="2" ParentId="24487" CreationDate="2016-07-09T16:03:56.443" Score="1" Body="&lt;p&gt;&#xA;The filter &lt;code&gt;org-export-filter-plain-text-functions&lt;/code&gt; never sees &lt;code&gt;\R&lt;/code&gt;, try to filter &lt;code&gt;org-export-filter-latex-fragment-functions&lt;/code&gt;.&#xA;For example, this works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ox)&#xA;(defun my-latex-filter-r-macro (text backend info)&#xA;  &quot;Replace \\R with \\mathbb{R}&quot;&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (replace-regexp-in-string &quot;\\\\R&quot; &quot;\\\\mathbb{R}&quot; text)))&#xA;&#xA;(add-to-list 'org-export-filter-latex-fragment-functions&#xA;             'my-latex-filter-r-macro)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-24T07:27:03.673" LastActivityDate="2016-08-24T07:27:03.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24492" PostTypeId="1" CreationDate="2016-07-09T17:51:43.117" Score="3" ViewCount="340" Body="&lt;p&gt;I have a bash shell script that has a fairly sizable amount of perl code in it. Is there a why to get perl syntax highlighting instead of the normal here doc coloring? Thank you for any help, I'm new to emacs and still getting the hang of elisp and the terminology &lt;/p&gt;&#xA;" OwnerUserId="12436" LastEditorUserId="25" LastEditDate="2016-09-07T21:22:38.663" LastActivityDate="2016-09-07T21:22:38.663" Title="Syntax highlight embedded script" Tags="|syntax-highlighting|multiple-modes|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24493" PostTypeId="1" CreationDate="2016-07-09T17:51:45.453" Score="2" ViewCount="222" Body="&lt;p&gt;I have 3 windows opened and I want to change which buffers they display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: when programming in C, I want to have the C code on the left, and the right side split into two windows showing gdb and the locals variables.  If I open them in order, Emacs puts the buffers in a layout I'm not comfortable with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I arrange which buffers are in which windows?  Can I do it without using non-built-in packages?&lt;/p&gt;&#xA;" OwnerUserId="12603" LastEditorUserId="253" LastEditDate="2016-07-10T14:31:57.793" LastActivityDate="2016-07-10T14:31:57.793" Title="Change which buffers are in which windows?" Tags="|buffers|window|display|window-splitting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24494" PostTypeId="2" ParentId="24488" CreationDate="2016-07-09T17:53:58.043" Score="5" Body="&lt;p&gt;I wouldn't use &lt;code&gt;align-regexp&lt;/code&gt; but the wonderful &lt;code&gt;orgtbl-mode&lt;/code&gt; for this: if you enable this minor mode, it will automatically recognize the table, and change its size as needed (use &lt;code&gt;tab&lt;/code&gt; to move around in the table). &lt;/p&gt;&#xA;" OwnerUserId="2237" LastEditorUserId="2237" LastEditDate="2016-07-09T21:13:01.153" LastActivityDate="2016-07-09T21:13:01.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24495" PostTypeId="2" ParentId="21570" CreationDate="2016-07-09T18:11:01.713" Score="1" Body="&lt;p&gt;On August 2 of 2016, the Windows 10 Anniversary update will be released. It includes an Ubuntu-based bash subsystem. Maybe updating to that new bash shell and running apt-get install emacs will resolve the issues you're having.&lt;/p&gt;&#xA;" OwnerUserId="3930" LastActivityDate="2016-07-09T18:11:01.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24496" PostTypeId="1" CreationDate="2016-07-09T18:19:13.223" Score="3" ViewCount="777" Body="&lt;p&gt;I'm starting to think that using the regular &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-v&lt;/kbd&gt; keys for kill-ring operations make sense, as they're used that way in every other program I use regularly. (And I'm starting to develop conflicting muscle memories.) However, I use &lt;code&gt;evil-mode&lt;/code&gt;. Is there a way to integrate &lt;code&gt;cua-mode&lt;/code&gt; (with keys) and &lt;code&gt;evil-insert-state&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="2642" LastEditDate="2016-07-21T03:03:12.543" LastActivityDate="2018-05-02T03:17:13.590" Title="Integrate cua-mode with evil-insert-state" Tags="|key-bindings|evil|cua-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24497" PostTypeId="2" ParentId="24492" CreationDate="2016-07-09T19:06:26.507" Score="-2" Body="&lt;p&gt;You can just M-x &lt;code&gt;perl-mode&lt;/code&gt; to activate perl mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, set a easy key to perl-mode. For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f8&amp;gt;&quot;) 'perl-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, you can put add this comment to the first line in the bash file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: perl -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then, it'll open with perl mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, you can put the following at the bottom&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# eval: (perl-mode 1)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does that answer your question?&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-07-09T19:12:03.283" LastActivityDate="2016-07-09T19:12:03.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24498" PostTypeId="2" ParentId="24458" CreationDate="2016-07-09T20:50:30.003" Score="1" Body="&lt;p&gt;I don't think org-export will actually do the macro expansions for you (i.e., it won't parse the macros and make the replacements), but you can add filters for each macro that you want replaced. The following code will add a filter that does the conversion you want when exporting from org to html:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ox)&#xA;(defun my-latex-filter-r-macro (text backend info)&#xA;  &quot;Replace \\R with \\mathbb{R}&quot;&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (replace-regexp-in-string &quot;\\\\R&quot; &quot;\\\\mathbb{R}&quot; text)))&#xA;&#xA;(add-to-list 'org-export-filter-latex-fragment-functions&#xA;             'my-latex-filter-r-macro)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want the filter to act on &lt;strong&gt;all&lt;/strong&gt; exports, remove the &lt;code&gt;(when...)&lt;/code&gt; form, and just use the &lt;code&gt;(replace-regexp-in-string ...)&lt;/code&gt; form on its own:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-latex-filter-r-macro (text backend info)&#xA;  &quot;Replace \\R with \\mathbb{R}&quot;&#xA;  (replace-regexp-in-string &quot;\\\\R&quot; &quot;\\\\mathbb{R}&quot; text))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more details, see the &lt;a href=&quot;http://orgmode.org/manual/Advanced-configuration.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;orgmode manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Thanks to @Theldoria for pointing out that this needs to be added to the &lt;a href=&quot;https://emacs.stackexchange.com/questions/24487/org-export-filter-on-escaped-characters?noredirect=1&amp;amp;lq=1&quot;&gt;&lt;code&gt;org-export-filter-latex-fragment-functions&lt;/code&gt; list&lt;/a&gt;!) &lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-09T20:50:30.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24499" PostTypeId="2" ParentId="24493" CreationDate="2016-07-09T20:57:33.460" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;nofollow&quot;&gt;ace-window&lt;/a&gt; package provides a function &lt;code&gt;ace-swap-window&lt;/code&gt; that provides a nice interface for this. When you call the command each window gets a letter label. Type that letter and it will swap the buffers in the current window and the selected window. Variations allow you to select or delete different windows as well.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-09T20:57:33.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24500" PostTypeId="2" ParentId="2624" CreationDate="2016-07-09T21:11:00.227" Score="1" Body="&lt;p&gt;Came across this while Googling for a solution to this problem. What I found to work is part of the &lt;a href=&quot;http://spacemacs.org/doc/FAQ#orgheadline31&quot; rel=&quot;nofollow noreferrer&quot;&gt;Spacemacs FAQ&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'evil-visual-update-x-selection 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;https://emacs.stackexchange.com/a/15054/84&quot;&gt;https://emacs.stackexchange.com/a/15054/84&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="84" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-09T21:16:35.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24501" PostTypeId="2" ParentId="9344" CreationDate="2016-07-09T21:15:36.487" Score="3" Body="&lt;p&gt;Came across this while Googling for a solution to this problem. What I found to work is part of the &lt;a href=&quot;http://spacemacs.org/doc/FAQ#prevent-the-visual-selection-overriding-my-system-clipboard&quot; rel=&quot;nofollow noreferrer&quot;&gt;Spacemacs FAQ&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'evil-visual-update-x-selection 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;https://emacs.stackexchange.com/a/15054/84&quot;&gt;https://emacs.stackexchange.com/a/15054/84&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="84" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-13T16:02:59.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24502" PostTypeId="2" ParentId="19686" CreationDate="2016-07-09T22:14:24.693" Score="46" Body="&lt;p&gt;Switching from &lt;code&gt;docview&lt;/code&gt; to &lt;code&gt;pdf-tools&lt;/code&gt; happens 'automatically' when you install &lt;code&gt;pdf-tools&lt;/code&gt;. Once you've done this, any time Emacs tries to open a pdf &lt;em&gt;in Emacs&lt;/em&gt;, it will use &lt;code&gt;pdf-tools&lt;/code&gt;. However, some packages will call out to the operating system, or use different config within Emacs, to decide if they should use Emacs or another program to open a pdf. So there is some 'tool-by-tool' configuration required to get all Emacs packages to use pdf-tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want your pdfs opened in the same instance of Emacs, you need to have it running in daemon mode (i.e., start it with &lt;code&gt;emacs --daemon&lt;/code&gt;), or call &lt;code&gt;(server-start)&lt;/code&gt; in your init so that &lt;code&gt;emacsclient&lt;/code&gt; will work.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Org-mode links&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Out of the box, &lt;code&gt;org-mode&lt;/code&gt; doesn't know about pdf-tools. However, you can add support for opening org links to pdf files with &lt;a href=&quot;https://github.com/markus1189/org-pdfview&quot; rel=&quot;noreferrer&quot;&gt;org-pdfview&lt;/a&gt;, which is available as a package on MELPA. Once it's installed, you can activate it with the following code in your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'org '(require 'org-pdfview))&#xA;&#xA;(add-to-list 'org-file-apps &#xA;             '(&quot;\\.pdf\\'&quot; . (lambda (file link)&#xA;                                     (org-pdfview-open link))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing this will provide a new completion target for adding links via &lt;code&gt;C-c C-l&lt;/code&gt;, &lt;code&gt;pdfview:&lt;/code&gt;, with support for jumping to specific pages. Full links use the format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[pdfview:/path/to/myfile.pdf::42][My file Description]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Interleave Mode &amp;amp; PDF annotations&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/rudolfochrist/interleave&quot; rel=&quot;noreferrer&quot;&gt;Interleave mode&lt;/a&gt; provides support for presenting &quot;your PDF side by side with an Org Mode buffer with your notes.&quot; This is an alternative to using the annotations embedded in a pdf (which you can do with pdf-tools). Instead, you end up with an org-mode file with all your annotations, which links to the page in the pdf that the annotations are associated with.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Gnus&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As I mentioned in my comment, &lt;code&gt;gnus&lt;/code&gt; uses &lt;a href=&quot;https://en.wikipedia.org/wiki/Media_type#Mailcap&quot; rel=&quot;noreferrer&quot;&gt;mailcap&lt;/a&gt; to open attachments. To configure this, you need the following in your &lt;code&gt;.mailcap&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;application/pdf; emacsclient %s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;EWW&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;EWW also uses mailcap, so modify your &lt;code&gt;.mailcap&lt;/code&gt; file as per Gnus above.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;AucTeX&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;For AucTeX, there are a number of relevant options: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;viewers are specified via the variable &lt;code&gt;TeX-view-program-selection&lt;/code&gt;: find the entry for &lt;code&gt;output-pdf&lt;/code&gt; and select &quot;PDF Tools&quot; for the value.&lt;/li&gt;&#xA;&lt;li&gt;to use SyncTex, you need to:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;set &lt;code&gt;TeX-source-correlate-mode&lt;/code&gt;, either interactively by calling that function via M-x, or by setting the variable permanently via &lt;code&gt;M-x customize-variable&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;make sure &lt;code&gt;TeX-source-correlate-method&lt;/code&gt; includes &lt;code&gt;(pdf . synctex)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With this in place, from your tex source file &lt;code&gt;C-c C-g&lt;/code&gt; should display the corresponding section of the pdf.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;ESS&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Customize the variable &lt;code&gt;ess-pdf-viewer-pref&lt;/code&gt; to &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;xdg-open&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;On Linux, some packages will call the external program &lt;code&gt;xdg-open&lt;/code&gt; to open pdf files. This will use your system-wide settings to determine which program to use. This is a system-wide change, so other programs will send pdf documents to Emacs when you've set this up. So if you don't want, e.g., Firefox, to do this, you won't want to make these changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To set emacsclient to open pdfs system-wide via &lt;code&gt;xdg-open&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;create a file in &lt;code&gt;~/.local/share/applications/emacsclient.desktop&lt;/code&gt; with the contents:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[Desktop Entry]&lt;br&gt;&#xA;  Name=Emacs Client&lt;br&gt;&#xA;  Exec=emacsclient %u&lt;br&gt;&#xA;  Icon=emacs-icon&lt;br&gt;&#xA;  Type=Application&lt;br&gt;&#xA;  Terminal=false&lt;br&gt;&#xA;  MimeType=application/pdf;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;from the command line, issue:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;xdg-mime default emacsclient.desktop application/pdf&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can test that this worked with &lt;code&gt;xdg-open your-document.pdf&lt;/code&gt; - it should open &lt;code&gt;your-document.pdf&lt;/code&gt; in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;w3m&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;w3m first checks the variable &lt;code&gt;w3m-doc-view-content-types&lt;/code&gt;, and if it sees &quot;application/pdf&quot; there, it will open pdfs in doc-view. This is a customizable variable, so remove the &quot;application/pdf&quot; entry using the customization interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without an entry in &lt;code&gt;w3m-doc-view-content-types&lt;/code&gt;, w3m next checks the variable &lt;code&gt;w3m-content-type-alist&lt;/code&gt; for entries that match &quot;application/pdf&quot;. Customize the entry to read &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[INS] [DEL] Type: application/pdf&#xA;  Regexp: ( ) Not specified&#xA;          (*) String: \.pdf\'&#xA;  Viewer: ( ) Not specified&#xA;          (*) External viewer:&#xA;                Command: emacsclient&#xA;                Arguments:&#xA;                  [INS] [DEL] file&#xA;                  [INS]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also use an emacs function (presumably &lt;code&gt;find-file&lt;/code&gt; or similar), rather than an external call to &lt;code&gt;emacsclient&lt;/code&gt;, but I couldn't figure out the syntax for that.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2020-06-10T13:47:17.840" LastActivityDate="2020-06-10T13:47:17.840" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="24503" PostTypeId="1" CreationDate="2016-07-09T22:37:11.413" Score="1" ViewCount="145" Body="&lt;p&gt;I wrote a function to show me a list of all defuns in the current buffer. The output is syntactically incorrect Lisp code (if you can even call it Lisp code, being syntactically a mess).  Here's what the output looks like in the help window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;List of results:&#xA;&#xA;(defvar var-one nil &quot;Var one doc&quot;)&#xA;(defvar var-two  nil &quot;Var two doc&quot;)&#xA;(defun foobar (one two)&#xA;(defmacro mymacro (body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If possible, I would like to fontify the display a bit, to color the defun words and the function names in some way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to do what org-mode does (suggested on another thread on SO). That is, copy my results to a temp buffer, enable Lisp mode, run &lt;code&gt;font-lock-fontify-buffer&lt;/code&gt; in Lisp mode on the temp buffer, and copy the fontified results back. But that didn't work, for two reasons. First, Lisp mode tried to indent my results like a mess of cascaded, nested defuns (ugh).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem seems to be that &lt;code&gt;with-help-window&lt;/code&gt; loses or blocks all font locking. Maybe it's because of the &lt;code&gt;princ&lt;/code&gt; statements used to generate output into the help window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my display code (which does not work for keeping font info):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-help-window (help-buffer)&#xA;  (princ (concat title &quot;\n\n&quot;))&#xA;  (princ alldefuns)&#xA;  (lisp-mode)  ; doesn't help, in or out&#xA;  (font-lock-fontify-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to display fontified text using &lt;code&gt;with-help-window&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there an alternate route that I should try? (I suppose I could go study the &lt;code&gt;occur&lt;/code&gt; source, which displays the same kind of results in a normal buffer. But I'd like to stick with &lt;code&gt;with-help-window&lt;/code&gt; approach if I could...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update for @lawlist comments below:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code that generates the list of defuns from the current buffer. The code looks like it should correctly collect and preserve font-lock info from the current buffer because it uses &lt;code&gt;buffer-substring&lt;/code&gt; to extract the lines. &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun ct-u-buffer-defuns-list ()&#xA;  &quot;Return a stringlist of defuns in current buffer.&quot;&#xA;  (let (result buf-contents tmp regex)&#xA;    (setq buf-contents (buffer-string))&#xA;    (with-temp-buffer&#xA;      (insert buf-contents)&#xA;      (goto-char (point-min))&#xA;      (setq regex &quot;^(defun&quot;)&#xA;      (while (re-search-forward regex nil t)&#xA;        (let (bol eol)&#xA;          (setq bol (line-beginning-position))&#xA;          (setq eol (line-end-position))&#xA;          (setq tmp (buffer-substring bol eol))&#xA;          (setq result (concat result tmp &quot;\n&quot;)))))&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But on a 20 line display displayed in a normal buffer using the code below executed in the scratch buffer, only the first 10 lines retain their font-lock info. Or sometimes it's another 5 or 10 lines in a 30 line display. I don't know why.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;  (let (alldefuns)&#xA;    (switch-to-buffer &quot;ct-utils.el&quot;)&#xA;    (setq alldefuns (ct-u-buffer-defuns-list))&#xA;    (switch-to-buffer (get-buffer-create &quot;foobar&quot;))&#xA;    (insert &quot;List of results:\n&quot;)&#xA;    (insert alldefuns))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems that at least part of the font-lock properties are collected and preserved by the extraction (search) code, and at least part of the font-lock properties are preserved by inserting the collected string into a temp buffer (Fundamental mode is active in the temporary buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, when I try the following bits of code in the &lt;code&gt;*scratch*&lt;/code&gt; buffer as suggested in the comments (&lt;code&gt;alldefuns&lt;/code&gt; is a variable that contains the lines extracted from the code buffer), I get the following results:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  &quot;Insert a string of defun lines in the current buffer.&quot;&#xA;  (insert alldefuns))&#xA;&#xA;;;works perfectly in Lisp mode scratch buffer&#xA;(foo) &#xA;&#xA;;; only displays 10 of 30 lines with font lock info&#xA;(let ((temp-buffer-window-setup-hook 'foo))&#xA;  (help-window-full-frame (help-buffer)&#xA;      (princ &quot;This title appears last in output.\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's a puzzle why displaying in (1) a temporary help buffer, or (2) in a temporary Fundamental mode buffer, only shows 1 chunk of 10 lines or so of font-lock info. &lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-07-10T05:28:11.207" LastActivityDate="2017-01-06T10:21:14.043" Title="How to fontify grep output displayed in a help window" Tags="|font-lock|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24504" PostTypeId="1" CreationDate="2016-07-09T23:17:30.930" Score="1" ViewCount="348" Body="&lt;p&gt;I've got a font lock config that I use to add certain helpful keywords to various modes of my choosing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-font-lock-keywords (mode)&#xA;  (font-lock-add-keywords mode&#xA;              '((&quot;\\&amp;lt;\\(FIXME\\|TODO\\|QUESTION\\|NOTE\\)&quot;&#xA;                 1 font-lock-warning-face t))))&#xA;&#xA;(mapc #'my-font-lock-keywords&#xA;      '(prog-mode text-mode message-mode latex-mode html-mode emacs-lisp-mode&#xA;          texinfo-mode sql-mode cc-mode c-mode clojure-mode lisp-mode&#xA;          c++-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works great except it matches/highlights lowercase versions of FIXME, TODO, QUESTION, and NOTE too. I only want it to match/highlight upper case versions of those &quot;keywords&quot;. How do I need to tweak the regexp to do this?&lt;/p&gt;&#xA;" OwnerUserId="8353" LastActivityDate="2016-09-09T23:42:05.917" Title="Make my font lock config only highlight my keywords when they are upper case" Tags="|font-lock|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24505" PostTypeId="1" CreationDate="2016-07-09T23:54:15.240" Score="2" ViewCount="324" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I get &lt;code&gt;pdf-tools&lt;/code&gt; to work simultaneously on OSX and Linux?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I keep my &lt;code&gt;.emacs.d&lt;/code&gt; directory synced over Dropbox, and share it between machines running OSX and Linux (Fedora and Ubuntu).  I got &lt;code&gt;pdf-tools&lt;/code&gt; off of melpa and successfully installed it on OSX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that &lt;code&gt;pdf-tools&lt;/code&gt; creates an executable (&lt;code&gt;epdfinfo&lt;/code&gt;) in its melpa directory.  The executable it generates on OSX is not usable on the Linux machines (and I presume vice versa).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How can I get &lt;code&gt;pdf-tools&lt;/code&gt; to play nice across the different systems?  Can I (should I) generate another executable on the Linux machines to store in the same directory, and if so, how?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The nuclear option, I believe, is to remove the melpa package, go old school, and install &lt;code&gt;pdf-tools&lt;/code&gt; by hand -- but do it twice, once for OSX, and once for the Linux systems, and then do some system checking at startup to see which one to use.  That seems like a lot of fuss.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-09T02:49:31.640" Title="How to use the same pdf-tools install on OSX and Linux simultaneously?" Tags="|osx|linux|pdf-tools|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24506" PostTypeId="1" AcceptedAnswerId="24510" CreationDate="2016-07-10T02:13:08.043" Score="3" ViewCount="568" Body="&lt;p&gt;Is there a way to edit a file only once?&#xA;So that for example: I open it and its closed (the buffer is killed) after the window closes.&#xA;A clarification: I usually have an Emacs deamon running and open windows with &lt;code&gt;emacsclient -nc [file]&lt;/code&gt;, but I don't want to have every file in my buffer list and I dont want to open a single instance for every file I only edit once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="12605" LastEditorUserId="1979" LastEditDate="2017-10-12T20:50:07.530" LastActivityDate="2017-10-12T20:50:07.530" Title="Edit file only once and close it" Tags="|emacsclient|emacs-daemon|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24507" PostTypeId="2" ParentId="24505" CreationDate="2016-07-10T02:42:45.340" Score="2" Body="&lt;p&gt;I guess one option is to add a &lt;code&gt;.gitignore&lt;/code&gt; which prevents Git from tracking that executable.  The downside of course is that it will force you to re-build that executable on every machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another is to set &lt;code&gt;pdf-info-epdfinfo-program&lt;/code&gt; to a filename that includes some system info, such as &lt;code&gt;(expand-file-name (concat &quot;epdfinfo-&quot; system-type) ...)&lt;/code&gt; and then to rename those executables accordingly.  You'll probably also want to adjust the above code since &lt;code&gt;system-type&lt;/code&gt; can be &lt;code&gt;gnu/linux&lt;/code&gt; where the slash is rather inconvenient.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-10T02:42:45.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24508" PostTypeId="2" ParentId="24506" CreationDate="2016-07-10T02:44:13.783" Score="2" Body="&lt;p&gt;You can end the edit session of such files by killing their buffer (e.g. &lt;code&gt;C-x k RET&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-10T02:44:13.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24509" PostTypeId="2" ParentId="24503" CreationDate="2016-07-10T06:11:19.547" Score="1" Body="&lt;p&gt;Here's the code that I am using for now. It displays the output lines in normal font-lock colors for Lisp-mode. Note that I had to add a trailing paren ) to each extracted &lt;code&gt;(defun foo (..)&lt;/code&gt; line (see the extraction function above), to make it valid Lisp code for the &lt;code&gt;(lisp-mode)&lt;/code&gt; call in the sample code below.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;  (let (title alldefuns)&#xA;    ;; get a list of matches&#xA;    (setq alldefuns (ct-u-buffer-defuns-list))&#xA;    (switch-to-buffer (get-buffer-create &quot;Defun-output&quot;))&#xA;    (lisp-mode)&#xA;    (local-set-key &quot;q&quot; (lambda () (interactive) (kill-buffer)))&#xA;    (setq title &quot;List of results:\n&quot;)&#xA;    (insert alldefuns))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-07-10T06:11:19.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24510" PostTypeId="2" ParentId="24506" CreationDate="2016-07-10T06:19:11.407" Score="3" Body="&lt;p&gt;Instead of using &lt;code&gt;emacsclient -nc [file]&lt;/code&gt;, if you remove the &lt;code&gt;-n&lt;/code&gt; argument and do just &lt;code&gt;emacsclient -c [file]&lt;/code&gt;, you can quickly close the popped frame and buffer by calling &lt;code&gt;server-edit&lt;/code&gt;, which is bound to &lt;code&gt;C-x #&lt;/code&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For instance, my workflow for editing crontab files would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;crone&lt;/code&gt; (aliased to &lt;code&gt;setenv VISUAL emacsclient &amp;amp;&amp;amp; crontab -e&lt;/code&gt; &lt;em&gt;(tcsh)&lt;/em&gt;) in terminal.&lt;/li&gt;&#xA;&lt;li&gt;Update the crontab&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x #&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Notice that I choose to not use even the &lt;code&gt;-c&lt;/code&gt; argument. I like the file to pop up in my one and only emacsclient frame (already open). When I am done editing that file, &lt;code&gt;C-x #&lt;/code&gt; will save the file (update crontab), kill the buffer, and I will be back to where I was in my emacsclient frame before I called &lt;code&gt;crone&lt;/code&gt; from the terminal.&lt;/p&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-07-10T06:19:11.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24511" PostTypeId="1" CreationDate="2016-07-10T10:45:12.297" Score="6" ViewCount="2301" Body="&lt;p&gt;Whenever I paste something in a source code buffer it is automatically re-indented. This is great sometimes, if I'm pasting a complete block of code or a single self contained line for example, but it's awful other times. For example I often assemble fragments together from various places and usually they have at least some existing indentation that I'd prefer to keep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been told I can pass the universal argument to the past command to paste without indentation but &quot;SPC u p&quot; doesn't seem to do anything different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to turn off auto-indent for one paste in Spacemacs or, alternatively, is there a way to disable auto-indent on paste altogether (in that second case it'd be cool to have a command to indent the last pasted block).&lt;/p&gt;&#xA;" OwnerUserId="3986" LastActivityDate="2020-04-19T00:37:38.597" Title="Pasting without auto-indent" Tags="|evil|spacemacs|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24513" PostTypeId="1" AcceptedAnswerId="24514" CreationDate="2016-07-10T20:43:54.747" Score="0" ViewCount="436" Body="&lt;p&gt;I am trying out the literate programming features of org mode and loving it! I will be using the noweb syntax of double angle brackets &amp;lt;&amp;lt;...&gt;&gt; heavily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want the named block to be inserted into the place of the double-brackets as intended, when I tangle the file (obviously)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I export to HTML, I don't want the named block to be expanded, and just make &lt;code&gt;&amp;lt;&amp;lt;block-name&amp;gt;&amp;gt;&lt;/code&gt; show up instead. This is useful to hide housekeeping code, since that often distracts my reading while reading the documentation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In brief, how do I prevent expansion of &amp;lt;&gt; while exporting to HTML and allow it while tangling? &lt;/p&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2016-08-26T13:20:42.060" Title="How to mark a code block in Org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24514" PostTypeId="2" ParentId="24513" CreationDate="2016-07-10T21:24:45.077" Score="1" Body="&lt;p&gt;The header argument &lt;code&gt;:noweb no-export&lt;/code&gt; (or another option, dpending on your need) will help you. See &lt;a href=&quot;http://orgmode.org/manual/noweb.html#noweb&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: As suggested by @Drew a small summary of the &lt;code&gt;:noweb&lt;/code&gt; arguments. The table below shows with which argument the code block will be expanded before what action:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;| :noweb argument| evaluate | tangle | export  |&#xA;|----------------+----------+--------+---------|&#xA;| no             |          |        |         |&#xA;| yes            | yes      | yes    | yes     |&#xA;| tangle         |          | yes    |         |&#xA;| no-export      | yes      | yes    |         |&#xA;| strip-export   | yes      | yes    | removed |&#xA;| eval           | yes      |        |         |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here a small example that shows how to apply the header argument to the source block:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* Example Use&#xA;#+begin_src sh :noweb-ref all&#xA;echo &quot;all&quot;&#xA;#+end_src&#xA;&#xA;#+begin_src sh :noweb no-export :tangle example.sh&#xA;&amp;lt;&amp;lt;all&amp;gt;&amp;gt;&#xA;echo &quot;more&quot;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that you have more options to set the header arguments. You can set them for example system wide or on a per file and subtree basis:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* Header arguments&#xA;** System wide&#xA;Set variable ~org-babel-default-header-args~:&#xA;#+BEGIN_SRC emacs-lisp&#xA;(setq org-babel-default-header-args '((:exports . &quot;code&quot;)))&#xA;#+END_SRC&#xA;** Per file&#xA;#+property: header-args       :eval no&#xA;#+property: header-args:ditaa :eval yes&#xA;&#xA;*** Per Subtree&#xA;    :PROPERTIES:&#xA;    :header-args:    :cache yes&#xA;    :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-26T13:20:42.060" LastActivityDate="2016-08-26T13:20:42.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24515" PostTypeId="2" ParentId="2837" CreationDate="2016-07-11T00:09:31.070" Score="4" Body="&lt;p&gt;Another, terser, way is to use a &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Permissions#insertion-specification&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;smartparens&lt;/code&gt; insertion spec&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(sp-local-pair 'c-mode &quot;{&quot; nil :post-handlers '(:add (&quot;||\n[i]&quot; &quot;RET&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2016-07-11T00:09:31.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24516" PostTypeId="1" CreationDate="2016-07-11T00:50:50.373" Score="0" ViewCount="558" Body="&lt;p&gt;I want to understand the different ways for installing a package, leading to readily using the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I compared &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_package_system.html&quot; rel=&quot;nofollow&quot;&gt;Emacs: How to Install Packages Using ELPA, MELPA&lt;/a&gt;  and &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_installing_packages.html&quot; rel=&quot;nofollow&quot;&gt;How to Install Emacs Package Manually&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second link, if I understand correctly, the steps to install a package manually are &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(optional) byte-compilation of the package's elisp code, &lt;/li&gt;&#xA;&lt;li&gt;loading the package's files, and &lt;/li&gt;&#xA;&lt;li&gt;auto-activating the mode defined in the package, when opening files which the package is supposed to handle.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the first link for installing a package using ELPA or MELPA, I don't find any of the three steps for installing a package manually in the first link. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;So does the way for installing a package using ELPA or MELPA in the&#xA;first link already do the things that are done by the three steps&#xA;for installing a package manually in the second link? Or does the&#xA;way for installing a package using ELPA or MELPA in the first link&#xA;need additional steps that appear in the way for installing a&#xA;package manually in the second link?&lt;/li&gt;&#xA;&lt;li&gt;In the way for installing a package using ELPA or MELPA in the first&#xA;link, is it necessary to add something to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2016-07-11T01:43:47.167" LastActivityDate="2016-07-11T03:43:30.970" Title="Does installing packages using ELPA or MELPA need some additional steps for installing them manually?" Tags="|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24517" PostTypeId="2" ParentId="24360" CreationDate="2016-07-11T01:43:41.027" Score="1" Body="&lt;p&gt;Emacs Lisp is not a natively compiled language, it compiles to a portable bytecode that is interpreted.  What is more, Emacs' bytecode is not the fastest bytecode ever designed.  In particular, access to lexical variables is probably not as fast as it should be, and your code relies greatly on those.  As mentioned by Stefan, it is surprising that your code is only 20 times slower in Emacs Lisp than in C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historically, There was little incentive to optimise the bytecode further, since Emacs was mostly used for editing text, and Emacs buffers are highly optimised.  Since nowadays a lot of people use Emacs with Gnus, Eww, or Wanderlust, we're waiting with held breath for the hero who will spend a year or two of their life reimplementing the Emacs Lisp runtime in a better way.&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-07-11T01:43:41.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24518" PostTypeId="2" ParentId="24516" CreationDate="2016-07-11T03:43:30.970" Score="2" Body="&lt;p&gt;When using ELPA, the package is automatically byte-compiled for you, and it is also automatically activated for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing you might want to add to your &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; file when using ELPA is &lt;code&gt;(package-initialize)&lt;/code&gt; so you can control when the installed packages get activated (in case you want to perform some setups before/after).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-11T03:43:30.970" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24519" PostTypeId="1" AcceptedAnswerId="24558" CreationDate="2016-07-11T12:10:11.663" Score="8" ViewCount="9434" Body="&lt;p&gt;I am not sure if my question makes sense. I am naive to this. I see that there is a standalone version of emacs with the menu bar, tool bar etc. Also, I see emacs version that could be run inside a terminal. Are they both same or is there a difference ? &lt;/p&gt;&#xA;" OwnerUserId="12612" LastActivityDate="2018-10-25T05:41:00.157" Title="What is the difference between standalone version of emacs and the one that runs inside terminal?" Tags="|emacsclient|terminal-emacs|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24520" PostTypeId="1" AcceptedAnswerId="24521" CreationDate="2016-07-11T12:55:05.487" Score="0" ViewCount="188" Body="&lt;p&gt;I want to get the first line of the buffer I'm actually in. More generally, I'm looking for a utility that returns Nth line from a supplied buffer. Is there some built-in for that?&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2016-07-11T14:01:36.193" Title="Return nth line from (current) buffer" Tags="|buffers|string|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24521" PostTypeId="2" ParentId="24520" CreationDate="2016-07-11T13:19:58.303" Score="4" Body="&lt;p&gt;This could be done with the next function (with or without narrowing):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-nth-line (number)&#xA;  &quot;Get line with NUMBER&quot;&#xA;  (save-restriction&#xA;    (widen)&#xA;    (save-excursion&#xA;      (goto-line number)&#xA;      (buffer-substring-no-properties (line-beginning-position)&#xA;                                      (line-end-position)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get the first line execute&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-nth-line 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to get text properties, then use &lt;code&gt;buffer-substring&lt;/code&gt; instead of &lt;code&gt;buffer-substring-no-properties&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-07-11T14:01:36.193" LastActivityDate="2016-07-11T14:01:36.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24522" PostTypeId="1" AcceptedAnswerId="24536" CreationDate="2016-07-11T13:39:45.987" Score="2" ViewCount="1265" Body="&lt;p&gt;So I've been using my &lt;a href=&quot;https://github.com/KarthikNayak/dotfiles/tree/master/Emacs&quot; rel=&quot;nofollow&quot;&gt;custom&lt;/a&gt; config for a while now and no problems whatsoever, recently however there's a lag while loading emacs. It hangs at &lt;code&gt;loading /home/&amp;lt;user&amp;gt;/.emacs.d/git_config.el (source)&lt;/code&gt; for about 5mins before going through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not entirely sure what the problem is. I tried loading it in &lt;code&gt;--debug-mode&lt;/code&gt; but to no avail. I can get over the hang by clicking &lt;code&gt;C-g&lt;/code&gt;. I tried commenting out &lt;code&gt;git_config.el&lt;/code&gt; but then it hangs in &lt;code&gt;helm.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;git_config.el&lt;/code&gt; it seems that it hangs at &lt;code&gt;(require 'git-commit)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea on how to go about debugging this?&lt;/p&gt;&#xA;" OwnerUserId="12617" LastEditorUserId="12617" LastEditDate="2016-07-11T13:46:02.300" LastActivityDate="2016-09-09T19:38:22.227" Title="Debug emacs hanging at startup" Tags="|start-up|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24523" PostTypeId="1" CreationDate="2016-07-11T14:26:26.443" Score="6" ViewCount="1912" Body="&lt;p&gt;I just installed Fedora 24 with Emacs and IPython. When I launched the IPython shell in Emacs, the prompt symbol, which should be &quot;In [1]&quot;, is displayed as &quot;^[[?12l^[[?25h&quot;. Is there a way to solve this issue?&lt;/p&gt;&#xA;" OwnerUserId="12618" LastEditorUserId="253" LastEditDate="2016-07-11T14:29:14.220" LastActivityDate="2024-02-28T07:07:40.970" Title="Emacs IPython prompt symbol is garbled" Tags="|character-encoding|ipython|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24526" PostTypeId="1" AcceptedAnswerId="24545" CreationDate="2016-07-11T15:18:18.460" Score="5" ViewCount="288" Body="&lt;p&gt;I've just called an interactive function (i.e., a command).  I want to call it again, with the same arguments.  I know that I can call a keyboard macro again by using &lt;code&gt;e&lt;/code&gt; right after running it the first time.  Is there something similar regarding interactive functions?&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="253" LastEditDate="2016-07-11T15:29:58.010" LastActivityDate="2016-07-12T00:34:36.173" Title="How to repeat a command immediately after calling it?" Tags="|functions|interactive|commands|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24527" PostTypeId="1" CreationDate="2016-07-11T15:26:20.703" Score="2" ViewCount="109" Body="&lt;p&gt;I am trying to define a minor mode that makes 2 keybindings. This is code i am defining it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode parinfer-mode&#xA;  &quot;Uses Parinfer to Format lispy code&quot;&#xA;  :lighter &quot; parinfer&quot;&#xA;  :keymap '(let ((map (make-sparse-keymap)))&#xA;             (define-key map (kbd &quot;C-c t&quot;) 'parinfer-mode--toggle)&#xA;             (define-key map (kbd &quot;C-c r&quot;) 'parinfer-mode--refresh)&#xA;             map)&#xA;  (if parinfer-mode&#xA;      (parinfer-mode--refresh)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when i later eval &lt;code&gt;parinfer-mode&lt;/code&gt;, those bindings remain undefined, and value of &lt;code&gt;parinfer-mode-map&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (67 keymap&#xA;     (45 keymap&#xA;         (99 keymap&#xA;             (32 keymap&#xA;                 (114 . parinfer)&#xA;                 (116 . parinfer-mode--toggle))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What should i change to set keymap the way i want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I am not interested in defining mode separately, but in understanding what goes wrong in using an approach described in documentation.&lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2016-07-11T15:26:20.703" Title="How to make minor mode keybindings for C-c prefix?" Tags="|keymap|minor-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24528" PostTypeId="2" ParentId="24526" CreationDate="2016-07-11T15:28:30.323" Score="8" Body="&lt;p&gt;You are looking for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Repeating.html&quot;&gt;&lt;code&gt;repeat&lt;/code&gt;&lt;/a&gt;, bound by default to &lt;code&gt;C-x z&lt;/code&gt;.  The&#xA;first part of the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(repeat REPEAT-ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Repeat most recently executed command.&#xA;  If &lt;code&gt;REPEAT-ARG&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt; (interactively, with a prefix argument),&#xA;  supply a prefix argument to that command.  Otherwise, give the&#xA;  command the same prefix argument it was given before, if any.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;evil&lt;/code&gt;, you also have access to the beloved dot command&#xA;from Vim.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-11T15:28:30.323" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24529" PostTypeId="1" AcceptedAnswerId="24534" CreationDate="2016-07-11T15:34:30.143" Score="2" ViewCount="856" Body="&lt;p&gt;In &lt;code&gt;minor-mode-alist&lt;/code&gt; documentation it is described that lighter can be a lisp expression that is evaluated to get text used in the display of minor mode in mode line. It has the form of (:eval ...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a function that makes such a string upon evaluation, for example, called &lt;code&gt;compose-mode-line&lt;/code&gt; (no parameters), how minor-mode's lighter can be set to results of evaluation of that function?&lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2016-07-11T17:40:15.210" Title="How to make changing minor-mode lighter in modeline?" Tags="|minor-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24531" PostTypeId="2" ParentId="24360" CreationDate="2016-07-11T16:32:56.923" Score="2" Body="&lt;p&gt;What is Emacs doing in code? Here is my analysis:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bytecode of elisp code doing the loop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0       constant  0&#xA;1       dup       &#xA;2       constant  float-time&#xA;3       call      0&#xA;4:1     stack-ref 2&#xA;5       constant  100000000&#xA;6       lss       &#xA;7       goto-if-nil 2&#xA;10      stack-ref 2&#xA;11      constant  7&#xA;12      mult      &#xA;13      stack-set 2&#xA;15      stack-ref 2&#xA;16      add1      &#xA;17      stack-set 3&#xA;19      goto      1&#xA;22:2    constant  float-time&#xA;23      call      0&#xA;24      stack-ref 1&#xA;25      diff      &#xA;26      return  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Opcode &quot;mult&quot; is defined as case expression in big switch statement:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;CASE (Bmult):&#xA;      BEFORE_POTENTIAL_GC ();&#xA;      DISCARD (1);&#xA;      TOP = Ftimes (2, &amp;amp;TOP);&#xA;      AFTER_POTENTIAL_GC ();&#xA;      NEXT;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;Ftimes&quot; is defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;DEFUN (&quot;*&quot;, Ftimes, Stimes, 0, MANY, 0,&#xA;doc: /* Return product of any number of arguments, which are numbers or markers.&#xA;usage: (* &amp;amp;rest NUMBERS-OR-MARKERS)  */)&#xA;(ptrdiff_t nargs, Lisp_Object *args)&#xA;{&#xA;    return arith_driver (Amult, nargs, args);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Arithmetic driver:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;static Lisp_Object&#xA;arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)&#xA;{&#xA;  Lisp_Object val;&#xA;  ptrdiff_t argnum, ok_args;&#xA;  EMACS_INT accum = 0;&#xA;  EMACS_INT next, ok_accum;&#xA;  bool overflow = 0;&#xA;&#xA;  switch (code)&#xA;    {&#xA;    case Alogior:&#xA;    case Alogxor:&#xA;    case Aadd:&#xA;    case Asub:&#xA;      accum = 0;&#xA;      break;&#xA;    case Amult:&#xA;    case Adiv:&#xA;      accum = 1;&#xA;      break;&#xA;    case Alogand:&#xA;      accum = -1;&#xA;      break;&#xA;    default:&#xA;      break;&#xA;    }&#xA;&#xA;  for (argnum = 0; argnum &amp;lt; nargs; argnum++)&#xA;    {&#xA;      if (! overflow)&#xA;    {&#xA;      ok_args = argnum;&#xA;      ok_accum = accum;&#xA;    }&#xA;&#xA;      /* Using args[argnum] as argument to CHECK_NUMBER_... */&#xA;      val = args[argnum];&#xA;      CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (val);&#xA;&#xA;      if (FLOATP (val))&#xA;    return float_arith_driver (ok_accum, ok_args, code,&#xA;                   nargs, args);&#xA;      args[argnum] = val;&#xA;      next = XINT (args[argnum]);&#xA;      switch (code)&#xA;    {&#xA;    case Aadd:&#xA;      overflow |= INT_ADD_WRAPV (accum, next, &amp;amp;accum);&#xA;      break;&#xA;    case Asub:&#xA;      if (! argnum)&#xA;        accum = nargs == 1 ? - next : next;&#xA;      else&#xA;        overflow |= INT_SUBTRACT_WRAPV (accum, next, &amp;amp;accum);&#xA;      break;&#xA;    case Amult:&#xA;      overflow |= INT_MULTIPLY_WRAPV (accum, next, &amp;amp;accum);&#xA;      break;&#xA;    case Adiv:&#xA;      if (! (argnum || nargs == 1))&#xA;        accum = next;&#xA;      else&#xA;        {&#xA;          if (next == 0)&#xA;        xsignal0 (Qarith_error);&#xA;          if (INT_DIVIDE_OVERFLOW (accum, next))&#xA;        overflow = true;&#xA;          else&#xA;        accum /= next;&#xA;        }&#xA;      break;&#xA;    case Alogand:&#xA;      accum &amp;amp;= next;&#xA;      break;&#xA;    case Alogior:&#xA;      accum |= next;&#xA;      break;&#xA;    case Alogxor:&#xA;      accum ^= next;&#xA;      break;&#xA;    case Amax:&#xA;      if (!argnum || next &amp;gt; accum)&#xA;        accum = next;&#xA;      break;&#xA;    case Amin:&#xA;      if (!argnum || next &amp;lt; accum)&#xA;        accum = next;&#xA;      break;&#xA;    }&#xA;    }&#xA;&#xA;  XSETINT (val, accum);&#xA;  return val;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;INT_MULTIPLY_WRAPV does multiplication via following code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;/* Return A &amp;lt;op&amp;gt; B, where the operation is given by OP.  Use the&#xA;   unsigned type UT for calculation to avoid overflow problems.&#xA;   Convert the result to type T without overflow by subtracting TMIN&#xA;   from large values before converting, and adding it afterwards.&#xA;   Compilers can optimize all the operations except OP.  */&#xA;#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \&#xA;  (((ut) (a) op (ut) (b)) &amp;lt;= (tmax) \&#xA;   ? (t) ((ut) (a) op (ut) (b)) \&#xA;   : ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Every time &quot;mult&quot; is executed it goes through switch statement, wrapper code with many additional instructions when it only needs to execute one x86 instruction. In provided code Garbage Collection was not executed at all (judging by variable gcs-done). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Potential bottlenecks: checking if number is float, checking for overflow, switch statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used portions of GPL licensed code from &lt;a href=&quot;https://www.gnu.org/software/emacs/&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs&lt;/a&gt; for education purposes.&lt;/p&gt;&#xA;" OwnerUserId="9596" LastActivityDate="2016-07-11T16:32:56.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24532" PostTypeId="2" ParentId="21507" CreationDate="2016-07-11T17:23:32.110" Score="1" Body="&lt;p&gt;Looking at the source file &lt;code&gt;ox-html.el&lt;/code&gt;, the function &lt;code&gt;org-html-template&lt;/code&gt; does not seem to allow customizing the &lt;code&gt;&amp;lt;html...&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tags in the export. :( However, there's also a CSS property &lt;a href=&quot;https://css-tricks.com/almanac/properties/d/direction/&quot; rel=&quot;nofollow&quot;&gt;direction:rtl&lt;/a&gt; that you could use, since org-mode lets you change the CSS by setting &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-html-head &quot;&amp;lt;style&amp;gt; &amp;lt;![CDATA[ body { direction: rtl; } ]]&amp;gt; &amp;lt;/style&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am not sure if CDATA should be there; the &lt;code&gt;org-html-head&lt;/code&gt; docstring shows it in the example. Alternatively, try it without:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-html-head &quot;&amp;lt;style&amp;gt; body { direction: rtl; } &amp;lt;/style&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-07-11T17:23:32.110" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24534" PostTypeId="2" ParentId="24529" CreationDate="2016-07-11T17:40:15.210" Score="1" Body="&lt;p&gt;You can do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode ...&#xA;  :lighter (:eval (compose-mode-line))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this will re-compute &lt;code&gt;(compose-mode-line)&lt;/code&gt; &lt;em&gt;very&lt;/em&gt; frequently (after every key press, typically), so make sure it does not perform longish or blocking computations.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-11T17:40:15.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24536" PostTypeId="2" ParentId="24522" CreationDate="2016-07-11T18:22:49.617" Score="1" Body="&lt;p&gt;I found the problem after hours of debugging, it seems to be an issue with &lt;strong&gt;TRAMP&lt;/strong&gt; as stated &lt;a href=&quot;https://emacs.stackexchange.com/questions/14708/debugging-slowness-in-init-file-not-hostname-related&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the &lt;a href=&quot;https://emacs.stackexchange.com/a/14828/12617&quot;&gt;answer&lt;/a&gt; sums it up, the problem is fixed by adding  &lt;code&gt;(setq tramp-ssh-controlmaster-options &quot;&quot;)&lt;/code&gt; to the start of the emacs config.&lt;/p&gt;&#xA;" OwnerUserId="12617" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-11T18:22:49.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24537" PostTypeId="1" CreationDate="2016-07-11T19:13:43.467" Score="0" ViewCount="1092" Body="&lt;p&gt;I personally use 2 spaces for indentation but everyone has a preference and I'd like to respect that. When I open someone else's files I would prefer to use their indentation scheme. In my .emacs file here is everything I use to set my indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq css-indent-offset 2)&#xA;(setq js-indent-level 2)&#xA;(setq javascript-indent-level 2)&#xA;&#xA;(setq-default python-indent 2) ;emacs 23                                                                                &#xA;(setq-default python-indent-offset 2); emacs 24                                                                         &#xA;(add-hook 'python-mode-hook&#xA;    (lambda () (setq tab-width 2)))&#xA;(setq html-indent-offset 2)&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq default-tab-width 2)&#xA;(add-hook 'html-mode-hook&#xA;      (lambda()&#xA;      (setq sgml-basic-offset 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could modify .emacs every time I want to use a different format, but I'd rather visually identify the indentation mode and manually change the variables (for the current emacs process only) to match the indentation of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I know very little about emacs/elisp, but my assumption was &lt;code&gt;M-x setq intent-tabs-mode t&lt;/code&gt; would make my tab key generate tabs instead of spaces. No such luck and googling has gotten me no where. Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="12620" LastActivityDate="2016-07-12T00:27:23.433" Title="Change indentation variables inside of buffer" Tags="|indentation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24538" PostTypeId="1" CreationDate="2016-07-11T19:55:08.607" Score="6" ViewCount="1114" Body="&lt;p&gt;Consider the below MWE of &lt;code&gt;.Rmd&lt;/code&gt; file containing Arabic text which needs xelatex engine to be rendered by &lt;code&gt;pandoc&lt;/code&gt;. As the documentation of the latter says putting this option would make it: &lt;code&gt;--latex-engine=xelatex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MWE&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---&#xA;title: &quot;Minimal Working Example `.Rmd` in Arabic&quot;&#xA;author: &quot;Author Name&quot;&#xA;date: &quot;Friday, July 08, 2016&quot;&#xA;output: pdf_document&#xA;latex-engine: xelatex&#xA;---&#xA;&#xA;----------&#xA;&#xA;# مقدمة عن التقرير&#xA;# نتائج البحث&#xA;# الخلاصة&#xA;&#xA;# Introduction of the Report&#xA;&#xA;# Results&#xA;&#xA;# Summary&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So this how it appears in Emacs editor:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bpg2P.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bpg2P.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This is my setup:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Ubuntu 16.04 &lt;/li&gt;&#xA;&lt;li&gt;Emacs GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian&lt;/li&gt;&#xA;&lt;li&gt;Pandoc 1.16.0.2&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;polymode-mode&lt;/code&gt; and &lt;code&gt;markdown-mode&lt;/code&gt; from MELPA latest as of this date&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;init.el&lt;/code&gt; setup in relation to polymode-mode&lt;/li&gt;&#xA;&lt;li&gt;ESS 16.04&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;init.el - polymode-mode&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'poly-R)&#xA;(require 'poly-markdown)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.md&quot; . poly-markdown-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.org&quot; . poly-org-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rmd`enter code here`&quot; . poly-markdown+r-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;init.el - customizataions&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA; '(ess-rutils-keys t)&#xA; '(ess-swv-pdflatex-commands (quote (&quot;xelatex&quot; &quot;pdflatex&quot; &quot;texi2pdf&quot; &quot;make&quot;)))&#xA; '(ess-swv-processor (quote knitr))&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Primary Issue&lt;/strong&gt;&#xA;When I export the &lt;code&gt;.Rmd&lt;/code&gt; buffer to pdf by &lt;kbd&gt;M-n-e&lt;/kbd&gt;, I am prompted for 3 options: &lt;code&gt;Rmarkdown-ESS&lt;/code&gt;, &lt;code&gt;Rmarkdown&lt;/code&gt;, and &lt;code&gt;pandoc&lt;/code&gt;. I picked &lt;code&gt;Rmarkdown-ESS&lt;/code&gt; this was the error log:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/bin/pandoc +RTS -K512m -RTS 4G_report.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output /home/username/.emacs.d/docs/rstat/4th_examCom_program_2015_2016/4G_report[exported].pdf --template /home/username/R/my_R_library/rmarkdown/rmd/latex/default-1.15.2.tex --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable 'geometry:margin=1in' &#xA;! Package inputenc Error: Unicode char س (U+633)&#xA;(inputenc)                not set up for use with LaTeX.&#xA;&#xA;See the inputenc package documentation for explanation.&#xA;Type  H &amp;lt;return&amp;gt;  for immediate help.&#xA; ...                                              &#xA;&#xA;l.293 \end{verbatim}&#xA;&#xA;Try running pandoc with --latex-engine=xelatex.&#xA;pandoc: Error producing PDF&#xA;Error: pandoc document conversion failed with error 43&#xA;R&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so as you can see the error suggests using &lt;code&gt;--latex-engine=xelatex&lt;/code&gt; in pandoc instead of the default pdflatex. So how to set xelatex engine as default in polymode export? I tried to set the engine to xelatex in the YAML header but it didn't work. Or is there a way to change the value of a variable like &lt;code&gt;pm-exporter/pandoc&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Secondary Issue&lt;/strong&gt;&lt;br&gt;&#xA;When I export to &lt;code&gt;html&lt;/code&gt; I want the Arabic text direction to be from right-to-left and the English part of the text to be from left-to-right. Although I enjoy this bidi-direction inside Emacs editor, well this is one of the good reasons to pick this editor, but unfortunately I dont' get the same effect in the html export, and I don't know whether the same issue will arise int the pdf. So what do I need to get that effect in the exported document? &lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2016-07-12T12:52:29.440" LastActivityDate="2023-02-28T11:26:29.490" Title="How to set PDF export in polymode-mode to use xelatex engine?" Tags="|latex|pdf|markdown|polymode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24539" PostTypeId="2" ParentId="24504" CreationDate="2016-07-11T20:18:08.797" Score="1" Body="&lt;p&gt;This should work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-font-lock-matcher (limit)&#xA;  &quot;Search forward for fixme and todos.&#xA;LIMIT is the limit of the search.&quot;&#xA;  (let ((case-fold-search nil))&#xA;    (re-search-forward &quot;\\&amp;lt;\\(FIXME\\|TODO\\|QUESTION\\|NOTE\\)&quot;&#xA;                       limit 'no-error)))&#xA;&#xA;(defun my-font-lock-keywords (mode)&#xA;  (font-lock-add-keywords mode&#xA;                          '((my-font-lock-matcher&#xA;                             1 font-lock-warning-face t))))&#xA;&#xA;(mapc #'my-font-lock-keywords&#xA;      '(prog-mode text-mode message-mode latex-mode html-mode emacs-lisp-mode&#xA;                  texinfo-mode sql-mode cc-mode c-mode clojure-mode lisp-mode&#xA;                  c++-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3858" LastActivityDate="2016-07-11T20:18:08.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24540" PostTypeId="2" ParentId="24519" CreationDate="2016-07-11T20:36:56.760" Score="1" Body="&lt;p&gt;A single executable of Emacs can run both in the terminal and in a GUI window by itself. The functionality is mostly the same, although for obvious there's some functionality that doesn't work &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Non_002dWindow-Terminals&quot; rel=&quot;nofollow&quot;&gt;in a terminal&lt;/a&gt; -- for example, you can't click to move point (unless you enable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Text_002dOnly-Mouse&quot; rel=&quot;nofollow&quot;&gt;simple mouse support&lt;/a&gt;), GUI buttons don't work, and I think there are fewer colors available.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-07-11T20:36:56.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24541" PostTypeId="1" CreationDate="2016-07-11T21:18:44.300" Score="16" ViewCount="2581" Body="&lt;p&gt;I am trying to edit a Swagger JSON file in emacs. It contains large nested JSON objects, so I want to collapse and hide some of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried &lt;code&gt;origami-mode&lt;/code&gt;, configured as &lt;code&gt;origami-c-style-parser&lt;/code&gt; in &lt;code&gt;origami-parser-alist&lt;/code&gt;, but it is quite unsophisticated (the word &quot;parser&quot; seems to be an overly grandiose word for what it does). It doesn't notice that Swagger URL parameter substrings like &lt;code&gt;{id}&lt;/code&gt; are inside JSON strings, so it happily collapses them too when I ask it to collapse all nodes in the buffer except the current node. I don't want it to do that. I want a way of collapsing only JSON subtrees like objects, not substrings of JSON strings that &lt;em&gt;happen&lt;/em&gt; to have curly braces in them. How can I achieve this goal?&lt;/p&gt;&#xA;" OwnerUserId="6790" LastEditorUserId="105" LastEditDate="2016-07-12T14:52:52.383" LastActivityDate="2017-07-24T23:58:39.457" Title="Outline editing, like org-mode, for JSON" Tags="|code-folding|json|outline|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24542" PostTypeId="1" AcceptedAnswerId="43799" CreationDate="2016-07-11T22:01:59.133" Score="5" ViewCount="372" Body="&lt;p&gt;In certain situations Emacs doesn't properly paste text. Apparently this only happens if the current buffer isn't saved and both web-mode and evil-mode are loaded. I was able to reproduce this behavior with the following config:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;(require 'evil)&#xA;(evil-mode 1)&#xA;(require 'web-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.js\\'&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reproduction:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit the following file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;function test() {&#xA;    console.log('hello world');&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then press the following series of keys:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;yGPwywp&lt;/code&gt; (Copy the function in front of the cursor, go to the function name, copy it behind the cursor)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;function test() {&#xA;tes&#xA;    console.log('hello world');&#xA;}&#xA;function test() {&#xA;    console.log('hello world');&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Apparently the text has been truncated and is being pasted to the next line.&#xA;If I remove web-mode (the last two lines) from my config, then everything works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-js prettyprint-override&quot;&gt;&lt;code&gt;function ttestest() {&#xA;    console.log('hello world');&#xA;}&#xA;function test() {&#xA;    console.log('hello world');&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the output of &lt;code&gt;web-mode-debug&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading /usr/share/emacs/site-lisp/site-start.d/autoconf-init.el (source)...done&#xA;Loading /usr/share/emacs/site-lisp/site-start.d/cmake-init.el (source)...done&#xA;Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...done&#xA;Loading /usr/share/emacs/site-lisp/site-start.d/git-init.el (source)...done&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;test.js has auto save data; consider M-x recover-this-file&#xA; [2 times]&#xA;--- WEB-MODE DEBUG BEG ---&#xA;versions: emacs(25.0) web-mode(&quot;14.0.8&quot;)&#xA;vars: engine(&quot;none&quot;) minor(&quot;none&quot;) content-type(&quot;javascript&quot;) file(&quot;/home/tbo/test.js&quot;)&#xA;system: window(nil) config(&quot;x86_64-redhat-linux-gnu&quot;)&#xA;colors: fg(nil) bg(nil)&#xA;minor modes: (completion-in-region-mode global-eldoc-mode evil-local-mode evil-mode undo-tree-mode global-undo-tree-mode shell-dirtrack-mode)&#xA;vars:&#xA;web-mode-enable-current-column-highlight=nil&#xA;web-mode-enable-current-element-highlight=nil&#xA;indent-tabs-mode=t&#xA;--- WEB-MODE DEBUG END ---&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the output of &lt;code&gt;list-command-history&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-yank 10 14 (quote exclusive) nil nil)&#xA;(evil-yank 1 53 (quote line) nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12622" LastEditorUserId="105" LastEditDate="2016-07-12T14:52:27.057" LastActivityDate="2018-07-26T18:08:40.420" Title="Pasting text doesn't work properly in evil-/web-mode" Tags="|evil|web-mode|copy-paste|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24544" PostTypeId="2" ParentId="24537" CreationDate="2016-07-12T00:27:23.433" Score="1" Body="&lt;p&gt;You can define a command that you can use for the switching.  Here's a very basic version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-set-indents (n)&#xA;  &quot;Set the normal indentation amount.  With no argument, sets to 2.&#xA;With just one C-u sets to 4.  With any other argument, sets to that amount.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (setq n (if n (prefix-numeric-value n) 2))&#xA;&#xA;  (setq css-indent-offset n)&#xA;  (setq js-indent-level n)&#xA;  (setq javascript-indent-level n)&#xA;&#xA;  (setq-default python-indent n) ;emacs 23                                                                                &#xA;  (setq-default python-indent-offset n); emacs 24                                                                         &#xA;  (add-hook 'python-mode-hook&#xA;    (lambda () (setq tab-width n)))&#xA;  (setq html-indent-offset n)&#xA;  (setq-default indent-tabs-mode nil)&#xA;  (setq default-tab-width n)&#xA;  (add-hook 'html-mode-hook&#xA;    (lambda()&#xA;      (setq sgml-basic-offset n)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, if you use it more than once, that &lt;code&gt;add-hook&lt;/code&gt; could be problematical.  I think you'll want to take out the &lt;code&gt;add-hook&lt;/code&gt; wrapper and just have the &lt;code&gt;setq&lt;/code&gt; directly in this code.  You can then invoke it with an arg using &lt;kbd&gt;M-x my-set-indents&lt;/kbd&gt;, or you could put it on a key (sequence).&lt;/p&gt;&#xA;" OwnerUserId="11699" LastActivityDate="2016-07-12T00:27:23.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24545" PostTypeId="2" ParentId="24526" CreationDate="2016-07-12T00:34:36.173" Score="5" Body="&lt;p&gt;There is also &lt;code&gt;repeat-complex-command&lt;/code&gt; (normally bound to &lt;kbd&gt;C-x ESC ESC&lt;/kbd&gt; as well as several others (that's the one I use, so I remember that)).  This will go back further in the history to the last command that required interaction (i.e. prompted for input).&lt;/p&gt;&#xA;" OwnerUserId="11699" LastActivityDate="2016-07-12T00:34:36.173" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24546" PostTypeId="1" CreationDate="2016-07-12T05:54:58.597" Score="2" ViewCount="1014" Body="&lt;p&gt;The question pretty much says it all.  I opened emacs as a regular user and am trying to edit something in the /etc/ folder (I know this is dangerous etc. etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2016-07-12T17:27:22.283" Title="How do I open a non-readable file from inside emacs when I opened emacs as a regular user?" Tags="|sudo|root|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24547" PostTypeId="2" ParentId="24546" CreationDate="2016-07-12T06:02:30.697" Score="4" Body="&lt;p&gt;You could use &lt;a href=&quot;https://stackoverflow.com/questions/95631/open-a-file-with-su-sudo-inside-emacs&quot;&gt;https://stackoverflow.com/questions/95631/open-a-file-with-su-sudo-inside-emacs&lt;/a&gt;, for example &lt;code&gt;C-x C-f /sudo::/path/to/file&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-07-12T06:02:30.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24548" PostTypeId="1" CreationDate="2016-07-12T07:53:51.430" Score="2" ViewCount="346" Body="&lt;p&gt;&lt;code&gt;make-network-process&lt;/code&gt; fails on Emacs25 (25.1.50.2 2016-07-03) when loaded with &lt;code&gt;-q&lt;/code&gt; and &lt;code&gt;-Q&lt;/code&gt; and trying to eval the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-network-process&#xA; :name &quot;*server2*&quot;&#xA; :type nil ; stream&#xA; :server t&#xA; :host 'local&#xA; :service t&#xA; :family nil&#xA; :nowait t&#xA; :stop nil&#xA; :noquery t)&#xA;&#xA;;; Debugger entered--Lisp error: (file-error &quot;make server process failed&quot; &quot;Success&quot; :name &quot;*server2*&quot; :type nil :server t :host local :service t :family nil :nowait t :stop nil :noquery t)&#xA;;; make-network-process(:name &quot;*server2*&quot; :type nil :server t :host local :service t :family nil :nowait t :stop nil :noquery t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same example works on Emacs 24.  This same issue is referenced here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/38188397/emacs-make-network-process-fails-how-to-debug&quot;&gt;https://stackoverflow.com/questions/38188397/emacs-make-network-process-fails-how-to-debug&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/ahungry/geben/issues/4&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/ahungry/geben/issues/4&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is this an Emacs bug?  Is there a workaround?&lt;/p&gt;&#xA;" OwnerUserId="256" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-07-12T14:51:27.103" Title="make-network-process fails in Emacs 25" Tags="|process|networking|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24549" PostTypeId="1" AcceptedAnswerId="24631" CreationDate="2016-07-12T08:47:11.470" Score="0" ViewCount="657" Body="&lt;p&gt;working on Red Hat Gnome 2.16.0 (pretty old, I guess).&#xA;Whenever I launch emacs 24.4.1, i keep getting these warnings&#xA;popping on the terminal I launched it from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody either point me to a possible cause of the issue,&#xA;or suggest how to turn these warnings off?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They tend to clog my terminal...&lt;/p&gt;&#xA;" OwnerUserId="9642" LastEditorUserId="253" LastEditDate="2016-07-12T13:49:40.593" LastActivityDate="2016-07-15T20:23:44.863" Title="(emacs:28245): GLib-GObject-WARNING **: IA__g_object_notify: object class `GtkMenuItem' has no property named `label'" Tags="|warning|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24550" PostTypeId="1" AcceptedAnswerId="24560" CreationDate="2016-07-12T08:59:25.107" Score="0" ViewCount="161" Body="&lt;p&gt;Is it possible to write a function with completion that act on region?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A mix of:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun function-style (style)&#xA;  (interactive&#xA;   (list&#xA;    (completing-read &quot;Style: &quot; styles-list)))&#xA;     ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun function-style (beg end)&#xA;      (interactive &quot;r&quot;)&#xA;       ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="253" LastEditDate="2016-07-12T13:48:47.343" LastActivityDate="2016-07-12T13:48:47.343" Title="defun completion and region" Tags="|region|completing-read|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24551" PostTypeId="1" AcceptedAnswerId="24554" CreationDate="2016-07-12T09:13:35.753" Score="1" ViewCount="1247" Body="&lt;p&gt;Some existing functions have ability to remember last input, which you can use in the next command call - for example, &lt;code&gt;replace-string&lt;/code&gt; will suggest the last replacement by default, while &lt;code&gt;isearch&lt;/code&gt; will look for the thing you searched for last, after pressing the combination once again. How can I achieve the same effect as in &lt;code&gt;replace-string&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="105" LastEditDate="2016-07-12T14:48:42.133" LastActivityDate="2016-07-12T14:48:42.133" Title="How to reuse last input in command with a prompt?" Tags="|interactive|commands|history-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24552" PostTypeId="1" AcceptedAnswerId="24556" CreationDate="2016-07-12T09:49:16.267" Score="9" ViewCount="2359" Body="&lt;p&gt;I'm using PDF-Tools (&lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/politza/pdf-tools&lt;/a&gt;) to display PDFs inside Emacs. But how to print them? C-c C-p raises the question »Print with:« and I have no idea how to answer it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a solution to print the pdf, not the buffer, if this makes a difference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My PC is inside a LAN and there are several printers available. I'm on Linux (openSuse Tumbleweed). &lt;/p&gt;&#xA;" OwnerUserId="2334" LastActivityDate="2016-07-12T10:16:47.277" Title="How to print a PDF, displayed with pdf-tools, from Emacs?" Tags="|pdf-tools|print|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24553" PostTypeId="2" ParentId="24546" CreationDate="2016-07-12T10:01:04.613" Score="0" Body="&lt;p&gt;There is &lt;a href=&quot;https://melpa.org/#/?q=sudo&quot; rel=&quot;nofollow&quot;&gt;packages&lt;/a&gt; that gives some utilities functions for this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;sudo-edit&lt;/code&gt; for &lt;em&gt;opening buffers as root&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;dired-toggle-sudo&lt;/code&gt; for switching &lt;em&gt;from current user to sudo when browsind dired buffers&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also see the &lt;a href=&quot;https://emacs.stackexchange.com/questions/52/edit-file-with-super-user-rights&quot;&gt;Edit file with super-user rights&lt;/a&gt; question.&lt;/p&gt;&#xA;" OwnerUserId="119" LastActivityDate="2016-07-12T10:01:04.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24554" PostTypeId="2" ParentId="24551" CreationDate="2016-07-12T10:05:46.873" Score="3" Body="&lt;p&gt;You could use &lt;code&gt;read-string&lt;/code&gt; and give they default value &lt;code&gt;def-say-word&lt;/code&gt; and save in later.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq def-say-word &quot;default value&quot;)&#xA;&#xA;(defun say-word (word)&#xA;  (interactive&#xA;   (list (read-string (format &quot;Say word [%s]: &quot; def-say-word) nil nil def-say-word)))&#xA;   (setq def-say-word word)&#xA;   (message &quot;The word is %s&quot; word))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-07-12T12:38:28.120" LastActivityDate="2016-07-12T12:38:28.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24555" PostTypeId="2" ParentId="24552" CreationDate="2016-07-12T10:15:13.690" Score="1" Body="&lt;p&gt;&lt;code&gt;Print with:&lt;/code&gt; asks you for a command to print with.  In most Linux distros you could use &lt;code&gt;lp&lt;/code&gt; or &lt;code&gt;lpr&lt;/code&gt; command to send files to printer.  More about &lt;code&gt;lp&lt;/code&gt;: &lt;a href=&quot;http://linux.die.net/man/1/lp&quot; rel=&quot;nofollow&quot;&gt;http://linux.die.net/man/1/lp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-07-12T10:15:13.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24556" PostTypeId="2" ParentId="24552" CreationDate="2016-07-12T10:16:47.277" Score="6" Body="&lt;p&gt;You need to set the variable &lt;code&gt;pdf-misc-print-programm&lt;/code&gt; and possibly also &lt;code&gt;pdf-misc-print-programm-args&lt;/code&gt; in the &lt;code&gt;pdf-misc&lt;/code&gt; customisation group. They should be set to the system command that you will print your document with, and that program must be installed on your system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;lpr&lt;/code&gt;, with the settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(pdf-misc-print-programm &quot;/usr/bin/lpr&quot;) &#xA;'(pdf-misc-print-programm-args (quote (&quot;-o media=Letter&quot; &quot;-o fitplot&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-12T10:16:47.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24557" PostTypeId="2" ParentId="24519" CreationDate="2016-07-12T10:49:25.487" Score="8" Body="&lt;p&gt;Some packages managers provides two different Emacs, &lt;code&gt;emacs&lt;/code&gt; and &lt;code&gt;emacs-nox&lt;/code&gt;. The core is the same and behave in a very similar way. The &lt;code&gt;nox&lt;/code&gt; version (&lt;em&gt;no X&lt;/em&gt; means &lt;em&gt;without &lt;a href=&quot;https://en.wikipedia.org/wiki/X_Window_System&quot; rel=&quot;nofollow noreferrer&quot;&gt;X11&lt;/a&gt; support&lt;/em&gt;) and should be installed on systems that don't provide a X Window System. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These &lt;code&gt;nox&lt;/code&gt; versions are compiled without support of X11. The standalone version can be run in the terminal using &lt;code&gt;emacs --no-window&lt;/code&gt; or &lt;code&gt;emacs -nw&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;nox&lt;/code&gt; version of Emacs is often used in servers system administration or for people who needs to run Emacs on a powerful computer for fastest processing. You connect to the server through your favorite SSH client and then you run Emacs &lt;em&gt;on the server&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another use case of &lt;code&gt;nox&lt;/code&gt; is saving the installation of all the necessary dependencies needed by the graphical version. Emacs also got a sound server in it's dependencies list. Some also prefers to use it only in terminal, for example, I did it during some years to force myself to learn more shortcuts and functions. &lt;/p&gt;&#xA;" OwnerUserId="119" LastEditorUserId="119" LastEditDate="2018-10-24T10:34:55.973" LastActivityDate="2018-10-24T10:34:55.973" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="24558" PostTypeId="2" ParentId="24519" CreationDate="2016-07-12T11:49:58.813" Score="5" Body="&lt;p&gt;They differ by the calling environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Small dictionary:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs &lt;em&gt;frame&lt;/em&gt; - what ordinary people call &lt;em&gt;window&lt;/em&gt;.&#xA;Emacs &lt;em&gt;window&lt;/em&gt; - a place in Emacs where you see some buffer(start emacs, and run &lt;code&gt;C-x 2&lt;/code&gt; to see one window split into two windows).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you open emacs in your Window Manager/Desktop Environment, the Emacs creates a new emacs frame. It is managed by X system, and therefore interacts with you(user) through it; this means that you can have some nice features like menus, or mouse pointer - since Emacs recognizes that its called from X system, and opens a more feature-rich version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, you can run Emacs in terminal, which means that you won't have access to some features(because of limitations of terminal), but it's full-fledged Emacs nevertheless. One trick though; by default, the terminal version is limited in colours. Should you wish to increase color range, you need to include the following line in your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;export TERM=xterm-256color&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Emacs core is the same; it's the interface that changes. You can run emacs daemon, and then connect from both GUI and CLI; both will have their full potential enabled.&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2016-07-12T11:49:58.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24560" PostTypeId="2" ParentId="24550" CreationDate="2016-07-12T12:34:12.233" Score="1" Body="&lt;p&gt;You can use any elisp functions to generate the arguments for an &lt;code&gt;interactive&lt;/code&gt; call. The code you use should return a list that matches the function arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-function (beg end style)&#xA;  (interactive&#xA;   (let ((string (completing-read &quot;Style: &quot; styles-list)))&#xA;     (list (region-beginning) (region-end) string)))&#xA;  &amp;lt;function body&amp;gt; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the the manual node &lt;a href=&quot;https://ftp.gnu.org/old-gnu/Manuals/elisp-manual-21-2.8/html_node/elisp_288.html&quot; rel=&quot;nofollow&quot;&gt;(elisp) Using Interactive&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-12T12:34:12.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24561" PostTypeId="1" AcceptedAnswerId="24640" CreationDate="2016-07-12T12:43:35.463" Score="0" ViewCount="55" Body="&lt;p&gt;I wannt to replace a specific word in multiple files. First time i do &quot;C-c c&quot; everything works fine, but when i repeat the command the text is not updated in the newly created files correctly. The files contain same content as the first pair of files(.cpp, .h). I think it is a buffer issue in replace-word-in-string but i dont know how to fix it? &#xA;I'm a beginner at Elisp please explain in simple terms, thanks for helping me out. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;Prototype source&#xA;(setq sourceCode &quot;//Include Librarys&#xA;#include MyClass&#xA;&#xA;//Include Files&#xA;&#xA;&#xA;//******&#xA;//MyClass::MyClass&#xA;//******&#xA;MyClass::MyClass() {}&#xA;&#xA;//******&#xA;//MyClass::~MyClass&#xA;//******&#xA;MyClass::~MyClass() {}&#xA;&#xA;&quot;)&#xA;&#xA;;;Prototype Header&#xA;(setq headerCode &quot;#ifndef MYCLASS&#xA;#define MYCLASS&#xA;&#xA;//Include Librarys&#xA;&#xA;//Include Files&#xA;&#xA;&#xA;//Forward declarations&#xA;&#xA;&#xA;class MyClass {&#xA;public:&#xA; MyClass();&#xA; ~MyClass();&#xA;&#xA;private:&#xA;&#xA;};&#xA;&#xA;#endif //!MyClass&#xA;&quot;)&#xA;&#xA;;;Create CLASS&#xA;(global-set-key (kbd &quot;C-c c&quot;)&#xA;   (defun create-class (directory name)&#xA;    (interactive &quot;s(Create a new class) Enter path: &#xA;    sEnter class name: &quot;)&#xA;&#xA;    (setq directory &quot;c:/Programming/&quot;) ;only for degugging&#xA;    (setq path (concat directory name))&#xA;    (setq pathSource (concat path &quot;.cpp&quot;))&#xA;    (setq pathHeader (concat path &quot;.h&quot;))&#xA;&#xA;    ;Replace default class name with user specified class name&#xA;    (setq sourceCode (replace-word-in-string sourceCode name &quot;MyClass&quot;))&#xA;&#xA;    (setq headerCode (replace-word-in-string headerCode name &quot;MyClass&quot;))&#xA;&#xA;    ;Check if file exist in current directory&#xA;    (if (and (file-exists-p pathSource)(file-exists-p pathHeader))&#xA;      (message &quot;%s&quot; &quot;Filename already exist, no files where created!&quot;)&#xA;      (write-region sourceCode nil pathSource) ;Write to files.&#xA;      (write-region headerCode nil pathHeader)&#xA;      (message &quot;Created source file: %s and created header file: %s&quot; pathSource pathHeader)&#xA;    )&#xA;  )&#xA;) &#xA;&#xA;(defun replace-word-in-string(string replacementWord searchedWord)&#xA;    (with-temp-buffer&#xA;      (insert string)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward searchedWord nil t)&#xA;        (replace-match replacementWord nil t)&#xA;      (setq retString (buffer-string)) ;returns all content in buffer as a   string&#xA;      )&#xA;   )&#xA;retString&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12625" LastEditorUserId="105" LastEditDate="2016-07-12T14:38:05.430" LastActivityDate="2016-07-16T14:55:23.167" Title="Replace word causes buffer issue" Tags="|search|replace|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24563" PostTypeId="1" AcceptedAnswerId="24564" CreationDate="2016-07-12T13:44:17.437" Score="4" ViewCount="1010" Body="&lt;p&gt;I was wondering if anyone has ever looked at a way to switch back to normal mode automatically after inaction?  In Vim, there are several methods to do that, such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://vim.wikia.com/wiki/To_switch_back_to_normal_mode_automatically_after_inaction&quot; rel=&quot;nofollow&quot;&gt;http://vim.wikia.com/wiki/To_switch_back_to_normal_mode_automatically_after_inaction&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-07-12T14:06:44.113" LastActivityDate="2016-07-12T14:06:44.113" Title="evil mode: switch back to normal mode automatically after inaction" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24564" PostTypeId="2" ParentId="24563" CreationDate="2016-07-12T14:05:41.910" Score="4" Body="&lt;p&gt;The following function and idle timer will force evil back into&#xA;normal state in all buffers after an idle delay of 30 seconds&#xA;(which you can adjust as you like):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun evil-normalize-all-buffers ()&#xA;  &quot;Force a drop to normal state.&quot;&#xA;  (unless (eq evil-state 'normal)&#xA;    (dolist (buffer (buffer-list))&#xA;      (set-buffer buffer)&#xA;      (unless (or (minibufferp)&#xA;                  (eq evil-state 'emacs))&#xA;        (evil-force-normal-state)))&#xA;    (message &quot;Dropped back to normal state in all buffers&quot;)))&#xA;&#xA;(defvar evil-normal-timer&#xA;  (run-with-idle-timer 30 t #'evil-normalize-all-buffers)&#xA;  &quot;Drop back to normal state after idle for 30 seconds.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-12T14:05:41.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24565" PostTypeId="2" ParentId="24551" CreationDate="2016-07-12T14:45:29.040" Score="4" Body="&lt;p&gt;Commands that read input from the minibuffer use functions such as &lt;code&gt;completing-read&lt;/code&gt;, &lt;code&gt;read-string&lt;/code&gt;, &lt;code&gt;read-regexp&lt;/code&gt;, etc. The most general of these is &lt;code&gt;read-from-minibuffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All such functions take a &lt;code&gt;HISTORY&lt;/code&gt; argument, which is a variable whose value is a list of previous inputs read by the function.  If &lt;code&gt;HISTORY&lt;/code&gt; is absent or &lt;code&gt;nil&lt;/code&gt; then usually the variable is understood to be &lt;code&gt;minibuffer-history&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you just provide the variable you want, to get the behavior you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a user, to get to previous inputs when reading a new input, you use &lt;strong&gt;&lt;code&gt;M-p&lt;/code&gt;&lt;/strong&gt; (or &lt;code&gt;M-n&lt;/code&gt;), which you can repeat to go farther back in the given history list.  Or you can use &lt;strong&gt;&lt;code&gt;M-r&lt;/code&gt;&lt;/strong&gt; (or &lt;code&gt;M-s&lt;/code&gt;) to search the history list for a match to a regular expression that you type at the prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer-History.html&quot; rel=&quot;nofollow&quot;&gt;Minibuffer History&lt;/a&gt; and the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Minibuffer-History.html&quot; rel=&quot;nofollow&quot;&gt;Minibuffer History&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-12T14:45:29.040" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24568" PostTypeId="1" CreationDate="2016-07-12T18:02:36.797" Score="3" ViewCount="245" Body="&lt;p&gt;I use &lt;code&gt;appt&lt;/code&gt; to remind me of my upcoming appointments (which I keep in an &lt;code&gt;org-mode&lt;/code&gt; file).  Under this setup, my computer beeps five minutes before the beginning of the next appointment (see setup &lt;a href=&quot;https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way change the warning time on a per-appointment basis? (e.g., if I have a meeting in a different building I would like to set up a 20-minute warning; for most other meetings, a 5-minute warning is fine).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine nice solutions to this would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Including the warning time in the &lt;code&gt;org-mode&lt;/code&gt; timestamp (e.g., &lt;code&gt;&amp;lt;2016-07-12 Tue 16:15-20&amp;gt;&lt;/code&gt; would mean beep 20 minutes before the meeting), or&lt;/li&gt;&#xA;&lt;li&gt;Associating a tag to a given warning time (e.g., items tagged &lt;code&gt;:far:&lt;/code&gt; would beep 20 minutes before the meeting).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to accomplish something like this? &lt;/p&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-24T15:03:33.450" Title="change warning time on a per appointment basis" Tags="|org-mode|appt|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24569" PostTypeId="1" AcceptedAnswerId="24570" CreationDate="2016-07-12T18:12:32.243" Score="1" ViewCount="482" Body="&lt;p&gt;All I'm trying to do is to create a slideshow presentation from Org mode.&lt;br /&gt;&#xA;As everyone does, I &lt;a href=&quot;https://www.google.com/webhp?sourceid=chrome-instant&amp;amp;ion=1&amp;amp;espv=2&amp;amp;ie=UTF-8#q=ppt%20with%20org%20mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;googled&lt;/a&gt; to get a few links.&lt;br /&gt;&#xA;I followed &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/non-beamer-presentations.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this link&lt;/a&gt; to write Non-Beamer presentations, as I thought presenting over a web browser would be a cool thing to do (maximum portability).&lt;br /&gt;&#xA;I chose to go with&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;org-html5presentation&lt;/p&gt;&#xA;&lt;p&gt;Is an Exporter of Org-mode documents to HTML5 slide show presentations. (see gist.github.com/509761 for code and usage information)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Even though the instructions are simple as follows:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First of all, check your Org-mode version. Note: This library has&#xA;been tested on Org-mode 8.2.5h. M-x org-version&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Get org-html5presentation.el. For example,&lt;br /&gt;&#xA;git clone &lt;a href=&quot;https://github.com/kinjo/org-html5presentation.el.git&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/kinjo/org-html5presentation.el.git&lt;/a&gt; \&lt;br /&gt;&#xA;~/org-html5presentation.el&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add following to ~/.emacs.d/init.el and reboot emacs.&lt;br /&gt;&#xA;(add-to-list 'load-path &amp;quot;~/org-html5presentation.el&amp;quot;)&lt;br /&gt;&#xA;(require 'ox-html5presentation)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I did not know how to do &lt;strong&gt;Step-2&lt;/strong&gt; above&lt;br /&gt;&#xA;I copy pasted the &lt;em&gt;org-html5presentation.el&lt;/em&gt; lisp code into file with name &lt;em&gt;org-html5presentation.el&lt;/em&gt; and saved it in some folder and added the path as requested in &lt;strong&gt;Step-3&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Nothing has worked so far. I get the error &lt;strong&gt;&amp;quot;Cannot open load file :org-html5presentation&amp;quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;What am I missing here?&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-07-12T22:01:39.400" Title="Create a presentation from Org mode" Tags="|org-mode|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24570" PostTypeId="2" ParentId="24569" CreationDate="2016-07-12T18:44:28.930" Score="1" Body="&lt;p&gt;&lt;code&gt;load-path&lt;/code&gt; is the list of directories, not files.  If you want to add this file, use in &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;~/org-html5presentation.el&quot;)&#xA;(require 'ox-html5presentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Better way is to put the file into &lt;code&gt;~/emacs.d/org-html5presentation/org-html5presentation.el&lt;/code&gt; and then put the &lt;code&gt;~/.emacs.d/org-html5presentation/&lt;/code&gt; into &lt;code&gt;load-path&lt;/code&gt; writing in &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/org-html5presentation/&quot;)&#xA;(require 'ox-html5presentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or load just one file with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;~/.emacs.d/org-html5presentation/org-html5presentation.el&quot;)&#xA;(require 'ox-html5presentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-07-12T18:52:49.533" LastActivityDate="2016-07-12T18:52:49.533" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24571" PostTypeId="1" CreationDate="2016-07-12T20:48:23.780" Score="0" ViewCount="1072" Body="&lt;p&gt;I'm updating my Ubuntu distro to LTS 16.04 release.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I followed the instructions given at &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow&quot;&gt;irony mode in github&lt;/a&gt; and &lt;a href=&quot;https://github.com/Sarcasm/company-irony&quot; rel=&quot;nofollow&quot;&gt;company irony in github&lt;/a&gt; in order to get autocompletion features in Emacs. For both packages, I have put the given configuration into &lt;code&gt;.emacs&lt;/code&gt; file located in my home directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when I open a &lt;code&gt;C++&lt;/code&gt; file, the Emacs status bar indicates &lt;code&gt;C++/l Irony Abbrev&lt;/code&gt; message. So, deduce that Emacs has understood something related to &lt;code&gt;ironic&lt;/code&gt; mode. However, until now I cannot appreciate some autocompletion behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, after doing some searches without getting a solution, I would want to ask to this forum for some clue or help. What should I revise? Is there some specific step for Ubuntu 16.04?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: this is the content of my &lt;code&gt;init.el&lt;/code&gt; file in the &lt;code&gt;.emacs.d&lt;/code&gt; directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (&amp;gt;= emacs-major-version 24)&#xA;  (require 'package)&#xA;  (add-to-list&#xA;   'package-archives&#xA;   '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;   t)&#xA;  (package-initialize))&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(custom-enabled-themes (quote (manoj-dark))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&#xA;(add-hook 'c++-mode-hook 'irony-mode)&#xA;(add-hook 'c-mode-hook 'irony-mode)&#xA;(add-hook 'objc-mode-hook 'irony-mode)&#xA;&#xA;;; replace the `completion-at-point' and `complete-symbol' bindings in&#xA;;; irony-mode's buffers by irony-mode's function&#xA;(defun my-irony-mode-hook ()&#xA;  (define-key irony-mode-map [remap completion-at-point]&#xA;    'irony-completion-at-point-async)&#xA;  (define-key irony-mode-map [remap complete-symbol]&#xA;    'irony-completion-at-point-async))&#xA;(add-hook 'irony-mode-hook 'my-irony-mode-hook)&#xA;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The directory &lt;code&gt;.emacs.d&lt;/code&gt; contains a subdir called &lt;code&gt;elpa&lt;/code&gt; which contains another subdir &lt;code&gt;irony-20160628.1329&lt;/code&gt; where I suppose is installed &lt;code&gt;irony&lt;/code&gt; mode.&lt;/p&gt;&#xA;" OwnerUserId="12628" LastEditorUserId="12628" LastEditDate="2016-07-13T13:01:44.617" LastActivityDate="2016-10-21T22:00:37.557" Title="irony mode not working in ubuntu 16.04" Tags="|auto-complete-mode|c++|irony-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24572" PostTypeId="2" ParentId="24453" CreationDate="2016-07-12T21:17:35.933" Score="48" Body="&lt;p&gt;IPython 5 has a new terminal interface, which is not compatible with Emacs' inferior shells. To fix it, add the &lt;code&gt;--simple-prompt&lt;/code&gt; flag to the IPython command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter &quot;ipython&quot;&#xA;    python-shell-interpreter-args &quot;--simple-prompt -i&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The new interface is not compatible with Emacs ‘inferior-shell’ feature. To continue using this, add the &lt;code&gt;--simple-prompt&lt;/code&gt; flag to the command Emacs runs. This flag disables most IPython features, relying on Emacs to provide things like tab completion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;http://ipython.readthedocs.io/en/stable/whatsnew/version5.html#id1&quot;&gt;http://ipython.readthedocs.io/en/stable/whatsnew/version5.html#id1&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2835" LastEditorUserId="2835" LastEditDate="2016-07-17T02:49:23.840" LastActivityDate="2016-07-17T02:49:23.840" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="24573" PostTypeId="1" CreationDate="2016-07-12T21:27:33.167" Score="1" ViewCount="342" Body="&lt;p&gt;How do I make &lt;code&gt;ae&lt;/code&gt; in evil insert mode produce &lt;code&gt;æ&lt;/code&gt;?&#xA;This would be the equivalent of &lt;code&gt;inoremap ae æ&lt;/code&gt; in vim.&#xA;(I tried&#xA;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;ae&quot;) (kbd &quot;\C-kae&quot;))&lt;/code&gt;,&#xA;but after this typing &lt;code&gt;a&lt;/code&gt; (without an &lt;code&gt;e&lt;/code&gt; after it) didn't &#xA;produce an &lt;code&gt;a&lt;/code&gt;, but rather the error &lt;code&gt;a is undefined&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2016-07-13T00:27:15.730" LastActivityDate="2016-07-29T10:20:01.473" Title="Evil equivalent of imap" Tags="|evil|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24574" PostTypeId="1" CreationDate="2016-07-12T22:26:14.307" Score="11" ViewCount="2308" Body="&lt;p&gt;I want org-mode to default to alt-enter when under bullets, so that for bullets I can just press enter to make a new bullet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for instance:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Banana&lt;/li&gt;&#xA;&lt;li&gt;Apple&lt;/li&gt;&#xA;&lt;li&gt;Kiwi [MOUSE CURSOR HERE]&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When I press enter, I want the following behavior (which happens when I press M-enter):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Banana&lt;/li&gt;&#xA;&lt;li&gt;Apple&lt;/li&gt;&#xA;&lt;li&gt;Kiwi&lt;/li&gt;&#xA;&lt;li&gt;[MOUSE CURSOR HERE]&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Instead of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Banana&lt;/li&gt;&#xA;&lt;li&gt;Apple&lt;/li&gt;&#xA;&lt;li&gt;Kiwi&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;[MOUSE CURSOR HERE]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is the default for most other applications, but why not for org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would greatly improve my workflow. But I don't know how! Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="12632" LastActivityDate="2017-04-13T06:08:37.953" Title="Org Mode Default to Alt-Enter for Bullets" Tags="|org-mode|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24575" PostTypeId="1" AcceptedAnswerId="24664" CreationDate="2016-07-13T01:21:40.430" Score="1" ViewCount="255" Body="&lt;p&gt;Today I'm trying out ERT for the first time.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(should-error (/ 1 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works and returns &lt;code&gt;(arith-error)&lt;/code&gt; as expected.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(should-error (cl-assert nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The assertion escapes the &lt;code&gt;should-error&lt;/code&gt; and causes a stack trace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the appropriate thing to do if I want to test code that uses &lt;code&gt;cl-assert&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2016-07-18T18:04:39.953" Title="ERT: should-error doesn't catch failed assertions" Tags="|ert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24576" PostTypeId="2" ParentId="24574" CreationDate="2016-07-13T07:23:34.947" Score="0" Body="&lt;p&gt;You can do it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun my/org-list-new-item ()&#xA;   (interactive)&#xA;   (if (org-in-item-p) (org-insert-heading) (org-return)))&#xA; (define-key org-mode-map (kbd &quot;RET&quot;) 'my/org-list-new-item)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I really do not recommend to use it like this. &lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-07-13T07:23:34.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24577" PostTypeId="1" AcceptedAnswerId="24626" CreationDate="2016-07-13T07:53:25.883" Score="0" ViewCount="937" Body="&lt;p&gt;I am a beginner using spacemacs and also new to emacs.&#xA;What I try is to use the command &lt;code&gt;M-x R new RET&lt;/code&gt; (dired-do-rename).&#xA;Though everytime I type &lt;code&gt;M-x&lt;/code&gt;, which is the same as &lt;code&gt;SPC :&lt;/code&gt; I end up with helm-M-x. My problem is that I would like to use just the letter &lt;code&gt;R&lt;/code&gt; now instead of typing e.g. &lt;code&gt;renam&lt;/code&gt; to get the dired-do-rename command.&#xA;Is there a possibility to avoid helm-M-x when I know the shortcut (&lt;code&gt;M-x R new RET&lt;/code&gt;in this case)? &lt;/p&gt;&#xA;" OwnerUserId="12637" LastActivityDate="2016-07-15T13:20:14.980" Title="Move folder using spacemacs with emacs command" Tags="|dired|spacemacs|m-x|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24578" PostTypeId="1" AcceptedAnswerId="24579" CreationDate="2016-07-13T09:10:33.890" Score="2" ViewCount="289" Body="&lt;p&gt;I have assigned C-c C-g to rgrep, this works fine, however I am still in the buffer I was in and not in the &lt;em&gt;grep&lt;/em&gt; buffer which loads the results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After hitting C-c C-g and running rgrep, I want to be in the &lt;em&gt;grep&lt;/em&gt; buffer how do I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried writing a new function&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun rgrep-switch() &#xA;   (interactive)&#xA;   (rgrep)&#xA;   (switch-to-buffer &quot;*grep*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this is throwing an error.&lt;/p&gt;&#xA;" OwnerUserId="12639" LastEditorUserId="8842" LastEditDate="2016-07-13T19:49:29.317" LastActivityDate="2018-11-16T20:01:08.417" Title="Switch to *grep* buffer after running rgrep" Tags="|rgrep|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24579" PostTypeId="2" ParentId="24578" CreationDate="2016-07-13T09:32:04.600" Score="4" Body="&lt;p&gt;You're getting an error because you're calling &lt;code&gt;rgrep&lt;/code&gt; with no arguments. In this case you clearly want to obtain the arguments interactively, so you can use &lt;code&gt;call-interactively&lt;/code&gt; to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also sounds like you wanted to select the window with the grep results, rather than switch to the grep results in the current window?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun rgrep-switch() &#xA;  &quot;Call `rgrep' and select its window.&quot;&#xA;  (interactive)&#xA;  (call-interactively 'rgrep)&#xA;  (select-window (get-buffer-window &quot;*grep*&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-07-13T09:32:04.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24580" PostTypeId="2" ParentId="22736" CreationDate="2016-07-13T10:59:09.263" Score="3" Body="&lt;p&gt;It happens because doc-view was added to &lt;code&gt;mailcap-mime-data&lt;/code&gt;; I am using&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ensc/mailcap-mime-data-filter (filter)&#xA;  &quot;&quot;&#xA;  (mapcar (lambda(major)&#xA;        (append (list (car major))&#xA;            (remove nil&#xA;                (mapcar (lambda(minor)&#xA;                      (when (funcall filter (car major) (car minor) (cdr minor))&#xA;                    minor))&#xA;                    (cdr major)))))&#xA;      mailcap-mime-data))&#xA;&#xA;(defun ensc/no-pdf-doc-view-filter (major minor spec)&#xA;  (if (and (string= major &quot;application&quot;)&#xA;       (string= minor &quot;pdf&quot;)&#xA;       (member '(viewer . doc-view-mode) spec))&#xA;      nil&#xA;    t))&#xA;&#xA;(eval-after-load 'mailcap&#xA;  '(progn&#xA;     (setq mailcap-mime-data&#xA;       (ensc/mailcap-mime-data-filter 'ensc/no-pdf-doc-view-filter))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to remove corresponding entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does not solve only the &lt;code&gt;org-mode&lt;/code&gt; problem but allows e.g. to display PDFs in &lt;code&gt;gnus&lt;/code&gt; using an external viewer.&lt;/p&gt;&#xA;" OwnerUserId="12640" LastEditorUserId="8842" LastEditDate="2016-07-13T14:28:31.923" LastActivityDate="2016-07-13T14:28:31.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24581" PostTypeId="1" AcceptedAnswerId="24649" CreationDate="2016-07-13T13:46:14.563" Score="1" ViewCount="256" Body="&lt;p&gt;What I tried, putting at the end of a file:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;Local IspellDict: de&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As local variable: &lt;code&gt;speck-dictionary: de&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, neither is interpreted. When I open the file in question, &lt;code&gt;speck-mode&lt;/code&gt;&#xA;always uses &lt;code&gt;en&lt;/code&gt; as dictionary. The spell checker used is &lt;code&gt;hunspell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;What should I add to a file to change the dictionary of &lt;code&gt;speck-mode&lt;/code&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I use &lt;code&gt;speck-mode&lt;/code&gt; because &lt;code&gt;flyspell-mode&lt;/code&gt; is very slow on my&#xA;system.&lt;/p&gt;&#xA;" OwnerUserId="5327" LastActivityDate="2016-07-17T14:41:25.250" Title="How to save speck-mode dictionary with file?" Tags="|file-local-variables|ispell|spell-checking|hunspell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24582" PostTypeId="2" ParentId="23900" CreationDate="2016-07-13T13:57:25.600" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is that the expect behavior?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How could I tangle all the source blocks to single file (lisp/t.el)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Make all blocks consistent with :tangle yes or do not give the lisp/t.el optional target file in the batch mode. In short don't mix and match different tangle options for blocks in the same file and expect same output.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2016-07-13T14:05:20.193" LastActivityDate="2016-07-13T14:05:20.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24583" PostTypeId="2" ParentId="24436" CreationDate="2016-07-13T14:17:05.067" Score="2" Body="&lt;p&gt;&lt;code&gt;preview&lt;/code&gt; as an Emacs package depends on &lt;code&gt;preview&lt;/code&gt; as a LaTeX package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you generate previews, a line &lt;code&gt;\usepackage{preview}&lt;/code&gt; is automatically injected in your buffer before processing it with LaTeX, so that LaTeX generates the imagelets that will be inserted in your buffer instead of your whole document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;preview&lt;/code&gt; as a Latex package uses a set of defaults that are tailored for the most usual document classes and, so it happens, these defaults (as you've discovered) are no good for the &lt;code&gt;beamer&lt;/code&gt; document class...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All this is documented in the fine docs for &lt;code&gt;preview.sty&lt;/code&gt; (i.e., the file that is sourced from &lt;code&gt;\usepackage{preview}&lt;/code&gt;).  I access the docs using &lt;code&gt;texdoc preview&lt;/code&gt; (I use a TeXlive distribution) but if you cannot find the docs on your system &lt;a href=&quot;http://mirrors.ctan.org/macros/latex/contrib/preview/preview.pdf&quot; rel=&quot;nofollow&quot;&gt;they are available on CTAN&lt;/a&gt; too...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, what you want to do is loading explicitly the &lt;code&gt;preview&lt;/code&gt; LaTeX package in your document, so that you can pass to it options different from the default ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it is what works for me, you may want to modify the lists of environments to preview or not preview according to your needs. You must put these lines close to the end of the preamble in your file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% load preview.sty at the end please&#xA;\usepackage[displaymath,textmath,sections,graphics]{preview}&#xA;\PreviewEnvironment{align*}&#xA;\PreviewEnvironment{multline*}&#xA;\PreviewEnvironment{tabular}&#xA;\PreviewEnvironment{verbatim}&#xA;\PreviewEnvironment{lstlisting}&#xA;\PreviewEnvironment*{frame}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the last line, the starred command (different from previous ones) means &lt;strong&gt;&lt;em&gt;exclude&lt;/em&gt;&lt;/strong&gt; the &lt;code&gt;frame&lt;/code&gt; environment from the previewing.  Omitting this line will break previewing.&lt;/p&gt;&#xA;" OwnerUserId="9672" LastEditorUserId="9672" LastEditDate="2016-07-18T13:08:52.827" LastActivityDate="2016-07-18T13:08:52.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24584" PostTypeId="2" ParentId="23933" CreationDate="2016-07-13T15:07:45.680" Score="1" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-e&quot;) '(lambda () (interactive) (insert-char 234)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to get 234? Place your cursor on the letter &lt;code&gt;ê&lt;/code&gt; and press &lt;code&gt;C-x =&lt;/code&gt;. Modeline will show you the codes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Char: ê (234, #o352, #xea, file ...) point=3 of 27 (7%) column=0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-07-13T15:07:45.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24585" PostTypeId="2" ParentId="24377" CreationDate="2016-07-13T16:24:32.210" Score="2" Body="&lt;p&gt;After a little more looking around, I found:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/gregsexton/origami.el&quot; rel=&quot;nofollow&quot;&gt;Origami&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/zenozeng/yafolding.el&quot; rel=&quot;nofollow&quot;&gt;yafolding&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Which can do what I wanted (and possibly a little more). I haven't thoroughly tested them both out, but on first impression, yafolding is working the best so far on python.el.&lt;/p&gt;&#xA;" OwnerUserId="10657" LastActivityDate="2016-07-13T16:24:32.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24586" PostTypeId="1" CreationDate="2016-07-13T17:07:33.263" Score="0" ViewCount="546" Body="&lt;p&gt;It would be nice if I could paste a commands name into the helm minibuffer when I am using &lt;code&gt;describe-function&lt;/code&gt; and &lt;code&gt;find-function&lt;/code&gt; without typing. &#xA;Additionally I need the possibility to exclude certain bindings from this feature, that I use from within helm buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;I've tried this command:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(defun my-insert-command-name-on-key (key)&#xA;  (interactive &quot;kInsert function on key: &quot;)&#xA;  (insert (symbol-name (key-binding key))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work properly in helm buffers. Sometimes it pastes the name, but mostly it pastes &quot;undefined&quot;.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-07-19T14:16:57.970" LastActivityDate="2016-07-19T14:16:57.970" Title="how to paste a command's name into the helm minibuffer by using its binding?" Tags="|helm|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24587" PostTypeId="1" AcceptedAnswerId="24599" CreationDate="2016-07-13T18:37:26.067" Score="2" ViewCount="711" Body="&lt;p&gt;I am attempting add an additional &lt;code&gt;Flycheck&lt;/code&gt; syntax checker for &lt;code&gt;nxml-mode&lt;/code&gt;, however errors/warnings are not showing up even though the linter, &lt;code&gt;igor&lt;/code&gt;, is reporting errors/warnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the syntax checker definition.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-define-checker igor&#xA;  &quot;FreeBSD Documentation Project sanity checker.&#xA;&#xA;See URLs http://www.freebsd.org/docproj/ and &#xA;http://www.freshports.org/textproc/igor/.&quot;&#xA;  :command (&quot;igor&quot; &quot;-X&quot; source-original)&#xA;  :standard-input t&#xA;  :error-parser flycheck-parse-checkstyle&#xA;  :modes (nxml-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I made the new definition available for automatic selection.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'flycheck-checkers 'igor 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the major mode is &lt;code&gt;nxml-mode&lt;/code&gt;, I can run &lt;code&gt;flycheck-verify-setup&lt;/code&gt; to verify that &lt;code&gt;igor&lt;/code&gt; is listed as a checker.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Syntax checkers for buffer chapter.xml in nxml-mode:&#xA;&#xA;  xml-xmlstarlet&#xA;    - predicate:  t&#xA;    - executable: Found at /usr/local/bin/xml&#xA;&#xA;  xml-xmllint&#xA;    - predicate:  t&#xA;    - executable: Found at /usr/local/bin/xmllint&#xA;&#xA;  igor&#xA;    - predicate:  t&#xA;    - executable: Found at /usr/local/bin/igor&#xA;&#xA;Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled checkers.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run &lt;code&gt;flycheck-compile&lt;/code&gt; and chose &lt;code&gt;igor&lt;/code&gt;, I see errors/warnings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: compilation; default-directory: &quot;~/scm/nm/freebsd-docs.svn/doc/head/en_US.ISO8859-1/books/fdp-primer/editor-config/&quot; -*-&#xA;Compilation started at Wed Jul 13 15:12:14&#xA;&#xA;igor -X /home/jrm/scm/nm/freebsd-docs.svn/doc/head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml&#xA;&amp;lt;file name=&quot;/home/jrm/scm/nm/freebsd-docs.svn/doc/head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml&quot;&amp;gt;&#xA;  &amp;lt;error line=&quot;49&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;spelling&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;56&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;wrap long line&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;112&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;bad tag indent&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;114&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;bad tag indent&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;114&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;wrap long line&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;115&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;bad tag indent&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;115&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;wrap long line&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;119&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;wrap long line&quot; source=&quot;igor&quot; /&amp;gt;&#xA;  &amp;lt;error line=&quot;120&quot; column=&quot;1&quot; severity=&quot;warning&quot; message=&quot;blank line with whitespace&quot; source=&quot;igor&quot; /&amp;gt;&#xA;&amp;lt;/file&amp;gt;&#xA;&#xA;Compilation finished at Wed Jul 13 15:12:15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can get basic error checking using &lt;code&gt;:error-patterns&lt;/code&gt; instead of &lt;code&gt;:error-parser&lt;/code&gt; in the definition, so the problem may be related to parsing the checkstyle XML output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running the sixth pretest for the soon-to-be-released as Emacs 25.1.  What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="10479" LastEditorUserId="10479" LastEditDate="2016-07-13T18:51:10.300" LastActivityDate="2016-07-14T07:23:16.357" Title="New Flycheck syntax checker: Errors missing" Tags="|flycheck|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24588" PostTypeId="2" ParentId="24586" CreationDate="2016-07-13T18:47:43.297" Score="0" Body="&lt;p&gt;You can do it with a key macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start record key macro. &lt;code&gt;start-kbd-macro&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Move top.&lt;/li&gt;&#xA;&lt;li&gt;Copy first word (which should be the command name)&lt;/li&gt;&#xA;&lt;li&gt;Press M-x. (or whatever the helm version of it)&lt;/li&gt;&#xA;&lt;li&gt;Paste, hit enter&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;then, save the key macro by&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;M-x name-last-kbd-macro&lt;/li&gt;&#xA;&lt;li&gt;M-x insert-kbd-macro&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Put the code in your emacs init.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can now give it a keybinding too. e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f1&amp;gt;&quot;) 'my-super-cmd)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use helm, don't have it installed. But I tried the above, should work in general.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-07-13T18:47:43.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24590" PostTypeId="1" CreationDate="2016-07-13T19:53:12.583" Score="1" ViewCount="459" Body="&lt;p&gt;When I try to install ac-cider via &lt;code&gt;package-install&lt;/code&gt; or via &lt;code&gt;init.el&lt;/code&gt; I get the message &lt;a href=&quot;http://melpa-stable.milkbox.net/packages/popup-20160531.425.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://melpa-stable.milkbox.net/packages/popup-20160531.425.el&lt;/a&gt;: Not Found:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zN0M5.png&quot; alt=&quot;popup-20160531.425.el: Not Found&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;;; (add-to-list 'package-archives&#xA;;;              '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;) t)&#xA;;; (add-to-list 'package-archives&#xA;;;              '(&quot;tromey&quot; . &quot;http://tromey.com/elpa/&quot;) t)&#xA;;; (add-to-list 'package-archives&#xA;;;              '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;&#xA;(setq package-archives '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                         (&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;                         (&quot;melpa&quot; . &quot;http://melpa-stable.milkbox.net/packages/&quot;)))&#xA;&#xA;&#xA;;; Load and activate emacs packages. Do this first so that the&#xA;;; packages are loaded before you start trying to modify them.&#xA;;; This also sets the load path.&#xA;(package-initialize)&#xA;&#xA;;; Download the ELPA archive description if needed.&#xA;;; This informs Emacs about the latest versions of all packages, and&#xA;;; makes them available for download.&#xA;(when (not package-archive-contents)&#xA;  (package-refresh-contents))&#xA;&#xA;;; The packages you want installed. You can also install these&#xA;;; manually with M-x package-install&#xA;;; Add in your own as you wish:&#xA;(defvar my-packages&#xA;  '(ac-cider))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can this be fixed so that ac-cider is installed?&lt;/p&gt;&#xA;" OwnerUserId="11605" LastActivityDate="2016-07-28T01:22:46.277" Title="popup package not found when installing ac-cider package" Tags="|init-file|clojure|cider|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="24591" PostTypeId="1" AcceptedAnswerId="24595" CreationDate="2016-07-13T21:42:23.173" Score="1" ViewCount="85" Body="&lt;p&gt;The following code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key (copy-tree global-map) (kbd &quot;C-r&quot;) 'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Immediately remaps C-r to forward-char. My understanding is that copy-tree will return a deepcopy of global-map. So why does editing the resulting keymap with define-key change my current global map?&lt;/p&gt;&#xA;" OwnerUserId="6554" LastEditorUserId="105" LastEditDate="2016-07-13T22:47:48.637" LastActivityDate="2016-07-14T02:46:29.317" Title="copy-tree on global-map" Tags="|keymap|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24592" PostTypeId="1" AcceptedAnswerId="24687" CreationDate="2016-07-13T22:29:50.877" Score="1" ViewCount="1034" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jxXAb.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jxXAb.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;evil-vimish-fold&lt;/code&gt; is really great for custom folds. However it's not clear to me how you would accomplish syntax based folds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does &lt;code&gt;evil-vimish-fold&lt;/code&gt; work with &lt;code&gt;JavaScript mode&lt;/code&gt;? Can I set &lt;code&gt;evil-vimish-fold&lt;/code&gt;'s &lt;code&gt;foldmethod&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is what I would do in vim &lt;code&gt;ftplugin/javascript.vim&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;syntax region foldBraces start=/{/ end=/}/ transparent fold keepend extend&#xA;setlocal foldmethod=syntax&#xA;setlocal foldlevel=99&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11088" LastEditorUserId="253" LastEditDate="2016-07-19T16:53:48.863" LastActivityDate="2016-07-19T16:53:48.863" Title="evil-vimish-fold based on syntax" Tags="|evil|code-folding|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24593" PostTypeId="1" CreationDate="2016-07-13T23:36:27.490" Score="2" ViewCount="347" Body="&lt;p&gt;I run Emacs locally on my Windows machine, but edit everything remotely, via tramp &amp;amp; plink (PuTTY's implementation of ssh). This all works just fine, but, as I found out today, TAGS files for large projects do not work. It's not that these files are &lt;em&gt;that&lt;/em&gt; large - 12 Mb, in my case, a few thousand .cpp files, but still.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I load TAGS file with &lt;code&gt;visit-tags-table&lt;/code&gt; remotely, with &lt;code&gt;/plink:user@host:/home/user/project/TAGS&lt;/code&gt; path, my Emacs just hangs forever, eating 100% of one of the CPU cores. It does not happen for smaller files, these work just fine, but for larger ones in happened every time I tried.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I load it remotely, but with pscp, &lt;code&gt;/pscp:user@host:/home/user/project/TAGS&lt;/code&gt;, it just does not load, &lt;code&gt;tags-apropos&lt;/code&gt; shows no tags loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I copy the TAGS file to my local machine, &lt;code&gt;visit-tags-table&lt;/code&gt; load tags just fine, but when I use them, Emacs expects the files mentioned there to be where the TAGS file is, i.e. on my local machine. If I generate TAGS with relative paths, it would try to open &lt;code&gt;c:/emacs/home/path/file.h&lt;/code&gt;, if I use &lt;code&gt;--tag-relative=no&lt;/code&gt; when generating TAGS to obtain absolute paths, the path changes to &lt;code&gt;c:/home/user/project/path/file.h&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of these three fails the last one looks the most 'fixable' (for the first two I suspect some shady network configuration issues), but I have yet to find how to make a local TAGS file work for remote projects. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dirty hacks like changing all paths in TAGS with sed from &lt;code&gt;/home/...&lt;/code&gt; to &lt;code&gt;/plink:user@host:/home/...&lt;/code&gt; don't work, I tried (Emacs just tries to open &lt;code&gt;c:/plink!user@host!/home/...&lt;/code&gt; file in this case). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://emacs.stackexchange.com/questions/53/ctags-over-tramp&quot;&gt;this&lt;/a&gt; question someone offered rewriting a &lt;code&gt;etags-file-of-tag&lt;/code&gt; function from etags.el - this looks promising, but that does not work for me either (either this is a wrong function, or I'm doing something very wrong: no matter how I change that one, it doesn't seem to affect anything). Unfortunately, I have a quite limited understanding of elisp and how Emacs works in general, so I am stuck at the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really want TAGS to work for this project, so any ideas or advice will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="12646" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-12-11T04:35:19.047" Title="Load a large TAGS file from a remote host at a Windows machine" Tags="|tramp|ctags|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24594" PostTypeId="2" ParentId="24593" CreationDate="2016-07-14T00:01:45.077" Score="1" Body="&lt;p&gt;create multiple smaller TAGS in sub-directory instead of one big TAGS in root directory,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;insert below code into ~/.emacs,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tags-table-list &quot;~/proj/sub-dir1/TAGS&quot; &quot;~/proj/sub-dir2/TAGS&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's all you need to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, I don't like &lt;code&gt;visit-tags-table&lt;/code&gt; which basically just &lt;code&gt;(setq tags-file-name &quot;~/proj/TAGS&quot;)&lt;/code&gt;. To use &lt;code&gt;tags-table-list&lt;/code&gt;, &lt;code&gt;tags-file-name&lt;/code&gt; should be nil.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-07-14T00:07:16.060" LastActivityDate="2016-07-14T00:07:16.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24595" PostTypeId="2" ParentId="24591" CreationDate="2016-07-14T02:46:29.317" Score="3" Body="&lt;p&gt;&lt;code&gt;copy-tree&lt;/code&gt; only makes copies of the cons cells, not the arrays.  &lt;code&gt;global-map&lt;/code&gt; is a &quot;dense&quot; map, which implies it has an array (well, a char-table) inside where it stores the mapping for &quot;simple char&quot; bindings.  And &lt;code&gt;(kbd &quot;C-r&quot;)&lt;/code&gt; corresponds to a simple char binding, so it gets stored in the array (which was not copied by &lt;code&gt;copy-tree&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, you should basically never copy a keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead just make your new keymap inherit from &lt;code&gt;global-map&lt;/code&gt;, e.g. with &lt;code&gt;(defvar my-new-map (make-composed-keymap nil global-map))&lt;/code&gt;.  This map will start out identical to &lt;code&gt;global-map&lt;/code&gt; but you can then modify it all you want without affecting &lt;code&gt;global-map&lt;/code&gt; itself.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-14T02:46:29.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24596" PostTypeId="2" ParentId="24586" CreationDate="2016-07-14T04:02:55.760" Score="2" Body="&lt;p&gt;You could use the command &lt;code&gt;describe-key-briefly&lt;/code&gt; &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt; with a prefix arg &lt;kbd&gt;C-u&lt;/kbd&gt; (which inserts the text into the current buffer instead of just printing it), followed by the key sequence you want to paste the name of the command you just typed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you wanted to paste the command &lt;code&gt;save-buffer&lt;/code&gt; you would type &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; which would insert &lt;code&gt;C-x C-s runs the command save-buffer&lt;/code&gt; which is close, but not quite what you want since it has the extra text at the beginning that you'd have to delete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define the following function as advice to &lt;code&gt;describe-key-briefly&lt;/code&gt; so that any time I invoke it, the name of the command automatically gets added to the kill-ring so I can just hit &lt;kbd&gt;C-y&lt;/kbd&gt; to paste the last key that I described.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun describe-key-copy-as-kill (&amp;amp;optional key insert untranslated)&#xA;    (kill-new (format &quot;%s&quot; (key-binding key))))&#xA;(advice-add 'describe-key-briefly :after #'describe-key-copy-as-kill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2138" LastActivityDate="2016-07-14T04:02:55.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24597" PostTypeId="1" CreationDate="2016-07-14T05:33:36.170" Score="3" ViewCount="400" Body="&lt;p&gt;I have a function that gets called when idle, but I would like it to run only when a frame has input focus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current work around is to use &lt;code&gt;focus-in-hook&lt;/code&gt; and &lt;code&gt;focus-out-hook&lt;/code&gt; to change the behavior when idle, but I'd like to simplify it by just having one function that would check whether or not it had focus. Here's the code I am working with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package zone&#xA;  :ensure shut-up&#xA;  :commands (zone-when-idle)&#xA;  :bind (&quot;C-c z&quot; . zone)&#xA;  :init&#xA;  (setq zone-timeout 30)&#xA;  (defun zone-when-idle-and-focused ()&#xA;    &quot;Use with `focus-in-hook' to only zone when our focus is back in Emacs.&quot;&#xA;    (zone-when-idle (or zone-timeout 30)))&#xA;  (defun zone-nodoze ()&#xA;    &quot;Use with `focus-out-hook' so we don't zone when our focus is elsewhere.&quot;&#xA;    (let ((inhibit-message t)) (zone-leave-me-alone)))&#xA;  (add-hook 'focus-in-hook #'zone-when-idle-and-focused)&#xA;  (add-hook 'focus-out-hook #'zone-nodoze)&#xA;  (zone-when-idle zone-timeout))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2138" LastEditorUserId="2138" LastEditDate="2016-07-14T05:40:52.283" LastActivityDate="2023-07-20T17:06:55.897" Title="Determine if any frame has input focus?" Tags="|focus|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24598" PostTypeId="1" AcceptedAnswerId="24652" CreationDate="2016-07-14T06:16:02.980" Score="1" ViewCount="188" Body="&lt;p&gt;I want to use some variations of ignoring timestamp options in org-agenda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want to have custom agenda command enumerates&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;TODOs Scheduled today&lt;/li&gt;&#xA;&lt;li&gt;TODOs tagged some tag only within future 2 weeks &lt;/li&gt;&#xA;&lt;li&gt;all TODOs regardless of timestamps&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Are there some good way to realize this? (I imagine doing like let-ting org-agenda-ignore-* variables in each custom search options.)&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-07-17T15:48:51.213" Title="Switch ignore timestamp option dynamically in org-agenda" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24599" PostTypeId="2" ParentId="24587" CreationDate="2016-07-14T07:23:16.357" Score="2" Body="&lt;p&gt;As we've found out in our discussion in the comments, contrary to its manpage &lt;code&gt;igor&lt;/code&gt; does not create proper Checkstyle XML.  The XML document lacks the &lt;code&gt;checkstyle&lt;/code&gt; root tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flycheck's &lt;code&gt;flycheck-parse-checkstyle&lt;/code&gt; parser expects this root tag and thus fails to parse Igor's output.  It simply doesn't find the tags it's looking for and can't parse any errors from the XML document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to write a custom error parser.  As you've already found out that wrapping the &lt;code&gt;checkstyle&lt;/code&gt; tag around the output is sufficient, I'd just do exactly that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun flycheck-parse-igor (output checker buffer)&#xA;  (flycheck-parse-checkstyle (concat &quot;&amp;lt;checkstyle version=\&quot;7.0\&quot;&amp;gt;&quot;&#xA;                                     output&#xA;                                     &quot;&amp;lt;/checkstyle&amp;gt;&quot;)&#xA;                             checker buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use this function as &lt;code&gt;:error-parser&lt;/code&gt; you should see errors from &lt;code&gt;igor&lt;/code&gt; in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Please also take the time to report this issue to the developers of &lt;code&gt;igor&lt;/code&gt; and ask them to either add the &lt;code&gt;checkstyle&lt;/code&gt; tag to their output or change the manpage.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-07-14T07:23:16.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24600" PostTypeId="2" ParentId="22371" CreationDate="2016-07-14T09:15:24.500" Score="2" Body="&lt;pre&gt;&lt;code&gt;(setq system-time-locale &quot;C&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this may generate english date format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;according to this : &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Locales.html#Locales&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Locales.html#Locales&lt;/a&gt; &#xA;locales will affect &lt;code&gt;format-time-string&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;wish can help.&lt;/p&gt;&#xA;" OwnerUserId="8466" LastActivityDate="2016-07-14T09:15:24.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24601" PostTypeId="1" AcceptedAnswerId="24617" CreationDate="2016-07-14T10:22:49.273" Score="1" ViewCount="102" Body="&lt;p&gt;Currently, I am doing the replacement of the word under the cursor on a script using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq bounds (bounds-of-thing-at-point 'word))&#xA;(setq pos1 (car bounds))&#xA;(setq pos2 (cdr bounds))&#xA;(delete-region pos1 pos2)&#xA;(insert newword)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this does not preserve the case pattern of the original word. The function &lt;code&gt;replace-match&lt;/code&gt; would preserve case, but it would require me to do a search before; something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(left-word)&#xA;(search-forward originalword)&#xA;(replace-match newword)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a &lt;code&gt;replace&lt;/code&gt; command which would allow me to replace the word at point preserving the original word pattern case? If not, am I missing a simple way to write one?&lt;/p&gt;&#xA;" OwnerUserId="12208" LastEditorUserId="105" LastEditDate="2016-07-14T14:36:13.813" LastActivityDate="2016-07-15T02:20:54.350" Title="Replace word at point preserving the case pattern" Tags="|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24602" PostTypeId="2" ParentId="9322" CreationDate="2016-07-14T10:54:50.507" Score="15" Body="&lt;p&gt;You can advise &lt;code&gt;ediff-quit&lt;/code&gt; so it dynamically rebinds &lt;code&gt;y-or-n-p&lt;/code&gt; to a function that returns &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun disable-y-or-n-p (orig-fun &amp;amp;rest args)&#xA;  (cl-letf (((symbol-function 'y-or-n-p) (lambda (prompt) t)))&#xA;    (apply orig-fun args)))&#xA;&#xA;(advice-add 'ediff-quit :around #'disable-y-or-n-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is more robust to upstream changes than redefining &lt;code&gt;ediff-quit&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12652" LastEditorUserId="12652" LastEditDate="2016-07-14T13:05:59.387" LastActivityDate="2016-07-14T13:05:59.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24603" PostTypeId="1" CreationDate="2016-07-14T11:53:40.730" Score="3" ViewCount="516" Body="&lt;p&gt;mu4e-switch-context seems to set shortcut key from first letter of its name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I customize this to other letter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.) I have contexts like &quot;work-A&quot;, &quot;work-B&quot;, &quot;work-C&quot;, ... and pressing &quot;;&quot; shows them all like [w]ork-*.&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-09-02T08:26:36.507" Title="How to customize mu4e-context's shortcut?" Tags="|mu4e|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24604" PostTypeId="2" ParentId="3963" CreationDate="2016-07-14T12:55:13.037" Score="3" Body="&lt;p&gt;As mentioned by @Malabarba, you can use &lt;code&gt;make-composed-keymap&lt;/code&gt; for that.  But If you really want the new keymap to inherit from both keymaps, such tht modifying the new keymap doesn't affect any of the other two keymaps, you need to do it in two steps:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-composed-keymap&#xA; nil (make-composed-keymap (list erc-mode-map markdown-mode-map)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is because &lt;code&gt;define-key&lt;/code&gt; can sometimes modify the maps passed as first argument of &lt;code&gt;make-composed-keymap&lt;/code&gt; but not those passed as second.  I guess you should &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; and request that &lt;code&gt;make-composed-keymap&lt;/code&gt; accept a &lt;em&gt;list&lt;/em&gt; of keymaps as second argument, so you could just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-composed-keymap nil (list erc-mode-map markdown-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-14T12:55:13.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24607" PostTypeId="2" ParentId="24484" CreationDate="2016-07-14T18:54:56.463" Score="0" Body="&lt;p&gt;It means the function is defined by the file providing the feature &lt;code&gt;package&lt;/code&gt; which is &lt;code&gt;package.el&lt;/code&gt;. It's the same as with&lt;code&gt;(require 'foo)&lt;/code&gt; which will also load a file &lt;code&gt;foo.el&lt;/code&gt;from the&lt;code&gt;load-path&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2016-07-14T18:54:56.463" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24608" PostTypeId="2" ParentId="24447" CreationDate="2016-07-14T19:04:07.123" Score="1" Body="&lt;p&gt;What you have configured here is that Gnus will check mail every three minutes &lt;strong&gt;but only if emacs is idle&lt;/strong&gt;. Thus, if mail check time has come but you are typing, the check is skipped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Daemons.html&quot; rel=&quot;nofollow&quot;&gt;the Gnus docs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is still a good configuration given that emacs is single-threaded and thus checking mail will make emacs block.&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2016-07-14T19:04:07.123" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24609" PostTypeId="1" AcceptedAnswerId="24638" CreationDate="2016-07-14T19:46:36.867" Score="8" ViewCount="2300" Body="&lt;p&gt;I am trying to have specific settings when I start a new emacs frame in X as opposed to in the terminal while using emacs-server. My initial attempt was using &lt;a href=&quot;https://stackoverflow.com/a/5801740/1284446&quot;&gt;this solution&lt;/a&gt;, but it appears it isn't working for me (using Emacs 24.4.1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, my minimimal non-working example is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun new-frame-setup (&amp;amp;optional frame)&#xA;  (if (display-graphic-p)&#xA;      (message &quot;window system&quot;)&#xA;    (message &quot;not a window system&quot;)&#xA;    ))&#xA;&#xA;;; run when regular emacs is started&#xA;(new-frame-setup)&#xA;;; run when a new frame is created using server&#xA;(add-hook 'after-make-frame-functions 'new-frame-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I start regular emacs and go to my Messages buffer it says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;window system&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So this works just as I expected. However, if I run the command &lt;code&gt;emacsclient -c&lt;/code&gt;, the Messages buffer says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;not a window system&#xA;Starting Emacs daemon&#xA;not a window system&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first &quot;not a window system&quot; makes sense, as it's starting the emacs server in the terminal.  However, the second one doesn't make sense, as that frame is already a graphical window. Furthermore, after the fact, if I evaluate &lt;code&gt;(display-graphic-p)&lt;/code&gt; in my scratch buffer, it evaluates as &lt;code&gt;t&lt;/code&gt;. Any ideas as to what I'm doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the big problem here is not that &lt;code&gt;(display-graphic-p)&lt;/code&gt; doesn't work, it's that it doesn't know what frame to check.  This was a problem for me since the daemon didn't have a window-system, but it's an even bigger problem if I have a terminal version and an X version of emacsclient running at the same time. For example, if I create a frame with &lt;code&gt;emacsclient -c&lt;/code&gt; and have it change some settings, and then I create a frame with &lt;code&gt;emacsclient -nw&lt;/code&gt; and have it change some other settings - all of those settings are getting changed at the &lt;em&gt;global&lt;/em&gt; level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess the real question is: how can I get emacs to check the display of the &lt;em&gt;most recently created&lt;/em&gt; frame, and then run some elisp code &lt;em&gt;only on that frame&lt;/em&gt;? I have absolutely no idea if this is possible.&lt;/p&gt;&#xA;" OwnerUserId="11862" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-07-16T12:01:26.677" Title="Determine graphical display on startup for emacs server/client" Tags="|emacsclient|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24610" PostTypeId="1" CreationDate="2016-07-14T20:02:17.097" Score="1" ViewCount="132" Body="&lt;p&gt;I want to inspect the lisp code that handle auto-indentation.&#xA;By &quot;auto-indent&quot; I mean the indentation that automatically puts the beginning of a line at the right position in files such as &lt;code&gt;.c&lt;/code&gt;, &lt;code&gt;.cpp&lt;/code&gt;, and &lt;code&gt;.java&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I find the code?&lt;/p&gt;&#xA;" OwnerUserId="8958" LastEditorUserId="253" LastEditDate="2016-07-14T21:32:53.737" LastActivityDate="2016-07-14T21:32:53.737" Title="How to see the implementation of the auto-indent procedure?" Tags="|indentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24612" PostTypeId="1" CreationDate="2016-07-14T20:48:08.740" Score="1" ViewCount="335" Body="&lt;p&gt;I want to bind key when in &lt;code&gt;ido-switch-buffer&lt;/code&gt; to open &lt;code&gt;ibuffer&lt;/code&gt; instead, but I do not understand how to make that with elisp. Here's my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-open-ibuffer ()&#xA;  &quot;Open ibuffer from ido-switch-buffer&quot;&#xA;  (interactive)&#xA;  (minibuffer-keyboard-quit)&#xA;  (ibuffer-other-window))&#xA;&#xA;(defun bind-ido-keys ()&#xA;  &quot;Keybindings for ido mode.&quot;&#xA;  (define-key ido-completion-map (kbd &quot;C-H-S-c&quot;) 'my-open-ibuffer))&#xA;&#xA;(add-hook 'ido-setup-hook #'bind-ido-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like when I call &lt;code&gt;(minibuffer-keyboard-quit)&lt;/code&gt; to close &lt;code&gt;ido-minibuffer&lt;/code&gt; function stops evaluating and not running next &lt;code&gt;(ibuffer-other-window)&lt;/code&gt; that should open &lt;code&gt;ibuffer&lt;/code&gt;. If I comment out &lt;code&gt;(minibuffer-keyboard-quit)&lt;/code&gt; it works as supposed - open new ibuffer window with not closed minibuffer. But I want minibuffer to be closed, and config described above only closes minibuffer and not triggering ibuffer opening.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="105" LastEditDate="2016-11-12T03:00:11.640" LastActivityDate="2016-11-12T03:00:11.640" Title="How to open new buffer instead of current via elisp?" Tags="|minibuffer|ido|ibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24613" PostTypeId="2" ParentId="24484" CreationDate="2016-07-14T20:57:48.200" Score="0" Body="&lt;p&gt;I emailed JohnWiegley, and he said the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That code was contributed by another, but I'm fairly certain it's just using the symbol-name of the symbol. The same sort of thing works with&#xA;eval-after-load:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;foo&quot; ...)&#xA;(eval-after-load 'foo ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-07-14T20:57:48.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24614" PostTypeId="1" AcceptedAnswerId="24625" CreationDate="2016-07-14T21:07:04.990" Score="5" ViewCount="5413" Body="&lt;p&gt;I am a vim user trying to covert to emacs/spacemacs, but I'm having a horribly difficult time configuring things that seem like a breeze others. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to limit the fill to 80 (mainly for .txt files and .org mode.. I thought the default was 80 anyway? Is this only for certain file extensions?), and I found &lt;a href=&quot;https://stackoverflow.com/questions/3566727/how-to-set-the-default-width-of-fill-mode-to-80-with-emacs&quot;&gt;this&lt;/a&gt; question which gives this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default fill-column 80)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but &lt;strong&gt;where do I put this?&lt;/strong&gt;. I have tried putting it in &#xA;&lt;code&gt;init.el&lt;/code&gt;, the &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; section of my &lt;code&gt;.spacemacs&lt;/code&gt;, and the &lt;code&gt;dotspacemacs/user-init&lt;/code&gt; section of my &lt;code&gt;.spacemacs&lt;/code&gt;. The keyboard combos &lt;code&gt;C-u 80 C-x f&lt;/code&gt; work for setting the fill to 80 while I'm in the buffer, and &lt;code&gt;M-q&lt;/code&gt; adjusts the fill if lines are overfilled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something here? From what I can see, &lt;a href=&quot;http://thume.ca/howto/2015/03/07/configuring-spacemacs-a-tutorial/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; (dated) blog of a spacemacs contributor suggests placing such lines in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; and &lt;strong&gt;not&lt;/strong&gt; in &lt;code&gt;init.el&lt;/code&gt;. Meanwhile, Eivind Fonn, another spacemacs contributor who has publicized his dotfiles on github, has everything in an &lt;code&gt;init.el&lt;/code&gt; and no &lt;code&gt;.spacemacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should add that other statements such as &lt;code&gt;(gobal-hl-line-mode)&lt;/code&gt; and &lt;code&gt;(setq-default evil-escape-key-sequence &quot;jk&quot;)&lt;/code&gt; work as expected for me. Do I have a big misunderstanding of how to configure spacemacs as my own or am I just mistaken on the intricacies of this specific function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was mistaken on the command that I needed. I actually want &lt;code&gt;auto-fill-mode&lt;/code&gt; instead of the default fill value. I tried putting &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auto-fill-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; and in &lt;code&gt;dotspacemacs/user-init&lt;/code&gt; but neither work. If I simply execute it as a command, it works fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided to scrap spacemacs and start learning emacs with evil-mode from the ground up. If I put the &lt;code&gt;(auto-fill-mode 1)&lt;/code&gt; into my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;, it works fine. I even made a function that auto-enables this only in org-mode. Learning emacs from scratch has given me a much better understanding of how emacs works, but now that I am manually installing packages and configuring things on my own, I want all the pre-configured-ness of spacemacs back! So now my question is &lt;strong&gt;where do I put &lt;code&gt;(auto-fill-mode 1)&lt;/code&gt; in my &lt;code&gt;.spacemacs&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Version info:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OS: Ubuntu 14.04&lt;br&gt;&#xA;Emacs: 24.4.2&lt;br&gt;&#xA;Spacemacs: Develop Branch (Release 0.105.x)&lt;/p&gt;&#xA;" OwnerUserId="12571" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-07-18T18:34:19.140" Title="Where to put user configurations/defaults for spacemacs?" Tags="|init-file|spacemacs|config|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24615" PostTypeId="2" ParentId="24610" CreationDate="2016-07-14T21:32:12.203" Score="2" Body="&lt;p&gt;To query the value of a variable or function in Emacs,&#xA;you can use the default keybindings of &lt;code&gt;C-h v VARIABLE&lt;/code&gt; and&#xA;&lt;code&gt;C-h f FUNCTION&lt;/code&gt;, respectively.  If you're not sure what to&#xA;look for, &lt;code&gt;M-x apropos SOMETHING&lt;/code&gt; will help you look for&#xA;functions and variables that contain SOMETHING in their names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, look up the &lt;em&gt;variable&lt;/em&gt; &lt;code&gt;indent-line-function&lt;/code&gt;,&#xA;whose docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Function to indent the current line.&#xA;  This function will be called with no arguments.&#xA;  If it is called somewhere where auto-indentation cannot be done&#xA;  (e.g. inside a string), the function should simply return &lt;code&gt;noindent&lt;/code&gt;.&#xA;  Setting this function is all you need to make TAB indent appropriately.&#xA;  Don't rebind TAB unless you really need to.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That variable will tell you which function to inspect.&#xA;For example, in &lt;code&gt;lisp-interaction-mode&lt;/code&gt; (i.e., the default&#xA;mode in the &lt;code&gt;*scratch*&lt;/code&gt; buffer), the value is &lt;code&gt;lisp-indent-line&lt;/code&gt;.&#xA;The help window should be hyperlinked, and, at the top, it&#xA;will tell you: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;lisp-indent-line is an interactive compiled Lisp function in&#xA;  &lt;code&gt;lisp-mode.el&lt;/code&gt;.&#xA;  ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You should be able to click on &lt;code&gt;lisp-mode.el&lt;/code&gt;, and Emacs will&#xA;open up that file at the function in question.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-14T21:32:12.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24616" PostTypeId="2" ParentId="24612" CreationDate="2016-07-14T21:43:31.800" Score="1" Body="&lt;p&gt;Ok looks like I figured it out by myself, and great thanks for this to abo-abo's brilliant post about &lt;a href=&quot;http://oremacs.com/2015/07/16/callback-quit/&quot; rel=&quot;nofollow&quot;&gt;callback-quit&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick is in &lt;code&gt;minibuffer-quit-and-run&lt;/code&gt; macro described below, if anyone had the same issues with running smth with minibuffer closing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro minibuffer-quit-and-run (&amp;amp;rest body)&#xA;  &quot;Quit the minibuffer and run BODY afterwards.&quot;&#xA;  `(progn&#xA;     (run-at-time nil nil&#xA;                  (lambda ()&#xA;                    (put 'quit 'error-message &quot;Quit&quot;)&#xA;                    ,@body))&#xA;     (minibuffer-keyboard-quit)))&#xA;&#xA;(defun my-open-ibuffer ()&#xA;  &quot;Open ibuffer from ido-switch-buffer&quot;&#xA;  (interactive)&#xA;  (minibuffer-quit-and-run (ibuffer-other-window)))&#xA;&#xA;&#xA;&#xA;(defun bind-ido-keys ()&#xA;  &quot;Keybindings for ido mode.&quot;&#xA;  (define-key ido-completion-map (kbd &quot;C-H-S-c&quot;) 'my-open-ibuffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-07-14T21:43:31.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24617" PostTypeId="2" ParentId="24601" CreationDate="2016-07-15T00:27:06.620" Score="6" Body="&lt;p&gt;The &lt;code&gt;replace-match&lt;/code&gt; function is your best bet. It's a C primitive and that's where the case preservation logic is implemented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;replace-match&lt;/code&gt; replaces the text indicated by the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Match-Data.html#Match-Data&quot; rel=&quot;nofollow&quot;&gt;match data&lt;/a&gt;. You can call &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Entire-Match-Data.html#index-set_002dmatch_002ddata&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;set-match-data&lt;/code&gt;&lt;/a&gt; to set the match data to bounds that don't result from a search.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-match-data&#xA;  (let ((bounds (bounds-of-thing-at-point 'word)))&#xA;    (set-match-data (list (car bounds) (cdr bounds)))&#xA;    (replace-match new-word)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-07-15T02:20:54.350" LastActivityDate="2016-07-15T02:20:54.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24618" PostTypeId="2" ParentId="9872" CreationDate="2016-07-15T03:09:46.160" Score="8" Body="&lt;p&gt;To toggle images, do either:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-x C-v&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x org-toggle-inline-images&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To do this in &lt;code&gt;#+OPTIONS&lt;/code&gt;, it looks like you can set it in the &lt;code&gt;#+STARTUP:&lt;/code&gt; &lt;a href=&quot;https://orgmode.org/manual/In_002dbuffer-Settings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://orgmode.org/manual/In_002dbuffer-Settings.html&lt;/a&gt; - see &lt;code&gt;inlineimages&lt;/code&gt; and &lt;code&gt;noinlineimages&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="591" LastEditorUserId="591" LastEditDate="2021-11-23T05:12:16.790" LastActivityDate="2021-11-23T05:12:16.790" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="24619" PostTypeId="1" CreationDate="2016-07-15T04:19:35.763" Score="0" ViewCount="188" Body="&lt;p&gt;A style guide for DocBook XML that I must adhere to states &quot;Content within elements should be indented by two spaces if the content runs over more than one line.&quot;  They give this example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;para&amp;gt;See the &amp;lt;link&#xA;    linkend=&quot;gmirror-troubleshooting&quot;&amp;gt;Troubleshooting&amp;lt;/link&amp;gt;&#xA;  section if there are problems booting.  Powering down and&#xA;  disconnecting the original &amp;lt;filename&amp;gt;ada0&amp;lt;/filename&amp;gt; disk&#xA;  will allow it to be kept as an offline backup.&amp;lt;/para&amp;gt;&#xA;&#xA;&amp;lt;para&amp;gt;It is also possible to journal the boot disk of a &amp;amp;os;&#xA;  system.  Refer to the article &amp;lt;link&#xA;    xlink:href=&quot;&amp;amp;url.articles.gjournal-desktop;&quot;&amp;gt;Implementing UFS&#xA;    Journaling on a Desktop PC&amp;lt;/link&amp;gt; for detailed&#xA;  instructions.&amp;lt;/para&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They also state that,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Tags containing long attributes follow the same rules.&#xA;  See the &lt;code&gt;linkend&lt;/code&gt; element of the &lt;code&gt;link&lt;/code&gt; tag.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;None of the customizable &lt;code&gt;nxml-mode&lt;/code&gt; variables seem to help.  In fact, some of the docstrings describe the opposite behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nxml-child-indent&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This only applies when the line or lines containing the start-tag&#xA;  contains nothing else other than that start-tag.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nxml-attribute-indent&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Indentation for the attributes of an element relative to the&#xA;  start-tag.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think I prefer keeping opening an closing tags on separate lines like &lt;code&gt;nxml-mode&lt;/code&gt; promotes.  Unfortunately the guide specifically prohibits some &quot;straggling&quot; tags (tags on their own line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I out of luck conforming to this style guide with &lt;code&gt;nxml-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10479" LastActivityDate="2016-07-15T14:10:01.630" Title="Indent Continuation Lines in nxml-mode" Tags="|nxml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24620" PostTypeId="1" AcceptedAnswerId="24628" CreationDate="2016-07-15T04:46:29.310" Score="3" ViewCount="1088" Body="&lt;p&gt;I was trying to read and eval Lisp forms from a string using a loop, instead of just putting the string into a buffer and using &lt;code&gt;eval-buffer&lt;/code&gt; to load everything in the string. That method was &lt;a href=&quot;https://emacs.stackexchange.com/questions/19877/how-to-evaluate-elisp-code-contained-in-a-string/19878#19878&quot;&gt;mentioned in another thread here.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that &lt;code&gt;read-from-string&lt;/code&gt; signals an error &quot;End of file reached during parsing&quot; and aborts my loop. I was hoping it would return nil, or some indication of the number of characters left, or give me some other way to figure out when to end my loop.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (while (&amp;lt; pos (length contents))&#xA;      (setq pair (read-from-string contents pos))&#xA;      (setq obj (car pair))&#xA;      (setq pos (cdr pair))&#xA;      .. inspect the read obj here&#xA;      .. maybe eval it, or toss it, or fix it..&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Read-from-string&lt;/code&gt; returns starting position for the next read operation in the cdr of the pair returned. So I'm thinking that's so I can use it to start the next read in the right place. But I can't find any examples of how to read a string without getting the EOF error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably it's just that I don't know how handle EOF errors while reading strings. Is there an ideomatic way of handling this kind of situation? Maybe with an &lt;code&gt;unwind-protect&lt;/code&gt; or something?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-15T13:53:46.413" Title="How to handle end of file during parsing errors while reading a string?" Tags="|eval|read|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24621" PostTypeId="2" ParentId="24561" CreationDate="2016-07-15T05:20:12.133" Score="1" Body="&lt;p&gt;I patched up your code so that it works. You'll have to study the differences to see what the problems were. Good luck!&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq sourceCode &quot;//Include Librarys&#xA;#include MyClass&#xA;//******&#xA;//MyClass::MyClass&#xA;//******&#xA;MyClass::MyClass() {}&#xA;&quot;)&#xA;&#xA;File Created:&#xA;//Include Librarys&#xA;#include HiThere&#xA;//******&#xA;//HiThere::HiThere&#xA;//******&#xA;HiThere::HiThere() {}&#xA;&#xA;&#xA;;;Prototype Header&#xA;(setq headerCode &quot;#ifndef MYCLASS&#xA;#define MYCLASS&#xA;class MyClass {&#xA;public:&#xA; MyClass();&#xA; ~MyClass();&#xA;};&#xA;#endif //!MyClass&#xA;&quot;)&#xA;&#xA;File Created:&#xA;#ifndef MYCLASS&#xA;#define MYCLASS&#xA;class HiThere {&#xA;public:&#xA; HiThere();&#xA; ~HiThere();&#xA;};&#xA;#endif //!HiThere&#xA;&#xA;&#xA;(defun create-class (directory name)&#xA;  &quot;Create a new class and header file.&quot;&#xA;  (interactive &quot;s(Create a new class) Enter path:&#xA;    sEnter class name: &quot;)&#xA;&#xA;  (let (path pathSource pathHeader)&#xA;    ;;(setq directory &quot;c:/Programming/&quot;) ;only for degugging&#xA;    (setq path (concat directory name))&#xA;    (setq pathSource (concat path &quot;.cpp&quot;))&#xA;    (setq pathHeader (concat path &quot;.h&quot;))&#xA;&#xA;    ;;Replace default class name with user specified class name&#xA;    (setq sourceCode (replace-word-in-string sourceCode name &quot;MyClass&quot;))&#xA;    (setq headerCode (replace-word-in-string headerCode name &quot;MyClass&quot;))&#xA;&#xA;    ;;Check if file exist in current directory&#xA;    (if (and (file-exists-p pathSource)&#xA;             (file-exists-p pathHeader))&#xA;        (message &quot;%s&quot; &quot;Filename already exist, no files where created!&quot;)&#xA;      ;; else no files exist, create the new ones&#xA;      (progn&#xA;        (with-temp-file pathSource&#xA;          (insert sourceCode))&#xA;        (with-temp-file pathHeader&#xA;          (insert headerCode))&#xA;        (message &quot;Created source file: %s\nCreated header file: %s&quot;&#xA;                 pathSource pathHeader)&#xA;        ))&#xA;    ))&#xA;;; default-directory is a variable for the current buffer directory&#xA;;; test-begin &#xA;(create-class default-directory &quot;HiThere&quot;)&#xA;&quot;Created source file: /Users/me/Dropbox/../HiThere.cpp&#xA;Created header file: /Users/me/Dropbox/.../HiThere.h&quot;&#xA;;; test-end&#xA;&#xA;(defun replace-word-in-string(string replacementWord searchedWord)&#xA;  (let (retString)&#xA;    (with-temp-buffer&#xA;      (insert string)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward searchedWord nil t)&#xA;        (replace-match replacementWord nil t))&#xA;      (setq retString (buffer-string)) ;returns all content in buffer as a string&#xA;      )&#xA;    retString))&#xA;;; test-begin&#xA;(replace-word-in-string &quot;How are you?&quot; &quot;busy&quot; &quot;are&quot;)&#xA;&quot;How busy you?&quot;&#xA;;; test-end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem you are having is that you are using external &quot;free&quot; variables&#xA;to drag in the template source file, and then resetting those variables&#xA;to the replaced strings the first time through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second time through, the template files have changed, so they no&#xA;longer contain the &quot;MyClass&quot; searched-for word. So no string replacements&#xA;occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the code below, I have used two local variables newSource and newHeader&#xA;to hold the replaced code. This solves the problem of resetting your&#xA;free variables.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let (path pathSource pathHeader newSource newHeader)&#xA;&#xA;;;Replace default class name with user specified class name&#xA;(setq newSource (replace-word-in-string sourceCode name &quot;MyClass&quot;))&#xA;(setq newHeader (replace-word-in-string headerCode name &quot;MyClass&quot;))&#xA;&#xA;    (message &quot;%s&quot; &quot;Filename already exist, no files where created!&quot;)&#xA;  ;; else no files exist, create the new ones&#xA;  (progn&#xA;    (with-temp-file pathSource&#xA;      (insert newSource))&#xA;    (with-temp-file pathHeader&#xA;      (insert newHeader))&#xA;    (message &quot;Created source file: %s\nCreated header file: %s&quot;&#xA;             pathSource pathHeader)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-07-16T14:03:11.737" LastActivityDate="2016-07-16T14:03:11.737" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24622" PostTypeId="2" ParentId="10085" CreationDate="2016-07-15T06:00:54.207" Score="3" Body="&lt;p&gt;I'm using org-mode 8.2.10&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I was expecting &lt;code&gt;#+INCLUDE: &quot;path&quot; html&lt;/code&gt; to work, it was&#xA;formatting the file contents in &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To work around this problem, I used an sh code block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports results :results value html&#xA;#!/bin/bash&#xA;/bin/cat ~/path/to/file.html&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8288" LastActivityDate="2016-07-15T06:00:54.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24623" PostTypeId="1" CreationDate="2016-07-15T06:51:12.453" Score="3" ViewCount="245" Body="&lt;p&gt;Is it possible to define in which modes (programming languages) i want to have company activated? I want to have company in all my modes but not in lisp mode.&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastActivityDate="2016-07-15T07:38:13.800" Title="Activate company in not all modes" Tags="|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24624" PostTypeId="2" ParentId="24623" CreationDate="2016-07-15T07:38:13.800" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;company-global-modes&lt;/code&gt; to control that.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(setq company-global-modes '(not lisp-mode))&lt;/p&gt;&#xA;&lt;p&gt;(global-company-mode 1)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11580" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-07-15T07:38:13.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24625" PostTypeId="2" ParentId="24614" CreationDate="2016-07-15T13:12:34.490" Score="8" Body="&lt;h1&gt;setting default value for auto-fill-column&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Normally, you'd put such configuration in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;, which is a function in your dotfile (&lt;code&gt;~/.spacemacs&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's possible to use a &lt;code&gt;~/.spacemacs.d/init.el&lt;/code&gt; as your dotfile instead of &lt;code&gt;~/.spacemacs&lt;/code&gt;, which I assume is what Eivind Fond does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original default value for &lt;code&gt;fill-column&lt;/code&gt; is 70. In current develop branch, Spacemacs configures &lt;code&gt;fill-column&lt;/code&gt; to a default of 80, so you probably don't need to do it yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Kevin wrote in the comment, keep in mind that we only set the default value for &lt;code&gt;fill-column&lt;/code&gt;, and the value can be different in buffers or modes that set their own value for &lt;code&gt;fill-column&lt;/code&gt;.&#xA;When the value is changed for a certain major-mode, it is usually done in the mode-hook. So if, for example, you want Org buffers to have a fill column of 72, you'd add something like this to &lt;code&gt;dotpsacemacs/user-config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda () (setq fill-column 72)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've used a &lt;code&gt;lambda&lt;/code&gt;, but I recommend using named functions instead of lambdas when you want to add them to hooks, since it makes it easier to use &lt;code&gt;remove-hook&lt;/code&gt; later if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to read the sections about &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer_002dLocal-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;buffer-local variables&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks.html&quot; rel=&quot;noreferrer&quot;&gt;hooks&lt;/a&gt; in the manual.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;enabling auto-fill-mode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;auto-fill-mode&lt;/code&gt; is a local mode, so when you add &lt;code&gt;(auto-fill-mode 1)&lt;/code&gt; to your user-config, it activates auto-fill-mode only for the buffer that is current when that line is evaluated. Instead, you want to add &lt;code&gt;auto-fill-mode&lt;/code&gt; to the hook of any major-mode where you want to activate auto-fill-mode. For example, if you want to activate auto-fill-mode in Org buffers, you need to add it the &lt;code&gt;org-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook #'auto-fill-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to activate auto-fill-mode everywhere, you'd probably want to hook it into &lt;code&gt;text-mode-hook&lt;/code&gt; and &lt;code&gt;prog-mode-hook&lt;/code&gt;. This way auto-fill-mode will be enabled in every major mode that derives from &lt;code&gt;text-mode&lt;/code&gt; or from &lt;code&gt;prog-mode&lt;/code&gt;, so basically that covers (almost?) every buffer where it's logical to have auto-fill-mode turned on:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'prog-mode-hook #'auto-fill-mode)&#xA;(add-hook 'text-mode-hook #'auto-fill-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These lines should be placed in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; as well.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastEditorUserId="6533" LastEditDate="2016-07-18T18:34:19.140" LastActivityDate="2016-07-18T18:34:19.140" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24626" PostTypeId="2" ParentId="24577" CreationDate="2016-07-15T13:20:14.980" Score="0" Body="&lt;p&gt;&lt;code&gt;M-x R new RET&lt;/code&gt; is not the correct shortcut. &lt;code&gt;M-x&lt;/code&gt;  (and &lt;code&gt;SPC :&lt;/code&gt;) is for invoking a command by it's &lt;strong&gt;name&lt;/strong&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x dired-do-rename RET new-name RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Dired mode, &lt;code&gt;dired-do-rename&lt;/code&gt; is bound to &lt;code&gt;R&lt;/code&gt;, so you just need to type &lt;code&gt;R&lt;/code&gt; &lt;strong&gt;without &lt;code&gt;M-x&lt;/code&gt;&lt;/strong&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R new-name RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-07-15T13:20:14.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24627" PostTypeId="1" CreationDate="2016-07-15T13:36:58.060" Score="1" ViewCount="420" Body="&lt;p&gt;I run &lt;code&gt;M-x gdb&lt;/code&gt;  using emacs integrated with the shell (-nw) but when I debug programs it doesn't display the output step by step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean that it returns the output only at the end when the program finishes and there is no output displayed immediately after the output commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this problem?&lt;/p&gt;&#xA;" OwnerUserId="12666" LastActivityDate="2016-07-15T13:36:58.060" Title="gdb input/output window" Tags="|gdb|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24628" PostTypeId="2" ParentId="24620" CreationDate="2016-07-15T13:53:46.413" Score="4" Body="&lt;p&gt;If you want evaluation to return &lt;code&gt;nil&lt;/code&gt; when it would normally raise an error, wrap the sexp to be evaluated in &lt;code&gt;ignore-errors&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ignore-errors (read-from-string contents pos))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;code&gt;with-demoted-errors&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-15T13:53:46.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24629" PostTypeId="2" ParentId="24619" CreationDate="2016-07-15T14:10:01.630" Score="1" Body="&lt;p&gt;I believe you're indeed partly out of luck.  nxml-mode is good at parsing the file and providing on the fly validation, but indentation was a secondary goal.  You would probably be better served by sgml-mode's indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, you could try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'nxml-mode-hook&#xA;          (lambda ()&#xA;            (require 'sgml-mode)&#xA;            (setq-local indent-line-function #'sgml-indent-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's quite possible that it will misbehave in various cases (e.g. because the syntax-tables are setup very differently), but if you're interested, I'd be happy to try and help you get it working well and integrate that change into Emacs.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-15T14:10:01.630" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24630" PostTypeId="1" CreationDate="2016-07-15T18:52:19.647" Score="21" ViewCount="4958" Body="&lt;p&gt;To better distinguish between focused window and rest that are not I would love to change this window's fringe color. Discovering customize with fringe keyword I found only how to change its bg color without ability to set different colors for active and not active ones. Is it possible at all? Thx.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="105" LastEditDate="2016-08-14T21:21:10.823" LastActivityDate="2017-10-18T06:32:20.300" Title="Is there a way to change color of active window's fringe?" Tags="|window|faces|customize|fringe|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24631" PostTypeId="2" ParentId="24549" CreationDate="2016-07-15T20:23:44.863" Score="1" Body="&lt;p&gt;According to commends on Emacs bug#16522: (&lt;a href=&quot;https://lists.gnu.org/archive/html/bug-gnu-emacs/2014-01/msg01157.html&quot; rel=&quot;nofollow&quot;&gt;https://lists.gnu.org/archive/html/bug-gnu-emacs/2014-01/msg01157.html&lt;/a&gt;), this is a bug when using Emacs with GTK version earlier than 2.16. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've personally seen this on RHEL 5 (GTK 2.10.4), but not on RHEL 6 (GTK 2.24.23).&lt;/p&gt;&#xA;" OwnerUserId="11087" LastActivityDate="2016-07-15T20:23:44.863" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24632" PostTypeId="2" ParentId="8319" CreationDate="2016-07-15T20:26:19.720" Score="1" Body="&lt;p&gt;This doesn't exactly solve the issue, but I've noticed that if you run tmux inside ansi-term (or byobu in my case, which is running tmux under the covers) it fixes the issue with the mongo shell.  Not sure why that is.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just resetting the value of TERM to something else (even &quot;screen&quot;, which is what tmux sets it to) doesn't solve the problem, but actually running mongo from inside tmux works properly.&lt;/p&gt;&#xA;" OwnerUserId="12669" LastActivityDate="2016-07-15T20:26:19.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24633" PostTypeId="1" CreationDate="2016-07-15T21:00:12.907" Score="7" ViewCount="2333" Body="&lt;p&gt;Given I'd like to keep using &lt;code&gt;global-flycheck-mode&lt;/code&gt;, how can I make sure flycheck is automatically disabled when editing org-mode documents? Or maybe is just activate it for code blocks?&lt;/p&gt;&#xA;&lt;p&gt;I found &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/723&quot; rel=&quot;nofollow noreferrer&quot;&gt;this discussion&lt;/a&gt; but I admit I don't know what to do with this information. :\&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;ORIGINAL QUESTION:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'm trying to create a timestamp with both date and time in org-mode (without adding to agenda), and I read from &lt;a href=&quot;http://orgmode.org/manual/Creating-timestamps.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the docs&lt;/a&gt; that I should be using this cord:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;C-u C-c !&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;However, I get this in my minibuffer:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://zc.d.pr/NxKK/56UjyS0K+&quot; rel=&quot;nofollow noreferrer&quot;&gt;screenshot http://zc.d.pr/NxKK/56UjyS0K+&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Seems like its waiting for more input. I'm an Emacs n00b so I'm not really sure what's happening here. I get the same behavior with&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;C-c !&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Both versions with &lt;code&gt;.&lt;/code&gt; work fine, though:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;C-u C-c .&lt;/p&gt;&#xA;&lt;p&gt;C-c .&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;What's happening here?&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: Thanks to suggestions from the comments below, I've determined Flycheck is doing something to screw this up: here's my flycheck config&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(use-package flycheck&#xA;  :ensure t&#xA;  :init (global-flycheck-mode))&#xA;(add-hook 'after-init-hook #'global-flycheck-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Where can I look to find if there is a colliding key binding?&lt;/p&gt;&#xA;" OwnerUserId="12495" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2018-02-22T01:30:35.103" Title="Turn off global-flycheck-mode for org-mode?" Tags="|org-mode|flycheck|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24634" PostTypeId="1" CreationDate="2016-07-15T21:26:47.480" Score="0" ViewCount="993" Body="&lt;p&gt;I installed linum relative with &lt;a href=&quot;https://github.com/coldnew/linum-relative?utm_medium=referral&amp;amp;utm_campaign=ZEEF&amp;amp;utm_source=https%3A%2F%2Femacs.zeef.com%2Fehartc&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;. But installing this replaced my fixed linum. I want to have both fixed line number and relative line number as well. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="10451" LastEditorUserId="105" LastEditDate="2016-08-10T21:50:02.607" LastActivityDate="2017-11-05T17:17:27.523" Title="How to have both fixed linum and relative linum?" Tags="|linum-mode|line-numbers|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24636" PostTypeId="2" ParentId="24634" CreationDate="2016-07-15T23:28:49.500" Score="0" Body="&lt;p&gt;Do you want to have them both running? Toggle?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try this package &lt;a href=&quot;https://github.com/coldnew/linum-relative&quot; rel=&quot;nofollow&quot;&gt;https://github.com/coldnew/linum-relative&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then I think you can toggle it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x linum-relative-toggle&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11531" LastActivityDate="2016-07-15T23:28:49.500" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24637" PostTypeId="2" ParentId="23858" CreationDate="2016-07-16T08:38:27.387" Score="9" Body="&lt;p&gt;Adding the following to my config file (~/.spacemacs) resolved the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-ex-define-cmd &quot;q[uit]&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can also be used to modify the behaviour of the ex command line by replacing nil with a function name, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-ex-define-cmd &quot;q[uit]&quot; 'evil-window-delete )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12015" LastActivityDate="2016-07-16T08:38:27.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24638" PostTypeId="2" ParentId="24609" CreationDate="2016-07-16T12:01:26.677" Score="6" Body="&lt;p&gt;The hook on &lt;code&gt;after-make-frame-functions&lt;/code&gt; runs after the frame is created but before it's selected (if it ever becomes selected). So you're asking whether the currently selected frame is on a graphical display, rather than whether the newly created frame is on a graphical display. This is easy to fix: pass the frame you're interested in to &lt;code&gt;display-graphic-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun new-frame-setup (frame)&#xA;  (if (display-graphic-p frame)&#xA;      (message &quot;window system&quot;)&#xA;    (message &quot;not a window system&quot;)))&#xA;&#xA;;; Run for already-existing frames&#xA;(mapc 'new-frame-setup (frame-list))&#xA;;; Run when a new frame is created&#xA;(add-hook 'after-make-frame-functions 'new-frame-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-07-16T12:01:26.677" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24639" PostTypeId="1" AcceptedAnswerId="24653" CreationDate="2016-07-16T14:18:05.400" Score="6" ViewCount="2328" Body="&lt;p&gt;When &lt;code&gt;flyspell-mode&lt;/code&gt; is active, typing is somewhat – although barely noticeable&#xA;– more sluggish than without, also marking of words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to somehow speed up &lt;code&gt;flyspell-mode&lt;/code&gt;, maybe make it not check as&#xA;frequently?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’m running &lt;code&gt;GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570&lt;/code&gt; on an&#xA;Intel Core i3 powered laptop with 8 GiB of RAM. As spell checker, I configured&#xA;&lt;code&gt;hunspell&lt;/code&gt; installed from &lt;a href=&quot;https://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ezwinports&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spell checking with &lt;code&gt;speck-mode&lt;/code&gt; does not slow down typing, but here I ran into&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/24581/how-to-save-speck-mode-dictionary-with-file&quot;&gt;another issue&lt;/a&gt; (now fixed).&lt;/p&gt;&#xA;" OwnerUserId="5327" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2020-06-08T12:48:15.630" Title="How to speed up flyspell-mode?" Tags="|flyspell|spell-checking|hunspell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24640" PostTypeId="2" ParentId="24561" CreationDate="2016-07-16T14:55:23.167" Score="0" Body="&lt;p&gt;Here is a working copy of the code(everything is included copy/paste into Emacs and run it), for an explenation of the answere see Kevin posts.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun create-class (directory name)&#xA;&quot;Create a new class(source and  header file.&quot;&#xA;(interactive &quot;s(Create a new class) Enter path:&#xA;sEnter class name: &quot;)&#xA;&#xA;  (let (path newSourceCode newHeaderCode pathSource pathHeader)&#xA;    (setq directory (concat directory &quot;/&quot;))&#xA;    (setq path (concat directory name))&#xA;    (setq pathSource (concat path &quot;.cpp&quot;))&#xA;    (setq pathHeader (concat path &quot;.h&quot;))&#xA;&#xA;    ;;Replace default class name with user specified class name&#xA;    (setq newSourceCode (replace-word-in-string sourceCode name &quot;MyClass&quot;))&#xA;    (setq newHeaderCode (replace-word-in-string headerCode name &quot;MyClass&quot;))&#xA;&#xA;    ;;Check if file exist in current directory&#xA;    (if (and (file-exists-p pathSource)&#xA;         (file-exists-p pathHeader))&#xA;    (message &quot;%s&quot; &quot;Filename already exist, no files where created!&quot;)&#xA;   ;; else no files exist, create the new ones&#xA;   (progn&#xA;    (with-temp-file pathSource&#xA;      (insert newSourceCode))&#xA;    (with-temp-file pathHeader&#xA;      (insert newHeaderCode))&#xA;    (message &quot;Created source file: %s\nCreated header file: %s&quot;&#xA;             pathSource pathHeader)&#xA;    ))&#xA;))&#xA;&#xA;(defun replace-word-in-string(string replacementWord searchedWord)&#xA;  (let (retString)&#xA;    (with-temp-buffer&#xA;      (insert string)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward searchedWord nil t)&#xA;        (replace-match replacementWord nil t))&#xA;      (setq retString (buffer-string)) ;returns all content in buffer as a   string&#xA;      )&#xA; retString))&#xA;&#xA;(setq sourceCode &quot;//Include Librarys&#xA;#include MyClass.h&#xA;&#xA;//Include Files&#xA;&#xA;&#xA;//******&#xA;//MyClass::MyClass&#xA;//******&#xA;MyClass::MyClass() {}&#xA;&#xA;//******&#xA;//MyClass::~MyClass&#xA;//******&#xA;MyClass::~MyClass() {}&#xA;&#xA;&quot;)&#xA;&#xA;;;Prototype Header&#xA;(setq headerCode &quot;#ifndef MYCLASS_H&#xA;#define MYCLASS_H&#xA;&#xA;//Include Librarys&#xA;&#xA;//Include Files&#xA;&#xA;&#xA;//Forward declarations&#xA;&#xA;&#xA;class MyClass {&#xA;public:&#xA;  MyClass();&#xA;  ~MyClass();&#xA;&#xA;private:&#xA;&#xA;};&#xA;&#xA;#endif //!MYCLASS_H&#xA;&quot;)&#xA;&#xA;;;Create CLASS&#xA;(global-set-key (kbd &quot;C-c c&quot;)&#xA;  'create-class&#xA;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12625" LastActivityDate="2016-07-16T14:55:23.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24641" PostTypeId="1" CreationDate="2016-07-16T15:17:39.503" Score="11" ViewCount="430" Body="&lt;p&gt;I would like to make modeline display all information not in one line but in two - for example first for cursor info, buffer, file, git and flycheck, and on second line - modes info (major and minor modes). Is it doable somehow? I googled bindings.el and emacs C source code and wasn't lucky to find where this line number for modeline could be possible changed, does anybody can help with this? Thx.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-07-17T07:38:55.670" Title="More than one line in mode-line?" Tags="|mode-line|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24642" PostTypeId="2" ParentId="24641" CreationDate="2016-07-16T15:36:39.990" Score="8" Body="&lt;p&gt;I'm afraid this is generally not possible as newlines in &lt;code&gt;mode-line-format&lt;/code&gt; are interpreted verbatim and appear as &lt;code&gt;^J&lt;/code&gt; or &lt;code&gt;^M&lt;/code&gt;.  What could work would be replacing the mode line with an image spanning two rows and manipulating that as needed...&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-07-17T07:38:55.670" LastActivityDate="2016-07-17T07:38:55.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24643" PostTypeId="2" ParentId="24639" CreationDate="2016-07-16T19:19:12.343" Score="2" Body="&lt;p&gt;Flyspell is unfortunately slow and that is just life when using Emacs.  The minor-mode does, however, have a few built-in optimizations that are customizable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variables &lt;code&gt;flyspell-default-deplacement-commands&lt;/code&gt; and &lt;code&gt;flyspell-deplacement-commands&lt;/code&gt; are used to prevent flyspell from checking a word.  Essentially, if &lt;code&gt;this-command&lt;/code&gt; (the current command) is the same as the previous command (&lt;code&gt;flyspell-previous-command&lt;/code&gt;), and this command is a member of the list of deplacement commands, then do &lt;em&gt;not&lt;/em&gt; check the word.  [The commands in the lists are associated with the &lt;em&gt;symbol&lt;/em&gt; &lt;code&gt;flyspell-deplacement&lt;/code&gt; and used internally when flyspell decides whether to check a word.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variables &lt;code&gt;flyspell-default-delayed-commands&lt;/code&gt; and &lt;code&gt;flyspell-delayed-commands&lt;/code&gt; are used to delay checking the word for &lt;code&gt;flyspell-delay&lt;/code&gt; seconds.  [The commands in the lists are associated with the &lt;em&gt;symbol&lt;/em&gt; &lt;code&gt;flyspell-delayed&lt;/code&gt; and used internally when flyspell decides whether to delay checking a word.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[When referring to the &lt;em&gt;symbols&lt;/em&gt; &lt;code&gt;flyspell-deplacement&lt;/code&gt; and &lt;code&gt;flyspell-delayed&lt;/code&gt;, they are for internal usage and not meant to be customized by the user.]&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-07-16T19:19:12.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24644" PostTypeId="1" CreationDate="2016-07-16T22:46:52.280" Score="2" ViewCount="391" Body="&lt;p&gt;Just began transitioning from vim to spacemacs and I can't find a way to define keymappings such as this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nnoremap N Nzz&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried defining it like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;define-key evil-normal-state-map (kbd &quot;N&quot;) (kbd &quot;Nzz&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... but using the &quot;N&quot; in the right hand side of the mapping causes the following error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;error &quot;Lisp nesting exceeds 'max-lisp-eval-depth'&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to define non-recursive keybindings with kbd?&lt;/p&gt;&#xA;" OwnerUserId="12677" LastActivityDate="2016-07-16T22:46:52.280" Title="Equivalent to vim's nnoremap?" Tags="|key-bindings|spacemacs|vim-emulation|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24645" PostTypeId="1" AcceptedAnswerId="24651" CreationDate="2016-07-17T02:43:49.517" Score="9" ViewCount="1801" Body="&lt;p&gt;I am writing a literate program in Org mode, and exporting the literate document to html file after tangling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after making any change to the Org file, I often have to do the export (Using &lt;code&gt;C-c C-e h h&lt;/code&gt;) and tangling (&lt;code&gt;C-c C-v t&lt;/code&gt;) separately. This gets &#xA;tedious when making lots of local changes to see the effect on the code's run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to add a command to emacs via Elisp, to do both simultaneously. I'd like to bind this action to the simultaneous key-presses&lt;code&gt;Alt+F2&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10896" LastEditorUserId="105" LastEditDate="2016-07-17T15:09:09.630" LastActivityDate="2016-12-21T09:31:36.260" Title="Exporting and Tangling simultaneously in org mode" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24646" PostTypeId="1" CreationDate="2016-07-17T02:51:39.727" Score="19" ViewCount="1916" Body="&lt;p&gt;For a variety of reasons it's possible to end up with duplicate heading Id's (manually-set ID conflicts, copy pasta, duplicate files, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When refiling you may get a message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;WARNING: 17 duplicate IDs found, check *Messages* buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Followed by a (possibly) long list of locations of duplicate Id's:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Duplicate ID &quot;271b2fbe-cb4f-4eb8-86d5-91544028ccae&quot;, also in file /home/erik/data.org&#xA;Duplicate ID &quot;bc7ea3e9-f821-4bee-9ce6-255083721a8a&quot;, also in file /home/erik/data.org&#xA;Duplicate ID &quot;24afb249-8481-46a5-8237-06a0c22295eb&quot;, also in file /home/erik/data.org&#xA;Duplicate ID &quot;6a545fe0-bd19-4523-8a6d-f7500a114f5f&quot;, also in file /home/erik/data.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's fairly simple to kill/copy the id and search through the document to replace duplicate ids, but that is rather onerous.  I'm curious what mechanisms are available in org-mode to assist in resolving these or alternatively what people may have come up with to resolve this occasional problem with their own agendas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like the duplicate logic is limited to what is currently baked into &lt;code&gt;org-id-update-id-locations&lt;/code&gt; and would be easy to extract, but I'd like to hear some other thoughts before I write a helper.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2018-04-11T13:29:40.110" LastActivityDate="2020-10-01T04:42:02.977" Title="Resolving duplicate ID's in org-mode" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24647" PostTypeId="1" CreationDate="2016-07-17T11:17:04.720" Score="1" ViewCount="52" Body="&lt;p&gt;I changed the default font of GNU emacs 24 to &lt;a href=&quot;http://dejavu-fonts.org/wiki/Main_Page&quot; rel=&quot;nofollow noreferrer&quot;&gt;DejaVu&lt;/a&gt; and when I want to open a file I had this weird output(characters start appearing in small size)! &#xA;Anyone knows how to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs for several days now, so can you please explain as much as possible. Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pOPE4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pOPE4.png&quot; alt=&quot;Photo&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11773" LastEditorUserId="9573" LastEditDate="2016-07-17T13:30:09.440" LastActivityDate="2016-07-17T13:30:09.440" Title="problem with default font" Tags="|init-file|fonts|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24648" PostTypeId="1" AcceptedAnswerId="24650" CreationDate="2016-07-17T13:55:36.493" Score="2" ViewCount="148" Body="&lt;p&gt;I am trying to learn Elisp and just found  &lt;a href=&quot;https://github.com/ffevotte/isend-mode.el/blob/master/isend-mode.el#L234&quot; rel=&quot;nofollow&quot;&gt;this line&lt;/a&gt; that I don't understand, in a package that I use to send code from buffer to a terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (let* ((region-active (region-active-p))&#xA;&#xA;        ;; The region to be sent&#xA;        (bds   (isend--region-boundaries)) ; &amp;lt;&amp;lt;-- *** LINE OF INTEREST ***&#xA;        (begin (car bds))&#xA;        (end   (cdr bds))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What does that command do? &lt;code&gt;isend--region-boundaries&lt;/code&gt; is a function defined elsewhere), but &lt;code&gt;bds&lt;/code&gt; isn't. So what's &lt;code&gt;bds&lt;/code&gt; here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it's just coincidence, but I have found the same keyword used &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_get-selection-or-unit.html&quot; rel=&quot;nofollow&quot;&gt;elsewhere&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="105" LastEditDate="2016-08-22T21:39:25.510" LastActivityDate="2016-08-22T21:39:25.510" Title="What is bds in Emacs speak?" Tags="|let-binding|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24649" PostTypeId="2" ParentId="24581" CreationDate="2016-07-17T14:04:25.090" Score="1" Body="&lt;p&gt;It’s a bug in Speck version 2014.08.30: The function &lt;code&gt;speck-restore-options&lt;/code&gt; was&#xA;missing support for Hunspell. I added a bug fix to &lt;a href=&quot;https://www.emacswiki.org/emacs/speck.el&quot; rel=&quot;nofollow&quot;&gt;speck.el&lt;/a&gt; on EmacsWiki. The new version is 2016.07.17.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For testing I assigned to &lt;code&gt;speck-hunspell-dictionary-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;en&quot; . &quot;en_US&quot;) (&quot;de&quot; . &quot;de_DE&quot;) (&quot;es&quot; . &quot;es_ES&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the German dictionary can be set at the end of the file with one of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;Local Dictionary: de&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;Local Dictionary: de_DE&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;Local IspellDict: de&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;Local IspellDict: de_DE&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The key on the left side in the above examples can be changed by customizing&#xA;&lt;code&gt;speck-save-dictionary-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5327" LastEditorUserId="5327" LastEditDate="2016-07-17T14:41:25.250" LastActivityDate="2016-07-17T14:41:25.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24650" PostTypeId="2" ParentId="24648" CreationDate="2016-07-17T14:39:21.287" Score="1" Body="&lt;p&gt;I'm with Dan, but I'm posting here so the question can be marked as answered. Another thing to understand about the code you posted is that it uses &lt;code&gt;let*&lt;/code&gt;, which imposes an ordering on the variable assignments so that the value of &lt;code&gt;bds&lt;/code&gt; assigned in the 2nd line of the let is available for use in the 3rd and 4th lines of the &lt;code&gt;let*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a normal &lt;code&gt;(let ((...&lt;/code&gt;, the ordering of assignments is not guaranteed, so the values of &lt;code&gt;begin&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; might be set to nil if those lines are evaluated before the 2nd line that sets the value of &lt;code&gt;bds&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry that I was not clear in my writing. As Jean-Pierre points out, the doc string does indeed say that all variables (right hand side) are evalled before any symbols (the left hand side) are bound. But the doc string does not say anything about the &lt;em&gt;order&lt;/em&gt; in which the variables are bound, which was my point above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, the implementation of a standard &lt;code&gt;(let&lt;/code&gt; is under no obligation to bind the variables in top to bottom order, as a code writer might expect. The implementation may or may not do the binding in the &quot;right&quot; order. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not that it matters what order is used to bind the variables. Since all right hand side VALUEFORMS are evalled before any of the left hand side variables are bound, the values that actually get assigned to the left side variables are cast in stone before the first left side variable gets bound. So binding them top to bottom or bottom to top or in some other order won't make any difference to the final values each left side variable receives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a standard &lt;code&gt;(let&lt;/code&gt;, the value of the left hand side &lt;code&gt;bds&lt;/code&gt; variable above on line 2 is undefined at the time the right hand &lt;code&gt;bds&lt;/code&gt; sides of lines 3 and 4 are evalled. So they must eval to nil, I would think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the whole point of introducing a different kind of let, the &lt;code&gt;(let*&lt;/code&gt; version, is to provide a let that &lt;em&gt;does&lt;/em&gt; have the obligation to eval and bind the successive variables in a &lt;code&gt;(let*&lt;/code&gt; sequentially. So with a &lt;code&gt;(let*&lt;/code&gt;, the code in the original posting will eval+bind the bds, begin, and end variables in proper sequential order, completing each line before starting the next line, thereby guaranteeing valid right-hand &lt;code&gt;bds&lt;/code&gt; values for lines 3 and 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully this update adds more clarity. The &lt;code&gt;(let*&lt;/code&gt; doc string says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Each VALUEFORM can refer to the symbols already bound by this VARLIST.&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-07-18T06:23:38.467" LastActivityDate="2016-07-18T06:23:38.467" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24651" PostTypeId="2" ParentId="24645" CreationDate="2016-07-17T15:37:09.237" Score="2" Body="&lt;p&gt;I don't think Org has an option to &lt;code&gt;tangle-on-export&lt;/code&gt;. Bu Org can evaluate code blocks on export, and one of those can do the tangling for you. I don't have the elisp skills to whip this out easily, but you'll want an elisp babel block that steps through all of the other code blocks (or a list of specific named blocks) and tangles them (or tangles them if :tangle is y and the cache is outdated, etc.)&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-07-17T15:37:09.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24652" PostTypeId="2" ParentId="24598" CreationDate="2016-07-17T15:48:51.213" Score="1" Body="&lt;p&gt;This can all be done using &lt;code&gt;tags&lt;/code&gt;/&lt;code&gt;tags-todo&lt;/code&gt; property searches.  You can search for schedule/deadline/timestamp information using the &lt;code&gt;SCHEDULED&lt;/code&gt;, &lt;code&gt;DEADLINE&lt;/code&gt; and &lt;code&gt;TIMESTAMP&lt;/code&gt; properties.  The TODO state is in the &lt;code&gt;TODO&lt;/code&gt; property.  Dates relative to &quot;now&quot; can be specified using org's &lt;code&gt;&amp;lt;+nd&amp;gt;&lt;/code&gt; syntax to mean &quot;n days from today&quot;.  Your first two examples can be done using this method:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;TODOs Scheduled today --- &lt;code&gt;+SCHEDULED=&quot;&amp;lt;+0d&amp;gt;&quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;TODOs tagged some tag only within future 2 weeks --- &lt;code&gt;+sometag+TIMESTAMP&amp;lt;=&amp;lt;+14d&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The third example is the built-in &lt;code&gt;t&lt;/code&gt; agenda that lists all TODO items.  You can recreated it by searching for &lt;code&gt;+TOOD={.*}&lt;/code&gt; (&lt;code&gt;.*&lt;/code&gt; being a regular expression that matches anything, so this matches any TODO state).  By default this excludes and &quot;done&quot; TODO state.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-07-17T15:48:51.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24653" PostTypeId="2" ParentId="24639" CreationDate="2016-07-17T23:54:57.827" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/rolandwalker/flyspell-lazy&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/rolandwalker/flyspell-lazy&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, you can turn off flyspell-mode completely and use &lt;code&gt;M-x flyspell-buffer&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use my package &lt;a href=&quot;https://github.com/redguardtoo/wucuo&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/wucuo&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has two modes (see &lt;code&gt;wucuo-flyspell-start-mode&lt;/code&gt;),&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In &quot;normal&quot; mode, it calls &lt;code&gt;flyspell-buffer&lt;/code&gt; to check current buffer when saving file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In &quot;fast&quot; mode, it calls &lt;code&gt;flyspell-region&lt;/code&gt; to check the visible region when saving file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2020-06-08T12:48:15.630" LastActivityDate="2020-06-08T12:48:15.630" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="24654" PostTypeId="2" ParentId="22306" CreationDate="2016-07-18T03:41:39.117" Score="3" Body="&lt;p&gt;According to your log and my own experiences, &quot;ssh&quot; command is executed several times. On slow connections this could take pretty long for each ssh command. For recent OpenSSH you can try to &lt;strong&gt;reuse connections&lt;/strong&gt;, check &lt;a href=&quot;https://puppet.com/blog/speed-up-ssh-by-reusing-connections&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt; here and set your ~/.ssh/config as follows (remember to &lt;em&gt;mkdir ~/.ssh/sockets&lt;/em&gt; first):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host *&#xA;ControlMaster auto&#xA;ControlPath ~/.ssh/sockets/%r@%h-%p&#xA;ControlPersist 600&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you need to disable tramp's default ControlMaster settings in your &lt;em&gt;~/.emacs&lt;/em&gt; by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     (setq tramp-ssh-controlmaster-options &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The next thing you will face is the auto-backup problem that Michael mentioned in his reply. My personal solution to this is combining the suggestion of tramp manual &lt;a href=&quot;http://www.gnu.org/software/tramp/#Auto_002dsave-and-Backup&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/TrampMode#toc24&quot; rel=&quot;nofollow&quot;&gt;this emacs wiki&lt;/a&gt;, add the following code into &lt;em&gt;~/.emacs&lt;/em&gt;. A new variable &lt;strong&gt;disable-tramp-backups&lt;/strong&gt; is introduced where you can list what kind of tramp connections you don't want to have backups. My following example disabled auto-backup for all tramped files. You can modify it according to my other examples in the comments.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;(setq disable-tramp-backups nil) ;; allow all tramp files to be backuped&#xA;;;(setq disable-tramp-backups '(&quot;su&quot; &quot;sudo&quot;)) ;; only 'su' and 'sudo'&#xA;;;(setq disable-tramp-backups '(&quot;ssh&quot; &quot;sftp&quot;)) ;; only 'ssh' and 'sftp'&#xA;(defvar disable-tramp-backups '(all))&#xA;&#xA;(eval-after-load &quot;tramp&quot;&#xA;  '(progn&#xA;     ;; Modified from https://www.gnu.org/software/emacs/manual/html_node/tramp/Auto_002dsave-and-Backup.html&#xA;     (setq backup-enable-predicate&#xA;           (lambda (name)&#xA;             (and (normal-backup-enable-predicate name)&#xA;              ;; Disable all tramp backups&#xA;              (and disable-tramp-backups&#xA;                   (member 'all disable-tramp-backups)&#xA;                   (not (file-remote-p name 'method)))&#xA;              (not ;; disable backup for tramp with the listed methods&#xA;               (let ((method (file-remote-p name 'method)))&#xA;                 (when (stringp method)&#xA;                   (member method disable-tramp-backups)))))))&#xA;&#xA;     (defun tramp-set-auto-save--check (original)&#xA;       (if (funcall backup-enable-predicate (buffer-file-name))&#xA;           (funcall original)&#xA;         (auto-save-mode -1)))&#xA;&#xA;     (advice-add 'tramp-set-auto-save :around #'tramp-set-auto-save--check)&#xA;&#xA;     ;; Use my ~/.ssh/config control master settings according to https://puppet.com/blog/speed-up-ssh-by-reusing-connections&#xA;     (setq tramp-ssh-controlmaster-options &quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last thing you might need to take care is the hooks or idle-time functions you set in your &lt;em&gt;~/.emacs&lt;/em&gt;. If you ever invoke shell to run commands (e.g. via `shell-command' function ...) in those hooks/idle-time functions, those commands might be passed to remote machine and will be very slow too. You need to wrap those shell commands with the current buffer changed to somewhere else, like the '&lt;em&gt;scratch&lt;/em&gt;' buffer, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (get-buffer &quot;*scratch*&quot;)&#xA;    (shell-command &quot;ls -al&quot;)) ;; just a sample shell command&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there are still other slow down problems, enable &quot;Enter Debugger on Quit/C-g&quot; option in Emacs. When emacs seems &quot;hanging&quot; there press C-g and see which function it stuck in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's about it. Hope this helps. If you find anything else, please also let me know.&lt;/p&gt;&#xA;" OwnerUserId="12634" LastEditorUserId="12634" LastEditDate="2016-07-18T04:43:25.063" LastActivityDate="2016-07-18T04:43:25.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24655" PostTypeId="1" AcceptedAnswerId="24726" CreationDate="2016-07-18T05:21:51.743" Score="1" ViewCount="250" Body="&lt;p&gt;I use use-package in my &lt;code&gt;init.el&lt;/code&gt; and use &lt;code&gt;:ensure&lt;/code&gt; to make sure packages are installed. However after every package update via &lt;code&gt;package.el&lt;/code&gt;, it tells me some packages are no longer needed and can be removed, even though those packages are actually needed. If I remove them via &lt;code&gt;M-x package-autoremove&lt;/code&gt;, they get installed the next time I open Emacs. Does this have something to do with the order in which they are added in &lt;code&gt;package.el&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, helm has been added to my init file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; helm-mode by default&#xA;(use-package helm&#xA;  :ensure t&#xA;  :diminish helm-mode&#xA;  :config&#xA;  (helm-mode 1)&#xA;  :bind ((&quot;M-x&quot; . helm-M-x)&#xA;         (&quot;C-x C-f&quot; . helm-find-files)&#xA;         (&quot;C-c f&quot; . helm-recentf)&#xA;         (&quot;C-x b&quot; . helm-mini)&#xA;         (&quot;C-x C-b&quot; . helm-buffers-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However it gets installed as a dependency. The same happens for &lt;code&gt;company-mode&lt;/code&gt;, &lt;code&gt;helm-ag&lt;/code&gt; etc.&lt;/p&gt;&#xA;" OwnerUserId="5196" LastEditorUserId="5196" LastEditDate="2016-07-20T09:34:08.777" LastActivityDate="2016-07-21T05:23:33.783" Title="use-package dependecy loop" Tags="|init-file|package|use-package|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24656" PostTypeId="1" AcceptedAnswerId="24659" CreationDate="2016-07-18T07:16:02.100" Score="3" ViewCount="209" Body="&lt;p&gt;I would like to have heading numbers ended with dot in html:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;* Another heading&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to be exported as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. Heading&#xA;2. Another heading&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any setting I can use?&lt;/p&gt;&#xA;" OwnerUserId="10063" LastActivityDate="2016-07-18T10:25:35.003" Title="org html export heading numbers with dot" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24657" PostTypeId="1" CreationDate="2016-07-18T08:39:53.877" Score="11" ViewCount="2185" Body="&lt;p&gt;I cannot find a predefined command in &lt;code&gt;nadvice&lt;/code&gt; to easily unadvise a function in Emacs 24.5.1.&#xA;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun advice-unadvice (sym)&#xA;  &quot;Remove all advices from symbol SYM.&quot;&#xA;  (interactive &quot;aFunction symbol:&quot;)&#xA;  (advice-mapc `(lambda (fun props) (advice-remove ,(quote sym) fun)) sym))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there such a thing predefined?&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="105" LastEditDate="2017-04-27T15:22:15.860" LastActivityDate="2017-04-27T15:22:15.860" Title="Unadvise a function (remove all advice from it)" Tags="|advice|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24658" PostTypeId="2" ParentId="24657" CreationDate="2016-07-18T09:06:21.607" Score="15" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun advice-unadvice (sym)&#xA;  &quot;Remove all advices from symbol SYM.&quot;&#xA;  (interactive &quot;aFunction symbol: &quot;)&#xA;  (advice-mapc (lambda (advice _props) (advice-remove sym advice)) sym))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="97" LastEditDate="2016-07-18T15:12:36.053" LastActivityDate="2016-07-18T15:12:36.053" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24659" PostTypeId="2" ParentId="24656" CreationDate="2016-07-18T10:16:32.157" Score="2" Body="&lt;p&gt;You could solve it with a css style appending your dots:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;span[class^=&quot;section-number-&quot;]:after {&#xA;    content: '.';&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can also be embedded in the org document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD_EXTRA: &amp;lt;style&amp;gt;span[class^=&quot;section-number-&quot;]:after { content: '.'; }&amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-07-18T10:25:35.003" LastActivityDate="2016-07-18T10:25:35.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24661" PostTypeId="1" AcceptedAnswerId="24662" CreationDate="2016-07-18T12:57:36.353" Score="4" ViewCount="538" Body="&lt;p&gt;Why can't I directly set csv-mode variables like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq csv-separators '(&quot;;&quot; &quot;\t&quot;))&#xA;(setq csv-field-quotes '(&quot;\&quot;&quot; &quot;'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I'm forced to set it like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables '(csv-separators '(&quot;;&quot; &quot;\t&quot;)))&#xA;(custom-set-variables '(csv-field-quotes '(&quot;\&quot;&quot; &quot;'&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, with this init file for csv-mode, my personnal settings are taken into account:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'csv-mode)&#xA;&#xA;(defun my/csv-mode-set-properties ()&#xA;  &quot;Set properties for editing CSV files.&quot;&#xA;  (custom-set-variables '(csv-separators '(&quot;;&quot; &quot;\t&quot;)))&#xA;  (custom-set-variables '(csv-field-quotes '(&quot;\&quot;&quot; &quot;'&quot;)))&#xA;  (custom-set-variables '(csv-align-padding 2))&#xA;  (custom-set-variables '(csv-header-lines 1)))&#xA;&#xA;(add-hook 'csv-mode-hook 'my/csv-mode-set-properties)&#xA;&#xA;(provide 'init-csv-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but not with that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'csv-mode)&#xA;&#xA;(defun my/csv-mode-set-properties ()&#xA;  &quot;Set properties for editing CSV files.&quot;&#xA;  (setq csv-separators '(&quot;;&quot; &quot;\t&quot;))&#xA;  (setq csv-field-quotes '(&quot;\&quot;&quot; &quot;'&quot;))&#xA;  (setq csv-align-padding 2)&#xA;  (setq csv-header-lines 1))&#xA;&#xA;(add-hook 'csv-mode-hook 'my/csv-mode-set-properties)&#xA;&#xA;(provide 'init-csv-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10056" LastEditorUserId="10056" LastEditDate="2016-07-18T13:30:49.230" LastActivityDate="2016-07-23T17:22:41.293" Title="setq and csv-mode variables" Tags="|csv|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24662" PostTypeId="2" ParentId="24661" CreationDate="2016-07-18T13:39:09.773" Score="4" Body="&lt;p&gt;Don't use the csv-hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq csv-separators '(&quot;;&quot; &quot;\t&quot;))&#xA;(setq csv-field-quotes '(&quot;\&quot;&quot; &quot;'&quot;))&#xA;(setq csv-align-padding 2)&#xA;(setq csv-header-lines 1)&#xA;(require 'csv-mode)&#xA;(provide 'init-csv-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2016-07-23T17:22:41.293" LastActivityDate="2016-07-23T17:22:41.293" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24663" PostTypeId="2" ParentId="24484" CreationDate="2016-07-18T16:51:00.307" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can &lt;code&gt;'package&lt;/code&gt; be a useful 2nd argument, when the doc for &lt;code&gt;declare-function&lt;/code&gt; says that the third argument should be a filename?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's a mistake in use-package.el, now &lt;a href=&quot;https://github.com/jwiegley/use-package/pull/342/commits/b4a17a59bf77c01f5fbc5a8c89fe67bb2128e82b&quot; rel=&quot;nofollow&quot;&gt;fixed&lt;/a&gt;.  If you run &lt;code&gt;check-declare&lt;/code&gt; on the unfixed version you'll see in &lt;code&gt;*Messages*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Malformed declaration for `package-installed-p'&#xA;Malformed declaration for `(, command)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first is the &lt;code&gt;'package&lt;/code&gt; mistake, the second is a false positive on &lt;code&gt;use-package&lt;/code&gt; code that generates a &lt;code&gt;declare-function&lt;/code&gt; statement call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason it's like this, is that &lt;code&gt;check-declare-scan&lt;/code&gt; works by regexp rather than actually parse the lisp code, so it can't be 100% certain about which statements are real.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-07-18T16:51:00.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24664" PostTypeId="2" ParentId="24575" CreationDate="2016-07-18T18:04:39.953" Score="2" Body="&lt;p&gt;I asked this question on &lt;a href=&quot;https://lists.gnu.org/mailman/listinfo/help-gnu-emacs&quot; rel=&quot;nofollow&quot;&gt;gnu.emacs.help&lt;/a&gt; and learned how to make this work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((debug-on-error nil)) (should-error (cl-assert nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems &lt;code&gt;cl-assert&lt;/code&gt; doesn't raise an error if &lt;code&gt;debug-on-error&lt;/code&gt; is true, it just goes straight to the debugger.&lt;/p&gt;&#xA;" OwnerUserId="2463" LastActivityDate="2016-07-18T18:04:39.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24665" PostTypeId="1" CreationDate="2016-07-18T21:55:43.107" Score="1" ViewCount="63" Body="&lt;p&gt;GDB has a feature: when the user wants to repeat the previous command (for example &quot;n&quot;), she can simply hit Enter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using GDB with a source code viewer in a terminal (&lt;code&gt;gdb -tui&lt;/code&gt;), repeat the last command simply does not create new command prompt lines and preserves what is currently displayed on the screen. However, when doing this in Emacs, this will create a lot of empty command prompt lines. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make Emacs not create new lines when repeating the previous GDB command?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-07-18T21:55:43.107" Title="Too many empty prompt lines when repeating the last command in GDB in Emacs" Tags="|gdb|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24667" PostTypeId="1" AcceptedAnswerId="24669" CreationDate="2016-07-19T02:06:37.640" Score="4" ViewCount="349" Body="&lt;p&gt;I have this in my &lt;code&gt;.emacs&lt;/code&gt; file to disable mouse right clicks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'mouse-save-then-kill 'disabled &quot;mouse-save-then-kill disabled\n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I now disable the query generated by emacs to turn this command back on (&quot;&lt;code&gt;Do you want to use this command anyway? You can now type [y/n/SPC/!]&lt;/code&gt;&quot;) ?&lt;/p&gt;&#xA;" OwnerUserId="2421" LastEditorUserId="105" LastEditDate="2016-07-19T03:36:28.723" LastActivityDate="2016-07-19T07:50:06.057" Title="How to disable query to turn on disabled command?" Tags="|key-bindings|mouse|commands|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24669" PostTypeId="2" ParentId="24667" CreationDate="2016-07-19T03:47:25.897" Score="6" Body="&lt;p&gt;Put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq disabled-command-function 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, disabling a command means that you get that prompt when you try to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can override this design by setting variable &lt;code&gt;disabled-command-function&lt;/code&gt; to a function other than its default value, &lt;code&gt;disabled-command-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see the code for disabling and enabling in library &lt;code&gt;novice.el&lt;/code&gt;.  You can find this out for yourself by doing &lt;code&gt;C-h f disable-command&lt;/code&gt; and clicking the link to go to the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Disabling.html&quot; rel=&quot;noreferrer&quot;&gt;Disabling&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any non-&lt;code&gt;nil&lt;/code&gt; value for property &lt;code&gt;disabled&lt;/code&gt; for symbol &lt;code&gt;mouse-save-then-kill&lt;/code&gt; means that that command is disabled. A &lt;code&gt;nil&lt;/code&gt; value means that that command is enabled (is not disabled).  But your use of a non-&lt;code&gt;nil&lt;/code&gt; value does not mean that &lt;em&gt;mouse right-clicking&lt;/em&gt; is disabled. It means only that command &lt;code&gt;mouse-save-then-kill&lt;/code&gt; is disabled. It so happens that a right-click invokes that command by default.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-07-19T03:52:25.943" LastActivityDate="2016-07-19T03:52:25.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24670" PostTypeId="2" ParentId="24667" CreationDate="2016-07-19T07:42:31.543" Score="5" Body="&lt;p&gt;Drew's answer solves your stated question so I would suggest accepting that; but my best guess is that something like this is what you're &lt;em&gt;actually&lt;/em&gt; after:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [remap mouse-save-then-kill] 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(to effectively disable all bindings for that command)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or maybe just:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;&amp;lt;mouse-3&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(to remove just that specific binding)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or a more extreme approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'mouse-save-then-kill 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(to completely redefine the command, ensuring that it never does anything, no matter how it's called)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-07-19T07:50:06.057" LastActivityDate="2016-07-19T07:50:06.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24671" PostTypeId="1" CreationDate="2016-07-19T08:42:13.230" Score="2" ViewCount="83" Body="&lt;p&gt;I'm looking for a particular LaTeX indentation feature regarding sections, subsections etc. Specifically, I would like to start the text within a section (assuming &lt;code&gt;\section&lt;/code&gt; is the highest sectioning level) at column 4, in a subsection in column 6 etc., like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\begin{document}&#xA;  some text not in a section: col 2&#xA;&#xA;  \section{Second Section}&#xA;    Section text: col 4&#xA;    \subsection{First Subsection}&#xA;      Subsection text in col 6&#xA;      \begin{..}&#xA;        standard extra indentation for environments&#xA;      \end{..}&#xA;&#xA;  \section{Last Section}&#xA;    Again some text in col 4&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The other indentation rules should be unchanged (extra indentation for environments etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;\section&lt;/code&gt; is not an environment, I could not find anything in the AUCTeX customization. Is there a simple way to do this?&lt;/p&gt;&#xA;" OwnerUserId="12689" LastActivityDate="2016-07-19T08:42:13.230" Title="Fixed indentation for sectioning commands" Tags="|indentation|auctex|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24672" PostTypeId="1" CreationDate="2016-07-19T08:47:23.187" Score="1" ViewCount="345" Body="&lt;p&gt;When the autocomplete from company-racer kicks in, it shows the path where it is found for some reason. For example, if I start typing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;use std::i&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it comes up with io /usr/src/rust/src/libstd/io/mod.rs : Module&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I hide this path so it just suggests io?&lt;/p&gt;&#xA;" OwnerUserId="12507" LastActivityDate="2016-07-19T08:47:23.187" Title="Rust autocomplete - hide paths where stuff is found" Tags="|company-mode|auto-complete-mode|rust|racer|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24673" PostTypeId="1" AcceptedAnswerId="24679" CreationDate="2016-07-19T08:56:27.660" Score="8" ViewCount="1292" Body="&lt;p&gt;Let's say I just did a commit with changes to two files. Now I would like to have just one of the files in that commit, and I would like to stash the other file. So, in essence, I would like to soft reset, unstage one of the files, recommit with the same message (or maybe change it). And after all that, I will have the second file not committed, and I can stash it, or stage it and commit it anew or whatever.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to do that in GitX easily, by just clicking the &lt;code&gt;amend last commit&lt;/code&gt; checkbox. It would show the staged changes, the commit message etc, and I could just change the message, or stage more, unstage some, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do that in magit?&lt;/p&gt;&#xA;" OwnerUserId="10463" LastActivityDate="2016-07-19T13:31:50.403" Title="Unstage something from the last commit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24675" PostTypeId="1" AcceptedAnswerId="24680" CreationDate="2016-07-19T11:05:34.817" Score="1" ViewCount="238" Body="&lt;p&gt;I want to redefine &lt;code&gt;C-w&lt;/code&gt; to run one of my commands. &lt;code&gt;evil&lt;/code&gt; has already defined a number of key sequences that start with &lt;code&gt;C-w&lt;/code&gt; to run its commands. So my command does not run, Emacs just waits for me to complete the sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can undefine all existing sequences starting with &lt;code&gt;C-w&lt;/code&gt; so that Emacs will then run my &lt;code&gt;C-w&lt;/code&gt; command?&lt;/p&gt;&#xA;" OwnerUserId="2194" LastEditorUserId="253" LastEditDate="2016-07-19T12:46:48.330" LastActivityDate="2016-07-19T13:47:42.360" Title="How can I redefine a key that is currently used as the start of a key sequence?" Tags="|key-bindings|evil|prefix-keys|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24676" PostTypeId="1" CreationDate="2016-07-19T11:30:59.743" Score="4" ViewCount="1775" Body="&lt;p&gt;i tried converting html webpages to org mode file using a simple pandoc command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pandoc -o output.org R\ Seminar:\ Introduction\ to\ ggplot2.htm  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this works quite well but im left with tons of html blocks that look like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_HTML&#xA;  &amp;lt;div class=&quot;rcode&quot;&amp;gt;&#xA;#+END_HTML&#xA;&#xA;#+BEGIN_HTML&#xA;  &amp;lt;div class=&quot;source&quot;&amp;gt;&#xA;#+END_HTML&#xA;&#xA;#+BEGIN_EXAMPLE&#xA;    #declare data and x and y aesthetics, but no shapes yet&#xA;    ggplot(data = Milk, aes(x=Time, y=protein))&#xA;#+END_EXAMPLE&#xA;&#xA;#+BEGIN_HTML&#xA;  &amp;lt;/div&amp;gt;&#xA;#+END_HTML&#xA;&#xA;#+BEGIN_HTML&#xA;  &amp;lt;/div&amp;gt;&#xA;#+END_HTML&#xA;&#xA;#+BEGIN_HTML&#xA;  &amp;lt;div class=&quot;rimage default&quot;&amp;gt;&#xA;#+END_HTML&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;any clue how to get rid of these annoying #+BEGIN_HTML blocks during conversion?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2018-06-24T20:33:31.527" LastActivityDate="2018-08-31T22:11:17.260" Title="html to orgmode via pandoc- get rid of all #+BEGIN_HTML blocks" Tags="|org-mode|pandoc|" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24678" PostTypeId="1" AcceptedAnswerId="24686" CreationDate="2016-07-19T12:20:32.343" Score="4" ViewCount="324" Body="&lt;p&gt;I'm using the slick-cut function (as answered &lt;a href=&quot;https://emacs.stackexchange.com/a/2348/12247&quot;&gt;here&lt;/a&gt; by &lt;a href=&quot;https://emacs.stackexchange.com/users/504/itsjeyd&quot;&gt;itsjeyd&lt;/a&gt;) for killing the entire line with minimal keystrokes. It's defined like so :- &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun slick-cut (beg end)&#xA;  (interactive&#xA;   (if mark-active&#xA;       (list (region-beginning) (region-end))&#xA;     (list (line-beginning-position) (line-beginning-position 2)))))&#xA;&#xA;(advice-add 'kill-region :before #'slick-cut)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, I noticed this behaviour, whenever I kill a line, the cursor will be positioned to the beginning of the next line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before killing line 28 :-&#xA;&lt;a href=&quot;https://i.stack.imgur.com/wX2qC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wX2qC.png&quot; alt=&quot;before killing line 28&quot;&gt;&lt;/a&gt;&#xA;After killing line 28 :-&#xA;&lt;a href=&quot;https://i.stack.imgur.com/KKg9a.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KKg9a.png&quot; alt=&quot;After killing line 28&quot;&gt;&lt;/a&gt;&#xA;Is there a way one can modify the slick-cut function so that, after killing a line, the cursor column position is also preserved. Like so :- &#xA;&lt;a href=&quot;https://i.stack.imgur.com/sHxyl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sHxyl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If unable to preserve cursor position, is it possible to at least move the cursor position to the indentation level ?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2022-08-23T11:14:40.787" Title="kill the current line and preserving cursor position" Tags="|text-editing|cursor|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24679" PostTypeId="2" ParentId="24673" CreationDate="2016-07-19T12:28:20.503" Score="11" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I will have the second file not committed, and I can stash it, or stage it and commit it anew or whatever. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The quickest way to get this in magit is hit &lt;kbd&gt;RET&lt;/kbd&gt; on the top line of the status to show the &lt;code&gt;HEAD&lt;/code&gt; commit, then in the &lt;code&gt;*magit-revision&lt;/code&gt; buffer hit &lt;kbd&gt;u&lt;/kbd&gt; on the part you don't want in the commit (this can be a whole file, a hunk, or even part of a hunk; and you can do this multiple times).  Then &lt;kbd&gt;c e&lt;/kbd&gt; (or &lt;kbd&gt;c a&lt;/kbd&gt; if you want to edit the commit message) to remove the part(s) from the commit.  This requires &lt;code&gt;magit-unstage-committed&lt;/code&gt; to be set to &lt;code&gt;t&lt;/code&gt; (the default) to allow &lt;code&gt;magit-unstage&lt;/code&gt; to fallback to &lt;code&gt;magit-reverse-in-index&lt;/code&gt; on committed hunks.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can also literally follow the sequence you outlined in magit:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to soft reset,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;X s&lt;/kbd&gt; &lt;code&gt;HEAD~1&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; (If point is on the commit you want to reset to, then it's the default input, and you don't need to type it).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;unstage one of the files,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Navigate to the unstaged file (&lt;kbd&gt;j u&lt;/kbd&gt; jumps to unstaged section), then &lt;kbd&gt;u&lt;/kbd&gt; to unstage it.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;recommit with the same message (or maybe change it).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;c c&lt;/kbd&gt; then &lt;kbd&gt;M-p&lt;/kbd&gt; to retrieve previous message when the COMMIT_EITMSG buffer pops up.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2016-07-19T13:31:50.403" LastActivityDate="2016-07-19T13:31:50.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24680" PostTypeId="2" ParentId="24675" CreationDate="2016-07-19T12:46:32.707" Score="2" Body="&lt;p&gt;By default, &lt;code&gt;evil&lt;/code&gt; binds &lt;code&gt;C-w&lt;/code&gt; to the &lt;code&gt;evil-window-map&lt;/code&gt;,&#xA;within which it stores the rest of the keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In looking at the source code, the core spot it happens is in&#xA;&lt;code&gt;evil-motion-state-map&lt;/code&gt;.  Depending on how you set&#xA;&lt;code&gt;evil-want-C-w-delete&lt;/code&gt; and &lt;code&gt;evil-want-C-w-in-emacs-state&lt;/code&gt;, it&#xA;will also bind the key in &lt;code&gt;evil-insert-state-map&lt;/code&gt; and&#xA;&lt;code&gt;evil-emacs-state-map&lt;/code&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can undefine the key with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map &quot;\C-w&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and, if necessary, with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map &quot;\C-w&quot; nil)&#xA;(define-key evil-emacs-state-map  &quot;\C-w&quot; nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can now bind a different key combination to &lt;code&gt;evil-windows-map&lt;/code&gt;.&#xA;Here's an uncomfortable example, but you get the point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map &quot;\C-!&quot; 'evil-windows-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-19T12:46:32.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24681" PostTypeId="1" AcceptedAnswerId="24710" CreationDate="2016-07-19T12:48:42.707" Score="1" ViewCount="98" Body="&lt;p&gt;If I fire up an eshell an try to type the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ls *&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;*&lt;/code&gt; char is automatically deleted.&#xA;By calling &lt;code&gt;C-h k&lt;/code&gt; on &lt;code&gt;*&lt;/code&gt; I get the expected:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;*&lt;/code&gt; runs the command self-insert-command&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what might be happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 25.0.95.1&lt;br&gt;&#xA;Spacemacs 0.105.21&lt;br&gt;&#xA;OS X 10.11.6&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2016-07-20T11:30:06.877" Title="Eshell cannot insert *" Tags="|eshell|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24682" PostTypeId="2" ParentId="14905" CreationDate="2016-07-19T13:10:41.940" Score="1" Body="&lt;p&gt;Traceback highlighting is provided by the compile package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;M-x compile&lt;/code&gt; to run a script and get traceback highlighting. If you have an existing buffer with a traceback, you can use &lt;code&gt;M-x compilation-minor-mode&lt;/code&gt; to highlight the tracebacks there.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-07-19T13:10:41.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24683" PostTypeId="2" ParentId="24675" CreationDate="2016-07-19T13:47:42.360" Score="0" Body="&lt;p&gt;If your &lt;code&gt;C-w&lt;/code&gt; command is shadowed by evil-mode, the following undefine evil's &lt;code&gt;C-w&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map (kbd &quot;C-w&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to use &lt;code&gt;C-w&lt;/code&gt; command even on insert-state of evil-mode, you should evaluate the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;C-w&quot;) nil)   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12626" LastActivityDate="2016-07-19T13:47:42.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24685" PostTypeId="2" ParentId="24681" CreationDate="2016-07-19T15:15:30.953" Score="1" Body="&lt;p&gt;The problem is caused by company-mode. Disabling it solves the problem. I've opened the issue on spacemacs &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/6635&quot; rel=&quot;nofollow&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2016-07-19T15:15:30.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24686" PostTypeId="2" ParentId="24678" CreationDate="2016-07-19T15:22:01.243" Score="3" Body="&lt;p&gt;Here's a version that does what you want. Just bind it to a key.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xah-cut-line-or-region ()&#xA;  &quot;Cut current line, or text selection.&#xA;When `universal-argument' is called first, cut whole buffer (respects `narrow-to-region').&#xA;&#xA;URL `http://ergoemacs.org/emacs/emacs_copy_cut_current_line.html'&#xA;Version 2016-07-29-stackoverflow&quot;&#xA;  (interactive)&#xA;  (if current-prefix-arg&#xA;      (progn ; not using kill-region because we don't want to include previous kill&#xA;        (kill-new (buffer-string))&#xA;        (delete-region (point-min) (point-max)))&#xA;    (if (use-region-p)&#xA;        (kill-region (region-beginning) (region-end) t)      &#xA;      (progn&#xA;        (kill-region (line-beginning-position) (line-beginning-position 2))&#xA;        (back-to-indentation)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice the &lt;code&gt;(back-to-indentation)&lt;/code&gt; in the end. That does what you want.&#xA;Thanks to @kaushalmodi for suggesting this.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-07-29T08:23:54.233" LastActivityDate="2016-07-29T08:23:54.233" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24687" PostTypeId="2" ParentId="24592" CreationDate="2016-07-19T16:53:31.800" Score="2" Body="&lt;p&gt;This answer does not address &lt;code&gt;evil-vimish-mode&lt;/code&gt;.  Instead, if&#xA;you're agnostic about which particular package does the folding&#xA;for you, you can try the built-in Hideshow mode&#xA;(&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;,&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/HideShow&quot; rel=&quot;nofollow&quot;&gt;wiki page&lt;/a&gt;).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hideshow mode is a buffer-local minor mode that allows you to&#xA;  selectively display portions of a program, which are referred to&#xA;  as blocks. Type M-x hs-minor-mode to toggle this minor mode (see&#xA;  Minor Modes).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When you use Hideshow mode to hide a block, the block disappears&#xA;  from the screen, to be replaced by an ellipsis (three periods in a&#xA;  row). Just what constitutes a block depends on the major mode. In&#xA;  C mode and related modes, blocks are delimited by braces...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can enable it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'js-mode-hook #'hs-minor-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's got some odd default keybindings (&lt;code&gt;C-c @ ...&lt;/code&gt;), so you'll&#xA;probably want to rebind them to something more comfortable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an old blog post from&#xA;&lt;a href=&quot;http://emacs-fu.blogspot.com/2008/12/showing-and-hiding-blocks-of-code.html&quot; rel=&quot;nofollow&quot;&gt;Emacs-Fu&lt;/a&gt;&#xA;that describes Hideshow.  For an example with JavaScript, see&#xA;&lt;a href=&quot;http://blog.deadpansincerity.com/2011/05/setting-up-emacs-as-a-javascript-editing-environment-for-fun-and-profit/&quot; rel=&quot;nofollow&quot;&gt;this old blog post&lt;/a&gt;&#xA;where it discusses &quot;Code Folding.&quot;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-19T16:53:31.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24688" PostTypeId="1" CreationDate="2016-07-19T17:53:01.073" Score="2" ViewCount="201" Body="&lt;p&gt;When writing Javascript, I always put curly brackets after &lt;code&gt;if&lt;/code&gt; in a new line, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if(a == 0)&#xA;{&#xA;    ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I do that in web-mode, the default is like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if(a == 0)&#xA;    {&#xA;        ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW the same goes with &lt;code&gt;for&lt;/code&gt;, but not with function definition.  Version information:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;versions: emacs(25.1) web-mode(&quot;14.0.13”)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don’t have this problem in the plain javascript-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here’s a minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&#xA;&amp;lt;html lang=&quot;en&quot;&amp;gt;&#xA;  &amp;lt;head&amp;gt;&#xA;    &amp;lt;meta charset=&quot;UTF-8&quot; /&amp;gt;&#xA;  &amp;lt;/head&amp;gt;&#xA;  &amp;lt;body&amp;gt;&#xA;  &amp;lt;/body&amp;gt;&#xA;  &amp;lt;script&amp;gt;&#xA;   var a = 0;&#xA;   if(a == 0)&#xA;       {&#xA;           a = 1;&#xA;       }&#xA;  &amp;lt;/script&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Scott Weldon in the comments suggested, I tried several things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I updated web-mode to 14.0.19.  Same problem.&lt;/li&gt;&#xA;&lt;li&gt;I tried using web-mode in a clean Emacs. Same problem.  What I did was:&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I ran &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Then I &lt;code&gt;M-x load-library RET ~/.emacs.d/elpa/web-mode-20160717.1201/web-mode.el&lt;/code&gt; to load web-mode.&lt;/li&gt;&#xA;&lt;li&gt;I then tried the minimal example.&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="514" LastEditorUserId="514" LastEditDate="2016-07-20T16:18:58.473" LastActivityDate="2016-07-20T16:18:58.473" Title="Web-mode javascript indentation for “if” and “for”" Tags="|indentation|web-mode|" AnswerCount="0" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24689" PostTypeId="1" CreationDate="2016-07-19T22:26:15.067" Score="2" ViewCount="877" Body="&lt;p&gt;Is there a function that will tell me for a given library foo if &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;has previously happened?&lt;/p&gt;&#xA;" OwnerUserId="10777" LastActivityDate="2022-02-13T20:53:38.637" Title="How to tell if a emacs library is loaded?" Tags="|load-path|require|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24690" PostTypeId="1" CreationDate="2016-07-19T22:30:02.997" Score="7" ViewCount="1472" Body="&lt;p&gt;If I insert a jpg in my org-mode document, I can preview it and scale its width, like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the following code to my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-image-actual-width nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then insert this code in my document, where I want the image to appear:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_ORG: :width 300&#xA;[[./my_image.jpg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On executing &lt;code&gt;org-toggle-inline-images&lt;/code&gt; the image appears in the buffer, 300px wide, as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I attempt this same operation with an SVG file, I get a blank placeholder. If I then remove the &lt;code&gt;#+ATTR_ORG&lt;/code&gt; tag, the SVG appears. (at it's pre-defined width)...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me how I can resize my SVGs image previews? I am running the &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport/releases&quot; rel=&quot;noreferrer&quot;&gt;macports version of Emacs&lt;/a&gt; version 25.1 on El Capitan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="12695" LastEditDate="2016-07-30T11:21:58.583" LastActivityDate="2016-07-30T11:21:58.583" Title="Scaling of inline SVG previews in org-mode" Tags="|org-mode|preview-latex|previewing|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24691" PostTypeId="1" CreationDate="2016-07-19T22:30:52.250" Score="2" ViewCount="2051" Body="&lt;p&gt;I am trying to create an org-capture template for a grocery list, but there seems to be no easy way to get the result I want, and I'm pretty bad at programming. So I was hoping that maybe someone has a solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have a template that does the following: I have a grocery.org file, that should have roughly the following structure: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* &amp;lt;Todays Date&amp;gt; &#xA;- [ ] item 1 &#xA;- [ ] item 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The template should check if there already is a headline with the current date. If so, just add an item to the list. If not, create the headline with the current date and start the list. &#xA;I tried a couple of things with the standard tools of org-capture, like (file+headline) and (checkitem) and so on, but I really cant get that done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really hope someone can offer some help, thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="12299" LastActivityDate="2017-04-16T05:51:55.533" Title="creating an org-capture template" Tags="|org-mode|org-capture|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24693" PostTypeId="1" AcceptedAnswerId="24695" CreationDate="2016-07-19T22:39:47.083" Score="2" ViewCount="232" Body="&lt;p&gt;When I'm in &lt;code&gt;Help-mode&lt;/code&gt; buffer generated from &lt;code&gt;describe-function&lt;/code&gt; or similar command - after placing cursor on clickable filename text I wish to open this file in the same window (ideally I wish I could also kill this help buffer the same time). How can I achieve that?&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-07-21T12:45:09.900" Title="Make opening clickable filenames from Help mode in same window" Tags="|help-mode|buttons|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24694" PostTypeId="1" CreationDate="2016-07-20T00:26:32.800" Score="3" ViewCount="250" Body="&lt;p&gt;I can not figure out why does when I factored out function it started to work wrong. &#xA;Here's the my function to kill all dired buffers, its bound to &lt;code&gt;dired-mode-map&lt;/code&gt; that work as expected and successfully kill all dired buffers when I invoke it in dired buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sandric/dired-kill-buffers ()&#xA;  (interactive)&#xA;  (mapc (lambda (buffer)&#xA;          (when (eq 'dired-mode (buffer-local-value 'major-mode buffer))&#xA;            (kill-buffer buffer)))&#xA;        (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I decided to factor out a function to kill all buffers by major mode name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sandric/kill-buffers-by-major-mode (mode-name)&#xA;  &quot;Kill open buffers by major mode name&quot;&#xA;  (interactive)&#xA;  (mapc (lambda (buffer)&#xA;          (when (eq mode-name (buffer-local-value 'major-mode buffer))&#xA;            (kill-buffer buffer)))&#xA;        (buffer-list)))&#xA;&#xA;(defun sandric/dired-kill-buffers ()&#xA;  (interactive)&#xA;  (sandric/kill-buffers-by-major-mode 'dired-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And now it works wrongly - it kills only current dired buffer and not killing parent ones. I can not understand why - it looks like nested function get bounded to current buffer and stops executing after it gets killed. Can anyone explain me why is it so and how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="105" LastEditDate="2016-07-20T01:46:14.413" LastActivityDate="2016-09-26T16:10:07.700" Title="Elisp nested function stops execution" Tags="|buffers|functions|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24695" PostTypeId="2" ParentId="24693" CreationDate="2016-07-20T01:36:22.727" Score="1" Body="&#xA;&#xA;&lt;p&gt;Here is a &lt;code&gt;push-button&lt;/code&gt; function wrapper:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eab/push-button-on-file-same-window ()&#xA;  (interactive)&#xA;  (let ((cwc (current-window-configuration))&#xA;        (hb (current-buffer))&#xA;        (file? (button-get (button-at (point)) 'help-args)))&#xA;    (funcall&#xA;     `(lambda ()&#xA;        (defun eab/push-button-on-file-same-window-internal ()&#xA;          (if (&amp;gt; (length ',file?) 1)&#xA;              (let ((cb (current-buffer)))&#xA;                (set-window-configuration ,cwc)&#xA;                (switch-to-buffer cb)&#xA;                (kill-buffer ,hb)))))))&#xA;  (call-interactively 'push-button)&#xA;  (run-with-timer 0.01 nil 'eab/push-button-on-file-same-window-internal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It implements required behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upd. Removed unnecessary &lt;code&gt;file-exist-p&lt;/code&gt; checking. Now it works for &lt;code&gt;C source&lt;/code&gt; files.&lt;/p&gt;&#xA;" OwnerUserId="2064" LastEditorUserId="2064" LastEditDate="2016-07-21T12:45:09.900" LastActivityDate="2016-07-21T12:45:09.900" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24696" PostTypeId="2" ParentId="24691" CreationDate="2016-07-20T01:50:17.670" Score="2" Body="&lt;p&gt;If you're willing to have things filed as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* &amp;lt;year&amp;gt;&#xA;** &amp;lt;month&amp;gt;&#xA;*** &amp;lt;day&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then using the &lt;code&gt;file+datetree&lt;/code&gt; capture target instead of &lt;code&gt;file+headline&lt;/code&gt; will work.  It files to the current date, creating it if it doesn't exist.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-07-20T01:50:17.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24698" PostTypeId="1" CreationDate="2016-07-20T02:45:53.307" Score="7" ViewCount="2625" Body="&lt;p&gt;When you run various &quot;modern&quot; compilation or test tools you get ANSI codes in the output. I'd like to either render them correctly (ideally) or otherwise strip them. I've tried applying either &lt;code&gt;term-mode-hook&lt;/code&gt; to the &lt;code&gt;compilation-minor-mode&lt;/code&gt; as suggested in &lt;a href=&quot;https://superuser.com/questions/416567/combine-compilation-mode-and-ansi-term-mode-in-emacs&quot;&gt;this superuser post&lt;/a&gt;, and also a similar approach using &lt;code&gt;shell-mode&lt;/code&gt; as per &lt;a href=&quot;https://stackoverflow.com/questions/27450173/emacs-compile-python-vs-running-in-shell&quot;&gt;this stackoverflow post&lt;/a&gt;, to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have this working?&lt;/p&gt;&#xA;" OwnerUserId="215" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2018-08-29T03:26:24.913" Title="ANSI escape sequences in compilation-mode" Tags="|compile-mode|ansi|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24699" PostTypeId="1" CreationDate="2016-07-20T02:53:32.937" Score="0" ViewCount="46" Body="&lt;p&gt;I've noticed that if function &lt;code&gt;f&lt;/code&gt; is used to advise function &lt;code&gt;g&lt;/code&gt; through &lt;code&gt;advice-add&lt;/code&gt;, and function &lt;code&gt;f&lt;/code&gt; is then redefined, function &lt;code&gt;g&lt;/code&gt;'s advice is not updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After digging into &lt;code&gt;advice-add&lt;/code&gt; a bit, it is clear that &lt;code&gt;advice-add&lt;/code&gt; uses &lt;code&gt;add-function&lt;/code&gt; behind the scenes, which means that it extracts the value in the function cell of &lt;code&gt;f&lt;/code&gt; and uses it to advise &lt;code&gt;g&lt;/code&gt;. Therefore, when &lt;code&gt;f&lt;/code&gt; is redefined, &lt;code&gt;g&lt;/code&gt; is not affected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering why such a design decision was made. Is there a good reason that we &lt;em&gt;shouldn't&lt;/em&gt; or &lt;em&gt;couldn't&lt;/em&gt; allow updating &lt;code&gt;f&lt;/code&gt; to update &lt;code&gt;g&lt;/code&gt;'s advice as well? &lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-07-20T02:53:32.937" Title="Updating advice in function" Tags="|advice|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24701" PostTypeId="1" AcceptedAnswerId="24715" CreationDate="2016-07-20T07:56:35.543" Score="2" ViewCount="93" Body="&lt;p&gt;I am using emacs on a debian system and have installed emacs-goodies-el. One of the many things in there is &lt;code&gt;todoo&lt;/code&gt; which registers itself in &lt;code&gt;auto-mode-alist&lt;/code&gt; for all files ending in &lt;code&gt;TODO&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This particular association is in the way and I would like to either get rid of &lt;code&gt;todoo&lt;/code&gt; or just change the entry in the &lt;code&gt;auto-mode-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to find a switch in &lt;code&gt;customize-group emacs-goodies-el&lt;/code&gt; but there seems to be nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've got a few incantations in a file in &lt;code&gt;~/.emacs.d&lt;/code&gt; and could add to those, but fiddling with with &lt;code&gt;auto-mode-alist&lt;/code&gt; seems a bit daunting. The entry I need to get rid of is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;TODO\\'&quot; . todoo-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if anyone knows off-hand how to easily disable &lt;code&gt;todoo&lt;/code&gt; in &lt;code&gt;emacs-goodies-el&lt;/code&gt;, let me know. Alternatively a hint how to remove this element from the alist or just define a different file pattern would help.&lt;/p&gt;&#xA;" OwnerUserId="12065" LastEditorUserId="105" LastEditDate="2016-07-20T14:14:00.307" LastActivityDate="2016-07-20T14:53:21.150" Title="Changing the file association of todoo or alternatively completely disable it" Tags="|files|start-up|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24702" PostTypeId="1" CreationDate="2016-07-20T08:21:58.623" Score="2" ViewCount="884" Body="&lt;p&gt;In my init.el file, I have some code to hide the Emacs toolbar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Hide the toolbar&#xA;(tool-bar-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I load Emacs, it first enables the toolbar, and then quickly hides it, after it reads through my init.el file. This alone is a small annoyance. But my init.el file is getting pretty long. And now Emacs must go through a whole series of spastic &lt;em&gt;corrections&lt;/em&gt;, every time it loads...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make Emacs process init.el &lt;em&gt;before&lt;/em&gt; it launches the first frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am on a Mac, running MacPorts Emacs, version 24.5.4.&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="253" LastEditDate="2016-07-20T16:08:39.457" LastActivityDate="2016-07-20T22:28:57.383" Title="Hide emacs frame until loaded" Tags="|init-file|frames|start-up|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24703" PostTypeId="2" ParentId="24702" CreationDate="2016-07-20T08:43:47.833" Score="3" Body="&lt;p&gt;Yes, run &lt;code&gt;emacs --daemon&lt;/code&gt; and then open a frame via &lt;code&gt;emacsclient&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the command-line options for each executable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. You can use &lt;code&gt;emacsclient -a '' -c&lt;/code&gt; to start the server (if necessary) and open a GUI frame, in a single command.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-07-20T08:43:47.833" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24704" PostTypeId="1" CreationDate="2016-07-20T08:57:27.437" Score="4" ViewCount="1419" Body="&lt;p&gt;Anyone know of a way to convert rmarkdown (rmd) files to orgmode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;im preparing a R course and lots of cool examples in R are in rmd format so it could be very useful to me.&#xA;I tried via pandoc but results were not great&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-07-20T11:08:11.280" Title="convert rmarkdown (rmd) files to orgmode?" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24705" PostTypeId="1" CreationDate="2016-07-20T09:34:48.010" Score="2" ViewCount="51" Body="&lt;p&gt;when I export org file into HTML or LaTex, the source code in the block cannot fold, Is there any setting can fold the text inside the source code block?&lt;/p&gt;&#xA;" OwnerUserId="12702" LastActivityDate="2016-07-20T09:34:48.010" Title="Question about emacs org mode exporting" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24706" PostTypeId="2" ParentId="24336" CreationDate="2016-07-20T10:00:28.570" Score="2" Body="&lt;p&gt;Not sure if it qualifies as good, but these are two workflows I use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;For fork -&gt; master workflow:&lt;/strong&gt;&#xA;In this case I have the main remote called &lt;code&gt;origin&lt;/code&gt; and a my fork remote which I imaginatively call &lt;code&gt;fork&lt;/code&gt; I set the origin as my upstream and the fork as my &lt;code&gt;push:Remote&lt;/code&gt;. So my changes are always pushed to my fork and any new changes on upstream are pulled from upstream&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;For feature-branch -&gt; master workflow&lt;/strong&gt;:&#xA;My master branch/epic branch is the upstream here and my feature-branch is the &lt;code&gt;push:Remote&lt;/code&gt; branch. Changes are pushed to my feature and upstream changes are pulled from my master/epic branch. The need to push to both remotes usually never appears in my workflow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might however be necessary for people who might be part of the organisation itself and have a dedicated branch for that feature in both repos. In this case the dedicated branch in the original repo might receive commits from multiple authors while the same branch on the fork will be used only by one author. In such cases, it might be necessary to push to both remotes.&lt;/p&gt;&#xA;" OwnerUserId="5196" LastActivityDate="2016-07-20T10:00:28.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24707" PostTypeId="1" CreationDate="2016-07-20T10:50:42.310" Score="3" ViewCount="1358" Body="&lt;p&gt;I am trying to define a custom agenda view that includes two agenda commands:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The first will list all unscheduled tasks with tag A (&lt;strong&gt;using standard view&lt;/strong&gt;).&lt;/li&gt;&#xA;&lt;li&gt;The second will list all scheduled tasks with tag A (&lt;strong&gt;using column view&lt;/strong&gt;, one column of which is the SCHEDULED timestamp).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following code (code v1) works but does not include column view for the second agenda command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  '((&quot;c&quot; &quot;My Custom View&quot;&#xA;    ((tags-todo &quot;TAGA&quot;&#xA;        ((org-agenda-overriding-header &quot;Unscheduled Tasks&quot;)&#xA;         (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))))&#xA;     (tags-todo &quot;TAGA&quot;&#xA;        ((org-agenda-overriding-header &quot;Scheduled Tasks&quot;)&#xA;         (org-agenda-skip-function '(org-agenda-skip-entry-if 'notscheduled))))&#xA; ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am trying to implement &lt;code&gt;org-agenda-view-columns-initially&lt;/code&gt; in the second agenda command (code v2):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  '((&quot;c&quot; &quot;My Custom View&quot;&#xA;    ((tags-todo &quot;TAGA&quot;&#xA;        ((org-agenda-overriding-header &quot;Unscheduled Tasks&quot;)&#xA;         (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))))&#xA;     (tags-todo &quot;TAGA&quot;&#xA;        ((org-agenda-overriding-header &quot;Scheduled Tasks&quot;)&#xA;         (org-agenda-skip-function '(org-agenda-skip-entry-if 'notscheduled))&#xA;         (org-agenda-overriding-columns-format &quot;%TODO %ITEM %SCHEDULED&quot;)&#xA;         (org-agenda-view-columns-initially t)))&#xA; ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I evaluate code v2 and then open the custom agenda view, I get the same result as code v1. However, when applied to a single, simple command as described on &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html&quot; rel=&quot;nofollow&quot;&gt;worg&lt;/a&gt; and by &lt;a href=&quot;http://article.gmane.org/gmane.emacs.orgmode/10114&quot; rel=&quot;nofollow&quot;&gt;Carsten Dominik on the mailing list&lt;/a&gt;, the result is as desired. I am also able to get column view for both scheduled and unscheduled results using code v1 and &lt;code&gt;C-c C-x C-c (org-columns)&lt;/code&gt; but this is not my ideal outcome (I only want column view for the scheduled tasks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this incorrect implementation on my part, or a limitation of &lt;code&gt;org-agenda-view-columns-initially&lt;/code&gt;? Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="11985" LastActivityDate="2016-07-20T10:50:42.310" Title="Column view in org-mode custom agenda command" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24708" PostTypeId="1" AcceptedAnswerId="24712" CreationDate="2016-07-20T10:55:32.027" Score="3" ViewCount="95" Body="&lt;p&gt;I was asked this by a friend, and I couldn't find any information about whether this vulnerability exists in nxml-mode as current or not. I specifically mean &lt;a href=&quot;https://en.wikipedia.org/wiki/Billion_laughs&quot; rel=&quot;nofollow&quot;&gt;this billion laughs attack&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="561" LastActivityDate="2016-07-20T12:30:13.043" Title="Is nxml-mode vulnerable to the billion laughs attack?" Tags="|nxml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24709" PostTypeId="2" ParentId="24704" CreationDate="2016-07-20T11:08:11.280" Score="7" Body="&lt;p&gt;Ok so for anyone interested here is the solution i found&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in R (via the GUI or through R -e command line), first convert the Rmd files to md files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(knitr) # required for knitting from rmd to md&#xA;require(markdown) # required for md to html &#xA;knit('test.rmd', 'test.md') # creates md file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then use pandoc to convert the md files to org:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pandoc -o test.org  test.md   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this gives an almost 1:1 org file&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-07-20T11:08:11.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24710" PostTypeId="2" ParentId="24681" CreationDate="2016-07-20T11:21:17.593" Score="0" Body="&lt;p&gt;To build on the answer from DanielG it is the &lt;em&gt;company-files&lt;/em&gt; backend being a little overly aggressive at deleting the * when it has failed to list any files. Try for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~&#xA;ls .em*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your eshell session. You'll see company pop-up a completion box for all the files/directories in ~ starting with .em. If you actually want to pass * to the shell then type faster. If you type another character before company start evaluation for completions then the * will stay ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've raised a &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/558&quot; rel=&quot;nofollow&quot;&gt;bug against company-mode&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2016-07-20T11:30:06.877" LastActivityDate="2016-07-20T11:30:06.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24711" PostTypeId="1" AcceptedAnswerId="24729" CreationDate="2016-07-20T12:00:26.283" Score="3" ViewCount="807" Body="&lt;p&gt;I've a problem with recentf-mode buffer in emacs. Apart from the files I opened before, its also showing all the autoload files for various packages I've installed which is cluttering the Open recent buffer with unnecessary items. Like so :- &lt;a href=&quot;https://i.stack.imgur.com/kUIH9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kUIH9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I stop emacs from doing this? &lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-07-21T08:28:43.123" Title="Open recent files buffer (recentf-mode) filled with autoload.el files" Tags="|files|recentf|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24712" PostTypeId="2" ParentId="24708" CreationDate="2016-07-20T12:30:13.043" Score="6" Body="&lt;p&gt;Well that's incredibly easy to test, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fire up a new Emacs instance, open a new XML file, paste in the code, see whether Emacs explodes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Spoiler: Yes, it does.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-07-20T12:30:13.043" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24713" PostTypeId="1" CreationDate="2016-07-20T12:32:57.533" Score="7" ViewCount="425" Body="&lt;p&gt;I'm running emacs on Linux with HiDPI display and all X environment I successfully tuned to support it, but in emacs wavy underlines are still looking extremely thin (relatively to font size).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pFQFA.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pFQFA.png&quot; alt=&quot;emacs thin wavy underline&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've checked face settings, but it allows only to customize color and style (wavy or line) of underlines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other options that controlling width/size of underlines?&lt;/p&gt;&#xA;" OwnerUserId="11574" LastActivityDate="2020-08-23T07:27:38.727" Title="Change size of wavy underlines for HiDPI displays" Tags="|faces|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24715" PostTypeId="2" ParentId="24701" CreationDate="2016-07-20T14:27:08.783" Score="4" Body="&lt;p&gt;You can do this to remove the entry.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-mode-alist  (rassq-delete-all 'todoo-mode auto-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure there's a specialized way to remove entry of &lt;code&gt;auto-mode-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-07-20T14:27:08.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24716" PostTypeId="2" ParentId="24701" CreationDate="2016-07-20T14:53:21.150" Score="0" Body="&lt;p&gt;Newer entries take priority over older ones, so you could just do&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(push '(&quot;TODO\\'&quot; . text-mode) auto-mode-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-07-20T14:53:21.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24718" PostTypeId="2" ParentId="24702" CreationDate="2016-07-20T15:28:48.983" Score="1" Body="&lt;p&gt;By placing &lt;code&gt;(tool-bar-mode -1)&lt;/code&gt; at the very &lt;strong&gt;top&lt;/strong&gt; of &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt;, the toolbar will be removed &lt;strong&gt;before&lt;/strong&gt; processing other user-configurations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution/workaround was tested with Emacs version 24.5.1 (built &lt;code&gt;--with-ns&lt;/code&gt;) from &lt;a href=&quot;https://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;https://emacsformacosx.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[My eyes are unable to detect the presence of a toolbar while starting Emacs GUI using this method.]&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-07-20T15:28:48.983" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="24719" PostTypeId="1" AcceptedAnswerId="24720" CreationDate="2016-07-20T16:03:40.960" Score="16" ViewCount="8983" Body="&lt;p&gt;I am trying to set the number of spaces per indent for starting a new function in &lt;code&gt;sh-mode&lt;/code&gt; (bash sub-mode). I have tried setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(sh-basic-offset 2)&#xA;'(sh-indentation 2)&#xA;'(smie-indent-basic 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(as shown in &lt;code&gt;custom-set-variables&lt;/code&gt; in &lt;code&gt;.emacs&lt;/code&gt;) and some others as well, but none of them have had any effect!&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2018-10-31T15:32:14.340" Title="Set indentation for shell script function" Tags="|indentation|shell-mode|bash|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24720" PostTypeId="2" ParentId="24719" CreationDate="2016-07-20T16:15:42.613" Score="11" Body="&lt;p&gt;Setting &lt;code&gt;sh-basic-offset&lt;/code&gt; to the required indentation is what is needed - but what I didn't realise is, it's also necessary to close and reopen all shell script files before the customisation takes effect. I can't remember ever having to do this before in emacs.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-07-20T16:15:42.613" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24722" PostTypeId="1" CreationDate="2016-07-20T18:56:32.473" Score="9" ViewCount="249" Body="&lt;p&gt;I would like to write a major mode for inspecting netCDF files. These are binary files which can be multiple GB in size. So I don't want to open them in emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interaction that I have in mind is the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;User opens netCDF file like any other file in emacs.&lt;/li&gt;&#xA;&lt;li&gt;A command line program (&lt;code&gt;ncdump -h&lt;/code&gt;) is executed on the file and the output is interpreted by emacs.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The problem is that there seems to be no way to stop emacs from actually opening the file.&lt;/p&gt;&#xA;" OwnerUserId="12707" LastEditorUserId="105" LastEditDate="2017-05-16T22:35:26.463" LastActivityDate="2017-05-16T22:35:26.463" Title="How to write a major mode that does not open the file but provides a view on it" Tags="|files|major-mode|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24723" PostTypeId="1" CreationDate="2016-07-20T21:51:32.043" Score="2" ViewCount="359" Body="&lt;p&gt;Is &lt;a href=&quot;https://www.emacswiki.org/emacs/GuileEmacs&quot; rel=&quot;nofollow&quot;&gt;Guile Emacs&lt;/a&gt;, the project to integrate a guile-based elisp interpreter, still alive? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was making headway a few years ago, and seemed like a promising project.  Is it on hold because of lack of interest or time?  Or is it awaiting a maturation of the guile language itself? &lt;/p&gt;&#xA;" OwnerUserId="11547" LastEditorUserId="14920" LastEditDate="2018-05-11T17:51:50.667" LastActivityDate="2018-05-11T17:51:50.667" Title="guile emacs integration update?" Tags="|elisp|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24724" PostTypeId="2" ParentId="24702" CreationDate="2016-07-20T22:28:57.383" Score="1" Body="&lt;p&gt;Under X11 (i.e. mainstream Unix), you can set GUI-related parameters via &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/X-Resources.html#X-Resources&quot; rel=&quot;nofollow noreferrer&quot;&gt;X resources&lt;/a&gt;. To disable toolbars:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs.toolBar: 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not apply to a native Mac program. You can set some GUI parameters through &lt;a href=&quot;https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/defaults.1.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;user defaults&lt;/a&gt; (see examples of &lt;code&gt;defaults write org.gnu.Emacs …&lt;/code&gt; &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsForMacOS&quot; rel=&quot;nofollow noreferrer&quot;&gt;in the Emacs Wiki&lt;/a&gt;), but I don't know if there's one about the toolbar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html#Startup-Summary&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs startup process&lt;/a&gt;, if you want to execute code before the initial frame is opened, you have a few choices. None of them are really intended to do what you want to do but it should work nonetheless. All of them involve changing a file in the directory which is on the load path before your init file runs. You can add load path directories by setting the environment variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html#index-EMACSLOADPATH-environment-variable&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;EMACSLOADPATH&lt;/code&gt;&lt;/a&gt;. In one of those directories, edit or create &lt;code&gt;subdirs.el&lt;/code&gt; and add the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tool-bar-mode 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not affect existing frames, but we're doing this before any frames are started, so I think it will work (but I haven't tested). It may help to also have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist (cons '(tool-bar-lines . 0) default-frame-alist))&#xA;(setq initial-frame-alist (cons '(tool-bar-lines . 0) initial-frame-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But rather than seek this, I would just &lt;a href=&quot;https://emacs.stackexchange.com/a/24703&quot;&gt;start the Emacs daemon&lt;/a&gt; at session startup and then open windows in the existing session as needed.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-07-20T22:28:57.383" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24725" PostTypeId="1" CreationDate="2016-07-20T22:47:34.217" Score="15" ViewCount="7047" Body="&lt;p&gt;is there a facility people use to export plain text to emacs orgmode as part of their research workflow to organise their links and annotations? I heard zotxt is useful, does anyone have opinions on it or of something better?&lt;/p&gt;&#xA;" OwnerUserId="11547" LastActivityDate="2019-01-08T18:50:57.433" Title="zotero workflow into emacs?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24726" PostTypeId="2" ParentId="24655" CreationDate="2016-07-21T05:23:33.783" Score="0" Body="&lt;p&gt;The problem was my &lt;code&gt;package-selected-packages&lt;/code&gt; variable. Somehow due to the order of the packages, &lt;code&gt;package.el&lt;/code&gt; was listing some packages as dependencies. Deleting the variable and restarting Emacs fixed the listing.&lt;/p&gt;&#xA;" OwnerUserId="5196" LastActivityDate="2016-07-21T05:23:33.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24727" PostTypeId="2" ParentId="24725" CreationDate="2016-07-21T06:19:54.860" Score="25" Body="&lt;p&gt;There isn't a single tool, but there are numerous packages that might be helpful if you use Zotero and Emacs alongside one another. There are &lt;a href=&quot;http://www.mkbehr.com/posts/a-research-workflow-with-zotero-and-org-mode/&quot; rel=&quot;noreferrer&quot;&gt;various&lt;/a&gt; &lt;a href=&quot;http://iflysib14.iflysib.unlp.edu.ar/tomas/en/blog/reference-management.html&quot; rel=&quot;noreferrer&quot;&gt;online&lt;/a&gt; &lt;a href=&quot;https://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/&quot; rel=&quot;noreferrer&quot;&gt;tutorials&lt;/a&gt; which discuss setting up combinations of these to the individual author's taste.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than repeating these, I'll try and give an overview, since it's not completely clear from your question what you'd like to do.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;&quot;Research Workflow&quot;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Consider first that the &quot;research workflow&quot;, so far as research literature is concerned, has various steps, such as:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Adding bibliographic items (articles, books, whatever)&lt;/li&gt;&#xA;&lt;li&gt;Editing items' bibliographic data&lt;/li&gt;&#xA;&lt;li&gt;Tagging, grouping and linking items&lt;/li&gt;&#xA;&lt;li&gt;Managing files (e.g. PDFs) associated with items&lt;/li&gt;&#xA;&lt;li&gt;Creating notes on items&lt;/li&gt;&#xA;&lt;li&gt;Searching bibliographic data and notes&lt;/li&gt;&#xA;&lt;li&gt;Inserting citations into documents whilst writing (your own papers)&lt;/li&gt;&#xA;&lt;li&gt;Resolving citations into inline references, footnotes and bibliographies for publication&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In &quot;standard&quot; Zotero, Zotero does 1 to 6, and the Zotero word-processor plug-in does 7 and 8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd suggest thinking first what you want Emacs to do, and what you like about Zotero. You can manage bibliographies and write scientific papers entirely within Emacs; plenty of people do. Instead of Zotero's database bibliographic information is stored in a Bib(La)Tex (&lt;code&gt;.bib&lt;/code&gt;) file, and citations added to LaTeX, org or markdown files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in my view Zotero has particular strengths at 1-4 (adding and managing data) and at 6 (it has a very fast and powerful search tool). Annotating (5) is relatively weak, because the simple text editor is uncomfortable if you're used to Emacs. And if you author your own papers in Emacs you need something that does tasks 7 and 8.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Some packages&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;Getting data into emacs&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you're using Emacs side-by-side with Zotero, Emacs needs some way to see what you have in your database. The best way to do this is to export a &lt;code&gt;.bib&lt;/code&gt; file, for which format Emacs has extensive support, from Zotero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be done manually, but packages like &lt;a href=&quot;https://github.com/vspinu/zotelo&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;zotelo&lt;/code&gt;&lt;/a&gt; or the fork &lt;a href=&quot;https://gist.github.com/andersjohansson/fa7ca643782771b6e15da41514e1358a&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;emacs-zotero-bib-fetch&lt;/code&gt;&lt;/a&gt; will allow you to quickly keep the &lt;code&gt;.bib&lt;/code&gt; file up-to-date from within Emacs. &lt;code&gt;zotelo&lt;/code&gt; requires Mozrepl, which is currently &lt;a href=&quot;https://github.com/vspinu/zotelo/issues/34&quot; rel=&quot;noreferrer&quot;&gt;not supported&lt;/a&gt; by Firefox Quantum, so I recommend using &lt;code&gt;emacs-zotero-bib-fetch&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Viewing data within emacs&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Once you have a &lt;code&gt;.bib&lt;/code&gt; file, the in-built package &lt;code&gt;reftex&lt;/code&gt;, as well as &lt;a href=&quot;https://github.com/jkitchin/org-ref&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;org-ref&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/tmalsburg/helm-bibtex&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;helm-bibtex&lt;/code&gt;&lt;/a&gt; will let you search your bibliographic data. One or both of these latter packages is likely to be very helpful; they do a number of tasks from the list above, including facilities for making notes.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;PDFs and annotating them&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-bibtex&lt;/code&gt; is particularly clever at finding PDFs linked to bibliographic items, which you can then open in Emacs. &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;pdf-tools&lt;/code&gt;&lt;/a&gt; is an excellent alternative PDF viewer within Emacs. It allows you to view and create annotations within the PDF file. If you like using PDF files this way, the &lt;a href=&quot;http://zotfile.com&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;zotfile&lt;/code&gt;&lt;/a&gt; extension for Zotero can extract annotations automatically into a Zotero note.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Note files&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-bibtex&lt;/code&gt; and &lt;code&gt;org-ref&lt;/code&gt; packages both have facilities for adding notes to bibliographic items. These are stored as org files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I have finished my notes on an item I do &lt;code&gt;C-c C-e h o&lt;/code&gt; to export an HTML version and copy and paste this back into Zotero as a note so that it is searchable. I haven't found a slicker way to do this.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Inserting and resolving citations whilst writing&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is partly dependent on what format you write (org, reftex, markdown) and partly dependent on what format you want at the end (PDF, HTML).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, both &lt;code&gt;helm-bibtex&lt;/code&gt; and &lt;code&gt;org-ref&lt;/code&gt; as well as &lt;code&gt;reftex&lt;/code&gt; allow inserting citations into documents you are writing of any of these types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you are writing in org, there is (not yet) a standard citation syntax, but org-ref provides one. Other people just use the LaTeX citation commands directly in org.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your primary output target is PDF, then &lt;code&gt;org-mode&lt;/code&gt;'s own exporting (via LaTeX) is likely the easiest route.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You mention &lt;code&gt;zotxt&lt;/code&gt;; I haven't used this, but it appears to be a tool for resolving and formatting citations in plain text files, including support for &lt;code&gt;pandoc&lt;/code&gt;. Pandoc markdown &lt;em&gt;does&lt;/em&gt; have a standard citation format and support for resolving and formatting bibliographies (using CSL). Pandoc may be preferable if you want to export primarily to multiple formats (e.g. HTML, markdown).&lt;/p&gt;&#xA;" OwnerUserId="9716" LastEditorUserId="9716" LastEditDate="2017-12-05T14:49:18.183" LastActivityDate="2017-12-05T14:49:18.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24728" PostTypeId="1" CreationDate="2016-07-21T07:55:29.180" Score="1" ViewCount="119" Body="&lt;p&gt;i was wondering if orgmode had a simple way to read/source all options from a template file. for example instead of adding all this to every presentation file i create:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+OPTIONS: reveal_center:t reveal_progress:t reveal_history:nil    reveal_control:t&#xA; #+OPTIONS: reveal_center:t &#xA; #+OPTIONS: reveal_rolling_links:t reveal_keyboard:t reveal_overview:t num:nil&#xA; #+OPTIONS: reveal_width:1200 reveal_height:800&#xA;  #+OPTIONS: toc:nil&#xA;  # #+REVEAL: split&#xA;  #+REVEAL_MARGIN: 0.1&#xA;  #+REVEAL_MIN_SCALE: 0.5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i would just source a file (txt or orgmode?) with all the pre definitions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any clue?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-07-21T11:07:20.343" Title="orgmode read/source all options from a template file" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24729" PostTypeId="2" ParentId="24711" CreationDate="2016-07-21T08:28:43.123" Score="3" Body="&lt;p&gt;Setting &lt;code&gt;recentf-exclude&lt;/code&gt; may help you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cf. &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3g468d/stop_recent_files_showing_elpa_packages/&quot; rel=&quot;nofollow&quot;&gt;https://www.reddit.com/r/emacs/comments/3g468d/stop_recent_files_showing_elpa_packages/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-07-21T08:28:43.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24730" PostTypeId="2" ParentId="24728" CreationDate="2016-07-21T11:07:20.343" Score="2" Body="&lt;p&gt;Ok got it, you can &quot;source&quot; a template file by using the SETUPFILE option , ie;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SETUPFILE: /home/zeltak/org/files/Uni/Courses/templates/org.options.reveal.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-07-21T11:07:20.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24731" PostTypeId="1" AcceptedAnswerId="24778" CreationDate="2016-07-21T12:45:03.067" Score="5" ViewCount="1464" Body="&lt;p&gt;I've been tracking my work time in org-mode for several years. My normal practice is to use clocktable mode in the agenda for daily tracking, and a clocktable block in my main projects file for monthly tracking. Both of these give me sums of my work time by file hierarchy, which in my org files corresponds to areas of responsibility and projects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is great, but now I need to be able to track time in this way, but also by type of activity (i.e., how much time on project management tasks, how much time on documentation, how much on customer meetings, etc.). I could tag the particular tasks I work on with tags for type of activity, but is there a way to get summed times (daily or monthly) by tag?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone had to do this (sum times in two different ways)? If so, what did you do?&lt;/p&gt;&#xA;" OwnerUserId="2011" LastActivityDate="2016-07-23T12:20:33.523" Title="Time tracking and reporting with cross-cutting concerns in org-mode" Tags="|org-mode|org-clock|org-clock-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24732" PostTypeId="2" ParentId="24048" CreationDate="2016-07-21T14:11:11.740" Score="1" Body="&lt;p&gt;You can try this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (member &quot;DejaVu Sans Mono&quot; (font-family-list))&#xA;  (set-face-attribute 'default nil :font &quot;DejaVu Sans Mono&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (member &quot;DejaVu Sans Mono&quot; (font-family-list))&#xA;    (add-to-list 'initial-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;))&#xA;    (add-to-list 'default-frame-alist '(font . &quot;DejaVu Sans Mono-10&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-07-21T14:11:11.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24733" PostTypeId="1" AcceptedAnswerId="48918" CreationDate="2016-07-21T14:52:40.247" Score="5" ViewCount="1719" Body="&lt;p&gt;When using &lt;code&gt;Skim&lt;/code&gt; I can export any kind of pdf annotations, including highlighted text, to a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do the same thing with &lt;code&gt;pdf-tools&lt;/code&gt; in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="6988" LastActivityDate="2022-03-26T05:44:53.683" Title="Is it possible to export highlighted text with pdf-tools?" Tags="|pdf-tools|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24734" PostTypeId="1" AcceptedAnswerId="24751" CreationDate="2016-07-21T14:56:34.077" Score="2" ViewCount="154" Body="&lt;p&gt;I'm &quot;new&quot; with Emacs. I'm making my own set up but I can't do one thing with killing words. You know what &lt;code&gt;M-DEL&lt;/code&gt; does by default, but I want to make like Sublime Text or VIM. I'll do an example (this is the original text):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Hi, I'm captainepoch&#xA;&amp;lt; first post here!&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this is how I do on &lt;code&gt;vim&lt;/code&gt; or &lt;code&gt;Sublime Text&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm captainepoch&#xA;&amp;lt; first post here▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm captainepoch&#xA;&amp;lt; first post▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm captainepoch&#xA;&amp;lt; first▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm captainepoch&#xA;&amp;lt;▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm captainepoch&#xA;▮    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Here, there's nothing at the beginning of the line and doing &lt;code&gt;M-DEL&lt;/code&gt; in vim makes the cursor go to the end of the previous line.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm captainepoch▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi,▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This final &lt;code&gt;M-DEL&lt;/code&gt; will end up deleting the whole text.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A friend of mine did this function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun backward-kill-word (arg)&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((init-pos (point))&#xA;        (line-begin (line-beginning-position)))&#xA;    (if (/= (point) line-begin)&#xA;        (kill-word (- arg)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it does the job until it got the &lt;code&gt;&amp;lt;&lt;/code&gt;, which does this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm captainepoch&#xA;&amp;lt;▮ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;M-DEL&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hi, I'm▮ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user11867" LastEditorUserId="115" LastEditDate="2016-07-21T15:49:03.010" LastActivityDate="2016-07-22T01:47:10.313" Title="Kill like vim or Sublime Text" Tags="|deletion|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24736" PostTypeId="1" CreationDate="2016-07-21T15:53:41.643" Score="2" ViewCount="439" Body="&lt;p&gt;I want to export two long tables (each 6X179). I tried to export with latex--&gt;PDF using &lt;code&gt;#+ATTR_LATEX: :float sidewaystable&lt;/code&gt; attribute. But what I get is this &lt;a href=&quot;https://i.stack.imgur.com/5dgEW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;result&lt;/a&gt;, I get just three pages pdf file (tables are cut at the first page). &lt;/p&gt;&#xA;" OwnerUserId="5202" LastActivityDate="2018-04-14T20:32:26.167" Title="Long tables in emacs org do not export correctly through latex-pdf" Tags="|latex|org-table|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24738" PostTypeId="1" CreationDate="2016-07-21T17:53:58.647" Score="8" ViewCount="1856" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I rotate PDFs in &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;pdf-tools&lt;/code&gt;&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes, I want to rotate a PDF page to toggle between portrait&#xA;and landscape.  This comes up in two common settings:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;An academic article has a wide table/figure typeset 90 degrees&#xA;to portrait.&lt;/li&gt;&#xA;&lt;li&gt;I've scanned a book chapter with two book pages to a PDF page,&#xA;and the two book pages are set side-by-side in landscape.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How do I rotate pages 90 degrees?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2019-05-02T13:35:04.507" Title="How do I rotate pages in pdf-tools?" Tags="|pdf-tools|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24739" PostTypeId="2" ParentId="24736" CreationDate="2016-07-21T18:21:06.473" Score="0" Body="&lt;p&gt;I got this to work, &lt;strong&gt;but&lt;/strong&gt; .. it seems like &lt;code&gt;minted&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt; packages do not work well with &lt;code&gt;sidewaystable&lt;/code&gt; environment. So this looks like more of a question for &lt;a href=&quot;https://tex.stackexchange.com/&quot;&gt;https://tex.stackexchange.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you do &lt;code&gt;C-c C-e l o&lt;/code&gt; on the below, pdf generation will fail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;You will need to hack the &lt;code&gt;.tex&lt;/code&gt; file and comment out the &lt;code&gt;\usepackage&lt;/code&gt; lines for &lt;code&gt;minted&lt;/code&gt; and &lt;code&gt;float&lt;/code&gt; if present.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the tex to pdf conversion will happen fine on doing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\latexmk -xelatex -quiet -shell-escape *.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;sidewaystable&lt;/code&gt; value in &lt;code&gt;#+ATTR_LATEX:&lt;/code&gt;, while still works, is deprecated since Org 8.3. &lt;code&gt;sideways&lt;/code&gt; should be used instead.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: toc:nil&#xA;&#xA;#+CAPTION: foo&#xA;#+NAME: tab__foo&#xA;#+ATTR_LATEX: :float sideways&#xA;| Data  | Numero Progr. | Descrizione o Fornitore | Importi delle operazioni |           Importi Imponibili |               Iva |&#xA;|-------+---------------+-------------------------+--------------------------+------------------------------+-------------------|&#xA;| 07/01 |           313 | ACLS Corso              |                   317.20 |                       260.00 |              57.2 |&#xA;| 07/01 |           314 | Libro Amazon            |                    76.59 |                        62.78 |             13.81 |&#xA;| 17/01 |           315 | Bottega della Pizza     |                      8.8 |                         7.21 |              1.59 |&#xA;| 23/01 |           316 | Pizzeria Passaparola    |                    11.00 |                         9.02 |              1.98 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NO3KM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NO3KM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Versions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Emacs 25.1.50.7 of 2016-07-20 built using commit 852111f3a6640d61ea1a1b2fd0cbf50623642927 (master branch).&lt;/li&gt;&#xA;&lt;li&gt;Org-mode version 8.3.4 (release_8.3.4-1049-g481709) (master branch, so actually Org 9.x)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-07-21T18:30:54.267" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24740" PostTypeId="1" AcceptedAnswerId="24742" CreationDate="2016-07-21T18:50:45.537" Score="2" ViewCount="350" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; can I set an &lt;code&gt;org-mode&lt;/code&gt; link to visit a file in read-only mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to store a link to another file in an &lt;code&gt;org-mode&lt;/code&gt; document,&#xA;but, when following the link, I want &lt;code&gt;org&lt;/code&gt; to visit the file in&#xA;read-only mode so that I don't go on autopilot and accidentally&#xA;edit the linked file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to annotate the link so &lt;code&gt;org&lt;/code&gt; knows to visit it in&#xA;read-only mode?  Hypothetically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[read-only-file:somefile.txt][A file that opens in read-only mode]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-21T19:22:12.270" Title="Visit org-mode links in read-only mode?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24741" PostTypeId="1" CreationDate="2016-07-21T18:53:53.960" Score="1" ViewCount="70" Body="&lt;p&gt;I have a problem every so often where I accidentally hit a key combination (don't know what it is) and I get into a state where the letter e (sometimes it is another letter IIRC) is inserted before every normal character. Modifiers are ok like M-x or C-x, but not C-x b - it gets interpreted as C-x e. Backspace is also ok. I've checked my &lt;em&gt;Messages&lt;/em&gt; buffer but don't see anything there (see pasted below). Is there somewhere else I could look or something else I could try to debug or undo when this happens? I would like to find a way out of it so I can undo it when I accidentally do it (having to quit emacs is a pain even with my session saved, since I lose all my active shell buffers and their histories - and my normal steps of saving them manually has a lot of backspacing to remove extra &lt;code&gt;e&lt;/code&gt; chars).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Mark set&#xA;Mark saved where search started&#xA;Mark set&#xA;Grep finished (matches found)&#xA;Mark set [3 times]&#xA;After 0 kbd macro iterations: isearch-search: Keyboard macro terminated by a command ringing the bell [3 times]&#xA;Quit [3 times]&#xA;After 0 kbd macro iterations: isearch-search: Keyboard macro terminated by a command ringing the bell&#xA;Quit [4 times]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 25.0.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F34))&#xA; of 2015-01-14 on pbuckleys-mbp.bos.dataxu.net&lt;/p&gt;&#xA;" OwnerUserId="9831" LastActivityDate="2016-07-21T18:53:53.960" Title="extra e character is inserted before every character" Tags="|insert|characters|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24742" PostTypeId="2" ParentId="24740" CreationDate="2016-07-21T19:22:12.270" Score="4" Body="&lt;p&gt;You can always use an elisp form (see &lt;code&gt;(info &quot;(org) External links&quot;)&lt;/code&gt;), in your case &lt;code&gt;[[elisp:(find-file-read-only &quot;somefile.txt&quot;)][A file that opens in read-only mode]]&lt;/code&gt;. For convenience consider setting &lt;code&gt;org-confirm-elisp-link-function&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-07-21T19:22:12.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24743" PostTypeId="2" ParentId="24738" CreationDate="2016-07-21T19:26:30.537" Score="2" Body="&lt;p&gt;It looks like this feature needs to be added to &lt;code&gt;pdf-tools&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone has already posted an issue on this github requesting this enhancement:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/politza/pdf-tools/issues/89&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;pdf-tools&lt;/code&gt;/&lt;em&gt;Issue#89&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From one &lt;a href=&quot;https://github.com/politza/pdf-tools/issues/89#issuecomment-212066317&quot; rel=&quot;nofollow&quot;&gt;comment&lt;/a&gt;, the workaround used by someone is to,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;use &lt;code&gt;pdftk&lt;/code&gt; to rotate the PDF and save it to another file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-07-21T19:26:30.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24744" PostTypeId="1" AcceptedAnswerId="24919" CreationDate="2016-07-21T22:06:48.707" Score="3" ViewCount="539" Body="&lt;p&gt;I'm trying to run a piece of code when a buffer/window becomes selected. For an example use case, suppose I'm editing a buffer, save it, and kill it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose also the buffer &quot;below&quot; (that appears and becomes selected after my kill operation) has a list of files or something (like dired) that should be refreshed after I did my editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was hoping to find a hook like &lt;code&gt;buffer-selected-hook&lt;/code&gt; or &lt;code&gt;window-selected-hook&lt;/code&gt;, preferably a local buffer hook, so that each time my &quot;dired-like buffer&quot; gets activated, it could run a refresh function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at many dozens of hooks with apropos, but couldn't see anything close to what I seek. Is there a standard way (or possible way) to run a piece of my refresh code when a buffer/window becomes selected?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-07-29T06:19:25.933" Title="How to be notified when a buffer/window becomes selected - no hook available?" Tags="|buffers|selected-window|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="24745" PostTypeId="1" AcceptedAnswerId="24746" CreationDate="2016-07-21T22:15:50.530" Score="0" ViewCount="53" Body="&lt;p&gt;Is there any why to make FlyCheck learn new html tags? Custom tags? or just html5 tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to add them?&lt;/p&gt;&#xA;" OwnerUserId="11531" LastActivityDate="2016-07-21T22:43:05.770" Title="Is there any why to make FlyCheck learn new html tags?" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24746" PostTypeId="2" ParentId="24745" CreationDate="2016-07-21T22:43:05.770" Score="2" Body="&lt;p&gt;Flycheck doesn't know anything about HTML tags; instead, the HTML checker that you use does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For HTML, the only checker available out of the box is &lt;code&gt;html-tidy&lt;/code&gt;; thus, you should check whether &lt;code&gt;html-tidy&lt;/code&gt; supports adding new tags.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-07-21T22:43:05.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24747" PostTypeId="2" ParentId="24568" CreationDate="2016-07-21T23:08:57.237" Score="2" Body="&lt;p&gt;You want the &lt;code&gt;APPT-WARNTIME&lt;/code&gt; property, I think. See section &quot;Appointment Reminders&quot; at the bottom of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(info &quot;(org) Weekly/daily agenda&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For properties:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(info &quot;(org) Properties and columns&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-07-21T23:08:57.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24750" PostTypeId="1" AcceptedAnswerId="24757" CreationDate="2016-07-22T01:03:26.720" Score="3" ViewCount="888" Body="&lt;p&gt;My problem is Emacs with elpy, specifically with &lt;code&gt;(elpy-use-ipython)&lt;/code&gt; in my init file.&#xA;When I try to open a python file, emacs freezes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I desactivate &lt;code&gt;ipython&lt;/code&gt; and emacs runs well. But I wanna use &lt;code&gt;ipython&lt;/code&gt; because it is a great tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My OS is Arch Linux, recently (21/07/2016), ipython upgrades from version 4.2.0 to 5.0.0. The emacs version is 24.5.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how I can fix this issue? How I can use &lt;code&gt;ipython&lt;/code&gt; again?&lt;/p&gt;&#xA;" OwnerUserId="12600" LastEditorUserId="105" LastEditDate="2016-07-22T01:29:53.503" LastActivityDate="2016-12-18T02:09:54.417" Title="Emacs freezes with ipython 5.0.0" Tags="|ipython|elpy|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24751" PostTypeId="2" ParentId="24734" CreationDate="2016-07-22T01:47:10.313" Score="1" Body="&lt;p&gt;I came from sublime as well and was looking for the behavior. I achieve the results you are describing by using &lt;code&gt;syntax-subword&lt;/code&gt; which I think can be installed through MELPA. Here is my &lt;code&gt;syntax-subword&lt;/code&gt; configuration (I use &lt;code&gt;use-package&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package syntax-subword&#xA;  :init&#xA;  (setq syntax-subword-skip-spaces t)&#xA;  :config&#xA;  (global-syntax-subword-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For you, it should be enough to do &lt;code&gt;M-x package-install syntax-subword&lt;/code&gt;, and then add the following to your config file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq syntax-subword-skip-spaces t)&#xA;(global-syntax-subword-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this setup works for you; it has been so long since I have configured Emacs without &lt;code&gt;use-package&lt;/code&gt; that I might have missed a step (e.g., you may need to &lt;code&gt;require&lt;/code&gt; the package). However, on my setup using that package I tested your example, and it works the way you want it to.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-07-22T01:47:10.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24752" PostTypeId="1" AcceptedAnswerId="24753" CreationDate="2016-07-22T02:19:46.207" Score="1" ViewCount="81" Body="&lt;p&gt;I noticed &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;spacemacs&lt;/a&gt; puts things like autosave and backup files in &lt;code&gt;~/.emacs.d/.cache/&lt;/code&gt; and I'd like to use that idea in my own setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/core/core-load-paths.el#L32-L33&quot; rel=&quot;nofollow&quot;&gt;spacemacs/core/core-load-paths.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst spacemacs-cache-directory&#xA;  (expand-file-name (concat user-emacs-directory &quot;.cache/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I considered adding this to my own init.el,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst cache-directory&#xA;  (expand-file-name (concat user-emacs-directory &quot;.cache/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but without the &quot;spacemacs&quot; prefix, &quot;cache-directory&quot; seems like a dangerously generic name, likely to collide with something at some point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still new to emacs, and I don't know enough about scoping in elisp to say whether this is a serious concern. Should I name it something silly like &quot;ivan-cache-directory&quot;, or is there a best practice people stick to? Or is this not actually worth worrying about?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-07-22T02:39:36.870" Title="How to avoid variable name collisions in my init file?" Tags="|init-file|dynamic-scoping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24753" PostTypeId="2" ParentId="24752" CreationDate="2016-07-22T02:39:36.870" Score="3" Body="&lt;p&gt;Using a should-be-unique prefix is recommended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For init file code I like to use &lt;code&gt;my-&lt;/code&gt; because:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it is suitably unlikely to conflict with anything.&lt;/li&gt;&#xA;&lt;li&gt;it's short, but meaningful.&lt;/li&gt;&#xA;&lt;li&gt;it's not my name -- so when I share code with other people it reads just as well in their init file as it does in my own.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-07-22T02:39:36.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24754" PostTypeId="1" CreationDate="2016-07-22T06:47:00.220" Score="1" ViewCount="142" Body="&lt;p&gt;im trying to write a function that will be used in dired where i would launch it on the file at point and it will convert it using pandoc. i have the following code chunk (warning: my coding skills are basiclly zero :))&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun  z/dired-shell-md2org ()&#xA; &quot;&quot;&#xA; (interactive)&#xA; (shell-command (concat &quot;pandoc -o OUTPUT.org&quot; (dired-file-name-at-point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the original pandoc command i use succesfuly is this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pandoc -o EDA.org EDA.md &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;can anyone guide me on 2 things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;how does one get the current file variable (i think its &lt;code&gt;dired-file-name-at-point&lt;/code&gt;) to be the last word&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;is there a way that instead of OUTPUT.org it will use the same filename (sans extension) of original file at point?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Basically i want the converted orf file to have the same name as the original md file&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-08-21T14:54:45.090" Title="help with writing a dired function to convert md to org with pandoc CLI..started but stuck" Tags="|dired|functions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24755" PostTypeId="2" ParentId="2262" CreationDate="2016-07-22T07:29:03.363" Score="0" Body="&lt;p&gt;Emacs 23.1 introduced the &lt;code&gt;locate-user-emacs-file&lt;/code&gt; function, to help library authors to help users to relocate dot files within &lt;code&gt;~/.emacs.d/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, everything which used to look for a file in the home directory will now use this function to &lt;em&gt;first&lt;/em&gt; look for the new preferred name:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;locate-user-emacs-file is a compiled Lisp function in `files.el'.&#xA;&#xA;(locate-user-emacs-file NEW-NAME &amp;amp;optional OLD-NAME)&#xA;&#xA;Return an absolute per-user Emacs-specific file name.&#xA;If NEW-NAME exists in `user-emacs-directory', return it.&#xA;Else if OLD-NAME is non-nil and ~/OLD-NAME exists, return ~/OLD-NAME.&#xA;Else return NEW-NAME in `user-emacs-directory', creating the&#xA;directory if it does not exist.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this means it's possible that some of your dot files in your home directory can simply be renamed to something in your user-emacs-directory, and Emacs will still find and use them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether this is the case for any particular file, and exactly what it should be renamed to, is up to the author of the library in question. Check the library's code for uses of &lt;code&gt;locate-user-emacs-file&lt;/code&gt; to find out if and how it is being used.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-07-22T07:29:03.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24756" PostTypeId="1" AcceptedAnswerId="24763" CreationDate="2016-07-22T07:40:25.853" Score="6" ViewCount="681" Body="&lt;p&gt;In the GUI version of Emacs, it is easy to see that something like &lt;code&gt;(blink-cursor-mode t)&lt;/code&gt; makes the cursor blink.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in a terminal emulator, such as on Mac OS X, it is possible to set things such as the cursor color or whether or not the cursor blinks, in various places (like your &lt;code&gt;~/.profile&lt;/code&gt; or in the Terminal Preferences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is, what determines when a &quot;graphical&quot; element, such as text color, is controlled by a terminal emulator (in Terminal in Mac OS you can set the ANSI colors) versus when Emacs controls it (specifically when Emacs is running in a terminal emulator)&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2016-07-22T15:24:10.737" Title="What controls things like cursor appearance in a terminal?" Tags="|init-file|terminal-emacs|config|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24757" PostTypeId="2" ParentId="24750" CreationDate="2016-07-22T07:50:14.893" Score="2" Body="&lt;p&gt;&lt;code&gt;ipython&lt;/code&gt;  5.0.0 by defautl uses &lt;a href=&quot;https://github.com/jonathanslenders/python-prompt-toolkit&quot; rel=&quot;nofollow&quot;&gt;prompt_toolkit&lt;/a&gt; which is  really nice in a terminal but uses special characters for colors and completion that screws emacs display. Eventually it should be fixed but for now I have this in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq python-shell-interpreter &quot;ipython3&quot;&#xA;    python-shell-interpreter-args &quot;--simple-prompt --pprint&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and run &lt;code&gt;M-x run-python&lt;/code&gt; to lauch the ipython interpreter wihtout &lt;code&gt;prompt_toolkit&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="499" LastActivityDate="2016-07-22T07:50:14.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24758" PostTypeId="2" ParentId="18194" CreationDate="2016-07-22T09:27:58.163" Score="2" Body="&lt;p&gt;Well this might not be the best answer, but what I did was wrap org-capture in a function that sets a global variable to the line number right before calling org-capture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the function I used to set the plus-line-capture:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-plus-line-capture ()&#xA;  (interactive)&#xA;  (setq plus-line-capture (number-to-string (line-number-at-pos)))&#xA;  (org-capture))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in the capture template you can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file://%F::%(concat plus-line-capture)][%^{Link Text}]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9742" LastActivityDate="2016-07-22T09:27:58.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24760" PostTypeId="2" ParentId="24754" CreationDate="2016-07-22T14:26:58.393" Score="1" Body="&lt;p&gt;Sounds like you want something like &lt;code&gt;(format &quot;pandoc -o %s.org&quot; (file-name-base (dired-get-filename)))&lt;/code&gt; instead of &lt;code&gt;(concat...)&lt;/code&gt;. You can use &lt;code&gt;dired-file-name-at-point&lt;/code&gt; if you want to, but that requires point to actually be on the file name, and not just somewhere on the same line.  E.g. (untested):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun  z/dired-shell-md2org ()&#xA; &quot;...&quot;&#xA; (interactive)&#xA; (let ((base  (file-name-base (dired-get-filename))))&#xA;   (shell-command (format &quot;pandoc -o %s.org %.md&quot; base base))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or this (to automatically quote file names for shell etc.):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'dired-aux)&#xA;&#xA;(defun  z/dired-shell-md2org ()&#xA;  &quot;...&quot;&#xA;  (interactive)&#xA;  (let* ((file  (dired-get-filename))&#xA;         (base  (file-name-base file)))&#xA;    (unless (string= &quot;.md&quot; (file-name-extension file :PERIOD))&#xA;      (error &quot;File is not an MD file&quot;))&#xA;    (dired-run-shell-command&#xA;      (dired-shell-stuff-it &quot;pandoc -o &quot;&#xA;                            (list (format &quot; %s.org&quot; base) (format &quot; %s.md&quot; base))&#xA;                            nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-07-22T14:54:36.327" LastActivityDate="2016-07-22T14:54:36.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24761" PostTypeId="1" AcceptedAnswerId="24762" CreationDate="2016-07-22T15:04:31.653" Score="2" ViewCount="1538" Body="&lt;p&gt;I asked another question yesterday but this bothers me a little. I use 4 spaces as indentation for programming (ShellScript, C and Python, mostly). When I want to delete the 4 spaces, I had to do one by one. When I was using &lt;code&gt;vim&lt;/code&gt;, I didn't have to do in that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to set up is that, when you put the cursor at the beginning of the first word after indentation and press &lt;code&gt;DEL&lt;/code&gt;, it deletes the 4 spaces at once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main () {&#xA;    ▮int a = 0;&#xA;    if (a = 0) {&#xA;        printf(&quot;Hello!&quot;);&#xA;    }&#xA;    return 0;&#xA;}&#xA;&#xA;&#xA;int main () {&#xA;▮int a = 0;&#xA;    if (a = 0) {&#xA;        printf(&quot;Hello!&quot;);&#xA;    }&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Suppose that ▮ is with the &lt;code&gt;i&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do that in emacs?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Result of doing &lt;code&gt;C-u C-x =&lt;/code&gt; on the indentation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Jftya.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Jftya.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user11867" LastEditorUserId="115" LastEditDate="2016-07-22T16:47:15.893" LastActivityDate="2016-07-22T16:50:51.050" Title="Delete 4-spaces as a single tab" Tags="|indentation|deletion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24762" PostTypeId="2" ParentId="24761" CreationDate="2016-07-22T15:16:15.777" Score="1" Body="&lt;p&gt;I have tested in &lt;code&gt;emacs -Q&lt;/code&gt; that &lt;code&gt;C-u &amp;lt;backspace&amp;gt;&lt;/code&gt; will delete 4 spaces &lt;strong&gt;backwards&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalent bindings would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-4 &amp;lt;backspace&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-4 &amp;lt;backspace&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Before&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;int main () {&#xA;    ▮int a = 0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(▮ represents &lt;code&gt;point&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;C-u &amp;lt;backspace&amp;gt;&lt;/code&gt; or &lt;code&gt;C-u DEL&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;After&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;int main () {&#xA;▮int a = 0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default &lt;code&gt;C-u&lt;/code&gt; represents a repetition or &lt;strong&gt;4&lt;/strong&gt; for most commands (usually navigation related).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To delete 4 space to the &lt;strong&gt;right&lt;/strong&gt; of the cursor, do &lt;code&gt;C-u C-d&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Before&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;int main () {&#xA;▮    int a = 0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(▮ represents &lt;code&gt;point&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Do &lt;code&gt;C-u C-d&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;After&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;int main () {&#xA;▮int a = 0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On emacs 25.1.50.x (emacs master branch as of now), &lt;code&gt;&amp;lt;backspace&amp;gt;&lt;/code&gt; or &lt;code&gt;DEL&lt;/code&gt; is bound to the &lt;code&gt;backward-delete-char-untabify&lt;/code&gt; command by default.&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-07-22T16:50:51.050" LastActivityDate="2016-07-22T16:50:51.050" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="24763" PostTypeId="2" ParentId="24756" CreationDate="2016-07-22T15:24:10.737" Score="4" Body="&lt;p&gt;The terminal application has full control over the graphical elements. The gui terminal app will give text applications &lt;em&gt;some&lt;/em&gt; control via “&lt;a href=&quot;https://en.wikipedia.org/wiki/ANSI_escape_code&quot; rel=&quot;nofollow&quot;&gt;escape codes&lt;/a&gt;”. For example, vt100/xterm terminals, including Mac OS X Terminal, allow you to change colors using the sequence &lt;code&gt;ESC&lt;/code&gt; &lt;code&gt;[&lt;/code&gt; &lt;em&gt;numbers&lt;/em&gt; &lt;code&gt;m&lt;/code&gt;. Try it in the shell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo -e &quot;\e[1;37;41mhello&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should print the word “hello” in a white foreground on red background. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs uses these codes to control the text color. Note: although most terminals use the same sequences for colors, other codes are not always the same, so applications normally go through some library (termcap? curses?) and the &lt;code&gt;TERM&lt;/code&gt; environment variable to look up what's needed and available in the given terminal. Emacs has &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Terminal_002dSpecific.html&quot; rel=&quot;nofollow&quot;&gt;its own elisp for each terminal type&lt;/a&gt;; see the source file term/xterm.el for example, or term/README for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cursor style is available in some terminals but not all. iTerm2 has &lt;a href=&quot;https://www.iterm2.com/documentation-escape-codes.html&quot; rel=&quot;nofollow&quot;&gt;its own set of sequences&lt;/a&gt;; I don't know if there's a similar list for Mac OS Terminal. They both emulate xterm/vt100 which has a long list &lt;a href=&quot;http://invisible-island.net/xterm/ctlseqs/ctlseqs.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. The “set cursor style” sequences on that page show control over blink/underline/solid, but I don't think Terminal or iTerm2 support those. I've not seen any codes for cursor &lt;em&gt;color&lt;/em&gt;; Emacs on my system is unable to set the cursor color in either Terminal or iTerm2. You can fake blinking by hiding the cursor (&lt;code&gt;ESC&lt;/code&gt; &lt;code&gt;?&lt;/code&gt; &lt;code&gt;2&lt;/code&gt; &lt;code&gt;5&lt;/code&gt; &lt;code&gt;l&lt;/code&gt;) and then showing it again (&lt;code&gt;ESC&lt;/code&gt; &lt;code&gt;?&lt;/code&gt; &lt;code&gt;2&lt;/code&gt; &lt;code&gt;5&lt;/code&gt; &lt;code&gt;h&lt;/code&gt;) at some interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related: an emacs frequently asked question is why you can't bind some keys in the terminal version of emacs, and the answer is that it's up to the terminal to decide which keys are sent to the program, and not all keys are assigned an escape code, so emacs can't see them all.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-07-22T15:24:10.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24765" PostTypeId="1" CreationDate="2016-07-22T18:13:36.457" Score="0" ViewCount="380" Body="&lt;p&gt;I have many color variables defined in my css - LESS file, whose background color i like to highlight on text selection and running this elisp block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-text-properties&#xA; (region-beginning)&#xA; (region-end) &#xA; '(:background (buffer-substring (region-beginning) (region-end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When i chose the word, &lt;code&gt;#ea7600&lt;/code&gt; in this LESS code and eval the above elisp code,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@rw-orange:         **#ea7600**;&#xA;@rw-orange-dark:    #ce6006;&#xA;@rw-orange-light:   #fff5cc;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It didn't change the text's background to orange color. How can i make such a change and persist it too for all future sessions?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2016-07-23T00:39:11.320" LastActivityDate="2016-07-23T00:39:11.320" Title="Change the background color with region text as color code" Tags="|faces|text-properties|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24766" PostTypeId="2" ParentId="24738" CreationDate="2016-07-22T19:08:19.093" Score="4" Body="&lt;p&gt;As @kaushalmodi's post notes, rotation is apparently an open issue&#xA;for &lt;code&gt;pdf-tools&lt;/code&gt;, and it's apparently trickier to implement than&#xA;expected.  Comments on github indicate that a workaround is to use&#xA;&lt;code&gt;pdftk&lt;/code&gt;.  Either I missed the code, or it wasn't posted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's the code for a workaround until rotation gets&#xA;implemented in &lt;code&gt;pdf-tools&lt;/code&gt;.  Two points:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It requires &lt;code&gt;pdftk&lt;/code&gt; to work.&lt;/li&gt;&#xA;&lt;li&gt;It overwrites the file, so be careful.  I haven't used&#xA;&lt;code&gt;pdf-tools&lt;/code&gt; enough to know how it'll interact with the editing&#xA;minor modes, so for now it's only going to work in&#xA;&lt;code&gt;pdf-view-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pdf-view--rotate (&amp;amp;optional counterclockwise-p page-p)&#xA;  &quot;Rotate PDF 90 degrees.  Requires pdftk to work.\n&#xA;Clockwise rotation is the default; set COUNTERCLOCKWISE-P to&#xA;non-nil for the other direction.  Rotate the whole document by&#xA;default; set PAGE-P to non-nil to rotate only the current page.&#xA;\nWARNING: overwrites the original file, so be careful!&quot;&#xA;  ;; error out when pdftk is not installed&#xA;  (if (null (executable-find &quot;pdftk&quot;))&#xA;      (error &quot;Rotation requires pdftk&quot;)&#xA;    ;; only rotate in pdf-view-mode&#xA;    (when (eq major-mode 'pdf-view-mode)&#xA;      (let* ((rotate (if counterclockwise-p &quot;left&quot; &quot;right&quot;))&#xA;             (file   (format &quot;\&quot;%s\&quot;&quot; (pdf-view-buffer-file-name)))&#xA;             (page   (pdf-view-current-page))&#xA;             (pages  (cond ((not page-p)                        ; whole doc?&#xA;                            (format &quot;1-end%s&quot; rotate))&#xA;                           ((= page 1)                          ; first page?&#xA;                            (format &quot;%d%s %d-end&quot;&#xA;                                    page rotate (1+ page)))&#xA;                           ((= page (pdf-info-number-of-pages)) ; last page?&#xA;                            (format &quot;1-%d %d%s&quot;&#xA;                                    (1- page) page rotate))&#xA;                           (t                                   ; interior page?&#xA;                            (format &quot;1-%d %d%s %d-end&quot;&#xA;                                    (1- page) page rotate (1+ page))))))&#xA;        ;; empty string if it worked&#xA;        (if (string= &quot;&quot; (shell-command-to-string&#xA;                         (format (concat &quot;pdftk %s cat %s &quot;&#xA;                                         &quot;output %s.NEW &quot;&#xA;                                         &quot;&amp;amp;&amp;amp; mv %s.NEW %s&quot;)&#xA;                                 file pages file file file)))&#xA;            (pdf-view-revert-buffer nil t)&#xA;          (error &quot;Rotation error!&quot;))))))&#xA;&#xA;(defun pdf-view-rotate-clockwise (&amp;amp;optional arg)&#xA;  &quot;Rotate PDF page 90 degrees clockwise.  With prefix ARG, rotate&#xA;entire document.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (pdf-view--rotate nil (not arg)))&#xA;&#xA;(defun pdf-view-rotate-counterclockwise (&amp;amp;optional arg)&#xA;  &quot;Rotate PDF page 90 degrees counterclockwise.  With prefix ARG,&#xA;rotate entire document.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (pdf-view--rotate :counterclockwise (not arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-07-22T22:01:01.887" LastActivityDate="2016-07-22T22:01:01.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24767" PostTypeId="1" AcceptedAnswerId="24785" CreationDate="2016-07-22T21:32:04.110" Score="0" ViewCount="403" Body="&lt;p&gt;I'm trying to disable &lt;code&gt;hl-anything&lt;/code&gt; only when I'm using &lt;code&gt;org-mode&lt;/code&gt; or &lt;code&gt;org-agenda-mode&lt;/code&gt; but I don't know how to do it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried this:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (hl-highlight-mode nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-agenda-mode-hook&#xA;          (lambda ()&#xA;            (hl-highlight-mode nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8621" LastEditorUserId="675" LastEditDate="2016-07-23T03:15:32.330" LastActivityDate="2016-07-26T11:58:20.747" Title="How to disable a hl-anything in orgmode?" Tags="|org-mode|init-file|hooks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24769" PostTypeId="1" CreationDate="2016-07-23T02:33:56.003" Score="2" ViewCount="88" Body="&lt;p&gt;I get this error when I am trying to swtch buffer and a folder of an open buffer is deleted outside emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in post-command-hook (evil-mode-check-buffers): (file-error &quot;Setting current directory&quot; &quot;directory not found&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think it would be better to just close the buffer or offer the user to save open files elsewhere instead of giving error and block all other commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to avoid the blockage?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-07-23T14:44:33.197" LastActivityDate="2016-07-23T17:31:34.157" Title="Error when folder of an open buffer is deleted outside emacs" Tags="|buffers|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24770" PostTypeId="1" AcceptedAnswerId="24773" CreationDate="2016-07-23T03:06:15.740" Score="3" ViewCount="60" Body="&lt;p&gt;I want to run &lt;em&gt;newline&lt;/em&gt; command after whenever I run &lt;em&gt;org-cut-subtree&lt;/em&gt;. I tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-org-cut-subtree-hook 'newline)&#xA;(add-hook 'org-cut-subtree-hook 'newline)&#xA;(add-hook 'org-after-cut-subtree-hook 'newline)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but none of them worked. How can I add &lt;em&gt;newline&lt;/em&gt; command to the post-command hook of org-cut-subtree?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="10707" LastEditDate="2016-07-23T04:52:06.243" LastActivityDate="2016-07-23T06:38:20.363" Title="post-command hook for org-cut-subtree" Tags="|hooks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24771" PostTypeId="2" ParentId="24769" CreationDate="2016-07-23T03:13:04.523" Score="1" Body="&lt;p&gt;You could override the post-command-hook function to check for the folder, then if it doesn't exist, do something else or just kill the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/15717103/preferred-method-of-overriding-an-emacs-lisp-function&quot;&gt;This article&lt;/a&gt; has some insight on how to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically overriding the function is redefining the function locally, so you can change it's behavior. This allows you to alter the functionality without having to delve into Emacs source code, recompiling, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably the easiest (at least in my opinion) is to &lt;code&gt;C-h f &amp;lt;function-name&amp;gt; RET&lt;/code&gt;, then should show you what elisp file contains that function, so you can get to the source code easily. Once you do that, you should be able to add a command or function call to do what you wish (i.e. close a buffer or save elsewhere).  I don't have evil installed, but this is an example of looking at &lt;code&gt;C-h f load-theme RET&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;load-theme is an interactive compiled Lisp function in 'custom.el'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now you know that the function you're looking for is in custom.el (in my example.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the GNU page on hooks&lt;/a&gt;, which is what you're effectively creating. &lt;/p&gt;&#xA;" OwnerUserId="2842" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-07-23T17:31:34.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24772" PostTypeId="1" AcceptedAnswerId="24840" CreationDate="2016-07-23T03:50:16.220" Score="2" ViewCount="464" Body="&lt;p&gt;Currently I'm ignore these buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf helm-boring-buffer-regexp-list '(&quot;\\` &quot; &quot;\\*helm&quot; &quot;\\*helm-mode&quot;&#xA;                                       &quot;\\*Echo Area&quot; &quot;\\*Minibuf&quot; &quot;\\*monky-cmd-process\\*&quot;&#xA;                                       &quot;\\*epc con&quot; &quot;\\*Compile-Log\\*&quot; &quot;\\*monky-process\\*&quot;&#xA;                                       &quot;\\*CEDET CScope\\*&quot; &quot;\\*Messages\\*&quot; &quot;\\*Flycheck error&quot;&#xA;                                       &quot;\\*.+(.+)&quot; &quot;elpa/.+&quot; &quot;tramp/.+&quot;&#xA;                                       &quot;\\*Gofmt Errors\\*&quot; &quot;\\*autopep8&quot;&#xA;                                       &quot;\\*magit-process:&quot; &quot;\\*magit-diff:&quot; &quot;\\*anaconda-mode\\*&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ok. I started using Circe for IRC and all that, but it annoys me seeing the buffer of each channel and the buffer of the server in the Helm buffer every time I hit &lt;code&gt;C-x b&lt;/code&gt;, I feel that my buffer list is cluttered. I'm on the way of using &lt;a href=&quot;https://github.com/lesharris/helm-circe&quot; rel=&quot;nofollow&quot;&gt;helm-circe&lt;/a&gt; to manage those buffers alone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I was wondering if it where even possible to tell Helm to ignore those buffers that have certain major mode activated, in this particular case, &lt;code&gt;circe-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2016-07-26T06:57:17.400" Title="Is possible to ignore buffers by major mode?" Tags="|helm|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24773" PostTypeId="2" ParentId="24770" CreationDate="2016-07-23T06:32:19.020" Score="5" Body="&lt;p&gt;I typed &lt;code&gt;M-x find-function RET org-cut-subtree RET&lt;/code&gt; and saw that it was just a few lines of code that calls &lt;code&gt;org-copy-subtree&lt;/code&gt;.  Then, I typed &lt;code&gt;M-x find-function RET org-copy-subtree RET&lt;/code&gt; and looked through about 25 lines of code to see if there were any built-in hooks -- I did not find any.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend creating a new function called &lt;code&gt;my-org-cut-subtree&lt;/code&gt; to avoid any unintended side effects that would likely occur if the original poster tried to alter the behavior of the core functions at issue, since they are used by other aspects of &lt;code&gt;org-mode&lt;/code&gt;.  I recommend using &lt;code&gt;(insert &quot;\n&quot;)&lt;/code&gt; instead of &lt;code&gt;newline&lt;/code&gt; to insert a new line.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-cut-subtree (&amp;amp;optional n)&#xA;  &quot;Cut the current subtree into the clipboard.&#xA;With prefix arg N, cut this many sequential subtrees.&#xA;This is a short-hand for marking the subtree and then cutting it.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (org-copy-subtree n 'cut)&#xA;  (insert &quot;\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-07-23T06:38:20.363" LastActivityDate="2016-07-23T06:38:20.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24774" PostTypeId="2" ParentId="24736" CreationDate="2016-07-23T07:21:31.180" Score="1" Body="&lt;p&gt;For some unknown reason the answer proposed by Kaushal is not working on my system (Org version ?). Anyway I find out a working solution using the &lt;code&gt;pandoc&lt;/code&gt; export instead of the Org &lt;em&gt;native&lt;/em&gt; LaTeX. So using the same &lt;a href=&quot;http://ix.io/16lG&quot; rel=&quot;nofollow noreferrer&quot;&gt;example&lt;/a&gt; and exporting to Pandoc--&gt;Latex and Open you get a tex &lt;a href=&quot;http://ix.io/16ED&quot; rel=&quot;nofollow noreferrer&quot;&gt;file&lt;/a&gt; with &lt;code&gt;longtable&lt;/code&gt; package. I made a slight modification adding the &lt;code&gt;lscape&lt;/code&gt;package. This is the result &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/y6MD3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y6MD3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5202" LastEditorUserId="5202" LastEditDate="2016-07-23T13:58:09.303" LastActivityDate="2016-07-23T13:58:09.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24775" PostTypeId="1" CreationDate="2016-07-23T08:40:47.537" Score="2" ViewCount="1852" Body="&lt;p&gt;Is it possible to bind the &lt;code&gt;compile&lt;/code&gt; and run commands for a c++ code to a single key (for example F5). What i do at the moment is to run &lt;code&gt;M-x compile&lt;/code&gt; and then as compile command &lt;code&gt;g++ project.cpp&lt;/code&gt; and then i run &lt;code&gt;./a.out&lt;/code&gt; in a shell. Does anyone has a solution for doing these with less typing for c++?&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastEditorDisplayName="user12021" LastEditDate="2016-07-23T08:50:22.680" LastActivityDate="2016-07-24T14:54:54.533" Title="Binding compile command to a key for c++ code" Tags="|c++|compilation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24776" PostTypeId="1" AcceptedAnswerId="24918" CreationDate="2016-07-23T08:42:39.303" Score="2" ViewCount="153" Body="&lt;p&gt;I came across this code today, and do not understand why the author used the &quot;and&quot; in it. As far as I can tell, these two lines deliver the same results and have the same functionality. The variable &lt;code&gt;initial-major-mode&lt;/code&gt; is defined in &lt;code&gt;startup.el&lt;/code&gt;, and holds the value of the initial major mode (lisp-interaction-mode for the &lt;em&gt;scratch&lt;/em&gt; buffer).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall (and initial-major-mode))&#xA;(funcall initial-major-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I missing some nuance why the &quot;and&quot; is useful or required in the code? The only thing I can think of is that it might be an easy way of protecting against a &lt;code&gt;(funcall nil)&lt;/code&gt; error if the &lt;code&gt;initial-major-mode&lt;/code&gt; is undefined. But since it's a system variable, I would guess that it is always defined?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="105" LastEditDate="2017-02-07T19:02:52.360" LastActivityDate="2017-02-07T19:02:52.360" Title="Why use the &quot;and&quot; in (funcall (and initial-major-mode))?" Tags="|debugging|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24777" PostTypeId="2" ParentId="24775" CreationDate="2016-07-23T08:59:44.357" Score="-1" Body="&lt;p&gt;I wonder why you use Emacs, if you don't write Elisp at all. For example, &lt;a href=&quot;http://www.nathan1hughes.co.uk/programming/why-i-persisted-to-learn-emacs/&quot; rel=&quot;nofollow&quot;&gt;http://www.nathan1hughes.co.uk/programming/why-i-persisted-to-learn-emacs/&lt;/a&gt; suits your question well, on the bottom of the blog:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; Run C programs directly from within emacs&#xA;(defun execute-c-program ()&#xA;  (interactive)&#xA;  (defvar foo)&#xA;  (setq foo (concat &quot;gcc &quot; (buffer-name) &quot; &amp;amp;&amp;amp; ./a.out&quot; ))&#xA;  (shell-command foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-07-23T08:59:44.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24778" PostTypeId="2" ParentId="24731" CreationDate="2016-07-23T12:20:33.523" Score="5" Body="&lt;p&gt;This is straightforward by using the &lt;code&gt;:tags&lt;/code&gt; option in clocktable lines, and I use this to do something similar to you. I have a separate org file (&lt;em&gt;clock.org&lt;/em&gt; in my case), which just contains clock tables with various time and project-specific tag filters. I then refresh the tables in this file when it comes time to pluck numbers out for a timesheet or whatever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following reports time entries from the previous week that have a tag like &quot;TAF001&quot;, &quot;TAF002&quot; etc (for time on change requests, in my case). This also includes an additional &quot;TAGS&quot; column so I can see which tags were on which item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:tags&lt;/code&gt; option takes a regular expression, so I make sure to include &lt;code&gt;^&lt;/code&gt; to avoid incorrect matches if somehow the expression matches within a tag:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 7 :scope agenda :block lastweek :fileskip0 :formatter :link t :indent t :inherit-props t :properties (&quot;TAGS&quot;) :tags &quot;-NOCLOCK+{^TAF[0-9]*}&quot; :narrow 79 :formula %&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This also excludes anything tagged &quot;NOCLOCK&quot;, and adds a percentage column in addition to reporting the raw time.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2016-07-23T12:20:33.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24779" PostTypeId="1" AcceptedAnswerId="24780" CreationDate="2016-07-23T13:07:54.233" Score="3" ViewCount="640" Body="&lt;p&gt;I'm quite new to emacs (coming from vim), and I'm struggling to figure out how to configure sane line-wrapping/truncation behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the most part, I'd like to prevent wrapping, so I put this in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default truncate-lines t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But for help/info buffers, I do want wrapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I want truncation in buffers that contain code, and wrapping in buffers that contain text. What's a sensible way to achieve this? I imagine I want to keep the above default, but override it for certain major modes (e.g. Help), but I'm not sure how to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;update based on &lt;a href=&quot;https://emacs.stackexchange.com/a/24780/8528&quot;&gt;Kaushal Modi's answer&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-truncate-lines-disable () (setq truncate-lines nil))&#xA;(add-hook 'help-mode-hook #'my-truncate-lines-disable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-07-23T20:04:50.063" Title="How to prevent line wrapping in code, but allow it in help/info buffers?" Tags="|major-mode|wrapping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24780" PostTypeId="2" ParentId="24779" CreationDate="2016-07-23T13:33:07.040" Score="6" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-truncate-lines-disable ()&#xA;  &quot;Disable line truncation, even in split windows.&quot;&#xA;  (let ((inhibit-message t) ; No messages in the echo area - needs emacs 25+&#xA;        message-log-max ; No messages in the *Messages* buffer&#xA;        truncate-partial-width-windows) ; No truncation in split windows&#xA;    (toggle-truncate-lines 0)))&#xA;(add-hook 'help-mode-hook #'my-truncate-lines-disable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-07-23T20:04:50.063" LastActivityDate="2016-07-23T20:04:50.063" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24781" PostTypeId="1" CreationDate="2016-07-23T14:44:00.160" Score="2" ViewCount="442" Body="&lt;p&gt;Suppose I have a lot of small text snippets (including some LaTeX-code). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to create a LaTeX document with emacs which includes some of the text snippets. I know yasnippet which can expand keywords to the snipped but that's not what I want. Instead I am looking for something like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Invoke an emacs command &lt;code&gt;insert-snippet&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then I can browse, search filter and select one (or at best also multiple snippets)&lt;/li&gt;&#xA;&lt;li&gt;The snippets should not be copied to the file but included via an LaTeX input statement say &lt;code&gt;\input{snippet1}&lt;/code&gt; (or if multiples are selected: &lt;code&gt;\input{snippet1}&lt;/code&gt; &lt;code&gt;\input{snippet5}&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I edit the main file and point is on say &lt;code&gt;\input{snippet3}&lt;/code&gt; there should be a command to view the content of this snippet (any maybe replace it by another one). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach described above seems to require that each snippet is saved in a separate file - otherwise the &lt;code&gt;\input&lt;/code&gt; statement wouldn't work. However this seems to make it harder to edit the snippets. Maybe one option would be to edit them using the multifiles package (then you can edit them just as they where one file) or just grep them with &lt;code&gt;helm-do-grep&lt;/code&gt; and browse it with executing &lt;code&gt;helm-persistent-action&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another idea would be to use another command instead of &lt;code&gt;\input&lt;/code&gt; like &lt;code&gt;\ExecuteMetaData[inputfile]{mytag1}&lt;/code&gt; from the &lt;code&gt;catchfilebetweentags&lt;/code&gt; package. Then you could store them in one file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to store the snippets in one file like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\newcommand{\mysnippet1}{&#xA;Snippet Text&#xA;}&#xA;&#xA;Some text or comments.&#xA;&#xA;\newcommand{\mysnippet2}{&#xA;Snippet Text&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then input &lt;code&gt;\mysnippet2&lt;/code&gt; instead of &lt;code&gt;\input{mysnippet2}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If no library exists which does what I want, what would you suggest where to start to realize this by myself?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-07-27T20:55:41.273" LastActivityDate="2016-07-27T20:55:41.273" Title="Browse and search text snippets in emacs and insert them as LaTeX input" Tags="|latex|yasnippet|reftex-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24782" PostTypeId="1" AcceptedAnswerId="24820" CreationDate="2016-07-23T17:12:14.223" Score="4" ViewCount="549" Body="&lt;p&gt;Is there a way to jump in helm mini directly to the next source? Is it also possible to fold and unfold a source-list?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-07-25T13:36:07.640" Title="How to move to the next source offered by helm mini?" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24783" PostTypeId="1" AcceptedAnswerId="24839" CreationDate="2016-07-23T18:01:41.253" Score="1" ViewCount="139" Body="&lt;p&gt;How can I get a section to helm-mini which just behaves if I invoke &lt;code&gt;helm-find-files&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding &lt;code&gt;helm-source-files-in-current-dir&lt;/code&gt; does almost what I want, but doesn't allow me to navigate to subdirectories (it rather opens then a dired buffer). Adding &lt;code&gt;helm-source-findutils&lt;/code&gt; doesn't seem to have an effect (at least there is not a section added). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a minimal &lt;code&gt;.emacs&lt;/code&gt; file to show what I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*-Emacs-Lisp-*-&#xA;;; -*- coding:utf-8 -*-&#xA;&#xA;(require 'package)&#xA;&#xA;(package-initialize)&#xA;&#xA;(setq inhibit-splash-screen 1)&#xA;&#xA;(require 'helm)  &#xA;&#xA;(require 'recentf) &#xA;&#xA;(helm-mode 1)&#xA;(recentf-mode 1)&#xA;&#xA;&#xA;(setq helm-mini-default-sources '(&#xA;                  ;helm-source-findutils&#xA;                  helm-source-files-in-current-dir&#xA;                  helm-source-recentf&#xA;                  )) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-07-26T06:08:49.993" Title="How can I add a section like in helm-find files to helm-mini" Tags="|helm|helm-for-files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24784" PostTypeId="1" AcceptedAnswerId="31954" CreationDate="2016-07-23T18:35:10.433" Score="16" ViewCount="2303" Body="&lt;p&gt;My understanding is that &lt;code&gt;ansi-term&lt;/code&gt; only supports 8 colors (a good discussion of this in reddit &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/44iwx0/emacs_internal_terminal_emulator_with_more_than_8/?&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, an increasing number of terminal emulators (e.g. &lt;code&gt;tmux&lt;/code&gt; or &lt;code&gt;iTerm2&lt;/code&gt; in OS X) support &lt;code&gt;True color&lt;/code&gt; (24 bit, i.e. &lt;strong&gt;16 million&lt;/strong&gt; colors). A good list can be found &lt;a href=&quot;https://gist.github.com/XVilka/8346728&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the 8-color cap is specific to &lt;code&gt;ansi-term&lt;/code&gt;, are there any other packages for terminal emulation that are trying to address this limitation? &lt;/li&gt;&#xA;&lt;li&gt;Are there any plans to bring &lt;code&gt;True color&lt;/code&gt; support to a terminal emulator in Emacs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And maybe to confirm:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is there any way to effectively have more than 8 colors in  &lt;code&gt;ansi-term&lt;/code&gt; buffers?&lt;/li&gt;&#xA;&lt;li&gt;Is tweaking &lt;code&gt;ansi-color-names-vector&lt;/code&gt; still the recommended way of setting &lt;code&gt;ansi-term&lt;/code&gt; colors in Emacs &lt;code&gt;25&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;How to test if an emulator supports &quot;&lt;strong&gt;True color&lt;/strong&gt;&quot;:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is a snippet from the link above that would test if the emulator supports True colors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;awk 'BEGIN{&#xA;    s=&quot;/\\/\\/\\/\\/\\&quot;; s=s s s s s s s s;&#xA;    for (colnum = 0; colnum&amp;lt;77; colnum++) {&#xA;        r = 255-(colnum*255/76);&#xA;        g = (colnum*510/76);&#xA;        b = (colnum*255/76);&#xA;        if (g&amp;gt;255) g = 510-g;&#xA;        printf &quot;\033[48;2;%d;%d;%dm&quot;, r,g,b;&#xA;        printf &quot;\033[38;2;%d;%d;%dm&quot;, 255-r,255-g,255-b;&#xA;        printf &quot;%s\033[0m&quot;, substr(s,colnum+1,1);&#xA;    }&#xA;    printf &quot;\n&quot;;&#xA;}'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If it is supported, the bottom line would display a nice gradient like the one shown below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/z0oNt.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/z0oNt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From what I read, &lt;a href=&quot;https://twitter.com/_Felipe/status/582762742345560065&quot; rel=&quot;noreferrer&quot;&gt;NeoVim (a VIM editor) added support for it&lt;/a&gt; in 2015, and there was &lt;a href=&quot;http://emacs.1067599.n5.nabble.com/bug-20243-True-color-terminal-support-tc354040.html&quot; rel=&quot;noreferrer&quot;&gt;a request&lt;/a&gt; made to Emacs bugs to add it.&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2016-07-25T17:57:08.500" LastActivityDate="2017-04-05T16:35:29.813" Title="Getting more than 8 colors in a terminal emulator inside Emacs" Tags="|colors|ansi-term|multi-term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24785" PostTypeId="2" ParentId="24767" CreationDate="2016-07-23T23:18:12.883" Score="2" Body="&lt;p&gt;&lt;code&gt;hl-highlight-mode&lt;/code&gt; is a global minor mode, and you can't disable a global minor mode on a per-buffer basis -- only buffer-local minor modes work that way. A global mode is either on or off globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Original answer about buffer-local minor modes follows...&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;The docstring at &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;hl-highlight-mode&lt;/code&gt; should tell you exactly what its argument does, so just follow that information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In recent versions of Emacs, modes defined by &lt;code&gt;define-minor-mode&lt;/code&gt; are explicitly &lt;strong&gt;enabled&lt;/strong&gt; when called from elisp with a &lt;code&gt;nil&lt;/code&gt;argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is to ensure consistent behaviour for the likes of &lt;code&gt;(add-hook 'HOOK 'MINORMODEFUNCTION)&lt;/code&gt; -- which results in MINORMODEFUNCTION being called without its optional argument, which is the same thing as passing it an argument of &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. your code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-agenda-mode-hook&#xA;          (lambda ()&#xA;            (hl-highlight-mode nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is equivalent to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-agenda-mode-hook 'hl-highlight-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Prior to that, a &lt;code&gt;nil&lt;/code&gt; argument to a minor mode function would &lt;strong&gt;toggle&lt;/strong&gt; the mode (just like calling the mode interactively); but that might be toggling it on or off depending on circumstances, so it wasn't a dependable thing to use in non-interactive cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In general&lt;/em&gt; a positive numeric argument enables a minor mode, and a non-positive (&amp;lt;= 0) argument disables it. In practice one mostly sees values of &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;-1&lt;/code&gt; used to disable modes. For modes defined by &lt;code&gt;define-minor-mode&lt;/code&gt; there is no difference between those two values.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if &lt;code&gt;hl-highlight-mode&lt;/code&gt; were being enabled via a &lt;em&gt;globalized&lt;/em&gt; minor mode, it's trickier, and you may need to use &lt;code&gt;after-change-major-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-inhibit-globalized-hl-highlight-mode ()&#xA;  &quot;Counter-act a globalized hl-highlight-mode.&quot;&#xA;  (add-hook 'after-change-major-mode-hook&#xA;            (lambda () (hl-highlight-mode 0))&#xA;            :append :local))&#xA;&#xA;(add-hook 'org-agenda-mode-hook 'my-inhibit-globalized-hl-highlight-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://stackoverflow.com/q/6837511&quot;&gt;https://stackoverflow.com/q/6837511&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-07-26T11:58:20.747" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24786" PostTypeId="2" ParentId="24568" CreationDate="2016-07-24T00:48:28.197" Score="0" Body="&lt;p&gt;Try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   Alt x appt-add&#xA;   Time  (hh:mm[am/pm])&#xA;   Message&#xA;   Minutes before the  appointment &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to start warning &lt;/p&gt;&#xA;" OwnerUserId="11762" LastEditorUserId="2274" LastEditDate="2016-07-24T15:03:33.450" LastActivityDate="2016-07-24T15:03:33.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24787" PostTypeId="1" CreationDate="2016-07-24T01:47:46.530" Score="1" ViewCount="461" Body="&lt;p&gt;Suppose I have a function that is 'noisy' and prints to standard output rudely.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun not-my-noisy-function ()&#xA;  &quot;A function outside my control&quot;&#xA;  (do-something-useful)&#xA;  (print &quot;Haha! Butts!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to make calls to that function without corresponding messages in stdout.  I was hoping that there was an elisp construct which would evaluate the form discarding standard-output from its body.  A little bit like &lt;code&gt;ignore-errors&lt;/code&gt;, but applicable to an output stream instead of thrown exceptions.  I haven't been about to find anything in the vein of &quot;suppress&quot;/&quot;silent&quot;/&quot;discard&quot;/&quot;redirect&quot; for output streams.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evaluate-silently ;; macro I wish existed&#xA;  (not-my-noisy-function))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My first thought of setting &lt;code&gt;standard-output&lt;/code&gt; to nil doesn't seem to do the trick.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((standard-output nil))&#xA;  (print &quot;Nope; doesn't work.  You can still hear me.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Interestingly the elisp manual says it must &lt;em&gt;not&lt;/em&gt; be nil and doesn't say anything about values other than &lt;code&gt;t&lt;/code&gt;, a buffer, or a marker.  I can't seem to find documentation about an &quot;real&quot; streams in the elisp manual; only optional parameters to output functions which only seem to duplicate captured standard output rather redirecting it.  &lt;code&gt;with-output-to-string&lt;/code&gt; and &lt;code&gt;with-output-to-temp-buffer&lt;/code&gt; also only seem to duplicate output to a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a last recourse I could manually examine problematic functions and use &lt;code&gt;cl-flet&lt;/code&gt; (to override &lt;code&gt;print&lt;/code&gt;,&lt;code&gt;message&lt;/code&gt;, etc), but I would rather not take that approach.  Unfortunately this is the only technique that I've identified to accomplish this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-flet ((print (&amp;amp;rest body) nil))&#xA;  (not-my-noisy-function)&#xA;  (print &quot;I am being ignored!?!!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a better way?  I hope I just haven't divined the correct &lt;code&gt;apropos&lt;/code&gt; incantation.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2016-07-24T15:53:16.837" LastActivityDate="2016-07-24T15:53:16.837" Title="Temporarily suppressing standard-output" Tags="|print|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24788" PostTypeId="1" CreationDate="2016-07-24T02:02:03.710" Score="1" ViewCount="33" Body="&lt;p&gt;Emacs 24.5.1, Funtoo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'd like to open a file in /etc, the ido-find-file would stuck for about two minutes. It looks ido is going thru the / dir for caching the directory names, but this is really annoying. This only happens for the first time after Emacs started. Are there a switch that can speed this up?&lt;/p&gt;&#xA;" OwnerUserId="12731" LastActivityDate="2016-07-24T02:02:03.710" Title="Q: How to speed up ido when opening a file in /etc?" Tags="|ido-find-file|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24789" PostTypeId="1" CreationDate="2016-07-24T04:14:58.170" Score="5" ViewCount="502" Body="&lt;p&gt;Quitting my Emacs takes a really long time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a good way to track what's happening while quitting Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(So far I'm turning to git blame to figure out what changes I have made to cause this problem.)&lt;/p&gt;&#xA;" OwnerUserId="11313" LastEditorUserId="105" LastEditDate="2016-08-15T01:33:39.140" LastActivityDate="2016-08-15T01:33:39.140" Title="Quitting emacs is very slow" Tags="|debugging|quitting|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24790" PostTypeId="1" AcceptedAnswerId="24792" CreationDate="2016-07-24T04:36:03.123" Score="1" ViewCount="360" Body="&lt;p&gt;Trying to make a function that I can call to create a file from a template or open an existing file. Current attempt is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun journal-entry ()&#xA;  (interactive)&#xA;  (let ((daily-name (format-time-string &quot;%Y-%m-%d)&quot;))&#xA;        (journal-path &quot;~/Dropbox (Personal)/journal/&quot;))&#xA;    (find-file (concat journal-path daily-name &quot;.md&quot;))&#xA;    (insert &quot;JOURNAL&quot; &quot;\n&quot; daily-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Problem with this is that every time I call it. The &lt;code&gt;( insert )&lt;/code&gt; content gets re added&lt;/p&gt;&#xA;" OwnerUserId="12732" LastEditorUserId="105" LastEditDate="2016-07-24T15:48:33.160" LastActivityDate="2016-07-25T05:47:42.287" Title="How to create a file from a template if it does not exist or open existing copy?" Tags="|find-file|insert|template|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24791" PostTypeId="2" ParentId="24152" CreationDate="2016-07-24T04:45:37.477" Score="0" Body="&lt;p&gt;A simple solution is to simply delete your current emacsclient frame with &lt;code&gt;C-x 5 0&lt;/code&gt;.  The daemon will continue to run and you won't be prompted about saving each buffer.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-07-24T21:05:31.567" LastActivityDate="2016-07-24T21:05:31.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24792" PostTypeId="2" ParentId="24790" CreationDate="2016-07-24T06:16:43.063" Score="4" Body="&lt;p&gt;You could use this version of the function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun journal-entry ()&#xA;  (interactive)&#xA;  (let* ((daily-name (format-time-string &quot;%Y-%m-%d)&quot;))&#xA;     (journal-path &quot;~/Dropbox (Personal)/journal/&quot;)&#xA;     (journal-file (concat journal-path daily-name &quot;.md&quot;)))&#xA;     (find-file journal-file)&#xA;     (unless (file-exists-p journal-file)&#xA;         (insert &quot;JOURNAL&quot; &quot;\n&quot; daily-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Unless&lt;/code&gt; like &lt;code&gt;if not&lt;/code&gt;, so if the file isn't exist (checked in &lt;code&gt;(file-exists-p journal-file)&lt;/code&gt;), the &lt;code&gt;(insert &quot;JOURNAL&quot; &quot;\n&quot; daily-name)&lt;/code&gt; will be executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added creating &lt;code&gt;journal-file&lt;/code&gt; because it used in the script twice.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-07-25T05:47:42.287" LastActivityDate="2016-07-25T05:47:42.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24793" PostTypeId="1" AcceptedAnswerId="28723" CreationDate="2016-07-24T07:50:07.477" Score="1" ViewCount="170" Body="&lt;p&gt;How can I configure &lt;code&gt;helm-source-locate&lt;/code&gt; (for &lt;code&gt;helm-mini&lt;/code&gt;) such that it matches like the following: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;some tex&lt;/code&gt; it should match &lt;code&gt;some_file.tex&lt;/code&gt; as well as &lt;code&gt;b_some_other_file.tex&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-11-17T19:30:27.083" Title="Configure matching settings for locate-source for helm-mini" Tags="|helm|helm-sources|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24794" PostTypeId="1" CreationDate="2016-07-24T11:11:21.667" Score="2" ViewCount="3445" Body="&lt;p&gt;Is it possible to wrap text automatically at 80 column length? I mean, writing code or text and then, when I reach 80 characters, put a breakline and continue on the next line (not wrapping the word but putting on the next line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerDisplayName="user11867" LastActivityDate="2021-06-03T17:17:25.447" Title="Wrap/trunc text at 80 column width" Tags="|wrapping|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24795" PostTypeId="2" ParentId="24794" CreationDate="2016-07-24T11:21:04.610" Score="3" Body="&lt;p&gt;&#xA;You can customize &lt;code&gt;fill-column&lt;/code&gt; or do &lt;code&gt;(setq-default fill-column 80)&lt;/code&gt; in your init file and use &lt;code&gt;auto-fill-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can activate it per mode by using &lt;code&gt;(add-hook 'text-mode-hook 'turn-on-auto-fill)&lt;/code&gt; or with key binding: &lt;code&gt;(global-set-key (kbd &quot;C-c q&quot;) 'auto-fill-mode)&lt;/code&gt;. See &lt;a href=&quot;https://www.emacswiki.org/emacs/AutoFillMode&quot; rel=&quot;nofollow&quot;&gt;emacswiki&lt;/a&gt; for more.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-23T04:54:05.913" LastActivityDate="2016-08-23T04:54:05.913" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24796" PostTypeId="2" ParentId="24793" CreationDate="2016-07-24T11:47:35.953" Score="0" Body="&lt;p&gt;&#xA;Fuzzy matching (enabled for some commands but disabled by default) should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq helm-locate-fuzzy-match t)&#xA;(setq helm-mode-fuzzy-match t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and/or:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq helm-completion-in-region-fuzzy-match t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-23T05:08:18.030" LastActivityDate="2016-08-23T05:08:18.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24797" PostTypeId="2" ParentId="24787" CreationDate="2016-07-24T11:58:49.897" Score="3" Body="&lt;p&gt;You were following a good line of enquiry regarding &lt;code&gt;standard-output&lt;/code&gt;, but just didn't manage to find the right information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of &lt;code&gt;standard-output&lt;/code&gt; has to be a valid value for the &lt;code&gt;PRINTCHARFUN&lt;/code&gt; argument, which &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;print&lt;/code&gt; describes nicely:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;Optional argument PRINTCHARFUN is the output stream, which can be one&#xA;of these:&#xA;&#xA;   - a buffer, in which case output is inserted into that buffer at point;&#xA;   - a marker, in which case output is inserted at marker's position;&#xA;   - a function, in which case that function is called once for each&#xA;     character of OBJECT's printed representation;&#xA;   - a symbol, in which case that symbol's function definition is called; or&#xA;   - t, in which case the output is displayed in the echo area.&#xA;&#xA;If PRINTCHARFUN is omitted, the value of `standard-output' (which see)&#xA;is used instead.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence you can simply bind &lt;code&gt;standard-output&lt;/code&gt; to the canonical function for doing nothing:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((standard-output 'ignore))&#xA;  (print &quot;hello&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-07-24T11:58:49.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24799" PostTypeId="1" AcceptedAnswerId="24801" CreationDate="2016-07-24T13:37:05.063" Score="4" ViewCount="828" Body="&lt;p&gt;In the org-mode LaTeX-export the &lt;code&gt;fontenc&lt;/code&gt; package is loaded by default with the &lt;code&gt;T1&lt;/code&gt; option. Since my document contains a few characters like &lt;code&gt;ȩ&lt;/code&gt; or &lt;code&gt;ĭ&lt;/code&gt; which are not contained in &lt;code&gt;T1&lt;/code&gt; I would like to load additional font encodings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which variables do I have to change in order to achieve this? Ideally I would like to do this in a local variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, is there a way to guarantee that &lt;code&gt;fontenc&lt;/code&gt; is loaded before &lt;code&gt;inputenc&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10405" LastEditorUserId="10405" LastEditDate="2016-07-24T13:42:18.313" LastActivityDate="2016-07-24T14:31:40.200" Title="How to change the fontenc parameters in org-mode latex export" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24800" PostTypeId="2" ParentId="13286" CreationDate="2016-07-24T14:24:17.157" Score="16" Body="&lt;p&gt;My complete setup for fixing this annoying default behavior is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;;; Prevent suggestions from being triggered automatically. In particular,&#xA;  ;;; this makes it so that:&#xA;  ;;; - TAB will always complete the current selection.&#xA;  ;;; - RET will only complete the current selection if the user has explicitly&#xA;  ;;;   interacted with Company.&#xA;  ;;; - SPC will never complete the current selection.&#xA;  ;;;&#xA;  ;;; Based on:&#xA;  ;;; - https://github.com/company-mode/company-mode/issues/530#issuecomment-226566961&#xA;  ;;; - https://emacs.stackexchange.com/a/13290/12534&#xA;  ;;; - http://stackoverflow.com/a/22863701/3538165&#xA;  ;;;&#xA;  ;;; See also:&#xA;  ;;; - https://emacs.stackexchange.com/a/24800/12534&#xA;  ;;; - https://emacs.stackexchange.com/q/27459/12534&#xA;&#xA;  ;; &amp;lt;return&amp;gt; is for windowed Emacs; RET is for terminal Emacs&#xA;  (dolist (key '(&quot;&amp;lt;return&amp;gt;&quot; &quot;RET&quot;))&#xA;    ;; Here we are using an advanced feature of define-key that lets&#xA;    ;; us pass an &quot;extended menu item&quot; instead of an interactive&#xA;    ;; function. Doing this allows RET to regain its usual&#xA;    ;; functionality when the user has not explicitly interacted with&#xA;    ;; Company.&#xA;    (define-key company-active-map (kbd key)&#xA;      `(menu-item nil company-complete&#xA;                  :filter ,(lambda (cmd)&#xA;                             (when (company-explicit-action-p)&#xA;                               cmd)))))&#xA;  (define-key company-active-map (kbd &quot;TAB&quot;) #'company-complete-selection)&#xA;  (define-key company-active-map (kbd &quot;SPC&quot;) nil)&#xA;&#xA;  ;; Company appears to override the above keymap based on company-auto-complete-chars.&#xA;  ;; Turning it off ensures we have full control.&#xA;  (setq company-auto-complete-chars nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;a href=&quot;https://github.com/raxod502/radian/blob/223abc524f693504af6ebbc70ad2d84d9a6e2d1b/radian-emacs/radian-autocomplete.el#L6-L182&quot; rel=&quot;noreferrer&quot;&gt;link&lt;/a&gt; to current configuration, which has been further improved but is quite complicated by this point)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(updated as per &lt;a href=&quot;https://emacs.stackexchange.com/q/27459/12534&quot;&gt;this question&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="12534" LastEditorUserId="12534" LastEditDate="2017-06-29T16:02:01.060" LastActivityDate="2017-06-29T16:02:01.060" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24801" PostTypeId="2" ParentId="24799" CreationDate="2016-07-24T14:31:40.200" Score="3" Body="&lt;p&gt;The default list of packages is stored in &lt;code&gt;org-latex-default-packages-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alist of default packages to be inserted in the header.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Change this only if one of the packages here causes an&#xA;  incompatibility with another package you are using.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Each element of this list is a triple &lt;code&gt;(&quot;options&quot; &quot;package&quot; SNIPPET-FLAG)&lt;/code&gt;.  As you've seen, the entry for &lt;code&gt;fontenc&lt;/code&gt; is &lt;code&gt;(&quot;T1&quot; &quot;fontenc&quot; t)&lt;/code&gt; and it is loaded after &lt;code&gt;inputenc&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can reorder and change the options by customizing this variable.  Parts of &lt;code&gt;org-mode&lt;/code&gt; make assumptions about what packages get loaded, so it's probably a bad ideal to &lt;em&gt;remove&lt;/em&gt; anything from this list.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-07-24T14:31:40.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24802" PostTypeId="2" ParentId="24775" CreationDate="2016-07-24T14:54:54.533" Score="5" Body="&lt;p&gt;You need to do two things: 1. Bind &lt;code&gt;compile&lt;/code&gt; to a key (like &lt;code&gt;f5&lt;/code&gt;) 2. Change the command that &lt;code&gt;compile&lt;/code&gt; runs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do the first add &lt;code&gt;(define-key c++-mode-map [f5] #'compile)&lt;/code&gt; to your &lt;code&gt;.emacs&lt;/code&gt;.  This sets the key only in &lt;code&gt;c++-mode&lt;/code&gt;; you can make it a global binding if you want by using &lt;code&gt;global-map&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second, the &lt;code&gt;compile&lt;/code&gt; function just runs whatever is stored in the variable &lt;code&gt;compile-command&lt;/code&gt;.  Changing this globally would be a pain as you probably want different commands for different projects.  File local variables to the rescue.  Open the file and run &lt;code&gt;M-x add-file-local-variable&lt;/code&gt;.  Chose &lt;code&gt;compile-command&lt;/code&gt; as the variable and &lt;code&gt;&quot;g++ project.cpp &amp;amp;&amp;amp; ./a.out&quot;&lt;/code&gt; as the value (don't forget the quotes).  This will add a block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// Local Variables:&#xA;// compile-command: &quot;g++ test.cpp &amp;amp;&amp;amp; ./a.out&quot;&#xA;// End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the bottom of your file.  You can easily add this block yourself if you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your project has multiple files, use &lt;code&gt;add-dir-local-variable&lt;/code&gt; instead.  Directory local variables are used by all files in that directory.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-07-24T14:54:54.533" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24803" PostTypeId="1" CreationDate="2016-07-24T15:03:19.660" Score="1" ViewCount="49" Body="&lt;p&gt;I like how Bash handles i-search: &lt;code&gt;C-r&lt;/code&gt;, type some characters, &lt;code&gt;C-r&lt;/code&gt; a couple more times to find the desired command, then hit &lt;code&gt;Return&lt;/code&gt; and the command is executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to edit the command before it's executed, I type any of &lt;code&gt;C-e&lt;/code&gt;, &lt;code&gt;C-a&lt;/code&gt;, &lt;code&gt;C-l&lt;/code&gt;, &lt;code&gt;&amp;lt;left&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;right&amp;gt;&lt;/code&gt;, which exits isearch, leaving the result on the command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I love using &lt;code&gt;C-r&lt;/code&gt; to search Emacs' minibuffer history, but having to hit &lt;code&gt;Return&lt;/code&gt; once to accept the search result and a second time to submit it is annoying. I guess it's partly psychological...&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Me (searching)&lt;/em&gt;: There, that's the one. Enter!&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Emacs&lt;/em&gt;: um, &lt;em&gt;this&lt;/em&gt; one?&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Me (eyeroll)&lt;/em&gt;: Yes, that one. Enter.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to fix this. &lt;code&gt;Return&lt;/code&gt; is bound to &lt;code&gt;isearch-exit&lt;/code&gt; in &lt;code&gt;overriding-terminal-local-map&lt;/code&gt;. This appears to be the case both inside and outside the minibuffer. It also seems that the aforementioned map is not defined until you've entered isearch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivan/isearch-exit ()&#xA;  (interactive)&#xA;  (isearch-exit)&#xA;  (if (minibuffer-window-active-p (selected-window))&#xA;      (minibuffer-complete-and-exit)))&#xA;&#xA;(defun ivan/remap-isearch-exit ()&#xA;  (define-key&#xA;    overriding-terminal-local-map&#xA;    [remap isearch-exit]&#xA;    #'ivan/isearch-exit))&#xA;&#xA;(add-hook 'isearch-mode-hook #'ivan/remap-isearch-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far, this seems to work, but is there a cleaner approach?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-09-02T13:03:52.867" LastActivityDate="2016-09-02T13:03:52.867" Title="Accept and submit minibuffer isearch result with a single keypress" Tags="|minibuffer|isearch|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24804" PostTypeId="2" ParentId="18040" CreationDate="2016-07-24T15:26:09.197" Score="5" Body="&lt;p&gt;I know nothing about mail in Emacs, but running &lt;code&gt;C-h k C-x m&lt;/code&gt; tells me that &lt;code&gt;C-x m&lt;/code&gt; runs the command &lt;code&gt;compose-mail&lt;/code&gt;, which is different from &lt;code&gt;mail&lt;/code&gt;. This is presumably why they behave differently. You can find out more with &lt;code&gt;C-h f compose-mail&lt;/code&gt; and &lt;code&gt;C-h f mail&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12534" LastActivityDate="2016-07-24T15:26:09.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24805" PostTypeId="2" ParentId="7501" CreationDate="2016-07-24T18:18:32.523" Score="2" Body="&lt;p&gt;I'm working on abbrev as well and it seems &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Expanding-Abbrevs.html&quot; rel=&quot;nofollow&quot;&gt;only word-constituent characters&lt;/a&gt; can be part of an abbrev. Thus I don't think you can use &lt;code&gt;&quot;-=&quot;&lt;/code&gt; as an abbrev. Have you tried using other characters?&lt;/p&gt;&#xA;" OwnerUserId="6807" LastActivityDate="2016-07-24T18:18:32.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24806" PostTypeId="1" CreationDate="2016-07-24T18:26:32.580" Score="2" ViewCount="113" Body="&lt;p&gt;I know one can define where abbrev files are saved with something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq abbrev-file-name &quot;/home/zeltak/.emacs.d/abbrv/personal_abbrv.txt&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this file has several section like &lt;code&gt;(define-abbrev-table 'Buffer-menu-mode-abbrev-table '())&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to define another file that will only record the &lt;code&gt;global-abbrev-table&lt;/code&gt;, is that possible at all?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="25" LastEditDate="2016-07-25T07:24:18.160" LastActivityDate="2016-07-25T07:24:18.160" Title="specify global-abbrev-table in a separate file" Tags="|abbrev|configuration-files|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24808" PostTypeId="1" CreationDate="2016-07-24T19:52:47.287" Score="3" ViewCount="2265" Body="&lt;p&gt;I have been using OS X forever. I have been using Emacs forever. I currently use the MacPorts Emacs.app and do &lt;code&gt;(server-start)&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt; file. I can't get &lt;code&gt;emacsclient&lt;/code&gt; going:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; which emacsclient&#xA;/opt/local/bin/emacsclient&#xA;&amp;gt;  emacsclient ~/.emacs&#xA;emacsclient: can't find socket; have you started the server?&#xA;To start the server in Emacs, type &quot;M-x server-start&quot;.&#xA;emacsclient: No socket or alternate editor.  Please use:&#xA;&#xA;        --socket-name&#xA;        --server-file      (or environment variable EMACS_SERVER_FILE)&#xA;        --altstrong texternate-editor (or environment variable ALTERNATE_EDITOR)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suggestions?&lt;/p&gt;&#xA;" OwnerUserId="11515" LastActivityDate="2016-07-24T21:09:14.207" Title="Emacsclient not working" Tags="|emacsclient|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24809" PostTypeId="1" CreationDate="2016-07-24T21:04:10.900" Score="2" ViewCount="223" Body="&lt;p&gt;I have the habit when creating larger projects to make files called skeleton.typ with all the standard boilerplate for a file of that type (e.g. copyright notices, licenses, the standard &lt;code&gt;html&lt;/code&gt;/&lt;code&gt;head&lt;/code&gt;/&lt;code&gt;title&lt;/code&gt;/&lt;code&gt;body&lt;/code&gt;/etc. tags for a web page, &lt;code&gt;#include&lt;/code&gt;s for a .c, etc.) and places to fill in marked.  Then when I create a new file with &lt;kbd&gt;C-x C-f&lt;/kbd&gt; and get a blank page, I &lt;kbd&gt;C-x C-i&lt;/kbd&gt; the relevant skeleton file.  And, if one doesn't exist in that dir when in a deep part of a project, it's relatively easy to do &lt;kbd&gt;M-b&lt;/kbd&gt; over the &lt;kbd&gt;sk&lt;/kbd&gt; I tried to complete and keep trying &lt;kbd&gt;M-backspace TAB&lt;/kbd&gt; until it finds one, or the top of the project is reached (in which case it's time to create one, starting from a personal dir of skeleton &lt;code&gt;skeleton&lt;/code&gt; files).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been thinking about automating this for a while (by writing something to go on &lt;code&gt;find-file-not-found-functions&lt;/code&gt;).  Then I saw &lt;a href=&quot;https://emacs.stackexchange.com/questions/24790/how-to-create-a-file-from-a-template-if-it-does-not-exist-or-open-existing-copy&quot;&gt;this question&lt;/a&gt; and it inspired me to action.  I realized that this seemed such an obviously useful thing that I should see if I could just find an existing piece of code I can use.  That might well find code with added features I like but wouldn't have written in my own version.  It would also save me the time of actually writing it (and the search, etc. was a completely effective &quot;avoidance mechanism&quot; to put off writing it for another day, at least I recognize them after-the-fact now, hopefully I'll eventually spot them ahead of time and avoid them :-).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having spent a couple of hours using &lt;code&gt;emacs&lt;/code&gt;' built in help to look at things that &lt;em&gt;almost&lt;/em&gt; do what I want, looking at SE and finding Q&amp;amp;A's that are close, and collating all these things for this Q; I figured the next step before actually buckling down to write the code, is to ask this august assemblage for references to existing things that might help (probably inspired slightly by the fact that the trigger was here).  So, &lt;em&gt;my&lt;/em&gt; question is: does anyone have or know of code that would do this?  Unlike other questions asking about slight variations, I'm not expecting anyone else to write the whole thing.  If no useful pointers arise, I'll write it and then answer this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things I've looked at:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/24790/how-to-create-a-file-from-a-template-if-it-does-not-exist-or-open-existing-copy&quot;&gt;This question&lt;/a&gt; is actually the one that inspired me to start thinking about this again.  But the existing answer is too simple and specific to that question.  If I'd already written the tool I'm thinking of, it might have made a good answer as well, and after I find/write it, I may think about adding it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;auto-insert&lt;/code&gt; is really almost the right thing, but it searches in the wrong way.  With this each user would have a unique set of templates.  I really need this the other way.  For my paradigm the template is a per-project thing (for example, every C project has different standard &lt;code&gt;#includes&lt;/code&gt; possibly different in different parts of the project, and as a consultant, the copyright may need to be to the client), and that's why my search in the local dir and parents to root of project.  If nobody comes up with a better resource, I may read through &lt;code&gt;auto-insert&lt;/code&gt; and either make a variant that does it the way I want, or try adding some options to it to do that.  I did realize, however, that &lt;code&gt;auto-insert&lt;/code&gt; might be just the right thing for the skeleton &lt;code&gt;skeleton&lt;/code&gt; files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;skeleton-insert&lt;/code&gt; seems like it might be a great part of a really elaborate solution.  But, it needs to be primed with a large complex LISP expression (which would then be a per-user setting, see previous bullet on that) and does not seem to be suited to the template file style I use.  I might be able to leverage this by having the &lt;code&gt;file-not-found&lt;/code&gt; hook look for a file of elisp that sets this locally, but that seems like it'd still be 50% of the work solving only 25% of the problem.  And then I need to write the hairy lisp structure rather than just creating a file that looks like what's wanted.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also did searches around &lt;a href=&quot;https://emacs.stackexchange.com/&quot;&gt;https://emacs.stackexchange.com/&lt;/a&gt; for all the relevant keywords I could think of and didn't find anything exactly right.  I kept coming across the question that inspired me, but none of the others were actually any more relevant.  I have tried to mention any keyword that seemed relevant in this question so future searchers can find &lt;em&gt;this&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, that's the relevant background.  If I write something myself, here are what I'll target as features (and some constraints I still haven't figured out):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;a function to go on &lt;code&gt;find-file-not-found-functions&lt;/code&gt;.  It does an insert to get the relevant template (or skeleton) file, searching up the tree to find it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There should (probably) be some way to limit the search, although in my case the top of the project is usually only a couple of layers down from &lt;code&gt;/&lt;/code&gt;, so it wouldn't be painful to search all the way to the top.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Maybe use &lt;code&gt;skeleton-insert&lt;/code&gt; to do the interactive fill-in or leverage some of its internals.  If not, I'll probably just continue my current convention where three square brackets are used to mark fill ins, with text inside to say what.  And have the function find relevant entries.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11699" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2018-05-16T11:15:45.040" Title="Looking for an existing function for find-file-not-found-functions to do form style creation" Tags="|files|find-file|template|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24810" PostTypeId="2" ParentId="24808" CreationDate="2016-07-24T21:09:14.207" Score="1" Body="&lt;p&gt;Sounds like you are trying to use &lt;code&gt;emacsclient&lt;/code&gt; before having started the server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have &lt;code&gt;(server-start)&lt;/code&gt; in your init file, but did you actually start Emacs normally before trying to use &lt;code&gt;emacsclient&lt;/code&gt;?  If not, that's probably your problem: that call to &lt;code&gt;server-start&lt;/code&gt; was not made before you invoked &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative is to use the &lt;code&gt;--daemon&lt;/code&gt; command-line option when starting Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html&quot; rel=&quot;nofollow&quot;&gt;Emacs Server&lt;/a&gt; of the Emacs manual explains it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-24T21:09:14.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24811" PostTypeId="2" ParentId="24809" CreationDate="2016-07-24T22:56:32.070" Score="1" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/header2.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;header2.el&lt;/code&gt;&lt;/a&gt; is generally for file headers, which use only code comments (see &lt;a href=&quot;https://www.emacswiki.org/emacs/AutomaticFileHeaders&quot; rel=&quot;nofollow&quot;&gt;automatic file headers&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it really is about adding and updating (including automatically) &lt;em&gt;boilerplate&lt;/em&gt; text that you define.  That text need not be comment text. And it can be mode-specific or be applied conditionally in any other way.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-24T22:56:32.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24812" PostTypeId="5" CreationDate="2016-07-25T07:30:28.773" Score="0" Body="&lt;p&gt;Use this tag for questions about configuration files for Emacs features and add-ons. For questions specifically about &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;.emacs.el&lt;/code&gt; or &lt;code&gt;.emacs.d/init.el&lt;/code&gt;, use the tag &lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt; instead. For questions that ask “how do I configure X?”, just use the tag(s) for X: use this tag only for questions where the configuration files themselves are the issue.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-07-25T07:30:28.773" LastActivityDate="2016-07-25T07:30:28.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24813" PostTypeId="4" CreationDate="2016-07-25T07:30:28.773" Score="0" Body="Questions specifically about configuration files other than the init file. Do not use this tag for questions about how to configure something, only for questions specifically about the configuration files." OwnerUserId="25" LastEditorUserId="14920" LastEditDate="2018-05-17T17:51:33.520" LastActivityDate="2018-05-17T17:51:33.520" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24814" PostTypeId="1" AcceptedAnswerId="24816" CreationDate="2016-07-25T09:14:14.603" Score="0" ViewCount="2413" Body="&lt;p&gt;I'm writing an extension to open a custom link type in Org-mode with Kiwix URL. (Kiwix is an offline Wikipedia program). Here is my &lt;a href=&quot;https://github.com/stardiviner/kiwix.el&quot; rel=&quot;nofollow&quot;&gt;kiwix.el source code&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I created a &lt;code&gt;wiki:&lt;/code&gt; link type for Org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the link formats:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[[wiki:(library):query]]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[[wiki:query]]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;links:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;wiki:(zh):%E7%A6%85%E5%AE%97&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;wiki:(en):linux&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;wiki:linux&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And here is the elisp regexp:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;&quot;\\(wiki\\):\\((\\(.*\\)):\\)?\\(.*\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is my current function to handle the link:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-wiki-link-open (link)&#xA;  &quot;Open LINK in external wiki program.&quot;&#xA;  (cond ((string-match &quot;\\(wiki\\):\\((\\(.*\\)):\\)?\\(.*\\)&quot;  link) ; [[wiki:(library):query]]&#xA;         (let* ((type (match-string 1 link))&#xA;                ;; convert between libraries full name and abbrev.&#xA;                (library (cdr (assoc&#xA;                               (match-string 3 link)&#xA;                               kiwix-librarie-abbrev-list)))&#xA;                (query (match-string 4 link))&#xA;                (url (concat kiwix-server-url library &quot;/A/&quot; (url-encode-url (capitalize query)) &quot;.html&quot;)))&#xA;           (browse-url url)))&#xA;        ((string-match &quot;\\(wiki\\):\\(.*\\)&quot;  link) ; [[wiki:query]]&#xA;         (let* ((type (match-string 1 link))&#xA;                (query (match-string 4 link))&#xA;                (url (concat kiwix-server-url kiwix-default-library &quot;/A/&quot; (url-encode-url (capitalize query)) &quot;.html&quot;)))&#xA;           (browse-url url)))))&#xA;&#xA;(defun org-wiki-link-export (link description format)&#xA;  &quot;Export the wiki LINK with DESCRIPTION for FORMAT from Org files.&quot;&#xA;  (let* ((type (when (string-match &quot;\\(.+\\):(\\(.+\\)?):\\(.*\\)&quot; link)&#xA;                 (match-string 1 link)))&#xA;         (library (when (string-match &quot;\\(.+\\):(\\(.+\\)?):\\(.*\\)&quot; link)&#xA;                    (match-string 2 link)))&#xA;         ;; query need to be convert to URL encoding: &quot;禅宗&quot; https://zh.wikipedia.org/wiki/%E7%A6%85%E5%AE%97&#xA;         (query (url-encode-url&#xA;                 (or description&#xA;                     (when (string-match &quot;\\(.+\\):(\\(.+\\)?):\\(.*\\)&quot; link)&#xA;                       (match-string 3 link)))))&#xA;         ;; &quot;http://en.wikipedia.org/wiki/Linux&quot;&#xA;         ;;         --&#xA;         ;;          ^- library: en, zh&#xA;         (path (concat &quot;http://&quot; library &quot;.wikipedia.org/wiki/&quot; query))&#xA;         (desc query))&#xA;    (when (stringp path)&#xA;      (cond&#xA;       ((eq format 'html) (format &quot;&amp;lt;a href=\&quot;%s\&quot;&amp;gt;%s&amp;lt;/a&amp;gt;&quot; path desc))&#xA;       ((eq format 'latex) (format &quot;\\href{%s}{%s}&quot; path desc))&#xA;       (t path)))))&#xA;&#xA;(org-add-link-type &quot;wiki&quot; 'org-wiki-link-open 'org-wiki-link-export)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this regexp is wrong, can't open those example links correctly.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;[[wiki:(en):Linux][Linux (wiki)]]&lt;/li&gt;&#xA;&lt;li&gt;[[wiki:Linux][Linux]]&lt;/li&gt;&#xA;&lt;li&gt;[[wiki:(zh):%E7%A6%85%E5%AE%97][禅宗]]&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So I hope someone can help me to improve this regexp pattern and my function code.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-07-26T05:12:26.723" Title="How to match this string with elisp regexp?" Tags="|regular-expressions|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24815" PostTypeId="1" CreationDate="2016-07-25T10:16:54.077" Score="0" ViewCount="78" Body="&lt;p&gt;Having mostly switched to Emacs, I still sorely miss the &lt;code&gt;dired&lt;/code&gt; mode of XEmacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell, XEmacs' &lt;code&gt;dired&lt;/code&gt; started from &lt;code&gt;dired-x&lt;/code&gt; (not Emacs' &lt;code&gt;dired&lt;/code&gt;) many years ago and then drifted away, so I guess that &lt;code&gt;dired-x&lt;/code&gt; (that now has drifted away from the &lt;code&gt;dired-x&lt;/code&gt; of many years ago as well) plus a number of extra packages and/or customizations may eventually lead to a partially satisfactory solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that (a part of) all this hassle can be avoided using some ready-made fix, so my question is,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is there a port of the Xemacs' &lt;code&gt;dired&lt;/code&gt;, or at least a partial port, for Emacs 24.x?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Tia&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: my question, despite the previous title that was a little misleading, does not concern customizing specific aspects of &lt;code&gt;dired&lt;/code&gt; but is about a ready-made mode that mimics XEmacs' &lt;code&gt;dired&lt;/code&gt;.  In this respect I don't feel like giving a detailed list of differences between the implementations, at least for now --- I may change my mind if no answers will show up...&lt;/p&gt;&#xA;" OwnerUserId="9672" LastEditorUserId="9672" LastEditDate="2016-07-25T12:04:46.777" LastActivityDate="2016-07-26T03:00:29.627" Title="is there a dired-like mode that behaves like XEmacs' dired" Tags="|dired|xemacs|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24816" PostTypeId="2" ParentId="24814" CreationDate="2016-07-25T10:55:34.690" Score="1" Body="&lt;p&gt;Your regexp should be &lt;code&gt;\\(wiki\\):\\(?:(\\([^:]*\\)):\\)?\\([^] \n\t\r]*\\)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have with that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;group 1: wiki&lt;/li&gt;&#xA;&lt;li&gt;non capturing group (&lt;code&gt;\(?:...\)&lt;/code&gt;) for optional library&lt;/li&gt;&#xA;&lt;li&gt;group 2: library (&lt;code&gt;en&lt;/code&gt; or &lt;code&gt;zh&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;group 3: link? (match everything but &lt;code&gt;]&lt;/code&gt;, space, tab, carriage return, linefeed by using &lt;code&gt;[^] \n\t\r]*&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, you have one group less (your code should be adapted to that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an optimization you should &lt;code&gt;string-match&lt;/code&gt; once and use subsequent &lt;code&gt;match-string&lt;/code&gt; for each group of interest.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-07-26T05:12:26.723" LastActivityDate="2016-07-26T05:12:26.723" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24818" PostTypeId="1" CreationDate="2016-07-25T11:44:57.353" Score="1" ViewCount="1648" Body="&lt;p&gt;I'm reading through the definition of &lt;code&gt;package-initialize&lt;/code&gt; to try and understand what goes on under the hood, and part of what it does is to read the package archive files. I see it comparing version numbers, but I don't fully understand what it's doing at a high level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking at this method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun package-read-archive-contents (archive)&#xA;  &quot;Re-read archive contents for ARCHIVE.&#xA;If successful, set the variable `package-archive-contents'.&#xA;If the archive version is too new, signal an error.&quot;&#xA;  ;; Version 1 of 'archive-contents' is identical to our internal&#xA;  ;; representation.&#xA;  (let* ((contents-file (format &quot;archives/%s/archive-contents&quot; archive))&#xA;     (contents (package--read-archive-file contents-file)))&#xA;    (when contents&#xA;      (dolist (package contents)&#xA;    (package--add-to-archive-contents package archive)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; it's being used to make sure that the packages we're loading also have their descriptors added to the package archives (e.g. &lt;code&gt;.emacs.d/elpa/melpa-stable/archive-contents&lt;/code&gt; if they're not already in there. But I'm not clear on what these &lt;code&gt;archive-contents&lt;/code&gt; files are used for, since running a command like &lt;code&gt;package-list-packages&lt;/code&gt; communicates with the remote package archive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologize if this question is a bit muddled, but I'm trying to push through the awkward early stage of learning emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should also probably mention that the reason I started investigating the internals of &lt;code&gt;package-initialize&lt;/code&gt; was to figure out if there's some kind of lazy-loading that I could be doing, rather than loading everything as soon as emacs starts up.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-07-25T23:40:48.740" LastActivityDate="2016-07-25T23:40:48.740" Title="What does package-initialize do with package archives?" Tags="|package|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24819" PostTypeId="2" ParentId="18040" CreationDate="2016-07-25T12:54:19.810" Score="0" Body="&lt;p&gt;&lt;code&gt;C-x m&lt;/code&gt; calls &lt;code&gt;compose-mail&lt;/code&gt; but not &lt;code&gt;mail&lt;/code&gt;.  According to documentation &lt;code&gt;compose-mail&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Start composing a mail message to send.&#xA;  This uses the user's chosen mail composition package&#xA;  as selected with the variable `mail-user-agent'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;for &lt;code&gt;mail-user-agent&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Your preference for a mail composition package.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but &lt;code&gt;mail&lt;/code&gt; from &lt;code&gt;sendmail.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit a message to be sent.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, if set, &lt;code&gt;compose-mail&lt;/code&gt; could call &lt;code&gt;mail&lt;/code&gt; from &lt;code&gt;sendmail.el&lt;/code&gt; for creating and sending email.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-07-25T12:54:19.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24820" PostTypeId="2" ParentId="24782" CreationDate="2016-07-25T13:36:07.640" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to jump in helm mini directly to the next source?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, you can do it via &lt;kbd&gt;C-o&lt;/kbd&gt; (&lt;code&gt;helm-next-source&lt;/code&gt;) in all helm commands. The following is copied from helm's documentation (you can access it via &lt;kbd&gt;C-h m&lt;/kbd&gt; in helm).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Helm's Basic Operations and Default Key Bindings&#xA;&#xA;| Key     | Alternative Keys | Command                                                   |&#xA;|---------+------------------+-----------------------------------------------------------|&#xA;| Left    |                  | Previous Source                                           |&#xA;| Right   | C-o              | Next Source                                               |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is it also possible to fold and unfold a source-list?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, it is impossible.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-07-25T13:36:07.640" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24821" PostTypeId="2" ParentId="24694" CreationDate="2016-07-25T15:13:20.140" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;mode-name&lt;/code&gt; is a buffer-local variable that is also bound inside your function &lt;code&gt;sandric/kill-buffers-by-major-mode&lt;/code&gt;.  Under dynamic scoping, that means that the value of &lt;code&gt;mode-name&lt;/code&gt; seen by your code will change when you change buffers (in this case, when you kill the current buffer).  See the warning &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Intro-to-Buffer_002dLocal.html#Intro-to-Buffer_002dLocal&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; about &lt;code&gt;let&lt;/code&gt; bindings; it also applies to function arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This problem goes away for me if the function is defined using lexical scope, but according to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Lexical-Binding.html#Using-Lexical-Binding&quot; rel=&quot;nofollow&quot;&gt;the manual&lt;/a&gt;, this is undefined behavior and using a special variable such as &lt;code&gt;mode-name&lt;/code&gt; as a function argument is discouraged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the correct solution is just to change the name of your function argument from &lt;code&gt;mode-name&lt;/code&gt; to another symbol that is not defined as buffer-local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Thanks to Tobias for explaining the details of the problematic interaction in the comments; my previous explanation was very sketchy, and I made some unfounded assumptions about what was causing the problem.)&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2016-09-26T16:10:07.700" LastActivityDate="2016-09-26T16:10:07.700" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24822" PostTypeId="1" CreationDate="2016-07-25T16:52:50.097" Score="1" ViewCount="486" Body="&lt;p&gt;I often write python code in which a function returns a value.  Often I will define that value higher up in the code as &quot;returnvalue&quot; or some similar name.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the next line is indented differently.  This is because emacs believes (falsely) that I just used the command &quot;return value&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I end up with things like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def square(x):&#xA;    returnvalue = x*x&#xA;return returnvalue&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where it should be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def square(x):&#xA;    returnvalue = x*x&#xA;    return returnvalue&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since indentation level is fundamentally important for python, this is a big deal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really like the auto-indenting, but I'd either like to somehow get it to recognize that if return isn't followed by white space, it should treat it as any other line of code.  Alternately I'd like it to simply not treat return as a special word at all.  Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;More information&lt;/strong&gt;:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For what it's worth, I'm using Aquamacs (on Mac OS X).  In &lt;code&gt;~/Library/Preferences/Aquamacs Emacs/&lt;/code&gt; it says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;  ;; custom-set-variables was added by Custom.&#xA;  ;; If you edit it by hand, you could mess it up, so be careful.&#xA;  ;; Your init file should contain only one such instance.&#xA;  ;; If there is more than one, they won't work right.&#xA; '(aquamacs-additional-fontsets nil t)&#xA; '(aquamacs-customization-version-id 215 t)&#xA; '(aquamacs-tool-bar-user-customization nil t)&#xA; '(default-frame-alist (quote ((fringe) (right-fringe) (left-fringe . 1) (internal-border-width . 0) (vertical-scroll-bars . right) (cursor-type . box) (menu-bar-lines . 1) (tool-bar-lines . 1) (background-color . &quot;black&quot;) (background-mode . dark) (border-color . &quot;black&quot;) (cursor-color . &quot;yellow&quot;) (foreground-color . &quot;white&quot;) (mouse-color . &quot;sienna1&quot;))))&#xA; '(ns-tool-bar-display-mode (quote both) t)&#xA; '(ns-tool-bar-size-mode (quote regular) t)&#xA; '(visual-line-mode nil t))&#xA;(custom-set-faces&#xA;  ;; custom-set-faces was added by Custom.&#xA;  ;; If you edit it by hand, you could mess it up, so be careful.&#xA;  ;; Your init file should contain only one such instance.&#xA;  ;; If there is more than one, they won't work right.&#xA; '(autoface-default ((t (:inherit default))))&#xA; '(fundamental-mode-default ((t (:inherit autoface-default))) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't have a &lt;code&gt;.emacs&lt;/code&gt; file and &lt;code&gt;~/Library/Preferences/Aquamacs Emacs/Preferences.el&lt;/code&gt; is empty.  When I run emacs from the terminal command line it opens in the window and doesn't automatically indent.&lt;/p&gt;&#xA;" OwnerUserId="12743" LastEditorUserId="12743" LastEditDate="2016-07-26T02:08:30.513" LastActivityDate="2016-07-26T02:08:30.513" Title="Modifying auto-indent in emacs with python" Tags="|indentation|python|" AnswerCount="0" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24823" PostTypeId="1" AcceptedAnswerId="24825" CreationDate="2016-07-25T16:55:29.000" Score="9" ViewCount="3966" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Related:&lt;/strong&gt; &lt;a href=&quot;https://stackoverflow.com/questions/3984730/emacs-gui-with-emacs-daemon-not-loading-fonts-correctly&quot;&gt;Emacs: GUI with emacs --daemon not loading fonts correctly&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;init.el&lt;/code&gt; contains the following lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'darktooth-theme)&#xA;(load-theme 'darktooth t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I start Emacs with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... the theme loads properly. [Scroll down!]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JTfUf.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JTfUf.png&quot; alt=&quot;The Darktooth theme working properly on Emacs.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I start Emacs with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --daemon&#xA;   ...&#xA;$ emacsclient -c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... the theme doesn't load properly. [Keep scrolling]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gZFpM.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gZFpM.png&quot; alt=&quot;The Darktooth theme not working.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why does this happen, and how can it be fixed?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="10948" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-07-26T15:02:02.160" Title="Emacs (as daemon) doesn't load theme" Tags="|themes|daemon|emacs-daemon|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24824" PostTypeId="1" CreationDate="2016-07-25T17:34:20.297" Score="0" ViewCount="468" Body="&lt;p&gt;I posted this question on &lt;a href=&quot;https://stackoverflow.com/questions/38554179/left-align-org-mode-like-foldingtext&quot;&gt;stackoverflow&lt;/a&gt; earlier, but perhaps this is a better place for it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a way to left-align text in Org-mode so that the paragraphs line up like in FoldingText. Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  * Headline number 1&#xA; ** Headline number 2 [0/2]&#xA;&#xA;    Here is some text&#xA;    before our first unordered list:&#xA;&#xA;  - List item 1&#xA;  - List item 2&#xA;&#xA;    And here is a checklist:&#xA;&#xA;  - [ ] Do this first&#xA;  - [ ] Do this next&#xA;&#xA; ** Headline number 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried using &lt;code&gt;align-regexp&lt;/code&gt; but I am having trouble figuring the correct regex string... any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Here's an update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got this working with the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun align-ft (p1 p2)&#xA;  &quot;Align outlines like FoldingText&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (align-regexp p1 p2 &quot;\\(^\\*+\\s-\\|^-\\s-\\|^\\).&quot; -1 0 nil)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only problem is that it aligns text by adding spaces, and I don't want spaces hard-coded into the document. I just want it to display, as if the spaces were there (like in &lt;code&gt;org-indent-mode&lt;/code&gt;). Also, this code requires the region to be highlighted and ultimately, I just want it to auto-align the entire document, as I type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2024-03-18T13:00:50.110" Title="Left-align org-mode like FoldingText... Regexp?" Tags="|org-mode|regular-expressions|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24825" PostTypeId="2" ParentId="24823" CreationDate="2016-07-25T17:38:09.483" Score="4" Body="&lt;p&gt;Edit: This &lt;a href=&quot;https://stackoverflow.com/questions/18904529/after-emacs-deamon-i-can-not-see-new-theme-in-emacsclient-frame-it-works-fr&quot;&gt;question&lt;/a&gt; has several answers, which generally seem to boil down to &quot;use &lt;code&gt;after-frame-functions&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Original answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you want to call &lt;code&gt;load-theme&lt;/code&gt; from &lt;code&gt;after-init-hook&lt;/code&gt;.  That's where I load my own theme, and I have no problems using it with &lt;code&gt;emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know the ins and outs of the Emacs initialization process well enough to say for sure, but presumably you're loading the theme too early, and it's getting overriden by other settings (maybe something set up through &lt;code&gt;customize&lt;/code&gt;?).&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-07-26T15:02:02.160" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24826" PostTypeId="1" CreationDate="2016-07-25T17:39:35.517" Score="4" ViewCount="1111" Body="&lt;p&gt;[OS X 10.11, MacPorts Emacs 24.5, OS X Terminal, lots of stuff in emacs and shell init files]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I almost always use Emacs.app (GUI). Sometimes I want to open Emacs in a terminal. When I open Emacs from a terminal I get a bright green background that in combination with my usual theme is unusable -- I can't even read the messages at the bottom of the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried this with various Terminal Profiles but they all do the same. I have tried &lt;code&gt;emacs -bg while&lt;/code&gt; but that doesn't work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I control the background color of Emacs opened from the terminal?&lt;/p&gt;&#xA;" OwnerUserId="11515" LastEditorUserId="11515" LastEditDate="2016-07-25T17:44:55.137" LastActivityDate="2023-03-02T20:07:11.183" Title="Emac in Terminal opens in unusable green background" Tags="|terminal-emacs|colors|" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24827" PostTypeId="1" CreationDate="2016-07-25T18:07:44.313" Score="1" ViewCount="127" Body="&lt;p&gt;Is there a way to only highlight blank spaces/tabs under the marked region? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically if I have whitespace-mode turned off and if a select a region all the spaces and tabs get highlighted.&lt;/p&gt;&#xA;" OwnerUserId="12747" LastActivityDate="2016-07-25T19:50:28.580" Title="highlight blank spaces only under the marked region" Tags="|region|mark|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24828" PostTypeId="2" ParentId="18194" CreationDate="2016-07-25T19:04:39.857" Score="4" Body="&lt;p&gt;The &lt;code&gt;org-capture&lt;/code&gt; function puts some properties into the &lt;code&gt;org-capture-plist&lt;/code&gt;, i. a. &lt;code&gt;:original-buffer&lt;/code&gt;, &lt;code&gt;:original-file&lt;/code&gt; and &lt;code&gt;:original-file-nondirectory&lt;/code&gt;, which all point to the buffer/file where the capture has been initiated from. The following addition to your capture template will insert the line-number at point in the original buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%(with-current-buffer (org-capture-get :original-buffer) (number-to-string (line-number-at-pos)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-07-25T19:04:39.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24830" PostTypeId="2" ParentId="24827" CreationDate="2016-07-25T19:50:28.580" Score="1" Body="&lt;p&gt;I'm not sure if there exists any package which can allow you to selectively highlight spaces and tabs in a region. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what you can do as an alternative is, select the region you want to use the whitespace-mode on, narrow the buffer to this region by pressing &lt;code&gt;C-x n n&lt;/code&gt; (you might get a warning from emacs about using a disabled command) and enable the whitespace-mode in this narrowed region. After you are done, press &lt;code&gt;C-x n w&lt;/code&gt; to execute &lt;code&gt;widen&lt;/code&gt; command which will undo the narrowing. &lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-07-25T19:50:28.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24831" PostTypeId="2" ParentId="24573" CreationDate="2016-07-25T20:05:59.350" Score="2" Body="&lt;p&gt;You could try something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-self-insert-hook&#xA;          (lambda ()&#xA;            (and (eq last-command-event ?e)&#xA;                 (looking-back &quot;ae&quot; (- (point) 2))&#xA;                 (replace-match &quot;æ&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-25T20:05:59.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24832" PostTypeId="2" ParentId="24818" CreationDate="2016-07-25T20:11:00.730" Score="4" Body="&lt;p&gt;&lt;code&gt;package-initialize&lt;/code&gt; is supposed to find all the installed packages and &lt;em&gt;activate&lt;/em&gt; them (depending on the optional argument) by executing their &lt;code&gt;&amp;lt;pkg&amp;gt;-autoloads.el&lt;/code&gt; files.  Part of the complexity comes from the fact that it tries to make sure that it only activates a single version (the latest) of a given package (in case several versions of a package are installed).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-25T20:11:00.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24833" PostTypeId="1" AcceptedAnswerId="32875" CreationDate="2016-07-25T20:27:12.643" Score="4" ViewCount="302" Body="&lt;p&gt;I noticed that whenever I narrow a region in emacs, the line numbering is relative to the narrowed region rather than being relative to the original file. Is there any way I can preserve the line numbering from the original buffer ?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="105" LastEditDate="2016-10-29T04:25:54.343" LastActivityDate="2017-05-19T07:53:07.497" Title="Preserve original line numbering for a narrowed region" Tags="|line-numbers|narrowing|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24835" PostTypeId="2" ParentId="24815" CreationDate="2016-07-26T03:00:29.627" Score="2" Body="&lt;p&gt;I'm pretty sure the answer is &lt;code&gt;no&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll be better off asking for the specific features/behaviors you miss.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-26T03:00:29.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24836" PostTypeId="2" ParentId="7806" CreationDate="2016-07-26T03:33:27.563" Score="0" Body="&lt;p&gt;install latest find-file-in-project&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x ffip-show-diff-by-description&lt;/code&gt;, but the output is in &lt;code&gt;ffip-diff-mode&lt;/code&gt; instead of ediff-mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also setup &lt;code&gt;ffip-diff-backends&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2017-05-08T09:26:28.427" LastActivityDate="2017-05-08T09:26:28.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24837" PostTypeId="2" ParentId="22406" CreationDate="2016-07-26T03:36:41.333" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/tumashu/chinese-fonts-setup&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tumashu/chinese-fonts-setup&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you google Chinese font emacs, this is the first result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'chinese-fonts-setup)&#xA;(chinese-fonts-setup-enable) ; enable setup&#xA;(cfs-set-spacemacs-fallback-fonts) ; fix unicode icon display in spacemacs mode-line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, there are three profiles setup in &lt;code&gt;cfs-profiles&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq cfs-profiles&#xA;    '(&quot;program&quot; &quot;org-mode&quot; &quot;read-book&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can switch the profile by &lt;code&gt;M-x cfs-switch-profile&lt;/code&gt; or &lt;code&gt;M-x cfs-next-profile&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely your OS should have Chinese fonts installed at first.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2017-02-27T10:13:54.483" LastActivityDate="2017-02-27T10:13:54.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24839" PostTypeId="2" ParentId="24783" CreationDate="2016-07-26T06:08:49.993" Score="2" Body="&lt;p&gt;Full behavior of &lt;code&gt;helm-find-files&lt;/code&gt; is coming from &lt;code&gt;helm-source-find-files&lt;/code&gt;. However, this variable has a docstring that says: &quot;Should not be used among other sources.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple of observations, from trying a few things and looking at &lt;code&gt;helm-files.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Adding &lt;code&gt;helm-source-find-files&lt;/code&gt; to &lt;code&gt;helm-mini-default-sources&lt;/code&gt; does produce the desired effect, with the following caveat:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;helm-source-find-files&lt;/code&gt; variable is initially &lt;code&gt;nil&lt;/code&gt;, and it gets initialised only after &lt;code&gt;helm-find-files&lt;/code&gt; has been invoked already at least once.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Based on all that, my take is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can make it work, by taking &lt;code&gt;helm-source-find-files&lt;/code&gt; as a basis, but you will have to initialise it - meaning digging through &lt;code&gt;helm-files.el&lt;/code&gt; and figuring how to do it, and keep it in proper order (syncing up with the current directory or thing at point etc.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And it may break in a future update of &lt;code&gt;helm&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In short, no, unless you are prepared to do a fair bit of coding and then support it (or submit a pull request to &lt;code&gt;helm&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="12749" LastActivityDate="2016-07-26T06:08:49.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24840" PostTypeId="2" ParentId="24772" CreationDate="2016-07-26T06:29:30.873" Score="4" Body="&lt;p&gt;Yes, a regexp that starts with an asterisk filters out by major mode, exactly what you need. So add &lt;code&gt;&quot;\\*circe-mode&quot;&lt;/code&gt; to &lt;code&gt;helm-boring-buffer-regexp-list&lt;/code&gt; list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(To convince yourself, you can first try it right in the buffer list, by typing &lt;code&gt;*circe-mode&lt;/code&gt; as the pattern and making sure you see only the buffers you want to filter out.)&lt;/p&gt;&#xA;" OwnerUserId="12749" LastActivityDate="2016-07-26T06:29:30.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24841" PostTypeId="2" ParentId="24772" CreationDate="2016-07-26T06:57:17.400" Score="1" Body="&lt;p&gt;The buffer names created by Circe look like &lt;code&gt;#emacs&lt;/code&gt; and &lt;code&gt;irc.freenode.net:6697&lt;/code&gt; from here, and the following is how to tell helm to ignore them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'helm-buffers&#xA;  (add-to-list 'helm-boring-buffer-regexp-list &quot;\\`#&quot;)&#xA;  (add-to-list 'helm-boring-buffer-regexp-list &quot;irc.freenode.net:6697&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as I know, there is no easy way to filter according to major mode.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-07-26T06:57:17.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24842" PostTypeId="1" CreationDate="2016-07-26T08:04:54.017" Score="0" ViewCount="170" Body="&lt;p&gt;this is a weird issue regarding &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+&lt;/a&gt;. after an emacs restart the &lt;code&gt;bmkp-jump-dired&lt;/code&gt;/&lt;code&gt;bmkp-jump-1&lt;/code&gt; functions wont work (when I launch them via a command such as in a hydra) before visiting the buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what i see in my message buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loaded /home/zeltak/.emacs.d/settings.el&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;Invalid face reference: quote [24 times]&#xA;bmkp-jump-1: No bookmark specified&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;anyone else has this issues or know what causes this?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2016-07-26T14:45:48.290" LastActivityDate="2017-01-22T18:10:06.470" Title="bookmark+: after emacs restart the bmkp-jump-dired/bmkp-jump wont work before visiting buffers" Tags="|config|bookmarks|hydra|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24843" PostTypeId="2" ParentId="24147" CreationDate="2016-07-26T10:58:25.727" Score="1" Body="&lt;p&gt;For C developers, I suggest ctags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem of GNU Gloal is that it treats the function declaration as reference. That's awkward if you want to check the declaration of function ONLY. C++ code does not have this issue because function is always inside class/struct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;https://github.com/redguardtoo/counsel-etags&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/counsel-etags&lt;/a&gt; which provides everything you need for code navigation using ctags/etags.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2017-10-25T13:19:40.523" LastActivityDate="2017-10-25T13:19:40.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24844" PostTypeId="1" AcceptedAnswerId="24848" CreationDate="2016-07-26T11:13:16.077" Score="4" ViewCount="436" Body="&lt;p&gt;In evil insert state, I can mark a region in the buffer using the mouse. If I now press the &lt;kbd&gt;Delete&lt;/kbd&gt; key (bound to the &lt;code&gt;delete-char&lt;/code&gt; command) it deletes the character at the current cursor position and not the the marked region. This behavior is different from how the delete key works in normal Emacs mode where the region is killed. How can I make evil insert mode work the same way?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="253" LastEditDate="2016-07-26T15:20:16.303" LastActivityDate="2016-07-27T14:56:31.177" Title="Make delete key also delete region in evil insert mode" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24845" PostTypeId="1" AcceptedAnswerId="24891" CreationDate="2016-07-26T12:41:18.477" Score="0" ViewCount="329" Body="&lt;p&gt;Here is the Org-mode buffer example which has a properties drawer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Kelvin Hu&#xA;  :PROPERTIES:&#xA;  :BLOG:     http://kelvinh.github.io/&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-07-28T02:57:02.067" Title="How to make org-mode support to open org-mode link in properties drawer?" Tags="|org-mode|org-link|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24846" PostTypeId="2" ParentId="24826" CreationDate="2016-07-26T14:04:46.140" Score="4" Body="&lt;p&gt;Few themes work well with emacs run within a terminal because you are dealing with a much smaller color palette.  Unless you have enabled 256 colors in your terminal, you are likely working with just 8 colors when you fire up emacs in a terminal.  An easy way around this issue is to conditionally load your color theme selections only when you are working with the gui version of emacs.  The &lt;code&gt;window-system&lt;/code&gt; variable contains the info you want, however use of that variable in situations such as this is deprecated in favor of the function &lt;code&gt;display-graphic-p&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In your &lt;code&gt;.emacs&lt;/code&gt; file try guarding your color theme initialization using something like the following:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(when (display-graphic-p)&#xA;  ; color theme initialization code goes here&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;display-graphic-p&lt;/code&gt; returns non-nil if the current display is a graphic display, and it returns nil if it is a terminal. See the docs if you are interested: &lt;code&gt;C-h f display-graphic-p&lt;/code&gt;.  For more info on &lt;code&gt;window-system&lt;/code&gt; variable: &lt;code&gt;C-h v window-system&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Doing this will cause the default color theme to be loaded when you start Emacs in a terminal.  While not very pretty, it works with 8 and 256 colors.&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11635" LastEditDate="2023-03-02T20:07:11.183" LastActivityDate="2023-03-02T20:07:11.183" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="24847" PostTypeId="2" ParentId="24842" CreationDate="2016-07-26T14:44:00.290" Score="1" Body="&lt;p&gt;Do they work without using your hydra? If so, the hydra is likely where your problem is. Please try to provide a step-by-step recipe to reproduce the problem, starting with &lt;code&gt;emacs -Q&lt;/code&gt;, using a simple bookmark file (even with just one bookmark), and saying what you expect to see at each step and what you do see instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error raised from &lt;code&gt;bmkp-jump-1&lt;/code&gt; says that it was not given a bookmark to jump to. That suggests that the code invoking it (or invoking a &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+&lt;/a&gt; function that calls it) might be to blame - perhaps your hydra.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the first error message (from where?), which is repeated 24 times (!) suggests that some code (that expected a face) was instead passed a &lt;em&gt;quoted&lt;/em&gt; face symbol instead of a face symbol (after evaluation). This suggests that the quoted face symbol was either inside a list (e.g. &lt;code&gt;(some list 'my-face)&lt;/code&gt;) or that it was used in a macro call (macros do not evaluate their arguments). (Does your hydra perhaps have 24 heads?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please &lt;em&gt;show some code&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-26T14:44:00.290" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24848" PostTypeId="2" ParentId="24844" CreationDate="2016-07-26T15:20:23.147" Score="3" Body="&lt;p&gt;If I understand correctly, you're asking about the behavior of&#xA;&lt;kbd&gt;DELETE&lt;/kbd&gt; when the region is active, or, as far as &lt;code&gt;evil&lt;/code&gt;&#xA;is concerned, when you're in &lt;code&gt;evil&lt;/code&gt;'s &lt;code&gt;visual&lt;/code&gt; state.  It should&#xA;be enough to rebind the key in that map:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-visual-state-map [delete] #'delete-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Update: as @HakonHaegland's comment indicates, it's not exactly clear what's going on with the different states.  However, using the following keybinding seems to resolve the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map [delete] #'evil-delete-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="260" LastEditDate="2016-07-27T14:56:31.177" LastActivityDate="2016-07-27T14:56:31.177" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24849" PostTypeId="2" ParentId="14763" CreationDate="2016-07-26T16:40:08.610" Score="0" Body="&lt;p&gt;I've run into this problem with: &lt;code&gt;GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.5.0, NS appkit-1404.47 Version 10.11.5 (Build 15F34)) of 2016-07-26&lt;/code&gt; and &lt;code&gt;Org-mode version 8.3.5 (8.3.5-elpa)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to get around it by removing any of my &quot;titles&quot; or any line it complained about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance removing this block, i was able to export to both &lt;code&gt;ox-reveal&lt;/code&gt; and &lt;code&gt;ox-twbs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE:  My Emacs Configuration&#xA;#+AUTHOR: JJ Asghar&#xA;#+EMAIL:  jjasghar@email.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="86" LastActivityDate="2016-07-26T16:40:08.610" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24850" PostTypeId="1" AcceptedAnswerId="24851" CreationDate="2016-07-26T17:19:29.067" Score="0" ViewCount="191" Body="&lt;p&gt;Is there a key binding that moves the cursor to the last character in a buffer? I'm asking because I often find myself at a point other than the last character, where I want to be, in the interactive-shell.&lt;/p&gt;&#xA;" OwnerUserId="12757" LastActivityDate="2016-07-26T18:04:49.230" Title="Is there a key-binding to move the cursor to the last character in the buffer" Tags="|key-bindings|shell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24851" PostTypeId="2" ParentId="24850" CreationDate="2016-07-26T18:04:49.230" Score="5" Body="&lt;p&gt;&lt;code&gt;C-end&lt;/code&gt; (and &lt;code&gt;M-&amp;gt;&lt;/code&gt; and another in default) runs command &lt;code&gt;end-of-buffer&lt;/code&gt; (into &lt;code&gt;simple.el&lt;/code&gt;), which moves cursor to the end of the buffer.  With numeric argument, for example, &lt;code&gt;C-u 4 C-end&lt;/code&gt;, moves point to 4/10 from the end of the accessable part.  With narrowed buffer moves point into the narrowed path of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could find all the keybindings for function with &lt;code&gt;C-h f end-of-buffer RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-07-26T18:04:49.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24852" PostTypeId="2" ParentId="22587" CreationDate="2016-07-26T19:33:26.163" Score="1" Body="&lt;p&gt;Lets start with conversion one line with this function&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun wrap-line (before after)&#xA;  &quot;Convert line at the point adding BEFORE and AFTER.&quot;&#xA;  (save-excursion&#xA;    (progn&#xA;      (goto-char (line-beginning-position))&#xA;      (insert before)&#xA;      (goto-char (line-end-position))&#xA;      (insert after))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could wrap line into &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;/li&amp;gt;&lt;/code&gt; with function&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun wrap-into-li ()&#xA;  (interactive)&#xA;  (wrap-line &quot;&amp;lt;li&amp;gt;&quot; &quot;&amp;lt;/li&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function do the same that @Jules macros in another answer. And you could set key for this with, for example&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c w l&quot;) 'wrap-into-li)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could convert block from &lt;code&gt;start&lt;/code&gt; till &lt;code&gt;end&lt;/code&gt; with markers of block and each line with function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun wrap-block (start end before-block after-block before-line after-line)&#xA;  &quot;Wrap each line and whole block.&#xA;   Wrap block from START till END with BEFORE-BLOCK and AFTER-BLOCK&#xA;   and wrap each line inside with BEFORE-LINE and AFTER-LINE.&quot;&#xA;  (save-excursion&#xA;    (goto-char start)&#xA;    (goto-char (line-beginning-position))&#xA;    (insert before-block) (newline)&#xA;    (while (&amp;lt;= (point) end)&#xA;      (wrap-line before-line after-line)&#xA;      (forward-line 1))&#xA;    (insert after-block) (newline)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you could use this function on region and make block &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; (marked) with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun make-region-ul (start end)&#xA;  (interactive &quot;r&quot;)&#xA;  (wrap-block start end &quot;&amp;lt;ul&amp;gt;&quot; &quot;&amp;lt;/ul&amp;gt;&quot; &quot;&amp;lt;li&amp;gt;&quot; &quot;&amp;lt;/li&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or make block &lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt; (numbered) with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun make-region-ol (start end)&#xA;  (interactive &quot;r&quot;)&#xA;  (wrap-block start end &quot;&amp;lt;ol&amp;gt;&quot; &quot;&amp;lt;/ol&amp;gt;&quot; &quot;&amp;lt;li&amp;gt;&quot; &quot;&amp;lt;/li&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bound this functions to keys:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c w u&quot;) 'make-region-ul)&#xA;(global-set-key (kbd &quot;C-c w o&quot;) 'make-region-ol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-07-28T05:40:21.097" LastActivityDate="2016-07-28T05:40:21.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24855" PostTypeId="1" AcceptedAnswerId="34384" CreationDate="2016-07-26T22:06:57.203" Score="6" ViewCount="1307" Body="&lt;p&gt;I am trying to parse a string with the json.el package, though when the string is not json unexpected things happen. Is there a way in elisp to check whether or not a provided string is actually a valid json before trying to parse it with &lt;code&gt;json-read-from-string&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="105" LastEditDate="2016-07-27T00:17:37.380" LastActivityDate="2017-07-25T00:05:51.660" Title="Is there a way to check whether or not a string is valid json?" Tags="|json|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24856" PostTypeId="2" ParentId="24722" CreationDate="2016-07-26T22:54:22.727" Score="2" Body="&lt;p&gt;Pretty sure you can do something like this by making your file name &quot;magic&quot;.  See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Magic-File-Names.html&quot; rel=&quot;nofollow&quot;&gt;this part of the elisp reference manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="786" LastActivityDate="2016-07-26T22:54:22.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24857" PostTypeId="1" AcceptedAnswerId="24858" CreationDate="2016-07-26T23:29:00.380" Score="7" ViewCount="1070" Body="&lt;p&gt;When using recentf with tramp, recentf would clean up its file list including all remote files, which takes a lot of time when the Internet is bad. How can I ask recentf to not cleanup remote files, without disabling recent file list auto cleanup for local files?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2019-07-16T15:26:06.520" Title="Disable remote file cleanup in recentf?" Tags="|tramp|recentf|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24858" PostTypeId="2" ParentId="24857" CreationDate="2016-07-27T00:17:16.427" Score="7" Body="&lt;p&gt;&lt;code&gt;M-x customize-option RET recentf-keep RET&lt;/code&gt;, and be sure to read its description. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use any arbitrary or conditional expression. And that includes &lt;code&gt;file-remote-p&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2019-07-16T15:26:06.520" LastActivityDate="2019-07-16T15:26:06.520" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="24859" PostTypeId="1" CreationDate="2016-07-27T02:08:39.213" Score="6" ViewCount="200" Body="&lt;p&gt;I've found that using the &lt;code&gt;highlight-symbol-mode&lt;/code&gt; provided by &lt;a href=&quot;https://github.com/nschum/highlight-symbol.el&quot; rel=&quot;noreferrer&quot;&gt;highlight-symbol&lt;/a&gt; works very nicely for highlighting all occurrences of the symbol at point, &lt;strong&gt;automatically&lt;/strong&gt; (without my pressing anything). However, I would like to highlight all &lt;strong&gt;other&lt;/strong&gt; occurrences of the symbol at point: that is, the actual symbol point is on should &lt;strong&gt;not&lt;/strong&gt; be highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't find anything in &lt;code&gt;customize-group highlight-symbol&lt;/code&gt; or in &lt;a href=&quot;https://github.com/nschum/highlight-symbol.el/blob/master/highlight-symbol.el&quot; rel=&quot;noreferrer&quot;&gt;highlight-symbol.el&lt;/a&gt; for this. Through Google, I haven't found any reference to other packages that support the functionality I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get automatic highlighting of all &lt;strong&gt;other&lt;/strong&gt; occurrences of the symbol at point?&lt;/p&gt;&#xA;" OwnerUserId="12534" LastActivityDate="2021-09-27T04:23:42.233" Title="Highlight *other* occurrences of symbol" Tags="|highlighting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24861" PostTypeId="1" CreationDate="2016-07-27T07:27:54.690" Score="0" ViewCount="303" Body="&lt;p&gt;I realize that &lt;code&gt;flycheck&lt;/code&gt; is a syntax checker that can be used with nearly every language's major mode.  My question is how (if at all) it can interact with modes such as (specifically) &lt;code&gt;js2-mode&lt;/code&gt; which offer &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;on-the-fly reporting of syntax errors and strict-mode warnings`.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/8305/js2-mode-with-flycheck-and-jshint&quot;&gt;This question&lt;/a&gt; answers how they are different but I am wondering if it&#xA;is better to just pick one mode or can they work together somehow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize this could be opinion based so I am wondering &lt;em&gt;If someone has an example of them working together&lt;/em&gt; how does it work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-27T19:07:20.947" Title="Does Flycheck interfere with JS-2 Mode?" Tags="|flycheck|js2-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24862" PostTypeId="2" ParentId="24861" CreationDate="2016-07-27T08:23:58.523" Score="3" Body="&lt;p&gt;Flycheck can use many &lt;a href=&quot;http://www.flycheck.org/en/latest/languages.html#javascript&quot; rel=&quot;nofollow&quot;&gt;different Javascript linters&lt;/a&gt;, including but not limited to eslint, which report far more issues that just syntax errors and strict-mode issues.  For instance eslint can warn you about useless &lt;code&gt;super()&lt;/code&gt; calls in ES6 constructors, and help you enforce the use of &lt;code&gt;const&lt;/code&gt; in ES6 code, or warn about using &lt;code&gt;var&lt;/code&gt; instead of &lt;code&gt;let&lt;/code&gt; in ES6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can use Flycheck you should do so and disable the built-in checking of JS2 Mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: I'm a Flycheck maintainer and thus probably biased.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-07-27T08:23:58.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24863" PostTypeId="2" ParentId="24722" CreationDate="2016-07-27T08:51:43.610" Score="1" Body="&lt;p&gt;I use a package called &lt;code&gt;vorbiscomment&lt;/code&gt;, which I now can't find at the URL in its header comment, and which doesn't appear in *ELPA or on EmacsWiki. Here's that non-functioning URL: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://users-phys.au.dk/harder/&quot; rel=&quot;nofollow&quot;&gt;http://users-phys.au.dk/harder/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, it lets you edit the tag metadata for (binary) OGG Vorbis audio files, which sounds conceptually similar to what you want. It's really just a simple wrapper around command-line tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've copied it to the following gist: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/PhilHudson/4fc8f38a5dc2b39f256feddb0014041c&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/PhilHudson/4fc8f38a5dc2b39f256feddb0014041c&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-07-27T08:51:43.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24864" PostTypeId="2" ParentId="24824" CreationDate="2016-07-27T10:07:53.190" Score="0" Body="&lt;p&gt;&lt;code&gt;org-indent-mode&lt;/code&gt; adds the &lt;code&gt;line-prefix&lt;/code&gt; and &lt;code&gt;wrap-prefix&lt;/code&gt; special text properties. I'm not sure it's worth the hassle, but if you want to align your org buffer the desired way once, this may be for you:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion&#xA;  (goto-char (point-min))&#xA;  (while (not (eobp))&#xA;    (let ((ind (make-string&#xA;                (- 4 (if (org-at-heading-p)&#xA;                         (org-current-level)&#xA;                       -1))&#xA;                ?\s)))&#xA;      (add-text-properties (point-at-bol) (point-at-eol)&#xA;                           `(line-prefix ,ind wrap-prefix ,ind)))&#xA;    (forward-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously you should deactivate &lt;code&gt;org-indent-mode&lt;/code&gt; before.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-07-27T10:07:53.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24865" PostTypeId="1" CreationDate="2016-07-27T14:59:34.373" Score="3" ViewCount="494" Body="&lt;p&gt;I am trying to write code snippets inside org-mode and I am not able to get the same effect from web-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I write the code in a css file completely I get this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/nRb5I.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I write the same code inside of org-mode and put the major mode as web, I get the following: &#xA;&lt;img src=&quot;https://i.stack.imgur.com/E2gdj.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this such that I get the same properties of web-mode inside of org-mode as well?&lt;/p&gt;&#xA;" OwnerUserId="12770" LastActivityDate="2016-09-25T13:24:48.710" Title="web-mode not working inside of org-mode src block" Tags="|org-mode|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24866" PostTypeId="1" AcceptedAnswerId="24867" CreationDate="2016-07-27T16:07:01.113" Score="6" ViewCount="418" Body="&lt;p&gt;I'm confused by the interpretation of &lt;code&gt;'&lt;/code&gt; in the context of lists of symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I'd like to check whether a buffer is in one a list of modes, and I'll use the scratch buffer as my example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;*scratch*&quot; major-mode) ;; lisp-interaction-mode&#xA;(equal (with-current-buffer &quot;*scratch*&quot; major-mode) 'lisp-interaction-mode) ;; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far so good.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(member (with-current-buffer &quot;*scratch*&quot; major-mode)&#xA;        '('lisp-interaction-mode) ;; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Huh? Trying to simplify this, I ended up with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(member 1 '( 1)) ;; (1) - okay, my list syntax seems correct&#xA;(member '1 '( '1)) ;; nil - Why doesn't this work? I think this is the issue&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how can I make a list of symbols, and then check whether a symbol is in there?&lt;/p&gt;&#xA;" OwnerUserId="503" LastEditorUserId="105" LastEditDate="2016-07-27T23:28:00.993" LastActivityDate="2016-07-27T23:28:00.993" Title="Does a list contain this symbol?" Tags="|quote|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24867" PostTypeId="2" ParentId="24866" CreationDate="2016-07-27T16:22:10.570" Score="11" Body="&lt;p&gt;Short version: remove the inner quote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you quote a list, it leaves the list's contents unevaluated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(a-symbol &quot;a string&quot; (+ 1 1)) =&amp;gt; (a-symbol &quot;a string&quot; (+ 1 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So: if the list includes symbols, a quoted list will return a&#xA;list of symbols.  Here's the rub: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html&quot;&gt;because quoting is so common,&#xA;there's a special reader syntax for&#xA;it&lt;/a&gt;: &lt;code&gt;'&lt;/code&gt;.  So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'kittens        =&amp;gt; kittens&#xA;(quote kittens) =&amp;gt; kittens&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, when you quote a list that includes a quoted symbol, what&#xA;you're actually producing is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'('kittens) =&amp;gt; ((quote kittens))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when what you really want is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(kittens)  =&amp;gt; kittens&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So your comparison looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(memq 'kittens '(puppies kittens otters))    =&amp;gt; (kittens otters)&#xA;(memq 'kittens '('puppies 'kittens 'otters)) =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-07-27T17:17:46.283" LastActivityDate="2016-07-27T17:17:46.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24868" PostTypeId="2" ParentId="24865" CreationDate="2016-07-27T16:42:34.677" Score="2" Body="&lt;p&gt;Use either css mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+BEGIN_SRC css&#xA;.inputField {&#xA;   color: #525252;&#xA;}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and add color fontification by using code found &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_CSS_colors.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or inline the css in web:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+BEGIN_SRC web&#xA;&amp;lt;style&amp;gt;&#xA;.inputField {&#xA;   color: #525252;&#xA;}&#xA;&amp;lt;/style&amp;gt;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; after comment from @predicate and @Dan:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, I see. The problem is, that &lt;code&gt;web-mode&lt;/code&gt; detects css based on file extension, which does not work for source blocks. As a workaround you could define a minimal helper mode for each language you use. You would have to call &lt;code&gt;web-mode&lt;/code&gt; to initialize web mode and then change the type by setting buffer local variable &lt;code&gt;web-mode-content-type&lt;/code&gt; to &lt;code&gt;&quot;css&quot;&lt;/code&gt;, &lt;code&gt;&quot;javascript&quot;&lt;/code&gt;, &lt;code&gt;&quot;json&quot;&lt;/code&gt; or &lt;code&gt;&quot;jsx&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here an example for a web-css-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-derived-mode web-css-mode web-mode &quot;WebCss&quot;&#xA;  &quot;Major mode for editing web css templates.&quot;&#xA;  (web-mode)&#xA;  (setq web-mode-content-type &quot;css&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And its usage in org-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+BEGIN_SRC web-css&#xA;.inputField {&#xA;   color: #525252;&#xA;   color: #dfdfdf;&#xA;   color: #FFCC02;&#xA;   color: #FFE477;&#xA;}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did not try it, but you might also be able to define another engine by inserting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;/* -*- engine:php -*- */&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(replacing php with the engine you want, see variable &lt;code&gt;web-mode-engines&lt;/code&gt; or topic &quot;Associate an engine&quot; &lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) in your buffer.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-26T13:16:57.210" LastActivityDate="2016-08-26T13:16:57.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24870" PostTypeId="1" AcceptedAnswerId="24874" CreationDate="2016-07-27T18:03:15.910" Score="3" ViewCount="382" Body="&lt;p&gt;When I got a snippet with a few parameters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;img src=&quot;http://lorempixel.com/${1:width}/${2:height}/${3:$$(yas-choose-value '(&quot;abstract&quot; &quot;city&quot; &quot;animals&quot; &quot;food&quot; &quot;people&quot; &quot;transport&quot; &quot;business&quot; &quot;sports&quot; &quot;technics&quot;))}/${4:text}&quot; alt=&quot;$3&quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can cycle forward pressing tab, but if I change my mind and want to modify a previous parameter the only way is leaving the cycle and go back by hand. Am I missing something or there's a key binding to go back?.&lt;/p&gt;&#xA;" OwnerUserId="7006" LastActivityDate="2016-07-27T18:43:18.377" Title="How to cycle back through parameters on a yasnippet?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24871" PostTypeId="2" ParentId="24781" CreationDate="2016-07-27T18:03:58.117" Score="1" Body="&lt;p&gt;This might do what you want: store your 'snippeds' in a &lt;code&gt;.tex&lt;/code&gt; file, and use use AucTex's auto-complete to look them up for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g., main.tex:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;\documentclass{article}&lt;br&gt;&#xA;  \include{snippeds}  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;\begin{document}  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;``\mysnippedA'' is a macro. I have a second macro: \mysnippedB. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;\end{document}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;snippeds.tex:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;\newcommand{\mysnippedA}{&lt;br&gt;&#xA;  Snipped Text&lt;br&gt;&#xA;  }  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;\newcommand{\mysnippedB}{&lt;br&gt;&#xA;  More snipped text!&lt;br&gt;&#xA;  }&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You need to set a few variables to get the files parsed (i.e., so AucTex knows which macros to complete):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq TeX-parse-self t) ; Enable parse on load.&#xA; (setq TeX-auto-save t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can call &lt;code&gt;C-c C-n&lt;/code&gt; to manually reparse the files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once that's done, &lt;code&gt;C-c C-m&lt;/code&gt; or &lt;code&gt;C-c RETURN&lt;/code&gt;, (&lt;code&gt;TeX-insert-macro&lt;/code&gt;) will prompt you for macro name completions, which now include your custom definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details in the AucTex Manual: &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Completion.html#Completion&quot; rel=&quot;nofollow&quot;&gt;(auctex) Completion&lt;/a&gt;, &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Parsing-Files.html#Parsing-Files&quot; rel=&quot;nofollow&quot;&gt;(auctex) Parsing Files&lt;/a&gt;, &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-27T18:03:58.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24873" PostTypeId="1" AcceptedAnswerId="24880" CreationDate="2016-07-27T18:27:22.823" Score="2" ViewCount="566" Body="&lt;p&gt;Is there a hook to execute stuff after I've run &lt;code&gt;emacs --daemon&lt;/code&gt;? I'd like to keep load stuff &lt;strong&gt;only&lt;/strong&gt; when running &lt;code&gt;emacs --daemon&lt;/code&gt; and &lt;strong&gt;not&lt;/strong&gt; when running &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it sounds like using square wheels, but I do have my reasons.&lt;/p&gt;&#xA;" OwnerUserId="10785" LastEditorUserId="105" LastEditDate="2016-07-27T23:26:53.313" LastActivityDate="2016-07-27T23:26:53.313" Title="`server-start` hook?" Tags="|hooks|emacsclient|server|emacs-daemon|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24874" PostTypeId="2" ParentId="24870" CreationDate="2016-07-27T18:43:18.377" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Am I missing something or there's a key binding to go back?.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;S-&amp;lt;tab&amp;gt;&lt;/kbd&gt; should be bound to &lt;code&gt;yas-prev-field&lt;/code&gt; (in &lt;code&gt;yas-keymap&lt;/code&gt;) which takes you back.  Note that it had a bug until recently, where it always went back to the 1st field.  &lt;a href=&quot;https://github.com/joaotavora/yasnippet/issues/722&quot; rel=&quot;nofollow&quot;&gt;https://github.com/joaotavora/yasnippet/issues/722&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-07-27T18:43:18.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24875" PostTypeId="2" ParentId="7429" CreationDate="2016-07-27T18:45:44.033" Score="2" Body="&lt;p&gt;A much simpler solution: in org mode, press &lt;code&gt;M-:&lt;/code&gt; and run the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords &#xA; nil &#xA; '((&quot;^[[:space:]*]+&quot; 0 '(face (:family &quot;Ubuntu Mono&quot;)) append))&#xA; 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may need &lt;code&gt;M-x font-lock-fontify-buffer&lt;/code&gt; after that.  This solution simply forces leading characters (spaces and stars) to use a monospace font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you'll want to replace &quot;Ubuntu Mono&quot; with a monospace font of your choosing,&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2018-03-26T14:20:59.573" LastActivityDate="2018-03-26T14:20:59.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24876" PostTypeId="2" ParentId="22755" CreationDate="2016-07-27T18:55:13.940" Score="8" Body="&lt;p&gt;The most common way to quickly add spaces between paragraphs in LaTeX is to use the &lt;a href=&quot;http://ctan.org/pkg/parskip&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;parskip&lt;/code&gt; package &lt;/a&gt;. You can tell org-mode to include that in the LaTeX header by adding the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage{parskip}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the document preamble at the top of your org-mode file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Including the &lt;code&gt;parskip&lt;/code&gt; package automatically adds separation between paragraphs and removes indentation.  If you want the separation and still want paragraphs to be indented, you can set the &lt;code&gt;parindent&lt;/code&gt; length back to the default by also adding the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \setlength{\parindent}{15pt}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Changing the &lt;code&gt;parskip&lt;/code&gt; length directly messes up other things like spacing between list items.  See &lt;a href=&quot;https://tex.stackexchange.com/questions/14764/too-much-whitespace-before-lists-when-changing-the-parskip-length&quot;&gt;this TeX.SX question&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="8968" LastActivityDate="2016-07-27T18:55:13.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24877" PostTypeId="1" CreationDate="2016-07-27T19:57:08.283" Score="3" ViewCount="1031" Body="&lt;p&gt;How do I create a deck.js or reveal.js presentation in org-mode that has the following formatting:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a figure inlined into running text, that is, not on a separate line,&lt;/li&gt;&#xA;&lt;li&gt;two columns of material, usually with one column of text and the other being a figure.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've done considerable searching w/o finding any answers.  These are possible with beamer, but IMO it doesn't look as good.   Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also is there any reason to prefer between deck and reveal?   I'm writing scientific presentations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My system:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;uname -a&lt;br&gt;&#xA;Linux w540 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs-version is a variable defined in `C source code'.&#xA;Its value is &quot;24.5.1&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-version is a variable defined in `org.el'.&#xA;Its value is &quot;8.3.5&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ox-reveal          20160719.28&lt;/p&gt;&#xA;" OwnerUserId="12775" LastActivityDate="2018-05-30T01:57:54.063" Title="org-mode deck.js or reveal.js: inline figure and 2 column" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24878" PostTypeId="1" AcceptedAnswerId="24881" CreationDate="2016-07-27T20:36:51.050" Score="0" ViewCount="137" Body="&lt;p&gt;I have a warning when I start Emacs.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/OSd3L.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OSd3L.png&quot; alt=&quot;Warning when starting Emacs&quot;&gt;&lt;/a&gt;&#xA;No problem, just start it with --debug-init.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/mNS9q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mNS9q.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;What!! No warning anymore, and it actually opens &lt;em&gt;scratch&lt;/em&gt; instead of Emacs standard spash screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;--debug-init&lt;/code&gt; removes the warning and gives me the correct behavior, but without it I get a warning and ... Well, not the desired behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running emacs 25.1.RC1, same problem with 25.1.50. I have not tested with 24.X.X but I am about to do that now.&#xA;Emacs is homebuild on a mac osx 10.11.5 El Capitan with &lt;code&gt;--with-cocoa --with-gnutls --with-rsvg --with-imagemagick --with-ns&lt;/code&gt;. Any recommendations? &lt;/p&gt;&#xA;" OwnerUserId="9747" LastEditorUserId="253" LastEditDate="2016-07-27T20:56:58.767" LastActivityDate="2016-07-27T21:21:53.153" Title="--debug-init changes emacs behaviour" Tags="|warning|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24879" PostTypeId="1" AcceptedAnswerId="24884" CreationDate="2016-07-27T20:50:46.347" Score="27" ViewCount="2463" Body="&lt;p&gt;I'm wondering if there is a magit equivalent to &lt;code&gt;git remote -v&lt;/code&gt; to list remotes and their URL's defined on a git repository.  The magit remotes popup offers options to add, remove, rename, and set url, but I don't see any sort of listing mechanism.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample &lt;code&gt;git remote -v&lt;/code&gt; output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;origin  ebpa@example.com:/var/git/myproject.git (fetch)&#xA;origin  ebpa@example.com:/var/git/myproject.git (push)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;magit-list-remotes&lt;/code&gt; is non-interactive and only lists remote names.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-07-27T21:59:45.367" Title="Magit equivalent for &quot;git remote -v&quot; (list remotes)" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24880" PostTypeId="2" ParentId="24873" CreationDate="2016-07-27T20:59:41.437" Score="4" Body="&lt;p&gt;You can wrap the relevant portions of you init file in a conditional&#xA;on &lt;code&gt;(daemonp)&lt;/code&gt;, whose docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return non-&lt;code&gt;nil&lt;/code&gt; if the current emacs process is a daemon.&#xA;  If the daemon was given a name argument, return that name.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (daemonp)&#xA;  (do-server-only-stuff-here))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-27T20:59:41.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24881" PostTypeId="2" ParentId="24878" CreationDate="2016-07-27T21:21:53.153" Score="5" Body="&lt;p&gt;Visit your &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; file and do &lt;code&gt;M-x check-parens RET&lt;/code&gt;.  It should show you the unclosed open paren in that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;--debug-init&lt;/code&gt;, I guess you could &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; indicating that it did not help debug the problem.  I think that is because of &lt;code&gt;debug-ignored-errors&lt;/code&gt; which should probably be bound to &lt;code&gt;nil&lt;/code&gt; during initialization.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-27T21:21:53.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24882" PostTypeId="2" ParentId="24713" CreationDate="2016-07-27T21:29:42.073" Score="0" Body="&lt;p&gt;Assuming you want to modify the &lt;code&gt;flycheck-error&lt;/code&gt; face, and assuming you are using the Customize interface to do it, then note the &quot;Show All Attributes&quot; link just below the &quot;Color&quot; and &quot;Style&quot; settings. Clicking that will allow you to set any attributes you want, like maybe a different background color. The extra attributes won't enable you to thicken the underline specifically, though; I'm sorry, but I have no idea how that might be achieved. Hope this helps somewhat anyway.&lt;/p&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-07-27T21:29:42.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24883" PostTypeId="2" ParentId="20264" CreationDate="2016-07-27T21:40:47.783" Score="1" Body="&lt;p&gt;You could start with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst foo-smie-grammar&#xA;    (smie-prec2-&amp;gt;grammar&#xA;     (smie-bnf-&amp;gt;prec2&#xA;      '((exp (&quot;begin&quot; insts &quot;end&quot;))&#xA;        (insts (exp) (insts &quot;;&quot; insts))))))&#xA;&#xA;  ...&#xA;  (smie-setup foo-smie-grammar #'ignore)&#xA;  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-07-27T21:40:47.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24884" PostTypeId="2" ParentId="24879" CreationDate="2016-07-27T21:59:45.367" Score="29" Body="&lt;p&gt;The buffer generated by &lt;code&gt;magit-show-refs-popup&lt;/code&gt; (&lt;kbd&gt;y&lt;/kbd&gt;) will&#xA;give output that includes something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Origin (ebpa@example.com:/var/git/myproject.git) (2)&#xA;  origin/HEAD               -&amp;gt; origin/master&#xA;  origin/master             Commit message&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is working with the output of &lt;code&gt;git branch -vvr&lt;/code&gt; rather than&#xA;&lt;code&gt;git remote -v&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2016-07-27T21:59:45.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24885" PostTypeId="1" AcceptedAnswerId="24917" CreationDate="2016-07-27T22:41:35.833" Score="2" ViewCount="235" Body="&lt;p&gt;I have a bibtex file, and would like to have indentation as follows.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@book{moon70:trees,&#xA;       AUTHOR = {John W. Moon}, &#xA;        TITLE = {Counting labelled trees},&#xA;         YEAR = 1970,&#xA;       SERIES = {Canadian Mathematical Monographs},&#xA;       NUMBER = 1,&#xA;    PUBLISHER = {Canadian Mathematical Congress}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am thinking of creating a &lt;code&gt;indent-bibtex-entry&lt;/code&gt; command, &#xA;but I am stuck in steps 4 and 5.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Save current position, jump to the previous ocurrence of the&#xA;regular expression &lt;code&gt;^[ \t]*@&lt;/code&gt;, then to the next &lt;code&gt;{&lt;/code&gt; and then to the&#xA;next &lt;code&gt;,&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;While next nonblank is not &lt;code&gt;}&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Capture the next field with the regular expression &lt;code&gt;[ \t\n]*\([^ \t=]+\)=&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Replace by &lt;code&gt;\n \1 =&lt;/code&gt; where the number of spaces must make the&#xA;total length of this expression equal to, say, 15.&lt;/li&gt;&#xA;&lt;li&gt;Capture the entry's content (see caveats below), removing&#xA;line-breaks and spaces before and after.&lt;/li&gt;&#xA;&lt;li&gt;Goto 2.&lt;/li&gt;&#xA;&lt;li&gt;Restore cursor's position.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Caveats&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The content of an entry is somewhat tex-aware. &#xA;The entries are text between quotes &lt;code&gt;&quot;like this&quot;&lt;/code&gt;&#xA;or between matching braces &lt;code&gt;{like this}&lt;/code&gt;.&#xA;&lt;strong&gt;However&lt;/strong&gt;, you may have braces (as long as they're balanced)&#xA;inside, and escaped quotes as well &lt;code&gt;{na\&quot;ive {example}}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Simplier, but also nice&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that is too difficult, an alternative is to define a command&#xA;&lt;code&gt;indent-field&lt;/code&gt;, assuming that the line contains a single field.&#xA;The problem is similar to the previous step 4 (but here it is step 3).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Save current position, jump to the beginning of the line.&lt;/li&gt;&#xA;&lt;li&gt;Capture the next field with the regular expression &lt;code&gt;[ \t\n]*\([^ \t=]+\)=[ \t\n*]*&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Replace by &lt;code&gt;\n \1 =&lt;/code&gt; where the number of spaces must make the&#xA;total length of this expression equal to, say, 15.&lt;/li&gt;&#xA;&lt;li&gt;Restore cursor's position.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? I am still working on the code for the items I &quot;know&quot; how to do.&#xA;This is my first time with elisp.&lt;/p&gt;&#xA;" OwnerUserId="8331" LastEditorUserId="105" LastEditDate="2016-07-27T23:25:03.460" LastActivityDate="2016-10-27T08:16:28.677" Title="align (indent) in bibtex file" Tags="|regular-expressions|align|bibtex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24886" PostTypeId="1" CreationDate="2016-07-28T00:05:40.067" Score="2" ViewCount="1199" Body="&lt;p&gt;I love emacs and its modes but sometimes I do not agree with its indentation.  In this specific case I am talking about &lt;code&gt;glsl-mode&lt;/code&gt; . When I type an array inside a function, I want the square brackes to be indented past the curly braces. Like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void main () {&#xA;    vec4 thing = [&#xA;     1, 2, 3, 4;&#xA;    ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I get by default is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void main () {&#xA;    vec4 thing = [&#xA;     1, 2, 3, 4;&#xA;] // I do not want this&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I am wondering if there is a simple way to fix this.  Can someone explain to me a possible solution?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="253" LastEditDate="2016-07-28T00:19:46.660" LastActivityDate="2016-12-25T15:10:14.147" Title="How to fix indentation that I do not like?" Tags="|indentation|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24887" PostTypeId="2" ParentId="18484" CreationDate="2016-07-28T00:49:27.810" Score="0" Body="&lt;p&gt;@Gordon Yuan Gao is correct. The [2.2.3] is your ruby version. Most likely from this package &lt;a href=&quot;https://github.com/senny/rbenv.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/senny/rbenv.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using this package then M-x and type global-rbenv-mode to toggle it on and off. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To permanently this off, add the following to your .emacs file:&#xA;(global-rbenv-mode -1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This worked for me. &lt;/p&gt;&#xA;" OwnerUserId="12780" LastActivityDate="2016-07-28T00:49:27.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24888" PostTypeId="2" ParentId="24590" CreationDate="2016-07-28T01:22:46.277" Score="1" Body="&lt;p&gt;It seems that your package archive metadata is corrupted.&#xA;Try renaming your .emacs.d temporally and re-run with your init.el. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mv ~/.emacs.d ~/.emacs.d-tmp; emacs -Q -l path/to/init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can setup successfully with your init.el pasted above (replacing last defvar with package-install).&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-07-28T01:22:46.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24889" PostTypeId="1" AcceptedAnswerId="24990" CreationDate="2016-07-28T02:07:13.597" Score="2" ViewCount="319" Body="&lt;p&gt;I'm trying to use the package siunitx to format my scientific notations/values more nicely, but I can't get one thing to work, possibly due to my pdf-process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I type in my orgfile something like this: &lt;code&gt;\ang{95;13;14}N&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expecting it to output: &lt;code&gt;95°13'14&quot;&lt;/code&gt;. In stead it outputs &#xA;&lt;code&gt;∠{95;13;14}N.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;code&gt;#+INCLUDE:&lt;/code&gt; this file with my LaTeX settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# page setup&#xA;#+LaTeX_CLASS: article&#xA;#+LaTeX_CLASS_OPTIONS: [a4paper] &#xA;#+LaTeX_CLASS_OPTIONS: [12pt] &#xA;#+LaTeX_CLASS_OPTIONS: [twoside] &#xA;&#xA;# placement of TOC anywhere&#xA;#+LaTeX_HEADER: \usepackage{titletoc}&#xA;&#xA;# mathtools&#xA;#+LaTeX_HEADER: \usepackage{mathtools}&#xA;&#xA;# fix margin&#xA;#+LaTeX_HEADER: \usepackage[innermargin=1.5in,outermargin=1.25in,vmargin=1.25in]{geometry}&#xA;&#xA;# citation style&#xA;#+LaTeX_HEADER: \usepackage[authordate,bibencoding=utf8,strict,backend=biber,url=false,natbib]{biblatex-chicago}&#xA;# (internal) links&#xA;#+LaTeX_HEADER: \hypersetup{colorlinks=true,citecolor=blue,linkcolor=blue,citebordercolor={0 1 0},linktocpage,pdfstartview=FitH,anchorcolor=blue,filecolor=blue,menucolor=blue,urlcolor=blue}&#xA;# don't forget to #+LATEX_HEADER: \addbibresource&#xA;&#xA;# chemical formulae&#xA;#+LaTeX_HEADER: \usepackage[version=4]{mhchem}&#xA;&#xA;# SI units simplified&#xA;#+LaTeX_HEADER: \usepackage{siunitx}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I use this line for my latex-pdf process in &lt;a href=&quot;https://github.com/japhir/ArchConfigs/blob/master/Laptop/myinit.org&quot; rel=&quot;nofollow&quot;&gt;my init file&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-pdf-process&#xA;     '(&quot;latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to resolve this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've opened up the exported .tex file and there I can see the problem:&#xA;org mode has exported &lt;code&gt;\(\angle\)\{65;;\}N&lt;/code&gt;, so it seems like emacs is extending &lt;code&gt;\ang&lt;/code&gt; into &lt;code&gt;\angle&lt;/code&gt;. If I manually edit the tex file and export it works correctly. &#xA;Any idea how to stop it from doing this?&lt;/p&gt;&#xA;" OwnerUserId="9748" LastEditorUserId="9748" LastEditDate="2016-07-29T22:32:06.620" LastActivityDate="2016-08-01T16:33:15.070" Title="Org-mode \ang from siunitx is overruled by the \angle symbol on pdf export" Tags="|org-export|latex|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24891" PostTypeId="2" ParentId="24845" CreationDate="2016-07-28T02:57:02.067" Score="0" Body="&lt;p&gt;After bisect my init files. I found the reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because this option setting which enable latex preview at startup.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt; (setq org-startup-with-latex-preview t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-07-28T02:57:02.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24892" PostTypeId="2" ParentId="24886" CreationDate="2016-07-28T04:01:48.447" Score="0" Body="&lt;p&gt;I don't know the glsl language or have that mode available on this machine for me to examine, but most modes that have indentation like this have variables that control it (often in very fine detail).  So, if you start with &lt;kbd&gt;C-h f glsl-mode&lt;/kbd&gt; it may tell you there.  If not, &lt;kbd&gt;C-h a glsl&lt;/kbd&gt; might reveal something interesting.  Otherwise, you may be forced to follow the link in the help for &lt;code&gt;glsl-mode&lt;/code&gt; to the source, and then just do some scrolling up and down to find all the variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course for individual cases, you can just change it yourself, after all you &lt;em&gt;are&lt;/em&gt; in an editor.  There is one of the &lt;code&gt;C&lt;/code&gt; indentations I don't like, but it's for something I use seldom, so when it happens I just fix it after the fact.&lt;/p&gt;&#xA;" OwnerUserId="11699" LastActivityDate="2016-07-28T04:01:48.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24893" PostTypeId="1" CreationDate="2016-07-28T09:20:19.020" Score="1" ViewCount="257" Body="&lt;p&gt;So, I have a function that sends a URL to bit.ly for shortening and returns the short URL, and a &lt;code&gt;(replace-regexp-in-string)&lt;/code&gt;, which is supposed to grab the URL out of a string to passes it to that function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Funny thing is -- both of these work fine on their own, but when I combine them, I end up with a mess.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun crshd/shorten-url (url)&#xA;  (let* ((bitly-url (format &quot;https://api-ssl.bit.ly/v3/shorten?access_token=%s&amp;amp;format=%s&amp;amp;longUrl=%s&quot;&#xA;                            crshd--bitly-api-key&#xA;                            &quot;txt&quot;&#xA;                            url))&#xA;         (response-buffer (url-retrieve-synchronously bitly-url)))&#xA;    (with-current-buffer response-buffer&#xA;                (buffer-substring (+ url-http-end-of-headers 1) (- (point-max) 1)))))&#xA;&#xA;(replace-regexp-in-string &quot;http.?://[a-z0-9./?&amp;amp;%#-_=]+&quot;&#xA;                          'crshd/shorten-url&#xA;                          &quot;replace http://emacs.stackexchange.com in this string&quot;&#xA;                          nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I end up with &lt;code&gt;&quot;replace http://emachttp://bit.ly/2a1zTGW.stackexchange.com in this string&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, &lt;code&gt;(crshd/shorten-url &quot;http://emacs.stackexchange.com&quot;)&lt;/code&gt; returns &lt;code&gt;&quot;http://bit.ly/2a1zTGW&quot;&lt;/code&gt;, as expected.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun crshd/foo-url (url)&#xA;  &quot;foo&quot;)&#xA;&#xA;(replace-regexp-in-string &quot;http.?://[a-z0-9./?&amp;amp;%#-_=]+&quot;&#xA;                          'crshd/foo-url&#xA;                          &quot;replace http://emacs.stackexchange.com in this string&quot;&#xA;                          nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also returns &lt;code&gt;&quot;replace foo in this string&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing here?&lt;/p&gt;&#xA;" OwnerUserId="11875" LastActivityDate="2016-07-29T14:24:20.857" Title="replace-regexp-in-string not replacing the entire match" Tags="|regular-expressions|url|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24894" PostTypeId="1" AcceptedAnswerId="24895" CreationDate="2016-07-28T11:39:27.327" Score="1" ViewCount="124" Body="&lt;p&gt;My bash_profile includes a couple functions to build the prompt. This is a super-simplified version, which I'm using to try to debug the problem with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;custom_git_function () {&#xA;  echo &quot;git&quot;&#xA;}&#xA;&#xA;build_custom_prompt() {&#xA;  export PS1=&quot;\u:\W \$(custom_git_function) &amp;gt;&quot;&#xA;}&#xA;&#xA;build_custom_prompt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run shell mode in emacs, it seems to have access to &lt;code&gt;build_custom_prompt&lt;/code&gt;, but not &lt;code&gt;custom_git_function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bash: custom_git_function: command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's a clean way to fix this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-07-28T12:22:02.213" Title="How to get shell mode to properly handle my PS1, which involves user-defined function calls?" Tags="|shell|shell-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24895" PostTypeId="2" ParentId="24894" CreationDate="2016-07-28T12:22:02.213" Score="1" Body="&lt;p&gt;Variables or functions defined in &lt;code&gt;.bash_profile&lt;/code&gt; are loaded by login shells, and aren't available to programs started via your window manager. &lt;code&gt;.bashrc&lt;/code&gt;, on the other hand, is run anytime you open a shell, include Emacs shell-mode. So if you move your function definition to &lt;code&gt;.bashrc&lt;/code&gt; you should be able to see it from inside Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, your login shell &lt;code&gt;.bash_profile&lt;/code&gt; will include something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# include .bashrc if it exists&#xA;if [ -f ~/.bashrc ]; then&#xA;    . ~/.bashrc&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will source everything in &lt;code&gt;.bashrc&lt;/code&gt;, so anything in &lt;code&gt;.bashrc&lt;/code&gt; gets loaded by login shells as well.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-07-28T12:22:02.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24896" PostTypeId="1" AcceptedAnswerId="24913" CreationDate="2016-07-28T12:37:47.517" Score="8" ViewCount="1536" Body="&lt;p&gt;It's in the title:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What's the difference between &lt;code&gt;evil-search-forward&lt;/code&gt; and &lt;code&gt;evil-ex-search-forward&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When would I want to use one instead of the other?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;evil-search-forward&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;&#xA;  Search forward for user-entered text.&lt;br&gt;&#xA;  Searches for regular expression if &lt;code&gt;evil-regexp-search&lt;/code&gt; is t.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;evil-ex-search-forward&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;&#xA;  Starts a forward search.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10948" LastEditorUserId="10948" LastEditDate="2016-07-28T13:15:09.623" LastActivityDate="2016-07-28T21:46:09.057" Title="Difference between `evil-search-forward` and `evil-ex-search-forward`" Tags="|evil|search|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24898" PostTypeId="2" ParentId="20239" CreationDate="2016-07-28T14:23:20.833" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;noreferrer&quot;&gt;Projectile&lt;/a&gt; provides a &lt;code&gt;projectile-toggle-between-implementation-and-test&lt;/code&gt; function with exactly this behavior. As stated in &lt;a href=&quot;http://projectile.readthedocs.io/en/latest/usage/#interactive-commands&quot; rel=&quot;noreferrer&quot;&gt;the docs&lt;/a&gt;, you can use &lt;kbd&gt;C-c p t&lt;/kbd&gt; to &quot;Toggle between an implementation file and its test file.&quot;&lt;/p&gt;&#xA;" OwnerUserId="8900" LastActivityDate="2016-07-28T14:23:20.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24900" PostTypeId="2" ParentId="20118" CreationDate="2016-07-28T14:42:54.837" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/projectile/commit/bd68bf45bad027d2f1c32ca88da9e7a01b67664a&quot; rel=&quot;nofollow&quot;&gt;Since 2016-04-05&lt;/a&gt;, you can use a bang prefix to override ignored profiles, as explained in &lt;a href=&quot;http://projectile.readthedocs.io/en/latest/usage/#ignoring-files&quot; rel=&quot;nofollow&quot;&gt;the docs&lt;/a&gt;. For instance, to override the &lt;code&gt;.gitignore&lt;/code&gt; in the question for the files in the &lt;code&gt;/dev&lt;/code&gt; folder, you could use a &lt;code&gt;.projectile&lt;/code&gt; file that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;!/dev/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8900" LastEditorUserId="8900" LastEditDate="2016-07-28T15:55:46.747" LastActivityDate="2016-07-28T15:55:46.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24901" PostTypeId="2" ParentId="24573" CreationDate="2016-07-28T15:32:04.027" Score="2" Body="&lt;p&gt;have a look at the &lt;code&gt;key-chord&lt;/code&gt; emacs package. it allows you to define mappings of multiple keys and take action on them. in your case the action would just be &lt;code&gt;(insert &quot;æ&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;alternatively, insert a digraph by typing &lt;code&gt;C-k a e&lt;/code&gt; in evil's insert mode. this invokes &lt;code&gt;(evil-insert-digraph)&lt;/code&gt; and reads &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;e&lt;/code&gt;, then produces æ.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastEditorUserId="12785" LastEditDate="2016-07-29T10:20:01.473" LastActivityDate="2016-07-29T10:20:01.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24902" PostTypeId="1" AcceptedAnswerId="24904" CreationDate="2016-07-28T16:15:05.250" Score="12" ViewCount="5934" Body="&lt;p&gt;Using Gnu Emacs in MacOS &quot;El Capitan&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I bind the &lt;em&gt;right&lt;/em&gt; option key to control but keep the &lt;em&gt;left&lt;/em&gt; option key bound to option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that even with caps_lock as control my left hand would start to ache, so I decided to have as many control keys as possible.  Before switching to Mac I never used caps_lock or option (still don't use caps_lock), so I bound both of them to control: caps_lock to control in the Keyboard systems preferences and option to control in my .emacs file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike PC keyboards, the Apple keyboard has only one control key but &lt;em&gt;two&lt;/em&gt; option keys (one on the outside of each of the two command keys): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7jG9R.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7jG9R.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I'm finding that I would like to be able to have an option key in Emacs.  There is already a control key on the bottom left but not one on the bottom right, so ideally I would revert just the left option key (now mapped to control) back to option But I still want the right option key to be a control.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the relevant lines from my .emacs file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq &#xA;  mac-option-key-is-control t&#xA;  mac-option-modifier 'control&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10628" LastActivityDate="2018-03-20T13:50:09.010" Title="For MacOS: how to bind left and right option keys separately?" Tags="|key-bindings|osx|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24903" PostTypeId="1" AcceptedAnswerId="24909" CreationDate="2016-07-28T16:20:25.607" Score="3" ViewCount="586" Body="&lt;p&gt;I use C-Tab and C-Shift-Tab to navigate buffer as I would do in a browser. Unfortunately, in magit-mode (which I call using &lt;code&gt;magit-status&lt;/code&gt;), the key is bound to some diff expansion. The means that I can't switch buffers the ways I would like to as soon as one buffer is in magit-mode. I tried removing the binding using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key magit-mode-map&#xA;    (kbd &quot;C-&amp;lt;Tab&amp;gt;&quot;) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this does not seem to have any effect. Any ideas on how to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding my settings: I have a &lt;code&gt;.emacs.d/buffers.el&lt;/code&gt; which has a line defining the key binding: &lt;code&gt;(global-set-key [C-tab] 'next-buffer)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;use-package&lt;/code&gt; to load magit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package magit&#xA;  :ensure t&#xA;  :config&#xA;  (define-key magit-mode-map (kbd &quot;C-&amp;lt;Tab&amp;gt;&quot;) nil)&#xA;  (with-eval-after-load 'magit-mode&#xA;    (define-key magit-mode-map (kbd &quot;&amp;lt;C-Tab&amp;gt;&quot;) nil))&#xA;  (setq magit-display-buffer-function&#xA;        (lambda (buffer)&#xA;          (display-buffer buffer '(display-buffer-same-window)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I added the suggestion by Konstantin Morenko, but &lt;code&gt;C-Tab&lt;/code&gt; still does not work properly.&lt;/p&gt;&#xA;" OwnerUserId="8891" LastEditorUserId="8891" LastEditDate="2016-07-29T08:07:52.327" LastActivityDate="2016-07-29T10:24:50.183" Title="Disable C-Tab in magit mode" Tags="|key-bindings|magit|keymap|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24904" PostTypeId="2" ParentId="24902" CreationDate="2016-07-28T16:36:32.063" Score="11" Body="&lt;p&gt;You're almost there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, the &lt;code&gt;ns-XXXXX-modifier&lt;/code&gt; variables affect both the&#xA;left and right versions of the key.  However, you can change the&#xA;&lt;em&gt;right&lt;/em&gt; one with &lt;code&gt;ns-right-XXXXX-modifier&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: to set the left one to &lt;code&gt;A&lt;/code&gt; and the right one to &lt;code&gt;B&lt;/code&gt;, you can&#xA;set the &lt;code&gt;ns-XXXXX-modifier&lt;/code&gt; to &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;ns-right-XXXXX-modifier&lt;/code&gt;&#xA;to &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example sets the left option modifier to meta, and&#xA;the right one to control:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ns-option-modifier      'meta&#xA;      ns-right-option-modifer 'control)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacsformacosx.com/tips&quot; rel=&quot;noreferrer&quot;&gt;https://emacsformacosx.com/tips&lt;/a&gt; (&quot;Changing the Modifier&#xA;Keys&quot;) for more details.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-07-28T16:36:32.063" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24905" PostTypeId="1" CreationDate="2016-07-28T17:59:43.933" Score="1" ViewCount="581" Body="&lt;p&gt;Would it be possible to disable &lt;a href=&quot;https://github.com/Malabarba/aggressive-indent-mode&quot; rel=&quot;nofollow&quot;&gt;aggressive indent package&lt;/a&gt; just for some file extensions?. I know it's possible to do it by major mode, but I use web-mode for js,html,php and others. And I just want to disable it for javascript.&lt;/p&gt;&#xA;" OwnerUserId="7006" LastEditorUserId="10578" LastEditDate="2016-07-29T12:35:37.773" LastActivityDate="2016-08-23T04:49:53.023" Title="Is it possible to disable aggressive indent mode per file extension?" Tags="|package|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24907" PostTypeId="1" AcceptedAnswerId="24910" CreationDate="2016-07-28T18:38:50.663" Score="11" ViewCount="7520" Body="&lt;p&gt;I'm trying to ignore some file patterns while performing &lt;code&gt;helm-projectile-grep&lt;/code&gt; and some with &lt;code&gt;helm-projectile-find-file&lt;/code&gt;. I've found that it could be achieved using &lt;code&gt;.dir-locals.el&lt;/code&gt; &lt;a href=&quot;http://projectile.readthedocs.io/en/latest/configuration/#configuring-projectiles-behavior&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;br&gt;&#xA;Following this chunk of documentation I've made my &lt;code&gt;.dir-locals.el&lt;/code&gt; looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;  (grep-find-ignored-files . '(&quot;*.log&quot;))&#xA;  (projectile-globally-ignored-files . '(&quot;*.log&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When &lt;code&gt;helm-projectile-grep&lt;/code&gt; is called it yields an error in &lt;code&gt;helm-projectile&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error running timer `helm-projectile-grep-or-ack': (wrong-type-argument stringp quote)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since both &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;emacs manual&lt;/a&gt; and projectile docs are sketchy about &lt;code&gt;.dir-locals.el&lt;/code&gt; and it's usage I have few questions?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How &lt;code&gt;.dir-locals.el&lt;/code&gt; works? Does it merge global and dir-local value of an variable? If I have a variable &lt;code&gt;a&lt;/code&gt; which is &lt;code&gt;'(&quot;a&quot; &quot;b&quot;)&lt;/code&gt; and set it in dir-local to &lt;code&gt;'(&quot;c&quot;)&lt;/code&gt;, what is its value that Emacs use when I perform an operation in certain scope of &lt;code&gt;.dir-locals.el&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;What kind of structure is expected in &lt;code&gt;.dir-locals.el&lt;/code&gt; for &lt;code&gt;grep-find-ignored-files&lt;/code&gt; and &lt;code&gt;projectile-globally-ignored-files&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On Projectile itself:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why Projectile &lt;code&gt;helm-projectile-grep&lt;/code&gt; and &lt;code&gt;helm-projectile-find-file&lt;/code&gt; don't ignore file patterns which are already ignored in &lt;code&gt;.gitignore&lt;/code&gt;? Is it turned off somewhere in my config?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;According to accepted answer, if you want to ignore e.g all the &lt;code&gt;.md&lt;/code&gt; files from Projectile operations in your project using &lt;code&gt;.dir-locals.el&lt;/code&gt; you should do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;  (eval . (set (make-local-variable 'projectile-globally-ignored-files)&#xA;               (append projectile-globally-ignored-files&#xA;                       (f-entries (projectile-project-root)&#xA;                                  (lambda (f) (string-match &quot;\\.md$&quot; f)) t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6551" LastEditorUserId="6551" LastEditDate="2016-07-30T19:44:49.860" LastActivityDate="2016-07-30T19:44:49.860" Title="How to use .dir-locals.el with Projectile?" Tags="|helm|customize|projectile|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24908" PostTypeId="2" ParentId="24905" CreationDate="2016-07-28T18:41:19.187" Score="2" Body="&lt;p&gt;This should do the trick:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'web-mode-hook #'(lambda ()&#xA;                             (unless (and (stringp buffer-file-name)&#xA;                                          (string-match &quot;\\.js\\'&quot; buffer-file-name))&#xA;                               (aggressive-indent-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It activates &lt;code&gt;aggressive-indent-mode&lt;/code&gt; only if file extension is not &lt;code&gt;js&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;(global-aggressive-indent-mode 1)&lt;/code&gt; you can disable it per this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'web-mode-hook #'(lambda ()&#xA;                             (when (and (stringp buffer-file-name)&#xA;                                        (string-match &quot;\\.js\\'&quot; buffer-file-name))&#xA;                               (aggressive-indent-mode 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And finally, to disable it in javascript sections use these advices:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun aggressive-indent-advice (org-fun &amp;amp;rest args)&#xA;  &quot;Do not agressive-indent in javascript section of web-mode.&quot;&#xA;  (let ((agressive-indent t))&#xA;    (when (equal major-mode 'web-mode)&#xA;      (setq agressive-indent&#xA;            (not (member (get-text-property (point) 'part-side) '(javascript)))))&#xA;    (when agressive-indent&#xA;      (apply org-fun args))))&#xA;(advice-add 'aggressive-indent--keep-track-of-changes :around #'aggressive-indent-advice)&#xA;(advice-add 'aggressive-indent--indent-if-changed :around #'aggressive-indent-advice)&#xA;(advice-add 'aggressive-indent--softly-indent-defun :around #'aggressive-indent-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that, depending on your need, you can use the former two hooks independently from &lt;code&gt;web-mode&lt;/code&gt; to disable &lt;code&gt;aggressive-indent&lt;/code&gt;. On the other hand, the depends on &lt;code&gt;web-mode&lt;/code&gt;, but will also work for &lt;code&gt;.js&lt;/code&gt; files in &lt;code&gt;web-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="675" LastEditDate="2016-08-23T04:49:53.023" LastActivityDate="2016-08-23T04:49:53.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24909" PostTypeId="2" ParentId="24903" CreationDate="2016-07-28T19:32:01.327" Score="4" Body="&lt;p&gt;According to &lt;a href=&quot;https://emacs.stackexchange.com/questions/21978/remove-key-binding-in-magit-status-mode&quot;&gt;Remove key binding in magit-status-mode&lt;/a&gt; use in &lt;code&gt;init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'magit-mode&#xA;  (define-key magit-mode-map (kbd &quot;&amp;lt;C-Tab&amp;gt;&quot;) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;(with-eval-after-load FILE &amp;amp;opt BODY)&lt;/code&gt; executes BODY after the FILE is loaded, so, it will rebind keys only after the keybind in &lt;code&gt;magit-mode&lt;/code&gt; will be created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation of &lt;code&gt;bind-key.el&lt;/code&gt; from &lt;code&gt;use-package&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If you have lots of keybindings set in your .emacs file, it can be hard to&#xA;;; know which ones you haven't set yet, and which may now be overriding some&#xA;;; new default in a new emacs version.  This module aims to solve that&#xA;;; problem.&#xA;;;&#xA;;; Bind keys as follows in your .emacs:&#xA;;;&#xA;;;   (require 'bind-key)&#xA;;;&#xA;;;   (bind-key &quot;C-c x&quot; 'my-ctrl-c-x-command)&#xA;;;&#xA;;; If you want the keybinding to override all minor modes that may also bind&#xA;;; the same key, use the `bind-key*' form:&#xA;;;&#xA;;;   (bind-key* &quot;&amp;lt;C-return&amp;gt;&quot; 'other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, use in your &lt;code&gt;buffers.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'bind-key)&#xA;(bind-key &quot;&amp;lt;C-Tab&amp;gt;&quot; 'next-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-07-29T10:24:50.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24910" PostTypeId="2" ParentId="24907" CreationDate="2016-07-28T20:08:27.940" Score="11" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;.dir-locals.el&lt;/code&gt; does not care about the meaning of the variables that it sets, nor does it assume their values are lists (they do not have to be.) So it does not perform any merge or other processing. The only thing that's been taken into account is precedence which is described in the documentation you have linked to. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The values are interpreted as-is, emacs uses &lt;code&gt;read&lt;/code&gt; function to get them, so they are unevaluated. That's what causes the error - do not use a quote, use straight values.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To get the effect of merging, you need to do it yourself, and since the values are unevaluated you need to use a special variable &lt;code&gt;eval&lt;/code&gt;, like this:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;   (eval . (setq a-variable-you-need-to-merge (add-to-list whatever-you-need))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; as pointed out in the comments, using  &lt;code&gt;setq&lt;/code&gt; in &lt;code&gt;eval&lt;/code&gt; will change the global value of the variable (unless of course the variable was declared local to begin with.) To make the change local, &lt;code&gt;make-local-variable&lt;/code&gt; can be used, so for example changing &lt;code&gt;projectile-globally-ignored-files&lt;/code&gt; locally can be done like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;   (eval . &#xA;         (set &#xA;          (make-local-variable 'projectile-globally-ignored-files)&#xA;          (push &quot;SOME-VALUE&quot; projectile-globally-ignored-files)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is a bit sloppy, and can certainly be done shorter, but I just wanted to make a point of using &lt;code&gt;make-local-variable&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I would definitely make a helper out of this kind of functions and put it in &lt;code&gt;init.el&lt;/code&gt; and just called from &lt;code&gt;.dir-locals.el&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;As I said, &lt;code&gt;.dir-locals.el&lt;/code&gt; does not assume anything about the variables, so the requirements are the same as if they were set in any other way. And as far as I can tell from looking at &lt;code&gt;projectile&lt;/code&gt; source, &lt;code&gt;projectile-globally-ignored-files&lt;/code&gt; does not expect blobs (asterisks etc.) but rather single file names, so you will have to either list them all or write an expression that calculates them and use &lt;code&gt;eval&lt;/code&gt; with it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You should have gotten a warning from Emacs about some local variables not being safe (because of &lt;code&gt;*&lt;/code&gt;.) Make sure you haven't ignored the variable list, otherwise your &lt;code&gt;.dir-locals.el&lt;/code&gt; will have no effect.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Update regarding &lt;code&gt;.gitignore&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems that Projectile takes &lt;code&gt;.gitignore&lt;/code&gt; file into account only if the project is indeed under &lt;code&gt;git&lt;/code&gt;, that is, a &lt;code&gt;git&lt;/code&gt; repository exists.&lt;/p&gt;&#xA;" OwnerUserId="12749" LastEditorUserId="12749" LastEditDate="2016-07-29T21:45:48.937" LastActivityDate="2016-07-29T21:45:48.937" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24911" PostTypeId="2" ParentId="3669" CreationDate="2016-07-28T20:49:54.297" Score="2" Body="&lt;p&gt;Quite a few possible reasons, two off the top of my head (had these troubles in the past.)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You may have a remote folder mapped in Windows, and when off the local network it may slow you down a lot (getting off the VPN doesn't quite help, actually it may make matters worse since Windows will keep trying to reach it stopped only by timeouts.) More recent versions of Windows seem to deal a bit better with it, but still. Try to run &lt;code&gt;net use * /delete&lt;/code&gt; in a command prompt and see if it helps.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Check if you are using &lt;code&gt;tramp&lt;/code&gt; (I doubt it since you are on Windows, but I am using Windows too along with Linux and I do use &lt;code&gt;tramp&lt;/code&gt; so it's not totally out of question.) If so, try to run &lt;code&gt;tramp-cleanup-all-connections&lt;/code&gt; when off the network.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If all this or anything else people suggest here doesn't help you may need to run deeper troubleshooting. The best tool I've found for it is Sysinternals' Process Monitor (&lt;a href=&quot;https://technet.microsoft.com/en-us/sysinternals/bb896645&quot; rel=&quot;nofollow&quot;&gt;https://technet.microsoft.com/en-us/sysinternals/bb896645&lt;/a&gt;). It's a complex beast to deal with, and it requires at least basic understanding of Windows operating system, but it is capable of taking guesswork totally out of the process and zeroing down on the offender.&lt;/p&gt;&#xA;" OwnerUserId="12749" LastActivityDate="2016-07-28T20:49:54.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24912" PostTypeId="2" ParentId="5613" CreationDate="2016-07-28T21:34:45.727" Score="3" Body="&lt;p&gt;In &lt;a href=&quot;https://bitbucket.org/lyro/evil/wiki/Home&quot; rel=&quot;nofollow&quot;&gt;Evil mode&lt;/a&gt; or &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/&quot; rel=&quot;nofollow&quot;&gt;Spacemacs&lt;/a&gt; you can do this, assuming you have not changed the default key-bindings:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In Normal state (equivalent to Vim's Normal mode), move the cursor to the beginning of the &lt;strong&gt;first&lt;/strong&gt; line in your list.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;v&lt;/kbd&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;j&lt;/kbd&gt; once for each &lt;strong&gt;remaining&lt;/strong&gt; line in your list. &lt;em&gt;(Alternatively, type the number of remaining lines in your list, followed by the &lt;kbd&gt;j&lt;/kbd&gt; key. E.g. for your example: &lt;kbd&gt;2&lt;/kbd&gt;&lt;kbd&gt;4&lt;/kbd&gt;&lt;kbd&gt;j&lt;/kbd&gt;.)&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;i&lt;/kbd&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Type &lt;code&gt;- [ ]&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Press &lt;kbd&gt;Esc&lt;/kbd&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user8341" LastEditorDisplayName="user8341" LastEditDate="2016-08-12T21:24:42.823" LastActivityDate="2016-08-12T21:24:42.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24913" PostTypeId="2" ParentId="24896" CreationDate="2016-07-28T21:40:20.197" Score="10" Body="&lt;p&gt;&lt;code&gt;evil&lt;/code&gt; has two search implementations, one is its own, the other one is a wrapper around emacs &lt;code&gt;isearch&lt;/code&gt;. &lt;code&gt;evil-search-forward&lt;/code&gt; wraps &lt;code&gt;isearch-forward&lt;/code&gt;, &lt;code&gt;evil-ex-search-forward&lt;/code&gt; invokes the internal search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one is used is governed by the variable &lt;code&gt;evil-search-module&lt;/code&gt;, the default is &lt;code&gt;isearch&lt;/code&gt;. In this mode, &lt;code&gt;evil&lt;/code&gt;'s search behaves exactly like emacs' (because it is.) When set to &lt;code&gt;evil-search&lt;/code&gt; you get the behavior much more similar to &lt;code&gt;vim&lt;/code&gt;. (I can't enumerate the differences since I migrated from &lt;code&gt;vim&lt;/code&gt; to &lt;code&gt;emacs&lt;/code&gt;/&lt;code&gt;evil&lt;/code&gt; quite some time ago, but play with this variable, you will get the taste of it and decide what you like more. I use &lt;code&gt;isearch&lt;/code&gt; because I get consistent behavior with other places in emacs where I stick to emacs mode and &lt;code&gt;evil&lt;/code&gt; does a very good job wrapping native &lt;code&gt;isearch&lt;/code&gt; and preserving &lt;code&gt;vim&lt;/code&gt;-like functionality, but it's a matter of taste and habits)&lt;/p&gt;&#xA;" OwnerUserId="12749" LastEditorUserId="12749" LastEditDate="2016-07-28T21:46:09.057" LastActivityDate="2016-07-28T21:46:09.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24914" PostTypeId="1" CreationDate="2016-07-28T21:41:01.300" Score="1" ViewCount="59" Body="&lt;p&gt;I edit some files that are mostly C code but include a few special extension tokens.  The tokens that give c-mode a problem are &lt;code&gt;@'&lt;/code&gt; and &lt;code&gt;@&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I essentially want c-mode to ignore these two bigrams.  The current behavior is that the quote (single or double) is interpreted as the beginning of a quoted string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reckon this is childs play for anyone well versed in elisp syntax tables but I am not hence my appeal for your help.&lt;/p&gt;&#xA;" OwnerUserId="12791" LastEditorUserId="675" LastEditDate="2016-07-29T14:19:17.497" LastActivityDate="2016-11-29T03:20:42.910" Title="how to change C-mode syntax so that the token @' is ignored?" Tags="|syntax-table|c-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24915" PostTypeId="1" CreationDate="2016-07-29T02:44:27.113" Score="2" ViewCount="336" Body="&lt;p&gt;Recently I have used company and I like it. But I feel prone to the mistake using the command &lt;code&gt;company-complete-common&lt;/code&gt;. For example,&#xA;when I make company-mode enabled on emacs-lisp-mode,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I'm going to input the function &quot;find-file&quot;. I typed &quot;fin&quot; one part of the function.&lt;/li&gt;&#xA;&lt;li&gt;Many emacs-lisp functions &quot;find-file&quot;,&quot;find-file--read-only&quot;,...,&quot;finger&quot; are included in company candidates.&lt;/li&gt;&#xA;&lt;li&gt;Since the candidate popup often shows &quot;find*&quot; functions on display hiding the &quot;finger&quot; function, I execute &lt;code&gt;company-complete-common&lt;/code&gt; by mistake. But the cursol is just moved down without completing common part.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I want to know the common part before executing &lt;code&gt;company-complete-common&lt;/code&gt;. Showing it like displaying continuing string with only one company candidate is ideal, I think. So is there the pacakge enabling it, or how to write the function to do so? I also want to know other ways to display the common part.&lt;/p&gt;&#xA;" OwnerUserId="12626" LastEditorUserId="12626" LastEditDate="2016-07-29T17:55:28.373" LastActivityDate="2016-07-29T17:55:28.373" Title="How to show the common part of company candidates?" Tags="|company-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24917" PostTypeId="2" ParentId="24885" CreationDate="2016-07-29T06:04:00.627" Score="0" Body="&lt;p&gt;Here's a possible solution for you. I broke up the code so you might be able to learn a little elisp at the same time...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun indent-me ()&#xA;  &quot;Indent a bibtext entry.&#xA;This assumes the entry starts with a non-white in column 0, and&#xA;ends with a } on a line by itself.  Invoke the function anywhere&#xA;inside the entry.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    ;; go to col 0 and search upwards for the start of the entry&#xA;    (goto-char (line-beginning-position))&#xA;    (while (not (looking-at &quot;^@book&quot;))&#xA;      (forward-line -1))&#xA;    ;; now looking at the start of entry, eg. @book&#xA;    (forward-line 1)&#xA;    (while (not (looking-at &quot;^}&quot;))&#xA;      (indent-one-line)&#xA;      (forward-line 1))&#xA;    ))&#xA;&#xA;&#xA;(defun indent-one-line ()&#xA;  &quot;Indent one line of the entry.&quot;&#xA;  (interactive)&#xA;  (let (tokens tag newline)&#xA;    (setq tokens (split-string (line-contents)))&#xA;    (setq tag (car tokens))&#xA;    (setq tag (string-pad-left tag 15))&#xA;    (setq newline (cdr tokens))&#xA;    (setq newline (push tag newline))&#xA;    (setq newline (mapconcat 'concat newline &quot; &quot;))&#xA;    (goto-char (line-beginning-position))&#xA;    (kill-line)&#xA;    (insert newline)&#xA;    ))&#xA;&#xA;&#xA;(defun line-contents ()&#xA;  &quot;Return the contents of the current buffer line.&quot;&#xA;  (buffer-substring-no-properties&#xA;   (line-beginning-position) (line-end-position)))&#xA;&#xA;(defun string-pad-left (string length)&#xA;  &quot;Return STRING padded left to LENGTH.&quot;&#xA;  (let (result)&#xA;    (while (&amp;gt; length (length string))&#xA;      (setq string (concat &quot; &quot; string)))&#xA;    (setq result string)&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-07-29T06:20:01.917" LastActivityDate="2016-07-29T06:20:01.917" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24918" PostTypeId="2" ParentId="24776" CreationDate="2016-07-29T06:09:33.383" Score="1" Body="&lt;p&gt;I'm posting an &quot;answer&quot; just to clear the question. Everyone, including me when I posted the question, thinks that the &quot;and&quot; has no value, and might be a leftover from something.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-07-29T06:09:33.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24919" PostTypeId="2" ParentId="24744" CreationDate="2016-07-29T06:19:25.933" Score="0" Body="&lt;p&gt;I'm posting a summary answer just to clear the question, so it has an &quot;answer.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I think my original question was off target to the final answer. I wanted to notify a &quot;parent&quot; buffer when a child buffer that it spawned was killed, so the parent could refresh the buffer contents when it regained focus after the child (temp) buffer was killed. So my focus was on finding out how the parent buffer could figure out that it just became active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was not a easy way to find that out, or I suppose someone would have posted an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what really worked was having the child buffer call a defun (a hook function) that just updated the parent's contents. At first I used the global buffer-kill-hook, but that led to problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, my hook function had to protect against every other killed buffer running the guts of my hook function. So I modified my hook function to look at the filename regexp of the killed buffer, so I could spot the filenames that were normally child buffers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That was ok so long as only the parent edited those files by spawning them into a child buffer. But when I edited those special filenames through dired and killed them, my hook function tried to update a parent buffer that wasn't there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Stefan pointed out the &quot;local&quot; argument to add-hook, I used that feature to have the parent install a buffer-local hook on the child buffer, so that my hook function could only be run by a child who was spawned by the parent and who had the local buffer-kill-hook installed by the parent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can edit the special files through dired without bad effects, since the buffers don't have a local buffer-kill-hook installed by a parent, and because I'm not using the global buffer-kill-hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So everything is working fine now. Thanks to everyone for helping. &lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-07-29T06:19:25.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24920" PostTypeId="1" AcceptedAnswerId="24926" CreationDate="2016-07-29T06:47:03.750" Score="0" ViewCount="56" Body="&lt;p&gt;I have a string variable, specifically the &lt;code&gt;emacs-version&lt;/code&gt; variable that can be quite long and I am only using &lt;code&gt;message&lt;/code&gt; with the first 4 of those characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to format the variable in a &lt;code&gt;message&lt;/code&gt; statement so that I am only printing the first x number of characters? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I am using &lt;code&gt;substring&lt;/code&gt; but it seems like there should be an easier / cleaner way. Please let me know if there is a more efficient way to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;You are running version %s old.&quot; (substring emacs-version 0 4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2016-07-29T13:32:55.330" Title="How to format a string variable to only show the first x number of characters?" Tags="|formatting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24921" PostTypeId="1" CreationDate="2016-07-29T07:27:55.883" Score="2" ViewCount="1071" Body="&lt;p&gt;In libreoffice I can insert a two column section. In org mode,&#xA;creating a two_columns page style and use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_ODT: :style &quot;two_columns&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;can produce a two column document, but org mode doesn't seem to have a section break like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# +SECTIONBREAK:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I switch from a two columns section to one column section?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="12616" LastEditDate="2016-07-29T16:19:57.373" LastActivityDate="2024-03-18T18:07:15.893" Title="org odt export: how to create a two columns section" Tags="|org-mode|org-export|xml|libreoffice|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24922" PostTypeId="2" ParentId="24920" CreationDate="2016-07-29T07:41:54.907" Score="2" Body="&lt;p&gt;In this case, I'd recommend resorting to &lt;code&gt;emacs-major-version&lt;/code&gt; and &lt;code&gt;emacs-minor-version&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;emacs version %s.%s&quot; emacs-major-version emacs-minor-version)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11875" LastActivityDate="2016-07-29T07:41:54.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24923" PostTypeId="1" CreationDate="2016-07-29T08:23:15.783" Score="0" ViewCount="27" Body="&lt;p&gt;When I try to type something right before an inline image, it inserts only one character there, and the cursor somehow moves to the end of that image link. When I try to type &quot;foo&quot; it goes like this (&quot;_&quot; is the cursor):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_[image] &#xA;f_[image] &#xA;f[image]_&#xA;f[image]o_&#xA;f[image]oo_&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-07-29T08:23:15.783" Title="Strange cursor behavior with inline images" Tags="|inline-image|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24924" PostTypeId="1" AcceptedAnswerId="24950" CreationDate="2016-07-29T09:14:23.097" Score="0" ViewCount="54" Body="&lt;p&gt;Is there a specific way to have the author email address linked on his name when exporting in LaTeX, or if I have to do it with &lt;code&gt;LaTeX&lt;/code&gt; commands using &lt;code&gt;hyperref&lt;/code&gt; package ?&lt;/p&gt;&#xA;" OwnerUserId="12627" LastActivityDate="2016-08-29T17:25:09.067" Title="Author name linked to his address" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24925" PostTypeId="2" ParentId="24902" CreationDate="2016-07-29T10:22:47.487" Score="1" Body="&lt;p&gt;emacs on osx has a few &lt;code&gt;ns-*-modifier&lt;/code&gt; variables that help for this particular case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in general, you can use karabiner (&lt;a href=&quot;https://pqrs.org/osx/karabiner/&quot; rel=&quot;nofollow&quot;&gt;https://pqrs.org/osx/karabiner/&lt;/a&gt;) to remap keys under osx.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastActivityDate="2016-07-29T10:22:47.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24926" PostTypeId="2" ParentId="24920" CreationDate="2016-07-29T13:32:55.330" Score="2" Body="&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;format&lt;/code&gt; tells you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For %s and %S, the precision specifier truncates the string to the given width.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(format &quot;%.4s&quot; emacs-version)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-07-29T13:32:55.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24927" PostTypeId="1" CreationDate="2016-07-29T13:56:15.327" Score="5" ViewCount="4311" Body="&lt;p&gt;When in &lt;code&gt;ansi-term&lt;/code&gt;, i can't use &lt;code&gt;M-x&lt;/code&gt;, the keyboard shortcut doesn't do anything. Does anyone know how to fix this?&lt;/p&gt;&#xA;" OwnerUserId="12507" LastEditorUserId="12616" LastEditDate="2016-07-29T14:09:41.433" LastActivityDate="2016-07-29T14:21:12.010" Title="Can't use M-x in ansi-term mode" Tags="|key-bindings|ansi-term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24928" PostTypeId="2" ParentId="14955" CreationDate="2016-07-29T14:00:08.433" Score="1" Body="&lt;p&gt;I had the same problem. Turns out company mode doesn't use multiple backends unless you group them. Problem occurred because I was adding the 'rtags' backend and it was preferred over &lt;code&gt;company-keywords&lt;/code&gt; backend. This is how I fixed it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(push '(company-rtags company-keywords) company-backends)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now both backends are used by company mode.&lt;/p&gt;&#xA;" OwnerUserId="2031" LastActivityDate="2016-07-29T14:00:08.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24929" PostTypeId="2" ParentId="24927" CreationDate="2016-07-29T14:13:35.120" Score="12" Body="&lt;p&gt;Term mode has two input mode char mode and line mode. In char mode you would press &lt;code&gt;C-x M-x&lt;/code&gt; (prefix your standard keyboard shortcuts with &lt;code&gt;C-x&lt;/code&gt; [0]). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you enter line mode (&lt;code&gt;C-c C-j&lt;/code&gt; [1]) &lt;code&gt;M-x&lt;/code&gt; should work as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more on both:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[0] &lt;a href=&quot;https://www.emacswiki.org/emacs/AnsiTerm&quot; rel=&quot;noreferrer&quot;&gt;https://www.emacswiki.org/emacs/AnsiTerm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11966" LastEditorUserId="12616" LastEditDate="2016-07-29T14:21:12.010" LastActivityDate="2016-07-29T14:21:12.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24931" PostTypeId="1" AcceptedAnswerId="24934" CreationDate="2016-07-29T14:17:02.440" Score="0" ViewCount="63" Body="&lt;p&gt;My goal was to improve the php mode. Very often I have to define an array element. And the possible code is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$array['key']&#xA;$array[$key]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, I wanted to create Emacs function, reacting upon clicking '[' key like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if '[' was clicked once:&#xA;    print '[';&#xA;if  '[' was clicked twice:&#xA;    #this is for the string key&#xA;    print &quot;['']&quot;;&#xA;    move the cursor between &quot;''&quot;;&#xA;if  '[' was clicked 3 times:&#xA;    #this is for the variable as a key&#xA;    remove &quot;''&quot; at the center;&#xA;    #so we got [&amp;lt;cursor&amp;gt;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I created a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *kb--bracket-pressed* 0)&#xA;(setq *kb--bracket-pressed* 0)&#xA;&#xA;(defun bracket-pressed ()&#xA;      &quot;[ key pressed&quot;&#xA;      (interactive)&#xA;      (cond&#xA;            ((= 0 *kb--bracket-pressed*)&#xA;                  (insert &quot;[&quot;)&#xA;                  (setq *kb--bracket-pressed* 1)&#xA;                  )&#xA;            ((= 1 *kb--bracket-pressed*)&#xA;                  (insert &quot;'']&quot;)&#xA;                  (backward-char 2)&#xA;                  (setq *kb--bracket-pressed* 2)&#xA;                  )&#xA;            ((= 2 *kb--bracket-pressed*)&#xA;                  (delete-char 1)&#xA;                  (delete-char -1)&#xA;                  (setq *kb--bracket-pressed* 0)&#xA;                  )&#xA;            )&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I added a function that will set &lt;code&gt;*kb--bracket-pressed* = 0&lt;/code&gt; when any non-bracket key was pressed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun clean-bracket-pressed ()&#xA;      (if (stringp (this-command-keys))&#xA;            (when (and&#xA;                        (not (= *kb--bracket-pressed* 0))&#xA;                        (not (string= (this-command-keys) &quot;[&quot;))&#xA;                        )&#xA;                  (setq *kb--bracket-pressed* 0))&#xA;            )&#xA;            (setq *kb--bracket-pressed* 0)&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When opening a php file the following hook is launched:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-php-mode ()&#xA;  &quot;My php-mode customisations.&quot;&#xA;      (local-set-key (kbd &quot;[&quot;) 'bracket-pressed)&#xA;      (add-hook 'pre-command-hook 'clean-bracket-pressed nil 'make-it-local)&#xA;)&#xA;&#xA;(add-hook 'php-mode-hook 'my-php-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason &lt;code&gt;clean-bracket-pressed&lt;/code&gt; doesn't work correctly. When I click '[' twice, and then click any other key &lt;code&gt;*kb--bracket-pressed*&lt;/code&gt; is still equal to 2. While I am expecting it to become 0.&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2016-07-29T16:33:06.433" Title="Reacting to custom key press" Tags="|key-bindings|functions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24932" PostTypeId="2" ParentId="24893" CreationDate="2016-07-29T14:24:20.857" Score="2" Body="&lt;p&gt;Emacs search functions (such as &lt;code&gt;re-search-forward&lt;/code&gt;, &lt;code&gt;replace-regexp-in-string&lt;/code&gt; etc) store the search result as &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Match-Data.html&quot; rel=&quot;nofollow&quot;&gt;the Match data&lt;/a&gt;. The later search overwrites the previous search's Match data by default. If you have to do another search within one search, you need to save &amp;amp; restore the Match data before/after the inner search, Emacs provides &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Saving-Match-Data.html#Saving-Match-Data&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;save-match-data&lt;/code&gt;&lt;/a&gt; for this purpose.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string some-regexp&#xA;                          (lambda (_match)&#xA;                            (save-match-data&#xA;&#xA;                              do-another-search&#xA;&#xA;                              ))&#xA;                          some-string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-07-29T14:24:20.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24933" PostTypeId="2" ParentId="22640" CreationDate="2016-07-29T14:33:29.087" Score="3" Body="&lt;p&gt;If you're using &lt;em&gt;js2-mode&lt;/em&gt;, the &lt;code&gt;js2-indent-switch-body&lt;/code&gt; var should be set at &lt;code&gt;true&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq js2-indent-switch-body t)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12799" LastActivityDate="2016-07-29T14:33:29.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24934" PostTypeId="2" ParentId="24931" CreationDate="2016-07-29T15:01:24.980" Score="1" Body="&lt;p&gt;Your parentheses are off in the &lt;code&gt;clean-bracket-pressed&lt;/code&gt; function, and the final &lt;code&gt;setq&lt;/code&gt; is outside the &lt;code&gt;if&lt;/code&gt;.  If you reindent using standard Elisp style, this pops right out at you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun clean-bracket-pressed ()&#xA;  (if (stringp (this-command-keys))&#xA;      (when (and&#xA;             (not (= *kb--bracket-pressed* 0))&#xA;             (not (string= (this-command-keys) &quot;[&quot;)))&#xA;        (setq *kb--bracket-pressed* 0)))&#xA;  (setq *kb--bracket-pressed* 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your original indentation suggests you want this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun clean-bracket-pressed ()&#xA;  (if (stringp (this-command-keys))&#xA;      (when (and&#xA;             (not (= *kb--bracket-pressed* 0))&#xA;             (not (string= (this-command-keys) &quot;[&quot;)))&#xA;        (setq *kb--bracket-pressed* 0))&#xA;    (setq *kb--bracket-pressed* 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And indeed, after this change everything works as intended.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2016-07-29T16:33:06.433" LastActivityDate="2016-07-29T16:33:06.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24936" PostTypeId="1" CreationDate="2016-07-29T17:49:24.783" Score="1" ViewCount="1394" Body="&lt;p&gt;I'm customizing my &lt;code&gt;emacs&lt;/code&gt; using literate programming within &lt;code&gt;org-mode&lt;/code&gt;. So far, It is going Ok, except that the org table align is not working properly if I press the &lt;code&gt;&amp;lt;TAB&amp;gt;&lt;/code&gt; key... even worst, the cursor does not change table cell. FYI, I'm using a monospaced font, and the alignment (and cursor movemnt) works if I press &lt;code&gt;S-&amp;lt;TAB&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I press the &lt;code&gt;&amp;lt;TAB&amp;gt;&lt;/code&gt; the massage in the mini-buffer says: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Variable binding depth exceeds max-specpdl-size&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what is happening? &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Update after some comments&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;@elethan: The &lt;code&gt;&amp;lt;TAB&amp;gt;&lt;/code&gt; key is bound to &lt;code&gt;org-cycle&lt;/code&gt;, which includes the rule for re-aligning and move to the next field. Additionally, when I call emacs with the &lt;code&gt;-Q&lt;/code&gt; flag, it behaves as it should. That is why I believe it is something in my &lt;code&gt;init&lt;/code&gt;-file&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@wasamasa: I'm getting a new error &lt;code&gt;org-planning-line-re&lt;/code&gt;, and the debug yields&lt;/p&gt;&#xA;&#xA;&lt;h2&gt; My configuration (Long) &lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;(package-initialize)&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;&#xA;(eval-when-compile&#xA;  (setq use-package-always-ensure t)&#xA;  (require 'use-package)&#xA;)&#xA;&#xA;(setq inhibit-splash-screen t)&#xA;(scroll-bar-mode -1)&#xA;(tool-bar-mode -1)&#xA;&#xA;(global-prettify-symbols-mode t)&#xA;&#xA;(global-hl-line-mode 1)&#xA;&#xA;(setq hrs/default-font &quot;Inconsolata&quot;)&#xA;(setq hrs/default-font-size 12)&#xA;(setq hrs/current-font-size hrs/default-font-size)&#xA;&#xA;;; (if (hrs/mac?)&#xA;;;     (setq hrs/default-font-size 18)&#xA;;;   (setq hrs/default-font-size 12))&#xA;&#xA;(setq hrs/font-change-increment 1.1)&#xA;&#xA;(defun hrs/set-font-size ()&#xA;  &quot;Set the font to `hrs/default-font' at `hrs/current-font-size'.&quot;&#xA;  (set-frame-font&#xA;   (concat hrs/default-font &quot;-&quot; (number-to-string hrs/current-font-size))))&#xA;&#xA;(defun hrs/reset-font-size ()&#xA;  &quot;Change font size back to `hrs/default-font-size'.&quot;&#xA;  (interactive)&#xA;  (setq hrs/current-font-size hrs/default-font-size)&#xA;  (hrs/set-font-size))&#xA;&#xA;(defun hrs/increase-font-size ()&#xA;  &quot;Increase current font size by a factor of `hrs/font-change-increment'.&quot;&#xA;  (interactive)&#xA;  (setq hrs/current-font-size&#xA;        (ceiling (* hrs/current-font-size hrs/font-change-increment)))&#xA;  (hrs/set-font-size))&#xA;&#xA;(defun hrs/decrease-font-size ()&#xA;  &quot;Decrease current font size by a factor of `hrs/font-change-increment', down to a minimum size of 1.&quot;&#xA;  (interactive)&#xA;  (setq hrs/current-font-size&#xA;        (max 1&#xA;             (floor (/ hrs/current-font-size hrs/font-change-increment))))&#xA;  (hrs/set-font-size))&#xA;&#xA;(define-key global-map (kbd &quot;C-)&quot;) 'hrs/reset-font-size)&#xA;(define-key global-map (kbd &quot;C-+&quot;) 'hrs/increase-font-size)&#xA;;; (define-key global-map (kbd &quot;C-=&quot;) 'hrs/increase-font-size)&#xA;;; (define-key global-map (kbd &quot;C-_&quot;) 'hrs/decrease-font-size)&#xA;(define-key global-map (kbd &quot;C--&quot;) 'hrs/decrease-font-size)&#xA;&#xA;(load-theme 'deeper-blue)&#xA;; (custom-safe-themes&#xA;;    (quote&#xA;;     (&quot;a301332a57e8de1b2996ee2d0b2439c18bd0cec9f8cc6ccaa73fac6e239462a8&quot;&#xA;;  &quot;0aca3a26459bbb43a77f34bc22851c05c0a5d70d3230cbcdbda4fec20fef77e6&quot; default)))&#xA;&#xA;(setq backup-directory-alist '((&quot;.&quot; . &quot;/home/oscar/mydotfiles/emacs.d/backups&quot;)))&#xA;&#xA;(ispell-change-dictionary &quot;british&quot; t)&#xA;&#xA;(dolist (hook '(text-mode-hook))&#xA;  (add-hook hook (lambda () (flyspell-mode 1))))&#xA;&#xA;(define-key global-map (kbd &quot;&amp;lt;f10&amp;gt;&quot;) 'shell)&#xA;&#xA;(define-key global-map (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;(setq-default indent-tabs-mode t)&#xA;&#xA;(transient-mark-mode 1)&#xA;(show-paren-mode 1)&#xA;(setq show-paren-style 'expression)&#xA;&#xA;(setq-default truncate-lines nil)&#xA;;; Even for org-mode&#xA;;; (setq org-startup-truncated nil)&#xA;&#xA;(define-key global-map &quot;\C-x\t&quot; 'pcomplete)&#xA;&#xA;(defun 2-windows-vertical-to-horizontal ()&#xA;  (let ((buffers (mapcar 'window-buffer (window-list))))&#xA;    (when (= 2 (length buffers))&#xA;      (delete-other-windows)&#xA;      (set-window-buffer (split-window-horizontally) (cadr buffers)))))&#xA;&#xA;(add-hook 'emacs-startup-hook '2-windows-vertical-to-horizontal)&#xA;&#xA;(setq-default tab-width 2)&#xA;&#xA;(setq python-indent 2)&#xA;&#xA;(add-hook 'sh-mode-hook&#xA;          (lambda ()&#xA;            (setq sh-basic-offset 2&#xA;                  sh-indentation 2)))&#xA;&#xA;(setq latex-block-names '(&quot;theorem&quot; &quot;corollary&quot; &quot;proof&quot; &quot;frame&quot; &quot;block&quot; &quot;alertblock&quot;&#xA; &quot;definition&quot; &quot;example&quot; &quot;align&quot; &quot;align*&quot; &quot;columns&quot; &quot;tikzpicture&quot; &quot;axis&quot;&#xA; &quot;cases&quot; &quot;matrix&quot; &quot;pmatrix&quot; &quot;vmatrix&quot; &quot;parts&quot; &quot;questions&quot; &quot;solution&quot; &quot;Ebox&quot; &quot;WEbox&quot;&#xA; &quot;widetext&quot; &quot;dmath&quot; &quot;dmath*&quot; &quot;split&quot;))&#xA;&#xA;(autoload 'markdown-mode &quot;markdown-mode&quot;&#xA;  &quot;Major mode for editing Markdown files&quot; t)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.md\\'&quot; . markdown-mode))&#xA;&#xA;;; (setq load-path (cons &quot;/home/oscar/Software/org-mode/lisp&quot; load-path))&#xA;;; (setq load-path (cons &quot;/home/oscar/Software/org-mode/contrib/lisp&quot; load-path))&#xA;;; (add-to-list 'load-path &quot;/home/oscar/Software/org-mode/lisp&quot;)&#xA;;; (add-to-list 'load-path &quot;/home/oscar/Software/org-mode/contrib/lisp&quot; t)&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.\\(org\\|org_archive\\|txt\\)$&quot; . org-mode))&#xA;&#xA;(global-set-key &quot;\C-cl&quot; 'org-store-link) &#xA;(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA;(global-set-key &quot;\C-cb&quot; 'org-iswitchb)&#xA;(global-set-key (kbd &quot;C-c c&quot;) 'org-capture)&#xA;&#xA;(setq org-indirect-buffer-display 'current-window)&#xA;(setq org-startup-indented t)&#xA;(setq org-src-preserve-indentation nil)&#xA;(setq org-edit-src-content-indentation 0)&#xA;&#xA;(use-package org-bullets&#xA;  :init&#xA;  (setq org-bullets-bullet-list '(&quot;◉&quot; &quot;◎&quot; &quot;⚫&quot; &quot;○&quot; &quot;►&quot; &quot;◇&quot;))&#xA;  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))&#xA;)&#xA;;; (require 'org-bullets)&#xA;;; (add-hook 'org-mode-hook&#xA;;;           (lambda ()&#xA;;;             (org-bullets-mode t)))&#xA;&#xA;(setq org-hide-leading-stars t)&#xA;&#xA;(setq org-ellipsis &quot;⤵&quot;)&#xA;&#xA;(setq org-src-fontify-natively t)&#xA;&#xA;(setq org-src-window-setup 'current-window)&#xA;&#xA;(setq org-log-done 'note)&#xA;&#xA;(setq org-directory &quot;/home/oscar/Documents/Dropbox/Org&quot;)&#xA;&#xA;(defun org-file-path (filename)&#xA;  &quot;Return the absolute address of an org file, given its relative name.&quot;&#xA;  (concat (file-name-as-directory org-directory) filename))&#xA;&#xA;;; (setq org-inbox-file &quot;/home/oscar/Documents/Dropbox/inbox.org&quot;)&#xA;;; (setq org-index-file (org-file-path &quot;index.org&quot;))&#xA;(setq org-archive-location&#xA;      (concat (org-file-path &quot;archive.org&quot;) &quot;::* From %s&quot;))&#xA;&#xA;(setq org-use-fast-todo-selection t)&#xA;&#xA;(setq org-todo-keywords     &#xA;      '((sequence &quot;TODO(t)&quot; &quot;STARTED(s!)&quot; &quot;NEXT(n)&quot; &quot;FEEDBACK(f@/!)&quot; &quot;VERIFY(v)&quot; &quot;WAITING(w@/!)&quot; &#xA;                  &quot;|&quot; &quot;DONE(d)&quot; &quot;DELEGATED(l@/!)&quot; &quot;CANCELLED(c@/!)&quot;)))&#xA;&#xA;(setq org-todo-keyword-faces&#xA;      (quote ((&quot;TODO&quot; :foreground &quot;red&quot; :weight bold)&#xA;              (&quot;STARTED&quot; :foreground &quot;yellow&quot; :weight bold)&#xA;              (&quot;NEXT&quot; :foreground &quot;blue&quot; :weight bold)&#xA;              (&quot;FEEDBACK&quot; :foreground &quot;blue&quot; :weight bold)&#xA;              (&quot;VERIFY&quot; :foreground &quot;magenta&quot; :weight bold)&#xA;              (&quot;WAITING&quot; :foreground &quot;orange&quot; :weight bold)&#xA;              (&quot;DONE&quot; :foreground &quot;forest green&quot; :weight bold)&#xA;              (&quot;DELEGATED&quot; :foreground &quot;forest green&quot; :weight bold)&#xA;              (&quot;CANCELLED&quot; :foreground &quot;forest green&quot; :weight bold))))&#xA;&#xA;(setq org-todo-state-tags-triggers&#xA;      (quote ((&quot;CANCELLED&quot; (&quot;CANCELLED&quot; . t))&#xA;              (&quot;WAITING&quot; (&quot;WAITING&quot; . t))&#xA;              (&quot;FEEDBACK&quot; (&quot;WAITING&quot;) (&quot;FEEDBACK&quot; . t))&#xA;              (done (&quot;WAITING&quot;) (&quot;FEEDBACK&quot;))&#xA;              (&quot;TODO&quot; (&quot;WAITING&quot;) (&quot;CANCELLED&quot;) (&quot;FEEDBACK&quot;))&#xA;              (&quot;NEXT&quot; (&quot;WAITING&quot;) (&quot;CANCELLED&quot;) (&quot;FEEDBACK&quot;))&#xA;              (&quot;DONE&quot; (&quot;WAITING&quot;) (&quot;CANCELLED&quot;) (&quot;FEEDBACK&quot;)))))&#xA;&#xA;(setq org-agenda-files (quote (&quot;/home/oscar/Documents/Dropbox/Org&quot;)))&#xA;&#xA;(setq org-refile-targets (quote ((nil :maxlevel . 9)&#xA;                                 (org-agenda-files :maxlevel . 9))))&#xA;&#xA;(setq org-refile-use-outline-path t)&#xA;(setq org-outline-path-complete-in-steps nil)&#xA;&#xA;(setq org-refile-allow-creating-parent-nodes (quote confirm))&#xA;&#xA;(setq org-completion-use-ido t)&#xA;(setq ido-everywhere t)&#xA;(setq ido-max-directory-size 100000)&#xA;(ido-mode (quote both))&#xA;; Use the current window when visiting files and buffers with ido&#xA;(setq ido-default-file-method 'selected-window)&#xA;(setq ido-default-buffer-method 'selected-window)&#xA;; Use the current window for indirect buffer display&#xA;(setq org-indirect-buffer-display 'current-window)&#xA;&#xA;(defun bh/verify-refile-target ()&#xA;  &quot;Exclude todo keywords with a done state from refile targets&quot;&#xA;  (not (member (nth 2 (org-heading-components)) org-done-keywords)))&#xA;&#xA;(setq org-refile-target-verify-function 'bh/verify-refile-target)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Cheers.&lt;/p&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="2441" LastEditDate="2016-07-30T11:22:37.313" LastActivityDate="2016-07-30T11:22:37.313" Title="TAB key is not working in my Org-mode table" Tags="|init-file|org-table|org-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24937" PostTypeId="2" ParentId="12871" CreationDate="2016-07-29T18:01:54.627" Score="18" Body="&lt;p&gt;I'm using Spacemacs (on Windows 10 if that matters) with the default keybindings. This may differ from your configuration, but I found the following ways to open files via Helm-Find-Files:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Open Helm-Find-Files - &lt;kbd&gt;SPC&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;Type in filename (via tab completion etc.). Once file has been selected, there are 3 options I use for opening the file:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Option 1. &lt;kbd&gt;Tab&lt;/kbd&gt; to preview file and &lt;kbd&gt;Tab&lt;/kbd&gt; again to close the preview (stays in Helm-Find-Files)&lt;/li&gt;&#xA;&lt;li&gt;Option 2. &lt;kbd&gt;Return/Enter&lt;/kbd&gt; opens the file in the same window that I was in before calling Helm-Find-Files&lt;/li&gt;&#xA;&lt;li&gt;Option 3. &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;c&lt;/kbd&gt;&lt;kbd&gt;o&lt;/kbd&gt; opens the file in another window.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12766" LastEditorUserId="12766" LastEditDate="2017-02-16T00:44:08.970" LastActivityDate="2017-02-16T00:44:08.970" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24938" PostTypeId="1" AcceptedAnswerId="26242" CreationDate="2016-07-29T19:04:56.320" Score="1" ViewCount="341" Body="&lt;p&gt;When exporting an Org document to ConTeXt using &lt;strong&gt;Pandoc&lt;/strong&gt;, I noticed the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;( &lt;code&gt;[org code]&lt;/code&gt; → PDF output )&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;*bold*&lt;/code&gt; → &lt;strong&gt;bold&lt;/strong&gt; &lt;br&gt; &lt;code&gt;*bold,*&lt;/code&gt; → *bold,* &lt;br&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;/italics/&lt;/code&gt; → &lt;em&gt;italics&lt;/em&gt; &lt;br&gt; &lt;code&gt;/italics,/&lt;/code&gt; → /italics,/ &lt;br&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;~code~&lt;/code&gt; → &lt;code&gt;code&lt;/code&gt;&lt;br&gt; &lt;code&gt;~code,~&lt;/code&gt; → ~code,~&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that, in each case, &lt;strong&gt;a final comma breaks the formatting&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there some way of coercing the formatting into working?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Perhaps similar to &lt;a href=&quot;https://meta.stackexchange.com/a/34298/335303&quot;&gt;this hack&lt;/a&gt; for Markdown regarding code blocks and lists?)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/13820/inline-verbatim-and-code-with-quotes-in-org-mode&quot;&gt;This question&lt;/a&gt; seems concerned with the Emacs syntax highlighting, and so the fix is made from within Emacs; I'm using &lt;strong&gt;Pandoc&lt;/strong&gt; to export the Org document to ConTeXt – so I can make finer typographical adjustments. &lt;strong&gt;Therefore changing Emacs' settings won't work&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10948" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-08-13T08:44:17.457" Title="Commas don't work with Org formatting (regarding Pandoc)" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24939" PostTypeId="2" ParentId="24889" CreationDate="2016-07-29T22:39:12.770" Score="1" Body="&lt;p&gt;I simply had to make sure to add math delimiters as described in &lt;a href=&quot;http://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments&quot; rel=&quot;nofollow&quot;&gt;@LaTeX{} fragments&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\(\ang{45;23;23}\)N&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9748" LastActivityDate="2016-07-29T22:39:12.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24940" PostTypeId="1" AcceptedAnswerId="24941" CreationDate="2016-07-29T23:05:32.583" Score="22" ViewCount="6530" Body="&lt;p&gt;I'm not quite clear on all the variations of buffer-local variables, even&#xA;after reading all the doc and a bunch of postings here on SX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a summary of my understandings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(defvar foo ..)&lt;/code&gt; declares a dynamic variable for the file. But the&#xA;variable is (1) not known to other files unless they include a &lt;code&gt;defvar&lt;/code&gt;&#xA;statement as well, and (2) the variable is global in scope, not buffer&#xA;local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(make-variable-buffer-local foo)&lt;/code&gt; after the &lt;code&gt;defvar&lt;/code&gt; above tells the&#xA;compiler and everyone else that the variable foo is to be treated as&#xA;buffer-local everywhere it is set, when it is set. So this pattern is&#xA;good style for declaring a buffer-local variable, putting both statements&#xA;back-to-back in the file.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar xxx ...)                    ;declare xxx with global scope&#xA;(make-variable-buffer-local 'xxx)   ;but now make it buffer-local everywhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For convenience, the &lt;code&gt;(defvar-local xxx ...)&lt;/code&gt; form can be used as one&#xA;line, in place of the two lines above:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local xxx ...)       ;make xxx buffer local everywhere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once declared as above, the variable xxx can be used like any other&#xA;variable in setq statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I just want to have a single instance of a buffer-local variable that&#xA;is already a global dynamic variable, I would use the following&#xA;declarations. The first one declares the global-scope dynamic variable,&#xA;and the second statement makes just one instance of a buffer-local&#xA;version of that variable, in the current buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar xxx ...)             ;declare xxx with global scope&#xA;(make-local-variable 'xxx)   ;make xxx local in this buffer only&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now for my explict questions (all the above were implicit questions on&#xA;whether my understanding is correct).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When setting the value of variables, I can use &lt;code&gt;setq&lt;/code&gt; or&#xA;&lt;code&gt;setq-local&lt;/code&gt;. When should &lt;code&gt;setq-local&lt;/code&gt; be used? Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens if I use &lt;code&gt;setq-local&lt;/code&gt; on buffer-local vars, or&#xA;non-buffer-local vars?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is &lt;code&gt;setq-local&lt;/code&gt; required for a &lt;code&gt;defvar-local&lt;/code&gt; declared variable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will &lt;code&gt;setq-local&lt;/code&gt; on a normal &lt;code&gt;defvar&lt;/code&gt; declared variable turn it into a&#xA;buffer-local variable? (In other words, is &lt;code&gt;setq-local&lt;/code&gt; somehow the&#xA;equivalent of a &lt;code&gt;(make-variable-local xxx)&lt;/code&gt; declaration?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="675" LastEditDate="2016-07-30T01:36:55.460" LastActivityDate="2016-07-30T15:46:56.647" Title="What does `setq-local` do, and when should I use it?" Tags="|buffer-local|defvar|defvar-local|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24941" PostTypeId="2" ParentId="24940" CreationDate="2016-07-30T00:46:32.847" Score="25" Body="&lt;p&gt;Most of your assumptions are close.  I'll mention a few later.  But, first the main question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The form &lt;code&gt;setq-local&lt;/code&gt; is merely a convenience, it is the same as doing &lt;code&gt;make-local-variable&lt;/code&gt; followed by &lt;code&gt;setq&lt;/code&gt;.  If you had done a &lt;kbd&gt;C-h f setq-local&lt;/kbd&gt; to see the documentation and clicked through to the source you might have seen this.  That's how I verified my first impression.  The code is a little obscure, though, since it is optimizing on things like the fact that &lt;code&gt;make-local-variable&lt;/code&gt; actually returns the variable itself.  Using &lt;code&gt;setq-local&lt;/code&gt; is a way to point out the localness in some code, so that others know the code can't be playing with the global value of the variable.  You do &lt;em&gt;not&lt;/em&gt; need to use it to access local variables.  Any variable can be made buffer-local and that will affect all code that touches the variable (except if it goes out of its way to get the global copy with &lt;code&gt;setq-default&lt;/code&gt; or similar).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the primary answer.  Now, there are a few things in your background that are a little off.  Since you asked about that, I'll address some things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first is &quot;not known to other files&quot;.  This isn't really true.  Any code can reference any global variable (that's why they are called &quot;global&quot;) without including the &lt;code&gt;defvar&lt;/code&gt; (and &lt;kbd&gt;C-h f defvar&lt;/kbd&gt; says so).  In fact, there should only be &lt;strong&gt;one&lt;/strong&gt; main &lt;code&gt;defvar&lt;/code&gt; (with docstring and default value) for each global variable.  A &lt;code&gt;defvar&lt;/code&gt; with just the variable name can be used to suppress a byte-compiler warning.  Emacs only uses the value from the first one it sees¹ and the docstring from the last one.  If there are multiple &lt;code&gt;defvar&lt;/code&gt;s with value/docstring they can be confusing to people reading the code.  And the order of loading files will matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some variables are &lt;em&gt;intended&lt;/em&gt; to be used only as buffer-local and those are the ones that use &lt;code&gt;defvar-local&lt;/code&gt; (or the two part &lt;code&gt;defvar&lt;/code&gt; / &lt;code&gt;make-variable-buffer-local&lt;/code&gt; which it is short for, mostly in older code before the short form was added).  This makes it be buffer-local in all buffers.  For some variables, their primary use is not buffer-local, but for some reason you may want one buffer to have a different value.  That's when you use &lt;code&gt;make-local-variable&lt;/code&gt;, usually in some buffer setup code almost never right after a &lt;code&gt;defvar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And as a general thing, there are two purposes to the &lt;code&gt;defvar&lt;/code&gt; forms.  One is to have some documentation, so that &lt;kbd&gt;C-h v&lt;/kbd&gt; can be used by others to know what the variable is for.  The second is to declare a &quot;default&quot; value, so that the variable is always set.  The declaration of the default value only affects the global (or default) instance of a variable, and is only used if that instance is not already set to something.  That means that if you &lt;code&gt;setq&lt;/code&gt; some variable and then include the file with the &lt;code&gt;defvar&lt;/code&gt; (e.g. through a &lt;code&gt;require&lt;/code&gt;), the defvar will not change the value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;¹ &lt;sub&gt; More precisely, &lt;code&gt;defvar&lt;/code&gt; doesn't modify the value of the variable if it's already set (it does set the docstring however); this is meant so that the user's init file can do &lt;code&gt;(setq some-variable)&lt;/code&gt; before a package is loaded to override the package's default value. &lt;/sub&gt;  &lt;/p&gt;&#xA;" OwnerUserId="11699" LastEditorUserId="11699" LastEditDate="2016-07-30T15:46:56.647" LastActivityDate="2016-07-30T15:46:56.647" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24942" PostTypeId="1" AcceptedAnswerId="24944" CreationDate="2016-07-30T01:07:39.743" Score="1" ViewCount="148" Body="&lt;p&gt;How do you pass arguments to a function using lambda? I have looked through:&lt;br&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html#Argument-List&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html#Argument-List&lt;/a&gt;&lt;br&gt;&#xA;and&lt;br&gt;&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/download/highlight-chars.el&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/download/highlight-chars.el&lt;/a&gt;&lt;br&gt;&#xA;The only examples I found in the 2nd link were for tabs and whitespaces which use functions requiring no arguments.&lt;br&gt;&lt;br&gt;&#xA;Here's what I have tried so far:&#xA;&lt;br&gt;&#xA;1.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (require 'highlight-chars)&#xA;  (defun my:add-semi-colon-highlighting ()&#xA;    (add-hook 'font-lock-mode-hook&#xA;              (lambda () (hc-highlight-chars &quot;;&quot; &quot;highlight&quot;))))&#xA;&#xA;  (add-hook 'c-mode-common-hook 'my:add-semi-colon-highlighting)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (require 'highlight-chars)&#xA;  (defun my:add-semi-colon-highlighting ()&#xA;    (add-hook 'font-lock-mode-hook&#xA;              (lambda () (hc-highlight-chars (&quot;;&quot;,&quot;highlight&quot;)))))&#xA;&#xA;  (add-hook 'c-mode-common-hook 'my:add-semi-colon-highlighting)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;3.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (require 'highlight-chars)&#xA;  (defun my:add-semi-colon-highlighting ()&#xA;    (add-hook 'font-lock-mode-hook&#xA;              (lambda () (hc-highlight-chars &quot;;&quot; highlight))))&#xA;&#xA;  (add-hook 'c-mode-common-hook 'my:add-semi-colon-highlighting)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure if this should go into another question or not, but if wanted to customize the face for &quot;;&quot; (E.g red foreground and current background), how would I do that in the my:add-semi-colon-highlighting function?&lt;/p&gt;&#xA;" OwnerUserId="12807" LastEditorUserId="105" LastEditDate="2016-07-31T05:40:56.280" LastActivityDate="2016-07-31T05:40:56.280" Title="How to pass multiple arguments to hc-highlight-chars?" Tags="|highlighting|highlight-chars|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24943" PostTypeId="1" CreationDate="2016-07-30T04:58:01.600" Score="1" ViewCount="58" Body="&lt;p&gt;I have my idle timer which saves the current buffer automatically just once when idle for three seconds. It's handy but when I stop typing while in helm, it opens up a prompt that asks me where to save the helm buffer, since it's not an already existing text file. And I don't want to save helm buffers in the first place. I want this behavior to stop, i.e. I'd like this idle timer to work only in org-mode. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-07-30T04:58:01.600" Title="mode-specific idle timer?" Tags="|idle-timer|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24944" PostTypeId="2" ParentId="24942" CreationDate="2016-07-30T06:18:07.753" Score="0" Body="&lt;p&gt;#2 is not Lisp - no comma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;#1 and #3 are almost right.  And admittedly the doc for this function is a bit complex on this matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer to your general question about passing multiple arguments is to do as you did (except for #2, with the comma).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer to your specific question about &lt;code&gt;hc-highlight-chars&lt;/code&gt; is to use this code: &lt;strong&gt;&lt;code&gt;(hc-highlight-chars '(&quot;;&quot;) 'highlight)&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Interactively&lt;/em&gt;, as the doc says, you enter first the characters and then the &lt;em&gt;name&lt;/em&gt; of a face. And a name is indeed a string, such as &lt;code&gt;&quot;highlight&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But at the end of the doc string you see a description of the arguments for non-interactive use, and there it says that argument &lt;code&gt;FACE&lt;/code&gt; is a face. I've now clarified that further by adding &lt;code&gt;(e.g., a symbol)&lt;/code&gt; after it. A face is typically a symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For argument &lt;code&gt;CHARS&lt;/code&gt; things are more complex.  For that the doc says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CHARS is a possible value for `hc-other-chars', that is, a list of&#xA;entries such as described above.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you really need to consult the doc above, which explains that the spec of which chars to highlight is a &lt;em&gt;list&lt;/em&gt;, each of whose elements can take multiple forms, one of which is a &lt;em&gt;string of characters&lt;/em&gt;.  &lt;code&gt;(&quot;;&quot;)&lt;/code&gt; is a list of one element that is a string of characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look more into the code you'll see that &lt;code&gt;hc-highlight-chars&lt;/code&gt; &lt;em&gt;already&lt;/em&gt; uses &lt;code&gt;add-hook&lt;/code&gt; to add to &lt;code&gt;font-lock-mode-hook&lt;/code&gt;. It does this, for the current case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'font-lock-mode-hook&#xA;          (lambda () (hc-highlight-other-chars '(&quot;ab&quot;) nil 'highlight))  &#xA;          'APPEND)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It can help perhaps to start by using &lt;code&gt;hc-highlight-chars&lt;/code&gt; interactively, to get the hang of what it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc (the file Commentary and other doc strings) tells you more about &lt;code&gt;hc-highlight-other-chars&lt;/code&gt;, other workhorse functions, and user option &lt;code&gt;hc-other-chars&lt;/code&gt;. You might need to read it twice to understand it all well, but I think the necessary info is there.  Let me know if you find that's not the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your question about customizing a face: Do you mean how to customize face &lt;code&gt;highlight&lt;/code&gt;, which you used in your example? If so, the answer is &lt;code&gt;M-x customize-face highlight&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or did you mean create a new face to use, which has attributes that you choose?  For that, you use &lt;code&gt;defface&lt;/code&gt; -- see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Faces.html&quot; rel=&quot;nofollow&quot;&gt;Defining Faces&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or did you perhaps mean provide a face specification on the fly, without changing any existing defined face or defining a new one (&lt;code&gt;defface&lt;/code&gt;)?  You can do that this way, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(hc-highlight-chars '(&quot;;&quot;) '(:foreground &quot;red&quot; :background &quot;green&quot;))`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(This is why the doc describing the &lt;code&gt;FACE&lt;/code&gt; parameter to the function says that it is a face, without saying that it must be a symbol. A face can also be just such a property list (plist) of face attributes and their values.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-07-30T06:31:02.820" LastActivityDate="2016-07-30T06:31:02.820" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24945" PostTypeId="2" ParentId="24855" CreationDate="2016-07-30T07:07:50.997" Score="1" Body="&lt;p&gt;&lt;code&gt;C-x my-validate-json-or-js-expression&lt;/code&gt; validate the current buffer or selected region as json.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only requirement is you need install &lt;code&gt;js2-mode&lt;/code&gt;. (No, you don't need setup js2-mode. My code works out of box! we use js2-mode as API collection instead of major-mode)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-validate-json-or-js-expression (&amp;amp;optional not-json-p)&#xA;  &quot;Validate buffer or select region as JSON.&#xA;If NOT-JSON-P is not nil, validate as Javascript expression instead of JSON.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((json-exp (if (region-active-p) (buffer-substring-no-properties (region-beginning) (region-end))&#xA;                     (buffer-substring-no-properties (point-min) (point-max))))&#xA;         (jsbuf-offet (if not-json-p 0 (length &quot;var a=&quot;)))&#xA;         errs&#xA;         first-err&#xA;         (first-err-pos (if (region-active-p) (region-beginning) 0)))&#xA;    (unless not-json-p&#xA;      (setq json-exp (format &quot;var a=%s;&quot;  json-exp)))&#xA;    (with-temp-buffer&#xA;      (insert json-exp)&#xA;      (unless (featurep 'js2-mode)&#xA;        (require 'js2-mode))&#xA;      (js2-parse)&#xA;      (setq errs (js2-errors))&#xA;      (cond&#xA;       ((not errs)&#xA;        (message &quot;NO error found. Good job!&quot;))&#xA;       (t&#xA;        ;; yes, first error in buffer is the last element in errs&#xA;        (setq first-err (car (last errs)))&#xA;        (setq first-err-pos (+ first-err-pos (- (cadr first-err) jsbuf-offet)))&#xA;        (message &quot;%d error(s), first at buffer position %d: %s&quot;&#xA;                 (length errs)&#xA;                 first-err-pos&#xA;                 (js2-get-msg (caar first-err))))))&#xA;    (if first-err (goto-char first-err-pos))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The bonus tip is you can also &lt;code&gt;C-u M-x my-validate-json-or-js-expression&lt;/code&gt; to validate as javascript expression. This is only useful when you don't use js2-mode for javascript file.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-07-30T07:28:33.287" LastActivityDate="2016-07-30T07:28:33.287" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24946" PostTypeId="1" CreationDate="2016-07-30T07:58:04.297" Score="2" ViewCount="612" Body="&lt;p&gt;I am editing &lt;code&gt;org-mode&lt;/code&gt; files with a lot of source code blocks. These blocks contain my own pseudo code that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(A) {B} (C) &#xA;(D) {F} (Z)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When moving within these blocks there is a pause or delay of several seconds between movements. After that the error message &lt;code&gt;eldoc error: (error Variable binding depth exceeds max-specpdl-size)&lt;/code&gt;is displayed. First I thought the recent 25.1.1 update of railwaycat's Emacs for Mac was the culprit. But after a downgrade to the latest 24 version, the issue is still there. I then tried to rollback any package updates (with &lt;code&gt;Spacemacs&lt;/code&gt;). Alas, to no avail. What can I do? &lt;/p&gt;&#xA;" OwnerUserId="8928" LastActivityDate="2024-01-26T11:07:40.963" Title="eldoc error: (error Variable binding depth exceeds max-specpdl-size)" Tags="|org-mode|spacemacs|eldoc|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24947" PostTypeId="1" CreationDate="2016-07-30T10:00:00.483" Score="7" ViewCount="507" Body="&lt;p&gt;in AucTex math mode several symbold are already defined. Fom latex.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst LaTeX-math-default&#xA;'((?a &quot;alpha&quot; &quot;Greek Lowercase&quot; 945) ;; #X03B1&#xA;(?b &quot;beta&quot; &quot;Greek Lowercase&quot; 946) ;; #X03B2&#xA;(?g &quot;gamma&quot; &quot;Greek Lowercase&quot; 947) ;; #X03B3&#xA;(?d &quot;delta&quot; &quot;Greek Lowercase&quot; 948) ;; #X03B4&#xA;(nil &quot;sum&quot; &quot;Var Symbol&quot; 8721) ;; #X2211&#xA;(nil &quot;prod&quot; &quot;Var Symbol&quot; 8719) ;; #X220F&#xA;(nil &quot;coprod&quot; &quot;Var Symbol&quot; 8720) ;; #X2210&#xA;(nil &quot;int&quot; &quot;Var Symbol&quot; 8747) ;; #X222B&#xA;(nil &quot;oint&quot; &quot;Var Symbol&quot; 8750) ;; #X222E)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The characters with nil have no shortcut. How do I access them? Do I really have to redefine them in &lt;code&gt;latex-mode-list&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation of auctex and latex-mode-list[1] says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;First, the key to be used after LaTeX-math-abbrev-prefix for macro insertion. If it is nil, the symbol has no associated keystroke (it is available in the menu, though). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But how can I bring up this menu? And as a second question, what is the best practice to redifine the shortcut of already defined symbols?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The menu the manual is referring to is in the menu bar and just called Math.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Entries can be added by editing &lt;code&gt;LaTeX-math-list&lt;/code&gt;, which will override an entry with the same symbol present in &lt;code&gt;LaTeX-math-default&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Mathematics.html#Mathematics&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/auctex/manual/auctex/Mathematics.html#Mathematics&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="11401" LastEditorUserId="11401" LastEditDate="2016-08-02T10:57:35.183" LastActivityDate="2016-08-02T10:57:35.183" Title="Symbol menu in auctex math mode" Tags="|auctex|completion|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24948" PostTypeId="2" ParentId="3358" CreationDate="2016-07-30T10:11:46.313" Score="7" Body="&lt;p&gt;According to the variable description (see &lt;code&gt;C-h v evil-want-fine-undo&lt;/code&gt;) the value &lt;code&gt;fine&lt;/code&gt; is not supported any more due to inconsistent behaviour. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I use undo to undo typos or the mentioned setting helped my allot.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-want-fine-undo t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had trouble undoing errors in org-table formula editing, since you don't have to leave the insert mode if you want to change to &lt;code&gt;*Edit Forumlas*&lt;/code&gt; with &lt;code&gt;C-'&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12808" LastEditorUserId="12808" LastEditDate="2016-07-30T10:31:17.057" LastActivityDate="2016-07-30T10:31:17.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24949" PostTypeId="1" CreationDate="2016-07-30T12:36:18.523" Score="7" ViewCount="1763" Body="&lt;p&gt;I am trying to make a table with images and texts, then export to an odt file. How to mix text and image in org table?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-07-30T14:48:50.043" LastActivityDate="2022-02-25T15:39:28.357" Title="how to insert image in table cell in org mode" Tags="|org-mode|org-export|libreoffice|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24950" PostTypeId="2" ParentId="24924" CreationDate="2016-07-30T16:36:30.747" Score="1" Body="&lt;p&gt;This should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+author: [[http://emacs.stackexchange.com/users/563/wvxvw][wvxvw]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From looking at the source of &lt;code&gt;org-export-as&lt;/code&gt;, you can do the same for &lt;code&gt;date&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, but not &lt;code&gt;email&lt;/code&gt; fields.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-07-30T16:36:30.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24951" PostTypeId="1" AcceptedAnswerId="24988" CreationDate="2016-07-30T16:36:53.920" Score="6" ViewCount="3045" Body="&lt;p&gt;Here is a bit of Org code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here's a bit of OCaml: ~let x' = 1 in x' + x'~.&#xA;Many ~x~s in there, no?&#xA;And this one is worse: ~x ~!~ x &amp;lt;&amp;gt; 0~ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exporting to PDF yields this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/MKEk9.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MKEk9.png&quot; alt=&quot;rendered&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Escape the &lt;code&gt;'&lt;/code&gt; to fix the first line?&lt;/li&gt;&#xA;&lt;li&gt;Escape the &lt;code&gt;s&lt;/code&gt; to fix the second line?&lt;/li&gt;&#xA;&lt;li&gt;Escape the &lt;code&gt;~&lt;/code&gt; to fix the third line?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I did not find any mention of this is the org manual.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-08-08T00:51:00.660" Title="How do I escape special characters in Org mode?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24952" PostTypeId="1" AcceptedAnswerId="24953" CreationDate="2016-07-30T18:12:57.610" Score="1" ViewCount="139" Body="&lt;p&gt;I want to insert content from one file anytime a file with a particular name is opened, i have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-foo-bar(filename)&#xA;  (when (string= (file-name-nondirectory filename) &quot;foo&quot;)&#xA;    (insert-file-contents &quot;~/bar&quot;)))&#xA;&#xA;(add-hook 'find-file-hook 'insert-foo-bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However after visiting a file with C-x C-f i get a &quot;wrong number of arguments&quot; error. Can anyone tell me what am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="12812" LastEditorUserId="12812" LastEditDate="2016-07-30T18:19:38.440" LastActivityDate="2016-07-30T18:44:47.790" Title="Hook to insert content into a particular file when visited" Tags="|hooks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24953" PostTypeId="2" ParentId="24952" CreationDate="2016-07-30T18:24:14.397" Score="2" Body="&lt;p&gt;You could use this version of your function&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-foo-bar ()&#xA;  (when (string= (find-file-nondirectory buffer-file-name) &quot;foo&quot;)&#xA;    (insert-file-contents &quot;~/bar&quot;)))&#xA;&#xA;(add-hook 'find-file-hook 'insert-foo-bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or shorter&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'find-file-hook (lambda ()&#xA;  (when (string= (find-file-nondirectory buffer-file-name) &quot;foo&quot;)&#xA;    (insert-file-contents &quot;~/bar&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-07-30T18:44:47.790" LastActivityDate="2016-07-30T18:44:47.790" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24954" PostTypeId="1" CreationDate="2016-07-30T19:39:13.937" Score="4" ViewCount="732" Body="&lt;p&gt;By default, nxml-mode looks at the name of the root element and decides to validate the document against some schema based on that name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to disable this and just validate that the document is well-formed, since I edit documents in my own custom format with element names that coincides with some schema nxml-mode knows about but that is not relevant to my purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can toggle validation using &lt;code&gt;C-c&lt;/code&gt; &lt;code&gt;C-v&lt;/code&gt;, but I'd prefer to keep the check for well-formedness enabled at all times, if possible.&lt;/p&gt;&#xA;" OwnerUserId="2349" LastActivityDate="2016-07-30T19:39:13.937" Title="How to disable schema validation in nxml-mode but keep validation of well-formedness?" Tags="|nxml|xml-schema|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24955" PostTypeId="1" AcceptedAnswerId="24956" CreationDate="2016-07-30T21:27:54.090" Score="4" ViewCount="5181" Body="&lt;p&gt;Where is Emacs installed by default on Ubuntu? I need to find its path so I can use it on another application. I am using Ubuntu 14.04 and Emacs 24.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="2248" LastEditDate="2016-07-31T01:24:42.230" LastActivityDate="2016-07-31T01:24:42.230" Title="Location of Emacs' installation" Tags="|install|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24956" PostTypeId="2" ParentId="24955" CreationDate="2016-07-30T21:35:49.087" Score="10" Body="&lt;p&gt;Executing the command &lt;code&gt;which emacs&lt;/code&gt; in your terminal should tell you where it is installed.&lt;/p&gt;&#xA;" OwnerUserId="11966" LastEditorUserId="11966" LastEditDate="2016-07-30T21:39:59.587" LastActivityDate="2016-07-30T21:39:59.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24958" PostTypeId="1" CreationDate="2016-07-31T00:46:12.637" Score="19" ViewCount="24432" Body="&lt;p&gt;It's possible to install a new theme in spacemacs?&#xA;How should I do this? I'm trying to install some theme from &lt;a href=&quot;http://themegallery.robdor.com/&quot; rel=&quot;noreferrer&quot;&gt;http://themegallery.robdor.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10861" LastEditorUserId="10861" LastEditDate="2018-09-06T17:13:13.483" LastActivityDate="2020-05-08T23:46:44.387" Title="How install a custom theme to spacemacs" Tags="|spacemacs|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24959" PostTypeId="2" ParentId="24958" CreationDate="2016-07-31T00:46:12.637" Score="24" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Select your theme: &lt;a href=&quot;http://themegallery.robdor.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://themegallery.robdor.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Go to your dotfile: &lt;code&gt;SPC f e d&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Adding or edit the follow line adding our theme name(gruvbox in this example), make sure that is the first element of the list:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun dotspacemacs/init ()&#xA;  (setq-default&#xA;    ;; ... other configurations...&#xA;    dotspacemacs-themes '(gruvbox))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Reload your spacemacs: &lt;code&gt;SPC q R&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10861" LastEditorUserId="1979" LastEditDate="2020-05-08T23:46:44.387" LastActivityDate="2020-05-08T23:46:44.387" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="24960" PostTypeId="1" AcceptedAnswerId="24986" CreationDate="2016-07-31T02:00:25.433" Score="4" ViewCount="1854" Body="&lt;p&gt;I'm trying to figure out how to reference a cell from a table that is located in a different file. I know I can use &lt;code&gt;remote(tablename, @1$1)&lt;/code&gt; to reference a remote table within the same file. Is there a similar way to reference a remote table from a different file?&lt;/p&gt;&#xA;" OwnerUserId="12095" LastEditorUserId="12095" LastEditDate="2016-08-07T13:37:11.933" LastActivityDate="2016-08-07T13:37:11.933" Title="Org Mode - Reference Remote Table From a Different File" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24961" PostTypeId="1" AcceptedAnswerId="24991" CreationDate="2016-07-31T04:10:00.960" Score="1" ViewCount="302" Body="&lt;p&gt;I know I can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ulimit -v ###KiloBytes###&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to limit the virtual memory of a shell and all subprocesses started by it, but it's annoying to have to open emacs from a shell everytime just for such a limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want my REPL's and &lt;code&gt;shell-mode&lt;/code&gt; buffers to crash earlier if I run some infinite loop that tries to use up too much memory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to set a virtual memory limit from my &lt;code&gt;.emacs&lt;/code&gt; file?&lt;/p&gt;&#xA;" OwnerUserId="12818" LastEditorUserId="12818" LastEditDate="2016-07-31T04:26:48.167" LastActivityDate="2016-08-01T17:06:53.650" Title="Limit virtual memory for all emacs sub-processes" Tags="|init-file|shell|repl|" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24964" PostTypeId="1" CreationDate="2016-07-31T07:12:29.970" Score="5" ViewCount="4686" Body="&lt;p&gt;Are there emacs commands which will let me resize/move the frames/windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By frame/window I mean the GUI object that X/Windows/whateverAppleCallsIt to contain the interface to emacs. Sorry, emacs language conflicts with OS-GUI language.&lt;/p&gt;&#xA;" OwnerUserId="12819" LastActivityDate="2020-05-04T05:30:08.357" Title="Resize/move frame/window" Tags="|frames|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24965" PostTypeId="2" ParentId="24964" CreationDate="2016-07-31T09:31:58.507" Score="6" Body="&lt;p&gt;There are the built in functions &lt;code&gt;set-frame-size&lt;/code&gt;, &lt;code&gt;set-frame-height&lt;/code&gt;, &lt;code&gt;set-frame-width&lt;/code&gt; and &lt;code&gt;set-frame-position&lt;/code&gt; which let's you programmatically set the frame size and position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example &lt;code&gt;(set-frame-size (selected-frame) 300 300 t)&lt;/code&gt; would set the currently selected frame size to 300x300 pixels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to set the size interactively there is the frame-cmds package available on melpa that you can install via &lt;code&gt;M-x package-install RET frame-cmds RET&lt;/code&gt; if you have melpa in you package-archives list or download from it from &lt;a href=&quot;https://www.emacswiki.org/emacs/frame-cmds.el&quot;&gt;the emacs wiki&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11966" LastActivityDate="2016-07-31T09:31:58.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24966" PostTypeId="1" AcceptedAnswerId="24969" CreationDate="2016-07-31T14:07:20.637" Score="2" ViewCount="226" Body="&lt;p&gt;I have two OS X machines that are &quot;sharing&quot; each other right now.  I want to use emacs rather than finder to browse one machine from the other.  How do I do this?&lt;/p&gt;&#xA;" OwnerUserId="10628" LastActivityDate="2016-07-31T18:25:24.747" Title="How to browse shared Os X machine with emacs?" Tags="|osx|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24967" PostTypeId="2" ParentId="24966" CreationDate="2016-07-31T16:31:46.610" Score="3" Body="&lt;p&gt;When machines are shared on OS X, the share-points are mounted in the folder &lt;code&gt;/Volumes&lt;/code&gt;.  Type &lt;code&gt;M-x dired&lt;/code&gt; and in the mini-buffer type &lt;code&gt;/Volumes&lt;/code&gt; and press the enter/return key -- then select whichever share-point that is desired by navigating the &lt;code&gt;dired-mode&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-07-31T16:31:46.610" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24968" PostTypeId="2" ParentId="24964" CreationDate="2016-07-31T17:18:38.487" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In addition to &lt;a href=&quot;http://www.emacswiki.org/emacs/download/frame-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;frame-cmds.el&lt;/code&gt;&lt;/a&gt;, which is mentioned by @Tephra, you have library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/frame-fns.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;frame-fns.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;, on which it depends, and which provides some general frame-manipulation utility functions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Libraries &lt;a href=&quot;http://www.emacswiki.org/emacs/download/fit-frame.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;fit-frame.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; and &lt;a href=&quot;http://www.emacswiki.org/emacs/download/autofit-frame.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;autofit-frame.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;, which shrink-wrap a frame to fit the text that is in its selected window (used typically in a one-window frame).  See &lt;a href=&quot;https://www.emacswiki.org/emacs/Shrink-Wrapping_Frames&quot; rel=&quot;nofollow&quot;&gt;Shrink-Wrapping Frames&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/zoom-frm.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;zoom-frm.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; lets you easily zoom the text in a frame (or a buffer) in and out.  It extends and is more flexible than the standard Emacs text &quot;scaling&quot; provided by vanilla Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/doremi-frm.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;doremi-frm.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; provides another way to incrementally resize frames.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-31T17:18:38.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24969" PostTypeId="2" ParentId="24966" CreationDate="2016-07-31T18:25:24.747" Score="1" Body="&lt;p&gt;To access both machines from each other using a uniform syntax, then use TRAMP. For example, to open DIRED buffer on the remote machine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f /ssh:hostname:/path/to/folder RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where you can replace hostname with its IP, DNS name, or local Apple name such as hostname.local. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the same syntax to open a file directly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f /ssh:hostname:/path/to/folder/filename RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace ssh with afp if that is how your local sharing is currently configured. TRAMP offers other protocols as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This syntax becomes handy when using emacs because you can use the same script to run from either machine. The path spec will pick up the same file/folder. You won't need separate programs for each machine. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-07-31T18:25:24.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24970" PostTypeId="1" AcceptedAnswerId="24971" CreationDate="2016-07-31T18:53:01.607" Score="7" ViewCount="6325" Body="&lt;p&gt;Running &lt;code&gt;M-x hl-line-mode&lt;/code&gt; enables highlighting for the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i set highlighting current line to be enabled in &lt;code&gt;init.el&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastEditorUserId="253" LastEditDate="2017-03-13T15:15:52.813" LastActivityDate="2024-01-10T00:32:21.260" Title="Enable hl-line-mode globally" Tags="|init-file|highlighting|hl-line-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24971" PostTypeId="2" ParentId="24970" CreationDate="2016-07-31T18:56:45.303" Score="16" Body="&lt;p&gt;just add this to your .emacs or init.el file : &lt;code&gt;(global-hl-line-mode 1)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-07-31T19:54:00.253" LastActivityDate="2016-07-31T19:54:00.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24972" PostTypeId="2" ParentId="24970" CreationDate="2016-07-31T19:42:14.453" Score="11" Body="&lt;p&gt;@Chakravarthy Raghunandan answered your question completely and succinctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you owe it to yourself to learn to &lt;strong&gt;&lt;em&gt;ask Emacs&lt;/em&gt;&lt;/strong&gt; -- that will help you much more, both immediately and in the long run.  One of the goals of &lt;em&gt;this&lt;/em&gt; particular Stack-Exchange site is to help not only by answering specific questions, but by helping you learn to help yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This kind of question is answered immediately by asking the Emacs manual (&lt;code&gt;C-h r&lt;/code&gt;) what it has about &lt;code&gt;hl-line-mode&lt;/code&gt;: just type &lt;strong&gt;&lt;code&gt;i hl-line-mode&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;i&lt;/code&gt; is bound to the command &lt;code&gt;Info-index&lt;/code&gt;).  That takes you immediately to node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Cursor-Display.html&quot; rel=&quot;noreferrer&quot;&gt;Cursor Display&lt;/a&gt; of the manual, where you see this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To make the cursor even more visible, you can use HL Line mode, a minor mode that highlights the line containing point.  Use &lt;code&gt;M-x hl-line-mode&lt;/code&gt; to enable or disable it in the current buffer.  &lt;strong&gt;&lt;code&gt;M-x global-hl-line-mode&lt;/code&gt;&lt;/strong&gt; enables or disables the same mode globally.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It really couldn't be simpler, in this case.  No need to open a web browser, go to a Q&amp;amp;A site, and type up your question.  Just &lt;em&gt;ask Emacs&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have the hypertext manual(s) ready-to-hand at all times when you are in Emacs. &lt;code&gt;C-h i&lt;/code&gt; opens the manuals browser (Info) for any installed manual, including the Emacs manual and the Elisp (Emacs-Lisp) manual. If you haven't yet taken time to get to know Info, I recommend you start by looking at the Info manual about Info: &lt;code&gt;C-h i m Info&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-07-31T19:42:14.453" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24973" PostTypeId="2" ParentId="24914" CreationDate="2016-07-31T22:54:45.337" Score="1" Body="&lt;p&gt;You have to put a &lt;code&gt;syntax-table&lt;/code&gt; property on the &lt;code&gt;'&lt;/code&gt; and &lt;code&gt;&quot;&lt;/code&gt; characters, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun c-propertize-@ ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward &quot;@\\(\&quot;\\|'\\)&quot; nil t)&#xA;      (put-text-property (match-beginning 1)&#xA;                         (match-end 1)&#xA;                         'syntax-table&#xA;                         '(1))))) ;;= punctuation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Take a look at &lt;code&gt;syntax-propertize-function&lt;/code&gt;, if you also want to edit these tokens.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-07-31T22:54:45.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24974" PostTypeId="1" CreationDate="2016-08-01T03:08:24.853" Score="0" ViewCount="357" Body="&lt;p&gt;I am using &lt;code&gt;emacs 24.4&lt;/code&gt; in &lt;code&gt;-nw&lt;/code&gt; terminal mode. I know &lt;code&gt;ruby-mode&lt;/code&gt; is included but I cannot get the following snippet to indent correctly in a &lt;code&gt;.rb&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;private&#xA;    def&#xA;    end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead I can only get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;private&#xA;def&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9540" LastActivityDate="2016-08-01T03:08:24.853" Title="ruby-mode not indenting correctly?" Tags="|ruby-mode|ruby|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24975" PostTypeId="2" ParentId="21338" CreationDate="2016-08-01T03:16:44.560" Score="1" Body="&lt;p&gt;&lt;code&gt;web-mode-tag-auto-close-style&lt;/code&gt; got renamed to &lt;code&gt;web-mode-auto-close-style&lt;/code&gt; in this commit &lt;a href=&quot;https://github.com/fxbois/web-mode/commit/c17be6c4900fdfe4e996552efc39bdff782c6585&quot; rel=&quot;nofollow&quot;&gt;https://github.com/fxbois/web-mode/commit/c17be6c4900fdfe4e996552efc39bdff782c6585&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12829" LastEditorUserId="1979" LastEditDate="2016-08-01T14:28:30.207" LastActivityDate="2016-08-01T14:28:30.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24976" PostTypeId="1" CreationDate="2016-08-01T04:17:37.200" Score="3" ViewCount="2886" Body="&lt;p&gt;I'm new to org-mode (and emacs in general), and have been trying to follow the tutorials and manuals to set up a GTD-like system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have an &quot;inbox.org&quot; file with two first-level headings (&quot;Inbox&quot; and &quot;Processing&quot;). I also have a &quot;todo.org&quot; file with a &quot;Projects&quot; heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've set up &lt;code&gt;org-refile-targets&lt;/code&gt; so that any task in inbox.org can be refiled to todo.org. When I refile something, it shows me all the headings in all my org files to choose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what I'd really like to do is have the refile targets change based on the heading or file I'm currently in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for example, for tasks under the &quot;Inbox&quot; heading, the only refile target available should be &quot;Processing&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For tasks under &quot;Processing&quot;, the only refile targets available should be &quot;Projects&quot;, &quot;Someday&quot; (goes to a someday.org file), or &quot;Reference&quot; (goes to a reference.org file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way, I can create sort of a directional &quot;workflow&quot; to enforce the GTD decision model. Is it possible to set this up with org-mode?&lt;/p&gt;&#xA;" OwnerUserId="12830" LastActivityDate="2020-05-31T17:04:00.793" Title="Org-mode: Can you set up context-dependent refile targets?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24977" PostTypeId="2" ParentId="24976" CreationDate="2016-08-01T08:58:24.270" Score="1" Body="&lt;p&gt;&lt;code&gt;org-refile&lt;/code&gt; uses a &lt;code&gt;rfloc&lt;/code&gt; argument that, after reading the docstring, unfortunately remains mysterious. &lt;a href=&quot;https://emacs.stackexchange.com/a/8049/5385&quot;&gt;This answer&lt;/a&gt; clarifies how &lt;code&gt;rfloc&lt;/code&gt; should look like. The following function sets the &lt;code&gt;rfloc&lt;/code&gt; based on a FILE argument, that is the target file, a HEADING argument, specifying the target heading the current heading should be refiled to (must be exact, meaning you have to include tags and todo states if there are any), and a PARENT argument that describes the top-level heading whose subitems will be refiled to that target:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-refile-enh (file heading parent &amp;amp;optional arg default-buffer msg)&#xA;  &quot;Refile entries with top-level PARENT under the (exact) HEADING in FILE.&quot;&#xA;  (let ((rfloc&#xA;         (if (equal parent&#xA;              (save-excursion&#xA;                (re-search-backward &quot;^\* &quot; nil 'noerror 1)&#xA;                (nth 4 (org-heading-components))))&#xA;             `(,heading&#xA;               ,file&#xA;               nil&#xA;               ,(with-current-buffer (find-file-noselect file)&#xA;                  (org-find-exact-headline-in-buffer heading))))))&#xA;    (org-refile arg default-buffer rfloc msg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your case, refiling subitems from &quot;Inbox&quot; under the &quot;Processing&quot; heading in the same file would be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-refile-enh &quot;~/path/to/inbox.org&quot; ;target file&#xA;                &quot;Processing&quot;          ;target heading&#xA;                &quot;Inbox&quot;               ;top-level heading of refiled item&#xA;                )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-08-01T08:58:24.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24978" PostTypeId="1" CreationDate="2016-08-01T10:24:46.527" Score="2" ViewCount="172" Body="&lt;p&gt;When &lt;code&gt;semantic-stickyfunc-mode&lt;/code&gt; is activated, the tabbar tabs are not visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to write a function that show the tabs 2 seconds and then goes to &lt;code&gt;semantic-stickyfunc-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried with this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;     (defun timer-local-tabbar-show()&#xA;        (if (eq major-mode 'python-mode)&#xA;            (progn&#xA;              (tabbar-local-mode -1)&#xA;              (run-with-timer 2 nil (lambda () (tabbar-local-mode 1))))))&#xA;      (add-hook 'window-configuration-change-hook 'timer-local-tabbar-show)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The tabs are shown, and then disappear (good ;-), but &lt;code&gt;semantic-stickyFunc-mode&lt;/code&gt; doesn't work (while &lt;code&gt;semantic-stickyFunc-mode&lt;/code&gt; variable is 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-header-line-format nil)&#xA;  (defun timer-local-tabbar-show()&#xA;    (if (eq major-mode 'python-mode)&#xA;        (progn&#xA;          (setq my-header-line-format header-line-format)&#xA;          (tabbar-local-mode -1)&#xA;          (run-with-timer 1.5 nil&#xA;                          (lambda ()&#xA;                            (tabbar-local-mode 1)&#xA;                            (setq header-line-format my-header-line-format)&#xA;                            (redisplay)&#xA;                            )))))&#xA;  (add-hook 'window-configuration-change-hook 'timer-local-tabbar-show)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This version works better (thanks &lt;code&gt;lawlist&lt;/code&gt;) but there are somme persistent random problems.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2016-08-02T06:48:18.723" LastActivityDate="2016-08-02T06:48:18.723" Title="tabbar-local-mode vs semantic-stickyfunc-mode" Tags="|tabbar|semantic|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24981" PostTypeId="1" CreationDate="2016-08-01T15:22:11.667" Score="5" ViewCount="467" Body="&lt;p&gt;&lt;em&gt;(I'm a rookie and I use Spacemacs)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to find the source of a certain function*.  I can find the &lt;code&gt;.el&lt;/code&gt; file in which it's defined by using &lt;code&gt;find-function&lt;/code&gt;, however the &lt;code&gt;defun&lt;/code&gt; is created dynamically using a macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way to show the source of the function as it exists now, after the macro has created it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(* Specifically though I don't think it matters: &lt;code&gt;spacemacs/align-repeat-bar&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="10055" LastActivityDate="2016-08-02T09:34:07.503" Title="Finding the source of a function after macro expansion?" Tags="|elisp|functions|elisp-macros|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24982" PostTypeId="2" ParentId="23955" CreationDate="2016-08-01T15:30:29.783" Score="1" Body="&lt;p&gt;This currently isn't possible in Magit. If you open a feature request, then I will consider adding such a feature, but I cannot promise that we will do so or even that we will do so soon.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-08-01T15:30:29.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24983" PostTypeId="2" ParentId="23966" CreationDate="2016-08-01T15:39:22.787" Score="2" Body="&lt;p&gt;I likely won't be adding this feature to the current implementation in &lt;code&gt;magit-popup.el&lt;/code&gt; but I will consider adding it to the planned successor &lt;code&gt;transient&lt;/code&gt;. See the open &lt;a href=&quot;https://github.com/magit/magit/issues/2700&quot; rel=&quot;nofollow&quot;&gt;issue #2700&lt;/a&gt; on Github for more information.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-08-01T15:39:22.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24984" PostTypeId="1" AcceptedAnswerId="24993" CreationDate="2016-08-01T15:48:24.117" Score="8" ViewCount="2316" Body="&lt;p&gt;Many versions ago, if you opened a dos-line-end file on Linux you would see the extra &lt;code&gt;^M&lt;/code&gt; codes. Now it automatically recognizes the situation and puts &quot;DOS&quot; in the info bar and hides the extra &lt;code&gt;^M&lt;/code&gt;s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I exit &quot;DOS&quot; mode and switch back to Unix mode? How can I disable the auto-detection and force the files to be opened with Unix line endings and the DOS CR shown as &lt;code&gt;^M&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12834" LastEditorUserId="12834" LastEditDate="2016-08-01T20:40:29.090" LastActivityDate="2018-02-03T13:17:16.280" Title="how to disable automatic dos mode?" Tags="|init-file|mode-line|linux|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24985" PostTypeId="2" ParentId="24981" CreationDate="2016-08-01T15:51:52.177" Score="0" Body="&lt;p&gt;Macros don't really work dynamically. Reader macros work at read time - reader transforms some reader macro call into code, and during compilation before application macros are replaced with code, creating &quot;static&quot; code - and the same static code is there after compilation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can't really see the static code, because it isn't there: macro will create it. Also, you can't plug into the compilation after the code has been generated and check what's there; however, you can use &lt;code&gt;macroexpand&lt;/code&gt;. I don't have spacemacs and can't test it, but I would guess that if you run &lt;code&gt;(macroexpand (quote *your-macro-here*))&lt;/code&gt; it should print you an expanded version.&lt;/p&gt;&#xA;" OwnerUserId="405" LastEditorUserId="405" LastEditDate="2016-08-02T09:34:07.503" LastActivityDate="2016-08-02T09:34:07.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24986" PostTypeId="2" ParentId="24960" CreationDate="2016-08-01T16:11:13.397" Score="4" Body="&lt;p&gt;It's a bit tricky and a patch towards accepting the &quot;normal&quot; &lt;code&gt;file::name&lt;/code&gt; syntax would definitely be appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, to refer to a remote file you must use the ID cf. &lt;code&gt;org-table-get-remote-range&lt;/code&gt;.  I don't know if it was always the case, but IDs seem to be linked to headings now.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Example with &lt;code&gt;org-id&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;First: &lt;code&gt;(require 'org-id)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create two files in &lt;code&gt;/tmp&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rasmus:[tmp] $ cat a.org&#xA;* foo&#xA;#+name: tab-1&#xA;| a | 1 |&#xA;| b | 2 |&#xA;| c | 3 |&#xA;&#xA;rasmus:[tmp] $ cat b.org&#xA;| x | 4 |  |&#xA;| y | 5 |  |&#xA;| z | 6 |  |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;a.org&lt;/code&gt; place the cursor somewhere under &lt;code&gt;* foo&lt;/code&gt; and do &lt;code&gt;M-x org-id-get-create&lt;/code&gt;.  This will add an &lt;code&gt;ID&lt;/code&gt; property to &lt;code&gt;* foo&lt;/code&gt; and store the location in &lt;code&gt;~/.emacs.d/.org-id-locations&lt;/code&gt; or similar.  In my case the &lt;code&gt;ID&lt;/code&gt; is &lt;code&gt;58efda96-fc03-4c25-91e3-30c987959618&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now in &lt;code&gt;b.org&lt;/code&gt; you can use the &lt;code&gt;ID&lt;/code&gt; as the first argument to your &lt;code&gt;REMOTE&lt;/code&gt; call.&#xA;E.g. to copy the second column in the table in &lt;code&gt;a.org&lt;/code&gt; to the third column in the table in &lt;code&gt;b.org&lt;/code&gt; you could use this formula: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: $3=remote(58efda96-fc03-4c25-91e3-30c987959618, @@#$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my files now look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rasmus:[tmp] $ cat a.org&#xA;* foo&#xA;:PROPERTIES:&#xA;:ID:       58efda96-fc03-4c25-91e3-30c987959618&#xA;:END:&#xA;#+name: tab-1&#xA;| a | 1 |&#xA;| b | 2 |&#xA;| c | 3 |&#xA;&#xA;rasmus:[tmp] $ cat b.org&#xA;| x | 4 | 1 |&#xA;| y | 5 | 2 |&#xA;| z | 6 | 3 |&#xA;#+TBLFM: $3=remote(58efda96-fc03-4c25-91e3-30c987959618, @@#$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Caveats&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;AFAIR you could once assign an &lt;code&gt;#+ID:&lt;/code&gt; to a table, but this is gone.  Thus, you might only be able to refer to the first table in a second.  I didn't test this.   I think remote referencing is nice, but it would be great if someone would add standard &lt;code&gt;org-link-search&lt;/code&gt; support.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Only at export time&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you only need to update the table in &lt;code&gt;c.org&lt;/code&gt; at export time you could &lt;code&gt;#+include&lt;/code&gt; the table in an &lt;code&gt;noexport&lt;/code&gt; heading and use the standard &lt;code&gt;#+name&lt;/code&gt; reference.  You'd need to update tables at export time.  There's probably a more elegant way than the one proposed in &lt;code&gt;c.org&lt;/code&gt; below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rasmus:[tmp] $ cat c.org &#xA;| x | 4 |   |&#xA;| y | 5 |   |&#xA;| z | 6 |   |&#xA;#+TBLFM: $3=remote(tab-1, @@#$2)&#xA;&#xA;* misc                                                             :noexport:&#xA;#+include: &quot;a.org::tab-1&quot;&#xA;#+begin_src emacs-lisp&#xA;  (add-hook 'org-export-before-parsing-hook&#xA;            (defun rasmus/ox-update-tbl (backend)&#xA;              (when (re-search-forward org-table-line-regexp nil t)&#xA;                (org-table-recalculate t))))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-08-01T16:11:13.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24987" PostTypeId="2" ParentId="24981" CreationDate="2016-08-01T16:16:09.257" Score="6" Body="&lt;p&gt;&lt;code&gt;find-function&lt;/code&gt; won't find macro-generated function definitions due to limitations of Emacs &lt;code&gt;load-history&lt;/code&gt; and the workarounds &lt;code&gt;find-function&lt;/code&gt; has to resort to.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;find-function&lt;/code&gt; has to explicitly search for the actual source code location of a function definition because Emacs only tracks the defining library but not the actual location of the definition during reading and evaluation. It uses the regular expression in &lt;code&gt;find-function-regexp&lt;/code&gt; which matches a couple of known built-in forms that define functions but knows nothing of 3rd party libraries that might also define functions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturally &lt;code&gt;find-function&lt;/code&gt; will thus fail to find any defining form which doesn't match &lt;code&gt;find-function-regexp&lt;/code&gt;, which implies that it fails for almost all 3rd party macros that define functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can manually add these to &lt;code&gt;find-function-regexp&lt;/code&gt; however. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More detailed background information follows:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To track where exactly symbol cells are filled (with function definitions for instance) Emacs would have to track source file positions in a way to preserve locations through reading up to &lt;code&gt;eval&lt;/code&gt; which it currently simply doesn't do—just take a look at compiled byte code (i.e. after read, but before evaluation), there are no source positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be able to track loads (and thus be able to unload features and find definitions) Emacs has a &lt;code&gt;load-history&lt;/code&gt; instead where certain forms (such as &lt;code&gt;defun&lt;/code&gt;) leave entries during &lt;em&gt;evaluation&lt;/em&gt;.  When Emacs loads a library it puts a new entry into &lt;code&gt;load-history&lt;/code&gt; and all &lt;code&gt;defun&lt;/code&gt; and related forms in the library being loaded add to that entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in this way Emacs only knows about the library that defined a function but not about the actual position of the source of the function within the library.  &lt;code&gt;find-function&lt;/code&gt; has to workaround the lack of this information, and it does so in a very dumb way: It visits the source library file, goes to the beginning of the buffer… and runs a &lt;strong&gt;literal search&lt;/strong&gt; for a pattern that could match the definition of the function.  In other words it does &lt;strong&gt;&lt;code&gt;C-s &amp;lt;THE-NAME-OF-THE-FUNCTION&amp;gt;&lt;/code&gt;&lt;/strong&gt;, just with a slightly more sophisticated pattern which you can actually inspect—and change, fwiw—in &lt;code&gt;find-function-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take a look at the pattern you'll see that it quite literally looks for certain known forms that define functions, including &lt;code&gt;defun&lt;/code&gt;, &lt;code&gt;define-minor-mode&lt;/code&gt; and a couple of related forms, and thus it'll fail to find functions defined by macros whose names don't match that pattern.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-08-01T16:16:09.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24988" PostTypeId="2" ParentId="24951" CreationDate="2016-08-01T16:23:21.570" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Escape the ' to fix the first line?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Works for me with the development version.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Escape the s to fix the second line?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't think that's possible ATM in Org syntax.  You might need something like &lt;code&gt;@@latex:\texttt{x}s@@&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Escape the ~ to fix the third line?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=x ~!~ x &amp;lt;&amp;gt; 0=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-08-01T16:23:21.570" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24989" PostTypeId="2" ParentId="24949" CreationDate="2016-08-01T16:27:35.147" Score="4" Body="&lt;p&gt;Like this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| &amp;lt;c&amp;gt;                       |&#xA;| text                      |&#xA;| [[file:~/images/img.png]] |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-08-01T16:27:35.147" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24990" PostTypeId="2" ParentId="24889" CreationDate="2016-08-01T16:33:15.070" Score="1" Body="&lt;p&gt;Disable entities.&#xA;Or if you want to keep using entities remove the &quot;ang&quot; entry.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org-entities&#xA;  (setq org-entities&#xA;        (cl-remove-if (lambda (x) (and (listp x) (equal (car x) &quot;ang&quot;))) org-entities)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-08-01T16:33:15.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24991" PostTypeId="2" ParentId="24961" CreationDate="2016-08-01T17:06:53.650" Score="1" Body="&lt;p&gt;I'm not aware that Emacs exposes system calls to change resource limits. Generally Emacs' exposure of specific OS calls is very limited beyond the basic UNIX interface and even there it's lacking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm afraid that you cannot change these limits from within Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll have to look at cgroups or whatever your OS provides to configure resource usage of processes externally.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-08-01T17:06:53.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24992" PostTypeId="1" AcceptedAnswerId="25020" CreationDate="2016-08-01T17:53:09.340" Score="6" ViewCount="2218" Body="&lt;p&gt;Suppose I have an &lt;code&gt;archive/&lt;/code&gt; folder, which contains several .org_archive files, each for a specific month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I archive a task in org-mode, is there a way to make it so that the task is automatically archived to the appropriate archive file, based on the current month?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I complete a task on 07/31/2016, archiving the task should move it to &lt;code&gt;archive/archive-201607.org_archive&lt;/code&gt;. The next day, on 08/01/2016, archiving another task should move it to &lt;code&gt;archive/archive-201608.org_archive&lt;/code&gt;. If the appropriate file for the month doesn't exist, org-mode should create one.&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2018-05-16T10:23:17.380" Title="Archiving completed tasks to an archive file based on the current date in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24993" PostTypeId="2" ParentId="24984" CreationDate="2016-08-01T18:40:58.433" Score="7" Body="&lt;p&gt;From the &lt;a href=&quot;https://www.emacswiki.org/emacs/EndOfLineTips&quot; rel=&quot;noreferrer&quot;&gt;https://www.emacswiki.org/emacs/EndOfLineTips&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can reopen the file with the correct line ending with a command like &lt;code&gt;M-x revert-buffer-with-coding-system utf-8-dos&lt;/code&gt;. If your file is not in Unicode, be sure to specify the correct encoding system instead of &lt;code&gt;utf-8-dos&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Dos uses &lt;code&gt;CR+LF&lt;/code&gt; end of line, when UNIX uses only &lt;code&gt;LF&lt;/code&gt;. &lt;code&gt;CR&lt;/code&gt; sometimes looks like &lt;code&gt;^M&lt;/code&gt;. For viewing &lt;code&gt;^M&lt;/code&gt; you must use &lt;code&gt;M-x revert-buffer-with-coding-system utf-8-unix&lt;/code&gt;. This will use &lt;code&gt;LF&lt;/code&gt; as end of line and indicate &lt;code&gt;CR&lt;/code&gt; like &lt;code&gt;^M&lt;/code&gt; instead of Dos which uses &lt;code&gt;CR+LF&lt;/code&gt; as end of line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disable autodetect: not sure it needs. If you want to convert files into UNIX format, then open DOS file and set line ending with &lt;code&gt;M-x set-buffer-file-coding-system utf-8-unix&lt;/code&gt;, this command will convert all &lt;code&gt;CR+LF&lt;/code&gt; into &lt;code&gt;LF&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can edit the file, you could open file with a certain coding system with &lt;code&gt;-*- coding: utf-8-unix; -*-&lt;/code&gt; at the first or second line in the file.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-08-02T05:14:33.457" LastActivityDate="2016-08-02T05:14:33.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24994" PostTypeId="1" CreationDate="2016-08-01T18:47:40.250" Score="6" ViewCount="254" Body="&lt;p&gt;Magit implements multi-key bindings in a nonstandard way: the first key runs a command that displays a “popup”, i.e. a buffer in a special mode that displays usage instructions, and the second key is bound in that special mode. That second key invokes &lt;code&gt;magit-invoke-popup-action&lt;/code&gt; which looks up the event that invoked it in a table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This breaks Emacs's help mechanism: if I want to know what command a key binding invokes, &lt;kbd&gt;C-h c&lt;/kbd&gt; or &lt;kbd&gt;C-h k&lt;/kbd&gt; isn't helpful. If I use these commands before the first key (the one that brings the popup), I get the help for the command that displays the popup (e.g. &lt;kbd&gt;C-h c c&lt;/kbd&gt; → “c runs the command magit-commit-popup”). If I use these commands before the second key (the one that runs in the popup buffer), I get the help for the generic second-key lookup function (e.g. &lt;kbd&gt;c C-h c c&lt;/kbd&gt; → “c runs the command magit-invoke-popup-action”). And if I want to look up the key that invokes a command, &lt;kbd&gt;C-h w&lt;/kbd&gt; truthfully tells me that the command isn't bound to any key — it's hidden behind the popup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find out Magit's key binding information from within Emacs? I am not interested in loading the documentation in Info and searching through it. I want to obtain the information automatically, following Emacs's self-documented principles, and accurately even if the documentation isn't up-to-date or I'm using customized key bindings.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="306" LastEditDate="2016-08-31T10:43:38.730" LastActivityDate="2016-08-31T10:43:38.730" Title="Key binding help for magit popup-based commands" Tags="|key-bindings|magit|help|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24995" PostTypeId="1" CreationDate="2016-08-01T18:57:55.403" Score="4" ViewCount="634" Body="&lt;p&gt;When I complete a task and move its todo state to &quot;Done&quot;, it adds the date the task was completed. Later during the weekend, I might archive these &quot;Done&quot; tasks so that they are moved into an .org_archive file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to view these archived tasks in a few different ways, namely by project structure and by completion date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have a project like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO My Project&#xA;*** TODO Task 1&#xA;*** TODO Task 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say I complete Task 1, and then Task 2, which also completes the entire project. In my archive file, I would have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE Task 1&#xA;  CLOSED: [some date]&#xA;  :PROPERTIES:...&#xA;* DONE Task 2&#xA;  CLOSED: [some date]&#xA;  :PROPERTIES:...&#xA;* DONE My Project&#xA;  CLOSED: [some date]&#xA;  :PROPERTIES:...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is useful for keeping a log of archived items, usually sorted by completion date. However, if completing Task 2 takes place several months after Task 1, it becomes difficult to recall what project Task 1 and 2 belong to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to &quot;sort&quot; the archive file such that I could view it both as a completion log (sorted by &quot;CLOSED&quot; date), &lt;em&gt;as well as&lt;/em&gt; sorting the file as to retain the project structure, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** DONE My Project&#xA;   CLOSED: [some date]&#xA;   :PROPERTIES:...&#xA;*** DONE Task 1&#xA;    CLOSED: [some date]&#xA;    :PROPERTIES:...&#xA;*** DONE Task 2&#xA;    CLOSED: [some date]&#xA;    :PROPERTIES:...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12837" LastEditorUserId="12837" LastEditDate="2016-08-03T19:13:18.923" LastActivityDate="2016-09-07T13:07:38.637" Title="Sorting an archive file while preserving headline structure in org-mode" Tags="|org-mode|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24996" PostTypeId="1" CreationDate="2016-08-01T19:26:11.807" Score="1" ViewCount="57" Body="&lt;p&gt;When I have four windows visible and I want to move from one to another, I use &lt;code&gt;C-x o&lt;/code&gt;.  But that cycles through the windows in a predetermined order, namely:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1  3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2  4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without intending to do so, just because my brain and fingers go on auto-pilot, I've fallen into the weird habit of using a combination of &lt;code&gt;C-x 0&lt;/code&gt;, &lt;code&gt;C-x 1&lt;/code&gt;, &lt;code&gt;C-x 2&lt;/code&gt;, &lt;code&gt;C-x 3&lt;/code&gt;, and &lt;code&gt;bury-buffer&lt;/code&gt; (which I've bound to &lt;code&gt;C-x c&lt;/code&gt;) to select the buffer I want while keeping them in a chosen order. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a more direct way for me to move from window 1, say, to window 4?&lt;/p&gt;&#xA;" OwnerUserId="10628" LastEditorUserId="105" LastEditDate="2016-08-10T21:13:13.333" LastActivityDate="2016-08-10T21:13:13.333" Title="Choose window to select when there are more than two visible" Tags="|window|" AnswerCount="1" CommentCount="3" ClosedDate="2016-08-27T14:01:31.583" ContentLicense="CC BY-SA 3.0" />
  <row Id="24997" PostTypeId="2" ParentId="24996" CreationDate="2016-08-01T19:35:10.370" Score="1" Body="&lt;p&gt;You can achieve the behaviour you want using &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;nofollow&quot;&gt;ace-window package&lt;/a&gt;.&#xA;Calling &lt;code&gt;ace-window&lt;/code&gt; (if you have just two windows open, will just switch to the other window) will highlight the first character of each window and pressing said character will switch you to that buffer. Here's a &lt;a href=&quot;http://oremacs.com/download/ace-window.gif&quot; rel=&quot;nofollow&quot;&gt;gif&lt;/a&gt; demonstrating how it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;a href=&quot;https://github.com/abo-abo/avy&quot; rel=&quot;nofollow&quot;&gt;avy&lt;/a&gt; package to switch between open windows.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-08-01T20:10:10.073" LastActivityDate="2016-08-01T20:10:10.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24999" PostTypeId="1" CreationDate="2016-08-01T21:42:37.987" Score="3" ViewCount="454" Body="&lt;p&gt;I have an org-mode document that I am exporting to reveal.js via &lt;a href=&quot;https://github.com/yjwen/org-reveal&quot; rel=&quot;nofollow&quot;&gt;org-reveal&lt;/a&gt;.&#xA;Currently, I do a &lt;code&gt;(require 'ox-reveal)&lt;/code&gt;  and then I can do &lt;code&gt;C-e R R&lt;/code&gt; from within my org-mode document.&#xA;I am wondering how I can script this so I can do this from within bash.&#xA;I currently have a bash script for a related project that does uses batch mode as follows,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;emacs my-doc.org --batch -f org-html-export-to-html --kill&#xA;&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering how to adapt this to org-reveal.&#xA;Part of the problem is making sure &lt;code&gt;(require 'ox-reveal)&lt;/code&gt; happens in batch mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking forward to any pointers here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12839" LastEditorUserId="12839" LastEditDate="2016-08-01T22:52:46.717" LastActivityDate="2016-09-01T10:15:37.310" Title="Automating org-mode export with org-reveal exporter" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25000" PostTypeId="2" ParentId="24994" CreationDate="2016-08-01T21:45:28.553" Score="5" Body="&lt;p&gt;You can use &lt;kbd&gt;? &amp;lt;key&amp;gt;&lt;/kbd&gt;. Inside popups &lt;kbd&gt;?&lt;/kbd&gt; is bound to &lt;code&gt;magit-popup-help&lt;/code&gt;. It would make sense for &lt;kbd&gt;C-h k&lt;/kbd&gt; to be bound to that command too. So I have done that now.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-08-01T23:14:24.423" LastActivityDate="2016-08-01T23:14:24.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25001" PostTypeId="1" CreationDate="2016-08-01T22:41:11.547" Score="2" ViewCount="210" Body="&lt;p&gt;I've debugged to this point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;OS X El Capitan (10.11.5)&#xA;Emacs 24.5.1 with Cocoa (installed from homebrew)&#xA;python.el 0.24.5&#xA;Python 3.5.1&#xA;IPython 5.0.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've configured IPython to use &lt;code&gt;NoColor&lt;/code&gt; mode in the default config file.  I start Emacs with this command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;open -a /Applications/Emacs.app --args -Q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Change the initial buffer to &lt;code&gt;python-mode&lt;/code&gt; and say &lt;code&gt;run-python&lt;/code&gt;.  After some boilerplate I get to the prompt I expect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From here I launch IPython with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import IPython&#xA;&amp;gt;&amp;gt;&amp;gt; IPython.terminal.ipapp.launch_new_instance()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after some more boilerplate I get to this prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^[[?12l^[[?25h&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;do&lt;/em&gt; have &lt;code&gt;ansi-color-for-comint-mode&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't get this prompt when I launch IPython from Terminal.app, so I'm thinking it's an issue with comint processing some IPython-specific control codes.  But I'm not sure how to dig into that.  Any advice?&lt;/p&gt;&#xA;" OwnerUserId="372" LastEditorUserId="253" LastEditDate="2016-08-25T12:27:57.690" LastActivityDate="2016-08-25T12:27:57.690" Title="How do I filter for IPython prompt characters on Mac OS?" Tags="|ipython|comint|" AnswerCount="1" CommentCount="1" ClosedDate="2016-08-02T08:40:21.570" ContentLicense="CC BY-SA 3.0" />
  <row Id="25002" PostTypeId="2" ParentId="24263" CreationDate="2016-08-01T22:51:51.540" Score="2" Body="&lt;p&gt;&lt;code&gt;magit-pull-from-upstream&lt;/code&gt; does not explicitly specify the remote branch because if we did that, then tags that point to commits that are being pulled would not be pulled along with the branch (i.e. the commits and the branch ref).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a while (&lt;code&gt;2.?&lt;/code&gt; to &lt;code&gt;2.6.2&lt;/code&gt;) the remote branch was explicitly specified for safety reasons, but I went back to not specifying the remote branch after a user pointed out the above issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;magit-pull-from-pushremote&lt;/code&gt; does specify the remote branch because in that case it has to be specified or it might pull from &lt;code&gt;branch.NAME.merge&lt;/code&gt; (i.e. the upstream) instead of the branch &quot;with the same name as the local branch&quot;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To limit what branches are being pulled by git's dwim pull command (&lt;code&gt;git pull&lt;/code&gt; or &lt;code&gt;git pull REMOTE&lt;/code&gt;) and by extension &lt;code&gt;magit-pull-from-upstream&lt;/code&gt;, configure &lt;code&gt;remote.NAME.fetch&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2020-06-12T21:57:20.333" LastActivityDate="2020-06-12T21:57:20.333" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="25003" PostTypeId="2" ParentId="24030" CreationDate="2016-08-01T23:12:43.360" Score="35" Body="&lt;p&gt;Magit does not provide a command that does &lt;code&gt;git rm&lt;/code&gt; (but if you opened a feature request, then I would probably add it eventually).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile you can delete the file using some other method, e.g. using &lt;kbd&gt;M-x delete-file RET &amp;lt;file&amp;gt; RET&lt;/kbd&gt;. Once you have done that refresh the Magit buffer using &lt;kbd&gt;g&lt;/kbd&gt; and then stage the &quot;deletion&quot; of the file by moving to it in the list of unstaged changes and then pressing &lt;kbd&gt;s&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-08-01T23:12:43.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25007" PostTypeId="2" ParentId="25001" CreationDate="2016-08-02T02:07:42.987" Score="1" Body="&lt;p&gt;I don't have a specific answer, but in general, I tell Python and IPython (which I run directly) to use a simpler prompt. This is part of my &lt;code&gt;elpy&lt;/code&gt; setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter &quot;ipython&quot;&#xA;      python-shell-interpreter-args &quot;--pylab=qt4 --pdb --nosep --classic&quot;&#xA;      python-shell-prompt-regexp &quot;&amp;gt;&amp;gt;&amp;gt; &quot;&#xA;      python-shell-prompt-output-regexp &quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-08-02T02:07:42.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25008" PostTypeId="1" CreationDate="2016-08-02T04:20:30.360" Score="0" ViewCount="243" Body="&lt;p&gt;Using the following command line causes Emacs to briefly display the initial frame, then hide it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q --eval &quot;(setq initial-frame-alist '((visibility . nil)))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is consistent with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Initial-Parameters.html#Initial-Parameters&quot; rel=&quot;nofollow&quot;&gt;the manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If these settings affect the frame geometry and appearance, you’ll see the frame appear with the wrong ones and then change to the specified ones. If that bothers you, you can specify the same geometry and appearance with X resources; those do take effect before the frame is created. See X Resources in The GNU Emacs Manual.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which X resource should I use to make the initial frame invisible? Is there a cross-platform way to do so? On GNU/Linux, how can I set these resources for the duration of a single command?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-08-02T04:20:30.360" Title="How can I make the initial frame invisible?" Tags="|frames|start-up|x-resources|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25009" PostTypeId="1" CreationDate="2016-08-02T04:30:24.953" Score="3" ViewCount="118" Body="&lt;p&gt;Loading a theme in batch mode seems to not set face attributes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q --eval &quot;(load-theme 'tango t)&quot; \&#xA;           --eval &quot;(prin1 (face-attribute 'font-lock-keyword-face :foreground)))&quot;&#xA;&quot;#346604&quot;&#xA;&#xA;$ emacs --batch -Q --eval &quot;(load-theme 'tango t)&quot; \&#xA;                   --eval &quot;(prin1 (face-attribute 'font-lock-keyword-face :foreground)))&quot;&#xA;unspecified&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What should I do to make sure that &lt;code&gt;load-theme&lt;/code&gt; works as expected in batch mode, and in particular that face attributes are the same as in interactive mode?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-08-02T04:30:24.953" Title="Loading a theme and fontifying in batch mode" Tags="|faces|themes|batch-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25011" PostTypeId="1" CreationDate="2016-08-02T07:01:31.613" Score="1" ViewCount="72" Body="&lt;p&gt;I am using &lt;code&gt;js2-mode&lt;/code&gt; as well as &lt;code&gt;electric-pair-mode&lt;/code&gt; and &lt;code&gt;autocomplete&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I create a function using &lt;code&gt;function () {&lt;/code&gt; and press &lt;code&gt;enter&lt;/code&gt; the second curly brace is made on the next line but my cursor is placed on the same line, right next to it.  I wind up with something that looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function test () {&#xA;*} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where my cursor is where the &lt;code&gt;*&lt;/code&gt; is.  I am used to behavior that would leave it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function test () {&#xA;   *&amp;lt;-cursor here&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to re-enable that?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2016-08-02T07:01:31.613" Title="How to mark / cursor inside of curly braces when opening set of curly braces" Tags="|auto-complete-mode|js2-mode|electric-pair-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25012" PostTypeId="1" CreationDate="2016-08-02T08:23:57.653" Score="6" ViewCount="1134" Body="&lt;p&gt;I'm using &lt;em&gt;mu4e&lt;/em&gt; for my e-mail, and am very happy with it.  However, now I need to copy e-mail messages from one Maildir to another, instead of moving them.  However, in the &lt;em&gt;mu4e&lt;/em&gt; documentation, I could not find anything about copying (i.e., duplicating and then moving one instance) of a message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I overlook something, or is this indeed not possible?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2019-07-03T06:15:17.897" Title="How can I copy an email message in mu4e?" Tags="|mu4e|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25013" PostTypeId="1" CreationDate="2016-08-02T09:00:12.453" Score="0" ViewCount="500" Body="&lt;p&gt;I can do M-x query-replace and replace all strings with another one. But it only replaces ones below the current cursor position. Is there any way to replace all the occurrences regardless the position of the cursor? &lt;/p&gt;&#xA;" OwnerUserId="12848" LastActivityDate="2016-08-02T10:25:47.063" Title="M-x query-replace but replace all in a file" Tags="|search|text-editing|replace|" AnswerCount="2" CommentCount="1" ClosedDate="2016-08-26T19:29:58.063" ContentLicense="CC BY-SA 3.0" />
  <row Id="25014" PostTypeId="2" ParentId="25013" CreationDate="2016-08-02T09:16:12.507" Score="3" Body="&lt;p&gt;You could use this function for replacing strings&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun replace-in-buffer ()&#xA;&quot;Replace text in whole buffer. Change OLD string to NEW string&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (replace-string (read-string &quot;OLD string:&quot;)&#xA;                    (read-string &quot;NEW string:&quot;)&#xA;                    nil&#xA;                    (point-min)&#xA;                    (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and bind it to key with &lt;code&gt;(global-set-key (kbd &quot;C-c r&quot;) 'replace-in-buffer)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks @rasmus, you could use: &lt;code&gt;M-&amp;lt;&lt;/code&gt;, &lt;code&gt;M-x query-replace &amp;lt;from&amp;gt; RET &amp;lt;to&amp;gt; RET&lt;/code&gt;, then press &lt;code&gt;!&lt;/code&gt; for replacing all occurences and &lt;code&gt;C-u C-SPC&lt;/code&gt; twice to return point into the initial position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;query-replace&lt;/code&gt; bound to &lt;code&gt;M-%&lt;/code&gt;, this could be helpfil when replace regexps too &lt;a href=&quot;https://emacs.stackexchange.com/questions/249/how-to-search-and-replace-in-the-entire-buffer&quot;&gt;How to search and replace in the entire buffer?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-08-02T10:18:35.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25015" PostTypeId="2" ParentId="24999" CreationDate="2016-08-02T09:25:40.637" Score="2" Body="&lt;p&gt;With external config file,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --batch --no-init-file --load config.el --find-file to-export.org --funcall org-export-function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or without your &quot;normal&quot; &lt;code&gt;init.el&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --batch --eval &quot;(require 'ox-backend)&quot; --find-file to-export.org --funcall org-export-function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-08-02T09:25:40.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25016" PostTypeId="1" AcceptedAnswerId="25021" CreationDate="2016-08-02T09:42:36.803" Score="12" ViewCount="1844" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dofOt.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dofOt.png&quot; alt=&quot;screenshot with an example&quot;&gt;&lt;/a&gt;&#xA;I tried to add &lt;code&gt;Noto Color Emoji&lt;/code&gt; from Google Noto as my font for Emoji in GNU Emacs, as mentioned in &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_list_and_set_font.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, but for some reason GNU Emacs doesn't display these characters properly in its window. I'm using GNU Emacs 24.5.1 on GNU/Linux. Is this a bug or am I doing something wrong?&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2020-04-25T04:34:51.270" Title="Emacs doesn't display color fonts at all" Tags="|fonts|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25017" PostTypeId="2" ParentId="22101" CreationDate="2016-08-02T10:05:32.270" Score="5" Body="&lt;p&gt;I can only tell for &lt;strong&gt;rtags&lt;/strong&gt; that I have been using actively for the last 1-2 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rtags works as expected. It is compiler based and provides correct code navigation. Something I have been looking for for the past 10 years as an emacs user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setup can be a bit tricky. I recommend taking a look at cmake-ide, that does part of the setup automatically.&#xA;&lt;a href=&quot;https://github.com/atilaneves/cmake-ide&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/atilaneves/cmake-ide&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This blog post can also help&#xA;&lt;a href=&quot;https://vxlabs.com/2016/04/11/step-by-step-guide-to-c-navigation-and-completion-with-emacs-and-the-clang-based-rtags/&quot; rel=&quot;noreferrer&quot;&gt;https://vxlabs.com/2016/04/11/step-by-step-guide-to-c-navigation-and-completion-with-emacs-and-the-clang-based-rtags/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also take a look (or use) my own configuration:&#xA;&lt;a href=&quot;https://github.com/jardon-u/dotfiles/blob/master/emacs.d/development/c/_init.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/jardon-u/dotfiles/blob/master/emacs.d/development/c/_init.el&lt;/a&gt;&#xA;I use a combination of cmake-ide (project discovery), irony (for code completion) and rtags (for code navigation). I am pretty sure this could be simplified as some functionalities overlap between each mode, but the result is at the level I am expecting from a modern IDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rtags also provides code refactoring facilities, but it is quite limited (mostly renaming)&lt;/p&gt;&#xA;" OwnerUserId="2401" LastActivityDate="2016-08-02T10:05:32.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25018" PostTypeId="2" ParentId="25013" CreationDate="2016-08-02T10:25:47.063" Score="1" Body="&lt;p&gt;M-x replace-string is what I use, unless I did not understand your question.&lt;/p&gt;&#xA;" OwnerUserId="12852" LastActivityDate="2016-08-02T10:25:47.063" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25019" PostTypeId="1" CreationDate="2016-08-02T13:02:27.693" Score="2" ViewCount="594" Body="&lt;p&gt;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).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I insert a new row (something like &lt;code&gt;#+TBLFM: @2..@-1=@#-1&lt;/code&gt;?) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my current table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| date             | start |   end | lunch |    total | expected |    + time |&#xA;|------------------+-------+-------+-------+----------+----------+-----------|&#xA;| [2016-08-02 Tue] | 08:58 | 17:00 |  0:15 | 07:47:00 | 07:30:00 |  00:17:00 |&#xA;| [2016-08-01 Mon] | 08:37 | 16:12 |  0:15 | 07:20:00 | 07:30:00 | -00:10:00 |&#xA;|------------------+-------+-------+-------+----------+----------+-----------|&#xA;|                  |       |       |       |          |          |  00:07:00 |&#xA;#+TBLFM: @2$5..@-1$5=$3-$2-$4;T::@2$7..@-1$7=$5-$6;T::@&amp;gt;$7=vsum(@2$7..@-1$7);T&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5154" LastEditorUserId="5154" LastEditDate="2016-08-02T15:17:27.370" LastActivityDate="2020-08-12T15:22:31.257" Title="TBLFM insert new row with current time" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25020" PostTypeId="2" ParentId="24992" CreationDate="2016-08-02T14:28:20.120" Score="5" Body="&lt;p&gt;Try setting &lt;code&gt;org-archive-location&lt;/code&gt; as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-archive-location (concat &quot;archive/archive-&quot;&#xA;                                   (format-time-string &quot;%Y%m&quot; (current-time))&#xA;                                   &quot;.org_archive::&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11580" LastEditorUserId="675" LastEditDate="2018-05-16T10:23:17.380" LastActivityDate="2018-05-16T10:23:17.380" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="25021" PostTypeId="2" ParentId="25016" CreationDate="2016-08-02T14:37:24.950" Score="11" Body="&lt;p&gt;You're not doing anything wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs for Linux uses XFT for font rendering, and XFT doesn't yet support the color fonts. See &lt;a href=&quot;http://emacs-devel.gnu.narkive.com/O7hbDsw3/status-of-multicolor-fonts&quot; rel=&quot;noreferrer&quot;&gt;this mailing list thread from Dec 2015&lt;/a&gt;. Richard Stallman writes in that thread that it's a low priority and they don't care about color fonts. Also in that thread you can see that they disabled color fonts in Emacs for &lt;em&gt;Mac&lt;/em&gt;, not for any technical reason but because color fonts are not supported in the Unix version of Emacs and they don't want the Mac version to have a feature that is not in the Unix version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I wouldn't expect to see this any time soon.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-08-02T14:37:24.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25023" PostTypeId="2" ParentId="25019" CreationDate="2016-08-02T15:22:08.347" Score="1" Body="&lt;p&gt;The following line inserts a new row, but with the content of cell 1 &quot;#ERROR&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: @2$1='(let ((org-table-fix-formulas-confirm 0)) (org-table-insert-row))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The part with setting &lt;code&gt;org-table-fix-formulas-confirm&lt;/code&gt; to 0 is so that it doesn't update all the indices in the formulae.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So using two formulae, the following works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| date             | start |   end |&#xA;|------------------+-------+-------|&#xA;| [2016-08-01 Mon] | 08:00 | 16:00 |&#xA;|------------------+-------+-------|&#xA;#+TBLFM: @2$1='(let ((org-table-fix-formulas-confirm 0)) (org-table-insert-row))&#xA;#+TBLFM: @2$1='(format-time-string &quot;[%Y-%m-%d %a]&quot;)::@2$2='(format-time-string &quot;%H:%M&quot;)&#xA;#+TBLFM: @2$3='(format-time-string &quot;%H:%M&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5154" LastActivityDate="2016-08-02T15:22:08.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25024" PostTypeId="1" CreationDate="2016-08-02T15:43:27.107" Score="2" ViewCount="287" Body="&lt;p&gt;Is there any differences between the following two ways of invoking a function in the init file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook `after-init-hook `turn-on-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;vs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(turn-off-auto-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12855" LastEditorUserId="105" LastEditDate="2016-08-02T23:55:18.440" LastActivityDate="2016-08-03T07:32:49.533" Title="Emacs init file function vs hooks" Tags="|init-file|hooks|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25025" PostTypeId="2" ParentId="25024" CreationDate="2016-08-02T15:56:40.053" Score="4" Body="&lt;p&gt;The main difference is time of evaluation. The former is evaluated after all init files are run, whereas the latter is evaluated immediately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of the former is, that you can initialize and require some nice or required stuff before running a command. The disadvantage is, that errors in your init scripts may lead to never firering the after-init-hook and thus never evaluating your command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may find more details in the GNU Emacs Lisp Reference for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Init-File.html#Init-File&quot; rel=&quot;nofollow&quot;&gt;The Init File&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-03T07:32:49.533" LastActivityDate="2016-08-03T07:32:49.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25026" PostTypeId="1" CreationDate="2016-08-02T18:50:26.643" Score="0" ViewCount="2410" Body="&lt;p&gt;For some reason I am getting errors for built-in variables that are available in the documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, evaluating in the &lt;code&gt;scratch&lt;/code&gt; buffer the following all return:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Symbol's function definition is void:&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs-major-version&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;emacs-minor-version&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;display-time-24hr-format&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is so weird because there is documentation for all of these, they show up in auto-complete and I see other users using them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can not use these in my &lt;code&gt;.emacs&lt;/code&gt; or anywhere else.  Interestingly however, I can set some of them using &lt;code&gt;customize&lt;/code&gt;.  For instance: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(display-time-24hr-format t)&lt;/code&gt; does work in the customize block&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any advice?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="7047" LastEditDate="2016-08-02T19:01:07.987" LastActivityDate="2016-08-02T19:01:07.987" Title="Symbol's function definition is void on built-in variables?" Tags="|functions|variables|symbols|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25028" PostTypeId="2" ParentId="25026" CreationDate="2016-08-02T18:57:12.377" Score="2" Body="&lt;p&gt;You get &lt;code&gt;Symbol's function definition is void&lt;/code&gt; because those are variables, not functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below will work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: emacs-major-version&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Below will not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (emacs-major-version)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-08-02T18:57:12.377" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25029" PostTypeId="1" CreationDate="2016-08-02T19:46:55.870" Score="5" ViewCount="1953" Body="&lt;p&gt;In orgmode, I do have a table like the following to track my overall working time a day. It is not important for which tasks or projects or even which client I spent my time on, just if I was in office or worked from remote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The table looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Day | Start |   End | Home |   Sum |&#xA;|-----+-------+-------+------+-------|&#xA;|   1 | 09:00 | 17:00 | No   |  8.00 |&#xA;|   2 | 09:00 | 12:00 | No   |  3.00 |&#xA;|   2 | 13:00 | 20:00 | Yes  |  7.00 |&#xA;|-----+-------+-------+------+-------|&#xA;|     |       |       | 7.00 | 11.00 |&#xA;#+TBLFM: @2$5..@-1$5=$3-$2;t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I need a formula that calculates the fields &lt;code&gt;@&amp;lt;$4&lt;/code&gt; and &lt;code&gt;@&amp;lt;$5&lt;/code&gt; as sums, while in &lt;code&gt;@&amp;lt;$4&lt;/code&gt; the values of $5 are summed when in that row $4 is &lt;code&gt;Yes&lt;/code&gt; and in &lt;code&gt;@&amp;lt;$5&lt;/code&gt; the values of $5 shall be summed when $3 of that row is &lt;strong&gt;not&lt;/strong&gt; &lt;code&gt;Yes&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;code&gt;Yes&lt;/code&gt;/&lt;code&gt;No&lt;/code&gt; I can switch to any other kind of marker as well.&lt;/p&gt;&#xA;" OwnerUserId="9389" LastActivityDate="2020-02-19T19:10:16.063" Title="Conditionally calculate the sum of a column depending on a fields value in another cell of the same row" Tags="|org-mode|org-table|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25031" PostTypeId="1" CreationDate="2016-08-03T00:01:09.497" Score="1" ViewCount="700" Body="&lt;p&gt;I want to create a &lt;code&gt;org-mode&lt;/code&gt; agenda dashboard that has multiple headers, each with content from a different query. How can I make this happen with a single command? Am I forced to have them in separate buffers?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2016-08-03T00:14:30.923" Title="Org agenda view with multiple headers" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25032" PostTypeId="2" ParentId="25031" CreationDate="2016-08-03T00:14:30.923" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; can contain search parameters for multiple blocks that have different search criteria.  Here is a section from the Emacs manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;10.6.2 Block agenda&#xA;&#xA;Another possibility is the construction of agenda views that comprise&#xA;the results of several commands, each of which creates a block in the&#xA;agenda buffer. The available commands include agenda for the daily or&#xA;weekly agenda (as created with C-c a a), alltodo for the global TODO&#xA;list (as constructed with C-c a t), and the matching commands discussed&#xA;above: todo, tags, and tags-todo. Here are two examples:&#xA;&#xA;(setq org-agenda-custom-commands&#xA;      '((&quot;h&quot; &quot;Agenda and Home-related tasks&quot;&#xA;         ((agenda &quot;&quot;)&#xA;          (tags-todo &quot;home&quot;)&#xA;          (tags &quot;garden&quot;)))&#xA;        (&quot;o&quot; &quot;Agenda and Office-related tasks&quot;&#xA;         ((agenda &quot;&quot;)&#xA;          (tags-todo &quot;work&quot;)&#xA;          (tags &quot;office&quot;)))))&#xA;&#xA;This will define C-c a h to create a multi-block view for stuff you&#xA;need to attend to at home. The resulting agenda buffer will contain&#xA;your agenda for the current week, all TODO items that carry the tag&#xA;‘home’, and also all lines tagged with ‘garden’. Finally the command&#xA;C-c a o provides a similar view for office tasks.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also the &lt;code&gt;org-mode&lt;/code&gt; manual at the section entitled &lt;em&gt;Custom Agenda Commands&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-08-03T00:14:30.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25033" PostTypeId="1" AcceptedAnswerId="25035" CreationDate="2016-08-03T02:41:08.877" Score="7" ViewCount="2219" Body="&lt;p&gt;How can I execute elisp in the currently running emacs from the command line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following command echoes 'hi' but doesn't set &lt;code&gt;'abc&lt;/code&gt; in the emacs instance.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --no-wait --eval '(message &quot;hi&quot;) (setq abc)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to modify emacs from the command line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My specific use case is to revert all buffers with a shell command.&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-08-03T02:51:19.873" Title="Run elisp from command line in running emacs" Tags="|shell-command|server|command-line-arguments|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25034" PostTypeId="1" AcceptedAnswerId="27343" CreationDate="2016-08-03T02:50:02.423" Score="0" ViewCount="570" Body="&lt;p&gt;Given an elisp function or macro, does Emacs provide any way of finding callers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm just grepping in &lt;code&gt;~/.emacs.d&lt;/code&gt; for examples, but it's crude. Slime has &lt;code&gt;slime-who-references&lt;/code&gt; but the excellent &lt;code&gt;elisp-slime-nav&lt;/code&gt; doesn't seem to have an equivalent command.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2016-08-03T04:59:18.650" LastActivityDate="2016-09-26T02:09:35.743" Title="How can I find callers to a function/macro?" Tags="|search|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25035" PostTypeId="2" ParentId="25033" CreationDate="2016-08-03T02:51:19.873" Score="7" Body="&lt;p&gt;You can either wrap your two forms in a &lt;code&gt;progn&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --no-wait --eval '(progn (message &quot;hi&quot;) (setq abc 123))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you can send them separately:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --no-wait --eval '(message &quot;hi&quot;)' '(setq def 456)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-03T02:51:19.873" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25036" PostTypeId="2" ParentId="25034" CreationDate="2016-08-03T03:04:58.393" Score="1" Body="&lt;p&gt;I don't believe it's even possible. Elisp has dynamic scope, any symbol can be rebound to anything (and it is being used and abused as you know.) So nothing is known statically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do the same, I mean grepping. I use &lt;code&gt;silver-searcher&lt;/code&gt; and &lt;code&gt;helm&lt;/code&gt; variations a lot around it, including &lt;code&gt;helm-swoop&lt;/code&gt; to make the grepping more palatable, and I am always on a lookout for ways to improve it, but I guess at the fundamental level text/regexp search is what we have to deal with.&lt;/p&gt;&#xA;" OwnerUserId="12749" LastActivityDate="2016-08-03T03:04:58.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25037" PostTypeId="1" CreationDate="2016-08-03T05:45:04.993" Score="14" ViewCount="3875" Body="&lt;p&gt;&lt;strong&gt;How do I compile Emacs with &lt;code&gt;xwidget&lt;/code&gt; under OSX?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried to run &lt;code&gt;./configure --prefix=$HOME/emacs-xwidgets --with-x-toolkit=gtk3 --with-xwidgets&lt;/code&gt; I get an error &lt;code&gt;configure: error: xwidgets requested but gtk3 not used.&lt;/code&gt;. But it looks like I have an gtk+3.0 - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;sandric@sandric-mac ~/emacs&amp;gt; brew install gtk+3&#xA;Error: gtk+3-3.18.9 already installed&#xA;To install this version, first `brew unlink gtk+3`&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like I don't have &lt;code&gt;gtk3&lt;/code&gt; package in &lt;code&gt;pkg-config&lt;/code&gt; - &#xA;&lt;code&gt;&#xA;sandric@sandric-mac ~&amp;gt; pkg-config --list-all&#xA;libzmq                              libzmq - 0MQ c++ library&#xA;gio-unix-2.0                        GIO unix specific APIs - unix specific headers for glib I/O library&#xA;libusb-1.0                          libusb-1.0 - C API for USB device access from Linux, Mac OS X, Windows and OpenBSD/NetBSD userspace&#xA;gobject-introspection-no-export-1.0 gobject-introspection - GObject Introspection&#xA;libecpg_compat                      libecpg_compat - PostgreSQL libecpg_compat library&#xA;gio-2.0                             GIO - glib I/O library&#xA;libcdt                              libcdt - Container DataType library&#xA;cairo-gobject                       cairo-gobject - gobject functions for cairo graphics library&#xA;harfbuzz-icu                        harfbuzz - HarfBuzz text shaping library ICU integration&#xA;cairo-quartz-font                   cairo-quartz-font - Quartz font backend for cairo graphics library&#xA;libpng16                            libpng - Loads and saves PNG files&#xA;dbus-1                              dbus - Free desktop message bus&#xA;ImageMagick++                       ImageMagick++ - Magick++ - C++ API for ImageMagick (ABI Q16)&#xA;cairo-ps                            cairo-ps - PostScript surface backend for cairo graphics library&#xA;gmodule-2.0                         GModule - Dynamic module loader for GLib&#xA;lcms                                lcms - LCMS Color Management Library&#xA;glib-2.0                            GLib - C Utility Library&#xA;ImageMagick                         ImageMagick - ImageMagick - convert, edit, and compose images (ABI Q16)&#xA;Magick++-6.Q16                      Magick++ - Magick++ - C++ API for ImageMagick (ABI Q16)&#xA;gimpthumb-2.0                       GIMP Thumb - GIMP Thumbnail Library&#xA;gdlib                               gd - GD graphics library&#xA;libpcre2-16                         libpcre2-16 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support&#xA;pango                               Pango - Internationalized text handling&#xA;uuid                                OSSP uuid - Universally Unique Identifier (UUID) Library&#xA;babl                                babl - Dynamic, any to any, pixel format conversion library&#xA;MagickWand                          MagickWand - MagickWand - C API for ImageMagick (ABI Q16)&#xA;libedit                             libedit - command line editor library provides generic line editing, history, and tokenization functions.&#xA;libublio                            ublio - UBLIO caching library&#xA;libicns                             libicns - Loads and saves Macintosh icns files&#xA;libcgraph                           libcgraph - Graph library (file i/o, dot language parsing, graph, subgraph, node, edge, attribute, data structure manipulation)&#xA;libpcrecpp                          libpcrecpp - PCRECPP - C++ wrapper for PCRE&#xA;pangoft2                            Pango FT2 and Pango Fc - Freetype 2.0 and fontconfig font support for Pango&#xA;libevent_pthreads                   libevent_pthreads - libevent_pthreads adds pthreads-based threading support to libevent&#xA;gdk-pixbuf-2.0                      GdkPixbuf - Image loading and scaling&#xA;gmodule-no-export-2.0               GModule - Dynamic module loader for GLib&#xA;MagickCore-6.Q16                    MagickCore - MagickCore - C API for ImageMagick (ABI Q16)&#xA;osxfuse                             fuse - OSXFUSE&#xA;libcroco-0.6                        libcroco - a CSS2 Parsing and manipulation Library in C.&#xA;libxdot                             libxdot - Library for parsing graphs in xdot format&#xA;liblzma                             liblzma - General purpose data compression library&#xA;gtk+-3.0                            GTK+ - GTK+ Graphical UI Library&#xA;libssh2                             libssh2 - Library for SSH-based communication&#xA;gobject-introspection-1.0           gobject-introspection - GObject Introspection&#xA;Magick++                            Magick++ - Magick++ - C++ API for ImageMagick (ABI Q16)&#xA;gtk+-unix-print-2.0                 GTK+ - GTK+ Unix print support&#xA;libiodbc                            iODBC - iODBC Driver Manager&#xA;libfontforgeexe                     libfontforgeexe - for embedding the FontForge UI in a program.&#xA;gdk-2.0                             GDK - GTK+ Drawing Kit (quartz target)&#xA;gtk-mac-integration-gtk2            gtk-mac-integration-gtk2 - Mac menu bar and dock integration for GTK+&#xA;gtk-mac-integration-gtk3            gtk-mac-integration-gtk3 - Mac menu bar and dock integration for GTK+&#xA;yaml-0.1                            LibYAML - Library to parse and emit YAML&#xA;libssl                              OpenSSL - Secure Sockets Layer and cryptography libraries&#xA;libpcre2-32                         libpcre2-32 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support&#xA;apr-util-1                          APR Utils - Companion library for APR&#xA;libevent                            libevent - libevent is an asynchronous notification event loop library&#xA;openssl                             OpenSSL - Secure Sockets Layer and cryptography libraries and tools&#xA;libevent_openssl                    libevent_openssl - libevent_openssl adds openssl-based TLS support to libevent&#xA;mysqlclient                         mysqlclient - MySQL client library&#xA;cairo-pdf                           cairo-pdf - PDF surface backend for cairo graphics library&#xA;gimpui-2.0                          GIMP UI - GIMP User Interface Library&#xA;apr-1                               APR - The Apache Portable Runtime library&#xA;gdk-quartz-2.0                      GDK - GTK+ Drawing Kit (quartz target)&#xA;pangocairo                          Pango Cairo - Cairo rendering support for Pango&#xA;gmodule-export-2.0                  GModule - Dynamic module loader for GLib&#xA;libgvpr                             libgvpr - The GVPR library&#xA;gimp-2.0                            GIMP - GIMP Library&#xA;libpq                               libpq - PostgreSQL libpq library&#xA;ImageMagick++-6.Q16                 ImageMagick++ - Magick++ - C++ API for ImageMagick (ABI Q16)&#xA;Wand-6.Q16                          MagickWand - MagickCore - C API for ImageMagick (ABI Q16)&#xA;gsettings-desktop-schemas           gsettings-desktop-schemas - Shared GSettings schemas for the desktop, including helper headers&#xA;pixman-1                            Pixman - The pixman library (version 1)&#xA;libpcre2-8                          libpcre2-8 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support&#xA;cairo-quartz-image                  cairo-quartz-image - Quartz Image surface backend for cairo graphics library&#xA;gtk+-quartz-2.0                     GTK+ - GTK+ Graphical UI Library (quartz target)&#xA;libpathplan                         libpathplan - Library for planning polyline and bezier paths around polygon obstacles&#xA;libpcre16                           libpcre16 - PCRE - Perl compatible regular expressions C library with 16 bit character support&#xA;libfontforge                        libfontforge - a font manipulation library.&#xA;libtiff-4                           libtiff - Tag Image File Format (TIFF) library.&#xA;gobject-2.0                         GObject - GLib Type, Object, Parameter and Signal Library&#xA;libgvc                              libgvc - The GraphVizContext library&#xA;gtk+-unix-print-3.0                 GTK+ - GTK+ Unix print support&#xA;libpng                              libpng - Loads and saves PNG files&#xA;gthread-2.0                         GThread - Thread support for GLib&#xA;cairo-fc                            cairo-fc - Fontconfig font backend for cairo graphics library&#xA;fontconfig                          Fontconfig - Font configuration and customization library&#xA;libecpg                             libecpg - PostgreSQL libecpg library&#xA;cairo                               cairo - Multi-platform 2D graphics library&#xA;gdk-3.0                             GDK - GTK+ Drawing Kit&#xA;pygobject-2.0                       PyGObject - Python bindings for GObject&#xA;libcrypto                           OpenSSL-libcrypto - OpenSSL cryptography library&#xA;libpcreposix                        libpcreposix - PCREPosix - Posix compatible interface to libpcre&#xA;cairo-png                           cairo-png - PNG functions for cairo graphics library&#xA;cairo-ft                            cairo-ft - FreeType font backend for cairo graphics library&#xA;epoxy                               epoxy - epoxy GL dispatch Library&#xA;gtk-mac-integration                 gtk-mac-integration-gtk2 - Mac menu bar and dock integration for GTK+&#xA;Wand                                MagickWand - MagickCore - C API for ImageMagick (ABI Q16)&#xA;atk                                 Atk - Accessibility Toolkit&#xA;libpcre2-posix                      libpcre2-posix - Posix compatible interface to libpcre2-8&#xA;fish                                fish - fish, the friendly interactive shell&#xA;libntfs-3g                          libntfs-3g - NTFS-3G Read/Write Driver Library&#xA;libczmq                             libczmq - The high-level C binding for 0MQ&#xA;cairo-svg                           cairo-svg - SVG surface backend for cairo graphics library&#xA;libsodium                           libsodium - A portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API.&#xA;gdk-quartz-3.0                      GDK - GTK+ Drawing Kit&#xA;cairo-quartz                        cairo-quartz - Quartz surface backend for cairo graphics library&#xA;fuse                                fuse - OSXFUSE&#xA;harfbuzz                            harfbuzz - HarfBuzz text shaping library&#xA;libtls                              LibreSSL-libtls - Secure communications using the TLS socket protocol.&#xA;MagickWand-6.Q16                    MagickWand - MagickWand - C API for ImageMagick (ABI Q16)&#xA;libpgtypes                          libpgtypes - PostgreSQL libpgtypes library&#xA;pycairo                             Pycairo - Python bindings for cairo&#xA;libpcre                             libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support&#xA;cairo-script                        cairo-script - script surface backend for cairo graphics library&#xA;ImageMagick-6.Q16                   ImageMagick - ImageMagick - convert, edit, and compose images (ABI Q16)&#xA;libpcre32                           libpcre32 - PCRE - Perl compatible regular expressions C library with 32 bit character support&#xA;gail-3.0                            Gail - GNOME Accessibility Implementation Library&#xA;cairo-tee                           cairo-tee - tee surface backend for cairo graphics library&#xA;freetype2                           FreeType 2 - A free, high-quality, and portable font engine.&#xA;slang                               slang - S-Lang programming library and interpreter&#xA;MagickCore                          MagickCore - MagickCore - C API for ImageMagick (ABI Q16)&#xA;gtk+-quartz-3.0                     GTK+ - GTK+ Graphical UI Library&#xA;librsvg-2.0                         librsvg - library that renders svg files&#xA;gtk+-2.0                            GTK+ - GTK+ Graphical UI Library (quartz target)&#xA;oniguruma                           oniguruma - Regular expression library&#xA;harfbuzz-gobject                    harfbuzz - HarfBuzz text shaping library GObject integration&#xA;pygtk-2.0                           PyGTK - Python bindings for GTK+ and related libraries&#xA;gail                                Gail - GNOME Accessibility Implementation Library&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="253" LastEditDate="2016-08-18T16:24:47.303" LastActivityDate="2021-11-30T18:52:55.910" Title="Compile emacs with xwidget under OSX?" Tags="|osx|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25038" PostTypeId="1" AcceptedAnswerId="26067" CreationDate="2016-08-03T06:56:35.577" Score="2" ViewCount="229" Body="&lt;p&gt;I'm trying to unbind &lt;code&gt;M-o&lt;/code&gt; in diff-mode with &lt;code&gt;use-package&lt;/code&gt;.  To do that I've written:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(use-package diff&#xA;  :defer t&#xA;  :config&#xA;  (unbind-key &quot;M-o&quot; diff-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Restarted Emacs 25, open a diff file, but &lt;code&gt;M-o&lt;/code&gt; still seems to be mapped to  &lt;code&gt;diff-goto-source&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked &lt;code&gt;diff-mode.el&lt;/code&gt; and found out that there is &lt;code&gt;diff-mode-shared-map&lt;/code&gt; which seems to have &lt;code&gt;M-o&lt;/code&gt;.  So I did changed the map in the previous code to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(use-package diff&#xA;  :defer t&#xA;  :config&#xA;  (unbind-key &quot;M-o&quot; diff-mode-shared-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, it still does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've used the same snippet for other modes and they seem to work as I expected. Is diff-mode special?&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2016-08-04T06:10:07.170" LastActivityDate="2016-08-04T13:09:47.770" Title="Unbind `M-o` in diff-mode with use-package" Tags="|key-bindings|use-package|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25039" PostTypeId="1" CreationDate="2016-08-03T06:58:46.650" Score="7" ViewCount="5609" Body="&lt;p&gt;I used to have Emacs 25.xx on my windows pc and was very happy with the daemon/server mode of emacs. Emacs started via batch-script on startup and everything worked fine -- on every subsequent call Emacs just started instantly. Just as it should. :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, due to scrolling problems in AucTeX I went back to 24.5.1. Now Emacs doesn't start in server mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;http://wikemacs.org/wiki/Emacs_server&quot; rel=&quot;noreferrer&quot;&gt;http://wikemacs.org/wiki/Emacs_server&lt;/a&gt; and it says at the bottom that on Microsoft Windows you need to have at least Emacs version 25 to use the server mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this just outdated information? Is there really no way to run Emacs 24 in server mode on Windows? Has anyone of you experience with running Emacs in server mode on Windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's important: I use Windows 10. Thanks in advance for any input on that topic.&lt;/p&gt;&#xA;" OwnerUserId="12284" LastActivityDate="2018-07-26T15:43:15.813" Title="Emacs 24.5.1 on Windows: How to use server mode?" Tags="|microsoft-windows|server|emacs-daemon|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25040" PostTypeId="2" ParentId="25029" CreationDate="2016-08-03T07:00:43.790" Score="3" Body="&lt;p&gt;I guess there is 2 options .. calculate some helper columns and sum multiply those or create helper elisp function .. I'll start with the latter.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp&#xA;  (defun my-sum-helper (a  b pred)&#xA;    (reduce #'+&#xA;            (cl-mapcar&#xA;              #'*&#xA;              (mapcar&#xA;               (lambda(x) (if (string= x pred) 1 0)) a)&#xA;              b)))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: my-sum-helper&#xA;&#xA;&#xA;| Day | Start |   End | Home |  Sum |&#xA;|-----+-------+-------+------+------|&#xA;|   1 | 09:00 | 17:00 | No   | 8.00 |&#xA;|   2 | 09:00 | 12:00 | No   | 3.00 |&#xA;|   2 | 13:00 | 20:00 | Yes  | 7.00 |&#xA;|-----+-------+-------+------+------|&#xA;|     |       |       | 7.0  | 11.0 |&#xA;#+TBLFM: @2$5..@-1$5=$3-$2;t::@&amp;gt;$4='(my-sum-helper '(@2$4..@4$4) '(@2$5..@4$5) &quot;Yes&quot;);L::@&amp;gt;$5='(my-sum-helper '(@2$4..@4$4) '(@2$5..@4$5) &quot;No&quot;);L&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use: evaluate the src block first then evaluate the formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LIke I said you can also create an intermediate column wih 0 an 1 values with the formula: &lt;code&gt;@2$6..@4$6='(if (string= &quot;$4&quot; &quot;Yes&quot;) 1 0);L&lt;/code&gt;. This facilitates the use of calc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Day | Start |   End | Home |  Sum |   |&#xA;|-----+-------+-------+------+------+---|&#xA;|   1 | 09:00 | 17:00 | No   | 8.00 | 0 |&#xA;|   2 | 09:00 | 12:00 | No   | 3.00 | 0 |&#xA;|   2 | 13:00 | 20:00 | Yes  | 7.00 | 1 |&#xA;|-----+-------+-------+------+------+---|&#xA;|     |       |       | 7.   |  11. |   |&#xA;#+TBLFM: @2$5..@-1$5=$3-$2;t::@2$6..@4$6='(if (string= &quot;$4&quot; &quot;Yes&quot;) 1 0);L::@&amp;gt;$4=vsum(@2$6..@4$6 * @2$5..@4$5);N::@&amp;gt;$5=vsum((1-@2$6..@4$6) * @2$5..@4$5);N&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;hope this helps. &lt;/p&gt;&#xA;" OwnerUserId="499" LastActivityDate="2016-08-03T07:00:43.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25043" PostTypeId="1" CreationDate="2016-08-03T10:58:22.090" Score="1" ViewCount="531" Body="&lt;p&gt;I have the following line turning hl-line-mode on globally in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-hl-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Most of the time, that's how I like it. But sometimes I want to turn it off. I'd hoped that I could somehow override the global setting with a buffer-local one, by running &lt;code&gt;hl-line-mode&lt;/code&gt; with a negative prefix argument. This does turn off the highlight for about a second, then it just comes back. I can, of course, disable &lt;code&gt;global-hl-line-mode&lt;/code&gt; instead, but is there a way to do a buffer or window local override of this setting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt; Kudos to @lawlist for the necessary mechanics. I bound this up in a little function and am quite happy with it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivan/local-toggle-hl-line ()&#xA;  &quot;Toggle line highlighting in current buffer&quot;&#xA;  (interactive)&#xA;  (setq-local global-hl-line-mode&#xA;              (null global-hl-line-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Dedicating it to the same keybinding that iTerm2 uses for the same sort of thing &lt;kbd&gt;⌥⌘;&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="105" LastEditDate="2016-12-22T17:27:17.070" LastActivityDate="2016-12-22T17:27:17.070" Title="Can I override global-hl-line-mode in a buffer/window?" Tags="|highlighting|buffer-local|global-mode|hl-line-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25044" PostTypeId="1" AcceptedAnswerId="25046" CreationDate="2016-08-03T11:47:15.570" Score="25" ViewCount="13114" Body="&lt;p&gt;I just installed web-mode. It works, but the indentation&#xA;seems to be set to 4 spaces by default. How does one&#xA;properly set it to 2 spaces?&lt;/p&gt;&#xA;" OwnerUserId="12863" LastActivityDate="2020-05-07T15:51:04.163" Title="How do I set up indentation to 2 spaces in web-mode" Tags="|web-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25045" PostTypeId="1" AcceptedAnswerId="25049" CreationDate="2016-08-03T11:55:16.540" Score="6" ViewCount="3941" Body="&lt;p&gt;The title says it all. When I press &lt;kbd&gt;A&lt;/kbd&gt; with opened email, it&#xA;proposes the following options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open with&lt;/li&gt;&#xA;&lt;li&gt;open in emacs&lt;/li&gt;&#xA;&lt;li&gt;import in diary&lt;/li&gt;&#xA;&lt;li&gt;pipe (haven't tried that)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there something straightforward to just save an attachment on disk?&lt;/p&gt;&#xA;" OwnerUserId="2487" LastActivityDate="2023-04-30T18:55:48.777" Title="How can I easily download/save an attachment in mu4e?" Tags="|mu4e|attachment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25046" PostTypeId="2" ParentId="25044" CreationDate="2016-08-03T12:08:24.323" Score="34" Body="&lt;p&gt;According to the &lt;a href=&quot;http://web-mode.org&quot; rel=&quot;noreferrer&quot;&gt;web-mode documentation&lt;/a&gt;, you can do that with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-web-mode-hook ()&#xA;  &quot;Hooks for Web mode.&quot;&#xA;  (setq web-mode-markup-indent-offset 2)&#xA;)&#xA;(add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also set values for &lt;code&gt;web-mode-css-indent-offset&lt;/code&gt; for CSS, and &lt;code&gt;web-mode-code-indent-offset&lt;/code&gt; Javascript, Java, PHP, etc.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2016-08-03T13:17:56.750" LastActivityDate="2016-08-03T13:17:56.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25047" PostTypeId="1" AcceptedAnswerId="25048" CreationDate="2016-08-03T14:11:43.460" Score="1" ViewCount="128" Body="&lt;p&gt;I found a neat code snippet for &lt;code&gt;~/.emacs&lt;/code&gt; configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (global-set-key (kbd &quot;C-&amp;gt;&quot;) &#xA;                  (lambda (b e &amp;amp;optional n) &#xA;                    (interactive &quot;r&quot;)&#xA;                    (indent-code-rigidly b e (or n 4)))&#xA;                  )&#xA;&#xA;  (global-set-key (kbd &quot;C-&amp;lt;&quot;) &#xA;                  (lambda (b e &amp;amp;optional n) &#xA;                    (interactive &quot;r&quot;)&#xA;                    (indent-code-rigidly b e (or n (- 0 4))))&#xA;                  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This snippet allows me to use &lt;code&gt;C-&amp;gt;&lt;/code&gt;/&lt;code&gt;C-&amp;lt;&lt;/code&gt; hotkeys to force indent/unindent selected code block.&#xA;But after indent/uindent applies to code block, selection is lost. How to retain selection (or select again same code lines) programmatically?&lt;/p&gt;&#xA;" OwnerUserId="10013" LastEditorUserId="105" LastEditDate="2016-08-03T14:49:09.090" LastActivityDate="2016-08-03T14:58:27.807" Title="How to retain selection after command run (indent-code-rigidly)?" Tags="|indentation|region|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25048" PostTypeId="2" ParentId="25047" CreationDate="2016-08-03T14:58:27.807" Score="2" Body="&lt;p&gt;I'm guessing that this is really what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-&amp;lt;&quot;) &#xA;        (lambda (b e n) &#xA;          (interactive &quot;r\nP&quot;)&#xA;          (indent-code-rigidly b e (if n (prefix-numeric-value n) -4))&#xA;          (setq deactivate-mark  nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What you were missing was &lt;code&gt;(setq deactivate-mark  nil)&lt;/code&gt;. After each command, the command loop normally deactivates the region, but if you set this variable to &lt;code&gt;nil&lt;/code&gt; then it does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond that, I fixed (according to what I think you wanted) the use of a prefix argument.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-03T14:58:27.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25049" PostTypeId="2" ParentId="25045" CreationDate="2016-08-03T15:52:10.460" Score="6" Body="&lt;p&gt;Use &lt;code&gt;e&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;e runs the command mu4e-view-save-attachment&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Offer to save attachment(s). If MULTI (prefix-argument) is nil, save a&#xA;  single one, otherwise, offer to save a range of attachments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Alternatively, with point on an attachment name, you can use &lt;code&gt;S-RET&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;S-return runs the command mu4e~view-save-attach-from-binding&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Save the attachement at point, or click location.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-08-03T15:52:10.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25050" PostTypeId="2" ParentId="25039" CreationDate="2016-08-03T15:54:49.723" Score="1" Body="&lt;p&gt;I can verify that it is possible to run Emacs 24 as a daemon on Windows 10, if you use &lt;a href=&quot;http://cygwin.org/&quot; rel=&quot;nofollow&quot;&gt;Cygwin&lt;/a&gt;.  If you're using the Windows-native Cygwin version (Cygwin package &lt;code&gt;emacs-w32&lt;/code&gt;), then I think you'll need to start the daemon through bash, but you can call &lt;code&gt;emacsclient&lt;/code&gt; directly from Windows, and the resulting instances will connect to the daemon just fine.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-08-03T15:54:49.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25052" PostTypeId="1" CreationDate="2016-08-03T19:15:42.613" Score="6" ViewCount="3374" Body="&lt;p&gt;In the past, I have exported org-mode source code blocks into LaTeX floating environments, without any problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At some point (I have no idea when), this behavior has changed for me.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The org manual says &lt;code&gt;:float t&lt;/code&gt; is the default if the source block has a caption, but I get no &lt;code&gt;\begin{figure}&lt;/code&gt; in the exported output.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: a&#xA;#+caption: abc&#xA;#+BEGIN_SRC SuperCollider -i&#xA;abc.play;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;--&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\lstset{language=SuperCollider,label=a,caption={abc},captionpos=b,numbers=none}&#xA;\begin{lstlisting}&#xA;abc.play;&#xA;\end{lstlisting}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Source code blocks aren't processing &lt;code&gt;#+ATTR_LATEX&lt;/code&gt;, whether it comes before the name and caption or immediately before &lt;code&gt;#+BEGIN_SRC&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I try to force a float using &lt;code&gt;#+BEGIN_FIGURE&lt;/code&gt;, I can't find a way to attach a placement string. &lt;code&gt;#+ATTR_LATEX&lt;/code&gt; appears to be ignored.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Tried with org-mode v8.3.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html#LaTeX-specific-attributes&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/LaTeX-specific-attributes.html#LaTeX-specific-attributes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12868" LastEditorUserId="421" LastEditDate="2016-12-05T16:42:21.383" LastActivityDate="2016-12-05T16:42:21.383" Title="Orgmode latex export of figures: how to apply placement string?" Tags="|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25055" PostTypeId="1" AcceptedAnswerId="25056" CreationDate="2016-08-03T23:28:31.050" Score="3" ViewCount="356" Body="&lt;p&gt;I'd like to patch some elisp functions inside my unit tests. I've tried &lt;code&gt;cl-labels&lt;/code&gt; and &lt;code&gt;cl-flet&lt;/code&gt;, but neither achieve the result I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun return-number ()&#xA;  1)&#xA;&#xA;(defun calls-return-number ()&#xA;  (return-number))&#xA;&#xA;(defun patch-cl-labels ()&#xA;  (cl-labels ((return-number () 2))&#xA;    (calls-return-number)))&#xA;&#xA;(message &quot;After patching: %s&quot; (patch-cl-labels))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've looked at &lt;a href=&quot;https://emacs.stackexchange.com/q/3276/304&quot;&gt;monkey-patching a function&lt;/a&gt; (but this permanently changes behaviour) and &lt;a href=&quot;https://emacs.stackexchange.com/q/19884/304&quot;&gt;patching a third-party function&lt;/a&gt; (this uses advice and holds on to the old function).&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2021-05-20T19:02:06.967" LastActivityDate="2021-05-20T19:02:06.967" Title="How do I temporarily mock a function for testing?" Tags="|testing|dynamic-scoping|monkey-patching|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25056" PostTypeId="2" ParentId="25055" CreationDate="2016-08-04T00:13:44.263" Score="7" Body="&lt;p&gt;Both macros are lexically scoped, that's why they have no effect on the &quot;distant&quot; call.  Either use the deprecated older &lt;code&gt;flet&lt;/code&gt; or &lt;code&gt;cl-letf&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-letf (((symbol-function 'return-number)&#xA;           (lambda () 2)))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-08-04T00:13:44.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26056" PostTypeId="1" AcceptedAnswerId="26057" CreationDate="2016-08-04T03:01:44.403" Score="5" ViewCount="449" Body="&lt;p&gt;People often recommend on &lt;code&gt;emacs.stackexchange.com&lt;/code&gt; and &lt;code&gt;stackoverflow.com&lt;/code&gt; (in the Emacs tag) that we should learn to &quot;&lt;strong&gt;ask Emacs&lt;/strong&gt;&quot;.  The built-in &lt;code&gt;Info-mode&lt;/code&gt; is not capable of performing a &lt;em&gt;recursive&lt;/em&gt; &lt;code&gt;regexp&lt;/code&gt; search that can compete with the likes of &lt;code&gt;grep&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I &lt;em&gt;recursively&lt;/em&gt; grep the Emacs manual (i.e., all &lt;code&gt;.info&lt;/code&gt; files) with a regexp search?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Keep in mind that some &lt;code&gt;.info&lt;/code&gt; files may be gzipped, whereas others will be unzipped.  This largely depends upon the install options specified at the time Emacs is built from source.]&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In a related thread on &lt;code&gt;reddit.com&lt;/code&gt;, @kaushalmodi made an excellent suggestion to use the &lt;code&gt;ag&lt;/code&gt; (aka The Silver Searcher) command-line utility in conjunction with the &lt;code&gt;counsel&lt;/code&gt; / &lt;code&gt;ivy&lt;/code&gt; /  &lt;code&gt;swiper&lt;/code&gt; packages, and the following function was provided by said author:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.reddit.com/r/emacs/comments/4vvwr9/grepping_the_info_files_versus_infomode/?ref=share&amp;amp;ref_source=link&quot; rel=&quot;nofollow&quot;&gt;https://www.reddit.com/r/emacs/comments/4vvwr9/grepping_the_info_files_versus_infomode/?ref=share&amp;amp;ref_source=link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun counsel-ag-emacs-info (&amp;amp;optional initial-input)&#xA;  &quot;Search for a pattern in emacs 'info/' directory using ag.&#xA;    INITIAL-INPUT can be given as the initial minibuffer input.&quot;&#xA;  (interactive)&#xA;  (counsel-ag initial-input (car Info-default-directory-list)&#xA;              &quot; -z&quot; &quot;Search emacs/elisp info&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="25" LastEditDate="2016-08-24T20:18:11.053" LastActivityDate="2016-08-24T20:18:11.053" Title="How to grep all the Info manuals with a regexp search" Tags="|info|grep|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26057" PostTypeId="2" ParentId="26056" CreationDate="2016-08-04T03:02:18.563" Score="3" Body="&lt;p&gt;The following solution relies upon three (3) command-line utilities:  &lt;code&gt;find&lt;/code&gt;; &lt;code&gt;xargs&lt;/code&gt;; and &lt;code&gt;zgrep&lt;/code&gt;.  In putting together the following function, I discovered that &lt;code&gt;grep&lt;/code&gt; cannot see inside gizipped files, and &lt;em&gt;not all versions&lt;/em&gt; of &lt;code&gt;zgrep&lt;/code&gt; are able to search recursively.  Inasmuch as &lt;code&gt;zgrep&lt;/code&gt; can handle both gzipped and unzipped &lt;code&gt;.info&lt;/code&gt; files, the function includes a search for both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On OSX &lt;code&gt;find&lt;/code&gt;/&lt;code&gt;xargs&lt;/code&gt;/&lt;code&gt;zgrep&lt;/code&gt; come pre-installed and they are located in the &lt;code&gt;/usr/bin&lt;/code&gt; directory; and, the &lt;code&gt;car&lt;/code&gt; of &lt;code&gt;Info-default-directory-list&lt;/code&gt; contains the built-in Emacs manual consisting of several &lt;code&gt;.info&lt;/code&gt; files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With some command-line utilities, Emacs may complain about exiting abnormally with code 1.  The &lt;code&gt;zgrep&lt;/code&gt; results in this case are nevertheless complete, and running the same commands in the terminal works perfectly without any error messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just type:   &lt;code&gt;M-x ask-emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun ask-emacs ()&#xA;&quot;Grep the .info files that are in the CAR of `Info-default-directory-list'.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (search-term (read-string &quot;Ask Emacs (regex):  &quot;))&#xA;      (search-path (directory-file-name (car Info-default-directory-list)))&#xA;      (default-directory (file-name-as-directory search-path))&#xA;      (initial-grep-command &quot;-inIE --color=always -C2&quot;)&#xA;      (grep-command (concat&#xA;        &quot;find&quot;&#xA;        &quot; &quot;&#xA;        search-path&#xA;        &quot; &quot;&#xA;        &quot;\\( -name \\*.gz -o -name \\*.info \\)&quot;&#xA;        &quot; &quot;&#xA;        &quot;-print0&quot;&#xA;        &quot; &quot;&#xA;        &quot;|&quot;&#xA;        &quot; &quot;&#xA;        &quot;xargs&quot;&#xA;        &quot; &quot;&#xA;        &quot;-0&quot;&#xA;        &quot; &quot;&#xA;        &quot;zgrep&quot;&#xA;        &quot; &quot;&#xA;        initial-grep-command&#xA;        &quot; &quot;&#xA;        search-term&#xA;        &quot; &quot;&#xA;        search-path)) )&#xA;   (compilation-start grep-command 'grep-mode (lambda (mode) &quot;*grep*&quot;) nil) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xGBJP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xGBJP.png&quot; alt=&quot;Example&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Link to related source with an example to recursively search using &lt;code&gt;zgrep&lt;/code&gt;:  &lt;a href=&quot;https://unix.stackexchange.com/a/187753/92940&quot;&gt;https://unix.stackexchange.com/a/187753/92940&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-08-04T15:37:02.293" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26058" PostTypeId="1" CreationDate="2016-08-04T03:38:49.003" Score="1" ViewCount="164" Body="&lt;p&gt;How can I get the compilation report by using AUCTeX in spacemacs? &#xA;For example, when I use WinEdt in Windows, i can obtain the following compilation report: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;LaTeX Compilation Report (Pages:14)&lt;br&gt;&#xA;Error:0 Warnings: 32 Bad Box: 19&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me how to achieve such info. in spacemacs with AUTeX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="12871" LastEditorUserId="12871" LastEditDate="2016-08-04T23:21:24.843" LastActivityDate="2016-08-04T23:21:24.843" Title="How can I get the Latex compilation report by using AUCTeX in spacemacs" Tags="|latex|auctex|spacemacs|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26059" PostTypeId="1" CreationDate="2016-08-04T04:35:55.853" Score="7" ViewCount="1226" Body="&lt;p&gt;I want to globally replace &lt;code&gt;C-&lt;/code&gt; with &lt;code&gt;SPC&lt;/code&gt; in emacs. This should make almost all emacs bindings not awful chords, and should completely avoid colliding emacs with evil/vim. It should also be able to be done globally and automatically so you don't have to futz with new plugins to make them compatible with evil (unless they use things like single characters to do things). This also seems like a single consistent change, so there is a chance that it is not hard to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;C-x f&lt;/code&gt; becomes &lt;code&gt;SPC x f&lt;/code&gt;, &lt;code&gt;C-x C-f&lt;/code&gt; becomes &lt;code&gt;SPC x SPC f&lt;/code&gt;. Perhaps &lt;code&gt;M-&lt;/code&gt; becomes &lt;code&gt;SPC SPC&lt;/code&gt;, so &lt;code&gt;M-x&lt;/code&gt; is &lt;code&gt;SPC SPC x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are my assumptions correct? They are: this will make emacs and vim not collide, this will make most plugins compatible with evil out of the box.&lt;/li&gt;&#xA;&lt;li&gt;How do I actually do it?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12873" LastEditorUserId="12616" LastEditDate="2016-08-04T14:14:36.440" LastActivityDate="2016-10-04T12:27:19.820" Title="Globally replace C- with SPC" Tags="|key-bindings|evil|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26061" PostTypeId="2" ParentId="26059" CreationDate="2016-08-04T06:12:55.693" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It's not as simple as it sounds. Besides global keybindings, there are numerous keymaps, almost all major and minor modes install their own. It is possible, see below, but much more work than it seems. Tons of gotchas. I am using Prelude with evil, with a lot of my tweaks, and I keep ironing out wrinkles almost every week.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want smooth emacs and evil integration, and fond of using space as modifier, then why not give &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;Spacemacs&lt;/a&gt; a try? That's exactly what you are describing, within realm of possible of course (but incomparably better than you or I would do alone in a few weeks or even months, trust me.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12749" LastActivityDate="2016-08-04T06:12:55.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26065" PostTypeId="2" ParentId="25052" CreationDate="2016-08-04T12:12:47.693" Score="4" Body="&lt;p&gt;I use the following attribute in org file and it works with org-mode v8.2.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many bugs or incompatible updates in org-mode v8.3.5, so I suggest you to try it with v8.2.10.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: example&#xA;#+LABEL: fig:example-fig&#xA;#+ATTR_LATEX: :placement [H]&#xA;[[file:example.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11809" LastActivityDate="2016-08-04T12:12:47.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26066" PostTypeId="2" ParentId="25039" CreationDate="2016-08-04T12:24:04.320" Score="5" Body="&lt;p&gt;Add the following code to your &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(unless (server-running-p)&#xA;  (cond&#xA;   ((eq system-type 'windows-nt)&#xA;    (setq server-auth-dir &quot;~\\.emacs.d\\server\\&quot;))&#xA;   ((eq system-type 'gnu/linux)&#xA;    (setq server-auth-dir &quot;~/.emacs.d/server/&quot;)))&#xA;  (setq server-name &quot;emacs-server-file&quot;)&#xA;  (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can get access to server with &lt;code&gt;emacsclientw.exe&lt;/code&gt; in the &lt;code&gt;bin/&lt;/code&gt; directory under your emacs installation path.&lt;/p&gt;&#xA;" OwnerUserId="11809" LastActivityDate="2016-08-04T12:24:04.320" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26067" PostTypeId="2" ParentId="25038" CreationDate="2016-08-04T13:09:47.770" Score="4" Body="&lt;p&gt;The package&lt;sup&gt;*&lt;/sup&gt; name is &lt;code&gt;diff-mode&lt;/code&gt;, not &lt;code&gt;diff&lt;/code&gt;.  The &lt;code&gt;use-package&lt;/code&gt; package symbol depends on what is &lt;code&gt;provide&lt;/code&gt;d, see near the bottom of &lt;code&gt;diff-mode.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; provide the package&#xA;(provide 'diff-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I checked &lt;code&gt;diff-mode.el&lt;/code&gt; and found out that there is &lt;code&gt;diff-mode-shared-map&lt;/code&gt; which seems to have &lt;code&gt;M-o&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;diff-mode-shared-map&lt;/code&gt; binds &lt;code&gt;o&lt;/code&gt;, &lt;code&gt;diff-mode-map&lt;/code&gt; adds an &lt;kbd&gt;ESC&lt;/kbd&gt; prefix which is equivalent to &lt;code&gt;M-o&lt;/code&gt;.  Therefore &lt;code&gt;diff-mode-map&lt;/code&gt; is the map you want to modify.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package diff-mode&#xA;  :defer t&#xA;  :config&#xA;  (unbind-key &quot;M-o&quot; diff-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you could unbind &lt;code&gt;o&lt;/code&gt; in &lt;code&gt;diff-mode-shared-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package diff-mode&#xA;  :defer t&#xA;  :config&#xA;  (unbind-key &quot;o&quot; diff-mode-shared-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This would unbind &lt;code&gt;C-c = o&lt;/code&gt; in &lt;code&gt;diff-minor-mode&lt;/code&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;* This is not the same kind of package as a &lt;code&gt;package.el&lt;/code&gt; package)&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-08-04T13:09:47.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26068" PostTypeId="2" ParentId="26059" CreationDate="2016-08-04T14:41:52.367" Score="1" Body="&lt;p&gt;I'm not a vim/evil user, so I can't speak to the wisdom of this, but this seems to be pretty close to what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;SPC&quot;) 'event-apply-control-modifier)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2016-08-04T15:20:28.780" LastActivityDate="2016-08-04T15:20:28.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26069" PostTypeId="1" AcceptedAnswerId="26071" CreationDate="2016-08-04T16:54:42.070" Score="3" ViewCount="1327" Body="&lt;p&gt;When I incrementally search for a phrase with &lt;kbd&gt;C-S&lt;/kbd&gt;, emacs usually highlights &lt;em&gt;all&lt;/em&gt; matching results visible in the buffer by giving them a different background color. However, my current theme apparently uses the same background color as the normal background color, meaning I can't see the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I specify a background color for matching search results?&lt;/p&gt;&#xA;" OwnerUserId="12866" LastActivityDate="2016-08-04T20:25:41.417" Title="How can I specify the background color for matching search results?" Tags="|colors|highlighting|isearch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26070" PostTypeId="2" ParentId="24335" CreationDate="2016-08-04T17:14:48.187" Score="3" Body="&lt;p&gt;I found the solution to your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your file should look like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: conceptmap&#xA;#+begin_src org  :exports none&#xA; (ONE) {TWO} (THREE) &#xA; (FOUR) {FIVE} (SIX)&#xA;#+end_src&#xA;&#xA;#+begin_src emacs-lisp :noweb yes &#xA;  (downcase &quot;&#xA;    &amp;lt;&amp;lt;conceptmap2&amp;gt;&amp;gt;&#xA;   &quot;&#xA;  )&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pay close attention to the &quot;, as your original &quot;input&quot; would be parsed directly and strings like (ONE) would be interpreted as functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another extremely important point is that the noweb reference must be on its own line as it seems there is either a bug, or an underdocumented limitation on the noweb expansion algorithm (I have no idea if the limitation is woth fixing )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a little example of what happens if the noweb reference is in its own line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+name: test&#xA; #+BEGIN_SRC emacs-lisp&#xA;  (let ((a 1)&#xA;        (b 2)&#xA;        (c 3))&#xA;    (+ a b c))&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC emacs-lisp :noweb yes&#xA;  (+ 4 &amp;lt;&amp;lt;test&amp;gt;&amp;gt;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which get expanded as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 4 (let ((a 1)&#xA;(+ 4       (b 2)&#xA;(+ 4       (c 3))&#xA;(+ 4   (+ a b c)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8289" LastActivityDate="2016-08-04T17:14:48.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26071" PostTypeId="2" ParentId="26069" CreationDate="2016-08-04T17:47:43.447" Score="3" Body="&lt;p&gt;You are looking for the &lt;code&gt;lazy-highlight&lt;/code&gt; face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You didn't mention what color your background is, so modify the below as needed:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'lazy-highlight nil :background &quot;green&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similarly, you can set the foreground color with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'lazy-highlight nil :foreground &quot;black&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you can combine the two with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'lazy-highlight nil :foreground &quot;black&quot; :background &quot;green&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To figure out what face needed to be modified, I did &lt;code&gt;M-x describe-char&lt;/code&gt; as described in &lt;a href=&quot;//emacs.stackexchange.com/a/22449/675&quot;&gt;this answer&lt;/a&gt;. I first had to set &lt;code&gt;lazy-highlight-cleanup&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; so that the selection wasn't cleared when exiting the isearch.&lt;/p&gt;&#xA;" OwnerUserId="675" LastEditorUserId="675" LastEditDate="2016-08-04T20:25:41.417" LastActivityDate="2016-08-04T20:25:41.417" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26073" PostTypeId="1" CreationDate="2016-08-04T18:09:21.460" Score="2" ViewCount="2054" Body="&lt;p&gt;I want Emacs to default to Emacs bindings, but to be able to define a list of modes in &lt;code&gt;init.el&lt;/code&gt; that enable &lt;code&gt;evil-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want something similar to this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://wikemacs.org/wiki/Evil#Enter_an_emacs_mode_in_a_given_state&quot; rel=&quot;nofollow&quot;&gt;http://wikemacs.org/wiki/Evil#Enter_an_emacs_mode_in_a_given_state&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but in reverse, where evil is explicitly enabled by mode, rather than Emacs bindings being enabled by mode.&lt;/p&gt;&#xA;" OwnerUserId="12883" LastEditorUserId="105" LastEditDate="2016-08-04T20:06:10.003" LastActivityDate="2018-01-01T23:54:31.943" Title="Enable evil in specific modes" Tags="|evil|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26074" PostTypeId="1" AcceptedAnswerId="26125" CreationDate="2016-08-04T19:59:54.863" Score="1" ViewCount="271" Body="&lt;p&gt;I have a multi-file patch and ediff-patch-file doesn't find the files unless I manually remove all of the &quot;a/&quot; and &quot;b/&quot; prefixes from the patch first. In other words, it acts like &quot;patch -p0&quot; when I want &quot;patch -p1&quot;. How do I tell ediff to do what I want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff --git a/src/java/main/com/example/player/PlayerApplication.java b/src/java/main/com/example/player/PlayerApplication.java&#xA;--- a/src/java/main/com/example/player/PlayerApplication.java&#xA;+++ b/src/java/main/com/example/player/PlayerApplication.java&#xA;@@ -907,6 +907,7 @@&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Version: GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) &lt;/p&gt;&#xA;" OwnerUserId="2240" LastActivityDate="2016-08-09T02:01:04.720" Title="How to make ediff-patch-file strip leading path components?" Tags="|ediff|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26077" PostTypeId="1" CreationDate="2016-08-04T21:47:44.873" Score="1" ViewCount="1681" Body="&lt;p&gt;I like Emacs but I hate the default shortcuts. I'm trying to make them more like Sublime Text, Atom, ...&#xA;Most shortcuts I can change without a problem, but &lt;code&gt;ESC&lt;/code&gt; seems to be more difficult. I don't wont to press &lt;code&gt;ESC&lt;/code&gt; 3 times or &lt;code&gt;C-g&lt;/code&gt; to exit something. &#xA;Can I remove &lt;code&gt;ESC&lt;/code&gt; as a prefix key? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this, but that doesn't work:&#xA;&lt;code&gt;(global-set-key (kbd &quot;ESC&quot;) 'keyboard-escape-quit)&lt;/code&gt;&#xA;It seems to break other shortcuts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Emacs on Ubuntu 16, but I connect from Windows with putty. (I got all the function keys working under putty)&lt;/p&gt;&#xA;" OwnerUserId="11278" LastEditorUserId="105" LastEditDate="2016-08-05T01:59:07.637" LastActivityDate="2016-08-05T01:59:07.637" Title="Map ESC to keyboard-escape-quit" Tags="|key-bindings|prefix-keys|escape|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26078" PostTypeId="1" AcceptedAnswerId="26087" CreationDate="2016-08-04T22:55:56.983" Score="2" ViewCount="955" Body="&lt;p&gt;I want to use the same configuration for both Ubuntu and Windows, so I want to share my &lt;code&gt;~/.emacs&lt;/code&gt; between boxes. I'd like, however, to use the Consolas font in Windows, and Ubuntu Mono font in Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I autodetect which OS emacs is running in, and define the font code conditionally on the environment?&lt;/p&gt;&#xA;" OwnerUserId="10865" LastEditorUserId="253" LastEditDate="2016-08-05T16:56:24.850" LastActivityDate="2016-08-23T14:35:31.853" Title="How do I set a specific font for Windows and Ubuntu?" Tags="|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26079" PostTypeId="1" AcceptedAnswerId="41280" CreationDate="2016-08-05T00:29:24.667" Score="3" ViewCount="133" Body="&lt;p&gt;PyCharm (and other JetBrains products) has wonderful feature — &quot;contexts&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can configure task server (e.g Github Issue Tracker, Redmine, Trello, etc or use built-in one). When you switch task this feature saved open tabs with files, branches, tasks and everything related to current task and than you can easily turn back to this &quot;context&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there anything similar for Emacs (I'm about context plugin)?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2759" LastActivityDate="2018-04-30T18:27:57.990" Title="Emacs &quot;context&quot; plugin for switching between different tasks in one project without loosing concentration" Tags="|ide|project|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26080" PostTypeId="2" ParentId="26079" CreationDate="2016-08-05T01:54:55.790" Score="3" Body="&lt;p&gt;Dunno exactly what constitutes a &quot;project&quot; in your context, but have a look at desktop bookmarks, with &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Bookmark+&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An Emacs &lt;em&gt;desktop&lt;/em&gt; records (and subsequently restores) the kinds of thing you mention: frames, windows, buffers (open files etc.), variable values,...  With only vanilla Emacs, people tend to use only a single desktop, and they use it only to save the final state of an Emacs session and restore then that state when the next session starts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But with Bookmark+, you can easily switch among any number of desktops, just by &quot;jumping&quot; to desktop bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;bmkp-set-desktop-bookmark&lt;/code&gt; (bound by default to &lt;strong&gt;&lt;code&gt;K&lt;/code&gt;&lt;/strong&gt; on the bookmark keymap, which is by default on prefix key &lt;code&gt;C-x p&lt;/code&gt; (so &lt;strong&gt;&lt;code&gt;C-x p K&lt;/code&gt;&lt;/strong&gt;), saves the current Emacs state in a desktop bookmark (or updates an existing such bookmark).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;bmk-desktop-jump&lt;/code&gt;, bound by default to &lt;strong&gt;&lt;code&gt;K&lt;/code&gt;&lt;/strong&gt; on the bookmark jump keymap, which is by default on prefix key &lt;code&gt;C-x j&lt;/code&gt; (so &lt;strong&gt;&lt;code&gt;C-x j K&lt;/code&gt;&lt;/strong&gt;), prompts you for a desktop bookmark name (with completion), and jumps to the one you choose, which means that it switches Emacs to that desktop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command &lt;strong&gt;&lt;code&gt;bmkp-cycle-desktop&lt;/code&gt;&lt;/strong&gt; (not bound by default) cycles through your desktop bookmarks.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-05T01:54:55.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26081" PostTypeId="2" ParentId="332" CreationDate="2016-08-05T03:30:28.777" Score="22" Body="&lt;p&gt;@Sigma's answer is a good start, but it doesn't filter by executability, nor does it allow for extra suffixes.  On windows, for example, running &lt;code&gt;a&lt;/code&gt; can invoke &lt;code&gt;a.exe&lt;/code&gt;, if that's what's in your path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So use &lt;code&gt;executable-find&lt;/code&gt;; here's the definition (taken from Emacs' sources), if you're curious:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun executable-find (command)&#xA;  &quot;Search for COMMAND in `exec-path' and return the absolute file name.&#xA;Return nil if COMMAND is not found anywhere in `exec-path'.&quot;&#xA;  ;; Use 1 rather than file-executable-p to better match the behavior of&#xA;  ;; call-process.&#xA;  (locate-file command exec-path exec-suffixes 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2016-09-11T14:00:53.217" LastActivityDate="2016-09-11T14:00:53.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26082" PostTypeId="1" AcceptedAnswerId="26089" CreationDate="2016-08-05T04:26:17.200" Score="0" ViewCount="348" Body="&lt;p&gt;I'm using &lt;code&gt;groovy-mode&lt;/code&gt; with &lt;code&gt;company-mode&lt;/code&gt; enabled; completion suggestions are in all lowercase. Whereas, in &lt;code&gt;java-mode&lt;/code&gt; -- a built-in package, and others such as &lt;code&gt;python-mode&lt;/code&gt;, &lt;code&gt;ruby-mode&lt;/code&gt;, company is giving camelCase suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we get similar behaviour in &lt;code&gt;groovy-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12861" LastEditorUserId="105" LastEditDate="2016-08-05T16:43:43.643" LastActivityDate="2016-08-05T16:43:43.643" Title="Company-mode in groovy-mode: How to get completions other than lowercase?" Tags="|company-mode|completion|" AnswerCount="1" CommentCount="0" ClosedDate="2020-05-06T05:46:31.393" ContentLicense="CC BY-SA 3.0" />
  <row Id="26083" PostTypeId="1" AcceptedAnswerId="26480" CreationDate="2016-08-05T04:27:05.610" Score="4" ViewCount="742" Body="&lt;p&gt;I noticed I copy-paste entire headers (with content) quite often. The problem I also notice is that this creates a lot of headers with duplicate IDs. I wonder if anyone has a function he would like to share or can help me create a function that will&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;copy current header and contents (&lt;code&gt;org-copy-subtree&lt;/code&gt;) at point&lt;/li&gt;&#xA;&lt;li&gt;paste it below current header&lt;/li&gt;&#xA;&lt;li&gt;change ID&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="12616" LastEditDate="2016-08-05T16:28:52.110" LastActivityDate="2016-08-23T02:04:50.067" Title="Org-mode function to duplicate current header and change ID" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26084" PostTypeId="1" CreationDate="2016-08-05T06:55:02.800" Score="1" ViewCount="364" Body="&lt;p&gt;Currently I have a heap of org files which I publish into a knowledge base. Every once in a while a special character or some formatting will stop the publishing. Is it possible to ignore the error and push on with the rest of the files?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; org publish options&#xA;(setq org-publish-project-alist&#xA;      '(&#xA;        ;; ... add all the components here (see below)...&#xA;&#xA;        ;; All org files (notes)&#xA;        (&quot;org-notes&quot;&#xA;         :base-directory &quot;~/org/business&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;/var/www/manual/&quot;&#xA;         :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot;&#xA;         :recursive t&#xA;         :publishing-function org-html-publish-to-html&#xA;         :headline-levels 4            &#xA;         :auto-preamble t&#xA;         :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot;&#xA;         )&#xA;&#xA;        ;; Attachments&#xA;        (&quot;org-static&quot;&#xA;         :base-directory &quot;~/org/&quot;&#xA;         :base-extension &quot;css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|htaccess&quot;&#xA;         :publishing-directory &quot;/var/www/manual/&quot;&#xA;         :recursive t&#xA;         :publishing-function org-publish-attachment&#xA;         )&#xA;&#xA;        ;; Publish component&#xA;        (&quot;org&quot;&#xA;     :components (&quot;org-notes&quot; &quot;org-static&quot;))&#xA;&#xA;      ))&#xA;&#xA;; Create a little function to run publish mode in a shortcut&#xA;(defun puborg ()&#xA;  (interactive)&#xA;  (org-publish-project &quot;org&quot;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error I get is;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Publishing file /home/map7/org/business/website.org using ‘org-html-publish-to-html’&#xA;apply: Wrong type argument: listp, #(&quot;Knowledge Base&quot; 0 14 (:parent (#0)))&#xA;Saving file /home/map7/org/business/website.org...&#xA;Wrote /home/map7/org/business/website.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I remove the following line it works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE:   Website&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE: Add a small complete org file&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have an test.org file with the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Test publish org file&#xA;&#xA;This file is to test the issue of publishing an org file which has a title.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then everything publishes fine, then I change this test.org file to the following;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Test publish org file&#xA;&#xA;This file is to test the issue of publishing an org file which has a title.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now with debugging mode on I try and publish and get the following error;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp #(&quot;Test publish org file&quot; 0 21 (:parent (#1))))&#xA;  org-element-set-contents(#(&quot;Test publish org file&quot; 0 21 (:parent (#0))))&#xA;  apply(org-element-set-contents #(&quot;Test publish org file&quot; 0 21 (:parent (#0))) nil)&#xA;  #[(s) &quot;\306\307\310#\311\312  \211:\204\313\202\&quot;@9\203!AA\202\&quot;)\&quot;\210\314\315\n \211:\2043\313\202@@9\203?AA\202@)#\210 \316\211\n;\203V\317\320\f#\202\\\321A@\f\&quot;*\211;\203n\322\313\f&#xA;$\202zA\323A@\f&#xA;#\240\210+\210\nA   A@\240\210\n    @\240*\207&quot; [s new old element property value replace-regexp-in-string &quot;\n&quot; &quot; &quot; mapc #[(blob) &quot;\305 \211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207&quot; [blob old value property element :parent org-add-props nil plist-put] 6] nil apply org-element-set-contents :parent get-text-property 0 plist-get org-add-props plist-put] 6](#(&quot;Test publish org file&quot; 0 21 (:parent (#0))))&#xA;  #[(--data) &quot;\211:\204 ;\205\306\202   @9\205  @)?\206\337\203,\307\310\&quot;&amp;gt;\206\337\n\2047\311\f\&quot;\202\337\n\312=\203\\\311\f\211:\204J\313\202W    @9\203V AA\202W )\&quot;\202\337\n&#xA;&amp;gt;\203\202!\211\203\201\203z\314\315\&quot;\210\202\201B)\316=\203\312;\204\312\n\236A\313\211\203\311@\f ;\203\266\317\320   #\202\275\307   A@\&quot;*!\210A\211\204\234*\203\202\316=\203\202\n&amp;gt;\203\202\313 \211\203\201@\211 @ A  ;\203\317\320   #\202\307   A@\&quot;*!\&quot;!\203w\&quot;#\235\203_\&quot;$\235\203P\321!!\313%\211\203L@%\f%A!\210\f%@!\210A\211\2042*\202w\f!A!\210\f!@!\210\202w\&quot;$\235\203r\311\f\321!!\&quot;\210\202w\f!!\210*A\211\204\350*\n&amp;amp;&amp;gt;\206\337\211:\204\224\313\202\241    @9\203\240  AA\202\241  )?\206\337\322=\203\265\n'&amp;gt;?\206\337\323=\203\303\n(&amp;gt;\206\337\311\f\211:\204\320\313\202\335    @9\203\334  AA\202\335  )\&quot;)\207&quot; [--data element --type info --walk-tree types plain-text plist-get :ignore-list mapc org-data nil throw --map-first-match objects get-text-property 0 reverse greater-elements elements fun result first-match --acc --category org-element-secondary-value-alist p --dolist-tail-- property with-affiliated org-element-all-elements org-element--parsed-properties-alist kwd-pair value kwd org-element-dual-keywords org-element-multiple-keywords line no-recursion org-element-greater-elements org-element-all-objects] 6](#(&quot;Test publish org file&quot; 0 21 (:parent (#0))))&#xA;  mapc(#[(--data) &quot;\211:\204    ;\205\306\202   @9\205  @)?\206\337\203,\307\310\&quot;&amp;gt;\206\337\n\2047\311\f\&quot;\202\337\n\312=\203\\\311\f\211:\204J\313\202W    @9\203V AA\202W )\&quot;\202\337\n&#xA;&amp;gt;\203\202!\211\203\201\203z\314\315\&quot;\210\202\201B)\316=\203\312;\204\312\n\236A\313\211\203\311@\f ;\203\266\317\320   #\202\275\307   A@\&quot;*!\210A\211\204\234*\203\202\316=\203\202\n&amp;gt;\203\202\313 \211\203\201@\211 @ A  ;\203\317\320   #\202\307   A@\&quot;*!\&quot;!\203w\&quot;#\235\203_\&quot;$\235\203P\321!!\313%\211\203L@%\f%A!\210\f%@!\210A\211\2042*\202w\f!A!\210\f!@!\210\202w\&quot;$\235\203r\311\f\321!!\&quot;\210\202w\f!!\210*A\211\204\350*\n&amp;amp;&amp;gt;\206\337\211:\204\224\313\202\241    @9\203\240  AA\202\241  )?\206\337\322=\203\265\n'&amp;gt;?\206\337\323=\203\303\n(&amp;gt;\206\337\311\f\211:\204\320\313\202\335    @9\203\334  AA\202\335  )\&quot;)\207&quot; [--data element --type info --walk-tree types plain-text plist-get :ignore-list mapc org-data nil throw --map-first-match objects get-text-property 0 reverse greater-elements elements fun result first-match --acc --category org-element-secondary-value-alist p --dolist-tail-- property with-affiliated org-element-all-elements org-element--parsed-properties-alist kwd-pair value kwd org-element-dual-keywords org-element-multiple-keywords line no-recursion org-element-greater-elements org-element-all-objects] 6] (#(&quot;Test publish org file&quot; 0 21 (:parent #0))))&#xA;  #[(--data) &quot;\211:\204 ;\205\306\202   @9\205  @)?\206\337\203,\307\310\&quot;&amp;gt;\206\337\n\2047\311\f\&quot;\202\337\n\312=\203\\\311\f\211:\204J\313\202W    @9\203V AA\202W )\&quot;\202\337\n&#xA;&amp;gt;\203\202!\211\203\201\203z\314\315\&quot;\210\202\201B)\316=\203\312;\204\312\n\236A\313\211\203\311@\f ;\203\266\317\320   #\202\275\307   A@\&quot;*!\210A\211\204\234*\203\202\316=\203\202\n&amp;gt;\203\202\313 \211\203\201@\211 @ A  ;\203\317\320   #\202\307   A@\&quot;*!\&quot;!\203w\&quot;#\235\203_\&quot;$\235\203P\321!!\313%\211\203L@%\f%A!\210\f%@!\210A\211\2042*\202w\f!A!\210\f!@!\210\202w\&quot;$\235\203r\311\f\321!!\&quot;\210\202w\f!!\210*A\211\204\350*\n&amp;amp;&amp;gt;\206\337\211:\204\224\313\202\241    @9\203\240  AA\202\241  )?\206\337\322=\203\265\n'&amp;gt;?\206\337\323=\203\303\n(&amp;gt;\206\337\311\f\211:\204\320\313\202\335    @9\203\334  AA\202\335  )\&quot;)\207&quot; [--data element --type info --walk-tree types plain-text plist-get :ignore-list mapc org-data nil throw --map-first-match objects get-text-property 0 reverse greater-elements elements fun result first-match --acc --category org-element-secondary-value-alist p --dolist-tail-- property with-affiliated org-element-all-elements org-element--parsed-properties-alist kwd-pair value kwd org-element-dual-keywords org-element-multiple-keywords line no-recursion org-element-greater-elements org-element-all-objects] 6]((#(&quot;Test publish org file&quot; 0 21 (:parent #0))))&#xA;  org-element-map((#(&quot;Test publish org file&quot; 0 21 (:parent #0))) plain-text #[(s) &quot;\306\307\310#\311\312    \211:\204\313\202\&quot;@9\203!AA\202\&quot;)\&quot;\210\314\315\n \211:\2043\313\202@@9\203?AA\202@)#\210 \316\211\n;\203V\317\320\f#\202\\\321A@\f\&quot;*\211;\203n\322\313\f&#xA;$\202zA\323A@\f&#xA;#\240\210+\210\nA   A@\240\210\n    @\240*\207&quot; [s new old element property value replace-regexp-in-string &quot;\n&quot; &quot; &quot; mapc #[(blob) &quot;\305 \211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207&quot; [blob old value property element :parent org-add-props nil plist-put] 6] nil apply org-element-set-contents :parent get-text-property 0 plist-get org-add-props plist-put] 6])&#xA;  org-export--get-inbuffer-options([cl-struct-org-export-backend html nil ((bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-definition . org-html-footnote-definition) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) (paragraph . org-html-paragraph) (plain-list . org-html-plain-list) (plain-text . org-html-plain-text) (planning . org-html-planning) (property-drawer . org-html-property-drawer) (quote-block . org-html-quote-block) (radio-target . org-html-radio-target) (section . org-html-section) (special-block . org-html-special-block) (src-block . org-html-src-block) (statistics-cookie . org-html-statistics-cookie) (strike-through . org-html-strike-through) (subscript . org-html-subscript) (superscript . org-html-superscript) (table . org-html-table) (table-cell . org-html-table-cell) (table-row . org-html-table-row) (target . org-html-target) (template . org-html-template) (timestamp . org-html-timestamp) (underline . org-html-underline) (verbatim . org-html-verbatim) (verse-block . org-html-verse-block)) ((:html-doctype &quot;HTML_DOCTYPE&quot; nil org-html-doctype) (:html-container &quot;HTML_CONTAINER&quot; nil org-html-container-element) (:description &quot;DESCRIPTION&quot; nil nil newline) (:keywords &quot;KEYWORDS&quot; nil nil space) (:html-html5-fancy nil &quot;html5-fancy&quot; org-html-html5-fancy) (:html-link-use-abs-url nil &quot;html-link-use-abs-url&quot; org-html-link-use-abs-url) (:html-link-home &quot;HTML_LINK_HOME&quot; nil org-html-link-home) (:html-link-up &quot;HTML_LINK_UP&quot; nil org-html-link-up) (:html-mathjax &quot;HTML_MATHJAX&quot; nil &quot;&quot; space) (:html-link-use-abs-url nil &quot;html-link-use-abs-url&quot; org-html-link-use-abs-url) (:html-postamble nil &quot;html-postamble&quot; org-html-postamble) (:html-preamble nil &quot;html-preamble&quot; org-html-preamble) (:html-head &quot;HTML_HEAD&quot; nil org-html-head newline) (:html-head-extra &quot;HTML_HEAD_EXTRA&quot; nil org-html-head-extra newline) (:subtitle &quot;SUBTITLE&quot; nil nil parse) (:html-head-include-default-style nil &quot;html-style&quot; org-html-head-include-default-style) (:html-head-include-scripts nil &quot;html-scripts&quot; org-html-head-include-scripts) (:html-allow-name-attribute-in-anchors nil nil org-html-allow-name-attribute-in-anchors) (:html-divs nil nil org-html-divs) (:html-checkbox-type nil nil org-html-checkbox-type) (:html-extension nil nil org-html-extension) (:html-footnote-format nil nil org-html-footnote-format) (:html-footnote-separator nil nil org-html-footnote-separator) (:html-footnotes-section nil nil org-html-footnotes-section) (:html-format-drawer-function nil nil org-html-format-drawer-function) (:html-format-headline-function nil nil org-html-format-headline-function) (:html-format-inlinetask-function nil nil org-html-format-inlinetask-function) (:html-home/up-format nil nil org-html-home/up-format) (:html-indent nil nil org-html-indent) (:html-infojs-options nil nil org-html-infojs-options) (:html-infojs-template nil nil org-html-infojs-template) (:html-inline-image-rules nil nil org-html-inline-image-rules) (:html-link-org-files-as-html nil nil org-html-link-org-files-as-html) (:html-mathjax-options nil nil org-html-mathjax-options) (:html-mathjax-template nil nil org-html-mathjax-template) (:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format) (:html-postamble-format nil nil org-html-postamble-format) (:html-preamble-format nil nil org-html-preamble-format) (:html-table-align-individual-fields nil nil org-html-table-align-individual-fields) (:html-table-caption-above nil nil org-html-table-caption-above) (:html-table-data-tags nil nil org-html-table-data-tags) (:html-table-header-tags nil nil org-html-table-header-tags) (:html-table-use-header-tags-for-first-column nil nil org-html-table-use-header-tags-for-first-column) (:html-tag-class-prefix nil nil org-html-tag-class-prefix) (:html-text-markup-alist nil nil org-html-text-markup-alist) (:html-todo-kwd-class-prefix nil nil org-html-todo-kwd-class-prefix) (:html-toplevel-hlevel nil nil org-html-toplevel-hlevel) (:html-use-infojs nil nil org-html-use-infojs) (:html-validation-link nil nil org-html-validation-link) (:html-viewport nil nil org-html-viewport) ...) ((:filter-options . org-html-infojs-install-script) (:filter-final-output . org-html-final-function)) (&quot;HTML&quot;) (104 &quot;Export to HTML&quot; ((72 &quot;As HTML buffer&quot; org-html-export-as-html) (104 &quot;As HTML file&quot; org-html-export-to-html) (111 &quot;As HTML file and open&quot; (lambda (a s v b) (if a (org-html-export-to-html t s v b) (org-open-file (org-html-export-to-html nil s v b)))))))])&#xA;  org-export-get-environment([cl-struct-org-export-backend html nil ((bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-definition . org-html-footnote-definition) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) (paragraph . org-html-paragraph) (plain-list . org-html-plain-list) (plain-text . org-html-plain-text) (planning . org-html-planning) (property-drawer . org-html-property-drawer) (quote-block . org-html-quote-block) (radio-target . org-html-radio-target) (section . org-html-section) (special-block . org-html-special-block) (src-block . org-html-src-block) (statistics-cookie . org-html-statistics-cookie) (strike-through . org-html-strike-through) (subscript . org-html-subscript) (superscript . org-html-superscript) (table . org-html-table) (table-cell . org-html-table-cell) (table-row . org-html-table-row) (target . org-html-target) (template . org-html-template) (timestamp . org-html-timestamp) (underline . org-html-underline) (verbatim . org-html-verbatim) (verse-block . org-html-verse-block)) ((:html-doctype &quot;HTML_DOCTYPE&quot; nil org-html-doctype) (:html-container &quot;HTML_CONTAINER&quot; nil org-html-container-element) (:description &quot;DESCRIPTION&quot; nil nil newline) (:keywords &quot;KEYWORDS&quot; nil nil space) (:html-html5-fancy nil &quot;html5-fancy&quot; org-html-html5-fancy) (:html-link-use-abs-url nil &quot;html-link-use-abs-url&quot; org-html-link-use-abs-url) (:html-link-home &quot;HTML_LINK_HOME&quot; nil org-html-link-home) (:html-link-up &quot;HTML_LINK_UP&quot; nil org-html-link-up) (:html-mathjax &quot;HTML_MATHJAX&quot; nil &quot;&quot; space) (:html-link-use-abs-url nil &quot;html-link-use-abs-url&quot; org-html-link-use-abs-url) (:html-postamble nil &quot;html-postamble&quot; org-html-postamble) (:html-preamble nil &quot;html-preamble&quot; org-html-preamble) (:html-head &quot;HTML_HEAD&quot; nil org-html-head newline) (:html-head-extra &quot;HTML_HEAD_EXTRA&quot; nil org-html-head-extra newline) (:subtitle &quot;SUBTITLE&quot; nil nil parse) (:html-head-include-default-style nil &quot;html-style&quot; org-html-head-include-default-style) (:html-head-include-scripts nil &quot;html-scripts&quot; org-html-head-include-scripts) (:html-allow-name-attribute-in-anchors nil nil org-html-allow-name-attribute-in-anchors) (:html-divs nil nil org-html-divs) (:html-checkbox-type nil nil org-html-checkbox-type) (:html-extension nil nil org-html-extension) (:html-footnote-format nil nil org-html-footnote-format) (:html-footnote-separator nil nil org-html-footnote-separator) (:html-footnotes-section nil nil org-html-footnotes-section) (:html-format-drawer-function nil nil org-html-format-drawer-function) (:html-format-headline-function nil nil org-html-format-headline-function) (:html-format-inlinetask-function nil nil org-html-format-inlinetask-function) (:html-home/up-format nil nil org-html-home/up-format) (:html-indent nil nil org-html-indent) (:html-infojs-options nil nil org-html-infojs-options) (:html-infojs-template nil nil org-html-infojs-template) (:html-inline-image-rules nil nil org-html-inline-image-rules) (:html-link-org-files-as-html nil nil org-html-link-org-files-as-html) (:html-mathjax-options nil nil org-html-mathjax-options) (:html-mathjax-template nil nil org-html-mathjax-template) (:html-metadata-timestamp-format nil nil org-html-metadata-timestamp-format) (:html-postamble-format nil nil org-html-postamble-format) (:html-preamble-format nil nil org-html-preamble-format) (:html-table-align-individual-fields nil nil org-html-table-align-individual-fields) (:html-table-caption-above nil nil org-html-table-caption-above) (:html-table-data-tags nil nil org-html-table-data-tags) (:html-table-header-tags nil nil org-html-table-header-tags) (:html-table-use-header-tags-for-first-column nil nil org-html-table-use-header-tags-for-first-column) (:html-tag-class-prefix nil nil org-html-tag-class-prefix) (:html-text-markup-alist nil nil org-html-text-markup-alist) (:html-todo-kwd-class-prefix nil nil org-html-todo-kwd-class-prefix) (:html-toplevel-hlevel nil nil org-html-toplevel-hlevel) (:html-use-infojs nil nil org-html-use-infojs) (:html-validation-link nil nil org-html-validation-link) (:html-viewport nil nil org-html-viewport) ...) ((:filter-options . org-html-infojs-install-script) (:filter-final-output . org-html-final-function)) (&quot;HTML&quot;) (104 &quot;Export to HTML&quot; ((72 &quot;As HTML buffer&quot; org-html-export-as-html) (104 &quot;As HTML file&quot; org-html-export-to-html) (111 &quot;As HTML file and open&quot; (lambda (a s v b) (if a (org-html-export-to-html t s v b) (org-open-file (org-html-export-to-html nil s v b)))))))] nil (:output-file &quot;/var/www/manual/test.html&quot; :base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :filter-final-output (org-publish--collect-references org-publish-collect-index)))&#xA;  org-export-as(html nil nil nil (:output-file &quot;/var/www/manual/test.html&quot; :base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :filter-final-output (org-publish--collect-references org-publish-collect-index)))&#xA;  org-export-to-file(html &quot;/var/www/manual/test.html&quot; nil nil nil nil (:base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :filter-final-output (org-publish--collect-references org-publish-collect-index)))&#xA;  org-publish-org-to(html &quot;/home/map7/org/business/test.org&quot; &quot;.html&quot; (:base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot;) &quot;/var/www/manual/&quot;)&#xA;  org-html-publish-to-html((:base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot;) &quot;/home/map7/org/business/test.org&quot; &quot;/var/www/manual/&quot;)&#xA;  org-publish-file(&quot;/home/map7/org/business/test.org&quot; (&quot;org-notes&quot; :base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot;) t)&#xA;  #[(project) &quot;\306@!\210A\307  \310\&quot;\307  \311\&quot;\307  \312\&quot;\206\313\307  \314\&quot;\206#\315\307 \316\&quot;\206-\307 \317\&quot;\2068  \307   \320\&quot;\307  \321\&quot;\322\n\&quot;!\323\324\307 \325\&quot;\&quot;\&quot;\203^\326\327!\210\203g&#xA;\f\&quot;\210!\330#\211$\203\216$@\211#\&quot;\232\204\205\331#\332#\210$A\211$\204r*\307 \333\&quot;\203\245\334\307  \325\&quot;\&quot;\210\331\&quot;\332#\210\203\256\326\335!\210\336 .\207&quot; [project project-plist exclude-regexp sitemap-p sitemap-filename sitemap-function org-publish-initialize-cache plist-get :exclude :auto-sitemap :sitemap-filename &quot;sitemap.org&quot; :sitemap-function org-publish-org-sitemap :sitemap-date-format :sitemap-file-entry-format :preparation-function :completion-function org-publish-get-base-files expand-file-name &quot;theindex.org&quot; :base-directory run-hooks preparation-function nil org-publish-file t :makeindex org-publish-index-generate-theindex completion-function org-publish-write-cache-file org-publish-sitemap-date-format org-publish-sitemap-file-entry-format files theindex file --dolist-tail--] 6]((&quot;org-notes&quot; :base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot;))&#xA;  mapc(#[(project) &quot;\306@!\210A\307 \310\&quot;\307  \311\&quot;\307  \312\&quot;\206\313\307  \314\&quot;\206#\315\307 \316\&quot;\206-\307 \317\&quot;\2068  \307   \320\&quot;\307  \321\&quot;\322\n\&quot;!\323\324\307 \325\&quot;\&quot;\&quot;\203^\326\327!\210\203g&#xA;\f\&quot;\210!\330#\211$\203\216$@\211#\&quot;\232\204\205\331#\332#\210$A\211$\204r*\307 \333\&quot;\203\245\334\307  \325\&quot;\&quot;\210\331\&quot;\332#\210\203\256\326\335!\210\336 .\207&quot; [project project-plist exclude-regexp sitemap-p sitemap-filename sitemap-function org-publish-initialize-cache plist-get :exclude :auto-sitemap :sitemap-filename &quot;sitemap.org&quot; :sitemap-function org-publish-org-sitemap :sitemap-date-format :sitemap-file-entry-format :preparation-function :completion-function org-publish-get-base-files expand-file-name &quot;theindex.org&quot; :base-directory run-hooks preparation-function nil org-publish-file t :makeindex org-publish-index-generate-theindex completion-function org-publish-write-cache-file org-publish-sitemap-date-format org-publish-sitemap-file-entry-format files theindex file --dolist-tail--] 6] ((&quot;org-notes&quot; :base-directory &quot;~/org/business&quot; :base-extension &quot;org&quot; :publishing-directory &quot;/var/www/manual/&quot; :style &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot; :recursive t :publishing-function org-html-publish-to-html :headline-levels 4 :auto-preamble t :html-head &quot;&amp;lt;link rel=\&quot;stylesheet\&quot; href=\&quot;css/stylesheet.css\&quot; type=\&quot;text/css\&quot; /&amp;gt;&quot;) (&quot;org-static&quot; :base-directory &quot;~/org/&quot; :base-extension &quot;css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|htaccess&quot; :publishing-directory &quot;/var/www/manual/&quot; :recursive t :publishing-function org-publish-attachment)))&#xA;  org-publish-projects(((&quot;org&quot; :components (&quot;org-notes&quot; &quot;org-static&quot;))))&#xA;  org-publish-project(&quot;org&quot;)&#xA;  puborg()&#xA;  funcall-interactively(puborg)&#xA;  call-interactively(puborg record nil)&#xA;  command-execute(puborg record)&#xA;  execute-extended-command(nil &quot;puborg&quot;)&#xA;  smex-read-and-run((&quot;org-publish&quot; &quot;magit-version&quot; &quot;toggle-debug-on-error&quot; &quot;eval-buffer&quot; &quot;slack-im-open&quot; &quot;slack-mode&quot; &quot;slack-start&quot; &quot;org-insert-link&quot; &quot;puborg&quot; &quot;ispell-word&quot; &quot;sudo-edit&quot; &quot;package-list-packages&quot; &quot;find-name-dired&quot; &quot;list-packages&quot; &quot;rotate-windows&quot; &quot;about-emacs&quot; &quot;bundle-outdated&quot; &quot;hide-sublevels&quot; &quot;javascript-mode&quot; &quot;package-install&quot; &quot;winner-undo&quot; &quot;org-screenshot&quot; &quot;volume&quot; &quot;multi-term&quot; &quot;org-table-sum&quot; &quot;org-toggle-inline-images&quot; &quot;twit&quot; &quot;magit-tag&quot; &quot;upcase-word&quot; &quot;paradox-list-packages&quot; &quot;term-send-esc&quot; &quot;magit-reset-hard&quot; &quot;size-indication-mode&quot; &quot;togetherly-server-start&quot; &quot;projectile-rails-console&quot; &quot;org-reveal-export-to-html-and-browse&quot; &quot;ispell&quot; &quot;calendar&quot; &quot;sql-postgres&quot; &quot;projectile-rails-mode&quot; &quot;linum-mode&quot; &quot;org-attach&quot; &quot;company-restclient&quot; &quot;ansible&quot; &quot;rbenv-use&quot; &quot;ruby-mode&quot; &quot;magit-diff&quot; &quot;crontab-mode&quot; &quot;menu-bar-mode&quot; &quot;query-replace&quot; ...))&#xA;  smex()&#xA;  funcall-interactively(smex)&#xA;  call-interactively(smex nil nil)&#xA;  command-execute(smex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9463" LastEditorUserId="9463" LastEditDate="2016-08-17T00:13:02.340" LastActivityDate="2016-08-17T00:13:02.340" Title="can publish org ignore errors and push on" Tags="|org-mode|org-publish|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26085" PostTypeId="1" CreationDate="2016-08-05T08:08:28.200" Score="12" ViewCount="2910" Body="&lt;p&gt;While regular paragraphs are happily indented under plain list items (using [SPACE] bar to indent the first line takes the rest along with) I have noticed that code blocks do not like to cooperate. Is there any way to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, this is what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [ ] My plain list item&#xA;&#xA;  Nicely indented paragraph, blah blah blah blah blah blah blah blah&#xA;  blah blah blah blah blah blah blah blah blah blah blah blah blah blah&#xA;  blah blah blah.&#xA;&#xA;  #+BEGIN_SRC elisp&#xA;; Uncooperative code block -&amp;gt; notice that only the first line indents.&#xA;(lambda () (do-something-amazing))&#xA;(blah-blah-blah)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [ ] My plain list item&#xA;&#xA;  Nicely indented paragraph, blah blah blah blah blah blah blah blah&#xA;  blah blah blah blah blah blah blah blah blah blah blah blah blah blah&#xA;  blah blah blah.&#xA;&#xA;  #+BEGIN_SRC elisp&#xA;  ; Happily indented code block -&amp;gt; notice that all code follows with :)&#xA;  (lambda () (do-something-amazing))&#xA;  (blah-blah-blah)&#xA;  #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-08-05T16:42:00.207" LastActivityDate="2018-10-26T07:00:28.890" Title="How to keep indented under plain list items in org-mode" Tags="|org-mode|formatting|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26087" PostTypeId="2" ParentId="26078" CreationDate="2016-08-05T09:51:40.397" Score="6" Body="&lt;p&gt;&#xA;You can check the &lt;code&gt;system-type&lt;/code&gt; and use &lt;code&gt;set-frame-font&lt;/code&gt; accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a short example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq my-prefered-font&#xA;      (cond ((eq system-type 'windows-nt) &quot;consolas&quot;)&#xA;            ((eq system-type 'gnu/linux) &quot;mono&quot;)&#xA;            (t nil)))&#xA;&#xA;(when my-prefered-font&#xA;  (set-frame-font my-prefered-font nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, that you can also set font size. For example I do &lt;code&gt;(setq my-prefered-font &quot;Hack-10&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hint: I found &lt;code&gt;list-fontsets&lt;/code&gt; useful to list available fonts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And one last note, I do the following to set system specific configurations in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(load-file (expand-file-name&#xA;            (cond ((eq system-type 'windows-nt) &quot;windows.el&quot;)&#xA;                  ((eq system-type 'gnu/linux) &quot;linux.el&quot;)&#xA;                  (t &quot;default-system.el&quot;))&#xA;            user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;code&gt;windows.el&lt;/code&gt;, &lt;code&gt;linux.el&lt;/code&gt;and &lt;code&gt;default-system.el&lt;/code&gt; in folder &lt;code&gt;~\.emacs.d&lt;/code&gt; with all the system specific stuff.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-23T14:35:31.853" LastActivityDate="2016-08-23T14:35:31.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26089" PostTypeId="2" ParentId="26082" CreationDate="2016-08-05T11:51:26.970" Score="2" Body="&lt;p&gt;If you use &lt;code&gt;company-dabbrev&lt;/code&gt; as the backend of &lt;code&gt;groovy-mode&lt;/code&gt;, the problem may be solved by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-dabbrev-downcase nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This command keeps the candidate as it is.&#xA;If you think that ignoring case is better when the candidates is collected, you&#xA;should add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-dabbrev-ignore-case t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Don't set &lt;code&gt;company-dabbrev-ignore-case&lt;/code&gt; &lt;code&gt;'keep-prefix'&lt;/code&gt; since only prefix is&#xA;kept as it is. Writing my answer, I refer to&#xA;&lt;a href=&quot;https://github.com/company-mode/company-mode/issues/60&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; on github page.&lt;/p&gt;&#xA;" OwnerUserId="12626" LastActivityDate="2016-08-05T11:51:26.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26090" PostTypeId="1" AcceptedAnswerId="26098" CreationDate="2016-08-05T12:20:27.640" Score="2" ViewCount="459" Body="&lt;p&gt;If the cursor is placed on a whitespace and there're multiple whitespaces between 2 words, how can I move the cursor backwards to the end of the 1st word?&lt;/p&gt;&#xA;" OwnerUserId="12851" LastEditorUserId="12851" LastEditDate="2016-08-05T14:38:02.783" LastActivityDate="2016-08-05T14:50:38.867" Title="Move the cursor backwards to the end of the 1st word on it's between 2 words" Tags="|cursor|motion|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26091" PostTypeId="2" ParentId="26090" CreationDate="2016-08-05T12:38:05.160" Score="2" Body="&lt;p&gt;You could&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;move cursor to the beginning of the first word with &lt;code&gt;M-b&lt;/code&gt; (&lt;code&gt;backward-word&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;and then move forward with &lt;code&gt;M-f&lt;/code&gt; (&lt;code&gt;forward-word&lt;/code&gt;), which place cursor after the end of the first word.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example (&lt;code&gt;*&lt;/code&gt; means point):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0: first    *   second&#xA;1: *first       second&#xA;2: first*       second&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want always go to the end of the word when moving backward, then use in &lt;code&gt;init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun backward-word-end ()&#xA;  &quot;Move backward to the end of the word.&quot;&#xA;  (interactive)&#xA;  (backward-word 2)&#xA;  (forward-word))&#xA;&#xA;(global-set-key (kbd &quot;M-b&quot;) 'backward-word-end)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;P.S. But don't forget about &lt;code&gt;local-set-key&lt;/code&gt; and &lt;code&gt;bind-key&lt;/code&gt; if you use &lt;code&gt;package&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-08-05T13:09:16.017" LastActivityDate="2016-08-05T13:09:16.017" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26093" PostTypeId="1" CreationDate="2016-08-05T13:17:44.267" Score="20" ViewCount="5064" Body="&lt;p&gt;I often find myself in the situation where I'm told to put absolute paths as directory local variable. For example &lt;a href=&quot;https://github.com/atilaneves/cmake-ide#non-cmake-projects&quot; rel=&quot;nofollow noreferrer&quot;&gt;cmake-ide&lt;/a&gt;'s &lt;code&gt;cmake-ide-project-dir&lt;/code&gt; and &lt;code&gt;cmake-ide-build-dir&lt;/code&gt;. Of course this is not very portable.&lt;/p&gt;&#xA;&lt;p&gt;So instead of&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;.dir-locals.el&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((nil . ((cmake-ide-project-dir . &amp;quot;/home/user/code/project&amp;quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I want something like&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;((nil . ((cmake-ide-project-dir . directory-of-current-dir-locals-file))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;How can I define such a variable &lt;code&gt;directory-of-current-dir-locals-file&lt;/code&gt;? And how would I set for example &lt;code&gt;cmake-ide-build-dir&lt;/code&gt;, which is typically &lt;code&gt;(concat directory-of-current-dir-locals-file &amp;quot;build&amp;quot;)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="23" LastEditorUserId="23" LastEditDate="2022-11-26T13:26:58.507" LastActivityDate="2022-11-26T13:26:58.507" Title="How can I set directory local variable in relative to .dir-locals.el file location?" Tags="|directory-local-variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="26094" PostTypeId="1" AcceptedAnswerId="30548" CreationDate="2016-08-05T13:18:49.847" Score="5" ViewCount="1432" Body="&lt;p&gt;I've enabled auto-complete-mode mode using prog-mode-hook like so: &lt;code&gt;(add-hook 'prog-mode-hook 'auto-complete-mode)&lt;/code&gt;, but I want auto-complete-mode to be disabled for python-mode. How can I achieve this ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried doing this :- &#xA;&lt;code&gt;(add-hook 'python-mode-hook (lambda() (auto-complete-mode -1)))&lt;/code&gt;&#xA;But, auto-complete-mode is still enabled for python-mode.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-08-05T13:35:17.143" LastActivityDate="2017-02-08T11:33:21.713" Title="how to disable minor mode (enabled using prog-mode-hook) for a particular major mode" Tags="|hooks|minor-mode|" AnswerCount="1" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="26095" PostTypeId="1" CreationDate="2016-08-05T13:21:29.287" Score="6" ViewCount="2572" Body="&lt;p&gt;Is there a way in the org mode syntax to create a link and to define which browser to open the link in? I have some links that I want to open in a different browser than my default one.&lt;/p&gt;&#xA;" OwnerUserId="9354" LastActivityDate="2023-12-30T12:57:52.287" Title="open org mode link in a different browser to the default browser" Tags="|org-mode|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26096" PostTypeId="2" ParentId="26093" CreationDate="2016-08-05T13:22:25.840" Score="-2" Body="&lt;p&gt;You could define variable with &lt;code&gt;(defvar directory-of-current-dir-locals-file &quot;/home/user/code/project&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-08-05T13:22:25.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26097" PostTypeId="2" ParentId="26093" CreationDate="2016-08-05T14:01:12.367" Score="9" Body="&lt;p&gt;My solution so far (based on &lt;a href=&quot;https://stackoverflow.com/questions/4012321/&quot;&gt;this Stackoverflow answer&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;.dir-locals.el&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Directory Local Variables&#xA;;;; For more information see (info &quot;(emacs) Directory Variables&quot;)&#xA;&#xA;((nil . ((eval . (set (make-local-variable 'my-project-path)&#xA;                      (file-name-directory&#xA;                       (let ((d (dir-locals-find-file &quot;.&quot;)))&#xA;                         (if (stringp d) d (car d))))))&#xA;         (cmake-ide-project-dir . my-project-path)&#xA;         (eval . (setq cmake-ide-build-dir (concat my-project-path &quot;build&quot;)))&#xA;         )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="23" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-08-05T14:01:12.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26098" PostTypeId="2" ParentId="26090" CreationDate="2016-08-05T14:45:14.040" Score="2" Body="&lt;p&gt;You could call &lt;code&gt;forward-whitespace&lt;/code&gt; with a negative prefix argument. You can bind this to a key with a lambda. For example, bind it to &lt;code&gt;M-B&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;M-B&quot;) (lambda () (interactive) (forward-whitespace -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="115" LastEditDate="2016-08-05T14:50:38.867" LastActivityDate="2016-08-05T14:50:38.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26099" PostTypeId="1" AcceptedAnswerId="26105" CreationDate="2016-08-05T16:49:01.693" Score="2" ViewCount="6982" Body="&lt;p&gt;After using emacs routinely for a long time, today I suddenly have problems starting emacs:  When I type &lt;code&gt;emacs&lt;/code&gt; in a terminal window, nothing at all happens, emacs seems to be running, but does not display anything, does not open a window, and does not react to any input.  This phase takes 30 seconds (nearly exactly!), and then emacs suddenly starts up.  Restarting the machine made emacs work again once, but 2 minutes later the problem was back again.  Details are below.  My questions: How can I make emacs start again without a 30 second delay?  How can I debug such problems?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Operating System: Mac OS X, version 10.11.6 (on a MacBook Air)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version: The problem occurs both with emacs 22.1.1 (system provided) and emacs 24.5.1 (installed via homebrew).  I can interrupt emacs 24.5.1 (in the non-working, hanging state) using Ctrl-C.  Emacs 22.1.1 seems not to react to Ctrl-C, but if I press Ctrl-G twice it suspends itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Illustration of the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; time emacs --batch&#xA;&#xA;real    0m30.039s&#xA;user    0m0.013s&#xA;sys 0m0.010s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Things that still work:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;emacs --version&lt;/code&gt; and &lt;code&gt;emacs --help&lt;/code&gt; work for both versions&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The computer seems otherwise happy, for example I still can start &lt;code&gt;vi&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Things that don't work (&quot;hangs&quot; below means that the 30 second wait is present):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;emacs -Q&lt;/code&gt; hangs, as does &lt;code&gt;emacs -q&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;emacs -nw&lt;/code&gt; hangs&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;emacs --debug-init&lt;/code&gt; hangs&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs seems to not complain about invalid command line options, for example &lt;code&gt;emacs --tri-tra-tralala&lt;/code&gt; just hangs with no message&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The problem is &lt;em&gt;not&lt;/em&gt; fixed by changing terminal emulators: emacs hangs both using the system-provided &lt;code&gt;Terminal&lt;/code&gt; application, and using &lt;code&gt;iTerm2&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12891" LastActivityDate="2016-08-06T11:37:21.957" Title="emacs does not start - how to debug?" Tags="|start-up|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26100" PostTypeId="1" AcceptedAnswerId="26101" CreationDate="2016-08-05T18:30:55.627" Score="4" ViewCount="1296" Body="&lt;p&gt;I currently have emacs 24.5.1 running on OSx el capitan. Since the first RC of emacs 25.1 released a few days ago, I am very curious to try it out. Can I have both versions installed on the same machine without causing any conflicts ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, can I use most of the packages I used for emacs 24 with emacs 25 without any major problems? or would I need to wait for some packages to have emacs 25 support ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I used homebrew to install emacs 24.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-08-06T05:33:15.357" LastActivityDate="2016-08-06T15:21:04.800" Title="Is it possible to install emacs 25.1 and emacs 24 on the same machine?" Tags="|start-up|install|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26101" PostTypeId="2" ParentId="26100" CreationDate="2016-08-05T20:08:43.460" Score="2" Body="&lt;p&gt;In Windows it is easy: you need to set two distinct &lt;code&gt;$HOME&lt;/code&gt; folders to host the packages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For OSX the process should be as follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After installing Emacs 24 and 25, in distinct folders, create two folders: &lt;code&gt;home24&lt;/code&gt; and &lt;code&gt;home25&lt;/code&gt;.&lt;br&gt;&#xA;Create two scripts, &lt;code&gt;run24&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;export HOME=path/to/home24&#xA;/path/to/24/emacs &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;run25&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;export HOME=path/to/home25&#xA;/path/to/25/emacs &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adjust the folder paths as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when you run &lt;code&gt;run24&lt;/code&gt;, you start the Emacs 24 binary, which will use &lt;code&gt;path/to/home24/.emacs.d&lt;/code&gt; for storing packages; while &lt;code&gt;run25&lt;/code&gt; will use &lt;code&gt;path/to/home25/.emacs.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Can you keep/share the same init file and configuration folders?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no straight answer to this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there are tons of open source packages, the Emacs developers do not introduce changes in new releases that break the previous ones, but they instead use &lt;em&gt;deprecation&lt;/em&gt;.&lt;br&gt;&#xA;That is, Emacs just warns you, but still lets you use the deprecated commands.  For example, sharing the &lt;code&gt;polymode&lt;/code&gt; package (from Emacs 24), I got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;share/emacs/site-lisp/polymode/polymode-classes.el: ‘defmethod’ is an obsolete macro (as of 25.1); use ‘cl-defmethod’ instead.&#xA;share/emacs/site-lisp/polymode/polymode-classes.el: ‘defgeneric’ is an obsolete macro (as of 25.1); use ‘cl-defgeneric’ instead.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which are  in fact just warnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the theory. In my practice, after upgrading,  Emacs occasionally failed to start or some packages failed to work an I  had to fix my init file and/or upgrade some packages to have the whole system working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your mileage may vary as actual results depends on how complex is your init file, how often do you maintain it, how many packages do you have and how supported they are. &lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-08-06T15:21:04.800" LastActivityDate="2016-08-06T15:21:04.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26102" PostTypeId="2" ParentId="26100" CreationDate="2016-08-05T20:40:09.727" Score="2" Body="&lt;p&gt;I use MS Windows, with prebuilt Emacs binaries.  Unlike what @antonio says, I have a single &lt;code&gt;HOME&lt;/code&gt; environment variable, and its location has nothing to do with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I create a Windows shortcut to the &lt;code&gt;runemacs.exe&lt;/code&gt; file for a given Emacs release. I have dozens and dozens of Emacs builds on my laptop, and I have shortcuts to about a dozen of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this kind of address for a typical Emacs shortcut &lt;code&gt;Target&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;D:\my-path-to-some-Emacs-build\bin\runemacs.exe --debug-init &quot;d:\my\startup\folder&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I use this as the value of field &lt;code&gt;Start in&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d:\my\startup\folder&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I start Emacs in Dired for that folder.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start Emacs I double-click such a shortcut. Or if it is on the task bar then I single-click it there.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-05T20:40:09.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26103" PostTypeId="1" AcceptedAnswerId="26109" CreationDate="2016-08-05T20:55:04.423" Score="1" ViewCount="464" Body="&lt;p&gt;I am running a session of emacs in an xterm+256color terminal, i.e., with the command emacs -nw. At the start of my session, the Home and End keys work just fine. However, after a while, the Home key eventually starts producing the key code ^[[H instead of ^[OF. Why does this happen? What can I do to fix this problem? &lt;/p&gt;&#xA;" OwnerUserId="12887" LastActivityDate="2016-09-05T05:31:11.153" Title="Home and End keys stop working correctly" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26104" PostTypeId="1" CreationDate="2016-08-05T20:56:53.417" Score="3" ViewCount="530" Body="&lt;p&gt;How can I include a package that is available locally on my system that depends on the string library &lt;code&gt;s&lt;/code&gt; with spacemacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an company internal package that adds functionality to magit available at &lt;code&gt;/usr/share/emacs-config/neat-tool.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;neat-tool.el&lt;/code&gt; is something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; neat-tool.el --- Use neat tool&#xA;&#xA;(require 'magit)&#xA;(require 's)&#xA;(magit-define-popup-action 'magit-dispatch-popup ?x&#xA;   &quot;Neat commands&quot;&#xA;   'neat-commands-popup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a custom layer called &lt;code&gt;my-layer&lt;/code&gt; with a &lt;code&gt;packages.el&lt;/code&gt; of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-layer-packages&#xA;  '((neat-tool&#xA;     :location (recipe&#xA;                :fetcher url&#xA;                :url &quot;file:///usr/share/emacs-config/neat-tool.el&quot;))))&#xA;&#xA;(defun my-layer/neat-tool ()&#xA;  &quot;Init neat-tool.&quot;&#xA;  (use-package neat-tool&#xA;    :defer t&#xA;    :init&#xA;    (with-eval-after-load 'magit&#xA;      (require 'neat-tool))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this fails with &lt;code&gt;Cannot open load file: No such file or directory, s&lt;/code&gt;.  &lt;code&gt;s&lt;/code&gt; is correctly installed and up to date in &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could wrap another &lt;code&gt;with-eval-after-load&lt;/code&gt; in the &lt;code&gt;:init&lt;/code&gt;, but that seems messy.  Is there a better way to declare the dependency on &lt;code&gt;s&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2024-03-29T21:02:10.187" Title="Use system-installed package with spacemacs that depends on MELPA packages" Tags="|init-file|spacemacs|package-repositories|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26105" PostTypeId="2" ParentId="26099" CreationDate="2016-08-05T21:17:29.513" Score="3" Body="&lt;p&gt;Given that the problem occurs even with &lt;code&gt;emacs -Q&lt;/code&gt;, Emacs's own debugging tools probably won't help. They're geared towards debugging Lisp problems but your Emacs hangs before problems in Lisp code get a chance to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see what a program is doing by running it under &lt;a href=&quot;https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/dtruss.1m.html&quot; rel=&quot;nofollow&quot;&gt;dtruss&lt;/a&gt;. From a terminal, run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo dtruss -deof emacs -Q  2&amp;gt;emacs.dtruss&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Look at the resulting &lt;code&gt;emacs.dtruss&lt;/code&gt; file and see what system calls took a long time. (Feel free to post the trace here if you don't understand it! This isn't meant to be comprehensible by end-users.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-08-06T10:52:36.737" LastActivityDate="2016-08-06T10:52:36.737" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26106" PostTypeId="1" AcceptedAnswerId="26107" CreationDate="2016-08-06T00:17:18.693" Score="1" ViewCount="250" Body="&lt;p&gt;I have my isearch failure face set like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; ...&#xA; '(isearch-fail ((t (:background &quot;#660c00&quot;))))&#xA; ...&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works for the most part, highlighting text which doesn't match in that color. However, whenever I write failing whitespace, i.e. a space or a tab which has no match in the buffer, the face that is used to highlight it is a brighter shade of red which is not the same color as the rest of the unmatched text. Furthermore, this color of whitespace is replaced by my custom isearch failure color when non-whitespace characters are written after it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cl.ly/2a2a2x3f1v1k/isearch_fail_faces.mp4&quot; rel=&quot;nofollow&quot;&gt;Here is an example demonstrating this.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that I can solve this issue by setting some face somewhere, but I'm not sure which face is the culprit here and I've looked and looked for it to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, I'm using GNU Emacs 25.1.50.2 on OS X 10.11.6.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2016-08-06T00:23:19.240" LastActivityDate="2016-08-06T01:48:07.377" Title="How to set the color for whitespace in isearch failures" Tags="|faces|colors|whitespace|isearch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26107" PostTypeId="2" ParentId="26106" CreationDate="2016-08-06T01:48:07.377" Score="2" Body="&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x list-faces-display&lt;/code&gt;&lt;/strong&gt; is your friend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The face used for this is face &lt;code&gt;trailing-whitespace&lt;/code&gt;. It highlights, well, trailing whitespace. ;-)  Customize it to whatever you want: &lt;strong&gt;&lt;code&gt;M-x customize-face trailing-whitespace&lt;/code&gt;&lt;/strong&gt;.  You can even make it identical in appearance to face &lt;code&gt;isearch-fail&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see how face &lt;code&gt;trailing-whitespace&lt;/code&gt; is used in the code by looking at function &lt;code&gt;isearch-message&lt;/code&gt;, in library &lt;code&gt;isearch.el&lt;/code&gt; (use &lt;code&gt;M-x find-library isearch&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-06T01:48:07.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26108" PostTypeId="1" CreationDate="2016-08-06T02:40:30.960" Score="0" ViewCount="752" Body="&lt;p&gt;In trying to debug auth failures from something that &lt;em&gt;should&lt;/em&gt; be getting its auth info from &lt;code&gt;auth-sources&lt;/code&gt;, I noticed an extremely weird thing: &lt;code&gt;auth-source-search&lt;/code&gt; frequently returns &lt;code&gt;nil&lt;/code&gt; for valid queries -- queries that in fact work elsewhere in the code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance: I have these two lines in my &lt;code&gt;.authinfo.gpg&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine gmail.com login gastove password mypassword port xmpp&#xA;machine dev.urbanairship.com login gastove password myotherpassword&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auth-source-search :host &quot;dev.urbanairship.com&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Returns the very normal, expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((:host &quot;dev.urbanairship.com&quot; :user &quot;gastove&quot; :secret (lambda (&amp;amp;rest --cl-rest--) (apply ... ... ... --cl-rest--))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(auth-source-search :host &quot;gmail.com&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Returns the totally imponderable: &lt;code&gt;nil&lt;/code&gt;. This makes &lt;em&gt;even less&lt;/em&gt; sense because that line provide auth info to &lt;code&gt;jabber.el&lt;/code&gt;, &lt;em&gt;which is working normally&lt;/em&gt;. I've even confirmed &lt;code&gt;jabber.el&lt;/code&gt; is reading my &lt;code&gt;.authinfo.gpg&lt;/code&gt; by deleting that line. It's not like it's just the host -- a search for &lt;code&gt;:user &quot;gastove&quot;&lt;/code&gt;, for instance, only returns the second line, not the first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So uh. What's going on? Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="10319" LastEditorUserId="253" LastEditDate="2016-08-06T04:22:18.550" LastActivityDate="2016-08-06T04:22:18.550" Title="`auth-source-search` returns nil for valid queries" Tags="|authinfo|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26109" PostTypeId="2" ParentId="26103" CreationDate="2016-08-06T04:35:44.493" Score="1" Body="&lt;p&gt;xterm has multiple keyboard modes (e.g. application mmode), and accepts escape sequences to switch between them. For example you can make the keypad send &quot;1&quot;, &quot;2&quot; etc or you can get it to send sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest way to get it back to normal is to run 'reset' or 'tput reset', which will consult the termcap or terminfo terminal database and should output the correct escape sequences to put all the keys into a standard state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid the problem in the first place avoid using 'cat' on binary files and other sources of random escape sequences being output to your terminal which can change the modes.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-08-06T04:35:44.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26110" PostTypeId="1" CreationDate="2016-08-06T05:52:43.460" Score="3" ViewCount="375" Body="&lt;p&gt;As I was going through &lt;a href=&quot;http://learnyousomeerlang.com/syntax-in-functions#what-the-if&quot; rel=&quot;nofollow&quot;&gt;learnyousomeerlang&lt;/a&gt; I came across code formatted like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if X &amp;gt; Y -&amp;gt; a()&#xA; ; true  -&amp;gt; b()&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Presently As close as I can get is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if X &amp;gt; Y -&amp;gt;&#xA;    a()&#xA;        ;&#xA;-&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am assuming this is due to the electric &gt; and electric ;. In Erlang.el. I'm just wondering If anyone happens to know of a useful criteria for the electric-semicolon and such that would make this possible.&lt;/p&gt;&#xA;" OwnerUserId="12896" LastEditorUserId="897" LastEditDate="2017-05-23T09:28:44.590" LastActivityDate="2017-05-23T09:28:44.590" Title="Is it possible to achieve erlang formatting like this?" Tags="|indentation|major-mode|erlang-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26111" PostTypeId="2" ParentId="774" CreationDate="2016-08-06T07:31:59.963" Score="3" Body="&lt;p&gt;This is an old question, but let me add this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          '(lambda ()&#xA;             (setq-local header-line-format (list '(:eval (substring-no-properties (org-table-get-field)))))&#xA;           ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a more direct way to implement @nispio 's solution, I think.&lt;/p&gt;&#xA;" OwnerUserId="11313" LastActivityDate="2016-08-06T07:31:59.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26112" PostTypeId="2" ParentId="26110" CreationDate="2016-08-06T07:51:04.467" Score="2" Body="&lt;p&gt;It's not only about the electric semicolon; it's also the indentation functions themselves that indent the semicolon too far.  The indentation level is calculated in the function &lt;code&gt;erlang-calculate-stack-indent&lt;/code&gt;.  It would be nice if this behaviour were configurable, a bit like how you can select different styles in &lt;code&gt;cc-mode&lt;/code&gt;, but it currently isn't.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2016-08-06T07:51:04.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26113" PostTypeId="1" CreationDate="2016-08-06T09:39:22.157" Score="1" ViewCount="459" Body="&lt;p&gt;I'm trying to print a pdf file which has Japanese letters on org-mode.&#xA;I use macbook pro and I installed MacTex 2016 and updated all the programs after installation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I typed &quot;C-c C-e l o&quot; to make a pdf file.&#xA;I can export English letters, but I cannot export Japanese ones.&#xA;Do you know how to embed Japanese letters in a pdf file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd appreciate your advice.&lt;/p&gt;&#xA;" OwnerUserId="12815" LastActivityDate="2016-09-06T14:56:25.307" Title="how to print a pdf with Japanese letters on org-mode" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26114" PostTypeId="2" ParentId="26099" CreationDate="2016-08-06T11:37:21.957" Score="1" Body="&lt;p&gt;As mentioned in &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/PROBLEMS?h=emacs-24.5#n460&quot; rel=&quot;nofollow noreferrer&quot;&gt;the &lt;code&gt;etc/PROBLEMS&lt;/code&gt; file in Emacs 24.5&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Emacs startup on GNU/Linux systems (and possibly other systems) is slow.&#xA;&#xA;This can happen if the system is misconfigured and Emacs can't get the&#xA;full qualified domain name, FQDN.  You should have your FQDN in the&#xA;/etc/hosts file, something like this:&#xA;&#xA;127.0.0.1   localhost&#xA;129.187.137.82  nuc04.t30.physik.tu-muenchen.de nuc04&#xA;&#xA;The way to set this up may vary on non-GNU systems.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://stackoverflow.com/a/23621608/113848&quot;&gt;this answer&lt;/a&gt;, the DNS request that caused the delay was removed in Emacs 25, so upgrading Emacs might be a simple way to fix the problem.&lt;/p&gt;&#xA;" OwnerUserId="11" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-08-06T11:37:21.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26115" PostTypeId="5" CreationDate="2016-08-06T12:18:46.537" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-08-06T12:18:46.537" LastActivityDate="2016-08-06T12:18:46.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26116" PostTypeId="4" CreationDate="2016-08-06T12:18:46.537" Score="0" Body="GNU Project Debugger - Start it via `M-x gdb` to run the debugger on Ada, C, C++, Objective-C, Pascal, Fortran, Java and other languages." OwnerUserId="8916" LastEditorUserId="105" LastEditDate="2016-08-06T15:12:44.770" LastActivityDate="2016-08-06T15:12:44.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26117" PostTypeId="2" ParentId="26100" CreationDate="2016-08-06T13:16:01.137" Score="1" Body="&lt;p&gt;You can have as many versions installed at the same time without conflicts.  Also, backward compatibility is generally maintained (with a few rare exceptions and modulo bugs, of course), so normally you can use in Emacs-25 all the packages you used in Emacs-24.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forward compatibility is generally not maintained, so be careful that if you byte-compile a package with Emacs-NN it's likely that it won't work with an older Emacs.  Byte-compilation is performed for example when you install via &lt;code&gt;package.el&lt;/code&gt;, so better install with the older Emacs rather than the newer one.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-06T13:16:01.137" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26118" PostTypeId="1" AcceptedAnswerId="26123" CreationDate="2016-08-06T17:40:39.680" Score="5" ViewCount="1878" Body="&lt;p&gt;I am using Vincet Goulet's modified version of Emacs that use &lt;code&gt;site-start.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://vgoulet.act.ulaval.ca/en/emacs/&quot; rel=&quot;noreferrer&quot;&gt;http://vgoulet.act.ulaval.ca/en/emacs/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read the description of its use but I don't understand exactly what conditions may affect choosing &lt;code&gt;site-start.el&lt;/code&gt; over &lt;code&gt;init.el&lt;/code&gt;. Can someone clarify a &lt;em&gt;rule of thumb&lt;/em&gt; on this?&lt;/p&gt;&#xA;" OwnerUserId="12900" LastEditorUserId="2287" LastEditDate="2016-08-06T20:14:17.293" LastActivityDate="2016-08-07T11:50:14.837" Title="When to use site-start.el vs init.el" Tags="|init-file|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26119" PostTypeId="1" AcceptedAnswerId="26120" CreationDate="2016-08-06T18:29:57.713" Score="3" ViewCount="2488" Body="&lt;p&gt;When I capture an item in org-capture, I have a template which adds &quot;DATE_CAPTURED: %T&quot; to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make it so that DATE_CAPTURED is added inside a PROPERTY drawer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how would I make &lt;em&gt;any&lt;/em&gt; org-mode-automated property (like DEADLINE, CLOSED, or SCHEDULED) get added to the PROPERTY drawer, instead of directly under the headline?&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-08-06T19:58:46.193" Title="Org mode: Adding a properties drawer to a capture template?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26120" PostTypeId="2" ParentId="26119" CreationDate="2016-08-06T19:09:34.753" Score="6" Body="&lt;p&gt;You could use this function and the hook in &lt;code&gt;init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun add-property-with-date-captured ()&#xA;  &quot;Add DATE_CAPTURED property to the current item.&quot;&#xA;  (interactive)&#xA;  (org-set-property &quot;DATE_CAPTURED&quot; (format-time-string &quot;%F&quot;)))&#xA;&#xA;(add-hook 'org-capture-before-finalize-hook 'add-property-with-date-captured)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will add to the current heading in your capture buffer property &lt;code&gt;DATE_CAPTURED&lt;/code&gt; with the date in ISO 8601 format when you'll end the capturing (after pressing &lt;code&gt;C-c C-c&lt;/code&gt; in the capture buffer).  So, you'll see the &lt;code&gt;DATE_CAPTURED&lt;/code&gt; property in the capture file.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-08-06T19:58:46.193" LastActivityDate="2016-08-06T19:58:46.193" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26121" PostTypeId="1" AcceptedAnswerId="26127" CreationDate="2016-08-07T00:24:44.810" Score="4" ViewCount="1842" Body="&lt;h2&gt;The Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I want to install Emacs on a USB Flash Drive in a &lt;em&gt;portable fashion&lt;/em&gt;, that is, Emacs should be able to be run from the UFD, once plugged on a device, without predefined paths to its binaries and save all its persistent data on the UFD.&lt;br&gt;&#xA;To obtain this, the Emacs startup script (possibly in the form of an icon for the user to click on) should be able to find the relevant binaries and set the needed directory paths. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hereafter I take Windows as an example, but my concepts are not platform-specific. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Windows 90% of the work for a portable Emacs is already done by &lt;a href=&quot;https://www.gnu.org/software/emacs/download.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Emacs&lt;/a&gt;, because Emacs for Windows comes as a zipped package, without an installer. According to the docs you have to:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unzip the zip file preserving the directory structure, and run &lt;code&gt;bin\runemacs.exe&lt;/code&gt;. Alternatively, create a desktop shortcut to &lt;code&gt;bin\runemacs.exe&lt;/code&gt;, and start Emacs by double-clicking on that shortcut's icon.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Anyway, when extracting on a UFD, &lt;em&gt;persistent data will not be stored on the UFD&lt;/em&gt;, but on the home directory of the host system. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;This is what I tried&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let us assume that Emacs has been extracted as &lt;code&gt;emacs&lt;/code&gt; on the root of the UFD,  where  there is also a &lt;code&gt;docs&lt;/code&gt; folder. In the root I therefore create the following batch script to bootstrap Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs.cmd&#xA;---------&#xA;set &quot;HOME=%~dp0docs&quot;&#xA;emacs\bin\runemacs.exe   -q   --load emacs\init.el %*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Script Explanation&lt;/strong&gt;&lt;br&gt;&#xA;&lt;code&gt;-q&lt;/code&gt; solves side effects due to unwanted  reading/writing of init files on the host system.&lt;br&gt;&#xA;At the same time, this requires that some &lt;em&gt;init file equivalent&lt;/em&gt; is manually loaded with the &lt;code&gt;--load&lt;/code&gt; part. An alternative would be using &lt;code&gt;site-start.el&lt;/code&gt;, not bypassed by &lt;code&gt;-q&lt;/code&gt;.&lt;br&gt;&#xA;Note that paths are relative to the position of the script so there is no need to guess the UFD drive letter. &#xA;The same is not true for the home dir. In this case I use the &lt;code&gt;%~dp0&lt;/code&gt; trick, which is converted by the shell to the script parent dir (somewhat like &lt;code&gt;$(dirname &quot;$0&quot;)&lt;/code&gt; in Bash).&lt;br&gt;&#xA;&lt;code&gt;%*&lt;/code&gt; lets add add extra arguments to &lt;code&gt;runemacs&lt;/code&gt;, when running &lt;code&gt;Emacs.cmd&lt;/code&gt; from the console.&lt;br&gt;&#xA;Given &lt;code&gt;-q&lt;/code&gt; is intended to make a slimmer Emacs, some default settings might be missing and if you need them you have to manually set them in &lt;code&gt;emacs\init.el&lt;/code&gt;. By reading superficially Emacs &lt;code&gt;startup.el&lt;/code&gt; code, one such missing item is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which should be added to &lt;code&gt;emacs\init.el&lt;/code&gt; or alternatively to &lt;code&gt;site-start.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This setup works pretty well. So now I come to the actual &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In the setup above, where the &lt;code&gt;HOME&lt;/code&gt; dir is used to store documents,  therefore it would be nice and make sense to have the Emacs settings directory, &lt;code&gt;.emacs.d&lt;/code&gt;, outside the document folder. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the documentation it should be possible to obtain this result by properly setting the variable &lt;code&gt;user-emacs-directory&lt;/code&gt;. Therefore, the following lines should be added to the head of the init file called by the bootstrap script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;init.el &#xA;-------&#xA;(setq user-emacs-directory&#xA;      (expand-file-name (concat invocation-directory &quot;../.emacs.d&quot;)))&#xA;(setq abbrev-file-name&#xA;      (locate-user-emacs-file &quot;abbrev_defs&quot;))&#xA;(setq auto-save-list-file-prefix&#xA;      (locate-user-emacs-file &quot;auto-save-list/.saves-&quot;))&#xA;(cd &quot;~&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Despite the &lt;code&gt;-q&lt;/code&gt; switch, before running &lt;code&gt;init.el&lt;/code&gt; other code is run  (this is why the abbreviations and the auto-save directory require a separate setup). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These settings work only partially. In fact, an empty &lt;code&gt;~/.emacs.d&lt;/code&gt; keeps appearing in the home dir.&lt;br&gt;&#xA;&lt;em&gt;What library creates the folder?&lt;/em&gt; &#xA;Is it possible to avoid to make the &lt;code&gt;HOME&lt;/code&gt; folder dirty?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Debugging &lt;code&gt;startup.el&lt;/code&gt; would help, but it is not possible, as  it is a &lt;em&gt;fake&lt;/em&gt; file. Its actual content is dumped into the Emacs binary. &lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-11-15T14:24:32.280" LastActivityDate="2016-11-15T14:24:32.280" Title="Portable Emacs: Remapping user-emacs-directory" Tags="|init-file|start-up|invocation|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26122" PostTypeId="1" CreationDate="2016-08-07T11:04:45.203" Score="2" ViewCount="223" Body="&lt;p&gt;I followed &lt;a href=&quot;https://github.com/jhamrick/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jessica Hamrick's emacs setup&lt;/a&gt; before adding &lt;code&gt;evil&lt;/code&gt;. This means that there is a lot of specific configuration issues in my &lt;code&gt;~/.emacs.d/&lt;/code&gt; which I don't necessarily understand, shame on me, but specifically I have checked that both &lt;code&gt;python-mode&lt;/code&gt; and &lt;code&gt;auto-complete&lt;/code&gt; were installed using &lt;code&gt;el-get&lt;/code&gt;, and yet the &lt;code&gt;python-mode-hook&lt;/code&gt; complains that it does not know about &lt;code&gt;ac-source-pycomplete&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;auto-complete error: (void-variable ac-source-pycomplete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The symbol is explicitly added (with other symbols) to &lt;code&gt;ac-sources&lt;/code&gt; as part of &lt;code&gt;'python-mode-hook&lt;/code&gt;, because &lt;code&gt;pycomplete&lt;/code&gt; thinks it's clever enough for all auto-completion tasks and removes all other sources from the &lt;code&gt;ac-sources&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;      (lambda ()&#xA;         (setq ac-sources '(ac-source-pycomplete&#xA;                            ac-source-yasnippet&#xA;                            ac-source-abbrev&#xA;                            ac-source-dictionary&#xA;                            ac-source-words-in-same-mode-buffers))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get Emacs to know &lt;code&gt;pycomplete&lt;/code&gt; in a clean-ish way?&lt;/p&gt;&#xA;" OwnerUserId="2702" LastEditorUserId="1979" LastEditDate="2017-05-05T13:28:51.997" LastActivityDate="2024-02-01T23:02:30.290" Title="How do I make emacs find `ac-source-pycomplete`?" Tags="|python|auto-complete-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26123" PostTypeId="2" ParentId="26118" CreationDate="2016-08-07T11:50:14.837" Score="8" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;[The] init file [...] specifies how to initialize Emacs for you. &#xA;  [Therefore it is normally located in (a subdir of) your home directory.]&lt;br&gt;&#xA;  [You] may also have a &lt;em&gt;site startup file&lt;/em&gt; [...] named &lt;code&gt;site-start.el&lt;/code&gt;. [It is normally located] in a subdirectory named &lt;code&gt;site-lisp&lt;/code&gt; in the Emacs installation directory, such as &lt;code&gt;/usr/local/share/emacs/site-lisp&lt;/code&gt; [but] you can place [...] &lt;code&gt;site-start.el&lt;/code&gt; in any of the directories which Emacs searches for Lisp libraries. &#xA;  [...]&#xA;  We recommend against using &lt;code&gt;site-start.el&lt;/code&gt; for changes that some users may not like. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;noreferrer&quot;&gt;The Emacs Initialization File&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a multi-user environment, as an admin, you put in &lt;code&gt;site-start.el&lt;/code&gt; the customisations intended for all users, while single users will use their own init file.&lt;br&gt;&#xA;Also, if you make a customised Emacs distro, you put specific distro packages, together with &lt;code&gt;site-start.el&lt;/code&gt;, in the &lt;code&gt;site-lisp&lt;/code&gt; directory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before the personal computing era, having a centralised Emacs server was a necessity due to the mainframe computing model, which required so called &lt;em&gt;site customisations&lt;/em&gt;. A typical scenario nowadays is that each user has their own Emacs on their own computer, perhaps a laptop. Therefore there is not much need for site customisations, including  &lt;code&gt;site-start.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway you might use Emacs as a daemon to manage your emails, you org agenda notifications, etc. In this case  &lt;code&gt;site-start.el&lt;/code&gt; is the proper place to craft your daemon. &lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-08-07T11:50:14.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26124" PostTypeId="2" ParentId="26113" CreationDate="2016-08-07T14:18:24.537" Score="3" Body="&lt;p&gt;I don't use latex but Chinese users of my setup use latex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They reported only XeLaTex supports unicode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'd better use org 8 (bundled with Emacs 24.4) instead of org 7 (Emacs 24.3)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, you need specify the font in your setup. Check this setup &lt;a href=&quot;https://kuanyui.github.io/2014/05/10/emacs-org-mode-xelatex-output-chinese-pdf/&quot; rel=&quot;nofollow&quot;&gt;https://kuanyui.github.io/2014/05/10/emacs-org-mode-xelatex-output-chinese-pdf/&lt;/a&gt;. Looks you need tweak &lt;code&gt;org-latex-classes&lt;/code&gt;. Please note fixed width font is recommended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since East Asians share the same HanZi problem, this solution should also work for Japanese.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-08-07T14:18:24.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26125" PostTypeId="2" ParentId="26074" CreationDate="2016-08-07T14:33:25.847" Score="2" Body="&lt;p&gt;If you read the code of &lt;code&gt;ediff-patch-file&lt;/code&gt;, you will find it calls &lt;code&gt;ediff-patch-file-internal&lt;/code&gt; which basically just calls GNU Patch (&lt;a href=&quot;https://www.gnu.org/software/diffutils/manual/html_node/patch-Options.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/diffutils/manual/html_node/patch-Options.html&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is code quoted from &lt;code&gt;ediff-patch-file-internal&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process-region&#xA; (point-min) (point-max)&#xA; shell-file-name&#xA; t   ; delete region (which contains the patch&#xA; t   ; insert output (patch diagnostics) in current buffer&#xA; nil ; don't redisplay&#xA; shell-command-switch   ; usually -c&#xA; (format &quot;%s %s %s %s&quot;&#xA;     ediff-patch-program&#xA;     ediff-patch-options&#xA;     ediff-backup-specs&#xA;     (expand-file-name true-source-filename))&#xA; ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can tweak &lt;code&gt;ediff-patch-options&lt;/code&gt; whose default value is &quot;-f&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the easiest setup is &lt;code&gt;(setq ediff-patch-options &quot;-f -p1&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-08-09T02:01:04.720" LastActivityDate="2016-08-09T02:01:04.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26127" PostTypeId="2" ParentId="26121" CreationDate="2016-08-07T18:20:00.803" Score="1" Body="&lt;p&gt;A solution based on suggestions by &lt;a href=&quot;https://emacs.stackexchange.com/questions/4253/how-to-start-emacs-with-a-custom-user-emacs-directory#comment9059_4255&quot;&gt;@phil&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/26121/portable-emacs-user-emacs-directory#comment39685_26121&quot;&gt;@glucas&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to set a dynamic &lt;code&gt;HOME&lt;/code&gt; variable: first set it in the shell as the parent of &lt;code&gt;.emacs.d&lt;/code&gt;; then reset it in  my &quot;pseudo-init&quot; to the desired value (here the document folder).&lt;br&gt;&#xA;Here is the full working solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs.cmd&#xA;---------&#xA;set &quot;HOME=%~dp0\emacs&quot;&#xA;emacs\bin\runemacs.exe   -q   --load emacs\init.el %*&#xA;&#xA;init.el &#xA;-------&#xA;(setq user-emacs-directory&#xA;      (expand-file-name (concat invocation-directory &quot;../.emacs.d&quot;)))&#xA;(setenv &quot;HOME&quot;&#xA;        (expand-file-name (concat invocation-directory &quot;../../docs&quot;)))&#xA;(setq abbreviated-home-dir (concat &#xA;                    &quot;\\`&quot; &#xA;                (getenv &quot;HOME&quot;)&#xA;                &quot;\\(/\\|\\'\\)&quot;))&#xA;(setq abbrev-file-name&#xA;      (locate-user-emacs-file &quot;abbrev_defs&quot;))&#xA;(setq auto-save-list-file-prefix&#xA;      (locate-user-emacs-file &quot;auto-save-list/.saves-&quot;))&#xA;(cd &quot;~&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Comments&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As explained in the question, &lt;code&gt;%~dp0\emacs&lt;/code&gt; stands for &lt;code&gt;&amp;lt;script parent dir&amp;gt;\emacs&lt;/code&gt; (of course with Windows slashes). &lt;code&gt;emacs&lt;/code&gt; is the Emacs install folder and also the designated parent for &lt;code&gt;.emacs.d&lt;/code&gt;.&#xA;Since &lt;code&gt;.emacs.d&lt;/code&gt; is supposed to be a subidir of &lt;code&gt;HOME&lt;/code&gt;, Emacs  will set it  automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After starting Emacs and launching my pseudo-init via the &lt;em&gt;relative&lt;/em&gt; path  &lt;code&gt;--load emacs\init.el&lt;/code&gt;,  the original value of &lt;code&gt;user-emacs-directory&lt;/code&gt;, that is &lt;code&gt;&quot;~/.emacs.d/&quot;&lt;/code&gt;,  is reset to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-emacs-directory&#xA;      (expand-file-name (concat invocation-directory &quot;../.emacs.d&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The new path is relative to the Emacs invocation directory and outside &lt;code&gt;HOME&lt;/code&gt;. &lt;code&gt;HOME&lt;/code&gt; is reset to the document dir: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;HOME&quot;&#xA;        (expand-file-name (concat invocation-directory &quot;../../docs&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As observed in my question, before starting the pseudo-init, other code is run. Therefore, at this level &#xA;&lt;code&gt;(locate-user-emacs-file &quot;foo&quot;)&lt;/code&gt; would report &lt;code&gt;&quot;~\\.emacs.d\\foo&quot;&lt;/code&gt;. Beside this  being not what is desired,  &lt;code&gt;&quot;~\\.emacs.d&quot;&lt;/code&gt; is not existent.  The &lt;code&gt;locate-user-emacs-file&lt;/code&gt; function is used by Emacs for reading and writing config files, which would become therefore impossible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, it turns out that, before starting the init files, Emacs sets &lt;code&gt;abbreviated-home-dir&lt;/code&gt;. In our case the variable is set to the old shell value, different from &lt;code&gt;(setenv &quot;HOME&quot; ...&lt;/code&gt; above. &#xA;The wrong &lt;code&gt;abbreviated-home-dir&lt;/code&gt; causes &lt;code&gt;(abbreviate-file-name user-emacs-directory)&lt;/code&gt; to return the undesired  &lt;code&gt;&quot;~/.emacs.d&quot;&lt;/code&gt;. &lt;code&gt;abbreviated-home-dir&lt;/code&gt;  is used by &lt;code&gt;locate-user-emacs-file&lt;/code&gt;, which ultimately breaks everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix this misbehaviour, &lt;code&gt;abbreviated-home-dir&lt;/code&gt;  is reset to the new &lt;code&gt;HOME&lt;/code&gt; in &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq abbreviated-home-dir ...   (getenv &quot;HOME&quot;) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To understand why the value is encapsulated in those weird strings, check the documentation with  &lt;code&gt;C-h v abbreviated-home-dir&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;abbrev-file-name&lt;/code&gt; and &lt;code&gt;auto-save-list-file-prefix&lt;/code&gt; are also set before the pseudo-init call. So they need to be reset to good values.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-11-14T21:48:39.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26128" PostTypeId="2" ParentId="26122" CreationDate="2016-08-07T19:01:36.350" Score="0" Body="&lt;p&gt;When &lt;code&gt;python-mode-hook&lt;/code&gt; is run (when &lt;code&gt;python-mode&lt;/code&gt; is enabled) &lt;code&gt;ac-source-pycomplete&lt;/code&gt; has not yet been defined, which indicates that the library where &lt;code&gt;ac-source-pycomplete&lt;/code&gt; is defined has not yet been loaded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find out what that library is and ensure that you load it (e.g. using &lt;code&gt;require&lt;/code&gt;)  before you enable &lt;code&gt;python-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-07T19:01:36.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26132" PostTypeId="2" ParentId="13820" CreationDate="2016-08-08T00:22:03.360" Score="17" Body="&lt;p&gt;There's a much simpler option: use &lt;a href=&quot;http://orgmode.org/manual/Structure-of-code-blocks.html&quot; rel=&quot;noreferrer&quot;&gt;inline source blocks&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_python{hello'}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works without problems for characters like quotations marks, and it provides syntax highlighting for inline code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To include the inline source code when exporting, you'll want to add this declaration to the header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :exports code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="293" LastEditDate="2017-10-16T01:26:31.190" LastActivityDate="2017-10-16T01:26:31.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26133" PostTypeId="2" ParentId="24951" CreationDate="2016-08-08T00:25:09.627" Score="4" Body="&lt;p&gt;Using &lt;a href=&quot;http://orgmode.org/manual/Structure-of-code-blocks.html&quot; rel=&quot;nofollow&quot;&gt;inline code blocks&lt;/a&gt; fixes some of these issues; I'm not sure why I didn't come across them before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :exports code&#xA;&#xA;Here's a bit of OCaml: src_ocaml{let x' = 1 in x' + x'}.&#xA;Many src_ocaml{x}s in there, no?&#xA;And this one is worse: src_ocaml{x ~!~ x &amp;lt;&amp;gt; 0}.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here's a bit of OCaml: \texttt{let x' = 1 in x' + x'}.&#xA;Many \texttt{x}s in there, no?&#xA;And this one is worse: \texttt{x \textasciitilde{}!\textasciitilde{} x &amp;lt;&amp;gt; 0}.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not a panacea, of course: both &lt;code&gt;src_c{int main \{}&lt;/code&gt; and &lt;code&gt;src_c{a{}b}&lt;/code&gt; are broken...&lt;/p&gt;&#xA;" OwnerUserId="2429" LastEditorUserId="2429" LastEditDate="2016-08-08T00:51:00.660" LastActivityDate="2016-08-08T00:51:00.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26134" PostTypeId="1" AcceptedAnswerId="26135" CreationDate="2016-08-08T02:27:53.163" Score="5" ViewCount="402" Body="&lt;p&gt;I was surprised to find that if I use &lt;code&gt;M-x ielm&lt;/code&gt;, I get a literal backquote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (read &quot;`foo&quot;)&#xA;`foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I use &lt;code&gt;M-: (read &quot;`foo&quot;)&lt;/code&gt; then &lt;code&gt;*Messages*&lt;/code&gt; and the minibuffer show &lt;code&gt;(\` foo)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are these two equivalent? Why doesn't &lt;code&gt;(equal (read &quot;`foo&quot;) `foo)&lt;/code&gt; return &lt;code&gt;t&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2016-08-08T03:20:11.287" LastActivityDate="2016-08-08T13:34:57.353" Title="Is there any difference between \` and backquote?" Tags="|eval|backquote|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26135" PostTypeId="2" ParentId="26134" CreationDate="2016-08-08T03:18:05.090" Score="5" Body="&lt;p&gt;The &lt;em&gt;value returned&lt;/em&gt; by the sexp &lt;code&gt;(read &quot;`foo&quot;)&lt;/code&gt; is &lt;code&gt;`foo&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are confused by the form of the &lt;em&gt;printing&lt;/em&gt; of the read value by the&#xA;command you are using (&lt;code&gt;eval-expression&lt;/code&gt;, bound to &lt;code&gt;M-:&lt;/code&gt; by default).  What it prints is a &lt;em&gt;Lisp representation&lt;/em&gt; of the value.  If you instead use &lt;code&gt;pp-eval-expression&lt;/code&gt; then you see &lt;code&gt;`foo&lt;/code&gt;, which is the (same) value printed for &lt;em&gt;humans&lt;/em&gt;. (This is one of several reasons that I prefer to bind &lt;code&gt;M-:&lt;/code&gt; to &lt;code&gt;pp-eval-expression&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the Lisp representation - in library &lt;code&gt;backquote.el&lt;/code&gt; you see this Commentary (notice the first line):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; When the Lisp reader sees `(...), it generates (\` (...)).&#xA;;; When it sees ,... inside such a backquote form, it generates (\, ...).&#xA;;; For ,@... it generates (\,@ ...).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That first line could have said that when it sees &lt;code&gt;`...&lt;/code&gt; it generates &lt;code&gt;(\` ...)&lt;/code&gt;. In other words, what is says is not just for a backquoted &lt;em&gt;list&lt;/em&gt;.  In your case, when it sees &lt;code&gt;`foo&lt;/code&gt; it generates &lt;code&gt;(\` foo)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;(equal (read &quot;`foo&quot;) '`foo)&lt;/code&gt; does return &lt;code&gt;t&lt;/code&gt;.  (You forgot to quote the second argument to &lt;code&gt;equal&lt;/code&gt;.  You used &lt;code&gt;`foo&lt;/code&gt; as the second argument, but that gets evaluated - to &lt;code&gt;foo&lt;/code&gt;, not to &lt;code&gt;`foo&lt;/code&gt;, which is what you wanted to compare with the value of &lt;code&gt;(read &quot;`foo&quot;)&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="10578" LastEditDate="2016-08-08T13:34:57.353" LastActivityDate="2016-08-08T13:34:57.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26136" PostTypeId="1" CreationDate="2016-08-08T05:33:56.817" Score="5" ViewCount="1013" Body="&lt;p&gt;Microsoft Visual Studio has a very useful wide scrollbar where you get to see the whole file scaled so it fits vertically.  Is there a way to do this in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lJks4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lJks4.png&quot; alt=&quot;Wide scrollbar&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked into having a 2nd frame and changing the zoom of the font in that frame, but the zoom affects any frame with the same buffer.&lt;/p&gt;&#xA;" OwnerUserId="12907" LastActivityDate="2016-08-09T17:49:45.373" Title="Can Emacs provide a wide scrollbar (birds-eye view) of code?" Tags="|frames|fonts|scroll-bars|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26138" PostTypeId="2" ParentId="965" CreationDate="2016-08-08T07:36:27.993" Score="0" Body="&lt;p&gt;Unfortunately Giles is not  correct about Emacs properly converting hex colors to Xterm colors.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;No nearest match translation is done. (The visual results are bad) themes have a color class system which they are supposed to use, instead of the &lt;code&gt;display-graphic-p&lt;/code&gt; solution used in Gruvbox.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only problems with the &lt;code&gt;display-graphic-p&lt;/code&gt; solution is that it only calculates at first load.  Which can cause issues when running an Emacs daemon and starting both GUI and Terminal emacsclient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OP could have a problem if the terminal isn't configured for Xterm 256 color mode.  These &lt;code&gt;unable to load color&lt;/code&gt; errors will show up anyway and can be safely ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: This question would have attracted better support if posted as an issue to the Gruvbox repo issues.  I suggest that anyone having problems with a theme or package, attempt to get help from the maintainers before trying here.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Updated with additional images...&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; To illustrate that the theme is working as expected, I made a couple of screen grabs on Darktooth which originated as a fork of Gruvbox, and uses an identical palette creation technique.  The same errors are shown, however they're meaningless, as the color which should be applied by the &lt;em&gt;xterm color name&lt;/em&gt;, is applied correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fig 1&lt;/strong&gt; - The Theme rendered in an xterm-256color compat terminal with the &lt;code&gt;display-graphic-p&lt;/code&gt; predicate selecting the xterm color names:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VVK8h.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VVK8h.png&quot; alt=&quot;Fig 1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fig 2&lt;/strong&gt; - The Theme rendered in an xterm-256color compat terminal with the &lt;code&gt;display-graphic-p&lt;/code&gt; predicate removed, therefore just the hex colors are passed to Emacs for &lt;em&gt;translation&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jxx5D.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jxx5D.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While Emacs does an OK job, it's not as the theme designer intended, and we can see that the XTerm colors are being sent correctly in Fig 1 but not Fig 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, Emacs &lt;strong&gt;is&lt;/strong&gt; sending &lt;code&gt;&quot;unable to load color&quot;&lt;/code&gt; errors to &lt;code&gt;*Messages*&lt;/code&gt; but these errors are spurious and can be disregarded.  As long as &lt;code&gt;TERM=xterm-256color&lt;/code&gt; is in the current environment and the terminal can support xterm 256 color mode, the theme will still display as intended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helped.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="2485" LastEditDate="2016-08-20T11:25:38.770" LastActivityDate="2016-08-20T11:25:38.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26139" PostTypeId="1" AcceptedAnswerId="26659" CreationDate="2016-08-08T08:37:00.020" Score="1" ViewCount="612" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/realgud/realgud&quot; rel=&quot;nofollow&quot;&gt;realgud&lt;/a&gt; I have a text button that needs access to a dynamically-bound buffer-local variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The situation occurs like this. Inside one buffer that has the buffer local variable, there is a command that creates another &quot;Describe&quot; buffer with the value of that complex &lt;code&gt;defstruct&lt;/code&gt; variable formatted nicely using org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But inside that &quot;Describe&quot; buffer I would like to have a button that calls &lt;code&gt;describe-variable&lt;/code&gt; on the variable, but have that use the value from its original buffer location, not the value in the describe buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have inside &lt;code&gt;insert-text-button&lt;/code&gt; an action property like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'action '(lambda(button) (describe-variable 'realgud-cmdbuf-info))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this gives picks up the wrong buffer-local value. I can't change the above say to: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'action '(lambda(button) (with-current-buffer buffer (describe-variable 'realgud-cmdbuf-info)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because of the quote in front of the lambda, and because &lt;code&gt;with-current-buffer&lt;/code&gt; is a macro. Changing that to start `list('lambda(button) would be cumbersome if I could figure it out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably I need to use some macro here, but that also is beyond my comprehension. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;`&lt;/p&gt;&#xA;" OwnerUserId="5163" LastEditorUserId="5163" LastEditDate="2016-09-01T05:12:48.973" LastActivityDate="2016-09-01T05:12:48.973" Title="How to get an insert-text-button 'action property accessing a dynamically-bound buffer-local variable" Tags="|elisp|text-properties|programming|buffer-local|lexical-scoping|" AnswerCount="2" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="26140" PostTypeId="1" CreationDate="2016-08-08T11:21:33.870" Score="2" ViewCount="761" Body="&lt;p&gt;When I have imported the &lt;code&gt;reagent.core&lt;/code&gt; library as &lt;code&gt;reagent&lt;/code&gt; and I type &lt;code&gt;(reagent/&lt;/code&gt; I want to see all possible functions from that library I can use, preferably with documentation. Unfortunately I get only suggestions of text I already typed in that file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/owrqr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/owrqr.png&quot; alt=&quot;not enough suggestions&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to see something similar as this, only then for reagent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1dIqQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1dIqQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;ac-cider&lt;/code&gt; and &lt;code&gt;auto-complete&lt;/code&gt; packages with the following settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Auto-completion&#xA;(require 'ac-cider)    &#xA;(add-hook 'cider-mode-hook 'ac-flyspell-workaround)&#xA;(add-hook 'cider-mode-hook 'ac-cider-setup)&#xA;(add-hook 'cider-repl-mode-hook 'ac-cider-setup)&#xA;&#xA;(require 'auto-complete)&#xA;(add-to-list 'ac-modes 'cider-mode)&#xA;(add-to-list 'ac-modes 'cider-repl-mode)&#xA;&#xA;(defun set-auto-complete-as-completion-at-point-function ()&#xA;  (setq completion-at-point-functions '(auto-complete)))&#xA;(add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)&#xA;(add-hook 'cider-mode-hook 'set-auto-complete-as-completion-at-point-function)&#xA;&#xA;(defun clojure-auto-complete-hook ()&#xA;  (auto-complete-mode 1))&#xA;&#xA;(add-hook 'clojure-mode-hook 'clojure-auto-complete-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I see all possible functions to use from an external library when I type the imported name? &lt;/p&gt;&#xA;" OwnerUserId="11605" LastActivityDate="2016-08-08T11:21:33.870" Title="Show all library functions in autocomplete with Cider" Tags="|auto-complete-mode|clojure|cider|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26141" PostTypeId="2" ParentId="17973" CreationDate="2016-08-08T12:18:57.090" Score="2" Body="&lt;pre&gt;&lt;code&gt;# -*- eval:(flymake-mode-off) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use this as a file local variable for remote files.&lt;/p&gt;&#xA;" OwnerUserId="12911" LastActivityDate="2016-08-08T12:18:57.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26142" PostTypeId="1" AcceptedAnswerId="26798" CreationDate="2016-08-08T12:56:18.773" Score="2" ViewCount="1042" Body="&lt;p&gt;So I start up emacs open foo.lisp then I would start slime and the window splits nicely. Except I don't want to start slime manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is it possible to switch to or startup slime when I open an appropriate file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such that my file buffer splits and slime is to the side below whatever.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun start-or-switch-to (function buffer-name)&#xA;  (if (not (get-buffer buffer-name))&#xA;      (progn&#xA;        (split-window-sensibly (selected-window))&#xA;        (other-window 1)&#xA;        (funcall function))&#xA;    (switch-to-buffer-other-window buffer-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have found this snippet of code. And tried to execute it with a&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook.....)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This however shoves the opened file and opens slime on both sides of the split.&lt;/p&gt;&#xA;" OwnerUserId="12896" LastEditorUserId="12896" LastEditDate="2016-08-08T13:01:19.173" LastActivityDate="2016-09-03T06:19:59.963" Title="Is it possible to open file then load slime automatically?" Tags="|window-splitting|slime|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26143" PostTypeId="1" CreationDate="2016-08-08T14:04:00.157" Score="7" ViewCount="686" Body="&lt;p&gt;In a &lt;code&gt;dired&lt;/code&gt; buffer of a directory, how do I copy the file names of all files matching &lt;code&gt;[tT]ypolog[yi]&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Getting them from an &lt;code&gt;elisp&lt;/code&gt; list format, &lt;code&gt;\n&lt;/code&gt; separated format or otherwise into a &lt;code&gt;python&lt;/code&gt; list format will be trivial, so the precise content of the kill ring matters little.&lt;/p&gt;&#xA;" OwnerUserId="2702" LastActivityDate="2016-08-09T07:30:19.230" Title="Copy all file names that match regexp" Tags="|dired|copy-paste|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26144" PostTypeId="2" ParentId="26143" CreationDate="2016-08-08T14:04:00.157" Score="2" Body="&lt;p&gt;You can mark all files whose names match a regular expression using &lt;code&gt;dired-mark-files-regexp&lt;/code&gt;, and then copy them to the kill ring them (see &lt;a href=&quot;https://emacs.stackexchange.com/a/21231/2702&quot;&gt;this answer&lt;/a&gt;) using &lt;code&gt;dired-copy-filename-as-kill&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this does not result in a list that is in any way nicely separated, because the file names are just concatenated using by  &lt;code&gt;&lt;/code&gt;, so if your file names may contain spaces, you get a mess.&lt;/p&gt;&#xA;" OwnerUserId="2702" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-08-08T14:04:00.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26145" PostTypeId="2" ParentId="26136" CreationDate="2016-08-08T14:05:06.017" Score="1" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/thumb-frm.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;thumb-frm.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; gives you &lt;strong&gt;thumbnail frames&lt;/strong&gt;, which provide a very similar feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are real, usable frames, but they are thumbnail-size (configurable). And you can, if you want, have them placed along a screen edge, similar to what you show.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Emacs-Wiki page &lt;a href=&quot;https://www.emacswiki.org/emacs/FisheyeWithThumbs&quot; rel=&quot;nofollow&quot;&gt;Fisheye with Thumbs&lt;/a&gt; for details and screenshots.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-08T14:05:06.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26146" PostTypeId="2" ParentId="26143" CreationDate="2016-08-08T15:35:29.860" Score="11" Body="&lt;p&gt;Use function &lt;code&gt;directory-files&lt;/code&gt;, for which &lt;code&gt;C-h f&lt;/code&gt; tells you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;directory-files is a built-in function in `C source code'.&#xA;&#xA;(directory-files DIRECTORY &amp;amp;optional FULL MATCH NOSORT)&#xA;&#xA;Return a list of names of files in DIRECTORY.&#xA;There are three optional arguments:&#xA;If FULL is non-nil, return absolute file names.  Otherwise return names&#xA; that are relative to the specified directory.&#xA;If MATCH is non-nil, mention only file names that match the regexp MATCH.&#xA;If NOSORT is non-nil, the list is not sorted--its order is unpredictable.&#xA; Otherwise, the list returned is sorted with `string-lessp'.&#xA; NOSORT is useful if you plan to sort the result yourself.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, you provide your regexp as argument &lt;code&gt;MATCH&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-: (directory-files default-directory nil &quot;[tT]ypolog[yi]&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you need not be in a Dired buffer to use this.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-08T15:35:29.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26148" PostTypeId="2" ParentId="26143" CreationDate="2016-08-08T16:06:10.720" Score="3" Body="&lt;p&gt;If you use &lt;code&gt;counsel-find-file&lt;/code&gt; from the &lt;code&gt;counsel&lt;/code&gt; MELPA package, you can press &lt;kbd&gt;M-w&lt;/kbd&gt; to copy all current matches. It works with regex patterns as input. Then press &lt;kbd&gt;C-g&lt;/kbd&gt; if you don't wont to select a file afterwards.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-08-08T16:06:10.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26149" PostTypeId="1" AcceptedAnswerId="26155" CreationDate="2016-08-08T16:55:44.387" Score="4" ViewCount="1427" Body="&lt;p&gt;I have a question about the &lt;code&gt;babel&lt;/code&gt; latex package (not &lt;code&gt;org-babel&lt;/code&gt;, which allows source code in documents). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to load the babel package with the &lt;code&gt;american&lt;/code&gt; language set so I added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage[american]{babel}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my org file. However, in the tex export it adds &lt;code&gt;english&lt;/code&gt; to this so that the tex output has:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\usepackage[american, english]{babel}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I don't want. How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2016-08-08T23:52:22.607" Title="How to use &quot;american&quot; language for babel in latex export" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26150" PostTypeId="2" ParentId="21964" CreationDate="2016-08-08T17:01:51.390" Score="1" Body="&lt;p&gt;I got the similar error, and I fixed it by adding &lt;code&gt;python&lt;/code&gt; executable (symlinked to &lt;code&gt;python3&lt;/code&gt;) on &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at source, you can see that function &lt;a href=&quot;https://github.com/gregsexton/ob-ipython/blob/950dbde87947f9e8f53f521d4bcf239f3be8ef71/ob-ipython.el#L158&quot; rel=&quot;nofollow&quot;&gt;ob-ipython--launch-driver&lt;/a&gt; expect &lt;code&gt;python.exe&lt;/code&gt; or &lt;code&gt;python&lt;/code&gt; on &lt;code&gt;PATH&lt;/code&gt; in order to create process.&lt;/p&gt;&#xA;" OwnerUserId="12916" LastActivityDate="2016-08-08T17:01:51.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26151" PostTypeId="1" CreationDate="2016-08-08T17:27:29.483" Score="0" ViewCount="107" Body="&lt;p&gt;Is it possible to narrow the look of only particular characters such as a, b, and c (Unicode code points #x61 through #x63) to 1/3 or something in width, without changing the font? If so, how? I know that you can change font for some particular Unicode code point ranges, and there's a type of font called condensed font, but I'd like to keep the font as is. The reason I don't like to change font is that I'm thinking of applying this to some fonts that there's not really an exact narrow-width equivalent for, like the color emoji font by Apple.&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="10707" LastEditDate="2016-08-09T01:08:43.470" LastActivityDate="2016-08-09T01:08:43.470" Title="Narrow the width of some characters without changing the font" Tags="|fonts|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26152" PostTypeId="2" ParentId="26073" CreationDate="2016-08-08T19:26:06.037" Score="1" Body="&lt;p&gt;You can &lt;code&gt;customize-variable&lt;/code&gt; &lt;code&gt;evil-default-state&lt;/code&gt; (to &lt;code&gt;emacs&lt;/code&gt;, &lt;code&gt;insert&lt;/code&gt; ...)&lt;/p&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2016-08-08T19:26:06.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26153" PostTypeId="2" ParentId="24351" CreationDate="2016-08-08T19:52:18.290" Score="1" Body="&lt;p&gt;In vim, one would use &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;d&lt;/kbd&gt; and &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;t&lt;/kbd&gt; in insert mode for this, which is replicated in Evil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, you would have to &lt;a href=&quot;https://www.emacswiki.org/emacs/Evil#toc8&quot; rel=&quot;nofollow&quot;&gt;rebind&lt;/a&gt; functions &lt;code&gt;evil-shift-left-line&lt;/code&gt; and &lt;code&gt;evil-shift-right-line&lt;/code&gt; to &lt;kbd&gt;TAB&lt;/kbd&gt; and &lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;TAB&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2016-08-08T19:52:18.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26154" PostTypeId="2" ParentId="26056" CreationDate="2016-08-08T20:03:44.337" Score="1" Body="&lt;p&gt;Another possibility:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Dired, in a directory in &lt;code&gt;Info-default-directory-list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;strong&gt;&lt;code&gt;% g&lt;/code&gt;&lt;/strong&gt; (command &lt;strong&gt;&lt;code&gt;dired-mark-files-containing-regexp&lt;/code&gt;&lt;/strong&gt;) to mark the Info files containing matches for your regexp.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-:&lt;/code&gt; &lt;strong&gt;&lt;code&gt;(multi-isearch-files-regexp (dired-get-marked-files))&lt;/code&gt;&lt;/strong&gt;, then type your regexp to search for matches (in the Info files that have matches).  (You can turn that into a command if you want.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then instead of step 2 you can do &#xA;&lt;code&gt;M-:&lt;/code&gt; &lt;strong&gt;&lt;code&gt;(icicle-search nil nil (format &quot;.*%s.*&quot; REGEXP) t (dired-get-marked-files))&lt;/code&gt;&lt;/strong&gt;, where &lt;code&gt;REGEXP&lt;/code&gt; is your regexp.  (You can turn that into a command if you want.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Completion candidates are the lines with &lt;code&gt;REGEXP&lt;/code&gt; matches in the Info files. You can type an input pattern to match any of them. Use &lt;code&gt;C-down&lt;/code&gt; to cycle among matches, or use &lt;code&gt;C-RET&lt;/code&gt; or &lt;code&gt;C-mouse-2&lt;/code&gt; to access any of the matches individually (i.e., in any order).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;REGEXP&lt;/code&gt; itself can match more than one line then use it as is, instead of &lt;code&gt;(format &quot;.*%s.*&quot; REGEXP)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-08T20:03:44.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26155" PostTypeId="2" ParentId="26149" CreationDate="2016-08-08T23:52:22.607" Score="6" Body="&lt;p&gt;Apparently, if you include the &lt;code&gt;babel&lt;/code&gt; package with the brackets for package options, the org exporter adds as the value of the current language as an option for the package.  So you can just set the &lt;code&gt;LANGUAGE&lt;/code&gt; option as in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: en-us&#xA;#+LATEX_HEADER: \usepackage[]{babel}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LANGUAGE: en-us&#xA;#+LATEX_HEADER: \usepackage[american]{babel}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The mapping between LANGUAGE code and babel option is given in variable &lt;code&gt;org-latex-babel-language-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-08-08T23:52:22.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26156" PostTypeId="1" CreationDate="2016-08-09T04:02:50.443" Score="0" ViewCount="79" Body="&lt;p&gt;I recently shifted over to and wrote a literate init.el in a manner of speaking. Using &lt;a href=&quot;http://endlessparentheses.com/init-org-Without-org-mode.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; technique, I don't (require 'org-mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suddenly when I open up my .org file to edit it, it consistently hangs for a second on &lt;code&gt;uncompressing ob-tangle.el.gz...done&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I have started from scratch and had not noticed that at all over the last few days while editing it, was I just blind, or did something happen?&lt;/p&gt;&#xA;" OwnerUserId="12896" LastActivityDate="2016-08-09T08:07:48.503" Title="Why is org-mode always uncompressing ob-tangle.el.gz?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26157" PostTypeId="2" ParentId="26156" CreationDate="2016-08-09T04:24:37.777" Score="2" Body="&lt;p&gt;The long and short of it is that I had accidentally modified that file while looking at source. Causing emacs to prefer it over the older bytecompiled version of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So on osx I pulled &lt;code&gt;touch -mt YYYYMMDDhhmm&lt;/code&gt; on the file and rolled it back to earlier than the bytecompiled version.&lt;/p&gt;&#xA;" OwnerUserId="12896" LastEditorUserId="12896" LastEditDate="2016-08-09T08:07:48.503" LastActivityDate="2016-08-09T08:07:48.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26158" PostTypeId="2" ParentId="26143" CreationDate="2016-08-09T07:30:19.230" Score="1" Body="&lt;p&gt;you could use a shell command to list the directory (ls -1), then use keep-lines to delete the lines that do not match your regex. the buffer then contains just the  file names that you want, one per line.&lt;/p&gt;&#xA;" OwnerUserId="5431" LastActivityDate="2016-08-09T07:30:19.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26159" PostTypeId="1" AcceptedAnswerId="26166" CreationDate="2016-08-09T08:53:35.953" Score="2" ViewCount="592" Body="&lt;p&gt;I recently installed a programming package, &quot;Haskell mode,&quot; and apparently I changed how &quot;initial parenthesis highlighting&quot; works. I'm used to a quick black/white box superimposed on the initial parenthesis. Now there is a solid colored box that lingers for a while. How do I change this back to the default behavior?&lt;/p&gt;&#xA;" OwnerUserId="12845" LastEditorUserId="105" LastEditDate="2016-08-09T14:23:24.770" LastActivityDate="2016-08-09T14:40:34.327" Title="change how initial parenthesis is highlighted" Tags="|highlighting|programming|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26160" PostTypeId="1" CreationDate="2016-08-09T10:07:03.943" Score="5" ViewCount="312" Body="&lt;p&gt;So, say I have a literate org file as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Random Scrap&#xA;&#xA;* Do something&#xA;:PROPERTIES:&#xA;:tangle: scrap.pl&#xA;:comments: org&#xA;:END:&#xA;&#xA;#+BEGIN_SRC perl&#xA;  sub my_func{&#xA;    my $var = pop;&#xA;#+END_SRC&#xA;&#xA;some thoughts here..&#xA;and the func continues...&#xA;#+BEGIN_SRC perl&#xA;    my $var1 = $var+1;&#xA; }&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tangling it to source using &lt;code&gt;C-c C-v C-t&lt;/code&gt; gives me the following ugly code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Do something&#xA;# :PROPERTIES:&#xA;# :tangle: scrap.pl&#xA;# :comments: org&#xA;# :END:&#xA;&#xA;&#xA;sub my_func{&#xA;  my $var = pop;&#xA;&#xA;&#xA;&#xA;# some thoughts here..&#xA;# and the func continues...&#xA;&#xA;&#xA;my $var1 = $var+1;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a simple way to preserve indentation across source blocks, when all of them are going to tangle to a single file?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a way to avoid the &lt;code&gt;# :PROPERTIES: ... # :END:&lt;/code&gt; text to come to the header?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It would be great to have the first feature available. Org mode is a great tool for documenting source code. However, the wrong indentations put it off sometimes. At times, I break the code into fragments that indent properly. At other times, it is required to break code elsewhere, and causes issues like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq org-src-preserve-indentation t)&lt;/code&gt; solved my problem partially. The output tangled file now goes like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Do something&#xA;# :PROPERTIES:&#xA;# :tangle: scrap.pl&#xA;# :comments: org&#xA;# :END:&#xA;&#xA;&#xA;  sub my_func{&#xA;    my $var = pop;&#xA;&#xA;&#xA;&#xA;# some thoughts here..&#xA;# and the func continues...&#xA;&#xA;&#xA;    my $var1 = $var+1;&#xA;  }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the comments are still out of indentation. Also, the responsibility of maintaining indentation now lies with me. And the header text is as is...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any comments/answers? I feel this solution is a bit hacky...&lt;/p&gt;&#xA;" OwnerUserId="3849" LastEditorUserId="3849" LastEditDate="2016-08-09T10:27:19.783" LastActivityDate="2016-08-09T10:27:19.783" Title="Indentation using multiple org src block" Tags="|org-babel|literate-programming|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26161" PostTypeId="1" CreationDate="2016-08-09T10:18:18.317" Score="0" ViewCount="300" Body="&lt;p&gt;Yesterday, I ran an upgrade from 12.04.5 over 14.04.5 to 16.04.1. The first step (12.04.5 --&gt; 14.04.5) worked quite well, no relevant problems. But the second step failed due to problems with some packages, hereunder XEmacs. Here's the log that comes when I try to run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    root@xxx:/home/xxx# sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&#xA;OK:1 http://archive.ubuntu.com/ubuntu xenial InRelease&#xA;Holen:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [95,7 kB]&#xA;OK:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease                                     &#xA;OK:4 http://archive.canonical.com/ubuntu xenial InRelease                          &#xA;Holen:5 http://archive.ubuntu.com/ubuntu xenial-security InRelease [94,5 kB]       &#xA;Holen:6 http://archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [308 kB]&#xA;Es wurden 498 kB in 3 s geholt (142 kB/s).                  &#xA;Paketlisten werden gelesen... Fertig&#xA;Abhängigkeitsbaum wird aufgebaut.       &#xA;Statusinformationen werden eingelesen.... Fertig&#xA;Alle Pakete sind aktuell.&#xA;Paketlisten werden gelesen... Fertig&#xA;Abhängigkeitsbaum wird aufgebaut.       &#xA;Statusinformationen werden eingelesen.... Fertig&#xA;Paketaktualisierung (Upgrade) wird berechnet... Fertig&#xA;Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:&#xA;  akonadi-backend-mysql akonadi-server bzr checkbox-ng comerr-dev dh-apparmor dpatch g++-4.6 g++-4.8&#xA;  gcc-4.9-base gcj-4.6-base gcj-4.6-jre-lib gcj-4.8-jre-lib gnuplot-data gnuplot-x11&#xA;  gstreamer1.0-clutter html2text hwinfo icedtea-netx kde-config-mailtransport kdegames-data&#xA;  kdepim-runtime kdepimlibs-data kdepimlibs-kio-plugins krb5-multidev kubuntu-debug-installer&#xA;  libabw-0.1-1v5 libaccounts-qt1 libakonadi-calendar4 libakonadi-contact4 libakonadi-kabc4&#xA;  libakonadi-kcal4 libakonadi-kmime4 libakonadi-notes4 libakonadi-socialutils4 libamd2.2.0 libamd2.3.1&#xA;  libapt-inst1.5 libarchive-extract-perl libarpack2 libastro1 libatk-wrapper-java&#xA;  libatk-wrapper-java-jni libatlas3gf-base libattica0.3 libaubio2 libavahi-client-dev&#xA;  libavahi-common-dev libavcodec54 libavdevice53 libavfilter3 libavformat54 libavresample1 libbabl-0.0-0&#xA;  libbackport-util-concurrent-java libbaloocore4 libbaloofiles4 libbalooxapian4&#xA;  libbasicusageenvironment0 libbind9-90 libblas3gf libboost-date-time1.54.0 libboost-date-time1.58.0&#xA;  libboost-iostreams1.46.1 libboost-iostreams1.54.0 libboost-program-options1.46.1&#xA;  libboost-program-options1.54.0 libboost-python1.46.1 libboost-python1.54.0 libboost-system1.54.0&#xA;  libboost-thread1.46.1 libboost-thread1.54.0 libboost-thread1.58.0 libcamd2.3.1 libcamel-1.2-45&#xA;  libccolamd2.7.1 libccolamd2.8.0 libcdr-0.0-0 libcdt4 libcelt0-0 libcholmod1.7.1 libcholmod2.1.2&#xA;  libclucene-contribs1v5 libclucene0ldbl libclutter-imcontext-0.1-0 libclutter-imcontext-0.1-bin&#xA;  libcluttergesture-0.0.2-0 libcmis-0.4-4 libcmis-0.5-5v5 libcolamd2.7.1 libcolamd2.8.0&#xA;  libcollections15-java libcolorhug1 libcommons-codec-java libcr0 libcxsparse2.2.3 libdee-qt5-3&#xA;  libdmtx0a libdns100 libdvbpsi7 libdvbpsi8 libe-book-0.1-1 libebackend-1.2-7 libebml3 libebook-1.2-14&#xA;  libebook-contacts-1.2-0 libedata-book-1.2-20 libedataserver-1.2-18 libegl1-mesa-drivers libelfg0&#xA;  libeot0 libept1.4.12 libepub0 libexif-dev libexiv2-12 libexttextcat-2.0-0 libfftw3-3 libfltk1.1&#xA;  libfreehand-0.1-1 libfriends0 libgcj12 libgcj14 libgcrypt11-dev libgcrypt20-dev libgegl-0.0-0&#xA;  libgegl-0.2-0 libgif4 libglamor0 libglew1.10 libglew1.5 libglewmx1.10 libglpk0 libgmp-dev&#xA;  libgmpxx4ldbl libgnome-bluetooth11 libgnome-desktop-3-7 libgnutls-dev libgnutlsxx27 libgnutlsxx28&#xA;  libgoffice-0.8-8 libgoffice-0.8-8-common libgpg-error-dev libgphoto2-dev libgphoto2-port10 libgps20&#xA;  libgps22 libgrail5 libgrantlee-templates5 libgrantlee-textdocument5 libgraph4 libgraphicsmagick++3&#xA;  libgraphicsmagick3 libgroupsock1 libgssrpc4 libgtksourceview2.0-0 libgtksourceview2.0-common libgvc5&#xA;  libhal1 libhd16 libhd21 libhdf5-serial-dev libhwloc-plugins libhwloc5 libibverbs1 libicu52&#xA;  libidn11-dev libieee1284-3-dev libilmbase6 libimobiledevice4 libintl-perl libisc95 libisccc90&#xA;  libisccfg90 libisl10 libjavascriptcoregtk-1.0-0 libjaxme-java libkactivities-models1 libkadm5clnt-mit8&#xA;  libkadm5clnt-mit9 libkadm5srv-mit8 libkadm5srv-mit9 libkalarmcal2 libkcal4 libkcalutils4 libkdb5-6&#xA;  libkdb5-8 libkdeedu-data libkdegames5a libkdegames6 libkf5akonadiagentbase5 libkf5akonadicalendar5&#xA;  libkf5akonadicontact5 libkf5akonadicore-bin libkf5akonadicore5 libkf5akonadimime5 libkf5akonadinotes5&#xA;  libkf5akonadiprivate5 libkf5akonadiwidgets5 libkf5alarmcalendar5 libkf5calendarcore5&#xA;  libkf5calendarutils5 libkf5contacts-data libkf5contacts5 libkf5emoticons-bin libkf5emoticons-data&#xA;  libkf5emoticons5 libkf5gapi-data libkf5gapicalendar5 libkf5gapicontacts5 libkf5gapicore5&#xA;  libkf5gapitasks5 libkf5holidays-data libkf5holidays5 libkf5identitymanagement5 libkf5imap5&#xA;  libkf5itemmodels5 libkf5ldap5 libkf5mailtransport-data libkf5mailtransport5 libkf5mbox5 libkf5mime5&#xA;  libkf5pimtextedit5 libkfbapi1 libkgapi2-2 libkholidays4 libkidletime4 libkimap4 libkmbox4 libkmime4&#xA;  libknewstuff2-4 libkolab1 libkolabxml1v5 libkpimidentities4 libkpimtextedit4 libkpimutils4 libkrb5-dev&#xA;  libkscreen1 liblapack3gf liblinear1 liblivemedia23 libllvm3.4 liblog-message-perl&#xA;  liblog-message-simple-perl liblwres90 libmagick++4 libmagick++5 libmagickcore4 libmagickcore4-extra&#xA;  libmagickcore5 libmagickcore5-extra libmagickwand4 libmagickwand5 libmailtransport4&#xA;  libmarblewidget-qt5-23 libmatroska5 libmbim-glib0 libmicroblog4 libmikmod2 libmodule-pluggable-perl&#xA;  libmodule-runtime-perl libmono-addins-gui0.2-cil libmono-addins0.2-cil libmono-sharpzip4.84-cil&#xA;  libmspub-0.0-0 libmspub-0.1-1 libmuparser0debian1 libmusicbrainz5-0 libmwaw-0.3-3 libmx-1.0-2&#xA;  libmx-bin libmx-common libnepomukcleaner4 libnepomukcore4abi1 libokularcore1abi1 libokularcore4&#xA;  libopenexr6 libopenjpeg2 libopenmpi1.6 libopenspc0 libopenvg1-mesa liborcus-0.10-0v5 liborcus-0.6-0&#xA;  libp11-kit-dev libpagemaker-0.0-0 libparams-classify-perl libparpack2 libpathplan4 libperl-dev&#xA;  libpocketsphinx1 libpod-latex-perl libpodofo0.9.0 libpoppler44 libprison0 libprocps3 libprotobuf8&#xA;  libprotoc8 libpthread-stubs0 libqapt3 libqapt3-runtime libqextserialport1 libqhull5 libqmi-glib0&#xA;  libqpdf13 libqrencode3 libqrupdate1 libqt5qml-graphicaleffects libqt5sensors5&#xA;  libqt5webkit5-qmlwebkitplugin libqtlocation1 libqtscript4-core libqtscript4-gui libqtscript4-network&#xA;  libqtscript4-opengl libqtscript4-phonon libqtscript4-qtbindings libqtscript4-sql libqtscript4-svg&#xA;  libqtscript4-uitools libqtscript4-webkit libqtscript4-xml libqtscript4-xmlpatterns libqtwebkit-dev&#xA;  libquazip0 libraw9 libreadline5 libreadonly-xs-perl librhythmbox-core8 libruby1.8 libsctp1&#xA;  libsdl-net1.2 libshp1 libshp2 libsignon-qt1 libsnmp-perl libsp1c2 libsphinxbase1 libstdc++-4.8-dev&#xA;  libstdc++6-4.6-dev libsystemd-daemon0 libsystemd-journal0 libsystemd-login0 libtar0 libtasn1-3-dev&#xA;  libtasn1-6-dev libtasn1-doc libtcl8.5 libterm-ui-perl libtext-soundex-perl libthumbnailer0&#xA;  libtiff4-dev libtiffxx0c2 libtk8.5 libtorque2 libts-0.0-0 libu1db-qt5-3 libumfpack5.4.0&#xA;  libumfpack5.6.2 libunityvoice1 libusageenvironment1 libusb-dev libusbmuxd2 libv4l-dev libv4l2rds0&#xA;  libvisio-0.0-0 libvte-common libvte9 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libwlocate0&#xA;  libwps-0.4-4 libx264-120 libx264-142 libx86emu1 libxerces-c3.1 libxtables10 libyaml-syck-perl libzip2&#xA;  libzip4 linux-headers-generic-lts-trusty lksctp-tools lp-solve marble-data marble-plugins&#xA;  mysql-client-core-5.7 mysql-server-core-5.7 nepomuk-core-data nettle-dev octave3.2-common&#xA;  octave3.2-htmldoc perlmagick python-bzrlib python-commandnotfound python-configobj python-gpgme&#xA;  python-imaging-tk python-requests python-support python3-checkbox qapt-batch&#xA;  qml-module-qtquick-localstorage qml-module-ubuntu-ui-extras-browser qtdeclarative5-dialogs-plugin&#xA;  qtdeclarative5-friends0.2 qtdeclarative5-localstorage-plugin qtdeclarative5-privatewidgets-plugin&#xA;  qtdeclarative5-qtfeedback-plugin qtdeclarative5-u1db1.0 qtdeclarative5-ubuntu-settings-components&#xA;  qtdeclarative5-ubuntu-ui-extras-browser-plugin qtdeclarative5-ubuntu-ui-extras-browser-plugin-assets&#xA;  qtdeclarative5-window-plugin shared-desktop-ontologies sp sphinx-voxforge-hmm-en sphinx-voxforge-lm-en&#xA;  syslinux-themes-debian syslinux-themes-debian-squeeze syslinux-themes-debian-wheezy tcl8.5 tk8.5&#xA;  tsconf ttf-umefont ttf-unfonts-core unity-lens-friends unity-scope-audacious unity-scope-clementine&#xA;  unity-scope-gmusicbrowser unity-scope-gourmet unity-scope-guayadeque unity-scope-musique&#xA;  unity-voice-service wine-gecko1.4 wine1.4 wine1.4-i386&#xA;Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.&#xA;0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.&#xA;27 nicht vollständig installiert oder entfernt.&#xA;Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.&#xA;Möchten Sie fortfahren? [J/n] j&#xA;emacsen-common (2.0.8) wird eingerichtet ...&#xA;Install emacsen-common for xemacs21&#xA;emacsen-common: Handling install of emacsen flavor xemacs21&#xA;&#xA;WARNING:&#xA;Couldn't find obvious defaults for:&#xA;data-directory&#xA;mule-lisp-directory&#xA;lisp-directory&#xA;Perhaps some directories don't exist, or the XEmacs executable,&#xA;/usr/bin/xemacs21&#xA;is in a strange place?Loading /usr/share/emacs/site-lisp/debian-startup...&#xA;Loading 00debian...&#xA;Error while loading 00debian: Symbol's function definition is void: loop&#xA;Loading 00debian-vars...&#xA;Loading 50asymptote...&#xA;Loading 50autoconf...&#xA;Error while loading 50autoconf: No /usr/local/ prefixed paths in load-path&#xA;Loading 50dictionaries-common...&#xA;Error while loading 50dictionaries-common: No /usr/local/ prefixed paths in load-path&#xA;Loading 50latex-cjk-common...&#xA;Error while loading 50latex-cjk-common: Cannot open load file: cjk-enc&#xA;Loading 50latex-cjk-thai...&#xA;Loading 50lilypond-data...&#xA;Loading 50noweb...&#xA;Loading 50octave3.2-emacsen...&#xA;Loading 50thailatex...&#xA;Symbol's function definition is void: dolist&#xA;xemacs exiting&#xA;.&#xA;ERROR: install script from emacsen-common package failed&#xA;dpkg: Fehler beim Bearbeiten des Paketes emacsen-common (--configure):&#xA; Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von dictionaries-common:&#xA; dictionaries-common hängt ab von emacsen-common (&amp;gt;= 2.0.5); aber:&#xA;  Paket emacsen-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes dictionaries-common (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von aspell:&#xA; aspell hängt ab von dictionaries-common (&amp;gt;&amp;gt; 0.40); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes aspell (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von aspell-en:&#xA; aspell-en hängt ab von aspell (&amp;gt;= 0.60.3-2); aber:&#xA;  Paket aspell ist noch nicht konfiguriert.&#xA;Es wurde kein Apport-Bericht verfasst, da die Fehlermeldung darauf hindeutet, dass dies lediglich ein Folgefehler eines vorherigen Problems ist.&#xA;                                      Es wurde kein Apport-Bericht verfasst, da die Fehlermeldung darauf hindeutet, dass dies lediglich ein Folgefehler eines vorherigen Problems ist.&#xA;                                                                            Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                      Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;          Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                                              Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                        Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                  Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                            Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;      Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;&#xA;                                                                                            Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes aspell-en (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hunspell-de-at:&#xA; hunspell-de-at hängt ab von dictionaries-common (&amp;gt;= 0.10); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hunspell-de-at (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hunspell-de-ch:&#xA; hunspell-de-ch hängt ab von dictionaries-common (&amp;gt;= 0.10); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hunspell-de-ch (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hunspell-de-de:&#xA; hunspell-de-de hängt ab von dictionaries-common (&amp;gt;= 0.10); aber:&#xA;  Paket dictionaries-common ist noch nicht konfEs wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                         Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;   Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                                       Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                 Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                           Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                     Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                                                         Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                                   Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                             Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                       Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                 Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                                                     iguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hunspell-de-de (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hunspell-en-ca:&#xA; hunspell-en-ca hängt ab von dictionaries-common; aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hunspell-en-ca (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hunspell-en-gb:&#xA; hunspell-en-gb hängt ab von dictionaries-common; aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hunspell-en-gb (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hunspell-en-us:&#xA; hunspell-en-us hängt ab von dictionaries-common (&amp;gt;= 0.10); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hunspell-Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                            Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;      Es wurde kein Apport-Bericht verfasst, da das Limit MaxReports bereits erreicht ist.&#xA;                                                                                          en-us (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hunspell-en-za:&#xA; hunspell-en-za hängt ab von dictionaries-common; aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hunspell-en-za (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hyphen-de:&#xA; hyphen-de hängt ab von dictionaries-common; aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hyphen-de (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von hyphen-en-us:&#xA; hyphen-en-us hängt ab von dictionaries-common (&amp;gt;= 0.10) | openoffice.org-updatedicts; aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;  Paket openoffice.org-updatedicts ist nicht installiert.&#xA;  Paket dictionaries-common, das openoffice.org-updatedicts bereitstellt, ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes hyphen-en-us (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von iamerican:&#xA; iamerican hängt ab von dictionaries-common (&amp;gt;= 1.23~); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes iamerican (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von myspell-en-gb:&#xA; myspell-en-gb hängt ab von hunspell-en-gb; aber:&#xA;  Paket hunspell-en-gb ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes myspell-en-gb (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von myspell-en-za:&#xA; myspell-en-za hängt ab von hunspell-en-za; aber:&#xA;  Paket hunspell-en-za ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes myspell-en-za (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von openoffice.org-hyphenation:&#xA; openoffice.org-hyphenation hängt ab von dictionaries-common (&amp;gt;= 0.10) | openoffice.org-updatedicts; aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;  Paket openoffice.org-updatedicts ist nicht installiert.&#xA;  Paket dictionaries-common, das openoffice.org-updatedicts bereitstellt, ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes openoffice.org-hyphenation (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von wngerman:&#xA; wngerman hängt ab von dictionaries-common (&amp;gt;= 1.0); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes wngerman (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von wogerman:&#xA; wogerman hängt ab von dictionaries-common (&amp;gt;= 1.0); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes wogerman (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von wswiss:&#xA; wswiss hängt ab von dictionaries-common (&amp;gt;= 1.0); aber:&#xA;  Paket dictionaries-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes wswiss (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von xemacs21-support:&#xA; xemacs21-support hängt ab von emacsen-common; aber:&#xA;  Paket emacsen-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes xemacs21-support (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von xemacs21-bin:&#xA; xemacs21-bin hängt ab von xemacs21-support (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-support ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes xemacs21-bin (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von xemacs21-mule:&#xA; xemacs21-mule hängt ab von xemacs21-support (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-support ist noch nicht konfiguriert.&#xA; xemacs21-mule hängt ab von xemacs21-bin (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-bin ist noch nicht konfiguriert.&#xA; xemacs21-mule hängt ab von emacsen-common; aber:&#xA;  Paket emacsen-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes xemacs21-mule (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von xemacs21-mule-canna-wnn:&#xA; xemacs21-mule-canna-wnn hängt ab von xemacs21-support (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-support ist noch nicht konfiguriert.&#xA; xemacs21-mule-canna-wnn hängt ab von xemacs21-bin (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-bin ist noch nicht konfiguriert.&#xA; xemacs21-mule-canna-wnn hängt ab von emacsen-common; aber:&#xA;  Paket emacsen-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes xemacs21-mule-canna-wnn (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von xemacs21-nomule:&#xA; xemacs21-nomule hängt ab von xemacs21-support (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-support ist noch nicht konfiguriert.&#xA; xemacs21-nomule hängt ab von xemacs21-bin (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-bin ist noch nicht konfiguriert.&#xA; xemacs21-nomule hängt ab von emacsen-common; aber:&#xA;  Paket emacsen-common ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes xemacs21-nomule (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von xemacs21:&#xA; xemacs21 hängt ab von xemacs21-mule (&amp;gt;= 21.4.22-14ubuntu1) | xemacs21-mule-canna-wnn (&amp;gt;= 21.4.22-14ubuntu1) | xemacs21-nomule (&amp;gt;= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-mule ist noch nicht konfiguriert.&#xA;  Paket xemacs21-mule-canna-wnn ist noch nicht konfiguriert.&#xA;  Paket xemacs21-nomule ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes xemacs21 (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;dpkg: Abhängigkeitsprobleme verhindern Konfiguration von xemacs21-supportel:&#xA; xemacs21-supportel hängt ab von xemacs21-support (= 21.4.22-14ubuntu1); aber:&#xA;  Paket xemacs21-support ist noch nicht konfiguriert.&#xA;&#xA;dpkg: Fehler beim Bearbeiten des Paketes xemacs21-supportel (--configure):&#xA; Abhängigkeitsprobleme - verbleibt unkonfiguriert&#xA;Fehler traten auf beim Bearbeiten von:&#xA; emacsen-common&#xA; dictionaries-common&#xA; aspell&#xA; aspell-en&#xA; hunspell-de-at&#xA; hunspell-de-ch&#xA; hunspell-de-de&#xA; hunspell-en-ca&#xA; hunspell-en-gb&#xA; hunspell-en-us&#xA; hunspell-en-za&#xA; hyphen-de&#xA; hyphen-en-us&#xA; iamerican&#xA; myspell-en-gb&#xA; myspell-en-za&#xA; openoffice.org-hyphenation&#xA; wngerman&#xA; wogerman&#xA; wswiss&#xA; xemacs21-support&#xA; xemacs21-bin&#xA; xemacs21-mule&#xA; xemacs21-mule-canna-wnn&#xA; xemacs21-nomule&#xA; xemacs21&#xA; xemacs21-supportel&#xA;E: Sub-process /usr/bin/dpkg returned an error code (1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, xemacs produces a fatal mistake. Nevertheless, 16.04.1 is installed, but not correctly. Can somebody help me? There is no update running due to this issue...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance!&lt;/p&gt;&#xA;" OwnerUserId="12925" LastEditorUserId="105" LastEditDate="2016-08-09T14:21:46.380" LastActivityDate="2016-08-09T14:21:46.380" Title="Upgrade to 16.04 incomplete because of Xemacs" Tags="|ubuntu|xemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26162" PostTypeId="1" CreationDate="2016-08-09T10:42:00.227" Score="1" ViewCount="108" Body="&lt;p&gt;In my case mu4e compose mode, everytime I got the error below:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error running timer `org-element--cache-sync': (wrong-type-argument hash-table-p nil)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This simptom is already subscribed as bug, but unresolved.&#xA;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00947.html&quot; rel=&quot;nofollow&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg00947.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that &lt;code&gt;(setq initial-major-mode 'org-mode)&lt;/code&gt; makes this happen.&#xA;Are there any good way to get rid of this timer error?&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-08-09T10:42:00.227" Title="org-element--cache-sync is needlessly called with setting initial-major-mode to org" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26163" PostTypeId="1" CreationDate="2016-08-09T10:50:09.890" Score="7" ViewCount="523" Body="&lt;p&gt;At times, especially when taking notes, a literate org file can contain one-line source blocks, as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Taking notes&#xA;:PROPERTIES:&#xA;:tangle: whatever.pl&#xA;:comments: org&#xA;:END:&#xA;&#xA;Perl set command&#xA;#+BEGIN_SRC perl&#xA;set $random_var=1;&#xA;#+END_SRC&#xA;&#xA;Perl unset command (just making it up... :P)&#xA;#+BEGIN_SRC perl&#xA;unset $random_var;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For such applications, the &lt;code&gt;#+BEGIN_SRC...#+END_SRC&lt;/code&gt; pragma looks to be an overkill. Easy templates reduce the typing, but the org doc still looks a bit overflowing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do this? I know that a line starting with a &lt;code&gt;:&lt;/code&gt; gets to verbatim text automatically. Is there a way to do something similar with org-tangle?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a solution something like this, or at least close to these lines, while still retaining the source highlighting and tangling facilities for parent mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Taking notes&#xA;:PROPERTIES:&#xA;:tangle: whatever.pl&#xA;:comments: org&#xA;:mode: perl&#xA;:END:&#xA;&#xA;Perl set command&#xA;: set $random_var=1;&#xA;&#xA;Perl unset command (just making it up... :P)&#xA;: unset $random_var;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's cleaner, easy to look at and, IMHO, a bit less noisy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions would be appreciated. Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="3849" LastActivityDate="2016-08-09T16:48:56.907" Title="One-liner org source tangle" Tags="|org-babel|literate-programming|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26164" PostTypeId="1" AcceptedAnswerId="29685" CreationDate="2016-08-09T11:45:36.533" Score="1" ViewCount="97" Body="&lt;p&gt;There is a way to link to a specific link of code in org babel src block. with &lt;code&gt;org-store-link&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt; ;;; This is comment | line. |&#xA; (describe-char | (point)) ; | comment |&#xA; (message | &quot;hello, world&quot;) |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt;: The vertical bar (&lt;code&gt;|&lt;/code&gt;) is the point positions.&#xA;I need a way to auto detect current position, whether it is in comment area.&#xA;If yes, then don't add comment char. If no, then auto add comment char like at&#xA;the third line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An advice for elisp or some way else.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2017-04-29T17:19:15.127" Title="How to auto prefix with comment char when inserting code ref label with org-store-link" Tags="|org-babel|comment|org-link|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26165" PostTypeId="2" ParentId="26161" CreationDate="2016-08-09T13:12:06.750" Score="3" Body="&lt;p&gt;I recommend you first &lt;code&gt;dpkg --remove xemacs21&lt;/code&gt; (and maybe also for related packages like &lt;code&gt;xemacs21-support&lt;/code&gt;, &lt;code&gt;xemacs21-mule&lt;/code&gt;, &lt;code&gt;xemacs21-nomule&lt;/code&gt;, &lt;code&gt;xemacs21-bin&lt;/code&gt;, ...), after which the update should work again.  Once that is done, you can try to re-install XEmacs (tho, of course, I'd recommend you switch to Emacs instead).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-09T13:12:06.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26166" PostTypeId="2" ParentId="26159" CreationDate="2016-08-09T14:40:34.327" Score="3" Body="&lt;p&gt;The original behaviour you describe sounds like &lt;code&gt;blink-matching-paren&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;blink-matching-paren is a variable defined in &lt;code&gt;simple.el&lt;/code&gt;.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Non-nil means show matching open-paren when close-paren is inserted.&#xA;  If t, highlight the paren.  If `jump', move cursor to its position.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The new behaviour you are seeing sounds like &lt;code&gt;show-paren-mode&lt;/code&gt;. From the help for that function:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Show Paren mode is a global minor mode.  When enabled, any&#xA;  matching parenthesis is highlighted in &lt;code&gt;show-paren-style&lt;/code&gt; after&#xA;  &lt;code&gt;show-paren-delay&lt;/code&gt; seconds of Emacs idle time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As @nitishch commented, you can turn off &lt;code&gt;show-paren-mode&lt;/code&gt; with &lt;code&gt;(show-paren-mode -1)&lt;/code&gt;. You can customize the behaviour of &lt;code&gt;blink-matching-paren&lt;/code&gt; via &lt;code&gt;M-x customize-variable blink-matching-paren&lt;/code&gt;. You can customize &lt;code&gt;show-paren-mode&lt;/code&gt; via &lt;code&gt;M-x customize-group paren-showing&lt;/code&gt; - this allows you to set the delay before showing parens, and the faces (fonts) used to highlight them.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-08-09T14:40:34.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26167" PostTypeId="2" ParentId="26163" CreationDate="2016-08-09T16:48:56.907" Score="4" Body="&lt;p&gt;From &lt;a href=&quot;http://orgmode.org/manual/Structure-of-code-blocks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(org) Structure of code blocks&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Live code blocks can also be specified inline using&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;src_&amp;lt;language&amp;gt;{&amp;lt;body&amp;gt;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;src_&amp;lt;language&amp;gt;[&amp;lt;header arguments&amp;gt;]{&amp;lt;body&amp;gt;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So you should be able to use &lt;code&gt;src_perl{set $random_var=1;}&lt;/code&gt; instead of the full block.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-08-09T16:48:56.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26168" PostTypeId="2" ParentId="26073" CreationDate="2016-08-09T16:56:43.023" Score="-1" Body="&lt;p&gt;aren't you looking for normal major mode hooks, such as this one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'python-mode-hook 'evil-mode)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...to enable evil mode only when editing python files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;note that you can also use &lt;code&gt;prog-mode-hook&lt;/code&gt; which is intended to be a catch-all hook for any programming language major mode.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastActivityDate="2016-08-09T16:56:43.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26169" PostTypeId="2" ParentId="26136" CreationDate="2016-08-09T17:49:45.373" Score="5" Body="&lt;p&gt;Most of the emacs packages I've seen related to this have thought of it as coming from the sublime Minimap, which seems identical. I've seen people refer to these, but I don't have much experience with them:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/MiniMap&quot;&gt;https://www.emacswiki.org/emacs/MiniMap&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/zk-phi/sublimity&quot;&gt;https://github.com/zk-phi/sublimity&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12258" LastActivityDate="2016-08-09T17:49:45.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26170" PostTypeId="2" ParentId="19449" CreationDate="2016-08-09T17:58:46.633" Score="2" Body="&lt;p&gt;Make a list of all the faces that are causing trouble (&lt;code&gt;M-x list-faces-display&lt;/code&gt; is helpful). Wipe out the foreground/background attributes of those faces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-loop for face in '(gnus-header-name gnus-header-from gnus-header-subject …) do&#xA;     (set-face-attribute face nil :foreground nil :background nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to wipe out the color from &lt;em&gt;all&lt;/em&gt; faces, not only the gnus ones:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cl-loop for face in (face-list) do&#xA;     (set-face-attribute face nil :foreground nil :background nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-08-09T17:58:46.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26171" PostTypeId="2" ParentId="5741" CreationDate="2016-08-09T19:08:51.747" Score="2" Body="&lt;p&gt;After you have opened the agenda, just exit it by pressing x in the agenda's buffer at any time. If you use q to quite the agenda it will keep all the buffers open.&lt;/p&gt;&#xA;" OwnerUserId="4052" LastActivityDate="2016-08-09T19:08:51.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26172" PostTypeId="1" AcceptedAnswerId="26173" CreationDate="2016-08-09T21:26:07.533" Score="3" ViewCount="1978" Body="&lt;p&gt;I am trying to configure my cc-styles to use a single basic offset for the braces of an inline defined lambda.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a function template which takes a functor as an argument&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;template&amp;lt;typename Func&amp;gt;&#xA;void some_function(Func f)&#xA;{&#xA;    // ...&#xA;}   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am calling this function with a lambda, defined inline at the call site:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function([](int foo)&#xA;              {&#xA;                  // ...&#xA;              });&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice how the opening and closing braces of the body of the lambda are aligned with the capture statement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our coding standards require that the braces are indented by one indent. As such, I am required to have the code look like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_function([](int foo)&#xA;    {&#xA;        // ...&#xA;    });&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do I need to specify in &lt;code&gt;c-offsets-alist&lt;/code&gt; to get the indent I'm looking for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the &lt;code&gt;c-add-style&lt;/code&gt; call I'm making, in case that's of some use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (c-add-style &quot;work&quot;&#xA;               '((indent-tabs-mode . nil)                   &#xA;                 (c-basic-offset . 4)                       &#xA;                 (c-offsets-alist&#xA;                  (substatement-open . 0)                  &#xA;                  (case-label . +)                         &#xA;                  (inline-open . 0)                        &#xA;                  (block-open . 0)                         &#xA;                  (statement-cont . +)                     &#xA;                  (inextern-lang . 0)                      &#xA;                  (innamespace . 0))))                     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10922" LastActivityDate="2018-05-22T07:36:51.323" Title="cc-styles c-offsets-alist setting for C++11 lambda brace indentation" Tags="|c++|cc-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26173" PostTypeId="2" ParentId="26172" CreationDate="2016-08-09T22:44:13.550" Score="4" Body="&lt;p&gt;You can add a function for that to &lt;code&gt;arglist-cont-nonempty&lt;/code&gt;. In the following example &lt;code&gt;my-c-lineup-arglist-lambda&lt;/code&gt; should do what you want:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(c-add-style &quot;work&quot;&#xA;             '((indent-tabs-mode . nil)                   &#xA;               (c-basic-offset . 4)                       &#xA;               (c-offsets-alist&#xA;                (substatement-open . 0)                  &#xA;                (case-label . +)                         &#xA;                (inline-open . 0)                        &#xA;                (block-open . 0)                         &#xA;                (statement-cont . +)                     &#xA;                (inextern-lang . 0)                      &#xA;                (innamespace . 0)&#xA;                (arglist-cont-nonempty (my-c-lineup-arglist-lambda c-lineup-arglist)))))   &#xA;&#xA;&#xA;(defun my-c-lineup-arglist-lambda (langelem)&#xA;  &quot;Line up lambda.&quot;&#xA;  (save-excursion&#xA;    (back-to-indentation)&#xA;    (when (looking-at &quot;{&quot;)&#xA;      '+)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this approach does not touch indentation of other function arguments.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-23T04:52:12.883" LastActivityDate="2016-08-23T04:52:12.883" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26174" PostTypeId="2" ParentId="26104" CreationDate="2016-08-09T22:48:21.080" Score="0" Body="&lt;p&gt;Did you add &lt;code&gt;s&lt;/code&gt; to &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt; in your init file? If so, require should find it as emacs is not doing relative loading (like e.g. npm).&lt;/p&gt;&#xA;" OwnerUserId="12827" LastActivityDate="2016-08-09T22:48:21.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26175" PostTypeId="2" ParentId="737" CreationDate="2016-08-10T01:28:15.743" Score="17" Body="&lt;p&gt;&lt;code&gt;swiper-all&lt;/code&gt; from the &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;noreferrer&quot;&gt;swiper package&lt;/a&gt; provides a tool for doing this. It's even incremental, so it updates as you type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cZgEk.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cZgEk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-08-10T01:28:15.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26176" PostTypeId="2" ParentId="737" CreationDate="2016-08-10T03:39:40.500" Score="2" Body="&lt;p&gt;Here is another way with helm: &lt;code&gt;M-x helm-mini M-a C-s blah&lt;/code&gt;. After invoking &lt;code&gt;helm-mini&lt;/code&gt;, &lt;code&gt;M-a&lt;/code&gt; will mark all opening buffers then &lt;code&gt;C-s blah&lt;/code&gt; will do multi occur on marked buffers.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-08-10T03:39:40.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26177" PostTypeId="1" CreationDate="2016-08-10T06:15:31.080" Score="1" ViewCount="748" Body="&lt;p&gt;I have installed Emacs (emacs-plus) via Homebrew on my Mac.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that if I in the Finder chooses &quot;open with&quot; -&gt; Emacs, Emacs open all right, but its not always the right file that is opened! Sometimes it's the right file, sometimes it's a file i have edited sometimes in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could be wrong? Any hint to debugging this problem? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extra info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The wrong file that's opened is typically the last i have edited/closed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The correct file is not opened in any buffers (before or after).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Second time i choose &quot;open with&quot;, the correct file is opened.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After restart of Emacs, the problem disappears for some time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12932" LastEditorUserId="12932" LastEditDate="2016-08-10T07:18:45.037" LastActivityDate="2016-08-10T07:18:45.037" Title="Spacemacs / Mac" Tags="|spacemacs|osx|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26178" PostTypeId="1" AcceptedAnswerId="26200" CreationDate="2016-08-10T07:48:20.020" Score="5" ViewCount="2310" Body="&lt;p&gt;I'm trying to install Emacs 25.1.rc1 on Ubuntu 15.10, and have pre-installed the usual dependencies i.e.:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;autoconf&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;automake&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libtool&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;texinfo&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;build-essential&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;xorg-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libgtk2.0-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libjpeg-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libncurses5-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libdbus-1-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libgif-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libtiff-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libm17n-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libpng12-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;librsvg2-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libotf-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;libxml2-dev&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, when I inspect the output of &lt;code&gt;./configure&lt;/code&gt; libxml2/xml2 is off and when I &lt;code&gt;make &amp;amp;&amp;amp; make install&lt;/code&gt; emacs and run it, &lt;code&gt;M-x eww&lt;/code&gt; says Emacs wasn't compiled with &lt;code&gt;libxml2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need help! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had previously installed using Linuxbrew, which had installed &lt;code&gt;pkg-config&lt;/code&gt; as a dependency. (ed. Yes, I know, well it seemed like a good idea at the time!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Removed it and recompiled Emacs.  Configure finds and reports libxml2 as expected.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastEditorUserId="2485" LastEditDate="2016-08-11T00:28:20.177" LastActivityDate="2017-03-27T11:36:52.433" Title="Compiling Emacs from source on Ubuntu - problems with libxml2" Tags="|compilation|eww|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26179" PostTypeId="1" AcceptedAnswerId="28903" CreationDate="2016-08-10T08:23:08.987" Score="12" ViewCount="5450" Body="&lt;p&gt;I am trying to customize the style of my org-mode tables when exported to Latex. I need to change their font face, their font size, the background color of the header and the background color of every other rows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see lots of discussions on how to do these things in pure LaTeX, using (or not) additional packages like pgfplotstable. But I would like to keep my document as 'org-mode' style as possible (for readability and because I also export in HTML). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are ways to specify basic options via attribute, but it won't take me far enough: &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html#LaTeX-specific-attributes&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/LaTeX-specific-attributes.html#LaTeX-specific-attributes&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to specify in an org-mode document that tables should use a particular format/structure (maybe in an external .sty) when exporting to LaTeX without messing the basic org-mode style table for other exports?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="12936" LastActivityDate="2017-02-27T11:56:04.347" Title="Change org-mode table style just for LaTeX export" Tags="|org-mode|latex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26180" PostTypeId="1" CreationDate="2016-08-10T08:55:22.590" Score="3" ViewCount="4008" Body="&lt;p&gt;I know that outline mode works like this in Emacs org mode   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;* Heading 1  &#xA;** Heading 2    &#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure Emacs to take a different identifier than the &lt;code&gt;*&lt;/code&gt;to identify headings?&lt;br&gt;&#xA;I have a few files where I want to use a particular character (or character combination) where I have certain character combinations like &lt;code&gt;C %% MODULE&lt;/code&gt; which mark the beginning of every module within the program. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So If I have a mechanism to use the &lt;code&gt;C %% MODULE&lt;/code&gt; instead of &lt;code&gt;*&lt;/code&gt; I do not have to add additional headings to enable the folding mechanism within my program.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which file would I have to modify to have this functionality changed?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to provide more clarity, my code looks as shown below&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/TJcG4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TJcG4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;I have developed this in org mode.  When I paste this into my system, I will have to manually delete the preceeding &lt;code&gt;*&lt;/code&gt; and paste it.&lt;br&gt;&#xA;But I was looking for a cleaner solution and if possible I could customize org-mode further to meet my requirements.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="10936" LastEditDate="2016-08-10T13:16:41.950" LastActivityDate="2018-12-16T11:52:35.297" Title="Change the asterisk (heading identifier) to some other symbol in Org mode" Tags="|org-mode|" AnswerCount="3" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="26181" PostTypeId="2" ParentId="7922" CreationDate="2016-08-10T10:17:26.710" Score="0" Body="&lt;pre&gt;&lt;code&gt;(setq helm-candidate-number-limit n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;replace n with your desired number&lt;/p&gt;&#xA;" OwnerUserId="12931" LastActivityDate="2016-08-10T10:17:26.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26182" PostTypeId="2" ParentId="26180" CreationDate="2016-08-10T10:55:51.997" Score="1" Body="&lt;p&gt;You can use org-bullets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/sabof/org-bullets&quot; rel=&quot;nofollow&quot;&gt;https://github.com/sabof/org-bullets&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (require 'org-bullets)&#xA; (setq org-bullets-bullet-list '(&quot;☯&quot; &quot;○&quot; &quot;✸&quot; &quot;✿&quot; &quot;~&quot;))&#xA; (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-08-10T10:55:51.997" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26183" PostTypeId="1" CreationDate="2016-08-10T14:05:13.170" Score="7" ViewCount="1068" Body="&lt;p&gt;I usually find myself when using helm-projectile-grep to narrow my search down to a specific file type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: I do a search for &quot;container&quot; but only want to show the results in the .style files. I haven't been able to find if you can do this with helm-projectile-grep but it does seem like it should be possible.&lt;/p&gt;&#xA;" OwnerUserId="11966" LastActivityDate="2022-09-29T09:07:27.370" Title="Narrow helm-projectile-grep to specific file type" Tags="|helm-projectile|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26184" PostTypeId="1" CreationDate="2016-08-10T18:43:37.667" Score="1" ViewCount="83" Body="&lt;p&gt;Setup: Xubuntu 16.04, GNU Emacs 25.1.50.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following function defined.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sudo-edit (&amp;amp;optional arg)&#xA;  &quot;Edit currently visited file as root.&#xA;&#xA;With a prefix ARG prompt for a file to visit.&#xA;Will also prompt for a file to visit if current&#xA;buffer is not visiting a file.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if (or arg (not buffer-file-name))&#xA;      (find-file (concat &quot;/sudo:root@localhost:&quot;&#xA;                         (ido-read-file-name &quot;Find file(as root): &quot;)))&#xA;    (find-alternate-file (concat &quot;/sudo:root@localhost:&quot; buffer-file-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I want to edit &lt;code&gt;/etc/default/grub&lt;/code&gt;, and in the GUI Emacs frame I call &lt;code&gt;sudo-edit&lt;/code&gt;, after typing my password, it works fine. But when I do the same with the emacsclient in terminal, it exits directly to the terminal after calling the same &lt;code&gt;sudo-edit&lt;/code&gt;. And it's not responding anymore, and I cannot create another frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fail to understand why Emacs is not handling this properly in terminal, and the GUI frame does it well. I couldn't find anything in the function which is related to the GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anybody that can find where this functions went wrong with the terminal Emacs?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-08-10T18:43:37.667" Title="Why is this function working properly in GUI-Emacs, but not in terminal Emacs?" Tags="|terminal-emacs|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26185" PostTypeId="1" CreationDate="2016-08-10T20:03:24.077" Score="2" ViewCount="751" Body="&lt;p&gt;Say I am using org-babel to tangle code blocks from an org document. I have several blocks with random code in them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to dynamically tangle (or not) individual blocks following a condition, for example, contents of first line of block, text in above heading, tag in heading, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, I want to pass the same defun as an argument to :tangle in the header arguments of all code blocks, avoiding the use of heading or buffer properties. Similarly, I try to avoid setting the same identical form in all my code blocks. Instead, I try to define a default header argument to be set programatically, or similar in the example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*  First                  :maybe:&#xA;&#xA;#+begin_src emacs-lisp&#xA;  ;; First : not to be tangled&#xA;&#xA;#+end_src&#xA;&#xA;* Second                  :no:&#xA;&#xA;#+begin_src emacs-lisp&#xA;  ;; Second : not to be tangled&#xA;&#xA;  ;; This code doesn't do it but it should !!&#xA;  (setq-local org-babel-default-header-args&#xA;          (cons `(:tangle . ,(test))&#xA;              (assq-delete-all :tangle org-babel-default-header-args)))&#xA;#+end_src&#xA;&#xA;* Third                   :yes:&#xA;&#xA;#+begin_src emacs-lisp&#xA;  ;; Third : this code is to be tangled&#xA;&#xA;  (defun test ()&#xA;    (if (let ((mytags (org-get-tags-at (point) t)))&#xA;          (or (member &quot;yes&quot; mytags)&#xA;              (null mytags)))&#xA;        (format &quot;%s.el&quot; (file-name-base&#xA;                         (buffer-file-name))) &quot;no&quot;))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my question is, is it possible to assign a function to the :tangle (or :prologue) header arguments in org-babel code blocks without using properties or explicitly put the form in all code blocks ?&lt;/p&gt;&#xA;" OwnerUserId="546" LastEditorUserId="546" LastEditDate="2016-08-10T20:47:55.760" LastActivityDate="2016-08-10T20:47:55.760" Title="Using a function as an org-babel header argument" Tags="|org-mode|babel|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26186" PostTypeId="1" CreationDate="2016-08-10T20:41:01.480" Score="3" ViewCount="1161" Body="&lt;p&gt;&lt;strong&gt;Update: 11/Aug&lt;/strong&gt;: I forgot to mention that I'm using literate programming to build the &lt;code&gt;init.el&lt;/code&gt; from an &lt;code&gt;org&lt;/code&gt; file. It seems that the problem appears when emacs opens the &lt;code&gt;configure.org&lt;/code&gt; to generate the &lt;code&gt;.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that if I write the configuration to a &lt;code&gt;.emacs&lt;/code&gt; (as I wrote below) the right version is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The right question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to load the latest version of &lt;code&gt;org-mode&lt;/code&gt; using &lt;code&gt;org&lt;/code&gt; literate programming to generate the &lt;code&gt;config.el&lt;/code&gt; file?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'd like to use the latest version of &lt;code&gt;org-mode&lt;/code&gt; from the git repository.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;My setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Emacs version:&lt;/em&gt; GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2015-03-07 on trouble, modified by Debian&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;About org-mode&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I clone the repository, say in &lt;code&gt;~/.emacs.d/org-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Compile the autoload using &lt;code&gt;make autoload&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Initial part of my &lt;code&gt;.emacs&lt;/code&gt; is &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;&#xA;(add-to-list 'load-path &quot;~/.emacs.d/org-mode/lisp/&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/org-mode/contrib/lisp/&quot; t)&#xA;&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-install 'use-package))&#xA;&#xA;(setq use-package-verbose t)&#xA;(setq use-package-always-ensure t)&#xA;&#xA;(require 'use-package)&#xA;&#xA;(use-package auto-compile&#xA;  :config (auto-compile-on-load-mode))&#xA;&#xA;(setq load-prefer-newer t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Result&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I call &lt;code&gt;M-x org-version&lt;/code&gt; and get&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Org-mode version 8.2.10 (release_8.2.10 @ /home/.../.emacs.d/org-mode/lisp/)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is no the latest release! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I call &lt;code&gt;M-x org-reload&lt;/code&gt; it load the newest &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Org-mode version 8.3.5 (release_8.3.5 @ /home/.../.emacs.d/org-mode/lisp/)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But it is not loaded automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.D.: I accept suggestions about simplifying the configuration.&lt;/p&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="2441" LastEditDate="2016-08-11T14:48:13.480" LastActivityDate="2017-05-21T01:56:40.130" Title="Correct way to configure the lastest `org-mode` (literate programming)" Tags="|org-mode|init-file|debugging|literate-programming|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26187" PostTypeId="2" ParentId="26180" CreationDate="2016-08-10T23:23:15.223" Score="2" Body="&lt;p&gt;This doesn't seem to be possible in org-mode, but if you need just the folding feature, you may use &lt;code&gt;outline-mode&lt;/code&gt; instead of &lt;code&gt;org-mode&lt;/code&gt;, where you can change the value of &lt;code&gt;outline-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq outline-regexp &quot;C %% &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Folding/unfolding are much less intuitive in &lt;code&gt;outline-mode&lt;/code&gt; but you can add org-mode visibility cycling to outline mode with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'outline-mode-hook&#xA;  (lambda () &#xA;     (define-key outline-mode-map [(tab)] 'org-cycle)&#xA;     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-08-10T23:23:15.223" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26188" PostTypeId="1" CreationDate="2016-08-11T00:42:28.613" Score="5" ViewCount="107" Body="&lt;p&gt;Is it possible to override glyphs at some range of code points, that the default-font already covers, with ones from a non-default font? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, I'd like to use &lt;em&gt;Arial&lt;/em&gt; only except for the uppercase letters, which I want to use &lt;em&gt;Cooper Black&lt;/em&gt; for. How can I achieve this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can override some rage of code points whose glyphs are &lt;strong&gt;missing&lt;/strong&gt; in the default font, but I'm failing to do the same for the code points whose glyphs exist in the default font. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I tested.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil :family &quot;Arial&quot;)&#xA;(let (&#xA;(my-upper-case-font &quot;Cooper Black&quot;)&#xA;(font-sets '(&#xA;               &quot;fontset-default&quot;&#xA;               &quot;fontset-standard&quot;&#xA;               &quot;fontset-startup&quot;)))&#xA;(mapcar&#xA;(lambda (font-set)&#xA;&#xA;(set-fontset-font font-set '(#x00. #x17F) my-upper-case-font)&#xA;;I set the range wider for the sake of testing. &#xA;;This doesn't work and when I inserted &quot;t&quot; after &quot;font-set&quot;, &#xA;;a message showed up saying &quot;Wrong type argument: frame-live-p, &quot;Cooper Black&quot;&quot;&#xA;)&#xA;font-sets))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="10707" LastEditDate="2016-08-12T19:11:15.230" LastActivityDate="2021-05-02T20:04:25.417" Title="Override particular range of code points with a non-default font" Tags="|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26189" PostTypeId="1" CreationDate="2016-08-11T01:21:59.573" Score="3" ViewCount="778" Body="&lt;p&gt;I want to write some AppleScript to raise individual Emacs frames, with a given name. Also to send keyboard events to those frames, and to resize and position them. I think that Emacs is &quot;unscriptable,&quot; but I am not sure if there is a way to do this nonetheless. Can anyone help?&lt;/p&gt;&#xA;" OwnerUserId="12845" LastActivityDate="2018-08-07T02:24:42.507" Title="controlling Emacs from AppleScript" Tags="|osx|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26190" PostTypeId="1" AcceptedAnswerId="26199" CreationDate="2016-08-11T01:25:00.890" Score="1" ViewCount="1108" Body="&lt;p&gt;I am trying to write in org mode and then export to an odt file. But some tables are better edited in libreoffice, can I include an external odt file that contains the table in org mode? Is there any org keyword for libreoffice's master document?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-08-11T14:03:46.663" LastActivityDate="2016-08-11T14:03:46.663" Title="how to include odt in org mode" Tags="|org-mode|libreoffice|odt|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26191" PostTypeId="1" CreationDate="2016-08-11T01:26:42.387" Score="2" ViewCount="199" Body="&lt;p&gt;When editing org-src blocks, I sometimes go to other buffers while editing but whenever I close; it restores the window configuration before editing the block which is a minor annoyance when you need to find an existing buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked out org-src.el and this is my hack.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        (defun fn/org-src-inhibit-save-window-configuration ()&#xA;                 &quot;Disable org-src from saving the window configuration&quot;&#xA;                 ;; HACK: This uses an internal variable, might be unstable&#xA;                 (setq org-src--saved-temp-window-config nil))&#xA;&#xA;               (add-hook 'org-src-mode-hook #'fn/org-src-inhibit-save-window-configuration)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sadly, this is touches on a private variable so my question is there a correct way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="10167" LastActivityDate="2016-08-11T07:29:35.827" Title="org-mode: Prevent org-src from restoring window configuration after editing" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26192" PostTypeId="2" ParentId="18056" CreationDate="2016-08-11T01:28:28.920" Score="2" Body="&lt;p&gt;For evil users, I've written a package which does &lt;code&gt;query-replace&lt;/code&gt; and &lt;code&gt;replace-regexp&lt;/code&gt; within evil visual blocks: &lt;a href=&quot;https://github.com/troyp/evil-visual-replace&quot; rel=&quot;nofollow&quot;&gt;evil-visual-replace&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this only works with &lt;code&gt;evil-mode&lt;/code&gt; (although you could always use evil just for the visual blocks or other cherry-picked functionality). For those who need replace within native rectangles, the &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01238.html&quot; rel=&quot;nofollow&quot;&gt;patch&lt;/a&gt; Drew linked to in the comments above should work.&lt;/p&gt;&#xA;" OwnerUserId="8578" LastActivityDate="2016-08-11T01:28:28.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26193" PostTypeId="2" ParentId="26189" CreationDate="2016-08-11T01:41:49.867" Score="7" Body="&lt;p&gt;Feature request 18283 was added to Emacs 25 and the master branch in conjunction with feature request 21415, but its primary purpose was to enable debugging of Emacs relating to frames on OSX.  &lt;code&gt;.../Emacs.app/Contents/Info.plist&lt;/code&gt; (when Emacs was built &lt;code&gt;--with-ns&lt;/code&gt;) now contains near the bottom the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;key&amp;gt;NSAppleScriptEnabled&amp;lt;/key&amp;gt;&#xA;&amp;lt;string&amp;gt;YES&amp;lt;/string&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Control of Emacs with Applescripts is not officially supported, but the above-lines added to the location indicated above permits some limited abilities.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is an example of the get bounds function that I used while assisting to debug certain frame location/placement issues:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun get-bounds ()&#xA;&quot;Get bounds.&quot;&#xA;(interactive)&#xA;  (let ((script (concat&#xA;      &quot;tell front window of application \&quot;Emacs\&quot;\n&quot;&#xA;        &quot;get bounds\n&quot;&#xA;      &quot;end tell&quot;)))&#xA;    (start-process &quot;get-bounds&quot; nil &quot;osascript&quot; &quot;-e&quot; script)&#xA;    (set-process-filter (get-process &quot;get-bounds&quot;) &#xA;      (lambda (proc string)&#xA;        (let ((bounds (format &quot;Bounds of Frame:  %s&quot; (car (split-string string &quot;\n&quot;)))))&#xA;          (message (propertize bounds 'face 'font-lock-warning-face))&#xA;          bounds)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;FWI:  Feature request 21415 brought about several important bug fixes in Emacs 25 and the master branch regarding frame placement and sizing, including the ability to control the precise pixel size of a frame at the time of creation (without the need to resize it after the fact).  Most (if not all) frame manipulation needs can be met within Emacs without using an Applescript.  The following is an example of frame-parameter specification to control exact pixel size upon frame creation -- this includes items such as the &lt;code&gt;initial-frame-alist&lt;/code&gt;, &lt;code&gt;default-frame-alist&lt;/code&gt;, and the &lt;code&gt;make-frame&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Example of usage for the frame &lt;code&gt;width&lt;/code&gt; parameter:  &lt;code&gt;'(width . (text-pixels . 1900))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Example of usage for the frame &lt;code&gt;height&lt;/code&gt; parameter:  &lt;code&gt;'(height . (text-pixels . 1054))&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See also some of the built-in functions such as &lt;code&gt;set-frame-position&lt;/code&gt;, &lt;code&gt;set-frame-size&lt;/code&gt; (with an optional pixelwise argument), and &lt;code&gt;set-frame-height&lt;/code&gt; (with an optional pixelwise argument):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Size-and-Position.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Size-and-Position.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-08-11T02:13:07.007" LastActivityDate="2016-08-11T02:13:07.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26194" PostTypeId="1" AcceptedAnswerId="26195" CreationDate="2016-08-11T03:27:12.923" Score="0" ViewCount="63" Body="&lt;p&gt;I have some code that takes as an argument a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun message-name (fn)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to, if the function has a name, message it. For example, if called this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message-name #'get-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like this code to message &lt;code&gt;The function's name is get-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun message-name (fn)&#xA;  (message &quot;The function's name is %s.&quot;&#xA;           (????? fn)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="105" LastEditDate="2016-08-11T14:03:31.397" LastActivityDate="2016-08-11T14:03:31.397" Title="If a function is passed as an argument to another function, is the first function's name accessible?" Tags="|functions|symbols|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26195" PostTypeId="2" ParentId="26194" CreationDate="2016-08-11T03:34:26.140" Score="2" Body="&lt;p&gt;If you are passing a &lt;em&gt;symbol&lt;/em&gt; (as in your example) then yes, you can get the &lt;code&gt;symbol-name&lt;/code&gt; of the argument. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbol-name fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A &quot;function passed as an argument&quot; might also be a function object, though, and you can't pull a symbol name from that. You would have to search for a symbol which had the same value in its function cell.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-08-11T03:34:26.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26197" PostTypeId="2" ParentId="18056" CreationDate="2016-08-11T07:14:50.147" Score="2" Body="&lt;p&gt;This looks like a duplicate of &lt;a href=&quot;https://stackoverflow.com/questions/11130546/search-and-replace-inside-a-rectangle-in-emacs&quot;&gt;Search and replace inside a rectangle in emacs&lt;/a&gt; on Stack Overflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer shows how to do this either using CUA's rectangle editing, or via a custom command.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-08-11T07:14:50.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26198" PostTypeId="2" ParentId="26191" CreationDate="2016-08-11T07:18:19.410" Score="2" Body="&lt;p&gt;If the first argument (labeled &lt;code&gt;CONTEXT&lt;/code&gt;) to &lt;code&gt;org-edit-src-code&lt;/code&gt; is &lt;code&gt;'save&lt;/code&gt;, then the window configuration is &lt;em&gt;not&lt;/em&gt; saved.  Try evaluating &lt;code&gt;(org-edit-src-code 'save)&lt;/code&gt;.  Also, take a look at that function with &lt;code&gt;M-x find-function RET org-edit-src-code RET&lt;/code&gt;. See where the first couple of lines of code say &lt;code&gt;(unless (eq context 'save) (setq org-edit-src-saved-temp-window-config (current-window-configuration)))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the optional argument to &lt;code&gt;org-edit-src-exit&lt;/code&gt; -- i.e., similar as above -- if it is &lt;code&gt;'save&lt;/code&gt;, then no restoration of window configuration occurs even though the variable &lt;code&gt;org-src--saved-temp-window-config&lt;/code&gt; may contain a saved window configuration. To see the function, type &lt;code&gt;M-x find-function RET org-edit-src-exit RET&lt;/code&gt; -- the relevant portion is at the tail end of said function.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-08-11T07:29:35.827" LastActivityDate="2016-08-11T07:29:35.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26199" PostTypeId="2" ParentId="26190" CreationDate="2016-08-11T08:41:18.280" Score="1" Body="&lt;p&gt;Here is how I would do that.  Create through libreoffice (or whatever you want, I tried with abiword) a &lt;code&gt;table.odt&lt;/code&gt; file containing the table.  Then copy the xml table code (the &lt;code&gt;&amp;lt;table:table&amp;gt;&lt;/code&gt; element) from the &lt;code&gt;content.xml&lt;/code&gt; file inside &lt;code&gt;table.odt&lt;/code&gt; (which actually is a zip file) into file &lt;code&gt;table.org&lt;/code&gt;, inside &lt;code&gt;#+BEGIN/END_ODT&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this and created the following &lt;code&gt;table.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_ODT&#xA;   &amp;lt;table:table table:name=&quot;Table1&quot;&amp;gt;&#xA;    &amp;lt;table:table-column/&amp;gt;&#xA;    &amp;lt;table:table-column/&amp;gt;&#xA;    &amp;lt;table:table-row&amp;gt;&#xA;     &amp;lt;table:table-cell table:style-name=&quot;Table1_col1_row1&quot;&amp;gt;&#xA;      &amp;lt;text:p text:style-name=&quot;P1&quot; &amp;gt;1&amp;lt;/text:p&amp;gt;&#xA;     &amp;lt;/table:table-cell&amp;gt;&#xA;     &amp;lt;table:table-cell table:style-name=&quot;Table1_col2_row1&quot;&amp;gt;&#xA;      &amp;lt;text:p text:style-name=&quot;P2&quot; &amp;gt;2&amp;lt;/text:p&amp;gt;&#xA;     &amp;lt;/table:table-cell&amp;gt;&#xA;    &amp;lt;/table:table-row&amp;gt;&#xA;    &amp;lt;table:table-row&amp;gt;&#xA;     &amp;lt;table:table-cell table:style-name=&quot;Table1_col1_row2&quot;&amp;gt;&#xA;      &amp;lt;text:p text:style-name=&quot;Normal&quot; &amp;gt;3&amp;lt;/text:p&amp;gt;&#xA;     &amp;lt;/table:table-cell&amp;gt;&#xA;     &amp;lt;table:table-cell table:style-name=&quot;Table1_col2_row2&quot;&amp;gt;&#xA;      &amp;lt;text:p text:style-name=&quot;P1&quot; &amp;gt;4&amp;lt;/text:p&amp;gt;&#xA;     &amp;lt;/table:table-cell&amp;gt;&#xA;    &amp;lt;/table:table-row&amp;gt;&#xA;   &amp;lt;/table:table&amp;gt;&#xA;#+END_ODT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, #+include &lt;code&gt;table.org&lt;/code&gt; in your main org file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: &quot;~/table.org&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exporting the main org file to odt does include the table as expected (in this simple example at least).  Of course you need to recreate the &lt;code&gt;table.org&lt;/code&gt; file each time you edit the table.  But I'm confident you could automate this with some shell (or whatever, certainly including emacs!) scripting:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;extract content.xml from odt,&lt;/li&gt;&#xA;&lt;li&gt;get  element from content.xml (eg with &lt;code&gt;sed&lt;/code&gt;),&lt;/li&gt;&#xA;&lt;li&gt;dump this to &lt;code&gt;table.org&lt;/code&gt;, enclosed in &lt;code&gt;#+BEGIN/END_ODT&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-08-11T08:41:18.280" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26200" PostTypeId="2" ParentId="26178" CreationDate="2016-08-11T10:47:04.473" Score="4" Body="&lt;p&gt;This problem was caused by &lt;code&gt;pkg-config&lt;/code&gt; being installed in two places.  Once by apt, the other time by Linuxbrew.  The path was finding the Linuxbrew &lt;code&gt;pkg-config&lt;/code&gt; copy first, which was configured to look in non-standard locations for libraries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this is problem is specific to the site,  it's important to note that &lt;code&gt;pkg-config&lt;/code&gt; will report that a package isn't installed when it is (if it's not configured to look in the &lt;em&gt;right&lt;/em&gt; place.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; always check the location of utilities (using &lt;code&gt;which&lt;/code&gt;) to make sure the system is configured as you expect/assume.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2016-08-11T10:47:04.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26201" PostTypeId="2" ParentId="22393" CreationDate="2016-08-11T12:49:12.113" Score="0" Body="&lt;p&gt;Packages that help you to customize window location settings include &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow&quot;&gt;Shackle&lt;/a&gt; (my recommendation) and &lt;a href=&quot;https://github.com/m2ym/popwin-el&quot; rel=&quot;nofollow&quot;&gt;Popwin&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2016-08-11T12:49:12.113" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26202" PostTypeId="1" AcceptedAnswerId="26224" CreationDate="2016-08-11T13:40:59.147" Score="0" ViewCount="224" Body="&lt;p&gt;When I try to open a PGP encrypted PDF &lt;code&gt;file.pdf.gpg&lt;/code&gt;, then – after entering the PIN in my smartcard reader – a window pops up with an error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: /syntaxerror in (binary token, type=150)&#xA;Operand stack:&#xA;   -117240830   -2063108939&#xA;Execution stack:&#xA;   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-&#xA;-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa&#xA;lse   1   %stopped_push   1967   1   3   %oparray_pop   1966   1   3   %oparray_&#xA;pop   1950   1   3   %oparray_pop   1836   1   3   %oparray_pop   --nostringval-&#xA;-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv&#xA;al--   2   %stopped_push&#xA;Dictionary stack:&#xA;   --dict:1200/1684(ro)(G)--   --dict:0/20(G)--   --dict:78/200(L)--&#xA;Current allocation mode is local&#xA;GPL Ghostscript 9.19: Unrecoverable error, exit code 1&#xA;&#xA;Close this window with the close button on the title bar or the system menu.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect the PDF to be shown in DocView mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About my system:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Windows 7 x64&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Viewing PDFs in DocView mode works fine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Viewing PGP encrypted text files with EasyPG Assistant (epa) works fine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5327" LastEditorUserId="5327" LastEditDate="2016-08-11T13:57:03.730" LastActivityDate="2016-08-12T11:23:27.973" Title="Why does viewing PGP encrypted PDF fail?" Tags="|microsoft-windows|pdf|docview|gpg|epa|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26203" PostTypeId="1" AcceptedAnswerId="26210" CreationDate="2016-08-11T15:05:13.157" Score="24" ViewCount="9854" Body="&lt;p&gt;Is there a function to convert between numbered and unordered lists in org-mode? The lists may or may not be nested.&lt;/p&gt;&#xA;" OwnerUserId="9881" LastActivityDate="2023-07-21T21:15:00.400" Title="Convert between numbered and unordered lists in org-mode" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26204" PostTypeId="2" ParentId="24163" CreationDate="2016-08-11T15:21:48.100" Score="1" Body="&lt;p&gt;Starting with &lt;code&gt;v2.8.0&lt;/code&gt; Magit supports globbing in paths passed to diff and log commands. (If you use Melpa, then the respective commit is already included now.)&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-08-11T15:21:48.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26205" PostTypeId="1" AcceptedAnswerId="26211" CreationDate="2016-08-11T15:22:11.897" Score="4" ViewCount="1387" Body="&lt;p&gt;I am writing a minor mode which involves fetching some pictures from url and displaying them, but some of them are way too big to fit an emacs window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How could I manage to limit the visual size of the displayed picture ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now I am using something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(insert-image (create-image pic nil t))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for display, where pic is a jpeg image raw data as a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I spent a lot of time browsing google and couldn't find a tutorial, docs or a code example that would help me rescaling my images.&lt;br&gt;&#xA;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Images.html#Images&quot; rel=&quot;nofollow&quot;&gt;GNU Emacs Lisp reference&lt;/a&gt; is quite obscure and confusing and doesn't contain much examples.&lt;/p&gt;&#xA;" OwnerUserId="11911" LastEditorUserId="105" LastEditDate="2016-08-11T16:24:07.977" LastActivityDate="2016-08-25T09:14:46.053" Title="Elisp: Resize displayed images programmatically" Tags="|images|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26206" PostTypeId="2" ParentId="26205" CreationDate="2016-08-11T15:43:43.177" Score="0" Body="&lt;p&gt;I suggest that you use &lt;a href=&quot;http://www.imagemagick.org/script/convert.php&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;convert&lt;/code&gt;&lt;/a&gt; from &lt;a href=&quot;http://www.imagemagick.org&quot; rel=&quot;nofollow&quot;&gt;ImageMagick&lt;/a&gt; to &lt;a href=&quot;http://www.imagemagick.org/Usage/resize/&quot; rel=&quot;nofollow&quot;&gt;Resize or Scale images&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can pass &lt;code&gt;:scale&lt;/code&gt; to &lt;code&gt;create-image&lt;/code&gt; or use &lt;code&gt;(setf (image-property my-image :scale) ...)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-08-11T16:55:34.080" LastActivityDate="2016-08-11T16:55:34.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26207" PostTypeId="2" ParentId="26203" CreationDate="2016-08-11T16:10:58.793" Score="26" Body="&lt;p&gt;In my org-mode environment, for example, the first state is as followings: unordered list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- a&#xA;- b&#xA;- c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Modify the first line as &quot;1. a&quot; as numbered list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. a&#xA;- b&#xA;- c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, hit &lt;code&gt;C-c C-c&lt;/code&gt; at the first line &quot;1. a&quot;.&#xA;Unordered list becomes numbered list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. a&#xA;2. b&#xA;3. c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Modify the first line as &quot;- a&quot; as unordered list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- a&#xA;2. b&#xA;3. c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now Hit &lt;code&gt;C-c C-c&lt;/code&gt; at the first line &quot;- a&quot;.&#xA;Numbered list becomes unordered list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- a&#xA;- b&#xA;- c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope it works.&lt;/p&gt;&#xA;" OwnerUserId="8634" LastEditorUserId="262" LastEditDate="2016-08-11T19:51:55.613" LastActivityDate="2016-08-11T19:51:55.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26208" PostTypeId="2" ParentId="24264" CreationDate="2016-08-11T16:16:04.633" Score="3" Body="&lt;p&gt;&lt;code&gt;tramp.el&lt;/code&gt; must be loaded indeed when a Tramp user option shall be set. The proper way to do this is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; '(tramp-remote-path (quote (tramp-own-remote-path)) nil (tramp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe this shall be described in the Tramp manual.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-08-11T16:16:04.633" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26209" PostTypeId="2" ParentId="22733" CreationDate="2016-08-11T16:29:03.017" Score="2" Body="&lt;p&gt;This problem was also reported as Emacs bug 23883, see &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23883&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23883&lt;/a&gt; . It has been resolved recently, will appear with next Tramp 2.3.1 and/or Emacs 25.2.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-08-11T16:29:03.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26210" PostTypeId="2" ParentId="26203" CreationDate="2016-08-11T16:31:22.900" Score="33" Body="&lt;p&gt;You can use the function &lt;code&gt;org-ctrl-c-minus&lt;/code&gt;, bound by default to&#xA;(you guessed it) &lt;kbd&gt;Control&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt;-&lt;kbd&gt;-&lt;/kbd&gt;, to cycle through the bullet types.  The doctstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Insert separator line in table or modify bullet status of line.&#xA;  Also turns a plain line or a region of lines into list items.&#xA;  Calls &lt;code&gt;org-table-insert-hline&lt;/code&gt;, &lt;code&gt;org-toggle-item&lt;/code&gt;, or&#xA;  &lt;code&gt;org-cycle-list-bullet&lt;/code&gt;, depending on context.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-cycle-list-bullet&lt;/code&gt;, in turn, does the following according to&#xA;the docstring: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(org-cycle-list-bullet &amp;amp;optional WHICH)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Cycle through the different itemize/enumerate bullets.&#xA;  This cycle the entire list level through the sequence:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;-&lt;/code&gt;  -&gt;  &lt;code&gt;+&lt;/code&gt;  -&gt;  &lt;code&gt;*&lt;/code&gt;  -&gt;  &lt;code&gt;1.&lt;/code&gt;  -&gt;  &lt;code&gt;1)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If WHICH is a valid string, use that as the new bullet.  If WHICH&#xA;  is an integer, 0 means &lt;code&gt;-&lt;/code&gt;, 1 means &lt;code&gt;+&lt;/code&gt; etc.  If WHICH is&#xA;  &lt;code&gt;previous&lt;/code&gt;, cycle backwards.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the&#xA;&lt;a href=&quot;http://orgmode.org/manual/Plain-lists.html&quot;&gt;&lt;code&gt;org&lt;/code&gt; manual node on plain lists&lt;/a&gt;&#xA;for more details.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-11T16:31:22.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26211" PostTypeId="2" ParentId="26205" CreationDate="2016-08-11T16:31:28.207" Score="4" Body="&lt;p&gt;Fist you should check whether &lt;code&gt;imagemagick&lt;/code&gt;-support is compiled into emacs.&#xA;If &lt;code&gt;(image-type-available-p 'imagemagick)&lt;/code&gt; returns non-nil you are fine (thanks to &lt;a href=&quot;/users/11911/deb0ch&quot;&gt;deb0ch&lt;/a&gt; for clarification).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Afterwards you can create images with type &lt;code&gt;imagemagick&lt;/code&gt; and property &lt;code&gt;:height&lt;/code&gt; and/or &lt;code&gt;:width&lt;/code&gt;:&#xA;&lt;code&gt;(create-image &quot;~/test.png&quot; 'imagemagick nil :height 100)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/ImageMagick-Images.html&quot; rel=&quot;nofollow&quot;&gt;the manual page on ImageMagick images&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-08-25T09:14:46.053" LastActivityDate="2016-08-25T09:14:46.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26212" PostTypeId="1" AcceptedAnswerId="26214" CreationDate="2016-08-11T16:42:42.793" Score="1" ViewCount="91" Body="&lt;p&gt;I'm trying to font lock some tokens in a simple text file, without&#xA;picking up adjacent tokens. For example, here are some example lines that I have been working with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;name: foobar (&amp;amp;optional arg1 arg2)&#xA;key:  somechars-1&#xA;(defun my-fun-name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to recognize and font lock the second token on each line -- &quot;foobar&quot;, &quot;somechars-1&quot;, or &quot;my-fun-name&quot;,  without matching &quot;name:&quot;, &quot;arg1&quot;, or &quot;key:&quot;. I've tried using re-builder and a bunch of regexp examples from the net, but without success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried what I know from using font-lock-defaults in major/minor modes, but what I know is not doing the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's easy to match and font lock tokens with unique syntaxes (like pathnames), or to match the whole line, or both the key: and first token of the value. But I can't figure out how to match only the second token on each line, when there are other (optional) tokens on the same line, with the same syntaxes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Various language modes do this (eg Lisp mode font locks the defun names), but I don't know how they do it. I looked at the lisp-mode code with pcase-let matching patterns, and could see them matching keywords, error tokens, etc, but I couldn't recognize anything that showed how it matches the second token on a line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps I am using the wrong approach, thinking in a &quot;font-lock-defaults&quot; way for a major mode. Those kinds of regexp matches are global kinds of things. Maybe the only way to do what I want is to parse the lines, mark off the special tokens programmatically, and font lock them individually. I don't know the right answer (or maybe even the right approach).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps someone could explain how to do this with a short example, or point me to some kind of a reference doc that explains how to do this kind of font locking matching. (or how to match the nth token on a line, when all the syntaxes are the same (eg foobar and arg1 in my example above). Thank you&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-08-23T04:51:12.423" Title="How to font lock the second token on a line of tokens" Tags="|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26213" PostTypeId="2" ParentId="26205" CreationDate="2016-08-11T16:42:47.173" Score="2" Body="&lt;p&gt;The &lt;code&gt;:width&lt;/code&gt; and &lt;code&gt;:height&lt;/code&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/ImageMagick-Images.html#ImageMagick-Images&quot; rel=&quot;nofollow&quot;&gt;keywords&lt;/a&gt; are available to scale the image only for the image type &lt;code&gt;imagemagick&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding of the documentation is that rather than using &quot;convenience functions&quot; such as &lt;code&gt;create-image&lt;/code&gt; and &lt;code&gt;insert-image&lt;/code&gt; you have to directly build an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Image-Descriptors.html#Image-Descriptors&quot; rel=&quot;nofollow&quot;&gt;image descriptor&lt;/a&gt; and put it as the &lt;code&gt;display&lt;/code&gt; text property of the position where you want to display the image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example (displaying the image &lt;code&gt;/usr/share/zenity/zenity.png&lt;/code&gt; at position 1 with a width of 100 pixels):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(put-text-property 1 2 'display (cons 'image&#xA; '(:type imagemagick :file  &quot;/usr/share/zenity/zenity.png&quot; :width 100)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: as shown in @Tobias' answer, and contrary to what I say above, you can actually use &quot;convenience functions&quot;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-08-22T22:15:55.673" LastActivityDate="2016-08-22T22:15:55.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26214" PostTypeId="2" ParentId="26212" CreationDate="2016-08-11T18:25:15.640" Score="3" Body="&lt;p&gt;The following regex will do what you want for your examples:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;^[ \t]*[^ \t\n]+[ \t]+\\([[:alpha:]][^ \t\n]*\\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It matches the start of line &lt;code&gt;^&lt;/code&gt;. Then possible leading whitespaces, everything but whitespace &lt;code&gt;[ \t]*[^ \t\n]+&lt;/code&gt;. Then at least one whitespace &lt;code&gt;[ \t]+&lt;/code&gt;. Now it matches in a capturing group anything but whitespace or carriage return, starting with a letter &lt;code&gt;\\([[:alpha:]][^ \t\n]*\\)&lt;/code&gt; (this depends a bit on what exactly a valid token is in your case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can use group 1 to font lock:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(font-lock-add-keywords nil '((&quot;^[ \t]*[^ \t\n]+[ \t]+\\([[:alpha:]][^ \t\n]*\\)&quot;&#xA;                               1&#xA;                               'font-lock-keyword-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that I intentionally used &lt;code&gt;[ \t]&lt;/code&gt; and not &lt;code&gt;\\s-&lt;/code&gt;, because the regexp would otherwise also match newline and become instable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example shows how to fontify more matching groups:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(font-lock-add-keywords nil '((&quot;^[ \t]*\\([^ \t\n]+\\)[ \t]+\\([[:alpha:]][^ \t\n]*\\)&quot;&#xA;                               (1 'font-lock-keyword-face)&#xA;                               (2 'font-lock-variable-name-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By this a regexp matching several part of interest must be evaled only once to fontify each part. If course the first group would have to be more specific to be really usefully fontified, probably something like &lt;code&gt;&quot;^[ \t]*(?\\([[:alpha:]][[:alnum:]_-]+\\):?[ \t]+\\([[:alpha:]][^ \t\n]*\\)&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-23T04:51:12.423" LastActivityDate="2016-08-23T04:51:12.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26215" PostTypeId="1" CreationDate="2016-08-11T19:08:32.430" Score="4" ViewCount="1666" Body="&lt;p&gt;I'm new to Emacs. I followed a tutorial for Emacs as IDE for C/C++ but there are steps that do not work fully for me: the auto-complete for c-headers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed yasnippet and auto-complete for C/C++ headers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) I get the normal auto-complete behavior for &lt;code&gt;#include &amp;lt;stdio.h&lt;/code&gt; but &lt;code&gt;&amp;gt;&lt;/code&gt; closing hook is not added even if I type tab on &lt;code&gt;h&lt;/code&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) And some functions (I don't know how many) aren't called even with &#xA;   their headers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other posts, particularly &lt;a href=&quot;https://emacs.stackexchange.com/a/22570/12950&quot;&gt;this one&lt;/a&gt;, helped me to solve an issue about &lt;code&gt;#include &amp;lt;float&lt;/code&gt;  when  is not completed with &lt;code&gt;.h&lt;/code&gt;, now it works but as alwas tab on &lt;code&gt;h&lt;/code&gt; does not add &lt;code&gt;&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after changing my &lt;code&gt;.emacs&lt;/code&gt; from the link above , &lt;code&gt;#include &amp;lt;ctype.h&amp;gt;&lt;/code&gt;  doesn't call at least &lt;code&gt;isdig&lt;/code&gt;  knowing that I want &lt;code&gt;isdigit&lt;/code&gt; ...&#xA;And for &lt;code&gt;getchar&lt;/code&gt; it doesn't add  &lt;code&gt;()&lt;/code&gt;wherease for  while, for loops it works fine...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my new &lt;code&gt;.emacs&lt;/code&gt; after following the link above. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;; start package.el with emacs&#xA;(require 'package)&#xA;;add MELPA to repository list&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;;initialize package.el&#xA;(package-initialize)&#xA;;start auto-complete with emacs&#xA;(require 'auto-complete)&#xA;;do default config for auto-complete&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;;start yasineppet with emacs&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;;let's define a function which initializes auto-complete-c-headers and gets called for c/c++ headers hooks&#xA;(defun my:ac-c-header-init ()&#xA;  (require 'auto-complete-c-headers)&#xA;  (add-to-list 'ac-sources 'ac-source-c-headers)&#xA;  (setq achead:include-directories&#xA;  (append '(&quot;/usr/include/c++/5&quot;&#xA;        &quot;/usr/include/x86_64-linux-gnu/c++/5&quot;&#xA;        &quot;/usr/include/c++/5/backward&quot;&#xA;        &quot;/usr/lib/gcc/x86_64-linux-gnu/5/include&quot;&#xA;        &quot;/usr/local/include&quot;&#xA;        &quot;/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed&quot;&#xA;        &quot;/usr/include/x86_64-linux-gnu&quot;)&#xA;        achead:include-directories)))&#xA;;now let's call this function from c/c++ hooks&#xA;(add-hook 'c++-mode-hook 'my:ac-c-header-init)&#xA;(add-hook 'c-mode-hook 'my:ac-c-header-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Something is missing ?&#xA;The path for headers comes from &lt;code&gt;gcc -xc++ -E -v -&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ignoring duplicate directory &quot;/usr/include/x86_64-linux-gnu/c++/5&quot;&#xA;ignoring nonexistent directory &quot;/usr/local/include/x86_64-linux-gnu&quot;&#xA;ignoring nonexistent directory &quot;/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include&quot;&#xA;#include &quot;...&quot; search starts here:&#xA;#include &amp;lt;...&amp;gt; search starts here:&#xA; /usr/include/c++/5&#xA; /usr/include/x86_64-linux-gnu/c++/5&#xA; /usr/include/c++/5/backward&#xA; /usr/lib/gcc/x86_64-linux-gnu/5/include&#xA; /usr/local/include&#xA; /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed&#xA; /usr/include/x86_64-linux-gnu&#xA; /usr/include&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12950" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-10-10T15:51:58.810" Title="emacs auto-complete-c-headers and closing brackets" Tags="|auto-complete-mode|header-line|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26216" PostTypeId="2" ParentId="26215" CreationDate="2016-08-11T20:30:17.183" Score="3" Body="&lt;p&gt;I'm not sure how you would accomplish this with &lt;code&gt;auto-complete&lt;/code&gt; but I do know that you can do all of this and more with &lt;code&gt;company-mode&lt;/code&gt;, &lt;code&gt;company-irony&lt;/code&gt;, &lt;code&gt;company-irony-c-headers&lt;/code&gt;, and &lt;code&gt;irony&lt;/code&gt;. You can find all of them on &lt;a href=&quot;https://melpa.org/&quot; rel=&quot;nofollow&quot;&gt;MELPA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll walk you through my &lt;code&gt;init.el&lt;/code&gt; file and you can make the relevant changes in yours accordingly. &lt;strong&gt;However, you should read the guides of the respective packages on their website instead of just copying mine.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, enable &lt;code&gt;company-mode&lt;/code&gt; using&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-init-hook #'global-company-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following are some optimizations that I made. You may or may not want them.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq company-idle-delay 0.5)&#xA;(setq company-minimum-prefix-length 2)&#xA;(setq company-selection-wrap-around t)&#xA;(setq company-show-numbers t)&#xA;(setq company-tooltip-align-annotations t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following line enables &lt;code&gt;irony-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'c-mode-hook #'irony-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found the following code &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and this is supposed to replace the default completion options with the options that &lt;code&gt;irony-mode&lt;/code&gt; would provide.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-irony-mode-hook ()&#xA;  (define-key irony-mode-map [remap completion-at-point]&#xA;    'irony-completion-at-point-async)&#xA;  (define-key irony-mode-map [remap complete-symbol]&#xA;    'irony-completion-at-point-async))&#xA;(add-hook 'irony-mode-hook #'my-irony-mode-hook)&#xA;(add-hook 'irony-mode-hook #'irony-cdb-autosetup-compile-options)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add &lt;code&gt;company-irony-c-headers&lt;/code&gt; and &lt;code&gt;company-irony&lt;/code&gt; to the list of backends that &lt;code&gt;company-mode&lt;/code&gt; uses.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'company&#xA;  '(add-to-list&#xA;    'company-backends '(company-irony-c-headers company-irony)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11384" LastEditorUserId="675" LastEditDate="2016-08-16T00:38:44.037" LastActivityDate="2016-08-16T00:38:44.037" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26217" PostTypeId="1" CreationDate="2016-08-11T21:12:05.773" Score="2" ViewCount="357" Body="&lt;p&gt;Here's a snippet from an optimistic org-mode file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CONSTANTS: rate=100000.0&#xA;&#xA;#+BEGIN: clocktable :maxlevel 2 :scope file :narrow 60! :header &quot;#+NAME: billed #+attr_latex: :align l|r|r|r|r :environment longtable :font \\footnotesize\n&quot;&#xA;#+NAME: billed #+attr_latex: :align l|r|r|r|r :environment longtable :font \footnotesize&#xA;| Headline                                                  | Time   |      |&#xA;|-----------------------------------------------------------+--------+------|&#xA;| *Total time*                                              | *0:07* |      |&#xA;|-----------------------------------------------------------+--------+------|&#xA;| &amp;lt;2016-08-04 Thu&amp;gt;                                          | 0:07   |      |&#xA;| \_  Doing things |        | 0:07 |&#xA;#+END:&#xA;&#xA;* &amp;lt;2016-08-04 Thu&amp;gt; &#xA;** Doing things&#xA;:LOGBOOK:&#xA;CLOCK: [2016-08-04 Thu 19:23]--[2016-08-04 Thu 19:30] =&amp;gt;  0:07&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to add a column that's the product of the rate constant and the Time column. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:function \&quot;@2$3=$rate*@2$2\&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;inside the header, or adding similar to a #+TBLFM before #+END has no effect. In the latter case the #+TBLFM line is removed after I doing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-dblock-update&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12467" LastActivityDate="2016-08-11T21:12:05.773" Title="Add org-mode clocktable column that is the product of a constant and the Time column" Tags="|org-mode|org-table|org-clock-table|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26218" PostTypeId="1" AcceptedAnswerId="30740" CreationDate="2016-08-11T21:48:05.763" Score="1" ViewCount="342" Body="&lt;p&gt;Disclaimer: Pretty new to Emacs and running Spacemacs, have no idea what I'm doing with elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We run all our projects under vagrant, so I'm interested in getting some things, such as &lt;code&gt;inf-ruby-mode&lt;/code&gt; consoles, to &lt;code&gt;ssh&lt;/code&gt; into my vagrant box before running their commands. In particular, I'm currently looking at the &lt;code&gt;run-ruby&lt;/code&gt; &lt;a href=&quot;https://github.com/nonsequitur/inf-ruby/blob/master/inf-ruby.el#L303&quot; rel=&quot;nofollow&quot;&gt;function&lt;/a&gt; right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided that aliasing &lt;code&gt;bundle&lt;/code&gt; to run under the ssh box would do this, so I made myself an eshell alias, but that doesn't seem to get loaded in &lt;code&gt;comint-mode&lt;/code&gt;, which I'm fairly certain is how such commands are run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach might be to have a &lt;code&gt;comint&lt;/code&gt; hook which first SSH's into the box before running another command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? Any other suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the &lt;code&gt;docker&lt;/code&gt; tag to this because the workflow can be quite similar, and there's no existing &lt;code&gt;vagrant&lt;/code&gt; tag.&lt;/p&gt;&#xA;" OwnerUserId="12568" LastActivityDate="2017-03-17T22:00:09.573" Title="comint-mode + vagrant" Tags="|spacemacs|ruby-mode|ruby|docker|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26219" PostTypeId="2" ParentId="19080" CreationDate="2016-08-11T22:11:20.390" Score="5" Body="&lt;p&gt;You could use &lt;code&gt;display-buffer-alist&lt;/code&gt; and dispatch on the executed&#xA;command, like this.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar display-buffer-same-window-commands&#xA;  '(occur-mode-goto-occurrence compile-goto-error))&#xA;&#xA;(add-to-list 'display-buffer-alist&#xA;             '((lambda (&amp;amp;rest _)&#xA;                 (memq this-command display-buffer-same-window-commands))&#xA;               (display-buffer-reuse-window&#xA;                display-buffer-same-window)&#xA;               (inhibit-same-window . nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-08-11T22:11:20.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26220" PostTypeId="1" CreationDate="2016-08-11T23:55:41.020" Score="6" ViewCount="772" Body="&lt;p&gt;I'm trying to write my thesis in org-mode, and so far it feels amazing. The integration with my todo system, the easy markup language, integration with latex. Wow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But recently (since I upgraded to the latest latex version on my Arch system, and installed biber from the separate package) the export to pdf cannot find my references anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I export to .tex first and then run &lt;code&gt;latexmk -f -pdf minimal.tex&lt;/code&gt; from the command line everything does work correctly.&#xA;Here are the relevant settings in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-pdf-process&#xA;      (list &quot;latexmk -f -pdf %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because it uses so many files, I made a small &lt;a href=&quot;https://github.com/japhir/minimallatex&quot; rel=&quot;noreferrer&quot;&gt;git repo&lt;/a&gt; with all the files.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://raw.githubusercontent.com/japhir/minimallatex/master/minimal.org&quot; rel=&quot;noreferrer&quot;&gt;minimal.org&lt;/a&gt; is the source file. &lt;sub&gt;note that some of the lines start with &lt;code&gt;# +&lt;/code&gt;, and are thus comments. &lt;/sub&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/japhir/minimallatex/blob/master/minimal.bib&quot; rel=&quot;noreferrer&quot;&gt;minimal.bib&lt;/a&gt; is a tiny bibliography file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/japhir/minimallatex/blob/master/minimal.tex&quot; rel=&quot;noreferrer&quot;&gt;minimal.tex&lt;/a&gt; is the auto-generated .tex file.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/japhir/minimallatex/blob/master/fromlatexmk.pdf&quot; rel=&quot;noreferrer&quot;&gt;fromlatexmk.pdf&lt;/a&gt; is the pdf file generated from the command line with the .tex file as input.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/japhir/minimallatex/blob/master/fromorgmode.pdf&quot; rel=&quot;noreferrer&quot;&gt;fromorgmode.pdf&lt;/a&gt; is the pdf generated from org's &lt;code&gt;C-c C-e l p&lt;/code&gt; (or &lt;code&gt;o&lt;/code&gt;), with the failed references.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I hope somebody can help me solve this mystery!&lt;/p&gt;&#xA;" OwnerUserId="9748" LastActivityDate="2023-09-17T16:08:44.857" Title="Org-mode latex pdf export command doesn't find citations" Tags="|org-export|latex|org-mode|bibtex|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26222" PostTypeId="1" AcceptedAnswerId="26345" CreationDate="2016-08-12T09:09:24.937" Score="11" ViewCount="1829" Body="&lt;p&gt;I set up an org-timer indicator in the mode line with this.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq-default&#xA; mode-line-format&#xA; (quote&#xA;  (&#xA;   ;; org-timer&#xA;   (:eval&#xA;    (unless (not org-timer-countdown-timer)&#xA;      (propertize (let* ((rtime (decode-time&#xA;                                 (time-subtract&#xA;                                  (timer--time org-timer-countdown-timer)&#xA;                                  (current-time))))&#xA;                         (rmins (nth 1 rtime))&#xA;                         (rsecs (nth 0 rtime)))&#xA;                    (format &quot; %d:%d&quot; rmins rsecs))&#xA;                  'face '(:foreground &quot;cyan&quot; :weight bold)&#xA;                  'help-echo &quot;org-timer&quot;)))&#xA;&#xA;   )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want this org-timer indicator to be shown in the &lt;strong&gt;active mode line&lt;/strong&gt; only, instead of all mode lines. How to do it?&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="262" LastEditDate="2016-09-30T20:10:40.287" LastActivityDate="2016-09-30T20:10:40.287" Title="Show something in active mode line instead of all mode lines" Tags="|mode-line|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26223" PostTypeId="1" AcceptedAnswerId="26302" CreationDate="2016-08-12T10:36:24.703" Score="3" ViewCount="2795" Body="&lt;p&gt;Dired used to run fine on my machine (Ubuntu 14.04). But for a while now, i keep running into the error &lt;code&gt;(wrong-type-argument stringp nil)&lt;/code&gt;. This does not only happen with &lt;em&gt;dired&lt;/em&gt; but also with other commands taking an argument (from the minibar).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From searching the web it seems that the error message comes up in situations with some misconfiguration, but I haven't been able to figure it out just yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Full error message:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;call-process(nil nil nil nil &quot;--dired&quot;)&#xA;dired-insert-directory(&quot;/home/hb/test/&quot; &quot;-al&quot; nil nil t)&#xA;dired-readin-insert()&#xA;dired-readin()&#xA;dired-internal-noselect(&quot;~/test/&quot; nil)&#xA;dired-noselect(&quot;/home/hb/test/ nil)&#xA;dired(&quot;/home/hb/test/&quot;)&#xA;ido-file-internal(dired dired nil &quot;Dired: &quot; dir)&#xA;ido-dired()&#xA;call-interactively(ido-dired nil nil)&#xA;command-execute(ido-dired)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10203" LastEditorUserId="129" LastEditDate="2016-08-16T14:35:01.320" LastActivityDate="2016-08-16T14:35:01.320" Title="(wrong-type-argument stringp nil)-error when starting dired" Tags="|dired|debugging|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26224" PostTypeId="2" ParentId="26202" CreationDate="2016-08-12T11:23:27.973" Score="1" Body="&lt;p&gt;When you open a encrypted file, Emacs automatically replaces the contents of it's buffer with a decrypted version of it.  Though &lt;code&gt;doc-view&lt;/code&gt;, and for that matter &lt;code&gt;pdf-view&lt;/code&gt; as well, does not care for the actual buffer content, but rather uses the buffer's file-name with various programs, in your case ghostscript, in order to produce images of the PDF pages.  Since the actual file stays encrypted, these programs fail to do their job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;doc-view&lt;/code&gt; already handles files in archives and remote files, by copying them to a temporary file and using this file with said programs.  It would be relatively easy to extend this behavior to encrypted files, but maybe this is considered a security risk. Or no one has thought of it yet.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-08-12T11:23:27.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26225" PostTypeId="1" AcceptedAnswerId="27426" CreationDate="2016-08-12T14:04:24.943" Score="9" ViewCount="3204" Body="&lt;p&gt;How can I get &lt;code&gt;electric-pair-mode&lt;/code&gt; to &lt;em&gt;not&lt;/em&gt; pair quotation marks (single or double)? I still want it to pair everything else (brackets, braces, etc.), just not quotes.&lt;/p&gt;&#xA;" OwnerUserId="12866" LastEditorUserId="12866" LastEditDate="2017-12-29T16:02:54.337" LastActivityDate="2021-03-03T05:09:34.937" Title="Don't pair quotes in electric-pair-mode" Tags="|quote|electric-pair-mode|pairing|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26226" PostTypeId="1" AcceptedAnswerId="26227" CreationDate="2016-08-12T17:40:02.817" Score="2" ViewCount="569" Body="&lt;p&gt;Can you recommend, a good bookmark package?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Yes, emacs standard has bookmarks. Although, hate naming them.&lt;/li&gt;&#xA;&lt;li&gt;Just want something small, not uber sophisticated (like bookmark+). (It crashes my setup, at the moment, had to remove it.)&lt;/li&gt;&#xA;&lt;li&gt;All I want is a hotkey to mark one location, per file.&lt;/li&gt;&#xA;&lt;li&gt;Don't care about saving, between sessions. (Great if just during session.)&lt;/li&gt;&#xA;&lt;li&gt;Although, I do have &quot;save last edited place&quot; working now. (Don't know, name of package off top of head.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Really after, just a remember position (in key), then other hotkey to recall. Yes, plain Emacs bookmark could do this? With a name in macro.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;But, is that the best way?&lt;/li&gt;&#xA;&lt;li&gt;Or easiest way?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12903" LastEditorUserId="105" LastEditDate="2020-03-21T14:33:13.287" LastActivityDate="2020-03-21T14:33:13.287" Title="Looking For Simple Bookmark Package" Tags="|bookmarks|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="26227" PostTypeId="2" ParentId="26226" CreationDate="2016-08-12T18:21:06.967" Score="2" Body="&lt;p&gt;I use this function to quickly create meaningful bookmarks with a single keypress, without having to think about it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/quick-save-bookmark ()&#xA;  &quot;Save bookmark with name as 'buffer:row:col'&quot;&#xA;  (interactive)&#xA;  (bookmark-set (format &quot;%s:%s:line %s:column %s&quot;&#xA;            (thing-at-point 'symbol)&#xA;            (buffer-name)&#xA;            (line-number-at-pos)&#xA;            (current-column)))&#xA;  (message &quot;Bookmarked saved at current position&quot;))&#xA;&#xA;(global-set-key (kbd &quot;C-S-b&quot;) 'my/quick-save-bookmark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure if this is what you are looking for, but it seems to basically meet your description. I have found it to be very useful and lightweight. I also use &lt;code&gt;helm&lt;/code&gt; and this to quickly see my bookmarks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key &quot;&amp;lt;menu&amp;gt;&quot; 'helm-bookmarks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-08-12T18:21:06.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26228" PostTypeId="1" CreationDate="2016-08-12T19:04:53.227" Score="2" ViewCount="345" Body="&lt;p&gt;Is it possible to comment the string &quot;emacs&quot; below  while  keeping this code one line? If so, how? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (message &quot;hi&quot;) &quot;emacs&quot; (message &quot;hi!&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="253" LastEditDate="2016-08-12T19:24:03.447" LastActivityDate="2016-08-12T19:59:25.100" Title="Is there a way to comment within a line in elisp?" Tags="|elisp|comment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26229" PostTypeId="2" ParentId="26228" CreationDate="2016-08-12T19:23:39.823" Score="4" Body="&lt;p&gt;It looks like the answer is &lt;em&gt;no, you cannot.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The elisp manual node on&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Comments.html&quot; rel=&quot;nofollow&quot;&gt;Comments&lt;/a&gt;&#xA;states that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In Lisp, a semicolon (&lt;code&gt;;&lt;/code&gt;) starts a comment if it is not within&#xA;  a string or character constant.  &lt;strong&gt;The comment continues to the end&#xA;  of line.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It also, however, goes on to say that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The &lt;code&gt;#@count&lt;/code&gt; construct, which skips the next count characters,&#xA;  is useful for program-generated comments containing binary&#xA;  data.  The Emacs Lisp byte compiler uses this in its output files&#xA;  (see Byte Compilation).  &lt;strong&gt;It isn't meant for source files,&#xA;  however.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The manual index links the &lt;code&gt;#@count&lt;/code&gt; construct to&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Docs-and-Compilation.html#index-_0023_0040count&quot; rel=&quot;nofollow&quot;&gt;Documentation Strings and Compilation&lt;/a&gt;.&#xA;It states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Internally, the dynamic loading of documentation strings is&#xA;  accomplished by writing compiled files with a special Lisp&#xA;  reader construct, &lt;code&gt;#@count&lt;/code&gt;. This construct skips the next count&#xA;  characters. It also uses the &lt;code&gt;#$&lt;/code&gt; construct, which stands for&#xA;  &quot;the name of this file, as a string&quot;. &lt;strong&gt;Do not use these&#xA;  constructs in Lisp source files; they are not designed to be&#xA;  clear to humans reading the file.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-12T19:23:39.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26232" PostTypeId="2" ParentId="26228" CreationDate="2016-08-12T19:58:27.947" Score="7" Body="&lt;p&gt;For the usual meaning of &quot;comment&quot;, the answer is mostly no (see Dan answer for details), but if you just want to prevent code from being executed, then you can simply do nothing in your case, since the execution of &lt;code&gt;&quot;emacs&quot;&lt;/code&gt; will not have any visible effect.  If you want to use it on elements whose execution does have visible effects, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro comment-out (&amp;amp;rest args) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after which you can do things like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;foo&quot;) (comment-out (message &quot;bar&quot;)) (message &quot;baz&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-12T19:58:27.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26235" PostTypeId="1" CreationDate="2016-08-12T22:21:45.363" Score="3" ViewCount="130" Body="&lt;p&gt;If I go to &lt;em&gt;scratch&lt;/em&gt;, M-x web-mode RET, type in this snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&quot;text/x-dust-template&quot;&amp;gt;&#xA;    {#obj_to_iterate}&#xA;    {prop} &amp;lt;----- this should indent&#xA;    {/obj_to_iterate}&#xA;&amp;lt;/script&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong here? I see bugs with Dust.js have been solved and I can't be the only one doing simple stuff like this without noticing this indentation behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also having problems with the general indentation of HTML, sometimes I get a TAB, sometimes I get two spaces, sometimes one space, who knows what else I can get but it is at least consistent so TAB or spaces are always the same for every line that I indent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want one TAB per identation and properly indented Dust, can somebody help me?&lt;/p&gt;&#xA;" OwnerUserId="12968" LastActivityDate="2018-11-01T20:00:29.933" Title="Web-mode + Dust.js, no indentation?" Tags="|indentation|microsoft-windows|web-mode|scratch-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26236" PostTypeId="2" ParentId="26235" CreationDate="2016-08-13T01:39:06.013" Score="1" Body="&lt;p&gt;I had a similar problem getting &lt;code&gt;web-mode&lt;/code&gt; to play nice with Django templates. For me the fix was as simple as adding the following to my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-engines-alist&#xA;  '((&quot;django&quot;    . &quot;\\.html\\'&quot;))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For you, try adding something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-engines-alist&#xA;  '((&quot;dust&quot;    . &quot;\\.html\\'&quot;))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more details, see the section &lt;strong&gt;Associate an engine&lt;/strong&gt; in the &lt;code&gt;web-mode&lt;/code&gt; &lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;nofollow&quot;&gt;docs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-08-13T01:39:06.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26237" PostTypeId="1" AcceptedAnswerId="26240" CreationDate="2016-08-13T03:19:02.730" Score="4" ViewCount="825" Body="&lt;p&gt;I've been using emacs for a long time but still have little understanding of elisp; I basically copy code I find on websites into my &lt;code&gt;.emacs&lt;/code&gt; until it seems to do what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only recently discovered &lt;code&gt;global-visual-line-mode&lt;/code&gt; (I had been using &lt;code&gt;auto-fill&lt;/code&gt;), and now see based on &lt;a href=&quot;https://emacs.stackexchange.com/questions/14589/correct-indentation-for-wrapped-lines&quot;&gt;this other answer&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/questions/13559061/emacs-how-to-keep-the-indentation-level-of-a-very-long-wrapped-line&quot;&gt;this one at stackoverflow&lt;/a&gt; that I also want &lt;code&gt;adaptive-wrap-prefix-mode&lt;/code&gt;. It works great when I turn it on manually, but when I blindly add the code provided in the former answer to my &lt;code&gt;.emacs&lt;/code&gt;, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Cannot open load file, no such file or directory, adaptive-wrap&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while blindly adding the code from the latter answer loads fine, but does not actually succeed in turning on &lt;code&gt;adaptive-wrap-mode&lt;/code&gt;. I've played with variations and I'm sure the solution is simple, but I just don't see it. How do I just get it to turn on both &lt;code&gt;global-visual-line-mode&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; &lt;code&gt;adaptive-wrap-prefix-mode&lt;/code&gt; by default?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be happy if I could get them both running just for my markdown files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="6886" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-08-13T06:10:59.013" Title="Loading adaptive wrap as default" Tags="|init-file|line-break|wrapping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26238" PostTypeId="1" AcceptedAnswerId="26239" CreationDate="2016-08-13T04:38:14.797" Score="4" ViewCount="4797" Body="&lt;p&gt;Whenever I've to create a  new directory in emacs, I enter dired mode, press &quot;+&quot; and enter the new directory name which creates the new directory. &#xA;Is there a way I can avoid using dired-mode and create a new directory in the current path of the active buffer like creating a new file using &lt;code&gt;C-x C-f&lt;/code&gt; command ?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-08-13T05:34:37.013" Title="How to quickly create a new directory without using dired-mode?" Tags="|commands|directories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26239" PostTypeId="2" ParentId="26238" CreationDate="2016-08-13T05:13:09.983" Score="8" Body="&lt;p&gt;You could use &lt;code&gt;M-x make-directory DIRNAME RET&lt;/code&gt;.  The default path is the path to the current buffer folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could bind it to key (like &lt;code&gt;C-x C-f&lt;/code&gt;) with &lt;code&gt;(global-set-key (kbd &quot;C-c d&quot;) 'make-directory)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could create buffer in nonexist path with &lt;code&gt;C-x C-f non/exist/path/file.name RET&lt;/code&gt; and then create nececcary folders with &lt;code&gt;M-x make-directory RET RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-08-13T05:34:37.013" LastActivityDate="2016-08-13T05:34:37.013" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26240" PostTypeId="2" ParentId="26237" CreationDate="2016-08-13T06:10:59.013" Score="3" Body="&lt;p&gt;You need to add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at the beginning of your &lt;code&gt;~/emacs&lt;/code&gt;.  IIRC Emacs-25 will tend to do that for you, but it's even better to do it manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is simply that &lt;code&gt;adaptive-wrap-mode&lt;/code&gt; is not defined until the ELPA packages have been initialized.  If your &lt;code&gt;~/.emacs&lt;/code&gt; file doesn't initialize the ELPA packages with &lt;code&gt;package-initialize&lt;/code&gt;, Emacs does it for you, but it can only notice it after your &lt;code&gt;~/.emacs&lt;/code&gt; is loaded, so the functions defined by the ELPA packages won't be available until after your &lt;code&gt;~/.emacs&lt;/code&gt; is loaded.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-13T06:10:59.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26241" PostTypeId="2" ParentId="26225" CreationDate="2016-08-13T06:47:25.173" Score="1" Body="&lt;p&gt;It appears you cannot. The various customizations only allow you to add pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're willing to use a different package to do your pairing, you can try &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow&quot;&gt;smartparens&lt;/a&gt;. You can set quotation marks to not pair as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;'&quot; nil :actions :rem)&#xA;(sp-pair &quot;\&quot;&quot; nil :actions :rem)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-08-13T06:47:25.173" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26242" PostTypeId="2" ParentId="24938" CreationDate="2016-08-13T08:44:17.457" Score="2" Body="&lt;p&gt;I'm the dev maintaining pandoc's org-mode reader.  There currently is no setting equivalent to &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt; in Emacs, though adding this is possible in principle.  We'd need to design a way to simply and uniformly pass variables to the reader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for now, the workaround suggested by @digitalis_ in the comments is the best option: Just add a zero with space character (&lt;kbd&gt;C-x 8 &amp;lt;RET&amp;gt; ZERO WIDTH SPACE&lt;/kbd&gt;) between the comma and the closing markup character.  Pandoc uses the default setting for characters which are forbidden at the inner border of markup, so any use of tabs, newlines, carriage returns, simple space, comma, and single/double quotes before the closing markup prevents the sequence from being interpreted as markup.&lt;/p&gt;&#xA;" OwnerUserId="8987" LastActivityDate="2016-08-13T08:44:17.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26243" PostTypeId="1" AcceptedAnswerId="26244" CreationDate="2016-08-13T09:04:36.803" Score="0" ViewCount="51" Body="&lt;p&gt;Usually when I load a project, I want to compile it once right away, be it to again see the compilation error I was working on or just to build the dependencies of the checkout, so I don't have to wait for the entire build when I've actually done some changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I can simply press &lt;code&gt;C-c m&lt;/code&gt; (which I've mapped to &lt;code&gt;recompile&lt;/code&gt;), but is there a way to achieve the build without any extra cue?&lt;/p&gt;&#xA;" OwnerUserId="10069" LastActivityDate="2016-08-13T11:45:03.127" Title="How can make emacs immediately compile a file I load?" Tags="|start-up|compilation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26244" PostTypeId="2" ParentId="26243" CreationDate="2016-08-13T11:43:47.727" Score="2" Body="&lt;p&gt;You could add hook into &lt;code&gt;init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'find-file-hook&#xA;          (lambda ()&#xA;            (when (string= major-mode &quot;c-mode&quot;)&#xA;              (recompile))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for &lt;code&gt;c-mode&lt;/code&gt; to recompile it automatically when you'll &lt;code&gt;find-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="306" LastEditDate="2016-08-13T11:45:03.127" LastActivityDate="2016-08-13T11:45:03.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26245" PostTypeId="2" ParentId="22740" CreationDate="2016-08-13T12:20:47.747" Score="0" Body="&lt;p&gt;I got the answer on &lt;code&gt;#emacs&lt;/code&gt; on freenode. The suggestion was that presumably &lt;code&gt;goto-address-mode&lt;/code&gt; should be related to the issue. It seems it's actually turned off in &lt;code&gt;java-mode&lt;/code&gt; in my setup, however turning that minor mode off does fix the issue for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the workaround is to put this in the &lt;code&gt;emacs&lt;/code&gt; startup script (&lt;code&gt;.spacemacs&lt;/code&gt; under spacemacs):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'java-mode-hook (lambda () (goto-address-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That does fix the issue for me.&lt;/p&gt;&#xA;" OwnerUserId="2592" LastActivityDate="2016-08-13T12:20:47.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26246" PostTypeId="1" CreationDate="2016-08-13T17:38:44.707" Score="1" ViewCount="89" Body="&lt;p&gt;How does one trigger a function to run when a buffer of a particular name is created?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My use case is connecting to freenode with ERC for Emacs related channels. I manually call a function to create a new frame with a window layout specific to the channels I auto join, #emacs #org-mode #erc &amp;amp; #gnus. I'd like the function to automatically kick off after the last channel, in this case '#gnus', is created.&lt;/p&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2016-08-13T17:38:44.707" Title="How to trigger function on particularly named buffer creation?" Tags="|buffers|window|frames|functions|erc|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26247" PostTypeId="1" AcceptedAnswerId="26248" CreationDate="2016-08-13T18:57:55.263" Score="10" ViewCount="1219" Body="&lt;p&gt;Can someone explain what the top three lines of the magit status buffer mean? Especially &lt;code&gt;Merge: origin/master Commit message&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Head:     master Commit message&#xA;Merge:    origin/master Commit message&#xA;Push:     origin/master Commit message&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the console my working directory seems clean and everything is pushed/pulled to/from my remote, so why does the &lt;code&gt;Merge&lt;/code&gt; appear in magit status?&lt;/p&gt;&#xA;" OwnerUserId="12637" LastActivityDate="2023-11-15T01:08:24.370" Title="Meaning of magit status buffer: Head, Merge, Push" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26248" PostTypeId="2" ParentId="26247" CreationDate="2016-08-13T19:22:09.923" Score="10" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;Head&lt;/code&gt; line shows information about the &lt;code&gt;HEAD&lt;/code&gt; commit. It doesn't say &lt;code&gt;Branch&lt;/code&gt; instead because &lt;code&gt;HEAD&lt;/code&gt; may be detached.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;Merge&lt;/code&gt; line does not indicate that a merge is in progress. It simply shows the upstream branch of the current branch.  The prefix used for that line used to be &lt;code&gt;Upstream&lt;/code&gt;, but now &lt;code&gt;Merge&lt;/code&gt; &lt;strong&gt;or&lt;/strong&gt; &lt;code&gt;Rebase&lt;/code&gt; is used, additionally informing you how upstream changes are pulled into the current branch.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;(If you want to rebase by default, then you should set &lt;code&gt;branch.&amp;lt;branch&amp;gt;.rebase&lt;/code&gt; or &lt;code&gt;pull.rebase&lt;/code&gt; accordingly. You can do that from the branch popup &lt;kbd&gt;b&lt;/kbd&gt; or the branch config popup &lt;kbd&gt;b C&lt;/kbd&gt;.)&lt;/p&gt;&#xA;&lt;p&gt;When a merge &lt;em&gt;is&lt;/em&gt; in progress, then a &amp;quot;progress section&amp;quot; is shown in the status buffer, but that comes further down and lists the commits that are being merged like so:&lt;/p&gt;&#xA;&lt;p&gt;_&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Merging np/submodules (3)&#xA;368a666 * origin/np/submodules np/submodules Reorganize submodule popup&#xA;c2a58fc * magit-submodule-popup: move (i, s) to nested popup&#xA;51c0564 * Add new submodule section type&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;code&gt;Push&lt;/code&gt; line is about the branch that that the current branch is being pushed to. When using a triangular workflow then the &amp;quot;target of push&amp;quot; is usually different from the &amp;quot;upstream&amp;quot;. Long-lived branches such as &lt;code&gt;master&lt;/code&gt; are the exception to that rule, so for those branches a bit of redundant information is being displayed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;To learn more about triangular workflows and the use of the &amp;quot;push-remote&amp;quot; in Magit (and Git), see this &lt;a href=&quot;https://magit.vc/manual/magit/The-Two-Remotes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;brief introduction&lt;/a&gt; in the Magit manual.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2023-11-15T01:08:24.370" LastActivityDate="2023-11-15T01:08:24.370" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="26249" PostTypeId="1" CreationDate="2016-08-13T19:54:10.173" Score="3" ViewCount="904" Body="&lt;p&gt;I've been writing my own custom org-agenda views lately, and I've had good luck playing around with &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; for customizing the format for my different tasks. I occasionally would like to include extra information, typically via my own added property tags.  However, while I've been adding this extra information /before/ the task of interest, I'd prefer to include it /after/ the task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I currently display calendar events as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Serenity:    18:00-19:00&#xA;              Location: Jaynestown&#xA;              Scheduled: TODO Help the Mudders&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I'd like for this information to appear in the following order:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Serenity:    18:00-19:00 &#xA;              Scheduled: TODO Help the Mudders&#xA;              Location: Jaynestown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that this cannot be done with &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; since some of the added text occurs after &lt;code&gt;TODO Help the Mudders&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;===&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Here's the code I used to generate the above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun gs/org-agenda-add-location-string ()&#xA;  &quot;Gets the value of the LOCATION property&quot;&#xA;  (let ((loc (org-entry-get (point) &quot;LOCATION&quot;)))&#xA;    (if (&amp;gt; (length loc) 0)&#xA;    (concat &quot;\n&quot; (make-string 15 ?\s) &quot;Location: &quot; loc&#xA;        &quot;\n&quot; (make-string 15 ?\s))&#xA;      &quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then use this custom function as follows (within &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-prefix-format '((agenda . &quot;  %-12:c%?-12t %(gs/org-agenda-add-location-string)% s&quot;) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8486" LastEditorUserId="8486" LastEditDate="2016-08-13T23:03:08.410" LastActivityDate="2016-08-13T23:03:08.410" Title="Customize text after task in custom org-agenda view" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26250" PostTypeId="1" CreationDate="2016-08-13T21:33:55.840" Score="0" ViewCount="129" Body="&lt;p&gt;I configured emacs to be slightly transparent in my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter (selected-frame) 'alpha '(97 . 85))&#xA;(add-to-list 'default-frame-alist   '(alpha . (97 . 85)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wanted to be able to toggle transparency on/off, and I saw this in the documentation for Font and Color Parameters:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To prevent the frame from disappearing completely from view, the variable &lt;code&gt;frame-alpha-lower-limit&lt;/code&gt; defines a lower opacity limit. If the value of the frame parameter is less than the value of this variable, Emacs uses the latter.  By default,&lt;code&gt;frame-alpha-lower-limit&lt;/code&gt; is 20.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Flipping &lt;code&gt;frame-alpha-lower-limit&lt;/code&gt; between 100 and its default 20 seemed like a good way to implement the toggle without having to hard-code my alpha settings into it or record any previous values.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivan/toggle-transparency ()&#xA;  (interactive)&#xA;  (setq frame-alpha-lower-limit&#xA;        (if (eql frame-alpha-lower-limit 100) 20 100)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But changing the lower limit doesn't trigger any re-evaluation of the relationship between the alpha parameter and its lower limit. I tried &lt;code&gt;(redraw-frame)&lt;/code&gt; and &lt;code&gt;(sit-for 0)&lt;/code&gt;, but the only thing that worked was using &lt;code&gt;set-frame-parameter&lt;/code&gt; to set the alpha to it's current setting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivan/toggle-transparency ()&#xA;  (interactive)&#xA;  (setq frame-alpha-lower-limit&#xA;        (if (eql frame-alpha-lower-limit 100) 20 100))&#xA;  (set-frame-parameter (selected-frame)&#xA;                       'alpha&#xA;                       (frame-parameter (selected-frame) 'alpha)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any other way to do this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="105" LastEditDate="2016-08-13T21:54:52.997" LastActivityDate="2016-08-14T01:23:53.060" Title="How to re-evaluate transparency when frame-alpha-lower-limit changes?" Tags="|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26251" PostTypeId="1" AcceptedAnswerId="26260" CreationDate="2016-08-13T21:48:12.107" Score="6" ViewCount="531" Body="&lt;p&gt;I've been trying to a macro to &lt;strong&gt;put one-time advice on a function&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean by one-time advice is &lt;strong&gt;advice which removes itself after it is called&lt;/strong&gt; – so that when you add the advice and run the original function, the advice runs, but if you run the function again, the advice is gone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current (non-working) definition is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro add-one-time-advice (symbol where function &amp;amp;optional props)&#xA;  `(let ((ad-sym (make-symbol &quot;advice&quot;)))&#xA;    (fset ad-sym (symbol-function ,function))&#xA;    (advice-add ad-sym :after (lambda () (advice-remove ,symbol ad-sym)))&#xA;    (advice-add ,symbol ,where ad-sym ,props)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This throws no errors, but the advice doesn't remove itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my approach is okay, &lt;strong&gt;how can I fix it&lt;/strong&gt;, and if it's not, &lt;strong&gt;what's the cleanest way to implement this?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="10948" LastActivityDate="2021-08-10T20:05:13.577" Title="One-time advice" Tags="|elisp|elisp-macros|advice|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26252" PostTypeId="2" ParentId="26250" CreationDate="2016-08-13T21:52:47.377" Score="-1" Body="&lt;p&gt;Forget about changing the lower limit for making any frame transparent, and forget about trying to force redisplay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All you want to do, apparently, is to toggle the selected frame between a minimum transparency value and a maximum one.  And apparently you want to be able to change those values easily anytime.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-max-transparency 100 &quot;...&quot;)&#xA;(defvar my-min-transparency 97 &quot;...&quot;)&#xA;&#xA;(defun toggle-transparency ()&#xA;  (interactive)&#xA;  (set-frame-parameter nil 'alpha&#xA;                       (let ((now  (frame-parameter nil 'alpha)))&#xA;                         (if (and now  (&amp;lt; now my-max-transparency))&#xA;                             my-max-transparency&#xA;                           my-min-transparency))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;M-: (setq my-min-transparency 42)&lt;/code&gt; or whatever.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom my-max-transparency 100 &quot;...&quot; :type 'integer)&#xA;(defcustom my-min-transparency 97  &quot;...&quot; :type 'integer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then use &lt;code&gt;M-x customize-option my-min-transparency&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-14T01:23:53.060" LastActivityDate="2016-08-14T01:23:53.060" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26253" PostTypeId="2" ParentId="9452" CreationDate="2016-08-13T22:16:34.463" Score="-1" Body="&lt;p&gt;Yeah you can see the &quot;todo&quot;  keyword to todo(!)  which will cause org to log the creation of the todo keyword &lt;/p&gt;&#xA;" OwnerUserId="12976" LastActivityDate="2016-08-13T22:16:34.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26254" PostTypeId="2" ParentId="16674" CreationDate="2016-08-13T22:39:55.250" Score="0" Body="&lt;p&gt;I believe the answer given by @EmacsUser is right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To better understand what's happening: Emacs has been around for&#xA;a &lt;em&gt;long&lt;/em&gt; time.  Back in the day, I/O (input/output) with&#xA;terminals was very slow.  Because Emacs is incredibly powerful,&#xA;it was enhanced so that output to the screen would wait for&#xA;internal processing to complete.  That's why your screen&#xA;&quot;freezes&quot; when you execute that macro you just defined with an&#xA;argument of 12345 -- Emacs is busy working on your buffer(s).&#xA;When it's done, Emacs will refresh the portions of your sreen&#xA;that need refreshing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Emacs starts up, it typically has a lot of things to do.&#xA;Unless one of those things blocks, screen updates are essentially&#xA;ignored (i.e. they're very low priority), so you won't see what's&#xA;happening behind the scenes until Emacs is done processing.&lt;/p&gt;&#xA;" OwnerUserId="12977" LastActivityDate="2016-08-13T22:39:55.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26255" PostTypeId="1" AcceptedAnswerId="26321" CreationDate="2016-08-13T22:52:22.083" Score="1" ViewCount="513" Body="&lt;p&gt;I am in the process of switching from Wanderlust to mu4e. I have multiple IMAP accounts and folders, and I used the &quot;contexts&quot; mechanism to configure each of them in their own specific ways. So far, everything is working fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is one feature of Wanderlust that I miss within mu4e: a &quot;Folder mode&quot; buffer. This is a buffer which contains a list of summary information for each active IMAP folder that I am dealing with. I can navigate from one folder to the next simply by selecting its line within this Folder mode buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Folder mode buffer looks like the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    - Email     :0/0/3745&#xA;        work        :0/0/190&#xA;        home        :0/0/803&#xA;        girlfriend  :0/0/2128&#xA;        misc        :0/0/624&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The numbers represent new, unread, and total messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone constructed anything similar that works under mu4e? It doesn't have to be exactly the same. Instead of folders, it could be a list of contexts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main thing I'm looking for is a list of folders or contexts that I can choose from, with some message counts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, at some point, I'm going to try to create such a thing for mu4e. But if something like this already exists, I don't want to go through the effort of reinventing the wheel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for any suggestions.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastActivityDate="2016-08-16T20:22:51.730" Title="mu4e - A &quot;Folder mode&quot; buffer?" Tags="|mu4e|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26256" PostTypeId="2" ParentId="26251" CreationDate="2016-08-14T00:54:34.687" Score="1" Body="&lt;p&gt;The code looks OK, actually (I would get rid of the call to &lt;code&gt;symbol-function&lt;/code&gt;, tho).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My crystal ball tells me that maybe you get bitten by dynamic scoping: your code relies on lexical-scoping for its use of &lt;code&gt;ad-sym&lt;/code&gt; from within the &lt;code&gt;lambda&lt;/code&gt;, so it's indispensable that &lt;code&gt;lexical-binding&lt;/code&gt; be non-nil in the code that &lt;em&gt;uses&lt;/em&gt; this macro.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-14T00:54:34.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26257" PostTypeId="1" AcceptedAnswerId="26259" CreationDate="2016-08-14T01:30:36.133" Score="2" ViewCount="220" Body="&lt;p&gt;If a function takes a parameter whose only significance is in whether it's nil or non-nil, is there any reason not to pass it a well-named symbol to clarify what's going on in the calling code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;add-to-list&lt;/code&gt; takes an optional APPEND argument, which if non-nil adds the element to the end of the list rather than the beginning. I could write,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list my-list &quot;x&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I think it would be clearer if I wrote&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list my-list &quot;x&quot; 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list my-list &quot;x&quot; :append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I like that last one best, but is that just not done? I could actually see it being confusing since it makes it look like a keyword argument and it's not really.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-08-14T01:37:16.287" Title="Can I pass an arbitrary symbol/keyword as a non-nil argument?" Tags="|functions|arguments|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26258" PostTypeId="2" ParentId="26257" CreationDate="2016-08-14T01:37:03.517" Score="2" Body="&lt;p&gt;Yes you can. You can use &lt;em&gt;any&lt;/em&gt; value which isn't &lt;code&gt;nil&lt;/code&gt; (noting that an empty list is the same thing as &lt;code&gt;nil&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's precisely why the docs invariably use that awkward &quot;non-nil&quot; wording.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-08-14T01:37:03.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26259" PostTypeId="2" ParentId="26257" CreationDate="2016-08-14T01:37:16.287" Score="5" Body="&lt;p&gt;No, there is no reason not to pass a non-&lt;code&gt;nil&lt;/code&gt; value that has some other meaning (to a human reader, if not to the executing code).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is common to do this, especially when there are multiple parameters, and especially if some are used in some call which are not used very often. That can help a (human) reader understand without needing to use &lt;code&gt;C-h f&lt;/code&gt; to consult the doc to see what a given parameter means.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use a quoted symbol - e.g. &lt;code&gt;'FOO&lt;/code&gt;. You can use a keyword symbol - e.g. &lt;code&gt;:FOO&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Beyond this documenting role, a function that you define can have different behaviors for different non-&lt;code&gt;nil&lt;/code&gt; values, and yet have all of those different values have something in common (or not), different from the behavior of a &lt;code&gt;nil&lt;/code&gt; value.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-14T01:37:16.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26260" PostTypeId="2" ParentId="26251" CreationDate="2016-08-14T02:43:00.167" Score="7" Body="&lt;p&gt;You don't need a macro for this.  And you don't need (but you can certainly use) lexical binding.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Without lexical binding:&#xA;;;&#xA;(defun advise-once (symbol where function &amp;amp;optional props)&#xA;  (advice-add symbol :after `(lambda (&amp;amp;rest _) (advice-remove ',symbol ',function)))&#xA;  (advice-add symbol where function props))&#xA;&#xA;;; With lexical binding:&#xA;;;&#xA;(defun advise-once (symbol where function &amp;amp;optional props)&#xA;  (advice-add symbol :after (lambda (&amp;amp;rest _) (advice-remove symbol function)))&#xA;  (advice-add symbol where function props))&#xA;&#xA;(advise-once 'backward-word :before (lambda (_) (message &quot;Eureka!&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason you do not need lexical binding is that you are interested, when the function (lambda form) is used, only in the &lt;strong&gt;values&lt;/strong&gt; of &lt;code&gt;symbol&lt;/code&gt; and &lt;code&gt;function&lt;/code&gt;, such as they were at the time the lambda-form list was created. You do not need &lt;strong&gt;variables&lt;/strong&gt; &lt;code&gt;symbol&lt;/code&gt; and &lt;code&gt;function&lt;/code&gt; when the lambda form is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The use of the backquote syntax &lt;em&gt;constructs a list&lt;/em&gt; that is a lambda form, where the &lt;strong&gt;values&lt;/strong&gt; of &lt;code&gt;symbol&lt;/code&gt; and &lt;code&gt;function&lt;/code&gt; have been substituted in place of those variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using lexical binding has the advantage that the lambda form can be compiled, because it is recognized by the compiler as a function, whereas in the case of using the backquote syntax all the compiler sees is code that constructs a list.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-14T02:48:30.663" LastActivityDate="2016-08-14T02:48:30.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26261" PostTypeId="1" AcceptedAnswerId="26265" CreationDate="2016-08-14T02:45:56.477" Score="4" ViewCount="335" Body="&lt;p&gt;This works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'clojure-mode)&#xA;(when (member 'clojure-mode my-packages)&#xA;  (define-clojure-indent&#xA;    (-&amp;gt; 1)&#xA;    (-&amp;gt;&amp;gt; 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This gives the error &lt;code&gt;Wrong type argument: listp, 1&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (member 'clojure-mode my-packages)&#xA;  (require 'clojure-mode)&#xA;  (define-clojure-indent&#xA;    (-&amp;gt; 1)&#xA;    (-&amp;gt;&amp;gt; 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's what I think is happening in the second version:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;define-clojure-indent&lt;/code&gt; is a macro &lt;a href=&quot;https://github.com/clojure-emacs/clojure-mode#indentation-of-macro-forms&quot; rel=&quot;nofollow&quot;&gt;defined by &lt;code&gt;clojure-mode&lt;/code&gt;&lt;/a&gt;, which is not loaded by default. So &lt;code&gt;define-clojure-indent&lt;/code&gt; is only defined after &lt;code&gt;(require 'clojure-mode)&lt;/code&gt; is evaluated.&lt;/li&gt;&#xA;&lt;li&gt;Since both the &lt;code&gt;require&lt;/code&gt; and the &lt;code&gt;define-clojure-indent&lt;/code&gt; call are in the same top-level form, all macroexpansion happens before any evaluation happens. This appears to be similar to the &lt;a href=&quot;https://technomancy.us/143&quot; rel=&quot;nofollow&quot;&gt;Gilardi scenario&lt;/a&gt; from Clojure.&lt;/li&gt;&#xA;&lt;li&gt;Both &lt;code&gt;-&amp;gt;&lt;/code&gt; and &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt; are macros &lt;a href=&quot;https://github.com/magnars/dash.el#--x-optional-form-rest-more&quot; rel=&quot;nofollow&quot;&gt;defined by &lt;code&gt;dash.el&lt;/code&gt;&lt;/a&gt;, which I also had loaded. They have the behavior that both of the forms &lt;code&gt;(-&amp;gt; 1)&lt;/code&gt; and &lt;code&gt;(-&amp;gt;&amp;gt; 1)&lt;/code&gt; expand to just &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It appears that since Emacs does its macroexpansion on the &lt;code&gt;define-clojure-indent&lt;/code&gt; form before it has loaded &lt;code&gt;clojure-mode&lt;/code&gt;, it does not yet know that &lt;code&gt;define-clojure-indent&lt;/code&gt; is actually a macro. Therefore, it goes ahead and macroexpands &lt;em&gt;recursively&lt;/em&gt;, transforming&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-clojure-indent&#xA;  (-&amp;gt; 1)&#xA;  (-&amp;gt;&amp;gt; 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-clojure-indent&#xA;  1&#xA;  1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;by interpreting &lt;code&gt;-&amp;gt;&lt;/code&gt; and &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt; as macros instead of simply unevaluated symbols.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When &lt;code&gt;clojure-mode&lt;/code&gt; is actually loaded and &lt;code&gt;define-clojure-indent&lt;/code&gt; is invoked as a macro, it throws an error because it expects its arguments to be lists, not integers.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Whereas in the first version, since the &lt;code&gt;require&lt;/code&gt; and &lt;code&gt;define-clojure-indent&lt;/code&gt; are in different top-level forms, by the time Emacs gets to macroexpanding the &lt;code&gt;define-clojure-indent&lt;/code&gt; form, it already knows that &lt;code&gt;define-clojure-indent&lt;/code&gt; is a macro, and doesn't try to do macroexpansion on its arguments. So &lt;code&gt;(-&amp;gt; 1)&lt;/code&gt; and &lt;code&gt;(-&amp;gt;&amp;gt; 1)&lt;/code&gt; are passed to &lt;code&gt;define-clojure-indent&lt;/code&gt; as lists of symbols, as I would expect, and everything works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is my question. If Emacs doesn't know whether or not something is a macro, &lt;em&gt;why would it do macroexpansion on the arguments&lt;/em&gt;? In this situation, it clearly produces unintended behavior. As far as I know, this would never happen in the Clojure macro system. And I can't think of any situation in which the current functionality would be desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely I am missing something here. Is there an elegant way to avoid this problem? Or do I have a fundamental misunderstanding?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(P.S. I am aware that I could use &lt;code&gt;eval-after-load&lt;/code&gt;. The same problem still occurs, but I used &lt;code&gt;require&lt;/code&gt; in the example because it was simpler. Full code—obviously not yet working, because of this and other errors—available &lt;a href=&quot;https://github.com/raxod502/dotfiles/blob/4a6d31edef74bdc208b1c47fbd655e37800aca5b/init.el#L453&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="12534" LastEditorUserId="12534" LastEditDate="2016-08-24T05:02:27.620" LastActivityDate="2016-08-24T05:02:27.620" Title="Deep eager macroexpansion" Tags="|elisp|elisp-macros|clojure|eval|require|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26262" PostTypeId="2" ParentId="26261" CreationDate="2016-08-14T03:26:34.077" Score="7" Body="&lt;p&gt;&lt;code&gt;(require &amp;lt;foo&amp;gt;)&lt;/code&gt; is treated specially when it's at top-level (it causes the compiler to require the file also, rather than only do the require at run-time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the &lt;code&gt;require&lt;/code&gt; is not performed at compilation time, then your code can't be compiled properly since the &lt;code&gt;define-clojure-indent&lt;/code&gt; macro won't be known during compilation, leading to mis-compilation, indeed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the byte-compiler never macro-expanded calls in args to something that is not known to be a function, then lots of existing code would break: all the warnings like &lt;code&gt;function &amp;lt;foo&amp;gt; is not known to be defined&lt;/code&gt; would turn into compilation errors.  We could do that, but lots of existing files would then fail to compile.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-08-14T04:24:57.790" LastActivityDate="2016-08-14T04:24:57.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26263" PostTypeId="1" AcceptedAnswerId="26264" CreationDate="2016-08-14T04:12:49.437" Score="2" ViewCount="866" Body="&#xA;&#xA;&lt;p&gt;I'm experimenting with making a major mode that does some simple syntax&#xA;highlighting.  My keywords are being highlighted just fine, but the&#xA;quoted string in the example below is also being highlighted (but not by&#xA;me).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar ct-mode-nset-keywords&#xA;  '(&quot;name&quot; &quot;type&quot; &quot;testme&quot; &quot;doc&quot;))&#xA;&#xA;(defvar ct-mode-nset-font-lock-defaults&#xA;      `((&#xA;         ;; highlight the second token on the name line&#xA;         (&quot;^name:[ \t]*\\([-a-zA-Z][a-zA-Z0-9]+\\)&quot;&#xA;          . (1 font-lock-function-name-face))&#xA;         ;; highlight all the other keywords&#xA;         ( ,(regexp-opt ct-mode-nset-keywords ) . font-lock-keyword-face)&#xA;         )))&#xA;&#xA;(defun ct-nset-mode ()&#xA;  &quot;Major mode for working with nameset files.&quot;&#xA;  (kill-all-local-variables)&#xA;  (setq major-mode 'ct-nset-mode)&#xA;  (setq mode-name &quot;MyMode&quot;)&#xA;  (set (make-local-variable 'font-lock-defaults)&#xA;       ct-mode-nset-font-lock-defaults))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is my sample buffer. My keywords (name, type, doc) all highlight as&#xA;expected. The second token on the name line also highlights as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that the quoted string on the third line is being&#xA;highlighted too (including the double quotes) by something.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;name: wonky&#xA;type: string&#xA;doc : &quot;this is a string&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the sample buffer, if I evaluate the variable font-lock-defaults, I&#xA;get the expected value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;font-lock-defaults&#xA;(((&quot;^name:[     ]*\\([-a-zA-Z][a-zA-Z0-9]+\\)&quot; 1&#xA;    font-lock-function-name-face)&#xA;(&quot;\\(?:doc\\|\\(?:nam\\|t\\(?:estm\\|yp\\)\\)e\\)&quot; &#xA;    . font-lock-keyword-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What code is font locking the quoted string?  (My mode line says &quot;MyMode&#xA;Abbrev&quot;), so I don't think any other modes are active. Thanks&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2016-08-14T04:18:02.310" LastActivityDate="2017-09-07T07:52:38.440" Title="What code is font locking quoted strings in my custom mode buffer?" Tags="|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26264" PostTypeId="2" ParentId="26263" CreationDate="2016-08-14T04:48:53.080" Score="6" Body="&lt;p&gt;This highlighting is syntactic font-lock highlighting.  It occurs when variable &lt;code&gt;font-lock-keywords-only&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.  This variable is normally set automatically by Font Lock mode based on the &lt;code&gt;KEYWORDS-ONLY&lt;/code&gt; element in ‘font-lock-defaults’.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Syntactic-Font-Lock.html&quot; rel=&quot;noreferrer&quot;&gt;Syntactic Font Lock&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As that node explains, your major mode can use the function specified by variable &lt;code&gt;syntax-propertize-function&lt;/code&gt; to apply&#xA;‘syntax-table’ text properties to override the buffer’s syntax table in&#xA;special cases.  (Syntactic highlighting uses the syntax table.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Basics.html&quot; rel=&quot;noreferrer&quot;&gt;Font Lock Basics&lt;/a&gt; of the Elisp manual for how to set variable &lt;code&gt;font-lock-keywords-only&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt; indirectly, by setting up the value of &lt;code&gt;font-lock-defaults&lt;/code&gt; so that it has a non-&lt;code&gt;nil&lt;/code&gt; &lt;code&gt;KEYWORDS-ONLY&lt;/code&gt; part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means just using a value such as &lt;code&gt;t&lt;/code&gt; as the second element of &lt;code&gt;font-lock-defaults&lt;/code&gt; -- just after the list of keywords for normal (non-syntactic) font-lock highlighting.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar ct-mode-nset-font-lock-defaults&#xA;  `(( ;; highlight the second token on the name line&#xA;     (&quot;^name:[ \t]*\\([-a-zA-Z][a-zA-Z0-9]+\\)&quot; . (1 font-lock-function-name-face))&#xA;     ;; highlight all the other keywords&#xA;     ( ,(regexp-opt ct-mode-nset-keywords ) . font-lock-keyword-face))&#xA;    t)) ;; &amp;lt;================ non-nil KEYWORDS-ONLY&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-14T04:55:59.177" LastActivityDate="2016-08-14T04:55:59.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26265" PostTypeId="2" ParentId="26261" CreationDate="2016-08-14T05:18:34.443" Score="4" Body="&lt;p&gt;@Stefan explained &lt;em&gt;why&lt;/em&gt; you see what you see: Your &lt;code&gt;require&lt;/code&gt; statement is not at top level of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;em&gt;solution&lt;/em&gt; to the byte-compiler not evaluating your (non top-level) &lt;code&gt;require&lt;/code&gt; statement is to force its evaluation, using &lt;strong&gt;&lt;code&gt;(eval-and-compile (require 'clojure-mode))&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that &lt;code&gt;require&lt;/code&gt; is evaluated by the byte-compiler when it is at top level is pointed out in the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html&quot; rel=&quot;nofollow&quot;&gt;Named Features&lt;/a&gt; (which I found by using &lt;strong&gt;&lt;code&gt;i require&lt;/code&gt;&lt;/strong&gt; in the manual).  There you see this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When &lt;code&gt;require&lt;/code&gt; is used at top level in a file, it takes effect when&#xA;  you byte-compile that file (*note Byte Compilation::) as well as when&#xA;  you load it.  This is in case the required package contains macros that&#xA;  the byte compiler must know about.  It also avoids byte compiler&#xA;  warnings for functions and variables defined in the file loaded with&#xA;  &lt;code&gt;require&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-14T05:18:34.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26266" PostTypeId="1" AcceptedAnswerId="26272" CreationDate="2016-08-14T08:37:15.743" Score="3" ViewCount="669" Body="&lt;p&gt;Every time I use &lt;code&gt;M-x magit-status b b&lt;/code&gt; to checkout a different branch, the projectile cache is of course out of date. I then use &lt;code&gt;M-x projectile-invalidate-cache&lt;/code&gt; to force projectile to rebuild its cache and that does work fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I automate this? I have no idea how to check which &lt;code&gt;magit-xyz&lt;/code&gt; command is triggered when using &lt;kbd&gt;b b&lt;/kbd&gt; in &lt;code&gt;magit-status&lt;/code&gt;. And even if I knew: How would I transparently &quot;overwrite&quot; that command to first call its previous definition and then &lt;code&gt;projectile-invalidate-cache&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="542" LastEditorUserId="306" LastEditDate="2016-08-31T10:41:59.507" LastActivityDate="2016-08-31T10:42:20.813" Title="Projectile and magit branch checkout" Tags="|magit|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26267" PostTypeId="2" ParentId="10822" CreationDate="2016-08-14T09:18:35.690" Score="1" Body="&lt;p&gt;You may also try something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-locale-environment &quot;en_AU&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your .emacs ini file&lt;/p&gt;&#xA;" OwnerUserId="2637" LastActivityDate="2016-08-14T09:18:35.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26268" PostTypeId="2" ParentId="10223" CreationDate="2016-08-14T10:01:48.523" Score="2" Body="&lt;p&gt;&lt;em&gt;For UNIX-like systems only.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In many cases the straightforward encoding definition in ~/.bashrc ~/bash_profile&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;LANG=en_EN.UTF8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;accomplished with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export LC_ALL=en_US.UTF-8&#xA;export LANG=en_US.UTF-8&#xA;export LANGUAGE=en_US.UTF-8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in ~/.profile should solve your issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P.S. After these corrections you need to RELOGIN in your session to allow changes become visible.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="11191" LastActivityDate="2016-08-14T10:01:48.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26269" PostTypeId="1" AcceptedAnswerId="26275" CreationDate="2016-08-14T10:22:55.990" Score="1" ViewCount="1949" Body="&lt;p&gt;I am following &lt;a href=&quot;http://tuhdo.github.io/c-ide.html&quot; rel=&quot;nofollow&quot;&gt;this tutorial&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When having enabled &lt;code&gt;company-node&lt;/code&gt; upon typing for instance &lt;code&gt;std::vec&lt;/code&gt; I get error message in the mini buffer saying:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;clang failed with error 1:&#xA;/usr/bin/clang -fsyntax-only -Xclang -code-completion-macros -x c++ -Xclang -code-completion-at=-:8:14 -&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However when I type just &lt;code&gt;vec&lt;/code&gt; and then hit tab, I get a correct completion to &lt;code&gt;std::vector&amp;lt;Class&amp;gt; var(10, Class());&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what might be going wrong with clang here?&lt;/p&gt;&#xA;" OwnerUserId="12978" LastActivityDate="2016-08-14T21:00:46.270" Title="company-mode clang error" Tags="|company-mode|completion|c++|xemacs|clang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26270" PostTypeId="1" CreationDate="2016-08-14T11:06:56.933" Score="1" ViewCount="193" Body="&lt;p&gt;Upon launching emacs, I get this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Warning: Cannot convert string &quot;-&lt;em&gt;-courier-medium-r-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-120-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-iso8859-*&quot; to type FontStruct&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Warning: Cannot convert string &quot;-&lt;em&gt;-helvetica-medium-r-&lt;/em&gt;--&lt;em&gt;-120-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-*-iso8859-1&quot; to type FontStruct&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, when I go to Options --&gt; Set Font/Fontset --&gt; Font menu, I get 3 submenus: Misc, Courier and Fontset. I clicked on every item in each submenu, but it didn't change the font. How do I change a font, mine is too small?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The operating system is SunOS 5.10.&lt;/p&gt;&#xA;" OwnerUserId="12966" LastEditorUserId="12966" LastEditDate="2016-08-14T11:24:50.233" LastActivityDate="2016-08-14T11:24:50.233" Title="Problem with changing fonts" Tags="|fonts|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26271" PostTypeId="1" AcceptedAnswerId="28777" CreationDate="2016-08-14T11:50:09.000" Score="2" ViewCount="125" Body="&lt;p&gt;I have a snippet called &lt;code&gt;struct&lt;/code&gt;.&#xA;And I write text &lt;code&gt;complex_struct&lt;/code&gt; in a snippet field. yasnippet will expand&#xA;&lt;code&gt;complex_struct&lt;/code&gt; with the snippet &lt;code&gt;struct&lt;/code&gt;. I have to move backward one&#xA;character to avoid this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I hope there is an indicator like make cursor change color to red, and style.&#xA;Or change text face etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the snippet code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: struct&#xA;# key: struct&#xA;# --&#xA;struct ${1:name} {&#xA;  $0&#xA;};&#xA;&#xA;&#xA;# -*- mode: snippet -*-&#xA;# name: complex_struct&#xA;# key: complex_struct&#xA;# --&#xA;complex struct ${1:name} {&#xA;  $0&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I type text like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;complex_struct|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The point is at position (&lt;code&gt;|&lt;/code&gt;).&#xA;It will be expanded from snippet &lt;code&gt;struct&lt;/code&gt; instead of &lt;code&gt;complex_struct&lt;/code&gt;. I don't&#xA;want to change yasnippet expand detect characters list. Just want to show which&#xA;text is expandable (Like &lt;code&gt;struct&lt;/code&gt; in this case). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a demo code to change cursor style dynamically:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; change cursor dynamically when prefix text is expandable.&#xA;(defun my-cursor-change-on-snippet ()&#xA;  ;; (yas-next-field-or-maybe-expand)&#xA;  (if (or yas-triggers-in-field ; FIXME: improve condition&#xA;          (yas-next-field-will-exit-p))&#xA;      (progn&#xA;        (set-cursor-color &quot;red&quot;)&#xA;        (setq cursor-type 'hollow))&#xA;    (set-cursor-color &quot;cyan&quot;)&#xA;    (setq cursor-type '(hbar . 2))&#xA;    )&#xA;  )&#xA;&#xA;(add-hook 'post-command-hook #'my-cursor-change-on-snippet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2016-10-03T12:16:49.197" LastActivityDate="2016-11-20T03:41:56.063" Title="add an indicator or annotation on filed which current input is expandable in yasnippet" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26272" PostTypeId="2" ParentId="26266" CreationDate="2016-08-14T12:50:21.413" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I have no idea how to check which magit-xyz command is triggered when using &lt;code&gt;b b&lt;/code&gt; in &lt;code&gt;magit-status&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Use &lt;kbd&gt;b ? b&lt;/kbd&gt; in &lt;code&gt;magit-status&lt;/code&gt;.  This tells you it runs &lt;code&gt;magit-checkout&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And even if I knew: How would I transparently &quot;overwrite&quot; that command to first call its previous definition and then &lt;code&gt;projectile-invalidate-cache&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Use advice:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun run-projectile-invalidate-cache (&amp;amp;rest _args)&#xA;  ;; We ignore the args to `magit-checkout'.&#xA;  (projectile-invalidate-cache nil))&#xA;(advice-add 'magit-checkout&#xA;            :after #'run-projectile-invalidate-cache)&#xA;(advice-add 'magit-branch-and-checkout ; This is `b c'.&#xA;            :after #'run-projectile-invalidate-cache)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another idea might be to use file notifications to invalidate the cache (this could work also if you did a checkout from the command line).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="306" LastEditDate="2016-08-31T10:42:20.813" LastActivityDate="2016-08-31T10:42:20.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26273" PostTypeId="1" CreationDate="2016-08-14T13:50:39.463" Score="1" ViewCount="854" Body="&lt;p&gt;I'm using contexts within mu4e, and I know how to add custom headers via the &lt;code&gt;mu4e-header-info-custom&lt;/code&gt; list.&lt;/p&gt;&#xA;&lt;p&gt;What I'd like to do, however, is to alter existing headers when replying or composing within certain contexts.&lt;/p&gt;&#xA;&lt;p&gt;Here's one example: if I reply to a message that matches one of these special contexts, I'd like the &lt;code&gt;To:&lt;/code&gt; header to be automatically changed to a different address, or to add additional addresses to the &lt;code&gt;To:&lt;/code&gt; line.&lt;/p&gt;&#xA;&lt;p&gt;Suppose the sender is sender@domain.com. If I reply to the message, I'd like the &lt;code&gt;To:&lt;/code&gt; line to automatically be changed to:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;To: newuser@domain.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;... or even perhaps to ...&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;To: sender@domain.com, newuser1@domain.com, newuser2@domain.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I might want to automatically change other existing headers, as well, such as &lt;code&gt;Subject:&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Is there any way to do this in mu4e?&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="105" LastEditDate="2020-06-17T15:03:21.900" LastActivityDate="2024-02-27T21:04:15.613" Title="mu4e - Changing existing headers" Tags="|mu4e|header-line|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="26274" PostTypeId="1" CreationDate="2016-08-14T15:30:48.057" Score="5" ViewCount="2191" Body="&lt;p&gt;Seems like most major modes clear all local variables before initializing. It also seems like many major modes read variables while initializing to customize their behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to set a file or directory local variable to determine major mode behavior (for example, overwriting &lt;a href=&quot;http://web-mode.org/&quot; rel=&quot;nofollow&quot;&gt;web mode's&lt;/a&gt; &lt;code&gt;web-mode-engines-alist&lt;/code&gt; in &lt;code&gt;.dir-locals.el&lt;/code&gt;), how can it be done so that the local variables are written before the major mode actually initializes, but are not cleared?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to do it would be to bind/rebind global variables using &lt;code&gt;((nil . ((eval . ((lambda () (setq name val)))))))&lt;/code&gt; in &lt;code&gt;.dir-locals.el&lt;/code&gt;. The &lt;code&gt;nil&lt;/code&gt; key seems to run before any major-modes are entered. Still, it doesn't seem ideal to overwrite global config. For example, maybe I want to work on multiple projects in the same emacs instance.&lt;/p&gt;&#xA;" OwnerUserId="12979" LastEditorUserId="12979" LastEditDate="2016-08-16T09:41:58.807" LastActivityDate="2016-09-28T23:27:48.703" Title="How to customize major mode initialization with local variables?" Tags="|major-mode|local-variables|directory-local-variables|buffer-local|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26275" PostTypeId="2" ParentId="26269" CreationDate="2016-08-14T16:00:42.290" Score="1" Body="&lt;p&gt;I had this error recently, too.&#xA;I think you could solve it with some clang-flags in the company-clang-arguments user option. You have to specify your Include-Paths and the Library-Paths and link the required libraries. Here it's the standard-library, so you have to edit company-clang-executable from clang to clang++!&#xA;But i use Atila Neves' c-make-ide. I can recommend that. You have to write a CMakeLists.txt and specify here the include-paths and libs.&#xA;Then call cmake-ide-setup and everything is configured.&#xA;I call it via hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-tobi&lt;/p&gt;&#xA;" OwnerUserId="12841" LastEditorUserId="12841" LastEditDate="2016-08-14T21:00:46.270" LastActivityDate="2016-08-14T21:00:46.270" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26276" PostTypeId="1" AcceptedAnswerId="26282" CreationDate="2016-08-14T16:03:48.000" Score="2" ViewCount="372" Body="&lt;p&gt;I'm trying to learn about font locking in my own custom major modes. I can get things working fine for the most part, keywords highlighted, &lt;code&gt;regexp-opt&lt;/code&gt; matching strings, using capture groups within a regexp to highlight just the capture group, etc.&lt;/p&gt;&#xA;&lt;p&gt;But I've noticed that some of the faces that I have tried (such as &lt;code&gt;dired-directory&lt;/code&gt;) do not work in font lock expressions, even though other faces such as &lt;code&gt;font-lock-keyword-face&lt;/code&gt; work fine in the same slot.&lt;/p&gt;&#xA;&lt;p&gt;Reading the manual says that face variables should be faces that have a value property that evaluates to the face name. Sure enough, when I eval &lt;code&gt;font-lock-keyword-face&lt;/code&gt;, the value is the same as the face name. But when I eval &lt;code&gt;dired-directory&lt;/code&gt; face, its value is &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So it looks like the value &lt;code&gt;nil&lt;/code&gt; is the proximal cause of the problem, and the answer to my question (kind of). But it's not really a good answer.&lt;/p&gt;&#xA;&lt;p&gt;(1) Why doesn't the &lt;code&gt;dired-directory&lt;/code&gt; face that I see listed with &lt;code&gt;list-faces-display&lt;/code&gt; have a value the same as the face name?&lt;/p&gt;&#xA;&lt;p&gt;(2) How can any mode use the face, if the font lock implementation requires that the face name symbol evaluates to the face name, when &lt;code&gt;dired-directory&lt;/code&gt; face does not?&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/3584/how-do-i-specify-a-custom-face-with-font-lock-defaults&quot;&gt;Here is a link&lt;/a&gt; in SX that touches on the same subject, but it mentions that the solution might be obsolete.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here is my code line that motivated the problem.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; ( ,(regexp-opt ct-mode-nset-keywords ) . font-lock-keyword-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;(1) Using &lt;code&gt;font-lock-keyword-face&lt;/code&gt; (with no quote) works. (2) Using &lt;code&gt;dired-directory&lt;/code&gt; (with no quote) fails. (3) Thanks to @theldoria, using &lt;code&gt;'dired-directory&lt;/code&gt; (with quote) works.&lt;/p&gt;&#xA;&lt;p&gt;Here is what the manual says:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;22.6.7 Faces for Font Lock&lt;/p&gt;&#xA;&lt;p&gt;Font Lock mode can highlight using any face, but Emacs defines several faces specifically for Font Lock to use to highlight text. These Font Lock faces are listed below. They can also be used by major modes for syntactic highlighting outside of Font Lock mode (see Major Mode Conventions).&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Each of these symbols is both a face name, and a variable whose default value is the symbol itself&lt;/em&gt;. Thus, the default value of font-lock-comment-face is font-lock-comment-face.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Thank you to everyone who responded -- I have a working syntax to use going forward. And sorry for the confusion using &lt;code&gt;dired-directory&lt;/code&gt; as my example - it is both a face and a separate variable holding a directory (or nil). It would have been better for me to use &lt;code&gt;dired-flagged&lt;/code&gt; or some other face from &lt;code&gt;list-faces-display&lt;/code&gt;, which trigger a &lt;code&gt;void variable&lt;/code&gt; error instead of nil.&lt;/p&gt;&#xA;&lt;p&gt;But now I'm wondering if the face-symbol-with-variable-value model is somehow old or obsolete, even if it is in the manual. Font lock apparently &lt;em&gt;requires&lt;/em&gt; that variable value one way or another (eg with a 'quoted-face-name), but other faces in the &lt;code&gt;list-faces-display&lt;/code&gt; do not have that value property (eg. dired-flagged, avy-lead-face, etc).&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-08-14T23:14:03.710" Title="Why do some faces not work with font lock mode expressions?" Tags="|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26277" PostTypeId="1" AcceptedAnswerId="26279" CreationDate="2016-08-14T17:03:55.760" Score="6" ViewCount="1152" Body="&lt;p&gt;Whenever I delete a file that I no longer need in emacs using &lt;code&gt;delete-file&lt;/code&gt; command, the buffer associated with the file is still open in emacs. Is there a way I can change this behaviour so that whenever I delete a file, the buffer associated with it is also automatically deleted.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="253" LastEditDate="2016-08-14T17:54:40.060" LastActivityDate="2016-08-14T18:04:04.950" Title="How to make emacs automatically kill buffer after invoking delete-file command?" Tags="|buffers|files|commands|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26278" PostTypeId="2" ParentId="26277" CreationDate="2016-08-14T17:32:05.933" Score="2" Body="&lt;p&gt;You could use this function instead of &lt;code&gt;delete-file&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-file-kill-buffer (filename)&#xA;  &quot;Delete the file buffer is visiting and kill the buffer.&quot;&#xA;  (interactive &quot;fFile name: &quot;)&#xA;  (progn&#xA;    (delete-file filename)&#xA;    (message &quot;Deleted file %s&quot; filename)&#xA;    (when (find-buffer-visiting filename)&#xA;      (kill-buffer (find-buffer-visiting filename)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-08-14T17:43:14.640" LastActivityDate="2016-08-14T17:43:14.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26279" PostTypeId="2" ParentId="26277" CreationDate="2016-08-14T18:04:04.950" Score="7" Body="&lt;p&gt;I wrote this method, which differs slightly from the one in the other answer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun delete-file-visited-by-buffer (buffername)&#xA;  &quot;Delete the file visited by the buffer named BUFFERNAME.&quot;&#xA;  (interactive &quot;b&quot;)&#xA;  (let* ((buffer (get-buffer buffername))&#xA;         (filename (buffer-file-name buffer)))&#xA;    (when filename&#xA;      (delete-file filename)&#xA;      (kill-buffer-ask buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you have the buffer open in Emacs, I find it easier to specify the buffer to delete, mainly because Emacs defaults to the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if point is in the buffer you want to delete, you can just hit enter, rather than having to type in the filename you want to delete.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-08-14T18:04:04.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26280" PostTypeId="1" AcceptedAnswerId="26281" CreationDate="2016-08-14T18:21:18.747" Score="3" ViewCount="465" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I delete a marker after it has been created?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see how to create markers and how to move markers, but I see nothing in the manual about how to delete them:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Creating:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Markers.html#Creating-Markers&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Markers.html#Creating-Markers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Moving:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Moving-Markers.html#Moving-Markers&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Moving-Markers.html#Moving-Markers&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-08-14T18:32:21.787" Title="How to delete a marker" Tags="|marker|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26281" PostTypeId="2" ParentId="26280" CreationDate="2016-08-14T18:32:21.787" Score="3" Body="&lt;p&gt;Markers that point nowhere are garbage-collected.  From the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Overview-of-Markers.html&quot; rel=&quot;nofollow&quot;&gt;Overview of Markers&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Insertion and deletion in a buffer must check all the markers and&#xA;  relocate them if necessary.  This slows processing in a buffer with a&#xA;  large number of markers.  For this reason, it is a good idea to make a&#xA;  marker point nowhere if you are sure you don’t need it any more.&#xA;  Markers that can no longer be accessed are eventually removed (*note&#xA;  Garbage Collection::).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To make a marker point nowhere, use &lt;code&gt;set-marker&lt;/code&gt; to set it to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-marker my-marker nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is that not enough for you? Can you explain why you want to explicitly (i.e., immediately) delete a marker?&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-14T18:32:21.787" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26282" PostTypeId="2" ParentId="26276" CreationDate="2016-08-14T18:41:48.977" Score="3" Body="&lt;p&gt;Variable &lt;code&gt;dired-directory&lt;/code&gt; does not have face &lt;code&gt;dired-directory&lt;/code&gt; as its value.  Instead, it has a directory as its value (as you can see by &lt;code&gt;C-h v dired-directory&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, faces are not associated with variables; that is, there is no variable whose value is a given face.  And it is generally recommended not to create and use a face-valued variable, just to be able to use its face.  Use the face directly, instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example, if you want to refer to face &lt;code&gt;dired-directory&lt;/code&gt; then simply refer to that symbol.  In most contexts this means passing the quoted symbol, so that evaluation returns the symbol: &lt;strong&gt;&lt;code&gt;'dired-directory&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just remember the general rule that you should never (or nearly never) need to refer to a face-valued variable, just in order to refer to its (face) value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some older parts of Emacs, including font lock, there are still some face-valued variables, and this can confuse things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another, more legitimate use of a face-valued variable is a user option, whose value is intended to be changed (customized) from one face to another. In this case, the option name typically is &lt;strong&gt;not&lt;/strong&gt;, and generally should &lt;strong&gt;not&lt;/strong&gt; be, the name of any given face.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-14T18:41:48.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26283" PostTypeId="2" ParentId="26274" CreationDate="2016-08-14T18:48:02.960" Score="3" Body="&lt;p&gt;If you want to set a buffer-local value for a given mode, do so after the mode has been established. You do that by putting the value-assignment on the mode hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you want to set local variable foo to 42 in &lt;code&gt;lisp-mode&lt;/code&gt; then do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'lisp-mode (lambda () (setq-local fill-paragraph-function  'my-fill-para)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or better yet, since it facilitates programmatic access, including use of &lt;code&gt;remove-hook&lt;/code&gt;, use a named function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-set-lisp-fill () (setq-local fill-paragraph-function  'my-fill-para))&#xA;&#xA;(add-hook 'lisp-mode 'my-set-lisp-fill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-15T01:12:25.077" LastActivityDate="2016-08-15T01:12:25.077" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26285" PostTypeId="1" AcceptedAnswerId="26299" CreationDate="2016-08-14T20:02:01.913" Score="1" ViewCount="610" Body="&lt;p&gt;I am learning about the kivy library for python. I have a test code which i run with &lt;code&gt;C-u C-c C-c&lt;/code&gt; after having the python interpreter fired up with &lt;code&gt;C-p&lt;/code&gt;. It runs fine the first time and the window opens, but trying to run it a second time makes nothing happen; the window doesn't show, only in the minibuffer below i see &lt;code&gt;Sent: import kivy&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import kivy&#xA;kivy.require(kivy.__version__)&#xA;from kivy.app import App&#xA;from kivy.uix.label import Label&#xA;&#xA;class MyApp(App):&#xA;        def build(self):&#xA;                return Label(text = &quot;Guido Van Rossum&quot;, font_size = 90)&#xA;&#xA;def main():&#xA;        MyApp().run()&#xA;&#xA;if __name__ == &quot;__main__&quot;:&#xA;        main()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone have experience with writing kivy using emacs, or can any one help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what i get in the terminal the second time i run the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; [INFO              ] [Base        ] Start application main loop&#xA;[ERROR             ] [Base        ] No event listeners have been created&#xA;[ERROR             ] [Base        ] Application will leave&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user12021" LastEditorDisplayName="user12021" LastEditDate="2016-08-14T21:05:14.010" LastActivityDate="2020-05-16T17:32:05.430" Title="Running kivy code in Emacs" Tags="|python|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26286" PostTypeId="1" AcceptedAnswerId="26292" CreationDate="2016-08-14T20:08:41.020" Score="1" ViewCount="237" Body="&lt;p&gt;Xah Lee wrote (some time ago) the following function that toggles the letter-case of the selected region or the current word.  When toggling to initial caps, some words should not be capitalized such as &lt;code&gt;and&lt;/code&gt;, &lt;code&gt;or&lt;/code&gt;, &lt;code&gt;for&lt;/code&gt;, and perhaps some custom words like &lt;code&gt;to&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can &lt;code&gt;toggle-letter-case&lt;/code&gt; be modified to exclude select words (e.g., from a list of custom words) when making &lt;em&gt;initial caps&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Scenario #1 -- all uppercase&lt;/strong&gt;:  FOO TO BAR FOR BAZ; AND, APPLE TO ORANGE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Scenario #2 -- all lowercase&lt;/strong&gt;:  foo to bar for baz; and, apple to orange&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Initial Caps -- Desired Result&lt;/strong&gt;:  Foo to Bar for Baz; and, Apple to Orange&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-letter-case ()&#xA;  &quot;Toggle the letter case of current word or text selection.&#xA;  Toggles between: “all lower”, “Init Caps”, “ALL CAPS”.&quot;&#xA;(interactive)&#xA;  (let ((deactivate-mark nil)&#xA;        (case-fold-search nil)&#xA;        p1 p2)&#xA;   (if (region-active-p)&#xA;       (setq p1 (region-beginning) p2 (region-end))&#xA;     (let ((bds (bounds-of-thing-at-point 'word)))&#xA;       (setq p1 (car bds) p2 (cdr bds))))&#xA;   (when (not (eq last-command this-command))&#xA;     (save-excursion&#xA;       (goto-char p1)&#xA;       (cond&#xA;        ((looking-at &quot;[[:lower:]][[:lower:]]&quot;) (put this-command 'state &quot;all lower&quot;))&#xA;        ((looking-at &quot;[[:upper:]][[:upper:]]&quot;) (put this-command 'state &quot;all caps&quot;))&#xA;        ((looking-at &quot;[[:upper:]][[:lower:]]&quot;) (put this-command 'state &quot;init caps&quot;))&#xA;        ((looking-at &quot;[[:lower:]]&quot;) (put this-command 'state &quot;all lower&quot;))&#xA;        ((looking-at &quot;[[:upper:]]&quot;) (put this-command 'state &quot;all caps&quot;))&#xA;        (t (put this-command 'state &quot;all lower&quot;)))))&#xA;   (cond&#xA;    ((string= &quot;all lower&quot; (get this-command 'state))&#xA;     (upcase-initials-region p1 p2) (put this-command 'state &quot;init caps&quot;))&#xA;    ((string= &quot;init caps&quot; (get this-command 'state))&#xA;     (upcase-region p1 p2) (put this-command 'state &quot;all caps&quot;))&#xA;    ((string= &quot;all caps&quot; (get this-command 'state))&#xA;     (downcase-region p1 p2) (put this-command 'state &quot;all lower&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorDisplayName="user8748" LastEditDate="2019-01-26T20:28:25.707" LastActivityDate="2019-01-26T20:28:25.707" Title="Toggle letter case -- exclude custom words from a list" Tags="|words|capitalization|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26287" PostTypeId="1" AcceptedAnswerId="26340" CreationDate="2016-08-14T20:23:20.530" Score="4" ViewCount="1028" Body="&lt;p&gt;I just started with Org-mode today and noticed whenever I press &lt;code&gt;C-a&lt;/code&gt; on a heading, the cursor is moved all the way to the beginning of the line instead of the first character in the heading. &#xA;Like so :-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;* This i|s a heading.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;after pressing &lt;code&gt;C-a&lt;/code&gt;, the cursor moves like so :-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;|* This is a heading.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want &lt;code&gt;C-a&lt;/code&gt; to move the cursor like so :- &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;* |This is a heading.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is pretty minor quirk, but I've bound &lt;code&gt;C-a&lt;/code&gt; to the below function (I don't remember where I got this from) and I'd want the behvaior of it to be consistent across all emacs modes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun smarter-move-beginning-of-line (arg)&#xA;  (interactive &quot;^p&quot;)&#xA;  (setq arg (or arg 1))&#xA;&#xA;  (when (/= arg 1)&#xA;    (let ((line-move-visual nil))&#xA;      (forward-line (1- arg))))&#xA;&#xA;  (let ((orig-point (point)))&#xA;    (back-to-indentation)&#xA;    (when (= orig-point (point))&#xA;      (move-beginning-of-line 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with Org-mode heading is, we use asterisks to indicate heading levels ( * -&gt; level 1, ** -&gt; level 2, and so on,) and they HAVE to be entered as the first character on the line and all these commands which move to the beginning of the line think the indentation level is the first character of the line. The solution should be pretty simple, but sadly I haven't learned elisp as of yet. All we have to do is :-&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;identify if the line is a heading or not.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if so, ignore all the asterisks and move forward by one character &lt;/li&gt;&#xA;&lt;li&gt;if not, invoke the smart-beginning-of-line command I mentioned in the post.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-08-14T21:30:43.187" LastActivityDate="2016-08-17T13:36:32.647" Title="Move to the beginning of a heading smartly in Org-mode" Tags="|org-mode|commands|cursor|motion|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26288" PostTypeId="2" ParentId="26287" CreationDate="2016-08-14T21:05:48.200" Score="1" Body="&lt;p&gt;This is a slight modification of commands &lt;code&gt;to-indentation-repeat-backward&lt;/code&gt; and &lt;code&gt;to-indentation-repeat-forward&lt;/code&gt;, from library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/misc-cmds.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;misc-cmds.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;em&gt;repeat&lt;/em&gt; these commands, to continue moving the same way on the previous (if backward) or next (if forward) line.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun to-org-indentation-repeat-backward ()&#xA;  &quot;Move to the first non-whitespace, non-* char on this line, or eol if none.&#xA;If already there then do the same on the previous line.&quot;&#xA;  (interactive &quot;^&quot;)&#xA;  (let ((opt  (point)))&#xA;    (back-to-indentation)&#xA;    ;;(while (eq ?* (char-after))&#xA;    (when (looking-at &quot;[*]+.&quot;) (goto-char (match-end 0)))&#xA;    (when (= opt (point))&#xA;      (forward-line -1)&#xA;      (back-to-indentation)&#xA;      (when (looking-at &quot;[*]+.&quot;) (goto-char (match-end 0))))))&#xA;&#xA;(defun to-org-indentation-repeat-forward ()&#xA;  &quot;Move to the first non-whitespace, non-* char on this line, or eol if none.&#xA;If already there do the same on the next line.&quot;&#xA;  (interactive &quot;^&quot;)&#xA;  (let ((opt  (point)))&#xA;    (back-to-indentation)&#xA;    (when (looking-at &quot;[*]+.&quot;) (goto-char (match-end 0)))&#xA;    (when (= opt (point))&#xA;      (forward-line 1)&#xA;      (back-to-indentation)&#xA;      (when (looking-at &quot;[*]+.&quot;) (goto-char (match-end 0))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-14T21:58:59.890" LastActivityDate="2016-08-14T21:58:59.890" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26289" PostTypeId="1" CreationDate="2016-08-14T21:48:59.003" Score="1" ViewCount="562" Body="&lt;p&gt;I want to enable visual-line-mode for use with org-column-view, so that the text under each headline wraps underneath. Here is a sample &quot;shopping list&quot; to illustrate what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iOaov.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iOaov.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice how the item's description extends to the full width of the buffer but wraps for readability. I was able to get this to work by calling &lt;code&gt;visual-line-mode&lt;/code&gt; after I ran column view. So I would love to find a hook that lets me load this from init, something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq 'org-column-view-hook 'visual-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can't find an &lt;code&gt;org-column-view-hook&lt;/code&gt; though..?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also noticed that if I make any changes to the view (e.g., hitting &quot;&amp;lt;&quot; or &quot;&gt;&quot; to adjust the column width) then visual-line-mode is immediately disabled... anyway ideas on how to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-08-14T22:49:45.413" LastActivityDate="2016-08-14T22:49:45.413" Title="Org column-view with visual-line-mode?" Tags="|org-mode|wrapping|visual-line-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26290" PostTypeId="1" CreationDate="2016-08-14T22:05:26.390" Score="2" ViewCount="468" Body="&lt;p&gt;I've got this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{align}&#xA;n &amp;amp;= 0 \\&#xA;n &amp;amp;= m + 1&#xA;\end{align}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in an org-mode buffer. When I produce a Latex output, the numbering &lt;code&gt;n = 0     (1)&lt;/code&gt; etc. is properly placed on the right. But an HTML output places the numbering on the left. What do I need to do to have both HTML and Latex output place the equation numbering off to the right? One Latex tip was to include &lt;code&gt;\documentclass[12pt,oneside,reqno]{amsart}&lt;/code&gt; where the &lt;code&gt;reqno&lt;/code&gt; is apparently the key addition. I'm not sure how to include this in an org-mode file.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="8349" LastEditDate="2016-08-14T22:12:07.953" LastActivityDate="2016-09-15T17:03:54.387" Title="Latex equation numbering on left instead of right with org-mode output" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26291" PostTypeId="1" AcceptedAnswerId="26303" CreationDate="2016-08-14T22:50:41.643" Score="2" ViewCount="714" Body="&lt;p&gt;I set up habits in org mode and using &lt;code&gt;C-k&lt;/code&gt; to toggle the habits on/off in the normal agenda is working fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in my custom agenda (taken from Bernt Hansen GTD implementation &lt;a href=&quot;http://doc.norang.ca/org-mode.html#CustomAgendaViewSetup&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;) I get the following error when using &lt;code&gt;C-k&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Not allowed in tags-type agenda buffers&quot;)&#xA;signal(error (&quot;Not allowed in tags-type agenda buffers&quot;))&#xA;error(&quot;Not allowed in %s-type agenda buffers&quot; tags)&#xA;org-agenda-check-type(t agenda)&#xA;org-habit-toggle-habits()&#xA;call-interactively(org-habit-toggle-habits nil nil)&#xA;command-execute(org-habit-toggle-habits)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same is true for changing week and day view:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Not allowed in tags-type agenda buffers&quot;)&#xA;signal(error (&quot;Not allowed in tags-type agenda buffers&quot;))&#xA;error(&quot;Not allowed in %s-type agenda buffers&quot; tags)&#xA;org-agenda-check-type(t agenda)&#xA;org-agenda-change-time-span(week nil)&#xA;org-agenda-week-view(nil)&#xA;call-interactively(org-agenda-week-view nil nil)&#xA;command-execute(org-agenda-week-view)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any hints on how to toggle habits in the custom agenda? Or why is toggling not possible in tags-type agendas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way I am using spacemacs 0.105.21 (emacs 24.5.1)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The solution is to change &lt;code&gt;(agenda &quot;&quot; nil)&lt;/code&gt; to &lt;code&gt;(agenda &quot;&quot;)&lt;/code&gt;.&#xA;Here is a part of the custom agenda:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      (quote ((&quot;N&quot; &quot;Notes&quot; tags &quot;NOTE&quot;&#xA;               ((org-agenda-overriding-header &quot;Notes&quot;)&#xA;                (org-tags-match-list-sublevels t)))&#xA;              (&quot;h&quot; &quot;Habits&quot; tags-todo &quot;STYLE=\&quot;habit\&quot;&quot;&#xA;               ((org-agenda-overriding-header &quot;Habits&quot;)&#xA;                (org-agenda-sorting-strategy&#xA;                 '(todo-state-down effort-up category-keep))))&#xA;              (&quot; &quot; &quot;Agenda&quot;&#xA;               ((agenda &quot;&quot;)      ;; delete nil&#xA;                (tags &quot;REFILE&quot;&#xA;                      ((org-agenda-overriding-header &quot;Tasks to Refile&quot;)&#xA;                       (org-tags-match-list-sublevels nil)))&#xA;                (tags-todo &quot;-CANCELLED/!&quot;&#xA;                           ((org-agenda-overriding-header &quot;Stuck Projects&quot;)&#xA;                            (org-agenda-skip-function 'bh/skip-non-stuck-projects)&#xA;                            (org-agenda-sorting-strategy&#xA;                             '(category-keep))))&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to @elethan&lt;/p&gt;&#xA;" OwnerUserId="12637" LastEditorUserId="12637" LastEditDate="2016-08-15T16:30:19.533" LastActivityDate="2016-08-15T16:30:19.533" Title="&quot;Not allowed in tags-type agenda&quot; using custom agenda" Tags="|org-mode|org-agenda|org-habit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26292" PostTypeId="2" ParentId="26286" CreationDate="2016-08-14T23:15:13.870" Score="0" Body="&lt;p&gt;Special thanks to @politza for &lt;code&gt;(regexp-opt WORDS 'words)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-letter-case ()&#xA;&quot;Initially written by Xah Lee, and slightly modified by @lawlist.&#xA;Toggle the letter case of current word or text selection.&#xA;Toggles between: “all lower”, “Init Caps”, “ALL CAPS”.&#xA;As to initial-capitals, do not capitalize hard-coded list of words.&quot;&#xA;(interactive)&#xA;  (let ((deactivate-mark nil)&#xA;        (case-fold-search nil)&#xA;        (regexp-exclusion (regexp-opt '(&quot;and&quot; &quot;for&quot; &quot;or&quot; &quot;to&quot;) 'words))&#xA;        p1 p2)&#xA;   (if (region-active-p)&#xA;       (setq p1 (region-beginning) p2 (region-end))&#xA;     (let ((bds (bounds-of-thing-at-point 'word)))&#xA;       (setq p1 (car bds) p2 (cdr bds))) )&#xA;   (when (not (eq last-command this-command))&#xA;     (save-excursion&#xA;       (goto-char p1)&#xA;       (cond&#xA;        ((looking-at &quot;[[:lower:]][[:lower:]]&quot;) (put this-command 'state &quot;all lower&quot;))&#xA;        ((looking-at &quot;[[:upper:]][[:upper:]]&quot;) (put this-command 'state &quot;all caps&quot;))&#xA;        ((looking-at &quot;[[:upper:]][[:lower:]]&quot;) (put this-command 'state &quot;init caps&quot;))&#xA;        ((looking-at &quot;[[:lower:]]&quot;) (put this-command 'state &quot;all lower&quot;))&#xA;        ((looking-at &quot;[[:upper:]]&quot;) (put this-command 'state &quot;all caps&quot;))&#xA;        (t (put this-command 'state &quot;all lower&quot;)))))&#xA;   (cond&#xA;    ((string= &quot;all lower&quot; (get this-command 'state))&#xA;      (upcase-initials-region p1 p2)&#xA;      (put this-command 'state &quot;init caps&quot;)&#xA;      (let ((case-fold-search t))&#xA;        (save-excursion&#xA;          (goto-char p1)&#xA;            (while (re-search-forward regexp-exclusion p2 t)&#xA;              (replace-match (downcase (match-string 0)) t)))))&#xA;    ((string= &quot;init caps&quot; (get this-command 'state))&#xA;     (upcase-region p1 p2) (put this-command 'state &quot;all caps&quot;))&#xA;    ((string= &quot;all caps&quot; (get this-command 'state))&#xA;     (downcase-region p1 p2) (put this-command 'state &quot;all lower&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-08-14T23:42:22.173" LastActivityDate="2016-08-14T23:42:22.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26293" PostTypeId="1" CreationDate="2016-08-15T01:23:19.030" Score="1" ViewCount="130" Body="&lt;p&gt;I have customized &lt;code&gt;tabbar&lt;/code&gt; to have a custom face for &lt;code&gt;tabbar-selected-modified&lt;/code&gt;. The customizations work nicely for displaying the &quot;modified&quot; status of a buffer, and reverts to the default face when the buffer is saved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now trying to extend &lt;code&gt;after-save-hook&lt;/code&gt; to automatically compile LaTeX files on save. This also works correctly. But the problem is that the tabbar status (which was &quot;modified&quot; before I saved the buffer) for the buffer does not change back to the default (i.e., the buffer is saved) face. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code snippet that can be used to reproduce the problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(setq package-user-dir (expand-file-name &quot;~/.emacs.d/elpa/&quot;)&#xA;      package-enable-at-startup nil)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;(eval-when-compile&#xA;  (require 'use-package))&#xA;&#xA;(use-package tabbar&#xA;  :ensure t&#xA;  :preface&#xA;  (defun tabbar-modification-state-change ()&#xA;    (tabbar-set-template tabbar-current-tabset nil)&#xA;    (tabbar-display-update))&#xA;&#xA;  (defun tabbar-on-buffer-modification ()&#xA;    (set-buffer-modified-p t)&#xA;    (tabbar-modification-state-change))&#xA;  :init (tabbar-mode 1)&#xA;  :config&#xA;  (add-hook 'after-save-hook #'tabbar-modification-state-change)&#xA;  (add-hook 'after-revert-hook #'tabbar-modification-state-change)&#xA;  (add-hook 'first-change-hook #'tabbar-on-buffer-modification)&#xA;&#xA;  (set-face-attribute 'tabbar-selected-modified nil&#xA;                      :background &quot;#f2f2f6&quot;&#xA;                      :foreground &quot;dark green&quot;&#xA;                      :box '(:line-width 1 :color &quot;black&quot; :style sunken)&#xA;                      :height 1.3&#xA;                      :bold t&#xA;                      :underline nil))&#xA;&#xA;(use-package tex-site ; Initialize auctex&#xA;  :ensure auctex&#xA;  :mode (&quot;\\.tex\\'&quot; . LaTeX-mode))&#xA;&#xA;(use-package tex-buf ; Requires tex and latex&#xA;  :config&#xA;  (setq TeX-auto-save t ; Enable parse on save, stores parsed information in an &quot;auto&quot; directory&#xA;        TeX-save-query nil)&#xA;  (setq-default TeX-master nil))&#xA;&#xA;(use-package tex-mode&#xA;  :init (setq latex-run-command &quot;latexmk&quot;))&#xA;&#xA;(use-package auctex-latexmk&#xA;  :ensure t&#xA;  :config&#xA;  (auctex-latexmk-setup)&#xA;  (add-hook 'LaTeX-mode-hook&#xA;            (lambda ()&#xA;              (setq TeX-command-default &quot;LaTeXMk&quot;))))&#xA;&#xA;(add-hook 'after-save-hook&#xA;          (lambda ()&#xA;            (when (string= major-mode &quot;latex-mode&quot;)&#xA;              (TeX-command-menu &quot;LaTeXMk&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To reproduce the problem, start with &lt;code&gt;emacs -Q&lt;/code&gt;, evaluate the snippet, then open a LaTeX file and modify the buffer. You will notice that the tabbar face will change. Then, save the buffer. This will also trigger LaTeX compilation (with &lt;code&gt;latexmk&lt;/code&gt; in this example). So far so good. But the problem is that the &lt;strong&gt;tabbar face does not revert back to the default (i.e., saved) face/state&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried calling &lt;code&gt;tabbar-modification-state-change&lt;/code&gt; in &lt;code&gt;after-save-hook&lt;/code&gt;, but that does not solve the problem.&lt;/p&gt;&#xA;" OwnerUserId="2292" LastEditorUserId="2292" LastEditDate="2016-08-15T15:30:51.697" LastActivityDate="2016-08-15T15:30:51.697" Title="Update buffer status in tabbar after saving and auto-compiling LaTeX file" Tags="|latex|tabbar|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26294" PostTypeId="2" ParentId="20880" CreationDate="2016-08-15T01:43:53.470" Score="2" Body="&lt;p&gt;Yes, there is a quick way to repeat &lt;em&gt;any&lt;/em&gt; complex command (that is, a command that uses the minibuffer to read input): &lt;strong&gt;&lt;code&gt;C-x ESC ESC&lt;/code&gt;&lt;/strong&gt; (aka &lt;code&gt;C-x M-ESC&lt;/code&gt;), &lt;code&gt;repeat-complex-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That inserts the Lisp form of the last complex command you executed in the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;M-p&lt;/code&gt; or &lt;code&gt;M-r&lt;/code&gt;, as usual, to retrieve previous elements from the input history.  So if the last complex command was your &lt;code&gt;ediff&lt;/code&gt; command then &lt;code&gt;C-x ESC ESC&lt;/code&gt; puts it in the minibuffer, and you just hit &lt;code&gt;RET&lt;/code&gt; (Enter key) to repeat the command.  If the &lt;code&gt;ediff&lt;/code&gt; command was further back than the last command then just use &lt;code&gt;M-p&lt;/code&gt;... or &lt;code&gt;M-r&lt;/code&gt; to retrieve it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-15T01:43:53.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26295" PostTypeId="1" AcceptedAnswerId="26297" CreationDate="2016-08-15T03:24:08.303" Score="3" ViewCount="220" Body="&lt;p&gt;I'm trying to create an &lt;a href=&quot;https://github.com/smihica/emmet-mode&quot; rel=&quot;nofollow&quot;&gt;emmet-like&lt;/a&gt; minor mode that will trigger on &lt;code&gt;SPC&lt;/code&gt; (or &lt;code&gt;TAB&lt;/code&gt;) if the previous text is expandable, but I don't want to completely override bindings that already exist for the key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I 'layer' my functionality over existing configuration?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (should-activate-p)&#xA;    (do-the-cool-thing)&#xA;  (business-as-usual))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-08-15T10:13:34.507" Title="How can I 'layer' a keybinding?" Tags="|key-bindings|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26296" PostTypeId="1" AcceptedAnswerId="26298" CreationDate="2016-08-15T05:50:22.393" Score="2" ViewCount="271" Body="&lt;p&gt;When I use &lt;code&gt;helm-mark-ring&lt;/code&gt; or &lt;code&gt;helm-imenu&lt;/code&gt;, I would like to jump to the current candidate automatically in the other buffer while keeping the helm session (i.e., similar to &lt;code&gt;helm-swoop&lt;/code&gt;).&#xA;I tried the following codes mentioned on &lt;a href=&quot;https://groups.google.com/forum/#!topic/emacs-helm/US8FWnfRu5o&quot; rel=&quot;nofollow&quot;&gt;this thread&lt;/a&gt;, but didn't work for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'helm-before-initialize-hook #'(lambda () (helm-attrset 'follow 1 helm-source-mark-ring)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result: It shows &lt;code&gt;[Display not ready]&lt;/code&gt; in echo area when I change the helm candidate (by &lt;code&gt;C-n&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help appreciated!&lt;/p&gt;&#xA;" OwnerUserId="12987" LastEditorUserId="12616" LastEditDate="2016-08-15T12:17:23.833" LastActivityDate="2017-03-17T10:03:49.150" Title="How to make helm-mark-ring/helm-imenu follow current candidate" Tags="|helm|imenu|mark-ring|follow-mode|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26297" PostTypeId="2" ParentId="26295" CreationDate="2016-08-15T10:13:34.507" Score="7" Body="&lt;p&gt;There are various ways you could approach this, but one in particular seems more or less designed for the purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You define the key using the &lt;code&gt;menu-item&lt;/code&gt; syntax, with a &lt;code&gt;:filter&lt;/code&gt; function that &lt;em&gt;returns the command to be called.&lt;/em&gt; If the function returns &lt;code&gt;nil&lt;/code&gt;, Emacs treats it as undefined in that keymap, and continues looking for a binding in the lower-priority maps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/16090517/elisp-conditionally-change-keybinding/22863701#22863701&quot;&gt;https://stackoverflow.com/questions/16090517/elisp-conditionally-change-keybinding/22863701#22863701&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://endlessparentheses.com/define-context-aware-keys-in-emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://endlessparentheses.com/define-context-aware-keys-in-emacs.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://paste.lisp.org/display/304865&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://paste.lisp.org/display/304865&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-08-15T10:13:34.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26298" PostTypeId="2" ParentId="26296" CreationDate="2016-08-15T11:57:40.013" Score="1" Body="&lt;p&gt;Put this in your .emacs &lt;code&gt;(setq helm-follow-mode-persistent t)&lt;/code&gt; and whenever you enter helm-imenu or helm-mark-ring, press &lt;code&gt;C-&amp;lt;up&amp;gt;&lt;/code&gt; or &lt;code&gt;C-&amp;lt;down&amp;gt;&lt;/code&gt; to follow to that line in helm.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-08-15T11:57:40.013" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26299" PostTypeId="2" ParentId="26285" CreationDate="2016-08-15T12:33:58.487" Score="1" Body="&lt;p&gt;I think this issue is caused by the fact that if you run the script with &lt;code&gt;C-u C-c C-c&lt;/code&gt; and then run it a second time the same way, you are trying to run it as part of the same process/session (not sure the correct term). To illustrate this, if it needs illustrating, you can visit the &lt;code&gt;*Python*&lt;/code&gt; buffer that will be open after you run the script, and at the interactive prompt and call the &lt;code&gt;dir()&lt;/code&gt; function. You will see that &lt;code&gt;'App'&lt;/code&gt;, &lt;code&gt;'Label'&lt;/code&gt;, &lt;code&gt;'MyApp'&lt;/code&gt;, &lt;code&gt;'kivy'&lt;/code&gt;, etc. are already there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reasons that I can't really explain, but that have also been mentioned &lt;a href=&quot;https://stackoverflow.com/questions/38042329/python-kivy-app-running-only-once&quot;&gt;here&lt;/a&gt;, kivy will not work this way if you try to run the same &lt;code&gt;App&lt;/code&gt; twice in the same session while everything is still in memory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you run your &lt;code&gt;.py&lt;/code&gt; file from the command line with &lt;code&gt;python myfile.py&lt;/code&gt; it will work every time you run it because you are starting from scratch each time. But if you open &lt;code&gt;ipython&lt;/code&gt; or another interactive interpreter, import your module, and then call the &lt;code&gt;main()&lt;/code&gt; function more than once, you will see the same errors for the same reason. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will see that if you got to the &lt;code&gt;*Python*&lt;/code&gt; buffer and type &lt;code&gt;exit()&lt;/code&gt; to end the Python process, and run your script again with &lt;code&gt;C-u C-c C-c&lt;/code&gt;, that it should work as expected again (although only once, of course, for the reasons described above). This is not an issue with Emacs really, but a product of the way that kivy works and the way the running Python scripts works in Emacs. I don't think it is something that you will easily be able to &quot;fix&quot;, nor should you really need to. However, this will hopefully put your mind at ease if you were worried that it was a bug or something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs and kivy do play well together in my experience (I used them together every day at my last job), so I hope this little quirk doesn't bother you too much!&lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-08-15T12:33:58.487" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26300" PostTypeId="2" ParentId="19898" CreationDate="2016-08-15T12:59:16.540" Score="1" Body="&lt;p&gt;Turns out that the behaviour of &lt;code&gt;TeX-insert-quote&lt;/code&gt; has changed from what I was used to. If I simply hit &lt;kbd&gt;&quot;&lt;/kbd&gt; &lt;strong&gt;twice&lt;/strong&gt; the correct quotation characters are inserted. It used to insert &lt;code&gt;&quot;`&lt;/code&gt; or &lt;code&gt;&quot;'&lt;/code&gt; immediately, but now does so after the second stroke. &lt;/p&gt;&#xA;" OwnerUserId="542" LastActivityDate="2016-08-15T12:59:16.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26302" PostTypeId="2" ParentId="26223" CreationDate="2016-08-15T13:56:26.910" Score="5" Body="&lt;p&gt;The backtrace you give in the question actually has all the information you need to debug this so while the answer is in the comments I'll go through the logic.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;call-process(nil nil nil nil &quot;--dired&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So an argument here has failed the &lt;em&gt;stringp&lt;/em&gt; predicate check. This first place to look is at C-h f &lt;em&gt;call-process&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call-process is a built-in function in ‘C source code’.&#xA;&#xA;(call-process PROGRAM &amp;amp;optional INFILE DESTINATION DISPLAY &amp;amp;rest ARGS)&#xA;&#xA;Call PROGRAM synchronously in separate process.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Well that's a bit of a pain, it is in the C code. If you have a copy of the code checked out you could have looked and found the following in &lt;em&gt;src/callproc.c&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (nargs &amp;gt;= 2 &amp;amp;&amp;amp; ! NILP (args[1]))&#xA;  {&#xA;    infile = Fexpand_file_name (args[1], BVAR (current_buffer, directory));&#xA;    CHECK_STRING (infile);&#xA;  }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But as most people don't have the C code on their systems we'll look higher up the stack. From the help text though it seems pretty likely calling &lt;em&gt;call-process&lt;/em&gt; with nil for its only mandatory argument isn't going to end well. So up the stack:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;call-process(nil nil nil nil &quot;--dired&quot;)&#xA;dired-insert-directory(&quot;/home/hb/test/&quot; &quot;-al&quot; nil nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So we visit C-h f &lt;em&gt;dired-insert-directory&lt;/em&gt; and follow the link to dired.el to look at the code. M-x narrow-to-defun and we can search just in this function for the &lt;em&gt;call-process&lt;/em&gt; invocation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (and&#xA; ;; Don't try to invoke `ls' if we are on DOS/Windows where&#xA; ;; ls-lisp emulation is used, except if they want to use `ls'&#xA; ;; as indicated by `ls-lisp-use-insert-directory-program'.&#xA; (not (and (featurep 'ls-lisp)&#xA;       (null ls-lisp-use-insert-directory-program)))&#xA; (or (if (eq dired-use-ls-dired 'unspecified)&#xA;     ;; Check whether &quot;ls --dired&quot; gives exit code 0, and&#xA;     ;; save the answer in `dired-use-ls-dired'.&#xA;     (or (setq dired-use-ls-dired&#xA;           (eq 0 (call-process insert-directory-program&#xA;                     nil nil nil &quot;--dired&quot;)))&#xA;         (progn&#xA;           (message &quot;ls does not support --dired; see `dired-use-ls-dired' for more details.&quot;)&#xA;           nil))&#xA;       dired-use-ls-dired)&#xA;     (file-remote-p dir)))&#xA;(setq switches (concat &quot;--dired &quot; switches)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And we see the invocation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process insert-directory-program nil nil nil &quot;--dired&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A quick C-h v &lt;em&gt;insert-directory-program&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;insert-directory-program is a variable defined in ‘files.el’.&#xA;Its value is &quot;ls&quot;&#xA;&#xA;  This variable may be risky if used as a file-local variable.&#xA;&#xA;Documentation:&#xA;Absolute or relative name of the ‘ls’ program used by ‘insert-directory’.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And if we follow the link to the definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar insert-directory-program (purecopy &quot;ls&quot;)&#xA;  &quot;Absolute or relative name of the `ls' program used by `insert-directory'.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So we can see it defaults to &quot;ls&quot;, ergo if it is not set something has messed with the setting. You can verify this by running emacs -Q to confirm the default setup works.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2016-08-15T13:56:26.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26303" PostTypeId="2" ParentId="26291" CreationDate="2016-08-15T13:57:35.367" Score="1" Body="&lt;p&gt;If your custom agenda view does not have an &lt;code&gt;agenda&lt;/code&gt; portion, you will not be able to toggle habits on and off from that view. One of the first things that the function &lt;code&gt;org-habit-toggle-habits&lt;/code&gt; (the command you are invoking with &lt;code&gt;C-k&lt;/code&gt;, but which is just &lt;code&gt;K&lt;/code&gt; for me) does before actually toggling habits, is the following check:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-check-type t 'agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the agenda type is anything other than &lt;code&gt;agenda&lt;/code&gt;, e.g., if it is a &lt;code&gt;tags&lt;/code&gt;-based agenda, it will raise the error that you are seeing. I am not sure if there is a way to get around this, or if you would want to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you add an &lt;code&gt;agenda&lt;/code&gt; portion to your custom agenda view, all you need to do is make sure point is in that part of the view, and then &lt;code&gt;org-habit-toggle-habits&lt;/code&gt; should work as expected. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-08-15T13:57:35.367" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26304" PostTypeId="1" CreationDate="2016-08-15T16:09:56.777" Score="1" ViewCount="671" Body="&lt;p&gt;I was wondering if anyone has been able to use org-journal and create a second independent journal. Note that I use Spacemacs. I have been using org-journal for my daily journal, which is great. However, I want to create a second weekly journal to plan things out for the week. Right now org-journal bounds to C-j-j key, so I would like to have a different key combo that would open the second journal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was looking over the org-journal code. It looks simple enough, but was not sure if I was on the right track. If anyone can suggest a simpler way, that would be great. The original &lt;a href=&quot;https://github.com/bastibe/org-journal/blob/master/org-journal.el&quot; rel=&quot;nofollow&quot;&gt;org-journal&lt;/a&gt; code is linked for reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code for the location of journal files is. Below. So I would just have to create a second similar entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first thing is to create a new keybinding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; Key bindings&#xA; (define-key org-journal-mode-map (kbd &quot;C-c C-f&quot;) 'org-journal-open-  &#xA; next-entry)&#xA; (define-key org-journal-mode-map (kbd &quot;C-c C-b&quot;) 'org-journal-open-&#xA; previous-entry)&#xA; (define-key org-journal-mode-map (kbd &quot;C-c C-j&quot;) 'org-journal-new-&#xA; entry)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I need to add a new location to the org-journal-dir variable to set a new directory for the second journal.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defcustom org-journal-dir &quot;~/Documents/journal/&quot;&#xA; &quot;Directory containing journal entries.&#xA;  Setting this will update auto-mode-alist using&#xA; `(org-journal-update-auto-mode-alist)`&quot;&#xA; :type 'string :group 'org-journal&#xA; :set (lambda (symbol value)&#xA;     (set-default symbol value)&#xA;     (org-journal-update-auto-mode-alist)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function for creating a new entry is below. But the variable for the journal directory is saved in the org-journal-dir variable. So it is not an argument for the function below. Hence I would just need to copy this function and reference the name of the second variable created for org-journal-dir2.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun org-journal-new-entry (prefix &amp;amp;optional time)&#xA; &quot;Open today's journal file and start a new entry.&#xA; Giving the command a prefix arg will just open a today's file,&#xA; without adding an entry. If given a time, create an entry for&#xA; the time's day.&quot;&#xA;(interactive &quot;P&quot;)&#xA;(org-journal-dir-check-or-create)&#xA;(let* ((entry-path (org-journal-get-entry-path time))&#xA;     (should-add-entry-p (not prefix)))&#xA;&#xA;;; open journal file&#xA;(funcall org-journal-find-file entry-path)&#xA;(org-journal-decrypt)&#xA;(goto-char (point-max))&#xA;(let ((unsaved (buffer-modified-p))&#xA;      (new-file-p (equal (point-max) 1)))&#xA;&#xA;  ;; empty file? Add a date timestamp&#xA;  (when new-file-p&#xA;    (insert org-journal-date-prefix&#xA;            (format-time-string org-journal-date-format time)))&#xA;&#xA;  ;; add crypt tag if encryption is enabled and tag is not present&#xA;  (when org-journal-enable-encryption&#xA;    (goto-char (point-min))&#xA;    (unless (member org-crypt-tag-matcher (org-get-tags))&#xA;      (org-set-tags-to org-crypt-tag-matcher))&#xA;    (goto-char (point-max)))&#xA;&#xA;  ;; move TODOs from previous day here&#xA;  (when (and new-file-p org-journal-carryover-items)&#xA;    (save-excursion (org-journal-carryover)))&#xA;&#xA;  ;; skip adding entry if a prefix is given&#xA;  (when should-add-entry-p&#xA;    (unless (eq (current-column) 0) (insert &quot;\n&quot;))&#xA;    (insert &quot;\n&quot; org-journal-time-prefix&#xA;            (if (= (time-to-days (current-time)) (time-to-days time))&#xA;                (format-time-string org-journal-time-format)&#xA;              &quot;&quot;)))&#xA;&#xA;  ;; switch to the outline, hide subtrees&#xA;  (org-journal-mode)&#xA;  (if (and org-journal-hide-entries-p (org-journal-time-entry-level))&#xA;      (hide-sublevels (org-journal-time-entry-level))&#xA;    (show-all))&#xA;&#xA;  ;; open the recent entry when the prefix is given&#xA;  (if should-add-entry-p&#xA;    (show-entry))&#xA;&#xA;  (set-buffer-modified-p unsaved))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The rest would seem to stay the same. Does this seem like the right way to do this, or is there a simpler way?&lt;/p&gt;&#xA;" OwnerUserId="6822" LastActivityDate="2016-08-15T16:09:56.777" Title="creating a second independent journal using org-journal" Tags="|org-mode|spacemacs|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26305" PostTypeId="2" ParentId="21540" CreationDate="2016-08-15T16:19:36.697" Score="4" Body="&lt;p&gt;According to your example you don't need the function &lt;code&gt;with-eval-after-load&lt;/code&gt;.&lt;br&gt;&#xA;In Spacemacs it works simple like that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  &quot;…&quot;&#xA;  ;; …&#xA;  ;; dummy silence definition&#xA;  (defun silence ()&#xA;    (interactive))&#xA;  ;; don't jump the cursor around in the window on clicking&#xA;  (define-key evil-motion-state-map [down-mouse-1] 'silence)&#xA;  ;; also avoid any '&amp;lt;mouse-1&amp;gt; is undefined' when setting to 'undefined&#xA;  (define-key evil-motion-state-map [mouse-1] 'silence))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get it working for me I had to add the definition of &lt;code&gt;silence&lt;/code&gt; before &lt;a href=&quot;https://xivilization.net/~marek/blog/2015/06/22/disabling-mouse-in-spacemacs/&quot; rel=&quot;nofollow&quot;&gt;like Marek Kubica did&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12991" LastActivityDate="2016-08-15T16:19:36.697" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26306" PostTypeId="2" ParentId="26286" CreationDate="2016-08-15T20:07:37.250" Score="1" Body="&lt;p&gt;There's this command maybe you've seen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't toggle, but rather just Init case with a list of words of exceptions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xah-title-case-region-or-line (*begin *end)&#xA;  &quot;Title case text between nearest brackets, or current line, or text selection.&#xA;Capitalize first letter of each word, except words like {to, of, the, a, in, or, and, …}. If a word already contains cap letters such as HTTP, URL, they are left as is.&#xA;&#xA;When called in a elisp program, *begin *end are region boundaries.&#xA;URL `http://ergoemacs.org/emacs/elisp_title_case_text.html'&#xA;Version 2015-05-07&quot;&#xA;  (interactive&#xA;   (if (use-region-p)&#xA;       (list (region-beginning) (region-end))&#xA;     (let (&#xA;           -p1&#xA;           -p2&#xA;           (-skipChars &quot;^\&quot;&amp;lt;&amp;gt;(){}[]“”‘’‹›«»「」『』【】〖〗《》〈〉〔〕&quot;))&#xA;       (progn&#xA;         (skip-chars-backward -skipChars (line-beginning-position))&#xA;         (setq -p1 (point))&#xA;         (skip-chars-forward -skipChars (line-end-position))&#xA;         (setq -p2 (point)))&#xA;       (list -p1 -p2))))&#xA;  (let* (&#xA;         (-strPairs [&#xA;                     [&quot; A &quot; &quot; a &quot;]&#xA;                     [&quot; And &quot; &quot; and &quot;]&#xA;                     [&quot; At &quot; &quot; at &quot;]&#xA;                     [&quot; As &quot; &quot; as &quot;]&#xA;                     [&quot; By &quot; &quot; by &quot;]&#xA;                     [&quot; Be &quot; &quot; be &quot;]&#xA;                     [&quot; Into &quot; &quot; into &quot;]&#xA;                     [&quot; In &quot; &quot; in &quot;]&#xA;                     [&quot; Is &quot; &quot; is &quot;]&#xA;                     [&quot; It &quot; &quot; it &quot;]&#xA;                     [&quot; For &quot; &quot; for &quot;]&#xA;                     [&quot; Of &quot; &quot; of &quot;]&#xA;                     [&quot; Or &quot; &quot; or &quot;]&#xA;                     [&quot; On &quot; &quot; on &quot;]&#xA;                     [&quot; Via &quot; &quot; via &quot;]&#xA;                     [&quot; The &quot; &quot; the &quot;]&#xA;                     [&quot; That &quot; &quot; that &quot;]&#xA;                     [&quot; To &quot; &quot; to &quot;]&#xA;                     [&quot; Vs &quot; &quot; vs &quot;]&#xA;                     [&quot; With &quot; &quot; with &quot;]&#xA;                     [&quot; From &quot; &quot; from &quot;]&#xA;                     [&quot;'S &quot; &quot;'s &quot;]&#xA;                     ]))&#xA;    (save-excursion &#xA;      (save-restriction&#xA;        (narrow-to-region *begin *end)&#xA;        (upcase-initials-region (point-min) (point-max))&#xA;        (let ((case-fold-search nil))&#xA;          (mapc&#xA;           (lambda (-x)&#xA;             (goto-char (point-min))&#xA;             (while&#xA;                 (search-forward (aref -x 0) nil t)&#xA;               (replace-match (aref -x 1) 'FIXEDCASE 'LITERAL)))&#xA;           -strPairs))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-08-15T20:07:37.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26307" PostTypeId="1" CreationDate="2016-08-15T22:46:00.317" Score="0" ViewCount="63" Body="&lt;p&gt;I'd like to fold each word in a header in org-mode. In other words, I'd like to toggle between this view:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* emacs is fun &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this view :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* e i f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and hopefully toggle each word like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* e is f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* e i fun&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="105" LastEditDate="2016-08-15T23:52:23.280" LastActivityDate="2016-08-15T23:52:23.280" Title="How can I fold each word in a header?" Tags="|code-folding|header-line|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26308" PostTypeId="2" ParentId="19849" CreationDate="2016-08-16T03:36:14.153" Score="1" Body="&lt;p&gt;I had the same issue on Emacs 24.5, but when I upgraded to Emacs 25rc1, it went away. Perhaps the same fix will work for you?&lt;/p&gt;&#xA;" OwnerUserId="12998" LastActivityDate="2016-08-16T03:36:14.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26309" PostTypeId="1" AcceptedAnswerId="26313" CreationDate="2016-08-16T06:14:02.363" Score="6" ViewCount="2264" Body="&lt;p&gt;I know that emacs is often critzied because of its shortcuts. But this isn't the intention of that question! I come in peace! ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was using vim for years. And I see a concept behind of the most shortcuts there. e.g. You don't have to move your right hand/fingers away from the basic-position on the keyboard to navigate in your file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did the emacs tutorial and couldn't get into it. Why are the shortcuts this way? Even the basic ones. They are hard to remember and hard to press. In my opinion I have to move and combine my fingers in a unnatural way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would help me to get deeper into emacs if I would understand the concept behind that keys. It was the same for me in vim. The first time it was damn crazy. But when I understood it everything went nice and easy. ;)&#xA;I am looking forward to work with emacs the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another side question would be why are &lt;code&gt;CTRL&lt;/code&gt; and &lt;code&gt;ALT&lt;/code&gt; are renamed in emacs? From the viewpoint of a beginner it doesn't help. It just underline the &quot;exoctic&quot; status of that genius piece of software.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;btw: I know the evil-mode and that emacs is able to modify nearly everything I want. But that shouldn't be the starting point for a emacs-beginner.&lt;/p&gt;&#xA;" OwnerUserId="12999" LastActivityDate="2016-08-17T14:43:32.103" Title="What is the concept behind the default keyboard shortcuts?" Tags="|key-bindings|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="26310" PostTypeId="1" CreationDate="2016-08-16T07:55:46.583" Score="4" ViewCount="134" Body="&lt;p&gt;In &lt;code&gt;org-babel&lt;/code&gt;, is there a way for checking for missing noweb references &lt;code&gt;&amp;lt;&amp;lt;...&amp;gt;&amp;gt;&lt;/code&gt; or for throwing an error if a reference is missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example in the following I have mistyped the name of the referenced code block.  Tangling via &lt;code&gt;C-c C-v f&lt;/code&gt; then produces an elisp file with &lt;code&gt;&amp;lt;&amp;lt;function-body&amp;gt;&amp;gt;&lt;/code&gt; replaced by nothing and reports no error. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args :noweb yes :tangle no :exports none&#xA;&#xA;The first code block calls all others.&#xA;&#xA;#+BEGIN_SRC emacs-lisp :tangle yes&#xA;  (defun test-fn (a b c)&#xA;    &quot;A test function&quot;&#xA;    &amp;lt;&amp;lt;function-body&amp;gt;&amp;gt;)&#xA;#+END_SRC&#xA;&#xA;#+NAME: function-bod&#xA;#+BEGIN_SRC emacs-lisp&#xA;  (+ a b c)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, is there a reliable way to make sure I don't type such names incorrectly?&lt;/p&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2016-08-16T13:38:12.647" LastActivityDate="2016-08-16T14:14:45.450" Title="Report missing noweb references in org-babel" Tags="|org-babel|noweb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26311" PostTypeId="1" AcceptedAnswerId="26312" CreationDate="2016-08-16T13:00:01.600" Score="1" ViewCount="2039" Body="&lt;p&gt;Steps to take to appreciate my befuddlement:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Run &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow&quot;&gt;Spacemacs&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press the space bar.&lt;/li&gt;&#xA;&lt;li&gt;This moves the mode line up, and in the area below the mode line (which I think is all called either the mini-window or the minibuffer), displays keys that the user might wish to press next in order to execute a command, e.g. &lt;code&gt;SPC → avy word&lt;/code&gt;, &lt;code&gt;TAB → last buffer&lt;/code&gt;, etc. Unfortunately, only 9 lines of these are shown (when Spacemacs is maximised; 10 lines if I go fullscreen), so some of the options are hidden on a second page. Below this, there is a line that reads, &lt;code&gt;SPC- Spacemacs root (1 of 2) [C-h paging/help]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;h&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;That last line now reads, &lt;code&gt;SPC- n → next page, p → previous page, u → undo-key, h → help, a → abort&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;n&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Aha! Now we can see the second page's worth of options.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'd like to make it unnecessary to have to press &lt;code&gt;SPC C-h n&lt;/code&gt; to see those remaining options. I figure this can be done by increasing the height of the area under the mode line, so that all the options can fit on one page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How can I do this? I've already tried increasing &lt;code&gt;max-mini-window-height&lt;/code&gt; from &lt;code&gt;0.25&lt;/code&gt; to &lt;code&gt;0.5&lt;/code&gt; and reloading Spacemacs, but this didn't appear to make any difference at all.&lt;/li&gt;&#xA;&lt;li&gt;What is the correct terminology for the area that appears below the mode line when pressing the space bar in Spacemacs?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user8341" LastEditorUserId="105" LastEditDate="2016-08-16T15:09:19.683" LastActivityDate="2016-08-16T15:13:06.950" Title="How to increase height of minibuffer/mini-window in Spacemacs?" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26312" PostTypeId="2" ParentId="26311" CreationDate="2016-08-16T13:08:31.077" Score="0" Body="&lt;p&gt;This feature is provided by &lt;a href=&quot;https://github.com/justbur/emacs-which-key&quot; rel=&quot;nofollow&quot;&gt;which-key&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The popup is actually a side window, not the minibuffer itself, so it is not affected by &lt;code&gt;max-mini-window-height&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your popup is at the top or bottom, increase &lt;code&gt;which-key-side-window-max-height&lt;/code&gt; as necessary to eliminate the pagination. If your popup is at the left or the right, adjust &lt;code&gt;which-key-side-window-max-width&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastEditorDisplayName="user8341" LastEditDate="2016-08-16T15:13:06.950" LastActivityDate="2016-08-16T15:13:06.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26313" PostTypeId="2" ParentId="26309" CreationDate="2016-08-16T13:45:27.590" Score="7" Body="&lt;p&gt;Unlike vi, Emacs does not have two completely separated modes, one for issuing commands and one for inserting text. This means that self-inserting keys such as letters &lt;em&gt;self-insert&lt;/em&gt; (duh). And that means that they &lt;em&gt;cannot simultaneously be used to invoke commands&lt;/em&gt; (other than the command to self-insert -- in Emacs &lt;strong&gt;all&lt;/strong&gt; user interactions invoke commands, in fact).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Emacs had to use other key combinations to invoke commands. (And this was also before there were things like a mouse, graphic-display, and window managers.) The ASCII control keys, using the Ctrl key, were the natural answer. Using them you can mix self-inserting keys with command-invoking keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is only one Ctrl key, so the commands you can invoke using it are (were, especially, at the time Emacs was created) limited in number. There is also the Escape key (&lt;code&gt;ESC&lt;/code&gt;) key, and that too was put to use for invoking commands, as a &lt;em&gt;prefix&lt;/em&gt; for key sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also an Alt key (aka Meta, typically), which in some cases allowed for a shortcut from using &lt;code&gt;ESC&lt;/code&gt;-prefixed keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most key typing involves self-inserting keys. A minority involves invoking commands. So this combination worked pretty well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond that is the question of &lt;em&gt;which&lt;/em&gt; key sequences to use for what commands.  This was carefully worked out, with experimentation -- and it continues to be.  Here are some of the basic ideas, which other posts here might go into, and which you can easily find more about elsewhere:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Often-used commands, and often-used sequences of commands, should have relatively easy-to-use key sequences. Commands used less often can have harder-to-use keys.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Seldom-used commands need have no key sequence.  Any command can be invoked using a simple-to-use key (&lt;code&gt;M-x&lt;/code&gt;) that prompts for you to enter its name.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Keys easy to reach by the stronger, longer fingers and the thumbs are generally easier to use often. This means keys like &lt;code&gt;f&lt;/code&gt;, &lt;code&gt;e&lt;/code&gt;, &lt;code&gt;g&lt;/code&gt;, &lt;code&gt;v&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;i&lt;/code&gt;, &lt;code&gt;o&lt;/code&gt;, &lt;code&gt;m&lt;/code&gt;, &lt;code&gt;n&lt;/code&gt;, &lt;code&gt;SPC&lt;/code&gt;, &lt;code&gt;DEL&lt;/code&gt; (Backspace), etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Because there are many commands, and thus many command-invoking key sequences, users need some help keeping track of them.  For this, Emacs defined &lt;em&gt;help keys&lt;/em&gt;, including &lt;code&gt;C-h c&lt;/code&gt; and &lt;code&gt;C-h k&lt;/code&gt;, which describe keys, and &lt;code&gt;C-h w&lt;/code&gt; which tells you what key to use for a command name you type at the prompt. This is behind the strong commitment that Emacs be a self-documenting editor - just ask it about itself. At the time Emacs was created, this was a new idea, and it is still an idea that is stronger in Emacs than elsewhere.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For the same reason, some degree of organization of the many key sequences, providing some symmetry and other mnemonic aids, was called for.  This is behind the system of using &lt;code&gt;C-f&lt;/code&gt;, &lt;code&gt;M-f&lt;/code&gt;, &lt;code&gt;C-M-f&lt;/code&gt;, &lt;code&gt;C-b&lt;/code&gt;, &lt;code&gt;M-b&lt;/code&gt;, &lt;code&gt;C-M-b&lt;/code&gt;, etc., with &lt;em&gt;&quot;f&quot;&lt;/em&gt; signifying &lt;em&gt;&quot;forward&quot;&lt;/em&gt; and &lt;em&gt;&quot;b&quot;&lt;/em&gt; standing for &lt;em&gt;&quot;backward&quot;&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The rest is history: evolution, adaptation, suggestions and experiments by thousands of people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, did I forget to say that &lt;strong&gt;because&lt;/strong&gt; Emacs uses modifier and prefix keys to invoke specific commands, binding keys to commands is very important, and &lt;strong&gt;because&lt;/strong&gt; it is important, users need to be able to do this themselves? This is behind the strong commitment that Emacs be a customizable editor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Predefined keys have no special significance.&lt;/em&gt; With a couple of somewhat-exceptions (you usually should not mess with &lt;code&gt;C-u&lt;/code&gt;, &lt;code&gt;ESC&lt;/code&gt;, or &lt;code&gt;C-g&lt;/code&gt;), you can easily create your own system of key bindings - you can pretty much &lt;em&gt;replace&lt;/em&gt; any and all of the predefined key bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this help understand Emacs keys? It should help understand Emacs more generally, because in Emacs, everything -- &lt;em&gt;every single user action, is a command&lt;/em&gt;. And &lt;em&gt;any command can be bound to a key&lt;/em&gt;. Many commands are bound to keys by default, and you can bind others or rebind any that are bound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, the Emacs &quot;crazy&quot; keys are your own fault, in this sense: predefined keys are offered as a suggestion - something suggested that you can use out of the box, if you want. But you can easily create your own crazy-keys combinations and systematize things your own way.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;&quot;Another side question would be why are CTRL and ALT are renamed in emacs?&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Those are common labels for the physical keys.  In Emacs (and other programs), there is a distinction between physical keys, the codes they send to applications, and the software representations of those codes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs there is more than one soft representation of keys. In particular, there is an external, user-facing key-description representation, such as &lt;code&gt;C-x 2&lt;/code&gt; or &lt;code&gt;&amp;lt;M-down&amp;gt;&lt;/code&gt; or &lt;code&gt;C-M-f&lt;/code&gt;, which is what you provide to function &lt;code&gt;kbd&lt;/code&gt; when you want to bind a key sequence. And there are internal, Emacs-Lisp representations, such as &lt;code&gt;[M-down]&lt;/code&gt; and &lt;code&gt;[(meta down)]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The aim of the external, user notation is to be succinct: &lt;code&gt;C-M-&lt;/code&gt; instead of &lt;code&gt;Ctrl + Meta&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason &lt;code&gt;Meta&lt;/code&gt; is used instead of &lt;code&gt;Alt&lt;/code&gt; is that in fact both can be used.  &lt;code&gt;Alt&lt;/code&gt; is a physical key; you can move &lt;code&gt;Meta&lt;/code&gt; pretty much wherever you like. Emacs users and programs generally use &lt;code&gt;Meta&lt;/code&gt;, which is separated from hardware, instead of &lt;code&gt;Alt&lt;/code&gt;, which is not. And they generally just accept the default assignment of &lt;code&gt;Meta&lt;/code&gt; to the &lt;code&gt;Alt&lt;/code&gt; key.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-17T14:43:32.103" LastActivityDate="2016-08-17T14:43:32.103" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="26314" PostTypeId="2" ParentId="26310" CreationDate="2016-08-16T14:14:45.450" Score="2" Body="&lt;p&gt;The behavior you want is controlled by the variable &lt;code&gt;org-babel-noweb-error-all-langs&lt;/code&gt;, whose default value is &lt;code&gt;nil&lt;/code&gt;. Set it to &lt;code&gt;t&lt;/code&gt; (e.g. via &lt;code&gt;(setq org-babel-noweb-error-all-langs t)&lt;/code&gt; in your init file), and unresolvable noweb references will raise an error.&lt;/p&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2016-08-16T14:14:45.450" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26315" PostTypeId="1" AcceptedAnswerId="26317" CreationDate="2016-08-16T15:45:15.107" Score="0" ViewCount="154" Body="&lt;p&gt;I wanted to bind M-n to transpose-chars in evil insert state, and tried&#xA;&lt;code&gt;(define-key evil-insert-state-map &quot;M-n&quot; 'transpose-chars)&lt;/code&gt;&#xA;But that didn't work. What should I do?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2016-08-16T16:02:50.827" Title="Binding modified key in evil mode" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26316" PostTypeId="1" AcceptedAnswerId="26333" CreationDate="2016-08-16T15:58:13.237" Score="1" ViewCount="173" Body="&lt;p&gt;I have a very strange issue. I have no idea how to debug. TRAMP hangs every time I issue it via &lt;code&gt;C-x C-f&lt;/code&gt; (and choose &lt;code&gt;ssh&lt;/code&gt;), when I try to execute a org code block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; :tangle:   /zeltak@aaa.zzz.yyy.xxx:/home/zeltak/.i3/config :mkdirp yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when I try to launch it with &lt;code&gt;M-x ssh&lt;/code&gt; it does prompt me for a passwords and connects fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any clue what can be going on?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="12616" LastEditDate="2016-08-16T18:42:01.250" LastActivityDate="2017-05-07T01:32:02.423" Title="Can connect TRAMP with m-x ssh but can't with anything else (org code blocks, C-x C-f, etc.)" Tags="|tramp|debugging|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26317" PostTypeId="2" ParentId="26315" CreationDate="2016-08-16T16:02:50.827" Score="2" Body="&lt;p&gt;In &lt;code&gt;(define-key KEYMAP KEY DEF)&lt;/code&gt; the &lt;code&gt;KEY&lt;/code&gt; is internal representation of keys, where prefix keys must be &lt;code&gt;\C-&lt;/code&gt; or &lt;code&gt;\M-&lt;/code&gt;.  A way to convert keys into internal representation is to use &lt;code&gt;(kbd KEYS)&lt;/code&gt; function, where &lt;code&gt;KEYS&lt;/code&gt; is string. In your question it could be two variants:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(define-key evil-insert-state-ma‌​p &quot;\M-n&quot; 'transpose-chars)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(define-key evil-insert-state-ma‌​p (kbd &quot;M-n&quot;) 'transpose-chars)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-08-16T16:02:50.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26318" PostTypeId="2" ParentId="26290" CreationDate="2016-08-16T16:51:41.493" Score="3" Body="&lt;p&gt;When in doubt actually do read the instructions. In this case &lt;a href=&quot;http://orgmode.org/manual/Math-formatting-in-HTML-export.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; explains how to move equation numbering:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I changed the &lt;code&gt;tagside&lt;/code&gt; to &lt;code&gt;right&lt;/code&gt; and all was well.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2016-08-16T16:51:41.493" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26319" PostTypeId="1" AcceptedAnswerId="26364" CreationDate="2016-08-16T17:51:14.560" Score="3" ViewCount="1343" Body="&lt;p&gt;I am using &lt;a href=&quot;https://github.com/myuhe/org-gcal.el&quot; rel=&quot;nofollow&quot;&gt;org-gcal&lt;/a&gt; and want to sync my Gmail Calender with Emacs. The &lt;code&gt;from Google to Emacs&lt;/code&gt; way seems to work really nice.&lt;br&gt;&#xA;In addition I am using &lt;a href=&quot;https://github.com/kiwanami/emacs-calfw&quot; rel=&quot;nofollow&quot;&gt;calfw&lt;/a&gt; to view the appointments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to create a new appointment with predefined fields, like &lt;code&gt;subject&lt;/code&gt;, &lt;code&gt;time&lt;/code&gt; and so on, instead of manually create a todo in the gmail org file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As proposed in the comments here is a sample appointment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Title&#xA;  :PROPERTIES:&#xA;  :LINK: [[https://www.google.com/calendar/event?eid=123456789][Go to gcal web page]]&#xA;  :ID: ukf76ifl27j3shea562f5vrhe0&#xA;  :END:      &#xA;&#xA;  &amp;lt;2016-08-01 Mo 09:10-10:10&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="12007" LastEditorUserId="12007" LastEditDate="2016-08-16T19:11:09.960" LastActivityDate="2016-08-18T12:33:18.850" Title="Create new Appointment with org-gcal" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26320" PostTypeId="1" AcceptedAnswerId="27108" CreationDate="2016-08-16T19:32:55.930" Score="2" ViewCount="3064" Body="&lt;p&gt;I am trying to edit the file &lt;code&gt;/etc/postfix/main.cf&lt;/code&gt; but this applies to any file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently its permission bits are set to &lt;code&gt;-rw-r--r--&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to open, edit and save this file when operating as a regular user in emacs.  However, try as I might, I just can not do it.  Here are the options I have tried.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I tried &lt;a href=&quot;https://unix.stackexchange.com/questions/47724/how-to-modify-write-permission-on-current-buffer-in-emacs&quot;&gt;this method&lt;/a&gt;: &lt;code&gt;C-x C -q&lt;/code&gt; &#xA;This allows me to edit the buffer well enough, but when I try to save the buffer I am presented with: &lt;code&gt;File main.cf is write-protected; try to save anyway? (yes or no)&lt;/code&gt;&#xA;and when I type &lt;code&gt;yes&lt;/code&gt; I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Doing chmod: operation not permitted, /etc/postfix/main.cf&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, if I try &lt;code&gt;M-! chmod u+w main.cf&lt;/code&gt; at any point I get the message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;chmod: changing permissions of 'main.cf': Operation not permitted&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly if I try to edit the file in &lt;code&gt;wdired&lt;/code&gt; with &lt;code&gt;wdired-allow-to-change-permissions&lt;/code&gt; I get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;chmod 664 '/etc/postfix/main.cf' failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs is so powerful it seems like there must be a way to do this without using&#xA;the &lt;code&gt;/sudo::/filename&lt;/code&gt; trick mentioned &lt;a href=&quot;https://superuser.com/questions/563552/emacs-tells-me-directory-is-write-protected/563633&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, I think there should be a &quot;permissions&quot; tag here in emacs stack overflow.&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2019-02-01T23:51:59.843" Title="How to edit and save an extremely stubborn read-only file" Tags="|dired|sudo|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26321" PostTypeId="2" ParentId="26255" CreationDate="2016-08-16T20:22:51.730" Score="4" Body="&lt;p&gt;Have you seen &quot;mu4e-maildirs-extension&quot; (&lt;a href=&quot;https://github.com/agpchil/mu4e-maildirs-extension&quot; rel=&quot;nofollow&quot;&gt;https://github.com/agpchil/mu4e-maildirs-extension&lt;/a&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This provides something similar to your request, but it does require a specific account/folder structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When installed it adds a folder/count hierarchy below the normal stuff on the mu4e &quot;welcome&quot; screen (from M-x mu4e).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for my configuration I get the following (truncated/obfuscated) content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- my@example.com (46022/185227)&#xA;  | Archives-2013 (0/0)&#xA;  | Drafts (0/134)&#xA;  | INBOX (4/41)&#xA;  | Infected (9/268)&#xA;  - Junk (137/12995)&#xA;  | Junk E-mail (0/0)&#xA;  | Junk-Train-Ham (0/0)&#xA;  | Junk-Train-Spam (0/21)&#xA;  - Lists (0/0)&#xA;  - Lists-Emacs (0/0)&#xA;  | Lists-Emacs-Org-mode (1201/1201)&#xA;  | Lists-Mailpile (0/0)&#xA;  | Lists-Mu (45/45)&#xA;  | Lists-Notmuch (1876/1876)&#xA;  | Lists-Obnam (12/12)&#xA;  | Lists-Slim-Beta (4145/5414)&#xA;  | Lists-Slim-Checkins (70/89)&#xA;  | Lists-Slim-Developers (1570/2170)&#xA;  | Lists-Slim-Discuss (8990/15504)&#xA;  | Lists-Slim-Jive (19/19)&#xA;  | Lists-Slim-Plugins (18727/24477)&#xA;  | Lists-Slim-Unix (8378/14141)&#xA;  | Lists-Squeeze-Dev (0/2)&#xA;  :&#xA;  :&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's available on MELPA.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2016-08-16T20:22:51.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26322" PostTypeId="1" AcceptedAnswerId="26324" CreationDate="2016-08-16T23:35:31.560" Score="5" ViewCount="2430" Body="&lt;p&gt;What is the easiest way to get autocompletion for math symbols when I write latex formulas between &lt;code&gt;\(..\)&lt;/code&gt; or &lt;code&gt;\[...\]&lt;/code&gt; in &lt;strong&gt;org-mode&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could packages like &lt;a href=&quot;https://github.com/vspinu/company-math&quot; rel=&quot;noreferrer&quot;&gt;company-math&lt;/a&gt; or &lt;a href=&quot;https://github.com/vspinu/ac-math&quot; rel=&quot;noreferrer&quot;&gt;ac-math&lt;/a&gt; be used in org-mode, for example? How should I configure them to use them in org-mode?&lt;/p&gt;&#xA;" OwnerUserId="12208" LastActivityDate="2020-08-25T09:48:41.557" Title="Math autocompletion in org mode" Tags="|org-mode|latex|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26323" PostTypeId="1" CreationDate="2016-08-16T23:58:25.970" Score="7" ViewCount="2442" Body="&lt;p&gt;When I try to commit using magit I get the following error;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 1 git … commit --&#xA;Waiting for Emacs...&#xA;*ERROR*: Wrong type argument: stringp, nil&#xA;error: There was a problem with the editor '/opt/emacs/bin/emacsclient --socket-name=/tmp/emacs1000/server'.&#xA;Please supply the message using either -m or -F option.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are the versions of software I'm using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Magit 20160814.1615, Git 2.9.0, Emacs 25.0.50.2, gnu/linux (Debian wheezy 7)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I run emacs as a server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type the following into a file within my git project and eval the buffer I get the following;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-editor&#xA;  (let ((magit-git-debug t)&#xA;        (process-environment&#xA;         (cons &quot;GIT_EDITOR=printf '[%s]\n' \&quot;$EDITOR\&quot;&quot; process-environment)))&#xA;    (magit-git-insert &quot;commit&quot;)))[/opt/emacs/bin/emacsclient --socket-name=/tmp/emacs1000/server]&#xA;[/home/map7/code/testproject/.git/COMMIT_EDITMSG]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On the command line if I do the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ export GIT_TRACE=1 &#xA;$ export GIT_EDITOR='printf &quot;[%s]\n&quot; &quot;$EDITOR&quot;'                                             &#xA;$ git commit &#xA;10:48:43.558746 git.c:350               trace: built-in: git 'commit'&#xA;10:48:43.561811 run-command.c:336       trace: run_command: '.git/hooks/pre-commit'&#xA;10:48:43.563366 run-command.c:336       trace: run_command: 'status' '--porcelain'&#xA;10:48:43.563595 exec_cmd.c:120          trace: exec: 'git' 'status' '--porcelain'&#xA;10:48:43.564766 git.c:350               trace: built-in: git 'status' '--porcelain'&#xA;10:48:43.574334 run-command.c:336       trace: run_command: 'printf &quot;[%s]\n&quot; &quot;$EDITOR&quot;' '/home/map7/code/testproject/.git/COMM&#xA;IT_EDITMSG'                                                                                                           &#xA;10:48:43.574637 run-command.c:195       trace: exec: '/bin/sh' '-c' 'printf &quot;[%s]\n&quot; &quot;$EDITOR&quot; &quot;$@&quot;' 'printf &quot;[%s]\n&quot; &quot;&#xA;$EDITOR&quot;' '/home/map7/code/testproject/.git/COMMIT_EDITMSG'                                                                  &#xA;[emacs -nw -q]&#xA;[/home/map7/code/testproject/.git/COMMIT_EDITMSG]&#xA;Aborting commit due to empty commit message.&#xA;10:48:43.581313 git.c:350               trace: built-in: git 'config' '--get' 'oh-my-zsh.hide-dirty' &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just restarted emacs and now I can commit again, but I don't know for how long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can re-enact a similar problem if I do the following&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Stage my changes in magit using 's' on a file&lt;/li&gt;&#xA;&lt;li&gt;Go to commit hitting 'c c'&lt;/li&gt;&#xA;&lt;li&gt;Cancel the commit 'C-c C-k'&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now I get the same error as I was getting before, when trying to commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE: error in Backtrace&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  isearch-done(t)&#xA;  isearch-cancel()&#xA;  server-goto-toplevel(#&amp;lt;process server &amp;lt;24&amp;gt;&amp;gt;)&#xA;  server-process-filter(#&amp;lt;process server &amp;lt;24&amp;gt;&amp;gt; &quot;-dir /home/map7/code/angularjs_nested_routes/ -current-frame -tty /dev/pts/31 dumb -file /home/map7/code/angularjs_nested_routes/.git/COMMIT_EDITMSG \n&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been busy testing my configuration by remarking parts out as suggested. I recently had the same error, but manage to fix the error by killing off some of my buffers. I didn't take note of which buffers, but I will next time. This may suggest that it's a certain state instead of configuration?&lt;/p&gt;&#xA;" OwnerUserId="9463" LastEditorUserId="9463" LastEditDate="2016-10-13T22:01:40.803" LastActivityDate="2017-01-20T15:38:58.413" Title="Magit has trouble commiting - there is a problem with the editor" Tags="|magit|" AnswerCount="3" CommentCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="26324" PostTypeId="2" ParentId="26322" CreationDate="2016-08-17T01:05:19.507" Score="5" Body="&lt;p&gt;You could use &lt;code&gt;LaTeX-math-mode&lt;/code&gt; from the AucTex package. This provides quick completion of common math macros like &lt;code&gt;\alpha&lt;/code&gt;, &lt;code&gt;\sum&lt;/code&gt;, &lt;code&gt;\Sigma&lt;/code&gt; etc.  Make sure the package is loaded with the following line in your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'latex)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then from your org-mode buffer turn on &lt;code&gt;latex-math-mode&lt;/code&gt; with &lt;code&gt;M-x latex-math-mode&lt;/code&gt;. This provides shortcuts for a number of math symbols. You start by entering the backtick symbol &quot;`&quot;. The next key will add a LaTeX macro. For example, &lt;code&gt;a&lt;/code&gt; inserts &lt;code&gt;\alpha&lt;/code&gt;, &lt;code&gt;C-_&lt;/code&gt; inserts &lt;code&gt;\inf&lt;/code&gt;, etc. The full list is available on the &lt;a href=&quot;ftp://ftp.gnu.org/gnu/auctex/11.86-extra/tex-ref.pdf&quot; rel=&quot;noreferrer&quot;&gt;auctex reference card&lt;/a&gt;, and you can add your own shortcuts by customizing the variable &lt;code&gt;LaTeX-math-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Entering two backticks in a row inserts a plain backtick. You can change the prefix key if you don't want to use the backtick - see the customization option &lt;code&gt;LaTeX-math-abbrev-prefix&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have more complex completion needs, you can use company-mode, yasnippet etc. I don't think there is anything special about configuring these for use with org-mode, relative to any other Emacs mode.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-08-17T01:05:19.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26325" PostTypeId="2" ParentId="22686" CreationDate="2016-08-17T01:46:22.130" Score="1" Body="&lt;p&gt;There is no &lt;code&gt;after-theme-load-hook&lt;/code&gt;. The theme is loaded directly after &lt;code&gt;(load-theme 'theme-name)&lt;/code&gt;. Simply modify the desired theme variables after the &lt;code&gt;load-theme&lt;/code&gt; function call.&lt;/p&gt;&#xA;" OwnerUserId="12195" LastActivityDate="2016-08-17T01:46:22.130" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26326" PostTypeId="1" AcceptedAnswerId="26343" CreationDate="2016-08-17T04:32:05.480" Score="1" ViewCount="83" Body="&lt;p&gt;I've just started using emacs recently and it's fist time i try to configure it.&#xA;I have following setup under Windows 7:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;...\emacs\config\.emacs&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;...\emacs\emacs-bin-w64-25.0.94-O2\...&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;...\emecs\emacs.exe&quot;&lt;/strong&gt; - this is actually a shortcut to emacs located in above directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shortcut target:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;...\emacs\emacs-bin-w64-25.0.94-O2\emacs\bin\runemacs.exe -q -l config.emacs&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start in:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;...\emacs\&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Above works just fine but I would like to be able to change settings using &lt;em&gt;Custom&lt;/em&gt; mode. So in &lt;strong&gt;.emacs&lt;/strong&gt; I've added following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(user-init-file (concat (pwd) &quot;config/.emacs&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it turns out that with this setting the &quot;1 = Save for future session&quot; option is gone when I try to save changes done in Custom mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I added next line after that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-file user-init-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now both variables store correct path to &lt;strong&gt;.emacs&lt;/strong&gt; file. At least they store path I expect which is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;...\emacs\config\.emacs&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &quot;1 = Save for future session&quot; option is available back again but the problem occur when I try to use it. The minibufer give me this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A buffer is visiting&#xA;  .../emacs/emacs-bin-w64-25.0.94-O2/emacs/share/info/Directory&#xA;  .../emacs/config/Directory&#xA;  .../emacs/config/.emacs; proceed? n user-error:&#xA;  Aborted&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Basically it adds two additional paths to the one I specified. Why is that and how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="13007" LastActivityDate="2016-08-17T14:45:26.430" Title="Wrong file path when saving through &quot;customize&quot; interface" Tags="|init-file|customize|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26328" PostTypeId="2" ParentId="26320" CreationDate="2016-08-17T05:08:25.180" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/nflath/sudo-edit&quot; rel=&quot;nofollow&quot;&gt;https://github.com/nflath/sudo-edit&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also other more &quot;convenient&quot; but dangerous solutions(for example, we can advice &lt;code&gt;find-file&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-08-17T07:02:24.007" LastActivityDate="2016-08-17T07:02:24.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26329" PostTypeId="1" CreationDate="2016-08-17T05:25:48.110" Score="8" ViewCount="1188" Body="&lt;p&gt;In &lt;code&gt;Shell-script[sh]&lt;/code&gt; mode, Emacs defaults to this style of indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/this/is/an/example/command/broken/over_multiple_lines which \&#xA;                                                       causes \&#xA;                                                       an \&#xA;                                                       annoying \&#xA;                                                       indentation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to change this so that each line is indented by only a single tab further than the original line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/this/is/another example \&#xA;  which is indented \&#xA;  by a single tab \&#xA;  shown here \&#xA;  as two spaces&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what the relevant section of my &lt;code&gt;init.el&lt;/code&gt; says I have customised:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(sh-backslash-align t)&#xA; '(sh-basic-offset 2)&#xA; '(sh-indent-after-continuation nil)&#xA; '(sh-indent-for-continuation 0)&#xA; '(sh-indentation 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What variable am I missing to change the alignment indent to a single-tab indent?&lt;/p&gt;&#xA;" OwnerUserId="13009" LastActivityDate="2021-08-01T13:02:50.417" Title="How to turn off alignment-indent after line continuation in Shell-script mode?" Tags="|indentation|shell-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26331" PostTypeId="1" AcceptedAnswerId="26748" CreationDate="2016-08-17T09:13:01.640" Score="2" ViewCount="527" Body="&lt;p&gt;I have following problem. In a unfamiliar project I need to inspect the history of changes in a given file. So I open the file and run &lt;code&gt;M-x magit-log-buffer-file&lt;/code&gt;. That opens a log buffer listing commits in which that file was modified. Now I move to the commit I want to inspect and press &lt;kbd&gt;RET&lt;/kbd&gt; to show the revision buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that buffer point is placed at the beginning of the buffer, but I would like if Magit allowed jumping right to the diff of that one file I am interested in directly from the log buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, once in the revision buffer, I have search for the file in the list of files that changed, press &lt;kbd&gt;j&lt;/kbd&gt;, then press &lt;kbd&gt;C-l C-l&lt;/kbd&gt;, and finally the diff for the interesting file appears at the top of revision buffer.&lt;/p&gt;&#xA;" OwnerUserId="8952" LastEditorUserId="306" LastEditDate="2016-09-04T15:57:47.590" LastActivityDate="2016-09-04T15:57:47.590" Title="How do I jump to revision history of a file if many files have changed during the commit?" Tags="|magit|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26332" PostTypeId="1" CreationDate="2016-08-17T09:44:44.513" Score="1" ViewCount="159" Body="&lt;p&gt;Trivial example of what I would like to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'my-prefix-map)&#xA;&#xA;(defun populate-my-prefix ()&#xA;  (define-key my-prefix-map (kbd &quot;a&quot;) #'move-beginning-of-line))&#xA;&#xA;(define-key global-map (kbd &quot;&amp;lt;f6&amp;gt;&quot;) #'my-prefix-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Upon pressing &lt;code&gt;f6&lt;/code&gt; I would like to run &lt;code&gt;populate-my-prefix&lt;/code&gt;, before &lt;code&gt;my-prefix-map&lt;/code&gt; is executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think Hydra can do something like this (call another function upon entering the Hydra), but I'm writing my own package and would rather not depend on it.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="105" LastEditDate="2016-08-17T14:52:29.383" LastActivityDate="2016-08-17T14:52:29.383" Title="How do I run a function upon pressing a prefix key?" Tags="|key-bindings|prefix-keys|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26333" PostTypeId="2" ParentId="26316" CreationDate="2016-08-17T10:20:31.243" Score="0" Body="&lt;p&gt;I found the 2 culprits and am reporting here for future use of anyone else. Following Drew's suggestion I spent a few hours binary partitioning my config and found 2 packages that interfered with proper tramp use:&#xA;&lt;code&gt;keychain-environment&lt;/code&gt; and &lt;code&gt;dired-toggle-sudo&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorDisplayName="user8748" LastEditDate="2017-05-07T01:32:02.423" LastActivityDate="2017-05-07T01:32:02.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26334" PostTypeId="1" CreationDate="2016-08-17T10:58:37.900" Score="22" ViewCount="12116" Body="&lt;p&gt;I'm using Emacs for quite some time and I still somehow fail to understand what is the best way to (recursively) grep for a string within a (project) directory and get the results presented either as a dired buffer or in some even more useful way. Please enlighten me.&lt;/p&gt;&#xA;" OwnerUserId="12863" LastEditorUserId="12863" LastEditDate="2016-08-19T08:55:32.777" LastActivityDate="2018-01-25T11:41:43.913" Title="How to recursively search / grep file contents in a directory / subdirectories in Emacs?" Tags="|grep|" AnswerCount="5" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="26335" PostTypeId="1" AcceptedAnswerId="26344" CreationDate="2016-08-17T11:25:31.247" Score="2" ViewCount="5925" Body="&lt;p&gt;I am using emacs behind a firewall in Windows. I configured the access to proxy and I worked with no problems for a week. But now I can't upgrade emacs packages using Melpa, because the proxy refuses to download packages (&quot;Bad request&quot;). Any clue to what may happened?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the result of emacs with &lt;code&gt;--init-debug&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;http://melpa.milkbox.net/packages/archive-contents&quot; &quot;Bad Request&quot;)&#xA;  signal(file-error (&quot;http://melpa.milkbox.net/packages/archive-contents&quot; &quot;Bad Request&quot;))&#xA;  url-insert-file-contents(&quot;http://melpa.milkbox.net/packages/archive-contents&quot;)&#xA;  package--download-one-archive((&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) &quot;archive-contents&quot;)&#xA;  #[0 &quot;\301\300\302\&quot;\207&quot; [(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) package--download-one-archive &quot;archive-contents&quot;] 3 &quot;\n\n(fn)&quot;]()&#xA;  funcall(#[0 &quot;\301\300\302\&quot;\207&quot; [(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) package--download-one-archive &quot;archive-contents&quot;] 3 &quot;\n\n(fn)&quot;])&#xA;  package-refresh-contents()&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;c:/Users/sergio.bacelar/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 8124&#xA;  load-with-code-conversion(&quot;c:/Users/sergio.bacelar/.emacs.d/init.el&quot; &quot;c:/Users/sergio.bacelar/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;c:/Users/sergio.bacelar/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6988" LastEditorDisplayName="user227" LastEditDate="2016-08-17T11:30:20.517" LastActivityDate="2016-08-17T14:57:03.360" Title="Emacs behind firewall cannot download packages from Melpa" Tags="|package-repositories|upgrade|proxy|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26336" PostTypeId="1" CreationDate="2016-08-17T11:30:07.107" Score="1" ViewCount="831" Body="&lt;p&gt;So far I've been using Moba Xterm on Windows to connect via ssh to remote linux machines on my network, but I'd like to switch to Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, just running an eshell or shell buffer and trying to ssh from there ends poorly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Pseudo-terminal will not be allocated because stdin is not a terminal.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My understanding is that this is because shell and eshell are not &quot;real&quot; terminals like ansi-term, it also seems that they can't handle printing output and/or taking input in real time very well as they tend to print to stdout all of a program's output at once when it finishes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to access those machines directly from an emacs buffer, possibly with dired in the same frame to manipulate files at the same time. I know about tramp but I was not able to connect to any machines using it (connections time out as if those machines were not responding), and I can't access remote folders either. I know this should be possible in principle because I can ssh from powershell with no problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to clarify, my question boils down to this: what is the recommended procedure for connecting to remote machines via ssh in interactive mode on Windows, and what is the recommended procedure for accessing their files via dired?&lt;/p&gt;&#xA;" OwnerUserId="13011" LastActivityDate="2016-08-17T16:15:59.457" Title="Interactive SSH in Emacs" Tags="|tramp|ssh|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26338" PostTypeId="2" ParentId="14755" CreationDate="2016-08-17T12:33:01.763" Score="2" Body="&lt;p&gt;Lovely answer over here: &lt;a href=&quot;https://superuser.com/a/945245/624661&quot;&gt;https://superuser.com/a/945245/624661&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting:&#xA;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this in your Emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; esc always quits&#xA;(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)&#xA;(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)&#xA;(global-set-key [escape] 'keyboard-quit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2007" LastEditorUserId="-1" LastEditDate="2017-03-20T10:04:44.717" LastActivityDate="2016-08-17T12:33:01.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26339" PostTypeId="1" CreationDate="2016-08-17T12:56:35.503" Score="0" ViewCount="186" Body="&lt;p&gt;I am trying to assemble a list of features that work out of the box on Linux but will fail on a standard installation without addinng additional &lt;strong&gt;executables&lt;/strong&gt; or &lt;strong&gt;DLLs&lt;/strong&gt;, or are &lt;strong&gt;not implemented&lt;/strong&gt; at all for Windows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I am interested in features supported directly by the &lt;strong&gt;emacs lisp API&lt;/strong&gt; of a clean installation, potentially after updating packages from ELPA but not installing any new packages explicitly. Since there are inofficial binary releases like &lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Emacs-w64&lt;/a&gt;, the official releases from &lt;a href=&quot;https://ftp.gnu.org/gnu/emacs/windows/&quot; rel=&quot;nofollow&quot;&gt;gnu.org&lt;/a&gt; should be the relevant point of reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More explicitly, this includes the following groups:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Features lacking Windows-compatibility at the C-source level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one I ran into is ImageMagick support for transforming images without calling exeternal commands, which silently fails on Windows.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Libraries Emacs is normally linked against for binary Windows releases, whose corresponding DLL files are not shipped with Emacs (e.g. &lt;code&gt;libpng&lt;/code&gt; or &lt;code&gt;libjpeg&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dynamic-library-alist&lt;/code&gt; should give a complete list of such libraries. Unless it is incomplete, or it may include entries for libraries that the binary was not actually compiled against, nothing should have to be said about these. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Libraries which Emacs &lt;em&gt;could&lt;/em&gt; be linked against, but isn't in the binary release (if there are any). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ubiquitous Linux tools which are not present on Windows, which the standard emacs-lisp API and builtin interactive commands depend on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important examples are probably &lt;code&gt;find&lt;/code&gt; and &lt;code&gt;grep&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Executables required by extensions that are wide-spread enough to be now bundled with Emacs releases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example would be &lt;code&gt;org-mode&lt;/code&gt;, whose export feature requires a LaTeX distribution. It is also an example for the unimplemented ImageMagick dependence. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2308" LastEditorUserId="2308" LastEditDate="2016-08-26T09:23:34.497" LastActivityDate="2016-08-26T09:23:34.497" Title="Missing features on Windows" Tags="|microsoft-windows|libraries|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26340" PostTypeId="2" ParentId="26287" CreationDate="2016-08-17T13:36:32.647" Score="9" Body="&lt;p&gt;This is supported right out-of-the-box, by setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-special-ctrl-a/e t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a bonus C-e handles tags similarly to C-a handling asterisks.&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2016-08-17T13:36:32.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26341" PostTypeId="2" ParentId="26336" CreationDate="2016-08-17T13:46:02.247" Score="1" Body="&lt;p&gt;You must use the &quot;-T&quot; option with your ssh command in the shell to avoid the pseudo terminal error message.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-08-17T13:46:02.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26342" PostTypeId="2" ParentId="26336" CreationDate="2016-08-17T14:33:15.337" Score="2" Body="&lt;p&gt;Well Tramp is &lt;em&gt;the&lt;/em&gt; method for using the likes of dired on remote hosts. You'll want to debug why that's not working for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't explain why you're not using ansi-term, given that you seemingly know that it solves the problems you're experiencing. You could then use &lt;a href=&quot;https://emacs.stackexchange.com/a/18678&quot;&gt;https://emacs.stackexchange.com/a/18678&lt;/a&gt; to streamline the process.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-08-17T14:33:15.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26343" PostTypeId="2" ParentId="26326" CreationDate="2016-08-17T14:45:26.430" Score="1" Body="&lt;p&gt;&lt;code&gt;(setq foo (pwd))&lt;/code&gt;, then &lt;code&gt;C-h v foo&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value is not just a directory string.  It's a directory string preceded by &lt;code&gt;&quot;Directory &quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't use &lt;code&gt;pwd&lt;/code&gt;; use variable &lt;code&gt;default-directory&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-17T14:45:26.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26344" PostTypeId="2" ParentId="26335" CreationDate="2016-08-17T14:57:03.360" Score="2" Body="&lt;p&gt;The URL you're using is outdated; MELPA now serves from &lt;a href=&quot;https://melpa.org&quot; rel=&quot;nofollow&quot;&gt;https://melpa.org&lt;/a&gt;.  Please replace &lt;code&gt;(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;)&lt;/code&gt; in your &lt;code&gt;package-archives&lt;/code&gt; with &lt;code&gt;(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)&lt;/code&gt;.  Then restart Emacs and try again.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should the error still occur, please try &lt;code&gt;curl https://melpa.org/packages/archive-contents&lt;/code&gt; or &lt;code&gt;wget https://melpa.org/packages/archive-contents&lt;/code&gt; to check whether the error comes from Emacs' or from the proxy server.  If curl/wget return a bad request as well please contact the administrator of the proxy server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that &lt;a href=&quot;https://github.com/melpa/melpa/issues/4156&quot; rel=&quot;nofollow&quot;&gt;MELPA had some downtime recently&lt;/a&gt; so you may want to try again in a couple of days if you're still getting the error after changing the URLs.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-08-17T14:57:03.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26345" PostTypeId="2" ParentId="26222" CreationDate="2016-08-17T15:31:07.830" Score="10" Body="&lt;p&gt;In the following example, the word “ACTIVE” will appear in the mode-line of the window that is active, and all other windows will display the word “INACTIVE” in the mode-line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be sure to try this example with &lt;code&gt;emacs -Q&lt;/code&gt; to verify that it works as advertised.  Thereafter, customize it as needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add additional hooks as needed to call &lt;code&gt;ml-update-all&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar ml-selected-window nil)&#xA;&#xA;(defun ml-record-selected-window ()&#xA;  (setq ml-selected-window (selected-window)))&#xA;&#xA;(defun ml-update-all ()&#xA;  (force-mode-line-update t))&#xA;&#xA;(add-hook 'post-command-hook 'ml-record-selected-window)&#xA;&#xA;(add-hook 'buffer-list-update-hook 'ml-update-all)&#xA;&#xA;(setq-default mode-line-format&#xA;  '(:eval&#xA;      (if (eq ml-selected-window (selected-window))&#xA;        &quot;ACTIVE&quot;&#xA;        &quot;INACTIVE&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="25" LastEditDate="2016-08-17T19:34:54.957" LastActivityDate="2016-08-17T19:34:54.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26346" PostTypeId="1" AcceptedAnswerId="26409" CreationDate="2016-08-17T15:52:30.380" Score="0" ViewCount="462" Body="&lt;p&gt;I am looking for a way to export the html/text body part generated by org-mime-htmlize without the header.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use notmuch mail for most of my mailing and threading is very important to me, so I want to stay within one thread when replying.&#xA;When I send code snippets I use org-mime-htmlize for quick editing.&#xA;But currently I have to open an org-mode buffer, htmlize it, select and copy the body part from it and paste it in to my reply mail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if it is possible to &lt;strong&gt;only&lt;/strong&gt; export the body part to speed up copying and pasting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before doing something with within text searches, I wanted to ask, if there is maybe already a solution out there?&lt;/p&gt;&#xA;" OwnerUserId="9901" LastEditorUserId="11941" LastEditDate="2018-01-26T13:57:12.167" LastActivityDate="2018-01-26T13:57:12.167" Title="org-mime-htmlize export body only" Tags="|org-mime|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26347" PostTypeId="1" AcceptedAnswerId="26626" CreationDate="2016-08-17T16:11:22.487" Score="1" ViewCount="80" Body="&lt;p&gt;everyone, I need that emacs matchit in evil mode works like that one works in vim. Let me explain. I have this lines of code&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;; {{{ matchit&#xA;(unless (package-installed-p 'evil-matchit)&#xA;  (package-install 'evil-matchit))&#xA;(require 'evil-matchit)&#xA;(global-evil-matchit-mode 1)&#xA;(setq evilmi-ignore-comments nil)&#xA;; }}} matchit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I'm at position of closing curly bracket and press &lt;code&gt;%&lt;/code&gt; nothing happens in Emacs. But vim jumps to corresponding open curly bracket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please help me with this different behaviour? &lt;/p&gt;&#xA;" OwnerUserId="13014" LastEditorUserId="675" LastEditDate="2016-08-17T16:45:53.797" LastActivityDate="2016-08-27T12:29:52.717" Title="Match separated comments in evil mode" Tags="|evil|vim-emulation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26348" PostTypeId="2" ParentId="26336" CreationDate="2016-08-17T16:15:59.457" Score="2" Body="&lt;p&gt;I suppose your local machine runs MS Windows. In this case, I recommend you to install PuTTY locally. Afterwards, you shall be able to connect your remote machines via Tramp, using the &lt;code&gt;plink&lt;/code&gt; method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this doesn't work for you, we will be able to debug.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-08-17T16:15:59.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26349" PostTypeId="2" ParentId="26334" CreationDate="2016-08-17T16:56:31.823" Score="4" Body="&lt;p&gt;Here is an example of a custom grep function that recursively greps file contents (using a regexp for the search term) in a directory and its subdirectories, and displays the results with lines of context before and after.  The built-in &lt;code&gt;compile.el&lt;/code&gt; and &lt;code&gt;grep.el&lt;/code&gt; libraries provide for several methods to jump to the location in the file containing the search results.  There is no need to install anything else for this example to work -- all that is needed is a full version of Emacs and a computer that has the &lt;code&gt;grep&lt;/code&gt; utility installed.  The variable &lt;code&gt;grep-program&lt;/code&gt; can be adjusted to point to a particular location of the &lt;code&gt;grep&lt;/code&gt; utility if the default is not sufficient.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun recursive-grep ()&#xA;&quot;Recursively grep file contents.  `i` case insensitive; `n` print line number;&#xA;`I` ignore binary files; `E` extended regular expressions; `r` recursive&quot;&#xA;(interactive)&#xA;  (let* ((search-term (read-string &quot;regex:  &quot;))&#xA;         (search-path&#xA;           (directory-file-name (expand-file-name (read-directory-name &quot;directory:  &quot;))))&#xA;         (default-directory (file-name-as-directory search-path))&#xA;         (grep-command&#xA;           (concat&#xA;             grep-program&#xA;             &quot; &quot;&#xA;             &quot;-inIEr --color=always -C2&quot;&#xA;             &quot; &quot;&#xA;             search-term&#xA;             &quot; &quot;&#xA;             search-path)))&#xA;    (compilation-start grep-command 'grep-mode (lambda (mode) &quot;*grep*&quot;) nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-08-17T16:56:31.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26350" PostTypeId="2" ParentId="26334" CreationDate="2016-08-17T19:43:27.317" Score="24" Body="&lt;p&gt;Well, since the original question doesn't mention &lt;code&gt;rgrep&lt;/code&gt;, I'll go ahead and point it out here. This is the simplest option already built into Emacs, and I've found it to be more than sufficient for most things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the documentation,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Recursively grep for REGEXP in FILES in directory tree rooted at DIR.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The search is limited to file names matching shell pattern FILES.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for instance, to search all python files beneath my home directory for uses of&lt;code&gt;some_function&lt;/code&gt;, I would call it with &lt;code&gt;some_function&lt;/code&gt;, &lt;code&gt;*.py&lt;/code&gt;, &lt;code&gt;~/&lt;/code&gt; as the arguments.  Results are displayed in a new buffer.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2016-08-17T19:43:27.317" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26351" PostTypeId="1" AcceptedAnswerId="26369" CreationDate="2016-08-17T20:12:12.700" Score="5" ViewCount="1806" Body="&lt;p&gt;I'm trying to build custom agenda block which would sort completed tasks by &lt;em&gt;CLOSED&lt;/em&gt; property. &lt;code&gt;org-agenda-sorting-strategy&lt;/code&gt; only supports ordering by &lt;em&gt;SCHEDULED&lt;/em&gt; and &lt;em&gt;DEADLINE&lt;/em&gt; properties, so I guess only way to implement this is to use custom sorting function with &lt;code&gt;org-agenda-cmp-user-defined&lt;/code&gt;. Any help would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; custom sorting for closed items (does not work)&#xA;  (defun my/org-custom-cmp (a b)&#xA;    (org-cmp-ts a b &quot;closed&quot;)&#xA;    )&#xA;&#xA;  (setq org-agenda-cmp-user-defined 'my/org-custom-cmp)&#xA;&#xA;  (setq org-agenda-custom-commands&#xA;        '((&quot;z&quot; &quot;Tasks Overview&quot;&#xA;           ((tags &quot;+TODO=\&quot;DONE\&quot;+CLOSED&amp;gt;\&quot;&amp;lt;-3d&amp;gt;\&quot;&quot; ((org-agenda-cmp-user-defined 'my/org-custom-cmp)&#xA;                                                     (org-agenda-sorting-strategy '(user-defined-up))&#xA;                                                     (org-agenda-max-entries 15)&#xA;                                                     (org-agenda-overriding-header &quot;Recently Completed Tasks&quot;)))&#xA;&#xA;            ))&#xA;;; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13020" LastActivityDate="2021-03-06T05:24:09.493" Title="Custom sorting for agenda" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26352" PostTypeId="1" AcceptedAnswerId="26353" CreationDate="2016-08-17T23:01:14.027" Score="6" ViewCount="1912" Body="&lt;p&gt;How do I open startup/splash/welcome screen/message buffer (&lt;strong&gt;*GNU Emacs*&lt;/strong&gt;) when it's not listed in &lt;code&gt;list-buffers&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="13007" LastEditorUserId="105" LastEditDate="2016-08-17T23:11:57.110" LastActivityDate="2017-10-11T10:18:16.840" Title="Restore welcome screen buffer when closed" Tags="|buffers|start-up|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26353" PostTypeId="2" ParentId="26352" CreationDate="2016-08-17T23:06:23.313" Score="5" Body="&lt;p&gt;&lt;code&gt;M-: (fancy-about-screen)&lt;/code&gt;, or call &lt;code&gt;(fancy-about-screen)&lt;/code&gt; from your Lisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ePRY2.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ePRY2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is GNU Emacs, one component of the GNU operating system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.5.1 (i686-pc-mingw32)&#xA; of 2015-04-11 on LEG570&#xA;Copyright (C) 2015 Free Software Foundation, Inc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Authors Many people have contributed code included in GNU Emacs&#xA;Contributing    How to contribute improvements to Emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU and Freedom Why we developed GNU Emacs, and the GNU operating system&#xA;Absence of Warranty GNU Emacs comes with ABSOLUTELY NO WARRANTY&#xA;Copying Conditions  Conditions for redistributing and changing Emacs&#xA;Getting New Versions    How to obtain the latest version of Emacs&#xA;Ordering Manuals    Buying printed manuals from the FSF&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs Tutorial  Learn basic Emacs keystroke commands&#xA;Emacs Guided Tour   See an overview of Emacs features at gnu.org&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-17T23:06:23.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26354" PostTypeId="1" CreationDate="2016-08-18T00:28:22.880" Score="1" ViewCount="167" Body="&lt;p&gt;I like &lt;code&gt;sqlplus&lt;/code&gt; package on emacs.&lt;br&gt;&#xA;It works perfect when I use oracle dbms, however,&lt;br&gt;&#xA;my company uses &lt;code&gt;Tibero&lt;/code&gt;, which is not available on melpa repository.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to write a melpa package for this specific db.&lt;br&gt;&#xA;What procedures should I follow if I want to upload the package on melpa   repository?&lt;br&gt;&#xA;Is there a good tutorial for this?&lt;/p&gt;&#xA;" OwnerUserId="13022" LastEditorUserId="253" LastEditDate="2016-08-18T01:15:53.997" LastActivityDate="2016-08-18T01:15:53.997" Title="Uploading a package to melpa" Tags="|package-repositories|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26356" PostTypeId="2" ParentId="26334" CreationDate="2016-08-18T05:12:23.133" Score="6" Body="&lt;p&gt;Solution 1 (best solution):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install counsel (&lt;a href=&quot;https://github.com/abo-abo/swiper/blob/master/counsel.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/swiper/blob/master/counsel.el&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;M-x counsel-git-grep&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No setup needed (git knows the project root and files to exclude). Both &lt;code&gt;git grep&lt;/code&gt; and &lt;code&gt;counsel&lt;/code&gt; is efficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The project need be managed by git.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;counsel requires ivy-mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution uses grep and works on any project. It's inferior to the Solution 1 because it's slower and need manual setup. It's also based on ivy-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar simple-project-root &quot;~/.emacs.d&quot;)&#xA;(defun simple-grep ()&#xA;  (interactive)&#xA;  (unless (featurep 'ivy)&#xA;    (require 'ivy))&#xA;  (let* ((default-directory (file-name-as-directory simple-project-root))&#xA;         (keyword (read-string &quot;Keyword:&quot;)))&#xA;    (ivy-read (format &quot;Grep at %s:&quot; simple-project-root)&#xA;              (split-string (shell-command-to-string (format &quot;grep -rsnI %s .&quot; keyword)) &quot;\n&quot; t)&#xA;              :action (lambda (val)&#xA;                        (let* ((lst (split-string val &quot;:&quot;))&#xA;                               (linenum (string-to-number (cadr lst))))&#xA;                          ;; open file&#xA;                          (find-file (car lst))&#xA;                          ;; goto line if line number exists&#xA;                          (when (and linenum (&amp;gt; linenum 0))&#xA;                            (goto-char (point-min))&#xA;                            (forward-line (1- linenum))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You need create .dir-locals.el to setup &lt;code&gt;simple-project-root&lt;/code&gt;, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&lt;/a&gt; for technical details&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code in solution 2 is just a prototype. My real implementation is much more complex. See &lt;code&gt;counsel-etags-grep&lt;/code&gt; in &lt;a href=&quot;https://github.com/redguardtoo/counsel-etags/blob/master/counsel-etags.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/counsel-etags/blob/master/counsel-etags.el&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summary:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those are the best two solutions I know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If any other better solutions exist, they need at least solve below problems to be production-ready,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;how to get the keyword to grep (for example, get keyword from selected region)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;escape the keyword&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if more efficient grep program exist, we should use it (ripgrep, the_silver_searcher/ag, ... etc), or else fallback the default grep&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;candidate window should use full width of screen and users can filter candidates interactively (that's why people use ivy or helm)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;we should show the relative path in candidate window &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;able to re-use previous grepped result. So previous result should be saved. You can use &lt;code&gt;ivy-resume&lt;/code&gt; from &lt;code&gt;ivy&lt;/code&gt; or &lt;code&gt;helm-resume&lt;/code&gt; from &lt;code&gt;helm&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When you save previous grepped result, the context of previous result should also be saved. For example, in the code of of Solution 2. &lt;code&gt;default-directory&lt;/code&gt; is context. See &lt;a href=&quot;https://github.com/abo-abo/swiper/issues/591&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/swiper/issues/591&lt;/a&gt; for more details.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Extended regular expression should be used because it's simpler and is already used by &lt;code&gt;counsel-git-grep&lt;/code&gt; and the the_silver_searcher/ag.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2018-01-25T11:41:43.913" LastActivityDate="2018-01-25T11:41:43.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26357" PostTypeId="2" ParentId="14669" CreationDate="2016-08-18T07:29:11.883" Score="1" Body="&lt;p&gt;This is only a variation on PythonNut's answer but it's too long to fit properly in a comment. The main difference is that I advise once, and then the desired behaviour is obtained by binding a dynamical variable.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- mode: emacs-lisp; lexical-binding: t; -*-&#xA;&#xA;(defvar auto-answer 'ask&#xA;  &quot;When bound, yes-or-no questions will not prompt.&#xA;&#xA;When this variable is bound to a boolean value, the functions&#xA;`yes-or-no-p' and `y-or-n-p' will return that value without&#xA;prompting.  With its default value (the symbol `ask'), the&#xA;functions will prompt normally.&quot;)&#xA;&#xA;(defun auto-answer (oldfun &amp;amp;rest args)&#xA;  (if (booleanp auto-answer)&#xA;      auto-answer&#xA;    (apply oldfun args)))&#xA;&#xA;(advice-add 'y-or-n-p :around 'auto-answer)&#xA;(advice-add 'yes-or-no-p :around 'auto-answer)&#xA;&#xA;;; test it:&#xA;(y-or-n-p &quot;foo&quot;)&#xA;(let ((auto-answer t))&#xA;  (y-or-n-p &quot;foo&quot;))&#xA;(let ((auto-answer nil))&#xA;  (y-or-n-p &quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-08-18T07:29:11.883" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26358" PostTypeId="2" ParentId="26319" CreationDate="2016-08-18T09:34:32.887" Score="0" Body="&lt;p&gt;You can start from setting below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;cfw:org-capture-template should be evaluated before requiring calfw-org&#xA;(setq cfw:org-capture-template&#xA;      '(&quot;c&quot; &quot;calfw2org&quot; entry &#xA;        (file &quot;/path/to/your/gmail.org&quot;)&#xA;        &quot;*  %?\n %(cfw:org-capture-day)&quot;))&#xA;&#xA;(require 'calfw-org)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setting, you can create new appointment by pressing &quot;c&quot; on the calfw view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cf. &lt;a href=&quot;http://sheephead.homelinux.org/2014/03/15/7035/&quot; rel=&quot;nofollow&quot;&gt;http://sheephead.homelinux.org/2014/03/15/7035/&lt;/a&gt; (Japanese)&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-08-18T09:34:32.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26359" PostTypeId="1" AcceptedAnswerId="26362" CreationDate="2016-08-18T10:27:07.617" Score="3" ViewCount="124" Body="&lt;p&gt;As far as I can see I only have the options to pick either A, or B, but not both. I occasionally want to pick both A and B. I know I can just go to the C buffer and edit the file by hand, but it happens often enough that I'd love a key for it. (A different conflict resolution tool I've used in the past, though I cannot remember which, allowed two options: A then B, and B then A.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example follows. Let's say I have the following conflict:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fi&#xA;fo&#xA;fa&#xA;fum&#xA;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&#xA;foo&#xA;=======&#xA;bar&#xA;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bar&#xA;I&#xA;like&#xA;Bubble&#xA;Gum&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would then like an option &quot;A then B&quot; that would yield the following result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fi&#xA;fo&#xA;fa&#xA;fum&#xA;foo&#xA;bar&#xA;I&#xA;like&#xA;Bubble&#xA;Gum&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As extra bonus, I'd love a &quot;B then A&quot; option that would yield the following result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fi&#xA;fo&#xA;fa&#xA;fum&#xA;bar&#xA;foo&#xA;I&#xA;like&#xA;Bubble&#xA;Gum&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS: I usually invoke emerge from Magit. I'm not sure if this is relevant... Further, I'm on a Mac and I use Emacs 25 pre-test from &lt;a href=&quot;http://emacsformacosx.com/&quot; rel=&quot;nofollow&quot;&gt;http://emacsformacosx.com/&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="10625" LastActivityDate="2016-08-18T12:05:37.640" Title="Is there a way to ask Emerge to &quot;pick both&quot;?" Tags="|emerge|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26361" PostTypeId="1" AcceptedAnswerId="26376" CreationDate="2016-08-18T12:01:34.713" Score="4" ViewCount="577" Body="&lt;p&gt;I'm coming from vim, which has a &lt;code&gt;gq&lt;/code&gt; operator that acts much like emacs' &lt;code&gt;fill-paragraph&lt;/code&gt; function (&lt;code&gt;M-q&lt;/code&gt;). There's a &lt;code&gt;'formatprg'&lt;/code&gt; setting that allows you to point &lt;code&gt;gq&lt;/code&gt; at an external program for its formatting decisions, and I've found that using &lt;a href=&quot;http://www.nicemice.net/par/&quot; rel=&quot;nofollow&quot;&gt;par&lt;/a&gt; yields much nicer results than vim's default formatting logic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to do something equivalent in emacs (get it to use par). I see there's a &lt;code&gt;fill-paragraph-function&lt;/code&gt; variable, and I know that basically &lt;em&gt;anything&lt;/em&gt; is possible in emacs, but I'm not sure how to go about wiring it in. How could I do so?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-08-20T03:18:37.893" Title="How can I use par as my paragraph formatter" Tags="|formatting|fill-paragraph|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26362" PostTypeId="2" ParentId="26359" CreationDate="2016-08-18T12:05:37.640" Score="2" Body="&lt;p&gt;There are commands &lt;code&gt;i a&lt;/code&gt; and &lt;code&gt;i b&lt;/code&gt; which insert a or b; or &lt;code&gt;x c&lt;/code&gt; to combine using a template.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your bonus case you should use &lt;code&gt;a&lt;/code&gt; followed by &lt;code&gt;i b&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more about that &lt;a href=&quot;http://www.nongnu.org/emacsdoc-fr/manuel/emerge.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2016-08-18T12:05:37.640" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26363" PostTypeId="1" AcceptedAnswerId="27916" CreationDate="2016-08-18T12:33:05.523" Score="19" ViewCount="12704" Body="&lt;p&gt;I used to be able to scale down an inline image in org-mode with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+attr_html: :width 650 px&#xA;[[file:~/org/def/202a3-9.jpeg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now it doesn't work anymore, presumably because of an update to 8.3.5.  What to do?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2016-08-19T15:14:45.217" LastActivityDate="2020-07-30T00:21:03.517" Title="Downscaling inline images in org-mode" Tags="|org-mode|images|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26364" PostTypeId="2" ParentId="26319" CreationDate="2016-08-18T12:33:18.850" Score="4" Body="&lt;p&gt;I found a proper solution: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the following template to write to my &lt;code&gt;gmail.org&lt;/code&gt;. The neat thing is, as soon as I accept this template it automatically pushs it to Google.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* %^{Subject}&#xA;%^T&#xA;&#xA;%^{Description}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also got into the &lt;code&gt;org-capture&lt;/code&gt; thing. I add the following thing to my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &#xA;    'org &#xA;  (setq org-capture-templates&#xA;        '(&#xA;          (&quot;g&quot; &quot;Gmail&quot;)&#xA;          (&quot;ge&quot; &quot;Event&quot; entry (file &quot;~/Todo/gmail.org&quot;) &#xA;           (file &quot;~/Todo/.org-templates/event&quot;)&#xA;           :empty-lines-before 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the above template is just in the file &lt;code&gt;&quot;~/Todo/.org-templates/event&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2016-08-18T12:33:18.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26365" PostTypeId="1" AcceptedAnswerId="26389" CreationDate="2016-08-18T12:39:17.333" Score="10" ViewCount="1908" Body="&lt;p&gt;I'm using &lt;code&gt;sql-interactive-mode&lt;/code&gt;, and I'm in need for a Company backends that will complete SQL keywords, and preferably, also column/table names of the used database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When looking around for any completion, to my surprise, there was no backend for SQL yet. I found this &lt;a href=&quot;https://github.com/aadis/aadis-emacs-config/blob/master/as-sql-company.el&quot; rel=&quot;noreferrer&quot;&gt;snippet&lt;/a&gt;, but that didn't worked properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's possible it doesn't exist yet, and I might to create an own backend for SQL. But I find it hard to believe there is no Company backend for one of the most common languages. &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2016-08-20T14:38:11.863" Title="Is there a company backend for completion in sql-interactive-mode?" Tags="|company-mode|sql-interactive-mode|sql-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26366" PostTypeId="2" ParentId="25037" CreationDate="2016-08-18T12:43:59.817" Score="2" Body="&lt;p&gt;I have gtk+-3 installed by homebrew and I can see it using &lt;code&gt;pkg-config --list-all&lt;/code&gt;. I have the following in my .zshrc, which may matter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/Cellar/libxml2/2.9.2/lib/pkgconfig:/opt/X11/lib/pkgconfig:$PKG_CONFIG_PATH&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To enable the gtk3 toolkit you also need to disable nextstep as building option, adding &lt;code&gt;--without-ns&lt;/code&gt; to you configure.&lt;/p&gt;&#xA;" OwnerUserId="491" LastEditorUserId="491" LastEditDate="2016-08-19T12:54:46.973" LastActivityDate="2016-08-19T12:54:46.973" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26367" PostTypeId="2" ParentId="26363" CreationDate="2016-08-18T13:37:22.383" Score="-2" Body="&lt;p&gt;Some testing seem to show that just adding a space before the &lt;code&gt;#&lt;/code&gt; solve the problem. It look like a bug. May be you should report it to the org-list.&lt;/p&gt;&#xA;" OwnerUserId="2237" LastActivityDate="2016-08-18T13:37:22.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26369" PostTypeId="2" ParentId="26351" CreationDate="2016-08-18T15:44:25.290" Score="6" Body="&lt;p&gt;As @lawlist said the entry's properties are stored in text properties of the corresponding lines in the agenda.  We just have to extract those using &lt;code&gt;get-text-property&lt;/code&gt;.  Not every property makes it into the agenda, but there is an &lt;code&gt;org-marker&lt;/code&gt; property telling us were the original data is.  We can use that to extract whatever we like using &lt;code&gt;org-entry-get&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Here's a function that provides  a comparator based on any timestamp property:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun cmp-date-property (prop)&#xA;  &amp;quot;Compare two `org-mode' agenda entries, `A' and `B', by some date property.&#xA;&#xA;If a is before b, return -1. If a is after b, return 1. If they&#xA;are equal return nil.&amp;quot;&#xA;  (lexical-let ((prop prop))&#xA;  #'(lambda (a b)&#xA;&#xA;    (let* ((a-pos (get-text-property 0 'org-marker a))&#xA;           (b-pos (get-text-property 0 'org-marker b))&#xA;           (a-date (or (org-entry-get a-pos prop)&#xA;                       (format &amp;quot;&amp;lt;%s&amp;gt;&amp;quot; (org-read-date t nil &amp;quot;now&amp;quot;))))&#xA;           (b-date (or (org-entry-get b-pos prop)&#xA;                       (format &amp;quot;&amp;lt;%s&amp;gt;&amp;quot; (org-read-date t nil &amp;quot;now&amp;quot;))))&#xA;           (cmp (compare-strings a-date nil nil b-date nil nil))&#xA;           )&#xA;      (if (eq cmp t) nil (signum cmp))&#xA;      ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Just set &lt;code&gt;org-agenda-cmp-user-defined&lt;/code&gt; to &lt;code&gt;(cmp-date-property &amp;quot;CLOSED&amp;quot;)&lt;/code&gt; and it should work:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&amp;quot;z&amp;quot; &amp;quot;Tasks Overview&amp;quot;&#xA;               tags &amp;quot;+TODO=\&amp;quot;DONE\&amp;quot;+CLOSED&amp;gt;\&amp;quot;&amp;lt;-3d&amp;gt;\&amp;quot;&amp;quot;&#xA;               ((org-agenda-cmp-user-defined (cmp-date-property&#xA;                                              &amp;quot;CLOSED&amp;quot;))&#xA;                (org-agenda-sorting-strategy '(user-defined-up)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Two things to note:  it compares the timestamps as strings which is basically fine using the default timestamp format, less fine otherwise; if the property in question doesn't exist it's value defaults to &lt;code&gt;&amp;lt;now&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2021-03-06T05:24:09.493" LastActivityDate="2021-03-06T05:24:09.493" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="26370" PostTypeId="1" AcceptedAnswerId="26372" CreationDate="2016-08-18T18:03:21.227" Score="0" ViewCount="53" Body="&lt;p&gt;I am new user of auctex/reftex and the &lt;code&gt;reftex-toc&lt;/code&gt;-function is brilliant. &#xA;However, on my small screen a lot of space is wasted when I have a document with only chapters, or even sections. (I put the toc on the left side of my 11-inch screen.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parts are indented with one leading space, chapters with three, sections with five. &#xA;Is it possible to remove/hide the extraneous indentation when it is not needed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TABLE-OF-CONTENTS on ~/test.tex&#xA;SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help&#xA;------------------------------------------------------------------------------&#xA; Part I Part level&#xA;    1 Chapter level&#xA;      1.1 Section Level&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Document with no parts or chapters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;------------------------------------------------------------------------------&#xA;      1 This document has only sections&#xA;      2 Like this&#xA;      3 And this&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13027" LastActivityDate="2016-08-18T19:50:56.163" Title="Can I remove the indentation in {reftex-toc}?" Tags="|indentation|auctex|reftex-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26371" PostTypeId="2" ParentId="24127" CreationDate="2016-08-18T18:24:50.120" Score="10" Body="&lt;p&gt;You need to enable multi-line commands support in GHCi. Put &lt;code&gt;:set +m&lt;/code&gt; to GHCi config file or execute it directly in org-babel session as shown in the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src haskell&#xA;&#xA;:set +m&#xA;&#xA;let doubleSmallNumber4 x = if x &amp;gt; 0&#xA;                            then x &#xA;                             else x*2 &#xA;&#xA;doubleSmallNumber4 42&#xA;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: 42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10115" LastActivityDate="2016-08-18T18:24:50.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26372" PostTypeId="2" ParentId="26370" CreationDate="2016-08-18T19:50:56.163" Score="1" Body="&lt;p&gt;The indentation is set by variable &lt;code&gt;reftex-level-indent&lt;/code&gt;. Its default value is 2, that is why indentation is 1,3,5 etc.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;-- User Option: reftex-level-indent&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Number of spaces to be used for indentation per section level.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You may simply set it to 0.&lt;/p&gt;&#xA;&lt;p&gt;This way, all levels are indented at 1, I don't know how to get rid of the remaining initial space.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-08-18T19:50:56.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26373" PostTypeId="1" AcceptedAnswerId="26394" CreationDate="2016-08-18T20:02:18.243" Score="0" ViewCount="314" Body="&lt;p&gt;I run zsh in multi-term. &lt;code&gt;M-p&lt;/code&gt; and &lt;code&gt;M-n&lt;/code&gt; allow me to jump through the input history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make &lt;code&gt;M-p&lt;/code&gt; and &lt;code&gt;M-n&lt;/code&gt; behave like &lt;code&gt;up-line-or-beginning-search&lt;/code&gt; and &lt;code&gt;down-line-or-beginning-search&lt;/code&gt; (jumping only through entries which start with the already input characters)?&lt;/p&gt;&#xA;" OwnerUserId="13001" LastActivityDate="2016-08-19T20:15:06.900" Title="zsh in multi-term" Tags="|history|multi-term|zsh|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26374" PostTypeId="1" AcceptedAnswerId="27033" CreationDate="2016-08-18T21:19:51.390" Score="1" ViewCount="610" Body="&lt;p&gt;Does anyone know how to setup org-mode so that you can write/process applescript from within org source code blocks? I.e.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC applescript&#xA;&#xA;tell application &quot;Emacs&quot;&#xA;    [do something amazing]&#xA;end tell&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastActivityDate="2016-09-12T14:00:18.580" Title="AppleScript in Org-Mode source code blocks?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26375" PostTypeId="2" ParentId="26374" CreationDate="2016-08-18T21:35:16.157" Score="2" Body="&lt;p&gt;Not sure if Org Babel supports AppleScript, but it supports bash. You can run applescript from Bash using &lt;code&gt;osascript&lt;/code&gt; and a bash &lt;code&gt;heredoc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh&#xA;  osascript &amp;lt;&amp;lt;'END'&#xA;  display dialog &quot;Hello, World&quot;&#xA;  END&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;SE doesn't allow proper formatting. The &lt;code&gt;END&lt;/code&gt; statement should be all the way to the left, with no spaces before it.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-08-18T21:35:16.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26376" PostTypeId="2" ParentId="26361" CreationDate="2016-08-19T00:16:47.893" Score="3" Body="&lt;p&gt;Essentially you want your function to do the equivalent of marking the paragraph and typing &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;M-|&lt;/kbd&gt; &lt;code&gt;par&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-fill-paragraph-using-par (&amp;amp;optional _justify)&#xA;  &quot;Invoke shell command `par' on the current paragraph.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (mark-paragraph)&#xA;    (forward-whitespace 1)&#xA;    (shell-command-on-region (point) (mark) &quot;par&quot; nil :replace))&#xA;  t) ;; Don't return nil. See variable `fill-paragraph-function'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-08-19T00:16:47.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26377" PostTypeId="1" AcceptedAnswerId="26388" CreationDate="2016-08-19T05:09:54.543" Score="3" ViewCount="1056" Body="&lt;p&gt;Suppose I want to debug Python script in Emacs. &lt;code&gt;M-x pdb&lt;/code&gt; &lt;code&gt;run pdb like this pdb script name.py&lt;/code&gt;. Next I'd like to examine a variable. I type &lt;code&gt;p&lt;/code&gt; and first letters of a variable name, then press &lt;code&gt;Tab&lt;/code&gt; and instead of completion of the variable name cursor moves right. Ho to achieve completion of a variable name on &lt;code&gt;Tab&lt;/code&gt; press while debugging Pyhon in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="13031" LastActivityDate="2016-08-20T12:16:18.823" Title="Autocompletion of a variable name while Python debugging" Tags="|python|auto-complete-mode|debug|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26378" PostTypeId="1" CreationDate="2016-08-19T08:58:49.973" Score="0" ViewCount="251" Body="&lt;p&gt;I recently notice that there's some strange behaviours of the font-lock of the c++-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start emacs by &lt;code&gt;emacs -Q&lt;/code&gt; in the terminal, edit a new file &lt;code&gt;test.cpp&lt;/code&gt; and save the following contents&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KEPsy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KEPsy.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then put the cursor two lines above the &lt;code&gt;int main&lt;/code&gt; line, type &lt;code&gt;int test&lt;/code&gt;, you will find that the color of word &lt;code&gt;main&lt;/code&gt; changes from &lt;em&gt;blue&lt;/em&gt; to &lt;em&gt;black&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/51d6U.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/51d6U.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Backspace the current line to &lt;code&gt;in&lt;/code&gt; or &lt;code&gt;i&lt;/code&gt;, you will see that the color of &lt;code&gt;main&lt;/code&gt; change back to &lt;em&gt;blue&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not a very big problem under this test, but I use color theme that the function names are in &lt;em&gt;bold&lt;/em&gt; type. So when I add a function above another function, the font-lock of the below one keep changing all the time which is really annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a emacs bug ? I want &lt;em&gt;bold&lt;/em&gt; function name and other keywords but how can I get rid of it ? Any help will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-08-19T08:58:49.973" Title="font-lock problem of c++ mode" Tags="|major-mode|font-lock|c++|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26379" PostTypeId="2" ParentId="26334" CreationDate="2016-08-19T09:19:09.330" Score="17" Body="&lt;p&gt;I happily use &lt;code&gt;M-x find-grep-dired&lt;/code&gt; for years. It returns the results as a dired buffer, which you could use.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-08-19T09:19:09.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26382" PostTypeId="2" ParentId="18405" CreationDate="2016-08-19T12:33:59.587" Score="1" Body="&lt;p&gt;Yep, I ran into the same problem. &lt;code&gt;org&lt;/code&gt; and &lt;code&gt;linum&lt;/code&gt; are somehow incompatible.&lt;br&gt;&#xA;As a different solution you can also use a hook and simply disable &lt;code&gt;linum-mode&lt;/code&gt; when &lt;code&gt;org&lt;/code&gt; is the major mode.&lt;br&gt;&#xA;I also do this for &lt;code&gt;drag-stuff&lt;/code&gt; since it violates &lt;code&gt;org-mode&lt;/code&gt;'s shortcuts.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook &#xA;          (lambda () &#xA;            (drag-stuff-mode -1) &#xA;            (linum-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2016-08-19T12:33:59.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26384" PostTypeId="1" AcceptedAnswerId="27160" CreationDate="2016-08-19T13:31:41.323" Score="0" ViewCount="236" Body="&lt;p&gt;I'd like a way to lazily activate certain ~/.emacs.d/elpa packages. I notice some of them have so many autoloads (which require other packages recursively from their &lt;code&gt;*-autoloads.el&lt;/code&gt;), that you might as well just &lt;code&gt;(require 'them)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I, for example, activate all &lt;em&gt;except&lt;/em&gt; certain packages? I see you can set &lt;code&gt;package-load-list&lt;/code&gt; to &lt;code&gt;(all)&lt;/code&gt; or a list of names and versions, but I can't see anything like &lt;code&gt;(all-but ,(alist))&lt;/code&gt; in the docs. &lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2017-08-15T19:29:04.617" Title="lazily activate an ELPA package?" Tags="|package|start-up|autoload|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26385" PostTypeId="2" ParentId="26384" CreationDate="2016-08-19T14:19:20.923" Score="0" Body="&lt;p&gt;This seems to do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize 'no-activate)&#xA;(let* ((no-activate '(a-slow-package an-even-slower-package)))&#xA;    (mapc (lambda (s) (unless (member s no-activate)&#xA;                (package-activate s)))&#xA;          (mapcar #'car package-alist)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="730" LastActivityDate="2016-08-19T14:19:20.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26386" PostTypeId="1" CreationDate="2016-08-19T16:15:40.937" Score="1" ViewCount="989" Body="&lt;p&gt;There are several posts and information around for changing the mode-line face properties, like size. I tried them for a smaller mode-line, using:&#xA;&lt;code&gt;&#xA;(set-face-attribute 'mode-line nil  :height 100)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works fine, but I've just realized that this also changes the top (header?) line that I use for &lt;code&gt;sticky-func-mode&lt;/code&gt;, which is unfortunate because it is smaller than my buffer face and disrupts the visual structure of the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the mode-line size without affecting the header line (I'm not sure how its called)?&lt;/p&gt;&#xA;" OwnerUserId="864" LastActivityDate="2016-12-19T16:18:50.880" Title="Change mode-line size without changing header line" Tags="|faces|mode-line|header-line|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26387" PostTypeId="2" ParentId="26361" CreationDate="2016-08-19T16:24:35.690" Score="4" Body="&lt;p&gt;Here I have taken what &lt;strong&gt;@phils&lt;/strong&gt; had posted and have modified it to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Take more &lt;code&gt;par&lt;/code&gt; options &lt;/li&gt;&#xA;&lt;li&gt;Apply &lt;code&gt;par&lt;/code&gt; formatting only on the region, without limiting to paragraph marking because &lt;code&gt;mark-paragraph&lt;/code&gt; relies on the major mode to work correctly.&lt;/li&gt;&#xA;&lt;li&gt;Attempt to make this work on code comments (by marking &lt;code&gt;comment-start&lt;/code&gt; characters as &lt;em&gt;Quote characters&lt;/em&gt; for &lt;code&gt;par&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Attempt to handle &lt;code&gt;par&lt;/code&gt; errors more gracefully and try not to mess up the user's original buffer in the event of error&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;How to use the below code&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Evaluate the below code&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-h M-H&lt;/code&gt; if you want to fill the region in a paragraph&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Code&lt;/h2&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; par - http://www.nicemice.net/par/&#xA;(when (executable-find &quot;par&quot;)&#xA;  (defun modi/par-fill-region (begin end par-option)&#xA;    &quot;Use `par' executable to fill region between BEGIN and END.&#xA;&#xA;If PAR-OPTION is \\='(4) `\\[universal-argument]', also justify the text.&#xA;If PAR-OPTION is \\='(16) `\\[universal-argument] \\[universal-argument]', try to&#xA;make all lines of almost equal lengths instead of justifying.&#xA;&#xA;See `man par' for more information.&quot;&#xA;    (interactive &quot;r\nP&quot;)&#xA;    (let* ((width-str (number-to-string fill-column))&#xA;           (err-buf &quot;*par Error*&quot;)&#xA;           (par-cmd&#xA;            (concat &quot;par &quot;&#xA;                    &quot;w&quot; width-str &quot; &quot; ; set fill width&#xA;                    ;; Body characters: . , ? upper-case lower-case&#xA;                    (shell-quote-argument &quot;B=.,?_A_a&quot;) &quot; &quot;&#xA;                    ;; Quote characters: space &amp;gt; | &amp;lt;comment-start char&amp;gt;&#xA;                    (shell-quote-argument&#xA;                     (concat &quot;Q=_s&amp;gt;|&quot; (when comment-start comment-start))) &quot; &quot;&#xA;                     ;; Allow bodiless characters like *, space, .. to inc/dec by&#xA;                     ;; up to 10 characters to adjust line width.&#xA;                     &quot;r10&quot;&#xA;                     &quot;T4&quot; ; Expand tab chars to 4 spaces&#xA;                     ;; Prefixes may not contain any trailing body characters, and&#xA;                     ;; suffixes may not contain any leading body characters&#xA;                     &quot;b&quot;&#xA;                     &quot;e&quot; ; Expel/remove superfluous lines&#xA;                     (when (equal '(16) par-option)&#xA;                       &quot;f&quot;) ; Try to make all lines of nearly the same length&#xA;                     &quot;g&quot; ; Make a better guess at inserting line breaks&#xA;                     (when (equal '(4) par-option)&#xA;                       &quot;j&quot;) ; Justify the lines by inserting spaces between words&#xA;                     &quot;q&quot; ; Insert blank lines before/after quoted text&#xA;                     &quot;R&quot; ; Throw an error if a word length exceeds the fill width&#xA;                     &quot;E&quot; )) ; Send error to stderr instead of stdout&#xA;           (before-text (buffer-substring-no-properties begin end))&#xA;           par-ret&#xA;           ;; Do the formatting in a temp buffer so that the text in the original&#xA;           ;; buffer doesn't get corrupted in case `par' fails due to some error.&#xA;           (after-text (with-temp-buffer&#xA;                         (insert before-text)&#xA;                         (setq par-ret (shell-command-on-region&#xA;                                        (point-min) (point-max)&#xA;                                        par-cmd nil :replace&#xA;                                        err-buf :display-error-buffer))&#xA;                         (buffer-substring-no-properties (point-min) (point-max)))))&#xA;      ;; If 1 is returned, error occurred in the cmd execution; 0 - no error&#xA;      (if (= 1 par-ret)&#xA;          (progn&#xA;            ;; Switch to the error buffer&#xA;            (switch-to-buffer-other-window err-buf)&#xA;            (special-mode)) ; Set this mode so that you can quit it quickly using C-u q&#xA;        ;; If no error occurred, do below in the original buffer &#xA;        (delete-region begin end)&#xA;        (insert after-text))&#xA;      (message &quot;Executed `%s' on the region&quot; par-cmd)))&#xA;  ;; Rationale for the below binding is that it flows very well when selecting a&#xA;  ;; paragraph and then filling that region: &quot;M-h M-H&quot;&#xA;  (global-set-key (kbd &quot;M-H&quot;) #'modi/par-fill-region))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2016-08-20T03:18:37.893" LastActivityDate="2016-08-20T03:18:37.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26388" PostTypeId="2" ParentId="26377" CreationDate="2016-08-19T17:06:23.130" Score="2" Body="&lt;p&gt;I have used &lt;code&gt;M-x pdb&lt;/code&gt; on and off for quite some time now, and while I would love to be corrected on this, unfortunately I don't think it supports tab completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have recently started playing with &lt;a href=&quot;https://github.com/realgud/realgud/&quot; rel=&quot;nofollow noreferrer&quot;&gt;RealGUD&lt;/a&gt;, and if you use this package with &lt;code&gt;ipdb&lt;/code&gt; instead of &lt;code&gt;pdb&lt;/code&gt; you will get some really nice features &lt;strong&gt;&lt;em&gt;including tab completion&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DdOve.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DdOve.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x pdb&lt;/code&gt; is nice because it is built in, but I personally have never found it to be satisfactory for my needs. &lt;/p&gt;&#xA;" OwnerUserId="8430" LastEditorUserId="8430" LastEditDate="2016-08-20T12:16:18.823" LastActivityDate="2016-08-20T12:16:18.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26389" PostTypeId="2" ParentId="26365" CreationDate="2016-08-19T17:15:16.850" Score="4" Body="&lt;p&gt;I had a similar problem and decided to create my own backend.  One of the existing backends (C++?) was used as a template and I modified it to create the new back end which behaves like a dictionary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my setup SQLi buffers are automatically named to match the database that is being connected to, eg. &lt;code&gt;*DB:DBASE1DM*&lt;/code&gt;.  The backend contains an alist for each database with the schemas, tables, and columns.  When I want to complete something the name of the buffer is used to get the correct list of candidates for that database.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ry/company-sql-upper-lower (&amp;amp;rest lst)&#xA;  (nconc (sort (mapcar 'upcase lst) 'string&amp;lt;) lst))&#xA;&#xA;(defvar ry/company-sql-alist&#xA;  `((&quot;DBASE1&quot;               ;; Database name w/o environment suffix.&#xA;     &quot;DBASE1DM&quot; &quot;DBASE1UM&quot;  ;; Database name with environment suffix.&#xA;     &quot;SCHEMA1&quot; &quot;SCHEMA2&quot;&#xA;     &quot;TABLE1&quot; &quot;TABLE2&quot;&#xA;     &quot;COLUMN1&quot; &quot;COLUMN2&quot;)&#xA;    (&quot;DBASE2&quot;&#xA;     &quot;DBASE2DM&quot; &quot;DBASE2UM&quot;&#xA;     &quot;SCHEMA1&quot; &quot;SCHEMA2&quot;&#xA;     &quot;TABLE1&quot; &quot;TABLE2&quot;&#xA;     &quot;COLUMN1&quot; &quot;COLUMN2&quot;))&#xA;    &quot;Alist mapping sql-mode to candidates.&quot;)&#xA;&#xA;(defun ry/company-sql (command &amp;amp;optional arg &amp;amp;rest ignored)&#xA;  &quot;`company-mode' back-end for SQL mode based on database name.&quot;&#xA;  (interactive (list 'interactive))&#xA;  (cl-case command&#xA;    (interactive (company-begin-backend 'ry/company-sql))&#xA;    (prefix (and (assoc (substring (buffer-name (current-buffer)) 4 -3) ry/company-sql-alist)&#xA;                 (not (company-in-string-or-comment))&#xA;                 (or (company-grab-symbol) 'stop)))&#xA;    (candidates&#xA;     (let ((completion-ignore-case t)&#xA;           (symbols (cdr (assoc (substring (buffer-name (current-buffer)) 4 -3) ry/company-sql-alist))))       &#xA;       (all-completions arg (if (consp symbols)&#xA;                                symbols&#xA;                              (cdr (assoc symbols company-sql-alist))))))&#xA;    (sorted t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the downside that it's not a smart completion and that including new databases or making modifications to existing databases is a manual process.  A couple queries can be used to gather the data and then it isn't very hard to massage it into the format needed for the backend.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function below handles connecting to a database and changing the names of the buffers to match the database that is connected to.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ry/sql-open-database (database username password)&#xA;  &quot;Open a SQLI process and name the SQL statement window with the name provided.&quot;&#xA;  (interactive (list&#xA;                (read-string &quot;Database: &quot;)&#xA;                (read-string &quot;Username: &quot;)&#xA;                (read-passwd &quot;Password: &quot;)))&#xA;  (let ((u-dbname (upcase database)))&#xA;    (setq sql-set-product &quot;db2&quot;)&#xA;&#xA;    (sql-db2 u-dbname)&#xA;    (sql-rename-buffer u-dbname)&#xA;    (setq sql-buffer (current-buffer))&#xA;    (sql-send-string (concat &quot;CONNECT TO &quot; database &quot; USER &quot; username &quot; USING &quot; password &quot;;&quot;))&#xA;&#xA;    (other-window 1)&#xA;    (switch-to-buffer (concat &quot;*DB:&quot; u-dbname &quot;*&quot;))&#xA;    (sql-mode)&#xA;    (sql-set-product &quot;db2&quot;)&#xA;    (setq sql-buffer (concat &quot;*SQL: &quot; u-dbname &quot;*&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13039" LastEditorUserId="13039" LastEditDate="2016-08-20T14:38:11.863" LastActivityDate="2016-08-20T14:38:11.863" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26390" PostTypeId="1" CreationDate="2016-08-19T18:21:26.537" Score="6" ViewCount="1022" Body="&lt;p&gt;Is there a way to tell Emacs to ignore a certain key binding and pass it to the OS unmodified? Eg. I am typing German from time to time and use &lt;code&gt;Alt+u o&lt;/code&gt; to type ö in OS X apps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Alt set to Meta I would like to tell emacs to ignore the &lt;code&gt;M-u&lt;/code&gt; binding, so that I can use &lt;code&gt;M-u o&lt;/code&gt; to enter ö as in other applications. &lt;code&gt;(global-unset-key (kbd &quot;M-u&quot;))&lt;/code&gt; does remove the binding from emacs, but pressing &lt;code&gt;M-u&lt;/code&gt; does nothing, instead of adding an umlaut to the next pressed character.&lt;/p&gt;&#xA;" OwnerUserId="13001" LastEditorUserId="25" LastEditDate="2016-08-19T22:57:34.120" LastActivityDate="2016-08-19T22:57:34.120" Title="Passing Alt+letter keybindings through to OSX?" Tags="|key-bindings|osx|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26391" PostTypeId="1" AcceptedAnswerId="26402" CreationDate="2016-08-19T19:47:07.600" Score="1" ViewCount="61" Body="&lt;p&gt;If I modify my &lt;code&gt;.emacs&lt;/code&gt; file I usually call &lt;code&gt;eval-buffer&lt;/code&gt; to apply all changes to existing buffers without restarting emacs. Now I have the following lines to invoke &lt;code&gt;helm-mini&lt;/code&gt; each time emacs starts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (&amp;lt; (length command-line-args) 2) &#xA;(setq initial-buffer-choice (car (helm-mini)))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that if I call &lt;code&gt;eval-buffer&lt;/code&gt; it displays a helm mini buffer each time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make emacs exclude those lines when calling &lt;code&gt;eval-buffer&lt;/code&gt; or alternatively, how can I change the code lines above such that the problem doesn't occur anymore?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-08-20T02:53:55.680" Title="Exclude parts of .emacs when executing eval-buffer" Tags="|init-file|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26392" PostTypeId="2" ParentId="26390" CreationDate="2016-08-19T20:02:09.023" Score="0" Body="&lt;p&gt;The problem is that, for Emacs, keys call commands.  Even simple&#xA;events like entering characters are calling commands: every time&#xA;you go to enter &quot;o&quot;, for example, you are, in fact, calling&#xA;&lt;code&gt;self-insert-command&lt;/code&gt; (try hitting &lt;code&gt;C-h k o&lt;/code&gt; to read about it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your case, the problem is that Emacs will ignore&#xA;&lt;code&gt;M-u&lt;/code&gt; (because you told it to) and see only the &quot;o&quot; keypress --&#xA;not the &quot;ö&quot; you think you're sending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, we can bind the sequence &lt;code&gt;M-u o&lt;/code&gt; to insert &quot;ö&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, you can pass a string in place of a command to have it&#xA;inserted:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-u o&quot;) &quot;kittens&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems like we should be able to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-u o&quot;) &quot;ö&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get an odd error on my machine when I do it, so we're going&#xA;with a more circuitous route:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-u o&quot;)&#xA;                (lambda ()&#xA;                  &quot;Insert ö.&quot;&#xA;                  (interactive)&#xA;                  (insert &quot;ö&quot;)))&#xA;&#xA;(global-set-key (kbd &quot;M-u O&quot;)&#xA;                (lambda ()&#xA;                  &quot;Insert Ö.&quot;&#xA;                  (interactive)&#xA;                  (insert &quot;Ö&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing that for all of the characters is bound to get tedious, of course.  Instead, you might consider using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Input-Methods.html&quot; rel=&quot;nofollow&quot;&gt;input methods&lt;/a&gt;, especially the &lt;a href=&quot;https://www.emacswiki.org/emacs/TeXInputMethod&quot; rel=&quot;nofollow&quot;&gt;TeX input method&lt;/a&gt;.  See, for example, &lt;a href=&quot;https://www.masteringemacs.org/article/diacritics-in-emacs&quot; rel=&quot;nofollow&quot;&gt;Olé! Diacritics in Emacs&lt;/a&gt; (from Mickey Petersen's &lt;a href=&quot;https://www.masteringemacs.org/&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Mastering Emacs&lt;/em&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-08-19T20:09:22.153" LastActivityDate="2016-08-19T20:09:22.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26394" PostTypeId="2" ParentId="26373" CreationDate="2016-08-19T20:15:06.900" Score="0" Body="&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;term&quot;&#xA;  (defun term-send-M-p ()&#xA;    &quot;Type M-p in `term-mode'.&quot;&#xA;    (interactive)&#xA;    (term-send-raw-string &quot;\ep&quot;))&#xA;&#xA;  (defun term-send-M-n ()&#xA;    &quot;Type M-n in `term-mode'.&quot;&#xA;    (interactive)&#xA;    (term-send-raw-string &quot;\en&quot;))&#xA;&#xA;  (define-key term-raw-map (kbd &quot;M-p&quot;) #'term-send-M-p)&#xA;  (define-key term-raw-map (kbd &quot;M-n&quot;) #'term-send-M-n))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think &lt;code&gt;multi-term&lt;/code&gt; binds &lt;code&gt;M-p&lt;/code&gt; and &lt;code&gt;M-n&lt;/code&gt; to &lt;code&gt;term-send-up&lt;/code&gt; and &lt;code&gt;term-send-down&lt;/code&gt; by default, which tries to do the same as pressing the arrows in a terminal.  IIRC, &lt;code&gt;multi-term&lt;/code&gt; has an elaborate binding override mechanism, which you may have to use instead of plain &lt;code&gt;define-key&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="651" LastActivityDate="2016-08-19T20:15:06.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26395" PostTypeId="2" ParentId="26390" CreationDate="2016-08-19T20:38:15.593" Score="7" Body="&lt;p&gt;When Emacs is built &lt;code&gt;--with-ns&lt;/code&gt; for OSX operating systems, the user has configuration options to disable the left and/or right meta key to achieve default OS behavior:  &lt;code&gt;ns-alternate-modifier&lt;/code&gt; for the left alt/option key, and &lt;code&gt;ns-right-alternate-modifier&lt;/code&gt; for right alt/option key. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I keep the left alt/option key as meta and disable the right alt/option key within Emacs so that I can write in foreign languages (taking advantage of default OS behavior with the right alt/option key).  Here are my settings for Emacs for OSX and Windows.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(cond&#xA;  ((eq system-type 'darwin)&#xA;    (setq ns-alternate-modifier 'meta)&#xA;    (setq ns-right-alternate-modifier 'none)&#xA;    (setq ns-command-modifier 'super)&#xA;    (setq ns-right-command-modifier 'left)&#xA;    (setq ns-control-modifier 'control)&#xA;    (setq ns-right-control-modifier 'left)&#xA;    (setq ns-function-modifier 'none))&#xA;  ((eq system-type 'windows-nt)&#xA;    (setq w32-pass-lwindow-to-system nil)&#xA;    (setq w32-pass-rwindow-to-system nil)&#xA;    (setq w32-lwindow-modifier 'super)&#xA;    (setq w32-rwindow-modifier 'super)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-08-19T21:08:16.133" LastActivityDate="2016-08-19T21:08:16.133" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26396" PostTypeId="1" AcceptedAnswerId="26398" CreationDate="2016-08-19T21:28:56.150" Score="2" ViewCount="50" Body="&lt;p&gt;Inspired by &lt;a href=&quot;http://emacsredux.com/blog/2013/06/21/eval-and-replace/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; blog I wrote a function which replaces arithmetic expressions between two $ symbols with the mathematical result inline (and deletes the $ symbols). How can I modify this such that it recognizes if the expression is invalid and prints an error message (without without modifying or replacing the expression) in this case in the minibuffer. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'calc)&#xA;(defun calc-eval-and-insert ()&#xA;  &quot;Replaces an arithmetic expression between two $ sympols with the result. Example expression: $2*(3 + round(5.5))$&quot; &#xA;  (interactive)&#xA;  (let (result p1 p2)&#xA;    (skip-chars-backward &quot;^$“&quot;)&#xA;    (setq p1 (point))&#xA;    (skip-chars-forward &quot;^$“&quot;)&#xA;    (setq p2 (point))&#xA;    (setq result (calc-eval (buffer-substring-no-properties p1 p2)))&#xA;    (goto-char p1)&#xA;    (delete-char -1)&#xA;    (setq p1 (point))&#xA;    (goto-char p2)&#xA;    (delete-char -1)    &#xA;    (delete-region p1 p2)&#xA;    ;(insert &quot; = &quot; result)&#xA;    (insert result)&#xA;    )&#xA;  )&#xA;&#xA;&#xA;(global-set-key (kbd &quot;C-c r&quot;) 'calc-eval-and-insert)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since I am a beginner in elisp, other suggestions of how to improve the code are also welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just noticed that executing it on &lt;code&gt;$2 + 2.2.2$&lt;/code&gt; results in a &quot;Bad Format&quot; error (as expected). But for example &lt;code&gt;$roundd(2.2)$&lt;/code&gt; (instead of &lt;code&gt;$round(2.2)$&lt;/code&gt; results in no error messages but replaces the expression with &lt;code&gt;round(2.2)&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="105" LastEditDate="2016-08-22T17:49:05.760" LastActivityDate="2016-08-22T17:49:05.760" Title="Catch invalid calc expression" Tags="|point|error-handling|calc|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26397" PostTypeId="1" AcceptedAnswerId="26477" CreationDate="2016-08-19T21:52:41.947" Score="2" ViewCount="485" Body="&lt;p&gt;Is there a way to temporarily disable scrolling in an emacs buffer? I would like to &quot;lock&quot; a particular line to be (say) the top of the displayed portion of the buffer, so that if I accidentally try to scroll it off screen I would be prevented from doing so, and it stays visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm using org-mode, so if I want to see/type further down than what is currently the bottom of the screen, I want to do it by collapsing sections between the top of the screen instead of accidentally scrolling away.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround I can split the buffer into two windows horizontally and work in the bottom buffer (keeping the top one fixed), but I'd rather use one window that just doesn't move.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note, in case it matters: My keyboard doesn't have a &quot;Scroll Lock&quot; key, and even when it did I never learned what it would do either in Emacs or in any other application.)&lt;/p&gt;&#xA;" OwnerUserId="862" LastActivityDate="2016-08-23T00:22:20.297" Title="Temporarily disable scrolling" Tags="|scrolling|motion|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26398" PostTypeId="2" ParentId="26396" CreationDate="2016-08-19T22:33:30.493" Score="2" Body="&lt;p&gt;As it says in the documentation of &lt;code&gt;calc-eval&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return value will either be the formatted result in string form,&#xA;  or a list containing a character position and an error message in string form.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So check whether the return value is a string or a list. If it's a list, don't modify the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other improvements:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Don't force the loading of &lt;code&gt;calc&lt;/code&gt;. &lt;code&gt;calc-eval&lt;/code&gt; is autoloaded so you don't need to do anything, the module will be loaded automatically when your function is called.&lt;/li&gt;&#xA;&lt;li&gt;Your code breaks if there isn't a valid opening character before or a valid closing character after the cursor.&lt;/li&gt;&#xA;&lt;li&gt;Your code breaks when the expression is the very last thing in the buffer, because when you delete a character, this effectively moves &lt;code&gt;p2&lt;/code&gt; one position forward.&lt;/li&gt;&#xA;&lt;li&gt;If the cursor is on a &lt;code&gt;$&lt;/code&gt;, it would be nice to allow it to be an opening &lt;code&gt;$&lt;/code&gt; rather than systematically looking backward. This can't be perfect (when the cursor is on the middle &lt;code&gt;$&lt;/code&gt; of &lt;code&gt;$1+1$2+2$&lt;/code&gt;, looking left and looking right are equally appealing).&lt;/li&gt;&#xA;&lt;li&gt;Your code may look very far before and after the cursor. I think you should stick to the same line.&lt;/li&gt;&#xA;&lt;li&gt;Don't move the cursor if the boundaries of the arithmetic expression can't be found. Whether to move the cursor in case of a calc error is debatable, I think it makes sense to move to the error location reported by calc.&lt;/li&gt;&#xA;&lt;li&gt;Put &lt;code&gt;*&lt;/code&gt; in the interactive specification so that the function stops immediately if the buffer is read-only. Put &lt;code&gt;@&lt;/code&gt; so that the function changes windows if you invoke it by clicking.&lt;/li&gt;&#xA;&lt;li&gt;A matter of style: avoid declaring variables and assigning them later.&lt;/li&gt;&#xA;&lt;li&gt;Also style: give variables more meaningful names than &lt;code&gt;p1&lt;/code&gt; and &lt;code&gt;p2&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun calc-eval-and-insert ()&#xA;  &quot;Replaces an arithmetic expression between two $ sympols with the result. Example expression: $2*(3 + round(5.5))$&quot; &#xA;  (interactive &quot;@*&quot;)&#xA;  (let* ((orig (point))&#xA;         (beg (save-excursion&#xA;                (if (and (eolp) (not (bolp)))&#xA;                    ;; If we're on the last character of a line, look before.&#xA;                    (backward-char))&#xA;                (skip-chars-backward &quot;^\n$“&quot;)&#xA;                (if (bolp)&#xA;                    ;; If there was no expression start character before, try one&#xA;                    ;; at the original point.&#xA;                    (goto-char (1+ orig)))&#xA;                (unless (memq (char-after (1- (point))) '(?$ ?“))&#xA;                  (error &quot;Start of arithmetic expression not found&quot;))&#xA;                (point)))&#xA;         (end (save-excursion&#xA;                (goto-char (1+ beg))&#xA;                (skip-chars-forward &quot;^\n$“&quot;)&#xA;                (unless (memq (char-after (point)) '(?$ ?”))&#xA;                  (error &quot;End of arithmetic expression not found&quot;))&#xA;                (point)))&#xA;         (result (calc-eval (buffer-substring-no-properties beg end))))&#xA;    (if (stringp result)&#xA;        (progn&#xA;          (delete-region (1- beg) (1+ end))&#xA;          (insert result))&#xA;      (goto-char (+ beg (car result)))&#xA;      (error &quot;Calc error: %s&quot; (cadr result)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-08-19T23:13:40.260" LastActivityDate="2016-08-19T23:13:40.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26401" PostTypeId="1" CreationDate="2016-08-20T02:05:03.777" Score="0" ViewCount="589" Body="&lt;p&gt;I am trying to send mail through emacs via my gmail account. I understand that this means it is senting using SMTP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I go through the basic steps to send mail through my gmail account,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnutls.c: [0] (Emacs) fatal error: The TLS connection was non-properly terminated.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am following the information found &lt;a href=&quot;http://tonyballantyne.com/tech/sending-email-from-emacs/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; which seems very easy, however I get that error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first I got a warning from google about a suspicious sign in attempt, but I have enabled that and now get this strange TLS issue.&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2017-01-17T12:43:30.030" Title="Emacs mail - The TLS connection was non-properly terminated" Tags="|email|gnutls|smtpmail|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26402" PostTypeId="2" ParentId="26391" CreationDate="2016-08-20T02:53:55.680" Score="3" Body="&lt;p&gt;If you want to call (helm-mini) after Emacs has started up, you can add it to &lt;code&gt;emacs-startup-hook&lt;/code&gt; in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-startup-hook #'helm-mini)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way Emacs will run this function upon startup, but not upon re-evaluation of your init file.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-08-20T02:53:55.680" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26403" PostTypeId="2" ParentId="26397" CreationDate="2016-08-20T04:52:10.960" Score="2" Body="&lt;p&gt;Have you considered narrowing?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wh/narrow-to-visible-screen ()&#xA;  &quot;Narrow to the currently visible text in the current buffer.&quot;&#xA;  (interactive)&#xA;  (widen)&#xA;  ;; Get position of the beginning of the current line.&#xA;  (let ((start-pos (progn (beginning-of-line) (point)))&#xA;        ;; Move down one screenful, and get position.&#xA;        (end-pos (progn (scroll-up nil) (point))))&#xA;    ;; Only show the text between start-pos and end-pos, and forbid&#xA;    ;; scrolling outside of that.&#xA;    (narrow-to-region start-pos end-pos)&#xA;    ;; Ensure the region is positioned correctly in the frame.&#xA;    (scroll-down nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-08-20T04:52:10.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26404" PostTypeId="1" AcceptedAnswerId="26408" CreationDate="2016-08-20T05:08:50.517" Score="8" ViewCount="2800" Body="&lt;p&gt;I'm trying to create &lt;code&gt;*Help*&lt;/code&gt; buffers in Emacs, documenting functions defined in other languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can create a simple help buffer easily:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wh/help-hello-world ()&#xA;  (interactive)&#xA;  (with-help-window (help-buffer)&#xA;    (princ &quot;foo_bar is a function.\n\nIt does stuff.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I want to add a clickable link in my &lt;code&gt;*Help*&lt;/code&gt; buffer, which Emacs seems to call a button. I can see &lt;code&gt;describe-function-1&lt;/code&gt; calls &lt;code&gt;help-xref-button&lt;/code&gt; which creates a button.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I call &lt;code&gt;insert-text-button&lt;/code&gt; the same way &lt;code&gt;help-xref-button&lt;/code&gt; creates buttons, then &lt;code&gt;'help-args&lt;/code&gt; seems to expect an elisp function and path.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wh/help-hello-world-button ()&#xA;  (interactive)&#xA;  (let ((buf (help-buffer)))&#xA;    (with-help-window buf&#xA;      (princ &quot;foo_bar is a function.\n\nIt does stuff.&quot;))&#xA;    (with-current-buffer buf&#xA;      (let ((inhibit-read-only t))&#xA;        (insert-text-button&#xA;         &quot;example.txt&quot;&#xA;         'type 'help-function-def&#xA;         'help-args '(button-type-subtype-p &quot;/usr/share/emacs/24.5/lisp/button.el.gz&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I create an Emacs button pointing to an arbitrary line in an arbitrary file?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-08-20T07:17:10.757" Title="How do I create a button in Emacs?" Tags="|help|buttons|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26405" PostTypeId="1" AcceptedAnswerId="28129" CreationDate="2016-08-20T06:15:21.290" Score="2" ViewCount="625" Body="&lt;p&gt;I would like to do a sort of &lt;code&gt;flyspell-goto-next-error&lt;/code&gt; but without first having to run &lt;code&gt;flyspell-buffer&lt;/code&gt; or &lt;code&gt;flyspell-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could this be accomplished?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words: keep &quot;&lt;code&gt;flyspell-buffer&lt;/code&gt;ing&quot; until a spelling error is found and then invoke &lt;code&gt;flyspell-word&lt;/code&gt; (&lt;kbd&gt;M-$&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case, I cannot run &lt;code&gt;ispell-buffer&lt;/code&gt; because I would like to use &lt;a href=&quot;https://community.dur.ac.uk/p.j.heslin/Software/Emacs/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;flyspell-babel.el&lt;/code&gt;&lt;/a&gt;, which uses Flyspell.&lt;/p&gt;&#xA;" OwnerUserId="10076" LastEditorUserId="10076" LastEditDate="2016-08-20T20:05:25.033" LastActivityDate="2016-10-25T20:48:22.990" Title="flyspell-goto-next-error without running flyspell-buffer first?" Tags="|flyspell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26406" PostTypeId="1" AcceptedAnswerId="26407" CreationDate="2016-08-20T06:26:50.223" Score="2" ViewCount="1701" Body="&lt;p&gt;I added MELPA stable and MELPA repositories with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa-stable&quot; . &quot;https://stable.melpa.org/packages/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I remove one of them from the list so &lt;code&gt;M-x package-list-packages&lt;/code&gt; does not show duplicate packages? Also, how could I print the list to see if the entry is really gone?&lt;/p&gt;&#xA;" OwnerUserId="12487" LastActivityDate="2016-08-21T16:12:31.460" Title="How to remove MELPA repository from package-archives?" Tags="|package-repositories|list|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26407" PostTypeId="2" ParentId="26406" CreationDate="2016-08-20T06:45:31.707" Score="3" Body="&lt;p&gt;Press &lt;code&gt;M-x RET customize-variable RET package-archives RET&lt;/code&gt; and you will be shown the customize options page for package archives where you can add or remove entries. After changing, click on &lt;code&gt;State&lt;/code&gt; button and click on &lt;code&gt;Save for future sessions&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-08-20T06:45:31.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26408" PostTypeId="2" ParentId="26404" CreationDate="2016-08-20T07:17:10.757" Score="9" Body="&lt;p&gt;You can use both &lt;code&gt;make-button&lt;/code&gt; or &lt;code&gt;make-text-button&lt;/code&gt;. For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun button-pressed (button)&#xA;  (message (format &quot;Button pressed!&quot;)))&#xA;&#xA;(define-button-type 'custom-button&#xA;  'action 'button-pressed&#xA;  'follow-link t&#xA;  'help-echo &quot;Click Button&quot;&#xA;  'help-args &quot;test&quot;)&#xA;&#xA;(make-button 1 10 :type 'custom-button)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will create a button at char 1 to 10 in the current buffer.&lt;/p&gt;&#xA;" OwnerUserId="11966" LastActivityDate="2016-08-20T07:17:10.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26409" PostTypeId="2" ParentId="26346" CreationDate="2016-08-20T09:49:57.227" Score="1" Body="&lt;p&gt;I was looking for the place in the &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-mime.html&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; where it might say explicitly how to use it inside email buffers, but it doesn't.  In retrospect you could guess it, since the documentation tells you to add hooks to &lt;code&gt;mml&lt;/code&gt; mode, but there's still some guesswork involved.  The quote below is from the documentation embedded in &lt;code&gt;org-mime.el&lt;/code&gt;.  Again, not exactly saying how to use it inside the email buffer, but close.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Commentary:&#xA;&#xA;;; WYSWYG, html mime composition using org-mode&#xA;;;&#xA;;; For mail composed using the orgstruct-mode minor mode, this&#xA;;; provides a function for converting all or part of your mail buffer&#xA;;; to embedded html as exported by org-mode.  Call `org-mime-htmlize'&#xA;;; in a message buffer to convert either the active region or the&#xA;;; entire buffer to html.&#xA;;;&#xA;;; Similarly the `org-mime-org-buffer-htmlize' function can be called&#xA;;; from within an org-mode buffer to convert the buffer to html, and&#xA;;; package the results into an email handling with appropriate MIME&#xA;;; encoding.&#xA;;;&#xA;;; you might want to bind this to a key with something like the&#xA;;; following message-mode binding&#xA;;;&#xA;;;   (add-hook 'message-mode-hook&#xA;;;             (lambda ()&#xA;;;               (local-set-key &quot;\C-c\M-o&quot; 'org-mime-htmlize)))&#xA;;;&#xA;;; and the following org-mode binding&#xA;;;&#xA;;;   (add-hook 'org-mode-hook&#xA;;;             (lambda ()&#xA;;;               (local-set-key &quot;\C-c\M-o&quot; 'org-mime-org-buffer-htmlize)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, basically, you'd add a hook to &lt;code&gt;message-mode&lt;/code&gt; and call this function using whatever keybinding you assign to it to get the message converted to HTML.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-08-20T09:49:57.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26410" PostTypeId="2" ParentId="26401" CreationDate="2016-08-20T10:01:08.450" Score="1" Body="&lt;p&gt;Below are my settings for sending mail through GMail:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'nnir)&#xA;&#xA;(setq gnus-select-method&#xA;      '(nnimap &quot;gmail&quot;&#xA;               (nnimap-address &quot;imap.gmail.com&quot;)&#xA;               (nnimap-server-port 993)&#xA;               (nnimap-stream ssl)&#xA;               (nnir-search-engine imap)))&#xA;&#xA;(setq send-mail-function 'smtpmail-send-it&#xA;      message-send-mail-function 'smtpmail-send-it&#xA;      smtpmail-starttls-credentials&#xA;      '((&quot;smtp.gmail.com&quot; 587 nil nil))&#xA;      smtpmail-auth-credentials&#xA;      (expand-file-name &quot;~/.authinfo&quot;)&#xA;      smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-service 587&#xA;      smtpmail-debug-info t)&#xA;(require 'smtpmail)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that GMail listens on port 587 rather than 25, that's why there's a connection error.  But that's just a guess.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-08-20T10:01:08.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26412" PostTypeId="1" CreationDate="2016-08-20T11:56:48.757" Score="6" ViewCount="1842" Body="&lt;p&gt;By default, org-attach.el names project folders, using a UUID scheme, which is paired with headlines in org-mode, via the &lt;code&gt;:PROPERTIES:&lt;/code&gt; drawer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to find a way to make this directory structure human readable, so that it can be accessed outside of org-mode (e.g., folder names are matched to headline names). So this outline structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* This headline&#xA;  ** This sub-headline 1&#xA;  ** This sub-headline 2&#xA;* This second headline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;matches to the directory structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- This headline&#xA;  - This sub-headline 1&#xA;  - This sub-headline 2&#xA;- This second headline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, this presents an issue, should either of these get renamed. But maybe there is another way to get this done with UUIDs? Some possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Match a UUID in the &lt;code&gt;:PROPERTIES:&lt;/code&gt; drawer to a UUID in the folder's metadata (Spotlight comments on the Mac come to mind)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Create a second folder structure via sim-links, that updates when &lt;code&gt;org-attach-sync&lt;/code&gt; is called.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any thoughts, ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-08-22T17:48:09.517" LastActivityDate="2019-08-21T18:00:12.553" Title="Human readable directory tree with org-attach" Tags="|org-mode|files|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26413" PostTypeId="1" AcceptedAnswerId="26425" CreationDate="2016-08-20T13:25:48.393" Score="6" ViewCount="147" Body="&lt;p&gt;I've tried &lt;code&gt;whitespace-mode&lt;/code&gt;, but I can't configure it the way I want. There are others, but some of them are obsolete and I don't want to try them all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I always indent via tabs and can't stand trailing whitespace. I never combine tabs and spaces (which means that with tabwidth=4 I can indent only multiples of 4, that's fine). I don't want non-indenting spaces to be highlighted as it's highly disturbing. I don't want any non-indenting tabs as there are always an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following pattern express it maybe more clearly&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;^\t* +&lt;/code&gt; - indenting space&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[ \t]+$&lt;/code&gt; - trailing space or tab&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[^\t\n]+\t&lt;/code&gt; - non-indenting tab&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It should work for all buffers and ideally use some nasty color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for either a package allowing exactly this or a hint what could I modify to get it in the easiest way. I used to hack emacs a lot some 15 years ago, but that's too long ago.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;" OwnerUserId="13045" LastEditorUserId="13045" LastEditDate="2016-08-20T18:00:35.133" LastActivityDate="2016-08-20T18:38:45.843" Title="Whitespace highlighting" Tags="|whitespace|highlighting|whitespace-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26414" PostTypeId="1" AcceptedAnswerId="26464" CreationDate="2016-08-20T13:49:02.713" Score="2" ViewCount="210" Body="&lt;p&gt;How can I modify &lt;code&gt;company-dabbrev&lt;/code&gt; to behave like other &lt;code&gt;company-backends&lt;/code&gt;, so I also receive words as completion candidates, that are connected with hyphens.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-08-22T15:03:31.707" Title="how to ignore hyphens in completion candidates using company-dabbrev backend?" Tags="|company-mode|dabbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26416" PostTypeId="2" ParentId="26405" CreationDate="2016-08-20T14:18:37.163" Score="2" Body="&lt;p&gt;The non-flying &lt;code&gt;ispell-buffer&lt;/code&gt; will search the buffer for errors and then prompt for a correction when it finds one.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-08-20T14:18:37.163" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26417" PostTypeId="1" AcceptedAnswerId="26424" CreationDate="2016-08-20T14:20:21.800" Score="4" ViewCount="353" Body="&lt;p&gt;I was not satisfied with the behavior of standard &lt;code&gt;C-arrow&lt;/code&gt; and &lt;code&gt;C-S-arrow&lt;/code&gt;, so I wrote this functions to replace standard ones.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq separators-regexp &quot;[\-'\&quot;();:,.\\/?!@#%&amp;amp;*+=]&quot;)&#xA;&#xA;(defun forward-to-separator()&#xA;    &quot;Move to the next separator like in the every NORMAL editor&quot;&#xA;    (interactive)&#xA;    (let ((my-pos (re-search-forward separators-regexp)))&#xA;        (goto-char my-pos)))&#xA;&#xA;(defun backward-to-separator()&#xA;    &quot;Move to the previous separator like in the every NORMAL editor&quot;&#xA;    (interactive)&#xA;    (let ((my-pos (re-search-backward separators-regexp)))&#xA;        (goto-char my-pos)))&#xA;&#xA;(global-set-key (kbd &quot;C-&amp;lt;right&amp;gt;&quot;) 'forward-to-separator)&#xA;(global-set-key (kbd &quot;C-&amp;lt;left&amp;gt;&quot;) 'backward-to-separator)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now I am facing a problem with shift selection: it actually just not working at all.&#xA;So my question is: how can I select text using my new functions and shift key(&lt;code&gt;C-S-arrow&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My final code is here:  &lt;a href=&quot;https://gist.github.com/FirstTimeInForever/8303ac1918c81365991d7acf7a926bd8&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/FirstTimeInForever/8303ac1918c81365991d7acf7a926bd8&lt;/a&gt;&#xA;I added &lt;code&gt;C-&amp;lt;backspace&amp;gt;&lt;/code&gt; support and changed my regex. Now I can move cursor like in sublime text!&lt;/p&gt;&#xA;" OwnerDisplayName="user13047" LastEditorDisplayName="user13047" LastEditDate="2016-08-24T10:06:06.187" LastActivityDate="2017-12-03T13:33:29.003" Title="Custom C-arrow cursor movement" Tags="|key-bindings|commands|interactive|shift-selection|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26418" PostTypeId="1" CreationDate="2016-08-20T14:54:28.627" Score="5" ViewCount="228" Body="&lt;p&gt;When using pdf-tools (&lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/politza/pdf-tools&lt;/a&gt;) I'd like to be able to select and area and copy it to the clipboard as an image, so as to insert into other applications. Selecting is easy from pdf-tools, but pasting into other applications as image does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that for this to be possible, Emacs would have to mark the contents of the selected area as being of type image &lt;a href=&quot;https://github.com/politza/pdf-tools/issues/184#issuecomment-238947452&quot; rel=&quot;noreferrer&quot;&gt;pdf-tools: issue 184&lt;/a&gt;. Is such a thing even possible?&lt;/p&gt;&#xA;" OwnerUserId="13050" LastActivityDate="2016-08-20T14:54:28.627" Title="Emacs: mark contents as type image in copy to clipboard" Tags="|images|clipboard|pdf-tools|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26419" PostTypeId="2" ParentId="24048" CreationDate="2016-08-20T14:54:54.493" Score="0" Body="&lt;p&gt;I set font in my .emacs like so :- &lt;code&gt;(set-frame-font &quot;PragmataPro 13&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-08-20T14:54:54.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26420" PostTypeId="1" CreationDate="2016-08-20T15:03:01.697" Score="2" ViewCount="227" Body="&lt;p&gt;After switching to 24.5.1&lt;sup&gt;1&lt;/sup&gt; from some ancient version, Emacs started to spam my primary selection: Whenever I mark a region, or &lt;em&gt;even move the point using e.g. arrow keys when the mark is active&lt;/em&gt;, a &lt;strong&gt;new entry&lt;/strong&gt; appears in my Parcellite history. This makes it unusable.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I want Emacs changing the primary selection when I mark some text using the mouse.&lt;/li&gt;&#xA;&lt;li&gt;I don't care about what happens when using keyboard (pressing &lt;code&gt;M-w&lt;/code&gt; is easy).&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;But there must be only a single such entry in the history&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Maybe it's not Emacs' thing at all and it's Parcellite capturing every selection? No idea, but it used to work on Ubuntu 10.04 (now I'm on 16.04).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian&lt;/p&gt;&#xA;" OwnerUserId="13045" LastEditorUserId="105" LastEditDate="2016-08-20T17:31:58.563" LastActivityDate="2016-08-20T17:31:58.563" Title="How to prevent the active region from setting the primary selection?" Tags="|region|clipboard|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26421" PostTypeId="1" AcceptedAnswerId="26423" CreationDate="2016-08-20T15:10:43.343" Score="4" ViewCount="1390" Body="&lt;p&gt;According to  &lt;a href=&quot;https://www.emacswiki.org/emacs/RegularExpression#regexp&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/RegularExpression#regexp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; \(\w+\) +\1\&amp;gt;       &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;finds two consecutive identical words. It works if the words are in the same line separated by an arbitrary number of white spaces. &#xA;How to find consecutive identical words not necessarily in the same line by a regexp? According to the link above&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\(\&amp;lt;\w+\&amp;gt;\)\s-+\1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;can do the job. But I don't know why it cannot find the duplicate words &lt;strong&gt;file file&lt;/strong&gt; below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This buffer is for notes you don't want to save, and for Lisp evaluation.&#xA;;; If you want to create a file, visit that file  &#xA;file with C-x C-f,&#xA;;; then enter the text in in that file's own buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2016-08-20T22:02:37.103" Title="regexp to find two consecutive and identical words not necessarily in the same line" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26422" PostTypeId="2" ParentId="26420" CreationDate="2016-08-20T15:54:48.133" Score="2" Body="&lt;p&gt;This should do the trick :- &lt;code&gt;(setq select-active-regions 'only)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will make sure that emacs will only save the temporarily active regions to the primary selection, i.e those made with the mouse or shift keys.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-08-20T15:54:48.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26423" PostTypeId="2" ParentId="26421" CreationDate="2016-08-20T17:25:31.370" Score="6" Body="&lt;p&gt;&lt;code&gt;\s-&lt;/code&gt; matches a whitespace character.  A newline character can have whitespace syntax in some modes, but often it does not. Many programming modes change the syntax of newlines to that of a comment end, for instance. So your regexp works in Text mode but not in Lisp interaction mode (used in &lt;code&gt;*scratch*&lt;/code&gt;, for instance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use this interactively, where the newline char is inserted using &lt;code&gt;C-q C-j&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\(\&amp;lt;\w+\&amp;gt;\)\(\s-\|&#xA;\)+\1\&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or use this in Lisp (it is equivalent): &lt;code&gt;\\(\\&amp;lt;\\w+\\&amp;gt;\\)\\(\\s-\\|\n\\)+\\1\\&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(re-search-forward &quot;\\(\\&amp;lt;\\w+\\&amp;gt;\\)\\(\\s-\\|\n\\)+\\1\\&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-20T22:02:37.103" LastActivityDate="2016-08-20T22:02:37.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26424" PostTypeId="2" ParentId="26417" CreationDate="2016-08-20T17:38:16.593" Score="2" Body="&lt;p&gt;Use &lt;strong&gt;&lt;code&gt;(interactive &quot;^&quot;)&lt;/code&gt;&lt;/strong&gt; instead of &lt;code&gt;(interactive)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f interactive&lt;/code&gt; tells you, way down near the bottom:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the string begins with &lt;strong&gt;&lt;code&gt;^&lt;/code&gt;&lt;/strong&gt; and &lt;code&gt;shift-select-mode&lt;/code&gt; is non-nil,&#xA;   Emacs first calls the function &lt;code&gt;handle-shift-selection&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In your case, the commands do not take an argument.  But you can still use a string argument to &lt;code&gt;interactive&lt;/code&gt;, in this case &lt;code&gt;&quot;^&quot;&lt;/code&gt;, to make the command respect shift selection.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-20T17:38:16.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26425" PostTypeId="2" ParentId="26413" CreationDate="2016-08-20T18:22:33.060" Score="5" Body="&lt;p&gt;This should do what you want.  Define regexps that match what you want, and faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then match the subgroups in the function you add to &lt;code&gt;font-lock-keywords&lt;/code&gt;. The subgroups are used to say that you want only the spaces after indenting tabs, and only non-indenting tabs.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defface my-tab '((t (:background &quot;LemonChiffon&quot;))) &quot;...&quot; :group 'faces)&#xA;&#xA;(defface my-space '((t (:background &quot;HotPink&quot;))) &quot;...&quot; :group 'faces)&#xA;&#xA;(defface my-trailing-whitespace '((t (:background &quot;Gold&quot;))) &quot;...&quot; :group 'faces)&#xA;&#xA;(defvar indenting-space-re &quot;^[\t]*\\([ ]+\\)&quot;&#xA;   &quot;Regexp to match space chars after tab chars, at the start of a line.&quot;)&#xA;&#xA;(defvar trailing-white-re &quot;[\u00a0\040\t]+$&quot;&#xA;   &quot;Regexp to match trailing whitespace&quot;)&#xA;&#xA;(defvar non-indenting-tabs-re &quot;[^\n\t]+\\(\t+\\)&quot;&#xA;   &quot;Regexp to match bol, non-newline, non-tab chars, then tab chars.&quot;)&#xA;&#xA;(defun foo ()&#xA;  &quot;...&quot;&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   `((,indenting-space-re (1 'my-space t))               ; indenting spaces&#xA;     (,non-indenting-tabs-re (1 'my-tab t))              ; non-indenting tabs&#xA;     (,trailing-white-re (0 'my-trailing-whitespace t))) ; trailing whitespace&#xA;   'APPEND))&#xA;&#xA;(add-hook 'font-lock-mode-hook 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-20T18:38:45.843" LastActivityDate="2016-08-20T18:38:45.843" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26426" PostTypeId="1" AcceptedAnswerId="26427" CreationDate="2016-08-20T18:39:13.940" Score="4" ViewCount="103" Body="&lt;p&gt;I have a forked repository. I want to configure my upstream so that I can keep my master up to date and rebase my feature branches. How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;magit-version&lt;/code&gt; returns &lt;code&gt;Magit 20160810.653, Git 2.6.4 (Apple Git-63), Emacs 25.0.50.1, darwin&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="306" LastEditDate="2016-08-31T10:40:28.923" LastActivityDate="2016-08-31T10:40:28.923" Title="Configure upstream for rebasing onto master in magit" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26427" PostTypeId="2" ParentId="26426" CreationDate="2016-08-20T19:21:49.880" Score="5" Body="&lt;p&gt;You can &lt;a href=&quot;https://magit.vc/manual/magit/Remotes.html#Remotes&quot; rel=&quot;nofollow&quot;&gt;add a remote&lt;/a&gt; with &lt;kbd&gt;M a&lt;/kbd&gt;. It will prompt for a name and url, and whether to set pushRemote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then &lt;a href=&quot;https://magit.vc/manual/magit/Fetching.html#Fetching&quot; rel=&quot;nofollow&quot;&gt;fetch from all remotes&lt;/a&gt; with &lt;kbd&gt;f a&lt;/kbd&gt;, or a specific remote with &lt;kbd&gt;f e&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;a href=&quot;https://magit.vc/manual/magit/Rebasing.html#Rebasing&quot; rel=&quot;nofollow&quot;&gt;rebase&lt;/a&gt; with &lt;kbd&gt;r e&lt;/kbd&gt;, which will let you pick a branch, including the branch upstream.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="306" LastEditDate="2016-08-31T10:39:55.453" LastActivityDate="2016-08-31T10:39:55.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26428" PostTypeId="1" AcceptedAnswerId="26431" CreationDate="2016-08-21T00:04:58.583" Score="6" ViewCount="448" Body="&lt;p&gt;I've inferred from the context in which it's used that &quot;site&quot; refers to a multi-user environment, as opposed to a particular user's section of that environment. But it's hard to find a formal explanation or origin for such a generic term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it a holdover from an earlier time, unique to Emacs, or a widespread term that I was simply unaware of before diving into Emacs?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-08-21T01:41:08.910" Title="Is the term &quot;site&quot;, as in &quot;site-lisp&quot;, unique to Emacs?" Tags="|site-lisp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26429" PostTypeId="1" AcceptedAnswerId="26430" CreationDate="2016-08-21T00:19:27.770" Score="2" ViewCount="1645" Body="&lt;p&gt;I have spacemacs and a problem I have compared to using terminal+vim is that I could do everything in the terminal : create files, directories, whatever and whenever I need to edit a file I just type &lt;code&gt;vim file&lt;/code&gt;. Now to use spacemacs I basically have to tab to exmaces and type the path to the file I want to edit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I think you would need to console inside emacs, is there such service ?&lt;/p&gt;&#xA;" OwnerUserId="13055" LastEditorUserId="105" LastEditDate="2016-08-21T01:37:10.067" LastActivityDate="2016-08-21T01:37:10.067" Title="How to console inside of emacs?" Tags="|shell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26430" PostTypeId="2" ParentId="26429" CreationDate="2016-08-21T01:36:19.290" Score="2" Body="&lt;p&gt;&lt;code&gt;M-x shell&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Interactive-Shell.html&quot; rel=&quot;nofollow&quot;&gt;Interactive Shell&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-21T01:36:19.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26431" PostTypeId="2" ParentId="26428" CreationDate="2016-08-21T01:41:08.910" Score="5" Body="&lt;p&gt;It is not specific to Emacs. And yes, it came from a time when a multi-user site (organization, school, company,...) installed Emacs for multiple-user use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yes, this is still the case sometimes. A company or other organization can well provide one or more company installations of Emacs, and provide company-specific customizations in &lt;code&gt;site-lisp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, even if, say, a company has a giant farm of virtual GNU/Linux machines, and provides each of its developers with one such machine, it may well want to pre-install Emacs on each such machine or in a shared location, and it might provide company-specific code in &lt;code&gt;site-lisp&lt;/code&gt; (also on each machine or in a shared location).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-21T01:41:08.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26432" PostTypeId="2" ParentId="17458" CreationDate="2016-08-21T04:20:53.513" Score="1" Body="&lt;p&gt;When we use &lt;code&gt;org-src-mode&lt;/code&gt;, the major mode is changed to the language we are editing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;'org-src-mode&lt;/code&gt; should change to the language mode or you can set it globally.&#xA;For example: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;|&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;C-c '&lt;/code&gt;) then the major mode in new buffer is &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, not &lt;code&gt;org-src-mode&lt;/code&gt;. So you should set evil-leader keys for &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-leader/set-key-for-mode 'emacs-lisp-mode&#xA;  &quot;s&quot; 'org-edit-src-save&#xA;  &quot;'&quot; 'org-edit-src-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or, set it globally by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-leader/set-key&#xA;  &quot;s&quot; 'org-edit-src-save&#xA;  &quot;'&quot; 'org-edit-src-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13057" LastEditorUserId="2710" LastEditDate="2016-08-22T10:34:41.240" LastActivityDate="2016-08-22T10:34:41.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26433" PostTypeId="1" CreationDate="2016-08-21T06:43:25.393" Score="2" ViewCount="641" Body="&lt;p&gt;I've been trying to change my line numbers background to be a different colour other than the background colour of my frames and it ended up looking like so :-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NPpdO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NPpdO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the line numbers background colour to be uniform throughout and not only till the last line of the buffer? &lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-08-21T08:40:51.007" LastActivityDate="2016-08-21T08:40:51.007" Title="Changing linum-mode face background uniformly" Tags="|faces|themes|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26434" PostTypeId="1" AcceptedAnswerId="26436" CreationDate="2016-08-21T10:28:07.453" Score="1" ViewCount="214" Body="&lt;p&gt;When I publish a project, the sitemap postamble looks like this. How can I change this email address?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                Email: douhua@joseichous-MacBook-Pro.local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9884" LastEditorUserId="9995" LastEditDate="2016-08-21T19:14:53.533" LastActivityDate="2016-08-21T19:14:53.533" Title="How to change email address in org-mode publish postamble?" Tags="|org-mode|org-publish|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26435" PostTypeId="1" CreationDate="2016-08-21T10:57:47.530" Score="3" ViewCount="1846" Body="&lt;p&gt;When writing within docstrings in &lt;code&gt;python-mode&lt;/code&gt;, I'm only able to tab/indent deeper than the leading edge of the string. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo():&#xA;    &quot;&quot;&quot;&#xA;|   | &amp;lt;&amp;lt; the only places I can &quot;tab&quot; to.&#xA;    &quot;&quot;&quot;&#xA;    pass&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to tab deeper within docstrings, to make editing easier for editing documentation, working with YAML, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can advise python-mode to ignore indentation rules within docstrings?&lt;/p&gt;&#xA;" OwnerUserId="10430" LastActivityDate="2017-04-18T23:07:17.660" Title="How can I disable indentation rules within docstrings in python-mode?" Tags="|indentation|python|doc-strings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26436" PostTypeId="2" ParentId="26434" CreationDate="2016-08-21T11:29:44.290" Score="1" Body="&lt;p&gt;Customise &lt;code&gt;user-mail-address&lt;/code&gt; to add your own Email address.  All Emacs packages and extension including Org Mode will pick it up.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-08-21T11:29:44.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26437" PostTypeId="2" ParentId="26435" CreationDate="2016-08-21T12:43:48.897" Score="0" Body="&lt;p&gt;As far as I know, there's no simple way of disabling the indentation engine inside a doc-string. However, you &lt;em&gt;can&lt;/em&gt; use various tools like &lt;code&gt;mmm-mode&lt;/code&gt; to enable a different &lt;code&gt;major-mode&lt;/code&gt; inside certain parts of the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., you can enable &lt;code&gt;rst-mode&lt;/code&gt; inside docstrings and thus use the &lt;code&gt;rst-mode&lt;/code&gt; indentation engine instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I answered a similar question to this some time ago with all the configuration details are available here: &lt;a href=&quot;https://emacs.stackexchange.com/a/21087/2653&quot;&gt;https://emacs.stackexchange.com/a/21087/2653&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-08-21T12:43:48.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26438" PostTypeId="2" ParentId="26386" CreationDate="2016-08-21T13:14:36.460" Score="2" Body="&lt;p&gt;I finally found it; doing an apropos of header-line and searching for faces put me on the right track. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(set-face-attribute 'mode-line nil  :height 100)&#xA;(set-face-attribute 'header-line nil  :height 200)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="864" LastActivityDate="2016-08-21T13:14:36.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26439" PostTypeId="1" AcceptedAnswerId="26521" CreationDate="2016-08-21T13:58:21.793" Score="1" ViewCount="143" Body="&lt;p&gt;GNU Emacs 25.1.50.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-mode version 8.3.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At some point in the past I could put down a block like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src latex :exports results :results {latex|html}&#xA;\begin{equation}&#xA;a = 1 + b&#xA;\end{eqation}&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For either html or latex and make it export to the corresponding format.&#xA;This functionality have for some reason disappeared and now it exports the src block as a code block instead of the results that exports to nice native latex or html math and rendered that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find it convenient to be able to do this, for a number of reasons, so it would be nice if there was a way to make this work again.&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2016-08-24T08:41:07.293" LastActivityDate="2016-10-23T09:09:11.083" Title="Why does my latex src code block ignore exports header arguments" Tags="|org-export|latex|html|header-line|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26440" PostTypeId="1" CreationDate="2016-08-21T15:25:53.573" Score="0" ViewCount="565" Body="&lt;p&gt;Is there a way to mark tasks in org-mode (similar to how you can mark files in Dired) so that they will show up on an Agenda view or in a sparse tree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm familiar with using TODO keywords. But I was hoping to find something quick and temporary... like a &quot;quick select&quot; mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-08-21T16:16:03.400" LastActivityDate="2016-08-21T16:16:03.400" Title="Mark tasks in org-mode to show up in agenda" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26441" PostTypeId="2" ParentId="26406" CreationDate="2016-08-21T16:12:31.460" Score="1" Body="&lt;p&gt;The selected answer is correct and i like that it can be used to edit any variable in a visual way. For completion, I will say that, in this case, removing one of the lines with the form &lt;code&gt;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&lt;/code&gt; from the &lt;code&gt;.emacs&lt;/code&gt; file eventually removed its respective repository.&lt;/p&gt;&#xA;" OwnerUserId="12487" LastActivityDate="2016-08-21T16:12:31.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26442" PostTypeId="1" AcceptedAnswerId="27192" CreationDate="2016-08-21T20:36:42.733" Score="1" ViewCount="819" Body="&lt;p&gt;Suppose I have two files: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;completed-YYYY.org_archive&lt;/li&gt;&#xA;&lt;li&gt;archive-YYYY.org_archive&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;where YYYY is the current year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an agenda file that looks like this, where each project and task has a unique ID:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** My Project&#xA;   :PROPERTIES:&#xA;   :ID: 1235-48&#xA;   :END:&#xA;*** DONE Task 1&#xA;    :PROPERTIES:&#xA;    :ID: 8943-41&#xA;    :END:&#xA;*** NEXT Task 2&#xA;    :PROPERTIES:&#xA;    :ID: 0124-47&#xA;    :END:&#xA;*** Task 3&#xA;    :PROPERTIES:&#xA;    :ID: 8491-03&#xA;    :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I go to &quot;archive&quot; Task 1 (because it's DONE), I want the following to happen:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Check archive-YYYY.org_archive to see if a &quot;My Project&quot; task with ID 1235-48 exists. If not, copy the contents (not including subtrees) of the &quot;My Project&quot; heading to the file.&lt;/li&gt;&#xA;&lt;li&gt;Check archive-YYYY.org_archive to see if a &quot;Task 1&quot; task with ID 8943-41 exists. If not, copy the contents of &quot;Task 1&quot; and place it under the &quot;My Project&quot; heading.&lt;/li&gt;&#xA;&lt;li&gt;org-archive &quot;Task 1&quot; into completed-YYYY.org_archive.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So when I mark Task 2 as DONE and go to &quot;archive&quot; it, its contents should be copied into archive-YYYY.org_archive under the existing &quot;My Project&quot; task (below Task 1), and then archived as normal into completed-YYY.org_archive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible to write a function for?&lt;/p&gt;&#xA;" OwnerUserId="12837" LastEditorUserId="105" LastEditDate="2016-08-21T21:55:48.593" LastActivityDate="2016-09-19T15:57:21.907" Title="Org-mode: A function to org-copy and org-archive unique tasks to different files" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26444" PostTypeId="1" AcceptedAnswerId="26514" CreationDate="2016-08-21T21:31:49.000" Score="1" ViewCount="275" Body="&lt;p&gt;I frequently use TRAMP with emacs to edit files remotely. However, I sometimes have files open from both my production and development server. When I have the same file open on both servers, TRAMP will name the buffers &lt;code&gt;bar&amp;lt;/ssh:stable:&amp;gt;&lt;/code&gt; and &lt;code&gt;bar&amp;lt;/ssh:dev:&amp;gt;&lt;/code&gt;. Is there a way I can get this behavior for all buffers, even if they’re currently only open from one of the servers? For instance, if I’m visiting /foo/bar on only the development server and /baz/qux on only the production server, I would like the buffers to be named &lt;code&gt;bar&amp;lt;/ssh:dev:&amp;gt;&lt;/code&gt; and &lt;code&gt;qux&amp;lt;/ssh:stable:&amp;gt;&lt;/code&gt;, respectively.&lt;/p&gt;&#xA;" OwnerUserId="13064" LastEditorUserId="13064" LastEditDate="2016-08-21T21:44:12.580" LastActivityDate="2016-08-24T05:00:47.870" Title="Include host in buffer name for all files opened with TRAMP" Tags="|tramp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26445" PostTypeId="1" CreationDate="2016-08-21T21:35:19.920" Score="0" ViewCount="106" Body="&lt;p&gt;I use &lt;code&gt;company-dabbrev&lt;/code&gt; as backend (source: &lt;a href=&quot;https://emacs.stackexchange.com/questions/15246/how-add-company-dabbrev-to-the-company-completion-popup&quot;&gt;How add company-dabbrev to the Company completion popup?&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I open &lt;code&gt;sql-mysql&lt;/code&gt;, after filling my credentials, I type &lt;code&gt;show databases;&lt;/code&gt; one of the databases is &lt;code&gt;information_schema&lt;/code&gt; displayed in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type &lt;code&gt;informatio&lt;/code&gt; in the buffer, there is no completion from Company. When I do &lt;kbd&gt;C-h v&lt;/kbd&gt; &lt;code&gt;company-backends&lt;/code&gt;, I see the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(company-wsd-mode&#xA;(company-edbi :with company-yasnippet)&#xA;(company-bbdb :with company-yasnippet)&#xA;(company-nxml :with company-yasnippet)&#xA;(company-css :with company-yasnippet)&#xA;(company-eclim :with company-yasnippet)&#xA;(company-semantic :with company-yasnippet)&#xA;(company-clang :with company-yasnippet)&#xA;(company-xcode :with company-yasnippet)&#xA;(company-cmake :with company-yasnippet)&#xA;(company-capf :with company-yasnippet)&#xA;(company-files :with company-yasnippet)&#xA;(company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet)&#xA;(company-oddmuse :with company-yasnippet)&#xA;(company-dabbrev :with company-yasnippet)&#xA;(company-yasnippet :with company-yasnippet)&#xA;(company-etags :with company-yasnippet)&#xA;(company-gtags :with company-yasnippet)&#xA;(company-sql :with company-yasnippet))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;Company-dabbrev&lt;/code&gt; is listed in the output. But why is there no completion for &lt;code&gt;information-schema&lt;/code&gt; in SQL interactive mode buffer, while  &lt;code&gt;company-mode&lt;/code&gt; is active as minor mode in same buffer and &lt;code&gt;company-dabbrev&lt;/code&gt; is listed as backend? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-08-21T21:35:19.920" Title="Company not active in shell/SQL, but it's says otherwise" Tags="|company-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26446" PostTypeId="1" CreationDate="2016-08-21T22:41:23.447" Score="1" ViewCount="560" Body="&lt;p&gt;I have spacemacs and when I press &lt;code&gt;SPC f f&lt;/code&gt; it starts of in the current directory. Problem is the file I need is in &lt;code&gt;/etc&lt;/code&gt; so I first have to delete the current path by pressing backspace numerous times before I can start typing my path. Is there a way to not have a default path pre-written when pressing &lt;code&gt;SPC f f&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="13055" LastEditorUserId="105" LastEditDate="2016-08-22T14:10:01.703" LastActivityDate="2016-08-22T14:10:01.703" Title="How to find a file from root with spacemacs?" Tags="|spacemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26447" PostTypeId="1" AcceptedAnswerId="26657" CreationDate="2016-08-22T00:50:10.927" Score="0" ViewCount="265" Body="&lt;p&gt;I would like to automatically set marks on all of the edited lines so that I can go back to any of my previous edited lines using &lt;code&gt;helm-mark-ring&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12987" LastActivityDate="2016-08-29T01:42:41.563" Title="How to automatically set marks on all of the edited lines?" Tags="|mark|mark-ring|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26448" PostTypeId="2" ParentId="26446" CreationDate="2016-08-22T01:40:48.773" Score="1" Body="&lt;p&gt;In vanilla Emacs, typing &lt;code&gt;/&lt;/code&gt; will reset the path to the root of the file system (or typing &quot;C:/&quot; in Windows). This behavior should be the same in Spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when it prompts you to find a file in the current directory (e.g. &lt;code&gt;/home/unimor/Documents&lt;/code&gt;), merely type &lt;code&gt;/&lt;/code&gt; and Emacs will start looking from the root.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-08-22T01:40:48.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26449" PostTypeId="1" CreationDate="2016-08-22T02:55:24.070" Score="4" ViewCount="1357" Body="&lt;p&gt;I have spacemacs and when I search for a word using &lt;code&gt;/&lt;/code&gt; once it turns out that I can't access it later on using the up arrow. This feature is present in vim so how do I cycle through search history after hitting &lt;code&gt;/&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="13055" LastEditorUserId="105" LastEditDate="2016-08-22T04:02:58.907" LastActivityDate="2017-06-30T15:28:19.277" Title="How to access search history?" Tags="|spacemacs|search|history|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26450" PostTypeId="1" AcceptedAnswerId="26453" CreationDate="2016-08-22T03:24:49.937" Score="5" ViewCount="5525" Body="&lt;p&gt;What's the Evil Mode equivalent of these Vim commands?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nnoremap : ;&#xA;nnoremap ; :&#xA;vnoremap : ;&#xA;vnoremap ; :&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13071" LastActivityDate="2018-11-03T20:22:31.280" Title="How to remap : to ; in Evil Mode" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26451" PostTypeId="1" AcceptedAnswerId="26460" CreationDate="2016-08-22T06:16:01.310" Score="0" ViewCount="790" Body="&lt;p&gt;Projects with multiple subprojects are tagged with &lt;code&gt;PROJ&lt;/code&gt;, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** PROJ Master Project&#xA;*** PROJ Subproject 1&#xA;**** Task 1a&#xA;*** PROJ Subproject 2&#xA;**** Task 2a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently, I have a custom agenda view that will simply display all items with a &lt;code&gt;PROJ&lt;/code&gt; tag: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;p&quot; &quot;all projects&quot; todo &quot;PROJ&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How do I modify it so that only master projects (which are all level 2 headings) are displayed?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do I modify it so that only subprojects (level 3 or more) are displayed?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-08-22T17:02:22.140" Title="Agenda view for all tasks with a project tag and at a certain level" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26453" PostTypeId="2" ParentId="26450" CreationDate="2016-08-22T06:40:40.787" Score="17" Body="&lt;p&gt;First of all, in Emacs one thinks in keymaps and commands, not so much keys in their (original) context.  Your first step would be figuring out how the commands are named in Evil's normal and visual state (&lt;code&gt;F1 k&lt;/code&gt;), then what keymap they're bound to (just look through &lt;code&gt;evil-maps.el&lt;/code&gt; with &lt;code&gt;M-x find-library&lt;/code&gt;).  Armed with this knowledge, accomplishing this is fairly simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'evil-maps&#xA;  (define-key evil-motion-state-map (kbd &quot;:&quot;) 'evil-repeat-find-char)&#xA;  (define-key evil-motion-state-map (kbd &quot;;&quot;) 'evil-ex))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you for whatever reason are still on Emacs 24.3:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'evil-maps&#xA;  '(progn&#xA;     (define-key evil-motion-state-map (kbd &quot;:&quot;) 'evil-repeat-find-char)&#xA;     (define-key evil-motion-state-map (kbd &quot;;&quot;) 'evil-ex)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might wonder why I'm defining a remapping for motion state only, it's because Evil only maps these keys in that state, so applying your suggested changes as is would be unnecessary.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-08-25T16:16:42.430" LastActivityDate="2016-08-25T16:16:42.430" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26454" PostTypeId="1" CreationDate="2016-08-22T07:02:40.417" Score="2" ViewCount="189" Body="&lt;p&gt;Trashed files are stored in the FreeDesktop standard location:&#xA;~/.local/share/Trash/files. How do I restore or permanently delete files in that folder using dired?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2016-08-22T14:11:25.367" LastActivityDate="2024-01-19T10:03:40.343" Title="Manage freedesktop trashcan with dired mode" Tags="|dired|files|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26457" PostTypeId="1" CreationDate="2016-08-22T10:41:52.337" Score="1" ViewCount="93" Body="&lt;p&gt;I want to input &lt;code&gt;this.&lt;/code&gt; and get &lt;code&gt;this-&amp;gt;&lt;/code&gt; in c++-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;abbrev-mode&lt;/code&gt; and &lt;code&gt;yasnippet&lt;/code&gt;, but failed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In abbrev-mode, I defined an abbrev &lt;code&gt;this&lt;/code&gt; to get &lt;code&gt;this&lt;/code&gt; using &lt;code&gt;.&lt;/code&gt; as a trigger key, but soon as I typed &lt;code&gt;this.&lt;/code&gt; I got &lt;code&gt;this-&amp;gt;.&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In yasnippet, I defined a snippet &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: this&#xA;# key: this&#xA;# binding: .&#xA;# condition: (eq 0 (string-match &quot;this&quot; (buffer-substring (- (point) 4) (point))))&#xA;# --&#xA;this-&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but got &lt;code&gt;thisthis-&amp;gt;&lt;/code&gt; after input &lt;code&gt;this.&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remove the &lt;code&gt;this&lt;/code&gt; in the last line of the snippet&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: this&#xA;# key: this&#xA;# binding: .&#xA;# condition: (eq 0 (string-match &quot;this&quot; (buffer-substring (- (point) 4) (point))))&#xA;# --&#xA;-&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;everything seems fine but why we don't need &lt;code&gt;this&lt;/code&gt; here ? Also, under this situation, the expansion broke the completion of &lt;code&gt;company-irony&lt;/code&gt; even I've added &lt;code&gt;yas-expand&lt;/code&gt; to &lt;code&gt;irony-completion-trigger-commands&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the &lt;strong&gt;&lt;em&gt;simplest&lt;/em&gt;&lt;/strong&gt; way to achieve this ? Thanks !&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-08-22T21:47:29.327" Title="How can I get &quot;this-&gt;&quot; by inputting &quot;this.&quot;?" Tags="|yasnippet|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26459" PostTypeId="2" ParentId="26457" CreationDate="2016-08-22T11:58:14.590" Score="1" Body="&lt;p&gt;From abbrev &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Abbrevs.html#Abbrevs&quot; rel=&quot;nofollow&quot;&gt;doc&lt;/a&gt; (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A defined “abbrev” is a &lt;strong&gt;word&lt;/strong&gt; which “expands”, if you insert it, into&#xA;  some different text.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;this.&lt;/code&gt; is not a word, at least in &lt;code&gt;c++-mode&lt;/code&gt; so this can't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggestion is to rebind in c++-mode the &lt;code&gt;.&lt;/code&gt; key to a command testing if the current word is &lt;code&gt;this&lt;/code&gt;, and inserting &lt;code&gt;-&amp;gt;&lt;/code&gt; if so, &lt;code&gt;.&lt;/code&gt; otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As pointed by @npostavs it's better to call &lt;code&gt;self-insert-command&lt;/code&gt; in the second case, rather than simply calling &lt;code&gt;(insert &quot;.&quot;)&lt;/code&gt; as this ensures the processing is exactly what it was before we changed the binding.  For example a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html#Arguments&quot; rel=&quot;nofollow&quot;&gt;prefix argument&lt;/a&gt;, if any, is handled as expected.  &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun this-dot-replace ()&#xA;  (interactive)&#xA;  (if (string= (thing-at-point 'word) &quot;this&quot;)&#xA;      (insert &quot;-&amp;gt;&quot;)&#xA;    (call-interactively 'self-insert-command)))&#xA;&#xA;(add-hook 'c++-mode-hook&#xA;  (lambda () (define-key c++-mode-map &quot;.&quot; 'this-dot-replace)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I make no guarantee this (pun intended?) is the simplest possible way.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-08-22T21:47:29.327" LastActivityDate="2016-08-22T21:47:29.327" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26460" PostTypeId="2" ParentId="26451" CreationDate="2016-08-22T12:23:11.420" Score="1" Body="&lt;p&gt;You can use the &lt;code&gt;LEVEL&lt;/code&gt; &quot;property&quot; to match a certain subtree level. The match syntax is described in &lt;code&gt;(info &quot;(org) Matching tags and properties&quot;)&lt;/code&gt;. &lt;code&gt;LEVEL=2&lt;/code&gt; corresponds to subtrees with 2 stars etc. And to answer your questions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;p&quot; &quot;master projects&quot; tags-todo &quot;LEVEL=2/PROJ&quot;)&#xA;        (&quot;u&quot; &quot;subprojects&quot; tags-todo &quot;LEVEL&amp;gt;2/PROJ&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2016-08-22T17:02:22.140" LastActivityDate="2016-08-22T17:02:22.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26461" PostTypeId="1" AcceptedAnswerId="26566" CreationDate="2016-08-22T13:23:01.907" Score="2" ViewCount="350" Body="&lt;p&gt;After compiling a LaTeX document with errors I can go to the first error via &lt;code&gt;TeX-next-error&lt;/code&gt; to the second one by executing this macro again etc. After the last error pressing it once more results in &lt;code&gt;no more errors&lt;/code&gt;. That makes sense so far. However using &lt;code&gt;TeX-previous-error&lt;/code&gt; doesn't bring me to the previous error but to the next one. For example if I am by the second error and execute &lt;code&gt;TeX-previous-error&lt;/code&gt; it jumps to the third error and not to the first one. In particular if &lt;code&gt;TeX-next-error&lt;/code&gt; reached &lt;code&gt;no more error&lt;/code&gt;, &lt;code&gt;TeX-previous-error&lt;/code&gt; doesn't bring you to the last error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My AucTeX version is 11.89.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug or an intended behavior (why?). Is there any other way to go to back and forward in the error list?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-08-25T17:01:12.423" Title="How to go to the previous error in latex document" Tags="|auctex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26462" PostTypeId="1" AcceptedAnswerId="26466" CreationDate="2016-08-22T13:30:50.970" Score="0" ViewCount="73" Body="&lt;p&gt;To load &lt;code&gt;helm-mini&lt;/code&gt; every-time when emacs starts, I use the following line in my .emacs file as suggested in &lt;a href=&quot;https://emacs.stackexchange.com/a/26402/2323&quot;&gt;https://emacs.stackexchange.com/a/26402/2323&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-startup-hook #'helm-mini)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This in particular avoids that &lt;code&gt;helm-mini&lt;/code&gt; is loaded if I execute &lt;code&gt;eval-buffer&lt;/code&gt; after changing my &lt;code&gt;.emacs&lt;/code&gt;-file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there is another problem with it: If I start &lt;code&gt;emacs&lt;/code&gt; from command line like &lt;code&gt;emacs myfile.tex&lt;/code&gt;, emacs opens the file &lt;code&gt;myfile.tex&lt;/code&gt; but also opens &lt;code&gt;helm-mini&lt;/code&gt;. How can I make emacs not to load &lt;code&gt;helm-mini&lt;/code&gt; in this case?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-08-22T16:22:19.183" Title="Execute command on every start except you load a file from commandline" Tags="|start-up|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26463" PostTypeId="1" AcceptedAnswerId="26468" CreationDate="2016-08-22T14:06:35.187" Score="2" ViewCount="1176" Body="&lt;h1&gt;without emacs&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;i have this &lt;code&gt;doc.tex&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{fontspec}&#xA;\usepackage[backend=biber]{biblatex}&#xA;\usepackage{csquotes}&#xA;&#xA;\title{}&#xA;\date{}&#xA;\author{}&#xA;\bibliography{bibliography}&#xA;&#xA;\begin{document}&#xA;\maketitle&#xA;\thispagestyle{empty} % has to be after  \maketitle&#xA;&#xA;testing bibliography ---&amp;gt; \autocite{test:test}&#xA;&#xA;\printbibliography&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this &lt;code&gt;bibliography.bib&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@book{test:test,&#xA;  title = {test},&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which both compiles to the desired pdf file (with the desired printed bibliography):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ xelatex doc.tex &amp;amp;&amp;amp; biber doc &amp;amp;&amp;amp; xelatex doc.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/41dKV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/41dKV.png&quot; alt=&quot;result without emacs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;with emacs&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;however, if i use &lt;code&gt;GNU Emacs 25.1.1&lt;/code&gt; and  &lt;code&gt;auctex-11.89.4&lt;/code&gt; for that, it doesn't work:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/VE57F.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VE57F.png&quot; alt=&quot;result with emacs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i think this is the important part of the log file (i can't upload the full log file, due to the character limitation on stackexchange.com):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Package biblatex Info: Trying to load bibliographic data...&#xA;Package biblatex Info: ... file 'doc.bbl' not found.&#xA;&#xA;No file doc.bbl.&#xA;Package biblatex Info: Reference section=0 on input line 11.&#xA;Package biblatex Info: Reference segment=0 on input line 11.&#xA;LaTeX Font Info:    External font `cmex10' loaded for size&#xA;(Font)              &amp;lt;12&amp;gt; on input line 12.&#xA;LaTeX Font Info:    External font `cmex10' loaded for size&#xA;(Font)              &amp;lt;8&amp;gt; on input line 12.&#xA;LaTeX Font Info:    External font `cmex10' loaded for size&#xA;(Font)              &amp;lt;6&amp;gt; on input line 12.&#xA;&#xA;LaTeX Warning: Citation 'test:test' on page 1 undefined on input line 15.&#xA;&#xA;&#xA;LaTeX Warning: Empty bibliography on input line 17.&#xA;&#xA;[1&#xA;&#xA;] (./doc.aux)&#xA;&#xA;LaTeX Warning: There were undefined references.&#xA;&#xA;&#xA;Package biblatex Warning: Please (re)run Biber on the file:&#xA;(biblatex)                doc&#xA;(biblatex)                and rerun LaTeX afterwards.&#xA;&#xA;Package logreq Info: Writing requests to 'doc.run.xml'.&#xA;\openout1 = `doc.run.xml'.&#xA;&#xA; ) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But unfortunately, i don't know what causes these errors. (in particular &lt;code&gt;file 'doc.bbl' not found&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;what have i tried?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Reading &lt;a href=&quot;https://tex.stackexchange.com/questions/43416/no-bbl-file-generated-by-bibtex-under-emacs&quot;&gt;this tex.stackexchange.com question&lt;/a&gt;, some solutions are given.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;reinstalling emacs and auctex&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;doesn't change anything.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;reading a different log file (.blg)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;unfortunately, no file with the extension .blg is given after building with emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;my emacs auctex settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'tex&#xA;    (setq LaTeX-item-indent -2 LaTeX-indent-level 4)&#xA;    (setq-default TeX-master nil)&#xA;    (setq TeX-parse-self t)          &#xA;    (setq TeX-auto-save t)                                        &#xA;    (add-hook 'LaTeX-mode-hook 'visual-line-mode)&#xA;    (add-hook 'LaTeX-mode-hook 'flyspell-mode)     &#xA;    (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)&#xA;    (add-hook 'LaTeX-mode-hook 'turn-on-reftex)&#xA;    (setq reftex-plug-into-AUCTeX t)                                    &#xA;    (setq-default TeX-engine 'xetex)   &#xA;    (setq LaTeX-biblatex-use-Biber t)&#xA;    (setq-default TeX-PDF-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11174" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-08-22T17:38:04.697" Title="compiling bibliography doesn't work with emacs (missing file *.bbl and its log file *.blg). Works on command line" Tags="|auctex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26464" PostTypeId="2" ParentId="26414" CreationDate="2016-08-22T14:57:30.330" Score="1" Body="&lt;p&gt;I've changed &lt;code&gt;company-dabbrev-char-regexp&lt;/code&gt; from &quot;\sw&quot; to &quot;\sw...[a-zA-Z0-9-]?+&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can complete not only foobar, but also foo-bar.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-08-22T15:03:31.707" LastActivityDate="2016-08-22T15:03:31.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26466" PostTypeId="2" ParentId="26462" CreationDate="2016-08-22T16:22:19.183" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;command-line-args&lt;/code&gt; contains the command line &lt;code&gt;(&quot;emacs&quot;)&lt;/code&gt; when there are no arguments and &lt;code&gt;(&quot;emacs&quot; &quot;myfile.tex&quot;)&lt;/code&gt; when you invoke it for myfile.tex. The simplest thing I can think of doing here is to check the length:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (&amp;lt; (length command-line-args) 2)&#xA;  (add-hook 'emacs-startup-hook #'helm-mini))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-08-22T16:22:19.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26468" PostTypeId="2" ParentId="26463" CreationDate="2016-08-22T17:38:04.697" Score="2" Body="&lt;p&gt;This is normal - the basic AucTex work flow requires that you run the various compilation steps one at a time. This is done through the &lt;code&gt;TeX-command-master&lt;/code&gt; command, bound to &lt;code&gt;C-c C-c&lt;/code&gt;. The first time you run it, it will call &lt;code&gt;latex&lt;/code&gt; on your file, or whatever option you have set for &lt;code&gt;TeX-engine&lt;/code&gt; (i.e., xelatex in this case). Once that's done, you may need to rerun it to have your bibliography compiled (with bibtex or biber), and again to compile your bibliography into the completed document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, the command line sequence:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xelatex doc.tex &amp;amp;&amp;amp; biber doc &amp;amp;&amp;amp; xelatex doc.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-c latex&lt;/code&gt;,&#xA;&lt;code&gt;C-c C-c biber&lt;/code&gt;,&#xA;&lt;code&gt;C-c C-c latex&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note - AucTeX is pretty good at guessing which step is next. When you enter &lt;code&gt;C-c C-c&lt;/code&gt; you'll see a message listing the default value. If it's the command you want (i.e., latex or biber), just hit enter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you'll get prompts if AucTex thinks you need to run another command, such as when a document is compiled before its bibliography is available. Watch for these prompts, and keep hitting &lt;code&gt;C-c C-c&lt;/code&gt; until you see the &quot;completed&quot; sign!&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-08-22T17:38:04.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26469" PostTypeId="1" AcceptedAnswerId="26488" CreationDate="2016-08-22T17:52:36.303" Score="5" ViewCount="739" Body="&lt;p&gt;I'm trying to evaluate the following code in &lt;code&gt;emacs&lt;/code&gt;, using &lt;code&gt;ob-ipython&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ipython :session :results output&#xA;lstt = [&quot;2&quot;,&quot;3&quot;]&#xA;for l in lstt:&#xA;  print l&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: 2&#xA;: 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why am I seeing the colon at the beginning of the results section?&lt;/p&gt;&#xA;" OwnerUserId="13076" LastActivityDate="2019-04-03T19:47:05.913" Title="Why are results prefaced with colon in ob-ipython?" Tags="|org-mode|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26470" PostTypeId="2" ParentId="18794" CreationDate="2016-08-22T17:57:08.357" Score="3" Body="&lt;p&gt;The following code gives you almost what you want in a gnu/linux or cygwin environment. (I do not know whether it works with nt-emacs.) Adaption to other environments should be easy.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;How can I get different default names for each picture?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;That is the only caveat. You have to input the file name for yourself. For an example input &lt;code&gt;[[file:Images/test.svg]]&lt;/code&gt;. The advantage is that you can choose a sane file name and you know exactly where the file resides.&#xA;It is not necessary that the file exists. The option &lt;code&gt;org-mouse-w32-app-templates&lt;/code&gt; provides some minimal contents for files that must exist when the application starts. There is only something for &lt;code&gt;svg&lt;/code&gt;-files yet. You can easily add other types if you want.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Would it be possible to recover the name so I can save it to another name?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;That is no problem with 1.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;And How can I reopen the application to modify the picture ? (like &lt;kbd&gt;C-c C-c&lt;/kbd&gt; is able to reevaluate source code... ).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;That is what the code really does for you. The 3rd mouse button on the link opens a context menu where you can choose to start the windows application for that link. (You can further populate the context menu with useful items yourself if you want.) Here at my place &lt;code&gt;inkscape&lt;/code&gt; is opened in this way. Emacs waits until the application is finished. If the file matches a regular expression for image files the images in the current org-buffer are updated thru the process-sentinel &lt;code&gt;org-mouse-app-update-images&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;EDIT 1: Now it should be more system independent.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;&#xA;(add-hook 'org-mode-hook '(lambda ()&#xA;                (org-defkey org-mouse-map [mouse-3] 'org-mouse-3-menu)))&#xA;&#xA;&#xA;(defun org-mouse-3-menu (event)&#xA;  &amp;quot;Context menu for org-links.&amp;quot;&#xA;  (interactive &amp;quot;e&amp;quot;)&#xA;  (let ((selection (x-popup-menu&#xA;            event&#xA;            (list&#xA;             &amp;quot;Org File Menu&amp;quot;&#xA;             (list&#xA;              &amp;quot;&amp;quot;&#xA;              '(&amp;quot;Registered Application&amp;quot; . org-mouse-app)&#xA;              ;; other nice applications go here&#xA;              )))))&#xA;    (and selection&#xA;     (with-current-buffer (window-buffer (posn-window (event-start event)))&#xA;       (call-interactively selection)))))&#xA;&#xA;(defcustom org-mouse-app-templates&#xA;  '((&amp;quot;svg&amp;quot; . &amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot; encoding=\&amp;quot;iso-8859-1\&amp;quot;?&amp;gt;&amp;lt;!DOCTYPE svg PUBLIC \&amp;quot;-//W3C//DTD SVG 20001102//EN\&amp;quot; \&amp;quot;http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd\&amp;quot;&amp;gt;&amp;lt;svg width=\&amp;quot;100%\&amp;quot; height=\&amp;quot;100%\&amp;quot;&amp;gt;&amp;lt;/svg&amp;gt;&amp;quot;))&#xA;  &amp;quot;Some applications bark if they are called with the name of a non-existing file.&#xA;This list associates file extensions of non-existing files to some minimal content.&amp;quot;&#xA;  :type '(alist :key-type string :value-type string)&#xA;  :group 'org)&#xA;&#xA;(defvar org-buf)&#xA;&#xA;(defun org-mouse-app-update-images (proc action)&#xA;  &amp;quot;Process sentinel for `org-mouse-app' updates images in org-buffer.&amp;quot;&#xA;  (with-current-buffer (process-buffer proc)&#xA;    (when (and (boundp 'org-buf)&#xA;           (buffer-live-p org-buf))&#xA;      (with-current-buffer org-buf&#xA;    (org-display-inline-images)))))&#xA;&#xA;(defcustom org-mouse-app-alist '((cygwin &amp;quot;cygstart&amp;quot; &amp;quot;-w&amp;quot;) ;; option -w: wait for the application to finish&#xA;                 (gnu/linux &amp;quot;xdg-open&amp;quot;)&#xA;                 (windows-nt &amp;quot;start&amp;quot;)&#xA;                 (t &amp;quot;xdg-open&amp;quot;))&#xA;  &amp;quot;Rules for starting default applications.&#xA;Association list. Each element is a cons with the system type as `car'&#xA;and the list of the command and its first arguments.&#xA;The name of the file to be opened is appended to the list.&#xA;System type `t' stands for all systems not explicitly contained in the list.&amp;quot;&#xA;  :type '(alist :key symbol :value (list string))&#xA;  :group 'org)&#xA;&#xA;(defun org-mouse-app (event)&#xA;  &amp;quot;Start registered application for file at point.&amp;quot;&#xA;  (interactive &amp;quot;e&amp;quot;)&#xA;  (set-buffer (window-buffer (posn-window (event-end event))))&#xA;  (let* ((file (save-excursion&#xA;        (goto-char (posn-point (event-end event)))&#xA;        (substitute-in-file-name (nth 1 (org-link-at-point)))))&#xA;    (ext (file-name-extension file)))&#xA;    (unless (file-exists-p file)&#xA;      (let ((content (assoc-string ext org-mouse-app-templates t)))&#xA;    (when content&#xA;      (with-temp-buffer&#xA;        (insert (cdr content))&#xA;        (write-region (point-min) (point-max) file)&#xA;        ))))&#xA;    (select-window (posn-window (event-end event)))&#xA;    (let ((proc (apply 'start-process (append (list (concat &amp;quot;App:&amp;quot; file)&#xA;                            (concat &amp;quot; *App:&amp;quot; file))&#xA;                          (cdr (or (assoc-string system-type org-mouse-app-alist)&#xA;                               (assoc-string t org-mouse-app-alist)))&#xA;                          (list (expand-file-name (encode-coding-string (file-name-sans-versions file t)&#xA;                                                (or file-name-coding-system&#xA;                                                default-file-name-coding-system)&#xA;                                                'nocopy)))))))&#xA;      (when (string-match (image-file-name-regexp) file)&#xA;    (let ((current-buf (current-buffer)))&#xA;      (with-current-buffer (process-buffer proc)&#xA;        (setq-local org-buf current-buf)&#xA;        (set-process-sentinel proc #'org-mouse-app-update-images)))))))&#xA;&#xA;(defun org-link-at-point ()&#xA;  &amp;quot;Return list (type path link) of org-link at point.&amp;quot;&#xA;  (interactive)&#xA;  (let (type path link line search (pos (point)))&#xA;    (catch 'match&#xA;      (save-excursion&#xA;    (skip-chars-forward &amp;quot;^]\n\r&amp;quot;)&#xA;    (when (org-in-regexp org-bracket-link-regexp)&#xA;      (setq link (org-link-unescape (org-match-string-no-properties 1)))&#xA;      (while (string-match &amp;quot; *\n *&amp;quot; link)&#xA;        (setq link (replace-match &amp;quot; &amp;quot; t t link)))&#xA;      (setq link (org-link-expand-abbrev link))&#xA;      (cond&#xA;       ((or (file-name-absolute-p link)&#xA;        (string-match &amp;quot;^\\.\\.?/&amp;quot; link))&#xA;        (setq type &amp;quot;file&amp;quot; path link))&#xA;       ((string-match org-link-re-with-space3 link)&#xA;        (setq type (match-string 1 link) path (match-string 2 link)))&#xA;       (t (setq type &amp;quot;thisfile&amp;quot; path link)))&#xA;      (throw 'match t)))&#xA;&#xA;      (when (get-text-property (point) 'org-linked-text)&#xA;    (setq type &amp;quot;thisfile&amp;quot;&#xA;          pos (if (get-text-property (1+ (point)) 'org-linked-text)&#xA;              (1+ (point)) (point))&#xA;          path (buffer-substring&#xA;            (previous-single-property-change pos 'org-linked-text)&#xA;            (next-single-property-change pos 'org-linked-text)))&#xA;    (throw 'match t))&#xA;&#xA;      (save-excursion&#xA;    (when (or (org-in-regexp org-angle-link-re)&#xA;          (org-in-regexp org-plain-link-re))&#xA;      (setq type (match-string 1) path (match-string 2))&#xA;      (throw 'match t)))&#xA;      (save-excursion&#xA;    (when (org-in-regexp (org-re &amp;quot;\\(:[[:alnum:]_@:]+\\):[ \t]*$&amp;quot;))&#xA;      (setq type &amp;quot;tags&amp;quot;&#xA;        path (match-string 1))&#xA;      (while (string-match &amp;quot;:&amp;quot; path)&#xA;        (setq path (replace-match &amp;quot;+&amp;quot; t t path)))&#xA;      (throw 'match t)))&#xA;      (when (org-in-regexp &amp;quot;&amp;lt;\\([^&amp;gt;&amp;lt;\n]+\\)&amp;gt;&amp;quot;)&#xA;    (setq type &amp;quot;tree-match&amp;quot;&#xA;          path (match-string 1))&#xA;    (throw 'match t)))&#xA;    (unless path&#xA;      (error &amp;quot;No link found&amp;quot;))&#xA;    (list type (substring-no-properties path) (substring-no-properties link))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-08-22T21:24:46.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26471" PostTypeId="1" AcceptedAnswerId="26474" CreationDate="2016-08-22T17:57:24.633" Score="2" ViewCount="201" Body="&lt;p&gt;I added Mac clipboard integration to my &lt;code&gt;emacs -nw&lt;/code&gt; using the following code, adapted from &lt;a href=&quot;https://gist.github.com/the-kenny/267162&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-from-osx ()&#xA;  (shell-command-to-string &quot;pbpaste&quot;))&#xA;&#xA;(defun paste-to-osx (text &amp;amp;optional push)&#xA;  (let ((process-connection-type nil))&#xA;    (let ((proc (start-process &quot;pbcopy&quot; &quot;*Messages*&quot; &quot;pbcopy&quot;)))&#xA;      (process-send-string proc text)&#xA;      (process-send-eof proc))))&#xA;&#xA;(setq interprogram-cut-function 'paste-to-osx)&#xA;(setq interprogram-paste-function 'copy-from-osx)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this creates some undesirable behavior in step 4 of the following situation:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I kill the text &lt;code&gt;abc&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I kill the text &lt;code&gt;def&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I press &lt;code&gt;C-y&lt;/code&gt;, which brings back &lt;code&gt;def&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I press &lt;code&gt;M-y&lt;/code&gt;, which &lt;strong&gt;should&lt;/strong&gt; replace &lt;code&gt;def&lt;/code&gt; with &lt;code&gt;abc&lt;/code&gt; but instead does nothing.&lt;/li&gt;&#xA;&lt;li&gt;I press &lt;code&gt;M-y&lt;/code&gt; again, which now properly replaces &lt;code&gt;def&lt;/code&gt; with &lt;code&gt;abc&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Further invocations of &lt;code&gt;M-y&lt;/code&gt; will function as expected, yanking kills from earlier on the kill ring.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(Having just the above code as my &lt;code&gt;init.el&lt;/code&gt; reproduces the problem.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I think is happening:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I kill some text, it's saved to the Emacs kill ring but also (via &lt;code&gt;interprogram-cut-function&lt;/code&gt;) to the system clipboard. Then, when I yank with &lt;code&gt;C-y&lt;/code&gt;, I first get the contents of the system clipboard (via &lt;code&gt;interprogram-paste-function&lt;/code&gt;). Pressing &lt;code&gt;M-y&lt;/code&gt; after that gets me the first entry in the Emacs kill ring, which is the same thing. Only by pressing &lt;code&gt;M-y&lt;/code&gt; a second time can I get to older entries in the kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what the best resolution to this problem is. Can Emacs be told to skip yanking from the system clipboard if its contents are identical to the first entry in the kill ring? Or is there another way to be able to &lt;code&gt;C-y M-y&lt;/code&gt; instead of &lt;code&gt;C-y M-y M-y&lt;/code&gt; to get the second-most-recent thing I killed?&lt;/p&gt;&#xA;" OwnerUserId="12534" LastEditorUserId="12534" LastEditDate="2016-08-22T23:29:08.080" LastActivityDate="2016-08-22T23:29:08.080" Title="How to avoid double M-y with system clipboard integration in the terminal" Tags="|osx|terminal-emacs|yank|kill-ring|clipboard|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26474" PostTypeId="2" ParentId="26471" CreationDate="2016-08-22T22:07:53.047" Score="1" Body="&lt;p&gt;I think the docstring from &lt;code&gt;interprogram-paste-function&lt;/code&gt; describes the problem and a possible solution:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that the function should return a string only if a program&#xA;  other than Emacs has provided a string for pasting; if Emacs&#xA;  provided the most recent string, the function should return nil.&#xA;  If it is difficult to tell whether Emacs or some other program&#xA;  provided the current string, it is probably good enough to return&#xA;  nil if the string is equal (according to `string=') to the last&#xA;  text Emacs provided.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you could do this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;create a variable (initially nil) to save the last text paste&lt;em&gt;d&lt;/em&gt;-to-osx,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;make &lt;code&gt;paste-to-osx&lt;/code&gt; save its text argument to the variable,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;make &lt;code&gt;cut-from-osx&lt;/code&gt; compare the obtained string with the one saved in the variable, and return either the string or nil.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-08-22T22:07:53.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26475" PostTypeId="2" ParentId="26471" CreationDate="2016-08-22T22:46:33.047" Score="0" Body="&lt;p&gt;Based on the suggestions in @JeanPierre's answer, I worked out the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq last-paste-to-osx nil)&#xA;&#xA;(defun copy-from-osx ()&#xA;  (let ((copied-text (shell-command-to-string &quot;pbpaste&quot;)))&#xA;    (unless (string= copied-text last-paste-to-osx)&#xA;      copied-text)))&#xA;&#xA;(defun paste-to-osx (text &amp;amp;optional push)&#xA;  (let ((process-connection-type nil))&#xA;    (let ((proc (start-process &quot;pbcopy&quot; &quot;*Messages*&quot; &quot;pbcopy&quot;)))&#xA;      (process-send-string proc text)&#xA;      (process-send-eof proc)))&#xA;  (setq last-paste-to-osx text))&#xA;&#xA;(setq interprogram-cut-function 'paste-to-osx)&#xA;(setq interprogram-paste-function 'copy-from-osx)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;sub&gt;&lt;sup&gt;(for additional context see my &lt;a href=&quot;https://github.com/raxod502/dotfiles/blob/master/init.el&quot; rel=&quot;nofollow&quot;&gt;init.el&lt;/a&gt;, commit &lt;a href=&quot;https://github.com/raxod502/dotfiles/commit/fff29ffe5912869b180000fd72960e5f49b1b418&quot; rel=&quot;nofollow&quot;&gt;fff29ffe&lt;/a&gt;)&lt;/sup&gt;&lt;/sub&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="12534" LastActivityDate="2016-08-22T22:46:33.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26476" PostTypeId="1" CreationDate="2016-08-22T23:50:38.557" Score="2" ViewCount="2154" Body="&lt;p&gt;I'm using &lt;code&gt;smartparens-global-strict-mode&lt;/code&gt;and having issues quoting variables. How do I get something like &lt;code&gt;'varname&lt;/code&gt;? My current strategy, which seems ridiculous, is to do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'|'&lt;/code&gt; (sp inserts both pairs)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;'varname'&lt;/code&gt; (write the varname)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;at this point, I do &lt;code&gt;M-x smartparens-strict-mode&lt;/code&gt;, which toggles it off, delete the right &lt;code&gt;'&lt;/code&gt;, then do &lt;code&gt;M-x smartparens-strict-mode&lt;/code&gt; again to turn it back on. But there's got to be a better way, right? Am I missing something simple?&lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2020-08-03T02:12:18.353" Title="smartparens strict mode insert single quote before variable" Tags="|smartparens|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26477" PostTypeId="2" ParentId="26397" CreationDate="2016-08-23T00:22:20.297" Score="2" Body="&lt;p&gt;Scrolling causes the hook &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Hooks.html#index-window_002dscroll_002dfunctions&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;window-scroll-functions&lt;/code&gt;&lt;/a&gt; to be executed. That lets you know when scrolling happens, but as the manual says,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning: don’t use this feature to alter the way the window is scrolled. It’s not designed for that, and such use probably won’t work.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's actually possible to “lock” scrolling by saving &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Start-and-End.html#index-window_002dstart&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;window-start&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Start-and-End.html#index-set_002dwindow_002dstart&quot; rel=&quot;nofollow noreferrer&quot;&gt;restoring it&lt;/a&gt; inside &lt;code&gt;window-scroll-functions&lt;/code&gt;, but that doesn't mean you should do it. It can cause the point to get out of the scrolling zone; you can fix that by manually clipping the point &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Point.html#Window-Point&quot; rel=&quot;nofollow noreferrer&quot;&gt;and the window point&lt;/a&gt; to the window area. But that gets really confusing when inserting text at the end of the window, as it causes the cursor to move backwards while inserting text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't prevent a modification that would cause scrolling, because whether to scroll is determined after the modification is made and after things like line wrapping (whether explicit through auto fill mode or visual with visual line mode) have been processed. Once Emacs gets to the bit where it finds out whether it needs to scroll, the modification has already been carried out and the only solution would be to undo it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A solution would be to keep two identical buffers, try out the modification in one of them, calculate the effect on scrolling (maybe by maintaining a “shadow” window in a hidden frame?), and carrying out the modification in the original buffer only if no scrolling happens. This sounds difficult for what it's worth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Narrowing.html#Narrowing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Narrowing&lt;/a&gt;, as &lt;a href=&quot;https://emacs.stackexchange.com/a/26403&quot;&gt;suggested by Wilfred Hughes&lt;/a&gt;, does most of what you want, but doesn't help with text insertions. You might combine narrowing with an entry in &lt;code&gt;window-scroll-functions&lt;/code&gt;, but you need to figure out what you want to do when the text grows too large. You need to have clear requirements before you can start implementing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think preventing edits makes sense. If you want to maintain a structure overview, do it with two windows: one where you edit text without any length restrictions, and one that shows the structure overview. See &lt;a href=&quot;https://emacs.stackexchange.com/questions/9530/how-can-i-get-an-org-mode-outline-in-a-2nd-buffer-as-a-dynamic-table-of-contents&quot;&gt;How can I get an org-mode outline in a 2nd buffer as a dynamic table of contents?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-08-23T00:22:20.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26478" PostTypeId="2" ParentId="26476" CreationDate="2016-08-23T01:29:43.097" Score="2" Body="&lt;p&gt;What major mode are you using? In &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, Smartparens does not automatically close single quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To insert a single character, use &lt;code&gt;C-q&lt;/code&gt;, &lt;code&gt;quoted-insert&lt;/code&gt;, followed by the character. E.g. &lt;code&gt;C-q '&lt;/code&gt; to insert a single quote.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-08-23T01:29:43.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26480" PostTypeId="2" ParentId="26083" CreationDate="2016-08-23T02:04:50.067" Score="1" Body="&lt;p&gt;I often need to copy/paste a large tree and had the same problem with duplicate ids.  Now, after pasting the tree, I &lt;strong&gt;narrow to the tree&lt;/strong&gt; and run the following function.  This will visit every heading at any level in the tree and either change its id or, for newly-created headings, give it an id.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bw/org-add-update-ids-to-headlines-in-file ()&#xA;  &quot;Add ID properties to all visible headlines in the current file which&#xA;do not already have one.  Change the IDs of those that already have them.&quot;&#xA;  (interactive)&#xA;  (org-map-entries '(lambda () (org-id-get-create t))))&#xA;&#xA;(spacemacs/set-leader-keys &quot;oa&quot; 'bw/org-add-update-ids-to-headlines-in-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe I should also look into adding an id automatically every time I create a new heading...&lt;/p&gt;&#xA;" OwnerUserId="2013" LastActivityDate="2016-08-23T02:04:50.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26482" PostTypeId="1" AcceptedAnswerId="26486" CreationDate="2016-08-23T04:52:22.510" Score="3" ViewCount="185" Body="&lt;p&gt;How can I tweak Emacs auto-fill to fill when a period is inserted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with a &lt;code&gt;(setq fill-column 10)&lt;/code&gt; the following will auto-fill when I press the space after &quot;fill&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; good fill&#xA;&#xA;;; good&#xA;;; fill on&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This example doesn't fill when I press the period.  I have to invoke&#xA;&lt;code&gt;fill-paragraph&lt;/code&gt; manually&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; bad fillllllllllllllllll.&#xA;&#xA;;; bad&#xA;;; fillllllllllllllllll.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-08-23T09:41:47.280" Title="Emacs auto fill on period" Tags="|text-editing|fill-paragraph|auto-fill-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26483" PostTypeId="1" CreationDate="2016-08-23T06:06:31.773" Score="3" ViewCount="1085" Body="&lt;p&gt;Do you have examples of packages that benefit substantially from byte-compilation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prefer to avoid byte-compiling files when it is not necessary, in particular when installing hundreds of packages, since it takes significantly longer to byte-compile. A comment in the &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el?h=emacs-25#n850&quot; rel=&quot;nofollow&quot;&gt;package.el source&lt;/a&gt; even suggests that &quot;Compilation should be done as a separate, optional, step.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/Byte-Compiling.html#Byte-Compiling&quot; rel=&quot;nofollow&quot;&gt;Byte Compiling section&lt;/a&gt; of the Emacs manual states:&#xA;&quot;As a practical matter, for most things you might do to customize or extend Emacs, you do not need to byte compile&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Elisp manual includes an example of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Speed-of-Byte_002dCode.html#Speed-of-Byte_002dCode&quot; rel=&quot;nofollow&quot;&gt;performance of byte-compiled code&lt;/a&gt;: &quot;In this example, the interpreted code required 10 seconds to run, whereas the byte-compiled code required less than 4 seconds. These results are representative, but actual results may vary.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Where &quot;substantially&quot; means a measurable difference like the example above in the running time of a package feature, or a measure of the latency of UI interaction.&lt;/p&gt;&#xA;" OwnerUserId="2138" LastEditorUserId="2138" LastEditDate="2016-08-27T15:42:44.993" LastActivityDate="2016-11-08T00:35:43.550" Title="Where and when should emacs lisp files be byte-compiled?" Tags="|byte-compilation|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26484" PostTypeId="2" ParentId="26483" CreationDate="2016-08-23T07:26:37.950" Score="5" Body="&lt;p&gt;Before the advent of eager (load-time) macro expansion, I would have said this was &lt;strong&gt;crazy talk&lt;/strong&gt;, and told you to forget the idea and compile everything as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Maybe&lt;/em&gt; it's somewhat less crazy now that macros are generally not expanded upon each evaluation -- but compiled elisp is still going to be faster (by varying margins) for pretty much everything, and elisp is not a fast language; so I just can't imagine why you'd pass up the long-term benefits of faster execution for the short-term benefits on the occasions when you install &quot;hundreds of packages&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Admittedly, I don't know what your scenario is when you're doing &lt;em&gt;that&lt;/em&gt; on a regular(?!) basis, so it's tricky to establish what the cost-vs-benefit might be here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm &lt;em&gt;guessing&lt;/em&gt; that you have a bare-bones Emacs config which fetches and installs these hundreds of packages the first time you run it. If you simply keep all the packages in your config (in version control, or however you're managing it) then this would be a non-issue, and you'd get the best of both worlds -- much faster installation (no need to fetch or compile anything), and you still have byte-compiled code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A pretty trivial test is to remove all &lt;code&gt;*.elc&lt;/code&gt; files from your config, then start Emacs, use it for a while (making use of as many features as possible), and decide whether it's acceptable or not.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find ~/.emacs.d/ -type f -name &quot;*.elc&quot; -delete&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-08-23T10:40:05.090" LastActivityDate="2016-08-23T10:40:05.090" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26486" PostTypeId="2" ParentId="26482" CreationDate="2016-08-23T09:41:47.280" Score="5" Body="&lt;p&gt;The elisp manual &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Auto-Filling.html#Auto-Filling&quot;&gt;section&lt;/a&gt; about auto-filling describes the&#xA;&lt;code&gt;auto-fill-chars&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-- Variable: auto-fill-chars&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; A char table of characters which invoke ‘auto-fill-function’ when&#xA; self-inserted—space and newline in most language environments.&#xA; They have an entry ‘t’ in the table.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;About char tables it &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Char_002dTables.html#Char_002dTables&quot;&gt;says&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A char-table is much like a vector, except that it is indexed by&#xA;  character codes.  Any valid character code, without modifiers, can be&#xA;  used as an index in a char-table.  You can access a char-table’s&#xA;  elements with ‘aref’ and ‘aset’, as with any array.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you could simply do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(aset auto-fill-chars ?. t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to add the &lt;code&gt;.&lt;/code&gt; character to the ones triggering auto filling.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-08-23T09:41:47.280" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26487" PostTypeId="1" AcceptedAnswerId="26512" CreationDate="2016-08-23T11:40:01.607" Score="1" ViewCount="82" Body="&lt;p&gt;Evil-mode binds &lt;kbd&gt;C-w&lt;/kbd&gt;&lt;kbd&gt;h&lt;/kbd&gt; to evil-window-left. I'd like to bind &lt;kbd&gt;C-w&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt; to the same so it will work whether or not I lift my finger off the Control key in time. But &lt;kbd&gt;C-h&lt;/kbd&gt; is the help key. Is there any reasonable workaround for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm willing to lose the Help functions on &lt;kbd&gt;C-h&lt;/kbd&gt; since I can access them elsewhere, like &lt;kbd&gt;F1&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;: I may have found the solution.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;\C-w\C-h&quot; 'evil-window-left)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work without affecting &lt;kbd&gt;C-h&lt;/kbd&gt; behavior in other cases.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-08-23T11:56:48.320" LastActivityDate="2016-08-24T04:17:19.130" Title="How can I bind a key-sequence ending in `C-h`?" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26488" PostTypeId="2" ParentId="26469" CreationDate="2016-08-23T13:45:41.860" Score="4" Body="&lt;p&gt;&lt;code&gt;:results output raw&lt;/code&gt; removes the &lt;code&gt;:&lt;/code&gt;. However, raw output means results from repeated execution of that code block are prepended. The results are not replaced.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-08-23T13:45:41.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26489" PostTypeId="1" AcceptedAnswerId="26490" CreationDate="2016-08-23T14:17:12.693" Score="5" ViewCount="588" Body="&lt;p&gt;By using &lt;code&gt;org-list-make-subtree&lt;/code&gt; (&lt;code&gt;C-c C-*&lt;/code&gt;) you turn an Org List into a sub tree:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Item 1&#xA; - Item 2&#xA;  - Item 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would turn into &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Item 1&#xA;** Item 2&#xA;*** Item 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But is there a built in function (like &lt;code&gt;org-subtree-make-list&lt;/code&gt;)to reverse this operation or would you need to do it by hand?&lt;/p&gt;&#xA;" OwnerUserId="12446" LastActivityDate="2016-08-23T14:32:19.833" Title="Org Mode - Is there a way to reverse org-list-make-subtree?" Tags="|org-mode|list|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26490" PostTypeId="2" ParentId="26489" CreationDate="2016-08-23T14:26:53.350" Score="8" Body="&lt;p&gt;The command &lt;code&gt;org-ctrl-c-minus&lt;/code&gt; (bound to &lt;code&gt;C-c -&lt;/code&gt; by default) turns a region of lines into a list. You need to mark the lines you want to change first, but it works with the headlines in your example as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a defun you might use to mark the subtree and then change it to a list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-subtree-make-list ()&#xA;  (interactive)&#xA;  (org-mark-subtree)&#xA;  (org-ctrl-c-minus))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-08-23T14:32:19.833" LastActivityDate="2016-08-23T14:32:19.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26492" PostTypeId="1" AcceptedAnswerId="26524" CreationDate="2016-08-23T17:28:22.877" Score="3" ViewCount="2923" Body="&lt;p&gt;I have some text that looks like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;quot;CFName&amp;quot;&#xA;&amp;quot;CLName&amp;quot;&#xA;&amp;quot;CDOB&amp;quot;&#xA;&amp;quot;CGender&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I would like to get output where are of the text inside the double quotes is lowercased, like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;quot;cfname&amp;quot;&#xA;&amp;quot;clname&amp;quot;&#xA;&amp;quot;cdob&amp;quot;&#xA;&amp;quot;cgender&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So I've tried to use &lt;code&gt;M-x replace-regexp&lt;/code&gt; with the regexp being &lt;code&gt;\(&amp;quot;.*&amp;quot;\)&lt;/code&gt; and the replace as &lt;code&gt;\,(downcase \1)&lt;/code&gt;.  Which is how it is explained in &lt;a href=&quot;https://stackoverflow.com/questions/677021/emacs-regular-expression-replacing-to-change-case&quot; title=&quot;this question&quot;&gt;this question&lt;/a&gt;.  The selection does what I expect, but the replacement doesn't.&lt;/p&gt;&#xA;&lt;p&gt;What I get is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;quot;cfname&amp;quot;&#xA;&amp;quot;clname&amp;quot;&#xA;&amp;quot;CDOB&amp;quot;&#xA;&amp;quot;cgender&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The groups that are in ALL CAPS aren't downcased.  I've tried using downcase-region and downcase-word but those both fail with errors such as &lt;code&gt;Wrong type argument: integerp, #(&amp;quot;\&amp;quot;CG_DOB\&amp;quot;&amp;quot; 0 8 (fontified t))&lt;/code&gt;. I don't understand why downcase doesn't work with a group that is all caps.&lt;/p&gt;&#xA;&lt;p&gt;How do I get this replace-regexp to downcase all groups?&lt;/p&gt;&#xA;&lt;p&gt;I'm using GNU Emacs 24.3.1. The problem persists even if I start emacs with the -Q (don't use .emacs) flag. I've tried it in both sql-mode and text-mode with the same result.&lt;/p&gt;&#xA;&lt;p&gt;I've tried this on the following two versions of emacs with the same results:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-apple-darwin14.4.0) of 2015-07-20&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu) of 2014-03-07 on lamiak, modified by Debian&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10562" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-08-24T12:19:23.283" Title="How do I lowercase (downcase) a group with replace-regexp?" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26493" PostTypeId="1" AcceptedAnswerId="26496" CreationDate="2016-08-23T17:34:18.770" Score="3" ViewCount="121" Body="&lt;p&gt;I have an org-file, which I've wrapped in a &lt;code&gt;div&lt;/code&gt; for html export. This div is necessary because it is targeted by some custom css.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+html: &amp;lt;div id=&quot;wrapper-div&quot;&amp;gt;&#xA;&#xA;* Section One&#xA;* Section Two&#xA;* Etc.&#xA;&#xA;#+html: &amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that the &lt;code&gt;&amp;lt;/div&amp;gt;&lt;/code&gt; always gets folded into the last section. This wouldn't be a huge deal, but it's annoying when I add a new section to the end because this misplaces the &lt;code&gt;&amp;lt;/div&amp;gt;&lt;/code&gt; tag (being folded into the previous section).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I somehow mark the line, &lt;code&gt;#+html: &amp;lt;/div&amp;gt;&lt;/code&gt;, as non-collapsible?&lt;/p&gt;&#xA;" OwnerUserId="12496" LastActivityDate="2016-08-24T07:38:17.373" Title="Org-mode: how to prevent line from being included in section?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26495" PostTypeId="1" CreationDate="2016-08-23T19:11:25.390" Score="0" ViewCount="171" Body="&lt;p&gt;Prompted by &lt;a href=&quot;https://vi.stackexchange.com/a/9315/1065&quot;&gt;this question&lt;/a&gt; about why &lt;code&gt;hjkl&lt;/code&gt; are the keys used to move the cursor around in VIM, what did the keyboard / terminal look like that emacs was written on?&lt;/p&gt;&#xA;" OwnerUserId="2532" LastEditorUserId="-1" LastEditDate="2017-04-13T12:51:57.437" LastActivityDate="2016-08-24T20:06:20.723" Title="What sort of terminal did the guy who wrote emacs have?" Tags="|history|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26496" PostTypeId="2" ParentId="26493" CreationDate="2016-08-23T19:28:39.893" Score="1" Body="&lt;p&gt;&#xA;You can not add something to the top-level after introducing a heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there might be another solution for you by advising the export functions. I prepared two examples on how to achieve what you want, since I do not know whether you want to cover the content including the table of content or not. The first (&lt;code&gt;org-html-template-around&lt;/code&gt;) covers also the table of content, the second (&lt;code&gt;org-html-inner-template-around&lt;/code&gt;) only the content.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-html-template-around (org-fun &amp;amp;rest args)&#xA;  (let ((content (car args))&#xA;        (info (cadr args)))&#xA;    (apply org-fun (list (concat &quot;&amp;lt;div id=\&quot;wrapper-div\&quot;&amp;gt;&quot;&#xA;                             content&#xA;                             &quot;&amp;lt;/div&amp;gt;&quot;)&#xA;                         info))))&#xA;(advice-add 'org-html-template :around #'org-html-template-around)&#xA;&#xA;(defun org-html-inner-template-around (org-fun &amp;amp;rest args)&#xA;  (let ((content (car args))&#xA;        (info (cadr args)))&#xA;    (apply org-fun (list (concat &quot;&amp;lt;div id=\&quot;inner-wrapper-div\&quot;&amp;gt;&quot;&#xA;                             content&#xA;                             &quot;&amp;lt;/div&amp;gt;&quot;)&#xA;                         info))))&#xA;(advice-add 'org-html-inner-template :around #'org-html-inner-template-around)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may want to set a customization variable, probably buffer local, to enable and disable your addition on a per file basis.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local org-html-inner-template-around-id nil&#xA;  &quot;If non nil: wrap html export in div with id given by this var.&quot;)&#xA;(defun org-html-inner-template-around (org-fun &amp;amp;rest args)&#xA;  (let ((content (car args))&#xA;        (info (cadr args)))&#xA;    (when org-html-inner-template-around-id&#xA;      (setq content (concat (format &quot;&amp;lt;div id=\&quot;%s\&quot;&amp;gt;&quot; org-html-inner-template-around-id)&#xA;                             content&#xA;                             &quot;&amp;lt;/div&amp;gt;&quot;)))&#xA;    (apply org-fun (list content info))))&#xA;(advice-add 'org-html-inner-template :around #'org-html-inner-template-around-id)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can set the variable in your org file, e.g. with the following first line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;# -*- org-html-inner-template-around-id: findme-as-div; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for more information on specifying file variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;ox-twbs&lt;/code&gt; then advice &lt;code&gt;org-twbs-template&lt;/code&gt; or &lt;code&gt;org-twbs-inner-template&lt;/code&gt; respectively.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-24T07:38:17.373" LastActivityDate="2016-08-24T07:38:17.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26498" PostTypeId="1" AcceptedAnswerId="26568" CreationDate="2016-08-23T19:55:08.260" Score="0" ViewCount="132" Body="&lt;p&gt;I'm trying to go full minimalist over here... But I can't figure out how to remove the strippled line next to &quot;untitled&quot;.&#xA;I'd like it to be nothing at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The customizations I've done so far for tabbar in my .emacs is under the image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strippled line does not appear when tabbar is uncustomized.&lt;br&gt;&#xA;It appears when &lt;code&gt;'(tabbar-background-color &quot;color-237&quot;)&lt;/code&gt; is set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yFbl9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yFbl9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Loads tabbar and customizations&#xA;(tabbar-mode 1)&#xA;(setq tabbar-use-images nil)&#xA;(setq tabbar-buffer-groups-function(lambda() (list &quot;All Buffers&quot;)))&#xA;(defun buffer-groups()&#xA;  (list (cond ((string-equal &quot;*&quot; (substring (buffer-name) 0 1)) &quot;emacs&quot;)&#xA;              ((eq major-mode 'dired-mode) &quot;emacs&quot;) (t &quot;user&quot;))))&#xA;(setq tabbar-buffer-groups-function 'buffer-groups)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and some from customize-group:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(tabbar-background-color &quot;color-237&quot;)&#xA;'(tabbar-buffer-home-button (quote ((&quot;&quot;) &quot;&quot;)))&#xA;'(tabbar-home-button (quote ((&quot;&quot;) &quot;&quot;)))&#xA;'(tabbar-scroll-left-button (quote ((&quot;&quot;) &quot;&quot;)))&#xA;'(tabbar-scroll-right-button (quote ((&quot;&quot;) &quot;&quot;)))&#xA;'(tabbar-separator (quote (2)&#xA;&#xA;'(tabbar-button ((t nil)))&#xA;'(tabbar-default ((t (:background &quot;color-237&quot; :foreground &quot;color-250&quot;))))&#xA;'(tabbar-highlight ((t nil)))&#xA;'(tabbar-modified ((t (:inherit tabbar-default :foreground &quot;#87D700&quot;))))&#xA;'(tabbar-selected ((t (:inherit tabbar-default :foreground &quot;#1EE8FF&quot;))))&#xA;'(tabbar-selected-modified ((t (:inherit tabbar-default :foreground &quot;#1EE8FF&quot;))))&#xA;'(tabbar-unselected ((t (:inherit tabbar-default))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2007" LastEditorUserId="2007" LastEditDate="2016-08-23T21:00:30.713" LastActivityDate="2016-08-25T10:54:56.813" Title="Dashes (or strippled line, dashed) in tabbar for emacs with X" Tags="|buffers|customize|gui-emacs|tabbar|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26499" PostTypeId="1" CreationDate="2016-08-23T19:55:09.613" Score="1" ViewCount="137" Body="&lt;p&gt;When I use the ics export functionality of org-mode on org files which contain date ranges, i.e., entries like &lt;code&gt;&amp;lt;2016-08-20 Sat&amp;gt;--&amp;lt;2016-08-25 Thu&amp;gt;&lt;/code&gt; only the first and the last day seem to be exported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is  there a way to export it so that the generated entry contains the whole date range?&lt;/p&gt;&#xA;" OwnerUserId="10405" LastActivityDate="2016-08-23T19:55:09.613" Title="Org Mode ics export and date ranges" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26500" PostTypeId="2" ParentId="26495" CreationDate="2016-08-23T19:58:39.927" Score="3" Body="&lt;p&gt;(Your question must be about the keyboard, not the terminal, I think.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs was written by multiple people, from the outset. And at that time there were multiple kinds of keyboards (but they were generally QWERTY). Emacs was developed on keyboards similar to those on which vi was developed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The essential difference between vi and Emacs, and the reason that keys such as &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, and &lt;code&gt;l&lt;/code&gt; are not used for cursor motion, is that Emacs, unlike vi, is not modal (in the sense of having an insert and a command mode). In Emacs, &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, and &lt;code&gt;l&lt;/code&gt; naturally insert themselves (in the typical case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contexts where you cannot insert text, keys such as &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, and &lt;code&gt;l&lt;/code&gt; often do run commands (other than self-insert).  It's not like the designers of Emacs were crazy about promoting odd key sequences.   Emacs uses complex key sequences because the simplest keys (&lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;,...) are used for self-inserting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Dunno why people somehow seem to lose sight of this, or it just doesn't occur to them.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-23T19:58:39.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26501" PostTypeId="1" AcceptedAnswerId="26511" CreationDate="2016-08-23T20:13:41.220" Score="0" ViewCount="139" Body="&lt;p&gt;I am using emacs to edit Latex. My work flow is to open the latex file, open a new buffer in a separate window via &lt;code&gt;C-x 2&lt;/code&gt;. Then moving the context into the new windowbuffer via &lt;code&gt;C-x o&lt;/code&gt;, I type &lt;code&gt;M x shell&lt;/code&gt; to open a terminal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is all fine but I then need to type in the changing of directories to get to the Latex file, and I do this frequently. So I would like to know if there is a quick way to open the shell in the current directory of the Latex file?&lt;/p&gt;&#xA;" OwnerUserId="2340" LastActivityDate="2016-08-24T04:10:46.383" Title="In a new shell, move to directory of other current buffer being edited?" Tags="|buffers|shell|directories|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26502" PostTypeId="1" AcceptedAnswerId="26504" CreationDate="2016-08-23T21:38:33.333" Score="2" ViewCount="47" Body="&lt;p&gt;I'm trying to rebind the window selection with this in the dotspacemacs/user-config :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;amp;&quot;) ’select-window-0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But at startup I got this error message :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(Spacemacs) Error in dotspacemacs/user-config: Symbol's value as&#xA;  variable is void: ’select-window-0&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;&amp;amp;&lt;/code&gt; is still unset. &lt;/p&gt;&#xA;" OwnerUserId="13055" LastActivityDate="2016-08-24T01:52:59.443" Title="Trying to rebind a comand in the init file but the command is void" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26503" PostTypeId="2" ParentId="9586" CreationDate="2016-08-23T22:04:47.997" Score="0" Body="&lt;p&gt;If you are on OS X I believe the Carbon Mac Emacs port supports ligatures.&lt;/p&gt;&#xA;" OwnerUserId="13085" LastActivityDate="2016-08-23T22:04:47.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26504" PostTypeId="2" ParentId="26502" CreationDate="2016-08-23T22:13:18.407" Score="6" Body="&lt;p&gt;I love this one.  You have a curly quote instead of a straight apostrophe character.  And the former is considered part of the symbol name (&lt;code&gt;’select-window-0&lt;/code&gt;), so Emacs is trying to evaluate that &lt;strong&gt;symbol (&lt;code&gt;’select-window-0&lt;/code&gt;) as a variable&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;amp;&quot;) 'select-window-0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You need to use an ASCII apostrophe.  The character you used (&lt;strong&gt;&lt;code&gt;’&lt;/code&gt;&lt;/strong&gt;) is named &lt;code&gt;RIGHT SINGLE QUOTATION MARK&lt;/code&gt; (in Unicode).  The character you want (&lt;strong&gt;&lt;code&gt;'&lt;/code&gt;&lt;/strong&gt;) is named &lt;code&gt;APOSTROPHE&lt;/code&gt; (in Unicode).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-24T01:52:59.443" LastActivityDate="2016-08-24T01:52:59.443" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26505" PostTypeId="2" ParentId="26483" CreationDate="2016-08-23T23:33:42.353" Score="4" Body="&lt;p&gt;js2-mode benefits substantially from byte compilation because it does heavy computing to semantically analyze the Javascript code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other major modes use regular expression. byte compilation does not matter for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually you don't need care about byte compilation because plugins don't do heavy computing at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A plugin is just a Emacs Lisp file. It has no difference with your dot Emacs file. So it's often the waste of time to compile your dot Emacs file&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-11-08T00:35:43.550" LastActivityDate="2016-11-08T00:35:43.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26506" PostTypeId="1" AcceptedAnswerId="26508" CreationDate="2016-08-24T01:13:43.123" Score="6" ViewCount="2333" Body="&lt;p&gt;I have a file called &lt;code&gt;zshrc&lt;/code&gt; (not &lt;code&gt;.zshrc&lt;/code&gt;). Emacs does not recognize that it must use &lt;code&gt;sh-mode&lt;/code&gt;automatically. I want to put some sort of hint for emacs to pick up and syntax highlight my file accordingly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;how do I achieve that? &lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="12585" LastEditDate="2016-08-30T14:01:22.503" LastActivityDate="2016-08-30T14:01:22.503" Title="How do I force a mode on a specific file through special comments" Tags="|major-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26507" PostTypeId="1" AcceptedAnswerId="26513" CreationDate="2016-08-24T01:19:08.920" Score="5" ViewCount="583" Body="&lt;p&gt;Is there a way to tell &lt;code&gt;package.el&lt;/code&gt; that the &lt;code&gt;org-plus-contrib&lt;/code&gt; package I already have satisfies any dependency on &lt;code&gt;org&lt;/code&gt;, so that installing packages that depend on &lt;code&gt;org&lt;/code&gt; (such as the afore mentioned &lt;code&gt;org2blog&lt;/code&gt;) doesn't automatically install &lt;code&gt;org&lt;/code&gt; as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not an actual problem: after installing &lt;code&gt;org2blog&lt;/code&gt; through the Package menu I now have &lt;code&gt;org&lt;/code&gt; installed in addition to &lt;code&gt;org-plus-contrib&lt;/code&gt; (which includes all of &lt;code&gt;org&lt;/code&gt;). This extra &lt;code&gt;org&lt;/code&gt; doesn't load (when I run &lt;code&gt;M-x org-version&lt;/code&gt; I can see that I get the one from &lt;code&gt;org-plus-contrib&lt;/code&gt;) or bother me in any way. But since I'm not using it, I'd rather not have it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bet the &quot;right way&quot; to fix this is for the &lt;code&gt;org-plus-contrib&lt;/code&gt; package to be reduced to an &lt;code&gt;org-contrib&lt;/code&gt; package that depends on &lt;code&gt;org&lt;/code&gt; and only contains the extra libraries, not the &lt;code&gt;org&lt;/code&gt; base. But is there anything locally I can do to fix this (very minor) annoyance?&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2016-08-24T01:46:16.343" LastActivityDate="2017-04-11T21:58:43.880" Title="Use `org-plus-contrib` to satisfy dependency of `org2blog`" Tags="|org-mode|package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26508" PostTypeId="2" ParentId="26506" CreationDate="2016-08-24T01:21:55.180" Score="14" Body="&lt;p&gt;You can use a&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot;&gt;file-local variable&lt;/a&gt;&#xA;to specify the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either put them at the top of the file, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: sh -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or at the bottom of the file, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# mode: sh&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-24T01:21:55.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26509" PostTypeId="1" AcceptedAnswerId="26571" CreationDate="2016-08-24T02:10:48.600" Score="6" ViewCount="768" Body="&lt;p&gt;I have 5 tasks from two org files - test and test2. I want to sort all tasks by only priority in the org agenda (To Do list, &lt;code&gt;C-c a t&lt;/code&gt;). By default, I understand that they are ordered by (org-file name and within that descending order of priority). So I changed, (&lt;code&gt;org-agenda-sortingstrategy&lt;/code&gt; to priority-desc). However, the ordering of tasks is somehow not happening by just priority-desc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not even able to understand what is the logic being applied to sort this. Any help in this matter will be really helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ucsY1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ucsY1.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13086" LastEditorUserId="13086" LastEditDate="2016-08-24T04:23:10.303" LastActivityDate="2016-08-25T11:49:54.817" Title="Agenda to do list sorting" Tags="|org-mode|todo|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26510" PostTypeId="2" ParentId="26507" CreationDate="2016-08-24T03:53:37.823" Score="4" Body="&lt;p&gt;I use &lt;code&gt;quelpa&lt;/code&gt; to fake package name &lt;code&gt;org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(quelpa '(org :url &quot;git://orgmode.org/org-mode.git&quot; :fetcher git&#xA;            :files (&quot;lisp/*.el&quot; &quot;contrib/lisp/*.el&quot; &quot;doc/dir&quot; &quot;doc/*.texi&quot;) :upgrade nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this snippet, you will have &lt;code&gt;master&lt;/code&gt; branch of git repo. ELPA version comes from &lt;code&gt;maint&lt;/code&gt; branch, so you may have versions gap. Please tweak its branch with your preference.&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-08-24T03:53:37.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26511" PostTypeId="2" ParentId="26501" CreationDate="2016-08-24T04:10:46.383" Score="1" Body="&lt;p&gt;One way to do what you want is to open the shell in the window that displays the Latex file. That way, the shell opens up in the directory containing the Latex file. Then switch windows &lt;code&gt;C-x o&lt;/code&gt; and switch buffers &lt;code&gt;C-x b&lt;/code&gt; back to the Latex file. This is just a different ordering of the actions that you are currently taking.&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-08-24T04:10:46.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26512" PostTypeId="2" ParentId="26487" CreationDate="2016-08-24T04:17:19.130" Score="0" Body="&lt;p&gt;This turned out to be simpler than I expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map &quot;\C-w\C-h&quot; 'evil-window-left)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It clobbers the help key, but only in this key-map and only following a &lt;kbd&gt;C-w&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-08-24T04:17:19.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26513" PostTypeId="2" ParentId="26507" CreationDate="2016-08-24T04:54:01.830" Score="3" Body="&lt;p&gt;I have tested below to work with the in-built &lt;code&gt;package&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below snippet will prevent installation of packages (package symbol) listed in the let-bound &lt;code&gt;pkg-black-list&lt;/code&gt; variable in the below function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, after evaluating the below, doing &lt;code&gt;M-x package-install ox-asciidoc&lt;/code&gt; will not install the &lt;code&gt;org&lt;/code&gt; package. You will see the below in the &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Package ‘org’ will not be auto-installed. See ‘modi/package-dependency-check-ignore’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/package-dependency-check-ignore (orig-ret)&#xA;  &quot;Remove the `black listed packages' from ORIG-RET.&#xA;&#xA;Packages listed in the let-bound `pkg-black-list' will not be auto-installed&#xA;even if they are found as dependencies.&#xA;&#xA;It is known that this advice is not effective when installed packages&#xA;asynchronously using `paradox'. Below is effective on synchronous&#xA;package installations.&quot;&#xA;  (let ((pkg-black-list '(org))&#xA;        new-ret&#xA;        pkg-name)&#xA;    (dolist (pkg-struct orig-ret)&#xA;      (setq pkg-name (package-desc-name pkg-struct))&#xA;      (if (member pkg-name pkg-black-list)&#xA;          (message (concat &quot;Package `%s' will not be installed. &quot;&#xA;                           &quot;See `modi/package-dependency-check-ignore'.&quot;)&#xA;                   pkg-name)&#xA;        (push pkg-struct new-ret)))&#xA;    ;; It's *very* critical that the order of packages stays the same in NEW-RET&#xA;    ;; as in ORIG-RET. The `push' command flips the order, so use `reverse'&#xA;    ;; to flip the order back to the original.&#xA;    ;;   Without this step, you will get package activation errors when&#xA;    ;; installing packages with dependencies.&#xA;    (setq new-ret (reverse new-ret))&#xA;    new-ret))&#xA;(advice-add 'package-compute-transaction :filter-return #'modi/package-dependency-check-ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This will not work when installing packages asynchronously using the &lt;a href=&quot;https://github.com/Malabarba/paradox&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;paradox&lt;/code&gt;&lt;/a&gt; package. You can still use the &lt;code&gt;paradox&lt;/code&gt; package, but you would need to pick the synchronous installation option.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="115" LastEditorUserId="115" LastEditDate="2017-04-11T21:58:43.880" LastActivityDate="2017-04-11T21:58:43.880" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26514" PostTypeId="2" ParentId="26444" CreationDate="2016-08-24T05:00:47.870" Score="2" Body="&lt;p&gt;Okay, the following appears to work exactly the way I want as described above. Just put these in your .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun add-server-postfix ()&#xA;  &quot;Add the name of the connection type and server to the buffer name&quot;&#xA;  (if (string-match &quot;^/ssh:.*?:&quot; (buffer-file-name (current-buffer)))&#xA;      (rename-buffer (concat (buffer-name (current-buffer)) &quot;&amp;lt;&quot; (match-string 0 (buffer-file-name (current-buffer))) &quot;&amp;gt;&quot;)) nil))&#xA;&#xA;(add-hook 'find-file-hook 'add-server-postfix)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13064" LastActivityDate="2016-08-24T05:00:47.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26515" PostTypeId="1" AcceptedAnswerId="26533" CreationDate="2016-08-24T05:38:59.353" Score="1" ViewCount="885" Body="&lt;p&gt;When I try to close the neotree window (&lt;code&gt;SPC w d&lt;/code&gt; with spacemacs) it just says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Only one window other than neotree left. Won't close.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's true that I only have one window other than neotree but what if I want to make it fullscreen ?&lt;/p&gt;&#xA;" OwnerUserId="13055" LastActivityDate="2016-08-24T14:34:52.473" Title="Can't close Neotree window" Tags="|window|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26516" PostTypeId="1" AcceptedAnswerId="26520" CreationDate="2016-08-24T06:00:58.170" Score="2" ViewCount="1095" Body="&lt;p&gt;Is there a way to bypass a prompt (set the value to nil) in an org-capture template with helm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, template looks like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;m&quot; &quot;Meeting notes&quot; entry (file &quot;~/Dropbox/org/meetings.org&quot;)&#xA;       &quot;* %^{Meeting Time}T %^{Title} %^g \n** %i%?\n &quot; :prepend t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I leave out the title (&lt;code&gt;%^{Title}&lt;/code&gt;) or tags (&lt;code&gt;%^g&lt;/code&gt;)? I've tried an empty string, but that aborts the capture. Pressing &lt;code&gt;enter&lt;/code&gt; without any input selects the first helm completion.&lt;/p&gt;&#xA;" OwnerUserId="13028" LastActivityDate="2016-08-24T07:31:27.693" Title="Optional prompts in org-capture template using helm?" Tags="|org-mode|helm|org-capture|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26517" PostTypeId="1" CreationDate="2016-08-24T06:45:29.170" Score="0" ViewCount="92" Body="&lt;p&gt;I've keybinded &lt;code&gt;&amp;amp;é&quot;'...&lt;/code&gt; to selecting windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (global-set-key (kbd &quot;²&quot;) 'select-window-0)&#xA;  (global-set-key (kbd &quot;&amp;amp;&quot;) 'select-window-1)&#xA;  (global-set-key (kbd &quot;é&quot;) 'select-window-2)&#xA;  (global-set-key (kbd &quot;\&quot;&quot;) 'select-window-3)&#xA;  (global-set-key (kbd &quot;\'&quot;) 'select-window-4)&#xA;  (global-set-key (kbd &quot;(&quot;) 'select-window-5)&#xA;  (global-set-key (kbd &quot;-&quot;) 'select-window-6)&#xA;  (global-set-key (kbd &quot;è&quot;) 'select-window-7)&#xA;  (global-set-key (kbd &quot;_&quot;) 'select-window-8)&#xA;  (global-set-key (kbd &quot;ç&quot;) 'select-window-9)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However now everytime I need to type something in the minibuffer that contains those characters it tries to select those windows instead. How would I limit the scope of these keybinds only to the normal mode in buffers that are not the minibuffer ? Also when I'm in insert mode I would like those keybinds to just insert the characters.&lt;/p&gt;&#xA;" OwnerUserId="13055" LastEditorUserId="10" LastEditDate="2018-12-16T21:38:41.547" LastActivityDate="2018-12-16T21:38:41.547" Title="How to limit keybinds to normal mode and not to override keybinds in minibuffer?" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="26518" PostTypeId="1" CreationDate="2016-08-24T06:50:48.597" Score="2" ViewCount="980" Body="&lt;p&gt;Hi everyone I am new to Emacs and was taking help of tutorials to make emacs an IDE for languages like c/c++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started out with the youtube tutorials by b yuksel at &lt;a href=&quot;https://www.youtube.com/channel/UCibKclzsnnHjQZFOLuykZ1A&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/channel/UCibKclzsnnHjQZFOLuykZ1A&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But these tutorials are 2 years older now and many packages have changed their structure therefore it is not clear how to move forward. However I am taking help from stackoverflow but still it seems insatiable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And many packages ask for some other package to be installed first and that package have some other prerequisite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I am stuck with irony-mode for C++.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I have installed packages (in this sequence) &lt;strong&gt;auto-complete, yasnippet, auto-complete-c-headers, iedit, flymake-google-cpplint, google-c-style and semantic&lt;/strong&gt; and &lt;strong&gt;cedet&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now I wanted to install the irony-mode package with clang, so i started with downloading &lt;strong&gt;irony-mode zip&lt;/strong&gt; from github and along with it &lt;strong&gt;mjpa-SimlpeJSON&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now I have to move simpleJSON to lib folder in irony-mode directory. &lt;strong&gt;But there is no lib folder in irony-mode directory&lt;/strong&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then somehow I managed to install irony-mode but next step was to install &lt;strong&gt;doxygen&lt;/strong&gt; and when i tried it it asked for some prerequisite packages like &lt;strong&gt;flex, bison, libiconv and strip&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And to install bison i need some other packages installed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Therefore I am confused what to install and in which sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My motive is to &lt;strong&gt;improve my editing experience in emacs for c/c++&lt;/strong&gt;. And &lt;strong&gt;I being a dilettante in emacs&lt;/strong&gt; just followed the simple instructions posted by people on internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I am stuck and &lt;strong&gt;need help&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So can anyone please post an easy way to install irony-mode with clang. And if you can explain &lt;strong&gt;why each package is necessary&lt;/strong&gt; and &lt;strong&gt;what does it do&lt;/strong&gt;(significance of each package), then I will be very grateful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using ubuntu 16.04.&lt;/p&gt;&#xA;" OwnerUserId="13062" LastEditorUserId="253" LastEditDate="2016-08-24T13:24:48.940" LastActivityDate="2016-08-29T10:01:41.907" Title="Sequence of packages to be installed to make emacs an ide for c/c++" Tags="|ide|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26519" PostTypeId="2" ParentId="26517" CreationDate="2016-08-24T07:17:05.807" Score="1" Body="&lt;p&gt;I'm just assuming that you are using Evil and have edited the tags accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to globally change  key, you will need to use &lt;code&gt;define-key&lt;/code&gt; with the right keymap.  This introduces one more difficulty, the keymap must be defined when running your code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'evil&#xA;  (define-key evil-normal-state-map (kbd &quot;²&quot;) 'select-window-0)&#xA;  (define-key evil-normal-state-map (kbd &quot;&amp;amp;&quot;) 'select-window-1)&#xA;  (define-key evil-normal-state-map (kbd &quot;é&quot;) 'select-window-2)&#xA;  (define-key evil-normal-state-map (kbd &quot;\&quot;&quot;) 'select-window-3)&#xA;  (define-key evil-normal-state-map (kbd &quot;\'&quot;) 'select-window-4)&#xA;  (define-key evil-normal-state-map (kbd &quot;(&quot;) 'select-window-5)&#xA;  (define-key evil-normal-state-map (kbd &quot;-&quot;) 'select-window-6)&#xA;  (define-key evil-normal-state-map (kbd &quot;è&quot;) 'select-window-7)&#xA;  (define-key evil-normal-state-map (kbd &quot;_&quot;) 'select-window-8)&#xA;  (define-key evil-normal-state-map (kbd &quot;ç&quot;) 'select-window-9))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the absence of &lt;code&gt;with-eval-after-load&lt;/code&gt;, use &lt;code&gt;(eval-after-load 'evil '(progn ...))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-08-24T17:20:16.363" LastActivityDate="2016-08-24T17:20:16.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26520" PostTypeId="2" ParentId="26516" CreationDate="2016-08-24T07:31:27.693" Score="3" Body="&lt;p&gt;&lt;code&gt;C-ENTER&lt;/code&gt; seems to work for me when in the template substitution helm, which helm binds to &lt;code&gt;helm-cr-empty-string&lt;/code&gt; in the helm interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There's probably a better way of discovering this, but I just did it via trial and error having tried various other unsuccessful things such as &lt;code&gt;C-u ENTER&lt;/code&gt;, &lt;code&gt;M-ENTER&lt;/code&gt; and a simple &lt;code&gt;.&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2016-08-24T07:31:27.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26521" PostTypeId="2" ParentId="26439" CreationDate="2016-08-24T08:37:46.557" Score="3" Body="&lt;p&gt;Turns out I carelessly set the variable &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-export-babel-evaluate nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which according to the documentation disregards all header arguments:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Switch controlling code evaluation during export.&#xA;  When set to nil no code will be evaluated as part of the export&#xA;  process and no header argumentss will be obeyed.  When set to&#xA;  ‘inline-only’, only inline code blocks will be executed.  Users&#xA;  who wish to avoid evaluating code on export should use the header&#xA;  argument ‘:eval never-export’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After setting this to &lt;code&gt;t&lt;/code&gt; I could export as expected.&lt;/p&gt;&#xA;" OwnerUserId="427" LastActivityDate="2016-08-24T08:37:46.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26523" PostTypeId="1" CreationDate="2016-08-24T12:13:28.727" Score="1" ViewCount="81" Body="&lt;p&gt;I have a list of objects and I want the user to pick one of them (with completion). But these objects are a priori not strings, so I can't use completing-read. What should I do ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt; In the following example I want to write the interactive spec for killing a process, so I want the user to pick a process to kill. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yf/kill-process (process)&#xA;  (interactive (list (let ((list&#xA;                            (mapcar&#xA;                             (lambda (proc)&#xA;                               (cons (format &quot;%s&quot; proc) proc))&#xA;                             (process-list))))&#xA;                       (cdr&#xA;                        (assoc (ido-completing-read &quot;Process: &quot;&#xA;                                                    (mapcar #'car list))&#xA;                               list)))))&#xA;  (when (yes-or-no-p (format &quot;You are about to kill process \&quot;%s\&quot;, continue? &quot; process))&#xA;    (delete-process process)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is something I have to do often, so I'm wondering if there's a standard way to achieve this functionality (or if I should write my own... which I have done already, but it's ugly).&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="253" LastEditDate="2016-08-24T13:17:31.183" LastActivityDate="2016-08-24T20:05:29.950" Title="Request an object other than a string from the user (with completion)" Tags="|completion|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26524" PostTypeId="2" ParentId="26492" CreationDate="2016-08-24T12:19:23.283" Score="2" Body="&lt;p&gt;From the docstring of &lt;code&gt;query-replace-regexp&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Matching is independent of case if ‘case-fold-search’ is non-nil and&#xA;REGEXP has no uppercase letters.  Replacement transfers the case&#xA;pattern of the old text to the new text, if ‘case-replace’ and&#xA;‘case-fold-search’ are non-nil and REGEXP has no uppercase letters.&#xA;(Transferring the case pattern means that if the old text matched is&#xA;all caps, or capitalized, then its replacement is upcased or&#xA;capitalized.)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if you &lt;code&gt;M-x set-variable RET case-replace RET nil RET&lt;/code&gt; first, then you will get the results you want.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-08-24T12:19:23.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26525" PostTypeId="2" ParentId="26523" CreationDate="2016-08-24T13:17:08.740" Score="1" Body="&lt;p&gt;You can change your code to get the process's &lt;em&gt;name&lt;/em&gt; with&#xA;&lt;code&gt;process-name&lt;/code&gt;, so your &lt;code&gt;let&lt;/code&gt; block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((list&#xA;       (mapcar&#xA;        (lambda (proc)&#xA;          (cons (format &quot;%s&quot; proc) proc))&#xA;        (process-list))))&#xA;        ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (let ((list (mapcar #'process-name (process-list))))&#xA;    ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's no need to give &lt;code&gt;delete-process&lt;/code&gt; both the string name and&#xA;the name, because, it will work with just the string.  According to&#xA;the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Delete PROCESS: kill it and forget about it immediately.&#xA;  PROCESS may be a process, a buffer, &lt;strong&gt;the name of a process or&#xA;  buffer&lt;/strong&gt;, or nil, indicating the current buffer's process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-24T13:17:08.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26526" PostTypeId="1" CreationDate="2016-08-24T13:29:03.900" Score="3" ViewCount="1219" Body="&lt;p&gt;Emacs claims to be self explanatory, but I couldn't find a way, to search through the documentation. This leads to me searching always in google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can is search through documentation in emacs?&lt;/p&gt;&#xA;" OwnerUserId="13003" LastActivityDate="2016-08-24T20:08:00.940" Title="How can I search through builtin documentation?" Tags="|search|documentation|" AnswerCount="3" CommentCount="1" ClosedDate="2016-08-24T15:09:53.443" ContentLicense="CC BY-SA 3.0" />
  <row Id="26527" PostTypeId="2" ParentId="26523" CreationDate="2016-08-24T13:44:39.887" Score="1" Body="&lt;p&gt;Writing your own is probably your best bet, you can likely clean up your own version using a supplied function to determine what information to prompt the user with. In this case using a hash table as your collection type may be cleaner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the solution below as a generic way to prompt for objects:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun completing-read-by (fn prompt list &amp;amp;rest args)&#xA;  &quot;Apply FN to each element of LIST and prompt the user to select a resulting value.&#xA;The output of the function will be the corresponding element of LIST&#xA;&#xA;ARGS will be passed to `completing-read' after the PROMPT and COLLECTION arguments.&quot;&#xA;  (let ((hash (make-hash-table :test 'equal)))&#xA;    (mapc (lambda (elem) (puthash (funcall fn elem) elem hash)) list)&#xA;    (gethash (apply 'completing-read prompt hash args) hash)))&#xA;&#xA;&#xA;;; read process by name&#xA;(completing-read-by 'process-name &quot;Process: &quot; (process-list) nil t)&#xA;&#xA;;; read a list of structs by property&#xA;(defstruct person name age)&#xA;&#xA;(let ((people (list (make-person :name &quot;Bob&quot; :age 22) &#xA;                    (make-person :name &quot;Tom&quot; :age 33)&#xA;                    (make-person :name &quot;Jan&quot; :age 34))))&#xA;  (completing-read-by 'person-name &quot;Person: &quot; people))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-08-24T13:44:39.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26528" PostTypeId="2" ParentId="26526" CreationDate="2016-08-24T13:46:59.630" Score="1" Body="&lt;p&gt;I guess you mean the manuals? &lt;strong&gt;&lt;code&gt;C-h r&lt;/code&gt;&lt;/strong&gt; takes you to the Emacs manual. &lt;strong&gt;&lt;code&gt;C-h i&lt;/code&gt;&lt;/strong&gt; takes you (initially) to all of the installed manuals, and from there you can choose a manual to visit. The main manuals for Emacs are the Emacs (user) manual and the Elisp manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once in a manual, you can use &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt; to search for index entries, with completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once in a manual, you can also use incremental search, &lt;strong&gt;&lt;code&gt;C-s&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;C-M-s&lt;/code&gt;&lt;/strong&gt;, to search throughout the manual for literal text or a regexp match, respectively. Repeat by repeating the key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, &lt;em&gt;prefer&lt;/em&gt; &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt; to searching full-text (e.g. &lt;code&gt;C-s&lt;/code&gt;) through a manual - &lt;code&gt;i&lt;/code&gt; is your friend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because there are often plenty of occurrences of some search pattern that are not particularly relevant to what you are looking for. Index entries, on the other hand (which is what &lt;code&gt;i&lt;/code&gt; searches), have been carefully chosen by Emacs developers and other users to represent what are typically the best entry points for the term you look up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you visit a manual using &lt;code&gt;C-h r&lt;/code&gt; or &lt;code&gt;C-h i&lt;/code&gt; you are in &lt;strong&gt;Info&lt;/strong&gt;, a hypertext document reader. You can quit it using &lt;code&gt;q&lt;/code&gt;. When you enter again using &lt;code&gt;C-h i&lt;/code&gt; you re-enter where you left off, in the last manual visited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Info you can also search for a pattern across &lt;em&gt;all&lt;/em&gt; installed manuals, using &lt;strong&gt;&lt;code&gt;a&lt;/code&gt;&lt;/strong&gt; (command &lt;code&gt;info-apropos&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Outside the manuals, the &lt;em&gt;apropos commands&lt;/em&gt; are your friends. Type &lt;code&gt;C-h f apropos TAB&lt;/code&gt; to see what they are, then &lt;code&gt;C-h f&lt;/code&gt; for any of them to see more about them. In particular, there is command &lt;code&gt;apropos-documentation&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; then you have more flexible &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_A_Propos_d&amp;#39;Apropos#IciclesAproposCommands&quot; rel=&quot;nofollow&quot;&gt;apropos commands&lt;/a&gt;. See, for example, (multi-)command &lt;code&gt;icicle-doc&lt;/code&gt;, which gives you all the documentation that matches either symbol-names or doc-string input patterns, or both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Icicles you also have an &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_A_Propos_d&amp;#39;Apropos&quot; rel=&quot;nofollow&quot;&gt;incremental way of getting apropos information&lt;/a&gt; about Emacs, available as part of the normal interaction with help commands (e.g. &lt;code&gt;C-h f&lt;/code&gt;) or with &lt;code&gt;M-x&lt;/code&gt; etc.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-24T14:06:37.457" LastActivityDate="2016-08-24T14:06:37.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26529" PostTypeId="2" ParentId="26526" CreationDate="2016-08-24T13:47:51.887" Score="3" Body="&lt;p&gt;To search through documentation, you can use the command &lt;code&gt;apropos-documentation&lt;/code&gt;, which is bound to &lt;code&gt;C-h d&lt;/code&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other &lt;code&gt;apropos&lt;/code&gt; commands may be useful to you. You can use &lt;code&gt;apropos&lt;/code&gt; to search for &lt;code&gt;apropos&lt;/code&gt; functions by using &lt;code&gt;apropos-command&lt;/code&gt; (bound to &lt;code&gt;C-h a&lt;/code&gt;) and typing &lt;code&gt;apropos RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a Helm command called &lt;code&gt;helm-apropos&lt;/code&gt; that will allow you to search through several different apropos sources at once.&lt;/p&gt;&#xA;" OwnerUserId="654" LastActivityDate="2016-08-24T13:47:51.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26531" PostTypeId="2" ParentId="26523" CreationDate="2016-08-24T14:19:02.857" Score="1" Body="&lt;p&gt;The general idea is this, for prompting a user to choose an object other than a string: Use a name for the object.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Pass an alist &lt;code&gt;COLLECTION&lt;/code&gt; argument to &lt;code&gt;completing-read&lt;/code&gt; (you can alternatively use another kind of &lt;code&gt;COLLECTION&lt;/code&gt; argument - the same approach applies). The cars of the alist entries are the object names; the cdrs are the complete objects (or any parts of them).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After the user makes a choice of an object name, &lt;code&gt;completing-read&lt;/code&gt; returns it, as a string.  You can use the string to look in the alist for the associated object.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In this case, you can use &lt;code&gt;completing-read&lt;/code&gt; with the process names, and you can keep other process info associated with the names.  For example, use the name, user, and pid in a list as an alist entry:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq my-alist&#xA;      (mapcar (lambda (pid)&#xA;                 (let ((ats  (process-attributes pid)))&#xA;                  `(,(cdr (assoc 'comm ats))&#xA;                    ,(cdr (assoc 'user ats))&#xA;                    ,(number-to-string pid))))&#xA;                 (list-system-processes)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That alist lets you use the process names (commands) as completion candidates. You can then look up the associated information (the &lt;code&gt;user&lt;/code&gt; and the &lt;code&gt;pid&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((name    (completing-read &quot;Choose process: &quot; my-alist))&#xA;       (object  (assoc name my-alist))&#xA;       (user    (cadr object))&#xA;       (pid     (caddr object)))&#xA;  (message &quot;Name: %s, User: %s, PID: %s&quot; name user pid))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="9995" LastEditDate="2016-08-24T20:05:29.950" LastActivityDate="2016-08-24T20:05:29.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26532" PostTypeId="2" ParentId="26526" CreationDate="2016-08-24T14:23:00.750" Score="1" Body="&lt;p&gt;&lt;strong&gt;RECURSIVELY GREP THE BUILT-IN .INFO MANUALS USING A REGEX SEARCH&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following solution relies upon three (3) command-line utilities:  &lt;code&gt;find&lt;/code&gt;; &lt;code&gt;xargs&lt;/code&gt;; and &lt;code&gt;zgrep&lt;/code&gt;.  In putting together the following function, I discovered that &lt;code&gt;grep&lt;/code&gt; cannot see inside gizipped files, and &lt;em&gt;not all versions&lt;/em&gt; of &lt;code&gt;zgrep&lt;/code&gt; are able to search recursively.  Inasmuch as &lt;code&gt;zgrep&lt;/code&gt; can handle both gzipped and unzipped &lt;code&gt;.info&lt;/code&gt; files, the function includes a search for both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On OSX &lt;code&gt;find&lt;/code&gt;/&lt;code&gt;xargs&lt;/code&gt;/&lt;code&gt;zgrep&lt;/code&gt; come pre-installed and they are located in the &lt;code&gt;/usr/bin&lt;/code&gt; directory; and, the &lt;code&gt;car&lt;/code&gt; of &lt;code&gt;Info-default-directory-list&lt;/code&gt; contains the built-in Emacs manual consisting of several &lt;code&gt;.info&lt;/code&gt; files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With some command-line utilities, Emacs may complain about exiting abnormally with code 1.  The &lt;code&gt;zgrep&lt;/code&gt; results in this case are nevertheless complete, and running the same commands in the terminal works perfectly without any error messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just type:   &lt;code&gt;M-x ask-emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun ask-emacs ()&#xA;&quot;Grep the .info files that are in the CAR of `Info-default-directory-list'.&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (search-term (read-string &quot;Ask Emacs (regex):  &quot;))&#xA;      (search-path (directory-file-name (car Info-default-directory-list)))&#xA;      (default-directory (file-name-as-directory search-path))&#xA;      (initial-grep-command &quot;-inIE --color=always -C2&quot;)&#xA;      (grep-command (concat&#xA;        &quot;find&quot;&#xA;        &quot; &quot;&#xA;        search-path&#xA;        &quot; &quot;&#xA;        &quot;\\( -name \\*.gz -o -name \\*.info \\)&quot;&#xA;        &quot; &quot;&#xA;        &quot;-print0&quot;&#xA;        &quot; &quot;&#xA;        &quot;|&quot;&#xA;        &quot; &quot;&#xA;        &quot;xargs&quot;&#xA;        &quot; &quot;&#xA;        &quot;-0&quot;&#xA;        &quot; &quot;&#xA;        &quot;zgrep&quot;&#xA;        &quot; &quot;&#xA;        initial-grep-command&#xA;        &quot; &quot;&#xA;        search-term&#xA;        &quot; &quot;&#xA;        search-path)) )&#xA;   (compilation-start grep-command 'grep-mode (lambda (mode) &quot;*grep*&quot;) nil) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xGBJP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xGBJP.png&quot; alt=&quot;Example&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Link to related source with an example to recursively search using &lt;code&gt;zgrep&lt;/code&gt;:  &lt;a href=&quot;https://unix.stackexchange.com/a/187753/92940&quot;&gt;https://unix.stackexchange.com/a/187753/92940&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-08-24T20:08:00.940" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26533" PostTypeId="2" ParentId="26515" CreationDate="2016-08-24T14:34:52.473" Score="1" Body="&lt;p&gt;When the value for the variable &lt;code&gt;neo-dont-be-alone&lt;/code&gt; is non-nil (e.g., &lt;code&gt;t&lt;/code&gt; or some other symbol such as &lt;code&gt;'foo&lt;/code&gt;), the function &lt;code&gt;delete-window&lt;/code&gt; (which has been &lt;code&gt;advice&lt;/code&gt; by the &lt;code&gt;neotree&lt;/code&gt; library) has check to see whether the &lt;code&gt;neotree&lt;/code&gt; window would be the only remaining window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default value for &lt;code&gt;neo-dont-be-alone&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, so the original poster has changed it somewhere along the way.  To restore the default value, either evaluate &lt;code&gt;(setq neo-dont-be-alone nil)&lt;/code&gt; or find the modification of default behavior within the user-configuration files and remove it (or comment it out).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a link to line 781 of &lt;code&gt;neotree.el&lt;/code&gt; in the Github repository in the event anyone is interested in seeing the &lt;code&gt;advice&lt;/code&gt; of &lt;code&gt;delete-window&lt;/code&gt;:  &lt;a href=&quot;https://github.com/jaypei/emacs-neotree/blob/dev/neotree.el#L781&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jaypei/emacs-neotree/blob/dev/neotree.el#L781&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-08-24T14:34:52.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26534" PostTypeId="1" AcceptedAnswerId="26536" CreationDate="2016-08-24T14:48:59.317" Score="1" ViewCount="210" Body="&lt;p&gt;If I have a list of books' call numbers in Dewey Decimal in a buffer, is this something I could sort with Emacs regex -- or is this an elisp task? For example, &lt;code&gt;261.1 C87&lt;/code&gt; comes before &lt;code&gt;261.104 Z99&lt;/code&gt; because the first one can be understood as &lt;code&gt;261.100 C87&lt;/code&gt;. So each column/place must be compared. And then of course the alphabet parts, which means &lt;code&gt;261.1 C87&lt;/code&gt; comes before &lt;code&gt;261.1 Ch2&lt;/code&gt;. I'm just wondering if there are any Emacs regex experts who would see a good way. Otherwise, I'll just do elisp on it.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-08-24T14:52:14.773" LastActivityDate="2016-08-24T15:03:08.920" Title="Sort Dewey Decimal list?" Tags="|regular-expressions|sorting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26536" PostTypeId="2" ParentId="26534" CreationDate="2016-08-24T14:56:02.360" Score="2" Body="&lt;p&gt;Use command &lt;strong&gt;&lt;code&gt;sort-numeric-fields&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f sort-numeric-fields&lt;/code&gt; tells you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;sort-numeric-fields is an interactive autoloaded Lisp function in&#xA;      &lt;code&gt;sort.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to menu-bar edit sort sort-numeric-fields.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(sort-numeric-fields FIELD BEG END)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Sort lines in region numerically by the ARGth field of each line.&#xA;      Fields are separated by whitespace and numbered from 1 up.&#xA;      Specified field must contain a number in each line of the region,&#xA;      which may begin with &quot;0x&quot; or &quot;0&quot; for hexadecimal and octal values.&#xA;      Otherwise, the number is interpreted according to sort-numeric-base.&#xA;      With a negative arg, sorts by the ARGth field counted from the right.&#xA;      Called from a program, there are three arguments:&#xA;      FIELD, BEG and END.  BEG and END specify region to sort.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See also the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Sorting.html&quot; rel=&quot;nofollow&quot;&gt;Sorting&lt;/a&gt;.  There you see, in addition to a general explanation of sorting and descriptions of other sorting commands:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x sort-fields&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Divide the region into lines, and sort by comparing the contents of&#xA;           one field in each line.  Fields are defined as separated by&#xA;           whitespace, so the first run of consecutive non-whitespace&#xA;           characters in a line constitutes field 1, the second such run&#xA;           constitutes field 2, etc.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Specify which field to sort by with a numeric argument: 1 to sort&#xA;           by field 1, etc.  A negative argument means count fields from the&#xA;           right instead of from the left; thus, minus 1 means sort by the&#xA;           last field.  If several lines have identical contents in the field&#xA;           being sorted, they keep the same relative order that they had in&#xA;           the original buffer.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x sort-numeric-fields&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Like &lt;code&gt;M-x sort-fields&lt;/code&gt; except the specified field is converted to&#xA;           an integer for each line, and the numbers are compared.  &lt;code&gt;10&lt;/code&gt; comes&#xA;           before &lt;code&gt;2&lt;/code&gt; when considered as text, but after it when considered as&#xA;           a number.  By default, numbers are interpreted according to&#xA;           &lt;code&gt;sort-numeric-base&lt;/code&gt;, but numbers beginning with &lt;code&gt;0x&lt;/code&gt; or &lt;code&gt;0&lt;/code&gt; are&#xA;           interpreted as hexadecimal and octal, respectively.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-24T15:03:08.920" LastActivityDate="2016-08-24T15:03:08.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26537" PostTypeId="1" CreationDate="2016-08-24T14:57:14.027" Score="5" ViewCount="401" Body="&lt;p&gt;I use org-mode to manage my notes and TODOs. At work, we use Jira to track bugs and development stories and I'd like to make this a bit easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to make all DEV-[0-9]+, BUG-[0-9]+ and some other terms behave like a normal URL, so that they are clickable (no need to make a explicit org-mode link) and that they open a URL with the matched term appended to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So DEV-1234 should be recognized as a link, and when I click on it Emacs should open the URL &lt;a href=&quot;http://jira/browse/DEV-1234&quot; rel=&quot;noreferrer&quot;&gt;http://jira/browse/DEV-1234&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If possible, I'd like to have other terms with other endpoints as well.&lt;/p&gt;&#xA;" OwnerUserId="9621" LastActivityDate="2022-12-28T07:01:11.027" Title="Make some regexps clickable (like URLs) and have them open URL" Tags="|org-mode|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26538" PostTypeId="1" CreationDate="2016-08-24T16:30:48.527" Score="1" ViewCount="421" Body="&lt;p&gt;I'm using Spacemacs, in term mode and on a mac. While I can adjust the standard font size I am often moving from/to a different monitor, and I want to be able to tweak the font size for the moment. Is there an easier way than changing the font size in my config file?&lt;/p&gt;&#xA;" OwnerUserId="12870" LastEditorUserId="253" LastEditDate="2016-08-24T16:55:48.120" LastActivityDate="2016-09-23T17:45:11.853" Title="Temporarily adjust font size?" Tags="|fonts|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26539" PostTypeId="1" CreationDate="2016-08-24T16:35:25.023" Score="1" ViewCount="1023" Body="&lt;p&gt;I am trying to get &lt;code&gt;org-mode&lt;/code&gt; to insert a custom timestamp with the current time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something along these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;20160824 34|3 163000 (UTC)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which I believe should be the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;%Y%m%d %W|%u %H%M%S (%Z)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, after editing &lt;code&gt;org-time-stamp-custom-formats&lt;/code&gt; using the &lt;code&gt;Customize Browser&lt;/code&gt;, I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Y0824 34|3 000000 (UTC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Issues:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Year does not display.&lt;/li&gt;&#xA;&lt;li&gt;Current time is not displayed.&lt;/li&gt;&#xA;&lt;li&gt;End parenthesis does not display.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have read through the &lt;code&gt;org-mode&lt;/code&gt; manual and searched online, but am still very lost.&lt;/p&gt;&#xA;" OwnerUserId="13087" LastEditorUserId="12616" LastEditDate="2016-08-24T19:07:40.893" LastActivityDate="2016-08-24T19:07:40.893" Title="Insert Current Date and Time with Custom Timestamp" Tags="|org-mode|customize|time-date|customization|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26540" PostTypeId="1" CreationDate="2016-08-24T16:43:24.393" Score="2" ViewCount="88" Body="&lt;p&gt;I'm on some mailing lists and there is a top-post culture. It's difficult for me to visually delineate the reply from the original content. Is there facility for coloring (perhaps in alternating colors) the nested replies in the email body?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: It looks like the issue is that the mailing list doesn't insert &lt;code&gt;&amp;gt;&lt;/code&gt; characters in the replied-to text.&lt;/p&gt;&#xA;" OwnerUserId="8777" LastEditorUserId="8777" LastEditDate="2016-08-24T17:00:23.207" LastActivityDate="2016-08-24T17:00:23.207" Title="Is there a way to color replies in the email body on mu4e?" Tags="|colors|email|mu4e|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26541" PostTypeId="2" ParentId="26538" CreationDate="2016-08-24T16:52:24.743" Score="1" Body="&lt;p&gt;On a mac it is &lt;code&gt;CMD +/-&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To learn more about this, &lt;code&gt;ctrl h f&lt;/code&gt; lets you learn about functions and their bindings. In this case &lt;code&gt;text-scale-adjust&lt;/code&gt;, as described in other answers and blog posts. The docs say it is bound to &lt;code&gt;C-+&lt;/code&gt;, but in this case, &lt;code&gt;C&lt;/code&gt;is actually the command key, not the control key.&lt;/p&gt;&#xA;" OwnerUserId="12870" LastActivityDate="2016-08-24T16:52:24.743" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26543" PostTypeId="1" AcceptedAnswerId="26584" CreationDate="2016-08-24T17:35:25.660" Score="2" ViewCount="427" Body="&lt;p&gt;When I'm programming Python, I will use rope to rename variables (using ropemacs). &lt;code&gt;rope-rename&lt;/code&gt; pops up a dialogue after you provide a new variable name, where you can preview the change, cancel, or perform the refactoring. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Choose what to do: [perform]  {perform | preview | cancel}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;perform&quot; is always the default option. 90% of the time, I don't want to go through this menu, I just want to to select the default option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to advise a command to automatically choose a specific (or the default) dialogue option so I can skip this menu? Is there maybe a package that allows me to specify automatic selections in dialogues matching certain conditions?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2016-08-24T17:40:04.303" LastActivityDate="2018-02-07T01:23:52.343" Title="How to automatically select an option in a specific prompt?" Tags="|advice|prompt|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26544" PostTypeId="1" CreationDate="2016-08-24T17:51:40.340" Score="1" ViewCount="110" Body="&lt;p&gt;I am trying to match &lt;code&gt;$$&lt;/code&gt; resp &lt;code&gt;$&lt;/code&gt; pairs to switch into latex-mode via &lt;code&gt;polymode&lt;/code&gt; in a markdown file. &lt;code&gt;$$&lt;/code&gt; is the delimiter for displayed math in this case and &lt;code&gt;$&lt;/code&gt; for inline math. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that this is not a good choice for delimiters because they are symmetric. However latex-mode itself i.e. when editing an usual latex-document just recognizes those pairs very well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there any good regular expression I can use in my code below instead of just looking for &lt;code&gt;$$&lt;/code&gt; resp. &lt;code&gt;$&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'polymode)&#xA;&#xA;(defcustom pm-host/markd&#xA;  (pm-bchunkmode &quot;Markd&quot;&#xA;                 :mode 'markdown-mode)&#xA;  &quot;Markdown host chunkmode&quot;&#xA;  :group 'hostmodes&#xA;  :type 'object)&#xA;&#xA;&#xA;(defcustom pm-inner/latex&#xA;  (pm-hbtchunkmode &quot;latex&quot;&#xA;           :mode 'latex-mode&#xA;           :head-reg  &quot;\\$\\$\\|\\$&quot;&#xA;           :tail-reg  &quot;\\$\\$\\|\\$&quot;)&#xA;  &quot;latex typical chunk.&quot;&#xA;  :group 'innermodes&#xA;  :type 'object)&#xA;&#xA;(defcustom pm-poly/markdown-latex&#xA;  (pm-polymode-one &quot;markdown-latex&quot;&#xA;           :hostmode 'pm-host/markd&#xA;           :innermode 'pm-inner/latex)&#xA;  &quot;markdown-python typical polymode.&quot;&#xA;  :group 'polymodes&#xA;  :type 'object)&#xA;&#xA;(define-polymode poly-markdown+latex-mode pm-poly/markdown-latex)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.mdwn\\'&quot; . poly-markdown+latex-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-08-24T19:07:18.437" LastActivityDate="2016-08-24T19:07:18.437" Title="Good way to match symmetric delimiters" Tags="|auctex|regular-expressions|polymode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26545" PostTypeId="1" AcceptedAnswerId="26606" CreationDate="2016-08-24T19:21:06.693" Score="10" ViewCount="656" Body="&lt;p&gt;I am developing a library and would like to reload it after editing without exiting Emacs (assume that it is on &lt;code&gt;load-path&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-library &quot;myname&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I do this, Emacs doesn't pick up changes to &lt;code&gt;defvar&lt;/code&gt;-bound variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to call &lt;code&gt;eval-defun&lt;/code&gt; (&lt;kbd&gt;C-M-x&lt;/kbd&gt;) manually on each top level form.  Does &lt;code&gt;M-x eval-buffer&lt;/code&gt; respect &lt;code&gt;defvar&lt;/code&gt;/&lt;code&gt;defcustom&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-08-25T20:38:53.590" LastActivityDate="2016-08-26T13:06:58.713" Title="Can I reload a library and have defvar re-assign values?" Tags="|variables|defvar|" AnswerCount="4" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26546" PostTypeId="2" ParentId="26495" CreationDate="2016-08-24T20:06:20.723" Score="0" Body="&lt;p&gt;Perhaps this link is a better answer to your question.  The original system was a DEC PDP-10.  Not sure if the SpaceCadet keyboard was custom or DEC-supplied, but it appears to be a big influence in much Emacs keyboard lore, such as Meta, Super, Hyper, and Alt keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.catb.org/jargon/html/S/space-cadet-keyboard.html&quot; rel=&quot;nofollow&quot;&gt;SpaceCadetKeyboard&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10291" LastActivityDate="2016-08-24T20:06:20.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26547" PostTypeId="2" ParentId="26545" CreationDate="2016-08-24T20:24:48.700" Score="3" Body="&lt;p&gt;&lt;code&gt;defvar&lt;/code&gt; does not reassign a variable's value in the same way as, say&#xA;&lt;code&gt;setq&lt;/code&gt; or &lt;code&gt;setf&lt;/code&gt;.  Once a variable has a value, &lt;code&gt;defvar&lt;/code&gt;&#xA;won't touch it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;defvar&lt;/code&gt;'s docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(defvar SYMBOL &amp;amp;optional INITVALUE DOCSTRING)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Define SYMBOL as a variable, and return SYMBOL.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;em&gt;The optional argument INITVALUE is evaluated, and used to set&#xA;  SYMBOL, &lt;strong&gt;only if SYMBOL's value is void.&lt;/em&gt;&lt;/strong&gt; If SYMBOL is&#xA;  buffer-local, its default value is what is set; buffer-local&#xA;  values are not affected.  If INITVALUE is missing, SYMBOL's&#xA;  value is not set.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since you presumably &lt;code&gt;defvar&lt;/code&gt;ed the variables in question to give them values when you first loaded the library, re-loading the library won't change the values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the elisp manual node on&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Defining Global Variables&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of relying on &lt;code&gt;defvar&lt;/code&gt;, you can always re-assign values with &lt;code&gt;setq&lt;/code&gt;.  As an alternative, clunky option, you can &lt;code&gt;unintern&lt;/code&gt; the symbols so that the &lt;code&gt;defvar&lt;/code&gt;s will not find them upon reloading:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test-1 &quot;test this&quot;)&#xA;(defvar test-2 &quot;test this one, too&quot;)&#xA;&#xA;test-1                                  ; =&amp;gt; &quot;test this&quot;&#xA;test-2                                  ; =&amp;gt; &quot;test this one, too&quot;&#xA;&#xA;(defvar test-1 &quot;trying to redefine&quot;)&#xA;(defvar test-2 &quot;trying to redefine, too&quot;)&#xA;&#xA;test-1                                  ; =&amp;gt; &quot;test this&quot;&#xA;test-2                                  ; =&amp;gt; &quot;test this one, too&quot;&#xA;&#xA;(mapc #'unintern '(test-1 test-2))&#xA;&#xA;test-1                                  ; =&amp;gt; error!&#xA;test-2                                  ; =&amp;gt; error!&#xA;&#xA;(defvar test-1 &quot;trying to redefine&quot;)&#xA;(defvar test-2 &quot;trying to redefine, too&quot;)&#xA;&#xA;test-1                                  ; =&amp;gt; &quot;trying to redefine&quot;&#xA;test-2                                  ; =&amp;gt; &quot;trying to redefine, too&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-08-24T20:53:11.640" LastActivityDate="2016-08-24T20:53:11.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26549" PostTypeId="2" ParentId="26545" CreationDate="2016-08-24T21:05:23.957" Score="2" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  &quot;(Re-)evaluate all `defvar's in the buffer (or its restriction).&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (not (eobp))&#xA;      (when (re-search-forward &quot;\\s-*(defvar \\([^ \t\n(\&quot;]+\\)[ \t\n]+[^)]&quot; nil 'MOVE)&#xA;        (let ((old-value (make-symbol &quot;t&quot;))&#xA;              new-value value)&#xA;          (let ((debug-on-error old-value))&#xA;            (setq value (eval-defun-2))&#xA;            (setq new-value debug-on-error))&#xA;          (unless (eq old-value new-value)&#xA;            (setq debug-on-error new-value))&#xA;          value)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That just uses the same code that &lt;code&gt;eval-defun&lt;/code&gt; uses on a &lt;code&gt;defvar&lt;/code&gt;.  It traverses the buffer (or its restriction by narrowing), stopping at each &lt;code&gt;defvar&lt;/code&gt; and using the &lt;code&gt;eval-defun&lt;/code&gt; code on it.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-24T21:05:23.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26550" PostTypeId="2" ParentId="26537" CreationDate="2016-08-24T21:20:39.540" Score="3" Body="&lt;p&gt;One straightforward way is to&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;write a function inserting the desired buttons and then&lt;/li&gt;&#xA;&lt;li&gt;hook it up with font-lock.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar jira-link-url &quot;http://jira/browse/%s&quot;)&#xA;&#xA;(defun jira-link-insert-buttons (beg end)&#xA;  (remove-overlays beg end 'type 'jira-link)&#xA;  (save-excursion&#xA;    (goto-char beg)&#xA;    (while (re-search-forward &quot;\\_&amp;lt;\\(DEV\\|BUG\\)-[0-9]+\\_&amp;gt;&quot; end t)&#xA;      (make-button (match-beginning 0)&#xA;                   (match-end 0)&#xA;                   'type 'jira-link&#xA;                   'action (lambda (button)&#xA;                             (browse-url (format jira-link-url (button-get button 'text))))&#xA;                   'follow-link t&#xA;                   'text (match-string 0)))))&#xA;&#xA;(define-minor-mode jira-link-mode nil nil nil nil&#xA;  (cond&#xA;   (jira-link-mode&#xA;    (jit-lock-register #'jira-link-insert-buttons)&#xA;    (jira-link-insert-buttons (point-min) (point-max)))&#xA;   (t&#xA;    (jit-lock-unregister #'jira-link-insert-buttons)&#xA;    (remove-overlays (point-min) (point-max) 'type 'jira-link))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-08-24T21:20:39.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26551" PostTypeId="1" AcceptedAnswerId="26552" CreationDate="2016-08-24T23:42:39.887" Score="7" ViewCount="1691" Body="&lt;p&gt;Is there any way to insert text into a buffer that &lt;em&gt;isn't&lt;/em&gt; the active buffer with Elisp? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps there is an equivalent to &lt;code&gt;with-temp-buffer&lt;/code&gt; that takes a specific, existing buffer as an argument?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2016-08-24T23:53:04.833" LastActivityDate="2016-08-24T23:54:24.477" Title="Insert into specific buffer (not the active buffer)?" Tags="|buffers|insert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26552" PostTypeId="2" ParentId="26551" CreationDate="2016-08-24T23:54:24.477" Score="14" Body="&lt;p&gt;Perhaps something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;*scratch*&quot; (insert &quot;Test&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is what you want.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-24T23:54:24.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26553" PostTypeId="2" ParentId="26537" CreationDate="2016-08-25T00:06:56.007" Score="2" Body="&lt;p&gt;Another approach is the button-lock package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'button-lock)&#xA;(global-button-lock-mode)&#xA;&#xA;(button-lock-set-button&#xA; &quot;DEV-[0-9]+&quot;&#xA; (lambda ()&#xA;   (interactive)&#xA;   (browse-url (concat &quot;http://jira/browse/&quot;&#xA;               (buffer-substring&#xA;            (previous-single-property-change (point) 'mouse-face)&#xA;            (next-single-property-change (point) 'mouse-face)))))&#xA; :face (list 'org-link))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-25T00:06:56.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26554" PostTypeId="1" AcceptedAnswerId="26556" CreationDate="2016-08-25T02:25:41.043" Score="2" ViewCount="342" Body="&lt;p&gt;Is it possible to use advice to not only run your function first, but also prevent the advised function from running at all?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say a command ordinarily calls &lt;code&gt;read-from-minibuffer&lt;/code&gt; to get a return value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-name ()&#xA;  (read-from-minibuffer &quot;Enter your name: &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say, in this example, my name never canges. Entering it manually is time-consuming. Can I use the advice system to intercept the call to read-from-minibuffer and return my own value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun return-my-name (&amp;amp;rest args)&#xA;  &quot;Jack&quot;)&#xA;&#xA;(defun quick-get-name ()&#xA;  ;; Add the intercepting advice, call the function, then remove the advice.&#xA;  (advice-add 'read-from-minibuffer :intercept 'return-my-name)&#xA;  (get-name)&#xA;  (advice-remove 'read-from-minibuffer 'return-my-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The key behaviour I need is to be able to fall back on the original function depending on the input. For example, I might want to intercept the command if the prompt is asking for a name, but not if it is asking for some other information, like age: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun return-my-name (prompt &amp;amp;rest args)&#xA;  (if (eq prompt &quot;Enter your name: &quot;)&#xA;      &quot;Jack&quot;&#xA;    (read-from-minibuffer prompt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyone know if the advice system is capable of this? Can it be done some other way, for example using aliases?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-08-25T04:37:51.457" Title="Can you intercept a function and return your own value using advice?" Tags="|advice|aliases|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26555" PostTypeId="1" CreationDate="2016-08-25T04:13:21.423" Score="2" ViewCount="593" Body="&lt;p&gt;Tramp has been hanging on 'Sending password' for me whenever I try to use it. This includes the simplest test case of C-x C-f /sudo::/etc/hosts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some trial-and-error with my .emacs, it looks like the problem occurs if and only if ESS is active. Unfortunately, I haven't been able to figure out anything more than that. Debug log output from trying to do /sudo::/etc/hosts is below; any help would be greatly appreciated!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; GNU Emacs: 25.1.1 Tramp: 2.2.13.25.1 -*- mode: outline; -*-&#xA;00:03:58.670758 tramp-maybe-open-connection (3) # Opening connection for root@rguha-mbp.hbs.edu using sudo...&#xA;00:03:58.690581 tramp-maybe-open-connection (6) # /bin/sh -i&#xA;00:03:58.694982 tramp-wait-for-regexp (6) # &#xA;#$ &#xA;00:03:58.719429 tramp-maybe-open-connection (3) # Sending command ‘exec env SHELL=/bin/sh sudo -u root -s -H -p P&quot;&quot;a&quot;&quot;s&quot;&quot;s&quot;&quot;w&quot;&quot;o&quot;&quot;r&quot;&quot;d&quot;&quot;:’&#xA;00:03:58.719589 tramp-send-command (6) # exec env SHELL=/bin/sh sudo -u root -s -H -p P&quot;&quot;a&quot;&quot;s&quot;&quot;s&quot;&quot;w&quot;&quot;o&quot;&quot;r&quot;&quot;d&quot;&quot;:&#xA;00:03:58.720503 tramp-process-actions (3) # Waiting for prompts from remote shell...&#xA;00:03:58.751461 tramp-process-one-action (5) # Looking for regexp &quot;\(.*\(user\|login\)\( .*\)?: *\)\'&quot; from remote shell&#xA;00:03:58.751579 tramp-process-one-action (5) # Looking for regexp &quot;\(^.*\(\(?:adgangskode\|contrase\(?:\(?:ny\|ñ\)a\)\|geslo\|h\(?:\(?:asł\|esl\)o\)\|iphasiwedi\|jelszó\|l\(?:ozinka\|ösenord\)\|m\(?:ot de passe\|ật khẩu\)\|pa\(?:rola\|s\(?:ahitza\|s\(?: phrase\|code\|ord\|phrase\|wor[dt]\)\|vorto\)\)\|s\(?:alasana\|enha\|laptažodis\)\|wachtwoord\|лозинка\|пароль\|ססמה\|كلمة السر\|गुप्तशब्द\|शब्दकूट\|গুপ্তশব্দ\|পাসওয়ার্ড\|ਪਾਸਵਰਡ\|પાસવર્ડ\|ପ୍ରବେଶ ସଙ୍କେତ\|கடவுச்சொல்\|సంకేతపదము\|ಗುಪ್ತಪದ\|അടയാളവാക്ക്\|රහස්පදය\|ពាក្យសម្ងាត់\|パスワード\|密[码碼]\|암호\)\).*:? *\)\'&quot; from remote shell&#xA;00:03:58.751693 tramp-process-one-action (5) # Call ‘tramp-action-password’&#xA;00:03:58.752167 tramp-action-password (3) # Sending Password&#xA;00:03:58.753291 tramp-send-command (6) # test -e /DESCRIPTION 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;00:04:01.674447 tramp-file-name-handler (1) # Interrupt received in operation (file-exists-p /sudo:root@rguha-mbp.hbs.edu:/DESCRIPTION)&#xA;&#xA;Sorry, try again.&#xA;Password:&#xA;00:04:01.675658 tramp-process-actions (3) # Waiting for prompts from remote shell...failed&#xA;00:04:01.676257 tramp-maybe-open-connection (3) # Opening connection for root@rguha-mbp.hbs.edu using sudo...failed&#xA;00:04:01.704867 tramp-process-sentinel (5) # Sentinel called: ‘#&amp;lt;process *tramp/sudo root@rguha-mbp.hbs.edu*&amp;gt;’ ‘killed: 9&#xA;’&#xA;00:04:01.712764 tramp-file-name-handler (1) # Interrupt received in operation (file-exists-p /sudo:root@rguha-mbp.hbs.edu:/etc/hosts)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13102" LastActivityDate="2017-04-26T09:30:46.890" Title="Tramp hangs on 'Sending password' whenever ESS is active" Tags="|tramp|ess|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26556" PostTypeId="2" ParentId="26554" CreationDate="2016-08-25T04:37:51.457" Score="6" Body="&lt;p&gt;Of course you can.  You can do it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'read-from-minibuffer :around #'return-my-name)&#xA;(defun return-my-name (orig-fun &amp;amp;rest args)&#xA;  (let ((orig-val (apply orig-fun args)))&#xA;    &amp;lt;return-the-new-value&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you can do it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'read-from-minibuffer :filter-return #'return-my-name)&#xA;(defun return-my-name (orig-val)&#xA;  &amp;lt;return-the-new-value&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;depending on how much control you want to have.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-25T04:37:51.457" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26557" PostTypeId="2" ParentId="26518" CreationDate="2016-08-25T07:14:21.123" Score="1" Body="&lt;p&gt;Here is the easy solution for newbies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works at Linux/OSX/Cygwin (should work at Windows, but I don't develop at Windows).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The setup is minimum. You need install &lt;code&gt;GNU Global&lt;/code&gt; and two Emacs plugins:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;company&lt;/code&gt; for code completion (&lt;a href=&quot;https://github.com/company-mode/company-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/company-mode/company-mode&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;emacs-helm-gtags&lt;/code&gt; for code navigation (&lt;a href=&quot;https://github.com/syohex/emacs-helm-gtags&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syohex/emacs-helm-gtags&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Steps：&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;suppose you have two C++ projects, &lt;code&gt;~/proj1&lt;/code&gt;, &lt;code&gt;~/proj2&lt;/code&gt;, and has a read-only 3rd party library diretory &lt;code&gt;/usr/include&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;create a directory to store index files of third party library &lt;code&gt;~/obj&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;run command &lt;code&gt;cd /usr/include &amp;amp;&amp;amp; MAKEOBJDIRPREFIX=~/obj gtags -O &amp;amp;&amp;amp; cd ~/proj1 &amp;amp;&amp;amp; gtags &amp;amp;&amp;amp; cd ~/proj2 &amp;amp;&amp;amp; gtags&lt;/code&gt; in shell to create code index file used by GNU Global&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;insert below code into your ~/.emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setenv &quot;GTAGSLIBPATH&quot; (concat &quot;/usr/include&quot;&#xA;                               &quot;:&quot;&#xA;                               (file-truename &quot;~/proj2&quot;)&#xA;                               &quot;:&quot;&#xA;                               (file-truename &quot;~/proj1&quot;)))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setenv &quot;MAKEOBJDIRPREFIX&quot; (file-truename &quot;~/obj/&quot;))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setq company-backends '((company-dabbrev-code company-gtags)))&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Done.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Extra tips:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Minimum setup copied from &lt;code&gt;company&lt;/code&gt; and &lt;code&gt;emacs-helm-gtags&lt;/code&gt; github page is enough&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Please note in ~/.emacs, I use &lt;code&gt;file-truename&lt;/code&gt; to make sure all paths are real absolute path&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I just fixed a &lt;code&gt;global&lt;/code&gt; issue of &lt;code&gt;company&lt;/code&gt; yesterday (24 August, 2016). So you need use the &lt;code&gt;company&lt;/code&gt; built today (25 August, 2016).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-08-29T10:01:41.907" LastActivityDate="2016-08-29T10:01:41.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26558" PostTypeId="1" CreationDate="2016-08-25T07:50:06.037" Score="2" ViewCount="409" Body="&lt;p&gt;I have some emoji icons inserted in my shell terminal, which i am trying to copy and paste it into emacs&#xA;&lt;a href=&quot;https://i.stack.imgur.com/8H2Ei.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8H2Ei.png&quot; alt=&quot;emoji-shell&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i copy the above text and paste it into my emacs window, it shows blank space in the place of emojis like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo I am not very happy  ;;&amp;lt;-- an extra space is visible at the line end instead of an angry face icon.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use Mac OS El Capitan.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2016-08-25T07:50:06.037" Title="Emoji icons pasted in emacs are shown as blank spaces" Tags="|fonts|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26559" PostTypeId="1" CreationDate="2016-08-25T08:19:21.913" Score="2" ViewCount="5241" Body="&lt;p&gt;How do I play Tetris inside Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done this a long time ago but I can't remember the commands.&lt;/p&gt;&#xA;" OwnerUserId="13071" LastActivityDate="2016-08-25T09:05:30.473" Title="How do I play Tetris in Emacs?" Tags="|games|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26560" PostTypeId="1" AcceptedAnswerId="26567" CreationDate="2016-08-25T08:46:30.797" Score="2" ViewCount="757" Body="&lt;p&gt;I have to connect to remote computers through ssh. I'm using tramp (&lt;code&gt;C-x d /sshx:user@myhost|su:myhost:/mydirectory&lt;/code&gt;) and I can sudo as root on directories in this machine. As it is very convenient, I would like to bookmark the location. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After giving a name to the bookmark, I can see that my latest bookmark looks like &lt;code&gt;'my newbookmark    /su:root@myhost:/mydirectory'&lt;/code&gt;, therefore forgetting the first half of the location. And when I try to comeback to it (after closing emacs for example), I have a message &lt;code&gt;&quot;Host 'myhost' looks like a remote host, 'su' can only use the local host&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would it be possible to bookmark the whole location?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="424" LastActivityDate="2016-08-25T10:20:12.773" Title="Bookmarking remote directories (tramp+sudo)" Tags="|tramp|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26561" PostTypeId="2" ParentId="26559" CreationDate="2016-08-25T08:48:30.547" Score="5" Body="&lt;p&gt;You can do this by typing &lt;code&gt;M-x tetris&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2016-08-25T08:48:30.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26562" PostTypeId="2" ParentId="26559" CreationDate="2016-08-25T09:05:30.473" Score="1" Body="&lt;p&gt;You can find it on the menu bar (&lt;code&gt;Tools -&amp;gt; Games -&amp;gt; Tetris&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-08-25T09:05:30.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26563" PostTypeId="1" CreationDate="2016-08-25T09:10:39.800" Score="0" ViewCount="491" Body="&lt;p&gt;I found myself over and over again looking at some Japanese texts (mostly in Emacs) and thinking that it would be nice to have some simple functionality to transcribe regular text with kanji characters into hiragana (I'm still a beginner and know only a handful of kanjis, so this would allow me to read Japanese texts without poring over a dictionary). So how can this be done in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="5198" LastEditorUserId="105" LastEditDate="2016-08-25T13:55:40.343" LastActivityDate="2016-08-25T13:55:40.343" Title="Transcribing Japanese text in Emacs" Tags="|japanese|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26564" PostTypeId="2" ParentId="26563" CreationDate="2016-08-25T09:10:39.800" Score="1" Body="&lt;p&gt;I've written before about &lt;a href=&quot;https://emacs.stackexchange.com/questions/7407/how-to-learn-the-stroke-order-of-a-kanji-or-kana-character-using-emacs&quot;&gt;my Emacs mode for kanji&lt;/a&gt; that allows you to point at a character and retrieve its stroke order. I've put in some more work and created wrappers around the excellent &lt;a href=&quot;http://kakasi.namazu.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kakasi&lt;/a&gt; utility for transcribing Japanese text.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;How To Use It?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Once you have &lt;code&gt;kanji-mode&lt;/code&gt; installed (it can be installed from MELPA), you can enable it in a buffer by running &lt;kbd&gt;M-x kanji-mode&lt;/kbd&gt;. It then provides you with two new key bindings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-s M-h&lt;/kbd&gt; (or &lt;kbd&gt;M-x kanji-mode-kanji-to-hiragana&lt;/kbd&gt;) - for transcribing kanji to hiragana&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-s M-r&lt;/kbd&gt; (or &lt;kbd&gt;M-x kanji-mode-all-to-romaji&lt;/kbd&gt;) - for transcribing Japanese script to romaji&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Additionally, both these functions have three modes of operation, depending on the prefix arguments provided:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;No prefix - display results in the minibuffer&lt;/li&gt;&#xA;&lt;li&gt;Prefix &lt;code&gt;-1&lt;/code&gt; (&lt;kbd&gt;M--&lt;/kbd&gt;) - put results in the kill-ring&lt;/li&gt;&#xA;&lt;li&gt;Any other prefix - display results in a separate buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I hope Emacs fanatics who happen to be Japanese learners will find this addition helpful.&lt;/p&gt;&#xA;" OwnerUserId="5198" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-08-25T09:10:39.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26565" PostTypeId="1" AcceptedAnswerId="26745" CreationDate="2016-08-25T09:42:06.143" Score="8" ViewCount="2740" Body="&lt;p&gt;It turned out not to be the same problem as &lt;a href=&quot;https://emacs.stackexchange.com/q/14509/13091&quot;&gt;Kill process buffer without confirmation?&lt;/a&gt;: emacs asks for different kind of confirmations when exiting and when just killing a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to specify for all or specific processes (e.g. one launched with &lt;code&gt;run-scheme&lt;/code&gt;) to be killed without confirmation on exiting emacs?&lt;/p&gt;&#xA;" OwnerUserId="13091" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2023-04-14T17:47:17.493" Title="Exiting emacs without confirmation to kill running processes" Tags="|process|exit|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26566" PostTypeId="2" ParentId="26461" CreationDate="2016-08-25T10:17:07.957" Score="2" Body="&lt;p&gt;This was a bug in AUCTeX, this should have been fixed with &lt;a href=&quot;http://git.savannah.gnu.org/gitweb/?p=auctex.git;a=commitdiff;h=e4b2e6a76965156257a19bd65f9bc76dfb743b6e&quot; rel=&quot;nofollow&quot;&gt;this commit&lt;/a&gt;.  This change will go live in the next ELPA release or next stable version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, note that starting from version 11.88 of the package, it's available a nicely formatted list of errors and warnings that can be accessed with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;TeX-error-overview&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, or from the menu &lt;code&gt;Command&lt;/code&gt; → &lt;code&gt;Error Overview&lt;/code&gt;.  You can navigate between errors with &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastEditorUserId="620" LastEditDate="2016-08-25T17:01:12.423" LastActivityDate="2016-08-25T17:01:12.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26567" PostTypeId="2" ParentId="26560" CreationDate="2016-08-25T10:20:12.773" Score="2" Body="&lt;p&gt;I don't know whether it is possible to bookmark the whole remote path as you type it. But please be aware, that the pipe notation &lt;code&gt;/sshx:user@myhost|su:myhost:&lt;/code&gt; is called ad-hoc proxies, it is not intended to survive an Emacs session. I recommend you to add the proxy configuration in your &lt;code&gt;.emacs&lt;/code&gt; file, as described in the Tramp manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'tramp-default-proxies-alist&#xA;             '(&quot;\\`mydomain\\'&quot; &quot;\\`root\\'&quot; &quot;/sshx:user@%h:&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From now on, you could always use &lt;code&gt;/su:myhost:&lt;/code&gt; as remote identification.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-08-25T10:20:12.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26568" PostTypeId="2" ParentId="26498" CreationDate="2016-08-25T10:54:56.813" Score="1" Body="&lt;p&gt;The value inside &#xA;&lt;code&gt;'(tabbar-background-color &quot;color-237&quot;)&lt;/code&gt; was invalid.&lt;br&gt;&#xA;Changed it to &lt;code&gt;'(tabbar-background-color &quot;#3A3A3A&quot;)&lt;/code&gt; - and it worked.&lt;/p&gt;&#xA;" OwnerUserId="2007" LastActivityDate="2016-08-25T10:54:56.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26569" PostTypeId="1" CreationDate="2016-08-25T11:13:50.263" Score="3" ViewCount="1361" Body="&lt;p&gt;I'm very new to emacs and am currently using it to edit files on mac os x. How do I open instances of the shell from inside emacs so that I can execute the code I'm working on?&lt;/p&gt;&#xA;" OwnerUserId="13103" LastEditorUserId="253" LastEditDate="2016-08-25T12:28:23.523" LastActivityDate="2017-06-20T04:08:01.480" Title="Open shell on Mac OS X" Tags="|osx|shell|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26570" PostTypeId="1" CreationDate="2016-08-25T11:40:56.043" Score="0" ViewCount="69" Body="&lt;p&gt;Please consider the following org-mode snippet containing code to call &quot;show tables&quot; on  a particular database via a sql code block and to dump out the database via mysqldump using an sh code block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Database&#xA;:PROPERTIES:&#xA;:header-args: :engine &quot;mysql&quot; :dbuser &quot;user&quot; :dbpassword &quot;password&quot; :dbhost &quot;127.0.0.1&quot; :database &quot;mydb&quot; :var dbuser=&quot;user&quot; :var dbpassword=&quot;password&quot; :var dbhost=&quot;127.0.0.1&quot; :var database=&quot;mydb&quot;&#xA;:END:&#xA;&#xA;**** Test connectivity&#xA;#+begin_src sql&#xA;show tables;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;&#xA;**** Dump schema&#xA;#+begin_src sh &#xA;echo mysqldump -u $dbuser -p $dbpassword -h $dbhost $database&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: mysqldump -u user^M^M -p password^M^M -h 127.0.0.1^M^M mydb&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will note that the line that is echoed contains spurious whitespace (line ends by the look of it).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why is this and how can I make it go away?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remove the echo from the sh code block then I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mysqldump: Got error: 2005: &quot;Unknown MySQL server host '127.0.0.1^M^M' (8)&quot; when trying to connect&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the whitespace is really there.  I am running GNU Emacs 25.0.94.2 (x86_64-w64-mingw32) of 2016-05-26 on Windows 10.  So it might be a Windows problem - haven't tried it on Linux yet, will do that when I get home from work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;For bonus marks, can someone tell me how to refactor the header_args so that I don't have to declare everything twice (once for SQL language specific headers and once for code block variables)?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know what additional information I should provide as this is my first post.&lt;/p&gt;&#xA;" OwnerUserId="13104" LastActivityDate="2016-08-26T11:08:13.320" Title="Why do I get random white space in header_arg expansions when running shell scripts from Babel?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26571" PostTypeId="2" ParentId="26509" CreationDate="2016-08-25T11:49:54.817" Score="5" Body="&lt;p&gt;Looks to me like that &lt;strong&gt;is&lt;/strong&gt; ordering by just priority-desc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can infer from that snippet that you've set your org-default-priority to B, so the todo item with no explicit priority has defaulted to B and is correctly placed in the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to send items without explicit priorities to the bottom of the list you have to set org-default-priority to the value of org-lowest-priority).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, add the following to .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-lowest-priority ?E)&#xA;(setq org-default-priority ?E)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13104" LastActivityDate="2016-08-25T11:49:54.817" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26572" PostTypeId="1" CreationDate="2016-08-25T14:10:36.783" Score="1" ViewCount="34" Body="&lt;p&gt;I am using AucTeX in combination with &lt;code&gt;visual-line-mode&lt;/code&gt; but sometimes I find it somewhat confusing that a broken line does not follow the &quot;current indentation&quot; which makes it harder to see environments. In other words a &quot;too long line&quot; is indented by a few characters but the parts which had to be broken start a the left of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get automated line breaks where the &quot;broken parts of the lines&quot; have the same indentation?&lt;/p&gt;&#xA;" OwnerUserId="10405" LastEditorUserId="262" LastEditDate="2016-08-25T14:44:47.093" LastActivityDate="2016-08-25T14:44:47.093" Title="Line break and indentation in AucTeX" Tags="|indentation|auctex|line-break|visual-line-mode|" AnswerCount="0" CommentCount="0" ClosedDate="2016-08-28T13:20:15.040" ContentLicense="CC BY-SA 3.0" />
  <row Id="26573" PostTypeId="1" CreationDate="2016-08-25T14:51:25.750" Score="3" ViewCount="153" Body="&lt;p&gt;I use emacs on different boxes and I want to share some files between them.&#xA;The canonical examples would be &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Startup-Files.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-startup-file&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/remember/Text-File.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;remember-data-file&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can set the files to remote locations (like, e.g., &lt;code&gt;/sds@myserver:~/.newsrc&lt;/code&gt;) and &lt;code&gt;tramp&lt;/code&gt; would take care of that.&#xA;However, &lt;code&gt;myserver&lt;/code&gt; is not always available and I don't want my &lt;code&gt;gnus&lt;/code&gt; to freeze when &lt;code&gt;myserver&lt;/code&gt; goes down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behavior I want is &lt;em&gt;local&lt;/em&gt; files which are synced to a &lt;em&gt;remote location&lt;/em&gt; every now and then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now I do it from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Startup-Variables.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-before-startup-hook&lt;/code&gt;&lt;/a&gt;/&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/Exiting-Gnus.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;gnus-after-exiting-gnus-hook&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/MidnightMode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;midnight-hook&lt;/code&gt;&lt;/a&gt;, but I was wondering what would others suggest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. Note that these files aren't on the same exalted level as, say, &lt;code&gt;.emacs&lt;/code&gt; (which is kept under &lt;code&gt;hg&lt;/code&gt;), so I do not want to preserve their history.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-08-25T21:37:29.580" LastActivityDate="2016-08-26T04:07:47.797" Title="Soft link local file to a remote file" Tags="|tramp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26574" PostTypeId="1" AcceptedAnswerId="26653" CreationDate="2016-08-25T16:20:48.317" Score="3" ViewCount="529" Body="&lt;p&gt;When working with files changed on disk, there are two warnings&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;... changed on disk; really edit the buffer?&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;... has changed since visited or saved.  Save anyway?&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They're useful, but get very impractical when switching branches fort and back (as I commonly do with git).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to make Emacs determine that the content hasn't actually changed (or has been restored to a state equals to what's in its Emacs buffer)?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The fix given in the nearly-duplicate solves the first part only. As @Stefan wrote, the second is easy using &lt;code&gt;(set-visited-file-modtime)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13045" LastEditorUserId="13045" LastEditDate="2016-08-28T23:35:28.060" LastActivityDate="2016-08-28T23:37:07.577" Title="Detect changed files by content" Tags="|files|editing|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26575" PostTypeId="1" AcceptedAnswerId="26580" CreationDate="2016-08-25T16:29:39.060" Score="0" ViewCount="422" Body="&lt;p&gt;On occasion, the git information on mode-line, gets stuck and will not update. For example if I checkout to a different branch, the old branch will still be shown. Or the &quot;mod&quot; indicator will remain when it should not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone know how to fix this?&lt;/p&gt;&#xA;" OwnerUserId="12507" LastEditorUserId="306" LastEditDate="2016-08-25T17:31:01.327" LastActivityDate="2017-11-10T20:23:33.730" Title="On occasion, mode-line git information gets stuck and doesn't update" Tags="|vc|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26576" PostTypeId="2" ParentId="26545" CreationDate="2016-08-25T16:56:18.660" Score="1" Body="&lt;p&gt;After I heard that there is no convenient solution for re-evaluation of buffer with reassigning of &lt;code&gt;defvar&lt;/code&gt;'s I made simple function that relays on &lt;code&gt;eval-defun&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/eval-buffer ()&#xA;  &quot;Evaluate entire buffer with re-assigning values to `defvar' / `defcustom'.&#xA;Useful during package development.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (beginning-of-buffer)&#xA;    (while (not (eobp))&#xA;      (eval-defun nil)&#xA;      (end-of-defun))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Code structure inspired by &lt;code&gt;eval-defun-2&lt;/code&gt; implementation. It is similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/2298/how-do-i-force-re-evaluation-of-a-defvar&quot;&gt;How do I force re-evaluation of a defvar?&lt;/a&gt; solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Originally I want high level function to re-evaluate library that re-installed through build script so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/load-library (library)&#xA;  &quot;Evaluate entire library with re-assigning values to `defvar' / `defcustom'.&#xA;Useful during package development.&quot;&#xA;  (interactive&#xA;   (list (completing-read &quot;Load library: &quot;&#xA;                          (apply-partially 'locate-file-completion-table&#xA;                                           load-path&#xA;                                           '(&quot;&quot; &quot;.el&quot;)))))&#xA;  (with-temp-buffer&#xA;    (insert-file-contents (locate-file library load-path '(&quot;&quot; &quot;.el&quot;)))&#xA;    (my/eval-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Drew&lt;/em&gt; solution works even on nested &lt;code&gt;defvar&lt;/code&gt; but it is hard to completely understand code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also think about &lt;code&gt;unintern&lt;/code&gt; all symbols based on symbol prefix/regex (as &lt;em&gt;Dan&lt;/em&gt; suggested) but I am lazy to type prefix each time... See &lt;a href=&quot;https://emacs.stackexchange.com/questions/2828/how-can-i-unbind-all-symbol-definitions-with-a-certain-prefix&quot;&gt;How can I unbind all symbol definitions with a certain prefix?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-08-25T17:24:17.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26577" PostTypeId="1" AcceptedAnswerId="29442" CreationDate="2016-08-25T17:14:57.643" Score="1" ViewCount="45" Body="&lt;p&gt;Is it possible to include only certain columns of a table when&#xA;   using org-mode's &lt;a href=&quot;http://orgmode.org/manual/Include-files.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;#+INCLUDE&lt;/code&gt; directive&lt;/a&gt;? You can choose certain&#xA;   rows like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: &quot;./paper.org::*conclusion&quot; :lines 1-20&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8431" LastEditorUserId="8431" LastEditDate="2016-12-20T17:44:17.623" LastActivityDate="2016-12-20T17:44:17.623" Title="Include Certain Columns of a Table" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26578" PostTypeId="1" CreationDate="2016-08-25T17:19:47.033" Score="1" ViewCount="34" Body="&lt;p&gt;This is a weird one, for me: I use both ESS (for R programming) and &lt;a href=&quot;https://github.com/defunkt/gist.el&quot; rel=&quot;nofollow&quot;&gt;gist.el&lt;/a&gt; for (surprise!) interacting with github gists. Except, now I have a problem: every time I try to view a gist locally, ESS's R hook tries to read the dir of the gist, which is nil, and explodes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  directory-file-name(nil)&#xA;  ess-r-package--find-package-path()&#xA;  ess-r-package--local-package-info()&#xA;  ess-r-package-get-info()&#xA;  ess-r-package-auto-activate()&#xA;  run-hooks(after-change-major-mode-hook)&#xA;  run-mode-hooks()&#xA;  fundamental-mode()&#xA;  normal-mode()&#xA;  gist-fetch(&quot;3116a156329746b082d9&quot;)&#xA;  gist-fetch-current()&#xA;  funcall-interactively(gist-fetch-current)&#xA;  call-interactively(gist-fetch-current nil nil)&#xA;  command-execute(gist-fetch-current)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So that's pretty cool. Adding to the general sense of bewilderment: this happens on &lt;em&gt;any&lt;/em&gt; gist, regardless of what major mode it should end up in. (I assume this is some deep ESS black magic trying to determine if it should leap in to action or not.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm trying to figure out:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is this a bug in ESS? Sure seems like a bug, but I don't actually grok the core behavior of ESS in this instance, so I'm not sure.&lt;/li&gt;&#xA;&lt;li&gt;Whether it's a bug or not, any suggestions on a work-around? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2016-08-25T17:50:36.793" Title="ESS hooks breaking buffers not associated with files" Tags="|hooks|ess|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26579" PostTypeId="1" AcceptedAnswerId="26583" CreationDate="2016-08-25T17:27:46.910" Score="6" ViewCount="328" Body="&lt;p&gt;I'm using git to maintain a web site located on a remote server.  My workflow has been as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Stage and commit changes to the web site (can do with Magit)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;ssh&lt;/code&gt; to the remote site and pull the changes into the repository that is located there, updating the working tree (cannot do with Magit)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Still in the script at the remote site, run &lt;code&gt;make&lt;/code&gt; on the new working tree&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Back in emacs, fetch from the remote repository, so that Magit knows things are up to date&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Steps 2 and 3 are implemented by a single shell script, but now that I'm addicted to magit, leaving magit to run a shell script seems an enormous imposition.  My question is twofold:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I integrate steps 2, 3, and 4 into a single emacs command?  The magit documentation has a section entitled &quot;Plumbing,&quot; and there are some hints there, so I might be able to make progress on my own.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I add the new command as an option to Magit's context-sensitive push menu, which pops up when I use the capital &lt;code&gt;P&lt;/code&gt;?  This one I have no idea how to do.  Can anybody help?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9343" LastActivityDate="2019-03-18T19:25:49.227" Title="How to extend magit's context-sensitive push menu?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26580" PostTypeId="2" ParentId="26575" CreationDate="2016-08-25T17:29:32.520" Score="2" Body="&lt;p&gt;This information is being updated by the VC package that is part of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many users have noticed that this information isn't always being updated when it should and asked about that problem in many different places, or reported as a bug in some unrelated package/project such as Magit or Spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because this has been reported as a Magit bug or feature request so often, I have added a note about it to Magit's FAQ: &lt;a href=&quot;https://magit.vc/manual/magit/The-mode_002dline-information-isn_0027t-always-up_002dto_002ddate.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;The mode-line information isn’t always up-to-date&lt;/a&gt;. Also see &lt;a href=&quot;https://github.com/magit/magit/issues/2687&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/magit/magit/issues/2687&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just realized that &lt;a href=&quot;https://github.com/magit/magit/wiki/magit-update-uncommitted-buffer-hook&quot; rel=&quot;nofollow noreferrer&quot;&gt;this relevant page&lt;/a&gt; on the wiki isn't being mentioned in the FAQ entry. You might want to check that out too.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-11-10T20:23:33.730" LastActivityDate="2017-11-10T20:23:33.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26581" PostTypeId="2" ParentId="10996" CreationDate="2016-08-25T17:48:27.543" Score="1" Body="&lt;p&gt;you may be interested in my new package to swap keys when entering text; it allows swapping quotes (avoiding the shift key): &lt;a href=&quot;https://github.com/wbolster/evil-swap-keys&quot; rel=&quot;nofollow&quot;&gt;https://github.com/wbolster/evil-swap-keys&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for automatic closing quotes, &lt;code&gt;electric-pair-mode&lt;/code&gt; may be what you're looking for: it will insert the closing quote automatically, and you can type the quoting character yourself to step over the (already inserted) closing quote, which means you can avoid cursor keys completely and still have automatic matching pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i know this is not an exact answer to your question, but it addresses the underlying problem in a (at least for me) very acceptable way.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastActivityDate="2016-08-25T17:48:27.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26583" PostTypeId="2" ParentId="26579" CreationDate="2016-08-25T18:19:48.870" Score="5" Body="&lt;p&gt;For steps 2 and 3, you can just use &lt;code&gt;shell-command&lt;/code&gt; and &lt;code&gt;ssh&lt;/code&gt; to accomplish this from emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do 4, you can use &lt;code&gt;magit-fetch-all-no-prune&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can wrap this into a function like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun aec/ssh-make-and-fetch ()&#xA;  (interactive)&#xA;  (shell-command &quot;ssh me@example.com \&quot;cd project &amp;amp;&amp;amp; make\&quot;&quot;)&#xA;  (magit-fetch-all-no-prune))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can add an action to the push popup with &lt;code&gt;magit-define-popup-action&lt;/code&gt;. The push popup is &lt;code&gt;magit-push-popup&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example, I'll bind it to the key &lt;code&gt;!&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-action 'magit-push-popup &#xA;  ?!&#xA;  &quot;Make remotely&quot;&#xA;  'aec/ssh-make-and-fetch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To configure this after magit loads, you can use &lt;code&gt;eval-after-load&lt;/code&gt; in your init.el (assuming you aren't already using something like &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;magit&quot;&#xA;  '(magit-define-popup-action 'magit-push-popup&#xA;     ?! &#xA;     &quot;Make remotely&quot; &#xA;     'aec/ssh-make-and-fetch))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12147" LastEditorUserId="12147" LastEditDate="2016-08-31T15:44:29.927" LastActivityDate="2016-08-31T15:44:29.927" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26584" PostTypeId="2" ParentId="26543" CreationDate="2016-08-25T20:40:03.420" Score="1" Body="&lt;p&gt;After delving into the innards of the minibuffer, I've developed a solution that should work for all prompting functions. It's pretty hacky though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method intercepts the prompt function itself (&lt;code&gt;read-from-minibuffer&lt;/code&gt;) and returns the default value - iff the prompt matches one of a list of regular expressions. This could be extended to return a specific value (other than the default), based on the prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; First, we set up a global list of regular expressions. This&#xA;;; variable should only be modified by auto-pick-default-prompt. A&#xA;;; prompt that matches any of these regular expressions will be&#xA;;; accepted automatically.&#xA;(setq auto-pick-default-prompts '())&#xA;&#xA;&#xA;(defun auto-pick-default-internal (original-function&#xA;                                   prompt&#xA;                                   &amp;amp;optional initial-contents key-map&#xA;                                   read history default-value&#xA;                                   inherit-input-method)&#xA;  &quot;Function to be run around prompts to auto-pick default value.&#xA;&#xA;Uses the global variable auto-pick-default-prompts to&#xA;determine whether the particular prompt it is enclosing should be&#xA;automatically confirmed.&#xA;&#xA;If no regular expressions for prompts are specified, auto&#xA;confirms all prompts.&quot;&#xA;  ;; If no prompt filters have been set, just return the default value&#xA;  ;; for the prompt&#xA;  (if (not auto-pick-default-prompts)&#xA;      default-value&#xA;    ;; Else check if the prompt matches one of the filters.&#xA;    ;; If so, return the default value for the prompt.&#xA;    (let ((matches nil))&#xA;      (mapc #'(lambda (regexp)&#xA;                (if (string-match regexp prompt)&#xA;                    (setq matches t)))&#xA;            auto-pick-default-prompts)&#xA;      (if matches&#xA;          default-value&#xA;        (funcall original-function&#xA;                 prompt initial-contents key-map read history&#xA;                 default-value inherit-input-method)))))&#xA;&#xA;&#xA;(defun auto-pick-default-prompt (function is-interactive prompt-regexps &amp;amp;optional args)&#xA;  &quot;Runs a function, auto selecting the default option in prompts.&#xA;&#xA;Takes a list of regular expressions for prompts that should be&#xA;auto-confirmed. Prompts which do not match any of these&#xA;expressions will not be auto confirmed.&quot;&#xA;  (condition-case nil&#xA;      (progn&#xA;        ;; Set the prompts that should be auto-accepted&#xA;        (setq auto-pick-default-prompts prompt-regexps)&#xA;        ;; Add the intercepting command&#xA;        (advice-add 'read-from-minibuffer :around #'auto-pick-default-internal)&#xA;        ;; Call the function in the appropriate manner (interactive,&#xA;        ;; with arguments, without arguments)&#xA;        (if is-interactive&#xA;            (if (&amp;gt; (length args) 0)&#xA;                (call-interactively function nil args)&#xA;              (call-interactively function))&#xA;          (apply function args))&#xA;        ;; Now remove the intercepting command and reset the prompts&#xA;        ;; that should be auto-accepted.&#xA;        (advice-remove 'read-from-minibuffer #'auto-pick-default-internal)&#xA;        (setq auto-pick-default-prompts nil))&#xA;    ((debug error) (progn&#xA;                     ;; This function wraps a child function with some&#xA;                     ;; advice. If the child throws an error, the&#xA;                     ;; advice will not be removed. Explicitly remove&#xA;                     ;; advice after an error has been thrown.&#xA;                     (advice-remove 'read-from-minibuffer #'auto-pick-default-internal)&#xA;                     (setq auto-pick-default-prompts nil)            &#xA;                     (signal err)))))&#xA;&#xA;&#xA;(defun noprompt-rope-rename (&amp;amp;rest args)&#xA;  &quot;Call rope-rename, skipping the confirmation prompt.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((prompts-to-skip'(&quot;Choose what to do&quot;)))&#xA;    (auto-pick-default-prompt 'rope-rename t prompts-to-skip)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A limitation of this approach is that it can't be called recursively. A command wrapped by &lt;code&gt;auto-pick-default-prompt&lt;/code&gt; cannot itself call &lt;code&gt;auto-pick-default-prompt&lt;/code&gt;. That should be fine though, and I imagine it's possible to get around this limitation by extending the advice system.&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2018-02-07T01:23:52.343" LastActivityDate="2018-02-07T01:23:52.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26586" PostTypeId="2" ParentId="26573" CreationDate="2016-08-25T20:59:57.873" Score="1" Body="&lt;p&gt;I keep those files in a git repository.  Then I run a script every once in a while which does &lt;code&gt;git commit; git pull; git push&lt;/code&gt;.  I really wish someone would write a file-system which does that for me.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-08-26T03:29:52.630" LastActivityDate="2016-08-26T03:29:52.630" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26588" PostTypeId="1" CreationDate="2016-08-25T21:25:51.633" Score="1" ViewCount="41" Body="&lt;p&gt;I want to modify the highlighting of my JS files, so that every line starting with &lt;code&gt;LOG&lt;/code&gt; gets shown in a different color.&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'font-core)&#xA;&#xA;(font-lock-mode 1)&#xA;&#xA;(defface mg-js-pseudo-face '((t (:background &quot;White&quot;))) &quot;...&quot; :group 'faces)&#xA;&#xA;(defvar mg-js-pseudo-regex &quot;^[ \t]*\\(LOG .*\\)&quot;)&#xA;&#xA;(defun mg-js-pseudo-hook ()&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   `(&#xA;     (,mg-js-pseudo-regex 1 'mg-js-pseudo-face t)) ;;; &amp;lt;----- here&#xA;))&#xA;&#xA;(add-hook 'js-mode-hook 'mg-js-pseudo-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works well when highlighting the whole line (using &lt;code&gt;0&lt;/code&gt; instead of &lt;code&gt;1&lt;/code&gt; in the marked line). It does nothing at all, when used as is. Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;It's invalid JS, I know. It gets preprocessed by the server to &lt;code&gt;console.log&lt;/code&gt; with some added information.&lt;/p&gt;&#xA;" OwnerUserId="13045" LastEditorUserId="13045" LastEditDate="2016-08-25T21:36:11.837" LastActivityDate="2016-08-25T21:36:11.837" Title="Modified mode highlighting" Tags="|syntax-highlighting|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26589" PostTypeId="1" CreationDate="2016-08-25T21:36:51.777" Score="5" ViewCount="969" Body="&lt;p&gt;Using Emacs 25.1 and js-mode for javascript editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to change the indention rules in js-mode to customize the indention of arrow functions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of anonymous function indention:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const x = list.map(function (x) {&#xA;  return someCoolFunction(x)&#xA;    .maybeEvenAChain()&#xA;    .or(two)&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How I would like arrow functions indented:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const x = list.map(x =&amp;gt;&#xA;  someCoolFunction(x)&#xA;    .maybeEvenAChain()&#xA;    .or(two)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what emacs is doing right now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const x = list.map(x =&amp;gt;&#xA;                   someCoolFunction(x)&#xA;                   .maybeEvenAChain()&#xA;                   .or(two)&#xA;                   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked through the indention code of js.el, and there seem to be two reasons arrow functions are not indented like anonymous functions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If an opening paren, square or curly brace has any text to the right all the text inside will be indented to the column of the first word after the opening punctuation. Also, the closing punctuation will be indented to the same column of the opening punctuation.&lt;br&gt;&lt;br&gt;&#xA;This is the desired behavior for object literals and the argument list of both function definitions and calls.&lt;br&gt;&lt;br&gt;&#xA;This functionality is defined in &lt;code&gt;js--proper-indentation&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If an exception is made for the arrow operator &lt;code&gt;=&amp;gt;&lt;/code&gt; to resolve the first issue, a second issue arises. The arrow operator is considered a continued expression by &lt;code&gt;js--continued-expression-p&lt;/code&gt;. The body of the arrow function will indented to &lt;code&gt;(* 2 js-indent-level)&lt;/code&gt;. This aligns the body with any actual continued expressions inside the body, which looks pretty messy.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am still pursuing a comprehensive way to resolve the issue. &lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="12195" LastEditDate="2016-09-02T13:00:38.053" LastActivityDate="2018-09-24T11:00:00.937" Title="Indent javascript arrow functions like regular anonymous functions" Tags="|indentation|javascript|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26590" PostTypeId="1" AcceptedAnswerId="26706" CreationDate="2016-08-25T21:39:47.057" Score="4" ViewCount="208" Body="&lt;p&gt;I've encountered a wierd situation when trying to match the first character of a string using a regex with alternatives.  It seems that replacement stops when matching a single character using a period at the start of the string, but not for slightly different patterns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Desired behavior:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;foo bar&quot; -&gt; &quot;Foo Bar&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string&#xA;   &quot;^.\\| .&quot;&#xA;   #'upcase&#xA;   &quot;foo bar&quot;)&#xA;&amp;gt; &quot;Foo bar&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that replacement stops and doesn't capitalize the 'b' in 'bar'.  However:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string&#xA;   &quot;^f\\| .&quot;&#xA;   #'upcase&#xA;   &quot;foo bar&quot;)&#xA;&amp;gt; &quot;Foo Bar&quot;&#xA;&#xA;(replace-regexp-in-string&#xA;   &quot;^.o\\| .&quot;&#xA;   #'upcase&#xA;   &quot;foo bar&quot;)&#xA;&amp;gt; &quot;FOo Bar&quot;&#xA;&#xA;(replace-regexp-in-string&#xA;   &quot;^..\\| .&quot;&#xA;   #'upcase&#xA;   &quot;foo bar&quot;)&#xA;&amp;gt; &quot;FOo Bar&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried parenthesizing all combinations of the alternatives to no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not concerned about beginning of string vs beginning of line ('\`' vs '^'), but FWIW this odd behavior is consistent with both patterns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm observing this behavior with both emacs 24.5.1 and 25.0.95.1.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="1979" LastEditDate="2016-08-28T15:54:21.520" LastActivityDate="2016-08-31T00:38:17.417" Title="replace-regexp-in-string stops replacement with &quot;^.&quot;?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26591" PostTypeId="1" AcceptedAnswerId="26594" CreationDate="2016-08-25T22:04:22.400" Score="4" ViewCount="447" Body="&lt;p&gt;&lt;strong&gt;The situation.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have opened up a file in emacs, and I type in something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;x \and \top&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, a Python program reads that file, and:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;replaces all &lt;code&gt;\and&lt;/code&gt; to &lt;code&gt;∧&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;replaces all &lt;code&gt;\top&lt;/code&gt; to &lt;code&gt;T&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;it does some thinking on the expression &lt;code&gt;x \and \top&lt;/code&gt; and decides that that is the same as &lt;code&gt;x&lt;/code&gt;, so will append an &lt;code&gt;= x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The final result of all the changes made by the program to the file will leave it like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;x ∧ T = x&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question: how should I pass messages between emacs and a Python program?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want the Python program to be constantly polling the file for changes (using a &lt;code&gt;while&lt;/code&gt; loop), and I probably don't want emacs to be constantly polling the file for updates (which I know how to do using the &lt;code&gt;auto-revert&lt;/code&gt; command). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I press some key combination, and then that sends a message to a Python script that its time to read the file and make updates and then the  Python script would message emacs and ask it to update what it is displaying in its buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could this be done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My goal:&lt;/strong&gt; I want to take advantage of the fact that emacs knows how to intelligently display pixels on a screen in an interactive way (it can manage dividing up the screen space, display text and allow editing, syntax highlighting, etc.). I want to take advantage of my knowledge of Python to do heavy programming (rather than using emacs Lisp), and emacs would be the UI for this program. I view communication between emacs, and the Python program as crucial to achieving this goal. If there is a better way to think about this though, I'd love to learn (for instance, maybe I really should be involving emacs Lisp a lot more, and eliminating Python entirely?).&lt;/p&gt;&#xA;" OwnerUserId="13108" LastEditorUserId="9995" LastEditDate="2016-08-26T09:55:34.880" LastActivityDate="2016-08-26T09:55:34.880" Title="How to pass messages between emacs and a Python program? (goal: trying to use emacs as a UI)" Tags="|python|process|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26593" PostTypeId="2" ParentId="26591" CreationDate="2016-08-26T01:29:17.090" Score="2" Body="&lt;p&gt;I developed a Python &amp;lt;-&gt; Emacs messaging prototype using an HTTP server running on each, but I don't have the code anymore. &lt;a href=&quot;https://www.emacswiki.org/emacs/Elnode&quot; rel=&quot;nofollow&quot;&gt;Elnode&lt;/a&gt; is an asynchronous background Server for Emacs and &lt;a href=&quot;https://github.com/tkf/emacs-request&quot; rel=&quot;nofollow&quot;&gt;Emacs-Request&lt;/a&gt; allows you to post HTTP requests to the Python server. Python of course has &lt;a href=&quot;https://docs.python.org/2/library/simplehttpserver.html&quot; rel=&quot;nofollow&quot;&gt;Simple Server&lt;/a&gt; and &lt;a href=&quot;http://docs.python-requests.org/en/master/&quot; rel=&quot;nofollow&quot;&gt;Requests&lt;/a&gt;, as well as more robust solutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works, and it's reliable (provided you handle dropped requests), but it's a limited solution. Because of how Emacs deals with asynchronous processes, the latency is very high - in the region of one second per request. If that isn't a problem, this is the most versatile solution and it is easy enough to implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more robust solution is probably &lt;a href=&quot;https://github.com/pinard/Pymacs&quot; rel=&quot;nofollow&quot;&gt;Pymacs&lt;/a&gt;, but I haven't looked into it myself. It's an interface between Python and Emacs-Lisp. Ropemacs is built on it, and I believe Elpy also uses it. The documentation is no longer available from their website, but it is available on the Wayback Machine. You may also find useful code snippets by looking at the source code for Elpy, Ropemacs, Emacs-Jedi, Sphinx-doc and other Python-interfacing packages.&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-08-26T01:29:17.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26594" PostTypeId="2" ParentId="26591" CreationDate="2016-08-26T01:47:01.143" Score="2" Body="&lt;p&gt;you could check out &lt;a href=&quot;https://github.com/tkf/python-epc&quot; rel=&quot;nofollow&quot;&gt;https://github.com/tkf/python-epc&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or if you like org-mode:&#xA;&lt;a href=&quot;https://github.com/gregsexton/ob-ipython&quot; rel=&quot;nofollow&quot;&gt;https://github.com/gregsexton/ob-ipython&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(actually the regular python support in org-mode might be sufficient. You can run sessions so you can have separate &quot;blocks&quot; of code).&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-26T01:47:01.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26595" PostTypeId="2" ParentId="26569" CreationDate="2016-08-26T01:49:27.890" Score="2" Body="&lt;p&gt;I wrote this terminal command to open a terminal in the current working directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun terminal ()&#xA;  (interactive)&#xA;  (shell-command&#xA;   (format &quot;open -b com.apple.terminal \&quot;%s\&quot;&quot;&#xA;       (if (buffer-file-name)&#xA;           (file-name-directory (buffer-file-name))&#xA;         (expand-file-name default-directory)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;its not an emacs shell, but it is convenient for me.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-26T01:49:27.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26596" PostTypeId="1" CreationDate="2016-08-26T03:18:20.297" Score="1" ViewCount="2359" Body="&lt;p&gt;I like having &lt;code&gt;mouse-wheel-follow-mouse&lt;/code&gt; set to non-nil, so I can use the trackpad to scroll an inactive window. Unfortunately, it doesn't apply to horizontal scrolling, so if I try to scroll an inactive window side-to-side, the active window scrolls (horizontally) instead. Is there a way to fix that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I have in my init.el as far as scrolling configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq scroll-step 1&#xA;      scroll-margin 0&#xA;      hscroll-step 1&#xA;      hscroll-margin 2&#xA;      scroll-conservatively 200&#xA;      mouse-wheel-scroll-amount '(0.01 ((shift) . 1)))&#xA;&#xA;(defun ivan/scroll-right ()&#xA;  (interactive)&#xA;  (scroll-right 2))&#xA;(defun ivan/scroll-left ()&#xA;  (interactive)&#xA;  (scroll-left 2))&#xA;&#xA;(defvar ivan/hscroll-minor-mode-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map [wheel-right] #'ivan/scroll-left)&#xA;    (define-key map [wheel-left] #'ivan/scroll-right)&#xA;    map))&#xA;&#xA;(define-minor-mode ivan/hscroll-minor-mode :init-value t)&#xA;(ivan/hscroll-minor-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-08-26T03:18:20.297" Title="mouse-wheel-follow-mouse for horizontal scrolling?" Tags="|mouse|scrolling|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26597" PostTypeId="2" ParentId="26573" CreationDate="2016-08-26T04:07:47.797" Score="0" Body="&lt;p&gt;Just put those files in your .emacs.d and symlink to them from your home directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That way they'll always be up to date as long as you keep your .emacs.d syncronized.&lt;/p&gt;&#xA;" OwnerUserId="10824" LastActivityDate="2016-08-26T04:07:47.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26598" PostTypeId="2" ParentId="24203" CreationDate="2016-08-26T04:35:43.507" Score="3" Body="&lt;p&gt;I take a different approach.  I export the Org file without the header (&lt;code&gt;C-c C-e C-b h l&lt;/code&gt;, and &lt;code&gt;\input&lt;/code&gt; the resulting latex code in my own &lt;code&gt;main.tex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives me full flexibility on LaTeX rendering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the document class: you're doing it fine, but 44pt is not a valid option for the &lt;code&gt;article&lt;/code&gt; class. This is a LaTeX issue.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-08-26T04:35:43.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26600" PostTypeId="1" AcceptedAnswerId="26609" CreationDate="2016-08-26T05:57:00.180" Score="0" ViewCount="325" Body="&lt;p&gt;I am using the cyberpunk-theme, the * are show in light green and is not visible in hightlighted line. I tried to set dired-mark-face to white. Is there other variables I can set?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="115" LastEditDate="2016-08-26T14:26:42.090" LastActivityDate="2016-09-06T19:40:08.737" Title="How to change the mark (*) color in dired mode" Tags="|dired|faces|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26601" PostTypeId="2" ParentId="26600" CreationDate="2016-08-26T08:22:48.857" Score="1" Body="&lt;p&gt;You should set the face, not the variable:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-foreground 'dired-mark &quot;#fff&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-08-26T13:18:00.033" LastActivityDate="2016-08-26T13:18:00.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26602" PostTypeId="1" CreationDate="2016-08-26T09:06:37.000" Score="3" ViewCount="945" Body="&lt;p&gt;How do I search&amp;amp;replace selected instances (in particular those occurring in strings, not in variable names – but using an equivalent of &lt;code&gt;'query-replace&lt;/code&gt; is safer and still fine, there should not be too many hits) of &lt;code&gt;lexibank&lt;/code&gt; with &lt;code&gt;lexikudang&lt;/code&gt; in all files below a certain directory, keeping capitalization – that is, i.e. also replacing &lt;code&gt;Lexibank&lt;/code&gt; with &lt;code&gt;Lexikudang&lt;/code&gt; and &lt;code&gt;LEXIBANK&lt;/code&gt; with &lt;code&gt;LEXIKUDANG&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2702" LastActivityDate="2016-08-27T16:58:18.280" Title="query-replace on directory" Tags="|directories|query-replace|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26603" PostTypeId="1" CreationDate="2016-08-26T11:02:11.960" Score="2" ViewCount="1536" Body="&lt;p&gt;How does one run the arbitrary command to execute the tangled code? I use Emacs both on Windows and Linux, but currently I need to run the generated batch file in particular Windows environment.&lt;br&gt;&#xA;Here is how the block looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src bat :exports both :tangle &quot;run_tests.bat&quot;&#xA;...&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a batch file which sets the environment (&lt;code&gt;d:\Programs\Microsoft Visual Studio 12.0\VC\vcvarsall.bat&lt;/code&gt;), but cannot run my tangled file inside this new environment. How to do this?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code can be tangled using &lt;code&gt;org-babel-tangle&lt;/code&gt; of course, but I cannot run the generated batch file from Emacs using &lt;code&gt;org-ctrl-c-ctrl-c&lt;/code&gt; as it says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-babel-execute-src-block: No org-babel-execute function for bat!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8840" LastActivityDate="2016-08-26T18:46:48.143" Title="How to run the tangled file?" Tags="|org-mode|org-export|org-babel|microsoft-windows|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26604" PostTypeId="2" ParentId="26570" CreationDate="2016-08-26T11:08:13.320" Score="1" Body="&lt;p&gt;Ok, after much banging my head on this, I think I've worked it out.  The spurious ^M characters are not as such caused by Emacs specifically but by any Windows program interacting with the Cygwin bash shell (which I am using).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting the following into ~/.emacs will tell bash to ignore spurious carriage returns and all my problems go away:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;SHELLOPTS&quot; &quot;igncr&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13104" LastActivityDate="2016-08-26T11:08:13.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26605" PostTypeId="2" ParentId="26603" CreationDate="2016-08-26T12:23:32.420" Score="3" Body="&lt;p&gt;Tangling creates the batch file, execution of source block tries to execute the source block in the specified language (and there is no &lt;code&gt;ob-bat&lt;/code&gt; I know of).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can execute the tangled batch file in a shell source block. Therefore add the following to your org file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+BEGIN_SRC sh :exports results :results output&#xA;cmd /c &quot;&quot;d:\Programs\Microsoft Visual Studio 12.0\VC\vcvarsall.bat&quot; &amp;amp; run_tests.bat&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This first runs the batch and then, separated by &lt;code&gt;&amp;amp;&lt;/code&gt;, your batch script.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I have a MinGW environment with a bash shell. If you want to run windows &lt;code&gt;cmd.exe&lt;/code&gt; directly you may find a hint &lt;a href=&quot;https://emacs.stackexchange.com/questions/19037/org-babel-invoking-cmd-exe&quot;&gt;here&lt;/a&gt;, which introduces a &lt;code&gt;shcmd&lt;/code&gt; header option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you need to require &lt;code&gt;ob-sh&lt;/code&gt; or &lt;code&gt;ob-shell&lt;/code&gt;, depending on your org version. Therefore I do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(unless (require 'ob-sh nil 'noerror)&#xA;  (require 'ob-shell))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Btw, if all you want is to execute some command sequence you can simply do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+BEGIN_SRC sh :exports results :results output&#xA;call &quot;d:\Programs\Microsoft Visual Studio 12.0\VC\vcvarsall.bat&quot;&#xA;echo &quot;insert commands here&quot;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I may need a windows native execution facility in org-mode I will write an &lt;code&gt;ob-bat.el&lt;/code&gt; as soon as I am back from holiday (next week). Meanwhile you may try this code snippet (since I have no windows box it is untested):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ob)&#xA;(require 'ob-shell)&#xA;&#xA;(defvar org-babel-tangle-lang-exts)&#xA;(add-to-list 'org-babel-tangle-lang-exts '(&quot;bat&quot; . &quot;bat&quot;))&#xA;&#xA;(defcustom org-babel-bat-command &quot;cmd.exe&quot;&#xA;  &quot;Name of command to use for executing bat code.&quot;)&#xA;&#xA;(defun org-babel-execute:bat (body params)&#xA;  &quot;Execute a block of bat code with cmd.exe.&#xA;This function is called by `org-babel-execute-src-block'.&quot;&#xA;  (let ((shell-file-name org-babel-bat-command))&#xA;    (org-babel-execute:shell body params)))&#xA;&#xA;(provide 'ob-bat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this you should be able to execute bat source blocks:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+BEGIN_SRC bat :exports results :results output&#xA;echo hello&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-08-26T18:46:48.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26606" PostTypeId="2" ParentId="26545" CreationDate="2016-08-26T13:06:58.713" Score="4" Body="&lt;p&gt;&lt;code&gt;(progn (unload-feature 'your-lib) (load-library &quot;your-lib&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will work as long as you first loaded the defvars by loading the library through emacs, and not using &lt;code&gt;eval-defun&lt;/code&gt;, &lt;code&gt;eval-buffer&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use &lt;code&gt;require&lt;/code&gt;, &lt;code&gt;load-library&lt;/code&gt; etc. Emacs will keep track of which variables and functions are part of your library, and will remove them entirely for you when you use &lt;code&gt;unload-feature&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When writing packages, I find that using the code above is a better solution than running &lt;code&gt;eval-defun&lt;/code&gt; as you write new code so you don't get into intermediate states.&lt;/p&gt;&#xA;" OwnerUserId="160" LastActivityDate="2016-08-26T13:06:58.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26607" PostTypeId="1" CreationDate="2016-08-26T13:31:46.073" Score="2" ViewCount="1713" Body="&lt;p&gt;I have been recently fiddling a lot with Emacs &lt;code&gt;org-mode&lt;/code&gt;. In this process suddenly my key-binding for showing the agenda menu is lost, so I have to access it with &lt;code&gt;M-x org-agenda&lt;/code&gt;.  The error I get when I press &lt;code&gt;C-c a&lt;/code&gt; is &quot; &lt;code&gt;C-c a&lt;/code&gt; is undefined&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I restore the original keybinding?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please answer the question with the following points in mind as I am trying to learn few things out of this problems.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Where are these default key-bindings stored? &lt;/li&gt;&#xA;&lt;li&gt;What could I have done to cause the problem (So that I am more aware when I am doing it next time)?&lt;/li&gt;&#xA;&lt;li&gt;How do I restore it? I do not want to add a custom key binding in &lt;code&gt;.emacs&lt;/code&gt; as &lt;code&gt;C-c a&lt;/code&gt; usually there by default in org-more.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13086" LastEditorUserId="253" LastEditDate="2016-08-26T14:28:15.990" LastActivityDate="2016-08-26T14:28:15.990" Title="Default key binding is lost, how to restore it?" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26608" PostTypeId="2" ParentId="26607" CreationDate="2016-08-26T14:27:46.727" Score="4" Body="&lt;p&gt;It's not possible to know what you did to lose your original&#xA;binding, so here's the basic upshot.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your customizations (as with keybindings) will be stored in&#xA;your&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;init&lt;/code&gt; file&lt;/a&gt;,&#xA;and any other elisp files you call from it. &lt;/li&gt;&#xA;&lt;li&gt;If it was a temporary change (i.e., you didn't make changes to&#xA;your &lt;code&gt;init&lt;/code&gt; file manually or through &lt;code&gt;customize&lt;/code&gt;), you can&#xA;just restart Emacs.&lt;/li&gt;&#xA;&lt;li&gt;If you &lt;em&gt;did&lt;/em&gt; make changes to your &lt;code&gt;init&lt;/code&gt; file (intentionally&#xA;or not), the problem will persist into new Emacs sessions.&lt;/li&gt;&#xA;&lt;li&gt;If you have no idea what code in the &lt;code&gt;init&lt;/code&gt; file is causing&#xA;you to lose your binding, do the following:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start Emacs &lt;em&gt;without&lt;/em&gt; your &lt;code&gt;init&lt;/code&gt; file (&lt;code&gt;emacs -Q&lt;/code&gt;) to&#xA;confirm.&lt;/li&gt;&#xA;&lt;li&gt;Recursively bisect your &lt;code&gt;init&lt;/code&gt; file by successively&#xA;commenting out halves until you isolate the problematic lines.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a given keybinding, you can find out what it calls with &lt;code&gt;C-h k&#xA;KEY SEQUENCE&lt;/code&gt;, (where &lt;code&gt;C-h k&lt;/code&gt; calls &lt;code&gt;describe-key&lt;/code&gt;).  For example,&#xA;you can try &lt;code&gt;C-h k C-c a&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a given command, you can find out the keybindings with &lt;code&gt;C-h f&#xA;FUNCTIONNAME&lt;/code&gt; (where &lt;code&gt;C-h f&lt;/code&gt; calls &lt;code&gt;describe-function&lt;/code&gt;).  For your&#xA;case, you can try &lt;code&gt;C-h f org-agenda&lt;/code&gt; to see what keybindings it has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;org&lt;/code&gt; manual's node on&#xA;&lt;a href=&quot;http://orgmode.org/manual/Activation.html&quot; rel=&quot;nofollow&quot;&gt;activation&lt;/a&gt; &lt;em&gt;suggests&lt;/em&gt;&#xA;using &lt;code&gt;C-c a&lt;/code&gt; as a global keybinding to access &lt;code&gt;org-agenda&lt;/code&gt;, but&#xA;you're under no obligation to use that particular binding.  If you&#xA;want to bind it again, you can follow it's suggestion with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can put that in your &lt;code&gt;scratch&lt;/code&gt; buffer and evaluate it, but it&#xA;should be somewhere in your &lt;code&gt;init&lt;/code&gt; file if you want it to persist&#xA;through Emacs sessions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, the reason &lt;code&gt;C-c a&lt;/code&gt; is not a hard and fast binding is&#xA;that it runs against&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html&quot; rel=&quot;nofollow&quot;&gt;keybinding conventions in Emacs&lt;/a&gt;,&#xA;one of which states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Don't define &lt;code&gt;C-c letter&lt;/code&gt; as a key in Lisp programs. Sequences&#xA;  consisting of &lt;code&gt;C-c&lt;/code&gt; and a letter (either upper or lower case)&#xA;  are reserved for users; they are the only sequences reserved for&#xA;  users, so do not block them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;More generally, have a look at the Emacs manual node on&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Key-Bindings.html#Key-Bindings&quot; rel=&quot;nofollow&quot;&gt;Customizing Key Bindings&lt;/a&gt;&#xA;to find out how to bind keys as you like.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-26T14:27:46.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26609" PostTypeId="2" ParentId="26600" CreationDate="2016-08-26T14:43:18.980" Score="2" Body="&lt;p&gt;You shouldn't set face variables directly. You should edit them with &lt;code&gt;set-face-attribute&lt;/code&gt; and accompanying commands.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute face frame &amp;amp;rest args)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;face&lt;/code&gt; - the font face you want to edit&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;frame&lt;/code&gt; - whether to make the edit frame-local (nil means global, otherwise supply a specific frame)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;args&lt;/code&gt; - the individual properties to set, in the form &lt;code&gt;:property new-value&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In your example, you want to edit &lt;code&gt;dired-mark-face&lt;/code&gt; to make it a different colour, and you want the change to be global:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'diredp-flag-mark nil &#xA;                    :foreground &quot;white&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can view the full documentation &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html&quot; rel=&quot;nofollow&quot;&gt;here.&lt;/a&gt; There are also standalone commands to set individual face attributes, such as &lt;code&gt;set-face-foreground&lt;/code&gt;. You can view them &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Attribute-Functions.html&quot; rel=&quot;nofollow&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you see a font you would like to change, you can get information about it by hovering over it and calling the command &lt;code&gt;M-x describe-face&lt;/code&gt;. The prompt will default to the face under point. You can also get more verbose information by calling &lt;code&gt;M-x what-cursor-position&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2016-09-06T19:40:08.737" LastActivityDate="2016-09-06T19:40:08.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26610" PostTypeId="1" CreationDate="2016-08-26T16:05:53.040" Score="7" ViewCount="1832" Body="&lt;p&gt;Suppose I want to be reminded to water my plants on Monday, Wednesday, and Friday, AND on any of the following days, if for some reason I miss the scheduled days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I originally tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** water plants (1,3,5)&#xA;    SCHEDULED: &amp;lt;2016-08-29 Mon ++1w&amp;gt;&amp;lt;2016-08-31 Wed ++1w&amp;gt;&amp;lt;2016-08-26 Fri ++1w&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not work -- only the first timestamp is scheduled. The other two are treated as regular timestamps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried the following, and it does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** water plants (1,3,5)&#xA;    SCHEDULED: &amp;lt;2016-08-29 Mon ++1w&amp;gt;&#xA;    SCHEDULED: &amp;lt;2016-08-31 Wed ++1w&amp;gt;&#xA;    SCHEDULED: &amp;lt;2016-08-26 Fri ++1w&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Eventually, I tried this, and it worked:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** water plants (1,3,5)&#xA;&#xA;**** RECURRING water plants (1)&#xA;     SCHEDULED: &amp;lt;2016-08-29 Mon ++1w&amp;gt;&#xA;**** RECURRING water plants (3)&#xA;     SCHEDULED: &amp;lt;2016-08-31 Wed ++1w&amp;gt;&#xA;**** RECURRING water plants (5) &#xA;     SCHEDULED: &amp;lt;2016-08-26 Fri ++1w&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All three occurrences now show up on my agenda. However, this solution seems very inelegant, and perhaps may be problematic. Is there a neater, more effective way to do achieve the same result?&lt;/p&gt;&#xA;" OwnerUserId="13087" LastEditorUserId="13087" LastEditDate="2016-08-26T17:19:19.957" LastActivityDate="2018-05-21T00:42:28.010" Title="Multiple Scheduled Timestamps for One Task" Tags="|org-mode|org-agenda|time-date|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26611" PostTypeId="2" ParentId="26602" CreationDate="2016-08-26T16:37:17.740" Score="1" Body="&lt;p&gt;Switch to the desired directory in dired, and type &lt;kbd&gt;C-u s R RET t&lt;/kbd&gt;. This should mark all files in that directory, including it's subdirectories.  Then enter &lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt; with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xxx -&amp;gt; \,(if (nth 3 (syntax-ppss)) &quot;yyy&quot; \&amp;amp;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as &lt;code&gt;regexp -&amp;gt; replacement&lt;/code&gt; input.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2016-08-26T20:46:14.210" LastActivityDate="2016-08-26T20:46:14.210" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26613" PostTypeId="1" AcceptedAnswerId="26638" CreationDate="2016-08-26T17:19:35.807" Score="16" ViewCount="5494" Body="&lt;p&gt;Is it possible to insert images directly from the web with its url in &lt;code&gt;org-mode&lt;/code&gt;? i.e. Can I paste something like this into emacs' buffer, so that it changes into the image of a cat in the link in &lt;code&gt;image mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[https://d1ra4hr810e003.cloudfront.net/media/27FB7F0C-9885-42A6-9E0C19C35242B5AC/0/D968A2D0-35B8-41C6-A94A0C5C5FCA0725/F0E9E3EC-8F99-4ED8-A40DADEAF7A011A5/dbe669e9-40be-51c9-a9a0-001b0e022be7/thul-IMG_2100.jpg]] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It just makes it a clickable link in my current settings.&lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="10707" LastEditDate="2016-08-26T20:26:57.260" LastActivityDate="2020-03-29T02:21:10.650" Title="Is it possible to insert images from the web with its url?" Tags="|org-mode|image-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26615" PostTypeId="1" CreationDate="2016-08-26T20:57:31.693" Score="7" ViewCount="724" Body="&lt;p&gt;When I create a new yasnippet template using the 'yas-new-snippet' command, I'm unable to get the leading whitespace to show when the template is expanded in a new document or even tested using 'yas-tryout-snippet'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;interface t1 &#xA;    description &#xA;    no shutdown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;interface t1 &#xA;description &#xA;no shutdown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get the leading whitespace to show when I expand?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The snippet is saved as text-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs24 with a new installation of Yasnippet from MELPA.&lt;/p&gt;&#xA;" OwnerUserId="13117" LastEditorUserId="13117" LastEditDate="2016-08-26T21:07:07.567" LastActivityDate="2016-08-26T22:55:52.210" Title="How to put whitespace into Yasnippet Templates?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26616" PostTypeId="1" AcceptedAnswerId="26619" CreationDate="2016-08-26T22:53:27.107" Score="18" ViewCount="15550" Body="&lt;p&gt;I'm new to Emacs, and am using a Mac.  I want the Mac &lt;code&gt;command&lt;/code&gt; key to act as a &lt;code&gt;control&lt;/code&gt; key for Emacs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I do that?&lt;/strong&gt;  I tried &lt;code&gt;(setq mac-command-modifier 'control)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, how do I find key variable and local key names in Emacs?  For example: how can I find that &lt;code&gt;mac-command-modifier&lt;/code&gt; is the command key name?&lt;/p&gt;&#xA;" OwnerUserId="11182" LastEditorUserId="253" LastEditDate="2016-08-26T23:13:38.220" LastActivityDate="2019-09-24T17:50:20.527" Title="How to use a Mac's Command key as a Control key?" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26617" PostTypeId="2" ParentId="26615" CreationDate="2016-08-26T22:55:52.210" Score="8" Body="&lt;p&gt;Use the &lt;code&gt;expand-env&lt;/code&gt; directive, as described in the &lt;a href=&quot;http://joaotavora.github.io/yasnippet/snippet-development.html#sec-2-5&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-08-26T22:55:52.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26618" PostTypeId="2" ParentId="26613" CreationDate="2016-08-26T23:06:56.830" Score="3" Body="&lt;p&gt;Not within the Org buffer itself, as far as I know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you export to HTML, however, &lt;a href=&quot;http://orgmode.org/manual/External-links.html&quot; rel=&quot;nofollow&quot;&gt;links to images will be converted into images&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the description is a file name or URL that points to an image, HTML export (see HTML export) will inline the image as a clickable button. If there is no description at all and the link points to an image, that image will be inlined into the exported HTML file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-08-26T23:06:56.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26619" PostTypeId="2" ParentId="26616" CreationDate="2016-08-26T23:10:35.383" Score="26" Body="&lt;p&gt;The EmacsWiki node on&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsForMacOS&quot; rel=&quot;noreferrer&quot;&gt;Emacs for Mac OS&lt;/a&gt;&#xA;will give you advice on a number of OSX-specific issues.  More specific to your question, you can adjust the&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsForMacOS#toc24&quot; rel=&quot;noreferrer&quot;&gt;modifier keys&lt;/a&gt;&#xA;as you like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mac-function-modifier&#xA;mac-control-modifier&#xA;mac-command-modifier&#xA;mac-option-modifier&#xA;mac-right-command-modifier&#xA;mac-right-control-modifier&#xA;mac-right-option-modifier&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Aside: you might see these as &lt;code&gt;ns-&lt;/code&gt; in place of &lt;code&gt;mac-&lt;/code&gt; in some&#xA;places.  The &lt;code&gt;ns-&lt;/code&gt;, I believe, is referring to&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/NeXTSTEP&quot; rel=&quot;noreferrer&quot;&gt;NeXTSTEP&lt;/a&gt;, one of the&#xA;sources for OSX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be fine with your setup to make Emacs interpret the&#xA;&lt;kbd&gt;command&lt;/kbd&gt; key as &lt;kbd&gt;control&lt;/kbd&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mac-command-modifier 'control)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put that in your&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;init&lt;/code&gt; file&lt;/a&gt;&#xA;and it should take effect the next time you start Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For keybindings, the first stop is the Emacs manual node on&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Key-Bindings.html&quot; rel=&quot;noreferrer&quot;&gt;Customizing Key Bindings&lt;/a&gt;.&#xA;Another good resource is Mickey Petersen's&#xA;&lt;a href=&quot;https://www.masteringemacs.org/article/mastering-key-bindings-emacs&quot; rel=&quot;noreferrer&quot;&gt;Mastering Key Bindings in Emacs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-08-26T23:10:35.383" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26621" PostTypeId="2" ParentId="26602" CreationDate="2016-08-27T06:55:43.987" Score="1" Body="&lt;p&gt;If the files to search are not in the same Dired buffer (same directory listing or included subdir listings), but are in a directory tree (a directory and its subdirectories, recursively) then you can use command &lt;strong&gt;&lt;code&gt;diredp-do-query-replace-regexp-recursive&lt;/code&gt;&lt;/strong&gt; from library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Dired+&lt;/strong&gt;&lt;/a&gt;. It is a super version of &lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt; (see @politza's answer, and below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f diredp-do-query-replace-regexp-recursive&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;diredp-do-query-replace-regexp-recursive&lt;/code&gt;&lt;/strong&gt; is an interactive Lisp&#xA;      function in &lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(diredp-do-query-replace-regexp-recursive FROM TO &amp;amp;optional ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Do &lt;code&gt;query-replace-regexp&lt;/code&gt; on marked files, including in marked subdirs.&#xA;  Query-replace &lt;code&gt;FROM&lt;/code&gt; with &lt;code&gt;TO&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Like &lt;code&gt;dired-do-query-replace&lt;/code&gt;, but act recursively on subdirs.&#xA;      The files included are those that are marked in the current Dired&#xA;      buffer, or all files in the directory if none are marked.  Marked&#xA;      subdirectories are handled recursively in the same way.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With an (explicit) numeric prefix argument:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;&gt;= 0 means ignore all marks - include ALL files in this Dired buffer&#xA;    and all subdirs, recursively.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;&amp;lt;= 0 means replace only word-delimited matches.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;If you exit (&lt;code&gt;C-g&lt;/code&gt;, &lt;code&gt;RET&lt;/code&gt; or &lt;code&gt;q&lt;/code&gt;), you can resume the query replacement&#xA;      using &lt;code&gt;M-,&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In addition, if you use &lt;strong&gt;Dired+&lt;/strong&gt; then standard command &lt;strong&gt;&lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt;&lt;/strong&gt; is also enhanced to perform different behaviors, depending on a prefix argument:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;dired-do-query-replace-regexp&lt;/code&gt;&lt;/strong&gt; is an interactive Lisp function in&#xA;      &lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;Q&lt;/code&gt;, &lt;code&gt;menu-bar operate search query-replace&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(dired-do-query-replace-regexp FROM TO &amp;amp;optional ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Do &lt;code&gt;query-replace-regexp&lt;/code&gt; of &lt;code&gt;FROM&lt;/code&gt; with &lt;code&gt;TO&lt;/code&gt;, on all marked files.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;NOTE: A prefix arg for this command acts differently than for other&#xA;      commands, so that you can use it to request word-delimited matches.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With a prefix argument:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;An odd number of plain &lt;code&gt;C-u&lt;/code&gt;: act on the marked files, but replace&#xA;     only word-delimited matches.&lt;/li&gt;&#xA;  &lt;li&gt;More than one plain &lt;code&gt;C-u&lt;/code&gt;: act on all files, ignoring whether any&#xA;     are marked.&lt;/li&gt;&#xA;  &lt;li&gt;Any other prefix arg: Act on the next numeric-prefix files.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;So for example:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;code&gt;C-u C-u C-u&lt;/code&gt;: act on all files, replacing word-delimited matches.&lt;/li&gt;&#xA;  &lt;li&gt;&lt;code&gt;C-u 4&lt;/code&gt;: act on the next 4 files.  &lt;code&gt;C-4&lt;/code&gt; means the same thing.&lt;/li&gt;&#xA;  &lt;li&gt;&lt;code&gt;C-u&lt;/code&gt;: act on the marked files, replacing word-delimited matches.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;If you exit (&lt;code&gt;C-g&lt;/code&gt;, &lt;code&gt;RET&lt;/code&gt; or &lt;code&gt;q&lt;/code&gt;), you can resume the query replace&#xA;      with the command &lt;code&gt;M-,&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To preserve case when replacing, as you requested, ensure that option &lt;code&gt;case-fold-search&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt;.  See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Replacement-and-Case.html&quot; rel=&quot;nofollow&quot;&gt;Replacement and Case&lt;/a&gt;, for more information about this.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-27T07:20:40.183" LastActivityDate="2016-08-27T07:20:40.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26622" PostTypeId="1" CreationDate="2016-08-27T07:45:15.240" Score="2" ViewCount="249" Body="&lt;p&gt;I work a lot these-days with &lt;code&gt;org-reveal&lt;/code&gt; to create presentations for some of my classes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each time to see what I've changed and how it would look, I need to manually export using &lt;code&gt;C-e R R&lt;/code&gt;. Is there a way to auto export the current org file to a reveal html file of the same name when I save manually? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the manual save methods is to difficult, I wouldn't mind automatically exporting every X minutes.&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="2277" LastEditDate="2018-01-28T23:22:49.217" LastActivityDate="2018-01-28T23:22:49.217" Title="auto export to org-reveal manual save?" Tags="|org-mode|org-reveal|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26623" PostTypeId="1" AcceptedAnswerId="26630" CreationDate="2016-08-27T11:28:52.733" Score="4" ViewCount="266" Body="&lt;p&gt;I am using a &lt;code&gt;%^T&lt;/code&gt; element in my &lt;code&gt;org-capture-template&lt;/code&gt;. This prompts me this need calendar buffer, where I can pick a date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can move around by using &lt;code&gt;SHIFT+&amp;lt;arrow&amp;gt;&lt;/code&gt;. It maps to &lt;code&gt;calendar-forward-day&lt;/code&gt;. How can I change the time in this view?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something similar like &lt;code&gt;add one hour&lt;/code&gt; or &lt;code&gt;set minutes to 00&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2016-08-27T14:37:53.343" Title="Change the time when picking a date?" Tags="|org-mode|org-capture|calendar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26624" PostTypeId="1" AcceptedAnswerId="26775" CreationDate="2016-08-27T11:29:53.613" Score="1" ViewCount="255" Body="&lt;p&gt;I have been trying around getting one keybinding &lt;code&gt;&amp;lt;F7&amp;gt;&lt;/code&gt; to perform one &lt;code&gt;gud-step&lt;/code&gt; command if a debugging process is running. If it is not running it shall perform &lt;code&gt;gud-run&lt;/code&gt;.&#xA;I am not very familiar with gdb/gud yet, so while trying to get &lt;code&gt;gdb-running&lt;/code&gt; to work as a condition for my defun I am exposed to lisp argument errors, that 2 arguments are required (string-or-char-p and nil), where the first argument is a token, as it seems.&#xA;In the end my goal is to use &lt;code&gt;&amp;lt;F7&amp;gt;&lt;/code&gt; to invoke a &lt;code&gt;gud-run&lt;/code&gt; and to step-through with the same key afterwards, after reaching a breakpoint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following snippet is my first attempt. It becomes obvious that &lt;code&gt;gdb-running&lt;/code&gt; is missing 2 arguments as aforementioned.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'gud)&#xA;(defun my-gud-run-or-step ()&#xA;  (interactive)&#xA;  (if (gdb-running)&#xA;      (gud-step nil)&#xA;    (gud-run nil)))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f7&amp;gt;&quot;) 'my-gud-run-or-step)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13120" LastEditorUserId="9995" LastEditDate="2016-08-28T07:43:00.927" LastActivityDate="2016-09-02T06:22:39.853" Title="Conditional Keybinding for gdb: gud-step if debugging, otherwise gud-run" Tags="|gud|gdb|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26625" PostTypeId="2" ParentId="26622" CreationDate="2016-08-27T12:05:48.477" Score="2" Body="&lt;p&gt;You can adapt this, which does the same for LaTeX. I don't active this globally, but occasionally turn it on for a buffer. It should probably be improved to only operate on the local buffer. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Export to LaTeX when saving&#xA;#+BEGIN_SRC emacs-lisp :results none&#xA;(defun kdm/org-save-and-export ()&#xA;  (interactive)&#xA;  (if (eq major-mode 'org-mode)&#xA;    (org-latex-export-to-latex)))&#xA;(add-hook 'after-save-hook 'kdm/org-save-and-export nil t)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-08-27T12:05:48.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26626" PostTypeId="2" ParentId="26347" CreationDate="2016-08-27T12:29:52.717" Score="1" Body="&lt;p&gt;upgrade to evil-matchit 2.1.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a bug in 2.1.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setup is not necessary. It works out of box now.&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-08-27T12:29:52.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26627" PostTypeId="2" ParentId="19560" CreationDate="2016-08-27T13:29:12.620" Score="2" Body="&lt;p&gt;This is a Mac specific approach that I use. You might be able to adapt it to the grab.app. I am not familiar with that app though.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; adapted from [[https://vmtyler.com/applescript-markdown-ready-screenshots/][AppleScript Markdown-Ready Screenshots | VMTyler.com]]&#xA;(defun screenshot (&amp;amp;optional arg)&#xA;  &quot;Take a screenshot and insert org link.&#xA;with prefix arg, minimize emacs first.&#xA;Only works on Mac OSX.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (when arg&#xA;    (suspend-frame))&#xA;&#xA;  (unless (f-directory? &quot;screenshots&quot;)&#xA;    (make-directory &quot;screenshots&quot;))&#xA;  (sit-for 0.2)&#xA;&#xA;  (let ((fname (concat (format-time-string &quot;date-%d-%m-%Y-time-%H-%M-%S&quot; (current-time)) &quot;.png&quot;)))&#xA;    (do-applescript&#xA;     (mapconcat&#xA;      'identity &#xA;      (list (format &quot;set screenshotFilePath to \&quot;%s\&quot;&quot; (expand-file-name fname &quot;screenshots&quot;))&#xA;        &quot;do shell script \&quot;screencapture \&quot; &amp;amp; \&quot;-s\&quot; &amp;amp; \&quot; \&quot; &amp;amp; quoted form of screenshotFilePath&quot;&#xA;        (concat &quot;set result to \&quot;[[./&quot; fname &quot;]]\&quot;&quot;)&#xA;        &quot;set the clipboard to result&quot;)&#xA;      &quot;\n&quot;))&#xA;    (insert (format &quot;\n\n#+attr_org: :width 300\n[[./%s]]\n\n&quot; (concat &quot;screenshots/&quot; fname)))&#xA;    (org-redisplay-inline-images)&#xA;    (raise-frame)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-27T13:29:12.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26628" PostTypeId="2" ParentId="22574" CreationDate="2016-08-27T14:13:50.403" Score="4" Body="&lt;p&gt;Try something like this. Put this code block in your document, and run it. The LaTeX will be in a buffer &lt;em&gt;Org LATEX Export&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* build :noexport:&#xA;#+BEGIN_SRC emacs-lisp&#xA;(defun delete-org-comments (backend)&#xA;  (loop for comment in (reverse (org-element-map (org-element-parse-buffer)&#xA;                    'comment 'identity))&#xA;    do&#xA;    (setf (buffer-substring (org-element-property :begin comment)&#xA;                (org-element-property :end comment))&#xA;          &quot;&quot;)))&#xA;&#xA;(let ((org-export-before-processing-hook '(delete-org-comments)))&#xA;  (switch-to-buffer (org-latex-export-as-latex)))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-27T14:13:50.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26629" PostTypeId="2" ParentId="26179" CreationDate="2016-08-27T14:19:41.587" Score="3" Body="&lt;p&gt;Depending on how much modification of the exported LaTeX you need, you might be able to use a filter, e.g. if all you need to do is wrap the latex in some additional LaTeX: &lt;a href=&quot;http://orgmode.org/worg/exporters/filter-markup.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/exporters/filter-markup.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the changes are more complex, it sounds like you need a custom exporter, eg &lt;a href=&quot;http://orgmode.org/worg/dev/org-export-reference.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/worg/dev/org-export-reference.html&lt;/a&gt; where you could define a function that generates the latex code you want for a table.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-27T14:19:41.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26630" PostTypeId="2" ParentId="26623" CreationDate="2016-08-27T14:37:53.343" Score="9" Body="&lt;p&gt;You can just type a time, eg 9am, or 1:30pm in the minibuffer.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-27T14:37:53.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26631" PostTypeId="1" AcceptedAnswerId="26635" CreationDate="2016-08-27T15:56:56.803" Score="4" ViewCount="1872" Body="&lt;p&gt;I installed magit, and it appears to have come with documentation I can access in info-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; cd ~/emacs.d/elpa&#xA;&amp;gt; ls -1 magit-2.8.0/{dir,*.info*}&#xA;magit-2.8.0/dir&#xA;magit-2.8.0/magit.info&#xA;magit-2.8.0/magit.info-1&#xA;magit-2.8.0/magit.info-2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run &lt;code&gt;info&lt;/code&gt; in emacs, I don't see any entry for Magit in the directory. I've also tried running &lt;code&gt;info-apropos&lt;/code&gt; to search for magit, and found nothing. What do I need to do to get it to show up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;use-package&lt;/code&gt;, if that's significant:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package magit&#xA;  :load-path (&quot;elpa/magit-2.8.0&quot;&#xA;              &quot;elpa/with-editor-2.5.2&quot;&#xA;              &quot;elpa/git-commit-2.8.0&quot;&#xA;              &quot;elpa/magit-popup-2.8.0&quot;)&#xA;  :config&#xA;  (setq vc-handled-backends (delq 'Git vc-handled-backends)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm also using the newest version of Emacs I could find, GNU Emacs 25.1.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However&lt;/em&gt;, I've intentionally avoided calling &lt;code&gt;package-initialize&lt;/code&gt; in my init.el except as needed (e.g. when installing new packages), which is why I'm specifying a load-path in the &lt;code&gt;use-package&lt;/code&gt; declaration above. Maybe that's related; I'm pretty sure &lt;code&gt;package-initialize&lt;/code&gt; populates the load-path so packages can be found -- does it also populate &lt;code&gt;Info-directory-list&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-08-27T21:02:54.567" LastActivityDate="2016-08-27T21:02:54.567" Title="How do I access a package's info manual?" Tags="|package|use-package|info|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26632" PostTypeId="2" ParentId="26602" CreationDate="2016-08-27T16:33:31.070" Score="0" Body="&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Isearch+&lt;/strong&gt;&lt;/a&gt;, including &lt;a href=&quot;https://www.emacswiki.org/emacs/download/isearch-prop.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; then you can use command &lt;strong&gt;&lt;code&gt;isearchp-thing&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;isearchp-thing-regexp&lt;/code&gt;&lt;/strong&gt; to search only within the contexts of strings, by entering &lt;strong&gt;&lt;code&gt;string&lt;/code&gt;&lt;/strong&gt; at the prompt for the thing type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While searching incrementally, you can replace the current search hit using &lt;strong&gt;&lt;code&gt;C-M-RET&lt;/code&gt;&lt;/strong&gt;. You can change the replacement text anytime using &lt;strong&gt;&lt;code&gt;C-u&lt;/code&gt;&lt;/strong&gt; &lt;code&gt;C-M-RET&lt;/code&gt;. And the replacement text can be interpreted as in &lt;code&gt;query-replace-regexp&lt;/code&gt;. In the latter case, you can use &lt;code&gt;\&amp;amp;&lt;/code&gt;, &lt;code&gt;\=\N&lt;/code&gt;, &lt;code&gt;\#&lt;/code&gt;, and &lt;code&gt;\,&lt;/code&gt;.  (&lt;code&gt;C-M--&lt;/code&gt; toggles whether replacement respects these constructs or is literal.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Isearch+ you can also limit any incremental search to the active region. So for example, you can search only within strings, and only those strings that are in the active region. You can use &lt;code&gt;C-x n&lt;/code&gt; during search to toggle whether the active region restricts search scope.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These commands are only for the current buffer, but with &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;Dired+&lt;/a&gt; you can use &lt;code&gt;M+-F&lt;/code&gt; (&lt;code&gt;diredp-do-find-marked-files-recursive&lt;/code&gt;) in Dired to open all marked files, including in marked subdirectories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus#isearchp-replace-on-demand&quot; rel=&quot;nofollow&quot;&gt;More information.&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-08-27T16:47:55.800" LastActivityDate="2016-08-27T16:47:55.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26634" PostTypeId="2" ParentId="26602" CreationDate="2016-08-27T16:58:18.280" Score="0" Body="&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Icicles&lt;/strong&gt;&lt;/a&gt; then, similarly to &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow&quot;&gt;Isearch+&lt;/a&gt;, you can search-and-replace incrementally within only strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like Isearch+, you can change the replacement text anytime, and it can make use of query-replace-regexp constructs like &lt;code&gt;\&amp;amp;&lt;/code&gt;, &lt;code&gt;\=\N&lt;/code&gt;, &lt;code&gt;\#&lt;/code&gt;, and &lt;code&gt;\,&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike Isearch+, you can narrow the search contexts incrementally, by typing a pattern to match on the fly. And unlike &lt;code&gt;isearchp-thing(-regexp)&lt;/code&gt;, you can search multiple files or buffers at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Search and replacement are each direct-access: you can visit particular search hits selectively, and selectively choose any of them to replace. You can also visit any number of them in sequence, and you can change the sequence sort order (i.e., not just buffer-occurrence order).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search-And-Replace&quot; rel=&quot;nofollow&quot;&gt;Icicles - Search and Replace&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-27T16:58:18.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26635" PostTypeId="2" ParentId="26631" CreationDate="2016-08-27T17:09:49.340" Score="3" Body="&lt;p&gt;Add the directory containing the &lt;code&gt;*.info&lt;/code&gt; files to &lt;code&gt;Info-directory-list&lt;/code&gt;, using &lt;code&gt;add-to-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it provides an Info manual, the package should have taken care of this for you.  Node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Multi_002dfile-Packages.html&quot; rel=&quot;nofollow&quot;&gt;Multi-File Packages&lt;/a&gt; of the Elisp manual says this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the content directory contains a file named &lt;code&gt;dir&lt;/code&gt;, this is assumed&#xA;  to be an Info directory file made with &lt;code&gt;install-info&lt;/code&gt;.  *Note Invoking&#xA;  install-info: (texinfo)Invoking install-info.  The relevant Info files&#xA;  should also be present in the content directory.  In this case, Emacs&#xA;  will automatically add the content directory to &lt;strong&gt;&lt;code&gt;Info-directory-list&lt;/code&gt;&lt;/strong&gt;&#xA;  when the package is activated.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-08-27T17:09:49.340" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26636" PostTypeId="1" AcceptedAnswerId="26639" CreationDate="2016-08-27T17:45:03.303" Score="0" ViewCount="85" Body="&lt;p&gt;I am using js-mode in emacs 25.1. There are some indentation rules that are not editable through the provided customization variables. The specific one I have issue with is the indentation of arrow functions, they are not indented like regular anonymous functions. After looking at the function js--proper-indentation, the only way to edit it is to redefine the function. Should I redefine it in my js-mode-hook?&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="12195" LastEditDate="2016-08-27T21:09:05.527" LastActivityDate="2016-08-27T21:09:05.527" Title="What is the best way to redefine the indentation rules of a major mode" Tags="|indentation|advice|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26638" PostTypeId="2" ParentId="26613" CreationDate="2016-08-27T18:20:31.260" Score="12" Body="&lt;p&gt;It is possible with a little code. I would define a new link like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(org-add-link-type&#xA; &quot;image-url&quot;&#xA; (lambda (path)&#xA;   (let ((img (expand-file-name&#xA;           (concat (md5 path) &quot;.&quot; (file-name-extension path))&#xA;           temporary-file-directory)))&#xA;     (if (file-exists-p img)&#xA;     (find-file img)&#xA;       (url-copy-file path img)&#xA;       (find-file img)))))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you click on it, you should get a cat in image mode. I didn't define export functions though. Also, the image is downloaded as a tempfile, which may or may not be convenient for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use it like this:&lt;br&gt;&#xA;&lt;code&gt;[[image-url:https://d1ra4hr810e003.cloudfront.net/media/27FB7F0C-9885-42A6-9E0C19C35242B5AC/0/D968A2D0-35B8-41C6-A94A0C5C5FCA0725/F0E9E3EC-8F99-4ED8-A40DADEAF7A011A5/dbe669e9-40be-51c9-a9a0-001b0e022be7/thul-IMG_2100.jpg]]&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can use these two functions to overlay or remove an image:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun image-url-overlays ()&#xA;  &quot;Put image overlays on remote image urls.&quot;&#xA;  (interactive)&#xA;  (loop for image-url in (org-element-map (org-element-parse-buffer) 'link&#xA;               (lambda (link)&#xA;                 (when (string= &quot;image-url&quot; (org-element-property :type link))&#xA;                   link)))&#xA;    do&#xA;    (let* ((path (org-element-property :path image-url))&#xA;           (ov (make-overlay (org-element-property :begin image-url)&#xA;                 (org-element-property :end image-url)))&#xA;           (img (create-image (expand-file-name&#xA;                   (concat (md5 path)&#xA;                       &quot;.&quot;&#xA;                       (file-name-extension&#xA;                        path))&#xA;                   temporary-file-directory))))&#xA;      (overlay-put ov 'display img)&#xA;      (overlay-put ov 'image-url t))))&#xA;&#xA;(defun image-url-clear-overlays ()&#xA;  &quot;Reove overlays on image-urls.&quot;&#xA;  (interactive)&#xA;  (require 'ov)&#xA;  (ov-clear 'image-url))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This downloads the image as a tempfile if it doesn't exist, and then puts an overlay on the link.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="15177" LastEditDate="2020-03-29T02:21:10.650" LastActivityDate="2020-03-29T02:21:10.650" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="26639" PostTypeId="2" ParentId="26636" CreationDate="2016-08-27T19:37:23.930" Score="1" Body="&lt;p&gt;You will probably want to use &lt;code&gt;defadvice&lt;/code&gt; to provide a wrapper around &lt;code&gt;js--proper-indentation&lt;/code&gt;, rather than cometely redefining it. This will allow you to handle the indentation for arrow functions yourself, while calling through to the original function to handle everything else.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-08-27T19:37:23.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26640" PostTypeId="1" CreationDate="2016-08-27T20:50:08.300" Score="1" ViewCount="128" Body="&lt;p&gt;In .org files—I've seen it only in a file with over 1k lines—emacs sometimes displays a secondary &quot;line number&quot; next to certain headings, like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6grTU.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The left-most gutter is populated by linum+, but the digit 8 on line 7 is what confuses me. The heading has no contents, just an empty line (line 8).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the extra / floating digit gives the &lt;em&gt;final&lt;/em&gt; line number of the collapsed heading...but what caused the number to show up in the first place? What mode is this coming from? Why doesn't it happen to all headings? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so on. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13125" LastActivityDate="2016-08-27T20:50:08.300" Title="Unexpected &quot;secondary&quot; line number labels in org-mode" Tags="|org-mode|linum-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26642" PostTypeId="1" CreationDate="2016-08-28T09:19:39.983" Score="1" ViewCount="127" Body="&lt;p&gt;I'm running Emacs 24.5.1 as a daemon on Fedora 24 with GNOME 3.20, and am encountering a strange behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With two frames, &lt;code&gt;F1&lt;/code&gt; (the initial frame) and &lt;code&gt;G1&lt;/code&gt; (the created frame), if &lt;code&gt;G1&lt;/code&gt; is iconified with &lt;code&gt;iconify-or-deiconify-frame&lt;/code&gt;, then raised again with &lt;code&gt;(raise-frame (selected-frame))&lt;/code&gt;, &lt;code&gt;G1&lt;/code&gt; does not appear in &lt;code&gt;(visible-frame-list)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this is probably a GNOME problem, but I'm curious as to whether others have come across it.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-08-28T09:19:39.983" Title="`raise-frame` not adding frame to `(visible-frame-list)`" Tags="|frames|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26644" PostTypeId="2" ParentId="19070" CreationDate="2016-08-28T14:23:42.873" Score="1" Body="&lt;p&gt;Download CC Mode 5.33 which is available at &lt;a href=&quot;http://cc-mode.sourceforge.net/release.php&quot; rel=&quot;nofollow&quot;&gt;http://cc-mode.sourceforge.net/release.php&lt;/a&gt;.  It solves this bug (amongst many others).&lt;/p&gt;&#xA;" OwnerUserId="13130" LastActivityDate="2016-08-28T14:23:42.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26645" PostTypeId="1" CreationDate="2016-08-28T16:26:51.337" Score="3" ViewCount="433" Body="&lt;p&gt;I am getting an indentation error in the Python interpreter while using elpy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; for i in range(1, 3):&#xA;...     print(i)&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1&#xA;    print(i)&#xA;    ^&#xA;IndentationError: unexpected indent&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried with manually typing 4 spaces to ensure it wasn't the tab key. It seems as if the interpreter is getting some extra whitespace from the buffer but I am not sure. What could be causing this?&lt;/p&gt;&#xA;" OwnerUserId="13132" LastActivityDate="2016-08-28T16:26:51.337" Title="Unexpected Indentation in Python interpreter" Tags="|python|elpy|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26647" PostTypeId="1" AcceptedAnswerId="26649" CreationDate="2016-08-28T18:14:52.850" Score="1" ViewCount="227" Body="&lt;p&gt;In response to a &lt;a href=&quot;https://emacs.stackexchange.com/questions/26579/&quot;&gt;question about adding an action to magit's push menu&lt;/a&gt;, I've written an Emacs Lisp command to implement the extension, and I've learned that I can extend the push menu by calling &lt;code&gt;magit-define-popup-action&lt;/code&gt;.  &lt;strong&gt;However&lt;/strong&gt;, not every repository supports the new action.  I've defined another Emacs Lisp function that will tell me, in a particular repository, whether the action is supported.  I want to define a new popup action only when the action is supported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a hook or other trick I can use to define the new popup action only on those repositories where the action is supported?  Or some other conditional code I can arrange for so that the menu knows, in a way sensitive to a particular repository, whether the action is enabled?  I know for example that &lt;kbd&gt;P p&lt;/kbd&gt; and &lt;kbd&gt;P u&lt;/kbd&gt; change their descriptions depending on settings in the git configuration, but I don't see how that is done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally if the action is not supported, there is no change of setting that can make it supported, and I'd prefer not to have the item on the menu.  But I'd settle for a way to give a description saying the action is unavailable.  And bonus points if I can &quot;gray it out.&quot;&lt;/p&gt;&#xA;" OwnerUserId="9343" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2019-03-18T19:26:49.590" Title="How to customize a magit popup, conditionally on the state of the repository?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26649" PostTypeId="2" ParentId="26647" CreationDate="2016-08-28T21:25:30.313" Score="1" Body="&lt;p&gt;You can do this simply by using a function instead of a string as &quot;description&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-action 'magit-push-popup ?!&#xA;  (lambda ()&#xA;    (and PREDICATE&#xA;         &quot;Make remotely\n&quot;))&#xA;  'aec/ssh-make-and-fetch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function has to return nil to indicate that the action should not be available or else it has to return the string to be inserted into the popup buffer to describe what the action does.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-08-28T22:55:39.613" LastActivityDate="2016-08-28T22:55:39.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26650" PostTypeId="2" ParentId="26555" CreationDate="2016-08-28T22:05:22.633" Score="1" Body="&lt;p&gt;I know @Michael Albinus has not been able to reproduce this, but I landed here  because I see the same behavior as @Rishab.  (I also wasn't subscribed to tramp-devel so cannot reply to messages there.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have these lines in my .emacs file, tramp fails:&#xA;&lt;code&gt;&#xA;(require 'ess)&#xA;(require 'ess-site)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is commit &lt;a href=&quot;https://github.com/emacs-ess/ESS/commit/6892dd29417e1541bea267434804c4f8f23b1ea4&quot; rel=&quot;nofollow&quot;&gt;ess@6892dd2&lt;/a&gt; that first causes TRAMP to hang with the message &lt;code&gt;&quot;Tramp: Sending password&quot;&lt;/code&gt;.  In fact, only the change to &lt;code&gt;add-hook&lt;/code&gt; is necessary to cause the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;-(add-hook 'hack-local-variables-hook 'ess-r-package-auto-activate)&#xA;+(add-hook 'after-change-major-mode-hook 'ess-r-package-auto-activate)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not have further info on why this change causes a problem.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;edit: &lt;a href=&quot;https://github.com/emacs-ess/ESS/issues/364&quot; rel=&quot;nofollow&quot;&gt;Issue #364&lt;/a&gt; submitted.&lt;/p&gt;&#xA;" OwnerUserId="13127" LastEditorUserId="13127" LastEditDate="2016-08-29T05:35:07.847" LastActivityDate="2016-08-29T05:35:07.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26651" PostTypeId="1" AcceptedAnswerId="26652" CreationDate="2016-08-28T22:06:05.580" Score="1" ViewCount="165" Body="&lt;p&gt;I'd like to use &lt;code&gt;visual-line-mode&lt;/code&gt; in the &lt;code&gt;*Messages*&lt;/code&gt; buffer. I can switch to that buffer and run &lt;code&gt;M-x visual-line-mode&lt;/code&gt;, but I want to configure it automatically. I've tried adding this to my init.el, but it's not taking effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'messages-buffer-mode-hook #'visual-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've also tried this, hoping it would apply &lt;code&gt;visual-line-mode&lt;/code&gt; to &lt;code&gt;*Messages*&lt;/code&gt; and &lt;code&gt;*Warnings*&lt;/code&gt;, but again, no luck:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'special-mode-hook #'visual-line-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe it's adding the hook after the messages buffer has already been initialized? Is there a correct way to do this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-08-28T22:48:41.903" Title="How to make *Messages* use visual-line-mode?" Tags="|hooks|visual-line-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26652" PostTypeId="2" ParentId="26651" CreationDate="2016-08-28T22:48:41.903" Score="5" Body="&lt;p&gt;None of those hooks will apply because the buffer (and its mode) has already been created long before your &lt;code&gt;add-hook&lt;/code&gt; happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;*Messages*&quot;&#xA;  (visual-line-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;code&gt;~/.emacs&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-28T22:48:41.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26653" PostTypeId="2" ParentId="26574" CreationDate="2016-08-28T22:59:36.897" Score="1" Body="&lt;p&gt;You might be able to tweak &lt;code&gt;ask-user-about-supersession-threat&lt;/code&gt; to just call &lt;code&gt;set-visited-file-modtime&lt;/code&gt; when the buffer and the file have the same contents, so that Emacs refreshes its notion of &quot;which was the state of the file when I read it&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Checking &quot;same contents&quot; basically involves saving the buffer into an auxiliary file, and then comparing the two files (or loading the file into a new buffer and comparing the two buffers).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-28T22:59:36.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26654" PostTypeId="2" ParentId="26574" CreationDate="2016-08-28T23:37:07.577" Score="1" Body="&lt;p&gt;@Stefan's answer solved it, I'm just adding the details. I'm using the following modification of &lt;code&gt;compare-buffer-with-file&lt;/code&gt; from the &lt;a href=&quot;https://emacs.stackexchange.com/q/21137/13045&quot;&gt;related question&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-restriction&#xA;  (widen)&#xA;  (let ((original-buffer (current-buffer))&#xA;        (original-size (point-max)))&#xA;    (and&#xA;     (with-temp-buffer&#xA;       (insert-file-contents filename)&#xA;       (zerop (compare-buffer-substrings original-buffer 1 original-size&#xA;                                        (current-buffer) 1 (point-max))))&#xA;     (progn (set-visited-file-modtime) t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13045" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-08-28T23:37:07.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26655" PostTypeId="1" CreationDate="2016-08-28T23:38:54.757" Score="5" ViewCount="1605" Body="&lt;p&gt;With a vertical split (C-x 3), regardless of which buffer I am in, C-c a opens the agenda on the right window, pushing my org file into the left window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have the agenda open into the left window, rather than the right? If yes, how?&lt;/p&gt;&#xA;" OwnerUserId="13087" LastActivityDate="2024-01-13T18:03:30.387" Title="Org-Mode Agenda Open in Left Window by Default" Tags="|org-mode|window|org-agenda|window-splitting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26657" PostTypeId="2" ParentId="26447" CreationDate="2016-08-29T01:42:41.563" Score="3" Body="&lt;p&gt;There's a built-in package &lt;code&gt;hilit-chg&lt;/code&gt; which tracks and highlights the changes applied to a buffer.&#xA;I disable its highlight and but just use as a change-tracker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode automatically put text-properties to mark the modified regions of a buffer, so I implement an anything (precedent of &lt;code&gt;helm&lt;/code&gt;) source for myself, that collects the regions marked by &lt;code&gt;hilit-chg&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/zk-phi/78fbfc612bd78abbab21909e2ab5fd10&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/zk-phi/78fbfc612bd78abbab21909e2ab5fd10&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not familiar with &lt;code&gt;helm&lt;/code&gt;, but I expect &lt;code&gt;helm&lt;/code&gt; can also do something similar.&lt;/p&gt;&#xA;" OwnerUserId="12049" LastActivityDate="2016-08-29T01:42:41.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26658" PostTypeId="1" CreationDate="2016-08-29T04:36:42.950" Score="2" ViewCount="81" Body="&lt;p&gt;I am looking to write my own major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The programming language that I need to write it for has //... and /* ... */ style comments. I am having a very hard time getting the syntax tables working for both at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I get both of them at the same time?&lt;/p&gt;&#xA;" OwnerUserId="13139" LastActivityDate="2016-08-29T04:36:42.950" Title="Emacs Syntax Table Modifications" Tags="|syntax|syntax-table|" AnswerCount="0" CommentCount="5" ClosedDate="2016-09-09T22:20:33.133" ContentLicense="CC BY-SA 3.0" />
  <row Id="26659" PostTypeId="2" ParentId="26139" CreationDate="2016-08-29T07:37:17.447" Score="4" Body="&lt;p&gt;You can add not only &lt;code&gt;action&lt;/code&gt; but any other attributes to a text-button, that can be referred later with &lt;code&gt;button-get&lt;/code&gt; function. So saving the (reference to the) current buffer, together with &lt;code&gt;action&lt;/code&gt;, seems a good idea here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-text-button&#xA;     &quot;realgud-cmdbuf-info&quot;&#xA;     'buffer buffer&#xA;     'action (lambda (b)&#xA;           (with-current-buffer (button-get b 'buffer)&#xA;             (describe-variable 'realgud-cmdbuf-info)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another solution is to enable &lt;code&gt;lexical-binding&lt;/code&gt; in your script, that simply disables dynamic-binding.&lt;/p&gt;&#xA;" OwnerUserId="12049" LastEditorUserId="12049" LastEditDate="2016-08-30T05:53:17.933" LastActivityDate="2016-08-30T05:53:17.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26661" PostTypeId="1" AcceptedAnswerId="26778" CreationDate="2016-08-29T11:45:53.197" Score="2" ViewCount="46" Body="&lt;p&gt;When reading an email notmuch-(show)-mode unpacks zip files by default in my Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to deactivate this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's less of an issue for small zip-Files but I frequently send files that contain large binaries and this slows down the mail opening process considerably.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2016-09-02T09:02:19.950" Title="notmuch mail unpacks zip" Tags="|notmuch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26662" PostTypeId="2" ParentId="19672" CreationDate="2016-08-29T11:50:03.210" Score="10" Body="&lt;p&gt;After a while I managed to have enough time to try to fix it myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know of any &quot;out-of-the-box&quot; way to do this; however, you can expand magit to fit your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, I wrote a function that would push to gerrit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun magit-push-to-gerrit ()&#xA;  (interactive)&#xA;  (magit-git-command &quot;push origin HEAD:refs/for/master&quot; (magit-toplevel)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, I added it to push menu:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(transient-append-suffix 'magit-push &quot;p&quot;&#xA;  '(&quot;m&quot; &quot;Push to gerrit&quot; magit-push-to-gerrit))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These two forms are in my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And that's it! Now I can use &lt;kbd&gt;P&lt;/kbd&gt; &lt;kbd&gt;m&lt;/kbd&gt; to push to gerrit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&#xA;If you want to push a specific commit and not HEAD, you can use this function (also updated with magit-git-command-topdir as referred to in the comment):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun magit-push-to-gerrit (source)&#xA;  &quot;Push an arbitrary branch or commit to gerrit. The source is read in the minibuffer.&quot;&#xA;  (interactive&#xA;   (let ((source (magit-read-local-branch-or-commit &quot;Push&quot;)))&#xA;     (list source)))&#xA;  (magit-git-command-topdir (concat &quot;git push origin &quot; source &quot;:refs/for/master&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="405" LastEditorUserId="306" LastEditDate="2020-05-02T11:05:57.707" LastActivityDate="2020-05-02T11:05:57.707" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="26663" PostTypeId="1" CreationDate="2016-08-29T12:25:43.543" Score="3" ViewCount="390" Body="&lt;p&gt;I've only just recently started using &lt;code&gt;avy&lt;/code&gt; to navigate inside my buffers and it seems to work nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for my question however, with &lt;code&gt;avy-all-windows&lt;/code&gt; set to &lt;code&gt;all-frames&lt;/code&gt; I am able to navigate between several &lt;em&gt;GUI&lt;/em&gt; &lt;code&gt;emacsclients&lt;/code&gt;. I am also able to move &lt;em&gt;from&lt;/em&gt; terminal &lt;code&gt;emacsclients&lt;/code&gt; &lt;em&gt;to&lt;/em&gt; GUI clients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am not able to move from one terminal to another, or from GUI clients to terminal clients. The appropriate destination hints do appear in the Emacs frames however, and typing the hint-keys will activates the correct &lt;code&gt;point&lt;/code&gt; position in the intended destination (terminal) frame but focus will remain in the frame that issued the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to work around this and change focus to the destination&#xA;terminal frame?&lt;/p&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2016-12-28T17:06:58.270" Title="Avy - Moving Between Terminal Frames" Tags="|emacsclient|terminal-emacs|avy|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26664" PostTypeId="1" CreationDate="2016-08-29T12:41:07.030" Score="6" ViewCount="2921" Body="&lt;p&gt;Is there a way to get a quick help for a certain package? Something similar you get when you click package description in &lt;code&gt;Paradox&lt;/code&gt;. I think it would be interesting a sort of &lt;em&gt;doc package&lt;/em&gt; which get the list of your installed packages and fetch the &lt;code&gt;Readme&lt;/code&gt;file of the related Github pages. For example if you get the description of package, say &lt;code&gt;Helm&lt;/code&gt;, using the &lt;code&gt;describe-package&lt;/code&gt; command you get a very brief description:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;helm is an installed package.&#xA;&#xA; Status: Installed in `~/.emacs.d/elpa/helm-20160824.745/' (unsigned).&#xA;Archive: n/a&#xA;Version: 20160824.745&#xA;Requires: emacs-24.3, async-1.9, popup-0.5.3, helm-core-2.0&#xA;Summary: Helm is an Emacs incremental and narrowing framework&#xA;Homepage: https://emacs-helm.github.io/helm/&#xA;Other versions: 20160824.745 (melpa), 2.0 (melpa-stable).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead it could be really useful to fetch the &lt;a href=&quot;https://raw.githubusercontent.com/emacs-helm/helm/master/README.md&quot; rel=&quot;noreferrer&quot;&gt;Readme&lt;/a&gt; and convert to an org file in order have a quick look for the most important commands. &lt;/p&gt;&#xA;" OwnerUserId="5202" LastEditorUserId="5202" LastEditDate="2016-08-29T20:59:27.020" LastActivityDate="2016-09-01T17:38:07.680" Title="Get help for a package" Tags="|package|documentation|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26665" PostTypeId="1" AcceptedAnswerId="26983" CreationDate="2016-08-29T13:38:04.813" Score="2" ViewCount="896" Body="&lt;p&gt;In Org mode, when attempting to edit an elisp source block such as the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;  (setq trees '(pine fir oak maple)&#xA;        herbivores '(gazelle antelope zebra))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the key-chord &lt;code&gt;C-c '&lt;/code&gt; loads the source block in a new window. Though &lt;code&gt;org-src-mode&lt;/code&gt; is not loaded in the new buffer. So I get the message &lt;code&gt;C-c ' is undefined&lt;/code&gt; when attempting to close the buffer and move back to Org mode. I am able to manually load &lt;code&gt;org-src-mode&lt;/code&gt;, which works, though it would be nice for it to be loaded automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using emacs 25.1 with no special &lt;code&gt;emacs-lisp-mode&lt;/code&gt; or &lt;code&gt;org-mode&lt;/code&gt; configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plus to ensure the issue was not caused by some other part of my configuration, I load the file in emacs without my init file &lt;code&gt;emacs -Q&lt;/code&gt; and still had the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;(setq debug-on-error t)&lt;/code&gt; the following error is shown in the debugger:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument listp t)&#xA;  delete((org-filtered) t)&#xA;  remove((org-filtered) t)&#xA;  org-move-to-column(0)&#xA;  org-edit-src-code()&#xA;  org-edit-special(nil)&#xA;  funcall-interactively(org-edit-special nil)&#xA;  call-interactively(org-edit-special nil nil)&#xA;  command-execute(org-edit-special)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to resolve the issue?&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="12195" LastEditDate="2016-08-29T19:24:27.460" LastActivityDate="2016-09-21T22:39:48.923" Title="org-src-mode is not being loading in the source block edit buffer" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26666" PostTypeId="2" ParentId="26664" CreationDate="2016-08-29T13:47:54.943" Score="6" Body="&lt;p&gt;The command you are looking for is &lt;code&gt;describe-package&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11912" LastEditorUserId="11912" LastEditDate="2016-08-30T13:51:02.413" LastActivityDate="2016-08-30T13:51:02.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26668" PostTypeId="1" CreationDate="2016-08-29T17:06:15.537" Score="1" ViewCount="223" Body="&lt;p&gt;I want to create a mode which in certain states converts all input to uppercase, regardless of the caps-lock status. But I'm at a loss as to how to go for this, and I'm not sure it could even be done. Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13140" LastActivityDate="2016-08-31T09:38:00.747" Title="How to uppercase all input in elisp?" Tags="|hooks|inputs|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26669" PostTypeId="1" CreationDate="2016-08-29T19:44:44.350" Score="1" ViewCount="924" Body="&lt;p&gt;In Emacs' C++ mode, I sometimes accidentally introduced a tab where I should use four whitespaces instead to create indentations. Adjacent lines with mixed uses of tabs and spaces for indentations are shown to be aligned in C++ mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I open the C++ file thus created in another editor, for example in Eclipse CDT editor, it will show that the indentations of the lines mentioned above are not actually aligned, because of mixed uses of tabs and spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes me realized that Emacs C++ mode is not actually a pure text editor.&#xA;A tab is probably not shown as wide as four whitespaces, and that makes me add more or less tabs than I should for aligning with other lines' indentations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs C++ mode, how can I avoid making such mistakes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2016-08-30T13:34:16.133" Title="tab and spaces shown aligned in emacs C++ mode, but not in other editors" Tags="|indentation|c++|whitespace|tabs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26671" PostTypeId="1" CreationDate="2016-08-29T20:40:07.233" Score="1" ViewCount="794" Body="&lt;p&gt;One of the possible bullet styles for plain lists is &lt;code&gt;-&lt;/code&gt;.  Can I replace this with &lt;code&gt;--&lt;/code&gt;?  (I'm afraid of seeming unable to tell a hyphen from an en-rule.)&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2017-01-26T22:30:31.883" LastActivityDate="2017-01-26T22:30:31.883" Title="Custom bullet style for org-mode plain lists" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26672" PostTypeId="1" AcceptedAnswerId="26715" CreationDate="2016-08-29T21:53:24.377" Score="1" ViewCount="378" Body="&lt;p&gt;On one of my devices I need double pressing &lt;code&gt;C-g&lt;/code&gt; to quit from a minibuffer, even when no initialization file is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, after pressing &lt;code&gt;C-x C-f&lt;/code&gt;, if I do not realease the control botton, I only need one &lt;code&gt;C-g&lt;/code&gt; to quit the minibuffer. But if I realease, I need two. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I only press &lt;code&gt;C-g&lt;/code&gt; once, the minibuffer shows the text quit, but the cursor is still focused on the minibufer, and I have to press &lt;code&gt;C-g&lt;/code&gt; again within 3 seconds, otherwise the Find-File minibuffer reappears after the text quit fades in 3 seconds. And in that case, I will need to double-press again to quit.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.6) of 2016-06-04 on juergen&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I solved this by switching off the option of &lt;code&gt;Show position of pointer when the Control key is pressed&lt;/code&gt; in Linux mouse setting. &#xA;I guess there is some conflict between Emacs and this option.&lt;/p&gt;&#xA;" OwnerUserId="5466" LastEditorUserId="5466" LastEditDate="2016-08-31T11:50:37.393" LastActivityDate="2016-08-31T11:50:37.393" Title="Need double c-g to quit from a minibuffer" Tags="|key-bindings|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26673" PostTypeId="1" AcceptedAnswerId="34946" CreationDate="2016-08-30T00:51:45.363" Score="3" ViewCount="342" Body="&lt;p&gt;When I've launched &lt;code&gt;vc-annotate&lt;/code&gt; and then type &lt;code&gt;a&lt;/code&gt; (&lt;code&gt;vc-annotate-revision-previous-to-line&lt;/code&gt;), emacs will show me the revision before the one on the current line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Old-Revisions.html&quot; rel=&quot;nofollow&quot;&gt;docs&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Annotate the revision before the one indicated by the current line.&#xA;  This is useful to see the state the file was in before the change on&#xA;  the current line was made.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After doing this, I now want to go back to the previous revision of the file that I was viewing before I pressed &lt;code&gt;a&lt;/code&gt;. How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If emacs &lt;code&gt;vc-annotate&lt;/code&gt; doesn't support it natively, are there any packages that can accomplish this? Or how would I go about coding this on my own? I imagine I could just use some sort of stack to store all the revisions visited in the current vc-annotate session, and then pop one off using an undo command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using git, so would even be interested in an answer that applies only to git.&lt;/p&gt;&#xA;" OwnerUserId="12470" LastActivityDate="2017-08-17T09:10:23.793" Title="undo vc-annotate-revision-previous-to-line" Tags="|git|version-control|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26674" PostTypeId="1" CreationDate="2016-08-30T04:02:18.407" Score="1" ViewCount="348" Body="&lt;p&gt;Is it possible to make this kind of an inline image link: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[path/to/the/image/of/a/cat][fluffy]] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;appear as an inline image in org-mode, and if you hover over it, you can see in the tooltip the string &quot;fluffy&quot;, hopefully along with the image link &quot;path/to/the/image/of/a/cat&quot;? If so, how?&lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-08-30T15:16:15.893" Title="Tooltip on inline images in org-mode" Tags="|org-mode|image-mode|inline-image|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26677" PostTypeId="2" ParentId="24246" CreationDate="2016-08-30T08:58:44.713" Score="3" Body="&lt;p&gt;It seems like org-pomodoro potentially uses &lt;code&gt;sound-wav&lt;/code&gt; to play sounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install it, along with &lt;code&gt;powershell&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install [RET] sound-wav [RET]&#xA;M-x package-install [RET] poweshell [RET]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="13147" LastActivityDate="2016-08-30T08:58:44.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26678" PostTypeId="1" CreationDate="2016-08-10T12:39:52.343" Score="1" ViewCount="111" Body="&lt;p&gt;I am reading the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/widget.htm&quot; rel=&quot;nofollow&quot;&gt;The Emacs Widget Library&lt;/a&gt;.&#xA;The library describes the widget properties in general and not per widget.  So I'd like some more insights about the &lt;code&gt;link&lt;/code&gt; widget properties and use.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;:notify&lt;/code&gt; property is  a &quot;function called each called each time the widget or a nested widget is changed&quot;.&lt;br&gt;&#xA;Does a widget click implies a call of this function?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;:action&lt;/code&gt; property is a &quot;function to handle user initiated events&quot;.  &quot;Pressing RET invokes the function specified by :action&quot;.&lt;br&gt;&#xA;Does this entail a widget click?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Do I have to set &lt;code&gt;:follow-link 'mouse-face&lt;/code&gt; or is it the default value for the property? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run the following snippet immediately after starting Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'widget)&#xA;(with-current-buffer (get-buffer-create &quot;test&quot;)&#xA;  (kill-all-local-variables)&#xA;  (let ((inhibit-read-only t))&#xA;    (widget-create 'link&#xA;           :notify (lambda (&amp;amp;rest ignore) (message  &quot;You clicked&quot;))&#xA;           &quot;my link&quot;)&#xA;    (widget-setup))&#xA;    (switch-to-buffer (current-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gui-get-primary-selection: No selection is available &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using GNU Emacs 25.0.94.2 (x86_64-w64-mingw32) with Windows 10 x64.&lt;/p&gt;&#xA;" OwnerUserId="3975" OwnerDisplayName="antonio" LastActivityDate="2016-08-30T11:50:04.913" Title="Emacs link widget gives the error &quot;gui-get-primary-selection: No selection is available&quot;" Tags="|widget|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26679" PostTypeId="1" CreationDate="2016-08-30T12:58:34.383" Score="0" ViewCount="497" Body="&lt;p&gt;I am looking for an elisp function that will toggle scheduling for the current headline either to  or not at all. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If (SCHEDULED == Nil | SCHEDULED &amp;gt; &amp;lt;today&amp;gt;)&#xA;   Set SCHEDULED to &amp;lt;today&amp;gt;&#xA;Else if (SCHEDULED &amp;lt;= &amp;lt;today&amp;gt;)&#xA;   Set SCHEDULED to Nil&#xA;End If&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea is to assign this function to a key combination (something like C-c C-t) so that I can quickly send (or remove) items from a Custom agenda view (the &quot;Today&quot; list). I would then font lock scheduled items in my &lt;code&gt;projects.org&lt;/code&gt; file, to add a visual queue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2017-02-07T19:01:38.887" LastActivityDate="2017-02-07T19:01:38.887" Title="Toggle SCHEDULED keyword" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26681" PostTypeId="2" ParentId="26668" CreationDate="2016-08-30T13:27:07.093" Score="2" Body="&lt;p&gt;You could do worse than look at GNU ELPA's &lt;code&gt;caps-lock&lt;/code&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-30T13:27:07.093" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26682" PostTypeId="2" ParentId="26669" CreationDate="2016-08-30T13:34:16.133" Score="4" Body="&lt;p&gt;The normal convention is that TAB characters align to the next multiple-of-8 column.  Notice: I wrote 8, not 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if your other text editor aligns to a multiple-of-4 column (like you seem to imply), it could be argued that it's a bug in that other editor (tho it's more likely that you have customized that editor (explicitly/knowingly or not) to use a &quot;tab-width&quot; of 4).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned by Drew, a good way to deal with these problems is to try and avoid inserting TAB characters, which you typically do by setting &lt;code&gt;indent-tabs-mode&lt;/code&gt; to nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really thing TABs chars should indent to a multiple-of-4 column, then you can also try and customize all the tools you ever use to look at those files correspondingly.  In the case of Emacs, you'd do that with &lt;code&gt;(setq tab-width 4)&lt;/code&gt;.  I'd recommend against this practice, tho.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-08-30T13:34:16.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26683" PostTypeId="1" AcceptedAnswerId="26702" CreationDate="2016-08-30T14:38:44.363" Score="0" ViewCount="524" Body="&lt;p&gt;Can I pass an argument to &lt;code&gt;(org-todo-list)&lt;/code&gt; so the buffer will only show item a specific category?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried something like &lt;code&gt;(org-todo-list &quot;personal&quot;)&lt;/code&gt;, but had no success. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can still use &lt;code&gt;&amp;lt;&lt;/code&gt; over a category, once I am in the &lt;code&gt;org-agenda-mode&lt;/code&gt;. Is there a way to combine these steps into &quot;open a new org todo view filtered by category&quot;?&lt;/p&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2016-08-30T22:48:32.173" Title="Show org-todo-list with specific category" Tags="|org-agenda|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26684" PostTypeId="2" ParentId="26674" CreationDate="2016-08-30T15:16:15.893" Score="2" Body="&lt;p&gt;It is not possible AFAICT out of the box. I did something similar here: &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/Displaying-image-overlays-on-image-filenames-in-Emacs/&quot; rel=&quot;nofollow&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/Displaying-image-overlays-on-image-filenames-in-Emacs/&lt;/a&gt; and modified tooltips on a link here &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2015/11/23/Improving-org-ref-cite-links-with-tooltips/&quot; rel=&quot;nofollow&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2015/11/23/Improving-org-ref-cite-links-with-tooltips/&lt;/a&gt;. They might give you some hints on how to get what you want.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-08-30T15:16:15.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26685" PostTypeId="2" ParentId="26663" CreationDate="2016-08-30T15:17:25.553" Score="1" Body="&lt;p&gt;This is an Emacs bug. Avy does call &lt;code&gt;select-frame-set-input-focus&lt;/code&gt; on the proper frame, but that function does not work well on terminal frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want this fixed, please follow up with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/9826/can-you-activate-bring-to-front-emacs-using-native-elisp-e-g-when-working-in&quot;&gt;see also&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2094" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-08-30T15:17:25.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26686" PostTypeId="1" AcceptedAnswerId="33116" CreationDate="2016-08-30T15:26:05.437" Score="2" ViewCount="534" Body="&lt;p&gt;How can I change the color of the comments starting with &lt;code&gt;-- |&lt;/code&gt; in Haskell mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I write a comment in Haskell I get a grey face, but when the comment starts with &lt;code&gt;-- |&lt;/code&gt;, as required by Haddock documentation lines, it takes a green one. I have tried to change the &lt;code&gt;Haskell Literate Comment Face&lt;/code&gt; to inherit from &lt;code&gt;font-lock-doc-face&lt;/code&gt; to &lt;code&gt;font-lock-comment-face&lt;/code&gt;, but it has had no effect over the comments starting with &lt;code&gt;-- |&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edited:&lt;/strong&gt;&#xA;Ok. Now I see the problem. The face of these comments is not &lt;code&gt;Haskell Literate Comment Face&lt;/code&gt;, it is directly &lt;code&gt;font-lock-doc-face&lt;/code&gt; (?). If I change it, the comments reflect the change. But why is it like this? I would like to change the color of the doc-comments only for Haskell, not globally.&lt;/p&gt;&#xA;" OwnerUserId="12208" LastEditorUserId="12208" LastEditDate="2016-08-31T08:50:13.007" LastActivityDate="2019-04-19T07:04:15.793" Title="Customize haddock comments color" Tags="|font-lock|customize|haskell-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26687" PostTypeId="2" ParentId="26679" CreationDate="2016-08-30T15:34:23.160" Score="2" Body="&lt;p&gt;This feature is already built-in.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-c C-s&lt;/code&gt; to add a scheduled date.  The default is today, so if you want today, then just press the enter key after the foregoing keyboard shortcut.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-u C-c C-s&lt;/code&gt; to remove a scheduled date.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is the doc-string for &lt;code&gt;org-schedule&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Insert the SCHEDULED: string with a timestamp to schedule a TODO item.&#xA;With one universal prefix argument, remove any scheduling date from the item.&#xA;With two universal prefix arguments, prompt for a delay cookie.&#xA;With argument TIME, scheduled at the corresponding date.  TIME can&#xA;either be an Org date like &quot;2011-07-24&quot; or a delta like &quot;+2d&quot;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the doc-string for &lt;code&gt;org-agenda-schedule&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Schedule the item at point.&#xA;ARG is passed through to `org-schedule'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a link to the section in the manual entitled &quot;&lt;strong&gt;Inserting deadlines or schedules&lt;/strong&gt;&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Inserting-deadline_002fschedule.html&quot; rel=&quot;nofollow&quot;&gt;http://orgmode.org/manual/Inserting-deadline_002fschedule.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-08-30T15:40:37.443" LastActivityDate="2016-08-30T15:40:37.443" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26688" PostTypeId="1" AcceptedAnswerId="26689" CreationDate="2016-08-30T17:11:47.513" Score="1" ViewCount="411" Body="&lt;p&gt;I have a file with a &lt;code&gt;.md&lt;/code&gt; extension, and I want to run a command to interpret/parse a file when &lt;code&gt;markdown-mode&lt;/code&gt; is active with a &lt;code&gt;C-c C-c&lt;/code&gt; key combination, for example. I want to run this shell command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aglio -i foo.md -o foo.html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where&lt;code&gt;foo.md&lt;/code&gt; is the file name of the current buffer and &lt;code&gt;foo.html&lt;/code&gt; is this name with replaced extension (to &lt;code&gt;html&lt;/code&gt;). How can I do this in Emacs?&lt;/p&gt;&#xA;" OwnerDisplayName="user12201" LastEditorUserId="9995" LastEditDate="2016-08-31T14:47:46.763" LastActivityDate="2016-08-31T14:47:46.763" Title="Run a command with C-c C-c for a specific major mode" Tags="|shell-command|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26689" PostTypeId="2" ParentId="26688" CreationDate="2016-08-30T17:43:42.347" Score="1" Body="&lt;p&gt;Running shell command could be done with &lt;code&gt;(shell-command COMMAND)&lt;/code&gt;.  Then we need to make string for executing command.  We'll concatenate it from sections with &lt;code&gt;(concat ...)&lt;/code&gt;.  We have 5 sections of the command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(concat &quot;aglio -i &quot;                                    ;; 1&#xA;        (buffer-file-name)                             ;; 2&#xA;        &quot; -o &quot;                                         ;; 3&#xA;        (file-name-sans-extension (buffer-file-name))  ;; 4&#xA;        &quot;.html&quot;)                                       ;; 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, if the buffer file name is &lt;code&gt;foo.md&lt;/code&gt;, then result of this script will be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aglio -i foo.md -o foo.html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We could make it function, like next:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun aglio-current-file ()&#xA;  &quot;Execute aglio shell command on current file&quot;&#xA;  (interactive)&#xA;  (shell-command&#xA;    (concat &quot;aglio -i &quot; (buffer-file-name)&#xA;     &quot; -o &quot; (file-name-sans-extension (buffer-file-name)) &quot;.html&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We could define key for &lt;code&gt;markdown-mode-map&lt;/code&gt; with next code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'markdown-mode&#xA;  '(define-key markdown-mode-map (kbd &quot;C-c C-c s&quot;)&#xA;    'aglio-current-file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;C-c C-c s&lt;/code&gt; instead of &lt;code&gt;C-c C-c&lt;/code&gt; cause &lt;a href=&quot;https://github.com/jrblevin/markdown-mode&quot; rel=&quot;nofollow&quot;&gt;this version&lt;/a&gt; of the markdown package from &lt;code&gt;melpa&lt;/code&gt; uses &lt;code&gt;C-c C-c&lt;/code&gt; as prefix for buffer-wide commands.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-08-31T14:12:19.543" LastActivityDate="2016-08-31T14:12:19.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26690" PostTypeId="1" AcceptedAnswerId="26693" CreationDate="2016-08-30T18:08:23.930" Score="3" ViewCount="1402" Body="&lt;p&gt;I am working on a cmake project and I would like to set a directory variable containing the correct compile command. I added this to the root directory of the project in a &lt;code&gt;.dir-locals.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Directory Local Variables&#xA;;;; For more information see (info &quot;(emacs) Directory Variables&quot;)&#xA;&#xA;((nil .&#xA;      ((indent-tabs-mode . t)&#xA;       (fill-column . 80)&#xA;       (compile-command . &quot;cd build &amp;amp;&amp;amp; make&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I enter &lt;code&gt;describe-variable&lt;/code&gt; for the variable &lt;code&gt;fill-column&lt;/code&gt;, I get the message that &lt;code&gt;This variable's value is directory-local, set by the file ...&lt;/code&gt;. The variable is set from its default of 70 to 80 instead. However, the &lt;code&gt;compile-command&lt;/code&gt; variable is unchanged. Is there a bug in the file?&lt;/p&gt;&#xA;" OwnerUserId="8891" LastActivityDate="2023-11-10T08:55:40.223" Title="Compile command as a directory variable?" Tags="|compilation|directory-local-variables|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26692" PostTypeId="1" CreationDate="2016-08-30T18:55:22.583" Score="1" ViewCount="52" Body="&lt;p&gt;I want to have an org file like this example :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: &#xA;#+TYP_DODO: KO | OK&#xA;#+TODO: KO | OK&#xA;&#xA;&#xA;* Automated tests results [62%] / [5/8]&#xA;:PROPERTIES:&#xA;:COOKIE_DATA: recursive&#xA;:END:&#xA;** results group 1 [50%]&#xA;*** test 1 : OK&#xA;*** test 2 : KO&#xA;*** test 3 : OK&#xA;*** test 4 : KO&#xA;** results group 2 [75%]&#xA;*** test 1 : KO&#xA;*** test 2 : OK&#xA;*** test 3 : OK&#xA;*** test 4 : OK&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To achieve this I need to have the TODO keyword at the end of the heading line instead of at the beginning.&#xA;Is it possible? If so how?&lt;/p&gt;&#xA;" OwnerUserId="13155" LastEditorUserId="9995" LastEditDate="2016-08-30T19:03:43.310" LastActivityDate="2016-08-30T20:29:09.183" Title="Is it possible to place TODO keywords at end of heading" Tags="|org-mode|todo|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26693" PostTypeId="2" ParentId="26690" CreationDate="2016-08-30T19:16:07.013" Score="2" Body="&lt;p&gt;The variable &lt;code&gt;compile-command&lt;/code&gt; is not buffer local by default, thus you can not set it per buffer. To change this add the following to your init file:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-variable-buffer-local 'compile-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2016-08-30T19:16:07.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26695" PostTypeId="1" CreationDate="2016-08-30T20:01:32.650" Score="1" ViewCount="1554" Body="&lt;ul&gt;&#xA;&lt;li&gt;OS X 10.11&lt;/li&gt;&#xA;&lt;li&gt;Emacs 24.5: &lt;code&gt;/Applications/Emacs.app&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;emacsclient: &lt;code&gt;/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9/emacsclient&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(server-start)&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt; file&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;% emacsclient some-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Result is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9/emacsclient:&#xA;  can't find socket; have you started the server? To start the server in&#xA;  Emacs, type &quot;M-x server-start&quot;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9/emacsclient: No&#xA;  socket or alternate editor.  Please use:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;--socket-name   --server-file      (or environment variable&#xA;  EMACS_SERVER_FILE)    --alternate-editor (or environment variable&#xA;  ALTERNATE_EDITOR)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have also tried this running Emacs and emacsclient as installed with MacPorts with the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is been happening for many years. I can't even remember the last time I was able to use emacsclient. I have searched extensively for information about this, but all I can find is information I already know as a sophisticated Emacs user of many decades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not looking to run Emacs as a daemon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions?&lt;/p&gt;&#xA;" OwnerUserId="11515" LastEditorUserId="25" LastEditDate="2016-08-30T20:59:25.450" LastActivityDate="2016-09-28T06:29:22.943" Title="Please help me get emacsclient working" Tags="|emacsclient|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26697" PostTypeId="2" ParentId="26695" CreationDate="2016-08-30T21:02:14.830" Score="1" Body="&lt;p&gt;&lt;code&gt;emacsclient&lt;/code&gt; with no option contacts a running Emacs. You need to either start Emacs with your session (presumably as a daemon) or instruct emacsclient to start Emacs if there isn't one already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To instruct emacsclient to start Emacs if it isn't already running, run either&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --alternate-editor=''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -a ''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You can put this in a shell alias or in a wrapper script.)&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="5444" LastEditDate="2016-09-28T06:29:22.943" LastActivityDate="2016-09-28T06:29:22.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26698" PostTypeId="1" AcceptedAnswerId="26711" CreationDate="2016-08-30T21:07:06.587" Score="2" ViewCount="4500" Body="&lt;p&gt;I would like w3m in emacs (in a terminal) to show me pictures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Showing pictures in emacs gui works:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/04aT3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/04aT3.png&quot; alt=&quot;images in emacs gui without terminal&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Showing pictures in the terminal without emacs works:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/UboNU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UboNU.png&quot; alt=&quot;images in w3m without emacs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in emacs w3m running in a terminal, no images are shown:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/nAv9J.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nAv9J.png&quot; alt=&quot;no images in w3m in emacs in terminal&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pressing T doesn't help, instead I get the message &quot;Can't display images in this environment&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since emacs and termite are clearly able to show images from w3m, why not at the same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional information: I am using x86_64 Arch Linux 4.7 with GNU Emacs 24.5.1 and w3m 0.5.3 and the w3m package 20160727.837 in emacs&lt;/p&gt;&#xA;" OwnerUserId="13157" LastActivityDate="2016-08-31T09:29:21.133" Title="display images in emacs w3m in terminal" Tags="|terminal-emacs|images|web-browser|w3m|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26699" PostTypeId="1" CreationDate="2016-08-30T22:24:27.947" Score="6" ViewCount="1457" Body="&lt;p&gt;I'm currently trying to learn org-mode in OS X. And I found there's a keymap &lt;code&gt;M-S-RET&lt;/code&gt;. But &lt;code&gt;S-RET&lt;/code&gt; is not recognized in the iTerm2.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It seems like terminal interpret &lt;code&gt;S-RET&lt;/code&gt; and &lt;code&gt;RET&lt;/code&gt; as same.&lt;/li&gt;&#xA;&lt;li&gt;iTerm2 can bind a &lt;code&gt;S-RET&lt;/code&gt; in the GUI preference tab. (PREFERENCE-&amp;gt;PROFILE-&amp;gt;KEY)&lt;/li&gt;&#xA;&lt;li&gt;I can bind &lt;code&gt;S-RET&lt;/code&gt; and send hex value instead of 13. (13 is keycode for RET) &lt;a href=&quot;https://i.stack.imgur.com/ntk3r.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ntk3r.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;But I can't find what's the keycode for the &lt;code&gt;S-RET&lt;/code&gt;. Actually, I think &lt;kbd&gt;Shift&lt;/kbd&gt; + &lt;kbd&gt;Enter&lt;/kbd&gt; does not exist as keycode. However, there must be some key combination that Emacs uses.&lt;/p&gt;&#xA;&lt;p&gt;How can I figure it out? Are there any files containing that information?&lt;/p&gt;&#xA;&lt;p&gt;Thank you for reading.&lt;/p&gt;&#xA;" OwnerUserId="13159" LastEditorUserId="11477" LastEditDate="2020-12-31T08:28:47.383" LastActivityDate="2020-12-31T08:28:47.383" Title="Keycode for `Shift + Return` on OS X iterm2" Tags="|org-mode|key-bindings|keymap|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="26700" PostTypeId="1" AcceptedAnswerId="26701" CreationDate="2016-08-30T22:31:48.817" Score="1" ViewCount="952" Body="&lt;p&gt;I am trying to run Emacs with slime and clisp on windows. Currently I am setting up my init-file so that I can run SLIME. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq inferior-lisp-program “home/gage/bin/clisp/full/lisp.exe&#xA;-B home/gage/bin/clisp/full&#xA;-M home/gage/bin/clisp/full/lispinit.mem&#xA;-ansi -q”)&#xA;(add-to-list ‘load-path “home/gage/bin/share/emacs/site-lisp/slime/”)&#xA;(require ‘slime)&#xA;(slime-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I run &lt;code&gt;eval-buffer&lt;/code&gt; and this error pops up.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eval-buffer: Symbol's value as variable is void: “home/gage/bin/clisp/full/lisp\.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Help?&lt;/p&gt;&#xA;" OwnerUserId="13158" LastEditorUserId="675" LastEditDate="2016-08-30T22:40:46.280" LastActivityDate="2016-08-30T22:44:48.837" Title="eval-buffer: Symbol's value as variable is void" Tags="|init-file|microsoft-windows|slime|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26701" PostTypeId="2" ParentId="26700" CreationDate="2016-08-30T22:44:48.837" Score="1" Body="&lt;p&gt;You are using the wrong kind of quotes. I just tried:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq foo “bar”)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and got the same error. This command worked for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq foo &quot;bar&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you need to change all instances of &lt;code&gt;“&lt;/code&gt; to &lt;code&gt;&quot;&lt;/code&gt; (and probably also &lt;code&gt;‘&lt;/code&gt; to &lt;code&gt;'&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="675" LastActivityDate="2016-08-30T22:44:48.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26702" PostTypeId="2" ParentId="26683" CreationDate="2016-08-30T22:48:32.173" Score="1" Body="&lt;p&gt;You can't do this with &lt;code&gt;org-todo-list&lt;/code&gt; directly, so use a tags search instead.  Despite the name &lt;code&gt;org-tags-view&lt;/code&gt; will match arbitrary properties, not just tags.  Setting the first argument of &lt;code&gt;org-tags-view&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; will restrict to only todo items.  For example &lt;code&gt;(org-tags-view t &quot;CATEGORY=\&quot;personal\&quot;&quot;)&lt;/code&gt; will show all todo items with &lt;code&gt;CATEGORY&lt;/code&gt; &quot;personal&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also access this using the &lt;code&gt;M&lt;/code&gt; option of &lt;code&gt;org-agenda&lt;/code&gt; or by creating a custom agenda view of type &lt;code&gt;tags-todo&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-08-30T22:48:32.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26703" PostTypeId="1" AcceptedAnswerId="26725" CreationDate="2016-08-30T23:10:59.427" Score="3" ViewCount="807" Body="&lt;p&gt;How can I make Emacs function 'browse-url-at-point work on a tablet running Android?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following advice I found at &quot;&lt;a href=&quot;http://endlessparentheses.com/running-emacs-on-android.html&quot; rel=&quot;nofollow&quot;&gt;http://endlessparentheses.com/running-emacs-on-android.html&lt;/a&gt;&quot; I installed 'Termux and 'Hacker's keyboard on my Android tablet, started 'Termux and ran:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;apt update&lt;br&gt;&#xA;apt install emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then started emacs.  In the Emacs scratch buffer I wrote &quot;&lt;a href=&quot;http://www.google.com&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com&lt;/a&gt;&quot; and invoked 'browse-url-at-point.  It said &quot;No usable browser found&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did some investigating of this subject on the Internet, but so far have found nothing helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The table is a HP Touchpad running Android 5.1.1 via CyanogenMod version &quot;12.1-20160109-SNAPSOT-jcsullins-tenderloin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added after reading the comment by Jack, and further investigation:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a while I thought that turning on root access on my HP Touchpad (running CyogenMod Android 12) and using command &quot;su&quot; was necessary, but someone referred me to &quot;termux-open-url&quot; and its source code suggested to me to add &quot;--user 0&quot; to what Jack suggested.  My first test was to run the command&lt;/p&gt;&#xA;&#xA;&lt;p&gt;am start --user 0 -a android.intent.action.VIEW -d &lt;a href=&quot;http://www.google.com&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the Termux terminal window.  That worked.  I then started up Emacs inside Termux and issued the same command inside the shell buffer.  That also worked.&lt;/p&gt;&#xA;" OwnerUserId="9240" LastEditorUserId="9240" LastEditDate="2016-09-07T19:47:54.447" LastActivityDate="2021-01-25T03:57:35.370" Title="How can I make Emacs function 'browse-url-at-point work on a tablet running Android?" Tags="|android|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26704" PostTypeId="1" AcceptedAnswerId="26747" CreationDate="2016-08-30T23:41:46.467" Score="3" ViewCount="236" Body="&lt;p&gt;In response to a &lt;a href=&quot;https://emacs.stackexchange.com/questions/26579/how-to-extend-magits-context-sensitive-push-menu&quot;&gt;question about extending magit's push menu&lt;/a&gt;, I have successfully added a command that logs into a remote server, pulls from where I am, and runs make:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun magit-update-course-repo ()&#xA;  &quot;Run pull-and-mk-repo remotely to update the course repo&quot;&#xA;  (interactive)&#xA;  (let ((cc (course-number-and-update-command)))&#xA;    (when cc&#xA;      (let* ((command (cdr cc)))&#xA;        (shell-command command)&#xA;        (magit-fetch-all-no-prune)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the &lt;code&gt;command&lt;/code&gt; here is an &lt;code&gt;ssh&lt;/code&gt; command which runs a script, and the whole thing takes many seconds to complete.  During that time, the user interface does not acknowledge that anything is happening, and indeed emacs seems to freeze.  Eventually, however, the magit status window updates, and a &lt;code&gt;*Shell Command Output*&lt;/code&gt; is shown in another buffer.&#xA;In other words, the functionality is there, but the user experience is not good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know magit provides internal tools that can do better than &lt;code&gt;shell-command&lt;/code&gt;, but I am having trouble understanding the documentation and reading the source code.  What magit functions should I use to achieve the  following goals?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The moment the command launches, magit's user interface acknowledges that something is happening, even if it takes a long time to complete.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The command's output goes into magit's &quot;process buffer&quot;, just like the output from normal git commands.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ideally, while the command is running, the user can get on with life and do other things inside emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have gotten as far as discovering the existence of command &lt;code&gt;magit-start-process&lt;/code&gt;, but I have not figured out how to use it.&lt;/p&gt;&#xA;" OwnerUserId="9343" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-09-01T20:21:10.177" Title="What is the correct way to launch a long-running shell command from magit?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26705" PostTypeId="2" ParentId="26537" CreationDate="2016-08-30T23:45:50.373" Score="1" Body="&lt;p&gt;An Org-native approach: use a link abbreviation.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[jira-dev:1234][DEV-1234]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To enable:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-link-abbrev-alist &#xA;    '(&amp;quot;jira-dev&amp;quot; . &amp;quot;http://jira/browse/DEV-%s&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;just correcting to -alist but adding this comment because edits must be at least 6 characters for some reason&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;And similarly for &lt;code&gt;BUG-*&lt;/code&gt; etc.&lt;/p&gt;&#xA;&lt;p&gt;With a suitably constructed &lt;code&gt;org-capture&lt;/code&gt; template you could enter just &amp;quot;1234&amp;quot; in response to a prompt and then have the rest automagically filled in for you.&lt;/p&gt;&#xA;" OwnerUserId="12184" LastEditorUserId="38160" LastEditDate="2022-12-28T07:01:11.027" LastActivityDate="2022-12-28T07:01:11.027" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="26706" PostTypeId="2" ParentId="26590" CreationDate="2016-08-31T00:38:17.417" Score="3" Body="&lt;p&gt;There's consensus that the observed behavior is buggy and not user error / an expected limitation of regexps in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mentioned this discussion and submitted a regression test for the bug on debbugs:&#xA;&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15107&quot; rel=&quot;nofollow&quot;&gt;GNU bug #15107 &quot;24.3; replace-regexp-in-string wrong on `&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution for those seeking one in the interim:  If the replacements do not interact with the pattern itself, the replacement may be split at the pattern alternatives.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp-in-string &quot;^.&quot; #'upcase&#xA; (replace-regexp-in-string &quot; .&quot; #'upcase &quot;foo bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ultimately I changed my regexp to use the word boundary character &lt;code&gt;\\&amp;lt;&lt;/code&gt; to yield the pattern &lt;code&gt;&quot;\\&amp;lt;.&quot;&lt;/code&gt;&#xA;In my particular case I could have replaced the whole thing with &lt;code&gt;#'capitalize&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-08-31T00:38:17.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26707" PostTypeId="1" CreationDate="2016-08-31T01:07:17.850" Score="1" ViewCount="921" Body="&lt;p&gt;I know that the `smtpmail-auth-credentials' variable has been removed in emacs 24.x, and that we are now expected to use an .authinfo file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have a specialized need for passing in SMTP credentials via elisp code, without any .authinfo file. I want to use &quot;plain&quot; user-ID/password authentication via port 587 with no SSL nor TLS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to accomplish this in 24.x with the credentials encoded in elisp and without the use of an .authinfo file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="105" LastEditDate="2016-08-31T22:25:16.073" LastActivityDate="2016-08-31T22:25:16.073" Title="SMTP auth credentials in emacs 24.x without an .authinfo file?" Tags="|mu4e|smtpmail|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26708" PostTypeId="1" AcceptedAnswerId="26834" CreationDate="2016-08-31T01:16:24.117" Score="6" ViewCount="3342" Body="&lt;p&gt;I have a few questions about the relationship between &lt;code&gt;TERM&lt;/code&gt;, &lt;code&gt;terminfo&lt;/code&gt; and &lt;code&gt;termcap&lt;/code&gt; and Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I do not know &lt;strong&gt;exactly&lt;/strong&gt; what &lt;code&gt;TERM&lt;/code&gt;, &lt;code&gt;terminfo&lt;/code&gt; and &lt;code&gt;termcap&lt;/code&gt; are. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am on OS X.  I do not know &lt;strong&gt;what&lt;/strong&gt; values (and &lt;strong&gt;where&lt;/strong&gt;) I should set variables such as &lt;code&gt;TERM&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But since such information is not really about Emacs I will seek it elsewhere. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to &lt;em&gt;Emacs&lt;/em&gt;, my question is this: &lt;em&gt;How are such things are used by Emacs by &lt;code&gt;shell&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="105" LastEditDate="2016-08-31T22:23:29.680" LastActivityDate="2016-09-04T15:09:31.097" Title="TERM, terminfo, termcap. What are they how does Emacs use it?" Tags="|shell|term|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26709" PostTypeId="2" ParentId="26686" CreationDate="2016-08-31T06:40:41.577" Score="0" Body="&lt;p&gt;Assume it had no effect, because &lt;code&gt;font-lock-comment-face&lt;/code&gt; is set to grey too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;kbd&gt;M-x&lt;/kbd&gt; customize-face &lt;kbd&gt;RET&lt;/kbd&gt; haskell-literate-comment-face &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then disable the check-box &quot;inherit&quot;, open the now enabled menu and edit the values at place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;WRT your comment: Looks like a bug. See in haskell-mode-autoloads.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface haskell-literate-comment-face '((t :inherit font-lock-doc-face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe editing it there will help. Might require a re-compile than, as the *.elc files --if present-- will be loaded.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2016-08-31T11:20:38.597" LastActivityDate="2016-08-31T11:20:38.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26710" PostTypeId="1" AcceptedAnswerId="28708" CreationDate="2016-08-31T08:29:32.407" Score="18" ViewCount="7815" Body="&lt;p&gt;Is there a way to paste something into the minibuffer?&lt;br&gt;&#xA;For example if I want to &lt;code&gt;eval-expression&lt;/code&gt; and paste something in there neiter &lt;code&gt;C-v&lt;/code&gt; or (obviously &lt;code&gt;p&lt;/code&gt;) will work? There has to be a way.&lt;/p&gt;&#xA;" OwnerUserId="11347" LastActivityDate="2020-06-09T22:39:17.237" Title="Spacemacs: paste into minibuffer" Tags="|spacemacs|minibuffer|copy-paste|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26711" PostTypeId="2" ParentId="26698" CreationDate="2016-08-31T09:29:21.133" Score="3" Body="&lt;p&gt;From elisp &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Images.html#Images&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs is usually able to display images when it is run on a graphical terminal. Images cannot be displayed in a text terminal, on certain graphical terminals that lack the support for this, or if Emacs is compiled without image support.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the answer is no.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-08-31T09:29:21.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26712" PostTypeId="2" ParentId="26668" CreationDate="2016-08-31T09:38:00.747" Score="1" Body="&lt;p&gt;I was able to do it by adding a buffer local &lt;code&gt;post-command-hook&lt;/code&gt; and upcasing the previous word when the &lt;code&gt;self-insert-command&lt;/code&gt; is executed and I am in the right state.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook 'mymode-post-command-hook nil t)&#xA;&#xA;(defun mymode-post-command-hook ()&#xA;  (when (and&#xA;         (eq this-command 'self-insert-command)&#xA;         (eq mymode-state 0))&#xA;    (upcase-word -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tested this a bit and seems to work fine. It could probably be slimmer with the &lt;code&gt;post-self-insert-hook&lt;/code&gt;. Thank you for all the suggestions.&lt;/p&gt;&#xA;" OwnerUserId="13140" LastActivityDate="2016-08-31T09:38:00.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26713" PostTypeId="2" ParentId="10065" CreationDate="2016-08-31T10:19:34.177" Score="2" Body="&lt;p&gt;I think it is possible with :after&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package python&#xA;  :ensure t&#xA;  :defer t&#xA;  :mode (&quot;\\.py\\'&quot; . python-mode))&#xA;&#xA;(use-package elpy&#xA;  :ensure t&#xA;  :after python&#xA;  :config (elpy-enable))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13161" LastEditorUserId="306" LastEditDate="2016-08-31T10:36:17.740" LastActivityDate="2016-08-31T10:36:17.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26714" PostTypeId="1" AcceptedAnswerId="75383" CreationDate="2016-08-31T10:36:24.450" Score="0" ViewCount="392" Body="&lt;p&gt;I love that we can quickly re-order our outlines with the &lt;code&gt;M-&amp;lt;Up|Down&amp;gt;&lt;/code&gt; arrow keys. For whatever reason, I can't get this to work in column view. I would like to enable this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to get this done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="33424" LastEditDate="2023-01-14T17:47:53.003" LastActivityDate="2023-01-14T17:47:53.003" Title="Org-mode: manually re-order headlines from column view" Tags="|org-mode|sorting|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="26715" PostTypeId="2" ParentId="26672" CreationDate="2016-08-31T11:50:04.843" Score="2" Body="&lt;p&gt;I solved this myself by switching off the option of &lt;code&gt;Show position of pointer when the Control key is pressed&lt;/code&gt; in Linux mouse setting. I guess there is some conflict between Emacs and this option.&lt;/p&gt;&#xA;" OwnerUserId="5466" LastActivityDate="2016-08-31T11:50:04.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26716" PostTypeId="1" CreationDate="2016-08-31T13:03:46.593" Score="10" ViewCount="816" Body="&lt;p&gt;I'm applying a background color to code blocks in org-mode, as shown in this line from my colortheme:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(org-block ((t (:background &quot;#F5F5F5&quot; :family &quot;Source Code Pro&quot; :height 140))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lZ8zy.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lZ8zy.png&quot; alt=&quot;expanded item with code block&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I collapse an item that contains a code block, the code block's background color extends from the end of the item's heading to the edge of the window, which I did not expect -- I expected collapsing the item would hide any evidence of the contained code-block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/N9EIT.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/N9EIT.png&quot; alt=&quot;collapsed item with code block&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to prevent the code block background from &quot;bleeding through&quot; like this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2022-07-08T10:30:28.767" Title="Prevent org-mode code block background color from bleeding through when collapsed?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26717" PostTypeId="1" CreationDate="2016-08-31T13:05:53.697" Score="0" ViewCount="389" Body="&lt;p&gt;I am trying to get helm-dash to work on Windows and I want to view the docsets in emacs. Here is what I did so far:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;downloaded ZealPortable (I don't have admin rights)&lt;/li&gt;&#xA;&lt;li&gt;downloaded some docs&lt;/li&gt;&#xA;&lt;li&gt;pointed &lt;code&gt;helm-dash-docsets-path&lt;/code&gt; to the docsets folder&lt;/li&gt;&#xA;&lt;li&gt;activate at least one docset&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;when I now invoke helm-dash and search for a function, the docset opens in the default browser.&lt;br&gt;&#xA;What I want is to view the docsets inside emacs. For that I can set the handy variable &lt;code&gt;helm-dash-browser-func&lt;/code&gt; to &lt;code&gt;eww&lt;/code&gt;.&lt;br&gt;&#xA;Problem: &lt;code&gt;eww&lt;/code&gt; is not able to resolve URLs to local files. At least for me. It interprets the &lt;code&gt;c:&lt;/code&gt; in the path as the hostname.&lt;br&gt;&#xA;Has anyone ever stumbled upon that issue? Is there a way to solve it? Perhaps a different browser than &lt;code&gt;eww&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw.: I'm using spacemacs but that shouldn't make any difference, should it?&lt;/p&gt;&#xA;" OwnerUserId="11347" LastActivityDate="2016-08-31T23:32:22.990" Title="helm-dash on windows and viewing docs inside emacs" Tags="|helm|spacemacs|eww|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26718" PostTypeId="1" CreationDate="2016-08-31T15:09:51.017" Score="2" ViewCount="270" Body="&lt;p&gt;I want to be able to fill a whole paragraph with &lt;code&gt;fill-paragraph&lt;/code&gt;, first line included, between the &lt;code&gt;left-margin&lt;/code&gt; and &lt;code&gt;fill-column&lt;/code&gt; values (&lt;code&gt;adaptive-fill-mode&lt;/code&gt; is disabled). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to do this, but I noticed that if the first line has an hanging indentation (meaning it has a different indentation from the &lt;code&gt;left-margin&lt;/code&gt; variable), I am unable to remove it, unless I manually go to the first line, removing it. I want to be able to remove the hanging indentation by just running &lt;code&gt;fill-paragraph&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of hanging indentation, considering &lt;code&gt;left-margin&lt;/code&gt; equal to 0:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  this is an example&#xA;of an hanging indentation&#xA;in a paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want to happen when I run &lt;code&gt;fill-paragraph&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;this is an example&#xA;of an hanging indentation&#xA;in a paragraph.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I am unable to recreate such a behaviour. The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Filling.html#Filling&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; on the topic barely mentions hanging indentations, and is not helpful on how to disable them. &lt;/p&gt;&#xA;" OwnerUserId="13140" LastActivityDate="2016-12-01T18:28:58.370" Title="Disabling hanging indentations with fill-paragraph" Tags="|indentation|fill-paragraph|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26719" PostTypeId="1" AcceptedAnswerId="26770" CreationDate="2016-08-31T17:06:06.417" Score="3" ViewCount="72" Body="&lt;p&gt;My work uses GNU RCS for our version control system, but I don't think the specific VCS is relevant here. (I know RCS isn't the most modern system but it suits our needs fine and has the advantage of relative simplicity. Anyway, that's not the question.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I steal the lock on a file using &lt;code&gt;C-x v v&lt;/code&gt;, emacs opens up a buffer so I can email the person from whom I stole it. I never need to do this, so I have to go to the trouble of killing the buffer and then confirming that I want to do so. This is a hassle I'd rather avoid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how can I make emacs not open that buffer in the first place?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; As pointed out in the comments, I could have included more relevant info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package is &lt;code&gt;vc&lt;/code&gt;, and the keybinding &lt;code&gt;C-x v v&lt;/code&gt; calls the function &lt;code&gt;vc-next-action&lt;/code&gt;, which is a smart command that attempts to figure out what you want to do next. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, RCS is an &quot;old-style locking-based VCS&quot;, somebody else has locked the file and the function is attempting to steal the lock, as outlined in the function's documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FURTHER EDIT&lt;/strong&gt; Digging a little more deeply, it seems that &lt;code&gt;vc-next-action&lt;/code&gt; is calling &lt;code&gt;vc-steal-lock&lt;/code&gt; (surprise, surprise). This function contains the following chunk of code at the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Write mail after actually stealing, because if the stealing&#xA;;; goes wrong, we don't want to send any mail.&#xA;(compose-mail owner (format &quot;Stolen lock on %s&quot; file-description))&#xA;(setq default-directory (expand-file-name &quot;~/&quot;))&#xA;(goto-char (point-max))&#xA;(insert&#xA; (format &quot;I stole the lock on %s, &quot; file-description)&#xA; (current-time-string)&#xA; &quot;.\n&quot;)&#xA;(message &quot;Please explain why you stole the lock.  Type C-c C-c when done.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume that if I comment this out, the email buffer won't open. I know that just commenting out this chunk in the source code isn't the right way to go about things. But what is the right way to modify a built-in function in a way that will survive if I upgrade, reinstall, etc?&lt;/p&gt;&#xA;" OwnerUserId="6692" LastEditorUserId="6692" LastEditDate="2016-09-01T17:59:25.860" LastActivityDate="2016-09-02T04:30:12.273" Title="Version control: how to inhibit opening email buffer upon breaking lock" Tags="|version-control|vc|vc-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26721" PostTypeId="1" AcceptedAnswerId="26724" CreationDate="2016-08-31T18:41:46.263" Score="4" ViewCount="935" Body="&lt;p&gt;How can I display the max line of a file in the bar at the bottom? So, how could it say &quot;L1/L1300&quot; instead of just &quot;Top L1&quot;, if the respective happens to have 1300 lines? &lt;/p&gt;&#xA;" OwnerUserId="8824" LastEditorUserId="2287" LastEditDate="2016-08-31T22:11:09.300" LastActivityDate="2016-09-01T06:01:40.373" Title="Display max line in bottom line (nox) (aka mode-line)" Tags="|mode-line|display|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26722" PostTypeId="1" AcceptedAnswerId="26726" CreationDate="2016-08-31T20:40:28.953" Score="4" ViewCount="1270" Body="&lt;p&gt;Is it possible to write an org table colmun formula which calculates the running total of some other column? Here is a simple example of the idea: The table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|  1 |   |&#xA;|  2 |   |&#xA;|  5 |   |&#xA;| 10 |   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should be endowed with a column formula which gives the resulting table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|  1 |  1 |&#xA;|  2 |  3 |&#xA;|  5 |  8 |&#xA;| 10 | 18 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13168" LastActivityDate="2016-08-31T22:39:13.407" Title="Org-table running total column formula" Tags="|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26723" PostTypeId="1" CreationDate="2016-08-31T20:49:09.750" Score="1" ViewCount="673" Body="&lt;p&gt;I have the following in my ~/.gnus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-demon-add-handler, 'gnus-demon-scan-mail 5 t)&#xA;(gnus-demon-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expect that gnus will be checking for new emails every 5 min, however this doesn't happen. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="12510" LastEditorUserId="25" LastEditDate="2018-06-11T21:12:34.690" LastActivityDate="2022-08-20T14:03:15.317" Title="gnus doesn't periodically check emails" Tags="|gnus|email|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26724" PostTypeId="2" ParentId="26721" CreationDate="2016-08-31T21:57:27.180" Score="4" Body="&lt;p&gt;&lt;code&gt;count-lines&lt;/code&gt; (also used by &lt;code&gt;line-number-at-pos&lt;/code&gt;) is increasingly less efficient as the buffer grows in size/length, whereas &lt;code&gt;(format-mode-line &quot;%l&quot;)&lt;/code&gt; does not have those limitations -- however, there are other limitations.  See the related thread entitled &quot;&lt;em&gt;A faster method to obtain &lt;code&gt;line-number-at-pos&lt;/code&gt; in large buffers&lt;/em&gt;&quot;:  &lt;a href=&quot;https://emacs.stackexchange.com/questions/3821/a-faster-method-to-obtain-line-number-at-pos-in-large-buffers&quot;&gt;A faster method to obtain `line-number-at-pos` in large buffers&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Performing anything remotely significant in the mode-line can cause a slow down (in part) because the mode-line for more than one visible window may be updated during redisplay.  The following example updates the &lt;em&gt;total&lt;/em&gt; line numbers in only the selected-window (i.e., active window).  See the related thread entitled &quot;&lt;em&gt;Show something in active mode line instead of all mode lines&lt;/em&gt;&quot;:  &lt;a href=&quot;https://emacs.stackexchange.com/questions/26222/show-something-in-active-mode-line-instead-of-all-mode-lines/26345#26345&quot;&gt;Show something in active mode line instead of all mode lines&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode-line for the inactive window uses the previously recorded value for the total number of lines if said value exists, otherwise calculate said value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add additional hooks as needed to call &lt;code&gt;ml-update-all&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar ml-selected-window nil)&#xA;&#xA;(defvar ml-total-lines nil&#xA;  &quot;Previously recorded total lines in a buffer -- used for inactive windows.&quot;)&#xA;(make-variable-buffer-local 'ml-total-lines)&#xA;&#xA;(defun ml-record-selected-window ()&#xA;  (setq ml-selected-window (selected-window)))&#xA;&#xA;(defun ml-update-all ()&#xA;  (force-mode-line-update t))&#xA;&#xA;(add-hook 'post-command-hook 'ml-record-selected-window)&#xA;&#xA;(add-hook 'buffer-list-update-hook 'ml-update-all)&#xA;&#xA;(setq-default mode-line-format '(&#xA;  &quot; %l | &quot;&#xA;  (:eval&#xA;    (let ((win (selected-window)))&#xA;      (with-current-buffer (window-buffer win)&#xA;        (if (or (eq ml-selected-window win) (null ml-total-lines))&#xA;          (save-excursion&#xA;            (goto-char (point-max))&#xA;            (setq ml-total-lines (format-mode-line &quot;%l&quot;)))&#xA;        ml-total-lines))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-09-01T06:01:40.373" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26725" PostTypeId="2" ParentId="26703" CreationDate="2016-08-31T22:34:33.780" Score="3" Body="&lt;p&gt;Based on &lt;a href=&quot;https://stackoverflow.com/questions/16488179/how-to-open-a-url-from-terminal&quot;&gt;this&lt;/a&gt; adding something like this to your config &lt;em&gt;should&lt;/em&gt; work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'browse-url-default-browser :override&#xA;            (lambda (url &amp;amp;rest args)&#xA;              (start-process-shell-command &quot;open-url&quot; nil (concat &quot;am start -a android.intent.action.VIEW -d &quot; url))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2738" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-01T02:53:59.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26726" PostTypeId="2" ParentId="26722" CreationDate="2016-08-31T22:39:13.407" Score="5" Body="&lt;p&gt;You can add from the first row to the current row thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| value | accum |&#xA;|-------+-------|&#xA;| 1     | 1     |&#xA;| 2     | 3     |&#xA;| 5     | 8     |&#xA;| 10    | 18    |&#xA;|-------+-------|&#xA;#+TBLFM: $2=vsum(@I$1..$1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;@I&lt;/code&gt; refers to the row after the first hline. If you don't want headings in your table, use &lt;code&gt;@1&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this is not super efficient for large tables since the whole sum is calculated each time. You can calculate the sum progressively as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| value | accum |&#xA;|-------+-------|&#xA;| 1     | 1     |&#xA;| 2     | 3     |&#xA;| 5     | 8     |&#xA;| 10    | 18    |&#xA;|-------+-------|&#xA;#+TBLFM: @2$2=$1::$2=$1+@-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;although I'm not sure if this second method is faster.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-08-31T22:39:13.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26727" PostTypeId="2" ParentId="26717" CreationDate="2016-08-31T23:32:22.990" Score="1" Body="&lt;p&gt;I think the url package is not handling Windows pathnames well.  We can try to fix it.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun url-generic-parse-url-fix-windows-path (fn url)&#xA;  (if (or (not (stringp url))&#xA;          (not (string-match &quot;\\`file://\\(\\([a-z]\\):\\)/&quot; url)))&#xA;      (funcall fn url)&#xA;    (let ((drive (match-string 2 url))&#xA;          (clx (funcall fn (replace-match &quot;/\\2&quot; t nil url 1))))&#xA;      (setf (url-filename clx)&#xA;            (concat drive &quot;:&quot; (substring (url-filename clx) 2)))&#xA;      clx)))&#xA;&#xA;(advice-add 'url-generic-parse-url :around #'url-generic-parse-url-fix-windows-path)&#xA;(url-generic-parse-url &quot;file://c:/foo&quot;)&#xA;;; =&amp;gt; [cl-struct-url &quot;file&quot; nil nil &quot;&quot; nil &quot;c:/foo&quot; nil nil t nil t]&#xA;&#xA;(advice-remove 'url-generic-parse-url #'url-generic-parse-url-fix-windows-path)&#xA;(url-generic-parse-url &quot;file://c:/foo&quot;)&#xA;;; =&amp;gt; [cl-struct-url &quot;file&quot; nil nil &quot;c&quot; nil &quot;/foo&quot; nil nil t nil t]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See, if that works for you (I have no access to such a machine right now.).&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-08-31T23:32:22.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26728" PostTypeId="1" AcceptedAnswerId="29683" CreationDate="2016-09-01T00:50:47.793" Score="2" ViewCount="478" Body="&lt;p&gt;How can I set AucTex to either (a) not pop up that annoying compilation buffer every time I &lt;code&gt;C-c C-c&lt;/code&gt; or (b) only pop it up if compilation is not successful? (b) is preferable, but if it's too hard then I'm fine with (a).&lt;/p&gt;&#xA;" OwnerUserId="5376" LastActivityDate="2016-12-30T14:08:39.207" Title="Disable pop-up compilation buffer in AucTex" Tags="|auctex|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26729" PostTypeId="1" CreationDate="2016-09-01T01:38:04.997" Score="2" ViewCount="1916" Body="&lt;p&gt;I tried to install &lt;code&gt;verilog-mode&lt;/code&gt; from github to replace the version built in to Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;spacemacs&lt;/code&gt;.  I created a layer for &lt;code&gt;verilog&lt;/code&gt; and added &lt;code&gt;verilog-mode&lt;/code&gt; in &lt;code&gt;packages.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(verilog-mode :location (recipe&#xA;                         :fetcher github&#xA;                         :repo &quot;veripool/verilog-mode&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have enabled the &lt;code&gt;verilog&lt;/code&gt; layer but the &lt;code&gt;verilog-mode&lt;/code&gt; is still the built-in version. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How could I make spacemacs use the version from Github?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="253" LastEditDate="2017-01-03T23:19:12.843" LastActivityDate="2017-02-03T00:17:08.403" Title="How to use a github package instead of the built-in version?" Tags="|package|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26730" PostTypeId="2" ParentId="26139" CreationDate="2016-09-01T01:53:33.970" Score="1" Body="&lt;p&gt;Start your file with&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Copyright (C) 2015-2016 Free Software Foundation, Inc -*- lexical-binding: t -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you're able to use closures in your Lisp code, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((x 0))&#xA;  (lambda () (setq x (1+ x))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will create a count function.  The same applies to your anonymous function, it will close over it's lexical environment, i.e. it knows about the variable buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(insert-text-button&#xA; &quot;realgud-cmdbuf-info&quot;&#xA; 'action (lambda (_button) ;; underscore makes compiler happy&#xA;           (describe-variable 'realgud-cmdbuf-info buffer))&#xA; 'help-echo &quot;mouse-2: help-on-variable&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In rare circumstances, enabling &lt;code&gt;lexical-binding&lt;/code&gt; can break your code, but only if you did something stupid to begin with. For example accessing local variables from a function up the call-stack.  And of course this won't work, if you're programming for ancient Emacs (I believe it was introduced in 24.1). &lt;/p&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2016-09-01T02:20:45.733" LastActivityDate="2016-09-01T02:20:45.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26732" PostTypeId="1" CreationDate="2016-09-01T03:56:25.137" Score="1" ViewCount="1331" Body="&lt;p&gt;If I create a second window with a terminal in it like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-x 2; C-x o; M-x ansi-term&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I copy text from a buffer into this terminal? I seems like the ansi-terminal has its own kill-ring (maybe the killring from readline?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Context: I use a REPL quite often for development, sometimes it's on a remote machine.&lt;/p&gt;&#xA;" OwnerUserId="10768" LastEditorUserId="10768" LastEditDate="2016-09-01T04:24:37.597" LastActivityDate="2016-10-03T10:34:45.347" Title="How to copy text from a buffer to an ansi-term" Tags="|window|ansi-term|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26733" PostTypeId="1" CreationDate="2016-09-01T05:45:56.197" Score="1" ViewCount="276" Body="&lt;p&gt;I am using a dvorak keyboard and Evil Mode. I would like to keep the qwerty keys while in Normal mode. And wonder if there is a more efficient way than remapping everything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;https://stackoverflow.com/questions/15169428/use-the-default-input-method-when-doing-an-incremental-search-in-evil&quot;&gt;this post&lt;/a&gt; that looks like it takes the opposite route: setting dvorak only for the Insert mode. It looks fine for somebody who use dvorak layout only in Emacs but not enough if I have dvorak set as my keyboard for the whole OS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something similar to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(activate-normal-method &quot;qwerty&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that I could use on an OS set to dvorak as its default keyboard?&lt;/p&gt;&#xA;" OwnerUserId="12936" LastActivityDate="2016-09-01T05:45:56.197" Title="How to setup keyboard for Normal mode in Evil [dvorak user]?" Tags="|evil|keyboard-layout|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26734" PostTypeId="2" ParentId="26732" CreationDate="2016-09-01T05:58:47.390" Score="2" Body="&lt;p&gt;From the doc for &lt;code&gt;term-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The terminal emulator uses Term mode, which has two input modes. In line mode, Term basically acts like Shell mode. In char mode, each character is sent directly to the subshell, except for the Term escape character, normally C-c.&lt;/p&gt;&#xA;&lt;p&gt;C-c C-c send a literal C-c to the sub-shell.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;From the doc for &lt;code&gt;shell-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The major mode for Shell buffers is Shell mode. Many of its special commands are bound to the C-c prefix, and resemble the usual editing and job control characters present in ordinary shells, except that you must type C-c first.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Into &lt;code&gt;ansi-term&lt;/code&gt; use &lt;code&gt;C-x C-j&lt;/code&gt; to switch terminal into line mode.  In this mode you could use &lt;code&gt;C-y&lt;/code&gt; to insert content from the emacs kill ring.  Switching back to character mode could be done with &lt;code&gt;C-c C-k&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This happens because &lt;code&gt;ansi-term&lt;/code&gt; mode runs custom terminal (like &lt;code&gt;/bin/bash&lt;/code&gt;), which have its own function for keys &lt;code&gt;C-k&lt;/code&gt;, &lt;code&gt;C-y&lt;/code&gt;, etc. This keys works with kill ring similar to emacs kill ring but into &lt;code&gt;bash&lt;/code&gt;.  So, if you kill string into char mode (in &lt;code&gt;bash&lt;/code&gt;) and then try to paste it, the string will be pasted, but the kill ring will be &lt;code&gt;bash&lt;/code&gt; kill ring.&lt;/p&gt;&#xA;&lt;p&gt;This could be helpful: &lt;a href=&quot;https://stackoverflow.com/questions/2886184/copy-paste-in-emacs-ansi-term-shell&quot;&gt;https://stackoverflow.com/questions/2886184/copy-paste-in-emacs-ansi-term-shell&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-09-01T09:24:54.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26735" PostTypeId="1" AcceptedAnswerId="26738" CreationDate="2016-09-01T06:02:30.390" Score="0" ViewCount="132" Body="&lt;p&gt;I've put together a &lt;a href=&quot;https://github.com/matthewrsilver/aql-mode&quot; rel=&quot;nofollow&quot;&gt;simple major mode&lt;/a&gt; for syntax highlighting and indentation of &lt;a href=&quot;https://docs.arangodb.com/3.0/AQL/&quot; rel=&quot;nofollow&quot;&gt;AQL&lt;/a&gt;. This is my first, and I'm open to any suggestions there, but my question is more specific:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type two slashes to begin a comment, the moment I type the second slash the cursor jumps back to the beginning of the line, and the line is indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This even happens if I've already typed a bunch of code on the line. So if I have the following line (&lt;code&gt;^&lt;/code&gt; is the cursor):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for u in users&#xA;              ^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I start to put a comment at the end of the line, the moment I type two slashes the cursor jumps:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for u in users \\&#xA;^&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's going on here? I've tried playing with and disabling &lt;code&gt;electric-indent-mode&lt;/code&gt;, and I've tried manipulating &lt;code&gt;electric-indent-chars&lt;/code&gt; but have not been able to alter this behavior in any way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts on how to proceed?&lt;/p&gt;&#xA;" OwnerUserId="6771" LastActivityDate="2016-09-01T17:32:42.013" Title="Stop automatic indentation and cursor movement while typing in major mode" Tags="|indentation|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26736" PostTypeId="2" ParentId="26729" CreationDate="2016-09-01T06:18:41.110" Score="2" Body="&lt;p&gt;To install a package by using a layer, you need to add the pacakge to the layer's packages list, write an init function for the package, and enable the layer. It appears that you did not write an init function. The init function is necessary for Spacemacs to install the package, but it can be empty if no configuration is needed for the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When trying to override a built-in package with a newer version, use the &lt;code&gt;:min-version&lt;/code&gt; keyword to specify a version that is higher than the built-in one and lower or equal to the desired version. &lt;code&gt;:min-version&lt;/code&gt; should be a version string, similar in format to &lt;code&gt;emacs-version&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming your layer is called verilog, its &lt;code&gt;packages.el&lt;/code&gt; file should look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defconst verilog-packages&#xA;  '((verilog-mode :location (recipe :fetcher github&#xA;                                    :repo &quot;veripool/verilog-mode&quot;&#xA;                                    :min-version &quot;1&quot;))))&#xA;&#xA;(defun verilog/init-verilog-mode ()&#xA;  ;; ... verilog configuration goes here ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And of course don't forget to enable the layer by adding it to &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make sure that &lt;code&gt;:min-version&lt;/code&gt; is newer than the built-in version, you can use this next small snippet. It is meant to be used interactively before installing the newer version:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(package-installed-p 'verilog-mode (version-to-list &quot;1&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another approach is to install verilog-mode as an additional package. In this approach, you install the package by adding it to &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;. The same entries that fit in a layer's packages list also fit in &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;. In your case, you'd add this as an entry:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(verilog-mode :location (recipe :fetcher github :repo &quot;veripool/verilog-mode&quot; :min-version &quot;1&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And any configuration for verilog-mode goes in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastEditorUserId="6533" LastEditDate="2016-09-05T19:31:55.770" LastActivityDate="2016-09-05T19:31:55.770" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26737" PostTypeId="1" CreationDate="2016-09-01T06:22:46.603" Score="1" ViewCount="150" Body="&lt;p&gt;I have all of my notes organized under one project, &quot;Notes&quot;, which consists of multiple subfolders with each subject:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|-Notes&#xA;  |-Subject 1&#xA;    | - topic.org&#xA;  |-Subject 2&#xA;    | - topic.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to generate a sitemap for each folder that only lists the pages in that folder, plus the sitemap for nested/parent folders? An example would be the &lt;a href=&quot;http://orgmode.org/manual/index.html&quot; rel=&quot;nofollow&quot;&gt;Org Manual&lt;/a&gt;, which does exactly what I would like, except there is no need for next/previous links.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to change the function that builds the sitemap with &lt;code&gt;:sitemap-function&lt;/code&gt; in the publishing configuration. Is modifying this property the correct approach?&lt;/p&gt;&#xA;" OwnerUserId="6831" LastActivityDate="2016-09-01T06:22:46.603" Title="Sitemap or index for each subfolder in project" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26738" PostTypeId="2" ParentId="26735" CreationDate="2016-09-01T06:35:32.810" Score="0" Body="&lt;p&gt;Hmm found a workable solution Based on this answer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/11061453/in-emacs-how-to-disable-comment-auto-indent-in-c-c&quot;&gt;https://stackoverflow.com/questions/11061453/in-emacs-how-to-disable-comment-auto-indent-in-c-c&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the following to the mode's keymap (called &lt;code&gt;custom-map&lt;/code&gt; below)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key custom-map &quot;/&quot; 'self-insert-command)&#xA;(define-key custom-map &quot;*&quot; 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And all is resolved. Not sure if this is the &lt;em&gt;right&lt;/em&gt; way, but it seems to work...&lt;/p&gt;&#xA;" OwnerUserId="6771" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-01T17:32:42.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26739" PostTypeId="1" AcceptedAnswerId="26743" CreationDate="2016-09-01T07:46:05.897" Score="1" ViewCount="145" Body="&lt;p&gt;IntelliJ has a nice feature in the overview of the staged area, where you can make changes to the files in the staging area while having the diff overview. In the Magit overview of staged changes I would also like to make changes. Is this possible? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make changes to files in a view where I see the diff?&lt;/p&gt;&#xA;" OwnerUserId="11605" LastActivityDate="2016-09-01T14:18:41.200" Title="Make changes to staged files in Magit" Tags="|magit|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26740" PostTypeId="1" AcceptedAnswerId="26742" CreationDate="2016-09-01T08:34:05.767" Score="0" ViewCount="597" Body="&lt;p&gt;I usually use &lt;code&gt;git push origin HEAD&lt;/code&gt; on the command line when I want to push my local branch to GitHub for the first time. That way I don't have to type the branch name. What is the equivalent in Magit?&lt;/p&gt;&#xA;" OwnerUserId="363" LastActivityDate="2016-09-01T10:50:42.960" Title="Magit equivalent to 'git push origin HEAD'" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26741" PostTypeId="2" ParentId="26728" CreationDate="2016-09-01T08:47:52.210" Score="1" Body="&lt;p&gt;When I was looking for to avoid this, I didn't found. But I finnaly found a solution to get around the problem by using &lt;code&gt;latexmk&lt;/code&gt;. The following code may help you :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-latexmk ()&#xA;  &quot;It compiles the current document&quot;&#xA;  (interactive)&#xA;  (let ((TeX-save-query nil)&#xA;        (TeX-process-asynchronous nil)&#xA;        (master-file (TeX-master-file)))&#xA;    (TeX-save-document &quot;&quot;)&#xA;    (TeX-run-TeX &quot;latexmk&quot;&#xA;         (TeX-command-expand &quot;latexmk -pdf %t&quot; 'TeX-master-file)&#xA;         master-file)&#xA;    (minibuffer-message &quot;latexmk done&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This was inspired by &lt;a href=&quot;https://tex.stackexchange.com/questions/115247/how-to-make-latexmk-run-the-appropriate-amount-of-times&quot;&gt;this page&lt;/a&gt; about how to make &lt;code&gt;latexmk&lt;/code&gt; run the appropriate amount of times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can rebind &lt;code&gt;C-c C-c&lt;/code&gt; with something like &lt;code&gt;(local-set-key (kbd &quot;C-c C-c&quot;) #'run-latexmk)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10056" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-09-01T08:47:52.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26742" PostTypeId="2" ParentId="26740" CreationDate="2016-09-01T10:50:42.960" Score="2" Body="&lt;p&gt;Magit does provide the exact equivalent. Instead it fully embraces both the &lt;em&gt;upstream&lt;/em&gt; and the &lt;em&gt;push-remote&lt;/em&gt;. When both of these remotes are configured for the current branch, then Magit can show logs in the status buffer which show which commits are in the current branch but not in the upstream and vice-versa, and for the push-remote it can do the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The upstream of a branch is usually set when the branch is created and the push-remote is usually set when you first use the &quot;push to push-remote&quot; command. To do so type &lt;kbd&gt;P p&lt;/kbd&gt;, select a remote, and confirm with &lt;kbd&gt;RET&lt;/kbd&gt;. The current branch will then be pushed to that remote to a branch with the same name as the local branch. For subsequent pushes you only have to type &lt;kbd&gt;P p&lt;/kbd&gt;.&#xA;&lt;a href=&quot;https://magit.vc/manual/magit/The-two-remotes.html&quot; rel=&quot;nofollow&quot;&gt;https://magit.vc/manual/magit/The-two-remotes.html&lt;/a&gt;&#xA;For more information about the upstream and the push-remote see the node about &lt;a href=&quot;https://magit.vc/manual/magit/The-two-remotes.html&quot; rel=&quot;nofollow&quot;&gt;the two remotes&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-09-01T10:50:42.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26743" PostTypeId="2" ParentId="26739" CreationDate="2016-09-01T10:51:57.480" Score="2" Body="&lt;p&gt;Magit does not currently allow editing diffs directly. I am considering to allow this in &lt;code&gt;v3&lt;/code&gt;, but this would require significant and expensive changes, so I might end up not doing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile you can very easily jump to the correct location in the file-visiting buffer by just pressing &lt;kbd&gt;RET&lt;/kbd&gt;. (It might be nice if &lt;code&gt;diff-hl-mode&lt;/code&gt; were enabled in that buffer.) Or you could give Magit's Ediff integration a try. To do so press &lt;kbd&gt;e&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-09-01T14:18:41.200" LastActivityDate="2016-09-01T14:18:41.200" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26744" PostTypeId="2" ParentId="26732" CreationDate="2016-09-01T11:01:27.950" Score="0" Body="&lt;p&gt;I switch to evil-mode by pressing &lt;code&gt;C-z&lt;/code&gt;. Then use vim key bindings to copy/paste text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's also my preferred way to run other REPL (js-comint, mostly).&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-09-01T11:01:27.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26745" PostTypeId="2" ParentId="26565" CreationDate="2016-09-01T12:29:55.773" Score="4" Body="&lt;p&gt;Following my own suggestion (second comment on the question), here's an answer which avoids the prompting altogether:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-answer)    &#xA;(let ((auto-answer '((&quot;\\`Active processes exist; kill them and exit anyway\\? \\'&quot; t))))&#xA;  (save-buffers-kill-emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This uses &lt;code&gt;auto-answer.el&lt;/code&gt;, available at &lt;a href=&quot;https://github.com/YoungFrog/auto-answer/blob/master/auto-answer.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/YoungFrog/auto-answer/blob/master/auto-answer.el&lt;/a&gt; (it requires dash.el from your favourite package store, and nadvice.el which is available at least in 24.4).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;If you only want to avoid the prompt for &lt;em&gt;some&lt;/em&gt; (specific) processes, the documented way to do it is to set its query-on-exit flag to &lt;code&gt;nil&lt;/code&gt; using &lt;code&gt;set-process-query-on-exit-flag&lt;/code&gt; when creating the process.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastEditorUserId="1982" LastEditDate="2016-09-04T10:28:53.510" LastActivityDate="2016-09-04T10:28:53.510" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26746" PostTypeId="1" CreationDate="2016-09-01T12:45:33.887" Score="0" ViewCount="74" Body="&lt;p&gt;When I type &lt;code&gt;M-s-h&lt;/code&gt; emacs reports: &lt;code&gt;M-s-˙ is undefined&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That tiny dot is the &lt;a href=&quot;http://www.fileformat.info/info/unicode/char/02d9/index.htm&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;'DOT ABOVE' (U+02D9)&lt;/code&gt;&lt;/a&gt; character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on OS X. This is happening when I use the &lt;a href=&quot;https://github.com/d12frosted/homebrew-emacs-plus&quot; rel=&quot;nofollow&quot;&gt;emacs-plus&lt;/a&gt; build. With &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot; rel=&quot;nofollow&quot;&gt;emacs-mac port&lt;/a&gt; I don't see this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way for me to debug this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-09-01T15:10:57.843" Title="&quot;M-s-h&quot; is being interpreted as &quot;M-s-˙&quot;" Tags="|keystrokes|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26747" PostTypeId="2" ParentId="26704" CreationDate="2016-09-01T13:32:14.560" Score="2" Body="&lt;p&gt;Here are all the magit-specific parts of the feature you want to implement. It includes code from your other &lt;a href=&quot;https://emacs.stackexchange.com/questions/26579/how-to-extend-magits-context-sensitive-push-menu&quot;&gt;two&lt;/a&gt; &lt;a href=&quot;https://emacs.stackexchange.com/questions/26647/how-to-customize-a-magit-popup-conditionally-on-the-state-of-the-repository&quot;&gt;questions&lt;/a&gt; about this. The non-magit-specific parts you will have to fill in yourself.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-update-course-repo ()&#xA;  &quot;Run remote `pull-and-mk-repo' remotely to update the course repo.&quot;&#xA;  (interactive)&#xA;  (--if-let (my--get-course-number-and-update-command)&#xA;      (progn&#xA;        (magit-start-process (car it) nil (cdr it))&#xA;        (set-process-sentinel magit-this-process 'my--ssh-sentinel))&#xA;    (user-error &quot;TODO useful description&quot;)))&#xA;&#xA;(magit-define-popup-action 'magit-push-popup ?!&#xA;  (lambda ()&#xA;    (and my--update-course-repo-all-good-p&#xA;         &quot;TODO useful description\n&quot;))&#xA;  'my-update-course-repo)&#xA;&#xA;(defun my--ssh-sentinel (process event)&#xA;  (let ((status (process-status process)))&#xA;    (when (memq status '(exit signal))&#xA;      (magit-process-sentinel process event)&#xA;      (if (eq status 'exit)&#xA;          (magit-fetch-all-no-prune)&#xA;        (message &quot;TODO useful description&quot;)))))&#xA;&#xA;(defun my--update-course-repo-all-good-p ()&#xA;  ;; TODO return t iff `my-get-course-number-and-update-command' would&#xA;  ;; return non-nil.&#xA;  )&#xA;&#xA;(defun my--get-course-number-and-update-command ()&#xA;  ;; TODO Return command and arguments as a list of string, not a&#xA;  ;; single string.&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The moment the command launches, magit's user interface acknowledges that something is happening, even if it takes a long time to complete.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You get messages in the echo area.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-09-01T20:21:10.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26748" PostTypeId="2" ParentId="26331" CreationDate="2016-09-01T14:15:40.050" Score="3" Body="&lt;p&gt;I have thrown together a quick-and-dirty implementation, which does this for diff buffers (not revision buffers as you requested), so you have to press &lt;kbd&gt;d d&lt;/kbd&gt; instead of &lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'magit-diff&#xA;  (defvar magit-diff-focus-file nil)&#xA;&#xA;  (defun magit-diff-setup (rev-or-range const args files)&#xA;    (require 'magit)&#xA;    (magit-mode-setup #'magit-diff-mode rev-or-range const args files)&#xA;    (--when-let (and magit-diff-focus-file&#xA;                     (magit-get-section&#xA;                      (append `((file . ,magit-diff-focus-file))&#xA;                              (magit-section-ident magit-root-section))))&#xA;      (magit-section-goto it)&#xA;      (recenter 0)))&#xA;&#xA;  (defun magit-diff (rev-or-range &amp;amp;optional args files)&#xA;    (interactive (cons (magit-diff-read-range-or-commit &quot;Diff for range&quot;&#xA;                                                        nil current-prefix-arg)&#xA;                       (magit-diff-arguments)))&#xA;    (let ((magit-diff-focus-file&#xA;           (and (derived-mode-p 'magit-log-mode)&#xA;                (= (length (car (cddr magit-refresh-args))) 1)&#xA;                (caar (cddr magit-refresh-args)))))&#xA;      (magit-diff-setup rev-or-range nil args files)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I might eventually add something like this to Magit. To make it less likely that I will forget, please open a feature request.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-09-01T14:15:40.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26750" PostTypeId="2" ParentId="26746" CreationDate="2016-09-01T15:10:57.843" Score="1" Body="&lt;p&gt;This might be a problem because some part of this keystroke is interpreted as that letter. Try typing it (like you did in Emacs and using other modifiers) in some other text editor or another thing where you can type in using your input methods, and check your keyboard settings.&lt;/p&gt;&#xA;&#xA;&lt;blockquote class=&quot;spoiler&quot;&gt;&#xA;  &lt;p&gt; I would comment this, but the reputation system here is pretty bad, and I can't even help people if I wanted to.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-09-01T15:10:57.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26751" PostTypeId="1" CreationDate="2016-09-01T15:34:48.313" Score="1" ViewCount="488" Body="&lt;p&gt;I'm having an intermittent issue where Emacs appears to freeze. Pressing &lt;code&gt;C-g&lt;/code&gt; eventually returns control of Emacs to me with the following message in the &lt;code&gt;*Messages*&lt;/code&gt; buffer: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Waiting for process to die...done&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I find out what process is hogging Emacs? &lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2023-11-30T21:01:26.150" Title="How to find what process won't die?" Tags="|process|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26752" PostTypeId="1" CreationDate="2016-09-01T15:39:56.787" Score="1" ViewCount="139" Body="&lt;p&gt;Suppose I do &lt;code&gt;helm-do-grep&lt;/code&gt; or &lt;code&gt;helm-do-ag&lt;/code&gt; on my tex-files, I can select a file on the results list and get a preview in another buffer by pressing tab. Is there a way (by pressing another key, not by redefining tab), to preview the corresponding pdf-file (if available) instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another idea would be to define a variant of 'helm-follow-mode' say 'helm-tex-pdf-follow-mode' which previews the compiled pdf of the corresponding tex file if existend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may say that I could use pdfgrep, but with grep on the source files, I can for example find files containing specific comments (for example tags), not contained in the pdf-file or you can better search for math formulas.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-11-18T22:43:47.957" LastActivityDate="2016-11-19T22:19:08.300" Title="Preview pdf-file if possible when doing `helm-do-grep` or `helm-do-ag`" Tags="|helm|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26753" PostTypeId="2" ParentId="26610" CreationDate="2016-09-01T15:59:24.497" Score="3" Body="&lt;p&gt;I think &lt;a href=&quot;http://orgmode.org/manual/Tracking-your-habits.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org habits&lt;/a&gt; is suitable for this task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise I actually don't see any problem with your current approach. They can indeed be regarded as three separate tasks anyways, since they're quite independent of each other, e.g. whether you watered on Monday doesn't have any impact on whether you'd still have to water it on Wednesday, so why not just leave it as it is? Maybe you can even remove the (1) (3) (5) there so they all show up as &quot;water plants&quot;, just separately, as you wished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe you can look at &lt;a href=&quot;https://emacs.stackexchange.com/questions/7845/org-habit-do-a-repetitive-task-certain-days-of-the-week-only&quot;&gt;this answer&lt;/a&gt;. Though I think your current approach actually makes more sense.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-09-01T15:59:24.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26757" PostTypeId="2" ParentId="26664" CreationDate="2016-09-01T17:38:07.680" Score="0" Body="&lt;p&gt;If you are looking for the interactive commands, there is always &lt;code&gt;C-h b&lt;/code&gt;, which will tell you all of the active keybindings available for current major and minor modes. Search for the mode you are looking for with&lt;code&gt;C-s&lt;/code&gt;. Documentation for each function is linked to as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this for exploring features of a mode, as most of the time the function names are self-explanatory, or it gives me more information to web search or use &lt;code&gt;apropos&lt;/code&gt;to find additional pieces of documentation.&lt;/p&gt;&#xA;" OwnerUserId="6831" LastActivityDate="2016-09-01T17:38:07.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26758" PostTypeId="1" AcceptedAnswerId="26768" CreationDate="2016-09-01T18:34:28.697" Score="2" ViewCount="388" Body="&lt;p&gt;I'd like to discard modified hunks (and ideally, view the diff before) basing on the current buffer position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have diff-hl so that it's quite obvious which part of a buffer are modified. Now, how to view the diff for the current hunk and/or discard it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way I though this might work is some way to jump to magit's view, moving to the selected hunk - this would show the diff, and then &lt;code&gt;k&lt;/code&gt; would discard it. I was also looking at &lt;code&gt;vc-mode&lt;/code&gt;, but didn't find anything that would fit that use-case.&lt;/p&gt;&#xA;" OwnerUserId="13181" LastActivityDate="2016-09-02T01:02:13.703" Title="Discarding modified hunk at current position" Tags="|magit|vc|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26759" PostTypeId="1" AcceptedAnswerId="26761" CreationDate="2016-09-01T19:16:45.283" Score="0" ViewCount="421" Body="&lt;p&gt;I have tried several setups and I just can't seem to be able to get anaconda and yasnippet working at the same time (dabbrev would be nice as well). First I tried reorganizing the order, it was a suggestion somewhere. If one puts anaconda higher(first) than yasnippet, then anaconda will show in the dropdown and yasnippet won't be listed in the dropdown (&lt;code&gt;yas-expand&lt;/code&gt; works though).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my current order:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(company-anaconda company-bbdb company-nxml company-css company-eclim&#xA;  company-semantic company-clang company-xcode company-cmake company-capf&#xA;  company-files (company-dabbrev-code company-gtags company-etags company-keywords&#xA;                 company-web-html company-yasnippet) company-oddmuse)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I place &lt;code&gt;company-anaconda&lt;/code&gt; below(after) company-oddmuse, then yasnippet works, but anaconda does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also tried something like this, to have it specifically working under python-mode, also does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'python-mode-hook (lambda ()&#xA;              (set (make-local-variable 'company-backends) '(company-anaconda :with company-yasnippet))&#xA;                      (company-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'python-mode-hook (lambda ()&#xA;              (set (make-local-variable 'company-backends) '(company-anaconda company-yasnippet))&#xA;                      (company-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the above cases changing the order also does not make a difference. Anyone having problems with this as well?&lt;/p&gt;&#xA;" OwnerUserId="13180" LastEditorUserId="9995" LastEditDate="2016-09-01T19:57:37.543" LastActivityDate="2016-09-01T20:11:48.627" Title="Problem with company-anaconda and company-yasnippet" Tags="|company-mode|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26761" PostTypeId="2" ParentId="26759" CreationDate="2016-09-01T20:11:48.627" Score="0" Body="&lt;p&gt;Ok It seems that I have found an answer myself. Here it is for anybody wanting it as well:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&#xA;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (set (make-local-variable 'company-backends)&#xA;                 '((company-anaconda company-dabbrev-code company-yasnippet)))))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13180" LastActivityDate="2016-09-01T20:11:48.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26762" PostTypeId="1" CreationDate="2016-09-01T20:22:29.793" Score="14" ViewCount="1192" Body="&lt;p&gt;pdf-tools shows by default just one page in the buffer at once. How can it be configured, that it displays multiple pages below each other just like evince does in &quot;continuous&quot; mode, if the zoom factor is small enough such that (parts) of multiple pages fit on one page?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-09-01T21:51:20.603" Title="pdf-tools: View multiple pages in one buffer - like evince's continous mode" Tags="|pdf-tools|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26763" PostTypeId="1" AcceptedAnswerId="26769" CreationDate="2016-09-01T21:06:01.887" Score="1" ViewCount="138" Body="&lt;p&gt;I am new to &lt;code&gt;helm-mode&lt;/code&gt;. When I use it with &lt;code&gt;LaTeX-mode&lt;/code&gt; for editing TeX files, and type backslash I get the following helm buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0Pj1o.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0Pj1o.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I would like to insert the &lt;code&gt;\num&lt;/code&gt; command (from the &lt;code&gt;siunitx&lt;/code&gt; package). However, the command &lt;code&gt;num&lt;/code&gt; is not recognized, so &lt;code&gt;nonumber&lt;/code&gt; is selected by default each time, and I then need to press arrow-up to select it and then press enter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make &lt;code&gt;num&lt;/code&gt; become the default cadidate? (Assuming I type &lt;code&gt;num&lt;/code&gt; much more often than &lt;code&gt;nonumber&lt;/code&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, is there a way to make &lt;code&gt;TeX-insert-macro History&lt;/code&gt; (see above screen shot) the default helm source instead of the current &lt;code&gt;TeX-insert-macro&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2016-09-01T21:32:28.930" LastActivityDate="2016-09-02T01:40:39.473" Title="How to add a macro to helm mode tex insert macro?" Tags="|helm|latex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26764" PostTypeId="2" ParentId="26762" CreationDate="2016-09-01T21:51:20.603" Score="12" Body="&lt;p&gt;It can't do that.  I have some ideas about how to implement this, but nothing has materialized yet.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-09-01T21:51:20.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26765" PostTypeId="1" AcceptedAnswerId="28827" CreationDate="2016-09-01T21:57:48.660" Score="4" ViewCount="517" Body="&lt;p&gt;I'm using Spacemacs, which by default includes &lt;code&gt;spaceline&lt;/code&gt;. I'd like the mode-line to indicate whether I'm in a narrowed buffer or not. So when I do &lt;code&gt;org-narrow-to-subtree&lt;/code&gt;, for instance, spaceline could display &lt;code&gt;Narrowed&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I direct spaceline to display &quot;Narrow&quot; in the mode-line?&lt;/p&gt;&#xA;" OwnerUserId="2494" LastActivityDate="2016-12-22T05:26:34.653" Title="how to direct spaceline to display &quot;Narrowed&quot; in the mode-line?" Tags="|org-mode|spacemacs|mode-line|spaceline|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26766" PostTypeId="2" ParentId="26758" CreationDate="2016-09-02T00:01:30.897" Score="0" Body="&lt;p&gt;Something like this ?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun vc-diff-current-hunk ()&#xA;  &quot;Find the hunk at point in a `vc-diff' buffer and narrow it there.&quot;&#xA;  (interactive)&#xA;  (let ((line (line-number-at-pos))&#xA;        found)&#xA;    (vc-diff)&#xA;    (widen)&#xA;    (goto-char 1)&#xA;    (while (and (not found)&#xA;                (re-search-forward&#xA;                 &quot;^@@ -[0-9]+,[0-9]+ \\+\\([0-9]+\\),\\([0-9]+\\) @@&quot; nil t))&#xA;      (let ((hunk-line (string-to-number (match-string 1)))&#xA;            (hunk-count (string-to-number (match-string 2))))&#xA;        (setq found (and (&amp;gt;= line hunk-line)&#xA;                         (&amp;lt; line (+ hunk-line hunk-count))))))&#xA;    (when found&#xA;      (save-excursion&#xA;        (narrow-to-region&#xA;         (point)&#xA;         (progn&#xA;           (if (ignore-errors (diff-hunk-next) t)&#xA;               (point)&#xA;             (point-max)))))&#xA;      (message &quot;Hunk found&quot;))&#xA;    (unless found&#xA;      (error &quot;Hunk not found&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-09-02T00:01:30.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26767" PostTypeId="2" ParentId="9632" CreationDate="2016-09-02T00:51:18.993" Score="1" Body="&lt;p&gt;To search pdf files, you need pick up these pdf files firstly via helm's file browser, i.e., &lt;code&gt;helm-find-files&lt;/code&gt;, then launch pdf specific action (such as &lt;code&gt;pdfgrep&lt;/code&gt;) there. The point is &lt;code&gt;helm-find-files&lt;/code&gt; is the entry point, so there is no needs to make &lt;code&gt;helm-pdfgrep/grep/git-grep/ack/ag/pt/zgrep&lt;/code&gt; etc.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-09-02T00:51:18.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26768" PostTypeId="2" ParentId="26758" CreationDate="2016-09-02T01:02:13.703" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;diff-hl: &lt;code&gt;diff-hl-revert-hunk&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;git-gutter: &lt;code&gt;git-gutter:revert-hunk&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-09-02T01:02:13.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26769" PostTypeId="2" ParentId="26763" CreationDate="2016-09-02T01:40:39.473" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to make num become the default cadidate? (Assuming I&#xA;  type num much more often than nonumber)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You need to teach &lt;code&gt;Tex-insert-macro&lt;/code&gt; to know &lt;code&gt;num&lt;/code&gt;, i.e., add it to the completion collection, it looks like the completion collection is generated by &lt;code&gt;(TeX-symbol-list-filtered)&lt;/code&gt;. I don't know how since I don't use Tex at all. But it is not related to helm anyway.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alternatively, is there a way to make TeX-insert-macro History (see&#xA;  above screen shot) the default helm source instead of the current&#xA;  TeX-insert-macro?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, by setting &lt;code&gt;helm-mode-reverse-history&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, the following is its docstring.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;helm-mode-reverse-history is a variable defined in `helm-mode.el'.&#xA;Its value is t&#xA;&#xA;Documentation:&#xA;Display history source after current source in `helm-mode' handled commands.&#xA;&#xA;You can customize this variable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-09-02T01:40:39.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26770" PostTypeId="2" ParentId="26719" CreationDate="2016-09-02T04:30:12.273" Score="2" Body="&lt;p&gt;I figured it out. Following method 2 outlined in &lt;a href=&quot;https://stackoverflow.com/a/15725437/733823&quot;&gt;this answer&lt;/a&gt;, I just redefined the function &lt;code&gt;vc-steal-lock&lt;/code&gt; by commenting out the chunk of code that has to do with emailing the person from whom you stole the lock.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (eval-after-load &quot;vc&quot;&#xA;  '(defun vc-steal-lock (file rev owner)&#xA;  &quot;Steal the lock on FILE.&quot;&#xA;  (let (file-description)&#xA;    (if rev&#xA;    (setq file-description (format &quot;%s:%s&quot; file rev))&#xA;      (setq file-description file))&#xA;    (when (not (yes-or-no-p (format &quot;Steal the lock on %s from %s? &quot;&#xA;                    file-description owner)))&#xA;      (error &quot;Steal canceled&quot;))&#xA;    (message &quot;Stealing lock on %s...&quot; file)&#xA;    (with-vc-properties&#xA;     (list file)&#xA;     (vc-call steal-lock file rev)&#xA;     `((vc-state . edited)))&#xA;    (vc-resynch-buffer file t t)&#xA;    (message &quot;Stealing lock on %s...done&quot; file)&#xA;    ;; commented this chunk out to avoid emailing re: stealing the lock&#xA;    ;;&#xA;    ;; Write mail after actually stealing, because if the stealing&#xA;    ;; goes wrong, we don't want to send any mail.&#xA;    ;; (compose-mail owner (format &quot;Stolen lock on %s&quot; file-description))&#xA;    ;; (setq default-directory (expand-file-name &quot;~/&quot;))&#xA;    ;; (goto-char (point-max))&#xA;    ;; (insert&#xA;    ;;  (format &quot;I stole the lock on %s, &quot; file-description)&#xA;    ;;  (current-time-string)&#xA;    ;;  &quot;.\n&quot;)&#xA;    ;; (message &quot;Please explain why you stole the lock.  Type C-c C-c when done.&quot;)&#xA;    )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6692" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-02T04:30:12.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26771" PostTypeId="1" AcceptedAnswerId="26772" CreationDate="2016-09-02T05:09:35.967" Score="1" ViewCount="109" Body="&lt;p&gt;&lt;strong&gt;Project&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Push every new &lt;code&gt;this-command&lt;/code&gt; onto a list containing any previously pushed &lt;code&gt;this-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Limit the list to a variable length (e.g., 3 or 5), and chop off the oldest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) Compare whether all elements of the list are &lt;code&gt;eq&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar this-command-list nil)&#xA;&#xA;(defvar maximum-elements 3)&#xA;&#xA;(defun pre-command-hook-fn ()&#xA;  (push this-command this-command-list)&#xA;  (if (&amp;gt; (length this-command-list) maximum-elements)&#xA;    (setq this-command-list (delq (last this-command-list) this-command-list)))&#xA;  (TEST IF ALL ELEMENTS of `this-command-list' ARE THE SAME))&#xA;&#xA;(add-hook 'pre-command-hook 'pre-command-hook-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background (aka why)&lt;/strong&gt;:  I am instituting a concept similar to the deplacement-command list used by flyspell -- i.e., if &lt;code&gt;this-command&lt;/code&gt; is the same as &lt;code&gt;last-command&lt;/code&gt; and it is also a &lt;code&gt;memq&lt;/code&gt; of a list of certain deplacement commands, then don't do a costly function.  The difference here is that I want to compare a variable number of previous commands with the current command -- e.g., if I move the cursor (consecutively) 3 or 5 times to the left, then skip the costly function that would ordinarily run every command loop.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  The following is a working solution based on the answer by @phils below.  I thought it important to correct the mistake above which used &lt;code&gt;delq&lt;/code&gt; instead of &lt;code&gt;nbutlast&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(defvar this-command-list nil)&#xA;&#xA;(defvar maximum-elements 3)&#xA;&#xA;(defun pre-command-hook-fn ()&#xA;  (push this-command this-command-list)&#xA;  (when (&amp;gt; (length this-command-list) maximum-elements)&#xA;    (setq this-command-list (nbutlast this-command-list)))&#xA;  (message &quot;test:  %s&quot; (eq (length (cl-remove-duplicates this-command-list)) 1)))&#xA;&#xA;(add-hook 'pre-command-hook 'pre-command-hook-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-09-02T15:21:05.813" LastActivityDate="2016-09-02T17:21:57.147" Title="Test whether all elements/symbols of a list are the same (eq)" Tags="|list|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26772" PostTypeId="2" ParentId="26771" CreationDate="2016-09-02T05:58:13.803" Score="3" Body="&lt;p&gt;How about:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eq (length (cl-remove-duplicates SEQ)) 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-09-02T05:58:13.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26773" PostTypeId="2" ParentId="26771" CreationDate="2016-09-02T06:05:35.320" Score="4" Body="&lt;p&gt;We don't actually need to keep track of the last &lt;em&gt;N&lt;/em&gt; commands, just the last command, and how many times it's repeated. This code will send a message when a command is called too many consecutive times.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-last-fn-repeat-count 0&#xA;  &quot;How many consecutive times the last function has been called.&quot;)&#xA;&#xA;(defvar repeat-limit 5&#xA;  &quot;When a command has repeated this many times, consider that too much.&quot;)&#xA;&#xA;(defun pre-command-hook-fn ()&#xA;  &quot;Warn when we're repeating too much.&quot;&#xA;  (if (eq this-command last-command)&#xA;      (incf my-last-fn-repeat-count)&#xA;    (setq my-last-fn-repeat-count 0))&#xA;&#xA;  (when (&amp;gt;= my-last-fn-repeat-count repeat-limit)&#xA;    (message &quot;You've repeated too much.&quot;)))&#xA;&#xA;(add-hook 'pre-command-hook 'pre-command-hook-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the benefit of not needing to do any list creation or searching, so it's a bit simpler. It should be faster, but I can't imagine working with a five-element list to ever be slow, so speed isn't a real-life benefit.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-09-02T06:05:35.320" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26774" PostTypeId="2" ParentId="26708" CreationDate="2016-09-02T06:07:31.690" Score="6" Body="&lt;p&gt;&lt;code&gt;TERM&lt;/code&gt; is an environment variable, you set it in your environment. This could be the environment of a particular shell that you've opened, by running &lt;code&gt;export TERM=foo&lt;/code&gt;, or all of your shells by adding the same command to your .bashrc (or a similar file for your shell, if you don't use bash. but you probably do use bash).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;terminfo&lt;/code&gt; and &lt;code&gt;termcap&lt;/code&gt; are databases containing information about terminals. A terminal was originally a hardware device that combined a display and a keyboard. Your computer would send commands to your terminal to tell it what to display, and of course the terminal would send most keyboard input to the computer (it would handle some keyboard input itself). These days your terminal is a software program running on the computer, but programs still talk to the terminal as if it were an external piece of hardware. The value you set this variable to depends on what program you're running. If you're running XTerm, then set it to &quot;xterm&quot;. If you're running RXVT, then set it to &quot;rxvt&quot;. And so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the terminals were all designed and built by different companies who were all in competition with each other, and so they were all adding features as quickly as possible in order to out-do each other. Naturally, none of these companies designed their terminals using the same command set as their competitors; the sort of standardization we have with HTML and CSS today didn't exist back then. The &lt;code&gt;termcap&lt;/code&gt; database was created to let you use any terminal you happened to want with your computer. A program could query the &lt;code&gt;termcap&lt;/code&gt; database to find out what commands to use for your terminal. Ultimately the program wouldn't need to know anything about any particular terminal; it would just ask &lt;code&gt;termcap&lt;/code&gt; how to do everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;terminfo&lt;/code&gt; is a newer database than &lt;code&gt;termcap&lt;/code&gt;. It contains essentially the same information, and can be considered interchangeable with &lt;code&gt;termcap&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Programs that use &lt;code&gt;termcap&lt;/code&gt; or &lt;code&gt;terminfo&lt;/code&gt; look at the &lt;code&gt;TERM&lt;/code&gt; environment variable to know what kind of terminal you're using; they pass the value along to the database when they make their queries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The emacs &lt;code&gt;shell&lt;/code&gt; and &lt;code&gt;eshell&lt;/code&gt; modes are not really considered terminal emulators; they don't provide any capabilities for changing the text color or moving the cursor around. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;term&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt;, on the other hand, provide essentially all the features you would expect from a mid-range terminal such as a VT100, or xterm. I don't actually know off-hand what &lt;code&gt;TERM&lt;/code&gt; should be set to for these, but I think they set it for you.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-02T06:07:31.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26775" PostTypeId="2" ParentId="26624" CreationDate="2016-09-02T06:22:39.853" Score="0" Body="&lt;p&gt;So the error tells you that &lt;code&gt;gdb-running&lt;/code&gt; needs two arguments, but that's kindof a red herring. &lt;code&gt;gdb-running&lt;/code&gt; doesn't actually do what you want; it doesn't return true or false to tell you whether gdb is currently running. I think it's called when gdb starts receiving gdb's output, as it appears to set several state variables that are used elsewhere. It looks like you could use the &lt;code&gt;gud-running&lt;/code&gt; variable, or &lt;code&gt;gdb-inferior-status&lt;/code&gt;. The former will be &lt;code&gt;t&lt;/code&gt;, and the latter will be &lt;code&gt;&quot;running&quot;&lt;/code&gt;, so these might work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if gud-running&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (equal gdb-inferior-status &quot;running&quot;)&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-02T06:22:39.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26776" PostTypeId="1" AcceptedAnswerId="27428" CreationDate="2016-09-02T07:12:11.520" Score="1" ViewCount="222" Body="&lt;p&gt;I want the image tooltip code also make work for pdf format, thus I added the pdf keyword to the file extension list of the original code (&lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/Displaying-image-overlays-on-image-filenames-in-Emacs/#sec-1&quot; rel=&quot;nofollow&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/Displaying-image-overlays-on-image-filenames-in-Emacs/#sec-1&lt;/a&gt;)). However it doesn't work with pdf. How can I make this work?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar image-tooltip-re (concat  &quot;\\(?3:'\\|\&quot;\\)\\(?1:.*\\.&quot;&#xA;                                  (regexp-opt '(&quot;png&quot; &quot;PNG&quot; &quot;JPG&quot; &quot;jpeg&quot;&#xA;                                                &quot;jpg&quot; &quot;JPEG&quot; &quot;eps&quot; &quot;EPS&quot; &quot;pdf&quot;))&#xA;                                  &quot;\\)\\(?:\\3\\)&quot;)&#xA;  &quot;Regexp to match image filenames in quotes&quot;)&#xA;&#xA;(defun image-tooltip (window object position)&#xA;  (save-excursion&#xA;    (goto-char position)&#xA;    (let (beg end imgfile img s)&#xA;      (while (not (looking-at image-tooltip-re))&#xA;        (forward-char -1))&#xA;      (setq imgfile (match-string-no-properties 1))&#xA;      (when (file-exists-p imgfile)&#xA;        (setq img (create-image (expand-file-name imgfile)&#xA;                                'imagemagick nil :width 200))&#xA;        (propertize &quot;Look in the minibuffer&quot;&#xA;                    'display img)))))&#xA;&#xA;(font-lock-add-keywords&#xA; nil&#xA; `((,image-tooltip-re&#xA;    0 '(face font-lock-keyword-face&#xA;             help-echo image-tooltip))))&#xA;&#xA;(font-lock-fontify-buffer)&#xA;(setq x-gtk-use-system-tooltips nil)&#xA;&#xA;&quot;tikz-standalone.pdf&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think the imagemagick backend should support it, for example I can do &lt;code&gt;display file.pdf&lt;/code&gt; from command line.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-09-02T09:05:35.933" LastActivityDate="2016-09-28T20:08:29.767" Title="Image tooltips with pdf" Tags="|images|pdf|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26777" PostTypeId="2" ParentId="24603" CreationDate="2016-09-02T08:26:36.507" Score="2" Body="&lt;p&gt;A quick and dirty maneer to obtain what you want is simply to choose your context name in order to have them begining with different letters. Say, in your case &lt;code&gt;A-work&lt;/code&gt;, &lt;code&gt;B-work&lt;/code&gt;, &lt;code&gt;C-work&lt;/code&gt;. Or maybe more meaningfull name. I don't know why you have 3 different work context, but I could imagine they address 3 different customer. They probably have different name, so you could name your contexts after them, i.e. &lt;code&gt;Bob-customer1&lt;/code&gt;, &lt;code&gt;Alice-customer2&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to keep the names &lt;code&gt;work-A&lt;/code&gt;, &lt;code&gt;work-B&lt;/code&gt; etc., another way is simply to put the desired shortcut letter at their begining. I.e. &lt;code&gt;awork-A&lt;/code&gt;, &lt;code&gt;bwork-B&lt;/code&gt;. You should now see &lt;code&gt;[a]work-A&lt;/code&gt; and &lt;code&gt;[b]work-B&lt;/code&gt; when trying to select a profile.&lt;/p&gt;&#xA;" OwnerUserId="13187" LastActivityDate="2016-09-02T08:26:36.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26778" PostTypeId="2" ParentId="26661" CreationDate="2016-09-02T09:02:19.950" Score="1" Body="&lt;p&gt;I found the solution in the archives of the notmuch-mailing list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to remove &quot;application/zip&quot; from `mm-inlined-types'.&#xA;Putting this in my init file solved it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mm-inlined-types (remove &quot;application/zip&quot; mm-inlined-types))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2016-09-02T09:02:19.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26779" PostTypeId="1" AcceptedAnswerId="26797" CreationDate="2016-09-02T09:10:44.840" Score="10" ViewCount="637" Body="&lt;p&gt;If I press &lt;code&gt;M-q&lt;/code&gt; in a docstring like this, then the line breaks in the docstring get messed up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo(word):&#xA;  &quot;&quot;&quot;&#xA;  This is a function that does something.&#xA;  @param word: str, input.&#xA;  @returns: True&#xA;  &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo(word):&#xA;  &quot;&quot;&quot;This is a function that does something. @param word:&#xA;  str, input. @returns: True&#xA;  &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="600" LastEditorUserId="600" LastEditDate="2016-09-02T12:25:10.043" LastActivityDate="2016-09-02T20:51:32.340" Title="How can I make fill-paragraph regard the formatting rules of Python docstrings?" Tags="|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26780" PostTypeId="1" AcceptedAnswerId="26788" CreationDate="2016-09-02T09:17:36.070" Score="8" ViewCount="746" Body="&lt;p&gt;How to write Org-mode, (maybe need use LaTeX) to archive this effect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/C5GS4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/C5GS4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-09-03T21:19:11.483" Title="How to add annotation in PDF src block like in this screenshot?" Tags="|org-mode|latex|pdf|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26781" PostTypeId="1" CreationDate="2016-09-02T11:01:10.523" Score="8" ViewCount="7306" Body="&lt;p&gt;I would like as said in the title customize colors of the differents levels in org-mode. I have tried from the &lt;code&gt;customize-group&lt;/code&gt; menu then &lt;code&gt;org-face&lt;/code&gt; but it looks like I can't change colors there.&#xA;So, I've to do it manually but what shall I add in my .init.el file ?&#xA;I've added the package color-theme and tried smth like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (org-level-1 ((t (:foreground &quot;yellow&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I get the follwing error :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's function definition is void: org-level-1&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Unfortunateley I'm quite new to debugging with Emacs...Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="105" LastEditDate="2016-09-02T18:15:01.597" LastActivityDate="2016-09-02T20:51:41.387" Title="customize colors of level in org-mode" Tags="|org-mode|themes|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26782" PostTypeId="2" ParentId="26781" CreationDate="2016-09-02T11:42:48.577" Score="2" Body="&lt;p&gt;You can customise the colours of different levels with the following steps:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize &amp;lt;RET&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in the search box, enter &lt;code&gt;org level 1&lt;/code&gt; and hit &lt;code&gt;Search&lt;/code&gt; button. Then you can see &lt;code&gt;Org level 1 face&lt;/code&gt; through &lt;code&gt;Org level 8 face&lt;/code&gt;. Expand the nodes you want to modify and set the attributes as you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't forget to save the result with &lt;code&gt;Save for future session&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="630" LastActivityDate="2016-09-02T11:42:48.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26783" PostTypeId="2" ParentId="26781" CreationDate="2016-09-02T12:10:16.067" Score="6" Body="&lt;p&gt;I think your main problem here is actually you do not consider org-level-1 the face but org-level-1 the function (which is not existing as the error message indicates it). You can use something like that to customize in your init file&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-theme-set-faces 'user&#xA;                        `(org-level-1 ((t (:foreground &quot;yellow&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13189" LastActivityDate="2016-09-02T12:10:16.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26784" PostTypeId="2" ParentId="26781" CreationDate="2016-09-02T13:14:42.713" Score="2" Body="&lt;p&gt;You could also make a your own hook for org-mode. That way you could set multiple faces inside the hook and they will all be loaded after org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-mode-hook ()&#xA;  &quot;My `org-mode' hook&quot;&#xA;  (set-face-attribute org-level-1 nil :foreground &quot;yellow&quot;)&#xA;  (set-face-attribute org-level-2 nil :foreground &quot;blue&quot;))  ; just add to the list&#xA;&#xA;(add-hook 'org-mode-hook 'my/org-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="12195" LastEditDate="2016-09-02T20:51:41.387" LastActivityDate="2016-09-02T20:51:41.387" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26785" PostTypeId="1" CreationDate="2016-09-02T15:06:05.350" Score="1" ViewCount="228" Body="&lt;p&gt;There is a function in ESS called &lt;strong&gt;ess-sas-goto-log&lt;/strong&gt; (&lt;a href=&quot;https://github.com/emacs-ess/ESS/blob/master/lisp/ess-sas-a.el#L705&quot; rel=&quot;nofollow&quot;&gt;https://github.com/emacs-ess/ESS/blob/master/lisp/ess-sas-a.el#L705&lt;/a&gt;) that will open a log file and search forward using re-search-forward. I would like to make a version that searches backwards. What would be the best way to go about this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can simply replace search-forward with search-backward but I would like to do it the proper way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13191" LastEditorUserId="105" LastEditDate="2016-09-02T18:13:20.310" LastActivityDate="2016-09-02T18:13:20.310" Title="What is the best way to modify an existing function from a package?" Tags="|ess|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26788" PostTypeId="2" ParentId="26780" CreationDate="2016-09-02T16:23:56.137" Score="11" Body="&lt;p&gt;This answer is focused on what I'm interested in, therefore it uses &lt;code&gt;minted&lt;/code&gt; for source code listings with Org, and &lt;code&gt;tikzmark&lt;/code&gt; as the package that can &quot;mark&quot; a place in your listing so that you can later refer to it from a Tikz picture. Here's a simple example (UPDATED):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage{tikz}&#xA;#+LATEX_HEADER: \usepackage{minted}&#xA;#+LATEX_HEADER: \usetikzlibrary{tikzmark}&#xA;#+OPTIONS: toc:nil&#xA;&#xA;* Using minted with tikzmark &#xA;&#xA;# Org mode sample configuration (in your init.el file):&#xA;#+BEGIN_SRC emacs-lisp :exports none&#xA;  (setq org-latex-listings 'minted)&#xA;  (setq org-latex-minted-options&#xA;        '((&quot;frame&quot; &quot;lines&quot;) (&quot;linenos&quot; &quot;true&quot;)))&#xA;#+END_SRC&#xA;&#xA;#+ATTR_LATEX: :caption \caption{Yes}\label{lst:code}&#xA;#+BEGIN_listing &#xA;#+ATTR_LATEX: :options escapeinside=||&#xA;#+BEGIN_SRC c&#xA;  #include &amp;lt;stdio.h&amp;gt;&#xA;&#xA;  int main()&#xA;  {&#xA;    // comment &#xA;    printf(&quot;hello world\n&quot;); |$\tikzmark{too}$|&#xA;    return 0;&#xA;  }&#xA;#+END_SRC&#xA;#+END_listing&#xA;&#xA;#+BEGIN_LaTeX&#xA;\begin{tikzpicture}[overlay,remember picture]&#xA;\draw[dashed,-&amp;gt;] (pic cs:too) ++(0,0.25) to[bend left] &#xA;                 ++(5,-1)node[right]{$\bullet$ Here it is too!};&#xA;\end{tikzpicture}&#xA;#+END_LaTeX&#xA;&#xA;As you can see in code listing \ref{lst:code}, \ldots&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... and this is the result (exported to LaTeX - XeLaTeX in my case):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RcVCp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RcVCp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I edited the original answer to show how to place marks outside comments (using the pygments option &quot;escapeinside&quot;, instead of the comment-limited &quot;mathescape&quot; option from the original answer) and how to set up a caption, a label for this environment, and also how to get a reference to it. HTH&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;2ND UPDATE: Here's a version of the same code (same output), that manages to use &lt;code&gt;#+CAPTION&lt;/code&gt;, &lt;code&gt;#+LABEL&lt;/code&gt; and &lt;code&gt;[[lst:ref]]&lt;/code&gt; styles instead of the latex ones, &lt;em&gt;AND&lt;/em&gt; gets rid of the enveloping listing environment completely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage{tikz}&#xA;#+LATEX_HEADER: \usetikzlibrary{tikzmark}&#xA;#+OPTIONS: toc:nil&#xA;&#xA;* Using minted with tikzmark &#xA;&#xA;# Org mode configuration:&#xA;#+BEGIN_SRC emacs-lisp :exports none&#xA;  (setq org-latex-listings 'minted)&#xA;  (setq org-latex-minted-options&#xA;        '((&quot;frame&quot; &quot;lines&quot;) (&quot;linenos&quot; &quot;true&quot;) (&quot;escapeinside&quot; &quot;||&quot;)))&#xA;#+END_SRC&#xA;&#xA;#+LABEL: lst:code&#xA;#+CAPTION: Yes&#xA;#+BEGIN_SRC c&#xA;  #include &amp;lt;stdio.h&amp;gt;&#xA;&#xA;  int main()&#xA;  {&#xA;    // comment &#xA;    printf(&quot;hello world\n&quot;); |$\tikzmark{too}$|&#xA;    return 0;&#xA;  }&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_LaTeX&#xA;    \begin{tikzpicture}[overlay,remember picture]&#xA;      \draw[dashed,-&amp;gt;] (pic cs:too) ++(0,0.25) to[bend left]&#xA;      ++(5,-1)node[right]{$\bullet$ Here it is too!};&#xA;    \end{tikzpicture}&#xA;#+END_LaTeX&#xA;&#xA;As you can see in [[lst:code]], \ldots&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This didn't work, until I got rid of the &lt;code&gt;#+ATTR_LATEX:&lt;/code&gt; line - no matter where I tried to put it, it interfered with the association between caption/label and the source block.&lt;/p&gt;&#xA;" OwnerUserId="8708" LastEditorUserId="8708" LastEditDate="2016-09-03T21:19:11.483" LastActivityDate="2016-09-03T21:19:11.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26790" PostTypeId="2" ParentId="26718" CreationDate="2016-09-02T17:10:37.170" Score="1" Body="&lt;p&gt;Since it seems like there is no option to remove them, I created a hack to work around this. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-fill-paragraph (&amp;amp;optional justify)&#xA;  (interactive &quot;P&quot;)&#xA;  (backward-paragraph)&#xA;  (skip-chars-forward &quot; \n\t&quot;)&#xA;  (indent-to-left-margin)&#xA;  (fill-paragraph))&#xA;&#xA;(setq fill-paragraph-function 'my-fill-paragraph)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What this does is moving at the beginning of the paragraph, skip any whitespace and newline and then indent the first line of the paragraph to &lt;code&gt;left-margin&lt;/code&gt;. After that, it just runs &lt;code&gt;fill-paragraph&lt;/code&gt; normally with the new indentation.&lt;/p&gt;&#xA;" OwnerUserId="13140" LastActivityDate="2016-09-02T17:10:37.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26793" PostTypeId="1" AcceptedAnswerId="26794" CreationDate="2016-09-02T17:45:18.293" Score="1" ViewCount="1997" Body="&lt;p&gt;I have multiple org files in my Dropbox directory. I wanted to add all of them into my org-agenda. So as normally prescribed I used &lt;code&gt;org-agenda-files&lt;/code&gt;. Infact I'm adding the the part of my .emacs that corresponds to org-mode setup below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ############  ORG-MODE  ####################&#xA;;; ## To enable shift - arrow mode for navigation (does not work in CUA mode)&#xA;(require 'org)&#xA;(setq org-support-shift-select t)&#xA;(setq org-todo-keywords&#xA;      '((sequence &quot;TODO(t)&quot; &quot;STARTED(s)&quot; &quot;ISSUE(p)&quot; &quot;INPUTNEEDED(i)&quot; &quot;VERIFY(v)&quot; &quot;|&quot; &quot;SCOPECHANGE(c)&quot; &quot;DONE(d)&quot; &quot;DELEGATED(o)&quot;)))&#xA;;; To hightlight code blocks ** SO Link: https://stackoverflow.com/questions/10642888/syntax-highlighting-within-begin-src-block-in-emacs-orgmode-not-working **&#xA;(setq org-src-fontify-natively t)&#xA;(setq org-directory &quot;~/orgFiles&quot;)&#xA;(setq org-mobile-inbox-for-pull  &quot;~/orgFiles/from-mobile.org&quot;)&#xA;(setq org-mobile-directory &quot;~/Apps/mobileorg&quot;)&#xA;;; ## Make RefTeX work in org-mode&#xA;;; ## https://emacs.stackexchange.com/questions/3375/loading-bibtex-file-in-org-mode-file&#xA;(setq org-latex-pdf-process '(&quot;texi2dvi -p -b -V %f&quot;))&#xA;(define-key org-mode-map (kbd &quot;C-c [&quot;) 'org-reftex-citation)&#xA;&#xA;(setq org-agenda-files '(&quot;~/Professional&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also verified that the variable is getting set by Performing &lt;code&gt;M-x customize-variable org-agenda-files&lt;/code&gt;. Now when I perform &lt;code&gt;M-x org-agenda t&lt;/code&gt;. I get the following output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Global list of TODO items of type: ALL&#xA;Available with `N r': (0)[ALL]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have numerous TODO in the org-files in the folder and I dont know why they dont get reported in the &lt;code&gt;org-agenda&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="8683" LastEditorUserId="8683" LastEditDate="2016-09-02T19:20:31.270" LastActivityDate="2016-09-02T19:21:06.070" Title="org-agenda-files not getting set in .emacs" Tags="|org-mode|init-file|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26794" PostTypeId="2" ParentId="26793" CreationDate="2016-09-02T18:53:20.290" Score="2" Body="&lt;p&gt;I fixed the problem. Apparently the &lt;code&gt;org-agenda-files&lt;/code&gt; can only add the org files that are immediately in the directory path. It cannot recursively add org files in the subdirectories, which was how my org files were stored. I solved it using the recipe as described in the SO answer &lt;a href=&quot;https://stackoverflow.com/a/11384907/1652217&quot;&gt;here&lt;/a&gt;. The full elisp code is attached below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ## Search org files recursively and add it to agenda&#xA;;; https://stackoverflow.com/questions/11384516/how-to-make-all-org-files-under-a-folder-added-in-agenda-list-automatically&#xA;;; recursively find .org files in provided directory&#xA;;; modified from an Emacs Lisp Intro example&#xA;(defun sa-find-org-file-recursively (&amp;amp;optional directory filext)&#xA;  &quot;Return .org and .org_archive files recursively from DIRECTORY.&#xA;If FILEXT is provided, return files with extension FILEXT instead.&quot;&#xA;  (interactive &quot;DDirectory: &quot;)&#xA;  (let* (org-file-list&#xA;     (case-fold-search t)         ; filesystems are case sensitive&#xA;     (file-name-regex &quot;^[^.#].*&quot;) ; exclude dot, autosave, and backup files&#xA;     (filext (or filext &quot;org$\\\|org_archive&quot;))&#xA;     (fileregex (format &quot;%s\\.\\(%s$\\)&quot; file-name-regex filext))&#xA;     (cur-dir-list (directory-files directory t file-name-regex)))&#xA;    ;; loop over directory listing&#xA;    (dolist (file-or-dir cur-dir-list org-file-list) ; returns org-file-list&#xA;      (cond&#xA;       ((file-regular-p file-or-dir) ; regular files&#xA;    (if (string-match fileregex file-or-dir) ; org files&#xA;        (add-to-list 'org-file-list file-or-dir)))&#xA;       ((file-directory-p file-or-dir)&#xA;    (dolist (org-file (sa-find-org-file-recursively file-or-dir filext)&#xA;              org-file-list) ; add files found to result&#xA;      (add-to-list 'org-file-list org-file)))))))&#xA;&#xA;(setq org-agenda-files&#xA;      (append (sa-find-org-file-recursively &quot;~/Professional&quot;)))&#xA;&#xA;(setq org-agenda-text-search-extra-files&#xA;      (append (sa-find-org-file-recursively &quot;~/Professional&quot; &quot;txt&quot;)&#xA;              (sa-find-org-file-recursively &quot;~/Professional&quot; &quot;tex&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8683" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-02T19:21:06.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26795" PostTypeId="2" ParentId="26776" CreationDate="2016-09-02T19:20:15.943" Score="1" Body="&lt;p&gt;pdf is probably not a supported image type for create-image. You probably have to run a command to convert the pdf to a temporary png file (eg. convert some.pdf temp.png), and use the temporary png file in the create-image function.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-09-02T19:20:15.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26796" PostTypeId="2" ParentId="26751" CreationDate="2016-09-02T19:25:53.523" Score="4" Body="&lt;p&gt;You might try at the command line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;kill -USR2 pid&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where pid is the emacs process that is stuck. Sometimes this leads to a traceback that might tell you what is going on.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-09-02T19:25:53.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26797" PostTypeId="2" ParentId="26779" CreationDate="2016-09-02T20:51:32.340" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/glyph/python-docstring-mode/blob/master/README.md&quot; rel=&quot;nofollow&quot;&gt;python-docstring&lt;/a&gt; is a package that overrides fill-paragraph so it is compatible with Python docstrings. It works for both sphinx-doc and reStructuredtext formats. It also provides syntax highlighting, and I believe will highlight markup in your docstrings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may be a good place to start. I haven't tried myself, but if you have a docstring format that isn't included, it should be possible to extend the package. For your use case, I imagine it would be a case of editing the regular expressions that detect variables. It might be harder to get it working for Google-style docstrings, however.&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-02T20:51:32.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26798" PostTypeId="2" ParentId="26142" CreationDate="2016-09-03T06:09:25.320" Score="2" Body="&lt;p&gt;Using &lt;code&gt;(slime)&lt;/code&gt; by itself already splits the buffer, so a separate function to split the buffer is unneeded. By itself it's a one-liner, but to avoid annoying questions and unintended restarts, we need one more statement to check if a slime process is already running:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'lisp-mode-hook '(lambda () &#xA;                              (unless (get-process &quot;SLIME Lisp&quot;)&#xA;                                (slime))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works for me at both start-up and in the middle of a session. If you don't want the cursor to bounce to the REPL, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'lisp-mode-hook '(lambda ()&#xA;                                  (unless (get-process &quot;SLIME Lisp&quot;)&#xA;                                     (let ((oldbuff (current-buffer)))&#xA;                                       (slime)&#xA;                                       (switch-buffer oldbuff))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6831" LastEditorUserId="6831" LastEditDate="2016-09-03T06:19:59.963" LastActivityDate="2016-09-03T06:19:59.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26799" PostTypeId="1" AcceptedAnswerId="37791" CreationDate="2016-09-03T08:40:44.707" Score="5" ViewCount="888" Body="&lt;p&gt;I often find I want to close the nearest parent subtree, but don't know of a better way of doing this than navigating to the header first and then pressing tab.  I use evil-mode, so properly this should be the effect of &lt;code&gt;zc&lt;/code&gt;, but it is not.&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2020-01-04T23:35:25.160" Title="Org-mode: closing the nearest parent" Tags="|org-mode|evil|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26801" PostTypeId="1" CreationDate="2016-09-03T15:19:51.990" Score="2" ViewCount="305" Body="&lt;p&gt;In command line I can start a specific firefox profile doing someting like that:&lt;br&gt;&#xA;&lt;code&gt;firefox -P my_specific_profile&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure emacs for use a specific Firefox profile when using &lt;code&gt;browse-url&lt;/code&gt; command?&lt;/p&gt;&#xA;" OwnerUserId="13200" LastActivityDate="2016-10-03T15:49:38.110" Title="How to start a specific Firefox profile with browse-url?" Tags="|web-browser|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26802" PostTypeId="2" ParentId="26801" CreationDate="2016-09-03T15:31:33.037" Score="1" Body="&lt;p&gt;Take a look &lt;a href=&quot;https://www.emacswiki.org/emacs/BrowseUrl#toc8&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. You'll want to add &lt;code&gt;&quot;-P my_specific_profile&quot;&lt;/code&gt; to &lt;code&gt;browse-url-firefox-arguments&lt;/code&gt;, and everything should work.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-09-03T15:31:33.037" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26805" PostTypeId="1" CreationDate="2016-09-03T18:27:50.987" Score="1" ViewCount="380" Body="&lt;p&gt;Emacs registers are useful but I find remembering the contents of them difficult. Figuring out which register I stored that particular macro in is a pain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a package that allows registers to be referred to by a meaningful name (rather than a single key)? If not, does anyone know of a different solution?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2016-09-03T18:39:58.743" LastActivityDate="2016-09-03T23:32:10.610" Title="How to refer to Emacs registers by name?" Tags="|registers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26807" PostTypeId="1" CreationDate="2016-09-03T20:33:19.817" Score="14" ViewCount="5190" Body="&lt;p&gt;I want to create clickable image links in org-mode. This would be equivalent to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;path-to-file&quot;&amp;gt;&#xA;   &amp;lt;img src=&quot;path-to-image&quot;&amp;gt;&#xA;&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently, I can display inline image previews just fine, with &lt;code&gt;[[path-to-image]]&lt;/code&gt; followed by &lt;code&gt;org-toggle-inline-images&lt;/code&gt;. What I would like to do now, is add support for &lt;code&gt;[[path-to-file][path-to-image]]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2017-02-07T19:01:15.420" LastActivityDate="2023-08-10T09:04:02.757" Title="Create image links in org-mode" Tags="|org-mode|images|org-link|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26808" PostTypeId="2" ParentId="26807" CreationDate="2016-09-03T22:28:35.537" Score="2" Body="&lt;p&gt;Org Mode already supports &lt;a href=&quot;http://orgmode.org/manual/Images-in-HTML-export.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;embedding images in exported HTML&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inline preview functionality does not work for remote images (i.e. those found on the internet). See the &lt;a href=&quot;https://emacs.stackexchange.com/questions/26613/is-it-possible-to-insert-images-from-the-web-with-its-url/26618#26618&quot;&gt;question&lt;/a&gt; about this. Preview &lt;em&gt;does&lt;/em&gt; work for local images, as I think you already know.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-09-03T22:28:35.537" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26809" PostTypeId="2" ParentId="26805" CreationDate="2016-09-03T23:19:13.400" Score="3" Body="&lt;p&gt;One certainly &lt;em&gt;could&lt;/em&gt; write alternative commands which use named registers (internally registers can be anything comparable with &lt;code&gt;eq&lt;/code&gt;), but as of Emacs 24.4 I feel like Emacs already solves your main problems?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting from the NEWS file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** All interactive commands that read a register (`copy-to-register', etc.)&#xA;now display a temporary window after `register-preview-delay' seconds&#xA;that summarizes existing registers.  To disable this, set that option to nil.&#xA;Interactive commands that read registers and want to make use of this&#xA;should use `register-read-with-preview' to read register names.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So when you can't remember which register you used, just pause a moment before you need to enter it, and Emacs will show you the options with most likely enough of the content to identify what it is you're after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's true that in your example case of keyboard macros, the summary register content may be less useful, but there's no need to do what you've asked for when it comes to keyboard macros -- you can &lt;em&gt;already&lt;/em&gt; give those names!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Save Keyboard Macro&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-09-03T23:32:10.610" LastActivityDate="2016-09-03T23:32:10.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26810" PostTypeId="1" AcceptedAnswerId="26830" CreationDate="2016-09-03T23:45:13.173" Score="9" ViewCount="2317" Body="&lt;p&gt;&lt;code&gt;(use-package dired)&lt;/code&gt; complains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Package ‘dired-’ is unavailable&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I see others' emacs configurations do use &lt;code&gt;(use-package dired)&lt;/code&gt;, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/lunaryorn/.emacs.d/blob/088ac57/init.el#L829&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/lunaryorn/.emacs.d/blob/088ac57/init.el#L829&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/bbatsov/emacs.d/blob/d94a751b/init.el#L295&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/bbatsov/emacs.d/blob/d94a751b/init.el#L295&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/mattss/emacs.d/blob/4e3cb1f5/init.el#L113&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/mattss/emacs.d/blob/4e3cb1f5/init.el#L113&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's needed to make dired use-package-able?  Is this something to do with cask?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-09-04T13:46:33.790" Title="Why doesn't (use-package dired) work for me?" Tags="|dired|use-package|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26811" PostTypeId="1" AcceptedAnswerId="26825" CreationDate="2016-09-03T23:56:43.643" Score="12" ViewCount="4662" Body="&lt;p&gt;I'm interested in using languages other than elisp to write emacs extensions, is this possible at all? If python is not supported, what languages are?&lt;/p&gt;&#xA;" OwnerUserId="13011" LastActivityDate="2016-09-04T23:18:24.740" Title="Is there a way to use python instead of elisp for extending emacs?" Tags="|python|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26812" PostTypeId="1" AcceptedAnswerId="26832" CreationDate="2016-09-04T00:05:16.740" Score="1" ViewCount="488" Body="&lt;p&gt;I really love the ability to quickly navigate to files opened in old editing sessions that &lt;code&gt;desktop&lt;/code&gt; provides.  However, there are a few things I don't like about it so I'd like to stop using it if possible, but I'm not quite there yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't like about &lt;code&gt;desktop&lt;/code&gt;:  Note neither of these would be a problem if buffers were merely easily re-openable, rather than immediately re-opened (as &lt;code&gt;desktop-change-dir&lt;/code&gt; does):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Slow startup with large numbers of buffers&lt;/li&gt;&#xA;&lt;li&gt;A tendency to make it harder to diagnose problems in my emacs configuration, because of side-effects from opening buffers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What I'm trying to use instead of &lt;code&gt;desktop&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;ido-use-virtual-buffers&lt;/code&gt;: This &lt;code&gt;ido&lt;/code&gt; feature keeps a list of closed buffers.  When using ido to switch buffer, the closed buffers show up too (with a different face and different prioritization).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;saveplace&lt;/code&gt; to save &lt;code&gt;point&lt;/code&gt; (cursor position) in buffers&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;savehist&lt;/code&gt; to save minibuffer history&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is all great, except that &lt;code&gt;ido&lt;/code&gt; is only saving a small number of buffers for me in &lt;code&gt;ido.last&lt;/code&gt;.  How can I have several hundred buffers saved by &lt;code&gt;ido&lt;/code&gt; across emacs restart, and have them saved whether they are closed ('virtual') or not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;s&gt;Customizing &lt;code&gt;ido-max-work-file-list&lt;/code&gt; doesn't seem to have any effect for me.&lt;/s&gt; -- actually it does, see answer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of &lt;code&gt;projectile&lt;/code&gt; and use that too, but this is a bit different.  I'm also aware of &lt;code&gt;recentf&lt;/code&gt;, but I'd prefer to stick with &lt;code&gt;ido-use-virtual-buffers&lt;/code&gt;, because aside from lack of persistence across emacs sessions it works perfectly for me.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2016-09-04T13:53:25.343" LastActivityDate="2016-12-10T20:28:30.737" Title="Configuring the number of buffers saved by ido, using ido-use-virtual-buffers?" Tags="|ido|desktop|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26814" PostTypeId="2" ParentId="26799" CreationDate="2016-09-04T00:35:47.740" Score="2" Body="&lt;p&gt;How about something like this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-cycle-parent-heading ()&#xA;    (interactive)&#xA;    (org-back-to-heading)&#xA;    (org-cycle)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;use-package&lt;/code&gt;, &lt;code&gt;general&lt;/code&gt; and &lt;code&gt;evil-org-mode&lt;/code&gt;, so my key binding configuration for that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org&#xA;    :general&#xA;    (:states '(normal) :keymaps 'evil-org-mode-map&#xA;         &quot;zc&quot; 'my/org-cycle-parent-heading))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2016-09-04T00:44:36.987" LastActivityDate="2016-09-04T00:44:36.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26816" PostTypeId="2" ParentId="25029" CreationDate="2016-09-04T02:15:55.273" Score="4" Body="&lt;h3&gt;Create &lt;a href=&quot;http://orgmode.org/manual/Tables.html#Tables&quot; rel=&quot;nofollow&quot;&gt;table&lt;/a&gt; function, i.e. &lt;code&gt;#+TBLFM:&lt;/code&gt;, and use the built-in &lt;a href=&quot;http://orgmode.org/manual/Lookup-functions.html#Lookup-functions&quot; rel=&quot;nofollow&quot;&gt;org-lookup-all&lt;/a&gt; function with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Comparison.html#index-string_003d&quot; rel=&quot;nofollow&quot;&gt;string=&lt;/a&gt; predicate and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Calling-Functions.html#index-apply&quot; rel=&quot;nofollow&quot;&gt;apply&lt;/a&gt; elisp function.&lt;/h3&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Use the Literal mode &lt;a href=&quot;http://orgmode.org/manual/Formula-syntax-for-Calc.html&quot; rel=&quot;nofollow&quot;&gt;L&lt;/a&gt; or the cell address &lt;a href=&quot;http://orgmode.org/manual/References.html&quot; rel=&quot;nofollow&quot;&gt;references&lt;/a&gt; may misbehave.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've wondered how to do calculations against filtered subset of an org-mode table data for years and never figured out how until today!&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The Answer&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Day | Start |   End | Home |  Sum |&#xA;|-----+-------+-------+------+------|&#xA;|   1 | 09:00 | 17:00 | No   | 8.00 |&#xA;|   2 | 09:00 | 12:00 | No   | 3.00 |&#xA;|   2 | 13:00 | 20:00 | Yes  | 7.00 |&#xA;|-----+-------+-------+------+------|&#xA;|     |       |       | 7.0  | 11.0 |&#xA;#+TBLFM: @2$5..@-1$5=$3-$2;t::@&amp;gt;$4='(apply '+ (org-lookup-all &quot;Yes&quot; '(@I$4..@II$4) '(@I$5..@II$5) 'string= ));L::@&amp;gt;$5='(apply '+ (org-lookup-all &quot;No&quot; '(@I$4..@II$4) '(@I$5..@II$5) 'string= ));L&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;The Tricky Bits&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Filtering the table with &lt;code&gt;org-lookup-all&lt;/code&gt; function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-lookup-all VAL S-LIST R-LIST &amp;amp;optional PREDICATE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;VAL&lt;/code&gt; is the filter value, e.g. &lt;em&gt;Yes&lt;/em&gt; or &lt;em&gt;No&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;S-LIST&lt;/code&gt; is the search list, e.g. &lt;code&gt;(&quot;No&quot; &quot;No&quot; &quot;Yes&quot;)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;R-LIST&lt;/code&gt; is the returned list, e.g. &lt;code&gt;(8.00 3.00 7.00)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;PREDICATE&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; optional in our answer because we're comparing strings, e.g. &lt;code&gt;string=&lt;/code&gt;    &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Returns a filtered list, e.g. &lt;code&gt;(8.0 3.0)&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;code&gt;apply&lt;/code&gt; elisp function instead of the &lt;code&gt;vsum&lt;/code&gt; calc function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Couldn't get &lt;code&gt;vsum&lt;/code&gt; to work - &lt;strong&gt;blah&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thank you for asking your question!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This code was tested using&lt;br&gt;&#xA;  GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)&lt;br&gt;&#xA;  Org-Mode Version: 8.3.5  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-09-04T03:10:05.103" LastActivityDate="2016-09-04T03:10:05.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26817" PostTypeId="2" ParentId="26059" CreationDate="2016-09-04T06:12:54.133" Score="2" Body="&lt;p&gt;God Mode might be close to what you're after. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/chrisdone/god-mode&quot; rel=&quot;nofollow&quot;&gt;https://github.com/chrisdone/god-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am liking about god mode is that for short operations, the usual suspects work.  If I am just saving a file, it's a simple C-x C-s.   If I am doing some heavy editing (killing, yanking, moving, etc) then I can enter god mode and everything is implicitly prefixed with Control.&lt;/p&gt;&#xA;" OwnerUserId="791" LastActivityDate="2016-09-04T06:12:54.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26818" PostTypeId="1" CreationDate="2016-09-04T07:30:50.723" Score="1" ViewCount="2885" Body="&lt;p&gt;I'm trying to change the cursor type in Emacs. Here are the steps I'm following,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-h v cursor-type&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;check the value of cursor type. It is set to t.&lt;/li&gt;&#xA;&lt;li&gt;start emacs with &lt;code&gt;emacs -nw -Q&lt;/code&gt; and type &lt;code&gt;(setq cursor-type 'bar)&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;move the cursor to the end of the line and press &lt;code&gt;C-x C-e&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;check the value of cursor type. It is set to &lt;code&gt;bar&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What result I'm expecting?&#xA;The cursor type to change to &lt;code&gt;bar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What result I'm seeing?&#xA;The cursor type remains default style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tested the same steps with GUI version of Emacs. Launched via &lt;code&gt;emacs -Q&lt;/code&gt; from terminal. I'm able to change the cursor type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have Mate desktop environment and running this in &lt;code&gt;mate-terminal&lt;/code&gt;. The &lt;code&gt;TERM&lt;/code&gt; is set to &lt;code&gt;xterm&lt;/code&gt; and i have also tried with setting &lt;code&gt;TERM&lt;/code&gt; to &lt;code&gt;xterm-256color&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using debian and my emacs version and configuration are as follows,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;``` &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In GNU Emacs 25.0.94.1 (i686-pc-linux-gnu, GTK+ Version 2.24.25)&#xA; of 2016-08-30 built on hari-laptop&#xA;System Description:     Debian GNU/Linux 8.5 (jessie)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Configured using:&#xA; 'configure --with-xpm=no --with-jpeg=no --with-gif=no --with-tiff=no'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Configured features:&#xA;PNG SOUND GSETTINGS NOTIFY FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2&#xA;X11&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Important settings:&#xA;  value of $LANG: en_US.UTF-8&#xA;  locale-coding-system: utf-8-unix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Major mode: Lisp Interaction&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minor modes in effect:&#xA;  tooltip-mode: t&#xA;  global-eldoc-mode: t&#xA;  electric-indent-mode: t&#xA;  mouse-wheel-mode: t&#xA;  tool-bar-mode: t&#xA;  menu-bar-mode: t&#xA;  file-name-shadow-mode: t&#xA;  global-font-lock-mode: t&#xA;  font-lock-mode: t&#xA;  auto-composition-mode: t&#xA;  auto-encryption-mode: t&#xA;  auto-compression-mode: t&#xA;  line-number-mode: t&#xA;  transient-mark-mode: t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recent messages:&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;Making completion list... [2 times]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Load-path shadows:&#xA;None found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Features:&#xA;(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml&#xA;mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies&#xA;mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail&#xA;rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu&#xA;cl-loaddefs pcase cl-lib mail-prsvr mail-utils term/xterm xterm&#xA;time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks&#xA;lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset&#xA;image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode&#xA;prog-mode register page menu-bar rfn-eshadow timer select scroll-bar&#xA;mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham&#xA;georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao&#xA;korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech&#xA;european ethiopic indian cyrillic chinese charscript case-table epa-hook&#xA;jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice&#xA;loaddefs button faces cus-face macroexp files text-properties overlay&#xA;sha1 md5 base64 format env code-pages mule custom widget&#xA;hashtable-print-readable backquote inotify dynamic-setting&#xA;system-font-setting font-render-setting move-toolbar gtk x-toolkit x&#xA;multi-tty make-network-process emacs)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Memory information:&#xA;((conses 8 91186 5077)&#xA; (symbols 24 19688 0)&#xA; (miscs 20 34 138)&#xA; (strings 16 14444 3826)&#xA; (string-bytes 1 410993)&#xA; (vectors 8 10488)&#xA; (vector-slots 4 397081 4396)&#xA; (floats 8 167 500)&#xA; (intervals 28 192 14)&#xA; (buffers 520 12)&#xA; (heap 1024 30704 569))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;``` &lt;/p&gt;&#xA;" OwnerUserId="9573" LastActivityDate="2019-10-17T11:27:43.007" Title="Unable to change cursor type in terminal" Tags="|terminal-emacs|cursor|term|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26819" PostTypeId="2" ParentId="26811" CreationDate="2016-09-04T07:37:09.097" Score="5" Body="&lt;p&gt;There is something called &lt;a href=&quot;https://github.com/pinard/Pymacs&quot; rel=&quot;noreferrer&quot;&gt;Pymacs&lt;/a&gt; which is an python to emacs-lisp interface. Although the project doesn't seem that active. The wiki keeps &lt;a href=&quot;http://www.emacswiki.org/emacs/CategoryExtensionLanguage&quot; rel=&quot;noreferrer&quot;&gt;a list&lt;/a&gt; of other modules that allows you to extend emacs in something other than elisp.&lt;/p&gt;&#xA;" OwnerUserId="11966" LastEditorUserId="12892" LastEditDate="2016-09-04T13:35:13.363" LastActivityDate="2016-09-04T13:35:13.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26820" PostTypeId="1" AcceptedAnswerId="26822" CreationDate="2016-09-04T08:01:50.090" Score="1" ViewCount="3889" Body="&lt;p&gt;Below is my emacs init file that relates to Go. I'm trying to use company mode to auto completes Go.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;;;===================================================&#xA;; Golang related configuration&#xA;;;===================================================&#xA;(defun my-go-mode-hook ()&#xA;  ; Add go-guru&#xA;  (require 'go-guru)&#xA;&#xA;  (require 'company)&#xA;  (require 'company-go)&#xA;&#xA;  ; Use goimports instead of go-fmt&#xA;  (setq gofmt-command &amp;quot;goimports&amp;quot;)&#xA;  ; Call Gofmt before saving&#xA;  (add-hook 'before-save-hook 'gofmt-before-save)&#xA;  ; Customize compile command to run go build&#xA;  (if (not (string-match &amp;quot;go&amp;quot; compile-command))&#xA;      (set (make-local-variable 'compile-command)&#xA;           ;&amp;quot;go build -v &amp;amp;&amp;amp; go test -v &amp;amp;&amp;amp; go vet&amp;quot;))&#xA;           &amp;quot;go run&amp;quot;))&#xA;  ; Godef jump key binding&#xA;  (local-set-key (kbd &amp;quot;M-.&amp;quot;) 'godef-jump))&#xA;(add-hook 'go-mode-hook 'my-go-mode-hook)&#xA;; Highlight identifiers in Golang by default&#xA;(add-hook 'go-mode-hook #'go-guru-hl-identifier-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;However, it seems that the company mode can only completes words that have been used in the buffer. See below screen shot.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fGVFe.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fGVFe.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;What I want is to complete Go's builtin functions, like &lt;code&gt;fmt.Fprintln&lt;/code&gt;. It seems company mode can't do that. See below screen shot.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IwESJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IwESJ.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I want to confirm, is it true? Can emacs auto completes Go's builtin functions? Are there any example emacs init files that I can use as a reference? Thanks in advance.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&lt;p&gt;Confirmed I installed gocode.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EMqPe.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EMqPe.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I've cleared my init.el and only contains the minimal code to do the completion, but it still not work (emacs restarted).&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/boinW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/boinW.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;Update2&lt;/h1&gt;&#xA;&lt;p&gt;Yes gocode is running.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/OfQ9k.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OfQ9k.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2273" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-09-04T08:51:04.247" Title="Can I use emacs with company-mode and company-go to complete Go's standard library function names?" Tags="|company-mode|auto-complete-mode|golang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26821" PostTypeId="1" AcceptedAnswerId="26828" CreationDate="2016-09-04T08:13:43.977" Score="2" ViewCount="12835" Body="&lt;p&gt;I have the following ~/.emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Added by Package.el.  This must come before configurations of&#xA;;; installed packages.  Don't delete this line.  If you don't want it,&#xA;;; just comment it out by adding a semicolon to the start of the line.&#xA;;; You may delete these explanatory comments.&#xA;(package-initialize)&#xA;&#xA;(require 'highlight-symbol)&#xA;(global-set-key [(control f3)] 'highlight-symbol)&#xA;(global-set-key [f3] 'highlight-symbol-next)&#xA;(global-set-key [(shift f3)] 'highlight-symbol-prev)&#xA;(global-set-key [(meta f3)] 'highlight-symbol-query-replace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I added the file highlight-symbol.el to my ~/.emacs.d folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I start emacs I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading ‘~/.emacs’:&#xA;&#xA;File error: Cannot open load file, No such file or directory, highlight-symbol&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am new to emacs, what am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="13105" LastActivityDate="2020-07-06T23:16:54.620" Title="File error: Cannot open load file" Tags="|package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26822" PostTypeId="2" ParentId="26820" CreationDate="2016-09-04T08:21:30.883" Score="6" Body="&lt;p&gt;You need to tell company-mode what backend to use. In my init file I have the following code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'go-mode-hook&#xA;      (lambda ()&#xA;        (set (make-local-variable 'company-backends) '(company-go))&#xA;        (company-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will also need the gocode autocomplete daemon which you can get by executing &lt;code&gt;go get github.com/nsf/gocode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11966" LastEditorUserId="11966" LastEditDate="2016-09-04T08:36:37.003" LastActivityDate="2016-09-04T08:36:37.003" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26823" PostTypeId="1" CreationDate="2016-09-04T09:40:57.870" Score="2" ViewCount="643" Body="&lt;p&gt;I am reverse engineering foreign web site and have a lot of minified code for CSS/HTML/JS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What package or tricks allow to beautify code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am usually replace &lt;code&gt;\([{}]\)&lt;/code&gt; to &lt;code&gt;\1\n&lt;/code&gt; and &lt;kbd&gt;C-x h&lt;/kbd&gt; &lt;kbd&gt;C-M-\&lt;/kbd&gt; (&lt;code&gt;indent-region&lt;/code&gt;) but would like something better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried these packages from &lt;code&gt;package-list-packages&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;json-reformat&lt;/code&gt; - doesn't work on JS file&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;web-beautify&lt;/code&gt; depends on &lt;code&gt;npm -g install js-beautify&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="947" LastEditorUserId="1979" LastEditDate="2018-08-07T15:51:57.240" LastActivityDate="2018-08-07T15:51:57.240" Title="Source code pretty-printer / beautifier / formatter for minified HTML/CSS/JS using only code I can trust?" Tags="|formatting|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="26824" PostTypeId="2" ParentId="9586" CreationDate="2016-09-04T09:53:26.540" Score="10" Body="&lt;p&gt;emacs for now doesn't support ligatures (on OSX there is some support, but not on other platforms).&#xA;However, emacs 24.4+ supports &lt;code&gt;prettify-symbols-mode&lt;/code&gt; which in some ways is better than normal ligatures support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That mode allows to subsitute for display any regex with any glyph. &lt;s&gt;I am personnally using &lt;a href=&quot;https://github.com/tonsky/FiraCode/issues/211#issuecomment-239087391&quot; rel=&quot;noreferrer&quot;&gt;this snippet&lt;/a&gt; to get Fira Code ligatures to work in emacs on linux.&lt;/s&gt; (EDIT: unfortunately the link is now dead, the policy of stackoverflow to always copy inline is obviously the good one...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The link I originally put is dead and I'm not certain exactly what it contained but I think these links should be good:&#xA;&lt;a href=&quot;https://github.com/tonsky/FiraCode/wiki/Emacs-instructions#using-prettify-symbols&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/tonsky/FiraCode/wiki/Emacs-instructions#using-prettify-symbols&lt;/a&gt; and &lt;a href=&quot;https://github.com/tonsky/FiraCode/issues/312#issuecomment-262878734&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/tonsky/FiraCode/issues/312#issuecomment-262878734&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the dead link issue, I'm putting the code inline this time:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun fira-code-mode--make-alist (list)&#xA;  &quot;Generate prettify-symbols alist from LIST.&quot;&#xA;  (let ((idx -1))&#xA;    (mapcar&#xA;     (lambda (s)&#xA;       (setq idx (1+ idx))&#xA;       (let* ((code (+ #Xe100 idx))&#xA;          (width (string-width s))&#xA;          (prefix ())&#xA;          (suffix '(?\s (Br . Br)))&#xA;          (n 1))&#xA;     (while (&amp;lt; n width)&#xA;       (setq prefix (append prefix '(?\s (Br . Bl))))&#xA;       (setq n (1+ n)))&#xA;     (cons s (append prefix suffix (list (decode-char 'ucs code))))))&#xA;     list)))&#xA;&#xA;(defconst fira-code-mode--ligatures&#xA;  '(&quot;www&quot; &quot;**&quot; &quot;***&quot; &quot;**/&quot; &quot;*&amp;gt;&quot; &quot;*/&quot; &quot;\\\\&quot; &quot;\\\\\\&quot;&#xA;    &quot;{-&quot; &quot;[]&quot; &quot;::&quot; &quot;:::&quot; &quot;:=&quot; &quot;!!&quot; &quot;!=&quot; &quot;!==&quot; &quot;-}&quot;&#xA;    &quot;--&quot; &quot;---&quot; &quot;--&amp;gt;&quot; &quot;-&amp;gt;&quot; &quot;-&amp;gt;&amp;gt;&quot; &quot;-&amp;lt;&quot; &quot;-&amp;lt;&amp;lt;&quot; &quot;-~&quot;&#xA;    &quot;#{&quot; &quot;#[&quot; &quot;##&quot; &quot;###&quot; &quot;####&quot; &quot;#(&quot; &quot;#?&quot; &quot;#_&quot; &quot;#_(&quot;&#xA;    &quot;.-&quot; &quot;.=&quot; &quot;..&quot; &quot;..&amp;lt;&quot; &quot;...&quot; &quot;?=&quot; &quot;??&quot; &quot;;;&quot; &quot;/*&quot;&#xA;    &quot;/**&quot; &quot;/=&quot; &quot;/==&quot; &quot;/&amp;gt;&quot; &quot;//&quot; &quot;///&quot; &quot;&amp;amp;&amp;amp;&quot; &quot;||&quot; &quot;||=&quot;&#xA;    &quot;|=&quot; &quot;|&amp;gt;&quot; &quot;^=&quot; &quot;$&amp;gt;&quot; &quot;++&quot; &quot;+++&quot; &quot;+&amp;gt;&quot; &quot;=:=&quot; &quot;==&quot;&#xA;    &quot;===&quot; &quot;==&amp;gt;&quot; &quot;=&amp;gt;&quot; &quot;=&amp;gt;&amp;gt;&quot; &quot;&amp;lt;=&quot; &quot;=&amp;lt;&amp;lt;&quot; &quot;=/=&quot; &quot;&amp;gt;-&quot; &quot;&amp;gt;=&quot;&#xA;    &quot;&amp;gt;=&amp;gt;&quot; &quot;&amp;gt;&amp;gt;&quot; &quot;&amp;gt;&amp;gt;-&quot; &quot;&amp;gt;&amp;gt;=&quot; &quot;&amp;gt;&amp;gt;&amp;gt;&quot; &quot;&amp;lt;*&quot; &quot;&amp;lt;*&amp;gt;&quot; &quot;&amp;lt;|&quot; &quot;&amp;lt;|&amp;gt;&quot;&#xA;    &quot;&amp;lt;$&quot; &quot;&amp;lt;$&amp;gt;&quot; &quot;&amp;lt;!--&quot; &quot;&amp;lt;-&quot; &quot;&amp;lt;--&quot; &quot;&amp;lt;-&amp;gt;&quot; &quot;&amp;lt;+&quot; &quot;&amp;lt;+&amp;gt;&quot; &quot;&amp;lt;=&quot;&#xA;    &quot;&amp;lt;==&quot; &quot;&amp;lt;=&amp;gt;&quot; &quot;&amp;lt;=&amp;lt;&quot; &quot;&amp;lt;&amp;gt;&quot; &quot;&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;-&quot; &quot;&amp;lt;&amp;lt;=&quot; &quot;&amp;lt;&amp;lt;&amp;lt;&quot; &quot;&amp;lt;~&quot;&#xA;    &quot;&amp;lt;~~&quot; &quot;&amp;lt;/&quot; &quot;&amp;lt;/&amp;gt;&quot; &quot;~@&quot; &quot;~-&quot; &quot;~=&quot; &quot;~&amp;gt;&quot; &quot;~~&quot; &quot;~~&amp;gt;&quot; &quot;%%&quot;&#xA;    &quot;x&quot; &quot;:&quot; &quot;+&quot; &quot;+&quot; &quot;*&quot;))&#xA;&#xA;(defvar fira-code-mode--old-prettify-alist)&#xA;&#xA;(defun fira-code-mode--enable ()&#xA;  &quot;Enable Fira Code ligatures in current buffer.&quot;&#xA;  (setq-local fira-code-mode--old-prettify-alist prettify-symbols-alist)&#xA;  (setq-local prettify-symbols-alist (append (fira-code-mode--make-alist fira-code-mode--ligatures) fira-code-mode--old-prettify-alist))&#xA;  (prettify-symbols-mode t))&#xA;&#xA;(defun fira-code-mode--disable ()&#xA;  &quot;Disable Fira Code ligatures in current buffer.&quot;&#xA;  (setq-local prettify-symbols-alist fira-code-mode--old-prettify-alist)&#xA;  (prettify-symbols-mode -1))&#xA;&#xA;(define-minor-mode fira-code-mode&#xA;  &quot;Fira Code ligatures minor mode&quot;&#xA;  :lighter &quot; Fira Code&quot;&#xA;  (setq-local prettify-symbols-unprettify-at-point 'right-edge)&#xA;  (if fira-code-mode&#xA;      (fira-code-mode--enable)&#xA;    (fira-code-mode--disable)))&#xA;&#xA;(defun fira-code-mode--setup ()&#xA;  &quot;Setup Fira Code Symbols&quot;&#xA;  (set-fontset-font t '(#Xe100 . #Xe16f) &quot;Fira Code Symbol&quot;))&#xA;&#xA;(provide 'fira-code-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I said that in some ways this is better than normal ligatures.. That's because it's &quot;a la carte&quot;.  You can mix-and-match, take only the symbols you like. You can say, I want the &quot;;;&quot; ligature, EXCEPT if the next character is again &quot;;&quot; in that case I don't want it... And about mix-and-matching... I'm using the 'Fira Mono' font, together with the 'Fira Code' ligatures. You don't have to buy in the whole font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's worse than pure ligatures because it doesn't work out of the box and it requires the font to be tuned in a certain way to make it possible.&lt;/p&gt;&#xA;" OwnerUserId="2592" LastEditorUserId="2592" LastEditDate="2019-03-25T06:25:08.027" LastActivityDate="2019-03-25T06:25:08.027" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="26825" PostTypeId="2" ParentId="26811" CreationDate="2016-09-04T10:26:44.760" Score="11" Body="&lt;p&gt;As Tephra said, &lt;a href=&quot;https://github.com/pinard/Pymacs&quot;&gt;Pymacs&lt;/a&gt; is a package designed for this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's an interface between Python and Emacs Lisp. The project isn't very active but from what I understand it's fully functional with the latest version of Emacs. A few Python packages use it (for example, &lt;a href=&quot;https://github.com/python-rope/ropemacs&quot;&gt;Ropemacs&lt;/a&gt;) so any changes to Emacs that break it are likely to be fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The GitHub link to the &lt;a href=&quot;http://pymacs.progiciels-bpi.ca/&quot;&gt;online documentation&lt;/a&gt; seems to be dead, but you can still find it &lt;a href=&quot;http://web.archive.org/web/20071219173207/http://pymacs.progiciels-bpi.ca/manual/index.html&quot;&gt;on the Wayback Machine&lt;/a&gt;. The Wayback documentation is only available for version 0.23 - the current version is 0.25. The changes are pretty minor though. The Ropemacs source code is a good place to look for examples, as are the other projects implemented with Pymacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with Pymacs is that it takes away a lot of what makes Elisp useful as a language for an extensible text editor. You have to edit source code directly if you want to change behaviour. You can't easily advise functions and you can't browse Elisp in memory. Since your Python implementation is abstracted from normal Elisp this removes a lot of the self-documenting behaviour that makes Emacs great, and errors become less informative. Extension languages like this are primarily useful for interfacing to external packages written in another language.&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-04T10:26:44.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26826" PostTypeId="1" CreationDate="2016-09-04T11:29:38.537" Score="3" ViewCount="976" Body="&lt;p&gt;I'm using the &lt;a href=&quot;https://github.com/justbur/emacs-which-key&quot; rel=&quot;nofollow noreferrer&quot;&gt;which key&lt;/a&gt; plugin in my emacs setup and I notice that when I set a key binding in a keymap with a lambda expression, like this&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-yank-keymap &amp;quot;l&amp;quot;&#xA;  (lambda ()&#xA;    &amp;quot;Yank whole line&amp;quot;&#xA;    (interactive)&#xA;    (save-excursion&#xA;      (back-to-indentation)&#xA;      (set-mark-command nil)&#xA;      (move-end-of-line nil)&#xA;      (kill-ring-save 'doesnt-matter-because 'of-next-argument t))))&#xA;                                    &#xA;(global-set-key (kbd &amp;quot;C-c w&amp;quot;) my-yank-keymap)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Activating &lt;code&gt;my-yank-keymap&lt;/code&gt; with &lt;code&gt;C-c w&lt;/code&gt; displays my key binding for the &lt;code&gt;l&lt;/code&gt; key, but the label for it is simply &lt;code&gt;lambda&lt;/code&gt;. Can &lt;code&gt;which-key&lt;/code&gt; be configured to use the &lt;code&gt;DOCSTRING&lt;/code&gt; of the function/lambda when there is no function name to display?&lt;/p&gt;&#xA;" OwnerUserId="8401" LastEditorUserId="105" LastEditDate="2021-12-20T00:30:23.167" LastActivityDate="2021-12-20T00:30:23.167" Title="`which-key` displays &quot;lambda&quot; when key binding bound to lambda expression" Tags="|key-bindings|keymap|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="26827" PostTypeId="1" AcceptedAnswerId="26839" CreationDate="2016-09-04T12:00:44.267" Score="6" ViewCount="784" Body="&lt;p&gt;How can I test in elisp whether an &lt;code&gt;org-mode&lt;/code&gt; tree node (either a heading or a list item) is folded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the code it seems the logic is a little complicated and only in &lt;code&gt;org-cycle-internal-local&lt;/code&gt;, with no public API?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've sometimes wished for this when writing small functions to navigate the tree and change its folding state - e.g. today when attempting to answer &lt;a href=&quot;https://emacs.stackexchange.com/questions/26799/org-mode-closing-the-nearest-parent&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if the node has no children, for my purposes I'd either need that to be regarded as folded, or to be able to find out explicitly whether there are children.  Otherwise I can't keep &lt;code&gt;org-cycle&lt;/code&gt;ing until the node is folded.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-03-26T02:36:35.353" Title="Test whether org-mode heading or list is folded" Tags="|org-mode|outline-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26828" PostTypeId="2" ParentId="26821" CreationDate="2016-09-04T12:37:10.100" Score="9" Body="&lt;p&gt;Looking at the help from &lt;code&gt;require&lt;/code&gt; (&lt;code&gt;C-h f require&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(require FEATURE &amp;amp;optional FILENAME NOERROR)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If feature FEATURE is not loaded, load it from FILENAME.&#xA;  If FEATURE is not a member of the list 'features', then the feature&#xA;  is not loaded; so load the file FILENAME.&#xA;  If FILENAME is omitted, the printname of FEATURE is used as the file name,&#xA;  and 'load' will try to load this name appended with the suffix '.elc' or&#xA;  '.el', in that order. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So let's look at &lt;code&gt;load&lt;/code&gt; help (either &lt;code&gt;C-h f load&lt;/code&gt; or simply use &lt;code&gt;TAB&lt;/code&gt; to navigate to the blue link then use&lt;code&gt;RET&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This function searches the directories in `load-path'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again we can have a look at &lt;code&gt;load-path&lt;/code&gt; help (either &lt;code&gt;C-h v load-path&lt;/code&gt;, since it's a variable, or navigating to the link) and, probably, find that &lt;code&gt;.emacs.d&lt;/code&gt; is not in the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be fixed by adding this to the init file:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(add-to-list 'load-path &quot;~/.emacs.d&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For it to take effect immediately you can use &lt;code&gt;C-x C-e&lt;/code&gt; (&lt;code&gt;eval-last-sexp&lt;/code&gt;) with point at end of line.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-09-04T12:37:10.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26829" PostTypeId="2" ParentId="26818" CreationDate="2016-09-04T13:07:05.883" Score="5" Body="&lt;p&gt;On a terminal, you can't change the shape of cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Cursor-Display.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;From the Emacs manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On a text terminal, the cursor’s appearance is controlled by the&#xA;  terminal, largely out of the control of Emacs. Some terminals offer&#xA;  two different cursors: a “visible” static cursor, and a “very visible”&#xA;  blinking cursor. By default, Emacs uses the very visible cursor, and&#xA;  switches to it when you start or resume Emacs. If the variable&#xA;  visible-cursor is nil when Emacs starts or resumes, it uses the normal&#xA;  cursor.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8604" LastEditorUserId="306" LastEditDate="2019-10-17T11:27:43.007" LastActivityDate="2019-10-17T11:27:43.007" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="26830" PostTypeId="2" ParentId="26810" CreationDate="2016-09-04T13:46:33.790" Score="11" Body="&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Package ‘dired-’ is unavailable&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You get this error when &lt;code&gt;package.el&lt;/code&gt; tries to install a non-existent package.  &lt;code&gt;use-package&lt;/code&gt; will attempt to install the given package name if you pass or &lt;code&gt;:ensure t&lt;/code&gt; or you have set &lt;code&gt;use-package-always-ensure&lt;/code&gt; to non-nil.  Use &lt;code&gt;:ensure nil&lt;/code&gt; to override &lt;code&gt;use-package-always-ensure&lt;/code&gt;.  You need to do this for any non-&lt;code&gt;package.el&lt;/code&gt; package (of which &lt;code&gt;dired&lt;/code&gt; is one example) that you &lt;code&gt;use-package&lt;/code&gt; with.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-09-04T13:46:33.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26831" PostTypeId="1" AcceptedAnswerId="26853" CreationDate="2016-09-04T13:50:51.197" Score="1" ViewCount="171" Body="&lt;p&gt;I am working with knitr, polymode, ess and I would like to export just the R code from my .Rnw into a .R file. A basic file might look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[a4paper]{article}&#xA;&#xA;My Rnw file &#xA;&#xA;&amp;lt;&amp;lt;&amp;gt;&amp;gt;=&#xA;##This is some R code &#xA;1+1 &#xA;@&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the end, I would like an R file with just &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;##This is some R code&#xA;1+1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10338" LastActivityDate="2016-09-05T14:31:00.277" Title="How Do you export only R code from Rnw file" Tags="|latex|ess|r|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26832" PostTypeId="2" ParentId="26812" CreationDate="2016-09-04T14:00:06.477" Score="2" Body="&lt;p&gt;ido gets its file history from multiple places:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;ido-use-virtual-buffers&lt;/code&gt; is enabled, ido uses &lt;code&gt;recentf&lt;/code&gt; to save buffer history.  At history save time (e.g. on emacs shutdown), &lt;code&gt;recentf-files&lt;/code&gt; may include both virtual (closed) and non-virtual buffers, so &lt;code&gt;recentf-save-list&lt;/code&gt; will save both to file &lt;code&gt;~/.emacs.d/recentf&lt;/code&gt;.  When emacs is started again later on, they will all become ido virtual buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ido also has &quot;work directory&quot; and &quot;work file&quot; features.  These are used via &lt;code&gt;ido-next-work-directory&lt;/code&gt; and &lt;code&gt;ido-prev-work-directory&lt;/code&gt; (M-n / M-p or M-down / M-up), and by &lt;code&gt;ido-next-work-file&lt;/code&gt; and &lt;code&gt;ido-prev-work-file&lt;/code&gt; (C-M-o / C-o).  &lt;code&gt;ido-max-work-file-list&lt;/code&gt; controls the number of work files stored in &lt;code&gt;ido-work-file-list&lt;/code&gt; (and similarly &lt;code&gt;ido-max-work-directory-list&lt;/code&gt; controls &lt;code&gt;ido-work-directory-list&lt;/code&gt;).  These lists are persisted to file &lt;code&gt;~/.emacs.d/ido.last&lt;/code&gt; by &lt;code&gt;ido-save-history&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that I was seeing files not saved in &lt;code&gt;ido.last&lt;/code&gt; is that buffers are not added to &lt;code&gt;ido-work-file-list&lt;/code&gt; unless they are visited &lt;strong&gt;using &lt;code&gt;ido&lt;/code&gt;&lt;/strong&gt;.  They are not added to that list if they are visited using &lt;code&gt;dired&lt;/code&gt;.  So I've added this to my init files so that regardless of how a file is opened, it gets added to the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/add-to-ido-work-file-list ()&#xA;    (ido-record-work-file (file-name-nondirectory (buffer-file-name)))&#xA;    (ido-record-work-directory (file-name-directory (buffer-file-name))))&#xA;(add-hook 'find-file-hook 'my/add-to-ido-work-file-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2016-09-11T18:30:20.053" LastActivityDate="2016-09-11T18:30:20.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26833" PostTypeId="2" ParentId="17014" CreationDate="2016-09-04T15:00:48.347" Score="1" Body="&lt;p&gt;The canonical answer here is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'js2-mode-hook 'tern-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This line of code is in my emacs config and works fine. When I open a &lt;code&gt;.js&lt;/code&gt; file, &lt;code&gt;tern-mode&lt;/code&gt; is enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that doesn't work, there are other things to debug, such as what package manager you're using, which files you're opening, whether tern has any &lt;a href=&quot;http://ternjs.net/doc/manual.html#emacs&quot; rel=&quot;nofollow&quot;&gt;prerequirements&lt;/a&gt; you're not fulfilling (like a server available in &lt;code&gt;bin/tern&lt;/code&gt; ?), etc. &lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2016-09-04T15:00:48.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26834" PostTypeId="2" ParentId="26708" CreationDate="2016-09-04T15:09:31.097" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Termcap&quot; rel=&quot;noreferrer&quot;&gt;Termcap&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Terminfo&quot; rel=&quot;noreferrer&quot;&gt;terminfo&lt;/a&gt; are both methods for an application running in a terminal to obtain information about the terminal — what it can do and how (e.g. its size, how to move the cursor around, etc.). Both consist of a database that associates terminal capability descriptions to terminal names, as well as a library of code to query the database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;TERM&lt;/code&gt; environment variable gives the terminal name, which applications look up in the database. Some applications also support the environment variable &lt;code&gt;TERMCAP&lt;/code&gt; which describes the terminal capabilities in termcap format. There is also an environment variable &lt;code&gt;TERMINFO&lt;/code&gt;, but it contains the location of the terminal database files, not the actual terminal description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In general, you should not set &lt;code&gt;TERM&lt;/code&gt;&lt;/strong&gt;. The terminal emulator sets it for you, or the OS configuration for a hardware terminal. Remote login methods (e.g. ssh, telnet) copy the local value of &lt;code&gt;TERM&lt;/code&gt; to the remote host, but typically don't propagate &lt;code&gt;TERMCAP&lt;/code&gt; or &lt;code&gt;TERMINFO&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shell mode sets &lt;code&gt;TERM&lt;/code&gt; to &lt;code&gt;dumb&lt;/code&gt;, a terminal that can basically do nothing other than display output line by line. Term (&lt;code&gt;M-x term&lt;/code&gt; or &lt;code&gt;M-x ansi-term&lt;/code&gt;) sets &lt;code&gt;TERM&lt;/code&gt; to &lt;code&gt;eterm-color&lt;/code&gt; (this can be configured by setting the variable &lt;code&gt;term-term-name&lt;/code&gt;), and also sets &lt;code&gt;TERMINFO&lt;/code&gt; and &lt;code&gt;TERMCAP&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with termcap and terminfo is that they work optimally only if everyone has the same name→information database, which is not the case with remote logins. You can sometimes end up with a terminal name that's known locally, but not known on the remote host. And sometimes terminal emulators set &lt;code&gt;TERM&lt;/code&gt; to a widely-supported name that only declares a subset of their capabilities, so as to work even on machines that don't have anything better in their database. In such cases, you might want to set &lt;code&gt;TERM&lt;/code&gt; manually. For example, if you log in to a machine that doesn't know &lt;code&gt;eterm-color&lt;/code&gt;, you might set &lt;code&gt;TERM&lt;/code&gt; to &lt;code&gt;eterm&lt;/code&gt; or &lt;code&gt;vt100&lt;/code&gt; instead (&lt;a href=&quot;https://en.wikipedia.org/wiki/VT100&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;vt100&lt;/code&gt;&lt;/a&gt; is a subset of most terminals' capabilities), either by setting &lt;code&gt;term-term-name&lt;/code&gt; in Emacs if you open a Term buffer just to log in to that machine, or by setting &lt;code&gt;TERM&lt;/code&gt; from your shell login script.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-09-04T15:09:31.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26835" PostTypeId="1" CreationDate="2016-09-04T15:11:43.180" Score="1" ViewCount="1162" Body="&lt;p&gt;I'm new to Emacs, new to Emmet, and new to Stack Overflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to wrap a list of text in individual html tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Home&lt;br&gt;&#xA;About&lt;br&gt;&#xA;Something&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is supposed to become&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&#xA;    &amp;lt;li&amp;gt;Home&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;About&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;Something&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Apparently emmet has an abbreviation for this. (Documented here: &lt;a href=&quot;http://docs.emmet.io/actions/wrap-with-abbreviation/&quot; rel=&quot;nofollow&quot;&gt;http://docs.emmet.io/actions/wrap-with-abbreviation/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following these instructions, I select my 3 lines of text, hit C-c w to bring up the emmet wrap function, enter ul&gt;li* and hit RET. But instead of the expected&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&#xA;    &amp;lt;li&amp;gt;Home&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;About&amp;lt;/li&amp;gt;&#xA;    &amp;lt;li&amp;gt;Something&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&#xA;    &amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&#xA;&amp;lt;/ul&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried experimenting with the $# placeholder but that didn't help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wraping a selected text in a single tag works fine (select text -&gt; C-c w -&gt; p -&gt; RET to create a p-tag with the selected text in it). Creating multiple tags, each with the same text in it also works fine (select text -&gt; C-c w -&gt; ul&gt;li*3 will create a ul with 3 items, each one has the selected text in it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Supposedly the * operator (without a number) repeats something for each line highlighted, but that doesn't seem to work. Is this feature not available in Emacs' emmet-mode or am I doing something wrong?&lt;/p&gt;&#xA;" OwnerUserId="13205" LastEditorUserId="105" LastEditDate="2016-09-04T15:43:03.580" LastActivityDate="2024-01-24T15:06:45.867" Title="Emmet-mode: Wrapping individual lines in HTML tags" Tags="|html|emmet|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26836" PostTypeId="1" CreationDate="2016-09-04T16:46:24.490" Score="1" ViewCount="137" Body="&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* my item (note)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The note causes the text in the headline to change color, from the headline's usual color to my default text color. How do I disable this?&lt;/p&gt;&#xA;" OwnerUserId="10152" LastActivityDate="2016-09-04T18:01:57.397" Title="Org-mode: why do headlines with parenthesis in them change color?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26837" PostTypeId="2" ParentId="26836" CreationDate="2016-09-04T18:01:57.397" Score="1" Body="&lt;p&gt;This was an interaction with rainbow-delimiters mode. Shutting that off fixes the problem.&lt;/p&gt;&#xA;" OwnerUserId="10152" LastActivityDate="2016-09-04T18:01:57.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26839" PostTypeId="2" ParentId="26827" CreationDate="2016-09-04T22:56:50.553" Score="0" Body="&lt;p&gt;I took a crack at it, based on that function (no tests, sorry for weird indentation, likely some redundancy and I'm sure poor style):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-get-folded-state ()&#xA;    (cond&#xA;        ((not (or (org-at-item-p) (org-at-heading-p)))&#xA;            (message &quot;not at node (neither heading nor list item)&quot;)&#xA;            'not-at-node)&#xA;        ((org-before-first-heading-p)&#xA;            (message &quot;not at node (neither heading nor list item)&quot;)&#xA;            'not-at-node)&#xA;        (t&#xA;            (let (eoh eol eos has-children children-skipped struct)&#xA;                ;; First, determine end of headline (EOH), end of subtree or item&#xA;                ;; (EOS), and if item or heading has children (HAS-CHILDREN).&#xA;                (save-excursion&#xA;                    (if (org-at-item-p)&#xA;                        (progn&#xA;                            (beginning-of-line)&#xA;                            (setq struct (org-list-struct))&#xA;                            (setq eoh (point-at-eol))&#xA;                            (setq eos (org-list-get-item-end-before-blank (point) struct))&#xA;                            (setq has-children (org-list-has-child-p (point) struct)))&#xA;                        (org-back-to-heading)&#xA;                        (setq eoh (save-excursion (outline-end-of-heading) (point)))&#xA;                        (setq eos (save-excursion (org-end-of-subtree t t)&#xA;                                    (when (bolp) (backward-char)) (point)))&#xA;                        (setq has-children&#xA;                            (or (save-excursion&#xA;                                    (let ((level (funcall outline-level)))&#xA;                                        (outline-next-heading)&#xA;                                        (and (org-at-heading-p t)&#xA;                                            (&amp;gt; (funcall outline-level) level))))&#xA;                                (save-excursion&#xA;                                    (org-list-search-forward (org-item-beginning-re) eos t)))))&#xA;                    ;; Determine end invisible part of buffer (EOL)&#xA;                    (beginning-of-line 2)&#xA;                    (while (and (not (eobp)) ;; this is like `next-line'&#xA;                            (get-char-property (1- (point)) 'invisible))&#xA;                        (goto-char (next-single-char-property-change (point) 'invisible))&#xA;                        (and (eolp) (beginning-of-line 2)))&#xA;                    (setq eol (point)))&#xA;                (cond&#xA;                    ((= eos eoh)&#xA;                        (message &quot;empty node&quot;)&#xA;                        'empty-node)&#xA;                    ((or (&amp;gt;= eol eos)&#xA;                        (not (string-match &quot;\\S-&quot; (buffer-substring eol eos))))&#xA;                        (message &quot;folded&quot;)&#xA;                        'folded)&#xA;                    (t&#xA;                        (message &quot;not folded&quot;)&#xA;                        'not-folded))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-09-04T22:56:50.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26840" PostTypeId="2" ParentId="26827" CreationDate="2016-09-04T23:18:09.727" Score="5" Body="&lt;p&gt;There's a simple way to test whether a heading or list item is&#xA;folded: the text within it will be invisible.  As such, you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-folded-p ()&#xA;  &quot;Returns non-nil if point is on a folded headline or plain list&#xA;item.&quot;&#xA;  (and (or (org-at-heading-p)&#xA;           (org-at-item-p))&#xA;       (invisible-p (point-at-eol))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that, if you'd like to use it in non-&lt;code&gt;org&lt;/code&gt; modes derived from&#xA;&lt;code&gt;outline-mode&lt;/code&gt;, you should swap in &lt;code&gt;outline-on-heading-p&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-09-04T23:18:09.727" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26841" PostTypeId="2" ParentId="26811" CreationDate="2016-09-04T23:18:24.740" Score="8" Body="&lt;p&gt;You can extend Emacs in other languages, like &lt;a href=&quot;https://github.com/knupfer/haskell-emacs&quot; rel=&quot;noreferrer&quot;&gt;Haskell&lt;/a&gt; and &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/505gnh/ecaml_writing_emacs_plugins_in_ocaml&quot; rel=&quot;noreferrer&quot;&gt;OCaml&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/505gnh/ecaml_writing_emacs_plugins_in_ocaml/d71uzup&quot; rel=&quot;noreferrer&quot;&gt;discussion on Reddit&lt;/a&gt; about advantages and disadvantages of doing so. In short, I don't think it's a good idea to use other languages (except possibly C for performance) due to the need for an additional runtime and the lack of common knowledge by others in the Emacs community about non-Elisp extension languages.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-09-04T23:18:24.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26842" PostTypeId="1" CreationDate="2016-09-05T00:20:24.673" Score="0" ViewCount="580" Body="&lt;p&gt;I am new to Emacs webmode. I was wondering how to debug javascript embedded into my html page using webmode.el. The script is in the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to see break lines and see the values as they progress and have the error shown describing the issue.&lt;/p&gt;&#xA;" OwnerUserId="12983" LastActivityDate="2017-03-04T17:14:28.750" Title="How to Debug Javascript in HTML in Webmode.el" Tags="|debugging|web-mode|javascript|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26843" PostTypeId="2" ParentId="26799" CreationDate="2016-09-05T00:26:37.930" Score="3" Body="&lt;p&gt;I tried implementing the 'keep closing parent' behaviour (please edit the question to say more explicitly what you wanted).  I'm quite sure this can be drastically simplified and is likely buggy, but this seems to work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-get-folded-state ()&#xA;    (cond&#xA;        ((not (or (org-at-item-p) (org-at-heading-p)))&#xA;            'not-at-node)&#xA;        ((org-before-first-heading-p)&#xA;            'not-at-node)&#xA;        (t&#xA;            (let (eoh eol eos has-children children-skipped struct)&#xA;                ;; First, determine end of headline (EOH), end of subtree or item&#xA;                ;; (EOS), and if item or heading has children (HAS-CHILDREN).&#xA;                (save-excursion&#xA;                    (if (org-at-item-p)&#xA;                        (progn&#xA;                            (beginning-of-line)&#xA;                            (setq struct (org-list-struct))&#xA;                            (setq eoh (point-at-eol))&#xA;                            (setq eos (org-list-get-item-end-before-blank (point) struct))&#xA;                            (setq has-children (org-list-has-child-p (point) struct)))&#xA;                        (org-back-to-heading)&#xA;                        (setq eoh (save-excursion (outline-end-of-heading) (point)))&#xA;                        (setq eos (save-excursion (org-end-of-subtree t t)&#xA;                                      (when (bolp) (backward-char)) (point)))&#xA;                        (setq has-children&#xA;                            (or (save-excursion&#xA;                                    (let ((level (funcall outline-level)))&#xA;                                        (outline-next-heading)&#xA;                                        (and (org-at-heading-p t)&#xA;                                            (&amp;gt; (funcall outline-level) level))))&#xA;                                (save-excursion&#xA;                                    (org-list-search-forward (org-item-beginning-re) eos t)))))&#xA;                    ;; Determine end invisible part of buffer (EOL)&#xA;                    (beginning-of-line 2)&#xA;                    (while (and (not (eobp)) ;; this is like `next-line'&#xA;                               (get-char-property (1- (point)) 'invisible))&#xA;                        (goto-char (next-single-char-property-change (point) 'invisible))&#xA;                        (and (eolp) (beginning-of-line 2)))&#xA;                    (setq eol (point)))&#xA;                (cond&#xA;                    ((= eos eoh)&#xA;                        'empty-node)&#xA;                    ((or (&amp;gt;= eol eos)&#xA;                         (not (string-match &quot;\\S-&quot; (buffer-substring eol eos))))&#xA;                        'folded)&#xA;                    (t&#xA;                        'not-folded))))))&#xA;&#xA;(defun my/org-at-list-root ()&#xA;    ;; (org-at-item-p) must be true when you call this&#xA;    (save-excursion&#xA;        (org-beginning-of-item-list)&#xA;        (let ((old (point)))&#xA;            (org-back-to-heading)&#xA;            (forward-line)&#xA;            (eq (point) old))))&#xA;&#xA;(defun my/org-jump-to-parent-item ()&#xA;    (org-beginning-of-item-list)&#xA;    (org-up-element))&#xA;&#xA;(defun my/org-tree-can-fold-p ()&#xA;    (not (member (my/org-get-folded-state) (list 'folded 'empty-node))))&#xA;&#xA;(defun my/org-cycle-until-folded ()&#xA;    (while (my/org-tree-can-fold-p)&#xA;        (org-cycle)))&#xA;&#xA;(defun my/org-close-next-parent ()&#xA;    (interactive)&#xA;    (cond&#xA;        ((org-before-first-heading-p)&#xA;            nil)&#xA;        ((org-at-item-p)&#xA;            (if (my/org-tree-can-fold-p)&#xA;                  (my/org-cycle-until-folded)&#xA;                (if (my/org-at-list-root)&#xA;                      (progn&#xA;                          (org-back-to-heading)&#xA;                          (my/org-close-next-parent))&#xA;                    (my/org-jump-to-parent-item)&#xA;                    (my/org-close-next-parent))))&#xA;        ((org-at-heading-p)&#xA;            (if (my/org-tree-can-fold-p)&#xA;                  (my/org-cycle-until-folded)&#xA;                (if (not (eq (org-outline-level) 1))&#xA;                      (progn&#xA;                          (call-interactively #'outline-up-heading)&#xA;                          (my/org-close-next-parent)))))&#xA;        ((org-in-item-p)&#xA;            (org-beginning-of-item)&#xA;            (my/org-cycle-until-folded))&#xA;        (t&#xA;            ;; in heading&#xA;            (org-back-to-heading)&#xA;            (my/org-cycle-until-folded))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-09-05T00:26:37.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26844" PostTypeId="1" AcceptedAnswerId="26867" CreationDate="2016-09-05T09:41:59.777" Score="3" ViewCount="634" Body="&lt;p&gt;I have moved to Emacs due to its diversity and yes...it simply Rocks! I have one final thing to resolve. I mostly program in python and it is a great feature to auto complete a function with its parentheses and the arguments &quot;pre-entered&quot;, then just tab through them to fill in the right variables. Also what I really like is the documentation pop-up while auto completing. The last desired feature is the function lookup in a library (eg. &lt;code&gt;os.path.j&lt;/code&gt; will find &lt;code&gt;join&lt;/code&gt;) I have achieved all features: documentation pop-up and library function lookup via Jedi or Anaconda. The function completion with parentheses and arguments via Gtags. The problem is this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NYR2E.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NYR2E.jpg&quot; alt=&quot;company popup with jedi and gtags&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The top line is from Gtags (full auto complete with parentheses and arguments, no documentation pop-up). The second line is from Jedi (documentation, but no full auto complete). I have been searching the web for several hours with no luck so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: can Company or Auto-complete be smarter about it and realize that they have the same function completion data and merge them into a single line providing documentation and full completion? Thus providing a smarter and better user experience?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sub-question: Is there a way to store all the gtags files generated per project all in one place, rather than those files existing in every project?&lt;/p&gt;&#xA;" OwnerUserId="13180" LastEditorUserId="13180" LastEditDate="2016-09-05T17:29:55.637" LastActivityDate="2016-09-06T00:37:21.690" Title="Smarter company/auto-complete" Tags="|company-mode|auto-complete-mode|gtags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26845" PostTypeId="1" AcceptedAnswerId="26889" CreationDate="2016-09-05T09:44:51.590" Score="13" ViewCount="4107" Body="&lt;p&gt;Similarly to &lt;a href=&quot;https://emacs.stackexchange.com/questions/15065/org-mode-babel-interactive-code-block-evaluation&quot;&gt;this question&lt;/a&gt; I would like to evaluate (in org mode) Python source code blocks containing &quot;input&quot; instructions but I can't find a way to have an interactive evaluation (with user input) during evaluation or to give it some input known in advance (stored in a file for instance). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My constraint is to use explicitly the &lt;code&gt;input&lt;/code&gt; instruction since all this should be included in a textbook for students.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of code :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :results output &#xA;a= input(&quot;Value&quot;) &#xA;print(a)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have such an interactive evaluation or to simulate it (by giving to the source code a fake input) ? &lt;/p&gt;&#xA;" OwnerUserId="9245" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2021-12-02T17:07:47.563" Title="Org Mode Babel - Interactive code block evaluation in Python" Tags="|org-mode|org-babel|" AnswerCount="5" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26846" PostTypeId="1" AcceptedAnswerId="26856" CreationDate="2016-09-05T13:17:46.767" Score="1" ViewCount="689" Body="&lt;p&gt;I'm writing a major mode to handle syntax highlighting for a language that allows namespaces just like in C++ e.g. &lt;code&gt;somewhere::out_there&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to highlight the text &lt;code&gt;somewhere&lt;/code&gt;, but leave the namespace operator &lt;code&gt;::&lt;/code&gt; in the default face (as is done in &lt;code&gt;cc-mode&lt;/code&gt;). So I'd like to match text that is &lt;em&gt;followed by&lt;/em&gt; a pattern, without matching that pattern too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I spent some time working with lookahead stuff, trying things like &lt;code&gt;[a-zA-Z]+\(?::\)&lt;/code&gt; but it seems I've bumped into the optional group syntax &lt;code&gt;\(?: ... \)&lt;/code&gt; that's just optionally including a single &lt;code&gt;:&lt;/code&gt; in the match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching around for methods to fix this, it seems that emacs doesn't actually support lookahead at all! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the solution may not be regex-based, let me give a bit more context: I'm setting &lt;code&gt;font-lock-defaults&lt;/code&gt; and &lt;code&gt;define-derived-mode&lt;/code&gt;, and my code follows this form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; define regexes for different text categories&#xA;(setq aql-numeric-regexp &quot;[-+]?\\.?\\_&amp;lt;[0-9]*\\.?[0-9]+\\.?\\(?:[eE][-+]?[0-9]+\\)?\\_&amp;gt;\\.?&quot;)&#xA;(setq aql-bindvar-regexp &quot;\\(^\\|[ \t]\\)@@?[a-zA-z_]+&quot;)&#xA;&#xA;;; Associate categories with faces                                                                                                                                                                                                             &#xA;(setq aql-font-lock-keywords&#xA;  `(&#xA;    (,aql-numeric-regexp . font-lock-warning-face)&#xA;    (,aql-bindvar-regexp . font-lock-variable-name-face)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then inside &lt;code&gt;define-derived-mode&lt;/code&gt; I include:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq font-lock-defaults '((aql-font-lock-keywords)))&#xA;(set (make-local-variable 'font-lock-defaults) '(aql-font-lock-keywords nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any strategies for dealing with this sort of thing? Any workarounds that will enable me to approximate lookaheads? Or other methods to tell emacs what to highlight?&lt;/p&gt;&#xA;" OwnerUserId="6771" LastEditorUserId="6771" LastEditDate="2016-09-06T12:49:47.703" LastActivityDate="2016-09-06T12:49:47.703" Title="Syntax highlighting: highlight text followed by a pattern, but not the pattern itself" Tags="|regular-expressions|major-mode|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26849" PostTypeId="1" AcceptedAnswerId="26876" CreationDate="2016-09-05T13:24:11.563" Score="3" ViewCount="2066" Body="&lt;p&gt;In my org file i have the following table:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: Заголовок пакета&#xA;| № | Размер | Тип      | Значение              |&#xA;|   | (байт) |          |                       |&#xA;|---+--------+----------+-----------------------|&#xA;| 1 |      1 | unsigned | *Маркер начала*       |&#xA;|   |        |          | константа 0xAC        |&#xA;|---+--------+----------+-----------------------|&#xA;| 2 |      1 | unsigned | *Размер данных*       |&#xA;|   |        |          | в байтах, от 1 до 255 |&#xA;|---+--------+----------+-----------------------|&#xA;| 3 |      1 | unsigned | *Контрольная сумма*   |&#xA;|   |        |          | по алгоритму CRC-8    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Table was made with liberal application of &lt;code&gt;org-table-wrap-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What i want/need: after export (to odt, doc/docx etc) have cells with multi-line contents. How do i achieve that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naive experimentation with built-in org export and pandoc produces tables where every line of text in original table becomes a row. What can i do to change that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. &lt;a href=&quot;http://pandoc.org/MANUAL.html#tables&quot; rel=&quot;nofollow&quot;&gt;Pandoc documentation&lt;/a&gt; mentions &lt;code&gt;multiline_tables&lt;/code&gt; and 'grid_tables' extensions. However, even after turning them on, i still get the same picture. Probably tables should be rewritten - but in that case, how do i reconcile output of org tables editor with the needs of pandoc input?&lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2022-05-04T05:59:11.730" Title="How to export org tables with cells on multiple lines?" Tags="|org-table|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26850" PostTypeId="2" ParentId="26842" CreationDate="2016-09-05T13:35:34.900" Score="1" Body="&lt;p&gt;I do not think that this is a functionality offered by web-mode. What I do for debugging javascript is to just look into the browsers console (most browser do offer one i think, like eg firefox offers one after pressing Ctrl-Shift-J). When he is complaining about my javascript i edit the according line in emacs. For that there is a mode available to support me in this process: &lt;a href=&quot;https://www.emacswiki.org/emacs/ImpatientMode&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/ImpatientMode&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="970" LastActivityDate="2016-09-05T13:35:34.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26851" PostTypeId="1" AcceptedAnswerId="26852" CreationDate="2016-09-05T14:15:55.120" Score="0" ViewCount="385" Body="&lt;p&gt;Pressing &lt;code&gt;TAB&lt;/code&gt; in an org-mode table (existing, or trying to create a new one) results in an error: &#xA;&quot;Variable binding depth exceeds max-specpdl-size.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Debug provides the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Variable binding depth exceeds max-specpdl-size&quot;)&#xA;  beginning-of-line(1)&#xA;  org-at-table-p(any)&#xA;  org-at-table\.el-p()&#xA;  org-element-table-parser(3858 (380))&#xA;  org-element--current-element(3858 element nil nil)&#xA;  byte-code(&quot;`\212\306\307 \211\310   P\311 \210,`)\312\211\211\211\211\211\211*+,-./\306\307 \211\310   P\313 \203Teb\210\314 \210m\204L\315 /V\203\205\316\317\312\&quot;\210\202\205\320 \210\312y\210\314 \210m\204i\315 /V\203\205\316\317\321\312x\210\322 \2100\204~\323d\306\&quot;\202\203\323d\306\&quot;C\&quot;\210,\322 \210\324.\325,*$\211@-\326\f12\211;\203\263\327\31221$\202\304A\330A@21#\240\210+\2100\203\322+B+\3312;\203\351\332\3332#\202\361\334A@2\&quot;*\2113/W\204\f3/U\2053.U?\2053b)\204\211-4&amp;gt;\204.\316\3170\203'+\202)\&quot;\210\202\211\3352;\203E\332\3332#\202M\334A@2\&quot;*\3362;\203e\332\3332#\202m\334A@2\&quot;*5\2116\203\2745\203\2746/V\204\2745/W\204\2746/U\203\232-\337&amp;gt;\204\2745/U\203\317-\340&amp;gt;\204\274-\341&amp;gt;\203\3175b\210n\204\274m\204\317\316\3170\203\310+\202\312\&quot;\210\202@\342-\343\&quot;\203\344,\3452;\203\364\332\3332#\202\374\334A@2\&quot;**\2028\342-\344\&quot;\203\312,\2028\342-\346\&quot;\203!\347,\312*\2028\342-\350\&quot;\2032\351,\312*\2028\312\211,*5.6b\210*\202\211&quot; [org-called-with-limited-levels org-outline-regexp outline-regexp org-outline-regexp-bol parent prevs t org-get-limited-outline-regexp &quot;^&quot; outline-next-heading nil org-before-first-heading-p org-skip-whitespace line-beginning-position throw exit org-back-to-heading &quot; &#xA;    \n&quot; beginning-of-line org-element-headline-parser org-element--current-element element :parent org-add-props plist-put :end get-text-property 0 plist-get :contents-begin :contents-end (plain-list table) (center-block drawer dynamic-block inlinetask property-drawer quote-block special-block) (item plain-list) eql plain-list item :structure property-drawer node-property table table-row struct trail special-flag type end origin keep-trail value ...] 10)&#xA;  org-element-at-point()&#xA;  org-table-begin(any)&#xA;  org-at-table\.el-p()&#xA;  org-element-table-parser(3858 (380))&#xA;  org-element--current-element(3858 element nil nil)&#xA;  byte-code(&quot;`\212\306\307 \211\310   P\311 \210,`)\312\211\211\211\211\211\211*+,-./\306\307 \211\310   P\313 \203Teb\210\314 \210m\204L\315 /V\203\205\316\317\312\&quot;\210\202\205\320 \210\312y\210\314 \210m\204i\315 /V\203\205\316\317\321\312x\210\322 \2100\204~\323d\306\&quot;\202\203\323d\306\&quot;C\&quot;\210,\322 \210\324.\325,*$\211@-\326\f12\211;\203\263\327\31221$\202\304A\330A@21#\240\210+\2100\203\322+B+\3312;\203\351\332\3332#\202\361\334A@2\&quot;*\2113/W\204\f3/U\2053.U?\2053b)\204\211-4&amp;gt;\204.\316\3170\203'+\202)\&quot;\210\202\211\3352;\203E\332\3332#\202M\334A@2\&quot;*\3362;\203e\332\3332#\202m\334A@2\&quot;*5\2116\203\2745\203\2746/V\204\2745/W\204\2746/U\203\232-\337&amp;gt;\204\2745/U\203\317-\340&amp;gt;\204\274-\341&amp;gt;\203\3175b\210n\204\274m\204\317\316\3170\203\310+\202\312\&quot;\210\202@\342-\343\&quot;\203\344,\3452;\203\364\332\3332#\202\374\334A@2\&quot;**\2028\342-\344\&quot;\203\312,\2028\342-\346\&quot;\203!\347,\312*\2028\342-\350\&quot;\2032\351,\312*\2028\312\211,*5.6b\210*\202\211&quot; [org-called-with-limited-levels org-outline-regexp outline-regexp org-outline-regexp-bol parent prevs t org-get-limited-outline-regexp &quot;^&quot; outline-next-heading nil org-before-first-heading-p org-skip-whitespace line-beginning-position throw exit org-back-to-heading &quot; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;. . . (repeating) . . .&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\n&quot; beginning-of-line org-element-headline-parser org-element--current-element element :parent org-add-props plist-put :end get-text-property 0 plist-get :contents-begin :contents-end (plain-list table) (center-block drawer dynamic-block inlinetask property-drawer quote-block special-block) (item plain-list) eql plain-list item :structure property-drawer node-property table table-row struct trail special-flag type end origin keep-trail value ...] 10)&#xA;      org-element-at-point()&#xA;      org-table-begin(any)&#xA;      org-at-table\.el-p()&#xA;      org-element-table-parser(3858 (380))&#xA;      org-element--current-element(3858 element nil nil)&#xA;      byte-code(&quot;`\212\306\307 \211\310   P\311 \210,`)\312\211\211\211\211\211\211*+,-./\306\307 \211\310   P\313 \203Teb\210\314 \210m\204L\315 /V\203\205\316\317\312\&quot;\210\202\205\320 \210\312y\210\314 \210m\204i\315 /V\203\205\316\317\321\312x\210\322 \2100\204~\323d\306\&quot;\202\203\323d\306\&quot;C\&quot;\210,\322 \210\324.\325,*$\211@-\326\f12\211;\203\263\327\31221$\202\304A\330A@21#\240\210+\2100\203\322+B+\3312;\203\351\332\3332#\202\361\334A@2\&quot;*\2113/W\204\f3/U\2053.U?\2053b)\204\211-4&amp;gt;\204.\316\3170\203'+\202)\&quot;\210\202\211\3352;\203E\332\3332#\202M\334A@2\&quot;*\3362;\203e\332\3332#\202m\334A@2\&quot;*5\2116\203\2745\203\2746/V\204\2745/W\204\2746/U\203\232-\337&amp;gt;\204\2745/U\203\317-\340&amp;gt;\204\274-\341&amp;gt;\203\3175b\210n\204\274m\204\317\316\3170\203\310+\202\312\&quot;\210\202@\342-\343\&quot;\203\344,\3452;\203\364\332\3332#\202\374\334A@2\&quot;**\2028\342-\344\&quot;\203\312,\2028\342-\346\&quot;\203!\347,\312*\2028\342-\350\&quot;\2032\351,\312*\2028\312\211,*5.6b\210*\202\211&quot; [org-called-with-limited-levels org-outline-regexp outline-regexp org-outline-regexp-bol parent prevs t org-get-limited-outline-regexp &quot;^&quot; outline-next-heading nil org-before-first-heading-p org-skip-whitespace line-beginning-position throw exit org-back-to-heading &quot; &#xA;        \n&quot; beginning-of-line org-element-headline-parser org-element--current-element element :parent org-add-props plist-put :end get-text-property 0 plist-get :contents-begin :contents-end (plain-list table) (center-block drawer dynamic-block inlinetask property-drawer quote-block special-block) (item plain-list) eql plain-list item :structure property-drawer node-property table table-row struct trail special-flag type end origin keep-trail value ...] 10)&#xA;      org-element-at-point()&#xA;      org-table-begin(any)&#xA;      org-at-table\.el-p()&#xA;      org-cycle(nil)&#xA;      call-interactively(org-cycle nil nil)&#xA;      command-execute(org-cycle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to fix this? I'm pretty lost at this point.&lt;/p&gt;&#xA;" OwnerUserId="13087" LastActivityDate="2016-11-04T18:52:02.307" Title="Tab in org-mode table generates &quot;Variable binding depth exceeds max-specpdl-size.&quot;" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26852" PostTypeId="2" ParentId="26851" CreationDate="2016-09-05T14:22:03.513" Score="0" Body="&lt;p&gt;I just remembered that I added &lt;code&gt;calfw-org&lt;/code&gt; to the init file yesterday night.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Opened the init file and saw that I had &lt;code&gt;(require 'calfw-org)&lt;/code&gt; before &lt;code&gt;(require 'org-install)&lt;/code&gt;. I switched the order and everything seems to work now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea why this is the case, and why it was creating an error with tables, but am guessing it has to do with the order of how emacs loads packages from the init file.&lt;/p&gt;&#xA;" OwnerUserId="13087" LastActivityDate="2016-09-05T14:22:03.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26853" PostTypeId="2" ParentId="26831" CreationDate="2016-09-05T14:31:00.277" Score="2" Body="&lt;p&gt;In R, &lt;a href=&quot;https://en.wikipedia.org/wiki/Literate_programming&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;tangling&lt;/em&gt;&lt;/a&gt; is implemented via &lt;code&gt;knitr::purl&lt;/code&gt; and &lt;code&gt;utils::Stangle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ESS provides an interface to these commands.  See the variable &lt;code&gt;ess-swv-processor&lt;/code&gt; and the &lt;code&gt;ess-swv-weave&lt;/code&gt; function (bound to &lt;kbd&gt;M-n&lt;/kbd&gt; &lt;kbd&gt;s&lt;/kbd&gt; in &lt;code&gt;Rnw-mode&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2016-09-05T14:31:00.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26854" PostTypeId="1" CreationDate="2016-09-05T14:52:20.457" Score="4" ViewCount="1246" Body="&lt;p&gt;Currently, I have both &lt;code&gt;elpy&lt;/code&gt; and &lt;code&gt;jedi&lt;/code&gt; installed. &lt;code&gt;init.el&lt;/code&gt; is like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(elpy-enable)&#xA;(elpy-use-ipython)&#xA;(setq elpy-rpc-backend &quot;jedi&quot;)&#xA;&#xA;(add-hook 'python-mode-hook 'jedi:setup)&#xA;(setq jedi:complete-on-dot t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that I shouldn't turn on &lt;code&gt;elpy&lt;/code&gt; and &lt;code&gt;jedi&lt;/code&gt; at the same time, it really causes competition and conflict in auto-completion. However, in my try I think &lt;code&gt;jedi&lt;/code&gt; yielded a better completion. But I need &lt;code&gt;elpy&lt;/code&gt; to manage the &lt;code&gt;ipython&lt;/code&gt; interperator, check the grammer and many other issues. Also, &lt;code&gt;(setq elpy-rpc-backend &quot;jedi&quot;)&lt;/code&gt; could not produce the same result as &lt;code&gt;jedi&lt;/code&gt; did. So my question is: is it possible to disable the auto-completion of &lt;code&gt;elpy&lt;/code&gt;, while keeping its remaining functions, so that I can use &lt;code&gt;jedi&lt;/code&gt; for auto-completion?&lt;/p&gt;&#xA;" OwnerUserId="13111" LastEditorUserId="675" LastEditDate="2016-09-05T17:50:56.610" LastActivityDate="2016-09-05T17:50:56.610" Title="How to use the auto-completion of jedi while keeping other functions of elpy?" Tags="|python|company-mode|auto-complete-mode|elpy|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26855" PostTypeId="1" AcceptedAnswerId="26990" CreationDate="2016-09-05T15:16:01.607" Score="1" ViewCount="818" Body="&lt;p&gt;I am unable to find any gdb-kill-hook or similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After calling gdb with gdb-many-windows the frame gets a new window layout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to store the previous layout in a register and to restore it after quitting gdb.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="10556" LastActivityDate="2016-09-11T07:27:20.183" Title="How to automatically restore the previous window layout after gdb?" Tags="|gdb|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26856" PostTypeId="2" ParentId="26846" CreationDate="2016-09-05T15:23:53.143" Score="2" Body="&lt;p&gt;You can match for something like &lt;code&gt;\(\_&amp;lt;[a-zA-Z_][a-zA-Z0-9_]*\)::&lt;/code&gt; and specify that group number 1 should be highlighted.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-09-05T15:23:53.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26858" PostTypeId="1" AcceptedAnswerId="27063" CreationDate="2016-09-05T17:13:18.317" Score="6" ViewCount="3776" Body="&lt;p&gt;I want to center an image in my project's GitHub README.org file, but everything I've tried so far hasn't worked:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML style=&quot;center&quot;&#xA;[[/path/to/img.png]]&#xA;&#xA;&#xA;#+ATTR_HTML align=&quot;center&quot;&#xA;[[/path/to/img.png]]&#xA;&#xA;#+begin_center&#xA;[[/path/to/img.png]]&#xA;#+end_center&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible, or should I just go the low-friction route and use Markdown?&lt;/p&gt;&#xA;" OwnerUserId="10036" LastActivityDate="2018-05-17T17:51:28.953" Title="Center image in GitHub's README.org" Tags="|org-mode|html|github|markup|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26859" PostTypeId="1" AcceptedAnswerId="26863" CreationDate="2016-09-05T18:02:01.883" Score="4" ViewCount="1684" Body="&lt;p&gt;I need to track the calls to &lt;code&gt;org-tags-view&lt;/code&gt; to discover the params passed to it.&lt;br&gt;&#xA;I tried an advice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun his-tracing-function (orig-fun &amp;amp;rest args)&#xA;  (message &quot;org-tags-view called with args %S&quot; args)&#xA;  (let ((res (apply orig-fun args)))&#xA;    (message &quot;org-tags-view returned %S&quot; res)&#xA;    res))&#xA;&#xA;(advice-add 'org-tags-view :around #'his-tracing-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the return was &lt;code&gt;display-buffer called with args (nil)&lt;/code&gt;. How can I discover what params was passed for this function?&lt;/p&gt;&#xA;" OwnerUserId="8621" LastEditorUserId="105" LastEditDate="2016-09-06T00:31:34.970" LastActivityDate="2019-09-09T11:02:36.817" Title="Trace calls to a function with the parameters" Tags="|debugging|functions|advice|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26860" PostTypeId="2" ParentId="26859" CreationDate="2016-09-05T18:14:00.543" Score="0" Body="&lt;p&gt;Someone else will likely answer your direct question, which is about &lt;code&gt;nadvice&lt;/code&gt;, the &quot;new&quot; advice system. In case it helps you or others, this answer is about the &quot;old&quot; advice system (&lt;code&gt;defadvice&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One reason to show it here is that this information was purged from the Elisp manual (unwisely, IMHO). It is available now only with Emacs 23 and previous builds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer for the &quot;old&quot; advice system:&#xA; &lt;em&gt;Just use macro &lt;strong&gt;&lt;code&gt;ad-get-arg&lt;/code&gt;&lt;/strong&gt; or macro &lt;strong&gt;&lt;code&gt;ad-get-args&lt;/code&gt;&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The (Emacs 23) Elisp manual, node &lt;code&gt;Argument Access in Advice&lt;/code&gt;, says this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The simplest way to access the arguments of an advised function in the&#xA;body of a piece of advice is to use the same names that the function&#xA;definition uses.  To do this, you need to know the names of the argument&#xA;variables of the original function.&#xA;&#xA;   While this simple method is sufficient in many cases, it has a&#xA;disadvantage: it is not robust, because it hard-codes the argument names&#xA;into the advice.  If the definition of the original function changes,&#xA;the advice might break.&#xA;&#xA;   Another method is to specify an argument list in the advice itself.&#xA;This avoids the need to know the original function definition's argument&#xA;names, but it has a limitation: all the advice on any particular&#xA;function must use the same argument list, because the argument list&#xA;actually used for all the advice comes from the first piece of advice&#xA;for that function.&#xA;&#xA;   A more robust method is to use macros that are translated into the&#xA;proper access forms at activation time, i.e., when constructing the&#xA;advised definition.  Access macros access actual arguments by their&#xA;(zero-based) position, regardless of how these actual arguments get&#xA;distributed onto the argument variables of a function.  This is robust&#xA;because in Emacs Lisp the meaning of an argument is strictly determined&#xA;by its position in the argument list.&#xA;&#xA; -- Macro: ad-get-arg position&#xA;     This returns the actual argument that was supplied at POSITION.&#xA;&#xA; -- Macro: ad-get-args position&#xA;     This returns the list of actual arguments supplied starting at&#xA;     POSITION.&#xA;&#xA; -- Macro: ad-set-arg position value&#xA;     This sets the value of the actual argument at POSITION to VALUE&#xA;&#xA; -- Macro: ad-set-args position value-list&#xA;     This sets the list of actual arguments starting at POSITION to&#xA;     VALUE-LIST.&#xA;&#xA;   Now an example.  Suppose the function `foo' is defined as&#xA;&#xA;     (defun foo (x y &amp;amp;optional z &amp;amp;rest r) ...)&#xA;&#xA;and is then called with&#xA;&#xA;     (foo 0 1 2 3 4 5 6)&#xA;&#xA;which means that X is 0, Y is 1, Z is 2 and R is `(3 4 5 6)' within the&#xA;body of `foo'.  Here is what `ad-get-arg' and `ad-get-args' return in&#xA;this case:&#xA;&#xA;     (ad-get-arg 0) =&amp;gt; 0&#xA;     (ad-get-arg 1) =&amp;gt; 1&#xA;     (ad-get-arg 2) =&amp;gt; 2&#xA;     (ad-get-arg 3) =&amp;gt; 3&#xA;     (ad-get-args 2) =&amp;gt; (2 3 4 5 6)&#xA;     (ad-get-args 4) =&amp;gt; (4 5 6)&#xA;&#xA;   Setting arguments also makes sense in this example:&#xA;&#xA;     (ad-set-arg 5 &quot;five&quot;)&#xA;&#xA;has the effect of changing the sixth argument to `&quot;five&quot;'.  If this&#xA;happens in advice executed before the body of `foo' is run, then R will&#xA;be `(3 4 &quot;five&quot; 6)' within that body.&#xA;&#xA;   Here is an example of setting a tail of the argument list:&#xA;&#xA;     (ad-set-args 0 '(5 4 3 2 1 0))&#xA;&#xA;If this happens in advice executed before the body of `foo' is run,&#xA;then within that body, X will be 5, Y will be 4, Z will be 3, and R&#xA;will be `(2 1 0)' inside the body of `foo'.&#xA;&#xA;   These argument constructs are not really implemented as Lisp macros.&#xA;Instead they are implemented specially by the advice mechanism.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-09-05T18:14:00.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26861" PostTypeId="2" ParentId="26858" CreationDate="2016-09-05T19:35:16.443" Score="5" Body="&lt;p&gt;To center with CSS, you need to use &lt;code&gt;margin-left: auto;&lt;/code&gt; and &lt;code&gt;margin-right: auto;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;try this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :style margin-left: auto; margin-right: auto;&#xA;[[/path/to/img.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-09-12T21:56:31.847" LastActivityDate="2016-09-12T21:56:31.847" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26862" PostTypeId="2" ParentId="26845" CreationDate="2016-09-05T19:43:19.220" Score="6" Body="&lt;p&gt;I don't think it is possible to get truly interactive Python input with org-babel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could use a preamble to redefine the input function so it returns what you want to simulate the use of input, e.g. here we make it look like the user typed in &quot;3&quot;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :results output :preamble def input(x): return 3&#xA;a = input(&quot;value &quot;)&#xA;print(a)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depending on what students see that is exported, they might not see that you have done this.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-09-05T19:43:19.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26863" PostTypeId="2" ParentId="26859" CreationDate="2016-09-05T21:18:55.967" Score="6" Body="&lt;p&gt;The easiest way to find out the arguments passed to a function is to use &lt;code&gt;M-x trace-function RET name-of-your-function RET&lt;/code&gt;. Once you're done, use &lt;code&gt;M-x untrace-function&lt;/code&gt; or &lt;code&gt;M-x untrace-all&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this should work for most functions you're interested in, but there are a few corner cases. See the commentary at the top of trace.el.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-09-05T21:18:55.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26864" PostTypeId="1" CreationDate="2016-09-06T00:02:56.287" Score="4" ViewCount="2360" Body="&lt;p&gt;I want to use a variable pitch face when using org mode (for composing articles, prose, etc.) The emacs wiki suggested using buffer face mode with a hook to set the face for org mode buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; Use variable width font faces in certain buffers&#xA; (defun my-buffer-face-mode-variable ()&#xA;   &quot;Set font to a variable width (proportional) fonts in current buffer&quot;&#xA;   (interactive)&#xA;   (setq buffer-face-mode-face '(:family &quot;Liberation Serif&quot; ))&#xA;   (buffer-face-mode))&#xA;&#xA; ;; Set default font faces for org  modes&#xA; (add-hook 'org-mode-hook 'my-buffer-face-mode-variable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This correctly changes the buffer face to variable-width, but seems to break org mode indentation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without buffer face mode, the buffer uses the default fixed pitch face for text and a variable pitch face for headers (as defined by the theme.) The resulting indentation is correct:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6coUC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6coUC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With buffer face mode both text and header use variable pitch face, but breaks indentation of all but the first line of headers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OfiUR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OfiUR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps there is a conflict using variable pitch faces with indentation or with visual line mode, which I also use? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (with-eval-after-load 'org       &#xA;  (setq org-startup-indented t) &#xA;  (add-hook 'org-mode-hook #'visual-line-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9382" LastActivityDate="2023-03-17T13:31:30.263" Title="Variable-pitch face breaking indentation in org mode" Tags="|indentation|faces|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26865" PostTypeId="1" AcceptedAnswerId="26868" CreationDate="2016-09-06T00:17:56.640" Score="26" ViewCount="4196" Body="&lt;p&gt;Pressing &lt;kbd&gt;TAB&lt;/kbd&gt; on a single unstaged file shows or hides details pertaining to that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I show &amp;amp; hide (toggle) details of all unstaged files at once?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did come across outline-hide-sublevels via &lt;code&gt;M-x&lt;/code&gt;. But I would like to know a key combination to do this in a toggle fashion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also typed &lt;kbd&gt;?&lt;/kbd&gt; to check the keybinding shortcuts for the magit-status area but could not find an answer. &lt;/p&gt;&#xA;" OwnerUserId="12780" LastActivityDate="2020-08-27T20:38:07.303" Title="Magit - How to expand all and collapse all sections in magit-status" Tags="|magit|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26866" PostTypeId="1" AcceptedAnswerId="35699" CreationDate="2016-09-06T00:19:54.203" Score="1" ViewCount="345" Body="&lt;p&gt;When using the &lt;code&gt;adaptive-wrap&lt;/code&gt; mode in the plain &lt;code&gt;latex-mode&lt;/code&gt; (no &lt;code&gt;AUCTeX&lt;/code&gt;), I want to give extra indents to only lines beginning with &amp;quot;&lt;code&gt;\item&lt;/code&gt;&amp;quot;. For example, I currently have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;\begin{itemize}&#xA;\item This is a very very very very very very very (soft-wrap here)&#xA;very very very very very very long line.&#xA;&#xA;  And this is another very very very very very very (soft-wrap here)&#xA;  very long line.&#xA;\end{itemize}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that there are two leading white-spaces at the beginning of the second paragraph (&amp;quot;  And this is ...&amp;quot;), which wraps by &lt;code&gt;adaptive-wrap&lt;/code&gt; nicely to my eyes. Now I would also like the paragraph beginning with &amp;quot;\item This is ...&amp;quot; to wrap with extra indentation even though it has no leading white-spaces. That is, I would like it displayed as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;\begin{itemize}&#xA;\item This is a very very very very very very very (soft-wrap here)&#xA;  very very very very very very long line.&#xA;&#xA;  And this is another very very very very very very (soft-wrap here)&#xA;  very long line.&#xA;\end{itemize}&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note the indentation at the beginning of the line next to the first soft-wrap. Could I do it somehow? Any help would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Globally setting &lt;code&gt;adaptive-wrap-extra-indent&lt;/code&gt; to 2 makes all lines have 2 extra indents, which I want to avoid. I would like only the line beginning with &amp;quot;&lt;code&gt;\item&lt;/code&gt;&amp;quot; have the effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. I am already very happy with the combination of &lt;code&gt;latex-mode&lt;/code&gt; and &lt;code&gt;adaptive-wrap&lt;/code&gt;, and this is the final issue I would like to resolve. I have the following in my .emacs file with some other stuff.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(load-library &quot;adaptive-wrap&quot;)&#xA;(visual-line-mode 1)&#xA;(adaptive-wrap-prefix-mode 1)&#xA;(whitespace-newline-mode 1)&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="13211" LastEditorUserId="13211" LastEditDate="2016-09-06T08:35:05.380" LastActivityDate="2017-09-23T10:14:49.257" Title="Extra indents in adaptive-wrap mode only for lines beginning with \item" Tags="|latex|indentation|wrapping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26867" PostTypeId="2" ParentId="26844" CreationDate="2016-09-06T00:37:21.690" Score="1" Body="&lt;p&gt;Regarding argument expansion, you should file a feature request at &lt;a href=&quot;https://github.com/syohex/emacs-company-jedi&quot; rel=&quot;nofollow&quot;&gt;company-jedi&lt;/a&gt; (or &lt;a href=&quot;https://github.com/proofit404/company-anaconda&quot; rel=&quot;nofollow&quot;&gt;company-anaconda&lt;/a&gt;!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And about files generated by &lt;code&gt;gtags&lt;/code&gt;, I don't think you want that. You'll have to teach every tool that uses them about the &quot;one place&quot; directory. But setting &lt;code&gt;GTAGSLIBPATH&lt;/code&gt; might help with that.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-09-06T00:37:21.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26868" PostTypeId="2" ParentId="26865" CreationDate="2016-09-06T01:16:48.157" Score="34" Body="&lt;p&gt;I think you want &lt;kbd&gt;M-TAB&lt;/kbd&gt; &lt;code&gt;magit-section-cycle-diffs&lt;/code&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Cycle the visibility of diff-related sections in the current buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://magit.vc/manual/magit.html#Section-Visibility-1&quot; rel=&quot;noreferrer&quot;&gt;https://magit.vc/manual/magit.html#Section-Visibility-1&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2738" LastEditorUserId="19689" LastEditDate="2020-08-27T20:38:07.303" LastActivityDate="2020-08-27T20:38:07.303" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="26869" PostTypeId="1" AcceptedAnswerId="27295" CreationDate="2016-09-06T01:17:40.820" Score="3" ViewCount="1050" Body="&lt;p&gt;I was not the only one who thought &lt;code&gt;ido&lt;/code&gt; is very inconvenient when trying to write a new file. The emacs wiki has a section dedicated to disabling &lt;code&gt;ido&lt;/code&gt; for &lt;code&gt;write-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/InteractivelyDoThings#toc33&quot; rel=&quot;nofollow&quot;&gt;Disable ido mode for particular commands, e.g. write-file&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their suggestion is to turn off &lt;code&gt;ido&lt;/code&gt; for write file using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This does not seem to work for me. &lt;code&gt;ido&lt;/code&gt; still runs when I hit &lt;code&gt;C-x C-w&lt;/code&gt;. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="9382" LastEditorUserId="2710" LastEditDate="2016-09-08T21:41:03.907" LastActivityDate="2017-07-21T18:52:35.797" Title="Disable ido mode for write file" Tags="|key-bindings|ido|overwrite|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26872" PostTypeId="2" ParentId="26855" CreationDate="2016-09-06T06:08:55.443" Score="2" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Select a register number which is unlikely to get used elsewere&#xA;(defconst my-windows-config-register 313465989&#xA;  &quot;Internal used&quot;)&#xA;&#xA;(defvar my-windows-config nil)&#xA;&#xA;(defun set-my-windows-config ()&#xA;  (interactive) &#xA;  (setq my-windows-config (window-configuration-to-register my-windows-config-register)))&#xA;&#xA;(defun jump-to-my-windows-config ()&#xA;  (interactive)&#xA;  (jump-to-register my-windows-config-register))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One command to register, the other to jump resp. restore window-configuration.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-09-06T06:08:55.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26873" PostTypeId="1" AcceptedAnswerId="26877" CreationDate="2016-09-06T07:20:09.150" Score="2" ViewCount="102" Body="&lt;p&gt;I'm trying to add a search engine in emacs-w3m and use duckduckgo to search emacswiki&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;w3m-search&quot;&#xA;  '(progn&#xA;     (setq w3m-search-engine-alist&#xA;           (append '(&#xA;                     (&quot;emacswiki&quot; &quot;https://duckduckgo.com/?q=%s++site%3Aemacswiki.org&amp;amp;ia=web&quot; nil)&#xA;                     ))&#xA;                     )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does not work as intended because of the second &quot;%&quot;. How can we escape the % character in emacs?&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="105" LastEditDate="2016-09-08T17:41:57.043" LastActivityDate="2016-09-08T17:41:57.043" Title="How to escape % in emacs" Tags="|w3m|format|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26874" PostTypeId="1" AcceptedAnswerId="26878" CreationDate="2016-09-06T07:28:26.587" Score="24" ViewCount="5181" Body="&lt;p&gt;CUA mode is very close to the workflow I am used to outside Emacs, so I am tempted to activate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have learned that Emacs may have useful gems hidden in its ways, and CUA mode seems something that was attached later on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the benefits of CUA Mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I do not know what I give up by activating it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the Emacs Info is not very revealing about the pros and cons of Emacs core approach vs CUA mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.emacswiki.org/emacs/CuaMode&quot; rel=&quot;noreferrer&quot;&gt;EmacsWiki section on CUA mode&lt;/a&gt; is also not too helpful in that regard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the features that a skilled Emacs user would miss by activating CUA mode?&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="337" LastEditDate="2016-09-08T21:47:36.750" LastActivityDate="2016-09-08T21:47:36.750" Title="What am I giving up by activating CUA mode?" Tags="|editing|cua-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26875" PostTypeId="2" ParentId="5552" CreationDate="2016-09-06T07:44:36.910" Score="4" Body="&lt;p&gt;For the record: I have dug up the root cause for this one. It is not for ZShaolin build, but rather, for Termux build of Emacs, but the source of the broken &lt;code&gt;load-history&lt;/code&gt; entry is the same, it's an Emacs bug resulting from running undumped, which Android builds necessarily have to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/termux/termux-packages/issues/423&quot; rel=&quot;nofollow&quot;&gt;https://github.com/termux/termux-packages/issues/423&lt;/a&gt; for the full story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most general solution appears to be commenting out the line &lt;code&gt;(setq current-load-list nil)&lt;/code&gt; in &lt;code&gt;/usr/share/emacs/&amp;lt;version&amp;gt;/loadup.el&lt;/code&gt; -- the presence of this line is intended to excise &lt;code&gt;loadup.el&lt;/code&gt; from &lt;code&gt;load-history&lt;/code&gt; with emacs that is dumped into a single binary with the lisp components during compilation. On Android, with the requirement that executables must be PIE, a dumped binary will simply not run, so both the ZShaolin and Termux builds of emacs run undumped, and this line results in the creation of a bogus &lt;code&gt;load-history&lt;/code&gt; entry.&lt;/p&gt;&#xA;" OwnerUserId="13163" LastActivityDate="2016-09-06T07:44:36.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26876" PostTypeId="2" ParentId="26849" CreationDate="2016-09-06T07:49:17.340" Score="1" Body="&lt;p&gt;I couldn't find the way to do it in plain org.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for that kind of tables I use latex tables (tabular and longtable) and export to pdf.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LATEX&#xA;\begin{table}[H]&#xA;\caption{Перечень сокращений}&#xA;\begin{center}&#xA;\begin{tabular}{|m{6cm}|m{10cm}|}&#xA;\hline&#xA;\theadfst{Сокращения} &amp;amp; \thead{Расшифровка} \\ \hline&#xA;АС     &amp;amp; Автоматизированная система\\ \hline&#xA;АРМ    &amp;amp; Автоматизированное рабочее место предназначенное для аудитора информационной безопасности\\ \hline&#xA;НСИ    &amp;amp; Нормативно-справочная информация\\ \hline&#xA;ЦХД    &amp;amp; Централизованное хранилище данных\\ \hline&#xA;ODS    &amp;amp; Оперативное хранилище данных на базе технологии Exadata и Golden Gate.\\ \hline&#xA;\end{tabular}&#xA;\end{center}&#xA;\end{table}&#xA;#+END_LATEX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One of the latest msword versions which I have can open PDFs as a docx. The formatting including tables and pictures are 99% fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QkRjz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QkRjz.png&quot; alt=&quot;пример&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS&#xA;theadfst and thead macros I have in a latex class setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\newcommand{\theadfst}[1]{\multicolumn{1}{|c|}{\textbf{#1}}}&#xA;\newcommand{\thead}[1]{\multicolumn{1}{c|}{\textbf{#1}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PPS&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you include makecell package, then your example could be made with the following latex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LATEX&#xA;\begin{table}[H]&#xA;\caption{Заголовок пакета}&#xA;\begin{center}&#xA;\begin{tabular}{|m{1cm}|m{1.5cm}|m{2cm}|m{4cm}|}&#xA;\hline&#xA;\thead{№} &amp;amp; \thead{Размер \\ (байт)} &amp;amp; \thead{Тип} &amp;amp; \thead{Значение} \\ \hline&#xA;1 &amp;amp; 1 &amp;amp; unsigned &amp;amp; \makecell[l]{\bfseries{Маркер начала} \\ константа 0xAC}\\ \hline&#xA;2 &amp;amp; 1 &amp;amp; unsigned &amp;amp; \makecell[l]{\bfseries{Размер данных} \\ в байтах, от 1 до 255}\\ \hline&#xA;3 &amp;amp; 1 &amp;amp; unsigned &amp;amp; \makecell[l]{\bfseries{Контрольная сумма} \\ по алгоритму CRC-8}\\ \hline&#xA;\end{tabular}&#xA;\end{center}&#xA;\end{table}&#xA;#+END_LATEX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GDYso.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GDYso.png&quot; alt=&quot;picture2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10063" LastEditorUserId="10063" LastEditDate="2016-09-06T08:34:55.377" LastActivityDate="2016-09-06T08:34:55.377" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26877" PostTypeId="2" ParentId="26873" CreationDate="2016-09-06T07:56:28.503" Score="3" Body="&lt;p&gt;I guess internally this uses the function 'format' so you can use %% to produce one %&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-09-06T07:56:28.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26878" PostTypeId="2" ParentId="26874" CreationDate="2016-09-06T10:23:23.527" Score="21" Body="&lt;p&gt;Here's my opinion, as I don't think there's an absolute answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, what you “lose” is the added complexity to the key use. Following is more detailed explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs C-x is prefix key for general commands, and C-c is prefix key of current major mode's commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CUA mode uses C-x for cut and C-c for copy. In order to avoid conflict, cua uses some tricks. Specifically, when there's text selection (that is, region active), then these keys acts as cut and copy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, sometimes emacs commands work differently depending on whether there's a text selection. For example, comment-dwim will act on a text selection if there's one, else just current line. (when you have transient-mark-mode on.) This is a very nice feature introduced since emacs 23 (in year 2009). It means, for many commands, you don't have to first make a selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When cua mode is on, and you want to call emacs command with key C-x or C-c, here's quote from the doc: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If you really need to perform a command which starts with one of&#xA;the prefix keys even when the region is active, you have three&#xA;options:&#xA;- press the prefix key twice very quickly (within 0.2 seconds),&#xA;- press the prefix key and the following key within 0.2 seconds, or&#xA;- use the SHIFT key with the prefix key, i.e. C-S-x or C-S-c.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, essentially you have complexities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used cua mode for several years around 2006 to 2011. Now I don't, because I basically remapped ALL emacs one thousand keys except the arrow keys.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-09-06T10:23:23.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26879" PostTypeId="1" CreationDate="2016-09-06T11:18:57.210" Score="1" ViewCount="239" Body="&lt;p&gt;I list my packages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; List all packages installed with el-get-install (look for &quot;installed&quot; to find installed packages)&#xA;(el-get-list-packages)&#xA;&#xA;;; List packages installed with &quot;package-install&quot;&#xA;(package-list-packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I see that the package &lt;code&gt;projectile&lt;/code&gt; (which is not working fine) is installed both with &lt;code&gt;el-get&lt;/code&gt; and &lt;code&gt;package-install&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does this mean the package is duplicated?&lt;/li&gt;&#xA;&lt;li&gt;Which installation takes precedence?&lt;/li&gt;&#xA;&lt;li&gt;How do I uninstall packages installed with &lt;code&gt;el-get-install&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;How do I uninstall packages installed with &lt;code&gt;package-install&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Is it possible to globally disable all packages installed with &lt;code&gt;package-install&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Is it possible to globally disable all packages installed with &lt;code&gt;el-get-install&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9216" LastActivityDate="2016-09-06T12:16:29.297" Title="Conflict in package installed with both package and el-get?" Tags="|package|install|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26880" PostTypeId="1" AcceptedAnswerId="26891" CreationDate="2016-09-06T11:29:06.890" Score="0" ViewCount="61" Body="&lt;p&gt;I am currently making a package which is for my own use, but it will be publicly available on github. Some of the code is borrowed from another package. How do I properly accredit the copied code to the original authors? Both the original code and modified code are GPL licensed.&lt;/p&gt;&#xA;" OwnerUserId="12195" LastActivityDate="2016-09-06T19:30:22.253" Title="Using code from other packages in your own" Tags="|package|licensing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26881" PostTypeId="2" ParentId="2387" CreationDate="2016-09-06T12:05:56.173" Score="5" Body="&lt;p&gt;I experienced the same problem after a new installation of ArchLinux with XFCE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I didn't manage to understand the problem, a workaround was to configure 'org-file-apps' as described in the FAQ :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-faq.html#external-application-launched-to-open-file-link&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/worg/org-faq.html#external-application-launched-to-open-file-link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in my .emacs.d/init.el, I have now :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(org-file-apps&#xA;    (quote&#xA;      ((auto-mode . emacs)&#xA;      (&quot;\\.mm\\'&quot; . default)&#xA;      (&quot;\\.x?html?\\'&quot; . &quot;/usr/bin/firefox %s&quot;)&#xA;      (&quot;\\.pdf\\'&quot; . default))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13217" LastActivityDate="2016-09-06T12:05:56.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26882" PostTypeId="2" ParentId="26879" CreationDate="2016-09-06T12:16:29.297" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Does this mean the package is duplicated?&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Probably.  Though it's also possible to tell el-get to install packages via package.el.  Use &lt;code&gt;M-x el-get-describe&lt;/code&gt; to see the &lt;code&gt;:type&lt;/code&gt; of the package, if it's &lt;code&gt;elpa&lt;/code&gt; then that means el-get is listing the package.el installation, otherwise it's duplicated.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Which installation takes precedence?&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Depends on the order you call &lt;code&gt;el-get&lt;/code&gt; and &lt;code&gt;package-initialize&lt;/code&gt; in your init file.  Use &lt;code&gt;M-x locate-library&lt;/code&gt; to find out where a lisp file is loaded from.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;How do I uninstall packages installed with el-get-install?&lt;/li&gt;&#xA;  &lt;li&gt;How do I uninstall packages installed with package-install?&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x el-get-remove&lt;/code&gt; and &lt;code&gt;M-x package-delete&lt;/code&gt; respectively.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Is it possible to globally disable all packages installed with package-install?&lt;/li&gt;&#xA;  &lt;li&gt;Is it possible to globally disable all packages installed with el-get-install?&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To prevent loading el-get packages during startup, remove the call to &lt;code&gt;el-get&lt;/code&gt; from your init file.  For package.el packages, remove the call to &lt;code&gt;package-initialize&lt;/code&gt; and also set &lt;code&gt;package-enable-at-startup&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no easy way to disable packages after the fact in a running Emacs session (you can try &lt;code&gt;unload-feature&lt;/code&gt;, if you know the relevant &quot;features&quot;, but it's not guaranteed to completely undo all the effects of loading, depending on what the package did).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-09-06T12:16:29.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26883" PostTypeId="2" ParentId="22665" CreationDate="2016-09-06T14:17:07.153" Score="1" Body="&lt;p&gt;You can disable dumping with &lt;code&gt;env CANNOT_DUMP=yes ./configure&lt;/code&gt;.  Does this not work on Docker?&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-09-06T14:17:07.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26885" PostTypeId="1" CreationDate="2016-09-06T14:45:32.590" Score="2" ViewCount="1553" Body="&lt;p&gt;I am using emacs with PuTTY. I have xterm-mouse-mode turned on, and it works nicely, except that nothing happens when I click on &quot;clickable texts&quot; for example on the start page, or in neotree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to use mouse clicks for these?&lt;/p&gt;&#xA;" OwnerUserId="13221" LastActivityDate="2017-05-05T17:03:47.467" Title="xterm-mouse-mode use mouse on clickable texts" Tags="|terminal-emacs|mouse|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26886" PostTypeId="1" CreationDate="2016-09-06T15:23:42.710" Score="1" ViewCount="433" Body="&lt;p&gt;Like the poster &lt;a href=&quot;https://emacs.stackexchange.com/questions/6105/how-to-set-proper-smtp-gmail-settings-in-emacs-in-order-to-be-able-to-work-with/6108#6108?newreg=ea3fd6a29dfd409fa7102497fb526f2a&quot;&gt;here&lt;/a&gt; I'm having difficulty connecting to an smtp server that uses tls.  I have installed gnutls-cli but I am still getting an error, &quot;530 5.7.0 Must issue a STARTTLS command first. ub8sm33925197wjc.39 - gsmtp&quot;.&#xA;How can I tell if smtpmail.el is really finding this program?  I have set up .key and .cert files, too, eventhough I'm not sure if they're necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are all my settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; send-mail-function 'smtpmail-send-it&#xA; message-send-mail-function 'smtpmail-send-it&#xA; user-mail-address &quot;XXXX.YYYY@gmail.com&quot;&#xA; smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; &quot;587&quot;&#xA;           &quot;~/.gnutls/smtp.gmail.com.key&quot; &quot;~/.gnutls/smtp.gmail.com.cert&quot;))&#xA; smtpmail-auth-credentials  (expand-file-name &quot;~/.authinfo&quot;)&#xA; smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-user &quot;XXXX.YYYY@gmail.com&quot;&#xA; smtpmail-smtp-service 587&#xA; smtpmail-stream-type 'ssl&#xA; smtpmail-debug-info t&#xA; smtpmail-debug-verb t&#xA; starttls-extra-arguments nil&#xA; starttls-gnutls-program &quot;/usr/bin/gnutls-cli&quot;&#xA; starttls-extra-arguments nil&#xA; starttls-use-gnutls t&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="13223" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2019-05-08T05:02:55.717" Title="smtpmail.el: How to tell if gnutls has started" Tags="|gnutls|smtpmail|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26887" PostTypeId="1" AcceptedAnswerId="26894" CreationDate="2016-09-06T15:30:50.697" Score="1" ViewCount="451" Body="&lt;p&gt;When I do &lt;kbd&gt;l&lt;/kbd&gt; (&lt;code&gt;vc-print-log&lt;/code&gt;) in the &lt;code&gt;*vc-dir*&lt;/code&gt; buffer, I get the &lt;code&gt;*vc-change-log*&lt;/code&gt; buffer with a single line per commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even when I can hit &lt;kbd&gt;RET&lt;/kbd&gt; (&lt;code&gt;log-view-toggle-entry-display&lt;/code&gt;) there to get the details, I still don't see the list of files touched by the commit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get the detailed list of all commits in the tree, including the full message and the list of files touched?&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-10-07T04:38:44.790" Title="super detailed vc-change-log" Tags="|git|vc|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26889" PostTypeId="2" ParentId="26845" CreationDate="2016-09-06T18:52:09.787" Score="9" Body="&lt;p&gt;Here is an alternative approach that uses a non-exported, tangled file to replace the input function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session :exports none :tangle example1.py&#xA;def input(x): &#xA;    if x == 'Value of a':&#xA;        return 3&#xA;    elif x == 'Value of b':&#xA;        return 4 &#xA;&#xA;#+END_SRC &#xA;&#xA;#+RESULTS: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Press &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-v&lt;/kbd&gt;&lt;kbd&gt;t&lt;/kbd&gt; or use the &lt;kbd&gt;M-x&lt;/kbd&gt;&lt;kbd&gt;org-babel-tangle&lt;/kbd&gt; command to create, i.e. &lt;a href=&quot;https://orgmode.org/manual/tangle.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;tangle&lt;/a&gt;, the &lt;code&gt;example1.py&lt;/code&gt; file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :results output :preamble from example1 import *&#xA;a = input('Value of a')&#xA;b = input('Value of b')&#xA;print(a + b) &#xA;#+END_SRC &#xA;&#xA;#+RESULTS:&#xA;: 7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The &lt;code&gt;example1.py&lt;/code&gt; file that was created from the previous python &lt;code&gt;SRC&lt;/code&gt; block will be imported into the current block using the builtin &lt;a href=&quot;https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;:preamble&lt;/a&gt; header and the value &lt;code&gt;from example1 import *&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="388" LastEditDate="2019-03-07T21:18:46.417" LastActivityDate="2019-03-07T21:18:46.417" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="26890" PostTypeId="1" CreationDate="2016-09-06T19:27:28.793" Score="0" ViewCount="114" Body="&lt;p&gt;I'm watching the great Emacs Rocks! Episode 13: multiple-cursors vide at youbube: &lt;a href=&quot;https://www.youtube.com/watch?v=jNa3axo40qM&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=jNa3axo40qM&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several places I'm not clear how the author did it. At 0:32: &lt;a href=&quot;https://youtu.be/jNa3axo40qM?t=32&quot; rel=&quot;nofollow&quot;&gt;https://youtu.be/jNa3axo40qM?t=32&lt;/a&gt;, how the author quickly deletes strings from the underscore character to the end of the words?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At 0:39:&lt;a href=&quot;https://youtu.be/jNa3axo40qM?t=39&quot; rel=&quot;nofollow&quot;&gt;https://youtu.be/jNa3axo40qM?t=39&lt;/a&gt;, how does the author quickly select the strings like &lt;code&gt;class=&quot;fruit&quot;&lt;/code&gt;? I guess it's a shortcuts from the html-mode but I can't find anything useful. &lt;/p&gt;&#xA;" OwnerUserId="2273" LastActivityDate="2016-09-07T06:55:10.133" Title="Question regarding Emacs Rocks! Episode 13: multiple-cursors" Tags="|multiple-cursors|" AnswerCount="1" CommentCount="0" ClosedDate="2016-09-09T22:14:37.230" ContentLicense="CC BY-SA 3.0" />
  <row Id="26891" PostTypeId="2" ParentId="26880" CreationDate="2016-09-06T19:30:22.253" Score="2" Body="&lt;p&gt;Assuming you have the correct GPL header at the top of the file then there isn't much else you need to do. A couple of extra headers will help though:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Copyright (C) 2016  Your Name&#xA;;; Copyright (C) 20xx-2011 Other Author&#xA;;; Author: Your Name &amp;lt;your@email&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I often put a note next to the function I've lifted:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Git Time Machine&#xA;;; via: http://blog.binchen.org/posts/new-git-timemachine-ui-based-on-ivy-mode.html&#xA;(defun ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course this does raise an interesting question of why are you nabbing the code? Could you not just add a (require 'foo) and list the package dependencies in your header? Unless you rename the function you run the risk of a name space clash if the user has both packages on their system.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2016-09-06T19:30:22.253" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26892" PostTypeId="2" ParentId="26845" CreationDate="2016-09-06T20:10:45.653" Score="2" Body="&lt;p&gt;As a complement of John Kitchin's solution, I propose to use a generator to provide the successive values that will &quot;feed&quot; the &lt;code&gt;input(...)&lt;/code&gt; functions and to return a &lt;code&gt;str&lt;/code&gt;object systematically. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session :exports none :tangle example2.py :results none&#xA;def generate(lst):&#xA;    for element in lst:&#xA;        yield str(element)&#xA;&#xA;generator =  generate([&quot;Thanks&quot;,4,&quot;your help&quot;])&#xA;&#xA;def input(x):&#xA;     return generator.__next__()&#xA;#+END_SRC &#xA;&#xA;&#xA;#+BEGIN_SRC python :results output :preamble from example2 import * :exports both&#xA;a = input('Value of a')&#xA;b = input('Value of b')&#xA;c = input('Value of c')&#xA;print(a,b,c)&#xA;#+END_SRC &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2016-09-06T20:10:45.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26894" PostTypeId="2" ParentId="26887" CreationDate="2016-09-06T23:42:37.777" Score="2" Body="&lt;p&gt;As far as I can tell, you need to modify the function &lt;code&gt;git-vc-print-log&lt;/code&gt;. It only has some limited configurability, and that's not enough for you. You can change the variable &lt;code&gt;vc-git-root-log-format&lt;/code&gt; to change what &lt;code&gt;vc-print-log&lt;/code&gt; displays for a directory, but that only gives you a value that's passed to &lt;code&gt;git log --pretty=tformat=&lt;/code&gt;, and there's no option to include the list of file names there. You need to add the option &lt;code&gt;--name-only&lt;/code&gt; or &lt;code&gt;--name-status&lt;/code&gt; as a separate argument to &lt;code&gt;git&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to change the way &lt;code&gt;git-vc-print-log&lt;/code&gt; calls &lt;code&gt;vc-git-command&lt;/code&gt;. While &lt;a href=&quot;https://emacs.stackexchange.com/questions/16809/override-a-function-locally-but-allow-calls-to-the-original-function&quot;&gt;it would technically be possible to do it with advice&lt;/a&gt;, it's a bit tricky. Given that the function is fairly small and only really does one thing, I'd just write my own modified version. Take the existing code and pass the extra option.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-09-06T23:42:37.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26895" PostTypeId="2" ParentId="26845" CreationDate="2016-09-07T00:29:34.427" Score="8" Body="&lt;h1&gt;Evaluate &lt;code&gt;python&lt;/code&gt; code blocks using literate programming in org-mode.&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;Use &lt;code&gt;:var&lt;/code&gt; header to assign variables and test your code.&lt;/h2&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note: If desired use &lt;code&gt;elisp&lt;/code&gt; &lt;code&gt;(read-string &quot;Prompt: &quot;)&lt;/code&gt; and &lt;code&gt;(read-number &quot;Prompt: &quot;)&lt;/code&gt; to prompt for user input inside emacs.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Example 1 - &lt;em&gt;print(a)&lt;/em&gt;&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Assign &lt;code&gt;hello world&lt;/code&gt; to &lt;code&gt;a&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: ex1-code  &#xA;#+header: :var a=&quot;hello world&quot;  &#xA;#+begin_src python :results verbatim replace output :exports results  &#xA;  print(a)  &#xA;#+end_src&#xA;&#xA;#+begin_src python :eval never :exports code :noweb yes   &#xA;  a = input('Value of a')  &#xA;  &amp;lt;&amp;lt;ex1-code&amp;gt;&amp;gt;  &#xA;#+end_src  &#xA;&#xA;#+results: ex1-code&#xA;: hello world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Example 2 - &lt;code&gt;print(a + b)&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Assign &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;a&lt;/code&gt;.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Assign &lt;code&gt;2&lt;/code&gt; to &lt;code&gt;b&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: ex2-code&#xA;#+header: :var a=1 &#xA;#+header: :var b=2 &#xA;#+begin_src python :results replace output  :exports results &#xA;  print(a + b)&#xA;#+end_src&#xA;&#xA;#+begin_src python :eval never :exports code :noweb yes &#xA;  a = input('Value of a')&#xA;  b = input('Value of b')&#xA;  &amp;lt;&amp;lt;ex2-code&amp;gt;&amp;gt;&#xA;#+end_src  &#xA;&#xA;#+results: ex2-code&#xA;: 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Example 3 - &lt;code&gt;print(a,b,c)&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When prompted for &lt;code&gt;Value of a&lt;/code&gt; enter &lt;code&gt;Thanks&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;When prompted for &lt;code&gt;Value of b&lt;/code&gt; enter &lt;code&gt;4&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When prompted for &lt;code&gt;Value of c&lt;/code&gt; enter &lt;code&gt;your question&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: ex3-code&#xA;#+header: :var a=(read-string &quot;Value of a &quot;) &#xA;#+header: :var b=(read-number &quot;Value of b &quot;) &#xA;#+header: :var c=(read-string &quot;Value of c &quot;) &#xA;#+begin_src python :results replace output   :exports results &#xA;  print a,b,c&#xA;#+end_src  &#xA;&#xA;#+begin_src python :eval never :exports code :noweb yes &#xA;  a = input('Value of a')&#xA;  b = input('Value of b')&#xA;  c = input('Value of c')&#xA;  &amp;lt;&amp;lt;ex3-code&amp;gt;&amp;gt;&#xA;#+end_src  &#xA;&#xA;#+results: ex3-code&#xA;: Thanks 4 your question&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When you export your org file, the output should look similar to the example below    &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Example 1 - &lt;code&gt;print(a)&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Assign &lt;code&gt;hello world&lt;/code&gt; to &lt;code&gt;a&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = input('Value of a')&#xA;print(a)&#xA;&#xA;hello world&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Example 2 - &lt;code&gt;print(a + b)&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assign &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;a&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Assign &lt;code&gt;2&lt;/code&gt; to &lt;code&gt;b&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = input('Value of a')&#xA;b = input('Value of b')&#xA;print(a + b)&#xA;&#xA;3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Example 3 - &lt;code&gt;print(a,b,c)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When prompted for &lt;code&gt;Value of a&lt;/code&gt; enter &lt;code&gt;Thanks&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;When prompted for &lt;code&gt;Value of b&lt;/code&gt; enter &lt;code&gt;4&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When prompted for &lt;code&gt;Value of c&lt;/code&gt; enter &lt;code&gt;your question&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = input('Value of a')&#xA;b = input('Value of b')&#xA;c = input('Value of c')&#xA;print a,b,c&#xA;&#xA;Thanks 4 your question&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This code was tested with&lt;br&gt;&#xA;  GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  Org-Mode Version: 8.3.2&lt;br&gt;&#xA;  and github.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastActivityDate="2016-09-07T00:29:34.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26896" PostTypeId="2" ParentId="26885" CreationDate="2016-09-07T05:46:31.887" Score="0" Body="&lt;p&gt;As Gilles said, emacs interprets the clicks of the middle mouse button, not the left. This means that you should first move the cursor to the desired position with the left mouse button, and then click with the middle. I do not find this behavior ergonomic, so I redefined the left-click to the &quot;usual&quot; way: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun on-mouse1-click (*click)&#xA;    (interactive &quot;e&quot;)&#xA;    (let ((p1 (posn-point (event-start *click))))&#xA;      (goto-char p1)&#xA;      (push-button)&#xA;      (neotree-enter)))&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-1&amp;gt;&quot;) 'on-mouse1-click)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13221" LastActivityDate="2016-09-07T05:46:31.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26897" PostTypeId="1" AcceptedAnswerId="26908" CreationDate="2016-09-07T06:40:53.600" Score="1" ViewCount="356" Body="&lt;p&gt;Since &lt;code&gt;js2-mode&lt;/code&gt; does not have &lt;code&gt;eldoc-mode&lt;/code&gt; support, I was wondering if I could get some similar functionality to &lt;code&gt;js2-mode&lt;/code&gt; with the help of &lt;code&gt;tern-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tern-mode&lt;/code&gt; has a command &lt;code&gt;tern-get-type&lt;/code&gt; which will return the type of the thing under cursor in the minibuffer. How can I get this command to run automatically when cursor is idle (preferably after a small delay)?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-09-07T13:45:53.463" LastActivityDate="2016-09-07T13:45:53.463" Title="Adding eldoc support to js2-mode" Tags="|commands|js2-mode|eldoc|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26898" PostTypeId="2" ParentId="26890" CreationDate="2016-09-07T06:55:10.133" Score="1" Body="&lt;p&gt;There are multiple ways of doing what the author did. Heres what I use to achieve them :-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the trick at 0:32, We can achieve this using &lt;code&gt;smartparens&lt;/code&gt; package. Just enable &lt;code&gt;smartparens-mode&lt;/code&gt; and press &lt;code&gt;C-k&lt;/code&gt;. That's it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the trick at 0:39, we can do this in two ways :-&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using &lt;code&gt;expand-region&lt;/code&gt; package. Check &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; link for details on how to use this.&lt;/li&gt;&#xA;&lt;li&gt;If you have &lt;code&gt;web-mode&lt;/code&gt; installed, it has a command to select the attribute. It is bound to &lt;code&gt;C-c C-a s&lt;/code&gt; by default.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-09-07T06:55:10.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26899" PostTypeId="2" ParentId="26885" CreationDate="2016-09-07T07:14:41.410" Score="0" Body="&lt;p&gt;On linked text, such as what you find on the start page, left-clicking only moves the cursor and sets the active window like it normally does. To follow the link, you need to press the middle mouse button (that's the wheel if you have a two-buttons-and-a-wheel mouse). Left-clicking does push proper buttons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A a long press of the left mouse button (450ms by default) also follows links, but I think that doesn't work in terminals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want left clicks to always follow links regardless of duration, in the Customize interface, go to Editing → Mouse and change the setting of “Mouse 1 Click Follows Link” to enable it. Or put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mouse-1-click-follows-link t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want only double-clicks of the left button to follow links, set the variable to &lt;code&gt;double&lt;/code&gt; instead of &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if that setting affects Neotree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GUI Emacs tends to be more comfortable to work in than terminal Emacs. Instead of running Emacs on the remote machine, consider running Emacs locally and &lt;a href=&quot;https://www.gnu.org/software/tramp/&quot; rel=&quot;nofollow&quot;&gt;editing remote files&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-09-07T07:37:14.700" LastActivityDate="2016-09-07T07:37:14.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26900" PostTypeId="1" AcceptedAnswerId="26902" CreationDate="2016-09-07T07:57:12.310" Score="5" ViewCount="2124" Body="&lt;p&gt;How can one include ReStructuredText or markdown snippets in org document, so that when org file is exported in corresponding format, those snippets are part of text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can that be done with org-mode built-in exporters? Or with pandoc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rationale: rst format supports grid tables (unlike org), so i want to take and use them in my document. 2-step export (first to rst or markdown, then to html or docx or odt) will get me document i need.&lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2016-09-07T13:38:41.087" Title="How to include rst or markdown in org document?" Tags="|org-export|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26901" PostTypeId="2" ParentId="26900" CreationDate="2016-09-07T08:54:15.110" Score="2" Body="&lt;p&gt;install corresponding major-mode. The language tag used after &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; is the major mode name with sub-string &quot;-mode&quot; removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For rst-mode, the language tag should be rst (sub-string &quot;-mode&quot; stripped), so the complete code in org mode should be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC rst&#xA;Section Header&#xA;==============&#xA;&#xA;Subsection Header&#xA;-----------------&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If your purpose is render markdown or rst into html and you want to manage the source code of documents in org-mode, you'd better convert rst/markdown to org format at first, then use &lt;code&gt;#+SETUPFILE&lt;/code&gt; to include the converted org.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+SETUPFILE: &quot;shared/rst-converted.org&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-09-07T13:38:41.087" LastActivityDate="2016-09-07T13:38:41.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26902" PostTypeId="2" ParentId="26900" CreationDate="2016-09-07T11:01:52.050" Score="5" Body="&lt;p&gt;In theory, you should be able to define backend-specific snippets with &lt;code&gt;@@markdown:**markdown snippet**@@&lt;/code&gt; or, starting with org-mode 9, exports blocks (&lt;code&gt;#+BEGIN_export markdown&lt;/code&gt; … &lt;code&gt;#+END_export markdown&lt;/code&gt;).  However, it seems that not all backends support this, I could only get this working with HTML and LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give a simple example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This document was exported as @@html:&amp;lt;strong&amp;gt;html&amp;lt;/strong&amp;gt;@@&#xA;@@rst:**rst**@@ @@markdown:`markdown`@@&#xA;&#xA;#+BEGIN_export rst&#xA;This should only show up in reStructuredText.&#xA;#+END_export&#xA;&#xA;#+BEGIN_export markdown&#xA;This block contains *Markdown*.&#xA;#+END_export&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the case at hand, you may get better results using &lt;a href=&quot;http://pandoc.org&quot; rel=&quot;noreferrer&quot;&gt;Pandoc&lt;/a&gt;. Only a limited subset of org-features is supported by pandoc, but export snippets and export blocks should work.  Simply invoke pandoc as &lt;code&gt;pandoc -f org -t rst -o target-file.rst your-org-input-file.org&lt;/code&gt;.  The result for the above example would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This document was exported as **rst**&#xA;&#xA;This should only show up in reStructuredText.&#xA;&#xA;.. raw:: markdown&#xA;&#xA;   This block should only show up in Markdown.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that inline snippets are dropped if they are not supported by the target format.  The Markdown-block is kept as RST allows to define raw blocks the same way org-mode does.  One would have to use a pandoc-filter to remove that block if it's not wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Disclaimer: I'm a pandoc contributor and hence biased, so take that recommendation with a grain of salt.)&lt;/p&gt;&#xA;" OwnerUserId="8987" LastEditorUserId="8987" LastEditDate="2016-09-07T12:02:30.340" LastActivityDate="2016-09-07T12:02:30.340" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26903" PostTypeId="2" ParentId="24398" CreationDate="2016-09-07T11:47:10.293" Score="0" Body="&lt;p&gt;If all you're interested in, are the &lt;code&gt;PATH&lt;/code&gt; and &lt;code&gt;MANPATH&lt;/code&gt; variables, one way to get good values for those, are with this code (snipped from my emacs init file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((path-helper&#xA;   (lambda (p pd)&#xA;     (with-temp-buffer&#xA;       (mapc (lambda (filename)&#xA;           (insert-file-contents filename)&#xA;           (goto-char (point-max))&#xA;           (unless (bolp) (insert &quot;\n&quot;)))&#xA;         (cons p (directory-files pd t &quot;[^.]&quot;)))&#xA;       (let (res)&#xA;     (goto-char (point-min))&#xA;     (while (&amp;lt; (point) (point-max))&#xA;       (setq res (cons (buffer-substring&#xA;                (point) (progn (end-of-line) (point)))&#xA;               res))&#xA;       (forward-char 1))&#xA;     (nreverse res))))))&#xA;  (setq exec-path (funcall path-helper &quot;/etc/paths&quot; &quot;/etc/paths.d&quot;))&#xA;  (setenv &quot;PATH&quot; (mapconcat #'identity exec-path &quot;:&quot;))&#xA;  (setenv &quot;MANPATH&quot;&#xA;      (mapconcat #'identity&#xA;         (funcall path-helper &quot;/etc/manpaths&quot; &quot;/etc/manpaths.d&quot;)&#xA;         &quot;:&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But then, of course, you need to maintain the files &lt;code&gt;/etc/paths&lt;/code&gt;, &lt;code&gt;/etc/paths.d/*&lt;/code&gt;,  &lt;code&gt;/etc/manpaths&lt;/code&gt;, and &lt;code&gt;/etc/manpaths.d/*&lt;/code&gt;. In any case, in the default setup, your login shell on OS X uses those files to set these variables, with the help of the &lt;code&gt;path_helper&lt;/code&gt; utility, so this should be no great burden.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-09-07T11:47:10.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26904" PostTypeId="1" AcceptedAnswerId="27099" CreationDate="2016-09-07T11:55:41.700" Score="1" ViewCount="859" Body="&lt;p&gt;While imenu works very well in most environments, I am having issues when using it in C++ files where functions are not defined flush left.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Update:)&#xA;Steps to reproduce the issue (thanks to Drew's comment below).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start &lt;code&gt;emacs -Q&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Load the file below. &lt;/li&gt;&#xA;&lt;li&gt;Do &lt;code&gt;M-x imenu&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;I get the error message: &quot;No items suitable for an index found in this buffer&quot;. &lt;/li&gt;&#xA;&lt;li&gt;If the two functions are not indented (the lines starting with &quot;int&quot;), I instead get the prompt &quot;Index item: &quot;, as expected.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Test file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;namespace this_breaks_imenu&#xA;{&#xA;   int other_function( int argc, char** argv )&#xA;   {&#xA;     float b;&#xA;     return 0;&#xA;   }&#xA;&#xA;  int main( int argc, char** argv )&#xA;  {&#xA;    float a;&#xA;    return 0;&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the code is indented like that (with a couple of extra spaces along the left margin), doing &lt;code&gt;S-down-mouse-3&lt;/code&gt; which is bound to &lt;code&gt;(imenu INDEX-ITEM)&lt;/code&gt; gives me &quot;No kbd macro has been defined&quot;. The same file without the spaces to the left works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this, and is there any way of working around it, other than changing the indentation of the files (which will not be appreciated by my collaborators)?&lt;/p&gt;&#xA;" OwnerUserId="12461" LastEditorUserId="12461" LastEditDate="2016-09-07T20:08:47.343" LastActivityDate="2024-03-13T05:41:39.470" Title="imenu doesn't work on indented C++ code" Tags="|imenu|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26907" PostTypeId="2" ParentId="26885" CreationDate="2016-09-07T13:15:56.983" Score="1" Body="&lt;p&gt;This was a bug in the &lt;code&gt;xterm-mouse-mode&lt;/code&gt; handling.  Should be fixed in Emacs-25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're interested about the details, the problem is the need to perform several rewritings:&#xA;- first from xterm's escape sequence to a &lt;code&gt;mouse-1&lt;/code&gt; event.&#xA;- then from &lt;code&gt;mouse-1&lt;/code&gt; to &lt;code&gt;mouse-2&lt;/code&gt; (because it's a left click on a link).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These two steps only work if they're performed in the right order, but in the old code, the two steps were not performed in the right order, so when the link-handling code was trying to modify &lt;code&gt;mouse-1&lt;/code&gt; into &lt;code&gt;mouse-2&lt;/code&gt;, all it saw was some escape sequence which it had no idea was actually &quot;equivalent&quot; to a &lt;code&gt;mouse-1&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-09-07T13:15:56.983" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26908" PostTypeId="2" ParentId="26897" CreationDate="2016-09-07T13:23:29.637" Score="2" Body="&lt;p&gt;The right thing to do is to run this &lt;code&gt;tern-get-type&lt;/code&gt; from &lt;code&gt;eldoc-documentation-function&lt;/code&gt;.  This way, &lt;code&gt;eldoc-mode&lt;/code&gt; will take care of running it after a little delay etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. maybe something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun js2--eldoc-via-tern ()&#xA;  ...(tern-get-type..)...)&#xA;&#xA;(add-hook 'js2-mode-hook&#xA;          (lambda ()&#xA;            (setq-local eldoc-documentation-function #'js2--eldoc-via-tern)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might even do that to &lt;code&gt;js-mode&lt;/code&gt; rather than &lt;code&gt;js2-mode&lt;/code&gt; (since nowadays &lt;code&gt;js2-mode&lt;/code&gt; inherits from &lt;code&gt;js-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If/when it works, I suggest you submit it for inclusion in js(2)-mode, e.g. via &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-09-07T13:23:29.637" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26909" PostTypeId="2" ParentId="10114" CreationDate="2016-09-07T14:09:15.013" Score="11" Body="&lt;p&gt;In addition to the above points there is one more detail. If clicking the link displays the image correctly in a new buffer, but toggling &lt;code&gt;org-display-inline-images&lt;/code&gt; returns the message &lt;code&gt;No images to display inline&lt;/code&gt;, you may have description text in the link: &lt;code&gt;[[path_to_image][description]]&lt;/code&gt;. Remove the description, leaving only &lt;code&gt;[[path_to_image]]&lt;/code&gt;, and the images should display inline correctly.&lt;/p&gt;&#xA;&lt;p&gt;As explained in the org manual:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/Handling-links.html#Handling-links&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Handling-links.html#Handling-links&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;C-c C-x C-v     (org-toggle-inline-images)&#xA;Toggle the inline display of linked images. Normally this will only inline images that have no description part in the link, i.e.,&#xA;images that will also be inlined during export. When called with a&#xA;prefix argument, also display images that do have a link description.&#xA;You can ask for inline images to be displayed at startup by&#xA;configuring the variable org-startup-with-inline-images.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Does anyone know the prefix for displaying inline images that have description text?&lt;/p&gt;&#xA;" OwnerUserId="9382" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-09-07T14:09:15.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26910" PostTypeId="1" AcceptedAnswerId="26911" CreationDate="2016-09-07T14:15:15.287" Score="0" ViewCount="89" Body="&lt;p&gt;I'm currently trying to transition my personal research writing from straight LaTeX to Rmarkdown to allow me to do better reproducible research, and I've run into one little snag. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have this in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'reftex-vars&#xA;  '(progn&#xA;     ;; (also some other reftex-related customizations)&#xA;     (setq reftex-cite-format&#xA;           '((?\C-m . &quot;\\cite[]{%l}&quot;)&#xA;             (?f . &quot;\\footcite[][]{%l}&quot;)&#xA;             (?a . &quot;\\autocite[]{%l}&quot;)&#xA;             (?t . &quot;\\textcite[]{%l}&quot;)&#xA;             (?p . &quot;\\parencite[]{%l}&quot;)&#xA;             (?o . &quot;\\citepr[]{%l}&quot;)&#xA;             (?n . &quot;\\nocite{%l}&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know I can &lt;a href=&quot;https://stackoverflow.com/questions/13607156/autocomplete-pandoc-style-citations-from-a-bibtex-file-in-emacs&quot;&gt;add lines for Rmd-style citations&lt;/a&gt; (&lt;code&gt;[@%l]&lt;/code&gt;), but I would like to be able to have the list of potential citation types be context-sensitive. Is there a way to customize &lt;code&gt;reftex-cite-format&lt;/code&gt; based on the buffer I'm currently editing, so that I can see the LaTeX-style cites in .tex files, and the Rmd-style cites in .Rmd files?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2016-09-07T15:11:00.490" Title="Change reftex-cite-format based on file type" Tags="|reftex-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26911" PostTypeId="2" ParentId="26910" CreationDate="2016-09-07T15:11:00.490" Score="1" Body="&lt;p&gt;Maybe you can use a mode hook function to set buffer-local variables. e.g. use setq-local in the hook function. Here is an example of customizing it for org-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda () &#xA;               (setq-local reftex-cite-format&#xA;                       '((?\C-m . &quot;cite:%l&quot;)&#xA;                     (?f . &quot;footcite:%l&quot;)&#xA;                     (?a . &quot;autocite:%l&quot;)&#xA;                     (?t . &quot;textcite:%l&quot;)&#xA;                     (?p . &quot;parencite:%l&quot;)&#xA;                     (?o . &quot;citepr:%l&quot;)&#xA;                     (?n . &quot;nocite:%l&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-09-07T15:11:00.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26912" PostTypeId="1" CreationDate="2016-09-07T15:31:40.523" Score="4" ViewCount="805" Body="&lt;p&gt;How can I make &lt;code&gt;smartparens&lt;/code&gt; &lt;em&gt;not&lt;/em&gt; to insert a parenthesis pair when the point is at the beginning of a word? I only want it to insert the opening parenthesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package smartparens-config&#xA;  :ensure smartparens&#xA;  :diminish smartparens-mode&#xA;  :config&#xA;  (progn&#xA;    (smartparens-global-mode 1)&#xA;    (show-smartparens-global-mode 1)&#xA;    (setq&#xA;       smartparens-strict-mode nil&#xA;       sp-autoinsert-if-followed-by-word nil&#xA;       sp-autoskip-closing-pair 'always&#xA;       sp-base-key-bindings 'paredit&#xA;       sp-hybrid-kill-entire-symbol nil)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you see, I have set &lt;code&gt;sp-autoinsert-if-followed-by-word&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, as the documentation recommends, but to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the animated gif here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EoViv.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EoViv.gif&quot; alt=&quot;animated gif of problem&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this?&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="304" LastEditDate="2016-09-08T01:33:26.717" LastActivityDate="2016-09-08T16:48:30.787" Title="Smartparens: do not insert parenthesis pair when point is at the beginning of word" Tags="|smartparens|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26913" PostTypeId="1" CreationDate="2016-09-07T16:47:56.830" Score="9" ViewCount="1013" Body="&lt;p&gt;I'd like to color the messages in my &lt;code&gt;*mu4e-headers*&lt;/code&gt; view, depending on which mailing list they come from. I'm rather new to emacs face alterations, and I didn't see anything that looked relevant for this. Are there programmatic hooks for defining a per-line face?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: If an email is in my INBOX/ML folder, I'd like it green. If it's just in my INBOX, I'd like it blue.&lt;/p&gt;&#xA;" OwnerUserId="8777" LastActivityDate="2019-07-07T20:47:16.947" Title="Coloring mu4e headers based on title content" Tags="|faces|colors|mu4e|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26914" PostTypeId="1" AcceptedAnswerId="26952" CreationDate="2016-09-07T16:51:24.860" Score="1" ViewCount="416" Body="&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; I use the symbol &lt;code&gt;␣&lt;/code&gt; to represent the character &lt;code&gt;SPACE&lt;/code&gt; (&lt;code&gt;U+0020&lt;/code&gt;) for visibility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a template like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${1:$$(yas-choose-value (with-current-buffer &quot;foo-buf&quot; (foo-get-name-list)))}␣[label=&quot;$1&quot;];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I pick an entry &lt;code&gt;&quot;Foo&quot;&lt;/code&gt; from the list returned from &lt;code&gt;foo-get-name-list&lt;/code&gt;, I expect to see an output line like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Foo␣[label=&quot;Foo&quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, however, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Foo[label=&quot;Foo&quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I preserve that &lt;code&gt;SPACE&lt;/code&gt; after &lt;code&gt;Foo&lt;/code&gt; and before the &lt;code&gt;LEFT SQUARE BRACKET&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2016-09-09T01:08:38.277" Title="Space eaten in yasnippet template" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26915" PostTypeId="1" AcceptedAnswerId="26917" CreationDate="2016-09-07T17:45:55.053" Score="4" ViewCount="2850" Body="&lt;p&gt;I would like to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;run an emacs function from the shell&lt;/li&gt;&#xA;&lt;li&gt;in a standard emacs session (configured as if it was run in an interactive session)&lt;/li&gt;&#xA;&lt;li&gt;with a certain file in the active buffer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I would like to do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --function org-beamer-export-to-pdf --file my-presentation.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bonus points if I can run it with the emacsclient, connecting to an already running emacs server.&lt;/p&gt;&#xA;" OwnerUserId="9216" LastEditorUserId="253" LastEditDate="2016-09-07T18:59:03.507" LastActivityDate="2016-09-07T18:59:03.507" Title="How to run emacs function from the shell" Tags="|command-line-arguments|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26917" PostTypeId="2" ParentId="26915" CreationDate="2016-09-07T18:41:27.750" Score="7" Body="&lt;p&gt;This should do what you want. If you don't have the file open, you may need to replace the &lt;code&gt;switch-to-buffer&lt;/code&gt; function to something that opens the file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -e '(progn (switch-to-buffer &quot;my-presentation.org&quot;) (org-beamer-export-to-pdf))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8777" LastActivityDate="2016-09-07T18:41:27.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26918" PostTypeId="5" CreationDate="2016-09-07T21:29:11.210" Score="0" Body="&lt;p&gt;A buffer has a single major mode chosen according to the file format. For mixed-content files, there are ways to benefit from multiple major modes.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Related tags&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/mmm-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;mmm-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;mmm-mode&lt;/a&gt;, one of the ways to switch between major modes based on context&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/polymode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;polymode&amp;#39;&quot; rel=&quot;tag&quot;&gt;polymode&lt;/a&gt;, another way to switch between major modes based on context&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/web-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;web-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;web-mode&lt;/a&gt;, for HTML files embedded CSS, Javascript and server-side scripts&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;External links&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacswiki.org/emacs/MultipleModes&quot; rel=&quot;nofollow&quot;&gt;Multiple Modes&lt;/a&gt; on the Emacs Wiki&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-09-23T18:08:37.523" LastActivityDate="2016-09-23T18:08:37.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26919" PostTypeId="4" CreationDate="2016-09-07T21:29:11.210" Score="0" Body="Editing mixed-content files with multiple major modes in the same buffer" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-09-07T21:29:11.210" LastActivityDate="2016-09-07T21:29:11.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26920" PostTypeId="5" CreationDate="2016-09-07T21:30:46.617" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/purcell/mmm-mode&quot; rel=&quot;nofollow&quot;&gt;MMM mode&lt;/a&gt; is a minor mode that allows multiple major modes to coexist in the same buffer, in order to edit mixed-content files. It is one of the &lt;a href=&quot;/questions/tagged/multiple-modes&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;multiple-modes&amp;#39;&quot; rel=&quot;tag&quot;&gt;multiple-modes&lt;/a&gt; solutions.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-09-07T21:30:46.617" LastActivityDate="2016-09-07T21:30:46.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26921" PostTypeId="4" CreationDate="2016-09-07T21:30:46.617" Score="0" Body="MMM mode is a minor mode that allows multiple major modes to coexist in the same buffer" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-09-07T21:30:46.617" LastActivityDate="2016-09-07T21:30:46.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26922" PostTypeId="2" ParentId="26589" CreationDate="2016-09-07T21:33:28.823" Score="1" Body="&lt;p&gt;I have written a solution based on the indentation code of &lt;code&gt;js.el&lt;/code&gt; and have called it &lt;code&gt;js-align&lt;/code&gt;, simular to &lt;code&gt;cc-align&lt;/code&gt;. If you are interested, the code is available here &lt;a href=&quot;https://github.com/johnhooks/js-align/&quot; rel=&quot;nofollow&quot;&gt;github.com/johnhooks/js-align&lt;/a&gt;. It isn't perfect yet, though I plan to continue to hack away at it. If you have any suggestions, feel free to let me know.&lt;/p&gt;&#xA;" OwnerUserId="12195" LastActivityDate="2016-09-07T21:33:28.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26923" PostTypeId="1" CreationDate="2016-09-07T21:50:59.267" Score="3" ViewCount="672" Body="&lt;p&gt;I wanted Emacs to automatically save all buffers after I refiled something, so I followed the bottom-most comment from &lt;a href=&quot;https://emacs.stackexchange.com/questions/477/how-do-i-automatically-save-org-mode-buffers&quot;&gt;this question&lt;/a&gt; and used&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-refile :after 'org-save-all-org-buffers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works great when the only thing I need to do is refile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I try to &lt;code&gt;org-copy&lt;/code&gt; something (which does an &lt;code&gt;org-refile&lt;/code&gt; under the hood), or use a custom function which uses &lt;code&gt;org-refile&lt;/code&gt; in some way, I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong number of arguments: #[nil &quot;ÀÁ!\210ÂÃÄ\&quot;\210ÅÆ!\203^R^@Ç \210ÀÈ!\207&quot; &#xA;[message &quot;Saving all Org-mode buffers...&quot; save-some-buffers t &#xA;#[nil &quot;ÀÁ!\207&quot; [derived-mode-p org-mode] 2] featurep org-id org-id-locations-save &#xA;&quot;Saving all Org-mode buffers... done&quot;] &#xA;3 (&quot;c:/Users/wiuah/.emacs.d/elpa/org-plus-contrib-20160801/org.elc&quot; . 620558) nil], 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyone know what's going on?&lt;/p&gt;&#xA;" OwnerUserId="12837" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2019-06-13T05:41:53.187" Title="Org-mode: Getting errors when auto-saving after refiling" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26925" PostTypeId="2" ParentId="26912" CreationDate="2016-09-07T23:30:42.600" Score="2" Body="&lt;p&gt;Type C-q ( to only insert a single opening paren. &lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-09-07T23:30:42.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26926" PostTypeId="1" AcceptedAnswerId="27055" CreationDate="2016-09-08T02:45:59.440" Score="3" ViewCount="446" Body="&lt;p&gt;By default, &lt;code&gt;M-s&lt;/code&gt; a prefix key bound to search-map, containing commands like occur (&lt;code&gt;M-s o&lt;/code&gt;) and isearch-forward-word (&lt;code&gt;M-s w&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I'd change my search-map prefix key to &lt;code&gt;ESC M-s&lt;/code&gt; in order to use &lt;code&gt;M-s&lt;/code&gt; for save-buffer (I'm on a Mac and I use &lt;kbd&gt;⌘&lt;/kbd&gt; as my meta key).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like the &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot; rel=&quot;nofollow&quot;&gt;bind-key&lt;/a&gt; package, but I can't figure out how to bind a prefix key to a keymap with it. I naively tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-keys (&quot;M-s&quot;     . save-buffer)&#xA;           (&quot;ESC M-s&quot; . search-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that doesn't work because &lt;code&gt;bind-keys&lt;/code&gt; expects an alist whose values are commands, but search-map is a keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've resorted to doing it without any of &lt;code&gt;bind-key&lt;/code&gt;'s helper functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;ESC M-s&quot;) search-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see &lt;code&gt;bind-key&lt;/code&gt; has the ability to bind keys within a particular map, and to define a new prefix map, but I don't see a way to bind to an existing map. Maybe there &lt;em&gt;is&lt;/em&gt; no way to do this using &lt;code&gt;bind-key&lt;/code&gt; macros, but I thought I'd ask in case anyone knows otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not totally convinced I want to move the search-map onto a less convenient prefix key just to get saving bound to &lt;kbd&gt;⌘S&lt;/kbd&gt;, but I'd like to try it out.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-09-13T02:57:08.960" Title="Use bind-key to bind a prefix key to an existing keymap?" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26927" PostTypeId="1" CreationDate="2016-09-08T05:46:47.513" Score="1" ViewCount="1068" Body="&lt;p&gt;I'm creating an &lt;code&gt;elisp&lt;/code&gt; file based on &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_syntax_coloring.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ergoemacs.org/emacs/elisp_syntax_coloring.html&lt;/a&gt; from this site.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My updated code is shown below&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; MOD5-mode.el --- sample major mode for editing MOD5 code.&#xA;&#xA;;; Copyleft © 2016, by &#xA;&#xA;;; Author:  (@gmail.com)&#xA;;; Version: 0.0.1&#xA;;; Created: 07-Sep-2016&#xA;;; Keywords: languages&#xA;;; Homepage: n/a&#xA;&#xA;;; This file is not part of GNU Emacs.&#xA;&#xA;;;; License:&#xA;&#xA;;; You can redistribute this program and/or modify it under the terms of the GNU General Public License version 2.&#xA;&#xA;;;; Commentary:&#xA;&#xA;;; This elisp file will enable the highlight of the MOD5 code when viewed in Emacs.&#xA;&#xA;;; ********* probably a link will be helpful here - under construction ***********&#xA;&#xA;;;; Code:&#xA;&#xA;;; define several category of keywords&#xA;(setq MOD5-keywords '(&quot;SEQ_SKEL&quot; &quot;NEMG&quot; &quot;NSDN&quot; &quot;SSTEP&quot; &quot;STEP&quot; &quot;START&quot; &quot;SCU&quot; &quot;LAMP&quot; &quot;HORN&quot; &quot;PRINTER&quot; &quot;MODULE&quot; &quot;END MODULE&quot; &quot;CALL TEMPLATE&quot; &quot;IF&quot; &quot;FOR&quot;) )&#xA;(setq MOD5-types '(&quot;AI&quot; &quot;AO&quot; &quot;DI&quot; &quot;DO&quot; &quot;AISIM&quot; &quot;DISIM&quot; &quot;ACO&quot; &quot;AIM&quot; &quot;AOT&quot; &quot;DOT&quot; &quot;AP&quot; &quot;AC&quot; &quot;DC&quot; &quot;DT&quot; &quot;DM&quot; &quot;AK&quot; &quot;AG&quot; &quot;AR&quot; &quot;TA&quot;))&#xA;(setq MOD5-constants '(&quot;PFS&quot; &quot;NFS&quot; &quot;IONE&quot; &quot;ZERO&quot;))&#xA;(setq MOD5-events '(&quot;WARN&quot; &quot;REQ&quot; &quot;ALT&quot;))&#xA;(setq MOD5-functions '(&quot;ALM_DI_DO05B&quot; &quot;IFD03B&quot; &quot;ALM_4S_AX04B&quot; &quot;ALM_DX05B&quot; &quot;ALM_RERING03B&quot; &quot;ALM_DI_DO05B&quot; &quot;IS04B&quot;))&#xA;(setq MOD5-operators '(&quot;=&quot; &quot;AND&quot; &quot;OR&quot; &quot;XOR&quot;))&#xA;(setq MOD5-acmdb '(&quot;\[(&amp;amp;A-Z0-9_)\]+&quot; &quot;\[(:A-Z0-9_)\]&quot;))&#xA;&#xA;;; generate regex string for each category of keywords&#xA;(setq MOD5-keywords-regexp (regexp-opt MOD5-keywords 'words))&#xA;(setq MOD5-type-regexp (regexp-opt MOD5-types 'words))&#xA;(setq MOD5-constant-regexp (regexp-opt MOD5-constants 'words))&#xA;(setq MOD5-event-regexp (regexp-opt MOD5-events 'words))&#xA;(setq MOD5-functions-regexp (regexp-opt MOD5-functions 'words))&#xA;(setq MOD5-operators-regexp (regexp-opt MOD5-operators 'words))&#xA;(setq MOD5-acmdb-regexp (regexp-opt MOD5-acmdb 'words))&#xA;&#xA;;; create the list for font-lock.&#xA;;; each category of keyword is given a particular face&#xA;(setq MOD5-font-lock-keywords&#xA;      `(&#xA;        (,MOD5-type-regexp . font-lock-type-face)&#xA;        (,MOD5-constant-regexp . font-lock-constant-face)&#xA;        (,MOD5-event-regexp . font-lock-builtin-face)&#xA;        (,MOD5-functions-regexp . font-lock-function-name-face)&#xA;        (,MOD5-keywords-regexp . font-lock-keyword-face)&#xA;    (,MOD5-acmdb-regexp . font-lock-variable-name-face)&#xA;    (,MOD5-operators-regexp . font-lock-negation-char-face)&#xA;        ;; note: order above matters, because once colored, that part won't change.&#xA;        ;; in general, longer words first&#xA;        ))&#xA;&#xA;;;;###autoload&#xA;(define-derived-mode MOD5-mode fundamental-mode&#xA;  &quot;MOD5 mode&quot;&#xA;  &quot;Major mode for editing MOD5 Dowtran Code…&quot;&#xA;&#xA;  ;; code for syntax highlighting&#xA;  (setq font-lock-defaults '((MOD5-font-lock-keywords))))&#xA;&#xA;;; clear memory. no longer needed&#xA;(setq MOD5-keywords nil)&#xA;(setq MOD5-types nil)&#xA;(setq MOD5-constants nil)&#xA;(setq MOD5-events nil)&#xA;(setq MOD5-functions nil)&#xA;(setq MOD5-acmdb nil)&#xA;(setq MOD5-operators nil)&#xA;&#xA;;; clear memory. no longer needed&#xA;(setq MOD5-keywords-regexp nil)&#xA;(setq MOD5-types-regexp nil)&#xA;(setq MOD5-constants-regexp nil)&#xA;(setq MOD5-events-regexp nil)&#xA;(setq MOD5-functions-regexp nil)&#xA;(setq MOD5-acmdb-regexp nil)&#xA;(setq MOD5-operators-regexp nil)&#xA;&#xA;;; add the mode to the `features' list&#xA;(provide 'MOD5-mode)&#xA;&#xA;;; Local Variables:&#xA;;; coding: utf-8&#xA;;; End:&#xA;&#xA;;;; MOD5-mode.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the above code, I'm unable to get the following to work:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq MOD5-operators '(&quot;=&quot; &quot;AND&quot; &quot;OR&quot; &quot;XOR&quot;))&#xA;(setq MOD5-acmdb '(&quot;\[(&amp;amp;A-Z0-9_)\]+&quot; &quot;\[(:A-Z0-9_)\]&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is wrong here? I have copy-pasted the existing code and created the above two lines and for some reason they do not highlight what is within quotes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also the regex &lt;code&gt;&quot;\[(&amp;amp;A-Z0-9_)\]+&quot; &quot;\[(:A-Z0-9_)\]&quot;&lt;/code&gt; is intended to match text like &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;:ALM_SIP_PROB_123&lt;/li&gt;&#xA;&lt;li&gt;(:ALM_SIP_PROB_123)&lt;/li&gt;&#xA;&lt;li&gt;(&amp;amp;:ALM_SIP_PROB_123)  &lt;/li&gt;&#xA;&lt;li&gt;PIT14501&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm using the following to generate the regex string:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq MOD5-operators-regexp (regexp-opt MOD5-operators 'words))&#xA;(setq MOD5-acmdb-regexp (regexp-opt MOD5-acmdb 'words))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if something could be wrong with this?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; - Adding a sample program  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ePW93.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ePW93.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above image you can see that the &lt;code&gt;OR&lt;/code&gt;, &lt;code&gt;AND&lt;/code&gt; have not been highlighted.&lt;br&gt;&#xA;Also the numbers within parenthesis have not been highlighted  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; - Changed the elisp code - face name updated from &lt;code&gt;font-lock-operator&lt;/code&gt; to &lt;code&gt;font-lock-negation-char-face&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(,MOD5-operators-regexp . font-lock-negation-char-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="105" LastEditDate="2016-09-08T17:39:47.847" LastActivityDate="2016-09-08T17:39:47.847" Title="Syntax highlighting using Emacs" Tags="|font-lock|syntax-highlighting|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26928" PostTypeId="1" CreationDate="2016-09-08T07:26:44.263" Score="2" ViewCount="66" Body="&lt;p&gt;When I rename files to move them I have a handful of popular destinations that I would like to see in the (pseudo)history so that I can just cursor up to choose one. What I'm thinking is something like what &lt;code&gt;dired-guess-shell-alist-user&lt;/code&gt; does except instead of suggest commands, suggest destination directory. I know some commands allow you to supply a history but I did not find one for dired. Does such a thing already exist?&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="253" LastEditDate="2016-09-08T13:36:24.777" LastActivityDate="2016-09-08T17:38:30.680" Title="Supplying suggested destination directories to dired" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26930" PostTypeId="2" ParentId="26927" CreationDate="2016-09-08T09:40:38.307" Score="2" Body="&lt;p&gt;When I try your code, it highlights more than it does in your example, including the AND:s. Try to restart Emacs and see if anything you've done earlier caused this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are some remaining problems: You can't apply &lt;code&gt;regexp-opt&lt;/code&gt; to regexp:s, it only work on plain strings, so the setup of MOD5-acmdb doesn't work. Unfortunately, it's not 100% clear what you are trying to match, but try write a plain regexp without using &lt;code&gt;regexp-opt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't highlight &lt;code&gt;=&lt;/code&gt; if you pass &lt;code&gt;words&lt;/code&gt; to &lt;code&gt;regexp-opt&lt;/code&gt;, so I suggest that you match it separately from &lt;code&gt;AND&lt;/code&gt;, &lt;code&gt;OR&lt;/code&gt; and &lt;code&gt;XOR&lt;/code&gt;. (The reason is that the resulting regexp contains &lt;code&gt;\&amp;lt;&lt;/code&gt; and &lt;code&gt;\&amp;gt;&lt;/code&gt; to match the start and end of a word, but &lt;code&gt;=&lt;/code&gt; isn't a word character.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minor details:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your regexp will match words inside symbols, as the &lt;code&gt;AND&lt;/code&gt; in &lt;code&gt;THIS_AND_THAT&lt;/code&gt;. This is easily fixed by passing &lt;code&gt;symbols&lt;/code&gt; instead of &lt;code&gt;words&lt;/code&gt; to &lt;code&gt;regexp-opt&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You can use &lt;code&gt;let&lt;/code&gt; to create temporary variables rather that setting them using &lt;code&gt;setq&lt;/code&gt; and later setting them to nil.&lt;/li&gt;&#xA;&lt;li&gt;In elisp strings, you will need two backslashes to yeild one. In other words, you need &lt;code&gt;&quot;\\[&quot;&lt;/code&gt; to create the regexp snippet &lt;code&gt;\[&lt;/code&gt;. (&lt;code&gt;&quot;\[&quot;&lt;/code&gt; is the same as &lt;code&gt;&quot;[&quot;&lt;/code&gt;.)&lt;/li&gt;&#xA;&lt;li&gt;If you would like to interactively debug your font-lock rules, you can use &lt;a href=&quot;https://github.com/Lindydancer/font-lock-studio&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Lindydancer/font-lock-studio&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-09-08T09:40:38.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26932" PostTypeId="1" AcceptedAnswerId="26933" CreationDate="2016-09-08T11:14:01.817" Score="1" ViewCount="1040" Body="&lt;p&gt;I want to be zoomed in twice at startup. This is the result of the command &lt;code&gt;SPC z f + +&lt;/code&gt;. How can I configure this in my &lt;code&gt;.spacemacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11605" LastActivityDate="2016-09-08T12:24:46.733" Title="How to be zoomed in twice at startup" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ClosedDate="2016-09-08T15:02:07.233" ContentLicense="CC BY-SA 3.0" />
  <row Id="26933" PostTypeId="2" ParentId="26932" CreationDate="2016-09-08T12:24:46.733" Score="4" Body="&lt;p&gt;The command those shortcuts reference is the &lt;code&gt;text-scale-adjust&lt;/code&gt; command. This command is designed to increase or decrease text size in a &lt;em&gt;single&lt;/em&gt; buffer, relative to the default font size. For example, evaluating:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(text-scale-adjust 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would scale the text in the &lt;em&gt;current&lt;/em&gt; buffer up by two steps. If you tried putting that in your &lt;code&gt;.init&lt;/code&gt; or &lt;code&gt;.spacemacs&lt;/code&gt; file, it wouldn't work - as soon as a new buffer is created, it resets to the default font size. You &lt;em&gt;could&lt;/em&gt; define a hook that calls &lt;code&gt;text-scale-adjust&lt;/code&gt; whenever a new buffer is created, but that isn't the intended solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to change the font size globally, you should manually set the default font size. To do this, you adjust the &lt;code&gt;height&lt;/code&gt; property of the font named &lt;code&gt;default&lt;/code&gt;. Add this line to your &lt;code&gt;.spacemacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil :height 110)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Play around with the value until you find a size you like. Note that this will not refill your windows - the frame expands relative to the text size increase. You may need to re-size the frame afterwards. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can look at the current height of the default font by calling &lt;code&gt;M-x describe-face RET default RET&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further information about font sizes (including this discussion) can be found on the &lt;a href=&quot;https://www.emacswiki.org/emacs/SetFonts&quot; rel=&quot;nofollow&quot;&gt;Wiki.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-08T12:24:46.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26935" PostTypeId="1" CreationDate="2016-09-08T15:02:30.187" Score="2" ViewCount="51" Body="&lt;p&gt;I've got emacs' HideShow mode working well with Perl code (let's face it, it's a doddle), but I don't know if it's even possible to get it to fold POD comments as well. Has anyone done this (and if so, how, please)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: when asked about this on stackoverflow I was encouraged to ask over here.  Sorry for the dup' thus caused.)&lt;/p&gt;&#xA;" OwnerUserId="13238" LastActivityDate="2016-09-08T15:02:30.187" Title="Using hideshow with Perl code / POD" Tags="|code-folding|hideshow|perl|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26936" PostTypeId="2" ParentId="24286" CreationDate="2016-09-08T15:29:29.620" Score="1" Body="&lt;p&gt;You have to set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default spacemacs-show-trailing-whitespace nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/4419&quot; rel=&quot;nofollow&quot;&gt;this discussion on turning off &lt;code&gt;whitespace-mode&lt;/code&gt; on the Spacemacs github site&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user13239" LastEditorUserId="253" LastEditDate="2016-09-08T16:23:42.533" LastActivityDate="2016-09-08T16:23:42.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26937" PostTypeId="1" AcceptedAnswerId="26951" CreationDate="2016-09-08T16:40:39.270" Score="5" ViewCount="1071" Body="&lt;p&gt;I'm looking to create a command which stores a kind of &quot;history&quot; for the current major-mode. I need the variable to be independent for each major mode, but consistent across all buffers in any particular major mode. For example, all buffers in &lt;code&gt;python-mode&lt;/code&gt; should use the same version of the variable and all buffers in &lt;code&gt;emacs-lisp-mode&lt;/code&gt; should use a single, &lt;em&gt;different&lt;/em&gt; version of the variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has the ability to have buffer-local variables. Is there a way to make a variable that is mode-local?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-09T12:38:25.643" Title="How can I create mode-local variables?" Tags="|major-mode|variables|local-variables|history-variables|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26938" PostTypeId="2" ParentId="26912" CreationDate="2016-09-08T16:48:30.787" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/smartparens/issues/645#issuecomment-245535672&quot; rel=&quot;noreferrer&quot;&gt;According&lt;/a&gt; to the author of smartparens, &lt;code&gt;sp-autoinsert-if-followed-by-word&lt;/code&gt; has been deprecated. &#xA;Instead, one should use the &lt;code&gt;:when&lt;/code&gt; and &lt;code&gt;:unless&lt;/code&gt; filters to accomplish what I wanted. (See the &lt;a href=&quot;https://github.com/Fuco1/smartparens/wiki/Permissions&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the way I managed smartparens to work as I wanted was this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;(&quot; nil :unless '(sp-point-before-word-p))&#xA;(sp-pair &quot;[&quot; nil :unless '(sp-point-before-word-p))&#xA;(sp-pair &quot;{&quot; nil :unless '(sp-point-before-word-p))&#xA;(sp-local-pair 'latex-mode &quot;$&quot; nil :unless '(sp-point-before-word-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="516" LastActivityDate="2016-09-08T16:48:30.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26942" PostTypeId="2" ParentId="26928" CreationDate="2016-09-08T17:38:30.680" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize &lt;code&gt;dired-dwim-target&lt;/code&gt; to non-&lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Advise &lt;code&gt;dired-dwim-target&lt;/code&gt; to make it use your favorite directory, instead of what it wants to use.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Be aware that this will affect also similar commands that act on the marked files with respect to some directory.  IOW, it will affect not only &lt;code&gt;C&lt;/code&gt; (copying) but things like renaming and linking.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-09-08T17:38:30.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26943" PostTypeId="1" CreationDate="2016-09-08T18:25:45.077" Score="3" ViewCount="97" Body="&lt;p&gt;I have &lt;code&gt;turn-on-auto-fill&lt;/code&gt; as part of my &lt;code&gt;text-mode-hook&lt;/code&gt;. This works great for new documents, but when I open a buffer that is not filled with hard breaks I rarely want to start doing so to a single paragraph just because I make one edit to the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to scan the whole buffer after opening to see whether it already is auto-filled? And turn on &lt;code&gt;auto-fill-mode&lt;/code&gt; in that case but leave it off otherwise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched EmacsWiki and MELPA Stable and didn't see anything relevant.&lt;/p&gt;&#xA;" OwnerUserId="2701" LastActivityDate="2016-09-08T18:25:45.077" Title="Enabling auto-fill-mode only when document already filled" Tags="|auto-fill-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26944" PostTypeId="2" ParentId="26374" CreationDate="2016-09-08T19:46:07.673" Score="1" Body="&lt;p&gt;Would a bit of indirection be OK? You can use &lt;code&gt;noweb&lt;/code&gt; to have an applescript&#xA;block inserted into a shell block for execution&amp;#x2026;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: hello-apples&#xA;#+BEGIN_SRC apples&#xA;display dialog &quot;Hello, World&quot;&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC sh :noweb yes :exports both&#xA;osascript -e '&amp;lt;&amp;lt;hello-apples&amp;gt;&amp;gt;'&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: button returned:OK&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;apples-mode&lt;/code&gt; because it appears to have better font-locking than &lt;code&gt;applescript-mode&lt;/code&gt; but you can use either.&lt;/p&gt;&#xA;" OwnerUserId="10625" LastActivityDate="2016-09-08T19:46:07.673" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26945" PostTypeId="1" CreationDate="2016-09-08T20:21:58.117" Score="2" ViewCount="5657" Body="&lt;p&gt;I am looking for a good alternative ide for c++ and for that started to lern first vanilla emacs and now spacemacs. I have configured my .spacemacs now to be able to edit lisp code quite comfortably using company-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important feature for me is that the function documentation of the candidates is shown in a help popup automatically as I was used to from &quot;Netbeans&quot; in java.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I have started to work on a c++ project using the c-c++ layer and company-clang. I have managed to get it running so that I get code completion of my c++ functions as well as my snippets, though the header completion seems to only finding the old c headers like &quot;string.h&quot; and not &quot;string&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I don't receive any help popup during completion. Did I do anything wrong or is this simply not supported by the layer? And more importantly is there an alternative layer/plugin available to get that working?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anybody has a hint for the string header file issue I would also be happy to hear about it.&lt;/p&gt;&#xA;" OwnerUserId="13241" LastEditorUserId="9995" LastEditDate="2016-09-08T20:44:40.123" LastActivityDate="2017-05-14T01:48:14.737" Title="spacemacs how to show the documentation of a function during autocomplete in c-c++ layer" Tags="|spacemacs|company-mode|c++|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26946" PostTypeId="2" ParentId="26937" CreationDate="2016-09-08T21:22:22.213" Score="4" Body="&lt;p&gt;I think what you might do is to use properties of the variable symbol to store the history. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, each symbol can have a property list, which is a list of pairs. The key will be major mode names, and value the history as list you wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But i don't know if that's efficient enough to work out.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-09-08T21:22:22.213" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26947" PostTypeId="1" CreationDate="2016-09-08T22:10:43.927" Score="2" ViewCount="71" Body="&lt;p&gt;&lt;code&gt;&quot;foo&quot;&lt;/code&gt; becomes &lt;code&gt;&amp;amp;ldquo;foo&amp;amp;rdquo;&lt;/code&gt; when I run &lt;code&gt;org-md-export-as-markdown&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want it to export to &lt;code&gt;&quot;foo&quot;&lt;/code&gt;. How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2016-09-08T22:10:43.927" Title="How can I avoid escaping quotes when I export an org file to markdown?" Tags="|org-mode|org-export|markdown|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26948" PostTypeId="1" CreationDate="2016-09-08T22:24:41.463" Score="0" ViewCount="52" Body="&lt;p&gt;I just installed Emacs on a new laptop, moved over my init files, and all of a sudden Dired+ stopped working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq debug-on-error t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  call-process(nil nil nil nil &quot;--dired&quot;)&#xA;  dired-insert-directory(&quot;/Users/loaner/&quot; &quot;-alh&quot; nil nil t)&#xA;  dired-readin-insert()&#xA;  dired-readin()&#xA;  dired-internal-noselect(&quot;~/&quot; nil)&#xA;  dired-noselect(&quot;/Users/loaner/&quot; nil)&#xA;  #[513 &quot;\300\301\&quot;!\207&quot; [switch-to-buffer dired-noselect] 6 (&quot;/usr/local/Cellar/emacs/HEAD-e951aa1/share/emacs/25.1.50/lisp/dired.elc&quot; . 22310) (dired-read-dir-and-switches &quot;&quot;)](&quot;/Users/loaner/&quot; nil)&#xA;  ad-Advice-dired(#[513 &quot;\300\301\&quot;!\207&quot; [switch-to-buffer dired-noselect] 6 (&quot;/usr/local/Cellar/emacs/HEAD-e951aa1/share/emacs/25.1.50/lisp/dired.elc&quot; . 22310) (dired-read-dir-and-switches &quot;&quot;)] &quot;/Users/loaner/&quot;)&#xA;  apply(ad-Advice-dired #[513 &quot;\300\301\&quot;!\207&quot; [switch-to-buffer dired-noselect] 6 (&quot;/usr/local/Cellar/emacs/HEAD-e951aa1/share/emacs/25.1.50/lisp/dired.elc&quot; . 22310) (dired-read-dir-and-switches &quot;&quot;)] &quot;/Users/loaner/&quot;)&#xA;  dired(&quot;/Users/loaner/&quot;)&#xA;  dired-jump(nil nil)&#xA;  funcall-interactively(dired-jump nil nil)&#xA;  call-interactively(dired-jump nil nil)&#xA;  command-execute(dired-jump)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's my emacs version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G31))&#xA; of 2016-09-08&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What could be going on?&lt;/p&gt;&#xA;" OwnerUserId="6" LastActivityDate="2016-09-08T22:24:41.463" Title="Dired stopped working (trace with debug-on-error)" Tags="|dired|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26949" PostTypeId="1" CreationDate="2016-09-08T23:04:36.627" Score="16" ViewCount="3973" Body="&lt;p&gt;I have a default setup of &lt;code&gt;js2-mode&lt;/code&gt;.  This provides nice syntax highlighting and checking but I am now working on a project with a different set of styles (specifically this new project does not use semicolons).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This causes every single line of code to be underlined in &lt;code&gt;js2-mode&lt;/code&gt; with the warning: &lt;code&gt;missing ; after statement&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way that I can disable the syntax checking in &lt;code&gt;js2-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, even better, is there a way to use a diferent syntax checker?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have Flycheck mode installed and running for my &lt;code&gt;.js&lt;/code&gt; files but I just do not have any syntax checkers enabled (i.e. all checkers are set to &lt;code&gt;nil&lt;/code&gt; and &lt;code&gt;not found&lt;/code&gt;).  It would be great to know how to enable one of these and disable the built in &lt;code&gt;js2&lt;/code&gt; one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the views on semicolon insertion vary but this project follows the &lt;code&gt;&quot;standard style&quot;&lt;/code&gt; for which there is a syntax checker in Flycheck and I am just interested in if I can switch the checker.&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorDisplayName="user227" LastEditDate="2016-09-09T16:34:10.153" LastActivityDate="2016-09-18T05:27:03.413" Title="Can I turn off or switch the syntax checker for js2-mode?" Tags="|syntax-highlighting|flycheck|js2-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26950" PostTypeId="2" ParentId="26949" CreationDate="2016-09-08T23:21:04.433" Score="2" Body="&lt;p&gt;You could customize the &lt;code&gt;js2-strict-missing-semi-warning&lt;/code&gt; variable to &lt;code&gt;nil&lt;/code&gt; so that it it doesn't warn you for this particular problem, or you could use &lt;code&gt;js-mode&lt;/code&gt; instead of &lt;code&gt;js2-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of the two options, I recommend changing your style guide; automatic semicolon insertion in JS is a trap. Still, I recognize that that might not always be possible.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-08T23:21:04.433" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26951" PostTypeId="2" ParentId="26937" CreationDate="2016-09-09T00:45:47.973" Score="2" Body="&lt;p&gt;A variable is either buffer-local or not. If it's buffer-local then the value isn't shared with other buffers. There's no built-in feature to directly have a variable that's shared between buffers. So you'll need to do something where accessing the value of the variable isn't just &lt;code&gt;my-variable&lt;/code&gt; and setting isn't just &lt;code&gt;(setq my-variable some-value)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possibility that makes lookup time quasi-constant is to define a variable with a different name for each mode, and compute the name. For example, I call the value of &lt;code&gt;foo&lt;/code&gt; in Python mode &lt;code&gt;mode-local:foo:python-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-variable-mode-local (var &amp;amp;optional default)&#xA;  &quot;Make VAR eligible for mode-local use.&#xA;When VAR hasn't been set in a mode, it will have the value DEFAULT.&quot;&#xA;  (set var default))&#xA;(defun mode-local-variable (var &amp;amp;optional mode)&#xA;  &quot;Return the mode-local variable symbol for VAR in the current major mode.&#xA;If MODE is specified, return the symbol for that major mode.&quot;&#xA;  (intern (concat &quot;mode-local:&quot; var &quot;:&quot; (symbol-name (or mode major-mode)))))&#xA;(defun mode-local-variable-value (var &amp;amp;optional mode)&#xA;  &quot;Return the mode-local value of VAR in the current major mode.&#xA;If MODE is specified, return the value for that major mode.&quot;&#xA;  (let ((mlv (mode-local-variable var mode)))&#xA;    (symbol-value (if (boundp mlv) mlv var))))&#xA;(defun mode-local-variable-set (var new-value &amp;amp;optional mode)&#xA;  &quot;Set the mode-local value of VAR to NEW-VALUE the current major mode.&#xA;If MODE is specified, return the value for that major mode.&quot;&#xA;  (let ((mlv (mode-local-variable var (or mode major-mode))))&#xA;    (set mlv new-value)))&#xA;(defun mode-local-variable-default-value (var)&#xA;  &quot;Get the default value of the mode-local variable VAR.&quot;&#xA;  (symbol-value var))&#xA;(defun mode-local-variable-set-default (var new-value)&#xA;  &quot;Set the default value of the mode-local variable VAR to VALUE.&quot;&#xA;  (set var new-value))&#xA;&#xA;(mode-local-variable-set 'answer 42)&#xA;(message (mode-local-variable-get 'answer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Warning: untested code.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility is to keep the data in a single global variable's value, arranged as an association list from mode symbols to values. This can be slow if a variable is set in a lot of major modes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-variable-mode-local (var &amp;amp;optional default)&#xA;  &quot;Make VAR eligible for mode-local use.&#xA;When VAR hasn't been set in a mode, it will have the value DEFAULT.&quot;&#xA;  (set var (cons default nil)))&#xA;(defun mode-local-variable-value (var &amp;amp;optional mode)&#xA;  &quot;Return the mode-local value of VAR in the current major mode.&#xA;If MODE is specified, return the value for that major mode.&quot;&#xA;  (or mode (setq mode major-mode))&#xA;  (let ((cell (assq mode (cdr var))))&#xA;    (if cell&#xA;        (cdr cell)&#xA;      (car var))))&#xA;(defun mode-local-variable-set (var new-value &amp;amp;optional mode)&#xA;  &quot;Set the mode-local value of VAR to NEW-VALUE the current major mode.&#xA;If MODE is specified, return the value for that major mode.&quot;&#xA;  (or mode (setq mode major-mode))&#xA;  (let ((cell (assq mode (cdr var))))&#xA;    (if cell&#xA;        (setcdr cell new-value)&#xA;      (setcdr var (cons (cons mode new-value) (cdr var))))))&#xA;(defun mode-local-variable-default-value (var)&#xA;  &quot;Get the default value of the mode-local variable VAR.&quot;&#xA;  (car var))&#xA;(defun mode-local-variable-set-default (var new-value)&#xA;  &quot;Set the default value of the mode-local variable VAR to VALUE.&quot;&#xA;  (setcar var new-value))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-09-09T00:45:47.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26952" PostTypeId="2" ParentId="26914" CreationDate="2016-09-09T01:08:38.277" Score="1" Body="&lt;p&gt;The problem is that the &lt;code&gt;$$(yas-choose-value...&lt;/code&gt; is not expanded before the indentation kicks in, so when yasnippet indents the snippet, the buffer text looks like: &lt;code&gt;␣[label=&quot;&quot;];&lt;/code&gt; and the space is removed by indenting.  You can disable indentation for a snippet by adding &lt;code&gt;# expand-env: ((yas-indent-line nil))&lt;/code&gt; to the snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure yet whether to classify this as a yasnippet bug or not.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-09-09T01:08:38.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26953" PostTypeId="1" AcceptedAnswerId="26979" CreationDate="2016-09-09T03:02:57.980" Score="1" ViewCount="45" Body="&lt;p&gt;When I open files that default to &lt;code&gt;csharp-mode&lt;/code&gt;, they always start modified. This is only occurring for &lt;code&gt;csharp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;save-buffers-kill-emacs&lt;/code&gt; with the &lt;code&gt;d&lt;/code&gt; option (view changes in this buffer) shows &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Diff finished (no differences).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I stop &lt;code&gt;.cs&lt;/code&gt; files from being modified when I open them? Why are they being modified?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;files are not modified if reloaded using &lt;code&gt;revert-buffer&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;files are modified after running &lt;code&gt;emacs -Q&lt;/code&gt;, &lt;code&gt;package-initialize&lt;/code&gt;, and then opening the file (which defaults to &lt;code&gt;csharp-mode&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;files are modified after running &lt;code&gt;emacs -Q&lt;/code&gt;, &lt;code&gt;package-initialize&lt;/code&gt;, opening a C# file with a fake extension (file is not modified at this point), &lt;code&gt;csharp-mode&lt;/code&gt; (file is now modified)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Filed a &lt;a href=&quot;https://github.com/josteink/csharp-mode/issues/90&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt; with &lt;code&gt;csharp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11551" LastEditorUserId="11551" LastEditDate="2016-09-09T14:12:43.353" LastActivityDate="2016-09-09T20:57:05.880" Title="CSharp files modified on open" Tags="|find-file|buffer-modified|csharp-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26954" PostTypeId="1" AcceptedAnswerId="26955" CreationDate="2016-09-09T03:26:39.943" Score="3" ViewCount="2859" Body="&lt;p&gt;I use a function, &lt;code&gt;ensure-packages-installed&lt;/code&gt; to &quot;bootstrap&quot; packages in my &lt;code&gt;.emacs&lt;/code&gt; file. This ensures that if the package isn't already install. The follow is at the top of my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;&#xA;; Set up Emacs package system.&#xA;;&#xA;(require 'package)&#xA;;(add-to-list 'package-archives&#xA;;             '(&quot;elpa&quot; . &quot;http://elpa.gnu.org/packages&quot;))&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;;(add-to-list 'package-archives&#xA;;             '(&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;&#xA;; fetch the list of packages available&#xA;(or (file-exists-p package-user-dir)&#xA;  (package-refresh-contents))&#xA;&#xA;(defun ensure-packages-installed (&amp;amp;rest packages)&#xA;  (mapcar (lambda (package)&#xA;    (unless (package-installed-p package)&#xA;      (package-install package))) packages))&#xA;&#xA;(ensure-packages-installed&#xA;  'company-mode&#xA;  'exec-path-from-shell&#xA;  'evil&#xA;  'haskell-mode&#xA;  'intero&#xA;  'idris-mode&#xA;  'org&#xA;  'projectile&#xA;  'solarized-theme&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I add &lt;code&gt;company-mode&lt;/code&gt; to the list it, I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/Users/steshaw/.emacs':&#xA;&#xA;error: Package `company-mode-' is unavailable&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12046" LastActivityDate="2016-09-09T14:49:04.180" Title="How do I install company-mode via `ensure-packages-installed`?" Tags="|company-mode|package-repositories|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26955" PostTypeId="2" ParentId="26954" CreationDate="2016-09-09T04:12:59.437" Score="5" Body="&lt;p&gt;You need to use &lt;code&gt;company&lt;/code&gt; instead of &lt;code&gt;company-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="253" LastEditDate="2016-09-09T14:49:04.180" LastActivityDate="2016-09-09T14:49:04.180" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26956" PostTypeId="1" CreationDate="2016-09-09T06:34:56.333" Score="13" ViewCount="5689" Body="&lt;p&gt;I'm curious to see which version of a package I'm using to see if it is out of date. I don't see a &lt;code&gt;package-&lt;/code&gt; function that looks applicable.&lt;/p&gt;&#xA;" OwnerUserId="12046" LastActivityDate="2016-10-09T13:57:43.287" Title="How can I see which version of a package I'm using?" Tags="|package|" AnswerCount="2" CommentCount="1" ClosedDate="2018-12-07T17:54:42.363" ContentLicense="CC BY-SA 3.0" />
  <row Id="26957" PostTypeId="1" CreationDate="2016-09-09T07:32:09.750" Score="0" ViewCount="1358" Body="&lt;p&gt;I load the &lt;code&gt;solarized-dark&lt;/code&gt; theme in the last line of my &lt;code&gt;.emacs&lt;/code&gt; files thusly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'solarized-dark t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this causes Aquamacs to look like:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/SQ9Dr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SQ9Dr.png&quot; alt=&quot;bad theme&quot;&gt;&lt;/a&gt;&#xA;If I then load the theme again by entering M-x &lt;code&gt;load-theme&lt;/code&gt; RET &lt;code&gt;solarized-dark&lt;/code&gt;, the theme looks correct:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/BlKhS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BlKhS.png&quot; alt=&quot;correct theme&quot;&gt;&lt;/a&gt;&#xA;How can I get the theme to load correct from my &lt;code&gt;.emacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12046" LastActivityDate="2024-03-30T17:07:16.367" Title="How can I load the solarized-dark theme correctly in Aquamacs from .emacs?" Tags="|themes|aquamacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26958" PostTypeId="1" AcceptedAnswerId="26962" CreationDate="2016-09-09T09:05:10.453" Score="3" ViewCount="600" Body="&lt;p&gt;I often work on several different codebases that use different indent styles (2 spaces vs 4 spacces vs tabs...). It is annoying to set &lt;code&gt;c-basic-offset&lt;/code&gt; (or other variables, depending on mode) each time I open new file. Is there a package (or setting) that makes Emacs detect indentation style of opened file? &lt;/p&gt;&#xA;" OwnerUserId="13244" LastActivityDate="2016-09-09T12:43:33.403" Title="How to automatically set indent width (e.g. c-basic-offset) based on edited file?" Tags="|indentation|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26959" PostTypeId="2" ParentId="26956" CreationDate="2016-09-09T09:19:52.380" Score="4" Body="&lt;p&gt;You could use &lt;code&gt;M-x list-packages&lt;/code&gt; to view list of available and installed packages with versions.  And you could mark packages for update with &lt;code&gt;U&lt;/code&gt;, then use &lt;code&gt;x&lt;/code&gt; to eXecute the updating.  And &lt;code&gt;M-x package-list-packages&lt;/code&gt; is an alias for &lt;code&gt;list-packages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Menu.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Menu.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="12616" LastEditDate="2016-09-09T09:25:19.510" LastActivityDate="2016-09-09T09:25:19.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26960" PostTypeId="2" ParentId="26958" CreationDate="2016-09-09T09:51:57.853" Score="2" Body="&lt;p&gt;One way to do that for a specific file is to use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html#File-Variables&quot; rel=&quot;nofollow&quot;&gt;file local variables&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A file can specify local variable values to use when editing the file&#xA;  with Emacs.  Visiting the file checks for local variable specifications;&#xA;  it automatically makes these variables local to the buffer, and sets&#xA;  them to the values specified in the file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The doc describes how you can specify them in a comment on the first line of the file, or as a “local variables list” near the end of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a whole code base, using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables&quot; rel=&quot;nofollow&quot;&gt;Per-Directory Local Variables&lt;/a&gt; is certainly more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sometimes, you may wish to define the same set of local variables to all&#xA;  the files in a certain directory and its subdirectories, such as the&#xA;  directory tree of a large software project.  This can be accomplished&#xA;  with “directory-local variables”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again, the linked doc (or info doc from within emacs) describes how to define them.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-09-09T09:51:57.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26961" PostTypeId="1" CreationDate="2016-09-09T11:42:06.803" Score="2" ViewCount="1193" Body="&lt;p&gt;I would like to display a youtube (or locally hosted) video inside an org-mode buffer, similar to how &lt;code&gt;org-toggle-inline-images&lt;/code&gt; will preview an image file.  How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="253" LastEditDate="2016-09-09T15:04:05.837" LastActivityDate="2016-09-09T15:04:05.837" Title="Embed a youtube video in org-mode buffer" Tags="|org-mode|previewing|video|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26962" PostTypeId="2" ParentId="26958" CreationDate="2016-09-09T12:17:08.320" Score="2" Body="&lt;p&gt;Check out dtrt-indent on melpa.&lt;/p&gt;&#xA;" OwnerUserId="2173" LastActivityDate="2016-09-09T12:17:08.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26963" PostTypeId="2" ParentId="26937" CreationDate="2016-09-09T12:38:25.643" Score="1" Body="&lt;p&gt;You can keep that data in a hash-table (or alist) indexed with the value of &lt;code&gt;major-mode&lt;/code&gt;.  Of course, it gets more interesting if you also want to take into account the hierarchy of major modes.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-09-09T12:38:25.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26964" PostTypeId="2" ParentId="26958" CreationDate="2016-09-09T12:43:33.403" Score="4" Body="&lt;p&gt;CC-mode comes with the &lt;code&gt;cc-guess.el&lt;/code&gt; file which provides functions to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. &lt;code&gt;M-x c-guess&lt;/code&gt; should do the trick.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-09-09T12:43:33.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26965" PostTypeId="2" ParentId="26956" CreationDate="2016-09-09T13:56:42.650" Score="6" Body="&lt;p&gt;As you noticed Emacs itself doesn't provide any convenient command for this purpose.  I had the same problem and wrote a little package called &lt;a href=&quot;https://github.com/lunaryorn/pkg-info.el&quot; rel=&quot;noreferrer&quot;&gt;pkg-info&lt;/a&gt; to address this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Install it from MELPA with &lt;code&gt;M-x package-install RET pkg-info&lt;/code&gt; and then type &lt;code&gt;M-x pkg-info-package-version RET magit&lt;/code&gt; to see the version of the &lt;code&gt;magit&lt;/code&gt; package.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-09-09T13:56:42.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26967" PostTypeId="1" AcceptedAnswerId="26970" CreationDate="2016-09-09T14:40:00.343" Score="2" ViewCount="1251" Body="&lt;p&gt;I would like to open in emacs, with a shortcut/bookmark three files in this configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_____________&#xA;|       | B |&#xA;|   A   |___|&#xA;|       | C |&#xA;|_______|___|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A is my main editing file, B is for the outline of what I write in A and C is for notes. Note that I manually set this layout because the second column is much smaller than what C-x 3 produces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using lawlist-bookmark -- &lt;a href=&quot;https://stackoverflow.com/a/19284395/2112489&quot;&gt;https://stackoverflow.com/a/19284395/2112489&lt;/a&gt; -- which allows me to use F5 and then a letter shortcut to open quickly a file configured. But with this solution, the opened file take all the space and I have to set manually the layout of emacs to achieve the picture above. I am looking for a solution which will open the three files in the specific geometry layout with one keystroke (after typing F5 to enter inside bookmarks &quot;menu&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current bookmarks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'lawlist-bookmark)&#xA;(defun lawlist-bookmark (choice)&#xA;  &quot;Choices for directories and files.&quot;&#xA;  (interactive &quot;cf[o]lder | [F]ile | ... )&#xA;  (cond&#xA;   ((eq choice ?o)&#xA;    (dired &quot;~/folder&quot;))&#xA;   ((eq choice ?f)&#xA;    (find-file &quot;/~file.tex&quot;)&#xA;    (message &quot;Opened:  %s&quot; (buffer-name)))&#xA; ....&#xA;   (t (message &quot;Quit&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5511" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2018-04-24T17:03:41.777" Title="Open several files in a specifc layout with a shortcut" Tags="|window-splitting|bookmarks|keyboard-layout|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26968" PostTypeId="2" ParentId="26954" CreationDate="2016-09-09T14:40:52.440" Score="2" Body="&lt;p&gt;You should consider using &lt;code&gt;use-package&lt;/code&gt;. It would look like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(use-package company :ensure t :pin melpa)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-09-09T14:40:52.440" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26969" PostTypeId="1" CreationDate="2016-09-09T15:47:28.320" Score="1" ViewCount="214" Body="&lt;p&gt;I'm trying to create a &lt;code&gt;.emacs&lt;/code&gt; file that works on multiple platforms. Therefore, I declare a variable with a path for each platform&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar macosx-p (string-match &quot;darwin&quot; (symbol-name system-type)))&#xA;(defvar gnulinux-p (string-match &quot;linux&quot; (symbol-name system-type)))&#xA;(defvar mswindows-p (string-match &quot;windows&quot; (symbol-name system-type)))&#xA;&#xA;(defconst macosx-ps &quot;/Users/xxx/&quot;)&#xA;(defconst gnulinux-ps &quot;/home/xxx&quot;)&#xA;(defconst mswindows-ps &quot;D:/xxx&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I pass one of the &lt;code&gt;-ps&lt;/code&gt; variables to a function like this?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if macosx-p&#xA;   (progn&#xA;    (setq org-capture-templates&#xA;     '((&quot;t&quot; &quot;TODO&quot; entry (file+headline (concat macosx-ps &quot;file.org&quot;) &quot;Inbox&quot;)&#xA;          &quot;* TODO %?&quot;)))))&#xA;&#xA;(if gnulinux-p&#xA;  (progn&#xA;   (setq org-agenda-files (quote&#xA;   ((concat gnulinux-ps &quot;file.org&quot;)&#xA;    (concat gnulinux-ps &quot;others/&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want &lt;code&gt;macosx-ps&lt;/code&gt; to output my path string.&lt;/p&gt;&#xA;" OwnerUserId="13248" LastEditorUserId="13248" LastEditDate="2016-09-09T18:39:35.383" LastActivityDate="2016-12-13T00:06:38.390" Title="Passing parameter to a function in init-file" Tags="|init-file|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26970" PostTypeId="2" ParentId="26967" CreationDate="2016-09-09T15:49:03.120" Score="4" Body="&lt;p&gt;It will be necessary to decide ahead of time what windows/buffers will be A, B and C.  The alist argument for the left &lt;code&gt;window-width&lt;/code&gt; can be adjusted to taste -- it is presently hard-coded to 70.  This example uses an internal function &lt;code&gt;window--display-buffer&lt;/code&gt;, which requires some general understanding of certain functions inside &lt;code&gt;window.el&lt;/code&gt;.  The &lt;code&gt;selected-window&lt;/code&gt; is letter &lt;code&gt;B&lt;/code&gt;, but this can be changed (with a little coding) if so desired.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun example-fn ()&#xA;  &quot;To try this example, type:  M-x example-fn&quot;&#xA;  (interactive)&#xA;  (let ((a (dired-noselect &quot;~&quot;))&#xA;        (b (find-file-noselect &quot;~/foo.txt&quot;))&#xA;        (c (get-buffer-create &quot;*scratch*&quot;)))&#xA;    (delete-other-windows)&#xA;    (switch-to-buffer b)&#xA;    ;; See the doc-strings for `split-window' and `window--display-buffer'.&#xA;    (window--display-buffer&#xA;     a (split-window (selected-window) nil 'left)&#xA;     'window '((window-width . 70)) display-buffer-mark-dedicated)&#xA;    (window--display-buffer&#xA;     c (split-window (selected-window) nil 'below)&#xA;     'window nil display-buffer-mark-dedicated)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And, if a keyboard shortcut is desired, it can be set with:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'example-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To incorporate this new example into &lt;code&gt;lawlist-bookmark&lt;/code&gt;, the entire &lt;code&gt;let&lt;/code&gt; section of &lt;code&gt;example-fn&lt;/code&gt; can be added or just use the name of the function itself.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun lawlist-bookmark (choice)&#xA;  &quot;Choices for directories and files.  http://stackoverflow.com/a/19284395/2112489&quot;&#xA;  (interactive &quot;c[3]-way | [D]ired | [v]ocab.org | [g]td.org | [d]iary.org | [n]otes.org&quot;)&#xA;  (cond&#xA;    ((eq choice ?3)&#xA;     (example-fn))&#xA;    ((eq choice ?D)&#xA;     (dired &quot;/very/long/and/boring/path/which/make/me/use/tab/for/...&quot;))&#xA;    ((eq choice ?v)&#xA;     (find-file &quot;/Users/HOME/.0.data/vocab.org&quot;)&#xA;     (message &quot;Opened:  %s&quot; (buffer-name)))&#xA;    ((eq choice ?g)&#xA;     (find-file &quot;/Users/HOME/.0.data/gtd.org&quot;)&#xA;     (message &quot;Opened:  %s&quot; (buffer-name)))&#xA;    ((eq choice ?d)&#xA;     (find-file &quot;/Users/HOME/.0.data/diary.org&quot;)&#xA;     (message &quot;Opened:  %s&quot; (buffer-name)))&#xA;    ((eq choice ?n)&#xA;     (find-file &quot;/Users/HOME/.0.data/notes.org&quot;)&#xA;     (message &quot;Opened:  %s&quot; (buffer-name)))&#xA;    (t (message &quot;Quit&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Pursuant to the request of the original poster in a comment underneath the initial answer, the following is an example of how to select window letter &lt;code&gt;A&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun example-fn-two ()&#xA;  &quot;To try this example, type:  M-x example-fn&quot;&#xA;  (interactive)&#xA;  (let ((window-a nil)&#xA;        (window-b (selected-window))&#xA;        (window-c nil)&#xA;        (buffer-a (dired-noselect &quot;~&quot;))&#xA;        (buffer-b (find-file-noselect &quot;~/foo.txt&quot;))&#xA;        (buffer-c (get-buffer-create &quot;*scratch*&quot;)))&#xA;    (delete-other-windows)&#xA;    (set-window-buffer window-b buffer-b)&#xA;    (setq window-a&#xA;          (window--display-buffer&#xA;           buffer-a (split-window window-b nil 'left)&#xA;           'window '((window-width . 70)) display-buffer-mark-dedicated))&#xA;    (setq window-c&#xA;          (window--display-buffer&#xA;           buffer-c (split-window window-b nil 'below)&#xA;           'window nil display-buffer-mark-dedicated))&#xA;    (select-window window-a)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="795" LastEditDate="2018-04-24T17:03:41.777" LastActivityDate="2018-04-24T17:03:41.777" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26971" PostTypeId="1" AcceptedAnswerId="26976" CreationDate="2016-09-09T15:50:49.780" Score="1" ViewCount="139" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Which function does &lt;code&gt;org-mode&lt;/code&gt; use to log a note with a&#xA;&lt;code&gt;TODO&lt;/code&gt; state change?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Background&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; provides the option of adding a note when&#xA;&lt;a href=&quot;http://orgmode.org/manual/Tracking-TODO-state-changes.html&quot; rel=&quot;nofollow&quot;&gt;tracking &lt;code&gt;TODO&lt;/code&gt; state changes&lt;/a&gt;.&#xA;That's great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;org&lt;/code&gt; is also cavalier about changing my window&#xA;configuration when it adds notes (i.e., it temporarily changes the&#xA;frame to a two-window layout), which is infuriating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've resolved the issue in a different setting when dealing with&#xA;&lt;a href=&quot;http://orgmode.org/manual/Capture.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;capture&lt;/code&gt;&lt;/a&gt; templates by&#xA;tracking down the offending function&#xA;(&lt;code&gt;org-capture-place-template&lt;/code&gt;) and commenting out the offending&#xA;line that changes my window configuration.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Problem&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I cannot find the analogous function for dealing with todo state&#xA;changes.  The &lt;code&gt;org&lt;/code&gt; source code is sometimes rather baroque, and&#xA;I've gone through the source for &lt;code&gt;org-todo&lt;/code&gt; without finding the&#xA;relevant call.  I suspect it's the same problem with a hard-coded&#xA;change to the window configuration that I need to comment out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: &lt;em&gt;what function does &lt;code&gt;org&lt;/code&gt; use to log the NOTE with a &lt;code&gt;TODO&lt;/code&gt;&#xA;state change?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2023-12-03T19:12:30.663" Title="Prevent TODO state change from altering my window configuration?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26973" PostTypeId="2" ParentId="26949" CreationDate="2016-09-09T16:41:47.493" Score="20" Body="&lt;p&gt;The warning comes from JS2 Mode which implements its own parser for Javascript and warns about a couple of issues.  As noted in the other answer the particular warning you observed is controlled by the user option &lt;code&gt;js2-strict-missing-semi-warning&lt;/code&gt; which you can set to &lt;code&gt;nil&lt;/code&gt; in your init file or via &lt;code&gt;M-x customize&lt;/code&gt; so as to turn off the warning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using JS2 Mode together with Flycheck we generally recommend to turn off all warnings of JS2 Mode by setting the variables &lt;code&gt;js2-mode-show-parse-errors&lt;/code&gt; and &lt;code&gt;js2-mode-show-strict-warnings&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; as in almost all cases Flycheck's syntax checking provides superior error reporting.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To select the &lt;code&gt;javascript-standard&lt;/code&gt; syntax checker for the current buffer use &lt;code&gt;C-c ! s javascript-standard&lt;/code&gt;.  You can permanently enable this syntax checker for your specific project by creating a &lt;code&gt;.dir-locals.el&lt;/code&gt; file in the top level directory of the project with the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((js2-mode&#xA;  (flycheck-checker . javascript-standard)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs automatically loads these &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;Directory Variables&lt;/a&gt; when visiting a file below the directory, and thus automatically picks the standard syntax checker for your project.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastEditorUserId="7047" LastEditDate="2016-09-18T05:27:03.413" LastActivityDate="2016-09-18T05:27:03.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26976" PostTypeId="2" ParentId="26971" CreationDate="2016-09-09T19:05:38.387" Score="1" Body="&lt;p&gt;I've dug into Org a few times before, so how hard could this possibly be?  Well, the location is somewhat unusual.  If you follow along the sources of &lt;code&gt;org-todo&lt;/code&gt;, you can see some comments about state changes to the &lt;code&gt;TODO&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (and now-done-p org-log-done)&#xA;  ;; It is now done, and it was not done before&#xA;  (org-add-planning-info 'closed (org-current-effective-time))&#xA;  (if (and (not dolog) (eq 'note org-log-done))&#xA;      (org-add-log-setup 'done org-state this 'findpos 'note)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to its docstring, &lt;code&gt;org-add-log-setup&lt;/code&gt; adds a helper function to &lt;code&gt;post-command-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook 'org-add-log-note 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this one can assume that &lt;code&gt;org-add-log-note&lt;/code&gt; is the one we're looking for.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-09-09T19:05:38.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26977" PostTypeId="2" ParentId="26969" CreationDate="2016-09-09T19:20:57.570" Score="0" Body="&lt;p&gt;As xuchunyang pointed out, I need to add a backquote (´) and , to my list, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if gnulinux-p&#xA;  (progn&#xA;   `(setq org-agenda-files (quote&#xA;   (,(expand-file-name &quot;file.org&quot; gnulinux-ps)&#xA;    ,(expand-file-name &quot;others/&quot; gnulinux-ps))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now everything works.&lt;/p&gt;&#xA;" OwnerUserId="13248" LastActivityDate="2016-09-09T19:20:57.570" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26978" PostTypeId="1" CreationDate="2016-09-09T20:44:20.593" Score="4" ViewCount="1435" Body="&lt;p&gt;Basically I try to enable showing git branch I'm in in eshell buffer. The elisp I got works fine. But I will constantly run into &quot;Text is read only &quot; and have to kill the eshell buffer to start over. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; eshell promopt&#xA;(defun my-current-git-branch ()&#xA;  (let ((branch (car (loop for match in (split-string (shell-command-to-string &quot;git branch&quot;) &quot;\n&quot;)&#xA;                           when (string-match &quot;^\*&quot; match)&#xA;                           collect match))))&#xA;    (if (not (eq branch nil))&#xA;        (concat &quot;:&quot; (substring branch 2))&#xA;      &quot;&quot;)))&#xA;&#xA;(defun my-eshell-prompt ()&#xA;  (concat (propertize (abbreviate-file-name (eshell/pwd)) 'face 'eshell-prompt)&#xA;          (propertize (my-current-git-branch) 'face 'font-lock-function-name-face)&#xA;          (propertize &quot; λ &quot; 'face 'font-lock-constant-face)))&#xA;&#xA;;; em-prompt&#xA;(setq eshell-prompt-function 'my-eshell-prompt)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using Arch Linux and Emacs25. Does anyone have any idea to solve or a better approach?&lt;/p&gt;&#xA;" OwnerUserId="11207" LastEditorUserId="675" LastEditDate="2016-09-09T21:44:46.153" LastActivityDate="2016-09-11T19:40:42.127" Title="Eshell will enter &quot;Text is read only&quot; and freeze" Tags="|eshell|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26979" PostTypeId="2" ParentId="26953" CreationDate="2016-09-09T20:57:05.880" Score="1" Body="&lt;p&gt;Issue with &lt;code&gt;csharp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed in melpa version &lt;code&gt;20160909.801&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the bug report &lt;a href=&quot;https://github.com/josteink/csharp-mode/issues/90&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11551" LastActivityDate="2016-09-09T20:57:05.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26981" PostTypeId="2" ParentId="24088" CreationDate="2016-09-10T14:53:10.797" Score="7" Body="&lt;p&gt;I wrote a few functions to cycle through a group of themes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ivan/themes '(elixir elixir-dark))&#xA;(setq ivan/themes-index 0)&#xA;&#xA;(defun ivan/cycle-theme ()&#xA;  (interactive)&#xA;  (setq ivan/themes-index (% (1+ ivan/themes-index) (length ivan/themes)))&#xA;  (ivan/load-indexed-theme))&#xA;&#xA;(defun ivan/load-indexed-theme ()&#xA;  (ivan/try-load-theme (nth ivan/themes-index ivan/themes)))&#xA;&#xA;(defun ivan/try-load-theme (theme)&#xA;  (if (ignore-errors (load-theme theme :no-confirm))&#xA;      (mapcar #'disable-theme (remove theme custom-enabled-themes))&#xA;    (message &quot;Unable to find theme file for ‘%s’&quot; theme)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I call &lt;code&gt;ivan/load-indexed-theme&lt;/code&gt; in my init file to initialize my theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bind &lt;code&gt;ivan/cycle-theme&lt;/code&gt; to &lt;kbd&gt;Space&lt;/kbd&gt;&lt;kbd&gt;\&lt;/kbd&gt; in evil mode. (&lt;kbd&gt;Space&lt;/kbd&gt; is my leader key.)&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-09-10T14:53:10.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26983" PostTypeId="2" ParentId="26665" CreationDate="2016-09-10T17:11:21.100" Score="1" Body="&lt;p&gt;After trying to figure this problem out myself, I sent an &lt;a href=&quot;https://www.mail-archive.com/emacs-orgmode@gnu.org/msg106818.html&quot; rel=&quot;nofollow&quot;&gt;email&lt;/a&gt; to the &lt;a href=&quot;http://orgmode.org/worg/org-mailing-list.html&quot; rel=&quot;nofollow&quot;&gt;mailing list&lt;/a&gt;. The only &lt;a href=&quot;https://www.mail-archive.com/emacs-orgmode@gnu.org/msg106993.html&quot; rel=&quot;nofollow&quot;&gt;response&lt;/a&gt; was to &quot;update your org-mode version,&quot; which I didn't think could be right because I was compliling Emacs from the latest git sources, (GNU Emacs 25.1.50.1) and since org-mode is included with those sources, I would have thought THAT org mode should work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I did remove the org-mode that was installed by default, and installed the &lt;a href=&quot;http://orgmode.org/&quot; rel=&quot;nofollow&quot;&gt;latest tarball&lt;/a&gt; from stable branch, which, at 8.3.5 is at least one minor version number ahead of what came with Emacs sources (8.2.something). And upgrading did do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sorry there isn't a better solution: you either have to keep your org current yourself, or you have to wail until Emacs starts shipping with the 8.3 branch. Of course, at that point, Org-stable will be at 8.5, which is the development branch now, so who knows what problems being two version numbers behind will cause.&lt;/p&gt;&#xA;" OwnerUserId="5203" LastActivityDate="2016-09-10T17:11:21.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26984" PostTypeId="1" AcceptedAnswerId="26985" CreationDate="2016-09-10T17:52:34.070" Score="1" ViewCount="139" Body="&lt;p&gt;I do a lot of my programming in Haskell and Python. I've started maintaining a personal cheat-sheet for each of these languages for common constructs and tasks I often come across. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence whenever I start an emacs process, in addition to the scratch buffer how do I load my files HaskellCheatSheet.org and PythonCheatSheet.org everytime? &lt;/p&gt;&#xA;" OwnerUserId="10896" LastEditorUserId="105" LastEditDate="2016-11-12T02:55:33.697" LastActivityDate="2016-11-12T02:55:33.697" Title="Loading addition org files along with default scratch buffer" Tags="|init-file|files|start-up|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26985" PostTypeId="2" ParentId="26984" CreationDate="2016-09-10T18:19:15.697" Score="6" Body="&lt;p&gt;Place two lines at the bottom of your &lt;code&gt;.emacs&lt;/code&gt; file using &lt;code&gt;find-file&lt;/code&gt; and adjust the path to the file locations.  If you want them loaded in the background only, then use &lt;code&gt;find-file-noselect&lt;/code&gt; instead of &lt;code&gt;find-file&lt;/code&gt; -- that way, they will not interfere with your current display window/buffer screen setup at startup.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(find-file &quot;/path/to/HaskellCheatSheet.org&quot;)&#xA;&#xA;(find-file &quot;/path/to/PythonCheatSheet.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-09-10T18:27:22.813" LastActivityDate="2016-09-10T18:27:22.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26986" PostTypeId="1" AcceptedAnswerId="26987" CreationDate="2016-09-10T23:18:11.370" Score="1" ViewCount="88" Body="&lt;p&gt;I wanted to change the behavior of isearch in the minibuffer, making &lt;kbd&gt;Return&lt;/kbd&gt; both accept a search result (&lt;code&gt;isearch-exit&lt;/code&gt;) and submit it (&lt;code&gt;minibuffer-complete-and-exit&lt;/code&gt;). This is the behavior I've grown to like with Ctrl-R in the shell.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivan/isearch-exit ()&#xA;  &quot;Run isearch-exit, and if in the minibuffer, submit the search result as input.&quot;&#xA;  (interactive)&#xA;  (isearch-exit)&#xA;  (if (minibuffer-window-active-p (selected-window))&#xA;      (minibuffer-complete-and-exit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first time &lt;code&gt;isearch-mode&lt;/code&gt; is entered, it binds &lt;kbd&gt;Return&lt;/kbd&gt; to &lt;code&gt;isearch-exit&lt;/code&gt; in &lt;code&gt;overriding-terminal-local-map&lt;/code&gt; (which takes precedence over all other keymaps). So I'm remapping &lt;code&gt;isearch-exit&lt;/code&gt; to my custome &lt;code&gt;ivan/isearch-exit&lt;/code&gt; in that keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, I can't simply do the remapping in my init file, because &lt;code&gt;overriding-terminal-local-map&lt;/code&gt; is nil at that point. To get around this, I've done the remapping in a hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivan/remap-isearch-exit ()&#xA;  (define-key&#xA;    overriding-terminal-local-map [remap isearch-exit] #'ivan/isearch-exit))&#xA;&#xA;(add-hook 'isearch-mode-hook #'ivan/remap-isearch-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works, &lt;em&gt;but&lt;/em&gt; it means I'm doing the remapping &lt;em&gt;every&lt;/em&gt; time isearch starts, which is unnecessary. Not that it hurts anything (except maybe performance?), but I'd like to avoid doing so. Now I've added a variable to make sure the remap only occurs the first time isearch is entered.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ivan/remapped-isearch-exit nil)&#xA;&#xA;(defun ivan/remap-isearch-exit ()&#xA;  (unless ivan/remapped-isearch-exit&#xA;    (setq ivan/remapped-isearch-exit t)&#xA;    (define-key&#xA;      overriding-terminal-local-map [remap isearch-exit] #'ivan/isearch-exit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it makes me wonder if there's a better way. Is there something I could hook into that's run when &lt;code&gt;overriding-terminal-local-map&lt;/code&gt; is first created? Or is there another approach altogether that I'm not aware of?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;: Thanks to lawlist's answer, I now have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;isearch&quot;&#xA;  '(define-key isearch-mode-map [remap isearch-exit] #'ivan/isearch-exit))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-09-11T03:00:55.440" LastActivityDate="2016-09-11T03:00:55.440" Title="How to defer a remap until the affected keymap has been created?" Tags="|key-bindings|hooks|keymap|isearch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26987" PostTypeId="2" ParentId="26986" CreationDate="2016-09-11T00:10:02.790" Score="2" Body="&lt;p&gt;Because certain components of &lt;code&gt;isearch.el&lt;/code&gt; are autoloaded by default, Emacs recognizes the existence of the autoloaded functions when they are called during an Emacs session -- the entire library is loaded once an autoloaded function is called.  The following are two different approaches to changing the settings -- &lt;code&gt;. . .&lt;/code&gt; means to add your own additional stuff as needed -- the first approach will be slightly faster than the second approach when starting Emacs:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;isearch&quot; '(progn&#xA;  . . .))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'isearch)&#xA;. . .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-09-11T00:10:02.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26988" PostTypeId="1" CreationDate="2016-09-11T01:54:18.023" Score="2" ViewCount="2734" Body="&lt;p&gt;What I've tried in .emacs (note: I don't know elisp, and just tried cobbling this stuff together from googling and from other people's stuff) is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mouse-wheel-mode 't) ;;; mouse-wheel enabled&#xA;(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;;; 1 line at a time&#xA;;;; (setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))&#xA;;;; (setq mouse-wheel-progressive-speed nil)&#xA;(setq mouse-wheel-follow-mouse 't) ;;; scroll window under mouse&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-4&amp;gt;&quot;) 'scroll-down-command)&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-5&amp;gt;&quot;) 'scroll-up-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;desired behavior&lt;/strong&gt; is that every small mouse wheel movement should scroll up or down &lt;strong&gt;one line&lt;/strong&gt; at a time. But it scrolls &lt;strong&gt;one screenful&lt;/strong&gt; at a time. That is, the smallest mouse wheel motion scrolls the buffer up or down an entire screenful. How can I get one line at a time? I'm using emacs 24.5.1, and sometimes 24.3.1, under linux (slackware versions 14.2x64, and sometimes 14.1x32).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; @lawlist's suggestion in comments below worked when I tried an .emacs file with the one single line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But my entire .emacs file must be doing something that defeats it, or that does some other bad thing. So below is my entire 50-line .emacs. What's wrong with it?...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq major-mode 'text-mode)&#xA;(setq auto-mode-alist '((&quot;.&quot; . text-mode)))&#xA;(setq make-backup-files  nil) ;;; no backup files&#xA;(setq auto-save-default  nil) ;;; no auto saving&#xA;&#xA;(setq scroll-step 1)&#xA;(setq scroll-margin 0)&#xA;(setq scroll-preserve-screen-position 't) ;;; scroll without moving cursor&#xA;(setq scroll-conservatively 10000) ;;; (0 or 10000 seems same)&#xA;(setq auto-window-vscroll nil)&#xA;(setq scroll-up nil)&#xA;(setq scroll-down nil)&#xA;(setq scroll-up-aggressively nil) ;;; used to be .01&#xA;(setq scroll-down-aggressively nil) ;;; used to be .01&#xA;;;; (setq track-eol nil) ;;; cursor doesn't track end-of-line&#xA;(setq next-screen-context-lines 0)&#xA;(mouse-wheel-mode 't) ;;; mouse-wheel enabled&#xA;;;; (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;;; 1 line at a time&#xA;(setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))&#xA;;;; (setq mouse-wheel-progressive-speed nil)&#xA;(setq mouse-wheel-follow-mouse 't) ;;; scroll window under mouse&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-4&amp;gt;&quot;) 'scroll-down-command)&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-5&amp;gt;&quot;) 'scroll-up-command)&#xA;;;; (scroll-bar-mode -1) ;;; no scroll bar displayed at all&#xA;(setq indent-tabs-mode nil)&#xA;;;; see http://emacs.stackexchange.com/questions/&#xA;;;;     14297/completely-disable-all-auto-indentation&#xA;(global-set-key &quot;\C-j&quot; 'newline)   ;;; disable auto-indent? emacs &amp;lt;=24.3&#xA;(electric-indent-mode 0)           ;;; disable auto-indent? emacs &amp;gt;=24.4&#xA;(setq blink-matching-paren nil)&#xA;(setq column-number-mode 't)&#xA;(setq size-indication-mode 't)&#xA;&#xA;;;; open with single window&#xA;(setq inhibit-startup-screen 't)&#xA;(add-hook 'emacs-startup-hook 'delete-other-windows)&#xA;&#xA;;;; initial frame width,height,position&#xA;(set-frame-width (selected-frame) 80)        ; #chars wide&#xA;(set-frame-height (selected-frame) 52)       ; #lines ling&#xA;(set-frame-position (selected-frame) 10 10 ) ; x y from upper-left&#xA;&#xA;;;; insert tab character&#xA;(defun insert-tab ()&#xA;  (interactive)&#xA;  (insert &quot;\t&quot;))&#xA;;;;  (insert &quot;        &quot;))&#xA;(global-unset-key [tab])&#xA;(global-set-key (kbd &quot;TAB&quot;) 'insert-tab)&#xA;;;; --- end-of-file ---&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13242" LastEditorUserId="13242" LastEditDate="2016-09-11T03:00:00.667" LastActivityDate="2016-09-11T03:00:00.667" Title="Set scroll-amount for mouse wheel in .emacs" Tags="|mouse|scrolling|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="26989" PostTypeId="1" AcceptedAnswerId="26996" CreationDate="2016-09-11T05:27:58.803" Score="6" ViewCount="1548" Body="&lt;p&gt;For example, when defining the natural number sequence stream, I can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t; -*-&#xA;&#xA;(defun nats (n)&#xA;  (cons n (lambda () (nats (1+ n)))))&#xA;&#xA;(nats 0)&#xA;     =&amp;gt; (0 closure ((n . 0) t) nil (nats (1+ n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I want to call simply &lt;code&gt;(nats)&lt;/code&gt; since the natural numbers begins with &lt;code&gt;0&lt;/code&gt;, and I don't want define a global helper function for &lt;code&gt;nats&lt;/code&gt; since it is useless everywhere else. I tried the following, but it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t; -*-&#xA;&#xA;(defalias 'nats&#xA;  (flet ((f (n) (cons n (lambda () (f (1+ n))))))&#xA;    (lambda () (f 0))))&#xA;&#xA;(nats)&#xA;error--&amp;gt; nats: Symbol's function definition is void: f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like &lt;code&gt;f&lt;/code&gt; is not in the closure's environment. I also tried some other options. &lt;code&gt;cl-letf&lt;/code&gt; produces the same result. &lt;code&gt;cl-flet&lt;/code&gt; doesn't allow recursive local function definition.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="2710" LastEditDate="2016-09-16T08:32:13.637" LastActivityDate="2016-09-16T08:32:13.637" Title="How to make local function binding for closure?" Tags="|elisp|defun|lexical-binding|closures|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26990" PostTypeId="2" ParentId="26855" CreationDate="2016-09-11T07:27:20.183" Score="1" Body="&lt;p&gt;Based on the answer of &lt;a href=&quot;https://emacs.stackexchange.com/users/3940/andreas-r%c3%b6hler&quot;&gt;Andreas Röhler&lt;/a&gt; I was able to create the following functions. In the gdb buffer you can press 'q' to quit gdb as usual and restore the previous layout.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Select a register number which is unlikely to get used elsewere&#xA;(defconst egdbe-windows-config-register 313465989&#xA;  &quot;Internal used&quot;)&#xA;&#xA;(defvar egdbe-windows-config nil)&#xA;&#xA;(defun set-egdbe-windows-config ()&#xA;  (interactive)&#xA;  (setq egdbe-windows-config (window-configuration-to-register egdbe-windows-config-register)))&#xA;&#xA;(defun egdbe-restore-windows-config ()&#xA;  (interactive)&#xA;  (jump-to-register egdbe-windows-config-register))&#xA;&#xA;(defun egdbe-start-gdb (&amp;amp;optional gdb-args)&#xA;  &quot;&quot;&#xA;  (interactive)&#xA;  (set-egdbe-windows-config)&#xA;  (call-interactively 'gdb))&#xA;&#xA;(defun egdbe-quit ()&#xA;  &quot;finish.&quot;&#xA;  (interactive)&#xA;  (gud-basic-call &quot;quit&quot;)&#xA;  (egdbe-restore-windows-config))&#xA;&#xA;(defun egdbe-gud-mode-hook ()&#xA;  &quot;&quot;&#xA;  (local-unset-key (kbd &quot;q&quot;))&#xA;  (local-set-key (kbd &quot;q&quot;) 'egdbe-quit))&#xA;&#xA;(add-hook 'gud-mode-hook 'egdbe-gud-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10556" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-09-11T07:27:20.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26991" PostTypeId="1" AcceptedAnswerId="30150" CreationDate="2016-09-11T07:54:55.303" Score="13" ViewCount="2141" Body="&lt;p&gt;For example I have an org mode that has the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure yasnippets in such a way so all emacs-lisp-mode snippets can be expanded inside that block but not outside it?&lt;/p&gt;&#xA;" OwnerUserId="5247" LastActivityDate="2017-05-03T14:05:59.070" Title="Is it possible to make yasnippets to expand snippets inside an org-mode babel section in the appropriate mode?" Tags="|org-mode|yasnippet|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26992" PostTypeId="1" AcceptedAnswerId="26995" CreationDate="2016-09-11T08:50:31.643" Score="1" ViewCount="175" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun switch-whitespace-mode ()&#xA;  (interactive)&#xA;  (whitespace-mode)&#xA;)&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt;&quot;) 'switch-whitespace-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Through the above configuration，I failed.&lt;/p&gt;&#xA;" OwnerUserId="13259" LastEditorUserId="9995" LastEditDate="2016-09-11T18:13:28.980" LastActivityDate="2016-09-11T18:13:28.980" Title="How can I switch whitespace-mode enabled/disabled by key?" Tags="|key-bindings|whitespace|whitespace-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26993" PostTypeId="1" CreationDate="2016-09-11T09:01:00.383" Score="13" ViewCount="1996" Body="&lt;p&gt;It looks like this can be achieved by modifying the variable &#xA;undo-tree-history-directory-alist, but I can't figure out how.  I tried a number of lines, the last of which is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq undo-tree-history-directory-alist (&quot;.&quot; ! &quot;~/.emacs.d/undo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this returns errors.&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2022-07-12T06:09:40.873" Title="Saving persistent undo to a single directory, alist format" Tags="|association-lists|undo-tree-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26994" PostTypeId="2" ParentId="26993" CreationDate="2016-09-11T09:29:45.583" Score="15" Body="&lt;p&gt;You most certainly want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq undo-tree-history-directory-alist '((&quot;.&quot; . &quot;~/.emacs.d/undo&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The docstring of this variable speaks of an alist aka association list.  These are a list of pairs, where a pair is a cons cell.  The short-hand syntax for a cons cell is &lt;code&gt;(foo . 1)&lt;/code&gt; whereas the short-hand syntax for returning a list as is would be &lt;code&gt;'(...)&lt;/code&gt;, both combined result in &lt;code&gt;'((foo . 1) ...))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-09-11T09:29:45.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26995" PostTypeId="2" ParentId="26992" CreationDate="2016-09-11T09:36:01.503" Score="4" Body="&lt;p&gt;There is a set of conventions for minor modes documented in the docstring of &lt;code&gt;define-minor-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The defined mode command takes one optional (prefix) argument.&#xA;  Interactively with no prefix argument, it toggles the mode.&#xA;  A prefix argument enables the mode if the argument is positive,&#xA;  and disables it otherwise.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When called from Lisp, the mode command toggles the mode if the&#xA;  argument is `toggle', disables the mode if the argument is a&#xA;  non-positive integer, and enables the mode otherwise (including&#xA;  if the argument is omitted or nil or a positive integer).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, &lt;code&gt;M-x whitespace-mode&lt;/code&gt; will toggle the state of the mode, &lt;code&gt;(whitespace-mode)&lt;/code&gt; won't.  Use &lt;code&gt;(whitespace-mode 'toggle)&lt;/code&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-09-11T09:36:01.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26996" PostTypeId="2" ParentId="26989" CreationDate="2016-09-11T09:44:34.810" Score="8" Body="&lt;p&gt;Without &lt;code&gt;cl-lib&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t; -*-&#xA;&#xA;(defun nats ()&#xA;  (letrec ((inner (lambda (n) (cons n (lambda () (funcall inner (1+ n)))))))&#xA;    (funcall inner 0)))&#xA;&#xA;(let* ((stream (nats))&#xA;       (i (car stream)))&#xA;  (while (&amp;lt; i 10)&#xA;    (message &quot;Got %i&quot; i)&#xA;    (setq stream (funcall (cdr stream))&#xA;          i (car stream))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://github.com/josteink/csharp-mode/issues/39#issuecomment-129636221&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/josteink/csharp-mode/issues/39#issuecomment-129636221&lt;/a&gt;.  As suggested in the linked post, I'd generally recommend against writing such code and going for a top-level helper function instead.  Emacs Lisp isn't Scheme after all, so you're only going to confuse whoever may read your code...&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-09-13T06:40:32.410" LastActivityDate="2016-09-13T06:40:32.410" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="26997" PostTypeId="1" AcceptedAnswerId="27000" CreationDate="2016-09-11T11:48:34.453" Score="2" ViewCount="459" Body="&lt;p&gt;I just began using erc-mode and I noticed that erc-mode alerts whenever people join or leave a channel. Is there a way I can somehow hide the alerts ? &lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-09-11T16:05:22.213" Title="erc-mode : how to hide alerts when users join/leave a channel" Tags="|erc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26999" PostTypeId="1" AcceptedAnswerId="27013" CreationDate="2016-09-11T15:11:43.447" Score="2" ViewCount="754" Body="&lt;p&gt;In regular (non-evil) emacs, if you select a rectangular region and hit &lt;code&gt;C-x r t&lt;/code&gt; to run &lt;code&gt;string-rectangle&lt;/code&gt;, inserted text is displayed on all the selected lines as you type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Vim, if you select a visual-block and hit &lt;code&gt;I&lt;/code&gt;, inserted text is only displayed on the top line until you finish by hitting &lt;code&gt;Escape&lt;/code&gt;, at which point it inserts the text on all &lt;em&gt;non-empty&lt;/em&gt; lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was really hoping that evil-mode would combine the best of both worlds: select a rectangular region, hit &lt;code&gt;I&lt;/code&gt;, and inserted text is displayed on all non-empty lines as you type. Unfortunately, it doesn't display the text as you type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to either make &lt;code&gt;evil-insert&lt;/code&gt; display inserted text on all non-empty lines or get &lt;code&gt;string-rectangle&lt;/code&gt; to respect empty lines?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;: I just realized there's also &lt;code&gt;string-insert-rectangle&lt;/code&gt;, which is like visual-block &lt;code&gt;I&lt;/code&gt;, in that it inserts text along the left edge of the rectangle, whereas &lt;code&gt;string-rectangle&lt;/code&gt; is more like visual-block &lt;code&gt;s&lt;/code&gt; because it replaces the existing contents of the rectangle with inserted text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;string-insert-rectangle&lt;/code&gt; also doesn't show the final results in the buffer until you complete your input, which makes me wonder if there's a reason behind this I haven't thought of.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-09-11T18:14:50.253" LastActivityDate="2016-09-12T00:37:57.013" Title="Can evil-visual-block show inserted text on all lines like string-rectangle does?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27000" PostTypeId="2" ParentId="26997" CreationDate="2016-09-11T15:28:22.740" Score="3" Body="&lt;p&gt;(setq erc-hide-list '(&quot;JOIN&quot; &quot;PART&quot; &quot;QUIT&quot;))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;describe-variable&lt;/code&gt; if you are looking for variables. It's very convenient when you want to change a certain behaviour and you don't the variables's name.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-09-11T16:05:22.213" LastActivityDate="2016-09-11T16:05:22.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27001" PostTypeId="1" CreationDate="2016-09-11T15:30:31.650" Score="15" ViewCount="15230" Body="&lt;p&gt;After a long debugging of my init.el file, it looks like the first line of the following elisp-code, i.e &lt;code&gt;(custom-set-variables&lt;/code&gt;is provoking an 'End of file during parsing' error) which I absolutely don't understand. If I comment this line, all is fine. I did not even enter this code myself, as it has been automatically added in init.el from the &lt;code&gt;customize&lt;/code&gt; menu.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;'(global-hl-line-mode t)&#xA;'(ido-mode (quote buffer) nil (ido))&#xA;'(menu-bar-mode nil)&#xA; (when (display-graphic-p)&#xA; (tool-bar-mode -1)&#xA; (scroll-bar-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the complete error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (initialization): An error occurred while loading `/Users/me/.emacs.d/init.el':&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;End of file during parsing: /Users/me/.emacs.d/init.el&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated ! Thanks&lt;/p&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="105" LastEditDate="2016-09-11T16:22:15.103" LastActivityDate="2016-09-11T16:22:15.103" Title="debugging some elisp -- &quot;end of file during parsing error&quot; in init.el" Tags="|debugging|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27002" PostTypeId="2" ParentId="27001" CreationDate="2016-09-11T15:56:16.097" Score="5" Body="&lt;p&gt;A closing parentheses is missing in the example above.  The &lt;code&gt;when&lt;/code&gt; statment is not part of the &lt;code&gt;custom-set-variables&lt;/code&gt;.  The corrected code is as follows:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-variables&#xA;  '(global-hl-line-mode t)&#xA;  '(ido-mode (quote buffer) nil (ido))&#xA;  '(menu-bar-mode nil))&#xA;&#xA;(when (display-graphic-p)&#xA;  (tool-bar-mode -1)&#xA;  (scroll-bar-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-09-11T15:56:16.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27003" PostTypeId="2" ParentId="27001" CreationDate="2016-09-11T15:57:54.520" Score="37" Body="&lt;p&gt;The &quot;end of file during parsing&quot; error means that you have not closed a paren.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To debug this, you should&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Parentheses.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;kbd&gt;M-x check-parens RET&lt;/kbd&gt;&lt;/a&gt; to pinpoint the location of the current error.&lt;/li&gt;&#xA;&lt;li&gt;Enable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq/Matching-parentheses.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;show-paren-mode&lt;/code&gt;&lt;/a&gt; to see which paren matches your current one - this will help you with on-going code maintenance.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Expressions.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;kbd&gt;C-M-f&lt;/kbd&gt;/&lt;kbd&gt;C-M-b&lt;/kbd&gt;&lt;/a&gt; to navigate by balanced parens; if you get an error, this is where your open parent which was not closed is.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode_002dSpecific-Indent.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;kbd&gt;TAB&lt;/kbd&gt;&lt;/a&gt; to indent each line and see if the new indentation conforms to your expectations.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The other answer correctly explains what the actual error is in your case.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-09-11T16:02:58.037" LastActivityDate="2016-09-11T16:02:58.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27004" PostTypeId="1" AcceptedAnswerId="27005" CreationDate="2016-09-11T15:58:58.827" Score="1" ViewCount="26" Body="&lt;p&gt;I've seen videos where someone an elisp function call like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(so-and-so/do-stuff)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But were able to shorted the displayed function name to something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(so/do-stuff)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do they do that? I'd like to use it in my init.el so I can display this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(i/do-stuff)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ivan/do-stuff)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-09-11T16:20:36.563" Title="Display abbreviated form of a function name?" Tags="|symbols|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27005" PostTypeId="2" ParentId="27004" CreationDate="2016-09-11T16:20:36.563" Score="2" Body="&lt;p&gt;You can do it by using Malabarba's &lt;a href=&quot;https://github.com/Malabarba/nameless&quot; rel=&quot;nofollow&quot;&gt;Nameless&lt;/a&gt; package, it is available from both GNU ELPA and MELPA. You probably want to customize the &lt;code&gt;nameless-global-aliases&lt;/code&gt; and &lt;code&gt;nameless-prefix&lt;/code&gt; user options. Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nameless-global-aliases '((&quot;i&quot; . &quot;ivan&quot;)))&#xA;(setq nameless-prefix &quot;/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and open your init.el then &lt;code&gt;M-x nameless-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-09-11T16:20:36.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27006" PostTypeId="2" ParentId="26992" CreationDate="2016-09-11T16:33:20.810" Score="1" Body="&lt;p&gt;&lt;code&gt;C-h f whitespace-mode&lt;/code&gt; tells you what your problem is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;whitespace-mode is an interactive autoloaded Lisp function in&#xA;  &lt;code&gt;whitespace.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;(whitespace-mode &amp;amp;optional ARG)&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Toggle whitespace visualization (Whitespace mode).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With a prefix argument ARG, enable Whitespace mode if ARG is&#xA;  positive, and disable it otherwise.  &lt;strong&gt;If called from Lisp, enable&#xA;  the mode if ARG is omitted or nil.&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See also &lt;code&gt;whitespace-style&lt;/code&gt;, &lt;code&gt;whitespace-newline&lt;/code&gt; and&#xA;  &lt;code&gt;whitespace-display-mappings&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The sentence I've put in &lt;strong&gt;bold&lt;/strong&gt; tells you that with no argument the mode is &lt;em&gt;enabled&lt;/em&gt;. In other words: &lt;code&gt;(whitespace-mode)&lt;/code&gt; always enables the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc string does &lt;em&gt;not&lt;/em&gt; tell you, unfortunately, how to &lt;em&gt;toggle the mode using Lisp&lt;/em&gt;.  This is a bug, IMO (I've filed Emacs &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24413&quot; rel=&quot;nofollow&quot;&gt;bug #24413&lt;/a&gt; for this).  The &lt;code&gt;define-minor-mode&lt;/code&gt; call that defines this mode explicitly provides a doc string that is deficient in this way.  If it had simply relied on the generic doc string provided by &lt;code&gt;define-minor-mode&lt;/code&gt; then you would have seen this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Toggle whitespace-mode on or off.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With a prefix argument ARG, enable Whitespace mode if ARG is&#xA;  positive, and disable it otherwise.  If called from Lisp, enable&#xA;  the mode if ARG is omitted or nil, &lt;strong&gt;and toggle it if ARG is &lt;code&gt;toggle&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;@wasamasa's answer -- consult the doc of &lt;code&gt;define-minor-mode&lt;/code&gt; -- provides this missing information: Use &lt;code&gt;(whitespace-mode 'toggle)&lt;/code&gt;. (And it lets you know that the same holds for other minor modes defined using &lt;code&gt;define-minor-mode&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-11T16:56:54.660" LastActivityDate="2016-09-11T16:56:54.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27007" PostTypeId="1" AcceptedAnswerId="27010" CreationDate="2016-09-11T16:55:03.913" Score="5" ViewCount="1610" Body="&lt;p&gt;I was referring the source code of &lt;code&gt;switch-to-buffer&lt;/code&gt; in elisp source code, &lt;code&gt;window.el.gz&lt;/code&gt;. I am seeing some backward single quotes like, `&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know single quote is used to refer to symbols but what does backward single quote do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source code is &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/window.el#L7257&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. When to use backward quote in elisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reproducing the same here,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;       ((pcase switch-to-buffer-in-dedicated-window&#xA;          (`nil (user-error&#xA;                 &quot;Cannot switch buffers in a dedicated window&quot;))&#xA;          (`prompt&#xA;           (if (y-or-n-p&#xA;                (format &quot;Window is dedicated to %s; undedicate it&quot;&#xA;                        (window-buffer)))&#xA;               (progn&#xA;                 (set-window-dedicated-p nil nil)&#xA;                 'force-same-window)&#xA;             (user-error&#xA;              &quot;Cannot switch buffers in a dedicated window&quot;)))&#xA;          (`pop nil)&#xA;          (_ (set-window-dedicated-p nil nil) 'force-same-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="9995" LastEditDate="2016-09-17T09:10:38.350" LastActivityDate="2016-09-17T09:10:38.350" Title="Backward quote, what does it mean in elisp?" Tags="|backquote|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27008" PostTypeId="2" ParentId="24976" CreationDate="2016-09-11T16:57:50.370" Score="4" Body="&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; already has a feature like this for &lt;code&gt;org-capture&lt;/code&gt; and &lt;code&gt;org-agenda&lt;/code&gt;.  We can use that to bootstrap a similar feature for &lt;code&gt;org-refile&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(defvar org-refile-contexts &quot;Contexts for `org-capture'.&#xA;&#xA;Takes the same values as `org-capture-templates-contexts' except&#xA;that the first value of each entry should be a valid setting for&#xA;`org-refile-targets'.&quot;)&#xA;&#xA;(defun org-refile--get-context-targets ()&#xA;  &quot;Get the refile targets for the current headline.&#xA;&#xA;Returns the first set of targets in `org-refile-contexts' that&#xA;the current headline satisfies, or `org-refile-targets' if there&#xA;are no such.&quot;&#xA;  (or (car (-first (lambda (x)&#xA;                            (org-contextualize-validate-key&#xA;                             (car x)&#xA;                             org-refile-contexts))&#xA;                          org-refile-contexts&#xA;                 ))&#xA;      org-refile-targets)&#xA;  )&#xA;&#xA;(defun org-refile-with-context (&amp;amp;optional arg default-buffer rfloc msg)&#xA;  &quot;Refile the headline to a location based on `org-refile-targets'.&#xA;&#xA;Changes the set of available refile targets based on `org-refile-contexts', but is otherwise identical to `org-refile'&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((org-refile-targets (org-refile--get-context-targets)))&#xA;    (org-refile arg default-buffer rfloc msg)&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Set the contexts you want in &lt;code&gt;org-refile-contexts&lt;/code&gt; using the same rules as &lt;code&gt;org-capture-templates-contexts&lt;/code&gt;: it is a list of pairs &lt;code&gt;(targets conditions)&lt;/code&gt;, where &lt;code&gt;targets&lt;/code&gt; is the desired setting for &lt;code&gt;org-refile-targets&lt;/code&gt; and &lt;code&gt;conditions&lt;/code&gt; is a list of predicates to test the current headline against (most generally, these can be any function taking no arguments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example this setting will cause anything in the &quot;notes.org&quot; file under the &quot;Inbox&quot; heading to be refiled to &quot;Projects&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-refile-contexts&#xA;      '(((((&quot;notes.org&quot;) . (:regexp . &quot;Projects&quot;)))&#xA;         ((lambda () (string= (org-find-top-headline) &quot;Inbox&quot;)))&#xA;         )&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More conditions and more targets can be added to achieve almost any workflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bind &lt;code&gt;org-capture-with-context&lt;/code&gt; to the key normally bound to &lt;code&gt;org-refile&lt;/code&gt; and it should replace it seamlessly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c C-w&quot;) #'org-refile-with-context)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="29147" LastEditDate="2020-05-31T17:04:00.793" LastActivityDate="2020-05-31T17:04:00.793" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27009" PostTypeId="2" ParentId="26992" CreationDate="2016-09-11T17:02:43.413" Score="3" Body="&lt;p&gt;&lt;code&gt;whitespace-mode&lt;/code&gt; is already an interactive function and, if &lt;em&gt;called&lt;/em&gt; interactively, toggles the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the simplest answer to your question is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt;&quot;) 'whitespace-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-09-11T17:02:43.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27010" PostTypeId="2" ParentId="27007" CreationDate="2016-09-11T17:35:23.157" Score="12" Body="&lt;p&gt;Ask Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-h i&lt;/code&gt;, choose the Elisp manual.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;i backquote&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You'll get to node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot;&gt;Backquote&lt;/a&gt;, where you'll find a complete explanation of how backquotes are used in Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first paragraph provides a summary description:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Backquote constructs&quot; allow you to quote a list, but &lt;strong&gt;selectively&#xA;  evaluate elements&lt;/strong&gt; of that list.  In the simplest case, it is identical&#xA;  to the special form ‘quote’ (described in the previous section; *note&#xA;  Quoting::). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You see there several examples, as well. Here is one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(1 2 (3 ,(+ 4 5)))&#xA;⇒ (1 2 (3 9))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's equivalent to each of these, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cons 1 (cons 2 (list 3 (+ 4 5))))&#xA;&#xA;(list 1 2 (list 3 (+ 4 5)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another possible summary: backquoting gives you a simple way to see, pictorially, what list structure you are creating.  In other words, it is essentially syntactic sugar that most users typically find easier to read than the equivalent sexps that use lots of &lt;code&gt;cons&lt;/code&gt;, &lt;code&gt;list&lt;/code&gt;, or &lt;code&gt;append&lt;/code&gt; calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;em&gt;typical use case&lt;/em&gt; is thus for &lt;em&gt;constructing Lisp code&lt;/em&gt;, especially complex code. And the &lt;strong&gt;most typical&lt;/strong&gt; of such use cases is the code &lt;em&gt;defining a Lisp macro&lt;/em&gt;, e.g., in the body of a &lt;code&gt;defmacro&lt;/code&gt; expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of that said, the particular case that you cite is a case of using &lt;code&gt;pcase&lt;/code&gt;. If you choose to use backquoting in a typical &lt;code&gt;pcase&lt;/code&gt; expression (which is what most people do) then the overall appearance is similar to that of a &lt;code&gt;cond&lt;/code&gt; or a &lt;code&gt;cl-case&lt;/code&gt; (Common Lisp &lt;code&gt;case&lt;/code&gt;) expression.  If you do not use backquoting then your &lt;code&gt;pcase&lt;/code&gt; expression (like a &lt;code&gt;defmacro&lt;/code&gt; body) is likely to be more difficult to read -- the &lt;code&gt;pcase&lt;/code&gt; patterns are not so obvious.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-11T18:45:09.697" LastActivityDate="2016-09-11T18:45:09.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27011" PostTypeId="2" ParentId="21947" CreationDate="2016-09-11T18:51:05.860" Score="1" Body="&lt;p&gt;This seems to work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-get-folded-state ()&#xA;    (cond&#xA;        ((not (or (org-at-item-p) (org-at-heading-p)))&#xA;            'not-at-node)&#xA;        ((org-before-first-heading-p)&#xA;            'not-at-node)&#xA;        (t&#xA;            (let (eoh eol eos has-children children-skipped struct)&#xA;                ;; First, determine end of headline (EOH), end of subtree or item&#xA;                ;; (EOS), and if item or heading has children (HAS-CHILDREN).&#xA;                (save-excursion&#xA;                    (if (org-at-item-p)&#xA;                        (progn&#xA;                            (beginning-of-line)&#xA;                            (setq struct (org-list-struct))&#xA;                            (setq eoh (point-at-eol))&#xA;                            (setq eos (org-list-get-item-end-before-blank (point) struct))&#xA;                            (setq has-children (org-list-has-child-p (point) struct)))&#xA;                        (org-back-to-heading)&#xA;                        (setq eoh (save-excursion (outline-end-of-heading) (point)))&#xA;                        (setq eos (save-excursion (org-end-of-subtree t t)&#xA;                                      (when (bolp) (backward-char)) (point)))&#xA;                        (setq has-children&#xA;                            (or (save-excursion&#xA;                                    (let ((level (funcall outline-level)))&#xA;                                        (outline-next-heading)&#xA;                                        (and (org-at-heading-p t)&#xA;                                            (&amp;gt; (funcall outline-level) level))))&#xA;                                (save-excursion&#xA;                                    (org-list-search-forward (org-item-beginning-re) eos t)))))&#xA;                    ;; Determine end invisible part of buffer (EOL)&#xA;                    (beginning-of-line 2)&#xA;                    (while (and (not (eobp)) ;; this is like `next-line'&#xA;                               (get-char-property (1- (point)) 'invisible))&#xA;                        (goto-char (next-single-char-property-change (point) 'invisible))&#xA;                        (and (eolp) (beginning-of-line 2)))&#xA;                    (setq eol (point)))&#xA;                (cond&#xA;                    ((= eos eoh)&#xA;                        'empty-node)&#xA;                    ((or (&amp;gt;= eol eos)&#xA;                         (not (string-match &quot;\\S-&quot; (buffer-substring eol eos))))&#xA;                        'folded)&#xA;                    (t&#xA;                        'not-folded))))))&#xA;&#xA;(defun my/org-tree-can-fold-p ()&#xA;    (not (member (my/org-get-folded-state) (list 'folded 'empty-node))))&#xA;&#xA;(defun my/org-cycle-until-folded ()&#xA;    (while (my/org-tree-can-fold-p)&#xA;        (org-cycle)))&#xA;&#xA;(defun my/org-hide-done-entries-in-range (start end)&#xA;    (save-excursion&#xA;        (goto-char end)&#xA;        (while (and (outline-previous-heading) (&amp;gt; (point) start))&#xA;            (when (org-entry-is-done-p)&#xA;                (my/org-cycle-until-folded)))))&#xA;&#xA;(defun my/org-hide-done-entries-in-region (start end)&#xA;    (interactive &quot;r&quot;)&#xA;    (my/org-hide-done-entries-in-range start end))&#xA;&#xA;(defun my/org-hide-done-entries-in-buffer ()&#xA;    (interactive)&#xA;    (my/org-hide-done-entries-in-range (point-min) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-09-11T18:51:05.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27012" PostTypeId="2" ParentId="26978" CreationDate="2016-09-11T19:40:42.127" Score="3" Body="&lt;p&gt;Thanks to @npostavs, the thing that I missed previously is you have to update &lt;code&gt;eshell-prompt-regexp&lt;/code&gt; as you modified the eshell prompt. This is also vaguely mentioned in EmacsWiki: &lt;a href=&quot;https://www.emacswiki.org/emacs/EshellPrompt&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/EshellPrompt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case, you can add sth like &lt;code&gt;(setq eshell-prompt-regexp &quot;^[^λ]+ λ &quot;)&lt;/code&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="11207" LastActivityDate="2016-09-11T19:40:42.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27013" PostTypeId="2" ParentId="26999" CreationDate="2016-09-11T20:12:47.753" Score="3" Body="&lt;p&gt;If I well understood &lt;code&gt;evil&lt;/code&gt;'s source code, it's a matter of implementation. When you hit &lt;code&gt;I&lt;/code&gt; with a visual block, the variable &lt;code&gt;evil-insert-vcount&lt;/code&gt; is set to the number of lines in that block (and column start position etc.), so evil knows how many times to repeat on those extra lines below the insertion that just started. &lt;em&gt;But&lt;/em&gt;, this extra insertion takes place only when exiting from insert state - see function &lt;code&gt;evil-cleanup-insert-state&lt;/code&gt; (the only place &lt;code&gt;evil-insert-vcount&lt;/code&gt; is actually used). For reference, here's the function description:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Called when Insert state is about to be exited.&#xA;  Handles the repeat-count of the insertion command.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(where repeat-count refers to both [evil-insert-]&lt;code&gt;count&lt;/code&gt; and &lt;code&gt;vcount&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this isn't an actual &lt;em&gt;answer&lt;/em&gt;, in that I have no idea how and what to modify to make it work as you suggest. Maybe the right place to ask &lt;em&gt;this&lt;/em&gt; question would be at the official's &lt;a href=&quot;https://bitbucket.org/lyro/evil/issues?status=new&amp;amp;status=open&quot; rel=&quot;nofollow&quot;&gt;evil issue tracker&lt;/a&gt; - I know there are many elisp-fu conaisseurs here, but few of them are probably also interested in evil-mode, at least at this level.&lt;/p&gt;&#xA;" OwnerUserId="8708" LastEditorUserId="8708" LastEditDate="2016-09-12T00:37:57.013" LastActivityDate="2016-09-12T00:37:57.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27014" PostTypeId="1" CreationDate="2016-09-11T20:56:04.300" Score="3" ViewCount="2077" Body="&lt;p&gt;I'm on Debian Jessie 8.5,GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5), and I installed irony-mode as the author said here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow&quot;&gt;irony-mode author's repository&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean, I typed &lt;code&gt;M-x package-install RET irony RET&lt;/code&gt;. After that, I configured my ~/.emacs file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c++-mode-hook 'irony-mode)&#xA;(add-hook 'c-mode-hook 'irony-mode)&#xA;(add-hook 'objc-mode-hook 'irony-mode)&#xA;&#xA;;; replace the `completion-at-point' and `complete-symbol' bindings in&#xA;;; irony-mode's buffers by irony-mode's function&#xA;(defun my-irony-mode-hook ()&#xA;  (define-key irony-mode-map [remap completion-at-point]&#xA;    'irony-completion-at-point-async)&#xA;  (define-key irony-mode-map [remap complete-symbol]&#xA;    'irony-completion-at-point-async))&#xA;(add-hook 'irony-mode-hook 'my-irony-mode-hook)&#xA;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After restarting Emacs, I opened a .cpp file, I typed &lt;code&gt;M-x irony-install-server RET&lt;/code&gt;, and it compiled perfectly. Then, I typed &lt;code&gt;irony-cdb-autosetup-compile-options&lt;/code&gt;, but irony doesn't work, when I try to call a function from a class included by its .h name, and I press TAB, nothing appears. And Irony mode is perfectly enabled.&lt;/p&gt;&#xA;" OwnerUserId="13115" LastActivityDate="2016-09-11T20:56:04.300" Title="Irony-mode is not working on Emacs" Tags="|auto-complete-mode|irony-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27016" PostTypeId="1" CreationDate="2016-09-12T01:34:18.480" Score="0" ViewCount="547" Body="&lt;p&gt;I have two seemingly identical computers that display org-bullet utf-8 bullets differently within emacs. Both computers use the same OS (windows 7) and the same emacs version (24.5) with no modifications. Both computers use identical (synced) init.el files, packages and package folders, and themes (monokai).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first computer displays the bullets correctly but the second computer seems to use placeholders for most of the bullets. Also, line spacing differs for the two computers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fMQhh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fMQhh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bullets display correctly on computer 2 when using a different theme (tangotango):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/37t2V.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/37t2V.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? Perhaps this is related to fonts missing or conflicting on the second computer? Note the monokai theme uses variable-pitch face.&lt;/p&gt;&#xA;" OwnerUserId="9382" LastActivityDate="2016-09-13T13:59:08.230" Title="utf-8 bullets displaying differently on different computers, same platform" Tags="|fonts|display|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27017" PostTypeId="1" AcceptedAnswerId="27018" CreationDate="2016-09-12T01:40:19.510" Score="7" ViewCount="419" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how can I convert a 2-item list to a dotted pair &lt;code&gt;cons&lt;/code&gt; cell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can convert a 2-item list to a dotted pair with:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((list '(1 2)))&#xA;  (cons (car list) (cadr list)))        ; =&amp;gt; (1 . 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm blanking: is there a built-in function that does this, or&#xA;should I roll my own?&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="304" LastEditDate="2016-09-12T03:08:50.140" LastActivityDate="2016-09-12T03:08:50.140" Title="Convert 2-item list to a dotted pair?" Tags="|list|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27018" PostTypeId="2" ParentId="27017" CreationDate="2016-09-12T02:27:34.873" Score="12" Body="&lt;p&gt;&lt;code&gt;cons&lt;/code&gt; makes a cons cell out of two arguments. &lt;code&gt;apply&lt;/code&gt; uses a list as arguments to a function.  When their powers combine: &lt;code&gt;(apply #'cons x)&lt;/code&gt; converts a two element list into a cons cell (without having to poke around inside the list) &lt;em&gt;and&lt;/em&gt; raises an error if the list isn't 2 long.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="5296" LastEditDate="2016-09-12T02:45:51.227" LastActivityDate="2016-09-12T02:45:51.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27019" PostTypeId="1" AcceptedAnswerId="27025" CreationDate="2016-09-12T03:01:08.323" Score="5" ViewCount="191" Body="&lt;p&gt;I have some lisp code that contains a comment:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(while list&#xA;  ;; take the head of LIST&#xA;  (setq len 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to extract the positions of the sexps. I'm using &lt;code&gt;scan-sexps&lt;/code&gt;. If I call &lt;code&gt;M-: (scan-sexps 12 1)&lt;/code&gt; with the above code in a buffer, it returns 54, as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I try to do this programmatically:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq src &quot;(while list&#xA;  ;; take the head of LIST&#xA;  (setq len 1))&quot;)&#xA;&#xA;(with-temp-buffer&#xA;  (insert src)&#xA;  (scan-sexps 12 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get 22! This seems to be parsing the words in my comment. Why don't I get 54, and how do I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the docstring for &lt;code&gt;scan-sexps&lt;/code&gt;, it mentions &lt;code&gt;parse-sexp-ignore-comments&lt;/code&gt;. However, this doesn't seem to affect the outcome:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-temp-buffer&#xA;  (insert src)&#xA;  (setq parse-sexp-ignore-comments t)&#xA;  (scan-sexps 12 1)) ; still 22&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make &lt;code&gt;scan-sexps&lt;/code&gt; return the end position of the next sexp, ignoring comments?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2017-05-02T12:46:10.623" LastActivityDate="2017-05-02T12:46:10.623" Title="How do I ignore comments with scan-sexps?" Tags="|sexp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27020" PostTypeId="1" CreationDate="2016-09-12T03:23:44.693" Score="0" ViewCount="3252" Body="&lt;p&gt;I have my config files in &lt;code&gt;~/config/emacs&lt;/code&gt; which &lt;code&gt;~/.emacs&lt;/code&gt; is symlinked to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to figure out how to make the default &quot;emacs root directory&quot; &lt;code&gt;$HOME&lt;/code&gt; in all contexts (unless overridden by a buffer-local variable), whether launching an ansi terminal, launching dired, or anything like that.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ls -al .emacs.d | perl -pe 's/^.*([.]emacs[.]d)/$1/'&#xA;.emacs.d -&amp;gt; ./config/emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.emacs.d/init.el&lt;/code&gt; file contains the following snippet in an attempt to force emacs open stuff like &lt;code&gt;dired&lt;/code&gt; and &lt;code&gt;ansi-term&lt;/code&gt; in my home directory.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cd (getenv &quot;HOME&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I change the effective root directory for &lt;code&gt;ansi-term&lt;/code&gt; and everything else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a complete example that should reproduce the surprising behavior I'm talking about on OS X and Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a directory &lt;code&gt;~/tmp/emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo '(cd (getenv &quot;HOME&quot;))' &amp;gt; ~/tmp/emacs/cd.el&#xA;$ cd /tmp&#xA;$ emacs -q -l ~/tmp/emacs/cd.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then from inside &lt;code&gt;emacs&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Launch the ansi terminal and accept the default shell&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x ansi-term C-m C-m&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;print the current working directory from inside the terminal&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ pwd&#xA;/tmp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expected working directory to be &lt;code&gt;$HOME&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="8921" LastActivityDate="2016-11-11T13:03:12.113" Title="Change Emacs home directory for all purposes" Tags="|directories|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27021" PostTypeId="1" CreationDate="2016-09-12T03:26:12.583" Score="3" ViewCount="246" Body="&lt;p&gt;I want to create a buffer where some parts are editable, but others are not. I'm using the &lt;code&gt;read-only&lt;/code&gt; string property to do this, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (get-buffer-create &quot;*scratch-demo*&quot;)&#xA;  (insert &quot;;; you can edit me\n&quot;)&#xA;  (insert (propertize&#xA;           &quot;;; but you cannot edit me\n&quot;&#xA;           'read-only t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I paste the second line into a buffer in fundamental mode, I can edit it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;this buffer is in fundamental mode&#xA;;; but you cannot *foo* edit me&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I paste the second line into an emacs-lisp-mode buffer, I cannot edit it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; this buffer is in emacs-lisp-mode&#xA;;; I cannot modify the line below:&#xA;;; but you cannot edit me&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I ensure users can edit text, which has been yanked from read-only portions of my buffer?&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-11-11T16:11:14.163" Title="How can I edit read-only text after pasting?" Tags="|text-properties|read-only-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27022" PostTypeId="1" AcceptedAnswerId="27023" CreationDate="2016-09-12T04:30:08.513" Score="2" ViewCount="1260" Body="&lt;p&gt;I'd like to be able to type unicode characters like Π using agda-mode's &quot;\Pi&quot;. In Emacs, I used to configure this like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file (let ((coding-system-for-read 'utf-8))&#xA;                (shell-command-to-string &quot;agda-mode locate&quot;)))&#xA;(require 'agda-input); for unicode input via latex names like \forall.&#xA;(add-hook 'evil-insert-state-entry-hook (lambda () (set-input-method &quot;Agda&quot;)))&#xA;(add-hook 'evil-insert-state-exit-hook (lambda () (set-input-method nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Spacemacs, I've enabled the &lt;code&gt;agda&lt;/code&gt; layer (which has nicely found my Homebrew agda installation without addition configuration, thanks). I am able to type &quot;\Pi&quot; in &lt;code&gt;.agda&lt;/code&gt; files an it works. However, it is not available in other modes.&lt;/p&gt;&#xA;" OwnerUserId="12046" LastActivityDate="2017-10-07T14:09:37.190" Title="How do I enable agda-mode's unicode input mode across all modes in Spacemacs?" Tags="|spacemacs|unicode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27023" PostTypeId="2" ParentId="27022" CreationDate="2016-09-12T04:36:59.400" Score="3" Body="&lt;p&gt;Adding the hooks to the &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; function seems work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA;This function is called at the very end of Spacemacs initialization after&#xA;layers configuration.&#xA;This is the place where most of your configurations should be done. Unless it is&#xA;explicitly specified that a variable should be set before a package is loaded,&#xA;you should place your code here.&quot;&#xA;  (add-hook 'evil-insert-state-entry-hook (lambda () (set-input-method &quot;Agda&quot;)))&#xA;  (add-hook 'evil-insert-state-exit-hook (lambda () (set-input-method nil)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let me know if there's a better way.&lt;/p&gt;&#xA;" OwnerUserId="12046" LastActivityDate="2016-09-12T04:36:59.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27024" PostTypeId="2" ParentId="27021" CreationDate="2016-09-12T04:39:29.843" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't see the problem you mention.  Maybe I miss the recipe. I did this, in a session from &lt;code&gt;emacs -Q&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a. In buffer &lt;code&gt;*scratch*&lt;/code&gt; I typed your code and evaluated it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b. I visited buffer &lt;code&gt;*scratch-demo*&lt;/code&gt;.  The text of the second line was read-only (could not modify it).  I copied the text there using &lt;code&gt;M-w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c. I visited a buffer in Emacs Lisp mode and yanked the copied text, using &lt;code&gt;C-y&lt;/code&gt;.  I had no problem modifying the yanked text, including the part from the read-only portion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d. I did the same thing in a buffer in Fundamental mode - same effect.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you have trouble with this kind of thing, have a look at function &lt;code&gt;insert-for-yank&lt;/code&gt; and variables &lt;code&gt;yank-handled-properties&lt;/code&gt; and &lt;code&gt;yank-excluded-properties&lt;/code&gt;, to get the properties you want and not get the properties you do not want, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also functions &lt;code&gt;remove-yank-excluded-properties&lt;/code&gt; and &lt;code&gt;insert-buffer-substring-as-yank&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Yanking.html&quot; rel=&quot;nofollow&quot;&gt;Yanking&lt;/a&gt; for details.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="304" LastEditDate="2016-09-12T15:31:02.747" LastActivityDate="2016-09-12T15:31:02.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27025" PostTypeId="2" ParentId="27019" CreationDate="2016-09-12T05:21:59.740" Score="5" Body="&lt;p&gt;The problem is that &lt;code&gt;with-temp-buffer&lt;/code&gt; puts the buffer in a fundamental mode, and you are counting on it being in a Lisp mode, such as &lt;code&gt;emacs-lisp-mode&lt;/code&gt;. So comments and sexps are not what you are expecting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (emacs-lisp-mode)&#xA;  (insert src)&#xA;  (scan-sexps 12 1))&#xA;&#xA;;; =&amp;gt; 54&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="1982" LastEditDate="2016-09-12T06:51:38.253" LastActivityDate="2016-09-12T06:51:38.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27027" PostTypeId="1" AcceptedAnswerId="27183" CreationDate="2016-09-12T10:11:38.237" Score="1" ViewCount="2604" Body="&lt;p&gt;I have the following environment on my machine: Windows 7, emacs and aspell built with mingw. I am trying to use aspell for spell-checking in buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After i change language to russian (i have russian language files, with names such as ru.multi, ru-ye.multi etc.), i get the following error when running &lt;code&gt;ispell-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ispell-init-process: Error: The file&#xA;  &quot;&quot;c:/mingw_mine&quot;/lib/aspell-0.60/&quot;c:/mingw_mine&quot;/lib/aspell-0.60/russian&quot;&#xA;  can not be opened for reading&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My only configuration for ispell is: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;ispell command program name set to correct full path &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ispell-extra-args&lt;/code&gt; set to have &quot;--prefix=\&quot;c:/mingw_mine\&quot;&quot; in it&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Dictionaries are located under abovementioned prefix in &quot;lib/aspell-0.60&quot; subfolder. When invoked from command line with that prefix, aspell correctly finds and loads them (ex.: &lt;code&gt;aspell --prefix=&quot;c:/mingw_mine&quot; -d ru.multi check c:/text.txt&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i ensure aspell, invoked from emacs, can do that as well? &lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2016-09-19T12:00:43.000" Title="How to supply ispell program with dictionaries?" Tags="|ispell|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27028" PostTypeId="2" ParentId="17242" CreationDate="2016-09-12T11:40:01.983" Score="-1" Body="&lt;p&gt;The simplest way is probably to ensure the correct Perlbrew perl binary is used in the same way as usual for Perlbrew, and &lt;em&gt;then&lt;/em&gt; launch Emacs in that environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally that would be something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;perlbrew switch X&#xA;perlbrew use X&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;https://perlbrew.pl/&quot; rel=&quot;nofollow&quot;&gt;https://perlbrew.pl/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="944" LastActivityDate="2016-09-12T11:40:01.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27029" PostTypeId="1" AcceptedAnswerId="27031" CreationDate="2016-09-12T11:56:26.313" Score="2" ViewCount="4234" Body="&lt;p&gt;I'm new to Emacs. I needed to install the &lt;code&gt;elpy&lt;/code&gt; package for python (as described &lt;a href=&quot;http://chillaranand.github.io/emacs-py-ide/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;), but as I forgot to install one python package with &lt;code&gt;pip&lt;/code&gt;, the installation with &lt;code&gt;M-x package-install RET elpy&lt;/code&gt; failed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed the missing python package, but I can't restart the installation of elpy on emacs. It remembers the previous error and won't try reinstalling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I proceed ?&lt;/p&gt;&#xA;" OwnerUserId="13268" LastActivityDate="2016-09-12T12:43:20.490" Title="emacs: reinstall package after installation error" Tags="|package|elpy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27030" PostTypeId="2" ParentId="27020" CreationDate="2016-09-12T12:04:54.437" Score="1" Body="&lt;p&gt;The answer is easy if you consider that &lt;code&gt;default-directory&lt;/code&gt; (the variable returned by &lt;code&gt;pwd&lt;/code&gt;) is always buffer local and returns the default directory of the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the following addition, you can watch, what's going on:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cd (getenv &quot;HOME&quot;))&#xA;(message &quot;Current dir: %s&quot; (pwd))&#xA;(message &quot;Current buffer: %s&quot; (buffer-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Without any file loaded, the file will be executed in the context of the first buffer created and that's &lt;code&gt;*scratch*&lt;/code&gt;. After the initialization (and the file loaded with &lt;code&gt;-l&lt;/code&gt; belongs to this phase) a new buffer with the start message is created and this one doesn't get the &lt;code&gt;default-directory&lt;/code&gt; from the &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; &lt;code&gt;default-directory&lt;/code&gt; is per file and changes, when you call &lt;code&gt;ansi-term&lt;/code&gt; (or &lt;code&gt;pwd&lt;/code&gt;) with another buffer open. &lt;code&gt;cd&lt;/code&gt; only changes the &lt;code&gt;default-directory&lt;/code&gt; of the current buffer.&lt;/p&gt;&#xA;" OwnerUserId="934" LastActivityDate="2016-09-12T12:04:54.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27031" PostTypeId="2" ParentId="27029" CreationDate="2016-09-12T12:43:20.490" Score="3" Body="&lt;p&gt;Have you tried to delete elpy package from &lt;code&gt;M-x list-packages&lt;/code&gt;? You can do it by pressing &lt;code&gt;d&lt;/code&gt; on the elpy package, and then pressing &lt;code&gt;yes&lt;/code&gt; to confirm the action. If you already did that, you can go to &lt;code&gt;~/.emacs.d&lt;/code&gt; and delete the elpy folder created when you installed it. Hope this help you.&lt;/p&gt;&#xA;" OwnerUserId="13115" LastActivityDate="2016-09-12T12:43:20.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27032" PostTypeId="1" AcceptedAnswerId="27038" CreationDate="2016-09-12T13:11:38.597" Score="4" ViewCount="767" Body="&lt;p&gt;&lt;code&gt;next-line&lt;/code&gt; is very slow, and this is creating problems. I'll give some background then explain why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, linum.el treats a wrapped line as a single line, and it takes into account hidden lines when numbering. I need it to number visual lines only - i.e. it should ignore hidden lines, and count wrapped lines as multiple lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this is how it works by default:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 This is a line.&#xA;2 This is a long line which has been auto-wrapped&#xA; &amp;gt;by emacs.&#xA;3 This is another line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the behaviour I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 This is a line.&#xA;2 This is a long line which has been auto-wrapped&#xA;3&amp;gt;by emacs.&#xA;4 This is another line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have this behaviour working, but it's very slow. By default, linum.el uses &lt;code&gt;forward-line&lt;/code&gt; to number each line. This is the code that actually moves down by one line and increments the line counter:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((inhibit-point-motion-hooks t))&#xA;  (forward-line))&#xA;(setq line (1+ line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I modified it to use &lt;code&gt;next-line&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((inhibit-point-motion-hooks t))&#xA;  ;; (forward-line)&#xA;  (next-line))&#xA;(setq line (1+ line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works, but &lt;code&gt;next-line&lt;/code&gt; is very slow in comparison to &lt;code&gt;forward-line&lt;/code&gt;. Line numbers must be updated frequently so this slows down Emacs considerably. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't actually &lt;em&gt;need&lt;/em&gt; to number every line. I am happy to use &lt;code&gt;forward-line&lt;/code&gt; and number only the beginning of lines, as so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 This is a line.&#xA;2 This is a long line which has been auto-wrapped&#xA; &amp;gt;by emacs.&#xA;4 This is another line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if I want to do this, I need to be able to check how many &lt;em&gt;screen&lt;/em&gt; lines I moved when I called &lt;code&gt;forward-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any ideas on how to solve this?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="253" LastEditDate="2016-09-12T17:18:35.700" LastActivityDate="2017-03-12T01:54:18.230" Title="How can I move by screen lines as quickly as forward-line?" Tags="|motion|linum-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27033" PostTypeId="2" ParentId="26374" CreationDate="2016-09-12T14:00:18.580" Score="5" Body="&lt;p&gt;It's super rough, but I managed to get a very, very basic integration working last night. Hope it is useful: &lt;a href=&quot;https://github.com/stig/ob-applescript.el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/stig/ob-applescript.el&lt;/a&gt; -- that should at least give you something to work with.&lt;/p&gt;&#xA;" OwnerUserId="10625" LastActivityDate="2016-09-12T14:00:18.580" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27034" PostTypeId="1" AcceptedAnswerId="27044" CreationDate="2016-09-12T14:42:30.863" Score="3" ViewCount="592" Body="&lt;p&gt;I try to set a new hex-color to highlight the current line in the distinguished theme, but this can have no effects. I put this in init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;highlight current LINE&#xA;(global-hl-line-mode 1)&#xA;(set-face-background 'hl-line &quot;#47310D&quot;)&#xA;(set-face-foreground 'highlight nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can i change the color of the current line?&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastEditorUserId="105" LastEditDate="2016-09-12T18:27:20.723" LastActivityDate="2016-09-12T18:27:20.723" Title="Can't change the line-highlight color" Tags="|themes|highlighting|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27035" PostTypeId="1" CreationDate="2016-09-12T14:48:18.297" Score="1" ViewCount="100" Body="&lt;p&gt;I want to enable pabbrev-mode for the auto completion only in normal text file (&lt;code&gt;.txt&lt;/code&gt;) because if for example I'm editing a &lt;code&gt;.c&lt;/code&gt; source file I already have a package that do this. How can I modify the &lt;code&gt;.emacs&lt;/code&gt; file to proper handle this issue? Or is there another package that only works on text file?&lt;/p&gt;&#xA;" OwnerUserId="13269" LastEditorUserId="675" LastEditDate="2016-09-12T18:57:53.880" LastActivityDate="2016-11-11T20:12:05.007" Title="How to enable pabbrev-mode only in normal text file" Tags="|completion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27036" PostTypeId="1" CreationDate="2016-09-12T15:33:32.320" Score="1" ViewCount="1238" Body="&lt;p&gt;I would like to enable &lt;code&gt;show-paren-mode&lt;/code&gt; in my configuration file &lt;code&gt;init.el&lt;/code&gt;, which is very convenient for debugging.&#xA;As it is a minor mode as I've understood, I don't know how to proceed.&lt;/p&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="7118" LastEditDate="2021-12-24T13:57:39.903" LastActivityDate="2021-12-24T13:57:39.903" Title="enable show-paren-mode in init.el" Tags="|init-file|balanced-parentheses|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27037" PostTypeId="2" ParentId="27036" CreationDate="2016-09-12T15:48:36.660" Score="4" Body="&lt;p&gt;I think &lt;code&gt;(show-paren-mode 1)&lt;/code&gt; should do the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also try &lt;code&gt;highlight-parentheses-mode&lt;/code&gt; if you want to highlight the cursor's current scope.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my config:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(use-package highlight-parentheses&#xA;   :ensure t&#xA;   :pin melpa&#xA;   :config &#xA;   (setq hl-paren-background-colors '(&quot;orangered4&quot;))&#xA;   (setq hl-paren-colors '(&quot;black&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-09-12T15:48:36.660" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27038" PostTypeId="2" ParentId="27032" CreationDate="2016-09-12T15:51:57.023" Score="2" Body="&lt;p&gt;After delving into the source for &lt;code&gt;next-line&lt;/code&gt;, I found a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;line-move-visual&lt;/code&gt; is the command I want. &lt;code&gt;next-line&lt;/code&gt; is an interactive command with side effects that does a lot of unnecessary things, &lt;code&gt;line-move-visual&lt;/code&gt; has the core behaviour I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the relevant passage after modification:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((inhibit-point-motion-hooks t))&#xA;  ;; (forward-line)&#xA;  (line-move-visual 1 t))&#xA;(setq line (1+ line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the full spec for the command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(line-move-visual ARG &amp;amp;optional NOERROR)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suppressing errors is necessary to prevent it dinging when it reaches the end of a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some testing it's still a lot slower than forward-line, but it's fast enough to be usable if I delay updates until I'm idling.&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2016-09-12T22:18:25.523" LastActivityDate="2016-09-12T22:18:25.523" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27039" PostTypeId="1" AcceptedAnswerId="27040" CreationDate="2016-09-12T16:07:59.810" Score="11" ViewCount="12865" Body="&lt;p&gt;I just started using emacs and since I have been using Sublime Text for a while, I am used to the four-grid-layout with 4 windows stacked horizontally and vertically. I have been able to split the screen horizontally only. How do I split it 4 ways?&lt;/p&gt;&#xA;" OwnerUserId="13270" LastActivityDate="2016-09-12T16:43:56.133" Title="Can I split emacs the window 4 ways (vertically and horizontally) in a 4 grid layout with different files in each?" Tags="|window|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27040" PostTypeId="2" ParentId="27039" CreationDate="2016-09-12T16:14:35.473" Score="15" Body="&lt;p&gt;To split the window in half with a vertical divider, use the command &lt;code&gt;split-window-right&lt;/code&gt;. To split it in half with a horizontal divider, use the command &lt;code&gt;split-window-below&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, assume we have this window by default:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.-------------.&#xA;|             |&#xA;|             |&#xA;|             |&#xA;|             |&#xA;|             |&#xA;'-------------'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x split-window-right RET&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.-------------.&#xA;|      |      |&#xA;|      |      |&#xA;|      |      |&#xA;|      |      |&#xA;|      |      |&#xA;'-------------'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x split-window-below RET&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.-------------.&#xA;|             |&#xA;|             |&#xA;|-------------|&#xA;|             |&#xA;|             |&#xA;'-------------'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;split-window-right&lt;/code&gt; is bound to &lt;code&gt;C-x 3&lt;/code&gt; by default. &lt;code&gt;split-window-below&lt;/code&gt; is bound to &lt;code&gt;C-x 2&lt;/code&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ErgoEmacs has &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_winner_mode.html&quot; rel=&quot;noreferrer&quot;&gt;a good guide&lt;/a&gt; on window management and navigation, including how to save a specific arrangement (e.g. a 4-way split) and load it automatically.&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-12T16:14:35.473" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27042" PostTypeId="2" ParentId="27039" CreationDate="2016-09-12T16:43:56.133" Score="9" Body="&lt;p&gt;Use the split-window-xxx commands, as described in another answer. If you always want a grid of 4 windows, here's a command you could use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun split-4-ways ()&#xA;  (interactive)&#xA;  (delete-other-windows)&#xA;  (split-window-right)&#xA;  (split-window-below)&#xA;  (windmove-right)&#xA;  (split-window-below)&#xA;  (windmove-left))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-09-12T16:43:56.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27043" PostTypeId="1" CreationDate="2016-09-12T17:11:12.693" Score="0" ViewCount="512" Body="&lt;p&gt;I am trying to run flycheck with c++-code which imports the &lt;em&gt;thread&lt;/em&gt; library. &lt;em&gt;thread&lt;/em&gt; requires -std=c++11 which is not used with the c/c++-gcc setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to add this flag or to solve this in a some other way?&lt;/p&gt;&#xA;" OwnerUserId="10061" LastActivityDate="2016-09-16T06:31:26.947" Title="Add flags for the compiler used by flycheck" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27044" PostTypeId="2" ParentId="27034" CreationDate="2016-09-12T17:24:23.117" Score="2" Body="&lt;p&gt;When you put your code before &lt;code&gt;load-theme&lt;/code&gt;, loading theme could change value of this variable.  Put your code after &lt;code&gt;load-theme&lt;/code&gt; in your &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-09-12T17:24:23.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27045" PostTypeId="1" CreationDate="2016-09-12T17:45:06.857" Score="1" ViewCount="87" Body="&lt;p&gt;How can I add spacing where there are linebreaks in the file, but not where a line is word-wrapped? This would be very useful for reading log files with long lines. Here's a mockup of what I'm after:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yvT3k.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yvT3k.png&quot; alt=&quot;Log file with large spacing between physical lines&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a variable called &lt;code&gt;line-spacing&lt;/code&gt;, but it controls the spacing between all display lines:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZdB7b.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZdB7b.png&quot; alt=&quot;Buffer with large &amp;lt;code&amp;gt;line-spacing&amp;lt;/code&amp;gt;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19" LastActivityDate="2016-09-12T17:45:06.857" Title="Increase spacing between physical lines only" Tags="|display|whitespace|line-break|wrapping|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27046" PostTypeId="2" ParentId="27035" CreationDate="2016-09-12T18:02:22.270" Score="-1" Body="&lt;p&gt;Add this to your init (&lt;code&gt;.emacs&lt;/code&gt;) file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.txt\\'&quot; . pabbrev-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="675" LastActivityDate="2016-09-12T18:02:22.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27047" PostTypeId="1" CreationDate="2016-09-12T19:21:06.943" Score="3" ViewCount="404" Body="&lt;p&gt;Recently at work (a small academic department, absolutely no Emacs support) we upgraded from Emacs version 21.3.1 to 24.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In version 21 marking a region with the mouse will put the highlighted text into the kill-ring. Highlighting another region and yanking would insert the previously highlighted text while saving the recent highlight to the kill-ring. You could continue this &quot;alternating replacing&quot; indefinitely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot recreate this behavior in version 24 even by changing the .emacs like done in this page: &lt;a href=&quot;https://www.emacswiki.org/emacs/CopyAndPaste&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/CopyAndPaste&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-select-enable-primary t)&#xA;(setq x-select-enable-clipboard nil)&#xA;(delete-selection-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Highlighting the text in version 24 with the mouse seems to just put it into the primary selection but not into the kill-ring until I yank, but then it doesn't produce the inserting alternating text behavior as in version 21, which is desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also looked into this page &lt;a href=&quot;https://www.emacswiki.org/emacs/Comments_on_CopyAndPaste&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/Comments_on_CopyAndPaste&lt;/a&gt; but there are many proposed solution and I haven't had the time to see which one would approximate the above mentioned behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="13191" LastActivityDate="2016-09-12T19:21:06.943" Title="How do I get the highlight region mouse and yank functionality work like Emacs 21.3 in a newer version?" Tags="|copy-paste|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27048" PostTypeId="1" AcceptedAnswerId="27056" CreationDate="2016-09-12T20:00:54.987" Score="1" ViewCount="39" Body="&lt;p&gt;I'd like to close all Tramp buffers in one fell swoop. Is it possible to narrow on Tramp buffers only when invoking &lt;code&gt;helm-buffers-list&lt;/code&gt;? I've tried various suggestions offered in Helm Help, but cannot narrow in on all Tramp buffers only.&lt;/p&gt;&#xA;" OwnerUserId="8424" LastActivityDate="2016-09-13T07:00:25.653" Title="Narrowing on Tramp Buffers Only When Using helm-buffers-list" Tags="|helm|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27049" PostTypeId="2" ParentId="27027" CreationDate="2016-09-12T23:57:32.577" Score="0" Body="&lt;p&gt;change environment variable LC_ALL to ru_RU.UTF-8&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use use Emacs inside msys shell, in your~/.bash_profiler, insert below line,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export LC_ALL=ru_RU.UTF-8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use windows native Emacs, insert below code into your ~/.emacs,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;LC_ALL&quot; &quot;ru_RU.UTF-8&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Either way, remove your &lt;code&gt;--prefix&lt;/code&gt; settings in &lt;code&gt;ispell-extra-args&lt;/code&gt; settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could run &lt;code&gt;aspell config&lt;/code&gt; to know where aspell to look up dictionaries and copy your dictionaries there.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-09-19T12:00:43.000" LastActivityDate="2016-09-19T12:00:43.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27050" PostTypeId="1" AcceptedAnswerId="27071" CreationDate="2016-09-13T00:17:58.003" Score="4" ViewCount="445" Body="&lt;p&gt;I have used emacs for several years now and wanted to make the leap to daemon mode and using emacsclient.&#xA;What has prevented me so far is getting ride(closing) of buffers opend via emacsclient.&#xA;Note that with the examples below the daemon was already started with emacs --daemon&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First problem is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open a file via shell with &quot;emacsclient -q -c a.txt&quot;&lt;/li&gt;&#xA;&lt;li&gt;open a b.txt from inside emacsclient via &quot;C-x C-f b.txt&quot;&lt;/li&gt;&#xA;&lt;li&gt;executing &quot;C-x #&quot; in buffer b.txt switches to buffer a.txt, but does not close buffer &quot;b.txt&quot;&lt;/li&gt;&#xA;&lt;li&gt;executing &quot;C-x #&quot; in buffer a.txt closes the client frame and kills buffer a.txt, but buffer b.txt remains open (runnig afterwards &quot;emacsclient -q -c&quot; and checking Ibuffer will show buffer b.txt as available.)&lt;/li&gt;&#xA;&lt;li&gt;I can only get rid of b.txt by going into its buffer and executing &quot;C-x k&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first question is how can I get rid of b.txt by simply closing the frame which opened it via &quot;C-x C-f&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second problem is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open a file via shell with &quot;emacsclient -q -c a.txt&quot;&lt;/li&gt;&#xA;&lt;li&gt;open a file via shell with &quot;emacsclient -q b.txt&quot;&lt;/li&gt;&#xA;&lt;li&gt;when being in buffer a.txt, executing &quot;C-x #&quot; closes buffer a.txt AND KILLS the frame, but buffer b.txt remains open (runnig afterwards &quot;emacsclient -q -c&quot; and checking Ibuffer will show buffer b.txt as available.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the same holds when executing &quot;C-x C-c&quot;, a.txt is closed, b.txt remains open&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;only when running &quot;C-x #&quot; first in buffer b.txt and then in buffer a.txt will keep the frame open until both buffers are closed&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The second question is therefore similar to the first: how can I close all buffers associated to a frame by executing &quot;C-x C-c&quot;, and, in case I use &quot;C-x #&quot; how can I keep the frame alive until the last buffer associated to it is close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea or suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="13274" LastActivityDate="2016-09-14T13:53:37.960" Title="emacsclient, c-x #, c-x c-f and other confusion" Tags="|buffers|emacsclient|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27051" PostTypeId="1" AcceptedAnswerId="27053" CreationDate="2016-09-13T00:54:01.537" Score="1" ViewCount="1003" Body="&lt;p&gt;In Vim there is the &lt;code&gt;virtualedit&lt;/code&gt; variable which can be set so that Vim allows the cursor to move past the end of the line always or only when in visual block mode. Is it possible to configure Emacs to do at least one of these?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;picture-mode&lt;/code&gt; is not what I'm looking for because it inserts actual spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on Emacs 24.5 (from the Ubuntu package).&lt;/p&gt;&#xA;" OwnerUserId="13275" LastActivityDate="2016-09-13T23:03:53.440" Title="Virtual space for rectangular selections (at least)" Tags="|whitespace|rectangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27052" PostTypeId="1" CreationDate="2016-09-13T01:39:26.190" Score="3" ViewCount="296" Body="&lt;p&gt;there is a .dir-locals in parent directory&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil (global-auto-revert-ignore-buffer . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and there is a .dir-locals in current directory&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil (tags-file-name &quot;TAGS&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when I visit files in current directory only tags-file-name directory variable are applied. but when I visit another subdirectory without .dir-locals, global-auto-revert-ignore-buffer are applied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could apply both directory variables in current directory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5292" LastActivityDate="2016-09-13T03:00:17.630" Title="how to apply parent directory and current directory variable together" Tags="|directory-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27053" PostTypeId="2" ParentId="27051" CreationDate="2016-09-13T02:43:02.700" Score="3" Body="&lt;p&gt;A common solution in general is to use &lt;code&gt;artist-mode&lt;/code&gt; (I'm even wondering whether you accidentally tried &lt;code&gt;picture-mode&lt;/code&gt; instead of this?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs 25, &lt;code&gt;rectangle-mark-mode&lt;/code&gt; has been improved such that you can do this by default, after invoking that with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;SPC&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For usage details, see &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Rectangles&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs 24 the &lt;code&gt;cua-selection-mode&lt;/code&gt; rectangle editing (see &lt;a href=&quot;https://stackoverflow.com/a/11009599&quot;&gt;this&lt;/a&gt;) allows you to extend the rectangle selection beyond the end of the lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read the commentary in &lt;code&gt;cua-base.el&lt;/code&gt; for the documentation on &quot;CUA rectangle support&quot;.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-13T23:03:53.440" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27054" PostTypeId="2" ParentId="27052" CreationDate="2016-09-13T02:53:41.427" Score="3" Body="&lt;p&gt;No, there is no provision (at least as at Emacs 24.5) for additionally continuing to look for and process ancestor &lt;code&gt;.dir-locals.el&lt;/code&gt; files after a nearer one has been located.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if it makes sense for your scenario, you can remove your &quot;current directory&quot; file and specify &lt;em&gt;all&lt;/em&gt; the variables in the parent &lt;code&gt;.dir-locals.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keys which are strings specify sub-directories; and the variables beneath that are set &lt;em&gt;in addition to&lt;/em&gt; (or perhaps overriding) the ones in the top-level specifications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Directory Variables&lt;/code&gt;, which provides the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;     ((nil . ((indent-tabs-mode . t)&#xA;              (fill-column . 80)))&#xA;      (c-mode . ((c-file-style . &quot;BSD&quot;)&#xA;                 (subdirs . nil)))&#xA;      (&quot;src/imported&quot;&#xA;       . ((nil . ((change-log-default-name&#xA;                   . &quot;ChangeLog.local&quot;))))))&#xA;&#xA;This sets ‘indent-tabs-mode’ and ‘fill-column’ for any file in the&#xA;directory tree, and the indentation style for any C source file.  The&#xA;special ‘subdirs’ element is not a variable, but a special keyword which&#xA;indicates that the C mode settings are only to be applied in the current&#xA;directory, not in any subdirectories.  Finally, it specifies a different&#xA;‘ChangeLog’ file name for any file in the ‘src/imported’ subdirectory.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-09-13T03:00:17.630" LastActivityDate="2016-09-13T03:00:17.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27055" PostTypeId="2" ParentId="26926" CreationDate="2016-09-13T02:57:08.960" Score="3" Body="&lt;p&gt;Although &lt;code&gt;bind-keys&lt;/code&gt; can't do this, &lt;code&gt;bind-key&lt;/code&gt; can:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key &quot;ESC M-s&quot; search-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-09-13T02:57:08.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27056" PostTypeId="2" ParentId="27048" CreationDate="2016-09-13T07:00:25.653" Score="1" Body="&lt;p&gt;Not using &lt;code&gt;helm&lt;/code&gt;, but there is &lt;code&gt;M-x tramp-cleanup-all-buffers&lt;/code&gt;. It closes all remote buffers, including the hidden connection buffers.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-09-13T07:00:25.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27058" PostTypeId="2" ParentId="19409" CreationDate="2016-09-13T11:08:45.037" Score="6" Body="&lt;p&gt;From the &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#closing-outline-sections&quot;&gt;Org-mode FAQ&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The short answer to the question is no. Org-mode adheres to the cascading logic of outlines, in which a section is closed only by another section that occupies an equal or greater level.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The FAQ suggests a few workarounds that may or may not work for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also &lt;a href=&quot;https://github.com/noorul/org-mode/blob/master/contrib/lisp/ox-extra.el&quot;&gt;ignore headings&lt;/a&gt; to use in your exports, which would ignore a tagged headline but would cause its children to be promoted by one, so I'm not entirely sure if it's worth it.&lt;/p&gt;&#xA;" OwnerUserId="13231" LastActivityDate="2016-09-13T11:08:45.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27059" PostTypeId="2" ParentId="27016" CreationDate="2016-09-13T13:59:08.230" Score="1" Body="&lt;p&gt;Looks like a font issue. Specifically, your second computer doesn't have the same font set as hte first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put cursor on a character and call describe-char. It'll tell you what font is used to display that character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in emacs, you can eval this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(print (font-family-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to see what fonts is available to emacs.&#xA;To eval the code, select it and M-x eval-region.&#xA;Press C-h e to go to the &lt;em&gt;Messages&lt;/em&gt; buffer to see full output.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-09-13T13:59:08.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27060" PostTypeId="1" AcceptedAnswerId="27065" CreationDate="2016-09-13T16:17:14.580" Score="11" ViewCount="3689" Body="&lt;p&gt;The goal is to make a self-contained html file when exporting from orgmode so that the images are intrinsic to the file and a single html file will can be distributed (I am trying to do this for a class I teach and want to give students a single html they can open in a browser).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a snippet of code on line that gives the idea of what I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :results output html :exports results&#xA;with open('/home/britt/Pictures/Britt0001.jpg', 'rb') as image:&#xA;    data = image.read()&#xA;    print '&amp;lt;img src=&quot;data:image/jpg;base64,%s&quot;&amp;gt;' % data.encode(&quot;base64&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I am trying to get it into elisp and thus remove the dependancy on python and as a step to creating my own elisp function that could have some more detail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have gotten to. Advice appreciated. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_src elisp :results output html :exports results&#xA;    (setq myim (concat &quot;&amp;lt;img src=\\&quot;data:image/jpg;base64,&quot; (tob64 &quot;/home/britt/Pictures/Britt0001.jpg&quot;) &quot;&amp;gt;&quot;))&#xA;     (print myim)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and where &lt;code&gt;tob64&lt;/code&gt; is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tob64 (filename)&#xA;  (base64-encode-string&#xA;   (with-temp-buffer&#xA;     (insert-file-contents filename)&#xA;     (buffer-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't give the correct formatting and quoting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal to be worked toward is some variant of &lt;code&gt;org-html-export-to-html&lt;/code&gt; where the elisp function could live and be invoked when an option like  &lt;code&gt;#+OPTIONS: embed-images-on-html-export:t&lt;/code&gt; was invoked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And as an aside, why doesn't the functionality of exporting to html with embedded images already exist in org-mode? Is there some bigger issue that makes this problematic for me to be working towards?&lt;/p&gt;&#xA;" OwnerUserId="8231" LastEditorUserId="253" LastEditDate="2016-09-13T16:33:15.977" LastActivityDate="2020-05-29T20:22:46.960" Title="Embed Image as Base64 on HTML export from Orgmode" Tags="|org-mode|images|html|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27061" PostTypeId="1" CreationDate="2016-09-13T17:06:48.290" Score="2" ViewCount="1677" Body="&lt;p&gt;I'm transitioning from emacs to spacemacs. In emacs I use &lt;a href=&quot;https://www.emacswiki.org/emacs/NeoTree&quot; rel=&quot;nofollow&quot;&gt;neotree&lt;/a&gt; to have a nice sidebar where I can explore my files. I like it on the right side, so inside my &lt;code&gt;custom-set-variables&lt;/code&gt; within my init file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(neo-window-position (quote right))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT, with spacemacs things are different. I wrote that line inside my &lt;code&gt;dotspacemacs/user-config()&lt;/code&gt; and nothing happens, when I hit &lt;code&gt;SPC f t&lt;/code&gt; neotree still appears on the left side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you help me to get it shown on the right? It's almost the only thing I need to feel comfortable working with spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you so much. :)&lt;/p&gt;&#xA;" OwnerUserId="12317" LastActivityDate="2019-07-14T17:34:55.537" Title="How to move spacemacs neotree window position to the right?" Tags="|spacemacs|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27062" PostTypeId="2" ParentId="26945" CreationDate="2016-09-13T17:36:56.253" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/nflath/c-eldoc&quot; rel=&quot;nofollow&quot;&gt;c-eldoc-mode&lt;/a&gt; might help a bit. I am not sure why spacemacs doesn't include it in the c-c++ layer. I submitted a feature request for this so maybe they will in the future.&lt;/p&gt;&#xA;" OwnerUserId="12507" LastActivityDate="2016-09-13T17:36:56.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27063" PostTypeId="2" ParentId="26858" CreationDate="2016-09-13T19:41:43.200" Score="6" Body="&lt;p&gt;You can embed &quot;raw&quot; html as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;p align=&quot;center&quot;&amp;gt;&amp;lt;img src=&quot;images/wim-128.png&quot; /&amp;gt;&amp;lt;/p&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When displayed on GitHub.com, for some reason org-mode's image styling directives are ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However GitHub does not ignore styling of &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags, so I used the above fix.&lt;/p&gt;&#xA;" OwnerUserId="10036" LastEditorUserId="-1" LastEditDate="2018-05-17T17:51:28.953" LastActivityDate="2018-05-17T17:51:28.953" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="27064" PostTypeId="1" AcceptedAnswerId="27066" CreationDate="2016-09-13T21:34:49.497" Score="3" ViewCount="548" Body="&lt;p&gt;What Emacs utilities can provide better browsing and navigation of &lt;a href=&quot;https://en.wikipedia.org/wiki/ReStructuredText&quot; rel=&quot;nofollow&quot;&gt;reST&lt;/a&gt; documents? Alternatively, how to configure existing utilities to work with reST? What I mean, why I ask:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of the lightweight markups I lately mostly compose reST &lt;strong&gt;[1]&lt;/strong&gt;, and of course I do so with God's Own Editor (currently version='GNU Emacs 24.4.1' as packaged for Debian stable). Some of my reST docs are rather large, hence I seek better ways to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;high-level-view reST doc sections. E.g., un/folding at section headings, or (better yet) providing a &lt;a href=&quot;http://cedet.sourceforge.net/speedbar.shtml&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;speedbar&lt;/code&gt;&lt;/a&gt;-like tree browser.&lt;/li&gt;&#xA;&lt;li&gt;navigate between doc sections. Again, &lt;code&gt;speedbar&lt;/code&gt; for reST would be great, but even an &lt;a href=&quot;https://www.emacswiki.org/emacs/OccurMode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;occur&lt;/code&gt;&lt;/a&gt;-like view would be helpful. (Unfortunately I lack sufficient multiline-regexp-fu to tell &lt;code&gt;occur&lt;/code&gt; how to match reST section headings--your assistance is appreciated!)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the otherwise-quite-useful &lt;a href=&quot;http://docutils.sourceforge.net/docs/user/emacs.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;rst-mode&lt;/code&gt;&lt;/a&gt; does not currently provide this functionality, though I am also pinging &lt;a href=&quot;http://docutils.sourceforge.net/docs/user/emacs.html#credits&quot; rel=&quot;nofollow&quot;&gt;its maintainer&lt;/a&gt; regarding this. It &lt;em&gt;does&lt;/em&gt; provide &lt;code&gt;rst-backward-section&lt;/code&gt; (&lt;code&gt;C-M-a&lt;/code&gt;) and &lt;code&gt;rst-forward-section&lt;/code&gt; (&lt;code&gt;C-M-e&lt;/code&gt;), but linear navigation is well short of what I want.&lt;/li&gt;&#xA;&lt;li&gt;When I &lt;code&gt;M-x speedbar&lt;/code&gt; from an &lt;code&gt;rst-mode&lt;/code&gt; buffer, I get basically an empty frame.&lt;/li&gt;&#xA;&lt;li&gt;When I &lt;code&gt;M-x imenu&lt;/code&gt; from an &lt;code&gt;rst-mode&lt;/code&gt; buffer, it seems only able to find the first-level headers. (Am I missing something?)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;set-selective-display&lt;/code&gt; (e.g., &lt;code&gt;M-1 C-x $&lt;/code&gt;) seems quite confused: it folds some sections and list items but not others, apparently at random (at least, I'm seeing no sense to it).&lt;/li&gt;&#xA;&lt;li&gt;As noted above, I don't know the correct regexp to give &lt;code&gt;occur&lt;/code&gt; to parse reST section heads.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[1]&lt;/strong&gt; except when on an SE site :-(&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="5444" LastEditDate="2016-09-14T05:28:23.577" LastActivityDate="2016-09-16T17:28:27.337" Title="browsing/navigating reStructuredText" Tags="|navigation|code-folding|occur|speedbar|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27065" PostTypeId="2" ParentId="27060" CreationDate="2016-09-13T23:53:32.647" Score="5" Body="&lt;p&gt;See &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2015/05/09/Another-approach-to-embedding-org-source-in-html/&quot; rel=&quot;noreferrer&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2015/05/09/Another-approach-to-embedding-org-source-in-html/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also find this: &lt;a href=&quot;https://github.com/KitchinHUB/kitchingroup-66/blob/master/manuscript.org#the-custom-export-code-labelexport-code&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/KitchinHUB/kitchingroup-66/blob/master/manuscript.org#the-custom-export-code-labelexport-code&lt;/a&gt; an interesting way to encode base64 data in html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your code works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results html :exports both&#xA;(defun tob64 (filename)&#xA;  (base64-encode-string&#xA;   (with-temp-buffer&#xA;     (insert-file-contents filename)&#xA;     (buffer-string))))&#xA;&#xA;(format &quot;&amp;lt;img src=\&quot;data:image/png;base64,%s\&quot;&amp;gt;&quot;&#xA;    (tob64 &quot;/Users/jkitchin/t.png&quot;))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;outputs a base64 encoded image I can see in the export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get this to work automatically in export, you probably want to use a function in org-export-before-processing-hook that will go through and replace your file links with an html block containing the output of a function like the one above.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-09-13T23:53:32.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27066" PostTypeId="2" ParentId="27064" CreationDate="2016-09-14T03:18:26.303" Score="2" Body="&lt;p&gt;&lt;code&gt;rst-toc&lt;/code&gt; can be used to navigate sections.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2016-09-14T03:18:26.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27067" PostTypeId="2" ParentId="26945" CreationDate="2016-09-14T05:12:28.897" Score="2" Body="&lt;p&gt;Spacemacs provides a help popup during completion through &lt;a href=&quot;https://github.com/expez/company-quickhelp/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;company-quickhelp&lt;/code&gt;&lt;/a&gt;, but you need to explicitly enable it, as described in the &lt;a href=&quot;http://spacemacs.org/layers/auto-completion/README.html&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; for auto-completion layer. What you need to do is set the layer variable &lt;code&gt;auto-completion-enable-help-tooltip&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. There are two good ways to change it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first way is to set the variable in the same place where you enable the auto-completion layer. In the &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt; list, replace:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;auto-completion&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(auto-completion :variables auto-completion-enable-help-tooltip t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second way is to set the variable in &lt;code&gt;dotspacemacs/user-init&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun dotspacemacs/user-init ()&#xA;  ;; ...&#xA;  (setq auto-completion-enable-help-tooltip t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-09-14T05:12:28.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27068" PostTypeId="1" CreationDate="2016-09-14T09:10:27.307" Score="2" ViewCount="375" Body="&lt;p&gt;When I'm editing a org-mode file, the structure of mine is like this(you may need configuration in init.el):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A section&#xA;  This is the content of the section&#xA;  #+BEGIN_SRC lang&#xA;    code here&#xA;  #+END_SRC&#xA;  ** A subsection&#xA;     This is the content of the subsection&#xA;* Another section&#xA;  This is the content of another section&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when when I'm editing a tex file using auctex, the structure of the tex file is this after I indented the whole buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\begin{document}&#xA;&#xA;\section{A section}&#xA;This is the content of the section.&#xA;&#xA;\begin{verbatim}&#xA;some verbatim text&#xA;\end{verbatim}&#xA;&#xA;\subsection{A subsection}&#xA;This is the content of the subsection&#xA;&#xA;\section{Another section}&#xA;This is the content of another section&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is not easy to view the whole structure, I know I can use &lt;strong&gt;C-c =&lt;/strong&gt; to view the toc, but how can I make it like org-mode such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\begin{document}&#xA;&#xA;  \section{A section}&#xA;    This is the content of the section.&#xA;&#xA;    \begin{verbatim}&#xA;      some verbatim text&#xA;    \end{verbatim}&#xA;&#xA;    \subsection{A subsection}&#xA;      This is the content of the subsection&#xA;&#xA;  \section{Another section}&#xA;    This is the content of another section&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, how can I indent the tex file (just using &lt;strong&gt;TAB&lt;/strong&gt; and &lt;strong&gt;ENTER&lt;/strong&gt; keys when editing it or indent the whole buffer using &lt;strong&gt;TAB&lt;/strong&gt; or indent command)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean, every block (section, subsection, &lt;strong&gt;EVERY&lt;/strong&gt; &lt;code&gt;\begin{}...\end{}&lt;/code&gt; pair no matter what is inside the {}) should be a part and should be in its place related to its parent? And the indent-level should be configurable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can do I do that? I googled a lot and found nothing useful.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="253" LastEditDate="2016-09-14T21:01:58.337" LastActivityDate="2016-09-14T21:01:58.337" Title="How to indent a tex file like org-mode?" Tags="|indentation|auctex|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27069" PostTypeId="2" ParentId="17242" CreationDate="2016-09-14T09:29:53.653" Score="1" Body="&lt;p&gt;These elisps may help you:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/kentaro/perlbrew.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/kentaro/perlbrew.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/dams/perlbrew-mini.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/dams/perlbrew-mini.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They seems to be pretty old, so please check them (I myself don't use perlbrew).&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-09-14T09:29:53.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27071" PostTypeId="2" ParentId="27050" CreationDate="2016-09-14T13:48:10.277" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;how can I get rid of b.txt by simply closing the frame which opened it via &quot;C-x C-f&quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun kill-buffer-plus-frame ()&#xA;  &quot;kill the current buffer plus current frame&quot;&#xA;  (interactive)&#xA;  (kill-buffer)&#xA;  (delete-frame))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function will kill the current buffer and delete the current frame. Keep in mind that the buffer visiting &lt;code&gt;a.txt&lt;/code&gt; is actually the buffer associated with that frame, so deleting that frame will also delete the buffer visiting &lt;code&gt;a.txt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;how can I close all buffers associated to a frame&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&quot;The only buffer associated with an emacsclient frame is the one that you opened with the original call to emacsclient. All other buffers, including the ones you opened after you started emacsclient, are treated the same.&quot; -- @Tyler's comment&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to close all buffers associated to a frame, by deleting the frame, maybe you should not use Emacs as daemon.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2016-09-14T13:53:37.960" LastActivityDate="2016-09-14T13:53:37.960" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27073" PostTypeId="1" CreationDate="2016-09-14T17:42:31.560" Score="4" ViewCount="291" Body="&lt;p&gt;I am referring the documentation for &lt;code&gt;truncate-string-to-width&lt;/code&gt; from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Size-of-Displayed-Text.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(truncate-string-to-width &quot;\tab\t&quot; 12 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will output,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ab&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what i get in my machine (emacs versioned 25.1.50.1) is one tab character with no alphabets printed. And similarly, when i do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;%s&quot;&#xA;                 (truncate-string-to-width &quot;\tab\t&quot; 12 4 ?\s))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my mac shows, one tab character plus six space chars. But the documentation quotes, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;⇒ &quot;    ab  &quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does &lt;code&gt;truncate-string-to-width&lt;/code&gt; truncate the alphabets in my machine?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2016-09-14T18:19:09.170" LastActivityDate="2016-09-14T18:19:09.170" Title="truncate-string-to-width doesn't pad/print the string, as documented" Tags="|string|table|" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27075" PostTypeId="1" CreationDate="2016-09-14T20:09:22.313" Score="2" ViewCount="63" Body="&lt;p&gt;I have two files &lt;code&gt;A.java&lt;/code&gt; (base class) and &lt;code&gt;B.java&lt;/code&gt; (class). The class &lt;code&gt;B&lt;/code&gt; succeed &lt;code&gt;A&lt;/code&gt;. In file &lt;code&gt;B.java&lt;/code&gt;, I compiled by &lt;code&gt;C-c C-v C-c&lt;/code&gt;, then it can not detect file &lt;code&gt;A.java&lt;/code&gt; with error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cannot find symbol&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it works well in compiling manually in terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when I try debugging in JDE, I only get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd: No such directory found via CDPATH environment variable in mini buffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess it is a path problem. I do not know how to fix this.&lt;/p&gt;&#xA;" OwnerUserId="13294" LastEditorUserId="675" LastEditDate="2016-09-15T00:06:24.327" LastActivityDate="2016-09-15T00:06:24.327" Title="JDEE can not detect multi file" Tags="|java|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27079" PostTypeId="1" AcceptedAnswerId="27587" CreationDate="2016-09-15T00:47:57.667" Score="2" ViewCount="184" Body="&lt;p&gt;I have had the issue that emacs will lock up (and need to be force quit)&#xA;on occasion when I minimize it.  I am almost always in org-mode, but&#xA;otherwise I can see any pattern, except that it happens while it is minimized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have scoured the world for a fix to this.  Does anyone know how to fix this, or at least how to figure out why it is happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on OSX 10.11 with Emacs 24.5&lt;/p&gt;&#xA;" OwnerUserId="13296" LastEditorUserId="253" LastEditDate="2016-09-15T01:31:20.573" LastActivityDate="2020-08-15T14:30:34.273" Title="Emacs freezes when minimizing frame on OSX" Tags="|osx|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27080" PostTypeId="2" ParentId="19849" CreationDate="2016-09-15T05:14:53.110" Score="1" Body="&lt;p&gt;This is how I start Emacs in shell, works with 24+, should also work with 25,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http_proxy=http://127.0.0.1:3128 https_proxy=http://127.0.0.1:3128 emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2016-09-15T06:16:50.303" LastActivityDate="2016-09-15T06:16:50.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27081" PostTypeId="1" AcceptedAnswerId="27082" CreationDate="2016-09-15T06:57:14.757" Score="0" ViewCount="103" Body="&lt;p&gt;I'd like to get a tooltip that says &quot;meow&quot;, whenever my mouse is on the word &quot;Cat&quot; in Emacs. I tried this snippet I put together, but didn't work. What's wrong with it?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-hi-lock ()&#xA;(interactive)&#xA;(highlight-regexp &quot;Cat&quot;  '(help-echo &quot;meow!&quot;))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to put the &lt;strong&gt;associated&lt;/strong&gt; tooltip message inside the highlight-regexp statement rather than define a font face at a different place because I won't reuse each tooltip message that I'm going to assign to different keywords. &lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-09-15T08:08:12.527" Title="tooltip in highlight-regexp" Tags="|tooltip|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27082" PostTypeId="2" ParentId="27081" CreationDate="2016-09-15T08:08:12.527" Score="1" Body="&lt;p&gt;&lt;code&gt;highlight-regexp&lt;/code&gt; seems to assume that the value is a symbol which is defined as a face, it doesn't work with lists. However, the function is just a wrapper around &lt;code&gt;font-lock-add-keywords&lt;/code&gt;, fortunately, you can call this function directly, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords&#xA; nil&#xA; '((&quot;Cat&quot; (0 '(face font-lock-warning-face help-echo &quot;meow!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set the &lt;code&gt;face&lt;/code&gt; property to &lt;code&gt;font-lock-warning-face&lt;/code&gt; (feel free to pick a better one, or use &lt;code&gt;nil&lt;/code&gt;) and the &lt;code&gt;help-echo&lt;/code&gt; property to &lt;code&gt;&quot;meow!&quot;&lt;/code&gt;. Note that the symbol &lt;code&gt;face&lt;/code&gt; must be the first entry in the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: If you do this, you must also put &lt;code&gt;help-echo&lt;/code&gt; into &lt;code&gt;font-lock-extra-managed-props&lt;/code&gt;, see the documentation of the variable &lt;code&gt;font-lock-keywords&lt;/code&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a concrete example, see &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-09-15T08:08:12.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27083" PostTypeId="1" AcceptedAnswerId="27093" CreationDate="2016-09-15T10:22:09.320" Score="0" ViewCount="466" Body="&lt;p&gt;I am using the &lt;a href=&quot;https://melpa.org/#/folding&quot; rel=&quot;nofollow&quot;&gt;folding minor mode&lt;/a&gt; in Emacs which I get installed with the following &lt;code&gt;use-package&lt;/code&gt; macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;  :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above works and ensures that &lt;code&gt;folding&lt;/code&gt; is installed whenever I fire up Emacs. However, when I visit a buffer with the folded marks ( &lt;code&gt;// {{{&lt;/code&gt; and &lt;code&gt;// }}}&lt;/code&gt;), the minor mode is not automatically loaded and I have to load it explicitly with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x folding-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I looked up the &lt;a href=&quot;https://melpa.org/#/folding&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; and saw that for the Folding mode to start automatically when a folded file is loaded you need to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (load &quot;folding&quot; 'nomessage 'noerror)&#xA;         (folding-mode-add-find-file-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, changing my &lt;code&gt;use-package&lt;/code&gt; macro to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;  :ensure t&#xA;  :config&#xA;  (if (load &quot;folding&quot; 'nomessage 'noerror)&#xA;      (folding-mode-add-find-file-hook))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; makes no difference. I still have to load folding mode manually with &lt;code&gt;M-x folding-mode&lt;/code&gt;. What gives?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Turns out that in addition to the accepted answer, I also had to add an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;nofollow&quot;&gt;Emacs file variable&lt;/a&gt; at the end of the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// {{{ folding-mode&#xA;&#xA;// Local Variables:&#xA;// folded-file: t&#xA;// End:&#xA;&#xA;// }}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But adding this editor-specific markup in every source file is too much for me. Is there a way to automatically always activate &lt;code&gt;folding-mode&lt;/code&gt; when visiting a buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;   :ensure t&#xA;   :config&#xA;     (folding-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; and:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;   :ensure t&#xA;   :config&#xA;     (setq 'folding-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; but none of the above is working.&lt;/p&gt;&#xA;" OwnerUserId="4003" LastEditorUserId="4003" LastEditDate="2016-09-17T22:02:09.377" LastActivityDate="2016-09-17T22:02:09.377" Title="loading the `folding` mode with `use-package`" Tags="|use-package|code-folding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27084" PostTypeId="1" AcceptedAnswerId="27085" CreationDate="2016-09-15T10:32:02.073" Score="2" ViewCount="693" Body="&lt;p&gt;According to &lt;a href=&quot;https://www.emacswiki.org/emacs/AutoPairs&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/AutoPairs&lt;/a&gt; the package &lt;code&gt;smartparens&lt;/code&gt; supports an electric pair of any length for example &lt;code&gt;\{&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question about the possibility that the built-in &lt;code&gt;electric-pair-mode&lt;/code&gt; can do it. I tried this without success:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA;              (lambda ()&#xA;                (define-key LaTeX-mode-map &quot;\\{&quot; 'electric-pair)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2016-09-15T13:46:38.053" LastActivityDate="2016-09-15T13:46:38.053" Title="electric pair of any length, using AUCTex" Tags="|auctex|electric-pair-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27085" PostTypeId="2" ParentId="27084" CreationDate="2016-09-15T11:04:28.783" Score="4" Body="&lt;p&gt;AUCTeX has a bultin support for &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Braces&quot; rel=&quot;nofollow&quot;&gt;pairing braces&lt;/a&gt;, and &lt;code&gt;\{...\}&lt;/code&gt; is in the default set of supported braces.  In order to enable this feature, just set &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#index-LaTeX_002delectric_002dleft_002dright_002dbrace&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;LaTeX-electric-left-right-brace&lt;/code&gt;&lt;/a&gt; to non nil, either with customize interface (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-variable&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;LaTeX-electric-left-right-brace&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;) or by adding the following line to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq LaTeX-electric-left-right-brace t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is much more advanced than any other generic mode for pairing braces, because it is able to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-tex prettyprint-override&quot;&gt;&lt;code&gt;\Bigl\{  →  \Bigl\{\Bigr\}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-09-15T11:04:28.783" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27086" PostTypeId="1" AcceptedAnswerId="27087" CreationDate="2016-09-15T12:35:25.293" Score="1" ViewCount="161" Body="&lt;p&gt;I am frequently running multiple Emacs servers. When I am in a particular client I sometimes want to check which Emacs server I am connected to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`C-h v`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; and the enter in the mini-buffer &lt;code&gt;server-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to define a keybinding that also includes the input that should be entered in the mini-buffer?&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2016-09-15T13:21:18.320" Title="how to define a key binding that includes input to the minibuffer?" Tags="|key-bindings|minibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27087" PostTypeId="2" ParentId="27086" CreationDate="2016-09-15T13:21:18.320" Score="1" Body="&lt;p&gt;Every key runs an Emacs command. You make an Emacs command (a special kind of function) then bind some key to it. For example, in your case, &lt;kbd&gt;C-h v&lt;/kbd&gt; runs the &lt;code&gt;describe-variable&lt;/code&gt; commands and takes &lt;code&gt;'server-name&lt;/code&gt; as its argument, thus you can make a command for your need using something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun describe-server-name ()&#xA;  (interactive)&#xA;  (describe-variable 'server-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can test this new command using &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;describe-server-name&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, if you are happy with it, you can bind some key (for example &lt;kbd&gt;C-h C-s&lt;/kbd&gt;) to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-h C-s&quot;) 'describe-server-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another way is using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html&quot; rel=&quot;nofollow&quot;&gt;(emacs) Keyboard Macros&lt;/a&gt;, I think minibuffer input is supported in vanilla Emacs. You can also fake the keyboard macro (which is a special kind of Emacs command) but I don't recommend this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-h C-s&quot;) (kbd &quot;C-h v server-name RET&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-09-15T13:21:18.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27088" PostTypeId="1" CreationDate="2016-09-15T14:32:54.917" Score="3" ViewCount="634" Body="&lt;p&gt;In an org-file, I have a table where I want one column to be exported verbatim:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|       Date | Rating | Comment    |&#xA;|------------+--------+------------|&#xA;| 2016-07-01 | ***    | so so      |&#xA;| 2016-07-08 | ****   | very good  |&#xA;| 2016-07-15 | *      | miserable! |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;rating&lt;/code&gt; column, consisting of a number (1-5) of stars, should be exported as verbatim or at least make the asterisks not be interpreted as &lt;strong&gt;bold&lt;/strong&gt;.  By default, the first and third line would be nearly indistinguishable in the exported pdf file (a bold asterisk versus a normal one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to mark the whole column so that it is exported in verbatim mode?  Preferably the solution would still look good in plain text/org-mode.&lt;/p&gt;&#xA;" OwnerUserId="6995" LastActivityDate="2016-09-16T04:18:02.860" Title="Org-mode: export table columns in verbatim mode" Tags="|org-mode|org-export|org-table|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27090" PostTypeId="2" ParentId="27088" CreationDate="2016-09-15T16:00:42.653" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;... should be exported as verbatim...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For org-tables you must /*/ format. Enter as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/*/ for one star&#xA;/**/ for two stars&#xA;and so on..&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Preferably the solution would still look good in plain text/org-mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After you tab out of the cell, the / will not display, which is clean for plain text viewing.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2016-09-15T16:00:42.653" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27092" PostTypeId="1" CreationDate="2016-09-15T18:28:37.413" Score="3" ViewCount="283" Body="&lt;p&gt;I use Emacs on both Linux and Windows to edit the same files (that I keep in Dropbox, which I hope is irrelevant, but who knows). The files are encoded in utf-8 with Unix line endings. Occasionally, I will notice that when editing them on Windows accented characters display incorrectly which I can correct by telling &lt;code&gt;M-x recode-region&lt;/code&gt; that the file was really in utf-8 but was interpreted as iso-latin-1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is Emacs incorrectly guessing my file is in iso-latin-1? Why does it only do that on Windows?&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-09-15T18:28:37.413" Title="Emacs keeps guessing wrong coding system on a file I edit both in Linux and Windows" Tags="|microsoft-windows|character-encoding|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27093" PostTypeId="2" ParentId="27083" CreationDate="2016-09-15T19:03:22.367" Score="1" Body="&lt;p&gt;Just do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;  :ensure t&#xA;  :config&#xA;  (folding-mode-add-find-file-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As to why, the &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (load &quot;folding&quot; 'nomessage 'noerror)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;bit is really saying &quot;try and load this package, and if it works invoke the next command&quot; (see help for &lt;code&gt;load&lt;/code&gt;). You take care of that using &lt;code&gt;use-package&lt;/code&gt; already, so you just need to call the next command directly in &lt;code&gt;:config&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the update, try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;  :ensure t&#xA;  :config&#xA;  (folding-install-hooks)&#xA;  (defun my-always-fold ()&#xA;    (setq-local folded-file t))&#xA;  (advice-add #'folding-mode-find-file :before #'my-always-fold))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That seems to work in my tests.&lt;/p&gt;&#xA;" OwnerUserId="9181" LastEditorUserId="9181" LastEditDate="2016-09-16T15:12:00.627" LastActivityDate="2016-09-16T15:12:00.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27094" PostTypeId="1" AcceptedAnswerId="33495" CreationDate="2016-09-15T19:50:54.723" Score="9" ViewCount="2239" Body="&lt;p&gt;In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for markdown mode to have active hyperlinks as well?&lt;/p&gt;&#xA;" OwnerUserId="2014" LastEditorUserId="2014" LastEditDate="2016-09-16T11:53:22.533" LastActivityDate="2021-04-04T16:47:22.890" Title="How to make hyperlinks clickable in markdown mode?" Tags="|org-mode|markdown-mode|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27095" PostTypeId="2" ParentId="17542" CreationDate="2016-09-15T21:13:40.403" Score="0" Body="&lt;p&gt;When you need it for a one-off (e.g. to try and test a recipe to reproduce a bug), you can often get away with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q -l ~/.emacs.d/elpa/&amp;lt;pkg&amp;gt;-&amp;lt;vers&amp;gt;/&amp;lt;pkg&amp;gt;-autoloads.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I said &quot;often&quot; because it will not pay attention to dependencies, so in some cases you'll need to add more of those &lt;code&gt;-l ...&lt;/code&gt; args to load the other packages that are needed.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-09-15T21:13:40.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27096" PostTypeId="1" AcceptedAnswerId="27098" CreationDate="2016-09-15T22:30:44.600" Score="0" ViewCount="238" Body="&lt;p&gt;I have a grep-like script that I run via &lt;code&gt;M-x grep&lt;/code&gt;, that changes its working directory, but outputs make-like &quot;Entering directory `/a/b/c/d'&quot; messages (to keep emacs informed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has worked fine for many years, but I recently (finally) upgraded to a new Emacs, and grep-mode no longer supports matching these magic strings in the output of the grep command (see &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8895&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8895&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This manifests as hitting &lt;code&gt;next-error&lt;/code&gt; to go to the fine and line of the hit, and getting prompted by emacs about where to find the file since its confused about what the relative path is relative to.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get my &quot;Entering directory&quot; messages to be honored again?&lt;/p&gt;&#xA;" OwnerUserId="2000" LastActivityDate="2017-07-13T04:08:35.270" Title="How to enable &quot;Entering Directory&quot; matching in grep output?" Tags="|compilation-mode|grep|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27097" PostTypeId="2" ParentId="19936" CreationDate="2016-09-15T22:32:00.943" Score="2" Body="&lt;p&gt;I checked out the patch that @Uwe Koloska used. It wasn't included in the main branch. I somewhat agree, I think that the problem should be resolved outside emacs using the shell and leaving emacs know nothing about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe that feature would be more logical from a user perspective, using a flag would be less convoluted for some users.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my use case I want to keep my Emacs installation and &lt;a href=&quot;http://spacemacs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Spacemacs&lt;/a&gt; so my variation of the two solutions above works like this.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;shell script&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;First of all the script for launching spacemacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;&#xA;export EMACS_USER_DIR=~/spacemacs/emacs.d&#xA;&#xA;exec emacs &quot;$@&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This script is called &lt;code&gt;spacemacs&lt;/code&gt; and is installed in the &lt;code&gt;/usr/local/bin&lt;/code&gt; folder.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;.emacs file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Then I need a &lt;code&gt;.emacs&lt;/code&gt; file in my home folder that would treat properly the environment variable &lt;code&gt;EMACS_USER_DIR&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar user-custom-dir (getenv &quot;EMACS_USER_DIR&quot;))&#xA;&#xA;(when (/= (length user-custom-dir) 0)&#xA;  (setq user-emacs-directory (file-name-as-directory user-custom-dir)))&#xA;&#xA;(load (expand-file-name &quot;init.el&quot; user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not experienced with elisp at all so I came up this, more experienced people could probably come up with something better. But hey, it works.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Eye-candy&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Then why not add an icon:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/q7Sud.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/q7Sud.png&quot; alt=&quot;icon&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Desktop Entry]&#xA;Name=Spacemacs&#xA;GenericName=Text Editor&#xA;Comment=Edit text&#xA;MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;&#xA;Exec=spacemacs %F&#xA;Icon=/home/marcs/.icons/spacemacs.svg&#xA;Type=Application&#xA;Terminal=false&#xA;Categories=Development;TextEditor;&#xA;StartupWMClass=Emacs&#xA;Keywords=Text;Editor;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12906" LastEditorUserId="12906" LastEditDate="2016-10-27T00:26:56.813" LastActivityDate="2016-10-27T00:26:56.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27098" PostTypeId="2" ParentId="27096" CreationDate="2016-09-15T22:43:32.537" Score="0" Body="&lt;p&gt;The linked bug report pointed out that grep-mode was explicitly overriding the compilation-mode support for matching &quot;Entering directory ...&quot; and &lt;code&gt;grep-mode-hook&lt;/code&gt; could be used to restore it.  I bit Frankenstein coding via cut-and-paste got me this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq real-directory-matcher compilation-directory-matcher)&#xA;&#xA;(defun grep-mode-enable-enter-dir ()&#xA;  &quot;Enable matching 'Entering directory ..' text in grep output&quot;&#xA;  (setq compilation-directory-matcher real-directory-matcher)&#xA;  )&#xA;&#xA;(add-hook 'grep-mode-hook 'grep-mode-enable-enter-dir)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I put this in my emacs initialization code and it seems to restore the old behavior for me.&lt;/p&gt;&#xA;" OwnerUserId="2000" LastActivityDate="2016-09-15T22:43:32.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27099" PostTypeId="2" ParentId="26904" CreationDate="2016-09-15T22:55:17.077" Score="2" Body="&lt;p&gt;I copied over the definition of the variable &lt;code&gt;cc-imenu-c++-generic-expression&lt;/code&gt; and patched the regular expressions that included &lt;code&gt;^&lt;/code&gt; to &lt;code&gt;^[ \t]*&lt;/code&gt;. Eval the &lt;code&gt;setq&lt;/code&gt; (maybe put it in your &lt;code&gt;init.el&lt;/code&gt;, then open the test file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq cc-imenu-c++-generic-expression&#xA; `(&#xA; ;; Try to match ::operator definitions first. Otherwise `X::operator new ()'&#xA; ;; will be incorrectly recognized as function `new ()' because the regexps&#xA; ;; work by backtracking from the end of the definition.&#xA; (nil&#xA;  ,(concat&#xA;    &quot;^\\&amp;lt;.*&quot;&#xA;    &quot;[^&quot; c-alnum &quot;_:&amp;lt;&amp;gt;~]&quot;                  ; match any non-identifier char&#xA;                       ; (note: this can be `\n')&#xA;    &quot;\\(&quot;&#xA;       &quot;\\([&quot; c-alnum &quot;_:&amp;lt;&amp;gt;~]*::\\)?&quot;      ; match an operator&#xA;       &quot;operator\\&amp;gt;[ \t]*&quot;&#xA;       &quot;\\(()\\|[^(]*\\)&quot;                  ; special case for `()' operator&#xA;    &quot;\\)&quot;&#xA;&#xA;    &quot;[ \t]*([^)]*)[ \t]*[^ \t;]&quot;           ; followed by ws, arg list,&#xA;                       ; require something other than&#xA;                       ; a `;' after the (...) to&#xA;                       ; avoid prototypes.  Can't&#xA;                       ; catch cases with () inside&#xA;                       ; the parentheses surrounding&#xA;                       ; the parameters.  e.g.:&#xA;                       ; `int foo(int a=bar()) {...}'&#xA;    ) 1)&#xA; ;; Special case to match a line like `main() {}'&#xA; ;; e.g. no return type, not even on the previous line.&#xA; (nil&#xA;  ,(concat&#xA;    &quot;^[ \t]*&quot;&#xA;    &quot;\\([&quot; c-alpha &quot;_][&quot; c-alnum &quot;_:&amp;lt;&amp;gt;~]*\\)&quot; ; match function name&#xA;    &quot;[ \t]*(&quot;                 ; see above, BUT&#xA;    &quot;[ \t]*\\([^ \t(*][^)]*\\)?)&quot;          ; the arg list must not start&#xA;    &quot;[ \t]*[^ \t;(]&quot;                       ; with an asterisk or parentheses&#xA;    ) 1)&#xA; ;; General function name regexp&#xA; (nil&#xA;  ,(concat&#xA;    &quot;^[ \t]*\\&amp;lt;&quot;                                 ; line MUST start with word char&#xA;    ;; \n added to prevent overflow in regexp matcher.&#xA;    ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-02/msg00021.html&#xA;    &quot;[^()\n]*&quot;                             ; no parentheses before&#xA;    &quot;[^&quot; c-alnum &quot;_:&amp;lt;&amp;gt;~]&quot;                  ; match any non-identifier char&#xA;    &quot;\\([&quot; c-alpha &quot;_][&quot; c-alnum &quot;_:&amp;lt;&amp;gt;~]*\\)&quot; ; match function name&#xA;    &quot;\\([ \t\n]\\|\\\\\n\\)*(&quot;        ; see above, BUT the arg list&#xA;    &quot;\\([ \t\n]\\|\\\\\n\\)*&quot;         ; must not start&#xA;    &quot;\\([^ \t\n(*]&quot;               ; with an asterisk or parentheses&#xA;    &quot;[^()]*\\(([^()]*)[^()]*\\)*&quot;         ; Maybe function pointer arguments&#xA;    &quot;\\)?)&quot;&#xA;    &quot;\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]&quot;&#xA;    ) 1)&#xA; ;; Special case for definitions using phony prototype macros like:&#xA; ;; `int main _PROTO( (int argc,char *argv[]) )'.&#xA; ;; This case is only included if cc-imenu-c-prototype-macro-regexp is set.&#xA; ;; Only supported in c-code, so no `:&amp;lt;&amp;gt;~' chars in function name!&#xA; ,@(if cc-imenu-c-prototype-macro-regexp&#xA;     `((nil&#xA;          ,(concat&#xA;        &quot;^[ \t]*\\&amp;lt;.*&quot;                   ; line MUST start with word char&#xA;        &quot;[^&quot; c-alnum &quot;_]&quot;          ; match any non-identifier char&#xA;        &quot;\\([&quot; c-alpha &quot;_][&quot; c-alnum &quot;_]*\\)&quot; ; match function name&#xA;        &quot;[ \t]*&quot;                   ; whitespace before macro name&#xA;        cc-imenu-c-prototype-macro-regexp&#xA;        &quot;[ \t]*(&quot;                  ; ws followed by first paren.&#xA;        &quot;[ \t]*([^)]*)[ \t]*)[ \t]*[^ \t;]&quot; ; see above&#xA;        ) 1)))&#xA; ;; Class definitions&#xA; (&quot;Class&quot;&#xA;  ,(concat&#xA;      &quot;^[ \t]*&quot;                                  ; beginning of line is required&#xA;      &quot;\\(template[ \t]*&amp;lt;[^&amp;gt;]+&amp;gt;[ \t]*\\)?&quot; ; there may be a `template &amp;lt;...&amp;gt;'&#xA;      &quot;\\(class\\|struct\\)[ \t]+&quot;&#xA;      &quot;\\(&quot;                                ; the string we want to get&#xA;      &quot;[&quot; c-alnum &quot;_]+&quot;                    ; class name&#xA;      &quot;\\(&amp;lt;[^&amp;gt;]+&amp;gt;\\)?&quot;                     ; possibly explicitly specialized&#xA;      &quot;\\)&quot;&#xA;      &quot;\\([ \t\n]\\|\\\\\n\\)*[:{]&quot;&#xA;      ) 3))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: Can't respond to your comment, but the following doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq cc-imenu-c++-generic-expression ((nil &quot;^\\&amp;lt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's because the &lt;code&gt;((&lt;/code&gt; is not quoted. (Emacs) Lisp sees a bare &lt;code&gt;(&lt;/code&gt; as the command to call a function. You need to use ` or &lt;code&gt;'&lt;/code&gt; to quote it. So &lt;code&gt;((&lt;/code&gt; says call the function returned by calling &lt;code&gt;nil ...&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9181" LastEditorUserId="9181" LastEditDate="2016-09-15T23:05:12.993" LastActivityDate="2016-09-15T23:05:12.993" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27100" PostTypeId="2" ParentId="27094" CreationDate="2016-09-16T01:18:28.150" Score="9" Body="&lt;p&gt;This isn't easy enough to find, but what you want is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Goto-Address-mode.html&quot; rel=&quot;noreferrer&quot;&gt;goto-address-mode&lt;/a&gt;. You can activate it in the current buffer with &lt;code&gt;M-x goto-address-mode&lt;/code&gt; or you can add it to markdown-mode-hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun turn-on-goto-address-mode ()&#xA;   (goto-address-mode 1))&#xA;(add-hook 'markdown-mode-hook #'turn-on-goto-address-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-09-16T01:18:28.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27101" PostTypeId="1" CreationDate="2016-09-16T03:24:23.107" Score="2" ViewCount="505" Body="&lt;p&gt;I recently noticed an issue in &lt;code&gt;man.el&lt;/code&gt;, in which sections in &lt;code&gt;Man--sections&lt;/code&gt; are listed backwards. That is, the value is is something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(#(&quot;SEE ALSO&quot; 0 8&#xA;   (face Man-overstrike))&#xA; #(&quot;COPYRIGHT&quot; 0 9&#xA;   (face Man-overstrike))&#xA; #(&quot;REPORTING BUGS&quot; 0 14&#xA;   (face Man-overstrike))&#xA; #(&quot;AUTHOR&quot; 0 6&#xA;   (face Man-overstrike))&#xA; #(&quot;EXAMPLES&quot; 0 8&#xA;   (face Man-overstrike))&#xA; #(&quot;DESCRIPTION&quot; 0 11&#xA;   (face Man-overstrike))&#xA; #(&quot;SYNOPSIS&quot; 0 8&#xA;   (face Man-overstrike))&#xA; #(&quot;NAME&quot; 0 4&#xA;   (face Man-overstrike)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is because &lt;code&gt;Man-build-section-alist&lt;/code&gt; scans the buffer from &lt;code&gt;(point-min)&lt;/code&gt; to &lt;code&gt;(point-max)&lt;/code&gt;, &lt;code&gt;push&lt;/code&gt;-ing values onto &lt;code&gt;Man--sections&lt;/code&gt; as it goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to change this behavior so that the sections are in the correct order, which matters to &lt;code&gt;helm-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, changing the &lt;code&gt;Man-build-section-alist&lt;/code&gt; function, then re-evaluating it doesn't do any good, because it's defined with &lt;code&gt;defsubst&lt;/code&gt; instead of &lt;code&gt;defun&lt;/code&gt;. &lt;code&gt;defsubst&lt;/code&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Inline-Functions.html&quot; rel=&quot;nofollow&quot;&gt;inlines functions&lt;/a&gt;, which means that, when the file is byte-compiled, the function definition is directly inserted where the function is called. This means that redefining/evaluating the function doesn't work, since the bytecode is not changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defsubst&lt;/code&gt; offers a performance benefit, but is there really any reason to use it for a command like &lt;code&gt;Man-build-section-alist&lt;/code&gt;? Most functions in &lt;code&gt;man.el&lt;/code&gt; use &lt;code&gt;defun&lt;/code&gt;, and I can't imagine that the performance benefit matters on hardware from the past 15 years.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorDisplayName="user8748" LastEditDate="2019-01-26T20:28:19.547" LastActivityDate="2019-01-26T20:28:19.547" Title="Why use `defsubst` in `man.el`?" Tags="|functions|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="27102" PostTypeId="2" ParentId="27088" CreationDate="2016-09-16T03:51:02.463" Score="3" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your table, use &lt;code&gt;\ast&lt;/code&gt;, &lt;code&gt;\lowast&lt;/code&gt; or &lt;code&gt;\star&lt;/code&gt; from &lt;a href=&quot;http://orgmode.org/manual/Special-symbols.html&quot; rel=&quot;nofollow&quot;&gt;org-entities&lt;/a&gt; instead of an asterix &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Toggle viewing UTF-8 entities in org-mode with &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-x&lt;/kbd&gt; &lt;kbd&gt;\&lt;/kbd&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h2&gt;&lt;code&gt;\ast&lt;/code&gt; exports as (&amp;ast;)&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|       Date | Rating           | Comment    |&#xA;|------------+------------------+------------|&#xA;| 2016-07-01 | \ast\ast\ast     | so so      |&#xA;| 2016-07-08 | \ast\ast\ast\ast | very good  |&#xA;| 2016-07-15 | \ast             | miserable! |&#xA;#+TBLFM: $2='(replace-regexp-in-string &quot;\\*&quot; &quot;\\\\ast&quot; $2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;&lt;code&gt;\lowast&lt;/code&gt; exports as (&amp;lowast;)&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|       Date | Rating                       | Comment    |&#xA;|------------+------------------------------+------------|&#xA;| 2016-07-01 | \lowast\lowast\lowast        | so so      |&#xA;| 2016-07-08 | \lowast\lowast\lowast\lowast | very good  |&#xA;| 2016-07-15 | \lowast                      | miserable! |&#xA;#+TBLFM: $2='(replace-regexp-in-string &quot;\\*&quot; &quot;\\\\lowast&quot; $2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;&lt;code&gt;\star&lt;/code&gt; exports as (*)&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|       Date | Rating               | Comment    |&#xA;|------------+----------------------+------------|&#xA;| 2016-07-01 | \star\star\star      | so so      |&#xA;| 2016-07-08 | \star\star\star\star | very good  |&#xA;| 2016-07-15 | \star                | miserable! |&#xA;#+TBLFM: $2='(replace-regexp-in-string &quot;\\*&quot; &quot;\\\\star&quot; $2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;Hope that Helped!&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This code was tested using&lt;br&gt;&#xA;  GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  Org-mode version 8.3.5 &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-09-16T04:18:02.860" LastActivityDate="2016-09-16T04:18:02.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27103" PostTypeId="1" CreationDate="2016-09-16T04:53:45.517" Score="1" ViewCount="505" Body="&lt;p&gt;I'm working with an org-mode file that might contain headlines and text, like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 1&#xA;  :PROPERTIES:&#xA;  :ID: h1&#xA;  :END:&#xA;  This is some text.&#xA;** Subheading A&#xA;   :PROPERTIES:&#xA;   :ID: s1&#xA;   :END:&#xA;   The subheading can also have text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suppose I have a string bound to the symbol &lt;code&gt;mytext&lt;/code&gt; that looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;:ID: h1&#xA;:END:&#xA;This is some UPDATED text.&#xA;&#xA;As you can see, it can&#xA;be multlined.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to replace h1's &quot;body&quot; text with the stuff in &lt;code&gt;mytext&lt;/code&gt; (including the Properties drawer and all), but leave any subtrees alone. So the end result should look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 1&#xA;  :PROPERTIES:&#xA;  :ID: h1&#xA;  :END:&#xA;  This is some UPDATED text.&#xA;&#xA;  As you can see, it can&#xA;  be multlined.&#xA;** Subheading A&#xA;   :PROPERTIES:&#xA;   :ID: s1&#xA;   :END:&#xA;   The subheading can also have text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the fastest / easiest way to do this with elisp?&lt;/p&gt;&#xA;" OwnerUserId="12837" LastEditorUserId="105" LastEditDate="2017-02-07T19:00:28.357" LastActivityDate="2017-08-12T15:00:30.167" Title="How do I replace a block of text with another block of text in elisp?" Tags="|org-mode|replace|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27104" PostTypeId="2" ParentId="27101" CreationDate="2016-09-16T06:25:25.280" Score="0" Body="&lt;p&gt;I do not know why man.el uses defsubst—you'd have to ask whoever wrote the function—but I'm sure that it's not really needed.  I agree with Drew: Nowadays you shouldn't use defsubst anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then you shouldn't patch or advice other libraries as well, unless absolutely necessary. And the inverse order of a list doesn't strike me as a good reason for advicing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why Helm should require this variable to be in proper order, but you should always be able to point it to another variable that holds the &lt;code&gt;reverse&lt;/code&gt; list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But please &lt;strong&gt;do not use advices&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-09-16T06:25:25.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27105" PostTypeId="2" ParentId="27043" CreationDate="2016-09-16T06:31:26.947" Score="1" Body="&lt;p&gt;There's an option for this called &lt;code&gt;flycheck-gcc-language-standard&lt;/code&gt;.  You can find this and more options for C/C++ in the &lt;a href=&quot;http://www.flycheck.org/en/latest/languages.html#flycheck-languages&quot; rel=&quot;nofollow&quot;&gt;list of supported languages&lt;/a&gt; in our &lt;a href=&quot;http://www.flycheck.org/en/latest/&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-09-16T06:31:26.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27106" PostTypeId="2" ParentId="27103" CreationDate="2016-09-16T06:36:55.383" Score="0" Body="&lt;p&gt;This plain replace-regexp seems to cut it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-replace-h1 ()&#xA;  (interactive)&#xA;  (let ((mytext &quot;&#xA;  :PROPERTIES:&#xA;  :ID: h1&#xA;  :END:&#xA;  This is some UPDATED text.&#xA;&#xA;  As you can see, it can&#xA;  be multlined.&quot;))&#xA;&#xA;    (goto-char (point-min))&#xA;    (while (search-forward-regexp &quot;^\\* \\(.+\\)\n\\(.+\\|\n\\)+?\\*&quot; nil t)&#xA;      (replace-match (concat &quot;* &quot; (match-string 1) mytext &quot;\n*&quot;) t nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="719" LastEditorUserId="161" LastEditDate="2017-05-10T18:53:34.017" LastActivityDate="2017-05-10T18:53:34.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27107" PostTypeId="1" AcceptedAnswerId="27125" CreationDate="2016-09-16T08:28:00.940" Score="2" ViewCount="243" Body="&lt;p&gt;I have defined an extra todo keyword &lt;code&gt;started&lt;/code&gt; in my org-mode config for tasks that I'm currently working on. I only ever have one task that is in the state started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I display this task in a seperate line above (or bellow) the the mode line?&lt;/p&gt;&#xA;" OwnerUserId="13310" LastActivityDate="2016-09-16T17:29:40.940" Title="Extra mode line for started todo of org-mode" Tags="|org-mode|mode-line|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27108" PostTypeId="2" ParentId="26320" CreationDate="2016-09-16T08:28:06.823" Score="6" Body="&lt;p&gt;&lt;code&gt;-rw-r--r--&lt;/code&gt; means that &lt;em&gt;only&lt;/em&gt; the file owner may write to the file (file ownership would be meaningless if any user could write to any other user's files).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The operating system enforces the file permissions, so unless Emacs was run by the file's owner, it cannot write to this file unless the operating system allows it to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The facilities available to you are using &lt;code&gt;sudo&lt;/code&gt; or &lt;code&gt;su&lt;/code&gt; or otherwise logging in as the file owner or as root. Neither Emacs nor any other application should ever have the ability to do what you are asking without going through such OS-approved channels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;sudo&lt;/code&gt; tramp method (e.g. visit &lt;code&gt;/sudo::/etc/postfix/main.cf&lt;/code&gt; to edit the file as the root user) is the typical approach to take in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2019-02-01T23:51:59.843" LastActivityDate="2019-02-01T23:51:59.843" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27109" PostTypeId="1" AcceptedAnswerId="27111" CreationDate="2016-09-16T09:07:02.467" Score="2" ViewCount="1093" Body="&lt;p&gt;I use &lt;code&gt;auctex&lt;/code&gt; to edit my &lt;code&gt;.tex&lt;/code&gt; files. Each time I create a new file &lt;code&gt;.tex&lt;/code&gt; file &lt;em&gt;via&lt;/em&gt; C-x C-f, I want to insert two local variables informations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Local Variables:&#xA;% coding: utf-8-unix&#xA;% TeX-engine: luatex&#xA;% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Until now, I do M-x &lt;code&gt;add-file-local-variable&lt;/code&gt; two times. Is there a way to automate this?&lt;/p&gt;&#xA;" OwnerUserId="2385" LastActivityDate="2016-09-18T18:49:57.493" Title="How can I automatically add some local variables info to a C-x C-f new (.tex) file?" Tags="|auctex|local-variables|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27110" PostTypeId="1" CreationDate="2016-09-16T09:12:06.013" Score="9" ViewCount="3947" Body="&lt;p&gt;&lt;strong&gt;Platform:&lt;/strong&gt; Windows 7, Emacs 24.2, Pandoc 1.17.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; I am writing a markdown file in Emacs. I need to use pandoc to render the output, because it supports citations (using &lt;a href=&quot;http://pandoc.org/demo/example19/Extension-citations.html&quot; rel=&quot;noreferrer&quot;&gt;pandoc-citeproc&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How can I preview a pandoc-rendered version (probably html) in another buffer simultaneously?&lt;/p&gt;&#xA;" OwnerUserId="8454" LastActivityDate="2016-09-16T09:54:59.223" Title="Markdown preview in Emacs using pandoc" Tags="|html|markdown|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27111" PostTypeId="2" ParentId="27109" CreationDate="2016-09-16T09:50:53.483" Score="4" Body="&lt;p&gt;You can use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html#Hooks&quot; rel=&quot;nofollow&quot;&gt;hook&lt;/a&gt; to achieve this.  Use the one you need as described in &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Modes-and-Hooks.html#Modes-and-Hooks&quot; rel=&quot;nofollow&quot;&gt;auctex documentation&lt;/a&gt;.  Here we check the file extension so that we don't do that for eg &lt;code&gt;.sty&lt;/code&gt; files.  Also, we test the &lt;code&gt;buffer-read-only&lt;/code&gt; variable before modifying the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;goto-char&lt;/code&gt; at the end ensures point is set at beginning of buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/add-auctex-file-variables ()&#xA;  (interactive)&#xA;  (if (and (not buffer-read-only)&#xA;           (string= (file-name-extension (buffer-file-name)) &quot;tex&quot;))&#xA;   (progn&#xA;     (add-file-local-variable 'coding 'utf-8-unix)&#xA;     (add-file-local-variable 'TeX-engine 'luatex)&#xA;     (goto-char (point-min)))))&#xA;&#xA;(add-hook 'LaTeX-mode-hook 'my/add-auctex-file-variables)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, as can be seen on &lt;code&gt;add-file-local-variable&lt;/code&gt; docstring (display it with &lt;code&gt;C-h f add-file-local-variable&lt;/code&gt;) any setting of the variable is first deleted, so there's no risk of accumulating such definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible pitfall is that the file is marked as modified even if nothing has actually changed.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-09-18T18:49:57.493" LastActivityDate="2016-09-18T18:49:57.493" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27112" PostTypeId="2" ParentId="27110" CreationDate="2016-09-16T09:54:59.223" Score="10" Body="&lt;p&gt;After a while, I found the answer myself:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell: &lt;em&gt;Use a combination of Eww and markdown mode, and configure markdown mode to render markdown with pandoc.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alas, easier said than done.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Update to Emacs 24.5&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Eww&lt;/strong&gt; is the built-in browser since Emacs 24.5 It can be used to display html output. Eww does not run out of the box in Emacs 24.5 for windows. The &lt;a href=&quot;https://github.com/cpitclaudel/company-coq/issues/20&quot; rel=&quot;noreferrer&quot;&gt;libxml2 library&lt;/a&gt; has to be downloaded and copied manually into Emacs' bin folder.&lt;/li&gt;&#xA;&lt;li&gt;In order to install markdown mode through the built-in package-manager, you first need to &lt;strong&gt;fix the package manager&lt;/strong&gt;. It relies on TLS. However, Emacs' 24.5 TLS implementation does not work out of the box in windows. To make it work:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First download the &lt;a href=&quot;http://xn--9dbdkw.se/diary/how_to_enable_GnuTLS_for_Emacs_24_on_Windows/index.en.html&quot; rel=&quot;noreferrer&quot;&gt;GnuTLS libary&lt;/a&gt; and copy it manually into Emacs' bin folder.&lt;/li&gt;&#xA;&lt;li&gt;Then download this &lt;a href=&quot;https://curl.haxx.se/ca/cacert.pem&quot; rel=&quot;noreferrer&quot;&gt;CA root certificate&lt;/a&gt; and copy it there as well.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Now you can &lt;strong&gt;install markdown mode&lt;/strong&gt; by invoking &lt;code&gt;M-x install-package markdown-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Configure&lt;/strong&gt; the rendering engine by invonking &lt;code&gt;M-x customize-mode&lt;/code&gt; in the active markdown buffer. Set this to pandoc with your preferred flags and options.&lt;/li&gt;&#xA;&lt;li&gt;Press C-C-l inside the markdown buffer to see the rendered results in a Eww buffer next to your markdown file.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;...et voilà. &lt;/p&gt;&#xA;" OwnerUserId="8454" LastActivityDate="2016-09-16T09:54:59.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27113" PostTypeId="1" AcceptedAnswerId="27177" CreationDate="2016-09-16T11:28:43.853" Score="1" ViewCount="286" Body="&lt;p&gt;I run several applications, in several languages, that store their error stacks&#xA;locally.  I made a small emacs mode that allows me to browse those errors and&#xA;navigate the related code.  The code I wrote, at its core, is basically loading&#xA;those stacks from the database in a buffer and setting that buffer in&#xA;compilation code.  Then I can browse code by using &lt;code&gt;previous-error&lt;/code&gt;,&#xA;&lt;code&gt;next-error&lt;/code&gt;, etc. to navigate the code.  &lt;code&gt;compilation-mode&lt;/code&gt; is great because it&#xA;knows many error regexps so I don't need to deal with them (I add to add just 3&#xA;new regexps to local variable &lt;code&gt;compilation-error-regexp-alist&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very convenient and that has been working fine for years.  The paths of the&#xA;stacks are absolute, which suits fine to compilation mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But more and more I run those applications in lightweight containers.  Then, the&#xA;path of those stacks does not works because I have mounted the container&#xA;filesystem in different paths in my host (I run emacs exclusivelly in the host,&#xA;and I store the stacks there).  Then, emacs cannot find the path the files are&#xA;and I cannot browse them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mount the root filesystem os my containers in known locations.  So, for a&#xA;stack /a/b/c/d.c:80 in container &quot;foo&quot;, I can calculate the path very easily:&#xA;/containers/foo/a/b/c/d.c:80&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use &lt;code&gt;compilation-search-path&lt;/code&gt;, with no avail (&lt;code&gt;compilation-find-file&lt;/code&gt;&#xA;does not concatenate an absolute path to the elements of the search path, only&#xA;the basename)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate some hint of how to achieve what I want (basically smarting&#xA;&lt;code&gt;compilation-find-file&lt;/code&gt; to prepend a path to those paths in its &quot;error lines&quot;)&#xA;that does not violates compile.el encapsulation.&lt;/p&gt;&#xA;" OwnerUserId="4048" LastActivityDate="2016-09-19T07:15:03.143" Title="Using compilation-mode to parse error stacks, relocating them" Tags="|compilation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27114" PostTypeId="2" ParentId="27094" CreationDate="2016-09-16T12:39:28.890" Score="-1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In an emacs org-mode buffer it is possible to type a hyperlink and then click on the hyperlink with a mouse to open the url in an external browser.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Yes this can be done without any additional code&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The format in which you have enter URLs in &lt;code&gt;org-mode&lt;/code&gt; file is&#xA;&lt;code&gt;[[http://www.google.co.in][Google India]]&lt;/code&gt;. This will open the webpage (in your default browser) on a click event.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how it looks in my org file&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/TnBwy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TnBwy.png&quot; alt=&quot;Hyperlink in org-mode&quot;&gt;&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://orgmode.org/guide/Link-format.html#Link-format&quot; rel=&quot;nofollow noreferrer&quot;&gt;Manual reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="10936" LastEditDate="2016-09-17T00:49:28.337" LastActivityDate="2016-09-17T00:49:28.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27115" PostTypeId="1" AcceptedAnswerId="27117" CreationDate="2016-09-16T14:06:33.047" Score="1" ViewCount="844" Body="&lt;p&gt;I'm running emacs through my terminal on OSX and was trying to get my line numbers on here. Ran the command &lt;code&gt;M-x linum-mode&lt;/code&gt; with a &lt;code&gt;[No match]&lt;/code&gt; result. Tried &lt;code&gt;global-linum-mode&lt;/code&gt;, same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;emacs --version&lt;/code&gt; shows GNU Emacs 22.1.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this just not a supported feature for 22.1.1 or is there something I don't know about when running emacs via OSX terminal?&lt;/p&gt;&#xA;" OwnerUserId="12346" LastActivityDate="2016-09-16T16:30:48.630" Title="linum-mode not working in OSX built in emacs version 22.1.1" Tags="|osx|terminal-emacs|linum-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27116" PostTypeId="1" AcceptedAnswerId="27157" CreationDate="2016-09-16T14:12:16.247" Score="4" ViewCount="1508" Body="&lt;p&gt;On the command-line, I often do this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git branch -D -r origin/feature/someLabelHere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to remove a remote branch after a pull request from that branch has been merged into master.  I know now to do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git branch -d feature/someLabelHere&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in magit, but not the &lt;code&gt;-D -r&lt;/code&gt; equivalent.   How can one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply pressing &lt;code&gt;k&lt;/code&gt; to ask for removal on the displayed remote branch gets &#xA;an error message and reference to the process buffer where one sees &lt;em&gt;e.g.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  1 git … push origin :bugfix/someLabelHere        &#xA;error: unable to delete 'bugfix/someLabelHere': remote ref does not exist  &#xA;error: failed to push some refs to 'git@github.com:eddelbuettel/somerepo.git'    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt; It may have been an 'order of commands' issue.  Deleting in magit &lt;em&gt;before&lt;/em&gt; removing the remote branch at github seems to do the trick.&lt;/p&gt;&#xA;" OwnerUserId="280" LastEditorUserId="280" LastEditDate="2016-09-18T01:28:56.793" LastActivityDate="2016-09-26T12:34:29.003" Title="Magit equivalent of `git branch -D -r origin/feature/someLabelHere`" Tags="|magit|" AnswerCount="1" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="27117" PostTypeId="2" ParentId="27115" CreationDate="2016-09-16T14:56:27.350" Score="3" Body="&lt;p&gt;&lt;code&gt;linum-mode&lt;/code&gt; was added in Emacs 23.1. See the related &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/33f856ba01d13f649cf5c848b322ecb0dbfc02fc/etc/NEWS.23#L1261&quot; rel=&quot;nofollow&quot;&gt;NEWS&lt;/a&gt; file, or if you have 23.1+ version of Emacs, you can find this information via &lt;code&gt;C-u C-h n 23.1&lt;/code&gt; then &lt;code&gt;C-s linum&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I know it's 23.1 because I searched &lt;code&gt;linum&lt;/code&gt; across all NEWS files.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-09-16T16:30:48.630" LastActivityDate="2016-09-16T16:30:48.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27118" PostTypeId="2" ParentId="27101" CreationDate="2016-09-16T15:34:30.347" Score="3" Body="&lt;p&gt;FWIW, I disagree with a general ban on &lt;code&gt;defsubst&lt;/code&gt;, but these two uses of &lt;code&gt;defsubst&lt;/code&gt; in man.el seem like clear errors, indeed.  Basically any function which contains a loop will spend much more time in its loop than entering/leaving the function itself, so using &lt;code&gt;defsubst&lt;/code&gt; is just not appropriate in such a case.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-09-16T15:34:30.347" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27119" PostTypeId="2" ParentId="27113" CreationDate="2016-09-16T15:40:16.587" Score="1" Body="&lt;p&gt;I think you might be able to use an old hack in compile.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local comint-file-name-prefix &quot;/containers/foo/a/b/c/d.c:80&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This was meant originally for use inside rlogin.el buffers (i.e. a remote shell), but your situation is basically the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might like to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; and ask for its name to be fixed since it really doesn't have much to do with comint.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-09-16T15:40:16.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27121" PostTypeId="1" CreationDate="2016-09-16T15:50:02.243" Score="0" ViewCount="315" Body="&lt;p&gt;I put the following in my .emacs file to make sure that the &quot;run-python&quot; variable maps to the right path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter &quot;C:\\Users\\xxxx\\python.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I restart emacs and do M-x run-python; it I get the following error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Searching for program: no such file or directory, c\:/Users/xxxx/python.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't understand why emacs puts &quot;c:/&quot; instead of &quot;c:\&quot; and I assume that is why it cannot find the python's interpreter's path. Am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: The following works:&#xA;C-u M-x run-python RET &quot;python&quot; -i&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure you don't put 'python'; and actually use quotation marks like &quot;.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="13311" LastEditDate="2016-09-16T19:04:45.877" LastActivityDate="2016-12-15T20:57:45.073" Title=".emacs setq sets a wrong path for a variable" Tags="|init-file|microsoft-windows|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27123" PostTypeId="2" ParentId="27121" CreationDate="2016-09-16T16:16:49.010" Score="1" Body="&lt;p&gt;No, that is not the reason. (And Emacs apparently did not put &lt;code&gt;c:/&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the problem is not the use of &lt;code&gt;setq&lt;/code&gt; instead of Customize (though the latter is generally advisable). If you are using the vanilla library &lt;code&gt;python.el&lt;/code&gt; then you'll see this in the file header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Running IPython on Windows needs more tweaking.  The way you should&#xA;;; set `python-shell-interpreter' and `python-shell-interpreter-args'&#xA;;; is as follows (of course you need to modify the paths according to&#xA;;; your system):&#xA;&#xA;;; (setq python-shell-interpreter &quot;C:\\Python27\\python.exe&quot;&#xA;;;       python-shell-interpreter-args&#xA;;;       &quot;-i C:\\Python27\\Scripts\\ipython-script.py&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error message you see says &lt;strong&gt;&lt;code&gt;c\:&lt;/code&gt;&lt;/strong&gt;.  It does not say &lt;code&gt;c:\&lt;/code&gt; (and it does not say, as you suggested, &lt;code&gt;c:/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you sure that you have &lt;code&gt;c:\&lt;/code&gt; and not &lt;strong&gt;&lt;code&gt;c\:&lt;/code&gt;&lt;/strong&gt; in your init file? The colon (:) needs to come before the backslash (&lt;code&gt;\&lt;/code&gt;) or the slash (&lt;code&gt;/&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update: It looks like the comment from @npostavs points to the problem: it's a bug in the &lt;code&gt;python.el&lt;/code&gt; code.  My &quot;answer&quot; speaks to the reason you gave and the reason that @choroba gave - neither is the cause of your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I guessed that either you mistyped &lt;code&gt;c\:&lt;/code&gt; or the error message mistakenly really wrote that (instead of &lt;code&gt;c:\&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-16T17:54:54.260" LastActivityDate="2016-09-16T17:54:54.260" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27124" PostTypeId="2" ParentId="27064" CreationDate="2016-09-16T17:28:27.337" Score="0" Body="&lt;p&gt;3- when I use &lt;code&gt;helm-imenu&lt;/code&gt; (coming in helm), I do have many levels of titles. I don't with a simple &lt;code&gt;imenu&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5- instead of occur I switched to &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop&quot; rel=&quot;nofollow&quot;&gt;helm-swoop&lt;/a&gt; which is the same idea, but interactive. So I can feed it level markups, like &lt;code&gt;---&lt;/code&gt; or &lt;code&gt;===&lt;/code&gt; and I can navigate through them with &lt;code&gt;C-n&lt;/code&gt; and &lt;code&gt;C-p&lt;/code&gt;. I know it isn't really a regexp, and I don't see the titles (but I do see them with helm-imenu).&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2016-09-16T17:28:27.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27125" PostTypeId="2" ParentId="27107" CreationDate="2016-09-16T17:29:40.940" Score="1" Body="&lt;p&gt;This doesn't answer your question exactly, but might be a viable alternative:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;org-mode&lt;/code&gt;'s &lt;a href=&quot;http://orgmode.org/manual/Clocking-work-time.html&quot; rel=&quot;nofollow&quot;&gt;clocking commands&lt;/a&gt;, your current task will be listed in the modeline along with the total time you've spent working on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;While the clock is running, the current clocking time is shown in the mode line, along with the title of the task. The clock time shown will be all time ever clocked for this task and its children. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This won't give you a separate mode line, but you'll have the info your after in the usual mode line. Perhaps that's close enough? It should be possible to put together a hook that automatically clocked-in on a task when you switched its state to &lt;code&gt;started&lt;/code&gt;, and clocked out when you changed it to something else.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-09-16T17:29:40.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27126" PostTypeId="1" AcceptedAnswerId="27128" CreationDate="2016-09-16T22:39:36.703" Score="19" ViewCount="3702" Body="&lt;p&gt;I would like to manage the tangling my org files with a Makefile. Though I can not find any information of how to tangle files from the command line.&lt;/p&gt;&#xA;" OwnerUserId="12195" LastActivityDate="2020-01-15T20:17:17.860" Title="Is it possible to org-bable-tangle an org file from the command line?" Tags="|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27127" PostTypeId="2" ParentId="27083" CreationDate="2016-09-16T22:49:00.930" Score="0" Body="&lt;p&gt;Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;  :ensure t&#xA;  :init&#xA;  (folding-mode-add-find-file-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that you want to only load folding-mode the first time you visit a folded file, but the hook that detects whether a file is folded is in the folding-mode package! This of course is impossible, you'll have to uncoditionally load folding-mode as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may prefer to stick with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;  :ensure t&#xA;  :config&#xA;  (folding-mode-add-find-file-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not as bad you might think: it's true that on the very first folded file you open in a given session you'll have to manually run &lt;code&gt;M-x folding-mode&lt;/code&gt;, but then the hook gets installed and any other folded file you open will get detected and put in folding-mode.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-09-16T22:49:00.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27128" PostTypeId="2" ParentId="27126" CreationDate="2016-09-16T22:59:22.650" Score="20" Body="&lt;p&gt;You can use something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --batch --eval &quot;(require 'org)&quot; --eval '(org-babel-tangle-file &quot;file-to-tangle.org&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(That shell quoting is meant for Bash, adjust if you use a different shell.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Thanks to @SkydiveMike for pointing out I had mistakenly written &lt;code&gt;org-babel-tangle&lt;/code&gt; instead of &lt;code&gt;org-babel-tangle-file&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2020-01-15T20:17:17.860" LastActivityDate="2020-01-15T20:17:17.860" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="27129" PostTypeId="1" AcceptedAnswerId="27130" CreationDate="2016-09-17T01:15:24.360" Score="3" ViewCount="134" Body="&lt;p&gt;I tried running &lt;code&gt;(forward-comment -1)&lt;/code&gt; by eval command, when the point is actually in the middle of a comment. Like forward-word (or) forward-line, i expected it move to the beginning of the comment &amp;amp; then to the previous comment etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, the point is not moving at all..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like, my javascript snippet looks like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    /*  this is a dummy comment&#xA;   this is additional(^) comment&#xA;this is more additional  comment*/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My cursor is on the second line denoted by caret symbol and then i run, &lt;code&gt;(forward-comment -1)&lt;/code&gt; and i expect the point to move to the comment's beginning. But &lt;code&gt;(point)&lt;/code&gt; has not changed at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This behavior is noticed in elisp mode as well with semicolon-ed comments.&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2016-09-17T01:24:47.117" LastActivityDate="2016-09-17T02:37:16.693" Title="forward-comment doesn't move the point" Tags="|sexp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27130" PostTypeId="2" ParentId="27129" CreationDate="2016-09-17T02:37:16.693" Score="3" Body="&lt;p&gt;Yes, that's the way &lt;code&gt;forward-comment&lt;/code&gt; works (likewise &lt;code&gt;forward-sexp&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To quote Stefan, from part of &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8667&quot; rel=&quot;nofollow&quot;&gt;bug #8667&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The forward-THINGY functions all share the following property AFAIK:&#xA;  when called with a positive argument with point &lt;em&gt;before&lt;/em&gt; some&#xA;  THINGIES, they will skip over that many THINGIES and when called&#xA;  with a negative argument with point &lt;em&gt;after&lt;/em&gt; some THINGIES they will&#xA;  skip over that many THINGIES.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;E.g. just like forward-comment, forward-sexp from within a sexp will not&#xA;  skip to the end of that sexp.  And just like forward-sexp,&#xA;  forward-comment called in front of a nested comment will jump over that&#xA;  nested comment.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;All calls with point elsewhere than before/after a THINGY behave in&#xA;  somewhat arbitrary ways which mostly depend on how the function is&#xA;  implemented and what kind of structure  have (e.g. can they&#xA;  nest?  Can we easily tell when we're in the middle of a THINGY ?).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-09-17T02:37:16.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27131" PostTypeId="1" CreationDate="2016-09-17T02:53:14.693" Score="0" ViewCount="575" Body="&lt;p&gt;I have some code I copy-paste from somewhere. What is this how to get rid of them all at once? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KigeS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KigeS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My emacs is setup to automatically cut the orange areas, but to get rid of these?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;update:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             position: 16165 of 16950 (95%), column: 0&#xA;            character: TAB (displayed as TAB) (codepoint 9, #o11, #x9)&#xA;    preferred charset: ascii (ASCII (ISO646 IRV))&#xA;code point in charset: 0x09&#xA;               script: latin&#xA;               syntax:      which means: whitespace&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #x09&#xA;            file code: #x09 (encoded by coding system undecided-unix)&#xA;              display: by display table entry [?→ ? ] (see below)&#xA;&#xA;The display table entry is displayed by these fonts (glyph codes):&#xA;→: xft:-MS  -Consolas-normal-normal-normal-*-23-*-*-*-m-0-iso10646-1 (#x365)&#xA;    : -- no font --&#xA;&#xA;Character code properties: customize what to show&#xA;  old-name: CHARACTER TABULATION&#xA;  general-category: Cc (Other, Control)&#xA;  decomposition: (9) (' ')&#xA;&#xA;There is an overlay here:&#xA; From 16165 to 16165&#xA;  before-string        [Show]&#xA;  linum-str            [Show]&#xA;&#xA;&#xA;There are text properties here:&#xA;  face                 whitespace-tab&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12851" LastEditorUserId="12851" LastEditDate="2016-09-17T03:22:03.237" LastActivityDate="2016-10-17T04:52:48.117" Title="How to get rid of the red areas and what are they?" Tags="|tabs|newlines|" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="27132" PostTypeId="2" ParentId="27131" CreationDate="2016-09-17T03:22:33.727" Score="1" Body="&lt;p&gt;If I understand correctly, OP is an Emacs newbie trying to turn tabs into spaces in his buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(customize-set-variable 'indent-tabs-mode nil)&#xA;(add-hook 'before-save-hook #'whitespace-cleanup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't need &lt;code&gt;delete-trailing-whitespace&lt;/code&gt; anymore.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-09-17T03:22:33.727" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27133" PostTypeId="2" ParentId="21080" CreationDate="2016-09-17T03:57:49.310" Score="1" Body="&lt;p&gt;If you use &lt;code&gt;company-mode&lt;/code&gt; (which is preferred by most over &lt;code&gt;autocomplete&lt;/code&gt; these days), try &lt;a href=&quot;https://github.com/expez/company-quickhelp&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;company-quickhelp&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-09-17T03:57:49.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27134" PostTypeId="1" AcceptedAnswerId="27136" CreationDate="2016-09-17T11:14:47.247" Score="0" ViewCount="68" Body="&lt;p&gt;I converted a file to &lt;code&gt;org-mode&lt;/code&gt;, but have a lot of extra asterisks.  I want to replace each * with a space, but I want to exclude the * in a header line.  How do I do this?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2016-09-17T15:37:44.860" LastActivityDate="2016-09-17T15:37:44.860" Title="replace all '*' with spaces EXCLUDING org headers?" Tags="|org-mode|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27135" PostTypeId="1" AcceptedAnswerId="27170" CreationDate="2016-09-17T12:12:03.103" Score="11" ViewCount="511" Body="&lt;p&gt;I frequently find myself trying to replace e.g. &lt;code&gt;foo&lt;/code&gt; with &lt;code&gt;bar&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt; with &lt;code&gt;foo&lt;/code&gt; in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I usually do it is either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;3 query-replaces: &lt;code&gt;aaa -&amp;gt; @@@&lt;/code&gt;, &lt;code&gt;bbb -&amp;gt; aaa&lt;/code&gt;, &lt;code&gt;@@@ -&amp;gt; bbb&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;give up on automation and just do the replacement by hand&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I suppose that it is possible to get something working using the &lt;code&gt;,&lt;/code&gt; syntax in &lt;code&gt;query-replace-regexp&lt;/code&gt; to test if the matched string is &lt;code&gt;aaa&lt;/code&gt; or &lt;code&gt;bbb&lt;/code&gt;. But the resulting syntax would be too cumbersome, so I never really tried it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, given how common a task it is, I think there must be a better, single-step, way of doing it, either built-in or in an existing package. Is there?&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2016-10-14T08:01:57.287" Title="Search/replace-like feature for swapping text" Tags="|replace|refactoring|" AnswerCount="2" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="27136" PostTypeId="2" ParentId="27134" CreationDate="2016-09-17T15:35:47.980" Score="2" Body="&lt;p&gt;The following function, minimally tested, uses&#xA;a&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/RegularExpression&quot; rel=&quot;nofollow&quot;&gt;regular expression&lt;/a&gt; search&#xA;and replace, but conditions the replace on not being in an &lt;code&gt;org&lt;/code&gt;&#xA;header.  Note that it doesn't treat the &lt;code&gt;*&lt;/code&gt; bullets in a plain&#xA;list as special: if you want to keep them, too, you'll need to&#xA;modify the function (try with&lt;code&gt;org-at-item-p&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bullets-to-spaces ()&#xA;  &quot;Replace * with a space except in org headers.&quot;&#xA;  (interactive)&#xA;  (save-restriction&#xA;    (save-excursion&#xA;      (widen)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward &quot;\\*&quot; nil t)&#xA;        (unless (org-at-heading-p)&#xA;          (replace-match &quot; &quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-09-17T15:35:47.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27137" PostTypeId="2" ParentId="21834" CreationDate="2016-09-17T15:55:10.080" Score="1" Body="&lt;p&gt;This seems like a sorely missing feature.  Having to stop and choose a number and type it in every time you open a group with a large backlog is tiresome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround, you could bind &lt;code&gt;RET&lt;/code&gt; in the &lt;code&gt;*Group*&lt;/code&gt; buffer to a function that runs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-group-select-group number)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...where &lt;code&gt;number&lt;/code&gt; is what you would normally type at the prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, note from the docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If ALL is non-nil, already read articles become readable.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This means that using this workaround will always load already-read articles--which, for me, defeats the whole purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose another possible workaround would be to write a function which compares the number of unread articles in the group to the &lt;code&gt;gnus-large-newsgroup&lt;/code&gt; variable, and if larger, calls &lt;code&gt;gnus-group-select-group&lt;/code&gt;, inputs the number directly into the minibuffer, and presses &lt;code&gt;RET&lt;/code&gt;.  Kind of an ugly hack, but I guess it would work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way gnus is installed on my system, the uncompiled elisp code isn't available, so modifying it will take a lot more effort.  However, once you have the gnus code handy, it would probably not be too difficult to add a new setting to gnus for a default number of articles to load...&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastEditorDisplayName="user3871" LastEditDate="2016-09-17T16:11:35.303" LastActivityDate="2016-09-17T16:11:35.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27138" PostTypeId="1" CreationDate="2016-09-17T16:29:11.413" Score="5" ViewCount="1884" Body="&lt;p&gt;I like to work with a vertically split frame with code in both windows. When i call &lt;code&gt;M-x compile&lt;/code&gt; the &lt;code&gt;*compilation*&lt;/code&gt; buffer shows in the other window (wich is fine as &lt;code&gt;M-g n&lt;/code&gt; would show problematic code in the current window while i can still see the error in the other), but, after reviewing code, i would like to kill the &lt;code&gt;*compilation*&lt;/code&gt; buffer and show the code that was in that window before, without visiting that window (&lt;code&gt;C-x o&lt;/code&gt;) and killing it (&lt;code&gt;C-x k&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've come up with something, altough, it does not work; it throws: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wrong-type-argument windowp (#&amp;lt;window 10 on *Backtrace*&amp;gt;))`&#xA;window-buffer((#&amp;lt;window 10 on *Backtrace*&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe that &lt;code&gt;window-buffer&lt;/code&gt; does take a window as an argument and return its buffer, but I don't know any Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-other-window-buffer ()&#xA;  &quot;Kill the buffer of the other window if there is two windows&quot;&#xA;  ;; I thought it will be better this way, to avoid killing an unexpected buffer&#xA;  ;; when several windows are in the frame&#xA;  (if (= (length (window-list)) 2)&#xA;    (kill-buffer&#xA;      (window-buffer (last (window-list)))&#xA;  )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12487" LastEditorUserId="12487" LastEditDate="2016-09-17T19:22:27.763" LastActivityDate="2022-03-10T14:02:02.807" Title="How do i close the *compilation* buffer without visitinig its window?" Tags="|window|compilation|kill-buffer|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27139" PostTypeId="1" AcceptedAnswerId="27141" CreationDate="2016-09-17T16:37:26.487" Score="3" ViewCount="2570" Body="&lt;p&gt;I use &lt;code&gt;company-statistics&lt;/code&gt; to sort completion candidates by previous completion choices. It works perfectly, except there is only tiny problem. The file &lt;code&gt;~/.emacs.d/company-statistics-cache.el&lt;/code&gt; pops up in &lt;code&gt;recentf-mode&lt;/code&gt; and I'd like &lt;code&gt;recentf-mode&lt;/code&gt; to not display this file. How can I achieve this ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the path of the file to the symbol &lt;code&gt;recentf-exclude&lt;/code&gt; but that did not help. I also tried adding the path of the directory itself and that didn't help either.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2022-06-29T17:31:50.643" Title="Ignoring specific files in recentf-mode" Tags="|files|recentf|" AnswerCount="1" CommentCount="0" ClosedDate="2016-10-11T16:12:52.323" ContentLicense="CC BY-SA 3.0" />
  <row Id="27141" PostTypeId="2" ParentId="27139" CreationDate="2016-09-17T18:56:20.450" Score="9" Body="&lt;pre&gt;&lt;code&gt;(add-to-list 'recentf-exclude &amp;quot;company-statistics-cache.el&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;or more accurately&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'recentf-exclude&#xA;             (recentf-expand-file-name &amp;quot;~/.emacs.d/company-statistics-cache.el&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;then run &lt;code&gt;M-x recentf-cleanup&lt;/code&gt; to make it work.&lt;/p&gt;&#xA;&lt;p&gt;Anyway, the regexp you set in &lt;code&gt;recentf-exclude&lt;/code&gt; must match the &lt;code&gt;$HOME/.emacs.d/company-statistics-cache.el&lt;/code&gt; (&lt;code&gt;~&lt;/code&gt; is expanded into &lt;code&gt;$HOME&lt;/code&gt;), so regexp like &lt;code&gt;~/.emacs.d/company-statistics-cache.el&lt;/code&gt; does not work.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="28899" LastEditDate="2022-06-29T17:31:50.643" LastActivityDate="2022-06-29T17:31:50.643" CommentCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="27142" PostTypeId="1" AcceptedAnswerId="27145" CreationDate="2016-09-17T20:03:22.423" Score="2" ViewCount="976" Body="&lt;p&gt;I am using Emacs' Org mode to scribble up some notes which all of which are being exported to HTML. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often need to insert a lot of paragraphs verbatim while citing other research papers. The &lt;code&gt;#+BEGIN_QUOTE ... #+END_QUOTE&lt;/code&gt; environment is perfect for that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I would also like the quotes to be surrounded by a gray box snapped tight around the quote. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. almost exactly like how the poem Twinkle Twinkle Little Star appears &#xA;below.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Twinkle, twinkle, little star,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;How I wonder what you are!&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Up above the world so high,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Like a diamond in the sky.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2023-10-05T05:59:27.957" Title="How to put boxes around quotes in Org mode" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27143" PostTypeId="2" ParentId="27138" CreationDate="2016-09-17T20:41:43.667" Score="2" Body="&lt;p&gt;As suggested by &lt;a href=&quot;https://emacs.stackexchange.com/users/12247/chakravarthy-raghunandan&quot; title=&quot;Chakravarthy&quot;&gt;Charkravarthy&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/users/105/drew&quot;&gt;Drew&lt;/a&gt;, using either vanilla Emacs, or together with &lt;code&gt;Helm&lt;/code&gt;, &lt;code&gt;Ido&lt;/code&gt; or &lt;code&gt;Ivy&lt;/code&gt; one can kill / &lt;em&gt;close&lt;/em&gt; the &lt;code&gt;*Compilation*&lt;/code&gt; buffer using &lt;code&gt;C-x k&lt;/code&gt; and selecting it when prompted to do so.&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-09-17T20:41:43.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27144" PostTypeId="1" AcceptedAnswerId="27165" CreationDate="2016-09-17T20:42:13.870" Score="3" ViewCount="233" Body="&lt;p&gt;How can I make emacs execute a script every time when a latex-compilation (via auctex and latexmk) finished successfully? In particular I want to send a SIGHUP signal to mupdf to make it reload my pdf file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the sighup can be send when using latexmk from commandline with -pvc option and that in this case also a general post compile hook is supported (&lt;a href=&quot;https://tex.stackexchange.com/questions/299822/post-compile-hook-latexmk&quot;&gt;https://tex.stackexchange.com/questions/299822/post-compile-hook-latexmk&lt;/a&gt;), however latexmk -pvc doesn't integrate well in auctex (&lt;a href=&quot;https://github.com/tom-tan/auctex-latexmk/pull/11&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tom-tan/auctex-latexmk/pull/11&lt;/a&gt;), so I am looking for an emacs way for a post compile hook.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-09-18T18:07:19.087" Title="&quot;Post compile hook&quot; in auctex" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27145" PostTypeId="2" ParentId="27142" CreationDate="2016-09-17T21:59:11.500" Score="4" Body="&lt;p&gt;You can achieve this by simply adding the following style to your org file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD_EXTRA: &amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt; blockquote {background:#EEEEEE; padding: 3px 13px}&amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can also put it in a &lt;code&gt;css&lt;/code&gt; file (e.g. &lt;code&gt;yourStyle.css&lt;/code&gt;):&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-css prettyprint-override&quot;&gt;&lt;code&gt;blockquote {&#xA;    background: #EEEEEE;&#xA;    padding: 3px 13px;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and include it&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD: &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;yourStyle.css&amp;quot;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;em&gt;EDIT:&lt;/em&gt; added &lt;code&gt;type=&amp;quot;text/css&amp;quot;&lt;/code&gt; as suggested by user16762&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2023-10-05T05:59:27.957" LastActivityDate="2023-10-05T05:59:27.957" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27146" PostTypeId="1" AcceptedAnswerId="27155" CreationDate="2016-09-17T23:02:26.203" Score="-4" ViewCount="584" Body="&lt;p&gt;I've been looking at &lt;a href=&quot;https://www.masteringemacs.org/article/whats-new-in-emacs-25-1&quot; rel=&quot;nofollow&quot;&gt;Mickey Petersen's exegesis&lt;/a&gt; on the &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS&quot; rel=&quot;nofollow&quot;&gt;Emacs 25.1 NEWS file&lt;/a&gt;, and realized that built-in Emacs Lisp files are a mess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The worst offender is without a doubt &lt;code&gt;subr.el&lt;/code&gt;, whose description simply says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Basic lisp subroutines for Emacs&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From what I can see, it is a motley collection of functions that has accumulated over decades, with no rhyme or reason as to why anything is or is not in there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also &lt;code&gt;subr-x.el&lt;/code&gt;, etc. which add to the confusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something about &lt;code&gt;subr.el&lt;/code&gt; (and Emacs Lisp files in general) that makes refactoring difficult? Would things break if, say, &lt;code&gt;string-&lt;/code&gt; functions were moved into &lt;code&gt;string.el&lt;/code&gt;, keymap functions were moved into &lt;code&gt;keymap.el&lt;/code&gt;, etc.?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-09-18T11:47:46.080" Title="Why is Emacs code so unorganized?" Tags="|emacs-internals|" AnswerCount="2" CommentCount="3" ClosedDate="2016-09-21T22:52:11.213" ContentLicense="CC BY-SA 3.0" />
  <row Id="27147" PostTypeId="1" AcceptedAnswerId="27148" CreationDate="2016-09-18T01:47:51.297" Score="67" ViewCount="12573" Body="&lt;p&gt;How do I list the branches of a repository in Magit (i.e., the equivalent of &lt;code&gt;git branch --list&lt;/code&gt;)? I expected to find this in the branch popup, but it seems to be neither there nor was I able to find it anywhere in the &quot;Inspecting&quot; section of the User's manual. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="8357" LastActivityDate="2020-11-16T06:13:39.687" Title="How to list branches with Magit" Tags="|magit|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27148" PostTypeId="2" ParentId="27147" CreationDate="2016-09-18T02:02:47.180" Score="89" Body="&lt;p&gt;Use &lt;code&gt;magit-show-refs&lt;/code&gt;, bound by default to &lt;code&gt;y&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2019-08-15T23:39:29.500" LastActivityDate="2019-08-15T23:39:29.500" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="27149" PostTypeId="2" ParentId="27146" CreationDate="2016-09-18T02:03:16.767" Score="1" Body="&lt;p&gt;Several reasons. First, emacs has grown over time. Thousands of people have contributed, and not all of the code is of identical quality. Like all things which grow over time, the final shape was not planned out in detail from the beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, emacs is more than a little bit influenced by image-based systems such as the Lisp Machine, Smalltalk, etc. In these systems, there is no separation between typing out a function into a source file and defining that function for immediate use. In these systems you might save a set of functions to a file in order to send them to someone else, but that file isn't needed for the functions you've defined to exist, even through a shutdown and reboot of the machine. Emacs does however live on systems that don't work that way, so it does have canonical source files. Once you've loaded a source file, however, you can call the functions they contain without reference to where they came from. To a first approximation you could rename all of the files to randomized names and emacs wouldn't care.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, not all files are actually loaded all of the time. If you don't use feature X, then the source files for feature X don't get loaded. If you did mangle all of the file names, then loading optional features would often fail unless you knew the new filenames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is that once it's running emacs doesn't care much about how functions are organized into files, but it is frequently necessary to know that filename in order to load the stuff you need. One makes reorganizing things easier, the other makes it harder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, it's not quite so dire as that. These days we mostly &lt;code&gt;require&lt;/code&gt; packages, rather than &lt;code&gt;load&lt;/code&gt; specific files. That makes refactoring them easier again! Maybe we just need people to dive in an propose patches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To address your specific questions about subr.el, I don't think that it's part of any package. It literally is just a collection of functions that always need to be available. Moving them around shouldn't be hard at all. There are probably some details of the early-stage loading process that need to be kept in mind (gotta define things before you use them, for instance), but otherwise it should be pretty straight-forward.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-18T02:03:16.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27151" PostTypeId="1" AcceptedAnswerId="27166" CreationDate="2016-09-18T04:52:09.080" Score="5" ViewCount="1204" Body="&lt;p&gt;What is the idiomatic way to make one face the same as another?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I would like &lt;code&gt;vertical-border&lt;/code&gt; to be exactly the same as &lt;code&gt;default&lt;/code&gt;. Preferably, if &lt;code&gt;default&lt;/code&gt; changes, so does &lt;code&gt;vertical-border&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure that creating a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Functions.html&quot; rel=&quot;noreferrer&quot;&gt;face alias&lt;/a&gt; is the right thing to do. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It's not clear that we should be aliasing one face as another. &lt;/li&gt;&#xA;&lt;li&gt;By the time the init file is loaded, the vertical border has already rendered, and aliasing does not re-render the vertical border&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;At the very least, I'd like to have something like &lt;code&gt;(copy-face 'default 'vertical-border)&lt;/code&gt; that copied all attributes of &lt;code&gt;default&lt;/code&gt; into &lt;code&gt;vertical-border&lt;/code&gt;, even if it's a one-time thing and the latter will not change when the former does.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-09-18T18:07:26.787" Title="Use one face's attributes in another" Tags="|faces|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27152" PostTypeId="2" ParentId="21935" CreationDate="2016-09-18T08:06:49.787" Score="0" Body="&lt;p&gt;The following works to give a latex-mode editing environment within org-mode but then have it export unprocessed for MathJax to work on:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC latex :results html replace :exports results :eval t&#xA;  \begin{equation}&#xA;    x! =&#xA;    \begin{cases}&#xA;      1 &amp;amp; x = 0 \\&#xA;      x * (x-1)! &amp;amp; \text{otherwise} \\&#xA;    \end{cases}&#xA;  \end{equation}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_HTML&#xA;\begin{equation}&#xA;  x! =&#xA;  \begin{cases}&#xA;    1 &amp;amp; x = 0 \\&#xA;    x * (x-1)! &amp;amp; \text{otherwise} \\&#xA;  \end{cases}&#xA;\end{equation}&#xA;#+END_HTML&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;ob-latex&lt;/code&gt; feature should be loaded before executing the example above.&lt;/p&gt;&#xA;" OwnerUserId="12451" LastEditorUserId="15748" LastEditDate="2017-11-09T11:17:04.140" LastActivityDate="2017-11-09T11:17:04.140" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27153" PostTypeId="1" AcceptedAnswerId="27163" CreationDate="2016-09-18T08:33:59.333" Score="1" ViewCount="844" Body="&lt;p&gt;After installing the new Emacs 25.1 (universal binary) on my Mac OSX 10.11.6 I got the following init error after starting with --debug-init. I don't know what to do. Can you help me?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function set-fringe-mode)&#xA;  (set-fringe-mode (quote (5 . 5)))&#xA;  eval-buffer(#&amp;lt;buffer  *load*-808999&amp;gt; nil &quot;/Users/sergiobacelar/.emacs.d/starter-kit-bindings.el&quot; nil t)  ; Reading at buffe$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;:&#xA;After solving &lt;code&gt;fringe-mode&lt;/code&gt;problem I got new ones: This is the new debug-init:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (invalid-function (quote ([&quot;Comment Out Region&quot; comment-region (c-fn-region-is-active-p)] [&quot;Uncomment Region&quot; (comment-region (region-beginning) (region-end) (quote (4))) (c-fn-region-is-active-p)] [&quot;Indent Expression&quot; c-indent-exp (memq (char-after) (quote (40 91 123)))] [&quot;Indent Line or Region&quot; c-indent-line-or-region t] [&quot;Fill Comment Paragraph&quot; c-fill-paragraph t] &quot;----&quot; [&quot;Backward Statement&quot; stan-beginning-of-statement t] [&quot;Forward Statement&quot; stan-end-of-statement t] [&quot;Backward Block&quot; stan-beginning-of-block t] [&quot;Forward Block&quot; stan-end-of-block t] [&quot;Mark Block&quot; stan-mark-block t] &quot;----&quot; (&quot;Style...&quot; [&quot;Set Style...&quot; c-set-style t] [&quot;Show Current Style Name&quot; (message &quot;Style Name: %s&quot; c-indentation-style) t] [&quot;Guess Style from this Buffer&quot; c-guess-buffer-no-install t] [&quot;Install the Last Guessed Style&quot; c-guess-install (and c-guess-guessed-offsets-alist c-guess-guessed-basic-offset)] [&quot;View the Last Guessed Style&quot; c-guess-view (and c-guess-guessed-offsets-alist c-guess-guessed-basic-offset)]) &quot;----&quot; (&quot;Toggle...&quot; [&quot;Syntactic indentation&quot; c-toggle-syntactic-indentation t] [&quot;Electric mode&quot; c-toggle-electric-state t] [&quot;Auto newline&quot; c-toggle-auto-newline t] [&quot;Hungry delete&quot; c-toggle-hungry-state t] [&quot;Subword mode&quot; c-subword-mode t]))))&#xA;  signal(invalid-function ((quote ([&quot;Comment Out Region&quot; comment-region (c-fn-region-is-active-p)] [&quot;Uncomment Region&quot; (comment-region (region-beginning) (region-end) (quote (4))) (c-fn-region-is-active-p)] [&quot;Indent Expression&quot; c-indent-exp (memq (char-after) (quote (40 91 123)))] [&quot;Indent Line or Region&quot; c-indent-line-or-region t] [&quot;Fill Comment Paragraph&quot; c-fill-paragraph t] &quot;----&quot; [&quot;Backward Statement&quot; stan-beginning-of-statement t] [&quot;Forward Statement&quot; stan-end-of-statement t] [&quot;Backward Block&quot; stan-beginning-of-block t] [&quot;Forward Block&quot; stan-end-of-block t] [&quot;Mark Block&quot; stan-mark-block t] &quot;----&quot; (&quot;Style...&quot; [&quot;Set Style...&quot; c-set-style t] [&quot;Show Current Style Name&quot; (message &quot;Style Name: %s&quot; c-indentation-style) t] [&quot;Guess Style from this Buffer&quot; c-guess-buffer-no-install t] [&quot;Install the Last Guessed Style&quot; c-guess-install (and c-guess-guessed-offsets-alist c-guess-guessed-basic-offset)] [&quot;View the Last Guessed Style&quot; c-guess-view (and c-guess-guessed-offsets-alist c-guess-guessed-basic-offset)]) &quot;----&quot; (&quot;Toggle...&quot; [&quot;Syntactic indentation&quot; c-toggle-syntactic-indentation t] [&quot;Electric mode&quot; c-toggle-electric-state t] [&quot;Auto newline&quot; c-toggle-auto-newline t] [&quot;Hungry delete&quot; c-toggle-hungry-state t] [&quot;Subword mode&quot; c-subword-mode t])))))&#xA;  c-get-lang-constant(c-mode-menu (cc-langs) stan-mode)&#xA;  byte-code(&quot;\302\303\304\305   \306=\203\307\202\310\311\312\313#B$\207&quot; [stan-mode-map c-version-sym easy-menu-do-define stan-menu &quot;Stan Mode Commands&quot; &quot;Stan&quot; 5\.32\.5 ([&quot;Comment Out Region&quot; comment-region (c-fn-region-is-active-p)] [&quot;Uncomment Region&quot; (comment-region (region-beginning) (region-end) (quote (4))) (c-fn-region-is-active-p)] [&quot;Indent Expression&quot; c-indent-exp (memq (char-after) (quote (40 91 123)))] [&quot;Indent Line or Region&quot; c-indent-line-or-region t] [&quot;Fill Comment Paragraph&quot; c-fill-paragraph t] &quot;----&quot; [&quot;Backward Statement&quot; stan-beginning-of-statement t] [&quot;Forward Statement&quot; stan-end-of-statement t] [&quot;Backward Block&quot; stan-beginning-of-block t] [&quot;Forward Block&quot; stan-end-of-block t] [&quot;Mark Block&quot; stan-mark-block t] &quot;----&quot; (&quot;Style...&quot; [&quot;Set Style...&quot; c-set-style t] [&quot;Show Current Style Name&quot; (message &quot;Style Name: %s&quot; c-indentation-style) t] [&quot;Guess Style from this Buffer&quot; c-guess-buffer-no-install t] [&quot;Install the Last Guessed Style&quot; c-guess-install (and c-guess-guessed-offsets-alist c-guess-guessed-basic-offset)] [&quot;View the Last Guessed Style&quot; c-guess-view (and c-guess-guessed-offsets-alist c-guess-guessed-basic-offset)]) &quot;----&quot; (&quot;Toggle...&quot; [&quot;Syntactic indentation&quot; c-toggle-syntactic-indentation t] [&quot;Electric mode&quot; c-toggle-electric-state t] [&quot;Auto newline&quot; c-toggle-auto-newline t] [&quot;Hungry delete&quot; c-toggle-hungry-state t] [&quot;Subword mode&quot; c-subword-mode t])) c-get-lang-constant c-mode-menu (cc-langs) stan-mode] 9)&#xA;  require(stan-mode)&#xA;  byte-code(&quot;\300\301!\210\300\302!\207&quot; [require stan-mode yasnippet] 2)&#xA;  (stan-snippets-initialize)&#xA;  (lambda nil (stan-snippets-initialize))()&#xA;  eval-after-load-helper(&quot;/Users/sergiobacelar/.emacs.d/elpa/yasnippet-20160801.1142/yasnippet.elc&quot;)&#xA;  run-hook-with-args(eval-after-load-helper &quot;/Users/sergiobacelar/.emacs.d/elpa/yasnippet-20160801.1142/yasnippet.elc&quot;)&#xA;  do-after-load-evaluation(&quot;/Users/sergiobacelar/.emacs.d/elpa/yasnippet-20160801.1142/yasnippet.elc&quot;)&#xA;  require(yasnippet)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-202317&amp;gt; nil &quot;/Users/sergiobacelar/.emacs.d/starter-kit-completion.el&quot; nil t)  ; Reading at buffer position 226&#xA;  load-with-code-conversion(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-completion.el&quot; &quot;/Users/sergiobacelar/.emacs.d/starter-kit-completion.el&quot; nil nil)&#xA;  load(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-completion.el&quot; nil nil t)&#xA;  load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-completion.el&quot;)&#xA;  org-babel-load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit-completion.org&quot;)&#xA;  starter-kit-load(&quot;starter-kit-completion.org&quot;)&#xA;  eval-buffer(#&amp;lt;buffer  *load*-77724&amp;gt; nil &quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; nil t)  ; Reading at buffer position 3859&#xA;  load-with-code-conversion(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; &quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; nil nil)&#xA;  load(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot; nil nil t)&#xA;  load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.el&quot;)&#xA;  org-babel-load-file(&quot;/Users/sergiobacelar/.emacs.d/starter-kit.org&quot;)&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/Users/sergiobacelar/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 3581&#xA;  load-with-code-conversion(&quot;/Users/sergiobacelar/.emacs.d/init.el&quot; &quot;/Users/sergiobacelar/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/Users/sergiobacelar/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\266 \306=\203\307\310Q\202? \311=\204\307\312Q\202?\313\307\314\315#\203*\316\202?\313\307\314\317#\203&amp;gt;\320\321\322!D\nB\323\202?\316\324\325\324\211#\210\324=\203e\326\327\330\307\331Q!\&quot;\325\324\211#\210\324=\203d\210\203\247\332!\333\232\203\247\334!\211\335P\336!\203\201\211\202\214\336!\203\213\202\214\314\262\203\245\337\&quot;\203\243\340\341#\210\342\343!\210\266\f?\205\264\314\325\344\324\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; initialization format-message &quot;`_emacs' init file is deprecated, please use `.emacs'&quot; &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6988" LastEditorUserId="5296" LastEditDate="2016-09-19T02:51:37.280" LastActivityDate="2016-09-19T02:51:37.280" Title="Problem with init file with new Emacs 25.1 on OSX" Tags="|init-file|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27154" PostTypeId="1" CreationDate="2016-09-18T11:15:52.693" Score="11" ViewCount="4245" Body="&lt;p&gt;I'm trying to export some python code with syntax highlighted to a pdf, from org-mode. Even though I can export to html without any issues I could not find a way to export it to pdf. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. I'm using spacemacs but also tried without success with vanilla emacs.&lt;/p&gt;&#xA;" OwnerUserId="13328" LastEditorUserId="13329" LastEditDate="2016-09-23T16:14:26.290" LastActivityDate="2018-10-08T12:20:00.517" Title="Exporting highlighted source code to pdf in Org-Mode" Tags="|org-mode|org-export|python|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27155" PostTypeId="2" ParentId="27146" CreationDate="2016-09-18T11:47:46.080" Score="14" Body="&lt;p&gt;&lt;code&gt;subr-x&lt;/code&gt; exists for a purely technical reason that goes down to a peculiarity of Emacs' build process: The Emacs' binary contains the loaded byte code of some selected core libraries for efficiency.  &lt;code&gt;subr&lt;/code&gt; is among these, and thus every running instance of Emacs as &lt;code&gt;subr&lt;/code&gt; loaded—which in turn means that every single definition in &lt;code&gt;subr&lt;/code&gt; is loaded in every running instance of Emacs, whether you use it or not.  Hence it's crucial that &lt;code&gt;subr&lt;/code&gt; only contains definitions that are very likely to be used by Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;subr-x&lt;/code&gt; serves as a staging ground for new &lt;code&gt;subr&lt;/code&gt; functions: It exists to make these functions available without dumping them into all Emacs' binaries.  If there's sufficient interest in these functions they'll be moved to &lt;code&gt;subr&lt;/code&gt; and included in the dumped Emacs.  Otherwise they'll be removed at some point, into a different library or entirely from Emacs.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As for the general sentiment I disagree.  I'd say that it's a strong move to call something &quot;messy&quot; without trying to understand the reasons and history first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;subr&lt;/code&gt; is probably not the best part of Emacs, but it's also one of the oldest, and one touched by many different people.  I'd say that &lt;code&gt;subr&lt;/code&gt; is to Emacs what the dreaded &lt;code&gt;util&lt;/code&gt; module is to other software: None likes it, but you'll also have a hard time to find any software that doesn't have this module in one or another manifestation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every system beyond a certain size feels the need for shared code that seemingly fits nowhere else, and it takes a very skilled and disciplined development team with strong respect for policies to abstract shared code in a way that avoids the &lt;code&gt;util&lt;/code&gt; trap.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a project with as many contributors as Emacs that's almost impossible, or at least very expensive in terms of time spent in code reviews and refactoring, time that's—given Emacs' limited resources—better spent elsewhere. We may not like &lt;code&gt;util&lt;/code&gt; modules but let's be honest they're not doing any harm either.  A project shouldn't strive for perfect quality, it should strive for the quality that is sufficient to do the job.  You shouldn't spent 80% of your resources for a 20% increase in code quality, the less, if your resources are as limited as Emacs' in relation to the project's size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs code has its dark corners, but it's not any more messy or unstructured than other large systems I've seen.  On the contrary I find it very remarkable that Emacs maintains discipline and structure despite it's decades old history and huge fluctuation in contributors.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-09-18T11:47:46.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27156" PostTypeId="1" AcceptedAnswerId="27242" CreationDate="2016-09-18T12:06:00.797" Score="1" ViewCount="601" Body="&lt;p&gt;How can we highlight SQL code in some log files, with Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample log file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[DEBUG][2016-05-26 09:04:51,714][FileHelper] - [realContextPath=[/server.xml]]&#xA;[DEBUG][2016-05-26 10:24:22,369][DbConnectionImpl] - [DELETE FROM xct_log]&#xA;[DEBUG][2016-05-26 11:00:46,925][DataSourceRestrictionConverter] - [parseRestrictions]&#xA;[DEBUG][2016-05-26 10:24:22,476][DbConnectionImpl] - [UPDATE hlpdsk_step_log&#xA;SET table_name= 'hxct_log' WHERE&#xA; table_name='xct_log' AND pkey_value = 247296]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The goal would be to put a light yellow background behind SQL code, that is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;code found between the last [...] (can be on multiple physical lines, as shown in the last line of the log sample), and&lt;/li&gt;&#xA;&lt;li&gt;code found on lines where the &quot;source&quot; (3rd bracket pair) is &quot;DbConnectionImpl&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If possible, the yellow background should only be between those last 2 brackets, on the right lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Originally posted on StackOverflow, but advised to post it here.)&lt;/p&gt;&#xA;" OwnerUserId="12539" LastActivityDate="2016-09-23T01:57:58.190" Title="Syntax highlighting (in Emacs) for SQL code in log files" Tags="|syntax-highlighting|highlighting|syntax|highlight-chars|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27157" PostTypeId="2" ParentId="27116" CreationDate="2016-09-18T13:31:23.317" Score="10" Body="&lt;p&gt;Edit: The below description is of course still accurate, but it should be noted that Magit now falls back to deleting just the local remote-tracking ref if the respective branch does not actually exist on the remote anymore.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Pulling out the relevant information from the question comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit does not provide a direct equivalent of &lt;code&gt;git branch -D -r &amp;lt;remote&amp;gt;/&amp;lt;branch&amp;gt;&lt;/code&gt;.&#xA;The &lt;code&gt;--prune&lt;/code&gt; flag from the fetch popup (by default, &lt;kbd&gt;f-p&lt;/kbd&gt;)&#xA;can be used instead to delete all stale remote-tracking for a&#xA;particular remote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that Magit doesn't provide a command for &lt;code&gt;git branch -D -r&lt;/code&gt;&#xA;because it is the assumed that it would be rare for a user to want to&#xA;delete a single stale remote-tracking branch but not prune other stale&#xA;remote-tracking branches for that remote.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If the branch does still exist on a remote, &lt;kbd&gt;k&lt;/kbd&gt; will run&#xA;&lt;code&gt;git push &amp;lt;remote&amp;gt; :&amp;lt;branch&amp;gt;&lt;/code&gt;, deleting the branch on the remote and&#xA;cleaning up the local remote-tracking branch.  So, provided that&#xA;the branch hasn't been deleted from the remote in some other way&#xA;(e.g., through GitHub's web interface or by running &lt;code&gt;git push &amp;lt;remote&amp;gt; :&amp;lt;branch&amp;gt;&lt;/code&gt;&#xA;from another machine), this command is all you need to run (at least&#xA;until you get on another machine and want to prune the remote-tracking&#xA;branches there).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike &lt;code&gt;git push &amp;lt;remote&amp;gt; :&amp;lt;branch&amp;gt;&lt;/code&gt;, &lt;code&gt;git branch -D -r &amp;lt;remote&amp;gt;/&amp;lt;branch&amp;gt;&lt;/code&gt;&#xA;is not sufficient to delete the branch on the remote.  This is&#xA;described in &lt;code&gt;man git-branch&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Use -r together with -d to delete remote-tracking branches. Note, that it only makes&#xA;sense to delete remote-tracking branches if they no longer exist in the remote&#xA;repository or if git fetch was configured not to fetch them again. See also the prune&#xA;subcommand of git-remote(1) for a way to clean up all obsolete&#xA;remote-tracking branches.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The example below shows what the above quote is talking about.  If you&#xA;just use &lt;code&gt;git branch -D -r&lt;/code&gt;, the local remote-tracking branch will&#xA;deleted just to be recreated on the next fetch.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set -x&#xA;&#xA;# Repo setup&#xA;&#xA;mkdir remote-repo&#xA;cd remote-repo&#xA;git init --bare&#xA;&#xA;cd ..&#xA;mkdir local-repo&#xA;cd local-repo&#xA;&#xA;git init&#xA;echo text &amp;gt; some-file&#xA;git add some-file&#xA;git commit -m&quot;Add some file&quot;&#xA;git checkout -b feat master&#xA;echo text &amp;gt; feat-file&#xA;git add feat-file&#xA;git commit -m&quot;Add feature file&quot;&#xA;git remote add origin ../remote-repo&#xA;git push origin feat master&#xA;&#xA;# branch -D -r test&#xA;&#xA;git branch -D -r origin/feat&#xA;ls .git/refs/remotes/origin/&#xA;&#xA;git fetch origin&#xA;ls .git/refs/remotes/origin/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But a &lt;code&gt;git push origin :feat&lt;/code&gt; (or, in Magit, &lt;kbd&gt;k&lt;/kbd&gt; and then&#xA;selecting &lt;code&gt;origin/feat&lt;/code&gt;) will get rid of the branch in both places.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git push origin :feat&#xA;ls .git/refs/remotes/origin/&#xA;&#xA;git fetch origin&#xA;ls .git/refs/remotes/origin/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="306" LastEditDate="2016-09-26T12:34:29.003" LastActivityDate="2016-09-26T12:34:29.003" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27158" PostTypeId="1" AcceptedAnswerId="27161" CreationDate="2016-09-18T15:45:00.917" Score="13" ViewCount="3114" Body="&lt;p&gt;Since several years I've been using this snippet to insert a date into buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- coding: utf-8 -*-&#xA;# name: date&#xA;# key: date&#xA;# --&#xA;`(insert (format-time-string &quot;%Y-%m-%d&quot;))`$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However nowadays I get this annoying warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (yasnippet): `date' modified buffer in a backquote expression.&#xA;To hide this warning, add (yasnippet backquote-change) to `warning-suppress-types'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is clearly related to &lt;a href=&quot;https://emacs.stackexchange.com/questions/24470/warning-yasnippet-modified-buffer-in-a-backquote-expression&quot;&gt;this question&lt;/a&gt;, but it is not clear what is the proper way to fix the snippet (rather then just suppress the message).&lt;/p&gt;&#xA;" OwnerUserId="5237" LastEditorUserId="5237" LastEditDate="2016-09-19T12:16:29.143" LastActivityDate="2016-09-19T12:16:29.143" Title="Insert current date with yasnippet" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27159" PostTypeId="1" CreationDate="2016-09-18T16:03:42.707" Score="3" ViewCount="1860" Body="&lt;p&gt;Lately, I'm working on how to configure the best grouped company-backends for different major modes, although having been using company-mode for over one year (already got a configuration long time ago), but recently realized it was not working as I expected, and started looking for the official documentation on how to configure it, but found nothing useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example&#xA;in emacs-lisp-mode, words in buffers, yasnippet, elisp(company-capf), etc., sorted in this order in the droplist&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in c/c++-mode, words in buffers, yasnippet, the name(variable, function, struct etc.), etc,.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in org-mode, words in buffers,  yasnippet, etc,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in latex-mode, words in buffers, yasnippet, latex-environment, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I insert and &quot;/&quot;, it should use company-files as the primary backend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In above examples, there will be a default company-backends for all the major modes when company-mode is enabled, there will be an extra configuration for a specific minor mode to work with the default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-backends&#xA;  '(&#xA;    (&#xA;     company-files&#xA;     company-dabbrev&#xA;     company-keywords&#xA;     company-capf&#xA;     company-yasnippet&#xA;     )&#xA;    (company-abbrev company-dabbrev)&#xA;    ))&#xA;(add-hook 'emacs-lisp-mode-hook&#xA;      (lambda ()&#xA;        (set (make-local-variable 'company-backends)&#xA;             (append company-backends&#xA;                     '((&#xA;                        company-elisp&#xA;                        ))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I cannot make the company-elisp work, there always are such problems for other major modes, the two backends won't work well for a specific major mode. there always are one or more backends is not working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No official documentation or examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to create grouped company-backends list to work with an extra one for specific major mode?&lt;/p&gt;&#xA;" OwnerUserId="794" LastActivityDate="2017-01-13T13:09:49.857" Title="How to create grouped company-backends list and an extra one for specific major mode?" Tags="|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27160" PostTypeId="2" ParentId="26384" CreationDate="2016-09-18T16:22:34.170" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Can I, for example, activate all &lt;em&gt;except&lt;/em&gt; certain packages? I see you can set &lt;code&gt;package-load-list&lt;/code&gt; to &lt;code&gt;(all)&lt;/code&gt; or a list of names and versions, but I can't see anything like &lt;code&gt;(all-but ,(alist))&lt;/code&gt; in the docs. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You should be able to use &lt;code&gt;((a-slow-package . nil) (an-even-slower-package . nil) all)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As described in the docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Each element in this list should be a list (NAME VERSION), or the&#xA;symbol ‘all’.  The symbol ‘all’ says to load the latest installed&#xA;versions of all packages not specified by other elements.&#xA;&#xA;For an element (NAME VERSION), NAME is a package name (a symbol).&#xA;[...]&#xA;If VERSION is nil, the package is not loaded (it is &quot;disabled&quot;).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-09-18T16:22:34.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27161" PostTypeId="2" ParentId="27158" CreationDate="2016-09-18T16:27:44.630" Score="21" Body="&lt;p&gt;You should rewrite your snippet so that the backquoted expression doesn't modify the buffer, but instead returns the string to insert:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- coding: utf-8 -*-&#xA;# name: date&#xA;# key: date&#xA;# --&#xA;`(format-time-string &quot;%Y-%m-%d&quot;)`$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more examples, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/24060/yasnippet-truncates-clipboard-contents&quot;&gt;yasnippet truncates clipboard contents&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-09-18T16:27:44.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27162" PostTypeId="1" CreationDate="2016-09-18T16:34:08.383" Score="5" ViewCount="374" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/798/2264&quot;&gt;Recording a GIF screencast of Emacs&lt;/a&gt; details a few ways we can record screencasts of Emacs sessions (e.g. to demonstrate features), but I'm &lt;em&gt;really&lt;/em&gt; bad at not screwing things up :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to script a session such that I can fake proficiency with my own package?  Essentially such a thing would be a keyboard macro, but it would not run at superhuman speeds and would be writable as a true script.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, the interface would be something like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(emacs-session-script&#xA;  &quot;M-x&quot;&#xA;  (insert &quot;magit-status&quot;)&#xA;  &quot;RET&quot;&#xA;  (pause 1)&#xA;  &quot;@&quot;&#xA;  (pause 1)&#xA;  &quot;i&quot;&#xA;  (pause 1)&#xA;  &quot;=l&quot;&#xA;  (pause 0.5)&#xA;  (insert &quot;Here is some text inserted into &quot;)&#xA;  (insert &quot;the minibuffer with a typewriter-like effect&quot;)&#xA;  (pause 1)&#xA;  &quot;RET&quot;&#xA;  ; Now emacs has switched to a new buffer&#xA;  ; (insert :speed is now 10 characters/second here)&#xA;  (insert :speed 10 &quot;Here is a long piece of text&#xA;&#xA;with many lines&quot;)&#xA;  (pause 1)&#xA;  &quot;C-c C-c&quot;&#xA;  (pause 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2018-10-22T19:48:05.880" Title="How can I script an emacs recording session?" Tags="|script|screencast|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27163" PostTypeId="2" ParentId="27153" CreationDate="2016-09-18T17:02:04.607" Score="2" Body="&lt;p&gt;The original poster is suffering from two (2) distinct issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Issue #1&lt;/strong&gt;:  The first issue is resolved by placing &lt;code&gt;(require 'fringe)&lt;/code&gt; at the top of the &lt;code&gt;.emacs&lt;/code&gt; file, saving the modified file, and restarting Emacs.  The first error message tells us that the function &lt;code&gt;set-fringe-mode&lt;/code&gt; has not been defined yet, and a quick &lt;code&gt;grep&lt;/code&gt; of the Emacs lisp source-code reveals that the function at issue is contained in the library &lt;code&gt;fringe.el&lt;/code&gt;.  If we open up &lt;code&gt;fringe.el&lt;/code&gt;, we can see that it contains a &lt;code&gt;provide&lt;/code&gt; statement at the bottom of the file -- so a &lt;code&gt;require&lt;/code&gt; statement in the &lt;code&gt;.emacs&lt;/code&gt; file is sufficient to load the entire &lt;code&gt;fringe.el&lt;/code&gt; file (assuming it is in its default location within the &lt;code&gt;load-path&lt;/code&gt;).  We put the &lt;code&gt;require&lt;/code&gt; statement at the top of the &lt;code&gt;.emacs&lt;/code&gt; file because we are guaranteed that it will load first in time -- before whatever else in the user-configuration is calling a function from that library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Issue #2&lt;/strong&gt;:  The second issue/diagnosis was identified by @npostavs as being a known problem with &lt;code&gt;stan-mode&lt;/code&gt; incapatibality with Emacs 25:  &lt;a href=&quot;https://github.com/stan-dev/stan-mode/issues/47&quot; rel=&quot;nofollow&quot;&gt;https://github.com/stan-dev/stan-mode/issues/47&lt;/a&gt;  There are a few general approaches  (1) disable &lt;code&gt;stan-mode&lt;/code&gt; in the user-configuration and don't use it; (2) wait patiently for a fix from the &lt;code&gt;stan-mode&lt;/code&gt; maintainers; (3) dig-into &lt;code&gt;stan-mode&lt;/code&gt; and &lt;code&gt;cc-mode&lt;/code&gt; and contribute to fixing Github issue number 47; or, (4) go back to a previous version of Emacs where &lt;code&gt;stan-mode&lt;/code&gt; still plays nice with &lt;code&gt;cc-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-09-19T00:47:34.703" LastActivityDate="2016-09-19T00:47:34.703" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="27164" PostTypeId="2" ParentId="27159" CreationDate="2016-09-18T17:58:11.193" Score="5" Body="&lt;p&gt;I faced with this exact same problem a couple of weeks back. &lt;code&gt;company-mode&lt;/code&gt; was not behaving as expected for some major modes and for major modes I got no completion at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it turns out the solution was pretty simple. Here's my config for emacs-lisp-mode :- &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package emacs-lisp-mode&#xA;  :init&#xA;  (defun my-elisp-mode-hook ()&#xA;    &quot;Hook for `emacs-lisp-mode'&quot;&#xA;    (set (make-local-variable 'company-backends)&#xA;         '((company-capf company-dabbrev-code company-yasnippet company-files))))&#xA;&#xA;  (add-hook 'emacs-lisp-mode-hook 'my-elisp-mode-hook)&#xA;  (add-hook 'emacs-lisp-mode-hook 'company-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Follow the same recipe for other major modes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for creating a grouped backend for company to use for all modes, add something like this to your &lt;code&gt;.emacs&lt;/code&gt; :- &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (add-to-list 'company-backends 'company-dabbrev-code)&#xA;  (add-to-list 'company-backends 'company-yasnippet)&#xA;  (add-to-list 'company-backends 'company-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-09-19T09:47:50.350" LastActivityDate="2016-09-19T09:47:50.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27165" PostTypeId="2" ParentId="27144" CreationDate="2016-09-18T18:07:19.087" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;TeX-after-compilation-finished-functions&lt;/code&gt;, as the name suggests it can be used to run functions after the compilation finished successfully.  This is its docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hook being run after TeX/LaTeX/ConTeXt finished successfully. The&#xA;  functions in this hook are run with the DVI/PDF output file given as&#xA;  argument.  Using this hook can be useful for updating the viewer&#xA;  automatically after re-compilation of the document.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If you use an emacs-internal viewer such as &lt;code&gt;doc-view-mode&lt;/code&gt; or&#xA;  &lt;code&gt;pdf-view-mode&lt;/code&gt;, add &lt;code&gt;TeX-revert-document-buffer&lt;/code&gt; to this hook.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-09-18T18:07:19.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27166" PostTypeId="2" ParentId="27151" CreationDate="2016-09-18T18:07:26.787" Score="4" Body="&lt;p&gt;What @lawlist said. But you can &lt;em&gt;ask Emacs&lt;/em&gt; about it, not just Google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h i m elisp&lt;/code&gt; to visit the Elisp manual, then &lt;strong&gt;&lt;code&gt;i inherit TAB&lt;/code&gt;&lt;/strong&gt;, to look up &lt;code&gt;inheritance&lt;/code&gt; entries in the index.  Choose &lt;strong&gt;&lt;code&gt;inheritance, for faces&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That takes you to the manual node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html&quot; rel=&quot;nofollow&quot;&gt;Face Attributes&lt;/a&gt;, which tells you all about how to make one face inherit from others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interactively, for your own use, you can do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-face vertical-border&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Change the definition, so that the face just inherits from face &lt;code&gt;default&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Save your changes.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To make the face inherit from &lt;code&gt;default&lt;/code&gt;, check the &lt;code&gt;Inherit&lt;/code&gt; attribute checkbox, and specify &lt;code&gt;default&lt;/code&gt; as the fact to inherit from.  (&lt;code&gt;INS&lt;/code&gt; and &lt;code&gt;DEL&lt;/code&gt; buttons insert a new line/entry and delete the current line/entry, respectively.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-09-18T18:07:26.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27167" PostTypeId="1" AcceptedAnswerId="27172" CreationDate="2016-09-18T19:53:30.283" Score="1" ViewCount="438" Body="&lt;p&gt;I would like to keep distinct desktop files in order to be able resume sessions based on the mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I open Emacs it should load the desktop file for the mode it starts with and when I run, say, &lt;code&gt;M-x latex-mode&lt;/code&gt; it should load (and later overwrite) another desktop file. In my noobness I had hoped a&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq desktop-path '(&quot;~/.emacs.d/desktops/plain&quot; ~/.emacs.d/desktops/latex-mode&quot;))&#xA;(defun my-TeX-hook ()&#xA;  (desktop-change-dir &quot;~/.emacs.d/desktops/latex-mode&quot;))&#xA;(add-hook 'TeX-mode-hook 'my-TeX-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;.emacs&lt;/code&gt; would work, but it didn't.&lt;/p&gt;&#xA;" OwnerUserId="13275" LastEditorUserId="13275" LastEditDate="2016-09-18T20:24:12.737" LastActivityDate="2016-09-18T23:40:23.767" Title="Save and load different desktop files based on the mode" Tags="|hooks|desktop|session|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27168" PostTypeId="1" CreationDate="2016-09-18T20:51:30.423" Score="4" ViewCount="694" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file, I have &lt;code&gt;(global-prettify-symbols-mode)&lt;/code&gt;, and if I visit a &lt;code&gt;.el&lt;/code&gt; document, I see the lambda character instead of &lt;code&gt;lambda&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that in a &lt;code&gt;.tex&lt;/code&gt; file I should see the beta character instead of &lt;code&gt;\beta&lt;/code&gt;, but this does not seem to work. The auctex manual says that if global prettify symbols mode is enabled, then this should work automatically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas of what could be going wrong?&lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2016-09-18T20:51:30.423" Title="prettify-symbols-mode not working in auctex" Tags="|latex|auctex|prettify-symbols-mode|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27169" PostTypeId="2" ParentId="20900" CreationDate="2016-09-18T20:57:34.820" Score="4" Body="&#xA;&#xA;&lt;p&gt;Examining the four answers available currently (&lt;a href=&quot;https://superuser.com/questions/1017094/emacs-jump-to-the-next-line-with-same-indentation&quot;&gt;two on Super User&lt;/a&gt; and two on this question), I see the following issues:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;https://superuser.com/questions/1017094/emacs-jump-to-the-next-line-with-same-indentation&quot;&gt;ones on SuperUser by Stefan and Peng Bai&lt;/a&gt; (moving line-by-line, looking at current indentation) don't implement retaining the current column position and moving up to the parent,&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;https://emacs.stackexchange.com/questions/20900/navigate-by-indentation/20902#20902&quot;&gt;answer by Dan&lt;/a&gt; (using re-search-forward to find next line with the same indentation) skips over lines with less indentation: it doesn't know when there is no next sibling, and can therefore move to something that is not a sibling but a child of another parent… a next &quot;cousin&quot; perhaps.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;https://emacs.stackexchange.com/questions/20900/navigate-by-indentation/20965#20965&quot;&gt;answer by Gilles&lt;/a&gt; (using outline-mode) doesn't retain column position and it doesn't work with lines with zero indentation (&quot;top-level&quot; lines). Also, looking at its code in &lt;code&gt;outline.el&lt;/code&gt;, it too is basically going line-by-line anyway (using &lt;code&gt;outline-next-visible-heading&lt;/code&gt;) in our case, as (almost) all lines would match the outline regexp and count as a &quot;heading&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, putting together some ideas of each, I have the following: move ahead line-by-line, skipping over empty and more-indented lines. If you are at equal indentation then it's the next sibling. The basic idea looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun indentation-get-next-sibling-line ()&#xA;  &quot;The line number of the next sibling, or nil if there isn't any.&quot;&#xA;  (let ((wanted-indentation (current-indentation)))&#xA;    (save-excursion&#xA;      (while (and (zerop (forward-line))  ; forward-line returns 0 on success&#xA;               (or (eolp)  ; Skip past blank lines and more-indented lines&#xA;                 (&amp;gt; (current-indentation) wanted-indentation))))&#xA;      ;; Now we can't go further. Which case is it?&#xA;      (if (and (not (eobp)) (= (current-indentation) wanted-indentation))&#xA;        (line-number-at-pos)&#xA;        nil))))&#xA;&#xA;(defun indentation-forward-to-next-sibling ()&#xA;  (interactive)&#xA;  (let ((saved-column (current-column)))&#xA;    (forward-line (- (indentation-get-next-sibling-line) (line-number-at-pos)))&#xA;    (move-to-column saved-column)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Suitably generalized (forward/backward/up/down), what I'm using looks like the following currently:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun indentation-get-next-good-line (direction skip good)&#xA;  &quot;Moving in direction `direction', and skipping over blank lines and lines that&#xA;satisfy relation `skip' between their indentation and the original indentation,&#xA;finds the first line whose indentation satisfies predicate `good'.&quot;&#xA;  (let ((starting-indentation (current-indentation))&#xA;         (lines-moved direction))&#xA;    (save-excursion&#xA;      (while (and (zerop (forward-line direction))&#xA;               (or (eolp)  ; Skip past blank lines and other skip lines&#xA;                 (funcall skip (current-indentation) starting-indentation)))&#xA;        (setq lines-moved (+ lines-moved direction)))&#xA;      ;; Now we can't go further. Which case is it?&#xA;      (if (and&#xA;            (not (eobp))&#xA;            (not (bobp))&#xA;            (funcall good (current-indentation) starting-indentation))&#xA;        lines-moved&#xA;        nil))))&#xA;&#xA;(defun indentation-get-next-sibling-line ()&#xA;  &quot;The line number of the next sibling, if any.&quot;&#xA;  (indentation-get-next-good-line 1 '&amp;gt; '=))&#xA;&#xA;(defun indentation-get-previous-sibling-line ()&#xA;  &quot;The line number of the previous sibling, if any&quot;&#xA;  (indentation-get-next-good-line -1 '&amp;gt; '=))&#xA;&#xA;(defun indentation-get-parent-line ()&#xA;  &quot;The line number of the parent, if any.&quot;&#xA;  (indentation-get-next-good-line -1 '&amp;gt;= '&amp;lt;))&#xA;&#xA;(defun indentation-get-child-line ()&#xA;  &quot;The line number of the first child, if any.&quot;&#xA;  (indentation-get-next-good-line +1 'ignore '&amp;gt;))&#xA;&#xA;&#xA;(defun indentation-move-to-line (func preserve-column name)&#xA;  &quot;Move the number of lines given by func. If not possible, use `name' to say so.&quot;&#xA;  (let ((saved-column (current-column))&#xA;          (lines-to-move-by (funcall func)))&#xA;    (if lines-to-move-by&#xA;      (progn&#xA;        (forward-line lines-to-move-by)&#xA;        (move-to-column (if preserve-column&#xA;                          saved-column&#xA;                          (current-indentation))))&#xA;      (message &quot;No %s to move to.&quot; name))))&#xA;&#xA;(defun indentation-forward-to-next-sibling ()&#xA;  &quot;Move to the next sibling if any, retaining column position.&quot;&#xA;  (interactive &quot;@&quot;)&#xA;  (indentation-move-to-line 'indentation-get-next-sibling-line t &quot;next sibling&quot;))&#xA;&#xA;(defun indentation-backward-to-previous-sibling ()&#xA;  &quot;Move to the previous sibling if any, retaining column position.&quot;&#xA;  (interactive &quot;@&quot;)&#xA;  (indentation-move-to-line 'indentation-get-previous-sibling-line t &quot;previous sibling&quot;))&#xA;&#xA;(defun indentation-up-to-parent ()&#xA;  &quot;Move to the parent line if any.&quot;&#xA;  (interactive &quot;@&quot;)&#xA;  (indentation-move-to-line 'indentation-get-parent-line nil &quot;parent&quot;))&#xA;&#xA;(defun indentation-down-to-child ()&#xA;  &quot;Move to the first child line if any.&quot;&#xA;  (interactive &quot;@&quot;)&#xA;  (indentation-move-to-line 'indentation-get-child-line nil &quot;child&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is still some more functionality desirable, and looking at the &lt;code&gt;outline.el&lt;/code&gt; and reimplementing some of that may help, but I'm happy with this for now, for my purposes.&lt;/p&gt;&#xA;" OwnerUserId="862" LastEditorUserId="862" LastEditDate="2016-09-19T02:05:42.213" LastActivityDate="2016-09-19T02:05:42.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27170" PostTypeId="2" ParentId="27135" CreationDate="2016-09-18T20:57:41.027" Score="8" Body="&lt;p&gt;Here is a small command that will do this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun query-swap-strings (from-string to-string &amp;amp;optional delimited start end)&#xA;  &quot;Swap occurrences of FROM-STRING and TO-STRING.&quot;&#xA;  (interactive&#xA;   (let ((common&#xA;          (query-replace-read-args&#xA;           (concat &quot;Query swap&quot;&#xA;                   (if current-prefix-arg&#xA;                       (if (eq current-prefix-arg '-) &quot; backward&quot; &quot; word&quot;)&#xA;                     &quot;&quot;)&#xA;                   (if (use-region-p) &quot; in region&quot; &quot;&quot;))&#xA;           nil)))&#xA;     (list (nth 0 common) (nth 1 common) (nth 2 common)&#xA;           (if (use-region-p) (region-beginning))&#xA;           (if (use-region-p) (region-end)))))&#xA;  (perform-replace&#xA;   (concat &quot;\\(&quot; (regexp-quote from-string) &quot;\\)\\|&quot; (regexp-quote to-string))&#xA;   `(replace-eval-replacement replace-quote (if (match-string 1) ,to-string ,from-string))&#xA;   t t delimited nil nil start end))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="478" LastEditorUserId="478" LastEditDate="2016-10-14T08:01:57.287" LastActivityDate="2016-10-14T08:01:57.287" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27171" PostTypeId="2" ParentId="27162" CreationDate="2016-09-18T22:48:51.730" Score="2" Body="&lt;p&gt;It's still in infancy, but &lt;a href=&quot;https://github.com/vermiculus/package-demo&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;package-demo&lt;/code&gt;&lt;/a&gt; has basic ability to do this.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-09-18T22:48:51.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27172" PostTypeId="2" ParentId="27167" CreationDate="2016-09-18T23:30:29.217" Score="1" Body="&lt;p&gt;This is simple to do, if you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow&quot;&gt;Bookmark+&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily create any number of &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#DesktopBookmarks&quot; rel=&quot;nofollow&quot;&gt;desktop bookmarks&lt;/a&gt;, including multiple such in the same directory. And you can then easily switch to any of them just by &quot;jumping&quot; to its bookmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can of course jump to a bookmark, including a desktop bookmark, from a mode hook. E.g., use something like this on your mode hook, where &lt;code&gt;my-desktop-bmk-42&lt;/code&gt; is the name of one of your desktop bookmarks:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'TeX-mode-hook (lambda () (bookmark-jump &quot;my-desktop-bmk-42&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to be sure your &lt;code&gt;bookmark-file&lt;/code&gt; is already loaded (so &lt;code&gt;my-desktop-bmk-42&lt;/code&gt; is defined), then use this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'TeX-mode-hook (lambda ()&#xA;                           (bookmark-maybe-load-default-file)&#xA;                           (bookmark-jump &quot;my-desktop-bmk-42&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can of course define that function as a named function, or even as a command:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun switch-to-desktop-42 ()&#xA;  &quot;Jump to desktop bookmark `my-desktop-bmk-42'.&quot;&#xA;  (interactive)&#xA;  (bookmark-maybe-load-default-file)&#xA;  (bookmark-jump &quot;my-desktop-bmk-42&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-18T23:40:23.767" LastActivityDate="2016-09-18T23:40:23.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27173" PostTypeId="1" CreationDate="2016-09-19T00:07:51.947" Score="1" ViewCount="199" Body="&lt;p&gt;This is my config in init.el:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(require 'helm-projectile)&#xA;(projectile-global-mode)&#xA;(setq projectile-completion-system 'helm)&#xA;(helm-projectile-on)&#xA;(setq projectile-indexing-method 'alien)&#xA;(setq projectile-switch-project-action 'helm-projectile-find-file)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was told &quot;Find: incorrect argument formatting&quot; and failed to list any file when used 'helm-projectile-find-file'.  I found that this error tips was produced by “find.exe”. However, this command works normally in a project which is considered project by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FQCXx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FQCXx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13259" LastEditorUserId="13259" LastEditDate="2016-09-19T00:26:06.530" LastActivityDate="2016-09-19T00:26:06.530" Title="Error in using &quot;helm-projectile-find-file&quot;" Tags="|package|projectile|commands|helm-projectile|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27174" PostTypeId="1" AcceptedAnswerId="27180" CreationDate="2016-09-19T03:33:04.353" Score="1" ViewCount="406" Body="&lt;p&gt;When I commit in Magit, I have the option to &quot;Sign using GPG&quot;. But when I revert a commit in Magit, I don't see this option. Is it hidden? If so, how do I activate signing in that context? Otherwise, does the feature not exist?&lt;/p&gt;&#xA;" OwnerUserId="2631" LastActivityDate="2016-09-19T09:29:56.790" Title="How to GPG-sign a commit when reverting in Magit?" Tags="|magit|gpg|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27175" PostTypeId="1" AcceptedAnswerId="27176" CreationDate="2016-09-19T05:18:58.207" Score="1" ViewCount="227" Body="&lt;p&gt;I have a reasonably large buffer, whose first five characters i like to make as comment (this is a simplified problem of a larger issue, so bear with me).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buffer contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;some comment text, whose property needs to be changed.&#xA;(add-text-properties 0 7 &#xA;                     '(comment t face highlight))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When i do &lt;code&gt;eval-buffer&lt;/code&gt;, it throws error as, &lt;code&gt;Args out of range: 0, 7&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the buffer has more than five characters, why does &lt;code&gt;add-text-properties&lt;/code&gt; throw out of range error?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2016-10-27T15:10:03.870" LastActivityDate="2016-10-27T15:10:03.870" Title="add-text-properties throws args out of range" Tags="|text-properties|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27176" PostTypeId="2" ParentId="27175" CreationDate="2016-09-19T05:46:29.553" Score="3" Body="&lt;p&gt;The first point in the buffer is &lt;strong&gt;1&lt;/strong&gt;, not &lt;strong&gt;0&lt;/strong&gt; -- that is why the example produces an error message stating &lt;strong&gt;Args out of range . . .&lt;/strong&gt;.  The doc-string for &lt;code&gt;add-text-properties&lt;/code&gt; states that START and END are buffer positions, unless the optional argument OBJECT is a string.  Since there is no optional OBJECT argument in the example, we are dealing with strictly buffer positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first line of code, &lt;code&gt;(ignore &quot;hello&quot; &quot;bye&quot; &quot;chalo&quot;)&lt;/code&gt;, serves no purpose and detracts from the issue.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;add-text-properties is a built-in function in `C source code'.&#xA;&#xA;(add-text-properties START END PROPERTIES &amp;amp;optional OBJECT)&#xA;&#xA;Add properties to the text from START to END.&#xA;The third argument PROPERTIES is a property list&#xA;specifying the property values to add.  If the optional fourth argument&#xA;OBJECT is a buffer (or nil, which means the current buffer),&#xA;START and END are buffer positions (integers or markers).&#xA;If OBJECT is a string, START and END are 0-based indices into it.&#xA;Return t if any property value actually changed, nil otherwise.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-09-19T05:46:29.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27177" PostTypeId="2" ParentId="27113" CreationDate="2016-09-19T07:09:09.613" Score="2" Body="&lt;p&gt;Just for the record, I ended up solving it via defadvice (it is a hackish solution imho).  When browsing the stacks, I set the value of a local variable (&lt;code&gt;container-path&lt;/code&gt;) to the container path of that specific stack and then I have the following defadvice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice compilation-find-file (around relocate-to-container (marker filename directory &amp;amp;rest formats) activate)&#xA;  (if (and container-path (file-name-absolute-p filename))&#xA;      (let ((filename (concat container-path filename)))&#xA;        ad-do-it)&#xA;    ad-do-it))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4048" LastEditorUserId="4048" LastEditDate="2016-09-19T07:15:03.143" LastActivityDate="2016-09-19T07:15:03.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27178" PostTypeId="1" AcceptedAnswerId="27187" CreationDate="2016-09-19T07:59:01.400" Score="4" ViewCount="214" Body="&lt;p&gt;In the Windows Binary release, if you look at the bin folder, you can see a binary file &lt;code&gt;Emacs.exe&lt;/code&gt; and another one &lt;code&gt;Emacs25.1.exe&lt;/code&gt;, these 2 files are exactly the same.  And it seems that deleting &lt;code&gt;Emacs25.1.exe&lt;/code&gt; doesn't affect it in anyway if you use &lt;code&gt;runemacs.exe&lt;/code&gt;.  why are there 2 identical files? &lt;/p&gt;&#xA;" OwnerUserId="10287" LastActivityDate="2016-09-19T13:20:19.730" Title="Why are there 2 exact same Emacs Binaries in the bin folder?" Tags="|binary|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27179" PostTypeId="1" CreationDate="2016-09-19T08:59:49.543" Score="0" ViewCount="787" Body="&lt;p&gt;I am trying to setup like the following in the top section of my &lt;code&gt;.org&lt;/code&gt; file. But it does not work, all the parameters are not passed into the subsequent R code blocks. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BABEL: :session *R* :cache yes :results output graphics :exports both :tangle yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing like the following works. But it forces every code block to have &lt;code&gt;:file&lt;/code&gt; parameter set. I don't want that because I have some code blocks which do not have graphic output.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: session *R*&#xA;#+PROPERTY: cache yes&#xA;#+PROPERTY: results graphics&#xA;#+PROPERTY: exports both&#xA;#+PROPERTY: tangle yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I setup this? I prefer one-liner setup like &quot;+BABEL:....&quot; and customize the code blocks that I want differently.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastActivityDate="2023-01-25T20:17:22.317" Title="orgmode: set global BABEL parameters?" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27180" PostTypeId="2" ParentId="27174" CreationDate="2016-09-19T09:29:56.790" Score="3" Body="&lt;p&gt;I've just added &lt;code&gt;--gpg-sign&lt;/code&gt; to the revert popup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it sounds like you are signing all commits anyway, you might also just set the Git variable &lt;code&gt;commit.gpgSign&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can always add your own actions and arguments to a popup. In this case this would have worked:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-define-popup-option 'magit-revert-popup&#xA;  ?S &quot;Sign using gpg&quot; &quot;--gpg-sign=&quot; 'magit-read-gpg-secret-key)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more information about that, see &lt;a href=&quot;https://magit.vc/manual/magit-popup/Customizing-existing-popups.html&quot; rel=&quot;nofollow&quot;&gt;Customizing existing popups&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-09-19T09:29:56.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27181" PostTypeId="2" ParentId="27179" CreationDate="2016-09-19T10:41:52.180" Score="2" Body="&lt;p&gt;One solution may be to add a PROPERTIES drawer at the heading level e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;:header-args: :session *R* :cache yes :results output graphics :exports both :tangle yes&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you do this, you cannot override individual parameters with another header-args in a PROPERTIES drawer as this overrides the whole line, but you can override indivudal parameters on the #+begin_src declaration.&lt;/p&gt;&#xA;" OwnerUserId="13104" LastActivityDate="2016-09-19T10:41:52.180" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27182" PostTypeId="1" AcceptedAnswerId="27185" CreationDate="2016-09-19T11:02:37.660" Score="2" ViewCount="666" Body="&lt;p&gt;I am trying to set the foreground color for first line in my buffer which has &lt;code&gt;global-font-lock&lt;/code&gt; ON.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buffer contents - &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ignore) &#xA;(add-text-properties 1 8&#xA;                                         '(:foreground &quot;red&quot;))&#xA;;;since add-text-properties didn't work, i tried with add-face-text-property&#xA;(add-face-text-property 1 8 '(:foreground &quot;red&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When i do &lt;code&gt;eval-buffer&lt;/code&gt;, i like to see the first line, &lt;code&gt;(ignore)&lt;/code&gt; made red. But it is not so. I referred &lt;a href=&quot;https://stackoverflow.com/questions/2242269/changing-text-appearance-in-emacs-overlays-work-text-properties-dont&quot;&gt;here&lt;/a&gt; to know the function, &lt;code&gt;add-text-properties&lt;/code&gt; doesn't work when font-lock mode is ON.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way one can change the properties for text that lies between a start and end point?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-09-19T12:38:40.723" Title="Add text property, when global-font-lock mode is on" Tags="|font-lock|text-properties|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27183" PostTypeId="2" ParentId="27027" CreationDate="2016-09-19T11:10:02.763" Score="1" Body="&lt;p&gt;Adding following to my initialisation file solved my problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; aspell setup&#xA;(setq&#xA; ispell-russian-dictionary &quot;russian&quot;&#xA; ispell-english-dictionary &quot;english&quot;)&#xA;&#xA;(custom-set-variables&#xA;  ;; i like aspell, and you?&#xA; '(ispell-program-name &quot;aspell&quot;)&#xA;&#xA;; my dictionary-alist, using for redefinition russian dictionary&#xA; '(ispell-dictionary-alist&#xA;   '((&quot;russian&quot;  ;; Russian&#xA;      &quot;\\cy&quot;&#xA;      &quot;\\Cy&quot; &#xA;      &quot;[-]&quot;&#xA;      nil&#xA;      (&quot;-C&quot; &quot;-d&quot; &quot;ru-yeyo.multi&quot;&#xA;       nil utf-8))&#xA;     (&quot;english&quot;                       ; English&#xA;      &quot;[a-zA-Z]&quot;&#xA;      &quot;[^a-zA-Z]&quot;&#xA;      &quot;[']&quot;&#xA;      nil&#xA;      (&quot;-d&quot; &quot;en_GB.multi&quot; &quot;--add-extra-dicts=en_GB-variant_1.multi&quot;&#xA;       nil iso-8859-1))&#xA;     (nil ;; Default&#xA;      &quot;[A-Za-z]&quot;&#xA;      &quot;[^A-Za-z]&quot;&#xA;      &quot;[']&quot;&#xA;      nil&#xA;      (&quot;-C&quot;&#xA;       nil iso-8859-1))))&#xA; '(flyspell-default-dictionary ispell-russian-dictionary)&#xA; '(ispell-dictionary ispell-english-dictionary)&#xA; '(ispell-local-dictionary ispell-russian-dictionary)&#xA; '(ispell-extra-args '(&quot;--sug-mode=ultra&quot; &quot;--prefix=c:/mingw_mine&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is based on contents of this thread: &lt;a href=&quot;http://www.linux.org.ru/forum/development/4457441&quot; rel=&quot;nofollow&quot;&gt;http://www.linux.org.ru/forum/development/4457441&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2016-09-19T11:10:02.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27184" PostTypeId="1" CreationDate="2016-09-19T11:40:23.510" Score="1" ViewCount="2232" Body="&lt;p&gt;When running M-x shell I get strange additional characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like this,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3BvTw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3BvTw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should look similar to how it does in the terminal,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9SPuJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9SPuJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am very new to Emacs. Hopefully there is a simple fix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running Fedora 25 and GNU Emacs 25.1.1&lt;/p&gt;&#xA;" OwnerUserId="13339" LastEditorUserId="253" LastEditDate="2016-09-20T00:50:03.713" LastActivityDate="2016-10-20T01:53:50.927" Title="shell strange characters" Tags="|shell-command|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27185" PostTypeId="2" ParentId="27182" CreationDate="2016-09-19T12:36:53.900" Score="4" Body="&lt;p&gt;When &lt;code&gt;font-lock-mode&lt;/code&gt; is in use, you can use the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;font-lock-face&lt;/code&gt;&lt;/a&gt; property instead of &lt;code&gt;face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(add-text-properties 1 8 '(font-lock-face (:foreground &quot;red&quot;)))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-09-19T12:36:53.900" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27186" PostTypeId="1" CreationDate="2016-09-19T12:47:11.097" Score="0" ViewCount="213" Body="&lt;p&gt;When I try and open a .tex file on emacs 25.1 under Windows I now get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File mode specification error: (dbus-error No connection to bus :session)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And cannot typeset anything using the usual &lt;code&gt;C-c C-c&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it may be something to with trying to load auctex because if I start emacs with -Q and open a tex file it opens OK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a clue how to fix that?  It works fine on emacs 24.5.1&lt;/p&gt;&#xA;" OwnerUserId="727" LastActivityDate="2016-09-19T12:47:11.097" Title="Opening a .tex file on Windows emacs 25.1" Tags="|latex|auctex|microsoft-windows|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27187" PostTypeId="2" ParentId="27178" CreationDate="2016-09-19T13:14:44.697" Score="8" Body="&lt;p&gt;It's completely normal for both to be generated, but in non-Windows environments, &lt;code&gt;emacs&lt;/code&gt; would be either a hard link or a symbolic link to the version-specific executable &lt;code&gt;emacs-25.1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most likely they are created as duplicate executables under the Windows build process because hard links and symlinks never used to exist in Windows (or not in the same trivial fashion, at minimum), and creating distinct executables was just simpler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for why you'd &lt;em&gt;want&lt;/em&gt; them both in the first place, it means that if you install multiple versions of Emacs such that each installation clobbers the &lt;code&gt;emacs&lt;/code&gt; executable, you can still run each installed version by its other name.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-09-19T13:20:19.730" LastActivityDate="2016-09-19T13:20:19.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27188" PostTypeId="2" ParentId="27135" CreationDate="2016-09-19T13:17:48.420" Score="8" Body="&lt;p&gt;Install &lt;a href=&quot;https://github.com/xuchunyang/plur&quot;&gt;plur&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and run the command &lt;code&gt;plur-query-replace&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and input &lt;code&gt;{foo,bar}&lt;/code&gt; and its replacement &lt;code&gt;{bar,foo}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hit &lt;code&gt;y&lt;/code&gt; to replace the occurrences as desired. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also non-interactive, and isearch-like, variants of this command. &lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2016-09-19T13:17:48.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27190" PostTypeId="2" ParentId="23870" CreationDate="2016-09-19T15:04:27.993" Score="5" Body="&lt;p&gt;Since I've accepted the answer I've been living with that 'have elisp snippet for each report I want' setup for a while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then I've came up with the following trick:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There &lt;em&gt;is&lt;/em&gt; a way to open org-babel outpupt in a separate buffer with &lt;code&gt;C-o&lt;/code&gt; - &lt;code&gt;org-open-at-point&lt;/code&gt; is fancy like that. The problem is, the result block is created. But there is also a command &lt;code&gt;org-babel-remove-result&lt;/code&gt;. Combining the two, I made a little dirty hack&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-babel-to-buffer ()&#xA;  &quot;A function to efficiently feed babel code block result to a separate buffer&quot;&#xA;  (interactive)&#xA;  (org-open-at-point)&#xA;  (org-babel-remove-result)&#xA;)&#xA;&#xA;(defun my-org-mode-config ()&#xA;  &quot;To use with `org-mode-hook'&quot;&#xA;  (local-set-key (kbd &quot;C-`&quot;) 'my-babel-to-buffer)&#xA;)&#xA;&#xA;(add-hook 'org-mode-hook 'my-org-mode-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The codeblocks I use like that have properties &lt;code&gt;:results output :format raw :exports results&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My file with tips and howtos is no longer cluttered with large outputs and the buffer is reused (which suits my workflow).&lt;/p&gt;&#xA;" OwnerUserId="12333" LastActivityDate="2016-09-19T15:04:27.993" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27191" PostTypeId="1" CreationDate="2016-09-19T15:57:21.543" Score="4" ViewCount="2708" Body="&lt;p&gt;I just upgraded Emacs to 25.1.1 (via the Arch Linux package manager &lt;code&gt;pacman&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I can't set the font size in my &lt;code&gt;.emacs&lt;/code&gt; anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to adjust it via &lt;code&gt;C-x C-+&lt;/code&gt; and &lt;code&gt;C-x C--&lt;/code&gt;, and I can also use &lt;code&gt;M-x customize&lt;/code&gt; to set the default font height to 83 instead of 103. This works for my current session in all buffers, then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I save the generated config code (attached below) in my &lt;code&gt;.emacs&lt;/code&gt; and restart, the settings are ignored and Emacs starts with the default font size instead. I am confused as to where to start searching for the cause of the problem, since it works if I adjust it in each session, but does not work when restarting Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no error message and nothing of help in the &lt;code&gt;*Messages*&lt;/code&gt; buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I start looking for the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must add that I have no idea about how Emacs-Lisp works and can only copy-paste things into my config file. It's a very confusing language for me.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(default ((t (:inherit nil :stipple nil :background &quot;white&quot; :foreground &quot;black&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 83 :width normal :foundry &quot;PfEd&quot; :family &quot;DejaVu Sans Mono&quot;))))&#xA; '(tabbar-button ((t (:inherit tabbar-default :foreground &quot;dark red&quot;))))&#xA; '(tabbar-button-highlight ((t (:inherit tabbar-default))))&#xA; '(tabbar-default ((t (:inherit variable-pitch :background &quot;#959A79&quot; :foreground &quot;black&quot; :weight bold))))&#xA; '(tabbar-highlight ((t (:underline t))))&#xA; '(tabbar-selected ((t (:inherit tabbar-default :background &quot;#95CA59&quot;))))&#xA; '(tabbar-separator ((t (:inherit tabbar-default :background &quot;#95CA59&quot;))))&#xA; '(tabbar-unselected ((t (:inherit tabbar-default)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12821" LastEditorUserId="675" LastEditDate="2016-09-19T20:19:31.440" LastActivityDate="2017-07-17T14:49:44.110" Title="Can't adjust font size anymore in emacs 25" Tags="|init-file|fonts|config|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27192" PostTypeId="2" ParentId="26442" CreationDate="2016-09-19T15:57:21.907" Score="0" Body="&lt;p&gt;I've managed to accomplish something like this using org-id and the code from &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2014-08/msg00109.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, which works for my purposes. It may not necessarily be optimized or the best way of doing things, so suggestions for improvements are welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code will copy the current subtree into the file you specify, along with that subtree's parents, grandparents, and ancestors. They are assigned UUIDs if they don't already have one, and it won't do anything to entries with the same ID, title, and body contents. If IDs are the same, but the title xor body content is modified, the changes will be copied over. If IDs are the same but both title and body content are different, it will error out just in case.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-archive)&#xA;(require 'org-id)&#xA;&#xA;(defun org-copy-task-hierarchy (filename)&#xA;    &quot;This function copies a task/project and its parent hierarchy tree to the given filename&quot;&#xA;    (interactive)&#xA;    (let ((this-buffer (current-buffer))&#xA;          (file (abbreviate-file-name &#xA;                (or (buffer-file-name (buffer-base-buffer)) &#xA;                    (error &quot;No file associated to buffer&quot;)))))&#xA;        (save-excursion&#xA;            ; prepare the target buffer to paste things into&#xA;            (setq infile-p (equal file (abbreviate-file-name (or filename &quot;&quot;))))&#xA;            (unless filename (error &quot;Invalid target location&quot;))&#xA;            (if (&amp;gt; (length filename) 0)&#xA;                (setq newfile-p (not (file-exists-p filename))&#xA;                      visiting (find-buffer-visiting filename)&#xA;                      buffer (or visiting (find-file-noselect filename)))&#xA;              (setq buffer (current-buffer)))&#xA;            (unless buffer (error &quot;Cannot access file \&quot;%s\&quot;&quot; filename))&#xA;&#xA;            ; construct hierarchy structure and copy current element&#xA;            (setq elem-id (org-id-get-create)&#xA;                  id-tree (org-copy-task-hierarchy--construct-id-tree))&#xA;            (org-copy-subtree nil nil nil t)&#xA;&#xA;            ; move to the target buffer&#xA;            (set-buffer buffer)&#xA;            (org-mode)&#xA;            (goto-char (point-min)) ; move point to top of the buffer&#xA;&#xA;            ; iterate through id-tree to paste in elements if needed&#xA;            (setq prev-id nil)&#xA;            (while (not (eq id-tree nil))&#xA;                (let* ((tree-elem-id       (caar id-tree))&#xA;                       (tree-elem-headline (nth 1 (car id-tree)))&#xA;                       (tree-elem-contents (nth 2 (car id-tree)))&#xA;                       (tree-elem-todo     (nth 3 (car id-tree)))&#xA;                       (tree-elem-fullbody (nth 4 (car id-tree)))&#xA;                       (target-location    (org-id-find-id-in-file tree-elem-id (buffer-file-name))))&#xA;                    (if (eq target-location nil) ; id doesn't exist&#xA;                        ; insert elem-fullbody&#xA;                        (progn &#xA;                            (if (eq prev-id nil)&#xA;                                (goto-char (point-max)) ; move point to end of buffer&#xA;                              (setq prev-location (org-id-find-id-in-file prev-id (buffer-file-name)))&#xA;                              (unless prev-location &#xA;                                (error &quot;ERROR: Could not find id %s in file %s&quot; prev-location buffer-file-name))&#xA;                              (goto-char (cdr prev-location))&#xA;                              (org-end-of-subtree t t)) ; move point after subtrees of previous entry &#xA;                            (insert tree-elem-fullbody)&#xA;                            (save-buffer)) ; needed for org-id-find-id-in-file to find newly added IDs&#xA;&#xA;                        ; id already exists, check for what's different&#xA;                        (goto-char (cdr target-location)) ; move point to target&#xA;                        (let* ((target-id (org-id-get))&#xA;                               (target-headline (org-get-heading t t))&#xA;                               (target-contents (org-get-entry-no-subtrees t))&#xA;                               (target-todo     (org-get-todo-state))&#xA;                               (match-headline-p (equal target-headline tree-elem-headline))&#xA;                               (match-contents-p (equal target-contents tree-elem-contents))&#xA;                               (match-todo-p     (equal target-todo tree-elem-todo)))&#xA;                            (if (or (and match-headline-p match-contents-p (not match-todo-p) &#xA;                                         ;(equal tree-elem-todo &quot;DONE&quot;) (equal tree-elem-todo &quot;COMPLETE&quot;))&#xA;                                         (member (tree-elem-todo) org-done-keywords))&#xA;                                    (and match-headline-p (not match-contents-p))&#xA;                                    (and (not match-headline-p) match-contents-p))&#xA;                                ; update target element with tree element&#xA;                                (org-replace-full-entry tree-elem-fullbody)&#xA;                                ; check if neither title nor contents match&#xA;                              (when (and (not match-headline-p) (not match-contents-p))&#xA;                                  (error &quot;ERROR updating id %s - &#xA;                                          title and body too different from existing&quot; tree-elem-id)))))&#xA;                    (setq prev-id tree-elem-id))&#xA;                ; headers, content, todo state are all same; skip and go to next elem&#xA;                (setq id-tree (cdr id-tree)))&#xA;&#xA;            (when (not (eq this-buffer buffer))&#xA;                (save-buffer))&#xA;            (message &quot;Subtree copied %s&quot; (concat &quot;in file: &quot; (abbreviate-file-name filename))))))&#xA;&#xA;(defun org-copy-task-hierarchy--construct-id-tree ()&#xA;    &quot;Construct and return a list/tree containing the IDs and content of the hierarchy&quot;&#xA;    (let ((id-tree nil))&#xA;        (save-excursion&#xA;            (while (org-up-heading-safe)&#xA;                (org-back-to-heading t) ; set point to heading beginning&#xA;                ; get current element's headline, content, and TODO state&#xA;                (setq elem-id       (org-id-get-create)&#xA;                      elem-headline (org-get-heading t t)             ; ignore todo and tags           &#xA;                      elem-contents (org-get-entry-no-subtrees t)  ; ignore properties&#xA;                      elem-todo     (org-get-todo-state)&#xA;                      elem-fullbody (org-get-full-entry))&#xA;                ; build id tree in reverse in order&#xA;                (if (eq id-tree nil)&#xA;                    (setq id-tree (cons (list elem-id elem-headline elem-contents elem-todo elem-fullbody) nil))&#xA;                  (setq id-tree &#xA;                      (cons (list elem-id elem-headline elem-contents elem-todo elem-fullbody) id-tree)))&#xA;                ))&#xA;        ; append current element to tree&#xA;        (setq id-tree (nconc id-tree (cons (list (org-id-get-create) &#xA;                                                 (org-get-heading t t) &#xA;                                                 (org-get-entry-no-subtrees t) &#xA;                                                 (org-get-todo-state) &#xA;                                                 (org-get-full-entry)) nil)))&#xA;        id-tree))&#xA;&#xA;(defun org-get-full-entry ()&#xA;    &quot;Get the entry text, including heading, no subtrees. &#xA;     If no-properties is non-nil, ignore the text properties of the entry&quot;&#xA;    (interactive)&#xA;    (save-excursion &#xA;        (let (beg end)&#xA;            (org-back-to-heading t) ; set point to heading beginning&#xA;            (setq beg (point))&#xA;            (skip-chars-forward &quot; \t\r\n&quot;)&#xA;            (save-match-data (outline-next-heading)) ; move point to next heading line&#xA;            (setq end (point))&#xA;            (goto-char beg)&#xA;            (buffer-substring-no-properties beg end))))&#xA;&#xA;(defun org-get-entry-no-subtrees (&amp;amp;optional no-properties)&#xA;    &quot;Get the entry text, after heading, no subtrees. &#xA;     If no-properties is non-nil, ignore the text properties of the entry&quot;&#xA;    (interactive)&#xA;    (save-excursion &#xA;        (let (beg end)&#xA;            (org-back-to-heading t) ; set point to heading beginning&#xA;            (setq beg (point-at-bol 2))&#xA;            (skip-chars-forward &quot; \t\r\n&quot;)&#xA;            (save-match-data (outline-next-heading)) ; move point to next heading line&#xA;            (setq end (point))&#xA;            (goto-char beg)&#xA;            (if no-properties&#xA;                (buffer-substring-no-properties beg end)&#xA;              (buffer-substring beg end)))))&#xA;&#xA;(defun org-replace-full-entry (&amp;amp;optional text)&#xA;    &quot;Replace the entry text, including heading but excluding subtrees, with the given text. &#xA;     If text is nil, simply delete the entry text.&quot;&#xA;    (interactive)&#xA;    (save-excursion &#xA;        (let (beg end)&#xA;            (org-back-to-heading t) ; set point to heading beginning&#xA;            (setq beg (point))&#xA;            (skip-chars-forward &quot; \t\r\n&quot;)&#xA;            (save-match-data (outline-next-heading)) ; move point to next heading line&#xA;            (setq end (point))&#xA;            (goto-char beg)&#xA;            (delete-region beg end)&#xA;            (when text&#xA;                (insert text)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To handle the archiving part, we can make use of the above functions in another one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun archive-log ()&#xA;    &quot;Copy current subtree and ancestors to archive.org_archive, then archive to completed.org_archive&quot;&#xA;    (interactive &quot;P&quot;)&#xA;    (org-copy-task-hierarchy &#xA;        (concat &quot;./archive-&quot; (format-time-string &quot;%Y%m&quot; (current-time)) &quot;.org_archive&quot;))&#xA;    (org-archive-subtree-default))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-09-19T15:57:21.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27193" PostTypeId="2" ParentId="27191" CreationDate="2016-09-19T17:11:11.623" Score="0" Body="&lt;p&gt;You can use this command to increase the font size,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil :height 165)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works for me on Mac - Emacs 25.1.50&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="5383" LastEditDate="2016-09-20T06:19:25.103" LastActivityDate="2016-09-20T06:19:25.103" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27194" PostTypeId="1" AcceptedAnswerId="28445" CreationDate="2016-09-19T18:03:30.130" Score="5" ViewCount="532" Body="&lt;p&gt;This is an example function that shows that docstrings do not automatically indent.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def testing_docstring():&#xA;    &quot;&quot;&quot;&#xA;docstring is not indented automatically!&#xA;Even after a newline.&#xA;&quot;&quot;&quot;&#xA;    body_is_indented_though&#xA;    return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Selecting a region inside the docstring and hitting tab won't work either. Only hitting tab on a single line will toggle the indent level. How can I set docstrings to automatically indent?&lt;/p&gt;&#xA;" OwnerUserId="13342" LastActivityDate="2016-11-05T14:26:17.363" Title="Docstrings don't automatically indent themselves in elpy-mode. How do I fix this?" Tags="|indentation|python|documentation|elpy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27196" PostTypeId="2" ParentId="27184" CreationDate="2016-09-20T00:43:30.410" Score="1" Body="&lt;p&gt;The problem is in your shell configuration. It's sending &lt;a href=&quot;https://en.wikipedia.org/wiki/Escape_sequence&quot; rel=&quot;nofollow&quot;&gt;escape sequences&lt;/a&gt; to color parts of the prompt, to set the terminal sequence, etc. But the terminal of &lt;code&gt;M-x shell&lt;/code&gt; is a very basic one that doesn't understand these escape sequences. You need to turn off all these features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic way to detect the terminal capabilities is to query the &lt;code&gt;TERM&lt;/code&gt; variable. Under &lt;code&gt;M-x shell&lt;/code&gt;, its value is &lt;code&gt;dumb&lt;/code&gt;. Turn off all prompt formatting and other similar configuration when &lt;code&gt;$TERM&lt;/code&gt; is &lt;code&gt;dumb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if your shell is bash, use something like in your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ &quot;$TERM&quot; == &quot;dumb&quot; ]]; then&#xA;  # No terminal escape sequences, only prompt escapes&#xA;  PS1='\u at \h in \w\n\$ '&#xA;else&#xA;  # Assuming a rich terminal, using terminal escape sequences&#xA;  PS1='\e]2;\w\a\e]1;\W\a\u at \h in \w\n\$ '&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-09-20T00:43:30.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27197" PostTypeId="2" ParentId="3747" CreationDate="2016-09-20T01:07:12.357" Score="4" Body="&lt;p&gt;I added this to my init file inside &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; to disable automatic line breaking:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spacemacs/toggle-auto-fill-mode-off)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, you can toggle on/off with &lt;code&gt;SPC t F&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13348" LastEditorUserId="253" LastEditDate="2017-01-03T19:19:53.033" LastActivityDate="2017-01-03T19:19:53.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27199" PostTypeId="2" ParentId="12772" CreationDate="2016-09-20T05:30:53.503" Score="15" Body="&lt;p&gt;Stable versions (25.1 currently):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-add-repository -y ppa:adrozdoff/emacs&#xA;sudo apt update&#xA;sudo apt install emacs25&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Provided packages for LTS 14.04 and 16.04.&lt;/p&gt;&#xA;" OwnerUserId="13351" LastActivityDate="2016-09-20T05:30:53.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27200" PostTypeId="1" CreationDate="2016-09-20T05:36:01.860" Score="6" ViewCount="324" Body="&lt;p&gt;When I click $ I get another matching $ thanks to smartparens. I would like to disable this behavior but keep all other matching pairs like () enabled. I tried adding this to the Spacemacs config but it doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair 'LaTeX-mode &quot;$&quot; nil :actions :rem)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13348" LastActivityDate="2016-09-20T16:36:13.903" Title="How to disable $ pairing in latex-mode in Spacemacs?" Tags="|spacemacs|smartparens|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27202" PostTypeId="1" AcceptedAnswerId="27251" CreationDate="2016-09-20T07:31:04.767" Score="22" ViewCount="13532" Body="&lt;p&gt;I just upgraded Emacs on my Windows 10 machine from 24.5 to 25.1. For Emacs 24.5 I had GnuTLS correctly setup and for 25.1 I did what I thought I remembered I did:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Got prebuilt Emacs binaries from the &lt;a href=&quot;https://www.gnu.org/software/emacs/download.html&quot;&gt;GNU Emacs website's download page&lt;/a&gt;. I'm using 32 bit Windows, so I got the i686 version of Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Got a copy of GnuTLS from &lt;a href=&quot;https://sourceforge.net/projects/ezwinports/files/&quot;&gt;ezwinports&lt;/a&gt; and extracted the zip file to the same directory as Emacs --the way the gnutls zip is organized means that this way both the dll's and the exe's for gnutls wind up in the same directory as the Emacs exe's. (I got version 3.3.11 this time; I don't remember what version of GnuTLS I had when I had version 24.5 of Emacs.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That didn't work this time. &lt;code&gt;gnutls-available-p&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, the package manager is only able to connect to http repositories and not https ones, eww can't handle https either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I setup GnuTLS for Emacs 25.1? Am I misremembering what I did for 24.5? Maybe the binaries from the GNU Emacs website are compiled without GnuTLS and for 24.5 I actually got binaries from somewhere else...&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2019-06-20T01:49:31.207" Title="How do I install GnuTLS for Emacs 25.1 on Windows?" Tags="|microsoft-windows|gnutls|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27205" PostTypeId="1" CreationDate="2016-09-20T10:30:44.653" Score="3" ViewCount="696" Body="&lt;p&gt;I want to use sql-sqlite on a remote database file via TRAMP. According to &lt;a href=&quot;http://gregorygrubbs.com/wordpress/emacs-power-remote-servers-and-shell-commands/&quot; rel=&quot;nofollow&quot;&gt;this website&lt;/a&gt; it should be possible, but I cannot get it to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I visit the remote directory with Dired and then invoke sql-sqlite:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x d /user@host:/directory&#xA;M-x sql-sqlite /scp:user@host:/directory/test.db&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As expected, this opens an &lt;code&gt;*SQL*&lt;/code&gt; buffer with an sqlite prompt. Entering any SQL statements or SQLite commands, however, results in this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: unable to open database &quot;/scp:user@host:/directory/test.db&quot;: unable to open database file&#xA;&#xA;Process SQL exited abnormally with code 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 25.1 with &lt;code&gt;emacs -Q&lt;/code&gt; (the other two versions I have access to, 24.3 and 24.5, behave identically).&lt;/p&gt;&#xA;" OwnerUserId="13355" LastActivityDate="2016-10-20T19:01:11.103" Title="Using sql-sqlite via TRAMP" Tags="|tramp|sql-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27206" PostTypeId="2" ParentId="26569" CreationDate="2016-09-20T11:52:36.737" Score="2" Body="&lt;p&gt;&lt;code&gt;M-x eshell&lt;/code&gt;  works.  If you have helm M-x will show a list of possible completions when you start typing. &lt;/p&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="10898" LastEditDate="2016-09-22T12:10:58.607" LastActivityDate="2016-09-22T12:10:58.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27207" PostTypeId="2" ParentId="25037" CreationDate="2016-09-20T11:57:06.550" Score="2" Body="&lt;p&gt;in addition to the --without-ns option, you also need the --without-x11 option, to force gtk+3 to use quartz. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;brew install --build-from-source at-spi2-core at-spi2-atk cairo harfbuzz pango gtk+ librsvg gnome-icon-theme gtk+3 --without-ns --without-x --without-x11 --with-gtk+3&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10898" LastActivityDate="2016-09-20T11:57:06.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27208" PostTypeId="1" AcceptedAnswerId="27221" CreationDate="2016-09-20T12:39:46.253" Score="0" ViewCount="332" Body="&lt;p&gt;Is there a way to exclude &lt;code&gt;.git/COMMIT_EDITMSG&lt;/code&gt; files from &lt;code&gt;file-name-history&lt;/code&gt;? Now that I'm authoring commits with Magit, those commit message files are often the most recent entries in &lt;code&gt;file-name-history&lt;/code&gt;, which is annoying since they're never what I'm looking for when scrolling through history entries.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="306" LastEditDate="2016-09-20T17:07:30.730" LastActivityDate="2016-09-20T20:56:58.327" Title="Can I exclude .git/COMMIT_EDITMSG from file-name-history?" Tags="|magit|git|history|history-variables|filenames|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27209" PostTypeId="1" AcceptedAnswerId="27662" CreationDate="2016-09-20T12:56:12.980" Score="2" ViewCount="148" Body="&lt;p&gt;I am using proof-general mode for editing and executing Coq files in emacs. However, I am highly annoyed by the &lt;code&gt;C-c C-n&lt;/code&gt; behavior of always going to the next line if the EoF is reached. As I tend to use it interactively, executing the proof as I go along I end up always typing: &lt;code&gt;C-c C-n + ARROW-UP + END&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change that behavior of &lt;code&gt;C-c C-n&lt;/code&gt; to ONLY evaluate to the next dot? Alternative: Is there a command I overlooked that does exactly that?&lt;/p&gt;&#xA;" OwnerUserId="13357" LastEditorUserId="25" LastEditDate="2017-10-04T14:39:21.557" LastActivityDate="2017-10-04T14:39:21.557" Title="proof-general no newline after C-c C-n" Tags="|proof-general|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27210" PostTypeId="1" CreationDate="2016-09-20T14:40:07.657" Score="-1" ViewCount="139" Body="&lt;p&gt;I'm having an issue when using &lt;code&gt;(org-global-cycle)&lt;/code&gt; from a subheading followed by &lt;code&gt;(org-cycle)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example in the following org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Level 1 Heading 1&#xA;** Level 2 Heading 1&#xA;** Level 2 Heading 2&#xA;*** Level 3 Heading 1&#xA;    Test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the cursor is at &lt;code&gt;*** Level 3 Heading 1{cursor here}&lt;/code&gt; and I hit &lt;code&gt;S-&amp;lt;TAB&amp;gt;&lt;/code&gt; everything will fold up to &lt;code&gt;* Level 1 Heading 1{cursor here}...&lt;/code&gt; properly.  But the if I use &lt;code&gt;&amp;lt;TAB&amp;gt;&lt;/code&gt; to view the level 2 headings I instead get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Level 1 Heading 1...&#xA;*** Level 3 Heading 1{cursor here}&#xA;    Test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any clue what's going on?  I'm running &lt;code&gt;emacs.exe -q&lt;/code&gt; with Emacs 24.5.1 and org-mode 8.2.10 when I use -q and 8.3.6 when running with my config.&lt;/p&gt;&#xA;" OwnerUserId="13358" LastActivityDate="2023-10-07T09:09:26.170" Title="How to Prevent org-global-cycle Glitch" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27212" PostTypeId="2" ParentId="27200" CreationDate="2016-09-20T16:36:13.903" Score="3" Body="&lt;p&gt;Fun fact: there is &lt;code&gt;LaTeX-mode&lt;/code&gt;, and then there is &lt;code&gt;latex-mode&lt;/code&gt;. Both are aliases for &lt;code&gt;TeX-latex-mode&lt;/code&gt;, which is part of the AUCTeX package. If you look at the default value of &lt;code&gt;sp-pairs&lt;/code&gt;, you'll see settings for &lt;code&gt;latex-mode&lt;/code&gt;, not &lt;code&gt;LaTeX-mode&lt;/code&gt;. The following command disabled &lt;code&gt;$&lt;/code&gt; pairing for me in LaTex documents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair #'latex-mode &quot;$&quot; nil :actions nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I use &lt;code&gt;:actions nil&lt;/code&gt; because that is what is recommended by the documentation of &lt;code&gt;sp-local-pair&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2016-09-20T16:36:13.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27213" PostTypeId="1" CreationDate="2016-09-20T17:36:38.063" Score="5" ViewCount="1107" Body="&lt;p&gt;I can't seem to get emacs to recognize node stacktraces. As you can see, I've added what I think is a valid regular expression to compilation-error-regex-alist and compilation-error-regex-alist-alist, but it still does not match, and brings up the file selection dialog if I try to navigate to the next error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cloud.githubusercontent.com/assets/4205/18681080/0cb6630a-7f2c-11e6-9c5c-aeaf62f651a6.png&quot; rel=&quot;noreferrer&quot;&gt;https://cloud.githubusercontent.com/assets/4205/18681080/0cb6630a-7f2c-11e6-9c5c-aeaf62f651a6.png&lt;/a&gt;&lt;a href=&quot;https://i.stack.imgur.com/0AC2D.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0AC2D.png&quot; alt=&quot;prompting for the file containing the error&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that it's thinking of &lt;code&gt;test/state-test.js:127&lt;/code&gt; as the file name:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to debug the process by which errors are recognized so I can see why it is not matching?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've run regex in the re-builder showing the file and so it would appear that the line and column groups match:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/CIhJd.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CIhJd.png&quot; alt=&quot;re-builder matching the desired regex&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the lisp code that attempts to add the node regex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'compilation-error-regexp-alist 'node)&#xA;&#xA;(add-to-list 'compilation-error-regexp-alist-alist&#xA;         '(node &quot;^[ \f\n ]*at.+(\(.+\):\([[:digit:]]+\):\([[:digit:]]+\))$&quot; 1 2 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The compilation buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: compilation; default-directory: &quot;~/Code/microstates.js/&quot; -*-&#xA;Compilation started at Tue Sep 20 12:09:31&#xA;&#xA;npm t&#xA;[?25h[0G&#xA;&amp;gt; microstates@0.0.1 test /Users/cowboyd/Code/microstates.js&#xA;&amp;gt; mocha test/index.js&#xA;&#xA;[?25l[0G&#xA;[?25h[?25h[1A[0G[?25h[0G&#xA;&#xA;  The Basic Opaque State&#xA;    wrapping an object value in a State&#xA;      with pre-defined properties&#xA;[0G        1) has those properties by default&#xA;&#xA;&#xA;  0 passing (38ms)&#xA;  1 failing&#xA;&#xA;  1) The Basic Opaque State wrapping an object value in a State with pre-defined properties has those properties by default:&#xA;      AssertionError: expected undefined to be an instance of State&#xA;      at Context.&amp;lt;anonymous&amp;gt; (test/state-test.js:127:33)&#xA;&#xA;&#xA;&#xA;[?25l[0G&#xA;[?25h[?25h[1A[0G[?25h[0Gnpm ERR! Test failed.  See above for more details.&#xA;&#xA;Compilation exited abnormally with code 1 at Tue Sep 20 12:09:33&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13360" LastActivityDate="2018-09-12T21:50:04.737" Title="How can I add a compilation error regex for node js?" Tags="|regular-expressions|compilation-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27214" PostTypeId="1" CreationDate="2016-09-20T17:50:19.923" Score="4" ViewCount="1901" Body="&lt;p&gt;I'd like to add a margin to the top of the window so that it's not so close to the top part of the frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what it looks like currently (arrow indicates where I'd like to add extra margin):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/1prvV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1prvV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I go about accomplishing this?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2016-11-12T02:32:15.690" LastActivityDate="2022-07-23T14:55:36.910" Title="How can I increase the spacing between the buffer and the top part of the frame?" Tags="|init-file|window|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27215" PostTypeId="1" CreationDate="2016-09-20T18:25:35.427" Score="8" ViewCount="768" Body="&lt;p&gt;How can I insert all the subdirectories of the toplevel directory in Dired?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how can I insert the whole directory tree, i.e. all the subdirectories recursively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to change the default switches, only to insert all the subdirectories just this once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not looking for &lt;code&gt;C-u i&lt;/code&gt; and adding the &lt;code&gt;R&lt;/code&gt; switch: that inserts subdirectories of the directory under the cursor. I want to insert all the subdirectories of the main directory.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-09-22T16:24:49.773" Title="Insert all subdirectories in Dired" Tags="|dired|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27216" PostTypeId="2" ParentId="27205" CreationDate="2016-09-20T18:48:18.070" Score="5" Body="&lt;p&gt;After some experimentation and a bit of digging around in the source code, I recognized what went wrong. Running &lt;code&gt;M-x sql-sqlite&lt;/code&gt; from the remote Dired buffer starts a remote SQLite process and that process needs to be provided with the absolute path to the database file &lt;em&gt;on the remote machine&lt;/em&gt;. So instead of this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x d /user@host:/directory&#xA;M-x sql-sqlite RET /scp:user@host:/directory/test.db&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I need to to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x d /user@host:/directory&#xA;M-x sql-sqlite RET /directory/test.db&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13362" LastActivityDate="2016-09-20T18:48:18.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27217" PostTypeId="2" ParentId="27213" CreationDate="2016-09-20T18:53:09.637" Score="4" Body="&lt;p&gt;Answer came in via twitter from hero @jscalterego &lt;a href=&quot;https://twitter.com/cowboyd/status/778287337952247808&quot; rel=&quot;nofollow&quot;&gt;https://twitter.com/cowboyd/status/778287337952247808&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently the problem is that in the re-builder, I was using &quot;string&quot; regex syntax vs &quot;read&quot; syntax, and so the regular expression was not properly formed. I'm not super well-versed on the differences between the various syntaxes. I imagine that's a whole other line of inquiry, but the winning regex was&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(node &quot;at [^ ]+ (\\(.+?\\):\\([[:digit:]]+\\):\\([[:digit:]]+\\)&quot; 1 2 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which worked very well.&lt;/p&gt;&#xA;" OwnerUserId="13360" LastActivityDate="2016-09-20T18:53:09.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27219" PostTypeId="2" ParentId="27214" CreationDate="2016-09-20T19:23:53.670" Score="1" Body="&lt;p&gt;According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Layout-Parameters.html#Layout-Parameters&quot; rel=&quot;nofollow noreferrer&quot;&gt;the docs&lt;/a&gt;, it can't be set individually at the moment. You can play with &lt;code&gt;internal-border-width&lt;/code&gt; which would change &lt;em&gt;all&lt;/em&gt; the borders inside the frame. That's what setting it to 7 gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist '(internal-border-width . 7))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/b0mqp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/b0mqp.png&quot; alt=&quot;X buffer, internal-border-width set to 7&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you'll find a value which would add enough space on top and at the same time small enough that it doesn't affect the sides too much.&lt;/p&gt;&#xA;" OwnerUserId="12333" LastActivityDate="2016-09-20T19:23:53.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27221" PostTypeId="2" ParentId="27208" CreationDate="2016-09-20T20:56:58.327" Score="1" Body="&lt;p&gt;These files (&lt;code&gt;COMMIT_EDITMSG&lt;/code&gt;, &lt;code&gt;git-rebase-todo&lt;/code&gt; and others) are added to &lt;code&gt;file-name-history&lt;/code&gt; by &lt;code&gt;server-visit-files&lt;/code&gt;. It is possible to undo that by advising that function, and I have implemented that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am unsure whether that advise should also remove entries for these files that already existed prior to that function being called. I think so because those entries are very likely there from before this advice was added. On the other hand this might surprise users who, for whatever reason, edit these files by manually opening them. I'll decide at a later time.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-09-20T20:56:58.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27222" PostTypeId="1" CreationDate="2016-09-20T23:06:25.340" Score="-1" ViewCount="794" Body="&lt;p&gt;I'm using Emacs on Windows. I plan on making a shortcut to Emacs for quick access.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have 3 files that should always be opened when I start emacs (ideally in 3 separate tabs), and I want that to happen I click on the shortcut.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've installed elscreen to get a tab bar-like functionality, but I'm not quite sure how to automatically open those 3 files in separate tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone have an idea on how to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2018-08-13T00:01:07.003" Title="Open multiple files in different tabs when starting emacs" Tags="|elscreen|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27223" PostTypeId="1" AcceptedAnswerId="27224" CreationDate="2016-09-20T23:07:12.953" Score="0" ViewCount="459" Body="&lt;p&gt;Occasionally when I'm navigating around I want Neotree to jump to the folder of the file I'm working in, but when I open Neotree it's still the last place I left it.  I can't find any function with M-x to jump to pwd.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas?&lt;/p&gt;&#xA;" OwnerUserId="9087" LastActivityDate="2016-11-20T04:36:24.033" Title="NeoTree: Open to CWD of Buffer" Tags="|directories|project|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27224" PostTypeId="2" ParentId="27223" CreationDate="2016-09-20T23:24:16.067" Score="0" Body="&lt;p&gt;Found it myself!  Must have been invisible before:  'neotree-projectile-action&lt;/p&gt;&#xA;" OwnerUserId="9087" LastActivityDate="2016-09-20T23:24:16.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27225" PostTypeId="2" ParentId="19936" CreationDate="2016-09-20T23:54:16.287" Score="2" Body="&lt;p&gt;It's already answered and accepted, but if you feel like trying new ways of doing things the reversible way (beyond emacs configs) I'd recommend you to spend half an hour familiarizing yourself with GNU Stow. It's sort of &lt;code&gt;ln -s&lt;/code&gt; on steroids, and there might be several approaches to use it. You can have the whole setup under one subdirectory (including offlineimap configs, emacs configs etc.) - that'd be environment based approach -  or have a separate subdirectory for every application you have. Sweet schizophrenia.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. emacs-related listing from my ~/Stow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-&amp;gt; % ls ~/Stow | grep emacs&#xA;emacs &#xA;emacs_from_scratch&#xA;spacemacs&#xA;hoodoo@T450s 2:46 [~]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's one initial config I've managed to get usable, one 'I stick with defaults' config and one 'I'm gonna roll my own'. I can just turn each of these on and off and always have them all available. Each subdir can have a whole tree relative to my ~/ and it's pretty handy to mix and match.&lt;/p&gt;&#xA;" OwnerUserId="12333" LastActivityDate="2016-09-20T23:54:16.287" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27226" PostTypeId="1" CreationDate="2016-09-20T23:56:14.763" Score="1" ViewCount="185" Body="&lt;p&gt;Executing the following code should create, for each top level tree in your file &lt;code&gt;~/tmp/file.org&lt;/code&gt;, an other file in &lt;code&gt;~/tmp&lt;/code&gt; named after the tree heading and containing its content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem: it does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The content is not the one expected...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it me or the code that is wrong? Both?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ()&#xA;  (with-temp-buffer&#xA;    (org-mode)&#xA;    (insert-file-contents &quot;~/tmp/file.org&quot;)&#xA;    (set-mark (point-min))&#xA;    (goto-char (point-max))&#xA;&#xA;    (org-map-entries&#xA;     (lambda ()&#xA;       (let ((entry_id (replace-regexp-in-string &quot; &quot; &quot;_&quot; (downcase (nth 4 (org-heading-components))))))&#xA;         (org-set-property&#xA;          &quot;EXPORT_FILE_NAME&quot;&#xA;          (expand-file-name entry_id &quot;~/tmp&quot;)))&#xA;       (org-org-export-to-org nil t)&#xA;       )&#xA;     nil&#xA;     'region-start-level)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Content of &lt;code&gt;file.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 1                                                          :ready:&#xA;&#xA;  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent libero orci,&#xA;  auctor sed, faucibus vestibulum, gravida vitae, arcu. Nunc posuere. Suspendisse&#xA;  potenti. Praesent in arcu ac nisl ultricies ultricies. Fusce eros. Sed pulvinar&#xA;  vehicula ante. Maecenas urna dolor, egestas vel, tristique et, porta eu,&#xA;  leo. Curabitur vitae sem eget arcu laoreet vulputate. Cras orci neque, faucibus&#xA;  et, rhoncus ac, venenatis ac, magna. Aenean eu lacus. Aliquam luctus facilisis&#xA;  augue. Nullam fringilla consectetuer sapien. Aenean neque augue, bibendum a,&#xA;  feugiat id, lobortis vel, nunc. Suspendisse in nibh quis erat condimentum&#xA;  pretium. Vestibulum tempor odio et leo. Sed sodales vestibulum justo. Cras&#xA;  convallis pellentesque augue. In eu magna. In pede turpis, feugiat pulvinar,&#xA;  sodales eget, bibendum consectetuer, magna. Pellentesque vitae augue.&#xA;&#xA;  [[file:data/fool.jpg][Foo]]&#xA;&#xA;&#xA;&#xA;* Headline 2                                                          :ready:&#xA;&#xA;  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent libero orci,&#xA;  auctor sed, faucibus vestibulum, gravida vitae, arcu. Nunc posuere. Suspendisse&#xA;  potenti. Praesent in arcu ac nisl ultricies ultricies. Fusce eros. Sed pulvinar&#xA;  vehicula ante. Maecenas urna dolor, egestas vel, tristique et, porta eu,&#xA;  leo. Curabitur vitae sem eget arcu laoreet vulputate. Cras orci neque, faucibus&#xA;  et, rhoncus ac, venenatis ac, magna. Aenean eu lacus. Aliquam luctus facilisis&#xA;  augue. Nullam fringilla consectetuer sapien. Aenean neque augue, bibendum a,&#xA;  feugiat id, lobortis vel, nunc. Suspendisse in nibh quis erat condimentum&#xA;  pretium. Vestibulum tempor odio et leo. Sed sodales vestibulum justo. Cras&#xA;  convallis pellentesque augue. In eu magna. In pede turpis, feugiat pulvinar,&#xA;  sodales eget, bibendum consectetuer, magna. Pellentesque vitae augue.&#xA;&#xA;  [[file:data/fool-2.jpg][Foo2]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Expected result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;heading_1.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 1                                                          :ready:&#xA;&#xA;  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent libero orci,&#xA;  auctor sed, faucibus vestibulum, gravida vitae, arcu. Nunc posuere. Suspendisse&#xA;  potenti. Praesent in arcu ac nisl ultricies ultricies. Fusce eros. Sed pulvinar&#xA;  vehicula ante. Maecenas urna dolor, egestas vel, tristique et, porta eu,&#xA;  leo. Curabitur vitae sem eget arcu laoreet vulputate. Cras orci neque, faucibus&#xA;  et, rhoncus ac, venenatis ac, magna. Aenean eu lacus. Aliquam luctus facilisis&#xA;  augue. Nullam fringilla consectetuer sapien. Aenean neque augue, bibendum a,&#xA;  feugiat id, lobortis vel, nunc. Suspendisse in nibh quis erat condimentum&#xA;  pretium. Vestibulum tempor odio et leo. Sed sodales vestibulum justo. Cras&#xA;  convallis pellentesque augue. In eu magna. In pede turpis, feugiat pulvinar,&#xA;  sodales eget, bibendum consectetuer, magna. Pellentesque vitae augue.&#xA;&#xA;  [[file:data/fool.jpg][Foo]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;heading_2.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Headline 2                                                          :ready:&#xA;&#xA;  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent libero orci,&#xA;  auctor sed, faucibus vestibulum, gravida vitae, arcu. Nunc posuere. Suspendisse&#xA;  potenti. Praesent in arcu ac nisl ultricies ultricies. Fusce eros. Sed pulvinar&#xA;  vehicula ante. Maecenas urna dolor, egestas vel, tristique et, porta eu,&#xA;  leo. Curabitur vitae sem eget arcu laoreet vulputate. Cras orci neque, faucibus&#xA;  et, rhoncus ac, venenatis ac, magna. Aenean eu lacus. Aliquam luctus facilisis&#xA;  augue. Nullam fringilla consectetuer sapien. Aenean neque augue, bibendum a,&#xA;  feugiat id, lobortis vel, nunc. Suspendisse in nibh quis erat condimentum&#xA;  pretium. Vestibulum tempor odio et leo. Sed sodales vestibulum justo. Cras&#xA;  convallis pellentesque augue. In eu magna. In pede turpis, feugiat pulvinar,&#xA;  sodales eget, bibendum consectetuer, magna. Pellentesque vitae augue.&#xA;&#xA;  [[file:data/fool-2.jpg][Foo]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe a duplicate of : &lt;a href=&quot;https://emacs.stackexchange.com/questions/2259/how-to-export-top-level-headings-of-org-mode-buffer-to-separate-files&quot; title=&quot;this question&quot;&gt;this question&lt;/a&gt; but did not help...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) of 2016-09-17&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Org-mode version 8.3.6&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13369" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2024-03-16T07:08:21.090" Title="How to export top level trees in an org file to corresponding files?" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27227" PostTypeId="1" CreationDate="2016-09-21T03:10:29.580" Score="0" ViewCount="404" Body="&lt;p&gt;I would like to use Emacs 64bit Windows version to view images sometimes, PNG images and JPEG images mostly.   The &lt;a href=&quot;http://ftp.gnu.org/gnu/emacs/windows/README&quot; rel=&quot;nofollow&quot;&gt;README&lt;/a&gt; file says: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs can also support some other image formats with appropriate&#xA;   libraries.  These libraries are all available on the following sites:&lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;&lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/projects/ezwinports/files/&lt;/a&gt;&#xA;  -- leaner, more up-to-date builds, only for 32-bit Emacs&lt;/li&gt;&#xA;  &lt;li&gt;&lt;a href=&quot;http://www.gtk.org/download/win32.php&quot; rel=&quot;nofollow&quot;&gt;http://www.gtk.org/download/win32.php&lt;/a&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;http://www.gtk.org/download/win64.php&quot; rel=&quot;nofollow&quot;&gt;http://www.gtk.org/download/win64.php&lt;/a&gt;&#xA;  -- the GTK project site; offers much fatter builds, but includes&#xA;     64-bit DLLs (from the 2nd URL)&lt;/li&gt;&#xA;  &lt;li&gt;GnuWin32 project -- very old builds, not recommended  &lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The URLs in the 2nd point are no longer valid. I've googled a lot and still haven't found a place to download 64bit image libraries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to use Emacs 32bit and I could download the image libraries from &lt;a href=&quot;http://sourceforge.net/projects/ezwinports/files/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/projects/ezwinports/files/&lt;/a&gt;   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question is,  now using the 64bit,  where can I can download the PNG &amp;amp; JPEG image libraries? &lt;/p&gt;&#xA;" OwnerUserId="10287" LastActivityDate="2017-03-20T12:14:41.470" Title="Where to download image library for Emacs 64bit Windows version?" Tags="|images|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27228" PostTypeId="1" CreationDate="2016-09-21T06:20:57.617" Score="1" ViewCount="108" Body="&lt;p&gt;[Note to folks with itchy 'close' fingers: this is &lt;strong&gt;not&lt;/strong&gt; a duplicate of &lt;a href=&quot;https://emacs.stackexchange.com/questions/16398/noninteractively-upgrade-all-packages&quot;&gt;Noninteractively upgrade all packages&lt;/a&gt;, since those answers rely on code or package &lt;strong&gt;in&lt;/strong&gt; one's &lt;code&gt;init.el&lt;/code&gt;, which would suffer from the following problem described below.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently-unpackaged, but migrating there now. I'm also not much of an Org user now, but hope to increase my usage soon. I noticed &lt;a href=&quot;https://github.com/eschulte/emacs24-starter-kit/issues/85&quot; rel=&quot;nofollow noreferrer&quot;&gt;this open issue&lt;/a&gt; on &lt;a href=&quot;https://github.com/eschulte/emacs24-starter-kit&quot; rel=&quot;nofollow noreferrer&quot;&gt;Eric Schulte's popular ESK&lt;/a&gt;, which says (edited to collapse nested blockquote)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;As people will quickly tell you when you ask about weird Org issues,&#xA;&quot;when installing from ELPA, please do so from a fresh Emacs session&#xA;where no Org function has been called.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OTOH, ESK is not the only Emacs config out there that uses literately-programmed &lt;code&gt;tangle&lt;/code&gt;d Org, so I'm guessing &quot;there's gotta be a way&quot; to, e.g., run package updates (at least for Org) offline. Perhaps with a one-liner like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -a '' -e '(unknown-package-update-magic)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;? (I'm guessing one must use &lt;code&gt;-e&lt;/code&gt; since I'm not seeing any equivalent of &lt;code&gt;--no-init-file&lt;/code&gt; for &lt;code&gt;emacsclient&lt;/code&gt;, at least for my version=24.4--am I missing something?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically I'd like to know:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1.&lt;/code&gt; Does the above instruction still apply? I.e., should (at least, to avoid &quot;weird issues&quot;) one still update Org packages from a never-Org'ed session?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;2.&lt;/code&gt; When referring to an &lt;code&gt;Emacs session&lt;/code&gt; in this context, how does running &lt;code&gt;emacs --daemon&lt;/code&gt; (either directly after host boot, or indirectly via, e.g., &lt;code&gt;emacsclient -c -a '' -e&lt;/code&gt;) change the situation? E.g., if I close my Emacs client (with &lt;code&gt;C-x C-c&lt;/code&gt;), but leave the daemon running, and then startup a new client, am I still in the same &quot;Emacs session&quot; until I kill/restart the daemon, or should I do something else to make a running daemon start a &lt;code&gt;fresh Emacs session&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;3.&lt;/code&gt; How to create a &lt;code&gt;fresh Emacs session&lt;/code&gt; in which &lt;code&gt;no Org function has been called&lt;/code&gt; if one's &lt;code&gt;init.el&lt;/code&gt; (or code called by one's &lt;code&gt;init.el&lt;/code&gt;) calls Org functions? For extra credit, show how to create an Emacs session (after answering the previous question :-) that can programmatically update all one's packages (or at least one package name provided by the user) and then exit.&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-12-22T22:32:40.540" Title="how to upgrade packages if init file calls package function?" Tags="|init-file|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27229" PostTypeId="2" ParentId="26864" CreationDate="2016-09-21T07:26:33.277" Score="3" Body="&lt;p&gt;I had the same issue. I believe this is because the indentation is implemented as a number of spaces, but those spaces are in the face &amp;quot;org-indent&amp;quot; which, by default, changes no attributes.&lt;/p&gt;&#xA;&lt;p&gt;The result of this is that your indentation is set by the pitch of your &amp;quot;default&amp;quot; face, which is now narrower than the pitch of your bullets in your headings and therefore your body text looks like it's shifted left compared with the indentation of your headings.&lt;/p&gt;&#xA;&lt;p&gt;As a solution I have the following in my init:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'org-indent nil :inherit '(org-hide fixed-pitch))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;My heading face always inherits from fixed-pitch so that tags line up, hence the use of &amp;quot;fixed-pitch&amp;quot; above.&lt;/p&gt;&#xA;&lt;p&gt;It's not perfect, but this has at least made it acceptable enough that I've stopped noticing. I also use &amp;quot;org-bullets&amp;quot; for prettier indents, which may be why it doesn't work perfectly (since the bullets end up being of a varying size), but if you don't use org-bullets this is likely to work even better for you.&lt;/p&gt;&#xA;&lt;p&gt;Note that I had to wrap the above face change into a hook to ensure it was done at the appropriate time. It's probably clumsy, but the way I've done that in my init is as follows:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda ()&#xA;            (set-face-attribute 'org-indent nil&#xA;                                :inherit '(org-hide fixed-pitch))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="737" LastEditorUserId="33424" LastEditDate="2023-03-17T13:31:30.263" LastActivityDate="2023-03-17T13:31:30.263" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27231" PostTypeId="2" ParentId="27227" CreationDate="2016-09-21T10:45:41.057" Score="1" Body="&lt;p&gt;The Wayback Machine has archives of both those gtk pages and the binaries are available to download on both. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://web.archive.org/web/20150905072710/http://www.gtk.org/download/win32.php&quot; rel=&quot;nofollow&quot;&gt;GTK page for win32&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://web.archive.org/web/20150905074429/http://www.gtk.org/download/win64.php&quot; rel=&quot;nofollow&quot;&gt;GTK page for win64&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-21T10:45:41.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27232" PostTypeId="1" AcceptedAnswerId="27233" CreationDate="2016-09-21T11:27:04.303" Score="3" ViewCount="486" Body="&lt;p&gt;I have an interesting problem that I am sure there must be a simple answer to if I can find the right syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, as outlined below, I have a simple sh code block that prints a variable that is declared as part of #+begin_src.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: test-fn&#xA;#+begin_src sh :var testvar=&quot;This is a test&quot;&#xA;echo testvar=$testvar&#xA;#+end_src&#xA;&#xA;#+RESULTS: test-fn&#xA;: testvar=This is a test&#xA;&#xA;#+begin_src sh :noweb yes&#xA;&amp;lt;&amp;lt;test-fn&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: testvar=&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I execute the code block directly, the parameter is evaluated.  When it is called from a noweb reference in a different code block, the parameter is not evaluated.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I get the called code block to evaluate it's parameters?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT1: I am using GNU Emacs 25.0.94.2 (x86_64-w64-mingw32) of 2016-05-26 running on Windows 10 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT2: Including the actual problem in detail &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: test-harness-running?&#xA;#+begin_src ruby :results value&#xA;...&#xA;#+end_src&#xA;&#xA;#+name: start-fw-test-harness&#xA;#+begin_src sh :noweb yes :var running=test-harness-running? :results output&#xA;...&#xA;#+end_src&#xA;&#xA;#+name: remove-fw-flash&#xA;#+begin_src sh :results output&#xA;...&#xA;#+end_src&#xA;&#xA;#+name: stop-fw-test-harness-if-running&#xA;#+begin_src sh :var running=test-harness-running? :noweb yes :results output&#xA;...&#xA;#+end_src&#xA;&#xA;#+begin_src sh :noweb yes :results output&#xA;    &amp;lt;&amp;lt;stop-fw-test-harness-if-running&amp;gt;&amp;gt;&#xA;    &amp;lt;&amp;lt;remove-fw-flash&amp;gt;&amp;gt;&#xA;    &amp;lt;&amp;lt;start-fw-test-harness&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason I've been doing it like this is I re-use stop-fw-test-harness-if-running, remove-fw-flash and start-fw-test-harness in many different scenarios (I used to use command line for it but I find babel gives me greater flexibility).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that start-fw-test-harness and stop-fw-test harness should only do their thing if the test harness is already started/stopped. However when called from a noweb reference, &quot;running&quot; never gets set as test-harness-running? is not called and so neither of these ever do anything.  They work just fine when called directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT3: Applying mutbuerger's solution to my problem, I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :noweb yes :results output :var dummy1=stop-fw-test-harness-if-running :var dummy2=remove-fw-flash :var dummy3=start-fw-test-harness&#xA;    echo $dummy1&#xA;    echo $dummy2&#xA;    echo $dummy3 &#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: nil&#xA;: 22 Sep 2016 09:50:30 Deleting 351277001993561_STORE.prps 351277001993561_STORE.prps has been deleted&#xA;: nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While this clearly works, I am reluctant to Accept the answer on account of the copious use of dummy variables and that I am not 100% sure the order in which the functions are called is clearly defined.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT4:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following mutbuerger's revised solution, this fixes my problem perfectly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :results output :noweb yes&#xA;    &amp;lt;&amp;lt;stop-fw-test-harness-if-running()&amp;gt;&amp;gt;&#xA;    &amp;lt;&amp;lt;remove-fw-flash()&amp;gt;&amp;gt;&#xA;    &amp;lt;&amp;lt;start-fw-test-harness()&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13104" LastEditorUserId="13104" LastEditDate="2016-09-22T10:21:16.427" LastActivityDate="2016-09-22T10:21:16.427" Title="How to get babel code blocks to evaluate parameters when called from a noweb ref?" Tags="|org-mode|org-babel|noweb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27233" PostTypeId="2" ParentId="27232" CreationDate="2016-09-21T13:10:05.913" Score="4" Body="&lt;p&gt;There may be other solutions, this is how I would do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :noweb yes :var res=test-fn()&#xA;echo $res&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: testvar=This is a test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same can be done without introducing the dummy variable (as is described &lt;a href=&quot;http://org-babel.readthedocs.io/en/latest/header-args/#syntax-of-noweb-references&quot; rel=&quot;nofollow&quot;&gt;in the documentation&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :noweb yes&#xA;echo &amp;lt;&amp;lt;test-fn()&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: testvar=This is a test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2016-09-22T10:02:09.587" LastActivityDate="2016-09-22T10:02:09.587" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27234" PostTypeId="2" ParentId="27226" CreationDate="2016-09-21T13:19:21.150" Score="0" Body="&lt;p&gt;&lt;strong&gt;ANSWER&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, ended up implementing my function. So far, it is working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun me/org-map-entries (org-file in-tags func)&#xA;  (let ((tags (if (stringp in-tags)&#xA;                   (list in-tags)&#xA;                 in-tags)))&#xA;&#xA;    (with-temp-buffer&#xA;      (org-mode)&#xA;      (insert-file-contents org-file-main)&#xA;&#xA;      ;; Execute func at each heading that matches tags.&#xA;      (while (&amp;lt; (point) (point-max))&#xA;&#xA;        ;; If find a heading...&#xA;        (and (search-forward-regexp &quot;^\* &quot; nil &quot;end&quot;)&#xA;&#xA;             ;; ...that matches the given tags...&#xA;             (seq-reduce&#xA;              (lambda(a b) (and a b))&#xA;              (mapcar&#xA;               (lambda (tag)&#xA;                 (beginning-of-line)&#xA;                 (search-forward-regexp&#xA;                  (concat &quot;:&quot; tag &quot;:&quot;) (line-end-position) &quot;end&quot;))&#xA;               tags)&#xA;              t)&#xA;&#xA;             ;; ... then execute given function with cursor at beginning of&#xA;             ;; heading.&#xA;             (progn&#xA;               (beginning-of-line)&#xA;               (save-excursion&#xA;                 (funcall func))&#xA;               (end-of-line)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13369" LastEditorUserId="13369" LastEditDate="2016-09-22T09:59:28.190" LastActivityDate="2016-09-22T09:59:28.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27235" PostTypeId="2" ParentId="27222" CreationDate="2016-09-21T13:25:21.493" Score="0" Body="&lt;p&gt;You can achieve that with &lt;a href=&quot;http://wikemacs.org/wiki/Elscreen#Persistent_screens_accross_sessions&quot; rel=&quot;nofollow&quot;&gt;elscreen-persist&lt;/a&gt;. Create screens and open the files you need, then call &lt;code&gt;M-x elscreen-persist-store&lt;/code&gt; and &lt;code&gt;elscreen-persist-restore&lt;/code&gt; to restore what you saved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;and maybe tabbar.el does that through configuration.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2016-09-21T13:25:21.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27236" PostTypeId="1" CreationDate="2016-09-21T15:12:57.817" Score="1" ViewCount="1287" Body="&lt;p&gt;I want to add &lt;code&gt;global-semantic-idle-summary-mode&lt;/code&gt; in my .emacs file instead of calling everytime it by using M-x.&#xA;I tried with &lt;code&gt;(setq ...)&lt;/code&gt; but it doesn't work. What's the right way?&lt;/p&gt;&#xA;" OwnerUserId="13380" LastEditorUserId="105" LastEditDate="2016-09-22T15:37:12.110" LastActivityDate="2016-09-22T15:37:12.110" Title="How to turn on a minor mode in my init file?" Tags="|init-file|minor-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27237" PostTypeId="2" ParentId="27236" CreationDate="2016-09-21T15:25:38.357" Score="4" Body="&lt;p&gt;It is a minor-mode which can be enabled with:  &lt;code&gt;(global-semantic-idle-summary-mode 1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doc-string states:  &quot;&lt;em&gt;Toggle Global Semantic Idle Summary mode.  With ARG, turn Global Semantic Idle Summary mode on if ARG is positive, off otherwise.  When this minor mode is enabled, 'semantic-idle-summary-mode' is turned on in every Semantic-supported buffer.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, a user may test for whether a minor-mode is active by inspecting the variable containing the same -- e.g., &lt;code&gt;M-x describe-variable RET semantic-idle-summary-mode RET&lt;/code&gt;  Unless the variable has been specifically defined beforehand, it will not exist until the minor-mode has been activated.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-09-21T15:44:02.827" LastActivityDate="2016-09-21T15:44:02.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27240" PostTypeId="2" ParentId="15116" CreationDate="2016-09-21T19:33:33.207" Score="1" Body="&lt;p&gt;Works for me, out of the box - &lt;code&gt;emacs -Q&lt;/code&gt; (no init file). Works in both old and new Emacs versions, including Emacs 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it not work for you, if you start Emacs using &lt;code&gt;emacs -Q&lt;/code&gt;? If that works then recursively bisect your init file to find the culprit. You can use &lt;code&gt;M-x comment-region&lt;/code&gt; to comment out the active region (with a prefix arg it uncomments the region).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Typically, if the region becomes inactive after your command, you just need to add &lt;code&gt;(setq deactivate-mark  nil)&lt;/code&gt; to the end of the command code. But your code works as is, as far as I can tell.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;(global-set-key [(ctrl f)] 'mp-search)&lt;/code&gt;, &lt;code&gt;(ctrl f)&lt;/code&gt; is currently undocumented syntax.  &lt;code&gt;[(control f)]&lt;/code&gt; is documented, as is this, which lets you reuse the external syntax (e.g. of &lt;code&gt;C-h k&lt;/code&gt;): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-f&quot;) 'mp-search)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-22T22:34:15.973" LastActivityDate="2016-09-22T22:34:15.973" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27241" PostTypeId="2" ParentId="27210" CreationDate="2016-09-21T21:13:42.137" Score="0" Body="&lt;p&gt;I can tell you what's going on, but it is not clear to me whether we should call it a bug or glitch.&#xA;When you get the position of the cursor in the unfolded document (using &lt;code&gt;(point)&lt;/code&gt;) you get 84. Now, when you use the global folding and everything folds to the first headline, your cursor may seem to be positioned at &lt;code&gt;* Level 1 Heading 1{cursor here}&lt;/code&gt;, but you can test that the buffer position is still 84. So, the cursor is still positioned at the end of the level 3 headline. When you do an `(org-cycle), it just opens the contents under that headline (and the headline itself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prevent this behavior, you need to execute any action which has an influence on the cursor. E.g. moving it one space. Even executing the &lt;code&gt;(point)&lt;/code&gt; statement to get the position will end up placing the cursor in the visible region, so the first execution in the above setup will return 84, the second invocation 20.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2016-09-21T21:13:42.137" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27242" PostTypeId="2" ParentId="27156" CreationDate="2016-09-21T21:24:33.590" Score="2" Body="&lt;p&gt;First, define a mode for this log file. Put the following somewhere in emacs and eval it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode sql-log-mode text-mode &quot;sql-log&quot;&#xA;  &quot;Hack&quot;&#xA;  (setq font-lock-multiline t)&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   '((&quot;\\[DbConnectionImpl\\] - \\[\\([^\]]*\\)\\]&quot; 1 'font-lock-warning-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This creates a new mode for the sql log file. In this mode, we use a regexp to find the text and highlight it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then open the log file and then &lt;code&gt;M-x sql-log-mode&lt;/code&gt;. This will activate the mode and turn on syntax highlighting for the sql using &lt;code&gt;'font-lock-warning-face&lt;/code&gt;, which is probably not yellow. &lt;code&gt;'font-lock-comment-face&lt;/code&gt; might be better. Play around with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't like any built-in faces, define your own face and use that directly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface sql-log-mode-sql-face '((t :inherit 'font-lock-string-face&#xA;                                    :foreground &quot;yellow&quot;))&#xA;  &quot;font face for sql&quot;)&#xA;&#xA;(define-derived-mode sql-log-mode text-mode &quot;sql-log&quot;&#xA;  &quot;Hack&quot;&#xA;  (setq font-lock-multiline t)&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   '((&quot;\\[DbConnectionImpl\\] - \\[\\([^\]]*\\)\\]&quot; 1 'sql-log-mode-sql-face))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: To add highlighting for other parts, simply extend the regexp and add more face names:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode sql-log-mode text-mode &quot;sql-log&quot;&#xA;  &quot;Hack&quot;&#xA;  (setq font-lock-multiline t)&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   '((&quot;\\[\\([^\]]*\\)\\]\\[\\([^\]]*\\)\\]\\[\\(DbConnectionImpl\\)\\] - \\[\\([^\]]*\\)\\]&quot;&#xA;      (1 'font-lock-warning-face)&#xA;      (2 'font-lock-doc-face)&#xA;      (3 'font-lock-function-name-face)&#xA;      (4 'font-lock-string-face)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9181" LastEditorUserId="9181" LastEditDate="2016-09-23T01:57:58.190" LastActivityDate="2016-09-23T01:57:58.190" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27244" PostTypeId="2" ParentId="27214" CreationDate="2016-09-21T22:19:16.033" Score="1" Body="&lt;p&gt;The &lt;code&gt;tabbar&lt;/code&gt; package uses an obscure emacs features called the &lt;code&gt;header-line&lt;/code&gt; to display the tab bar. This &lt;code&gt;header-line&lt;/code&gt; is an extra line of text shown at the top of a buffer, just as the &lt;code&gt;mode-line&lt;/code&gt; is shown at the bottom. The text in this line is rendered using the &lt;code&gt;tabbar-default&lt;/code&gt; face, so you could edit it and change some parameters to customize the look of the tab bar. You could change its font size, or change the font used, for example. Perhaps that will get you close to what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, you can't change the line spacing for an individual face, that has to be done for the buffer as a whole. (Curiously, the &lt;code&gt;line-spacing&lt;/code&gt; variable isn't used for the &lt;code&gt;header-line&lt;/code&gt; or the &lt;code&gt;mode-line&lt;/code&gt;, so you can put extra space between all the lines of the buffer except these two.)&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-21T22:19:16.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27245" PostTypeId="2" ParentId="26665" CreationDate="2016-09-21T22:39:48.923" Score="0" Body="&lt;p&gt;Using package-list-packages and installing the &quot;org&quot; package from elpa (currently 8.3.6) also resolves this problem in current Emacs.&lt;/p&gt;&#xA;" OwnerUserId="13384" LastActivityDate="2016-09-21T22:39:48.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27246" PostTypeId="1" AcceptedAnswerId="27248" CreationDate="2016-09-21T22:46:51.560" Score="3" ViewCount="183" Body="&lt;p&gt;I have some frames in emacs window, and I want in one of them having open agenda (org mode) but often emacs replaces me content of this frame (for example if I use list packages, rgrep etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make this frame (and maybe one-two more) inviolable? Something like left panel of neotree.&lt;/p&gt;&#xA;" OwnerUserId="13386" LastActivityDate="2016-09-22T00:00:38.093" Title="How to make frame inviolable?" Tags="|frames|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27248" PostTypeId="2" ParentId="27246" CreationDate="2016-09-21T23:53:21.227" Score="3" Body="&lt;p&gt;(You have your terms backward: the window-manager &quot;window&quot; is called a &lt;em&gt;frame&lt;/em&gt; in Emacs. It can be divided into multiple panes, which Emacs calls &lt;em&gt;windows&lt;/em&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make the window be &lt;em&gt;dedicated&lt;/em&gt;. Here is one way to do that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f set-window-dedicated-p&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set-window-dedicated-p is a built-in function in `C source code'.&#xA;&#xA;(set-window-dedicated-p WINDOW FLAG)&#xA;&#xA;Mark WINDOW as dedicated according to FLAG.&#xA;WINDOW must be a live window and defaults to the selected one.  FLAG&#xA;non-nil means mark WINDOW as dedicated to its buffer.  FLAG nil means&#xA;mark WINDOW as non-dedicated.  Return FLAG.&#xA;&#xA;When a window is dedicated to its buffer, `display-buffer' will refrain&#xA;from displaying another buffer in it.  `get-lru-window' and&#xA;`get-largest-window' treat dedicated windows specially.&#xA;`delete-windows-on', `replace-buffer-in-windows', `quit-window',&#xA;`quit-restore-window' and `kill-buffer' can delete a dedicated window&#xA;and the containing frame.&#xA;&#xA;As a special case, if FLAG is t, mark WINDOW as &quot;strongly&quot; dedicated to&#xA;its buffer.  Functions like `set-window-buffer' may change the buffer&#xA;displayed by a window, unless that window is strongly dedicated to its&#xA;buffer.  If and when `set-window-buffer' displays another buffer in a&#xA;window, it also makes sure that the window is no more dedicated.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(What that verbose doc calls &quot;strongly dedicated&quot; is what used to be called &quot;dedicated&quot;. See predicate &lt;code&gt;window-dedicated-p&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another, simple way, is to tell Emacs that certain buffer names, or buffer names matching a given regexp, are &quot;&lt;strong&gt;special-display&lt;/strong&gt;&quot;. That means that their windows are to be dedicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this by customizing either or both user options &lt;strong&gt;&lt;code&gt;special-display-buffer-names&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;special-display-regexps&lt;/code&gt;&lt;/strong&gt;.  These options are very easy to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Emacs Dev considers these simple and useful user options to be &quot;obsolete&quot;, but they are still supported, fortunately. If you want to use what they recommend now, instead of &lt;code&gt;special-display-*&lt;/code&gt;, then you'll need to delve into the complex labyrinth of user option &lt;strong&gt;&lt;code&gt;display-buffer-alist&lt;/code&gt;&lt;/strong&gt;.  You can accomplish the same thing with this option as you can accomplish with the &lt;code&gt;special-display-*&lt;/code&gt; (and a lot more).  It's just more complicated to do the same thing.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-22T00:00:38.093" LastActivityDate="2016-09-22T00:00:38.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27249" PostTypeId="1" AcceptedAnswerId="27250" CreationDate="2016-09-22T00:09:30.107" Score="1" ViewCount="1499" Body="&lt;p&gt;Are &lt;code&gt;'function-name&lt;/code&gt; and &lt;code&gt;(function function-name)&lt;/code&gt; completely equivalent, or are there conditions under which I &lt;em&gt;must&lt;/em&gt; use the more verbose &lt;code&gt;(function function-name)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply 'message ( list &quot;call func via quote&quot;))&#xA;(apply (function message) (list &quot;call func via function keyword&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both of them yield the same effect. But in many elisp libraries, i am seeing people using &lt;code&gt;(function func)&lt;/code&gt; to pass function symbols like in &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/dired-aux.el#L1305&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dired-add-file (filename &amp;amp;optional marker-char)&#xA;  (dired-fun-in-all-buffers&#xA;   (file-name-directory filename) (file-name-nondirectory filename)&#xA;   (function dired-add-entry) filename marker-char))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why do people use more verbose way, when they can use just a quote?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastEditorUserId="105" LastEditDate="2022-09-18T17:32:53.687" LastActivityDate="2022-09-18T17:32:53.687" Title="Pass function symbol as argument via function or single quote?" Tags="|functions|quote|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27250" PostTypeId="2" ParentId="27249" CreationDate="2016-09-22T01:22:50.863" Score="3" Body="&lt;p&gt;&lt;code&gt;'foo&lt;/code&gt; and &lt;code&gt;(quote foo)&lt;/code&gt; are identical: they prevent evaluation of &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#'foo&lt;/code&gt; and &lt;code&gt;(function foo)&lt;/code&gt; are also identical: they extract the function binding of &lt;code&gt;foo&lt;/code&gt;, including at compile time, which means that the function gets compiled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you want a &lt;em&gt;symbol&lt;/em&gt;, use &lt;code&gt;'foo&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-variable-buffer-local 'my-local-var)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if you want a &lt;em&gt;function&lt;/em&gt;, use &lt;code&gt;#'foo&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-after-function #'my-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply #'my-function arg1 arg2 others)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/q/134887/850781&quot;&gt;When to use 'quote in Lisp&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/q/29338004/850781&quot;&gt;Why sharp quote lambda expressions?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="795" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-22T01:22:50.863" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27251" PostTypeId="2" ParentId="27202" CreationDate="2016-09-22T01:47:36.627" Score="31" Body="&lt;p&gt;@StuartHickinbottom explained what I was doing wrong: using &lt;code&gt;libgnutls-28.dll&lt;/code&gt; when Emacs 25.1 requires the newer and incompatible &lt;code&gt;libgnutls-30.dll&lt;/code&gt;. Then it was a matter of finding binaries of &lt;code&gt;libgnutls-30.dll&lt;/code&gt; and other required libraries. Thankfully Phillip Lord has compiled Windows versions of all the GnuTLS libraries and dependencies &lt;em&gt;and&lt;/em&gt; many other libraries you might want for Emacs! They are available &lt;a href=&quot;https://ftp.gnu.org/gnu/emacs/windows/emacs-25/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;: get &lt;code&gt;emacs-25-i686-deps.zip&lt;/code&gt; if you use 32-bit Windows and get &lt;code&gt;emacs-25-x86_64-deps.zip&lt;/code&gt; if you use 64-bit; then unzip in the root folder of your Emacs installation (so that the &lt;code&gt;bin&lt;/code&gt; folder of the zip files gets decompressed into the &lt;code&gt;bin&lt;/code&gt; folder of your Emacs installation, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I figured out how to find out which version of a library Emacs is expecting: look in the variable &lt;code&gt;dynamic-library-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="11217" LastEditDate="2019-06-20T01:49:31.207" LastActivityDate="2019-06-20T01:49:31.207" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="27252" PostTypeId="1" AcceptedAnswerId="27253" CreationDate="2016-09-22T02:31:13.553" Score="0" ViewCount="26" Body="&lt;pre&gt;&lt;code&gt;~/github/hub $ git rev-parse HEAD&#xA;4777bd363058213605ebb292b35ef1a6edb3663c&#xA;&#xA;~/github/hub $ git --no-pager log \&#xA;                --grep='\[ci skip\]' --invert-grep \&#xA;                --format=oneline --max-count=1&#xA;cbf7ab1ba3fa91287085ce0cbebdc11c84388888 Improve `hub merge` to not generate leftover remote refs&#xA;&#xA;~/github/hub $ (magit-git-lines &quot;log&quot;&#xA;                &quot;--grep='\\[ci skip\\]'&quot; &quot;--invert-grep&quot;&#xA;                &quot;--format=oneline&quot; &quot;--max-count=1&quot;)&#xA;(&quot;4777bd363058213605ebb292b35ef1a6edb3663c Update `merge` documentation&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The repository I'm working with is &lt;a href=&quot;https://github.com/github/hub&quot; rel=&quot;nofollow&quot;&gt;github/hub&lt;/a&gt;.  I can only assume I'm misapplying the arguments, but I can't see my error.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-09-22T02:43:26.930" Title="Why does magit-git-lines differ from git output in this case?" Tags="|magit|process|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27253" PostTypeId="2" ParentId="27252" CreationDate="2016-09-22T02:43:26.930" Score="2" Body="&lt;p&gt;&lt;code&gt;magit-git-lines&lt;/code&gt; does not run a shell, so you don't need the single quotes to protect the argument value.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(magit-git-lines &quot;log&quot;&#xA;                 &quot;--grep=\\[ci skip\\]&quot; &quot;--invert-grep&quot;&#xA;                 &quot;--format=oneline&quot; &quot;--max-count=1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-09-22T02:43:26.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27254" PostTypeId="1" AcceptedAnswerId="27274" CreationDate="2016-09-22T03:48:44.963" Score="2" ViewCount="754" Body="&lt;p&gt;So I've decided to try emacs, and I find it really good. However, I'm mostly writing Python, so the indentation is a crucial thing for me. After couple of failures in configuring I've finally reached to the point when I press ENTER, it goes to new line and automatically indents it (with TAB - size 4). Okay. But lets say I've got a function and a loop inside it. If I want emacs to indent a for loop it does it not in a proper way (for me):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main()&#xA;{&#xA;    for (int i=0; i&amp;lt;=10; i++)&#xA;        {&#xA;            printf(&quot;lol\n&quot;);&#xA;        }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;cuz I want it to be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main()&#xA;{&#xA;    for (int i=0; i&amp;lt;=10; i++)&#xA;    {&#xA;        printf(&quot;lol\n&quot;);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.emacs file&lt;/code&gt; looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme `wombat)&#xA;(setq-default standard-indent 4)&#xA;(mouse-wheel-mode t)&#xA;(setq make-backup-files nil)&#xA;(line-number-mode 1)&#xA;(setq indent-size 4)&#xA;(setq-default tab-width 4)&#xA;(setq-default indent-tabs-mode t)&#xA;(setq-default indent-line-function 'insert-tab)&#xA;(defvaralias 'c-basic-offset 'tab-width)&#xA;(defvaralias 'cperl-indent-level 'tab-width)&#xA;(require 'package)&#xA;(add-to-list 'package-archives&#xA;  '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can configure this, to make it like I want it to be?&lt;/p&gt;&#xA;" OwnerUserId="13388" LastActivityDate="2016-09-23T05:51:54.730" Title="Emacs bad indentation" Tags="|init-file|indentation|" AnswerCount="1" CommentCount="5" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27255" PostTypeId="1" CreationDate="2016-09-22T04:53:16.653" Score="3" ViewCount="729" Body="&lt;p&gt;If I start clock on an item, I can use &lt;code&gt;org-clock-jump-to-current-clock&lt;/code&gt; and it always takes me to the current item (from any buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you clock-out, you cannot jump to &lt;code&gt;current-clock&lt;/code&gt; anymore and that makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if I started the timer via &lt;a href=&quot;https://github.com/lolownia/org-pomodoro&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;org-pomodoro&lt;/code&gt;&lt;/a&gt;? Then after it clocks out, in order to start another cycle I'd have to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open the .org buffer with the task I'm trying to clock&lt;/li&gt;&#xA;&lt;li&gt;run &lt;code&gt;org-pomodoro&lt;/code&gt; while on the task item&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;this will add a row to the item's CLOCK drawer (or whatever you have set in &lt;code&gt;org-clock-into-drawer&lt;/code&gt; variable)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there more efficient way to restart the timer on the last (clocked) item?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without having to find and open the .org buffer?&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="8992" LastEditDate="2016-09-22T20:57:40.687" LastActivityDate="2016-10-04T18:13:21.420" Title="Restarting pomodoro" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27256" PostTypeId="1" AcceptedAnswerId="27257" CreationDate="2016-09-22T09:19:43.793" Score="0" ViewCount="129" Body="&lt;p&gt;How can I make the column with the line numbers wider?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VT1d9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VT1d9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2016-09-22T10:02:24.563" Title="Make the column with the line numbers wider" Tags="|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27257" PostTypeId="2" ParentId="27256" CreationDate="2016-09-22T10:02:24.563" Score="1" Body="&lt;p&gt;You can change the appearance of &lt;code&gt;linum-mode&lt;/code&gt; by setting values for &lt;code&gt;linum-format&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add something like this to your &lt;code&gt;.emacs&lt;/code&gt; file :- &lt;code&gt;(setq linum-format &quot;%3s&quot;)&lt;/code&gt; [to have your &lt;code&gt;linum-mode&lt;/code&gt; numbers be at least 3 characters wide]. &lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-09-22T10:02:24.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27258" PostTypeId="2" ParentId="27156" CreationDate="2016-09-22T11:00:08.183" Score="2" Body="&lt;p&gt;The following will highlight the fields of the log file. The first three fields are highlighted using plain highlight rules, the fourth use an anchored rule to highlight multiple lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use this, add &lt;code&gt;fl-sql-activate&lt;/code&gt; to a suitable major mode hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See comments in the code below for implementation details.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface fl-sql-yellow-background '((t :background &quot;Yellow&quot;))&#xA;  &quot;Face for highlighting SQL statements in log file.&quot;)&#xA;&#xA;(defvar fl-sql--inside-dbconnectionimpl nil)&#xA;&#xA;(defun fl-sql-activate ()&#xA;  (setq font-lock-multiline t)&#xA;  (font-lock-add-keywords&#xA;   nil&#xA;   '((&quot;^\\[\\([^]]*\\)\\]\\[\\([^]]*\\)\\]\\[\\([^]]*\\)\\] - \\[&quot;&#xA;      ;; Plain font-lock rules. Highlight the three initial fields.&#xA;      (1 'font-lock-keyword-face)&#xA;      (2 'font-lock-constant-face)&#xA;      (3 'font-lock-function-name-face)&#xA;      ;; Anchored font-lock rule. Highlight the SQL lines.&#xA;      ;;&#xA;      ;; An &quot;anchored&quot; rule is effectively a search within a&#xA;      ;; search. The search is performed from where the pre-match&#xA;      ;; form place the point. The end of the inner search is&#xA;      ;; determined by the value the pre-match form is evaluated&#xA;      ;; to. In this case, the inner search is performed between&#xA;      ;; the &quot;[&quot; and the &quot;]&quot;.&#xA;      ;;&#xA;      ;; The inner search use the trivial regexp &quot;.+&quot;, causing&#xA;      ;; each line to be highlighted.&#xA;      (&quot;.+&quot;&#xA;       ;; Pre-match form. Place point where inner search should&#xA;       ;; start and the return point where it should end.&#xA;       (progn&#xA;         (ignore-errors&#xA;           ;; Remember if this is a DbConnectionImpl line.&#xA;           (setq fl-sql--inside-dbconnectionimpl&#xA;                 (equal (match-string-no-properties 3) &quot;DbConnectionImpl&quot;))&#xA;           ;; Place point after the &quot;[&quot; (start of inner search).&#xA;           (goto-char (match-end 0))&#xA;           ;; Return location before the &quot;]&quot; (end of inner search).&#xA;           (save-excursion&#xA;             (backward-char)&#xA;             (forward-sexp)&#xA;             (- (point) 1))))&#xA;       ;; Post-match form&#xA;       nil&#xA;       ;; Highlights of the anchored rule. Highlight SQL&#xA;       ;; statement, but only for DbConnectionImpl lines.&#xA;       (0 (if fl-sql--inside-dbconnectionimpl&#xA;              'fl-sql-yellow-background&#xA;            nil)))))))&#xA;&#xA;(add-hook 'SUITABLE-MAJOR-MODE-hook #'fl-sql-activate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-09-22T11:00:08.183" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27260" PostTypeId="1" CreationDate="2016-09-22T14:55:17.300" Score="1" ViewCount="32" Body="&lt;p&gt;It is clear from the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; how to set file variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: modename; var: value; … -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, at the top of my &lt;code&gt;~/.gitconfig&lt;/code&gt; file, I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: conf; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I recently discovered &lt;code&gt;gitconfig-mode&lt;/code&gt;, which makes this unnecessary, except in the case that this &lt;code&gt;.gitconfig&lt;/code&gt; is opened in an Emacs install that doesn't have &lt;code&gt;gitconfig-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to write the file mode specification to have a &quot;fallback&quot; mode, so that &lt;code&gt;gitconfig-mode&lt;/code&gt; is used if available, otherwise &lt;code&gt;conf-mode&lt;/code&gt; is used?&lt;/p&gt;&#xA;" OwnerUserId="10950" LastEditorUserId="105" LastEditDate="2016-09-22T15:35:57.553" LastActivityDate="2016-09-22T15:35:57.553" Title="Specify fallback possibilities for file-local variables?" Tags="|major-mode|file-local-variables|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27261" PostTypeId="2" ParentId="27215" CreationDate="2016-09-22T16:24:49.773" Score="2" Body="&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;Dired+&lt;/a&gt; then this is simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use &lt;strong&gt;&lt;code&gt;M-+ M-i&lt;/code&gt;&lt;/strong&gt; (command &lt;strong&gt;&lt;code&gt;diredp-insert-subdirs-recursive&lt;/code&gt;&lt;/strong&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, use menu &lt;code&gt;Multiple&lt;/code&gt; &gt; &lt;code&gt;Marked Here and Below&lt;/code&gt; &gt; &lt;code&gt;Insert Subdirs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dired+ has many commands that act on the marked files and the marked files in marked subdirectories, gathered recursively.  And when none are marked, these commands act on &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; files in &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; subdirectories.  All such commands are on prefix key &lt;strong&gt;&lt;code&gt;M-+&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if some files or subdirs are marked, such commands ignore the markings and act on &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; files in &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; subdirectories if you provide a &lt;em&gt;prefix argument&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;diredp-insert-subdirs-recursive&lt;/strong&gt; is an interactive compiled Lisp&#xA;      function in &lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(diredp-insert-subdirs-recursive &amp;amp;optional IGNORE-MARKS-P)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Insert the marked subdirs, including those in marked subdirs.&#xA;      Like &lt;code&gt;diredp-insert-subdirs&lt;/code&gt;, but act recursively on subdirs.&#xA;      The subdirs inserted are those that are marked in the current Dired&#xA;      buffer, or ALL subdirs in the directory if none are marked.  Marked&#xA;      subdirectories are handled recursively in the same way (their marked&#xA;      subdirs are inserted...).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With a prefix argument, ignore all marks - include all files in this&#xA;      Dired buffer and all subdirs, recursively.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-09-22T16:24:49.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27264" PostTypeId="2" ParentId="17578" CreationDate="2016-09-22T17:48:19.063" Score="2" Body="&lt;p&gt;This behaviour has changed now for Emacs 25.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original behaviour was to ensure that every buffer got an undo boundary, but it has negative side effects. Emacs 25.1 uses a new heuristic -- changes are lot more limited now and should only be to those buffers where changes have happened as a result of the command, not just by side effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in more detail, originally, after each change, Emacs would check the last changed buffer, and unless this was current, it would add an undo-boundary. So, when you add the second &quot;B&quot;, you get an undo boundary after &quot;A&quot; because the last change was in buffer &quot;FOO&quot; which is not current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it works differently. Emacs adds undos only at the end of a command, and it adds a boundary too all buffers which have been changed during the course of the command. So, in this case, both current and FOO would get an undo boundary after the command finishes. So, in Emacs 25, &quot;AB&quot; undo with a single undo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a timer that adds boundaries also, but that's a detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The motivation for this change was pretty much the one shown here - specifically, in this case, use of the &lt;code&gt;after-change-functions&lt;/code&gt; variable. If functions on here change another buffer, they used to affect the undo behaviour of the current buffer. Now they don't.&lt;/p&gt;&#xA;" OwnerUserId="5228" LastEditorUserId="5228" LastEditDate="2016-09-23T14:41:22.540" LastActivityDate="2016-09-23T14:41:22.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27265" PostTypeId="1" CreationDate="2016-09-22T18:10:15.513" Score="0" ViewCount="107" Body="&lt;p&gt;With the new 25.1 installed, I'm wondering if there is a better way to view a Markdown inside an Emacs buffer. Would this involve xwidget? Not sure how to enable/install xwidget on my new Emacs 25.1.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2016-09-22T18:10:15.513" Title="Does 25.1 allow Markdown viewing?" Tags="|markdown|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27266" PostTypeId="1" CreationDate="2016-09-22T18:17:56.853" Score="2" ViewCount="247" Body="&lt;p&gt;As part of a weekly review, I'd like to have a block agenda that displays only the subtrees under the &quot;Inbox&quot; heading in my inbox.org file (which is part of &lt;code&gt;org-agenda-files&lt;/code&gt;). To do that, I believe I would need to use a user-defined function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;  '(; Weekly Review block agenda&#xA;    (&quot;r&quot; . &quot;Weekly Review&quot;)&#xA;    (&quot;r1&quot; &quot;Review unprocessed items in Inbox&quot; &#xA;      my/org-get-items-under-headline &quot;Inbox&quot;&#xA;      ((org-agenda-overriding-header &quot;Inbox items to process:&quot;)))&#xA;    ; ...&#xA;   ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I need help writing the &lt;code&gt;my/org-get-items-under-headline&lt;/code&gt; function, which should take the parameter &lt;code&gt;heading&lt;/code&gt; and return all the subtree headlines under it. Unfortunately I'm not quite sure what kind of format &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; is looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My inbox.org file looks relatively simple.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Inbox&#xA;** Task 1&#xA;   :PROPERTIES:...&#xA;** Task 2&#xA;   :PROPERTIES:...&#xA;* Processing&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the block agenda should only display the Task 1 and Task 2 headlines.&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-09-22T18:17:56.853" Title="Org mode: Display only tasks under a specific headline in the agenda" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27267" PostTypeId="1" CreationDate="2016-09-22T19:00:24.957" Score="0" ViewCount="579" Body="&lt;p&gt;So I'm trying to setup default indentation in Emacs. Currently I have the following at the bottom of my &lt;code&gt;.emacs&lt;/code&gt; file as per a number of tutorials I've found on the internet.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;(setq tab-width 3)&#xA;(defvaralias 'c-basic-offset 'tab-width)&#xA;(defvaralias 'cperl-ident-level 'tab-width)&#xA;(defvaralias 'js-indent-level 'tab-width)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Except... it doesn't work; when I open a C++ code file, tab-width appears to be set to 8. Can someone tell me &lt;em&gt;why&lt;/em&gt; this is, and also what I need to do to fix it?&lt;/p&gt;&#xA;" OwnerUserId="10957" LastEditorUserId="675" LastEditDate="2016-09-22T22:32:57.723" LastActivityDate="2016-09-22T22:32:57.723" Title="Why is tab-width reset when I open a C++ file?" Tags="|init-file|indentation|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27268" PostTypeId="1" AcceptedAnswerId="27270" CreationDate="2016-09-22T19:52:13.310" Score="2" ViewCount="61" Body="&lt;p&gt;I need to advise emacs to do something when any error dings to the user. I can't find any documentation on which function I actually need to advise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which function do I need to advise to do something when a user-error is unhandled?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-22T20:17:22.290" Title="Which function should I advise to do something when a user-error is unhandled?" Tags="|advice|error-handling|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27269" PostTypeId="2" ParentId="27267" CreationDate="2016-09-22T20:11:44.050" Score="2" Body="&lt;p&gt;Ok, turns out the answer to my question was the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tab-width&lt;/code&gt; automatically becomes buffer local when set. The buffer local version derives from the default value, so I needed to use &lt;code&gt;setq-default&lt;/code&gt; not &lt;code&gt;setq&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10957" LastActivityDate="2016-09-22T20:11:44.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27270" PostTypeId="2" ParentId="27268" CreationDate="2016-09-22T20:17:22.290" Score="0" Body="&lt;p&gt;The dinging is called ringing the bell. If the variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Beeping.html#index-ring_002dbell_002dfunction&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ring-bell-function&lt;/code&gt;&lt;/a&gt; is defined, it's called instead of the terminal-dependent method (which may either emit a sound or flash the screen). So you'd set this variable, rather than advising a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to get information about the error, you can piggyback on the debugger trigger mechanism. Set &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html#index-debug_002don_002derror&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;debug-on-error&lt;/code&gt;&lt;/a&gt; to &lt;code&gt;t&lt;/code&gt; (and possibly tune other variables mentioned in the same section of the manual to make sure that the debugger is entered in the circumstances you want) and set the variable &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Internals-of-Debugger.html#index-debugger&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;debugger&lt;/code&gt;&lt;/a&gt; to your function. The default function is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Invoking-the-Debugger.html#index-debug&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;debug&lt;/code&gt;&lt;/a&gt; if you want to call it from yours.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-09-22T20:17:22.290" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27271" PostTypeId="1" AcceptedAnswerId="27272" CreationDate="2016-09-22T21:42:18.300" Score="6" ViewCount="1863" Body="&lt;p&gt;&lt;code&gt;git status&lt;/code&gt; in my configuration is extremely slow at enumerating untracked files, for reasons not relevant here. I'd like to have Magit use the &lt;code&gt;-uno&lt;/code&gt; argument in most cases, in order to avoid a long delay every time I refresh the buffer, but also have the option of doing a full status (including untracked files) at will.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not seeing a way to make this happen without modifying or advising Magit's code and mode map; there doesn't seem either to be an &quot;ignore untracked files&quot; option, or an option to add arbitrary command arguments to the &lt;code&gt;git status&lt;/code&gt; invocation. Have I missed something, or do I have some hacking to do?&lt;/p&gt;&#xA;" OwnerUserId="2162" LastEditorUserId="2162" LastEditDate="2016-09-29T19:26:31.997" LastActivityDate="2018-08-30T11:37:42.340" Title="How do I toggle Magit enumerating untracked files?" Tags="|magit|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27272" PostTypeId="2" ParentId="27271" CreationDate="2016-09-22T22:16:12.703" Score="10" Body="&lt;p&gt;The default value of the Git variable &lt;code&gt;status.showUntrackedFiles&lt;/code&gt; is &lt;code&gt;normal&lt;/code&gt;. In that case both &lt;code&gt;git status&lt;/code&gt; and &lt;code&gt;magit-status&lt;/code&gt; only lists directories containing untracked files (and untracked files at the top-level).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you set it to &lt;code&gt;all&lt;/code&gt;, then &lt;code&gt;git status&lt;/code&gt; lists all individual untracked files, but it &lt;em&gt;appears&lt;/em&gt; as if &lt;code&gt;magit-status&lt;/code&gt; isn't affected. However it is now possible to expand such a directory section.  &lt;kbd&gt;TAB&lt;/kbd&gt; on &lt;code&gt;foo/&lt;/code&gt; in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Untracked files (1)&#xA;foo/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Untracked files (1)&#xA;foo/&#xA;foo/a&#xA;foo/b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;(1)&lt;/code&gt; is a bit unfortunate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the value is &lt;code&gt;all&lt;/code&gt; and until &lt;code&gt;foo/&lt;/code&gt; is expanded, Magit actually pretends the value is &lt;code&gt;normal&lt;/code&gt;. I have updated the documentation accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason Magit does it this way, is that &lt;code&gt;all&lt;/code&gt; can be very costly and we cannot assume that users realize that setting this variable also affects Magit.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-09-29T23:01:28.027" LastActivityDate="2016-09-29T23:01:28.027" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27274" PostTypeId="2" ParentId="27254" CreationDate="2016-09-23T04:14:59.867" Score="2" Body="&lt;p&gt;Yes. I met this problem before. Here, I recommend you to install a package named &lt;code&gt;google-c-style&lt;/code&gt;. After finishing this, the only thing you should do is&#xA;that put config below into your own init-file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'google-c-style)&#xA;(defun my-c-mode-hook ()&#xA;  (google-set-c-style)&#xA;  (setq c-basic-offset 4 &#xA;        indent-tabs-mode t &#xA;        default-tab-width 4))&#xA;(add-hook 'c-mode-hook 'my-c-mode-hook)&#xA;(add-hook 'c++-mode-hook 'my-c-mode-hook)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's my own config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, I'm new for emacs two. It's so difficult to find a question that I can help. Thanks for your question!&lt;/p&gt;&#xA;" OwnerUserId="13259" LastEditorUserId="13259" LastEditDate="2016-09-23T05:51:54.730" LastActivityDate="2016-09-23T05:51:54.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27277" PostTypeId="1" CreationDate="2016-09-23T10:14:48.890" Score="1" ViewCount="109" Body="&lt;p&gt;I've recently upgraded to Emacs 25.1.1 and have found that it's, understandably, broken a very useful package to me: &lt;a href=&quot;https://github.com/JonWaltman/pcmpl-args.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;pcmpl-args.el&lt;/a&gt;. I say &quot;understandably&quot; because the package hasn't been developed since 2012 and its developer doesn't seem to be very talkative. Now, mind you, the package isn't completely broken; it (seemingly) works fine for the most part, but some particular functionality from it is broken now for no apparent reason, even after I re-compiled the whole &lt;code&gt;elpa&lt;/code&gt; directory as per &lt;a href=&quot;https://stackoverflow.com/a/24735377/2636454&quot;&gt;this answer&lt;/a&gt;. So, I have confirmed that the problem must have something to do with the upgrade to 25.1.1 and I also know which function the problem seems to originate from, but this function is rather monolithic and convoluted. Finding out which exact part(s) is broken (due to some unknown compatibility issues) will be a tricky and time-consuming process, to say the least.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only see two ways out of this problem (which don't involve wading through the code and deciphering what went wrong):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Downgrade back to my previous version which doesn't bork the package (which was a somewhat old build of Emacs 25 back from February 2016)... this is my current solution.&lt;/li&gt;&#xA;&lt;li&gt;Figure out how to run Emacs in some sort of &quot;compatibility mode&quot;, i.e., I'd like to be able to change Emacs versions at runtime for this package to work properly.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there any way to accomplish this second option so that I can seamlessly use my package with minimal hassle? Or is there perhaps a better solution to this problem that I'm not aware of?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a followup question to this question which explores the possibility of fixing pcmpl-args for Emacs 25.1.1: &lt;a href=&quot;https://emacs.stackexchange.com/q/27290/10761&quot;&gt;Can&amp;#39;t parse the output of manpages in pcmpl-args.el in Emacs 25.1.1&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I managed to find a fix to my issue with pcmpl-args in 25.1.1. Check out &lt;a href=&quot;https://emacs.stackexchange.com/a/27346/10761&quot;&gt;my answer&lt;/a&gt; if you're curious about it.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-09-26T05:03:35.047" Title="A way to change Emacs versions at runtime (or some other way to fix an outdated package)" Tags="|completion|version-compatibilty|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27278" PostTypeId="1" AcceptedAnswerId="27284" CreationDate="2016-09-23T11:19:09.910" Score="15" ViewCount="4314" Body="&lt;p&gt;There are (in my mind) two types of word wrapping:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hard : Actually edit the file to have lines of a maximum length&lt;/li&gt;&#xA;&lt;li&gt;Soft : Just wrap in the editor, but the underlying file still has long lines.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I can't figure out how to make Emacs do these two different types of word wrapping (most people just talk about &quot;word wrap&quot;, without distinguishing which they are talking about).&lt;/p&gt;&#xA;" OwnerUserId="13406" LastActivityDate="2020-02-08T18:11:08.153" Title="Soft vs Hard word wrap in Emacs" Tags="|wrapping|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27279" PostTypeId="2" ParentId="27277" CreationDate="2016-09-23T12:03:49.547" Score="1" Body="&lt;p&gt;Install Emacs 24.5 in your $HOME. Multiple versions of Emacs can co-exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run below command line in shell,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --prefix=$HOME/myemacs/24.4 --without-x-toolkit --without-x --without-xpm --without-png --without-gif --without-tiff --without-jpeg --without-rsvg --without-xft --without-xaw3d --without-xim --without-xpm --without-dbus --without-makeinfo --with-x-toolkit=no --without-sound --without-sync-input --without-pop;make;make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-09-23T12:03:49.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27281" PostTypeId="1" CreationDate="2016-09-23T13:40:31.470" Score="1" ViewCount="236" Body="&lt;p&gt;I have added the following option in my &lt;code&gt;~/.emacs&lt;/code&gt; file so that it uses the Fortran 2008 standard when checking syntax using Flycheck (as suggested in &lt;a href=&quot;http://www.flycheck.org/en/latest/_downloads/flycheck.html#Fortran&quot; rel=&quot;nofollow&quot;&gt;http://www.flycheck.org/en/latest/_downloads/flycheck.html#Fortran&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-gfortran-language-standard 2008)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I load emacs, I get the following error messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/wadud/.emacs':&#xA;Symbol's function definition is void: flycheck-gfortran-language-standard&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I fix this?&lt;/p&gt;&#xA;" OwnerUserId="13408" LastEditorUserId="253" LastEditDate="2016-09-23T14:24:31.060" LastActivityDate="2018-03-13T12:16:14.527" Title="flycheck-gfortran-language-standard option" Tags="|flycheck|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27282" PostTypeId="2" ParentId="27281" CreationDate="2016-09-23T14:22:56.810" Score="1" Body="&lt;p&gt;Maybe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq flycheck-gfortran-language-standard 2008)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-09-23T14:22:56.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27284" PostTypeId="2" ParentId="27278" CreationDate="2016-09-23T16:11:29.867" Score="22" Body="&lt;p&gt;Emacs uses &lt;code&gt;visual-line-mode&lt;/code&gt; for the soft-wrap and &lt;code&gt;auto-fill-mode&lt;/code&gt; (and/or &lt;code&gt;refill-mode&lt;/code&gt;) for the hard-wrap. See &lt;a href=&quot;https://emacs.stackexchange.com/a/47587/19069&quot;&gt;What is the difference between refill-mode and auto-fill-mode?&lt;/a&gt; for the difference between the two.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="19069" LastEditDate="2020-02-08T18:11:08.153" LastActivityDate="2020-02-08T18:11:08.153" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27285" PostTypeId="1" CreationDate="2016-09-23T16:39:10.103" Score="0" ViewCount="1088" Body="&lt;p&gt;I've been doing a lot of python coding. I often find myself checking my code by&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;saving my file&lt;/li&gt;&#xA;&lt;li&gt;opening a terminal&lt;/li&gt;&#xA;&lt;li&gt;issuing &lt;code&gt;$ pep8 my_file.py&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;issuing &lt;code&gt;$ pyflakes my_file.py&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It would be cool if I could maybe bind &lt;code&gt;$ pep8 my_current_script.py&lt;/code&gt; and &lt;code&gt;$ pyflakes my_current_script.py&lt;/code&gt; to a key combination and have the results pop up in a new buffer. Is this possible in emacs?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-09-23T19:08:42.087" Title="Can tools like pep8 and pyflakes be called from within emacs?" Tags="|python|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27286" PostTypeId="1" CreationDate="2016-09-23T17:40:42.013" Score="1" ViewCount="38" Body="&lt;p&gt;Polymode creates a distinct buffer for each mode involved.&#xA;Some use really inconvenient names, where the mode part of the name is easily longer than the actual document name itself, e.g. &lt;code&gt;foo.Rmd[poly-head-tail]&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible, if not eliminate the &lt;code&gt;[]&lt;/code&gt; part of the buffer name, at least customise it. &lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-09-23T17:40:42.013" Title="Polymode: customise buffer names" Tags="|polymode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27288" PostTypeId="2" ParentId="27285" CreationDate="2016-09-23T19:08:42.087" Score="1" Body="&#xA;&#xA;&lt;p&gt;Nearly anything is possible in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install the package &lt;a href=&quot;https://github.com/flycheck/flycheck&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;flycheck&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;flake8&lt;/code&gt; is the default checker, but you can choose others, such as &lt;code&gt;pylint&lt;/code&gt; or &lt;a href=&quot;https://github.com/Wilfred/flycheck-pyflakes&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;pyflakes&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All you need to do is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add MELPA putting putting this in your &lt;code&gt;.emacs&lt;/code&gt; or evaluating it with &lt;code&gt;M-:&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Install &lt;code&gt;flycheck&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;M-x package-install RET flycheck RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Activate it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;M-x flycheck-mode RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use this configuration in my &lt;code&gt;.emacs&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;(require 'flycheck)&#xA;(add-hook 'after-init-hook #'global-flycheck-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="654" LastActivityDate="2016-09-23T19:08:42.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27289" PostTypeId="1" CreationDate="2016-09-23T19:55:16.537" Score="2" ViewCount="1963" Body="&lt;p&gt;This is probably pretty simple, but for some reason I can't seem to get this to work.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a block agenda that should list all the headlines with &lt;code&gt;NEXT&lt;/code&gt; as well as &lt;code&gt;DONE&lt;/code&gt; and &lt;code&gt;DROPPED&lt;/code&gt; todo states. I want one block to show Done and Dropped, and another one to show NEXT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have this in &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;n&quot; &quot;Next&quot;&#xA;  ((tags-todo &quot;/+DONE|+DROPPED&quot; ((org-agenda-overriding-header &quot;Done/Dropped:&quot;)))&#xA;  (todo &quot;NEXT&quot; ((org-agenda-overriding-header &quot;Next:&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;NEXT&lt;/code&gt; block works, but the &quot;Done/Dropped&quot; block is blank. When I use this match syntax in the Agenda's actual match/search (&lt;code&gt;C-c a m&lt;/code&gt;), it works, but for some reason it doesn't work in custom commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps some of the characters need to be escaped? I've tried various combinations of escaping with &lt;code&gt;\&lt;/code&gt;, but no success so far.&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2017-03-05T23:55:13.773" Title="Org Agenda - Matching multiple TODO keywords in custom commands" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27290" PostTypeId="1" AcceptedAnswerId="27346" CreationDate="2016-09-23T19:55:18.793" Score="2" ViewCount="165" Body="&lt;p&gt;This is a followup to &lt;a href=&quot;https://emacs.stackexchange.com/q/27277/10761&quot;&gt;this question&lt;/a&gt;, as I originally was uncertain as to how to make this question into a suitable format for this site. So, I'm a user of &lt;a href=&quot;https://github.com/JonWaltman/pcmpl-args.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;pcmpl-args.el&lt;/a&gt;, which is an Emacs package that allows for more sophisticated completion of shell commands in environments like &lt;code&gt;M-x shell&lt;/code&gt;, &lt;code&gt;M-x eshell&lt;/code&gt;, &lt;code&gt;M-!&lt;/code&gt;, etc. It achieves this by creating &quot;argspecs&quot; by parsing commands' manpages or the output of &lt;code&gt;&amp;lt;command&amp;gt; --help&lt;/code&gt; invocations. However, after having upgraded to Emacs 25.1.1, I've noticed that pcmpl-args is no longer completing commands that are completed via manpage parsing. The really weird thing about it is that it does complete commands which are completed via &lt;code&gt;&amp;lt;command&amp;gt; --help&lt;/code&gt; parsing, and both of these types of parsing are handled by the same function. I can only conclude that the upgrade must have introduced some sort of compatibility issue since I've re-compiled my whole &lt;code&gt;elpa&lt;/code&gt; directory and this package hasn't been developed since 2012, so it's not far-fetched for it to be incompatible with 25.1.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the specific error that I get when I try to complete a command, such as &lt;code&gt;rm&lt;/code&gt; (which uses manpage parsing to create its argspecs), is &lt;code&gt;No completions of -&lt;/code&gt; in the minibuffer (since I tried to complete &lt;code&gt;rm&lt;/code&gt; options via tab completion of &lt;code&gt;$ rm -&lt;/code&gt;). When I take a look at &lt;code&gt;pcomplete/rm&lt;/code&gt;, I see that it's an alias to &lt;code&gt;pcmpl-args-pcomplete-on-man&lt;/code&gt;. &lt;code&gt;pcmpl-args-pcomplete-on-man&lt;/code&gt; is mainly just a wrapper to the &lt;code&gt;pcmpl-args-extract-argspecs-from-manpage&lt;/code&gt; function, which (as the name suggests) extracts argspecs from manpages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pcmpl-args-extract-argspecs-from-manpage (name &amp;amp;rest args)&#xA;  &quot;Return a list of argspecs by parsing the manpage identified by NAME.&#xA;ARGS are passed to `pcmpl-args-parse-help-buffer'.&quot;&#xA;  (ignore-errors (kill-buffer &quot; *pcmpl-args-output*&quot;))&#xA;  (with-current-buffer (get-buffer-create &quot; *pcmpl-args-output*&quot;)&#xA;    (erase-buffer)&#xA;    (funcall pcmpl-args-man-function name)&#xA;    (goto-char (point-min))&#xA;    (apply 'pcmpl-args-extract-argspecs-from-buffer args)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, it uses two principal functions to do this. The first is &lt;code&gt;pcmpl-args-default-man-function&lt;/code&gt;, which invokes &lt;code&gt;man&lt;/code&gt; to output manpages in a particular way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pcmpl-args-default-man-function (name)&#xA;  (let ((process-environment process-environment))&#xA;    ;; Setting MANWIDTH to a high number makes most paragraphs fit on a single&#xA;    ;; line, reducing the number of false positives that result from lines&#xA;    ;; starting with `-' that aren't really options.&#xA;    (push &quot;MANWIDTH=10000&quot; process-environment)&#xA;    (pcmpl-args-process-file &quot;man&quot; &quot;--nj&quot; &quot;--nh&quot; &quot;--&quot; name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note for OS X users: pcmpl-args is expecting to deal with &lt;a href=&quot;http://www.nongnu.org/man-db/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;man-db&lt;/code&gt;&lt;/a&gt;, which is a &lt;code&gt;man&lt;/code&gt; library that is commonly used on Linux. So, you'll need to compile &lt;code&gt;man-db&lt;/code&gt; by hand in order to get it working on OS X since I haven't found it in package managers such as &lt;code&gt;brew&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ./configure CC=&quot;gcc -arch x86_64&quot; &amp;amp;&amp;amp; sudo make CFLAGS=&quot;-Wl,-flat_namespace,-undefined,suppress&quot; &amp;amp;&amp;amp; sudo make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had to use the above command to get &lt;code&gt;man-db&lt;/code&gt; as well as one of its dependencies, &lt;a href=&quot;http://libpipeline.nongnu.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;libpipeline&lt;/code&gt;&lt;/a&gt;, to compile. Also note that the usage of &lt;code&gt;sudo&lt;/code&gt; there can cause you to not be able to run &lt;code&gt;man&lt;/code&gt; without using &lt;code&gt;sudo&lt;/code&gt; because it writes all of &lt;code&gt;man-db&lt;/code&gt;'s files as &lt;code&gt;root&lt;/code&gt;, so you'll need to fix the permissions like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ find /usr/local -user root -exec sudo chown &amp;lt;your_username&amp;gt; {} \;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyway, the other function that &lt;code&gt;pcmpl-args-extract-argspecs-from-manpage&lt;/code&gt; uses, &lt;code&gt;pcmpl-args-extract-argspecs-from-buffer&lt;/code&gt;, is a wrapper to the real culprit here: &lt;code&gt;pcmpl-args-parse-help-buffer&lt;/code&gt;. This function performs the parsing of manpages and &lt;code&gt;&amp;lt;command&amp;gt; --help&lt;/code&gt; output in a special buffer called &lt;code&gt;*pcmpl-args-output*&lt;/code&gt;. Unfortunately, whenever this function is called with &lt;code&gt;*pcmpl-args-output*&lt;/code&gt; as the current buffer, it returns &lt;code&gt;nil&lt;/code&gt; for manpages. This is incorrect because it's supposed to return a list of cons cells / argspecs of the form &lt;code&gt;(OPTION . DESCRIPTION)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the source for this rather monolithic and somewhat convoluted function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pcmpl-args-parse-help-buffer (&amp;amp;rest keyword-args)&#xA;  &quot;Return a list of options found in the current buffer.&#xA;The current buffer should contain text describing option usage,&#xA;such as the output of command called with the `--help' option.&#xA;&#xA;Due to the variations in formatting, this function tries to&#xA;recognize and handle many different styles.  The best handled&#xA;style is the GNU long-option style.&#xA;&#xA;The following keyword arguments are recognized:&#xA;&#xA;:filters&#xA;    Function or a list of functions to call before parsing.&#xA;    May be used to modify the buffer contents.&#xA;&#xA;:start-regexp&#xA;    Regular expression indicating where to start parsing.&#xA;&#xA;:end-regexp&#xA;    Regular expression indicating where to stop parsing.&#xA;&#xA;If the variable `pcmpl-args-debug-parse-help' is non-nil, the&#xA;matched options will be highlighted.&#xA;&#xA;Returns a list of cons cells of the form:&#xA;&#xA;    \(OPTION . DESCRIPTION)&#xA;&quot;&#xA;  (when pcmpl-args-debug-parse-help&#xA;    (dolist (ov (append (car (overlay-lists))&#xA;                        (cdr (overlay-lists))))&#xA;      (delete-overlay ov)))&#xA;  (goto-char (point-min))&#xA;  (when (plist-get keyword-args :filters)&#xA;    (dolist (f (or (and (functionp (plist-get keyword-args :filters))&#xA;                        (list (plist-get keyword-args :filters)))&#xA;                   (plist-get keyword-args :filters)))&#xA;      (goto-char (point-min))&#xA;      (funcall f)))&#xA;  (goto-char (point-min))&#xA;  (save-restriction&#xA;    (when (or (plist-get keyword-args :start-regexp)&#xA;              (plist-get keyword-args :end-regexp))&#xA;      (when (plist-get keyword-args :start-regexp)&#xA;        (re-search-forward (plist-get keyword-args :start-regexp) nil t))&#xA;      (narrow-to-region&#xA;       (point)&#xA;       (or (save-excursion&#xA;             (and (plist-get keyword-args :end-regexp)&#xA;                  (re-search-forward (plist-get keyword-args :end-regexp) nil t)&#xA;                  (match-beginning 0)))&#xA;           (point-max))))&#xA;    (let* ((start-time (float-time))&#xA;           (rgx (concat &quot;^[ ]\\{1,60\\}&quot;&#xA;                        &quot;\\(&quot;&#xA;                        (concat &quot;\\(?:\\(?:\\(?:&quot;&#xA;                                &quot;-+[^- \n][^ \n]*&quot;         ;option&#xA;                                &quot;\\(?: [^- \n][^ \n]*\\)?&quot; ;optarg&#xA;                                &quot;\\)\\)&quot;                   ;&#xA;                                &quot;\\(?:[ ]\\{,60\\},\\|[ ]\\{1,60\\}or \\)[ ]\\{0,60\\}&quot; ;delimiter&#xA;                                &quot;\\)*&quot;)&#xA;                        &quot;\\(?:&quot;&#xA;                        &quot;\\(?:[ ]\\{,60\\}-+[^- \n][^ \n]*\\)+&quot; ;option&#xA;                        ;; &quot;\\&amp;gt;&quot;&#xA;                        (concat &quot;\\(&quot;&#xA;                                ;; optarg followed by description or newline&#xA;                                &quot;\\(?: [^- \n][^ \n]*\\($\\|[ ][ ]+\\)\\)&quot;&#xA;                                &quot;\\|&quot;&#xA;                                &quot;\\(?: &amp;lt;[^ \n]*&amp;gt;\\)+&quot; ;&amp;lt;optarg&amp;gt;...&#xA;                                &quot;\\|&quot;&#xA;                                &quot;\\(?: \\[[^ \n]*\\]\\)+&quot; ;[optarg]...&#xA;                                &quot;\\|&quot;&#xA;                                &quot;\\(?: [A-Z][-:_@A-Z0-9]+\\)&quot; ;OPTARG&#xA;                                &quot;\\|&quot;&#xA;                                &quot;\\(?: [a-zA-Z]=[^ \n]*\\)&quot; ;optarg=value&#xA;                                &quot;\\)&quot;)&#xA;                        &quot;?&quot;&#xA;                        &quot;\\)+\\)&quot;))&#xA;           opts&#xA;           opt doc&#xA;           opt-beg-pos opt-end-pos&#xA;           doc-beg-pos doc-end-pos&#xA;           doc-column)&#xA;      (while (let (case-fold-search)&#xA;               (re-search-forward rgx nil t))&#xA;        (skip-chars-forward &quot; &quot;)&#xA;        (setq opt-beg-pos (match-beginning 1)&#xA;              opt-end-pos (match-end 0)&#xA;              doc-beg-pos (point)&#xA;              doc-end-pos (line-end-position)&#xA;              doc-column (save-excursion&#xA;                           (goto-char doc-beg-pos)&#xA;                           (current-column))&#xA;              opt (replace-regexp-in-string&#xA;                   &quot; or &quot; &quot;, &quot;&#xA;                   (replace-regexp-in-string&#xA;                    &quot;[ \t\f\v\r\n]+&quot; &quot; &quot;&#xA;                    (buffer-substring-no-properties&#xA;                     opt-beg-pos opt-end-pos)))&#xA;              doc nil)&#xA;        ;; Look for a description which may span multiple lines.&#xA;        (if (eolp)&#xA;            ;; Description may start on the next line.&#xA;            (save-excursion&#xA;              (forward-line)&#xA;              (skip-chars-forward &quot; &quot;)&#xA;              (when (or (eolp) (bolp))&#xA;                (forward-line)&#xA;                (skip-chars-forward &quot; &quot;))&#xA;              (if (or (eolp) (bolp)&#xA;                      (&amp;lt;= (current-column)&#xA;                          (save-excursion&#xA;                            (goto-char opt-beg-pos)&#xA;                            (current-column))))&#xA;                  (setq doc-column nil)&#xA;                (setq doc-beg-pos (point)&#xA;                      doc-column (current-column))))&#xA;          ;; The description starts on the same line so be more discerning&#xA;          ;; about parsing the next line if it looks like an option.&#xA;          (save-excursion&#xA;            (forward-line)&#xA;            (skip-chars-forward &quot; &quot;)&#xA;            (if (or (eolp)&#xA;                    (bolp)&#xA;                    (and (looking-at &quot;-&quot;)&#xA;                         (&amp;lt; (current-column) doc-column)))&#xA;                (setq doc-column nil)&#xA;              (setq doc-column (min doc-column (current-column))))))&#xA;        (goto-char doc-beg-pos)&#xA;        ;; Parse indented text.&#xA;        (while (and doc-column&#xA;                    (not (eobp)))&#xA;          (setq doc-end-pos (line-end-position))&#xA;          (forward-line)&#xA;          (skip-chars-forward &quot; &quot;)&#xA;          (when (or (eolp)&#xA;                    (&amp;lt; (current-column) doc-column))&#xA;            (setq doc-column nil)))&#xA;        (goto-char doc-end-pos)&#xA;        ;; (save-excursion&#xA;        ;;   (goto-char doc-beg-pos)&#xA;        ;;   (setq doc-end-pos&#xA;        ;;         (min (+ (point) 300)&#xA;        ;;              (or (and (re-search-forward&#xA;        ;;                        &quot;\\=\\(.\\|\n\\)+?\\.\\([ ][ ]\\|[ ]*$\\)&quot;&#xA;        ;;                        doc-end-pos t)&#xA;        ;;                       (match-beginning 2))&#xA;        ;;                  doc-end-pos))))&#xA;        (setq doc (replace-regexp-in-string&#xA;                   &quot; *\n *&quot; &quot; &quot;&#xA;                   (pcmpl-args-strip&#xA;                    (buffer-substring-no-properties doc-beg-pos doc-end-pos))))&#xA;        (when pcmpl-args-debug-parse-help&#xA;          (pcmpl-args-debug &quot;Found option: %S  %S&quot; opt doc)&#xA;          (let ((ov (make-overlay opt-beg-pos opt-end-pos)))&#xA;            (overlay-put ov 'face '(:background &quot;light green&quot;)))&#xA;          (let ((ov (make-overlay doc-beg-pos doc-end-pos)))&#xA;            (overlay-put ov 'face '(:background &quot;pink&quot;))))&#xA;        (push (cons opt doc) opts))&#xA;      (setq opts (nreverse opts))&#xA;      ;; We assume that options without descriptions are probably aliases&#xA;      ;; so we assign them the subsequent option's description.&#xA;      (let ((lst opts) el)&#xA;        (while lst&#xA;          (setq el (pop lst))&#xA;          (when (and lst (string= &quot;&quot; (cdr el)))&#xA;            (setcdr el (dolist (p lst)&#xA;                         (when (not (string= &quot;&quot; (cdr p)))&#xA;                           (return (cdr p))))))))&#xA;      (when pcmpl-args-debug&#xA;        (pcmpl-args-debug &quot;Found %s options in %f seconds&quot;&#xA;                          (length opts) (- (float-time) start-time)))&#xA;      opts)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone see what could be causing the issue here with compatibility? For reference, &lt;a href=&quot;https://www.masteringemacs.org/article/whats-new-in-emacs-25-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;here's the (commentated) changelog for Emacs 25.1.1&lt;/a&gt;. You can also, of course, view the changelog via &lt;code&gt;C-h n&lt;/code&gt; in Emacs 25.1.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I forgot to mention that pcmpl-args malfunctions differently depending on whether it's in &lt;code&gt;M-x eshell&lt;/code&gt; or &lt;code&gt;M-x shell&lt;/code&gt;. In Eshell, it outputs &lt;code&gt;No completions of -&lt;/code&gt; for something like &lt;code&gt;rm&lt;/code&gt;; in &lt;code&gt;M-x shell&lt;/code&gt;, it outputs a list of filenames containing &lt;code&gt;-&lt;/code&gt;'s or whatever you tried to complete. In either case, this is obviously incorrect as it's supposed to output a list of options to that command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/54bjsd/pcmplargsel_compatibility_in_emacs_2511/d80ptbe&quot; rel=&quot;nofollow noreferrer&quot;&gt;a discussion on reddit&lt;/a&gt; that I had with someone, this issue appears to be platform-dependent. The person in question is unable to reproduce my issue, however, they are running on Ubuntu 16.04 while I'm running on OS X 10.11.6. Check out the discussion thread for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 3:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upon further inspection, I've found that the output of &lt;code&gt;man&lt;/code&gt; is different in different Emacs versions on my platform (OS X 10.11.6). I took the output of &lt;code&gt;*pcmpl-args-output*&lt;/code&gt; in both versions and &lt;code&gt;diff&lt;/code&gt;'d them. I found that the newer version of Emacs is using some special bytes for hyphens and other things to display the output of manpages, which makes a lot of sense now in terms of why that's breaking pcmpl-args. The regexps in &lt;code&gt;pcmpl-args-parse-help-buffer&lt;/code&gt; are failing in the new version because there are now some weird bytes in the output of &lt;code&gt;man&lt;/code&gt; that are causing the function to not recognize any options (because it's not seeing any normal hyphens). I'm going to look into this further since it's obviously specific to OS X and I'm guessing that there must be some way to disable this special output that is breaking &lt;code&gt;pcmpl-args-parse-help-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-03-15T02:18:48.857" Title="Can't parse the output of manpages in pcmpl-args.el in Emacs 25.1.1" Tags="|shell|completion|eshell|version-compatibilty|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27291" PostTypeId="1" AcceptedAnswerId="27292" CreationDate="2016-09-23T23:47:20.450" Score="2" ViewCount="2876" Body="&lt;p&gt;I would like to set the following keyboard shortcuts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Copy (selected text): &lt;code&gt;C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Cut (selected text): &lt;code&gt;C-x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Paste from clipboard: &lt;code&gt;C-v&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Debugger (GDB): &lt;code&gt;M-g&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now I realize that to do this I merely need the command for each of these, and add lines of the form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;shortcut&quot;) 'command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;~/.emacs&lt;/code&gt; file. The problem is that Googling emacs commands hasn't revealed the emacs commands for each of these. So all I need is the commands for each of these. &lt;/p&gt;&#xA;" OwnerUserId="11131" LastActivityDate="2016-09-23T23:55:48.210" Title="How to change keyboard shortcuts for copy, cut and paste and set keyboard shortcut for debugger (GDB)?" Tags="|commands|keyboard-macros|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27292" PostTypeId="2" ParentId="27291" CreationDate="2016-09-23T23:55:48.210" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;kill-ring-save&lt;/code&gt; for &lt;code&gt;C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;kill-region&lt;/code&gt; for &lt;code&gt;C-x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;yank&lt;/code&gt; for &lt;code&gt;C-v&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;gdb&lt;/code&gt; for &lt;code&gt;M-g&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You should also look into enabling &lt;code&gt;cua-mode&lt;/code&gt;, which ships with Emacs by default and allows usage of common keyboard shortcuts as expected with minimal setup. You can also use &lt;code&gt;C-h k&lt;/code&gt; to see what a keybinding does and &lt;code&gt;C-h f&lt;/code&gt; to see what a particular function does and what it's bound to currently.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastActivityDate="2016-09-23T23:55:48.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27293" PostTypeId="1" AcceptedAnswerId="27294" CreationDate="2016-09-23T23:57:28.847" Score="7" ViewCount="5288" Body="&lt;p&gt;Just unzipped and started using Emacs 25.1, hoping to get a browser running in emacs.  The instructions I found had me enter &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;M-x xwidget-webkit-browse-url&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I'm asked to complete a command like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://editing.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which I do with some random URL -- then I'm told that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Your emacs did not compile with xwidget support.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone give me some simple instructions to follow to fix this?  (hopefully this isn't too involved...)&lt;/p&gt;&#xA;" OwnerUserId="13415" LastEditorUserId="97" LastEditDate="2016-11-10T03:41:50.420" LastActivityDate="2017-02-28T00:01:17.583" Title="your emacs does not come with xwidget support... (Windows 10)" Tags="|microsoft-windows|display|web-browser|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27294" PostTypeId="2" ParentId="27293" CreationDate="2016-09-24T00:10:11.187" Score="9" Body="&lt;p&gt;I don't use Emacs on Windows, nor do I use xwidgets, but I do know that Emacs has to be compiled with xwidgets (since some of its stuff is written in C) for it to work. Taking a cursory look at the &lt;code&gt;configure&lt;/code&gt; options for Emacs, I see a particular option for compiling Emacs with xwidgets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--with-xwidgets         enable use of some gtk widgets in Emacs buffers&#xA;                          (requires gtk3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how you would compile Emacs like this on Windows, but my first guess would be to use Cygwin or something similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://tuhdo.github.io/setup-emacs-windows.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here's an article about compiling Emacs with Xwidgets support on Windows via Cygwin&lt;/a&gt;, courtesy of &lt;a href=&quot;https://emacs.stackexchange.com/users/13940/m-w&quot;&gt;M.W.&lt;/a&gt; I'll copy it here for convenience and to circumvent link rot:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Setup Emacs with PDF Tools and Xwidgets web browser on Windows&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Installation instructions:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Prerequisite&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Download &lt;code&gt;Cywing&lt;/code&gt; setup from &lt;a href=&quot;https://cygwin.com/install.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cygwin's Install page&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;If you want only the PDF reader, you can install the Emacs shipped by&#xA;Cygwin. However, if you also want the web browser, then you need to&#xA;compile your own Emacs 25 from source.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;With PDF reader&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://tuhdo.github.io/static/setup-emacs-windows/pdf_tools_windows_latex.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;DEMO&lt;/a&gt; (Notice how I press some text in PDF file and Latex buffer jumps to corresponding automatically).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, don’t use MELPA; you must install pdf-tools manually from this repository. Then, you need to install Cygwin. The following dependencies are needed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't plan to use Xwidget browser, just install Emacs from Cygwin:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;emacs-w32 (Editors category)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then install the tool chain for PDF Tools:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;make (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;gcc-core (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;gcc-g++ (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;autoconf (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;automake (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;perl (&lt;strong&gt;Perl&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then install Poppler development library:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;libpoppler-devel (&lt;strong&gt;Lib&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libpoppler-glib-devel (&lt;strong&gt;Lib&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Just type the dependency name above and click to choose. For example, enter libpoppler-devel into the search box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After all dependencies installed, clone &lt;code&gt;pdf-tools&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone https://github.com/politza/pdf-tools&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, go into pdf-tools directory and build it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;make&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the compilation is done, from your Cygwin Terminal, copy the file &lt;code&gt;server/epdfinfo.exe&lt;/code&gt; into &lt;code&gt;/usr/bin/&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cp server/epdfinfo.exe /usr/bin/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, also within &lt;strong&gt;Cygwin&lt;/strong&gt;, run &lt;strong&gt;emacs&lt;/strong&gt; command. Within Emacs, run the Emacs command:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x package-install-file&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select pdf-tools-${VERSION}.tar RET (the tar file is in your&#xA;repository).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally, run pdf-tools-install and enjoy. Here is the configuration&#xA;you can put in your init file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(pdf-tools-install)&#xA;(setq pdf-info-epdfinfo-program &quot;/usr/bin/epdfinfo.exe&quot;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;With Xwidgets browser&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://tuhdo.github.io/static/setup-emacs-windows/emacs_xwidgets_windows.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;DEMO&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Development libraries for building Emacs that supports Xwidgets:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;libgif-devel (&lt;strong&gt;Graphics&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libtiff-devel (&lt;strong&gt;Lib&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libjpeg-devel (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libxpm-devel (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libgnutls-devel (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libpng-devel (&lt;strong&gt;Devel&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libncurses-devel (&lt;strong&gt;Lib&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libgtk3-drivel (&lt;strong&gt;Lib&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;libwebkitgtk3.0-devel (&lt;strong&gt;Lib&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then, install X11 server for displaying Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;xorg-server (&lt;strong&gt;X11&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;li&gt;xinit (&lt;strong&gt;X11&lt;/strong&gt; category)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then, open Cygwin terminal and compile Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --with-xwidgets&#xA;make&#xA;make install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, set your display:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo &quot;export DISPLAY=:0.0&quot; &amp;gt;&amp;gt; .bash_profile&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, from your Start Menu, open the X server:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BaVHi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BaVHi.png&quot; alt=&quot;Xserver example&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, run your compiled Emacs 25 from Cygwin terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-02-28T00:01:17.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27295" PostTypeId="2" ParentId="26869" CreationDate="2016-09-24T03:18:13.280" Score="1" Body="&lt;p&gt;the following should work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ido)&#xA;(ido-mode)&#xA;(define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the problem was caused by ido not initialized. Need the &lt;code&gt;(ido-mode)&lt;/code&gt; line there.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-12-07T18:21:33.353" LastActivityDate="2016-12-07T18:21:33.353" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27296" PostTypeId="1" CreationDate="2016-09-24T05:40:08.630" Score="1" ViewCount="212" Body="&lt;p&gt;When I run &lt;code&gt;projectile-find-file&lt;/code&gt; in GUI (non-terminal) Emacs, the project directory is set to the directory I most recently &lt;code&gt;cd&lt;/code&gt;'d to in a terminal window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that I have a home directory not under version control, as well as two Git projects, &lt;code&gt;~/foo&lt;/code&gt; and &lt;code&gt;~/bar&lt;/code&gt;. If I do the following&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open a file in &lt;code&gt;~/foo&lt;/code&gt; in Emacs.&lt;/li&gt;&#xA;&lt;li&gt;Open a terminal window and run &lt;code&gt;cd ~/bar&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x projectile-find-file&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;it will show me the files in &lt;code&gt;~/bar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if I &lt;code&gt;cd&lt;/code&gt; to the home directory in iTerm, I get this message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;fatal: Not a git repository (or any of the parent directories): .git&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected behavior is that it would show the files in &lt;code&gt;~/foo&lt;/code&gt; regardless of what directory was most recently &lt;code&gt;cd&lt;/code&gt;'d into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run &lt;code&gt;projectile-project-info&lt;/code&gt;, it shows the correct project directory (e.g., &lt;code&gt;Project dir: /Users/pat/foo ## Project VCS: git ## Project type: emacs-cask&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know whether this is a bug or I configured something wrong. It used to work correctly. I'm using Emacs 25.1 and Projectile 20160921.902.&lt;/p&gt;&#xA;" OwnerUserId="2679" LastEditorUserId="2679" LastEditDate="2016-09-24T06:29:10.437" LastActivityDate="2017-01-23T08:35:19.943" Title="Why is the Projectile Git repository being set to the most recently cd'd directory?" Tags="|git|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27297" PostTypeId="1" AcceptedAnswerId="29932" CreationDate="2016-09-24T05:59:08.143" Score="7" ViewCount="1481" Body="&lt;p&gt;I have a chapter heading in a literate program, in which all source-code is tangled into a single file called &lt;code&gt;test.hs&lt;/code&gt;. It is irritating and error-prone to have to repeatedly type &#xA;the &lt;code&gt;:tangle code/src/test.hs&lt;/code&gt; for every new code block &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence I would like to use the properties drawer of that chapter to once and for all tell Emacs to tangle ALL source code it sees inside this subtree to go into the file &lt;code&gt;test.hs&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt at trying this did not work. How do I fix it? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ** New Chapter&#xA; :+PROPERTIES:&#xA; :tangle: code/src/test.hs   (This does not work!)&#xA; :END:&#xA;&#xA;  #+BEGIN_SRC haskell&#xA;    import qualified Data.Map as Map  &#xA;    main = print &quot;Hello World&quot;&#xA;  #+END_SRC&#xA;&#xA;  Here's the `add` function to add two numbers.     &#xA;&#xA;  #+BEGIN_SRC haskell &#xA;   add a b = a+b&#xA;  #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10896" LastActivityDate="2017-01-14T09:17:33.373" Title="How to tangle all the source code blocks inside a sub-tree using the properties drawer?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27298" PostTypeId="1" CreationDate="2016-09-24T11:07:28.257" Score="6" ViewCount="1489" Body="&lt;p&gt;I've just installed Emacs 25.1. My .emacs works well on Emacs 24.5. But now that I'm on Emacs 25.1, when I do M-x package-list-packages, Emacs modifies and write .emacs in the background with the following modifications in custom-set-variables and custom-set-faces :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; '(package-selected-packages&#xA;   (quote&#xA;    (yaml-mode w3m toml-mode thing-cmds slime-company rust-mode revive proc-net paredit monky minibuf-isearch markdown-mode magit list-processes+ imenu-list google-this ggtags expand-region emacs-cl elnode elisp-slime-nav company-c-headers common-lisp-snippets column-enforce-mode cl-generic cl-format aggressive-indent))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and that :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; '(default ((t (:height 110 :family &quot;Monospace&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I prevent Emacs doing this ?&lt;/p&gt;&#xA;" OwnerUserId="4105" LastActivityDate="2016-09-24T11:44:24.500" Title="Since Emacs 25.1, package-list-packages modifies and writes my .emacs" Tags="|init-file|package|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27300" PostTypeId="2" ParentId="27298" CreationDate="2016-09-24T11:44:24.500" Score="4" Body="&lt;p&gt;I've managed to prevent Emacs from modifying and writing my .emacs by setting the &lt;code&gt;package-selected-packages&lt;/code&gt; to my list of packages I want to have installed by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have this configuration now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives&#xA;         '(&quot;marmalade&quot; .&#xA;           &quot;https://marmalade-repo.org/packages/&quot;))&#xA;&#xA;(package-initialize)&#xA;&#xA;(setq package-selected-packages&#xA;      '(&#xA;    aggressive-indent&#xA;    column-enforce-mode&#xA;    common-lisp-snippets&#xA;    company&#xA;    company-c-headers&#xA;    elisp-slime-nav&#xA;    expand-region&#xA;    ggtags&#xA;    google-this&#xA;    imenu-list&#xA;    macrostep&#xA;    magit&#xA;    markdown-mode&#xA;    monky&#xA;    paredit&#xA;    slime&#xA;    slime-company&#xA;    yaml-mode&#xA;    yasnippet&#xA;    ))&#xA;&#xA;(defun install-packages ()&#xA;  &quot;Install all required packages.&quot;&#xA;  (interactive)&#xA;  (unless package-archive-contents&#xA;    (package-refresh-contents))&#xA;  (dolist (package package-selected-packages)&#xA;    (unless (package-installed-p package)&#xA;      (package-install package))))&#xA;&#xA;(install-packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4105" LastActivityDate="2016-09-24T11:44:24.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27301" PostTypeId="1" AcceptedAnswerId="27302" CreationDate="2016-09-24T11:50:11.890" Score="3" ViewCount="879" Body="&lt;p&gt;When a file (like .emacs for example) is modified in a Git repository, if I want to &lt;code&gt;git pull&lt;/code&gt; git refuses to do so because I have a modified file. Git proposes to remove the modification by doing &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git checkout -- .emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But how do you do that using Magit ? I have &lt;a href=&quot;https://git-scm.com/docs/git-checkout&quot; rel=&quot;nofollow&quot;&gt;seen&lt;/a&gt; that &lt;code&gt;--&lt;/code&gt; is the equivalent of &lt;code&gt;--ignore-skip-worktree-bits&lt;/code&gt; but I don't see this option in Magit.&lt;/p&gt;&#xA;" OwnerUserId="4105" LastActivityDate="2016-09-24T12:29:05.173" Title="How do you do &quot;git checkout -- .emacs&quot; using magit?" Tags="|magit|git|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27302" PostTypeId="2" ParentId="27301" CreationDate="2016-09-24T12:29:05.173" Score="6" Body="&lt;p&gt;Either stash the modifications with &lt;kbd&gt;z&lt;/kbd&gt; or kill the modifications with &lt;kbd&gt;k&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter, with point at &lt;code&gt;.emacs&lt;/code&gt;, is the equivalent of checking out the latest/unmodified revision of that file. You can also apply it to the entire list of modified files.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-09-24T12:29:05.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27307" PostTypeId="1" CreationDate="2016-09-24T15:31:57.570" Score="4" ViewCount="220" Body="&lt;p&gt;The documentation on backup file creation, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Copying.html#Backup-Copying&quot; rel=&quot;nofollow&quot;&gt;Copying vs. Renaming&lt;/a&gt;, makes it sound like copying is the more sensible choice.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;file owner and group remain unchanged&lt;/li&gt;&#xA;&lt;li&gt;hard links remain associated with the actual file rather than its backup&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Given that, why does the default behavior prefer renaming in most cases?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;backup-by-copying&lt;/code&gt; defaults to &lt;code&gt;nil&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;backup-by-copying-when-linked&lt;/code&gt; defaults to &lt;code&gt;nil&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;backup-by-copying-when-mismatch&lt;/code&gt; defaults to &lt;code&gt;t&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-09-24T15:31:57.570" Title="Why is renaming (rather than copying) the default way to create backup files?" Tags="|backup|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27308" PostTypeId="1" CreationDate="2016-09-24T15:57:03.077" Score="2" ViewCount="401" Body="&lt;p&gt;I'm using an overlay to display additional information next to Dired candidates, because modifying the Dired buffer directly prevents Dired from working properly. I'm displaying the text using a &lt;code&gt;propertize&lt;/code&gt;d string in the &lt;code&gt;before-string&lt;/code&gt; property of the overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've given the string a face. The problem is, it inherits properties from the underlying text when they are unspecified in the face. For example, let's say Dired is displaying a file with a strikethrough. If the overlay is placed at the start of that file, the overlay will display the &lt;code&gt;before-string&lt;/code&gt; with a strikethrough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code for creating a dummy overlay:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((current-overlay (make-overlay (point) (point)))&#xA;                  (info-string (propertize &quot;[dummy info]&quot;&#xA;                                            'face 'my-dired-numbers-face)))&#xA;              (overlay-put current-overlay 'before-string info-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The whole function is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defface my-dired-numbers-face&#xA;  '((t :inherit 'font-lock-keyword-face&#xA;       :weight bold :background nil :strike-through nil))&#xA;  &quot;The face used to display selection numbers to the user.&quot;)&#xA;&#xA;(defun my-dired-insert-numbers (&amp;amp;rest _)&#xA;  (if my-dired-number-overlays&#xA;      (mapc (lambda (overlay)&#xA;              (delete-overlay overlay))&#xA;            my-dired-number-overlays))&#xA;  (setq my-dired-number-overlays '())&#xA;  (save-excursion&#xA;    (let ((n 1)&#xA;          (old-point (point))&#xA;          (end-of-buffer 0))&#xA;      (goto-char 0)&#xA;      (while (= end-of-buffer 0)&#xA;        (if (dired-move-to-filename)&#xA;            (let ((current-overlay (make-overlay (point) (point)))&#xA;                  (number-string (propertize (my-dired-format-string (number-to-string n) 3)&#xA;                                             'face 'my-dired-numbers-face)))&#xA;              (overlay-put current-overlay 'after-string number-string)&#xA;              (setq n (1+ n))&#xA;              (push current-overlay my-dired-number-overlays)))&#xA;        (setq end-of-buffer (forward-line))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to override this behaviour? Can I get my &lt;code&gt;before-string&lt;/code&gt; to display without inheriting any properties?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I've managed to get around this problem by passing &lt;code&gt;default&lt;/code&gt; as the lowest-priority face to &lt;code&gt;propertize&lt;/code&gt;. This explicitly sets all undefined properties to those of the &lt;code&gt;default&lt;/code&gt; face (overriding the inherited properties). This is the relevant line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(number-string (propertize (my-dired-format-string &quot;[dummy string]&quot;&#xA;                            'face '(my-dired-numbers-face&#xA;                                    default)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems like a hacky solution though. Is there an intended way to do this?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2016-09-24T18:04:19.420" LastActivityDate="2016-09-24T18:04:19.420" Title="How can I stop an overlay from inheriting the properties of underlying text?" Tags="|faces|overlays|" AnswerCount="0" CommentCount="6" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27309" PostTypeId="1" AcceptedAnswerId="27878" CreationDate="2016-09-24T17:44:41.973" Score="4" ViewCount="500" Body="&lt;p&gt;I have an org-formatted file named &lt;code&gt;foo.org&lt;/code&gt; that consists only of headings (without&#xA;body).  Notice the absence of blank lines.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* one&#xA;** a&#xA;** b&#xA;* two&#xA;** c&#xA;* three&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to use capture templates to add a sub-headings (without body) under&#xA;the top-level headings &lt;code&gt;one&lt;/code&gt; or &lt;code&gt;two&lt;/code&gt; while preserving the original format.&#xA;To do this I have these templates&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;  (list&#xA;    '(&quot;f&quot; &quot;Foo&quot;)&#xA;    '(&quot;fo&quot; &quot;One&quot; entry&#xA;       (file+headline &quot;/tmp/foo.org&quot; &quot;one&quot;)&#xA;       &quot;** TODO %?&quot;&#xA;       :prepend t :unnarrowed t :jump-to-captured t)&#xA;    '(&quot;ft&quot; &quot;Two&quot; entry&#xA;       (file+headline &quot;/tmp/foo.org&quot; &quot;two&quot;)&#xA;       &quot;** TODO %?&quot;&#xA;       :prepend t :unnarrowed t :jump-to-captured t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is the templates automatically include a blank line after the&#xA;heading&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;**␣TODO␣&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I have to delete manually every time.  Is it possible to tell Emacs not to insert&#xA;a newline character after the heading?&lt;/p&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2017-01-15T14:07:49.173" Title="Capture template without body" Tags="|org-mode|org-capture|template|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27311" PostTypeId="1" AcceptedAnswerId="27316" CreationDate="2016-09-24T20:49:52.800" Score="0" ViewCount="61" Body="&lt;p&gt;I am trying to parse file permissions using string-match. My code is,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq fmode (nth 8 (file-attributes &quot;/Users/sk/a.js&quot;)))&#xA;(message &quot;file mode is as, - %s&quot; fmode)&#xA;(string-match &quot;^.\\(...\\)\\(...\\)\\(...\\)$&quot; fmode)&#xA;(message &quot;User permission -  %s&quot; (match-string 1))&#xA;(message &quot;Group permission - %s&quot; (match-string 2))&#xA;(message &quot;Others permission - %s&quot; (match-string 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It outputs,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file mode is as, - -rw-r--r--&#xA;User permission -  (se&#xA;Group permission - tq &#xA;Others permission - fmo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As one can see, instead of parsing the file mode string, &lt;code&gt;-rw-r--r--&lt;/code&gt;, &lt;code&gt;string-match&lt;/code&gt; parses the buffer contents from the beginning position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My case is very similar to the documented example &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Search.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, but i am clueless why it doesn't work?&lt;/p&gt;&#xA;" OwnerUserId="5383" LastActivityDate="2016-09-24T23:33:25.360" Title="string-match matches buffer contents, instead of argument string" Tags="|string|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27312" PostTypeId="1" CreationDate="2016-09-24T20:55:39.680" Score="2" ViewCount="785" Body="&lt;p&gt;My preferred font is &lt;code&gt;-*-fixed-*-*-*--14-*-*-*-*-*-*-*&lt;/code&gt; and it doesn't have &lt;code&gt;slant=italic&lt;/code&gt; variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like &lt;code&gt;-*-terminus-*-*-*-*-14-*-*-*-*-*-*-*&lt;/code&gt; font and under Debian there is special &lt;code&gt;xfonts-terminus-oblique&lt;/code&gt; package to provide italic font variation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to tell Emacs to use &lt;code&gt;terminus&lt;/code&gt; font for &lt;code&gt;italic&lt;/code&gt; &lt;code&gt;:slant&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't use &lt;code&gt;terminus&lt;/code&gt; as default because it misses some glyphs.&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2016-09-25T13:59:39.630" Title="Default font has no slant=italic but I want to show italic text" Tags="|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27313" PostTypeId="1" AcceptedAnswerId="28015" CreationDate="2016-09-24T21:57:35.283" Score="0" ViewCount="119" Body="&lt;p&gt;Consider the following content of a file called &lt;code&gt;image-tooltips.el&lt;/code&gt; which I source into my .emacs file via &lt;code&gt;load-file&lt;/code&gt;. Displaying the image tooltip works if I put a &lt;code&gt;;\includegraphics{myfile.jpg}&lt;/code&gt; into this file after executing &lt;code&gt;eval-buffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if I load a latex-file also including an &lt;code&gt;includegraphics&lt;/code&gt; stanza, it doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I turned flyspell mode off and also tried to but the following code between a &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA; '(lambda ()&#xA;&#xA;;;; code below&#xA;&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the content of &lt;code&gt;image-tooltips.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar image-tooltip-re (concat  &quot;\\\\includegraphics{\\(?1:.*\\.&quot;&#xA;                                 (regexp-opt '(&quot;png&quot; &quot;PNG&quot; &quot;JPG&quot; &quot;jpeg&quot;&#xA;                                               &quot;jpg&quot; &quot;JPEG&quot; &quot;eps&quot; &quot;EPS&quot; &quot;pdf&quot;))&#xA;                                 &quot;\\)}&quot;)&#xA; &quot;Regexp to match included images&quot;)&#xA;&#xA;&#xA;(defun image-tooltip (window object position)&#xA;  (save-excursion&#xA;    (goto-char position)&#xA;    (let (beg end imgfile img s)&#xA;      (while (not (looking-at image-tooltip-re))&#xA;        (forward-char -1))&#xA;      (setq imgfile (match-string-no-properties 1))&#xA;      (when (file-exists-p imgfile)&#xA;        (setq img (create-image (expand-file-name imgfile)&#xA;                                'imagemagick nil :width 800))&#xA;        (propertize &quot;Look in the minibuffer&quot;&#xA;                    'display img)))))&#xA;&#xA;&#xA;(font-lock-add-keywords&#xA; nil&#xA; `((,image-tooltip-re&#xA;    0 '(face font-lock-keyword-face&#xA;             help-echo image-tooltip))))&#xA;&#xA;(font-lock-fontify-buffer)&#xA;(setq x-gtk-use-system-tooltips nil)&#xA;&#xA;;\includegraphics{image.jpg};; works&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make this work automatically if I load a tex-file and also if &lt;code&gt;flyspell&lt;/code&gt; mode is enabled (the matched strings should be ignored by &lt;code&gt;flyspell&lt;/code&gt; and the image should show on mouseover instead). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code above is a slightly adapted version of &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/Displaying-image-overlays-on-image-filenames-in-Emacs/#sec-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;Displaying image overlays on image filenames in Emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; Same problem with the code from &lt;a href=&quot;https://emacs.stackexchange.com/a/27428/2323&quot;&gt;https://emacs.stackexchange.com/a/27428/2323&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt; Here is a minimal &lt;code&gt;.emacs&lt;/code&gt; file where I get the problem with John Kitchin's solution that it works only after explicitely reloading latex mode, i.e. load a &lt;code&gt;.tex&lt;/code&gt; file (where &lt;code&gt;latex-mode&lt;/code&gt; is loaded automatically) the it doesn't work but it works afer an &lt;code&gt;M-x latex-mode&lt;/code&gt;. Also if I add an &lt;code&gt;\includegraphics{image.jpg}&lt;/code&gt; line it sometimes doesn't recognize it, but after reloading latex mode it works. However it should recognize it without reloading &lt;code&gt;latex-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives &#xA;    '(&quot;marmalade&quot; .&#xA;      &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;&#xA;(setq package-archive-enable-alist '((&quot;melpa&quot; deft magit)))&#xA;&#xA;(package-initialize)&#xA;&#xA;(setq ispell-program-name &quot;hunspell&quot;)&#xA;(setq ispell-local-dictionary &quot;de_DE&quot;)&#xA;(setq ispell-local-dictionary-alist&#xA;      '((&quot;de_DE&quot; &quot;[[:alpha:]]&quot; &quot;[^[:alpha:]]&quot; &quot;[']&quot; nil nil nil utf-8)&#xA;    (&quot;en_US&quot; &quot;[[:alpha:]]&quot; &quot;[^[:alpha:]]&quot; &quot;[']&quot; nil nil nil utf-8)&#xA;    ))&#xA;&#xA;&#xA;&#xA;(add-hook 'LaTeX-mode-hook 'turn-on-flyspell)&#xA;(add-hook 'LaTeX-mode-hook 'flyspell-buffer)&#xA;&#xA;&#xA;&#xA;(setq x-gtk-use-system-tooltips nil)&#xA;&#xA;(defvar image-tooltip-re (concat  &quot;\\\\includegraphics{\\(?1:.*\\.&quot;&#xA;                  (regexp-opt '(&quot;png&quot; &quot;PNG&quot; &quot;JPG&quot; &quot;jpeg&quot;&#xA;                        &quot;jpg&quot; &quot;JPEG&quot; &quot;eps&quot; &quot;EPS&quot; &quot;pdf&quot;))&#xA;                  &quot;\\)}&quot;)&#xA;  &quot;Regexp to match included images&quot;)&#xA;&#xA;&#xA;(defun image-tooltip (window object position)&#xA;  (save-excursion&#xA;    (goto-char position)&#xA;    (let (beg end imgfile img s)&#xA;      (while (not (looking-at image-tooltip-re))&#xA;        (forward-char -1))&#xA;      (setq imgfile (match-string-no-properties 1))&#xA;      (if (file-exists-p imgfile)&#xA;      (progn&#xA;        (setq img (create-image (expand-file-name imgfile)&#xA;                    'imagemagick nil :width 800))&#xA;        (propertize &quot;Look in the minibuffer&quot;&#xA;            'display img))&#xA;    &quot;No file found&quot;))))&#xA;&#xA;(defun img-match (limit)&#xA;  &quot;Match bar in at the end of a word.&quot;&#xA;  (when (re-search-forward image-tooltip-re limit t)&#xA;    (flyspell-delete-region-overlays (match-beginning 1)&#xA;                     (match-end 1))&#xA;    t))&#xA;&#xA;(add-hook 'LaTeX-mode-hook&#xA;      (lambda ()&#xA;        (font-lock-add-keywords&#xA;         nil&#xA;         '((img-match 1 '(face font-lock-keyword-face&#xA;                   help-echo image-tooltip))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-10-31T10:05:19.080" Title="Image tooltips doesn't work in other buffers" Tags="|auctex|images|tooltip|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27314" PostTypeId="2" ParentId="26575" CreationDate="2016-09-24T22:38:41.030" Score="1" Body="&lt;p&gt;Check the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/VC-Mode-Line.html&quot; rel=&quot;nofollow&quot; title=&quot;manual&quot;&gt;manual&lt;/a&gt; about version control info in the mode line, specifically the part about &lt;code&gt;auto-revert-check-vc-info&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you set &lt;code&gt;auto-revert-check-vc-info&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, Auto Revert mode updates the version control status information every &lt;code&gt;auto-revert-interval&lt;/code&gt; seconds, even if the work file itself is unchanged. The resulting CPU usage depends on the version control system, but is usually not excessive.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You probably just want &lt;code&gt;(setq auto-revert-check-vc-info t)&lt;/code&gt; in your .emacs or something like that.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2016-09-24T22:38:41.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27315" PostTypeId="1" AcceptedAnswerId="27320" CreationDate="2016-09-24T23:04:11.083" Score="7" ViewCount="73" Body="&lt;p&gt;Long story short, there's a little library I like but I don't like any of the default keybindings.  E.g. it's a global minor mode and binds a function to &lt;code&gt;C-c C-s&lt;/code&gt;, but that shadows &lt;code&gt;org-schedule&lt;/code&gt; in my org and org-agenda buffers.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to keep the little library but get rid of all the bindings in the little library keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an early attempt to do this, I tried the following (after confirming that &lt;code&gt;little-library-mode-map&lt;/code&gt; is where the bindings live):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;little-library-mode&quot;&#xA;  (setq little-library-mode-map (make-sparse-keymap)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code &quot;succeeds&quot; (&lt;code&gt;C-h v little-library-mode-map RET&lt;/code&gt; shows that it's just &lt;code&gt;(keymap)&lt;/code&gt; now) but all the little library keybindings still &quot;work&quot; (&lt;code&gt;C-c C-s&lt;/code&gt; still does the little library function, including in org and org-agenda buffers).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found another way to solve my issue, but I'm really curious why this approach fails.  Emacs' keybindings still seem like black magic to me.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2019-04-08T14:40:15.733" Title="Why does this code fail to nullify all keybindings in a keymap?" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27316" PostTypeId="2" ParentId="27311" CreationDate="2016-09-24T23:33:25.360" Score="1" Body="&lt;p&gt;&lt;code&gt;string-match&lt;/code&gt; works fine but &lt;code&gt;match-string&lt;/code&gt; gets the group contents from the wrong object, namely the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You &lt;strong&gt;must&lt;/strong&gt; pass the original string to &lt;code&gt;match-string&lt;/code&gt; as second argument.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-09-24T23:33:25.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27320" PostTypeId="2" ParentId="27315" CreationDate="2016-09-25T06:30:06.697" Score="3" Body="&lt;p&gt;There are three important things in this story:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the minor mode keymap&lt;/li&gt;&#xA;&lt;li&gt;its name&lt;/li&gt;&#xA;&lt;li&gt;the sparse keymap you create&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Basically what you did is make the name point at the sparse keymap instead of the original, but it's too late: the minor mode uses the original.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2016-09-25T06:30:06.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27321" PostTypeId="2" ParentId="27296" CreationDate="2016-09-25T07:02:31.297" Score="2" Body="&lt;p&gt;This problem was caused by a conflict with the Oh My Zsh plugin &lt;a href=&quot;https://github.com/robbyrussell/oh-my-zsh/blob/57fcee0f1c520a7c5e3aa5e2bde974154cdaf0c3/plugins/last-working-dir/last-working-dir.plugin.zsh&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;last-working-dir&lt;/code&gt;&lt;/a&gt;. Every time you &lt;code&gt;cd&lt;/code&gt; to a directory, &lt;code&gt;last-working-dir&lt;/code&gt; saves the path to file. When you open a new terminal window, the plug-in sets the current directory to the value in this file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that Emacs runs every shell command as though it were in a new terminal window. You can see this effect by enabling &lt;code&gt;last-working-dir&lt;/code&gt; and running &lt;code&gt;(message (shell-command &quot;pwd&quot;))&lt;/code&gt;. If you edit the cache file used by &lt;code&gt;last-working-dir&lt;/code&gt; and re-run the previous command, it'll output the updated directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know of any way of fixing this other than disabling the &lt;code&gt;last-working-dir&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2679" LastActivityDate="2016-09-25T07:02:31.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27322" PostTypeId="1" CreationDate="2016-09-25T08:55:12.473" Score="5" ViewCount="1599" Body="&lt;p&gt;I've this table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;|H1    |H2    |H3    |&#xA;|------+------+------|&#xA;|text11|text12|text13|&#xA;|text21|text22|text23|&#xA;|...   |...   |...   |&#xA;|textN1|textN2|textN3|&#xA;|--------------------|&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and i want this list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;* text11&#xA;- H1: text11&#xA;- H2: text12&#xA;- H3: text13&#xA;&#xA;* text21&#xA;- H1: text21&#xA;- H2: text22&#xA;- H3: text23&#xA;&#xA;...&#xA;&#xA;* textN1&#xA;- H1: textN1&#xA;- H2: textN2&#xA;- H3: textN3&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I do that?&lt;/p&gt;&#xA;" OwnerUserId="11940" LastEditorUserId="253" LastEditDate="2016-09-25T19:42:31.087" LastActivityDate="2024-02-20T20:56:45.287" Title="How to convert org-table to list?" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27323" PostTypeId="2" ParentId="9974" CreationDate="2016-09-25T10:09:40.133" Score="2" Body="&lt;p&gt;I had a similar situation but couldn't find anything working out of the box. But since &lt;code&gt;org-time-stamp&lt;/code&gt; handles all kinds of formats, I figured the code was there. The function below will insert an org time stamp from a provided time string. I haven't tested it for all kinds of times, but for &lt;code&gt;&quot;15-03-12 Thu 16:49&quot;&lt;/code&gt; it will give &lt;code&gt;&quot;[2015-03-12 tor 16:49]&quot;&lt;/code&gt;. (&lt;code&gt;&quot;tor&quot;&lt;/code&gt; is Thursday in my locale).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this answer is not fully matching the question, since you don't have a way of providing the format string, but hopefully it will work out anyway. It should understand all formats that org-time-stamp handles.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jk-org-insert-time-stamp (time-string)&#xA;  (interactive &quot;sTime: &quot;)&#xA;  (let ((default-time (apply 'encode-time (decode-time))))&#xA;    (org-insert-time-stamp&#xA;     (apply 'encode-time (org-read-date-analyze time-string default-time default-time)) t t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2688" LastEditorUserId="2264" LastEditDate="2017-08-04T00:34:02.463" LastActivityDate="2017-08-04T00:34:02.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27325" PostTypeId="1" AcceptedAnswerId="27489" CreationDate="2016-09-25T13:26:55.680" Score="5" ViewCount="210" Body="&lt;p&gt;Let's say &lt;code&gt;abbrev&lt;/code&gt; expands &quot;com&quot; into &quot;commission&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that this expands &quot;google.com&quot; into &quot;google.commission&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to disable this expansion if &quot;com&quot; is preceded by a &quot;.&quot;?&lt;/p&gt;&#xA;" OwnerUserId="2728" LastActivityDate="2016-10-01T13:59:26.783" Title="Do not expand abbreviation if preceded by &quot;.&quot;" Tags="|abbrev|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27326" PostTypeId="1" AcceptedAnswerId="27336" CreationDate="2016-09-25T13:58:23.277" Score="5" ViewCount="6037" Body="&lt;p&gt;I use Emacs 25.1 on my Windows XP laptop both as a command-line app (on ConEmu terminal emulator with MSYS bash as the shell) and as the GUI Emacs. I mainly use Emacs to test and compile programs, so I frequently use Mono C# compiler (gmcs) and GCC. The path of gmcs is defined inside the Windows environment variable Path, so when I use gmcs in GUI Emacs, it works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the path of GCC (&lt;strong&gt;/c/MinGW/bin&lt;/strong&gt;) is defined inside &lt;strong&gt;~/.bashrc&lt;/strong&gt;   and if I try to use GCC in GUI Emacs, it doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start &lt;strong&gt;emacs -nw&lt;/strong&gt; from within ConEmu terminal and try to compile a C code using &lt;code&gt;M-x compile &amp;amp; gcc my-c-code.c -o my-c-code.exe&lt;/code&gt; there's no problem: Emacs recognizes the gcc command and does the compilation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to do the same thing in GUI Emacs it says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gcc my-c-code.c -o my-c-code.exe&#xA;/usr/bin/bash: gcc: command not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To introduce the GCC's path into Emacs's exec-path I've added these into .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (append exec-path '(&quot;C:/MinGW/bin&quot;)))&#xA;(setenv &quot;PATH&quot; (concat &quot;C:/MinGW/bin&quot;  (getenv &quot;PATH&quot;)))&#xA;(setq shell-file-name &quot;C:/msys32/usr/bin/bash.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but none of them helped. The last line helped only if I open a shell within GUI Emacs, but not at the &lt;strong&gt;M-x compile&lt;/strong&gt; stage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I define the path of GCC inside the .emacs file? Note that I might add the path of GCC in the Windows env variable Path, but I don't want to solve it that way, I'd like to solve it the Emacs way. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="2784" LastEditorUserId="2784" LastEditDate="2020-01-23T17:10:35.477" LastActivityDate="2020-01-23T17:10:35.477" Title="GUI Emacs sets the exec-path only from Windows environment variable but not from .emacs file" Tags="|microsoft-windows|path|gui-emacs|exec-path|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="27327" PostTypeId="2" ParentId="27312" CreationDate="2016-09-25T13:59:39.630" Score="1" Body="&lt;pre&gt;&lt;code&gt;(set-frame-font &quot;-*-terminus-*-*-*--14-*-*-*-c-*-*-*&quot;)&#xA;(setq-default line-spacing nil)&#xA;(set-fontset-font nil 'cyrillic &quot;-*-terminus-*-*-*--14-*-*-*-c-*-*-*&quot;)&#xA;(set-fontset-font nil 'greek &quot;-*-terminus-*-*-*--14-*-*-*-c-*-*-*&quot;)&#xA;(set-fontset-font nil nil &quot;-misc-fixed-*-*-*--13-*-*-*-*-*-*-*&quot;)&#xA;(set-fontset-font nil 'phonetic &quot;-misc-fixed-*-*-*--13-*-*-*-*-*-*-*&quot;)&#xA;(set-fontset-font nil 'symbol &quot;-misc-fixed-*-*-*--13-*-*-*-*-*-*-*&quot;)&#xA;;; MODIFIER LETTER is not present in terminus, this includes ˌːˈ characters.&#xA;(set-fontset-font nil '(#x02C0 . #x02FF) &quot;-misc-fixed-*-*-*--13-*-*-*-*-*-*-*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't understand why&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font nil nil &quot;-misc-fixed-*-*-*--13-*-*-*-*-*-*-*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is not in effect. So I should include&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-fontset-font nil '(#x02C0 . #x02FF) &quot;-misc-fixed-*-*-*--13-*-*-*-*-*-*-*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastActivityDate="2016-09-25T13:59:39.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27328" PostTypeId="1" AcceptedAnswerId="27329" CreationDate="2016-09-25T14:16:39.010" Score="1" ViewCount="113" Body="&lt;p&gt;M-x dired = defaults me to C:\emacs\bin/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C-x d = defaults me to C:\home\files\&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My init file is in C:\home\ and seems to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read the relevant manual sections several times, and I can't figure out what is going on here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want M-x dired to default me to C:\home\files\&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want anything to be going on in emacs\bin&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do this? &lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="13432" LastEditDate="2016-09-27T10:08:19.077" LastActivityDate="2016-09-27T10:08:19.077" Title="How do I control the directory that emacs starts in?" Tags="|init-file|dired|directory|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27329" PostTypeId="2" ParentId="27328" CreationDate="2016-09-25T14:54:06.157" Score="0" Body="&lt;p&gt;Create a Windows shortcut, then set the “Start in” field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To create a file shortcut:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hold Alt then drag that runemacs.exe icon to desktop.&lt;/li&gt;&#xA;&lt;li&gt;In the newly created alias icon, right click to open file properties. Then, in the “Start in” field, enter %home%.&lt;/li&gt;&#xA;&lt;li&gt;In the “Target” field, you can add your own init files. For example, here's mine: %home%\apps\emacs-24.1\bin\runemacs.exe -q --load=%home%\ErgoEmacs_dev\init.el --load=%home%.emacs. Here, i suppress loading init files by -q, but load ErgoEmacs init files, then load my personal init files.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Tested on Windows Vista. Solution probably similar in Windows 10.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-09-25T14:54:06.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27331" PostTypeId="1" AcceptedAnswerId="34833" CreationDate="2016-09-25T17:57:34.367" Score="14" ViewCount="1132" Body="&lt;p&gt;Is there a way to make Ediff highlight whitespace using a different color, the way it does for non-whitespace differences?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here are two regions with only whitespace differences:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RPiPR.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RPiPR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here are two regions with non-whitespace differences:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hL8xI.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hL8xI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The non-whitespace differences are highlighted with &lt;code&gt;ediff-fine-diff-*&lt;/code&gt; faces, while whitespace differences are not. I'd like some way to tell &lt;em&gt;what&lt;/em&gt; the whitespace differences are.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2016-09-25T19:59:52.043" LastActivityDate="2017-09-19T20:26:04.750" Title="Ediff: view whitespace differences" Tags="|ediff|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27332" PostTypeId="2" ParentId="27322" CreationDate="2016-09-25T18:19:13.197" Score="7" Body="&lt;p&gt;EDIT: Updated code because I had misunderstood what the headings should be, and to switch to &lt;code&gt;s-join&lt;/code&gt; because apparently @lap's version of Emacs doesn't have &lt;code&gt;string-join&lt;/code&gt; from &lt;code&gt;subr-x&lt;/code&gt; (&lt;code&gt;s-join&lt;/code&gt; and &lt;code&gt;string-join&lt;/code&gt; take their arguments in opposite order!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Last fix: OP is using an older version of Org Mode and the parsed table includes the symbol &lt;code&gt;hline&lt;/code&gt; to indicate the position of horizontal lines, so we &lt;code&gt;remq&lt;/code&gt; them away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can name the table and then use a &lt;code&gt;:var&lt;/code&gt; declaration in a source&#xA;block and Org Mode will parse the table for you!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: laps-table&#xA;|H1    |H2    |H3    |&#xA;|------+------+------|&#xA;|text11|text12|text13|&#xA;|text21|text22|text23|&#xA;|...   |...   |...   |&#xA;|textN1|textN2|textN3|&#xA;|--------------------|&#xA;&#xA;#+BEGIN_SRC emacs-lisp :var tbl=laps-table&#xA;  (require 's)&#xA;  (let ((headings (car tbl)))&#xA;    (s-join&#xA;     &quot;\n&quot;&#xA;     (mapcar&#xA;      (lambda (row)&#xA;        (concat&#xA;         (format &quot;* %s\n- &quot; (car row))&#xA;         (s-join&#xA;          &quot;\n- &quot;&#xA;          (cl-map 'list &#xA;                  (lambda (hd x) (concat hd &quot;: &quot; x))&#xA;                  headings row))))&#xA;      (remq 'hline (cdr tbl)))))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running the source block results in the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+begin_example&#xA;* text11&#xA;- H1: text11&#xA;- H2: text12&#xA;- H3: text13&#xA;* text21&#xA;- H1: text21&#xA;- H2: text22&#xA;- H3: text23&#xA;* ...&#xA;- H1: ...&#xA;- H2: ...&#xA;- H3: ...&#xA;* textN1&#xA;- H1: textN1&#xA;- H2: textN2&#xA;- H3: textN3&#xA;#+end_example&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2016-09-27T00:25:27.860" LastActivityDate="2016-09-27T00:25:27.860" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27333" PostTypeId="1" CreationDate="2016-09-25T19:01:05.927" Score="1" ViewCount="244" Body="&lt;p&gt;hi i'm new to emacs and i'm really amazed about the org-mode. But i have some problems with the tables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i want a nice looking table but i get always a strange format&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example: &#xA;&lt;a href=&quot;https://i.stack.imgur.com/DmPha.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DmPha.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But i want it like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/CWaMC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CWaMC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i have the configuration from &lt;a href=&quot;https://github.com/myTerminal/super-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/myTerminal/super-emacs&lt;/a&gt; &#xA;but it also doesn't work without this configuration (standard configuration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My system font on Arch Linux is Liberation Sans and Liberation Mono&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my Windows computer emacs org-mode tables work fine i have this problem only on my Arch Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope somebody can explain me what i have to change.&lt;/p&gt;&#xA;" OwnerUserId="13434" LastEditorUserId="14825" LastEditDate="2022-11-05T01:12:59.363" LastActivityDate="2022-11-05T01:12:59.363" Title="org-mode table layout" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27335" PostTypeId="1" AcceptedAnswerId="27337" CreationDate="2016-09-25T20:16:32.090" Score="5" ViewCount="130" Body="&lt;p&gt;I find it surprising that rings (from &lt;code&gt;make-ring&lt;/code&gt;) are sequences (satisfy &lt;code&gt;sequencep&lt;/code&gt;), but cannot be operated on by standard sequence functions (&lt;code&gt;length&lt;/code&gt;, &lt;code&gt;elt&lt;/code&gt;, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What, then, does being a &quot;sequence&quot; entail? The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequences-Arrays-Vectors.html#Sequences-Arrays-Vectors&quot; rel=&quot;nofollow&quot;&gt;Elisp manual&lt;/a&gt; says that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The “sequence” type is the union of two other Lisp types: lists and&#xA;  arrays.  In other words, any list is a sequence, and any array is a&#xA;  sequence.  The common property that all sequences have is that each is&#xA;  an ordered collection of elements.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The diagram in the manual does not include rings. Should rings really be considered sequences?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2016-09-25T21:56:07.697" LastActivityDate="2016-09-25T21:56:07.697" Title="Rings and sequences" Tags="|sequences|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27336" PostTypeId="2" ParentId="27326" CreationDate="2016-09-25T20:32:34.727" Score="10" Body="&#xA;&#xA;&lt;h2&gt;&lt;code&gt;PATH&lt;/code&gt; vs &lt;code&gt;exec-path&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;PATH&lt;/code&gt; environment variable lists directories for programs to find executable files (when executing a non-absolute filename).  The &lt;code&gt;exec-path&lt;/code&gt; Emacs variable lists directories for Emacs to find executable files (again, when executing a non-absolute filename).  The value of &lt;code&gt;exec-path&lt;/code&gt; takes its value from the environment variable &lt;code&gt;PATH&lt;/code&gt; when starting up (hence, &lt;code&gt;PATH&lt;/code&gt; does effectively tell Emacs where to find executables, just like all other programs).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;exec-path&lt;/code&gt; is for things run directly by Emacs&lt;/h3&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;on this &lt;a href=&quot;https://stackoverflow.com/questions/740836/compiling-c-programs-with-emacs-on-windows&quot;&gt;SO page&lt;/a&gt;, on the selected answer there are no semicolons.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That answer deals with modifying &lt;code&gt;shell-file-name&lt;/code&gt;, i.e., the shell that Emacs runs.  If you use a relative file-name for &lt;code&gt;shell-file-name&lt;/code&gt;, &lt;code&gt;exec-path&lt;/code&gt; will be consulted, hence there is no reason to worry about path separators.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;PATH&lt;/code&gt; is for everything else&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;compile-command&lt;/code&gt; is a shell command, i.e., Emacs runs a shell and then tells that shell to run &lt;code&gt;compile-command&lt;/code&gt;.  This shell inherits the &lt;code&gt;PATH&lt;/code&gt; environment variable from Emacs, but of course it doesn't see &lt;code&gt;exec-path&lt;/code&gt;.  Therefore, if you use a relative file-name in &lt;code&gt;compile-command&lt;/code&gt;, the &lt;code&gt;PATH&lt;/code&gt; environment variable will be consulted.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Filenames in &lt;code&gt;PATH&lt;/code&gt; must be (semi)colon separated&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;On most operating systems (i.e., all the ones that Emacs runs on), environment variables can only hold strings, so the list has to be encoded by separating the directory names with a special character.  On Windows this character is the semi-colon, on Unix-like systems it's a colon.  To write portable elisp, use the variable &lt;code&gt;path-separator&lt;/code&gt; which has the right character for the current system.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Hence the correct answer for this question is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setenv &quot;PATH&quot; (concat &quot;C:/MinGW/bin;&quot; (getenv &quot;PATH&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or to make things bit neater, and keep &lt;code&gt;exec-path&lt;/code&gt; and &lt;code&gt;PATH&lt;/code&gt; synchronized:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'exec-path &quot;C:/MinGW/bin&quot;)&#xA;(setenv &quot;PATH&quot; (mapconcat #'identity exec-path path-separator))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-09-25T20:32:34.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27337" PostTypeId="2" ParentId="27335" CreationDate="2016-09-25T21:32:29.730" Score="4" Body="&lt;p&gt;Predicate &lt;code&gt;sequencep&lt;/code&gt; returns non-nil if its argument is a list or an array, and in this case &quot;list&quot; includes a cons cell (a dotted pair).  &lt;code&gt;(sequencep '(a . b))&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo  (make-ring 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h v foo&lt;/code&gt; shows that &lt;code&gt;foo&lt;/code&gt; is &lt;code&gt;(0 0 . [nil nil nil])&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a ring is a sequence - because it is a cons, but a sequence is not necessarily a ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether &lt;code&gt;sequencep&lt;/code&gt; should behave this way in Emacs Lisp is a good question.  It does not correspond to what Common Lisp considers a sequence, for instance.  In Common Lisp only proper lists (with &lt;code&gt;nil&lt;/code&gt; as the last cdr) are sequences, not dotted lists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have function &lt;code&gt;ring-convert-sequence-to-ring&lt;/code&gt;, which returns a ring that corresponds to its sequence argument.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-25T21:51:00.093" LastActivityDate="2016-09-25T21:51:00.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27338" PostTypeId="1" AcceptedAnswerId="27340" CreationDate="2016-09-25T22:18:54.303" Score="1" ViewCount="190" Body="&lt;p&gt;What controls the print depth of lisp forms? For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(macroexpand '(defun foo () (let ((bar)) (+ 1 2))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias (quote foo) (function (lambda nil (let ... ...))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the &lt;code&gt;*Messages*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-04-11T19:17:41.750" Title="Lisp form print depth" Tags="|print|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27339" PostTypeId="1" CreationDate="2016-09-25T22:35:05.927" Score="12" ViewCount="13136" Body="&lt;p&gt;I just hit &lt;code&gt;SPC a u&lt;/code&gt; and it opened the undo-redo tree. Now I can't operate it.&lt;br&gt;&#xA;I go on the tree, press enter and nothing happen. I can't close it!&lt;br&gt;&#xA; Either &lt;code&gt;:q&lt;/code&gt; is unrecognized. How do I operate this ?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastEditorUserId="15747" LastEditDate="2017-05-30T08:23:08.440" LastActivityDate="2017-06-01T18:20:14.107" Title="How to operate the undo-redo tree in spacemacs?" Tags="|spacemacs|undo-tree-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27340" PostTypeId="2" ParentId="27338" CreationDate="2016-09-25T23:29:01.033" Score="0" Body="&lt;p&gt;Print length/depth for the echo area are in &lt;code&gt;eval-expression-print-length&lt;/code&gt; and &lt;code&gt;eval-expresssion-print-depth&lt;/code&gt; respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For general printing (e.g. &lt;code&gt;princ&lt;/code&gt;), the relevant variables are &lt;code&gt;print-length&lt;/code&gt; and &lt;code&gt;print-level&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2017-04-11T19:17:41.750" LastActivityDate="2017-04-11T19:17:41.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27341" PostTypeId="1" CreationDate="2016-09-26T00:24:51.503" Score="1" ViewCount="93" Body="&lt;p&gt;&lt;code&gt;(a b (c |d) e f)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-M-n&lt;/code&gt; works as I would expect, producing this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(a b (c d)| e f)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I break the line after the (c d) like so…&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(a b (c |d)&#xA;     e f)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same &lt;code&gt;C-M-n&lt;/code&gt; does absolutely nothing. Interestingly, the command works as expected if I insert an end of line space just after &lt;code&gt;(c d)&lt;/code&gt;. Given that the whole point of paredit is to edit syntax trees rather than text, I don't see how the insertion of a newline should have any impact on the behavior of paredit-forward-up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="13438" LastEditorUserId="105" LastEditDate="2016-09-26T01:33:00.127" LastActivityDate="2016-09-26T01:33:00.127" Title="paredit-forward-up won't cross line boundary" Tags="|evil|paredit|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27342" PostTypeId="1" CreationDate="2016-09-26T00:39:58.810" Score="2" ViewCount="208" Body="&lt;p&gt;For the most part, I'm really liking &lt;code&gt;shell-mode&lt;/code&gt;. I've configured it to read my &lt;code&gt;.history&lt;/code&gt; file and if I spawn a dired or open a file it uses the current directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;tcsh&lt;/code&gt; with the &lt;code&gt;set implicitcd&lt;/code&gt; flag set. This allows me to type a directory and cd to it automatically, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% cd&#xA;&amp;lt;home directory&amp;gt;&#xA;% /tmp&#xA;% pwd&#xA;/tmp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are two problems with the default &lt;code&gt;shell-mode&lt;/code&gt; configuration from my perspective (although they're fine for the default &lt;code&gt;sh&lt;/code&gt; or &lt;code&gt;csh&lt;/code&gt; settings).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) I can't tab-complete directories in the first position, only executables. I'd like to be able to tab-complete directories here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) If I change directory without using &lt;code&gt;cd&lt;/code&gt; emacs does not know to change the buffer's directory. I'd like to stat the first argument if there's only one argument and see if it's a directory and cd to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for (2), the documentation mentions something about &lt;code&gt;comint-input-filter-functions&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun comint-send-input (&amp;amp;optional no-newline artificial)&#xA;  &quot;Send input to process.&#xA;After the process output mark, sends all text from the process mark to&#xA;point as input to the process.  Before the process output mark, calls&#xA;value of variable `comint-get-old-input' to retrieve old input, copies&#xA;it to the process mark, and sends it.&#xA;&#xA;This command also sends and inserts a final newline, unless&#xA;NO-NEWLINE is non-nil.&#xA;&#xA;Any history reference may be expanded depending on the value of the variable&#xA;`comint-input-autoexpand'.  The list of function names contained in the value&#xA;of `comint-input-filter-functions' is called on the input before sending it.&#xA;The input is entered into the input history ring, if the value of variable&#xA;`comint-input-filter' returns non-nil when called on the input.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'm a little concerned that &lt;code&gt;comint-input-filter-functions&lt;/code&gt; may not be the appropriate place to parse input and determine if it constitutes changing directory because it's &lt;code&gt;nil&lt;/code&gt; by default and emacs does parse the command if it starts with &lt;code&gt;cd&lt;/code&gt; (but not &lt;code&gt;chdir&lt;/code&gt; oddly enough).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar comint-input-filter-functions '()&#xA;  &quot;Abnormal hook run before input is sent to the process.&#xA;These functions get one argument, a string containing the text to send.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8921" LastActivityDate="2019-02-19T22:37:53.573" Title="configure shell-mode to understand implicit cd" Tags="|shell-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27343" PostTypeId="2" ParentId="25034" CreationDate="2016-09-26T02:09:35.743" Score="0" Body="&lt;p&gt;I've written a package that does this! &lt;a href=&quot;https://github.com/Wilfred/refs.el&quot; rel=&quot;nofollow&quot;&gt;refs.el, semantic search for elisp&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-09-26T02:09:35.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27344" PostTypeId="2" ParentId="23909" CreationDate="2016-09-26T03:23:14.670" Score="0" Body="&lt;p&gt;In normal mode, you can simply type &quot;&gt;&quot; and then [RETURN] and the paragraph will have the indentation you want. &quot;&amp;lt;&quot; and then [RETURN] to put it back. You can also select the lines and then press &quot;&gt;&quot; (or &quot;&amp;lt;&quot;)&lt;/p&gt;&#xA;" OwnerUserId="4052" LastActivityDate="2016-09-26T03:23:14.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27346" PostTypeId="2" ParentId="27290" CreationDate="2016-09-26T05:01:11.290" Score="2" Body="&lt;p&gt;Well, the solution to this problem was a very simple one. The issue was that the encoding used for putting manpages (and maybe other things) into buffers in 25.1.1 was unsuitable for pcmpl-args because it used special characters for quotation marks, hyphens, etc. These special characters are used by default in &lt;code&gt;man-db&lt;/code&gt;, but older versions of Emacs forced buffers which contained manpages to not use said special characters and hence everything was in the standard (ASCII) format. However, 25.1.1 has (for whatever reason) allowed said special characters back into buffers which contain manpages, which broke the regexps that the pcmpl-args parser was using to detect options for argspecs. This, obviously, caused completion to break anywhere that was using &lt;code&gt;man&lt;/code&gt; for extracting argspecs, while completion functions using &lt;code&gt;&amp;lt;command&amp;gt; --help&lt;/code&gt; invocations did not suffer the same issue because I guess most commands make sure that they don't put any weird characters in their &lt;code&gt;--help&lt;/code&gt; output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;man-db&lt;/code&gt;, one can force the encoding via the &lt;code&gt;--encoding=&amp;lt;encoding&amp;gt;&lt;/code&gt; option. In my case, I need it to be ASCII so that all characters are standard and can be consumed by the pcmpl-args parser with no trouble. So, all that I had to do to fix this issue was put the following in one of my initialization files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ASCII encoding needs to be enforced for pcmpl-args to work properly&#xA;;; with newer versions of Emacs.&#xA;(setq pcmpl-args-man-function (lambda (name)&#xA;                                (let ((process-environment process-environment))&#xA;                                  ;; Setting MANWIDTH to a high number makes most paragraphs fit on a single&#xA;                                  ;; line, reducing the number of false positives that result from lines&#xA;                                  ;; starting with `-' that aren't really options.&#xA;                                  (push &quot;MANWIDTH=10000&quot; process-environment)&#xA;                                  (pcmpl-args-process-file &quot;man&quot; &quot;--nj&quot; &quot;--nh&quot; &quot;--encoding=ascii&quot; &quot;--&quot; name))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All that this does is set the &lt;code&gt;pcmpl-args-man-function&lt;/code&gt; variable to a function which handles the invocation of &lt;code&gt;man&lt;/code&gt;. This function is almost identical to &lt;code&gt;pcmpl-args-default-man-function&lt;/code&gt;, but with the slight modification of forcing the encoding of the &lt;code&gt;man&lt;/code&gt; output to ASCII with &lt;code&gt;&quot;--encoding=ascii&quot;&lt;/code&gt; in the argument list. Now, commands such as &lt;code&gt;rm&lt;/code&gt; et al. work again through tab completion and I don't have to revert to an older version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git&lt;/code&gt; sub-command option completion is still broken if one uses only the above code. I didn't realize this at the time of writing that, but completion for &lt;code&gt;git&lt;/code&gt; uses a special way to get argspecs from manpages by invoking &lt;code&gt;git help --man -- &amp;lt;command&amp;gt;&lt;/code&gt;. Since I've not found a way to pass arguments to this special type of &lt;code&gt;man&lt;/code&gt; invocation, I've found it easy enough to redefine &lt;code&gt;pcmpl-args-git-extract-argspecs-from-help&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; `pcmpl-args-git-extract-argspecs-from-help' normally uses `git help --man -- &amp;lt;command&amp;gt;'&#xA;;; to get manpages for git, but you can't pass arguments to `man' in this way,&#xA;;; which means that ASCII encoding can't be enforced (see above). So, we're going&#xA;;; to get argspecs for git via `pcmpl-args-extract-argspecs-from-manpage', which&#xA;;; will use `man &amp;lt;args&amp;gt; git-&amp;lt;command&amp;gt;' to get the manpage.&#xA;(defun pcmpl-args-git-extract-argspecs-from-help (cmd)&#xA;  (pcmpl-args-extract-argspecs-from-manpage (if (or (null cmd) (string= &quot;&quot; cmd))&#xA;                                                &quot;&quot;&#xA;                                              (concat &quot;git-&quot; cmd))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2017-03-15T02:18:48.857" LastActivityDate="2017-03-15T02:18:48.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27347" PostTypeId="2" ParentId="27342" CreationDate="2016-09-26T06:22:30.663" Score="2" Body="&lt;p&gt;For tab completion, I use company-mode:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-shell-mode-hook ()&#xA; (company-mode)&#xA; (define-key shell-mode-map (kbd &amp;quot;TAB&amp;quot;) #'company-manual-begin))&#xA;&#xA;(add-hook 'shell-mode-hook #'my-shell-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;see &lt;a href=&quot;http://wikemacs.org/wiki/Shell#Shell_completion_with_a_nice_menu_.C3.A0_la_zsh&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikemacs&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/36sHE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/36sHE.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&#xA;&lt;sub&gt;(source: &lt;a href=&quot;http://wikemacs.org/images/8/87/Emacs-shell-company.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikemacs.org&lt;/a&gt;)&lt;/sub&gt;&lt;/p&gt;&#xA;&lt;p&gt;For 2) I think we could advice the input method to transform its input beforehand.&lt;/p&gt;&#xA;&lt;p&gt;I myself don't write &amp;quot;cd&amp;quot; a lot any more, I mainly use shell-pop (see wiki) and if I must, I use &lt;a href=&quot;https://gitlab.com/emacs-stuff/fasd-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;my integration&lt;/a&gt; with the &lt;em&gt;fasd&lt;/em&gt; tool, so I don't have to write full paths, but just something like &lt;code&gt;d foo&lt;/code&gt; and it takes me to &lt;code&gt;~/projects/bla/foo&lt;/code&gt;, if I visited it already after installing fasd.&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2019-02-19T22:37:53.573" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27348" PostTypeId="2" ParentId="17700" CreationDate="2016-09-26T09:38:13.247" Score="13" Body="&lt;p&gt;With Emacs 25.1 you can pass options to &lt;code&gt;git blame&lt;/code&gt; using the &lt;code&gt;vc-git-annotate-switches&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq vc-git-annotate-switches '(&quot;-w&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9721" LastEditorUserId="675" LastEditDate="2017-01-12T19:51:24.410" LastActivityDate="2017-01-12T19:51:24.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27349" PostTypeId="1" CreationDate="2016-09-26T10:04:31.390" Score="3" ViewCount="470" Body="&lt;p&gt;I have a file that contains important information and I often have to make small changes in this file.  Every once in a while I accidentally change something in this file and then save it without noticing that something is missing.  What I'd like to have is that Emacs automatically shows me a diff between the buffer content and the content of the file on disk and asks me if I really want to save it.  Is there an existing solution for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;code&gt;highlight-changes-mode&lt;/code&gt; but that's not what I want.  I shows changes compared to when the mode was enabled not compared to the file on disk.  In large files, it is also difficult to spot the changes even when they are marked red with &lt;code&gt;highlight-changes-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2016-09-26T12:37:07.173" LastActivityDate="2016-09-26T15:19:58.983" Title="Automatically show diff before saving file" Tags="|saving|diff|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27350" PostTypeId="2" ParentId="9583" CreationDate="2016-09-26T10:36:20.410" Score="17" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/develop/doc/FAQ.org#include-underscores-in-word-motions&quot; rel=&quot;noreferrer&quot;&gt;spacemacs FAQ&lt;/a&gt; offers the following language-specific solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; For python&#xA;(add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ &quot;w&quot;)))&#xA;;; For ruby&#xA;(add-hook 'ruby-mode-hook #'(lambda () (modify-syntax-entry ?_ &quot;w&quot;)))&#xA;;; For Javascript&#xA;(add-hook 'js2-mode-hook #'(lambda () (modify-syntax-entry ?_ &quot;w&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It also works in regular emacs. With evil on, it works with all word-related commands (&lt;code&gt;w&lt;/code&gt;, &lt;code&gt;e&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;#&lt;/code&gt;, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, this will do it for all major modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-change-major-mode-hook&#xA;          (lambda ()&#xA;            (modify-syntax-entry ?_ &quot;w&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13287" LastEditorUserId="-1" LastEditDate="2019-07-03T15:01:35.407" LastActivityDate="2019-07-03T15:01:35.407" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="27352" PostTypeId="2" ParentId="27333" CreationDate="2016-09-26T11:31:42.667" Score="4" Body="&lt;p&gt;You're using a proportional font; switch to using a monospaced font and the columns will line up.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-26T11:31:42.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27354" PostTypeId="2" ParentId="27349" CreationDate="2016-09-26T12:27:47.857" Score="2" Body="&lt;p&gt;What about something like this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(defun my-diff ()&#xA;  (let ((temp-file (make-temp-file &quot;gpgdiff-&quot;))&#xA;    (contents (buffer-string))&#xA;    (current-file (buffer-file-name)))&#xA;    (with-temp-file temp-file&#xA;      (insert contents))&#xA;    (diff current-file temp-file))&#xA;&#xA;  (unless (y-or-n-p &quot;Save buffer?&quot;)&#xA;    (keyboard-quit)))&#xA;&#xA;(add-hook 'before-save-hook 'my-diff t t) &#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess you should probably put the last line in as a local variable, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# eval: (add-hook (quote before-save-hook) (quote my-diff) t t)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2016-09-26T15:19:58.983" LastActivityDate="2016-09-26T15:19:58.983" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27355" PostTypeId="1" AcceptedAnswerId="27360" CreationDate="2016-09-26T14:14:41.780" Score="2" ViewCount="168" Body="&lt;p&gt;I can't jump to every instance of a character, for instance consider this line : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;if( c == '\n' ||  c == ' ' || c == '\n') continue;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;code&gt;avy-shortcut SPACE&lt;/code&gt; to label all the white spaces will only allow me to jump at the spaces between the &lt;code&gt;c&lt;/code&gt; and the &lt;code&gt;=&lt;/code&gt;, all the other spaces after and before the &lt;code&gt;(, ), |&lt;/code&gt; are ignored. Any idea on how to fix this behavior ?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastActivityDate="2016-09-26T18:39:22.117" Title="Avy is not labelling every character I want to jump to" Tags="|avy|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27356" PostTypeId="1" AcceptedAnswerId="27357" CreationDate="2016-09-26T15:34:55.183" Score="4" ViewCount="1192" Body="&lt;p&gt;I often find that I need to define faces for custom commands. I prefer to inherit from faces defined by the current theme, to keep things visually consistent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x list-faces-display&lt;/code&gt; lists the faces, but it doesn't display a preview. It's just a list of face names and then the alphabet, formatted with the default &quot;link&quot; face. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for me to easily visualise what faces are defined by the current theme? Is there a way for me to easily visualise all currently defined faces across the board?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &lt;code&gt;M-x list-faces-display&lt;/code&gt; is not giving me a preview. Here is what it looks like with the &lt;code&gt;leuven&lt;/code&gt; theme:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dMC03.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dMC03.png&quot; alt=&quot;&amp;lt;code&amp;gt;list-faces-display&amp;lt;/code&amp;gt; under the Leuven theme&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is what it looks like with &lt;code&gt;zenburn&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rwxSR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rwxSR.png&quot; alt=&quot;&amp;lt;code&amp;gt;list-faces-display&amp;lt;/code&amp;gt; under the Zenburn theme&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I disable my init file, I can get previews working again. The previews do actually appear to be in the correct face, but they are displaying as buttons. Is there any reason having the &lt;code&gt;button&lt;/code&gt; property set to &lt;code&gt;t&lt;/code&gt; or being in the &lt;code&gt;help-face-button&lt;/code&gt; category would override the underlying face?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastEditorUserId="12892" LastEditDate="2016-09-26T17:04:49.747" LastActivityDate="2016-09-26T17:04:49.747" Title="Is there a way to easily see currently defined faces?" Tags="|faces|themes|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27357" PostTypeId="2" ParentId="27356" CreationDate="2016-09-26T15:46:12.573" Score="6" Body="&lt;p&gt;To see all faces currently defined: &lt;strong&gt;&lt;code&gt;M-x list-faces-display&lt;/code&gt;&lt;/strong&gt;.  It &lt;strong&gt;does&lt;/strong&gt; show a preview. It does &lt;strong&gt;not&lt;/strong&gt; show the samples using the &quot;&lt;em&gt;default 'link' face&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs manual, as usual, is your friend. &lt;code&gt;C-h r i face TAB&lt;/code&gt;, choose &lt;code&gt;faces&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That takes you to node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Faces.html&quot; rel=&quot;noreferrer&quot;&gt;Faces&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/FaceMenuPlus&quot; rel=&quot;noreferrer&quot;&gt;Facemenu+&lt;/a&gt; then &lt;code&gt;list-faces-display&lt;/code&gt; is enhanced a bit.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-09-26T15:52:23.207" LastActivityDate="2016-09-26T15:52:23.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27358" PostTypeId="1" AcceptedAnswerId="27366" CreationDate="2016-09-26T17:21:02.363" Score="0" ViewCount="205" Body="&lt;p&gt;&lt;code&gt;org-tag-alist&lt;/code&gt; will list tags exactly as they are defined in the .emacs or init file, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((:startgroup . nil) (&quot;@computer&quot; . ?c) (&quot;@phone&quot; . ?p) (&quot;@home&quot; . ?h) (:endgroup . nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a variable that &quot;cleans&quot; this format so that the tags are easily accessible as a list?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;@computer&quot; &quot;@phone&quot; &quot;@home&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is similar to how &lt;code&gt;org-done-keywords&lt;/code&gt; will parse (though it'll only take the done keywords) the much messier &lt;code&gt;org-todo-keywords&lt;/code&gt; (which is a list of sequences).&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-09-26T22:02:36.523" Title="Org-mode: Is there a variable for a tags list like org-done-keywords is there for done todo keywords?" Tags="|org-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27359" PostTypeId="1" AcceptedAnswerId="27362" CreationDate="2016-09-26T17:59:59.437" Score="2" ViewCount="188" Body="&lt;p&gt;I don't know if I'm using the command correctly or not.&lt;br&gt;&#xA;I select the region to be underlined and then pass the command &lt;code&gt;M-x underline-region&lt;/code&gt; and it doesn't work.&lt;br&gt;&#xA;For example   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if the text is &lt;code&gt;SAMPLE&lt;/code&gt; which I select and pass the command within Emacs, the output looks like this  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA; _^HS_^HA_^HM_^HP_^HL_^HE&#xA;&lt;/pre&gt;  &#xA;&#xA;&lt;p&gt;How should I be using this command? I found this command by co-incidence.&lt;br&gt;&#xA;When I searched on this topic, I found &lt;a href=&quot;https://github.com/jwiegley/emacs-release/blob/master/lisp/textmodes/underline.el&quot; rel=&quot;nofollow&quot;&gt;ul.el&lt;/a&gt;. I'm not good at elisp yet, so couldn't make any sense of the code.&lt;br&gt;&#xA;The comment in the code says:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;&quot;Underline all nonblank characters in the region.&#xA;Works by overstriking underscores.&#xA;Called from program, takes two arguments START and END&#xA;which specify the range to operate on.&quot;&#xA;&lt;/pre&gt;  &#xA;&#xA;&lt;p&gt;Which means that the output should look this SAMPLE (&lt;em&gt;with an underline below it - I'm unable to get it in Markdown&lt;/em&gt;)&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-09-26T18:56:57.237" Title="Why does M-x underline-region doesn't work?" Tags="|formatting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27360" PostTypeId="2" ParentId="27355" CreationDate="2016-09-26T18:11:47.247" Score="6" Body="&lt;p&gt;It looks like your avy shortcut is bound to &lt;code&gt;avy-goto-word-1&lt;/code&gt;, while what you want here is &lt;code&gt;avy-goto-char&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;code&gt;M-x avy-goto-char SPC&lt;/code&gt; and you will see that when word boundaries are ignored, all spaces are matched. On the other hand, &lt;code&gt;avy-goto-word-1&lt;/code&gt; is searching for a word boundary followed by a space. In your example text that happens to find the spaces following the word &quot;c&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll see the same behavior with &lt;code&gt;M-x search-forward-regexp RET \b SPC&lt;/code&gt; (ie search forward for the regular expression &lt;code&gt;\b&lt;/code&gt; followed by a space). In Emacs regular expressions, &lt;code&gt;\b&lt;/code&gt; matches the empty string at the beginning or end of word, where the current syntax table defines what characters are considered part of a word. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-09-26T18:39:22.117" LastActivityDate="2016-09-26T18:39:22.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27361" PostTypeId="1" AcceptedAnswerId="27372" CreationDate="2016-09-26T18:19:01.770" Score="0" ViewCount="121" Body="&lt;p&gt;I encounter many situations where I'd like to use &lt;code&gt;mc/mark-next-lines&lt;/code&gt; but I don't know how to change the number of cursors. When I do &lt;code&gt;C-u 2 mc/mark-next-lines&lt;/code&gt; I get 7 cursors instead of 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be neat if I could pass a two to this command to get 2 cursors. I don't see any sense in that bevhaviour.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-09-27T01:20:27.533" Title="how can I change the number of cursors using multiple cursors mc/mark-next-lines?" Tags="|multiple-cursors|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27362" PostTypeId="2" ParentId="27359" CreationDate="2016-09-26T18:56:57.237" Score="5" Body="&lt;p&gt;It appears to work as advertised. Note that what looks like &lt;code&gt;^H&lt;/code&gt; in the emacs buffer is really a backspace character. If you were to print &lt;code&gt;_^HS&lt;/code&gt; on an old fashioned dot matrix printer, it would print the underscore, then the print head would go back one step, and it would print the S. Result: an underlined S! And so on for the next characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, this shows the age of emacs. Emacs is &lt;em&gt;old&lt;/em&gt;, from before dot matrix printers even (I think), and this was a common technique back then. Even now, you will find that programs like &lt;a href=&quot;http://www.greenwoodsoftware.com/less/&quot;&gt;less&lt;/a&gt; will emulate this behaviour! So if you take a file in which you have run &lt;code&gt;M-x underline-region&lt;/code&gt; on some text, then save it, and view it with less in a terminal, you will see underlined text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this will &lt;em&gt;not&lt;/em&gt; do, however, is to display the text as underlined in the emacs buffer. Though it is conceivable that some modes exist (or could be written) that will display it that way.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-09-26T18:56:57.237" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27363" PostTypeId="1" AcceptedAnswerId="71368" CreationDate="2016-09-26T19:40:26.883" Score="2" ViewCount="109" Body="&lt;p&gt;I recently updated to emacs 25.1, and I'm noticing that sometimes escape sequences like &lt;code&gt;[&amp;lt;8;38;34m&lt;/code&gt; or &lt;code&gt;[&amp;lt;8;20;27m&lt;/code&gt; are being inserted into my document. I use emacs in the terminal (&lt;code&gt;emacs -nw&lt;/code&gt;). I use iTerm2 on macOS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't yet figured out what I do when this happens (I have thus far only noticed it after it happened). If I do I'll post more here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can any shed some light on what might be causing this? I can't figure out what ANSI escape sequence this might be. I haven't found a great list of sequences, but none of the ones I've seen have anything close to this. &lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="118" LastEditDate="2016-09-26T20:05:41.957" LastActivityDate="2022-04-13T23:45:49.380" Title="Escape sequences like [&lt;8;38;34m being inserted into my document when I middle click" Tags="|terminal-emacs|ansi|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27366" PostTypeId="2" ParentId="27358" CreationDate="2016-09-26T22:02:36.523" Score="1" Body="&lt;p&gt;I couldn't find anything else in org-agenda.el or org.el that stored the tags in the way I wanted, but it turned out it was relatively easy to write the function to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;#(...)&lt;/code&gt; format was apparently just a text property, so the function was as simple as (as long as you don't mind the property still there in the list)...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-get-all-tags-list ()&#xA;    (interactive)        &#xA;    (mapcar 'car (org-global-tags-completion-table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-09-26T22:02:36.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27368" PostTypeId="1" AcceptedAnswerId="27374" CreationDate="2016-09-27T00:55:13.500" Score="1" ViewCount="379" Body="&lt;p&gt;I'm using spacemacs and while when I create a new buffer with a given name and try to save it into a real file I find that &lt;code&gt;:w&lt;/code&gt; won't work but &lt;code&gt;:sav&lt;/code&gt; will. What is the difference between those two commands ?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastEditorUserId="6533" LastEditDate="2016-09-27T07:53:41.467" LastActivityDate="2016-11-01T15:54:56.380" Title="What's the difference between :w and :sav in spacemacs?" Tags="|evil|spacemacs|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27369" PostTypeId="1" AcceptedAnswerId="27370" CreationDate="2016-09-27T00:55:15.557" Score="1" ViewCount="166" Body="&lt;p&gt;I want to know if there is a package to send a piece of text to shell commands like sed, awk or other text processing utilities and then get the result back to emacs? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="2273" LastActivityDate="2016-09-27T01:08:42.147" Title="Is there a package to send a piece of text to shell and get the result back?" Tags="|shell|shell-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27370" PostTypeId="2" ParentId="27369" CreationDate="2016-09-27T01:08:42.147" Score="4" Body="&lt;p&gt;Possibly, but there's no need to install a package for this; it's built in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;shell-command-on-region&lt;/code&gt; (bound to &lt;code&gt;M-|&lt;/code&gt; by default) prompts for and then executes a shell command, sending it whatever you have selected on stdin, then displays the output in a temporary buffer. With a prefix arg (so &lt;code&gt;C-u M-|&lt;/code&gt;) it replaces the contents of the region with the output of the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other details in the documentation, so you might want to read it. Type &lt;code&gt;C-h f shell-command-on-region RET&lt;/code&gt; to open a help buffer for the command. This and other commands are also documented in the Emacs manual. &lt;code&gt;C-h i&lt;/code&gt; will open the info viewer with a list of all the available manuals. Select emacs, then navigate to section 40, Running Shell Commands from Emacs. You can jump right to it by typing &lt;code&gt;M-: (info &quot;(emacs)Shell&quot;)&lt;/code&gt;, but that's a bit of a mouth-full.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-27T01:08:42.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27371" PostTypeId="2" ParentId="20633" CreationDate="2016-09-27T01:15:35.913" Score="1" Body="&lt;p&gt;I would use one of the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~&amp;gt; (cons 1 nil)~ \to ~(1)~&#xA;&#xA;~&amp;gt; (cons 1 nil) → (1)~&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-09-27T01:15:35.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27372" PostTypeId="2" ParentId="27361" CreationDate="2016-09-27T01:20:27.533" Score="1" Body="&lt;p&gt;The function you are looking for is &lt;code&gt;mc/mark-next-like-this&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have no active region, then it will select one (or more) extra lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Find and mark the next part of the buffer matching the currently&#xA;  active region If no region is active add a cursor on the next line&#xA;  With negative ARG, delete the last one instead. With zero ARG, skip&#xA;  the last one and mark next.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have it bound to &lt;kbd&gt;C-x x&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-09-27T01:20:27.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27373" PostTypeId="2" ParentId="27368" CreationDate="2016-09-27T01:44:41.760" Score="2" Body="&lt;p&gt;I don't use spacemacs, but emacs in general is self-documenting; you can always query the help system for information about keybindings, functions, variables, etc. The normal emacs keyboard shortcut for getting help with a key binding is &lt;code&gt;C-h k&lt;/code&gt;. From a quick glance at the spacemacs manual (&lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION.html#orgheadline91&quot; rel=&quot;nofollow&quot;&gt;http://spacemacs.org/doc/DOCUMENTATION.html#orgheadline91&lt;/a&gt;), it looks like you should use &lt;code&gt;SPC h d k&lt;/code&gt;, or possibly &lt;code&gt;SPC h d f&lt;/code&gt; (I'm not sure if the ex-commands like :w are classified as keyboard shortcuts or functions; probably the former but it might be the latter.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to figure out the differnce by comparing the documentation for the two.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-09-27T01:44:41.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27374" PostTypeId="2" ParentId="27368" CreationDate="2016-09-27T04:55:14.360" Score="3" Body="&lt;p&gt;&lt;code&gt;:w&lt;/code&gt; and &lt;code&gt;:sav&lt;/code&gt; are Evil ex-commands, provided by &lt;a href=&quot;https://bitbucket.org/lyro/evil/wiki/Home&quot; rel=&quot;nofollow&quot;&gt;Evil&lt;/a&gt;. The &quot;bindings&quot; of ex-commands are stored in the variable &lt;code&gt;evil-ex-commands&lt;/code&gt;, which is an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html&quot; rel=&quot;nofollow&quot;&gt;alist&lt;/a&gt;. To examine the variable, run the command &lt;code&gt;C-h v evil-ex-commands&lt;/code&gt; (in Spacemacs you can use &lt;code&gt;SPC h d v evil-ex-commands&lt;/code&gt; instead). The output would be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;evil-ex-commands is a variable defined in ‘evil-vars.el’.&#xA;Its value is shown below.&#xA;&#xA;This variable may be risky if used as a file-local variable.&#xA;&#xA;Documentation:&#xA;Association list of command bindings and functions.&#xA;&#xA;Value: ((&quot;edit&quot; . evil-edit)&#xA;        (&quot;e&quot; . &quot;edit&quot;)&#xA;        (&quot;write&quot; . evil-write)&#xA;        (&quot;w&quot; . &quot;write&quot;)&#xA;        (&quot;wall&quot; . evil-write-all)&#xA;        (&quot;wa&quot; . &quot;wall&quot;)&#xA;        (&quot;saveas&quot; . evil-save)&#xA;        (&quot;sav&quot; . &quot;saveas&quot;)&#xA;        (&quot;read&quot; . evil-read)&#xA;        (&quot;r&quot; . &quot;read&quot;)&#xA;--- I trimmed the rest (the list continues) ---&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When invoking &lt;code&gt;:&amp;lt;key&amp;gt;&lt;/code&gt;, Evil looks for &lt;code&gt;&amp;lt;key&amp;gt;&lt;/code&gt; in &lt;code&gt;evil-ex-commands&lt;/code&gt; and invokes the corresponding command. As you can see, &quot;:w&quot; is a shortcut for &quot;:write&quot;, and &quot;:write&quot; invokes the function &lt;code&gt;evil-write&lt;/code&gt;. Similarly, &quot;:sav&quot; is a shortcut for &quot;:saveas&quot;, which invokes &lt;code&gt;evil-save&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find the differences between &lt;code&gt;evil-write&lt;/code&gt; and &lt;code&gt;evil-save&lt;/code&gt;, you can read their documentation by calling &lt;code&gt;C-h f&lt;/code&gt; or &lt;code&gt;SPC h d f&lt;/code&gt; (as db48x wrote). It seems that &quot;:w&quot; saves to current file, while &quot;:sav&quot; lets you save to a new file.&lt;/p&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-09-27T04:55:14.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27376" PostTypeId="1" AcceptedAnswerId="27406" CreationDate="2016-09-27T06:13:12.713" Score="4" ViewCount="1752" Body="&lt;h1&gt;summary&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I'm trying to debug a problem that involves an Emacs config and daemon startup. But when I run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from a console, the spew ends with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading desktop from /home/me/.emacs.d/personal/ ...&#xA;Entering debugger...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and hangs until killed. How to make the daemon &lt;em&gt;properly&lt;/em&gt; enter the &lt;code&gt;--debug-init&lt;/code&gt; (or other) debugger?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;current workaround&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Take &lt;a href=&quot;https://emacs.stackexchange.com/users/1982/youngfrog&quot;&gt;YoungFrog&lt;/a&gt;'s &lt;a href=&quot;https://emacs.stackexchange.com/questions/27376/how-to-start-daemon-with-debug-init-or-equivalent-debugger#comment41833_27376&quot;&gt;advice&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;0.&lt;/code&gt; Consider &lt;code&gt;emacs --daemon --debug-init&lt;/code&gt; to be broken WRT this usecase. (&lt;strong&gt;TODO:&lt;/strong&gt; file emacs bug.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1.&lt;/code&gt; Start sessions with &lt;code&gt;emacs --debug-init&lt;/code&gt; (and not &lt;code&gt;emacs --daemon --debug-init&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;2.&lt;/code&gt; Debugger will work: use it to resolve all startup problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;3.&lt;/code&gt; Once session will load without error with &lt;code&gt;emacs --debug-init&lt;/code&gt;, return to starting sessions with &lt;code&gt;emacs --daemon&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;detour&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Another late-night brainfart &lt;code&gt;:-(&lt;/code&gt; I had tried to run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --daemon --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(as later &lt;a href=&quot;https://emacs.stackexchange.com/a/27396/5444&quot;&gt;recommended by phils&lt;/a&gt;) and got the response&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient: unrecognized option '--daemon'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next morning I realized&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ alias emacs&#xA;alias emacs='emacsclient -c -a emacs'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and therefore that I needed to run (in bash)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ \emacs --daemon --debug-init&#xA;# ^--note backslash needed to override the alias&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works ... except that it gives the problem described in section=&lt;code&gt;summary&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;details&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;reproduction procedure&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I'm running the GNU Emacs 24.4 GUI via daemon on a vanilla Debian stable=Jessie with minor bits of testing (none involving Emacs). I'm rebasing my old'n'crufty, non-package-using emacs config on &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow noreferrer&quot;&gt;Prelude&lt;/a&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1. Old config (also a git repo, but private) is @ &lt;code&gt;~/.emacs.d__old_n_crufty/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2. New config (a Prelude fork) is @ &lt;code&gt;~/.emacs.d__Prelude/&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3. When I want to check my old functionality, I do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pkill emacs                  # ensure daemon not running&#xA;rm ~/.emacs.d&#xA;ln -sr ~/.emacs.d__old_n_crufty ~/.emacs.d&#xA;ls -ald ~/.emacs.d*          # sanity check&#xA;\emacs --daemon --debug-init # backslash to override alias&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;4. I copy bits of elisp from my old config to the new, then test latter with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pkill emacs&#xA;rm ~/.emacs.d&#xA;ln -sr ~/.emacs.d__Prelude ~/.emacs.d&#xA;ls -ald ~/.emacs.d*&#xA;\emacs --daemon --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just to be excruciatingly clear: both configurations are running the same underlying Emacs version, and both are using daemon+&lt;code&gt;emacsclient&lt;/code&gt;. The only difference is the configs, i.e., the runtime &lt;code&gt;~/.emacs.d/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Old'n'crufty config works as expected: particularly, the spew in the console in which I run my startup scriptlet ends with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Desktop: 1 frame, [much too large number of] buffers restored.&#xA;Starting Emacs daemon.&#xA;Restarting server&#xA;Emacs daemon should have started, trying to connect again&#xA;Waiting for Emacs...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I see my GUI frame. New config was doing fine until I ported my &lt;a href=&quot;https://www.emacswiki.org/emacs/Desktop&quot; rel=&quot;nofollow noreferrer&quot;&gt;desktop&lt;/a&gt;; now, console spew ends with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading desktop from /home/me/.emacs.d/personal/ ...&#xA;Entering debugger...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which hangs until &lt;code&gt;C-c&lt;/code&gt;. (Note also that both configs are using the exact same desktop file: 2 copies in different filetrees, no symlinks involved (yet, anyway).)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make the daemon start/enter the &lt;code&gt;--debug-init&lt;/code&gt; debugger properly? Alternatively, is there another debugger that plays better with the Emacs daemon, but which does not require major labor?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;workarounds&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;starting without daemon, i.e. just oldschool &lt;code&gt;emacs --debug-init &amp;amp;&lt;/code&gt;. See this &lt;a href=&quot;https://emacs.stackexchange.com/a/27406/5444&quot;&gt;&quot;answer&quot;&lt;/a&gt;, or section=&lt;code&gt;current workaround&lt;/code&gt; above (to which I'd link but &lt;a href=&quot;https://meta.stackexchange.com/questions/140594/is-there-a-way-to-link-to-a-section-header-in-an-answer#comment397110_140595&quot;&gt;SE apparently won't support section links&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;failed options&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;unalias emacs&lt;/code&gt;. I thought, maybe starting the debugger might involve calling &lt;code&gt;emacs&lt;/code&gt;, and be getting hosed by my alias. Empirically, no change.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;deprecated options&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Recompiling Emacs with debug symbols. That seems like a &lt;em&gt;lot&lt;/em&gt; of work.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bisecting config. This is unnecessary, because I've been porting function from old'n'crufty config to Prelude-based config step-by-step, and I know exactly &lt;em&gt;what&lt;/em&gt; is failing: it's loading my old desktop. What I want to investigate is,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;exact same Emacs version used for both cases&lt;/li&gt;&#xA;&lt;li&gt;exact same desktop file used for both cases&lt;/li&gt;&#xA;&lt;li&gt;old'n'crufty config can load that desktop with no error&lt;/li&gt;&#xA;&lt;li&gt;Prelude config hangs &lt;code&gt;entering debugger&lt;/code&gt; with that desktop&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-09-28T06:14:30.503" Title="how to start daemon with `--debug-init` or equivalent debugger?" Tags="|emacs-daemon|debug|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27378" PostTypeId="1" AcceptedAnswerId="27387" CreationDate="2016-09-27T07:23:20.967" Score="4" ViewCount="413" Body="&lt;p&gt;I have a long tex document and I would like to perform a search for finding some string inside math environments. Is there a search function already provided by &lt;code&gt;auctex&lt;/code&gt; to do this? Other solutions are welcomed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I found &lt;a href=&quot;https://stackoverflow.com/questions/19845598/emacs-regex-replacing-a-string-inside-a-latex-equation&quot;&gt;https://stackoverflow.com/questions/19845598/emacs-regex-replacing-a-string-inside-a-latex-equation&lt;/a&gt; on a similar topic for replacing a string inside math environments). &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="15606" LastEditDate="2024-02-29T19:28:52.000" LastActivityDate="2024-02-29T19:28:52.000" Title="How to perform a search for a string inside math environments in a tex/latex document" Tags="|latex|auctex|search|isearch-filter-predicate|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27380" PostTypeId="1" AcceptedAnswerId="28705" CreationDate="2016-09-27T09:22:31.383" Score="1" ViewCount="152" Body="&lt;p&gt;I have sr-sppedbar always turned on, but whenever I start, I have to manually click the code window to switch the cursor from speedbar to the codes. How do I start emacs with cursor in the main window instead of sr-speedbar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;It works after adding (other-window 1) to start hook in init.el.&lt;/p&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="12577" LastEditDate="2016-09-28T07:51:05.173" LastActivityDate="2016-11-17T00:16:02.697" Title="Set start cursor in code window instead of speedbar" Tags="|cursor|speedbar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27381" PostTypeId="1" CreationDate="2016-09-27T09:45:48.220" Score="2" ViewCount="843" Body="&lt;p&gt;I have changed the keybindings for yasnippet and autocomplete so that I can use tab for indentation anywhere in a line without accidentally autocompleting or inserting a snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this in my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(define-key ac-mode-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key ac-completing-map (kbd &quot;TAB&quot;) nil)&#xA;(define-key ac-completing-map [tab] nil)&#xA;&#xA;(ac-set-trigger-key &quot;`&quot;) ;; sets the auto-complete key   &#xA;&#xA;(require 'yasnippet)&#xA;(yas/initialize)&#xA;(yas/load-directory&#xA;  (dot-emacs &quot;elpa/yasnippet/snippets&quot;))&#xA;&#xA;;; Remove Yasnippet's default tab key binding            &#xA;(define-key yas-minor-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) nil)&#xA;(define-key yas-minor-mode-map (kbd &quot;TAB&quot;) nil)&#xA;;; Set Yasnippet's key binding to shift+tab              &#xA;(define-key yas-minor-mode-map (kbd &quot;§&quot;) 'yas-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works for most emacs modes, however when I use one particular mode (vhdl-mode) the yasnippet key bind &lt;code&gt;§&lt;/code&gt; works as expected but ` does not work for auto-complete and it resets to the default &lt;code&gt;tab&lt;/code&gt; key for autocomplete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means when I go through my code using tab to indent or un-indent parts of it random words are auto-completed.&lt;/p&gt;&#xA;" OwnerUserId="11742" LastEditorUserId="262" LastEditDate="2019-08-17T03:18:30.783" LastActivityDate="2022-12-29T08:03:05.510" Title="auto-complete Key binding doesn't work in one emacs mode" Tags="|key-bindings|init-file|package|auto-complete-mode|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27382" PostTypeId="1" AcceptedAnswerId="33863" CreationDate="2016-09-27T09:47:06.403" Score="10" ViewCount="2239" Body="&lt;p&gt;I need the diff of two buffers.  One way would be to create temporary files containing the contents of these buffers and to use the &lt;code&gt;diff&lt;/code&gt; function.  However, the buffers contain sensitive information and I'd prefer not to have that information in clear text on disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought about using ediff which can compare buffers directly but ediff starts an interactive session and I want to use this in a script.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2016-09-27T10:31:06.007" LastActivityDate="2023-08-29T16:46:49.373" Title="Diff of two buffers without creating temporary files" Tags="|ediff|diff|" AnswerCount="4" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27384" PostTypeId="1" AcceptedAnswerId="27385" CreationDate="2016-09-27T10:12:10.233" Score="0" ViewCount="48" Body="&lt;p&gt;I want this file to show up in a buffer when I start emacs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E:\emacs\org\index.org&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do I put in my init file? &lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="262" LastEditDate="2016-09-30T20:08:08.550" LastActivityDate="2016-09-30T20:08:08.550" Title="How to I use my init file to have another file automatically load in a buffer at start of emacs?" Tags="|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27385" PostTypeId="2" ParentId="27384" CreationDate="2016-09-27T11:34:32.617" Score="2" Body="&lt;p&gt;(find-file &quot;E:/emacs/org/index.org&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Windows accepts both forward and backward slashes. I prefer forward slashes as they do not need escaping.&lt;/p&gt;&#xA;" OwnerUserId="10394" LastEditorUserId="10394" LastEditDate="2016-09-27T13:03:34.143" LastActivityDate="2016-09-27T13:03:34.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27386" PostTypeId="2" ParentId="27381" CreationDate="2016-09-27T12:12:12.447" Score="0" Body="&lt;p&gt;I haven't looked at the source-code, but &lt;code&gt;vhdl-mode&lt;/code&gt; is probably resetting the keybindings for &lt;code&gt;auto-complete&lt;/code&gt; by itself. Does it work if you manually redefine them again after &lt;code&gt;vhdl-mode&lt;/code&gt; loads?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-redefine-auto-complete-keys ()&#xA;  (define-key ac-mode-map (kbd &quot;TAB&quot;) nil)&#xA;  (define-key ac-completing-map (kbd &quot;TAB&quot;) nil)&#xA;  (define-key ac-completing-map [tab] nil)&#xA;  (ac-set-trigger-key &quot;`&quot;))&#xA;&#xA;(add-hook 'vhdl-mode-hook 'my-redefine-auto-complete-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-09-27T12:12:12.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27387" PostTypeId="2" ParentId="27378" CreationDate="2016-09-27T12:39:40.163" Score="5" Body="&lt;p&gt;Bundled with AUCTeX there is the &lt;code&gt;texmathp&lt;/code&gt; utility (which, however, is independent from the TeX modes provided by AUCTeX and can be used without it), which allows you to test whether point is inside a mathematical mode or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest suggestion I can give you is to combine &lt;code&gt;texmathp&lt;/code&gt; with &lt;code&gt;search-forward&lt;/code&gt;, here is a possible implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun mg-search-in-math (string)&#xA;  (interactive &quot;MSearch string: &quot;)&#xA;  (while (null (and (search-forward string)&#xA;            (texmathp)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-09-27T12:39:40.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27388" PostTypeId="1" AcceptedAnswerId="27390" CreationDate="2016-09-27T12:40:52.600" Score="0" ViewCount="83" Body="&lt;p&gt;When I use a &lt;em&gt;for in&lt;/em&gt; statement, js2 mode doesn't recognize the new variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let foo = {bar: 1};&#xA;&#xA;for(key in foo) {&#xA;    console.log(key);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It prints:&#xA;&lt;em&gt;Undeclared variable or function 'key'&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-09-27T15:03:10.633" Title="js2 mode doesn't recognize variable in &quot;for in&quot; statement" Tags="|javascript|js2-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27389" PostTypeId="2" ParentId="27271" CreationDate="2016-09-27T13:26:54.700" Score="0" Body="&lt;p&gt;You can also just go to the un-tracked files heading and press &lt;code&gt;TAB&lt;/code&gt;. It will fold it like an orgmode buffer heading.&lt;/p&gt;&#xA;" OwnerUserId="13454" LastEditorUserId="9995" LastEditDate="2016-09-27T13:34:15.523" LastActivityDate="2016-09-27T13:34:15.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27390" PostTypeId="2" ParentId="27388" CreationDate="2016-09-27T15:03:10.633" Score="2" Body="&lt;p&gt;It warns you that the &lt;code&gt;key&lt;/code&gt; variable is undeclared, and using it like this, you leak it into the global namespace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this is your browser console:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; let foo = {bar: 1};&#xA;&#xA;&amp;gt; for(key in foo) {}&#xA;&#xA;&amp;gt; key&#xA;=&amp;gt; &quot;bar&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-09-27T15:03:10.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27391" PostTypeId="1" CreationDate="2016-09-27T15:05:34.403" Score="4" ViewCount="1096" Body="&lt;p&gt;I'm new to emacs (coming from vim) and wanted to try flycheck with jshint. I have &lt;code&gt;jshint&lt;/code&gt; installed and available in my path.  However, when I try to check a buffer, I get the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error while checking syntax automatically: (wrong-type-argument stringp nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I already set &lt;code&gt;debug-on-error&lt;/code&gt; and got the following trace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  signal(wrong-type-argument (stringp nil))&#xA;  #[257 &quot;\300 \210\301@A\&quot;\207&quot; [flycheck-report-failed-syntax-check signal] 4 &quot;\n\n(fn ERR)&quot;]((wrong-type-argument stringp nil))&#xA;  funcall(#[257 &quot;\300 \210\301@A\&quot;\207&quot; [flycheck-report-failed-syntax-check signal] 4 &quot;\n\n(fn ERR)&quot;] (wrong-type-argument stringp nil))&#xA;  flycheck-buffer()&#xA;  #[0 &quot;\300 \207&quot; [flycheck-buffer] 1 &quot;\n\n(fn)&quot;]()&#xA;  funcall(#[0 &quot;\300 \207&quot; [flycheck-buffer] 1 &quot;\n\n(fn)&quot;])&#xA;  flycheck-buffer-automatically(idle-change)&#xA;  flycheck-handle-idle-change()&#xA;  apply(flycheck-handle-idle-change nil)&#xA;  byte-code(&quot;r\301\302H\303H\&quot;\210)\301\207&quot; [timer apply 5 6] 4)&#xA;  timer-event-handler([t 22506 35301 253712 nil flycheck-handle-idle-change nil nil 115000])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that's about far as I can go with my limited understanding of elisp...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to run &lt;code&gt;jshint&lt;/code&gt; from my terminal (and from emacs) without problems.&lt;/p&gt;&#xA;" OwnerUserId="13447" LastEditorUserId="2710" LastEditDate="2016-09-30T12:49:50.360" LastActivityDate="2016-09-30T12:49:50.360" Title="wrong-type-argument stringp nil when trying to run flycheck" Tags="|spacemacs|flycheck|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27392" PostTypeId="1" AcceptedAnswerId="27411" CreationDate="2016-09-27T15:31:59.603" Score="4" ViewCount="1626" Body="&lt;p&gt;I use org-mode since 2012. I recently adopted the org-mode clocking&#xA;work time capabilities and thus have created the following org-capture-template:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates '(&quot;j&quot; &quot;Journal&quot; entry (file (concat&#xA;  org-directory &quot;/journal.org&quot;)) &quot;* %?\n%u\n&quot; :clock-in t :clock-resume t))&#xA;&#xA;(define-key global-map &quot;\C-cr&quot; 'org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I start working on something (eg. Project A), I press &lt;code&gt;C-c r j&lt;/code&gt; and the timer starts. When I finish, I press &lt;code&gt;C-c C-c&lt;/code&gt;. In this simple scenario, everything works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are occasions where I get interrupted during Project A,&#xA;without time for any key press. For example, the phone rings and I discuss an urgent issue for 10 minutes. Before I return to what I was doing before the phone call, I want to keep log of the phone call.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|  time | event                        |&#xA;|-------+------------------------------|&#xA;| 10:00 | Clock-in                     |&#xA;| 10:15 | Interrupt                    |&#xA;| 10:25 | RETI (return from interrupt) |&#xA;|-------+------------------------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is now &lt;code&gt;10:25&lt;/code&gt; and the corresponding entry in &lt;code&gt;journal.org&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Project A&#xA;  :LOGBOOK:&#xA;  CLOCK: [2016-09-27 Tue 10:00]&#xA;  :END:&#xA;  [2016-09-27 Tue]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Which is the best/recommended/straightforward way to achieve the following result?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Phone call&#xA;  :LOGBOOK:&#xA;  CLOCK: [2016-09-27 Tue 10:15]--[2016-09-27 Tue 10:25] =&amp;gt;  0:10&#xA;  :END:&#xA; [2016-09-27 Tue]&#xA;&#xA;* Project A&#xA;  :LOGBOOK:&#xA;  CLOCK: [2016-09-27 Tue 10:25]&#xA;  CLOCK: [2016-09-27 Tue 10:00]--[2016-09-27 Tue 10:15] =&amp;gt;  0:15&#xA;  :END:&#xA; [2016-09-27 Tue]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is shown here is:&lt;br&gt;&#xA;a) The phone call has been clocked from &lt;code&gt;10:15 - 10:25&lt;/code&gt;&lt;br&gt;&#xA;b) The Project A has been clocked from &lt;code&gt;10:00 - 10:15&lt;/code&gt;&lt;br&gt;&#xA;c) The Project A clock has resumed from &lt;code&gt;10:25&lt;/code&gt;  &lt;/p&gt;&#xA;" OwnerUserId="13455" LastActivityDate="2016-09-28T07:44:09.797" Title="Resuming org-mode clocking" Tags="|org-mode|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27394" PostTypeId="1" AcceptedAnswerId="27399" CreationDate="2016-09-27T17:27:06.073" Score="0" ViewCount="534" Body="&lt;p&gt;I'm looking for a simple version control system.  I'm the only programmer in my team and I would be the only one who is making changes to files.&lt;/p&gt;&#xA;&lt;p&gt;It gets complicated when the inputs change and I have to branch from the main source code into two (most times) versions - this will provide two different functionality.&lt;/p&gt;&#xA;&lt;p&gt;I have searched a lot and found the following:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs has VC which can do version control and it supports - RCS,CVS,SVN Git etc. I read the VC portion of the manual - but could not help me create a simple directory with files in it.&lt;/p&gt;&#xA;&lt;p&gt;When I created the &lt;code&gt;VC backend&lt;/code&gt; as &lt;code&gt;RCS&lt;/code&gt; - it is looking for a file &amp;quot;RCS&amp;quot; the same is true with &lt;code&gt;SVN&lt;/code&gt; too&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Magit is a package for Emacs which can do version control management.&lt;br /&gt;&#xA;I started running into problems during installation, it was looking for a git directory - which for some reason was not there and I ended up with errors during Magit installation.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;em&gt;(Note: I had installed Magit through MELPA and I had installed all the &lt;code&gt;requires&lt;/code&gt; packages for the Magit before the actual Magit installation)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I adjust need an example on how to set this up&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-09-27T20:43:33.397" Title="Version control using emacs" Tags="|magit|version-control|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27395" PostTypeId="2" ParentId="21948" CreationDate="2016-09-27T18:35:07.833" Score="0" Body="&lt;p&gt;Python, by default buffers &lt;code&gt;stdout&lt;/code&gt; and &lt;code&gt;stderr&lt;/code&gt;, and as is pointed out in the emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq-w32/Subprocess-buffering.html&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt; (ever so thankfully), output will not show in the shell unless the buffer overflows.  In the case of pdb, it is rather unlikely that the buffer overflows and issues arise attempting to interact (as above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, Python allows you to run unbuffered by using either the &lt;code&gt;-u&lt;/code&gt; flag passed to the executable at runtime, or by setting the &lt;code&gt;PYTHONUNBUFFERED&lt;/code&gt; environment variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This resolves the issue in both shell-mode and in eshell.&lt;/p&gt;&#xA;" OwnerUserId="598" LastActivityDate="2016-09-27T18:35:07.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27396" PostTypeId="2" ParentId="27376" CreationDate="2016-09-27T19:11:13.460" Score="1" Body="&lt;p&gt;You could use a custom wrapper script as your &lt;code&gt;-a&lt;/code&gt; argument value, but you presumably only want to use &lt;code&gt;--debug-init&lt;/code&gt; temporarily, so... just do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kill your Emacs server if it's running, and then restart it with &lt;code&gt;--debug-init&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now connect to it as usual.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;edit: TomRoche adds the following...&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, if this throws an immediate error, like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient: unrecognized option '--daemon'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you may have aliased &lt;code&gt;emacs&lt;/code&gt;: check that with (in bash)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you have an alias, you can either delete it (with &lt;code&gt;unalias emacs&lt;/code&gt;) or temporarily override it by preceding the alias with a backslash, e.g.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\emacs --daemon --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-09-27T23:32:23.073" LastActivityDate="2016-09-27T23:32:23.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27397" PostTypeId="1" AcceptedAnswerId="27398" CreationDate="2016-09-27T19:27:32.547" Score="0" ViewCount="198" Body="&lt;p&gt;Inside the magit-status, I see tons of stashes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I removed them by pressing a key on the keyboard?&lt;/p&gt;&#xA;" OwnerUserId="9829" LastActivityDate="2016-09-27T20:41:32.003" Title="How to remove git stashes when inside magit-status" Tags="|magit|git|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27398" PostTypeId="2" ParentId="27397" CreationDate="2016-09-27T19:42:23.430" Score="2" Body="&lt;p&gt;Move to the relevant stash, and &lt;kbd&gt;k&lt;/kbd&gt; to kill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you move to the &lt;code&gt;Stashes&lt;/code&gt; heading and type &lt;kbd&gt;k&lt;/kbd&gt; on that line you can remove them all.  &lt;/p&gt;&#xA;" OwnerUserId="791" LastEditorUserId="306" LastEditDate="2016-09-27T20:41:32.003" LastActivityDate="2016-09-27T20:41:32.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27399" PostTypeId="2" ParentId="27394" CreationDate="2016-09-27T19:47:28.100" Score="1" Body="&lt;p&gt;It's important to note that the VC features of emacs are interfaces to an underlying Version Control System, rather than a replacement for that.  Whichever one you choose you will need some level of proficiency in, even if that level is &quot;just learning&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Git would be a serviceable choice.  There are plenty of tutorials out there, and it is widely used.  Magit is an amazing Emacs extension. But again, passing knowledge of what Git is and how it works will be beneficial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A short answer to your question is that you'll need to &lt;code&gt;git init&lt;/code&gt; from the command line in your source directory.  This does however open up a lot more questions like: now that you have it initialized, how do you add your files to the repository?  How do you commit? How do you branch? &lt;/p&gt;&#xA;" OwnerUserId="791" LastEditorUserId="306" LastEditDate="2016-09-27T20:43:33.397" LastActivityDate="2016-09-27T20:43:33.397" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27401" PostTypeId="1" AcceptedAnswerId="27435" CreationDate="2016-09-27T23:45:52.193" Score="1" ViewCount="422" Body="&lt;p&gt;Using Emacs 25.1.50.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To set the slot of a structure, I believe the elisp manual says to use &lt;code&gt;setq&lt;/code&gt; along with the accessor function for the slot. Though I am having trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code results in an error on the fourth line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;(cl-defstruct foo name)&#xA;(setq bar (make-foo :name 'john))&#xA;(setq (foo-name bar) 'jim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eval: Wrong type argument: symbolp, (progn &quot;Access slot \&quot;name\&quot; of    `foo' struct CL-X.&quot; nil (or (progn nil (and (vectorp bar) (&gt;= (length bar) 2) (memq (aref bar 0) cl-struct-foo-tags) t)) (signal (quote wrong-type-argument) (list (quote foo) bar))) (aref bar 1))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also there is no &lt;code&gt;cl&lt;/code&gt; tag to use for the Emacs Common Lisp Emulation Library... don't know what else to put it under, just going to put it under &lt;code&gt;common-lisp&lt;/code&gt; for someone to help me find the &lt;em&gt;right&lt;/em&gt; tag.&lt;/p&gt;&#xA;" OwnerUserId="12195" LastEditorUserId="12195" LastEditDate="2016-09-27T23:57:25.310" LastActivityDate="2016-09-29T02:50:38.227" Title="Error while trying to set a slot of a cl-struct" Tags="|common-lisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27402" PostTypeId="2" ParentId="26695" CreationDate="2016-09-28T01:23:21.477" Score="0" Body="&lt;p&gt;I had the same issue because I was running emacsclient from /usr/bin/emacsclient, now I use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export EDITOR='/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --no-wait --alternate-editor=/Applications/Emacs.app/Contents/MacOS/Emacs'&#xA;alias e=$EDITOR&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13463" LastActivityDate="2016-09-28T01:23:21.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27403" PostTypeId="2" ParentId="12823" CreationDate="2016-09-28T01:27:34.120" Score="1" Body="&lt;p&gt;Not exactly what you're asking for, but this works well for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-unset-key [down-mouse-1])   ; no dragging nonsense&#xA;(global-set-key [mouse-1] 'mouse-select-window)  ; no setting point&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't match your request exactly in that not only is the frame made active but so is the window clicked.  But, I find that to be useful.  Double click moves the point, single click doesn't.&lt;/p&gt;&#xA;" OwnerUserId="13464" LastEditorUserId="9995" LastEditDate="2016-09-28T06:32:07.867" LastActivityDate="2016-09-28T06:32:07.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27404" PostTypeId="2" ParentId="27391" CreationDate="2016-09-28T03:49:34.883" Score="1" Body="&lt;p&gt;I've run into this same issue and can trace it back to this &lt;a href=&quot;https://github.com/flycheck/flycheck/commit/ec31874a662fdf1dcd174bca99af870a20415ceb&quot; rel=&quot;nofollow&quot;&gt;commit&lt;/a&gt; which in turn was a solution for having no eslint config from this &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/1085&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt;.  Downgrading to the previous version of flycheck worked for me, but it sounds like the real solution is to provide an eslint config somewhere on your path where your emacs can find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updated - I just opened an &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/1115&quot; rel=&quot;nofollow&quot;&gt;issue&lt;/a&gt; for this to see what the proper fix is.&lt;/p&gt;&#xA;" OwnerUserId="10045" LastEditorUserId="10045" LastEditDate="2016-09-28T04:20:23.190" LastActivityDate="2016-09-28T04:20:23.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27405" PostTypeId="1" AcceptedAnswerId="27419" CreationDate="2016-09-28T05:24:00.943" Score="11" ViewCount="1735" Body="&lt;p&gt;I am trying to write a yasnippet to insert code chunks into an R Markdown file. I use polymode to have multiple major modes (markdown, ESS[S]) in a single file. This is my snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: chunk&#xA;# key: chunk&#xA;# --&#xA;\`\`\`{r $1}&#xA;$0&#xA;\`\`\`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to insert the snippet into a .Rmd file in markdown mode, I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in post-command-hook (yas--post-command-handler): (error &quot;Marker points into wrong buffer&quot; #&amp;lt;marker at 7 in test.Rmd&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The snippet does appear and my cursor is in the correct spot (right before the second curly brace):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;```{r }&#xA;&#xA;```&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I hit tab I get the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;yas-next-field: Wrong type argument: overlayp, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am guessing that I'm running into an interaction with polymode: I'm in markdown mode when I insert the snippet, but then polymode converts the contents of the code chunk to ESS[S] mode. It looks like there will eventually be a command to &lt;a href=&quot;https://github.com/vspinu/polymode/blob/a29b8a07cc9081bd75114d68fc7afdcef2e5bc94/polymode.el#L222-L224&quot; rel=&quot;noreferrer&quot;&gt;insert a new chunk&lt;/a&gt; in polymode, but in the meantime is there any way to get this snippet working?&lt;/p&gt;&#xA;" OwnerUserId="7060" LastEditorUserId="7060" LastEditDate="2017-02-05T17:38:17.953" LastActivityDate="2017-02-05T17:38:17.953" Title="Insert code chunk in R Markdown with yasnippet and polymode" Tags="|yasnippet|ess|polymode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27406" PostTypeId="2" ParentId="27376" CreationDate="2016-09-28T06:06:47.537" Score="0" Body="&lt;p&gt;Not quite an answer, but the only currently-working workaround is, take &lt;a href=&quot;https://emacs.stackexchange.com/users/1982/youngfrog&quot;&gt;YoungFrog&lt;/a&gt;'s &lt;a href=&quot;https://emacs.stackexchange.com/questions/27376/how-to-start-daemon-with-debug-init-or-equivalent-debugger#comment41833_27376&quot;&gt;advice&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;0. Consider &lt;code&gt;emacs --daemon --debug-init&lt;/code&gt; to be broken WRT this usecase. (&lt;strong&gt;TODO:&lt;/strong&gt; file emacs bug.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1. Start sessions with &lt;code&gt;emacs --debug-init&lt;/code&gt; (and not &lt;code&gt;emacs --daemon --debug-init&lt;/code&gt;); debugger will work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2. Use {&quot;classic&quot; startup, debugger} to resolve all startup problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3. Once session will load without error with &lt;code&gt;emacs --debug-init&lt;/code&gt;, return to starting sessions with &lt;code&gt;emacs --daemon&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-09-28T06:06:47.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27407" PostTypeId="1" AcceptedAnswerId="27409" CreationDate="2016-09-28T06:07:58.443" Score="7" ViewCount="7364" Body="&lt;p&gt;JSON:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;  &quot;name&quot;: &quot;xxxxx&quot;,&#xA;  &quot;job&quot;: &quot;xxxxxx&quot;,&#xA;  &quot;projects&quot;: [&#xA;    {&#xA;      &quot;name&quot;: &quot;xxxxx&quot;,&#xA;      &quot;date&quot;: &quot;xxxxx&quot;,&#xA;      &quot;about&quot;: &quot;xxxxxxxxxx&quot;&#xA;    },&#xA;    {&#xA;      &quot;name&quot;: &quot;xxxxx&quot;,&#xA;      &quot;date&quot;: &quot;xxxxx&quot;,&#xA;      &quot;about&quot;: &quot;xxxxxxxxxx&quot;&#xA;    },&#xA;    {&#xA;      &quot;name&quot;: &quot;xxxxx&quot;,&#xA;      &quot;date&quot;: &quot;xxxxx&quot;,&#xA;      &quot;about&quot;: &quot;xxxxxxxxxx&quot;&#xA;    }&#xA;  ]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Elisp file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((json-object-type 'hash-table)&#xA;      (json-array-type 'list)&#xA;      (json-key-type 'string))&#xA;  (setq data (with-temp-buffer&#xA;               (insert-file-contents (elt argv 0))&#xA;               (buffer-string))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to access the first element in projects list (json array)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note:&#xA;According to &lt;a href=&quot;https://github.com/thorstadt/json.el/blob/master/json.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/thorstadt/json.el/blob/master/json.el&lt;/a&gt; (read-json) should be used instead of setq but it doesn't show a clear example on how to do that. Also I have chosen hash-tables as the json-object-type as in comparision of plist and alist it seems favorable to me. &lt;/p&gt;&#xA;" OwnerUserId="13465" LastEditorUserId="1979" LastEditDate="2019-05-30T02:28:11.497" LastActivityDate="2019-05-30T02:28:11.497" Title="Accessing JSON data in elisp" Tags="|json|hash-tables|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="27408" PostTypeId="2" ParentId="27382" CreationDate="2016-09-28T06:34:29.903" Score="0" Body="&lt;p&gt;AFAIU Emacs takes external programms to do the diff. For example &lt;code&gt;ediff-make-diff2-buffer&lt;/code&gt;, which would compare two buffers, internally calls&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(ediff-exec-process ediff-diff-program&#xA;                    diff-buffer&#xA;                    'synchronize&#xA;                    ediff-actual-diff-options file1 file2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Where &lt;code&gt;ediff-diff-program&lt;/code&gt; might represent the GNU/Linux &lt;code&gt;diff&lt;/code&gt;.&#xA;With new FFI the system &lt;code&gt;diff&lt;/code&gt; might be accessible. Also an Emacs Lisp diff-implementation might do the job.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="37922" LastEditDate="2023-08-26T19:52:33.677" LastActivityDate="2023-08-26T19:52:33.677" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27409" PostTypeId="2" ParentId="27407" CreationDate="2016-09-28T06:39:05.847" Score="13" Body="&lt;p&gt;I've taken the liberty of adjusting your code appropriately:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'json)&#xA;&#xA;(let* ((json-object-type 'hash-table)&#xA;       (json-array-type 'list)&#xA;       (json-key-type 'string)&#xA;       (json (json-read-file &quot;test.json&quot;)))&#xA;  (car (gethash &quot;projects&quot; json)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;let*&lt;/code&gt; is required because otherwise the call to &lt;code&gt;json-read-file&lt;/code&gt; will not see the previously bound values as &lt;code&gt;let&lt;/code&gt; sets them in parallel...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the access functions, &lt;code&gt;gethash&lt;/code&gt; retrieves a value by key from a hash table, whereas &lt;code&gt;car&lt;/code&gt; returns the first list element.  If you need a different one, you can use &lt;code&gt;nth&lt;/code&gt; with an index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To actually iterate over the projects:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'json)&#xA;&#xA;(let* ((json-object-type 'hash-table)&#xA;       (json-array-type 'list)&#xA;       (json-key-type 'string)&#xA;       (json (json-read-file &quot;test.json&quot;))&#xA;       (projects (gethash &quot;projects&quot; json)))&#xA;  (dolist (project projects)&#xA;    ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-09-28T07:05:35.730" LastActivityDate="2016-09-28T07:05:35.730" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27410" PostTypeId="1" CreationDate="2016-09-28T07:41:23.300" Score="4" ViewCount="1560" Body="&lt;p&gt;I have a weird issue in emacs with &lt;code&gt;TRAMP&lt;/code&gt;. i can ssh via M-x ssh to a machine (zlap) from within emacs with no issue. yet when i try to use C-x C-f (find file) it hangs after i enter the passphrase. looking at the message buffer i see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Tramp: Opening connection for 132.72.154.204 using ssh...&#xA;Tramp: Sending command ‘exec ssh   -o ControlMaster=auto -o ControlPath='tramp.%C' -o ControlPersist=no -e none 132.72.154.204’&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Timeout reached, see buffer ‘*tramp/ssh 132.72.154.204*’ for details&#xA;Tramp: Waiting for prompts from remote shell...failed&#xA;Tramp: Opening connection for 132.72.154.204 using ssh...failed&#xA;Tramp: Opening connection for 132.72.154.204 using ssh...&#xA;Couldn’t find local shell prompt for /bin/sh&#xA;Tramp: Opening connection for 132.72.154.204 using ssh...failed&#xA;tramp-file-name-handler: Couldn’t find local shell prompt for /bin/sh&#xA;Invalid face reference: quote [21 times]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;looking at the ‘&lt;em&gt;tramp/ssh 132.72.154.204&lt;/em&gt;’ buffer shows this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    tramp_exit_status 0&#xA;$fg[magenta]zeltak$reset_color$fg[cyan]@$reset_color$fg[yellow]zx1voics$reset_color$fg[red]:$reset_color$fg[cyan]~$reset_color$fg[red]|$reset_color$fg[cyan]⇒$reset_color  #$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;im at loss here, any clue how to resolve this?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2017-02-25T14:30:51.050" Title="cant connect with TRAMP (tramp-file-name-handler: Couldn’t find local shell prompt for /bin/sh)" Tags="|tramp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27411" PostTypeId="2" ParentId="27392" CreationDate="2016-09-28T07:44:09.797" Score="1" Body="&lt;p&gt;I believe this question is basically the same as &lt;a href=&quot;https://emacs.stackexchange.com/questions/16983/how-to-manipulate-clock-times-org-mode&quot;&gt;How to manipulate clock times (org-mode)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I provided an answer under that question (currently the recognised correct answer if that helps you spot it), but the basic gist is that you create and clock in to your &quot;interrupt&quot; task on your return, then adjust the starting clock time of that interrupt task back to when you were actually interrupted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use M-S-Up and M-S-Down on the CLOCK line of your interrupt task then, in addition to adjusting that clock time, it will also adjust the clock entry of the previously clocked-in task. In your scenario this would therefore adjust the end of &quot;Clock-in&quot; as it was adjusting the start time of &quot;Interrupt&quot;.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2016-09-28T07:44:09.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27412" PostTypeId="2" ParentId="26274" CreationDate="2016-09-28T08:06:42.740" Score="1" Body="&lt;p&gt;Try something like this: (make the variable permanent-local and call web-mode after setting the variables)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((web-mode . ((eval . (progn&#xA;                        (setq-local web-mode-engines-alist '((&quot;django&quot; . &quot;\\.html\\'&quot;)))&#xA;                        (put 'web-mode-engines-alist 'permanent-local t)&#xA;                        (web-mode))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-09-28T23:27:48.703" LastActivityDate="2016-09-28T23:27:48.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27413" PostTypeId="1" CreationDate="2016-09-28T08:15:13.650" Score="1" ViewCount="37" Body="&lt;p&gt;It would be really useful if emacs could detect the cursor is currently inside a code-block in my markdown-file and compiles the fragment automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am editing a large &lt;em&gt;markdown&lt;/em&gt; file with a lot of code sections in it. Most code sections begin with &lt;code&gt;#!cpp filename=somefile.cpp test=output&lt;/code&gt;, which means: *The code is a real and complete code fragment that is compileable, runnable (ie, contains &lt;code&gt;main&lt;/code&gt;) and contains its own test data (in &lt;code&gt;//=&lt;/code&gt; commented lines).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You can *initialize* a `vector`:&#xA;&#xA;%%heading: It is empty.&#xA;&#xA;    #!cpp filename=41vector-init-default.cpp test=output.cpp&#xA;    #include &amp;lt;vector&amp;gt;&#xA;    #include &amp;lt;iostream&amp;gt;&#xA;    using std::vector; using std::cout;&#xA;    int main() {&#xA;       vector&amp;lt;int&amp;gt; dataA;&#xA;       vector&amp;lt;int&amp;gt; dataB{};&#xA;       vector&amp;lt;int&amp;gt; dataC = {};&#xA;       cout &amp;lt;&amp;lt; dataA.size() &amp;lt;&amp;lt; ' ' dataB.size() &amp;lt;&amp;lt; ' ' &amp;lt;&amp;lt; dataC.size() &amp;lt;&amp;lt; '\n';&#xA;       //= 0 0 0&#xA;    }&#xA;&#xA;You can *copy* it:&#xA;&#xA;%%heading: Copy the thing&#xA;&#xA;    #!cpp filename=41vector-init-copy.cpp test=output&#xA;    #include &amp;lt;vector&amp;gt;&#xA;    #include &amp;lt;iostream&amp;gt;&#xA;    using std::vector; using std::cout;&#xA;    int main() {&#xA;        vector&amp;lt;int&amp;gt; input{1,2,3};&#xA;        vector&amp;lt;int&amp;gt; output(input);&#xA;        cout &amp;lt;&amp;lt; output.size() &amp;lt;&amp;lt; '\n';&#xA;        //= 3&#xA;    }&#xA;&#xA;There you go.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It would be really useful if emacs could detect the cursor us currently inside a &lt;code&gt;#!cpp&lt;/code&gt;-Block and execute my python-script &lt;code&gt;ly-compile.py&lt;/code&gt; on it that compiles, executes and checks it. Maybe each time I move the cursor inside such a section or change text inside of it. The result of the python script should be shown in a separate buffer/window, on-the-fly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The python-script takes filename to compile and a bunch of command-line arguments taken form the &lt;code&gt;#!cpp&lt;/code&gt;-line. I could adjust it so it reals all it needs from stdin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I plug the different things together that emacs already can do or tweak them so it works on-the-fly? &lt;code&gt;flymake&lt;/code&gt; seems to be a candidate, but how?&lt;/p&gt;&#xA;" OwnerUserId="13466" LastEditorUserId="13466" LastEditDate="2016-09-28T20:43:48.417" LastActivityDate="2016-09-28T20:43:48.417" Title="Detect a region in markdown and run a compilation" Tags="|markdown|interactive-development|flymake|compile-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27414" PostTypeId="1" AcceptedAnswerId="27415" CreationDate="2016-09-28T08:50:07.683" Score="2" ViewCount="88" Body="&lt;p&gt;I'm trying to do something very simple, write bytes to a file using the f library:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'f)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I create a list of bytes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq random-data (loop for i from 0 to 40 collect (random 150)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, so good.  However, the &lt;code&gt;unibyte-string&lt;/code&gt; function seemingly expects separate arguments so the following doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(f-write-bytes (unibyte-string random-data) &quot;file.dat&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems painfully easy but I can't get it working, is there a standard way of doing this?&lt;/p&gt;&#xA;" OwnerUserId="727" LastEditorUserId="105" LastEditDate="2016-09-28T15:23:44.780" LastActivityDate="2016-09-28T15:23:44.780" Title="Writing bytes to a file using library f.el" Tags="|files|functions|apply|" AnswerCount="1" CommentCount="0" ClosedDate="2016-10-04T16:16:20.797" ContentLicense="CC BY-SA 3.0" />
  <row Id="27415" PostTypeId="2" ParentId="27414" CreationDate="2016-09-28T09:09:46.017" Score="2" Body="&lt;p&gt;You need to &lt;code&gt;apply&lt;/code&gt; the function to the list of arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(f-write-bytes (apply 'unibyte-string random-data) &quot;file.dat&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(apply '+ '(1 2 3))&lt;/code&gt; is equivalent to &lt;code&gt;(+ 1 2 3)&lt;/code&gt;. See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Calling-Functions.html&quot; rel=&quot;nofollow&quot;&gt;section about calling functions&lt;/a&gt; in the elisp manual for more details.&lt;/p&gt;&#xA;" OwnerUserId="10334" LastActivityDate="2016-09-28T09:09:46.017" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27416" PostTypeId="1" CreationDate="2016-09-28T09:36:32.683" Score="5" ViewCount="1967" Body="&lt;p&gt;How does Emacs display inline image for svg and gif formats in Org-mode? With &lt;code&gt;imagemagick&lt;/code&gt; or something else? I know &lt;code&gt;[C-c C-x C-v]&lt;/code&gt; toogle inline image display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found in Emacs 24.3 old version, I can inline view svg and gif images in Org-mode, but in Emacs 25.1, it can't, it will auto open &lt;code&gt;svg&lt;/code&gt; and &lt;code&gt;gif&lt;/code&gt; image link (&lt;code&gt;[[file:/path/to/file.gif]]&lt;/code&gt;) with external program.&#xA;Does Emacs added some new options for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want Emacs can inline display support those image formats.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Found config in my init file which cause this problem:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'openwith-associations '(&quot;\\.gif\\'&quot; &quot;gwenview&quot; (file)))&#xA;(add-to-list 'openwith-associations '(&quot;\\.svg\\'&quot; &quot;feh --magick-timeout 5&quot; (file)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2016-09-28T14:48:39.347" LastActivityDate="2016-11-27T15:33:50.640" Title="Does Org-mode support display inline images for format like svg, gif?" Tags="|org-mode|inline-image|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27417" PostTypeId="2" ParentId="27416" CreationDate="2016-09-28T10:25:49.060" Score="3" Body="&lt;p&gt;From the &lt;a href=&quot;http://orgmode.org/manual/Handling-links.html#Handling-links&quot; rel=&quot;nofollow&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;C-c C-x C-v     (org-toggle-inline-images)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Toggle the inline display of linked images. &lt;strong&gt;Normally this will only inline images that have no description part in the link&lt;/strong&gt;, i.e., images that will also be inlined during export. When called with a prefix argument, also display images that do have a link description. You can ask for inline images to be displayed at startup by configuring the variable org-startup-with-inline-images.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, for images without descriptions, you can toggle inline display with &lt;code&gt;C-c C-x C-v&lt;/code&gt;, and you can customize the variable &lt;code&gt;org-startup-with-inline-images&lt;/code&gt; to make this the default behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This won't work for images with descriptions, but then, if you have a description you probably want that to be displayed anyways?&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-09-28T12:51:22.150" LastActivityDate="2016-09-28T12:51:22.150" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27418" PostTypeId="2" ParentId="27410" CreationDate="2016-09-28T10:26:30.767" Score="7" Body="&lt;p&gt;Your remote prompt is not Tramp compatible. Check the Tramp documentation how to simplify it. Something like this might work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ $TERM = &quot;dumb&quot; ] &amp;amp;&amp;amp; PS1='$ '&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If your remote shell is zsh, you might even need this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ $TERM = &quot;dumb&quot; ] &amp;amp;&amp;amp; unsetopt zle &amp;amp;&amp;amp; PS1='$ '&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-09-28T10:26:30.767" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27419" PostTypeId="2" ParentId="27405" CreationDate="2016-09-28T10:45:08.443" Score="8" Body="&lt;p&gt;I ran into a similar issue, and wrote a stand-alone function to get around the weird interactions between &lt;code&gt;yasnippet&lt;/code&gt; and &lt;code&gt;polymode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following function mimics the behaviour of the snippet you tried, prompting first for the header info, which gets inserted at your &lt;code&gt;$1&lt;/code&gt;, and then dropping you in the chunck body (your &lt;code&gt;$0&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun tws-insert-r-chunk (header) &#xA;  &quot;Insert an r-chunk in markdown mode. Necessary due to interactions between polymode and yas snippet&quot; &#xA;  (interactive &quot;sHeader: &quot;) &#xA;  (insert (concat &quot;```{r &quot; header &quot;}\n\n```&quot;)) &#xA;  (forward-line -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-09-28T12:48:01.250" LastActivityDate="2016-09-28T12:48:01.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27420" PostTypeId="1" CreationDate="2016-09-28T11:32:56.193" Score="2" ViewCount="2063" Body="&lt;p&gt;I have regularly tried, over the years, to run emacs through putty to get rid of the need to install a local X server. I remember the putty+emacs combination being abysmal in the past; and right now it seems slightly better but still outright unusable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, even after applying all configurations from &lt;a href=&quot;https://www.emacswiki.org/emacs/PuTTY&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/PuTTY&lt;/a&gt; (setting to SCO emulation, etc.), many keys still do not get sent to emacs work (e.g., Shift-Arrow, Ctrl-Arrow, Ctrl-PageUp/Down etc.). That page is from 2014, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has someone had good results in a current(ish) PuTTY (0.65, which is from 2015, but the changelog displays only minor bugfixes and security changes since then) with GNU emacs (24.5.1 in my case, but the problems seem to occur long before they actually reach emacs...). Or is it still hopeless?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I am aware of Emacs being available as a native windows executable; I have used that; also Tramp, or running an X server on the Windows machine. This question is geared toward the specific situation of being forced to start it in this specific terminal program (which seems to be quite standard in the Windows world) on a remote machine (Unix, of course), for whatever reasons out of my control. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT^2: I don't see how I can get much more specific. I named a few commonplace key combinations that do not work; I would suspect/hope that anybody who regularly uses Emacs over Putty would be able to give a quick &quot;situational update&quot; like &quot;it kind of works, but better learn to only use Ctrl/Alt+[a-z] keys instead of any 'modern' key&quot; or &quot;if you set option XYZ in Putty and option ABC in Emacs, 99% of all combinations work&quot;. I'll interpret &quot;no answer&quot; as &quot;let go of all hope&quot;. &lt;/p&gt;&#xA;" OwnerUserId="11371" LastEditorUserId="11371" LastEditDate="2016-10-09T15:13:28.093" LastActivityDate="2016-10-09T15:13:28.093" Title="Fixing keybindings of Emacs inside Putty on Windows" Tags="|microsoft-windows|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27422" PostTypeId="1" CreationDate="2016-09-28T15:25:47.183" Score="0" ViewCount="444" Body="&lt;p&gt;For plain Emacs, I used to use the following methods to organize my configurations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Put logically related configurations into different files;&lt;/li&gt;&#xA;&lt;li&gt;Organize with Org Babel.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now I'm trying to use Spacemace, it seems that all user configurations goes into &lt;code&gt;dotspacemacs/user-init&lt;/code&gt; and &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;.  If all my configs are put inside these two procedures, it will be a big chunk of code.  Is there a way to separate the configs neatly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have quite some Org mode configurations.  There's already a layer for Org mode in Spacemacs.  Then my personal configs should go somewhere else.  What's the best way to deal with that?&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2016-09-30T15:44:21.750" Title="What's the best way to organize personal configurations in Spacemacs?" Tags="|org-mode|spacemacs|configuration-files|" AnswerCount="1" CommentCount="2" ClosedDate="2016-09-30T17:27:52.263" ContentLicense="CC BY-SA 3.0" />
  <row Id="27424" PostTypeId="2" ParentId="18710" CreationDate="2016-09-28T17:50:02.310" Score="1" Body="&lt;p&gt;As it happens, I just implemented &lt;a href=&quot;https://bitbucket.org/apharris/emacs-init/src/dd2c9eed4da128023347c84f8ee0cba06db9cf7b/org-agenda-count.el?at=default&amp;amp;fileviewer=file-view-default&quot; rel=&quot;nofollow&quot;&gt;something useful for this&lt;/a&gt; for myself before I came across your question.  To avoid having all of the source code just in a link, it's also at the bottom of this answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use this, you would construct an empty agenda block like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;'(&quot;x&quot; &quot;Example block agenda&quot;&#xA;   ((tags&#xA;     &quot;drill&quot;&#xA;     ((org-agenda-overriding-header&#xA;       (format &quot;Org-Drill: %s cards today.&quot;&#xA;               (org-agenda-count &quot;drill&quot;)))&#xA;      (org-agenda-max-entries 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This block would contain just the block header, with a count of all &lt;code&gt;:drill:&lt;/code&gt; tasks.  In reality, you would probably want an &lt;code&gt;agenda&lt;/code&gt;-type block with an appropriate skip function so you only pick up the scheduled cards, but the principle is the same.  And of course you'd have other blocks where you'd filter &lt;em&gt;out&lt;/em&gt; the drill tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way this works is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When the function &lt;code&gt;org-agenda-count&lt;/code&gt; is called, it sets up the rest of the process using hooks and advice, then returns a proxy string (by default for this example, &quot;##drill##&quot;), which is incorporated into the header.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;During agenda construction, the function &lt;code&gt;org-agenda-finalize-entries&lt;/code&gt; is called.  Its first argument is a list with one item per agenda entry.  We run advice here that counts that list and stores the result.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At some point in here, &lt;code&gt;org-agenda-max-entries&lt;/code&gt; is applied and all of the actual entries are discarded.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally, &lt;code&gt;org-agenda-finalize-hook&lt;/code&gt; is run, along with our hook function that looks for the proxy string from step 1 and replaces it with the appropriate count, then removes all of the advice and so forth.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You should note that the code has one non-Org dependency, a macro called &lt;code&gt;alist-put&lt;/code&gt; (which is essentially an alist-only backport of &lt;code&gt;map-put&lt;/code&gt; from map.el for use in Emacs 24).  Its source code is &lt;a href=&quot;https://bitbucket.org/apharris/emacs-init/src/9de9e17b5bc5cb4b133950839ca5991f637f8540/alist.el?at=default&amp;amp;fileviewer=file-view-default&quot; rel=&quot;nofollow&quot;&gt;elsewhere&lt;/a&gt; in the repository linked above and included in the code block below, or you can replace it with whatever similar idiom you desire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full source code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun alist--put (alist key value &amp;amp;optional test)&#xA;  &quot;Subroutine used by `alist-put'.&#xA;&#xA;As `alist-put', except back-assignment may be necessary, as with&#xA;`delete'.&quot;&#xA;  (let* ((test  (or test #'eql))&#xA;         (elt   (cl-assoc key alist :test test)))&#xA;    (if elt (setf (cdr elt) value)&#xA;      (setq alist (push (cons key value) alist)))&#xA;    alist))&#xA;&#xA;(defmacro alist-put (alist key value &amp;amp;optional test)&#xA;  &quot;Associate KEY with VALUE in ALIST.  Return ALIST.&#xA;&#xA;If ALIST does not already contain an association for KEY, it is&#xA;added; otherwise, the existing association is updated.&#xA;&#xA;If the optional parameter TEST is supplied, it is used in place&#xA;of `eql' to compare elements.&#xA;&#xA;Here, ALIST may be any generalized variable containing an alist.&quot;&#xA;  (declare (debug (gv-place form form &amp;amp;optional function-form)))&#xA;  `(setf ,alist (alist--put ,alist ,key ,value ,test)))&#xA;&#xA;(defcustom org-agenda-count-delimiter &quot;##&quot;&#xA;  &quot;String used to delimit the proxy for `org-agenda-count'.&quot;&#xA;  :group 'org-agenda&#xA;  :type  'string)&#xA;&#xA;(defvar org-agenda-count--alist nil&#xA;  &quot;Alist containing agenda block counts for `org-agenda-count'.&quot;)&#xA;&#xA;(defvar org-agenda-count--block nil&#xA;  &quot;Agenda block being counted for `org-agenda-count'.&quot;)&#xA;&#xA;(defun org-agenda-count (&amp;amp;optional block)&#xA;  &quot;Display a count of the number of items in this agenda block.&#xA;&#xA;For use in custom agenda commands, specifically with&#xA;`org-agenda-overriding-header'.  To use this function, call it&#xA;while constructing the value for `org-agenda-overriding-header'&#xA;and use the return value as if it were the number of items in&#xA;this block (before filtering by `org-agenda-max-entries' and&#xA;similar).&#xA;&#xA;The optional BLOCK parameter identifies the agenda block being&#xA;counted.  To count multiple blocks in the same agenda, each&#xA;invocation of `org-agenda-count' should have a different BLOCK&#xA;value.&#xA;&#xA;The actual return value is a proxy string incorporating the BLOCK&#xA;parameter.  This string is replaced with the actual value during&#xA;agenda construction.&quot;&#xA;  ;; Set up replacement process&#xA;  (setq org-agenda-count--block (or block &quot;&quot;))&#xA;  (alist-put org-agenda-count--alist&#xA;             org-agenda-count--block&#xA;             0&#xA;             #'equal)&#xA;  (advice-add 'org-agenda-finalize-entries :before #'org-agenda--count)&#xA;  (add-hook 'org-agenda-finalize-hook #'org-agenda-count--replace)&#xA;  ;; Return proxy value&#xA;  (concat org-agenda-count-delimiter&#xA;          org-agenda-count--block&#xA;          org-agenda-count-delimiter))&#xA;&#xA;(defun org-agenda--count (list &amp;amp;optional type)&#xA;  &quot;Count the number of entries in this block for `org-agenda-count'.&#xA;&#xA;Intended as (temporary) :before advice for the function&#xA;`org-agenda-finalize-hook'.&quot;&#xA;  (alist-put org-agenda-count--alist&#xA;             org-agenda-count--block&#xA;             (length list)&#xA;             #'equal))&#xA;&#xA;(defun org-agenda-count--regexp ()&#xA;  &quot;Return a regexp matching `org-agenda-count' proxy values.&quot;&#xA;  (let ((delim (regexp-quote org-agenda-count-delimiter)))&#xA;    (concat delim &quot;\\([^\n]*?\\)&quot; delim)))&#xA;&#xA;(defun org-agenda-count--reset ()&#xA;  &quot;Reset state variables used by `org-agenda-count'.&#xA;&#xA;This includes removing hook functions and temporary advice&#xA;functions.&quot;&#xA;  (setq org-agenda-count--alist nil&#xA;        org-agenda-count--block  nil)&#xA;  (advice-remove 'org-agenda-finalize-entries #'org-agenda--count)&#xA;  (remove-hook 'org-agenda-finalize-hook #'org-agenda-count--replace))&#xA;&#xA;(defun org-agenda-count--replace ()&#xA;  &quot;Replace `org-agenda-count' proxy values with entry counts.&#xA;&#xA;Intended for use in `org-agenda-finalize-hook'.&quot;&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward (org-agenda-count--regexp) nil :noerror)&#xA;      (let* ((block  (match-string 1))&#xA;             (count  (cdr (assoc block org-agenda-count--alist))))&#xA;        (when count (replace-match (format &quot;%d&quot; count)))))&#xA;    (org-agenda-count--reset)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-09-28T17:50:02.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27425" PostTypeId="1" AcceptedAnswerId="27440" CreationDate="2016-09-28T17:59:40.797" Score="3" ViewCount="162" Body="&lt;p&gt;&lt;code&gt;lispy-flow&lt;/code&gt; &lt;em&gt;almost&lt;/em&gt; does what I want. The problem is, though it descends into a parenthesized sexp, it does so only if that parenthesized sexp contains another parenthesized sexp. The fact that it skips over atoms is problematic: there are times when I want to go to the next sexp, regardless of whether it's parenthesized or a simple atom. &lt;code&gt;lispy-forward&lt;/code&gt; doesn't do what I want because it won't descend into an s-expression. What I really need is something analogous to hitting Space in an info manual: i.e., keep going to the next node, even when that means descending a level. Perhaps I've just overlooked it, but I haven't seen anything like that in lispy. &lt;code&gt;lispy-down&lt;/code&gt; isn't quite right because it skips over atoms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;forward-sexp&lt;/code&gt; is closer to what I want, I guess, as it won't skip atoms, but it doesn't descend into parenthesized sexp's. I guess I could live with this, since I can descend with &lt;code&gt;lispy-flow&lt;/code&gt;, then use &lt;code&gt;forward-sexp&lt;/code&gt; to move across the list, but &lt;code&gt;forward-sexp&lt;/code&gt; isn't even provided by lispy. Is it consistent with &quot;the lispy way&quot; to rely upon it when using lispy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the subject of &quot;the lispy way&quot;... I see that &lt;code&gt;lispy-ace-symbol&lt;/code&gt; can be used to mark (and position cursor on) a specific symbol within the list at point, and then j/k can be used to move the mark to different sexp's (including atoms) in the list. So perhaps I could get some of the functionality I need this way, though it seems a bit heavy-handed. I mean, if I'm planning to move a sexp around within the list, it makes sense, but if I just want to move cursor to an atom within a list (e.g., to modify a symbol, or perhaps to insert a new sexp just before or after it), I'll need to cancel the region mark, and perhaps reposition cursor to the other end of the atom before doing my editing. Also, there's the side-effect of changing the region, when all I wanted was to move the cursor. (Perhaps that's not really an issue. It may be only because I'm relatively new to emacs, but that sort of side-effect seemed problematic to me, if only from an aesthetic standpoint...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what's &quot;the lispy way&quot; to move cursor from outside a list to a specific element (possibly an atom) within the list for editing?&lt;/p&gt;&#xA;" OwnerUserId="13438" LastEditorUserId="105" LastEditDate="2016-09-29T00:19:22.003" LastActivityDate="2016-09-29T09:09:58.093" Title="Lispy movement commands that treat atoms and parenthesized s-expressions the same?" Tags="|paredit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27426" PostTypeId="2" ParentId="26225" CreationDate="2016-09-28T18:11:29.080" Score="11" Body="&lt;p&gt;Add the following to your emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq electric-pair-inhibit-predicate&#xA;      (lambda (c)&#xA;        (if (char-equal c ?\&quot;) t (electric-pair-default-inhibit c))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reference from my blog post: &lt;a href=&quot;https://www.topbug.net/blog/2016/09/29/emacs-disable-certain-pairs-for-electric-pair-mode/&quot; rel=&quot;noreferrer&quot;&gt;https://www.topbug.net/blog/2016/09/29/emacs-disable-certain-pairs-for-electric-pair-mode/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-09-29T06:25:09.997" LastActivityDate="2016-09-29T06:25:09.997" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27427" PostTypeId="1" AcceptedAnswerId="27432" CreationDate="2016-09-28T19:43:36.660" Score="4" ViewCount="370" Body="&lt;p&gt;I sometimes work on legacy code, and they have mixture of tabs and spaces. I use &lt;code&gt;whitespace-cleanup&lt;/code&gt; function in &lt;code&gt;whitespace.el&lt;/code&gt; to clean them up. But I have many files, so i want to run the command on all of them (excluding the .git directory). What is the implementation of this recursive function call in elisp? My seasonal elisp skill does not let me do it right away.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="105" LastEditDate="2016-09-29T01:21:58.227" LastActivityDate="2016-09-29T01:21:58.227" Title="Function to allow select a directory and run a command on its files, descending recursively?" Tags="|files|whitespace|mapping|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27428" PostTypeId="2" ParentId="26776" CreationDate="2016-09-28T20:08:29.767" Score="1" Body="&lt;p&gt;Imagemagick seems to be able to render PDF files, though apparently it is very slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, hovering the mouse over a filename calls the original &lt;code&gt;image-tooltip&lt;/code&gt; about a dozen times, making things even worse.  A solution could be to immediately put the image as a help-echo property, see below.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar image-tooltip-regexp (concat  &quot;\\(?3:'\\|\&quot;\\)\\(?1:.*\\.\\(?2:&quot;&#xA;                                      (regexp-opt '(&quot;png&quot; &quot;jpeg&quot; &quot;jpg&quot; &quot;eps&quot; &quot;pdf&quot;))&#xA;                                      &quot;\\)\\)\\(?:\\3\\)&quot;))&#xA;&#xA;(defvar image-tooltip-width 200)&#xA;&#xA;(defun image-tooltip-fontify (&amp;amp;optional limit)&#xA;  (while (re-search-forward image-tooltip-regexp nil t)&#xA;    (let* ((imgfile (expand-file-name (match-string-no-properties 1)))&#xA;           (imgtype (intern (downcase (match-string-no-properties 2))))&#xA;           (data-p (and (eq imgtype 'pdf)&#xA;                        (require 'pdf-tools nil t)))&#xA;           (data-or-file (if data-p&#xA;                             (pdf-info-renderpage 1 image-tooltip-width imgfile)&#xA;                           imgfile)))&#xA;      (when (file-exists-p imgfile)&#xA;        (with-silent-modifications&#xA;          (put-text-property&#xA;           (match-beginning 0)&#xA;           (match-end 0)&#xA;           'help-echo&#xA;           (propertize &quot; &quot; 'display&#xA;                       (create-image&#xA;                        data-or-file&#xA;                        'imagemagick&#xA;                        data-p&#xA;                        :width image-tooltip-width))))))))&#xA;&#xA;(font-lock-add-keywords nil&#xA;  `((image-tooltip-fontify)))&#xA;&#xA;(font-lock-fontify-buffer)&#xA;(setq x-gtk-use-system-tooltips nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-09-28T20:08:29.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27429" PostTypeId="1" AcceptedAnswerId="27434" CreationDate="2016-09-28T21:51:03.987" Score="1" ViewCount="131" Body="&lt;p&gt;In my line of work, I often have one document containing questions and another document containing answers.  How can I merge these documents in the form of Question/Answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUFFER #1:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Q1:  Do you like green eggs and ham?&#xA;Q2:  Would you like them here or there?&#xA;Q3:  Would you like them in a house?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BUFFER #2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A1:  I do not like them, Sam-I-am.&#xA;A2:  I would not like them here or there.&#xA;A3:  I do not like them in a house.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;DESIRED RESULT -- BUFFER #3:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Q1:  Do you like green eggs and ham?&#xA;A1:  I do not like them, Sam-I-am.&#xA;Q2:  Would you like them here or there?&#xA;A2:  I would not like them here or there.&#xA;Q3:  Would you like them in a house?&#xA;A3:  I do not like them in a house.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-09-29T03:37:54.023" Title="How to merge two buffers containing questions and answers" Tags="|list|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27430" PostTypeId="1" CreationDate="2016-09-28T21:54:45.997" Score="3" ViewCount="820" Body="&lt;p&gt;Emacs provides support for polymorphism, supporting &quot;generic functions&quot;, like in CLOS.&lt;br&gt;&#xA;According to Emacs manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A generic function specifies an abstract operation, by defining its&#xA;  name and list of arguments, but (usually) no implementation.  The actual&#xA;  implementation for several specific classes of arguments is provided by&#xA;  &quot;methods&quot;, which should be defined separately [...]&#xA;  by “specializing” the arguments defined by the generic function.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the manual does not give practical examples of a methods implementation once a generic function is defined. &#xA;Can you give such an example, implementing the standard OO paradigms through &lt;code&gt;cl-defgeneric&lt;/code&gt;/&lt;code&gt;cl-defmethod&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-09-30T10:11:26.983" LastActivityDate="2016-09-30T10:11:26.983" Title="Defining a generic function and implementing specialised methods" Tags="|functions|cl-lib|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="27431" PostTypeId="1" CreationDate="2016-09-28T23:31:17.897" Score="0" ViewCount="494" Body="&lt;p&gt;Emacs has recently (between 24.0 and 25 ish?) removed iswitchb in favor of some combination of ido and icomplete mode, which I've seen claims are 99% compatible; which I can live with, I don't have any sort of fancy custom hooks or anything just a few excludes here and there. But I can't seem to figure out how to make the &quot;new&quot; modes work the way iswitchb did.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When trying to open a new file with &lt;kbd&gt;C-x f&lt;/kbd&gt; or &lt;kbd&gt;C-x C-v&lt;/kbd&gt; I often get stuck with extra garbage on one or both ends of the path I'm trying to navigate to, (either the path prefix is in a weird green mode and behaves oddly when trying to navigate or edit characters or text persists to the right of the point and interferes with suggestions. Or at times I only get suggestions for directories even when there are files present (I have multiple times had to type the entire path and file name and hit enter to open a file as it wouldn't complete at all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how do I get the iswitchb style behavior back?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a specific repeatable occurrence of one problem: I have a file open in a buffer, and hit &lt;kbd&gt;C-x C-f&lt;/kbd&gt; to find a new file, the path to the buffer's current file's directory is pre-filled in the mini-buffer and is the colour of the mini-buffer prompt instead of the colour of the text you type (green instead of white for me), if I paste/yank/whatever in a relative path, the new text is white and ido (or icomplete or whatever is handling the completion in this case) cannot find the file. What's more; often there is some overlap at the end of the pre-filled portion of the path and the new text added, so I need to edit at that point, however pressing alt-b deletes directories off the end of the pre-filled section instead of moving the point and the new text is lost too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open file at ~/Developer/lisp/cool_file.el&lt;/li&gt;&#xA;&lt;li&gt;copy the path to another file in another terminal tab or where-ever.&#xA;eg: &lt;code&gt;ruby/other_cool_file.rb&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;press &lt;kbd&gt;C-x C-f&lt;/kbd&gt; in emacs to find a new file&lt;/li&gt;&#xA;&lt;li&gt;the mini-buffer will show the following:&#xA;&lt;code&gt;Find file: ~/Developer/lisp/&lt;/code&gt; in the mini-buffer's &quot;prompt&quot; colour&lt;/li&gt;&#xA;&lt;li&gt;paste in the new path&#xA;&lt;code&gt;Find file: ~/Developer/lisp/ruby/other_cool_file.rb [No match]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;the pasted path will be the regular colour of mini-buffer input and the file will not be found even if the path is correct as is. (hitting return will clear the pre-filled path completely and replace it with the pasted path, which won't find anything either.&lt;/li&gt;&#xA;&lt;li&gt;if there needs to be some change made at the point between the two styles of text in the mini-buffer, pressing alt-b to get to that point will not move the point as expected but instead remove the rightmost prompt-coloured directory from the pre-filled path and delete the new path that you pasted in.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Obviously I'd like to have the file be found when the path is correct as entered and be able to navigate the mini-buffer as normal.&lt;/p&gt;&#xA;" OwnerUserId="13474" LastEditorUserId="13474" LastEditDate="2016-10-25T18:49:44.910" LastActivityDate="2016-11-25T17:27:23.570" Title="How can I make icomplete/ido behave like iswitchb?" Tags="|buffers|ido|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27432" PostTypeId="2" ParentId="27427" CreationDate="2016-09-29T00:16:32.783" Score="3" Body="&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;Dired+&lt;/a&gt; offers a bunch of commands that let you act on the marked files and the files marked in marked subdirectories, defined recursively. These commands have names like &lt;code&gt;diredp-*-recursive&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also the case that you can insert any subdirs (and subsubdirs etc.) into the same Dired buffer, and then act on marked files there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the Dired+ commands is &lt;code&gt;diredp-do-apply-function-recursive&lt;/code&gt;, bound to &lt;strong&gt;&lt;code&gt;M-+ @&lt;/code&gt;&lt;/strong&gt;.  It lets you apply an Emacs-Lisp function to each of the marked files, defined recursively (see above).  Define a function that does what you want to do to &lt;em&gt;one&lt;/em&gt; file, and then you can use &lt;code&gt;M-+ @&lt;/code&gt; to apply it to all of the marked files (defined recursively).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;diredp-do-apply-function-recursive&lt;/strong&gt; is an interactive compiled Lisp&#xA;      function in &lt;code&gt;dired+.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(diredp-do-apply-function-recursive FUNCTION &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Apply FUNCTION to the marked files.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Like &lt;code&gt;diredp-do-apply-function&lt;/code&gt; but act recursively on subdirs.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The files acted on are those that are marked in the current Dired&#xA;      buffer, or all files in the directory if none are marked.  Marked&#xA;      subdirectories are handled recursively in the same way.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With a plain prefix ARG (&lt;code&gt;C-u&lt;/code&gt;), visit each file and invoke FUNCTION&#xA;       with no arguments.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Otherwise, apply FUNCTION to each file name.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Any other prefix arg behaves according to the ARG argument of&#xA;      &lt;code&gt;dired-get-marked-files&lt;/code&gt;.  In particular, &lt;code&gt;C-u C-u&lt;/code&gt; operates on all&#xA;      files in the Dired buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As you can see from that doc string, another command, &lt;strong&gt;&lt;code&gt;diredp-do-apply-function&lt;/code&gt;&lt;/strong&gt;, does the same thing, but only in the current Dired buffer.  It is bound &lt;strong&gt;&lt;code&gt;@&lt;/code&gt;&lt;/strong&gt;.  Use it if all of the files you want to act on are in the same Dired buffer (e.g., because you inserted their directories there). &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-09-29T00:16:32.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27433" PostTypeId="1" CreationDate="2016-09-29T01:09:41.310" Score="0" ViewCount="1186" Body="&lt;p&gt;So apparently org-babel is evaluating python code inside its own function, perhaps when calling the interpreter or to be able to return the &lt;code&gt;#+RESULTS:&lt;/code&gt; I guess. How to instruct it to evaluate the same way that the python mode does (say &lt;code&gt;C-c '&lt;/code&gt; and &lt;code&gt;C-c C-c&lt;/code&gt;) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Begin_src python&#xA;from math import *&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluating to python3 directly from org spits in &lt;code&gt;Org-Babel Error Output&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 2 &#xA;SyntaxError: import * only allowed at module level &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Python 2.7 being more permissive, illustrating the situation called for a different example &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Begin_src python &#xA;from Tkinter import *&#xA;&#xA;class MainWindow():&#xA;   def __init__(self,parent):&#xA;        # the following line stumbles on the problem&#xA;        Frame(self , parent)            &#xA;        pass&#xA;&#xA;Tk()&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure there's an option to bypass the case. What could it be ?&lt;/p&gt;&#xA;" OwnerUserId="13477" LastActivityDate="2016-09-30T02:20:32.690" Title="Evaluating python block at module level" Tags="|org-babel|python|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27434" PostTypeId="2" ParentId="27429" CreationDate="2016-09-29T01:50:53.837" Score="2" Body="&lt;p&gt;If I would do that, copy&amp;amp;paste both Q&amp;amp;As into a new buffer (&lt;code&gt;#3&lt;/code&gt;) then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Q1:  Do you like green eggs and ham?&#xA;Q2:  Would you like them here or there?&#xA;Q3:  Would you like them in a house?&#xA;A1:  I do not like them, Sam-I-am.&#xA;A2:  I would not like them here or there.&#xA;A3:  I do not like them in a house.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;do the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;beginning-of-buffer (M-&amp;lt;)&#xA;kmacro-start-macro (f3)&#xA;    next-line x3 (3 C-n)&#xA;    kill-whole-line (C-S-BS)&#xA;    previous-line x2 (2 C-p)&#xA;    yank (C-y)&#xA;kmacro-end-macro (f4)&#xA;kmacro-call-macro x2 (2 f4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you often need to do this then to implement a function may be an option:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (let ((Qs (with-current-buffer &quot;#1&quot; (split-string (buffer-string) &quot;\n&quot;)))&#xA;        (As (with-current-buffer &quot;#2&quot; (split-string (buffer-string) &quot;\n&quot;))))&#xA;    (with-current-buffer (get-buffer-create &quot;#3&quot;)&#xA;      (dolist (Q Qs)&#xA;        (insert Q &quot;\n&quot;)&#xA;        (insert (pop As) &quot;\n&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12049" LastEditorUserId="2287" LastEditDate="2016-09-29T03:37:54.023" LastActivityDate="2016-09-29T03:37:54.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27435" PostTypeId="2" ParentId="27401" CreationDate="2016-09-29T02:35:21.223" Score="3" Body="&lt;p&gt;Use &lt;code&gt;setf&lt;/code&gt; instead of &lt;code&gt;setq&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf (foo-name bar) 'jim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5415" LastEditorUserId="5415" LastEditDate="2016-09-29T02:50:38.227" LastActivityDate="2016-09-29T02:50:38.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27436" PostTypeId="1" AcceptedAnswerId="27446" CreationDate="2016-09-29T06:32:16.403" Score="0" ViewCount="513" Body="&lt;p&gt;I'm trying to use global-set-key to bind commands &quot;&lt;code&gt;:x&lt;/code&gt;&quot; as save and close, just like the way vim do. Right now I'm doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;S-; x&quot;) (lambda() (kbd &quot;C-x C-s&quot;) (kill-emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I type Shift+: and then x, it just write :x in the documents instead of really doing save and close. Wondering what should be the right form?&lt;/p&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="12577" LastEditDate="2016-09-29T08:18:34.970" LastActivityDate="2016-09-29T14:01:25.553" Title="Setting key problem: save and close just like vim" Tags="|key-bindings|keyboard-macros|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27438" PostTypeId="1" CreationDate="2016-09-29T08:44:16.713" Score="1" ViewCount="144" Body="&lt;p&gt;The children of a heading at point can be sorted alphabetically&#xA;with &lt;code&gt;C-c ^ a&lt;/code&gt;.  Can this sorting method be customized?&#xA;What I want is to sort Greek words according to their Latin&#xA;translitteration.  For instance, I want κατά to be sorted as&#xA;if it were 'kata'.&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2016-09-29T12:56:13.240" Title="Org mode customized alphabetic sorting" Tags="|org-mode|sorting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27439" PostTypeId="2" ParentId="27436" CreationDate="2016-09-29T08:51:24.467" Score="1" Body="&lt;p&gt;This should do the trick. Just add this to your &lt;code&gt;.emacs&lt;/code&gt; and bind it to a key and you're done&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun save-all-and-quit ()&#xA;  (interactive)&#xA;  (save-some-buffers t)&#xA;  (kill-emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is considering you want to save all buffers without prompting interactively for &lt;code&gt;yes&lt;/code&gt; or &lt;code&gt;no&lt;/code&gt; for all the unsaved buffers. &lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-09-29T09:20:40.103" LastActivityDate="2016-09-29T09:20:40.103" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27440" PostTypeId="2" ParentId="27425" CreationDate="2016-09-29T09:09:58.093" Score="2" Body="&lt;p&gt;The only way to navigate and manipulate atoms in lispy is to mark them&#xA;with a region. This is because if the point is around the item and the&#xA;region is not active, the alpha keys should self-insert instead of&#xA;calling commands.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Sexps example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Start with (&lt;code&gt;|&lt;/code&gt; is the point):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|(progn&#xA;  (foo)&#xA;  (bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Press &lt;kbd&gt;fs&lt;/kbd&gt; to get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (bar)&#xA;  |(foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Equivalent atoms example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Start with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|(list&#xA; foo&#xA; bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Press &lt;kbd&gt;mijs&lt;/kbd&gt; to get (&lt;code&gt;~&lt;/code&gt; is the mark):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list&#xA; bar&#xA; ~foo|)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, &lt;kbd&gt;2ms&lt;/kbd&gt; works the same, since &lt;kbd&gt;2m&lt;/kbd&gt; marks the second element.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-09-29T09:09:58.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27441" PostTypeId="1" CreationDate="2016-09-29T12:30:52.720" Score="0" ViewCount="58" Body="&lt;p&gt;I have downloaded file &lt;code&gt;ido.el&lt;/code&gt;, but can't load it.  When I &lt;code&gt;(require 'ido)&lt;/code&gt; the following is displayed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;No such file or directory&quot; &quot;seq&quot;)&#xA;  require(seq)&#xA;  eval-buffer(# nil &quot;/home/admin/.emacs.d/ido.el&quot; nil t)  ; Reading at buffer position 13523&#xA;  load-with-code-conversion(&quot;/home/admin/.emacs.d/ido.el&quot; &quot;/home/admin/.emacs.d/ido.el&quot; nil t)&#xA;  require(ido)&#xA;  eval((require (quote ido)) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/b&gt;&#xA;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is with &lt;i&gt;GNU Emacs 24.4.1&lt;/i&gt;&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="9995" LastEditDate="2016-09-29T12:46:53.680" LastActivityDate="2016-09-29T13:12:21.767" Title="Failed to load ido.el" Tags="|ido|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27442" PostTypeId="2" ParentId="27438" CreationDate="2016-09-29T12:56:13.240" Score="1" Body="&lt;p&gt;According to &lt;code&gt;org-sort-entries&lt;/code&gt; docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-sort-entries &amp;amp;optional WITH-CASE SORTING-TYPE GETKEY-FUNC&#xA;  COMPARE-FUNC PROPERTY)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The command prompts for the sorting type unless it has been given to the&#xA;  function through the SORTING-TYPE argument, which needs to be a character,&#xA;  (?n ?N ?a ?A ?t ?T ?s ?S ?d ?D ?p ?P ?o ?O ?r ?R ?f ?F ?k ?K).  Here is&#xA;  the precise meaning of each character:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies a function to be&#xA;  called with point at the beginning of the record.  It must return either&#xA;  a string or a number that should serve as the sorting key for that record.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it seems you could use ?f as SORTING-TYPE and give as GETKEY-FUNC a function returning the latin transliteration of its greek word argument.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-09-29T12:56:13.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27444" PostTypeId="1" CreationDate="2016-09-29T13:04:38.097" Score="0" ViewCount="106" Body="&lt;p&gt;I'm looking through &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/startup.el&quot; rel=&quot;nofollow&quot;&gt;startup.el&lt;/a&gt;, and normal-top-level-add-subdirs-to-load-path references the &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/startup.el#L448&quot; rel=&quot;nofollow&quot;&gt;default-directory&lt;/a&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the value of that variable during startup? I searched for calls to normal-top-level-add-subdirs-to-load-path and only found a 2-line file site-lisp/subdirs.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (fboundp 'normal-top-level-add-subdirs-to-load-path)&#xA;    (normal-top-level-add-subdirs-to-load-path))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried inserting some debugging statements to get more insight, but so far they haven't worked. First I tried adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;%s&quot; default-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and byte recompiling the file. Restarted Emacs but I saw no trace of my debugging in the Messages buffer. Then I replaced the above line with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-file &quot;/Users/ivan/emacswhereami&quot;&#xA;  '(insert default-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-09-29T13:38:51.330" LastActivityDate="2016-09-29T13:38:51.330" Title="What's the value of default-directory during startup?" Tags="|start-up|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27445" PostTypeId="2" ParentId="27441" CreationDate="2016-09-29T13:12:21.767" Score="2" Body="&lt;p&gt;Ido is part of Emacs since Emacs 22, you can (and should) load it without any setup. Emacs 24 can or can't load Emacs 25's &lt;code&gt;ido.el&lt;/code&gt;. The backtrace complains: can't load &lt;code&gt;seq&lt;/code&gt;. &lt;code&gt;seq&lt;/code&gt; is added from Emacs 25.1. You can install &lt;code&gt;seq&lt;/code&gt; on Emacs 24. However, if you want to use a newer version of Ido, I think you should use a newer version of Emacs.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-09-29T13:12:21.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27446" PostTypeId="2" ParentId="27436" CreationDate="2016-09-29T14:01:25.553" Score="5" Body="&lt;p&gt;There is a function that does this already:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(save-buffers-kill-emacs &amp;amp;optional ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Offer to save each buffer, then kill this Emacs process.&#xA;  With prefix ARG, silently save all file-visiting buffers without asking.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can call it interactively with &lt;code&gt;C-u M-x save-buffers-kill-emacs&lt;/code&gt; and all files are saved without asking you and emacs quits, problem solved!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your keybinding didn't work for two reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;(kbd &quot;S-;&quot;)&lt;/code&gt; is not shifted &quot;;&quot; (i.e., &quot;:&quot;), it is &quot;;&quot; with the Super bit on. To bind to &quot;:&quot; just use &quot;:&quot; like this - &lt;code&gt;(kbd &quot;:&quot;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&quot;:&quot; is not a prefix key, so you can't use it in a chain &lt;code&gt;(kbd &quot;: x&quot;)&lt;/code&gt; without further changes. Either you need to define a prefix-map  and bind it to &quot;:&quot; (see below), or investigate some other approach.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So, to get a save-all-and-quit bound to a key, the easiest solution is probably:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c x&quot;) &#xA;    (lambda () &#xA;        (interactive) &#xA;        (save-buffers-kill-emacs t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here the function is bound to &lt;code&gt;C-c x&lt;/code&gt;, but you can change it to anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to use &quot;:&quot; as a prefix, you'd do something like this:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'my-keymap)&#xA;(global-set-key &quot;:&quot; my-keymap)&#xA;&#xA;;; define kill-emacs:&#xA;(define-key my-keymap &quot;x&quot; (lambda () &#xA;        (interactive) &#xA;        (save-buffers-kill-emacs t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, of course, you've lost use of the : key for entering the &quot;:&quot; character. You can get it back by adding it to your keymap:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key my-keymap &quot;:&quot; 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now entering &lt;code&gt;: x&lt;/code&gt; will save all buffers and kill emacs, and &lt;code&gt;: :&lt;/code&gt; will enter a &quot;:&quot;.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-09-29T14:01:25.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27447" PostTypeId="2" ParentId="27430" CreationDate="2016-09-29T14:09:51.450" Score="4" Body="&lt;p&gt;An attempt...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-generic)&#xA;&#xA;;; Checking accounts can have a negative balance&#xA;;; Savings accounts can't&#xA;(cl-defstruct checking-account balance)&#xA;(cl-defstruct savings-account balance)&#xA;&#xA;;; A generic `withdraw' method&#xA;(cl-defgeneric withdraw (account amount)    &#xA;  (:documentation &quot;Withdraw AMOUNT from ACCOUNT balance.&#xA;Give an error for savings accounts where balance &amp;lt; AMOUNT&quot;))&#xA;&#xA;;; Implementation of `withdraw' for checking accounts&#xA;(cl-defmethod withdraw ((account checking-account) amount)&#xA;  (cl-decf (checking-account-balance account) amount))&#xA;&#xA;;; Implementation of `withdraw' for savings accounts&#xA;(cl-defmethod withdraw ((account savings-account) amount)&#xA;  (when (&amp;lt; (savings-account-balance account) amount)&#xA;    (error &quot;Account overdrawn.&quot;))&#xA;  (cl-decf (savings-account-balance account) amount))&#xA;&#xA;;; Account instantiations, i.e. creation of account objects  &#xA;(setq x (make-checking-account :balance 50))&#xA;(setq y (make-savings-account :balance 50))&#xA;&#xA;;; Withdraw amounts from accounts &#xA;(withdraw x 60) ; =&amp;gt; - 10&#xA;(withdraw y 60) ; =&amp;gt; (error &quot;Account overdrawn.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html&quot; rel=&quot;nofollow&quot;&gt;gigamonkeys.com&lt;/a&gt; for Common Lisp.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-09-29T14:09:51.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27449" PostTypeId="1" CreationDate="2016-09-29T15:50:13.870" Score="1" ViewCount="271" Body="&lt;p&gt;When Emacs executes &lt;code&gt;call-process&lt;/code&gt; after the focus has moved to another window (this is after a compilation step which takes some time to finish) it grabs the focus and causes the pointer to move to the upper-right of the Emacs frame. This is on Linux using gnome-shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to disable this behavior? Either globally or on a per-call basis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Found it. The frame was being explicitly set by &lt;code&gt;select-frame-set-input-focus&lt;/code&gt; in a function that I was adding to &lt;code&gt;compilation-finish-function&lt;/code&gt;. I should understand the code I copy-and-paste a little better.&lt;/p&gt;&#xA;" OwnerUserId="10513" LastEditorUserId="10513" LastEditDate="2016-09-29T16:16:59.490" LastActivityDate="2016-09-29T16:16:59.490" Title="Prevent call-process from stealing focus" Tags="|focus|call-process|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27450" PostTypeId="1" CreationDate="2016-09-29T16:24:01.023" Score="0" ViewCount="228" Body="&lt;p&gt;I'm using &lt;code&gt;org-mode&lt;/code&gt; and &lt;code&gt;visual-line-mode&lt;/code&gt; with Spacemacs by pressing &lt;code&gt;&amp;lt;SPC&amp;gt; t l&lt;/code&gt;.  However, when I do this I get strange behavior, possibly due to the visual indenting of lines.  As I move between lines, the cursor seems to jump all over the place.  I've recorded a short video of it that you can see below. You can see as I move down (&lt;code&gt;j&lt;/code&gt;) the lines, especially from the first row of a paragraph to the second, the cursor jumps. Also, as I move up (&lt;code&gt;k&lt;/code&gt;), occasionally the cursor will skip a line.  How do I make these two modes play nice with each other?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gfycat.com/SpicyGiganticAmazontreeboa&quot; rel=&quot;nofollow&quot;&gt;https://gfycat.com/SpicyGiganticAmazontreeboa&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2016-09-29T16:24:01.023" Title="Spacemacs/org-mode/visual line bug" Tags="|org-mode|spacemacs|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27452" PostTypeId="2" ParentId="12345" CreationDate="2016-09-29T17:48:03.803" Score="1" Body="&lt;p&gt;I solved this with the following overloaded function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun cd (dir)&#xA;  &quot;Make DIR become the current buffer's default directory.&#xA;If your environment includes a `CDPATH' variable, try each one of&#xA;that list of directories (separated by occurrences of&#xA;`path-separator') when resolving a relative directory name.&#xA;The path separator is colon in GNU and GNU-like systems.&quot;&#xA;  (interactive&#xA;   (list&#xA;    ;; FIXME: There's a subtle bug in the completion below.  Seems linked&#xA;    ;; to a fundamental difficulty of implementing `predicate' correctly.&#xA;    ;; The manifestation is that TAB may list non-directories in the case where&#xA;    ;; those files also correspond to valid directories (if your cd-path is (A/&#xA;    ;; B/) and you have A/a a file and B/a a directory, then both `a' and `a/'&#xA;    ;; will be listed as valid completions).&#xA;    ;; This is because `a' (listed because of A/a) is indeed a valid choice&#xA;    ;; (which will lead to the use of B/a).&#xA;    (minibuffer-with-setup-hook&#xA;        (lambda ()&#xA;          (setq minibuffer-completion-table&#xA;                (apply-partially #'locate-file-completion-table&#xA;                                 cd-path nil))&#xA;          (setq minibuffer-completion-predicate&#xA;                (lambda (dir)&#xA;                  (locate-file dir cd-path nil&#xA;                               (lambda (f) (and (file-directory-p f) 'dir-ok))))))&#xA;      (unless cd-path&#xA;        (setq cd-path (or (parse-colon-path (getenv &quot;CDPATH&quot;))&#xA;                          (list &quot;./&quot;))))&#xA;      (read-directory-name &quot;Change default directory: &quot;&#xA;                           default-directory default-directory&#xA;                           t))))&#xA;  (unless cd-path&#xA;    (setq cd-path (or (parse-colon-path (getenv &quot;CDPATH&quot;))&#xA;                      (list &quot;./&quot;))))&#xA;  (cd-absolute&#xA;   (or (locate-file dir (cons default-directory cd-path) nil&#xA;                    (lambda (f) (and (file-directory-p f) 'dir-ok)))&#xA;       (error &quot;No such directory found via CDPATH environment variable&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This prepends, in the 3rd from last line, &lt;code&gt;default-directory&lt;/code&gt; to the cdpath (default &lt;code&gt;(&quot;./&quot;)&lt;/code&gt;), which works around what appears to be a bug with Windows Emacs &lt;code&gt;locate-file-internal&lt;/code&gt;. It may have unforseen side-effects!&lt;/p&gt;&#xA;" OwnerUserId="13486" LastActivityDate="2016-09-29T17:48:03.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27453" PostTypeId="1" CreationDate="2016-09-29T18:55:23.673" Score="0" ViewCount="881" Body="&lt;p&gt;I have just upgraded to Emacs 25 (windows 32-bit version on Windows 10), and found out that there are still quite a few things to smooth out.&#xA;One includes potentially the PNG background not being transparent.&#xA;On Emacs 25:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/FPTrr.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FPTrr.jpg&quot; alt=&quot;Emacs 25&quot;&gt;&lt;/a&gt;&#xA;On Emacs 24:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/dj75H.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dj75H.jpg&quot; alt=&quot;Emacs 24&quot;&gt;&lt;/a&gt;&#xA;Or is it just me due to my settings? By the way they're using the same .emacs init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, also my Emacs 24 starts in about 5 seconds, while the new Emacs 25 takes about 8 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope there can be some tips from members here. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="6942" LastEditorUserId="105" LastEditDate="2016-09-29T19:56:24.860" LastActivityDate="2017-01-05T18:14:13.443" Title="Emacs 25 png background transparency issue and sluggish init" Tags="|start-up|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27454" PostTypeId="1" CreationDate="2016-09-29T19:53:58.727" Score="2" ViewCount="1482" Body="&lt;p&gt;In yasnippet's manual expansion of snippet inside a snippet is mentioned but I wasn't able to achieve this.&#xA;Can someone tell me what I'm doing wrong ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two snippets :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: newhist&#xA;# key: newhist&#xA;# expand-env: ((yas-triggers-in-field 't))&#xA;# --&#xA;${1:-- }----------------------------------------------------------------------------&#xA;${2:_head}$2&#xA;$1Objet        : ${4:Objet}$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: _head&#xA;# key: _head&#xA;# --&#xA;${1:-- }Auteur       : `(and (boundp 'user-ngram) user-ngram)`&#xA;$1Date         : `(capitalize (format-time-string &quot;%d/%m/%Y&quot;))`&#xA;$1Version      : `(and (boundp 'global-release) global-release)`.00.${2:0001}$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I expect something like that after expansion :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-- ----------------------------------------------------------------------------&#xA;-- Auteur       : me&#xA;-- Date         : 29/09/2016&#xA;-- Version      : 513.00.0001&#xA;-- Objet        : Objet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But all I get is :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-- ----------------------------------------------------------------------------&#xA;_head_head&#xA;-- Objet        : Objet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13155" LastActivityDate="2023-02-23T11:50:13.513" Title="yasnippet : How to expand snippet inside snippet?" Tags="|yasnippet|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27456" PostTypeId="1" CreationDate="2016-09-29T20:04:08.150" Score="1" ViewCount="525" Body="&lt;p&gt;I'd like to have my Emacs frame setup with a neotree window on the left, my active source code or text file taking up the majority of window's space.&#xA;I'd like to have Emacs put virtually all other windows at the bottom of the window space (&lt;em&gt;messages&lt;/em&gt; buffer, REPL's, compilation logs, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been researching display-buffer-alist and so forth but I'm new to customizing Emacs so my grasp of terminology my incomplete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some combination of display-buffer-alist settings or some elisp that can maintain this setup as I work?&lt;/p&gt;&#xA;" OwnerUserId="12436" LastActivityDate="2016-09-29T20:04:08.150" Title="Setting up an maintaining my window layout" Tags="|window|display-buffer-alist|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27457" PostTypeId="1" CreationDate="2016-09-29T21:51:54.757" Score="3" ViewCount="2398" Body="&lt;p&gt;Update: As of early October 2016 emacs for windows does not support ImageMagick versions 7.x or greater as discussed &lt;a href=&quot;https://sourceforge.net/p/emacsbinw64/discussion/general/thread/f3f2cfdf/?limit=25&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://lists.gnu.org/archive/html/emacs-devel/2016-10/msg00011.html&quot; rel=&quot;nofollow&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presumably some combination of an earlier version of emacs for windows and ImageMagick prior to version 7.x should work. Is anybody using emacs for windows with functioning ImageMagick support (resizing images etc.)? If so,  please let us know which versions of each you are using.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I want to resize images displayed inline in org mode. Apparently this requires Emacs to be compiled with Imagemagick. I need Emacs for windows, but have not found a version compiled with Imagemagick. Can someone point me to a version of Emacs for windows compiled with Imagemagick?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have to build a version myself, I noticed the official &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/nt/INSTALL.W64&quot; rel=&quot;nofollow&quot;&gt;nt/insall.64&lt;/a&gt; claims:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;we need to disable Imagemagick because Emacs does not yet support it&#xA;  on Windows.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is this still true?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, my version of Emacs for windows does have support to display images, but it is unable to resize images.&lt;/p&gt;&#xA;" OwnerUserId="9382" LastEditorUserId="9382" LastEditDate="2016-10-06T14:44:35.927" LastActivityDate="2017-11-29T16:47:10.303" Title="Imagemagick not supported in Emacs on windows?" Tags="|images|inline-image|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27458" PostTypeId="2" ParentId="27433" CreationDate="2016-09-29T22:17:01.520" Score="1" Body="&lt;p&gt;As stated in the &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/intro.html#orgheadline14&quot; rel=&quot;nofollow&quot;&gt;babel introduction&lt;/a&gt; : Setting the system wide header argument &lt;code&gt;:session&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;run an interactive session as an &quot;inferior process&quot; within Emacs. This&#xA;  means that an environment is created containing data objects that&#xA;  persist between different source code blocks.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Also, in non-session mode, the python code block will be wrapped in a&#xA;  function&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="13477" LastEditorUserId="13477" LastEditDate="2016-09-30T02:20:32.690" LastActivityDate="2016-09-30T02:20:32.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27459" PostTypeId="1" AcceptedAnswerId="27482" CreationDate="2016-09-29T23:36:56.783" Score="2" ViewCount="544" Body="&lt;p&gt;I have put the following code (partially adapted from &lt;a href=&quot;https://github.com/company-mode/company-mode/issues/530#issuecomment-226566961&quot; rel=&quot;nofollow noreferrer&quot;&gt;a &lt;code&gt;company-mode&lt;/code&gt; issue&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/q/13286/12534&quot;&gt;a Stack Exchange question&lt;/a&gt;) in &lt;a href=&quot;https://github.com/raxod502/radian/blob/7ae63a1295a68cc9796e558dfbabe42357c0bcc8/init.el#L487&quot; rel=&quot;nofollow noreferrer&quot;&gt;my &lt;code&gt;init.el&lt;/code&gt;&lt;/a&gt; in order to adjust the keybindings active in the &lt;code&gt;company-mode&lt;/code&gt; completions menu:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun company-complete-if-explicit ()&#xA;  &quot;Complete the current selection, but only if the user has interacted&#xA;explicitly with Company.&quot;&#xA;  (interactive)&#xA;  (if (company-explicit-action-p)&#xA;      (company-complete)&#xA;    (call-interactively&#xA;     (key-binding (this-command-keys)))))&#xA;&#xA;(define-key company-active-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) #'company-complete-if-explicit)&#xA;(define-key company-active-map (kbd &quot;RET&quot;) #'company-complete-if-explicit)&#xA;(define-key company-active-map (kbd &quot;TAB&quot;) #'company-complete-selection)&#xA;(define-key company-active-map (kbd &quot;SPC&quot;) nil)&#xA;&#xA;(setq company-auto-complete-chars nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In terminal Emacs, pressing &lt;code&gt;RET&lt;/code&gt; will dismiss the completions menu and insert a newline. However, if I have explicitly interacted with the menu (for instance, using &lt;code&gt;up&lt;/code&gt; and &lt;code&gt;down&lt;/code&gt;), then &lt;code&gt;RET&lt;/code&gt; will instead insert the selected completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that this doesn't work in windowed Emacs: if I press &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt; while the completions menu is showing (but I &lt;em&gt;haven't&lt;/em&gt; explicitly interacted with it), then instead of Emacs inserting a newline, I receive the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument commandp nil)&#xA;  call-interactively(nil)&#xA;  (if (company-explicit-action-p) (company-complete) (call-interactively (key-binding (this-command-keys))))&#xA;  company-complete-if-explicit()&#xA;  call-interactively(company-complete-if-explicit nil nil)&#xA;  command-execute(company-complete-if-explicit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I debugged this, and here is what I think is happening:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In windowed Emacs, the Return key sends &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt; instead of &lt;code&gt;RET&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Only &lt;code&gt;RET&lt;/code&gt; has a binding (to &lt;code&gt;newline&lt;/code&gt;), but normally &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt; is translated automatically to &lt;code&gt;RET&lt;/code&gt;, so the Return key still inserts a newline in windowed Emacs.&lt;/li&gt;&#xA;&lt;li&gt;When I call &lt;code&gt;this-command-keys&lt;/code&gt; in &lt;code&gt;company-complete-if-explicit&lt;/code&gt;, the returned value is &lt;code&gt;&amp;lt;return&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;key-binding&lt;/code&gt; function does not appear to do the key translation that usually occurs, so that &lt;code&gt;(key-binding (kbd &quot;RET&quot;))&lt;/code&gt; is &lt;code&gt;newline&lt;/code&gt; but &lt;code&gt;(key-binding (kbd &quot;&amp;lt;return&amp;gt;&quot;))&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The error is thrown because &lt;code&gt;nil&lt;/code&gt; is then passed to &lt;code&gt;call-interactively&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My question is therefore: what is the best way to fix this problem (either by making &lt;code&gt;key-binding&lt;/code&gt; perform automatic translations, or otherwise)?&lt;/p&gt;&#xA;" OwnerUserId="12534" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-10-01T01:47:55.017" Title="(key-binding (this-command-keys)) not translating keybindings" Tags="|key-bindings|company-mode|keymap|functions|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27460" PostTypeId="2" ParentId="27382" CreationDate="2016-09-30T00:55:46.950" Score="0" Body="&lt;p&gt;How about you use shell-command to call diff, passing it an output buffer? Or, shell-command-to-string to get the diff in a string&lt;/p&gt;&#xA;" OwnerUserId="13489" LastActivityDate="2016-09-30T00:55:46.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27461" PostTypeId="1" AcceptedAnswerId="27630" CreationDate="2016-09-30T03:11:58.443" Score="10" ViewCount="2024" Body="&lt;p&gt;I'm using ssh to connect to a remote server. On the server there is a git repo called &lt;code&gt;MRFLSSVM&lt;/code&gt;. However, when I execute &lt;code&gt;magit-status&lt;/code&gt; on:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/ssh:qmServer:/home/Chang/qmCodeLab/MRFLSSVM/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Magit asks me to &lt;code&gt;Create repository in /ssh:qmServer:/home/Chang/qmCodeLab/MRFLSSVM/?&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how to let magit recognize that repo? (I've already installed git 2.10.0 on /usr/local/git and configured my system (CentOS) to use it by update-alternatives)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-----------Edit------------------------------&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error (magit): Magit requires Git &amp;gt;= 1.9.4, you are using 1.8.3.&#xA;&#xA;If this comes as a surprise to you, because you do actually have&#xA;a newer version installed, then that probably means that the&#xA;older version happens to appear earlier on the `$PATH'.  If you&#xA;always start Emacs from a shell, then that can be fixed in the&#xA;shell's init file.  If you start Emacs by clicking on an icon,&#xA;or using some sort of application launcher, then you probably&#xA;have to adjust the environment as seen by graphical interface.&#xA;For X11 something like ~/.xinitrc should work.&#xA;&#xA;If you use Tramp to work inside remote Git repositories, then you&#xA;have to make sure a suitable Git is used on the remote machines&#xA;too.&#xA;&#xA;Error (magit): Magit requires Git &amp;gt;= 1.9.4, but on /ssh:qmServer: the version is 1.8.3.&#xA;&#xA;If multiple Git versions are installed on the host then the&#xA;problem might be that TRAMP uses the wrong executable.&#xA;&#xA;First check the value of `magit-git-executable'.  Its value is&#xA;used when running git locally as well as when running it on a&#xA;remote host.  The default value is &quot;git&quot;, except on Windows&#xA;where an absolute path is used for performance reasons.&#xA;&#xA;If the value already is just &quot;git&quot; but TRAMP never-the-less&#xA;doesn't use the correct executable, then consult the info node&#xA;`(tramp)Remote programs'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This problem seems to be &lt;code&gt;tramp&lt;/code&gt; is not using the correct git on remote server. I've tried to change &lt;code&gt;magit-git-executable&lt;/code&gt; to &lt;code&gt;usr/local/git/bin/git&lt;/code&gt; which is the path both of my local and remotes installed git. But this still doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas to solve this? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10753" LastEditorUserId="10753" LastEditDate="2016-09-30T06:21:52.443" LastActivityDate="2020-05-23T12:18:44.767" Title="Magit doesn't recognise git repo through ssh connection" Tags="|magit|tramp|ssh|" AnswerCount="2" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="27462" PostTypeId="2" ParentId="27454" CreationDate="2016-09-30T04:03:46.860" Score="4" Body="&lt;p&gt;you need to add this to your &lt;code&gt;yasnippet&lt;/code&gt; config in &lt;code&gt;.emacs&lt;/code&gt; to enable nested triggering of snippets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq yas-triggers-in-field t)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-09-30T04:03:46.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27463" PostTypeId="1" CreationDate="2016-09-30T04:23:33.733" Score="1" ViewCount="776" Body="&lt;p&gt;I currently have Cygwin Emacs installed on my Windows machine.  I am wondering:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to open files from Windows Explorer in Emacs (which would be running in terminal mode in Cygwin).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default is always notepad or all the GUI applications on Windows and I would like to be able to open Cygwin and Emacs and then open the file directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On some GUI type editors you can just drag and drop a file into the editor.  This obviously doesn't work with Cygwin Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like there is no &lt;code&gt;.exe&lt;/code&gt; file for Cygwin Emacs which means I can't point anything to the binary and indicate &lt;code&gt;&quot;open file with&quot;&lt;/code&gt;...&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="7047" LastEditDate="2016-10-02T04:55:01.227" LastActivityDate="2018-02-24T12:07:40.767" Title="How to open a file from Windows explorer in Cygwin Emacs" Tags="|microsoft-windows|cygwin|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27464" PostTypeId="1" CreationDate="2016-09-30T08:58:34.140" Score="2" ViewCount="1296" Body="&lt;p&gt;My &lt;kbd&gt;Shift&lt;/kbd&gt; key is usually working but the combination &lt;code&gt;M-S-&lt;/code&gt; is not, and &lt;code&gt;M-S-&lt;/code&gt; is sometimes pretty useful in &lt;code&gt;org-mode&lt;/code&gt;. It's not just for &lt;code&gt;org-mode&lt;/code&gt;, though. I tried &lt;code&gt;describe-key&lt;/code&gt; but when I enter &lt;code&gt;S-&lt;/code&gt; after &lt;code&gt;M-&lt;/code&gt; nothing happens.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For example, &lt;kbd&gt;M&lt;/kbd&gt;-&lt;kbd&gt;&gt;&lt;/kbd&gt; (meta+shift+period) no longer activates &lt;code&gt;end-of-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 24.5 and I'm under OSX El capitan&lt;/p&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="105" LastEditDate="2018-09-06T15:27:12.690" LastActivityDate="2018-12-05T20:02:55.693" Title="Shift key is not working after Meta key (Mac OSX)" Tags="|key-bindings|osx|" AnswerCount="3" CommentCount="6" ClosedDate="2018-12-05T20:20:21.973" ContentLicense="CC BY-SA 4.0" />
  <row Id="27465" PostTypeId="2" ParentId="26220" CreationDate="2016-09-30T09:34:14.440" Score="2" Body="&lt;p&gt;So a rather unsatisfying answer that works out, is to run the commands in from the command line to generate all the required auto files with &lt;code&gt;latexmk&lt;/code&gt;. From then on the export commands from emacs work correctly.&lt;/p&gt;&#xA;" OwnerUserId="9748" LastActivityDate="2016-09-30T09:34:14.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27466" PostTypeId="2" ParentId="27464" CreationDate="2016-09-30T11:03:31.267" Score="0" Body="&lt;p&gt;I looked into the &lt;code&gt;org-mode&lt;/code&gt; source code and find the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-defkey org-mode-map [(meta shift right)]  'org-shiftmetaright)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By looking at the other functions, I found out the use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [(meta shift right)] 'foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried it in my Emacs and it seems to work this way.&lt;/p&gt;&#xA;" OwnerUserId="12007" LastEditorUserId="1979" LastEditDate="2017-03-31T12:15:37.543" LastActivityDate="2017-03-31T12:15:37.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27467" PostTypeId="1" CreationDate="2016-09-30T11:09:20.103" Score="21" ViewCount="3195" Body="&lt;p&gt;is there a way to keep only source code inside source code, that is make #+BEGIN_SRC and #+END_SRC invisible? It's cosmetic but it makes things clearer when one have to deal with a lot of short code snippets.&#xA;For exemple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-xor (a b)&#xA;          &quot;Exclusive or.&quot;&#xA;          (if a (not b) b))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  #+BEGIN_SRC emacs-lisp&#xA;       (defun org-xor (a b)&#xA;          &quot;Exclusive or.&quot;&#xA;          (if a (not b) b))&#xA;  #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="9995" LastEditDate="2016-09-30T12:54:51.180" LastActivityDate="2021-02-03T14:31:05.287" Title="Way to hide SRC block delimiters" Tags="|org-mode|" AnswerCount="6" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27468" PostTypeId="1" CreationDate="2016-09-30T12:16:17.607" Score="0" ViewCount="44" Body="&lt;p&gt;In &lt;code&gt;wakatime-mode&lt;/code&gt;, there are a bunch of process calls that is done by the &lt;code&gt;wakatime-call&lt;/code&gt; function. It calls a predefined shell command, so no real magic inside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I’d like to make it a bit more error prone by adding a retry count. However, as this is done by a process sentinel, I have to create a lambda for this. A process sentinel takes two parameters, &lt;code&gt;process&lt;/code&gt; and &lt;code&gt;signal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question is, is it possible to somehow pass the value of a local (ie. function parameter) variable to a lambda for use, thus converting the lambda into a clojure? I’d prefer to go without moving to lexical binding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Backquote is not an option (or is it?), as the variable I want to reference is not in the function’s argument list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun wakatime-call (savep &amp;amp;optional retrying)&#xA;  &quot;Call WakaTime command.&quot;&#xA;  (let*&#xA;    ((command (wakatime-client-command savep t))&#xA;     (process-environment (if wakatime-python-path&#xA;                              (cons (format &quot;PYTHONPATH=%s&quot;&#xA;                                            wakatime-python-path)&#xA;                                    process-environment)&#xA;                            process-environment))&#xA;     (process (start-process&#xA;               &quot;Shell&quot;&#xA;               (generate-new-buffer &quot; *WakaTime messages*&quot;)&#xA;               shell-file-name&#xA;               shell-command-switch&#xA;               command)))&#xA;&#xA;    (set-process-sentinel process&#xA;                          `(lambda (process signal)&#xA;                             (when (memq (process-status process) '(exit signal))&#xA;                               (kill-buffer (process-buffer process))&#xA;                               (let ((exit-status (process-exit-status process)))&#xA;                                 (when (and (not (= 0 exit-status)) (not (= 102 exit-status)))&#xA;                                   (error &quot;WakaTime Error (%s)&quot; exit-status))&#xA;                                 (when (= 102 exit-status)&#xA;                                        ; If we are retrying already, error out&#xA;                                   (if retrying&#xA;                                       (error &quot;WakaTime Error (%s)&quot; exit-status)&#xA;                                        ; otherwise, ask for an API key and call ourselves&#xA;                                        ; recursively&#xA;                                     (wakatime-prompt-api-key)&#xA;                                     (wakatime-call savep t)))))))&#xA;&#xA;    (set-process-query-on-exit-flag process nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The goal is to access &lt;code&gt;savep&lt;/code&gt; and &lt;code&gt;retrying&lt;/code&gt; in the process sentinel’s lambda/closure.&lt;/p&gt;&#xA;" OwnerUserId="507" LastEditorUserId="507" LastEditDate="2016-10-03T11:34:37.353" LastActivityDate="2016-10-03T11:34:37.353" Title="Bind a function-local variable to an asynchronous lambda" Tags="|programming|lexical-binding|" AnswerCount="0" CommentCount="7" ClosedDate="2016-10-11T16:11:49.670" ContentLicense="CC BY-SA 3.0" />
  <row Id="27469" PostTypeId="1" CreationDate="2016-09-30T13:10:07.470" Score="2" ViewCount="232" Body="&lt;p&gt;For example I want to put &lt;code&gt;(setq spacemacs-theme-org-height nil)&lt;/code&gt; into a personal layer, but that doesn't work.  I can only put the setting into &lt;code&gt;dotspacemacs/user-init&lt;/code&gt;.  The reason seems to be Spacemace has already initiated the theme before loading layers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to put the theme settings into a personal layer？&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2016-09-30T13:10:07.470" Title="How to put theme modifications into a personal layer?" Tags="|spacemacs|themes|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27470" PostTypeId="2" ParentId="27467" CreationDate="2016-09-30T13:31:28.970" Score="13" Body="&lt;p&gt;The face for all lines starting with &lt;code&gt;#+&lt;/code&gt; is called &lt;code&gt;org-meta-line&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize this face smaller, darker, etc. to make it less visible.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-09-30T13:31:28.970" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27471" PostTypeId="2" ParentId="27457" CreationDate="2016-09-30T15:08:49.503" Score="0" Body="&lt;p&gt;Edit: After some experimentation, it looks like the following information is not necessarily talking about the correct kind of ImageMagick support.  I use eimp to resize images in &lt;code&gt;image-mode&lt;/code&gt;, and eimp uses the ImageMagick utilities directly; unfortunately, I confused this with the type of ImageMagick support that the OP is talking about.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;When running Emacs on non-Cygwin-equipped Windows, I use a pre-compiled version downloaded from &lt;a href=&quot;http://emacsbinw64.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;emacsbinw64.sourceforge.net&lt;/a&gt;; it has ImageMagick support.  Bear in mind that you will also have to install &lt;a href=&quot;http://www.imagemagick.org/script/index.php&quot; rel=&quot;nofollow&quot;&gt;ImageMagick&lt;/a&gt; itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Apparently ImageMagick support was dropped (hopefully temporarily) after I downloaded the version I'm using (25.0.50.1).  I'm not sure exactly where ImageMagick support failed (according to the OP's comment, sometime prior to 25.0.94), but &lt;a href=&quot;https://sourceforge.net/projects/emacsbinw64/files/?source=navbar&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; page has the most complete set of downloads I can find.  See &lt;a href=&quot;https://sourceforge.net/p/emacsbinw64/discussion/general/thread/f3f2cfdf/?limit=25&quot; rel=&quot;nofollow&quot;&gt;this discussion thread&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2016-10-05T01:21:22.223" LastActivityDate="2016-10-05T01:21:22.223" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="27472" PostTypeId="2" ParentId="27422" CreationDate="2016-09-30T15:44:21.750" Score="1" Body="&lt;p&gt;My understanding is that to manage configurations you should create one or more layer(s). Click &lt;a href=&quot;http://spacemacs.org/doc/LAYERS.html#orgheadline1&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for documentation. &lt;/p&gt;&#xA;" OwnerUserId="11442" LastActivityDate="2016-09-30T15:44:21.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27473" PostTypeId="2" ParentId="27339" CreationDate="2016-09-30T16:02:09.383" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;h&lt;/code&gt; and &lt;code&gt;l&lt;/code&gt; to move from branch to branch (the current one is highlighted).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-n&lt;/code&gt; and &lt;code&gt;C-p&lt;/code&gt; to move up and down the tree. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you are ready press &lt;code&gt;q&lt;/code&gt; and you are out.&lt;/p&gt;&#xA;" OwnerUserId="11442" LastActivityDate="2016-09-30T16:02:09.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27476" PostTypeId="1" AcceptedAnswerId="27478" CreationDate="2016-09-30T18:54:18.540" Score="2" ViewCount="349" Body="&lt;p&gt;I am generating several tables in R and then exporting them to HTML(5). For instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R :session *R-org* :results output raw :exports results&#xA;  df &amp;lt;- data.frame(x=0.110, y=0.132)&#xA;  rownames(df) &amp;lt;- &quot;Rates&quot;&#xA;  print(ascii(df, header=TRUE, colnames=colnames(df), rownames=rownames(df),&#xA;              digits=3, caption=&quot;Rates&quot;),&#xA;        type=&quot;org&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems to work well enough, but it creates very ugly tables. How do I assign HTML attributes (as shown with the &lt;code&gt;#+ATTR_HTML&lt;/code&gt; line in &lt;a href=&quot;http://orgmode.org/manual/Tables-in-HTML-export.html&quot; rel=&quot;nofollow&quot;&gt;org manual&lt;/a&gt;) from the R block?&lt;/p&gt;&#xA;" OwnerUserId="9783" LastEditorUserId="9995" LastEditDate="2016-09-30T19:20:35.633" LastActivityDate="2017-08-14T04:34:21.070" Title="Changing HTML Table Formatting When Exporting from R" Tags="|org-mode|org-export|org-table|html|r|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27477" PostTypeId="1" CreationDate="2016-09-30T19:26:58.020" Score="0" ViewCount="66" Body="&lt;p&gt;I'm trying to set up a color theme I like when using an xterm.  I'm looking through the variable names (e.g. &quot;Font Lock Doc Face&quot;) for the theme 'deep-blue' using &lt;em&gt;Custom Theme&lt;/em&gt; option.  Unfortunately, I don't see any settings that seem to correspond to the faces used when accessing the menubar at the top of the frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help clue me in?&lt;/p&gt;&#xA;" OwnerUserId="13497" LastActivityDate="2016-09-30T19:34:07.710" Title="Variable names for the nw drop down menu faces?" Tags="|menu-bar|coloring|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27478" PostTypeId="2" ParentId="27476" CreationDate="2016-09-30T19:27:54.087" Score="1" Body="&lt;p&gt;You can handle this from the R side:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Test this&#xA;&#xA;** Original&#xA;#+BEGIN_SRC R :session *R-org* :results output raw :exports results&#xA;  library(ascii)&#xA;  df &amp;lt;- data.frame(x=0.110, y=0.132)&#xA;  rownames(df) &amp;lt;- &quot;Rates&quot;&#xA;  print(ascii(df, header=TRUE, colnames=colnames(df), rownames=rownames(df),&#xA;              digits=3, caption=&quot;Rates&quot;),&#xA;        type=&quot;org&quot;)&#xA;#+END_SRC&#xA;&#xA;&#xA;** Formatted&#xA;#+BEGIN_SRC R :session *R-org* :results output raw :exports results&#xA;  library(ascii)&#xA;  df &amp;lt;- data.frame(x=0.110, y=0.132)&#xA;  rownames(df) &amp;lt;- &quot;Rates&quot;&#xA;  cat(&quot;#+ATTR_HTML: :border 2 :rules all :frame border\n&quot;)&#xA;  print(ascii(df, header=TRUE, colnames=colnames(df), rownames=rownames(df),&#xA;              digits=3, caption=&quot;Rates&quot;),&#xA;        type=&quot;org&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's a bit ugly. It would be neater if the author of the &lt;code&gt;ascii&lt;/code&gt; provided a &lt;code&gt;header&lt;/code&gt; argument that allowed you to explicitly add an org-mode header in the call to &lt;code&gt;ascii&lt;/code&gt;. (they do provide a &lt;code&gt;header&lt;/code&gt; argument, but it serves another purpose). That may be a reasonable feature request.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-09-30T19:27:54.087" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27479" PostTypeId="2" ParentId="27477" CreationDate="2016-09-30T19:34:07.710" Score="2" Body="&lt;p&gt;Found my answer &lt;a href=&quot;https://emacs.stackexchange.com/questions/7980/how-to-determine-where-a-face-as-it-appears-on-the-screen-is-defined&quot; title=&quot;here&quot;&gt;here&lt;/a&gt;.  Basically, executing &lt;code&gt;list-faces-display&lt;/code&gt; gives me a list of &lt;em&gt;all&lt;/em&gt; variable faces.  The ones I was looking for begin with &lt;code&gt;tty-menu-*&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13497" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-09-30T19:34:07.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27482" PostTypeId="2" ParentId="27459" CreationDate="2016-09-30T22:21:13.303" Score="2" Body="&lt;p&gt;The solution that worked for me was to replace&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun company-complete-if-explicit ()&#xA;  &quot;Complete the current selection, but only if the user has interacted&#xA;explicitly with Company.&quot;&#xA;  (interactive)&#xA;  (if (company-explicit-action-p)&#xA;      (company-complete)&#xA;    (call-interactively&#xA;     (key-binding (this-command-keys)))))&#xA;&#xA;;; &amp;lt;return&amp;gt; is for windowed Emacs; RET is for terminal Emacs&#xA;(define-key company-active-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) #'company-complete-if-explicit)&#xA;(define-key company-active-map (kbd &quot;RET&quot;) #'company-complete-if-explicit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; &amp;lt;return&amp;gt; is for windowed Emacs; RET is for terminal Emacs&#xA;(dolist (key '(&quot;&amp;lt;return&amp;gt;&quot; &quot;RET&quot;))&#xA;  ;; Here we are using an advanced feature of define-key that lets&#xA;  ;; us pass an &quot;extended menu item&quot; instead of an interactive&#xA;  ;; function. Doing this allows RET to regain its usual&#xA;  ;; functionality when the user has not explicitly interacted with&#xA;  ;; Company.&#xA;  (define-key company-active-map (kbd key)&#xA;    `(menu-item nil company-complete&#xA;                :filter ,(lambda (cmd)&#xA;                           (when (company-explicit-action-p)&#xA;                             cmd)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;RET&lt;/code&gt; will act like normal when I don't interact with Company, but it will insert the selected completion when I have interacted with Company—in both terminal and windowed Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/raxod502/radian/commit/af57ab37d7532f1441fa39e72733d473502800ff&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is the complete patch.&lt;/p&gt;&#xA;" OwnerUserId="12534" LastEditorUserId="12534" LastEditDate="2016-10-01T01:47:55.017" LastActivityDate="2016-10-01T01:47:55.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27483" PostTypeId="1" AcceptedAnswerId="36427" CreationDate="2016-10-01T00:39:21.480" Score="1" ViewCount="538" Body="&lt;p&gt;I'm running a test suite in a shell buffer that tends to produce really long lines with &lt;code&gt;PASSED&lt;/code&gt; or &lt;code&gt;FAILED&lt;/code&gt; at the end of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to quickly see whether a given line passed or failed as the text scrolls past, but without throwing away the first part of the line in case. (I have a short script that reads lines and prints the last 80 characters padded on the left with spaces), but I'd prefer to change how the lines are displayed within in emacs so I'm not losing information if I need to inspect a particular test case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;just to be really concrete&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &lt;code&gt;emacs -q&lt;/code&gt; totally stock emacs installation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &lt;code&gt;M-x shell&lt;/code&gt; start shell&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) &lt;code&gt;M-x toggle-truncate-lines&lt;/code&gt; turn off line wrapping&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) run a command like &lt;code&gt;perl -e 'for $x (40..200) { printf &quot;begin%send\n&quot;, (&quot;.&quot; x $x); }'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll see &lt;code&gt;begin......&lt;/code&gt; and no &lt;code&gt;end&lt;/code&gt; after the lines become too long for the terminal to display. I'd like the &lt;code&gt;end&lt;/code&gt;s to be visible and lined up regardless of the length of the line.&lt;/p&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="105" LastEditDate="2016-10-01T00:55:10.197" LastActivityDate="2018-03-26T04:18:56.243" Title="Display lines aligned with right edge of buffer?" Tags="|line-truncation|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27484" PostTypeId="2" ParentId="27483" CreationDate="2016-10-01T00:51:17.083" Score="1" Body="&lt;p&gt;Try command &lt;code&gt;scroll-left&lt;/code&gt;, bound to &lt;code&gt;C-x &amp;lt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;code&gt;auto-hscroll-mode&lt;/code&gt;. You can also set &lt;code&gt;hscroll-margin&lt;/code&gt; and &lt;code&gt;hscroll-step&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Horizontal-Scrolling.html&quot; rel=&quot;nofollow&quot;&gt;Horizontal Scrolling&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more details, see also the &lt;em&gt;Elisp&lt;/em&gt; manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Horizontal-Scrolling.html&quot; rel=&quot;nofollow&quot;&gt;Horizontal Scrolling&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-01T00:51:17.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27485" PostTypeId="1" CreationDate="2016-10-01T01:00:33.470" Score="2" ViewCount="560" Body="&lt;p&gt;After several years of being annoyed of Emacs on Ubuntu (not Mac via brew) having a ~2-3 second delay before displaying file contents at startup I finally decided to debug this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran &lt;code&gt;strace -r emacs&lt;/code&gt; and piped all output to a file. Reading through the file I noticed that there were only three syscalls that took longer than 10ms and they were all pselect6 calls. One of the calls in particular was taking a lot of time (if you're not immediately familiar with &lt;code&gt;-r&lt;/code&gt; it shows the time between syscalls): &#xA;&lt;code&gt;&#xA;0.000499 pselect6(4, [3], [], NULL, {1, 996507900}, {NULL, 8}) = 0 (Timeout)&#xA;1.997844 ioctl(3, FIONREAD, [0])   = 0&#xA;&lt;/code&gt;&#xA;and tracing that back to the &lt;code&gt;open&lt;/code&gt; call with fd 3:&#xA;&lt;code&gt;&#xA;0.000000 open(&quot;/dev/tty&quot;, O_RDWR|O_NOCTTY) = 3&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Emacs is timing out, waiting for user input on startup?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This occurs regardless of what init scripts I use and I've tried both enabling and disabling the splash screen. All to no avail, the 2 second delay persists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing that seems to affect this 2 second pause is to hit a key, which will take me directly to the file you wanted to open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried installing both Emacs 23 and 24 and both are affected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a screenshot of what Emacs looks like while waiting:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/uR4wY.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://i.stack.imgur.com/uR4wY.jpg&lt;/a&gt;&#xA;And here is after the 2 seconds are up and &lt;em&gt;scratch&lt;/em&gt; has loaded:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/OmLep.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://i.stack.imgur.com/OmLep.jpg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to get emacs to not wait for input on &lt;code&gt;/dev/tty&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;Here's the entire strace log from starting up emacs:&#xA;&lt;a href=&quot;https://paste.ee/r/cL5jP&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://paste.ee/r/cL5jP&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13503" LastEditorUserId="13503" LastEditDate="2016-10-03T17:37:42.190" LastActivityDate="2016-10-03T17:37:42.190" Title="Emacs times out trying to read from /dev/tty on startup?" Tags="|start-up|ubuntu|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27486" PostTypeId="1" AcceptedAnswerId="27506" CreationDate="2016-10-01T08:07:34.413" Score="2" ViewCount="1054" Body="&lt;p&gt;i have the following template&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-capture-templates&#xA;               '(&quot;un&quot; &quot;resturant&quot;&#xA;                 entry&#xA;                (file+headline &quot;/home/zeltak/org/files/agenda/travel.org&quot; &quot;NYC&quot;)&#xA;&quot;* TOVISIT %^{Description}   &#xA;%u&#xA;  :PROPERTIES:&#xA;  :Rating: %^{rating?|-|1|2|3|4|5}&#xA;  :price: %^{price in local currancy?|-|0-10|10-20|20-30|30-50|50+}&#xA;  :Source: %^{Source?}&#xA;  :Type: %^{Type?|meal|breakfeast|dessert|street}&#xA;  :Cuisine:   &#xA;%^{Cuisine?|-|Indian|Thai|Vietnamese|Asian|Chinese|Israeli|Italian|American|EastEuro|Mexican|French|Persian|Austrian|Japan}&#xA;  :Fav: %^{Fav|yes|no}&#xA;  :END:&#xA;&#xA;%^{prompt|** My Review}&#xA;%?&#xA;    &quot;&#xA;       ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;note the last entry where i try and add a sub header. when i finzalize the capture it dosent create a header but rather just add the 2 starts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is there a way to make the capture template add a proper sub header?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-10-02T09:40:55.863" Title="orgmode capture template: adding sub headers" Tags="|org-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27488" PostTypeId="1" CreationDate="2016-10-01T13:11:02.880" Score="0" ViewCount="69" Body="&lt;p&gt;I often use .c file and .txt file on the split emacs frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote a code such as the following to init.el.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; change text-mode indent&#xA;(add-hook 'text-mode-hook&#xA;      (lambda ()&#xA;         (setq indent-line-function 'tab-to-tab-stop)&#xA;         (electric-indent-mode -1)&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code is convenience for me to arrange text on .txt file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, c-mode on emacs also doesn't indent for c-code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I must input tab-key by oneself for .c file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I write a setting to solve this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please teach me.&lt;/p&gt;&#xA;" OwnerUserId="13506" LastEditorUserId="1979" LastEditDate="2016-10-03T01:09:39.967" LastActivityDate="2016-10-03T04:22:30.220" Title="different mode setting" Tags="|init-file|major-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27489" PostTypeId="2" ParentId="27325" CreationDate="2016-10-01T13:59:26.783" Score="3" Body="&lt;p&gt;I ended up solving this question using the &lt;code&gt;:enable-function&lt;/code&gt; in &lt;code&gt;define-abbrev-table&lt;/code&gt; (similar to what's recommended here: &lt;a href=&quot;https://emacs.stackexchange.com/questions/12193/do-not-expand-a-given-abbrev-when-followed-by&quot;&gt;Do not expand a given abbrev when followed by &amp;quot;:&amp;quot;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution is to put all my abbreviations in the &lt;code&gt;global-abbrev-table&lt;/code&gt; and all my exceptions in &lt;code&gt;text-mode-abbrev-table&lt;/code&gt;.  Then have an &lt;code&gt;enable-function&lt;/code&gt; that checks that the character preceding the current word is not a &quot;&lt;code&gt;.&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-char-preceding-word ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (backward-word)&#xA;    (char-before)))&#xA;&#xA;(define-abbrev-table 'text-mode-abbrev-table&#xA;  '((&quot;com&quot; &quot;commission&quot;))&#xA;  &quot;My exceptions table.&quot;&#xA;  :enable-function (lambda ()&#xA;                     (not (eq (my-char-preceding-word) ?.))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2728" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-10-01T13:59:26.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27491" PostTypeId="1" AcceptedAnswerId="27494" CreationDate="2016-10-01T18:12:55.297" Score="12" ViewCount="5620" Body="&lt;p&gt;I'd like to format a table with a wide column nicely in PDF export from org-mode. Ideally it would be with a wrap on that column, but I can deal with a manual character or fraction of &lt;code&gt;\textwidth&lt;/code&gt; for that column. I've tried a number of things, but I can't get it to change width. What do I need to do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_LATEX: :width .6\textwidth&#xA;| Column                    | Wide Column                                        | Column   |&#xA;|---------------------------+----------------------------------------------------+----------|&#xA;|                           | &amp;lt;30&amp;gt;                                               |          | &#xA;| Some stuff                | Lots and lots of stuff. Way too much. Like, a lot. |          |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2017-11-17T23:17:26.443" Title="How do I limit the width of a table or columns in org-mode PDF export?" Tags="|org-mode|org-export|latex|pdf|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27492" PostTypeId="1" CreationDate="2016-10-01T18:16:59.007" Score="3" ViewCount="1238" Body="&lt;p&gt;I have the following files in a directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CIMG4879.JPG&#xA;CIMG4880.JPG&#xA;CIMG4881.JPG&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to rename them all with a numeric sequence such that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;01.jpg&#xA;02.jpg&#xA;03.jpg&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In bash, I could &lt;code&gt;convert *.JPG %02d.jpg&lt;/code&gt;, since they're all image files.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I do a batch rename in &lt;code&gt;dired&lt;/code&gt;?&lt;/strong&gt;  Assume I have a lot a files, so doing it one by one would be tedious and error-prone.&lt;/p&gt;&#xA;" OwnerUserId="13511" LastEditorUserId="253" LastEditDate="2016-10-01T23:46:37.073" LastActivityDate="2021-03-29T18:06:49.410" Title="Batch rename files to numeric sequence in dired?" Tags="|dired|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27493" PostTypeId="2" ParentId="17063" CreationDate="2016-10-01T18:48:13.497" Score="5" Body="&lt;p&gt;This is an all-in-one solution. It will &lt;em&gt;create and display a PDF from an Rnw&lt;/em&gt;.&lt;br&gt;&#xA;Specifically it will:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Save the Rnw buffer and knit it,&lt;/li&gt;&#xA;&lt;li&gt;Apply a given LaTeX engine to the resulting TeX file,&lt;/li&gt;&#xA;&lt;li&gt;Identify the BibTeX engine executable (e.g. biber, bibtex8),&lt;/li&gt;&#xA;&lt;li&gt;Run the BibTeX engine on the TeX file if the bib file is newer than TeX file,&lt;/li&gt;&#xA;&lt;li&gt;Run LaTeX again,&#xA;6  Open resulting PDF in the designated viewer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The procedure tries to exit with informative messages if one of the above steps above fails.&lt;br&gt;&#xA;An R instance will be opened, if necessary, or the current one is used to show knitting process.&lt;br&gt;&#xA;LaTeX output is sent to &quot;TeX-output&quot; buffer, which also is popped in case of compilation error.  &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Usage&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;Meta&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; &lt;code&gt;knit-me&lt;/code&gt; to create and view the PDF.&lt;br&gt;&#xA;&lt;kbd&gt;Meta&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; &lt;code&gt;knit-me-clear&lt;/code&gt; to remove intermediate LaTeX files and &lt;code&gt;knit-me&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bibliography requires the &quot;biblatex&quot; package, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\usepackage[&#xA;    options...      &#xA;    backend=ENGINE,&#xA;]{biblatex}&#xA;\addbibresource{foo.bib}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The name of the bib-engine (e.g. &lt;code&gt;bibtex&lt;/code&gt;, &lt;code&gt;biber&lt;/code&gt;) is obtained parsing the &lt;code&gt;backend&lt;/code&gt; keyword.&lt;br&gt;&#xA;&lt;code&gt;\addbibresource&lt;/code&gt; command is parsed to obtain the bibliography file: if &lt;code&gt;foo.bib&lt;/code&gt; is newer than the TeX file the bib engine is run. In this regard, only the first &lt;code&gt;\addbibresource&lt;/code&gt; command is taken into account if there are many.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Customise&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To actually view the PDF, set the viewer executable path with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq pdf-viewer &quot;path/to/pdf-viewer&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Possibly use a viewer like &lt;a href=&quot;http://www.sumatrapdfreader.org/free-pdf-reader.html&quot; rel=&quot;noreferrer&quot;&gt;SumatraPDF&lt;/a&gt;, which automatically updates the PDF when recompiled and does not block the opened file preventing new compilations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default LaTeX engine is &lt;code&gt;pdflatex&lt;/code&gt; (assumed in the current path). Customise with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq latex-engine &quot;newengine&quot;&#xA;      latex-args   &quot;--option-1 --option-2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course you might want to bind &lt;code&gt;knit-me&lt;/code&gt; and &lt;code&gt;knit-me-clear&lt;/code&gt; to some convenient keys.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Notes&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Tested in Windows MiKTeX, with &lt;code&gt;biber&lt;/code&gt; and &lt;code&gt;bibtex8&lt;/code&gt; backends and GNU Emacs 25.1.1.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Elisp code&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; (require 'ess-site) ; assumed in your init file&#xA;&#xA;(defun knit-me-clear () &#xA;  &quot;Delete intermediate LaTeX files and run `knkt-me'.&#xA;These are based on extensions .aux, .blg, .out, .run.xml, .bbl, .log, -blx.bib&quot;&#xA;&#xA;  (interactive)&#xA;  (check-Rnw)&#xA;  (let&#xA;      ((file)&#xA;       (stem (file-name-sans-extension (buffer-file-name))))&#xA;    (dolist (elt&#xA;         (list &quot;.aux&quot; &quot;.blg&quot; &quot;.out&quot; &quot;.run.xml&quot; &quot;.bbl&quot; &quot;.log&quot; &quot;-blx.bib&quot;))&#xA;      (setq file (concat stem elt))&#xA;      (if (file-exists-p file) (delete-file file))))  &#xA;  (knit-me))&#xA;&#xA;&#xA;(defun knit-me () &#xA;  &quot;Knit-&amp;gt;LaTeX-engine-&amp;gt;bibtex-engine-&amp;gt;LaTeX-engine-&amp;gt;View.&#xA;Default LaTeX engine is \&quot;pdflatex\&quot; and can be customised with `latex-engine';&#xA;default LaTeX arguments are set to nil and can be customised with `latex-args';&#xA;default PDF viewer is set to nil and can be customised with `pdf-viewer'.&#xA;Bibliography must be set via \&quot;biblatex\&quot; LaTeX package.&#xA;Bibliography engine is obtained from \&quot;backend\&quot; option in \&quot;biblatex\&quot; package.&#xA;A reference  LaTeX bib file is obtained from the first LaTeX command \&quot;\addbibresource{foo.bib}\&quot;.&#xA;The biblatex-engine is run if the bib file is newer of the TeX file. &#xA;If there are multiple \&quot;\addbibresource\&quot; only the first will be used to decide whether to run the biblatex-engine.&quot;&#xA;&#xA;  (interactive)&#xA;&#xA;  ;; Default values&#xA;  (defvar pdf-viewer nil)&#xA;  (defvar latex-engine &quot;pdflatex&quot;)&#xA;  (defvar latex-args nil)&#xA;&#xA;  (check-Rnw)&#xA;&#xA;  ;;If 1 R-proc found, associate it with buffer;&#xA;  ;;if many found, ask to choose one; if none found, launch and associate&#xA;  (ess-force-buffer-current &quot;Process to use: &quot;)&#xA;&#xA;  ;;Save Rnw buffer&#xA;  (save-buffer)&#xA;&#xA;&#xA;  (let*&#xA;      (;;Set file paths&#xA;       (pathstem (file-name-sans-extension (buffer-file-name)))&#xA;       (namestem (file-name-nondirectory pathstem))&#xA;       (cur-dir     (file-name-directory pathstem))&#xA;       (rnw-name    (concat namestem &quot;.Rnw&quot;))&#xA;       (tex-name    (concat namestem &quot;.tex&quot;))&#xA;&#xA;       ;;Create LaTeX commmand&#xA;       (latex-args (concat latex-args &quot; &quot; namestem))&#xA;       (latex-cmd (concat latex-engine &quot; &quot; latex-args))&#xA;&#xA;       ;;Create knit commmand&#xA;       (knit-cmd (format &quot;require(knitr); setwd('%s'); knit('%s')&quot;  cur-dir rnw-name))&#xA;&#xA;       ;;Get R buffer proc&#xA;       (r-proc (ess-get-process))&#xA;       (r-buf (ess-get-process-buffer))&#xA;&#xA;       ;;TeX executable process and bibtex engine/file&#xA;       (tex-proc)&#xA;       (tex-buf)&#xA;       (bibfile (bib-getfile))&#xA;       (bibengine (bib-getengine))&#xA;       (bibfile-updated&#xA;    (file-newer-than-file-p&#xA;     (concat cur-dir (file-name-nondirectory bibfile) &quot;.bib&quot;) (concat pathstem &quot;.tex&quot;)))&#xA;&#xA;&#xA;       ;;Command success&#xA;       (success nil)&#xA;       (error-msg &quot;&quot;)&#xA;       )&#xA;&#xA;&#xA;    (setq default-directory cur-dir)&#xA;&#xA;    ;; Exit on error&#xA;    (catch 'exit-func&#xA;&#xA;      ;;Check bibtex file and engine&#xA;      (when (not bibfile)&#xA;    (setq error-msg (bib-getfile t))&#xA;    (throw 'exit-func nil))     &#xA;      (when (not bibengine)&#xA;    (setq error-msg (bib-getengine t))      &#xA;    (throw 'exit-func nil))&#xA;&#xA;      ;; Biber wants .bib&#xA;      (let ((fail (and (string= bibengine &quot;biber&quot;)&#xA;              (string= (file-name-nondirectory bibfile) (file-name-base bibfile)))))&#xA;    (setq success (not fail)))&#xA;      (when (not success)&#xA;    (setq error-msg&#xA;          (format &quot;biber wants \\addbibresource{%s%s}&quot; (file-name-base bibfile) &quot;.bib&quot;))&#xA;    (throw 'exit-func nil))&#xA;&#xA;&#xA;      ;; Knitting&#xA;      (switch-to-buffer-other-window r-buf)&#xA;      (message knit-cmd)&#xA;      (ess-eval-linewise knit-cmd nil t nil t) &#xA;      ;; Foll. 3 lines are an alternative to ess-eval&#xA;      ;; (inferior-ess-mark-as-busy r-proc)  ; knit immediately after this line       &#xA;      ;; (process-send-string r-proc (format &quot;cat(\&quot;%s\&quot;);%s\n&quot; knit-cmd knit-cmd)) ; real &#xA;      ;; (ess-wait-for-process r-proc nil)&#xA;&#xA;      ;; Check for knitting results&#xA;      (with-current-buffer r-buf&#xA;    ;; Parse last 3 lines&#xA;    (let ((beg) (end) (out))&#xA;      (goto-char (point-max))&#xA;      (setq end (point))&#xA;      (forward-line -3) &#xA;      (setq beg (point))&#xA;      (setq out (buffer-substring-no-properties beg end))&#xA;&#xA;      ;; Knitting successful?&#xA;      (setq success &quot;output file: %s\n\n[1] \&quot;%s\&quot;\n&amp;gt; &quot;)&#xA;      (setq success (string= (format success tex-name tex-name) out))))&#xA;&#xA;      (when (not success)&#xA;    (setq error-msg (concat &quot;Unable to knit &quot; rnw-name))&#xA;    (throw 'exit-func nil))&#xA;&#xA;      ;; First LaTeXing&#xA;      (setq tex-buf (get-buffer-create &quot;TeX-output&quot;)) ; Create output buffer or use existing&#xA;      (with-current-buffer tex-buf                   &#xA;    (buffer-disable-undo)&#xA;    (erase-buffer))&#xA;      (message &quot;1st latex ...&quot;)&#xA;      (send-r-mess (format &quot;Starting LaTeX (see \&quot;%s\&quot;)&quot; (buffer-name tex-buf)))      &#xA;      (send-r-mess latex-cmd)&#xA;      (setq success (= 0 (call-process latex-engine nil tex-buf t latex-args)))&#xA;      (goto-char (point-max))&#xA;&#xA;      ;; Check 1st LaTeX results&#xA;      (when (not success)&#xA;    (setq error-msg (concat &quot;Unable to LaTeX &quot; namestem))&#xA;    (switch-to-buffer-other-window tex-buf) &#xA;    (other-window 1)&#xA;    (throw 'exit-func nil))&#xA;&#xA;      ;; Run bibtex engine&#xA;      (when bibfile-updated  &#xA;    (message &quot;biblatex ...&quot;)&#xA;    (send-r-mess (concat bibengine &quot; &quot;  namestem))&#xA;    (setq success (= 0 (call-process bibengine nil tex-buf t namestem)))&#xA;    (goto-char (point-max))&#xA;&#xA;    ;; Check bibtex results&#xA;    (when (not success)&#xA;      (setq error-msg (concat &quot;Unable to &quot; bibengine &quot; &quot; namestem))&#xA;      (switch-to-buffer-other-window tex-buf) &#xA;      (other-window 1)&#xA;      (throw 'exit-func nil)))&#xA;&#xA;      ;; Second LaTeXing&#xA;      (message &quot;2nd latex ...&quot;)&#xA;      (send-r-mess latex-cmd)&#xA;      (setq success (= 0 (call-process latex-engine nil tex-buf t latex-args)))&#xA;      (goto-char (point-max))&#xA;&#xA;      ;; Check 2nd LaTeX results&#xA;      (when (not success)&#xA;    (setq error-msg (concat &quot;Unable to LaTeX &quot; pathstem))&#xA;    (switch-to-buffer-other-window tex-buf) &#xA;    (other-window 1)&#xA;    (throw 'exit-func nil))&#xA;&#xA;      ;; View   &#xA;      (if (not pdf-viewer) (throw 'exit-func nil))&#xA;      (send-r-mess  &quot;...and now the viewer&quot;)&#xA;      (goto-char (point-max))&#xA;      (setq success (file-exists-p pdf-viewer))&#xA;      (when (not success)&#xA;    (setq error-msg (concat &quot;Can\\'t find executable &quot; pdf-viewer))&#xA;    (throw 'exit-func nil))&#xA;&#xA;      ;; If you need viewer console output, use &quot;(start-process &quot;pdf-viewer&quot; tex-buf ...&quot;;&#xA;      ;; but you block tex-buf buffer till the viewer is open&#xA;      (start-process &quot;pdf-viewer&quot; nil pdf-viewer (concat namestem &quot;.pdf&quot;)))&#xA;&#xA;    (if success&#xA;    (if bibfile-updated (message (concat &quot;Updated to &quot;  (file-name-nondirectory bibfile))))&#xA;      (message error-msg)&#xA;      (send-r-mess error-msg))))&#xA;&#xA;(defun bib-getfile(&amp;amp;optional show-messages)&#xA;  &quot;Check if 'addbibresource' command and related file exist. &#xA;If found, return .bib file full path, else:&#xA;if SHOW-MESSAGES is nil return nil, if SHOW-MESSAGES is non-nil return related error.&quot;&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (re-search-forward &quot;\\\\addbibresource{\\(.+\\)}&quot; nil t))&#xA;  (let ((fmatch (match-string-no-properties 1)) &#xA;    (success nil)&#xA;    mess)    &#xA;    (cond &#xA;     ((not fmatch) (setq mess &quot;Missing \\addbibresource command.&quot;))&#xA;     ((not (file-exists-p (concat (file-name-sans-extension fmatch) &quot;.bib&quot;)))&#xA;      (setq mess (concat &quot;Missing file: &quot; fmatch &quot;.bib&quot;)))&#xA;     ;; if no problem, sucess=message=bib-file-path&#xA;     (t (setq mess (concat (file-name-directory (buffer-file-name)) fmatch)&#xA;          success mess)))&#xA;&#xA;    (if show-messages mess success)))&#xA;&#xA;(defun bib-getengine(&amp;amp;optional show-messages)&#xA;  &quot;Find biblatex engine.&#xA;If found,  engine name, else:&#xA;if SHOW-MESSAGES is nil return nil, if SHOW-MESSAGES is non-nil return related error.&quot;&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (let ((pack (re-search-forward &quot;\\\\usepackage *\\(\\[[^]]*\\)\\] *{ *biblatex *}&quot; nil t))&#xA;      (bend nil)&#xA;      mess)&#xA;&#xA;      (when pack (setq pack (match-string-no-properties 1)))&#xA;      (when (and pack&#xA;         (string-match &quot;[^[:alpha:]]+backend *= *\\([^, \n]+\\)&quot; pack))&#xA;    (setq bend (match-string 1 pack)))&#xA;      (cond &#xA;       ((not pack) (setq mess &quot;Missing biblatex package command.&quot;))&#xA;       ((not bend) (setq mess &quot;Missing biblatex backend.&quot;))&#xA;       ;; if no problem, sucess=message=bib-file-path&#xA;       (t (setq mess bend)))&#xA;      (if show-messages mess bend))))&#xA;&#xA;&#xA;(defun send-r-mess (mess)&#xA;  &quot;Just send MESS at the end of R console buffer&quot;&#xA;  (process-send-string (ess-get-process)&#xA;             (format &quot;cat('%s\\n')\n&quot; mess)))&#xA;&#xA;(defun check-Rnw ()&#xA;  &quot;Give error if `ess-dialect' is not \&quot;R\&quot;&quot;&#xA;  (if (not (string= &quot;R&quot; ess-dialect))&#xA;      (error &quot;Not an Rnw buffer&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-10-01T18:48:13.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27494" PostTypeId="2" ParentId="27491" CreationDate="2016-10-01T19:20:00.357" Score="14" Body="&lt;p&gt;You may try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+ATTR_LATEX: :environment longtable :align |l|p{10cm}|l|&#xA;|            | &amp;lt;30&amp;gt;                                               |        |&#xA;| Column     | Wide Column                                        | Column |&#xA;|------------+----------------------------------------------------+--------|&#xA;| Some stuff | Lots and lots of stuff. Way too much. Like, a lot. |        |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this example the align table has three columns with &lt;code&gt;|&lt;/code&gt; as a delimiter. The first and last are left justified (&lt;code&gt;l&lt;/code&gt;). The middle one is a paragraph of width 10 cm (&lt;code&gt;p{10cm}&lt;/code&gt;). Edit the align table in the &lt;code&gt;#+ATTR_LATEX:&lt;/code&gt; line to match the number of columns you have.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2017-11-17T23:17:26.443" LastActivityDate="2017-11-17T23:17:26.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27495" PostTypeId="1" CreationDate="2016-10-01T20:14:59.450" Score="2" ViewCount="1411" Body="&lt;p&gt;I have a custom emacs major-mode which I specified the background and foreground colors for. However, the default cursor color clashes with the background and you can't see it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;'set-cursor-color' changes the color for the entire emacs session which is undesirable. I tried using a mode-hook where I set the 'cursor' face locally using &lt;a href=&quot;https://stackoverflow.com/questions/27784417/setting-font-lock-face-to-different-values-for-different-major-modes&quot;&gt;'make-local-variable'&lt;/a&gt;, that didn't work either (I saw no effect), I did see an effect if I set a font-lock face though, so I think the code is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that the cursor is actually only settable as a global variable and is not evaluated per buffer. Is there a way I can set the cursor color per buffer so that it doesn't clobber the cursor color for other buffers? Or maybe is there a way where I can detect that I am 'entering' and 'leaving' the buffer and set the cursor color appropriately?  &lt;/p&gt;&#xA;" OwnerUserId="13512" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-07-30T04:07:25.990" Title="How do I change the cursor face per buffer?" Tags="|major-mode|faces|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27498" PostTypeId="2" ParentId="27492" CreationDate="2016-10-01T22:46:17.230" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In dired I do not know the regexp&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why bother with dired's regex-replacement? Just enter &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Wdired.html&quot; rel=&quot;nofollow&quot;&gt;wdired-mode&lt;/a&gt; (which I bind to &lt;code&gt;w&lt;/code&gt; in dired, but default=&lt;code&gt;C-x C-q&lt;/code&gt;), edit the filenames like regular text, then exit back to normal dired with &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5444" LastEditorUserId="5444" LastEditDate="2016-10-02T00:53:40.260" LastActivityDate="2016-10-02T00:53:40.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27499" PostTypeId="2" ParentId="27492" CreationDate="2016-10-01T23:04:49.400" Score="10" Body="&lt;p&gt;Firstly, take note of JeanPierre's comment -- you're &lt;em&gt;not&lt;/em&gt; renaming files by using &lt;code&gt;convert&lt;/code&gt; like that. You're creating new and different files (lower quality ones, although the difference may or may not matter in practice, depending on your use-cases).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few different options for renaming files in dired using a number sequence. The first two are general techniques for editing text, which are applicable thanks to the excellent &lt;code&gt;wdired-mode&lt;/code&gt;. The third combines dired's rename command with keyboard macro counters.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With search-and-replace:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-q&lt;/kbd&gt; (change to editable dired mode; use &lt;code&gt;C-c C-k&lt;/code&gt; to cancel the edit if you mess anything up)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-M-%&lt;/kbd&gt; (call &lt;code&gt;query-replace-regexp&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;CIMG[0-9]+\.JPG&lt;/code&gt; (pattern to match)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;\,(format &quot;%02d&quot; (1+ \#)).JPG&lt;/code&gt; (replacement)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;!&lt;/kbd&gt; (replace all; or else you could confirm the replacements individually)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt; (to return to normal dired mode, writing the changes)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\,(...)&lt;/code&gt; calls an elisp function and uses the result in the replacement text; here we are calling &lt;code&gt;format&lt;/code&gt; on the replacement counter, to which we are first adding one (as it counts from zero).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It's a shame that &lt;code&gt;dired-do-rename-regexp&lt;/code&gt; doesn't support that, but not a big deal when you're familiar with &lt;code&gt;wdired-mode&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Once again in editable dired mode, mark the filenames as a rectangle, delete the rectangle, then use &lt;code&gt;rectangle-number-lines&lt;/code&gt; to insert new contents:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt; call &lt;code&gt;rectangle-number-lines&lt;/code&gt; with extended argument input&lt;/li&gt;&#xA;&lt;li&gt;Start from 1&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;%02d&lt;/code&gt; as the replacement, being sure to remove the default trailing space (or you could use &lt;code&gt;%02d.JPG&lt;/code&gt;, depending on what you actually deleted)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With keyboard macros, in normal dired:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-k&lt;/kbd&gt;&lt;kbd&gt;C-f&lt;/kbd&gt; &lt;code&gt;%02d&lt;/code&gt; (set kmacro counter format)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-1&lt;/kbd&gt;&lt;kbd&gt;F3&lt;/kbd&gt; (start recording, initialising counter to 1)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;R&lt;/kbd&gt; (dired rename)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;F3&lt;/kbd&gt; (insert the current kmacro counter value; the counter then increments)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;.JPG&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; (remainder of the new filename)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-n&lt;/kbd&gt; (next line)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;F4&lt;/kbd&gt; (repeatedly; first to end recording, and then to repeat the macro)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;kbd&gt;M-0&lt;/kbd&gt;&lt;kbd&gt;F4&lt;/kbd&gt; to repeat the macro as many times as possible.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-10-02T07:48:13.383" LastActivityDate="2016-10-02T07:48:13.383" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27500" PostTypeId="2" ParentId="27495" CreationDate="2016-10-02T00:22:12.870" Score="1" Body="&lt;p&gt;I (I'm the OP) figured out an (imperfect) way to do it using &lt;code&gt;buffer-list-update-hook&lt;/code&gt; (which happens whenever you switch buffers or windows &lt;a href=&quot;https://www.emacswiki.org/emacs/SwitchingBuffers#toc8&quot; rel=&quot;nofollow&quot;&gt;https://www.emacswiki.org/emacs/SwitchingBuffers#toc8&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I store the original cursor color:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq orig-cursor-background (face-attribute 'cursor :background))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then whenever &lt;code&gt;buffer-list-update-hook&lt;/code&gt; runs I just check the &lt;code&gt;major-mode&lt;/code&gt; variable and see if it matches my major mode. If it does, then I set the cursor color to what I want using &lt;code&gt;set-face-background&lt;/code&gt;. Otherwise I set it to &lt;code&gt;orig-cursor-background&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with this approach is that every buffer in the frame will also have the cursor changed until you switch buffers.&lt;/p&gt;&#xA;" OwnerUserId="13512" LastEditorUserId="13512" LastEditDate="2016-10-02T22:35:09.860" LastActivityDate="2016-10-02T22:35:09.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27501" PostTypeId="1" CreationDate="2016-10-02T02:14:32.087" Score="3" ViewCount="717" Body="&lt;p&gt;I'm having trouble getting query-regex-replace to do what I want. I've read the docs several times and still can't figure it out. Here are a few examples of things I can't figure out how to do with query-regex-replace:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Replace a bunch of whitespace on one line followed by &quot;*&quot; with just &quot;*&quot; (get rid of the whitespace.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;EDIT - I got this to work with &lt;code&gt;[[:space:]]+\*&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;*&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Replace two forward slashes followed by non white space with two forward slashes and white space (insert a space before the first non white space character).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;EDIT - I also got this to work with &lt;code&gt;//\([^[:space:]]+\)&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;// \1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Get rid of blank lines (optionally of course because this is a query replace).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;EDIT - I still cannot get this to work. Among other things, I tried these:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;)[[:space:]]+{&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;) {&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;)\s-+{&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;) {&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;" OwnerUserId="13515" LastEditorUserId="160" LastEditDate="2016-10-04T13:20:02.930" LastActivityDate="2016-10-05T15:28:16.067" Title="Difficulty with query-replace-regexp" Tags="|regular-expressions|whitespace|query-replace|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27502" PostTypeId="1" AcceptedAnswerId="27504" CreationDate="2016-10-02T04:47:28.480" Score="3" ViewCount="1660" Body="&lt;p&gt;How can I stop company-mode from autocompleting dictionary words? I only want it to autocomplete commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company&#xA;  :ensure&#xA;  :defer 4&#xA;  :init (progn&#xA;          (global-company-mode)&#xA;          (setq company-global-modes '(not python-mode cython-mode sage-mode))&#xA;          )&#xA;  :config (progn&#xA;            (setq company-tooltip-limit 20&#xA;                  company-idle-delay .1&#xA;                  company-echo-delay 0&#xA;                  company-begin-commands '(self-insert-command)&#xA;                  company-transformers '(company-sort-by-occurrence)&#xA;                  company-selection-wrap-around t&#xA;                  company-idle-delay .1&#xA;                  company-minimum-prefix-length 1&#xA;                  company-selection-wrap-around t&#xA;                  company-dabbrev-downcase nil&#xA;                  )&#xA;            (bind-keys :map company-active-map&#xA;                       (&quot;C-n&quot; . company-select-next)&#xA;                       (&quot;C-p&quot; . company-select-previous)&#xA;                       (&quot;C-d&quot; . company-show-doc-buffer)&#xA;                       (&quot;&amp;lt;tab&amp;gt;&quot; . company-complete)&#xA;                       (&quot;&amp;lt;escape&amp;gt;&quot; . company-abort)&#xA;                       )&#xA;            )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&#xA;I just noticed that it autocompletes not from the dictionary (ispell) but from all words already existing in the current buffer. How can I stop it from doing so?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="516" LastEditDate="2016-10-02T04:55:51.057" LastActivityDate="2016-10-02T07:25:41.487" Title="Stop company-mode from completing dictionary words" Tags="|company-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27503" PostTypeId="2" ParentId="27495" CreationDate="2016-10-02T06:09:43.853" Score="0" Body="&lt;p&gt;Library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/cursor-chg.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;cursor-chg.el&lt;/code&gt;&lt;/a&gt; shows you how to do this.  See &lt;code&gt;change-cursor-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, you can change the cursor type or color using a function on &lt;code&gt;post-command-hook&lt;/code&gt; or on a major mode hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'post-command-hook 'my-cursor-change)&#xA;&#xA;(defun my-cursor-change ()&#xA;  (set-cursor-color (if SOME-TEST &quot;Orange&quot; &quot;Blue&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-02T06:09:43.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27504" PostTypeId="2" ParentId="27502" CreationDate="2016-10-02T07:18:32.147" Score="3" Body="&lt;p&gt;You have to take a look at the variable &lt;code&gt;company-backends&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you append the backends you want to use manually, the preconfigured backends will be ignored. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to only complete python commands, you'd have to use &#xA;&lt;code&gt;(add-to-list 'company-backends '(company-jedi))&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should configure your backends for every mode that uses company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you have to install jedi first.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-02T07:25:41.487" LastActivityDate="2016-10-02T07:25:41.487" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27505" PostTypeId="1" AcceptedAnswerId="27518" CreationDate="2016-10-02T07:26:21.473" Score="1" ViewCount="80" Body="&lt;p&gt;I'd like to change the default behaviour of pressing &lt;kbd&gt;C-e&lt;/kbd&gt; so that, If I have an inline comment, pressing  &lt;kbd&gt;C-e&lt;/kbd&gt; should first go to the end of line and pressing it again should go to the beginning of the first non-space character in the inline comment like so :-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(insert code here) ;; |inline comment.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this (I know very little elisp to be able to code this :( )? This was inspired by &lt;code&gt;smarter-move-beginning-of-line&lt;/code&gt; which toggles between the first non-space character in a line and the beginning of line.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-02T17:04:09.370" Title="Toggle between end of line and beginning of an inline comment" Tags="|text-editing|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27506" PostTypeId="2" ParentId="27486" CreationDate="2016-10-02T09:31:31.973" Score="2" Body="&lt;p&gt;I think I found the answer for you. Make sure you have no space(s) before this part in the &lt;em&gt;template definition&lt;/em&gt;: &lt;code&gt;%^{prompt|** My Review}&lt;/code&gt;. This is because &lt;code&gt;orgmode&lt;/code&gt; will retain exact whitespace structure like you instructed in the template. Furthermore, avoid using multiple character in the shortcut key &lt;code&gt;&quot;un&quot; &quot;restaurant&quot;&lt;/code&gt; should be something like &lt;code&gt;&quot;u&quot; &quot;restaurant&quot;&lt;/code&gt;. Actually I could not use that two letters shortcut myself.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="8937" LastEditDate="2016-10-02T09:40:55.863" LastActivityDate="2016-10-02T09:40:55.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27508" PostTypeId="1" AcceptedAnswerId="27509" CreationDate="2016-10-02T11:06:21.963" Score="2" ViewCount="476" Body="&lt;p&gt;When executing some time consuming commands like &lt;code&gt;magit-status&lt;/code&gt; or using &lt;code&gt;scp&lt;/code&gt; to transfer files, then Emacs freezes and waits for return. Is there any way I can tell Emacs to run those commands in the background?&lt;/p&gt;&#xA;" OwnerUserId="10753" LastEditorUserId="306" LastEditDate="2016-10-02T15:40:21.017" LastActivityDate="2016-10-02T15:40:21.017" Title="How to execute emacs commands in background" Tags="|magit|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27509" PostTypeId="2" ParentId="27508" CreationDate="2016-10-02T12:03:15.773" Score="5" Body="&lt;p&gt;No, there is no silver bullet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit, and I am sure Tramp, do run some child processes like &lt;code&gt;git&lt;/code&gt; and &lt;code&gt;scp&lt;/code&gt; asynchronously in some cases and in other cases they do not. The author has to decide on a case-by-case basis if it makes sense for a process to be run asynchronously and whether it is worth to deal with the additional complexity that comes with doing so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally speaking if a child process is called for a side-effect, e.g. &quot;push my changes to a remote&quot;, then things can be done asynchronously. But something like &quot;give me a list of changes&quot; cannot be done asynchronously because you wouldn't be satisfied with a result that boils down to &quot;let me get back to you on that one&quot;. You want to see the up-to-date diff now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of &lt;code&gt;magit-status&lt;/code&gt;, there is little that can be done asynchronously because its purpose is to show the current status of the repository now. Some things can be done to speed up things anyway and Magit already does some of them and others are in planning. E.g. its possible to cache information so that it does not have to be recalculated over and over again, information that isn't actually required yet because it would be hidden anyway can be calculated only when the respective section is actually expanded, and Magit could be taught that certain commands only require certain parts to be updated (it already knows about commands that don't need any updates at all, most of them at least).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That all requires work and planning and there is no switch in Emacs that magically makes all packages smarter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Magit manual has a node about &lt;a href=&quot;https://magit.vc/manual/magit/Performance.html&quot;&gt;performance&lt;/a&gt;. There are some tricks in there that might help in your case and you might also learn a thing or two about why some issues exist.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-10-02T13:17:38.777" LastActivityDate="2016-10-02T13:17:38.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27510" PostTypeId="1" CreationDate="2016-10-02T13:21:28.327" Score="9" ViewCount="1345" Body="&lt;p&gt;I'd like M-g n and M-g p to cycle, at least when I'm using them with flycheck. This feature requires writing a custom function as it's not supported (as mentioned on &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/64&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/flycheck/flycheck/issues/64&lt;/a&gt; and confirmed in chat), but I am an Elisp noob.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other reasons (working around &lt;a href=&quot;https://github.com/commercialhaskell/intero/issues/268&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/commercialhaskell/intero/issues/268&lt;/a&gt;), in &lt;code&gt;flycheck-mode&lt;/code&gt; I bypass &lt;code&gt;next-error&lt;/code&gt; and invoke &lt;code&gt;flycheck-next-error&lt;/code&gt; directly. I can live with normal compilation mode not cycling since I use it seldom (though probably this will get annoying if I do start using compilation mode).&lt;/p&gt;&#xA;" OwnerUserId="2087" LastActivityDate="2018-09-23T23:08:46.897" Title="Getting flycheck &quot;jump to next/previous error&quot; to cycle" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27511" PostTypeId="2" ParentId="27510" CreationDate="2016-10-02T13:21:28.327" Score="4" Body="&lt;p&gt;Here's what I came up with (as a noob) after learning about &lt;code&gt;condition-case&lt;/code&gt;, advices, &lt;code&gt;universal-argument&lt;/code&gt; and some internals of flycheck. I usually don't write code with so little clue of what I'm doing, so I welcome better answers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commented out logging is left in since I don't regard this as finished, and for those who'd like to trace execution of this code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, this does nothing for raw &lt;code&gt;next-error&lt;/code&gt;, it is only invoked when flycheck is.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Optional: ensure flycheck cycles, both when going backward and forward.&#xA;;; Tries to handle arguments correctly.&#xA;;; Since flycheck-previous-error is written in terms of flycheck-next-error,&#xA;;; advising the latter is enough.&#xA;(defun flycheck-next-error-loop-advice (orig-fun &amp;amp;optional n reset)&#xA;  ; (message &quot;flycheck-next-error called with args %S %S&quot; n reset)&#xA;  (condition-case err&#xA;      (apply orig-fun (list n reset))&#xA;    ((user-error)&#xA;     (let ((error-count (length flycheck-current-errors)))&#xA;       (if (and&#xA;            (&amp;gt; error-count 0)                   ; There are errors so we can cycle.&#xA;            (equal (error-message-string err) &quot;No more Flycheck errors&quot;))&#xA;           ;; We need to cycle.&#xA;           (let* ((req-n (if (numberp n) n 1)) ; Requested displacement.&#xA;                  ; An universal argument is taken as reset, so shouldn't fail.&#xA;                  (curr-pos (if (&amp;gt; req-n 0) (- error-count 1) 0)) ; 0-indexed.&#xA;                  (next-pos (mod (+ curr-pos req-n) error-count))) ; next-pos must be 1-indexed&#xA;             ; (message &quot;error-count %S; req-n %S; curr-pos %S; next-pos %S&quot; error-count req-n curr-pos next-pos)&#xA;             ; orig-fun is flycheck-next-error (but without advise)&#xA;             ; Argument to flycheck-next-error must be 1-based.&#xA;             (apply orig-fun (list (+ 1 next-pos) 'reset)))&#xA;         (signal (car err) (cdr err)))))))&#xA;&#xA;(advice-add 'flycheck-next-error :around #'flycheck-next-error-loop-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a snapshot of &lt;a href=&quot;https://gist.github.com/Blaisorblade/c7349438b06e7b1e034db775408ac4cb&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/Blaisorblade/c7349438b06e7b1e034db775408ac4cb&lt;/a&gt;, where I'll place any updated version.&lt;/p&gt;&#xA;" OwnerUserId="2087" LastEditorUserId="454" LastEditDate="2018-09-23T23:08:46.897" LastActivityDate="2018-09-23T23:08:46.897" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="27512" PostTypeId="2" ParentId="27505" CreationDate="2016-10-02T14:54:37.037" Score="0" Body="&lt;p&gt;Something like this should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun impaktor-move-end-of-line ()&#xA;  (interactive)&#xA;  (when (comment-search-forward (line-end-position) t)&#xA;    (goto-char (match-beginning 0))&#xA;    (skip-syntax-backward &quot; &quot; (line-beginning-position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To this function, you'll probably need to give a shortcut, something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f2&amp;gt; e&quot;) 'impaktor-move-end-of-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;https://www.emacswiki.org/emacs/EndOfLineNoComments&quot; rel=&quot;nofollow&quot;&gt;EmacsWiki&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2016-10-02T14:54:37.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27513" PostTypeId="1" AcceptedAnswerId="27529" CreationDate="2016-10-02T15:23:46.557" Score="0" ViewCount="102" Body="&lt;p&gt;I define an alist like this:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq major-mode-list&#xA;  '(((emacs-lisp-mode inferior-emacs-lisp-mode) . (&quot;Elisp&quot; &quot;Emacs&quot;))&#xA;    ((haskell-mode) . (&quot;Haskell&quot; &quot;Haskell&quot;))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And match current major-mode with this function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt; (defun major-mode-icon-3 ()&#xA;   (let* ((match (assoc&#xA;                  (car (mapcar&#xA;                        (lambda (element)&#xA;                          (member (buffer-local-value 'major-mode (current-buffer))&#xA;                                  element))&#xA;                        (map-keys major-mode-list)))&#xA;                  major-mode-list))&#xA;          (name (car (cdr match)))&#xA;          (icon (car (cdr (cdr match)))))&#xA;     )&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Function works correct in &lt;code&gt;((emacs-lisp-mode inferior-emacs-lisp-mode) . (&quot;Elisp&quot; &quot;Emacs&quot;))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But not correct in &lt;code&gt;((haskell-mode) . (&quot;Haskell&quot; &quot;Haskell&quot;))&lt;/code&gt;. The function will&#xA;return &lt;code&gt;nil&lt;/code&gt; because of &lt;code&gt;(car (haskell-mode))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: How to correct this function?&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="105" LastEditDate="2016-10-02T16:57:53.043" LastActivityDate="2016-11-03T06:18:11.130" Title="car on cons gets nil" Tags="|debugging|association-lists|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27514" PostTypeId="1" CreationDate="2016-10-02T15:55:02.343" Score="4" ViewCount="2717" Body="&lt;p&gt;This is a long-standing problem that I haven't found a solution for months. I sometimes copy text or snippet from somewhere relse and paste into my emacsclient in the Terminal by &lt;code&gt;Ctrl + Shift + V&lt;/code&gt; (Gnome Terminal, Linux). Emacs frequently interferes with this pasting by triggering arbitrary commands. This breaks the pasting job, and may also be a security risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;head -n1 ucsc.refseq.txt &amp;gt;refseq.sorted.txt &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would be trucated to &lt;code&gt;head -n1 ucsc.re&lt;/code&gt; and send &lt;code&gt;eq.txt &amp;gt;re&lt;/code&gt; to some other command (i.e. switch buffer). The &lt;code&gt;eq.sorted.txt&lt;/code&gt; disappears. And the &lt;code&gt;fs&lt;/code&gt; parts were interpreted as some command/mt macro that I can't find from any exposed emacs function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried with &lt;code&gt;clipboard-yank&lt;/code&gt;, pasting produced different result but still not complete content I want to paste.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how do I make emacs paste literally all of my clipboard content, without triggering anything?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it helps anything: my emacs version 24.5 with spacemacs configuration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some more background information: &#xA;The problem here is that I use my local computer to select and copy text. Then I paste into emacsclient with the ssh. This means the my local clipboard's content has to be transferred to the remote server letter by letter, not the normal way of clipboard handling. And that causes the problem. &lt;/p&gt;&#xA;" OwnerUserId="8937" LastEditorUserId="12895" LastEditDate="2016-10-21T20:11:38.757" LastActivityDate="2016-10-21T20:11:38.757" Title="How to paste from clipboard litterally into emacsclient within an ssh session?" Tags="|spacemacs|emacsclient|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27515" PostTypeId="2" ParentId="27495" CreationDate="2016-10-02T16:00:46.577" Score="0" Body="&lt;p&gt;As to the &lt;em&gt;first&lt;/em&gt; question (&quot;&lt;em&gt;Is there a way I can set the cursor color per buffer so that it doesn't clobber the cursor color for other buffers?&lt;/em&gt;&quot;), the answer is:  &quot;No, this is not presently an available feature.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As described by @JeanPierre in the initial comment underneath the question above, cursor color is set on a per-frame basis -- i.e., &lt;em&gt;not&lt;/em&gt; on a per-buffer basis, and &lt;em&gt;not&lt;/em&gt; on a per-window basis.  Therefore, all visible windows on the same frame will be affected by a change in cursor color made from anywhere inside said frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the &lt;em&gt;second&lt;/em&gt; question (&quot;&lt;em&gt;Or maybe is there a way where I can detect that I am 'entering' and 'leaving' the buffer and set the cursor color appropriately?&lt;/em&gt;&quot;), see the other answers in this thread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One idea the original poster may wish to consider is experimenting with the variable &lt;code&gt;cursor-in-non-selected-windows&lt;/code&gt;, which could perhaps be used in conjunction with the other answers to completely remove or change the type of cursor in non-selected windows.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-10-02T16:14:55.193" LastActivityDate="2016-10-02T16:14:55.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27516" PostTypeId="1" CreationDate="2016-10-02T16:12:09.643" Score="0" ViewCount="85" Body="&lt;p&gt;When I byte compile an elisp file via &lt;code&gt;emacs -batch -f batch-byte-compile&lt;/code&gt; I get &lt;strong&gt;Warning: load-theme called with 2 arguments, but accepts only 1&lt;/strong&gt;. The code in question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(load-theme 'solarized-light t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The source in Emacs 25.1's custom.el: &lt;code&gt;(defun load-theme (theme &amp;amp;optional no-confirm no-enable)&lt;/code&gt; ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly I get &lt;strong&gt;set-frame-font called with 3 arguments, but accepts&#xA;    only 1-2&lt;/strong&gt; when set-frame-font's help says: &lt;code&gt;(set-frame-font FONT &amp;amp;optional KEEP-SIZE FRAMES)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is confused, the byte compiler or I; and why? &lt;/p&gt;&#xA;" OwnerUserId="5146" LastEditorUserId="5146" LastEditDate="2016-10-02T16:20:49.690" LastActivityDate="2016-12-01T19:29:06.850" Title="byte compiler warning: called with 2 arguments, but accepts only 1" Tags="|byte-compilation|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27517" PostTypeId="1" CreationDate="2016-10-02T16:45:08.360" Score="1" ViewCount="298" Body="&lt;p&gt;I would like to reset my working directory to the state in another commit. In pure git, I'd use &lt;code&gt;git checkout &amp;lt;commit&amp;gt; -- &amp;lt;file&amp;gt;&lt;/code&gt;. Is there a way to reach similar functionality from any of the dispatch popups in magit?&lt;/p&gt;&#xA;" OwnerUserId="8357" LastEditorUserId="8357" LastEditDate="2016-10-03T04:27:25.027" LastActivityDate="2016-10-03T04:27:25.027" Title="Magit equivalent of `git checkout &lt;tree-ish&gt; &lt;path&gt;`" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27518" PostTypeId="2" ParentId="27505" CreationDate="2016-10-02T17:04:09.370" Score="3" Body="&lt;p&gt;I bumped into this package in MELPA which does exactly what I wanted :- &lt;a href=&quot;https://github.com/alezost/mwim.el&quot; rel=&quot;nofollow&quot;&gt;mwin&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-02T17:04:09.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27519" PostTypeId="1" CreationDate="2016-10-02T17:12:35.233" Score="2" ViewCount="55" Body="&lt;p&gt;We have &lt;code&gt;org-babel-get-src-block-info&lt;/code&gt; and &lt;code&gt;org-babel-view-src-block-info&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything similar to programatically (or preferably interactively) changing the choices from the &lt;code&gt;src-block-info&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what would be the recommended way to do that?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2016-10-02T17:12:35.233" Title="Org-babel `set` src-block-info?" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27520" PostTypeId="2" ParentId="27516" CreationDate="2016-10-02T17:33:26.347" Score="1" Body="&lt;p&gt;A guess would be that you are byte-compiling in an older Emacs version, which does not support the additional arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you byte-compile with Emacs 23 then you will get such warnings, because those args are not supported.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-02T17:33:26.347" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27521" PostTypeId="2" ParentId="27517" CreationDate="2016-10-02T19:13:42.770" Score="1" Body="&lt;p&gt;Use &lt;code&gt;M-x magit-checkout-file RET &amp;lt;rev&amp;gt; RET &amp;lt;file RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-10-02T19:13:42.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27523" PostTypeId="1" CreationDate="2016-10-03T00:18:24.310" Score="10" ViewCount="6674" Body="&lt;p&gt;What is the meaning of the possible values for #+STARTUP?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2021-10-02T17:49:18.400" Title="Org mode initial visibility with #+STARTUP" Tags="|org-mode|visibility|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27524" PostTypeId="2" ParentId="27523" CreationDate="2016-10-03T00:18:24.310" Score="20" Body="&lt;p&gt;The Org-mode manual indicates these possible values for &lt;a href=&quot;https://orgmode.org/manual/Initial-visibility.html#Initial-visibility&quot; rel=&quot;noreferrer&quot;&gt;initial visibility&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: overview&#xA;#+STARTUP: content&#xA;#+STARTUP: showall&#xA;#+STARTUP: show2levels&#xA;#+STARTUP: show3levels&#xA;#+STARTUP: show4levels&#xA;#+STARTUP: show5levels&#xA;#+STARTUP: showeverything&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With the following meanings, according to the &lt;a href=&quot;https://orgmode.org/manual/In_002dbuffer-Settings.html&quot; rel=&quot;noreferrer&quot;&gt;summary of in-buffer setting&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;overview         top-level headlines only&#xA;content          all headlines&#xA;showall          no folding of any entries&#xA;showeverything   show even drawer contents&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;br/&gt;&#xA;*Bonus*: the Elisp command `describe-variable`, shortcut `C-h v`, shows in the documentation for `org-startup-folded` variable, these two possible values:&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: fold              (or `overview', this is equivalent)&#xA;#+STARTUP: nofold            (or `showall', this is equivalent) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="36093" LastEditDate="2021-10-02T17:49:18.400" LastActivityDate="2021-10-02T17:49:18.400" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27525" PostTypeId="1" AcceptedAnswerId="27527" CreationDate="2016-10-03T00:29:38.427" Score="9" ViewCount="5079" Body="&lt;p&gt;Is there a way to change the font associated with the variable-pitch-mode? On my emacs installation enabling variable-pitch-mode changes the font to a sans-serif font; I would like to use a serif font instead.&lt;/p&gt;&#xA;" OwnerDisplayName="user13413" LastEditorUserId="105" LastEditDate="2016-10-03T03:24:15.677" LastActivityDate="2016-10-03T03:24:15.677" Title="Changing the Variable Pitch Font" Tags="|faces|variable-pitch|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27527" PostTypeId="2" ParentId="27525" CreationDate="2016-10-03T03:16:01.883" Score="7" Body="&lt;p&gt;It seems that function &lt;code&gt;variable-pitch-mode&lt;/code&gt; hard-codes the use of face &lt;code&gt;variable-pitch&lt;/code&gt;.  I think your two choices (other than perhaps advising that function) are these:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Use face&lt;/em&gt; &lt;code&gt;variable-pitch&lt;/code&gt;.  Just customize it to be have any appearance you want: &lt;code&gt;M-x customize-face variable-pitch&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Write your own command&lt;/em&gt;, similar to &lt;code&gt;variable-pitch-mode&lt;/code&gt;.  That definition is very short.  You need only substitute your own face for face &lt;code&gt;variable-pitch&lt;/code&gt; in that definition.  (You could also define your command using &lt;code&gt;buffer-face-mode-invoke&lt;/code&gt;, which is what &lt;code&gt;variable-pitch-mode&lt;/code&gt; uses.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun my-variable-pitch-mode (&amp;amp;optional arg face)&#xA;      &quot;MY Variable-pitch default-face mode.&#xA;    An interface to `buffer-face-mode' which uses FACE&#xA;    \(`variable-pitch', by default).&#xA;    Besides the choice of FACE, it is the same as `buffer-face-mode'.&quot;&#xA;      (interactive (list (or current-prefix-arg 'toggle)))&#xA;      (buffer-face-mode-invoke face arg (called-interactively-p 'interactive)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In fact, I'll (or you can) suggest that as the definition of &lt;code&gt;variable-pitch-mode&lt;/code&gt;, using &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.  (I've done that now - bug #&lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24594&quot; rel=&quot;noreferrer&quot;&gt;24594&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-03T03:23:41.130" LastActivityDate="2016-10-03T03:23:41.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27528" PostTypeId="2" ParentId="27488" CreationDate="2016-10-03T04:12:55.707" Score="1" Body="&lt;p&gt;I'm not 100% sure what the question is, but I can see a problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;electric-indent-mode&lt;/code&gt; is a global minor mode, so when your &lt;code&gt;text-mode-hook&lt;/code&gt; function runs, it disables it globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;electric-indent-mode&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a global minor mode.  To toggle the mode in a single buffer, use `electric-indent-local-mode'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Therefore your code should be calling:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(electric-indent-local-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;n.b. Because you've used a lambda in a hook variable, you're liable to accidentally leave the original function in the hook when you add the modified version. If you're unsure, you should restart Emacs to make certain that the original call to the global mode isn't still happening. I recommend avoiding the use of lambdas in hook variables for this reason, and instead always using named functions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-text-mode-hook ()&#xA;  &quot;Custom behaviours for `text-mode'.&quot;&#xA;  (setq indent-line-function 'tab-to-tab-stop)&#xA;  (electric-indent-local-mode -1))&#xA;&#xA;(add-hook 'text-mode-hook 'my-text-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-10-03T04:22:30.220" LastActivityDate="2016-10-03T04:22:30.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27529" PostTypeId="2" ParentId="27513" CreationDate="2016-10-03T05:33:54.833" Score="0" Body="&lt;p&gt;There are two methods.&#xA;One simple methods is &lt;code&gt;(remove nil '(nil nil (clojure-mode) nil nil ..)&lt;/code&gt;. This answer is from IRC channel #emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And another method is to use &lt;code&gt;cl-some&lt;/code&gt; which is from Google search:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (cl-some&#xA;    (lambda (elem)&#xA;      (when (not (null elem))&#xA;        elem))&#xA;    (mapcar&#xA;     (lambda (element)&#xA;       (member major-mode element))&#xA;     (map-keys major-mode-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Better way is use &lt;code&gt;cl-assoc-if&lt;/code&gt; as @npostavs suggest.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2016-11-03T06:18:11.130" LastActivityDate="2016-11-03T06:18:11.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27532" PostTypeId="2" ParentId="26732" CreationDate="2016-10-03T10:34:45.347" Score="2" Body="&lt;p&gt;I used these functions for that&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; yank in term (kill-ing)&#xA;(defun term-yank-kill-ring ()&#xA;  (interactive)&#xA;  (flet ((insert-for-yank (string) (term-send-raw-string string)))&#xA;    (yank)))&#xA;;; yank-pop un term (kill-ring)&#xA;(defun term-yank-pop-kill-ring ()&#xA;  (interactive)&#xA;  (dotimes (i (- (point) (mark t)))&#xA;    (term-send-backspace))&#xA;  (process-send-string&#xA;   (get-buffer-process (current-buffer))&#xA;   (current-kill 1)))&#xA;;; shorcuts&#xA;(setq term-bind-key-alist&#xA;      '((&quot;C-x C-y&quot; . term-yank-kill-ring)&#xA;        (&quot;C-x M-y&quot; . term-yank-pop-kill-ring)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-10-03T10:34:45.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27533" PostTypeId="2" ParentId="27501" CreationDate="2016-10-03T11:02:37.623" Score="3" Body="&lt;p&gt;To replace space and/or tab sequence followed by an asterisk to just an asterisk:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ LiteralTabHere]+\*&#xA;*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That LiteralTabHere should be a literal tab char. Enter it by pressing C-q C-i.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need the backslash before asterisk. Because the asterisk is a meta char, it means 0 or more items.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To insert a space before the first non-white-space character after 2 slashes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;//\([[:graph:]]+\)&#xA;// \1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To remove blank lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\n\n\n+&#xA;\n\n&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each &lt;code&gt;\n&lt;/code&gt; must be a literal return. To insert literal return, press C-q C-j.&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="305" LastEditDate="2016-10-05T15:28:16.067" LastActivityDate="2016-10-05T15:28:16.067" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="27534" PostTypeId="1" CreationDate="2016-10-03T13:06:49.637" Score="3" ViewCount="287" Body="&lt;p&gt;Here &quot;menu&quot; means something which appears when you hit F10. (Not the menubar.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because my display is small, several options are hidden below. (See the following image. You can not see &quot;Quit&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Vz6Ei.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Vz6Ei.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is sometimes annoying me, so I would like to make the line hight in the menu list smaller. But the following &lt;code&gt;gtk.css&lt;/code&gt; does not affect the line-height. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#pane #menubar GtkMenuShell &#xA;{&#xA;    line-height: 100px !important;&#xA;    background-color: #000;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is : what should I write in &lt;code&gt;gtk.css&lt;/code&gt; to change the line-height in the list of menu?&lt;/p&gt;&#xA;" OwnerUserId="9061" LastActivityDate="2016-10-03T13:06:49.637" Title="How to change the line height in the menu" Tags="|customize|css|gtk3|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27535" PostTypeId="1" AcceptedAnswerId="27539" CreationDate="2016-10-03T13:56:14.287" Score="1" ViewCount="240" Body="&lt;p&gt;Sometimes it would be handy to get the previously entered field values, and process them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; the second field (function name) of this snippet is always the camelCase version of the first field (description) in my workflow.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;describe('$1', function $2() {&#xA;  $0&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To write lisp function to do this, one should know how to get the value of the first field.&lt;/p&gt;&#xA;" OwnerUserId="10978" LastActivityDate="2016-10-03T18:30:15.813" Title="Getting the value of previos field with yasnippet" Tags="|yasnippet|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27536" PostTypeId="1" CreationDate="2016-10-03T15:47:08.427" Score="0" ViewCount="5806" Body="&lt;p&gt;I would like Emacs to open the folder &lt;code&gt;$HOME/Documents/CodeLite/CPP-Math-Projects/Simple-Pendulum&lt;/code&gt; on startup and show it in the directory browser. Is there a way to do this? I have read &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html&lt;/a&gt;, but it is too abstract for me to follow, given the fact I am fairly unconfident with Emacs Lisp. &lt;/p&gt;&#xA;" OwnerUserId="11131" LastActivityDate="2016-10-17T16:29:17.347" Title="How to get Emacs to automatically open a specific directory on startup?" Tags="|customize|start-up|directory|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27537" PostTypeId="2" ParentId="27536" CreationDate="2016-10-03T15:56:06.127" Score="3" Body="&lt;p&gt;Oops, never mind, I read the link I provided earlier again and I finally got how to turn it into an &lt;code&gt;~/.emacs&lt;/code&gt; modification. Specifically I added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq initial-buffer-choice &quot;~/Documents/CodeLite/CPP-Math-Projects/Simple-Pendulum&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;~/.emacs&lt;/code&gt; file. &lt;/p&gt;&#xA;" OwnerUserId="11131" LastActivityDate="2016-10-03T15:56:06.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27538" PostTypeId="2" ParentId="27536" CreationDate="2016-10-03T15:59:57.467" Score="1" Body="&lt;p&gt;If you are on MS Windows, consider using this simple way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create a Windows shortcut, with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;runemacs.exe&lt;/code&gt; (with its path), in field &lt;em&gt;Target&lt;/em&gt;.  Include any command-line switches you like - e.g., &lt;code&gt;D:\Emacs-25.1\bin\runemacs.exe --debug-init&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;The directory you want Emacs to start in, in field &lt;em&gt;Start in&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can also have Emacs start out by visiting that directory in Dired. To do that, just add the directory at the end of field &lt;em&gt;Target&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, to start Emacs, just double-click your shortcut.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-03T15:59:57.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27539" PostTypeId="2" ParentId="27535" CreationDate="2016-10-03T18:30:15.813" Score="1" Body="&lt;p&gt;According to the &lt;a href=&quot;http://joaotavora.github.io/yasnippet/snippet-development.html#sec-3-6&quot; rel=&quot;nofollow&quot;&gt;Yasnippet Documentation&lt;/a&gt; in the &lt;em&gt;Mirrors with Transformations&lt;/em&gt;, you can have a &lt;code&gt;$1&lt;/code&gt; substitution multiple times in your snippet, but each one can be transformed. Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;describe('$1', function ${1:$(camelize yas-text)}() {&#xA;  $0&#xA;});&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That said, you'll need a &lt;code&gt;camelize&lt;/code&gt; function written in Lisp. Check out the examples on the &lt;a href=&quot;https://www.emacswiki.org/emacs/CamelCase&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt;, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun camelize (s)&#xA;  &quot;Convert under_score string S to CamelCase string.&quot;&#xA;  (mapconcat 'identity (mapcar&#xA;                        '(lambda (word) (capitalize (downcase word)))&#xA;                        (split-string s &quot;_&quot;)) &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="173" LastActivityDate="2016-10-03T18:30:15.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27540" PostTypeId="1" CreationDate="2016-10-03T18:34:20.943" Score="0" ViewCount="73" Body="&lt;p&gt;I am using the python mode. When i try to evaluate the following &lt;code&gt;def&lt;/code&gt; using &lt;code&gt;C-M-x&lt;/code&gt; i get this error from the python interpreter which looks strange:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo(*args, **kwargs):&#xA;    print args, kwargs&#xA;&#xA;&amp;gt;&amp;gt;&amp;gt; Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;  File &quot;/home/amir/programming/python/tst.py&quot;, line 2&#xA;    if True:&#xA;           ^&#xA;IndentationError: expected an indented block&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can any one say why this happens? The file is only including the above function definition beginning from the first line an nothing more.&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastActivityDate="2016-10-05T07:21:24.933" Title="Strange Errors in Python-Mode" Tags="|indentation|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27541" PostTypeId="1" AcceptedAnswerId="27551" CreationDate="2016-10-03T18:37:56.930" Score="1" ViewCount="152" Body="&lt;p&gt;I recently shifted form &lt;code&gt;bash&lt;/code&gt; to &lt;code&gt;zsh&lt;/code&gt; and also installed &lt;code&gt;ohmyz&lt;/code&gt;. Since then my emacs theme doesn't work.&lt;a href=&quot;https://i.stack.imgur.com/RTYqV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RTYqV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the one on the Left is how it looks in bash. On the right, when run on zsh its different.&#xA;Thanks,.&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="253" LastEditDate="2016-10-03T19:40:11.167" LastActivityDate="2016-10-04T07:01:13.570" Title="emacs theme changes when i moved to zsh from bash" Tags="|themes|bash|zsh|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27542" PostTypeId="1" CreationDate="2016-10-03T18:51:48.057" Score="0" ViewCount="519" Body="&lt;p&gt;I have the following line in my .emacs.d/init.el file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [(control tab)]  'other-window)&#xA;;; remap f1 to undo&#xA;(global-set-key (kbd &quot;&amp;lt;f1&amp;gt;&quot;) 'undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use the full X-window GUI version of emacs, the commands works fine.  When I start using the &lt;code&gt;-nw&lt;/code&gt; options to use Emacs in a terminal, they don't work at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="13497" LastEditorUserId="253" LastEditDate="2016-10-03T19:39:43.380" LastActivityDate="2016-10-05T10:36:19.950" Title="global-set-key not working in terminal" Tags="|init-file|terminal-emacs|gui-emacs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27543" PostTypeId="1" CreationDate="2016-10-03T18:52:58.833" Score="1" ViewCount="112" Body="&lt;p&gt;The mouse pointer shape changes whether its over the buffer, over the mode line, or header line, if that exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the mouse pointer shapes for these different areas to something other than their defaults?&lt;/p&gt;&#xA;" OwnerUserId="13019" LastActivityDate="2016-10-03T18:52:58.833" Title="How to change mouse pointer in mode line or header line?" Tags="|mode-line|mouse|header-line|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27544" PostTypeId="1" AcceptedAnswerId="27548" CreationDate="2016-10-04T00:16:24.090" Score="0" ViewCount="276" Body="&lt;p&gt;When right- or middle-clicking on a headline generated in the agenda, org will open a buffer with the file containing that headline. That headline will be centered in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make it so that clicking on an agenda link aligns the headline to the top of the buffer rather than the center?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that I could do this manually by customizing &lt;code&gt;recenter-positions&lt;/code&gt; and then hitting &lt;code&gt;C l&lt;/code&gt; (&lt;code&gt;recenter-top-bottom&lt;/code&gt;), but I really would like this to happen automatically.&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-10-04T05:37:33.920" Title="Org-mode: Recenter buffer to top when clicking on an org-agenda link" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27545" PostTypeId="1" AcceptedAnswerId="27546" CreationDate="2016-10-04T01:44:48.083" Score="4" ViewCount="3297" Body="&lt;p&gt;Using git cli I would execute  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git diff SHA#1 SHA#2&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one do the equivalent in magit? &lt;/p&gt;&#xA;" OwnerUserId="12780" LastEditorUserId="12780" LastEditDate="2016-10-04T02:25:52.560" LastActivityDate="2016-10-04T08:52:35.737" Title="Magit git diff between two specific SHAs" Tags="|magit|git|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27546" PostTypeId="2" ParentId="27545" CreationDate="2016-10-04T02:26:31.987" Score="6" Body="&lt;p&gt;Use the diff range command with the &lt;code&gt;..&lt;/code&gt; syntax:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;d&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt; &lt;code&gt;SHA#1..SHA#2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to the git diff man page:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   git diff [--options] &amp;lt;commit&amp;gt; &amp;lt;commit&amp;gt; [--] [&amp;lt;path&amp;gt;...]&#xA;       This is to view the changes between two arbitrary &amp;lt;commit&amp;gt;.&#xA;&#xA;   git diff [--options] &amp;lt;commit&amp;gt;..&amp;lt;commit&amp;gt; [--] [&amp;lt;path&amp;gt;...]&#xA;       This is synonymous to the previous form. If &amp;lt;commit&amp;gt; on one side is omitted,&#xA;       it will have the same effect as using HEAD instead.&#xA;&#xA;   git diff [--options] &amp;lt;commit&amp;gt;...&amp;lt;commit&amp;gt; [--] [&amp;lt;path&amp;gt;...]&#xA;       This form is to view the changes on the branch containing and up to the second&#xA;       &amp;lt;commit&amp;gt;, starting at a common ancestor of both &amp;lt;commit&amp;gt;. &quot;git diff A...B&quot; is&#xA;       equivalent to &quot;git diff $(git-merge-base A B) B&quot;. You can omit any one of&#xA;       &amp;lt;commit&amp;gt;, which has the same effect as using HEAD instead.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that you can type both commits with completion (but you have to type the &lt;code&gt;..&lt;/code&gt; before completion for the second kicks in).&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="306" LastEditDate="2016-10-04T08:51:43.533" LastActivityDate="2016-10-04T08:51:43.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27547" PostTypeId="1" AcceptedAnswerId="27550" CreationDate="2016-10-04T04:34:53.423" Score="4" ViewCount="3506" Body="&lt;p&gt;I would like to set custom keyboard shortcuts for the Open File and Open Directory commands listed in the &lt;code&gt;File&lt;/code&gt; menu. The only problem is that I don't know the corresponding Lisp commands. I've tried open-file but it doesn't work. I've tried Googling for the answer, but it too failed. &lt;/p&gt;&#xA;" OwnerUserId="11131" LastActivityDate="2016-10-04T05:56:50.660" Title="Open File and Directory: What's the Emacs command?" Tags="|commands|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27548" PostTypeId="2" ParentId="27544" CreationDate="2016-10-04T05:37:33.920" Score="0" Body="&lt;p&gt;Using the function &lt;code&gt;describe-key&lt;/code&gt;, we can trace &lt;code&gt;org-agenda-goto-mouse&lt;/code&gt; to &lt;code&gt;org-agenda-goto&lt;/code&gt;, and from there we can examine the function in the &lt;code&gt;org-agenda.el&lt;/code&gt; library to see what makes it tick.  The re-centering command is hard-coded as &lt;code&gt;(recenter (/ (window-height) 2))&lt;/code&gt;, which means it cannot be easily controlled by the user with an optional argument or by customizing a variable.  In general, functions an be redefined by &lt;code&gt;require&lt;/code&gt;-ing the library followed by the newly defined function with the same name:  &lt;code&gt;(require 'org-agenda) (defun org-agenda-goto (&amp;amp;optional highlight) &quot;Go to the Org-mode file which contains the item at point.&quot; ...)&lt;/code&gt; Change the portion relating to recentering. The doc-string for &lt;code&gt;recenter&lt;/code&gt; describes the available methods of controling the behavior of said function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the process of inspecting &lt;code&gt;org-agenda-goto&lt;/code&gt;, we learned that &lt;code&gt;org-agenda-after-show-hook&lt;/code&gt; is called at the tail-end.  A less efficient alternative approach to modifying &lt;code&gt;org-agenda-goto&lt;/code&gt; would be to add new behavior to the aforementioned hook -- however, that would essentially call &lt;em&gt;again&lt;/em&gt; &lt;code&gt;recenter&lt;/code&gt; to fix the undesired previous call.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-10-04T05:37:33.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27549" PostTypeId="1" CreationDate="2016-10-04T05:40:28.850" Score="4" ViewCount="1973" Body="&lt;p&gt;I often find myself copying commands line by line from an emacs buffer to my terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i bind a shortcut which sends the current line/selection in emacs to my gnome-terminal?&lt;/p&gt;&#xA;" OwnerUserId="13430" LastActivityDate="2019-12-30T04:54:57.660" Title="Execute current line in shell" Tags="|shell|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27550" PostTypeId="2" ParentId="27547" CreationDate="2016-10-04T05:56:50.660" Score="6" Body="&lt;p&gt;Emacs is designed to be self-documenting. A comment has already shown you how to use &lt;code&gt;C-h k&lt;/code&gt; to get help for a keyboard shortcut (or a menu shortcut in this case). There are other quite a lot of other help commands available. You can get a list of them by typing &lt;code&gt;C-h ?&lt;/code&gt;. It's a pretty long list, but I'll describe two that you'll especially want to remember (in addition to &lt;code&gt;C-h k&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f&lt;/code&gt; gives you help for a function, if you know that function's name. Obviously not directly helpful in your case, since you didn't yet know the name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h a&lt;/code&gt; searches for commands by name, but you don't have to know the exact name. For example, you could have typed in &quot;file&quot; at the resulting prompt and it would give you a list of all commands with the word &quot;file&quot; in the name. Unfortunately for you that's a pretty long list. Clicking on anything in this list (or putting the cursor on it and hitting enter) takes you to the same help that &lt;code&gt;C-h f&lt;/code&gt; gives you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h i&lt;/code&gt; opens up the Info viewer. This is a great choice when you get lost, because Emacs comes with a bunch of different manuals which you can read here. You start out at an index listing all the available manuals. Go down to the Emacs manual and click or hit enter to view it. There's a huge amount of stuff in here, but it's pretty well organized. In your case I would scan down the table of contents until I saw an entry labeled &quot;Files&quot; under the heading &quot;Major Structures of Emacs&quot;. That link takes us to chapter 18. The second paragraph explains that opening a file is usually called &quot;visiting&quot; the file, though it doesn't get into the historical reasons for that. There's another table of contents for the chapter there, and the second entry is labeled &quot;Visiting&quot;, so that's the obvious next step. That gives us a nice list of different commands for visiting files (yes, there's more than one) as well as a bunch of prose that describes things in some detail. There's nothing much there about directories, but that's documented a little further along in section 18.8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h m&lt;/code&gt; shows help information about all the various modes which are active in the current buffer. Usually that's a major mode which is determined by the file type, plus some number of minor modes that add features that are available for many types of files. Not of any direct use for you, since it won't show you the &lt;code&gt;find-file&lt;/code&gt; command you were looking for, but you'll consult this information fairly frequently. You might take a look while you're reading the manuals to see the handy keyboard shortcuts for navigating up and down the tree structure of the manuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h b&lt;/code&gt; shows you a listing of every single keybinding currently configured in the current buffer. This is never going to be a small list, but it's handy because it's generated from the actual keymaps that are currently in place. This means that nothing is ever left out; while other sources are hand-written and might ommit details for clarity, this always includes everything.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-04T05:56:50.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27551" PostTypeId="2" ParentId="27541" CreationDate="2016-10-04T07:01:13.570" Score="1" Body="&lt;p&gt;Are $TERM environment variables same value ? If its value is different from each other. It causes different looking.&lt;/p&gt;&#xA;" OwnerUserId="5415" LastActivityDate="2016-10-04T07:01:13.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27552" PostTypeId="1" AcceptedAnswerId="27568" CreationDate="2016-10-04T07:49:34.920" Score="3" ViewCount="720" Body="&lt;p&gt;I use the following to keep track of my daily tasks/todos etc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Monday 03.10.2016 [7/18]...&#xA;** Tuesday 04.10.2016&#xA;       CLOCK: [2016-10-04 Di. 09:00]&#xA;Some things to do...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would I carry over the open tasks from Monday to Tuesday's block in org-mode?&lt;/p&gt;&#xA;" OwnerUserId="10754" LastActivityDate="2016-10-04T16:23:08.950" Title="Org-mode: How do you carry over incomplete todo items?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27553" PostTypeId="2" ParentId="27545" CreationDate="2016-10-04T08:52:35.737" Score="5" Body="&lt;p&gt;If both commits are near each other in some Magit buffer, then it might be convenient to mark them using the region and then pressing &lt;kbd&gt;d d&lt;/kbd&gt;. With such an active region &quot;diff dwim&quot; assumes that you want to compare the commits at the edge of the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;d r&lt;/kbd&gt; works always. It might just be a bit annoying to type or copy-paste hashes.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-10-04T08:52:35.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27554" PostTypeId="1" CreationDate="2016-10-04T10:53:55.153" Score="1" ViewCount="795" Body="&lt;p&gt;After upgrading to Emacs 25, I get &lt;code&gt;gnutls-negotiate: Certificate validation failed for [hostname] verification code 402&lt;/code&gt; on connecting to my weechat IRC proxy, with no prompt about accepting things anyway. I already have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-to-list 'gnutls-trustfiles &quot;~/.emacs.d/weechat-relay.cert&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where weechat-relay.cert is the CERTIFICATE part of the weechat IRC proxy ssl key.&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2017-03-03T12:23:38.660" Title="gnutls-negotiate: Certificate validation failed for [hostname] verification code 402" Tags="|gnutls|ssl|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27555" PostTypeId="2" ParentId="27554" CreationDate="2016-10-04T10:53:55.153" Score="1" Body="&lt;p&gt;I tried &lt;code&gt;gnutls-cli hostname -p 9001&lt;/code&gt; to check if there actually was a problem with the cert (and not just my Emacs 25) and it turns out the certificate was expired. So it seems Emacs 24 didn't care about expiry (nor did the weechat android app). Redoing &lt;a href=&quot;http://www.weechat.org/files/doc/stable/weechat_user.en.html#relay_ssl&quot; rel=&quot;nofollow&quot;&gt;http://www.weechat.org/files/doc/stable/weechat_user.en.html#relay_ssl&lt;/a&gt; (and updating my &lt;code&gt;~/.emacs.d/weechat-relay.cert&lt;/code&gt;) solved it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would of course be nice if Emacs could say it was expired instead of just &quot;402&quot; (which gnutls docs say is the rather unhelpful &lt;a href=&quot;https://www.gnutls.org/manual/html_node/Error-codes.html&quot; rel=&quot;nofollow&quot;&gt;GNUTLS_E_LIB_IN_ERROR_STATE&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2016-10-04T10:53:55.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27556" PostTypeId="1" CreationDate="2016-10-04T11:32:10.910" Score="5" ViewCount="1784" Body="&lt;p&gt;My Internet was not working, and while waiting it to go back up, I used Emacs to type some ideas first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few minutes later, the Internet was up, and I checked my Chrome browser, and it worked. So I will use Google Docs instead, I thought.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I came back to Emacs and too quickly pressed CTRL-x CTRL-c, and Emacs exited without asking. Will everything I typed be gone forever?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw some way to make scratch persistent if we configure it, but it seems weird if Emacs actually will exit without asking and let the content be gone forever without warning.&lt;/p&gt;&#xA;" OwnerUserId="10496" LastActivityDate="2016-10-04T15:38:39.017" Title="If I press CTRL-x CTRL-c and exited the scratch buffer in Emacs, will everything I typed be gone?" Tags="|quitting|exit|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27557" PostTypeId="2" ParentId="27556" CreationDate="2016-10-04T12:23:23.890" Score="2" Body="&lt;p&gt;The short answer is yes, unfortunately. But see &lt;a href=&quot;https://emacs.stackexchange.com/q/19254/962&quot;&gt;this question&lt;/a&gt; for hints on avoiding this in the future.&lt;/p&gt;&#xA;" OwnerUserId="962" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-10-04T12:23:23.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27558" PostTypeId="2" ParentId="26059" CreationDate="2016-10-04T12:27:19.820" Score="0" Body="&lt;p&gt;If you are on macOS, there is &lt;a href=&quot;https://pqrs.org/osx/karabiner/&quot; rel=&quot;nofollow&quot;&gt;karabiner&lt;/a&gt;. It can dual map both &lt;code&gt;control&lt;/code&gt; and &lt;code&gt;SPC&lt;/code&gt; to spacebar. If you press &lt;code&gt;SPC&lt;/code&gt; only, it's considered as a spacebar, but if you press &lt;code&gt;SPC&lt;/code&gt; along with any other key it's considered as &lt;code&gt;control&lt;/code&gt; + whatever key you've pressed. And, the best part is, you can use &lt;code&gt;control&lt;/code&gt; key in itself for modifiers too. It's left untouched.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-04T12:27:19.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27560" PostTypeId="2" ParentId="27556" CreationDate="2016-10-04T14:09:08.620" Score="4" Body="&lt;p&gt;@Harald answered your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would &lt;em&gt;not&lt;/em&gt; say &quot;unfortunately&quot;.  This is &lt;em&gt;by design&lt;/em&gt;.  Buffer &lt;code&gt;*scratch*&lt;/code&gt; is designed for what its name suggests and its initial contents describe: It is a &lt;strong&gt;scratchpad&lt;/strong&gt;, for throwaway content.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use it for some other purpose then you are misusing it.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;But of course you might want a scratchpad that is automatically backed up (autosaved) periodically.  If so, then use a buffer that is backed by a file.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example, edit your Lisp scratch in a new file buffer &lt;code&gt;iii.el&lt;/code&gt; or whatever.  Then (a) you can more easily save the content, if you want, and (b) Emacs will prompt you about any unsaved changes when you use &lt;code&gt;C-x C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, Emacs does not prompt you about unsaved changes for &lt;code&gt;*scratch*&lt;/code&gt; because it is not a buffer that is &lt;em&gt;designed&lt;/em&gt; (intended, by default) to be saved.  For that, use a file buffer, even for a not-yet-existing file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to autosaving, be aware that it happens only for an existing file, that is, a file on disk.  So if you want autosaving to kick in then you must save the file buffer at least once.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;If you want &lt;code&gt;C-x C-c&lt;/code&gt; to ask for confirmation, that is easy to get. You could even have it let you know about modification of buffers, such as &lt;code&gt;*scratch*&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is what I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'kill-emacs-query-functions&#xA;          (lambda () (y-or-n-p &quot;Do you really want to exit Emacs? &quot;))&#xA;          'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That &lt;em&gt;always&lt;/em&gt; prompts me, when I use &lt;code&gt;C-x C-c&lt;/code&gt;, regardless of the state of any buffers.  You might prefer something more specific, which checks certain buffers etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use command &lt;code&gt;customize-customized&lt;/code&gt; to check whether you have unsaved customizations.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-04T14:09:08.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27561" PostTypeId="1" AcceptedAnswerId="29841" CreationDate="2016-10-04T15:00:27.547" Score="3" ViewCount="1023" Body="&lt;p&gt;I updated to 25.1 and found that copy/paste works differently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example when I select a word &quot;&lt;strong&gt;visit&lt;/strong&gt;&quot; and try to replace this word with [shift insert], &lt;strong&gt;text&lt;/strong&gt; in clipboard is inserted in the beginning of the selection, instead of replacing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/q8PB2.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/q8PB2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I select &lt;strong&gt;visit&lt;/strong&gt; and type text, &lt;strong&gt;visit&lt;/strong&gt; is replaced as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have enabled delete selection and transient mark modes, it worked well in 24.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="13536" LastActivityDate="2020-02-10T06:36:46.873" Title="Replace selected text on [shift insert] is broken in emacs 25.1" Tags="|terminal-emacs|delete-selection-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27562" PostTypeId="1" AcceptedAnswerId="27567" CreationDate="2016-10-04T15:30:42.657" Score="1" ViewCount="878" Body="&lt;p&gt;I have just started using the zenburn theme in emacs on my macbook and I really like how it looks. It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uf986.png&quot; alt=&quot;MacbookZenburn&quot; title=&quot;On my Macbook&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I put it on my ubuntu pc (my .emacs.d directory is synced with git and I double checked it was working properly by copying it over through dropbox as well and the files should be identical in both .emacs.d directories) it looked like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sBnq6.png&quot; alt=&quot;UbuntuZenburn&quot; title=&quot;On my Ubuntu&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest what's going on here and how I can get emacs to look the same on my ubuntu machine as on my macbook?&lt;/p&gt;&#xA;" OwnerUserId="11742" LastActivityDate="2016-10-08T10:54:04.060" Title="Why does the zenburn colour scheme look different on different computers" Tags="|themes|colors|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27563" PostTypeId="2" ParentId="27556" CreationDate="2016-10-04T15:38:39.017" Score="1" Body="&lt;p&gt;Yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I would like to recommend an easy way of using emacs more efficiently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, you create emacs &lt;strong&gt;server&lt;/strong&gt;:&#xA;&lt;code&gt;emacs --daemon&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes emacs run as daemon(server mode), which means that you have one emacs server and you can have multiple clients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when you open emacs(using &lt;code&gt;emacsclient -t&lt;/code&gt; or &lt;code&gt;emacsclient -c&lt;/code&gt; depending on console/GUI), you create new window(in emacs terminology you refer to it as a Frame). When you &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;C&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt;, you only close &quot;Frame&quot; - the client. The server is still running, so you can run another &lt;code&gt;emacsclient&lt;/code&gt;, and you scratch will be the same as before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The upside of this solution is that you start server once, and it's there in background; if you have many packages, Emacs can take few seconds to start. This solution makes starting an emacs client instantenous.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Warning&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The above solution isn't perfect. It's good, it helps and fixes many problems, but one of Emacs's flaw is its design: it's single-threaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that some code that is executed might get stuck in an infinite loop. And this means you will be forced to kill the Emacs server and everything running there.&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2016-10-04T15:38:39.017" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27565" PostTypeId="1" CreationDate="2016-10-04T15:49:19.660" Score="2" ViewCount="131" Body="&lt;p&gt;I use org-mode for scheduling and logging in tasks. I clock in non-recurring tasks, however I find it strenuous to clock in recurring tasks. Is there any way I can mark the recurring task done and the scheduled time for the task is converted into clocked data as soon as I mark it done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Task 1&#xA;SCHEDULED: &amp;lt;2016-10-04 Tue 10:00-10:30 ++1d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After I mark it done, the task should read&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Task 1&#xA;SCHEDULED: &amp;lt;2016-10-05 Wed 10:00-10:30&amp;gt;&#xA;:LOGBOOK:&#xA;- State &quot;DONE&quot;       from &quot;TODO&quot;       [2016-10-04 Tue 11:42]&#xA;CLOCK: [2016-10-04 Tue 10:00]--[2016-10-04 Tue 10:30] =&amp;gt; 0:30&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13538" LastActivityDate="2024-02-05T01:03:50.483" Title="How do I convert scheduled recurring entries into clocked data?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27566" PostTypeId="1" CreationDate="2016-10-04T15:56:31.177" Score="0" ViewCount="55" Body="&lt;p&gt;I have a VPS server and I always ssh to it and us emacs in the ssh session. I found that when I save a buffer the cursor always move to the beginning of the screen. How to disable this behavior? I don't want cursor movement when save a file. &lt;/p&gt;&#xA;" OwnerUserId="2273" LastActivityDate="2016-10-04T15:56:31.177" Title="ssh to a remove host and use emacs in the ssh session, cursor always move to the beginning of the screen when save file" Tags="|cursor|saving|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27567" PostTypeId="2" ParentId="27562" CreationDate="2016-10-04T15:59:01.670" Score="2" Body="&lt;p&gt;The problem was that the terminal on my ubuntu computer was only using 8 colours, and as such couldn't use the colours shown on my macbook. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find out how many colours your terminal has in emacs using &lt;code&gt;M-x list-colors-display&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution was either to run it outside the terminal or add &lt;code&gt;[[ $COLORTERM = gnome-terminal ]] &amp;amp;&amp;amp; TERM=xterm-256color&lt;/code&gt;(found at stackoverflow.com/a/64585/1590790/) to my .bashrc file so that it could use 256 colours. &lt;/p&gt;&#xA;" OwnerUserId="11742" LastEditorUserId="11742" LastEditDate="2016-10-08T10:54:04.060" LastActivityDate="2016-10-08T10:54:04.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27568" PostTypeId="2" ParentId="27552" CreationDate="2016-10-04T16:23:08.950" Score="1" Body="&lt;p&gt;Personally I don't sort my tasks into hierarchical structures by hand but use the aggregation via org-agenda. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/TODO-Items.html&quot; rel=&quot;nofollow&quot;&gt;org manual TODO-Items&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacslife.com/baby-steps-org.html&quot; rel=&quot;nofollow&quot;&gt;Sachas WIP intro &quot;A Baby Steps Guide to Managing Your Tasks with Org&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Judging from your presented lines, the entries under Monday are checkboxed lists or TODO childs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coming from checkbox lists I'd sort by reverse checked state with &lt;code&gt;org-sort (C-c ^) X&lt;/code&gt;, convert the open entries to Todo child entries &lt;code&gt;org-list-make-subtree (C-c C-*)&lt;/code&gt;, mark the open lines by hand and refile the region to the running clock task &lt;code&gt;org-refile (C-u 2 C-c C-w)&lt;/code&gt; when the Tuesday task is clocked in. If your child entries are already todo child entries the argument for &lt;code&gt;org-sort&lt;/code&gt; changes to &lt;code&gt;todo order (o)&lt;/code&gt; or its capital version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change TODO children back to checkbox lists with &lt;code&gt;org-ctrl-c-minus (C-c -)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not yet found out how to move a list of checkbox entries if the cut and paste is not done by hand. If you're willing to do that, sort the list, cut the interesting stuff and &lt;code&gt;org-clock-jump-to-running-clock&lt;/code&gt; and paste.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastActivityDate="2016-10-04T16:23:08.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27570" PostTypeId="1" CreationDate="2016-10-04T16:32:51.903" Score="1" ViewCount="441" Body="&lt;p&gt;I would like to install &lt;a href=&quot;https://github.com/sagemath/sage-shell-mode&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;sage-shell-mode&lt;/code&gt;&lt;/a&gt;. Now I read the README, and it indicated that with MELPA added to my package archive list I should be able to install &lt;code&gt;sage-shell-mode&lt;/code&gt; with (after pressing &lt;kbd&gt;M&lt;/kbd&gt;+&lt;kbd&gt;x&lt;/kbd&gt;, of course) &lt;code&gt;package-install sage-shell-mode&lt;/code&gt;. But this failed for me (i.e., &lt;code&gt;sage-shell-mode&lt;/code&gt; was &lt;strong&gt;not&lt;/strong&gt; found). &lt;a href=&quot;https://github.com/fusion809/emacs/raw/322cd0376ce823b7071175dd3fcf2bdffea821d8/.emacs&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is my &lt;code&gt;~/.emacs&lt;/code&gt; file, most notably this is how I enabled my package archives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;...&#xA;(add-to-list 'package-archives  (quote&#xA;((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;    (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;    (&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;)&#xA;    (&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;)&#xA;    )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I'm wondering if I made a mistake or whether &lt;code&gt;sage-shell-mode&lt;/code&gt; is for whatever reason incompatible with Emacs 25.1. I have also run &lt;code&gt;package-refresh-contents&lt;/code&gt; too, since I last updated my &lt;code&gt;~/.emacs&lt;/code&gt; file. &lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="11131" LastEditDate="2016-10-04T16:42:58.437" LastActivityDate="2018-10-25T15:00:51.250" Title="How to install sage-shell-mode with Emacs 25.1?" Tags="|package-repositories|version-compatibilty|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27571" PostTypeId="2" ParentId="27540" CreationDate="2016-10-04T17:05:43.983" Score="1" Body="&lt;p&gt;Looks like code was sent to a Python3 shell, where &lt;code&gt;print&lt;/code&gt; is a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;py-execute-def-python2&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; should work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Customizing &lt;code&gt;py-shell-name&lt;/code&gt; is an option too.&lt;/p&gt;&#xA;" OwnerUserId="3940" LastEditorUserId="3940" LastEditDate="2016-10-05T07:21:24.933" LastActivityDate="2016-10-05T07:21:24.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27572" PostTypeId="2" ParentId="27255" CreationDate="2016-10-04T18:13:21.420" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-c C-x C-i     (org-clock-in)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Start the clock on the current item (clock-in). ...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When called with a C-u prefix argument, select the task from a list of&#xA;  recently clocked tasks.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;info:(org) Clocking commands&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="4068" LastActivityDate="2016-10-04T18:13:21.420" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27573" PostTypeId="2" ParentId="27570" CreationDate="2016-10-04T19:43:39.040" Score="1" Body="&lt;p&gt;I loaded up MELPA and see sage-shell-mode listed. I don't know if this will solve the problem, but I've run into problems before with multiple package archives loading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a function I use to clear the list of packages and add MELPA. Don't forget to refresh the package list after this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-package-load-melpa-only ()&#xA;  &quot;Load package manager with MELPA only&quot;&#xA;  (interactive)&#xA;  (if (eq nil (featurep 'package))  ; check if package feature is loaded&#xA;      ((require 'package)&#xA;       (package-initialize)&#xA;       (message &quot;Initializing package manager&quot;)))&#xA;  (cond (&#xA;   (boundp 'package-archives)&#xA;   (setq package-archives '())&#xA;   ))&#xA;  (add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I would try finding the package in the package list mode (package-list-packages) if installing the mode still doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="2225" LastEditorUserId="2225" LastEditDate="2016-10-04T21:00:36.513" LastActivityDate="2016-10-04T21:00:36.513" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27574" PostTypeId="1" AcceptedAnswerId="27575" CreationDate="2016-10-04T20:32:18.953" Score="11" ViewCount="3839" Body="&lt;p&gt;In Vim, if I want search for all variable names LX where X is a number, I can simply type &lt;code&gt;/L\d&lt;/code&gt;. However, this doesn't seem to work with &lt;code&gt;evil&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another syntax for regular expressions in Evil mode, or will I have to fall back on some Emacs functionality for search and replace using regular expressions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;code&gt;spacemacs&lt;/code&gt;, and I am pretty clueless regarding most things in Emacs, happily staying in Evil mode all day :).&lt;/p&gt;&#xA;" OwnerDisplayName="user9809" LastEditorUserId="253" LastEditDate="2016-10-04T21:05:59.753" LastActivityDate="2016-10-04T21:05:59.753" Title="Evil mode and regular expressions" Tags="|evil|regular-expressions|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27575" PostTypeId="2" ParentId="27574" CreationDate="2016-10-04T21:04:53.783" Score="8" Body="&lt;p&gt;&lt;code&gt;evil&lt;/code&gt; uses the Emacs regexp facilities under the hood.  Unfortunately, Emacs does not appear to have a separate &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html&quot; rel=&quot;noreferrer&quot;&gt;syntax&#xA;class&lt;/a&gt; for digits, and does not recognize the &lt;code&gt;\d&lt;/code&gt; &lt;a href=&quot;https://www.emacswiki.org/emacs/RegularExpression&quot; rel=&quot;noreferrer&quot;&gt;regexp&lt;/a&gt; class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to match your variable named &lt;code&gt;LX&lt;/code&gt; where &lt;code&gt;X&lt;/code&gt; is a digit, it&#xA;looks like you're stuck with the clunky &lt;code&gt;/L[0-9]&lt;/code&gt; or the even clunkier &lt;code&gt;/L[[:digit:]]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, in principle, it looks like you could use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html&quot; rel=&quot;noreferrer&quot;&gt;character&#xA;codes&lt;/a&gt;&#xA;as listed by &lt;code&gt;describe-categories&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`\cc`&#xA;&#xA;matches any character whose category is *c*.  Here *c* is a&#xA;character that represents a category: thus, 'c' for Chinese&#xA;characters or 'g' for Greek characters in the standard&#xA;category table. You can see the list of all the currently&#xA;defined categories with `M-x describe-categories RET`. You can&#xA;also define your own categories in addition to the standard&#xA;ones using the `define-category` function (see Categories).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to &lt;code&gt;describe-categories&lt;/code&gt;, digits are category 6.&#xA;Hence, &lt;code&gt;/L\c6&lt;/code&gt; should work (although it doesn't for me, even&#xA;though other categories do).  Still, you wouldn't be saving&#xA;yourself much awkward typing when compared to &lt;code&gt;/L[0-9]&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-10-04T21:04:53.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27576" PostTypeId="1" AcceptedAnswerId="30403" CreationDate="2016-10-04T22:46:05.147" Score="6" ViewCount="546" Body="&lt;p&gt;I have a &lt;code&gt;.tex&lt;/code&gt; file with text in Devanagari script. I am able to convert to pdf using XeLaTeX outside of Emacs without any problem. However, when I try it within Emacs, the resulting pdf does not have any Devanagari text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new to emacs, and am using &lt;code&gt;spacemacs 25.1&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the solutions I have already tried, but I couldn't get them to work:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.r-bloggers.com/hindidevanagari-presentations-using-orgmode-r-latex-and-beamer/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.r-bloggers.com/hindidevanagari-presentations-using-orgmode-r-latex-and-beamer/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://tex.stackexchange.com/questions/21200/auctex-and-xetex&quot;&gt;https://tex.stackexchange.com/questions/21200/auctex-and-xetex&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/15926817/add-xelatex-to-the-command-list&quot;&gt;https://stackoverflow.com/questions/15926817/add-xelatex-to-the-command-list&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/worg/org-faq.html#using-xelatex-for-pdf-export&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/worg/org-faq.html#using-xelatex-for-pdf-export&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have tried many combinations and variations of these to no success. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I generate a pdf from within Emacs that shows the Devanagari script?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the minimal example which works in a &lt;code&gt;.tex&lt;/code&gt; file if compiled with &lt;code&gt;xelatex&lt;/code&gt; outside of &lt;code&gt;emacs&lt;/code&gt; environment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\usepackage{polyglossia}&#xA;\setmainlanguage{sanskrit}&#xA;\setotherlanguage{english}&#xA;\setmainfont[Script=Devanagari]{Arial Unicode MS}&#xA;\newfontfamily\devanagarifontsf[Script=Devanagari]{Arial Unicode MS}&#xA;&#xA;\begin{document}&#xA;&#xA;मया emacs बहु रोचते।&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I try to write the same in org mode, desired output is not generated. Here is the content of my org mode file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: Generating Devanagarai text in LaTeX?&#xA;#+LATEX_CMD: xelatex&#xA;#+LATEX_HEADER: \usepackage{polyglossia}&#xA;#+LATEX_HEADER: \setmainlanguage{sanskrit}&#xA;#+LATEX_HEADER: \setotherlanguage{english}&#xA;#+LATEX_HEADER: \setmainfont[Script=Devanagari]{Arial Unicode MS}&#xA;#+LATEX_HEADER: \newfontfamily\devanagarifontsf[Script=Devanagari]{Arial Unicode MS}&#xA;&#xA;मया emacs बहु रोचते।&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the org file is exported as &lt;code&gt;html&lt;/code&gt;, the output has both Devanagari and English text as expected. However, no pdf output is generated when exporting as &lt;code&gt;latex&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="13502" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-02-21T00:21:27.697" Title="Exporting Devanagarai text from org-mode to LaTeX?" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27577" PostTypeId="2" ParentId="16353" CreationDate="2016-10-04T22:53:21.227" Score="1" Body="&lt;p&gt;If you add to your org hook, you won't have to keep manually calling M-q.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     (add-hook 'org-mode-hook '(lambda ()&#xA;                              (visual-line-mode)&#xA;                              (org-indent-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13541" LastActivityDate="2016-10-04T22:53:21.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27578" PostTypeId="1" CreationDate="2016-10-05T05:22:12.830" Score="1" ViewCount="352" Body="&lt;p&gt;When i try to open my &lt;code&gt;.emacs&lt;/code&gt; file with emacs i get an error as such.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs .emacs       &#xA;Fatal error 11: Segmentation fault&#xA;Backtrace:&#xA;emacs[0x4f74cb]&#xA;emacs[0x4dcf3e]&#xA;emacs[0x4f611e]&#xA;emacs[0x4f6283]&#xA;/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340)[0x7f98da6f4340]&#xA;emacs[0x538130]&#xA;emacs[0x59a8cb]&#xA;emacs[0x59a8e1]&#xA;emacs[0x59a8e1]&#xA;emacs[0x59a8e1]&#xA;emacs[0x539e37]&#xA;emacs[0x5380dd]&#xA;emacs[0x537d28]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x537dd4]&#xA;emacs[0x537dd4]&#xA;emacs[0x537d28]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x537cf1]&#xA;emacs[0x538186]&#xA;emacs[0x537ce4]&#xA;emacs[0x537ce4]&#xA;emacs[0x537dd4]&#xA;emacs[0x537dd4]&#xA;emacs[0x537cf1]&#xA;...&#xA;[1]    6084 segmentation fault (core dumped)  emacs -nw .emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But emacs opens other files without crashing. Can some one help me.&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="105" LastEditDate="2016-10-05T15:29:56.600" LastActivityDate="2016-10-05T15:29:56.600" Title="emacs crashes while opening .emacs file" Tags="|debugging|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="27579" PostTypeId="1" AcceptedAnswerId="27582" CreationDate="2016-10-05T06:24:10.810" Score="3" ViewCount="152" Body="&lt;p&gt;I'm trying to get how many times a task has been re-scheduled (the &lt;code&gt;Sched.00x:&lt;/code&gt; you see in org-agenda for &quot;today tasks&quot;). But so far, I don't know how to extract information from the structure returned by &lt;code&gt;org-agenda-get-day-entries&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My original plan was to regexp the hell out of the title, since it carries the information I'm looking, but I don't even know how to obtain from the data structure for the title of the entry. It doesn't seems like the number of times an entry was re-scheduled comes within the data structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my current code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((files (org-agenda-files))&#xA;         (due-todos 0)&#xA;         (due-older 0)&#xA;         (today (calendar-current-date)))&#xA;    (dolist (file files)&#xA;      (let* ((entries (org-agenda-get-day-entries file today :scheduled :deadline)))&#xA;        (dolist (entry entries)&#xA;          ;; Get how many times the task was re-scheduled, and count it&#xA;          ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="690" LastEditorUserId="105" LastEditDate="2016-10-05T15:29:01.360" LastActivityDate="2016-10-07T10:24:18.293" Title="Get how many times a task has been rescheduled" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27580" PostTypeId="1" AcceptedAnswerId="27588" CreationDate="2016-10-05T06:58:09.903" Score="5" ViewCount="1203" Body="&lt;p&gt;How can I change the color of the fill-column-indicator and have the changes visible immediately?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:change-fci-color (color)&#xA;  (setq fci-rule-color color)&#xA;  (fci-redraw-frame))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The previous code doesn't change the color in existing buffers until the major mode is changed or I reload the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code works but feels like a gross hack.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;fill-column-indicator.el&quot;&#xA;  (when fci-mode&#xA;    (turn-off-fci-mode)&#xA;    (turn-on-fci-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ultimately, I want to change &lt;code&gt;fci-rule-color&lt;/code&gt; based on the current theme's background color.  So, when I change from a light theme to a dark theme, &lt;code&gt;fci-rule-color&lt;/code&gt; remains a subtle shade off of the background color.&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2021-02-14T17:06:04.973" Title="Change fill-column-indicator rule color immediately" Tags="|colors|display|fill-column|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27581" PostTypeId="1" AcceptedAnswerId="27584" CreationDate="2016-10-05T08:01:35.760" Score="18" ViewCount="829" Body="&lt;p&gt;I had a bug in one of my extensions that eventually turned out to be caused by &lt;code&gt;set&lt;/code&gt; not working as I expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;&#xA;(let ((a nil))&#xA;  (setq a t)&#xA;  (print a))&#xA;&#xA;&#xA;(let ((a nil))&#xA;  (set 'a t)&#xA;  (print a))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when run with &lt;code&gt;emacs -Q --batch -l temp.el&lt;/code&gt; prints:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t&#xA;&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems very strange to me. I was under the impression that &lt;code&gt;(setq a b)&lt;/code&gt; is shorthand for &lt;code&gt;(set 'a b)&lt;/code&gt;. What's going on?&lt;/p&gt;&#xA;" OwnerUserId="237" LastEditorUserId="105" LastEditDate="2022-09-18T17:32:26.513" LastActivityDate="2022-09-18T17:32:26.513" Title="Why do setq and set quote act differently on let-bound variables with lexical scope?" Tags="|lexical-scoping|setq|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27582" PostTypeId="2" ParentId="27579" CreationDate="2016-10-05T08:05:00.483" Score="1" Body="&lt;p&gt;Suggesting another approach since &lt;code&gt;org-agenda-get-day-entries&lt;/code&gt; parses more than you asked for:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let (res)&#xA;  (dolist (i org-agenda-files)&#xA;    (with-current-buffer (get-file-buffer i)&#xA;      (org-with-wide-buffer&#xA;       (goto-char (point-min))&#xA;       (while (re-search-forward org-heading-regexp nil t)&#xA;         (push (cons&#xA;                (match-string-no-properties 2)&#xA;                (- (org-today) (time-to-days (org-get-scheduled-time (point)))))&#xA;               res)))))&#xA;  (seq-filter (lambda (x) (&amp;gt; (cdr x) 0)) res))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, to retrieve the &lt;code&gt;Sched.00x:&lt;/code&gt; strings, use &lt;code&gt;get-text-property&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mapcar (lambda (x) (get-text-property 0 'extra x))&#xA;        (org-agenda-get-day-entries&#xA;         file&#xA;         (calendar-current-date) :scheduled))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2016-10-07T10:24:18.293" LastActivityDate="2016-10-07T10:24:18.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27584" PostTypeId="2" ParentId="27581" CreationDate="2016-10-05T10:14:07.693" Score="17" Body="&lt;p&gt;This is documented behaviour. The (much improved) explanation in the Emacs 25.1 elisp manual is as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that unlike dynamic variables which are tied to the symbol&#xA;  object itself, the relationship between lexical variables and symbols is&#xA;  only present in the interpreter (or compiler).  Therefore, functions&#xA;  which take a symbol argument (like ‘symbol-value’, ‘boundp’, and ‘set’)&#xA;  can only retrieve or modify a variable’s dynamic binding (i.e., the&#xA;  contents of its symbol’s value cell).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Lexical Binding&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-10-05T10:20:34.557" LastActivityDate="2016-10-05T10:20:34.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27585" PostTypeId="2" ParentId="27542" CreationDate="2016-10-05T10:36:19.950" Score="1" Body="&lt;p&gt;The problem is that the Ctl-Tab (and other escape sequences) aren't natively passed from the terminal to the application (emacs).  Luckily, Xterm and emacs can be reconfigured to allow the passage of these sequences.  Check out &lt;a href=&quot;https://emacs.stackexchange.com/users/25/gilles&quot;&gt;gilles's&lt;/a&gt; excellent overview &lt;a href=&quot;https://emacs.stackexchange.com/a/13957/13497&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13497" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-10-05T10:36:19.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27586" PostTypeId="1" CreationDate="2016-10-05T11:28:21.443" Score="1" ViewCount="64" Body="&lt;p&gt;I'm using org mode beamer export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an itemized list&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want an item to start with the text &quot;&amp;lt;7ms&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to be almost impossible to quote the &quot;&amp;lt;&quot; character so that the org parser doesn't think it's an overlay, and pass it into LaTeX, which then chokes on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe writing &quot;\item{} &amp;lt;7ms&quot; would work, but I can't seem to find any way to write this in org so that I get that result in the LaTeX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now the only workaround is write $7ms$, but that isn't really the effect I wanted.  And I have no idea why writing $7$ms doesn't work either.&lt;/p&gt;&#xA;" OwnerUserId="13544" LastActivityDate="2016-10-05T11:28:21.443" Title="org beamer export vs &lt; symbol" Tags="|org-mode|latex|beamer|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27587" PostTypeId="2" ParentId="27079" CreationDate="2016-10-05T11:48:54.237" Score="2" Body="&lt;p&gt;I have been using the ``not yet stable'' 25-rc2 build of Emacs for a month without any lockup issues.  So it seems @lawless is correct, and this did fix the issue.&lt;/p&gt;&#xA;" OwnerUserId="13296" LastActivityDate="2016-10-05T11:48:54.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27588" PostTypeId="2" ParentId="27580" CreationDate="2016-10-05T14:37:09.070" Score="4" Body="&lt;p&gt;The following three lines of code in this specific order will immediately visibly update the &lt;code&gt;fci-rule-color&lt;/code&gt; -- in this example, I am using the color &quot;red&quot;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq fci-rule-color &quot;red&quot;)&#xA;(fci-make-overlay-strings)&#xA;(fci-update-all-windows t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-10-05T14:37:09.070" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27589" PostTypeId="1" AcceptedAnswerId="27590" CreationDate="2016-10-05T15:35:53.747" Score="1" ViewCount="64" Body="&lt;p&gt;I am reading a diff between two revisions, say &lt;code&gt;A..B&lt;/code&gt;, possibly limited to a single file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once in a while, I stumble on a hunk that I’d like to investigate in detail. I want to press a key or two and see the commit(s) that introduce the change I’m currently looking at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since that is kind of vague, let’s say I want the equivalent of &lt;kbd&gt;l =L&lt;/kbd&gt; &lt;code&gt;file&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;start,+lines&lt;/code&gt; &lt;kbd&gt;RET l&lt;/kbd&gt; &lt;code&gt;range&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;, where &lt;code&gt;file&lt;/code&gt;, &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;lines&lt;/code&gt; are taken from the current hunk and &lt;code&gt;range&lt;/code&gt; is the current diff’s range. The log should not be limited to the file, even if the diff was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can do this manually but I want to automate it.&lt;/p&gt;&#xA;" OwnerUserId="13548" LastActivityDate="2016-10-05T17:05:52.053" Title="How do I jump from a diff hunk to the relevant commit(s)?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27590" PostTypeId="2" ParentId="27589" CreationDate="2016-10-05T16:12:10.687" Score="0" Body="&lt;p&gt;That's currently not supported. There already exist requests for similar features and I plan to implement such things eventually. So it's not strictly necessary that you open a feature request for this, but if you want to really make sure I don't forget about this particular variant, then you might want to open one anyway.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-10-05T16:12:10.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27591" PostTypeId="1" AcceptedAnswerId="27788" CreationDate="2016-10-05T16:51:05.533" Score="2" ViewCount="381" Body="&lt;p&gt;When inserting a reference in a LaTeX document (using Auctex) I normally type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\cite{joebob_2010}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &quot;\cite&quot; shows up in blue font, while &quot;joebob_2010&quot; shows up reddish/purple.  I like this coloring.  However, when I use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\citep{joebob_2010}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;all text shows up white.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my .emacs file I put: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook&#xA;    (lambda ()&#xA;      (font-lock-add-keywords nil   '((&quot;\\(\\\\citep\\)\\s-*{&quot; 1 font-lock-keyword-face t)))&#xA;      (font-lock-add-keywords nil   '((&quot;\\(\\\\citet\\)\\s-*{&quot; 1 font-lock-keyword-face t)))&#xA;      ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This changed the color of &quot;\citep&quot; to blue, but the reference to &quot;joebob_2010&quot; remains white.  Can I modify this to have the same coloring as &quot;\cite{joebob_2010}&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT/SOLUTION&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I posted a bug report to the gnu group for Auctex and found out there was no bug after all.  The following solution works.  In the .emacs file, put: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; set special font highlighting for \cite* commands&#xA;(add-hook 'LaTeX-mode-hook&#xA;     (lambda ()&#xA;       (font-lock-add-keywords nil  '((&quot;\\(\\\\citep\\)\\s-*{&quot; 1 font-lock-keyword-face t)))&#xA;       (font-lock-add-keywords nil  '((&quot;\\(\\\\citet\\)\\s-*{&quot; 1 font-lock-keyword-face t)))&#xA;       (font-latex-add-keywords '((&quot;citep&quot; &quot;*[[{&quot;)) 'reference)&#xA;       (font-latex-add-keywords '((&quot;citet&quot; &quot;*[[{&quot;)) 'reference)&#xA;       ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adding the keywords at the end is the key.  &lt;/p&gt;&#xA;" OwnerUserId="13395" LastEditorUserId="13395" LastEditDate="2016-10-13T13:19:44.190" LastActivityDate="2016-10-13T14:30:24.967" Title="AucteX Citation Color" Tags="|auctex|fonts|colors|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27592" PostTypeId="2" ParentId="27589" CreationDate="2016-10-05T17:05:52.053" Score="0" Body="&lt;p&gt;As a stopgap, I’m going to try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yk-magit-log-hunk ()&#xA;  (interactive)&#xA;  (let ((yk-diff-range (car magit-refresh-args)))&#xA;    (magit-section-case&#xA;      ('hunk (let* ((yk-file (magit-section-value (magit-section-parent it)))&#xA;                    (yk-hunk-lines (nth 2 (magit-section-value it)))&#xA;                    (yk-line-range (replace-regexp-in-string&#xA;                                    &quot;^\\+\\([0-9]+\\),\\([0-9]+\\)$&quot;&#xA;                                    &quot;\\1,+\\2&quot;&#xA;                                    yk-hunk-lines)))&#xA;               (magit-log (list yk-diff-range)&#xA;                          (list (concat &quot;-L&quot; yk-line-range &quot;:&quot; yk-file))&#xA;                          nil)))&#xA;      ('file (let ((yk-file (magit-section-value it)))&#xA;               (magit-log (list yk-diff-range) nil (list yk-file)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13548" LastActivityDate="2016-10-05T17:05:52.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27593" PostTypeId="1" CreationDate="2016-10-05T17:09:48.410" Score="1" ViewCount="188" Body="&lt;p&gt;When using &lt;code&gt;INCLUDE&lt;/code&gt; in an org-file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: preamble/preamble.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;..and referring to an image in the included file..&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Preamble&#xA;&#xA;Look at this amazing image:&#xA;[[./figure1.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then generating LaTeX for the top-level file, the resulting TeX is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\part{Preamble}&#xA;\label{sec:orgheadline3}&#xA;&#xA;Look at this amazing image:&#xA;&#xA;\includegraphics[width=.9\linewidth]{./figure1.png}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e., the path to the image is relative to the &lt;code&gt;preamble&lt;/code&gt; directory, but the &lt;code&gt;.tex&lt;/code&gt; file is one level up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to fix that (so that &lt;code&gt;includegraphics&lt;/code&gt; refers to &lt;code&gt;preamble/figure1.png&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="13550" LastActivityDate="2016-10-05T17:09:48.410" Title="org-mode: image file names in LaTeX export when using INCLUDE" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27594" PostTypeId="2" ParentId="24039" CreationDate="2016-10-05T17:46:27.050" Score="0" Body="&lt;p&gt;Patch to ${emacs_root}/lisp/term.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--- term.el 2016-10-06 01:34:52.000000000 +0800&#xA;+++ fix-term.el 2016-10-06 01:35:25.000000000 +0800&#xA;@@ -2857,6 +2857,8 @@ See `term-prompt-regexp'.&quot;&#xA;          (term-vertical-motion 0)&#xA;          (setq term-current-column term-start-line-column))&#xA;             ((eq char ?\n)  ;; (terminfo: cud1, ind)&#xA;+             (term-vertical-motion 0)&#xA;+             (setq term-current-column term-start-line-column)&#xA;          (unless (and term-kill-echo-list&#xA;                   (term-check-kill-echo-list))&#xA;            (term-down 1 t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13552" LastActivityDate="2016-10-05T17:46:27.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27595" PostTypeId="1" AcceptedAnswerId="27596" CreationDate="2016-10-05T17:53:21.733" Score="3" ViewCount="591" Body="&lt;p&gt;I'd like to export an org file to LaTeX from the command line. I have created a file &lt;code&gt;export.el&lt;/code&gt; with the following contents (simplified to reproduce the problem):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;&#xA;(when (not (assoc &quot;scrreprt&quot; org-latex-classes))&#xA;  (push '(&quot;scrreprt&quot;&#xA;          (assoc &quot;report&quot; org-latex-classes))&#xA;        org-latex-classes))&#xA;&#xA; (with-current-buffer (find-file-noselect &quot;contents.org&quot;)&#xA;   (org-latex-export-to-latex nil nil nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I tried to run it from the shell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs -Q --batch -l export.el &#xA;Symbol's value as variable is void: org-latex-classes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that I am missing some org functionality. How do I find out what else I have to &lt;code&gt;require&lt;/code&gt; in order to get &lt;code&gt;org-latex-classes&lt;/code&gt; defined?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Omitting the &lt;code&gt;-Q&lt;/code&gt; option does not help either, but even if it helped my question about finding the right &lt;code&gt;require&lt;/code&gt; would stand).&lt;/p&gt;&#xA;" OwnerUserId="13550" LastActivityDate="2016-10-05T18:04:27.397" Title="Using org in emacs batch mode" Tags="|org-mode|start-up|batch-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27596" PostTypeId="2" ParentId="27595" CreationDate="2016-10-05T18:04:27.397" Score="3" Body="&lt;p&gt;I presume you have access to &lt;code&gt;org-latex-classes&lt;/code&gt; when you start&#xA;up Emacs for interactive use, so something in your &lt;code&gt;init&lt;/code&gt; file is&#xA;loading it.  You can check which library defines&#xA;&lt;code&gt;org-latex-classes&lt;/code&gt; with &lt;code&gt;C-h v org-latex-classes&lt;/code&gt; (or&#xA;&lt;code&gt;describe-variable&lt;/code&gt;).  It tells you that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;org-latex-classes&lt;/code&gt; is a variable defined in &lt;code&gt;ox-latex.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As such, you also need to &lt;code&gt;(require 'ox-latex)&lt;/code&gt; for Emacs to&#xA;recognize that variable.  It should also work to &lt;code&gt;(require 'ox)&lt;/code&gt;&#xA;instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see &lt;a href=&quot;https://superuser.com/questions/896741/how-do-i-configure-org-latex-classes-in-emacs&quot;&gt;this SuperUser post on the question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2016-10-05T18:04:27.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27597" PostTypeId="1" CreationDate="2016-10-05T18:39:47.450" Score="4" ViewCount="9623" Body="&lt;p&gt;See the image below.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9wEj8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9wEj8.png&quot; alt=&quot;package-list-packages - output screen&quot;&gt;&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to update my &lt;code&gt;org&lt;/code&gt; from &lt;code&gt;Version: 2016071&lt;/code&gt; to &lt;code&gt;Version 20161003&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not give me an option to upgrade when I use the &lt;code&gt;package-list-packages&lt;/code&gt; command.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An additional question is when the packages get loaded and I push the &quot;U&quot; key - it tells me one package is marked for upgrade.  How to find out which package is marked and how to activate the upgrade action?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update-1:&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just found out by accident (co-incidence) the solution to part of my problem.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to activate an upgrade a package from the list of packages press &quot;x&quot;. This will upgrade the marked package.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a coincidence it turned out that &lt;code&gt;org&lt;/code&gt; package was the one marked for upgrade and pressing &quot;x&quot; upgraded it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update-2:&lt;/strong&gt;&lt;br&gt;&#xA;Even though I upgraded just now, my org version is still &lt;code&gt;Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef&lt;/code&gt; while my org-mode in Windows (with 64 bit Emacs from sourceforge) has &lt;code&gt;Org-mode version 8.2.10 (release_8.2.10&lt;/code&gt;    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to get the latest version of Org, I referred the &lt;a href=&quot;http://orgmode.org/manual/Installation.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-manual&lt;/a&gt; and used the &lt;code&gt;Using Org's git repository&lt;/code&gt; method.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did&lt;br&gt;&#xA; - make autoloads&#xA; - make &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And got the following error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;make[1]: Entering directory `/home/prasannarajaram/org-mode/doc'&#xA;org-version: 8.3.6 (release_8.3.6-1203-g966e0b)&#xA;makeinfo --no-split org.texi -o org&#xA;make[1]: makeinfo: Command not found&#xA;make[1]: *** [org] Error 127&#xA;make[1]: Leaving directory `/home/prasannarajaram/org-mode/doc'&#xA;make: *** [info] Error 2&#xA;&lt;/pre&gt; &#xA;&#xA;&lt;p&gt;And now I'm completely stuck!&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="10936" LastEditDate="2016-10-05T19:22:17.007" LastActivityDate="2016-11-05T13:26:14.273" Title="How to update Org to latest version using package repo's / git clone in Ubuntu" Tags="|org-mode|package|package-repositories|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27599" PostTypeId="2" ParentId="27597" CreationDate="2016-10-05T19:36:08.300" Score="8" Body="&lt;p&gt;Add:&#xA;&lt;pre&gt;&lt;code&gt;&#xA;(require 'package)&#xA;(setq package-archives&#xA;      '((&quot;melpa&quot; . &quot;&lt;a href=&quot;https://melpa.org/packages/&quot; rel=&quot;noreferrer&quot;&gt;https://melpa.org/packages/&lt;/a&gt;&quot;)&#xA;        (&quot;gnu&quot; . &quot;&lt;a href=&quot;https://elpa.gnu.org/packages/&quot; rel=&quot;noreferrer&quot;&gt;https://elpa.gnu.org/packages/&lt;/a&gt;&quot;)&#xA;        (&quot;org&quot; . &quot;&lt;a href=&quot;http://orgmode.org/elpa/&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/elpa/&lt;/a&gt;&quot;)))&#xA;(package-initialize)&#xA;&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to your emacs init file. Adding the org repo will put the latest version of org-mode in &lt;code&gt;list-packages&lt;/code&gt;, where you can update it just like any other package (e.g. press &lt;code&gt;U x&lt;/code&gt; then answer prompts to upgrade all packages). &lt;/p&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="10936" LastEditDate="2016-10-06T11:23:07.263" LastActivityDate="2016-10-06T11:23:07.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27600" PostTypeId="2" ParentId="27597" CreationDate="2016-10-05T22:01:27.083" Score="0" Body="&lt;p&gt;Install from source.  Here are my possibility dates instructions in a shell script &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/eludom/HOWTO/blob/master/getLatestOrg.sh&quot; rel=&quot;nofollow&quot;&gt;https://github.com/eludom/HOWTO/blob/master/getLatestOrg.sh&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="587" LastActivityDate="2016-10-05T22:01:27.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27601" PostTypeId="1" AcceptedAnswerId="27604" CreationDate="2016-10-05T22:44:06.253" Score="50" ViewCount="21163" Body="&lt;p&gt;How do I specify a quote in org-mode so that it is rendered nicely in github? In markdown it is rendered like so:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;albert enstein&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="12585" LastEditDate="2021-08-25T18:16:48.523" LastActivityDate="2021-08-25T18:16:48.523" Title="how to markup a quotation?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27602" PostTypeId="1" AcceptedAnswerId="27608" CreationDate="2016-10-06T00:00:36.600" Score="2" ViewCount="792" Body="&lt;p&gt;&lt;em&gt;Local History&lt;/em&gt; is a feature in IntelliJ and Eclipse, which for every file keeps a history of its changes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.jetbrains.com/help/idea/2016.2/local-history.html&quot; rel=&quot;nofollow&quot;&gt;IntelliJ Local History&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://help.eclipse.org/mars/topic/org.eclipse.platform.doc.user/gettingStarted/qs-55.htm&quot; rel=&quot;nofollow&quot;&gt;Eclipse Local History&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is not a replacement for revision control systems like Git, but I found it useful when experimenting with code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way in Emacs to allow browsing through changes in one file and being able to select one version and revert to it?&lt;/p&gt;&#xA;" OwnerUserId="8261" LastEditorUserId="105" LastEditDate="2016-10-06T15:29:55.710" LastActivityDate="2018-06-16T20:22:32.673" Title="Is there a package for tracking local history of files like in IntelliJ or Eclipse?" Tags="|version-control|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27603" PostTypeId="1" CreationDate="2016-10-06T01:48:48.427" Score="1" ViewCount="93" Body="&lt;p&gt;While editing files, time to time I regret deleting some redundant parts which afterwards become necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you are writing a letter and first you explained your thoughts with redundantly very long sentences.&#xA;Later on, you come up with an on-spot phrase for them and rephrase with them.&#xA;But later again, on 2nd thought, you think the words weren't right phrasing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To go back to original sentences, in my knowledge, is to use undo, or undo-tree, to go back in history.&#xA;But you have to keep pressing the key til it hits that version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any easy way to search in undo-history to get back to the version?&#xA;I'm looking for something along the line of helm-occur functionality, which searches your word in current buffer and lists all the matching lines with line number, but works for the undo-history.&lt;/p&gt;&#xA;" OwnerUserId="13403" LastEditorUserId="10936" LastEditDate="2016-10-06T15:58:46.757" LastActivityDate="2016-10-06T15:58:46.757" Title="Is there a package to search in history of changes?" Tags="|version-control|history|undo|version-support|" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="27604" PostTypeId="2" ParentId="27601" CreationDate="2016-10-06T02:33:10.833" Score="62" Body="&lt;p&gt;When quoting a passage from another document, it is customary to format this as a paragraph that is indented on both the left and the right margin. You can include quotations in Org mode documents like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN_QUOTE&#xA; Everything should be made as simple as possible,&#xA; but not any simpler -- Albert Einstein&#xA; #+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This information in available in the &lt;a href=&quot;http://orgmode.org/manual/Paragraphs.html&quot; rel=&quot;noreferrer&quot;&gt;org manual&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you convert your file to html then your text will be as shown below  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LXfmr.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LXfmr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-10-06T02:33:10.833" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27605" PostTypeId="1" AcceptedAnswerId="30436" CreationDate="2016-10-06T02:41:01.787" Score="0" ViewCount="297" Body="&lt;p&gt;I'm reading the Emacs manual in Info-mode. Some non-ascii characters render as octal escape sequences rather than glyphs. For example, node 23.2 &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/emacs.html#Minor-Modes&quot; rel=&quot;nofollow&quot;&gt;Minor Modes&lt;/a&gt; contains the following text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Electric Quote mode automatically converts quotation marks.  For&#xA;  example, it requotes text typed `like this' to text ‘like&#xA;  this’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I view it in an info buffer, I see:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Electric Quote mode automatically converts quotation marks.  For&#xA;  example, it requotes text typed `like this' to text \342\200\230like&#xA;  this\342\200\231.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I select this text and write the region to a file, I can open that file and Emacs renders it correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs in a gui, but I've repro'd everything above in the terminal as well, and both with and without my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's causing this behavior, and how can I fix it so info buffers render correctly?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-02-03T22:55:06.063" Title="Render non-ascii chars correctly in Info buffers?" Tags="|unicode|info|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27606" PostTypeId="2" ParentId="27605" CreationDate="2016-10-06T08:47:14.337" Score="0" Body="&lt;p&gt;Add this to your config file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;(set-default-coding-systems 'utf-8)&#xA;(set-terminal-coding-system 'utf-8)&#xA;(set-keyboard-coding-system 'utf-8)&#xA;(setq default-buffer-file-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, if you run emacs in tmux, add this to tmux config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set -gq utf8&#xA;setw -gq utf8 on&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13536" LastActivityDate="2016-10-06T08:47:14.337" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27608" PostTypeId="2" ParentId="27602" CreationDate="2016-10-06T13:19:59.297" Score="4" Body="&lt;p&gt;I think &lt;a href=&quot;https://melpa.org/#/undo-tree&quot; rel=&quot;nofollow&quot;&gt;undo-tree&lt;/a&gt; looks like the closest match to these features. Although, it's hardly a one-to-one match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to navigate between changes more readily by visualizing the 'tree' of changes using &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;u&lt;/kbd&gt;. It is then possible to navigate to the various changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are no similar 'diffing' or 'timestamping' features available as far as I know.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastActivityDate="2016-10-06T13:19:59.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27609" PostTypeId="2" ParentId="21205" CreationDate="2016-10-06T14:19:20.660" Score="4" Body="&lt;p&gt;I don't have enough reputation to comment on the accepted solution. But I made a variation of it, that works well with nested packages (for example using &lt;a href=&quot;https://github.com/lerna/lerna&quot; rel=&quot;nofollow&quot;&gt;lerna&lt;/a&gt;). This is the exact same code, however it looks up the parent &lt;code&gt;node_modules&lt;/code&gt; folder recursively until it finds an &lt;code&gt;eslint&lt;/code&gt; binary, and uses it. This way, you can have a lerna project have only one eslint configuration, shared between all sub-packages.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/use-eslint-from-node-modules ()&#xA;  (let ((root (locate-dominating-file&#xA;               (or (buffer-file-name) default-directory)&#xA;               (lambda (dir)&#xA;                 (let ((eslint (expand-file-name &quot;node_modules/eslint/bin/eslint.js&quot; dir)))&#xA;                  (and eslint (file-executable-p eslint)))))))&#xA;    (when root&#xA;      (let ((eslint (expand-file-name &quot;node_modules/eslint/bin/eslint.js&quot; root)))&#xA;        (setq-local flycheck-javascript-eslint-executable eslint)))))&#xA;(add-hook 'flycheck-mode-hook #'my/use-eslint-from-node-modules)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13560" LastActivityDate="2016-10-06T14:19:20.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27610" PostTypeId="1" AcceptedAnswerId="28877" CreationDate="2016-10-06T16:18:29.983" Score="5" ViewCount="1762" Body="&lt;p&gt;&lt;strong&gt;GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-10-06&lt;/strong&gt;&lt;br&gt;&#xA;&lt;strong&gt;Org-mode version 8.3.5 (release_8.3.5-1131-g7eecb2 @ ~/.emacs.d/el-get/org-mode/lisp/)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have come to share my projects as html files where I include notes and codes so that others can follow my workflow and reproduce my results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing is that I want to reuse code blocks with different input variables, and I do this with the &lt;code&gt;:var&lt;/code&gt; header arg. The issue is that &lt;code&gt;:var&lt;/code&gt;arguments are not included in the exported code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to selectively choose code blocks where the &lt;code&gt;:var&lt;/code&gt; arguments are included in the exported code block?&#xA;I noticed that when tangling the code block the variables are included in the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note that I am asking for a language agnostic solution if possible.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example use case:&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat ./export_var.org&#xA;&#xA;* Export with variables&#xA;:PROPERTIES:&#xA;:header-args: :var status=&quot;not_finished&quot;&#xA;:END:&#xA;&#xA; #+NAME: example-table&#xA;| 1 |&#xA;| 2 |&#xA;| 3 |&#xA;| 4 |&#xA;&#xA;Here we import a table.          &#xA;#+NAME: table-length&#xA;#+BEGIN_SRC R :var table=example-table :tangle &quot;./export_var.R&quot;&#xA;status &amp;lt;- &quot;finished&quot;&#xA;dim(table)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: table-length&#xA;| 4 |&#xA;| 1 |&#xA;&#xA;Here we think we import a table&#xA;#+NAME: table-str-length&#xA;#+BEGIN_SRC R :var table=&quot;./filename_example-table.tsv&quot; :tangle &quot;./export_var.R&quot;&#xA;length(table)&#xA;print(status)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: table-str-length&#xA;: not_finished&#xA;&#xA;** Some subcase&#xA;If I run with the data in =&quot;./other_data.tsv&quot;=&#xA;#+call: table-str-length[ :var table=&quot;./other_data.tsv&quot;]()&#xA;&#xA;#+RESULTS:&#xA;: not_finished&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now this would tangle as the following &lt;code&gt;./export_var.R&lt;/code&gt; as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;status &amp;lt;- &quot;not_finished&quot;&#xA;table &amp;lt;- local({&#xA;     con &amp;lt;- textConnection(&#xA;       &quot;\&quot;1\&quot;&#xA;\&quot;2\&quot;&#xA;\&quot;3\&quot;&#xA;\&quot;4\&quot;&quot;&#xA;     )&#xA;     res &amp;lt;- utils::read.table(&#xA;       con,&#xA;       header    = FALSE,&#xA;       row.names = NULL,&#xA;       sep       = &quot;\t&quot;,&#xA;       as.is     = TRUE&#xA;     )&#xA;     close(con)&#xA;     res&#xA;   })&#xA;status &amp;lt;- &quot;finished&quot;&#xA;dim(table)&#xA;&#xA;status &amp;lt;- &quot;not_finished&quot;&#xA;table &amp;lt;- &quot;./filename_example-table.tsv&quot;&#xA;length(table)&#xA;print(status)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The desired result would be the same code as in the tangled file, although split up as usual in the html file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inheritance structure of &lt;code&gt;:header-args&lt;/code&gt; can be somewhat complex.&lt;/p&gt;&#xA;" OwnerUserId="427" LastEditorUserId="427" LastEditDate="2016-10-07T10:09:26.973" LastActivityDate="2016-11-24T05:56:14.777" Title="How do I insert code block header :var in exported code block in org-mode" Tags="|org-mode|org-export|org-babel|variables|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27611" PostTypeId="1" CreationDate="2016-10-06T18:24:18.547" Score="0" ViewCount="238" Body="&lt;p&gt;If I open a file in emacs, and the file subsequently gets moved or renamed by a different program, emacs will still save the file to the old location and name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example process:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open &lt;code&gt;ex.txt&lt;/code&gt; in emacs.&lt;/li&gt;&#xA;&lt;li&gt;Make some changes to the file.&lt;/li&gt;&#xA;&lt;li&gt;From another terminal, move &lt;code&gt;ex.txt&lt;/code&gt; to the &lt;code&gt;dir/&lt;/code&gt; subdirectory.&lt;/li&gt;&#xA;&lt;li&gt;In emacs, save the modified file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Expected behavior:&lt;/em&gt; emacs realized the file was moved and saves the changes to the new file location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Actual behavior:&lt;/em&gt; emacs saves the changes to the old filename and location. There are now two files, the old &lt;code&gt;ex.txt&lt;/code&gt; in &lt;code&gt;dir/&lt;/code&gt; and the modified &lt;code&gt;ex.txt&lt;/code&gt; in the original directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I get emacs to realize an open file has been moved and update the file in its new location?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="12866" LastActivityDate="2016-10-06T19:39:30.970" Title="Automatically save moved file to new location" Tags="|saving|saveplace|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27612" PostTypeId="1" CreationDate="2016-10-06T18:31:36.373" Score="0" ViewCount="1860" Body="&lt;p&gt;So I can't get Auto-Complete to work for JavaScript. I've tried a variety of solutions but nothing seems to be working. Here is the relevant code snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;&#xA;;;adds js2-mode for javascript autocompletion&#xA;;;&#xA;(add-to-list 'load-path &quot;~/.emacs-config/js2-mode&quot;)&#xA;(require 'js2-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.js\\'&quot; . js2-mode))&#xA;&#xA;;;&#xA;;;adds auto complete&#xA;;;&#xA;;Load the default configuration&#xA;(add-to-list 'load-path &quot;~/.emacs-config/auto-complete&quot;)&#xA;(require 'auto-complete-config)&#xA;; Make sure we can find the dictionaries&#xA;(add-to-list 'ac-dictionary-directories &quot;~/.emacs-config/auto-complete/dict&quot;)&#xA;; Use dictionaries by default&#xA;(ac-config-default)&#xA;(dolist (m '(js2-mode))&#xA;  (add-to-list 'ac-modes m))&#xA;;Start auto-completion after 2 characters of a word&#xA;(setq ac-auto-start 2)&#xA;; case sensitivity is important when finding matches&#xA;(setq ac-ignore-case nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, I install and manage all of my packages manually with Git, and I am on Emacs 24.5.1 and running spacemacs. Anyone have any insight into this issue?&lt;/p&gt;&#xA;" OwnerUserId="13561" LastEditorUserId="675" LastEditDate="2016-10-06T21:52:51.053" LastActivityDate="2024-03-30T01:06:00.770" Title="Autocomplete not working for JavaScript" Tags="|spacemacs|auto-complete-mode|js2-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27613" PostTypeId="1" CreationDate="2016-10-06T18:36:03.140" Score="0" ViewCount="930" Body="&lt;p&gt;I'm using spacemacs devel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added following private layer using M-x configuration-layer/create-layer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(setq irony-packages&#xA;      '(&#xA;        company-irony&#xA;        company-irony-c-headers&#xA;        irony&#xA;        irony-eldoc&#xA;        ;; flycheck-irony ;; I'm not using it.&#xA;        ))&#xA;&#xA;(defun irony/init-irony ()&#xA;  (use-package irony&#xA;    :defer t&#xA;    :commands (irony-mode irony-install-server)&#xA;    :init&#xA;    (progn&#xA;      (add-hook 'c-mode-hook 'irony-mode)&#xA;      (add-hook 'c++-mode-hook 'irony-mode))&#xA;    :config&#xA;    (progn&#xA;      (setq irony-user-dir (f-slash (f-join user-home-directory &quot;bin&quot; &quot;irony&quot;)))&#xA;      (setq irony-server-install-prefix irony-user-dir)&#xA;      (add-hook 'c++-mode-hook (lambda () (setq irony-additional-clang-options '(&quot;-std=c++11&quot;))))&#xA;      (defun irony/irony-mode-hook ()&#xA;        (define-key irony-mode-map [remap completion-at-point] 'irony-completion-at-point-async)&#xA;        (define-key irony-mode-map [remap complete-symbol] 'irony-completion-at-point-async))&#xA;&#xA;      (add-hook 'irony-mode-hook 'irony/irony-mode-hook)&#xA;      (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))))&#xA;&#xA;(when (configuration-layer/layer-usedp 'auto-completion)&#xA;  (defun irony/init-company-irony ()&#xA;    (use-package company-irony&#xA;      :if (configuration-layer/package-usedp 'company)&#xA;      :defer t&#xA;      :commands company-irony&#xA;      :init&#xA;      (progn&#xA;        ;;(add-to-list 'company-backends 'company-irony)&#xA;        (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)))))&#xA;&#xA;(when (configuration-layer/layer-usedp 'auto-completion)&#xA;  (defun irony/init-company-irony-c-headers ()&#xA;    (use-package company-irony-c-headers&#xA;      :if (configuration-layer/package-usedp 'company)&#xA;      :defer t&#xA;      :commands company-irony-c-headers&#xA;      :init&#xA;      (push 'company-irony-c-headers company-backends-c-mode-common))))&#xA;&#xA;(when (configuration-layer/layer-usedp 'syntax-checking)&#xA;  (defun irony/init-flycheck-irony ()&#xA;    (use-package flycheck-irony&#xA;      :if (configuration-layer/package-usedp 'flycheck)&#xA;      :defer t&#xA;      :init (add-hook 'irony-mode-hook 'flycheck-irony-setup))))&#xA;&#xA;(defun irony/init-irony-eldoc ()&#xA;  (use-package irony-eldoc&#xA;    :commands (irony-eldoc)&#xA;    :init&#xA;    (add-hook 'irony-mode-hook 'irony-eldoc)))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then added irony to dotspacemacs-configuration-layers. After restart all is working well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I need to do is to use my github versions of all the packages listed above:&#xA;&lt;code&gt;&#xA;        company-irony&#xA;        company-irony-c-headers&#xA;        irony&#xA;        irony-eldoc&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what I did.&#xA;&lt;code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;removed irony from dotspacemacs-configuration-layers.&lt;/li&gt;&#xA;&lt;li&gt;restared emacs. This removed all the 4 irony packages from my system, which is OK.&lt;/li&gt;&#xA;&lt;li&gt;edited dotspacemacs-additional-packages, then restared emacs:&#xA;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;   dotspacemacs-additional-packages '(w3m google-c-style flycheck-google-cpplint&#xA;                                          ;; I added the following.&#xA;                                          (irony :location (recipe :fetcher github :repo &quot;vibrys/irony-mode&quot;))&#xA;                                          (company-irony :location (recipe :fetcher github :repo &quot;vibrys/company-irony&quot;))&#xA;                                          (company-irony-c-headers :location (recipe :fetcher github :repo &quot;vibrys/company-irony-c-headers&quot;))&#xA;                                          (irony-eldoc :location (recipe :fetcher github :repo &quot;vibrys/irony-eldoc&quot;))&#xA;                                          )&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Messages&lt;/em&gt; log tells the following about the source of packages' installation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Spacemacs) --&gt; installing package: company-irony@dotfile... [1/4]&#xA;Fetcher: github&#xA;Source: vibrys/company-irony&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Spacemacs) --&gt; installing package: company-irony-c-headers@dotfile... [2/4]&#xA;Fetcher: github&#xA;Source: vibrys/company-irony-c-headers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Spacemacs) --&gt; installing package: irony@dotfile... [3/4]        ;; this on does NOT go from github.com. THis is my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Spacemacs) --&gt; installing package: irony-eldoc@dotfile... [4/4]&#xA;Fetcher: github&#xA;Source: vibrys/irony-eldoc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that irony@dotfile does NOT go from github. It is taken from standard repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;regards&lt;/p&gt;&#xA;" OwnerUserId="11050" LastActivityDate="2023-12-31T01:04:45.567" Title="spacemacs, problem with irony package when getting irony* from github as alternative location" Tags="|spacemacs|github|irony-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27614" PostTypeId="1" AcceptedAnswerId="27648" CreationDate="2016-10-06T18:57:57.293" Score="2" ViewCount="1815" Body="&lt;p&gt;I am a fairly new Emacs user and just switched to using Spacemacs instead of trying to do all of the Vim configuration myself. It included a whole bunch of packages that I had not been using before, including Helm. I am willing to bet that I am missing something completely obvious, but I can't figure out how to search up a directory for file names without leaving the Helm search results. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;What I am doing:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I type &lt;code&gt;:e &amp;lt;TAB&amp;gt;&lt;/code&gt; and get a list of filenames. &lt;/li&gt;&#xA;&lt;li&gt;I see I am in the wrong directory and type &lt;code&gt;../&lt;/code&gt; to go up a directory&lt;/li&gt;&#xA;&lt;li&gt;Helm shows me anything in the current directory with any two characters followed by &lt;code&gt;/&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;What I want to happen:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I type &lt;code&gt;:e &amp;lt;TAB&amp;gt;&lt;/code&gt; followed by &lt;code&gt;../&lt;/code&gt; or some other simple sequence&lt;/li&gt;&#xA;&lt;li&gt;Helm shows me the contents of the directory above my current location&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Similar behavior&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I see that I can type &lt;code&gt;:e ../&amp;lt;TAB&amp;gt;&lt;/code&gt; to get the contents of the directory above me or that I can hit &lt;code&gt;&amp;lt;ESC&amp;gt;&lt;/code&gt; followed by &lt;code&gt;../&amp;lt;TAB&amp;gt;&lt;/code&gt; but these both hide the search result window which I find a minor annoyance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that this is simple enough that I must be missing something. Is there a way to get this behavior?&lt;/p&gt;&#xA;" OwnerUserId="13562" LastActivityDate="2016-10-08T09:20:41.670" Title="spacemacs+helm search up a directory" Tags="|helm|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27615" PostTypeId="2" ParentId="27611" CreationDate="2016-10-06T18:59:39.013" Score="0" Body="&lt;p&gt;I doubt this would ever become the default behavior, but it's a pretty good idea for an optional one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real problem is implementing it. Linux currently provides two APIs that Emacs can use to get notifications about changes to files, inotify and fanotify. The newer API, fanotify, doesn't send notifications about file moves at all. inotify is happy to notify you that a file was moved or renamed, but it does so in a rather odd way. If you're watching the directory containing the file, inotify will tell you that the file was moved away. Unless you're already watching the destination, however, inotify won't tell you where the file was moved &lt;em&gt;to&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm fairly certain that Windows and OSX have similar APIs, but since I don't actually do any programming for those platforms I don't really know much about them. I suggest that the first step towards implementing this would be to research these and see if it's doable. There are a few other packages for Emacs which are platform-specific, so don't let that stop you.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-06T18:59:39.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27616" PostTypeId="2" ParentId="27612" CreationDate="2016-10-06T19:00:01.480" Score="0" Body="&lt;p&gt;You still need an auto-complete source, do you not?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could try &lt;a href=&quot;https://github.com/ScottyB/ac-js2&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;ac-js2&quot;&gt;ac-js2&lt;/a&gt;. Please note that I have not tried this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see &lt;a href=&quot;https://stackoverflow.com/questions/26812853/js2-auto-complete-not-working-on-emacs&quot;&gt;this question&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6615" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-10-06T19:00:01.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27617" PostTypeId="2" ParentId="27611" CreationDate="2016-10-06T19:39:30.970" Score="1" Body="&lt;p&gt;This doesn't answer the question as posed, but one option that you have for moving a file that is being visited by a buffer is to use &lt;code&gt;dired&lt;/code&gt;.  Files that are being visited by a buffer automatically have their &lt;code&gt;buffer-file-name&lt;/code&gt; value updated when they are moved or renamed via dired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-f /tmp/testfile.txt&lt;/code&gt; to create a new file&lt;/li&gt;&#xA;&lt;li&gt;Type some text in the buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-s&lt;/code&gt; To save the file&lt;/li&gt;&#xA;&lt;li&gt;Type a little more text without saving&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x d RET&lt;/code&gt; To open a dired buffer&lt;/li&gt;&#xA;&lt;li&gt;Use arrows (or &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt;) to move your cursor to &lt;code&gt;testfile.txt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;R newfile.txt&lt;/code&gt; to rename the file to &lt;code&gt;newfile.txt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;q&lt;/code&gt; to dismiss the dired buffer&lt;/li&gt;&#xA;&lt;li&gt;Notice that the buffer name has changed to reflect the new file name&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-s&lt;/code&gt; to save the unsaved changes to the new file location.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-10-06T19:39:30.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27618" PostTypeId="2" ParentId="27613" CreationDate="2016-10-06T20:04:45.023" Score="0" Body="&lt;p&gt;When I left only irony within the following&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;   dotspacemacs-additional-packages '(w3m google-c-style flycheck-google-cpplint&#xA;                                          (irony :location (recipe :fetcher github :repo &amp;quot;vibrys/irony-mode&amp;quot;))&#xA;                                          )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and layer packages.el file is also left with irony, ie:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq irony-packages&#xA;      '(&#xA;        irony))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;then emacs restart installs it from github. &lt;em&gt;messages&lt;/em&gt; tells:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(Spacemacs) --&amp;gt; installing package: irony@irony... [1/1]&#xA;&#xA;Fetcher: github&#xA;&#xA;Source: vibrys/irony-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So maybe the problem is that in case all four irony packages are going to be installed, then this irony package is already contained within one of the three thus installed earlier.&lt;/p&gt;&#xA;&lt;p&gt;I changed the sequence of packages in packages.el then, so that:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq irony-packages&#xA;      '(&#xA;        irony&#xA;        irony-eldoc&#xA;        company-irony-c-headers&#xA;        company-irony&#xA;        ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and changed sequence within &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;   dotspacemacs-additional-packages '(w3m google-c-style flycheck-google-cpplint&#xA;                                          (irony :location (recipe :fetcher github :repo &amp;quot;vibrys/irony-mode&amp;quot;))&#xA;                                          (irony-eldoc :location (recipe :fetcher github :repo &amp;quot;vibrys/irony-eldoc&amp;quot;))&#xA;                                          (company-irony-c-headers :location (recipe :fetcher github :repo &amp;quot;vibrys/company-irony-c-headers&amp;quot;))&#xA;                                          (company-irony :location (recipe :fetcher github :repo &amp;quot;vibrys/company-irony&amp;quot;))&#xA;                                          )&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;, then restarted emacs, and I've noticed that company mode is fetched just after &lt;code&gt;company-irony&lt;/code&gt; has been fetched, even if it is installed in step [3/4]. This time the source is: Sarcasm/irony-mode, not: &lt;code&gt;vibrys/irony-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(Spacemacs) --&amp;gt; installing package: company-irony@irony... [1/4]&#xA;&#xA;Fetcher: github&#xA;&#xA;Source: vibrys/company-irony&#xA;&#xA;....&#xA;&#xA;Fetcher: github&#xA;&#xA;Source: Sarcasm/irony-mode&#xA;&#xA;....&#xA;&#xA;(Spacemacs) --&amp;gt; installing package: company-irony-c-headers@irony... [2/4]&#xA;&#xA;Fetcher: github&#xA;&#xA;Source: vibrys/company-irony-c-headers&#xA;&#xA;(Spacemacs) --&amp;gt; installing package: irony@irony... [3/4]&#xA;&#xA;&#xA;(Spacemacs) --&amp;gt; installing package: irony-eldoc@irony... [4/4]&#xA;&#xA;Fetcher: github&#xA;&#xA;Source: vibrys/irony-eldoc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11050" LastEditorUserId="23697" LastEditDate="2020-08-17T15:28:22.313" LastActivityDate="2020-08-17T15:28:22.313" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27619" PostTypeId="2" ParentId="6070" CreationDate="2016-10-06T20:17:52.803" Score="1" Body="&lt;p&gt;A solution based on &lt;a href=&quot;https://technet.microsoft.com/en-us/sysinternals/bb896768&quot; rel=&quot;nofollow&quot;&gt;Microsoft junction&lt;/a&gt; by Mark Russinovich. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-target (dir)&#xA;  &quot;If DIR is a junction, return its target, else return DIR.&#xA;The 'junction' util is assumed to be in your path.&quot;  &#xA;  (setq dir (expand-file-name (substitute-in-file-name dir)))&#xA;  (let* (out (bin &quot;junction.exe&quot;))    &#xA;    (unless (executable-find bin) (error (concat &quot;Unable to find the tool &quot; bin)))&#xA;    (setq out (car (last (split-string&#xA;              (shell-command-to-string&#xA;               (concat &quot;junction &quot;&#xA;                   (shell-quote-argument&#xA;                    (replace-regexp-in-string&#xA;                     &quot;/&quot; &quot;\\\\&quot;&#xA;                     (replace-regexp-in-string &quot;/$&quot; &quot;&quot; dir)))))&#xA;              &quot;\n&quot; t))))&#xA;    (if (string-match &quot;^ +Substitute Name: &quot; out)&#xA;    (expand-file-name (replace-match &quot;&quot; nil nil out)) dir)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-10-06T20:17:52.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27620" PostTypeId="1" AcceptedAnswerId="58806" CreationDate="2016-10-06T20:48:46.750" Score="7" ViewCount="1564" Body="&lt;p&gt;I have a basic capture template:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;a&quot; &quot;Article&quot; entry     &#xA;(file+headline &quot;~/GitLab/Reports/Bibliography/references.org&quot; &quot;Article&quot;)&#xA;&quot;* %^{Title} \n%?&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that asks you to fill the Title field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, my question is how to automatically fill this using the title of the original document (the original #+TITLE my title). One must certainly use &lt;em&gt;sexp&lt;/em&gt; with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;a&quot; &quot;Article&quot; entry     &#xA;(file+headline &quot;~/GitLab/Reports/Bibliography/references.org&quot; &quot;Article&quot;)&#xA;&quot;* %(...some elisp instructions...) \n%?&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that I do not find/know a function returning the title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;a&quot; &quot;Article&quot; entry     &#xA;(file+headline &quot;~/GitLab/Reports/Bibliography/references.org&quot; &quot;Article&quot;)&#xA;&quot;* %(org-capture-get :original-file-nondirectory) \n%?&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fills with the original file name, but the equivalent for title:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%(org-capture-get :title)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does not exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also try, from an org-mode file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Titi Toto&#xA;&#xA;#+BEGIN_SRC emacs-lisp&#xA;(plist-get (org-export-get-environment) ':title)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| Titi Toto |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(plist-get (org-export-get-environment) ':title)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;does not work anymore when used in the capture template.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is welcome&lt;/p&gt;&#xA;" OwnerUserId="13563" LastEditorUserId="13563" LastEditDate="2020-05-30T06:03:01.650" LastActivityDate="2020-06-14T08:31:01.360" Title="orgmode, capturing original document title" Tags="|org-mode|org-capture|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27621" PostTypeId="1" AcceptedAnswerId="27623" CreationDate="2016-10-06T21:18:47.183" Score="4" ViewCount="1317" Body="&lt;p&gt;I have this on my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; magit status&#xA;(define-key evil-motion-state-map &quot;gs&quot; 'magit-status)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like to have another binding, for &lt;code&gt;C-u M-x magit-status&lt;/code&gt; (C-u is the universal-argument)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like (which obviously does not work):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; magit status&#xA;(define-key evil-motion-state-map &quot;ga&quot; 'C-u magit-status)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;rationale&lt;/em&gt;: with &lt;code&gt;C-u M-x magit-status&lt;/code&gt;, magit allows you to supply a directory where a git repo resides, so you do not have to have an opened file that resides inside the git repo where you want to perform git actions.&lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="253" LastEditDate="2016-10-06T22:00:49.380" LastActivityDate="2016-10-07T15:44:33.813" Title="how to supply universal-argument (C-u) to a function call inside a binding statement" Tags="|key-bindings|magit|evil|" AnswerCount="3" CommentCount="1" ClosedDate="2016-10-11T16:12:08.027" ContentLicense="CC BY-SA 3.0" />
  <row Id="27622" PostTypeId="2" ParentId="27610" CreationDate="2016-10-06T21:50:20.717" Score="3" Body="&lt;h1&gt;Embed &lt;code&gt;org-babel-variable-assignments:R&lt;/code&gt; call into &lt;code&gt;R&lt;/code&gt; code block using &lt;code&gt;elisp&lt;/code&gt; and &lt;code&gt;noweb&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Create a named &lt;strong&gt;elisp&lt;/strong&gt; block, e.g. &lt;em&gt;convert-data-to-R-code&lt;/em&gt;, &lt;em&gt;without&lt;/em&gt; &lt;code&gt;:var&lt;/code&gt; headers that returns results from &lt;code&gt;org-babel-variable-assignments:R&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: convert-data-to-R-code&#xA;#+BEGIN_SRC elisp  :exports none &#xA;  (mapconcat 'identity (org-babel-variable-assignments:R params) &quot; &quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Call &lt;code&gt;elisp&lt;/code&gt; block, &lt;em&gt;convert-data-to-R-code&lt;/em&gt;, in &lt;code&gt;R&lt;/code&gt; code block during export via &lt;code&gt;noweb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Pass original &lt;code&gt;:var&lt;/code&gt; headers inside square brackets &lt;code&gt;[]&lt;/code&gt; to &lt;code&gt;elisp&lt;/code&gt; code block, e.g. &lt;code&gt;:var table&quot;./filename_example-table.tsv&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC R  :noweb yes &#xA;&amp;lt;&amp;lt;convert-data-to-R-code[ :var table=&quot;./filename_example-table.tsv&quot;]()&amp;gt;&amp;gt;&#xA;dim(table)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After exporting, the &lt;code&gt;R&lt;/code&gt; code should contain missing variable assignments.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;table &amp;lt;- &quot;./filename_example-table.tsv&quot;&#xA;dim(table)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;Hope that helped&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;This code was tested using:&lt;/strong&gt;&lt;br&gt;&#xA;  GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  org-mode version: 8.3.5&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/melioratus/nosebutter/blob/master/stackexchange/How_do_I_insert_code_block_header_var_in_exported_code_block_in_org-mode.org#answer---try-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;Show Org Source&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-11-24T05:54:09.517" LastActivityDate="2016-11-24T05:54:09.517" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27623" PostTypeId="2" ParentId="27621" CreationDate="2016-10-06T21:52:32.500" Score="3" Body="&lt;p&gt;&lt;code&gt;#'magit-status&lt;/code&gt; is fun, because its argument to &lt;code&gt;interactive&lt;/code&gt; isn't just a string, so running it naively with &lt;code&gt;call-interactively&lt;/code&gt; doesn't work.Instead, the function generates its own interactive arguments. Here's the &lt;code&gt;interactive&lt;/code&gt; call inside &lt;code&gt;(defun magit-status ...&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(interactive&#xA; (list (and (or current-prefix-arg (not (magit-toplevel)))&#xA;            (magit-read-repository&#xA;             (&amp;gt;= (prefix-numeric-value current-prefix-arg) 16)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So we have to bind &lt;code&gt;current-prefix-arg&lt;/code&gt; directly, to pretend it's been called with a prefix arg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map &quot;ga&quot;&#xA; (lambda () (interactive)&#xA;   (let ((current-prefix-arg 4))&#xA;     (call-interactively #'magit-status))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, as I tested it (because I don't use evil-mode):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key&#xA; (kbd &quot;C-c C-s&quot;)&#xA; (lambda () (interactive)&#xA;   (let ((current-prefix-arg 4))&#xA;     (call-interactively #'magit-status))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to @npostavs for the instruction on binding &lt;code&gt;current-prefix-arg&lt;/code&gt;. The previous answer (for the purposes of transparency) was:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key&#xA; (kbd &quot;C-c C-s&quot;)&#xA; (lambda () (interactive)&#xA;   (magit-status (magit-read-repository&#xA;                  (&amp;gt;= (prefix-numeric-value current-prefix-arg) 16)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2016-10-07T15:44:33.813" LastActivityDate="2016-10-07T15:44:33.813" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27624" PostTypeId="2" ParentId="27621" CreationDate="2016-10-06T21:54:05.577" Score="2" Body="&lt;p&gt;You do not need a separate keybinding to pass the universal argument to the command.  Based on your current keybinding, you may simply type &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt;&lt;kbd&gt;s&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-10-06T21:54:05.577" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27625" PostTypeId="2" ParentId="27621" CreationDate="2016-10-06T22:41:53.443" Score="2" Body="&lt;p&gt;Even better, if you don't want to risk doing the wrong thing when/if &lt;code&gt;magit-status&lt;/code&gt; is changed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-motion-state-map &quot;ga&quot;&#xA;  (lambda () (interactive)&#xA;    (universal-argument)&#xA;    (call-interactively 'magit-status))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or to test without using evil:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key&#xA; (kbd &quot;C-c C-s&quot;)&#xA; (lambda () (interactive)&#xA;   (universal-argument)&#xA;   (call-interactively 'magit-status)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically &lt;code&gt;universal-argument&lt;/code&gt; sets up the state as if you had pressed &lt;code&gt;C-u&lt;/code&gt; (because &lt;code&gt;C-u&lt;/code&gt; is actually bound to &lt;code&gt;universal-argument&lt;/code&gt;), then the next interactively-called function reads that state. If you wanted to call a function as if &lt;code&gt;C-u&lt;/code&gt; had been pressed twice, then you would first call &lt;code&gt;universal-argument&lt;/code&gt; and then &lt;code&gt;universal-argument-more&lt;/code&gt;. Numeric arguments could be supplied with &lt;code&gt;digit-argument&lt;/code&gt; and &lt;code&gt;negative-argument&lt;/code&gt;; see simple.el for the actual code that implements all of this.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2016-10-06T23:02:47.047" LastActivityDate="2016-10-06T23:02:47.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27627" PostTypeId="2" ParentId="26887" CreationDate="2016-10-07T04:38:44.790" Score="0" Body="&lt;p&gt;FWIW if you display the full diff for the commit with &lt;kbd&gt;D&lt;/kbd&gt;, that naturally details all of the modified files as part of the diff.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-10-07T04:38:44.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27628" PostTypeId="1" CreationDate="2016-10-07T08:43:07.487" Score="1" ViewCount="1062" Body="&lt;p&gt;There is such feature as Command Palette in Sublime text:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/OdzQX.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OdzQX.jpg&quot; alt=&quot;Command Palette&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It provides searchable list of command with human-readable descriptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything similar to this in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="13568" LastEditorUserId="105" LastEditDate="2016-10-07T14:48:13.097" LastActivityDate="2016-10-07T15:52:16.890" Title="Is there Sublime Text - style command palette in Emacs?" Tags="|completion|commands|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27629" PostTypeId="2" ParentId="27420" CreationDate="2016-10-07T09:27:05.783" Score="2" Body="&lt;p&gt;I solved my problem with a workaround: I use Autohotkey Pro (AHK) on the windows machine to change the non-working key combinations to something else; on the Emacs side I alias them back to the original meaning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without further ado, this is the AHK script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# emacs_fix.ahk&#xA;&#xA;#NoEnv&#xA;SendMode Input    &#xA;&#xA;#IfWinActive, emacs&#xA;&#xA;end:: Send, ^xpe&#xA;^right:: Send, ^xpcr&#xA;^left:: Send, ^xpcl&#xA;^up:: Send, ^xpcu&#xA;^down:: Send, ^xpcd&#xA;^end:: Send, ^xpce&#xA;^home:: Send, ^xpch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro defkbalias (old new)&#xA;  `(define-key (current-global-map) ,new&#xA;     (lookup-key (current-global-map) ,old)))&#xA;&#xA;(defkbalias (kbd &quot;&amp;lt;end&amp;gt;&quot;) (kbd &quot;C-x p e&quot;))&#xA;(defkbalias (kbd &quot;C-&amp;lt;right&amp;gt;&quot;) (kbd &quot;C-x p c r&quot;))&#xA;(defkbalias (kbd &quot;C-&amp;lt;left&amp;gt;&quot;) (kbd &quot;C-x p c l&quot;))&#xA;(defkbalias (kbd &quot;C-&amp;lt;up&amp;gt;&quot;) (kbd &quot;C-x p c u&quot;))&#xA;(defkbalias (kbd &quot;C-&amp;lt;down&amp;gt;&quot;) (kbd &quot;C-x p c d&quot;))&#xA;(defkbalias (kbd &quot;C-&amp;lt;end&amp;gt;&quot;) (kbd &quot;C-x p c e&quot;))&#xA;(defkbalias (kbd &quot;C-&amp;lt;home&amp;gt;&quot;) (kbd &quot;C-x p c h&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I picked &lt;code&gt;C-x p&lt;/code&gt; as prefix because it was unused in emacs; it should work with anything that goes through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am very happy - I am positive that I can fix any further broken key combination this way. The display side seems fine - Putty and emacs seem to talk the same language in that regard, at least.&lt;/p&gt;&#xA;" OwnerUserId="11371" LastActivityDate="2016-10-07T09:27:05.783" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27630" PostTypeId="2" ParentId="27461" CreationDate="2016-10-07T09:35:30.137" Score="6" Body="&lt;blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Error (magit): Magit requires Git &amp;gt;= 1.9.4, you are using 1.8.3.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I've already installed git 2.10.0 on /usr/local/git&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The list of directories to search for executables on remote hosts is controlled by the option &lt;code&gt;tramp-remote-path&lt;/code&gt;. It does begin with a &amp;quot;what the remote told me what I should be using&amp;quot; element, but in my experience that doesn't work so well. In particular it does ignore any changes to &lt;code&gt;$PATH&lt;/code&gt; that you have made in your shell's configuration file, I believe.&lt;/p&gt;&#xA;&lt;p&gt;So, in your init file, put &lt;code&gt;/usr/local/git/bin&lt;/code&gt; before &lt;code&gt;/usr/bin&lt;/code&gt; in &lt;code&gt;tramp-remote-path&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tramp)&#xA;(push &amp;quot;/wherever/git/is/&amp;quot; tramp-remote-path)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-08-13T20:19:21.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27632" PostTypeId="2" ParentId="27628" CreationDate="2016-10-07T11:51:17.930" Score="7" Body="&lt;p&gt;I use &lt;code&gt;helm-M-x&lt;/code&gt;. It's part of the package &lt;code&gt;helm&lt;/code&gt;.&#xA;You can view a command's description with &lt;code&gt;helm-execute-persistent-action&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gWzzp.png&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gWzzp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-10-07T11:51:17.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27633" PostTypeId="1" AcceptedAnswerId="27641" CreationDate="2016-10-07T14:41:52.300" Score="5" ViewCount="950" Body="&lt;p&gt;I am using Spacemacs and after using the splitting windows feature, either by splitting horizontally or vertically, Spacemacs always try to balance the split windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when pressing &lt;code&gt;C-x 3&lt;/code&gt; twice, I expect something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;++++++++++++++++&#xA;|      |   |   |&#xA;|      |   |   | &#xA;++++++++++++++++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But Spacemacs always produces this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;++++++++++++++++&#xA;|    |    |    |&#xA;|    |    |    |&#xA;++++++++++++++++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do you know how to disable Spacemacs from doing so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="13199" LastEditorUserId="105" LastEditDate="2016-10-07T14:48:36.480" LastActivityDate="2016-10-07T19:04:32.800" Title="How to disable Spacemacs from auto-balancing the split windows?" Tags="|spacemacs|window-splitting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27634" PostTypeId="2" ParentId="27628" CreationDate="2016-10-07T14:47:35.163" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; provides what you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And not only for &lt;code&gt;M-x&lt;/code&gt; but for anything that prompts for a command name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it provides the same thing for not just names of commands but everything else: faces, buffers, files, variables, functions, bookmarks -- you name it.  It even provides completion of &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Key_Completion&quot; rel=&quot;nofollow&quot;&gt;key sequences and menus/menu items&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can get &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_A_Propos_d&amp;#39;Apropos&quot; rel=&quot;nofollow&quot;&gt;additional information&lt;/a&gt; (complete doc string) about any completion candidates, on demand.  And even without asking for complete doc on a candidate, you get a summary description of it in the mode line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow&quot;&gt;progressively narrow&lt;/a&gt; the set of candidates by using multiple patterns to match &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-07T14:47:35.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27635" PostTypeId="2" ParentId="19152" CreationDate="2016-10-07T14:51:45.160" Score="0" Body="&lt;p&gt;Had the same problem. Uninstalling the org-contrib package fixed this for me. &lt;/p&gt;&#xA;" OwnerUserId="13430" LastActivityDate="2016-10-07T14:51:45.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27636" PostTypeId="2" ParentId="27633" CreationDate="2016-10-07T15:44:49.903" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/roman/golden-ratio.el&quot; rel=&quot;nofollow&quot;&gt;golden-ratio&lt;/a&gt; package does what you want.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-07T15:44:49.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27637" PostTypeId="2" ParentId="27453" CreationDate="2016-10-07T15:50:54.920" Score="1" Body="&lt;p&gt;I 'solved' this mystery by replacement the four splash screen image files of 25.1 by those in version 24.5&#xA;The missing transparency of the logo at the 'About' screen is due to the newer version's splash screen files.&lt;/p&gt;&#xA;" OwnerUserId="6942" LastActivityDate="2016-10-07T15:50:54.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27638" PostTypeId="2" ParentId="27628" CreationDate="2016-10-07T15:52:16.890" Score="3" Body="&lt;p&gt;You can also try &lt;code&gt;counsel-M-x&lt;/code&gt; which comes with &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow&quot;&gt;counsel&lt;/a&gt; package and uses &lt;code&gt;ivy&lt;/code&gt;(similar to &lt;code&gt;helm&lt;/code&gt;) as a backend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are on emacs 25, there is the command &lt;code&gt;describe-symbol&lt;/code&gt; which can provide help for any face/variable/function and &lt;code&gt;ivy&lt;/code&gt; provides narrowing for that as well.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-07T15:52:16.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27639" PostTypeId="1" CreationDate="2016-10-07T16:01:11.517" Score="1" ViewCount="1213" Body="&lt;p&gt;When debugging with gud and gdb in many-windows mode, some source files are opened in the gud interaction window instead of the source window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This appears to happen to files, and only those files, which were open in Emacs before gud was started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've replicated the behavior without my environment using &lt;code&gt;emacs -Q&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is currently in version 24.5.1 but I also experienced the behavior in 24.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My bug report is here: &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22374&quot; rel=&quot;nofollow&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22374&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="10513" LastActivityDate="2017-03-06T18:56:52.707" Title="gud opening source in gud interaction window" Tags="|window|gud|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27640" PostTypeId="2" ParentId="26334" CreationDate="2016-10-07T16:03:14.003" Score="4" Body="&lt;p&gt;I'd like to add another solution to @chen bin's solution which also uses &lt;code&gt;counsel&lt;/code&gt; (but you don't need to have a project maintained by &lt;code&gt;git&lt;/code&gt; for this). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to install &lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot; rel=&quot;nofollow noreferrer&quot;&gt;ag&lt;/a&gt; (the silver searcher) and &lt;code&gt;counsel&lt;/code&gt; provides the command &lt;code&gt;counsel-ag&lt;/code&gt; which searches the current directory for the entered string. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to search within a project(not just the current working directory), add this to your &lt;code&gt;.emacs&lt;/code&gt; :- &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun rag/counsel-ag-project-at-point ()&#xA;    &quot;use counsel ag to search for the word at point in the project&quot;&#xA;    (interactive)&#xA;    (counsel-ag (thing-at-point 'symbol) (projectile-project-root)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function will use &lt;code&gt;ag&lt;/code&gt; to recursively search the project root directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: the above function defaults to the symbol at point for searching. If you do not like that behaviour, replace &lt;code&gt;(thing-at-point 'symbol)&lt;/code&gt; with &lt;code&gt;nil&lt;/code&gt;. And if you want the search results in it's own buffer press &lt;kbd&gt;C-c C-o&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit2&lt;/strong&gt;: if you've &lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ripgrep&lt;/code&gt;&lt;/a&gt; installed, you can replace &lt;code&gt;counsel-ag&lt;/code&gt; with &lt;code&gt;counsel-rg&lt;/code&gt; in the above function and it'll just as fine :) &lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-12-08T11:09:49.293" LastActivityDate="2016-12-08T11:09:49.293" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27641" PostTypeId="2" ParentId="27633" CreationDate="2016-10-07T19:04:32.800" Score="10" Body="&lt;p&gt;Spacemacs sets &lt;code&gt;window-combination-resize&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, which causes Emacs to split windows evenly. You need to add this to &lt;code&gt;user-config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq window-combination-resize nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-10-07T19:04:32.800" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27642" PostTypeId="1" AcceptedAnswerId="27651" CreationDate="2016-10-07T21:18:59.337" Score="2" ViewCount="125" Body="&lt;p&gt;Is it possible to use the jobs table (&lt;code&gt;C-z&lt;/code&gt; &lt;code&gt;bg&lt;/code&gt; &lt;code&gt;jobs&lt;/code&gt; &lt;code&gt;fg&lt;/code&gt;) in &lt;code&gt;multi-term&lt;/code&gt; (or another emacs terminal emulator)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At present when I press &lt;code&gt;C-z&lt;/code&gt; all of emacs is backgrounded to the system jobs table&lt;/p&gt;&#xA;" OwnerUserId="10789" LastEditorUserId="10789" LastEditDate="2016-10-08T11:10:54.483" LastActivityDate="2016-10-08T11:10:54.483" Title="background / jobs table in multi-term" Tags="|multi-term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27643" PostTypeId="1" AcceptedAnswerId="27644" CreationDate="2016-10-07T21:54:18.360" Score="0" ViewCount="56" Body="&lt;p&gt;How can I eliminate the 200ms delay before text is redrawn in table-mode?&lt;/p&gt;&#xA;" OwnerUserId="13575" LastEditorUserId="13575" LastEditDate="2016-10-07T21:55:07.690" LastActivityDate="2016-12-06T22:52:14.367" Title="Fix redraw delay in table-mode" Tags="|table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27644" PostTypeId="2" ParentId="27643" CreationDate="2016-10-07T21:54:47.553" Score="0" Body="&lt;p&gt;The default settings in table-mode have a built-in delay which makes your text invisible for 200ms. Assuming your computer is fast enough to handle it, you can eliminate this with the following settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; 16ms = 60fps&#xA;(setq table-time-before-update 0.016)&#xA;(setq table-time-before-reformat 0.016)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13575" LastActivityDate="2016-10-07T21:54:47.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27645" PostTypeId="1" AcceptedAnswerId="27646" CreationDate="2016-10-07T22:50:18.210" Score="0" ViewCount="237" Body="&lt;p&gt;I am trying to create new keybindings for quickly italicizing and bold-facing the text in org-mode. By default, &lt;code&gt;org-emphasize&lt;/code&gt; function is provided by org-mode for this. I'm leveraging that for my case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this is the keybinding for bold-facing the text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;s-b&quot;) (&#xA;                      lambda () &#xA;                      (interactive) &#xA;                      (org-emphasize '*) &#xA;                      ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I run the keybinding, it throws the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-emphasize: Wrong type argument: characterp, *&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="13458" LastEditorUserId="253" LastEditDate="2016-10-08T00:10:24.127" LastActivityDate="2016-10-08T00:10:24.127" Title="Unable to bind emphasize key in org-mode" Tags="|org-mode|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27646" PostTypeId="2" ParentId="27645" CreationDate="2016-10-07T23:25:23.597" Score="2" Body="&lt;p&gt;Short version: you need to give &lt;code&gt;org-emphasize&lt;/code&gt; a &lt;em&gt;character&lt;/em&gt;, so&#xA;change your function to read&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-emphasize ?\*)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The docstring for &lt;code&gt;org-emphasize&lt;/code&gt; says that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-emphasize &amp;amp;optional CHAR)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Insert or change an emphasis, i.e. a font like bold or italic.&#xA;  If there is an active region, change that region to a new emphasis.&#xA;  If there is no region, just insert the marker characters and position&#xA;  the cursor between them.&#xA;  CHAR should be the marker character.  If it is a space, it means to&#xA;  remove the emphasis of the selected region.&#xA;  If CHAR is not given (for example in an interactive call) it will be&#xA;  prompted for.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You have passed a&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html#Symbol-Type&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;symbol&lt;/em&gt;&lt;/a&gt;&#xA;to &lt;code&gt;org-emphasize&lt;/code&gt; rather than a&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Character-Type.html&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;character&lt;/em&gt;&lt;/a&gt;,&#xA;which is what you need to pass to it.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-10-07T23:25:23.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27647" PostTypeId="1" CreationDate="2016-10-08T00:05:17.370" Score="11" ViewCount="3939" Body="&lt;p&gt;In Org-mode, when creating internal links, we have to type full name of the section heading to which we want to link. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible that the heading name gets automatically filled in when we are creating a new internal link? When creating a new link, we type a few characters and headings matching the characters are shown, and then we can choose from the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe some way using &lt;code&gt;helm&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="13458" LastActivityDate="2022-06-01T20:09:00.230" Title="Autocompletion when creating Internal Links in Org-mode" Tags="|org-mode|helm|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27648" PostTypeId="2" ParentId="27614" CreationDate="2016-10-08T05:55:52.777" Score="2" Body="&lt;p&gt;I don't know which helm command you are using, but if you want to only display files of a certain directory you should try &lt;code&gt;helm-find-files&lt;/code&gt;.&#xA;You can get to the contents of the directory above with the predefined shortcut &lt;code&gt;C-l&lt;/code&gt; within the &lt;code&gt;helm-buffer&lt;/code&gt;. It's also possible to navigate through your filesystem with arrow keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you already know the name of the file you are looking for, I would recommend the command &lt;code&gt;helm-for-files&lt;/code&gt;. However it doesn't always work properly, when using &lt;code&gt;locate&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-08T09:20:41.670" LastActivityDate="2016-10-08T09:20:41.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27649" PostTypeId="1" AcceptedAnswerId="27650" CreationDate="2016-10-08T10:12:26.213" Score="0" ViewCount="74" Body="&lt;p&gt;I googled for this with no success. im looking to &quot;bookmark&quot; a lisp code block so that it appears in the emacs/bookmark+ bookmark lists. for example i want to launch this lisp code when i launch a bookmark &quot;xxz&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xxz ()&#xA; &quot;jump&quot;&#xA;  (interactive)&#xA;  (bmkp-dired-jump &quot;h.nyc&quot; )&#xA;  (org-narrow-to-subtree)&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;anyone know if this is possible at all?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2017-05-07T01:31:41.580" Title="&quot;bookmark&quot; a lisp code block and launch through emacs bookmarking system" Tags="|bookmarks|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27650" PostTypeId="2" ParentId="27649" CreationDate="2016-10-08T10:22:22.613" Score="2" Body="&lt;p&gt;I should have read the bookmark+ deeper. There is a way to do that with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bmkp-make-function-bookmark&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works perfectly.&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorDisplayName="user8748" LastEditDate="2017-05-07T01:31:41.580" LastActivityDate="2017-05-07T01:31:41.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27651" PostTypeId="2" ParentId="27642" CreationDate="2016-10-08T10:24:20.293" Score="2" Body="&lt;p&gt;To send &lt;code&gt;C-z&lt;/code&gt; directly to the shell, open your shell: &lt;code&gt;M-x shell&lt;/code&gt; or &lt;code&gt;M-x term&lt;/code&gt;, I did not try with &lt;code&gt;mutli-term&lt;/code&gt;. Then, once inside the shell, execute:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x local-set-key RET C-z self-insert-command&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, &lt;code&gt;C-z&lt;/code&gt; should send to the background, the task actually running inside the command line, and not the whole Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want this configuration to be persistent. Then you should update your &lt;code&gt;init.el&lt;/code&gt; file and add those lines:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'term-mode-hook&#xA;          (lambda ()&#xA;            (define-key term-raw-map (kbd &quot;C-z&quot;) 'self-insert-command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2016-10-08T10:36:04.547" LastActivityDate="2016-10-08T10:36:04.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27652" PostTypeId="2" ParentId="26323" CreationDate="2016-10-08T11:22:26.920" Score="0" Body="&lt;p&gt;While it can of course not be completely ruled out that Magit and/or &lt;code&gt;with-editor&lt;/code&gt; in some way at least contribute to this error, it most likely is causes by a local configuration issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question can therefore not be answered by someone who does not have access to the machine on which the error occurs. We can only provide tips about how to best locate the cause.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cause of the error has to be isolated by performing a binary-&quot;commenting-out&quot;-search on the user's init file and/or by making educated guesses about what might be the cause and looking specifically in those places. Since the issue apparently cannot be reproduced consistently, the latter might be the only option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;isearch-cancel&lt;/code&gt; appeared in a backtrace, looking for strange things involving &lt;code&gt;isearch&lt;/code&gt; would be a good start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also check the values of the hooks &lt;code&gt;server-visit-hook&lt;/code&gt;, &lt;code&gt;server-switch-hook&lt;/code&gt;, and &lt;code&gt;server-done-hook&lt;/code&gt;. Is there anything on those hooks that shouldn't be?&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-10-08T11:22:26.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27653" PostTypeId="1" CreationDate="2016-10-08T11:38:16.290" Score="1" ViewCount="462" Body="&lt;p&gt;What is the lisp function to get some entry text (excluding descendant items) for the highlighted item in the org-agenda?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-agenda-get-some-entry-text&lt;/code&gt; seems to be promising. I have called it like this via a key in &lt;code&gt;org-agenda-mode-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-get-some-entry-text (point-marker) 6)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it always returns empty string and no error. What gives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there is a function to set an entry property in Agenda, &lt;code&gt;org-agenda-set-property&lt;/code&gt;. Is there a counterpart for &lt;strong&gt;getting&lt;/strong&gt; a property?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything like &lt;code&gt;org-agenda-get-property&lt;/code&gt; out there?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastEditorUserId="2590" LastEditDate="2016-10-08T12:24:53.740" LastActivityDate="2016-10-08T12:24:53.740" Title="How to get entry text and property value in agenda?" Tags="|org-mode|org-agenda|point|marker|" AnswerCount="0" CommentCount="2" ClosedDate="2017-08-13T10:39:33.340" ContentLicense="CC BY-SA 3.0" />
  <row Id="27656" PostTypeId="1" AcceptedAnswerId="28795" CreationDate="2016-10-08T18:16:27.080" Score="1" ViewCount="108" Body="&lt;p&gt;For the value of &lt;code&gt;frame-inherited-parameters&lt;/code&gt;, I normally use &lt;code&gt;(top left width height)&lt;/code&gt; so that new frames have the same geometry as &lt;code&gt;(selected-frame)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since switching to Emacs 25.1.1, this no longer works completely.  Only &lt;em&gt;some&lt;/em&gt; of the parameter values are copied to the new frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run on MacOS Sierra.  (Therefore my &lt;code&gt;frame-creation-function&lt;/code&gt; is the one in &lt;code&gt;term/ns-win.el&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start with a frame like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(#&amp;lt;frame  *Minibuf-1* 0x101899c30&amp;gt; (top (+ -568)) (left 1920) (width 177) (height 98))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and press &lt;code&gt;C-x 5 2&lt;/code&gt; &lt;code&gt;(make-frame-command)&lt;/code&gt;, I end up with frames like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(#&amp;lt;frame  *Minibuf-1* 0x108366c38&amp;gt; (top 23) (left 0) (width 80) (height 95))&#xA;(#&amp;lt;frame *scratch* 0x101899c30&amp;gt; (top (+ -568)) (left 1920) (width 177) (height 98))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried switching the order of &lt;code&gt;frame-inherited-parameters&lt;/code&gt; to &lt;code&gt;(width height top left)&lt;/code&gt; and ended up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(#&amp;lt;frame  *Minibuf-1* 0x108374618&amp;gt; (width 80) (height 98) (top (+ -568)) (left 1920))&#xA;(#&amp;lt;frame *scratch* 0x101899c30&amp;gt; (width 177) (height 98) (top (+ -568)) (left 1920))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All of this happens even though I started emacs with &lt;code&gt;--no-init-file&lt;/code&gt; and loaded no libraries since starting it.&lt;/p&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2016-11-23T16:51:06.650" Title="Emacs frame-inherited-parameters only partially work" Tags="|frames|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27657" PostTypeId="1" AcceptedAnswerId="27661" CreationDate="2016-10-08T18:48:49.980" Score="23" ViewCount="1089" Body="&lt;p&gt;I've looked all around for footage of ancient Emacs distributions, but to no avail.&#xA;The source code for Emacs 16.56 from &lt;em&gt;July 15, 1985&lt;/em&gt; is available on &lt;a href=&quot;https://github.com/larsbrinkhoff/emacs-16.56&quot;&gt;Github&lt;/a&gt;, but under no circumstances could I manage to build it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original Stallman &lt;a href=&quot;ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-519A.pdf&quot;&gt;Emacs paper&lt;/a&gt; describes Elisp, the motivation behind Emacs, and some old extensions - but is not enough for one to reconstruct what it felt like to play around with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how did Emacs look like back in the days? &#xA;Before org-mode, MELPA, magit, most of the languages we know today - did people do anything besides hacking Lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Were there packages that people used that are now completely forgotten?&#xA;How did the &quot;UI&quot; look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And as a last question: is there anything we have today that lives unchanged since the first release of GNU Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be interested to hear from those who used it then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(I tagged terminal-emacs because the question needs at least one tag.)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2016-10-09T09:44:12.550" LastActivityDate="2018-12-09T17:51:21.383" Title="What was Emacs like back in the 80s?" Tags="|terminal-emacs|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27658" PostTypeId="1" CreationDate="2016-10-08T19:09:36.420" Score="1" ViewCount="809" Body="&lt;p&gt;Complete emacs/lisp newbie trying to switch from vim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that emacs indents C# files to 4 spaces, which is normally great, but I'm working on a project that requires 2 space indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been searching and tried a few things, but it's not working for me. Here's my .spacemacs relevant sections:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-setup-indent (n)&#xA;  (message &quot;Setting up indentation!&quot;)&#xA;  ;; java/c++&#xA;  (setq substatement-open 0)&#xA;  (setq c-basic-offset n)&#xA;  (c-set-offset 'substatement-open 0)&#xA;  (setq tab-width n)&#xA;  (setq indent-tabs-mode nil)&#xA;  ;; web dev&#xA;  (setq javascript-indent-level n)&#xA;  (setq js-indent-level n)&#xA;  (setq js2-basic-offset n)&#xA;  (setq web-mode-markup-indent-offset n) ; web-mode, html tag in html file&#xA;  (setq web-mode-css-indent-offset n) ; web-mode, css in html file&#xA;  (setq web-mode-code-indent-offset n) ; web-mode, js code in html file&#xA;  (setq css-indent-offset n) ; css-mode&#xA;  )&#xA;&#xA;(defun dotspacemacs/user-init ()&#xA;  &quot;Initialization function for user code.&#xA;It is called immediately after `dotspacemacs/init', before layer configuration&#xA;executes.&#xA; This function is mostly useful for variables that need to be set&#xA;before packages are loaded. If you are unsure, you should try in setting them in&#xA;`dotspacemacs/user-config' first.&quot;&#xA;  )&#xA;&#xA;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA;This function is called at the very end of Spacemacs initialization after&#xA;layers configuration.&#xA;This is the place where most of your configurations should be done. Unless it is&#xA;explicitly specified that a variable should be set before a package is loaded,&#xA;you should place your code here.&quot;&#xA;  (global-linum-mode) ; Show line numbers by default&#xA;  (my-setup-indent 2) ; indent 2 spaces width&#xA;  )&#xA;&#xA;;; Do not write anything past this comment. This is where Emacs will&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only csharp &quot;layer&quot; I have added is &lt;code&gt;csharp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13579" LastActivityDate="2016-10-08T19:09:36.420" Title="setting csharp mode indentation to 2 spaces" Tags="|indentation|spacemacs|csharp-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27659" PostTypeId="1" CreationDate="2016-10-08T20:55:48.357" Score="2" ViewCount="140" Body="&lt;p&gt;The &lt;code&gt;pp&lt;/code&gt; package is great for pretty-printing Emacs Lisp forms, but can be excruciatingly slow for &quot;large&quot; forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a general rule-of-thumb for determining whether we should &lt;code&gt;pp&lt;/code&gt; a form or not? E.g. if a sequence contains more than X elements, &lt;code&gt;pp&lt;/code&gt; would probably be unbearably slow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what causes the poor performance of &lt;code&gt;pp&lt;/code&gt; for &quot;large&quot; forms; that is, I'm not sure what a good definition of &quot;large&quot; is. Is it length? Depth? Some combination of both? What dominates &lt;code&gt;pp&lt;/code&gt; time?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-10-08T20:55:48.357" Title="To `pp` or not to `pp`?" Tags="|pretty-print|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27661" PostTypeId="2" ParentId="27657" CreationDate="2016-10-08T22:43:06.883" Score="24" Body="&lt;p&gt;Emacs predates GNU Emacs and thus predates Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most of the 80s, Emacs was only what we now call terminal-mode (and only one frame), and there was no mouse, menu-bar, tool-bar, fringe, faces, color, or Customize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest looked and acted about the same as now (for terminal mode). Help mode (e.g. &lt;code&gt;C-h f&lt;/code&gt;) was essentially the same, but with no &lt;code&gt;Back&lt;/code&gt; etc. Info was essentially the same. The minibuffer, windows, echo area, region, isearch, apropos, and query-replace etc. were all essentially the same as now. The use of &lt;code&gt;TAGS&lt;/code&gt; files to jump to a function etc. definition was essentially the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, most of the basic stuff probably lives more or less unchanged, but stuff has been added. Much of the stuff added, at first, was stuff that existed elsewhere in GUIs: mouse, color, separate frames, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The EmacsWiki &lt;a href=&quot;https://www.emacswiki.org/emacs/CategoryHistory&quot;&gt;History&lt;/a&gt; category page can give you more background. Among other info, there you will find a link to an Emacs &lt;a href=&quot;https://www.jwz.org/doc/emacs-timeline.html&quot;&gt;timeline&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-08T22:43:06.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27662" PostTypeId="2" ParentId="27209" CreationDate="2016-10-09T04:56:17.523" Score="1" Body="&lt;p&gt;As a way around it I'm having extra commands written on the line, so that end-of-line isn't reached after executing &lt;code&gt;C-c C-n&lt;/code&gt;: &lt;code&gt;Proof. .&lt;/code&gt;. That extra dot ensures that when &lt;code&gt;Proof.&lt;/code&gt; is executed the cursor still stays on the same line.&lt;/p&gt;&#xA;" OwnerUserId="13582" LastActivityDate="2016-10-09T04:56:17.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27663" PostTypeId="1" AcceptedAnswerId="28461" CreationDate="2016-10-09T06:49:31.957" Score="0" ViewCount="424" Body="&lt;p&gt;I recently started using &lt;strong&gt;org-mode&lt;/strong&gt; to take academic notes, so I use LaTeX blocks (&lt;code&gt;#+BEGIN_LaTeX&lt;/code&gt;) to insert LaTeX code using the special buffer that gives me code completion via &lt;strong&gt;AuCTeX&lt;/strong&gt;. I also insert labels &lt;em&gt;inside&lt;/em&gt; these blocks in order to be able to reference them later. I discovered that &lt;strong&gt;org-ref&lt;/strong&gt; can help me do this easily, but the thing is I want to be able to see a list of labels that I currently have on my file that I can choose from whenever I want to reference an equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;code&gt;C-c C-l&lt;/code&gt; to call &lt;code&gt;org-insert-link&lt;/code&gt; and choose &lt;em&gt;eqref&lt;/em&gt;, I'm not able to see all my labels or get any sort of completion for my labels. When I have a large number of labels, I can't remember what I labeled a particular equation with and so I need some way to keep track of all these labels. Is there a solution for this? &lt;/p&gt;&#xA;" OwnerUserId="13583" LastActivityDate="2016-11-06T04:55:21.550" Title="org-ref completion of labels inside latex blocks" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27664" PostTypeId="1" AcceptedAnswerId="27701" CreationDate="2016-10-09T07:26:41.973" Score="4" ViewCount="156" Body="&lt;p&gt;I'm browsing with &lt;code&gt;erc&lt;/code&gt; to some channels which are mainly used by bot request. Therefore the buffer size will scale up very fast. Since It's a read-only buffer I cannot empty it by hand. Is there a way to tell Emacs to empty a buffer if it reaches a specific size?&lt;/p&gt;&#xA;" OwnerUserId="13585" LastEditorUserId="105" LastEditDate="2016-11-12T02:54:09.643" LastActivityDate="2016-11-12T02:54:09.643" Title="How to empty a buffer before it gets to0 large" Tags="|buffers|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27666" PostTypeId="2" ParentId="27639" CreationDate="2016-10-09T09:17:34.313" Score="1" Body="&lt;p&gt;I also had problems with &lt;code&gt;gdb-many-windows&lt;/code&gt;. My window and buffer setup was always messed after certain events. I decided to rewrite it myself, so I can also customize my window setup better. You have to take a look at the relations between &lt;code&gt;gdb-many-windows&lt;/code&gt;, &lt;code&gt;gdb-restore-windows&lt;/code&gt; and &lt;code&gt;gdb-setup-windows&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you only want to fix your problem with the source file, you should&#xA;look for this snippet &lt;code&gt;(gud-find-file gdb-main-file)&lt;/code&gt;. This is actually responsible for opening your source file. However there seems to be a problem with the code that uses it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far it works for me just fine, though I expect different problems, because I've removed some code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&#xA;I just recognized, that there seems to be a problem with &lt;code&gt;gud-find-file&lt;/code&gt;. However I couldn't fix it yet.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-09T16:17:00.087" LastActivityDate="2016-10-09T16:17:00.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27667" PostTypeId="2" ParentId="23872" CreationDate="2016-10-09T10:09:12.963" Score="1" Body="&lt;p&gt;I find it difficult to understand why would want to export a subheading and not export the heading associated to it. But if you have good reasons for doing so may be you can request this feature on the org-mailing list? The option might be add in future releases?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually to something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some Heading     &#xA;** Not exported     :ignore:noexport:&#xA;   Some stuff.&#xA;** Other not exported heading     :ignore:noexport:&#xA;   More stuff.&#xA;** Exported        :export:&#xA;   Other stuff.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9340" LastActivityDate="2016-10-09T10:09:12.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27668" PostTypeId="1" AcceptedAnswerId="28160" CreationDate="2016-10-09T10:32:27.713" Score="2" ViewCount="475" Body="&lt;p&gt;When running &lt;code&gt;gdb -i=mi&lt;/code&gt;and then attach to the process for debugging, emacs hangs for like 5 minutes before I can type anything. After trial and error I found it is caused by the following line in my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gdb-many-windows t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Start software to debug-&gt;Get Process ID-&gt;Start Emacs-&gt;Start gdb inside Emacs (with many-window)-&gt;Attach to Process-&gt;Set break point-&gt;Continue-&gt;Do things in software GUI to trigger breakpoint-&gt;Emacs show break point hit and hangs for 5 minutes&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The configuration was never changed, and I only start experiencing this problem recently. So is gdb-many-windows really affecting the performance so bad or if there is some thing else possibly, like the version of emacs or debugger?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4).&#xA;GNU gdb (GDB) 7.10.&lt;/p&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="25" LastEditDate="2018-10-17T12:09:05.613" LastActivityDate="2018-10-17T12:09:05.613" Title="gdb-many-windows causes hangs in emacs 24.5" Tags="|debugging|gud|gdb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27669" PostTypeId="1" CreationDate="2016-10-09T11:09:20.323" Score="13" ViewCount="963" Body="&lt;p&gt;Say I have an org-mode document with some block like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC blablabla&#xA;bla1&#xA;bla2&#xA;bla3&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to put the point after, say, &lt;code&gt;bla2&lt;/code&gt;, call some elisp and split the block like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC blablabla&#xA;bla1&#xA;bla2&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC blablabla&#xA;bla3&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does this already exist?&lt;/p&gt;&#xA;" OwnerUserId="8930" LastActivityDate="2016-10-09T12:29:07.553" Title="split org-mode blocks" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27671" PostTypeId="2" ParentId="27669" CreationDate="2016-10-09T12:29:07.553" Score="14" Body="&lt;p&gt;The &lt;code&gt;org-babel-demarcate-block&lt;/code&gt; command does this code block splitting. By default it's bound to &lt;kbd&gt;C-c&lt;/kbd&gt; &lt;kbd&gt;C-v&lt;/kbd&gt; &lt;kbd&gt;C-d&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-10-09T12:29:07.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27672" PostTypeId="1" CreationDate="2016-10-09T13:23:04.530" Score="1" ViewCount="524" Body="&lt;p&gt;Just upgraded to Sierra, and if I try to copy or paste text, nothing goes through. Has anyone else experienced this problem? Any way to debug the prolem? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently Sierra &lt;a href=&quot;https://github.com/tmux/tmux/issues/543&quot; rel=&quot;nofollow&quot;&gt;also broke&lt;/a&gt; copy/paste in Tmux, which relies on &lt;code&gt;pbcopy&lt;/code&gt; and &lt;code&gt;pbpaste&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is with Emacs (25.1.1), which I always install with &lt;code&gt;brew&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --with-cocoa --with-gnutls --with-glib --with-librsvg --with-imagemagick&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6" LastEditorUserId="6" LastEditDate="2016-10-09T13:56:57.350" LastActivityDate="2024-03-30T02:01:40.183" Title="Clipboard sharing broken in OS X Sierra" Tags="|osx|clipboard|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27673" PostTypeId="1" AcceptedAnswerId="27729" CreationDate="2016-10-09T13:43:29.160" Score="0" ViewCount="62" Body="&lt;p&gt;In R it is possible to customise the appearance of a &lt;a href=&quot;https://en.wikipedia.org/wiki/Dendrogram&quot; rel=&quot;nofollow&quot;&gt;dendrogram&lt;/a&gt; and set a custom start character for the last branches. According to the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In some environments, using &lt;code&gt;'&lt;/code&gt; will provide much nicer looking output, than the historical default &lt;code&gt;`&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs ESS does just this and, in &lt;a href=&quot;https://github.com/emacs-ess/ESS/blob/master/lisp/ess-s-l.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ess-s-l.el&lt;/code&gt;&lt;/a&gt;, sets the option &lt;code&gt;str.dendrogram.last&lt;/code&gt; to a single quote. It is a sort of strict requirement, in fact, contrary to the Emacs ESS philosophy (where everything can be customised), this setting is hardcoded in &lt;code&gt;ess-s-l.el&lt;/code&gt; and is difficult to override. Therefore I assume that Emacs is one of those environments where single quotes &lt;em&gt;look much nicer&lt;/em&gt; than backticks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, in my current Windows Emacs version, backticks look perfect and I am going (trying) to get rid of it.&lt;br&gt;&#xA;However I wonder whether there is some situation where backticks might display poorly or it is a problem showed in some old Emacs version.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-12-10T15:25:06.300" Title="ESS dendrograms: appearance of last branch" Tags="|character-encoding|ess|characters|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27674" PostTypeId="1" CreationDate="2016-10-09T13:55:50.973" Score="2" ViewCount="1196" Body="&lt;p&gt;How can I modify (or replace) &lt;code&gt;elpy-shell-send-region-or-buffer&lt;/code&gt; (bound to &lt;code&gt;C-c C-c&lt;/code&gt;) to behave like &lt;code&gt;ess-eval-region-or-function-or-paragraph-and-step&lt;/code&gt;, i.e.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if region is active, evaluate it (this currently works), goto 4.&lt;/li&gt;&#xA;&lt;li&gt;if inside a function, evaluate it, goto 4.&lt;/li&gt;&#xA;&lt;li&gt;evaluate current paragraph&lt;/li&gt;&#xA;&lt;li&gt;Jump to the beginning of next paragraph&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2017-08-19T19:50:57.157" Title="Make elpy-shell-send more intelligent" Tags="|python|elpy|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27675" PostTypeId="1" AcceptedAnswerId="27680" CreationDate="2016-10-09T13:56:42.210" Score="9" ViewCount="562" Body="&lt;p&gt;When you trigger minibuffer completion for a partial command/filename/etc., the *Completions* buffer lists possible completions aligned vertically (in columns) but &lt;em&gt;sorted&lt;/em&gt; horizontally.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;../                ./                   ajax-proj/         algorithms/&#xA;angular-phone/     angular/             annex/             archives/&#xA;blog-ideas/        clojure-koans/       ctags58/           diff-tryout/&#xA;encodings/         filters/             game-table/        git-grounds/&#xA;hartl/             invoice_angel/       jQuery-basics/     java/&#xA;making/            ng-fundamentals/     node-meetup/       pickaxe/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I find this much more difficult to scan than if they were sorted vertically, like Bash does.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;../                annex/               encodings/         jQuery-basics/&#xA;./                 archives/            filters/           java/&#xA;ajax-proj/         blog-ideas/          game-table/        making/&#xA;algorithms/        clojure-koans/       git-grounds/       ng-fundamentals/&#xA;angular-phone/     ctags58/             hartl/             node-meetup/&#xA;angular/           diff-tryout/         invoice_angel/     pickaxe/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a setting that controls this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-10-09T14:03:58.310" LastActivityDate="2016-10-09T17:14:10.940" Title="Change *Completions* list to sort vertically?" Tags="|completion|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27676" PostTypeId="2" ParentId="27675" CreationDate="2016-10-09T14:58:08.587" Score="1" Body="&lt;p&gt;You can easily do this if you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; - see &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Completions_Display#VerticalLayout&quot; rel=&quot;nofollow&quot;&gt;Vertical Layout&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can make this the default behavior by customizing option &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#icicle-completions-format&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-completions-format&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to have the value &lt;code&gt;vertical&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can toggle between horizontal and vertical layout anytime during completion, using &lt;strong&gt;&lt;code&gt;C-M-^&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This affects &lt;em&gt;all&lt;/em&gt; minibuffer completion, whether by &lt;code&gt;completing-read&lt;/code&gt; or &lt;code&gt;read-file-name&lt;/code&gt; (or anything else that uses these).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-09T14:58:08.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27677" PostTypeId="1" CreationDate="2016-10-09T15:29:41.493" Score="4" ViewCount="87" Body="&lt;p&gt;I have multiple IMAP and NNTP servers configured in Gnus, mostly over&#xA;SSL using the integrated GnuTLS. When I put my laptop into&#xA;suspend-to-RAM for a while, the TCP connections will obviously drop&#xA;eventually, but Gnus doesn't recognize this, so pressing 'g' after&#xA;the system wake-up will cause Gnus to hang while waiting for the TCP&#xA;connections to respond. I usually resolve that by restarting Gnus&#xA;with &lt;code&gt;C-g&lt;/code&gt; and &lt;code&gt;R&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for Gnus to quickly detect dropped TCP connections&#xA;and transparently reconnect when I try to update the group list?&lt;/p&gt;&#xA;" OwnerUserId="13551" LastActivityDate="2016-10-09T15:29:41.493" Title="Transparently reconnect to servers after a system suspend" Tags="|gnus|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27678" PostTypeId="1" AcceptedAnswerId="27769" CreationDate="2016-10-09T15:49:20.677" Score="2" ViewCount="38" Body="&lt;p&gt;Using &lt;code&gt;org-org-export-to-org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :style max-width:60%;&#xA;[[file:data/fool_f7dc.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is exported as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:data/fool_f7dc.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to keep the line &lt;code&gt;#+ATTR_HTML: :style max-width:60%;&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thx!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tried suggestion solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_export org&#xA;#+ATTR_HTML: :style max-width:60%;&#xA;[[file:data/fool_f7dc.png]]&#xA;#+end_export&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But does not work since &lt;code&gt;org-org-export-to-org&lt;/code&gt; returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_export&#xA;[[file:data/fool_f7dc.png]]&#xA;#+END_export&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13592" LastEditorUserId="13592" LastEditDate="2016-10-13T00:18:48.580" LastActivityDate="2016-10-13T00:20:30.313" Title="How not to remove other back-ends specific contents using org-org-export-to-org?" Tags="|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27679" PostTypeId="1" CreationDate="2016-10-09T15:54:55.807" Score="5" ViewCount="378" Body="&lt;p&gt;I often find myself writing ReST files with embedded source code examples (e.g. in &lt;code&gt;.. code::&lt;/code&gt; blocks or GFM-style triple-backticks; usually the embedded source code is Python). And this is always an exercise in frustration, because ReST mode has opinions about things like how text should be indented and where my cursor should go when I hit enter, and these are totally wrong for source code. So I find myself not only having to indent my code by hand (like an &lt;em&gt;animal&lt;/em&gt;), but actively fighting against emacs to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping someone out there has found something, anything, that makes writing these kinds of documents less painful. Exiling source code snippets to external files sometimes helps, but it's not well-supported by all ReST processors and for short snippets often isn't worth the hassle. Possibly the gold standard would be an equivalent to org-mode's excellent org-edit-special (which pops out a source code block into its own buffer to edit in the proper major mode, while synchronizing changes back to the original buffer), but I'm not picky...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If there's a markdown mode that handles this better I'd also be interested in that -- I don't always get a choice between rst and md, but in cases when I do then this could be a compelling differentiator.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you do?&lt;/p&gt;&#xA;" OwnerUserId="13591" LastActivityDate="2017-03-07T08:35:13.483" Title="Ergonomic way to edit source code inside ReST or Markdown code blocks?" Tags="|multiple-modes|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27680" PostTypeId="2" ParentId="27675" CreationDate="2016-10-09T17:14:10.940" Score="8" Body="&lt;p&gt;There is the variable &lt;code&gt;completions-format&lt;/code&gt; (since Emacs 23.2). Just set it to &lt;code&gt;'vertical&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-10-09T17:14:10.940" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27681" PostTypeId="2" ParentId="27580" CreationDate="2016-10-09T17:52:35.440" Score="3" Body="&lt;p&gt;Here's the complete end-to-end solution I ended up with based on lawlist's answer.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my:color-is-closer-to-white-p (color)&#xA;  &quot;Returns t if COLOR is closer to white than black.&quot;&#xA;  (&amp;lt; (color-distance color &quot;white&quot;) (color-distance color &quot;black&quot;)))&#xA;&#xA;(defun my:get-subtle-color-from-background (percent-difference)&#xA;  &quot;Gets a shade PERCENT-DIFFERENCE from the current background color.&#xA;If the color is closer to white, multiply percent-difference by 2&#xA;so it's easier to see.&quot;&#xA;  (let* ((current-background-color (face-background 'default)))&#xA;    (if (my:color-is-closer-to-white-p current-background-color)&#xA;        (color-darken-name current-background-color (* 2 percent-difference))&#xA;      (color-lighten-name current-background-color percent-difference))))&#xA;&#xA;(defun my:change-fci-color (&amp;amp;rest args)&#xA;  &quot;Change the fill-column-indicator based on the background.&#xA;ARGS is only used because we use this function as advice after&#xA;`load-theme'.&quot;&#xA;  (setq fci-rule-color (my:get-subtle-color-from-background 10))&#xA;  (let* ((wins (window-list (selected-frame) 'no-minibuf))&#xA;        (bufs (delete-dups (mapcar #'window-buffer wins))))&#xA;    (dolist (buf bufs)&#xA;      (with-current-buffer buf&#xA;        (when fci-mode&#xA;          (fci-make-overlay-strings)&#xA;          (fci-update-all-windows t))))))&#xA;&#xA;(advice-add 'load-theme :after 'my:change-fci-color)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-10-09T17:52:35.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27682" PostTypeId="1" CreationDate="2016-10-09T18:58:35.117" Score="2" ViewCount="47" Body="&lt;p&gt;Whitespace traversal in Emacs is atrocious. By &quot;traversal&quot; I mean:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Moving the point with &lt;code&gt;C-&amp;lt;direction&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Expanding a selection (with either a package or region mark)&lt;/li&gt;&#xA;&lt;li&gt;Deleting with &lt;code&gt;C-&lt;/code&gt; or &lt;code&gt;M-&lt;/code&gt; &lt;code&gt;backspace&lt;/code&gt; or &lt;code&gt;delete&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It trips over punctuation, deletes the next word when deleting whitespace ahead of point, and leaps from paragraph to space to maybe the next paragraph, if there aren't an odd number of spaces, and Mercury is not in retrograde.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;believe&lt;/em&gt; (without having inspected the related code) that the core issue is the way Emacs handles the traversal of the point over whitespace (since marking regions, deleting, and traversing are so related).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone taken a wrench to this and produced an improved configuration or package?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to keep this question actionable, I am specifically looking for a configuration that allows the user to delete usually contiguous chunks of whitespace, text, or a mix of those efficiently and accurately, without an unreasonable amount of new commands and shortcuts. You know, like those &quot;other&quot; text editors do.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2016-10-09T21:55:06.567" LastActivityDate="2016-10-09T21:55:06.567" Title="Are there any packages or configuration snippets for better whitespace traversal?" Tags="|region|whitespace|point|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27683" PostTypeId="1" AcceptedAnswerId="27714" CreationDate="2016-10-09T19:36:47.793" Score="8" ViewCount="1502" Body="&lt;p&gt;I am using web-mode 20161003.1327&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment when I comment  a region in web-mode, it comments like this;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* import chai from 'chai';&#xA; * import 'babel-polyfill';&#xA; * import configureMockStore from 'redux-mock-store';&#xA; * import thunk from 'redux-thunk';&#xA; * import * as ActionTypes from '../actions/ForecastActions';&#xA; * &#xA; * const expect = chai.expect;&#xA; * &#xA; * const middlewares = [ thunk ];&#xA; * const mockStore = configureMockStore(middlewares);&#xA; * &#xA; * /&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is not good for uncommenting only a section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I change the commenting to use double forward slash?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using &lt;code&gt;(setq web-mode-comment-style 2)&lt;/code&gt; but this appears to do nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried &lt;code&gt;web-mode-comment-formats&lt;/code&gt; but it also does not appear to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'web-mode)&#xA;&#xA;(add-to-list 'web-mode-comment-formats '(&quot;javascript&quot; . &quot;//&quot;))&#xA;&#xA;(defun my-web-mode-hook ()&#xA;  &quot;web-mode settings&quot;&#xA;  (setq web-mode-markup-indent-offset 2)&#xA;  (setq web-mode-css-indent-offset 2)&#xA;  (setq web-mode-code-indent-offset 2))&#xA;&#xA;(add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.html?\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.js?$&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13577" LastEditorUserId="13577" LastEditDate="2016-10-10T18:52:52.917" LastActivityDate="2023-04-25T10:14:45.593" Title="Change comment style in web-mode" Tags="|web-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27685" PostTypeId="2" ParentId="24039" CreationDate="2016-10-09T22:18:47.037" Score="1" Body="&lt;p&gt;Here's my solution, that doesn't involve modifying the Emacs source. I copy the definition of &lt;code&gt;serial-term&lt;/code&gt; from &lt;code&gt;term.el&lt;/code&gt; and provide a process filter that inserts &lt;code&gt;\r&lt;/code&gt; before any &lt;code&gt;\n&lt;/code&gt; before passing the output to the &lt;code&gt;term-mode&lt;/code&gt; process filter.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun replace-all (string to-find to-replace)&#xA;  (let ((index  (cl-search to-find string))&#xA;        (pos    0)&#xA;        (result &quot;&quot;))&#xA;    (while index&#xA;      (setq result (concat result&#xA;                           (substring string pos index)&#xA;                           to-replace)&#xA;            pos    (+ index (length to-find))&#xA;            index  (cl-search to-find string :start2 pos)))&#xA;    (concat result (substring string pos))))&#xA;&#xA;(defun rephone-serial-process-filter (process output)&#xA;  &quot;Replace LF in output string with CR+LF.&quot;&#xA;  (term-emulate-terminal process&#xA;                         (replace-all output&#xA;                                      (byte-to-string ?\n)&#xA;                                      (string ?\r ?\n))))&#xA;&#xA;(defun rephone-serial-term (port)&#xA;  &quot;Basically duplicate SERIAL-TERM from term.el but with process&#xA;  filtering to translate LF to CR+LF.&quot;&#xA;  (interactive (list (serial-read-name)))&#xA;  (serial-supported-or-barf)&#xA;  (let* ((process (make-serial-process&#xA;                   :port port&#xA;                   :speed 115200&#xA;                   :bytesize 8&#xA;                   :parity nil&#xA;                   :stopbits 1&#xA;                   :flowcontrol nil&#xA;                   :coding 'raw-text-unix&#xA;                   :noquery t&#xA;                   :name (format &quot;Lua:%s&quot; port)&#xA;                   :filter 'rephone-serial-process-filter&#xA;                   :sentinel 'term-sentinel))&#xA;         (buffer (process-buffer process)))&#xA;    (with-current-buffer buffer&#xA;      (term-mode)&#xA;      (term-line-mode)&#xA;      (goto-char (point-max))&#xA;      (set-marker (process-mark process) (point)))&#xA;    (switch-to-buffer buffer)&#xA;    buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9437" LastEditorUserId="675" LastEditDate="2016-10-10T00:23:20.110" LastActivityDate="2016-10-10T00:23:20.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27686" PostTypeId="2" ParentId="27678" CreationDate="2016-10-10T04:26:32.097" Score="1" Body="&lt;p&gt;An export block would be an option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_export org&#xA;#+ATTR_HTML: :style max-width:60%;&#xA;[[file:data/fool_f7dc.png]]&#xA;#+end_export&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-10-10T04:26:32.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27687" PostTypeId="2" ParentId="21842" CreationDate="2016-10-10T07:00:51.397" Score="3" Body="&lt;p&gt;You can set the below variable in your .emacs to avoid the confirmation message.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq neo-force-change-root t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13597" LastActivityDate="2016-10-10T07:00:51.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27688" PostTypeId="1" CreationDate="2016-10-10T08:39:28.040" Score="2" ViewCount="714" Body="&lt;p&gt;See excerpt below for code used in emacs Cadence SKILL mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cons (concat &quot;\\&amp;lt;&quot; (regexp-opt '(&quot;nil&quot; &quot;t&quot;) t)  &quot;\\&amp;gt;&quot;)  'font-lock-constant-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it does a brilliant job at highlighting nil and t.&lt;br&gt;The issue is that if I have the string &quot; nil_finder &quot; anywhere  within the code, it would highlight the part of the word which is &quot;nil&quot;, and keep the _finder not highlighted. I want none of the &quot; nil_finder &quot; highlighted.&lt;br&gt;&#xA;I have tried replacing the &lt;code&gt;t&lt;/code&gt; with &lt;code&gt;'symbols&lt;/code&gt; or with &lt;code&gt;'words&lt;/code&gt;, and it did not work.&lt;br&gt; I can generate my own (many/ 1 huge) regular expression(s) to get the behavior that I need, but I read the regexp-opt returns a much more efficient regexp.&lt;br&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13534" LastActivityDate="2017-08-24T05:51:47.787" Title="How can I get regexp-opt (or similar) not apply on the word with added underscore?" Tags="|regular-expressions|syntax-highlighting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27689" PostTypeId="2" ParentId="27688" CreationDate="2016-10-10T08:50:19.000" Score="3" Body="&lt;p&gt;&lt;code&gt;\&amp;lt;&lt;/code&gt; and &lt;code&gt;\&amp;gt;&lt;/code&gt; match &lt;em&gt;word&lt;/em&gt; boundaries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming &lt;code&gt;_&lt;/code&gt; is a symbol-constituent character in the buffer in question, you want to use &lt;code&gt;\_&amp;lt;&lt;/code&gt; and &lt;code&gt;\_&amp;gt;&lt;/code&gt; to match the beginning and end of the &lt;em&gt;symbol&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Regexp Backslash&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;rx&lt;/code&gt; syntax, these are &lt;code&gt;symbol-start&lt;/code&gt; and &lt;code&gt;symbol-end&lt;/code&gt; respectively.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-10-10T09:05:30.403" LastActivityDate="2016-10-10T09:05:30.403" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27690" PostTypeId="2" ParentId="27674" CreationDate="2016-10-10T09:43:35.860" Score="1" Body="&lt;p&gt;&lt;code&gt;elpy-shell-send-region-or-buffer&lt;/code&gt; is meant only to send entire buffer or a region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to step through code, you should use &lt;code&gt;elpy-shell-send-current-statement&lt;/code&gt;, which is bound to &lt;code&gt;C-ENTER&lt;/code&gt;. This function sends current statement to Python shell and advances to next. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to send entire function, you have to use &lt;code&gt;python-shell-send-defun&lt;/code&gt; which is bound to &lt;code&gt;C-M-x&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2016-10-10T09:43:35.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27691" PostTypeId="1" AcceptedAnswerId="27697" CreationDate="2016-10-10T10:05:47.977" Score="4" ViewCount="1617" Body="&lt;p&gt;Currently my images are exported with &lt;code&gt;org-html-publish-to-html&lt;/code&gt;, and they end up as inlined &lt;code&gt;&amp;lt;img src=''/&amp;gt;&lt;/code&gt;. I want them inside figures, so I'm working around this my problem by injecting the following in my org document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_HTML&#xA;&amp;lt;figure&amp;gt;&#xA;&amp;lt;img src=&quot;./the_image_path.png&quot;/&amp;gt;&#xA;&amp;lt;figcaption style=&quot;font-size:0.8em&quot;&amp;gt;This is a caption.&amp;lt;/figcaption&amp;gt;&#xA;&amp;lt;/figure&amp;gt;&#xA;#+END_HTML&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This solution isn't ideal, since I may want to generate images on the fly with org-babel, and I'll want to target them with CSS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell org-mode to export links to images as figures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out setting the following on my project-alist does the trick.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     :html-html5-fancy t&#xA;     :html-doctype &quot;html5&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the output is still messed up because org-mode adds an unnecessary p tag to the image:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;figure&amp;gt;&#xA;&amp;lt;p&amp;gt;&amp;lt;img src=&quot;../media/dog.jpg&quot; alt=&quot;dog.jpg&quot; width=&quot;60%&quot;&amp;gt;&#xA;&amp;lt;/p&amp;gt;&#xA;&amp;lt;figcaption&amp;gt;&amp;lt;span class=&quot;figure-number&quot;&amp;gt;Figure 1:&amp;lt;/span&amp;gt; This is a dog.&amp;lt;/figcaption&amp;gt;&#xA;&amp;lt;/figure&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The culprit is the following function from ox-html. Note the suspicious &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-html--wrap-image (contents info &amp;amp;optional caption label)&#xA;  &quot;Wrap CONTENTS string within an appropriate environment for images.&#xA;INFO is a plist used as a communication channel.  When optional&#xA;arguments CAPTION and LABEL are given, use them for caption and&#xA;\&quot;id\&quot; attribute.&quot;&#xA;  (let ((html5-fancy (org-html--html5-fancy-p info)))&#xA;    (format (if html5-fancy &quot;\n&amp;lt;figure%s&amp;gt;%s%s\n&amp;lt;/figure&amp;gt;&quot;&#xA;          &quot;\n&amp;lt;div%s class=\&quot;figure\&quot;&amp;gt;%s%s\n&amp;lt;/div&amp;gt;&quot;)&#xA;        ;; ID.&#xA;        (if (org-string-nw-p label) (format &quot; id=\&quot;%s\&quot;&quot; label) &quot;&quot;)&#xA;        ;; Contents.&#xA;        (format &quot;\n&amp;lt;p&amp;gt;%s&amp;lt;/p&amp;gt;&quot; contents)&#xA;        ;; Caption.&#xA;        (if (not (org-string-nw-p caption)) &quot;&quot;&#xA;          (format (if html5-fancy &quot;\n&amp;lt;figcaption&amp;gt;%s&amp;lt;/figcaption&amp;gt;&quot;&#xA;            &quot;\n&amp;lt;p&amp;gt;%s&amp;lt;/p&amp;gt;&quot;)&#xA;              caption)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I redefine the function on my &lt;code&gt;web-config.el&lt;/code&gt; and remove the &lt;p&gt; tags, and everything works ok. But is there a better way to do it? Perhaps with an advice?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2016-10-10T14:04:16.707" LastActivityDate="2016-10-10T15:29:51.157" Title="org-mode export images to html as figures, not img" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27692" PostTypeId="1" CreationDate="2016-10-10T13:56:49.450" Score="7" ViewCount="4867" Body="&lt;p&gt;Following are the list of default options for &lt;code&gt;Reveal.js&lt;/code&gt;, which I got when I did &lt;code&gt;C-c C-e #&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;#+OPTIONS: reveal_control:t reveal_height:-1&#xA;#+OPTIONS: reveal_history:nil reveal_keyboard:t reveal_overview:t&#xA;#+OPTIONS: reveal_progress:t reveal_rolling_links:nil&#xA;#+OPTIONS: reveal_single_file:nil reveal_slide_number:&quot;c&quot;&#xA;#+OPTIONS: reveal_title_slide:auto reveal_width:-1&#xA;#+REVEAL_MARGIN: -1&#xA;#+REVEAL_MIN_SCALE: -1&#xA;#+REVEAL_MAX_SCALE: -1&#xA;#+REVEAL_ROOT: file:///C:\Users\nd04805\Documents\99 EMACS\work\PPT\reveal.js&#xA;#+REVEAL_TRANS: none&#xA;#+REVEAL_SPEED: default&#xA;#+REVEAL_THEME: moon&#xA;#+REVEAL_EXTRA_CSS:&#xA;#+REVEAL_EXTRA_JS:&#xA;#+REVEAL_HLEVEL:&#xA;#+REVEAL_TITLE_SLIDE_BACKGROUND:&#xA;#+REVEAL_TITLE_SLIDE_BACKGROUND_SIZE:&#xA;#+REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT:&#xA;#+REVEAL_TITLE_SLIDE_BACKGROUND_TRANSITION:&#xA;#+REVEAL_MATHJAX_URL: https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&#xA;#+REVEAL_PREAMBLE:&#xA;#+REVEAL_HEAD_PREAMBLE:&#xA;#+REVEAL_POSTAMBLE:&#xA;#+REVEAL_MULTIPLEX_ID:&#xA;#+REVEAL_MULTIPLEX_SECRET:&#xA;#+REVEAL_MULTIPLEX_URL:&#xA;#+REVEAL_MULTIPLEX_SOCKETIO_URL:&#xA;#+REVEAL_SLIDE_HEADER: &#xA;#+REVEAL_SLIDE_FOOTER:Process Automation&#xA;#+REVEAL_PLUGINS:&#xA;#+REVEAL_DEFAULT_FRAG_STYLE:&#xA;#+REVEAL_INIT_SCRIPT:&#xA;#+REVEAL_HIGHLIGHT_CSS: %r/lib/css/zenburn.css&#xA;&lt;/pre&gt;  &#xA;&#xA;&lt;p&gt;I could edit a few of them to get some fancy slide show set up.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following things what I'm looking for (which are rather basic) could not be found.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1. How to set the title/author_name/email_address?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried using the &lt;code&gt;#+TITLE&lt;/code&gt; &lt;code&gt;#+AUTHOR&lt;/code&gt; - but could not get it to work. &lt;a href=&quot;http://orgmode.org/manual/Document-title.html#Document-title&quot; rel=&quot;noreferrer&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. How to align text (at least left align)?&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried deleting &lt;code&gt;reveal_center:t&lt;/code&gt; from the template - but no use  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html#Export-settings&quot; rel=&quot;noreferrer&quot;&gt;Section 12.3&lt;/a&gt; of Org manual as reference, but failing somehow to see it through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any pointers to lead me to the right direction would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-10-10T22:31:35.567" Title="How to format a presentation in ox-reveal / Reveal.js export in Org mode" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27693" PostTypeId="2" ParentId="18265" CreationDate="2016-10-10T14:28:02.257" Score="0" Body="&lt;pre&gt;&lt;code&gt;import os; os.chdir('/path/to/dir');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get know current working directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import os; os.getcwd();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-10-10T15:08:34.183" LastActivityDate="2016-10-10T15:08:34.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27694" PostTypeId="1" CreationDate="2016-10-10T14:38:34.530" Score="2" ViewCount="104" Body="&lt;p&gt;This is a follow-up question from a &lt;a href=&quot;https://emacs.stackexchange.com/questions/27691/org-mode-export-images-to-html-as-figures-not-img&quot;&gt;previous thread&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;org-html--wrap-image&lt;/code&gt; adds a &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag around its contents, as you can see here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (org-html--wrap-image &quot;bla&quot; t)&#xA;&quot;\n&amp;lt;div class=\&quot;figure\&quot;&amp;gt;\n&amp;lt;p&amp;gt;bla&amp;lt;/p&amp;gt;\n&amp;lt;/div&amp;gt;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to remove those &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags around &quot;bla&quot;. My current workaround consists of redefining the function &lt;code&gt;org-html--wrap-image&lt;/code&gt; completely, removing the tags, but this seems to be a bit of an overkill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I acknowledge that if I wrap the function with a call to &lt;code&gt;replace-regexp-in-string&lt;/code&gt;, I can achieve the same effect. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (replace-regexp-in-string&#xA;        (rx (or &quot;&amp;lt;p&amp;gt;&quot; &quot;&amp;lt;/p&amp;gt;&quot;))&#xA;        &quot;&quot;&#xA;        (org-html--wrap-image &quot;bla&quot; t))&#xA;&#xA;&quot;\n&amp;lt;div class=\&quot;figure\&quot;&amp;gt;\nbla\n&amp;lt;/div&amp;gt;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I write an &quot;advice&quot; to do that? I've never written one before, and the documentation for &quot;advices&quot; is kind of harsh on Elisp beginners.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completeness, here's the function code:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-html--wrap-image (contents info &amp;amp;optional caption label)&#xA;  &quot;Wrap CONTENTS string within an appropriate environment for images.&#xA;INFO is a plist used as a communication channel.  When optional&#xA;arguments CAPTION and LABEL are given, use them for caption and&#xA;\&quot;id\&quot; attribute.&quot;&#xA;  (let ((html5-fancy (org-html--html5-fancy-p info)))&#xA;    (format (if html5-fancy &quot;\n&amp;lt;figure%s&amp;gt;%s%s\n&amp;lt;/figure&amp;gt;&quot;&#xA;          &quot;\n&amp;lt;div%s class=\&quot;figure\&quot;&amp;gt;%s%s\n&amp;lt;/div&amp;gt;&quot;)&#xA;        ;; ID.&#xA;        (if (org-string-nw-p label) (format &quot; id=\&quot;%s\&quot;&quot; label) &quot;&quot;)&#xA;        ;; Contents.&#xA;        (format &quot;\n&amp;lt;p&amp;gt;%s&amp;lt;/p&amp;gt;&quot; contents)&#xA;        ;; Caption.&#xA;        (if (not (org-string-nw-p caption)) &quot;&quot;&#xA;          (format (if html5-fancy &quot;\n&amp;lt;figcaption&amp;gt;%s&amp;lt;/figcaption&amp;gt;&quot;&#xA;            &quot;\n&amp;lt;p&amp;gt;%s&amp;lt;/p&amp;gt;&quot;)&#xA;              caption)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2018-02-03T13:32:27.197" Title="Constructing an advice around org-html--wrap-image" Tags="|org-export|regular-expressions|advice|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27695" PostTypeId="2" ParentId="27679" CreationDate="2016-10-10T14:49:55.343" Score="3" Body="&lt;p&gt;I think &lt;a href=&quot;https://github.com/vspinu/polymode&quot; rel=&quot;nofollow noreferrer&quot;&gt;polymode&lt;/a&gt; can provide some help for this. By itself, &lt;code&gt;polymode&lt;/code&gt; is&#xA;framework for combining multiple major modes in a systematic way. Among the the&#xA;examples, there is a &lt;code&gt;polymode&lt;/code&gt; available that creates a new major mode based on&#xA;&lt;code&gt;markdown-mode&lt;/code&gt; that can display &lt;em&gt;any&lt;/em&gt; other major-mode recognized by Emacs. The&#xA;example can be seen &lt;a href=&quot;https://github.com/vspinu/polymode/blob/master/modes/poly-markdown.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and is installed with &lt;code&gt;polymode&lt;/code&gt; by default from&#xA;Melpa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some caveats though, &lt;code&gt;polymode&lt;/code&gt; needs to figure out which major-mode somehow and thus the name must match the major mode used by Emacs. E.g., instead of writing &lt;code&gt;shell&lt;/code&gt;,&#xA;you have to write &lt;code&gt;sh-script&lt;/code&gt;. See the samples folder on &lt;a href=&quot;https://github.com/vspinu/polymode&quot; rel=&quot;nofollow noreferrer&quot;&gt;polymode&lt;/a&gt; for an some examples of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is probably possible to fix that however by using some kind of look-up&#xA;function, but that would require non-trivial changes. Furthermore, I believe it&#xA;would be possible to create a &lt;code&gt;ReST&lt;/code&gt; &lt;code&gt;polymode&lt;/code&gt; in a similar fashion, but that&#xA;would probably require a significant amount of hacking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The configuration I ended up using for getting all of this to work is this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package polymode&#xA;  :ensure t&#xA;  :defer t)&#xA;&#xA;(use-package poly-markdown&#xA;  :ensure polymode&#xA;  :defer t&#xA;  :mode (&quot;\\.md&quot; . poly-markdown-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A word of warning though: It is important to know that mixing major-modes can&#xA;cause a wide variety of issues. Usually, this means that font-locking or&#xA;indenting can start to behave strangely, or the performance might degrade&#xA;significantly. Personally though, I haven't run into any issues yet but then&#xA;again, I haven't worked with any really large markdown files either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After getting slightly bored at work, I actually implemented the ReST equivalent to the &lt;code&gt;poly-markdown-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; poly-rest-mode.el -- Polymode for ReST. -*- lexical-binding: t -*-&#xA;;;&#xA;;;; Commentary:&#xA;;; A mode for interacting with multiple kinds of code inside a ReST host-mode.&#xA;;;&#xA;;;; Code:&#xA;&#xA;(require 'polymode)&#xA;&#xA;&#xA;(defcustom pm-host/ReST&#xA;  (pm-bchunkmode &quot;ReST&quot;&#xA;                 :mode 'rst-mode&#xA;                 :init-functions '(poly-rest-fixes))&#xA;  &quot;Restructued Text host chunkmode.&quot;&#xA;  :group 'hostmodes&#xA;  :type 'object)&#xA;&#xA;(defvar pm-ReST-code-regexp&#xA;  (regexp-opt '(&quot;code&quot; &quot;code-block&quot; &quot;sourcecode&quot; &quot;highlight&quot;))&#xA;  &quot;Regular expression to match all possible ReST code blocks.&quot;)&#xA;&#xA;(defvar pm-ReST-head-regexp&#xA;  (concat &quot;^[^ ]*\\( *\.\. +&quot; pm-ReST-code-regexp &quot;::.*\n&quot;&#xA;          &quot;\\(?: +:.+\n\\)*\\)&quot;)      ;; Match 0 or more option lines.&#xA;  &quot;Regular expression to match the `head' of a ReST code block.&quot;)&#xA;&#xA;(defvar pm-ReST-retriever-regexp&#xA;  (concat &quot;^[^ ]*\\(?: *\.\. +&quot; pm-ReST-code-regexp &quot;:: \\(.+\\)\\)$&quot;)&#xA;  &quot;Regular expression to retrieve the mode of the code block.&quot;)&#xA;&#xA;(pm-create-indented-block-matchers &quot;ReST&quot; pm-ReST-head-regexp)&#xA;&#xA;(defcustom pm-inner/ReST-code&#xA;  (pm-hbtchunkmode-auto &quot;ReST&quot;&#xA;                        :head-reg #'pm-ReST-head-matcher&#xA;                        :tail-reg #'pm-ReST-tail-matcher&#xA;                        :head-mode 'host&#xA;                        :tail-mode 'host&#xA;                        :retriever-regexp pm-ReST-retriever-regexp&#xA;                        :font-lock-narrow t)&#xA;  &quot;Restructured Text inner code block mode.&quot;&#xA;  :group 'innermodes&#xA;  :type 'object)&#xA;&#xA;&#xA;(defcustom pm-poly/ReST&#xA;  (pm-polymode-multi-auto &quot;ReST&quot;&#xA;                          :hostmode 'pm-host/ReST&#xA;                          :auto-innermode 'pm-inner/ReST-code)&#xA;  &quot;Restructured Text typical `polymode' configuration.&quot;&#xA;  :group 'polymodes&#xA;  :type 'object)&#xA;&#xA;&#xA;;;;###autoload (autoload #'poly-rest-mode &quot;poly-rest-mode&quot;)&#xA;(define-polymode poly-rest-mode pm-poly/ReST)&#xA;&#xA;&#xA;(defun poly-rest-fixes ()&#xA;  &quot;Fix various minor issues that can occur in the poly-ReST-mode.&quot;&#xA;  (remove-hook 'prog-mode-hook   #'whitespace-mode)&#xA;  (remove-hook 'python-mode-hook #'mmm-mode))&#xA;&#xA;(provide 'poly-rest-mode)&#xA;&#xA;;;; poly-rest-mode.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, it is likely that I've missed some detail where this doesn't work perfectly, I'm simply not familiar enough with ReST to tell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It &lt;em&gt;does&lt;/em&gt; seem to work fairly well on a rather complete example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vfkXp.gif&quot; alt=&quot;poly-rest-mode in action&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concerns mentioned in the comments regarding nested indentations have been fixed in the above code snippet.&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2653" LastEditDate="2017-03-07T08:35:13.483" LastActivityDate="2017-03-07T08:35:13.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27696" PostTypeId="1" CreationDate="2016-10-10T15:11:11.940" Score="1" ViewCount="154" Body="&lt;p&gt;I often find myself in the situation where ReST-mode has correctly identified that my last line can be followed by an idented line, but I want to continue on the next higher level of indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I make backspace (or C-backspace or whatever) delete a single level of indentation when on a line with only whitespace before the cursor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, from (█ is the cursor)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.. toctree::&#xA;   :maxdepth: 2&#xA;              █&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to get to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.. toctree::&#xA;   :maxdepth: 2&#xA;   █&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;by pressing backspace once. The 11 spaces should be deleted. What do I need to do? I know python-mode has functionality like this.&lt;/p&gt;&#xA;" OwnerUserId="2702" LastActivityDate="2016-10-10T15:11:11.940" Title="Make backspace(+?) remove a level of indentation in ReST mode" Tags="|key-bindings|indentation|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27697" PostTypeId="2" ParentId="27691" CreationDate="2016-10-10T15:29:51.157" Score="3" Body="&lt;p&gt;The relevant variables are&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-html-html5-fancy t&#xA;      org-html-doctype &quot;html5&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To publish the document with &lt;code&gt;org-html-publish-to-html&lt;/code&gt; you can also use the &lt;code&gt;:html-doctype&lt;/code&gt; and &lt;code&gt;:html-html5-fancy&lt;/code&gt; keys in the plist argument (or in your &lt;code&gt;org-publish-project-alist&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-10-10T15:29:51.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27698" PostTypeId="1" AcceptedAnswerId="27699" CreationDate="2016-10-10T16:56:15.250" Score="5" ViewCount="4739" Body="&lt;p&gt;I use Spacemacs, and for some time I've rebound &lt;kbd&gt;C-v&lt;/kbd&gt; and &lt;kbd&gt;M-v&lt;/kbd&gt; to &lt;code&gt;spacemacs/scroll-half-page-down&lt;/code&gt; and &lt;code&gt;spacemacs/scroll-half-page-up&lt;/code&gt;, respectively, to aid my understanding of the buffer as I move through it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a recent update, though, these functions seem to no longer be defined. How can I get them back, or something reasonably similar?&lt;/p&gt;&#xA;" OwnerUserId="10604" LastActivityDate="2021-04-15T13:02:11.327" Title="How can I scroll a half page on C-v and M-v?" Tags="|spacemacs|scrolling|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27699" PostTypeId="2" ParentId="27698" CreationDate="2016-10-10T17:13:26.700" Score="9" Body="&lt;p&gt;I actually managed to find the equivalent functions. They are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;View-scroll-half-page-forward&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;View-scroll-half-page-backward&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, I've updated my dotfile's user-config section to contain&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-v&quot;) 'View-scroll-half-page-forward)&#xA;(global-set-key (kbd &quot;M-v&quot;) 'View-scroll-half-page-backward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this seems to work fine!&lt;/p&gt;&#xA;" OwnerUserId="10604" LastActivityDate="2016-10-10T17:13:26.700" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27700" PostTypeId="2" ParentId="27698" CreationDate="2016-10-10T17:18:28.393" Score="2" Body="&lt;p&gt;You can also write pretty simple elisp code to achieve this :-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun scroll-half-page-down ()&#xA;  &quot;scroll down half the page&quot;&#xA;  (interactive)&#xA;  (scroll-down (/ (window-body-height) 2)))&#xA;&#xA;(defun scroll-half-page-up ()&#xA;  &quot;scroll up half the page&quot;&#xA;  (interactive)&#xA;  (scroll-up (/ (window-body-height) 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-10T17:18:28.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27701" PostTypeId="2" ParentId="27664" CreationDate="2016-10-10T18:39:23.330" Score="3" Body="&lt;p&gt;I just found &lt;code&gt;erc-truncate-mode&lt;/code&gt;. You have to change this variable &#xA;&lt;code&gt;erc-max-buffer-size&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Maximum size in chars of each ERC buffer. Used only&#xA;  when auto-truncation is enabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-11T18:05:16.337" LastActivityDate="2016-10-11T18:05:16.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27703" PostTypeId="1" AcceptedAnswerId="27704" CreationDate="2016-10-10T19:41:09.617" Score="1" ViewCount="28" Body="&lt;p&gt;Recent versions of emacs come with package.el built in and provide the abbreviation &lt;code&gt;M-x l-pac&lt;/code&gt;. However, &lt;code&gt;l-pac&lt;/code&gt; is not recognized by &lt;code&gt;smex&lt;/code&gt; or &lt;code&gt;helm-M-x&lt;/code&gt;. &lt;code&gt;M-: (l-pac)&lt;/code&gt; also does not work and the help functions do not seem to know about &lt;code&gt;l-pac&lt;/code&gt; either, so it does not seem to be a an emacs function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where/How is &lt;code&gt;l-pac&lt;/code&gt; defined?&lt;/p&gt;&#xA;" OwnerUserId="2706" LastEditorUserId="2706" LastEditDate="2016-10-10T19:48:24.233" LastActivityDate="2016-10-10T20:13:37.140" Title="Where the `l-pac` abrreviation for `list-packeages defined`?" Tags="|package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27704" PostTypeId="2" ParentId="27703" CreationDate="2016-10-10T20:07:10.610" Score="3" Body="&lt;p&gt;&lt;code&gt;l-pac&lt;/code&gt; is not a defined abbreviation. Completion for it is provided; that's all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This comes from user option &lt;strong&gt;&lt;code&gt;completion-styles&lt;/code&gt;&lt;/strong&gt;, which you can customize. The default value (in Emacs 25.1, for example) is &lt;code&gt;(basic partial-completion emacs22)&lt;/code&gt;, which means try to complete input using, first, &lt;em&gt;basic&lt;/em&gt; completion, then, &lt;em&gt;partial&lt;/em&gt; completion, and finally, &lt;em&gt;emacs22&lt;/em&gt; completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is &lt;code&gt;partial-completion&lt;/code&gt; that is completing &lt;code&gt;l-pac&lt;/code&gt; as you see. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion-Styles.html&quot; rel=&quot;nofollow&quot;&gt;Completion Styles&lt;/a&gt;.  There you see this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;partial-completion&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This aggressive completion style divides the minibuffer text into&#xA; words separated by hyphens or spaces, and completes each word&#xA; separately.  (For example, when completing command names, `em-l-m`&#xA; completes to `emacs-lisp-mode`.)&#xA;&#xA; Furthermore, a `*` in the minibuffer text is treated as a&#xA; “wildcard”—it matches any character at the corresponding position&#xA; in the completion alternative.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Perhaps &lt;code&gt;smex&lt;/code&gt; and &lt;code&gt;helm-M-x&lt;/code&gt; do not support this kind of completion? Or perhaps you need to look at their doc/help to see how they support it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-: (l-pac)&lt;/code&gt; does not work because &lt;code&gt;l-pac&lt;/code&gt; is not a defined function.  But if you use &lt;code&gt;M-: (l-pac TAB&lt;/code&gt; then it should be completed OK to &lt;code&gt;(list-packages&lt;/code&gt;. (You then need to add &lt;code&gt;)&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-10T20:13:37.140" LastActivityDate="2016-10-10T20:13:37.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27705" PostTypeId="2" ParentId="27694" CreationDate="2016-10-10T20:59:56.327" Score="1" Body="&lt;p&gt;Since Org offers export filters (see &lt;code&gt;(info &quot;(org) Advanced configuration&quot;)&lt;/code&gt;) for this very purpose, I would refrain from advising an internal function. The following will unwrap &lt;code&gt;img&lt;/code&gt; tags in the final output of an HTML export:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-html-export-img-without-p-tag (s backend info)&#xA;  (when (org-export-derived-backend-p backend 'html)&#xA;    (replace-regexp-in-string &quot;class=\&quot;figure\&quot;&amp;gt;\n&amp;lt;p&amp;gt;\\(?1:&amp;lt;img[^&amp;lt;]+\\)&amp;lt;/p&amp;gt;&quot;&#xA;                              &quot;class=\&quot;figure\&quot;\n\\1&quot; s)))&#xA;&#xA;(add-to-list 'org-export-filter-final-output-functions&#xA;             'org-html-export-img-without-p-tag)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-10-10T20:59:56.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27706" PostTypeId="1" CreationDate="2016-10-10T21:32:42.657" Score="2" ViewCount="81" Body="&lt;p&gt;Org-mode has a magical &lt;code&gt;org-src-fontify-natively&lt;/code&gt; setting.  With this on, org highlights each code snippet using the corresponding mode's font-locking support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use this in LaTeX-mode? It would make editing small snippets in lstlistings environments much nicer!  By default, AucTeX highlights code snippets uniformly.&lt;/p&gt;&#xA;" OwnerUserId="2429" LastActivityDate="2016-10-10T21:32:42.657" Title="Can I reuse Org's syntax highlighting in LaTeX mode?" Tags="|org-mode|auctex|font-lock|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27707" PostTypeId="2" ParentId="27692" CreationDate="2016-10-10T22:31:35.567" Score="10" Body="&lt;p&gt;The org-reveal export package builds on top of &lt;code&gt;ox-html&lt;/code&gt;. That means that most export settings are still controlled just like when exporting org to html.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How to set the title/author_name/email_address?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To set the title, author name and email address you can &lt;strong&gt;use the standard org-mode preprocessor tags&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: My wonderful reveal presentation&#xA;#+DATE: 11.10.2016&#xA;#+AUTHOR: Me&#xA;#+EMAIL: me@me.com&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You just have to place them at the top of your org document. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The information will land in the title screen when you export your org to reveal. To make sure they really get exported, you can &lt;a href=&quot;http://orgmode.org/org.html#Export-settings&quot; rel=&quot;noreferrer&quot;&gt;override any other configurations&lt;/a&gt; by adding the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: author:t date:t email:t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How to align text (at least left align)?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Text alignment - be it left, right or whatever else - is controlled by adding &lt;a href=&quot;http://www.w3schools.com/tags/att_global_style.asp&quot; rel=&quot;noreferrer&quot;&gt;style attributes&lt;/a&gt; to your html. The easiest way to achieve this is by writing your own &lt;strong&gt;CSS stylesheet&lt;/strong&gt; and adding it to reveal with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+REVEAL_EXTRA_CSS: ./mystyle.css&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An example of what you could write into a &lt;code&gt;mystyle.css&lt;/code&gt; file to align text to the left is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.reveal p {&#xA;    text-align: left;&#xA;    margin-left: 55px;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adding styles to your presentation is not the responsibility of ox-reveal, since it's job is to export org to html. That said, you can always inject your own HTML in a presentation, if you want extra control over a particular element. Here is an example to insert a video:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_HTML&#xA;&amp;lt;video id=&quot;vid&quot; onClick=&quot;playPause('vid');&quot; width=38.3% height=38.3% autoplay&amp;gt;&#xA;    &amp;lt;source data-src=&quot;./media/vid.webm&quot; type=&quot;video/webm&quot; /&amp;gt;&#xA;&amp;lt;/video&amp;gt;&#xA;#+END_HTML&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function playPause is defined on a &lt;code&gt;vid.js&lt;/code&gt; file and org-reveal is aware of it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+REVEAL_EXTRA_JS: { src: 'vid.js', async: true, condition: function() { return !!document.body.classList; } }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2016-10-10T22:31:35.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27709" PostTypeId="1" AcceptedAnswerId="27710" CreationDate="2016-10-11T00:05:48.150" Score="2" ViewCount="149" Body="&lt;p&gt;I am writing an emacs package which provides some commands to the user. The user can run things like &lt;code&gt;M-x foobar&lt;/code&gt; and &lt;code&gt;M-x eggsspam&lt;/code&gt;. However, some of these commands can fail. As an example, without running &lt;code&gt;M-x foobar&lt;/code&gt; once, &lt;code&gt;M-x spameggs&lt;/code&gt; will make no sense and has to report an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the right way to signal such errors to the user? Should I use &lt;code&gt;(message...)&lt;/code&gt; or &lt;code&gt;(user-error ...)&lt;/code&gt; or something else?&lt;/p&gt;&#xA;" OwnerUserId="9181" LastActivityDate="2016-10-11T01:34:32.030" Title="Standard way of reporting user errors to user?" Tags="|error-handling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27710" PostTypeId="2" ParentId="27709" CreationDate="2016-10-11T01:34:32.030" Score="4" Body="&lt;p&gt;You can use whatever you think is most appropriate for your context. There is no &quot;right&quot; way for all contexts.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;message&lt;/code&gt; does not prevent continued processing of the current command. If you want to be sure the user sees the message, you can use &lt;code&gt;sit-for&lt;/code&gt; or &lt;code&gt;sleep-for&lt;/code&gt; (which see).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can pop up a window, frame, or tooltip with a message.  Like &lt;code&gt;message&lt;/code&gt;, this does not, by itself, interrupt program execution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;user-error&lt;/code&gt; raises an error that is intended to be for a pilot (user) error, rather than an error of the program itself.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;error&lt;/code&gt; raises an error that is (generally) intended for a programmatic error (e.g. division by zero, wrong number of arguments). In general, &lt;code&gt;error&lt;/code&gt; is more general than &lt;code&gt;user-error&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;signal&lt;/code&gt; is more general than &lt;code&gt;error&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Signaling-Errors.html&quot; rel=&quot;nofollow&quot;&gt;Signaling Errors&lt;/a&gt;.  See also node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Error-Debugging.html&quot; rel=&quot;nofollow&quot;&gt;Error Debugging&lt;/a&gt;, where you can learn some of the behavior differences between &lt;code&gt;user-error&lt;/code&gt; and &lt;code&gt;error&lt;/code&gt; (see option &lt;code&gt;debug-ignored-errors&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-11T01:34:32.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27711" PostTypeId="1" AcceptedAnswerId="27720" CreationDate="2016-10-11T03:43:37.780" Score="1" ViewCount="1068" Body="&lt;p&gt;When using the &lt;code&gt;popwin&lt;/code&gt; mode, I notice that the pop-up window always appears at the bottom of the entire frame. For example, given the frame contains two windows, divided vertically, and I am editing the left one&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+++++++++++++++++++++++++++&#xA;+            |            +   &#xA;+  Editting  |            +   &#xA;+   window   |            +   &#xA;+            |            +   &#xA;+            |            +   &#xA;+++++++++++++++++++++++++++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When performing some task, for example, compiling the editting file, the pop-up window in &lt;code&gt;popwin&lt;/code&gt; mode will appear as follow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+++++++++++++++++++++++++++&#xA;+  Editting  |            +   &#xA;+   window   |            +   &#xA;+            |            +   &#xA;+++++++++++++++++++++++++++&#xA;+         pop-win         +   &#xA;+++++++++++++++++++++++++++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I find out that it's is a waste of space that the pop-up window occupies and the other window is shrunk, consequently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I would like to ask if &lt;code&gt;popwin&lt;/code&gt; mode can be configured to appear as follow?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+++++++++++++++++++++++++++&#xA;+  Editting  |            +   &#xA;+   window   |            +   &#xA;+            |            +   &#xA;++++++++++++++            +&#xA;+   pop-win  |            +   &#xA;+++++++++++++++++++++++++++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for spending your time to read my question. Any helps is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13199" LastActivityDate="2016-10-11T10:32:10.277" Title="How to make pop-up window appear in the divided portion of the frame" Tags="|window|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27712" PostTypeId="1" AcceptedAnswerId="27768" CreationDate="2016-10-11T05:27:09.537" Score="9" ViewCount="2510" Body="&lt;p&gt;What is the difference between &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt; and &lt;code&gt;switch-to-buffer&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;switch-to-buffer-other-window&lt;/code&gt; is basically an alias for &lt;code&gt;pop-to-buffer&lt;/code&gt;, so I'm surprised that &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt; is not basically an alias for &lt;code&gt;switch-to-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-10-12T22:46:07.900" Title="`switch-to-buffer` vs. `pop-to-buffer-same-window`" Tags="|buffers|window|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27713" PostTypeId="1" AcceptedAnswerId="27738" CreationDate="2016-10-11T05:48:07.513" Score="2" ViewCount="2150" Body="&lt;p&gt;For example, I can open a bare vim (without plugin) and input &lt;code&gt;some_long_object&lt;/code&gt; and then hit &lt;code&gt;Enter&lt;/code&gt; to open a new line, and input a &lt;code&gt;s&lt;/code&gt;, hit &lt;code&gt;C-x C-p&lt;/code&gt;, it will complete &lt;code&gt;some_long_object&lt;/code&gt; for me. If I input &lt;code&gt;some_long_object.some_method_really_long&lt;/code&gt; on a new line, then I open a new line and input &lt;code&gt;s&lt;/code&gt;, then hit &lt;code&gt;C-x C-p C-x C-p&lt;/code&gt;, it will complete &lt;code&gt;some_long_object.some_method_really_long&lt;/code&gt; for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vim can also do the same kind of thing on lines.(not only complete word, but also lines)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Out-of-box Emacs seems not doing word completion, line completion, and series completion as good as Vim. It only has an expand. when I use Vim, I can &lt;code&gt;C-x C-p&lt;/code&gt; to complete a word, (maybe it is a &lt;code&gt;some_object&lt;/code&gt;)and sequentially hit another &lt;code&gt;C-x C-p&lt;/code&gt; to complete it, hoping to check what should be following a &lt;code&gt;some_object&lt;/code&gt;, (for example it is a &lt;code&gt;some_object.some_method&lt;/code&gt;), and &lt;code&gt;C-x C-l&lt;/code&gt; will complete line or (use in sequence) lines for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So vim can complete one thing after another and I need not think about what should appear next if I am sure what should appear when I hit &lt;code&gt;C-x C-p&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And another thing, I can use &lt;code&gt;C-x C-p&lt;/code&gt; to recall what method I've used in this buffer but do not have to really finish the completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I heard of but have not used &lt;code&gt;evil&lt;/code&gt; before. Can evil do the same thing as I just said? and can I use &lt;code&gt;evil&lt;/code&gt; just for completion, not using its other kdbs? I've used to Emacs key bindings and have not used vim for at least 5 years.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm been using &lt;code&gt;hippie-expand&lt;/code&gt; for years. I don't like the way it does things because it does not give me any feedback how I can use it. It's like exploring on a website without UE designing. I even tried &lt;code&gt;hippie-expand&lt;/code&gt; with &lt;code&gt;ido&lt;/code&gt; menu. It's just not what I need. I'm not familiar with &lt;code&gt;auto-complete&lt;/code&gt; because when I tried it a few years ago, it was full of problems, and besides that its user experience was not as good as vim's completion. Vim's completion just provides me everything what I need and not any more or or any less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there any Emacs extensions, or tweeks that can help me to do completion just like the way as I said?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've been using Emacs for years. Emacs provides me many huge good things, but with this simple completion thing, I've tried again and again. Maybe the user experience philosophy behind Emacs is not so good as Vim.&#xA;For example, &lt;code&gt;auto-complete&lt;/code&gt; claims it has built a LOW COST operation philosophy behind it. But for me, the simple thing is it uses a input-userlookup-feedback-input-userlookup-feedback loop in its philosophy. It is slower than vim, because vim use a input-&gt;not_good?-&gt;simple_adjust philosophy. Behind vim it is real Unix philosophy, which is splitting complex things to simple parts. Try to lower the feedback cost and decrease feedback-loop is the central thing what vim provide us.&lt;/p&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="13609" LastEditDate="2016-10-12T01:42:52.850" LastActivityDate="2017-12-13T18:00:59.813" Title="Can I do vim-like completions in emacs?" Tags="|completion|" AnswerCount="3" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="27714" PostTypeId="2" ParentId="27683" CreationDate="2016-10-11T07:11:34.280" Score="6" Body="&lt;p&gt;&lt;code&gt;web-mode-comment-formats&lt;/code&gt; is a buffer local variable.  Also, &lt;code&gt;add-to-list&lt;/code&gt; may not work correctly, since there is already a mapping for &lt;code&gt;javascript&lt;/code&gt; to &lt;code&gt;/*&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can try one of the following:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default web-mode-comment-formats&#xA;              (remove '(&amp;quot;javascript&amp;quot; . &amp;quot;/*&amp;quot;)&#xA;                      web-mode-comment-formats))&#xA;(add-to-list 'web-mode-comment-formats '(&amp;quot;javascript&amp;quot; . &amp;quot;//&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default web-mode-comment-formats&#xA;              '((&amp;quot;java&amp;quot;       . &amp;quot;/*&amp;quot;)&#xA;                (&amp;quot;javascript&amp;quot; . &amp;quot;//&amp;quot;)&#xA;                (&amp;quot;php&amp;quot;        . &amp;quot;/*&amp;quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2465" LastEditorUserId="28451" LastEditDate="2023-04-25T10:14:45.593" LastActivityDate="2023-04-25T10:14:45.593" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="27715" PostTypeId="1" AcceptedAnswerId="27747" CreationDate="2016-10-11T07:17:11.553" Score="8" ViewCount="1699" Body="&lt;p&gt;Say I have a function like this in a .js file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import React, { Component, PropTypes } from 'react';&#xA;const Forecast = ({ summary, details }) =&amp;gt; {&#xA;  if (!summary) return &amp;lt;div/&amp;gt;;&#xA;&#xA;  const image = `http://openweathermap.org/img/w/${summary.get('icon')}.png`;&#xA;&#xA;  return (&#xA;    &amp;lt;div className=&quot;col-lg-3 col-md-4 col-xs-6 thumb&quot;&amp;gt;&#xA;      &amp;lt;div className=&quot;thumbnail&quot;&amp;gt;&#xA;        &amp;lt;div className=&quot;weather&quot;&amp;gt;&#xA;          &amp;lt;img src={image}/&amp;gt;&#xA;        &amp;lt;/div&amp;gt;&#xA;        &amp;lt;div className=&quot;caption&quot;&amp;gt;&#xA;          &amp;lt;h3&amp;gt;{summary.get('outlook')}&amp;lt;/h3&amp;gt;&#xA;          &amp;lt;p&amp;gt;{summary.get('date').format('DD/MM/YYYY')}&amp;lt;/p&amp;gt;&#xA;        &amp;lt;/div&amp;gt;&#xA;      &amp;lt;/div&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;  );&#xA;};&#xA;&#xA;export default Forecast;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I highlight the jsx code and format, this is the result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import React, { Component, PropTypes } from 'react';&#xA;&#xA;const Forecast = ({ summary, details }) =&amp;gt; {&#xA;  if (!summary) return &amp;lt;div/&amp;gt;;&#xA;&#xA;  const image = `http://openweathermap.org/img/w/${summary.get('icon')}.png`;&#xA;&#xA;  return (&#xA;    &amp;lt;div className=&quot;col-lg-3 col-md-4 col-xs-6 thumb&quot;&amp;gt;&#xA;    &amp;lt;div className=&quot;thumbnail&quot;&amp;gt;&#xA;    &amp;lt;div className=&quot;weather&quot;&amp;gt;&#xA;    &amp;lt;img src={image}/&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;    &amp;lt;div className=&quot;caption&quot;&amp;gt;&#xA;    &amp;lt;h3&amp;gt;{summary.get('outlook')}&amp;lt;/h3&amp;gt;&#xA;    &amp;lt;p&amp;gt;{summary.get('date').format('DD/MM/YYYY')}&amp;lt;/p&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;    &amp;lt;/div&amp;gt;&#xA;  );&#xA;};&#xA;&#xA;export default Forecast;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure web-mode to format the jsx with correct indentation?&lt;/p&gt;&#xA;" OwnerUserId="13577" LastActivityDate="2016-12-11T06:36:35.077" Title="Formatting jsx in js files with web-mode" Tags="|web-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27716" PostTypeId="1" CreationDate="2016-10-11T08:25:55.997" Score="4" ViewCount="293" Body="&lt;p&gt;Being new to Emacs, it often happens to me that I press some key combination and then, seeing the preview with &lt;code&gt;which-key&lt;/code&gt; of how the key combination should finish, realize that I made a mistake somewhere, and I want to use none of the combinations shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to then cancel a partially completed key combination? I usually end up pressing &lt;kbd&gt;ESC&lt;/kbd&gt;, in the hope that there is no combination that ends in &lt;kbd&gt;ESC&lt;/kbd&gt; (which sometimes is not true). Is there a better way?&lt;/p&gt;&#xA;" OwnerUserId="13610" LastEditorUserId="454" LastEditDate="2016-10-11T09:07:48.730" LastActivityDate="2016-10-11T12:53:40.537" Title="Is it possible to cancel a key combination half way through?" Tags="|key-bindings|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27717" PostTypeId="2" ParentId="27716" CreationDate="2016-10-11T09:11:50.633" Score="9" Body="&lt;p&gt;In short, type &lt;kbd&gt;C-g&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read the manual page on Quitting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(emacs) Quitting&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-10-11T09:11:50.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27718" PostTypeId="1" AcceptedAnswerId="27721" CreationDate="2016-10-11T09:24:14.853" Score="0" ViewCount="888" Body="&lt;p&gt;&lt;code&gt;spacemacs&lt;/code&gt; default configuration enables auto-completion, however by default its case insensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make &lt;code&gt;auto-complete&lt;/code&gt; case sensitive (specifically using a &lt;code&gt;spacemacs&lt;/code&gt; configuration)?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="253" LastEditDate="2016-10-11T15:19:56.060" LastActivityDate="2016-10-11T15:19:56.060" Title="How to make auto-completion case sensitive?" Tags="|spacemacs|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27720" PostTypeId="2" ParentId="27711" CreationDate="2016-10-11T10:32:10.277" Score="1" Body="&lt;p&gt;Popwin doesn't have a customizable way to achieve what you ask for, but we can hack it by overriding the function &lt;code&gt;popwin:popup-buffer&lt;/code&gt;. Essentially, we replace the call to &lt;code&gt;popwin:create-popup-window&lt;/code&gt; with code that displays the popup buffer in a new split:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let* ((orig-window (selected-window))&#xA;      (new-window (split-window orig-window nil 'below)))&#xA;  (set-window-buffer new-window buffer)&#xA;  (list orig-window new-window nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This piece of code returns a &quot;master window&quot;, which is the original window, a &quot;popup window&quot;, which is the window used for the popup buffer, and a &quot;window map&quot;, which is nil. In the original version, &lt;code&gt;popwin:create-popup-window&lt;/code&gt; calls &lt;code&gt;popwin:replicate-window-config&lt;/code&gt; and returns the result as the &quot;window map&quot;. In turn, &lt;code&gt;popwin:replicate-window-config&lt;/code&gt; returns nil if the frame has more than one window (maybe a bug), otherwise it returns some other value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer is more a proof-of-concept than a polished solution, but of course you can improve on it if you find it necessary.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun* popwin:popup-buffer (buffer&#xA;                            &amp;amp;key&#xA;                            (width popwin:popup-window-width)&#xA;                            (height popwin:popup-window-height)&#xA;                            (position popwin:popup-window-position)&#xA;                            noselect&#xA;                            dedicated&#xA;                            stick&#xA;                            tail)&#xA;  &quot;Show BUFFER in a popup window and return the popup window. If&#xA;NOSELECT is non-nil, the popup window will not be selected. If&#xA;STICK is non-nil, the popup window will be stuck. If TAIL is&#xA;non-nil, the popup window will show the last contents. Calling&#xA;`popwin:popup-buffer' during `popwin:popup-buffer' is allowed. In&#xA;that case, the buffer of the popup window will be replaced with&#xA;BUFFER.&quot;&#xA;  (interactive &quot;BPopup buffer:\n&quot;)&#xA;  (setq buffer (get-buffer buffer))&#xA;  (popwin:push-context)&#xA;  (run-hooks 'popwin:before-popup-hook)&#xA;  (multiple-value-bind (context context-stack)&#xA;      (popwin:find-context-for-buffer buffer :valid-only t)&#xA;    (if context&#xA;        (progn&#xA;          (popwin:use-context context)&#xA;          (setq popwin:context-stack context-stack))&#xA;      (let ((win-outline (car (popwin:window-config-tree))))&#xA;        (destructuring-bind (master-win popup-win win-map)&#xA;            (let ((size (if (popwin:position-horizontal-p position) width height))&#xA;                  (adjust popwin:adjust-other-windows))&#xA;              ;; (popwin:create-popup-window size position adjust)       ; &amp;lt;-- original line&#xA;              (let* ((orig-window (selected-window))                     ; &amp;lt;-- modifications&#xA;                    (new-window (split-window orig-window nil 'below)))  ; &amp;lt;--&#xA;                (set-window-buffer new-window buffer)                    ; &amp;lt;--&#xA;                (list orig-window new-window nil))                       ; &amp;lt;--&#xA;              )&#xA;          (setq popwin:popup-window popup-win&#xA;                popwin:master-window master-win&#xA;                popwin:window-outline win-outline&#xA;                popwin:window-map win-map&#xA;                popwin:window-config nil&#xA;                popwin:selected-window (selected-window)))&#xA;        (popwin:update-window-reference 'popwin:context-stack :recursive t)&#xA;        (popwin:start-close-popup-window-timer))&#xA;      (with-selected-window popwin:popup-window&#xA;        (popwin:switch-to-buffer buffer)&#xA;        (when tail&#xA;          (set-window-point popwin:popup-window (point-max))&#xA;          (recenter -2)))&#xA;      (setq popwin:popup-buffer buffer&#xA;            popwin:popup-last-config (list buffer&#xA;                                          :width width :height height :position position&#xA;                                          :noselect noselect :dedicated dedicated&#xA;                                          :stick stick :tail tail)&#xA;            popwin:popup-window-dedicated-p dedicated&#xA;            popwin:popup-window-stuck-p stick)))&#xA;  (if noselect&#xA;      (setq popwin:focus-window popwin:selected-window)&#xA;    (setq popwin:focus-window popwin:popup-window)&#xA;    (select-window popwin:popup-window))&#xA;  (run-hooks 'popwin:after-popup-hook)&#xA;  popwin:popup-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6533" LastActivityDate="2016-10-11T10:32:10.277" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27721" PostTypeId="2" ParentId="27718" CreationDate="2016-10-11T10:32:36.687" Score="1" Body="&lt;p&gt;Put this in your &lt;code&gt;~/.emacs&lt;/code&gt;, &lt;code&gt;(setq ac-ignore-case nil)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For spacemacs this can be done by editing &lt;code&gt;~/.spacemacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  ;; add the line below to the user-config section&#xA;  (setq ac-ignore-case nil)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="2418" LastEditDate="2016-10-11T12:03:59.957" LastActivityDate="2016-10-11T12:03:59.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27723" PostTypeId="1" AcceptedAnswerId="27728" CreationDate="2016-10-11T12:45:27.873" Score="1" ViewCount="172" Body="&lt;p&gt;I want to use an interactive function to do the vim-like &lt;code&gt;gd n&lt;/code&gt; in Emacs, search the current word in buffer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;gd&lt;/code&gt; in vim will select current word(highlighting same words), and n will cycle selecting the current word in current file.&#xA;I used to use an interactive function(by google and copy), binding to 'M-n' to do this,&#xA;(or maybe it is a function in some package)&#xA;but a few days before my &lt;code&gt;.emacs.d&lt;/code&gt; directory has lost by fault.&#xA;The last few days I've been searching for this function again and again and&#xA;did not get it.&#xA;Can any one help me with this?&#xA;By using this function, I can hit &lt;code&gt;M-n&lt;/code&gt; just one time, the word&#xA;under/just-before/just-after point will be selected and point will&#xA;go to the next occurance of the same word under/just-before/just-after point.&#xA;thanks a lot!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Thank you all for your answers!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key thing is here:&#xA;I should use the same kbd, say it is &lt;code&gt;M-n&lt;/code&gt; to select the current word and to cycling all candidates.&#xA;so if I put point on a word, I just need to hit &lt;code&gt;M-n&lt;/code&gt; multiple times to cycling all the same word in buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="13609" LastEditDate="2016-10-11T16:05:03.783" LastActivityDate="2016-10-11T16:05:03.783" Title="I want to use an interactive function to do something like vim's `gd n` in Emacs, search the current word in buffer" Tags="|search|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27724" PostTypeId="1" AcceptedAnswerId="27727" CreationDate="2016-10-11T12:51:42.143" Score="4" ViewCount="383" Body="&lt;p&gt;I’m creating a big feature in one of our projects, that is close to around 20 commits in my local repository. Most of them are still subject to change with rebasing, but I’d like to push the first few stable ones for review already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the command line, I’d do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git push origin affec75:master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(given that &lt;code&gt;affec75&lt;/code&gt; is a commit somewhere in my local history.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;kbd&gt;P&lt;/kbd&gt; &lt;kbd&gt;r&lt;/kbd&gt; (explicit refspecs), specifying &lt;code&gt;origin&lt;/code&gt; as the remote and &lt;code&gt;affec75&lt;/code&gt; as the refspec, but it failed. As the generated command is &lt;code&gt;git push origin affec75&lt;/code&gt;, I tried setting &lt;code&gt;affec75:master&lt;/code&gt; as the refspec; it succeeds, but it’s a real pain to type. Is there a shorter way to do this?&lt;/p&gt;&#xA;" OwnerUserId="507" LastEditorUserId="306" LastEditDate="2016-10-11T13:22:52.103" LastActivityDate="2016-10-12T11:13:26.870" Title="Push only part of the history with magit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27726" PostTypeId="2" ParentId="27698" CreationDate="2016-10-11T12:58:38.093" Score="3" Body="&lt;p&gt;I personally recommend you to use a package named &lt;code&gt;golden-ratio-scroll-screen&lt;/code&gt;.&#xA;You can add melpa to your package-list if you have not.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(add-to-list 'package-archives '(&quot;melpa&quot; .&#xA;  &quot;&lt;a href=&quot;https://melpa.org/packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://melpa.org/packages/&lt;/a&gt;&quot;))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and then &lt;code&gt;M-x package-list-packages&lt;/code&gt;,&#xA;search for &lt;code&gt;golden-ratio-&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or go to &lt;a href=&quot;https://github.com/jixiuf/golden-ratio-scroll-screen&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jixiuf/golden-ratio-scroll-screen&lt;/a&gt;&#xA;to get it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will do the following two things, which are to me excellent, maybe also what you want:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Scroll half screen down or up, and&lt;/li&gt;&#xA;&lt;li&gt;highlight current line before or after scrolling.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="17895" LastEditDate="2019-03-04T18:21:55.383" LastActivityDate="2019-03-04T18:21:55.383" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="27727" PostTypeId="2" ParentId="27724" CreationDate="2016-10-11T13:29:04.150" Score="7" Body="&lt;ol&gt;&#xA;&lt;li&gt;Move to the commit.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;P o&lt;/kbd&gt; to push &quot;another branch&quot; (despite the description in the popup, this can also push arbitrary commits).&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;RET&lt;/kbd&gt; confirm the default source, which should be the abbreviated commit hash. If a branch points at the commit, then the commit is the second choice.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;RET&lt;/kbd&gt; confirm the default target, which should be the current branch. (But only if the commit is reachable from &lt;code&gt;HEAD&lt;/code&gt;.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-10-12T11:13:26.870" LastActivityDate="2016-10-12T11:13:26.870" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27728" PostTypeId="2" ParentId="27723" CreationDate="2016-10-11T13:44:51.673" Score="2" Body="&lt;p&gt;Short answer: &lt;code&gt;C-s C-w&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details: in &lt;code&gt;isearch&lt;/code&gt;, &lt;code&gt;C-w&lt;/code&gt; is bound to &lt;code&gt;isearch-yank-word-or-char&lt;/code&gt; which usually puts the current word in the search query. If the point is on a punctuation mark, this char will be searched.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is to use the package &lt;a href=&quot;https://github.com/mickeynp/smart-scan&quot; rel=&quot;nofollow&quot;&gt;smart-scan&lt;/a&gt; (maybe it is what you had in your old &lt;code&gt;.emacs&lt;/code&gt;) which searches for the current &lt;em&gt;symbol&lt;/em&gt; forward (bound to &lt;code&gt;M-n&lt;/code&gt; by default) and backwards (&lt;code&gt;M-p&lt;/code&gt; by default). &lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2016-10-11T13:53:49.153" LastActivityDate="2016-10-11T13:53:49.153" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27729" PostTypeId="2" ParentId="27673" CreationDate="2016-10-11T14:04:39.777" Score="1" Body="&lt;p&gt;Are you asking how to set &lt;code&gt;str.dendrogram.last&lt;/code&gt; to &quot;`&quot;? That can be done from R using the &lt;code&gt;last.str&lt;/code&gt; argument to &lt;code&gt;str()&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;str(dend1, max = 2, last.str =  &quot;`&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or, it can be set using the function &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;options(str.dendrogram.last = &quot;`&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can add the &lt;code&gt;options()&lt;/code&gt; call to your .Rprofile file to have it loaded automatically, which should over-ride the setting imposed by ESS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether this displays poorly or not will depend on the font you are using.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-10-11T14:04:39.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27730" PostTypeId="2" ParentId="27723" CreationDate="2016-10-11T15:14:47.763" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;M-s .&lt;/code&gt; bound to &lt;code&gt;isearch-forward-symbol-at-point&lt;/code&gt; by default, and then &lt;code&gt;C-s&lt;/code&gt; to search forward for that symbol ('word') or &lt;code&gt;C-r&lt;/code&gt; to search backwards.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h f isearch-forward-symbol-at-point&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Do incremental search forward for a symbol found near point.&#xA;  Like ordinary incremental search except that the symbol found at point&#xA;  is added to the search string initially as a regexp surrounded&#xA;  by symbol boundary constructs &lt;code&gt;\_&amp;lt;&lt;/code&gt; and &lt;code&gt;\_&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="115" LastActivityDate="2016-10-11T15:14:47.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27731" PostTypeId="1" AcceptedAnswerId="28993" CreationDate="2016-10-11T15:58:42.923" Score="5" ViewCount="169" Body="&lt;p&gt;I have had &lt;code&gt;(setq org-footnote-auto-label 'plain)&lt;/code&gt; in my init.el&#xA;to get footnote labels of the form[1].  But after updating to&#xA;version 9, I see this option is no longer supported?  Does&#xA;this really mean that there is no longer any way to get plain&#xA;footnotes??  (Surely there is no reason to prefer[fn:1] in documents that have no chance of containing false positives? which is true of all my documents.)&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2016-11-30T15:40:57.140" LastActivityDate="2016-11-30T15:40:57.140" Title="Are plain footnotes now impossible?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27733" PostTypeId="1" CreationDate="2016-10-11T16:27:18.743" Score="1" ViewCount="323" Body="&lt;p&gt;I have two versions of a file (or buffer) and I'm running ediff to compare them. Some of the changes are irrelevant and I want to ignore them. Specifically, &lt;code&gt;foo&lt;/code&gt; has been renamed to &lt;code&gt;bar&lt;/code&gt; in places and I don't care about that. Note that both versions have both &lt;code&gt;foo&lt;/code&gt;s and &lt;code&gt;bar&lt;/code&gt;s, just in different mixes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I ignore regions where &lt;code&gt;foo&lt;/code&gt; → &lt;code&gt;bar&lt;/code&gt; is the only change? Either with Ediff itself, or with a third-party package, or with an external &lt;code&gt;diff&lt;/code&gt; replacement that's easily available on Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;foo+corge&lt;/code&gt; has changed to &lt;code&gt;bar+baz&lt;/code&gt;, I &lt;em&gt;do&lt;/em&gt; want to know about the change from &lt;code&gt;corge&lt;/code&gt; to &lt;code&gt;baz&lt;/code&gt; (whereas a change from &lt;code&gt;foo+corge&lt;/code&gt; to &lt;code&gt;bar+corge&lt;/code&gt; should be ignored). So I don't think that &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ediff/Selective-Browsing.html&quot; rel=&quot;nofollow&quot;&gt;selective browsing&lt;/a&gt; (&lt;code&gt;#h&lt;/code&gt;) can help me. What I really want to ignore is changes, not regions — though if a region has non-ignored changes, I don't mind if the refinement also highlights the ignored change.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-10-11T16:27:18.743" Title="Ignore certain changes in Ediff" Tags="|ediff|diff|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27734" PostTypeId="1" CreationDate="2016-10-11T16:28:12.317" Score="1" ViewCount="161" Body="&lt;p&gt;I've created an ascii video at &lt;a href=&quot;https://asciinema.org/a/63b67gx2hm5pasdvjkhiyq4ud&quot; rel=&quot;nofollow&quot;&gt;https://asciinema.org/a/63b67gx2hm5pasdvjkhiyq4ud&lt;/a&gt; to demo my emacs issue with multiple-cursors. I created 4 lines of text and created 4 cursors (see 00:36). Then I use &lt;code&gt;C-a&lt;/code&gt; moved the cursors to the beginning of the lines. After that, I use &lt;code&gt;mc/insert-letters&lt;/code&gt; to insert letters (see 00:46).  Note that at this time the status line shows &lt;code&gt;mc:4&lt;/code&gt; means I have 4 cursors.  After I inserted the letters, the status line shows &lt;code&gt;mc:3&lt;/code&gt; (see 00:49) and the mini buffer is still activated with the command &lt;code&gt;mc/insert-letters&lt;/code&gt; selected by default. If I press Enter again, the letters &lt;code&gt;a, b, c&lt;/code&gt; only installed in line 2, 3, 4 and the status line shows &lt;code&gt;mc:4&lt;/code&gt; again. At the end of the video, I tried the command &lt;code&gt;mc/insert-numbers&lt;/code&gt; and it shows similar behavior. It seems this behavior is not correct. Could anyone help to confirm please? If it's an issue, how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="2273" LastEditorUserId="2273" LastEditDate="2016-10-11T16:58:50.540" LastActivityDate="2016-10-11T16:58:50.540" Title="emacs multiple-cursors insert letters (numbers) issue" Tags="|insert|multiple-cursors|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27735" PostTypeId="1" CreationDate="2016-10-11T17:14:11.153" Score="1" ViewCount="282" Body="&lt;p&gt;I've got a script that generates some output. Some parts of the output are cyrillic letters, and they cause my &lt;code&gt;ansi-term&lt;/code&gt; to break - I guess they are treated as control characters(they are displayed like &lt;code&gt;\320\272&lt;/code&gt;, and this makes me restart the ansi-term hoping it won't happen again(that I skip this part of output). However, this isn't a fix, but a hack.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make these characters appear correctly/not break my con&lt;/p&gt;&#xA;" OwnerUserId="405" LastActivityDate="2017-05-11T19:00:23.333" Title="Some UTF-8 characters break my ansi-term. How to fix it?" Tags="|ansi-term|utf-8|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27736" PostTypeId="1" CreationDate="2016-10-11T17:14:43.727" Score="3" ViewCount="411" Body="&lt;p&gt;I guess I've been out of the loop for a while. I used to have this at the end of my org-mode SQL files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: engine mysql&#xA;#+PROPERTY: dbhost xx.xx.xx.xx&#xA;#+PROPERTY: dbuser xxxxxx&#xA;#+PROPERTY: dbpassword xxxxxxxxx&#xA;#+PROPERTY: database xxxxxxxxxxxxx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But since I recently updated org-mode, these don't have any effect anymore. In ob-sql I can see they're not getting passed to org-babel-execute:sql.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried a different form that I saw in the doc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args:sql :engine mysql&#xA;#+PROPERTY: header-args:sql :dbhost xxxxxxx&#xA;#+PROPERTY: header-args:sql :dbuser xxxxxxx&#xA;#+PROPERTY: header-args:sql :dbpassword xxxxxx&#xA;#+PROPERTY: header-args:sql :database xxxxxxxxxxxx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but that doesn't work either. Can anyone tell me the proper new-style form for passing header args to all sql code blocks?&lt;/p&gt;&#xA;" OwnerUserId="2672" LastActivityDate="2021-12-10T21:51:15.390" Title="What's the proper new-style form for passing header args to all sql code blocks?" Tags="|org-mode|org-babel|sql|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27738" PostTypeId="2" ParentId="27713" CreationDate="2016-10-11T17:52:07.493" Score="6" Body="&lt;p&gt;GNU Emacs has a way to complete words based on buffers you have open. It's bound to &lt;kbd&gt;M-/&lt;/kbd&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Dynamic-Abbrevs.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Dynamic-Abbrevs.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-10-11T17:52:07.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27739" PostTypeId="2" ParentId="27735" CreationDate="2016-10-11T20:07:28.767" Score="2" Body="&lt;p&gt;The &lt;code&gt;\370\272&lt;/code&gt; is Emacs trying to show the character using octal escapes. See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Display.html&quot; rel=&quot;nofollow&quot;&gt;Text Display&lt;/a&gt;, and see the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Usual-Display.html&quot; rel=&quot;nofollow&quot;&gt;Usual Display&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set variable &lt;code&gt;ctl-arrow&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; to see the characters displayed otherwise, using face &lt;code&gt;escape-glyph&lt;/code&gt;.  But if your font does not enable showing those characters as you expect (Cyrillic) then, well, it can't show them that way. In that case, try a different font.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-13T13:46:21.547" LastActivityDate="2016-10-13T13:46:21.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27740" PostTypeId="2" ParentId="27713" CreationDate="2016-10-11T20:08:35.270" Score="5" Body="&lt;p&gt;If you take a look at &lt;code&gt;evil-maps.el&lt;/code&gt;, you'll see that it defines a few of Vim's completion commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map &quot;\C-n&quot; 'evil-complete-next)&#xA;(define-key evil-insert-state-map &quot;\C-p&quot; 'evil-complete-previous)&#xA;(define-key evil-insert-state-map &quot;\C-x\C-n&quot; 'evil-complete-next-line)&#xA;(define-key evil-insert-state-map &quot;\C-x\C-p&quot; 'evil-complete-previous-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The definition of &lt;code&gt;C-x C-p&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-command evil-complete-previous-line (&amp;amp;optional arg)&#xA;  &quot;Complete a whole line.&#xA;Calls `evil-complete-previous-line-func'.&quot;&#xA;  :repeat change&#xA;  (interactive &quot;P&quot;)&#xA;  (if (minibufferp)&#xA;      (funcall evil-complete-previous-minibuffer-func)&#xA;    (funcall evil-complete-previous-line-func arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;evil-complete-previous-line-func&lt;/code&gt; happens to be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#'(lambda (arg)&#xA;    (let ((hippie-expand-try-functions-list&#xA;           '(try-expand-line&#xA;             try-expand-line-all-buffers)))&#xA;      (hippie-expand arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this I can judge that what you're after is &lt;a href=&quot;https://www.emacswiki.org/emacs/HippieExpand&quot; rel=&quot;noreferrer&quot;&gt;hippie-expand&lt;/a&gt; with the above customization to &lt;code&gt;hippie-expand-try-functions-list&lt;/code&gt;.  It is a more versatile tool than dabbrev if you're willing to invest a bit of time into it.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-10-11T20:08:35.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27741" PostTypeId="2" ParentId="14297" CreationDate="2016-10-11T20:10:40.657" Score="1" Body="&lt;p&gt;You might also try bracketed paste mode. This is a feature of your terminal emulator (PuTTY in this case, versions 0.63 and up) which uses escape sequences to signal that the user is pasting something, and then again when the paste ends. There's an Emacs package called &lt;code&gt;bracketed-paste&lt;/code&gt; which you can install, it enables Emacs to recognize the escape sequences and transition to a safer keymap for the duration of the paste. Not only does this prevent the indentation from getting messed up, it also prevents a rogue paste from running commands in your emacs session using &lt;code&gt;M-x&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-11T20:10:40.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27742" PostTypeId="1" AcceptedAnswerId="30428" CreationDate="2016-10-11T20:54:34.117" Score="1" ViewCount="671" Body="&lt;p&gt;I tried using &lt;a href=&quot;https://github.com/zhangkaiyulw/ac-html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ac-html&lt;/code&gt;&lt;/a&gt; recently since I'm an &lt;code&gt;auto-complete&lt;/code&gt; user and I'd like to have HTML completion in &lt;code&gt;html-mode&lt;/code&gt; and &lt;code&gt;web-mode&lt;/code&gt; buffers. However, it has been acting somewhat strangely and throws an error whenever I type anything in an &lt;code&gt;html-mode&lt;/code&gt; or &lt;code&gt;web-mode&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;auto-complete error: (args-out-of-range &amp;lt;name-of-current-buffer&amp;gt; 0 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a result of this error, &lt;code&gt;auto-complete-mode&lt;/code&gt; is disabled in the current buffer. However, perhaps even more strangely, if I turn on &lt;code&gt;auto-complete-mode&lt;/code&gt; after it was disabled by the error, everything works as expected and I get auto-completion. Yet, this only seems to happen in &lt;code&gt;html-mode&lt;/code&gt; buffers; i.e., I do not get auto-completion after re-enabling &lt;code&gt;auto-complete-mode&lt;/code&gt; in &lt;code&gt;web-mode&lt;/code&gt; buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;ac-html&lt;/code&gt; set up for both &lt;code&gt;html-mode&lt;/code&gt; and &lt;code&gt;web-mode&lt;/code&gt; like so in my init files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Better completion for html-mode&#xA;(defun setup-ac-for-html ()&#xA;  (require 'ac-html)&#xA;  (require 'ac-html-default-data-provider)&#xA;  (ac-html-enable-data-provider 'ac-html-default-data-provider)&#xA;  (ac-html-setup)&#xA;  (setq ac-sources '(ac-source-html-tag&#xA;                     ac-source-html-attr&#xA;                     ac-source-html-attrv)))&#xA;&#xA;;; Better completion for web-mode&#xA;(defun setup-ac-for-web-mode ()&#xA;  (require 'ac-html)&#xA;  (require 'ac-html-default-data-provider)&#xA;&#xA;  (add-to-list 'web-mode-ac-sources-alist&#xA;               '(&quot;html&quot; . (ac-source-html-tag&#xA;                           ac-source-html-attr&#xA;                           ac-source-html-attrv))))&#xA;&#xA;...&#xA;&#xA;(add-hook 'html-mode-hook                      'setup-ac-for-html)&#xA;(add-hook 'web-mode-before-auto-complete-hooks 'setup-ac-for-web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get this error to stop happening so that I don't have to re-enable &lt;code&gt;auto-complete-mode&lt;/code&gt; after said error? Also, why does this re-enabling seemingly not work for &lt;code&gt;web-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 25.1.1 on OS X 10.11.6.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastActivityDate="2017-04-26T22:51:17.093" Title="args-out-of-range error with ac-html" Tags="|completion|auto-complete-mode|web-mode|html|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27744" PostTypeId="1" AcceptedAnswerId="27758" CreationDate="2016-10-12T02:30:18.593" Score="2" ViewCount="103" Body="&lt;p&gt;I am a fiend for &lt;code&gt;C-r&lt;/code&gt; (isearch-backward), and I often will enter the minibuffer with &lt;code&gt;M-x&lt;/code&gt; (execute-extended-command), then use &lt;code&gt;C-r&lt;/code&gt; to search for a previous command. I'd like to bind a key that drops me into the minibuffer to read an extended command and automatically activates isearch-backward, but I'm not sure how to write such a function.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="10936" LastEditDate="2016-10-12T13:01:37.743" LastActivityDate="2016-10-12T17:50:31.350" Title="How can I bind a key to M-x C-r (isearch extended command)?" Tags="|key-bindings|minibuffer|isearch|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27745" PostTypeId="1" CreationDate="2016-10-12T04:22:22.717" Score="1" ViewCount="371" Body="&lt;p&gt;tl;dr Which keymap is active in &lt;code&gt;helm-recentf&lt;/code&gt;? Or is there a better way to accomplish my goal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use emacs as my file browser. When I select a file with &lt;code&gt;helm-find-files&lt;/code&gt; or &lt;code&gt;helm-recentf&lt;/code&gt;, I want to check whether the extension is in a whitelist (eg. &quot;pdf&quot;, &quot;png&quot;, &quot;docx&quot;) and if it is, open the file in the appropriate external program. If it's not, the file should be visited normally in emacs.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solutions I've rejected:&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;C-c C-x&lt;/code&gt; in helm to open candidate externally. I don't want to press a separate keybinding or to be prompted for a program name, I just want to press &lt;code&gt;return&lt;/code&gt; as usual and have helm figure out the right thing to do.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use the &lt;code&gt;openwith&lt;/code&gt; package. It breaks things like mu4e attachments and images embedded in org buffers. I only ever want files I explicitly open through helm to be opened externally.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;What I've tried so far:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I remapped &lt;code&gt;RET&lt;/code&gt; to a custom function that does what I want. It's probably a horrible hack, but it works for &lt;code&gt;helm-find-files&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-find-files-map (kbd &quot;RET&quot;) 'my-helm-ff-run-open-in-emacs-or-externally)&#xA;&#xA;&#xA;(defun my-helm-ff-run-open-in-emacs-or-externally ()                                &#xA;  (interactive)                                                                     &#xA;  (with-helm-alive-p                                                                &#xA;    (helm-exit-and-execute-action 'my-helm-ff-open-in-emacs-or-externally)          &#xA;    )                                                                               &#xA;  )                                                                                 &#xA;&#xA;(defun my-helm-ff-open-in-emacs-or-externally (file)                                &#xA;  ;; based on helm-open-file-externally,                                            &#xA;  ;; Copyright (C) 2012 ~ 2016 Thierry Volpiatto &amp;lt;thierry.volpiatto@gmail.com&amp;gt;      &#xA;  &quot;Open FILE either with emacs or with an external program.                         &#xA;Try to guess which external program to use with `helm-get-default-program-for-file'.&#xA;If not found, open file in emacs.&quot;                                                  &#xA;  (if (bufferp file)                                                                &#xA;      (switch-to-buffer file)                                                       &#xA;    (let* ((file-name      (expand-file-name file))                                 &#xA;           (collection      (helm-external-commands-list-1 'sort))                  &#xA;           (default-program   (helm-get-default-program-for-file file-name)))       &#xA;      (if (not default-program)                                                     &#xA;          (find-file file) ;; open in emacs                                         &#xA;        (helm-run-or-raise default-program file) ;; open in external program        &#xA;        ))))                                                                        &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only problem is, I can't define this mapping for &lt;code&gt;helm-recentf&lt;/code&gt;. I assumed that the &lt;code&gt;helm-buffer-map&lt;/code&gt; would be active in &lt;code&gt;helm-recentf&lt;/code&gt;, but it's not:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key helm-buffer-map (kbd &quot;RET&quot;) '(lambda () (interactive) (message &quot;define-key worked!&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The message prints when I select a buffer in &lt;code&gt;helm-mini&lt;/code&gt;, but not when I select a file in &lt;code&gt;helm-recentf&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Questions&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;So, which keymap is active in &lt;code&gt;helm-recentf&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, am I doing this all wrong, and is there a much better to intelligently open some files with an external program?&lt;/p&gt;&#xA;" OwnerUserId="13619" LastActivityDate="2016-12-31T18:33:47.597" Title="Make helm-recentf open files with external program?" Tags="|helm|files|recentf|openwith|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27746" PostTypeId="2" ParentId="5957" CreationDate="2016-10-12T05:18:21.737" Score="2" Body="&lt;p&gt;I made it slightly different (but the previous answers helped me a lot, thanks guys), to avoid string matching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I modified the &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_new_empty_buffer.html&quot; rel=&quot;nofollow&quot;&gt;&quot;new-empty-buffer&quot; function&lt;/a&gt; suggested by Xah Lee from ErgoEmacs, making it set a local-variable &lt;code&gt;'custom-scratch-buffer&lt;/code&gt; when the buffer is created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, we know when the buffer is a scratch buffer created by this function and we can add a query to the &lt;code&gt;kill-buffer-query-functions&lt;/code&gt; list identifying this kind of buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here goes the code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun custom-scratch-buffer-create ()&#xA;  &quot;Open a new empty buffer.&#xA;URL `http://ergoemacs.org/emacs/emacs_new_empty_buffer.html'&#xA;Version 2016-08-11&quot;&#xA;  (interactive)&#xA;  (let ((-buf (generate-new-buffer &quot;untitled&quot;)))&#xA;    (switch-to-buffer -buf)&#xA;    (funcall initial-major-mode)&#xA;    (setq buffer-offer-save t)&#xA;    (set (make-local-variable 'custom-scratch-buffer) t))) ;; I added this line&#xA;&#xA;(defun custom-scratch-buffer-kill-query-function ()&#xA;  (if (and (not buffer-file-name)           ;; buffer is not visiting a file&#xA;           (buffer-modified-p)              ;; buffer has been modified&#xA;           (boundp 'custom-scratch-buffer))&#xA;      (if 'custom-scratch-buffer            ;; buffer is a custom scratch created buffer&#xA;          (yes-or-no-p &quot;Scratch buffer modified. Kill it anyway? &quot;))&#xA;    t))&#xA;&#xA;;; run query before killing if buffer is custom-scratch-buffer&#xA;(add-to-list 'kill-buffer-query-functions 'custom-scratch-buffer-kill-query-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can bind the function &lt;code&gt;custom-scratch-buffer-create&lt;/code&gt; to a key or use it with &lt;code&gt;M-x&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13589" LastEditorUserId="9995" LastEditDate="2016-10-12T10:15:42.213" LastActivityDate="2016-10-12T10:15:42.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27747" PostTypeId="2" ParentId="27715" CreationDate="2016-10-12T05:47:56.623" Score="8" Body="&lt;p&gt;The answer was to add the following to my init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-content-types-alist&#xA;  '((&quot;jsx&quot; . &quot;\\.js[x]?\\'&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13577" LastActivityDate="2016-10-12T05:47:56.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27748" PostTypeId="1" AcceptedAnswerId="27782" CreationDate="2016-10-12T06:21:14.443" Score="4" ViewCount="250" Body="&lt;p&gt;Is there a way to provide a list of files that have been edited since a previous commit or branch with helm and projectile integration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The use case is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create feature branch &lt;code&gt;feat-my-thing&lt;/code&gt; off of master.&lt;/li&gt;&#xA;&lt;li&gt;Modify foo.txt and bar.txt&lt;/li&gt;&#xA;&lt;li&gt;Commit changes.&lt;/li&gt;&#xA;&lt;li&gt;Days pass. Work on other things.&lt;/li&gt;&#xA;&lt;li&gt;Revisit &lt;code&gt;feat-my-thing&lt;/code&gt; branch.&lt;/li&gt;&#xA;&lt;li&gt;I'd really like to select from a list of just foo.txt or bar.txt as those are the only files with changes since &lt;code&gt;master&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For small repos, &lt;code&gt;helm-projectile-find-file&lt;/code&gt; works well because I can usually remember what I was working on.  With hundreds of files, is not as helpful especially because I'm usually only concerned with 1-5 files for a feature branch.&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-10-18T01:18:57.017" Title="Open files in git repo that have been edited since a previous commit or branch" Tags="|helm|git|projectile|helm-projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27749" PostTypeId="1" AcceptedAnswerId="27770" CreationDate="2016-10-12T09:10:26.617" Score="7" ViewCount="1317" Body="&lt;p&gt;I often have various files open and cycle through them using &lt;code&gt;C-x &amp;lt;left&amp;gt;&lt;/code&gt; and &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt;. However, this means I also need to cycle through various &quot;informative&quot; buffers that I really don't care about. For example, at work I connect to a remote machine (call it &lt;code&gt;foo&lt;/code&gt;) via tramp and edit files there. This opens various buffers such as &lt;code&gt;*debug tramp/sshx foo*&lt;/code&gt; &lt;code&gt;*tramp/sshx foo*&lt;/code&gt;. Then, we have &lt;code&gt;*Messages*&lt;/code&gt;, &lt;code&gt;*Completions*&lt;/code&gt;, &lt;code&gt;*scratch*&lt;/code&gt; etc, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how can I define a list of buffers that are never shown when cycling through the open buffers with &lt;code&gt;C-x &amp;lt;left&amp;gt;&lt;/code&gt; and &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt;? Ideally, these would still be shown in the buffer drop-down menu in the GUI and in &lt;a href=&quot;https://www.emacswiki.org/emacs/IbufferMode&quot; rel=&quot;nofollow&quot;&gt;Ibuffer&lt;/a&gt; so I can switch to them if I ever want to, but they will be hidden when cycling through open buffers. &lt;/p&gt;&#xA;" OwnerUserId="241" LastEditorUserId="454" LastEditDate="2016-10-13T10:41:46.570" LastActivityDate="2016-10-13T10:41:46.570" Title="How can I hide unwanted buffers when cycling with C-x &lt;left/right&gt;" Tags="|buffers|ibuffer|" AnswerCount="1" CommentCount="6" ClosedDate="2016-10-13T10:43:22.283" ContentLicense="CC BY-SA 3.0" />
  <row Id="27750" PostTypeId="1" CreationDate="2016-10-12T09:22:22.577" Score="1" ViewCount="1328" Body="&lt;p&gt;I want to optimize my &lt;code&gt;gdb&lt;/code&gt; window setup. The idea is to automatically resize the &lt;code&gt;gdb-breakpoints&lt;/code&gt; window to the current buffer length. In my setup this buffer is at the bottom and I want it to auto-resize vertically every time I add or remove a breakpoint.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-10-12T14:24:30.473" Title="how to automatically adjust window size to buffer height?" Tags="|buffers|window|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27751" PostTypeId="1" AcceptedAnswerId="27764" CreationDate="2016-10-12T09:48:57.453" Score="1" ViewCount="504" Body="&lt;p&gt;I have been using &lt;code&gt;emacs&lt;/code&gt; for a while, and i recently installed &lt;code&gt;zsh&lt;/code&gt; and i wanted to give a try with &lt;code&gt;spacemacs&lt;/code&gt;. I want to try &lt;code&gt;spacemacs&lt;/code&gt; without disturbing existing &lt;code&gt;emacs&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I followed the instruction as mentioned &lt;a href=&quot;https://github.com/syl20bnr/spacemacs#modify-home-environment-variable&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;created a dir &lt;code&gt;~/spacemacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;git clone https://github.com/syl20bnr/spacemacs.git ~/spacemacs/.emacs.d&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;HOME=~/spacemacs emacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I did the first two steps. But im not sure to do the last step &lt;code&gt;HOME=~/spacemacs emacs&lt;/code&gt;, because i want things to be as follows. when i give &lt;code&gt;emacs&lt;/code&gt;, my default &lt;code&gt;emacs&lt;/code&gt; should open, and when i give &lt;code&gt;semacs&lt;/code&gt; i want to open &lt;code&gt;spacemacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, i have modified my &lt;code&gt;.zshrc&lt;/code&gt; file in such a way that, when i give the command &lt;code&gt;emacs&lt;/code&gt; it fires up &lt;code&gt;emacs&lt;/code&gt;, so i have an alias like such &lt;code&gt;alias emacs='emacs -nw'&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And i want to give &lt;code&gt;semacs&lt;/code&gt;(alias for &lt;code&gt;spacemacs&lt;/code&gt;) open &lt;code&gt;spacemacs&lt;/code&gt;, so that i can open &lt;code&gt;emacs&lt;/code&gt; any time i wanted to, if im not comfortable with &lt;code&gt;spacemacs&lt;/code&gt;. Now what should be the 3rd step as and what should be my alias look like.&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2016-10-12T21:54:59.367" Title="installing spacemacs without disturbing existing emacs" Tags="|spacemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27752" PostTypeId="1" CreationDate="2016-10-12T10:02:24.460" Score="0" ViewCount="78" Body="&lt;p&gt;The following loop hangs my emacs (even when called with -q) to the point that I have to force quit it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((buffs (buffer-list)))&#xA;  (while buffs&#xA;    (delq (car buffs) buffs)&#xA;    (print (cadr buffs))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't understand why this should happen, but is there something I can do to recover from a hanging Emacs?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2016-10-12T10:17:11.677" LastActivityDate="2016-10-12T10:18:34.857" Title="Hanging my emacs with a while loop. How to recover?" Tags="|crash|" AnswerCount="1" CommentCount="2" ClosedDate="2016-10-12T12:35:12.217" ContentLicense="CC BY-SA 3.0" />
  <row Id="27753" PostTypeId="2" ParentId="27752" CreationDate="2016-10-12T10:18:34.857" Score="1" Body="&lt;p&gt;I guess since youre saving the result of buffer-list, buffs never evaluates to a falsy value.&#xA;You should update the buffs variable by seting it to the return vaulue of your delq.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq buffs (delq (car buffs) buffs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13626" LastActivityDate="2016-10-12T10:18:34.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27754" PostTypeId="1" CreationDate="2016-10-12T10:32:50.283" Score="6" ViewCount="573" Body="&lt;p&gt;I write my research notes in org-mode, and I'd like to avoid writing &lt;code&gt;#+ATTR_LaTeX: :width 5cm :placement [!htpb]&lt;/code&gt; right before all of my figures, to save some time. A possible solution might be to make changes to my &lt;code&gt;.emacs&lt;/code&gt; file. I'm just not sure what to add.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have spent quite some time searching for a solution to this, but so far I haven't found one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion will be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13625" LastActivityDate="2018-11-07T06:03:10.080" Title="Set image width globally for LaTeX export" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27755" PostTypeId="1" AcceptedAnswerId="27766" CreationDate="2016-10-12T11:38:05.637" Score="4" ViewCount="2546" Body="&lt;p&gt;I used &lt;code&gt;global-company-mode&lt;/code&gt; from my &lt;code&gt;.emacs&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook 'global-company-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I’m trying to move to &lt;code&gt;use-package&lt;/code&gt;, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company&#xA;  :config&#xA;  (global-company-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I check with &lt;kbd&gt;C-h m&lt;/kbd&gt;, &lt;code&gt;company-mode&lt;/code&gt; is said to be active, but it’s not listed on my modeline (I don’t use anything that would hide it). And it actually works, as I get the &lt;code&gt;company&lt;/code&gt; popup, when I start typing a function or variable name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;whitespace-mode&lt;/code&gt; is much worse, though:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package whitespace&#xA;  :ensure t  ;; I also tried without this line&#xA;  :config&#xA;    (global-whitespace-mode)&#xA;  :bind&#xA;  (([f10] . whitespace-mode)&#xA;   ([(shift f10)] . global-whitespace-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;WS&lt;/code&gt; doesn’t appear on my modeline as expected (again, I don’t hide anything) and I cannot see its effects like the end-of-line marker &lt;code&gt;$&lt;/code&gt; characters, and it’s not even listed when I press &lt;kbd&gt;C-h m&lt;/kbd&gt;. But when I press &lt;kbd&gt;shift f10&lt;/kbd&gt;, it says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Global Whitespace mode disabled&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and when I press it again, I get the message that it got enabled, and I can also see the effects in all my buffers (and in &lt;kbd&gt;C-h m&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I just realised that &lt;code&gt;diminish&lt;/code&gt; is actually installed as a dependency (I’m trying to figure out what pulled it in). However, &lt;code&gt;diminished-mode-alist&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;, so I don’t think that’s the reason of mode names not displaying in my mode line (correct me if I’m wrong).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit2&lt;/strong&gt;: deferring loading the &lt;code&gt;diminish&lt;/code&gt; package solved the &lt;code&gt;company&lt;/code&gt; problem, but the &lt;code&gt;whitespace&lt;/code&gt; related one still persists.&lt;/p&gt;&#xA;" OwnerUserId="507" LastEditorUserId="507" LastEditDate="2016-10-12T17:21:12.493" LastActivityDate="2016-10-12T21:58:30.130" Title="Activate global minor modes from use-package" Tags="|use-package|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27756" PostTypeId="2" ParentId="27750" CreationDate="2016-10-12T14:24:30.473" Score="2" Body="&lt;p&gt;Try function &lt;code&gt;fit-window-to-buffer&lt;/code&gt;? Put it on an appropriate hook for use with &lt;code&gt;gdb&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;fit-window-to-buffer&lt;/code&gt;&lt;/strong&gt; is an interactive compiled Lisp function in&#xA;  &lt;code&gt;window.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(fit-window-to-buffer &amp;amp;optional WINDOW MAX-HEIGHT MIN-HEIGHT MAX-WIDTH&#xA;  MIN-WIDTH)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Adjust size of &lt;code&gt;WINDOW&lt;/code&gt; to display its buffer's contents exactly.&#xA;  &lt;code&gt;WINDOW&lt;/code&gt; must be a live window and defaults to the selected one.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;WINDOW&lt;/code&gt; is part of a vertical combination, adjust &lt;code&gt;WINDOW&lt;/code&gt;'s&#xA;  height.  The new height is calculated from the actual height of&#xA;  the accessible portion of its buffer.  The optional argument&#xA;  &lt;code&gt;MAX-HEIGHT&lt;/code&gt; specifies a maximum height and defaults to the height&#xA;  of &lt;code&gt;WINDOW&lt;/code&gt;'s frame.  The optional argument &lt;code&gt;MIN-HEIGHT&lt;/code&gt; specifies a&#xA;  minimum height and defaults to &lt;code&gt;window-min-height&lt;/code&gt;.  Both&#xA;  &lt;code&gt;MAX-HEIGHT&lt;/code&gt; and &lt;code&gt;MIN-HEIGHT&lt;/code&gt; are specified in lines and include mode&#xA;  and header line and a bottom divider, if any.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;WINDOW&lt;/code&gt; is part of a horizontal combination and the value of&#xA;  the option &lt;code&gt;fit-window-to-buffer-horizontally&lt;/code&gt; is non-nil, adjust&#xA;  &lt;code&gt;WINDOW&lt;/code&gt;'s width.  The new width of WINDOW is calculated from the&#xA;  maximum length of its buffer's lines that follow the current&#xA;  start position of &lt;code&gt;WINDOW&lt;/code&gt;.  The optional argument &lt;code&gt;MAX-WIDTH&lt;/code&gt;&#xA;  specifies a maximum width and defaults to the width of &lt;code&gt;WINDOW&lt;/code&gt;'s&#xA;  frame.  The optional argument &lt;code&gt;MIN-WIDTH&lt;/code&gt; specifies a minimum width&#xA;  and defaults to &lt;code&gt;window-min-width'.  Both&lt;/code&gt;MAX-WIDTH&lt;code&gt;and&lt;/code&gt;MIN-WIDTH`&#xA;  are specified in columns and include fringes, margins, a&#xA;  scrollbar and a vertical divider, if any.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Fit pixelwise if the option &lt;code&gt;window-resize-pixelwise&lt;/code&gt; is non-nil.&#xA;  If &lt;code&gt;WINDOW&lt;/code&gt; is its frame's root window and the option&#xA;  &lt;code&gt;fit-frame-to-buffer&lt;/code&gt; is non-nil, call &lt;code&gt;fit-frame-to-buffer&lt;/code&gt; to&#xA;  adjust the frame's size.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note that even if this function makes WINDOW large enough to show&#xA;  &lt;strong&gt;all&lt;/strong&gt; parts of its buffer you might not see the first part when&#xA;  &lt;code&gt;WINDOW&lt;/code&gt; was scrolled.  If &lt;code&gt;WINDOW&lt;/code&gt; is resized horizontally, you will&#xA;  not see the top of its buffer unless &lt;code&gt;WINDOW&lt;/code&gt; starts at its minimum&#xA;  accessible position.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-12T14:24:30.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27757" PostTypeId="1" AcceptedAnswerId="27763" CreationDate="2016-10-12T14:26:41.933" Score="3" ViewCount="340" Body="&lt;p&gt;I was searching through docs at &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/gnus/&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/gnus/&lt;/a&gt; but could not find the proper key sequence for this. What is the key sequence for this?&lt;/p&gt;&#xA;" OwnerUserId="12510" LastEditorUserId="105" LastEditDate="2016-10-12T14:44:52.647" LastActivityDate="2016-10-12T18:01:51.493" Title="GNUS - mark all articles in the thread as Unread" Tags="|gnus|email|imap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27758" PostTypeId="2" ParentId="27744" CreationDate="2016-10-12T14:39:06.637" Score="3" Body="&lt;p&gt;This should help:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-M-x (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (minibuffer-with-setup-hook&#xA;      (lambda () (call-interactively #'previous-matching-history-element))&#xA;    (execute-extended-command arg)))&#xA;&#xA;(global-set-key (kbd &quot;M-x&quot;) 'my-M-x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-12T17:50:31.350" LastActivityDate="2016-10-12T17:50:31.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27759" PostTypeId="1" AcceptedAnswerId="29782" CreationDate="2016-10-12T15:15:04.503" Score="4" ViewCount="187" Body="&lt;p&gt;I configured emacs to automatically sign emails:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'mu4e-compose-mode-hook 'mml-secure-message-sign)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, mailing lists often add a footer to the message and that breaks the signature.  Also some people are consistently confused by the attached signatures, and in these cases I'd prefer if the message wasn't signed.  (These people are not going to check the signature anyway.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way to implement a blacklist of email addresses such that emails to addresses on that list are not automatically signed?&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2017-01-04T21:22:30.277" Title="Do not automatically sign emails directed to mailing lists and such" Tags="|email|gpg|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27761" PostTypeId="1" AcceptedAnswerId="27762" CreationDate="2016-10-12T16:28:04.850" Score="4" ViewCount="598" Body="&lt;p&gt;I have custom yasnippets and I noticed they are located in the ~/.emacs.d/snippets folder. The builtin snippets are located at ~/.emacs.d/elpa/yasnippet-20161008.804. There are some builtin snippets which I don't want and I want to remove them. Can I simply remove them? Will next time I upgrade yasnippet cause them come back again? What's the best way to handle it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please don't suggest not to remove them. I really don't want them because of the conflict key and poor quality of them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance friends.&lt;/p&gt;&#xA;" OwnerUserId="2273" LastActivityDate="2016-10-12T17:52:50.123" Title="What's the best way to remove some of the builtin yasnippet and make emacs upgradable?" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27762" PostTypeId="2" ParentId="27761" CreationDate="2016-10-12T17:52:50.123" Score="7" Body="&lt;p&gt;Simply change the value of the variable &lt;code&gt;yas-snippet-dirs&lt;/code&gt;, which by default includes &lt;code&gt;yas-installed-snippets-dir&lt;/code&gt; (pointing to the builtin snippets - those that you want ignored/disabled). For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs '(&quot;~/.emacs.d/mysnippets&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... asuming you have your own custom snippets at the above location (or at least the empty folder created for such a purpose). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the documentation of that variable for more details (basically, it's a list of paths pointing to snippet folders, and the first path is used to store snippets created with &lt;code&gt;yas-new-snippet&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8708" LastActivityDate="2016-10-12T17:52:50.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27763" PostTypeId="2" ParentId="27757" CreationDate="2016-10-12T18:01:51.493" Score="4" Body="&lt;pre&gt;&#xA;3.9.2 Thread Commands&#xA;---------------------&#xA;‘T k’&#xA;‘C-M-k’&#xA;     Mark all articles in the current (sub-)thread as read&#xA;     (‘gnus-summary-kill-thread’).  If the prefix argument is positive,&#xA;     remove all marks instead.  If the prefix argument is negative, tick&#xA;     articles instead.&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;— &lt;code&gt;(info &quot;(gnus) Thread Commands&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And please do not ask me, how should you guess this without readind the manual, or why &lt;code&gt;M-u&lt;/code&gt; does not work on ‘process marked’ articles.&lt;/p&gt;&#xA;" OwnerUserId="9893" LastActivityDate="2016-10-12T18:01:51.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27764" PostTypeId="2" ParentId="27751" CreationDate="2016-10-12T18:06:05.040" Score="1" Body="&lt;p&gt;If I understand your question, what you want to do is set up an alias. The third command, &lt;code&gt;HOME=~/spacemacs emacs&lt;/code&gt;, will launch emacs using the Spacemacs configuration and layers. So, all you should need to do is put&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias semacs='HOME=~/spacemacs emacs'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your &lt;code&gt;.zshrc&lt;/code&gt; file, and restart the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a caveat, I am not very familiar with zsh, but am reasonably experienced with bash. &lt;del&gt;I assume simple aliases like this should work the same.&lt;/del&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I was unable to personally get the alias working in zsh. However, I was able to do it using a shell function (based on &lt;a href=&quot;https://unix.stackexchange.com/a/7966&quot;&gt;this answer&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;semacs() {&#xA;  HOME=~/spacemacs emacs $@&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10604" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-10-12T21:54:59.367" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27765" PostTypeId="1" CreationDate="2016-10-12T19:40:06.047" Score="4" ViewCount="1819" Body="&lt;p&gt;I work with ELisp hash-table and I would like to have a better printed representation of it. I'm on Emacs version 24.5.1. When I create a hash-table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq table (make-hash-table))&#xA;(puthash :name &quot;john&quot; table)&#xA;(puthash :age 31 table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 data&#xA;          (:name &quot;john&quot; :age 31))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I just want to have the content (i.e. &lt;code&gt;data&lt;/code&gt;) of my hash-table.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:name &quot;john&quot; :age 31)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that you can have a specific printed representation in Common Lisp thanks to the &lt;code&gt;print-object&lt;/code&gt; method. Even the pretty printer &lt;code&gt;pp&lt;/code&gt; displays the hash-table metadata. Any idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13632" LastActivityDate="2022-12-05T22:14:43.547" Title="Get a better printed representation of a hash-table" Tags="|print|hash-tables|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27766" PostTypeId="2" ParentId="27755" CreationDate="2016-10-12T21:58:30.130" Score="11" Body="&lt;p&gt;I don't know why &lt;code&gt;company-mode&lt;/code&gt; is getting diminished, but I think I know what's going on with &lt;code&gt;whitespace-mode&lt;/code&gt;.  Your block&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package whitespace&#xA;  :ensure t  ;; I also tried without this line&#xA;  :config&#xA;    (global-whitespace-mode)&#xA;  :bind&#xA;  (([f10] . whitespace-mode)&#xA;   ([(shift f10)] . global-whitespace-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will automatically defer loading the &lt;code&gt;whitespace&lt;/code&gt; package because it includes a &lt;code&gt;:bind&lt;/code&gt;.  So nothing happens until you press &lt;kbd&gt;S-&amp;lt;f10&amp;gt;&lt;/kbd&gt;, at which time the package gets loaded, your &lt;code&gt;:config&lt;/code&gt; block runs, and &lt;code&gt;global-whitespace-mode&lt;/code&gt; is enabled.  Then your keypress is processed, and the mode is promptly disabled again.  There are three solutions that occur to me:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You could change your &lt;code&gt;:config&lt;/code&gt; into an &lt;code&gt;:init&lt;/code&gt; and rely on the fact that &lt;code&gt;global-whitespace-mode&lt;/code&gt; is autoloaded to load the package for you.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You could add a &lt;code&gt;:demand t&lt;/code&gt; line, to cancel &lt;code&gt;:bind&lt;/code&gt;'s deferment.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You could add &lt;code&gt;:defer N&lt;/code&gt;, where &lt;code&gt;N&lt;/code&gt; is an integer.  This will trigger loading whenver Emacs is idle for &lt;code&gt;N&lt;/code&gt; seconds.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All of these options are detailed in the &lt;kbd&gt;C-h f&lt;/kbd&gt; help for the &lt;code&gt;use-package&lt;/code&gt; macro, for further reference.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2016-10-12T21:58:30.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27767" PostTypeId="1" CreationDate="2016-10-12T22:00:29.993" Score="5" ViewCount="591" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; is there a way to center the minibuffer/echo area horizontally?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Emacs in a single, very wide frame split into three windows&#xA;side by side.  I'm usually working in the &lt;em&gt;center&lt;/em&gt; window, with&#xA;the other windows showing notes, a REPL, etc.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+-----------+-----------+-----------+&#xA;|           |           |           |&#xA;|   notes   | EYES HERE |   notes   |&#xA;|           |           |           |&#xA;+-----------+-----------+-----------+&#xA;| echo                              |&#xA;+-----------------------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I use the minibuffer or get a message in the echo area, the&#xA;text is flush with the left side of the frame.  On super wide&#xA;frames like the one I'm using, this placement is really&#xA;inconvenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is there a way to make minibuffer/echo area text show up in the&#xA;center of the frame (i.e., in the middle along the x-axis)?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+-----------+-----------+-----------+&#xA;|           |           |           |&#xA;|   notes   | EYES HERE |   notes   |&#xA;|           |           |           |&#xA;+-----------+-----------+-----------+&#xA;|            echo here?             |&#xA;+-----------------------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In a perfect world, the minibuffer/echo area would start flush&#xA;with the left margin of the active window, but I'd be&#xA;glad if I could just get the text moved to the middle of the frame.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-10-14T10:47:57.807" Title="Center text in minibuffer/echo area?" Tags="|window|frames|minibuffer|echo-area|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27768" PostTypeId="2" ParentId="27712" CreationDate="2016-10-12T22:46:07.900" Score="10" Body="&lt;p&gt;The difference is that &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt; doesn't insist as much about using the same window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historically, &lt;code&gt;switch-to-buffer&lt;/code&gt; has been used for 2 purposes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;change which buffer is shown in the selected window.&lt;/li&gt;&#xA;&lt;li&gt;display the specified buffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In many cases you can do both at the same time, but in some cases you have to choose between the two (e.g. when the selected-window is a minibuffer window).  &lt;code&gt;switch-to-buffer&lt;/code&gt; cares more about the first, while &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt; cares more about the second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I recommend you stay away from &lt;code&gt;switch-to-buffer&lt;/code&gt; in Elisp code (in 99% of the cases where I see &lt;code&gt;switch-to-buffer&lt;/code&gt; in Elisp code, the code will misbehave when used with my config).  Better use &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt; or use &lt;code&gt;set-window-buffer&lt;/code&gt; depending on your specific needs.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-12T22:46:07.900" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27769" PostTypeId="2" ParentId="27678" CreationDate="2016-10-13T00:20:30.313" Score="0" Body="&lt;p&gt;Did not find out... does not matter anymore. &#xA;Found a way out: &lt;a href=&quot;https://github.com/phfrohring/org-to-blog/blob/master/org_to_blog.el&quot; rel=&quot;nofollow&quot;&gt;https://github.com/phfrohring/org-to-blog/blob/master/org_to_blog.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13592" LastActivityDate="2016-10-13T00:20:30.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27770" PostTypeId="2" ParentId="27749" CreationDate="2016-10-13T03:43:12.000" Score="7" Body="&lt;p&gt;You can set the &lt;code&gt;buffer-predicate&lt;/code&gt; parameter of a frame to a function that decides which buffers you want to see in the cycle for windows in that frame. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say that you want to see only buffers that are associated to a file. The function &lt;code&gt;buffer-file-name&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; for buffers that are &lt;em&gt;not&lt;/em&gt; associated to files and a non-nil value (the filename) for those that are. Evaluate the following expression in some frame:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter (selected-frame) 'buffer-predicate #'buffer-file-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After doing so, &lt;code&gt;C-x &amp;lt;left&amp;gt;&lt;/code&gt; and &lt;code&gt;C-x &amp;lt;right&amp;gt;&lt;/code&gt; called from windows in that frame will only cycle through buffers with associated files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As another example, if you want to only cycle through buffers whose name does not start with an asterisk you could evaluate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter (selected-frame) 'buffer-predicate&#xA;  (lambda (buf) (not (string-match-p &quot;^*&quot; (buffer-name buf)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I had no idea about any of that before trying to answer this question. I started by looking up which function &lt;code&gt;C-x &amp;lt;left&amp;gt;&lt;/code&gt; runs, then took a look at the source code of that function and that's when I saw a suspicious &lt;code&gt;(frame-parameter frame 'buffer-predicate)&lt;/code&gt; call. I love how easy it is to get definitive answers about how Emacs does something, I've never used another system that comes close in transparency!&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-10-13T03:43:12.000" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27771" PostTypeId="1" AcceptedAnswerId="27848" CreationDate="2016-10-13T03:54:59.460" Score="1" ViewCount="430" Body="&lt;p&gt;This is why I ask -- Orgzly on my humble Samsung galaxy S5 can handle a 1.6MB org file with little trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs croaks. I have to kill it and restart. What?!?!?&#xA;I also ask because 1.6MB doesn't seem big to me and I have big plans for org-mode, it's a dream come true... almost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 24.5.1&#xA;Spacemacs 0.200.1 develop&#xA;MBA: 1.7Ghz i7, 8GB 1600 DDR3 RAM&lt;/p&gt;&#xA;" OwnerUserId="13118" LastEditorUserId="253" LastEditDate="2016-10-13T13:17:52.533" LastActivityDate="2016-10-16T00:27:28.813" Title="Emacs 24.5 Can't handle large org files" Tags="|org-mode|" AnswerCount="1" CommentCount="8" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27772" PostTypeId="1" CreationDate="2016-10-13T03:58:08.330" Score="0" ViewCount="159" Body="&lt;p&gt;Is there any way to turn on (inhibit-message) only for particular modes or buffers or frames or windows? (any of those would do)&lt;/p&gt;&#xA;" OwnerUserId="891" LastActivityDate="2016-10-13T04:30:02.123" Title="Is there a way to activate (inhibit-message) only for particular modes or buffers?" Tags="|inhibit-message|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27773" PostTypeId="2" ParentId="27772" CreationDate="2016-10-13T04:20:03.273" Score="5" Body="&lt;p&gt;&lt;code&gt;inhibit-message&lt;/code&gt; is a variable (added in 25.1), not a function (I mention this because you've written it like a function call).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore you can set its value buffer-locally:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-local inhibit-message t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where you would do that would depend on your specific requirements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a particular mode you can use the associated mode hook. For &lt;code&gt;foo-mode&lt;/code&gt; you would use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'foo-mode-hook 'my-inhibit-buffer-messages)&#xA;&#xA;(defun my-inhibit-buffer-messages ()&#xA;  &quot;Set `inhibit-message' buffer-locally.&quot;&#xA;  (setq-local inhibit-message t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that a more typical use for the variable would be to &lt;code&gt;let&lt;/code&gt;-bind it around some specific code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((inhibit-message t))&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-10-13T04:30:02.123" LastActivityDate="2016-10-13T04:30:02.123" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27774" PostTypeId="2" ParentId="21739" CreationDate="2016-10-13T04:36:17.093" Score="0" Body="&lt;p&gt;I think you're likely right that it's an upstream bug, as was the case here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/6943&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syl20bnr/spacemacs/issues/6943&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13444" LastActivityDate="2016-10-13T04:36:17.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27776" PostTypeId="1" AcceptedAnswerId="27777" CreationDate="2016-10-13T04:47:36.127" Score="8" ViewCount="3260" Body="&lt;p&gt;I have the following code which doesn't work:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile (require 'cl)) &#xA;(setq mymachine (system-name))&#xA;(case mymachine&#xA;  (&quot;HP&quot; (setq package-user-dir (concat user-emacs-directory &quot;packages/hp&quot;)))&#xA;  (&quot;DELL&quot; (setq package-user-dir (concat user-emacs-directory &quot;packages/dell&quot;)))&#xA;  (&quot;MBP.local&quot; (setq package-user-dir (concat user-emacs-directory &quot;packages/mbp&quot;)))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's something happening in the key comparison between the variable &lt;code&gt;mymachine&lt;/code&gt; and its three possible values. The following does work, however:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (string= system-name &quot;HP&quot;)&#xA;  (setq package-user-dir (concat user-emacs-directory &quot;packages/hp&quot;)))&#xA;(when (string= system-name &quot;DELL&quot;)&#xA;  (setq package-user-dir (concat user-emacs-directory &quot;packages/dell&quot;)))&#xA;(when (string= system-name &quot;MBP.local&quot;)&#xA;  (setq package-user-dir (concat user-emacs-directory &quot;packages/mbp&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would prefer, for the sake of legibility, to use the &lt;code&gt;case&lt;/code&gt; key selection. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's happening here?&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="675" LastEditDate="2016-10-13T18:55:44.980" LastActivityDate="2016-10-13T18:55:44.980" Title="`case` doesn't switch correctly with strings" Tags="|common-lisp|conditionals|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27777" PostTypeId="2" ParentId="27776" CreationDate="2016-10-13T05:05:20.313" Score="12" Body="&lt;p&gt;&lt;code&gt;cl-case&lt;/code&gt; uses &lt;code&gt;eql&lt;/code&gt; for comparisons, so string get tested for identity not for equality in the sense of &lt;code&gt;string=&lt;/code&gt;. You can fix this by just switching to &lt;code&gt;pcase&lt;/code&gt; (or, if you really want to use &lt;code&gt;case&lt;/code&gt;, convert to symbols instead: match &lt;code&gt;(intern mymachine)&lt;/code&gt; against &lt;code&gt;'HP&lt;/code&gt;, etc.).&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2016-10-13T16:43:14.143" LastActivityDate="2016-10-13T16:43:14.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27778" PostTypeId="2" ParentId="27776" CreationDate="2016-10-13T05:24:32.883" Score="5" Body="&lt;p&gt;Your second version would more typically be written as a &lt;code&gt;cond&lt;/code&gt; form:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cond ((string= system-name &quot;HP&quot;)&#xA;       (setq package-user-dir (concat user-emacs-directory &quot;packages/hp&quot;)))&#xA;      ((string= system-name &quot;DELL&quot;)&#xA;       (setq package-user-dir (concat user-emacs-directory &quot;packages/dell&quot;)))&#xA;      ((string= system-name &quot;MBP.local&quot;)&#xA;       (setq package-user-dir (concat user-emacs-directory &quot;packages/mbp&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-10-13T05:24:32.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27779" PostTypeId="1" AcceptedAnswerId="27799" CreationDate="2016-10-13T06:42:06.227" Score="9" ViewCount="682" Body="&lt;p&gt;I would like to change all occurrences of a string (say string1) with another string (say string2) and vice-versa. To be precise I have a long document and these strings occur many times. What I currently do, is to replace string1--&gt;string3, then string2--&gt;string1 and finally string3--&gt;string2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if there is already a function in emacs which does this.  Other solutions are welcomed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: This is actually a duplicate of the question linked in the comment. But the problem is that the accepted answer of that question does not always work (see the comment below). I think it is better to wait until the author of that accepted answer corrects his/her answer or some other solution comes out. Secondly before posting my question, I googled the question and that question did not show up. I think having two duplicate questions is sometimes useful since they use different wording and if a user find the duplicate one, he/she can find the right one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2:&lt;/strong&gt; The accepted answer of &lt;a href=&quot;https://emacs.stackexchange.com/questions/27135/search-replace-like-feature-for-swapping-text&quot;&gt;Search/replace-like feature for swapping text&lt;/a&gt; seems to be fine now.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-10-20T08:12:53.623" Title="Replace two strings with each other" Tags="|replace|query-replace|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27780" PostTypeId="1" AcceptedAnswerId="27961" CreationDate="2016-10-13T06:58:27.027" Score="4" ViewCount="224" Body="&lt;p&gt;First, here is the &lt;a href=&quot;https://bitbucket.org/shackra/dwight-k.-schrute/src/4b2abe8dc530bab5b93e4f0293d8459b93d47ab9/schrute.el?at=master&amp;amp;fileviewer=file-view-default&quot;&gt;full source&lt;/a&gt; code of my package.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Requirement&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Currently I'm working on a package that provides a feature which upon the user invoking several times in a row certain command in a short amount of time, an &lt;em&gt;alternative command&lt;/em&gt; is invoke instead. The assumption is made on the basis that the user has forgotten that the &lt;em&gt;alternative command&lt;/em&gt; exist and that it is better/more efficient to achieve what he wants to achieve than the command he is using now.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Example use case&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;many invocations of &lt;code&gt;next-line&lt;/code&gt; or &lt;code&gt;previous-line&lt;/code&gt; through its bindings (either , C-n or , C-p), instead of letting the user keep invoking those two commands many more times, my package comes in and calls &lt;code&gt;avy-goto-line&lt;/code&gt; (because that's how the user previously configured it to work).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I want to &lt;em&gt;force&lt;/em&gt; the user to comply with whatever input a command request, right now if the user &lt;em&gt;fall asleep&lt;/em&gt; on any binding for &lt;code&gt;next-line&lt;/code&gt;, the alternative command &lt;code&gt;goto-line&lt;/code&gt; never executes, or at least that's how it looks. If the alternative command were &lt;code&gt;avy-goto-line&lt;/code&gt; it will throw an &lt;code&gt;wrong-type-argument&lt;/code&gt; rendering my feature useless for next invocations if I don't &lt;code&gt;ignore-errors&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((exit nil))&#xA;  (while (not exit)&#xA;    (setf exit (ignore-errors (avy-goto-line)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it works, it does what I want to achieve. But for functions like &lt;code&gt;goto-line&lt;/code&gt; or even &lt;code&gt;avy-goto-word-0&lt;/code&gt; Emacs gets freeze and the mini-buffer never popups asking something to the user.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;the code&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is the relevant parts of my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf schrute-shortcuts-commands '((goto-char  (left-char right-char))&#xA;                                   (goto-line  (next-line previous-line))))&#xA;&#xA;(defun schrute--run-command ()&#xA;  &quot;Helper that will run an alternative-command.&quot;&#xA;  (let* ((alternative-command)&#xA;         (command-list))&#xA;    (dolist (elem schrute-shortcuts-commands)&#xA;      (setf alternative-command (car elem))&#xA;      (setf command-list (cadr elem))&#xA;      (when (or (member this-command command-list)&#xA;               (eq this-command command-list))&#xA;        (funcall-interactively alternative-command)))))&#xA;&#xA;(defun schrute-check-last-command ()&#xA;  &quot;Check what command was used last time.&#xA;&#xA;It also check the time between the last two invocations of the&#xA;same command and use the alternative command instead.&quot;&#xA;  (when (eq this-command last-command)&#xA;    (if (member this-command schrute--interesting-commands)&#xA;        (let* ((time-passed (float-time (time-subtract (current-time) schrute--time-last-command))))&#xA;          (if (&amp;lt;= time-passed 1.0)&#xA;              (setf schrute--times-last-command (1+ schrute--times-last-command)))&#xA;          (setf schrute--time-last-command (current-time)))))&#xA;  (when (&amp;gt; schrute--times-last-command 2)&#xA;    (setf schrute--times-last-command 0)&#xA;    ;; Call the alternative command for `this-command'&#xA;    (ignore-errors (schrute--run-command))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="690" LastEditorUserId="105" LastEditDate="2016-10-13T13:49:24.413" LastActivityDate="2016-10-20T11:50:38.707" Title="How to force the user to comply with a command?" Tags="|commands|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27781" PostTypeId="2" ParentId="27779" CreationDate="2016-10-13T07:19:23.103" Score="-2" Body="&lt;p&gt;Well, maybe with a macro this would be easy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;F3&lt;/kbd&gt;&lt;kbd&gt;C-s&lt;/kbd&gt;&lt;code&gt;a&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;kbd&gt;C-b&lt;/kbd&gt;&lt;kbd&gt;M-t&lt;/kbd&gt;&lt;kbd&gt;F4&lt;/kbd&gt;. Using this macro on your question yells this result:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to change all occurrences of string a (say string1) with&#xA;  another string (say string2) and vice-versa. To be precise I have long&#xA;  a document and these strings occur many times. What I currently do, is&#xA;  to replace string1--&gt;string3, then string2--&gt;string1 and finally&#xA;  string3--&gt;string2.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I am wondering if there is already function a in emacs which does&#xA;  this. Other solutions are welcomed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm transposing positions between whatever word is after an &lt;code&gt;a&lt;/code&gt; and that word. You can later edit such macro to transpose other words as well without needing to redefine the entire macro, you can edit the macro with &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-k&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2016-10-13T07:19:23.103" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27782" PostTypeId="2" ParentId="27748" CreationDate="2016-10-13T07:21:23.210" Score="3" Body="&lt;p&gt;Here's a complete working solution with an example keybinding for spacemacs.&#xA;The master branch is hard-coded in as the default branch to compare for file&#xA;changes against.  If you want to diff against the nearest parent branch you&#xA;would need something like this from &lt;a href=&quot;https://stackoverflow.com/questions/10641361&quot;&gt;https://stackoverflow.com/questions/10641361&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git diff --name-only &amp;lt;notMainDev&amp;gt; $(git merge-base &amp;lt;notMainDev&amp;gt; &amp;lt;mainDev&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs Code.  This is mostly a simplification of &lt;code&gt;helm-projectile-find-files&lt;/code&gt; and the resulting calls into &lt;code&gt;projectile-current-project-files&lt;/code&gt; and &lt;code&gt;projectile-dir-files&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my:helm-projectile-changed-master ()&#xA;  &quot;Finds files changed from master in the current project.&quot;&#xA;  (interactive)&#xA;  (let ((changed-files (my:project-files-changed-from-master)))&#xA;    (if changed-files&#xA;        (helm :sources (helm-projectile-build-dwim-source changed-files)&#xA;              :buffer &quot;*helm projectile*&quot;&#xA;              :prompt (projectile-prepend-project-name &quot;Find file: &quot;))&#xA;      (message &quot;No files have changed from master.&quot;))))&#xA;&#xA;(defun my:project-files-changed-from-master ()&#xA;  &quot;Returns a list of files changed from master in the current project.&quot;&#xA;  (cl-mapcan&#xA;  #'my:get-files-changed-from-master-in-dir&#xA;  (projectile-get-project-directories)))&#xA;&#xA;(defun my:get-files-changed-from-master-in-dir (directory)&#xA;  &quot;Returns list of files changed from master branch in DIRECTORY.&quot;&#xA;  (let* ((root (projectile-project-root))&#xA;        (default-directory directory)&#xA;        (command &quot;git diff --name-only master&quot;)&#xA;        (changed-files (split-string&#xA;                        (projectile-shell-command-to-string command)&#xA;                        &quot;\n&quot;))&#xA;        (changed-files-no-empty (delete &quot;&quot; changed-files))&#xA;        (get-relative-project-file-name&#xA;          (lambda (file)&#xA;            (file-relative-name (expand-file-name file directory)&#xA;                                root))))&#xA;    (projectile-adjust-files&#xA;    (mapcar get-relative-project-file-name&#xA;            changed-files-no-empty))))&#xA;&#xA;(spacemacs/set-leader-keys &quot;pj&quot; #'my:helm-projectile-changed-master)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-10-18T01:18:57.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27783" PostTypeId="1" AcceptedAnswerId="27791" CreationDate="2016-10-13T07:55:17.280" Score="0" ViewCount="247" Body="&lt;p&gt;when run the command of helm-find-projectile-file, it will show a file lists in the mini buffer, and then I can use up and down key to select the file I want to view. But is it possible to view the file content when I select a file without press the &quot;Enter&quot; key? if press the Enter key, then I have to get back the helm session. I just want to use up and down key to go through each file, and then let emacs show the file content immediately.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2016-10-14T09:56:51.533" Title="helm find projectile file: how to view the file content when choose the file?" Tags="|projectile|helm-projectile|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27785" PostTypeId="1" AcceptedAnswerId="27800" CreationDate="2016-10-13T08:24:37.880" Score="0" ViewCount="206" Body="&lt;p&gt;I've installed flake8 for flycheck to use to check my python syntax. I installed flake8 in cygwin, using the python interpreter shipped with cygwin, which results in a &lt;code&gt;flake8&lt;/code&gt; file in &lt;code&gt;C:\cygwin64\bin&lt;/code&gt;. The problem is, emacs seems to only respect exe files so if I &lt;code&gt;(executable-find &quot;flake8&quot;)&lt;/code&gt; it yields &lt;code&gt;nil&lt;/code&gt;. I had the same problem when I enabled anaconda-mode, since cygwin has &lt;code&gt;python2.7.exe&lt;/code&gt; and &lt;code&gt;python&lt;/code&gt; in &lt;code&gt;C:\cygwin64\bin&lt;/code&gt;. I solved this by copy &lt;code&gt;python2.7.exe&lt;/code&gt; to &lt;code&gt;python.exe&lt;/code&gt;, but the flake8 problem can't be solved this way.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;code&gt;vim /usr/bin/flake8&lt;/code&gt;d, turns out it's really &lt;code&gt;flake.py&lt;/code&gt; with python code inside to run with python.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt;: Generally the question is: How to make emacs aware of &quot;excutables&quot; that would normally run by &lt;code&gt;python flake8.py&lt;/code&gt;, &lt;code&gt;node eslint.js&lt;/code&gt;? (When I used eslint with flycheck for js-file syntax check, it just works, maybe there's the solution?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="12854" LastEditorUserId="12854" LastEditDate="2016-10-13T08:42:12.643" LastActivityDate="2016-10-14T07:38:54.803" Title="How to make emacs respect non-exe executables on windows?" Tags="|microsoft-windows|cygwin|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27786" PostTypeId="1" AcceptedAnswerId="27985" CreationDate="2016-10-13T08:39:57.650" Score="0" ViewCount="349" Body="&lt;p&gt;This is a weird problem, and I can't see to find an answer anywhere. I have a file with 5 images that I want to show inline. I'm sure this worked for me yesterday, but today I can not make it work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I toggle inline mode, &lt;code&gt;C-c C-x C-v&lt;/code&gt;, I get the message &lt;code&gt;2 images displayed inline&lt;/code&gt;. However, I can click the three other links, and the images open in new buffers. I can also export the document to PDF using LaTeX, and the images show.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="13625" LastActivityDate="2016-10-21T09:05:22.777" Title="Some inline images won't show" Tags="|org-mode|inline-image|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27787" PostTypeId="1" CreationDate="2016-10-13T13:35:27.260" Score="2" ViewCount="192" Body="&lt;p&gt;I have disabled &lt;code&gt;electric indent mode&lt;/code&gt;, as specified &lt;a href=&quot;https://emacs.stackexchange.com/a/14307/9216&quot;&gt;here&lt;/a&gt;, but when yanking text, indenting is still performed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am yanking text into an html buffer, and I do not want any change whatsoever to be applied to the yanked text. I want it as-is, no indentation, no nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this? I am running:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)  of&#xA;  2016-04-17 on lgw01-04, modified by Debian&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9216" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-10-13T13:48:00.317" Title="Prevent emacs to indent when yanking into html buffer" Tags="|indentation|yank|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27788" PostTypeId="2" ParentId="27591" CreationDate="2016-10-13T14:30:24.967" Score="3" Body="&lt;p&gt;You can find the solution in the manual (&lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Fontification-of-macros&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(info &quot;(auctex)Fontification of macros&quot;)&lt;/code&gt;&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Highlighting of macros can be customized by adapting keyword lists which can be found in the customization group &lt;code&gt;font-latex-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thus you have to issue &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-group&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;font-latex-keywords&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; and then add to the &quot;Font Latex Match Reference Keywords&quot; variable&#xA;the new entry with &lt;code&gt;citep&lt;/code&gt; as &quot;keyword&quot; field and&#xA;&lt;code&gt;*[[{&lt;/code&gt; as &quot;format&quot; field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In alternative, you can add the following lines to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook&#xA; 'LaTeX-mode-hook&#xA; (lambda ()&#xA;   (font-latex-add-keywords '((&quot;citep&quot; &quot;*[[{&quot;)) 'reference)&#xA;   (font-latex-add-keywords '((&quot;citet&quot; &quot;*[[{&quot;)) 'reference)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Cross-reference: &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24667&quot; rel=&quot;nofollow&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24667&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-10-13T14:30:24.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27789" PostTypeId="1" CreationDate="2016-10-13T15:14:21.473" Score="1" ViewCount="434" Body="&lt;p&gt;As I move all my &lt;code&gt;emacs.d&lt;/code&gt; between my machines using Git, and, obviously, I don’t version control byte-compiled files (&lt;code&gt;*.elc&lt;/code&gt;), I sometimes get into a situation when my &lt;code&gt;.el&lt;/code&gt; files are newer then the corresponding &lt;code&gt;.elc&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I construct a &lt;code&gt;find(1)&lt;/code&gt; command using &lt;code&gt;find-cmd&lt;/code&gt;, to find all &lt;code&gt;.elc&lt;/code&gt; files, check if they are older then their &lt;code&gt;.el&lt;/code&gt; counterpart, and byte-compile them if so.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun recompile-stale-elcs ()&#xA;  (interactive)&#xA;&#xA;  (with-temp-buffer&#xA;    (setq-local default-directory user-emacs-directory)&#xA;&#xA;    (let ((find-command (find-cmd '(prune (name &quot;.git&quot;))&#xA;                                  '(name &quot;*.elc&quot;))))&#xA;&#xA;      (shell-command find-command t t))&#xA;&#xA;    (goto-char (point-min))&#xA;    (setq more-lines t)&#xA;&#xA;    (while more-lines&#xA;      (let ((start (progn (beginning-of-line)&#xA;                          (point)))&#xA;            (end (progn (end-of-line)&#xA;                        (point))))&#xA;        (let ((el (buffer-substring start (- end 1)))&#xA;              (elc (buffer-substring start end)))&#xA;&#xA;          (if (file-newer-than-file-p el elc)&#xA;              (byte-compile-file (buffer-substring start (- end 1))))))&#xA;      (setq more-lines (= 0 (forward-line 1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to change that &lt;code&gt;find-cmd&lt;/code&gt; call to pure Elisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if there is any other solution for the base problem, I’m open to hear that (probably in comment/chat.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Also, I was in doubt when selecting tags for this question. Please add some more relevant ones if such exist.)&lt;/p&gt;&#xA;" OwnerUserId="507" LastEditorUserId="105" LastEditDate="2016-10-13T23:52:17.740" LastActivityDate="2016-10-13T23:52:17.740" Title="byte-recompilation of files under a directory" Tags="|shell|byte-compilation|" AnswerCount="0" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="27790" PostTypeId="2" ParentId="17487" CreationDate="2016-10-13T18:03:27.383" Score="1" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(make-frame `((name . ,(concat &quot;[foo] &quot; (buffer-name)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not see any reason to use both &lt;strong&gt;title&lt;/strong&gt; and &lt;strong&gt;name&lt;/strong&gt; frame parameters to achieve the goal stated in the question above.  If the goal is to affect the mode-line as mentioned in the documentation below relating to using the &lt;strong&gt;title&lt;/strong&gt; parameter, then there would be no need to use the &lt;strong&gt;name&lt;/strong&gt; parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[It is important to note that Emacs 25 contains substantial bug fixes relating to frame placement and size on OSX.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Parameters.html#Basic-Parameters&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Parameters.html#Basic-Parameters&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;title&lt;/strong&gt;:  If a frame has a non-nil title, it appears in the window system’s title bar at the top of the frame, and also in the mode line of windows in that frame if mode-line-frame-identification uses ‘%F’ (see %-Constructs). This is normally the case when Emacs is not using a window system, and can only display one frame at a time. See Frame Titles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;name&lt;/strong&gt;:  The name of the frame. The frame name serves as a default for the frame title, if the title parameter is unspecified or nil. If you don’t specify a name, Emacs sets the frame name automatically (see Frame Titles).  If you specify the frame name explicitly when you create the frame, the name is also used (instead of the name of the Emacs executable) when looking up X resources for the frame.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-10-13T18:03:27.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27791" PostTypeId="2" ParentId="27783" CreationDate="2016-10-13T19:15:57.827" Score="1" Body="&lt;p&gt;You have to press &lt;kbd&gt;C-j&lt;/kbd&gt; or &lt;kbd&gt;C-z&lt;/kbd&gt;to see the content of the &lt;em&gt;thing&lt;/em&gt; under the selection.&lt;/p&gt;&#xA;" OwnerUserId="193" LastEditorUserId="193" LastEditDate="2016-10-14T05:27:49.010" LastActivityDate="2016-10-14T05:27:49.010" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27792" PostTypeId="1" AcceptedAnswerId="27807" CreationDate="2016-10-13T23:38:17.307" Score="2" ViewCount="393" Body="&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the problem is pretty straight forward I'm just trying to get delete trailing spaces from all files in a projectile project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I've tried so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-delete-trailing-white-spaces-from-project-files ()&#xA;  &quot;Deletes trailing spaces from all projectile project files.&quot;&#xA;  (interactive)&#xA;  (let* ((list (projectile-current-project-files))&#xA;         (buffer (car list)))&#xA;    (while buffer&#xA;      (message buffer)&#xA;      (when&#xA;        (when (file-exists-p buffer)&#xA;          (set-buffer (find-file-noselect buffer))&#xA;          (delete-trailing-whitespace) ;; &amp;lt;-- This isn't working?&#xA;          (save-buffer))               ;; &amp;lt;-- This isn't working?&#xA;        (setq list (cdr list))&#xA;        (setq buffer (car list))&#xA;        ))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13648" LastEditorUserId="105" LastEditDate="2016-10-13T23:49:00.157" LastActivityDate="2016-10-21T01:25:54.337" Title="Delete trailing white space from all projectile project files" Tags="|projectile|whitespace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27793" PostTypeId="1" AcceptedAnswerId="27801" CreationDate="2016-10-13T23:40:45.033" Score="1" ViewCount="161" Body="&lt;p&gt;The following error appears every &lt;em&gt;other&lt;/em&gt; time that a &lt;code&gt;.tex&lt;/code&gt; file is opened:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Wrong number of arguments, setq, 3&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enabling &lt;code&gt;toggle-debug-on-error&lt;/code&gt; gives this &lt;a href=&quot;https://gist.github.com/mpf/605428fbbf9730d659e99f920e8e5e24&quot; rel=&quot;nofollow&quot;&gt;backtrace&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to go about debugging this? I've tagged this as related to AUCTeX, since it seems to only happen for &lt;code&gt;.tex&lt;/code&gt; files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is some information on the installed versions of Aquamacs and AUCTeX. It appears that AUCTeX is the latest version.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs  : Aquamacs 3.3dev  GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109))&#xA; of 2016-09-10 on d897b997d8d0ed9db56ce9d1afc679b9a3f1e2fd&#xA;Package: 11.89&#xA;&#xA;current state:&#xA;==============&#xA;(setq&#xA; AUCTeX-date &quot;2015-11-13&quot;&#xA; window-system 'ns&#xA; LaTeX-version &quot;2e&quot;&#xA; TeX-style-path '(&quot;/Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/var/auctex&quot;&#xA;                  &quot;/Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/edit-modes/auctex/style&quot;&#xA;                  &quot;/Users/mpf/Library/Preferences/Aquamacs Emacs/Packages/auctex/auto&quot;&#xA;                  &quot;/Users/mpf/Library/Preferences/Aquamacs Emacs/Packages/auctex/style&quot; &quot;auto&quot; &quot;style&quot;)&#xA; TeX-auto-save t&#xA; TeX-parse-self t&#xA; TeX-master t&#xA; TeX-command-list '((&quot;LatexMk&quot; &quot;latexmk %(-PDF)%S%(mode) %(file-line-error) %(extraopts) %t&quot; TeX-run-latexmk nil&#xA;                     (plain-tex-mode latex-mode doctex-mode) :help &quot;Run LatexMk&quot;)&#xA;                    (&quot;TeX&quot; &quot;%(PDF)%(tex) %(file-line-error) %(extraopts) %`%S%(PDFout)%(mode)%' %t&quot; TeX-run-TeX nil&#xA;                     (plain-tex-mode ams-tex-mode texinfo-mode) :help &quot;Run plain TeX&quot;)&#xA;                    (&quot;LaTeX&quot; &quot;%`%l%(mode)%' %t&quot; TeX-run-TeX nil (latex-mode doctex-mode) :help &quot;Run LaTeX&quot;)&#xA;                    (&quot;Makeinfo&quot; &quot;makeinfo %(extraopts) %t&quot; TeX-run-compile nil (texinfo-mode) :help&#xA;                     &quot;Run Makeinfo with Info output&quot;)&#xA;                    (&quot;Makeinfo HTML&quot; &quot;makeinfo %(extraopts) --html %t&quot; TeX-run-compile nil (texinfo-mode) :help&#xA;                     &quot;Run Makeinfo with HTML output&quot;)&#xA;                    (&quot;AmSTeX&quot; &quot;amstex %(PDFout) %(extraopts) %`%S%(mode)%' %t&quot; TeX-run-TeX nil (ams-tex-mode) :help&#xA;                     &quot;Run AMSTeX&quot;)&#xA;                    (&quot;ConTeXt&quot; &quot;%(cntxcom) --once --texutil %(extraopts) %(execopts)%t&quot; TeX-run-TeX nil&#xA;                     (context-mode) :help &quot;Run ConTeXt once&quot;)&#xA;                    (&quot;ConTeXt Full&quot; &quot;%(cntxcom) %(extraopts) %(execopts)%t&quot; TeX-run-TeX nil (context-mode) :help&#xA;                     &quot;Run ConTeXt until completion&quot;)&#xA;                    (&quot;BibTeX&quot; &quot;bibtex %s&quot; TeX-run-BibTeX nil t :help &quot;Run BibTeX&quot;)&#xA;                    (&quot;View&quot; &quot;%V&quot; TeX-run-discard-or-function t t :help &quot;Run Viewer&quot;)&#xA;                    (&quot;Print&quot; &quot;%p&quot; TeX-run-command t t :help &quot;Print the file&quot;)&#xA;                    (&quot;Queue&quot; &quot;%q&quot; TeX-run-background nil t :help &quot;View the printer queue&quot; :visible TeX-queue-command)&#xA;                    (&quot;File&quot; &quot;%(o?)dvips %d -o %f &quot; TeX-run-dvips t t :help &quot;Generate PostScript file&quot;)&#xA;                    (&quot;Dvips&quot; &quot;%(o?)dvips %d -o %f &quot; TeX-run-dvips nil t :help &quot;Convert DVI file to PostScript&quot;)&#xA;                    (&quot;Dvipdfmx&quot; &quot;dvipdfmx %d&quot; TeX-run-dvipdfmx nil t :help &quot;Convert DVI file to PDF with dvipdfmx&quot;)&#xA;                    (&quot;Ps2pdf&quot; &quot;ps2pdf %f&quot; TeX-run-ps2pdf nil t :help &quot;Convert PostScript file to PDF&quot;)&#xA;                    (&quot;Index&quot; &quot;makeindex %s&quot; TeX-run-index nil t :help &quot;Run makeindex to create index file&quot;)&#xA;                    (&quot;Xindy&quot; &quot;texindy %s&quot; TeX-run-command nil t :help &quot;Run xindy to create index file&quot;)&#xA;                    (&quot;Check&quot; &quot;lacheck %s&quot; TeX-run-compile nil (latex-mode) :help &quot;Check LaTeX file for correctness&quot;)&#xA;                    (&quot;ChkTeX&quot; &quot;chktex -v6 %s&quot; TeX-run-compile nil (latex-mode) :help&#xA;                     &quot;Check LaTeX file for common mistakes&quot;)&#xA;                    (&quot;Spell&quot; &quot;(TeX-ispell-document \&quot;\&quot;)&quot; TeX-run-function nil t :help &quot;Spell-check the document&quot;)&#xA;                    (&quot;Clean&quot; &quot;TeX-clean&quot; TeX-run-function nil t :help &quot;Delete generated intermediate files&quot;)&#xA;                    (&quot;Clean All&quot; &quot;(TeX-clean t)&quot; TeX-run-function nil t :help&#xA;                     &quot;Delete generated intermediate and output files&quot;)&#xA;                    (&quot;Other&quot; &quot;&quot; TeX-run-command t t :help &quot;Run an arbitrary command&quot;)&#xA;                    (&quot;Jump to PDF&quot; &quot;%V&quot; TeX-run-discard-or-function nil t :help &quot;Run Viewer&quot;))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13649" LastEditorUserId="13649" LastEditDate="2016-10-14T20:35:40.503" LastActivityDate="2016-10-14T20:35:40.503" Title="Debugging erratic error" Tags="|auctex|aquamacs|debug|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27794" PostTypeId="2" ParentId="27792" CreationDate="2016-10-14T00:20:16.397" Score="3" Body="&lt;p&gt;This works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-delete-trailing-white-spaces-from-project-files ()&#xA;  &quot;Deletes trailing spaces from all projectile project files.&quot;&#xA;  (interactive)&#xA;  (let ((project-files (projectile-current-project-files)))&#xA;    (dolist (pr project-files)&#xA;      (when (file-exists-p pr)&#xA;        (message &quot;clearing trailing whitespace in %s&quot; pr)&#xA;        (with-temp-buffer&#xA;          (insert-file-contents pr)&#xA;          (delete-trailing-whitespace (point-min) (point-max))&#xA;          (write-file pr))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although not certain it's the best way to do it.&lt;/p&gt;&#xA;" OwnerUserId="2738" LastActivityDate="2016-10-14T00:20:16.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27795" PostTypeId="1" AcceptedAnswerId="27809" CreationDate="2016-10-14T01:40:33.863" Score="3" ViewCount="64" Body="&lt;p&gt;While resolving complex conflicts manually, I usually want emacs to treat conflict markers and region between them as comment, since it breaks major-mode's syntactic analysis (fontification, electric-indent, etc) :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD          &amp;lt;- comment&#xA;aaa&#xA;bbb&#xA;=======               &amp;lt;- comment&#xA;ccc                   &amp;lt;- comment&#xA;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; brabrabrabra  &amp;lt;- comment&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems possible to visually highlight them as comment with search-based fontification, but is it possible to treat them as comment not just visually but also syntactically ?&lt;/p&gt;&#xA;" OwnerUserId="12049" LastActivityDate="2016-10-14T13:20:56.507" Title="How to treat region between conflict markers as comment?" Tags="|comment|syntax|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27797" PostTypeId="1" CreationDate="2016-10-14T05:26:09.707" Score="4" ViewCount="1291" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ne1aI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ne1aI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it became to one long straight bar, instead of showing as a block of the paragraph. I use &lt;code&gt;#+begin_example&lt;/code&gt;. if I use quote it looks ok but I want to have the block looks.&lt;/p&gt;&#xA;" OwnerUserId="12702" LastEditorUserId="388" LastEditDate="2018-07-11T15:28:24.957" LastActivityDate="2018-07-11T15:28:24.957" Title="Emacs org mode export paragraph in block to HTML, The content does not wrap" Tags="|org-mode|org-export|html|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27798" PostTypeId="1" AcceptedAnswerId="27804" CreationDate="2016-10-14T05:53:04.593" Score="7" ViewCount="3707" Body="&lt;p&gt;When I press &lt;kbd&gt;l&lt;/kbd&gt;&lt;kbd&gt;l&lt;/kbd&gt; in Magit's status buffer, then it shows a log buffer listing commits. Then I want to show details about the commit at point in another window, but at the same time I want to stay in the log buffer/window. If I press &lt;kbd&gt;RET&lt;/kbd&gt;, then it shows another buffer with details about the commit, but it also jumps into the new buffer. How to keep the log buffer selected?&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="306" LastEditDate="2016-10-14T11:48:26.987" LastActivityDate="2016-10-14T13:36:29.523" Title="How to view each commit in magit easily?" Tags="|magit|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27799" PostTypeId="2" ParentId="27779" CreationDate="2016-10-14T06:19:48.083" Score="12" Body="&lt;p&gt;For the interactive case query-replace-regexp (C-M-%) can do this, using the relatively unknown \, for the replacement. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-M-% \(string1\)\|\(string2\)&#xA;\,(if (equal \&amp;amp; &quot;string1&quot;) &quot;string2&quot; &quot;string1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the replacement text contains \, followed by a lisp expression, it uses the value of that expression as the replacement. In this case the expression is an &quot;if&quot; which takes a condition and the return value for the true and false cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the comments it is suggested to use &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;\,(if \1 &quot;string2&quot; &quot;string1&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This works because \1 will be &quot;string1&quot; if the pattern matches string1, and will be nil otherwise. Lisp takes any non-nil value as true. Whilst this works and is shorter, I think my answer is more useful. I think the code is more readable to someone whose lisp knowledge is limited. It has a second advantage as it still works if the &quot;from&quot; pattern is given as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\(string1\|string2\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or even&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;string1\|string2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2016-10-20T08:12:53.623" LastActivityDate="2016-10-20T08:12:53.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27800" PostTypeId="2" ParentId="27785" CreationDate="2016-10-14T07:38:54.803" Score="0" Body="&lt;p&gt;Solution: &lt;code&gt;cp path/to/eslint.cmd /usr/bin/flake8.cmd&lt;/code&gt;, then &lt;code&gt;vim flake8.cmd&lt;/code&gt;, edit exe and script names inside.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How I found that: I gave a second thought to &quot;why eslint just works?&quot; Because it's &lt;code&gt;eslint.js&lt;/code&gt;? I changed &lt;code&gt;flake8&lt;/code&gt; to &lt;code&gt;flake8.py&lt;/code&gt;, no luck. Thanks to &lt;code&gt;everything&lt;/code&gt;, I typed &lt;code&gt;eslint.&lt;/code&gt; in the search bar, and &lt;code&gt;eslint.cmd&lt;/code&gt; stood out. Then I cloned it to &lt;code&gt;flake8.cmd&lt;/code&gt; and problem's solved. I tried in both cygwin and dos terminals, &lt;code&gt;flake8&lt;/code&gt; can be invoked just like a command/exe. So I guess for everyone under Windows, the definition for &quot;executable&quot; is the same: &lt;code&gt;.exe&lt;/code&gt;s and &lt;code&gt;.cmd&lt;/code&gt;s (and some others).&lt;/p&gt;&#xA;" OwnerUserId="12854" LastActivityDate="2016-10-14T07:38:54.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27801" PostTypeId="2" ParentId="27793" CreationDate="2016-10-14T07:54:25.350" Score="2" Body="&lt;p&gt;You're probably using an old version of AUCTeX, which had indeed the bug you're reporting: &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22417&quot; rel=&quot;nofollow&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22417&lt;/a&gt;  This was due to an error in the &lt;code&gt;style/subfigure.el&lt;/code&gt; file in AUCTeX code and it was raised by a change in the syntax of &lt;code&gt;setq&lt;/code&gt; in Emacs 25 (now &lt;code&gt;setq&lt;/code&gt; takes an even number of arguments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you installed AUCTeX using the Emacs's built-in package manager (by far the best way to install it), you only have to update it (you should get version 11.89.5).&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-10-14T07:54:25.350" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27803" PostTypeId="2" ParentId="27767" CreationDate="2016-10-14T08:09:10.740" Score="1" Body="&lt;p&gt;The following advice does this stuff in a hacky way.&#xA;One disadvantage I am already aware of is that the spaces are also inserted into the message buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add #'message :filter-args #'message-filter-center)&#xA;&#xA;(defun message-filter-center (args)&#xA;  &quot;Center message string.&#xA;This is a :filter-args advice for `message`.&quot;&#xA;  (if (car args)&#xA;      (with-current-buffer (window-buffer (minibuffer-window))&#xA;    (let ((str (apply #'format-message args)))&#xA;      (list &quot;%s&quot; (propertize str 'line-prefix (list 'space :align-to (max 0 (/ (- (window-width (minibuffer-window)) (string-width str)) 2)))))))&#xA;    args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: After the comment of user:blujay I use the &lt;code&gt;line-prefix&lt;/code&gt; text property instead of the string composed of whitespaces. That text property gets through &lt;code&gt;message&lt;/code&gt;. Fiddling with the content of the message window directly is quite more involved.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've got the impression that the above version causes some strange problems (e.g., added space at the end of completed lisp-symbols on &lt;code&gt;C-h f&lt;/code&gt;).&#xA;Therefore, I also add the original version here which did not have these problems:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add #'message :filter-args #'message-filter-center)&#xA;&#xA;(defun message-filter-center (args)&#xA;  &quot;Center message string.&#xA;This is a :filter-args advice for `message`.&quot;&#xA;  (if (car args)&#xA;      (with-current-buffer (window-buffer (minibuffer-window))&#xA;    (let* ((str (apply #'format-message args))&#xA;           (filler (make-string (max 0 (/ (- (window-width (minibuffer-window)) (string-width str)) 2)) ? )))&#xA;      (list &quot;%s%s&quot; filler str)))&#xA;    args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-10-14T10:47:57.807" LastActivityDate="2016-10-14T10:47:57.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27804" PostTypeId="2" ParentId="27798" CreationDate="2016-10-14T09:02:56.707" Score="10" Body="&lt;p&gt;&lt;kbd&gt;SPC&lt;/kbd&gt; calls &lt;code&gt;magit-diff-show-or-scroll-up&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-10-14T09:02:56.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27805" PostTypeId="2" ParentId="27783" CreationDate="2016-10-14T09:56:51.533" Score="1" Body="&lt;p&gt;Try &lt;code&gt;helm-follow-mode&lt;/code&gt;, it should do the trick.&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2016-10-14T09:56:51.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27806" PostTypeId="2" ParentId="27797" CreationDate="2016-10-14T10:02:34.563" Score="0" Body="&lt;p&gt;&lt;code&gt;#+BEGIN_EXAMPLE&lt;/code&gt; is intended to be unbroken, as far as I know.  From the info page:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can include literal examples that should not be subjected to&#xA;  markup.  Such examples will be typeset in monospace, so this is well&#xA;  suited for source code and similar examples.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Probably the best way to handle this is to use a &lt;code&gt;#+BEGIN_HTML&lt;/code&gt; block and style it manually.  You could also insert line breaks manually in the &lt;code&gt;EXAMPLE&lt;/code&gt; block, but I doubt you want to do that.&lt;/p&gt;&#xA;" OwnerDisplayName="user3871" LastActivityDate="2016-10-14T10:02:34.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27807" PostTypeId="2" ParentId="27792" CreationDate="2016-10-14T10:12:10.610" Score="2" Body="&lt;p&gt;Adjusting Jack's answer slightly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun projectile-whitespace-cleanup-project-files ()&#xA;  &quot;Run `whitespace-cleanup' on all project files.&quot;&#xA;  (interactive)&#xA;  (dolist (file (projectile-current-project-files))&#xA;    (let ((path (concat (projectile-project-root) file)&#xA;          (buffer (find-file-noselect path)))&#xA;      (when buffer&#xA;        (with-current-buffer buffer&#xA;          (whitespace-cleanup)&#xA;          (save-buffer)&#xA;          (kill-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user3871" LastEditorDisplayName="user3871" LastEditDate="2016-10-21T01:25:54.337" LastActivityDate="2016-10-21T01:25:54.337" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27808" PostTypeId="2" ParentId="27798" CreationDate="2016-10-14T11:52:38.530" Score="8" Body="&lt;p&gt;Instead of &lt;kbd&gt;RET&lt;/kbd&gt; use &lt;kbd&gt;SPC&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first time you do that it will show the commit in a new buffer and display that buffer in another window, but it does not select that window/buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pressing &lt;kbd&gt;SPC&lt;/kbd&gt; again will scroll in the window which displays the commit buffer, so you don't even have to go to that buffer if some of its content is initially hidden because the window is to small.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-10-14T13:36:29.523" LastActivityDate="2016-10-14T13:36:29.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27809" PostTypeId="2" ParentId="27795" CreationDate="2016-10-14T13:20:56.507" Score="1" Body="&lt;p&gt;Yes, it's possible, but AFAIK noone has written the corresponding code.  This would need to be done via the &lt;code&gt;syntax-propertize-function&lt;/code&gt;, to place appropriate &lt;code&gt;syntax-table&lt;/code&gt; properties at the appropriate places.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be somewhat tricky to handle all cases, tho, such as when the conflict markers are within strings or comments.  But it's definitely worth a try and I'd welcome a patch to &lt;code&gt;smerge-mode&lt;/code&gt; to provide that functionality.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-14T13:20:56.507" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27810" PostTypeId="1" CreationDate="2016-10-14T14:59:47.160" Score="1" ViewCount="167" Body="&lt;p&gt;For me, &lt;code&gt;smerge-diff-mine-other&lt;/code&gt; seems to ignore changes in the number of whitespace characters where there is whitespace, but I would sometimes like it to ignore all whitespace, including newlines - even if a newline was inserted where the was no newline before. How can I achieve that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c C-w&lt;/code&gt; in the *vc-diff buffer created by &lt;code&gt;smerge-diff-mine-other&lt;/code&gt; doesn't seem to do anything.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2016-10-14T15:46:38.217" Title="Ignoring newline changes in smerge-diff-mine-other" Tags="|whitespace|diff|vc|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27811" PostTypeId="1" AcceptedAnswerId="27815" CreationDate="2016-10-14T15:06:09.897" Score="6" ViewCount="206" Body="&lt;p&gt;(I ask this question after reading &lt;a href=&quot;https://emacs.stackexchange.com/q/23933/184&quot;&gt;this one&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-e&quot;) &quot;e&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is, as far as I can tell, equivalent to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-e&quot;) (lambda () (interactive) (insert &quot;e&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, after evaluating &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-e&quot;) &quot;abcdeéfghij&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;pressing &lt;code&gt;M-e&lt;/code&gt; inserts &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abcde   fghij&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(3 spaces instead of &lt;code&gt;é&lt;/code&gt;). Looking up the keybinding, it appears that &lt;code&gt;M-e&lt;/code&gt; is not really bound to &lt;code&gt;(insert ...)&lt;/code&gt;, but rather to a keyboard macro inserting all these chars... except that the &lt;code&gt;é&lt;/code&gt; became a &lt;code&gt;M-i&lt;/code&gt;. With a &lt;code&gt;ê&lt;/code&gt; it's a linefeed (&lt;code&gt;M-j&lt;/code&gt;). With a &lt;code&gt;à&lt;/code&gt; it enters some menu (&lt;code&gt;M-backtick&lt;/code&gt;), and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there isn't any problem if I create a macro using the keys for these characters.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So, the question is simple: what is going on here?&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-10-14T16:49:40.173" Title="Key bound to string does not handle some chars in string correctly" Tags="|key-bindings|character-encoding|keyboard-macros|insert|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27812" PostTypeId="1" AcceptedAnswerId="27816" CreationDate="2016-10-14T15:14:29.687" Score="1" ViewCount="515" Body="&lt;p&gt;In many case, I often wants to send a org-mode subtree to certain file, at certain headline.  Here is an example workflow of such todo:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I capture any todos to &lt;code&gt;inbox.org&lt;/code&gt; first, as many todos occur asynchrounously, those pops into my mind.  Later, I view them in the agenda file, and start dispatching them into more adequate org file, at adequate headline (e.g. &lt;code&gt;projecta.org&lt;/code&gt;, &lt;code&gt;* todo&lt;/code&gt; heading)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wondered if I can achieve this in a existing elisp.  In more systematical description, I imagine it to be like an &lt;code&gt;org-capture&lt;/code&gt;, but it does not create a new entry; it sends current subtree to the whatever defined destination.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any such feature?&lt;/p&gt;&#xA;" OwnerUserId="9371" LastActivityDate="2016-10-14T17:58:51.187" Title="Send org-mode subtree to certain file, and headline" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27813" PostTypeId="2" ParentId="27811" CreationDate="2016-10-14T15:35:36.907" Score="5" Body="&lt;p&gt;global-set-key is just a thin wrapper around define-key, ignoring some error checking it is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun global-set-key (key def)&#xA;   (define-key (current-global-map) key def))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation for define-key says that the &quot;def&quot; can be a number of things, including&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a string (treated as a keyboard macro),&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So then there is the question about what something like ê is stored as. This typically has a character code of 0xea or 0x80+0x6a. 0x6a is the character code for j. The meta modifier is typically encoded as setting the top bit (0x80), hence ê being the same as M-j, and as a keyboard macro running something like comment-indent-newline.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-10-14T15:35:36.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27814" PostTypeId="2" ParentId="27810" CreationDate="2016-10-14T15:46:38.217" Score="2" Body="&lt;p&gt;Indeed, all those diff options work line-by-line, and insertion/removal of newlines creates completely different lines so they don't see those changes as &quot;just whitespace&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to use a word-based diff or something like that.  Emacs comes with one such functionality which is the &quot;refined&quot; highlighting.  It's available both in &lt;code&gt;smerge-mode&lt;/code&gt; and in &lt;code&gt;diff-mode&lt;/code&gt;.  IOW, try the &lt;code&gt;smerge-refine&lt;/code&gt; or &lt;code&gt;diff-refine-hunk&lt;/code&gt; commands, and if you like them you might like to set &lt;code&gt;diff-auto-refine-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-14T15:46:38.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27815" PostTypeId="2" ParentId="27811" CreationDate="2016-10-14T16:21:35.657" Score="4" Body="&lt;p&gt;What is going on is that string in Emacs have historically been used in this context for 2 different purposes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;sequence of &lt;em&gt;characters&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;sequence of &lt;em&gt;events&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In your case, you're writing what you think as a sequence of characters, but it's used in a context where Emacs expects a sequence of events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Emacs-19 added support for GUIs, events have become a lot more complex, so sequences of events can also be represented as &lt;em&gt;vectors&lt;/em&gt; rather than as &lt;em&gt;strings&lt;/em&gt;.  And this is usually the better option since it avoids this whole issue.  IOW I'd recommend you write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-e&quot;) [?a ?b ?c ?d ?e ?é ?f ?g ?h ?i ?j])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-e&quot;) (kbd &quot;abcdeéfghij&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or even&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [?\M-e] [?a ?b ?c ?d ?e ?é ?f ?g ?h ?i ?j])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;kbd&lt;/code&gt; is a function that turns a &quot;human readable&quot; string representation of events into an actual vector of events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; arguing that Emacs should figure out that the &lt;code&gt;é&lt;/code&gt; (character code 233 (which is 128 + 105 where 105 is the code of &lt;code&gt;i&lt;/code&gt; and 128 is the 7th bit that's used as the &lt;em&gt;meta&lt;/em&gt; modifier in some contexts)) is really just a character and not the &lt;code&gt;\M-i&lt;/code&gt; event, but it's probably difficult to fix this case without breaking existing code, since a lot of code still (mis)uses strings to represent sequences of events as if GUIs didn't exist.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-14T16:21:35.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27816" PostTypeId="2" ParentId="27812" CreationDate="2016-10-14T17:58:51.187" Score="5" Body="&lt;p&gt;It turned out that, &lt;code&gt;org-refile&lt;/code&gt; &lt;kbd&gt;C-c C-w&lt;/kbd&gt; is what I wanted.&lt;/p&gt;&#xA;" OwnerUserId="9371" LastActivityDate="2016-10-14T17:58:51.187" CommentCount="0" CommunityOwnedDate="2016-10-14T17:58:51.187" ContentLicense="CC BY-SA 3.0" />
  <row Id="27817" PostTypeId="1" CreationDate="2016-10-14T18:34:24.237" Score="1" ViewCount="50" Body="&lt;p&gt;I have &lt;code&gt;ido-use-virtual-buffers&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;, so when I &lt;code&gt;M-x ido-switch-buffer&lt;/code&gt;, I initially see a list of files with the most recent files at the top.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as soon as I type anything to filter the list of matching buffers, the view switches to a different sort order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to retain the sorting by recentness even when the list is filtered in this way?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-10-14T18:34:24.237" Title="Sort ido results by recentness even when filtered" Tags="|ido|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27818" PostTypeId="1" CreationDate="2016-10-14T19:01:20.373" Score="0" ViewCount="57" Body="&lt;p&gt;It is from yesterday that emacs behaves in an unexpected way, as I will now explain.&#xA;If I open emacs and I open the minibuffer with C-x C-f and the I press M-0 C-k, emacs deletes the line, this is the normal behaviour.&#xA;If now I exit from the minibuffer, pressing for instance C-g and the I reenter with C-x C-f and I press again M-0 C-k, this error appears! &lt;a href=&quot;https://i.stack.imgur.com/fNRnA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fNRnA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anybody any idea of what it may be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the moment I delete the line using C-a C-k, but I would like to understand why the second time that I try M-0 C-k it gives me an error and not the first, also this behaviour appeared recently (I am installing a lot of packages, it may be that, I do not know). &#xA;What about your emacs? How does it behave?&lt;/p&gt;&#xA;" OwnerUserId="13656" LastEditorUserId="13656" LastEditDate="2016-10-14T19:12:05.110" LastActivityDate="2016-10-14T19:12:05.110" Title="Error when typing C-0 C-k in minibuffer" Tags="|minibuffer|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27820" PostTypeId="2" ParentId="12249" CreationDate="2016-10-14T21:18:45.367" Score="2" Body="&lt;p&gt;In case of evil mode, you can do like this  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'neotree-mode-hook&#xA;      (lambda ()&#xA;        (define-key evil-normal-state-local-map (kbd &quot;TAB&quot;) 'neotree-enter-vertical-split)&#xA;        (define-key evil-normal-state-local-map (kbd &quot;SPC&quot;) 'neotree-enter-horizontal-split)&#xA;        (define-key evil-normal-state-local-map (kbd &quot;q&quot;) 'neotree-hide)&#xA;        (define-key evil-normal-state-local-map (kbd &quot;RET&quot;) 'neotree-enter)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13658" LastActivityDate="2016-10-14T21:18:45.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27821" PostTypeId="1" CreationDate="2016-10-14T21:56:19.113" Score="9" ViewCount="5578" Body="&lt;p&gt;I use (global-hl-line-mode 1) in order to highlight the current line.&#xA;This changes the text colours of the highlighted line. Is it possible to highlight while keeping the current syntax highlighting colours (so changing only the background)?&lt;/p&gt;&#xA;" OwnerUserId="13656" LastEditorUserId="105" LastEditDate="2016-12-22T17:29:27.960" LastActivityDate="2019-11-22T09:30:00.513" Title="Highlight current line without changing colours" Tags="|syntax-highlighting|highlighting|hl-line-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27822" PostTypeId="1" CreationDate="2016-10-14T22:11:11.893" Score="2" ViewCount="277" Body="&lt;p&gt;I'm fairly new to the Mac, and I've started using Emacs. I've noticed that the scroll-down command, bound to Meta-v, works okay to scroll the visible portion of the buffer, except that it doesn't move point to the very top of the buffer, the behavior that I'm used to in Windows. Nor does Ctrl-v move point to the very bottom of the buffer. Why is this, and how can I change it to match Windows?&lt;/p&gt;&#xA;" OwnerUserId="12845" LastActivityDate="2016-11-14T03:55:02.257" Title="on Mac, scroll-down or scroll-up don't move point to very top/bottom" Tags="|scrolling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27823" PostTypeId="2" ParentId="27821" CreationDate="2016-10-15T00:00:50.367" Score="5" Body="&lt;p&gt;This is the case by default for me: &lt;code&gt;hl-line-mode&lt;/code&gt; by default uses a face which only specifies a background color.  That face is &lt;code&gt;hl-line&lt;/code&gt; which by default just inherits from &lt;code&gt;highlight&lt;/code&gt;.  So maybe the problem is simply your that &lt;code&gt;highlight&lt;/code&gt; face specifies both a background and a foreground color.  I recommend you &lt;code&gt;M-x customize-face&lt;/code&gt; and either change your &lt;code&gt;highlight&lt;/code&gt; face or your &lt;code&gt;hl-line&lt;/code&gt; face so as to keep its foreground color unspecified.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-15T00:00:50.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27825" PostTypeId="2" ParentId="27822" CreationDate="2016-10-15T02:46:45.543" Score="2" Body="&lt;p&gt;Scrolling doesn't move point, unless it has to because point would otherwise be outside the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Scrolling.html&quot; rel=&quot;nofollow&quot;&gt;Scrolling&lt;/a&gt; explains this and more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see there, you can control how much overlap there is when you scroll a &quot;windowful&quot;, using option &lt;code&gt;next-screen-context-lines&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can customize option &lt;strong&gt;&lt;code&gt;scroll-error-top-bottom&lt;/code&gt;&lt;/strong&gt; to &lt;code&gt;t&lt;/code&gt; to get the behavior you are used to: &lt;code&gt;M-x customize-option scroll-error-top-bottom&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you are fairly new to Emacs, here is the first and &lt;em&gt;most important&lt;/em&gt; thing to learn: &lt;strong&gt;&lt;em&gt;Ask Emacs&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h r&lt;/code&gt;&lt;/strong&gt; puts you in the Emacs manual, which is hypertext linked. When in a manual, you can use &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt; and type some text plus &lt;code&gt;TAB&lt;/code&gt; to complete, to look something up in the index and go to it in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, I did &lt;code&gt;C-h r&lt;/code&gt;, then &lt;code&gt;i scroll TAB&lt;/code&gt;, and I chose the index entry &lt;code&gt;scrolling&lt;/code&gt;, which took me directly to the node (page) of the manual cited above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h C-h&lt;/code&gt;&lt;/strong&gt; is the general Help entry point (all help commands use the prefix &lt;code&gt;C-h&lt;/code&gt;). Try it, to learn more about how to &lt;strong&gt;ask Emacs&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-15T02:46:45.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27826" PostTypeId="1" CreationDate="2016-10-15T03:11:14.980" Score="1" ViewCount="1939" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5LLHF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5LLHF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed the latest version of MacTex, and I am sure the latex is in the Libray/TeX/texbin/, I just don't know how to set the PATH variable, also I cannot install the AUCtex, I assume these two are the same PATH problem. I have no idea how to solve these. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/G2MAW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/G2MAW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12702" LastActivityDate="2018-04-06T21:45:21.860" Title="How to set PATH variable to latex, so that I can use latex layer?" Tags="|latex|auctex|spacemacs|path|" AnswerCount="1" CommentCount="7" ClosedDate="2018-04-06T23:29:42.157" ContentLicense="CC BY-SA 3.0" />
  <row Id="27827" PostTypeId="1" AcceptedAnswerId="27828" CreationDate="2016-10-15T07:55:16.493" Score="2" ViewCount="860" Body="&lt;p&gt;Org mode headlines are turned into &lt;code&gt;section{...}&lt;/code&gt;,&#xA;&lt;code&gt;subsection{...}&lt;/code&gt;, &amp;amp;c. when exported to LaTeX.  How can I ignore&#xA;them instead, making the org structure invisible in the exported&#xA;document? (preferably allowing normal behaviour only when a&#xA;certain tag (:head:) is present, but I would rather disable &#xA;automatic sectioning altogether than keep the default behaviour.)&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2016-10-15T08:08:47.443" LastActivityDate="2018-11-22T13:43:21.973" Title="Omitting headlines when exporting from org mode to LaTeX" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27828" PostTypeId="2" ParentId="27827" CreationDate="2016-10-15T10:35:56.503" Score="4" Body="&lt;p&gt;&lt;code&gt;org-plus-contrib&lt;/code&gt; package and org-mode git repo contain &lt;code&gt;ox-extra.el&lt;/code&gt;. You can extend its functionality (see &lt;a href=&quot;https://github.com/boykov/org-mode/compare/ox-extra-notignore&quot; rel=&quot;nofollow&quot;&gt;https://github.com/boykov/org-mode/compare/ox-extra-notignore&lt;/a&gt;) and use &lt;code&gt;notignore-headlines&lt;/code&gt; with &lt;em&gt;:notignore:&lt;/em&gt; tag instead of &lt;code&gt;ignore-headlines&lt;/code&gt; with &lt;em&gt;:ignore:&lt;/em&gt; tag. &lt;/p&gt;&#xA;" OwnerUserId="2064" LastActivityDate="2016-10-15T10:35:56.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27829" PostTypeId="1" AcceptedAnswerId="27880" CreationDate="2016-10-15T10:43:19.333" Score="1" ViewCount="192" Body="&lt;p&gt;I use the exam document class in auctex to write exams for my students. I want to use the features provided by the outline-minor-mode to hide all the exercises I have finished  and only show the one I am editing.&#xA;In the exam class there is \question macro for writing exercises. &#xA;here is an example :&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{exam}&#xA;\begin{document}&#xA;\begin{questions}&#xA;\question % exercise N°1&#xA;     statement of exercise 1&#xA;\question % exercise N°2&#xA;    statement of exercise 2&#xA;\question % exercise N° 3&#xA;     statement of exercise 3&#xA;\end{questions}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want for example to hide the statements of exercise 1 and 3 when I edit the statement of exercise 2!&#xA;So I have add  \question to the heading list of auctex with the variable TeX-outline-extra like this:&#xA;&lt;code&gt;M-x (setq TeX-outline-extra '((&quot;\question&quot; 1)))&lt;/code&gt;&#xA;But \question is not recognized as a heading as expected!&lt;/p&gt;&#xA;" OwnerUserId="12607" LastEditorUserId="12242" LastEditDate="2016-10-17T10:39:57.057" LastActivityDate="2016-10-17T13:17:17.147" Title="How to use outline-minor-mode to hide some exam class exercises in auctex" Tags="|auctex|outline|visibility|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27830" PostTypeId="1" CreationDate="2016-10-15T11:59:25.423" Score="1" ViewCount="1485" Body="&lt;p&gt;I have Emacs 24 running in Linux Mint 18 Xfce.  As shown in the picture below by the red arrows, how can I decrease the width of the gray zones that are to the left/right of each Emacs window? The so-called &quot;padding&quot;, I guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KpZP8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KpZP8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="105" LastEditDate="2016-10-15T15:53:36.847" LastActivityDate="2016-10-15T15:53:36.847" Title="Emacs change window fringes (vertical padding)?" Tags="|init-file|frames|fringe|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27831" PostTypeId="1" AcceptedAnswerId="27833" CreationDate="2016-10-15T12:36:24.187" Score="0" ViewCount="319" Body="&lt;p&gt;my question is pretty basic but I don't know how to create yasnippets properly. I have created some snippets for &lt;code&gt;Java&lt;/code&gt; or &lt;code&gt;html&lt;/code&gt; with &lt;code&gt;yas-new-snippets&lt;/code&gt;, installed them under emacs.d/snippets/org-mode, but they only work when I invoke them from &lt;code&gt;org-mode&lt;/code&gt; , not from Java-mode (or JDEE) or html-mode, which is not very useful...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my config file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path&#xA;         &quot;~/.emacs.d/elpa/yasnippet-20160801.1142&quot;)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;(add-to-list 'yas-snippet-dirs &quot;~/.emacs.d/snippets&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;yas-snippet-dirs&lt;/code&gt; yields:&#xA;(&quot;~/.emacs.d/snippets&quot; &quot;/Users/me/.emacs.d/snippets&quot; yas-installed-snippets-dir) so I tried to put directly under .emacs.d/snippets/ but they are not recognized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13074" LastActivityDate="2016-10-15T12:45:41.430" Title="snippet not recognized -- yasnippet" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27832" PostTypeId="1" AcceptedAnswerId="27836" CreationDate="2016-10-15T12:39:53.493" Score="1" ViewCount="527" Body="&lt;p&gt;I am using emacs daemon, and with the default config for js, jsx:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(flycheck-add-mode 'javascript-eslint 'web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I edit *.html.erb files, I have an error: &lt;strong&gt;Parsing error: Unexpected token&lt;/strong&gt; at &lt;code&gt;&amp;lt;%=&lt;/code&gt; or &lt;code&gt;&amp;lt;%&lt;/code&gt; on ruby code block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think &lt;code&gt;javascript-eslint&lt;/code&gt; causes the problem. So, How do I select another flycheck checker or just disable automatically flycheck when I open *.html.erb files on web-mode?&lt;/p&gt;&#xA;" OwnerUserId="13662" LastActivityDate="2016-10-15T13:53:10.640" Title="How do I enable/disable flycheck when changing buffer content-type of web-mode" Tags="|web-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27833" PostTypeId="2" ParentId="27831" CreationDate="2016-10-15T12:45:41.430" Score="2" Body="&lt;p&gt;Did you use the right table ?  &lt;code&gt;yas-new-snippet&lt;/code&gt; creates the snippets for org mode if you use it in an org-mode buffer, except you changed the table manually. In other words, each major-mode got its own snippets and snippet directory.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-10-15T12:45:41.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27834" PostTypeId="1" AcceptedAnswerId="27875" CreationDate="2016-10-15T12:49:42.410" Score="3" ViewCount="2482" Body="&lt;p&gt;I recently installed Spacemacs and am new to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.200.2@24.5.2 (spacemacs) / 14.04 Ubuntu&lt;/p&gt;&#xA;&#xA;&lt;p&gt;same problem with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.200.2@26.0.50.2 (spacemacs) / 14.04 Ubuntu&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Syntax Checking etc. is working fine, but i cannot get code completion to work when working on a python file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to get a popup on &quot;.&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If i execute &quot;M-x company-jedi&quot;, i get a popup window with completions, but not for &quot;M-x company-anaconda&quot;. Error: &quot;Cannot complete at point&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i track down what is wrong? Could you please give me a step-by-step help, since i am relatively new? Thank you very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my dotfile, the only file i changed since installation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- mode: emacs-lisp -*-&#xA;;; This file is loaded by Spacemacs at startup.&#xA;;; It must be stored in your home directory.&#xA;&#xA;(defun dotspacemacs/layers ()&#xA;  &quot;Configuration Layers declaration.&#xA;You should not put any user code in this function besides modifying the variable&#xA;values.&quot;&#xA;  (setq-default&#xA;   ;; Base distribution to use. This is a layer contained in the directory&#xA;   ;; `+distribution'. For now available distributions are `spacemacs-base'&#xA;   ;; or `spacemacs'. (default 'spacemacs)&#xA;   dotspacemacs-distribution 'spacemacs&#xA;   ;; Lazy installation of layers (i.e. layers are installed only when a file&#xA;   ;; with a supported type is opened). Possible values are `all', `unused'&#xA;   ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers&#xA;   ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will&#xA;   ;; lazy install any layer that support lazy installation even the layers&#xA;   ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy&#xA;   ;; installation feature and you have to explicitly list a layer in the&#xA;   ;; variable `dotspacemacs-configuration-layers' to install it.&#xA;   ;; (default 'unused)&#xA;   dotspacemacs-enable-lazy-installation 'unused&#xA;   ;; If non-nil then Spacemacs will ask for confirmation before installing&#xA;   ;; a layer lazily. (default t)&#xA;   dotspacemacs-ask-for-lazy-installation t&#xA;   ;; If non-nil layers with lazy install support are lazy installed.&#xA;   ;; List of additional paths where to look for configuration layers.&#xA;   ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')&#xA;   dotspacemacs-configuration-layer-path '()&#xA;   ;; List of configuration layers to load.&#xA;   dotspacemacs-configuration-layers&#xA;   '(&#xA;     ;; ----------------------------------------------------------------&#xA;     ;; Example of useful layers you may want to use right away.&#xA;     ;; Uncomment some layer names and press &amp;lt;SPC f e R&amp;gt; (Vim style) or&#xA;     ;; &amp;lt;M-m f e R&amp;gt; (Emacs style) to install them.&#xA;     ;; ----------------------------------------------------------------&#xA;     helm&#xA;     python&#xA;     auto-completion&#xA;     better-defaults&#xA;     emacs-lisp&#xA;     git&#xA;     markdown&#xA;     org&#xA;     (shell :variables&#xA;            shell-default-height 30&#xA;            shell-default-position 'bottom)&#xA;     spell-checking&#xA;     syntax-checking&#xA;     version-control&#xA;     )&#xA;   ;; List of additional packages that will be installed without being&#xA;   ;; wrapped in a layer. If you need some configuration for these&#xA;   ;; packages, then consider creating a layer. You can also put the&#xA;   ;; configuration in `dotspacemacs/user-config'.&#xA;   dotspacemacs-additional-packages &#xA;   '(&#xA;     company-jedi&#xA;   )&#xA;   ;; A list of packages that cannot be updated.&#xA;   dotspacemacs-frozen-packages '()&#xA;   ;; A list of packages that will not be installed and loaded.&#xA;   dotspacemacs-excluded-packages '()&#xA;   ;; Defines the behaviour of Spacemacs when installing packages.&#xA;   ;; Possible values are `used-only', `used-but-keep-unused' and `all'.&#xA;   ;; `used-only' installs only explicitly used packages and uninstall any&#xA;   ;; unused packages as well as their unused dependencies.&#xA;   ;; `used-but-keep-unused' installs only the used packages but won't uninstall&#xA;   ;; them if they become unused. `all' installs *all* packages supported by&#xA;   ;; Spacemacs and never uninstall them. (default is `used-only')&#xA;   dotspacemacs-install-packages 'used-only))&#xA;&#xA;(defun dotspacemacs/init ()&#xA;  &quot;Initialization function.&#xA;This function is called at the very startup of Spacemacs initialization&#xA;before layers configuration.&#xA;You should not put any user code in there besides modifying the variable&#xA;values.&quot;&#xA;  ;; This setq-default sexp is an exhaustive list of all the supported&#xA;  ;; spacemacs settings.&#xA;  (setq-default&#xA;   ;; If non nil ELPA repositories are contacted via HTTPS whenever it's&#xA;   ;; possible. Set it to nil if you have no way to use HTTPS in your&#xA;   ;; environment, otherwise it is strongly recommended to let it set to t.&#xA;   ;; This variable has no effect if Emacs is launched with the parameter&#xA;   ;; `--insecure' which forces the value of this variable to nil.&#xA;   ;; (default t)&#xA;   dotspacemacs-elpa-https t&#xA;   ;; Maximum allowed time in seconds to contact an ELPA repository.&#xA;   dotspacemacs-elpa-timeout 5&#xA;   ;; If non nil then spacemacs will check for updates at startup&#xA;   ;; when the current branch is not `develop'. Note that checking for&#xA;   ;; new versions works via git commands, thus it calls GitHub services&#xA;   ;; whenever you start Emacs. (default nil)&#xA;   dotspacemacs-check-for-update nil&#xA;   ;; If non-nil, a form that evaluates to a package directory. For example, to&#xA;   ;; use different package directories for different Emacs versions, set this&#xA;   ;; to `emacs-version'.&#xA;   dotspacemacs-elpa-subdirectory nil&#xA;   ;; One of `vim', `emacs' or `hybrid'.&#xA;   ;; `hybrid' is like `vim' except that `insert state' is replaced by the&#xA;   ;; `hybrid state' with `emacs' key bindings. The value can also be a list&#xA;   ;; with `:variables' keyword (similar to layers). Check the editing styles&#xA;   ;; section of the documentation for details on available variables.&#xA;   ;; (default 'vim)&#xA;   dotspacemacs-editing-style 'vim&#xA;   ;; If non nil output loading progress in `*Messages*' buffer. (default nil)&#xA;   dotspacemacs-verbose-loading nil&#xA;   ;; Specify the startup banner. Default value is `official', it displays&#xA;   ;; the official spacemacs logo. An integer value is the index of text&#xA;   ;; banner, `random' chooses a random text banner in `core/banners'&#xA;   ;; directory. A string value must be a path to an image format supported&#xA;   ;; by your Emacs build.&#xA;   ;; If the value is nil then no banner is displayed. (default 'official)&#xA;   dotspacemacs-startup-banner 'official&#xA;   ;; List of items to show in startup buffer or an association list of&#xA;   ;; the form `(list-type . list-size)`. If nil then it is disabled.&#xA;   ;; Possible values for list-type are:&#xA;   ;; `recents' `bookmarks' `projects' `agenda' `todos'.&quot;&#xA;   ;; Example for 5 recent files and 7 projects: '((recents . 5) (projects . 7))&#xA;   ;; List sizes may be nil, in which case&#xA;   ;; `spacemacs-buffer-startup-lists-length' takes effect.&#xA;   ;; (default nil)&#xA;   dotspacemacs-startup-lists '()&#xA;   ;; True if the home buffer should respond to resize events.&#xA;   dotspacemacs-startup-buffer-responsive t&#xA;   ;; Default major mode of the scratch buffer (default `text-mode')&#xA;   dotspacemacs-scratch-mode 'text-mode&#xA;   ;; List of themes, the first of the list is loaded when spacemacs starts.&#xA;   ;; Press &amp;lt;SPC&amp;gt; T n to cycle to the next theme in the list (works great&#xA;   ;; with 2 themes variants, one dark and one light)&#xA;   dotspacemacs-themes '(spacemacs-dark&#xA;                         spacemacs-light)&#xA;   ;; If non nil the cursor color matches the state color in GUI Emacs.&#xA;   dotspacemacs-colorize-cursor-according-to-state t&#xA;   ;; Default font, or prioritized list of fonts. `powerline-scale' allows to&#xA;   ;; quickly tweak the mode-line size to make separators look not too crappy.&#xA;   dotspacemacs-default-font '(&quot;Source Code Pro&quot;&#xA;                               :size 13&#xA;                               :weight normal&#xA;                               :width normal&#xA;                               :powerline-scale 1.1)&#xA;   ;; The leader key&#xA;   dotspacemacs-leader-key &quot;SPC&quot;&#xA;   ;; The key used for Emacs commands (M-x) (after pressing on the leader key).&#xA;   ;; (default &quot;SPC&quot;)&#xA;   dotspacemacs-emacs-command-key &quot;SPC&quot;&#xA;   ;; The key used for Vim Ex commands (default &quot;:&quot;)&#xA;   dotspacemacs-ex-command-key &quot;:&quot;&#xA;   ;; The leader key accessible in `emacs state' and `insert state'&#xA;   ;; (default &quot;M-m&quot;)&#xA;   dotspacemacs-emacs-leader-key &quot;M-m&quot;&#xA;   ;; Major mode leader key is a shortcut key which is the equivalent of&#xA;   ;; pressing `&amp;lt;leader&amp;gt; m`. Set it to `nil` to disable it. (default &quot;,&quot;)&#xA;   dotspacemacs-major-mode-leader-key &quot;,&quot;&#xA;   ;; Major mode leader key accessible in `emacs state' and `insert state'.&#xA;   ;; (default &quot;C-M-m)&#xA;   dotspacemacs-major-mode-emacs-leader-key &quot;C-M-m&quot;&#xA;   ;; These variables control whether separate commands are bound in the GUI to&#xA;   ;; the key pairs C-i, TAB and C-m, RET.&#xA;   ;; Setting it to a non-nil value, allows for separate commands under &amp;lt;C-i&amp;gt;&#xA;   ;; and TAB or &amp;lt;C-m&amp;gt; and RET.&#xA;   ;; In the terminal, these pairs are generally indistinguishable, so this only&#xA;   ;; works in the GUI. (default nil)&#xA;   dotspacemacs-distinguish-gui-tab nil&#xA;   ;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)&#xA;   dotspacemacs-remap-Y-to-y$ nil&#xA;   ;; If non-nil, the shift mappings `&amp;lt;' and `&amp;gt;' retain visual state if used&#xA;   ;; there. (default t)&#xA;   dotspacemacs-retain-visual-state-on-shift t&#xA;   ;; If non-nil, J and K move lines up and down when in visual mode.&#xA;   ;; (default nil)&#xA;   dotspacemacs-visual-line-move-text nil&#xA;   ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.&#xA;   ;; (default nil)&#xA;   dotspacemacs-ex-substitute-global nil&#xA;   ;; Name of the default layout (default &quot;Default&quot;)&#xA;   dotspacemacs-default-layout-name &quot;Default&quot;&#xA;   ;; If non nil the default layout name is displayed in the mode-line.&#xA;   ;; (default nil)&#xA;   dotspacemacs-display-default-layout nil&#xA;   ;; If non nil then the last auto saved layouts are resume automatically upon&#xA;   ;; start. (default nil)&#xA;   dotspacemacs-auto-resume-layouts nil&#xA;   ;; Size (in MB) above which spacemacs will prompt to open the large file&#xA;   ;; literally to avoid performance issues. Opening a file literally means that&#xA;   ;; no major mode or minor modes are active. (default is 1)&#xA;   dotspacemacs-large-file-size 1&#xA;   ;; Location where to auto-save files. Possible values are `original' to&#xA;   ;; auto-save the file in-place, `cache' to auto-save the file to another&#xA;   ;; file stored in the cache directory and `nil' to disable auto-saving.&#xA;   ;; (default 'cache)&#xA;   dotspacemacs-auto-save-file-location 'cache&#xA;   ;; Maximum number of rollback slots to keep in the cache. (default 5)&#xA;   dotspacemacs-max-rollback-slots 5&#xA;   ;; If non nil, `helm' will try to minimize the space it uses. (default nil)&#xA;   dotspacemacs-helm-resize nil&#xA;   ;; if non nil, the helm header is hidden when there is only one source.&#xA;   ;; (default nil)&#xA;   dotspacemacs-helm-no-header nil&#xA;   ;; define the position to display `helm', options are `bottom', `top',&#xA;   ;; `left', or `right'. (default 'bottom)&#xA;   dotspacemacs-helm-position 'bottom&#xA;   ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching&#xA;   ;; in all non-asynchronous sources. If set to `source', preserve individual&#xA;   ;; source settings. Else, disable fuzzy matching in all sources.&#xA;   ;; (default 'always)&#xA;   dotspacemacs-helm-use-fuzzy 'always&#xA;   ;; If non nil the paste micro-state is enabled. When enabled pressing `p`&#xA;   ;; several times cycle between the kill ring content. (default nil)&#xA;   dotspacemacs-enable-paste-transient-state nil&#xA;   ;; Which-key delay in seconds. The which-key buffer is the popup listing&#xA;   ;; the commands bound to the current keystroke sequence. (default 0.4)&#xA;   dotspacemacs-which-key-delay 0.4&#xA;   ;; Which-key frame position. Possible values are `right', `bottom' and&#xA;   ;; `right-then-bottom'. right-then-bottom tries to display the frame to the&#xA;   ;; right; if there is insufficient space it displays it at the bottom.&#xA;   ;; (default 'bottom)&#xA;   dotspacemacs-which-key-position 'bottom&#xA;   ;; If non nil a progress bar is displayed when spacemacs is loading. This&#xA;   ;; may increase the boot time on some systems and emacs builds, set it to&#xA;   ;; nil to boost the loading time. (default t)&#xA;   dotspacemacs-loading-progress-bar t&#xA;   ;; If non nil the frame is fullscreen when Emacs starts up. (default nil)&#xA;   ;; (Emacs 24.4+ only)&#xA;   dotspacemacs-fullscreen-at-startup nil&#xA;   ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.&#xA;   ;; Use to disable fullscreen animations in OSX. (default nil)&#xA;   dotspacemacs-fullscreen-use-non-native nil&#xA;   ;; If non nil the frame is maximized when Emacs starts up.&#xA;   ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.&#xA;   ;; (default nil) (Emacs 24.4+ only)&#xA;   dotspacemacs-maximized-at-startup nil&#xA;   ;; A value from the range (0..100), in increasing opacity, which describes&#xA;   ;; the transparency level of a frame when it's active or selected.&#xA;   ;; Transparency can be toggled through `toggle-transparency'. (default 90)&#xA;   dotspacemacs-active-transparency 90&#xA;   ;; A value from the range (0..100), in increasing opacity, which describes&#xA;   ;; the transparency level of a frame when it's inactive or deselected.&#xA;   ;; Transparency can be toggled through `toggle-transparency'. (default 90)&#xA;   dotspacemacs-inactive-transparency 90&#xA;   ;; If non nil show the titles of transient states. (default t)&#xA;   dotspacemacs-show-transient-state-title t&#xA;   ;; If non nil show the color guide hint for transient state keys. (default t)&#xA;   dotspacemacs-show-transient-state-color-guide t&#xA;   ;; If non nil unicode symbols are displayed in the mode line. (default t)&#xA;   dotspacemacs-mode-line-unicode-symbols t&#xA;   ;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth&#xA;   ;; scrolling overrides the default behavior of Emacs which recenters point&#xA;   ;; when it reaches the top or bottom of the screen. (default t)&#xA;   dotspacemacs-smooth-scrolling t&#xA;   ;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'&#xA;   ;; derivatives. If set to `relative', also turns on relative line numbers.&#xA;   ;; (default nil)&#xA;   dotspacemacs-line-numbers nil&#xA;   ;; Code folding method. Possible values are `evil' and `origami'.&#xA;   ;; (default 'evil)&#xA;   dotspacemacs-folding-method 'evil&#xA;   ;; If non-nil smartparens-strict-mode will be enabled in programming modes.&#xA;   ;; (default nil)&#xA;   dotspacemacs-smartparens-strict-mode nil&#xA;   ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes&#xA;   ;; over any automatically added closing parenthesis, bracket, quote, etc…&#xA;   ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)&#xA;   dotspacemacs-smart-closing-parenthesis nil&#xA;   ;; Select a scope to highlight delimiters. Possible values are `any',&#xA;   ;; `current', `all' or `nil'. Default is `all' (highlight any scope and&#xA;   ;; emphasis the current one). (default 'all)&#xA;   dotspacemacs-highlight-delimiters 'all&#xA;   ;; If non nil, advise quit functions to keep server open when quitting.&#xA;   ;; (default nil)&#xA;   dotspacemacs-persistent-server nil&#xA;   ;; List of search tool executable names. Spacemacs uses the first installed&#xA;   ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.&#xA;   ;; (default '(&quot;ag&quot; &quot;pt&quot; &quot;ack&quot; &quot;grep&quot;))&#xA;   dotspacemacs-search-tools '(&quot;ag&quot; &quot;pt&quot; &quot;ack&quot; &quot;grep&quot;)&#xA;   ;; The default package repository used if no explicit repository has been&#xA;   ;; specified with an installed package.&#xA;   ;; Not used for now. (default nil)&#xA;   dotspacemacs-default-package-repository nil&#xA;   ;; Delete whitespace while saving buffer. Possible values are `all'&#xA;   ;; to aggressively delete empty line and long sequences of whitespace,&#xA;   ;; `trailing' to delete only the whitespace at end of lines, `changed'to&#xA;   ;; delete only whitespace for changed lines or `nil' to disable cleanup.&#xA;   ;; (default nil)&#xA;   dotspacemacs-whitespace-cleanup nil&#xA;   ))&#xA;&#xA;(defun dotspacemacs/user-init ()&#xA;  &quot;Initialization function for user code.&#xA;It is called immediately after `dotspacemacs/init', before layer configuration&#xA;executes.&#xA; This function is mostly useful for variables that need to be set&#xA;before packages are loaded. If you are unsure, you should try in setting them in&#xA;`dotspacemacs/user-config' first.&quot;&#xA;  )&#xA;&#xA;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA;This function is called at the very end of Spacemacs initialization after&#xA;layers configuration.&#xA;This is the place where most of your configurations should be done. Unless it is&#xA;explicitly specified that a variable should be set before a package is loaded,&#xA;you should place your code here.&quot;&#xA;  )&#xA;&#xA;;; Do not write anything past this comment. This is where Emacs will&#xA;;; auto-generate custom variable definitions.&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(company-backends (quote (company-capf)))&#xA; '(package-selected-packages&#xA;   (quote&#xA;    (helm-company helm-c-yasnippet company-anaconda company auto-yasnippet yasnippet ac-ispell auto-complete yapfify pyvenv pytest pyenv-mode py-isort pip-requirements live-py-mode hy-mode helm-pydoc cython-mode anaconda-mode pythonic ws-butler window-numbering which-key volatile-highlights vi-tilde-fringe uuidgen use-package toc-org spaceline powerline restart-emacs request rainbow-delimiters popwin persp-mode pcre2el paradox org-plus-contrib org-bullets open-junk-file neotree move-text macrostep lorem-ipsum linum-relative link-hint info+ indent-guide ido-vertical-mode hydra hungry-delete hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation help-fns+ helm-themes helm-swoop helm-projectile helm-mode-manager helm-make projectile pkg-info epl helm-flx helm-descbinds helm-ag google-translate golden-ratio flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg undo-tree eval-sexp-fu highlight elisp-slime-nav dumb-jump f s diminish define-word column-enforce-mode clean-aindent-mode bind-map bind-key auto-highlight-symbol auto-compile packed dash aggressive-indent ace-window ace-link ace-jump-helm-line helm avy helm-core popup async quelpa package-build spacemacs-theme))))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13663" LastEditorUserId="13663" LastEditDate="2016-10-15T15:55:20.853" LastActivityDate="2016-10-17T07:58:48.783" Title="Spacemacs: Company-Anaconda doesnt work" Tags="|python|spacemacs|company-mode|debugging|jedi|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27835" PostTypeId="2" ParentId="27830" CreationDate="2016-10-15T13:13:05.513" Score="2" Body="&lt;p&gt;That's called the fringe. You can indeed turn it off or control it's size; see the documentation for the &lt;code&gt;fringe-mode&lt;/code&gt; function (type &lt;code&gt;C-h f fringe-mode RET&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-15T13:13:05.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27836" PostTypeId="2" ParentId="27832" CreationDate="2016-10-15T13:53:10.640" Score="1" Body="&lt;p&gt;You can select the flycheck linter by doing this :- &lt;code&gt;M-x&lt;/code&gt; RET &lt;code&gt;flycheck-select-checker&lt;/code&gt; RET and chose the linter you need and press RET. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for disabling flycheck for &lt;code&gt;web-mode&lt;/code&gt; just for &lt;code&gt;*.html.erb&lt;/code&gt; files, add this to your &lt;code&gt;.emacs&lt;/code&gt; :-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist&#xA;             '(&quot;\\.html.erb\\'&quot; . (lambda ()&#xA;                                    (web-mode)&#xA;                                    (flycheck-mode -1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-15T13:53:10.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27837" PostTypeId="1" AcceptedAnswerId="27838" CreationDate="2016-10-15T14:41:33.180" Score="2" ViewCount="681" Body="&lt;p&gt;I have a dired workflow that I like. From a file-visiting buffer, I'll use &lt;code&gt;dired-jump&lt;/code&gt; to pop up to the containing directory. Dired renders the directory in a new buffer with the cursor on the file-entry I came from. Another &lt;code&gt;dired-jump&lt;/code&gt; puts me in the parent directory with the cursor on the subdirectory I was in. This makes it easy to drill back down with a series of Return keypresses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside is that dired generates a lot of buffers in order to build such a &quot;breadcrumb&quot; trail. I mitigate this somewhat by reusing buffers on my way down, using &lt;code&gt;dired-find-alternate-file&lt;/code&gt;. But I still end up with multiple dired buffers littering the buffer list, so I'd like to find an easy way to toggle hiding dired buffers in IBuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, with a file-tree like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~        &#xA;├── A    &#xA;└── B    &#xA;    ├── x&#xA;    └── y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and starting from the file &lt;code&gt;~/B/y&lt;/code&gt;, running &lt;code&gt;dired-jump&lt;/code&gt; results in (using &lt;code&gt;|&lt;/code&gt; to represent the cursor position):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;buffer contents  buffer list&#xA;---------------  -----------&#xA;~/B:             ~/B/&#xA;.                ~/B/y&#xA;..&#xA;x&#xA;y|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another &lt;code&gt;dired-jump&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;buffer contents  buffer list&#xA;---------------  -----------&#xA;~:               ~/&#xA;.                ~/B/&#xA;..               ~/B/y&#xA;A&#xA;B|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;find-alternate-file&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;buffer contents  buffer list&#xA;---------------  -----------&#xA;~/B:             ~/B/&#xA;.                ~/B/y&#xA;..&#xA;x&#xA;y|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And another &lt;code&gt;find-alternate-file&lt;/code&gt; puts me back into file &lt;strong&gt;y&lt;/strong&gt;, with only &lt;code&gt;~/B/y&lt;/code&gt; in my buffer list.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-10-16T20:10:14.387" LastActivityDate="2016-10-17T13:50:51.617" Title="Hide dired buffers from IBuffer list?" Tags="|buffers|dired|ibuffer|buffer-list|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27838" PostTypeId="2" ParentId="27837" CreationDate="2016-10-15T15:33:31.637" Score="7" Body="&lt;p&gt;If all you want is to hide &lt;code&gt;*dired*&lt;/code&gt; buffers from ibuffer, just add this to your &lt;code&gt;.emacs&lt;/code&gt; :-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-to-list 'ibuffer-never-show-predicates &quot;^\\*dired&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-15T15:33:31.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27839" PostTypeId="2" ParentId="27830" CreationDate="2016-10-15T15:38:08.520" Score="1" Body="&lt;p&gt;Just turn off both the left and right &lt;em&gt;fringe&lt;/em&gt; (the vertical gray bars you noticed).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;One way: &lt;code&gt;M-x customize-option default-frame-alist&lt;/code&gt;, and add these entries, then save.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;INS DEL Parameter: left-fringe&#xA;           Value: 0&#xA;INS DEL Parameter: right-fringe&#xA;           Value: 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That adds these entries to the alist value of &lt;strong&gt;&lt;code&gt;default-frame-alist&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(left-fringe . 0)&#xA;&#xA;(right-fringe . 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So for example, if the original value of your &lt;code&gt;default-frame-alist&lt;/code&gt; option was &lt;code&gt;nil&lt;/code&gt; (aka &lt;code&gt;()&lt;/code&gt;) then the new value after customization would be this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((left-fringe . 0) (right-fringe . 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h v default-frame-alist&lt;/code&gt; shows you the current value and describes this option.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another way: customize option &lt;strong&gt;&lt;code&gt;fringe-mode&lt;/code&gt;&lt;/strong&gt;, setting it to &lt;code&gt;(0 . 0)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(I mention option &lt;code&gt;default-frame-alist&lt;/code&gt; first because it is a good thing to know. It lets you configure many other frame parameters, besides just the fringe.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, see the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Fringes.html&quot; rel=&quot;nofollow&quot;&gt;Fringes&lt;/a&gt;.  You can find this node yourself, by &lt;em&gt;asking Emacs&lt;/em&gt; about the fringe: &lt;strong&gt;&lt;code&gt;C-h r&lt;/code&gt;&lt;/strong&gt;, then &lt;strong&gt;&lt;code&gt;i fringe TAB&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-15T15:44:26.130" LastActivityDate="2016-10-15T15:44:26.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27840" PostTypeId="1" AcceptedAnswerId="27847" CreationDate="2016-10-15T16:37:00.357" Score="2" ViewCount="394" Body="&lt;p&gt;I'm often in the situation, that I am looking for variables and functions with helm. However when I find whatever I was looking for and I want to use it in my code I close the helm buffer, start typing and try to complete the name with company. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's really annoying to type again after I already found the candidate I was looking for. So the question is, how can I insert the currently selected helm candidate into the previous buffer ? &lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-10-16T13:55:26.943" Title="how to insert selected candidate in helm buffer into previously selected buffer?" Tags="|helm|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27841" PostTypeId="1" CreationDate="2016-10-15T17:30:35.263" Score="17" ViewCount="7753" Body="&lt;p&gt;I have an &lt;code&gt;accounts.org.gpg&lt;/code&gt; file. I can open it using gpg directly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ gpg -d ./accounts.org.gpg &#xA;&#xA;You need a passphrase to unlock the secret key for&#xA;user: &quot;Omair Majid &amp;lt;removed@removed&amp;gt;&quot;&#xA;4096-bit RSA key, ID 7CC8AAC6, created 2012-01-18 (main key ID 66484681)&#xA;&#xA;gpg: encrypted with 4096-bit RSA key, ID 7CC8AAC6, created 2012-01-18&#xA;    &quot;Omair Majid &amp;lt;removed@removed&amp;gt;&quot;&#xA;+TITLE: Accounts&#xA;&amp;lt;rest of output removed&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I can't open the same file using Emacs. Trying to open it in emacs&#xA;gives me an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;epa-file--find-file-not-found-function: Opening input file: Decryption failed, No secret key: E295ECEC7CC8AAC6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there something I need to configure on the emacs side to make this work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some additional background, I created this file on another machine&#xA;(using the same version of Emacs), on which Emacs could read/write to&#xA;that file just fine. I then copied over the contents of &lt;code&gt;~/.gnupg&lt;/code&gt;&#xA;over to this machine. And now gpg can still read it, but Emacs can't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Could this be a gpg1 vs gpg2 difference?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ gpg2 --decrypt accounts.org.gpg &#xA;gpg: encrypted with RSA key, ID E295ECEC7CC8AAC6&#xA;gpg: decryption failed: No secret key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How was the Emacs on the other machine (using same configuration, same&#xA;version of Emacs (25.1) and same OS (Fedora 24 x86_64, same version of gpg and gpg2 packages)) read from it and write to it. Anyway&#xA;using,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq epg-gpg-program &quot;/usr/bin/gpg&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still results in the same error.&lt;/p&gt;&#xA;" OwnerUserId="9181" LastEditorUserId="9181" LastEditDate="2016-10-17T14:51:17.123" LastActivityDate="2017-01-15T20:14:53.380" Title="Unable to decrypt .gpg file using emacs but command line gpg works" Tags="|gpg|epa|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27842" PostTypeId="2" ParentId="17894" CreationDate="2016-10-15T17:38:16.807" Score="1" Body="&lt;p&gt;I understand this question is almost an year old, but since it may help someone in future, I'm adding my answer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x org-journal-new-entry&lt;/code&gt; does this exact thing for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. If I had a file for today's journal with single timestamp bullet (say at &lt;code&gt;11:00&lt;/code&gt;) then calling &lt;code&gt;M-x org-journal-new-entry&lt;/code&gt; next time, will just add new timestamp bullet (for the current time) to the existing file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just for testing, I called &lt;code&gt;M-x org-journal-new-entry&lt;/code&gt; in rapid succession (within same minute) so two entries (for say &lt;code&gt;11:00&lt;/code&gt;) were created. (I had expected that it will &lt;strong&gt;not&lt;/strong&gt; create second bullet, but ..)&lt;/p&gt;&#xA;" OwnerUserId="11877" LastActivityDate="2016-10-15T17:38:16.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27843" PostTypeId="1" AcceptedAnswerId="27857" CreationDate="2016-10-15T17:54:57.310" Score="0" ViewCount="389" Body="&lt;p&gt;I've tried&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#define DEFUN(lsym, csym, amin, amax, doc, data) \&#xA;  bind_function (env, lsym, env-&amp;gt;make_function(env, amin, amax, csym, doc, data))&#xA;&#xA;DEFUN(&quot;libgit2-core-status&quot;, Flibgit2_status, 1, 1, \&#xA;  &quot;\\(fn PATH) libgit2 status test return branch \\(fn PATH)&quot;, NULL);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I still get this for &lt;code&gt;C-h f libgit2-core-status&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;libgit2-core-status is a Lisp function.&#xA;&#xA;(libgit2-core-status &amp;amp;rest ARGS)&#xA;&#xA;\(fn PATH) libgit2 status test return branch \(fn PATH)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2016-10-16T14:03:50.127" Title="How can I define the syntax of a C-defined function with with module_make_function?" Tags="|doc-strings|modules|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27844" PostTypeId="5" CreationDate="2016-10-15T18:11:45.713" Score="0" Body="&lt;p&gt;From the Emacs 25.1 &lt;code&gt;NEWS&lt;/code&gt; (&lt;code&gt;C-h n&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs can now load shared/dynamic libraries (modules).&#xA;  A dynamic Emacs module is a shared library that provides additional&#xA;  functionality for use in Emacs Lisp programs, just like a package&#xA;  written in Emacs Lisp would.  The functions &lt;code&gt;load&lt;/code&gt;, &lt;code&gt;require&lt;/code&gt;,&#xA;  &lt;code&gt;load-file&lt;/code&gt;, etc. were extended to load such modules, as they do with&#xA;  Emacs Lisp packages.  The new variable &lt;code&gt;module-file-suffix&lt;/code&gt; holds the&#xA;  system-dependent value of the file-name extension (&lt;code&gt;.so&lt;/code&gt; on Posix&#xA;  hosts) of the module files.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A module should export a C-callable function named&#xA;  &lt;code&gt;emacs_module_init&lt;/code&gt;, which Emacs will call as part of the call to&#xA;  &lt;code&gt;load&lt;/code&gt; or &lt;code&gt;require&lt;/code&gt; which loads the module.  It should also export a&#xA;  symbol named &lt;code&gt;plugin_is_GPL_compatible&lt;/code&gt; to indicate that its code is&#xA;  released under the GPL or compatible license; Emacs will refuse to&#xA;  load modules that don't export such a symbol.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If a module needs to call Emacs functions, it should do so through the&#xA;  API defined and documented in the header file &lt;code&gt;emacs-module.h&lt;/code&gt;.  Note&#xA;  that any module that provides Lisp-callable functions will have to use&#xA;  Emacs functions such as &lt;code&gt;fset&lt;/code&gt; and &lt;code&gt;funcall&lt;/code&gt;, in order to register its&#xA;  functions with the Emacs Lisp interpreter.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Modules can create &lt;code&gt;user-ptr&lt;/code&gt; Lisp objects that embed pointers to C&#xA;  structs defined by the module.  This is useful for keeping around&#xA;  complex data structures created by a module, to be passed back to the&#xA;  module's functions.  User-ptr objects can also have associated&#xA;  &quot;finalizers&quot; -- functions to be run when the object is GC'ed; this is&#xA;  useful for freeing any resources allocated for the underlying data&#xA;  structure, such as memory, open file descriptors, etc.  A new&#xA;  predicate &lt;code&gt;user-ptrp&lt;/code&gt; returns non-nil if its argument is a &lt;code&gt;user-ptr&lt;/code&gt;&#xA;  object.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Loadable modules in Emacs are an experimental feature, and subject to&#xA;  change in future releases.  For that reason, their support is disabled&#xA;  by default, and must be enabled by using the &lt;code&gt;--with-modules&lt;/code&gt; option&#xA;  at configure time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See also the &lt;code&gt;emacs-devel@gnu.org&lt;/code&gt; thread &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01693.html&quot; rel=&quot;nofollow&quot;&gt;good examples of Emacs modules?&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2016-10-15T18:27:13.723" LastActivityDate="2016-10-15T18:27:13.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27845" PostTypeId="4" CreationDate="2016-10-15T18:11:45.713" Score="0" Body="Emacs modules are dynamically-loaded libraries written in C. (They were introduced in Emacs 25.1.)" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2016-10-15T18:22:43.087" LastActivityDate="2016-10-15T18:22:43.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27846" PostTypeId="1" CreationDate="2016-10-15T23:18:42.653" Score="4" ViewCount="363" Body="&lt;p&gt;I am tryping out &lt;a href=&quot;https://github.com/caiorss/org-wiki&quot; rel=&quot;nofollow&quot;&gt;org-wiki.el&lt;/a&gt; to create a personal wiki in org-mode. The package offers a custom link type &lt;code&gt;wiki:&amp;lt;page&amp;gt;&lt;/code&gt; which creates a link like &lt;code&gt;wiki:myPage&lt;/code&gt; that matches up with &lt;code&gt;myPage.org&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if there is any way to set the default description for this link type to hide the &lt;code&gt;wiki:&lt;/code&gt; prefix, so that on completing the link, it converts to &lt;code&gt;[[wiki:myPage][myPage]]&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or better yet, typing &lt;code&gt;[[wiki:My page]]&lt;/code&gt; which automatically displays as &lt;code&gt;[[wiki:My page][My page]]&lt;/code&gt; so we can ditch the camelCase!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks,&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="12695" LastEditDate="2016-10-16T15:24:25.787" LastActivityDate="2016-11-15T16:26:33.557" Title="Set the default link description" Tags="|org-mode|hyperlinks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27847" PostTypeId="2" ParentId="27840" CreationDate="2016-10-15T23:22:29.583" Score="4" Body="&lt;p&gt;You can use &lt;code&gt;C-c C-k&lt;/code&gt; to add the current candidate to the kill ring.  Pressing &lt;code&gt;C-y&lt;/code&gt; will then insert it into the current buffer as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to paste the candidate directly into the buffer, you can use &lt;code&gt;helm-copy-to-buffer&lt;/code&gt; with &lt;code&gt;C-c C-i&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="11377" LastEditDate="2016-10-16T13:55:26.943" LastActivityDate="2016-10-16T13:55:26.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27848" PostTypeId="2" ParentId="27771" CreationDate="2016-10-16T00:27:28.813" Score="0" Body="&lt;p&gt;As @syl20bnr suggested, the issue is with the linum package. I disabled it and emacs is responsive again. I disabled it for org-mode by default by putting the following in init (user-config in spacemacs):  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (add-hook 'org-mode-hook (lambda () (linenum-mode 0)))   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(via comment &lt;a href=&quot;https://stackoverflow.com/questions/5229705/emacs-org-mode-turn-off-line-numbers&quot;&gt;here&lt;/a&gt; ).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Editing the file in a significant way is slow however; modifying the entire tree hierarchy of a 29,708 file requires about 13 seconds. Undo takes about the same time. It still works, but can reduce productivity, so I will adjust my usage with multiple, limited size files.&lt;/p&gt;&#xA;" OwnerUserId="13118" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-10-16T00:27:28.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27849" PostTypeId="1" AcceptedAnswerId="27969" CreationDate="2016-10-16T02:59:29.530" Score="16" ViewCount="2315" Body="&lt;p&gt;I'm very fond of &lt;code&gt;ivy&lt;/code&gt; for completion and love that a simple &lt;code&gt;(ivy-mode 1)&lt;/code&gt; is enough to get &lt;code&gt;ivy&lt;/code&gt; almost everywhere that Emacs uses some sort of completion (that is acomplished by overriding &lt;code&gt;completeing-read&lt;/code&gt;, I believe). But this doesn't setup &lt;code&gt;eshell&lt;/code&gt; to use &lt;code&gt;ivy&lt;/code&gt; for tab completion. I do like &lt;code&gt;eshell&lt;/code&gt;'s list of completion candidates, but would prefer the &lt;code&gt;ivy&lt;/code&gt; UI to pick among them. Is there some way to reuse whatever &lt;code&gt;eshell&lt;/code&gt; does to produce completion candidates and hand that off to `ivy'?&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-10-20T13:46:33.347" Title="How can I setup eshell to use ivy for tab completion?" Tags="|eshell|ivy|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27850" PostTypeId="2" ParentId="8211" CreationDate="2016-10-16T04:59:01.820" Score="1" Body="&lt;p&gt;A while ago, I posted a similar question here: check &lt;a href=&quot;https://emacs.stackexchange.com/questions/5889/&quot;&gt;How to highlight text permanently in org-mode&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not exactly what you are asking for, this gives you more, customize it as you like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq org-emphasis-alist&#xA;      '(&#xA;        (&quot;*&quot; (:foreground &quot;cyan&quot; :weight bold))&#xA;        (&quot;/&quot; (:foreground &quot;cyan&quot; :slant italic))&#xA;        (&quot;_&quot; (:foreground &quot;cyan&quot; :underline t))&#xA;        (&quot;=&quot; (:foreground &quot;cyan&quot; :weight bold))&#xA;        (&quot;~&quot; (:foreground &quot;cyan&quot; :weight bold&#xA;                          :box (:line-width 3 :color &quot;#545454&quot; :style released-button)))&#xA;        (&quot;+&quot; (:foreground &quot;cyan&quot; :strike-through t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="794" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-10-16T04:59:01.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27851" PostTypeId="2" ParentId="12218" CreationDate="2016-10-16T06:40:08.140" Score="2" Body="&lt;p&gt;&lt;strong&gt;Another option: Transposing paragraphs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completeness sake, you can achieve your reordering of paragraphs (sequentially) with marked regions and &lt;code&gt;M-0 M-x transpose-paragraph&lt;/code&gt; (the zero argument makes &lt;code&gt;tra-par&lt;/code&gt; swap the paragraphs where point and mark are in, i.e. the region begins and ends)!  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way this works for all &lt;code&gt;transpose-.*&lt;/code&gt; commands (-words, -sexp, -sentences, ...) and is extremely handy in many situations.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2016-10-16T17:51:35.377" LastActivityDate="2016-10-16T17:51:35.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27852" PostTypeId="1" AcceptedAnswerId="27858" CreationDate="2016-10-16T06:52:09.410" Score="3" ViewCount="359" Body="&lt;p&gt;Is there a builtin function to guess the MIME type of a file in Emacs Lisp? I would like to display the MIME type for files in Dired buffers.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="105" LastEditDate="2018-05-11T17:53:05.987" LastActivityDate="2018-05-11T17:53:05.987" Title="Guess the mime type of a file in elisp?" Tags="|files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27853" PostTypeId="1" CreationDate="2016-10-16T08:56:06.890" Score="3" ViewCount="235" Body="&lt;p&gt;Assume that I am working with a file whose name contains a unique version number for example &lt;code&gt;myfile_03.tex&lt;/code&gt; or &lt;code&gt;03jhcjh.tex&lt;/code&gt; and so on. Currently I create a new version of the file by &lt;code&gt;C-x C-w&lt;/code&gt; and incrementing the number manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be precise I would like to maintain the number length if possible, i.e. 027 → 028 instead of 28, but 9 → 10. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a function in emacs which automatizes this procedure? Other solutions are welcomed.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2016-10-17T12:52:13.293" Title="Increment file name and create a new version of the file" Tags="|saving|filenames|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27854" PostTypeId="2" ParentId="27853" CreationDate="2016-10-16T09:59:56.327" Score="-1" Body="&lt;p&gt;&lt;code&gt;&#xA;C-x C-f &amp;lt;your directory&amp;gt;&#xA;wdired-change-to-wdired-mode&#xA;query-replace-regexp&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;query-replace-regexp&lt;/code&gt; with &lt;code&gt;\#&lt;/code&gt; should do.&lt;/p&gt;&#xA;" OwnerUserId="13592" LastActivityDate="2016-10-16T09:59:56.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27855" PostTypeId="2" ParentId="27853" CreationDate="2016-10-16T10:15:16.357" Score="3" Body="&lt;p&gt;The following elisp code should define a function &lt;code&gt;write-file-increment&lt;/code&gt; doing what you want, except for the &quot;preserving length&quot; part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the file name does not contain a number, it adds &quot;-1&quot;. Apart from that case, the position of the number in the filename shouldn't matter.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tv/increment-number-in-file-name (name)&#xA;  (with-temp-buffer&#xA;    (insert name)&#xA;    (search-backward &quot;.&quot; nil t)&#xA;    (re-search-backward &quot;[0-9]+&quot; nil t)&#xA;    ;(skip-chars-forward &quot;0&quot;) ;; Would preserve 0s&#xA;    (if (looking-at &quot;[0123456789]+&quot;)&#xA;        (replace-match (number-to-string (1+ (string-to-number (match-string 0)))))&#xA;      (insert &quot;-1&quot;))&#xA;    (buffer-string)))&#xA;&#xA;(defun write-file-increment ()&#xA;  (interactive)&#xA;  (write-file (tv/increment-number-in-file-name (buffer-file-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Preserving prefixed &lt;code&gt;0&lt;/code&gt;s can be done by uncommenting the commented line, but it would also replace &lt;code&gt;09&lt;/code&gt; with &lt;code&gt;010&lt;/code&gt;, probably not what you want.&lt;/p&gt;&#xA;" OwnerUserId="184" LastEditorUserId="184" LastEditDate="2016-10-17T12:52:13.293" LastActivityDate="2016-10-17T12:52:13.293" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27856" PostTypeId="1" AcceptedAnswerId="27868" CreationDate="2016-10-16T11:10:00.413" Score="2" ViewCount="503" Body="&lt;p&gt;While this answer (&lt;a href=&quot;https://emacs.stackexchange.com/questions/27718/how-to-make-auto-completion-case-sensitive&quot;&gt;How to make auto-completion case sensitive?&lt;/a&gt; - &lt;code&gt;ac-ignore-case&lt;/code&gt;) works in some cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using evil mode on its own.&#xA;Adding &lt;code&gt;(setq ac-ignore-case nil)&lt;/code&gt; to &lt;code&gt;~/.emacs&lt;/code&gt; doesn't make completion case sensitive. (Pressing Ctrl-N in evil mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From looking into it this calls &lt;code&gt;evil-complete-next&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Checked the source but didn't see any options to adjust.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be made to be case sensitive?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-10-17T01:15:03.633" Title="How to make evil-mode completion case sensitive?" Tags="|evil|completion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27857" PostTypeId="2" ParentId="27843" CreationDate="2016-10-16T14:03:50.127" Score="1" Body="&lt;p&gt;The use of &lt;code&gt;(fn ARGS)&lt;/code&gt; syntax is described in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Function-Documentation.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;(elisp) Function Documentation&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;   The last line of the documentation string can specify calling&#xA;conventions different from the actual function arguments.  Write text&#xA;like this:&#xA;&#xA;     \(fn ARGLIST)&#xA;&#xA;following a blank line, at the beginning of the line, with no newline&#xA;following it inside the documentation string.  (The `\' is used to&#xA;avoid confusing the Emacs motion commands.)  The calling convention&#xA;specified in this way appears in help messages in place of the one&#xA;derived from the actual arguments of the function.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The backslash is a single backslash in a string literal, not a doubled one to produce an actual backslash in the string value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are writing in C, where string literals must stop at the end of line, you have to use something like &lt;code&gt;&quot;The function description...\n\n(fn ARGLIST)&quot;&lt;/code&gt;. Since the opening parenthesis doesn't occur in the first column, there's no need to escape it with a backslash (although you can if you want).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-10-16T14:03:50.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27858" PostTypeId="2" ParentId="27852" CreationDate="2016-10-16T14:35:08.873" Score="4" Body="&lt;p&gt;Yes. In standard library &lt;code&gt;mailcap.el&lt;/code&gt; you will find functions that deal with mime types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;code&gt;mailcap-mime-types&lt;/code&gt; gives a list of known mime types - &lt;code&gt;M-: (mailcap-mime-types)&lt;/code&gt; returns something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(&quot;text/plain&quot; &quot;audio/x-mpeg&quot; &quot;audio/aiff&quot; &quot;application/x-annotator&quot; &#xA; &quot;audio/ulaw&quot; &quot;video/x-msvideo&quot; &quot;application/x-bcpio&quot; &quot;application/octet-stream&quot;&#xA; &quot;application/x-netcdr&quot; &quot;application/x-cpio&quot; &quot;application/x-csh&quot; &quot;text/css&quot; &#xA; &quot;application/x-dvi&quot; &quot;text/x-patch&quot; &quot;test/x-patch&quot; &quot;application/emacs-lisp&quot; &#xA; &quot;application/postscript&quot; &quot;text/x-setext&quot; &quot;image/x-fax&quot; &quot;image/gif&quot; &#xA; &quot;application/x-hdf&quot; &quot;application/mac-binhex40&quot; &quot;text/html&quot; &quot;image/x-icon&quot; &quot;image/ief&quot;&#xA; &quot;image/jpeg&quot; &quot;image/x-macpaint&quot; &quot;application/x-troff-man&quot; &quot;application/x-troff-me&quot;&#xA; &quot;application/mif&quot; &quot;video/quicktime&quot; &quot;video/x-sgi-movie&quot; &quot;audio/x-mpeg2&quot; &#xA; &quot;video/mpeg&quot; &quot;application/x-troff-ms&quot; &quot;application/x-netcdf&quot; &quot;application/oda&quot;&#xA; &quot;image/x-portable-bitmap&quot; &quot;application/pdf&quot; &quot;image/portable-graymap&quot; &quot;image/pict&quot;&#xA; &quot;image/png&quot; &quot;image/x-portable-anymap&quot; &quot;image/portable-pixmap&quot; &quot;image/x-raster&quot;&#xA; &quot;image/x-rgb&quot; &quot;application/rtf&quot; &quot;text/richtext&quot; &quot;application/x-sh&quot; &#xA; &quot;application/x-stuffit&quot; &quot;application/sieve&quot; &quot;audio/basic&quot; &quot;text/dns&quot; &#xA; &quot;application/x-wais-source&quot; &quot;archive/tar&quot; &quot;application/x-tcl&quot; &#xA; &quot;application/x-tex&quot; &quot;application/texinfo&quot; &quot;image/x-targa&quot; &quot;image/tiff&quot; &#xA; &quot;application/x-troff&quot; &quot;text/tab-separated-values&quot; &quot;x-world/x-vrml&quot; &#xA; &quot;audio/x-wav&quot; &quot;application/vnd.ms-excel&quot; &quot;image/xbm&quot; &quot;image/xpm&quot; &#xA; &quot;image/windowdump&quot; &quot;application/zip&quot; &quot;text/x-org&quot; &quot;application/x-x509-ca-cert&quot;&#xA; &quot;application/x-x509-user-cert&quot; &quot;application/dvi&quot; &quot;application/x-emacs-lisp&quot; &#xA; &quot;application/x-tar&quot; &quot;application/x-latex&quot; &quot;application/latex&quot; &#xA; &quot;application/tex&quot; &quot;application/pgp-keys&quot; &quot;message/rfc822&quot; &quot;image/x-xwd&quot; &quot;text/enriched&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And for example, &lt;code&gt;mailcap-extension-to-mime&lt;/code&gt; returns mime types applicable to files with given extensions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code in &lt;code&gt;mailcap-file-default-commands&lt;/code&gt; shows some of what you can do.  This part, for example, returns all unique MIME types for the given FILES:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(mailcap-delete-duplicates&#xA;   (mapcar (lambda (file) (mailcap-extension-to-mime (file-name-extension file t)))&#xA;           files))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-16T14:41:03.603" LastActivityDate="2016-10-16T14:41:03.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27859" PostTypeId="1" CreationDate="2016-10-16T14:43:29.580" Score="2" ViewCount="24" Body="&lt;p&gt;Highlighting the region when it includes text with different heights/fonts shows gaps and different highlighting heights as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tj1Pr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tj1Pr.png&quot; alt=&quot;variable highlight height screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way of highlighting continuously (no gaps) and consistently (same height)?&lt;/p&gt;&#xA;" OwnerUserId="11991" LastEditorUserId="105" LastEditDate="2016-10-16T20:01:43.003" LastActivityDate="2016-10-16T20:01:43.003" Title="Is it possible to highlight the region uniformly across different sizes/fonts?" Tags="|faces|region|highlighting|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27860" PostTypeId="2" ParentId="27846" CreationDate="2016-10-16T15:23:45.253" Score="2" Body="&lt;p&gt;The function &lt;code&gt;org-wiki-insert&lt;/code&gt; inserts a &lt;code&gt;wiki:&lt;/code&gt; link of the form &lt;code&gt;[[wiki:MyHeading][MyHeading]]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, it's more convenient to use the built-in &lt;code&gt;org-insert-link&lt;/code&gt;.  For that we need two things: completions for the link target and a default description.  For the first, we just need to define a function called &lt;code&gt;org-wiki-complete-link&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt; will pick it up for completing &lt;code&gt;wiki:&lt;/code&gt; links:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-wiki-complete-link (&amp;amp;optional arg)&#xA;  (org-wiki--helm-selection&#xA;   (lambda (page)&#xA;     (format &quot;wiki:%s&quot; page))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only way to set default descriptions seems to be to set &lt;code&gt;org-make-link-description-function&lt;/code&gt;.  There isn't a per-type function like there is with the targets.  We just have to make sure that we only complete &lt;code&gt;wiki:&lt;/code&gt; type links:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-make-wiki-link-description (link desc)&#xA;  (when (string-prefix-p &quot;wiki:&quot; link)&#xA;    (string-remove-prefix &quot;wiki:&quot; link)&#xA;    )&#xA;  )&#xA;(setq org-make-link-description-function #'org-make-wiki-link-description)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, hit &lt;code&gt;C-c C-l&lt;/code&gt; and type &lt;code&gt;wiki:[return]&lt;/code&gt;.  You will be prompted for the wiki heading and then a default description will be added.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-10-16T15:23:45.253" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27861" PostTypeId="1" CreationDate="2016-10-16T16:12:32.633" Score="2" ViewCount="365" Body="&lt;p&gt;Is there a way to have headlines in &lt;code&gt;org-mode&lt;/code&gt; automatically behave as radio targets? Basically, I am looking for each line starting with &lt;code&gt;* &lt;/code&gt; get turned into a radio target.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* My Headline&#xA;And this is some text that auto-links to My Headline.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;which behaves the same as if I had written:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* &amp;lt;&amp;lt;&amp;lt;My Headline&amp;gt;&amp;gt;&amp;gt;&#xA;And this is some text that auto-links to My Headline.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As suggested in the comments, I tried overriding &lt;code&gt;org-radio-target-regexp&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defconst org-radio-target-regexp (format &amp;quot;&amp;lt;%s&amp;gt;\\|^\\*\s\\(.+\\)&amp;quot; org-target-regexp)&#xA;          &amp;quot;Regular expression matching a radio target.&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;but this does not seem to do anything... any ideas?&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="12504" LastEditDate="2021-08-29T20:51:56.397" LastActivityDate="2021-08-29T20:51:56.397" Title="Automatic radio targets from org-mode headlines" Tags="|org-mode|regular-expressions|org-link|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27862" PostTypeId="1" CreationDate="2016-10-16T17:16:59.173" Score="4" ViewCount="677" Body="&lt;p&gt;I'm using Emacs on Windows. Everything was fine just a few minutes ago, but for some odd reason, when I open a certain file, I get &lt;code&gt;^M&lt;/code&gt; characters after every line. As far as I know/remember, I didn't do anything to the file except refile a a couple org-mode items (and they didn't contain any strange characters like smart quotes or anything either)... and yet when I closed then reopened the file a few seconds later, these characters appeared. It only happens for that file; other buffers seem to be okay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my research, &lt;code&gt;^M&lt;/code&gt; seems to be the end of line character for Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following &lt;a href=&quot;https://www.emacswiki.org/emacs/EndOfLineTips&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;, executing &lt;code&gt;M-x revert-buffer-with-coding-system utf-8-dos&lt;/code&gt; seems to fix the problem until I open the file again, at which point the &lt;code&gt;^M&lt;/code&gt;s return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only encoding-related thing I have in my init.el file is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-language-environment &quot;UTF-8&quot;)&#xA;(set-default-coding-systems 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which hasn't changed since I set them a couple months ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any idea what happened?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: One thing I noticed (after disabling my modeline theme) is that the file in question seems to always want to revert to &lt;code&gt;(Unix)&lt;/code&gt; Unix-style LF line endings, when all my other (working) files are set to &lt;code&gt;\&lt;/code&gt; DOS-style CRLF line endings. I have some characters like é and あ in my file, but they hadn't caused problems before...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a comparison of the modeline indicators:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(Working) File with no &lt;code&gt;^M&lt;/code&gt;, no foreign characters: &lt;code&gt;-\&lt;/code&gt; undecided-dos, DOS-style CRLF&lt;/li&gt;&#xA;&lt;li&gt;(Not working) File with &lt;code&gt;^M&lt;/code&gt;, with foreign characters: &lt;code&gt;=(Unix)&lt;/code&gt; no-conversion, Unix-style LF&lt;/li&gt;&#xA;&lt;li&gt;(Working) File with no &lt;code&gt;^M&lt;/code&gt;, with foreign characters: &lt;code&gt;U\&lt;/code&gt; utf-8-dos, CRLF&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &quot;not working&quot; file always seems to want to open with (Unix) and no-conversion...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;: I seem to have temporarily been able to solve this by forcing the buffer to read the file as utf-8-dos by including &lt;code&gt;# -*- coding: utf-8-dos -*-&lt;/code&gt; at the top.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will leave this question open, however, as I still would like to know what caused this, and why emacs suddenly decided it wanted to encode the file as &lt;code&gt;no-conversion&lt;/code&gt; even though it had been handling foreign characters just fine earlier in the day...&lt;/p&gt;&#xA;" OwnerUserId="12837" LastEditorUserId="12837" LastEditDate="2016-10-16T23:17:17.000" LastActivityDate="2016-10-17T10:46:36.760" Title="^M character suddenly appearing upon opening file" Tags="|character-encoding|utf-8|" AnswerCount="1" CommentCount="3" ClosedDate="2016-10-17T19:14:22.657" ContentLicense="CC BY-SA 3.0" />
  <row Id="27863" PostTypeId="1" CreationDate="2016-10-16T18:59:02.437" Score="1" ViewCount="32" Body="&lt;p&gt;By default (e.g., in fundamental mode), emacs seems to treat the sequence of characters &lt;code&gt;abcαβγ&lt;/code&gt; in a buffer as two separate words. In particular, a command like &lt;code&gt;M-f&lt;/code&gt; done at the beginning will only move past the &lt;code&gt;abc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have trouble understanding what is going on and how to change this behaviour. I thought that the definition of a word is a sequence of characters with syntax class &lt;code&gt;w&lt;/code&gt;, but here all six characters have syntax class &lt;code&gt;w&lt;/code&gt; yet it is treated as two different words.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use &lt;code&gt;superword-mode&lt;/code&gt;, it seems to work for &lt;code&gt;M-f&lt;/code&gt; for instance but double-clicking on it will still only select only one of the two halfs (maybe that’s a bug in &lt;code&gt;superword-mode&lt;/code&gt;?)&lt;/p&gt;&#xA;" OwnerUserId="13672" LastActivityDate="2016-10-16T18:59:02.437" Title="Word boundaries in mixed-alphabet words" Tags="|unicode|words|" AnswerCount="0" CommentCount="2" ClosedDate="2016-10-18T01:29:25.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="27866" PostTypeId="1" AcceptedAnswerId="27891" CreationDate="2016-10-16T21:18:11.773" Score="9" ViewCount="1533" Body="&lt;p&gt;Is this possible?  (I know it's possible for &lt;code&gt;#+BEGIN_SRC latex&lt;/code&gt; blocks.)&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2019-02-03T16:15:05.340" Title="Syntax highlighting in org mode #+BEGIN_LATEX block" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27867" PostTypeId="2" ParentId="27862" CreationDate="2016-10-17T00:36:40.597" Score="2" Body="&lt;p&gt;Are you sure &lt;em&gt;every&lt;/em&gt; line ends with a ^M? If just a single one doesn't then you will get the symptoms you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can search for such lines with isearch-forward-regexp, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;escape ctrl-s [ ^ ctrl-q ctrl-m ] $&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The [^^m] matches any character that is not ctrl-m, and the dollar matches the end of line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you find a line which is missing a ctrl-m, you can add one with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ctrl-e ctrl-q ctrl-m&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you have changed all the lines you can save the file and reload it, and hopefully the issue will have gone away.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2016-10-17T10:46:36.760" LastActivityDate="2016-10-17T10:46:36.760" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27868" PostTypeId="2" ParentId="27856" CreationDate="2016-10-17T01:15:03.633" Score="3" Body="&lt;p&gt;Evil mode uses &lt;code&gt;dabbrev&lt;/code&gt;, to make autocomplete case sensitive, set this in your emacs config.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dabbrev-case-fold-search nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;https://emacs.stackexchange.com/questions/7464&quot;&gt;case-sensitivity of word completion using dabbrev&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;thanks to @VanLaser for the hint.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-10-17T01:15:03.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27869" PostTypeId="1" AcceptedAnswerId="27872" CreationDate="2016-10-17T01:51:56.130" Score="4" ViewCount="5066" Body="&lt;p&gt;Currently pressing TAB in evil insert mode, runs &lt;code&gt;indent-for-tab-command&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure of the exact details, but from what I can tell this is performing some kind of re-indentation, which does nothing if emacs consideres the text already indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like this to behave (like vim) where.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When tabs are enabled a &lt;code&gt;\t&lt;/code&gt; is inserted *.&lt;/li&gt;&#xA;&lt;li&gt;When tabs are disabled, insert &lt;em&gt;n&lt;/em&gt; spaces, aligning to the &lt;code&gt;tab-width&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;* by tabs enabled I mean &lt;code&gt;(setq indent-tabs-mode t)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2016-11-16T07:35:43.430" Title="How to make evil-mode tab key indent? (not re-indent based on context)" Tags="|indentation|evil|" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27870" PostTypeId="2" ParentId="27841" CreationDate="2016-10-17T04:23:36.360" Score="22" Body="&lt;p&gt;You do not say which OS nor version of emacs you have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I solved yesterday exactly the same problem in OSX and emacs 25.1 using information from this link: &lt;a href=&quot;http://colinxy.github.io/software-installation/2016/09/24/emacs25-easypg-issue.html&quot; rel=&quot;noreferrer&quot;&gt;http://colinxy.github.io/software-installation/2016/09/24/emacs25-easypg-issue.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran these commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew unlink gnupg2 gpg-agent dirmngr&#xA;brew uninstall gnupg2 gpg-agent dirmngr&#xA;brew install gnupg21&#xA;ln -s /usr/local/bin/gpg2 /usr/local/bin/gpg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and set the pinentry mode in my emacs conf file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf epa-pinentry-mode 'loopback)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="903" LastEditorUserId="5296" LastEditDate="2016-11-16T18:25:54.157" LastActivityDate="2016-11-16T18:25:54.157" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27871" PostTypeId="2" ParentId="27849" CreationDate="2016-10-17T04:25:22.973" Score="6" Body="&lt;p&gt;I found something that seems to work OK upon initial testing: essentially rebind &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; to &lt;code&gt;pcomplete-std-complete&lt;/code&gt;, but since that function isn't interactive for some reason, you need to wrap it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key eshell-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;  (lambda () (interactive) (pcomplete-std-complete)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;pcompete-std-complete&lt;/code&gt; tries to use the completions written for &lt;code&gt;pcomplete&lt;/code&gt; with the standard completion UI, which &lt;code&gt;ivy&lt;/code&gt; by default will override (with the very recent update, they appear in a nice overlay right in the eshell buffer near point!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The comments in the source code of &lt;code&gt;pcomplete-completions-at-point&lt;/code&gt; (which &lt;code&gt;pcomplete-std-complete&lt;/code&gt; depends on) mention a couple of potential problems:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; FIXME: it only completes the text before point, whereas the&#xA;;; standard UI may also consider text after point.&#xA;;; FIXME: the `pcomplete' UI may be used internally during&#xA;;; pcomplete-completions and then throw to `pcompleted', thus&#xA;;; imposing the pcomplete UI over the standard UI.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think the first one won't affect me, since I don't think I ever press &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; except at the end of the input line. I haven't seen the second problem surface either, so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: For those unfamiliar with eshell's quirks (this is a euphemism), maybe I should add that to rebind eshell's key as suggested above you should put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'eshell-mode-hook&#xA;  (lambda () &#xA;    (define-key eshell-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;)&#xA;      (lambda () (interactive) (pcomplete-std-complete)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Before you yell at me for the wasteful keybindings-in-a-hook antipattern, let me explain that eshell declares its keymap with &lt;code&gt;(defvar eshell-mode-map nil)&lt;/code&gt; and then does &lt;code&gt;(setq-local eshell-mode-map (sparse-keymap))&lt;/code&gt; inside &lt;code&gt;eshell-mode&lt;/code&gt;! (The code has a helpful &lt;code&gt;;; FIXME: What the hell!?&lt;/code&gt;.) That means that you can't rebind keys until after &lt;code&gt;eshell-mode&lt;/code&gt; runs! Hence the hook.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2016-10-17T05:49:08.927" LastActivityDate="2016-10-17T05:49:08.927" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27872" PostTypeId="2" ParentId="27869" CreationDate="2016-10-17T06:36:31.843" Score="5" Body="&lt;p&gt;To have tab work as it does in VIM, use &lt;code&gt;tab-to-tab-stop&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;TAB&quot;) 'tab-to-tab-stop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2016-10-17T06:36:31.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27873" PostTypeId="2" ParentId="16610" CreationDate="2016-10-17T06:52:52.873" Score="9" Body="&lt;p&gt;By default &lt;code&gt;org-agenda-log-mode&lt;/code&gt; shows only &lt;code&gt;closed&lt;/code&gt; and &lt;code&gt;clock&lt;/code&gt; items. To show done recurring tasks add &lt;code&gt;state&lt;/code&gt; symbol to the &lt;code&gt;org-agenda-log-mode-items&lt;/code&gt; variable, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-log-mode-items '(closed clock state))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will now see done recurring tasks in your &lt;code&gt;org-agenda&lt;/code&gt; by pressing &lt;code&gt;l&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13681" LastActivityDate="2016-10-17T06:52:52.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27875" PostTypeId="2" ParentId="27834" CreationDate="2016-10-17T07:58:48.783" Score="1" Body="&lt;p&gt;That one solved the issue for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# pip install --upgrade jedi json-rpc service_factory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Had wrong dependencies.&lt;/p&gt;&#xA;" OwnerUserId="13663" LastActivityDate="2016-10-17T07:58:48.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27877" PostTypeId="1" CreationDate="2016-10-17T08:30:34.927" Score="2" ViewCount="104" Body="&lt;p&gt;How to distribute an emacs package via Elpa that includes OSX and Linux module written in C that needs to be compiled locally?&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-10-17T08:30:34.927" Title="Distributing emacs packages with module functionality" Tags="|package|modules|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27878" PostTypeId="2" ParentId="27309" CreationDate="2016-10-17T12:00:26.950" Score="2" Body="&lt;p&gt;Try adding &lt;code&gt;:empty-lines 0&lt;/code&gt; to each template's set of properties. Zero is in fact the default value, so it would be strange if this was the solution, but maybe worth a try.&lt;/p&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-10-17T12:00:26.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27879" PostTypeId="2" ParentId="27647" CreationDate="2016-10-17T12:44:53.537" Score="5" Body="&lt;p&gt;The Org mode info manual has a footnote on &lt;code&gt;(org) Internal links&lt;/code&gt;, see &lt;a href=&quot;http://orgmode.org/manual/Internal-links.html#fnd-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;the orgmode manual&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(1) To insert a link targeting a headline, in-buffer completion can be&#xA;used.  Just type a star followed by a few optional letters into the&#xA;buffer and press `M-&amp;lt;TAB&amp;gt;'.  All headlines in the current buffer will&#xA;be offered as completions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In case your desktop environment intercepts &lt;code&gt;M-TAB&lt;/code&gt; before it reaches Emacs you can instead type &lt;code&gt;&amp;lt;ESC&amp;gt; &amp;lt;TAB&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastEditorUserId="33705" LastEditDate="2021-05-08T11:47:54.083" LastActivityDate="2021-05-08T11:47:54.083" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="27880" PostTypeId="2" ParentId="27829" CreationDate="2016-10-17T13:17:17.147" Score="2" Body="&lt;p&gt;You haven't properly escaped the regexp for &quot;\question&quot;. It should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\\\question\\b&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a string, and in order to encode a single backslash in a string, it needs to be escaped with a backslash of its own. And in order to use a literal backslash in a regexp, it must be escaped with another backslash. So to get a regexp to match a single literal &lt;code&gt;\&lt;/code&gt; from a string, you need to use &lt;code&gt;\\\\&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;\\b&lt;/code&gt; at the end of the string matches the end of a word, which is the regexp &lt;code&gt;\b&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will only work if &lt;code&gt;\question&lt;/code&gt; appears at the beginning of the line. That's why @arashesbati added the &lt;code&gt;[ \t]*&lt;/code&gt;, which makes the regexp match &lt;code&gt;\question&lt;/code&gt; with any number of tabs or spaces before it on a line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting the outline level to 1 seems a bit high, I think you might end up folding everything below the question into the question, including subsequent sections. So probably more useful to use something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;[ \t]*\\\\question\\b&quot; 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, it looks like AucTex only reads this at the beginning of a session, and subsequent changes to take effect until you restart. So the best way to make this addition is probably via &lt;code&gt;M-x customize-variable TeX-outline-extra&lt;/code&gt;. That way, you know the variable will be changed before AucTex is loaded the next time you start Emacs. In my case, this variable is defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;[   ]*\\\\question\\b&quot; 4) (&quot;[   ]*\\\\\\(bib\\)?item\\b&quot; 7) (&quot;\\\\bibliography\\b&quot; 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-10-17T13:17:17.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27881" PostTypeId="2" ParentId="27837" CreationDate="2016-10-17T13:50:51.617" Score="2" Body="&lt;p&gt;You could use a custom filter group, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;/ m dired-mode RET                      ;Filter by dired-mode&#xA;/ !                                     ;Negate filter&#xA;/ s non-dired RET                       ;Save filter as &quot;non-dired&quot;&#xA;&#xA;(add-hook 'ibuffer-mode-hook&#xA;          (lambda nil (ibuffer-add-saved-filters &quot;non-dired&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, that you can negate the filter as desired, in case you need to view the dired buffers.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-10-17T13:50:51.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27882" PostTypeId="1" CreationDate="2016-10-17T14:42:33.280" Score="1" ViewCount="1132" Body="&lt;p&gt;Can Emacs 25 on macOS leverage the &lt;a href=&quot;http://www.howtogeek.com/275155/how-to-add-tabs-to-almost-any-app-in-macos-sierra/&quot; rel=&quot;nofollow&quot;&gt;new tab features&lt;/a&gt; introduced in &lt;a href=&quot;http://www.apple.com/macos/sierra/&quot; rel=&quot;nofollow&quot;&gt;macOS Sierra&lt;/a&gt; (10.12)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what is required for it to start supporting tabs?&lt;/p&gt;&#xA;" OwnerUserId="2075" LastEditorUserId="25" LastEditDate="2016-11-23T21:49:06.970" LastActivityDate="2018-03-06T02:13:04.110" Title="Can Emacs 25 use the new macOS Sierra tab features?" Tags="|osx|frames|gui|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27883" PostTypeId="2" ParentId="17320" CreationDate="2016-10-17T15:49:08.483" Score="1" Body="&lt;p&gt;I've hit this same problem before and I &quot;solved&quot; it by changing the value of &lt;code&gt;ac-delay&lt;/code&gt; from 0.1s to 1.0, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-variable 'ac-delay 1.0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That means that as I'm typing it only attempts the auto-complete if I stop typing for a second.  So if you know you want a &lt;code&gt;std::vector&lt;/code&gt; you can just keep typing and &lt;code&gt;auto-complete&lt;/code&gt; never fires.&lt;/p&gt;&#xA;" OwnerUserId="13686" LastEditorUserId="675" LastEditDate="2016-10-17T20:33:47.217" LastActivityDate="2016-10-17T20:33:47.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27884" PostTypeId="2" ParentId="27536" CreationDate="2016-10-17T16:29:17.347" Score="1" Body="&lt;p&gt;To open a directory at startup you can also insert (find-file &quot;/path/to/dir&quot;) in init.el&lt;/p&gt;&#xA;" OwnerUserId="970" LastActivityDate="2016-10-17T16:29:17.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27885" PostTypeId="1" AcceptedAnswerId="27890" CreationDate="2016-10-17T16:40:11.240" Score="17" ViewCount="6359" Body="&lt;p&gt;I'm a beginner in Emacs (using it for about 2 weeks now and loving it). As I update and expand my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; file, the things that I write in there depend on certain packages that I installed from MELPA using &lt;code&gt;M-x package-install&lt;/code&gt;, on &lt;code&gt;.el&lt;/code&gt; files that I've written myself, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, should I in the future switch computers for example, what is the best way to seamlessly get the same exact Emacs environment on the new computer as I have now?&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2018-06-19T22:17:03.673" Title="How to get the same Emacs environment on a different computer?" Tags="|init-file|config|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27886" PostTypeId="2" ParentId="27885" CreationDate="2016-10-17T16:59:06.440" Score="4" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/cask/cask&quot; rel=&quot;nofollow&quot;&gt;cask&lt;/a&gt; to manage your packages. Use git/github to source control and sync your emacs dotfiles.&lt;/p&gt;&#xA;" OwnerUserId="7091" LastEditorUserId="12247" LastEditDate="2016-10-17T17:48:42.153" LastActivityDate="2016-10-17T17:48:42.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27887" PostTypeId="1" CreationDate="2016-10-17T17:36:54.730" Score="2" ViewCount="669" Body="&lt;p&gt;Emacs comes with it's own solution for scrollbars(rather than using native macOS scrollbar) and honestly, I find them kinda intrusive and ugly. Can I somehow configure scrollbars to use native mac scrollbar which only pops up when scrolling. Kinda like this :- &lt;a href=&quot;https://i.stack.imgur.com/aqI4T.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aqI4T.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is this something that's out of our hands to configure? If it is, is there a hack that can make it work/appear like native mac srollbar?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-10-17T17:43:31.393" LastActivityDate="2016-10-17T17:43:31.393" Title="Native mac scrollbar in emacs?" Tags="|osx|themes|scroll-bars|gui|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27889" PostTypeId="2" ParentId="27885" CreationDate="2016-10-17T17:47:51.067" Score="11" Body="&lt;p&gt;If you use &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt;, you can move that file around from computer to computer, and when Emacs starts up, as long as you have internet access, it will pull in the packages and configure them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, set up the package library:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;) t)&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then bootstrap &lt;code&gt;use-package&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;&#xA;(eval-when-compile (require 'use-package))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, instead of configuring Emacs and assuming packages are installed, use &lt;code&gt;use-package&lt;/code&gt; to both install and configure them. For example, for some of my helm settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package helm&#xA;  :ensure t&#xA;  :bind ((&quot;M-x&quot; . helm-M-x)&#xA;         (&quot;M-y&quot; . helm-show-kill-ring)&#xA;         (&quot;C-x C-f&quot; . helm-find-files)&#xA;         (&quot;M-s o&quot; . helm-occur))&#xA;&#xA;  :config&#xA;  (helm-mode 1)&#xA;  (setq helm-echo-input-in-header-line t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2016-10-20T04:21:18.840" LastActivityDate="2016-10-20T04:21:18.840" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27890" PostTypeId="2" ParentId="27885" CreationDate="2016-10-17T18:02:31.490" Score="9" Body="&lt;p&gt;The correct solution is to use &lt;a href=&quot;https://github.com/raxod502/straight.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;straight.el&lt;/code&gt;&lt;/a&gt;, a package manager that I wrote to solve this problem. You can find more details about this in &lt;a href=&quot;https://emacs.stackexchange.com/a/34241/12534&quot;&gt;another answer to this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer, which was written months before I started work on &lt;code&gt;straight.el&lt;/code&gt;, previously described a strictly inferior way of achieving a partial solution. This approach is described briefly below; I no longer recommend it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if you don't want to use &lt;code&gt;straight.el&lt;/code&gt;, you should at least adopt &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;. (Not that the two are mutually exclusive—I believe the cleanest setup comes from using both.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Start by defining a list of packages in your init-file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-packages&#xA;        '(&#xA;          aggressive-indent&#xA;          avy&#xA;           .&#xA;           .&#xA;           .&#xA;          projectile&#xA;          undo-tree&#xA;          )&#xA;  &quot;List of packages to be installed at Emacs startup.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then install them automatically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;(package-initialize)&#xA;(unless (cl-every #'package-installed-p my-packages)&#xA;  (dolist (package my-packages)&#xA;    (unless (package-installed-p package)&#xA;      (package-install package))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you keep your &lt;code&gt;init.el&lt;/code&gt; file under version control, then syncing it to another machine will result in your packages being installed automatically. Of course, the versions that are installed will be completely different, and your configuration can't be expected to work out of the box as a result. This is a fundamental flaw of &lt;code&gt;package.el&lt;/code&gt;, and is one of the reasons why this approach is bad. See again &lt;a href=&quot;https://github.com/raxod502/straight.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;straight.el&lt;/code&gt;&lt;/a&gt;. Note also that the code outlined above separates your package list from your configuration for those packages, making it harder to keep track of things in your init-file. This is another major disadvantage. See again &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12534" LastEditorUserId="12534" LastEditDate="2018-06-19T22:17:03.673" LastActivityDate="2018-06-19T22:17:03.673" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="27891" PostTypeId="2" ParentId="27866" CreationDate="2016-10-17T19:10:04.033" Score="9" Body="&lt;p&gt;It seems to be possible, by specifying &lt;code&gt;latex&lt;/code&gt; as an extra parameter to the LaTeX fragment (!), as if it were a &lt;code&gt;src&lt;/code&gt; block. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LaTeX latex&#xA;\begin{tikzpicture}&#xA;  \draw[dashed] (0,0) -- (1,1) ;&#xA;\end{tikzpicture}&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To compare:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xpwbT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xpwbT.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(from &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/57whx0/how_to_fontify_begin_latex_blocks_natively/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Reddit&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure the behavior is intentional, but it seems to be working great.&lt;/p&gt;&#xA;" OwnerUserId="8708" LastEditorUserId="25" LastEditDate="2016-10-22T10:54:17.150" LastActivityDate="2016-10-22T10:54:17.150" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="27892" PostTypeId="1" AcceptedAnswerId="27901" CreationDate="2016-10-17T19:48:28.823" Score="3" ViewCount="2673" Body="&lt;p&gt;Does simple markup, such as italic, work for whole paragraphs or only for parts of the line?  For example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;/first italic paragraph&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;second italic paragraph/&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If not - what would be a correct way to do that?&lt;/p&gt;&#xA;" OwnerUserId="11047" LastEditorUserId="11047" LastEditDate="2016-10-19T21:10:50.937" LastActivityDate="2016-10-19T21:10:50.937" Title="Italic paragraphs in org-mode" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27894" PostTypeId="1" CreationDate="2016-10-17T21:50:33.370" Score="3" ViewCount="851" Body="&lt;p&gt;I have some customization in my &lt;code&gt;.dir-locals.el&lt;/code&gt;. Some of variables set there are unsafe and when I set them and visit some file in &lt;code&gt;dir&lt;/code&gt; for the first time Emacs nicely asks me to save their name-value pairs for future use in the current session.&lt;br&gt;&#xA;There is a bit different story when variable is also considered as risky, then Emacs do not offer the choice to safe them for the future use and asks for the permission &lt;strong&gt;every time&lt;/strong&gt; I visit any file in &lt;code&gt;dir&lt;/code&gt;.&lt;br&gt;&#xA;I've &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Local-Variables.html&quot; rel=&quot;nofollow&quot;&gt;read&lt;/a&gt; that it is actually desirable Emacs behavior but it's a bit impractical to me.&lt;br&gt;&#xA;I want to set up some variables for my project, put &lt;code&gt;.dir-locals.el&lt;/code&gt; on git and let others in my team use my customizatins.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mentioned &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Local-Variables.html&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; claims:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs always queries before setting a risky variable, unless the user explicitly allows a value by customizing safe-local-variable-values directly.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What I've tried is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((clojure-mode&#xA;  . ((eval . (add-to-list 'safe-local-variable-values&#xA;                          '(projectile-test-suffix-function (lambda (_) &quot;&quot;))))&#xA;     (projectile-test-suffix-function&#xA;      . (lambda (_) &quot;&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it has no effect - it still asks for permission every time I visiting a file in &lt;code&gt;dir&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-10-17T21:50:33.370" Title="How to mark risky variable as safe?" Tags="|customize|file-local-variables|directory-local-variables|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27895" PostTypeId="1" CreationDate="2016-10-17T21:51:23.077" Score="0" ViewCount="474" Body="&lt;p&gt;Problem: When a C++ file is loaded, the indentation rules are not always what they should be, i.e. instead  of indenting by 3, it will indent by 1 or 8 for that session. This occurs consistently through the buffer, as if I have changed the variable for &lt;code&gt;offset&lt;/code&gt; and/or &lt;code&gt;indent&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code I have in general configurations file that is loaded by my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;No tabs, set to 3 spaces when found&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 3)&#xA;&#xA;;;C AND C++&#xA;;;---------&#xA;(setq c-default-style &quot;linux&quot;&#xA;   c-basic-offset 3&#xA;   c-basic-indent 3&#xA;   indent-tabs-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To reiterate: sometimes the file will load and the indentation rules, as given above, will load correctly and work just fine. However, very often it will not and will have a 'new' rule in the session, indenting by some new amount X of spaces. Going to &lt;code&gt;M-x Customize Variable&lt;/code&gt; and checking &lt;code&gt;c-basic-offset&lt;/code&gt; and &lt;code&gt;c-basic-indent&lt;/code&gt; shows they are custom set and &lt;code&gt;c-default-style&lt;/code&gt; shows linux as it should. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only other thing I have to say is that emacs does not know it has loaded a C++ file all the time and will say &lt;code&gt;C/l&lt;/code&gt; mode instead of &lt;code&gt;C++/l&lt;/code&gt; mode, requiring me to manually switch to that. Regardless, when indentation isn't working as it should, both modes act up. When it isn't, both modes indent as they should. Other modes that I have loaded (that I could see /potentially/ influencing this) include Company(vanilla), Flycheck, and Electric Indent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My emacs configuration isn't crazy or that complex, so I have no problem giving my github here if that will help.&lt;/p&gt;&#xA;" OwnerUserId="11660" LastActivityDate="2016-10-24T15:31:41.147" Title="Inconsistent Indentation for C/C++ Upon Loading File" Tags="|init-file|indentation|c++|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27896" PostTypeId="1" CreationDate="2016-10-17T23:35:43.087" Score="0" ViewCount="452" Body="&lt;p&gt;I am using a triangle workflow. Upstream is called &lt;code&gt;upstream&lt;/code&gt; and my forked repository is called &lt;code&gt;fork&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to have multiple branches and each of those branches should exist both locally as well as in my forked remote repository. My plan is to synchronize from my fork into a local feature branch, work on it some, and push it to the corresponding branch on my forked repository again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I create the branches in &lt;code&gt;fork&lt;/code&gt; (using Github's UI), I can't seem to get my local repository to pull that new branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried pulling from &lt;code&gt;fork&lt;/code&gt; as well as &lt;code&gt;upstream&lt;/code&gt;, but neither works. I can only think I'm doing something stupid - anyone care to tell me what? &lt;/p&gt;&#xA;" OwnerUserId="13692" LastEditorUserId="306" LastEditDate="2016-10-21T18:15:29.383" LastActivityDate="2016-11-28T10:58:15.827" Title="magit - triangle workflow with branches in fork" Tags="|magit|git|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27897" PostTypeId="1" CreationDate="2016-10-18T01:46:31.707" Score="1" ViewCount="1407" Body="&lt;p&gt;I have multiple syntax checkers installed for Flycheck (specifically &lt;code&gt;javascript-eslint&lt;/code&gt; and &lt;code&gt;javascript-standard&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I have them set up is not compatible (one demands semicolons, one prohibits them etc.) and my question is &lt;em&gt;how&lt;/em&gt; does flycheck pick which one to use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently their &quot;predicate&quot;s are both found and they are both enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way I have found to make sure standard is used, is to disable eslint in my .emacs and close and reopen emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, once I have done that, disabling standard and enabling eslint doesn't appear to do anything (even very obvious errors are not flagged).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could I have some help on how to quickly switch between the two modes (or at least switch after visiting a buffer) and how to tell which checker is currently active?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2017-01-21T19:41:01.977" Title="How does priority work with multiple checkers in Flycheck mode?" Tags="|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27898" PostTypeId="2" ParentId="27892" CreationDate="2016-10-18T01:52:40.113" Score="1" Body="&lt;p&gt;This approach uses Emacs macros to do what you need. Follow the steps given below. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use the &lt;kbd&gt;F3&lt;/kbd&gt; to start recording your macro.&lt;/li&gt;&#xA;&lt;li&gt;Assuming that your point is somewhere in the first line of the&#xA;paragraph that you wish to apply italic formatting, press &lt;code&gt;C-a&lt;/code&gt;.&#xA;This takes the cursor to the beginning of the line.&lt;/li&gt;&#xA;&lt;li&gt;Type the &lt;code&gt;/&lt;/code&gt; key and press &lt;code&gt;C-e&lt;/code&gt; to move the cursor to the end of&#xA;the current line and type &lt;code&gt;/&lt;/code&gt; again. Notice that your line is&#xA;already has italic formatting applied in org-mode.&lt;/li&gt;&#xA;&lt;li&gt;Move your point to the next line and press &lt;code&gt;C-a&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;kbd&gt;F4&lt;/kbd&gt; to stop recording your macro.&lt;/li&gt;&#xA;&lt;li&gt;Assuming you will re-use this macro, let us give this macro a name&#xA;and save it for future use. Use the command &lt;code&gt;M-x&#xA;name-last-kbd-macro&lt;/code&gt; and give your macro a name. For example:&#xA;&lt;em&gt;para_italic&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Select (&lt;code&gt;C-spc&lt;/code&gt;) the paragraph (only one paragraph) at a time and&#xA;use the command &lt;code&gt;M-x apply-macro-to-region-lines&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To learn more about using keyboard macros, you can refer,   &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/KeyboardMacros&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;YouTube &lt;a href=&quot;https://www.youtube.com/results?search_query=emacs+macros&quot; rel=&quot;nofollow&quot;&gt;videos&lt;/a&gt; on Emacs macros. I'm following Mike Zamansky. His videos are good.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-10-18T01:52:40.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27899" PostTypeId="1" AcceptedAnswerId="27949" CreationDate="2016-10-18T02:52:49.567" Score="6" ViewCount="4433" Body="&lt;p&gt;My &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; file looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;(require 'init-my-emacs-settings)&#xA;(require 'init-my-emacs-performance)&#xA;(require 'init-my-emacs-font)&#xA;(require 'init-my-emacs-color-theme)&#xA;(require 'init-my-emacs-appearance)&#xA;&#xA;(require 'init-my-tool-calendar)&#xA;(require 'init-my-tool-dictionary)&#xA;(require 'init-my-tool-clock)&#xA;(require 'init-my-tool-speak)&#xA;&#xA;(require 'init-my-prog-programming)&#xA;(require 'init-my-prog-license)&#xA;(require 'init-my-prog-code)&#xA;(require 'init-my-prog-comment)&#xA;&#xA;;;; Programming Languages&#xA;(require 'init-my-prog-lang-lisp)&#xA;(require 'init-my-prog-lang-emacs-lisp)&#xA;(require 'init-my-prog-lang-common-lisp)&#xA;(require 'init-my-prog-lang-clojure)&#xA;(require 'init-my-prog-lang-ruby)&#xA;(require 'init-my-prog-lang-python)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope to load them &lt;strong&gt;only when needed&lt;/strong&gt;. If for init files like&#xA;&lt;code&gt;init-my-emacs-settings&lt;/code&gt; can&amp;rsquo;t be lazy load. Then I hope lazy load for programming&#xA;languages init files like &lt;code&gt;init-my-prog-lang-lisp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my simple idea to load programming language init files only when load major-mode hook.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; TODO: convert code into an macro.&#xA;&#xA;(defvar init-my-prog-lang-lisp-loaded nil)&#xA;(add-hook 'lisp-mode-hook&#xA;          (lambda ()&#xA;            (unless init-my-prog-lang-lisp-loaded&#xA;              (require 'init-my-prog-lang-lisp)&#xA;              (setq init-my-prog-lang-lisp-loaded t))&#xA;            ))&#xA;&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;(defun symbol-concat (symbol string)&#xA;  (intern (concat (symbol-name symbol) string)))&#xA;&#xA;;; (type-of (symbol-concat 'ruby-mode-hook &quot;-p&quot;))&#xA;&#xA;(defmacro my-lazy-load-init-file (init-file mode)&#xA;  &quot;Lazy load my `INIT-FILE' only when `MODE' loaded.&quot;&#xA;  (let ((state (symbol-concat init-file &quot;-loaded&quot;)))&#xA;    ;; state variable&#xA;    (defvar state nil)&#xA;    ;; load on major-mode hook&#xA;    (add-hook (symbol-concat mode &quot;-hook&quot;)&#xA;              (lambda ()&#xA;                (unless state&#xA;                  (require init-file)&#xA;                  (setq state t)&#xA;                  )))&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My questions:&#xA;- how to improve this macro?&#xA;- Do you have better solution? If have, please show me. Thanks&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="10269" LastEditDate="2018-05-31T22:06:41.530" LastActivityDate="2018-05-31T22:06:41.530" Title="How to lazy load init files to speedup Emacs startup?" Tags="|init-file|start-up|autoload|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="27900" PostTypeId="1" CreationDate="2016-10-18T04:41:51.353" Score="2" ViewCount="278" Body="&lt;p&gt;What is the relationship between the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Faces.html#Basic-Faces&quot; rel=&quot;nofollow&quot;&gt;&quot;basic&quot; faces&lt;/a&gt; defined in &lt;code&gt;faces.el&lt;/code&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces-for-Font-Lock.html&quot; rel=&quot;nofollow&quot;&gt;&quot;font-lock&quot; faces&lt;/a&gt; in &lt;code&gt;font-lock.el&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial impression was that basic faces, like &lt;code&gt;bold&lt;/code&gt; and &lt;code&gt;fixed-pitch&lt;/code&gt;, are based on &lt;em&gt;style&lt;/em&gt; rather than &lt;em&gt;semantics&lt;/em&gt;. The font-lock faces, in contrast, are based on semantics rather than style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Closer inspection shows that this is not accurate, however. For example, there is both a &lt;code&gt;warning&lt;/code&gt; face in &lt;code&gt;faces.el&lt;/code&gt; and a &lt;code&gt;font-lock-warning-face&lt;/code&gt; in &lt;code&gt;font-lock.el&lt;/code&gt;. There are also some basic faces, like &lt;code&gt;success&lt;/code&gt; and &lt;code&gt;error&lt;/code&gt;, that are clearly semantic, but without font-lock counterparts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything more than historical accident (font-lock, I believe, was introduced by &lt;a href=&quot;https://en.wikipedia.org/wiki/XEmacs&quot; rel=&quot;nofollow&quot;&gt;XEmacs&lt;/a&gt;, an Emacs fork) that there are two sets of general-purpose faces? Would it be desirable to unify them into a single set? Are there any plans to do so?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-10-18T04:41:51.353" Title="Faces vs. font-lock faces" Tags="|faces|font-lock|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27901" PostTypeId="2" ParentId="27892" CreationDate="2016-10-18T05:16:43.930" Score="3" Body="&lt;p&gt;The maximum number of newlines allowed in an Org emphasis expression is controlled by the last element in &lt;code&gt;org-emphasis-regexp-components&lt;/code&gt;. As is mentioned in the docstring, you need to reload Org after changing this variable to take effect:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setf (nth 4 org-emphasis-regexp-components) 10)&#xA;(load-library &quot;org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-10-18T05:16:43.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27903" PostTypeId="2" ParentId="27882" CreationDate="2016-10-18T08:49:57.507" Score="1" Body="&lt;p&gt;I use &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsLispScreen&quot; rel=&quot;nofollow noreferrer&quot;&gt;elscreen&lt;/a&gt; for tabs.  I don't think you have to rely on the OS to get tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bLb5h.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bLb5h.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7091" LastActivityDate="2016-10-18T08:49:57.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27906" PostTypeId="1" AcceptedAnswerId="27910" CreationDate="2016-10-18T11:23:47.507" Score="4" ViewCount="1290" Body="&lt;p&gt;I have two displays and different frames on each. Each display has very different DPI so I need different fonts sizes for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set different fonts sizes for different frames (font size changes not applied globally)?&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-12-20T16:35:11.877" Title="How to change font of current frame?" Tags="|fonts|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27908" PostTypeId="2" ParentId="27899" CreationDate="2016-10-18T13:18:34.823" Score="3" Body="&lt;p&gt;I'd recommend two things to speedup startup:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Merge your many init files into a single large file.&lt;/li&gt;&#xA;&lt;li&gt;Look at the content of your init files and try to make sure that they don't &lt;code&gt;require&lt;/code&gt; or &lt;code&gt;load&lt;/code&gt; but instead, they should just use &lt;code&gt;setq&lt;/code&gt;, &lt;code&gt;add-hook&lt;/code&gt;, and &lt;code&gt;eval-after-load&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-18T13:18:34.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27910" PostTypeId="2" ParentId="27906" CreationDate="2016-10-18T14:17:37.030" Score="3" Body="&lt;p&gt;You could also change  font like so :- &lt;code&gt;(set-frame-font &quot;PragmataPro 13&quot;)&lt;/code&gt;, &#xA;where the 2nd argument is the size you want to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: if you are running emacsclient by connecting to an emacs daemon process, the above answer will not work. Instead put this in your &lt;code&gt;init.el&lt;/code&gt;: &lt;code&gt;(setq default-frame-alist '((font . &quot;PragmataPro-13&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-12-20T16:35:11.877" LastActivityDate="2016-12-20T16:35:11.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27911" PostTypeId="1" CreationDate="2016-10-18T16:25:01.857" Score="0" ViewCount="899" Body="&lt;p&gt;Hi fellow Emacs users,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm experience very slower performance of 25.1 but a startup with -Q indicated the problem is probably caused by my old packages.&#xA;(Similar scenario: &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/55ork0/is_emacs_251_noticeably_slower_than_245_on_windows/&quot; rel=&quot;nofollow&quot;&gt;https://www.reddit.com/r/emacs/comments/55ork0/is_emacs_251_noticeably_slower_than_245_on_windows/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Removing all the old byte-compiled package files in ELPA (and perhaps also in other folders? please suggest) will be necessary. But I'm paranoid as to keeping some older contents suited version 24 will also affect version 25. So I am planning to refresh every packages to their latest versions, and remove those obsolete packages with obviously suspended maintenance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I foresee that I need to remove the content of the whole ELPA folder manually; but for re-downloading the packages to the ELPA folder, I don't want to compare a previously saved list visually and add them one by one manually in package-list-packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a smarter way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="6942" LastActivityDate="2016-12-15T19:34:01.167" Title="How can I refresh the ELPA directory content without having to select and re-download the packages manually? (for slowed ver. 25.1 in Windows 10)" Tags="|package|package-repositories|byte-compilation|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27912" PostTypeId="1" CreationDate="2016-10-18T16:47:35.787" Score="15" ViewCount="2332" Body="&lt;p&gt;More often than not, when I open a dired buffer, I press&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;(&lt;/code&gt; to run &lt;code&gt;dired-hide-details-mode&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;s&lt;/code&gt; to run&lt;code&gt;dired-sort-toggle-or-edit&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What's a good way to have these done automatically every time I open a dired buffer?&lt;/p&gt;&#xA;" OwnerUserId="163" LastEditorUserId="163" LastEditDate="2016-10-18T22:44:50.467" LastActivityDate="2016-10-18T22:44:50.467" Title="dired - sort and hide by default" Tags="|dired|sorting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27913" PostTypeId="2" ParentId="27912" CreationDate="2016-10-18T17:00:53.760" Score="15" Body="&lt;p&gt;Thanks to Dan's comment on the original question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'dired-mode-hook&#xA;      (lambda ()&#xA;        (dired-hide-details-mode)&#xA;        (dired-sort-toggle-or-edit)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="163" LastActivityDate="2016-10-18T17:00:53.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27915" PostTypeId="1" CreationDate="2016-10-18T21:29:51.957" Score="0" ViewCount="22" Body="&lt;p&gt;The key &lt;code&gt;C-SPC&lt;/code&gt; is not working in RHEL 6.7 GNOME 2.28.2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try &lt;code&gt;C-h k&lt;/code&gt; and then hit &lt;code&gt;C-SPC&lt;/code&gt; I see the following message on the mini-buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-@ is undefined &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is, &lt;code&gt;SPC&lt;/code&gt; is mistaken for &lt;code&gt;@&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4003" LastActivityDate="2016-10-18T21:29:51.957" Title="C-C C-SPC not working in RHEL 6.7 GNOME 2.28.2" Tags="|key-bindings|" AnswerCount="0" CommentCount="5" ClosedDate="2016-10-19T15:05:14.493" ContentLicense="CC BY-SA 3.0" />
  <row Id="27916" PostTypeId="2" ParentId="26363" CreationDate="2016-10-18T21:44:16.510" Score="27" Body="&lt;p&gt;set option in your emacs init file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-image-actual-width nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And add this property upon image link:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: fig:figure name&#xA;#+CAPTION: figure name&#xA;#+ATTR_ORG: :width 200&#xA;#+ATTR_LATEX: :width 2.0in&#xA;#+ATTR_HTML: :width 200&#xA;[[file:./file.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The width value &lt;code&gt;200&lt;/code&gt; and &lt;code&gt;2.0in&lt;/code&gt; can be any inch number value if you want.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2020-07-30T00:21:03.517" LastActivityDate="2020-07-30T00:21:03.517" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="27918" PostTypeId="1" CreationDate="2016-10-19T01:37:17.830" Score="4" ViewCount="661" Body="&lt;p&gt;I am trying to run an identical emacsserver setup as the emacs I normally use.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having issues because the emacsserver has a different &lt;code&gt;exec-path&lt;/code&gt; variable when it starts than when normal &lt;code&gt;emacs&lt;/code&gt; does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start emacsserver I am using:&#xA;&lt;code&gt;/usr/bin/emacs --daemon&lt;/code&gt; in a systemd script.  To start emacs normally I just type &lt;code&gt;emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacsserver (which I connect to by typing emacsclient&lt;code&gt;) has the following value for&lt;/code&gt;exec-path`:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    exec-path is a variable defined in `C source code'.&#xA;    Its value is&#xA;    (&quot;PATH&quot; &quot;/usr/local/sbin&quot; &quot;/usr/local/bin&quot; &quot;/usr/sbin&quot; &quot;/usr/bin&quot; &quot;/sbin&quot; &quot;/bin&quot; &quot;/usr/lib/emacs/24.5/x86_64-linux-gnu&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas &quot;normal&quot; emacs has the full path I normally use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;exec-path is a variable defined in `C source code'.&#xA;Its value is&#xA;(&quot;/usr/local/sbin&quot; &quot;/usr/local/bin&quot; &quot;/usr/sbin&quot; &quot;/usr/bin&quot; &quot;/sbin&quot; &quot;/bin&quot; &quot;/usr/games&quot; &quot;/usr/local/games&quot; &quot;/snap/bin&quot; &quot;/bin&quot; &quot;/usr/local/bin&quot; &quot;/sbin&quot; &quot;/usr/bin&quot; &quot;/usr/local/sbin&quot; &quot;/opt/node-v4.2.1-linux-x64/bin&quot; &quot;/opt/node-v4.2.1-li\&#xA;nux-x64/bin/node&quot; &quot;/home/optonox/.npm-global/bin&quot; &quot;/usr/local/mongodb/bin&quot; &quot;/snap/bin&quot; &quot;/bin&quot; &quot;/usr/local/bin&quot; &quot;/sbin&quot; &quot;/usr/bin&quot; &quot;/usr/local/sbin&quot; &quot;/opt/node-v4.2.1-linux-x64/bin&quot; &quot;/opt/node-v4.2.1-linux-x64/bin/node&quot; &quot;/home/optono\&#xA;x/.npm-global/bin&quot; &quot;/usr/local/mongodb/bin&quot; &quot;/usr/lib/emacs/24.5/x86_64-linux-gnu&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is this happening / can I start it normally somehow?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2020-06-30T23:46:05.720" Title="Why is exec-path different in emacsclient / emacsserver than in emacs?" Tags="|emacsclient|path|exec-path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27920" PostTypeId="1" CreationDate="2016-10-19T02:48:12.780" Score="4" ViewCount="746" Body="&lt;p&gt;I am using aquamacs and latex mode, 'Symbol’s value as variable is void: last-command-char when trying to insert bracket' occurs when I am trying to insert a bracket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I do, thank you &lt;/p&gt;&#xA;" OwnerUserId="13700" LastActivityDate="2016-11-18T15:50:05.403" Title="Symbol’s value as variable is void: last-command-char when trying to insert bracket" Tags="|latex|aquamacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27921" PostTypeId="1" AcceptedAnswerId="27924" CreationDate="2016-10-19T03:05:21.137" Score="5" ViewCount="632" Body="&lt;p&gt;In org mode I go to a subtree. This subtree contains lots of text, let's say a thousand lines. I want to look up some information in it. I got it, but now I want to collapse that subtree I'm in directly with a keystroke. That's all. But it seems that I need to go with the cursor to the heading before I can use TAB for visiblity cycling. Jumping to the heading takes time and is tedious. When I use TAB inside the subtree text nothing happens and I haven't found any other way to collapse the subtree directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at the manuals and internet but I couldn't find any solution. Stackexchange is my last resort. Since I'm not a coder I can't help myself here programming a lisp function to solve the problem. Additonally I think this is useful also for other users and I would have needed it very often myself.&lt;/p&gt;&#xA;" OwnerUserId="11055" LastActivityDate="2022-02-14T02:37:19.470" Title="Org-Mode cycling inside subtree impossible?" Tags="|org-mode|code-folding|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27922" PostTypeId="2" ParentId="27921" CreationDate="2016-10-19T05:06:46.663" Score="5" Body="&lt;p&gt;The Org manual section &lt;a href=&quot;http://orgmode.org/manual/Motion.html&quot; rel=&quot;nofollow&quot;&gt;2.4 Motion&lt;/a&gt; describes the key bindings to be used for navigation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your case I think   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt; C-c C-p   (outline-previous-visible-heading)  &#xA;                 Previous heading. &#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would cater the requirement. When you are within a sub heading with lots of lines just use &lt;code&gt;C-c C-p&lt;/code&gt; to navigate to the heading and press the &lt;kbd&gt;Tab&lt;/kbd&gt; key to collapse the heading.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="10936" LastEditDate="2016-10-20T08:54:26.297" LastActivityDate="2016-10-20T08:54:26.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27923" PostTypeId="2" ParentId="27921" CreationDate="2016-10-19T05:07:39.050" Score="2" Body="&lt;p&gt;&lt;kbd&gt;C-u &amp;lt;tab&amp;gt;&lt;/kbd&gt; (&lt;code&gt;#'org-cycle&lt;/code&gt;) will collapse all top-level trees. This might or might not be what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, you can move up to the parent heading (repeating it to go more than one level up) with &lt;kbd&gt;C-c C-u&lt;/kbd&gt; (&lt;code&gt;#'outline-up-heading&lt;/code&gt;), and then press &lt;code&gt;tab&lt;/code&gt; to collapse it.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2016-10-19T18:51:03.350" LastActivityDate="2016-10-19T18:51:03.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27924" PostTypeId="2" ParentId="27921" CreationDate="2016-10-19T05:08:11.903" Score="8" Body="&lt;p&gt;Something like this ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-cycle-previous-heading ()&#xA;  (interactive)&#xA;  (outline-previous-heading)&#xA;  (org-cycle))&#xA;&#xA;(define-key org-mode-map (kbd &quot;C-x C-l&quot;) 'my-cycle-previous-heading)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-19T08:06:01.090" LastActivityDate="2016-10-19T08:06:01.090" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27925" PostTypeId="2" ParentId="27918" CreationDate="2016-10-19T06:29:19.087" Score="4" Body="&lt;p&gt;&lt;code&gt;exec_path&lt;/code&gt; is initialized from the &lt;code&gt;EMACSPATH&lt;/code&gt; and &lt;code&gt;PATH&lt;/code&gt; environment variables. Emacs also adds the directory containing the emacs binary to the end. This is done at startup by &lt;code&gt;init_callproc_1&lt;/code&gt; in &lt;code&gt;callproc.c&lt;/code&gt; (&lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/callproc.c#n1466&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/callproc.c#n1466&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;systemd.exec&lt;/code&gt; man page has a section about the environment variables it sets whenever it starts a process. Here's what it has to say about &lt;code&gt;PATH&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   $PATH&#xA;       Colon-separated list of directories to use when launching executables. Systemd uses a fixed value of&#xA;       /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since that matches very well with your &lt;code&gt;exec-path&lt;/code&gt;, the only real mystery is why you're ending up with the string &lt;code&gt;&quot;PATH&quot;&lt;/code&gt; in there; that's kinda weird.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-19T06:29:19.087" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27926" PostTypeId="1" AcceptedAnswerId="27943" CreationDate="2016-10-19T07:39:42.910" Score="11" ViewCount="2494" Body="&lt;p&gt;Okay, this is a persistent problem for me. As I continue to use emacs more and more, I'm starting to customize it to my needs by installing the packages(and/or defining functions) and the one big problem I face when I configure a package is:- what keybinding to use for commands. I do not want to overwrite the global key bindings emacs ships with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, to check if a &lt;code&gt;key-binding&lt;/code&gt; is being used for a command or not, I execute &lt;code&gt;counsel-discbinds&lt;/code&gt; and enter the &lt;code&gt;key-binding&lt;/code&gt; to see if it's already mapped to a command. If not, I proceed to map it to a command. But there is another problem, &lt;code&gt;counsel-descbinds&lt;/code&gt; shows mapping only the current active &lt;code&gt;major-mode&lt;/code&gt;. There have been times when I realized OH! I have overwritten another &lt;code&gt;major-mode&lt;/code&gt; binding with this command and I had to again remap to another binding( which sucks :| ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what can I do to avoid overwriting &lt;code&gt;global-key-bindings&lt;/code&gt;. Is there something that lists all the unused key bindings that I could use for a command (which is not being used for any other &lt;code&gt;major-mode&lt;/code&gt;). And whats a good rule of thumb whenever I'm creating new bindings for commands?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Adding to the list of answers, I came across these two commands which I find to be very useful when you want to define key bindings:-&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(describe-personal-keybindings)&lt;/code&gt; defined in &lt;code&gt;bind-key&lt;/code&gt; (which comes with &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;). This lists all the &lt;code&gt;key-bindings&lt;/code&gt; which are made by the enduser according to mode specific maps.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;free-keys&lt;/code&gt; command defined in the package &lt;a href=&quot;https://github.com/Fuco1/free-keys&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;free-keys.el&lt;/code&gt;&lt;/a&gt;. This will show all the key chords which aren't bound to any command for the current buffer. You can also change the prefix key to something like &lt;code&gt;C-c&lt;/code&gt;, to list all the unbound key chords.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-10-19T19:52:33.823" LastActivityDate="2021-04-12T14:03:07.370" Title="Avoiding overwriting global key bindings" Tags="|key-bindings|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27927" PostTypeId="2" ParentId="27926" CreationDate="2016-10-19T07:46:56.960" Score="5" Body="&lt;p&gt;One rule of thumb is that &lt;code&gt;C-c &amp;lt;letter&amp;gt;&lt;/code&gt; are reserved for end users, so they should not be used by any package.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-10-19T07:46:56.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27928" PostTypeId="1" CreationDate="2016-10-19T07:54:05.103" Score="2" ViewCount="76" Body="&lt;p&gt;When I type &lt;code&gt;&amp;lt;TAB&amp;gt;&lt;/code&gt; in a LaTeX file anywhere on a comment line, the comment symbol is moved to the beginning of the previous non-blank line. This also occurs with &lt;code&gt;M-x indent-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to protect comment lines from indentation and to keep them exactly as I type them? I have tried to set &lt;code&gt;comment-style&lt;/code&gt; to &lt;code&gt;plain&lt;/code&gt;, to no avail... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had the same problem in the past with Fortran 90 files. For some reason, it disappeared in more recent versions of Emacs (I use GNU Emacs 24.3.1), so I hope it should be possible with LaTeX files too.&lt;/p&gt;&#xA;" OwnerUserId="13702" LastActivityDate="2016-10-19T07:54:05.103" Title="How to protect LaTeX comment lines from indentation?" Tags="|latex|indentation|comment|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27929" PostTypeId="1" CreationDate="2016-10-19T09:12:27.697" Score="3" ViewCount="1262" Body="&lt;p&gt;I am using the &lt;code&gt;Python&lt;/code&gt; mode with Emacs 25.1.1 to send parts of my python scripts to an ipython console. I have the problem that both the input and the output is not shown in the python window. Whenever I use &lt;code&gt;C-c C-c&lt;/code&gt; the line is sent to the console and is executed but in the window only an additional line number shows up. Neither the input nor the output is visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;C-c C-p&lt;/code&gt; to start the python console I get the error message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native’ was t and &quot;ipython&quot; is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10405" LastActivityDate="2017-01-17T11:43:29.630" Title="Input and Output does not show up in python mode" Tags="|python|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27930" PostTypeId="1" AcceptedAnswerId="27997" CreationDate="2016-10-19T10:33:07.957" Score="0" ViewCount="342" Body="&lt;p&gt;I sometimes explore customisable variables in &lt;code&gt;Custom-mode&lt;/code&gt; to get a structured overview, before manually setting them with &lt;code&gt;setq-default&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt;. Can I make &lt;code&gt;Custom-mode&lt;/code&gt; show the Lisp names of the variables/faces &lt;em&gt;in addition to&lt;/em&gt; the having access to the TUI widgets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like these:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;custom-variable-default-form&lt;/code&gt;&#xA;&lt;code&gt;custom-face-default-form&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can be set to &lt;code&gt;edit&lt;/code&gt; for widgets and &lt;code&gt;lisp&lt;/code&gt; for lisp names. However:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You cannot show both. In particular, choices are not listed in &lt;code&gt;lisp&lt;/code&gt; mode, and choices are often not listed in the description, and &lt;code&gt;xref-find-definitions&lt;/code&gt; fails to go to the source.&lt;/li&gt;&#xA;&lt;li&gt;They do not take priority over &lt;code&gt;defcustom&lt;/code&gt;'s &lt;code&gt;:custom-form&lt;/code&gt;. In practice this doesn't seem likely to be an issue. My Emacs Lisp is not great, but maybe adding advice to e.g. &lt;code&gt;custom-variable-value-create&lt;/code&gt; can override this.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3985" LastEditorUserId="3985" LastEditDate="2016-10-19T22:04:34.553" LastActivityDate="2016-10-21T16:11:02.350" Title="Show name of variable in Custom-mode" Tags="|custom|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27931" PostTypeId="2" ParentId="27906" CreationDate="2016-10-19T10:39:45.967" Score="1" Body="&lt;p&gt;I figured out the second parameter of &lt;code&gt;set-face-attribute&lt;/code&gt; correspond to what frame you want the face-attribute to change so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; on my retina display (2880x1800)&#xA;(set-face-attribute 'default (selected-frame) :font &quot;Source Code Pro&quot; :height 140 :weight 'medium)&#xA;&#xA;;; on my 4k external display (3840 x 2160)&#xA;(set-face-attribute 'default (selected-frame) :font &quot;Source Code Pro&quot; :height 210 :weight 'medium)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case I'm only changing the font &lt;code&gt;:height&lt;/code&gt;. Anyway, I'm setting &lt;a href=&quot;https://emacs.stackexchange.com/a/27910/308&quot;&gt;this&lt;/a&gt; as valid answer because it is the one I will be using.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-10-19T10:39:45.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27932" PostTypeId="2" ParentId="27929" CreationDate="2016-10-19T10:46:33.243" Score="1" Body="&lt;p&gt;You can try to set &lt;code&gt;ipython&lt;/code&gt; as a python shell interpreter using the following line: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter &quot;ipython&quot; python-shell-interpreter-args &quot;--simple-prompt --pprint&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;elpy&lt;/code&gt; and it works on my settings, just ignore the warnings and go to the &lt;code&gt;Python&lt;/code&gt; buffer. Just for information, you need to add &lt;code&gt;--simple-prompt&lt;/code&gt; because IPython 5 doesn't support Emacs inferior shell anymore as stated in the IPython doc: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The new interface is not compatible with Emacs ‘inferior-shell’&#xA;  feature. To continue using this, add the --simple-prompt flag to the&#xA;  command Emacs runs. This flag disables most IPython features, relying&#xA;  on Emacs to provide things like tab completion. current doc, you have&#xA;  the following line&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;More info on the documentation page &lt;a href=&quot;http://ipython.readthedocs.io/en/stable/whatsnew/version5.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should also add that beside the issue with IPython, there is a related known bug between Emacs 25 (and &gt;25) and  Python 3.5, it warns about no readline support (&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401&quot; rel=&quot;nofollow&quot;&gt;bug report&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="325" LastActivityDate="2016-10-19T10:46:33.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27934" PostTypeId="2" ParentId="27926" CreationDate="2016-10-19T14:07:17.527" Score="2" Body="&lt;p&gt;I'm not sure exactly what you're asking, but maybe this will help.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Command &lt;code&gt;describe-keymap&lt;/code&gt;, bound to &lt;strong&gt;&lt;code&gt;C-h M-k&lt;/code&gt;&lt;/strong&gt;, from library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/help-fns%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/a&gt; shows you all of the key bindings &lt;em&gt;for a given keymap&lt;/em&gt; (whether keymap variable or the keymap itself).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;, &lt;strong&gt;&lt;code&gt;S-TAB&lt;/code&gt;&lt;/strong&gt; shows you &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Key_Completion&quot; rel=&quot;nofollow&quot;&gt;all of the keys &lt;em&gt;currently available&lt;/em&gt;&lt;/a&gt; (from all accessible keymaps), together with their commands.  Works for prefix keys too: &lt;code&gt;C-x S-TAB&lt;/code&gt; shows all keys on the prefix key &lt;code&gt;C-x&lt;/code&gt;. (Works even for menus.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;strong&gt;&lt;code&gt;C-h&lt;/code&gt;&lt;/strong&gt; after a prefix key shows the keys bound with that prefix. For example, &lt;code&gt;C-x C-h&lt;/code&gt; shows you all of the keys that have prefix key &lt;code&gt;C-x&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-19T14:07:17.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27935" PostTypeId="1" AcceptedAnswerId="27960" CreationDate="2016-10-19T14:44:11.610" Score="4" ViewCount="599" Body="&lt;p&gt;Here's an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro test (arg)&#xA;  `(message foo-,arg))&#xA;&#xA;(defmacro test-with-space (arg)&#xA;  `(message foo- ,arg))&#xA;&#xA;(macroexpand-1 '(test-with-space bar))&#xA;(macroexpand-1 '(test bar))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both eval to &lt;code&gt;(message foo -bar)&lt;/code&gt;. Intuitively to me it should eval to &lt;code&gt;(message foo-bar)&lt;/code&gt; and &lt;code&gt;(message foo -bar)&lt;/code&gt; respectively. Am I using backquotes incorrectly or is this a feature? If not, is there a way to do what I'm trying to do without polluting code with  &lt;code&gt;intern&lt;/code&gt; and &lt;code&gt;format&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10263" LastEditorUserId="105" LastEditDate="2016-10-19T14:55:10.907" LastActivityDate="2016-10-20T11:15:27.470" Title="Elisp backquote comma eval puts a space in between" Tags="|elisp|backquote|" AnswerCount="2" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="27936" PostTypeId="2" ParentId="27926" CreationDate="2016-10-19T14:51:44.610" Score="2" Body="&lt;p&gt;Another helpful shortcut if you are unsure about a specific key-binding you want to use: &lt;code&gt;C-h c &amp;lt;key sequence&amp;gt;&lt;/code&gt; will tell you if what function is bound to a given key sequence. In addition to the answers above, this can be a good way to double-check that there isn't a binding in another mode.&lt;/p&gt;&#xA;" OwnerUserId="11286" LastEditorUserId="11286" LastEditDate="2016-10-19T15:03:43.777" LastActivityDate="2016-10-19T15:03:43.777" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27937" PostTypeId="2" ParentId="27920" CreationDate="2016-10-19T15:05:01.960" Score="6" Body="&lt;p&gt;&lt;code&gt;last-command-char&lt;/code&gt; was a variable made obsolete in Emacs-19.34 when it was replaced by &lt;code&gt;last-command-event&lt;/code&gt; (because in older Emacsen, events were only characters).  It was finally removed in Emacs-24.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So some Elisp code you're using still refers to that variable and needs to be updated.  Just &lt;code&gt;grep&lt;/code&gt; for that name in your files to see which thing needs to be updated.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-19T15:05:01.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27938" PostTypeId="1" CreationDate="2016-10-19T15:16:42.283" Score="2" ViewCount="1152" Body="&lt;p&gt;In LaTeX, I use extra spacing to separate sentences from each other.&#xA;This may for instance be achieved by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\spaceskip=.33333em plus .16667em  minus .083333em &#xA;\xspaceskip=.8em plus .4em minus .13333em&#xA;\nonfrenchspacing&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With these settings I must take care to make it known when I want to&#xA;use a full stop for something other than ending a period, such as&#xA;marking an abbreviation.&#xA;This I do by typing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Mr.\ Charles&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&amp;amp;c.  But if I write &lt;code&gt;Mr.\ Charles&lt;/code&gt; in an org buffer and export to&#xA;LaTeX, I get a literal &lt;code&gt;\&lt;/code&gt; in my pdf, which corresponds to &lt;code&gt;\\&lt;/code&gt; in&#xA;the exported source.  How can I get &lt;code&gt;\&lt;/code&gt; in the source and a normal&#xA;space skip in the typeset document?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can do &lt;code&gt;Mr.@@latex:\@@ Charles&lt;/code&gt;, but is there no better way?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2017-12-10T13:31:01.663" Title="Org mode export of intraperiodic spaces" Tags="|org-mode|org-export|latex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27939" PostTypeId="2" ParentId="24050" CreationDate="2016-10-19T15:20:16.540" Score="4" Body="&lt;p&gt;The immediate cause of this delay is a timeout withing the TRAMP package, that is a dependency of ESS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810640&quot; rel=&quot;noreferrer&quot;&gt;https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810640&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hang occurs when Emacs spawns ssh processes when initialising the&#xA;variable `tramp-ssh-controlmaster-options'.  If your ISP's DNS server&#xA;likes to hijack failed lookups to redirect the user to a branded search&#xA;engine, these ssh processes hang for a long time before timing out.&#xA;This bug affects all Emacs Lisp addons that load TRAMP as part of their&#xA;startup...&lt;/p&gt;&#xA;" OwnerUserId="13707" LastActivityDate="2016-10-19T15:20:16.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27941" PostTypeId="1" CreationDate="2016-10-19T16:44:00.523" Score="4" ViewCount="1178" Body="&lt;p&gt;I'm using Emacs 25.1 and the most recent orgmode. My problem is that I tried compiling one of the examples on Worg, but the content that's supposed to be displayed in a block is displayed on its own slide:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+STARTUP: beamer&#xA;#+TITLE:     Writing Beamer presentations in org-mode&#xA;#+AUTHOR:    Eric S Fraga&#xA;#+EMAIL:     e.fraga@ucl.ac.uk&#xA;#+DATE:      2010-03-30 Tue&#xA;#+DESCRIPTION: &#xA;#+KEYWORDS: &#xA;#+LANGUAGE:  en&#xA;#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t &amp;lt;:t&#xA;#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc&#xA;#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js&#xA;#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)&#xA;#+BEAMER_FRAME_LEVEL: 2&#xA;#+EXPORT_SELECT_TAGS: export&#xA;#+EXPORT_EXCLUDE_TAGS: noexport&#xA;#+LINK_UP:   &#xA;#+LINK_HOME:&#xA;&#xA;* A Presentation&#xA;** A more complex slide&#xA;This slide illustrates the use of Beamer blocks.  The following text,&#xA;with its own headline, is displayed in a block:&#xA;*** Org mode increases productivity               :B_theorem:&#xA;    :PROPERTIES:&#xA;    :BEAMER_env: theorem&#xA;    :END:&#xA;    - org mode means not having to remember LaTeX commands.&#xA;    - it is based on ascii text which is inherently portable.&#xA;    - Emacs!&#xA;&#xA;    \hfill \(\qed\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Did I miss something? Or is the example simply outdated, and I have to do something else?&lt;/p&gt;&#xA;" OwnerUserId="5191" LastEditorUserId="8979" LastEditDate="2017-02-22T14:20:10.167" LastActivityDate="2017-06-22T15:53:12.957" Title="Org Beamer Presentation: blocks do not work?" Tags="|org-mode|org-export|beamer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27942" PostTypeId="2" ParentId="27941" CreationDate="2016-10-19T17:13:21.987" Score="6" Body="&lt;p&gt;Please change &lt;code&gt;#+options: H:3&lt;/code&gt; to &lt;code&gt;#+options: H:2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is working for me with Emacs 25.1, Org 9.0.4.&#xA;Maybe &lt;code&gt;#+beamer_frame_level:&lt;/code&gt; became obsolete in Org9, the example is from 2010!&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2017-02-22T07:32:05.007" LastActivityDate="2017-02-22T07:32:05.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27943" PostTypeId="2" ParentId="27926" CreationDate="2016-10-19T19:10:38.777" Score="11" Body="&lt;p&gt;I find that it helps to make all your personal keybindings in a custom minor mode instead of the global map.  At its most basic, that's just a mode like this:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode my-keys-mode&#xA;  &amp;quot;Minor mode for my personal keybindings.&amp;quot;&#xA;  :global t&#xA;  :keymap (make-sparse-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This does a few useful things:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First, when you clobber a major mode's keybinding, your keybinding will take precedence, and not the other way around.  This can cause problems, but at least you aren't surprised when you press a key and it doesn't do what you expect.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;More importantly, you aren't overwriting anything, only shadowing.  If you find that you've clobbered something important, or even if you just need to check what the default binding for a key is, you can just disable &lt;code&gt;my-keys-mode&lt;/code&gt; temporarily.  (I do recommend giving &lt;code&gt;my-keys-mode&lt;/code&gt; itself a global keybinding, as the sole exception to the above advice.)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It makes it easier to revert changes.  If you decide to reset a binding to default, you can just bind it to nil in your keymap, instead of having to either restart Emacs or figure out what command you overwrote.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The one big limitation of this approach is that by default there isn't really a clean way to use it for mode-specific keybindings.  If you want to take a look at or use &lt;a href=&quot;https://github.com/aaron-harris/emacs-init/blob/master/umbra.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;my keybindings mode&lt;/a&gt;, I've added support for this that alleviates most of the problems, but I still run into precedence-related issues from time to time.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2021-04-12T14:03:07.370" LastActivityDate="2021-04-12T14:03:07.370" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="27944" PostTypeId="1" CreationDate="2016-10-19T19:26:47.947" Score="0" ViewCount="188" Body="&lt;p&gt;Emacs 24.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is init:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; appointments&#xA;&#xA;(require 'appt)&#xA;&#xA;(appt-activate t) ; I have also tried (appt-activate 1) here as the appt.el documentation says to&#xA;&#xA;; (setq appt-message-warning-time 1) I have messed around with these variables quite a bit and cannot find anything that works, so they are commented out at the moment. &#xA;&#xA;; (setq appt-display-interval 1) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried many variants of the following formats in the diary file, which is working appropriately in all other regards:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Oct 19, 2016&lt;/p&gt;&#xA;  &#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;3:00pm testing&lt;/p&gt;&#xA;    &#xA;    &lt;p&gt;15:00 testing&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am aware that the appt-message-warning-time default is 12 minutes. I have tried changing that and everything else that I can find in the documentation. I am saving the diary file each time. I have tried forcing an appt check. Nothing works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;UPDATE&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought Dieter's answer got it, but it didn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluating (appt-activate 1) in my init file did prompt Emacs to display the appointment. Speaking of that, I changed (appt-activate t) to (appt-activate 1) per the documentation instructions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, unless I manually evaluate the expression, the appointment will not diplay. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought Dieter was correct about the white space around the diary file formatting, but documentation for appt-check actually says the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note: the time must be the first thing in the line in the diary&#xA;  for a warning to be issued.  The format of the time can be either&#xA;  24 hour or am/pm.  For example:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;          02/23/89&#xA;            18:00 Dinner&#xA;&#xA;          Thursday&#xA;            11:45am Lunch meeting.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is my current init for appointments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; appointments&#xA;&#xA;(require 'appt)&#xA;&#xA;(appt-activate 1)&#xA;&#xA;(appt-check 1)&#xA;&#xA;(setq appt-message-warning-time 15)&#xA;&#xA;(setq appt-display-interval 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above is not working. What am I doing wrong? &lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="13432" LastEditDate="2016-10-20T12:59:58.110" LastActivityDate="2017-01-18T15:36:04.777" Title="Appointments not working (not displaying at all)" Tags="|diary|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27946" PostTypeId="1" AcceptedAnswerId="28003" CreationDate="2016-10-19T21:57:50.917" Score="2" ViewCount="250" Body="&lt;p&gt;I have written a snippet for &lt;code&gt;git-commit-mode&lt;/code&gt;.  However when I'm writing a commit message (from Magit), the snippet won't trigger.  Does anyone know how to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have yasnippet version 20160924.2001, and Emacs 24.5.1.&lt;/p&gt;&#xA;" OwnerUserId="514" LastActivityDate="2019-08-01T09:46:45.743" Title="Yasnippets won't expand in git-commit-mode?" Tags="|magit|yasnippet|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27947" PostTypeId="1" CreationDate="2016-10-20T00:35:36.270" Score="0" ViewCount="335" Body="&lt;p&gt;I currently have an emacs package conflict occuring. It is a difficult one to pinpoint as it happens occasionally. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have started using &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;unload-feature&lt;/code&gt; to unload packages from memory, get out of the error state and identify the package causing the conflict error.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a good start but I have noticed that not all my packages are loaded in memory. As I have 161 packages installed, including dependencies. I do not want to manually go through each one, then run unload feature, only to find out it that package is not loaded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start, is there a way to display all packages that are currently loaded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of displaying all major and minor modes as a start. But I cannot even work out how to do that!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="12780" LastEditorUserId="105" LastEditDate="2017-02-07T18:59:17.720" LastActivityDate="2017-02-07T18:59:17.720" Title="How to efficiently debug emacs package conflicts (strategies too)" Tags="|package|debugging|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27948" PostTypeId="2" ParentId="27947" CreationDate="2016-10-20T02:34:42.313" Score="2" Body="&lt;p&gt;I don't think there's a good way to show all packages that are currently loaded. You can inspect the &lt;code&gt;features&lt;/code&gt; variable, but not all loaded files may provide a feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;describe-mode&lt;/code&gt; (by default, &lt;code&gt;C-h m&lt;/code&gt;) to view the current major mode and active minor modes. Most conflicts come from minor modes clashing with each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never missing an opportunity to hawk my own wares, I recommend using &lt;a href=&quot;https://github.com/emacs-helm/helm-describe-modes&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;helm-describe-modes&lt;/code&gt;&lt;/a&gt; to better search for, view, activate, and deactivate modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having 161 packages seems excessive...though perhaps somewhat understandable if most are from transitive dependencies. As with any technology, try to avoid using what you don't understand (unless it's a very&#xA; well-maintained package for which the author has made great effort to avoid conflicts, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you provide more information about the conflict in question, we can provide more specific advice.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-10-20T02:34:42.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27949" PostTypeId="2" ParentId="27899" CreationDate="2016-10-20T02:44:21.283" Score="4" Body="&lt;p&gt;Consider using John Wiegley's &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; if you really care about startup time that much. &lt;code&gt;use-package&lt;/code&gt; provides built-in support for lazy/deferred loading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better yet, &lt;strong&gt;don't constantly restart your Emacs&lt;/strong&gt;. The best way to avoid constantly restarting is to run an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html&quot; rel=&quot;nofollow&quot;&gt;Emacs daemon&lt;/a&gt;; then you can create as many frames (both GUI and terminal) as you like that will all start instantly &lt;em&gt;and&lt;/em&gt;, as an added benefit, share buffers, history, etc. because they're clients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;a href=&quot;http://mjwall.com/blog/2013/10/04/how-i-use-emacs/&quot; rel=&quot;nofollow&quot;&gt;MJ Wall's scripts&lt;/a&gt; to easily start/stop the Emacs daemon, launch clients, etc. from the command line. I also set &lt;code&gt;ec&lt;/code&gt; (described in the article) as a startup application so I &lt;em&gt;never even notice&lt;/em&gt; the Emacs startup time, since it's part of the OS startup.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-10-20T02:44:21.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27950" PostTypeId="1" AcceptedAnswerId="27966" CreationDate="2016-10-20T03:17:02.330" Score="0" ViewCount="104" Body="&lt;p&gt;I admit it, I use tabbar. It is a bit quirky but it works for me. There is just one thing I really tried very hard to solve but it was not possible. I think mainly because a lot of people don't use tabbar so there is not so much information out there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is my tabbar config, the grouping was stolen from some other init.el but it is exactly what I need. The problem is that as soon as I click on diary (a user buffer without stars) or &lt;code&gt;*Packages*&lt;/code&gt; buffer (an emacs-buffer) the tabbar disappears. I think this is because of the different nature of diary and &lt;code&gt;*Packages*&lt;/code&gt; buffer. Now to solve this I would like the buffers to be excluded from the groups below or put in a separate group. I have no skill in coding, I tried my best but a solution is beyond me. I hope someone could help.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(use-package tabbar&#xA;:ensure t&#xA;:config&#xA;(setq tabbar-buffer-groups-function 'tabbar-buffer-groups)&#xA;(setq tabbar-background-color &quot;black&quot;)&#xA;(setq tabbar-use-images nil)&#xA;(tabbar-mwheel-mode -1)&#xA;(tabbar-mode)&#xA;(defun tabbar-buffer-groups ()&#xA;  &quot;Return the list of group names the current buffer belongs to.&#xA;This function is a custom function for tabbar-mode's tabbar-buffer-groups.&#xA;This function group all buffers into 3 groups:&#xA;Those Dired, those user buffer, and those emacs buffer.&#xA;Emacs buffer are those starting with “*”.&quot;&#xA;  (list&#xA;   (cond&#xA;    ((string-equal &quot;*&quot; (substring (buffer-name) 0 1))&#xA;     &quot;Emacs Buffer&quot;&#xA;     )&#xA;    ((eq major-mode 'dired-mode)&#xA;     &quot;Dired&quot;&#xA;     )&#xA;    (t&#xA;     &quot;User Buffer&quot;&#xA;     )&#xA;    ))))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11055" LastActivityDate="2016-10-20T13:18:28.680" Title="Exclude/Separate diary and Packages buffer from tabbar group" Tags="|tabbar|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27952" PostTypeId="1" AcceptedAnswerId="27953" CreationDate="2016-10-20T06:34:09.247" Score="1" ViewCount="203" Body="&lt;p&gt;When I insert timestamps, even if by using the calendar, org inserts something like &lt;code&gt;&amp;lt;2016-10-20 Thu&amp;gt;&lt;/code&gt;. However, I sometimes have to use machines with a different locale, which inserts &lt;code&gt;&amp;lt;2016-10-20 cs&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This, of course, I can parse, but it makes my (otherwise fully English) Org files look inconsistent. Given that Org doesn't parse the day name and inserts it for pure readability reasons[citation needed], is there a way to prevent Org inserting it at all?&lt;/p&gt;&#xA;" OwnerUserId="507" LastActivityDate="2016-10-21T15:33:59.887" Title="Make org-mode not to insert day name in timestamps" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27953" PostTypeId="2" ParentId="27952" CreationDate="2016-10-20T06:53:25.557" Score="3" Body="&lt;p&gt;Yes. You can customize the variable &lt;code&gt;org-time-stamp-custom-formats&lt;/code&gt; and remove the &lt;code&gt;%a&lt;/code&gt; from the default. Note you also need to set the &lt;code&gt;org-display-custom-times&lt;/code&gt; variable to something other than nil.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="507" LastEditDate="2016-10-21T14:37:14.313" LastActivityDate="2016-10-21T14:37:14.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27955" PostTypeId="1" AcceptedAnswerId="27959" CreationDate="2016-10-20T07:44:53.017" Score="3" ViewCount="78" Body="&lt;p&gt;Sometimes the doc is just confusing without proper background knowledge mentioned in the manual (Info). How to jump to the manual from the help buffer?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-10-20T13:57:47.750" Title="In the help page of a function/variable, how to jump to the corresponding part in the manual?" Tags="|help|manual|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27956" PostTypeId="2" ParentId="27955" CreationDate="2016-10-20T08:25:01.330" Score="0" Body="&lt;p&gt;If there's a link you can follow it, otherwise you just have to open the manual (&lt;code&gt;C-h i&lt;/code&gt;) and navigate to the correct section yourself.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-20T08:25:01.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27957" PostTypeId="1" AcceptedAnswerId="28173" CreationDate="2016-10-20T08:48:41.220" Score="2" ViewCount="1119" Body="&lt;p&gt;I am pretty new to spacemacs and I am still trying to configure it to my needs.&#xA;In emacs I use yas-snippet a lot and I am fond of the autocomplete feature in spacemacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently there is a way to combine the two via company-mode that I found &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/385&quot; rel=&quot;nofollow&quot;&gt;on github&lt;/a&gt;, but I have no idea where I have to place the configurations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope someone can help me. I would like to avoid setting a new key for company-yasnippet because the integration with the autocomplete drop menu would greatly speed up the working process.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastActivityDate="2016-10-27T16:05:32.540" Title="spacemacs combine yas-snippet + autocomplete" Tags="|spacemacs|company-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27958" PostTypeId="2" ParentId="728" CreationDate="2016-10-20T08:50:09.170" Score="2" Body="&lt;p&gt;Addition to ido, I have following setup.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In case of evil mode, use following key bindings to switch buffers&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;C-j&quot;) 'next-buffer)&#xA;(define-key evil-normal-state-map (kbd &quot;C-k&quot;) 'previous-buffer)&#xA;(define-key evil-normal-state-map (kbd &quot;C-S-h&quot;) 'evil-window-left)&#xA;(define-key evil-normal-state-map (kbd &quot;C-S-j&quot;) 'evil-window-down)&#xA;(define-key evil-normal-state-map (kbd &quot;C-S-k&quot;) 'evil-window-up)&#xA;(define-key evil-normal-state-map (kbd &quot;C-S-l&quot;) 'evil-window-right)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set buffer name as title of window. This will help you when navigating with above keybindings&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-title-format &quot;%b&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are using evil mode, you can try &lt;code&gt;evil-leader&lt;/code&gt;. Bind frequently used keys to leader. e.g You can bind &lt;code&gt;C-x b&lt;/code&gt; to &lt;code&gt;&amp;lt;leader&amp;gt;-b&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-evil-leader-mode)&#xA;(evil-leader/set-leader &quot;,&quot;)&#xA;(evil-leader/set-key&#xA; &quot;b&quot; 'switch-to-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bind dired mode to &lt;code&gt;C-&amp;lt;f8&amp;gt;&lt;/code&gt;. Now when you want to open file in directory, press &lt;code&gt;C-&amp;lt;f8&amp;gt;&lt;/code&gt;, navigate to file name &amp;amp; press &lt;code&gt;a&lt;/code&gt; instead of &lt;code&gt;RET&lt;/code&gt;. So dired buffer will be killed immediately.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-&amp;lt;f8&amp;gt;&quot;)&#xA;        (lambda ()&#xA;          (interactive)&#xA;          (dired default-directory)))&#xA;(put 'dired-find-alternate-file 'disabled nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;recentf&lt;/code&gt; mode to navigate recent files. &lt;code&gt;C-x C-r&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One last important point is - use ergonomic mechanical keyboard. So you can press 'ctrl' key easily and quickly with wrist instead of hurting pinky.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope this might help someone.&lt;/p&gt;&#xA;" OwnerUserId="13658" LastEditorUserId="13658" LastEditDate="2016-10-20T09:01:46.267" LastActivityDate="2016-10-20T09:01:46.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27959" PostTypeId="2" ParentId="27955" CreationDate="2016-10-20T08:52:25.423" Score="4" Body="&lt;p&gt;Place point on the symbol and press &lt;kbd&gt;C-h S&lt;/kbd&gt;.&#xA;This works in buffers with &lt;code&gt;emacs-lisp-mode&lt;/code&gt; and in help buffers.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-10-20T08:52:25.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27960" PostTypeId="2" ParentId="27935" CreationDate="2016-10-20T09:02:36.990" Score="7" Body="&lt;p&gt;The short answer is that this is expected behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You seem to be expecting &lt;code&gt;foo-,arg&lt;/code&gt; to be something like &lt;code&gt;(intern (concat &quot;foo-&quot; (symbol-name ',arg)))&lt;/code&gt;, but there's no reason why that should be the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For starters &lt;code&gt;,arg&lt;/code&gt; evaluates &lt;code&gt;arg&lt;/code&gt; to whatever arbitrary lisp object it has as its value, so there mightn't even be a sensible way to form the end of a symbol name from that value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, note that the lisp &lt;em&gt;reader&lt;/em&gt; has to read your code into objects before they can be evaluated. For your expectation to work, it would need to read all of &lt;code&gt;foo-,arg&lt;/code&gt; into a form which would subsequently do the interning at evaluation time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice &lt;code&gt;foo-&lt;/code&gt; is read as a symbol, and &lt;code&gt;,arg&lt;/code&gt; is read into a form recognised by the &lt;code&gt;backquote&lt;/code&gt; processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can call the reader ourselves to see what it actually produces (or rather, we can see the &lt;em&gt;printed representation&lt;/em&gt; of those lisp objects; internally those objects are not text, but they are converted back into text for display purposes).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(read &quot;(defmacro test (arg) `(message foo-,arg))&quot;)&#xA;=&amp;gt; (defmacro test (arg) (\` (message foo- (\, arg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here we see that &lt;code&gt;foo-,arg&lt;/code&gt; has been read into two forms, represented as &lt;code&gt;foo-&lt;/code&gt; and &lt;code&gt;(\, arg)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The list structure &lt;code&gt;(\, arg)&lt;/code&gt; is recognised by &lt;code&gt;backquote-process&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(backquote-process '(message foo-,arg))&#xA;=&amp;gt; (1 list (quote message) (quote foo-) arg)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Naturally we can also see this form in the definition of the &lt;code&gt;test&lt;/code&gt; macro:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(symbol-function 'test)&#xA;=&amp;gt; (macro lambda (arg) (list (quote message) (quote foo-) arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get the result you were after, the reader would need to have produced something along these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(read &quot;(defmacro test (arg) `(message foo-,arg))&quot;)&#xA;=&amp;gt; (defmacro test (arg) (\` (message ,(intern (concat &quot;foo-&quot; (symbol-name (eval arg)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-10-20T09:02:36.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27961" PostTypeId="2" ParentId="27780" CreationDate="2016-10-20T10:02:59.687" Score="2" Body="&lt;p&gt;The following is an easy way to achieve what you want. The problem seems to be that some commands like &lt;code&gt;avy-goto-char&lt;/code&gt; leave unprocessed input around so you have to make sure to clear that if the command failed. &lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun schrute--call-until-success (cmd)&#xA;  (when (not (ignore-errors (call-interactively cmd) t))&#xA;    (discard-input)&#xA;    (schrute--call-until-success cmd)))&#xA;&#xA;;; example usages&#xA;(schrute--call-until-success 'avy-goto-symbol-1)&#xA;(schrute--call-until-success 'avy-goto-line)&#xA;(schrute--call-until-success 'goto-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastEditorUserId="9198" LastEditDate="2016-10-20T11:50:38.707" LastActivityDate="2016-10-20T11:50:38.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27962" PostTypeId="1" AcceptedAnswerId="28594" CreationDate="2016-10-20T10:19:57.677" Score="4" ViewCount="1395" Body="&lt;p&gt;Something &lt;code&gt;setq&lt;/code&gt;s &lt;code&gt;desktop-dirname&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; after my &quot;init.el&quot; is loaded.&#xA;I want to track down the offending code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just before the end of &quot;init.el&quot;, &lt;code&gt;desktop-dirname&lt;/code&gt; is correctly set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked &lt;code&gt;run-hooks&lt;/code&gt; by giving advise to it, but the variable was found to be set outside of &lt;code&gt;run-hooks&lt;/code&gt;. But there are more hook-runners, timers, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a general technique to pin-point the code that writes to a variable?   &lt;/p&gt;&#xA;" OwnerUserId="13715" LastActivityDate="2017-04-28T22:23:49.637" Title="Tracking down a write to a variable" Tags="|debugging|edebug|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27963" PostTypeId="1" AcceptedAnswerId="40688" CreationDate="2016-10-20T10:21:48.323" Score="9" ViewCount="5355" Body="&lt;p&gt;I want to directly compare the diffs of two commits in emacs (rather than seeing the diff of two trees at given commit points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bonus would be being able to use ediff mode to compare the two buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there seems to be no way to have two &lt;code&gt;*magit-revision*&lt;/code&gt; buffers open at once. Even if I rename the first, &lt;code&gt;(magit-visit-ref)&lt;/code&gt; still updates that buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked through the manuals but couldn't find a reference to what controls the new buffer creation. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="454" LastEditDate="2018-03-27T01:46:03.887" LastActivityDate="2018-03-27T01:46:03.887" Title="How can I compare two commit diffs in magit?" Tags="|magit|ediff|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27964" PostTypeId="1" AcceptedAnswerId="27978" CreationDate="2016-10-20T11:07:00.290" Score="2" ViewCount="1405" Body="&lt;p&gt;I'm trying to read a value of variable &lt;code&gt;context&lt;/code&gt; from the config file. I use something like this (but have got an error..):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer&#xA;(insert-file-contents &quot;/home/user/liquibase.properties&quot;)&#xA;(keep-lines &quot;contexts&quot; point-min point-max)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The file &lt;code&gt;/home/user/liquibase.properties&lt;/code&gt; has the following structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;logLevel: off&#xA;contexts: my_context&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Give me a direction please. How to read the content of properties-file, filter it and store some value into a variable? To have the same result as after a call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ctx &quot;my_context&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13716" LastEditorUserId="105" LastEditDate="2016-10-20T13:42:17.230" LastActivityDate="2016-10-20T23:10:47.250" Title="Read a config file and get some value into elisp variable" Tags="|files|read|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27965" PostTypeId="2" ParentId="27935" CreationDate="2016-10-20T11:15:27.470" Score="1" Body="&lt;p&gt;Not that I'm advocating something like this...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro with-intern-concat (&amp;amp;rest body)&#xA;  (declare (indent 0) (debug t))&#xA;  (cons 'progn (intern-concat-map body)))&#xA;&#xA;(defun intern-concat-map (body)&#xA;  (with-temp-buffer&#xA;    (intern-concat-map-qq-symbols body&#xA;      (lambda (symbol)&#xA;        (erase-buffer)&#xA;        (save-excursion (insert (symbol-name symbol)))&#xA;        (while (re-search-forward &quot;\\([^%]+\\)\\|%\\([^%]*\\)%&quot; nil t)&#xA;          (replace-match&#xA;           (if (match-string 1)&#xA;               (prin1-to-string (match-string 1))&#xA;             (concat &quot;(symbol-name &quot; (match-string 2) &quot;)&quot;))&#xA;           t t))&#xA;        `(intern (concat ,@(read (concat &quot;(&quot; (buffer-string) &quot;)&quot;))))))))&#xA;&#xA;(defun intern-concat-map-qq-symbols (form fn)&#xA;  (declare (indent 1))&#xA;  (cond&#xA;   ((and (consp form)&#xA;         (eq '\, (car form))&#xA;         (= (length form) 2)&#xA;         (symbolp (cadr form)))&#xA;    (list (car form) (funcall fn (cadr form))))&#xA;   ((consp form)&#xA;    (cons (intern-concat-map-qq-symbols (car form) fn)&#xA;          (and (cdr form) (intern-concat-map-qq-symbols (cdr form) fn))))&#xA;   (t form)))&#xA;&#xA;(defmacro test (arg)&#xA;  (with-intern-concat&#xA;    `(message &quot;%d&quot; ,fill-%arg%)))&#xA;&#xA;(macroexpand '(test column))&#xA;;; =&amp;gt; (message &quot;%d&quot; fill-column)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-10-20T11:15:27.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27966" PostTypeId="2" ParentId="27950" CreationDate="2016-10-20T13:18:28.680" Score="1" Body="&lt;p&gt;The tabbar disappears because the major mode of diary and &lt;em&gt;Packages&lt;/em&gt; (and completion, and ...) buffers use the header-line. You can view the tabbar with &lt;code&gt;M-x tabbar-local-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A solution for putting these buffers in another group:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun tabbar-buffer-groups ()&#xA;  (list&#xA;   (cond&#xA;    ((or (string-equal &quot;diary&quot; (buffer-name)) (string-equal &quot;*Packages*&quot; (buffer-name)))&#xA;     &quot;Diary or package&quot;&#xA;     )&#xA;    ((string-equal &quot;*&quot; (substring (buffer-name) 0 1))&#xA;     &quot;Emacs Buffer&quot;&#xA;     )&#xA;    ((eq major-mode 'dired-mode)&#xA;     &quot;Dired&quot;&#xA;     )&#xA;    (t&#xA;     &quot;User Buffer&quot;&#xA;     )&#xA;    )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here my tabbar configuration: &lt;a href=&quot;https://github.com/djangoliv/conf/blob/master/init.org#tabbar&quot; rel=&quot;nofollow&quot;&gt;https://github.com/djangoliv/conf/blob/master/init.org#tabbar&lt;/a&gt; for more inspiration.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-10-20T13:18:28.680" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27967" PostTypeId="2" ParentId="27963" CreationDate="2016-10-20T13:27:09.713" Score="10" Body="&lt;p&gt;You can do it from the &lt;code&gt;magit-log&lt;/code&gt; buffer&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x magit-log&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;E r ref1..ref2&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-10-20T13:27:09.713" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27968" PostTypeId="2" ParentId="27944" CreationDate="2016-10-20T13:42:06.813" Score="2" Body="&lt;p&gt;The problem was in my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have my diary file set for a custom location:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Diary&#xA;&#xA;(setq diary-file &quot;E:/emacs/diary/diary&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This part of my init file appeared AFTER the part of my init file that calls for the appointment activations and checks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs was trying to check as soon as it hit this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; appointments&#xA;&#xA;(require 'appt)&#xA;&#xA;(appt-activate 1)&#xA;&#xA;(appt-check 1)&#xA;&#xA;(setq appt-message-warning-time 15)&#xA;&#xA;(setq appt-display-interval 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem was that there was no diary file in the default location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I manually ran the check, the appointments displayed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put the diary location before the appointments part of my init file, and it is working properly. &lt;/p&gt;&#xA;" OwnerUserId="13432" LastActivityDate="2016-10-20T13:42:06.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27969" PostTypeId="2" ParentId="27849" CreationDate="2016-10-20T13:46:33.347" Score="12" Body="&lt;p&gt;This should work fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key eshell-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'completion-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know why the above isn't the default. But I use only &lt;code&gt;shell-mode&lt;/code&gt; and &lt;code&gt;term-mode&lt;/code&gt; anyway.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-10-20T13:46:33.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27970" PostTypeId="2" ParentId="27955" CreationDate="2016-10-20T13:57:47.750" Score="2" Body="&lt;p&gt;What @Tobias said.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or if you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/help-fns%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;help-fns+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; then &lt;code&gt;*Help*&lt;/code&gt; buffers provide a link to help from the manuals. Option &lt;strong&gt;&lt;code&gt;help-cross-reference-manuals&lt;/code&gt;&lt;/strong&gt; in that library lets you decide the behavior:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;help-cross-reference-manuals is a variable defined in &lt;code&gt;help-fns+.el&lt;/code&gt;.&#xA;  Its value is &lt;code&gt;((&quot;emacs&quot; &quot;elisp&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Manuals to search, for a &lt;code&gt;*Help*&lt;/code&gt; buffer link to the manuals.&#xA;  A cons.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The car is a list of manuals to search, or the symbol &lt;strong&gt;&lt;code&gt;all&lt;/code&gt;&lt;/strong&gt;, to&#xA;    search all.  If &lt;code&gt;nil&lt;/code&gt;, then do not create a cross-reference link.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The cdr is a boolean:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;Non-&lt;code&gt;nil&lt;/code&gt; means search the manuals, then create a cross-ref link:&#xA;      create it only if some search hits are found.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;&lt;code&gt;nil&lt;/code&gt; means create a cross-ref link without searching manuals&#xA;      first (but only if there are some manuals to search).&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For more information check the manuals.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The last line of that &lt;code&gt;*Help*&lt;/code&gt; output is what this feature adds (to all &lt;code&gt;*Help*&lt;/code&gt; buffers). The word &quot;&lt;em&gt;manuals&lt;/em&gt;&quot; is a link (as is the word &quot;&lt;em&gt;customize&lt;/em&gt;&quot;, as usual).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option value lets you choose whether to search manuals before displaying the &lt;code&gt;*Help*&lt;/code&gt; or only when you click the &lt;code&gt;manuals&lt;/code&gt; link.  The default behavior is the latter.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-20T13:57:47.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27971" PostTypeId="1" AcceptedAnswerId="27974" CreationDate="2016-10-20T14:16:26.670" Score="0" ViewCount="115" Body="&lt;p&gt;I’m trying to make a particular exclamation point behave like a word constituent (from the point of view of the syntax table), using the &lt;code&gt;syntax-table&lt;/code&gt; text property, but I can’t get it to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an empty buffer I write an exclamation mark and then evaluate the command &lt;code&gt;(add-text-properties 1 2 '(syntax-table (2)))&lt;/code&gt;. I think this is what I’m supposed to do.&#xA;But &lt;code&gt;describe-char&lt;/code&gt; on the exclamation mark shows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            character: ! (displayed as !) (codepoint 33, #o41, #x21)&#xA;[…]&#xA;               syntax: .    which means: punctuation&#xA;[…]&#xA;There are text properties here:&#xA;  syntax-table         (2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the text property has been applied, but it is still considered a punctuation character. What am I missing? Do I need to call a function to update it somehow? Other text properties (for instance &lt;code&gt;display&lt;/code&gt;) are applied automatically.&lt;/p&gt;&#xA;" OwnerUserId="13672" LastActivityDate="2016-10-20T21:05:18.760" Title="Locally modify the syntax-table via text-properties" Tags="|text-properties|syntax-table|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27972" PostTypeId="1" CreationDate="2016-10-20T19:52:32.820" Score="0" ViewCount="196" Body="&lt;p&gt;I needed emacs to startup and show me all the files I worked on last time (whom I didn't close explicitly) before &lt;code&gt;M-x kill-emacs&lt;/code&gt;. I installed Workgroups for it and my prefix is &lt;code&gt;C-c w&lt;/code&gt;. I split the window, ran a few files and I saved a workgroup. After restarting, it showed me all the files I closed last time (first usage). &#xA;After I worked on some other files, I closed emacs. But the next time I tried to start it, it shows me the files from the first session. My last session wasn't saved and instead my first session files are being shown. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to automatically load the files I ran the last time before closing to be arranged just the way it was. &#xA;How do I fix this?&lt;/p&gt;&#xA;" OwnerUserId="13270" LastActivityDate="2016-10-24T01:56:26.293" Title="Workgroups doesn't load the files from last session on startup" Tags="|workgroups|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27973" PostTypeId="2" ParentId="9488" CreationDate="2016-10-20T20:32:18.517" Score="1" Body="&lt;p&gt;If you need a default encoding different from utf-8, you could use an advice around the list-package function to force use of utf-8 encoding :&#xA;ex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun pte/list-packages (org-fun &amp;amp;rest args)&#xA;  &quot;Ensure to set `buffer-file-coding-system' to utf-8 before calling `list-packages'.&quot;&#xA;  (let ((buffer-file-coding-system 'utf-8))&#xA;    (apply org-fun args)))&#xA;&#xA;(advice-add 'list-packages :around #'pte/list-packages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my daily use I need to use :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefer-coding-system 'windows-1252)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I've advised the list-package function ... hope this could help.&lt;/p&gt;&#xA;" OwnerUserId="13155" LastActivityDate="2016-10-20T20:32:18.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27974" PostTypeId="2" ParentId="27971" CreationDate="2016-10-20T21:05:18.760" Score="2" Body="&lt;p&gt;As mentioned by Tobias, you generally need&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'parse-sexp-lookup-properties) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in order for those properties to have an effect.  The reason for it is probably historical and linked to performance, and nobody bothered to try and change it since.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that &lt;code&gt;syntax-table&lt;/code&gt; text properties are usually set via &lt;code&gt;syntax-propertize-function&lt;/code&gt;, in which case &lt;code&gt;syntax-propertize&lt;/code&gt; will take it upon itself to set &lt;code&gt;parse-sexp-lookup-properties&lt;/code&gt; for you, which is why you don't usually see major modes setting this var explicitly.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-20T21:05:18.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27975" PostTypeId="2" ParentId="27972" CreationDate="2016-10-20T22:23:06.817" Score="2" Body="&lt;p&gt;If you use &lt;code&gt;kill-emacs&lt;/code&gt;, it will not save the session on exit. You must call &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt; or the default exit &lt;code&gt;C-x C-c&lt;/code&gt;. So either call &lt;code&gt;save-buffers-kill-emacs&lt;/code&gt; or &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt;, or add &lt;code&gt;wg-save-session-on-emacs-exit&lt;/code&gt; to &lt;code&gt;kill-emacs-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10167" LastActivityDate="2016-10-20T22:23:06.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27976" PostTypeId="1" AcceptedAnswerId="28043" CreationDate="2016-10-20T22:28:37.267" Score="0" ViewCount="797" Body="&lt;p&gt;I am running into problems creating and connecting to an Emacs daemon on RHEL 6. I am using Emacs 23.1.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The daemon starts correctly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon=foo&#xA;...&#xA;Starting Emacs daemon.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; but when I try to launch a client against it I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacsclient -f foo -t&#xA;emacsclient: connected to remote socket at 255.255.255.255&#xA;emacsclient: connect: Network is unreachable&#xA;...&#xA;Starting Emacs daemon.&#xA;Unable to start the daemon.&#xA;Another instance of Emacs is running the server, either as daemon or interactively.&#xA;You can use emacsclient to connect to that Emacs process.&#xA;Error: server did not start correctly&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Error: Could not start the Emacs daemon&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to find the port Emacs listens to by way of &lt;code&gt;lsof&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ps aux | grep -i emacs | grep -v grep&#xA;mperdike 19396  0.3  0.4 259832 17596 ?        Ss   18:21   0:00 emacs -nw --daemon=foo&#xA;$ lsof -Pan -p 19396 -i&#xA;$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; but as can be seen in the screen above &lt;code&gt;lsof&lt;/code&gt; didn't produce any output (maybe that's because I am not a sudoer).&lt;/p&gt;&#xA;" OwnerUserId="4003" LastEditorUserId="4003" LastEditDate="2016-10-20T22:43:23.393" LastActivityDate="2016-10-23T15:38:13.623" Title="problems connecting to an emacs daemon on RHEL" Tags="|emacs-daemon|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27978" PostTypeId="2" ParentId="27964" CreationDate="2016-10-20T23:10:47.250" Score="3" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (insert-file-contents &quot;config.dat&quot;)&#xA;  (keep-lines &quot;contexts&quot; (point-min) (point-max)) &#xA;  (setq ctx (when (string-match &quot;contexts: \\(.*\\)&quot; (buffer-string))&#xA;          (match-string 1 (buffer-string)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-10-20T23:10:47.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27979" PostTypeId="1" AcceptedAnswerId="27983" CreationDate="2016-10-21T01:12:53.760" Score="9" ViewCount="978" Body="&lt;p&gt;Is there a way to use avy or a similar in-buffer selection tool to quickly select a word or line to paste at the current point?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the following buffer an example workflow for proposed functionality would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;line 1 - reallyLongSymbol&#xA;line 2 - bravo&#xA;line 3 - &amp;lt;POINT_HERE&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;At line 3, realize I want to paste &lt;code&gt;reallyLongSymbol&lt;/code&gt; at the current point.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x avy-select-word-and-paste&lt;/code&gt; (made-up)&lt;/li&gt;&#xA;&lt;li&gt;Press the key combo that corresponds to &lt;code&gt;reallyLongSymbol&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;reallyLongSymbol&lt;/code&gt; is inserted at POINT.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The buffer is now as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;line 1 - reallyLongSymbol&#xA;line 2 - bravo&#xA;line 3 - reallyLongSymbol&amp;lt;POINT_HERE&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ideally, this would work for other targets like lines and urls.&lt;/p&gt;&#xA;" OwnerUserId="256" LastEditorUserId="105" LastEditDate="2016-11-12T02:52:44.670" LastActivityDate="2020-02-05T13:41:02.593" Title="Use avy to select distant word or line and paste at point" Tags="|yank|avy|selection|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27980" PostTypeId="2" ParentId="27979" CreationDate="2016-10-21T02:57:40.000" Score="0" Body="&lt;p&gt;for this example you can use dynamic abbrev.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;type &quot;r&quot; &quot;M-/&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use avy, then assuming you have avy-goto-char bound to something like M-p, then &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;C-SPC&quot;   # set-mark, to remember where we are&#xA;&quot;M-p the_correct_character_from_overlay&quot; # avy-goto-char, goto place&#xA;&quot;C-SPC&quot;   # set-mark, start the region to copy&#xA;&quot;M-f&quot;     # forward-word, or C-e if you want to select a line...&#xA;&quot;M-w&quot;     # copy-region-as-kill, to copy the region&#xA;&quot;C-x C-SPC&quot; # pop-global-mark, get back to where we were&#xA;&quot;C-y&quot;     # yank, paste in the stuff we copied.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know it looks a bit long (9 key combinations) but they will soon flow off the fingers.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-10-21T02:57:40.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27981" PostTypeId="1" CreationDate="2016-10-21T03:45:12.420" Score="2" ViewCount="188" Body="&lt;p&gt;When using &lt;code&gt;find-alternate-file&lt;/code&gt;, to refresh the file in the current buffer, point is always moved back to the &lt;em&gt;start&lt;/em&gt; of the file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get point to be moved to where I was in the file &lt;em&gt;before&lt;/em&gt; invoking &lt;code&gt;find-alternate-file&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="13725" LastEditorUserId="9995" LastEditDate="2016-10-21T06:45:47.597" LastActivityDate="2016-10-21T06:45:47.597" Title="find-alternate-file and move point" Tags="|find-file|point|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27982" PostTypeId="1" AcceptedAnswerId="27984" CreationDate="2016-10-21T04:28:56.393" Score="15" ViewCount="8080" Body="&lt;p&gt;After inspecting the LaTeX generated for my org-mode file, I figured out that the code blocks are exported with the &lt;code&gt;verbatim&lt;/code&gt; environment. Are there any way to tell org-mode to export code blocks using the &lt;code&gt;minted&lt;/code&gt; environment for the appropriated language?&lt;/p&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2016-10-21T15:20:25.450" Title="Export code blocks in org-mode with minted environment" Tags="|org-mode|syntax-highlighting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27983" PostTypeId="2" ParentId="27979" CreationDate="2016-10-21T04:41:47.420" Score="8" Body="&lt;p&gt;avy already supports what you want. See &lt;code&gt;avy-dispatch-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the default actions are not enough. I have the following function in my config (here it copies a sexp, but you can change it to copy a line):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-avy-action-copy-and-yank (pt)&#xA;  &quot;Copy and yank sexp starting on PT.&quot;&#xA;  (avy-action-copy pt)&#xA;  (yank))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then assign a key to the function in &lt;code&gt;avy-dispatch-alist&lt;/code&gt;. I use &lt;code&gt;p&lt;/code&gt; here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq avy-dispatch-alist '((?c . avy-action-copy)&#xA;                           (?k . avy-action-kill-move)&#xA;                           (?K . avy-action-kill-stay)&#xA;                           (?m . avy-action-mark)&#xA;                           (?p . my-avy-action-copy-and-yank)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To use it: before you jump to &lt;code&gt;reallyLongSymbol&lt;/code&gt;, first press &lt;code&gt;p&lt;/code&gt;, then the letter combination for jumping to &lt;code&gt;reallyLongSymbol&lt;/code&gt;. Note that you can't use &lt;code&gt;p&lt;/code&gt; in &lt;code&gt;avy-keys&lt;/code&gt; since it is now reserved for the &lt;code&gt;my-avy-action-copy-and-yank&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a really awesome feature and you can easily add other actions you want.&lt;/p&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="12247" LastEditDate="2016-10-21T05:58:26.270" LastActivityDate="2016-10-21T05:58:26.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27984" PostTypeId="2" ParentId="27982" CreationDate="2016-10-21T06:43:30.930" Score="24" Body="&lt;p&gt;You will need to tell Org to   &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use minted for listings&lt;/li&gt;&#xA;&lt;li&gt;Include minted in the default package list&lt;/li&gt;&#xA;&lt;li&gt;Change the compilation switches to accommodate for minted:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre&gt;(setq org-latex-listings 'minted&#xA;      org-latex-packages-alist '((&quot;&quot; &quot;minted&quot;))&#xA;      org-latex-pdf-process&#xA;      '(&quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&quot;))&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-10-21T15:20:25.450" LastActivityDate="2016-10-21T15:20:25.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27985" PostTypeId="2" ParentId="27786" CreationDate="2016-10-21T09:05:22.777" Score="0" Body="&lt;p&gt;The solution turned out to be really simple. In fact I was just being stupid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I viewed my document I realized that the images that didn't show were missing the double square brackets before and after the image links. I guess the reason I didn't notice this in the beginning is that the square brackets also didn't occur for the images that showed:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/p7zow.png&quot; alt=&quot;org-mode1&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...until I tried to delete part of the line:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Q6GTd.png&quot; alt=&quot;org-mode2&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13625" LastActivityDate="2016-10-21T09:05:22.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27986" PostTypeId="1" CreationDate="2016-10-21T09:57:56.327" Score="1" ViewCount="1161" Body="&lt;p&gt;I am getting error messages initializing some company backend packages, but messages only appear in the &lt;code&gt;*Messages*&lt;/code&gt; buffer, like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Company backend 'company-web' could not be initialized:&#xA;Symbol's function definition is void: company-web&#xA;Company backend 'company-quickhelp' could not be initialized:&#xA;Symbol's function definition is void: company-quickhelp&#xA;Company backend 'company-php' could not be initialized:&#xA;Symbol's function definition is void: company-php&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't find a way to spot the problem, my current &lt;code&gt;.emacs&lt;/code&gt; relevant code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company-web)&#xA;(use-package company-quickhelp)&#xA;(use-package company-php)&#xA;(use-package company&#xA;  :bind ((&quot;C-?&quot; . company-complete))&#xA;  :config&#xA;  (global-company-mode t)&#xA;  (add-to-list 'company-backends 'company-php)&#xA;  (add-to-list 'company-backends 'company-quickhelp)&#xA;  (add-to-list 'company-backends 'company-web)&#xA;  ) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notes &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Using &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;--debug-init&lt;/code&gt; doesn't show anything &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Fixed &lt;code&gt;company-php&lt;/code&gt; and &lt;code&gt;company-web&lt;/code&gt; but not &lt;code&gt;company-quickhelp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fix &lt;code&gt;company-php&lt;/code&gt; and &lt;code&gt;company-web&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company-web&#xA;  :config&#xA;  (require 'company-web-html))&#xA;(use-package company&#xA;  :bind ((&quot;C-?&quot; . company-complete))&#xA;  :config&#xA;  (global-company-mode t)&#xA;  (add-to-list 'company-backends 'company-web-html) ;; changed from company-web&#xA;  (add-to-list 'company-backends 'company-ac-php-backend)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;company-quickhelp&lt;/code&gt; still shows the error in &lt;code&gt;*Messages*&lt;/code&gt; with: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company-quickhelp&#xA;  :config&#xA;  (company-quickhelp-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8563" LastEditorUserId="105" LastEditDate="2016-10-21T14:42:44.813" LastActivityDate="2016-10-21T14:42:44.813" Title="How to debug &quot;company backend&quot; initialization problems?" Tags="|company-mode|debugging|use-package|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27987" PostTypeId="1" CreationDate="2016-10-21T10:30:33.743" Score="1" ViewCount="1098" Body="&lt;p&gt;Say I want to find a directory like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo/bar/bazz/bar/directory_name_looking_for/stuff.xml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I don't know the intermediate directory paths, or the full directory name, but remember that the directory has the word looking in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using flx-ido like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'flx-ido)&#xA;(setq ido-enable-flex-matching t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which joins very well for when I want to do things like &lt;code&gt;f/b/b/b/d/stuff&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a good way to type &lt;code&gt;looking&lt;/code&gt; and get a list of suggestions?&lt;/p&gt;&#xA;" OwnerUserId="10789" LastEditorUserId="105" LastEditDate="2017-05-16T22:34:58.530" LastActivityDate="2017-05-16T22:34:58.530" Title="Fuzzy search for directory when you don't know the full directory name" Tags="|ido|find-file|ido-find-file|flx-ido|fuzzy-search|" AnswerCount="3" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27988" PostTypeId="1" AcceptedAnswerId="28078" CreationDate="2016-10-21T10:33:06.050" Score="5" ViewCount="502" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.emacswiki.org/emacs/point-undo.el&quot; rel=&quot;nofollow&quot;&gt;point-undo&lt;/a&gt; to jump between positions in the cursor history. However, point-undo uses &lt;em&gt;every&lt;/em&gt; previous position of the cursor, and I often experience that what I actually want is to jump just to the last/next &lt;em&gt;line&lt;/em&gt; where my cursor was. So I don't want to jump around within one line. In other words, I would like the cursor history to store only the last position per line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to do this?    &lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="105" LastEditDate="2016-11-12T02:51:39.987" LastActivityDate="2016-11-12T02:51:39.987" Title="Navigate cursor position history with line-based jumps" Tags="|cursor|point|navigation|history|" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27989" PostTypeId="1" AcceptedAnswerId="32883" CreationDate="2016-10-21T11:55:17.857" Score="2" ViewCount="1062" Body="&lt;p&gt;I use symmetric encryption in emacs 24 and somewhere along the line the variable named epa-file-cache-passphrase-for-symmetric-encryption seems to have disappeared from emacs.  I am going crazy entering the passphrase twice each time I try to save or open a file. I must have missed some big change but google does not seem to be helping much figure out what I need to do to get some sort of caching of the passphrase during a session.&lt;/p&gt;&#xA;" OwnerUserId="9068" LastActivityDate="2017-05-17T15:31:39.903" Title="Cache symmetric encryption passphrase for a session or some amount of time" Tags="|gpg|epa|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27990" PostTypeId="1" AcceptedAnswerId="27996" CreationDate="2016-10-21T12:30:53.390" Score="0" ViewCount="87" Body="&lt;p&gt;I have cloned &lt;a href=&quot;https://github.com/AndreaCrotti/yasnippet-snippets/&quot; rel=&quot;nofollow&quot;&gt;yasnippets repo&lt;/a&gt; repo in &lt;code&gt;~/.emacs.d/yasnippet-snippets&lt;/code&gt;.&lt;br&gt;&#xA;I would like to synchronize it each time I start Emacs (btw, it would be nice to do it only if there is a connection available), my current (pretty raw) code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; ~/.emacs&#xA;(use-package yasnippet&#xA;  :config&#xA;  (cd &quot;~/.emacs.d/yasnippet-snippets&quot;)&#xA;  (magit-submodule-update)&#xA;  (yas-reload-all)&#xA;  (cd &quot;~/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I am getting this error in &lt;code&gt;*Messages*&lt;/code&gt;, probably because it changes directory before finishing the &lt;em&gt;magit&lt;/em&gt; process:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error in process sentinel: user-error: Not inside a Git repository&#xA;error in process sentinel: Not inside a Git repository&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;*Using: &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow&quot;&gt;use-package&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8563" LastEditorUserId="105" LastEditDate="2016-10-21T14:43:20.307" LastActivityDate="2016-10-21T15:46:16.970" Title="Emacs init file with yasnippets and magit submodule update error" Tags="|magit|yasnippet|use-package|process|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27991" PostTypeId="1" CreationDate="2016-10-21T12:49:43.977" Score="1" ViewCount="55" Body="&lt;p&gt;I'd really like to use &lt;code&gt;eshell&lt;/code&gt; on remote hosts, however I have to use !N in order to call history items. I haven't found any other way to select history items and this is really inconvenient compared to &lt;code&gt;helm-eshell-history&lt;/code&gt;. How can I make eshell recognize remote history ?&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-10-21T12:49:43.977" Title="how can I view the history on remote hosts with helm-eshell-history?" Tags="|eshell|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27993" PostTypeId="2" ParentId="27952" CreationDate="2016-10-21T13:51:56.423" Score="1" Body="&lt;p&gt;Although a custom format suggested by @icarus seems to be a good idea, I generally like the standard Org-mode format of &lt;code&gt;%Y-%m-%d&lt;/code&gt; and &lt;code&gt;%Y-%m-%d %H:%M&lt;/code&gt; (without that pesky &lt;code&gt;%a&lt;/code&gt; part). As the only thing I wanted to get rid of is the name of the day, I ended up setting &lt;code&gt;org-time-stamp-formats&lt;/code&gt; (I use &lt;code&gt;use-package&lt;/code&gt;; if you don’t use such package managers, this &lt;code&gt;setq&lt;/code&gt; should go into &lt;code&gt;after-init-hook&lt;/code&gt;; otherwise &lt;code&gt;org.el&lt;/code&gt;’s &lt;code&gt;defvar&lt;/code&gt; will overwrite your preference.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org&#xA;  :config&#xA;  (setq org-time-stamp-formats '(&quot;&amp;lt;%Y-%m-%d&amp;gt;&quot; . &quot;&amp;lt;%Y-%m-%d %H:%M&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: I also found out &lt;a href=&quot;http://orgmode.org/manual/Creating-timestamps.html&quot; rel=&quot;nofollow&quot;&gt;from the docs&lt;/a&gt; that I can update the day name &lt;kbd&gt;C-c C-c&lt;/kbd&gt; if it is wrong, but that’s just an overkill for my situation.&lt;/p&gt;&#xA;" OwnerUserId="507" LastEditorUserId="12895" LastEditDate="2016-10-21T15:33:59.887" LastActivityDate="2016-10-21T15:33:59.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27994" PostTypeId="1" CreationDate="2016-10-21T14:42:28.817" Score="4" ViewCount="101" Body="&lt;p&gt;Is it possible to cherrypick changes from different branches in undo tree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example say I make a change call it change1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then undo, and make a change, call it change2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then undo, and make a change, call it change3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then undo, and revert to change1. I then realize I infact also want the contents of change3. Is it possible to import it, similiar to gits cherry-pick?&lt;/p&gt;&#xA;" OwnerUserId="10789" LastActivityDate="2016-10-21T14:42:28.817" Title="undo-tree tree manipulation/cherry picking?" Tags="|history|undo|undo-tree-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27995" PostTypeId="2" ParentId="27514" CreationDate="2016-10-21T14:55:39.187" Score="1" Body="&lt;p&gt;Try this in a terminal session on your local machine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xsel -bo | ssh you@remoteHost 'cat - &amp;gt; /tmp/pasted'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in your remote terminal &lt;code&gt;emacsclient&lt;/code&gt; session:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x i /tmp/pasted RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to insert &lt;code&gt;/tmp/pasted&lt;/code&gt; at point.&lt;/p&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-10-21T14:55:39.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27996" PostTypeId="2" ParentId="27990" CreationDate="2016-10-21T15:46:16.970" Score="0" Body="&lt;p&gt;Something like this would probably work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package yasnippet&#xA;  :init&#xA;  (let ((default-directory &quot;~/.emacs.d/yasnippet-snippets/&quot;))&#xA;    (call-process &quot;git&quot; nil nil nil &quot;pull&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-10-21T15:46:16.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27997" PostTypeId="2" ParentId="27930" CreationDate="2016-10-21T16:11:02.350" Score="3" Body="&lt;p&gt;I'm assuming that you are using the Custom interface to find variables you might want to change and to try out the possible values, but that once you have settled on a value, then you want to use &lt;code&gt;setq&lt;/code&gt; in you init file instead of saving the value from the Custom interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have done this in Custom:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[v] Mode Require Final Newline: [Value Menu] Ask each time&#xA; [State]: modified&#xA; Whether to add a newline at end of file, in certain major modes. [more]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and now you want to use &lt;code&gt;setq&lt;/code&gt; to do the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem you appear to have is that &lt;code&gt;Mode Require Final Newline&lt;/code&gt; isn't a variable and &lt;code&gt;Ask each time&lt;/code&gt; isn't a proper value for whatever the variable may be. And that you don't know how to &quot;translate&quot; the things you see to what you have to put into your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to see &lt;code&gt;mode-require-final-newline&lt;/code&gt; instead of &lt;code&gt;Mode Require Final Newline&lt;/code&gt; you have to &lt;code&gt;(setq custom-unlispify-tag-names nil)&lt;/code&gt;. You cannot do this on the fly. Alternatively you can manually replace every space with a dash and downcase everything. That gives you the correct result for most (but not all) variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in order to see &lt;code&gt;'ask&lt;/code&gt; instead of &lt;code&gt;Ask each time&lt;/code&gt; you have to first click on &lt;code&gt;State &amp;gt; Set for Current Session&lt;/code&gt; and then on &lt;code&gt;State &amp;gt; Show Saved Lisp Expression&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-10-21T16:11:02.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27998" PostTypeId="1" AcceptedAnswerId="27999" CreationDate="2016-10-21T16:57:54.020" Score="0" ViewCount="59" Body="&lt;p&gt;I have a flake8 wrapper script: a small program that execs flake8 (in order to pick an appropriate version of flake8 for whichever project I'm working on).  flycheck is using that wrapper script (I'm sure of that because I can break syntax checking in emacs by editing the script).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have verified that if I change the source code of the wrapper script in a certain way, such as to leave its stdout, stderr and exit code unchanged, flycheck's behaviour nevertheless changes!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular it seems that with one source code text for my wrapper script, flycheck shows both errors (red squiggly line under offending lines) and warnings (yellow squiggly line) -- and with the other source code text, it displays only warnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems perhaps emacs is actually looking at the text of the wrapper script itself in order to guess something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps even more oddly, I've reproduced the same issue using both a wrapper script implemented in python, and one implemented in sh -- so the source code in each case is rather different!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a pretty crazy issue, anybody have any guesses, or hints on start debugging flycheck?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All help appreciated!&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-10-21T17:16:42.747" Title="Why does flycheck behaviour not depend only on flake8 output and exit code?" Tags="|python|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27999" PostTypeId="2" ParentId="27998" CreationDate="2016-10-21T17:16:42.747" Score="1" Body="&lt;p&gt;Turns out the answer is that I was running my script differently than emacs was: emacs was piping stdin into flake8, but I was passing it a filename directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I was using the pathname in my wrapper script to determine which flake8 to run, the wrapper script behaved differently if I left that check in or disabled it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I thought I'd verified it was reaching the right code branch, but I only verified that using a command that emacs was &lt;em&gt;not&lt;/em&gt; using!)&lt;/p&gt;&#xA;" OwnerUserId="5495" LastActivityDate="2016-10-21T17:16:42.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28000" PostTypeId="2" ParentId="27987" CreationDate="2016-10-21T17:17:46.320" Score="1" Body="&lt;p&gt;I wrote a small script, and then integrated with helm to achieve similar effect. Luckily I wrote about it on my blog (while trying to kickstart my blogging habit). Here it is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://harizvi.wordpress.com/2013/03/31/poor-mans-everything-on-mac-osx/&quot; rel=&quot;nofollow&quot;&gt;https://harizvi.wordpress.com/2013/03/31/poor-mans-everything-on-mac-osx/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should work on Linux transparently. On Windows, you can plug in the actual Everything app that I was trying to mimic. &lt;/p&gt;&#xA;" OwnerUserId="13733" LastActivityDate="2016-10-21T17:17:46.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28001" PostTypeId="1" CreationDate="2016-10-21T17:58:36.140" Score="3" ViewCount="80" Body="&lt;p&gt;Is it possible to have ruled lines in emacs? I would like to have the same look of a notebook while writing my org files.&lt;/p&gt;&#xA;" OwnerUserId="7199" LastActivityDate="2016-10-21T17:58:36.140" Title="Ruled paper aspect in emacs interface" Tags="|customize|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28002" PostTypeId="2" ParentId="27896" CreationDate="2016-10-21T17:59:20.377" Score="1" Body="&lt;p&gt;Cloning a repository does only create a single local branch. Usually that branch is named &lt;code&gt;master&lt;/code&gt; and its upstream is &lt;code&gt;origin/master&lt;/code&gt;. To create an additional branch &lt;code&gt;some-feature&lt;/code&gt; from an existing &lt;em&gt;remote branch&lt;/em&gt; &lt;code&gt;my-fork/some-feature&lt;/code&gt;, you could use &lt;kbd&gt;b c&lt;/kbd&gt; &lt;code&gt;my-fork/some-feature&lt;/code&gt; &lt;kbd&gt;RET RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The upstream of that branch would be &lt;code&gt;my-fork/some-feature&lt;/code&gt;, but since you mentioned that you want to use a triangular work-flow, you probably want to use either &lt;code&gt;master&lt;/code&gt; or &lt;code&gt;origin/master&lt;/code&gt; as &lt;em&gt;upstream&lt;/em&gt;. You can &lt;em&gt;change&lt;/em&gt; the upstream using &lt;kbd&gt;b u&lt;/kbd&gt;. You can also configure Magit to always adjust the upstream when creating a new local branch from a remote feature branch by customizing &lt;code&gt;magit-branch-adjust-remote-upstream-alist&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2016-10-29T10:51:36.807" LastActivityDate="2016-10-29T10:51:36.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28003" PostTypeId="2" ParentId="27946" CreationDate="2016-10-21T18:08:47.000" Score="3" Body="&lt;p&gt;&lt;code&gt;git-commit-mode&lt;/code&gt; is a minor-mode but you have limited the snippets to be used with a major-mode &lt;code&gt;git-commit-mode&lt;/code&gt;. Such a major-mode no longer exists, so you have to use a different mechanism to restrict your snippets to &quot;when I edit a commit message&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason &lt;code&gt;git-commit-mode&lt;/code&gt; is a minor-mode is to allow you to choose the major-mode most suitable for commit messages according to the conventions used by the projects you contribute to. By default this is &lt;code&gt;text-mode&lt;/code&gt;, but if some project uses Markdown or Org-Mode for commit messages, then you can configure that on a per project basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you have some snippets that are appropriate for &lt;code&gt;text-mode&lt;/code&gt;+&lt;code&gt;git-commit-mode&lt;/code&gt;, but not just &lt;code&gt;text-mode&lt;/code&gt; or say &lt;code&gt;markdown-mode&lt;/code&gt;+&lt;code&gt;git-commit-mode&lt;/code&gt;, then use something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'git-commit-mode&#xA;          (lambda ()&#xA;            (when (derived-mode-p 'text-mode)&#xA;              (yas-activate-extra-mode 'text-mode+git-commit-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You then have to define your snippets as if there actually existed a major-mode named &lt;code&gt;text-mode+git-commit-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-10-21T18:08:47.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28004" PostTypeId="2" ParentId="27987" CreationDate="2016-10-21T18:39:59.023" Score="0" Body="&lt;p&gt;I'm using the standard &lt;code&gt;(icomplete-mode t)&lt;/code&gt; in my init-file. Then for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Directories:&lt;/strong&gt; &lt;code&gt;C-x d /*/*/src&lt;/code&gt; -&gt; gives me as a candidate /usr/local/src, with other word it is working for your scenario when you know the depth of the interesting directory and for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Files:&lt;/strong&gt; &lt;code&gt;C-x C-f /u/l/s/e&lt;/code&gt; returns the completion of -&gt; /usr/local/src/emacs, or for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Functions:&lt;/strong&gt; &lt;code&gt;C-h f a-r-m&lt;/code&gt; -&gt; one candidate is e.g. &lt;code&gt;auto-revert-mode&lt;/code&gt;. Also for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Buffers:&lt;/strong&gt; &lt;code&gt;C-x b d.&lt;/code&gt;-&gt; returns candidate buffers beginning with &lt;em&gt;d&lt;/em&gt; and a file suffix. Finally&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; &lt;code&gt;a-r-m C-M-i&lt;/code&gt; writes the completion &lt;em&gt;auto-r-mod&lt;/em&gt; into the buffer and a completion buffer.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2016-10-21T18:47:37.197" LastActivityDate="2016-10-21T18:47:37.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28005" PostTypeId="2" ParentId="27514" CreationDate="2016-10-21T19:10:38.493" Score="1" Body="&lt;p&gt;Good news: this problem should be solved in Emacs-25 where we support the so-called &quot;bracketed paste&quot; mode: Emacs asks the terminal emulator to surround every paste with a special escape sequence, which Emacs can then recognize so as to treat the pasted text as just that (i.e. text) rather than a sequence of key presses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW just upgrade to Emacs-25 and this problem should disappear (apparently this functionality has been supported by most terminal emulators for a while already, so you probably don't need to update this part).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-21T19:10:38.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28006" PostTypeId="2" ParentId="24571" CreationDate="2016-10-21T22:00:37.557" Score="2" Body="&lt;p&gt;I'm pretty sure you're missing the &lt;code&gt;company-irony&lt;/code&gt; mode here. As far as I know, irony is not enough for autocompleting. At least not with your setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll first explain a kind-of-short answer to it which should be ok if you're familiar with emacs. If you're not, just keep on reading. I'll explain everything after the short answer anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, install &lt;code&gt;company-irony&lt;/code&gt; (look up their website as I cant post more than 2 links) and follow it's instructions. Appending the following to your &lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt; should do the trick after installing &lt;code&gt;company-irony&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(eval-after-load 'company&#xA;  '(add-to-list 'company-backends 'company-irony))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That one is the short answer. If you find that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It does not work&lt;/li&gt;&#xA;&lt;li&gt;You do not understand what that is&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Read on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, irony-mode is some sort of backend made to help you when you code C/C++. By itself if cannot (as far as I understand) help you very much. So what you usually do is install a &lt;em&gt;frontend&lt;/em&gt; that actually can get the help irony gives to it and show it to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For autocompletion, there are two big candidates: &lt;a href=&quot;http://company-mode.github.io/&quot; rel=&quot;nofollow&quot;&gt;company&lt;/a&gt;, and auto-complete (look this one up if you want). These two take options from various backends and help you complete. If you install either you will notice they can help you when coding Emacs-lisp (the &lt;code&gt;init.el&lt;/code&gt; file). Anyway, these two support irony backend, and I already explained the company way to do so. That should be enough explanation for what's going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have trouble with auto completion candidates when using company or auto-complete, you can have a look at &lt;a href=&quot;https://www.youtube.com/watch?v=NjTCjqSZOAU&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; video which explains the whole process (don't follow the Mac-specific instructions though).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The show doesn't end there, though, you can take advantage of irony to tell you errors from your code. There's a package called Flycheck that highlights errors, which of course, has an irony backend, but that's another story.&lt;/p&gt;&#xA;" OwnerUserId="13735" LastActivityDate="2016-10-21T22:00:37.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28007" PostTypeId="2" ParentId="27987" CreationDate="2016-10-22T00:18:12.440" Score="1" Body="&lt;p&gt;Install find-file-in-project, &lt;a href=&quot;https://github.com/technomancy/find-file-in-project&quot; rel=&quot;nofollow&quot;&gt;https://github.com/technomancy/find-file-in-project&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x find-directory-in-project-by-selected&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="202" LastActivityDate="2016-10-22T00:18:12.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28008" PostTypeId="1" AcceptedAnswerId="28019" CreationDate="2016-10-22T01:04:39.190" Score="5" ViewCount="3069" Body="&lt;p&gt;I just setup the latest Spacemacs. I'm pasting python code from here &lt;a href=&quot;https://raw.githubusercontent.com/jpmens/mosquitto-auth-plug/master/examples/http-auth-be.py&quot; rel=&quot;noreferrer&quot;&gt;https://raw.githubusercontent.com/jpmens/mosquitto-auth-plug/master/examples/http-auth-be.py&lt;/a&gt; into a new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this it indents almost every single line relative to the last. I'm using spacemacs from iTerm2 on OSX. I'm using Evil mode. I've tried toggling the value &lt;code&gt;electric-indent-mode&lt;/code&gt; but ti doesn't help. I've also tried the command &lt;code&gt;:set paste&lt;/code&gt;, but it gives me the error &lt;code&gt;State paste cannot be set as initial Evil state&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So firstly, how do I stop the auto indentation? Secondly, what does the error message mean about the initial Evil state and how do I correct it?&lt;/p&gt;&#xA;" OwnerUserId="13738" LastActivityDate="2020-02-17T10:30:53.540" Title="How do I paste code without auto indentation" Tags="|evil|spacemacs|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28009" PostTypeId="1" AcceptedAnswerId="28010" CreationDate="2016-10-22T02:24:05.830" Score="2" ViewCount="947" Body="&lt;p&gt;I have a ipython config which imports lots of packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have some configs in my python setup like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq python-shell-interpreter &quot;ipython3&quot;&#xA;        python-shell-interpreter-args &quot;-i --profile=ipy --simple-prompt --pprint&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Loading a lot of packages will cause slow ipython shell startup. But this also happens when &lt;code&gt;python-mode&lt;/code&gt; is being enabled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, even after opened a python file, when I use &lt;kbd&gt;C-c C-p&lt;/kbd&gt; to start an interactive shell, the slow progress happens again. Here is the illustration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1d278.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1d278.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After removing the &lt;code&gt;--profile=ipy&lt;/code&gt; part, both the mode enabling and interactive shell starting will have a significant speed up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/O2gQW.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O2gQW.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can understand the slowness of starting an interactive shell process when with &lt;code&gt;--profile=ipy&lt;/code&gt;, but not the python mode enabling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what is the appropriate way to avoid this ? As I don't see any shell process when python mode is being enabled. The mode enabling is still very slow. &#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-10-22T14:52:53.677" Title="Setting `python-shell-interpreter-args` causes slow python mode enabling" Tags="|python|ipython|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28010" PostTypeId="2" ParentId="28009" CreationDate="2016-10-22T05:07:00.083" Score="1" Body="&lt;p&gt;This is due to &lt;code&gt;semantic-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will call &lt;code&gt;python-shell-internal-send-string&lt;/code&gt; which depends on &lt;code&gt;python-shell-interpreter&lt;/code&gt; and &lt;code&gt;python-shell-interpreter-args&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus using a non-profile &lt;code&gt;python-shell-interpreter-args&lt;/code&gt; to start this shell and set the profile one back after &lt;code&gt;semantic-mode&lt;/code&gt; is enabled solves the problem.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="8373" LastEditDate="2016-10-22T14:52:53.677" LastActivityDate="2016-10-22T14:52:53.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28011" PostTypeId="1" CreationDate="2016-10-22T09:47:00.317" Score="4" ViewCount="1155" Body="&lt;p&gt;Let's say I want to grep word1 &lt;em&gt;and&lt;/em&gt; word2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use the grep command for word1 I get the results in the &lt;code&gt;*grep*&lt;/code&gt;  buffer.&#xA;If I then use the grep command for word2 I loose the old results and get the word2 results in a new &lt;code&gt;*grep*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want two see the &lt;em&gt;two&lt;/em&gt; grep buffers (for example &lt;code&gt;*grep 1*&lt;/code&gt; and &lt;code&gt;*grep 2*&lt;/code&gt;) at the &lt;em&gt;same&lt;/em&gt; time: How to get this?&lt;/p&gt;&#xA;" OwnerUserId="11498" LastActivityDate="2019-04-02T15:01:01.300" Title="Multiple grep results buffers" Tags="|buffers|grep|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28012" PostTypeId="1" CreationDate="2016-10-22T10:19:59.630" Score="2" ViewCount="453" Body="&lt;p&gt;I use gtags, jedi and dabbrev for python. Sometimes the duplicates get a bit annoying. I read that using &lt;code&gt;:with&lt;/code&gt; should sort out the duplicates problem. However, it does not... Is there a better solution that this? :&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (set (make-local-variable 'company-backends)&#xA;                 '((company-gtags :with company-jedi company-dabbrev-code)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the Company documentation, Company Backends section there is a line that reads: &quot;‘duplicates’: If non-nil, company will take care of removing duplicates&#xA;   from the list.&quot;. I just can't figure out how to enable it.&lt;/p&gt;&#xA;" OwnerUserId="13180" LastEditorUserId="13180" LastEditDate="2016-10-22T17:54:41.953" LastActivityDate="2022-01-03T03:22:02.857" Title="Company duplicates" Tags="|company-mode|gtags|dabbrev|jedi|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28014" PostTypeId="2" ParentId="28011" CreationDate="2016-10-22T10:49:59.083" Score="0" Body="&lt;p&gt;You can save the word1 result in some temporary file then do another grep for word2.&lt;/p&gt;&#xA;" OwnerUserId="13403" LastActivityDate="2016-10-22T10:49:59.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28015" PostTypeId="2" ParentId="27313" CreationDate="2016-10-22T13:14:42.463" Score="1" Body="&lt;p&gt;You probably want something like this. I think you need a function that matches the img, so you can get the region and remove flyspell overlays. Also you need to modify the add-hook call a bit.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-gtk-use-system-tooltips nil)&#xA;&#xA;(defvar image-tooltip-re (concat  &quot;\\\\includegraphics{\\(?1:.*\\.&quot;&#xA;                  (regexp-opt '(&quot;png&quot; &quot;PNG&quot; &quot;JPG&quot; &quot;jpeg&quot;&#xA;                        &quot;jpg&quot; &quot;JPEG&quot; &quot;eps&quot; &quot;EPS&quot; &quot;pdf&quot;))&#xA;                  &quot;\\)}&quot;)&#xA;  &quot;Regexp to match included images&quot;)&#xA;&#xA;&#xA;(defun image-tooltip (window object position)&#xA;  (save-excursion&#xA;    (goto-char position)&#xA;    (let (beg end imgfile img s)&#xA;      (while (not (looking-at image-tooltip-re))&#xA;        (forward-char -1))&#xA;      (setq imgfile (match-string-no-properties 1))&#xA;      (if (file-exists-p imgfile)&#xA;      (progn&#xA;        (setq img (create-image (expand-file-name imgfile)&#xA;                    'imagemagick nil :width 800))&#xA;        (message (propertize &quot;Look in the minibuffer&quot;&#xA;                 'display img)))&#xA;    &quot;No file found&quot;))))&#xA;&#xA;(defun img-match (limit)&#xA;  &quot;Match bar in at the end of a word.&quot;&#xA;  (when (re-search-forward image-tooltip-re limit t)&#xA;    (flyspell-delete-region-overlays (match-beginning 1)&#xA;                     (match-end 1))&#xA;    t))&#xA;&#xA;(add-hook 'LaTeX-mode-hook&#xA;      (lambda ()&#xA;        (font-lock-add-keywords&#xA;         nil&#xA;         '((img-match 1 '(face font-lock-keyword-face&#xA;                   help-echo image-tooltip))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2016-10-31T10:05:19.080" LastActivityDate="2016-10-31T10:05:19.080" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28016" PostTypeId="1" AcceptedAnswerId="28023" CreationDate="2016-10-22T13:44:11.260" Score="3" ViewCount="438" Body="&lt;p&gt;I'm having problems getting dired to list directory contents correctly after I install dired+. To demonstrate, below is an example of how dired lists directory contents &lt;em&gt;before&lt;/em&gt; installing dired+:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QtdtO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QtdtO.png&quot; alt=&quot;Before installing dired&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I expect. Furthermore, I've updated my .emacs file to use the following listing switches:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-listing-switches &quot;-alh&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, after I install dired+, my dired-listing-switches are not respected anymore. Below is an image that shows how dired lists directory contents &lt;em&gt;after&lt;/em&gt; I install dired+&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/19oys.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/19oys.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have added the following to my .emacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired+)&#xA;(setq dired-listing-switches &quot;-alh&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I should mention that I'm using GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-10-22.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2016-10-22T16:25:55.763" Title="dired+ does not respect listing dired-listing-switches" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28017" PostTypeId="1" AcceptedAnswerId="28024" CreationDate="2016-10-22T15:00:44.940" Score="2" ViewCount="204" Body="&lt;p&gt;I like to keep my modeline pretty minimal, so I'm hiding most minor-mode lighters. Occasionally I want to check which minor-modes are enabled, and it would be nice if I could trigger a pop-up that listed them and that I could easily dismiss with &lt;code&gt;q&lt;/code&gt; or &lt;code&gt;ESC&lt;/code&gt;. I'm imagining an interface like &lt;a href=&quot;https://github.com/justbur/emacs-which-key&quot; rel=&quot;nofollow&quot;&gt;which-key&lt;/a&gt; uses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;code&gt;C-h m&lt;/code&gt;, but I'm looking for a solution that looks less like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Async-Bytecomp-Package Auto-Composition&#xA;Auto-Compression Auto-Encryption Auto-Revert Buffer-Face Column-Number&#xA;Delete-Selection Diff-Auto-Refine Drag-Stuff-Global Electric-Indent&#xA;Electric-Pair Evil Evil-Commentary Evil-Local File-Name-Shadow&#xA;Font-Lock Global-Eldoc Global-Font-Lock Global-Git-Commit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and more like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Async-Bytecomp-Package    Delete-Selection     Evil-Local&#xA;Auto-Composition          Diff-Auto-Refine     File-Name-Shadow&#xA;Auto-Compression          Drag-Stuff-Global    Font-Lock&#xA;Auto-Encryption           Electric-Indent      Global-Eldoc&#xA;Auto-Revert               Electric-Pair        Global-Font-Lock&#xA;Buffer-Face               Evil                 Global-Git-Commit&#xA;Column-Number             Evil-Commentary&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also don't need all the extra info that &lt;code&gt;C-h m&lt;/code&gt; presents (keybindings, descriptions, etc.). Plus &lt;code&gt;C-h m&lt;/code&gt; forces me to switch to it's newly opened window before I can kill it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of a package that does something like this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-10-22T16:51:34.030" Title="pop-up a list of enabled minor modes in a readable format?" Tags="|minor-mode|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28018" PostTypeId="2" ParentId="28016" CreationDate="2016-10-22T15:36:55.723" Score="1" Body="&lt;p&gt;That's how &lt;code&gt;dired+&lt;/code&gt; looks by default. To get it to view more details (like vanilla &lt;code&gt;dired-mode&lt;/code&gt;), select  &lt;code&gt;Dir&lt;/code&gt; (in menu) -&gt; &lt;code&gt;Hide/Show&lt;/code&gt; -&gt; &lt;code&gt;Hide/Show Details()&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-22T15:36:55.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28019" PostTypeId="2" ParentId="28008" CreationDate="2016-10-22T15:39:44.150" Score="5" Body="&lt;p&gt;Because you're using Emacs inside of a terminal emulator, it can't generally tell the difference between something that was typed in and something that is pasted in. You do have some options, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could run Emacs directly, rather than running it inside of a terminal emulator. As a gui app Emacs can tell the difference and act accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're using Emacs 24 (or earlier), and your terminal supports the &quot;bracketed paste&quot; feature, then you can install the &lt;code&gt;bracketed-paste&lt;/code&gt; Emacs package. If your terminal supports this feature, then it will surround your pastes with escape sequences. The &lt;code&gt;bracketed-paste&lt;/code&gt; package uses these escape sequences to turn off indentation and other automatic behaviours for the duration of the paste.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're using Emacs 25, then you don't need to install any packages; bracketed pastes are supported out of the box. Perhaps iTerm2 doesn't support them, or perhaps you have to enable them first.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-22T15:39:44.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28020" PostTypeId="2" ParentId="26716" CreationDate="2016-10-22T15:40:52.550" Score="1" Body="&lt;p&gt;I found that adding a blank line past the source block prevents the bleeding.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastActivityDate="2016-10-22T15:40:52.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28021" PostTypeId="2" ParentId="28017" CreationDate="2016-10-22T15:46:44.867" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/ShingoFukuyama/manage-minor-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;manage-minor-mode&lt;/code&gt;&lt;/a&gt;  will open a new window which shows two columns of all the &lt;em&gt;active&lt;/em&gt; minor modes and &lt;em&gt;inactive&lt;/em&gt; minor modes for the current buffer. You can selectively enable/disable minor modes by pressing &lt;kbd&gt;RET&lt;/kbd&gt; or you can also select minor modes to be enabled/disabled for the whole session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like so :- &#xA;&lt;a href=&quot;https://i.stack.imgur.com/k0WhG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/k0WhG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-10-22T16:51:34.030" LastActivityDate="2016-10-22T16:51:34.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28022" PostTypeId="2" ParentId="28017" CreationDate="2016-10-22T16:07:28.360" Score="1" Body="&lt;p&gt;Here's another way to see a list of (at least some of) the minor modes - those that choose to let you access them this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right-click the mode indicator in the mode line (any part of it: major-mode indicator or any minor-mode indicator). This is the part in parentheses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This pops up a menu (list) of many of the minor modes currently enabled (those that bother to provide mode-line lighters).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use this menu to toggle any of these minor modes on/off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Mode-Line.html&quot; rel=&quot;nofollow&quot;&gt;Mode Line&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-22T16:07:28.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28023" PostTypeId="2" ParentId="28016" CreationDate="2016-10-22T16:25:55.763" Score="3" Body="&lt;p&gt;@Chakravarthy provided most of the answer.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;(&lt;/code&gt;&lt;/strong&gt; is a keyboard shortcut for using menu &lt;strong&gt;Dir&lt;/strong&gt; &gt; &lt;strong&gt;Hide/Show&lt;/strong&gt; &gt; &lt;strong&gt;Hide/Show Details&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow&quot;&gt;Dired+&lt;/a&gt; does not impose this default behavior of hiding details. You can customize the initial behavior (details hidden or not).  These options control the behavior of hiding and showing details (&lt;code&gt;C-h v&lt;/code&gt; for each option tells you this):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;diredp-hide-details-initially-flag&lt;/strong&gt; is a variable defined in &lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;.&#xA;  Its value is t&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Non-nil means hide details in Dired from the outset.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;diredp-hide-details-propagate-flag&lt;/strong&gt; is a variable defined in &lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;.&#xA;  Its value is t&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Non-nil means display the next Dired buffer the same way as the last.&#xA;  The last &lt;code&gt;dired-hide-details-mode&lt;/code&gt; value set is used by the next Dired&#xA;  buffer created.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-22T16:25:55.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28024" PostTypeId="2" ParentId="28017" CreationDate="2016-10-22T16:40:55.867" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm-describe-modes&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;helm-describe-modes&lt;/code&gt;&lt;/a&gt; uses Helm completion, so you can easily search for and act on modes.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-10-22T16:40:55.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28025" PostTypeId="2" ParentId="21735" CreationDate="2016-10-22T16:59:40.927" Score="1" Body="&lt;p&gt;You need to add a function to one of the save-buffer hooks that serializes the contents of (point) and (org-outline-overlay-data) somewhere, perhaps as a local file variable, and also add a local variable to eval a function to restore state.&#xA;Here is an example that almost does what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar org-outline-state () &quot;State data for outline visibility&quot;)&#xA;(make-variable-buffer-local  'org-outline-state)&#xA;(put 'org-outline-state 'safe-local-variable #'listp)&#xA;&#xA;&#xA;(defun load-org-outline-state ()&#xA;  &quot;Load the last point and outline state stored in this file and apply them.&#xA;This function is usually run from a local file variable.&quot;&#xA;  (org-set-outline-overlay-data (cadr org-outline-state))&#xA;  (add-hook 'before-save-hook 'save-org-outline-state nil t)&#xA;  ;; we need visibility changes to modify the buffer so we can save them.&#xA;  (add-hook 'org-cycle-hook&#xA;        (lambda (arg)&#xA;          (set-buffer-modified-p t))&#xA;        nil t)&#xA;  (add-hook 'find-file-hook&#xA;        (lambda ()&#xA;          (when (and (boundp 'org-outline-state) org-outline-state)&#xA;        (goto-char (car org-outline-state))))))&#xA;&#xA;&#xA;(defun save-org-outline-state ()&#xA;  &quot;Write point and outline state to the file.&#xA;The first time you run this it sets up the file to save the state&#xA;persistently.&quot;&#xA;  (interactive)&#xA;  (add-hook 'before-save-hook 'save-org-outline-state nil t)&#xA;  (add-hook 'org-cycle-hook&#xA;        (lambda (arg)&#xA;          (set-buffer-modified-p t))&#xA;        nil t)&#xA;  (add-hook 'find-file-hook&#xA;        (lambda ()&#xA;          (when (and (boundp 'org-outline-state) org-outline-state)&#xA;        (goto-char (car org-outline-state)))))&#xA;&#xA;  ;; Save the data&#xA;  (save-excursion&#xA;    (add-file-local-variable&#xA;     'org-outline-state&#xA;     (list (point) (org-outline-overlay-data)))&#xA;&#xA;    ;; Make sure we have a load local variable and add it if not.&#xA;    (org-with-wide-buffer&#xA;     (goto-char (point-min))&#xA;     ;; we do this search because otherwise we will add a new eval line on every&#xA;     ;; save.&#xA;     (unless (re-search-forward &quot;^# eval: (load-org-outline-state)&quot; nil 'mv)&#xA;       (add-file-local-variable 'eval '(load-org-outline-state)))))) &#xA;&#xA;(add-to-list 'safe-local-eval-forms&#xA;         '(load-org-outline-state))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will modify the contents of your file (adding local variables and data to the end).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could store the visibility in each headline via a similar save-buffer hook, and then in a similar load function map over them to set the visibility. It is just another way to do it. &lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2016-10-22T19:22:18.373" LastActivityDate="2016-10-22T19:22:18.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28026" PostTypeId="1" AcceptedAnswerId="28507" CreationDate="2016-10-22T17:43:18.707" Score="5" ViewCount="3556" Body="&lt;p&gt;I am starting to develop a ROS (Robot Operating System) application for the first time using Emacs. Here is my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; configuration for Flycheck and company packages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Flycheck&#xA;;;;;;;;; Description: code linting (particularly C/C++ for me)&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;(require 'cc-mode)&#xA;(add-hook 'c++-mode-hook 'flycheck-mode)&#xA;(add-hook 'c-mode-hook 'flycheck-mode)&#xA;;; Check buffer on save, new line and immediately after anbling flycheck-mode&#xA;(setq flycheck-check-syntax-automatically '(mode-enabled save)) ;; new-line also possible&#xA;;; Add include paths&#xA;(add-hook 'c++-mode-hook&#xA;          (lambda () (setq flycheck-clang-include-path&#xA;                           (list (expand-file-name &quot;/opt/ros/kinetic/include/&quot;)))))&#xA;&#xA;&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; company-mode&#xA;;;;;;;;; Description: text completion framework&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;(require 'company)&#xA;;; Use company-mode in all buffers&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;;; Use company-mode with Clang&#xA;(setq company-backends (delete 'company-semantic company-backends))&#xA;(set 'company-clang-arguments (list &quot;-std=c++11&quot;)) ;; enable C++11 code completion&#xA;&#xA;&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Irony&#xA;;;;;;;;; Description: asynchronous completion capability for company-mode&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;(add-hook 'c++-mode-hook 'irony-mode)&#xA;(add-hook 'c-mode-hook 'irony-mode)&#xA;(add-hook 'objc-mode-hook 'irony-mode)&#xA;&#xA;(defun my-irony-mode-hook ()&#xA;  (define-key irony-mode-map [remap completion-at-point]&#xA;    'irony-completion-at-point-async)&#xA;  (define-key irony-mode-map [remap complete-symbol]&#xA;    'irony-completion-at-point-async))&#xA;&#xA;(add-hook 'irony-mode-hook 'my-irony-mode-hook)&#xA;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)&#xA;;; Use comapny-mode with Irony&#xA;(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)&#xA;(setq company-backends (delete 'company-semantic company-backends))&#xA;;; Enable tab-completion with no delay&#xA;(setq company-idle-delay 0)&#xA;(define-key c-mode-base-map (kbd &quot;&amp;lt;S-SPC&amp;gt;&quot;) 'company-complete)&#xA;;; Add support for completing C/C++ headers&#xA;(require 'company-irony-c-headers)&#xA;(eval-after-load 'company&#xA;  '(add-to-list&#xA;    'company-backends '(company-irony-c-headers company-irony)))&#xA;;;(add-to-list 'company-c-headers-path-system &quot;/usr/include/c++/5.4.0/&quot;)&#xA;;; Integrate Irony with Flycheck&#xA;(eval-after-load 'flycheck&#xA;  '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))&#xA;;; Set cppcheck standard to C++11&#xA;(setq irony-additional-clang-options '(&quot;-std=c++11&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem is that it seems like Flycheck is not recognizing where the ROS header files are located. On my system, they are all in &lt;code&gt;/opt/ros/kinetic/include/&lt;/code&gt; and I tried to include this path in the above code with the command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Add include paths&#xA;(add-hook 'c++-mode-hook&#xA;          (lambda () (setq flycheck-clang-include-path&#xA;                           (list (expand-file-name &quot;/opt/ros/kinetic/include/&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this seems to not fix things. I still get the error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aVvmA.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aVvmA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me with an answer on the best practice of adding custom include paths for projects for both Flycheck and company-mode to use, with the include path in this particular case being &lt;code&gt;/opt/ros/kinetic/include&lt;/code&gt;. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2016-11-07T20:30:32.347" Title="Add include paths to flycheck and to company-irony?" Tags="|company-mode|flycheck|c++|irony-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28027" PostTypeId="1" AcceptedAnswerId="28033" CreationDate="2016-10-22T17:51:48.457" Score="1" ViewCount="534" Body="&lt;p&gt;Having marked a bunch of files in &lt;code&gt;dired-mode&lt;/code&gt;, if I wanted to open all them at once, I press &lt;kbd&gt;F&lt;/kbd&gt;. But, the problem is, all the selected files opens in their own separate window and now i've at least as many windows as the files I marked in &lt;code&gt;dired-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to change this behaviour to open &lt;strong&gt;only&lt;/strong&gt; the window of the topmost file in dired listing (while also opening the rest of the selected files in &lt;code&gt;dired-mode&lt;/code&gt;, but not opening each of them in a separate window)?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-10-23T15:56:23.593" LastActivityDate="2023-05-25T17:21:37.880" Title="change default action of opening multiple files in dired" Tags="|dired|files|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28028" PostTypeId="1" CreationDate="2016-10-22T18:46:35.713" Score="1" ViewCount="2226" Body="&lt;p&gt;When starting Emacs 23.3.1 under Ubuntu 12.0.4.5 LTS, I get the following message:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `/home/john/.emacs': &#xA;Symbol's function definition is void: defvar-local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I restart with &lt;code&gt;emacs --debug-init&lt;/code&gt;, I get the following response:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function defvar-local)&#xA;  (defvar-local ess-dump-object-function nil &quot;When defined this function is called by `ess-dump-object'.&quot;)&#xA;(progn (defvar-local ess-dump-object-function nil &quot;When defined this function is called by `ess-dump-object'.&quot;) (defun ess-dump-object (object filename) &quot;Dump the ESS object OBJECT into file FILENAME.\n\nUse `ess-defmethod' to define dialect specific overrides.&quot; (let ... ... ...)))&#xA;  (eval-and-compile (defvar-local ess-dump-object-function nil &quot;When defined this function is called by `ess-dump-object'.&quot;) (defun ess-dump-object (object filename) &quot;Dump the ESS object OBJECT into file FILENAME.\n\nUse `ess-defmethod' to define dialect specific overrides.&quot; (let ... ... ...)))&#xA;  (ess-defgeneric ess-dump-object (object filename) &quot;Dump the ESS object OBJECT into file FILENAME.&quot; (let (...) (if ... nil ...) (:override ... ... ... ... ... ... ... ... ...)))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;lt;4&amp;gt;&amp;gt; nil &quot;/usr/share/emacs/site-lisp/ess/ess-mode.el&quot; nil t)  ; Reading at buffer position 44237&#xA;  load-with-code-conversion(&quot;/usr/share/emacs/site-lisp/ess/ess-mode.el&quot; &quot;/usr/share/emacs/site-lisp/ess/ess-mode.el&quot; nil t)&#xA;require(ess-mode)&#xA;eval-buffer(#&amp;lt;buffer  *load*&amp;lt;3&amp;gt;&amp;gt; nil &quot;/usr/share/emacs/site-lisp/ess/ess.el&quot; nil t)  ; Reading at buffer position 4533&#xA; load-with-code-conversion(&quot;/usr/share/emacs/site-lisp/ess/ess.el&quot; &quot;/usr/share/emacs/site-lisp/ess/ess.el&quot; nil t)&#xA;  require(ess)&#xA; eval-buffer(#&amp;lt;buffer  *load*&amp;lt;2&amp;gt;&amp;gt; nil &quot;/usr/share/emacs/site-lisp/ess/ess-site.el&quot; nil t)  ; Reading at buffer position 7790&#xA;  load-with-code-conversion(&quot;/usr/share/emacs/site-lisp/ess/ess-site.el&quot; &quot;/usr/share/emacs/site-lisp/ess/ess-site.el&quot; nil nil)&#xA;load(&quot;/usr/share/emacs/site-eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/john/.emacs&quot; nil t)  ; Reading at buffer position 4844&#xA;  load-with-code-conversion(&quot;/home/john/.emacs&quot; &quot;/home/john/.emacs&quot; t t)&#xA; load(&quot;~/.emacs&quot; t t)&#xA;  #[nil &quot;\205\264�  \306=\203�\307\310Q\2027�   \311=\2033�\312\307\313\314#\203#�\315\2027�\312\307\313\316#\203/�\317\2027�\315\2027�\307\320Q\321\322\n\321\211#\210\321=\203_�\323\324\325\307\326Q!\&quot;\322\f\321\211#\210\321=\203^�\n)\203\244�\327!\330\232\203\244�\331!\211\332P\&quot;\333\&quot;!\203\200�\&quot;\202\213�\333&#xA;!\203\212�&#xA;\202\213�\313\211\203\243�\334&#xA;\&quot;\203\241�\335\336&#xA;#\210\337\340!\210&#xA;*#?\205\263�\313$\322\341\321\211#))\207&quot; [init-file-user system-type user-init-file-1 user-init-file otherfile source ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; &quot;~/_emacs&quot; &quot;/.emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot; alt inhibit-default-init inhibit-startup-screen] 7]() &#xA;  command-line()  &#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs basic functions work o.k.  But the features I had specified in the &lt;code&gt;.emacs&lt;/code&gt; file are ignored.  I have not located the troublesome &quot;defvar-local&quot; definition.  If someone could tell me how to correct the error, I would be most grateful.&lt;/p&gt;&#xA;" OwnerUserId="13747" LastEditorUserId="675" LastEditDate="2016-10-22T19:29:07.710" LastActivityDate="2016-10-23T03:17:42.427" Title="How to remove cause of an error in loading .emacs: Symbol's function definition is void: defvar-local" Tags="|init-file|defvar-local|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28029" PostTypeId="2" ParentId="28028" CreationDate="2016-10-22T19:19:55.537" Score="2" Body="&lt;p&gt;You are getting this error because macro &lt;code&gt;defvar-local&lt;/code&gt; does not exist in your Emacs version (23). It was introduced in Emacs 24.3. (You might consider upgrading to a more recent version.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define the macro if you want, or you can replace its use by substituting its definition.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro defvar-local (var val &amp;amp;optional docstring)&#xA;  &quot;Define VAR as a buffer-local variable with default value VAL.&#xA;Like `defvar' but additionally marks the variable as being automatically&#xA;buffer-local wherever it is set.&quot;&#xA;  (declare (debug defvar) (doc-string 3))&#xA;  ;; Can't use backquote here, it's too early in the bootstrap.&#xA;  (list 'progn (list 'defvar var val docstring)&#xA;        (list 'make-variable-buffer-local (list 'quote var))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you define it, be sure to do so before loading the file where the error is being raised. Or define the macro and then byte-compile that file again, to incorporate the macro calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If substituting, this is all you really need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar THE-VARIABLE THE-VALUE THE-DOC)&#xA;(make-variable-buffer-local THE-VARIABLE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However&lt;/em&gt;, be prepared for other gotchas (if you don't upgrade), since apparently that library needs Emacs 24.3 or later. It is possible that there are other things from such a recent version that it needs, besides &lt;code&gt;defvar-local&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-22T19:28:40.063" LastActivityDate="2016-10-22T19:28:40.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28030" PostTypeId="1" CreationDate="2016-10-22T19:50:29.473" Score="2" ViewCount="249" Body="&lt;p&gt;Emacs is aweseome but sometimes it feels it's too smart for its own good. You may feel you learned everything there's to know about a function and then someone tells you to try a prefix argument and suddenly it does something you never knew about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example - you can jump to Magit without opening a project, by calling &lt;code&gt;magit-status&lt;/code&gt; with 2 prefix arguments (it will prompt you with a &quot;choose directory&quot; dialog) - I just learned that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So my question is:&lt;/strong&gt; Is it possible to build a list of functions that take prefix arguments and for each row grab the description (maybe from &lt;code&gt;describe-function&lt;/code&gt;) that explains what calling the function with a prefix would do?&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="8992" LastEditDate="2016-10-24T04:57:13.467" LastActivityDate="2016-10-24T04:57:13.467" Title="Finding possible prefix arguments" Tags="|prefix-argument|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28031" PostTypeId="2" ParentId="28030" CreationDate="2016-10-22T20:33:06.960" Score="2" Body="&lt;p&gt;Here is one way to get the functions that mention prefix in the doc string. This saves the output to a file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-file &quot;prefix-cmds.org&quot;&#xA;  (loop for cmd-name in smex-ido-cache&#xA;    do&#xA;    (let* ((cmd (intern cmd-name))&#xA;           (doc (documentation cmd)))&#xA;      (when (and doc (string-match &quot;prefix&quot; doc))&#xA;        (insert&#xA;         (format &quot;** %s\n\n%s\n\n&quot;&#xA;             cmd&#xA;             (org-escape-code-in-string doc)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This misses any function that doesn't specifically call it a prefix, e.g. a universal argument, or prfix, etc... You might catch those with a better string match. It is also limited to functions in smex-ido-cache, but that is what counsel-M-x uses, so I assume it is not missing any. Maybe there is a better way to get a full list of interactive commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, this listed 1457 commands for me!&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-10-22T20:33:06.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28032" PostTypeId="1" AcceptedAnswerId="28223" CreationDate="2016-10-22T20:55:36.710" Score="1" ViewCount="179" Body="&lt;p&gt;I've been using Neil Van Dyke's &lt;a href=&quot;http://www.neilvandyke.org/scribble-emacs/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;scribble-mode&lt;/code&gt;&lt;/a&gt; for editing &lt;a href=&quot;http://docs.racket-lang.org/scribble/index.html&quot; rel=&quot;nofollow&quot;&gt;Scribble&lt;/a&gt; code in Emacs. I'm also using &lt;a href=&quot;https://github.com/auto-complete/auto-complete&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;auto-complete&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/syohex/emacs-ac-capf&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ac-capf&lt;/code&gt;&lt;/a&gt; to get better completion in &lt;code&gt;scribble-mode&lt;/code&gt;. However, I've been running into a problem wherein I can't get auto-completion directly after an &lt;code&gt;@&lt;/code&gt; character in &lt;code&gt;scribble-mode&lt;/code&gt; buffers. This is a problem because the &lt;code&gt;@&lt;/code&gt; character &lt;a href=&quot;http://docs.racket-lang.org/scribble/reader.html&quot; rel=&quot;nofollow&quot;&gt;is an important part of Scribble's syntax.&lt;/a&gt; My current workaround is to type a keyword out and use a keybinding to auto-insert an &lt;code&gt;@&lt;/code&gt; before the word. However, this is becoming quite tedious and I would like to have normal-style completion instead. A very weird part about this is that pressing &lt;code&gt;M-TAB&lt;/code&gt; (which runs the &lt;code&gt;completion-at-point&lt;/code&gt; function) displays completion candidates in the &lt;code&gt;*Completions*&lt;/code&gt; buffer, even  after an &lt;code&gt;@&lt;/code&gt; character, so I'm not sure why this isn't working with &lt;code&gt;auto-complete&lt;/code&gt; / &lt;code&gt;ac-capf&lt;/code&gt;. &lt;a href=&quot;https://cl.ly/3O47001k1l0s/auto_complete_and_scribble_mode.mp4&quot; rel=&quot;nofollow&quot;&gt;Here's a screencast demonstrating my problem.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is how can I get auto-completion to work directly after an &lt;code&gt;@&lt;/code&gt; character in &lt;code&gt;scribble-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10761" LastActivityDate="2016-10-28T18:35:37.100" Title="Getting auto-complete to work correctly in scribble-mode" Tags="|completion|auto-complete-mode|characters|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28033" PostTypeId="2" ParentId="28027" CreationDate="2016-10-22T21:01:45.590" Score="4" Body="&lt;p&gt;If you want that to happen all the time, try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key dired-mode-map (kbd &quot;F&quot;) (lambda ()&#xA;                       (interactive)&#xA;                       (find-file (car (dired-get-marked-files)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want all the files to get opened, you could try this variation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key dired-mode-map (kbd &quot;F&quot;)&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (mapc #'find-file (reverse (dired-get-marked-files)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2016-10-23T17:35:58.833" LastActivityDate="2016-10-23T17:35:58.833" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28034" PostTypeId="2" ParentId="26186" CreationDate="2016-10-22T21:28:32.057" Score="1" Body="&lt;p&gt;You have still not provided the real initialization code, but from your description it seems, your &lt;code&gt;.emacs&lt;/code&gt; contains code that loads an org-file for example with &lt;code&gt;org-babel-load-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use this function org-mode has to be loaded and because it's part of emacs, this doesn't raise a chicken-and-egg problem, but succeeds with the builtin version. And because org-mode now is loaded it will never be looked up in your cloned directory that is configured after this point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from this insight you have at least these possibilities:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Tangle your org-file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Just tangle the &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt; every time you change your source file. There is for sure a way to do this automatically.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Bootstrap org-mode before loading the init-file&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Move the loading of org-mode to &lt;code&gt;.emacs&lt;/code&gt; and then &lt;code&gt;org-babel-load-file&lt;/code&gt; the rest of your configuration.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;reload org-mode&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Reload org-mode in the above shown code with &lt;code&gt;org-reload&lt;/code&gt;.  I think this is the least useful choice because org-mode is loaded twice.&lt;/p&gt;&#xA;" OwnerUserId="934" LastActivityDate="2016-10-22T21:28:32.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28035" PostTypeId="2" ParentId="28030" CreationDate="2016-10-22T23:44:10.623" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A list of all commands &quot;that take prefix arguments&quot; means a list of &lt;strong&gt;all&lt;/strong&gt; commands.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you instead mean a list of only those commands whose doc mentions prefix-argument behavior then you need to search command doc strings.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;An easy way to do this is to use command &lt;code&gt;apropos-documentation&lt;/code&gt;, which is bound to &lt;strong&gt;&lt;code&gt;C-h d&lt;/code&gt;&lt;/strong&gt;.  Give it the regexp &lt;strong&gt;&lt;code&gt;prefix[- ]+arg&lt;/code&gt;&lt;/strong&gt;, for example.&#xA;And yes, use &lt;code&gt;C-u&lt;/code&gt; if you have not customized &lt;strong&gt;&lt;code&gt;apropos-do-all&lt;/code&gt;&lt;/strong&gt; to non-&lt;code&gt;nil&lt;/code&gt; (which I recommend).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; apropos-documentation is an interactive autoloaded compiled Lisp&#xA; function in `apropos.el'.&#xA;&#xA; It is bound to C-h d, f1 d, help d, C-h M-a, f1 M-a, help M-a,&#xA; menu-bar help-menu apropos apropos-doc, menu-bar help-menu&#xA; search-documentation search-documentation-strings.&#xA;&#xA; (apropos-documentation PATTERN &amp;amp;optional DO-ALL)&#xA;&#xA; Show symbols whose documentation contains matches for PATTERN.&#xA; PATTERN can be a word, a list of words (separated by spaces),&#xA; or a regexp (using some regexp special characters).  If it is a word,&#xA; search for matches for that word as a substring.  If it is a list of words,&#xA; search for matches for any two (or more) of those words.&#xA;&#xA; Note that by default this command only searches in the file specified by&#xA; `internal-doc-file-name'; i.e., the etc/DOC file.  With C-u prefix,&#xA; or if `apropos-do-all' is non-nil, it searches all currently defined&#xA; documentation strings.&#xA;&#xA; Returns list of symbols and documentation found.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Apropos.html&quot; rel=&quot;nofollow&quot;&gt;Apropos&lt;/a&gt;, for more information.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another easy way to do this is to use &#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt; command &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_A_Propos_d&amp;#39;Apropos#icicle-fundoc&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;icicle-fundoc&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-23T01:20:29.777" LastActivityDate="2016-10-23T01:20:29.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28036" PostTypeId="2" ParentId="28028" CreationDate="2016-10-23T03:17:42.427" Score="1" Body="&lt;p&gt;Answering the &lt;code&gt;I have not located the troublesome &quot;defvar-local&quot; definition&lt;/code&gt; part of the question...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The message tells you where the error is coming from - &lt;code&gt;/usr/share/emacs/site-lisp/ess/ess-mode.el&lt;/code&gt; (and that this was required from &lt;code&gt;ess.el&lt;/code&gt; in the same directory and that came from &lt;code&gt;ess-site&lt;/code&gt;). The fact that this is from site-lisp hints that you might have a later version of emacs installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might decide that you don't want to &lt;code&gt;(require 'ess-site)&lt;/code&gt;  or at least move it to the end of &lt;code&gt;/home/john/.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There is also a &lt;code&gt;--no-site-lisp&lt;/code&gt; startup option in case you have a conflict, but I doubt that this is the problem)&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-10-23T03:17:42.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28037" PostTypeId="1" AcceptedAnswerId="28051" CreationDate="2016-10-23T06:38:14.270" Score="9" ViewCount="1345" Body="&lt;p&gt;I am using Emacs 25.1 run with &lt;code&gt;emacs -Q&lt;/code&gt; and Org mode version 8.2.10. This problem persists in my &lt;a href=&quot;https://github.com/igorpere/emacs-config&quot; rel=&quot;noreferrer&quot;&gt;customized Emacs&lt;/a&gt; with Org mode version 8.3.6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am attempting to open hyperlinks of the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:documenterino.pdf][documenterino]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;using the external default pdf viewer, evince.&#xA;When I create the above link, it turns into a blue, underlined &lt;code&gt;documenterino&lt;/code&gt;. If I use &lt;code&gt;C-c C-o&lt;/code&gt;, &lt;code&gt;C-u C-c C-o&lt;/code&gt;, or &lt;code&gt;C-u C-u C-c C-o&lt;/code&gt; on it, I get the same result every time: the pdf opens in a new &lt;code&gt;docview&lt;/code&gt; buffer in emacs, when I want it to open outside emacs in evince.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried changing &lt;code&gt;file:&lt;/code&gt; to &lt;code&gt;file+sys:&lt;/code&gt;, and &lt;code&gt;~/documents/documenterino.pdf&lt;/code&gt; instead of &lt;code&gt;documenterino.pdf&lt;/code&gt;, but there is no change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LMouse, RMouse, and MMouse also open in doc-view regardless of changes.&lt;/p&gt;&#xA;" OwnerUserId="13342" LastEditorUserId="25" LastEditDate="2016-11-23T21:51:25.963" LastActivityDate="2016-11-23T21:51:25.963" Title="Org-mode file hyperlinks always use doc-view, can't force it to use external pdf viewer" Tags="|org-mode|pdf|docview|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28038" PostTypeId="1" AcceptedAnswerId="28041" CreationDate="2016-10-23T06:50:02.413" Score="5" ViewCount="426" Body="&lt;p&gt;Is there something like &lt;code&gt;apply-partially&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(apply-partially FUN &amp;amp;rest ARGS)&#xA;&#xA;Return a function that is a partial application of FUN to ARGS.&#xA;ARGS is a list of the first N arguments to pass to FUN.&#xA;The result is a new function which does the same as FUN, except that&#xA;the first N arguments are fixed at the values with with which this&#xA;function was called.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But with the &quot;&lt;strong&gt;last&lt;/strong&gt; N arguments are fixed&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or &quot;&lt;strong&gt;all&lt;/strong&gt; arguments are fixed except wildcard&quot; ie:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (a b c))&#xA;(defalias 'fix-a-c-in-foo 'apply-partially-wildcard 'foo &quot;a valuel&quot; '_ &quot;c value&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;_&lt;/code&gt; - random symbol that means &quot;wildcard&quot;&lt;/p&gt;&#xA;" OwnerUserId="13154" LastEditorUserId="9995" LastEditDate="2016-10-23T07:28:17.370" LastActivityDate="2016-10-24T00:31:12.697" Title="apply partially last arg" Tags="|elisp|apply|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28039" PostTypeId="2" ParentId="20981" CreationDate="2016-10-23T09:48:12.090" Score="1" Body="&lt;p&gt;I ended up writing &lt;a href=&quot;https://github.com/tetracat/emacsrepl&quot; rel=&quot;nofollow&quot;&gt;my own readline thing&lt;/a&gt; with the help of @ack006.  It consists of a shell script enabling raw mode and sending one character at a time to an Emacs in batch mode which interprets the key sequences accordingly and emits ANSI escapes to pretend line editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd still appreciate an answer involving the new module support.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-10-23T09:48:12.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28040" PostTypeId="1" AcceptedAnswerId="28044" CreationDate="2016-10-23T13:30:13.020" Score="3" ViewCount="3619" Body="&lt;p&gt;new to emacs, so if I'm mistaken with vocabulary, please excuse me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using orgmode, and I wish to modify the way it displays, specifically I wish to have some extra vertical distance before a level 1 task and the line before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the &lt;code&gt;M-x customize-groups RET orgmode-faces RET&lt;/code&gt; menu, and there are some options to customize org level 1 face, however not what I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please point me in the right direction? I think I'm just not fluent in emacs speech to formulate the question correctly...&lt;/p&gt;&#xA;" OwnerUserId="13751" LastEditorUserId="105" LastEditDate="2016-10-23T13:49:11.793" LastActivityDate="2016-10-23T14:10:08.317" Title="Orgmode: Extra vertical space between level 1 and previous line" Tags="|org-mode|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28041" PostTypeId="2" ParentId="28038" CreationDate="2016-10-23T13:37:44.003" Score="4" Body="&lt;p&gt;You have everything you need in the emacs-lisp core language with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Function-Cells.html#index-fset&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;fset&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Lambda-Expressions.html#Lambda-Expressions&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;lambda&lt;/code&gt; expressions&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html#Backquote&quot; rel=&quot;nofollow&quot;&gt;backticks&lt;/a&gt;.&#xA;The following source code is an extension of your second example.&#xA;The comma expression allows you to easily substitute something in a back-tick quoted &lt;code&gt;lambda&lt;/code&gt; expression&#xA;and you can assign that expression to a symbol's function-cell with &lt;code&gt;fset&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (a b c d)&#xA;  (message &quot;a=%s b=%s c=%s d=%s&quot; a b c d))&#xA;&#xA;(let ((fix-a &quot;a-value&quot;))&#xA;  (fset #'fix-a-c-in-foo `(lambda (_d _b) (foo ,fix-a _b &quot;c-value&quot; _d)))&#xA;  )&#xA;&#xA;(fix-a-c-in-foo &quot;new-d-value&quot; &quot;new-b-value&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have added one more argument to &lt;code&gt;foo&lt;/code&gt; to have at least two fix parameters and two &quot;template&quot; parameters. The template parameters &lt;code&gt;_b&lt;/code&gt; and &lt;code&gt;_d&lt;/code&gt; are swapped which would not be possible if you just had one symbol for all such parameters. Furthermore, I've wrapped the &lt;code&gt;fset&lt;/code&gt; (corresponding to your &lt;code&gt;defalias&lt;/code&gt;) in my version in a &lt;code&gt;let&lt;/code&gt; to show that we can use the value of a local variable as fixed parameter in the template.&#xA;The part of the above source code that solves your problem is just:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(fset #'fix-a-c-in-foo `(lambda (_d _b) (foo ,fix-a _b &quot;c-value&quot; _d)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-10-23T14:14:13.140" LastActivityDate="2016-10-23T14:14:13.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28043" PostTypeId="2" ParentId="27976" CreationDate="2016-10-23T13:54:08.620" Score="1" Body="&lt;p&gt;Use this command to invoke the client:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -s foo -t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;-s&lt;/code&gt; is for giving a server name in contrast to &lt;code&gt;-f&lt;/code&gt; that specifies the server file and that's a socket with full path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs starts the server on a local socket (represented by a file) if available -- and with linux it is. So, no TCP socket is opened.&lt;/p&gt;&#xA;" OwnerUserId="934" LastEditorUserId="934" LastEditDate="2016-10-23T15:38:13.623" LastActivityDate="2016-10-23T15:38:13.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28044" PostTypeId="2" ParentId="28040" CreationDate="2016-10-23T14:10:08.317" Score="7" Body="&lt;p&gt;There may be a better way, but the following can help.  From org &lt;a href=&quot;http://orgmode.org/manual/Headlines.html#Headlines&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt;, if you insert more than one blank line before the heading, one blank line will be displayed:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An empty line after the end of a subtree is considered part of it and&#xA;  will be hidden when the subtree is folded.  However, if you leave at&#xA;  least two empty lines, one empty line will remain visible after folding&#xA;  the subtree, in order to structure the collapsed view.  See the variable&#xA;  ‘org-cycle-separator-lines’ to modify this behavior.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As it says, this can be tweaked (&lt;code&gt;C-h v org-cycle-separator-lines&lt;/code&gt;) for the variable doc string:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Number of empty lines needed to keep an empty line between collapsed trees.&#xA;  If you leave an empty line between the end of a subtree and the following&#xA;  headline, this empty line is hidden when the subtree is folded.&#xA;  Org-mode will leave (exactly) one empty line visible if the number of&#xA;  empty lines is equal or larger to the number given in this variable.&#xA;  So the default 2 means at least 2 empty lines after the end of a subtree&#xA;  are needed to produce free space between a collapsed subtree and the&#xA;  following headline.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;If the number is negative, and the number of empty lines is at least -N,&#xA;  all empty lines are shown&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So if you set the variable to -2, and insert two blank lines, they will be displayed.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-10-23T14:10:08.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28045" PostTypeId="2" ParentId="28038" CreationDate="2016-10-23T14:41:27.287" Score="5" Body="&lt;p&gt;&lt;code&gt;apply-partially&lt;/code&gt; was most useful back when Emacs did not have lexical binding, since it let you build &quot;closures&quot;.  But for your example, you don't even need a closure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'fix-a-c-in-foo (lambda (b) (foo &quot;a_value&quot; b &quot;c_value&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for a more general case, OTOH you do need closures, so you'll want to add &lt;code&gt;-*- lexical-binding:t -*-&lt;/code&gt; to the first line of your file and then you can do things like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun whatever (a c)&#xA;  (lambda (b) (foo a b c)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, note that &lt;code&gt;(lambda (x y) (foo a x y))&lt;/code&gt; is implemented more efficiently than &lt;code&gt;(apply-partially #'foo a)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-10-24T00:31:12.697" LastActivityDate="2016-10-24T00:31:12.697" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28046" PostTypeId="2" ParentId="27897" CreationDate="2016-10-23T15:38:16.380" Score="1" Body="&lt;p&gt;Flycheck picks the first existing syntax checker from &lt;code&gt;flycheck-checkers&lt;/code&gt;. In other words, the order in &lt;code&gt;flycheck-checkers&lt;/code&gt; defines the priority of syntax checkers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to ensure that &lt;code&gt;standard&lt;/code&gt; is being used for your project set &lt;code&gt;flycheck-checker&lt;/code&gt; to &lt;code&gt;javascript-standard&lt;/code&gt; via &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow&quot;&gt;Directory Variables&lt;/a&gt;.  You can use &lt;code&gt;C-c ! s&lt;/code&gt; to interactively switch between syntax checkers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The verification buffer at &lt;code&gt;C-c ! v&lt;/code&gt; tells you which checkers aren't disabled.  It won't tell you exactly which checkers are actually, but we &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/1090&quot; rel=&quot;nofollow&quot;&gt;intend to fix that&lt;/a&gt;.  We are also working on a refactoring that will make it easier to select just those syntax checkers you want via directory variables.&lt;/p&gt;&#xA;" OwnerDisplayName="user227" LastActivityDate="2016-10-23T15:38:16.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28047" PostTypeId="2" ParentId="28037" CreationDate="2016-10-23T16:34:50.323" Score="5" Body="&lt;p&gt;I added &#xA;&lt;code&gt;(add-to-list 'org-file-apps '(&quot;pdf&quot; . &quot;evince %s&quot;))&lt;/code&gt;&#xA;to my init-file.  Now &lt;code&gt;C-c C-o&lt;/code&gt; opens any PDF in evince and &lt;code&gt;C-u C-u C-c C-o&lt;/code&gt; opens them in &lt;code&gt;doc-view&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2016-10-23T16:34:50.323" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28048" PostTypeId="1" CreationDate="2016-10-23T16:55:43.813" Score="2" ViewCount="109" Body="&lt;p&gt;If I invoke &lt;code&gt;org-preview-latex-fragment&lt;/code&gt; under one region, it destroys my previews in all other regions. Is there a way to make latex previews stick, so that previews are only removed when running &lt;code&gt;C-c C-c&lt;/code&gt; a local (on point) or global &quot;hide previews&quot; command?&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-10-23T20:59:15.840" LastActivityDate="2017-01-12T14:26:06.617" Title="Make org-preview-latex-fragment stick" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28049" PostTypeId="2" ParentId="27674" CreationDate="2016-10-23T17:46:48.153" Score="3" Body="&lt;p&gt;I haven't tried this thoroughly, but should work:&#xA;1. if region is active, evaluate it (this currently works), goto 3.&#xA;2. if region not active, evaluate current statement, goto 3.&#xA;3. Jump to the beginning of next paragraph&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun python-shell-send-region-or-line nil&#xA;  &quot;Sends from python-mode buffer to a python shell, intelligently.&quot;&#xA;  (interactive)&#xA;  (cond ((region-active-p)&#xA;     (setq deactivate-mark t)&#xA;     (python-shell-send-region (region-beginning) (region-end))&#xA;     (python-nav-forward-statement)&#xA; ) (t (elpy-shell-send-current-statement))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Taken from &lt;a href=&quot;https://stackoverflow.com/questions/35934972/emacs-elisp-send-line-if-no-region-active-python-mode/40152990#40152990&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13752" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-10-23T17:46:48.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28050" PostTypeId="2" ParentId="27228" CreationDate="2016-10-23T17:46:57.657" Score="1" Body="&lt;p&gt;You have mixed a lot of orthogonal questions into one problem.  I will try to untangle them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's generally no problem, if you update packages after you have used functions from the package. The problem with org-mode is, that it's part of emacs. So if you call some org-mode function before initializing the elpa-repo, the internal package will be used and you don't get your newly installed org-mode. This is true for every emacs startup not just when upgrading the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some times it is a problem, if you try to compile a package that is already loaded, because there may be symbols that have changed in the new version, but are still present in your running instance. This may lead to weird effects and so these package are better compiled in a fresh instance of emacs like &lt;code&gt;paradox-upgrade-packages&lt;/code&gt; do in async mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting emacs in daemon-mode means, that it starts with no console and frame attached, starts a server and then waits for clients to attach. A client is now able to open a new frame (or reuse an existing one) and when this frame is closed, the server is still running in the back. &lt;code&gt;emacsclient -a &quot;&quot;&lt;/code&gt; is just an easy way to connect to a running daemon that has started a server or starting one if not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1: If you have started the right org-mode, you can update org-mode and restart in the same session with org-reload.  Only if you get weird results, try an async compile i.e. compile in a fresh emacs and just restart your running session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2: The daemon changes nothing to the better for upgrading, but sometimes to the worse. The daemon keeps running and &lt;code&gt;emacsclient -a &quot;&quot;&lt;/code&gt; just ignores the &lt;code&gt;-a&lt;/code&gt; cause the server is still there. So if you come into trouble, start a new emacs without &lt;code&gt;--daemon&lt;/code&gt; (you don't have to stop your current session), resolve your problems and then restart your daemon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3: Make sure your first org-mode function is used after the elpa packages are initialized (or your load-path is set to the local org-mode installation). And if you want to be on the safe side, do every &lt;code&gt;package-install&lt;/code&gt; inside a clean emacs.&lt;/p&gt;&#xA;" OwnerUserId="934" LastActivityDate="2016-10-23T17:46:57.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28051" PostTypeId="2" ParentId="28037" CreationDate="2016-10-23T18:25:20.380" Score="7" Body="&lt;p&gt;I fixed the problem by using &lt;code&gt;M-x customize-variable org-file-apps&lt;/code&gt; and adding a cons-cell with &lt;code&gt;Extension: \.pdf\'&lt;/code&gt; and &lt;code&gt;Command: evince %s&lt;/code&gt; at the top.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PKOVd.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PKOVd.png&quot; alt=&quot;emacs customize screen&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oddly enough, links starting with &lt;code&gt;file+sys:&lt;/code&gt; still open in emacs doc-view, while links starting with &lt;code&gt;file:&lt;/code&gt; open in evince (regadless of absolute or relative path). But I don't care because there's no autocompletion for &lt;code&gt;file+sys:&lt;/code&gt; anyway.&lt;/p&gt;&#xA;" OwnerUserId="13342" LastEditorUserId="13342" LastEditDate="2016-10-23T18:48:42.357" LastActivityDate="2016-10-23T18:48:42.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28053" PostTypeId="1" AcceptedAnswerId="28083" CreationDate="2016-10-23T21:12:24.770" Score="1" ViewCount="494" Body="&lt;p&gt;I'm learning Haskell. One of first steps was to make pleasant development environment. I've already found &lt;code&gt;haskell-mode&lt;/code&gt;, &lt;code&gt;intero&lt;/code&gt; and some more useful packages but I miss offline/online documentation for the symbol at point.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I've already found looks alike what I need is &lt;a href=&quot;http://haskell.github.io/haskell-mode/manual/latest/Browsing-Haddocks.html#Browsing-Haddocks&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; but have no success with configuration. I have &lt;code&gt;cabal&lt;/code&gt; installed from &lt;code&gt;haskell-platform&lt;/code&gt; on &lt;code&gt;ubuntu 14.04&lt;/code&gt; but don't have &lt;code&gt;~/.cabal/share/doc/&lt;/code&gt;. What I expect is when the cursor is on e.g. &lt;code&gt;repeat&lt;/code&gt; function and &lt;code&gt;C-c C-d&lt;/code&gt; is presed it shows the some documentation for the function. It's nice to have some basic information about function signature in mini buffer but for a newcomer it would be great to have access to full documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is prefered way to get symbols full documentation inside Emacs?&lt;/p&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-10-24T18:35:53.103" Title="Symbol documentation and implementation code in haskell-mode" Tags="|haskell-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28054" PostTypeId="1" CreationDate="2016-10-23T21:18:33.133" Score="1" ViewCount="199" Body="&lt;p&gt;I have a plain text dictionary in which each headword is matched by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^# \(† \)?headword,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make a custom search function that relieves me of typing &#xA;the whole regex every time I want to look up a word?   I tried recording a keyboard macro, but that didn't work.&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2022-07-27T21:52:30.197" Title="Custom search function for dictionary lookup" Tags="|regular-expressions|functions|keyboard-macros|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28055" PostTypeId="1" CreationDate="2016-10-23T21:52:07.683" Score="7" ViewCount="1109" Body="&lt;p&gt;What is the reasoning behind the design of not inheriting the SCHEDULED and priority properties?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any notable use cases to support this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the contrary, actually inheriting SCHEDULED (or DEADLINE for that matter) and priority properties makes perfect sense to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if an entry is SCHEDULED and thus is appearing in the week agenda, adding a sub-item to it will automatically bring that item to agenda replacing the parent. This will prevent the parent from falling out of attention. In the current design you may loose a DEADLINE task forever by adding a sub-task to it without scheduling it.&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2021-08-01T16:05:05.487" Title="Inherit SCHEDULED and priority properties" Tags="|org-mode|org-agenda|todo|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28056" PostTypeId="1" CreationDate="2016-10-23T22:53:28.627" Score="2" ViewCount="1145" Body="&lt;p&gt;I'm using Spacemacs Latex layer, which uses Auctex. If press space m v for the first time, the document viewer opens up in full screen over my emacs window. After, it only updates the window and keeps it under my emacs window. So to have the workflow that I want, I have to manually resize the emacs window to take up the left half of my screen and the Document Viewer window take up the right half.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two possible solutions that I can think of, I don't know how to do either or which is easier:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Get a pdf viewer for emacs and make the view command open the pdf in emacs in a new split window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make the view command somehow resize the Document Viewer window and my emacs window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But presumably there is a standard solution to this problem? It's a pretty standard workflow so I expect someone to have figured it out.&lt;/p&gt;&#xA;" OwnerUserId="12873" LastActivityDate="2021-12-08T18:02:00.223" Title="Spacemacs Latex: how to make view command tile vertically with emacs window?" Tags="|latex|auctex|spacemacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28057" PostTypeId="2" ParentId="28054" CreationDate="2016-10-23T23:02:11.123" Score="1" Body="&lt;p&gt;Something like this might do. I wasn't sure how you store the dictionary though.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-search (word)&#xA;  (interactive &quot;sWord: &quot;)&#xA;  ;; some code to open your dictionary file&#xA;  (goto-char (point-min))&#xA;  (re-search-forward (format &quot;^# \\(† \\)?%s,&quot; word) nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2016-10-24T22:39:06.263" LastActivityDate="2016-10-24T22:39:06.263" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28059" PostTypeId="1" CreationDate="2016-10-24T01:04:18.727" Score="23" ViewCount="10064" Body="&lt;p&gt;Occasionally emacs will hit 100% cpu usage. Obviously when this occurs there is an issue with a runaway process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wondering if there is a way to view all running processes in emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind of like unix htop, the interactive system process monitor &amp;amp; viewer... &lt;a href=&quot;https://github.com/hishamhm/htop&quot; rel=&quot;noreferrer&quot;&gt;htop&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12780" LastActivityDate="2019-03-12T12:22:16.837" Title="Does emacs have a process viewer (resource manager) or equivalent?" Tags="|process|" AnswerCount="5" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28060" PostTypeId="2" ParentId="27972" CreationDate="2016-10-24T01:56:26.293" Score="0" Body="&lt;p&gt;I guess you forgot to put &lt;code&gt;(workgroups-mode 1)&lt;/code&gt; at the bottom of your .emacs. This line code will restore workspaces session.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-10-24T01:56:26.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28061" PostTypeId="1" CreationDate="2016-10-24T03:08:51.970" Score="2" ViewCount="541" Body="&lt;p&gt;I am able to clone a session after configure the configure file under .ssh&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat .ssh/config&#xA;host *&#xA;ControlMaster auto&#xA;ControlPath ~/.ssh/master-%r@%h:%p&#xA;ServerAliveInterval 60&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After I connect to the remote server once, then I don't need to input password to it when connect to it the second time using the clone session approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But looks like emacs couldn't clone the session. When I open a file on emacs, it still need to ask for password. Is there anything additional need to configure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tramp I am using is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tramp is a built-in package.&#xA;&#xA;     Status: Built-In.&#xA;    Version: 2.2.13.25.1&#xA;    Summary: Transparent Remote Access, Multiple Protocol&#xA;Other versions: 2.2.13.25.1 (builtin).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After I added the following to the .spacemacs (I am using spacemac).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq tramp-debug-buffer t)&#xA;  (setq tramp-verbose 9)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In in the debug buffer I will see it has the following and hangs there.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; GNU Emacs: 25.1.1 Tramp: 2.2.13.25.1 -*- mode: outline; -*-&#xA;16:03:10.771969 tramp-get-file-property (8) #  file-attributes-string nil&#xA;16:03:10.772297 tramp-get-connection-property (7) # stat undef&#xA;16:03:10.772372 tramp-get-remote-stat (5) # Finding a suitable ‘stat’ command&#xA;16:03:10.772442 tramp-get-connection-property (7) # remote-path undef&#xA;16:03:10.772521 tramp-get-connection-property (7) # process-name nil&#xA;16:03:10.772591 tramp-get-connection-property (7) # process-name nil&#xA;16:03:10.772655 tramp-get-connection-property (7) # process-buffer nil&#xA;16:03:10.772759 tramp-file-name-handler (5) # Non-essential received in operation (file-attributes /ssh:test-server: string)&#xA;16:03:10.773157 tramp-get-connection-property (7) # uid-string nil&#xA;16:03:10.773240 tramp-get-connection-property (7) # gid-string nil&#xA;16:03:10.773315 tramp-get-file-property (8) #  file-attributes-integer nil&#xA;16:03:10.773769 tramp-get-connection-property (7) # stat undef&#xA;16:03:10.773839 tramp-get-remote-stat (5) # Finding a suitable ‘stat’ command&#xA;16:03:10.773903 tramp-get-connection-property (7) # remote-path undef&#xA;16:03:10.773973 tramp-get-connection-property (7) # process-name nil&#xA;16:03:10.774048 tramp-get-connection-property (7) # process-name nil&#xA;16:03:10.774115 tramp-get-connection-property (7) # process-buffer nil&#xA;16:03:10.774194 tramp-file-name-handler (5) # Non-essential received in operation (file-attributes /ssh:test-server:)&#xA;16:03:10.774587 tramp-get-connection-property (7) # uid-integer nil&#xA;16:03:10.774665 tramp-get-connection-property (7) # gid-integer nil&#xA;16:03:10.774756 tramp-get-connection-property (7) # test undef&#xA;16:03:10.774820 tramp-get-test-command (5) # Finding a suitable ‘test’ command&#xA;16:03:10.774887 tramp-get-connection-property (7) # process-name nil&#xA;16:03:10.774959 tramp-get-connection-property (7) # process-name nil&#xA;16:03:10.775027 tramp-get-connection-property (7) # process-buffer nil&#xA;16:03:10.775106 tramp-file-name-handler (5) # Non-essential received in operation (file-readable-p /ssh:test-server:)&#xA;16:03:18.005921 tramp-get-file-property (8) #  file-attributes-integer nil&#xA;16:03:18.006013 tramp-get-file-property (8) #  file-attributes-string nil&#xA;16:03:18.006082 tramp-get-connection-property (7) # file-exists undef&#xA;16:03:18.006163 tramp-get-file-exists-command (5) # Finding command to check if file exists&#xA;16:03:18.006258 tramp-get-connection-property (7) # test undef&#xA;16:03:18.006321 tramp-get-test-command (5) # Finding a suitable ‘test’ command&#xA;16:03:18.006399 tramp-get-connection-property (7) # process-name nil&#xA;16:03:18.006467 tramp-get-connection-property (7) # process-name nil&#xA;16:03:18.006540 tramp-get-connection-property (7) # process-buffer nil&#xA;16:03:18.006648 tramp-file-name-handler (5) # Non-essential received in operation (file-exists-p /ssh:test-server:)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="6697" LastEditDate="2016-10-25T08:06:43.753" LastActivityDate="2024-02-12T14:07:41.027" Title="edit a file on remote server using an existing session(by clone it)" Tags="|tramp|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28063" PostTypeId="1" CreationDate="2016-10-24T05:19:55.293" Score="2" ViewCount="95" Body="&lt;p&gt;I have my proper function to run latex, say &lt;code&gt;my-tex&lt;/code&gt;.&#xA;Sometimes one should run latex two times to get references right. A message like below in the echo area appears to tell this. How to identify programmatically the presence of this message in order that I run &lt;code&gt;my-tex&lt;/code&gt; two times?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You should run LaTeX again to get references right, {14} pages&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2016-10-25T21:43:08.353" Title="Taking action depending on the presence of particular message in the echo area" Tags="|latex|auctex|error-handling|echo-area|message|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28064" PostTypeId="1" AcceptedAnswerId="28065" CreationDate="2016-10-24T05:51:07.577" Score="2" ViewCount="1883" Body="&lt;p&gt;Source Insight can show function names in a larger font. Can Emacs display function names with a larger font and different color?&lt;/p&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="256" LastEditDate="2016-10-27T21:45:00.417" LastActivityDate="2016-10-27T21:45:00.417" Title="Enlarge font size of function names in source code like Source Insight" Tags="|fonts|c++|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28065" PostTypeId="2" ParentId="28064" CreationDate="2016-10-24T06:07:03.077" Score="7" Body="&lt;p&gt;This can be done pretty easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;press &lt;code&gt;M-x&lt;/code&gt; RET &lt;code&gt;customize-face&lt;/code&gt; RET &lt;code&gt;font-lock-function-name-face&lt;/code&gt; RET and you'll get the customization menu for function name face. You can change any attribute you want(font weight, height, color, etc.) and &lt;strong&gt;don't&lt;/strong&gt; forget to click on &lt;code&gt;Apply and Save&lt;/code&gt; and save for future sessions.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-24T06:07:03.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28066" PostTypeId="2" ParentId="28059" CreationDate="2016-10-24T07:25:34.293" Score="9" Body="&lt;p&gt;You may want to check &lt;code&gt;list-processes&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;list-processes&lt;/code&gt; is an interactive compiled Lisp function in&#xA;  ‘&lt;code&gt;simple.el&lt;/code&gt;’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(list-processes &amp;amp;optional QUERY-ONLY BUFFER)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Display a list of all processes that are Emacs sub-processes.&#xA;  If optional argument &lt;code&gt;QUERY-ONLY&lt;/code&gt; is non-nil, only processes with&#xA;  the &lt;code&gt;query-on-exit&lt;/code&gt; flag set are listed.&lt;br&gt;&#xA;  Any process listed as exited or signaled is actually eliminated&#xA;  after the listing is made.&lt;br&gt;&#xA;  Optional argument &lt;code&gt;BUFFER&lt;/code&gt; specifies a buffer to use, instead of&#xA;  &quot;&lt;code&gt;*Process List*&lt;/code&gt;&quot;.&#xA;  The return value is always &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This function lists only processes that were launched by Emacs.  To&#xA;  see other processes running on the system, use ‘&lt;code&gt;list-system-processes&lt;/code&gt;’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It seems to miss a lot of features you need, but with a bit coding you may get the desired results (if you do so, please send your patches upstream, I’d occasionally like to see this feature in Emacs.) That said, I couldn’t find any better ready-made candidates to your problem.&lt;/p&gt;&#xA;" OwnerUserId="507" LastActivityDate="2016-10-24T07:25:34.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28067" PostTypeId="1" CreationDate="2016-10-24T08:45:17.357" Score="2" ViewCount="264" Body="&lt;p&gt;Can we configure gnus to use an external mail retrieval (like thunderbird) to read and send emails?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean is let the external application do the job of connecting to the mail server and use gnus to read and type emails.&lt;/p&gt;&#xA;" OwnerUserId="12607" LastActivityDate="2016-10-24T08:45:17.357" Title="configure gnus to read and send emails with thunderbird" Tags="|gnus|email|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28068" PostTypeId="1" AcceptedAnswerId="28069" CreationDate="2016-10-24T09:02:36.897" Score="1" ViewCount="133" Body="&lt;p&gt;When starting an older Emacs (23.4, say) for testing, I get an error from package initialisation a certain package is not available for installation. &lt;code&gt;list-packages&lt;/code&gt; also shows a failure but with no details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with &lt;code&gt;--debug-init&lt;/code&gt; shows that the error is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(error &quot;Archive location https://melpa.org/packages/ is not an absolute file name&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What causes this?&lt;/p&gt;&#xA;" OwnerUserId="3985" LastActivityDate="2018-04-14T02:17:17.120" Title="Why does a package archive produce error &quot;not an absolute file name&quot;?" Tags="|init-file|package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28069" PostTypeId="2" ParentId="28068" CreationDate="2016-10-24T09:22:46.360" Score="1" Body="&lt;p&gt;This misleading error is due to &lt;code&gt;string-match&lt;/code&gt;ing the URL against &quot;http:&quot; - essentially HTTPS is not supported by &lt;code&gt;package-legacy.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Arguably this is also a bug in &lt;code&gt;cask.el&lt;/code&gt; (which only uses HTTPS) but I'm not sure if they already dropped support for Emacs 23.&lt;/p&gt;&#xA;" OwnerUserId="3985" LastActivityDate="2016-10-24T09:22:46.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28070" PostTypeId="1" CreationDate="2016-10-24T10:56:40.660" Score="0" ViewCount="197" Body="&lt;p&gt;I am trying to modify org-wikinodes.el to match any org-mode headline (not just camelCase text. So I have replaced the default regular expression with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*\\s-\\(.+\\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works. But in order to link back to say &lt;code&gt;My headline&lt;/code&gt; I have to write my link as &lt;code&gt;* My headline&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, how can I get org-mode to only match group 1 of the regex, so that I can link back to &lt;code&gt;My headline&lt;/code&gt; without including the &lt;code&gt;*&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-10-24T13:34:06.843" LastActivityDate="2016-10-24T13:34:06.843" Title="Match regexp group" Tags="|org-mode|regular-expressions|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28072" PostTypeId="1" CreationDate="2016-10-24T14:02:54.747" Score="3" ViewCount="501" Body="&lt;p&gt;Is it possible to hide TODO timestamps in Org mode?  More specifically, I want to keep the timestamps associated with TODO states (CLOSED, SCHEDULED, DEADLINE) from being shown in the Org buffer, even if they exist in the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why?  I'm working on the same file in both Emacs and Orgzly (Org app for Android).  I don't use timestamps in Emacs, but Orgzly puts them in by default and has no option not to do so, although it does allow you to hide them in its UI.&lt;/p&gt;&#xA;" OwnerUserId="13761" LastActivityDate="2016-10-24T14:02:54.747" Title="Is it possible to hide TODO timestamps in Org mode?" Tags="|org-mode|todo|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28074" PostTypeId="2" ParentId="27895" CreationDate="2016-10-24T15:31:41.147" Score="1" Body="&lt;p&gt;Okay, since I added the following line immediately after the block of code given above, I haven't had any problems:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq c-guess-current-offset nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whether this was an actual solution or not is not perfectly clear, but for anyone else you might run into this, it's worth a try.&lt;/p&gt;&#xA;" OwnerUserId="11660" LastActivityDate="2016-10-24T15:31:41.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28075" PostTypeId="1" CreationDate="2016-10-24T16:02:33.763" Score="0" ViewCount="425" Body="&lt;p&gt;I want to test a new configuration from emacs for that case I begin with this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs -q --load &quot;.emacs.jesus.d/init.el&quot; --debug-init&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it works and I load the emacs file, until I started to download packages from MElPA, in that case I allways get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Scan error: &quot;Unbalanced parentheses&quot;, 7659, 14295&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My emacs configuration file until loading things is like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Allow to run n instances of emacs server&#xA;(setq server-use-tcp t)&#xA;;; emacs --daemon=work&#xA;;; emacsclient --server-file=work -c -n&#xA;&#xA;;; Allow  n configuration directories&#xA;;; emacs -q --load &quot;/path/to/init.el&quot;&#xA;(setq user-init-file (or load-file-name (buffer-file-name)))&#xA;(setq user-emacs-directory (file-name-directory user-init-file))&#xA;(setq package-user-dir (concat user-emacs-directory &quot;packages&quot;))&#xA;;; Using MELPA for packages&#xA;(when (&amp;gt;= emacs-major-version 24)&#xA;  (require 'package)&#xA;  (when (&amp;gt;= emacs-major-version 24)&#xA;    (setq package-archives '((&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)))))&#xA;&#xA;;; Load necessary packages&#xA;&#xA;(package-initialize)&#xA;(setq my-required-packages&#xA;      (list&#xA;            ;; Emacs General packages https://melpa.org/#/&#xA;            'ivy&#xA;            'expand-region ;; Increase selected region by semantic units&#xA;            'wrap-region ;;  Emacs minor mode to wrap region with tag or punctuations &#xA;            'exec-path-from-shell ;;  Make Emacs use the $PATH set up by the user's shell &#xA;            'visual-regexp ;;  A regexp/replace command for Emacs with interactive visual feedback &#xA;            'buffer-move ;; used for rotating buffers&#xA;            'visual-regexp-steroids ;;  Extends visual-regexp to support other regexp engines &#xA;            'ido-vertical-mode ;;  makes ido-mode display vertically &#xA;            'yafolding ;;  Yet another folding extension for Emacs &#xA;            's ;;  The long lost Emacs string manipulation library.            &#xA;            'sourcemap ;;   Sourmap parser in Emacs Lisp &#xA;            'projectile ;; Project Interaction Library for Emacs http://projectile.readthedocs.io&#xA;            'f ;;  Modern API for working with files and directories in Emacs &#xA;            'jump ;; build functions which contextually jump between files&#xA;            'discover ;; discover more of Emacs&#xA;            'dired-details ;; hide or show the file and directory detail&#xA;            'ibuffer-vc ;;  Let Emacs' ibuffer-mode group files by git project etc., and show file state &#xA;            'auto-compile ;;  Automatically compile Emacs Lisp libraries &#xA;            'yaml-mode ;;  The emacs major mode for editing files in the YAML data serialization format. &#xA;            'undo-tree ;; Treat undo history as a tree&#xA;            'smartscan ;; Quickly jumps between other symbols found at point in Emacs&#xA;            'discover-my-major ;;  Discover key bindings and their meaning for the current Emacs major mode &#xA;            'goto-chg ;; Goto last change in current buffer&#xA;            'anzu ;; displays current match and total matches information&#xA;            'fullframe ;;  Advice commands to execute fullscreen, restoring the window setup when exiting. &#xA;            'dash ;;  A modern list library for Emacs &#xA;            'popup ;;  Visual Popup Interface Library for Emacs &#xA;            'company ;; Complete anything ;-)&#xA;            'cl-lib ;; Properly prefixed CL functions and macros&#xA;            'eldoc ;; the argument list of the function call you are currently writing&#xA;            'evil ;; Evil is an extensible vi layer for Emacs&#xA;            'sh-script ;; The major mode for editing Unix and GNU/Linux shell script code&#xA;            'neotree ;;  A emacs tree plugin like NerdTree for Vim. &#xA;            'sx ;; Stackoverflow mode ;-)&#xA;        'duplicate-thing ;; duplicate current line&#xA;            'clean-aindent-mode ;; Emacs extension for simple indent and unindent&#xA;            'comment-dwim-2 ;;  A replacement for the emacs' built-in command comment-dwim &#xA;            'dtrt-indent ;; A minor mode that guesses the indentation offset originally used for creating source code&#xA;            'ws-butler ;;  Unobtrusively trim extraneous white-space *ONLY* in lines edited. &#xA;            'iedit ;; Emacs minor mode and allows you to edit one occurrence of some text in a buffer&#xA;            'smartparens ;; Minor mode for Emacs that deals with parens pairs and tries to be smart about it.&#xA;            'volatile-highlights ;; Minor mode for visual feedback on some operations.&#xA;            'zygospore ;; reversible C-x 1 for Emacs&#xA;        'fliplr&#xA;        ;; Programming &#xA;            'anaconda-mode ;; Python IDE&#xA;            'company-anaconda ;; Python ide -completions&#xA;        'docker&#xA;        ;; GIT&#xA;        'magit ;; git on emacs&#xA;            'magit-gerrit ;; gerrit mode for emacs&#xA;        'git-timemachine ;; Walk through git revisions of a file&#xA;        ;; keep latest org-mode&#xA;            'org ;; Go and use &#xA;        ;; Themes https://emacsthemes.com/&#xA;            'green-phosphor-theme&#xA;            'gotham-theme&#xA;        'solarized-theme))&#xA;&#xA;(dolist (package my-required-packages)&#xA;  (when (not (package-installed-p package))&#xA;    (package-refresh-contents)&#xA;    (package-install package)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I start the emacs lisp interpreter I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; user-emacs-directory&#xA;&quot;/home/anquegi/.emacs.jesus.d/&quot;&#xA;ELISP&amp;gt; package-user-dir&#xA;&quot;/home/anquegi/.emacs.jesus.d/packages&quot;&#xA;ELISP&amp;gt; my-required-packages&#xA;(ivy expand-region wrap-region exec-path-from-shell visual-regexp buffer-move visual-regexp-steroids ido-vertical-mode yafolding s sourcemap projectile f jump discover dired-details ibuffer-vc auto-compile yaml-mode undo-tree smartscan discover-my-major goto-chg anzu fullframe dash popup company cl-lib eldoc evil sh-script neotree sx duplicate-thing clean-aindent-mode comment-dwim-2 dtrt-indent ws-butler iedit smartparens volatile-highlights zygospore fliplr anaconda-mode company-anaconda docker magit magit-gerrit git-timemachine org green-phosphor-theme gotham-theme solarized-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then when I try to execute the dolist term with C-x C-e I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (scan-error &quot;Unbalanced parentheses&quot; 7659 14295)&#xA;  scan-sexps(45 14294)&#xA;  forward-sexp(14294)&#xA;  custom-save-delete(custom-set-variables)&#xA;  custom-save-variables()&#xA;  custom-save-all()&#xA;  customize-save-variable(package-selected-packages nil)&#xA;  package--save-selected-packages(nil)&#xA;  package--user-selected-p(ivy)&#xA;  package-install(ivy)&#xA;  (progn (package-refresh-contents) (package-install package))&#xA;  (if (not (package-installed-p package)) (progn (package-refresh-contents) (package-install package)))&#xA;  (while --dolist-tail-- (setq package (car --dolist-tail--)) (if (not (package-installed-p package)) (progn (package-refresh-contents) (package-install package))) (setq --dolist-tail-- (cdr --dolist-tail--)))&#xA;  (let ((--dolist-tail-- my-required-packages) package) (while --dolist-tail-- (setq package (car --dolist-tail--)) (if (not (package-installed-p package)) (progn (package-refresh-contents) (package-install package))) (setq --dolist-tail-- (cdr --dolist-tail--))))&#xA;  eval((let ((--dolist-tail-- my-required-packages) package) (while --dolist-tail-- (setq package (car --dolist-tail--)) (if (not (package-installed-p package)) (progn (package-refresh-contents) (package-install package))) (setq --dolist-tail-- (cdr --dolist-tail--)))) nil)&#xA;  elisp--eval-last-sexp(nil)&#xA;  eval-last-sexp(nil)&#xA;  funcall-interactively(eval-last-sexp nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;also I tried to intall the ivy package with package-install and give the same error, but if I started emacs without any option i.e. using the normal .emacs.d/init.el it works as expected&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if I do &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2016-10-26 10:55:28 ☆  toshiba in ~&#xA;○ → mv .emacs.d .emacs.old.d&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2016-10-26 10:55:53 ☆  toshiba in ~&#xA;○ → mv .emacs.jesus.d/ .emacs.d&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2016-10-26 10:56:28 ☆  toshiba in ~&#xA;○ → emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works well&lt;/p&gt;&#xA;" OwnerUserId="8892" LastEditorUserId="12895" LastEditDate="2016-11-04T01:34:07.040" LastActivityDate="2016-11-04T01:34:07.040" Title="Problems loading packages from repos in another emacs directory" Tags="|init-file|package|debugging|package-repositories|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28076" PostTypeId="1" CreationDate="2016-10-24T16:24:42.290" Score="1" ViewCount="686" Body="&lt;p&gt;I'm building a script to install a version of emacs (24.5 in this case) on a small server running on a raspberry pi. Since this will be in headless mode, I have no need for a GUI/X windows based installation and will run the configuration with the &lt;code&gt;--without-x&lt;/code&gt; flag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, how can I find all the dependencies needed by emacs24.5 (or in general) so that I can build a list for installation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further context: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using Raspbian OS, I do not know how to get &lt;code&gt;sudo apt-get build-dep emacs24&lt;/code&gt; to work as a command, so that is why I am asking for a list of these dependencies.&lt;/li&gt;&#xA;&lt;li&gt;the recommendation from this &lt;a href=&quot;https://stackoverflow.com/questions/4627158/how-to-list-all-dependencies-of-a-package-on-linux&quot;&gt;SX&lt;/a&gt; answer seems to be the closest to this, but &lt;code&gt;apt-cache depends emacs24-nox&lt;/code&gt; seems to give a shallow answer in terms of dependencies. Is this all I really would need to put?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11660" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-10-24T16:24:42.290" Title="Find All Dependencies Necessary for an Emacs Install Without X" Tags="|terminal-emacs|install|build|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28077" PostTypeId="2" ParentId="22266" CreationDate="2016-10-24T16:41:29.133" Score="-1" Body="&lt;p&gt;I had the same problem and solved it more easily this way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;backspace&amp;gt;&quot;)&#xA;          '(lambda () (interactive) (backward-delete-char-untabify 1 nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling &lt;code&gt;(backward-delete-char-untabify 1 nil)&lt;/code&gt; tells Emacs to backward-delete one char (that's the &lt;code&gt;1&lt;/code&gt; parameter) and that it refrains from copying to the ring (that's the &lt;code&gt;nil&lt;/code&gt; parameter). You need a lambda (i.e. anonymous) function because you're binding a function with parameters to a key.&lt;/p&gt;&#xA;" OwnerUserId="516" LastActivityDate="2016-10-24T16:41:29.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28078" PostTypeId="2" ParentId="27988" CreationDate="2016-10-24T17:06:33.260" Score="1" Body="&lt;p&gt;I've tried to modify &lt;code&gt;point-undo&lt;/code&gt;. It seems to work. However I included the first jump on the current line. That's intended behaviour.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar point-undo-ring-length 20)&#xA;&#xA;(defvar point-undo-ring (make-ring point-undo-ring-length))&#xA;(make-variable-buffer-local 'point-undo-ring)&#xA;&#xA;(defvar point-redo-ring (make-ring point-undo-ring-length))&#xA;(make-variable-buffer-local 'point-redo-ring)&#xA;&#xA;(defun point-undo-pre-command-hook ()&#xA;  &quot;Save positions before command.&quot;&#xA;  (unless (or (eq this-command 'point-undo)&#xA;              (eq this-command 'point-redo))&#xA;    (let ((line (line-number-at-pos)))&#xA;      (when (eq line (cdr (nth 0 (ring-elements point-undo-ring))))&#xA;        (ring-remove point-undo-ring 0))&#xA;      (ring-insert point-undo-ring (cons (point) line))&#xA;      (setq point-redo-ring (make-ring point-undo-ring-length)))))&#xA;(add-hook 'pre-command-hook 'point-undo-pre-command-hook)&#xA;&#xA;(defun point-undo-doit (ring1 ring2)&#xA;  &quot;ring1, ring2 = {point-undo-ring, point-redo-ring}&quot;&#xA;  (condition-case nil&#xA;      (progn&#xA;        (goto-char (car (nth 0 (ring-elements ring1)))) &#xA;        (ring-insert ring2 (ring-remove ring1 0)))&#xA;    (error nil)))&#xA;&#xA;(defun point-undo ()&#xA;  &quot;Undo position.&quot;&#xA;  (interactive)&#xA;  (point-undo-doit point-undo-ring point-redo-ring))&#xA;&#xA;(defun point-redo ()&#xA;  &quot;Redo position.&quot;&#xA;  (interactive)&#xA;  (when (or (eq last-command 'point-undo)&#xA;            (eq last-command 'point-redo))&#xA;    (point-undo-doit point-redo-ring point-undo-ring)))&#xA;&#xA;(define-key global-map [f9] 'point-undo)&#xA;(define-key global-map [f10] 'point-redo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-25T14:14:07.137" LastActivityDate="2016-10-25T14:14:07.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28080" PostTypeId="1" CreationDate="2016-10-24T17:28:05.427" Score="1" ViewCount="268" Body="&lt;p&gt;Consider for the sake of an example the following code block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC scheme :exports both&#xA;  (atan 0.0 -1.0)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export this file, Org inserts the result (which is the number Pi) into the output.  So far, so good.  I would like to format this result (e.g. typeset it in italics).  How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="13763" LastActivityDate="2016-10-24T17:28:05.427" Title="How can I format the results of a code block in Org-mode?" Tags="|org-mode|org-export|org-babel|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28082" PostTypeId="2" ParentId="28059" CreationDate="2016-10-24T18:02:38.090" Score="8" Body="&lt;p&gt;Check out helm-top. It lists all the things you want, and has actions to send signals to the processes.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-10-24T18:02:38.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28083" PostTypeId="2" ParentId="28053" CreationDate="2016-10-24T18:35:53.103" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://www.haskell.org/hoogle/&quot; rel=&quot;nofollow&quot;&gt;Hoogle&lt;/a&gt; is what I serching for. At this moment there is (at least) two ways to integrate it nicely with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Directly through &lt;code&gt;haskell-mode&lt;/code&gt;. Fuction which should be called with cursor on desired symbol is &lt;code&gt;haskell-hoogle-lookup-from-local&lt;/code&gt;. It will ask you to run &lt;code&gt;hoogle&lt;/code&gt; local server for the first time.&lt;br&gt;&#xA;You also have to install &lt;code&gt;hoogle&lt;/code&gt; in your &lt;code&gt;stack&lt;/code&gt; sandbox via:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;stack install hoogle&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and you have to generate &lt;code&gt;hoogle&lt;/code&gt; local documentation with:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;hoogle generate&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;a href=&quot;https://github.com/areina/helm-dash&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;helm-dash&lt;/code&gt;&lt;/a&gt; which supports many other languages and envirnoments. Function which should be called when the cursor is on desired symbol is called &lt;code&gt;helm-dash-at-point&lt;/code&gt;. You should also install Haskell docset with &lt;code&gt;M-x helm-dash-install-docset RET Haskell RET&lt;/code&gt; and activate Haskell docset with &lt;code&gt;M-x helm-dash-activate-docset RET Haskell RET&lt;/code&gt; (there is also a way to activate corresponding docset acording to active mode/language described &lt;a href=&quot;https://github.com/areina/helm-dash#buffer-local-docsets&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-10-24T18:35:53.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28086" PostTypeId="1" AcceptedAnswerId="28099" CreationDate="2016-10-24T19:57:29.323" Score="0" ViewCount="134" Body="&lt;p&gt;I recently got a new Chromebook and installed Ubuntu via crouton.  I then installed Emacs 23 and transferred my .emacs file to the new machine.  However, a few of my key rebindings have been overridden by definitions in the LaTeX major mode of the new installation.  This did not happen on my previous computer (emacs 24.something).  The three changes I would like to make are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;When I press &lt;code&gt;[&lt;/code&gt;, I want &lt;code&gt;}&lt;/code&gt; to display.&lt;/li&gt;&#xA;&lt;li&gt;When I press &lt;code&gt;(&lt;/code&gt;, I want &lt;code&gt;{&lt;/code&gt; to display.&lt;/li&gt;&#xA;&lt;li&gt;When I press &lt;code&gt;$&lt;/code&gt;, I want &lt;code&gt;^&lt;/code&gt; to display.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have the following lines in my .emacs file (along with other similar lines that work as intended):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;[&quot;) '(lambda () (interactive) (princ &quot;{&quot; (get-buffer (current-buffer)))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;(&quot;) '(lambda () (interactive) (princ &quot;[&quot; (get-buffer (current-buffer)))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;$&quot;) '(lambda () (interactive) (princ &quot;^&quot; (get-buffer (current-buffer)))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only use Emacs for LaTeX, so I am not concerned with the fact that I am defining everything globally.  Currently, if I use &lt;code&gt;C-h k [&lt;/code&gt;, I see that &lt;code&gt;[&lt;/code&gt; calls &lt;code&gt;skeleton-pair-insert-maybe&lt;/code&gt; instead of &lt;code&gt;self-insert-command&lt;/code&gt;, as expected (and similarly for the other two).  All of my attempts to search on how to disable this returned only results talking about the usage of skeleton pairs and why one would want to use them, nothing about getting rid of them.  Similarly, I have been unable to find a way to edit the LaTeX major mode to remove the lines that bind this function in the first place.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any method which allows me to redefine these keys over the LaTeX major mode, or to change the LaTeX major mode, would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13766" LastActivityDate="2016-10-25T03:31:27.907" Title="How to disable skeleton-pair-insert-maybe?" Tags="|major-mode|skeleton|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28087" PostTypeId="1" AcceptedAnswerId="28097" CreationDate="2016-10-24T20:56:53.300" Score="10" ViewCount="1399" Body="&lt;p&gt;Currently I have jsx in my js files but when using web-mode it is only possible to have single quotes or double quotes for html attributes with this setting the &lt;code&gt;web-mode-auto-quote-style&lt;/code&gt; setting, e.g:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-auto-quote-style 2) ; use single quotes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to disable it all together but how is this possible when it only takes 1 or 2 as a value.&lt;/p&gt;&#xA;" OwnerUserId="13577" LastActivityDate="2016-10-25T02:53:10.073" Title="turn off auto-quotes in web-mode" Tags="|web-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28088" PostTypeId="2" ParentId="28059" CreationDate="2016-10-24T20:59:05.250" Score="7" Body="&lt;p&gt;I like htop and so I also use it in emacs. However the interactive part doesn't work this way.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun htop ()&#xA;  (interactive)&#xA;  (if (get-buffer &quot;*htop*&quot;)&#xA;      (switch-to-buffer &quot;*htop*&quot;)&#xA;    (ansi-term &quot;/bin/bash&quot; &quot;htop&quot;)   &#xA;    (comint-send-string &quot;*htop*&quot; &quot;htop\n&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-25T06:43:03.660" LastActivityDate="2016-10-25T06:43:03.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28089" PostTypeId="1" AcceptedAnswerId="28090" CreationDate="2016-10-24T21:19:38.880" Score="4" ViewCount="385" Body="&lt;p&gt;When I trigger helm-swoop, it autofills the search with the word at point. For my most common use case, this isn't what I want. How do I disable it, so there's nothing in the search.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-02-02T22:22:50.053" Title="How do I make helm swoop not default the search to the word at point?" Tags="|helm|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28090" PostTypeId="2" ParentId="28089" CreationDate="2016-10-24T21:19:38.880" Score="4" Body="&lt;p&gt;When helm swoop starts up, it looks at the variable &lt;code&gt;helm-swoop-pre-input-function&lt;/code&gt;. That variable stores a function that returns a string, and helm swoop uses that string as the default value. So, to not have anything in the search, make that value return an empty string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-swoop-pre-input-function (lambda () &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Its default value is to call &lt;code&gt;(thing-at-point 'symbol)&lt;/code&gt;. There are more examples &lt;a href=&quot;https://github.com/ShingoFukuyama/helm-swoop#configure-pre-input-search-query&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. For example, to always use the previous search:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-swoop-pre-input-function&#xA;      (lambda () (if (boundp 'helm-swoop-pattern)&#xA;                     helm-swoop-pattern&#xA;                     &quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2017-02-02T22:22:50.053" LastActivityDate="2017-02-02T22:22:50.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28092" PostTypeId="1" AcceptedAnswerId="28200" CreationDate="2016-10-24T22:50:25.803" Score="3" ViewCount="486" Body="&lt;p&gt;I have several tasks in an org file, some of which which have an &lt;code&gt;Effort&lt;/code&gt; property and some of which which don't.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Example Task 1, with effort&#xA;   :PROPERTIES:&#xA;   :Effort: 1:30&#xA;   :END:&#xA;** Example Task 2, without effort&#xA;   :PROPERTIES:&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run a match query in the agenda (&lt;code&gt;C-c a m&lt;/code&gt;) and want to check by effort, &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/advanced-searching.html&quot; rel=&quot;nofollow&quot;&gt;this tutorial&lt;/a&gt; suggests the following. Suppose I want to match all todo tasks whose efforts are estimated to be less than 2 hours. I would do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Match: +Effort&amp;lt;2/TODO&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this also displays todo items which do &lt;em&gt;not&lt;/em&gt; have an Effort property. (Example Task 2 would be shown along with Example Task 1.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make it so that having no Effort property results in not appearing in an Effort query?&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-10-31T08:11:55.333" Title="Matching tasks in org-agenda by effort" Tags="|org-mode|org-agenda|org-clock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28093" PostTypeId="2" ParentId="22266" CreationDate="2016-10-24T23:05:44.160" Score="5" Body="&lt;p&gt;Since Emacs 24, without any configuration, you can delete any text without adding it to the kill ring by selecting it and then pressing &lt;kbd&gt;Backspace&lt;/kbd&gt; or &lt;kbd&gt;Delete&lt;/kbd&gt;. When the mark is active, these keys delete the region instead of just deleting the character before/after the cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, move to one end of the text you want to delete, press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Space&lt;/kbd&gt;, move to the other end, and press &lt;kbd&gt;Backspace&lt;/kbd&gt; (or &lt;kbd&gt;Delete&lt;/kbd&gt;) do delete the highlighted region. Or move to one end, hold &lt;kbd&gt;Shift&lt;/kbd&gt; while you use movement keys to go to the other end, and press &lt;kbd&gt;Backspace&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-10-24T23:05:44.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28094" PostTypeId="1" CreationDate="2016-10-25T01:12:02.497" Score="1" ViewCount="593" Body="&lt;p&gt;When I manually login into remote server, it first needs to input password, and then input some youbikey like the following prompt.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Password:    (after I input password correctly, then it will show the next line.)&#xA;Tap your Key:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in tramp, after I input password correctly, it hangs there without any further info. How to make it work in tramp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am already using version 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the following doesn't work for me.&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/17573/tramp-login-with-2-factor-authentication&quot;&gt;Tramp login with 2-factor authentication&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-02-23T05:32:22.513" Title="emacs tramp: how to input a password and additional verification?" Tags="|tramp|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28095" PostTypeId="2" ParentId="28059" CreationDate="2016-10-25T01:53:19.437" Score="13" Body="&lt;p&gt;In addition to the other answers, the original poster may wish to consider using the built-in &lt;em&gt;profiling&lt;/em&gt; feature:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Profiling.html&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Profiling.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To begin profiling, type &lt;code&gt;M-x profiler-start&lt;/code&gt;. You can choose to profile by processor usage, memory usage, or both. After doing some work, type &lt;code&gt;M-x profiler-report&lt;/code&gt; to display a summary buffer for each resource that you chose to profile.  The names of the report buffers include the times at which the reports were generated, so you can generate another report later on without erasing previous results. When you have finished profiling, type &lt;code&gt;M-x profiler-stop&lt;/code&gt; (there is a small overhead associated with profiling).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the link above to the manual for additional details regarding this feature.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-10-25T01:53:19.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28096" PostTypeId="1" CreationDate="2016-10-25T02:22:28.613" Score="0" ViewCount="325" Body="&lt;p&gt;My checkbox list appears as shown below&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/lYJr9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lYJr9.png&quot; alt=&quot;checkbox list right now&quot;&gt;&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have it like this.&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/iWMEA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iWMEA.png&quot; alt=&quot;checkbox list as desired&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see the number of digits for the numbered list is two, starting at 01.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not see an opportunity where we might need 001, so 01 should be good.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-10-25T21:01:02.413" Title="How to change the checkbox list appearance in Org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28097" PostTypeId="2" ParentId="28087" CreationDate="2016-10-25T02:53:10.073" Score="14" Body="&lt;pre&gt;&lt;code&gt;(setq web-mode-enable-auto-quoting nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Add double quotes after the character = in a tag.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-10-25T02:53:10.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28098" PostTypeId="1" AcceptedAnswerId="38898" CreationDate="2016-10-25T03:16:37.380" Score="11" ViewCount="4888" Body="&lt;p&gt;By default, Org-mode will override current babel src block content on file&#xA;original content (when the file already has content).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have an org-mode file content as the bellowing block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC org&#xA;,* config file&#xA;&#xA;,** config 1&#xA;&#xA;,#+BEGIN_SRC clojure :tangle &quot;data/code/tangle-append-test.clj&quot;&#xA;(println &quot;hello&quot;)&#xA;,#+END_SRC&#xA;&#xA;,** config 2&#xA;&#xA;,#+BEGIN_SRC clojure :tangle &quot;data/code/tangle-append-test.clj&quot;&#xA;(println &quot;world&quot;)&#xA;,#+END_SRC&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you tangle the whole buffer file, then the result will looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tangled file result content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: data/code/tangle-append-test.clj&#xA;#+BEGIN_SRC clojure&#xA;(println &quot;hello&quot;)&#xA;&#xA;(println &quot;world&quot;)&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is fine. But here is my problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But&lt;/strong&gt; if you &lt;strong&gt;tangle only current src block&lt;/strong&gt; with &lt;code&gt;[C-u C-c C-v t]&lt;/code&gt;. Then&#xA;the current tangled src block will overwrite the whole destination file, like&#xA;this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; $ cat data/code/tangle-append-test.clj&#xA;&#xA;(println &quot;world&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATED&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: The single babel block override original file content, I hope to&#xA;only &lt;strong&gt;append&lt;/strong&gt; current tangled block without overwriting.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2016-10-25T09:45:08.717" LastActivityDate="2020-12-14T07:28:05.573" Title="How to change Org-mode babel tangle write to file way as append instead of override by default?" Tags="|org-mode|org-babel|tangle|" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28099" PostTypeId="2" ParentId="28086" CreationDate="2016-10-25T03:31:27.907" Score="1" Body="&lt;p&gt;If you are trying to move keys around, but only in emacs, then it is probably easier to use a translation keymap.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map &quot;[&quot; &quot;{&quot;)&#xA;(define-key key-translation-map &quot;(&quot; &quot;[&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as the binding to &lt;code&gt;skeleton-pair-insert-maybe&lt;/code&gt;, I don't see this being setup to any key. You can use the code &lt;a href=&quot;https://emacs.stackexchange.com/questions/653/how-can-i-find-out-in-which-keymap-a-key-is-bound&quot;&gt;How can I find out in which keymap a key is bound?&lt;/a&gt; to find the keymap,and then use &lt;code&gt;(define-key keymap &quot;[&quot; nil)&lt;/code&gt; to unbind it from that keymap. When you want to unbind it depends on where it is being bound!&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-10-25T03:31:27.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28100" PostTypeId="1" AcceptedAnswerId="28101" CreationDate="2016-10-25T03:32:40.923" Score="1" ViewCount="206" Body="&lt;p&gt;How can I make &lt;code&gt;message-insert-signature&lt;/code&gt; not inserting the &lt;code&gt;--&lt;/code&gt; prefix? If not possible, is there a another function that inserts signature without the &lt;code&gt;--&lt;/code&gt; prefix?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-10-25T04:57:46.270" Title="`message-insert-signature` : Do not add the &quot;--&quot; prefix?" Tags="|email|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28101" PostTypeId="2" ParentId="28100" CreationDate="2016-10-25T04:57:46.270" Score="0" Body="&lt;p&gt;A signature like this can be inserted using the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        (save-excursion&#xA;          (if (not (eq message-cite-reply-position 'above))&#xA;              (message-goto-signature)&#xA;            (message-goto-body)&#xA;            (insert &quot;\n\n&quot;)&#xA;            (message-goto-body))&#xA;          (insert &quot;\n\n&quot;)&#xA;          (insert &quot;MY SIGNATURE&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-10-25T04:57:46.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28102" PostTypeId="1" CreationDate="2016-10-25T06:04:44.190" Score="0" ViewCount="65" Body="&lt;p&gt;I have paredit configured to work on javascript files.  I also have web-mode enabled&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to cause a bug in certain situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a stack trace I got by trying to clear all the text in an attribute quote:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get this error&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wrong type argument: number-or-marker-p, nil&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And here is the stack trace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)&#xA;  logand(nil 4)&#xA;  (eq (logand (get-text-property pos (quote tag-attr-beg)) 4) 4)&#xA;  (and depth end (setq beg (web-mode-attribute-beginning-position end)) (eq (logand (get-text-property pos (quote tag-attr-beg)) 4) 4))&#xA;  (if (and depth end (setq beg (web-mode-attribute-beginning-position end)) (eq (logand (get-text-property pos (quote tag-attr-beg)) 4) 4)) (progn (setq depth (1- (get-text-property beg (quote jsx-depth))))))&#xA;  (cond ((null pos) (setq end nil)) ((get-text-property pos (quote tag-attr-end)) (setq end pos)) ((get-text-property pos (quote tag-attr)) (setq end (next-single-property-change pos (quote tag-attr-end))) (if (and depth end (setq beg (web-mode-attribute-beginning-position end)) (eq (logand (get-text-property pos (quote tag-attr-beg)) 4) 4)) (progn (setq depth (1- (get-text-property beg (quote jsx-depth)))))) (cond ((not (get-text-property end (quote tag-attr-end))) (setq end nil)) ((and depth (eq depth (get-text-property end (quote jsx-depth))) (not (eq depth (get-text-property end ...))))) ((and depth (eq (1+ depth) (get-text-property end (quote jsx-depth))))) ((and depth (not (eq (1+ depth) (get-text-property end ...)))) (let ((continue (&amp;lt; end ...))) (while continue (setq end (1+ end)) (setq end (next-single-property-change end ...)) (cond (... ...) (... ...) (... ...))))))) (t (setq end nil)))&#xA;  (let (beg end depth) (setq depth (get-text-property pos (quote jsx-depth))) (cond ((null pos) (setq end nil)) ((get-text-property pos (quote tag-attr-end)) (setq end pos)) ((get-text-property pos (quote tag-attr)) (setq end (next-single-property-change pos (quote tag-attr-end))) (if (and depth end (setq beg (web-mode-attribute-beginning-position end)) (eq (logand (get-text-property pos ...) 4) 4)) (progn (setq depth (1- (get-text-property beg ...))))) (cond ((not (get-text-property end (quote tag-attr-end))) (setq end nil)) ((and depth (eq depth (get-text-property end ...)) (not (eq depth ...)))) ((and depth (eq (1+ depth) (get-text-property end ...)))) ((and depth (not (eq ... ...))) (let ((continue ...)) (while continue (setq end ...) (setq end ...) (cond ... ... ...)))))) (t (setq end nil))) end)&#xA;  web-mode-attribute-end-position(665)&#xA;  (web-mode-go (web-mode-attribute-end-position (point)) 1)&#xA;  web-mode-attribute-end()&#xA;  (cond ((eobp) nil) ((get-text-property pos (quote block-beg)) (web-mode-block-end)) ((get-text-property pos (quote block-token)) (web-mode-block-token-end)) ((get-text-property pos (quote part-token)) (web-mode-part-token-end)) ((get-text-property pos (quote tag-beg)) (web-mode-element-end)) ((get-text-property pos (quote tag-attr)) (web-mode-attribute-end)) ((get-text-property pos (quote tag-type)) (web-mode-tag-end)) ((get-text-property pos (quote jsx-beg)) (web-mode-jsx-end)) (t (let ((forward-sexp-function nil)) (forward-sexp))))&#xA;  (while (&amp;lt; _ --dotimes-limit--) (skip-chars-forward &quot;[:space:]&quot;) (setq pos (point)) (cond ((eobp) nil) ((get-text-property pos (quote block-beg)) (web-mode-block-end)) ((get-text-property pos (quote block-token)) (web-mode-block-token-end)) ((get-text-property pos (quote part-token)) (web-mode-part-token-end)) ((get-text-property pos (quote tag-beg)) (web-mode-element-end)) ((get-text-property pos (quote tag-attr)) (web-mode-attribute-end)) ((get-text-property pos (quote tag-type)) (web-mode-tag-end)) ((get-text-property pos (quote jsx-beg)) (web-mode-jsx-end)) (t (let ((forward-sexp-function nil)) (forward-sexp)))) (setq _ (1+ _)))&#xA;  (let ((--dotimes-limit-- n) (_ 0)) (while (&amp;lt; _ --dotimes-limit--) (skip-chars-forward &quot;[:space:]&quot;) (setq pos (point)) (cond ((eobp) nil) ((get-text-property pos (quote block-beg)) (web-mode-block-end)) ((get-text-property pos (quote block-token)) (web-mode-block-token-end)) ((get-text-property pos (quote part-token)) (web-mode-part-token-end)) ((get-text-property pos (quote tag-beg)) (web-mode-element-end)) ((get-text-property pos (quote tag-attr)) (web-mode-attribute-end)) ((get-text-property pos (quote tag-type)) (web-mode-tag-end)) ((get-text-property pos (quote jsx-beg)) (web-mode-jsx-end)) (t (let ((forward-sexp-function nil)) (forward-sexp)))) (setq _ (1+ _))))&#xA;  (let (pos) (let ((--dotimes-limit-- n) (_ 0)) (while (&amp;lt; _ --dotimes-limit--) (skip-chars-forward &quot;[:space:]&quot;) (setq pos (point)) (cond ((eobp) nil) ((get-text-property pos (quote block-beg)) (web-mode-block-end)) ((get-text-property pos (quote block-token)) (web-mode-block-token-end)) ((get-text-property pos (quote part-token)) (web-mode-part-token-end)) ((get-text-property pos (quote tag-beg)) (web-mode-element-end)) ((get-text-property pos (quote tag-attr)) (web-mode-attribute-end)) ((get-text-property pos (quote tag-type)) (web-mode-tag-end)) ((get-text-property pos (quote jsx-beg)) (web-mode-jsx-end)) (t (let ((forward-sexp-function nil)) (forward-sexp)))) (setq _ (1+ _)))))&#xA;  (if (&amp;lt; n 0) (web-mode-backward-sexp (- n)) (let (pos) (let ((--dotimes-limit-- n) (_ 0)) (while (&amp;lt; _ --dotimes-limit--) (skip-chars-forward &quot;[:space:]&quot;) (setq pos (point)) (cond ((eobp) nil) ((get-text-property pos (quote block-beg)) (web-mode-block-end)) ((get-text-property pos (quote block-token)) (web-mode-block-token-end)) ((get-text-property pos (quote part-token)) (web-mode-part-token-end)) ((get-text-property pos (quote tag-beg)) (web-mode-element-end)) ((get-text-property pos (quote tag-attr)) (web-mode-attribute-end)) ((get-text-property pos (quote tag-type)) (web-mode-tag-end)) ((get-text-property pos (quote jsx-beg)) (web-mode-jsx-end)) (t (let (...) (forward-sexp)))) (setq _ (1+ _))))))&#xA;  web-mode-forward-sexp(1)&#xA;  forward-sexp(1)&#xA;  paredit-string-start+end-points()&#xA;  paredit-kill-line-in-string()&#xA;  paredit-kill(nil)&#xA;  call-interactively(paredit-kill nil nil)&#xA;  command-execute(paredit-kill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13577" LastActivityDate="2016-10-25T06:04:44.190" Title="bug with web-mode and paredit" Tags="|web-mode|paredit|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28103" PostTypeId="1" CreationDate="2016-10-25T07:34:28.713" Score="0" ViewCount="109" Body="&lt;p&gt;Trying to &lt;code&gt;magit-bisect-start&lt;/code&gt; in Emacs source code with the bad commit being &lt;code&gt;emacs-24.5&lt;/code&gt; and good being &lt;code&gt;emacs-25.1&lt;/code&gt; does not seem to work. Nothing is shown in the Magit buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing the same with other repos works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an issue with Emacs sources having too many commits or something?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-10-25T14:40:29.567" Title="`magit-bisect` with Emacs sources" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28104" PostTypeId="1" AcceptedAnswerId="28106" CreationDate="2016-10-25T07:53:24.357" Score="5" ViewCount="877" Body="&lt;p&gt;I have which-function-mode enabled and from time to time it shows ???. Is it possible to customize this to eg '∅'. I have tried to customize group &quot;Which Func&quot; but did not find something suiteable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I do not completely understand when ??? is shown and what is means.&lt;/p&gt;&#xA;" OwnerUserId="970" LastEditorUserId="454" LastEditDate="2016-10-25T23:18:10.807" LastActivityDate="2017-09-01T01:40:59.987" Title="Customize ??? in which-func-mode" Tags="|customize|which-function-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28105" PostTypeId="1" AcceptedAnswerId="28120" CreationDate="2016-10-25T08:02:41.470" Score="5" ViewCount="1942" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/jwiegley/use-package/blob/master/bind-key.el&quot; rel=&quot;nofollow&quot;&gt;bind-key&lt;/a&gt; and I haven't found anything else that convenient for organizing key bindings. However sometimes I want to bind some commands for more keymaps than one. That's the way I do it now for both maps.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (bind-keys  :map some-map&#xA;               :prefix-map some-prefix-map&#xA;               :prefix &quot;PKEY&quot;&#xA;               (&quot;KEY1&quot; . command1)&#xA;               (&quot;KEY2&quot; . command2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want it to also work this way&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (bind-keys  :map map1 map2&#xA;               :prefix-map some-prefix-map&#xA;               :prefix &quot;PKEY&quot;&#xA;               (&quot;KEY1&quot; . command1)&#xA;               (&quot;KEY2&quot; . command2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EXAMPLE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (bind-keys :map org-mode-map emacs-lisp-mode-map&#xA;              :prefix-map f14-prefix-map&#xA;              :prefix &quot;&amp;lt;f14&amp;gt;&quot;&#xA;              (&quot;x&quot; . my-elisp-indent)&#xA;              (&quot;y&quot; . paredit-open-round)&#xA;              (&quot;z&quot; . paredit-kill))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-25T10:46:46.907" LastActivityDate="2020-08-08T14:37:13.940" Title="how to define bindings for multiple keymaps with bind-keys?" Tags="|key-bindings|keymap|bind-key.el|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28106" PostTypeId="2" ParentId="28104" CreationDate="2016-10-25T08:03:35.390" Score="9" Body="&lt;p&gt;??? is displayed if &lt;code&gt;which-func-mode&lt;/code&gt; (or &lt;code&gt;which-function-mode&lt;/code&gt; in Emacs 25) can't determine the name of the current function. To customize it, modify the variable &lt;code&gt;which-func-unknown&lt;/code&gt;, which is the &quot;String to display in the mode line when current function is unknown.&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq which-func-unknown &quot;∅&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Its default value is &quot;???&quot;.&lt;/p&gt;&#xA;" OwnerUserId="9257" LastEditorUserId="9257" LastEditDate="2016-10-25T11:02:12.303" LastActivityDate="2016-10-25T11:02:12.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28107" PostTypeId="2" ParentId="27989" CreationDate="2016-10-25T08:28:57.853" Score="1" Body="&lt;p&gt;To prevent EPG from prompting for a key every time you save a file, put the following at the top of your file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- epa-file-encrypt-to: (&quot;your@email.address&quot;) -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="357" LastActivityDate="2016-10-25T08:28:57.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28108" PostTypeId="2" ParentId="28098" CreationDate="2016-10-25T09:38:59.373" Score="3" Body="&lt;p&gt;What I do is I specify a single block per output file, and use noweb references to collect what goes into it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the blocks with the source you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: hello-world&#xA;#+begin_src clojure&#xA;(println &quot;hello&quot;)&#xA;#+end_src&#xA;&#xA;#+name: hello-world&#xA;#+begin_src clojure&#xA;(println &quot;world&quot;)&#xA;#+end_src&#xA;&#xA;#+name: goodbye&#xA;#+begin_src clojure&#xA;(println &quot;goodbye&quot;)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the block that collects it all and tangles it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src clojure :noweb yes :tangle data/code/tangle-append-test.clj&#xA;&amp;lt;&amp;lt;hello-world&amp;gt;&amp;gt;&#xA;&amp;lt;&amp;lt;goodbye&amp;gt;&amp;gt;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12451" LastActivityDate="2016-10-25T09:38:59.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28109" PostTypeId="1" CreationDate="2016-10-25T09:52:01.757" Score="3" ViewCount="799" Body="&lt;p&gt;When I try run &lt;code&gt;describe-variable&lt;/code&gt; on &lt;code&gt;package-archive-contents&lt;/code&gt; &lt;code&gt;C-h v package-archive-contents&lt;/code&gt; emacs hangs. It hangs at least 5 minutes, maybe forever (I did not wait any longer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems like &lt;code&gt;Esc : (print package-archive-contents)&lt;/code&gt; also almost hangs.. It outputs an enormous string to message buffer after a minute. When trying to copy the string to the clipboard emacs hangs again..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running Emacs version 25.1 on Ubuntu 16.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;C-h v package-archives&lt;/code&gt; gives current value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;) (&quot;marmalade&quot;&#xA; . &quot;http://marmalade-repo.org/packages/&quot;) (&quot;melpa&quot;&#xA; . &quot;http://melpa.milkbox.net/packages/&quot;) (&quot;org&quot;&#xA; . &quot;http://orgmode.org/elpa/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2018-01-28T20:40:44.677" Title="Emacs hangs after describe-variable on package-archive-contents" Tags="|package|help|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28110" PostTypeId="1" CreationDate="2016-10-25T10:35:30.980" Score="2" ViewCount="1950" Body="&lt;p&gt;Take the following sample code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;cmath&amp;gt;&#xA;&#xA;int main() {&#xA;    double a = -10;&#xA;    double b = std::abs(a);&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I place the cursor over &lt;code&gt;abs&lt;/code&gt;, for example between &lt;code&gt;b&lt;/code&gt; and &lt;code&gt;s&lt;/code&gt;, I want to have a command which would make Emacs jump to where &lt;code&gt;abs&lt;/code&gt; is defined in the &lt;code&gt;cmath&lt;/code&gt; header. It's a &lt;code&gt;ctags&lt;/code&gt; or &lt;code&gt;gtags&lt;/code&gt; kind of functionality, but which allows to jump to definitions in header files that are outside of the project root directory. How can I do that?&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2016-10-25T17:08:11.570" Title="Jump to definition of function or class in one of the include files?" Tags="|c++|ctags|ide|gtags|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28111" PostTypeId="2" ParentId="26329" CreationDate="2016-10-25T12:34:09.977" Score="3" Body="&lt;p&gt;Open a file in &lt;code&gt;shell-script-mode&lt;/code&gt;, run &lt;code&gt;M-x customize-variable&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;sh-indent-after-continuation&lt;/code&gt;, and see if you can set it to &lt;code&gt;always&lt;/code&gt;. (This seems to be a relatively new option, Emacs 25.1+)&lt;/p&gt;&#xA;" OwnerUserId="13771" LastEditorUserId="12247" LastEditDate="2016-10-25T14:44:06.093" LastActivityDate="2016-10-25T14:44:06.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28112" PostTypeId="2" ParentId="28104" CreationDate="2016-10-25T12:48:14.617" Score="2" Body="&lt;p&gt;??? means &lt;code&gt;which-function-mode&lt;/code&gt; can't find current function name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read code of &lt;code&gt;which-function-mode&lt;/code&gt; you will find that &lt;code&gt;imenu&lt;/code&gt; setup in your major mode hook provides function names used by other plugins like &lt;code&gt;which-function-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the &lt;strong&gt;real problem&lt;/strong&gt; is how to setup imenu in major mode hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simplified version of my setup for &lt;code&gt;js-mode&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq javascript-common-imenu-regex-list&#xA;      '((&quot;Controller&quot; &quot;[. \t]controller([ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Controller&quot; &quot;[. \t]controllerAs:[ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Filter&quot; &quot;[. \t]filter([ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;State&quot; &quot;[. \t]state[(:][ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Factory&quot; &quot;[. \t]factory([ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Service&quot; &quot;[. \t]service([ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Module&quot; &quot;[. \t]module( *['\&quot;]\\([a-zA-Z0-9_.]+\\)['\&quot;], *\\[&quot; 1)&#xA;        (&quot;ngRoute&quot; &quot;[. \t]when(\\(['\&quot;][a-zA-Z0-9_\/]+['\&quot;]\\)&quot; 1)&#xA;        (&quot;Directive&quot; &quot;[. \t]directive([ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Event&quot; &quot;[. \t]\$on([ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Config&quot; &quot;[. \t]config([ \t]*function *( *\\([^\)]+\\)&quot; 1)&#xA;        (&quot;Config&quot; &quot;[. \t]config([ \t]*\\[ *['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;OnChange&quot; &quot;[ \t]*\$(['\&quot;]\\([^'\&quot;]*\\)['\&quot;]).*\.change *( *function&quot; 1)&#xA;        (&quot;OnClick&quot; &quot;[ \t]*\$([ \t]*['\&quot;]\\([^'\&quot;]*\\)['\&quot;]).*\.click *( *function&quot; 1)&#xA;        (&quot;Watch&quot; &quot;[. \t]\$watch( *['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        (&quot;Function&quot; &quot;function[ \t]+\\([a-zA-Z0-9_$.]+\\)[ \t]*(&quot; 1)&#xA;        (&quot;Function&quot; &quot;^[ \t]*\\([a-zA-Z0-9_$.]+\\)[ \t]*=[ \t]*function[ \t]*(&quot; 1)&#xA;        ;; {{ es6 beginning&#xA;        (&quot;Function&quot; &quot;^[ \t]*\\([A-Za-z_$][A-Za-z0-9_$]+\\)[ \t]*([a-zA-Z0-9, ]*) *\{ *$&quot; 1) ;; es6 fn1 () { }&#xA;        (&quot;Function&quot; &quot;^[ \t]*\\([A-Za-z_$][A-Za-z0-9_$]+\\)[ \t]*=[ \t]*(?[a-zA-Z0-9, ]*)?[ \t]*=&amp;gt;[ \t]*\{ *$&quot; 1) ;; es6 fn1 = (e) =&amp;gt; (var, var2) {&#xA;        ;; }}&#xA;        (&quot;Task&quot; &quot;[. \t]task([ \t]*['\&quot;]\\([^'\&quot;]+\\)&quot; 1)&#xA;        ))&#xA;&#xA;;; js-mode imenu enhancement&#xA;;; @see http://stackoverflow.com/questions/20863386/idomenu-not-working-in-javascript-mode&#xA;(defun mo-js-imenu-make-index ()&#xA;  (save-excursion&#xA;    (imenu--generic-function javascript-common-imenu-regex-list)))&#xA;&#xA;(defun mo-js-mode-hook ()&#xA;  (setq imenu-create-index-function 'mo-js-imenu-make-index))&#xA;&#xA;(add-hook 'js-mode-hook 'mo-js-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My actual setup is more complicated (&lt;a href=&quot;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-javascript.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-javascript.el&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some major modes provide advanced imenu utilities out of the box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are multiple major modes for one programming language, the solution could be as simple as choosing a better major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, both js-mode and js2-mode supports javascript, but js2-mode provides better imenu utilities. If you use js2-mode for javascript code, your &lt;code&gt;which-function-mode&lt;/code&gt; works with much less manual imenu setup code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My article &lt;a href=&quot;http://blog.binchen.org/posts/why-emacs-is-better-editor.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blog.binchen.org/posts/why-emacs-is-better-editor.html&lt;/a&gt; discuss the technical details on hacking js2-mode imenu code if you are still not satisfied with js2-mode's default imenu setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you need hacking is that some major modes will provide their own imenu framework. For example, in &lt;code&gt;web-mode&lt;/code&gt; you need change &lt;code&gt;web-mode-imenu-regexp-list&lt;/code&gt; instead of standard imenu variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Grep my emacs configuration at &lt;a href=&quot;https://github.com/redguardtoo/emacs.d/tree/master/lisp&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/tree/master/lisp&lt;/a&gt; , you will find many samples on imenu setup.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2017-09-01T01:40:59.987" LastActivityDate="2017-09-01T01:40:59.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28113" PostTypeId="1" CreationDate="2016-10-25T12:52:02.560" Score="1" ViewCount="195" Body="&lt;p&gt;I wanted to generate a tags table for the lisp libraries that my Emacs came with, located in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/path/to/emacs/25.1/lisp/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's a mix of compressed and uncompressed files in that directory, so I ran &lt;code&gt;etags *.el{.gz,}&lt;/code&gt; to build the TAGS file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;find-tag&lt;/code&gt; works, but &lt;code&gt;xref-find-definitions&lt;/code&gt; only works for the uncompressed libraries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I run &lt;code&gt;xref-find-definitions&lt;/code&gt; with &lt;code&gt;copy-to-buffer&lt;/code&gt;, which lives in &lt;code&gt;simple.el.gz&lt;/code&gt;, it reports:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user-error: Rerun etags: ‘^(defun copy-to-buffer ’ not found in /path/to/emacs/25.1/lisp/simple.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and inspecting the buffer-list shows a newly-created empty buffer named &lt;code&gt;simple.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have &lt;code&gt;simple.el.gz&lt;/code&gt; open before running the above command, it works correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking in the TAGS file itself, I see that all the filenames end in &lt;code&gt;.el&lt;/code&gt;, even those whose files on disk end in &lt;code&gt;.el.gz&lt;/code&gt;, and I assume this related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I properly build/use tags for these compressed files? Also, if I delete the TAGS file I generated, &lt;code&gt;xref-find-definitions&lt;/code&gt; just works, whereas &lt;code&gt;find-tag&lt;/code&gt; prompts me for a tags table to visit, so I'm curious how xref is finding references: is it using a TAGS file located elsewhere, or some other mechanism?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-10-25T13:06:04.923" LastActivityDate="2020-08-21T20:07:15.873" Title="Generate/use etags for compressed (.el.gz) libraries?" Tags="|compression|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28114" PostTypeId="2" ParentId="7530" CreationDate="2016-10-25T12:53:09.590" Score="2" Body="&lt;p&gt;In a comment, you give this example: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let's say I make a framework for doing certain things and put it on GitHub. For those using the framework, the extensions to cperl-mode would be of interest, but not for the users of cperl-mode in general.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For this situation, an option is to write a &lt;code&gt;derived-mode&lt;/code&gt;, that is a major-mode inheriting from another major-mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode your-framework-mode&#xA;  cperl-mode&#xA;  &quot;Your-framework&quot; ; name for the status line&#xA;  &quot;Your-framework Mode&quot;     ; long name&#xA;  ;; your settings&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A buffer with &lt;code&gt;your-framework-mode&lt;/code&gt; enabled will have all the features of &lt;code&gt;cperl-mode&lt;/code&gt;, with the addition of a keymap named &lt;code&gt;your-framework-mode-map&lt;/code&gt;, which you can use for your extra bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the form really defines a major mode, so you get much more than a keymap: hook, initialization code...&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2016-10-25T12:53:09.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28115" PostTypeId="2" ParentId="28110" CreationDate="2016-10-25T13:07:25.967" Score="1" Body="&lt;p&gt;The following code demonstrates the direct use of &lt;code&gt;semantic&lt;/code&gt; for jumping to tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure you configured &lt;code&gt;semantic-c-dependency-system-include-path&lt;/code&gt; right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code displays the tag in another buffer.&#xA;You can adapt the code to jump to the tag if you really want that.&#xA;There should already exist something like that. But, I did not find it.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun semantic-display-tag (&amp;amp;optional pt)&#xA;  &quot;Display tag at point.&quot;&#xA;  (interactive &quot;d&quot;)&#xA;  (unless pt (setq pt (point)))&#xA;  (let (analyze tag buf loc start pt)&#xA;    (when (and (setq analyze (semantic-analyze-current-context pt))&#xA;           (setq tag (semantic-analyze-interesting-tag analyze))&#xA;           (setq buf (semantic-tag-buffer tag))&#xA;           (setq start (semantic-tag-start tag)))&#xA;      (with-selected-window (display-buffer buf #'display-buffer-pop-up-window)&#xA;    (goto-char start)&#xA;    (recenter))&#xA;      )))&#xA;&#xA;(global-set-key (kbd &quot;C-c , d&quot;) #'semantic-display-tag)&#xA;(easy-menu-add-item cedet-menu-map '(&quot;Navigate Tags&quot;) [&quot;Display Tag&quot; semantic-display-tag (semantic-active-p)] 'semantic-complete-jump-local)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-10-25T17:08:11.570" LastActivityDate="2016-10-25T17:08:11.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28117" PostTypeId="2" ParentId="28103" CreationDate="2016-10-25T14:10:22.913" Score="1" Body="&lt;p&gt;Yes, it is most likely just the number of commits between the good and&#xA;bad revisions.  When I run the same bisect on my machine, it takes&#xA;between five and ten seconds to finish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bulk of the time is probably being spent generating the log.&#xA;Aside from profiling, I can think of two quick ways to test this: 1)&#xA;stop the process with &lt;kbd&gt;C-g&lt;/kbd&gt; and look at the state of the&#xA;status buffer (is the log partially highlighted?), and 2)&#xA;remove &lt;code&gt;magit-insert-bisect-rest&lt;/code&gt; from &lt;code&gt;magit-status-sections-hook&lt;/code&gt; to&#xA;see if it still hangs for you.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2016-10-25T14:40:29.567" LastActivityDate="2016-10-25T14:40:29.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28118" PostTypeId="1" AcceptedAnswerId="28635" CreationDate="2016-10-25T14:27:30.000" Score="5" ViewCount="813" Body="&lt;p&gt;Let's say I have a custom TODO tag called 'NEXT' and a file gtd.org which contains the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some category&#xA;** TODO Big project in category&#xA;*** NEXT Big step to completing project&#xA;**** NEXT Small step to completing big step&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In my custom agenda view, I have a block listing everything with a NEXT tag. The problem is that this block lists the big step &lt;em&gt;and&lt;/em&gt; the small step, whereas I only want to see the small step. That is, I'm looking for one of the following solutions, from most desirable to least desirable:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do not show a 'NEXT' headline if it has a child with 'NEXT' (probably resource        heavy)&lt;/li&gt;&#xA;&lt;li&gt;Sort the agenda block so that greater headline depth is on top&lt;/li&gt;&#xA;&lt;li&gt;Have different blocks for different headline depths&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I &lt;strong&gt;know&lt;/strong&gt; that org can detect headline depth, because when setting &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; its possible to add a number of spaces spaces to the prefix equaling the headline depth (using &lt;code&gt;%l&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="13775" LastEditorUserId="13775" LastEditDate="2016-10-25T14:35:42.527" LastActivityDate="2016-11-13T14:54:31.113" Title="Org agenda filter by headline depth" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28119" PostTypeId="1" CreationDate="2016-10-25T14:41:08.160" Score="2" ViewCount="570" Body="&lt;p&gt;I've been experimenting with &lt;code&gt;M-x compile&lt;/code&gt; recently (I'm using it to start my node.js-project which will output a stack-trace if there is an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get traces like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: Configuration property &quot;loggers&quot; is not defined&#xA;    at Config.get (/home/myuser/path/to/project/node_modules/config/lib/config.js:179:11)&#xA;    at Object.&amp;lt;anonymous&amp;gt; (/home/myuser/path/to/project/lib/setup-logging.js:14:26)&#xA;    at Module._compile (module.js:570:32)&#xA;    at Object.Module._extensions..js (module.js:579:10)&#xA;    at Module.load (module.js:487:32)&#xA;    at tryModuleLoad (module.js:446:12)&#xA;    at Function.Module._load (module.js:438:3)&#xA;    at Module.require (module.js:497:17)&#xA;    at require (internal/module.js:20:19)&#xA;    at Object.&amp;lt;anonymous&amp;gt; (/home/myuser/path/to/project/index.js:6:1)&#xA;    at Module._compile (module.js:570:32)&#xA;    at Object.Module._extensions..js (module.js:579:10)&#xA;    at Module.load (module.js:487:32)&#xA;    at tryModuleLoad (module.js:446:12)&#xA;    at Function.Module._load (module.js:438:3)&#xA;    at Module.runMain (module.js:604:10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each of the paths there is actually nicely clickable, however when I do click it (or navigate to it and press &lt;code&gt;RET&lt;/code&gt;), emacs isn't smart enough to open the right file. Instead, I get a &lt;code&gt;helm&lt;/code&gt;-popup saying &lt;code&gt;Find this error in (default setup-logging.js:14): /home/myuser/path/to/project/directory/of/the/currently/open/file&lt;/code&gt; where I then have to navigate to the file myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked through the docs but I couldn't find anything relating to this issue, can you guys help me out here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I'm actually using &lt;code&gt;projectile-compile-project&lt;/code&gt; rather than &lt;code&gt;compile&lt;/code&gt; directly, but I get the same results with plain &lt;code&gt;compile&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13447" LastActivityDate="2017-04-26T19:50:46.423" Title="Source-Links in Compilation mode not working" Tags="|compilation|compilation-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28120" PostTypeId="2" ParentId="28105" CreationDate="2016-10-25T15:03:57.313" Score="6" Body="&lt;p&gt;You can iterate over the list of modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (m (list org-mode-map emacs-lisp-mode-map))&#xA;  (bind-keys :map m&#xA;             :prefix-map f14-prefix-map&#xA;             :prefix &quot;&amp;lt;f14&amp;gt;&quot;&#xA;             (&quot;x&quot; . my-elisp-indent)&#xA;             (&quot;y&quot; . paredit-open-round)&#xA;             (&quot;z&quot; . paredit-kill)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-25T15:03:57.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28121" PostTypeId="1" AcceptedAnswerId="28296" CreationDate="2016-10-25T15:12:10.150" Score="6" ViewCount="1143" Body="&lt;p&gt;I have keyboard shortcuts set up to switch to virtual desktops with Ctrl-&lt;em&gt;n&lt;/em&gt;. When I switch to a desktop, the &quot;front-most&quot; app in that window becomes focused. But not for Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another, perhaps related, issue is that even though I have the &lt;code&gt;When switching to an application, switch to a Space with open windows for the application&lt;/code&gt; option checked Mission Control preferences, when I Cmd-Tab to Emacs, the Emacs window is moved to the desktop I'm currently in. That's unexpected since when I Cmd-Tab to any other app, I'm switched to that desktop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how to get Emacs to behave like normal applications?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs version: &lt;code&gt;GNU Emacs 25.1.1 (x86_64-apple-darwin15.4.0, Carbon Version 157 AppKit 1404.46) of 2016-10-24&lt;/code&gt; (&lt;code&gt;brew install emacs-mac&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;OS version: &lt;code&gt;10.11.4 (15E65)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9062" LastActivityDate="2023-05-15T05:55:27.543" Title="OSX: Switching to virtual desktop doesn't focus Emacs" Tags="|osx|emacs-mac-port|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28122" PostTypeId="1" CreationDate="2016-10-25T15:28:20.210" Score="1" ViewCount="930" Body="&lt;p&gt;I have two windows open - one in editor mode with some SQL, bash, etc and the other in ansi-term. I want to mark my text and then execute it in the ansi-term window. Yes, I could make a shortcut involving copy paste but I was curious if there was anything canonical. Copy-paste also forces me to switch out of terminal mode and into editor mode in ansi-term&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2016-10-25T20:21:25.983" Title="How to execute shell command from editor window?" Tags="|shell|ansi-term|" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28123" PostTypeId="2" ParentId="28122" CreationDate="2016-10-25T16:37:02.930" Score="2" Body="&lt;p&gt;Emacs supports sending the region/buffer to the interpreter. This is supported in various modes, including &lt;a href=&quot;http://www.bnikolic.co.uk/blog/python-running-emacs.html&quot; rel=&quot;nofollow&quot;&gt;python&lt;/a&gt;, &lt;a href=&quot;https://wiki.haskell.org/Emacs/Inferior_Haskell_processes&quot; rel=&quot;nofollow&quot;&gt;haskell&lt;/a&gt;, &lt;a href=&quot;https://www.gnu.org/software/octave/doc/v4.0.3/Running-Octave-from-Within-Emacs.html&quot; rel=&quot;nofollow&quot;&gt;octave&lt;/a&gt;, and even in shell scripts. Unfortunately, they keybindings are different in every mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For shell scripts (&lt;code&gt;sh-mode&lt;/code&gt;), you can use &lt;code&gt;C-c C-n&lt;/code&gt; to send the current line, or the highlighted region to the inferior shell. Unfortunately, it looks like it is hardcoded to use &lt;code&gt;shell&lt;/code&gt;, not &lt;code&gt;ansi-term&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For SQL (&lt;code&gt;sql-mode&lt;/code&gt;), similar features are available under &lt;code&gt;C-c C-r&lt;/code&gt; (send region) and &lt;code&gt;C-c C-b&lt;/code&gt; (send entire buffer). See the mode help of sql-mode for mode keybindings. You may need to install an interpreter that sql-mode can use (or configure sql-mode to use the right interpreter).&lt;/p&gt;&#xA;" OwnerUserId="9181" LastEditorUserId="9181" LastEditDate="2016-10-25T18:58:06.613" LastActivityDate="2016-10-25T18:58:06.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28124" PostTypeId="1" CreationDate="2016-10-25T17:55:28.657" Score="1" ViewCount="776" Body="&lt;p&gt;I'm putting all my backups in a directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar saves-dir (expand-file-name &quot;~/.saves/&quot;))&#xA;(setq backup-directory-alist `((&quot;.*&quot; . ,saves-dir)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This creates annoying filenames with ! in them, such as &lt;code&gt;!home!bjourne!.fonts.conf.~1~&lt;/code&gt;. How do I change that so it instead becomes &lt;code&gt;_home_bjourne_.fonts.conf.~1~&lt;/code&gt;.?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Come to think of it, even better would be if emacs created a directory tree and kept each backup file in its own directory. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.saves/home/bjourne/wtf.txt/~1~&#xA;~/.saves/home/bjourne/wtf.txt/~2~&#xA;~/.saves/home/bjourne/wtf.txt/~3~&#xA;~/.saves/home/bjourne/whatever/program.c/~1~&#xA;~/.saves/home/bjourne/whatever/program.c/~2~&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if this naming scheme was possible, I'd prefer that.&lt;/p&gt;&#xA;" OwnerUserId="9942" LastEditorUserId="9942" LastEditDate="2016-10-25T18:05:46.907" LastActivityDate="2016-10-26T14:55:33.643" Title="Change naming scheme for backup files" Tags="|auto-save|backup|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28125" PostTypeId="1" CreationDate="2016-10-25T18:20:54.567" Score="1" ViewCount="52" Body="&lt;p&gt;Consider the following setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat contents.org &#xA;#+INCLUDE: preamble.org&#xA;#+INCLUDE: introduction.org&#xA;$ cat preamble.org &#xA;* Preamble&#xA;** subsection 1&#xA;** subsection 2&#xA;$ cat introduction.org &#xA;* Introduction&#xA;** Subsection 1&#xA;** Subsection 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if I convert this to LaTeX:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat compile.el &#xA;(require 'org)&#xA;(require 'ox-latex)&#xA;&#xA;;; Generate LaTeX&#xA;(with-current-buffer (find-file-noselect &quot;contents.org&quot;)&#xA;   (org-latex-export-to-latex nil nil nil t))&#xA;$ emacs -Q --batch -l compile.el&#xA;Saving file /home/nikratio/tmp/org-bug/contents.tex...&#xA;Wrote /home/nikratio/tmp/org-bug/contents.tex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the output looks rather wrong - everything in the second file is treated at the wrong indentation level:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat contents.tex&#xA;\section{Preamble}&#xA;\label{sec-1}&#xA;\subsection{subsection 1}&#xA;\label{sec-1-1}&#xA;\subsection{subsection 2}&#xA;\label{sec-1-2}&#xA;\subsubsection{Introduction}&#xA;\label{sec-1-2-1}&#xA;\begin{enumerate}&#xA;\item Subsection 1&#xA;\label{sec-1-2-1-1}&#xA;\item Subsection 2&#xA;\label{sec-1-2-1-2}&#xA;\end{enumerate}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong? I'd like to have the following output (ommitting the labels for brevity):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{Preamble}&#xA;\subsection{subsection 1}&#xA;\subsection{subsection 2}&#xA;\section{Introduction}&#xA;\subsection{subsection 1}&#xA;\subsection{subsection 2}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is with org 8.3.4.&lt;/p&gt;&#xA;" OwnerUserId="13550" LastActivityDate="2016-10-25T18:20:54.567" Title="org messes up indentation levels when including files" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28126" PostTypeId="2" ParentId="28122" CreationDate="2016-10-25T18:53:57.210" Score="0" Body="&lt;p&gt;You can try something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun send-region-to-ansi ()&#xA;  &quot;If region active, send it to ansi-term buffer.&quot;&#xA;  (interactive)&#xA;  (if (region-active-p) &#xA;      (send-region &quot;*ansi-term*&quot; (region-beginning) (region-end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe you don't even want to mark a region. I use a function that marks the current paragraph automatically.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun send-paragraph-to-ansi ()&#xA;  (interactive)&#xA;  (mark-paragraph)&#xA;  (send-region &quot;*ansi-term*&quot; (region-beginning) (region-end))&#xA;  (deactivate-mark))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-25T19:41:00.257" LastActivityDate="2016-10-25T19:41:00.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28127" PostTypeId="2" ParentId="28121" CreationDate="2016-10-25T19:13:34.097" Score="2" Body="&lt;p&gt;I don't see this behavior either with: &#xA;osx 10.11.6&#xA;&quot;GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G31)) of 2016-09-22&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs from brew as follows: &#xA;brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick&lt;/p&gt;&#xA;" OwnerUserId="13733" LastActivityDate="2016-10-25T19:13:34.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28128" PostTypeId="2" ParentId="28122" CreationDate="2016-10-25T20:21:25.983" Score="0" Body="&lt;p&gt;The most basic command, independent of a major mode, is &lt;code&gt;shell-command-on-region&lt;/code&gt;or &lt;code&gt;M-|&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buffer where the output from above command is send to is &lt;code&gt;*Shell Command Output*&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2016-10-25T20:21:25.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28129" PostTypeId="2" ParentId="26405" CreationDate="2016-10-25T20:48:22.990" Score="1" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;flyspell&quot;&#xA;  '(progn&#xA;     (defun flyspell-goto-next-and-popup ( )&#xA;       &quot;Goto the next spelling error, popup menu, and stop when the end of buffer is reached.&quot;&#xA;       (interactive)&#xA;       (while (&amp;lt; (point) (point-max))&#xA;     (flyspell-goto-next-error)&#xA;     (redisplay)&#xA;     (flyspell-correct-word-before-point))&#xA;       (message &quot;No more spelling errors in buffer.&quot;)&#xA;       ) &#xA;     ))&#xA;(define-key flyspell-mode-map (kbd &quot;C-;&quot;) 'flyspell-goto-next-and-popup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10076" LastActivityDate="2016-10-25T20:48:22.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28130" PostTypeId="2" ParentId="28096" CreationDate="2016-10-25T21:01:02.413" Score="2" Body="&lt;p&gt;The following modifications allow bullets with leading zeros in org-mode version 8.3.6:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--- ~/.emacs.d/elpa/org-20160425/org-list.el    Sun May  1 10:12:55 2016&#xA;+++ /tmp/org-list.el    Tue Oct 25 22:49:47 2016&#xA;@@ -367,6 +367,14 @@&#xA;      (list (symbol :tag &quot;Major mode&quot;)&#xA;        (string :tag &quot;Format&quot;))))&#xA;&#xA;+(defcustom org-list-keep-leading-zeros t&#xA;+  &quot;Keep leading zeros in numeric list bullets, i.e.:&#xA;+ 01. [X]&#xA;+ 02. [X]&quot;&#xA;+  :group 'org-plain-lists&#xA;+  :type 'boolean)&#xA;+&#xA;+&#xA; (defvar org-list-forbidden-blocks '(&quot;example&quot; &quot;verse&quot; &quot;src&quot; &quot;ascii&quot; &quot;beamer&quot;&#xA;                    &quot;html&quot; &quot;latex&quot; &quot;odt&quot;)&#xA;   &quot;Names of blocks where lists are not allowed.&#xA;@@ -1656,10 +1664,13 @@&#xA;   (let ((case-fold-search nil))&#xA;     (cond&#xA;      ;; Num bullet: increment it.&#xA;-     ((string-match &quot;[0-9]+&quot; bullet)&#xA;-      (replace-match&#xA;-       (number-to-string (1+ (string-to-number (match-string 0 bullet))))&#xA;-       nil nil bullet))&#xA;+     ((string-match &quot;\\([0]*\\)\\([1-9][0-9]*\\)&quot; bullet)&#xA;+      (replace-match (format &#xA;+             (if (match-string 1 bullet)&#xA;+             (concat &quot;%0&quot; (number-to-string (length (match-string 0 bullet))) &quot;d&quot;)&#xA;+           &quot;%d&quot;)&#xA;+             (1+ (string-to-number (match-string 2 bullet))))&#xA;+            nil nil bullet))&#xA;      ;; Alpha bullet: increment it.&#xA;      ((string-match &quot;[A-Za-z]&quot; bullet)&#xA;       (replace-match&#xA;@@ -1731,7 +1742,12 @@&#xA;         ((and alphap (string-match &quot;[a-z]&quot; bullet))&#xA;          (replace-match &quot;a&quot; nil nil bullet))&#xA;         ;; First bullet is num: use &quot;1&quot;.&#xA;-        ((string-match &quot;\\([0-9]+\\|[A-Za-z]\\)&quot; bullet)&#xA;+        ((string-match (concat &quot;\\(&quot;&#xA;+                   (if org-list-keep-leading-zeros&#xA;+                       &quot;[1-9][0-9]+&quot;&#xA;+                     &quot;[0-9]+&quot;)&#xA;+                   &quot;\\|[A-Za-z]\\)&quot;)&#xA;+               bullet)&#xA;          (replace-match &quot;1&quot; nil nil bullet))&#xA;         ;; Not an ordered list: keep bullet.&#xA;         (t bullet)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The relevant code which you can use to override the org-mode definitions is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-list-keep-leading-zeros t&#xA;  &quot;Keep leading zeros in numeric list bullets, i.e.:&#xA; 01. [X]&#xA; 02. [X]&quot;&#xA;  :group 'org-plain-lists&#xA;  :type 'boolean)&#xA;&#xA;(defun org-list-inc-bullet-maybe (bullet)&#xA;  &quot;Increment BULLET if applicable.&quot;&#xA;  (let ((case-fold-search nil))&#xA;    (cond&#xA;     ;; Num bullet: increment it.&#xA;     ((string-match &quot;\\([0]*\\)\\([1-9][0-9]*\\)&quot; bullet)&#xA;      (replace-match (format &#xA;              (if (match-string 1 bullet)&#xA;              (concat &quot;%0&quot; (number-to-string (length (match-string 0 bullet))) &quot;d&quot;)&#xA;            &quot;%d&quot;)&#xA;              (1+ (string-to-number (match-string 2 bullet))))&#xA;             nil nil bullet))&#xA;     ;; Alpha bullet: increment it.&#xA;     ((string-match &quot;[A-Za-z]&quot; bullet)&#xA;      (replace-match&#xA;       (char-to-string (1+ (string-to-char (match-string 0 bullet))))&#xA;       nil nil bullet))&#xA;     ;; Unordered bullet: leave it.&#xA;     (t bullet))))&#xA;&#xA;(defun org-list-struct-fix-bul (struct prevs)&#xA;  &quot;Verify and correct bullets in STRUCT.&#xA;PREVS is the alist of previous items, as returned by&#xA;`org-list-prevs-alist'.&#xA;&#xA;This function modifies STRUCT.&quot;&#xA;  (let ((case-fold-search nil)&#xA;    (fix-bul&#xA;     (function&#xA;      ;; Set bullet of ITEM in STRUCT, depending on the type of&#xA;      ;; first item of the list, the previous bullet and counter&#xA;      ;; if any.&#xA;      (lambda (item)&#xA;        (let* ((prev (org-list-get-prev-item item struct prevs))&#xA;           (prev-bul (and prev (org-list-get-bullet prev struct)))&#xA;           (counter (org-list-get-counter item struct))&#xA;           (bullet (org-list-get-bullet item struct))&#xA;           (alphap (and (not prev)&#xA;                (org-list-use-alpha-bul-p item struct prevs))))&#xA;          (org-list-set-bullet&#xA;           item struct&#xA;           (org-list-bullet-string&#xA;        (cond&#xA;         ;; Alpha counter in alpha list: use counter.&#xA;         ((and prev counter&#xA;               (string-match &quot;[a-zA-Z]&quot; counter)&#xA;               (string-match &quot;[a-zA-Z]&quot; prev-bul))&#xA;          ;; Use cond to be sure `string-match' is used in&#xA;          ;; both cases.&#xA;          (let ((real-count&#xA;             (cond&#xA;              ((string-match &quot;[a-z]&quot; prev-bul) (downcase counter))&#xA;              ((string-match &quot;[A-Z]&quot; prev-bul) (upcase counter)))))&#xA;            (replace-match real-count nil nil prev-bul)))&#xA;         ;; Num counter in a num list: use counter.&#xA;         ((and prev counter&#xA;               (string-match &quot;[0-9]+&quot; counter)&#xA;               (string-match &quot;[0-9]+&quot; prev-bul))&#xA;          (replace-match counter nil nil prev-bul))&#xA;         ;; No counter: increase, if needed, previous bullet.&#xA;         (prev&#xA;          (org-list-inc-bullet-maybe (org-list-get-bullet prev struct)))&#xA;         ;; Alpha counter at first item: use counter.&#xA;         ((and counter (org-list-use-alpha-bul-p item struct prevs)&#xA;               (string-match &quot;[A-Za-z]&quot; counter)&#xA;               (string-match &quot;[A-Za-z]&quot; bullet))&#xA;          (let ((real-count&#xA;             (cond&#xA;              ((string-match &quot;[a-z]&quot; bullet) (downcase counter))&#xA;              ((string-match &quot;[A-Z]&quot; bullet) (upcase counter)))))&#xA;            (replace-match real-count nil nil bullet)))&#xA;         ;; Num counter at first item: use counter.&#xA;         ((and counter&#xA;               (string-match &quot;[0-9]+&quot; counter)&#xA;               (string-match &quot;[0-9]+&quot; bullet))&#xA;          (replace-match counter nil nil bullet))&#xA;         ;; First bullet is alpha uppercase: use &quot;A&quot;.&#xA;         ((and alphap (string-match &quot;[A-Z]&quot; bullet))&#xA;          (replace-match &quot;A&quot; nil nil bullet))&#xA;         ;; First bullet is alpha lowercase: use &quot;a&quot;.&#xA;         ((and alphap (string-match &quot;[a-z]&quot; bullet))&#xA;          (replace-match &quot;a&quot; nil nil bullet))&#xA;         ;; First bullet is num: use &quot;1&quot;.&#xA;         ((string-match (concat &quot;\\(&quot;&#xA;                    (if org-list-keep-leading-zeros&#xA;                        &quot;[1-9][0-9]+&quot;&#xA;                      &quot;[0-9]+&quot;)&#xA;                    &quot;\\|[A-Za-z]\\)&quot;)&#xA;                bullet)&#xA;          (replace-match &quot;1&quot; nil nil bullet))&#xA;         ;; Not an ordered list: keep bullet.&#xA;         (t bullet)))))))))&#xA;    (mapc fix-bul (mapcar #'car struct))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Install this code in your init-file -- maybe after &lt;code&gt;(require 'org-list)&lt;/code&gt;.&#xA;Afterwards, you can insert your first bullet with the right number of zeros at the front and all other bullets are formatted accordinly by keystrokes like &lt;kbd&gt;C-c C-c&lt;/kbd&gt; or &lt;kbd&gt;M-return&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-10-25T21:01:02.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28131" PostTypeId="2" ParentId="28063" CreationDate="2016-10-25T21:43:08.353" Score="2" Body="&lt;p&gt;I don't know what you want to accomplish exactly, but as other people pointed out, reading the echo area is not the best strategy.  Instead, you probably want to set up a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sentinels.html&quot; rel=&quot;nofollow&quot;&gt;sentinel&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many commands in AUCTeX have a sentinel associated.  For example, the one associated to LaTeX command is &lt;code&gt;TeX-LaTeX-sentinel&lt;/code&gt;.  You may want to build your own sentinel upon this one.  Once you define your sentinel function, you can set it as the default one by setting &lt;code&gt;TeX-sentinel-default-function&lt;/code&gt; to the name's symbol of the function in LaTeX buffers (you can use a hook for this).&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-10-25T21:43:08.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28132" PostTypeId="2" ParentId="28094" CreationDate="2016-10-26T02:11:08.063" Score="2" Body="&lt;p&gt;In the file macs-plus/25.1/share/emacs/25.1/lisp/simple.el.gz&#xA;I added &quot;Tap your Key&quot; to  password-word-equivalents, then it works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom password-word-equivalents&#xA;  '(&quot;password&quot; &quot;passcode&quot; &quot;passphrase&quot; &quot;pass phrase&quot;&#xA;    ; These are sorted according to the GNU en_US locale.&#xA;    &quot;암호&quot;        ; ko&#xA;    &quot;Tap your Key&quot; ; for 2 factor&#xA;    &quot;パスワード&quot; ; ja&#xA;.....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2016-10-26T02:11:08.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28133" PostTypeId="1" AcceptedAnswerId="28137" CreationDate="2016-10-26T02:27:53.907" Score="4" ViewCount="333" Body="&lt;p&gt;Out of the box, my emacs build can jump to elisp function definitions. For example, I start emacs with no init file, type &lt;code&gt;copy-to-buffer&lt;/code&gt; in the scratch buffer, hit &lt;code&gt;M-.&lt;/code&gt;, and it opens up simple.el.gz with the cursor on the defun for &lt;code&gt;copy-to-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would think this indicates there's a TAGS file somewhere that emacs is using, but I can't locate it. I checked the values of &lt;code&gt;tags-file-name&lt;/code&gt; and &lt;code&gt;tags-table-list&lt;/code&gt;, both of which are nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I searched the directory where emacs is installed (I installed with Homebrew),&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find /usr/local/Cellar/ -iname *tags*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and found nothing on interest. I searched all of &lt;code&gt;/usr/&lt;/code&gt; as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What black magic is this? Does Emacs have some kind of internalized tags table for the built-in elisp libraries?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-10-26T02:33:34.477" LastActivityDate="2016-10-26T04:31:47.733" Title="Is Emacs using a TAGS file to locate built-in definitions?" Tags="|builtin|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28134" PostTypeId="2" ParentId="28075" CreationDate="2016-10-26T03:10:36.327" Score="0" Body="&lt;p&gt;The issue appears to be that the file &lt;code&gt;.emacs.jesus.d/init.el&lt;/code&gt; file in the part that is not shown has characters that are not valid elisp. The package code wants to save some custom variables, and therefore wants to edit this file as there is not a separate &lt;code&gt;custom-file&lt;/code&gt;. The edits want to remove any existing custom-set-variables, and add a new one. It is failing due to the invalid elisp.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-10-26T03:10:36.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28135" PostTypeId="1" AcceptedAnswerId="32350" CreationDate="2016-10-26T03:33:48.420" Score="9" ViewCount="3570" Body="&lt;p&gt;If I have &lt;code&gt;text1 text2&lt;/code&gt;, I yank &lt;code&gt;text1&lt;/code&gt; with &lt;code&gt;yw&lt;/code&gt; then I highlight &lt;code&gt;text2&lt;/code&gt; with &lt;code&gt;vw&lt;/code&gt; and paste overwrite that text with &lt;code&gt;p&lt;/code&gt;, my kill ring now has &lt;code&gt;text2&lt;/code&gt;. I'd prefer if &lt;code&gt;text2&lt;/code&gt; wasn't added to my kill ring because next time I paste text, Emacs will paste &lt;code&gt;text2&lt;/code&gt; which I inadvertently copied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same question for &lt;code&gt;x&lt;/code&gt; (which deletes 1 character), the deleted character goes into my kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;p&lt;/code&gt; then &lt;code&gt;C-p&lt;/code&gt; to cycle through the kill ring isn't ideal. I paste the text again, the over written text is continually added onto the kill ring leading to more &lt;code&gt;C-p&lt;/code&gt; presses to get the original text. Ideally I'm hoping to disable or redefine p when over writing text to not add to the kill ring&lt;/p&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="105" LastEditDate="2016-10-26T13:23:21.960" LastActivityDate="2019-11-05T01:56:00.103" Title="In Evil mode, how can I prevent adding to the kill ring when I yank text, visual mode over other text, then paste over?" Tags="|evil|yank|kill-ring|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28136" PostTypeId="2" ParentId="28124" CreationDate="2016-10-26T03:50:36.157" Score="1" Body="&lt;p&gt;You can customize the&lt;code&gt;make-backup-filename-function&lt;/code&gt; variable to do this, using the existing &lt;code&gt;make-backup-file-name&lt;/code&gt; and &lt;code&gt;make-backup-file-name-1&lt;/code&gt; as examples. If you don't need to support msdos etc then you can simplify them a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thought this is a lot of work for little gain. It would be different if &lt;code&gt;!&lt;/code&gt; meant something to your filesystem.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2016-10-26T07:45:37.170" LastActivityDate="2016-10-26T07:45:37.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28137" PostTypeId="2" ParentId="28133" CreationDate="2016-10-26T03:53:23.517" Score="5" Body="&lt;p&gt;It doesn't use a TAGS file, or even the same code that works with TAGS files. Instead, any time you load an elisp file (using &lt;code&gt;require&lt;/code&gt; or &lt;code&gt;load&lt;/code&gt; or similar) Emacs stores information about the symbols that are defined in that file in a variable called &lt;code&gt;load-history&lt;/code&gt;. You can see its contents with &lt;code&gt;C-h v load-history RET&lt;/code&gt;, and you can read the source code that uses it with &lt;code&gt;C-h k M-.&lt;/code&gt; and following the link to the definition of the function &lt;code&gt;xref-find-definitions&lt;/code&gt;. Burrow down a few levels and you'll find &lt;code&gt;elisp--xref-find-definitions&lt;/code&gt; which calls &lt;code&gt;find-lisp-object-file-name&lt;/code&gt; which calls &lt;code&gt;symbol-file&lt;/code&gt; which looks the info up in &lt;code&gt;load-history&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I just saw your comment about Emacs 24; I'm describing Emacs 25. In earlier versions it wasn't as unified.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2016-10-26T03:57:55.193" LastActivityDate="2016-10-26T03:57:55.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28138" PostTypeId="2" ParentId="28133" CreationDate="2016-10-26T04:31:47.733" Score="1" Body="&lt;p&gt;Internally emacs stores this information on the &lt;code&gt;load-history&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A small part of it might look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;the/file/name.el&quot; var1 var2 (defun . fn1) (defun . fn2))&#xA; (&quot;ano/ther/filename.el&quot; var3 var4 (defun . fn3))&#xA; ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to record 4 variables and 3 functions. I think once it has the filename it just searches for the name.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-10-26T04:31:47.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28139" PostTypeId="1" CreationDate="2016-10-26T08:37:56.760" Score="1" ViewCount="239" Body="&lt;p&gt;I have a comint managing a subprocess and I want to send a huge text payload to it that the user doesn't need to see (it's a multi-page configuration string that must be provided this way).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Text sent to the comint is normally echoed to the buffer, is there a way to suppress this?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2016-10-26T08:37:56.760" Title="do not echo commands to comint-mode buffer" Tags="|comint|" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28140" PostTypeId="2" ParentId="28135" CreationDate="2016-10-26T08:51:49.707" Score="0" Body="&lt;p&gt;I'm pretty new to emacs, so I'm not sure about the terminology, but using vim-speak (and this works in evil-mode), yanking populates the &lt;code&gt;0&lt;/code&gt; register, while deleting text will populate the &lt;code&gt;1&lt;/code&gt;-&lt;code&gt;9&lt;/code&gt; registers, pushing them along as you delete text. So in your case, you should be able to access your yanked text using &lt;code&gt;&quot;0p&lt;/code&gt;, even after deleting something else.&lt;/p&gt;&#xA;" OwnerUserId="13525" LastActivityDate="2016-10-26T08:51:49.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28141" PostTypeId="2" ParentId="24886" CreationDate="2016-10-26T09:24:00.643" Score="1" Body="&lt;p&gt;You can adjust the indentation of &lt;code&gt;cc-mode&lt;/code&gt; used for &lt;code&gt;glsl-mode&lt;/code&gt;.&#xA;Put the following elisp lines into your initialization files.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun glsl-mode-adjust-closing-bracket ()&#xA;  (setf (cdr (assoc 'arglist-close c-offsets-alist)) 0))&#xA;(add-hook 'glsl-mode-hook #'glsl-mode-adjust-closing-bracket)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the doc for variable &lt;code&gt;c-offsets-alist&lt;/code&gt; in the manual for &lt;code&gt;cc-mode&lt;/code&gt;: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ccmode/c_002doffsets_002dalist.html#c_002doffsets_002dalist&quot; rel=&quot;nofollow&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/ccmode/c_002doffsets_002dalist.html#c_002doffsets_002dalist&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the above modification you get the following indentation if you add a semi-colon after the closing bracket.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;void main () {&#xA;    vec4 thing = [&#xA;        1, 2, 3, 4;&#xA;    ];&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remaining question: Is the semicolon missing in your example or is this valid glsl-syntax?&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-10-26T12:28:31.890" LastActivityDate="2016-10-26T12:28:31.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28142" PostTypeId="1" CreationDate="2016-10-26T12:04:27.200" Score="4" ViewCount="185" Body="&lt;p&gt;I'm using skewer-mode and can't use the &lt;code&gt;skewer-repl&lt;/code&gt;, which is unfortunate.&#xA;I get a prompt &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;js&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;then I can enter anything, nothing is happening...&#xA;&lt;code&gt;js-REPL:run&lt;/code&gt; and &lt;code&gt;Shell-Compile&lt;/code&gt; are running as major modes in the skewer-repl.&#xA;I'm using Emacs 24.5 on Mac OSX&#xA;Any idea how I can make it working? Thanks&lt;/p&gt;&#xA;" OwnerUserId="13074" LastActivityDate="2016-10-26T12:04:27.200" Title="JavaScript REPL in skewer-mode" Tags="|skewer-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28143" PostTypeId="2" ParentId="24713" CreationDate="2016-10-26T13:20:04.520" Score="2" Body="&lt;p&gt;The underwave is drawn at a fixed size and position. The relevant source code is at &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/xterm.c#n3381&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/xterm.c#n3381&lt;/a&gt; and &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/w32term.c#n309&quot; rel=&quot;nofollow&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/tree/src/w32term.c#n309&lt;/a&gt;. I don't see any reason why you couldn't fix that, though. You could scale the wave based on &lt;code&gt;s-&amp;gt;font-&amp;gt;underline_thickness&lt;/code&gt;, for instance.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-26T13:20:04.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28144" PostTypeId="2" ParentId="19560" CreationDate="2016-10-26T14:27:26.973" Score="2" Body="&lt;p&gt;I modified the code you linked to on org-hacks to use &lt;a href=&quot;https://en.wikipedia.org/wiki/Scrot&quot; rel=&quot;nofollow&quot;&gt;scrot&lt;/a&gt;. This is a linux-only program, which, although no longer maintained, still works fine and allows you to interactively select the area of your screenshot.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-screenshot ()&#xA;  &quot;Take a screenshot into a time stamped unique-named file in the&#xA;same directory as the org-buffer and insert a link to this file.&quot;&#xA;  (interactive)&#xA;  (let ((filename&#xA;         (concat&#xA;          (make-temp-name&#xA;           (concat (buffer-file-name)&#xA;                   &quot;_&quot;&#xA;                   (format-time-string &quot;%Y%m%d_%H%M%S_&quot;)) ) &quot;.png&quot;)))&#xA;    (call-process &quot;scrot&quot; nil nil nil &quot;-s&quot; filename)&#xA;    (insert (concat &quot;[[&quot; filename &quot;]]&quot;))&#xA;    (org-display-inline-images)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that when you call this command, there is no visual indication that anything is happening! You just draw a rectangle with the mouse, and when you're done it inserts the resulting screenshot in the org buffer. It would be nice if the cursor changed shape or something to indicate that it was waiting for you to draw, but it doesn't.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-10-26T14:27:26.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28145" PostTypeId="2" ParentId="28124" CreationDate="2016-10-26T14:55:33.643" Score="0" Body="&lt;p&gt;+1 for the answer from @icarus. Here's an example from the &lt;a href=&quot;https://www.emacswiki.org/emacs/BackupDirectory&quot; rel=&quot;nofollow&quot;&gt;Emacs Wiki&lt;/a&gt; that stores your backup files in dated directories (e.g. &lt;code&gt;~/.backups/emacs/16/10/26/foo.txt&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-make-backup-file-name (FILE)&#xA;  (let ((dirname (concat &quot;~/.backups/emacs/&quot;&#xA;                         (format-time-string &quot;%y/%m/%d/&quot;))))&#xA;    (if (not (file-exists-p dirname))&#xA;        (make-directory dirname t))&#xA;    (concat dirname (file-name-nondirectory FILE))))&#xA;&#xA;(setq make-backup-file-name-function #'my-make-backup-file-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that unlike the default backup name function, this doesn't handle the case where you have multiple files with the same name at different paths -- they would map to the same backup. You probably want to look at &lt;code&gt;make-backup-file-name-1&lt;/code&gt; (where path separators are replaced with  &lt;code&gt;!&lt;/code&gt;) to make the simple example above more robust. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-10-26T14:55:33.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28148" PostTypeId="2" ParentId="27431" CreationDate="2016-10-26T16:01:28.720" Score="1" Body="&lt;p&gt;Ah, I see what's going on. Almost everything you describe is normal and desirable behavior for &lt;code&gt;ido-mode&lt;/code&gt;, which makes it hard to see what bug you're reporting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I think I've replicated it. I already had a file from the Emacs source code open (src/xterm.c), so I started with that. I tried opening two README files in different locations using the method you describe; one was src/README and the other was lisp/README. First I tried to open lisp/README by pasting in the string &quot;../lisp/README&quot;, and it didn't work; it said that the file wasn't found. Then I tried pasting in just the string &quot;README&quot;, and that did work; it successfully opened src/README. This seems to be the bug that you're hitting; I surmise that when you paste in something with a path separator in it it breaks. To double check that it's not happening simply because I pasted in a &quot;..&quot;, I also tried opening src/bitmaps/README by pasting in the string &quot;bitmaps/README&quot;. This didn't work either, which seems to be pretty conclusive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would use &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; to send in a bug report about it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-26T16:01:28.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28151" PostTypeId="1" AcceptedAnswerId="28152" CreationDate="2016-10-26T17:33:42.570" Score="1" ViewCount="71" Body="&lt;p&gt;I often open temp files and I don't care about saving the contents when I modify the buffer.  How can I tell Emacs to ignore buffer changes when the filename matches a pattern, so that I don't get prompted to save the buffer when I kill it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I am loading files from the command line, so I'd like to auto-detect this situation and configure the buffer accordingly.&lt;/p&gt;&#xA;" OwnerUserId="7152" LastEditorUserId="7152" LastEditDate="2016-10-26T18:46:30.897" LastActivityDate="2016-10-26T19:00:10.373" Title="preventing save prompt for temp files" Tags="|buffer-modified|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28152" PostTypeId="2" ParentId="28151" CreationDate="2016-10-26T17:43:38.853" Score="1" Body="&lt;p&gt;I use scratch buffers for that purpose. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun python-scratch () &#xA;  (interactive) &#xA;  (let ((python-scratch-buffer (get-buffer-create &quot;*python-scratch*&quot;)))&#xA;    (switch-to-buffer python-scratch-buffer)&#xA;    (python-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can convert the buffer with the file to a scratch buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-detach-buffer-from-file ()&#xA;  (interactive)&#xA;  (setq buffer-file-name nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-26T19:00:10.373" LastActivityDate="2016-10-26T19:00:10.373" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28153" PostTypeId="1" CreationDate="2016-10-26T23:16:12.363" Score="7" ViewCount="666" Body="&lt;p&gt;As I basically use &lt;code&gt;Org&lt;/code&gt; to take note and export LaTeX files, I find displaying eps files as inline image to be important for me.I have my emacs compiled with ImageMagick support, and added the following codes in the &lt;code&gt;.emacs&lt;/code&gt; file to enable inline preview support of &lt;code&gt;.eps&lt;/code&gt; files link in &lt;code&gt;Org-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(add-to-list 'image-type-file-name-regexps '(&quot;\\.eps\\'&quot; . imagemagick)  )&#xA;(add-to-list 'image-file-name-extensions &quot;eps&quot;)&#xA;(setq org-image-actual-width '(400))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tested an .eps file created by &lt;code&gt;matplotlib&lt;/code&gt; using &lt;code&gt;Agg&lt;/code&gt; backend, which the rendered inline image is blank. &#xA;However when converting the eps file using Adobe Illustrator to Illustrator EPS (I have tried several versions from AI 3 to AI CC) and the converted eps file can be successfully shown as inline image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Mwux2.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Mwux2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the &lt;code&gt;org-display-inline-images&lt;/code&gt; function only takes the image created by &lt;code&gt;ImageMagick&lt;/code&gt; to make the overlay,&#xA;this problem seems to be due to be caused by &lt;code&gt;ImageMagick&lt;/code&gt; failing to render the &lt;code&gt;matplotlib&lt;/code&gt; version eps file. However if using the ImageMagick from system command line like &lt;code&gt;convert -density 300 test.eps test.png&lt;/code&gt; will correctly create the png file which can be opened by system preview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, what exactly is the difference between the eps created by matplotlib and AI?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The test is done in OS X El Capitan with emacs 25.1.1, org-mode 8.2.0, matplotlib 2.0.0b4 and Adobe Illustrator CC 2015.  &lt;a href=&quot;https://www.dropbox.com/s/ju9yv1fpv53tvsf/tese_org_eps.zip?dl=0&quot; rel=&quot;noreferrer&quot;&gt;The sample files (.org + .eps files created by matplotlib and AI)&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="13790" LastEditorUserId="105" LastEditDate="2016-10-27T02:55:48.293" LastActivityDate="2016-10-27T02:55:48.293" Title="Org-mode inline .eps images display error. (.eps created by AI ok, .eps created by matplotlib no)" Tags="|org-mode|inline-image|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28154" PostTypeId="1" CreationDate="2016-10-27T00:06:37.297" Score="0" ViewCount="543" Body="&lt;pre&gt;&lt;code&gt;(defun pretty-add-keywords (mode keywords)&#xA;      (font-lock-add-keywords&#xA;       mode (mapcar (lambda (kw) `(,(car kw)&#xA;                                   (0 (prog1 nil&#xA;                                        (compose-region (match-beginning 0)&#xA;                                                        (match-end 0)&#xA;                                                        ,(cdr kw))))))&#xA;                    keywords)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function currently lets me match a regexp and replace it with a single char. I've been trying to modify it so that instead of just replacing it with a fixed char it replaces it with a group from the regex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anybody be able to help me out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13724" LastActivityDate="2017-12-22T19:29:23.613" Title="Using font-lock regexp groups" Tags="|font-lock|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28156" PostTypeId="1" CreationDate="2016-10-27T03:48:31.587" Score="1" ViewCount="635" Body="&lt;p&gt;I have a vanilla Spacemacs setup, and in my &lt;code&gt;.spacemacs&lt;/code&gt; file, the &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; definition I have added &lt;code&gt;(setq js2-basic-offset 2)&lt;/code&gt; which should be sufficient to set the indent length as &lt;code&gt;2&lt;/code&gt;. I have also placed this before in my &lt;code&gt;user-init&lt;/code&gt; with no luck as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can verify this in my window using &lt;code&gt;SPC h d v&lt;/code&gt; which it shows to be &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, in my &lt;code&gt;.js&lt;/code&gt; files it continues to indent 4 spaces. My spacemacs shows &quot;Javascript&quot; for the major mode in the modeline bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on what I am doing wrong/how I can debug this?&lt;/p&gt;&#xA;" OwnerUserId="9540" LastEditorUserId="19102" LastEditDate="2019-07-15T20:03:09.617" LastActivityDate="2019-07-15T20:03:18.873" Title="Unable to Set Javascript Indent on Spacemacs" Tags="|spacemacs|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28157" PostTypeId="1" AcceptedAnswerId="28170" CreationDate="2016-10-27T04:18:55.407" Score="1" ViewCount="835" Body="&lt;p&gt;I initialized a Git repository outside emacs, added and committed the files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if I a file in emacs that is under version control by Git and run &lt;code&gt;C-x v =&lt;/code&gt; emacs tells me &lt;code&gt;This file is not under version control&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems emacs missed that I added this file to Git already. How can I tell emacs that this file (and the whole directory) is already in Git, so that I can use the &lt;code&gt;vc-git-*&lt;/code&gt; commands?&lt;/p&gt;&#xA;" OwnerUserId="9623" LastEditorUserId="9623" LastEditDate="2016-10-27T06:11:24.617" LastActivityDate="2019-09-26T06:54:46.007" Title="vc-git doesn't recognize that file is under version control" Tags="|git|vc|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28160" PostTypeId="2" ParentId="27668" CreationDate="2016-10-27T10:43:00.097" Score="1" Body="&lt;p&gt;If thats indeed gdb-many-windows problem. One can avoid using gdb-many-windows and define similar functionality inside the function gdb-get-source-file. You can modify the source file and build from source, but can also defadvice gdb-get-source-file, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice gdb-get-source-file (after new-setup-gdb-windows activate)&#xA;    (goto-char (point-min))&#xA;  (if (re-search-forward gdb-source-file-regexp nil t)&#xA;      (setq gdb-main-file (read (match-string 1))))&#xA;    (gdb-get-buffer-create 'gdb-stack-buffer)&#xA;  (set-window-dedicated-p (selected-window) nil)&#xA;  (switch-to-buffer gud-comint-buffer)&#xA;  (delete-other-windows)&#xA;     (let ((win0 (selected-window))&#xA;        (win1 (split-window nil nil 'left))      ;code and output&#xA;        (win2 (split-window-below (/ (* (window-height) 2) 3)))     ;stack&#xA;        )&#xA;    (select-window win2)&#xA;    (gdb-set-window-buffer (gdb-stack-buffer-name))&#xA;    (select-window win1)&#xA;    (set-window-buffer&#xA;     win1&#xA;     (if gud-last-last-frame&#xA;         (gud-find-file (car gud-last-last-frame))&#xA;       (if gdb-main-file&#xA;           (gud-find-file gdb-main-file)&#xA;         ;; Put buffer list in window if we&#xA;         ;; can't find a source file.&#xA;         (list-buffers-noselect))))&#xA;    (setq gdb-source-window (selected-window))&#xA;    (let ((win3 (split-window nil (/ (* (window-height) 3) 4)))) ;io&#xA;      (gdb-set-window-buffer (gdb-get-buffer-create 'gdb-inferior-io) nil win3))&#xA;    (select-window win0)&#xA;;;(if gdb-many-windows&#xA;;;gdb-setup-windows is previously called here&#xA;            )&#xA;      (gdb-force-mode-line-update&#xA;       (propertize &quot;ready&quot; 'face font-lock-variable-name-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Right now gdb-get-source-file is doing something similar to the original gdb-many-windows file but with fewer buffers.&lt;/p&gt;&#xA;" OwnerUserId="13594" LastActivityDate="2016-10-27T10:43:00.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28161" PostTypeId="1" CreationDate="2016-10-27T10:43:20.863" Score="6" ViewCount="2562" Body="&lt;p&gt;I'm struggling a bit with yasnippet. My question must be very basic but I would like to modify some snippets but I can't locate them. &#xA;I have for example a snippet &lt;code&gt;style&lt;/code&gt; for &lt;code&gt;html-mode&lt;/code&gt; but it does not appear where it should be that is either under :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d/elpa/yasnippet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.emacs.d/snippets&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My config is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path&#xA;         &quot;~/.emacs.d/elpa/yasnippet-20160801.1142&quot;)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;(add-to-list 'yas-snippet-dirs &quot;~/.emacs.d/snippets&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any would be appreciated!&lt;/p&gt;&#xA;" OwnerUserId="13074" LastActivityDate="2020-02-20T13:17:41.917" Title="yasnippets - finding and modifying some snippets" Tags="|yasnippet|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28162" PostTypeId="1" AcceptedAnswerId="28189" CreationDate="2016-10-27T10:44:35.007" Score="0" ViewCount="480" Body="&lt;p&gt;I am trying to avoid duplicating code and also trying to avoid introducing unnecessary global symbols. So I tried to use &lt;code&gt;let&lt;/code&gt;, &lt;code&gt;dolist&lt;/code&gt; and &lt;code&gt;lambda&lt;/code&gt; when defining the same keys in two different keymaps: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((key (kbd &quot;S-&amp;lt;down&amp;gt;&quot;))&#xA;      (def (lambda ()&#xA;             (interactive)&#xA;             (unless (evil-visual-state-p)&#xA;               (evil-visual-state))&#xA;             (evil-next-line))))&#xA;  (dolist (map '(evil-normal-state-map evil-insert-state-map))&#xA;    (define-key map key def)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here I want &lt;code&gt;S-down&lt;/code&gt; to have the same definition in both &lt;code&gt;evil-normal-state-map&lt;/code&gt; and in &lt;code&gt;evil-insert-state-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives me error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: keymapp, evil-normal-state-map&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastEditorUserId="105" LastEditDate="2022-09-18T17:31:01.597" LastActivityDate="2022-09-18T17:31:01.597" Title="Define key inside dolist" Tags="|key-bindings|keymap|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28163" PostTypeId="1" AcceptedAnswerId="28176" CreationDate="2016-10-27T11:00:28.980" Score="1" ViewCount="62" Body="&lt;p&gt;I'm writing a custom build mode (mybuild-mode) for custom build tool and want  that mode to be autoloaded in case I'm in the folder which contains &lt;code&gt;mybuild.sh&lt;/code&gt; file. Also my mode depends on projectile (so the directory should contain the &lt;code&gt;.projectile&lt;/code&gt; file).&lt;/p&gt;&#xA;" OwnerUserId="9682" LastActivityDate="2016-10-27T16:51:09.140" Title="how to autoload emacs mode if folder contains specific file?" Tags="|projectile|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28164" PostTypeId="2" ParentId="28161" CreationDate="2016-10-27T11:02:19.007" Score="0" Body="&lt;p&gt;Try &lt;code&gt;(setq yas-snippet-dirs '(&quot;~/.emacs.d/snippets&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you miss a snippet, that you've already created, use &lt;code&gt;yas-reload-all&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you don't need the first line.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-27T11:12:21.217" LastActivityDate="2016-10-27T11:12:21.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28165" PostTypeId="1" AcceptedAnswerId="28554" CreationDate="2016-10-27T11:38:03.660" Score="3" ViewCount="433" Body="&lt;p&gt;I'm trying to make &lt;strong&gt;Spacemacs&lt;/strong&gt; and &lt;strong&gt;sr-speedbar&lt;/strong&gt; work together smoothly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Without using Spacemacs&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command buffer is local to each buffer where it is called:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/6SG5B.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6SG5B.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Left is sr-speedbar, right is the main buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If invoke command buffer from sr-speedbar buffer, then it is local to sr-speedbar buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/O5DXs.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O5DXs.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Left is sr-speedbar, right is the main buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;After using Spacemacs:&lt;/strong&gt;&#xA;The command buffer is occupying both of the windows, &#xA;&lt;a href=&quot;https://i.stack.imgur.com/r8RQ5.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/r8RQ5.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And possibly because of this feature, oftentimes, it creates two sr-speedbar buffers, which is very annoying, using list-fontsets:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/dM1DF.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dM1DF.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how to roll back the command buffer to make them act like normal to prevent creating two sr-speedbars?&lt;/p&gt;&#xA;" OwnerUserId="13594" LastActivityDate="2016-11-16T17:08:03.847" Title="Prevent Spacemacs from creating double sr-speedbar" Tags="|spacemacs|commands|speedbar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28166" PostTypeId="1" AcceptedAnswerId="28168" CreationDate="2016-10-27T11:49:58.863" Score="5" ViewCount="1045" Body="&lt;p&gt;Whenever one runs a function/command for which there is already a shortcut, Emacs shows briefly a message in the echo area to recall that there is a shortcut associated with that command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if I run &lt;code&gt;backward-word&lt;/code&gt;, Emacs shows for some seconds the following in the echo area:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You can run the command `backward-word' with M-b&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a mechanism for the reverse of this? i.e., to recall the name of function when one uses a shortcut to revoke a command. I know by the command &lt;code&gt;describe-key&lt;/code&gt; I can find which function corresponds to which shortcut. But it would be interesting to see the name of function every time one runS a shortcut.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="253" LastEditDate="2016-10-31T21:10:41.940" LastActivityDate="2016-11-03T07:33:35.570" Title="How to see the name of the command every time I run it by a shortcut?" Tags="|key-bindings|commands|help|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28167" PostTypeId="2" ParentId="28161" CreationDate="2016-10-27T11:56:34.420" Score="7" Body="&lt;p&gt;Considering your configuration, using &lt;em&gt;elpa&lt;/em&gt;, they are located in &lt;code&gt;~/.emacs.d/elpa/yasnippet-20160801.1142/snippets&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your custom snippets should be at &lt;code&gt;~/.emacs.d/snippets&lt;/code&gt; so they don't get overwritten in each update. Also check the value of the variable &lt;code&gt;yas-snippets-dirs&lt;/code&gt; with &lt;code&gt;Ctr-h v yas-snippets-dir&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8563" LastActivityDate="2016-10-27T11:56:34.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28168" PostTypeId="2" ParentId="28166" CreationDate="2016-10-27T12:20:26.033" Score="7" Body="&lt;p&gt;You can use &lt;code&gt;post-command-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-echo-command-name-hook ()&#xA;  (unless (or (eq this-command 'self-insert-command)&#xA;              (eq this-command 'next-line))&#xA;    (message &quot;%s&quot; this-command)))&#xA;&#xA;(add-hook 'post-command-hook 'my-echo-command-name-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-11-03T07:33:35.570" LastActivityDate="2016-11-03T07:33:35.570" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28169" PostTypeId="2" ParentId="28161" CreationDate="2016-10-27T12:24:01.807" Score="2" Body="&lt;p&gt;If you want to edit a snippet from the mode you are in just press the standard commands :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c &amp;amp; C-v&lt;/code&gt; to view an existing snippet (you should know what name it has)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c &amp;amp; C-n&lt;/code&gt; to create a new snippet for the mode you're in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this way you don't have to care about where the snippets are located, YASnippet should do that automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also open existing/new snippets by clicking on the menu bar YASnippet (if you're using the GUI).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this could help you.&lt;/p&gt;&#xA;" OwnerUserId="13623" LastActivityDate="2016-10-27T12:24:01.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28170" PostTypeId="2" ParentId="28157" CreationDate="2016-10-27T12:32:12.317" Score="2" Body="&lt;p&gt;Emacs caches version control information for each buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you visit a file first, and then &lt;code&gt;git add&lt;/code&gt; it in a terminal, Emacs doesn't know this. You can &lt;code&gt;M-x revert-buffer&lt;/code&gt; to force it to refresh the cache, or kill the buffer and visit the file again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the future, you can register such files from within Emacs, using &lt;code&gt;vc-next-action&lt;/code&gt;, by default bound to &lt;code&gt;C-x v v&lt;/code&gt;. Though if the file is already registered this command will do something else.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-10-27T12:32:12.317" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28171" PostTypeId="2" ParentId="28166" CreationDate="2016-10-27T13:37:21.900" Score="4" Body="&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/ShowKey&quot; rel=&quot;nofollow&quot;&gt;ShowKey&lt;/a&gt; (code: &lt;a href=&quot;https://www.emacswiki.org/emacs/download/showkey.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;showkey.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; does this.  It shows keys and other events as you use them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yes, you can tailor the behavior, to ignore certain event types (e.g., key sequences) for display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two global minor modes defined in &lt;code&gt;showkey.el&lt;/code&gt;, which give you two ways to show keys:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;showkey-tooltip-mode&lt;/code&gt;&lt;/strong&gt;: Show only the &lt;em&gt;last&lt;/em&gt; key used, in a &lt;strong&gt;tooltip&lt;/strong&gt;. This is refreshed with each such event.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;showkey-log-mode&lt;/code&gt;&lt;/strong&gt;: Show a log of such events, in a separate frame. It is refreshed with each new event, and it is kept on top of other frames without stealing the input focus.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Events that raise an error are not shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few user options control the behavior:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;showkey-tooltip-ignored-events&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;showkey-log-ignored-events&lt;/code&gt;&lt;/strong&gt; are each a list of regexps to match against events that you do &lt;em&gt;not&lt;/em&gt; want to show, for &lt;code&gt;showkey-tooltip-mode&lt;/code&gt; and &lt;code&gt;showkey-log-mode&lt;/code&gt;, respectively.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;showkey-log-frame-alist&lt;/code&gt;&lt;/strong&gt; is an association list of frame parameters for the logging frame. (It is not used for &lt;code&gt;showkey-tooltip-mode&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;showkey-log-erase-keys&lt;/code&gt;&lt;/strong&gt; is a list of keys that will each &lt;em&gt;restart logging&lt;/em&gt;, that is, erase the log and start it over. For example, if you add the &lt;code&gt;RET&lt;/code&gt; key to it (&lt;code&gt;?\r&lt;/code&gt;) then each time it is pressed the log is restarted from scratch. By default, the list is empty. (It is not used for &lt;code&gt;showkey-tooltip-mode&lt;/code&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;showkey-tooltip-timeout&lt;/code&gt;&lt;/strong&gt; is the number of seconds to show the&#xA;tooltip, before hiding it.  (It is also hidden upon any user&#xA;event, such as hitting another key.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-27T13:53:36.243" LastActivityDate="2016-10-27T13:53:36.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28172" PostTypeId="1" CreationDate="2016-10-27T15:55:50.140" Score="0" ViewCount="109" Body="&lt;p&gt;Following this thread:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/39808820/replacing-on-mouse-selected-area-in-emacs&quot;&gt;https://stackoverflow.com/questions/39808820/replacing-on-mouse-selected-area-in-emacs&lt;/a&gt;&lt;br&gt;I can highlight an area, and do replace only on this area. Great! Now, I want to do several replacements...&lt;br&gt;The issue is that after I input ! for all occurrences, I need to re-highlight the area again and again. I think that there is a way to avoid doing the re-highlight, but don't know how. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13534" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-10-27T18:50:48.717" Title="Keep selection on/reselect for multiple query-replace sessions" Tags="|highlighting|query-replace|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28173" PostTypeId="2" ParentId="27957" CreationDate="2016-10-27T16:05:32.540" Score="1" Body="&lt;p&gt;I think you may find what you need somewhere in the autocompletion layer documentation.  Have a look at this documentation by pressing &quot;spacebar h spacebar&quot; and then typing &quot;auto-completion&quot;. or look at this link&#xA;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bcompletion/auto-completion&quot; rel=&quot;nofollow&quot;&gt;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bcompletion/auto-completion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use company-mode, but currently I'm happy typing &quot;spacebar i s&quot; whenever I want to add a yasnippet.&lt;/p&gt;&#xA;" OwnerUserId="11133" LastActivityDate="2016-10-27T16:05:32.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28174" PostTypeId="1" CreationDate="2016-10-27T16:09:11.283" Score="1" ViewCount="137" Body="&lt;p&gt;I am starting to use emacs guy (precisely this &lt;a href=&quot;https://emacsformacosx.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://emacsformacosx.com&lt;/a&gt;) and I am not always getting monospaced charters as I get in emacs when using terminal. I have tried putting this in my .emacs (found in the web)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Only change sectioning colour&#xA;(setq font-latex-fontify-sectioning 1.0)&#xA;(setq font-latex-fontify-sectioning 'color)&#xA;(setq font-latex-slide-title-face 1.0)&#xA;;; super-/sub-script on baseline&#xA;(setq font-latex-script-display (quote (nil)))&#xA;;; Do not change super-/sub-script font&#xA;;; Exclude bold/italic from keywords&#xA;(setq font-latex-deactivated-keyword-classes&#xA;'(&quot;italic-command&quot; &quot;bold-command&quot; &quot;italic-declaration&quot; &quot;bold-declaration&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I got some improvements but as you can see in the images I have not solved my problem yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I expect:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tluG5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tluG5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I get (you can see that &quot;Theoretical introduction&quot; is small and not vertically aligned to other characters). What can I do?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/QEA8x.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QEA8x.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to solve it?&lt;/p&gt;&#xA;" OwnerUserId="13656" LastActivityDate="2016-10-27T20:39:19.587" Title="auctex beamer, set all characters to a fixed size" Tags="|auctex|fonts|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28176" PostTypeId="2" ParentId="28163" CreationDate="2016-10-27T16:51:09.140" Score="1" Body="&lt;p&gt;I assume that your &lt;code&gt;mybuild-mode&lt;/code&gt; is actually a minor mode that should be loaded additionally to the major mode for your source files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case you can use &lt;code&gt;find-file-hook&lt;/code&gt; to activate that minor mode depending on the presence of &lt;code&gt;mybuild.sh&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-minor-mode mybuild-mode&#xA;  &quot;Mode activated if mybuild.sh file is present in the same directory.&quot;&#xA;  :lighter &quot; ⚒&quot;&#xA;  (if mybuild-mode&#xA;      (message &quot;Doing some stuff at start-up.&quot;)&#xA;    (message &quot;Doing some stuff at shutting-down.&quot;)))&#xA;&#xA;(defun mybuild-start-maybe ()&#xA;  &quot;Starts mybuild-mode if mybuild.sh is present in `default-directory'.&quot;&#xA;  (when (file-readable-p &quot;mybuild.sh&quot;)&#xA;    (mybuild-mode t)))&#xA;&#xA;(add-hook 'find-file-hook #'mybuild-start-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-10-27T16:51:09.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28177" PostTypeId="1" AcceptedAnswerId="28178" CreationDate="2016-10-27T16:52:24.740" Score="3" ViewCount="171" Body="&lt;p&gt;I'm looking for a way to &lt;strong&gt;mix tabs and spaces&lt;/strong&gt; in my cc-styles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whilst I question the sanity of this coding style, and wouldn't ever choose to use it had I the choice &lt;a href=&quot;https://softwareengineering.stackexchange.com/a/197839/79828&quot;&gt;(seems other people share my view)&lt;/a&gt;, in this instance I don't have a choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My company has the following coding style wrt tabs and spaces:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Indentation should be made using tabs&lt;/li&gt;&#xA;&lt;li&gt;Alignment should be made using spaces&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As an example, with &lt;code&gt;-&amp;gt;&lt;/code&gt; denoting a tab, the following are valid snippets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tabs for indentation, spaces for vertical alignment of variable names and initialisation:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;struct Foo&#xA;{&#xA;-&amp;gt; int    bar  = 0;&#xA;-&amp;gt; char   baz  = 'c';&#xA;-&amp;gt; double fizz = .1;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tabs for indentation, spaces for vertical alignment of function parameters:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void some_function(int foo,&#xA;                   double bar,&#xA;                   char baz)&#xA;{&#xA;-&amp;gt; if (foo == 0)&#xA;-&amp;gt; {&#xA;-&amp;gt; -&amp;gt; bar *= 2;&#xA;-&amp;gt; }&#xA;-&amp;gt; ...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tabs for indentation, spaces for vertical alignment of logical statements:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void some_function(int foo,&#xA;                   double bar,&#xA;                   char fizzbuzz)&#xA;{&#xA;-&amp;gt; if (foo      == 0 &amp;amp;&amp;amp;&#xA;-&amp;gt;     fizzbuzz == 'a') // note 1 leading tab for indentation level, then spaces&#xA;-&amp;gt; {&#xA;-&amp;gt; -&amp;gt; bar *= 2;&#xA;-&amp;gt; }&#xA;-&amp;gt; ...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use the &lt;a href=&quot;https://github.com/typester/emacs/blob/master/lisp/align.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;align&lt;/a&gt; package by John Wiegley in order to affect the vertical alignment of variables in the example above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do I need to have in my cc-styles in order to conform to my company's coding standards?&lt;/p&gt;&#xA;" OwnerUserId="10922" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:57.267" LastActivityDate="2016-10-27T17:50:58.547" Title="Update cc-style to use a mix of tabs and spaces, depending on context?" Tags="|cc-mode|align|style|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28178" PostTypeId="2" ParentId="28177" CreationDate="2016-10-27T17:50:58.547" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/jcsalomon/smarttabs&quot; rel=&quot;nofollow&quot;&gt;Smart Tabs&lt;/a&gt; is a mode that will do what you want -- indent with tabs, align with spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;https://www.emacswiki.org/emacs/SmartTabs&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt;, once you install it, you can disable it normally, but enable it in c-mode this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;&#xA;(add-hook 'c-mode-common-hook&#xA;          (lambda () (setq indent-tabs-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-10-27T17:50:58.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28179" PostTypeId="2" ParentId="28172" CreationDate="2016-10-27T18:26:56.717" Score="1" Body="&lt;p&gt;One option is to temporarily narrow the buffer to the region. Mark the region you are interested in, and then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x n n&lt;/code&gt; to &lt;code&gt;narrow-to-region&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;li&gt;Jump to the top of the buffer (e.g. &lt;code&gt;M-&amp;lt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Query/replace (&lt;code&gt;M-%&lt;/code&gt;, ... &lt;code&gt;!&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Jump back to the top of the buffer (e.g. &lt;code&gt;M-&amp;lt;&lt;/code&gt; again, or &lt;code&gt;C-u C-SPC&lt;/code&gt; to pop the mark.)&lt;/li&gt;&#xA;&lt;li&gt;Do more query/replace operations, or whatever else you want with the region.&lt;/li&gt;&#xA;&lt;li&gt;When you're done, use &lt;code&gt;C-x n w&lt;/code&gt; to &lt;code&gt;widen&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-10-27T18:26:56.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28180" PostTypeId="1" CreationDate="2016-10-27T18:42:03.340" Score="9" ViewCount="2289" Body="&lt;p&gt;I use &lt;code&gt;org-edit-special&lt;/code&gt; and it's really convenient, when editing source code, that's stored in org files. However I often only want to copy some code and I'm used to the highlighting of &lt;code&gt;highlight-parentheses-mode&lt;/code&gt; when I'm reading elisp and I only want it to be turned on in this situation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example is line numbers in large babel blocks. I avoid using files for my own code and I have several blocks that don't fit on my screen. As I don't use nlinum in my org files this would be nice to additionally emphasize large code blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to enable the features of minor modes in org buffers, but only activate them for certain blocks ? Just like &lt;code&gt;org-src-fontify-natively&lt;/code&gt; enables syntax highlighting in source code blocks.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-10-28T08:53:04.163" LastActivityDate="2020-01-01T12:32:47.090" Title="Is it possible to enable minor modes in org babel blocks?" Tags="|org-mode|org-babel|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28181" PostTypeId="2" ParentId="28172" CreationDate="2016-10-27T18:50:48.717" Score="0" Body="&lt;p&gt;One shortcut that may be useful is C-x C-x &lt;code&gt;exchange-point-and-mark&lt;/code&gt;. This will reactivate the last region, except that it extends only so far as the current point. Assuming you left the cursor where it was after the last interactive replacement, that may or may not be all the way to the end of the prior replacement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not sufficient, you may consider shortcuts to select syntactic units. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;C-x h (entire buffer)&lt;/li&gt;&#xA;&lt;li&gt;M-C-h (current defun)&lt;/li&gt;&#xA;&lt;li&gt;M-h (paragraph)&lt;/li&gt;&#xA;&lt;li&gt;Or, use &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow&quot;&gt;expand-region&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2016-10-27T18:50:48.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28182" PostTypeId="1" AcceptedAnswerId="28185" CreationDate="2016-10-27T19:31:02.627" Score="1" ViewCount="190" Body="&lt;p&gt;I want to be able to kill selected text and yank it to the bottom of the buffer from which it was killed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do this efficiently, meaning not with C-k, moving point to end of buffer, C-y?&lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="105" LastEditDate="2016-10-27T19:54:24.883" LastActivityDate="2016-10-30T09:14:11.003" Title="Kill and yank (append?) text from buffer to bottom of same buffer" Tags="|yank|kill-text|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28183" PostTypeId="1" AcceptedAnswerId="28211" CreationDate="2016-10-27T19:46:10.660" Score="2" ViewCount="238" Body="&lt;p&gt;Why does my code generate the error when used with org-table?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;No error message when code used outside of &lt;code&gt;org-table&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: get-country-or-area-name&#xA;#+HEADER: :var iso-alpha2-code=&quot;ca&quot; &#xA;#+HEADER: :var dc-list='((US . &quot;United States of America&quot;) (CA . &quot;Canada&quot;) (BR . &quot;Brazil&quot;))&#xA;#+BEGIN_SRC elisp &#xA;  (setq s (upcase (substring iso-alpha2-code 0 2)))&#xA;  (cdr (assoc-string `,s dc-list)) &#xA;#+END_SRC&#xA;&#xA;#+NAME: Brazil&#xA;#+CALL: get-country-or-area-name(iso-alpha2-code=&quot;br&quot;)&#xA;&#xA;#+RESULTS: Brazil&#xA;: Brazil&#xA;&#xA;#+NAME: Canada&#xA;#+CALL: get-country-or-area-name(iso-alpha2-code=&quot;ca&quot;)&#xA;&#xA;#+RESULTS: Canada&#xA;: Canada&#xA;&#xA;#+NAME: United-States-of-America&#xA;#+CALL: get-country-or-area-name(iso-alpha2-code=&quot;us&quot;)&#xA;&#xA;#+RESULTS: United-States-of-America&#xA;: United States of America&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Error generated when called in &lt;code&gt;#+TBLFM:&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The error is generated when &lt;code&gt;org-table-calc-current-TBLFM&lt;/code&gt; attempts to delete the temporary &lt;code&gt;#+TBLFM:&lt;/code&gt; line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ISO Alpha 2 Code | Country or Area Name     |&#xA;|------------------+--------------------------|&#xA;| BR               |                          |&#xA;| CA               |                          |&#xA;| US               |                          |&#xA;#+TBLFM: $2='(org-sbe get-country-or-area-name (iso-alpha2-code $$1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ISO Alpha 2 Code | Country or Area Name     |&#xA;|------------------+--------------------------|&#xA;| BR               | Brazil                   |&#xA;| CA               | Canada                   |&#xA;| US               | United States of America |&#xA;#+TBLFM: $2='(org-sbe get-country-or-area-name (iso-alpha2-code $$1))&#xA;#+TBLFM: $2='(org-sbe get-country-or-area-name (iso-alpha2-code $$1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Excerpt from &lt;code&gt;*Messages*&lt;/code&gt; buffer:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Re-applying formulas to 3 lines&amp;#x2026; done&lt;br&gt;&#xA;  Re-applying formulas&amp;#x2026; done&lt;br&gt;&#xA;  org-table-calc-current-TBLFM: Wrong type argument: integer-or-marker-p, &quot;US&quot;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Version Info&lt;/h1&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-mode version: 8.3.5&lt;br&gt;&#xA;  emacs version: GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="105" LastEditDate="2022-09-18T17:29:48.067" LastActivityDate="2022-09-18T17:29:48.067" Title="Why is org-table-calc-current-TBLFM throwing Wrong type argument: integer-or-marker-p Error?" Tags="|org-mode|org-babel|org-table|dynamic-scoping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28184" PostTypeId="1" AcceptedAnswerId="28186" CreationDate="2016-10-27T19:46:28.063" Score="14" ViewCount="5324" Body="&lt;p&gt;On:  Aquamacs 3.3  GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109))&#xA;of 2016-09-19&#xA;in mac osx sierra&lt;/p&gt;&#xA;&lt;p&gt;I changed my ~/Library/Preferences/Aquamacs Emacs/Preferences.el&#xA;with the below:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq python-version-checked t)&#xA;(setq py-python-command &amp;quot;python3.5&amp;quot;)&#xA;&#xA;(eval-after-load &amp;quot;org&amp;quot;&#xA;  '(org-babel-do-load-languages&#xA;    'org-babel-load-languages&#xA;    '((sh . t)&#xA;      (python . t)&#xA;      (emacs-lisp . t)&#xA;      (ditaa . t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;but it still fails to point to python 3.5.&#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13799" LastEditorUserId="23812" LastEditDate="2021-04-04T05:11:45.297" LastActivityDate="2021-04-04T05:11:45.297" Title="org-mode: how can i point to python3.5 in my org-mode doc?" Tags="|org-mode|python|aquamacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28185" PostTypeId="2" ParentId="28182" CreationDate="2016-10-27T19:48:31.893" Score="1" Body="&lt;p&gt;I don't think there's anything built-in that's more efficient than this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;select text&lt;/li&gt;&#xA;&lt;li&gt;kill selection with &lt;code&gt;C-w&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;move to end of buffer with &lt;code&gt;M-&amp;gt;&lt;/code&gt; (i.e., &lt;code&gt;end-of-buffer&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;yank &lt;code&gt;C-y&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;return to where I started with &lt;code&gt;C-u &amp;lt;space&amp;gt; &amp;lt;space&amp;gt;&lt;/code&gt; &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you do this a lot, you can wrap these operations into a function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-yank-at-end (beg end)&#xA;  (interactive &quot;r&quot;)&#xA;  (save-excursion&#xA;    (let ((target (kill-region beg end )))&#xA;      (end-of-buffer)&#xA;      (insert &quot;\n&quot;)&#xA;      (yank))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function assumes you've got an active selection before you call it. It also adds a newline before it yanks the selection.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-10-27T20:18:42.360" LastActivityDate="2016-10-27T20:18:42.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28186" PostTypeId="2" ParentId="28184" CreationDate="2016-10-27T20:22:54.970" Score="17" Body="&lt;p&gt;I discovered that just setting in the file:  ~/Library/Preferences/Aquamacs Emacs/Preferences.el&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(setq org-babel-python-command &quot;python3&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does the job.  However, i don't really understand why it worked here and not in the ob-python.el file directly.&#xA;If anyone has a view, please share.&lt;/p&gt;&#xA;" OwnerUserId="13799" LastActivityDate="2016-10-27T20:22:54.970" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28187" PostTypeId="2" ParentId="28180" CreationDate="2016-10-27T20:30:19.657" Score="4" Body="&lt;p&gt;After some comments and some modifications of the question it turned out  that this is not the expected answer to the question. Nevertheless, &lt;strong&gt;applying local variables to source code blocks&lt;/strong&gt; when they are edited with &lt;code&gt;org-edit-special&lt;/code&gt; is very useful. So I do not delete this answer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I already use local variables in source blocks for some time.&#xA;Activating minor modes is one of the use cases for file local variables.&#xA;Below I demonstrate how I activate &lt;code&gt;flyspell-mode&lt;/code&gt; within some source code blocks. I think this scheme fits your aim to activate &lt;code&gt;linum&lt;/code&gt; in source code blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the following line to your initialization files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'org-src-mode-hook 'hack-local-variables)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After evaluation of this line you can use local variables in source code blocks with &lt;code&gt;org-edit-special&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should add a page-break (i.e., &lt;kbd&gt;C-q C-l&lt;/kbd&gt;) after the source block. This prevents emacs to interpret the local variables of the source block as local variables of the org-file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some header&#xA;&#xA;#+BEGIN_SRC text&#xA;Netter Text in Deutsch.&#xA;Local Variables:&#xA;ispell-dictionary: &quot;de_DE&quot;&#xA;eval: (flyspell-mode 1)&#xA;End:&#xA;#+END_SRC&#xA;^L&#xA;&#xA;Some org-text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;highlight-parenthesis-mode&lt;/code&gt; why don't you put it into &lt;code&gt;emacs-lisp-mode-hook&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook (lambda () (highlight-parentheses-mode 1)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the best way if you want to have it always when you are editing emacs lisp -- independent on whether you edit it directly or via &lt;code&gt;org-edit-special&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-10-30T09:48:48.033" LastActivityDate="2016-10-30T09:48:48.033" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28188" PostTypeId="2" ParentId="28174" CreationDate="2016-10-27T20:39:19.587" Score="1" Body="&lt;p&gt;AucTeX modifies provides a bunch of customizable faces. You can view and edit them with &lt;code&gt;M-x customize-group font-latex-highlighting-faces&lt;/code&gt;. Go through that list, and untick the 'height' box on any that have it set.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-10-27T20:39:19.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28189" PostTypeId="2" ParentId="28162" CreationDate="2016-10-27T20:53:22.910" Score="0" Body="&lt;p&gt;According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Lisp-Data-Types.html&quot; rel=&quot;nofollow&quot;&gt;Chapter 2&lt;/a&gt; : &lt;em&gt;&quot;Lisp Data Types&quot;&lt;/em&gt;, of the Emacs Lisp manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each object belongs to one and only one primitive type. These types&#xA;  include integer, float, cons, symbol, string, vector, hash-table,&#xA;  subr, and byte-code function, plus several special types, such as&#xA;  buffer, that are related to editing.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Cons-Cell-Type.html#Cons-Cell-Type&quot; rel=&quot;nofollow&quot;&gt;Chapter 2.3.6&lt;/a&gt; : &lt;em&gt;&quot;Cons Cell and List Types&quot;&lt;/em&gt; :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A cons cell is an object that consists of two slots, called the CAR&#xA;  slot and the CDR slot. Each slot can hold any Lisp object. We also say&#xA;  that the CAR of this cons cell is whatever object its CAR slot&#xA;  currently holds, and likewise for the CDR. A list is a series of cons&#xA;  cells, linked together so that the CDR slot of each cons cell holds&#xA;  either the next cons cell or the empty list. The empty list is&#xA;  actually the symbol nil. Because cons cells are so central to Lisp, we&#xA;  also have a word for an object which is not a cons cell. These objects&#xA;  are called atoms.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Format-of-Keymaps.html&quot; rel=&quot;nofollow&quot;&gt;Chapter 21.3&lt;/a&gt; : &lt;em&gt;&quot;Format of Keymaps&quot;&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each keymap is a list whose CAR is the symbol keymap. The remaining&#xA;  elements of the list define the key bindings of the keymap. A symbol&#xA;  whose function definition is a keymap is also a keymap. Use the&#xA;  function keymapp (see below) to test whether an object is a keymap.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I quote an object, I get an object of type &lt;code&gt;symbol&lt;/code&gt;, whereas a keymap is an object of primitive type &lt;code&gt;cons&lt;/code&gt;, type &lt;code&gt;list&lt;/code&gt;, and constructed type &lt;code&gt;keymap&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;define-key&lt;/code&gt; function expects a first argument of type &lt;code&gt;keymap&lt;/code&gt;. This is checked by &lt;code&gt;define-key&lt;/code&gt; using the &lt;code&gt;keymapp&lt;/code&gt; predicate function. If the argument is not of type &lt;code&gt;keymap&lt;/code&gt;, it will throw an exception.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Components.html#Symbol-Components&quot; rel=&quot;nofollow&quot;&gt;Chapter 8.1&lt;/a&gt; : &lt;em&gt;&quot;Symbol Components&quot;&lt;/em&gt; :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each symbol has four components (or “cells”), each of which references&#xA;  another object:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Print name&lt;/strong&gt;&lt;br&gt;&#xA;  The symbol’s name.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Value&lt;/strong&gt;&lt;br&gt;&#xA;  The symbol’s current value as a variable.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;br&gt;&#xA;  The symbol’s function definition. It can also hold a symbol,&#xA;  a keymap, or a keyboard macro.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Property list&lt;/strong&gt;&lt;br&gt;&#xA;  The symbol’s property list.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The print name cell always holds a string, and cannot be changed. Each&#xA;  of the other three cells can be set to any Lisp object.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Eval.html&quot; rel=&quot;nofollow&quot;&gt;Chapter 9.5&lt;/a&gt; : &lt;em&gt;&quot;Eval&quot;&lt;/em&gt; :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Eval&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Most often, forms are evaluated automatically, by virtue of their&#xA;  occurrence in a program being run. On rare occasions, you may need to&#xA;  write code that evaluates a form that is computed at run time, such as&#xA;  after reading a form from text being edited or getting one from a&#xA;  property list. On these occasions, use the eval function. Often eval&#xA;  is not needed and something else should be used instead. For example,&#xA;  to get the value of a variable, while eval works, symbol-value is&#xA;  preferable&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Iteration.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;dolist&lt;/code&gt;&lt;/a&gt; on a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;quoted&lt;/code&gt;&lt;/a&gt; &#xA;list of keymaps, I get a list of objects of type &lt;code&gt;symbol&lt;/code&gt;, whereas each symbol's value slot has a keymap object. Hence, my problem can be solved by passing each symbol's value to &lt;code&gt;define-key&lt;/code&gt;, instead of the symbol itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the comments by @Tobias and @npostavs, there are many ways to solve my problem. For example, we could solve this using either &lt;code&gt;symbol-value&lt;/code&gt;, &lt;code&gt;eval&lt;/code&gt;, or &lt;code&gt;list&lt;/code&gt;. Hence, the following three examples will all pass an object of type &lt;code&gt;keymap&lt;/code&gt; as first argument to &lt;code&gt;lookup-key&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (kmap '(global-map))&#xA;  (message-box &quot;%s&quot; (lookup-key (symbol-value kmap) (kbd &quot;C-h&quot;))))&#xA;(dolist (kmap '(global-map))&#xA;  (message-box &quot;%s&quot; (lookup-key (eval kmap) (kbd &quot;C-h&quot;))))&#xA;(dolist (kmap (list global-map))&#xA;  (message-box &quot;%s&quot; (lookup-key kmap (kbd &quot;C-h&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-10-27T20:53:22.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28190" PostTypeId="1" AcceptedAnswerId="28220" CreationDate="2016-10-27T20:55:39.833" Score="2" ViewCount="1167" Body="&lt;p&gt;Lets say that I am viewing a pdf in emacs which contains a section numbered with roman numerals. How would I jump to page &lt;code&gt;xxii&lt;/code&gt; in that section without doing mental math about what that page's number is according to emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, page &lt;code&gt;71&lt;/code&gt; in that document might be considered page number &lt;code&gt;105&lt;/code&gt; by emacs due to the fact that page &lt;code&gt;1&lt;/code&gt; of the document is actually the 35th page of the pdf, since the first 35 pages were a roman numeral numbered introduction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am fine with using a mode other than DocView as well. &lt;/p&gt;&#xA;" OwnerUserId="13802" LastActivityDate="2016-10-28T17:32:57.803" Title="How to jump to a page in `DocView` mode when a pdf contains a roman numeral numbered introduction?" Tags="|pdf|docview|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28192" PostTypeId="1" CreationDate="2016-10-28T00:18:38.583" Score="1" ViewCount="659" Body="&lt;p&gt;I'm using emacs 24.5.1 on ubuntu 16.04 on a Vaio x64 pc. earlier I ran the emacs tutorial and got through it completely no problem. Then I started playing with the &quot;replace-string&quot; command and now my Meta key no longer works so SOME but not all key commands. M-f, M-b, M-a and M-e work fine and so does M-x &#xA;&#xA;&lt;p&gt;But when I do M-&gt; or M-&amp;lt; I get the following messages (see below). No amount of C-g'ing or hitting the ESC seems to help. What happened? How do I get out of it? How do I avoid getting back into this? &#xA;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;user-error: No M-x tags-search or M-x tags-query-replace in progress [3 times]&#xA;Quit [3 times]&#xA;completing-read-default: Command attempted to use minibuffer while in minibuffer [2 times]&#xA;Quit&#xA;completing-read-default: Command attempted to use minibuffer while in minibuffer [2 times]&#xA;user-error: There is no default tag&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="13803" LastEditorUserId="105" LastEditDate="2016-10-28T00:22:27.413" LastActivityDate="2016-10-28T00:22:27.413" Title="Ubuntu Emacs Meta Key problem related to keys" Tags="|key-bindings|terminal-emacs|input-method|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28193" PostTypeId="2" ParentId="28156" CreationDate="2016-10-28T02:11:32.277" Score="2" Body="&lt;p&gt;Turns out I needed &lt;code&gt;js-indent-level&lt;/code&gt; because I was in &lt;code&gt;js-mode&lt;/code&gt;. Still unsure how I ended up in &lt;code&gt;js-mode&lt;/code&gt; and not &lt;code&gt;js2-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9540" LastEditorUserId="19102" LastEditDate="2019-07-15T20:03:18.873" LastActivityDate="2019-07-15T20:03:18.873" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="28195" PostTypeId="1" AcceptedAnswerId="28196" CreationDate="2016-10-28T02:53:12.847" Score="2" ViewCount="1127" Body="&lt;p&gt;I tried everything but again I'm hitting a wall here. I have one frame split in the middle with a vertical line giving me a window left and right. Now I have Ibuffer open in the left window and I just want to press a key and the selected buffer should open in the right window WITHOUT opening another window. Whatever I do I either get Ibuffer to open the selected buffer in it's own buffer (pressing Return for example) or getting it to open it new window or frame. It seems impossible for it to open it in the already opened window on the right. I'm not a coder so I can't help myself using some lisp.&lt;/p&gt;&#xA;" OwnerUserId="11055" LastActivityDate="2017-03-29T23:06:58.497" Title="Open Ibuffer selected buffer in other existing window" Tags="|window-splitting|ibuffer|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="28196" PostTypeId="2" ParentId="28195" CreationDate="2016-10-28T04:26:52.050" Score="1" Body="&lt;p&gt;This needs more investigation on negative side-effects, but setting &lt;code&gt;display-buffer-base-action&lt;/code&gt; to &lt;code&gt;display-buffer-use-some-window&lt;/code&gt; seem to work. Found hint to it on &#xA;&lt;a href=&quot;https://www.reddit.com/r/emacs/comments/24zu2a/how_do_i_stop_emacs_from_taking_over_my_split/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.reddit.com/r/emacs/comments/24zu2a/how_do_i_stop_emacs_from_taking_over_my_split/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the mentioned variable with the hook from glucas mentioned below seems to work and limits possible side effects to ibuffer. It's a workaround, but better than nothing.&lt;/p&gt;&#xA;" OwnerUserId="11055" LastEditorUserId="11055" LastEditDate="2017-03-29T23:06:58.497" LastActivityDate="2017-03-29T23:06:58.497" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28197" PostTypeId="1" CreationDate="2016-10-28T05:31:21.947" Score="-1" ViewCount="280" Body="&lt;p&gt;I opened a very large file by emacs, and I found it is too slow to go to the top of the buffer by hit &lt;code&gt;M-&amp;lt;&lt;/code&gt;. And I also found that it is normal when I enter the command &lt;code&gt;goto-line 1&lt;/code&gt;. So I want to override the default keybinding like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hao-goto-beginning-of-buffer-quickly ()&#xA;  &quot;Go to beginning of the buffer quickly&quot;&#xA;  (interactive)&#xA;  (goto-line 1)&#xA;  )&#xA;(global-set-key (kbd &quot;M-&amp;lt;&quot;) 'hao-goto-beginning-of-buffer-quickly)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then a weird situation happened. It is still very very slow when I hit &lt;code&gt;M-&amp;lt;&lt;/code&gt;. But it is normal when I directly hit &lt;code&gt;M-x hao-goto-beginning-of-buffer-quickly&lt;/code&gt;. I can not explain how this come? Do you ever come to this problem?&lt;/p&gt;&#xA;" OwnerUserId="13804" LastEditorUserId="13804" LastEditDate="2016-11-08T05:21:52.813" LastActivityDate="2016-11-08T05:21:52.813" Title="cursor movement performance problem in Emacs" Tags="|key-bindings|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28198" PostTypeId="1" AcceptedAnswerId="28225" CreationDate="2016-10-28T05:33:12.420" Score="4" ViewCount="1295" Body="&lt;p&gt;This is something that's been bothering me for  a while. I think I've configured &lt;code&gt;company-mode&lt;/code&gt; backends wrong as I'm also getting company backends when &lt;em&gt;inside&lt;/em&gt; comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/CSRaghunandan/.emacs.d/blob/master/setup-files/setup-company.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;Here&lt;/code&gt;&lt;/a&gt; is my &lt;code&gt;company-mode&lt;/code&gt; config file.&#xA;And here is an example of how I enable &lt;code&gt;company-mode&lt;/code&gt; for specific major modes using a local variable for &lt;code&gt;company-backends&lt;/code&gt; and adding that to the major mode hook. Like so:-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun my-racer-mode-hook ()&#xA;      (set (make-local-variable 'company-backends)&#xA;           '((company-capf company-files company-yasnippet))))&#xA;    (add-hook 'racer-mode-hook 'my-racer-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strike&gt;I configure other major modes very similarly to the snippet above. But, I feel I did a mistake somewhere that's making &lt;code&gt;company-yasnippet&lt;/code&gt; to pop up in the comments also. Can someone please point out where I did wrong ? &lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I get completion from all backends inside the comments, not just &lt;code&gt;company-yasnippet&lt;/code&gt;. Sorry for the confusion.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-10-28T11:17:09.970" LastActivityDate="2016-10-28T19:13:03.387" Title="disable company-mode completion inside comments" Tags="|company-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28199" PostTypeId="2" ParentId="28182" CreationDate="2016-10-28T05:43:06.940" Score="2" Body="&lt;p&gt;I'd rather use standard keyboard short-cuts or the customised solution of @Taylor above, but for completenes sake here are two out of the box Emacs ways:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;append-to-file:&lt;/strong&gt; Save your buffer (so it's only working for buffers with an underlying file) and select a region, then &lt;code&gt;M-x a-t-f&lt;/code&gt; and specifying &lt;em&gt;your-file&lt;/em&gt; will ad the region is at the end of &lt;em&gt;your-file&lt;/em&gt;. (To see this change in the current buffer you have to revert the buffer, which will happen after you start editing and Emacs warns you that your buffer is not updated and you press &lt;code&gt;r&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;append-to-buffer:&lt;/strong&gt; Interactively this appends the region only behind the current &lt;code&gt;point&lt;/code&gt;.  So &lt;code&gt;M-x a-t-b&lt;/code&gt; and specifying &lt;em&gt;your-buffer&lt;/em&gt; doesn't work exactly for the use case above but for appending to other buffers it's very convenient.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2016-10-30T09:14:11.003" LastActivityDate="2016-10-30T09:14:11.003" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28200" PostTypeId="2" ParentId="28092" CreationDate="2016-10-28T08:05:43.193" Score="0" Body="&lt;p&gt;Just add a condition &lt;code&gt;EFFORT&amp;gt;0&lt;/code&gt; to the search.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if the current &lt;code&gt;org-mode&lt;/code&gt; buffer contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Example Task 1, with effort&#xA;   :PROPERTIES:&#xA;   :Effort: 1:30&#xA;   :END:&#xA;&#xA;** Example Task 2, without effort&#xA;   :PROPERTIES:&#xA;   :END:&#xA;&#xA;** Example Task 3, with effort&#xA;   :PROPERTIES:&#xA;   :Effort: 3:00&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;C-c a &amp;lt; m EFFORT&amp;gt;0+EFFORT&amp;lt;2&lt;/code&gt; (the first &lt;code&gt;&amp;lt;&lt;/code&gt; is to just restrict the search to the current buffer) returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Headlines with TAGS match: EFFORT&amp;gt;0+EFFORT&amp;lt;2&#xA;Press ‘C-u r’ to search again with new search string&#xA;  b:          Example Task 1, with effort&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you wish to search on efforts of the form &lt;code&gt;0:15&lt;/code&gt; etc. then you should enclose all values in double quotes, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c a &amp;lt; m EFFORT&amp;gt;&quot;0&quot;+EFFORT&amp;lt;&quot;0:30&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2016-10-31T08:11:55.333" LastActivityDate="2016-10-31T08:11:55.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28201" PostTypeId="1" AcceptedAnswerId="28208" CreationDate="2016-10-28T08:15:50.993" Score="3" ViewCount="85" Body="&lt;p&gt;In 25.1 there is (still) no builtin algorithm named &lt;code&gt;filter&lt;/code&gt;. Why? What should I use instead? I think I've read somewhere that a standardized filter algorithm should be added to Emacs.&lt;/p&gt;&#xA;" OwnerUserId="12001" LastActivityDate="2016-10-28T15:11:45.907" Title="Builtin Filter Algorithm" Tags="|filtering|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28202" PostTypeId="1" CreationDate="2016-10-28T08:38:27.343" Score="14" ViewCount="1284" Body="&lt;p&gt;If an error is signalled in Emacs Lisp code, and &lt;code&gt;debug-on-error&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;, I get a backtrace buffer that makes it easy to figure out where the error occurred.  However, for errors that occur while processing a response from the network asynchronously, it would be annoying to have the backtrace buffer pop up, so I'd rather catch the error with &lt;code&gt;condition-case&lt;/code&gt; and log it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when I'm handling an error in &lt;code&gt;condition-case&lt;/code&gt;, is there a way to get access to the backtrace at the point of the error?  Calling the &lt;code&gt;backtrace&lt;/code&gt; function gets the backtrace of the code inside the handler, which is not what I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case e&#xA;    (do-something-that-might-fail)&#xA;  (error&#xA;    (message &quot;%s&quot;&#xA;             ;; This gets the wrong backtrace!&#xA;             (with-temp-buffer&#xA;               (let ((standard-output (current-buffer)))&#xA;                 (backtrace)&#xA;                 (buffer-string))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11" LastEditorUserId="105" LastEditDate="2016-10-28T15:04:58.273" LastActivityDate="2019-04-12T00:07:18.993" Title="Get backtrace from error programmatically" Tags="|debugging|error-handling|backtrace|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28203" PostTypeId="1" AcceptedAnswerId="28205" CreationDate="2016-10-28T08:43:02.487" Score="21" ViewCount="1423" Body="&lt;p&gt;I am editing some file, abc.org, and call org-narrow-to-block to narrow to a code block that I want to edit. For the editing process I have to access another part of abc.org and just want to show it in another window. So I do &quot;C-x 2&quot; and find that the window shows the abc.org, but also narrowed. Is it possible to have two &quot;views&quot; on the file? One narrowed and one not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have checked the seven questions tagged with narrowing and did not find a similar question.&lt;/p&gt;&#xA;" OwnerUserId="970" LastEditorUserId="2096" LastEditDate="2016-10-28T19:50:18.427" LastActivityDate="2021-07-16T00:49:33.890" Title="Can I have two views on a file - one narrowed one not?" Tags="|org-mode|narrowing|indirect-buffers|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28204" PostTypeId="1" CreationDate="2016-10-28T10:49:47.533" Score="3" ViewCount="352" Body="&lt;p&gt;When commenting C-style code like C++, JavaScript etc., I use single-line comments to be able to uncomment a previously commented region selectively, i.e&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// This &#xA;// is&#xA;// a single-line style&#xA;// comment&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I later want to uncomment lines 2 and 3, for example, I would simply select them and uncomment. With multi-line comments &lt;code&gt;/* */&lt;/code&gt;, however, I would first need to uncomment the whole block, then selectively comment the parts excluding those that I wanted to uncomment in the first place. &lt;a href=&quot;https://emacs.stackexchange.com/questions/27683/change-comment-style-in-web-mode&quot;&gt;From this question&lt;/a&gt;, I found out that I can change the comment character to &lt;code&gt;//&lt;/code&gt; by putting in my config&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default web-mode-comment-formats (remove '(&quot;javascript&quot; . &quot;/*&quot;) web-mode-comment-formats))&#xA;(add-to-list 'web-mode-comment-formats '(&quot;javascript&quot; . &quot;//&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This, however, does not change the commenting behavior of web-mode. When I select the desired region and run &lt;code&gt;web-mode-comment-or-uncomment-region&lt;/code&gt;, it still exhibits multi-line behavior and uncomments the whole block instead of the region that I select.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I uncomment just the selected region instead of the whole block? &lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2023-12-10T12:03:50.407" Title="How to set web-mode to use single-line comment style instead of multi-line for JavaScript" Tags="|indentation|web-mode|comment|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28205" PostTypeId="2" ParentId="28203" CreationDate="2016-10-28T11:50:34.913" Score="21" Body="&lt;p&gt;I think you're looking for &lt;code&gt;clone-indirect-buffer-other-window&lt;/code&gt; (bound to &lt;code&gt;C-x 4 c&lt;/code&gt; by default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this makes a linked clone of the buffer so you'll need to remember to kill the cloned buffer as well as the window to avoid accumulating more and more buffers with the same content.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2016-10-28T11:50:34.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28206" PostTypeId="2" ParentId="28154" CreationDate="2016-10-28T12:05:25.710" Score="1" Body="&lt;p&gt;The following code will hide the &quot;array[&quot; and &quot;]&quot; parts using the &lt;code&gt;invisible&lt;/code&gt; text property. It is a different approach compared to using &lt;code&gt;compose-region&lt;/code&gt;, as suggested in the question.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-hide-array ()&#xA;  (make-variable-buffer-local 'font-lock-extra-managed-props)&#xA;  (add-to-list 'font-lock-extra-managed-props 'invisible)&#xA;  (font-lock-add-keywords nil&#xA;                          '((&quot;\\(\\_&amp;lt;array\\_&amp;gt;\\[\\)[a-zA-Z0-9_]+\\(\\]\\)&quot;&#xA;                             (1 '(face nil invisible t))&#xA;                             (2 '(face nil invisible t))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can add this function to a suitable major mode hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;compose-region&lt;/code&gt; would probably not be a good idea -- the replacement text would probably not be editable, so you would have to disable the font-lock rule from time to time to edit your source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the function matched only simple cases, where the array is indexed by a simple variable or constant. If you would like to handle the case with complex expression (maybe even nested occurrences of &lt;code&gt;array&lt;/code&gt;), you would need to replace the regexp with an elisp function to do the match (using tools like &lt;code&gt;forward-sexp&lt;/code&gt;). It can either apply the &lt;code&gt;invisible&lt;/code&gt; text property itself or set up a &quot;fake&quot; match data structure and continue using the font-lock rule as is.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-10-28T12:05:25.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28207" PostTypeId="1" AcceptedAnswerId="28218" CreationDate="2016-10-28T13:37:39.137" Score="1" ViewCount="3207" Body="&lt;p&gt;I've got some Python source code blocks in my Org mode document and when I print lists as output I get an org table of one row with all elements (regardless of whether I create a session or not):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session&#xA;list = [1, 2, 3, 4]&#xA;list&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| 1 | 2 | 3 | 4 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For long lists this is inconvenient (also when exporting to LaTeX/PDF, for example). Is there a way to change the output to one column, multiple rows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried adding &lt;code&gt;:results list&lt;/code&gt; to the source block header, which sort of gives me what I want. Nevertheless, a table is preferred over a list.&lt;/p&gt;&#xA;" OwnerUserId="421" LastActivityDate="2016-10-28T17:19:19.120" Title="Getting Python list output into column table instead of row" Tags="|org-mode|org-babel|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28208" PostTypeId="2" ParentId="28201" CreationDate="2016-10-28T13:59:14.277" Score="6" Body="&lt;p&gt;My crystal ball tells me that you want&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'seq)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;... (seq-filter ...) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;seq&lt;/code&gt; package is built-in, even though you have to say explicitly when you want to use it.  Of course it's still not called &lt;code&gt;filter&lt;/code&gt;, you may say, so you additionally need&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'filter #'seq-filter)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;tho I'd advise against doing that.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-28T13:59:14.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28209" PostTypeId="1" AcceptedAnswerId="28216" CreationDate="2016-10-28T14:18:44.247" Score="10" ViewCount="4524" Body="&lt;p&gt;I have a long document with 10 tables, and I want to to have a summary table at the end of the document. Something like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tab1&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Nº | Description | Value |&#xA;+----+-------------+-------+&#xA;|...                       |&#xA;+----+-------------+-------+&#xA;|    | TOTAL       |   XXX |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tab10&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Nº | Description | Value |&#xA;+----+-------------+-------+&#xA;|...                       |&#xA;+----+-------------+-------+&#xA;|    | TOTAL       |   XXX |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;tab-summary&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Description      | Value |&#xA;+------------------+-------|&#xA;| Total of Table 1 |   XXX |&#xA;| Total of Table 2 |   XXX |&#xA;| ...                      |&#xA;+------------------+-------|&#xA;| Grand Total      |   XXX |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to reference the total of each table, instead of manually coping the results in the summary table?&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="14825" LastEditDate="2022-11-05T01:12:27.963" LastActivityDate="2022-11-05T01:12:27.963" Title="Reference cells of other tables in org-mode table" Tags="|org-mode|org-table|spreadsheet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28210" PostTypeId="2" ParentId="28105" CreationDate="2016-10-28T14:41:16.710" Score="-1" Body="&lt;p&gt;EDIT: This answer no longer works, with more recent versions of the &lt;code&gt;bind-keys&lt;/code&gt; package.&lt;/p&gt;&#xA;&lt;p&gt;Just put the maps in a list, like so:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(bind-keys :map (org-mode-map emacs-lisp-mode-map)&#xA;           :prefix-map f14-prefix-map&#xA;           :prefix &amp;quot;&amp;lt;f14&amp;gt;&amp;quot;&#xA;           (&amp;quot;x&amp;quot; . my-elisp-indent)&#xA;           (&amp;quot;y&amp;quot; . paredit-open-round)&#xA;           (&amp;quot;z&amp;quot; . paredit-kill))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;One caveat: Last time I checked, the &lt;code&gt;bind-keys&lt;/code&gt; handler for &lt;code&gt;use-package&lt;/code&gt; doesn't recognize this syntax, so this won't work in a &lt;code&gt;:bind&lt;/code&gt; statement inside &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8647" LastEditorUserId="8647" LastEditDate="2020-08-08T14:37:13.940" LastActivityDate="2020-08-08T14:37:13.940" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="28211" PostTypeId="2" ParentId="28183" CreationDate="2016-10-28T14:55:03.930" Score="2" Body="&lt;p&gt;Ah, very nice. Remember that elisp is dynamically scoped, so any function that you call can see and overwrite any variable you define, and any function that you write can do the same for any variable defined anywhere in the call stack.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, &lt;code&gt;org-table-calc-current-TBLFM&lt;/code&gt; defines two variables &lt;code&gt;s&lt;/code&gt; and &lt;code&gt;e&lt;/code&gt; to hold the start and end positions of the temporary formula. After the table is recalculated it uses those markers to delete the temporary formula. However, your source block sets &lt;code&gt;s&lt;/code&gt; to a string, and this overwrites the marker held by &lt;code&gt;org-table-calc-current-TBLFM&lt;/code&gt;. You can see in the error message that it expected a marker and got the string &lt;code&gt;&quot;US&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix it, just define your own local variable rather than overwriting someone else's. It's still dynamically scoped, but it will shadow the other variable of the same name and then go away once your source block (aka a function) is done:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: get-country-or-area-name&#xA;#+HEADER: :var iso-alpha2-code=&quot;ca&quot;&#xA;#+HEADER: :var dc-list='((US . &quot;United States of America&quot;) (CA . &quot;Canada&quot;) (BR . &quot;Brazil&quot;))&#xA;#+BEGIN_SRC elisp&#xA;  (let ((s (upcase (substring iso-alpha2-code 0 2))))&#xA;    (cdr (assoc-string s dc-list)))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-28T14:55:03.930" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28212" PostTypeId="2" ParentId="28203" CreationDate="2016-10-28T15:03:54.673" Score="5" Body="&lt;p&gt;That is precisely the purpose of library &lt;a href=&quot;https://www.emacswiki.org/emacs/NarrowIndirect&quot; rel=&quot;noreferrer&quot;&gt;Narrow Indirect&lt;/a&gt; (&lt;a href=&quot;http://www.emacswiki.org/emacs/download/narrow-indirect.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;narrow-indirect.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gives you narrowing commands that create an indirect buffer that is a clone of the current buffer and that is narrowed to a particular portion of it. You can narrow to the current defun, active region, or current page.&#xA;Suggested key bindings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ctl-x-4-map &quot;nd&quot; 'ni-narrow-to-defun-other-window)&#xA;(define-key ctl-x-4-map &quot;nn&quot; 'ni-narrow-to-region-other-window)&#xA;(define-key ctl-x-4-map &quot;np&quot; 'ni-narrow-to-page-other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It offers two ways to distinguish indirect buffers from non-indirect buffers, for the indirect buffers it creates:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The buffer name of an indirect narrowed buffer starts with a prefix that you can set using option &lt;strong&gt;&lt;code&gt;ni-buf-name-prefix&lt;/code&gt;&lt;/strong&gt;. The default value is &lt;strong&gt;&lt;code&gt;I-&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The name of an indirect narrowed buffer is highlighted in the mode line using face &lt;strong&gt;&lt;code&gt;ni-mode-line-buffer-id&lt;/code&gt;&lt;/strong&gt; instead of face &lt;code&gt;mode-line-buffer-id&lt;/code&gt;. (To turn this off, just customize the former to be the same as the latter.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Such an indirect buffer gives you a different view of a portion of the buffer, or even of the whole buffer (use &lt;code&gt;C-x h C-x 4 n n&lt;/code&gt;). It always has the same text and text properties, but otherwise it is pretty independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, you can kill an indirect buffer without affecting its base buffer. You will likely want to kill indirect narrowed buffers rather than widening them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Emacs manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html&quot; rel=&quot;noreferrer&quot;&gt;Indirect Buffers&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-28T15:03:54.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28213" PostTypeId="2" ParentId="28201" CreationDate="2016-10-28T15:11:45.907" Score="3" Body="&lt;p&gt;Does it need to be &quot;named &lt;code&gt;filter&lt;/code&gt;&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Stefan mentions, &lt;code&gt;seq-filter&lt;/code&gt; is available in Emacs 25.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Earlier releases, going back to almost forever, have functions &lt;code&gt;remove-if&lt;/code&gt; and &lt;code&gt;remove-if-not&lt;/code&gt;, in library &lt;code&gt;cl.el&lt;/code&gt;. Recent releases provide the same functions under the names &lt;code&gt;cl-remove-if&lt;/code&gt; and &lt;code&gt;cl-remove-if-not&lt;/code&gt;, in library &lt;code&gt;cl-seq.el&lt;/code&gt; (so you need not load library &lt;code&gt;cl.el&lt;/code&gt; at runtime, to get them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of these do essentially the same thing, and probably the same thing as what you are requesting (whose behavior is not really specified). You can of course name any of them &quot;&lt;code&gt;filter&lt;/code&gt;&quot; using &lt;code&gt;defalias&lt;/code&gt;, if you want.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-28T15:11:45.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28214" PostTypeId="1" AcceptedAnswerId="28221" CreationDate="2016-10-28T15:56:36.983" Score="2" ViewCount="518" Body="&lt;p&gt;So, that's it. I am writing a lot of LaTeX, and lately emacs is hanging (becoming unresponsive) on almost every word I type, and I have to press C-g to regain control. It started happening around 4 weeks ago. At first it happened less frequently (once or twice a day) and it got worst and worst.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 25.1 (compiled from source with default options), on Ubuntu Gnome 16.04 LTS. I use Prelude configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been using Emacs without a problem for more than 5 years. Never had this kind of problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions is: how can I identify what is the source of the problem. What keeps making my Emacs hang?&lt;/p&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2016-10-28T18:05:27.393" Title="Emacs is hanging on almost every word I type. How to identify the problem?" Tags="|debug|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28215" PostTypeId="2" ParentId="28119" CreationDate="2016-10-28T15:58:46.260" Score="2" Body="&lt;p&gt;After some tinkering, I was able to trace the problem to emacs wrongly recognizing the column in the trace output as the line number. All I had to do was add a new regexp to &lt;code&gt;compilation-error-regexp-alist-alist&lt;/code&gt; &lt;a href=&quot;https://benhollis.net/blog/2015/12/20/nodejs-stack-traces-in-emacs-compilation-mode/&quot; rel=&quot;nofollow&quot;&gt;like described in this nice post&lt;/a&gt; (note that I had to restart emacs for the changes to take effect).&lt;/p&gt;&#xA;" OwnerUserId="13447" LastActivityDate="2016-10-28T15:58:46.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28216" PostTypeId="2" ParentId="28209" CreationDate="2016-10-28T16:47:20.287" Score="17" Body="&lt;p&gt;You are looking for &lt;a href=&quot;http://orgmode.org/manual/References.html#index-remote-references-352&quot; rel=&quot;noreferrer&quot;&gt;remote table references&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: tab1&#xA;| Nº  | Description | Value |&#xA;|-----+-------------+-------|&#xA;|     | TOTAL       |     1 |&#xA;&#xA;...&#xA;&#xA;#+TBLNAME: tab10&#xA;| Nº | Description | Value |&#xA;|----+-------------+-------|&#xA;|    | TOTAL       |     2 |&#xA;&#xA;tab-summary&#xA;| Description       | Value |&#xA;|-------------------+-------|&#xA;| Total of Table 1  |     1 |&#xA;| Total of Table 10 |     2 |&#xA;|-------------------+-------|&#xA;| Grand Total       |     3 |&#xA;#+TBLFM: @2$2=remote(tab1,@2$3)::@3$2=remote(tab10,@2$3)::@&amp;gt;$2=vsum(@I$2..@II$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, this question has already an answer there: &lt;a href=&quot;https://emacs.stackexchange.com/questions/19105/how-to-reference-named-table-or-code-block-in-org-mode/19125#19125&quot;&gt;How to reference named table or code block in Org-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can even generate &lt;code&gt;tab-summary&lt;/code&gt; automatically.&#xA;This is easy if formulas can directly be written into table cells.&#xA;The following &lt;code&gt;ctrl-c-ctrl-c-hook&lt;/code&gt; allows you to install all table formulas from the cells.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-table-install-formulas ()&#xA;  &quot;Install formulas in cells starting with = or := at the bottom of the table as #+TBLFM line.&#xA;Do nothing when point is not inside a table.&quot;&#xA;  (interactive)&#xA;  (when (org-table-p)&#xA;    (save-excursion&#xA;      (goto-char (org-table-begin))&#xA;      (org-table-next-field)&#xA;      (while (progn&#xA;           (org-table-maybe-eval-formula)&#xA;           (looking-at &quot;[^|\n]*|\\([[:space:]]*\n[[:space:]]*|\\)?[^|\n]*\\(|\\)&quot;))&#xA;    (goto-char (match-beginning 2)))&#xA;      ))&#xA;  nil)&#xA;&#xA;(add-hook #'org-ctrl-c-ctrl-c-hook #'org-table-install-formulas)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The automatic generation of the total-sum table is shown in the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLNAME: tab1&#xA;| Nº  | Description | Value |&#xA;|-----+-------------+-------|&#xA;|     | TOTAL       |     1 |&#xA;&#xA;...&#xA;&#xA;#+TBLNAME: tab2&#xA;| Nº | Description | Value |&#xA;|----+-------------+-------|&#xA;|    | TOTAL       |     2 |&#xA;&#xA;#+TBLNAME: tab3&#xA;| Nº | Description | Value |&#xA;|----+-------------+-------|&#xA;|    | TOTAL       |     3 |&#xA;&#xA;&#xA;#+BEGIN_SRC emacs-lisp :var basename=&quot;tbl&quot; start=1 stop=3&#xA;(append&#xA; '((&quot;Description&quot; &quot;Value&quot;)&#xA;   hline)&#xA;   (cl-loop for i from start upto stop&#xA;        collect (list (format &quot;Total of Table %d&quot; i) (format &quot;:=remote(tab%d,@&amp;gt;$3)&quot; i)))&#xA;   '(&#xA;     hline&#xA;     (&quot;Grand Total&quot; &quot;:=vsum(@I$2..@II$2)&quot;)))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| Description      | Value               |&#xA;|------------------+---------------------|&#xA;| Total of Table 1 | :=remote(tab1,@&amp;gt;$3) |&#xA;| Total of Table 2 | :=remote(tab2,@&amp;gt;$3) |&#xA;| Total of Table 3 | :=remote(tab3,@&amp;gt;$3) |&#xA;|------------------+---------------------|&#xA;| Grand Total      | :=vsum(@I$2..@II$2) |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The example shows the table as it results from the execution of the emacs lisp source block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have installed the above &lt;code&gt;org-ctrl-c-ctrl-c-hook&lt;/code&gt; place point in the total-sum table and press &lt;kbd&gt;C-c C-c&lt;/kbd&gt; you get the following table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Description      | Value |&#xA;|------------------+-------|&#xA;| Total of Table 1 |     1 |&#xA;| Total of Table 2 |     2 |&#xA;| Total of Table 3 |     3 |&#xA;|------------------+-------|&#xA;| Grand Total      |     6 |&#xA;#+TBLFM: @2$2=remote(tab1,@&amp;gt;$3)::@3$2=remote(tab2,@&amp;gt;$3)::@4$2=remote(tab3,@&amp;gt;$3)::@5$2=vsum(@I$2..@II$2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-10-28T21:59:54.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28217" PostTypeId="1" AcceptedAnswerId="28219" CreationDate="2016-10-28T17:15:27.267" Score="2" ViewCount="138" Body="&lt;p&gt;I'm trying to define the keymap for a major mode but keep getting the error: &lt;code&gt;Wrong type argument: keymapp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun insert-text ()&#xA;  (interactive)&#xA;  (let ((x (read-string &quot;Enter text to be printed: &quot;)))&#xA;    (insert x)))&#xA;&#xA;(defvar test-mode-map&#xA;  (let ((map (make-keymap)))&#xA;    (define-key map (kbd &quot;M-S-RET&quot;) 'insert-text)))&#xA;&#xA;(defun test-mode ()&#xA;  (interactive)&#xA;  (setq major-mode 'test-mode&#xA;    mode-name  &quot;Test Mode&quot;)&#xA;  (use-local-map test-mode-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I read &lt;a href=&quot;https://emacs.stackexchange.com/questions/28162/define-key-inside-dolist&quot;&gt;another question&lt;/a&gt; with a similar error but it doesn't really help.&lt;/p&gt;&#xA;" OwnerUserId="13813" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-10-28T18:14:05.580" Title="Why doesn't my keymap let-binding work?" Tags="|let-binding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28218" PostTypeId="2" ParentId="28207" CreationDate="2016-10-28T17:19:19.120" Score="2" Body="&lt;p&gt;You can output a column vector by mapping each list element to a row element of a new list of lists (matrix):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session&#xA;mylist = [1, 2, 3, 4, 5, 6]&#xA;map( lambda x: [x], mylist )&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| 1 |&#xA;| 2 |&#xA;| 3 |&#xA;| 4 |&#xA;| 5 |&#xA;| 6 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-10-28T17:19:19.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28219" PostTypeId="2" ParentId="28217" CreationDate="2016-10-28T17:28:56.603" Score="3" Body="&lt;p&gt;The problem is in the &lt;code&gt;let&lt;/code&gt;-binding of your &lt;code&gt;defvar&lt;/code&gt; form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;let&lt;/code&gt; will return the value of its last form.  Currently, the&#xA;last form is &lt;code&gt;define-key&lt;/code&gt;, which returns the function symbol&#xA;which you bound to the keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, you want to return the &lt;code&gt;map&lt;/code&gt; you created:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test-mode-map&#xA;  (let ((map (make-keymap)))&#xA;    (define-key map (kbd &quot;M-S-RET&quot;) 'insert-text)&#xA;    map))                           ; need to return the keymap&#xA;&#xA;(keymapp test-mode-map)             ; =&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-10-28T17:28:56.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28220" PostTypeId="2" ParentId="28190" CreationDate="2016-10-28T17:32:57.803" Score="5" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;noreferrer&quot;&gt;pdf-tools&lt;/a&gt; you can type &lt;kbd&gt;M-g l&lt;/kbd&gt; (&lt;code&gt;pdf-view-goto-label&lt;/code&gt;), which asks for a page-label, which is usually equal to the displayed page-number.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-10-28T17:32:57.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28221" PostTypeId="2" ParentId="28214" CreationDate="2016-10-28T18:05:27.393" Score="5" Body="&lt;p&gt;I would approach this a few ways:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, you'll want to identify if the problem reproduces in vanilla (i.e. non-configured, no Prelude) Emacs, or with your configurations.  As Drew mentioned above, use &lt;code&gt;emacs -Q&lt;/code&gt; to launch Emacs without any extra &lt;code&gt;init.el&lt;/code&gt; configuration. If it does not reproduce here, then you're looking for a problem with a package or custom code you load in your configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, if there is an actual error happening that you're then canceling with &lt;code&gt;C-g&lt;/code&gt;, you can enable debugging with &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt;. If it gives you a stack trace when it next hangs, you can use it to identify the cause.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, if it's not an error, it might just be &lt;em&gt;really&lt;/em&gt; slow and need to be profiled. Use &lt;code&gt;M-x profiler-start&lt;/code&gt;, probably choose just the CPU report, reproduce your problem, and then use &lt;code&gt;M-x profiler-report&lt;/code&gt;. Your hang is probably occurring in the code path using the most CPU. Here is the Emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Profiling.html&quot; rel=&quot;noreferrer&quot;&gt;documentation on profiling&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fourth, and this is the longest shot, you could try compiling from the &lt;code&gt;emacs-25&lt;/code&gt; branch instead of the &lt;code&gt;emacs-25.1&lt;/code&gt; tag. This is something I would probably try, but is not very likely to solve your issue. However, if the bug is within Emacs, knowing that it reproduces on the latest code is useful. If you become certain the bug was introduced by changes to the Emacs source code, and you know a version where it did not reproduce, you can use &lt;code&gt;git bisect&lt;/code&gt; and recompile a few times to identify the problem commit. I do not recommend this unless you are 95 percent confident it's a bug in Emacs without any configurations (&lt;code&gt;emacs -Q&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="378" LastActivityDate="2016-10-28T18:05:27.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28222" PostTypeId="1" AcceptedAnswerId="28224" CreationDate="2016-10-28T18:30:32.837" Score="6" ViewCount="5303" Body="&lt;p&gt;In &lt;code&gt;evil&lt;/code&gt; mode, I would like &lt;code&gt;C-i&lt;/code&gt; not to work as a tab key, which is the default behavior in Emacs. Also, I would not have the default &lt;code&gt;vi&lt;/code&gt; behavior simulated in Emacs &lt;code&gt;evil&lt;/code&gt; by &lt;code&gt;evil-jump-forward&lt;/code&gt;, but instead I would like to have &lt;code&gt;C-i&lt;/code&gt; work as the &lt;code&gt;scroll-down-command&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, since &lt;code&gt;C-i&lt;/code&gt; is mapped to &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; by default, and I would like &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; work as the usual &lt;code&gt;indent-for-tab-command&lt;/code&gt;, I need to bind &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; also. Here is a minimal setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-load-list&#xA;      '((evil t)&#xA;        (undo-tree t)&#xA;        (goto-chg t)))&#xA;&#xA;(package-initialize)&#xA;(require 'evil)&#xA;(evil-mode 1)&#xA;(define-key evil-normal-state-map (kbd &quot;C-i&quot;) 'scroll-down-command)&#xA;(define-key evil-normal-state-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) 'indent-for-tab-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem now is that this seems to confuse &lt;code&gt;org-mode&lt;/code&gt;. I think &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; in &lt;code&gt;org-mode&lt;/code&gt; only works correctly if &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; is not bound, in that case &lt;code&gt;org-mode&lt;/code&gt; will rebind it locally to &lt;code&gt;org-cycle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now I am not able to expand subtrees in org-mode. In fact, in &lt;code&gt;org-mode&lt;/code&gt; the &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; key is bound to &lt;code&gt;indent-for-tab-command&lt;/code&gt; instead of the desired &lt;code&gt;org-cycle&lt;/code&gt; command. How to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the solution provided in &lt;a href=&quot;https://stackoverflow.com/q/22878668/2173773&quot;&gt;Emacs, org-mode, evil-mode - TAB key not working&lt;/a&gt; does not work, since I rebind the &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; key.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-10-28T18:38:33.710" Title="How to make &lt;tab&gt; work in org mode when combined with evil mode?" Tags="|org-mode|key-bindings|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28223" PostTypeId="2" ParentId="28032" CreationDate="2016-10-28T18:35:37.100" Score="0" Body="&lt;p&gt;I came up with a hacky solution / workaround to this problem. Instead of using &lt;a href=&quot;https://github.com/syohex/emacs-ac-capf&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ac-capf&lt;/code&gt;&lt;/a&gt; for completion, I used &lt;a href=&quot;https://raw.githubusercontent.com/buzztaiki/auto-complete/master/ac-company.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;ac-company&lt;/code&gt;&lt;/a&gt; to access the &lt;a href=&quot;https://raw.githubusercontent.com/company-mode/company-mode/master/company-capf.el&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;company-capf&lt;/code&gt;&lt;/a&gt; backend of &lt;a href=&quot;http://company-mode.github.io&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;company-mode&lt;/code&gt;&lt;/a&gt;. I put the following code in my init files to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Feed company backends to auto-complete&#xA;(autoload 'ac-company-define-source &quot;ac-company&quot; nil nil 'macro)&#xA;(autoload 'ac-company-prefix &quot;ac-company&quot;)&#xA;...&#xA;(ac-company-define-source ac-source-company-scribble company-capf)&#xA;(add-hook 'scribble-mode-hook '(lambda ()&#xA;                                 (add-to-list 'ac-sources 'ac-source-company-scribble)&#xA;                                 (auto-complete-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reasons that this is hacky are that 1) it doesn't address the issue with &lt;code&gt;ac-capf&lt;/code&gt; 2) this solution borks the auto-complete menu faces and 3) this solution causes an annoying error to appear in the minibuffer on completion and when cycling through completion candidates: &lt;code&gt;Error running timer ‘ac-quick-help’: (wrong-type-argument stringp nil)&lt;/code&gt;. Nonetheless, the error and messed up faces seem to be of no consequence and this solution appears to work fine. &lt;a href=&quot;https://cl.ly/3n3O3h0D1s1k/scribble_auto_complete_solution.mp4&quot; rel=&quot;nofollow&quot;&gt;Here's a screencast showing it in action.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10761" LastActivityDate="2016-10-28T18:35:37.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28224" PostTypeId="2" ParentId="28222" CreationDate="2016-10-28T18:38:33.710" Score="9" Body="&lt;p&gt;It's not 100% clear what you want the &lt;kbd&gt;tab&lt;/kbd&gt; key to do&#xA;when you're in &lt;code&gt;org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you have done is to bind &lt;kbd&gt;tab&lt;/kbd&gt; in &lt;code&gt;evil&lt;/code&gt;'s &quot;global&quot;&#xA;&lt;code&gt;normal&lt;/code&gt;-state keymap.  If you're in &lt;code&gt;normal&lt;/code&gt; state in an &lt;code&gt;org&lt;/code&gt;&#xA;buffer, &lt;kbd&gt;tab&lt;/kbd&gt; will do what &lt;em&gt;you&lt;/em&gt; bound it to do, not to&#xA;the default &lt;code&gt;org-cycle&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;kbd&gt;tab&lt;/kbd&gt; to invoke &lt;code&gt;org-cycle&lt;/code&gt; in &lt;code&gt;org&lt;/code&gt; buffers&#xA;when you're in normal state, you can:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'normal org-mode-map (kbd &quot;&amp;lt;tab&amp;gt;&quot;) #'org-cycle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-10-28T18:38:33.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28225" PostTypeId="2" ParentId="28198" CreationDate="2016-10-28T19:13:03.387" Score="4" Body="&lt;p&gt;Each backend decides whether it works in the given context.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;company-yasnippet&lt;/code&gt; works everywhere (you can counteract this using the keyword &lt;code&gt;:with&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;company-files&lt;/code&gt; works where it sees a beginning of an existing file name.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;company-capf&lt;/code&gt; works where one of the elements in &lt;code&gt;completion-at-point-functions&lt;/code&gt; says it works.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since around 25.1, &lt;code&gt;elisp-completion-at-point&lt;/code&gt; refuses to operate inside strings and comments (except when following a backtick, to complete symbol references).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should probably open an issue at &lt;a href=&quot;https://github.com/racer-rust/emacs-racer/&quot; rel=&quot;nofollow&quot;&gt;emacs-racer&lt;/a&gt; and ask for &lt;code&gt;racer-complete-at-point&lt;/code&gt; to behave similarly.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-10-28T19:13:03.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28226" PostTypeId="2" ParentId="28011" CreationDate="2016-10-29T04:04:16.533" Score="3" Body="&lt;p&gt;You can do this easily if you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/GrepPlus#Grep%2b&quot; rel=&quot;nofollow&quot;&gt;Grep+&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/grep%2b.el&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;grep+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;strong&gt;&lt;code&gt;+&lt;/code&gt;&lt;/strong&gt; in your first &lt;code&gt;*grep*&lt;/code&gt; buffer, followed by &lt;strong&gt;&lt;code&gt;g&lt;/code&gt;&lt;/strong&gt;. The &lt;code&gt;+&lt;/code&gt; renames the first &lt;code&gt;*grep*&lt;/code&gt; buffer by appending &lt;code&gt;&amp;lt;N&amp;gt;&lt;/code&gt; (&lt;code&gt;N&lt;/code&gt;=2,3,...) to it, and it opens a new buffer named &lt;code&gt;*grep*&lt;/code&gt;.  The &lt;code&gt;g&lt;/code&gt; in that buffer then launches a new &lt;code&gt;grep&lt;/code&gt; command there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h k +&lt;/code&gt; tells you this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;+&lt;/code&gt;&lt;/strong&gt; runs the command &lt;strong&gt;&lt;code&gt;grepp-new-grep-buffer&lt;/code&gt;&lt;/strong&gt;, which is an interactive&#xA;      compiled Lisp function in &lt;code&gt;grep+.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;menu-bar grep grepp-new-grep-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(grepp-new-grep-buffer)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Rename current grep buffer and switch to new buffer &lt;code&gt;*grep*&lt;/code&gt;.&#xA;  Current buffer must be a grep buffer.  It is renamed to &lt;code&gt;*grep*&amp;lt;N&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-29T04:10:16.633" LastActivityDate="2016-10-29T04:10:16.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28227" PostTypeId="2" ParentId="22278" CreationDate="2016-10-29T04:35:04.897" Score="1" Body="&lt;p&gt;You can sort the buffers you access in multiple ways, if you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow&quot;&gt;Icicles&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use any command, such as &lt;code&gt;C-x b&lt;/code&gt;, that accesses a buffer by name, you can use &lt;strong&gt;&lt;code&gt;C-,&lt;/code&gt;&lt;/strong&gt; to choose a different sort order for the buffer-name candidates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, these buffer-name sort orders are available, to choose from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;by last display time&#xA;*...* last &#xA;by buffer size&#xA;by major mode name &#xA;by mode-line mode name&#xA;by file/process name &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Besides those sort orders, which are specific to buffer-name completion, the following general sort orders are also available for buffer-name completion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alphabetical&#xA;by 2nd parts alphabetically&#xA;by flx score&#xA;by last display time&#xA;by last use as input&#xA;by previous use alphabetically&#xA;case insensitive&#xA;extra candidates first &#xA;special candidates first&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, you can define your own sort orders.  And you can make any given sort order the default one for a given command or for all buffer-name completion (see user option &lt;code&gt;icicle-buffer-sort&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Buffer-Name_Input&quot; rel=&quot;nofollow&quot;&gt;Icicles - Buffer-Name Input&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-29T04:49:01.920" LastActivityDate="2016-10-29T04:49:01.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28228" PostTypeId="1" AcceptedAnswerId="28243" CreationDate="2016-10-29T05:45:47.423" Score="4" ViewCount="489" Body="&lt;p&gt;The following show the message &quot;something&quot; in the echo area immediately, and this message remains there unless I do a second action (e.g. moving the cursor, executing anther command etc)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;something&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like that the message to not appear immediately, but after a delay of few second (say 2 seconds) and to automatically disappear after few second (say 3 second). Is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be precise I would like that in the first delay of 2 seconds, I would able to see other system messages (if any).&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-10-29T10:09:12.060" LastActivityDate="2016-10-29T17:43:20.073" Title="How to show a message in the echo area not immediately but after a certain delay and to disappear it after a certain delay" Tags="|echo-area|message|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28230" PostTypeId="1" AcceptedAnswerId="28239" CreationDate="2016-10-29T08:01:41.623" Score="1" ViewCount="1336" Body="&lt;p&gt;I want to delete char backwards using &lt;code&gt;C-d&lt;/code&gt;, not the backspace key. I could do it like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;\C-d&quot;) 'delete-backward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I have noticed that in fact backspace points to different functions in different major modes. For example, in lisp-mode it is &lt;code&gt;backward-delete-char-untabify&lt;/code&gt; function, in C mode &lt;code&gt;c-electric-backspace&lt;/code&gt;, in Help mode it is &lt;code&gt;cua-scroll-down&lt;/code&gt;. Is it possible to emulate backspace behaviour with &lt;code&gt;C-d&lt;/code&gt; without remapping it for every major mode separately?&#xA;I also tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-set-key (kbd &quot;\C-d&quot;) (kbd &quot;&amp;lt;DEL&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it obviously turns every &lt;code&gt;C-d&lt;/code&gt; key into &lt;code&gt;&amp;lt;DEL&amp;gt;&lt;/code&gt;, so keybindings such &lt;code&gt;C-c C-d&lt;/code&gt; stop working, making this not a suitable solution either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I am slightly suprised that (as it seems after some googling) not so many people rebind backspace key. You have to take away your hand from home  row every time you need to delete a character! This is so uncomfortable...how do you, Emacs people, delete characters?&lt;/p&gt;&#xA;" OwnerUserId="12293" LastActivityDate="2016-10-29T14:53:16.033" Title="Rebind backspace to C-d for deleting char backwards" Tags="|key-bindings|deletion|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28232" PostTypeId="1" CreationDate="2016-10-29T08:42:37.803" Score="9" ViewCount="1053" Body="&lt;p&gt;In clojure, the comment character is &lt;code&gt;;&lt;/code&gt;. clojure-mode syntax highlighting + color scheme greys comment text out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want emacs to color lines that begin with &lt;code&gt;;-;&lt;/code&gt; with a different color. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is a normal greyed out comment, we use ;; by convention for blocks.&#xA;;  This is a typical grey inline comment, we use ; by convention.&#xA;&#xA;;-; This is recognized as a comment and is normally greyed out.&#xA;;-; I want emacs to recognize this as something a little different and give&#xA;;-; it a different color.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="2808" LastEditorUserId="105" LastEditDate="2016-10-29T17:16:25.380" LastActivityDate="2016-10-31T15:04:31.060" Title="Syntax highlighting for comments starting with specific sequence of characters" Tags="|syntax-highlighting|comment|" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28234" PostTypeId="1" CreationDate="2016-10-29T11:55:02.217" Score="2" ViewCount="1183" Body="&lt;p&gt;I make intensive use of &lt;code&gt;org-mode&lt;/code&gt; and it boosts my productivity significantly. But I'm missing the possibility to adjust the space between headings automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the one hand I want to define the number of lines between headings and subheadings, so that for example headings of the same level are delimited by 1 empty line and headings of different levels by 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the text inside headings is to be positioned consistently.&#xA;It would be ideal If could distinguish between the space that is to be inserted after a heading and the space before. So I can define that the text after a heading starts after 2 lines and the heading after a text has 4 preceding empty lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The perfect solution would be If I could add that function to &lt;code&gt;org-cycle-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-11-06T20:01:43.383" Title="Automatically reformat org buffers" Tags="|org-mode|formatting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28235" PostTypeId="2" ParentId="28230" CreationDate="2016-10-29T12:49:44.007" Score="0" Body="&lt;p&gt;Maybe you can try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key* &quot;C-d&quot; (kbd &quot;&amp;lt;DEL&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(kbd &quot;&amp;lt;DEL&amp;gt;&quot;)&lt;/code&gt; is keyboard macro and a command definition. I guess you can also use something like &lt;code&gt;(lambda () (interactive) (call-interactively (key-binding (kbd &quot;&amp;lt;DEL&amp;gt;&quot;))))&lt;/code&gt; if you prefer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bind-key*&lt;/code&gt; will bind &lt;code&gt;C-d&lt;/code&gt; and override any mode-specific binding of &lt;code&gt;C-d&lt;/code&gt;. (this function is from &lt;code&gt;bind-key.el&lt;/code&gt;, which is part of the &lt;code&gt;use-package&lt;/code&gt; project)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;By the way, to cancel the effect of the above code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unbind-key &quot;C-d&quot; override-global-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-10-29T12:49:44.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28236" PostTypeId="1" AcceptedAnswerId="28240" CreationDate="2016-10-29T13:03:54.463" Score="0" ViewCount="27" Body="&lt;p&gt;When I write a big text exceeding the window bounds when starting Emacs the fonts appear in other color than the rest. If it makes any good to mention, when I disable font-lock mode text appears in one color as it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qLXI9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qLXI9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13818" LastActivityDate="2016-10-29T14:59:03.997" Title="Fonts appear in different color in buffer" Tags="|font-lock|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28237" PostTypeId="2" ParentId="28232" CreationDate="2016-10-29T14:22:42.903" Score="1" Body="&lt;p&gt;You can use overlay for this. You'll need to search for the &lt;code&gt;;-;&lt;/code&gt; to end of line, then put overlay to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's full code.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-make-overlay-bold-region (*begin *end)&#xA;  &quot;make the region bold, using overlay.&#xA;Calls `make-overlay' and `overlay-put'. This:&#xA; (overlay-put (make-overlay *begin *end) 'face 'bold)&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (progn&#xA;    (overlay-put (make-overlay *begin *end) 'face 'bold)&#xA;    (setq mark-active nil )))&#xA;&#xA;(defun my-remove-overlays-region (*begin *end)&#xA;  &quot;Call `remove-overlays' interactively.&#xA;Call (remove-overlays *begin *end)&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (remove-overlays *begin *end))&#xA;&#xA;(defun my-color-special-comment ()&#xA;  &quot;highlight text beging with ;-; to end of line.&quot;&#xA;  (interactive)&#xA;  (let (p1 p2)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (search-forward &quot;;-;&quot; )&#xA;        (left-char 3)&#xA;        (setq p1 (point) p2 (line-end-position))&#xA;        (goto-char p2)&#xA;        (my-make-overlay-bold-region p1 p2)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(add-hook 'clojure-mode-hook 'my-color-special-comment)&lt;/p&gt;&#xA;" OwnerUserId="305" LastEditorUserId="5253" LastEditDate="2016-10-29T20:50:07.467" LastActivityDate="2016-10-29T20:50:07.467" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28238" PostTypeId="1" CreationDate="2016-10-29T14:47:29.113" Score="1" ViewCount="163" Body="&lt;p&gt;I am using emacs for OSX (GUI, not the terminal).&#xA;I use desktop-save in order to save my workflow when closing emacs.&#xA;All works fine except when I use OSX virtual desktop: if I open emacs in &quot;Virtual Desktop 1&quot;, I create a new frame, I place it &quot;Virtual Desktop 2&quot;, I use desktop-save, I quit emacs and then I open it again, then the two frames will be opened in the current virtual desktop and not the first in &quot;Virtual Desktop 1&quot; and the second in &quot;Virtual desktop 2&quot;, as I would like to happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to avoid ambiguity I insert an image that clarifies what I mean with &quot;Virtual desktop&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bH5l1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bH5l1.png&quot; alt=&quot;macOS 10.12 with 11 virtual desktop, the first two with emacs opened&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The image portrays macOS 10.12 with 11 virtual desktop, the first two with emacs opened.&lt;/p&gt;&#xA;" OwnerUserId="13656" LastActivityDate="2016-11-12T08:32:04.037" Title="Emacs reopens all frames in current virtual desktop, not in each correct one" Tags="|frames|desktop|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28239" PostTypeId="2" ParentId="28230" CreationDate="2016-10-29T14:53:16.033" Score="1" Body="&lt;p&gt;You can do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;C-d&quot;) (kbd &quot;DEL&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to make the &lt;code&gt;C-c C-d&lt;/code&gt; work, one can&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;DEL&quot;) (kbd &quot;C-d&quot;) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that is, when you need to press C-d in some key, press backspace instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think this remap is a good idea. You trade moving hand and possibly twisting wrist by requiring 2 keys, involving a pinky.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2016-10-29T14:53:16.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28240" PostTypeId="2" ParentId="28236" CreationDate="2016-10-29T14:59:03.997" Score="0" Body="&lt;p&gt;Run &lt;code&gt;M-x customize-group RET whitespace RET&lt;/code&gt; to customize how &lt;code&gt;whitespace-mode&lt;/code&gt; works. In particular, you can scroll down to the &quot;Whitespace Style&quot; setting, and uncheck the &quot;Lines, only overlong part&quot; option to turn off this particular effect. Use &lt;code&gt;C-x C-s&lt;/code&gt; to save the settings, and then reload or revert the buffer to update it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-10-29T14:59:03.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28241" PostTypeId="2" ParentId="28232" CreationDate="2016-10-29T15:06:27.427" Score="2" Body="&lt;p&gt;You want to customize &lt;code&gt;font-lock-syntactic-face-function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function stored in that variable is called for every string and comment to decide which face to use for it.  Of course, you'll want to set it buffer-locally.  It receives as argument a &lt;em&gt;ppss&lt;/em&gt;, i.e. the return value of &lt;code&gt;syntax-ppss&lt;/code&gt; at the current position, so you can figure out whether you're inside a string by checking &lt;code&gt;(nth 3 ppss)&lt;/code&gt; or inside a comment with &lt;code&gt;(nth 4 ppss)&lt;/code&gt; and you get to know where that string or comment started with &lt;code&gt;(nth 8 ppss)&lt;/code&gt;, so you can go check whether it started with &lt;code&gt;;-;&lt;/code&gt; or something else.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-29T15:06:27.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28242" PostTypeId="1" AcceptedAnswerId="28244" CreationDate="2016-10-29T15:49:48.837" Score="1" ViewCount="195" Body="&lt;p&gt;I have written a few simple tests, when I run them on the buffer inside emacs everything passes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I run them in batch mode as shown below, it fails. What can explain this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -batch -l ert -l mytests.el -f ert-run-tests-batch-and-exit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the output from one of the failing tests:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Test pp-test-docker-container-names backtrace:&#xA;  (let ((container_ids (split-string (dc-docker-run-return &quot;ps -q&quot; &quot;&quot; &#xA;  dc-docker-names()&#xA;  (list (dc-docker-names) (quote (nil)))&#xA;  (let ((fn-89805 (function equal)) (args-89806 (list (dc-docker-names&#xA;  (progn (fset (quote shell-command-to-string) vnew) (let ((fn-89805 (&#xA;  (unwind-protect (progn (fset (quote shell-command-to-string) vnew) (&#xA;  (let* ((vnew (function (lambda (_) &quot;&quot;))) (old (symbol-function (quot&#xA;  (closure (t) nil (let* ((vnew (function (lambda (_) &quot;&quot;))) (old (symb&#xA;  #[0 &quot;\306\307!r\211q\210\310\311\312\313\314\315!\316\&quot;\317\320%DC&#xA;  funcall(#[0 &quot;\306\307!r\211q\210\310\311\312\313\314\315!\316\&quot;\31&#xA;  ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc&#xA;  #[0 &quot;r\304 q\210\305 )\306\307\310\311\312\313!\314\&quot;\315\316%DC\2&#xA;  funcall(#[0 &quot;r\304 q\210\305 )\306\307\310\311\312\313!\314\&quot;\315\&#xA;  ert-run-test([cl-struct-ert-test pp-test-docker-container-names &quot;Tes&#xA;  ert-run-or-rerun-test([cl-struct-ert--stats t [[cl-struct-ert-test p&#xA;  ert-run-tests(t #[385 &quot;\306\307\&quot;\203D\211\211G\310U\203\211@\20&#xA;  ert-run-tests-batch(nil)&#xA;  ert-run-tests-batch-and-exit()&#xA;  command-line-1((&quot;-l&quot; &quot;ert&quot; &quot;-l&quot; &quot;docker-compose.el&quot; &quot;-f&quot; &quot;ert-run-te&#xA;  command-line()&#xA;  normal-top-level()&#xA;Test pp-test-docker-container-names condition:&#xA;    (void-function loop)&#xA;   FAILED  2/2  pp-test-docker-container-names&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas ?&lt;/p&gt;&#xA;" OwnerUserId="13729" LastEditorUserId="9995" LastEditDate="2016-10-29T17:15:20.653" LastActivityDate="2016-10-29T17:15:20.653" Title="Why does running my tests with ert-run-tests-batch-and-exit fail" Tags="|debugging|testing|ert|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28243" PostTypeId="2" ParentId="28228" CreationDate="2016-10-29T16:44:59.513" Score="3" Body="&lt;p&gt;You could try something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(run-with-timer 2 nil&#xA;        (lambda ()&#xA;          (message &quot;Some message&quot;)&#xA;          (run-with-timer 3 nil&#xA;                  (lambda ()&#xA;                    (message nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;run-with-timer&lt;/code&gt; will call a function of your choice after a delay (there's a &lt;code&gt;run-with-idle-timer&lt;/code&gt; variant if you want to only show the message when Emacs is idle). I've used &lt;code&gt;lambda&lt;/code&gt; here to create an anonymous function with the body of code I want to run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example shows a message then schedules a second timer to clear the echo-area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a bit clumsy since there might be somebody else's message in the echo area by the time the second timer fires, so you may end up clearing a different message. There's probably a way to avoid that with some more work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit: changed (message &quot;&quot;) to (message nil) to clear the echo-area and return to showing any minibuffer contents (thanks Drew!)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="737" LastEditorUserId="737" LastEditDate="2016-10-29T17:43:20.073" LastActivityDate="2016-10-29T17:43:20.073" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28244" PostTypeId="2" ParentId="28242" CreationDate="2016-10-29T16:58:01.187" Score="2" Body="&lt;pre&gt;&lt;code&gt;(void-function loop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;loop&lt;/code&gt; is not available, which comes from &lt;code&gt;cl.el&lt;/code&gt;. In your code/tests, you should load this library before using &lt;code&gt;loop&lt;/code&gt;. When you launch Emacs interactively with your own init.el, it is usually already loaded since it is a common library used by many other packages.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-10-29T16:58:01.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28245" PostTypeId="1" CreationDate="2016-10-29T17:02:41.237" Score="2" ViewCount="256" Body="&lt;p&gt;I'm using AUCTeX (v.11.89.6 with Emacs 25.1). I have no problems with it, just a small nuisance. Whenever I use &lt;code&gt;TeX-insert-macro&lt;/code&gt; (C-c C-m) I get many options I never use. For instance, when I wish to insert the command &lt;code&gt;\enquote{...}&lt;/code&gt;, I run &lt;code&gt;TeX-insert-macro&lt;/code&gt; and start typing &lt;code&gt;enq&lt;/code&gt;. The first option I get is &lt;code&gt;MakeHyphenQuote&lt;/code&gt; and so I have to scroll down to select &lt;code&gt;enquote&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fGPEb.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fGPEb.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;To go around this issue, I used to edit the &lt;code&gt;csquotes.el&lt;/code&gt; style file and remove &lt;code&gt;MakeHyphenQuote&lt;/code&gt; from the list. However, each time AUCTeX updates itself, my file is removed and all customisation gets lost.&lt;/p&gt;&#xA;&lt;p&gt;I also tried editing the &lt;code&gt;TeX-symbol-list&lt;/code&gt; variable (which, according to &lt;code&gt;apropos-value&lt;/code&gt;, seems to hold these commands), but couldn't make it to work.&lt;/p&gt;&#xA;&lt;p&gt;So my question is whether I can remove &lt;code&gt;MakeHyphenQuote&lt;/code&gt; (or any other command or environment) from the list used by AUCTeX for command insertion.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Update: just to clarify, I'm using &lt;code&gt;ivy-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="516" LastEditorUserId="18951" LastEditDate="2022-03-17T20:57:57.557" LastActivityDate="2024-04-06T04:04:20.483" Title="Restrict available command options in AUCTeX" Tags="|auctex|ivy|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="28246" PostTypeId="1" AcceptedAnswerId="28252" CreationDate="2016-10-29T21:26:40.750" Score="0" ViewCount="685" Body="&lt;p&gt;Since there is parameter I need to use, so I will not use single quote as the &lt;a href=&quot;https://emacs.stackexchange.com/questions/26915/how-to-run-emacs-function-from-the-shell&quot;&gt;question's answer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I try &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -q --eval (progn (find-file &quot;ORG/${UN}.org&quot;) (org-latex-export-to-pdf))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;zsh: bad pattern: (progn (find-file ORG/Austin.org)&#xA;  (org-latex-export-to-pdf))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -q --eval &quot;(progn (find-file &quot;ORG/${UN}.org&quot;) (org-latex-export-to-pdf))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the error again&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;ERROR&lt;/em&gt;: Symbol’s value as variable is void: ORG/Austin\.org&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The question is how to give the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still get error after backslash the period&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -q --eval &quot;(progn (find-file &quot;ORG/${UN}\.org&quot;) (org-latex-export-to-pdf))&quot; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;ERROR&lt;/em&gt;: Symbol’s value as variable is void: ORG/Austin\.org&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9923" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-10-30T06:35:33.567" Title="run emacs function in the shell with parameter" Tags="|org-mode|org-export|shell|functions|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28247" PostTypeId="1" CreationDate="2016-10-29T21:33:33.413" Score="-1" ViewCount="6380" Body="&lt;p&gt;I can't find the init.el file in the normal paths that is supposed to be, and I already try to search inside the emacs app and with the terminal. Apart from that I can write and save files. I made a search to see if there is any init.el file with the basic stuff that already comes with the emacs, but I couldn't find. I need the init.el file because I need to add a meta key for the hash in mac with uk keyboard. I already know how to make a init.el file, but I go to the internet to get the source code, but until now it was not possible to add the meta key to add the hash. If possible could you give me some link to get the init.el file that already comes with emacs. If necessary I can take screenshots.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="13819" LastEditorUserId="8271" LastEditDate="2016-11-04T14:46:16.227" LastActivityDate="2016-11-04T14:46:16.227" Title="I can't find my emacs init.el file in the normal paths" Tags="|init-file|help|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28248" PostTypeId="2" ParentId="28247" CreationDate="2016-10-29T21:35:48.470" Score="0" Body="&lt;p&gt;You need to create the file if it doesn't exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a decent start, &lt;a href=&quot;http://spacemacs.org&quot; rel=&quot;nofollow&quot;&gt;spacemacs&lt;/a&gt; is one possibility.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-10-30T19:52:53.233" LastActivityDate="2016-10-30T19:52:53.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28250" PostTypeId="2" ParentId="28246" CreationDate="2016-10-29T22:43:54.143" Score="-1" Body="&lt;p&gt;Use eval solve this question.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; eval &quot;emacsclient -q --eval '(progn (find-file \&quot;ORG/$UN.org\&quot;) (org-latex-export-to-pdf))'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2016-10-29T22:43:54.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28251" PostTypeId="1" AcceptedAnswerId="28616" CreationDate="2016-10-30T00:24:19.393" Score="0" ViewCount="609" Body="&lt;p&gt;How can I use a remote git executable for all git operations when accessing a file&#xA;via SSHFS?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mount a remote system's git repo via SSHFS on my local computer.  The git repo is medium-sized with about 1000 files and a few years of history.  My local git executable it is unusably slow for all operations on SSHFS.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time for git status:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Executing git from the Remote system: 0.012s total&lt;/li&gt;&#xA;&lt;li&gt;Local git on SSHFS: More than 2 minutes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Constraints:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I'm not allowed to store source code on my laptop due to corporate policy so a normal push/pull git workflow isn't allowed.&lt;/li&gt;&#xA;&lt;li&gt;I'd prefer to keep git functionality enabled over SSHFS rather than disabling git on SSHFS and performing git operations on the remote machine.&lt;/li&gt;&#xA;&lt;li&gt;There's a number of Emacs tools that use git including magit, git-gutter, git-gutter+.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-11-12T07:44:31.687" Title="Use remote git executable for magit and git-gutter when file system is SSHFS" Tags="|magit|tramp|git|ssh|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28252" PostTypeId="2" ParentId="28246" CreationDate="2016-10-30T02:04:35.720" Score="1" Body="&lt;p&gt;Use either&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -q --eval &quot;(progn (find-file \&quot;ORG/${UN}.org\&quot;) (org-latex-export-to-pdf))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -q --eval '(progn (find-file &quot;ORG/'&quot;${UN}&quot;'.org&quot;) (org-latex-export-to-pdf))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem that needs to be solved is to give the string &lt;code&gt;&quot;ORG/Austin.org&quot;&lt;/code&gt; rather than the symbol &lt;code&gt;ORG/Austin.org&lt;/code&gt; to emacs. &lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-10-30T02:04:35.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28253" PostTypeId="1" AcceptedAnswerId="28361" CreationDate="2016-10-30T04:01:59.370" Score="8" ViewCount="3097" Body="&lt;p&gt;What is the best way to use Magit with GitHub personal access tokens?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, pushing to GitHub causes Magit to prompt me for a username and password. I have to provide the access token instead of my regular password to authenticate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/4zl5hl/magit_with_github_2fa/&quot; rel=&quot;noreferrer&quot;&gt;cloning with SSH instead of HTTPS&lt;/a&gt; is the way to go. However, I've already cloned a large number of repos w/ HTTPS. Can I get them to use the token I've specified in my &lt;code&gt;.gitconfig&lt;/code&gt; file?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-12-03T02:17:40.050" Title="Magit and GitHub personal access tokens" Tags="|magit|github|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28254" PostTypeId="2" ParentId="28246" CreationDate="2016-10-30T06:35:33.567" Score="0" Body="&lt;pre&gt;&lt;code&gt;emacs --batch foo.org -f org-latex-export-to-pdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;--batch&lt;/code&gt;: Run Emacs in batch mode&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;foo.org&lt;/code&gt;: Open &lt;code&gt;foo.org&lt;/code&gt; and set it as current buffer (&lt;code&gt;org.el&lt;/code&gt; is loaded by the way)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-f org-latex-export-to-pdf&lt;/code&gt;: Then call &lt;code&gt;org-latex-export-to-pdf&lt;/code&gt; to export the current buffer to pdf&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As your tries&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -q --eval (progn (find-file &quot;ORG/${UN}.org&quot;) (org-latex-export-to-pdf))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you need quote your expression for shell since it contains white spaces.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -q --eval &quot;(progn (find-file &quot;ORG/${UN}.org&quot;) (org-latex-export-to-pdf))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you need escape the inner &lt;code&gt;&quot;&lt;/code&gt; because you are using &lt;code&gt;&quot;&lt;/code&gt; outside. You can refer to &lt;a href=&quot;https://emacs.stackexchange.com/a/28252/3889&quot;&gt;@icarus's answer&lt;/a&gt;, I think it's correct. However, instead of writing Lisp in your shell, you can just make a function in Emacs and call it using &lt;code&gt;emacsclient&lt;/code&gt; from command line, for example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-latex-export-to-pdf ()&#xA;  ...)&#xA;&#xA;$ emacsclient --eval '(my-org-latex-export-to-pdf)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Emacs Lisp, you can use &lt;code&gt;getenv&lt;/code&gt; to access value of environment variable if you need to.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-10-30T06:35:33.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28255" PostTypeId="1" CreationDate="2016-10-30T08:36:36.420" Score="2" ViewCount="112" Body="&lt;p&gt;With AucTeX, one can insert many LaTeX commands using shortcuts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example in a math environment (e.g., between $ $), the shortcut &lt;code&gt;`g&lt;/code&gt; insert &lt;code&gt;\gamma&lt;/code&gt;. Normally right after &lt;code&gt;\gamma&lt;/code&gt; if I would like to type a letter I should make a space, for example &lt;code&gt;$\gamma a=1$&lt;/code&gt;, but if I would like to type a number, a symbol or another latex command, it is not necessary, for example &lt;code&gt;$\gamma\alpha=1$&lt;/code&gt; or &lt;code&gt;$\gamma*1=\gamma$ or $\gamma1=\gamma$&lt;/code&gt;, or &lt;code&gt;$\gamma^1=\gamma$&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way in AucTeX to insert a space right after a latex command (inserted by an AucTeX shortcut, e.g. &lt;code&gt;`g&lt;/code&gt;) if the next keystroke is a letter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this can significantly increase the speed of typing, because the space should be inserted anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have added the requirement &lt;em&gt;inserted by an AucTeX shortcut&lt;/em&gt; to avoid the complicated situations like &lt;code&gt;\leq&lt;/code&gt; and &lt;code&gt;\leqslant&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2755" LastEditDate="2016-10-30T09:37:46.613" LastActivityDate="2016-11-04T09:07:34.973" Title="Ways to automatically insert a space after a LaTeX command (inserted by an AucTeX shortcut, e.g. `g) if the next keystroke is a letter" Tags="|latex|auctex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28256" PostTypeId="1" AcceptedAnswerId="28259" CreationDate="2016-10-30T10:28:44.057" Score="0" ViewCount="37" Body="&lt;p&gt;I use the &quot;go to line&quot; navigation a lot, but mostly of the time I have to type a three digit number in order to navigate through the document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have a row count referring to the visible area of the window and not to all the document, in such a way I will always have to type only a 1 or 2 digit number when navigating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance typing M-g M-g 3 RET I would like to go to the third visible line and not the third line of the document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="13656" LastActivityDate="2016-10-30T13:21:32.267" Title="linum referring to the top of the window" Tags="|navigation|linum-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28257" PostTypeId="1" AcceptedAnswerId="28265" CreationDate="2016-10-30T12:53:51.187" Score="0" ViewCount="946" Body="&lt;p&gt;Step 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;make-toggle-func returns a anonymous function ...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun make-toggle-func (book-name repl-name code-file)&#xA;  `(function (lambda (x)&#xA;           (interactive)&#xA;&#xA;           (setq book-name ,book-name&#xA;             repl-name ,repl-name&#xA;             code-file ,code-file)&#xA;&#xA;           (toggle-between-book-and-code))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step:2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (fset 'el-toggle (make-toggle-func  &quot;eintr.pdf&quot;&#xA;                &quot;*ielm*&quot;&#xA;                &quot;ch01-02.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step: 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(funcall (symbol-function 'el-toggle))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; &#xA;I'm getting the following error. Please help?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Eval error ***  Invalid function: (function (lambda (x) (interactive) (setq book-name &quot;eintr.pdf&quot; repl-name &quot;*ielm*&quot; code-file &quot;ch01-02.el&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13822" LastEditorUserId="105" LastEditDate="2016-10-30T17:05:51.070" LastActivityDate="2016-10-31T17:26:47.540" Title="*** Eval error *** Invalid function:" Tags="|functions|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28258" PostTypeId="1" AcceptedAnswerId="28264" CreationDate="2016-10-30T13:19:34.050" Score="2" ViewCount="81" Body="&lt;p&gt;Suppose I want to make additions to a major mode's syntax highlighting, how would I do this without modifying the major mode's source code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some ideas:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Redefine variable in .emacs&lt;/li&gt;&#xA;&lt;li&gt;Define a minor mode with the changes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2808" LastEditorUserId="105" LastEditDate="2016-11-01T05:12:02.753" LastActivityDate="2016-11-01T05:12:02.753" Title="Modify mode's font-locking without changing source code" Tags="|major-mode|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28259" PostTypeId="2" ParentId="28256" CreationDate="2016-10-30T13:21:32.267" Score="1" Body="&lt;p&gt;One option you can explore is to install &lt;a href=&quot;https://github.com/abo-abo/avy&quot; rel=&quot;nofollow&quot;&gt;https://github.com/abo-abo/avy&lt;/a&gt;. If you bind M-g M-g to &lt;code&gt;avy-goto-line&lt;/code&gt; then it will give you an overlay so that a single letter from the home row of the keyboard will take you to the first 7 rows of the screen, and a pair of letters from the home row will take you to most of the rest of the screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you enter a number it will forward that to the standard &lt;code&gt;goto-line&lt;/code&gt;, so you get fast navigation to onscreen lines using one or two letters, and can go to any line with numbers.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-10-30T13:21:32.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28260" PostTypeId="1" CreationDate="2016-10-30T13:57:09.370" Score="8" ViewCount="3092" Body="&lt;p&gt;When programming, I often switch from emacs to Xcode and viceversa.&#xA;When I switch to Xcode, it automatically updates the current file &lt;strong&gt;when I focus Xcode window&lt;/strong&gt;, if it detects that there are some external changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs I have to press C-x C-v (but I lose the cursor position) or I have to press something and then insert r (reload?) in the minibuffer when emacs asks me what to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make emacs automatically reload the file (without losing the cursor position), it when I select back a buffer it corresponds to a modified file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13656" LastEditorUserId="105" LastEditDate="2016-10-30T16:40:00.640" LastActivityDate="2016-10-30T16:40:00.640" Title="automatically update buffers when focusing if file changed" Tags="|auto-revert-mode|buffer-modified|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28261" PostTypeId="2" ParentId="28260" CreationDate="2016-10-30T14:53:02.810" Score="11" Body="&lt;p&gt;This isn't specific to focus in/out but rather to just updating buffers when the underlying file changes.  Emacs calls this &quot;reverting&quot; the buffer and has the functions &lt;code&gt;revert-buffer&lt;/code&gt; to do it manually and &lt;code&gt;auto-revert-mode&lt;/code&gt; to revert automatically when the file changes on disk.  &lt;code&gt;auto-revert-mode&lt;/code&gt; can be added to the hook for whatever mode your using or you turn on &lt;code&gt;global-auto-revert-mode&lt;/code&gt; (by adding &lt;code&gt;(global-auto-revert-mode)&lt;/code&gt; to your &lt;code&gt;.emacs&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-10-30T14:53:02.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28262" PostTypeId="2" ParentId="28247" CreationDate="2016-10-30T15:24:53.693" Score="3" Body="&lt;p&gt;Emacs doesn't come with a user init file. You write your own. If there's no user init file, Emacs behaves in the same way as if there's an empty init file, so there's no need for a default init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html#Init-File&quot; rel=&quot;nofollow&quot;&gt;several possible locations for the init file&lt;/a&gt;. If you don't have one already, you can use whichever you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make sure that you don't have an init file yet, check the value of the variable &lt;code&gt;user-init-file&lt;/code&gt; (&lt;code&gt;C-h v user-init-file RET&lt;/code&gt;). If this points to an existing file, edit that file. If it doesn't, edit that file or any of the other possible locations.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-10-30T15:24:53.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28263" PostTypeId="1" AcceptedAnswerId="28267" CreationDate="2016-10-30T15:33:26.957" Score="2" ViewCount="353" Body="&lt;p&gt;&lt;strong&gt;I'm using a closure to keep track of some stuff to do with state&lt;/strong&gt;; &lt;strong&gt;I want to be&#xA;able to ‘include’ a function into that closure&lt;/strong&gt;, so it can access the state. The&#xA;only way this is possible is by &lt;em&gt;creating&lt;/em&gt; that function inside the closure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is to have a function &lt;code&gt;include&lt;/code&gt;, itself created inside that lexical&#xA;environment, which takes a &lt;em&gt;quoted&lt;/em&gt; lambda form, and then returns the actual&#xA;function (which will have been created inside the closure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that &lt;code&gt;lambda&lt;/code&gt; is actually a macro which expands to &lt;s&gt;another macro call&lt;/s&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(function (lambda ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my best attempt has been&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; -*- lexical-binding: t; -*-&#xA;&#xA;(let ((x 0)) ;; to represent some state variable&#xA;  (defun include (quoted-lambda)&#xA;    (eval&#xA;     (macroexpand quoted-lambda)&#xA;     t))) ;; last `t' is to eval with lexical binding&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'incx (include '(lambda ()&#xA;                            (incf x))))&#xA;&#xA;(incx) ;; should get 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this just results in  &lt;code&gt;(void-variable x)&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can this be fixed?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="10948" LastEditorUserId="105" LastEditDate="2022-09-18T17:29:19.143" LastActivityDate="2022-09-18T17:29:19.143" Title="Bringing a function into a lexical environment" Tags="|functions|lexical-scoping|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28264" PostTypeId="2" ParentId="28258" CreationDate="2016-10-30T16:41:36.370" Score="3" Body="&lt;p&gt;Use &lt;code&gt;font-lock-add-keywords&lt;/code&gt;. See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Customizing-Keywords.html&quot; rel=&quot;nofollow&quot;&gt;Customizing Keywords&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Elisp manual is your friend: &lt;code&gt;C-h i&lt;/code&gt;, then choose it. In the manual, &lt;code&gt;i&lt;/code&gt; is your friend. E.g., &lt;code&gt;i font-lock TAB&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-10-30T16:41:36.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28265" PostTypeId="2" ParentId="28257" CreationDate="2016-10-30T16:54:14.563" Score="0" Body="&lt;p&gt;You have apparently not yet learned how to define a function using &lt;code&gt;defun&lt;/code&gt;. Why would you be fiddling with &lt;code&gt;fset&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Functions.html&quot; rel=&quot;nofollow&quot;&gt;Defining Functions&lt;/a&gt;, for how to define an Elisp function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's hard to help you further, as the aim of your code is unclear -- what you are trying to do; what you expect your function to do; how you expect to call it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what @wvxvw suggested in a comment might be a start: A lambda form is self-evaluating.  And &lt;code&gt;fset&lt;/code&gt; expects a function as its second argument, not just a list whose first element is &lt;code&gt;function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe something like this will help. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-toggle-func (book-name repl-name code-file)&#xA;  (interactive)&#xA;  (lambda () (toggle-between-book-and-code)))&#xA;&#xA;(fset 'el-toggle (make-toggle-func  &quot;eintr.pdf&quot; &quot;*ielm*&quot;  &quot;ch01-02.el&quot;))&#xA;&#xA;(funcall 'el-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you call &lt;code&gt;el-toggle&lt;/code&gt; with no arguments then it must be able to be so called. So the lambda must not require an argument. Alternatively, if the lambda has an arg then you must provide a second arg to funcall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the command makes no use of its arguments, and its definition is the same as this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-toggle-func (book-name repl-name code-file)&#xA;  (interactive)&#xA;  #'toggle-between-book-and-code)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd say it looks like you need to start over, and figure out just what you are trying to do.  Follow up with a specific question here, if you have trouble after trying at that point.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-10-30T17:05:13.593" LastActivityDate="2016-10-30T17:05:13.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28267" PostTypeId="2" ParentId="28263" CreationDate="2016-10-30T19:28:13.643" Score="6" Body="&#xA;&#xA;&lt;p&gt;You're trying here to access the lexical variable &lt;code&gt;x&lt;/code&gt; from outside its lexical scope, which obviously can't work.  What you can do is pass a lexical environment to &lt;code&gt;eval&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;LEXICAL can also be an actual lexical environment, in the form of an&#xA;  alist mapping symbols to their value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; -*- lexical-binding: t; -*-&#xA;&#xA;(defun include (quoted-lambda)&#xA;  (eval quoted-lambda&#xA;        ;; Using a quoted constant means all expressions returned by&#xA;        ;; `include' will share the same environment.  Use `copy-tree'&#xA;        ;; to get indenpendent copies.&#xA;        '((x . 0))))&#xA;&#xA;;and then&#xA;&#xA;(require 'cl-lib)&#xA;(defalias 'incx (include '(lambda ()&#xA;                            (cl-incf x))))&#xA;&#xA;(incx) ;; should get 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2016-10-31T02:55:07.800" LastActivityDate="2016-10-31T02:55:07.800" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28268" PostTypeId="2" ParentId="28234" CreationDate="2016-10-30T20:02:17.293" Score="3" Body="&lt;p&gt;This is trickier than it seemed! Here is some code that seems to do what you want, I think. It only adds lines at the beginning of a heading, and at the end of what I call the heading content (not including subtrees). It adds different numbers of lines at the end depending on what the next heading is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I briefly tried adding it to the org-cycle-hook, and it seems to work ok. I would make sure you have a backup on files you use this on, since it changes your file! While developing it, I noticed some occasional visibility issues, and issues with the org-element-cache sometimes, and occasionally had to reset it. This version does not seem to have an issue there, but if you see weird behavior it might be related.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(defvar org-blank-lines-after-heading 1&#xA;  &quot;Number of blank lines to separate a heading from the content.&quot;)&#xA;&#xA;(defvar org-blank-lines-after-content (cons 2 4) &#xA;  &quot;Cons cell for the number of blank lines after content in a heading.&#xA;The car is for when the next heading is at the same level, and&#xA;the cdr is for when the next heading is at a different level.&#xA;This is for the body specific to the headline, not counting&#xA;subheadings.&quot;)&#xA;&#xA;(defun org-format-heading-blank-lines ()&#xA;  &quot;Make sure each headline has exactly&#xA;`org-blank-lines-after-heading' after the heading, and&#xA;`org-blank-lines-after-content' blank lines at the end of its&#xA;content. Only works when point is in a headline.&quot;&#xA;  (interactive)&#xA;  (when (org-at-heading-p)&#xA;    (let ((current-level (nth 0 (org-heading-components)))&#xA;      next-level)&#xA;      (save-excursion&#xA;    (org-end-of-meta-data)&#xA;    ;; chomp blank lines then add what you want back.&#xA;    (while (and (not (eobp)) (looking-at &quot;^[[:space:]]*$&quot;))&#xA;      (kill-line))&#xA;    (insert (cl-loop for i from 0 below org-blank-lines-after-heading concat &quot;\n&quot;)))&#xA;&#xA;      ;; Now go to the end of content and insert lines if needed.&#xA;      (save-excursion&#xA;    (when (outline-next-heading)&#xA;      (setq next-level (nth 0 (org-heading-components)))&#xA;      ;; chomp lines back then reinsert them.&#xA;      (previous-line)&#xA;      (while (looking-at &quot;^[[:space:]]*$&quot;)&#xA;        (kill-line)&#xA;        (previous-line))&#xA;      (unless (eobp) (end-of-line))&#xA;      (insert (cl-loop for i from 0 below (if (= current-level next-level)&#xA;                          (car org-blank-lines-after-content)&#xA;                        (cdr org-blank-lines-after-content))&#xA;               concat &quot;\n&quot;)))))))&#xA;&#xA;(defun org-format-headings (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (save-excursion&#xA;    (org-save-outline-visibility t&#xA;      (org-cycle '(64))&#xA;      (message nil)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward org-heading-regexp nil t)&#xA;    (org-format-heading-blank-lines)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-10-30T20:02:17.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28269" PostTypeId="2" ParentId="28180" CreationDate="2016-10-30T20:50:30.167" Score="6" Body="&lt;p&gt;I don't know a way to do this. There is mmm-mode, which allows you to have multiple major modes in one buffer. It is not obvious that mode hook functions get run though to setup minor modes, e.g. I do not see numbers in code blocks, and lispy is not active in elisp blocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For temporary line numbers in code blocks see: &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2015/10/13/Line-numbers-in-org-mode-code-blocks/&quot; rel=&quot;noreferrer&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2015/10/13/Line-numbers-in-org-mode-code-blocks/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In org-mode, mmm-mode prevents you from then using org-edit-special, and also to run and capture the code blocks. Also, some things like checkers (via flycheck I guess) get applied to the whole buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could try this and see if you like it. Use mmm-mode-off to turn it off.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'mmm-mode)&#xA;(setq mmm-global-mode 'maybe)&#xA;(mmm-add-mode-ext-class 'org-mode nil 'org-python)&#xA;(mmm-add-mode-ext-class 'org-mode nil 'org-elisp)&#xA;&#xA;(mmm-add-group&#xA; 'org-python&#xA; '((python-src-block&#xA;    :submode python-mode&#xA;    :face org-block&#xA;    :front &quot;#\\+BEGIN_SRC python.*\n&quot;&#xA;    :back &quot;#\\+END_SRC&quot;)))&#xA;&#xA;(mmm-add-group&#xA; 'org-elisp&#xA; '((elisp-src-block&#xA;    :submode emacs-lisp-mode&#xA;    :face org-block&#xA;    :front &quot;#\\+BEGIN_SRC emacs-lisp.*\n&quot;&#xA;    :back &quot;#\\+END_SRC&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-10-30T20:50:30.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28270" PostTypeId="1" AcceptedAnswerId="28298" CreationDate="2016-10-30T20:54:58.500" Score="9" ViewCount="5282" Body="&lt;p&gt;It seems to me that the normal way to copy a column of an org table is by rectangle selection (see &lt;a href=&quot;https://stackoverflow.com/questions/22002374/how-to-select-a-column-of-a-table-in-emacs-org-mode&quot;&gt;here&lt;/a&gt;). That is, first the column is selected by marking all of it by hand, and then it is copied with &lt;code&gt;org-table-copy-region&lt;/code&gt; or the like. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to have is something more ergonomic in step one: The column gets selected based on the position of the cursor only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to do this?&lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2018-03-21T03:02:20.473" Title="How to select (and copy) a column of an org table *without* rectangle selection?" Tags="|org-table|copy-paste|rectangle|column|selection|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28271" PostTypeId="1" AcceptedAnswerId="28321" CreationDate="2016-10-30T21:13:24.907" Score="3" ViewCount="574" Body="&lt;p&gt;&lt;code&gt;diff-mode&lt;/code&gt; provides &lt;code&gt;diff-refine-hunk&lt;/code&gt; function to refine the highlighting of the current hunk. However, by default, only &lt;code&gt;diff-hunk-next&lt;/code&gt; or explicit &lt;code&gt;diff-refine-hunk&lt;/code&gt; calls will do this job -- hunks will not be refined by default. I wrote the following snippet to refine all hunks when I enter &lt;code&gt;diff-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-diff-hunks-highlight-all ()&#xA;  &quot;Highlight all hunks in diff-mode.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (let ((last-point))&#xA;      (while (not (equal (point) last-point))&#xA;        (setq last-point (point))&#xA;        (diff-refine-hunk)&#xA;        (diff-hunk-next)))))&#xA;(add-hook 'diff-mode-hook 'my-diff-hunks-highlight-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it turns out that only the last hunk will be refined. Is there any reason that this approach fails? What should be the proper way to do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Related Emacs bug&lt;/strong&gt;: &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18128&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18128&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-11-04T07:55:19.287" LastActivityDate="2016-11-04T07:55:19.287" Title="diff-mode: refine all hunks when opening a diff file?" Tags="|diff-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28273" PostTypeId="1" CreationDate="2016-10-31T00:42:01.220" Score="1" ViewCount="348" Body="&lt;p&gt;A custom Agenda view can be filtered by tags AND'ed, e.g. show entries having both &lt;code&gt;play&lt;/code&gt; &lt;strong&gt;AND&lt;/strong&gt; &lt;code&gt;read&lt;/code&gt; tags, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; org-agenda-custom-commands&#xA; '((&quot;p&quot; &quot;play AND read&quot; agenda &quot;&quot;&#xA;    ((org-agenda-tag-filter-preset '(&quot;+play&quot; &quot;+read&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What could be the way to display &lt;strong&gt;day agenda&lt;/strong&gt; listing entries with either &lt;code&gt;play&lt;/code&gt; &lt;strong&gt;OR&lt;/strong&gt; &lt;code&gt;read&lt;/code&gt; tags?&lt;/p&gt;&#xA;" OwnerUserId="2590" LastActivityDate="2016-10-31T00:42:01.220" Title="Org-Agenda day agenda filtered by tags OR'ed" Tags="|org-mode|org-agenda|org-tags|filtering|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28274" PostTypeId="1" AcceptedAnswerId="28278" CreationDate="2016-10-31T02:29:55.223" Score="0" ViewCount="806" Body="&lt;p&gt;I am very new to emacs and I can't figure out why my plots doesn't appear, I have &lt;code&gt;ein&lt;/code&gt; and &lt;code&gt;elpy&lt;/code&gt; installed, my code runs but I just can't see the plot. I installed the packages in &lt;code&gt;M-x list-packages&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My .emacs looks like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;(setq debug-on-error t)&#xA;&#xA;;; Added by Package.el.  This must come before configurations of&#xA;;; installed packages.  Don't delete this line.  If you don't want it,&#xA;;; just comment it out by adding a semicolon to the start of the line.&#xA;;; You may delete these explanatory comments.&#xA;(package-initialize)&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(package-archives&#xA;   (quote&#xA;    ((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;     (&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))))&#xA; '(package-selected-packages (quote (org ein elpy flycheck py-autopep8 material-theme))))&#xA;&#xA;(when (memq window-system '(mac ns))&#xA;  (exec-path-from-shell-initialize))&#xA;&#xA;(setq inhibit-startup-message t) ;; hide the startup message&#xA;(load-theme 'material t) ;; load material theme&#xA;(global-linum-mode t) ;; enable line numbers globally&#xA;&#xA;&#xA;(elpy-enable)&#xA;(elpy-use-ipython)&#xA;(require 'ein)&#xA;&#xA;;; use flycheck not flymake with elpy&#xA;(when (require 'flycheck nil t)&#xA;  (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))&#xA;  (add-hook 'elpy-mode-hook 'flycheck-mode))&#xA;&#xA;;; enable autopep8 formatting on save&#xA;(require 'py-autopep8)&#xA;(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)&#xA;&#xA;&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A code snippet :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import matplotlib.pyplot as plt&#xA;a = [1,2,3]&#xA;b = [1,2,3]&#xA;plt.plot(a,b)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [7]: Out[7]: [&amp;lt;matplotlib.lines.Line2D at 0x110a80c50&amp;gt;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I make the plot show up ?&lt;/p&gt;&#xA;" OwnerUserId="13789" LastActivityDate="2017-12-27T09:24:04.743" Title="problem generating python plots" Tags="|python|elpy|ein|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28275" PostTypeId="1" CreationDate="2016-10-31T03:05:37.337" Score="1" ViewCount="88" Body="&lt;p&gt;Given this input,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &quot;&quot;&quot;&#xA;    This is an example.&#xA;&#xA;    * x hello this is an example. hello this is an example. hello this is an example. hello this is an example. hello this is an example.&#xA;    * y hi this is an example. hi this is an example. hi this is an example. hi this is an example. hi this is an example.&#xA;&#xA;    - x hello this is an example. hello this is an example. hello this is an example. hello this is an example. hello this is an example.&#xA;    - y hi this is an example. hi this is an example. hi this is an example. hi this is an example. hi this is an example.&#xA;&#xA;    1. x hello this is an example. hello this is an example. hello this is an example. hello this is an example. hello this is an example.&#xA;    2. y hi this is an example. hi this is an example. hi this is an example. hi this is an example. hi this is an example.&#xA;&#xA;    : x hello this is an example. hello this is an example. hello this is an example. hello this is an example. hello this is an example.&#xA;    : y hi this is an example. hi this is an example. hi this is an example. hi this is an example. hi this is an example.&#xA;&#xA;    :param hello this is an example. hello this is an example. hello this is an example. hello this is an example. hello this is an example.&#xA;    :param hi this is an example. hi this is an example. hi this is an example. hi this is an example. hi this is an example.&#xA;&#xA;    @param hello this is an example. hello this is an example. hello this is an example. hello this is an example. hello this is an example.&#xA;    @param hi this is an example. hi this is an example. hi this is an example. hi this is an example. hi this is an example.&#xA;    &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;fill-paragraph generates this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &quot;&quot;&quot; This is an example.&#xA;&#xA;    * x hello this is an example. hello this is an example. hello&#xA;    * this is an example. hello this is an example. hello this is&#xA;    * an example.  y hi this is an example. hi this is an&#xA;    * example. hi this is an example. hi this is an example. hi&#xA;    * this is an example.&#xA;&#xA;    - x hello this is an example. hello this is an example. hello&#xA;    - this is an example. hello this is an example. hello this is&#xA;    - an example.  y hi this is an example. hi this is an&#xA;    - example. hi this is an example. hi this is an example. hi&#xA;    - this is an example.&#xA;&#xA;    1. x hello this is an example. hello this is an example. hello&#xA;    this is an example. hello this is an example. hello this is an&#xA;    example.  2. y hi this is an example. hi this is an&#xA;    example. hi this is an example. hi this is an example. hi this&#xA;    is an example.&#xA;&#xA;    : x hello this is an example. hello this is an example. hello&#xA;    this is an example. hello this is an example. hello this is an&#xA;    example.  : y hi this is an example. hi this is an example. hi&#xA;    this is an example. hi this is an example. hi this is an&#xA;    example.&#xA;&#xA;    :param hello this is an example. hello this is an&#xA;    example. hello this is an example. hello this is an&#xA;    example. hello this is an example.  :param hi this is an&#xA;    example. hi this is an example. hi this is an example. hi this&#xA;    is an example. hi this is an example.&#xA;&#xA;    @param hello this is an example. hello this is an&#xA;    example. hello this is an example. hello this is an&#xA;    example. hello this is an example.  @param hi this is an&#xA;    example. hi this is an example. hi this is an example. hi this&#xA;    is an example. hi this is an example.  &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Two problems for me:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it didn't keep the line separated between each bullet.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;* and -&lt;/code&gt; are treated specially and prepended for all lines. (I think it is related to &lt;code&gt;(set (make-local-variable 'paragraph-start) &quot;\\s-*$&quot;)&lt;/code&gt; in python.el&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That is, I want to honor the heading of each bullet and keep lines between then. Those bullets are from rest style.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &quot;&quot;&quot;&#xA;    This is an example.&#xA;&#xA;    1. x hello this is an example. hello this is an example. hello&#xA;    this is an example. hello this is an example. hello this is an&#xA;    example.&#xA;    2. y hi this is an example. hi this is an example. hi this is&#xA;    an example. hi this is an example. hi this is an example.&#xA;&#xA;    * x hello this is an example. hello this is an example. hello&#xA;      this is an example. hello this is an example. hello this is&#xA;      an example.&#xA;    * y hi this is an example. hi this is an example. hi this is&#xA;      an example. hi this is an example. hi this is an example.&#xA;&#xA;    - x hello this is an example. hello this is an example. hello&#xA;      this is an example. hello this is an example. hello this is&#xA;      an example.&#xA;    - y hi this is an example. hi this is an example. hi this is&#xA;      an example. hi this is an example. hi this is an example.&#xA;&#xA;    : x hello this is an example. hello this is an example. hello&#xA;        this is an example. hello this is an example. hello this is&#xA;        an example.&#xA;    : y hi this is an example. hi this is an example. hi this is&#xA;        an example. hi this is an example. hi this is an example.&#xA;&#xA;    :param hello this is an example. hello this is an&#xA;           example. hello this is an example. hello this is an&#xA;           example. hello this is an example.&#xA;    :param hi this is an example. hi this is an example. hi this&#xA;           is an example. hi this is an example. hi this is an&#xA;           example.&#xA;&#xA;    @param hello this is an example. hello this is an&#xA;           example. hello this is an example. hello this is an&#xA;           example. hello this is an example.&#xA;    @param hi this is an example. hi this is an example. hi this&#xA;           is an example. hi this is an example. hi this is an&#xA;           example.&#xA;    &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using Using GNU Emacs 24.5.1. and &lt;code&gt;(setq python-fill-docstring-style 'django)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13826" LastActivityDate="2016-10-31T03:05:37.337" Title="python-fill-docstring-style to honor reST style" Tags="|python|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28276" PostTypeId="1" CreationDate="2016-10-31T06:18:14.317" Score="4" ViewCount="493" Body="&lt;p&gt;I would like to have a &lt;em&gt;Progress&lt;/em&gt; Column in &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html&quot; rel=&quot;nofollow&quot;&gt;Column view&lt;/a&gt; that shows the &lt;a href=&quot;http://orgmode.org/manual/Checkboxes.html&quot; rel=&quot;nofollow&quot;&gt;Checkbox&lt;/a&gt; count for headlines / subtasks . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can make the count show after the subtask / headline by adding the &lt;code&gt;[/]&lt;/code&gt; cookie, but I I can't make them show in the Column view. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried several ways, including  the below columns, but none work: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Project&#xA;    :PROPERTIES:&#xA;    :COLUMNS:  %COOKIE_DATA %[/] %boxcount{{/}}&#xA;    :COOKIE_DATA: checkbox&#xA;    :END:&#xA;** Task1&#xA;    :PROPERTIES:&#xA;    :COOKIE_DATA: checkbox&#xA;    :boxcount: [/]&#xA;    :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I have found I can have a &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2009-04/msg00647.html&quot; rel=&quot;nofollow&quot;&gt;checkbox count across tasks when manually putting checkboxes in their properties&lt;/a&gt;, but I would like to know how to automatically propagate the Checkbox-list count that appears behind a headline when putting a &lt;code&gt;[X]&lt;/code&gt; or &lt;code&gt;[X]&lt;/code&gt; macro into column view&lt;/p&gt;&#xA;" OwnerUserId="11142" LastActivityDate="2016-10-31T06:18:14.317" Title="Orgmode checkbox-list progress in column-view" Tags="|org-mode|column|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28277" PostTypeId="1" AcceptedAnswerId="28279" CreationDate="2016-10-31T06:56:44.510" Score="4" ViewCount="974" Body="&lt;p&gt;I am wondering the semantic of the &lt;code&gt;error&lt;/code&gt; function. For &lt;code&gt;condition-case&lt;/code&gt;, the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html&quot; rel=&quot;nofollow&quot;&gt;Elisp manual&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The arguments after the protected form are handlers. Each handler&#xA;  lists one or more condition names (which are symbols) to specify which&#xA;  errors it will handle.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From its example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case nil&#xA;    (delete-file filename)&#xA;  (error nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;error&lt;/code&gt; in &lt;code&gt;(error nil)&lt;/code&gt; is the condition which is a symbol in my understanding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, when we want to raise an error, we use the function &lt;code&gt;error&lt;/code&gt; as well. From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Signaling-Errors.html#Signaling-Errors&quot; rel=&quot;nofollow&quot;&gt;Elisp manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Function: error format-string &amp;amp;rest args&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This function signals an error with an error message constructed by applying format-message (see Formatting Strings) to format-string and args. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(error &quot;That is an error -- try something else&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error function will create a message and signal the error. What I cannot understand is, what is the difference between this error signaling function, and the error symbol in the &lt;code&gt;(condition-case)&lt;/code&gt; above? If &lt;code&gt;(error)&lt;/code&gt; is a function used to signal an error, in the &lt;code&gt;(condition-case)&lt;/code&gt; above the &lt;code&gt;(error nil)&lt;/code&gt; should be eval-ed and raise an error with a nil message instead of catching an error?&lt;/p&gt;&#xA;" OwnerUserId="13807" LastEditorUserId="105" LastEditDate="2016-10-31T14:21:53.943" LastActivityDate="2016-10-31T14:21:53.943" Title="What is the difference between the error handler in condition-case and the error function" Tags="|error-handling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28278" PostTypeId="2" ParentId="28274" CreationDate="2016-10-31T07:33:01.173" Score="1" Body="&lt;p&gt;It is not an emacs problem as far as I can see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To let a plot show up in python (using matplotlib) use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;plt.show()&lt;/code&gt; &lt;/p&gt;&#xA;" OwnerUserId="13623" LastActivityDate="2016-10-31T07:33:01.173" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28279" PostTypeId="2" ParentId="28277" CreationDate="2016-10-31T07:46:20.127" Score="8" Body="&lt;p&gt;The docstring for &lt;code&gt;condition-case&lt;/code&gt; (&lt;code&gt;C-h f condition-case&lt;/code&gt;) says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;condition-case is a special form in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(condition-case VAR BODYFORM &amp;amp;rest HANDLERS)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Regain control when an error is signaled.&#xA;  Executes BODYFORM and returns its value if no error happens.&#xA;  Each element of HANDLERS looks like (CONDITION-NAME BODY...)&#xA;  where the BODY is made of Lisp expressions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The elisp &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Forms.html#Special-Forms&quot; rel=&quot;noreferrer&quot;&gt;manual&lt;/a&gt; describes &quot;special form&quot; as (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A “special form” is a primitive function specially marked so that its&#xA;  arguments &lt;strong&gt;are not all evaluated&lt;/strong&gt;.  Most special forms define control&#xA;  structures or perform variable bindings—things which functions cannot&#xA;  do.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Each special form &lt;strong&gt;has its own rules for which arguments are evaluated&#xA;  and which are used without evaluation&lt;/strong&gt;.  Whether a particular argument is&#xA;  evaluated may depend on the results of evaluating other arguments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So in this case, the &lt;em&gt;condition name&lt;/em&gt; &lt;code&gt;error&lt;/code&gt; is not evaluated but simply used as a symbol; if it matches the raised error, the corresponding &lt;em&gt;body&lt;/em&gt; is evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contrary to many programming languages, a symbol is just that, a symbol, although it very often references another object, such as a variable or function.&#xA;You may want to have a look at the section on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbols.html#Symbols&quot; rel=&quot;noreferrer&quot;&gt;symbols&lt;/a&gt; in the elisp manual to further clarify this.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-10-31T07:46:20.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28280" PostTypeId="1" AcceptedAnswerId="28282" CreationDate="2016-10-31T08:02:22.940" Score="0" ViewCount="150" Body="&lt;p&gt;Emacs has a secondary selection (not the X11 selection, rather the &lt;code&gt;mouse-secondary-overlay&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my system holding Alt-LMB dragging sets it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I check if there this selection is set in elisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried checking;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if mouse-secondary-overlay&#xA;  ... do something ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;however this always prints &lt;code&gt;&quot;Have Second Select&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be tested?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="105" LastEditDate="2016-10-31T14:19:06.083" LastActivityDate="2016-10-31T14:19:06.083" Title="How to check if there exists a secondary selection?" Tags="|secondary-selection|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28281" PostTypeId="2" ParentId="28280" CreationDate="2016-10-31T08:46:15.920" Score="1" Body="&lt;p&gt;This can be done by checking if the start of &lt;code&gt;(overlay-start mouse-secondary-overlay)&lt;/code&gt; is not nil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a function that uses the secondary selection, then the primary as a fallback.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mouse-yank-secondary-and-deselect (click)&#xA;  &quot;Deselect after yanking, for quick select-copy. Uses primary as fallback.&quot;&#xA;  (interactive &quot;*p&quot;)&#xA;  (if (overlay-start mouse-secondary-overlay)&#xA;      (progn&#xA;        ;; use the secondary buffer and clear it&#xA;        (mouse-yank-secondary click)&#xA;        (delete-overlay mouse-secondary-overlay)&#xA;        )&#xA;    (progn&#xA;      ;; fallback to primary buffer&#xA;      (mouse-yank-primary click)&#xA;      )&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2016-10-31T08:46:15.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28282" PostTypeId="2" ParentId="28280" CreationDate="2016-10-31T09:09:26.710" Score="2" Body="&lt;pre&gt;&lt;code&gt;(gui-get-selection 'SECONDARY)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;returns nil if there is no secondary selection. (if your Emacs is older than 25.1, use &lt;code&gt;x-get-selection&lt;/code&gt; instead)&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-10-31T09:09:26.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28283" PostTypeId="2" ParentId="28180" CreationDate="2016-10-31T09:09:36.573" Score="3" Body="&lt;p&gt;I am not aware of any established general method that would allow to restrict minor modes to sub-regions of a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, for minor modes that do not use restrictions you can use &lt;code&gt;narrow-to-region&lt;/code&gt; on the minor-mode functions that affect the buffer.&#xA;I demonstrate this for &lt;code&gt;linenum-mode&lt;/code&gt; and &lt;code&gt;highlight-parentheses-mode&lt;/code&gt; in the following lisp code.&#xA;Line numbers are only shown and parentheses are only highlighted for the source block with the point in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to try the code evaluate it and switch on &lt;code&gt;bertfred-mode&lt;/code&gt; in your &lt;code&gt;org-mode&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pityingly, the concept is not so simple for &lt;code&gt;linenum-mode&lt;/code&gt;. There also a function for &lt;code&gt;pre-redisplay-functions&lt;/code&gt; is required to make line-numberings responsive for point-motion functions without scrolling (i.e., when point enters a source block without scrolling).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;An advantage over the &lt;a href=&quot;https://emacs.stackexchange.com/questions/28180/is-it-possible-to-enable-minor-modes-in-org-babel-blocks#28269&quot;&gt;method proposed by John Kitchin&lt;/a&gt; is that line-numbering remains permanent and consistent when one edits the source code block. The line numbering disappears if you place point in the region with &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2015/10/13/Line-numbers-in-org-mode-code-blocks/&quot; rel=&quot;nofollow noreferrer&quot;&gt;his method&lt;/a&gt; (&lt;em&gt;Note: I did not try this method but I watched the end of his &lt;a href=&quot;https://www.youtube.com/watch?v=kinWijGzXms&quot; rel=&quot;nofollow noreferrer&quot;&gt;youtube video&lt;/a&gt;. Please give me a note if I misunderstood this part of the video. I will delete this section if the statement turns out to be wrong.&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;An disadvantage with respect of the method proposed by John is that the border for line-numbering is shown in the full org-mode buffer -- also at places where no line-numbering takes place.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-narrow-to-block-contents ()&#xA;  &quot;Narrow buffer to the current source block contents.&#xA;This is almost a copy of `org-narrow-to-block'.&quot;&#xA;  (interactive)&#xA;  (let* ((case-fold-search t)&#xA;     (blockp (org-between-regexps-p &quot;^[ \t]*#\\+begin_.*&quot;&#xA;                    &quot;^[ \t]*#\\+end_.*&quot;)))&#xA;    (if blockp&#xA;    (narrow-to-region (save-excursion&#xA;                (goto-char (car blockp))&#xA;                (line-beginning-position  2))&#xA;              (save-excursion&#xA;                (goto-char (cdr blockp))&#xA;                (line-end-position 0)))&#xA;      (user-error &quot;Not in a block&quot;))))&#xA;&#xA;(defun org-restrict-fun-to-src-block (oldfun &amp;amp;rest args)&#xA;  &quot;Restrict minor-mode function to source block.&quot;&#xA;  (if bertfred-mode&#xA;      (when (org-in-src-block-p)&#xA;    (save-excursion&#xA;      (save-restriction&#xA;        (org-narrow-to-block-contents)&#xA;        (apply oldfun args))))&#xA;    (apply oldfun args)))&#xA;&#xA;(defvar-local org-linum-redisplay nil&#xA;  &quot;Update line numbers of source code blocks.&quot;)&#xA;&#xA;(defun org-linum-redisplay-function (window)&#xA;  &quot;Trigger linum update at `redisplay' &quot;&#xA;  (when (and bertfred-mode&#xA;     (eq (window-buffer window) (current-buffer)))&#xA;    (let ((in-src-block (org-in-src-block-p))&#xA;      (selected-window (selected-window)))&#xA;      (when (and (null org-linum-redisplay)&#xA;         in-src-block)&#xA;    (linum-update-window selected-window))&#xA;      (setq org-linum-redisplay in-src-block))))&#xA;&#xA;(define-minor-mode bertfred-mode&#xA;  &quot;Use `linum-mode' and `highlight-paren-mode' for source blocks in `org-mode'.&quot;&#xA;  :lighter &quot; BF&quot;&#xA;  (if bertfred-mode&#xA;      (progn&#xA;    (advice-add #'linum-update-window :around #'org-restrict-fun-to-src-block)&#xA;    (advice-add #'hl-paren-highlight :around #'org-restrict-fun-to-src-block)&#xA;    (add-hook 'pre-redisplay-functions #'org-linum-redisplay-function nil t)&#xA;    (linum-mode 1)&#xA;    (highlight-parentheses-mode 1))&#xA;    (advice-remove #'linum-update-window #'org-restrict-fun-to-src-block)&#xA;    (advice-remove #'hl-paren-highlight #'org-restrict-fun-to-src-block)&#xA;    (remove-hook 'pre-redisplay-functions #'org-linum-redisplay-function t)&#xA;    (linum-mode 0)&#xA;    (highlight-parentheses-mode 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-10-31T09:47:00.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28284" PostTypeId="1" CreationDate="2016-10-31T09:21:13.520" Score="6" ViewCount="7779" Body="&lt;p&gt;On local machine, I am using the account as test1, and I could use the same account to login remote server. After login as test1 on remote server, I could run &lt;code&gt;sudo su - oracle&lt;/code&gt; to change as oracle user, and then I could all files under account of oracle. But I don't know the password of oracle, I could only change to oracle using &lt;code&gt;sudo su - oracle&lt;/code&gt;. So how to use tramp to edit the file from oracle account on remote server? I read the tramp document, it said we have sudo and su option. I can't simple use su since I don't have the password of oracle. But if using sudo, looks like it doesn't work as the emacs hangs forever.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastActivityDate="2020-07-21T20:04:20.827" Title="tramp and sudo: how to edit files under another account" Tags="|tramp|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28285" PostTypeId="2" ParentId="28284" CreationDate="2016-10-31T09:44:32.927" Score="2" Body="&lt;p&gt;This is probably a (cross-site) duplicate, as the question has a fairly comprehensive answer on Stack Overflow:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/q/2177687/324105&quot;&gt;Open file via SSH and Sudo with Emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But if using sudo, looks like it doesn't work as the emacs hangs forever.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As you neither show what you've tried, nor provide any details on how far tramp gets (customize the &lt;code&gt;tramp-verbose&lt;/code&gt; option), it's extremely difficult to tell whether there's still a problem, or what it might be.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-10-31T19:53:51.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28286" PostTypeId="1" CreationDate="2016-10-31T10:21:15.410" Score="1" ViewCount="2235" Body="&lt;p&gt;I am using Aquamacs 3.3  GNU Emacs 25.1.1, and I got the error message 'Wrong number of arguments: setq, 3' every time when I trying to open a file the first time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I solve this problem? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13700" LastActivityDate="2017-02-02T19:18:40.757" Title="Got problem 'Wrong number of arguments: setq, 3' when trying to open file" Tags="|aquamacs|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28287" PostTypeId="2" ParentId="28286" CreationDate="2016-10-31T11:03:57.410" Score="1" Body="&lt;p&gt;I finally find the problem is caused by using 'subfigure' package in my latex file. And this problem has been solved by changing 'subfigure.el'. And specific salutation is given in &lt;a href=&quot;https://groups.google.com/forum/#!topic/aquamacs-devel/r9iaih8rsAg&quot; rel=&quot;nofollow noreferrer&quot;&gt;thread on google groups&lt;/a&gt;. Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="13700" LastEditorUserId="14190" LastEditDate="2017-02-02T19:18:40.757" LastActivityDate="2017-02-02T19:18:40.757" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28288" PostTypeId="2" ParentId="28286" CreationDate="2016-10-31T11:05:08.340" Score="2" Body="&lt;p&gt;As I said in &lt;a href=&quot;https://emacs.stackexchange.com/questions/28155/unable-to-update-packages-on-emacs-25-1#comment43164_28155&quot;&gt;https://emacs.stackexchange.com/questions/28155/unable-to-update-packages-on-emacs-25-1#comment43164_28155&lt;/a&gt; one of the changes in emacs is that now &lt;code&gt;setq&lt;/code&gt; requires an even number of arguments. If you set the &lt;code&gt;debug-on-error&lt;/code&gt; variable to &lt;code&gt;t&lt;/code&gt; then when you get this error you should enter the debugger and see where the error is coming from. Adding &lt;code&gt;nil&lt;/code&gt; as a final argument should resolve your problem.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-10-31T11:05:08.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28289" PostTypeId="1" AcceptedAnswerId="28290" CreationDate="2016-10-31T12:19:35.590" Score="2" ViewCount="674" Body="&lt;p&gt;I would like to have &lt;code&gt;;&lt;/code&gt; bound to &lt;code&gt;other-window&lt;/code&gt; in special modes, unless the derived mode overrides the definition. It would be nice to also include modes not strictly deriving from &lt;code&gt;special-mode&lt;/code&gt; (but defining &lt;code&gt;'mode-class&lt;/code&gt;), but that's not strictly necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas I've tried/considered:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;code&gt;global-set-key&lt;/code&gt;: I thought the global keymap would be of lower precedence than major-mode keymaps, so &lt;code&gt;;&lt;/code&gt; would work in modes that defined it, but instead I just overwrote &lt;code&gt;self-insert-command&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Add the keybinding in &lt;code&gt;special-mode-hook&lt;/code&gt;: It doesn't seem like this hook is actually run, and this misses the &lt;code&gt;'mode-class&lt;/code&gt; special modes&lt;/li&gt;&#xA;&lt;li&gt;Add a keybinding that either calls &lt;code&gt;other-window&lt;/code&gt; or defers to the major mode. Not sure how I would do this?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="9356" LastActivityDate="2016-10-31T13:58:46.440" Title="How to define a key in 'special-mode?" Tags="|key-bindings|keymap|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28290" PostTypeId="2" ParentId="28289" CreationDate="2016-10-31T12:33:14.393" Score="4" Body="&lt;p&gt;I think you can use &lt;code&gt;special-mode-map&lt;/code&gt; when possible. When it doesn't work, simply use the corresponding mode map such as &lt;code&gt;Info-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The following (needs &lt;code&gt;bind-key.el&lt;/code&gt;) might works (I tested in info-mode and help-mode), it uses &lt;code&gt;bind-key.el&lt;/code&gt;'s &lt;code&gt;override-global-mode&lt;/code&gt;, which overrides any minor-mode binding of &lt;code&gt;;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun override-global-mode-semicolon ()&#xA;  (interactive)&#xA;  (if (eq (get major-mode 'mode-class) 'special)&#xA;      (call-interactively 'other-window)&#xA;    (let (buf (current-buffer))&#xA;      (override-global-mode -1)&#xA;      (unwind-protect&#xA;          (call-interactively (key-binding &quot;;&quot;))&#xA;        (and (buffer-live-p buf)&#xA;             (with-current-buffer buf&#xA;               (override-global-mode 1)))))))&#xA;&#xA;(bind-key* &quot;;&quot; 'override-global-mode-semicolon)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-10-31T13:54:56.820" LastActivityDate="2016-10-31T13:54:56.820" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28291" PostTypeId="2" ParentId="28263" CreationDate="2016-10-31T12:58:12.017" Score="1" Body="&lt;p&gt;To &quot;give access&quot; to a variable, you simply have to &lt;em&gt;pass it&lt;/em&gt; to the closure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((x 0))&#xA;  (defun include (fun)&#xA;    (funcall fun x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, in your case, you really want to pass the state itself rather than the state's value.  You can do that in the following way, using &lt;code&gt;gv-ref&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((x 0)&#xA;       (xref (gv-ref x)))&#xA;  (defun include (fun)&#xA;    (funcall fun xref)))&#xA;&#xA;(defun incx (xref)&#xA;  (cl-incf (gv-deref xref)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;gv-ref&lt;/code&gt; is like C's &lt;code&gt;&amp;amp;&lt;/code&gt; and &lt;code&gt;gv-deref&lt;/code&gt; is like C's &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you can also do it without gv, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((xref (cons 0 nil)))&#xA;  (defun include (fun)&#xA;    (funcall fun xref)))&#xA;&#xA;(defun incx (xref)&#xA;  (cl-incf (car xref)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-31T12:58:12.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28293" PostTypeId="2" ParentId="28289" CreationDate="2016-10-31T13:58:46.440" Score="3" Body="&lt;p&gt;IIUC you're just looking for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key special-mode-map &quot;;&quot; #'other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And for those other modes which don't (yet) derive from &lt;code&gt;special-mode&lt;/code&gt;, you'll have to do something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook '&amp;lt;foo&amp;gt;-mode-hook&#xA;          (lambda ()&#xA;            (local-set-key &quot;;&quot; #'other-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;tho I'd advise you to report those modes via &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; if you think they should derive from &lt;code&gt;special-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-10-31T13:58:46.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28294" PostTypeId="1" CreationDate="2016-10-31T14:51:00.580" Score="3" ViewCount="522" Body="&lt;p&gt;is it possible to show indentation guides in org-mode source code blocks? I use &lt;a href=&quot;https://github.com/DarthFennec/highlight-indent-guides&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;highlight-indent-guides-mode&lt;/code&gt;&lt;/a&gt; for highlighting indention and it does not work in org-mode (I think this is because the mode uses font-lock to draw indent guides and hence, it does not work for org-mode source code blocks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any other package that draws indent guides in org-mode source code blocks?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-10-31T14:51:00.580" Title="Highlight indent guides in org-mode src blocks" Tags="|org-mode|indentation|highlighting|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28295" PostTypeId="2" ParentId="28232" CreationDate="2016-10-31T15:04:31.060" Score="8" Body="&lt;p&gt;This is what I ended up going with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface special-comment '((t (:foreground &quot;#2aa198&quot;))) &quot;Cyan&quot;)&#xA;&#xA;(font-lock-add-keywords&#xA; 'clojure-mode '((&quot;;-;.*&quot; 0 'special-comment t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;;-;.*&quot;&lt;/code&gt; is regex. &lt;code&gt;0&lt;/code&gt; matches the entire expression. &lt;code&gt;t&lt;/code&gt; overrides existing highlights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info on &lt;code&gt;font-lock-add-keywords&lt;/code&gt; can be found here: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html&lt;/a&gt;. Of note is the &lt;code&gt;(matcher . subexp-highlighter)&lt;/code&gt; section.&lt;/p&gt;&#xA;" OwnerUserId="2808" LastActivityDate="2016-10-31T15:04:31.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28296" PostTypeId="2" ParentId="28121" CreationDate="2016-10-31T17:00:38.717" Score="8" Body="&lt;p&gt;The behavior you described is specific to Emacs Mac port and can be observed when the menu bar is globally disabled. Enabling it should make Emacs behave like other applications on OS X. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I emailed the maintainer of the port, Yamamoto Mitsuharu, regarding this issue and he referred me to &lt;a href=&quot;https://bitbucket.org/mituharu/emacs-mac/src/892fa7b2501a403b4f0aea8152df9d60d63f391a/doc/emacs/macport.texi?at=master#macport.texi-529&quot; rel=&quot;noreferrer&quot;&gt;the relevant section of the Mac port info node&lt;/a&gt;, which goes as follows.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unlike the original Emacs, enabling or disabling Menu Bar mode&#xA;  (@pxref{Menu Bars}) does not affect the appearance of the menu bar on&#xA;  the Mac port because it does not make sense on OS X having the global&#xA;  menu bar.  Instead, the value of the @code{menu-bar-lines} frame&#xA;  parameter affects the system-wide full screen behavior of the frame.&#xA;  In most cases, disabling the menu bar of a particular frame by default&#xA;  means that it is a utility frame used for a subsidiary purpose&#xA;  together with other frames, rather than an ordinary frame on its own.&#xA;  Examples include the speedbar (@pxref{Speedbar}) and Ediff Control&#xA;  Panel (@pxref{Top, Ediff, Ediff, ediff, The Ediff Manual}).  Using&#xA;  this heuristics, the Mac port regards a frame having a menu bar as an&#xA;  ordinary frame that is eligible for full screen.  Conversely, a frame&#xA;  without a menu bar is considered as a utility frame and it can coexist&#xA;  with a full screen ordinary frame and other utility frames in a same&#xA;  desktop (or Space) for full screen.  Note that a utility frame doesn't&#xA;  have the full screen button on the title bar.  If you don't see the&#xA;  full screen button while it is supposed to be there, then check the&#xA;  menu bar setting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="13834" LastActivityDate="2016-10-31T17:00:38.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28297" PostTypeId="2" ParentId="17282" CreationDate="2016-10-31T18:14:57.407" Score="5" Body="&lt;p&gt;New here with no-reputation, otherwise I would simply have added a comment to erikstokes answer.&lt;/p&gt;&#xA;&lt;p&gt;Using org-mode version 8.3.4 the advise above was not sufficient as &lt;code&gt;org-add-note()&lt;/code&gt; had completed before &lt;code&gt;org-store-log-note()&lt;/code&gt; callback function had been called.&lt;/p&gt;&#xA;&lt;p&gt;So I took his example and made it two pronged:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun sjm/org-add-note (func &amp;amp;rest args)&#xA;  &amp;quot;Set sjm/org-log-into-drawer to value of args (c-u), its value is read by sjm/org-store-log-note.&amp;quot;&#xA;  (interactive &amp;quot;P&amp;quot;)&#xA;  (setq sjm/org-log-into-drawer (car args))&#xA;  (funcall func))&#xA;&#xA;(defun sjm/org-store-log-note (func)&#xA;  &amp;quot;calls org-store-log-note momentarily setting&#xA;org-log-into-drawer to nil if sjm/org-log-into-drawer is nil. As set by sjm/org-add-note.&amp;quot;&#xA;  (if (not sjm/org-log-into-drawer)&#xA;      (funcall func)&#xA;    (let ((org-log-into-drawer nil))&#xA;      (funcall func))))&#xA;&#xA;(advice-add 'org-add-note :around #'sjm/org-add-note)&#xA;(advice-add 'org-store-log-note :around #'sjm/org-store-log-note)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;As it stands &lt;code&gt;sjm/org-log-into-drawer&lt;/code&gt; is a global switch, but then so is the buffer &lt;code&gt;*Org Note*&lt;/code&gt;; meaning you can only take one note at a time anyway!&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;code&gt;org-version&lt;/code&gt; 9.4 (9.4.4) needs to have advice around &lt;code&gt;org-log-into-drawer()&lt;/code&gt; rather than &lt;code&gt;org-store-log-note()&lt;/code&gt;.  I now have the following instead of the above (corrected to reset).&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (defun sjm/org-add-note (func &amp;amp;rest args)&#xA;    &amp;quot;Advisor function to go around `org-add-note'.  Takes optional&#xA;  count (c-u) and sets sjm/org-log-into-drawer to be used by&#xA;  `sjm/org-store-log-note'.&#xA;&#xA;  The usage is thus:&#xA;&#xA;  (advice-add 'org-log-into-drawer :around #'sjm/org-log-into-drawer)&#xA;  (advice-add 'org-add-note :around #'sjm/org-add-note)&#xA;&#xA;  When you do not want to log note into a draw use C-u C-c C-z.&#xA;  Otherwise use C-c C-z as normal and it should log note as per&#xA;  standard `org-log-into-drawer'.&#xA;  &amp;quot;&#xA;    (interactive &amp;quot;P&amp;quot;)&#xA;    (setq sjm/org-log-into-drawer (car args))&#xA;    (funcall func))&#xA;&#xA;  (defun sjm/org-log-into-drawer (func)&#xA;    &amp;quot;Advisor function to go around `org-log-into-drawer'.&#xA;  Reads value of sjm/org-log-into-drawer, as set by&#xA;  `sjm/org-add-note', and if set returns nil meaning do not log&#xA;  into drawer.  Otherwise returns value from call to&#xA;  `org-log-into-draw'.  Before returning resets&#xA;  sjm/org-log-into-drawer for subsequent calls.&amp;quot;&#xA;    (let ((ret&#xA;    (if (not sjm/org-log-into-drawer)&#xA;        (funcall func)&#xA;      nil)))&#xA;      (setq sjm/org-log-into-drawer nil)&#xA;      ret))&#xA;  (setq sjm/org-log-into-drawer nil)&#xA;  (advice-add 'org-log-into-drawer :around #'sjm/org-log-into-drawer)&#xA;  (advice-add 'org-add-note :around #'sjm/org-add-note)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13835" LastEditorUserId="13835" LastEditDate="2021-03-24T07:51:02.077" LastActivityDate="2021-03-24T07:51:02.077" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="28298" PostTypeId="2" ParentId="28270" CreationDate="2016-10-31T18:21:59.903" Score="3" Body="&lt;p&gt;The two commands &lt;code&gt;org-table-select-col&lt;/code&gt; and &lt;code&gt;org-table-copy-col&lt;/code&gt; in the following lisp code allow the selection and the copying of the current table column. You can bind it to the key of your liking and/or insert it via &lt;code&gt;easy-menu-define-key&lt;/code&gt; into &lt;code&gt;org-tbl-menu&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-table-goto-col-beginning ()&#xA;  &quot;Go to beginning of current column and return `point'.&quot;&#xA;  (interactive)&#xA;  (assert (org-table-p) &quot;Not in org-table.&quot;)&#xA;  (org-table-align)&#xA;  (let ((col (org-table-current-column)))&#xA;    (goto-char (org-table-begin))&#xA;    (org-table-goto-column col))&#xA;  (point))&#xA;&#xA;(defun org-table-col-beginning ()&#xA;  &quot;Return beginning position of current column.&quot;&#xA;  (save-excursion&#xA;    (org-table-goto-col-beginning)))&#xA;&#xA;(defun org-table-goto-col-end ()&#xA;  &quot;Goto end of current column and return `point'.&quot;&#xA;  (interactive)&#xA;  (assert (org-table-p) &quot;Not in org-table.&quot;)&#xA;  (org-table-align)&#xA;  (let ((col (org-table-current-column)))&#xA;    (goto-char (1- (org-table-end)))&#xA;    (org-table-goto-column col)&#xA;    (skip-chars-forward &quot;^|&quot;))&#xA;  (point))&#xA;&#xA;(defun org-table-col-end ()&#xA;  &quot;Return end position of current column.&quot;&#xA;  (save-excursion&#xA;    (org-table-goto-col-end)))&#xA;&#xA;(defun org-table-select-col ()&#xA;  &quot;Select current column.&quot;&#xA;  (interactive)&#xA;  (set-mark (org-table-col-beginning))&#xA;  (org-table-goto-col-end))&#xA;&#xA;(defun org-table-copy-col ()&#xA;  &quot;Copy current column.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (org-table-copy-region (org-table-goto-col-beginning)&#xA;               (org-table-goto-col-end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-10-31T18:21:59.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28300" PostTypeId="2" ParentId="28270" CreationDate="2016-10-31T19:02:36.210" Score="9" Body="&lt;p&gt;Actually for &lt;code&gt;org-table-copy-region&lt;/code&gt; it isn't necessary to mark the exact column width! Just mark the beginning of the column somewhere in a cell, then the end by going down the required number of rows and do &lt;code&gt;C-c C-x M-w&lt;/code&gt; (for &lt;code&gt;M-x o-t-c-r&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then go to another cell, where you want to add the column and do &lt;code&gt;C-c C-x C-y&lt;/code&gt; (for &lt;code&gt;M-x org-table-paste-rectangle&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2018-03-21T03:02:20.473" LastActivityDate="2018-03-21T03:02:20.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28301" PostTypeId="1" AcceptedAnswerId="28471" CreationDate="2016-10-31T19:17:52.650" Score="10" ViewCount="3305" Body="&lt;p&gt;To avoid the &lt;a href=&quot;http://xyproblem.info/&quot; rel=&quot;noreferrer&quot;&gt;XY problem&lt;/a&gt;, let me say that what I actually want is to embed Javascript code into &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags in the HTML files produced via Org mode export, in such a way that (1) the Javascript code is included in the Org file (not a separate Javascript file), and (2) it is very easy to edit the Javascript in a Javascript specific major mode. The question title is only one way to achieve that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently to embed Javascript in the resulting exported HTML I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_EXPORT html&#xA;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&#xA; // javascript code goes here&#xA;&amp;lt;/script&amp;gt;&#xA;#+END_EXPORT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That works fine, of course, but I'd like to edit the Javascript code in a Javascript major mode. Using &lt;code&gt;C-'&lt;/code&gt; on an HTML block sensibly opens a buffer in HTML mode. So I've been using temp buffers I manually open and put in Javascript mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To embed code in an Org file that's conveniently editable in the correct major mode, you can use source blocks. Is there a way to get that Javascript code to export into a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag? Or some other convenient way to get what I want?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: Updated the &lt;code&gt;#+BEGIN_HTML&lt;/code&gt; to &lt;code&gt;#+BEGIN_EXPORT html&lt;/code&gt; for the shiny new Org 9.0, per @mutbuerger's suggestion.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="253" LastEditDate="2016-11-15T19:16:50.313" LastActivityDate="2016-11-15T19:16:50.313" Title="Export Javascript source block to script tag in HTML when exporting Org file to HTML" Tags="|org-mode|org-export|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28302" PostTypeId="2" ParentId="28270" CreationDate="2016-10-31T19:55:59.453" Score="2" Body="&lt;p&gt;Another simple way to go would be to use &lt;code&gt;org-table-transpose-table-at-point&lt;/code&gt;, which turns columns into rows, and vice versa. Drawback is that horizontal lines get removed. Furthermore the cursor does not remain in the proper column/row.&lt;/p&gt;&#xA;" OwnerUserId="12336" LastActivityDate="2016-10-31T19:55:59.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28303" PostTypeId="2" ParentId="15255" CreationDate="2016-10-31T19:57:08.263" Score="2" Body="&lt;p&gt;When using &lt;code&gt;dired-x&lt;/code&gt; the keyboard shortcut &lt;code&gt;C-x C-j&lt;/code&gt; is bound to &lt;code&gt;dired-jump&lt;/code&gt;.  So from your file buffer you end up at the right dired line and can copy its file name with &lt;code&gt;w&lt;/code&gt;.   And then you are able to paste it in the mini buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility to aleviate typing of the file name is the standard Emacs mini buffer file completion. Just typing the first characters of your filename and then TAB.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2018-05-29T15:44:56.717" LastActivityDate="2018-05-29T15:44:56.717" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="28304" PostTypeId="2" ParentId="28263" CreationDate="2016-10-31T20:06:36.613" Score="2" Body="&lt;p&gt;What you seem to want is access to the lexical-environment of a function, which would allow something like this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ...&#xA;  (defun include (lambda-form)&#xA;    (eval lambda-form&#xA;          (this-lexical-environment))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But such a function does not exist and while there is a variable &lt;code&gt;internal-interpreter-environment&lt;/code&gt;, it's not accessible via Lisp. But let's remember how closures are constructed:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((x 0))&#xA;  (lambda () (* x x)))&#xA;;; =&amp;gt; (closure ((x . 0) t) nil (* x x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems that we can access the environment of a closure.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(butlast (cadr (let ((x 0))&#xA;                 (lambda () (* x x)))))&#xA;;; =&amp;gt; ((x . 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Armed with this knowledge, we can write a function, which injects the environment of one closure into a second one.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun lexenv-grant-access (from to)&#xA;  &quot;Grant access of FROM's lexenv to TO.&quot;&#xA;  (let (name env)&#xA;    (when (symbolp from)&#xA;      (setq from (symbol-function from)))&#xA;    (when (symbolp to)&#xA;      (setq name to&#xA;            to (symbol-function to)))&#xA;    (pcase from&#xA;      (`(closure ,env-form ,args . ,body)&#xA;       (setq env (butlast env-form)))&#xA;      (_ (error &quot;FROM is not a closure&quot;)))&#xA;    (pcase to&#xA;      (`(closure ,env-form ,args . ,body)&#xA;       (eval&#xA;        (if name&#xA;            `(defalias ',name (lambda ,args ,@body))&#xA;          `(lambda ,args ,@body))&#xA;        (append (butlast env-form)&#xA;                env)))&#xA;      (_ (error &quot;TO is not a closure&quot;)))))&#xA;&#xA;(let ((x 0))&#xA;  (defun incx ()&#xA;    (cl-incf x)))&#xA;&#xA;(defun decx ()&#xA;  (cl-decf x))&#xA;&#xA;(decx)&#xA;;; =&amp;gt; (wrong-type-argument number-or-marker-p nil)&#xA;&#xA;(lexenv-grant-access 'incx 'decx)&#xA;(list (incx) (decx))&#xA;;; =&amp;gt; (1 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what are the problems ?  First, this uses an internal implementation detail, i.e. how closure lists are constructed.  But more importantly, it won't work with compiled functions.  Such a function has a completely different structure and it may not even store the names of the variables, only their values.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;Byte compiling the function's file...&#xA;(symbol-function 'incx)&#xA;;; =&amp;gt; #[0 &quot;\300\211\242T\240\207&quot; [(0)] 2]&#xA;(disassemble 'incx) ;; =&amp;gt; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can you spot the value of &lt;code&gt;x&lt;/code&gt; ? Anyway, I don't think you want to do this.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-10-31T20:06:36.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28305" PostTypeId="1" CreationDate="2016-10-31T20:32:10.903" Score="3" ViewCount="2403" Body="&lt;p&gt;I would to include and preview some math formula inside an &lt;code&gt;org-mode&lt;/code&gt; buffer, but can't find any way. &#xA;I've read about &lt;code&gt;auctex&lt;/code&gt; but how can I enable it in a non &lt;code&gt;tex-mode&lt;/code&gt; ? &#xA;Don't know really from where to start...&#xA;thanks in advance !&lt;/p&gt;&#xA;" OwnerUserId="13074" LastActivityDate="2016-10-31T20:32:10.903" Title="preview math formula in org-mode" Tags="|org-mode|auctex|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28306" PostTypeId="2" ParentId="28284" CreationDate="2016-10-31T20:33:45.270" Score="0" Body="&lt;p&gt;&lt;code&gt;sudo su - oracle&lt;/code&gt; is not supported by Tramp out-of-the-box. You would need to define an own method in &lt;code&gt;tramp-methods&lt;/code&gt; for this, kind of tricky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fear it will be to detailed to fiddle it out here on stackexchange. You might rather ask on the &lt;code&gt;tramp-devel@gnu.org&lt;/code&gt; mailing list.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-10-31T20:33:45.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28308" PostTypeId="2" ParentId="413" CreationDate="2016-10-31T21:27:04.457" Score="19" Body="&lt;p&gt;Have you ever tried Emacs' &lt;code&gt;M-x speedbar&lt;/code&gt;? :-) before installing some new package I'd try an inbuilt solution...&lt;/p&gt;&#xA;&lt;p&gt;Update 2020-01-10&lt;/p&gt;&#xA;&lt;p&gt;Actually I'm using now &lt;a href=&quot;https://github.com/jojojames/dired-sidebar&quot; rel=&quot;noreferrer&quot;&gt;dired-sidebar&lt;/a&gt; which is available via Melpa.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2021-01-10T17:51:28.330" LastActivityDate="2021-01-10T17:51:28.330" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="28309" PostTypeId="1" AcceptedAnswerId="28310" CreationDate="2016-10-31T21:29:34.707" Score="1" ViewCount="128" Body="&lt;p&gt;I am trying to open pdf files in specific folder using org mode. &#xA;For example, in a org file &lt;code&gt;test.org&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;My sample org file. Here is an external link: file:test.pdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I click on the link, it should open the file &lt;code&gt;/home/hakon/my_pdf_files/test.pdf&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried this: I added the following to my Emacs init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;org&quot;&#xA;  '(progn&#xA;     (setcdr (assoc &quot;\\.pdf\\'&quot; org-file-apps) &quot;/home/hakon/my_org_pdf_viewer.sh %s&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where the shell script &lt;code&gt;my_org_pdf_viewer.sh&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#! /bin/bash&#xA;&#xA;file_name=$(basename $1)&#xA;evince ~/my_pdf_files/&quot;$file_name&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this only works if the file name in the external link in &lt;code&gt;test.org&lt;/code&gt; : &lt;code&gt;file:test.pdf&lt;/code&gt; also exists as file name in the same folder as &lt;code&gt;test.org&lt;/code&gt;, which is usually not the case. If the file does not exist in that directory, Emacs shows &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No such file: &amp;lt;path/test.pdf&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the echo area.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-10-31T22:12:38.700" Title="Prevent org mode from checking if file exists in external link" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28310" PostTypeId="2" ParentId="28309" CreationDate="2016-10-31T22:12:38.700" Score="1" Body="&lt;p&gt;I think I found a solution &lt;a href=&quot;http://orgmode.org/manual/Adding-hyperlink-types.html#Adding-hyperlink-types&quot; rel=&quot;nofollow&quot;&gt;using the org feature of adding new hyperlink types&lt;/a&gt;. I can just create a new hyperlink type called &lt;code&gt;pdf&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-add-link-type &quot;pdf&quot; 'org-mypdf-open)&#xA;&#xA;(defcustom org-mypdf-command 'mypdf-open&#xA;  &quot;The Emacs command to be used to display a pdf file.&quot;&#xA;  :group 'org-link)&#xA;&#xA;(defun org-mypdf-open (path)&#xA;  &quot;View the pdf file of PATH in evince.&quot;&#xA;  (funcall org-mypdf-command path))&#xA;&#xA;(defun mypdf-open (path)&#xA;  (shell-command-to-string (concat &quot;/home/hakon/my_org_pdf_viewer.sh &quot; path)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then also change the script &lt;code&gt;/home/hakon/my_org_pdf_viewer.sh&lt;/code&gt; to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#! /bin/bash    &#xA;evince ~/my_pdf_files/&quot;$1&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;test.org&lt;/code&gt; is now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;My sample org file. Here is an external link: pdf:test.pdf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-10-31T22:12:38.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28311" PostTypeId="1" AcceptedAnswerId="28333" CreationDate="2016-10-31T23:14:50.280" Score="1" ViewCount="169" Body="&lt;p&gt;I'm trying to add support for &lt;code&gt;imenu&lt;/code&gt; in a major mode I currently writing.&lt;br&gt;&#xA;Reading documentation I've found that its API looks simple and all I want to do is to write a function and bind it to &lt;code&gt;imenu-create-index-function&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation for &lt;code&gt;imenu--index-alist&lt;/code&gt; also declares something called &lt;code&gt;nested sub-alist&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A nested sub-alist element looks like (INDEX-NAME . SUB-ALIST).&#xA;  The function ‘imenu--subalist-p’ tests an element and returns t&#xA;  if it is a sub-alist.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does it mean that one could make &lt;code&gt;imenu&lt;/code&gt; have nested structure like?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- index 1&#xA;  - sub-index&#xA;    - ...&#xA;- index 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried to return following from funciton bound to &lt;code&gt;imenu-create-index-function&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;item 1&quot; . '((&quot;sub-item&quot; . 1))) (&quot;item 2&quot; . 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And error says that it violates &lt;code&gt;integer-or-marker-p&lt;/code&gt; at &lt;code&gt;'((&quot;sub-item&quot; . 1))&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If nested structures are possible, how to form them?&lt;/p&gt;&#xA;" OwnerUserId="6551" LastEditorUserId="105" LastEditDate="2016-11-01T00:10:12.613" LastActivityDate="2016-11-01T16:50:17.267" Title="Does imenu sopport sub-indexes?" Tags="|imenu|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28312" PostTypeId="2" ParentId="28166" CreationDate="2016-11-01T00:33:46.327" Score="1" Body="&lt;p&gt;If you are using Emacs 25 or newer, the built-in command &lt;code&gt;view-lossage&lt;/code&gt; (bound to &lt;code&gt;C-h l&lt;/code&gt;) might be useful here. This shows you anything you've recently typed and the corresponding commands that were executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the output might look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; C-SPC [set-mark-command]&#xA; C-e [move-end-of-line]&#xA; M-w [kill-ring-save]&#xA; C-x o [other-window]&#xA; C-y [yank]&#xA; C-h l [view-lossage]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This command exists in earlier versions of Emacs as well, but prior to Emacs 25 it did not display the commands that were run.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-11-01T00:33:46.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28313" PostTypeId="2" ParentId="15255" CreationDate="2016-11-01T01:30:48.070" Score="-1" Body="&lt;p&gt;The question asks for an existing Emacs command to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As stated earlier:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unfortunately there is no ready made command for this&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which turns out to be the answer to this question.&lt;/p&gt;&#xA;" OwnerUserId="2506" LastEditorUserId="2506" LastEditDate="2018-05-28T23:07:55.800" LastActivityDate="2018-05-28T23:07:55.800" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28314" PostTypeId="1" AcceptedAnswerId="28315" CreationDate="2016-11-01T03:34:30.517" Score="0" ViewCount="230" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/rejeep/drag-stuff.el&quot; rel=&quot;nofollow&quot;&gt;drag-stuff&lt;/a&gt;, which defines a minor-mode (&lt;code&gt;drag-stuff-mode&lt;/code&gt;), a corresponding keymap (&lt;code&gt;drag-stuff-mode-map&lt;/code&gt;), and a globalized minor mode (&lt;code&gt;drag-stuff-global-mode&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to make some changes to the default &lt;a href=&quot;https://github.com/rejeep/drag-stuff.el/blob/master/drag-stuff.el#L331-L334&quot; rel=&quot;nofollow&quot;&gt;keybindings&lt;/a&gt;, and I'd like to use the globalized minor mode, but my changes to the keymap don't seem to affect the globalized minor mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, after turning on &lt;code&gt;drag-stuff-global-mode&lt;/code&gt;, describing &lt;code&gt;drag-stuff-mode-map&lt;/code&gt; shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(keymap&#xA; (M-left . drag-stuff-left)&#xA; (M-right . drag-stuff-right)&#xA; (M-down . drag-stuff-down)&#xA; (M-up . drag-stuff-up))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to undefine &lt;code&gt;M-left&lt;/code&gt;, so I evaluate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key drag-stuff-mode-map [M-left] nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but &lt;code&gt;drag-stuff-mode-map&lt;/code&gt; remains unchanged, and I can confirm that &lt;code&gt;M-left&lt;/code&gt; is still bound to &lt;code&gt;drag-stuff-left&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use the regular (local) minor mode, everything behaves as expected, it's only when using the globalized minor mode that I run into this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's going on, and how can I achieve what I'm trying to do?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-11-01T06:13:54.517" Title="How do I change a globalized minor mode's key bindings?" Tags="|key-bindings|keymap|minor-mode|global-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28315" PostTypeId="2" ParentId="28314" CreationDate="2016-11-01T05:25:51.660" Score="1" Body="&lt;p&gt;&lt;code&gt;drag-stuff-mode&lt;/code&gt; is poorly behaved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;drag-stuff-define-keys&lt;/code&gt; sets/clobbers &lt;code&gt;drag-stuff-mode-map&lt;/code&gt;, and it is called whenever the buffer-local &lt;code&gt;drag-stuff-mode&lt;/code&gt; is enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A 'globalized' minor mode is a global minor mode which controls a buffer-local minor mode, and it enables that buffer-local mode in every buffer to which it is applicable -- and will continue to call it as future applicable buffers are created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As is usual, the minor mode's keymap is global, so your changes (which did work) were simply being undone again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround you can use &lt;code&gt;drag-stuff-mode-hook&lt;/code&gt; to do your own clobbering each time the buffer-local mode is enabled anywhere; but this is really a bug in the library, so you should raise an issue for it with the author.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-drag-stuff-mode-hook ()&#xA;  &quot;Custom `drag-stuff-mode' behaviours.&quot;&#xA;  (define-key drag-stuff-mode-map (drag-stuff--kbd 'left) nil))&#xA;&#xA;(add-hook 'drag-stuff-mode-hook 'my-drag-stuff-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;n.b. Here I've used the helper function defined by the library in defining the key, but your own code &lt;em&gt;was&lt;/em&gt; also functional.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-11-01T06:13:54.517" LastActivityDate="2016-11-01T06:13:54.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28317" PostTypeId="1" AcceptedAnswerId="28318" CreationDate="2016-11-01T06:04:59.660" Score="4" ViewCount="2237" Body="&lt;p&gt;For those who are trying to determine how to do this here is the answer.&lt;br&gt;&#xA;Yes the answer is in the docs!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I missed it on the first pass. Then looked at questions such as the below, trying &lt;kbd&gt;b&lt;/kbd&gt; &lt;kbd&gt;u&lt;/kbd&gt; and thinking it could be set there but this was not the case.&lt;br&gt;&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/19149/how-do-i-set-the-upstream-branch-to-push-a-local-branch-to-in-magit/19150#19150&quot;&gt;How do I set the upstream branch to push a local branch to in magit?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12780" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-11-01T06:04:59.660" Title="Magit equivalent of 'git remote add origin git@github.com:user/project.git'?" Tags="|magit|remote|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28318" PostTypeId="2" ParentId="28317" CreationDate="2016-11-01T06:04:59.660" Score="10" Body="&lt;p&gt;The equivalent of the git command in Magit is to set a new Remote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://magit.vc/manual/magit.html#Remotes&quot; rel=&quot;noreferrer&quot;&gt;This is where it is in the docs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M&lt;/kbd&gt;&lt;kbd&gt;a&lt;/kbd&gt; creates a new remote.&#xA;When asked for the name of your remote, the usual answer is the name of your remote server, typically 'origin'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this saves someone some time!&lt;/p&gt;&#xA;" OwnerUserId="12780" LastActivityDate="2016-11-01T06:04:59.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28319" PostTypeId="1" AcceptedAnswerId="28334" CreationDate="2016-11-01T09:27:12.377" Score="1" ViewCount="420" Body="&lt;p&gt;I compiled a simple program in C (it does the sum of 2 numbers), by doing :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x compile RET&#xA;gcc -dummy.c -o dummy&#xA;M-x shell RET&#xA;./dummy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get a prompt for the first number I can enter, then nothing is happening. I mean I can enter the first number, do RET, enter the second number (even though I don't have the prompt for this one) and I can get the result with Ctrl-D.&#xA;So, very ugly.&#xA;Any idea what is happening under the hood and what I should do to improve that?&#xA;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is the code :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main()&#xA;{&#xA;    int nb1,nb2;&#xA;    printf(&quot;please enter nb1&quot;);&#xA;    scanf(&quot;%d \n&quot;, &amp;amp;nb1);&#xA;    printf(&quot;please enter nb2&quot;);&#xA;    scanf(&quot;%d \n&quot;, &amp;amp;nb2);&#xA;    printf(&quot;the sum:&quot;);&#xA;    printf(&quot;%d + %d = %d&quot;, nb1, nb2, nb1 + nb2);&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13074" LastActivityDate="2016-11-01T16:54:29.193" Title="interactive shell and C compilation inside emacs" Tags="|shell|shell-command|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28320" PostTypeId="2" ParentId="28271" CreationDate="2016-11-01T09:50:26.170" Score="2" Body="&lt;p&gt;The following works for me when I test on two small files (i.e., there are not many diffs).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-diff-hunks-highlight-all ()&#xA;  &quot;Highlight all hunks in diff-mode.&quot;&#xA;  (interactive)&#xA;  (run-at-time 0.1 nil&#xA;               (lambda ()&#xA;                 (save-excursion&#xA;                   (goto-char (point-min))&#xA;                   (while (not (eobp))&#xA;                     (diff-hunk-next 1)&#xA;                     (sit-for 0.01))))))&#xA;&#xA;(add-hook 'diff-mode-hook 'my-diff-hunks-highlight-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I didn't call &lt;code&gt;diff-refine-hunk&lt;/code&gt; explicitly since it will be called from &lt;code&gt;diff-hunk-next&lt;/code&gt; if &lt;code&gt;diff-auto-refine-mode&lt;/code&gt; is on (it is by default).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(run-at-time 0.1 ...)&lt;/code&gt;: gives 0.1 seconds to diff-mode to be ready&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(sit-for 0.01)&lt;/code&gt;: gives 0.01 seconds to &lt;code&gt;diff-refine-hunk&lt;/code&gt; to make effect&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The above is not a very good solution, I think. You might need to adjust the times. There should be other element way. I don't know diff-mode very much.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-01T09:50:26.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28321" PostTypeId="2" ParentId="28271" CreationDate="2016-11-01T11:35:30.447" Score="3" Body="&lt;p&gt;The actual problem is the following form in the definition of &lt;code&gt;diff-mode-hook&lt;/code&gt;. It removes all the refinement overlays that you created with your function &lt;code&gt;my-diff-hunks-highlight-all&lt;/code&gt; immediately after starting up &lt;code&gt;diff-mode&lt;/code&gt; and initializing &lt;code&gt;font-lock-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(declare-function 'diff-hunk-next &quot;diff-mode&quot;)&#xA;&#xA;(defun my-diff-refine-all ()&#xA;  &quot;Refine all diffs.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (condition-case nil&#xA;        (diff-beginning-of-hunk t)&#xA;      (error (diff-hunk-next)))&#xA;    (condition-case nil&#xA;        (while (not (eobp))&#xA;          (diff-refine-hunk)&#xA;          (diff-hunk-next))&#xA;      (user-error) ;; catches &quot;No next hunk.&quot; from `diff-hunk-next' if there is garbage at the end of the file.&#xA;      )))&#xA;&#xA;(defun my-diff-hunks-highlight-all ()&#xA;  &quot;Highlight all hunks in diff-mode.&quot;&#xA;  (add-hook 'font-lock-mode-hook #'my-diff-refine-all t t))&#xA;&#xA;(add-hook 'diff-mode-hook 'my-diff-hunks-highlight-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="5253" LastEditDate="2016-11-01T20:22:44.337" LastActivityDate="2016-11-01T20:22:44.337" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28322" PostTypeId="1" AcceptedAnswerId="28337" CreationDate="2016-11-01T12:17:40.743" Score="3" ViewCount="1341" Body="&lt;p&gt;I want my emacs to start &lt;code&gt;.php&lt;/code&gt; and others web files in web mode so i copied this code which is on the &lt;a href=&quot;http://web-mode.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;web-mode webpage&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'web-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.phtml\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.tpl\\.php\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.[agj]sp\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.as[cp]x\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.erb\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.mustache\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.djhtml\\'&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it's not working.&#xA;Here's my .emacs config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;         t)&#xA;(package-initialize)&#xA;&#xA;(require 'linum)&#xA;(require 'linum-relative)&#xA;(global-linum-mode 1)&#xA;(linum-relative-on)&#xA;&#xA;(require 'auto-complete)&#xA;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(require 'yasnippet)&#xA;(yas-global-mode 1)&#xA;&#xA;(set-language-environment &quot;UTF-8&quot;)&#xA;&#xA;(setq frame-title-format &quot;Emacs&quot;)&#xA;&#xA;(menu-bar-mode -1)&#xA;&#xA;(tool-bar-mode -1)&#xA;&#xA;(scroll-bar-mode -1)&#xA;&#xA;(set-default 'cursor-type 'hbar)&#xA;&#xA;(load-theme 'dracula t)&#xA;&#xA;&#xA;(require 'web-mode)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.phtml\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.tpl\\.php\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.[agj]sp\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.as[cp]x\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.erb\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.mustache\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.djhtml\\'&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13844" LastEditorUserId="13844" LastEditDate="2016-11-01T15:43:42.677" LastActivityDate="2016-11-01T20:25:11.777" Title="How can i start web-mode at a file's startup?" Tags="|init-file|web-mode|config|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28323" PostTypeId="2" ParentId="28322" CreationDate="2016-11-01T12:39:23.750" Score="1" Body="&lt;p&gt;The lines you copied associate &lt;code&gt;.phtml&lt;/code&gt; files with web-mode. You need another couple of lines to associate &lt;code&gt;.php&lt;/code&gt; and &lt;code&gt;.co&lt;/code&gt; files as well.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-11-01T12:39:23.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28324" PostTypeId="1" CreationDate="2016-11-01T13:01:16.220" Score="1" ViewCount="690" Body="&lt;p&gt;Unfortunately, I am not very proficient in writing my own lisp functions.  I want to create a capture template that prompts for a sub-heading of a particular heading as the capture location. E.g. for&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* heading 1&#xA;** subheading 1.1&#xA;** subheading 1.2&#xA;* heading 2&#xA;** subheading 2.1&#xA;** subheading 2.2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the template &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA; '((&quot;t&quot; &quot;todo&quot; entry (file+function &quot;~/org/org.org&quot; function-i-need)&#xA;            &quot;**** TODO %^{Brief Description} %^g\n%?\n&quot;)&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To offer targets under &lt;code&gt;subheading 2&lt;/code&gt; only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be great if someone could help me out with that. &lt;/p&gt;&#xA;" OwnerUserId="13845" LastActivityDate="2016-11-01T13:01:16.220" Title="Select subheading for capture" Tags="|org-mode|org-capture|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28325" PostTypeId="1" AcceptedAnswerId="28327" CreationDate="2016-11-01T13:59:39.030" Score="8" ViewCount="645" Body="&lt;p&gt;Given &lt;code&gt;~/foo/bar&lt;/code&gt;, I can get &lt;code&gt;/home/sds/foo/bar&lt;/code&gt; using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Expansion.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;expand-file-name&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, given &lt;code&gt;/Users/sds/foo/bar&lt;/code&gt;, how do I get &lt;code&gt;~/foo/bar&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use case: I want to copy a file between computers and they have different physical paths to my home directory.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="105" LastEditDate="2016-11-01T14:24:17.577" LastActivityDate="2016-11-01T14:42:40.420" Title="How do I unexpand a file name?" Tags="|filenames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28326" PostTypeId="1" AcceptedAnswerId="28352" CreationDate="2016-11-01T14:00:38.470" Score="8" ViewCount="1193" Body="&lt;p&gt;A. Is there a spellchecker built in to Emacs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/InteractiveSpell&quot; rel=&quot;noreferrer&quot;&gt;This&lt;/a&gt; seems to say that there is a &quot;built-in ispell package&quot; that &quot;handles spell-checking and correction&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual (Emacs &gt; Fixit &gt; Spelling &gt; 16.4) makes it sound like nothing is built in: &quot;These commands only work if the&#xA;spelling checker program Aspell, Ispell or Hunspell is installed.  These&#xA;programs are not part of Emacs, but one of them is usually installed in&#xA;GNU/Linux and other free operating systems.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B. If there is a spellchecker built in to Emacs, how do I use it? The commands in the manual (Emacs &gt; Fixit &gt; Spelling &gt; 16.4) do not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try &quot;M-x ispell&quot;, I get this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;Starting new Ispell process ispell with default dictionary...&#xA;apply: Searching for program: no such file or directory, ispell&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;C. If there is not a spellchecker built in to Emacs, what is the most simple way to get one working on a Windows 8 or 10 machine? I don't even care about &quot;on-the-fly&quot; spellchecking. I'd be happy with being able to type a command and have the spellchecker check the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="13432" LastEditDate="2016-11-02T14:45:45.807" LastActivityDate="2017-05-03T10:46:18.743" Title="What is the relationship between Emacs and various spellcheckers (ispell, etc.)?" Tags="|microsoft-windows|ispell|spell-checking|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28327" PostTypeId="2" ParentId="28325" CreationDate="2016-11-01T14:22:07.897" Score="11" Body="&lt;p&gt;Use function &lt;code&gt;abbreviate-file-name&lt;/code&gt;.  &lt;code&gt;C-h f&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;abbreviate-file-name is a compiled Lisp function in `files.el'.&#xA;&#xA;(abbreviate-file-name FILENAME)&#xA;&#xA;Return a version of FILENAME shortened using `directory-abbrev-alist`.&#xA;This also substitutes &quot;~&quot; for the user's home directory (unless the&#xA;home directory is a root directory) and removes automounter prefixes&#xA;(see the variable `automount-dir-prefix`).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Directory-Names.html&quot; rel=&quot;noreferrer&quot;&gt;Directory Names&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-11-01T14:42:40.420" LastActivityDate="2016-11-01T14:42:40.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28328" PostTypeId="2" ParentId="27639" CreationDate="2016-11-01T14:28:32.260" Score="2" Body="&lt;p&gt;I'm having similar issue with 24.5.1 which comes with Ubuntu 16 LTS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems to be somehow related to &lt;a href=&quot;https://stackoverflow.com/questions/13560933/how-to-turn-off-input-output-buffer-in-gud&quot;&gt;this&lt;/a&gt; issue and using &quot;gud-gdb&quot; command as &lt;a href=&quot;https://stackoverflow.com/a/15559663/956967&quot;&gt;suggested in an answer&lt;/a&gt; to revert to the old GUD behavior solved my problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And within that issue, &lt;a href=&quot;https://stackoverflow.com/a/14578246/956967&quot;&gt;another answer&lt;/a&gt; describes the issue of the usage of &quot;dedicated window&quot; with new GUD in more details.&lt;/p&gt;&#xA;" OwnerUserId="13846" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-03-06T18:56:52.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28330" PostTypeId="2" ParentId="27745" CreationDate="2016-11-01T15:52:46.957" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Which keymap is active in helm-recentf?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's &lt;code&gt;helm-generic-files-map&lt;/code&gt;, inherits from the &lt;code&gt;helm-type-file&lt;/code&gt; class.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-01T15:52:46.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28332" PostTypeId="1" AcceptedAnswerId="28336" CreationDate="2016-11-01T16:08:11.907" Score="1" ViewCount="234" Body="&lt;p&gt;I'm trying to install the &lt;code&gt;smartparens&lt;/code&gt; package, but I'm having trouble. When I go to &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;list-packages&lt;/code&gt;, mark &lt;code&gt;smartparens&lt;/code&gt; for installation, and hit &lt;kbd&gt;x&lt;/kbd&gt; (execute) &lt;kbd&gt;y&lt;/kbd&gt; (yes), I get the error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Required package 'dash' is disabled&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is not just for &lt;code&gt;smartparens&lt;/code&gt;, but for anything that depends on &lt;code&gt;dash&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By removing almost all of my packages except &lt;code&gt;helm-projectile&lt;/code&gt; and its dependencies, I was able to install &lt;code&gt;dash&lt;/code&gt; from either Melpa or GNU; nevertheless, every time I try to install &lt;code&gt;smartparens&lt;/code&gt; it complains that dash is disabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My essential question is what is going wrong, or what am I missing; and how can I enable &lt;code&gt;dash&lt;/code&gt; so that I can install things that depend on it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Supplementary info:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of &lt;code&gt;package-load-list&lt;/code&gt; is &lt;code&gt;((helm-core t) (helm t) (async t) (popup t))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10604" LastEditorUserId="10604" LastEditDate="2016-11-01T18:08:16.830" LastActivityDate="2016-11-01T18:18:00.777" Title="What is disabling the dash package?" Tags="|package|smartparens|dash.el|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28333" PostTypeId="2" ParentId="28311" CreationDate="2016-11-01T16:50:17.267" Score="2" Body="&lt;p&gt;It is possible to represent structured menu with &lt;code&gt;imenu&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A valid alist shape could be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list&#xA; (list &quot;Title 1&quot;&#xA;       (list &quot;Title 11&quot;&#xA;             '(&quot;Index Name 1&quot; . 1)&#xA;             '(&quot;Index Name 2&quot; . 1)))&#xA; (list &quot;Title 2&quot;&#xA;       '(&quot;Index Name 21&quot; . 1)&#xA;       '(&quot;Index Name 22&quot; . 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error was caused by quoting of &lt;code&gt;'((&quot;sub-item&quot; . 1))&lt;/code&gt; form.&lt;/p&gt;&#xA;" OwnerUserId="6551" LastActivityDate="2016-11-01T16:50:17.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28334" PostTypeId="2" ParentId="28319" CreationDate="2016-11-01T16:54:29.193" Score="2" Body="&lt;p&gt;One solution is to use M-x term or M-x ansi-term.  This will give you a real terminal emulator instead of shell-mode.&lt;/p&gt;&#xA;" OwnerUserId="7146" LastActivityDate="2016-11-01T16:54:29.193" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28335" PostTypeId="1" AcceptedAnswerId="28357" CreationDate="2016-11-01T17:01:05.990" Score="0" ViewCount="627" Body="&lt;p&gt;I recently started using spacemacs/emacs, and encountered the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I enable &lt;code&gt;popwin-mode&lt;/code&gt; I would expect popup windows to get handled by &lt;code&gt;popwin&lt;/code&gt;. However, when I run occur (&lt;code&gt;M-x occur&lt;/code&gt;), it seems to not be - the buffer with the occur results always gets opened in another buffer either to the left or right of the current one. And can not be closed with &lt;code&gt;C-g&lt;/code&gt;, as advertised.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having set &lt;code&gt;popwin-window-position&lt;/code&gt; to bottom, I would also expect occur to open a new buffer below the current one. But, as I said, it does not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone help me fix whatever is the problem here? &lt;/p&gt;&#xA;" OwnerUserId="13850" LastEditorUserId="105" LastEditDate="2016-11-01T18:03:24.463" LastActivityDate="2016-11-02T18:28:28.450" Title="popup windows, popwin problem?" Tags="|window|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28336" PostTypeId="2" ParentId="28332" CreationDate="2016-11-01T18:18:00.777" Score="1" Body="&lt;p&gt;Based on Tobias's suggestion in the comments, I found that &lt;code&gt;package-load-list&lt;/code&gt; was getting overridden in my &lt;code&gt;init.el&lt;/code&gt; by a code snippet that I'd gotten from &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/master/emacs-helm.sh#L84&quot; rel=&quot;nofollow noreferrer&quot;&gt;someone else&lt;/a&gt;. Commenting out that line didn't seem to affect helm, and it fixed my original problem.&lt;/p&gt;&#xA;" OwnerUserId="10604" LastActivityDate="2016-11-01T18:18:00.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28337" PostTypeId="2" ParentId="28322" CreationDate="2016-11-01T20:25:11.777" Score="4" Body="&lt;p&gt;This line is in error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.tpl\\.php\\'&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It doesn't open &lt;code&gt;.tpl&lt;/code&gt; files &lt;em&gt;and&lt;/em&gt; &lt;code&gt;.php&lt;/code&gt; files in web-mode, it opens files ending &lt;code&gt;.tpl.php&lt;/code&gt; in web-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amusingly, I have that in my init file also; it came from somewhere on the web. And it doesn't work for me either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to fix it, add two separate lines, one for each filetype:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.tpl\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.php\\'&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-11-01T20:25:11.777" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28338" PostTypeId="1" CreationDate="2016-11-01T20:27:11.193" Score="2" ViewCount="103" Body="&lt;p&gt;When writing Lisp, I often encounter a long line such as the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(map function (|apply append long-list-name1 long-list-name2 long-list-name3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(where '|' denotes the point).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be a problem for readability especially if the long line ends up being nested at a deeper level.  Is there a package available that will transform this into the following (and also perform the inverse operation)?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(map function (|apply append&#xA;                      long-list-name1 &#xA;                      long-list-name2 &#xA;                      long-list-name3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="7146" LastEditDate="2016-11-01T20:41:45.233" LastActivityDate="2016-11-02T08:57:08.080" Title="Rearranging whitespace in sexps" Tags="|text-editing|programming|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28339" PostTypeId="1" CreationDate="2016-11-01T23:51:59.673" Score="4" ViewCount="321" Body="&lt;p&gt;&lt;em&gt;Is there any way to postpone or update all expired deadlines (or scheduled tasks) at once in org-agenda mode?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to schedule more than I can handle and need a way to quickly either (a) remove old deadlines or (b) postpone old deadlines. (It would be nice to have a similar tool for the &quot;SCHEDULED&quot; property as well.)&lt;/p&gt;&#xA;" OwnerUserId="13854" LastEditorUserId="253" LastEditDate="2016-11-01T23:59:37.503" LastActivityDate="2016-11-01T23:59:37.503" Title="Is there any way to postpone or update all expired deadlines (or scheduled tasks) at once?" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28340" PostTypeId="1" AcceptedAnswerId="28341" CreationDate="2016-11-02T03:36:31.163" Score="5" ViewCount="265" Body="&lt;p&gt;Emacs' byte-compiler can tell me if I call pure functions without saving the result:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo-calls-add ()&#xA;  ;; value returned from (+ 1 2) is unused:&#xA;  (+ 1 2)&#xA;  12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I don't get any warnings when I define my own pure functions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo-pure (x)&#xA;  (declare (pure t) (side-effect-free error-free))&#xA;  x)&#xA;&#xA;(defun foo-calls-pure ()&#xA;  ;; No warning here:&#xA;  (foo-pure 1)&#xA;  12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What do I need to do in order for the byte compiler to warn about &lt;code&gt;foo-calls-pure&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've compared &lt;code&gt;(symbol-plist '+)&lt;/code&gt; with &lt;code&gt;(symbol-plist 'foo-pure)&lt;/code&gt; and I can't see any obvious missing properties.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2016-11-08T15:10:08.383" LastActivityDate="2016-11-08T15:10:08.383" Title="How can I make Emacs warn about calls to my pure functions?" Tags="|byte-compilation|warning|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28341" PostTypeId="2" ParentId="28340" CreationDate="2016-11-02T04:59:03.530" Score="6" Body="&#xA;&#xA;&lt;p&gt;If you look in &lt;code&gt;byte-optimize-form-code-walker&lt;/code&gt;, you can see that a warning is printed for side-effect-free functions, but error-free functions just get optimized out and logged (not warned) only.  Logging means it only shows up if have &lt;code&gt;byte-optimize-log&lt;/code&gt; set to non-nil (you'll want to set it to &lt;code&gt;source&lt;/code&gt; otherwise there's a lot of noise).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;      ((and for-effect (setq tmp (get fn 'side-effect-free))&#xA;            (or byte-compile-delete-errors&#xA;                (eq tmp 'error-free)&#xA;                (progn&#xA;                  (byte-compile-warn &quot;value returned from %s is unused&quot;&#xA;                                     (prin1-to-string form))&#xA;                  nil)))&#xA;       (byte-compile-log &quot;  %s called for effect; deleted&quot; fn)&#xA;       ;; appending a nil here might not be necessary, but it can't hurt.&#xA;       (byte-optimize-form&#xA;        (cons 'progn (append (cdr form) '(nil))) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally, the declaration doesn't take effect during compilation unless you use &lt;code&gt;eval-when-compile&lt;/code&gt;, so you'll need something like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-and-compile&#xA;  (defun foo-pure (x)&#xA;    (declare (pure t) (side-effect-free t))&#xA;    x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or to avoid putting the whole &lt;code&gt;defun&lt;/code&gt; inside &lt;code&gt;eval-and-compile&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-and-compile (function-put 'foo-pure 'side-effect-free 't))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-11-02T04:59:03.530" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28342" PostTypeId="2" ParentId="28338" CreationDate="2016-11-02T06:27:13.377" Score="1" Body="&lt;p&gt;I &quot;translate&quot; manual steps into Emacs Lisp. It works in the following demos but it is not reliable (that is, it will produce unexpected results or even block your Emacs, if you run the commands at the wrong position).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo| bar baz)&#xA;  -&amp;gt;&#xA;(foo|&#xA; bar&#xA; baz)&#xA;&#xA;(defun indent-sexp-after-point ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (while (condition-case nil&#xA;               (prog1 t&#xA;                 (forward-sexp)&#xA;                 (backward-sexp)&#xA;                 (newline-and-indent)&#xA;                 (forward-sexp))&#xA;             (error nil)))))&#xA;&#xA;(foo|&#xA; bar&#xA; baz)&#xA;  -&amp;gt;&#xA;(foo| bar baz)&#xA;&#xA;(defun join-sexp-after-point ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (while (condition-case nil&#xA;               (prog1 t&#xA;                 (forward-sexp)&#xA;                 (backward-sexp)&#xA;                 (delete-indentation)&#xA;                 (forward-sexp))&#xA;             (error nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-02T06:27:13.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28343" PostTypeId="1" AcceptedAnswerId="28353" CreationDate="2016-11-02T06:53:59.783" Score="4" ViewCount="599" Body="&lt;p&gt;I'm sure emacs used to do it my way, but things appear to have changed (probably years ago, I've just been living with the pain).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want this (to conform to corp. standards):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MULTIFORM=$(&#xA;    curl -k -A http://foo.com |&#xA;    grep -m1 multiform |&#xA;    tr '=' '\n' |&#xA;    tail -1 |&#xA;    cut -d &quot;'&quot; -f 2&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But emacs-25.1 insists that this is the right way to indent:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MULTIFORM=$(&#xA;    curl -k -A http://foo.com |&#xA;        grep -m1 multiform |&#xA;        tr '=' '\n' |&#xA;        tail -1 |&#xA;        cut -d &quot;'&quot; -f 2&#xA;         )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... quite apart from our standards, it's ugly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried messing around with sh-learn-line-indent and it offers rules like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;close-all &quot;)&quot;&#xA;list-intro &quot;;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... but playing with them gives no joy at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="13856" LastActivityDate="2018-12-28T13:51:51.477" Title="sh-script alignment issues" Tags="|indentation|major-mode|shell-mode|bash|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28344" PostTypeId="2" ParentId="28338" CreationDate="2016-11-02T08:50:47.450" Score="0" Body="&lt;p&gt;Thanks xuchunyang - below a variant of this solution: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;indent-sexp-after-point&lt;/code&gt; should indent according to column of symbol before.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo bar| baz)&#xA;  -&amp;gt;&#xA;(foo bar|&#xA;     baz)&#xA;&#xA;(defun indent-sexp-after-point ()&#xA;  (interactive &quot;*&quot;)&#xA;  (save-excursion&#xA;    (let ((indent (save-excursion (backward-sexp)&#xA;                  (current-column))))&#xA;      (while (ignore-errors&#xA;           (prog1 t&#xA;        (forward-sexp)&#xA;        (backward-sexp)&#xA;        (newline)&#xA;        (indent-to indent)&#xA;        (forward-sexp)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;join-sexp-after-point&lt;/code&gt; should be protected against eternal loop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(foo|&#xA; bar&#xA; baz)&#xA;  -&amp;gt;&#xA;(foo| bar baz)&#xA;&#xA;(defun join-sexp-after-point ()&#xA;  (interactive &quot;*&quot;)&#xA;  (save-excursion&#xA;    (let (orig)&#xA;      (while (ignore-errors&#xA;           (progn&#xA;         (forward-sexp)&#xA;         (setq orig (copy-marker (point)))&#xA;         (backward-sexp)&#xA;         (delete-indentation)&#xA;         (forward-sexp)&#xA;         (&amp;lt;= orig (point))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2016-11-02T08:50:47.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28345" PostTypeId="2" ParentId="28338" CreationDate="2016-11-02T08:57:08.080" Score="1" Body="&lt;p&gt;You can use the command &lt;code&gt;special-lispy-alt-multiline&lt;/code&gt; from abo-abo's &lt;a href=&quot;https://github.com/abo-abo/lispy&quot; rel=&quot;nofollow noreferrer&quot;&gt;lispy&lt;/a&gt;. In lispy-mode, it is bound to &lt;code&gt;M&lt;/code&gt;. There is also a &lt;code&gt;special-lispy-oneline&lt;/code&gt; command bound to &lt;code&gt;O&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not familiar with lispy, the key bindings might surprise you (they're just letters!): the idea in lispy, is that since you are quite unlikely to want to put a letter immediately to the left of an opening parenthesis, or immediately to the right of a closing one, letter keys can be made to do double duty: they insert the letter away from those locations and do something else just outside a parenthesized expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I should point out that while this command comes close to what you want it doesn't do exactly what you asked for: pressing &lt;code&gt;M&lt;/code&gt; will convert&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(map function |(apply append long-list-name1 long-list-name2 long-list-name3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(map function (apply&#xA;               append&#xA;               long-list-name1&#xA;               long-list-name2&#xA;               long-list-name3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-11-02T08:57:08.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28346" PostTypeId="2" ParentId="13799" CreationDate="2016-11-02T10:06:28.027" Score="1" Body="&lt;p&gt;What you want to do is &lt;code&gt;M-g&lt;/code&gt; I think. It will get ride of the deleted articles. This shortcut is bound to &lt;code&gt;gnus-summary-rescan-group&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically it will exit the group, ask for new articles then select the group again.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastEditorUserId="13859" LastEditDate="2017-11-29T16:18:45.190" LastActivityDate="2017-11-29T16:18:45.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28347" PostTypeId="2" ParentId="23786" CreationDate="2016-11-02T12:08:44.000" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Installing helm didn't solve the problem, so I'll stick with your 'solution'. :-)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Try to write &lt;code&gt;(require 'sr-speedbar)&lt;/code&gt; after your &lt;code&gt;(require 'helm)&lt;/code&gt; with many of your &lt;em&gt;helm&lt;/em&gt; configuration along.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm)&#xA;(require 'helm-config)&#xA;;; Your preferred configuration for Helm.&#xA;;; ...&#xA;&#xA;(require 'sr-speedbar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13860" LastActivityDate="2016-11-02T12:08:44.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28348" PostTypeId="1" AcceptedAnswerId="28351" CreationDate="2016-11-02T12:59:38.323" Score="6" ViewCount="471" Body="&lt;p&gt;This question refers exclusively to interactive functions that modify the contents of the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does one need to do to ensure that a single execution of &lt;code&gt;(undo)&lt;/code&gt;, right after running the function, will fully undo all the changes it made to the buffer's contents?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For the rest of this post I'll use the word &lt;em&gt;undoable&lt;/em&gt; to mean &quot;can be undone with a single execution of &lt;code&gt;(undo)&lt;/code&gt;&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Apparently, interactive functions are not undoable by default, as the example below shows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(NB: I stress that the function below is just an example of the problem; I'm looking for a general solution, not one that just works for this particular function/use-case.  Also, please do not use this function!  In addition to not being undoable, it has other shortcomings.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;quote-region&lt;/code&gt; inserts single quotes at the beginning and end of the current region, and replaces all occurrences of single quotes in-between with a backslash-escaped single quote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun quote-region ()&#xA;  (interactive)&#xA;&#xA;  (let ((beginning (region-beginning))&#xA;        (end       (region-end)))&#xA;&#xA;    (goto-char end)&#xA;    (insert &quot;'&quot;)&#xA;&#xA;    (replace-string &quot;'&quot; &quot;\\'&quot; nil beginning end)&#xA;&#xA;    (goto-char beginning)&#xA;    (insert &quot;'&quot;)&#xA;&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, if the current region's content is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo'bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...then running &lt;code&gt;M-x quote-region&lt;/code&gt; will change it to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'foo\'bar'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...as desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;But&lt;/em&gt; if I now hit &lt;code&gt;C-/&lt;/code&gt; (&lt;code&gt;undo&lt;/code&gt;), the buffer changes to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo'bar'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I must then hit &lt;code&gt;C-/&lt;/code&gt; a &lt;em&gt;second&lt;/em&gt; time to return to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo'bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence &lt;code&gt;quote-region&lt;/code&gt; is not &lt;em&gt;undoable&lt;/em&gt;, as defined above.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-11-02T15:18:35.147" LastActivityDate="2016-11-02T15:18:35.147" Title="How to make interactive functions (simply) undoable?" Tags="|functions|undo|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28349" PostTypeId="1" CreationDate="2016-11-02T13:17:00.937" Score="3" ViewCount="274" Body="&lt;p&gt;I'm using pomodoro method of focus-enhanced time allocation when I work in my tasks. In Emacs (I'm using Windows 10), here comes the org-pomodoro package for org-mode, where I can 'clock-in' an item in an .org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want is to extend the function in two ways:&#xA;1. When the countdown is finished, I want Emacs to send out a system pop-up windows in case the Emacs windows is minimized or not active.&#xA;2. I want to log the pomodoro by adding a line to the item in the .org file where I 'clock-in' and potentially with pomodoro count.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some knowledge of Lisp but hacking Emacs Lisp (except for the really long .emacs file and tiny code files in load-path I have written).&#xA;Where should I begin?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please give me some ideas and your opinion.&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="6942" LastEditorUserId="6942" LastEditDate="2016-11-05T13:54:19.370" LastActivityDate="2016-11-05T13:54:19.370" Title="org-pomodoro - extending its function: popup windows and pomo logging" Tags="|org-mode|org-capture|org-clock|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28350" PostTypeId="1" CreationDate="2016-11-02T13:25:59.170" Score="3" ViewCount="150" Body="&lt;p&gt;My Emacs crashes seemingly randomly. Is there a way to view the &lt;em&gt;Messages&lt;/em&gt; buffer after it crashed? Or is there another standard way of approaching this problem? I'd like to see an error message so that I can start pinpointing the source of the crash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run Arch Linux with Emacs 25.1.1 and AucTeX 11.89-3&lt;/p&gt;&#xA;" OwnerUserId="12821" LastActivityDate="2016-12-03T01:17:29.490" Title="How to debug seemingly random crashes of AucTeX?" Tags="|auctex|crash|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28351" PostTypeId="2" ParentId="28348" CreationDate="2016-11-02T13:50:43.327" Score="10" Body="&lt;p&gt;I recommend you do &lt;code&gt;C-h f replace-string RET&lt;/code&gt; and read it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[...]&#xA;This function is for interactive use only;&#xA;in Lisp code use `search-forward' and `replace-match' instead.&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, as suggested replace that call with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while (search-backward &quot;'&quot; beginning t)&#xA;  (replace-match &quot;\\'&quot; t t)&#xA;  (goto-char (match-beginning 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some functions do &quot;unusual&quot; additional things which are helpful in interactive use but get in the way when you need their main functionality within your own function.  Among those &quot;unusual&quot; operations, some interactive functions (such as &lt;code&gt;replace-string&lt;/code&gt;) insert an undo-boundary, others set the mark (e.g. &lt;code&gt;beginning-of-buffer&lt;/code&gt;), etc...  We try to help the user discover those quirks by documenting them in the &lt;code&gt;C-h f&lt;/code&gt; output, and we also try to make the byte-compiler emit a warning when it sees you call such a function, but you need to &lt;code&gt;C-h f&lt;/code&gt; or to byte-compile your file in order to discover the problem.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-11-02T14:54:04.597" LastActivityDate="2016-11-02T14:54:04.597" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28352" PostTypeId="2" ParentId="28326" CreationDate="2016-11-02T14:17:36.873" Score="7" Body="&lt;p&gt;Quote from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Spelling.html#Spelling&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h3&gt;16.4 Checking and Correcting Spelling&lt;/h3&gt;&#xA;  &#xA;  &lt;p&gt;This section describes the commands to check the spelling of a single&#xA;  word or of a portion of a buffer. These commands only work if the&#xA;  spelling checker program Aspell, Ispell or Hunspell is installed.&#xA;  These programs are not part of Emacs, but one of them is usually&#xA;  installed in GNU/Linux and other free operating systems.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You have to install and configure the binaries separately.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Hunspell&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Eli Zaretskii's &lt;a href=&quot;https://sourceforge.net/projects/ezwinports/files/?source=navbar&quot; rel=&quot;nofollow noreferrer&quot;&gt;Port&lt;/a&gt;: Version 1.3.2 (32bit) is not the latest version, but it is safe to assume that this one works with Emacs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/msys2/msys2/wiki/MSYS2-installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Msys2&lt;/a&gt;: You have to install Msys2 first and then Hunspell version 1.4.1 through &lt;code&gt;pacman&lt;/code&gt;.  Depending on your OS, you can have a 32 or 64bit version.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fhunspell%2Fhunspell-1.4.1-1&amp;amp;grep=hunspell&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cygwin&lt;/a&gt;: You have to install Cygwin first and then Hunspell through their package manager.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h1&gt;Aspell&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Msys2: Again, with Msys2 you can have Aspell version 0.60.7&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Faspell%2Faspell-0.60.6.1-1&amp;amp;grep=aspell&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cygwin&lt;/a&gt;: With Cygwin, you can have version 0.60.6.1 or&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://aspell.net/win32/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Official site&lt;/a&gt;:  An outdated version (Released Dec 22, 2002)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h1&gt;Ispell&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://w32tex.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;W32TeX&lt;/a&gt;: Ispell version 3.4. is distributed along with W32TeX, you can get the binary as a separate download.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h1&gt;What to use?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This is not answered easily: Aspell's development &lt;a href=&quot;http://lists.gnu.org/archive/html/aspell-devel/2011-09/msg00000.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;has stalled&lt;/a&gt;, but it does a good job for English language.  Ispell's development is going forward after a long halt, if you're old school, you want to go with it.  Hunspell is under development and new versions appear from time to time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hunspell has the feature that you can combine multiple dictionaries.  This feature is supported by ispell.el shipped with Emacs 25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Msys2 and Hunspell.&lt;/p&gt;&#xA;" OwnerUserId="12242" LastEditorUserId="12242" LastEditDate="2017-05-03T10:46:18.743" LastActivityDate="2017-05-03T10:46:18.743" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28353" PostTypeId="2" ParentId="28343" CreationDate="2016-11-02T14:48:16.897" Score="4" Body="&lt;p&gt;For the indentation after the &lt;code&gt;|&lt;/code&gt; you should be able to get the right result by going to the incorrect line (i.e. the one that starts with &lt;code&gt;grep&lt;/code&gt;) and then do &lt;code&gt;M-x smie-config-set-indent RET before &quot;|&quot; RET nil RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But smie-config is not up to the task when it comes to tweaking the behavior of the close paren in the way you want.  For that you'll need actual code.  One possible approach could look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-sh-indent-rules ()&#xA;  (when (eq ?= (char-before))&#xA;    (skip-chars-backward &quot;[:alnum:]_=&quot;)&#xA;    (current-column)))&#xA;&#xA;(add-hook 'sh-mode-hook&#xA;          (lambda ()&#xA;            (add-hook 'smie-indent-functions&#xA;                      #'my-sh-indent-rules&#xA;                      nil 'local)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, if you want to handle the &lt;code&gt;|&lt;/code&gt; alignment &quot;by hand&quot; rather than via &lt;code&gt;smie-config&lt;/code&gt;, you could do it this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-sh-smie-rules (orig-fun kind token)&#xA;  (pcase (cons kind token)&#xA;   (`(:before . &quot;|&quot;) nil)&#xA;   (_ (funcall orig-fun kind token))))&#xA;(advice-add 'sh-smie-sh-rules :around #'my-sh-smie-rules)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;wef: This is the final bit of the puzzle that Stefan gave me in my muddle below - how to save the customisations for next time. As he said, I needed to teach &lt;code&gt;smie&lt;/code&gt; about my preferences eg with &lt;code&gt;M-x smie-config-set-indent&lt;/code&gt; then run &lt;code&gt;M-x smie-config-save&lt;/code&gt; and look at the variable &lt;code&gt;smie-config&lt;/code&gt;. Finally, I copied those rules (in my case, just one rule) into &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-sh-indent-rules ()&#xA;  (smie-config-local '((nil :before &quot;|&quot; (column . 8)))))&#xA;(add-hook 'smie-indent-functions #'my-sh-indent-rules)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There may be other ways to do this eg with the commands in &lt;code&gt;sh-mode&lt;/code&gt; eg &lt;code&gt;M-x sh-learn-line-indent&lt;/code&gt; - but I wasn't able to get it to work.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2018-12-28T13:51:51.477" LastActivityDate="2018-12-28T13:51:51.477" CommentCount="14" ContentLicense="CC BY-SA 4.0" />
  <row Id="28354" PostTypeId="1" CreationDate="2016-11-02T15:37:51.180" Score="0" ViewCount="174" Body="&lt;p&gt;I'm regularly compiling some C programs and one thing is annoying : after I've compiled, I'm opening a shell with &lt;code&gt;M-x shell ./foo&lt;/code&gt;, but the shell open in place of the source code's window. &#xA;I would like the shell buffer to open in place of the compilation window, which I don't really need anymore. Otherwise, it's an overkill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read about this topic &lt;a href=&quot;https://emacs.stackexchange.com/questions/5745/open-buffer-in-a-specified-frame&quot;&gt;open buffer in a specified frame&lt;/a&gt; but my emacs lisp competence are not that great and I can't adapt it to my case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance! I guess I'm not the only one it can help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added a screenshot to make things clearer.&#xA;Let's call the above window &quot;A&quot; and the below &quot;B&quot;. When I call the shell, i.e &lt;code&gt;M-x shell&lt;/code&gt; (I rather use &lt;code&gt;M-x term&lt;/code&gt; but that the same here), A has the focus, which is probably the reason why the shell window open in place of A. I want it to open in place of A (originally the compilation window).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SGKSf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SGKSf.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-11-02T16:10:04.980" Title="open the shell buffer in the same frame as compilation buffer -- C compilation" Tags="|buffers|frames|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28355" PostTypeId="1" CreationDate="2016-11-02T16:59:39.203" Score="8" ViewCount="3043" Body="&lt;p&gt;I wish to remove selection programatically, what is the proper way of doing this? Specifically I wish to write a function to make swiper search in buffer with selected text, but it needs to remove selection before open swiper window. Here's the function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sandric/swiper-or-region (beg end)&#xA;  &quot;Swiper region or 'empty string' if none highlighted.&quot;&#xA;  (interactive (if (use-region-p)&#xA;                   (list (region-beginning) (region-end))&#xA;                 (list nil nil)))&#xA;  (if (and beg end)&#xA;      (progn&#xA;        (keyboard-quit)&#xA;        (swiper (buffer-substring-no-properties beg end)))&#xA;    (swiper)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see there's a &lt;code&gt;(keyboard-quit)&lt;/code&gt; call before swiper command to open swiper buffer, but with that it simply discards swiper buffer as if ESC was called already after swiper buffer appeared. So I need to find a better way.&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="105" LastEditDate="2016-11-02T21:50:44.850" LastActivityDate="2019-05-11T13:49:42.227" Title="How to unmark selection in elisp?" Tags="|region|mark|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28356" PostTypeId="2" ParentId="28355" CreationDate="2016-11-02T17:01:51.723" Score="15" Body="&lt;p&gt;Ok, I found the answer almost immediately after posting question. The function name is &lt;code&gt;deactivate-mark&lt;/code&gt; if anyone has the same question. Its described &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/The-Mark.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. Updated code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sandric/swiper-or-region (beg end)&#xA;  &quot;Swiper region or 'empty string' if none highlighted.&quot;&#xA;  (interactive (if (use-region-p)&#xA;                   (list (region-beginning) (region-end))&#xA;                 (list nil nil)))&#xA;  (if (and beg end)&#xA;      (progn&#xA;        (deactivate-mark)&#xA;        (swiper (buffer-substring-no-properties beg end)))&#xA;    (swiper)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="21299" LastEditDate="2019-05-11T13:49:42.227" LastActivityDate="2019-05-11T13:49:42.227" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="28357" PostTypeId="2" ParentId="28335" CreationDate="2016-11-02T17:12:20.310" Score="1" Body="&lt;p&gt;@Tobias's comment led me to the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;popwin&lt;/code&gt; has a variable &lt;code&gt;special-display-config&lt;/code&gt; which specifies, in various ways, on what buffers it should act on. The spacemacs default configuration does not by default handle &lt;code&gt;occur-mode&lt;/code&gt;. I added an entry named &lt;code&gt;*occur*&lt;/code&gt; via &lt;code&gt;M-x customize-variable&lt;/code&gt;, and now it works. &lt;/p&gt;&#xA;" OwnerUserId="13850" LastEditorUserId="13850" LastEditDate="2016-11-02T18:28:28.450" LastActivityDate="2016-11-02T18:28:28.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28359" PostTypeId="1" AcceptedAnswerId="28360" CreationDate="2016-11-02T19:35:29.343" Score="3" ViewCount="466" Body="&lt;p&gt;Is there a way to visually show the merge-base of two branches in Magit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it should be easy to do, there's git merge-base that returns the SHA1 of the commit, so maybe we could mark it in the log screen?&lt;/p&gt;&#xA;" OwnerUserId="13865" LastActivityDate="2016-12-02T21:08:23.097" Title="How to show merge-base in Magit?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28360" PostTypeId="2" ParentId="28359" CreationDate="2016-11-02T20:09:11.027" Score="4" Body="&lt;p&gt;Magit does not visualize the merge-base. (There are commands that use it to do their thing internally though.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is more of a feature request and should be taken to the issue tracker on Github. If you do so then please explain a little more about your use-cases and also how Magit is supposed to know which merge-base to visualize (i.e. if a log shows more than two branches, which two shall it be?).&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-11-02T20:09:11.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28361" PostTypeId="2" ParentId="28253" CreationDate="2016-11-02T20:20:14.987" Score="3" Body="&lt;p&gt;Magit doesn't deal with authentication directly and leaves that all to Git. The only thing Magit does is that when Git asks the user to provide a password or passphrase, then it forwards that question to the user and later hands the reply to Git.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Git provides many alternative methods for remembering the secret needed to access a remote repository and they all work with Magit. Some of the available options are described &lt;a href=&quot;https://help.github.com/categories/ssh&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;https://help.github.com/articles/caching-your-github-password-in-git&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, and &lt;a href=&quot;https://help.github.com/articles/updating-credentials-from-the-osx-keychain&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can access remote repositories on the command line without having to provide a secret, but not inside Magit, then that is a configuration issue. For example on Windows your shell and Emacs may not agree on the location of &lt;code&gt;$HOME&lt;/code&gt;. See &lt;a href=&quot;https://github.com/magit/magit/wiki/Pushing-with-Magit-from-Windows&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pushing with Magit from Windows&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-11-02T20:20:14.987" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28362" PostTypeId="2" ParentId="28251" CreationDate="2016-11-02T20:29:21.097" Score="2" Body="&lt;p&gt;The advantage of using &lt;code&gt;sshfs&lt;/code&gt; is that you can remote files using local processes just as if the files actually were local. Except it's significantly slower than if the files actually were local when doing IO-heavy stuff. The advantage then becomes a disadvantage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It wouldn't make much sense to teach Magit to run Git on the other machine. That would be an immense effort and the only effect would be that the advantage and the disadvantage of using &lt;code&gt;sshfs&lt;/code&gt; cancel each other out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead you should figure out how to address the issue you are having with Tramp. That's the right tool for the job. Or ssh to the remote machine and then run &lt;code&gt;emacs -nw&lt;/code&gt; (if available).&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-11-02T20:29:21.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28364" PostTypeId="2" ParentId="28350" CreationDate="2016-11-02T22:52:45.470" Score="1" Body="&lt;p&gt;For hard crashes (segfaults, aborts), you'll need to use &lt;code&gt;gdb&lt;/code&gt;, see &lt;code&gt;etc/DEBUG&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I run Arch Linux with Emacs 25.1.1&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's probably Emacs bug#24821/24358, see &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24821#8&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24821#8&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does it help to apply the following patches?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=9afea93ed536fb9110ac62b413604cf4c4302199&#xA;http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=71ca4f6a43bad06192cbc4bb8c7a2d69c179b7b0&#xA;http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=1047496722a58ef5b736dae64d32adeb58c5055c&#xA;http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=96ac0c3ebce825e60595794f99e703ec8302e240&#xA;http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=43986d16fb6ad78a627250e14570ea70bdb1f23a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;Alternatively, try configuring with &lt;code&gt;REL_ALLOC=no&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-11-02T22:52:45.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28365" PostTypeId="1" AcceptedAnswerId="28374" CreationDate="2016-11-03T07:50:43.753" Score="-1" ViewCount="1928" Body="&lt;p&gt;I am trying to escape some text for a shell command, but i am gettig stuck with this error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not enough arguments for format string&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what i can tell its trying to interpret the % symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This snippet produce the error when i output the command, but its fine if i pass it to shell-command.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(setq dc-str-addresses &quot;{{printf \\\&quot;%.30s\\\&quot; .Name}}{{printf\\\&quot;%.22s\\\&quot; .IPAddress }}&quot;)&#xA;(message (format &quot;test %s&quot; dc-str-addresses))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where as this one outputs fine, but give me %% when i pass it to shell-command so how can i make this work for both ? can i tell lisp to ignore the % symbols in my string ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(setq dc-str-addresses &quot;{{printf \\\&quot;%%.30s\\\&quot; .Name}}{{printf \\\&quot;%%.22s\\\&quot; .IPAddress }}&quot;)&#xA;(message (format &quot;test %s&quot; dc-str-addresses))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: test {{printf \&quot;%.30s\&quot; .Name}}{{printf \&quot;%.22s\&quot; .IPAddress }}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am running the command through shell in this manner.&#xA;    (shell-command dc-str-addresses)&lt;/p&gt;&#xA;" OwnerUserId="13729" LastEditorUserId="13729" LastEditDate="2016-11-03T10:52:42.630" LastActivityDate="2016-11-03T12:14:46.967" Title="How do you correctly escape characters in string for example %" Tags="|formatting|escape|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28366" PostTypeId="1" CreationDate="2016-11-03T08:44:38.027" Score="6" ViewCount="1658" Body="&lt;p&gt;I would like to be able to switch to an open window by typing the name of the buffer which is displayed in it.&#xA;It would be something like C-x b which opens the selected buffer only if it is not opened in another windows and in that case the focus switch to that window.&lt;/p&gt;&#xA;" OwnerUserId="13656" LastActivityDate="2020-10-04T06:15:48.290" Title="Go to window by buffername" Tags="|buffers|window|navigation|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28367" PostTypeId="1" AcceptedAnswerId="28368" CreationDate="2016-11-03T09:48:00.293" Score="16" ViewCount="3716" Body="&lt;p&gt;It's a simple thing. My cursor is over a word and I want to get the word so that I can do something with it. I see a few different ways to do this but want to avoid reinvention and use a standard method.&lt;/p&gt;&#xA;" OwnerUserId="2808" LastEditorUserId="105" LastEditDate="2016-11-03T16:13:20.150" LastActivityDate="2019-09-22T01:50:15.200" Title="Get word at point" Tags="|words|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28368" PostTypeId="2" ParentId="28367" CreationDate="2016-11-03T09:54:35.800" Score="22" Body="&lt;p&gt;You can use the function &lt;code&gt;thing-at-point&lt;/code&gt; and tell it to return the &lt;code&gt;word&lt;/code&gt; at point and not return any text properties (unless you need them). Example buffer contents (| is the cursor):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hello wor|ld&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Calling &lt;code&gt;(thing-at-point 'word 'no-properties)&lt;/code&gt; returns &quot;world&quot;.&lt;/p&gt;&#xA;" OwnerUserId="9257" LastActivityDate="2016-11-03T09:54:35.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28369" PostTypeId="1" CreationDate="2016-11-03T10:01:31.207" Score="12" ViewCount="1696" Body="&lt;p&gt;I'm attempting to set up multiple Gmail accounts using &lt;code&gt;mu4e-context&lt;/code&gt;'s. I have a lot of the features working except one. I can switch between contexts, update my mail in each account (using offlineimap) and I can send mail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I have multiple lines in my &lt;code&gt;.authinfo&lt;/code&gt; file, that have the same hostname - I was assuming that &lt;code&gt;mu4e&lt;/code&gt; would be able to differentiate by username, this appears to not be the case. It doesn't matter which context I am in, the mail is always being sent from the account that is configured &lt;em&gt;first&lt;/em&gt; in the &lt;code&gt;.authinfo&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how to make each context use separate credentials for logging into the Gmail SMTP Server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought about attempting to set up some hostname aliases so that &lt;code&gt;personal.gmail.com&lt;/code&gt; and &lt;code&gt;work.gmail.com&lt;/code&gt; both resolve to &lt;code&gt;smtp.gmail.com&lt;/code&gt; so that I can give them separate machine names in &lt;code&gt;authinfo&lt;/code&gt;, but I am unsure how to achieve this (on OSX) or even if it's a sensible way to solve this problem (Ideally I'd not have to monkey around with config outside of Emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My authinfo looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine smtp.gmail.com login personal@example.com port 587 password fakepassword&#xA;machine smtp.gmail.com login work@example.com port 587 password fakepassword&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the relevant parts of my mu4e-config is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mu4e-get-mail-command &quot;offlineimap&quot;)&#xA;(setq mail-user-agent 'mu4e-user-agent)&#xA;(setq message-send-mail-function 'smtpmail-send-it)&#xA;&#xA;(setq smtpmail-stream-type 'starttls)&#xA;(setq smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;)&#xA;(setq smtpmail-smtp-server &quot;smtp.gmail.com&quot;)&#xA;(setq smtpmail-smtp-service 587)&#xA;&#xA;(setq mu4e-contexts&#xA;      `( ,(make-mu4e-context&#xA;           :name &quot;personal&quot;&#xA;           :enter-func (lambda () (mu4e-message &quot;Switch to Personal context&quot;))&#xA;           ;; leave-func not defined&#xA;           :match-func (lambda (msg)&#xA;                         (when msg&#xA;                           (mu4e-message-contact-field-matches msg :to &quot;personal@example.com&quot;)))&#xA;           :vars '(  (user-mail-address . &quot;personal@example.com&quot;  )&#xA;                     (mu4e-drafts-folder . &quot;/personal/drafts&quot;)&#xA;                     (mu4e-sent-folder   . &quot;/personal/sent&quot;)&#xA;                     (mu4e-trash-folder  . &quot;/personal/bin&quot;)&#xA;                     (mu4e-maildir-shortcuts . ((&quot;/personal/INBOX&quot; . ?i)&#xA;                                                (&quot;/personal/sent&quot;  . ?s)&#xA;                                                (&quot;/personal/bin&quot;   . ?t)))&#xA;                     (smtpmail-mail-address . &quot;personal@example.com&quot;)&#xA;                     (user-full-name    . &quot;Matt Valentine-House&quot; )))&#xA;         ,(make-mu4e-context&#xA;           :name &quot;work&quot;&#xA;           :enter-func (lambda () (mu4e-message &quot;Switch to Work context&quot;))&#xA;           ;; leave-fun not defined&#xA;           :match-func (lambda (msg)&#xA;                         (when msg&#xA;                           (mu4e-message-contact-field-matches msg :to &quot;work@example.com&quot;)))&#xA;           :vars '(  (user-mail-address . &quot;work@example.com&quot; )&#xA;                     (mu4e-drafts-folder . &quot;/work/drafts&quot;)&#xA;                     (mu4e-sent-folder   . &quot;/work/sent&quot;)&#xA;                     (mu4e-trash-folder  . &quot;/work/bin&quot;)&#xA;                     (mu4e-maildir-shortcuts . ((&quot;/work/INBOX&quot; . ?i)&#xA;                                                (&quot;/work/sent&quot;  . ?s)&#xA;                                                (&quot;/work/bin&quot;   . ?t)))&#xA;                     (smtpmail-mail-address . &quot;work@example.com&quot;)&#xA;                     ( user-full-name    . &quot;Matthew Valentine-House&quot; )))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13870" LastActivityDate="2018-09-20T03:46:17.510" Title="`mu4e-contexts` multiple gmail accounts using incorrect smtp credentials" Tags="|email|mu4e|smtpmail|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28371" PostTypeId="1" CreationDate="2016-11-03T10:34:42.343" Score="2" ViewCount="309" Body="&lt;p&gt;How I can customize helm/projectile behaviour to find files and &lt;code&gt;grep&lt;/code&gt; in &lt;code&gt;$VIRTUALENV&lt;/code&gt; dir easier? Or maybe I can write some function(s) to &lt;code&gt;find&lt;/code&gt;/&lt;code&gt;grep&lt;/code&gt; in &lt;code&gt;virtualenv&lt;/code&gt; of current project?&lt;/p&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="105" LastEditDate="2018-11-27T23:26:22.373" LastActivityDate="2018-11-27T23:26:22.373" Title="How to find/grep in Python virtualenv with projectile/helm easier?" Tags="|helm|python|files|projectile|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28372" PostTypeId="2" ParentId="28366" CreationDate="2016-11-03T11:10:45.607" Score="2" Body="&lt;p&gt;For a slightly different approach, you can install the &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/ace-window&lt;/a&gt; package (available from melpa) and bind &lt;code&gt;ace-window&lt;/code&gt; to some key sequence. When you invoke it, it gives each window a letter or number, which you can type to select. If you turn on &lt;code&gt;ace-window-display-mode&lt;/code&gt; this letter is also added to the mode line so you can see it in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer to &lt;a href=&quot;https://emacs.stackexchange.com/questions/991/defining-the-window-pointed-by-other-window?rq=1&quot;&gt;Defining the window pointed by &amp;quot;other-window&amp;quot;&lt;/a&gt; has a screencast showing it in action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package has extra features, for example if invoked with one universal argument it swaps the current window with the target window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://github.com/abo-abo/ace-window/wiki&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/ace-window/wiki&lt;/a&gt; has an extended example, with scrolling other windows, &lt;code&gt;winner-mode&lt;/code&gt; to save and restore window configurations and so on.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-11-03T11:10:45.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28373" PostTypeId="1" CreationDate="2016-11-03T11:57:42.380" Score="1" ViewCount="417" Body="&lt;p&gt;Is there a web app for Emacs-Lisp API searching with nice description, links, examples, etc?&lt;br&gt;&#xA;Something like &lt;a href=&quot;http://apidock.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://apidock.com/&lt;/a&gt; for Ruby, or &lt;a href=&quot;http://en.cppreference.com/w/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.cppreference.com/w/&lt;/a&gt; for C++, etc.&lt;/p&gt;&#xA;" OwnerUserId="9682" LastEditorUserId="105" LastEditDate="2016-11-03T16:04:59.223" LastActivityDate="2016-12-12T02:56:13.307" Title="Where to explore Emacs-Lisp APIs?" Tags="|help|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28374" PostTypeId="2" ParentId="28365" CreationDate="2016-11-03T12:14:46.967" Score="4" Body="&lt;p&gt;Instead of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message (format &quot;test %s&quot; dc-str-addresses))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;test %s&quot; dc-str-addresses)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;message&lt;/code&gt; accepts the same arguments as &lt;code&gt;format&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(message FORMAT-STRING &amp;amp;rest ARGS)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The first argument is a format control string, and the rest are data&#xA;  to be formatted under control of the string.  See `format' for details.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Note: Use (message &quot;%s&quot; VALUE) to print the value of expressions and&#xA;  variables to avoid accidentally interpreting `%' as format specifiers.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-11-03T12:14:46.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28375" PostTypeId="1" CreationDate="2016-11-03T13:35:41.650" Score="12" ViewCount="3540" Body="&lt;p&gt;Emacs has this very handy kill-ring that can be cycled through after yanking, by pressing &lt;code&gt;M-y&lt;/code&gt; repeatedly. Is there a way to switch the cycling direction? So I don not need to cycle through all when I actually want to get to the very first one?&lt;/p&gt;&#xA;" OwnerUserId="13243" LastEditorUserId="105" LastEditDate="2016-11-03T16:00:45.390" LastActivityDate="2016-11-03T16:00:45.390" Title="How do I yank and cycle backward through earlier killed text?" Tags="|yank|kill-ring|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28376" PostTypeId="2" ParentId="28375" CreationDate="2016-11-03T13:45:46.283" Score="9" Body="&lt;p&gt;This is from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Earlier-Kills.html#Earlier-Kills&quot; rel=&quot;noreferrer&quot;&gt;12.2.2 Yanking Earlier Kills&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;   ‘M-y’ can take a numeric argument, which tells it how many entries to&#xA;advance the “last yank” pointer by.  A negative argument moves the&#xA;pointer toward the front of the ring; from the front of the ring, it&#xA;moves “around” to the last entry and continues forward from there.&#xA;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="13432" LastActivityDate="2016-11-03T13:45:46.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28377" PostTypeId="2" ParentId="28375" CreationDate="2016-11-03T13:47:13.280" Score="3" Body="&lt;p&gt;It seems you could use -1 as a prefix argument to &lt;code&gt;M-y&lt;/code&gt; as hinted by the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Earlier-Kills.html#Earlier-Kills&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;M-y can take a numeric argument, which tells it how many entries to advance the last-yank pointer by. A negative argument moves the pointer toward the front of the ring; from the front of the ring, it moves around to the last entry and continues forward from there. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-11-03T13:47:13.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28378" PostTypeId="2" ParentId="28375" CreationDate="2016-11-03T13:48:11.167" Score="7" Body="&lt;p&gt;You have a few options for this :-&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;counsel&lt;/code&gt;&lt;/a&gt; which provides with the command &lt;code&gt;counsel-yank-pop&lt;/code&gt; which will show the list of all the yanked text and you can select anyone of them using &lt;code&gt;ivy&lt;/code&gt; (this is what I use). In your case, you can press &lt;code&gt;M-&amp;gt;&lt;/code&gt; to go the first entry in the &lt;code&gt;kill-ring&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if you use &lt;code&gt;helm&lt;/code&gt;, there is the command &lt;code&gt;helm-show-kill-ring&lt;/code&gt; which does the same as mentioned above, except uses &lt;code&gt;helm&lt;/code&gt; narrowing framework instead of &lt;code&gt;ivy&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you don't want either of the above options, then have a look at the package &lt;a href=&quot;https://github.com/browse-kill-ring/browse-kill-ring&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;browse-kill-ring&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also, a useful variable &lt;code&gt;kill-do-not-save-duplicates&lt;/code&gt; will do as the name suggests :)&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-11-03T13:48:11.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28379" PostTypeId="2" ParentId="28375" CreationDate="2016-11-03T16:00:18.307" Score="1" Body="&lt;p&gt;Check out Emacs Wiki page &lt;a href=&quot;https://www.emacswiki.org/emacs/BrowseKillRing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Browse Kill Ring&lt;/a&gt;.&#xA;The basic feature is to show you a buffer of all kill-ring entries and let you act on them (edit, yank, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatives to, and enhancements of, the basic feature are also presented on that page, including these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/browse-kill-ring%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;browse-kill-ring+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can browse (or pop) other rings, in addition to the &lt;code&gt;kill-ring&lt;/code&gt; — in particular, the &lt;strong&gt;&lt;code&gt;secondary-selection-ring&lt;/code&gt;&lt;/strong&gt; (see &lt;a href=&quot;https://www.emacswiki.org/emacs/SecondarySelection#second-sel.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;secondary-sel.el&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can copy or move selections from one ring to another (using &lt;strong&gt;&lt;code&gt;c&lt;/code&gt;&lt;/strong&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lets &lt;code&gt;delete-selection-mode&lt;/code&gt; replace the active region whenever you insert a kill.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt; lets you clean up the kill ring selectively during completion, deleting entries on the fly.  You can sort completions in various ways.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;C-- C-y&lt;/code&gt;&lt;/strong&gt; yanks from the kill ring using completion.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;M-y&lt;/code&gt;&lt;/strong&gt; at top level (i.e., not after a yank from either the kill ring or the &lt;code&gt;secondary-selection-ring&lt;/code&gt; of &lt;a href=&quot;https://www.emacswiki.org/emacs/second-sel.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;second-sel.el&lt;/code&gt;&lt;/a&gt;) yanks from one of those rings using completion. It yanks a kill by default, but a secondary selection if you use a prefix argument.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you use either of these, you can cycle among completion candidates (the entries in the ring), in various orders, or you can choose any of them directly, without cycling.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-03T16:00:18.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28381" PostTypeId="2" ParentId="28366" CreationDate="2016-11-03T16:20:05.957" Score="1" Body="&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt; then you can use command &lt;code&gt;icicle-select-window&lt;/code&gt;, bound to &lt;strong&gt;&lt;code&gt;C-0 C-x o&lt;/code&gt;&lt;/strong&gt; to &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Tripping&quot; rel=&quot;nofollow noreferrer&quot;&gt;trip among windows&lt;/a&gt; using&#xA;their buffer names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, &lt;strong&gt;&lt;code&gt;C-x o&lt;/code&gt;&lt;/strong&gt; trips among windows or frames, as follows (&lt;code&gt;C-h k C-x o&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;C-x o&lt;/code&gt;&lt;/strong&gt; runs the command &lt;strong&gt;&lt;code&gt;icicle-other-window-or-frame&lt;/code&gt;&lt;/strong&gt;&#xA;         which is an interactive compiled Lisp function in &lt;a href=&quot;https://www.emacswiki.org/emacs/download/icicles-cmd1.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;icicles-cmd1.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(icicle-other-window-or-frame ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Select a window or frame, by name or by order.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This command combines Emacs commands &lt;code&gt;other-window&lt;/code&gt; and &lt;code&gt;other-frame&lt;/code&gt;,&#xA;      together with Icicles commands &lt;strong&gt;&lt;code&gt;icicle-select-window&lt;/code&gt;&lt;/strong&gt;,&#xA;      &lt;strong&gt;&lt;code&gt;icicle-select-frame&lt;/code&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;code&gt;icicle-choose-window-for-buffer-display&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use the &lt;em&gt;prefix argument&lt;/em&gt; to choose the behavior, as follows:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;With &lt;em&gt;no&lt;/em&gt; prefix arg or a &lt;em&gt;non-zero&lt;/em&gt; numeric prefix arg:&#xA;    If the selected frame has multiple windows, then this is&#xA;    &lt;code&gt;other-window&lt;/code&gt;.  Otherwise, it is &lt;code&gt;other-frame&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;With a &lt;em&gt;zero&lt;/em&gt; prefix arg (e.g. &lt;strong&gt;&lt;code&gt;C-0&lt;/code&gt;&lt;/strong&gt;):&#xA;    If the selected frame has multiple windows, then this is&#xA;    &lt;code&gt;icicle-select-window&lt;/code&gt; with windows in the frame as candidates.&#xA;    Otherwise (single-window frame), this is &lt;code&gt;icicle-select-frame&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;With plain &lt;strong&gt;&lt;code&gt;C-u&lt;/code&gt;&lt;/strong&gt;:&#xA;    If the selected frame has multiple windows, then this is&#xA;    &lt;code&gt;icicle-select-window&lt;/code&gt; with windows from all visible frames as&#xA;    candidates.  Otherwise, this is &lt;code&gt;icicle-select-frame&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;With plain &lt;strong&gt;&lt;code&gt;C-u C-u&lt;/code&gt;&lt;/strong&gt;:&#xA;    Same as &lt;code&gt;icicle-select-window&lt;/code&gt; with a negative prefix arg: Select a&#xA;    window from any frame, including iconified and invisible frames.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;With plain &lt;strong&gt;&lt;code&gt;C-u C-u C-u&lt;/code&gt;&lt;/strong&gt;:&#xA;    This is &lt;code&gt;icicle-choose-window-for-buffer-display&lt;/code&gt;, with windows from&#xA;    all frames (i.e., iconified and invisible) frames as candidates. &lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;If you use library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/oneonone.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;oneonone.el&lt;/code&gt;&lt;/a&gt; with a &lt;em&gt;standalone minibuffer&lt;/em&gt; frame,&#xA;      and if option &lt;code&gt;1on1-remap-other-frame-command-flag&lt;/code&gt; is non-nil, then&#xA;      frame selection can include the standalone minibuffer frame.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;By default, Icicle mode remaps all key sequences that are normally&#xA;      bound to &lt;code&gt;other-window&lt;/code&gt; to &lt;code&gt;icicle-other-window-or-frame&lt;/code&gt;.  If you do&#xA;      not want this remapping, then customize option&#xA;      &lt;code&gt;icicle-top-level-key-bindings&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-11-03T16:27:12.220" LastActivityDate="2016-11-03T16:27:12.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28382" PostTypeId="1" CreationDate="2016-11-03T16:33:11.537" Score="6" ViewCount="489" Body="&lt;p&gt;I am currently running R 3.3.1 in emacs 25.1.1, ESS 16.10, and polymode 20160805.448 installed via MELPA on Mac OS Sierra.  Whenever I try to open an interactive R console using &lt;code&gt;M-x R&lt;/code&gt;, it freezes immediately upon startup and I have to force quit emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom bar says &quot;ess-tracebug mode enabled&quot; and the R console initially runs &lt;code&gt;if(identical(getOption('pager'), file.path(R.home('bin'), 'pager'))).&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.emacs&lt;/code&gt; file has the following code related to ESS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;ESS mode configuration&#xA;(autoload 'R-mode &quot;ess-site.el&quot; &quot;ESS&quot; t)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.R$&quot; . R-mode))&#xA;(setq inferior-R-program-name &quot;/usr/local/bin/R&quot;)&#xA;&#xA;;;R stuff&#xA;(setq ess-eval-visibly-p nil)&#xA;(setq ess-ask-for-ess-directory nil)&#xA;(require 'ess-eldoc)&#xA;&#xA;;;compile the first target in the Makefile in the current directory using F9&#xA;(global-set-key [f9] 'compile)&#xA;(setq compilation-read-command nil)&#xA;&#xA;(require 'poly-R) ;; Load polymode for Rmd and Rnw&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Snw&quot; . poly-noweb+r-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rnw&quot; . poly-noweb+r-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.Rmd&quot; . poly-markdown+r-mode))&#xA;&#xA;&#xA;;; The following four lines set C-; to automatically add &quot; -&amp;gt; &quot; in ESS,&#xA;;; and causes _ to insert a normal underscore.&#xA;(setq ess-S-assign-key (kbd &quot;C-;&quot;))&#xA;(ess-toggle-S-assign-key t) ; enable above key definition&#xA;;; leave my underscore key alone!&#xA;(ess-toggle-underscore nil)&#xA;;; Map C-' to the pipe operator %&amp;gt;%&#xA;(defun then_R_operator ()&#xA;  &quot;R - %&amp;gt;% operator or 'then' pipe operator&quot;&#xA;  (interactive)&#xA;  (just-one-space 1)&#xA;  (insert &quot;%&amp;gt;%&quot;)&#xA;  (just-one-space 1))&#xA;(define-key ess-mode-map (kbd &quot;C-'&quot;) 'then_R_operator)&#xA;(define-key inferior-ess-mode-map (kbd &quot;C-'&quot;) 'then_R_operator)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:  Also I'm not sure if this helps, but I copied a .emacs file from a computer with a functioning R mode to try to fix this issue and it still failed.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**EDIT 2:  Completely copied over a &lt;code&gt;.emacs&lt;/code&gt; and a &lt;code&gt;.emacs.d&lt;/code&gt; from the same working computer.  Upon startup, the first line on the frozen computer is &lt;code&gt;if(identical(getOption('pager'), file.path(R.home('bin'), 'pager')))&lt;/code&gt;, but on the original, working computer, it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; if(identical(getOption('pager'), file.path(R.home('bin'), 'pager'))) # rather take the ESS one&#xA;+       options(pager='cat')&#xA;&amp;gt; options(STERM='iESS', str.dendrogram.last=&quot;'&quot;, editor='emacsclient', show.error.locations=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13874" LastEditorUserId="13874" LastEditDate="2016-11-07T05:59:34.870" LastActivityDate="2017-03-08T11:49:34.807" Title="ESS freezes on startup with ess-tracebug mode enabled" Tags="|ess|r|polymode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28383" PostTypeId="1" AcceptedAnswerId="28395" CreationDate="2016-11-03T16:44:27.080" Score="2" ViewCount="1074" Body="&lt;p&gt;I want to highlight somehow symbol under cursor, is there a way to customize font for that current symbol? Ideally I want to add underline with some color to it, or maybe change bg color of text, is there a package for that or specific default font?&lt;/p&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="105" LastEditDate="2016-11-03T21:24:03.750" LastActivityDate="2016-11-04T01:07:49.263" Title="Is there a way to underline symbol under cursor?" Tags="|highlighting|symbols|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28384" PostTypeId="1" AcceptedAnswerId="28417" CreationDate="2016-11-03T16:45:10.573" Score="2" ViewCount="72" Body="&lt;p&gt;I just noticed that Emacs will trim a very big file before saving it. I opened a 4.6 GB file (not the best thing to do, but anyway) and after saving, the file was trimmed to around 375 MB. It didn't warn me about the file size, trimming or anything. I'm using Emacs 22.1.1 for Mac.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this default behavior (I definitely hope not) or a bug?&lt;/p&gt;&#xA;" OwnerUserId="10210" LastEditorUserId="105" LastEditDate="2016-11-03T20:35:29.617" LastActivityDate="2016-11-04T13:22:00.950" Title="Saving very big files" Tags="|files|saving|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28385" PostTypeId="1" AcceptedAnswerId="28386" CreationDate="2016-11-03T16:53:27.143" Score="6" ViewCount="460" Body="&lt;p&gt;I'd like to have the following code in my library:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (not (buffer-visible-p es-results-buffer))&#xA;  (delete-other-windows)&#xA;  (view-buffer-other-window es-results-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I haven't been able to find a function for &lt;code&gt;buffer-visible-p&lt;/code&gt;. Is there such a function?&lt;/p&gt;&#xA;" OwnerUserId="379" LastEditorUserId="105" LastEditDate="2016-11-03T20:35:14.870" LastActivityDate="2016-11-03T20:35:14.870" Title="How can I tell if a buffer is already visible?" Tags="|buffers|window|visibility|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28386" PostTypeId="2" ParentId="28385" CreationDate="2016-11-03T17:16:43.047" Score="5" Body="&lt;p&gt;You are looking for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffers-and-Windows.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;get-buffer-window&lt;/code&gt;&lt;/a&gt;, or you can iterate over the list of all visible windows yourself.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-11-03T17:16:43.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28387" PostTypeId="2" ParentId="28301" CreationDate="2016-11-03T17:35:48.580" Score="13" Body="&lt;p&gt;It's worth mentioning that Org 9.0 is out and the &lt;code&gt;#+BEGIN_HTML&lt;/code&gt; syntax you used is &lt;a href=&quot;http://orgmode.org/Changes.html&quot; rel=&quot;noreferrer&quot;&gt;replaced&lt;/a&gt; with &lt;code&gt;#+BEGIN_EXPORT language&lt;/code&gt; for export blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are different ways to achieve what you want, I'm using Org-babel's noweb references here. The syntax &lt;code&gt;&amp;lt;&amp;lt;inline-js&amp;gt;&amp;gt;&lt;/code&gt; inserts the literal javascript block before the elisp code block is evaluated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: inline-js&#xA;#+begin_src javascript :exports none&#xA;console.log('Test');&#xA;#+end_src&#xA;&#xA;#+begin_src elisp :noweb yes :exports results :results html&#xA;(concat&#xA; &quot;&amp;lt;script type=\&quot;text/javascript\&quot;&amp;gt;\n&quot;&#xA; &quot;&amp;lt;&amp;lt;inline-js&amp;gt;&amp;gt;\n&quot;&#xA; &quot;&amp;lt;/script&amp;gt;&quot;)&#xA;#+end_src&#xA;&#xA;#+results:&#xA;#+BEGIN_EXPORT html&#xA;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&#xA;console.log('Test');&#xA;&amp;lt;/script&amp;gt;&#xA;#+END_EXPORT&#xA;&#xA;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the exported document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&#xA;&amp;lt;html lang=&quot;en&quot;&amp;gt;&#xA;&amp;lt;head&amp;gt;&#xA;&#xA;&amp;lt;!-- ... --&amp;gt;&#xA;&#xA;&amp;lt;/head&amp;gt;&#xA;&amp;lt;body&amp;gt;&#xA;&amp;lt;div id=&quot;content&quot;&amp;gt;&#xA;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&#xA;console.log('Test');&#xA;&amp;lt;/script&amp;gt;&#xA;&#xA;&amp;lt;p&amp;gt;&#xA;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. &amp;lt;/p&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: The following may be more appropriate if you reuse the elisp block a lot:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: inline-js&#xA;#+begin_src elisp :exports none :results html :var blk=&quot;&quot;&#xA;(concat&#xA; &quot;&amp;lt;script type=\&quot;text/javascript\&quot;&amp;gt;\n&quot;&#xA; (cadr (org-babel-lob--src-info blk))&#xA; &quot;\n&quot;&#xA; &quot;&amp;lt;/script&amp;gt;&quot;)&#xA;#+end_src&#xA;&#xA;#+name: foo&#xA;#+begin_src javascript :exports none&#xA;console.log('foo');&#xA;#+end_src&#xA;&#xA;#+call: inline-js(&quot;foo&quot;)&#xA;&#xA;#+name: bar&#xA;#+begin_src javascript :exports none&#xA;console.log('bar');&#xA;#+end_src&#xA;&#xA;#+call: inline-js(&quot;bar&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2016-11-04T07:53:54.593" LastActivityDate="2016-11-04T07:53:54.593" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28388" PostTypeId="2" ParentId="28383" CreationDate="2016-11-03T18:43:13.540" Score="1" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar hi-last-symbol nil)&#xA;&#xA;(defun hilight-current-symbol (&amp;amp;optional arg)&#xA;  (interactive)&#xA;  (let ((sym (thing-at-point 'symbol))) &#xA;    (cond&#xA;     ;; sym + last and not equal&#xA;     ((and&#xA;       sym          &#xA;       hi-last-symbol       &#xA;       (not (string= hi-last-symbol sym)))&#xA;      ;; unhilite the last one&#xA;      (hi-lock-unface-buffer (format &quot;\\_&amp;lt;%s\\_&amp;gt;&quot; (regexp-quote hi-last-symbol)))&#xA;      ;; highlight this one&#xA;      (hi-lock-face-buffer (format &quot;\\_&amp;lt;%s\\_&amp;gt;&quot; (regexp-quote sym)))&#xA;      (setq hi-last-symbol sym))&#xA;     ;; sym + no last&#xA;     ((and&#xA;       sym              ;we have symbol&#xA;       (null hi-last-symbol))             &#xA;      ;; highlight this one&#xA;      (hi-lock-face-buffer (format &quot;\\_&amp;lt;%s\\_&amp;gt;&quot; (regexp-quote sym)))&#xA;      (setq hi-last-symbol sym))&#xA;     ;; no sym and last&#xA;     ((and&#xA;       (null sym)           &#xA;       (not (null hi-last-symbol)))           &#xA;      (hi-lock-unface-buffer (format &quot;\\_&amp;lt;%s\\_&amp;gt;&quot; (regexp-quote hi-last-symbol))) &#xA;      (setq hi-last-symbol sym)))))&#xA;&#xA;(add-hook 'post-command-hook 'hilight-current-symbol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-11-03T18:43:13.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28389" PostTypeId="1" AcceptedAnswerId="28549" CreationDate="2016-11-03T19:03:23.200" Score="1" ViewCount="455" Body="&lt;p&gt;I have a custom mode to highlight my log files.  In it, I attempt to highlight strings that are surrounded by double quotes(&lt;code&gt;&quot;[^&quot;]*&quot;&lt;/code&gt;).  In the files, there are sometimes lines with an odd number of double quotes.  This results in many lines being treated as a string, up to the next line with a double quote.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode is defined by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my--one-line-string-p (limit)&#xA;  &quot;Match strings, but do not cross line boundaries&quot;&#xA;&#xA;  (when (search-forward &quot;\&quot;&quot; limit 'no-error)&#xA;    (backward-char 1)&#xA;    (let ((end (min limit&#xA;                  (save-excursion&#xA;                    (end-of-line)&#xA;                    (point)))))&#xA;      (when&#xA;          (search-forward-regexp &quot;\&quot;[^\&quot;]*\&quot;&quot; end 'no-error)&#xA;;;        (message &quot;Found match from %d to %d&quot; (match-beginning 0) (match-end 0))&#xA;        t&#xA;        )))&#xA;  )&#xA;&#xA;&#xA;(defvar my-log-file-mode-font-lock-defaults&#xA;  `((&#xA;     (&quot;\\[WARN *\\].*&quot; . font-lock-warning-face)&#xA;     (&quot;\\[ERROR *\\].*&quot; . 'my-error-face)&#xA;     (my--one-line-string-p . font-lock-string-face)&#xA;     (&quot;{[^}&#xA;]+}&quot; . font-lock-builtin-face)&#xA;     (&quot;\\[akka://[^]]+\\]&quot; . font-lock-doc-face)&#xA;     (&quot;\\([a-zA-Z0-9]+\\)=\\([-a-zA-Z0-9:]+\\)&quot;&#xA;      (1 font-lock-variable-name-face)&#xA;      (2 font-lock-constant-face))&#xA;     )))&#xA;;; log file mode&#xA;(define-derived-mode my-log-file-mode fundamental-mode&#xA;  &quot;Log&quot;&#xA;  &quot;Major mode for viewing log files&quot;&#xA;&#xA;  (setq font-lock-defaults my-log-file-mode-font-lock-defaults)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;font-lock-multiline&lt;/code&gt; is nil in the buffer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;font-lock-keywords&lt;/code&gt; is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (t&#xA; ((&quot;\\[WARN *\\].*&quot; . font-lock-warning-face)&#xA;  (&quot;\\[ERROR *\\].*&quot; quote my-error-face)&#xA;  (my--one-line-string-p . font-lock-string-face)&#xA;  (&quot;{[^}\n]+}&quot; . font-lock-builtin-face)&#xA;  (&quot;\\[akka://[^]]+\\]&quot; . font-lock-doc-face)&#xA;  (&quot;\\([a-zA-Z0-9]+\\)=\\([-a-zA-Z0-9:]+\\)&quot;&#xA;   (1 font-lock-variable-name-face)&#xA;   (2 font-lock-constant-face)))&#xA; (&quot;\\[WARN *\\].*&quot;&#xA;  (0 font-lock-warning-face))&#xA; (&quot;\\[ERROR *\\].*&quot;&#xA;  (0 'my-error-face))&#xA; (my--one-line-string-p&#xA;  (0 font-lock-string-face))&#xA; (&quot;{[^}\n]+}&quot;&#xA;  (0 font-lock-builtin-face))&#xA; (&quot;\\[akka://[^]]+\\]&quot;&#xA;  (0 font-lock-doc-face))&#xA; (&quot;\\([a-zA-Z0-9]+\\)=\\([-a-zA-Z0-9:]+\\)&quot;&#xA;  (1 font-lock-variable-name-face)&#xA;  (2 font-lock-constant-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like an line with an unmatched double quote should not trigger highlighting, but it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have these minor modes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption&#xA;  Blink-Cursor Desktop-Save Diff-Auto-Refine Ede Electric-Indent&#xA;  File-Name-Shadow Flycheck Flycheck-Color-Mode-Line Font-Lock&#xA;  Global-Ede Global-Flycheck Global-Font-Lock Global-Semantic-Decoration&#xA;  Global-Semantic-Highlight-Func Global-Semantic-Idle-Breadcrumbs&#xA;  Global-Semantic-Idle-Completions&#xA;  Global-Semantic-Idle-Local-Symbol-Highlight&#xA;  Global-Semantic-Idle-Scheduler Global-Semantic-Idle-Summary&#xA;  Global-Semantic-Stickyfunc Global-Semanticdb Jdee-Etrace Line-Number&#xA;  Menu-Bar Mode-Icons Mouse-Wheel Pallet Schrute Semantic Shell-Dirtrack&#xA;  Show-Paren Tool-Bar Tooltip Which-Function Yas Yas-Global&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there some other variable that I need to set to prevent multi-line string highlighting?&lt;/p&gt;&#xA;" OwnerUserId="13881" LastEditorUserId="105" LastEditDate="2016-11-03T20:34:28.207" LastActivityDate="2016-11-08T23:58:52.400" Title="Preventing font-lock string match from going past end of line" Tags="|regular-expressions|font-lock|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28390" PostTypeId="1" CreationDate="2016-11-03T19:14:37.740" Score="19" ViewCount="6257" Body="&lt;p&gt;My laptop has a 4K screen therefore a very high DPI, much higher than my external monitors. So when I switch from using external monitors to the builtin laptop screen I would like to quickly scale the text and, if possible, all the GUI widgets in Emacs to suite the new DPI. I'm aware of set-frame-font but I haven't found a corresponding function that adjusts the scaling aswell. And text-scale-adjust only works on a buffer locally.&lt;/p&gt;&#xA;" OwnerUserId="12001" LastActivityDate="2020-03-12T20:34:50.570" Title="Quickly Adjusting Text to DPI Changes" Tags="|faces|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28391" PostTypeId="2" ParentId="28390" CreationDate="2016-11-03T20:06:09.933" Score="13" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can set the value of &lt;strong&gt;&lt;code&gt;default-frame-alist&lt;/code&gt;&lt;/strong&gt;, including its &lt;code&gt;font&lt;/code&gt; parameter, conditionally, depending on the current monitor/display.  (You can use function &lt;code&gt;display-monitor-attributes-list&lt;/code&gt; to give you the monitor/display information.) This lets you use different default font sizes for different monitors or other different contexts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also change font size dynamically, for all windows and buffers shown in any frame, using command &lt;code&gt;zoom-in&lt;/code&gt;, &lt;code&gt;zoom-out&lt;/code&gt;, or &lt;code&gt;zoom-in/out&lt;/code&gt;, from library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/zoom-frm.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;zoom-frm.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These same commands can either zoom a &lt;em&gt;buffer&lt;/em&gt; (in all windows, on whatever frame) or a &lt;em&gt;frame&lt;/em&gt; (all of its windows, whatever their buffer).&#xA;See Emacs Wiki page &lt;a href=&quot;https://www.emacswiki.org/emacs/SetFonts&quot; rel=&quot;noreferrer&quot;&gt;Set Fonts&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-03T20:06:09.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28392" PostTypeId="2" ParentId="28389" CreationDate="2016-11-03T20:34:11.787" Score="1" Body="&lt;p&gt;If you want to prevent &lt;em&gt;multi-line&lt;/em&gt; matching then include &lt;code&gt;\n&lt;/code&gt; (newline character) in the characters to exclude: &lt;code&gt;&quot;[^&quot;\n]*&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-03T20:34:11.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28393" PostTypeId="1" CreationDate="2016-11-03T21:08:11.410" Score="0" ViewCount="29" Body="&lt;p&gt;What I want is the opposite of code folding. Code folding looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unfolded:&#xA;1 * Top Level&#xA;2 ** Second Level&#xA;3 Info that belongs to Second Level&#xA;4 More Info that belongs to Second Level&#xA;5 ** Another Second Level&#xA;6 More Info&#xA;&#xA;Folded (usually with a &quot;...&quot; at the end of Second Level):&#xA;1 * Top Level&#xA;2 ** Second Level&#xA;5 ** Another Second Level&#xA;6 More Info&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Unexpanded:&#xA;1 * Top Level&#xA;2 ** Second Level&#xA;3 Info that belongs to Second Level [Expandable]&#xA;4 More Info that belongs to Second Level&#xA;5 ** Another Second Level&#xA;6 More Info&#xA;&#xA;Expanded:&#xA;1 * Top Level&#xA;2 ** Second Level&#xA;3 Info that belongs to Second Level [Expandable]&#xA;  Additional info&#xA;  More additional info&#xA;4 More Info that belongs to Second Level&#xA;5 ** Another Second Level&#xA;6 More Info&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main idea is that I don't want the additional information to be part of the actual file. The information is sourced from elsewhere. How can I inject these pseudolines into my buffers?&lt;/p&gt;&#xA;" OwnerUserId="2808" LastActivityDate="2016-11-03T21:08:11.410" Title="Show additional lines that are not part of the file" Tags="|code-folding|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28394" PostTypeId="1" CreationDate="2016-11-03T21:15:41.853" Score="1" ViewCount="1058" Body="&lt;p&gt;I want to search for a combination of two or more strings, in any order. I use org-mode.&lt;/p&gt;&#xA;" OwnerUserId="9320" LastActivityDate="2016-11-04T20:43:46.573" Title="Search line that contains n strings, in any order" Tags="|search|" AnswerCount="6" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28395" PostTypeId="2" ParentId="28383" CreationDate="2016-11-03T21:20:02.367" Score="1" Body="&lt;p&gt;Use library &lt;a href=&quot;https://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;nofollow noreferrer&quot;&gt;Highlight&lt;/a&gt; (code: &lt;a href=&quot;https://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commands &lt;code&gt;hlt-highlight-symbol&lt;/code&gt; and &lt;code&gt;hlt-unhighlight-symbol&lt;/code&gt; highlight and unhighlight the symbol at point or under the mouse pointer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(They are bound to &lt;code&gt;C-x X h s&lt;/code&gt; and &lt;code&gt;C-x X u s&lt;/code&gt;, by default.  All commands of the library are bound in keymap &lt;code&gt;hlt-map&lt;/code&gt;, which is on prefix key &lt;code&gt;C-x X&lt;/code&gt; by default.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally, these commands provide a highlighting background color by default (changed each time you invoke them).  But when called from Lisp they accept a &lt;code&gt;FACE&lt;/code&gt; argument and use that face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can easily define your own command that uses an underline of a given color, for which you are prompted:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-highlight-symbol-with-face (symbol color all-buffers-p)&#xA;  &quot;Highlight occurrences of SYMBOL using an underline of COLOR.&#xA;The symbol at point is used by default, or the symbol under the mouse&#xA;pointer if the command is invoked using the mouse.&#xA;&#xA;Highlight over the region if active, or the buffer otherwise.&#xA;With a prefix arg, use all buffers that are visible or iconified.&#xA;\(This first unhighlights occurrences, to prevent stacking up multiple&#xA;highlighting on the same occurrences.)&quot;&#xA;  (interactive&#xA;   (save-excursion&#xA;     (when (listp last-nonmenu-event) (mouse-set-point last-nonmenu-event))&#xA;     (let ((symb  (symbol-at-point))&#xA;           colr)&#xA;       (unless symb (error &quot;No symbol %s&quot; (if (listp last-nonmenu-event)&#xA;                                              &quot;under mouse pointer&quot;&#xA;                                            &quot;at point&quot;)))&#xA;       (setq colr  (read-color &quot;Color: &quot;))&#xA;       (list symb colr current-prefix-arg))))&#xA;  (let ((face  `(:underline (:color ,color))))&#xA;    (hlt-highlight-symbol symbol all-buffers-p face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You could also specify an underlining style in the code, or prompt for it.  By default, the style is a straight line.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use &lt;code&gt;hlt-unhighlight-symbol&lt;/code&gt; to unhighlight this highlighting.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-03T21:20:02.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28396" PostTypeId="2" ParentId="28394" CreationDate="2016-11-03T21:39:48.003" Score="1" Body="&lt;p&gt;Regular expressions will only get you so far, if you want to search for multiple things in any order.  The regexp you use needs to specify each possible order for the things. For two or three things that's not such a big deal, but for more it quickly becomes problematic.  A single regexp is &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; your friend when trying to match patterns in any order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm assuming that you want to do this searching interactively. If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Isearch+&lt;/a&gt; you can easily do what you request.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The first thing you do is search for a general context.  For example, &lt;code&gt;C-M-s .*&lt;/code&gt; searches for full lines.  (But you are by no means limited to defining &lt;em&gt;line&lt;/em&gt; contexts; a search context can be &lt;em&gt;any zone of text&lt;/em&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then you impose an Isearch filter predicate that restricts the set of matching lines to those that also match your first pattern (a regexp).  For example, to restrict search to lines that contain &lt;code&gt;cat&lt;/code&gt; you do this (during the same search for &lt;code&gt;.*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-z % cat&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then you do the same for another pattern you want the lines found to also match:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-z % dog&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And so on: &lt;code&gt;C-z % turtle&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-z %&lt;/code&gt; prompts you for a pattern, which is in fact a regexp, so you are not limited to a literal sequence such as &lt;code&gt;turtle&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What happens is that when you enter a regexp, Isearch+ constructs a predicate that filters for its matches - within the current set of search hits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of other ways that Isearch+ provides to &lt;em&gt;dynamically refine search contexts&lt;/em&gt;, besides regexp matching.  This page about its &lt;a href=&quot;https://www.emacswiki.org/emacs/DynamicIsearchFiltering&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dynamic Isearch Filtering&lt;/a&gt; describes this and various other ways to combine multiple Isearch filters.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-11-04T20:37:19.643" LastActivityDate="2016-11-04T20:37:19.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28397" PostTypeId="2" ParentId="24061" CreationDate="2016-11-03T22:01:57.427" Score="1" Body="&lt;p&gt;The workaround is the patch from &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&lt;/a&gt; which allows you to specify .emacs.d location via EMACS_USER_DIRECTORY environment variable. Unfortunately it's not yet in upstream because some people think that 30 lines (half of which are comments) is too much of added complexity for emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So either take this patch and rebuild emacs yourself or go to the link above and explain how this patch would solves your issues. Please be polite and constructive in your feedback.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2016-11-03T22:01:57.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28398" PostTypeId="2" ParentId="4253" CreationDate="2016-11-03T22:36:45.103" Score="4" Body="&lt;p&gt;The patch which allows you to specify .emacs.d location via `EMACS_USER_DIRECTORY' environment variable is available in &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&lt;/a&gt; but it's not yet merged.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2016-11-03T22:36:45.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28399" PostTypeId="2" ParentId="26121" CreationDate="2016-11-03T22:41:43.353" Score="3" Body="&lt;p&gt;The patch which allows you to specify .emacs.d location via `EMACS_USER_DIRECTORY' environment variable is available in &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&lt;/a&gt; but it's not yet merged.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2016-11-03T22:41:43.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28400" PostTypeId="2" ParentId="14931" CreationDate="2016-11-03T22:44:38.263" Score="0" Body="&lt;p&gt;A patch which allows you to specify .emacs.d location via `EMACS_USER_DIRECTORY' environment variable is available in &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&lt;/a&gt; but it's not yet merged. This should eliminate the need for you to use symlinks.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastEditorUserId="105" LastEditDate="2016-11-03T23:19:21.753" LastActivityDate="2016-11-03T23:19:21.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28401" PostTypeId="2" ParentId="17318" CreationDate="2016-11-03T22:57:14.657" Score="1" Body="&lt;p&gt;Well, it's not really an answer but it did solved the overall problem for me: instead of trying to reach Emacs' calc via emacsclient from shell I've flipped the problem upside-down and started using eshell as my main shell which allows me to use &quot;calc-eval EXPR&quot; directly :)&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2016-11-03T22:57:14.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28402" PostTypeId="2" ParentId="28075" CreationDate="2016-11-03T23:05:19.457" Score="1" Body="&lt;p&gt;The problem is that specifying user-emacs-directory that way is just a broken workaround - see &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539&lt;/a&gt; for details. You can also take the patch from there which solves the problem properly.&lt;/p&gt;&#xA;" OwnerUserId="9660" LastActivityDate="2016-11-03T23:05:19.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28403" PostTypeId="2" ParentId="28394" CreationDate="2016-11-04T00:44:37.450" Score="1" Body="&lt;p&gt;Drew already described ways of recursive filtering lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;occur&lt;/code&gt; (already shipped with emacs) recursively for that purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To search for a line containing the words &lt;code&gt;Adam Smith 1900 history&lt;/code&gt; use &lt;code&gt;occur&lt;/code&gt; on &lt;code&gt;Adam&lt;/code&gt; in the original buffer. Afterwards use &lt;code&gt;occur&lt;/code&gt; on &lt;code&gt;Smith&lt;/code&gt; in the resulting &lt;code&gt;occur&lt;/code&gt;-buffer. Afterwards use &lt;code&gt;occur&lt;/code&gt; on &lt;code&gt;1900&lt;/code&gt; in the resulting buffer and finally use &lt;code&gt;occur&lt;/code&gt; on &lt;code&gt;history&lt;/code&gt; in the resulting buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Afterwards you can go back to the line containing all words in the original buffer recursively through the occur buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some false positives with this method. E.g., if you are searching for the word &lt;code&gt;matches&lt;/code&gt; also the first line of an occur-buffer matches.  But, these should not disturb too much.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-04T01:41:26.157" LastActivityDate="2016-11-04T01:41:26.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28404" PostTypeId="2" ParentId="28383" CreationDate="2016-11-04T01:07:49.263" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/nschum/highlight-symbol.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight-symbol&lt;/a&gt; package is a simple way to do exactly this.  It provides &lt;code&gt;highlight-symbol&lt;/code&gt; which will toggle the highlighting of the symbol under the point and &lt;code&gt;highlight-symbol-mode&lt;/code&gt; which will continuously update the highlighting as the point moves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default is to change the background color.  To underline instead use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'highlight-symbol-face nil&#xA;                    :background nil&#xA;                    :underline t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-11-04T01:07:49.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28405" PostTypeId="2" ParentId="28394" CreationDate="2016-11-04T01:33:03.460" Score="1" Body="&lt;p&gt;Another easy way to do what you want is to use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt;. With &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles search&lt;/a&gt; you first define search contexts, and then you type patterns to match within the contexts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define contexts using a regexp, or several other ways. And some Icicles search commands define contexts for you.  For example, &lt;code&gt;icicle-occur&lt;/code&gt;, bound by default to &lt;strong&gt;&lt;code&gt;C-c '&lt;/code&gt;&lt;/strong&gt;, the contexts are lines.  For &lt;code&gt;icicle-search&lt;/code&gt;, bound by default to &lt;strong&gt;&lt;code&gt;C-c `&lt;/code&gt;&lt;/strong&gt;, you are prompted for a context-defining regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After establishing the search contexts, whatever you type in the minibuffer is taken as a pattern (e.g. a regexp) to match within the contexts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is Icicles &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion&quot; rel=&quot;nofollow noreferrer&quot;&gt;progressive completion&lt;/a&gt; that provides the answer to your question. To match another search pattern you just hit &lt;code&gt;S-SPC&lt;/code&gt;, locking in the previous one, and then type another. The patterns are ANDed, each one narrowing the search further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because this is all done by matching minibuffer input against completion candidates, you can change the current pattern to match anytime, incrementally. And because each &lt;code&gt;S-SPC&lt;/code&gt; creates a recursive minibuffer, you can also use &lt;code&gt;C-]&lt;/code&gt; to pop out of the current pattern inputting altogether and change the previous, formerly &quot;locked in&quot; pattern. You can thus input an infinite number of sets of matching patterns, to search for different things within the set of search contexts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Harder to describe than to experience...&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-04T01:33:03.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28406" PostTypeId="2" ParentId="28394" CreationDate="2016-11-04T02:37:15.547" Score="0" Body="&lt;p&gt;The following lisp code provides you with a single command that finds a line containing all words given by the user as space-separated list in any order.&#xA;You can apply this command iteratively to find consecutive matching lines using the input history. This is ensured by placing point at the end of the matching line.&#xA;The search starts at point. If you place point in the middle of some line then only the partial line starting at point is tested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to avoid regexp-matches replace &lt;code&gt;string-match&lt;/code&gt; by &lt;code&gt;string-equal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun search-forward-words-in-line (words)&#xA;  &quot;Search forward for a line containing some words in any order.&#xA;WORDS is a string of words separated by spaces.&#xA;Search starts at the line where point is in.&#xA;Puts point on the end of the found line.&#xA;So you can use this command iteratively.&quot;&#xA;  (interactive &quot;sSpace separated list of words:&quot;)&#xA;  (let ((word-list (split-string words))&#xA;    found)&#xA;    (while (and (null (eobp))&#xA;        (null (setq found (cl-subsetp word-list (split-string (buffer-substring-no-properties (point) (line-end-position))) :test #'string-match))))&#xA;      (forward-line))&#xA;    (and found (goto-char (line-end-position)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There follows an alternative implementation with an associated special &lt;code&gt;occur&lt;/code&gt; named &lt;code&gt;occur-words-in-line&lt;/code&gt; in the following.&#xA;The function &lt;code&gt;re-search-forward&lt;/code&gt; is hijacked by &lt;code&gt;occur-search-forward-words-in-line&lt;/code&gt; during the execution of the original &lt;code&gt;occur&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had to modify the behavior of &lt;code&gt;search-forward-words-in-line&lt;/code&gt; to make this work. The new version of this function applies &lt;code&gt;re-search-forward&lt;/code&gt; starting at the beginning of the line that contains all the words from wordstr or at point if point was initially in the middle of the line. It places point and determines its return value and match data by this call of &lt;code&gt;re-search-forward&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun search-forward-words-in-line (wordstr &amp;amp;optional bound noerror)&#xA;  &quot;Search forward for a line containing the words from WORDSTR in any order.&#xA;WORDS is a string of words separated by spaces.&#xA;Search starts at the line where point is in.&quot;&#xA;  (interactive &quot;sSpace separated list of words:&quot;)&#xA;  (unless bound (setq bound (point-max)))&#xA;  (let ((word-list (split-string wordstr))&#xA;    line&#xA;    found)&#xA;    (while (and (&amp;lt; (point) bound)&#xA;        (setq line (buffer-substring-no-properties (point) (min bound (line-end-position))))&#xA;        (null (setq found (cl-subsetp word-list (split-string line) :test #'string-match))))&#xA;      (forward-line))&#xA;    (if found&#xA;    (let ((b (line-beginning-position))&#xA;          (e (line-end-position)))&#xA;      (goto-char b)&#xA;      (re-search-forward (concat &quot;\\(&quot; (mapconcat #'identity word-list &quot;\\)\\|\\(&quot;) &quot;\\)&quot;) e)) ;; Set `match-data', place point and return beginning of match.&#xA;      (unless noerror&#xA;    (error &quot;Line with words %s not found&quot; word-list))&#xA;      )))&#xA;&#xA;(defun occur-words-in-line (words &amp;amp;optional nlines)&#xA;  &quot;Linke `occur' but with `re-search-forward' replaced by `search-forward-words-in-line'.&quot;&#xA;  (interactive &quot;sSpace separated list of words:\nP&quot;)&#xA;  (setq nlines (and (numberp nlines) nlines))&#xA;  (let* ((original-re-search-forward (symbol-function 're-search-forward))&#xA;     (words-in-line-words words)&#xA;     (word-list (split-string words))&#xA;     (words-in-line-re (concat &quot;\\(&quot; (mapconcat #'identity word-list &quot;\\)\\|\\(&quot;) &quot;\\)&quot;)) ;; we keep regular expressions&#xA;     words-in-line-re-search-forward)&#xA;    (setq words-in-line-re-search-forward&#xA;      (lambda (words &amp;amp;optional bound noerror)&#xA;        (fset 're-search-forward original-re-search-forward)&#xA;        (prog1 (search-forward-words-in-line words-in-line-words bound noerror)&#xA;          (fset 're-search-forward words-in-line-re-search-forward))))&#xA;    (unwind-protect&#xA;    (progn&#xA;      (fset 're-search-forward words-in-line-re-search-forward)&#xA;      (occur words-in-line-re nlines))&#xA;      (fset 're-search-forward original-re-search-forward))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The programming of &lt;code&gt;occur-words-in-line&lt;/code&gt; would have been much cleaner if &lt;code&gt;occur&lt;/code&gt; provided search-plugins such as &lt;code&gt;query-replace-regexp&lt;/code&gt; does with &lt;code&gt;replace-re-search-function&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-04T20:43:46.573" LastActivityDate="2016-11-04T20:43:46.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28408" PostTypeId="1" AcceptedAnswerId="41251" CreationDate="2016-11-04T05:47:48.493" Score="7" ViewCount="1263" Body="&lt;p&gt;I've got some org-clock-tables created with the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 2 :block thisweek :link t :formula % :scope agenda-with-archives :step day :fileskip0&#xA;&#xA;| File           | Headline         | Time   |     % |&#xA;|----------------+------------------+--------+-------|&#xA;|                | ALL *Total time* | *5:04* | 100.0 |&#xA;|----------------+------------------+--------+-------|&#xA;| emacs.org      | *File time*      | *0:31* |  10.2 |&#xA;|                | Emacs            | 0:31   |  10.2 |&#xA;|----------------+------------------+--------+-------|&#xA;| project1.org   | *File time*      | *1:40* |  32.9 |&#xA;|                | Task1            | 1:40   |  32.9 |&#xA;|----------------+------------------+--------+-------|&#xA;| project2.org   | *File time*      | *2:40* |  52.6 |&#xA;|                | TaskA            | 2:40   |  52.6 |&#xA;|----------------+------------------+--------+-------|&#xA;| project3.org   | *File time*      | *0:13* |   4.3 |&#xA;|                | Task             | 0:13   |   4.3 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to have this list sorted by the last column to see which tasks I spend most of my time on in a given time period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried sorting that last column, but as each file is separated emacs doesn't sort it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a plugin or built-in command which already does this?&lt;/p&gt;&#xA;" OwnerUserId="9463" LastActivityDate="2022-10-11T18:36:05.150" Title="Org-clock-report sort by time" Tags="|org-mode|org-clock|org-clock-table|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28409" PostTypeId="1" CreationDate="2016-11-04T07:12:30.730" Score="12" ViewCount="1343" Body="&lt;p&gt;I learnt &lt;code&gt;. /path/to/file&lt;/code&gt; in bash is used to execute a file. Just out of curiosity, I eval something like the following in Emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(. 123)&#xA;     ⇒ 123&#xA;&#xA;(read &quot;(. 123)&quot;)&#xA;     ⇒ 123&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like Emacs simply reads &lt;code&gt;(. 123)&lt;/code&gt; as &lt;code&gt;123&lt;/code&gt;, what happened?&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="105" LastEditDate="2016-11-04T14:58:39.597" LastActivityDate="2016-11-04T14:58:39.597" Title="Meaning of period in (. 123)" Tags="|elisp|list|read|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28410" PostTypeId="2" ParentId="28409" CreationDate="2016-11-04T08:00:20.707" Score="15" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;It looks like Emacs simply reads (. 123) as 123, what happened?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's exactly what happened.  To back it up with sources:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (ch == '.')&#xA;  {&#xA;    if (!NILP (tail))&#xA;      XSETCDR (tail, read0 (readcharfun));&#xA;    else&#xA;      val = read0 (readcharfun);&#xA;    read1 (readcharfun, &amp;amp;ch, 0);&#xA;&#xA;    if (ch == ')')&#xA;      {&#xA;        if (doc_reference == 1)&#xA;          return make_number (0);&#xA;        if (doc_reference == 2 &amp;amp;&amp;amp; INTEGERP (XCDR (val)))&#xA;          /* ... */&#xA;        return val;&#xA;      }&#xA;    invalid_syntax (&quot;. in wrong context&quot;);&#xA;  }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the special case for &lt;code&gt;read_list&lt;/code&gt; in &lt;code&gt;lread.c&lt;/code&gt;.  Normally a &lt;code&gt;.&lt;/code&gt;&#xA;is treated by setting the cdr of the previously read tail by whatever&#xA;follows.  However in the case there is no tail (like when reading&#xA;&lt;code&gt;(. 123)&lt;/code&gt;), the next thing is read and returned as is.  Personally,&#xA;I'd expect that to lead to an invalid syntax error, but I'm sure&#xA;someone put the special case there to work around peculiarly terrible&#xA;sources.  I've tried out how other Lisp interpreters behave for fun&#xA;and none of &lt;code&gt;csi&lt;/code&gt;, &lt;code&gt;pil&lt;/code&gt; and &lt;code&gt;sbcl&lt;/code&gt; do permit reading this,  so it may&#xA;be worth a bug report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Guile behaves the same, MIT-Scheme doesn't.  There goes my theory of this behavior being a GNU thing...&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-11-04T08:39:55.750" LastActivityDate="2016-11-04T08:39:55.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28412" PostTypeId="2" ParentId="28255" CreationDate="2016-11-04T08:45:11.487" Score="2" Body="&lt;pre&gt;&lt;code&gt;  (defun my-insert-space-if-alnum (orig-func &amp;amp;rest args)&#xA;    &quot;Insert an extra space if the char read is alphabetical or a number.&quot;&#xA;    (let ((c (read-char)))&#xA;      (when (memq (get-char-code-property c 'general-category) '(Ll Lu Nd))&#xA;        (insert ?\ ))&#xA;      (insert c)))&#xA;  (dolist (f '(&#xA;               LaTeX-math-alpha&#xA;               LaTeX-math-beta&#xA;               LaTeX-math-delta&#xA;               LaTeX-math-Delta&#xA;               LaTeX-math-epsilon&#xA;               LaTeX-math-phi&#xA;               LaTeX-math-Phi&#xA;               LaTeX-math-gamma&#xA;               LaTeX-math-Gamma&#xA;               LaTeX-math-eta&#xA;               LaTeX-math-theta&#xA;               LaTeX-math-Theta&#xA;               LaTeX-math-kappa&#xA;               LaTeX-math-lambda&#xA;               LaTeX-math-Lambda&#xA;               LaTeX-math-mu&#xA;               LaTeX-math-nu&#xA;               LaTeX-math-nabla&#xA;               LaTeX-math-pi&#xA;               LaTeX-math-Pi&#xA;               LaTeX-math-chi&#xA;               LaTeX-math-rho&#xA;               LaTeX-math-sigma&#xA;               LaTeX-math-Sigma&#xA;               LaTeX-math-tau&#xA;               LaTeX-math-upsilon&#xA;               LaTeX-math-Upsilon&#xA;               LaTeX-math-omega&#xA;               LaTeX-math-Omega&#xA;               LaTeX-math-xi&#xA;               LaTeX-math-Xi&#xA;               LaTeX-math-psi&#xA;               LaTeX-math-Psi&#xA;               LaTeX-math-zeta&#xA;               ))&#xA;  (advice-add f :after #'my-insert-space-if-alnum))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-11-04T09:07:34.973" LastActivityDate="2016-11-04T09:07:34.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28413" PostTypeId="1" AcceptedAnswerId="28473" CreationDate="2016-11-04T12:14:10.447" Score="4" ViewCount="13259" Body="&lt;p&gt;I have recently moved from &lt;em&gt;dired&lt;/em&gt; to &lt;em&gt;ranger&lt;/em&gt;.&#xA;While using it on a regular work day, I noticed there isn't any command for creating a new directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a workaround or am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="8271" LastActivityDate="2019-09-05T09:57:12.293" Title="How do I create a new directory from within ranger?" Tags="|ranger|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28414" PostTypeId="2" ParentId="22675" CreationDate="2016-11-04T12:23:27.077" Score="1" Body="&lt;p&gt;Actually, the problem seems to be on the iPython side.&#xA;Upgrading to 5.1.0 fixed the problem, both with Anaconda iPython or MSYS2 iPython.&lt;/p&gt;&#xA;" OwnerUserId="13890" LastActivityDate="2016-11-04T12:23:27.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28415" PostTypeId="1" CreationDate="2016-11-04T12:32:15.530" Score="1" ViewCount="200" Body="&lt;p&gt;According to the &lt;a href=&quot;http://orgmode.org/manual/Repeated-tasks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;docs&lt;/a&gt;, &lt;code&gt;C-- 1 C-c C-t&lt;/code&gt; aka &lt;code&gt;org-todo&lt;/code&gt; with a negative prefix should close a repeated task once and for all. Unfortunately it just doesn't work for me. Any ideas what could be causing this or how I could close the task?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatives seem to be to manually set the task to &lt;code&gt;DONE&lt;/code&gt;, delete it, archive it, ... However, I would like to get my setup working :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: By &quot;it just doesn't work&quot; I meant that the task is logged as done with the current time but is also rescheduled immediately, i.e. it's not fully closeable.&lt;/p&gt;&#xA;" OwnerUserId="13891" LastEditorUserId="-1" LastEditDate="2016-11-23T10:50:41.210" LastActivityDate="2016-11-23T10:50:41.210" Title="Closing a repeated task once and for all doesn't work" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28416" PostTypeId="1" AcceptedAnswerId="28436" CreationDate="2016-11-04T13:14:21.130" Score="1" ViewCount="432" Body="&lt;p&gt;I recently came across various workgroup extensions for Emacs and have been doing some experiments. I had a look at:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/wasamasa/eyebrowse&quot; rel=&quot;nofollow noreferrer&quot;&gt;eyebrowse&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/tlh/workgroups.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;workgroups&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/pashinin/workgroups2&quot; rel=&quot;nofollow noreferrer&quot;&gt;workgroups2&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(I have currently settled with workgroups2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could see the workgroup details on the default Emacs modeline but as soon as I enable the &lt;a href=&quot;https://github.com/milkypostman/powerline&quot; rel=&quot;nofollow noreferrer&quot;&gt;powerline&lt;/a&gt; or the &lt;a href=&quot;https://github.com/dbordak/telephone-line&quot; rel=&quot;nofollow noreferrer&quot;&gt;telephone-line&lt;/a&gt;, I could not see the workgroups anymore, except for the &lt;strong&gt;wg&lt;/strong&gt; as an indication that the minor-mode is enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone provide me a few pointers for how I can get it on the custom mode-line?&lt;/p&gt;&#xA;" OwnerUserId="8271" LastActivityDate="2016-11-05T08:11:39.717" Title="Displaying workgroup details on powerline or telephone-line modeline" Tags="|powerline|workgroups|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28417" PostTypeId="2" ParentId="28384" CreationDate="2016-11-04T13:22:00.950" Score="4" Body="&lt;p&gt;Emacs-22.1 was released on June 2 2007, so it qualifies as ancient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AFAIK the usual 32bit build of Emacs is currently limited to 512MB buffers (tho there's a compilation option to push this limit to 2GB at the cost of performance), and IIRC on Emacs&amp;lt;24 a similar limit applied to 64bit versions of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So better ditch Apple's bundled Emacs and install the real thing.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-04T13:22:00.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28418" PostTypeId="2" ParentId="28394" CreationDate="2016-11-04T14:11:13.187" Score="0" Body="&lt;p&gt;Just as an exercise, here's a more &lt;code&gt;occur&lt;/code&gt;-like way to search for matching lines:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar search-multi-mode-map nil&#xA;  ;; (let ((map (make-sparse-keymap)))&#xA;  ;;   (define-key map (kbd &quot;RET&quot;) 'search-multi-goto)&#xA;  ;;   map)&#xA;  &quot;Keymap for `search-multi-mode'.&quot;)&#xA;&#xA;(defvar search-multi-mode-hook nil&#xA;  &quot;These hooks are run when `search-multi-mode' starts&quot;)&#xA;&#xA;(define-derived-mode search-multi-mode fundamental-mode &quot;Search-Multi&quot;&#xA;  &quot;Major mode for searching for multiple words in a buffer.&#xA;&#xA;Available commands:&#xA;\\{search-multi-mode-map}&quot;&#xA;&#xA;  (run-hooks search-multi-mode-hook)&#xA;  (buffer-disable-undo)&#xA;  (read-only-mode 0)&#xA;  (erase-buffer)&#xA;  (insert &quot;;; -*- mode: multi-search -*-\n\n&quot;)&#xA;  (read-only-mode 1))&#xA;&#xA;(defun search-multi-goto (button)&#xA;  (interactive)&#xA;  (let ((line (button-get button 'line)))&#xA;    (with-current-buffer (pop-to-buffer search-multi-source)&#xA;      (goto-char (point-min))&#xA;      (forward-line (1- line)))))&#xA;&#xA;(defvar-local search-multi-source nil&#xA;  &quot;The source buffer where the search was performed&quot;)&#xA;&#xA;(defun search-multi-popup (matches)&#xA;  (let ((b (current-buffer)))&#xA;    (with-current-buffer (get-buffer-create &quot;*multi-search*&quot;)&#xA;      (search-multi-mode)&#xA;      (read-only-mode 0)&#xA;      (setq-local search-multi-source b)&#xA;      (insert &quot;searched: &quot; (buffer-name b) &quot;\n\n&quot;)&#xA;      (while matches&#xA;        (let ((match (car matches))&#xA;              (p (point)))&#xA;          (insert (format &quot;%d: %s&quot; (car match) (cdr match)))&#xA;          (make-text-button p (point)&#xA;                            'face 'font-lock-variable-name-face&#xA;                            'action 'search-multi-goto&#xA;                            'line (car match)))&#xA;        (setq matches (cdr matches)))&#xA;      (read-only-mode 1)&#xA;      (pop-to-buffer (current-buffer)))))&#xA;&#xA;(defun search-multi (words)&#xA;  (interactive &quot;MWords to search (separate with space): &quot;)&#xA;  (let ((words (sort (split-string words &quot; &quot;) 'string-lessp))&#xA;        (current-line 0)&#xA;        matches)&#xA;    (while (not (eobp))&#xA;      (setq current-line (1+ current-line))&#xA;      (let* ((raw-line (buffer-substring-no-properties&#xA;                        (point)&#xA;                        (progn (forward-line) (point))))&#xA;             (line&#xA;              (sort (split-string raw-line &quot;[^[:alnum:]]&quot; t)&#xA;                    'string-lessp))&#xA;             (words words))&#xA;        (catch :failed&#xA;          (while (and words line)&#xA;            (let ((a (car words))&#xA;                  (b (car line)))&#xA;              (cond&#xA;               ((string-equal a b)&#xA;                (setq words (cdr words) line (cdr line)))&#xA;               ((string-lessp b a)&#xA;                (setq line (cdr line)))&#xA;               (t (throw :failed t)))))&#xA;          (unless words&#xA;            (setq matches&#xA;                  (cons (cons current-line raw-line) matches))))))&#xA;    (search-multi-popup matches)))&#xA;&#xA;(provide 'search-multi)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-11-04T14:11:13.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28419" PostTypeId="1" AcceptedAnswerId="28423" CreationDate="2016-11-04T14:53:35.803" Score="4" ViewCount="119" Body="&lt;p&gt;Is it possible to get ESS to display results of &lt;code&gt;help(package=xxx)&lt;/code&gt; in a new buffer, like it does for &lt;code&gt;?xxx&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="5131" LastActivityDate="2016-11-04T16:58:12.490" Title="ESS: getting help on package" Tags="|ess|r|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28420" PostTypeId="1" CreationDate="2016-11-04T15:16:45.863" Score="2" ViewCount="476" Body="&lt;p&gt;This year, I am having classes with complex descriptions, such as &quot;every 1st and 3rd friday between 2016-11-18 and 2017-5-19&quot;, so I chose to use org-mode agenda combined with sexps to describe them easily:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*17:00-19:00 Name of the class&#xA; &amp;lt;%%(and&#xA;      (diary-block 11 18 2016 5 19 2017)&#xA;      (or&#xA;        (diary-float t 5 1)&#xA;        (diary-float t 5 3)&#xA;      ))&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I want to export my schedule in the iCalendar format, to be able to use it in Lightning and/or Google Calendar. However, when I export it with &lt;code&gt;C-c C-e c f&lt;/code&gt; (&lt;em&gt;ie&lt;/em&gt; &quot;Export current file to iCalendar&quot;), I only get the events I input in classical timestamp format, &lt;em&gt;e.g.&lt;/em&gt; &lt;code&gt;*Name of class &amp;lt;2016-12-12 Mon&amp;gt;&lt;/code&gt;, although &lt;code&gt;org-icalendar-include-sexps&lt;/code&gt; evaluates to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried to use the agenda view exporting utility &lt;code&gt;C-c a e&lt;/code&gt;, but encountered the same problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. : I finally tried the alternative solution of directly importing my schedule to Google Calendar using org-gcal (&lt;a href=&quot;https://github.com/myuhe/org-gcal.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/myuhe/org-gcal.el&lt;/a&gt;), to no avail.&lt;/p&gt;&#xA;" OwnerUserId="13893" LastActivityDate="2023-02-14T19:02:04.870" Title="Orgmode : exporting agenda with sexps to ics" Tags="|org-mode|org-export|org-agenda|sexp|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28421" PostTypeId="1" CreationDate="2016-11-04T15:19:14.520" Score="2" ViewCount="73" Body="&lt;p&gt;f.e. I want to compare 2 pair of files&lt;br&gt;&#xA;file1 vs file11&lt;br&gt;&#xA;file2 vs file22&lt;br&gt;&#xA;For now I run the bash &lt;code&gt;for&lt;/code&gt;, loop over 2 file pairs and run emacs 2 times. But it is not so convenient because I can not go back.&lt;br&gt;&#xA;Is it possible to run emacs with a list of file pairs which will open several ediff sessions where I'll be able to switch between them?  &lt;/p&gt;&#xA;" OwnerUserId="9682" LastActivityDate="2016-11-04T15:19:14.520" Title="several ediff sessions in one emacs" Tags="|ediff|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28422" PostTypeId="1" CreationDate="2016-11-04T16:36:04.630" Score="3" ViewCount="242" Body="&lt;p&gt;I have own minor-mode with 2 (for now) user specific variables (string and int). For now they are dropping to default values each emacs restart. Which is not convenient.&lt;br&gt;&#xA;How  and where it is better to save them?&lt;br&gt;&#xA;For now I found 2 options:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using &lt;code&gt;savehist-additional-variables&lt;/code&gt; function.&lt;/li&gt;&#xA;&lt;li&gt;Binding hook to &lt;code&gt;kill-emacs-hook&lt;/code&gt; and writing it into own file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any other option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more precise. My minor mode is running build based on custom build script and one of the variables is a &lt;code&gt;target-name&lt;/code&gt; which user does not change while he is working on one target and changing from time to time while switching between modules.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think &lt;code&gt;savehist-additional-variables&lt;/code&gt; will be the best choice in my case.&lt;/p&gt;&#xA;" OwnerUserId="9682" LastEditorUserId="9682" LastEditDate="2016-11-04T21:05:19.507" LastActivityDate="2016-11-04T21:05:19.507" Title="save variable on exit" Tags="|minor-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28423" PostTypeId="2" ParentId="28419" CreationDate="2016-11-04T16:58:12.490" Score="4" Body="&lt;p&gt;&lt;code&gt;M-x ess-display-package-index&lt;/code&gt;, bound to &lt;code&gt;C-c C-d i&lt;/code&gt; by default, does exactly this.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-11-04T16:58:12.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28424" PostTypeId="1" AcceptedAnswerId="28553" CreationDate="2016-11-04T17:26:26.677" Score="8" ViewCount="609" Body="&lt;p&gt;I have a function that automatically runs after the user does some action. However, the function takes a long time to complete. This means Emacs becomes unresponsive for a short time after every input. To fix this, I'd like to check whether the user has entered a new input and if so, cancel execution of this function and proceed with the user's input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a variable that holds queued keyboard inputs? If not, is there another way to check whether the user has pressed a button since a function started running?&lt;/p&gt;&#xA;" OwnerUserId="12892" LastActivityDate="2016-11-09T10:21:28.053" Title="How can I check if a user has pressed a button while a function is running?" Tags="|inputs|keyboard|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28425" PostTypeId="2" ParentId="28422" CreationDate="2016-11-04T17:40:08.427" Score="4" Body="&lt;p&gt;Emacs provides the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/defcustom.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Customize&lt;/a&gt; system for user-configurable variables. Your definition can include a default value, but Emacs provides an interface for the user to specify their own value. The user-set value is saved in their .emacs, or if they've set it up, a separate customization file. Either way, the value is permanently stored, so that when you restart Emacs, the user's value is used to initialize the variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example from the linked manual page:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For example, the customizable user option variable text-mode-hook looks like this:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom text-mode-hook nil&#xA;  &quot;Normal hook run when entering Text mode and many related modes.&quot;&#xA;  :type 'hook&#xA;  :options '(turn-on-auto-fill flyspell-mode)&#xA;  :group 'wp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The name of the variable is text-mode-hook; it has no default value; and its documentation string tells you what it does. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the linked page for more detail and options.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-11-04T17:40:08.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28426" PostTypeId="2" ParentId="6051" CreationDate="2016-11-04T18:40:56.267" Score="0" Body="&lt;p&gt;Going off the answer by Kaushal Modi this is a more general solution that will use the &lt;code&gt;csh-indentation&lt;/code&gt; anytime your shell file is set to &lt;code&gt;tcsh&lt;/code&gt; or &lt;code&gt;csh&lt;/code&gt;. That way you don't have to enumerate every file that you want this fix to apply to and it won't affect other shell types. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/tcsh-set-indent-functions ()&#xA;  (when (string-match &quot;.*csh.*&quot; (symbol-value 'sh-shell-file))&#xA;    (require 'csh-mode) ; https://github.com/Tux/tcsh/blob/tux/csh-mode.el&#xA;    (setq-local indent-line-function 'csh-indent-line)&#xA;    (setq-local indent-region-function 'csh-indent-region)))&#xA;(add-hook 'sh-set-shell-hook #'my/tcsh-set-indent-functions)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12269" LastActivityDate="2016-11-04T18:40:56.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28427" PostTypeId="2" ParentId="28301" CreationDate="2016-11-04T18:47:25.347" Score="4" Body="&lt;p&gt;This answer is really a comment on @mutbuerger's &lt;a href=&quot;https://emacs.stackexchange.com/a/28387/2221&quot;&gt;answer&lt;/a&gt;. I'm posting it here because comments can't and shouldn't contain blocks of code. I figured out how to avoid the need for inventing names for the JavaScript blocks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: inline-js&#xA;#+begin_src emacs-lisp :exports none :results html&#xA;  (format&#xA;   &quot;&amp;lt;script type =\&quot;text/javascript\&quot;&amp;gt;\n%s\n&amp;lt;/script&amp;gt;\n&quot;&#xA;   (save-excursion&#xA;     (org-babel-next-src-block)&#xA;     (cadr (org-babel-get-src-block-info))))&#xA;#+end_src&#xA;&#xA;#+call: inline-js()&#xA;#+begin_src javascript :exports none&#xA;console.log('foo');&#xA;#+end_src&#xA;&#xA;#+call: inline-js()&#xA;#+begin_src javascript :exports none&#xA;console.log('bar');&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I initially tried to use &lt;code&gt;org-babel-previous-src-block&lt;/code&gt; and to keep the &lt;code&gt;#+call: inline-js()&lt;/code&gt;'s &lt;em&gt;after&lt;/em&gt; the JavaScript blocks as in mutbuerger's answer, but that doesn't work because by the time the Org exporter get's to the &lt;code&gt;#+call&lt;/code&gt; line it has already removed the JavaScript block from the buffer (because of the &lt;code&gt;:exports none&lt;/code&gt;)! Ah, the joys of stateful programming.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-11-04T18:47:25.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28428" PostTypeId="2" ParentId="28394" CreationDate="2016-11-04T20:36:26.667" Score="1" Body="&lt;p&gt;If you are searching files, and if you only care about search contexts that are lines of text, then you can use &lt;code&gt;M-x grep&lt;/code&gt;.  You just keep piping &lt;code&gt;grep&lt;/code&gt; commands, to add additional filters. The resulting lines are those containing matches for each of the filters, &lt;em&gt;in any order&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;M-x grep -nH -e for icicles-doc.el | grep the | grep function&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;icicles-doc1.el:1758:;;  prompts you &lt;strong&gt;for&lt;/strong&gt; a &lt;strong&gt;function&lt;/strong&gt; to apply to &lt;strong&gt;the&lt;/strong&gt; current completion&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:2415:;;  For most Emacs &lt;strong&gt;function&lt;/strong&gt;s that prompt you &lt;strong&gt;for&lt;/strong&gt; input, &lt;strong&gt;the&lt;/strong&gt; person who&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:4182:;;       candidates are proxy candidates &lt;strong&gt;for&lt;/strong&gt; &lt;strong&gt;the&lt;/strong&gt;se &lt;strong&gt;function&lt;/strong&gt;s.)&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:4783:;;  The second argument is &lt;strong&gt;the&lt;/strong&gt; actual &lt;strong&gt;function&lt;/strong&gt; used &lt;strong&gt;for&lt;/strong&gt; sorting.  It&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:5532:;;  &lt;strong&gt;function&lt;/strong&gt; is designed to be `C-u' sensitive.  This is &lt;strong&gt;the&lt;/strong&gt; case &lt;strong&gt;for&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:6241:;;  prompts you once &lt;strong&gt;for&lt;/strong&gt; &lt;strong&gt;the&lt;/strong&gt; &lt;strong&gt;function&lt;/strong&gt; to apply, and &lt;strong&gt;the&lt;/strong&gt;n applies it to&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:6270:;;  &lt;strong&gt;function&lt;/strong&gt; &lt;strong&gt;for&lt;/strong&gt; some command.  Do this if you always want &lt;strong&gt;the&lt;/strong&gt; same&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:6302:;;  predefined &lt;strong&gt;for&lt;/strong&gt; type `&lt;strong&gt;function&lt;/strong&gt;'.  Since &lt;strong&gt;the&lt;/strong&gt; actions you can choose&lt;/p&gt;&#xA;&lt;p&gt;icicles-doc1.el:6304:;;  &lt;strong&gt;the&lt;/strong&gt;m, to apply a &lt;strong&gt;function&lt;/strong&gt;-&lt;strong&gt;for&lt;/strong&gt;-&lt;strong&gt;function&lt;/strong&gt;s (e.g. `find-&lt;strong&gt;function&lt;/strong&gt;' or&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;...&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-11-04T20:36:26.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28429" PostTypeId="1" AcceptedAnswerId="28430" CreationDate="2016-11-04T22:29:02.870" Score="25" ViewCount="4458" Body="&lt;p&gt;In a situation where Emacs is not behaving like I want, what can I do to troubleshoot the problem? What steps can I take to find and fix the problem myself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, failing that, how can I gather useful information that so that people here (or on the mailing list or other forums) can help me with my problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs includes many packages, a collection of snippets copy &amp;amp; pasted (or killed &amp;amp; yanked) from all over the internet, and my own custom elisp, some of which I don't recall writing, or no longer understand. Is there a way to make sense of all of these complications?&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="105" LastEditDate="2017-09-21T23:53:37.093" LastActivityDate="2021-08-05T16:16:26.590" Title="How do I troubleshoot Emacs problems?" Tags="|init-file|debugging|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28430" PostTypeId="2" ParentId="28429" CreationDate="2016-11-04T22:29:02.870" Score="35" Body="&lt;h1&gt;Step 1: running &lt;code&gt;emacs -Q&lt;/code&gt;&lt;/h1&gt;&#xA;&lt;p&gt;The first thing you need to do is run emacs without any of your customizations. If you can reproduce the problem in vanilla Emacs, it may actually be a bug in Emacs itself. That's rare, but we rule it out as a first step.&lt;/p&gt;&#xA;&lt;p&gt;If you start Emacs from the command line with the &lt;code&gt;-Q&lt;/code&gt; flag, i.e., &lt;code&gt;emacs -Q&lt;/code&gt;, you'll get a bare or 'vanilla' emacs, with none of your local customizations loaded. Does your problem still occur? If so, skip down to &amp;quot;Providing a Bug Recipe&amp;quot;.&lt;/p&gt;&#xA;&lt;h2&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code&gt;emacs -q&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;While &lt;code&gt;emacs -Q&lt;/code&gt; runs emacs without &lt;em&gt;any&lt;/em&gt; customizations, &lt;code&gt;emacs -q&lt;/code&gt; runs it without &lt;em&gt;user&lt;/em&gt; customizations, but still runs &lt;em&gt;site&lt;/em&gt; customizations. If you have a bug that occurs with &lt;code&gt;emacs -q&lt;/code&gt;, but not &lt;code&gt;emacs -Q&lt;/code&gt;, then the problem is in your site config. In that case, you need to find the file &lt;code&gt;site-start.el&lt;/code&gt;. It's location depends on your OS. Some Linux distributions put it in &lt;code&gt;/etc/emacs/&lt;/code&gt;. It may also be in &lt;code&gt;/usr/local/share/emacs/site-lisp/&lt;/code&gt;. The &lt;code&gt;locate&lt;/code&gt; command line program may be helpful in tracking it down.&lt;/p&gt;&#xA;&lt;h2&gt;Step 1b: what if the problem is with a package?&lt;/h2&gt;&#xA;&lt;p&gt;If your problem is specific to a particular package, then obviously you can't reproduce it without loading that package. But you want to load only the package concerned, not all of your configuration. To do that, run &lt;code&gt;emacs -Q&lt;/code&gt; again, and prepare a short script such as the following:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-load-list&#xA;      '((package1 t)))&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Replace &lt;code&gt;package1&lt;/code&gt; with the name of the package you want to load. If you need to load multiple packages, modify the script accordingly:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-load-list&#xA;      '((package1 t)&#xA;        (package2 t)&#xA;        (package3 t)))&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To load this code, you can paste it into the &lt;code&gt;*scratch*&lt;/code&gt; buffer, and call &lt;code&gt;M-x eval-buffer&lt;/code&gt;. (or any buffer, as long as it doesn't have any other code in it!).&lt;/p&gt;&#xA;&lt;p&gt;At this point, you've loaded the package(s), and just the package(s) you're testing. If you can reproduce the problem now, skip down to &amp;quot;Providing a Bug Recipe&amp;quot;.&lt;/p&gt;&#xA;&lt;h1&gt;Step 2: Finding a Bug in your &lt;code&gt;.emacs&lt;/code&gt;&lt;/h1&gt;&#xA;&lt;p&gt;You've now confirmed that the problem is coming from something in your configuration (&amp;quot;the call is coming from inside the house!&amp;quot;). Your configuration may be many thousands of lines long, and may load many different files. To find the problem, you'll do a binary search, commenting out half the code at a time to narrow things down.&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open your regular emacs, &lt;code&gt;emacs&lt;/code&gt;, without the &lt;code&gt;-Q&lt;/code&gt; option.&lt;/li&gt;&#xA;&lt;li&gt;Open your config file (usually &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;.emacs.d/init.el&lt;/code&gt;, if you can't find it try &lt;code&gt;C-h v user-init-file&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Select the first half of the file: &lt;code&gt;C-space&lt;/code&gt; to set the mark, scroll down half-way to extend the region&lt;/li&gt;&#xA;&lt;li&gt;Comment out the selected region: &lt;code&gt;M-;&lt;/code&gt; and &lt;strong&gt;save the file&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Open a &lt;strong&gt;new&lt;/strong&gt; &lt;code&gt;emacs&lt;/code&gt; (your &lt;em&gt;test emacs&lt;/em&gt;), leaving the first emacs running. &lt;em&gt;test emacs&lt;/em&gt; will read the reduced version of your config.&lt;/li&gt;&#xA;&lt;li&gt;Try to reproduce the problem in &lt;em&gt;test emacs&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;If you can't reproduce it, close &lt;em&gt;test emacs&lt;/em&gt;, and in your original emacs &lt;code&gt;undo&lt;/code&gt; the comment with &lt;code&gt;C-/&lt;/code&gt;, and comment out half of the remaining code. Open a new &lt;em&gt;test emacs&lt;/em&gt; and try again.&lt;/li&gt;&#xA;&lt;li&gt;If you can reproduce the problem, comment out half of the remaining code and see if the problem persists.&lt;/li&gt;&#xA;&lt;li&gt;Repeat this process until you find the smallest bit of your configuration necessary to reproduce the problem.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If your problem is with a specific package, you'll have to leave the code that loads that package uncommented, of course.&lt;/p&gt;&#xA;&lt;p&gt;If your config file loads other files, you may end up extending your search into those files as well.&lt;/p&gt;&#xA;&lt;p&gt;At this point, you may have found that the problem is due to just a line or two of code. You may even be able to fix it yourself. If so, congratulations, you've learned something! Otherwise, move along to step three.&lt;/p&gt;&#xA;&lt;h1&gt;Step 3: Providing a Bug Recipe&lt;/h1&gt;&#xA;&lt;p&gt;At this point, you should be able to provide a detailed bug recipe to post here. It should include:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your Emacs version (you can get this from Emacs with &lt;code&gt;M-x emacs-version&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Your operating system (Windows #, Mac, Linux distribution)&lt;/li&gt;&#xA;&lt;li&gt;The version of the package your struggling with, if applicable&lt;/li&gt;&#xA;&lt;li&gt;The specific steps necessary to demonstrate the problem, including what you &lt;strong&gt;expect to happen&lt;/strong&gt;, and what &lt;strong&gt;actually happens&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For example, I might post a question like this:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I'm having a problem with super-mode. When I use &lt;code&gt;M-x sm-compile-code&lt;/code&gt;, it makes a withdrawal from my PayPal account.&lt;/p&gt;&#xA;&lt;p&gt;Steps to reproduce:&lt;/p&gt;&#xA;&lt;p&gt;Load super-mode:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-load-list&#xA;      '((super-mode t)))&#xA;(package-initialize)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open a new file with &lt;code&gt;C-x C-f my-code&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;enter a line of code:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;10 goto 10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;call &lt;code&gt;M-x sm-compile-code&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I expect this to invoke the super-compiler and compile my program. Instead, I see a message in the minibuffer &amp;quot;$100 transfered from paypal to super-mode author&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;GNU Emacs 25.1.50.3&lt;br /&gt;&#xA;Debian Linux&lt;br /&gt;&#xA;Super-mode version 3.1415&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt;The &lt;a href=&quot;https://github.com/Malabarba/elisp-bug-hunter&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bug Hunter&lt;/a&gt; package might help you with this, (semi-)automatically bisecting your init file.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2021-08-05T16:16:26.590" LastActivityDate="2021-08-05T16:16:26.590" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="28431" PostTypeId="1" AcceptedAnswerId="28432" CreationDate="2016-11-05T00:09:11.080" Score="3" ViewCount="962" Body="&lt;p&gt;I use emacs gui in daemon mode and also in standalone terminal mode. There is a package that I just want to use when I'm using emacs in terminal mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the problem is that I can't use &lt;code&gt;(display-graphic-p)&lt;/code&gt; because when I run &lt;code&gt;emacs --daemon&lt;/code&gt; the initialization system thinks that I have no graphic-display, but I'll have when I connect the emacsclient to the daemon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish I had access to a function like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (emacs-initiating-in-daemon-mode)&#xA;    (my-setup-for-gui)&#xA;    (my-setup-for-terminal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is that possible?&lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="15477" LastEditDate="2017-06-17T13:23:01.940" LastActivityDate="2017-06-17T13:23:01.940" Title="How to check for emacs being initialized in daemon mode?" Tags="|emacsclient|terminal-emacs|emacs-daemon|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28432" PostTypeId="2" ParentId="28431" CreationDate="2016-11-05T00:38:22.000" Score="6" Body="&lt;p&gt;I think &lt;code&gt;daemonp&lt;/code&gt; is what you're looking for.  From its docstring:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Return non-nil if the current emacs process is a daemon.&#xA;If the daemon was given a name argument, return that name.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2016-11-05T00:38:22.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28433" PostTypeId="1" AcceptedAnswerId="28434" CreationDate="2016-11-05T01:47:08.983" Score="0" ViewCount="52" Body="&lt;p&gt;I want to write function that will create new empty buffer, populates it with current &lt;code&gt;term&lt;/code&gt; buffer contents, preserving point and window-start positions, and switch to it right away. Basically I want to make my own &lt;code&gt;term-line-mode&lt;/code&gt;. Function below do it all great, with only problem that its not preserving coloring of term buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sandric/duplicate-current-term-buffer ()&#xA;  (interactive)&#xA;  (let ((duplicate-buffer (get-buffer-create &quot;NEWBUF&quot;))&#xA;        (term-point (point))&#xA;        (term-window-start (window-start))&#xA;        (term-overlay (make-overlay (point-min) (point-max))))&#xA;    (copy-to-buffer duplicate-buffer (point-min) (point-max))&#xA;    (switch-to-buffer duplicate-buffer)&#xA;    (set-window-start (selected-window) term-window-start)&#xA;    (goto-char term-point)&#xA;    (move-overlay term-overlay (point-min) (point-max) duplicate-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know nothing about coloring in emacs, and how its actually works, as I understand, it is done via overlays? So in that code I tried to get current term buffer overlay and copy it to newly created duplicate buffer. But I see no color. Can anyone explain how should I tackle this?&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-11-05T04:12:32.427" Title="Create term buffer duplicate with coloring preserved" Tags="|overlays|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28434" PostTypeId="2" ParentId="28433" CreationDate="2016-11-05T03:08:42.047" Score="2" Body="&lt;pre&gt;&lt;code&gt;(defun sandric/duplicate-current-term-buffer ()&#xA;  (interactive)&#xA;  (let ((duplicate-buffer (get-buffer-create &quot;NEWBUF&quot;))&#xA;        (term-point (point))&#xA;        (term-window-start (window-start))&#xA;        (term-window (current-buffer)))&#xA;    (switch-to-buffer duplicate-buffer)&#xA;    (delete-region (point-min) (point-max))&#xA;    (insert-buffer term-window)&#xA;    (set-window-start (selected-window) term-window-start)&#xA;    (goto-char term-point)&#xA;    (fundamental-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;edit: Add call to fundamental-mode&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2016-11-05T04:12:32.427" LastActivityDate="2016-11-05T04:12:32.427" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28435" PostTypeId="1" CreationDate="2016-11-05T06:49:53.720" Score="12" ViewCount="1374" Body="&lt;p&gt;I began exploring &lt;code&gt;org-mode&lt;/code&gt; lately and I love it. But, I'd like to know how I can have more control over repeating tasks, like if I've set a task to repeat everyday, how can I make it exclude weekends? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there a option like a &lt;em&gt;holiday mode&lt;/em&gt; or something similar which when turned on asks for the duration i'll be away and all my repeating tasks(if I have any that are scheduled during the time I take off) are rescheduled automatically to the next scheduled day after the holiday ends.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-11-09T17:52:19.533" Title="How can I have more control over repeating tasks in Org?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28436" PostTypeId="2" ParentId="28416" CreationDate="2016-11-05T08:11:39.717" Score="1" Body="&lt;p&gt;After &lt;em&gt;intense&lt;/em&gt; research on Emacs modeline and &lt;strong&gt;workgroups2&lt;/strong&gt; code, I finally figured it out!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turns out that the expression &lt;code&gt;wg-mode-line-string&lt;/code&gt; can be used to construct a segment for telephone-line like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(telephone-line-defsegment telephone-line-workgroups2-segment&#xA;  (wg-mode-line-string))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is now integrated in my &lt;a href=&quot;https://github.com/myTerminal/dotfiles/blob/master/.emacs.d/myTerminal/packages.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;dotfiles&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8271" LastActivityDate="2016-11-05T08:11:39.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28438" PostTypeId="2" ParentId="28343" CreationDate="2016-11-05T10:41:04.093" Score="0" Body="&lt;p&gt;The following is a broken (or incomplete) answer ...  I'm trying to fix my original problem using the &lt;code&gt;sh-mode&lt;/code&gt; calls only instead of the lower-level &lt;code&gt;smie&lt;/code&gt; calls that Stefan was kind enough to provide, just to see if it can be done. Reading those docs and running in a fresh &lt;code&gt;emacs -Q&lt;/code&gt; session, I did this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x sh-learn-line-indent RET before &quot;|&quot; RET nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The style then worked for me and indented the lines ending in &quot;|&quot; - but not the final &quot;)&quot; - I'll still need Stefan's code for that. Then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x sh-name-style RET bobs&#xA;M-x sh-save-styles-to-buffer RET *scratch*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then used that code to create this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-sh-indent-rules ()&#xA;  (setq sh-styles-alist&#xA;        '((&quot;bobs&quot;&#xA;           (sh-basic-offset . 4)&#xA;           (sh-first-lines-indent . 0)&#xA;           (sh-indent-after-case . +)&#xA;           (sh-indent-after-do . +)&#xA;           (sh-indent-after-done . 0)&#xA;           (sh-indent-after-else . +)&#xA;           (sh-indent-after-if . +)&#xA;           (sh-indent-after-loop-construct . +)&#xA;           (sh-indent-after-open . +)&#xA;           (sh-indent-comment . t)&#xA;           (sh-indent-for-case-alt . ++)&#xA;           (sh-indent-for-case-label . +)&#xA;           (sh-indent-for-continuation . +)&#xA;           (sh-indent-for-do . 0)&#xA;           (sh-indent-for-done . 0)&#xA;           (sh-indent-for-else . 0)&#xA;           (sh-indent-for-fi . 0)&#xA;           (sh-indent-for-then . 0))))&#xA;  (sh-load-style &quot;bobs&quot;))&#xA;(add-hook 'sh-mode-hook #'my-sh-indent-rules)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... note that it has no &lt;code&gt;before &quot;|&quot;&lt;/code&gt; rule. Perhaps it doesn't know how to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, running that in a fresh &lt;code&gt;emacs -Q&lt;/code&gt; session it doesn't work even after a &lt;code&gt;M-x sh-load-style RET bobs&lt;/code&gt;, so I'm reverting to the default behaviour. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm happy with Stefan's &lt;code&gt;smie&lt;/code&gt; solution above, but I'd be interested to know how to make it work with &lt;code&gt;sh-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13856" LastEditorUserId="13856" LastEditDate="2018-12-27T23:26:32.240" LastActivityDate="2018-12-27T23:26:32.240" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28439" PostTypeId="1" CreationDate="2016-11-05T11:28:26.383" Score="1" ViewCount="653" Body="&lt;p&gt;In vim, right after opening a file, I can type &lt;code&gt;g;&lt;/code&gt; to go to&#xA;the place last edited.  This doesn't work in evil-mode with my&#xA;configuration.  Is there something I can do to make it work?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2016-11-09T08:55:39.260" Title="Go to last session's last edit" Tags="|evil|" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28440" PostTypeId="1" AcceptedAnswerId="28443" CreationDate="2016-11-05T12:53:59.547" Score="1" ViewCount="865" Body="&lt;p&gt;I am using the distinguished theme. I want to set the main font color to something more dark, how could i do that?&lt;/p&gt;&#xA;" OwnerDisplayName="user12021" LastActivityDate="2016-11-05T14:40:55.393" Title="Customize theme font color" Tags="|themes|customize|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28441" PostTypeId="1" AcceptedAnswerId="28448" CreationDate="2016-11-05T12:57:26.147" Score="45" ViewCount="12127" Body="&lt;p&gt;My Emacs config lives inside of a &lt;code&gt;.org&lt;/code&gt; file from which I tangle source blocks to a &lt;code&gt;.el&lt;/code&gt; file. I could evaluate source blocks with &lt;kbd&gt;C-c C-c&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I updated to org-mode version 9 from org elpa and now evaluating a source block like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle yes&#xA;(setq org-export-coding-system 'utf-8)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;kbd&gt;C-c C-c&lt;/kbd&gt; prints the following message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Evaluation of this emacs-lisp code-blockis disabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;init.el&lt;/code&gt; I have already defined the languages for org-babel:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA;'org-babel-load-languages&#xA;'((emacs-lisp . t)&#xA;  (org . t)&#xA;  (sh . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I load the stock Emacs version of org-mode I can tangle with &lt;kbd&gt;C-c C-c&lt;/kbd&gt; as expected.&#xA;I could not find any changes regarding this in the changelog for org-mode 9.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to enable evaluation of code-blocks in org-mode 9?&lt;/p&gt;&#xA;" OwnerUserId="13901" LastEditorUserId="12247" LastEditDate="2016-11-05T14:02:56.443" LastActivityDate="2018-05-17T17:51:40.923" Title="Org-mode 9: unable to eval code-blocks" Tags="|org-mode|org-babel|eval|tangle|" AnswerCount="6" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28442" PostTypeId="2" ParentId="27597" CreationDate="2016-11-05T13:26:14.273" Score="0" Body="&lt;p&gt;I had the same issue like you and no solution I've found worked. That's what I did eventually.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;git clone git://orgmode.org/org-mode.git&lt;/li&gt;&#xA;&lt;li&gt;make&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That didn't work and emacs still loaded the old org version. So I deleted all files in /usr/local/share/emacs/25.1/lisp/org and then copied the files from org-mode/lisp into that directory. Now I've got Org mode version 9.0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;code&gt;org-version&lt;/code&gt; you can see the path of the currently used org files.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-11-05T13:26:14.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28443" PostTypeId="2" ParentId="28440" CreationDate="2016-11-05T13:57:28.633" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;describe-face&lt;/code&gt; to get the name of the face at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can change the color with &lt;code&gt;custom-set-faces&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA;  '(default ((t (:foreground &quot;khaki4&quot; :slant italic)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-11-05T14:40:55.393" LastActivityDate="2016-11-05T14:40:55.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28444" PostTypeId="1" CreationDate="2016-11-05T14:04:14.007" Score="0" ViewCount="593" Body="&lt;p&gt;I've been trying to hide the URL component of the markdown links in my buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could select the markdown links using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\(\\[.+\\]\\)\\((.+)\\)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I just want to capture the second half (the URL component) of the links and fade them away in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried every possible documentation available but with no avail. Please help.&lt;/p&gt;&#xA;" OwnerUserId="8271" LastEditorUserId="8271" LastEditDate="2016-11-07T10:42:54.533" LastActivityDate="2016-11-07T12:03:00.657" Title="How to match the URL component from a markdown link?" Tags="|regular-expressions|url|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28445" PostTypeId="2" ParentId="27194" CreationDate="2016-11-05T14:26:17.363" Score="3" Body="&lt;p&gt;&lt;code&gt;elpy&lt;/code&gt; has a function &lt;code&gt;elpy-open-and-indent-line-below&lt;/code&gt; which is binded to &lt;code&gt;&amp;lt;S-return&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;&quot;&quot;&quot;&lt;/code&gt;, you can hit &lt;code&gt;&amp;lt;S-return&amp;gt;&lt;/code&gt; to open new line and indent automatically. You can use this at the end of line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can bind &lt;code&gt;return&lt;/code&gt; to this function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key elpy-mode-map (kbd &quot;&amp;lt;return&amp;gt;&quot;) 'elpy-open-and-indent-line-below)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2016-11-05T14:26:17.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28447" PostTypeId="1" AcceptedAnswerId="28450" CreationDate="2016-11-05T14:34:32.183" Score="2" ViewCount="145" Body="&lt;p&gt;I am writing an elisp package currently I am using hydra, I would like to be able to have shortcuts you can toggle on and off for various flags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You see this sort of thing in magit and org mode when you press the key and it hightlight the text another colour to indicate the flag is checked before selecting an actual option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are my options and can hydra do this sort of thing ?&lt;/p&gt;&#xA;" OwnerUserId="13729" LastActivityDate="2016-11-05T16:32:56.107" Title="How can i make toggle shortcuts like org mode or magit" Tags="|org-mode|magit|hydra|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28448" PostTypeId="2" ParentId="28441" CreationDate="2016-11-05T15:25:25.340" Score="47" Body="&lt;p&gt;I think this problem is caused by the &lt;a href=&quot;http://orgmode.org/Changes.html#org184e052&quot; rel=&quot;noreferrer&quot;&gt;change&lt;/a&gt; of &lt;code&gt;org-babel-check-confirm-evaluate&lt;/code&gt; from a macro to a function.  If you have &lt;code&gt;org-mode&lt;/code&gt; (and thus the old macro) loaded when you compile the new code, it sees the old macro instead of the new function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As others have pointed out uninstalling &lt;code&gt;org-mode&lt;/code&gt; restarting Emacs (without loading &lt;code&gt;org-mode&lt;/code&gt;) and reinstalling will fix the problem.  You can also delete the compiled &lt;code&gt;.elc&lt;/code&gt; files and recompile with &lt;code&gt;byte-recompile-directory&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-11-05T15:25:25.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28450" PostTypeId="2" ParentId="28447" CreationDate="2016-11-05T16:32:56.107" Score="2" Body="&lt;p&gt;I am not sure whether Hydra supports this (like you I would have to look at the documentation to be sure). I think it only supports setting the value of lisp variables, but not arguments to commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit's popup functionality is available as a separate package &lt;code&gt;magit-popup&lt;/code&gt;. It comes with &lt;a href=&quot;https://magit.vc/manual/magit-popup&quot; rel=&quot;nofollow noreferrer&quot;&gt;a manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-11-05T16:32:56.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28451" PostTypeId="1" AcceptedAnswerId="28452" CreationDate="2016-11-05T17:30:00.887" Score="3" ViewCount="508" Body="&lt;p&gt;I'm using &lt;code&gt;evil&lt;/code&gt; (specifically via &lt;code&gt;spacemacs&lt;/code&gt;).  Is there a way to enter a regular command without leaving &lt;code&gt;insert&lt;/code&gt; state? For example, running &lt;code&gt;SPC i u&lt;/code&gt; (for adding unicode character) while still in &lt;code&gt;insert&lt;/code&gt; state?&lt;/p&gt;&#xA;" OwnerUserId="13650" LastEditorUserId="253" LastEditDate="2016-12-17T03:37:35.413" LastActivityDate="2016-12-17T03:37:35.413" Title="Enter regular command in evil insert state?" Tags="|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28452" PostTypeId="2" ParentId="28451" CreationDate="2016-11-05T19:19:36.590" Score="7" Body="&lt;p&gt;This might not be exactly what you want, but there is a way to execute &lt;em&gt;one&lt;/em&gt;&#xA;command and then return to &lt;code&gt;insert state&lt;/code&gt;. Press &lt;code&gt;C-o&lt;/code&gt;&#xA;(&lt;code&gt;evil-execute-in-normal-state&lt;/code&gt;) which puts you in a state where the next&#xA;keybinding will be executed in &lt;code&gt;normal state&lt;/code&gt;, and then you will be returned to&#xA;&lt;code&gt;insert state&lt;/code&gt;. For example, while in &lt;code&gt;insert state&lt;/code&gt;, press &lt;code&gt;C-o&lt;/code&gt; and then &lt;code&gt;SPC&#xA;f y&lt;/code&gt;. This will display the path of the current file in the echo area (and copy&#xA;it to the kill ring) and leave you in &lt;code&gt;insert state&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the very least, this should be a good way to deal with your &lt;em&gt;insert Unicode character&lt;/em&gt; example&lt;/p&gt;&#xA;" OwnerUserId="13902" LastEditorUserId="9257" LastEditDate="2016-11-05T22:06:11.180" LastActivityDate="2016-11-05T22:06:11.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28453" PostTypeId="2" ParentId="28439" CreationDate="2016-11-05T20:39:29.657" Score="1" Body="&lt;p&gt;I also use &lt;code&gt;saveplace&lt;/code&gt;, however it actually doesn't save the point of the last edit, but the point that was last visited before closing a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to save the last edited point, you can combine &lt;code&gt;saveplace&lt;/code&gt; and &lt;code&gt;goto-last-change&lt;/code&gt;. You have to install the package &lt;code&gt;goto-last-change&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to define a function, that returns the last point saved from &lt;code&gt;goto-last-change&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-last-edited-point ()&#xA;  &quot;Return point of last edit in file.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-last-change)    &#xA;    (point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you have to replace &lt;code&gt;point&lt;/code&gt; in &lt;code&gt;save-place-to-alist&lt;/code&gt; with &lt;code&gt;my-last-edited-point&lt;/code&gt;. I just paste the modified function so you don't have to look for it yourself.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun save-place-to-alist ()&#xA;  ;; put filename and point in a cons box and then cons that onto the&#xA;  ;; front of the save-place-alist, if save-place is non-nil.&#xA;  ;; Otherwise, just delete that file from the alist.&#xA;  ;; first check to make sure alist has been loaded in from the master&#xA;  ;; file.  If not, do so, then feel free to modify the alist.  It&#xA;  ;; will be saved again when Emacs is killed.&#xA;  (or save-place-loaded (load-save-place-alist-from-file))&#xA;  (let ((item (or buffer-file-name&#xA;                  (and (derived-mode-p 'dired-mode)&#xA;               dired-directory&#xA;               (expand-file-name (if (consp dired-directory)&#xA;                         (car dired-directory)&#xA;                       dired-directory))))))&#xA;    (when (and item&#xA;               (or (not save-place-ignore-files-regexp)&#xA;                   (not (string-match save-place-ignore-files-regexp&#xA;                                      item))))&#xA;      (let ((cell (assoc item save-place-alist))&#xA;            (position (cond ((eq major-mode 'hexl-mode)&#xA;                 (with-no-warnings&#xA;                   (1+ (hexl-current-address))))&#xA;                ((and (derived-mode-p 'dired-mode)&#xA;                  dired-directory)&#xA;                 (let ((filename (dired-get-filename nil t)))&#xA;                   (if filename&#xA;                   `((dired-filename . ,filename))&#xA;                 (my-last-edited-point))))&#xA;                (t (my-last-edited-point)))))&#xA;        (if cell&#xA;            (setq save-place-alist (delq cell save-place-alist)))&#xA;        (if (and save-place&#xA;                 (not (and (integerp position)&#xA;               (= position 1)))) ;; Optimize out the degenerate case.&#xA;            (setq save-place-alist&#xA;                  (cons (cons item position)&#xA;                        save-place-alist)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-11-09T08:55:39.260" LastActivityDate="2016-11-09T08:55:39.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28454" PostTypeId="1" AcceptedAnswerId="28484" CreationDate="2016-11-05T21:17:59.870" Score="2" ViewCount="780" Body="&lt;p&gt;I have been reading very good thing about Spacemacs, and decided to give it a try. Right now I am trying to port my (messy handwritten) configuration to it, and the Spacemacs way to do it is by creating a layer (or so I think).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I have a few doubts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I use &lt;code&gt;org-journal&lt;/code&gt;, and it can only be loaded after &lt;code&gt;org&lt;/code&gt;. What should I put in my &lt;code&gt;&amp;lt;layer&amp;gt;-packages&lt;/code&gt; list? Just &lt;code&gt;org-journal&lt;/code&gt; or both &lt;code&gt;org-journal&lt;/code&gt; and &lt;code&gt;org&lt;/code&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Where is the appropriate place to setup things like &lt;code&gt;org-agenda-files&lt;/code&gt; and &lt;code&gt;org-todo-keywords&lt;/code&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2016-11-07T02:02:37.280" Title="What is the proper way to setup a package with Spacemacs?" Tags="|org-mode|init-file|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28455" PostTypeId="1" AcceptedAnswerId="28463" CreationDate="2016-11-06T00:40:01.647" Score="0" ViewCount="114" Body="&lt;p&gt;I like arbitrary substring matching for buffer completion but I want to disable it when completing file names or directories.  The idea is to set &lt;code&gt;ido-enable-prefix&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; only when &lt;code&gt;ido-find-file&lt;/code&gt; is being used, and &lt;code&gt;nil&lt;/code&gt; otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So something like this looks like it should work but it doesn't.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ido-enable-prefix nil)&#xA;&#xA;(defun ido-init-file-dir ()&#xA;  (when (or (eq ido-cur-item 'file) (eq ido-cur-item 'dir))&#xA;    (set (make-local-variable 'ido-enable-prefix) t)))&#xA;&#xA;(add-hook 'ido-setup-hook 'ido-init-file-dir)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2016-11-06T12:21:58.160" Title="different settings for ido-find-file and ido-switch-buffer" Tags="|hooks|ido|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28456" PostTypeId="1" CreationDate="2016-11-06T03:57:11.397" Score="0" ViewCount="167" Body="&lt;p&gt;Using Ostro on &lt;a href=&quot;https://twitter.com/search?q=%23IntelMaker%20%23Joule%20%40Mcnst&quot; rel=&quot;nofollow noreferrer&quot;&gt;#IntelMaker #Joule&lt;/a&gt;, I've downloaded the earliest version of emacs available from &lt;a href=&quot;https://ftp.gnu.org/pub/gnu/emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ftp.gnu.org/pub/gnu/emacs/&lt;/a&gt;, and tried running configure, but it failed with a message that emacs wasn't ported to the platform yet.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;root@intel-corei7-64:~/emacs/emacs-21.4# ./configure &#xA;creating cache ./config.cache&#xA;checking host system type... x86_64-unknown-linux-gnu&#xA;configure: error: Emacs hasn't been ported to `x86_64-unknown-linux-gnu' systems.&#xA;Check `etc/MACHINES' for recognized configuration names.&#xA;root@intel-corei7-64:~/emacs/emacs-21.4# cd ..&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I just want an emacs-like text editor, and don't have a package manager, what's the quickest way to get an emacs-compatible editor going?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Size-wise, &lt;code&gt;emacs-21.4a.tar.gz&lt;/code&gt; is only 19M, but &lt;code&gt;emacs-25.1.tar.gz&lt;/code&gt; is already 59M.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What was the earliest version that had support for &lt;code&gt;x86_64&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7179" LastActivityDate="2016-12-07T18:07:41.387" Title="What's the lighest version of emacs for Ostro x86_64-unknown-linux-gnu?" Tags="|linux|build|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28457" PostTypeId="1" AcceptedAnswerId="28469" CreationDate="2016-11-06T04:15:15.930" Score="2" ViewCount="1623" Body="&lt;p&gt;How can I implement folding behaviour like a vim?&#xA;In vim I has this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set foldenable          &quot; enable folding&#xA;set foldmethod=indent   &quot; fold sections by indentation&#xA;set foldcolumn=1        &quot; display folding column&#xA;set foldlevel=0         &quot; first folding level is open&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I need close all fold levels 'level by level'. When I unfold some 'folding level', included fold levels must be closed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I can implement this with HideShow plugin or another variant?&lt;/p&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="13740" LastEditDate="2016-11-07T02:49:09.920" LastActivityDate="2016-11-07T02:49:09.920" Title="Folding by levels (like a vim)" Tags="|code-folding|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28458" PostTypeId="2" ParentId="28456" CreationDate="2016-11-06T04:16:45.750" Score="1" Body="&lt;p&gt;It turns out, Emacs is surprisingly fast to build, so, building even the latest version appears to take less time than the time it takes to run the &lt;code&gt;./configure&lt;/code&gt; script!&lt;/p&gt;&#xA;" OwnerUserId="7179" LastActivityDate="2016-11-06T04:16:45.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28460" PostTypeId="2" ParentId="28441" CreationDate="2016-11-06T04:31:29.620" Score="4" Body="&lt;p&gt;for me uninstalling the org-plus-contrib package and reinstalling it solved it.&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-11-06T04:31:29.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28461" PostTypeId="2" ParentId="27663" CreationDate="2016-11-06T04:55:21.550" Score="0" Body="&lt;p&gt;So I was able to solve this problem through the use of &lt;code&gt;org-ref-helm-insert-ref-link&lt;/code&gt; which shows all the labels (regardless of whether they are inside latex code blocks or outside them) you have in your org file and anything surrounding that label for context. This, of course, requires the &lt;code&gt;org-ref&lt;/code&gt; package to be installed, but I already had it and didn't know about this functionality before.&lt;/p&gt;&#xA;" OwnerUserId="13583" LastActivityDate="2016-11-06T04:55:21.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28462" PostTypeId="1" CreationDate="2016-11-06T08:58:00.570" Score="6" ViewCount="535" Body="&lt;p&gt;Very often I need to open a file in dired in other window and for that &lt;code&gt;dired-find-file-other-window&lt;/code&gt; comes handy, but sometimes I want to open file in specific split - vertical or horizontal. So if I have:&lt;br&gt;&#xA;two windows (with dired on the left) &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  |-----------+-----------|&#xA;  | -window1- | -window2- |&#xA;  | file1     |           |&#xA;  | file1     |           |&#xA;  | file3     |           |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and want to explicitly tell dired to open file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;either by creating a vertical split in window1:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  |-----------+-----------|&#xA;  | -window1- | -window2- |&#xA;  | file1     |           |&#xA;  |-----------+           |&#xA;  | (content) |           |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or in window2 (which is usually a default behavior of &lt;code&gt;dired-find-file-other-window&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  |-----------+-----------|&#xA;  | -window1- | (content) |&#xA;  | file1     |           |&#xA;  | file1     |           |&#xA;  | file3     |           |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or below window2 (by creating vertical split in window2):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  |-----------+-----------|&#xA;  | -window1- | -window2- |&#xA;  | file1     |           |&#xA;  | file1     |           |&#xA;  | file3     +-----------|&#xA;  |           | (content) |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or by creating horizontal split (adding new window to the right of window2):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  |-----------+-----------+-----------|&#xA;  | -window1- | -window2- | (content) |&#xA;  | file1     |           |           |&#xA;  | file1     |           |           |&#xA;  | file3     |           |           |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a package for doing something like that? If not, can someone help me writing a function/functions?&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="105" LastEditDate="2016-11-06T19:57:30.397" LastActivityDate="2016-11-06T19:57:30.397" Title="Controlling window locations for files visited by Dired" Tags="|window|dired|" AnswerCount="0" CommentCount="0" ClosedDate="2016-11-07T17:43:11.073" ContentLicense="CC BY-SA 3.0" />
  <row Id="28463" PostTypeId="2" ParentId="28455" CreationDate="2016-11-06T12:21:58.160" Score="0" Body="&lt;p&gt;The mistake was using &lt;code&gt;set&lt;/code&gt; and &lt;code&gt;make-local-variable&lt;/code&gt; instead of just &lt;code&gt;setq&lt;/code&gt;.  Working version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ido-setup-file-dir ()&#xA;  (when (or (eq ido-cur-item 'file) (eq ido-cur-item 'dir))&#xA;    (setq ido-enable-prefix t)))&#xA;&#xA;(add-hook 'ido-setup-hook 'ido-setup-file-dir)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5263" LastActivityDate="2016-11-06T12:21:58.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28464" PostTypeId="2" ParentId="27457" CreationDate="2016-11-06T13:42:03.833" Score="2" Body="&lt;p&gt;I hacked some support for image scaling in windows using the imagemagick executables here: &lt;a href=&quot;https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L1158&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L1158&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted in some comments above, you need to have the mogrify program installed. With the code at that location, images get scaled in org-mode on windows for us.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-11-06T13:42:03.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28466" PostTypeId="1" CreationDate="2016-11-06T15:03:44.807" Score="2" ViewCount="327" Body="&lt;p&gt;I created a custom keyboard layout (using ukelele) where I use F1-F4 as dead keys to input pinyin (accents for tones). Is there a way to get it to work in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the (require 'iso-transl) but that doesn't help (not sure if it is supposed to). &lt;/p&gt;&#xA;" OwnerUserId="9648" LastEditorUserId="9648" LastEditDate="2016-11-07T14:27:00.633" LastActivityDate="2016-11-07T14:27:00.633" Title="Dead keys not working in Emacs OSX" Tags="|key-bindings|osx|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28467" PostTypeId="2" ParentId="24165" CreationDate="2016-11-06T15:35:35.053" Score="2" Body="&lt;p&gt;I use symlinks to link  &lt;code&gt;~/.emacs&lt;/code&gt; and &lt;code&gt;~/.emacs.d&lt;/code&gt; to the actual files which are stored elsewhere. I had used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cmd /c mklink C:\Users\&amp;lt;me&amp;gt;\.emacs.d C:\&amp;lt;elsewhere&amp;gt;\.emacs.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to create the link, but you actually need to create a &lt;em&gt;hard&lt;/em&gt; link to the directory (or &lt;em&gt;junction&lt;/em&gt; as Windows calls them) with the &lt;code&gt;/J&lt;/code&gt; flag:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cmd /c mklink /J C:\Users\&amp;lt;me&amp;gt;\.emacs.d C:\&amp;lt;elsewhere&amp;gt;\.emacs.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also created a hard link to my &lt;code&gt;.emacs&lt;/code&gt; file with the &lt;code&gt;/H&lt;/code&gt; flag:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;cmd /c mklink /H C:\Users\&amp;lt;me&amp;gt;\.emacs C:\&amp;lt;elsewhere&amp;gt;\.emacs&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11435" LastActivityDate="2016-11-06T15:35:35.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28469" PostTypeId="2" ParentId="28457" CreationDate="2016-11-06T17:06:16.953" Score="5" Body="&lt;p&gt;There are a lot of different implementations of folding for emacs. Some are specific to a particular programming language or syntax, others are more generic. Of the generic ones, it sounds like &lt;code&gt;yafolding&lt;/code&gt; is exactly what you're asking for. I tried it out, and while it feels somewhat slow, it does work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another I tried is called &lt;code&gt;origami&lt;/code&gt;, and I liked the results a lot better. It goes by indentation if that's all it knows about your file, but if it's one of a dozen or so supported languages then it uses syntax markers like curly braces to do the folding. It was also much quicker to fold an entire file. On the other hand, it apparently comes with no pre-configured keybindings, so to use it you'll have to set those up yourself (it does provide a keymap to add them to). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of others you might check out; run &lt;code&gt;M-x list-packages&lt;/code&gt; and then search for &quot;fold&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many people also use &lt;code&gt;outline-minor-mode&lt;/code&gt; to do folding and organization of code. It works off of embedded headline markers in comments rather than the structure of the code, but that's handy for many things as well. It also has the advantage of being built-in.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-11-06T17:06:16.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28470" PostTypeId="1" AcceptedAnswerId="28479" CreationDate="2016-11-06T17:44:21.990" Score="3" ViewCount="395" Body="&lt;p&gt;I installed emacs 25.1.1 on fedora and cloned the spacemacs environment. Then, I launch emacs and install some packages (e.g. magit). When I close and reopen emacs all my extensions must be reinstalled to use them. I can see the files I need exist under .emacs.d/.cache. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea why it is not installing them permanently?&lt;/p&gt;&#xA;" OwnerUserId="10933" LastEditorUserId="105" LastEditDate="2016-11-06T19:53:20.200" LastActivityDate="2016-11-06T22:16:25.670" Title="Emacs (spacemacs) not keeping extensions" Tags="|package|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28471" PostTypeId="2" ParentId="28301" CreationDate="2016-11-06T18:22:40.823" Score="7" Body="&lt;p&gt;I think I just found my ideal approach: add a new language to babel! It's much easier than I thought. Here's how you add &lt;code&gt;inline-js&lt;/code&gt;, the language that you edit in some JavaScript major mode and &quot;evaluate&quot; by wrapping in a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-src-lang-modes '(&quot;inline-js&quot; . javascript)) ;; js2 if you're fancy&#xA;(defvar org-babel-default-header-args:inline-js&#xA;  '((:results . &quot;html&quot;)&#xA;    (:exports . &quot;results&quot;)))&#xA;(defun org-babel-execute:inline-js (body _params)&#xA;  (format &quot;&amp;lt;script type=\&quot;text/javascript\&quot;&amp;gt;\n%s\n&amp;lt;/script&amp;gt;&quot; body))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can write blocks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC inline-js&#xA;  console.log(&quot;Hello World!&quot;);&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That block exports like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_EXPORT html&#xA;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&#xA;console.log(&quot;Hello World!&quot;);&#xA;&amp;lt;/script&amp;gt;&#xA;#+END_EXPORT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2016-11-06T19:08:01.620" LastActivityDate="2016-11-06T19:08:01.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28472" PostTypeId="1" AcceptedAnswerId="28478" CreationDate="2016-11-06T18:40:20.927" Score="1" ViewCount="3437" Body="&lt;p&gt;I use &lt;code&gt;GNU Emacs 24.3.1&lt;/code&gt; on &lt;code&gt;Ubuntu 14.04&lt;/code&gt; and I have a bash script: &lt;code&gt;~/path/to the/script/test.sh&lt;/code&gt;. As you see the path has &lt;code&gt;space&lt;/code&gt; character. Script has a simple content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ENTRY=`zenity --password --username`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try to run script from &lt;code&gt;Emacs&lt;/code&gt; by &lt;code&gt;C-c C-x&lt;/code&gt;(execute script option from &lt;code&gt;Sh-Script&lt;/code&gt; menu), without marking any region, I got this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/bin/bash: ~/path/to: No such file or directory&#xA;&#xA;Comint exited abnormally with code 127 ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I try to run that from bash, it runs normally:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/path/to\ the/script/test.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I'm sure the problem is in about &lt;code&gt;space&lt;/code&gt; character in path of script. Also I do not want to change the path (by removing &lt;code&gt;space&lt;/code&gt; and for example replacing it by '_') because it is a part of a nested/linked content manager system and changing it may cause a big problem. Is there a way to solve this problem without changing path of script?&lt;/p&gt;&#xA;" OwnerUserId="13398" LastEditorUserId="13398" LastEditDate="2016-11-07T03:09:14.750" LastActivityDate="2016-11-07T07:09:25.267" Title="No such file or directory error on executing script" Tags="|shell|ubuntu|bash|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28473" PostTypeId="2" ParentId="28413" CreationDate="2016-11-06T18:55:54.820" Score="4" Body="&lt;p&gt;I am assuming this is talking about the &lt;a href=&quot;https://github.com/ralesi/ranger.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/ralesi/ranger.el&lt;/a&gt; package available from &lt;a href=&quot;http://melpa.org/packages&quot; rel=&quot;nofollow noreferrer&quot;&gt;Melpa&lt;/a&gt;.&#xA;There are several things you can do&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &quot;!&quot; to run a command. This is made slightly tricky as ranger seems to want to pass the filename you are on to the command, so something like &lt;code&gt;mkdir wibble ; :&lt;/code&gt; could be used on unix systems.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Switch to dired mode using &lt;code&gt;control-p&lt;/code&gt;, then use &lt;code&gt;+&lt;/code&gt; to call &lt;code&gt;dired-create-directory&lt;/code&gt;, and then &lt;code&gt;control-p&lt;/code&gt; to switch back to ranger&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ranger)&#xA;(define-key ranger-normal-mode-map (kbd &quot;+&quot;) #'dired-create-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;to your startup file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whilst ranger is quite pretty, I dislike the way it takes away standard ways to discover things. In particular binding control-h to toggle hidden (dot) files is bad.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2016-11-06T19:09:55.130" LastActivityDate="2016-11-06T19:09:55.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28474" PostTypeId="1" CreationDate="2016-11-06T19:15:06.083" Score="3" ViewCount="2527" Body="&lt;p&gt;I went to start emacs today and was greeted with this:    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;WARNING: No org-loaddefs.el file could be found from where org.el is loaded.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;followed by &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You need to run &quot;make&quot; or &quot;make autoloads&quot; from Org lisp directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea how I can fix this error?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2020-12-28T10:44:26.457" Title="How can I fix my org-loaddefs.el?" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28476" PostTypeId="1" AcceptedAnswerId="28477" CreationDate="2016-11-06T21:00:25.870" Score="4" ViewCount="357" Body="&lt;p&gt;I'm curious how I get my emacs to use the git org-mode repository. I have followed the instructions &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Now I have a &lt;code&gt;~/elisp/org-mode/&lt;/code&gt; directory but I'm not sure how to get emacs to use this version of org. Issuing &lt;code&gt;M-x org-version&lt;/code&gt; yields&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org mode version 9.0 (9.0-elpa @ /home/brian/.emacs.d/elpa/org-20161102/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, my emacs is using the org package from &lt;code&gt;elpa&lt;/code&gt;. How do I get my emacs using the git version and not the elpa version?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-11-06T23:06:29.160" Title="How do I stay on org's &quot;bleeding edge&quot;?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28477" PostTypeId="2" ParentId="28476" CreationDate="2016-11-06T21:41:30.160" Score="4" Body="&lt;p&gt;I believe all you need to do is delete the elpa package (use &lt;code&gt;M-x list-packages&lt;/code&gt;, find org-mode, type &lt;code&gt;d&lt;/code&gt; to mark it for deletion and &lt;code&gt;x&lt;/code&gt; to execute the changes), and add the new directory to your load path, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq load-path (cons &quot;~/elisp/org-mode&quot; load-path))&#xA;(require 'org-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this is untested. The document you linked to says that the &lt;a href=&quot;http://elpa.gnu.org/packages&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;elpa&quot;&gt;elpa&lt;/a&gt; archive is updated daily, and I don't see any need to change faster than that.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="105" LastEditDate="2016-11-06T23:06:29.160" LastActivityDate="2016-11-06T23:06:29.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28478" PostTypeId="2" ParentId="28472" CreationDate="2016-11-06T21:54:35.897" Score="2" Body="&lt;p&gt;Assuming that &lt;code&gt;ctrl-c ctrl-x&lt;/code&gt; is bound to &lt;code&gt;execute-interpret&lt;/code&gt;, then the system should prompt you with the command to run, suggesting as a default &lt;code&gt;/path/to the/script/test.sh&lt;/code&gt; as a default. Edit this default value to put single quotes around the whole thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A different way would be to change the command to be run to &lt;code&gt;./test.sh&lt;/code&gt;. I suspect that when you say &lt;code&gt;But when I try to run that from bash, it runs normally.&lt;/code&gt; you are actually running this command, not the one emacs offers you by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might consider adding some setting of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html#File-Variables&quot; rel=&quot;nofollow noreferrer&quot;&gt;file variables&lt;/a&gt; to the end of the file, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #!/bin/bash&#xA;&#xA; echo Hello there&#xA; ....&#xA;&#xA; # Local Variables:&#xA; # mode: sh&#xA; # executable-command: &quot;'/path/to the/script/test.sh'&quot;&#xA; # End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will query you if you want to set the variable when you load the file.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2016-11-06T22:12:29.687" LastActivityDate="2016-11-06T22:12:29.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28479" PostTypeId="2" ParentId="28470" CreationDate="2016-11-06T22:16:25.670" Score="8" Body="&lt;p&gt;This is expected, from the FAQ:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why are packages installed with package-install automatically deleted by Spacemacs when it boots?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default Spacemacs will keep only the packages that you use (i.e. the packages belonging to a layer explicitly listed in the variable &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To install packages that don't not belong to any Spacemacs layers, you can:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use the variable &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;or create a configuration layer configuring the package and add this layer to &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;or set the variable &lt;code&gt;dotspacemacs-install-packages&lt;/code&gt; to &lt;code&gt;used-but-keep-unused&lt;/code&gt; which will prevent Spacemacs from removing the packages you installed manually.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To check if Spacemacs supports the package you want to install press &lt;code&gt;SPC h SPC&lt;/code&gt; and then look for the package you are interested in, for instance &lt;code&gt;magit&lt;/code&gt;, you will see that &lt;code&gt;magit&lt;/code&gt; is part of the &lt;code&gt;git&lt;/code&gt; layer. Add &lt;code&gt;git&lt;/code&gt; to the variable &lt;code&gt;dotspacemacs-configutation-layers&lt;/code&gt; and press &lt;code&gt;SPC f e R&lt;/code&gt; to reload the configuration in place. You should end with &lt;code&gt;magit&lt;/code&gt; installed, it will remain installed as long as you use the &lt;code&gt;git&lt;/code&gt; layer or you list &lt;code&gt;magit&lt;/code&gt; in &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be sure to read the docstrings of all the dotspacemacs variables in your dotfile, especially the variables in &lt;code&gt;dotspacemacs/layers&lt;/code&gt; function.&lt;/p&gt;&#xA;" OwnerUserId="167" LastActivityDate="2016-11-06T22:16:25.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28480" PostTypeId="1" CreationDate="2016-11-06T22:39:28.283" Score="0" ViewCount="140" Body="&lt;p&gt;I use &lt;code&gt;org-mode&lt;/code&gt; combined with &lt;code&gt;htmlize&lt;/code&gt; to maintain my personal webpage. For example, I have a directory &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;webpage/&#xA;├── bar.pdf&#xA;└── foo.org&#xA;&#xA;0 directories, 2 files&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to link to the file &lt;code&gt;bar.pdf&lt;/code&gt; in the org file &lt;code&gt;foo.org&lt;/code&gt;. My &lt;code&gt;foo.org&lt;/code&gt; file is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: testing htmlize links&#xA;&#xA;This is a link to [[./bar.pdf]].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I &lt;code&gt;htmlize&lt;/code&gt; the file &lt;code&gt;foo.org&lt;/code&gt; the output is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;&amp;gt;&#xA;&amp;lt;!-- Created by htmlize-1.47 in css mode. --&amp;gt;&#xA;&amp;lt;html&amp;gt;&#xA;  &amp;lt;head&amp;gt;&#xA;    &amp;lt;title&amp;gt;foo.org&amp;lt;/title&amp;gt;&#xA;    &amp;lt;style type=&quot;text/css&quot;&amp;gt;&#xA;    &amp;lt;!--&#xA;      body {&#xA;        color: #000000;&#xA;        background-color: #ffffff;&#xA;      }&#xA;      .org-document-info-keyword {&#xA;        /* org-document-info-keyword */&#xA;        color: #ffff00;&#xA;      }&#xA;      .org-document-title {&#xA;        /* org-document-title */&#xA;        color: #afeeee;&#xA;        font-weight: bold;&#xA;      }&#xA;      .org-link {&#xA;        /* org-link */&#xA;        color: #00ffff;&#xA;        text-decoration: underline;&#xA;      }&#xA;&#xA;      a {&#xA;        color: inherit;&#xA;        background-color: inherit;&#xA;        font: inherit;&#xA;        text-decoration: inherit;&#xA;      }&#xA;      a:hover {&#xA;        text-decoration: underline;&#xA;      }&#xA;    --&amp;gt;&#xA;    &amp;lt;/style&amp;gt;&#xA;  &amp;lt;/head&amp;gt;&#xA;  &amp;lt;body&amp;gt;&#xA;    &amp;lt;pre&amp;gt;&#xA;&amp;lt;span class=&quot;org-document-info-keyword&quot;&amp;gt;#+Title:&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;org-document-title&quot;&amp;gt;testing htmlize links&#xA;&amp;lt;/span&amp;gt;&#xA;This is a link to &amp;lt;span class=&quot;org-link&quot;&amp;gt;&amp;lt;a href=&quot;nil:nil&quot;&amp;gt;./bar.pdf&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;.&#xA;&amp;lt;/pre&amp;gt;&#xA;  &amp;lt;/body&amp;gt;&#xA;&amp;lt;/html&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is with the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    This is a link to &amp;lt;span class=&quot;org-link&quot;&amp;gt;&amp;lt;a href=&quot;nil:nil&quot;&amp;gt;./bar.pdf&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Somehow &lt;code&gt;htmlize&lt;/code&gt; is linking to &lt;code&gt;&quot;nil:nil&quot;&lt;/code&gt; instead of &lt;code&gt;./bar.pdf&lt;/code&gt;. What's going on here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issuing &lt;code&gt;M-x org-version&lt;/code&gt; yields &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Org mode version 9.0 (release_9.0-16-g8826f2 @ /home/brian/elisp/org-mode/lisp/)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think &lt;code&gt;org version 9.0&lt;/code&gt; may have changed how links work and &lt;code&gt;htmlize&lt;/code&gt; is not cooperating. If this is so, how can I fix my problem?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-11-07T00:41:17.093" Title="Why aren't my org-links being htmlized?" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28481" PostTypeId="2" ParentId="28480" CreationDate="2016-11-07T00:41:17.093" Score="2" Body="&lt;p&gt;I think this will fix  your file links for now. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(org-link-set-parameters nil :htmlize-link&#xA;             (lambda ()&#xA;               (let* ((link (org-element-context))&#xA;                  (type (org-element-property :type  link))&#xA;                  (path (org-element-property :path link)))&#xA;                 (list :uri (format &quot;%s:%s&quot; type path)))))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-11-07T00:41:17.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28482" PostTypeId="2" ParentId="26323" CreationDate="2016-11-07T00:46:59.253" Score="6" Body="&lt;p&gt;I encountered this too, and traced the problem a fraction further, within the &lt;code&gt;isearch-done&lt;/code&gt; function.  The source of the &lt;code&gt;stringp&lt;/code&gt; error is this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer isearch--current-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;with-current-buffer&lt;/code&gt; expects that its first parameter is a string, but at this point &lt;code&gt;isearch--current-buffer&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.  I'm 80% sure that this is because &lt;code&gt;server-goto-toplevel&lt;/code&gt; calls &lt;code&gt;isearch-cancel&lt;/code&gt; just in case &lt;code&gt;isearch&lt;/code&gt; is currently active, presumably because if it was it would interfere with the server or client somehow - but if it's not active then this error happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good news is that it seems that &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21091&quot; rel=&quot;nofollow noreferrer&quot;&gt;this bug has already been fixed&lt;/a&gt;, and indeed manually patching &lt;code&gt;isearch.el&lt;/code&gt; with this fix seems to do the trick!&lt;/p&gt;&#xA;" OwnerUserId="2018" LastEditorUserId="2018" LastEditDate="2016-11-07T14:39:48.913" LastActivityDate="2016-11-07T14:39:48.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28483" PostTypeId="1" AcceptedAnswerId="28485" CreationDate="2016-11-07T01:45:23.410" Score="5" ViewCount="1573" Body="&lt;p&gt;I'm using swiper for searching, one thing i very much miss compared to isearch is to insert the word at point into swiper. I have icicles installed, but &lt;code&gt;M-.&lt;/code&gt;, which i usally use to insert word at point into the current minifbuffer, doesn't seem to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found some code in the &lt;a href=&quot;https://www.emacswiki.org/emacs/SearchAtPoint#toc8&quot; rel=&quot;noreferrer&quot;&gt;emacs wiki&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key swiper-map (kbd &quot;M-.&quot;)&#xA;  (lambda () (interactive) (insert (format &quot;\\&amp;lt;%s\\&amp;gt;&quot; (with-ivy-window (thing-at-point 'word))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That seemed to basically do what I want, except it doesn't really work. It inserts the text with &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; surrounded (ok, i could fix that) and multiple calls to &lt;code&gt;M-.&lt;/code&gt; don't continue inserting the next word(s) into swiper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I wonder if there is any canonical solution to this, if swiper already provides the functionality to insert word at point into the search, then I didn't find it in the documentation. &lt;/p&gt;&#xA;" OwnerUserId="9623" LastActivityDate="2016-11-07T10:38:37.580" Title="Is it possible to insert word at point in swiper?" Tags="|search|swiper|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28484" PostTypeId="2" ParentId="28454" CreationDate="2016-11-07T02:02:37.280" Score="2" Body="&lt;p&gt;There are two ways you can do both of these things: with, or without, a custom spacemacs layer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without a custom layer, you would add org-journal to the list of &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt; (with &lt;code&gt;org&lt;/code&gt; in your list of configuration layers). Your agenda and todo setup would go in &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other option would be to create your own custom layer for your org configuration. You'd put the org-journal requirement, and your agenda/todo configs in that layer. If you haven't, checkout the spacemacs layer introduction &lt;a href=&quot;http://spacemacs.org/doc/LAYERS.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Regarding your comment that layers are the &quot;Spacemacs way&quot;, that may be the Spacemacs philosophy, but it's not a functional requirement. Loading individual packages and keeping all your config in your .spacemacs would definitely work to get spacemacs configured how you like. A custom configuration layer could come later (so says a person who doesn't have any custom layers yet, but a fair amount of configuration).&lt;/p&gt;&#xA;" OwnerUserId="13674" LastActivityDate="2016-11-07T02:02:37.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28485" PostTypeId="2" ParentId="28483" CreationDate="2016-11-07T02:11:29.670" Score="2" Body="&lt;p&gt;Its not quite the word at point, but M-j puts the current subword in the minibuffer. If you are at the beginning of the word, it puts the word in.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-11-07T02:11:29.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28486" PostTypeId="2" ParentId="28483" CreationDate="2016-11-07T02:30:48.057" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;What happens if you just remove any other (e.g. swiper) binding of &lt;code&gt;M-.&lt;/code&gt;?&#xA;For example, if you do &lt;code&gt;(define-key swiper-map (kbd &quot;M-.&quot;) nil)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm guessing that won't help, because this is a minibuffer keymap binding, not a swiper-map binding, but you can try it.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Icicle mode binds &lt;code&gt;M-.&lt;/code&gt; in the minibuffer keymaps. If you turn on swiper after you turn on Icicle mode (&lt;code&gt;icy-mode&lt;/code&gt;) then swiper might change minibuffer keymap bindings.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In that case, you should be able to get back the Icicles &lt;code&gt;M-.&lt;/code&gt; behavior by toggling Icicle mode off and on again. Try that, to see if it works for &lt;code&gt;M-.&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That might not be the ultimate solution, because Icicle mode might change some minibuffer keys that swiper expects, but at least it will tell you what's going on.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;If that's what's happening, then the thing to do is probably to explicitly bind &lt;code&gt;M-.&lt;/code&gt; on some swiper mode hook: Just bind it in each of the minibuffer keymaps to command &lt;strong&gt;&lt;code&gt;icicle-insert-string-at-point&lt;/code&gt;&lt;/strong&gt;.  IOW, after swiper does its thing, binding &lt;code&gt;M-.&lt;/code&gt; to whatever, you have it bind it back to the Icicles command.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(Because some minibuffer maps inherit from some other minibuffer maps, you need not bind it in all of the maps, but that depends on your Emacs version. The simplest thing is to just bind it in all of the minibuffer maps.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-07T02:30:48.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28487" PostTypeId="2" ParentId="28472" CreationDate="2016-11-07T04:31:57.123" Score="1" Body="&lt;p&gt;Here's the workaround that I mentioned:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun db48x/shell-quote-arg-list (args)&#xA;  (mapcar 'shell-quote-argument args))&#xA;&#xA;(advice-add 'executable-interpret :filter-args 'db48x/shell-quote-arg-list '(name escape-command-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This tells emacs to run the &lt;code&gt;db48x/shell-quote-arg-list&lt;/code&gt; function on the argument list any time anyone calls &lt;code&gt;executable-interpret&lt;/code&gt;. This gives us a change to escape any spaces in it before it's passed off to the original function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works quite well; any spaces or shell metacharacters you give to &lt;code&gt;executable-interpret&lt;/code&gt; are escaped, and everything works quite well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one downside, however. The next time you run &lt;code&gt;executable-interpret&lt;/code&gt;, it will reuse the same value again as the new default script to run. However, it saved the value after we escaped it, so if you use it as-is it will be escaped again. A more complex set of advice needs to be applied to get the right behavior, probably an :around function that escapes the argument, calls the original function, and then overwrites the variable holding the previous command with the unescaped version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the better method I mentioned:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun db48x/executable-interpret-escaped (original-func command)&#xA;  (funcall original-func (shell-quote-argument command))&#xA;  (setf executable-command command))&#xA;&#xA;(advice-add 'executable-interpret :around 'db48x/executable-interpret-escaped '(name escape-command-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2016-11-07T07:09:25.267" LastActivityDate="2016-11-07T07:09:25.267" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28489" PostTypeId="1" AcceptedAnswerId="32322" CreationDate="2016-11-07T06:17:36.257" Score="8" ViewCount="3548" Body="&lt;p&gt;I installed &quot;PlantUML Mode for Emacs&quot; using Melpa successfully, and I am able to switch to Plantuml-mode.  However, when I try to evaluate code with &lt;code&gt;C-c C-c&lt;/code&gt;, inside of org-mode, I get the error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-babel-execute-src-block: No org-babel-execute function for plantuml!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I add this?&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2018-01-19T01:07:55.803" Title="How to add org-babel-execute function for plantuml?" Tags="|org-mode|org-babel|package-repositories|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28490" PostTypeId="1" AcceptedAnswerId="28495" CreationDate="2016-11-07T09:22:24.580" Score="2" ViewCount="126" Body="&lt;p&gt;I have a small snippet like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: options&#xA;# key: vop&#xA;# --&#xA;var options = {&#xA;    target:        '#$1',&#xA;    beforeSubmit:  showRequest,&#xA;    success:       showResponse&#xA;}$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I would like to do is to increment function name for each insertion. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var options1 = {&#xA;  target:        '#',&#xA;  beforeSubmit:  showRequest,&#xA;  success:       showResponse&#xA;}&#xA;&#xA;var options2 = {&#xA;  target:        '#',&#xA;  beforeSubmit:  showRequest,&#xA;  success:       showResponse&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;etc... Is there a way to achieve this?&lt;/p&gt;&#xA;" OwnerDisplayName="user13916" LastActivityDate="2016-11-07T12:20:58.517" Title="Yasnippet increment function name" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28491" PostTypeId="1" CreationDate="2016-11-07T09:58:42.523" Score="6" ViewCount="365" Body="&lt;p&gt;I have discovered the noweb syntax, and in particular how it can be used in &lt;code&gt;org&lt;/code&gt; source blocks, very recently, and I have grown quite fond of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But inserting the references (is there a better term?) seems to be unnecessarily painful: it seems that I have to either remember the name of the source block I want to link to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current workflow for long references is to insert a space after &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; and use &lt;code&gt;dabbrev-expand&lt;/code&gt; (which requires that I choose unique-enough prefixes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could certainly scrap together a completion feature automating this, or add a completion source scanning &lt;code&gt;#+name&lt;/code&gt; and &lt;code&gt;#+srcname&lt;/code&gt;. However, I do not like duplicating work (yes I am very lazy), and with all the completion features offered by org and 3rd-party packages, it strikes me as odd that nothing seems to provide completion for noweb references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any way of inserting noweb references with completion? And if not, is there a good reason for that? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;MWE.org:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+srcname: snippet-with-an-annoyingly-long-name&#xA;#+begin_src emacs-lisp&#xA;(message &quot;Hello&quot;)&#xA;#+end_src&#xA;&#xA;#+begin_src emacs-lisp&#xA;;; I would like to be able to insert the line below with the help of completion&#xA;&amp;lt;&amp;lt;snippet-with-an-annoyingly-long-name&amp;gt;&amp;gt; &#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="184" LastActivityDate="2016-11-10T18:31:03.057" Title="Insert noweb references with completion" Tags="|org-mode|org-babel|completion|noweb|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28492" PostTypeId="2" ParentId="28483" CreationDate="2016-11-07T10:38:37.580" Score="8" Body="&lt;p&gt;You can insert symbol at point with &lt;kbd&gt;M-n&lt;/kbd&gt; - the same key as the history forward, which is one of the recommended Emacs workflows for inserting thing at point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, &lt;kbd&gt;M-j&lt;/kbd&gt; will extend the minibuffer by word at point, similar to what &lt;kbd&gt;C-w&lt;/kbd&gt; does for isearch.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-11-07T10:38:37.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28493" PostTypeId="1" AcceptedAnswerId="48455" CreationDate="2016-11-07T11:03:21.027" Score="1" ViewCount="458" Body="&lt;p&gt;The title pretty much sums it up, I'd like to avoid that the scroll continues when I release the touchpad. Here's my custom variable about the mouse &lt;em&gt;wheel&lt;/em&gt; behaviour:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(mouse-wheel-scroll-amount '(1 ((shift) . 5)))&#xA;'(mouse-wheel-progressive-speed nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To be honest, I'm not sure whether this is is actually inertia or the scroll operations stack up and get executed with some delay hence causing the effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behaviour is observed with &lt;code&gt;emacs -q&lt;/code&gt; as well.&lt;/p&gt;&#xA;" OwnerUserId="13744" LastEditorUserId="13744" LastEditDate="2016-11-07T18:16:50.637" LastActivityDate="2019-03-19T18:04:44.030" Title="Disable scroll inertia in Emacs for macOS (Sierra)" Tags="|scrolling|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28494" PostTypeId="2" ParentId="28444" CreationDate="2016-11-07T11:34:10.737" Score="1" Body="&lt;p&gt;The following minimal example code shows how to hide the urls in md-files:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun md-hide-urls ()&#xA;  &quot;Hide all urls in the current buffer.&quot;&#xA;  (interactive)&#xA;  (goto-char (point-min))&#xA;  (while (re-search-forward &quot;\\(\\[.+\\]\\)\\((.+)\\)&quot; nil t)&#xA;    (put-text-property (match-beginning 2) (match-end 2) 'invisible t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Regular expression search via lisp is described in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Search.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Section 33.4 of the emacs manual&lt;/a&gt;.&#xA;How to make text invisible is described in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Invisible-Text.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Section 37.6 of the emacs manual&lt;/a&gt;. You find informations on accessing match strings in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Simple-Match-Data.html#Simple-Match-Data&quot; rel=&quot;nofollow noreferrer&quot;&gt;Section 37.6.2 of the emacs manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-07T12:03:00.657" LastActivityDate="2016-11-07T12:03:00.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28495" PostTypeId="2" ParentId="28490" CreationDate="2016-11-07T12:20:58.517" Score="2" Body="&lt;p&gt;Yes, in yasnippet you can use elisp code, so it's easy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: options&#xA;# key: vop&#xA;# --&#xA;var options`(if (boundp 'vop-count) (setq vop-count (1+ vop-count)) (setq vop-count 1) ) (vop-count)` = {&#xA;    target:        '#$1',&#xA;    beforeSubmit:  showRequest,&#xA;    success:       showResponse&#xA;}$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you wanna reset the counter, run &lt;code&gt;(setq vop-count 0)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2550" LastActivityDate="2016-11-07T12:20:58.517" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28496" PostTypeId="1" CreationDate="2016-11-07T12:23:59.817" Score="12" ViewCount="2950" Body="&lt;p&gt;Is there a configuration option in Magit that will force the &quot;git status&quot; window to always appear in a  vertical split?  I didn't see anything about that in the documentation, and Google was rather useless.&lt;/p&gt;&#xA;" OwnerUserId="13917" LastActivityDate="2019-03-28T20:58:59.937" Title="Magit Status - always split vertically" Tags="|magit|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28497" PostTypeId="1" AcceptedAnswerId="29299" CreationDate="2016-11-07T12:35:57.233" Score="0" ViewCount="110" Body="&lt;p&gt;i want to add an abbrv for 2 lines (that is a 1st line, a break and then a 2nd line)&#xA;Anyone know the syntax for that?&#xA;here is the syntax i try &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(&quot;8rt&quot; &quot;#+ATTR_HTML: :style color:green  *lets try it on your computer!*&quot; nil 0)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i want the breakline to come right after the &lt;code&gt;:green&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any clue?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-12-15T03:47:48.403" Title="emacs ABBRV command break for new line" Tags="|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28498" PostTypeId="1" AcceptedAnswerId="28505" CreationDate="2016-11-07T12:54:46.713" Score="1" ViewCount="1439" Body="&lt;p&gt;I use &lt;code&gt;display-buffer-alist&lt;/code&gt; to &lt;a href=&quot;http://www.lunaryorn.com/posts/the-power-of-display-buffer-alist.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Configure buffer display&lt;/a&gt;. For example I have this snippet to display flycheck errors buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist&#xA;             `(,(rx bos &quot;*Flycheck errors*&quot; eos)&#xA;               (display-buffer-reuse-window&#xA;                display-buffer-below-selected)&#xA;               (reusable-frames . visible)&#xA;               (side            . bottom)&#xA;               (window-height   . 0.4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works well, but when I want the same behaviour for the Messages buffer, it doesn't work. Why does this only work for certain buffers ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And is it also possible to configure the display for buffers, that are opened by specific commands ? One example is &lt;code&gt;shell-mode&lt;/code&gt;. When I open a new shell buffer, with another one already existing, my display modifications don't work because the name of the buffer is different.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-11-07T18:56:17.383" Title="how to modify buffer display behaviour?" Tags="|buffers|display-buffer-alist|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28499" PostTypeId="2" ParentId="28435" CreationDate="2016-11-07T14:15:10.773" Score="0" Body="&lt;p&gt;You could use diary dates.  I have an event that happens every 1st, 3rd, and 5th Friday of the month.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Music Jam&#xA;   &amp;lt;%%(diary-float t 5 1)&amp;gt;&#xA;   &amp;lt;%%(diary-float t 5 3)&amp;gt; &#xA;   &amp;lt;%%(diary-float t 5 5)&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are other diary functions too. diary-float, diary-remind, diary-cyclic, etc.  You can read more about this via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      M-x info RET org RET m Agenda  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Search for diary, and you'll find it. (C-s diary)&lt;/p&gt;&#xA;" OwnerUserId="13541" LastActivityDate="2016-11-07T14:15:10.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28500" PostTypeId="2" ParentId="28496" CreationDate="2016-11-07T14:19:59.673" Score="8" Body="&lt;p&gt;You can control how Magit­ — and many other modes that open new windows — divide a window by customising the variables &lt;code&gt;split-height-threshold&lt;/code&gt; and &lt;code&gt;split-width-threshold&lt;/code&gt;, and, if you need more control, changing &lt;code&gt;split-window-preferred-function&lt;/code&gt;. These are all documented in the Elisp reference, and see other questions here, e.g. &lt;a href=&quot;https://emacs.stackexchange.com/questions/17872/algorithm-on-deciding-splitting-vertically-or-horizontally/17877#17877&quot;&gt;Algorithm on deciding splitting vertically or horizontally&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a reason that I, and others, find puzzling, the default function prefers to split horizontally if possible, so in your case you might want to tweak the variables so that &lt;code&gt;split-height-threshold&lt;/code&gt; is greater than your window's maximum height, and so that a window is never split horizontally.&lt;/p&gt;&#xA;" OwnerUserId="9716" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-11-07T14:19:59.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28501" PostTypeId="1" AcceptedAnswerId="29290" CreationDate="2016-11-07T14:26:01.027" Score="2" ViewCount="1027" Body="&lt;p&gt;I use a different keyboard layout (colemak) so standard evil keys are a bit annoying. Is there a way to swap keys globally (minus when writing text)?&lt;/p&gt;&#xA;" OwnerUserId="9648" LastEditorUserId="9648" LastEditDate="2016-11-07T14:31:35.257" LastActivityDate="2017-02-12T21:31:12.423" Title="Spacemacs - Changing evil keys (swapping)" Tags="|key-bindings|evil|spacemacs|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28502" PostTypeId="1" AcceptedAnswerId="28506" CreationDate="2016-11-07T15:44:14.000" Score="6" ViewCount="991" Body="&lt;p&gt;Is there a way to get the output of &lt;code&gt;git status --ignored&lt;/code&gt; in a Magit buffer? Preferably in a way that would make opening ignored files easy.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-11-07T17:32:08.010" Title="Magit: show ignored files" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28503" PostTypeId="1" AcceptedAnswerId="28511" CreationDate="2016-11-07T16:15:57.400" Score="1" ViewCount="716" Body="&lt;p&gt;I’m trying to install &lt;code&gt;git-gutter&lt;/code&gt; or &lt;code&gt;git-gutter-fringe&lt;/code&gt; depending if I’m running in graphics mode or not. I have an &lt;code&gt;if&lt;/code&gt; statement for that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (display-graphic-p)&#xA;    (use-package git-gutter-fringe&#xA;      ;; package setup here)&#xA;  (use-package git-gutter&#xA;    ;; same package setup here))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was trying to do it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package (if (display-graphic-p) git-gutter-fringe git-gutter)&#xA;  ;; package setup here)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((package-name (if (display-graphic-p) &quot;git-gutter-fringe&quot; &quot;git-gutter-fringe&quot;)))&#xA;  (use-package package-name&#xA;    ;; package setup here))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But none of these succeeds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final question is, is it possible to do what I want, or do I have to stay with my current config?&lt;/p&gt;&#xA;" OwnerUserId="507" LastActivityDate="2016-11-07T21:38:03.367" Title="Install package git-gutter or git-gutter-fringe conditionally" Tags="|use-package|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28504" PostTypeId="1" AcceptedAnswerId="28509" CreationDate="2016-11-07T16:39:14.527" Score="3" ViewCount="563" Body="&lt;p&gt;Is there a way to make a file read-only from dired?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/26320/how-to-edit-and-save-an-extremely-stubborn-read-only-file&quot;&gt;This&lt;/a&gt;, &lt;a href=&quot;https://unix.stackexchange.com/questions/47724/how-to-modify-write-permission-on-current-buffer-in-emacs&quot;&gt;this&lt;/a&gt;, and &lt;a href=&quot;https://emacs.stackexchange.com/questions/3994/make-buffer-read-only-on-a-per-file-basis/3997#3997&quot;&gt;this&lt;/a&gt; are unclear to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual has lots to say about &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Marks-vs-Flags.html#Marks-vs-Flags&quot; rel=&quot;nofollow noreferrer&quot;&gt;marking/flagging&lt;/a&gt; via dired as well as &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Operating-on-Files.html#Operating-on-Files&quot; rel=&quot;nofollow noreferrer&quot;&gt;operating on files&lt;/a&gt;, but I can't see anything in operating that discusses changing a file to read-only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the links above (that I said were unclear to me), I am guessing it has something to do with modes and/or permissions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bonus points, is there a way to operate on a directory via dired to make all files within it read-only?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, I want the files to become read-only and to stay that way until they are changed back to read/write manually. &lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.350" LastActivityDate="2016-11-07T19:49:24.123" Title="Way to make a file read-only from dired?" Tags="|dired|microsoft-windows|" AnswerCount="1" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="28505" PostTypeId="2" ParentId="28498" CreationDate="2016-11-07T16:52:33.560" Score="3" Body="&lt;p&gt;Citation of my comment:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Did you really try &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;(display-buffer &quot;*Messages*&quot;)&lt;/code&gt;?? It works for me with your entry in &lt;code&gt;display-buffer-alist&lt;/code&gt; and &lt;code&gt;&quot;*flycheck errors*&quot;&lt;/code&gt; replaced by &lt;code&gt;&quot;*Messages*&quot;&lt;/code&gt;! Could it be that you tried &lt;code&gt;switch-to-buffer&lt;/code&gt; instead and expected the same effects as for &lt;code&gt;display-buffer&lt;/code&gt;? They behave differently (at least for me).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And @bertfred's answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;That was the problem. I have a custom function that displays the message buffer. However it works with eshell when I use&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(defun switch-to-eshell () (interactive) (switch-to-buffer (eshell)))&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eshell&lt;/code&gt; generates the buffer and shows it with &lt;code&gt;pop-to-buffer-same-window&lt;/code&gt; which in turn calls &lt;code&gt;pop-to-buffer&lt;/code&gt; and this calls &lt;code&gt;display-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also occasions when &lt;code&gt;switch-to-buffer&lt;/code&gt; calls &lt;code&gt;pop-to-buffer&lt;/code&gt;.&#xA;In that case your entries in &lt;code&gt;display-buffer-alist&lt;/code&gt; become relevant.&#xA;But normally, &lt;code&gt;switch-to-buffer&lt;/code&gt; uses just the low-level routine &lt;code&gt;set-buffer&lt;/code&gt; where the entries in &lt;code&gt;display-buffer-alist&lt;/code&gt; are irrelevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relevant citation from the help of &lt;code&gt;switch-to-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the selected window cannot display the specified buffer&#xA;  because it is a minibuffer window or strongly dedicated to&#xA;  another buffer, call ‘pop-to-buffer’ to select the buffer in&#xA;  another window.  In interactive use, if the selected window is&#xA;  strongly dedicated to its buffer, the value of the option&#xA;  ‘switch-to-buffer-in-dedicated-window’ specifies how to proceed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You also asked:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And is it also possible to configure the display for buffers, that are opened by specific commands ? One example is shell-mode. When I open a new shell buffer, with another one already existing, my display modifications don't work because the name of the buffer is different.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The documentation of &lt;code&gt;generate-new-buffer-name&lt;/code&gt; describes how unique buffernames are generated:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;generate-new-buffer-name is a built-in function in ‘C source code’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(generate-new-buffer-name NAME &amp;amp;optional IGNORE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return a string that is the name of no existing buffer based on NAME.&#xA;  If there is no live buffer named NAME, then return NAME.&#xA;  Otherwise modify name by appending &lt;code&gt;‘&amp;lt;NUMBER&amp;gt;’&lt;/code&gt;, incrementing NUMBER&#xA;  (starting at 2) until an unused name is found, and then return that name.&#xA;  Optional second argument IGNORE specifies a name that is okay to use (if&#xA;  it is in the sequence to be tried) even if a buffer with that name exists.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If NAME begins with a space (i.e., a buffer that is not normally&#xA;  visible to users), then if buffer NAME already exists a random number&#xA;  is first appended to NAME, to speed up finding a non-existent buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;(rx &quot;SomeBufferName&amp;lt;&quot; (one-or-more digit) &quot;&amp;gt;&quot;)&lt;/code&gt; should do the job.&#xA;Just replace &lt;code&gt;SomeBufferName&lt;/code&gt; with the name of the first buffer of this special kind.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-07T18:56:17.383" LastActivityDate="2016-11-07T18:56:17.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28506" PostTypeId="2" ParentId="28502" CreationDate="2016-11-07T17:32:08.010" Score="9" Body="&lt;p&gt;You can customize &lt;code&gt;magit-status-sections-hook&lt;/code&gt;, functions in this hook are used to insert contents at magit status buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Command to list ignored files:&#xA;;; $ git ls-files --others --ignored --exclude-standard --directory&#xA;(defun magit-ignored-files ()&#xA;  (magit-git-items &quot;ls-files&quot; &quot;--others&quot; &quot;--ignored&quot; &quot;--exclude-standard&quot; &quot;-z&quot; &quot;--directory&quot;))&#xA;&#xA;(defun magit-insert-ignored-files ()&#xA;  (-when-let (files (magit-ignored-files))&#xA;    (magit-insert-section (ignored)&#xA;      (magit-insert-heading &quot;Ignored files:&quot;)&#xA;      (magit-insert-un/tracked-files-1 files nil)&#xA;      (insert ?\n))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then add &lt;code&gt;magit-insert-ignored-files&lt;/code&gt; to &lt;code&gt;magit-status-sections-hook&lt;/code&gt;, it should be very easy if using Custom. I added it right after the &quot;Untracked files&quot; section:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Izyqh.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Izyqh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-07T17:32:08.010" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28507" PostTypeId="2" ParentId="28026" CreationDate="2016-11-07T18:41:21.640" Score="5" Body="&lt;p&gt;Irony-mode maintainer's here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also using ROS at work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use catkin, then you can get along with irony-mode easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not have ROS at my disposal right now but you should be able to do something along these lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;catkin_make&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# create build/compile_commands.json&#xA;catkin_make -DCMAKE_EXPORT_COMPILE_COMMANDS=ON&#xA;&#xA;emacs src/my_packages/src/foo.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I explain a bit more:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First step, tells CMake (which catkin uses under the hoot) to generate a compilation database.&#xA;You can read more about the compilation database here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/Sarcasm/irony-mode/#compilation-database&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/Sarcasm/irony-mode/#compilation-database&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://clang.llvm.org/docs/JSONCompilationDatabase.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://clang.llvm.org/docs/JSONCompilationDatabase.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://sarcasm.github.io/notes/dev/compilation-database.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://sarcasm.github.io/notes/dev/compilation-database.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I got the command right, you will have a new file in you build directory: &lt;code&gt;build/compile_commands.json&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second step,&#xA;when you open Emacs on the file.&#xA;&lt;code&gt;irony-autosetup-compile-options&lt;/code&gt; will look if there is a compilation database in a parent directory of your file, or in a subdirectory &lt;code&gt;build/&lt;/code&gt; in a parent path of your file, which should be the case with the command we typed earlier. Type &lt;code&gt;C-h v irony-cdb-search-directory-list RET&lt;/code&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;catkin_tools&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# create ~/catkin_ws/build/xxx/compile_commands.json&#xA;# for all the packages located in ~/catkin_ws/src/xxx&#xA;catkin config --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON&#xA;&#xA;# in emacs, type:&#xA;#     M-x irony-cdb-json-add-compile-commands-path RET&#xA;# you will be prompted with the compile_commands.json to add, in this case,&#xA;# set the &quot;Project root&quot; to ~/catkin_ws/src/xxx/&#xA;# and set the &quot;Compile commands&quot; to ~/catkin_ws/build/xxx/compile_commands.json&#xA;emacs src/my_packages/src/foo.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="901" LastEditorUserId="901" LastEditDate="2016-11-07T20:30:32.347" LastActivityDate="2016-11-07T20:30:32.347" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28508" PostTypeId="1" AcceptedAnswerId="28510" CreationDate="2016-11-07T19:16:34.470" Score="2" ViewCount="543" Body="&lt;p&gt;As an evil I choose to use tabs.&#xA;I'm having trouble getting them to work like they do in other editors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want displayed tabs &lt;em&gt;aligned&lt;/em&gt; to 2 columns (with no exceptions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tab-width set to 2, but when tabs begin on an odd column they become 3 columns wide. Standard editors align to the next tab stop so in this case they become only 1 column wide (which is what I want).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples (where 'T+' is a tab with 2 chars, and 'x' is an ordinary character):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xxT+xx // same alignment on emacs and standard editors.&#xA;xT++xx // emacs.&#xA;xTxx   // standard editors. (This is what I'm after)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I achieve this (preferably globally, but primarily for C/C++/bash/text).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This question is entirely about the &lt;em&gt;display&lt;/em&gt; of existing tabs.&lt;/p&gt;&#xA;" OwnerUserId="13922" LastEditorUserId="13922" LastEditDate="2016-11-07T20:03:44.333" LastActivityDate="2016-11-07T21:20:41.163" Title="Consistent tab alignment" Tags="|tabs|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28509" PostTypeId="2" ParentId="28504" CreationDate="2016-11-07T19:49:24.123" Score="2" Body="&lt;p&gt;As @lawlist said in a comment, use the &lt;code&gt;dired-do-chmod&lt;/code&gt; command (which is bound to &lt;code&gt;M&lt;/code&gt;). This asks you what mode you want to set on the file, and it expects either a three or four-digit octal number or a symbolic representation of the mode. This is exactly the same value you would give to the chmod program if you were running it at the command line. The difference is that &lt;code&gt;dired-do-chmod&lt;/code&gt; works in windows, even though permissions in windows work a different way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using an octal number to represent permissions is concise and traditional, but hard to remember and explain. It's basically a bitmask of the permissions, and &lt;code&gt;600&lt;/code&gt; or &lt;code&gt;660&lt;/code&gt; are the usual values that you would use. Changing that to &lt;code&gt;400&lt;/code&gt; or &lt;code&gt;440&lt;/code&gt; will unset the bits that allow writing, thus making the file readonly. I won't explain further here, but you can look it up if you're curious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better way to do it is to to use the symbolic representation. If you use &lt;code&gt;a-w&lt;/code&gt;, then you are saying that for all users you want to remove the write permission. Again I won't explain all the possible values you can use here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is slightly overkill for just making the file readonly, so you might think about recording a keyboard macro and saving it for future use. &lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-11-07T19:49:24.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28510" PostTypeId="2" ParentId="28508" CreationDate="2016-11-07T20:39:44.587" Score="1" Body="&lt;p&gt;I cannot reproduce what you see.  I've done the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q&#xA;Options&#xA;-&amp;gt; Customize Emacs&#xA;-&amp;gt; Browse Customization Groups&#xA;-&amp;gt; Emacs -&amp;gt; Editing&#xA;-&amp;gt; Editing Basics&#xA;-&amp;gt; Tab Width&#xA;Replace the 8 with a 2&#xA;Click on `State` -&amp;gt; Set for Current Session&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I went back to &lt;code&gt;*scratch*&lt;/code&gt; and typed&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x C-q TAB xx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at which point I saw&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xTxx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than the&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xT++xx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[ where &lt;code&gt;T&lt;/code&gt; and &lt;code&gt;+&lt;/code&gt; both stand for whitespace.  ]&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="5296" LastEditDate="2016-11-07T21:20:41.163" LastActivityDate="2016-11-07T21:20:41.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28511" PostTypeId="2" ParentId="28503" CreationDate="2016-11-07T21:03:58.627" Score="2" Body="&lt;p&gt;Your first try should work? I.e. something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (display-graphic-p)&#xA;   (use-package git-gutter-fringe&#xA;     :ensure t&#xA;     :init (global-git-gutter-mode))&#xA; (use-package git-gutter&#xA;  :ensure t&#xA;  :init (global-git-gutter-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For your 2nd try, since &lt;code&gt;use-package&lt;/code&gt; is a macro, the &lt;code&gt;if&lt;/code&gt; is not evaluated before the &quot;call&quot;. This should evaluate it when needed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((package-name (if (display-graphic-p)&#xA;                        &quot;git-gutter-fringe&quot;&#xA;                      &quot;git-gutter&quot;)))&#xA;  (eval `(use-package ,package-name&#xA;    :ensure t&#xA;    :init (global-git-gutter-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From my tests, the fringe version also installs &lt;code&gt;git-gutter&lt;/code&gt;, so there may be other approaches to this. You could simply install both, and &lt;em&gt;enable&lt;/em&gt; the right mode based on &lt;code&gt;display-graphic-p&lt;/code&gt;. E.g., I'd use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package git-gutter                                                                                              &#xA;  :ensure t                                                                                                          &#xA;  :init                                                                                                              &#xA;  (when (display-graphic-p)                                                                                          &#xA;      (use-package git-gutter-fringe                                                                                 &#xA;        :ensure t))                                                                                                  &#xA;  (global-git-gutter-mode))   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For those who don't use &lt;code&gt;git-gutter*&lt;/code&gt;, both packages use the same mode name, hence the similar code in both situations (only the package names are different).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not a great lisper, so there may be other, smarter &amp;amp; shorter solutions out there.&lt;/p&gt;&#xA;" OwnerUserId="8708" LastEditorUserId="8708" LastEditDate="2016-11-07T21:38:03.367" LastActivityDate="2016-11-07T21:38:03.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28512" PostTypeId="1" CreationDate="2016-11-08T02:12:17.970" Score="2" ViewCount="573" Body="&lt;p&gt;I am using emacs &lt;code&gt;ispell&lt;/code&gt; to look for spelling mistakes. It works well in interactive mode, but I was wondering if I can see all the words with spelling issues highlighted in the buffer itself or highlighted in a separate buffer. I need this because a lot of my writing involves use of technical nouns that aren't in the dictionary and it is a little inefficient to cycle through them, specially since I don't make a lot of mistakes. I am unable to find any clue online and the manual mentions only the interactive mode of usage.&lt;/p&gt;&#xA;" OwnerUserId="10971" LastEditorUserId="2287" LastEditDate="2016-11-09T01:55:16.700" LastActivityDate="2016-11-09T01:55:16.700" Title="Emacs Ispell to list all spelling errors at once" Tags="|flyspell|ispell|spell-checking|writing|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28513" PostTypeId="2" ParentId="28197" CreationDate="2016-11-08T03:04:52.430" Score="0" Body="&lt;p&gt;After I have checked init.el, I found that it is the problem of linum-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to disable global-linum-mode, and it goes fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I wrote a shortcut: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun hao-goto-beginning-of-buffer-quickly ()&#xA;  &quot;Go to beginning of the buffer quickly&quot;&#xA;  (interactive)&#xA;  (global-linum-mode 0)&#xA;  (goto-line 1)&#xA;  (global-linum-mode 1)&#xA;  )&#xA;(global-set-key [(meta &amp;lt;)] 'hao-goto-beginning-of-buffer-quickly)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13804" LastActivityDate="2016-11-08T03:04:52.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28514" PostTypeId="1" CreationDate="2016-11-08T05:16:35.020" Score="3" ViewCount="868" Body="&lt;p&gt;In org-mode, warning date for a TODO's DEADLINE can be designated by giving the &lt;code&gt;-&lt;/code&gt; date.&#xA;For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEADLINE: &amp;lt;2004-02-29 Sun -5d&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any keyboard shortcut for changing this warning date descriptor?&#xA;Because, my current operation for changing this descriptor would be to&#xA;move the cursor into the timestamp and to edit it manually; it can be better, I think...&lt;/p&gt;&#xA;" OwnerUserId="9371" LastActivityDate="2018-08-11T13:01:11.290" Title="Is there keyboard shortcut for changing DEADLINE warning date?" Tags="|org-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28516" PostTypeId="1" CreationDate="2016-11-08T08:20:39.773" Score="2" ViewCount="414" Body="&lt;p&gt;I'm writing a paper using org-mode, using the LaTeX export function to generate the &lt;code&gt;.tex&lt;/code&gt; file I need to submit to the journal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I run an external shell command every time I to the &lt;code&gt;C-c C-e l l&lt;/code&gt; for LaTeX export?  I need to apply a patch to the generated &lt;code&gt;.tex&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2016-11-08T16:52:41.273" Title="Running an external shell command after org export" Tags="|org-mode|org-export|hooks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28517" PostTypeId="1" AcceptedAnswerId="28522" CreationDate="2016-11-08T10:47:20.157" Score="0" ViewCount="347" Body="&lt;p&gt;I want to make a few customizations to &lt;a href=&quot;https://cmake.org/gitweb?p=cmake.git;a=blob_plain;hb=master;f=Auxiliary/cmake-mode.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;cmake-model.el&lt;/a&gt;. The big-picture view of this lisp file is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;&#xA;;; This function I want to modify&#xA;(defun cmake-indent ()&#xA;  ...&#xA;  )&#xA;&#xA;...&#xA;&#xA;;; Mode definition.&#xA;;;&#xA;;;;###autoload&#xA;(define-derived-mode cmake-mode cmake--parent-mode &quot;CMake&quot;&#xA;  &quot;Major mode for editing CMake source files.&quot;&#xA;  ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want to do is to create a minor mode &lt;code&gt;ros-mode&lt;/code&gt; which would override the &lt;code&gt;cmake-indent()&lt;/code&gt; function with my own, but keep everything else the same compared to the original cmake-mode.el. The mode line should show &lt;code&gt;ROS&lt;/code&gt; when the minor mode is active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no experience with creating minor modes, but I feel like this should be easy for someone with experience. Thank you for helping!&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2016-11-08T14:12:33.223" Title="Create a sub-mode of an existing mode which overrides certain functions?" Tags="|major-mode|customize|functions|minor-mode|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28518" PostTypeId="1" AcceptedAnswerId="28520" CreationDate="2016-11-08T11:34:38.773" Score="1" ViewCount="94" Body="&lt;p&gt;Example, I want to define a &lt;code&gt;package-open-homepage&lt;/code&gt; command, which reuses &lt;kbd&gt;C-h P&lt;/kbd&gt; (&lt;code&gt;describe-package&lt;/code&gt;)'s &quot;interactive&quot; form. I don't want to copy-and-paste because it is too long. The following&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval&#xA; `(defun package-open-homepage (pkg)&#xA;    &quot;Open homepage of pkg, or do nothing if none.&quot;&#xA;    ,(interactive-form 'describe-package)&#xA;    (when-let ((desc (cadr (assq pkg package-alist)))&#xA;               (extras (package-desc-extras desc))&#xA;               (homepage (cdr (assoc :url extras))))&#xA;      (browse-url homepage))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works, but I never use &lt;code&gt;eval&lt;/code&gt; before, is this use case the reason that why &lt;code&gt;eval&lt;/code&gt; is needed? and is there any other way without using &lt;code&gt;eval&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I already know &lt;code&gt;(put 'package-open-homepage 'interactive-form (interactive-form 'describe-package))&lt;/code&gt; works.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="105" LastEditDate="2017-12-24T16:06:46.420" LastActivityDate="2017-12-24T16:06:46.420" Title="Reuse other command's &quot;interactive&quot; form" Tags="|commands|interactive|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28520" PostTypeId="2" ParentId="28518" CreationDate="2016-11-08T12:53:26.823" Score="2" Body="&lt;p&gt;Your own solution (setting the symbol property) is a perfectly fine way to go IMHO.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't care about interactive forms with string literal values (the following won't work with those), your own interactive form could eval the other command's interactive form at run-time:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (&amp;amp;rest args)&#xA;  (interactive&#xA;   (eval (cadr (interactive-form 'COMMAND))))&#xA;  (message &quot;%S&quot; args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-11-08T12:53:26.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28521" PostTypeId="1" AcceptedAnswerId="28533" CreationDate="2016-11-08T13:13:56.900" Score="3" ViewCount="769" Body="&lt;p&gt;I want to list particular files in a buffer, with each file on its own line. I want to be able to choose the files to list from a Dired buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried copying file names to the clipboard, and then pasting what I copied, but that puts all of the file names on the same line. For example if I mark these file nams&#xA;&lt;code&gt;&#xA;Slide1.JPG&#xA;Slide2.JPG&#xA;Slide3.JPG&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;issue &lt;code&gt;0w&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then paste and they are all in 1 line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide1.JPG/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide2.JPG/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide3.JPG&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I instead want each file to have its own line so it will look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide1.JPG&#xA;&#xA;/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide2.JPG&#xA;&#xA;/home/zeltak/org/attach/bgu/courses/BGUC004.GIS.Planners/images/t2/Slide3.JPG &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;any clue?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2016-11-08T18:56:57.413" LastActivityDate="2023-03-21T11:29:16.207" Title="list marked files in dired in another buffer" Tags="|dired|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28522" PostTypeId="2" ParentId="28517" CreationDate="2016-11-08T14:12:33.223" Score="1" Body="&lt;p&gt;I ended up going for a derived major mode as suggested by &lt;a href=&quot;https://emacs.stackexchange.com/users/454/phils&quot;&gt;phils&lt;/a&gt;. I wrote in &lt;code&gt;~/.emacs.d/lisp/ros-cmake-mode.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cmake-mode)&#xA;&#xA;(defun ros-cmake-indent ()&#xA;   ;; my code here...&#xA;  )&#xA;&#xA;;;;###autoload&#xA;(define-derived-mode ros-cmake-mode cmake-mode &quot;CMake[ROS]&quot;&#xA;  &quot;Major mode for editing ROS CMakeLists.txt files.&quot;&#xA;&#xA;  ;; Setup indentation function.&#xA;  (set (make-local-variable 'indent-line-function) 'ros-cmake-indent))&#xA;&#xA;(provide 'ros-cmake-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in &lt;code&gt;~/.emacs.d/lisp/init.el&lt;/code&gt; (using &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;use-package&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package cmake-mode&#xA;  ;; major-mode for editing CMake sources&#xA;  :load-path &quot;lisp/&quot;&#xA;  :config&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.cmake\\'&quot; . cmake-mode))&#xA;  (autoload 'cmake-mode &quot;lisp/cmake-mode.el&quot; t))&#xA;&#xA;(use-package ros-cmake-mode&#xA;  ;; major-mode for editing CMakeLists.txt files with ROS-style indentation&#xA;  :load-path &quot;lisp/&quot;&#xA;  :config&#xA;  (add-to-list 'auto-mode-alist '(&quot;CMakeLists\\.txt\\'&quot; . ros-cmake-mode))&#xA;  (autoload 'ros-cmake-mode &quot;lisp/ros-cmake-mode.el&quot; t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I open a CMakeLists.txt file, the major mode &lt;code&gt;CMake[ROS]&lt;/code&gt; is used by default. In case I want to switch to &lt;code&gt;CMake&lt;/code&gt; major mode (as provided by &lt;a href=&quot;https://cmake.org/gitweb?p=cmake.git;a=blob_plain;hb=master;f=Auxiliary/cmake-mode.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;cmake-mode.el&lt;/a&gt;), I can type &lt;code&gt;M-x cmake-mode RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-11-08T14:12:33.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28524" PostTypeId="2" ParentId="28521" CreationDate="2016-11-08T14:29:45.143" Score="2" Body="&lt;p&gt;A workaround using &lt;code&gt;xargs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Yank the filenames as you did (all in 1 line)&lt;/li&gt;&#xA;&lt;li&gt;Select the line&lt;/li&gt;&#xA;&lt;li&gt;pipe to a command &lt;kbd&gt;C-u M-|&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;xargs -n 1&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This will substitute your selection with one filename per line.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-11-08T14:29:45.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28525" PostTypeId="1" AcceptedAnswerId="28532" CreationDate="2016-11-08T14:54:50.513" Score="3" ViewCount="939" Body="&lt;p&gt;I want to display the line contains matching bracket in the message/mini buffer at the bottom of emacs. I found some code on emacs Wiki, after put it in init file, emacs do show the maching line in the message buffer:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Matches    myfucntion...()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But then it &lt;strong&gt;disappears very quickly (&amp;lt;1s)&lt;/strong&gt; and is replaced by the following message:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Error running timer &amp;quot;show-paren-function&amp;quot;: (wrong-type-argument stringp t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I was wondering what is the cause of this timer error and just want the matching line info to be always displayed as long as my cursor stays, it would be the best if it can also display the matching line number.&lt;/p&gt;&#xA;&lt;p&gt;Below is the code I'm using from:&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/ShowParenMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacswiki: How to show the matching paren when it is offscreen&lt;/a&gt;&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (defadvice show-paren-function&#xA;      (after show-matching-paren-offscreen activate)&#xA;      &amp;quot;If the matching paren is offscreen, show the matching line in the&#xA;        echo area. Has no effect if the character before point is not of&#xA;        the syntax class ')'.&amp;quot;&#xA;      (interactive)&#xA;      (let* ((cb (char-before (point)))&#xA;             (matching-text (and cb&#xA;                                 (char-equal (char-syntax cb) ?\) )&#xA;                                 (blink-matching-open))))&#xA;        (when matching-text (message matching-text))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;More pages that I found that is relavent but not constructive:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/smartparens/issues/346&quot; rel=&quot;nofollow noreferrer&quot;&gt;Request: show-smartparens and offscreen delimiter&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I tried mic-paren with emacs 25.1, but it has the same problem as the matching message also disappears very fast.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&#xA;Error message disappears after using:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (defadvice show-paren-function&#xA;      (after show-matching-paren-offscreen activate)&#xA;      &amp;quot;If the matching paren is offscreen, show the matching line in the&#xA;        echo area. Has no effect if the character before point is not of&#xA;        the syntax class ')'.&amp;quot;&#xA;      (interactive)&#xA;      (let* (&#xA;         (cb (char-before (point)))&#xA;             (matching-text (and cb&#xA;                                 (char-equal (char-syntax cb) ?\) )&#xA;                                 (blink-matching-open)&#xA;                )&#xA;         )&#xA;        )&#xA;      )&#xA;    &#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="17538" LastEditDate="2023-10-21T11:33:34.437" LastActivityDate="2023-10-21T11:33:34.437" Title="Error running timer &quot;show-paren-function&quot; when displaying matching line in message/mini buffer" Tags="|minibuffer|echo-area|message|smartparens|timers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28526" PostTypeId="2" ParentId="28521" CreationDate="2016-11-08T15:02:53.453" Score="0" Body="&lt;p&gt;If you are using &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;counsel&lt;/code&gt;&lt;/a&gt;, when you execute &lt;code&gt;find-file&lt;/code&gt; or &lt;code&gt;projectile-find-file&lt;/code&gt; and enter a regexp(or a search string) to narrow down the files to search, pressing &lt;kbd&gt;M-w&lt;/kbd&gt; will copy the file names in as they appear in &lt;code&gt;ivy&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But they don't copy the full path names of the files, only filename is copied OR if you are using &lt;code&gt;projectile&lt;/code&gt;, the file names relative to the project root directory is copied. I'm not sure how you can get the full path name from &lt;code&gt;ivy&lt;/code&gt;. But, if you're happy with just the file names, you can use this method :)&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;An alternative solution(this is better than the first solution) would be to use the command &lt;code&gt;directory-files&lt;/code&gt; to get the file names. With this, you can also get the full path names of the file. Check help for the function using &lt;kbd&gt;C-h f&lt;/kbd&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-11-08T15:08:43.780" LastActivityDate="2016-11-08T15:08:43.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28527" PostTypeId="2" ParentId="15197" CreationDate="2016-11-08T15:08:14.703" Score="1" Body="&lt;p&gt;As @Tarsius mentions, you can define your own command to do this.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun wh/magit-branch-from-current-and-checkout (branch)&#xA;  &quot;Create and checkout BRANCH from the current branch.&quot;&#xA;  (interactive (list (magit-read-string-ns &quot;Branch name&quot;)))&#xA;  (let ((start-point (magit-get-current-branch)))&#xA;    (if (string-match-p &quot;^stash@{[0-9]+}$&quot; start-point)&#xA;        (magit-run-git &quot;stash&quot; &quot;branch&quot; branch start-point)&#xA;      (magit-call-git &quot;checkout&quot; &quot;-b&quot; branch start-point)&#xA;      (--when-let (and (magit-get-upstream-branch branch)&#xA;                       (magit-get-indirect-upstream-branch start-point))&#xA;        (magit-call-git &quot;branch&quot; (concat &quot;--set-upstream-to=&quot; it) branch))&#xA;      (magit-refresh))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can add this to the existing branch popup. In this case, I've chosen &lt;kbd&gt;b f&lt;/kbd&gt; as the keybinding (as it's currently unused).&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(magit-define-popup-action 'magit-branch-popup&#xA;  ?f &quot;new branch From current&quot; #'wh/magit-branch-from-current-and-checkout)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't have unpushed commits on your current branch, you can also use &lt;kbd&gt;b&lt;/kbd&gt; &lt;kbd&gt;s&lt;/kbd&gt; (bound to &lt;code&gt;magit-branch-spinoff&lt;/code&gt;) to create a new branch without prompting for the base branch.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2016-12-08T09:53:48.063" LastActivityDate="2016-12-08T09:53:48.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28528" PostTypeId="1" AcceptedAnswerId="28536" CreationDate="2016-11-08T16:06:42.567" Score="2" ViewCount="455" Body="&lt;p&gt;how does one do a &lt;code&gt;query-replace-regexp&lt;/code&gt; to add a prefix string but &lt;em&gt;not&lt;/em&gt; on EVERY line but rather just lines with text (or start with specific text?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i know how to add a prefix with &lt;code&gt;query-replace-regexp&lt;/code&gt; but that adds the prefix to every line (even empty ones).&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="12895" LastEditDate="2016-11-08T20:03:14.870" LastActivityDate="2016-11-08T20:03:14.870" Title="query-replace-regexp on specific lines" Tags="|regular-expressions|replace|query-replace|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28530" PostTypeId="2" ParentId="28528" CreationDate="2016-11-08T16:38:11.430" Score="3" Body="&lt;p&gt;If you want to add a prefix of &lt;code&gt;hello&lt;/code&gt; to all lines which start with a letter, you can use &lt;code&gt;C-M-%&lt;/code&gt; &lt;code&gt;^\([a-zA-Z]\)&lt;/code&gt; &lt;code&gt;hello \1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to use &lt;code&gt;\(...\)&lt;/code&gt; to capture stuff and &lt;code&gt;\1&lt;/code&gt; to represent the first captured group. Here I am using &lt;code&gt;[a-zA-Z]&lt;/code&gt; to represent a single letter using the normal unix conventions. It would be better if I said &lt;code&gt;[[:alpha:]]&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to add the prefix to non-empty lines then the critical observation you need is that a line is non-empty if it has a character on it! So you want to replace &lt;code&gt;^\(.\)&lt;/code&gt; with &lt;code&gt;prefix \1&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-11-08T16:38:11.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28531" PostTypeId="2" ParentId="28516" CreationDate="2016-11-08T16:52:41.273" Score="1" Body="&lt;p&gt;You might do this by using Org's &lt;a href=&quot;http://orgmode.org/manual/Publishing.html#Publishing&quot; rel=&quot;nofollow noreferrer&quot;&gt;publishing&lt;/a&gt; functions, and setting up one for your project. Take a look in particular at the setting &lt;a href=&quot;http://orgmode.org/manual/Publishing-action.html#Publishing-action&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;publishing-function&lt;/code&gt;&lt;/a&gt;, which allows you to specify an arbitrary elisp function by which an org file within a given project is exported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The publishing function might do a standard export to latex then run a shell command on the resulting file like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun publish-latex-and-patch (plist filename pub-dir)&#xA;  &quot;Export a latex file then patch it by reversing lines&quot;&#xA;  (let ((outfile&#xA;         (org-publish-org-to 'latex filename &quot;.tex&quot; plist pub-dir)))&#xA;    (shell-command (format &quot;tac %s &amp;gt; %s-patched.tex&quot;&#xA;                           outfile&#xA;                           (file-name-sans-extension outfile)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you would then export your file by doing &lt;code&gt;C-c C-e P f&lt;/code&gt; (&quot;publish this file&quot;). Obviously replace &lt;code&gt;tac&lt;/code&gt; with your patching command, and exercise hygiene (e.g. escaping) if passing untrusted input to the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also many org-export hooks, but they are more designed to modify specify elements within the parse tree during the export process.&lt;/p&gt;&#xA;" OwnerUserId="9716" LastActivityDate="2016-11-08T16:52:41.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28532" PostTypeId="2" ParentId="28525" CreationDate="2016-11-08T17:43:45.030" Score="1" Body="&lt;p&gt;A quick look at the code shows this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;blink-matching-open&lt;/code&gt; does not return a string - the return value is not the matching text.  So &lt;code&gt;message&lt;/code&gt; complains that its arg is not a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;blink-matching-open&lt;/code&gt; itself calls &lt;code&gt;message&lt;/code&gt; to show the matching text, so you should be able to just remove your &lt;code&gt;(when matching-text...)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-08T17:43:45.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28533" PostTypeId="2" ParentId="28521" CreationDate="2016-11-08T18:29:45.447" Score="1" Body="&lt;p&gt;Is it important for you to copy to the clipboard and then paste?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want file names listed in a buffer then you can easily do that using &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dired+&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just mark the files whose names you want to list, then hit &lt;strong&gt;&lt;code&gt;C-M-l&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The files are listed in a buffer named &lt;code&gt;*Files*&lt;/code&gt;, which you can of course rename.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If you also mark some directories then they too are listed.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h k C-M-l&lt;/code&gt;&lt;/strong&gt; tells you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;C-M-l&lt;/code&gt; runs the command diredp-list-marked, which is an interactive&#xA;      compiled Lisp function in &lt;code&gt;dired+.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;C-M-l&lt;/code&gt;, &lt;code&gt;menu-bar operate diredp-list-marked&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(diredp-list-marked &amp;amp;optional ARG PREDICATE)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;List the marked files in this Dired buffer.&#xA;      A prefix arg specifies files to use instead of the marked files:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Numeric prefix arg &lt;code&gt;N&lt;/code&gt;: The next &lt;code&gt;N&lt;/code&gt; files (previous &lt;code&gt;-N&lt;/code&gt;, if &amp;lt; 0).&lt;/li&gt;&#xA;  &lt;li&gt;&lt;code&gt;C-u C-u&lt;/code&gt;: &lt;em&gt;All&lt;/em&gt; files, but &lt;em&gt;no directories&lt;/em&gt;.&lt;/li&gt;&#xA;  &lt;li&gt;&lt;code&gt;C-u C-u C-u&lt;/code&gt;: &lt;em&gt;All&lt;/em&gt; files and directories, &lt;em&gt;except&lt;/em&gt; &lt;code&gt;.&lt;/code&gt; and &lt;code&gt;..&lt;/code&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;code&gt;C-u C-u C-u C-u&lt;/code&gt;: &lt;em&gt;All&lt;/em&gt; files and directories, &lt;em&gt;including&lt;/em&gt; &lt;code&gt;.&lt;/code&gt; and &lt;code&gt;..&lt;/code&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Any other prefix arg: The &lt;em&gt;current line&lt;/em&gt;'s file only.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can use &lt;code&gt;RET&lt;/code&gt; or &lt;code&gt;mouse-2&lt;/code&gt; to visit any of the files.&#xA;  If &lt;code&gt;tooltip-mode&lt;/code&gt; is on then moving the mouse over image-file names&#xA;  shows image previews.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Non-interactively, non-nil arg &lt;code&gt;PREDICATE&lt;/code&gt; is a file-name predicate.&#xA;  List only the files for which it returns non-nil.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can also do the same thing for all marked files &lt;em&gt;including those in marked subdirectories, defined recursively&lt;/em&gt;.  You do that using &lt;strong&gt;&lt;code&gt;M-+ C-M-l&lt;/code&gt;&lt;/strong&gt; (command &lt;code&gt;diredp-list-marked-recursive&lt;/code&gt;). (All commands that act on marked files defined recursively are on prefix key &lt;code&gt;M-+&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-08T18:29:45.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28534" PostTypeId="1" AcceptedAnswerId="28550" CreationDate="2016-11-08T18:39:23.540" Score="3" ViewCount="61" Body="&lt;p&gt;I am using find-file-at-point and it stubbornly selects incorrect file name string in NXML mode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;String where I have cursor on the file name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;include&amp;gt;my-file.ext&amp;lt;/include&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and when evaluating: &lt;code&gt;(ffap-string-at-point)&lt;/code&gt; it selects &quot;&lt;code&gt;&amp;gt;my-file.ext&amp;lt;/include&lt;/code&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some simple way to tell ffap that '&amp;lt;' and '&gt;' are NOT part of the file name?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, this is driving me crazy.&lt;/p&gt;&#xA;" OwnerUserId="13933" LastEditorUserId="105" LastEditDate="2016-11-08T19:18:06.577" LastActivityDate="2016-11-09T01:54:26.873" Title="Force ffap to ignore '&lt;' and '&gt;' in file names" Tags="|find-file|ffap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28535" PostTypeId="1" AcceptedAnswerId="30705" CreationDate="2016-11-08T18:42:15.847" Score="2" ViewCount="700" Body="&lt;p&gt;Is there any way to disable just this one warning?&#xA;Two spaces seems like overkill but maybe that is the lisp standard?&lt;/p&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="2710" LastEditDate="2016-11-08T19:20:43.233" LastActivityDate="2017-02-14T11:32:36.403" Title="Flycheck elisp &quot;There should be two spaces after period&quot;" Tags="|flycheck|sentences|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28536" PostTypeId="2" ParentId="28528" CreationDate="2016-11-08T19:05:52.583" Score="1" Body="&lt;p&gt;Another way to approach this is to use &lt;code&gt;occur&lt;/code&gt; to select the lines you want to modify, and then apply your modification in the &lt;code&gt;occur&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x occur&lt;/code&gt;, enter the regexp that matches the lines you want to edit&lt;/li&gt;&#xA;&lt;li&gt;Switch to the &lt;code&gt;occur&lt;/code&gt; window&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;e&lt;/code&gt; to enter &lt;code&gt;occur-edit-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-C-%&lt;/code&gt; to call &lt;code&gt;query-replace-regexp&lt;/code&gt;, do your replacements&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-c&lt;/code&gt; to leave &lt;code&gt;occur-edit-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Move back to your original window, where the modifications you made in step 4 will be made.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This does the same thing that @icarus suggests, but uses two different regexps: one to select the line, and a second to modify the selected lines. This approach requires a few more steps, but might be easier if @icarus solution requires a very complicated regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also do variants of this using &lt;code&gt;helm-occur&lt;/code&gt; or other packages, but what I describe here works in regular Emacs without any additional packages. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-11-08T19:05:52.583" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28537" PostTypeId="1" AcceptedAnswerId="28541" CreationDate="2016-11-08T19:16:21.343" Score="11" ViewCount="1115" Body="&lt;p&gt;We have a convention that every commit message begins with an issue number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to programmatically insert the issue number part (computed by a separate function) into the commit window of Magit, when it first opens (that is, on pressing &lt;kbd&gt;C&lt;/kbd&gt; &lt;kbd&gt;C&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I best do it? Where to look?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: Here's what I'm currently using.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-extract-branch-tag (branch-name)&#xA;  (let ((TICKET-PATTERN &quot;\\(?:[[:alpha:]]+-\\)?\\([[:alpha:]]+-[[:digit:]]+\\)-.*&quot;))&#xA;    (when (string-match-p TICKET-PATTERN branch-name)&#xA;       (s-upcase (replace-regexp-in-string TICKET-PATTERN &quot;[\\1] &quot; branch-name)))))&#xA;&#xA;(defun my-git-commit-insert-branch ()&#xA;  (insert (my-extract-branch-tag (magit-get-current-branch))))&#xA;&#xA;(add-hook 'git-commit-setup-hook 'my-git-commit-insert-branch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a branch name like &lt;code&gt;&amp;lt;username&amp;gt;-foo-123-&amp;lt;explanatory part&amp;gt;&lt;/code&gt; it produces &lt;code&gt;[FOO-123]&lt;/code&gt; in the first line of the commit message, to allow easy ticket auto-linking in Jira.&lt;/p&gt;&#xA;" OwnerUserId="9370" LastEditorUserId="9370" LastEditDate="2019-04-15T17:43:41.420" LastActivityDate="2019-04-15T17:43:41.420" Title="A way to insert a predefined text into Magit's commit message window?" Tags="|magit|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="28539" PostTypeId="2" ParentId="28496" CreationDate="2016-11-08T20:20:45.417" Score="1" Body="&lt;p&gt;I asked a &lt;a href=&quot;https://emacs.stackexchange.com/q/28498/11377&quot;&gt;similar question&lt;/a&gt; recently. You could try this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist&#xA;             `(,(rx bos &quot;*magit:&quot;)&#xA;               (display-buffer-reuse-window&#xA;                display-buffer-below-selected)&#xA;               (reusable-frames . visible)&#xA;               (side            . bottom)&#xA;               (window-height   . 0.4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I don't use magit frequently and therefore I don't know if this would also open buffers in a vertical split, that you don't want to open that way.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-11-08T20:30:11.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28540" PostTypeId="2" ParentId="28535" CreationDate="2016-11-08T20:28:46.043" Score="1" Body="&lt;p&gt;Flycheck uses &lt;code&gt;checkdoc-current-buffer&lt;/code&gt; to implement the &lt;code&gt;emacs-lisp-checkdoc&lt;/code&gt; checker which (in general) takes &lt;code&gt;sentence-end-double-space&lt;/code&gt; into account. However, the checker itself is implemented by calling an emacs subprocess and only passing along the variables whitelisted in &lt;code&gt;flycheck-emacs-lisp-checkdoc-variables&lt;/code&gt;, which doesn't include &lt;code&gt;sentence-end-double-space&lt;/code&gt;. You can (but since it's a defconst shouldn't) add &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;flycheck-emacs-lisp-checkdoc-variables&lt;/code&gt; to pass it along as well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local flycheck-emacs-lisp-checkdoc-variables (cons 'sentence-end-double-space flycheck-emacs-lisp-checkdoc-variables))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9257" LastActivityDate="2016-11-08T20:28:46.043" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28541" PostTypeId="2" ParentId="28537" CreationDate="2016-11-08T20:38:27.133" Score="15" Body="&lt;p&gt;There is a &lt;code&gt;git-commit-setup-hook&lt;/code&gt; that can be used to prepare the commit message buffer.  Here comes a short example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-git-commit-setup ()&#xA;  (insert &quot;#123 &quot;))&#xA;&#xA;(add-hook 'git-commit-setup-hook 'my-git-commit-setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-11-08T20:38:27.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28542" PostTypeId="1" CreationDate="2016-11-08T21:10:27.420" Score="2" ViewCount="784" Body="&lt;p&gt;I switched to &lt;code&gt;helm-occur&lt;/code&gt; for searching within buffers. However, I can't help missing two of the nice features of &lt;code&gt;isearch&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;isearch&lt;/code&gt; remembers the position where it was invoked in a buffer; &lt;code&gt;helm-occur&lt;/code&gt; doesn't: when typing a search query, the focus is on the first match of the buffer overall, not on the first match after the cursor position in the buffer.&lt;/li&gt;&#xA;&lt;li&gt;When typing &lt;code&gt;C-s&lt;/code&gt; within &lt;code&gt;isearch&lt;/code&gt;, at first the last search query is reactivated, and then, upon further uses of &lt;code&gt;C-s&lt;/code&gt;, it cycles through all the matches in a buffer. On the contrary, with &lt;code&gt;helm-occur&lt;/code&gt;, I have to first reactivate the last search query with &lt;code&gt;M-p&lt;/code&gt;, and then do the browsing with some third key binding, e.g. &lt;code&gt;&amp;lt;down&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How can I make &lt;code&gt;helm-occur&lt;/code&gt; act just like &lt;code&gt;isearch&lt;/code&gt; in these two respects?    &lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="12336" LastEditDate="2016-11-13T14:09:45.453" LastActivityDate="2016-11-13T14:09:45.453" Title="helm-occur: how to make it behave more like isearch?" Tags="|helm|isearch|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28543" PostTypeId="1" CreationDate="2016-11-08T22:30:19.590" Score="1" ViewCount="257" Body="&lt;p&gt;I'm using smartparens-strict-mode and trying to get it so that C-w kills a region if selected and the whole line that point is on if not (like &lt;a href=&quot;http://emacs-fu.blogspot.co.uk/2009/11/copying-lines-without-selecting-them.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; but working with smartparens strict mode). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sp-kill-line-or-region (orig-fun &amp;amp;rest args)&#xA;    &quot;Kill whole line if region not selected.&quot;&#xA;    (if (region-active-p)&#xA;        (apply orig-fun args)&#xA;      (kill-whole-line)))&#xA;  (advice-add 'sp-kill-region :around 'sp-kill-line-or-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work. If I just do C-w it gives me the error &lt;code&gt;command-execute: The mark is not set now, so there is no region&lt;/code&gt;. However, if I mark something, then C-w, then I can use it like I want (i.e. I can then not mark anything and it will kill the whole line). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't figure this one out for whatever reason. Help? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2017-01-10T19:56:49.413" Title="Smartparens strict mode C-w kill line if no active region" Tags="|smartparens|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28545" PostTypeId="1" AcceptedAnswerId="28564" CreationDate="2016-11-08T23:05:08.747" Score="2" ViewCount="868" Body="&lt;p&gt;I want to transform some of the opening and closing tags in an html document to other tags. That is I would like to transform&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;div class='foo'&amp;gt; This is some text. &amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &amp;lt;p&amp;gt; This is some text &amp;lt;/p&amp;gt;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to find and replace matching html tags?&lt;/p&gt;&#xA;" OwnerUserId="8338" LastEditorUserId="10" LastEditDate="2016-11-09T07:21:43.833" LastActivityDate="2016-11-10T00:21:46.533" Title="Find and replace matching html tags" Tags="|html|replace|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28546" PostTypeId="2" ParentId="15197" CreationDate="2016-11-08T23:25:30.513" Score="2" Body="&lt;p&gt;If you're running a Magit version newer than 2.8 (the relevant commit was on 2016-10-10), you can customize the user option &lt;code&gt;magit-no-confirm-default&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add &lt;code&gt;magit-branch-and-checkout&lt;/code&gt; to that list, then when you use &lt;kbd&gt;b&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt; you will only need to enter the new branch name, and Magit will use the default start point without prompting you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;n.b. That default start point is contextual! The prompt for the new branch will indicate what the start point will be.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. If you are viewing a Magit Log or Magit Refs buffer, the start point would reflect the ref at point, rather than the branch you currently have checked out.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2016-11-09T00:14:46.263" LastActivityDate="2016-11-09T00:14:46.263" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28547" PostTypeId="2" ParentId="28439" CreationDate="2016-11-08T23:38:19.160" Score="2" Body="&lt;p&gt;Add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'saveplace)&#xA;(setq-default save-place t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;saveplace.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Automatically save place in files, so that visiting them later&#xA;;; (even during a different Emacs session) automatically moves point&#xA;;; to the saved position, when the file is first found.  Uses the&#xA;;; value of buffer-local variable save-place to determine whether to&#xA;;; save position or not.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12184" LastActivityDate="2016-11-08T23:38:19.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28548" PostTypeId="1" AcceptedAnswerId="28565" CreationDate="2016-11-08T23:40:58.193" Score="5" ViewCount="2865" Body="&lt;p&gt;I've got an org file that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Project Cats&#xA;** Get them&#xA;*** TODO Find a tabby&#xA;*** DONE Find one that's orange&#xA;    CLOSED: [2016-11-08 Tue 15:32]&#xA;** Feed them&#xA;*** DONE Buy some food&#xA;    CLOSED: [2016-11-08 Tue 15:32]&#xA;*** TODO Put it in bowls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a command that, with my cursor on the top headline, will archive everything marked as DONE that's a descendant? After running such a command, I'd expect to see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Project Cats&#xA;** Get them&#xA;*** TODO Find a tabby&#xA;** Feed them&#xA;*** TODO Put it in bowls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6852" LastEditorUserId="2274" LastEditDate="2016-11-10T02:23:33.207" LastActivityDate="2022-11-17T05:42:15.303" Title="How to archive all completed tasks under a headline?" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28549" PostTypeId="2" ParentId="28389" CreationDate="2016-11-08T23:58:52.400" Score="1" Body="&lt;p&gt;The solution is to disable syntactical highlighting.  Even though the regular expression suggested by Drew and the function that I originally had used only match a single line string, the syntax table will find multi-line strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable this, you need to set &lt;code&gt;font-lock-keywords-only&lt;/code&gt; in the buffer.  The way to do this that works is as the second element of &lt;code&gt;font-lock-defaults&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-log-file-mode-font-lock-defaults&#xA;  `((&#xA;     (&quot;\\[WARN *\\].*&quot; . font-lock-warning-face)&#xA;     (&quot;\\[ERROR *\\].*&quot; . 'my-error-face)&#xA;     (my--one-line-string-p . font-lock-string-face)&#xA;     (&quot;{[^}&#xA;]+}&quot; . font-lock-builtin-face)&#xA;     (&quot;\\[akka://[^]]+\\]&quot; . font-lock-doc-face)&#xA;     (&quot;\\([a-zA-Z0-9]+\\)=\\([-a-zA-Z0-9:]+\\)&quot;&#xA;      (1 font-lock-variable-name-face)&#xA;      (2 font-lock-constant-face))&#xA;     )&#xA;     t ;; &amp;lt;---- This is the addition&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13881" LastActivityDate="2016-11-08T23:58:52.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28550" PostTypeId="2" ParentId="28534" CreationDate="2016-11-09T01:54:26.873" Score="4" Body="&lt;p&gt;This behavior is based on &lt;code&gt;ffap-string-at-point-mode-alist&lt;/code&gt;. Take a look at the current value and doc string. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll see an entry like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(file &quot;--:\\\\${}+&amp;lt;&amp;gt;@-Z_[:alpha:]~*?&quot; &quot;&amp;lt;@&quot; &quot;@&amp;gt;;.,!:&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The format here is (MODE CHARS BEG END) where CHARS are characters to include and BEG and END are characters to drop from the beginning and end. Notice that &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; are included as valid characters but also dropped at the beginning/end, which is why you're getting the seemingly odd match &lt;code&gt;&amp;gt;my-file.ext&amp;lt;/include&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possible fix: add a new entry for XML files that does not include &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; in the set of valid chars:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'ffap-string-at-point-mode-alist&#xA;         '(nxml-mode &quot;--:\\\\${}+@-Z_[:alpha:]~*?&quot; &quot;&amp;lt;@&quot; &quot;@&amp;gt;;.,!:&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-11-09T01:54:26.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28551" PostTypeId="1" AcceptedAnswerId="28552" CreationDate="2016-11-09T02:15:46.543" Score="3" ViewCount="949" Body="&lt;p&gt;I need a hydra with four &quot;heads&quot;, each of should exit the hydra when its function is executed.&#xA;The hydra intended to be used in &lt;code&gt;dired-mode&lt;/code&gt; and &lt;code&gt;direx:direx-mode&lt;/code&gt; and pop-up when &lt;code&gt;O&lt;/code&gt; pressed. This is what I got so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defhydra dired-open (dired-mode-map &quot;O&quot; :exit t)&#xA;        &quot;dired-open&quot;&#xA;        (&quot;j&quot; dired-find-file-other-window-below &quot;below&quot;)&#xA;        (&quot;k&quot; dired-find-file-other-window-above &quot;above&quot;)&#xA;        (&quot;h&quot; dired-find-file-other-windowd-left &quot;left&quot;)&#xA;        (&quot;l&quot; dired-find-file-other-window-right &quot;left”))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it kinda works, but: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;it's a bit ugly - I would like to learn how to make &quot;proper&quot; hydras, like in magit&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it works only &lt;code&gt;dired&lt;/code&gt; mode, I don't know how to properly bind it for both modes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;upd: apparently Spacemacs has builtin function for introducing transient states. I'm gonna add Spacemacs tag, since I'm using it&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="8992" LastEditDate="2016-11-09T02:26:35.830" LastActivityDate="2016-11-09T03:40:02.860" Title="Little help with a hydra" Tags="|spacemacs|hydra|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28552" PostTypeId="2" ParentId="28551" CreationDate="2016-11-09T03:40:02.860" Score="3" Body="&lt;p&gt;Oh. wow. Spacemacs's &lt;code&gt;define-transient-state&lt;/code&gt; is really nice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spacemacs|define-transient-state dired-open-item-other-window&#xA;  :title &quot;Open item in other window&quot;&#xA;  :doc&#xA;  &quot;\n[_j_/_k_] down/up [_h_/_l_] left/right [_q_] quit&quot;&#xA;  :bindings&#xA;  (&quot;j&quot; dired-find-file-other-window-below :exit t)&#xA;  (&quot;k&quot; dired-find-file-other-window-above :exit t)&#xA;  (&quot;h&quot; dired-find-file-other-window-left :exit t)&#xA;  (&quot;l&quot; dired-find-file-other-window-right :exit t)&#xA;  (&quot;q&quot; nil :exit t))&#xA;&#xA;(evil-define-key 'normal dired-mode-map &quot;O&quot;&#xA;   'spacemacs/dired-open-item-other-window-transient-state/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8992" LastActivityDate="2016-11-09T03:40:02.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28553" PostTypeId="2" ParentId="28424" CreationDate="2016-11-09T07:29:07.347" Score="5" Body="&lt;p&gt;OK, I'll try an expanded answer. The thing is, Emacs Lisp is single-threaded. You can spin more processes, but not inside the Emacs Lisp interpreter.  However, the keyboard input that you need to read from user to interrupt your function needs to be processed by the same Emacs Lisp interpreter. This means that if your interpreter is stuck interpreting some Lisp code there may not be a way for you to interrupt it from within.  Here's a place in the manual that describes this situation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At the level of C code, quitting cannot happen just anywhere; only at the special places that check quit-flag. The reason for this is that quitting at other places might leave an inconsistency in Emacs’s internal state. Because quitting is delayed until a safe place, quitting cannot make Emacs crash. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Quitting.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Quitting.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how Emacs still has the &lt;kbd&gt;C-g&lt;/kbd&gt; / canceling functionality?--There are timers and functions which do I/O (wait for events in command loop). Timers can arrange for your computations to be done in chunks, so that you would have points in your computations where you can look around and, if necessary, prevent all further computations.  I/O functions can send &lt;code&gt;quit&lt;/code&gt; signal.  The macro &lt;code&gt;with-keyboard-quit&lt;/code&gt; waits for this signal and once received will exit gracefully. However, your function needs to know to send this signal.  This means that if your function prevents the user from sending keyboard input, then you will not be able to benefit from keyboard interrupts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: try wrapping your function's code into &lt;code&gt;while-no-input&lt;/code&gt;.  If this doesn't work, try rewriting your function in a way that it will let Emacs process keyboard events.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2016-11-09T07:29:07.347" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28554" PostTypeId="2" ParentId="28165" CreationDate="2016-11-09T09:14:01.427" Score="1" Body="&lt;p&gt;The problem is solved after specifying distribution as base instead of the default one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-distribution 'spacemacs-base&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem occurs because of the layer spacemacs-ui-visual, but by disabling it, cannot see the spaceline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further investigation has shown that the package conflicting with sr-speedbar is the package &lt;code&gt;popwin&lt;/code&gt;, so exclude this package in .spacemacs would solve the problem and can still use spaceline.&lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="13594" LastEditDate="2016-11-16T17:08:03.847" LastActivityDate="2016-11-16T17:08:03.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28555" PostTypeId="1" CreationDate="2016-11-09T10:04:23.770" Score="1" ViewCount="215" Body="&lt;p&gt;I am using Emacs 24.3.1. on Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying use compile in emacs: (&lt;code&gt;M-x compile&lt;/code&gt;), I choose my Makefile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It answered me &lt;code&gt;-*- mode: compilation; default-directory:&quot;path&quot; -*-&#xA;Compilation started at Wed Nov  9 10:48:00.&lt;/code&gt; status is &lt;code&gt;Compilation:run&lt;/code&gt;, I wait, wait and it will never say nothing more. To leave this process I must kill it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;em&gt;Process List&lt;/em&gt;:&#xA;compilation     run     &lt;em&gt;compilation&lt;/em&gt;   /dev/pts/14  /bin/csh -c make -f ../Makefile &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run it from terminal everything works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did one test more I run grep function (&lt;code&gt;M-x&lt;/code&gt;) &lt;code&gt;grep -nH all &quot;main&quot; ./*&lt;/code&gt; . It is the same problem. &lt;code&gt;Grep:run Compiling&lt;/code&gt; but I don’t have any results and a &lt;code&gt;grep&lt;/code&gt; process is running. To leave this window again I must kill it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I sure that any packages don’t have impact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did someone have similar problem? Can you share how to repair it? &lt;/p&gt;&#xA;" OwnerUserId="13092" LastEditorUserId="13092" LastEditDate="2016-11-09T13:38:15.330" LastActivityDate="2016-11-13T18:47:04.233" Title="Compilation problem in Emacs," Tags="|compilation|compilation-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28556" PostTypeId="2" ParentId="28424" CreationDate="2016-11-09T10:21:28.053" Score="3" Body="&lt;p&gt;I would go with &lt;code&gt;input-pending-t&lt;/code&gt;. From the docs:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(input-pending-p &amp;amp;optional CHECK-TIMERS)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return t if command input is currently available with no wait.&#xA;  Actually, the value is nil only if we can be sure that no input is&#xA;  available; if there is a doubt, the value is t.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A quick example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  ;; I put this into a progn call so you can call it direcly from Emacs&#xA;  ;; if you are using the sx package&#xA;  (message &quot;Try pressing a key in the next 2 seconds!&quot;)&#xA;  (sleep-for 2)&#xA;  (message (if (input-pending-p)&#xA;               &quot;There is input waiting!&quot;&#xA;             &quot;No input, let’s move on!&quot;))&#xA;  (sleep-for 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="507" LastActivityDate="2016-11-09T10:21:28.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28557" PostTypeId="1" CreationDate="2016-11-09T10:52:36.300" Score="3" ViewCount="280" Body="&lt;p&gt;The package &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;ivy-mode&quot;&gt;ivy-mode&lt;/a&gt; has the function &lt;code&gt;ivy-switch-buffer&lt;/code&gt;, which&#xA;use the build in variable &lt;code&gt;bookmark-alist&lt;/code&gt; to incorporate bookmarks to its options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the package &lt;a href=&quot;https://github.com/joodland/bm&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;bm&quot;&gt;bm&lt;/a&gt; to store my bookmarks, which use the file in the varaible &lt;code&gt;bm-repository-file&lt;/code&gt; to save the bookmarks permanently.&#xA;I really like this package because it's simple to configure and use,&#xA;but the variable &lt;code&gt;bookmark-alist&lt;/code&gt; has always nil value and &lt;code&gt;ivy-switch-buffer&lt;/code&gt;doesn't show my bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code &lt;code&gt;(bookmark-load bm-repository-file)&lt;/code&gt; load the bookmarks from the field &lt;code&gt;bm-repository-file&lt;/code&gt; to the variable &lt;code&gt;bookmark-alist&lt;/code&gt;, but it says that the &lt;code&gt;bm-repository-file&lt;/code&gt; is not in the &quot;standard form&quot;&#xA;(The function &lt;code&gt;bookmark-load&lt;/code&gt;is in the package bookmark+).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could &lt;code&gt;bookmark-alist&lt;/code&gt; be synchronized with &lt;code&gt;bm-repository-file&lt;/code&gt;? &#xA;or, if they can not be synchronized, is there a function that transform the file &lt;code&gt;bm-repository-file&lt;/code&gt; into such &quot;standard form&quot;?&lt;/p&gt;&#xA;" OwnerUserId="12156" LastEditorUserId="12156" LastEditDate="2016-11-09T16:32:32.520" LastActivityDate="2017-01-08T19:52:59.767" Title="Compatibility with the function (ivy-switch-buffer) of ivy-mode and bm (a bookmark package)" Tags="|bookmarks|ivy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28558" PostTypeId="2" ParentId="28435" CreationDate="2016-11-09T14:42:51.440" Score="2" Body="&lt;p&gt;My solution:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Tag items 'winter', 'weekends', 'schoolnights', etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Make sure each of these tags has an associated speed-key in &lt;code&gt;org-tag-alist&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Write a predicate for each tag that tells you if it is &lt;em&gt;not&lt;/em&gt; current: &lt;code&gt;not-winter-p&lt;/code&gt; (returning non-nil between April and November in the northern hemisphere), &lt;code&gt;weekdayp&lt;/code&gt;, &lt;code&gt;not-schoolnight-p&lt;/code&gt;, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Put it all together in your own agenda command:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(Ah-ha! Discovered I have to put non-numbered-list  text here to make following code appear properly formatted)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ph/agenda ()&#xA;  &quot;Display my agenda.&quot;&#xA;  (interactive)&#xA;  (org-agenda-list)&#xA;  (cl-loop&#xA;    for (predicate . speed-key)&#xA;    in&#xA;    '((weekendp . ?\[)&#xA;      (winterp . ?\])&#xA;      (not-schoolday-p . ?\{)&#xA;      (not-schoolnight-p . ?\}))&#xA;    when (funcall predicate)&#xA;    do (org-agenda-filter-by-tag nil speed-key 'exclude)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12184" LastEditorUserId="12184" LastEditDate="2016-11-09T17:52:19.533" LastActivityDate="2016-11-09T17:52:19.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28559" PostTypeId="1" AcceptedAnswerId="28560" CreationDate="2016-11-09T15:32:51.737" Score="8" ViewCount="8558" Body="&lt;p&gt;In org-mode is it possible to generate a table, where there is a column which contains a value computed from values in the other columns and which contains the sum of these values?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, at the moment I have a table with seven columns, where the last two columns contain values computed from values in the other columns using the following formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TBLFM: $6=$4-$3;t::$7=$4-$3-$2;t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to include the sum of the last column.  Is this possible? If yes, how can this be achieved? When I tried to do this I always got zero. Ideally I would like to have the sum somewhere outside of the table or in the last row (even if I add new rows).&lt;/p&gt;&#xA;" OwnerUserId="10405" LastActivityDate="2020-05-05T19:56:40.803" Title="How to have the sum of a column (with computed data) in the first row?" Tags="|org-mode|org-table|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28560" PostTypeId="2" ParentId="28559" CreationDate="2016-11-09T16:40:11.713" Score="8" Body="&lt;p&gt;You should use cell formulas (prefixed by &lt;code&gt;:=&lt;/code&gt; instead of &lt;code&gt;=&lt;/code&gt;) for your results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example below gives the sum of the last column both at the first and the last rows.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|      |      | 8   |&#xA;| Col1 | Col2 | Sum |&#xA;|------+------+-----|&#xA;| 1    | 3    | 4   |&#xA;| 2    | 8    | 10  |&#xA;| 3    | -9   | -6  |&#xA;|------+------+-----|&#xA;|      |      | 8   |&#xA;#+TBLFM: $3=$1+$2::@1$3=vsum(@I..@II)::@6$3=vsum(@I..@II)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;vsum&lt;/code&gt; sums a vector of numbers; &lt;code&gt;@I&lt;/code&gt; and &lt;code&gt;@II&lt;/code&gt; refer to the first and second hlines.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-11-09T16:40:11.713" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28561" PostTypeId="2" ParentId="28557" CreationDate="2016-11-09T18:32:58.107" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bookmark+&lt;/a&gt; uses the vanilla Emacs standard form of bookmarks. It can also use additional kinds of bookmarks that it defines (or that you define), but they are still based on the same overall bookmark-list structure of vanilla Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Library &lt;code&gt;bm.el&lt;/code&gt; does not - its &quot;bookmarks&quot; are overlays, and they are not at all compatible with Bookmark+ bookmarks (including the ordinary bookmarks of vanilla Emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, Bookmark+ can do everything that &lt;code&gt;bm.el&lt;/code&gt; does, and more. And it is not difficult to &quot;configure&quot; it to have behavior similar to that of &lt;code&gt;bm.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In sum:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want to stick with &lt;code&gt;bm.el&lt;/code&gt; then you cannot use its bookmarks in a bookmarks file expected by Bookmark+ or vanilla Emacs. If &lt;code&gt;ivy-mode&lt;/code&gt; requires using such  bookmarks then you will need to find a way to make it accept &lt;code&gt;bm.el&lt;/code&gt; bookmarks instead.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you instead want to use Bookmark+ bookmarks then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If &lt;code&gt;ivy-mode&lt;/code&gt; works with vanilla Emacs bookmarks then it will &lt;em&gt;likely&lt;/em&gt; work with any bookmarks that Bookmark+ creates and uses.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can configure Bookmark+ to have your bookmarks to behave similarly to &lt;code&gt;bm.el&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-09T18:32:58.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28562" PostTypeId="1" CreationDate="2016-11-09T19:18:16.907" Score="1" ViewCount="183" Body="&lt;p&gt;When I'm editing source code contained in an org file, I use &lt;kbd&gt;C-c '&lt;/kbd&gt; to call &lt;code&gt;#'org-edit-special&lt;/code&gt;, which &lt;a href=&quot;http://orgmode.org/manual/Editing-source-code.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;opens up a new buffer&lt;/a&gt; to edit that block in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this block, I'll often save (with &lt;kbd&gt;C-x C-s&lt;/kbd&gt;), which will both move the changes to the original org file, and save that file. At this point, the org file is not marked as edited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I exit that new buffer (&lt;kbd&gt;C-c '&lt;/kbd&gt; again), the original org buffer is marked as edited, even though I saved it right before exiting the org-edit-special buffer. How can I make it not do this?&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-11-09T19:18:16.907" Title="When exiting an org-src block, it always marks the buffer as edited" Tags="|org-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28563" PostTypeId="1" CreationDate="2016-11-09T21:34:22.863" Score="2" ViewCount="1170" Body="&lt;p&gt;I am experiencing font issues for a few specific characters, namely the &quot;SYMBOL FOR …&quot; family, which are textual representations of control characters such as NUL, BEL, BS, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ra8gH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ra8gH.png&quot; alt=&quot;While the symbols on the left are cute, I&amp;#39;d rather have those on the right&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This screenshot shows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;on the left, &lt;code&gt;emacs -Q&lt;/code&gt;, with completion candidates for &lt;code&gt;C-x 8 RET SYMBOL FOR&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;on the right, a Terminator console running Python, displaying some of the same characters.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Not shown: a file containing some of these characters, opened with the Geany text editor. Geany displays the same glyphs as Terminator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the symbols on the left are rather cute, I would rather have Emacs show the same glyphs as Terminator and Geany. I have no idea of what causes this though. Terminator and Geany both use the Monospace font, but customizing Emacs's &lt;code&gt;default&lt;/code&gt; face to Monospace does not change the situation. I do not know yet whether the issue comes from:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;my system (font cache, what have you);&lt;/li&gt;&#xA;&lt;li&gt;my Emacs configuration (unlikely, since &lt;code&gt;-Q&lt;/code&gt; includes &lt;code&gt;--no-init-file --no-site-file&lt;/code&gt;);&lt;/li&gt;&#xA;&lt;li&gt;the Emacs software.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-u C-x =&lt;/code&gt; on e.g. SYMBOL FOR NULL has this to say about the character:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             position: 146 of 151 (96%), column: 0&#xA;            character: ␀ (displayed as ␀) (codepoint 9216, #o22000, #x2400)&#xA;    preferred charset: unicode (Unicode (ISO10646))&#xA;code point in charset: 0x2400&#xA;               script: symbol&#xA;               syntax: _    which means: symbol&#xA;             category: .:Base, c:Chinese&#xA;             to input: type &quot;C-x 8 RET 2400&quot; or &quot;C-x 8 RET SYMBOL FOR NULL&quot;&#xA;          buffer code: #xE2 #x90 #x80&#xA;            file code: #xE2 #x90 #x80 (encoded by coding system utf-8-unix)&#xA;              display: by this font (glyph code)&#xA;    xft:-unknown-Symbola-normal-normal-semicondensed-*-15-*-*-*-*-0-iso10646-1 (#x77D)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: SYMBOL FOR NULL&#xA;  old-name: GRAPHIC FOR NULL&#xA;  general-category: So (Symbol, Other)&#xA;  decomposition: (9216) ('␀')&#xA;&#xA;There are text properties here:&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;emacs -nw&lt;/code&gt; is unaffected, i.e. the characters on the right side of the screenshot are shown. I guess Terminator takes care of font selection in this case? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any input on the subject. I do not know whether this warrants a bug report, since for all I know my whole setup is working &quot;as intended&quot; for some value of &quot;intended&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version: GNU Emacs 25.1.1 (i686-pc-linux-gnu, GTK+ Version 3.14.5)&lt;br&gt;&#xA;Terminator version: terminator 0.97&lt;br&gt;&#xA;Python version: Python 3.4.2&lt;br&gt;&#xA;Geany version: geany 1.24.1 (built on 2014-04-19 with GTK 2.24.23, GLib 2.40.0)&lt;br&gt;&#xA;OS: BunsenLabs GNU/Linux 8.5 (Hydrogen) (essentially Debian Jessie)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I tried to reproduce on a Xubuntu 14.04 machine, and saw intricate glyphs composed of a square box, featuring the acronym (e.g. NUL, BS) in the bottom half and the weird symbol (e.g. heart, spades) in the top-right corner (could not take a screenshot unfortunately).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS2: now that I've copy-pasted the above code-block in Firefox (49.0), I can also add that Firefox uses the same glyph than Terminator and Geany.&lt;/p&gt;&#xA;" OwnerUserId="10209" LastEditorUserId="25" LastEditDate="2016-11-09T23:14:00.980" LastActivityDate="2016-11-10T03:55:35.480" Title="Surprising glyphs for some characters" Tags="|fonts|unicode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28564" PostTypeId="2" ParentId="28545" CreationDate="2016-11-10T00:21:46.533" Score="2" Body="&lt;p&gt;Using &lt;code&gt;nxml-mode&lt;/code&gt;, first customize &lt;code&gt;nxml-sexp-element-mode&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. Then normal Emacs commands like &lt;code&gt;forward-sexp&lt;/code&gt;, &lt;code&gt;backward-sexp&lt;/code&gt;, and &lt;code&gt;kill-sexp&lt;/code&gt; will work on elements, not just start or end tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with &lt;code&gt;&quot;|&amp;lt;div class='foo'&amp;gt; This is some text. &amp;lt;/div&amp;gt;&quot;&lt;/code&gt; (where the | illustrates the cursor position), doing &lt;code&gt;C-M-d C-M-k C-M-u C-M-k &amp;lt;p C-c C-i C-y M-y&lt;/code&gt; will replace the div with a paragraph. That's quite easy to record as a keyboard macro, although of course it'll only ever replace the tag after point with a paragraph; if you want more flexibility you'll have to write a function that prompts for the new tag to insert first.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-11-10T00:21:46.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28565" PostTypeId="2" ParentId="28548" CreationDate="2016-11-10T02:28:33.497" Score="4" Body="&lt;p&gt;I don't know of a single command, but the following sequence accomplishes this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c a&lt;/code&gt; to look at the agenda&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;&amp;lt; &amp;lt;&lt;/code&gt; to restrict the agenda to the buffer and then to the current sub-tree&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M DONE&lt;/code&gt; to show everything matching a TODO keyword (search for &lt;code&gt;DONE&lt;/code&gt; items in the current sub-tree)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;*&lt;/code&gt; to mark everything in the agenda (all &lt;code&gt;DONE&lt;/code&gt; items in the current subtree).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;B $&lt;/code&gt; to bulk archive everything you marked (i.e. everything)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-11-10T02:28:33.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28566" PostTypeId="2" ParentId="28563" CreationDate="2016-11-10T03:55:35.480" Score="6" Body="&lt;p&gt;Fonts are harder than they look, in general. If you look at the details you pasted from Emacs you'll see that it actually used Symbola, not Monospace, to render that character. Probably the Monospace font didn't have any glyph for that character, and it had to go find a different font for it. Luckily you can tell Emacs which font to fall back to for a character range. You'll want to use the &lt;code&gt;set-fontset-font&lt;/code&gt; command, as described in the answer to this previous question: &lt;a href=&quot;https://stackoverflow.com/questions/6083496/how-do-you-specify-a-fallback-font-in-emacs&quot;&gt;https://stackoverflow.com/questions/6083496/how-do-you-specify-a-fallback-font-in-emacs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more details, check out sections 22.13 through 22.16, and section 14.19, of the Emacs manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, and when you run Emacs inside of a terminal of any kind, Emacs loses all control of what fonts get used; the terminal renders all text in that case.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-11-10T03:55:35.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28567" PostTypeId="1" AcceptedAnswerId="28574" CreationDate="2016-11-10T06:04:16.123" Score="1" ViewCount="4008" Body="&lt;p&gt;I am trying to write  emacs init using Org-mode By using &lt;strong&gt;org-babel-load-file&lt;/strong&gt; function in &lt;strong&gt;init.el&lt;/strong&gt;. My init.el file is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives    &#xA;         '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)&#xA;         '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;)&#xA;         )&#xA;(package-initialize)&#xA;(unless (package-installed-p 'use-package)&#xA;(package-refresh-contents)&#xA;(package-install 'use-package))&#xA;(org-babel-load-file (expand-file-name &quot;settings.org&quot;&#xA;                   user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But on using so I am getting the following error message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  expand-file-name(nil)&#xA;  load-file(nil)&#xA;  org-babel-load-file(&quot;/home/nithin/.emacs.d/settings.org&quot;)&#xA;  eval((org-babel-load-file (expand-file-name &quot;settings.org&quot; user-emacs-directory)) nil)&#xA;  eval-last-sexp-1(nil)&#xA;  eval-last-sexp(nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any input on the subject.&lt;/p&gt;&#xA;" OwnerUserId="9145" LastEditorUserId="105" LastEditDate="2016-11-10T17:03:45.513" LastActivityDate="2019-06-30T20:09:02.120" Title="Error on using org-babel-load-file" Tags="|org-mode|init-file|org-babel|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28568" PostTypeId="1" AcceptedAnswerId="28569" CreationDate="2016-11-10T06:16:40.633" Score="1" ViewCount="616" Body="&lt;p&gt;How do I start emacs with a command and its option, for example, I want emacs start with entering gdb mi mode, otherwise it does not go to the gdb mode during startup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs gdb&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or using evaluate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs gdb -e gdb&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I want to enter the mi mode and this does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs gdb -i=mi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -e gdb -i=mi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I just want to enter mi mode directly during startup.&lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="13594" LastEditDate="2016-11-10T07:00:41.430" LastActivityDate="2021-04-04T05:10:40.663" Title="Start Emacs with entering gdb mi mode (NOT after startup and enter gdb mi manually)" Tags="|start-up|gdb|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28569" PostTypeId="2" ParentId="28568" CreationDate="2016-11-10T07:13:36.517" Score="1" Body="&lt;p&gt;The following works:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &amp;quot;(gdb \&amp;quot;gdb -i=mi\&amp;quot;)&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="591" LastEditDate="2021-04-04T05:10:40.663" LastActivityDate="2021-04-04T05:10:40.663" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="28571" PostTypeId="2" ParentId="2671" CreationDate="2016-11-10T08:11:37.280" Score="2" Body="&lt;p&gt;if you use &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ivy&lt;/code&gt;&lt;/a&gt;,in the recent updates &lt;code&gt;ivy&lt;/code&gt; supports completion at point functionality in an overlay. Ivy supports fuzzy matching with the help of &lt;a href=&quot;https://github.com/lewang/flx&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;flx&lt;/code&gt;&lt;/a&gt;. Checkout &lt;a href=&quot;https://www.youtube.com/watch?v=oMQFqqZeorc&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; video on how it works :) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All you got to do is, press the key binding for &lt;code&gt;complete-symbol&lt;/code&gt; which is by default bound to &lt;kbd&gt;C-M-i&lt;/kbd&gt; and an overlay will pop up and you use fuzzy matching to get the completion candidate.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-11-10T08:11:37.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28572" PostTypeId="1" CreationDate="2016-11-10T08:53:48.193" Score="6" ViewCount="593" Body="&lt;p&gt;Currently, I've experienced some strange behavior of latex labelling of org-mode exported file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally, I use the label style like &lt;code&gt;#+NAME: fig:name&lt;/code&gt; for figure and table labelling, which corresponds to the label in the LaTeX file as &lt;code&gt;\label{fig:name}&lt;/code&gt;, and works fine with the &lt;code&gt;org-ref&lt;/code&gt; reference style &lt;code&gt;[[ref:fig:name]]&lt;/code&gt;. The sections I do not intentionally label will be added a label like &lt;code&gt;\label{sec:1}&lt;/code&gt; in LaTeX file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I found sometimes the org-mode exported file will generate a different label style like &lt;code&gt;\label{sec:org76fd1b6}}&lt;/code&gt;, and the &lt;code&gt;#+NAME:&lt;/code&gt; tag is not correctly translated to the label I want. Indeed, putting something like &lt;code&gt;#+CAPTION: label:fig:name XXXX&lt;/code&gt; still works, but looks much uglier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: &lt;strong&gt;how is such behavior invoked and how to avoid it?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tested system: OS X 10.11, Emacs 25.1, org-mode 20161102 and org-ref 20161101&lt;/p&gt;&#xA;" OwnerUserId="13790" LastEditorUserId="8431" LastEditDate="2018-01-14T11:06:17.403" LastActivityDate="2018-03-15T12:15:21.910" Title="Strange behavior Org-mode latex export label" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28573" PostTypeId="2" ParentId="28555" CreationDate="2016-11-10T10:37:39.310" Score="1" Body="&lt;p&gt;Ok, I solve this problem. I will share the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before I had problem, I start my shell with &lt;code&gt;csh&lt;/code&gt; but I would start in &lt;code&gt;bash&lt;/code&gt;.&#xA;So I added line with &lt;code&gt;bash&lt;/code&gt; in my &lt;code&gt;.cshrs&lt;/code&gt; to change it automatically each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was big conflict, I don't understand why but I found it based on advice of &lt;code&gt;@icarus&lt;/code&gt;. Thank you very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally I edit &lt;code&gt;etc/passwd&lt;/code&gt; to change it using &lt;code&gt;chsh&lt;/code&gt; , I found it as better solution.&#xA;Compilation works right now, thanks. Good luck. &lt;/p&gt;&#xA;" OwnerUserId="13092" LastEditorUserId="13092" LastEditDate="2016-11-13T18:47:04.233" LastActivityDate="2016-11-13T18:47:04.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28574" PostTypeId="2" ParentId="28567" CreationDate="2016-11-10T12:14:11.520" Score="2" Body="&lt;p&gt;As hinted by &lt;code&gt;org-babel-load-file&lt;/code&gt; docstring (&lt;code&gt;C-h f&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Load Emacs Lisp source code blocks in the Org-mode FILE.&#xA;  This function exports the source code using &lt;code&gt;org-babel-tangle&lt;/code&gt;&#xA;  and then loads the resulting file using &lt;code&gt;load-file&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your stack trace suggests there's a problem with the tangling (&lt;code&gt;load-file&lt;/code&gt; is provided a &lt;code&gt;nil&lt;/code&gt; arg as the file name).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Src blocks are &lt;a href=&quot;http://orgmode.org/manual/Extracting-source-code.html#Extracting-source-code&quot; rel=&quot;nofollow noreferrer&quot;&gt;tangled according to their header argument&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Header arguments&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;:tangle no&lt;/strong&gt;&#xA;      The default. The code block is not included in the tangled output.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;:tangle yes&lt;/strong&gt;&#xA;      Include the code block in the tangled output. The output file name is the name of the org file with the extension ‘.org’ replaced by the extension for the block language.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;:tangle filename&lt;/strong&gt;&#xA;      Include the code block in the tangled output to file ‘filename’. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you could add a &lt;code&gt;:tangle yes&lt;/code&gt; header arg to the source blocks in file &lt;code&gt;settings.org&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-11-10T12:14:11.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28575" PostTypeId="1" AcceptedAnswerId="41823" CreationDate="2016-11-10T12:57:35.907" Score="1" ViewCount="861" Body="&lt;p&gt;I have two IMAP accounts, I'd like to see all my IMAP folders for both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With only one account I use &quot;%/&quot; in my .folders file and it works well (but I have the &lt;code&gt;(setq elmo-imap4-default-server ...&lt;/code&gt; &amp;amp; co. in my .emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With two accounts I cannot make it work. &#xA;I think the problem is that I'm not able to specify credentials for the two &quot;%/&quot;.&#xA;Is there a solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example ~/.folders:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AccountA {&#xA;    %INBOX:username/clear@imap.serverA.com:993!        &quot;Inbox&quot;&#xA;    %/&#xA;}&#xA;AccountB {&#xA;    %INBOX:username/clear@imap.serverB.com:993!        &quot;Inbox&quot;&#xA;    %/&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13945" LastEditorUserId="13945" LastEditDate="2016-11-10T13:04:57.717" LastActivityDate="2018-06-12T13:44:32.780" Title="All the IMAP folders of multiple accounts in wanderlust" Tags="|imap|wanderlust|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28576" PostTypeId="1" AcceptedAnswerId="28582" CreationDate="2016-11-10T13:03:51.910" Score="6" ViewCount="349" Body="&lt;p&gt;Emacs' source code contains multiple instances of using &lt;code&gt;fset&lt;/code&gt; with a keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in ediff-util.el:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Allow ediff-mode-map to be referenced indirectly&#xA;(fset 'ediff-mode-map ediff-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or in esh-mode.el:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(fset eshell-command-prefix (make-sparse-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or compile.el:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar compilation-button-map&#xA;  (let ((map (make-sparse-keymap)))&#xA;    (define-key map [mouse-2] 'compile-goto-error)&#xA;    (define-key map [follow-link] 'mouse-face)&#xA;    (define-key map &quot;\C-m&quot; 'compile-goto-error)&#xA;    map)&#xA;  &quot;Keymap for compilation-message buttons.&quot;)&#xA;(fset 'compilation-button-map compilation-button-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've found examples in third-party elisp projects too, such as projectile. I've looked at the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Keymaps.html#Creating-Keymaps&quot; rel=&quot;nofollow noreferrer&quot;&gt;creating keymaps&lt;/a&gt; documentation but I can't find anything relevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These values cannot even be called as functions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;ELISP&amp;gt; (compilation-button-map)&#xA;*** Eval error ***  Invalid function: compilation-button-map&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the purpose of setting the function slot of a symbol with a keymap? Where is it documented?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2016-11-10T17:02:54.483" LastActivityDate="2016-11-10T17:02:54.483" Title="When does Emacs treat keymaps as functions?" Tags="|key-bindings|keymap|prefix-keys|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28577" PostTypeId="1" CreationDate="2016-11-10T14:19:09.307" Score="3" ViewCount="445" Body="&lt;p&gt;I use the &lt;a href=&quot;http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;Misc-Fixed&lt;/code&gt;&lt;/a&gt; fonts because I enjoy non-antialiased fonts.  They are designed &lt;em&gt;per height&lt;/em&gt;, and tolerate shrinking badly.  For instance, in the following example, the default font is set to &lt;code&gt;9x15&lt;/code&gt; and the face used for the sub and superscript just indicates &lt;code&gt;(:height 0.8)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pUTBm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pUTBm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;—To be honest, I'm not even sure what Emacs is doing here, as it ends up using a serifed font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How can I make my fonts great again?  Many other faces are defined using an &lt;code&gt;height&lt;/code&gt; setting; I'd like to map, e.g., an height of &lt;code&gt;0.8&lt;/code&gt; to the font &lt;code&gt;8x13&lt;/code&gt;, an height of &lt;code&gt;0.6&lt;/code&gt; to &lt;code&gt;7x13&lt;/code&gt;, etc…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(On GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9) of 2016-09-18)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="13946" LastActivityDate="2016-11-10T14:19:09.307" Title="Misc-Fixed fonts and font height" Tags="|fonts|faces|linux|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28578" PostTypeId="1" AcceptedAnswerId="31153" CreationDate="2016-11-10T15:31:16.470" Score="5" ViewCount="1116" Body="&lt;p&gt;I'm having a hard time getting Emacs to build under CentOS 7.1 where I don't have admin rights to install dependencies.&#xA;After downloading Emacs sources I tried ./configure, and I found out that I was missing X libraries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I grabbed the gtk3-dev libraries from an rpm repository and extracted them with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rpm2cpio ../gtk3-devel-3.8.8-10.el7.x86_64.rpm | cpio -idv&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I tried both:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GTK_LIBS=-L$HOME/tmp/gtk3/usr/lib64/ ./configure \&#xA;--prefix=$HOME/Downloads/emacs-25.1/build-out --with-x-toolkit=gtk3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --x-includes=$HOME/tmp/gtk3/usr/include/ \ &#xA;--x-libraries=$HOME/tmp/gtk3/usr/lib64 --with-x-toolkit=gtk3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the configure script through other messages telling me that other gtk3 dependencies where missing, or that it couldn't find everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if anyone knows where to find a statically build Emacs 25 for centOS x86_64, or how to build Emacs without admin rights in such a way that all dependencies are handled and installed locally?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2018-07-04T00:01:36.050" Title="Building Emacs 25 on CentOS *without admin rights*" Tags="|build|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28579" PostTypeId="2" ParentId="28576" CreationDate="2016-11-10T16:06:57.477" Score="1" Body="&lt;p&gt;This was news to me. After doing some experiment it looks like it allows you to refer to a keymap &lt;em&gt;by name&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-test () (interactive) (message &quot;TEST TEST&quot;))&#xA;(defvar my-test-mode t)&#xA;(defvar my-test-map (make-sparse-keymap))&#xA;(define-key my-test-map (kbd &quot;C-c q&quot;) 'my-test)&#xA;(add-to-list 'minor-mode-map-alist '(my-test-mode . my-test-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you press &lt;code&gt;C-c q&lt;/code&gt;, Emacs informs that they binding is undefined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'my-test-map my-test-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, the key binding is working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;em&gt;guess&lt;/em&gt; is that when the key lookup code find a symbol it looks at its function definition. If that looks like a keymap it will use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You don't need to add a key binding &lt;em&gt;by name&lt;/em&gt;. The standard way to add a keymap is by value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'minor-mode-map-alist (cons 'my-test-mode . my-test-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will include the &lt;em&gt;value&lt;/em&gt; of &lt;code&gt;my-test-map&lt;/code&gt;. Since all functions binding keys destructively change the keymap, the change will take effect both in &lt;code&gt;my-test-map&lt;/code&gt; and &lt;code&gt;minor-mode-map-alist&lt;/code&gt;. The only drawback is that if you &lt;em&gt;reinitialize&lt;/em&gt; the keymap variable, the old value will still be in &lt;code&gt;minor-mode-map-alist&lt;/code&gt;. Effectively, it would appear as though new bindings wouldn't work.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-11-10T16:06:57.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28580" PostTypeId="2" ParentId="28491" CreationDate="2016-11-10T16:50:08.907" Score="2" Body="&lt;p&gt;This is only a partial solution, but the &lt;code&gt;dabbrev-expand&lt;/code&gt; method can be greatly improved by modifying the syntax table so that &lt;code&gt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&lt;/code&gt; are treated as delimiters:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?&amp;lt; &quot;(&amp;gt;&quot; org-mode-syntax-table)&#xA;(modify-syntax-entry ?&amp;gt; &quot;)&amp;lt;&quot; org-mode-syntax-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This means that you don't have to go back and insert a space before using &lt;code&gt;M-/&lt;/code&gt;, although you do still need to manually type the closing &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;.  And of course the completion candidates are not specifically restricted to noweb references.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should also mention that I haven't checked if hacking the syntax table in this way doesn't produce subtle breakage in other org-mode features, so use it at your own risk!&lt;/p&gt;&#xA;" OwnerUserId="1980" LastActivityDate="2016-11-10T16:50:08.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28581" PostTypeId="1" CreationDate="2016-11-10T17:00:38.173" Score="2" ViewCount="90" Body="&lt;p&gt;I have an idea where I have something like a FOCUS tag that I can apply to tasks that need special attention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I want to make it so that only 3 tasks can actually be tagged with FOCUS at a time. If I try to tag a fourth with FOCUS, I should just get an error. So in order to apply a FOCUS tag, the count of currently FOCUS-tagged tasks should be &amp;lt;3, otherwise I'll have to untag one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea on how to get started on doing this?&lt;/p&gt;&#xA;" OwnerUserId="12837" LastActivityDate="2016-11-10T23:13:03.270" Title="Org-mode: Limit the number of tasks to which a tag can be applied" Tags="|org-mode|org-tags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28582" PostTypeId="2" ParentId="28576" CreationDate="2016-11-10T17:02:05.857" Score="4" Body="&lt;p&gt;There's nothing new or unusual about this. This is how prefix keys work. They are bound to a keymap -- &lt;strong&gt;&lt;em&gt;or&lt;/em&gt;&lt;/strong&gt; they are bound to a symbol whose value &lt;strong&gt;&lt;em&gt;or&lt;/em&gt;&lt;/strong&gt; whose function definition is a keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Elisp manual node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Keys.html&quot; rel=&quot;noreferrer&quot;&gt;Prefix Keys&lt;/a&gt; tells you this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The keymap binding of a prefix key is used for looking up the event&#xA;  that follows the prefix key.  (&lt;strong&gt;&lt;em&gt;It may instead be a symbol whose function&#xA;  definition is a keymap.&lt;/em&gt;&lt;/strong&gt;  The effect is the same, but the symbol serves&#xA;  as a name for the prefix key.)  Thus, the binding of &lt;code&gt;C-x&lt;/code&gt; is the symbol&#xA;  &lt;code&gt;Control-X-prefix&lt;/code&gt;, whose function cell holds the keymap for &lt;code&gt;C-x&lt;/code&gt;&#xA;  commands.  (The same keymap is also the value of &lt;em&gt;[variable]&lt;/em&gt; &lt;code&gt;ctl-x-map&lt;/code&gt;.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-10T17:02:05.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28583" PostTypeId="1" CreationDate="2016-11-10T17:59:10.923" Score="4" ViewCount="682" Body="&lt;p&gt;I have &lt;code&gt;org-fontify-quote-and-verse-blocks&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt; and &lt;code&gt;'(org-block ((t (:foreground &quot;#2E8B57&quot;))))&lt;/code&gt; to make quote blocks stand out in a particular color. However, this also means that I cannot get markup like &lt;code&gt;/emphasis/&lt;/code&gt; or &lt;code&gt;*bold*&lt;/code&gt; to display properly in such a fontified quote block. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there a way to have both of these together? In other words, have fontified quote blocks that display in a particular color and have them display text according to its markup (i.e. &lt;code&gt;/emphasis/&lt;/code&gt; looks like &lt;em&gt;emphasis&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: On emacs 25.3.1 and org 9.1.3 this now works, though I'm not sure what the change was that allowed this to be so.&lt;/p&gt;&#xA;" OwnerUserId="11934" LastEditorUserId="11934" LastEditDate="2017-12-15T16:14:32.293" LastActivityDate="2018-08-12T22:00:58.170" Title="Fontify org quote blocks with font-locked markup" Tags="|org-mode|fonts|font-lock|quote|markup|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28584" PostTypeId="2" ParentId="28491" CreationDate="2016-11-10T18:31:03.057" Score="3" Body="&lt;p&gt;I think there is already a parser for src block names in &lt;code&gt;org-babel-src-block-names&lt;/code&gt; returning a list. The following provides programmed completion for that list:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-src-block-names--completion-function (str pred action)&#xA;  (let ((tbl (org-babel-src-block-names)))&#xA;    (pcase action&#xA;      (`nil (try-completion   str tbl pred))&#xA;      (`t   (all-completions  str tbl pred))&#xA;      (`metadata&#xA;       '(metadata (annotation-function . org-src-block-names--get-lang))))))&#xA;&#xA;(defun org-src-block-names--get-lang (lang)&#xA;  (concat &quot; &quot; (car-safe (org-babel-lob--src-info lang))))&#xA;&#xA;(defun org-src-block-names-completion-at-point-function ()&#xA;  (when (and (looking-back &quot;&amp;lt;&amp;lt;\\([-a-z]+\\)&quot;)&#xA;             (eq (org-element-type (org-element-at-point)) 'src-block))&#xA;    (list&#xA;     (match-beginning 1)&#xA;     (point)&#xA;     'org-src-block-names--completion-function&#xA;     :exclusive 'no&#xA;     :annotation-function 'org-src-block-names--get-lang)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:annotation-function&lt;/code&gt; property in the completion function is an extra property that the &lt;code&gt;company-capf&lt;/code&gt; backend for &lt;code&gt;company-mode&lt;/code&gt; uses to add some additional information (the src block's language in this case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To actually use it in your org buffer with the &lt;code&gt;completion-at-point&lt;/code&gt; command, you have to add the completion function to a special hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'completion-at-point-functions&#xA;          'org-src-block-names-completion-at-point-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-11-10T18:31:03.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28585" PostTypeId="1" CreationDate="2016-11-10T19:30:28.967" Score="5" ViewCount="978" Body="&lt;p&gt;I use org-mode with emacs heavily. On LINUX, everything is great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have to use windows emacs regularly freezes and I have to kill via task manager and restart.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how I can debug this? Or better yet how to stop it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="12294" LastEditorUserId="105" LastEditDate="2016-11-11T00:28:33.000" LastActivityDate="2020-09-02T01:45:25.640" Title="how to debug constant freezing with emacs org-mode on windows?" Tags="|org-mode|microsoft-windows|debugging|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28586" PostTypeId="2" ParentId="28581" CreationDate="2016-11-10T19:49:05.227" Score="1" Body="&lt;p&gt;The following concept draft idea will comb through the &lt;code&gt;org-agenda-files&lt;/code&gt; and gather all the tags that fall within ambit of regexp group 5 to &lt;code&gt;org-complex-heading-regexp&lt;/code&gt;, and then search through that list to find out how many matches of a particular tag.  The original poster may wish to perform a similar test when assigning a particular tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;USAGE&lt;/strong&gt;:  &lt;code&gt;(stop-or-go &quot;NAME_OF_TAG&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl) ;; for loop&#xA;(require 'org)&#xA;(require 'org-agenda)&#xA;&#xA;(defun how-many-tags (tag)&#xA;&quot;Tag must be a string without any colons.&quot;&#xA;  (let ((tag-list&#xA;          (loop for file in (org-agenda-files nil 'ifmode)&#xA;            append&#xA;            (let (result)&#xA;              (org-check-agenda-file file)&#xA;              (with-current-buffer (find-file-noselect file)&#xA;                (save-excursion&#xA;                  (goto-char (point-max))&#xA;                  (while (re-search-backward org-complex-heading-regexp nil t)&#xA;                    (push (match-string-no-properties 5) result)))&#xA;                result)))))&#xA;    (length&#xA;      (delq nil&#xA;        (mapcar&#xA;          (lambda (x) (when (and x (string-match (concat &quot;:&quot; tag &quot;:&quot;) x)) x))&#xA;          tag-list)))))&#xA;&#xA;(defun stop-or-go (tag)&#xA;&quot;The default hard-coded count is 3.  Tag must be a string without any colons.&quot;&#xA;  (let ((count (how-many-tags tag)))&#xA;    (if (&amp;gt;= count 3)&#xA;      (message &quot;STOP!:  %s&quot; count)&#xA;      (message &quot;GO!:  %S&quot; count))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-10T23:13:03.270" LastActivityDate="2016-11-10T23:13:03.270" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28588" PostTypeId="2" ParentId="28585" CreationDate="2016-11-10T20:45:59.500" Score="2" Body="&lt;p&gt;Have you tried using &lt;code&gt;(setq debug-on-error t)&lt;/code&gt; on your &lt;code&gt;init.el&lt;/code&gt;. Or even &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if I'm not mistaken you can start emacs with the flag &lt;code&gt;--debug-init&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe one of those options with help you understand whats going on. There are a log of problems that at first glance don't seem to cause problems... till they do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you could disabled packages that you might not need at the moment, to help you increase the changes of finding the problem.&lt;/p&gt;&#xA;" OwnerUserId="11531" LastActivityDate="2016-11-10T20:45:59.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28589" PostTypeId="1" CreationDate="2016-11-10T20:53:11.010" Score="0" ViewCount="75" Body="&lt;p&gt;I wish to start a command that has a very large argument list (10s or 100s of thousand characters) with &lt;code&gt;comint-exec&lt;/code&gt; but when I do this on Windows it fails to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only error is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Spawning child process: exec format error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I've confirmed that it is the argument length that causes the problem by reducing the list and the process starts up (but that's no good because I need the arguments to be able to get any use out of the process I'm spawning, which is a java command with an extremely large classpath).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sounds similar to &lt;a href=&quot;https://stackoverflow.com/questions/2261071&quot;&gt;https://stackoverflow.com/questions/2261071&lt;/a&gt; but it's not the same.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-11-10T21:55:54.397" Title="comint-exec with very large argument list on windows" Tags="|microsoft-windows|comint|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28590" PostTypeId="1" CreationDate="2016-11-10T21:36:17.363" Score="0" ViewCount="498" Body="&lt;p&gt;Since upgrading to MacOS a/k/a OS/X 10.12, I've noticed an annoying behavior. I have several spaces open. If I use [CMD][TAB] to move to EMACS from another program, the display switches to EMACS, it becomes visible, but then is immediately sent to the back and another application comes up. If I [CMD][TAB] &lt;em&gt;again&lt;/em&gt;, it brings EMACS to the front.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea if this is an EMACS issue or a MacOX issue, but it's annoying and I'd appreciate any suggestions to make it stop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0, Carbon Version 157 AppKit 1404.47) of 2016-09-08&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;System Version: macOS 10.12.1 (16B2555)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9153" LastActivityDate="2016-11-12T07:02:17.903" Title="EMACS, MacOS Sierra, and Mission Control work badly together" Tags="|osx|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28591" PostTypeId="1" AcceptedAnswerId="28602" CreationDate="2016-11-10T22:25:37.110" Score="0" ViewCount="616" Body="&lt;p&gt;After a recent Emacs update, the clang-format package started to misbehave under Windows. For instance, calling &lt;code&gt;clang-format-buffer&lt;/code&gt; on a &lt;code&gt;test.cpp&lt;/code&gt; file with the following content returns error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;(clang-format failed with code 1: error: invalid length 34, offset + length (34) is outside the file.)&quot;&#xA;&#xA;&#xA;{&#xA;  int a = 2;&#xA;  int b = 1;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that the length passed to &lt;code&gt;clang-format&lt;/code&gt; is right, because putting Point at the end of the buffer and calling &lt;code&gt;(bufferpos-to-filepos (point))&lt;/code&gt; returns &lt;code&gt;34&lt;/code&gt;. The file uses DOS-style file endings. But the error seems to be that &lt;code&gt;call-process-region&lt;/code&gt; passes &lt;code&gt;\n&lt;/code&gt; line endings to clang-format instead of &lt;code&gt;\r\n&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation of &lt;a href=&quot;https://ftp.gnu.org/old-gnu/Manuals/elisp-manual-21-2.8/html_node/elisp_604.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;clang-process-region&lt;/code&gt;&lt;/a&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The input sent to a subprocess by call-process-region is encoded using a coding system, much like text written into a file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;buffer-file-coding-system&lt;/code&gt; in the buffer is &lt;code&gt;undecided-dos&lt;/code&gt;. Is it normal then that &lt;code&gt;call-process-region&lt;/code&gt; passes &lt;code&gt;\n&lt;/code&gt; instead or &lt;code&gt;\r\n&lt;/code&gt; to clang-format?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The clang-format package I tried is installed from melpa.org, version &lt;strong&gt;20161004.253&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10314" LastEditorUserId="12247" LastEditDate="2016-11-21T21:12:32.343" LastActivityDate="2016-11-21T21:12:32.343" Title="Coding issue with clang-format on Windows" Tags="|character-encoding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28592" PostTypeId="1" CreationDate="2016-11-10T23:22:32.237" Score="0" ViewCount="167" Body="&lt;p&gt;I love using Emacsserver and Emacsclient, as it saves all of my buffers so that if I log in via ssh and then log out, all of my buffers are saved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I log into Emacsserver after quitting from another session, the layout (for instance how many windows I have and how they are set up) is gone, and I always start from a Scratch buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past I have used TMUX to make it so that when I reconnect to a terminal session, my Emacs session was identical to how I left it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if I minimize Emacsserver before exiting &lt;code&gt;^z&lt;/code&gt; upon reconnecting all of my window set up information is lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have Emacsserver remember all your window placement options?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="105" LastEditDate="2016-11-11T00:56:14.963" LastActivityDate="2016-11-11T00:56:14.963" Title="Is it possible to keep window set up when connecting via emacsclient?" Tags="|window|frames|emacsclient|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28593" PostTypeId="2" ParentId="24393" CreationDate="2016-11-11T00:49:47.060" Score="1" Body="&lt;p&gt;Use &lt;a href=&quot;https://github.com/atomontage/xterm-color&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/atomontage/xterm-color&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's noticeably faster than ansi-color.el and now supports interactive&#xA;buffer colorization (via M-x xterm-color-colorize-buffer).&lt;/p&gt;&#xA;" OwnerUserId="13952" LastActivityDate="2016-11-11T00:49:47.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28594" PostTypeId="2" ParentId="27962" CreationDate="2016-11-11T03:19:05.363" Score="10" Body="&lt;p&gt;This is still under development, but in Emacs 26.1 (assuming nothing goes wrong) you will be able to do &lt;code&gt;M-x debug-watch &amp;lt;variable&amp;gt; RET&lt;/code&gt; and then any change to the variable will land in the debugger with a backtrace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get the patchset now, at &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24923&quot; rel=&quot;noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24923&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does your patch enable attaching arbitrary code to execute?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, the mechanism allows running any function when a symbol value is modified.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-11-11T03:19:05.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28595" PostTypeId="1" CreationDate="2016-11-11T04:58:44.173" Score="0" ViewCount="157" Body="&lt;p&gt;I find the instruction from &lt;a href=&quot;https://www.sharelatex.com/learn/Glossaries&quot; rel=&quot;nofollow noreferrer&quot;&gt;enter link description here&lt;/a&gt; as given below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\usepackage[utf8]{inputenc}&#xA;&#xA;\usepackage{glossaries}&#xA;&#xA;\makeglossaries&#xA;&#xA;\newglossaryentry{latex}&#xA;{&#xA;    name=latex,&#xA;    description={Is a mark up language specially suited &#xA;    for scientific documents}&#xA;}&#xA;&#xA;\newglossaryentry{maths}&#xA;{&#xA;    name=mathematics,&#xA;    description={Mathematics is what mathematicians do}&#xA;}&#xA;&#xA;\title{How to create a glossary}&#xA;\author{ }&#xA;\date{ }&#xA;&#xA;\begin{document}&#xA;\maketitle&#xA;&#xA;The \Gls{latex} typesetting markup language is specially suitable &#xA;for documents that include \gls{maths}. &#xA;&#xA;\clearpage&#xA;&#xA;\printglossaries&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I cannot get glossaries working. I know I need to run 'makeglossaries' or 'makeindex', but how could I do in aquamacs latex mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;C-c index&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it shows &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Running `Index' on `test2' with ``makeindex test2''&#xA;Couldn't find input index file test2 nor test2.idx.&#xA;Usage: makeindex [-ilqrcgLT] [-s sty] [-o ind] [-t log] [-p num] [idx0 idx1 ...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So how could make this glossaries package working?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the version of software I am using is Aquamacs 3.3  GNU Emacs 25.1.1 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13700" LastEditorUserId="12242" LastEditDate="2016-11-11T09:12:44.900" LastActivityDate="2024-03-15T14:00:25.080" Title="How to use 'glossaries' package in aquamacs, or I mean how could I run makeglossaries in aquatics" Tags="|aquamacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28596" PostTypeId="1" AcceptedAnswerId="28826" CreationDate="2016-11-11T05:18:23.437" Score="4" ViewCount="1448" Body="&lt;p&gt;I use the &lt;code&gt;shell&lt;/code&gt; command via &lt;code&gt;C-u M-x shell&lt;/code&gt; to open a shell on a remote server by giving as default directory the path to the remote server (e.g &lt;code&gt;/user@myserver.com:/home/user&lt;/code&gt;) (which should have the same effect as the method described in &lt;a href=&quot;https://emacs.stackexchange.com/a/18046/9387&quot;&gt;this answer&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The directory of the buffer is at the beginning in sync with the directory of the shell (/user@myserver.com:/home/user`), and  tab completion works as expected giving me choices from the &lt;em&gt;remote&lt;/em&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when you issue &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the remote  shell, the buffer directory is set to the &lt;em&gt;local&lt;/em&gt; home path, so that I get tab completion for local directories which obviously does not make any sense in the remote shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I keep the directory tracking in sync even when I use cd in the remote shell? - I'm using GNU Emacs 23.1.1 on Centos, remote machine is Linux too.&lt;/p&gt;&#xA;" OwnerUserId="9387" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-12-06T09:59:32.117" Title="Directory tracking in remote shell buffer" Tags="|tramp|shell|completion|shell-mode|remote|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28597" PostTypeId="2" ParentId="12613" CreationDate="2016-11-11T07:21:35.293" Score="2" Body="&lt;p&gt;You may find a working solution here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun capitalizeFirst (s)&#xA;  (if (&amp;gt; (length s) 0)&#xA;      (concat (upcase (substring s 0 1)) (downcase (substring s 1)))&#xA;    nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again put this function to your .emacs file before yasnippet initialization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Snippet&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: name&#xA;# key: name&#xA;# --&#xA;Hi, my name is ${1:$$(capitalizeFirst yas-text)}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also some countries use different locales. According to Turkish locale if you convert &lt;em&gt;ırak&lt;/em&gt; word which means far, distant to uppercase it should be converted like this &lt;em&gt;Irak&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a function which converts the first character of a string uppercase correctly according to Turkish locale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Function which converts first character according to Turkish locale&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun buyukHarfYap (metin)&#xA;  (let (ilkHarf sesliMi)&#xA;    (if (&amp;gt; (length metin) 0)&#xA;        (progn&#xA;&#xA;          (setq ilkHarf (aref metin 0))&#xA;&#xA;          (if (eq ilkHarf 105) ; i harfi&#xA;              (aset metin 0 ?İ))&#xA;&#xA;          (if (eq ilkHarf 305) ; ı harfi&#xA;              (aset metin 0 ?I))&#xA;&#xA;          (if (eq ilkHarf 97)  ; a harfi&#xA;              (aset metin 0 ?A))&#xA;&#xA;          (if (eq ilkHarf 101) ; e harfi&#xA;              (aset metin 0 ?E))&#xA;&#xA;          (if (eq ilkHarf 252) ; ü harfi&#xA;              (aset metin 0 ?Ü))&#xA;&#xA;          (if (eq ilkHarf 111) ; o harfi&#xA;              (aset metin 0 ?O))&#xA;&#xA;          (if (eq ilkHarf 246)&#xA;              (aset metin 0 ?Ö)); ö harfi&#xA;&#xA;          (if (eq ilkHarf 117)&#xA;              (aset metin 0 ?U)); u harfi&#xA;&#xA;          (setq ilkHarf (substring metin 0 1))&#xA;&#xA;          (setq sesliMi (string-match ilkHarf &quot;AEIİOÖUÜ&quot;))&#xA;&#xA;          (if (eq sesliMi nil)&#xA;              (concat (upcase(substring metin 0 1))  (downcase (substring metin 1)))&#xA;            (concat (substring metin 0 1)  (downcase (substring metin 1)))))nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user13916" LastEditorDisplayName="user13916" LastEditDate="2016-11-11T18:46:39.307" LastActivityDate="2016-11-11T18:46:39.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28598" PostTypeId="1" CreationDate="2016-11-11T09:04:07.997" Score="2" ViewCount="96" Body="&lt;p&gt;I am running emacs as daemon, in MacOSX, it works flawlessly but when I kill the client the icon remains in the dock as running. I searched around for a way to hide it when no client is running but I couldn't find any workaround. Has anyone found a way to do this.&lt;/p&gt;&#xA;" OwnerUserId="13818" LastActivityDate="2016-11-11T09:04:07.997" Title="Hide emacs icon when client is off" Tags="|emacsclient|emacs-daemon|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28599" PostTypeId="2" ParentId="13791" CreationDate="2016-11-11T10:23:22.157" Score="3" Body="&lt;p&gt;I had a similar problem with PDFView and it turned out that the flickering was caused by Blink-Cursor mode. Try to disable this minor mode in the buffer.&lt;/p&gt;&#xA;" OwnerUserId="13957" LastActivityDate="2016-11-11T10:23:22.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28600" PostTypeId="1" AcceptedAnswerId="28603" CreationDate="2016-11-11T10:29:29.593" Score="1" ViewCount="105" Body="&lt;p&gt;I have seen several proposals to run more than one instance of &lt;code&gt;eshell&lt;/code&gt; (or &lt;code&gt;shell&lt;/code&gt;) at a time. See &lt;a href=&quot;https://stackoverflow.com/questions/6532998/how-to-run-multiple-shells-on-emacs&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/EshellMultipleEshellBuffers&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. However, they are inconvenient in my view, using peculiar key chords and forcing you to actively invent ad-hoc buffer names. I'd rather like to have a simple DWIM-like function, e.g. &lt;code&gt;new-eshell&lt;/code&gt;, that creates a fresh instance of &lt;code&gt;eshell&lt;/code&gt; in an automatically named buffer. Buffer names should be numbered consecutively, i.e., &lt;code&gt;*eshell1*&lt;/code&gt;, &lt;code&gt;*eshell2*&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Who can help?&lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-11-12T02:50:24.000" Title="How to create another instance of (e)shell in a DWIM fashion?" Tags="|shell|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28601" PostTypeId="1" CreationDate="2016-11-11T12:44:27.943" Score="7" ViewCount="671" Body="&lt;p&gt;I want to remove the push branch for a repository. I only use merge branch to push to a remote repository and now I have two headers with the same info all the time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Head:     master Merge pull request #zzz in xxxxxxx from yyyyyyyyyy to master&#xA;Merge:    origin/master Merge pull request #zzz in xxxxxx from yyyyyyyyyy to master&#xA;Push:     origin/master Merge pull request #zzz in xxxxxx from yyyyyyyyyy to master&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The adding of a push branch was a mistake but I don't know how to remove it.&lt;/p&gt;&#xA;" OwnerUserId="2300" LastActivityDate="2016-11-12T10:13:57.580" Title="Magit: how remove push branch?" Tags="|magit|git|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28602" PostTypeId="2" ParentId="28591" CreationDate="2016-11-11T14:43:37.110" Score="0" Body="&lt;p&gt;The issue comes from the fact Emacs using &lt;code&gt;undecided-unix&lt;/code&gt; by default for sending data to a subprocess. Calling &lt;code&gt;describe-coding-system&lt;/code&gt; (&lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;h&lt;/kbd&gt;, &lt;kbd&gt;C&lt;/kbd&gt;) shows all the different encodings used for a given buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This issue is fixed by calling &lt;code&gt;(setq default-process-coding-system '(undecided-dos . undecided-dos))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've filed a bug report on llvm.org's bug tracker to see if this can be solved in clang-format.el directly. &lt;a href=&quot;https://llvm.org/bugs/show_bug.cgi?id=31092&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://llvm.org/bugs/show_bug.cgi?id=31092&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10314" LastEditorUserId="10314" LastEditDate="2016-11-21T14:59:18.800" LastActivityDate="2016-11-21T14:59:18.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28603" PostTypeId="2" ParentId="28600" CreationDate="2016-11-11T15:25:19.930" Score="1" Body="&lt;p&gt;This function uses the default naming conventions of &lt;code&gt;eshell&lt;/code&gt; when called with a non-numeric prefix argument (e.g. &lt;kbd&gt;C-u M-x eshell&lt;/kbd&gt;), so consecutive calls create buffers titled, e.g., &lt;code&gt;*eshell*&amp;lt;2&amp;gt;*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun eshell/new ()&#xA;  (interactive)&#xA;  (eshell t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-11-11T15:25:19.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28604" PostTypeId="2" ParentId="28441" CreationDate="2016-11-11T15:30:13.430" Score="38" Body="&lt;p&gt;To elaborate on @erikstokes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rm ~/.emacs.d/elpa/ORGDIRNAME/*.elc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;ORGDIRNAME&lt;/code&gt; is the name of the core ogrmode directory. Restart emacs and  you can now run &lt;code&gt;org-babel&lt;/code&gt; code blocks.&lt;/p&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="12564" LastEditDate="2018-05-17T17:51:40.923" LastActivityDate="2018-05-17T17:51:40.923" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28606" PostTypeId="1" AcceptedAnswerId="28673" CreationDate="2016-11-11T17:42:24.463" Score="4" ViewCount="832" Body="&lt;p&gt;When editing a long Maven &lt;code&gt;pom.xml&lt;/code&gt; I may see a screen full of &lt;code&gt;&amp;lt;plugin&amp;gt;&lt;/code&gt; blocks with their parent tags out of sight. I would like to know whether I'm looking at a &lt;code&gt;/project/build/plugins/plugin&lt;/code&gt; tag or a &lt;code&gt;/project/profiles/profile/build/plugins/plugin&lt;/code&gt; tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to display this information in the modeline or on the top of the screen?&lt;/p&gt;&#xA;" OwnerUserId="13963" LastActivityDate="2016-11-15T18:23:26.953" Title="How to show XPath for current location in an XML hierarchy in the modeline?" Tags="|mode-line|xml|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28607" PostTypeId="1" AcceptedAnswerId="28618" CreationDate="2016-11-11T18:25:41.260" Score="3" ViewCount="1129" Body="&lt;p&gt;When editing code or org-mode, I often need the URL of the page I'm viewing in Google Chrome.  Is there a way to do this from Emacs?  Or with an external helper script if necessary?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example use case would be editing code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# See &amp;lt;insert current link to StackOverflow on bash variables&amp;gt;&#xA;if [[ -z &quot;${param// }&quot; ]]; then foo; fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-11-19T14:00:07.417" Title="Copy current URL from web browser from Emacs while editing" Tags="|org-mode|yank|web-browser|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28608" PostTypeId="1" AcceptedAnswerId="28622" CreationDate="2016-11-11T19:18:23.587" Score="0" ViewCount="1393" Body="&lt;p&gt;At work I'm connecting to a server that only accepts SFTP connections.  I can connect from the command line just fine.  I'd like to use TRAMP or Ange-FTP or something similar from within Emacs, but I'm stuck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I say &lt;code&gt;C-x C-f /sftp:user@host:&lt;/code&gt; I expect to get a prompt for a password but instead I get back &lt;code&gt;Unknown method &quot;sftp&quot;&lt;/code&gt; in the echo area.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the TRAMP that came with Emacs, and I notice that &lt;code&gt;tramp-methods&lt;/code&gt; does not contain anything for sftp.  Do I need to add something there?&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2023-08-27T18:51:51.903" Title="How do I edit files on an SFTP server, connecting from Mac OS X?" Tags="|tramp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28609" PostTypeId="2" ParentId="12924" CreationDate="2016-11-11T21:06:38.670" Score="0" Body="&lt;p&gt;try using &lt;code&gt;(setq ns-use-srgb-colorspace nil)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11531" LastActivityDate="2016-11-11T21:06:38.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28611" PostTypeId="2" ParentId="14984" CreationDate="2016-11-11T23:28:39.577" Score="0" Body="&lt;p&gt;What actually fixed it for me was using &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/railwaycat/homebrew-emacsmacport&lt;/a&gt;, which works much better with OSX.&lt;/p&gt;&#xA;" OwnerUserId="9130" LastActivityDate="2016-11-11T23:28:39.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28612" PostTypeId="2" ParentId="28373" CreationDate="2016-11-12T02:26:47.613" Score="3" Body="&lt;p&gt;&lt;strong&gt;No, there isn't anything as nice as those online docs.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, your Emacs is the best source of information. The online Emacs reference only applies to the latest released version of Emacs, so some of it may not apply to your version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I highly recommend the &lt;a href=&quot;https://tuhdo.github.io/helm-intro.html#orgheadline17&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-apropos&lt;/code&gt;&lt;/a&gt; command from the &lt;a href=&quot;https://github.com/emacs-helm/helm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Helm&lt;/a&gt; package, which allows for incremental completion of function, command, variable, and face names. I find it invaluable for exploring a new Emacs package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also consider the &lt;code&gt;apropos-documentation&lt;/code&gt; command, which allows you to search inside docstrings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for external documentation, take a look at Artur Malabarba's &lt;a href=&quot;http://doc.endlessparentheses.com/app.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Online Documentation&lt;/a&gt; (also available as an Android app!).&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2016-11-12T02:26:47.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28613" PostTypeId="2" ParentId="14366" CreationDate="2016-11-12T02:42:01.440" Score="1" Body="&lt;p&gt;Have you tried &lt;code&gt;C-x C-b&lt;/code&gt; (&lt;code&gt;list-buffers&lt;/code&gt;)? That gives you a list of buffers in another window. It will remain visible, depending on what keys you use to access the listed buffers. &lt;code&gt;?&lt;/code&gt; in that window tells you what keys are available:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Buffer Menu mode defined in ‘buff-menu.el’:&#xA;Major mode for Buffer Menu buffers.&#xA;The Buffer Menu is invoked by the commands C-x C-b,&#xA;M-x buffer-menu, and M-x buffer-menu-other-window.&#xA;See ‘buffer-menu’ for a description of its contents.&#xA;&#xA;In Buffer Menu mode, the following commands are defined:&#xA;&#xA;q    Remove the Buffer Menu from the display.&#xA;RET  Select current line’s buffer in place of the buffer menu.&#xA;o    Select that buffer in another window,&#xA; so the Buffer Menu remains visible in its window.&#xA;V    Select current line’s buffer, in View mode.&#xA;M-x Buffer-menu-view-other-window  Select that buffer in&#xA; another window, in view-mode.&#xA;C-o  Make another window display that buffer.&#xA;m    Mark current line’s buffer to be displayed.&#xA;v    Select current line’s buffer.&#xA; Also show buffers marked with m, in other windows.&#xA;1    Select that buffer in full-frame window.&#xA;2    Select that buffer in one window, together with the&#xA; buffer selected before this one in another window.&#xA;M-s a C-s    Incremental search in the marked buffers.&#xA;M-s a C-M-s  Isearch for regexp in the marked buffers.&#xA;M-s a C-o Show lines matching regexp in the marked buffers.&#xA;t    visit-tags-table this buffer.&#xA;~    Clear modified-flag on that buffer.&#xA;s    Mark that buffer to be saved, and move down.&#xA;C-k  Mark that buffer to be deleted, and move down.&#xA;C-d  Mark that buffer to be deleted, and move up.&#xA;x    Delete or save marked buffers.&#xA;u    Remove all marks from current line.&#xA; With prefix argument, also move up one line.&#xA;DEL  Back up a line and remove marks.&#xA;%    Toggle read-only status of buffer on this line.&#xA;g    Update the list of buffers.&#xA;T    Toggle whether the menu displays only file buffers.&#xA;b    Bury the buffer listed on this line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-12T02:42:01.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28615" PostTypeId="2" ParentId="28590" CreationDate="2016-11-12T07:02:17.903" Score="1" Body="&lt;p&gt;I am currently digging into some changed/different behaviour with respect to frames, macOS windows and mission control, but I'm not seeing the problem you mention. Not sure yet if my issues are a sign of a problem or a sign of something needing to be re-configured. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appear to be using the same maOS version as you and my emacs is build from homebrew using the 'brew install emacs' recipe. Version details are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.1.1 (x86_64-apple-darwin16.1.0, NS appkit-1504.60 Version 10.12.1 (Build 16B2555))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the differences between our versions. Perhaps try a re-build? The brew command I used is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --with-cocoa --with-gnutls --srgb --with-librsvg --with-ns&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm going to give the 'brew cask install emacs' recipe a go to see if that makes a difference for my issue&lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2016-11-12T07:02:17.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28616" PostTypeId="2" ParentId="28251" CreationDate="2016-11-12T07:44:31.687" Score="1" Body="&lt;p&gt;See tarsius' response for an approach with tramp.  That said, this is doable from outside Emacs via the very helpful &lt;a href=&quot;https://github.com/ericpruitt/sshfsexec&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/ericpruitt/sshfsexec&lt;/a&gt;.  Basically, you sym-link file intensive commands (like git) to &lt;code&gt;sshfsexec.py&lt;/code&gt; which in intelligently forwards commands via ssh if you're in a SSHFS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The benefits of this approach are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can use a GUI Emacs.&lt;/li&gt;&#xA;&lt;li&gt;You still have the sshfs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you're on a Mac, you'll need to edit the sshfsexec.py to replace &lt;code&gt;sshfsmountmap&lt;/code&gt; with hardcoded values due to &lt;a href=&quot;https://github.com/ericpruitt/sshfsexec/issues/2&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/ericpruitt/sshfsexec/issues/2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def sshfsmountmap():&#xA;    &quot;&quot;&quot;&#xA;    Return a dictionary mapping mount points to tuples containing the&#xA;    remote login ([user@]hostname) and remote path for all remote hosts&#xA;    mounted with sshfs.&#xA;    &quot;&quot;&quot;&#xA;    # /proc/self/mountinfo isn't available on mac, so hard code values.  See&#xA;    # https://github.com/ericpruitt/sshfsexec/issues/2&#xA;    SSH_ADDRESS = 'host@remote.com'&#xA;    # List of paths is available in remount.&#xA;    return {&#xA;        '/home/joe': (SSH_ADDRESS, '/remote/path'),&#xA;        '/home/build': (SSH_ADDRESS, '/remote/build'),&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-11-12T07:44:31.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28617" PostTypeId="1" CreationDate="2016-11-12T07:53:53.173" Score="1" ViewCount="48" Body="&lt;p&gt;I recently noticed the &lt;code&gt;M-x shell&lt;/code&gt; command opens the shell in the other buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to do &lt;code&gt;Ctrl-x 3&lt;/code&gt; &gt; &lt;code&gt;Ctrl-x o&lt;/code&gt; &gt; &lt;code&gt;M-x shell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But recently I found that &lt;code&gt;M-x shell&lt;/code&gt; opens the shell in the other buffer.&#xA;Was it changed? Or is there any possible mis-configuration?&lt;/p&gt;&#xA;" OwnerUserId="13968" LastActivityDate="2016-11-12T07:53:53.173" Title="Since when the M-x shell open the shell on the other buffer?" Tags="|shell|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28618" PostTypeId="2" ParentId="28607" CreationDate="2016-11-12T08:17:00.473" Score="1" Body="&lt;h2&gt;Mac OS&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-mac-link.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-mac-link.el&lt;/a&gt;, it produces an Org link since it can know not only URL but also TITLE by using AppleScript. You can install it via&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Install &lt;code&gt;org-plus-contrib&lt;/code&gt; from &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org ELPA&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;or install &lt;code&gt;org-mac-link&lt;/code&gt; from MELPA&lt;/li&gt;&#xA;&lt;li&gt;or &lt;code&gt;contrib/lisp/&lt;/code&gt; under Org source code (get it via Git repo or tarball)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;by the way, even you install via ELPA, you still need to setup autoloads  for commands you need or simply require the feature since &lt;code&gt;org-mac-link.el&lt;/code&gt; doesn't setup its autoload cookies.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;GNU/Linux&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As far as I know, X11 doesn't provide tool like AppleScript. So you need to do it manually or some automation tool. For example, to get URL:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Switch to Google Chrome&lt;/li&gt;&#xA;&lt;li&gt;Move cursor to Address Bar and select (or copy) URL&lt;/li&gt;&#xA;&lt;li&gt;Switch to Emacs (or Terminal if you are running Emacs in it)&lt;/li&gt;&#xA;&lt;li&gt;Yank from PRIMARY selection (or clipboard)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can use tools such as &lt;code&gt;xdotool(1)&lt;/code&gt; to simulate the above steps, I tried this way a few days ago in &lt;a href=&quot;https://github.com/xuchunyang/grab-x-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;grab-x-link.el&lt;/a&gt;, it supports Firefox and Chromium but not Chrome, it works for me in most cases.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There is also &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-protocol.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-protocol.el&lt;/a&gt;. Basically, you register a URL scheme / protocol for emacsclient, then you find some way (such as Bookmarklet in web browser) to activate URL in that scheme.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-11-19T14:00:07.417" LastActivityDate="2016-11-19T14:00:07.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28619" PostTypeId="2" ParentId="28238" CreationDate="2016-11-12T08:32:04.037" Score="1" Body="&lt;p&gt;It seems there have been some changes in 10.12 with the introduction of the 'tabbed' windows option which can affect emacs. I found that when I created new frames, they were on the same 'virtual desktop' where previously, they were on a different virtual desktop (when doing so in fullscreen mode). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that this was because of a new option under the dock preferences. The option has the title/text &quot;Prefer tabs when opening documents&quot; and was set to &quot;In full screen only&quot;. Changing this to &quot;Manual&quot; has restored the previous behaviour. Not sure if that will fix your issue, but may be worth giving it a try.  &lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2016-11-12T08:32:04.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28620" PostTypeId="1" CreationDate="2016-11-12T09:18:40.660" Score="3" ViewCount="1281" Body="&lt;p&gt;I recently installed Org 9.0 and ‘org-ctrl-c-ctrl-c’ often complains about &#xA;&lt;code&gt;user-error: ‘C-c C-c’ can do nothing useful here&lt;/code&gt;. However when I use it repeatedly it works suddenly, although I didn't change anything ?&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-11-12T15:02:53.120" Title="Problems with org-ctrl-c-ctrl-c and Org 9.0" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28621" PostTypeId="2" ParentId="28601" CreationDate="2016-11-12T10:13:57.580" Score="7" Body="&lt;p&gt;Bring up the magit status window with &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;magit-status&lt;/code&gt; or whatever shortcut key binding you use. type &lt;code&gt;b&lt;/code&gt; to bring up the branch menu. type &lt;code&gt;p&lt;/code&gt; to cycle through the push options enough times to get to &lt;code&gt;default:remote.pushDefault&lt;/code&gt; and your extra line should go away.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-11-12T10:13:57.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28622" PostTypeId="2" ParentId="28608" CreationDate="2016-11-12T10:36:51.100" Score="0" Body="&lt;p&gt;Tramp supports &lt;code&gt;sftp&lt;/code&gt; only in conjunction with gvfs. I fear, that this is not available for OS X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility could be to use &lt;code&gt;psftp&lt;/code&gt; from the PuTTY suite. Although PuTTY is dedicated to MS Windows machines, it might also be available for OS X. I know that it exists for GNU/Linux.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-11-12T10:36:51.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28623" PostTypeId="2" ParentId="28620" CreationDate="2016-11-12T12:18:27.910" Score="2" Body="&lt;p&gt;Remove the &lt;code&gt;org&lt;/code&gt; and &lt;code&gt;org-plus-contrib&lt;/code&gt; packages and reinstall to fix this problem.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2016-11-12T12:18:27.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28624" PostTypeId="2" ParentId="28620" CreationDate="2016-11-12T15:02:53.120" Score="2" Body="&lt;p&gt;@John Kitchin thanks. I will use this temporary fix.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-ctrl-c-ctrl-c ()&#xA;  &quot;Fix blank line issue.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (org-babel-goto-src-block-head)&#xA;    (org-ctrl-c-ctrl-c)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-11-12T15:02:53.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28625" PostTypeId="1" CreationDate="2016-11-12T15:03:36.343" Score="2" ViewCount="410" Body="&lt;p&gt;Is there any modes which may improve development experience for nowadays ObjC (syntax highlight for method calls, properties, blocks, literals, lightweight generics, modern keywords)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally with Xcode projects/workspaces integration (add/remove files, reuse environment variables).&lt;/p&gt;&#xA;" OwnerUserId="210" LastActivityDate="2016-11-12T15:03:36.343" Title="Emacs as environment for iOS development" Tags="|osx|cc-mode|ios|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28627" PostTypeId="1" AcceptedAnswerId="28694" CreationDate="2016-11-12T23:22:39.923" Score="2" ViewCount="2045" Body="&lt;p&gt;I use &lt;code&gt;org-icalendar-export-to-ics&lt;/code&gt; to export org-agenda scheduled tasks to iCal format, which works nicely. In my use case, I always select export the &quot;current file&quot; (as opposed to &quot;combine all agenda files&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has the effect of creating an &lt;code&gt;.ics&lt;/code&gt; file with a name like &lt;code&gt;foo.ics&lt;/code&gt;. I then have to go navigate in Finder to go find that file and then open it in iCal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I direct Emacs to &lt;code&gt;open&lt;/code&gt; or &lt;code&gt;open-with&lt;/code&gt; that &lt;code&gt;.ics&lt;/code&gt; file automatically upon &lt;code&gt;org-icalendar-export-to-ics&lt;/code&gt;? I can't imagine a scenario where I would want to export to an &lt;code&gt;.ics&lt;/code&gt; file but not go on to open the &lt;code&gt;.ics&lt;/code&gt; file and import the task into iCal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe some bash scripting around &lt;code&gt;org-after-save-iCalendar-file-hook&lt;/code&gt;? The documentation for &lt;code&gt;org-after-save-iCalendar-file-hook&lt;/code&gt; says &quot;A good way to use this is to tell a desktop calendar application to re-read the iCalendar file,&quot; but it doesn't say how to go about telling my desktop calendar to do that.&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2016-11-16T17:13:57.063" LastActivityDate="2016-11-16T19:40:45.490" Title="how to automatically open .ics file after org-icalendar-export-to-ics?" Tags="|org-export|org-agenda|bash|ical|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28628" PostTypeId="1" CreationDate="2016-11-12T23:37:52.340" Score="2" ViewCount="325" Body="&lt;p&gt;I swear there used to be something like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm writing a lot of Markdown with embedded code.  I would like to have EMACS treat code in GitHum fenced code according to the default mode for that type of code. That is, if I write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...and this excellent piece of code computes a function significant to number theory:&#xA;&#xA;```python&#xA;def even(x):&#xA;    return (x % 2) == 0&#xA;```&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like the code within the fences to be treated as Python while the code outside the fences is Markdown.&lt;/p&gt;&#xA;" OwnerUserId="9153" LastActivityDate="2016-11-13T11:47:33.543" Title="multi-mode with markdown and language" Tags="|markdown|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28629" PostTypeId="1" CreationDate="2016-11-13T00:44:15.640" Score="3" ViewCount="705" Body="&lt;p&gt;I'm currently started using tmux because of getting tired of term-mode, and I managed to shortcut in tmux to open current session output in emacs so I could search and select from it in emacs. I have the only problem - I wish for emacs buffer to display term session output with the same color highlighting - for directories to be blue e.g. As I understand it is doable since term-mode is able of that somehow. Can anyone point me how to copy text with such face overlays from terminal to emacs?&lt;/p&gt;&#xA;" OwnerUserId="9056" LastActivityDate="2016-12-04T19:07:27.960" Title="Copy from terminal (tmux) to emacs with color?" Tags="|term|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28630" PostTypeId="1" CreationDate="2016-11-13T05:10:06.230" Score="5" ViewCount="215" Body="&lt;p&gt;&lt;strong&gt;Historical Perspective&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On Unix like operating systems, it is common practice to redirect IO between shell commands using pipes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the command below would insert all the lines that didn't match &quot;10.1.2.3&quot; into the &lt;code&gt;*scratch*&lt;/code&gt; buffer in emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; `cat /tmp/ip-addresses.txt | grep -vi &quot;10.1.2.3&quot; | emacs --insert /path/to/stdin`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are numerous ways to do this same task inside of emacs too. One of the easiest methods is probably something like the example below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-!&lt;/kbd&gt; &lt;code&gt;cat /tmp/ip-addresses.txt | grep -vi &quot;10.1.2.3&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output from the command would be displayed in new buffer named &lt;code&gt;*Shell Command Output*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of my favorite features, is to run shell commands &lt;em&gt;asynchronously&lt;/em&gt; inside of emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-&amp;amp;&lt;/kbd&gt; &lt;code&gt;tail -f /tmp/ip-addresses.txt | grep -vi &quot;10.1.2.3&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output from the command would be displayed and be &lt;em&gt;automagically&lt;/em&gt; refreshed in new buffer named &lt;code&gt;*Async Shell Command*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, when I run the &lt;em&gt;asynchronous&lt;/em&gt; command outside of emacs the &lt;code&gt;*scratch*&lt;/code&gt; buffer will never refresh when the file is updated by another process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;tail -f /tmp/ip-addresses.txt | grep -vi &quot;10.1.2.3&quot; | emacs --insert /path/to/stdin&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Is there some way to continue reading from a STDIN file descriptor when data is PIPED to Emacs on Command-line?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I'm looking for an answer that shows how to continue reading the  redirected IO from the PIPE by modifying the emacs command-line.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example, to update the destination buffer from &lt;code&gt;*scratch*&lt;/code&gt; to a buffer named &lt;code&gt;STDIN&lt;/code&gt; I would modify the original command-line like so:  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;cat /tmp/ip-addresses.txt | grep -vi &quot;10.1.2.3&quot; | emacs --eval &quot;(set-buffer (generate-new-buffer \&quot;STDIN\&quot;))&quot; --insert /path/to/stdin&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thanks for your help!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-11-13T17:17:10.347" LastActivityDate="2016-11-13T17:17:10.347" Title="Is there some way to continue reading from a STDIN file descriptor when data is PIPED to Emacs on Command-line?" Tags="|async|command-line-arguments|pipe|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28631" PostTypeId="1" CreationDate="2016-11-13T06:07:36.907" Score="0" ViewCount="152" Body="&lt;p&gt;I have installed matlab-mode from the melpa repository. However when I do&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x: matlab-shell [RET]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It gives me the following error.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;objc[4164]: Class JavaLaunchHelper is implemented in both&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;/Applications/MATLAB_R2016b.app/sys/java/jre/maci64/jre/bin/java and&#xA;/Applications/MATLAB_R2016b.app/sys/java/jre/maci64/jre/lib/jli/libjli.dylib. One of the two will be used. Which one is undefined&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-shell segmentation fault 11&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Can anyone help me with this?.&lt;/p&gt;&#xA;" OwnerUserId="13976" LastEditorUserId="13976" LastEditDate="2020-08-04T15:21:23.897" LastActivityDate="2020-08-04T15:21:23.897" Title="matlab crashes when logged in via emacs" Tags="|init-file|matlab|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="28632" PostTypeId="1" CreationDate="2016-11-13T09:18:38.457" Score="5" ViewCount="72" Body="&lt;p&gt;I'm looking for a command like &lt;code&gt;sx-tab-all-questions&lt;/code&gt;. But instead of &#xA;displaying a list with all communities, I want it to display my list of filters. How can I create a filter, include tags of different communities and highlight new questions ?&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-11-14T20:19:09.023" LastActivityDate="2016-11-14T20:19:09.023" Title="how to filter Stack Exchange questions with sx.el?" Tags="|sx.el|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28633" PostTypeId="2" ParentId="28628" CreationDate="2016-11-13T11:47:33.543" Score="3" Body="&lt;p&gt;For &lt;code&gt;markdown&lt;/code&gt;, I would strongly recommend&#xA;using &lt;a href=&quot;https://github.com/vspinu/polymode&quot; rel=&quot;nofollow noreferrer&quot;&gt;polymode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, &lt;code&gt;polymode&lt;/code&gt; is distributed with a special mode that will allow you to&#xA;edit these regions with the appropriate major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're also using &lt;code&gt;use-package&lt;/code&gt; you can enable it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package polymode&#xA;  :ensure t&#xA;  :defer t)&#xA;&#xA;(use-package poly-markdown&#xA;  :ensure polymode&#xA;  :defer t&#xA;  :mode (&quot;\\.md&quot; . poly-markdown-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There's also some more details available in this answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/27695/2653&quot;&gt;https://emacs.stackexchange.com/a/27695/2653&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-11-13T11:47:33.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28634" PostTypeId="2" ParentId="28048" CreationDate="2016-11-13T13:24:05.460" Score="1" Body="&lt;p&gt;It seems like it is not possible to achieve this currently. First, &#xA; &lt;code&gt;org-preview-latex-fragment&lt;/code&gt; always deletes all overlays before doing anything at all, see &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/org/org.el#L18392&quot; rel=&quot;nofollow noreferrer&quot;&gt;Line 18329 in org.el&lt;/a&gt;.&#xA;In addition, &lt;code&gt;C-c C-c&lt;/code&gt; also implements this behavior, see &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/org/org.el#L20313&quot; rel=&quot;nofollow noreferrer&quot;&gt;Line 20313 in org.el&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I cannot see any compelling reason why &lt;code&gt;org-preview-latex-fragment&lt;/code&gt; must delete all overlays before creating the current one. And I agree this is annoying behavior. Maybe it should be reported as a bug?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-11-13T13:24:05.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28635" PostTypeId="2" ParentId="28118" CreationDate="2016-11-13T14:54:31.113" Score="3" Body="&lt;p&gt;Having studied &lt;code&gt;org-mode&lt;/code&gt; for a few weeks, I believe I can answer my own question.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;To hide headlines with children in &lt;code&gt;TODO&lt;/code&gt; states, first put this in your &lt;code&gt;init.el&lt;/code&gt; or equivalent:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-enforce-todo-dependencies t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above will prevent a headline from entering a &lt;code&gt;DONE&lt;/code&gt; state while a child is in a &lt;code&gt;TODO&lt;/code&gt; state. &lt;code&gt;TODO&lt;/code&gt; headlines with at least one child in a &lt;code&gt;TODO&lt;/code&gt; state have the property &lt;code&gt;BLOCKED&lt;/code&gt;. To prevent &lt;code&gt;BLOCKED&lt;/code&gt; headlines from showing in agenda views, use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-dim-blocked-tasks 'invisible)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sorting the agenda block by headline depth is possible by creating a custom sorting strategy. The depth of a headline is given by the property &lt;code&gt;LEVEL&lt;/code&gt;. As an example where &lt;code&gt;LEVEL&lt;/code&gt; is used, org defaults to determining stuck projects by first tag searching for &lt;code&gt;&quot;+LEVEL=2/-DONE&quot;&lt;/code&gt;. For more information, look up the syntax of tag searching.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Distinct blocks for distinct headline depths can be achieved by using the &lt;code&gt;LEVEL&lt;/code&gt; property, as described above.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13775" LastActivityDate="2016-11-13T14:54:31.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28636" PostTypeId="1" AcceptedAnswerId="28639" CreationDate="2016-11-13T15:38:56.533" Score="1" ViewCount="99" Body="&lt;p&gt;When I open &lt;a href=&quot;https://www.emacswiki.org/emacs/InferiorEmacsLispMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;IELM&lt;/a&gt; and type in &lt;code&gt;(point)&lt;/code&gt; or &lt;code&gt;(point-max)&lt;/code&gt; in the interpreter, it always returns &lt;code&gt;710 (#o1306, #x2c6, ?ˆ)&lt;/code&gt; and &lt;code&gt;64292 (#o175444, #xfb24, ?ﬤ)&lt;/code&gt; respectively. If I eval these functions via &lt;code&gt;eval-expression&lt;/code&gt; instead, then I get correct values for the &lt;code&gt;*ielm*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As &lt;code&gt;(buffer-size)&lt;/code&gt; is just &lt;code&gt;(+1 (point-max))&lt;/code&gt; (unless narrowing is in effect), typing it into IELM yields &lt;code&gt;64291 (#o175443, #xfb23, ?ﬣ)&lt;/code&gt;, but evaluating it via &lt;code&gt;eval-expression&lt;/code&gt; gives the correct buffer size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this doesn't create any problems, I'm just curious why typing these directly into IELM returns really weird results? Is there any technical/theoretical reason for that?&lt;/p&gt;&#xA;" OwnerUserId="3972" LastActivityDate="2016-11-13T17:16:36.193" Title="Weird (point) and (point-max) values in IELM" Tags="|point|eval-expression|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28637" PostTypeId="1" CreationDate="2016-11-13T17:01:58.847" Score="4" ViewCount="1882" Body="&lt;p&gt;I would like to update Google Calendar / iCal automatically by exporting my org deadlines and scheduled tasks in .ics format, then automatically importing them into a cross-platform calendar app. I have tried the org / Google Calendar integration and been unable to get it to work. Is it possible to use cron jobs or some other method to automate this task?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: I have used org-icalendar-export-to-ics to export my org file and then manually imported it into the OSX calendar app, and it then appears in my Google Calendar. I am wondering whether anyone has a way to automate this process. As a first step, I envision running a command from the terminal that launches emacs with an argument that sends the org-icalendar-export-to-ics command. Is that possible? After that, I'll have to set up a way to automatically import the .ics file into either OSX calendar or Google Calendar.&lt;/p&gt;&#xA;" OwnerUserId="13854" LastEditorUserId="13854" LastEditDate="2016-11-14T20:58:13.620" LastActivityDate="2024-03-25T06:05:15.573" Title="Can I automatically export org deadlines and scheduled tasks as an iCal file and import it with another calendar app?" Tags="|org-mode|org-export|org-agenda|calendar|ical|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28638" PostTypeId="1" CreationDate="2016-11-13T17:10:31.220" Score="8" ViewCount="574" Body="&lt;p&gt;I would like to export org file to ODT. Is there any nice ready to use ODT template that can be used for exported documents? Default template is not good looking. I had the same problem with html export where I was able to find some very nice themes.&lt;/p&gt;&#xA;" OwnerUserId="6730" LastEditorUserId="6730" LastEditDate="2018-12-05T10:10:56.300" LastActivityDate="2018-12-05T10:10:56.300" Title="org-mode ODT export template" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28639" PostTypeId="2" ParentId="28636" CreationDate="2016-11-13T17:16:36.193" Score="3" Body="&lt;p&gt;IELM allows you to set another the current buffer, take a look at your Mode Line to see which buffer your IELM is running on, I guess you changed the current buffer. You can change it back with &lt;kbd&gt;C-c C-b&lt;/kbd&gt; (&lt;code&gt;ielm-change-working-buffer&lt;/code&gt;). To learn more info about IELM, type &lt;kbd&gt;C-h m&lt;/kbd&gt; (&lt;code&gt;describe-mode&lt;/code&gt;) as usual.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-13T17:16:36.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28640" PostTypeId="2" ParentId="20942" CreationDate="2016-11-13T20:15:59.270" Score="3" Body="&lt;p&gt;As mentioned before, you can try &lt;code&gt;aspell&lt;/code&gt;. I've also tried &lt;code&gt;hunspell&lt;/code&gt;, but I had the same problems as you. I found &lt;a href=&quot;https://stackoverflow.com/a/4111580/5883049&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (if (file-exists-p &quot;/usr/bin/aspell&quot;)&#xA;      (progn&#xA;        (setq ispell-program-name &quot;aspell&quot;)&#xA;        (eval-after-load &quot;ispell&quot;&#xA;          '(progn (defun ispell-get-coding-system () 'utf-8)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="18746" LastEditDate="2019-03-29T06:38:04.320" LastActivityDate="2019-03-29T06:38:04.320" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28641" PostTypeId="1" CreationDate="2016-11-13T22:48:41.213" Score="4" ViewCount="1179" Body="&lt;p&gt;In Emacs, on the modeline: I would like the name of the currently focused buffer to be bold, but only when its window is selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My modeline looks something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-line-format&#xA;  (list &quot;%&amp;amp;&quot;&#xA;    &quot; &quot;&#xA;    (propertize &quot;%b &quot; 'face 'mode-line-buffer-id)&#xA;    &quot;%p of %I&quot;&#xA;    &quot; &quot;&#xA;    &quot;[%l,%c]&quot;&#xA;    'vc-mode&#xA;    &quot; &quot;&#xA;    'mode-line-modes&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like &quot;%b&quot; (the name of the buffer) to be bold when its window is selected. I am totally new to Emacs Lisp. I thought setting the face to a variable that is changed by some &quot;focus-in&quot; hook would be the way to go (and possibly forcing the modeline to be redrawn).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what event I should hook in to. I know about focus-in-hook and focus-out-hook but those are for the frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13978" LastEditorUserId="105" LastEditDate="2016-11-14T00:39:49.050" LastActivityDate="2016-11-14T15:38:27.717" Title="How to make buffer name in mode-line be bold when its window is selected?" Tags="|buffers|faces|mode-line|" AnswerCount="2" CommentCount="1" ClosedDate="2016-11-28T18:09:48.860" ContentLicense="CC BY-SA 3.0" />
  <row Id="28642" PostTypeId="2" ParentId="28641" CreationDate="2016-11-13T23:11:02.993" Score="1" Body="&lt;p&gt;Just &lt;em&gt;customize&lt;/em&gt; face &lt;code&gt;mode-line-buffer-id&lt;/code&gt;: &lt;strong&gt;&lt;code&gt;M-x customize-face RET mode-line-buffer-id RET&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Customize, you can specify that the face's &lt;code&gt;Weight&lt;/code&gt; attribute is &lt;code&gt;Bold&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set your edit changes, to see the effect.  Save your set changes, if you like the effect and want to have it in future Emacs sessions, by default.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-13T23:11:02.993" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28643" PostTypeId="1" AcceptedAnswerId="28655" CreationDate="2016-11-14T00:11:57.563" Score="8" ViewCount="3371" Body="&lt;h1&gt;History&lt;/h1&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Recently,  I cobbled together a shell script that can execute a named code block from inside an org-mode file using the command-line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I copied source code directly from the &lt;a href=&quot;http://orgmode.org/manual/Batch-execution.html#Batch-execution&quot; rel=&quot;noreferrer&quot;&gt;org-mode manual&lt;/a&gt; and the &lt;code&gt;org-babel-open-src-block-result&lt;/code&gt; function in &lt;code&gt;ob-core.el&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment, the shell script &lt;strong&gt;only &lt;em&gt;works&lt;/em&gt; with elisp code blocks&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;  # Shell Command&#xA;  ./call-named-code-block-examples.sh ./call-named-code-block-examples.org &quot;get-org-version&quot; 2&amp;gt;/dev/null&#xA;  # Returns Expected Results&#xA;  # org-mode version: 9.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The script &lt;strong&gt;displays an error&lt;/strong&gt; when calling code blocks written in other languages, e.g. ruby.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;  # Shell Command&#xA; ./call-named-code-block-examples.sh ./call-named-code-block-examples.org &quot;get-emacs-version&quot;&#xA;  # Returns Error Message&#xA;  # No org-babel-execute function for ruby!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;How to execute named code blocks written in any language using a shell script? &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Below is the shell script and org-mode code needed to reproduce the issue:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Shell Script&lt;/h2&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Save as file named:&lt;/strong&gt; call-named-code-block-examples.sh&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/sh&#xA;# -*- mode: shell-script -*-&#xA;#&#xA;# Call named code block in org-mode file&#xA;#&#xA;DIR=`pwd`&#xA;FILE=$1&#xA;CODE_BLOCK=$2&#xA;&#xA;emacs -Q --batch \&#xA;  --eval &quot;&#xA;(progn&#xA;  (require 'org)(require 'ob)(require 'ob-table)(setq org-confirm-babel-evaluate nil)&#xA;  (mapc (lambda (file)&#xA;        (find-file (expand-file-name file \&quot;$DIR\&quot;))&#xA;        (let ((re-run (quote t))&#xA;          (results (quote \&quot;ERROR: Did not call code block: $CODE_BLOCK\&quot;)))&#xA;    (save-excursion&#xA;      (org-babel-goto-named-src-block \&quot;$CODE_BLOCK\&quot;)&#xA;      (let ((info (org-babel-get-src-block-info 'light)))&#xA;        (when info&#xA;          (save-excursion&#xA;        ;; go to the results, if there aren't any then run the block&#xA;        (goto-char (or (and (not re-run) (org-babel-where-is-src-block-result))&#xA;                   (progn (org-babel-execute-src-block)&#xA;                      (org-babel-where-is-src-block-result))))&#xA;        (end-of-line 1)&#xA;        (while (looking-at \&quot;[\n\r\t\f ]\&quot;) (forward-char 1))&#xA;        ;; open the results&#xA;        (if (looking-at org-bracket-link-regexp)&#xA;            ;; file results&#xA;            (org-open-at-point)&#xA;          (let ((r (org-babel-format-result&#xA;                (org-babel-read-result) (cdr (assq :sep (nth 2 info))))))&#xA;            (pop-to-buffer (get-buffer-create \&quot;*Org-Babel Results*\&quot;))&#xA;            (delete-region (point-min) (point-max))&#xA;            (insert r)&#xA;            (setq results (buffer-string))))&#xA;        t)))&#xA;      t)&#xA;    (princ (format \&quot;%s\&quot; results))&#xA;    )&#xA;&#xA;      (kill-buffer))&#xA;    '(\&quot;$FILE\&quot;))&#xA;  )&#xA;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Named Code Block Examples&lt;/h2&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Save as file named:&lt;/strong&gt; call-named-code-block-examples.org&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: get-org-version&#xA;#+BEGIN_SRC elisp &#xA;(format &quot;org-mode version: %s&quot; (org-version))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: get-org-version&#xA;: org-mode version: 9.0&#xA;&#xA;#+NAME: get-emacs-version&#xA;#+BEGIN_SRC ruby  :var emacs_version=(format &quot;Emacs Version: %s&quot; (substring (version) 10 16))&#xA;  emacs_version&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: get-emacs-version&#xA;: Emacs Version: 24.5.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="388" LastActivityDate="2016-11-14T15:50:47.567" Title="How to execute named code blocks written in any language using a shell script?" Tags="|org-mode|org-babel|command-line-arguments|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28644" PostTypeId="1" AcceptedAnswerId="28660" CreationDate="2016-11-14T03:07:41.913" Score="0" ViewCount="1901" Body="&lt;p&gt;Only when I'm trying to compile + link to the pthread library, I'm getting this error from Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: compilation; default-directory: &quot;~/GITHUB/kandr/&quot; -*-&#xA;Compilation started at Mon Nov 14 02:50:59&#xA;&#xA;cc -Wall -Wextra -pedantic -std=c11 -g -lpthread how_to_thread.c -o ./bin/how_to_thread&#xA;/usr/bin/ld: ne peut ouvrir le fichier de sortie ./bin/how_to_thread: Aucun fichier ou dossier de ce type&#xA;collect2: error: ld returned 1 exit status&#xA;&#xA;Compilation exited abnormally with code 1 at Mon Nov 14 02:50:59&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to type the same command: &lt;code&gt;cc -Wall -Wextra -pedantic -std=c11 -g -lpthread how_to_thread.c -o ./bin/how_to_thread&lt;/code&gt; directly from the command line, and I have no error, the compilation went fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem seems to occur only when I need to link (-lpthread). Compiling from Emacs a simple c source code, wich doesn't need a library to be linked brings not compilation errors. Is there something I'm doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2016-11-14T19:03:06.270" Title="Compilation exiting abnormally with code 1 only when inside Emacs + liking to pthread library" Tags="|c|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28645" PostTypeId="1" AcceptedAnswerId="28662" CreationDate="2016-11-14T06:42:27.533" Score="3" ViewCount="312" Body="&lt;p&gt;Whenever I open a file using emacs &lt;strong&gt;without&lt;/strong&gt; &lt;strong&gt;gui&lt;/strong&gt; (&lt;code&gt;emacs --no-window-system&lt;/code&gt;) it modifies the file with the following text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;12;rgb:0000/0000/0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This text is inserted at the beginning of the file. How can I debug what is happening? How to prevent this from happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATES&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This problems appears only when using &lt;strong&gt;SSH&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;DETAILS&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error appears in two cases &lt;strong&gt;CentOS 5&lt;/strong&gt; and &lt;strong&gt;CentOS 6&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs &lt;strong&gt;version&lt;/strong&gt; 24.5.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command I'm using to open the files is: &lt;code&gt;emacs --no-window-system file.txt&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems happens even when &lt;strong&gt;disabling&lt;/strong&gt; all &lt;strong&gt;customizations&lt;/strong&gt; (&lt;a href=&quot;https://emacs.stackexchange.com/questions/28429/how-do-i-troubleshoot-emacs-problems&quot;&gt;How do I troubleshoot Emacs problems?&lt;/a&gt;), e.g.: it persists when using (&lt;code&gt;emacs --no-window-system -Q file.txt&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="13701" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-02-03T18:03:14.570" Title="Emacs without GUI adding extra text to opened files" Tags="|debugging|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28646" PostTypeId="1" CreationDate="2016-11-14T07:13:11.303" Score="3" ViewCount="2213" Body="&lt;p&gt;For example when I select a word I want the same words to be automatically highlighted just like it in Notepad++:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I select the word &quot;install&quot; in Notepad++ (all other &quot;install&quot; are highlighted&quot;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/peA5X.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/peA5X.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;spacemacs&lt;/code&gt;. I tried the package &lt;code&gt;auto-highlight-symbol&lt;/code&gt; and also the package &lt;code&gt;highlight-symbol&lt;/code&gt;. Set mode to 1 in &lt;code&gt;.spacemacs&lt;/code&gt;. But when I select a word no other same words highlighted:&lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="13594" LastEditDate="2016-11-16T04:21:27.647" LastActivityDate="2021-09-16T14:18:18.910" Title="How to automatically highlight all the words same with selection just like Notepad++" Tags="|syntax-highlighting|highlighting|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28647" PostTypeId="1" AcceptedAnswerId="28648" CreationDate="2016-11-14T08:43:42.400" Score="8" ViewCount="11377" Body="&lt;p&gt;I am having an issue with one of the plugins i am running because its trying to use fish and does not like the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way i can change emacs to use bash for any plugins that use shell-command or similar functions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;SHELL&quot; &quot;/bin/bash&quot;)&#xA;(setq explicit-shell-file-name &quot;/bin/bash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried the above but shell-command still seems to use fish.&lt;/p&gt;&#xA;" OwnerUserId="13729" LastActivityDate="2023-11-07T05:50:36.177" Title="How do i change the default shell for shell-command" Tags="|shell|shell-command|default|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28648" PostTypeId="2" ParentId="28647" CreationDate="2016-11-14T09:05:37.783" Score="11" Body="&lt;p&gt;You need to change the option &lt;code&gt;shell-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(setenv &quot;SHELL&quot; &quot;/bin/bash&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This doesn't work since Emacs is already running thus it's too late, Emacs initializes &lt;code&gt;shell-file-name&lt;/code&gt; according to  &lt;code&gt;SHELL&lt;/code&gt; during startup. Something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ SHELL=/bin/bash emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should work.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(setq explicit-shell-file-name &quot;/bin/bash&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is for &lt;code&gt;M-x shell&lt;/code&gt;, not &lt;code&gt;M-x shell-command&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-14T09:05:37.783" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28649" PostTypeId="1" AcceptedAnswerId="28663" CreationDate="2016-11-14T09:29:57.490" Score="1" ViewCount="487" Body="&lt;p&gt;I recently upgraded to yasnippet 0.10.0, on emacs 24.5.1/OS X and noticed that some of my yasnippets are not loaded anymore, but this only affects some. I can see that these are still in the compiled list of snippet, but entering the snippet key and TAB doesn't do anything anymore. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried reloading and recompiling the list of yasnippets, but didn't have any luck. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the snippets that doesn't work anymore looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet; require-final-newline: nil -*-&#xA;# name: function&#xA;# key: lerj&#xA;# --&#xA;error_log(json_encode($0));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My yasnippet setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq yas-snippet-dirs '(&quot;~/Documents/playground/emacs/my-emacs-config/yasnippet-snippets&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the compiled file &lt;code&gt;.yas-compiled-snippets.el&lt;/code&gt; I can also see that the snippet is registered:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;lerj&quot; &quot;lerj\n$0&quot; &quot;function&quot; nil nil nil &quot;/Users/max/Documents/playground/emacs/my-emacs-config/yasnippet-snippets/php-mode/log-error-json_encode&quot; nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But also when executing &lt;code&gt;yas-describe-tables&lt;/code&gt; only 2 snippets are liseted, but not the &lt;code&gt;lerj&lt;/code&gt; one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only noticed that behaviour since I upgraded yasnippet to a more recent version, but I couldn't find any similar bug report. &lt;/p&gt;&#xA;" OwnerUserId="9623" LastActivityDate="2016-11-15T02:13:06.917" Title="Some yasnippets don't load anymore" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28650" PostTypeId="1" CreationDate="2016-11-14T10:00:26.797" Score="0" ViewCount="267" Body="&lt;p&gt;I've a hard time to make Gnus working properly. I got the following error :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Debugger entered--Lisp error: (void-function nnir-search-engine)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Any idea what is wrong? I precise that I've no problem sending some mails, so the SMTP side is fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can provide the full backtrace error if needed. Thanks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My config:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've the following in &lt;code&gt;~/.gnus.el&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'nnir) &#xA;;; I added this require just in case but does not change anything&#xA;&#xA;(setq gnus-select-method&#xA;      '(nnimap &quot;gmail&quot;&#xA;           (nnimap-address &quot;imap.gmail.com&quot;)&#xA;           (nnimap-server-port 993)&#xA;           (nnimap-stream ssl)))&#xA;               (nnir-search-engine imap)&#xA;               (nnimap-authinfo-file &quot;~/.authinfo&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.profile&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export EMAIL=&quot;my_mail@gmail.com&quot;&#xA;export NAME=&quot;Rico&quot;&#xA;export SMTPSERVER=&quot;smtp.gmail.com&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.authinfo&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine SMTP.gmail.com login my_mail@gmail.com port 465 password my_pwd&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="10269" LastEditDate="2017-04-05T09:31:11.957" LastActivityDate="2017-06-04T11:08:34.333" Title="issue with nnir-search-engine -- Gnus" Tags="|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28651" PostTypeId="2" ParentId="28641" CreationDate="2016-11-14T10:40:08.373" Score="1" Body="&lt;p&gt;Here a solution (works only if buffers are different per windows)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun toggle-mode-line-buffer-name-face (window)&#xA;  (with-current-buffer (window-buffer window)&#xA;    (if (eq (current-buffer) (window-buffer (selected-window)))&#xA;        (face-remap-reset-base 'mode-line-buffer-id)&#xA;      (face-remap-set-base 'mode-line-buffer-id '(:bold nil)))))&#xA;(add-hook 'buffer-list-update-hook (lambda () (walk-windows #'toggle-mode-line-buffer-name-face nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2016-11-14T15:38:27.717" LastActivityDate="2016-11-14T15:38:27.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28653" PostTypeId="1" CreationDate="2016-11-14T12:24:06.380" Score="2" ViewCount="380" Body="&lt;p&gt;I have Helm installed and added this line to the end of the init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map [remap find-file] 'helm-find-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, when I restart Emacs and try &lt;code&gt;C-x C-f&lt;/code&gt; it executes &lt;code&gt;helm-find-files&lt;/code&gt;. But all subsequent &lt;code&gt;C-x C-f&lt;/code&gt; are executing plain &lt;code&gt;find-file&lt;/code&gt;. Why?&lt;/p&gt;&#xA;" OwnerUserId="13983" LastActivityDate="2019-02-28T23:01:40.303" Title="Remapping find-file to helm-find-files" Tags="|helm|keymap|find-file|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28654" PostTypeId="1" CreationDate="2016-11-14T15:00:35.800" Score="3" ViewCount="650" Body="&lt;h2&gt;Background&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Used vim for 15+ years. Currently using Emacs + Evil + Cider (Clojure).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;My Ideal Workflow (this part is not the question -- merely describing my ideal workflow)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Three vertical panes.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+---------+--------------------------+----------------------+&#xA;|         |                          |                      |&#xA;| NeoTree | Main Editing Window      | Eshell / Repl / Msgs |&#xA;| Win1    | Win2                     | Win3                 |&#xA;|         |                          |                      |&#xA;|         |                          |                      |&#xA;|         |                          |                      |&#xA;|         |                          |                      |&#xA;|         |                          |                      |&#xA;|         |                          |                      |&#xA;|         |                          |                      |&#xA;+---------+--------------------------+----------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, at this point, I want the following things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs ignore other window comands, i.e. ignore C-x 2, C-x 3, C-x 1&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;NeoTree never gets modified -- it stays as NeoTree.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;Main Editing Window&quot; never gets &quot;auto replaced&quot; -- it only changes in response to direct commands by me: C-x f, C-x C-b, C-x b, or clicking on NeoTree&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Everything else (msgs, anything that pops up, any other replacement) gets sent to my &quot;Eshell / Repl / Msgs&quot; window).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Quick way to switch the &quot;Eshell / Repl / Msgs&quot; window, i.e. C-c a = &quot;make that window be eshell&quot;, C-c b = &quot;make taht window repl&quot;, etc ...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm not even sure where to begin on this. Please send me proper suggestions. (I'm perfectly happy to read documentation).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Concrete Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I want to tell emacs the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Do not ever create new windows/frames. Do not ever touch win1/win2 without my permission. If you ever want to show me more info, shove it to win3.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Win1 should always be NeoTree. Win2 should always be whatever I edit. I don't want new windows/frames ever created or split. I want everything new shoved into Win3.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13974" LastEditorUserId="13974" LastEditDate="2016-11-14T16:14:40.690" LastActivityDate="2016-11-14T16:14:40.690" Title="Emacs Fixed Layout" Tags="|window|frames|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28655" PostTypeId="2" ParentId="28643" CreationDate="2016-11-14T15:35:07.727" Score="6" Body="&lt;p&gt;In you &lt;code&gt;progn&lt;/code&gt;, you do load org-babel, but &lt;strong&gt;don't load any extra languages&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages.html#configure&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/worg/org-contrib/babel/languages.html#configure&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does work in your regular Emacs session because these are obviously loaded somewhere in your init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I've saved your script and edited it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;# -*- mode: shell-script -*-&#xA;#&#xA;# Call named code block in org-mode file&#xA;#&#xA;DIR=`pwd`&#xA;FILE=$1&#xA;CODE_BLOCK=$2&#xA;&#xA;emacs -Q --batch \&#xA;  --eval &quot;&#xA;(progn&#xA;  (require 'org)(require 'ob)(require 'ob-table)(setq org-confirm-babel-evaluate nil)&#xA;;; Don't forget to load languages&#xA;;; ------8&amp;lt;------------------&#xA;(org-babel-do-load-languages&#xA;   'org-babel-load-languages&#xA;   '((sh . t)&#xA;     (ruby . t)&#xA;     (emacs-lisp . t)&#xA;     ))&#xA;;; ------8&amp;lt;------------------&#xA;  (mapc (lambda (file)&#xA;        (find-file (expand-file-name file \&quot;$DIR\&quot;))&#xA;        (let ((re-run (quote t))&#xA;          (results (quote \&quot;ERROR: Did not call code block: $CODE_BLOCK\&quot;)))&#xA;    (save-excursion&#xA;      (org-babel-goto-named-src-block \&quot;$CODE_BLOCK\&quot;)&#xA;      (let ((info (org-babel-get-src-block-info 'light)))&#xA;        (when info&#xA;          (save-excursion&#xA;        ;; go to the results, if there aren't any then run the block&#xA;        (goto-char (or (and (not re-run) (org-babel-where-is-src-block-result))&#xA;                   (progn (org-babel-execute-src-block)&#xA;                      (org-babel-where-is-src-block-result))))&#xA;        (end-of-line 1)&#xA;        (while (looking-at \&quot;[\n\r\t\f ]\&quot;) (forward-char 1))&#xA;        ;; open the results&#xA;        (if (looking-at org-bracket-link-regexp)&#xA;            ;; file results&#xA;            (org-open-at-point)&#xA;          (let ((r (org-babel-format-result&#xA;                (org-babel-read-result) (cdr (assq :sep (nth 2 info))))))&#xA;            (pop-to-buffer (get-buffer-create \&quot;*Org-Babel Results*\&quot;))&#xA;            (delete-region (point-min) (point-max))&#xA;            (insert r)&#xA;            (setq results (buffer-string))))&#xA;        t)))&#xA;      t)&#xA;    (princ (format \&quot;%s\&quot; results))&#xA;    )&#xA;&#xA;      (kill-buffer))&#xA;    '(\&quot;$FILE\&quot;))&#xA;  )&#xA;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then created a test Org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: test-ruby-block&#xA;#+BEGIN_SRC ruby :results output&#xA;puts &quot;HELLO&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: test-ruby-block&#xA;: HELLO&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And checked your script on it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hoodoo@T450s [06:32:51 PM] [~/Org] [master *]&#xA;-&amp;gt; % bash org-babel-run.sh test-script.org test-ruby-block&#xA;Position saved to mark ring, go back with C-c &amp;amp;.&#xA;executing Ruby code block (test-ruby-block)...&#xA;Code block evaluation complete.&#xA;HELLO%&#xA;hoodoo@T450s [06:32:59 PM] [~/Org] [master *]&#xA;-&amp;gt; %&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: Don't use this code as is, it's potentially dangerous:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hoodoo@T450s [06:32:59 PM] [~/Org] [master *]&#xA;-&amp;gt; % bash org-babel-run.sh test-script.org no-such-block&#xA;source-code block ‘no-such-block’ not found in this buffer&#xA;executing Ruby code block (test-ruby-block)...&#xA;Code block evaluation complete.&#xA;HELLO% &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code block is evaluated anyway, if you have unlink somewhere in your file it might result in a huge mess.&lt;/p&gt;&#xA;" OwnerUserId="12333" LastEditorUserId="12333" LastEditDate="2016-11-14T15:50:47.567" LastActivityDate="2016-11-14T15:50:47.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28656" PostTypeId="1" CreationDate="2016-11-14T16:13:24.240" Score="4" ViewCount="174" Body="&lt;p&gt;Is there a good robust method to draw with colors in artist-mode or a similar mode?  By this I mean setting the foreground and background faces to colors such as red, green, blue, etc. for individual &quot;pixels&quot; (characters) when drawing with the mouse or programmatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've concluded it's not supported out of the box as the only notion of &quot;color&quot; in artist.el corresponds to character weight (&lt;code&gt;M&lt;/code&gt; is &quot;darker&quot; than &lt;code&gt;-&lt;/code&gt;) and there is no mention of faces.  Since artist-mode relies on characters rather than strings (&lt;code&gt;artist-fill-char-set&lt;/code&gt;, &lt;code&gt;artist-line-char&lt;/code&gt;, etc.), the user can't propertize with a face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experiments adding face properties to inserted characters (in &lt;code&gt;artist-replace-char&lt;/code&gt; and &lt;code&gt;artist-replace-chars&lt;/code&gt;) are somewhat successful.  Before I dig into fixing the hygiene of inserted character faces I want to check be sure that I'm not duplicating existing work!&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-11-14T16:13:24.240" Title="Use colors with artist-mode" Tags="|colors|artist-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28657" PostTypeId="1" CreationDate="2016-11-14T16:42:14.030" Score="0" ViewCount="220" Body="&lt;h2&gt;I mess up my non edited question. Here is the right question&lt;/h2&gt;&#xA;&lt;p&gt;In the previous version of the question I mixed two different things I was having problems with.&lt;/p&gt;&#xA;&lt;p&gt;I was trying to export a literate &lt;code&gt;LaTeX&lt;/code&gt; code using &lt;code&gt;#+begin_latex ... #+end_latex&lt;/code&gt; syntax, and it was note the right thing to do. &lt;em&gt;Thanks to t-verron for answer my doubt&lt;/em&gt; even when I posted the wrong question.&lt;/p&gt;&#xA;&lt;p&gt;Sorry for screwing this up!&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;I'm trying to set specific attributes for LaTeX in an =org= file, but the &lt;code&gt;#+attr_latex&lt;/code&gt; command does not work (see the first edit below)... moreover, only the =verse=, =export=, =center=, =source=, =example=, =quote= and =comment= seems to be available.&lt;/p&gt;&#xA;&lt;p&gt;Is this a problem of =org-9.0= ?&lt;/p&gt;&#xA;&lt;p&gt;Setup: Emacs 24.4.1, org 9.0 (from org repo, with org-plus-contrib)&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;First Edit:&lt;/strong&gt; To my understanding, the &lt;code&gt;attr_latex&lt;/code&gt; is supposed to assure that the code in between is exported literally. However, once my file is exported, I get a &lt;code&gt;\begin{latex} ... \end{latex}&lt;/code&gt; environment (which inserts a &lt;code&gt;\LaTeX&lt;/code&gt; command before the code.&lt;/p&gt;&#xA;&lt;p&gt;The following code in &lt;code&gt;org&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_LaTeX&#xA;  \begin{dmath}&#xA;    \label{4dfull}&#xA;    S[{\Gamma},T,A] =&#xA;    \int\dn{4}{x}\bigg[&#xA;      B_1\, R_{\mu\nu}{}^{\mu}{}_{\rho} T^{\nu,\alpha\beta}T^{\rho,\gamma\delta}\epsilon_{\alpha\beta\gamma\delta}&#xA;      +B_2\, R_{\mu\nu}{}^{\sigma}{}_\rho T^{\beta,\mu\nu}T^{\rho,\gamma\delta}\epsilon_{\sigma\beta\gamma\delta}&#xA;      +B_3\, R_{\mu\nu}{}^{\mu}{}_{\rho} T^{\nu,\rho\sigma}A_\sigma&#xA;      +B_4\, R_{\mu\nu}{}^{\sigma}{}_\rho T^{\rho,\mu\nu}A_\sigma&#xA;      +B_5\, R_{\mu\nu}{}^{\rho}{}_\rho T^{\sigma,\mu\nu}A_\sigma&#xA;      +C_1\, R_{\mu\rho}{}^{\mu}{}_\nu \nabla_\sigma T^{\nu,\rho\sigma}&#xA;      +C_2\, R_{\mu\nu}{}^{\rho}{}_\rho \nabla_\sigma T^{\sigma,\mu\nu} &#xA;      +D_1\, T^{\alpha,\mu\nu}T^{\beta,\rho\sigma}\nabla_\gamma T^{(\lambda, \kappa) \gamma}\epsilon_{\beta\mu\nu\lambda}\epsilon_{\alpha\rho\sigma\kappa}&#xA;      +D_2\,T^{\alpha,\mu\nu}T^{\lambda,\beta\gamma}\nabla_\lambda T^{\delta,\rho\sigma}\epsilon_{\alpha\beta\gamma\delta}\epsilon_{\mu\nu\rho\sigma}&#xA;      +D_3\,T^{\mu,\alpha\beta}T^{\lambda,\nu\gamma}\nabla_\lambda T^{\delta,\rho\sigma}\epsilon_{\alpha\beta\gamma\delta}\epsilon_{\mu\nu\rho\sigma}&#xA;      +D_4\,T^{\lambda,\mu\nu}T^{\kappa,\rho\sigma}\nabla_{(\lambda} A_{\kappa)} \epsilon_{\mu\nu\rho\sigma}&#xA;      +D_5\,T^{\lambda,\mu\nu}\nabla_{[\lambda}T^{\kappa,\rho\sigma} A_{\kappa]} \epsilon_{\mu\nu\rho\sigma}&#xA;      +D_6\,T^{\lambda,\mu\nu}A_\nu\nabla_{(\lambda} A_{\mu)}&#xA;      +D_7\,T^{\lambda,\mu\nu}A_\lambda\nabla_{[\mu} A_{\nu]} &#xA;      +E_1\,\nabla_{(\rho} T^{\rho,\mu\nu}\nabla_{\sigma)} T^{\sigma,\lambda\kappa}\epsilon_{\mu\nu\lambda\kappa}&#xA;      +E_2\,\nabla_{(\lambda} T^{\lambda,\mu\nu}\nabla_{\mu)} A_\nu&#xA;      +T^{\alpha,\beta\gamma}T^{\delta,\eta\kappa}T^{\lambda,\mu\nu}T^{\rho,\sigma\tau}&#xA;      \Big(F_1\,\epsilon_{\beta\gamma\eta\kappa}\epsilon_{\alpha\rho\mu\nu}\epsilon_{\delta\lambda\sigma\tau}&#xA;      +F_2\,\epsilon_{\beta\lambda\eta\kappa}\epsilon_{\gamma\rho\mu\nu}\epsilon_{\alpha\delta\sigma\tau}\Big) &#xA;      +F_3\, T^{\rho,\alpha\beta}T^{\gamma,\mu\nu}T^{\lambda,\sigma\tau}A_\tau \epsilon_{\alpha\beta\gamma\lambda}\epsilon_{\mu\nu\rho\sigma}&#xA;      +F_4\,T^{\eta,\alpha\beta}T^{\kappa,\gamma\delta}A_\eta A_\kappa\epsilon_{\alpha\beta\gamma\delta}\bigg],&#xA;  \end{dmath}&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;is exported to LaTeX as&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;\begin{LaTeX}&#xA;\begin{dmath}&#xA;  \label{4dfull}&#xA;  S[{\Gamma},T,A] =&#xA;  \int\dn{4}{x}\bigg[&#xA;    B_1\, R_{\mu\nu}{}^{\mu}{}_{\rho} T^{\nu,\alpha\beta}T^{\rho,\gamma\delta}\epsilon_{\alpha\beta\gamma\delta}&#xA;    +B_2\, R_{\mu\nu}{}^{\sigma}{}_\rho T^{\beta,\mu\nu}T^{\rho,\gamma\delta}\epsilon_{\sigma\beta\gamma\delta}&#xA;    +B_3\, R_{\mu\nu}{}^{\mu}{}_{\rho} T^{\nu,\rho\sigma}A_\sigma&#xA;    +B_4\, R_{\mu\nu}{}^{\sigma}{}_\rho T^{\rho,\mu\nu}A_\sigma&#xA;    +B_5\, R_{\mu\nu}{}^{\rho}{}_\rho T^{\sigma,\mu\nu}A_\sigma&#xA;    +C_1\, R_{\mu\rho}{}^{\mu}{}_\nu \nabla_\sigma T^{\nu,\rho\sigma}&#xA;    +C_2\, R_{\mu\nu}{}^{\rho}{}_\rho \nabla_\sigma T^{\sigma,\mu\nu} &#xA;    +D_1\, T^{\alpha,\mu\nu}T^{\beta,\rho\sigma}\nabla_\gamma T^{(\lambda, \kappa) \gamma}\epsilon_{\beta\mu\nu\lambda}\epsilon_{\alpha\rho\sigma\kappa}&#xA;    +D_2\,T^{\alpha,\mu\nu}T^{\lambda,\beta\gamma}\nabla_\lambda T^{\delta,\rho\sigma}\epsilon_{\alpha\beta\gamma\delta}\epsilon_{\mu\nu\rho\sigma}&#xA;    +D_3\,T^{\mu,\alpha\beta}T^{\lambda,\nu\gamma}\nabla_\lambda T^{\delta,\rho\sigma}\epsilon_{\alpha\beta\gamma\delta}\epsilon_{\mu\nu\rho\sigma}&#xA;    +D_4\,T^{\lambda,\mu\nu}T^{\kappa,\rho\sigma}\nabla_{(\lambda} A_{\kappa)} \epsilon_{\mu\nu\rho\sigma}&#xA;    +D_5\,T^{\lambda,\mu\nu}\nabla_{[\lambda}T^{\kappa,\rho\sigma} A_{\kappa]} \epsilon_{\mu\nu\rho\sigma}&#xA;    +D_6\,T^{\lambda,\mu\nu}A_\nu\nabla_{(\lambda} A_{\mu)}&#xA;    +D_7\,T^{\lambda,\mu\nu}A_\lambda\nabla_{[\mu} A_{\nu]} &#xA;    +E_1\,\nabla_{(\rho} T^{\rho,\mu\nu}\nabla_{\sigma)} T^{\sigma,\lambda\kappa}\epsilon_{\mu\nu\lambda\kappa}&#xA;    +E_2\,\nabla_{(\lambda} T^{\lambda,\mu\nu}\nabla_{\mu)} A_\nu&#xA;    +T^{\alpha,\beta\gamma}T^{\delta,\eta\kappa}T^{\lambda,\mu\nu}T^{\rho,\sigma\tau}&#xA;    \Big(F_1\,\epsilon_{\beta\gamma\eta\kappa}\epsilon_{\alpha\rho\mu\nu}\epsilon_{\delta\lambda\sigma\tau}&#xA;    +F_2\,\epsilon_{\beta\lambda\eta\kappa}\epsilon_{\gamma\rho\mu\nu}\epsilon_{\alpha\delta\sigma\tau}\Big) &#xA;    +F_3\, T^{\rho,\alpha\beta}T^{\gamma,\mu\nu}T^{\lambda,\sigma\tau}A_\tau \epsilon_{\alpha\beta\gamma\lambda}\epsilon_{\mu\nu\rho\sigma}&#xA;    +F_4\,T^{\eta,\alpha\beta}T^{\kappa,\gamma\delta}A_\eta A_\kappa\epsilon_{\alpha\beta\gamma\delta}\bigg],&#xA;\end{dmath}&#xA;\end{LaTeX}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and shown as &lt;code&gt;PDF&lt;/code&gt; as (notice the word &lt;code&gt;LaTeX&lt;/code&gt; just before the equation)&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nc1Tn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nc1Tn.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;In addition, when I want to use &lt;code&gt;pcomplete&lt;/code&gt; to insert the &lt;code&gt;attr_latex&lt;/code&gt;, it is not shown as an available option.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Q1:&lt;/strong&gt; How can the appearance of the word LaTeX be avoided?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Q2:&lt;/strong&gt; What should I do to have the &lt;code&gt;attr_latex&lt;/code&gt; in the &lt;code&gt;pcomplete&lt;/code&gt; setup?&lt;/p&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-11-17T14:04:53.753" Title="Exporting LaTeX fracments - The right way!" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28658" PostTypeId="1" AcceptedAnswerId="28659" CreationDate="2016-11-14T16:46:33.410" Score="3" ViewCount="378" Body="&lt;p&gt;I often use scratch buffers, when I want to take a closer look at some code. However I can't enable &lt;code&gt;flyspell&lt;/code&gt; in scratch buffers. Is there a way to also use it when not editing a file ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't enable &lt;code&gt;flyspell-mode&lt;/code&gt; while the buffer isn't saved to a file. When I use it in a scratch buffer I only get this message in the echo area &lt;code&gt;Flyspell mode disabled in current buffer&lt;/code&gt;. No matter how often I try to activate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to lawlist I found the problem. It seems, that I ignored &lt;code&gt;flyspell-lazy-mode&lt;/code&gt; consequently while I was looking for the problem.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This package also forces flyspell-mode off completely for certain&#xA;  buffers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&quot;Certain buffers&quot; seems to include scratch buffers, but not buffers that are attached to a file. lawlist was right so I reward his correct answer and also his patience.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-11-15T18:21:20.110" LastActivityDate="2016-11-15T18:21:20.110" Title="Is it possible to enable flyspell in scratch buffers?" Tags="|flyspell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28659" PostTypeId="2" ParentId="28658" CreationDate="2016-11-14T16:53:55.473" Score="2" Body="&lt;p&gt;The default major-mode for the &lt;code&gt;*Scratch*&lt;/code&gt; buffer is &lt;code&gt;lisp-interaction-mode&lt;/code&gt;.  In this example, we use the &lt;code&gt;emacs-lisp-mode-hook&lt;/code&gt; -- &lt;code&gt;lisp-interaction-mode&lt;/code&gt; is &lt;em&gt;derived&lt;/em&gt; from &lt;code&gt;emacs-lisp-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook 'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another method is to use the &lt;code&gt;lisp-interaction-mode-hook&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'lisp-interaction-mode-hook 'flyspell-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another method is to call &lt;code&gt;flyspell-mode&lt;/code&gt; manually with:  &lt;code&gt;M-x flyspell-mode&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-14T16:59:42.030" LastActivityDate="2016-11-14T16:59:42.030" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28660" PostTypeId="2" ParentId="28644" CreationDate="2016-11-14T19:03:06.270" Score="0" Body="&lt;p&gt;Not sure if this is the only problem, however:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in general, command line parameters are processed in the order listed on the command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the &lt;code&gt;-lpthread&lt;/code&gt; is listed before the source file and output file so the linker processes the &lt;code&gt;pthread&lt;/code&gt; library before processing the object file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The linker only picks up an entry from a library if it resolves an external reference.  But since the library was processed first, there is no external reference to resolve. (it does not have any unresolved external reference until it processes the object file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fix is simple:  place the library after the object file (preferably at the end of the command line) similar to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cc -Wall -Wextra -pedantic -std=c11 -g how_to_thread.c -o ./bin/how_to_thread -lpthread&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to make this more obvious and as a general good practice. separate the compile step from the link step, similar to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cc -Wall -Wextra -pedantic -std=c11 -g -c how_to_thread.c -o how_to_thread.o&#xA;cc -g how_to_thread.o -o ./bin/how_to_thread -lpthread&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11256" LastActivityDate="2016-11-14T19:03:06.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28661" PostTypeId="2" ParentId="5371" CreationDate="2016-11-14T21:54:25.677" Score="21" Body="&lt;p&gt;The &lt;code&gt;transpose-frame&lt;/code&gt; package is available on &lt;a href=&quot;https://melpa.org/#/transpose-frame&quot; rel=&quot;noreferrer&quot;&gt;MELPA&lt;/a&gt; as well.&lt;/p&gt;&#xA;&lt;p&gt;Use &lt;code&gt;M-x transpose-frame&lt;/code&gt;, or bind it to something to accomplish this.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="9019" LastEditDate="2020-12-19T02:57:22.483" LastActivityDate="2020-12-19T02:57:22.483" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28662" PostTypeId="2" ParentId="28645" CreationDate="2016-11-14T21:58:59.413" Score="2" Body="&lt;h2&gt;Some general debugging tips&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Try to get the debugger invoked when something tries to insert this text. This will give you a backtrace which should at least let you know what is doing the inserting, and hopefully that will in turn lead you towards how to work around the bug. Locate a &lt;em&gt;read-only&lt;/em&gt; file &lt;code&gt;read-only-file.txt&lt;/code&gt; (for example an OS file) and run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval '(setq debug-on-error t debug-ignored-errors nil)' -nw read-only-file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should also determine whether the issue is with Emacs startup or with file opening. If you run plain &lt;code&gt;emacs -nw&lt;/code&gt;, is the text inserted somewhere? If you open another file, is the text inserted into it as well? In the latter case, you can set &lt;code&gt;debug-on-error&lt;/code&gt; and &lt;code&gt;debug-ignored-errors&lt;/code&gt; after starting Emacs and open any file read-only with &lt;code&gt;M-x view-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have trouble locating which package or which part of the init file is responsible for something, the tips in &lt;a href=&quot;https://emacs.stackexchange.com/questions/28429/how-do-i-troubleshoot-emacs-problems&quot;&gt;How do I troubleshoot Emacs problems?&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/questions/1045/how-to-debug-startup-problem-if-debug-init-has-no-effect&quot;&gt;How to debug startup problem, if `--debug-init&amp;#39; has no effect&lt;/a&gt; should help.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What is causing this&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Given the text that's inserted, there's a good chance that the above generic tips will be unhelpful because they'll point at &lt;code&gt;self-insert-command&lt;/code&gt;. The text looks like a response from a terminal when an application sends the &lt;a href=&quot;http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Operating-System-Commands&quot; rel=&quot;nofollow noreferrer&quot;&gt;escape sequence&lt;/a&gt; to query the terminal's color configuration. Normally, Emacs should send &lt;code&gt;\e]12;?\a&lt;/code&gt; (where &lt;code&gt;\e&lt;/code&gt; is the escape character, octal code 033, and &lt;code&gt;\a&lt;/code&gt; is the bell character, octal code 007, which can be replaced by character 034), and the terminal replies &lt;code&gt;\e]12;rgb:0000/0000/0000\a&lt;/code&gt; to say that the cursor color is black. It seems that something here is going wrong: Emacs is sending the color query command but not reading the response back. Your terminal configuration may be incorrect, or it may be a bug in the terminal code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check that the value of &lt;code&gt;TERM&lt;/code&gt; is correct. If you have any code or package that tries to talk to the terminal directly, review it. Check in particular the package whose name is the same as the value of &lt;code&gt;TERM&lt;/code&gt; — see the manual section about &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Terminal_002dSpecific.html#Terminal_002dSpecific&quot; rel=&quot;nofollow noreferrer&quot;&gt;terminal-specific initialization&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I can't think of a simple way to set a breakpoint where something writes to the terminal. If you can't find the source of the problem on your own, there are some complicated ways, such as running Emacs under GDB, or running Emacs under an Expect script that sends SIGUSR2 when it sees the escape sequence in question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To facilitate debugging, note that given the probable cause, it's likely that this text will be inserted every time you open a new terminal, so if you run the Emacs server you can set things up in an Emacs session and attach to a new terminal every time you want to test. This may help to debug: set a breakpoint at the beginning of the terminal setup function, and step through it until you find where it causes the problem (but note that the debugger's input/output may change the behavior of that part of the code).&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-11-14T21:58:59.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28663" PostTypeId="2" ParentId="28649" CreationDate="2016-11-15T02:13:06.917" Score="0" Body="&lt;p&gt;Loading a new snippet with the same name as an older one will overwrite the older one.  A similar issue is &lt;a href=&quot;https://github.com/joaotavora/yasnippet/issues/548#issuecomment-68224840&quot; rel=&quot;nofollow noreferrer&quot;&gt;#548&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;I'm not sure if having 2 snippets with the same name is supposed to work.&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;  &#xA;  &lt;p&gt;It isn't. Two snippets with the same key is fine though, and the name&#xA;  differentiates them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Another way to differentiate snippets is with the &lt;code&gt;uuid&lt;/code&gt; attribute. Loading a new snippet with the same name as an older one, but different &lt;code&gt;uuid&lt;/code&gt; should not overwrite the older one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So make sure your snippets have unique &lt;code&gt;name&lt;/code&gt; or &lt;code&gt;uuid&lt;/code&gt; attributes.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-11-15T02:13:06.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28664" PostTypeId="2" ParentId="27561" CreationDate="2016-11-15T08:13:01.943" Score="0" Body="&lt;p&gt;I had the same problem, and found &lt;code&gt;(setq select-enable-primary t)&lt;/code&gt; makes the situation.  I have sent it to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11248" LastActivityDate="2016-11-15T08:13:01.943" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28665" PostTypeId="1" AcceptedAnswerId="28670" CreationDate="2016-11-15T10:16:48.327" Score="6" ViewCount="894" Body="&lt;p&gt;I want to use &lt;code&gt;emacsclient&lt;/code&gt; to let my running instance of emacs evaluate a function and print the result to a terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, I want to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$ emacsclient --eval &quot;(frame-parameter (car (frame-list)) 'name)&quot;&lt;br&gt;&#xA;  *info*&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, instead, I get output like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;*info*&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I use &lt;code&gt;message&lt;/code&gt;, the output is displayed in some frame's minibuffer and I still get quoted output (&lt;code&gt;&quot;*info*&quot;&lt;/code&gt; instead of &lt;code&gt;*info*&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get &lt;code&gt;princ&lt;/code&gt;-like output to be output to my &lt;code&gt;emacsclient&lt;/code&gt; terminal?&lt;/p&gt;&#xA;" OwnerUserId="4085" LastEditorUserId="105" LastEditDate="2016-11-15T14:29:45.057" LastActivityDate="2021-04-04T00:02:51.743" Title="print unquoted output to stdout from emacsclient" Tags="|emacsclient|print|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28666" PostTypeId="1" AcceptedAnswerId="28669" CreationDate="2016-11-15T11:43:05.707" Score="1" ViewCount="137" Body="&lt;p&gt;Present 20161102 org mode now exports images by default wrapped in &lt;code&gt;\begin{center}..\end{center}&lt;/code&gt; environments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This destroys layouts and confuses export scripts made with earlier versions or different settings in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;\centering&lt;/code&gt; is added in the case of figures. This is in principle a bit less obtrusive, as here we are telling org to prepare the environment.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I turn off this &quot;feature&quot;?&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="105" LastEditDate="2016-11-15T20:02:18.913" LastActivityDate="2016-11-15T20:02:18.913" Title="Org mode 20161102 Latex export: Images without {center} environment" Tags="|org-mode|org-export|latex|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28668" PostTypeId="2" ParentId="28665" CreationDate="2016-11-15T14:52:43.353" Score="0" Body="&lt;p&gt;AFAIK it is not possible to redirect standard output from an emacs server directly with emacsclient alone.  As you found, the only output of is the value that the s-expression evaluates to.  &lt;code&gt;server-eval-at&lt;/code&gt; with &lt;code&gt;emacs --batch --eval&lt;/code&gt; looks like a good option.  If you still want to use emacsclient for some reason, here's one approach that will work for capturing standard output.  I'm not sure how to capture standard error in this manner.&lt;/p&gt;&#xA;&lt;p&gt;Since &lt;code&gt;emacsclient --eval&lt;/code&gt; does not capture any of the server's standard output streams, you will need to capture it as part of your s-expression:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &amp;quot;(with-output-to-string\&#xA;  (mapc\&#xA;   (lambda (frame)\&#xA;     (princ (format \&amp;quot;%s\\n\&amp;quot; (frame-parameter frame 'name))))\&#xA;   (frame-list)))&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Anything printed to standard output during within the body of &lt;code&gt;with-output-to-string&lt;/code&gt; is captured and returned as a string value.  You can then print that string output as Emacs otherwise (by using Emacs to interpret it):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval '(with-output-to-string \&#xA;  (mapc \&#xA;   (lambda (frame) \&#xA;     (princ (format &amp;quot;%s\\n&amp;quot; (frame-parameter frame \'name)))) \&#xA;   (frame-list)))' \&#xA;| emacs --batch --eval '(princ \&#xA;  (concat \&#xA;    (with-temp-buffer \&#xA;      (insert-file-contents &amp;quot;/dev/stdin&amp;quot;) \&#xA;      (read (current-buffer))) \&#xA;    &amp;quot;\n&amp;quot;))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The same command (in one line):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval '(with-output-to-string (princ &amp;quot;Hello, World!&amp;quot;))' | emacs --batch --eval '(princ (concat (with-temp-buffer (insert-file-contents &amp;quot;/dev/stdin&amp;quot;) (read (current-buffer))) &amp;quot;\n&amp;quot;))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2021-04-04T00:02:51.743" LastActivityDate="2021-04-04T00:02:51.743" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="28669" PostTypeId="2" ParentId="28666" CreationDate="2016-11-15T15:14:46.430" Score="3" Body="&lt;p&gt;Customize the variable &lt;code&gt;org-latex-images-centered&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13946" LastActivityDate="2016-11-15T15:14:46.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28670" PostTypeId="2" ParentId="28665" CreationDate="2016-11-15T17:10:09.157" Score="7" Body="&lt;p&gt;It seems that &lt;code&gt;emacsclient&lt;/code&gt; is the wrong way to do what I want.  I thought I could not use &lt;code&gt;emacs --batch&lt;/code&gt; because I wanted to get &quot;live&quot; info from my running &lt;code&gt;emacs&lt;/code&gt; instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The missing piece of the puzzle was the function &lt;code&gt;server-eval-at&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --batch --eval &quot;(progn (require 'server) (princ (format \&quot;%s\\n\&quot; (server-eval-at \&quot;server\&quot; '(frame-parameter (car (frame-list)) 'name)))))&quot;&#xA;*info*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, a more significant example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --batch --eval &quot;(progn (require 'server) (princ (format \&quot;%s\\n\&quot; (server-eval-at \&quot;server\&quot; '(mapconcat (lambda (f) (frame-parameter f 'name)) (frame-list) \&quot;\\n\&quot;)))))&quot;&#xA;*info*&#xA;CAPTURE-3-foo-service.org&#xA;SomeClass.java&#xA;SomeOtherClass.java&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2016-11-15T17:10:09.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28671" PostTypeId="1" CreationDate="2016-11-15T17:32:44.703" Score="2" ViewCount="493" Body="&lt;p&gt;I have a problem that I could not solve with the help of google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) How do I have to adjust the .emacs file in order to use the Windows-Key (Super-Key) for shortcuts. I am working on a Linux system and the system does not use this key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) How do I create my own shortcuts using this key – I am sure that I have to do that in the .emacs file also but I haven’t found out exactly how to do it. The reason why I want to do all this is, that I a recently switched from TeXstudio to Autctex and I want to use (at least till I am getting used to the Emacs/Auctex World) as many of my old shortcuts (For: begin{quote}, section, italics, footnote etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Win + i = Italics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Win + b = Bold&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Win + Z = Quote&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Win + F12 = begin{itemize}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Win + 1 = section&lt;/p&gt;&#xA;&#xA;&lt;p&gt;etc. etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I should move the questions elsewhere I would be glad to do it…&lt;/p&gt;&#xA;" OwnerUserId="13996" LastEditorUserId="105" LastEditDate="2016-11-15T20:02:01.560" LastActivityDate="2016-11-15T20:02:01.560" Title="How do I configure my own shortcuts in Auctex (Emacs)?" Tags="|key-bindings|init-file|auctex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28672" PostTypeId="2" ParentId="28671" CreationDate="2016-11-15T18:04:44.130" Score="5" Body="&lt;p&gt;Here is an example of what you want to accomplish:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;latex&quot;&#xA;  (define-key LaTeX-mode-map (kbd &quot;s-z&quot;)&#xA;    (lambda ()&#xA;      (interactive)&#xA;      (LaTeX-insert-environment &quot;quote&quot;)))&#xA;  (define-key LaTeX-mode-map (kbd &quot;s-&amp;lt;f12&amp;gt;&quot;)&#xA;    (lambda ()&#xA;      (interactive)&#xA;      (LaTeX-insert-environment &quot;itemize&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But please note that if you want to unleash the power of AUCTeX, you shouldn't try to mimic the shortcuts of other editors but exploit the default key-bindings.  Thus, for example, you can insert the all font-related commands with &lt;kbd&gt;C-c C-f C-X&lt;/kbd&gt;, where &lt;kbd&gt;X&lt;/kbd&gt; is a different letter for each different font command (&lt;kbd&gt;E&lt;/kbd&gt; for &lt;code&gt;\emph&lt;/code&gt;, &lt;kbd&gt;b&lt;/kbd&gt; for &lt;code&gt;\textbf&lt;/code&gt;, etc... issue &lt;kbd&gt;C-c C-f C-h&lt;/kbd&gt; for the complete list).  This is much more powerful than what you may expect because it's context-sensitive, it lets you insert the appropriate macro depending on whether you're in plain-TeX or LaTeX mode and on whether you're inside or outside an equation, always with the same key-bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the same way, &lt;kbd&gt;C-c C-s&lt;/kbd&gt; lets you insert a new sectioning command, there is no need to specify a different key-binding for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any environment can be inserted with &lt;kbd&gt;C-c C-e&lt;/kbd&gt;, which provides sensible default choices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any macro can be inserted with &lt;kbd&gt;C-c C-m&lt;/kbd&gt; (or &lt;kbd&gt;C-c RET&lt;/kbd&gt;), with a powerful autocompletion mechanism for the most common commands (more than 200 packages are supported).&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-11-15T18:04:44.130" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28673" PostTypeId="2" ParentId="28606" CreationDate="2016-11-15T18:23:26.953" Score="7" Body="&lt;p&gt;Install &lt;a href=&quot;https://www.emacswiki.org/emacs/NxmlMode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;nxml-mode&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.emacswiki.org/emacs/WhichFuncMode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;which-function-mode&lt;/code&gt;&lt;/a&gt;. Take the &lt;code&gt;nxml-where&lt;/code&gt; function from &lt;a href=&quot;https://www.emacswiki.org/emacs/NxmlMode#toc11&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; and add it to your &lt;code&gt;.emacs&lt;/code&gt; file followed by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xml-find-file-hook ()&#xA;  (when (derived-mode-p 'nxml-mode)&#xA;    (which-function-mode t)&#xA;    (setq which-func-mode t)&#xA;    (add-hook 'which-func-functions 'nxml-where t t)))&#xA;&#xA;(add-hook 'find-file-hook 'xml-find-file-hook t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13963" LastActivityDate="2016-11-15T18:23:26.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28674" PostTypeId="1" CreationDate="2016-11-15T18:30:21.200" Score="2" ViewCount="73" Body="&lt;p&gt;I consistently get the following problem on Emacs 24.5.1 with &lt;code&gt;folding&lt;/code&gt; package (version &lt;code&gt;20140401.3&lt;/code&gt;) for which I've found a workaround but would like to understand what was going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in the screenshot above, the emacs server started OK, but when I try to launch the &lt;code&gt;emacsclient&lt;/code&gt; it just hangs there:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EEZtu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EEZtu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; after killing &lt;code&gt;emacsclient&lt;/code&gt; with &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;C&lt;/kbd&gt; I get into a situation where nothing is echoed on my terminal as I type a command and, moreover, the command's output is mangled (line feed characters are apparently missing):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/cnkp9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cnkp9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upon further investigation I noticed that this behaviour was dependent on the type of file I was trying to open with &lt;code&gt;emacsclient&lt;/code&gt;. Some files triggered it, some not. Further digging pointed me to a message emitted by the &lt;code&gt;folding&lt;/code&gt; package (version &lt;code&gt;20140401.3&lt;/code&gt;) when I was trying to open the offending files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The message on the mini-buffer read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Folding error: mode is not in `folding-mode-marks-alist'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Upon adding the single line marked as &quot;line-A&quot; in my &lt;code&gt;.emacs&lt;/code&gt; the problem went away:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package folding&#xA;  :ensure t&#xA;  :config&#xA;  (folding-install-hooks)&#xA;  (defun my-always-fold ()&#xA;    (setq-local folded-file t))&#xA;  (advice-add #'folding-mode-find-file :before #'my-always-fold)&#xA;  (folding-add-to-marks-list 'json-mode &quot;foo&quot; &quot;foo&quot;) ;; line-A&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, even without the fix, directly opening the file using &lt;code&gt;emacs&lt;/code&gt; (not &lt;code&gt;emacsclient&lt;/code&gt;) does not result in this behaviour. Something a lot milder happens: the file is not placed in the buffer that's currently opened. Instead I am presented with the &lt;code&gt;*scratch*&lt;/code&gt; buffer and the file I asked to open is placed in another buffer. This is what I see when I press &lt;code&gt;C-x C-b&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hsSUI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hsSUI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;hellip; so I just use &lt;code&gt;C-x C-b&lt;/code&gt; and navigate to my buffer to bring it up. And there is no mangling at all at the terminal. This leds me to believe that the problem may also be related to emacs daemon / emacsclient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;was this problem related to &lt;code&gt;emacsclient&lt;/code&gt; or &lt;code&gt;folding&lt;/code&gt; mode ?&lt;/li&gt;&#xA;&lt;li&gt;how is it possible for &lt;code&gt;emacsclient&lt;/code&gt; to mangle my terminal's output even after it's killed and how could I have fixed the terminal output?&lt;/li&gt;&#xA;&lt;li&gt;is there another way to solve this problem? I don't want to have to specify folding marks for JSON files because folding makes no sense in JSON.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4003" LastEditorUserId="4003" LastEditDate="2016-11-15T19:42:36.250" LastActivityDate="2016-11-15T19:42:36.250" Title="mangled terminal output after failing emacsclient / folding mode launch" Tags="|code-folding|emacs-daemon|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28675" PostTypeId="1" AcceptedAnswerId="28693" CreationDate="2016-11-15T19:40:48.647" Score="1" ViewCount="187" Body="&lt;p&gt;when helm is active, I can press &lt;code&gt;C-c ?&lt;/code&gt; to open a buffer containing helpful information for the current helm session. Now, coming from vim, I'd like to have some evil-bindings in that window, but I'm not even able to determine the mode that the buffer is in, as everything except from a couple of keystrokes is not bound to anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I rebind keys in helm's help-buffer?&lt;/p&gt;&#xA;" OwnerUserId="13447" LastEditorUserId="105" LastEditDate="2016-11-15T20:01:26.957" LastActivityDate="2016-11-16T18:51:56.663" Title="Bindings in helm-help?" Tags="|helm|help|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28676" PostTypeId="1" AcceptedAnswerId="28683" CreationDate="2016-11-15T20:03:32.083" Score="5" ViewCount="706" Body="&lt;p&gt;I was just looking at &lt;a href=&quot;http://howardism.org/Technical/Emacs/literate-database.html&quot; rel=&quot;noreferrer&quot; title=&quot;Literate SQL org-mode example&quot;&gt;This literate SQL / org-mode example&lt;/a&gt; and see that org-mode supports username and password fields in a SQL source code block. As illustrated there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** MySQL Analysis&#xA;  :PROPERTIES:&#xA;  :engine:   mysql&#xA;  :dbhost:   localhost&#xA;  :database: &amp;lt;redacted&amp;gt;&#xA;  :dbuser:   &amp;lt;redacted&amp;gt;&#xA;  :dbpassword: &amp;lt;redacted&amp;gt;&#xA;  :cmdline:  --protocol=tcp&#xA;  :exports:  both&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As fun as storing credentials in plain text is, I'm hoping someone can suggest a straightforward path to pulling those critical bits from a gpg-encrypted .authinfo.gpg file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way of pulling those properties from .authinfo.gpg, emacs gurus?&lt;/p&gt;&#xA;" OwnerUserId="2457" LastActivityDate="2020-10-12T07:16:06.050" Title="Org-mode header properties from .authinfo.gpg?" Tags="|org-mode|org-babel|authinfo|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28677" PostTypeId="1" AcceptedAnswerId="28679" CreationDate="2016-11-15T22:45:28.940" Score="0" ViewCount="202" Body="&lt;p&gt;So I'm trying to use eclim with spacemacs and I have this function called &lt;code&gt;eclim-java-format&lt;/code&gt; which reformat the text as in eclipse. The problems is that it reformats tabs as tabs and not as space and it sets tabs length to 2 and I prefer working with 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know how I can tweek these tabs settings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even with emacs but not spacemacs answer is fine. I may try to figure out the rest of it.&lt;/p&gt;&#xA;" OwnerUserId="13997" LastEditorUserId="253" LastEditDate="2016-11-15T23:39:56.007" LastActivityDate="2016-11-15T23:50:10.980" Title="modify tab length for eclim-java-format" Tags="|spacemacs|whitespace|tabs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28678" PostTypeId="1" AcceptedAnswerId="28680" CreationDate="2016-11-15T23:41:30.493" Score="1" ViewCount="118" Body="&lt;p&gt;As per title, I want to define a kill buffer hook with the variable &lt;code&gt;kill-buffer-hook&lt;/code&gt; and the function should be able to detect when &lt;code&gt;(kill-buffer )&lt;/code&gt; has been called interactively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The use case is in that I'd like to control the buffer displayed after killings. &#xA;Anyway, there are a lot of hidden buffers opened and killed in the background, which should not trigger the hook actions. &lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-11-16T14:03:48.817" LastActivityDate="2016-11-16T14:03:48.817" Title="Detect interactive use of `kill-buffer` in `kill-buffer-hook`" Tags="|hooks|interactive|kill-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28679" PostTypeId="2" ParentId="28677" CreationDate="2016-11-15T23:50:10.980" Score="0" Body="&lt;p&gt;Ok I after at least 2h of searching I finally found &lt;a href=&quot;https://www.emacswiki.org/emacs/IndentingJava&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;! Which says :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'java-mode-hook (lambda ()&#xA;                            (setq c-basic-offset 4&#xA;                                  tab-width 4&#xA;                                  indent-tabs-mode t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I put it in my .spacemacs in user-config function and it worked :D&lt;/p&gt;&#xA;" OwnerUserId="13997" LastActivityDate="2016-11-15T23:50:10.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28680" PostTypeId="2" ParentId="28678" CreationDate="2016-11-16T01:27:03.663" Score="5" Body="&lt;p&gt;Test the variable &lt;code&gt;this-command&lt;/code&gt; to see whether it is &lt;code&gt;kill-buffer&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-11-16T01:27:03.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28681" PostTypeId="2" ParentId="28646" CreationDate="2016-11-16T07:10:59.403" Score="1" Body="&lt;p&gt;Use package &lt;a href=&quot;http://nschum.de/src/emacs/highlight-symbol/&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight-symbol&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(use-package highlight-symbol&#xA;  :ensure t&#xA;  :init&#xA;  (add-hook 'prog-mode-hook 'highlight-symbol-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-11-16T07:10:59.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28682" PostTypeId="1" AcceptedAnswerId="28695" CreationDate="2016-11-16T11:48:53.910" Score="1" ViewCount="290" Body="&lt;p&gt;If I compile my latex document in auctex, an overview window of the errors pops up where I can select specific errors and jump to that source code position. However after fixing the errors and compiling successfully the windows containing error messages remain open but showing another buffer, i.e. the initial window remains splitted. How can I make emacs to close those windows automatically after fixing the errors and recompiling successfully?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="2323" LastEditDate="2016-11-16T19:59:48.233" LastActivityDate="2016-11-16T21:27:39.250" Title="Close error list automatically after latex compiled successfully" Tags="|auctex|frames|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28683" PostTypeId="2" ParentId="28676" CreationDate="2016-11-16T12:28:14.397" Score="2" Body="&lt;p&gt;You could use a suitable lisp-function which returns the suitable string.&lt;/p&gt;&#xA;&lt;p&gt;E.g. if you already had function `my-secret-password' which picks the password for a user, you could write&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;** MySQL Analysis&#xA;:PROPERTIES:&#xA;:header-args:   :engine:   mysql&#xA;:header-args:   :dbhost:   localhost&#xA;:header-args:   :database: MY_DB&#xA;:header-args:   :dbuser:   DB_GUY&#xA;:header-args:   :dbpassword: (my-secret-password &amp;quot;DB_GUY@MY_DB&amp;quot; )&#xA;:header-args:   :cmdline:  --protocol=tcp&#xA;:header-args:   :exports:  both&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Also note the syntax of the properties for the recent Org version.&lt;/p&gt;&#xA;&lt;p&gt;It remains to write the suitable function (to replace the `my-secret-password' from above.)&lt;/p&gt;&#xA;&lt;p&gt;I think this function could build on `auth-source-search' (and needs some energy to get into existence.)&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Invested some energy (20161117):&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;After a little research I found a concrete example how to pull out a password from the return of `auth-source-search'.&lt;/p&gt;&#xA;&lt;p&gt;With my personal settings I get my password for marco.wahl@gmail.com with the lisp line&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(funcall (plist-get (car (auth-source-search :user  &amp;quot;marco.wahl@gmail.com&amp;quot;)) :secret ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You need to find such line for your 'dbpassword' and insert it at the right place at the properties.  Possibly it is&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;...&#xA;:header-args:   :dbpassword: (funcall (plist-get (car (auth-source-search :user  &amp;quot;Peter@my-super-db&amp;quot;)) :secret ))&#xA;...&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8943" LastEditorUserId="25475" LastEditDate="2020-10-12T07:16:06.050" LastActivityDate="2020-10-12T07:16:06.050" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="28684" PostTypeId="1" CreationDate="2016-11-16T12:59:55.227" Score="7" ViewCount="2767" Body="&lt;p&gt;According to documentation, &lt;code&gt;member&lt;/code&gt; checks if a a given element is an element of a list. For example if the list, say &lt;code&gt;my_list&lt;/code&gt; consists of &lt;strong&gt;apple&lt;/strong&gt; and &lt;strong&gt;orange&lt;/strong&gt;, &lt;code&gt;(member &quot;apple&quot; my_list)&lt;/code&gt; returns true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to check if a given string is a part of a string of a list. For example &lt;strong&gt;ap&lt;/strong&gt; is a part of a string  of the above list.&#xA;Hence it would be desirable to have a function like &lt;code&gt;my-function&lt;/code&gt;  such that &lt;code&gt;(my-function &quot;ap&quot; my_list)&lt;/code&gt; returns true.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2016-11-16T14:47:56.767" LastActivityDate="2023-05-04T20:53:43.260" Title="How to check if a given string is a substring of an element of a list" Tags="|string|list|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28685" PostTypeId="2" ParentId="28684" CreationDate="2016-11-16T14:01:28.383" Score="7" Body="&lt;p&gt;The easiest way is to use the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/&quot; rel=&quot;noreferrer&quot;&gt;Common Lisp compatibility layer&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-seq)&#xA;(cl-member &quot;ap&quot; '(&quot;foo&quot; &quot;apa&quot; &quot;bar&quot;) :test #'string-match)&#xA;==&amp;gt; (&quot;apa&quot; &quot;bar&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS. This is not directly relevant to your question, but if you have a few minutes to kill, keep reading. ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Emacs maintainers have traditionally eschewed CL (starting with the original political animosity of RMS towards the CL creators).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://ergoemacs.org/emacs/elisp_common_lisp_in_emacs.html&quot; rel=&quot;noreferrer&quot;&gt;Controversy of Common Lisp Package in Emacs Lisp&lt;/a&gt; for attempts to justify the hostility in technical terms.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-11-16T14:06:51.420" LastActivityDate="2016-11-16T14:06:51.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28686" PostTypeId="2" ParentId="28684" CreationDate="2016-11-16T14:03:44.150" Score="5" Body="&lt;p&gt;The function that comes to my mind at least would be &lt;code&gt;cl-member&lt;/code&gt; using a &lt;code&gt;string-match-p&lt;/code&gt; test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a short example that shows how to use it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (setq testing '(&quot;an apple&quot; &quot;a pear&quot; &quot;a grape&quot;))&#xA;(&quot;an apple&quot; &quot;a pear&quot; &quot;a grape&quot;)&#xA;&#xA;ELISP&amp;gt; (cl-member &quot;apple&quot; testing)&#xA;nil&#xA;ELISP&amp;gt; (cl-member &quot;an apple&quot; testing)&#xA;nil&#xA;ELISP&amp;gt; (cl-member &quot;an apple&quot; testing :test #'string=)&#xA;(&quot;an apple&quot; &quot;a pear&quot; &quot;a grape&quot;)&#xA;&#xA;ELISP&amp;gt; (cl-member &quot;a pear&quot; testing :test #'string=)&#xA;(&quot;a pear&quot; &quot;a grape&quot;)&#xA;&#xA;ELISP&amp;gt; (cl-member &quot;a pear&quot; testing :test #'string-match-p)&#xA;(&quot;a pear&quot; &quot;a grape&quot;)&#xA;&#xA;ELISP&amp;gt; (cl-member &quot;pear&quot; testing :test #'string-match-p)&#xA;(&quot;a pear&quot; &quot;a grape&quot;)&#xA;&#xA;ELISP&amp;gt; (cl-member &quot;xx&quot; testing :test #'string-match-p)&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;member&lt;/code&gt; and &lt;code&gt;cl-member&lt;/code&gt; doesn't actually return &lt;code&gt;true&lt;/code&gt; but the&#xA;sublist that contains the sought element. That in turn will eventually evaluates&#xA;to &lt;code&gt;true&lt;/code&gt; in tests, but That's mostly a minor detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sean pointed out an important detail about &lt;code&gt;string-match&lt;/code&gt; and &lt;code&gt;string-match-p&lt;/code&gt;:&#xA;Regular expression meta-characters in the search string might give an erroneous&#xA;result. If that's a problem you could examine the raw sequence instead with&#xA;&lt;code&gt;cl-search&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (setq test (list &quot;apple&quot; &quot;pear&quot; &quot;grape&quot;))&#xA;(&quot;apple&quot; &quot;pear&quot; &quot;grape&quot;)&#xA;&#xA;ELISP&amp;gt; (cl-member &quot;ap&quot; test :test #'cl-search)&#xA;(&quot;apple&quot; &quot;pear&quot; &quot;grape&quot;)&#xA;&#xA;ELISP&amp;gt; (cl-member &quot;gra&quot; test :test #'cl-search)&#xA;(&quot;grape&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2653" LastEditorUserId="2653" LastEditDate="2016-11-16T20:03:12.257" LastActivityDate="2016-11-16T20:03:12.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28687" PostTypeId="2" ParentId="12532" CreationDate="2016-11-16T14:24:30.143" Score="0" Body="&lt;p&gt;If you mean a way to run some code with idle timer in such a way that the passed code runs in the original buffer, maybe you can adapt the following snippet that I am currently using. Please keep in mind that this snippet assumes that it is placed in an *.el file with lexical binding.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-delayed-tex-font-lock ()&#xA;  (let ((here (current-buffer)))&#xA;    (run-with-idle-timer&#xA;     10 nil&#xA;     (lambda ()&#xA;       (with-current-buffer here&#xA;         (my-tex-font-lock))))))&#xA;(add-hook 'TeX-mode-hook 'my-delayed-tex-font-lock)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What this snippet does is make my function my-tex-font-lock run after ten seconds of idle time for each TeX file buffer. When I open alice.tex, quickly switch to bob.txt and wait for ten seconds doing nothing, then my-tex-font-lock will kick in and it will affect the alice.tex buffer but not bob.txt.&lt;/p&gt;&#xA;" OwnerUserId="13986" LastActivityDate="2016-11-16T14:24:30.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28688" PostTypeId="1" AcceptedAnswerId="28692" CreationDate="2016-11-16T14:48:20.883" Score="2" ViewCount="628" Body="&lt;pre&gt;&lt;code&gt;* Heading  &#xA;** Sub-heading  &#xA;*** Sub-sub-heading  &#xA;- plain text&#xA;- more plain text&#xA;- even more plain text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to select &lt;code&gt;- more plain text&lt;/code&gt; and archive it with C-c, C-x, C-a.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only want &lt;code&gt;- more plain text&lt;/code&gt; to be archived. I want the headings and the rest of the plain text to stay in place. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try this, it archives everything. &lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="2274" LastEditDate="2016-11-17T01:29:15.910" LastActivityDate="2016-11-17T01:29:15.910" Title="How to archive selected text in Org?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28689" PostTypeId="2" ParentId="28684" CreationDate="2016-11-16T15:33:47.533" Score="1" Body="&lt;p&gt;A solution that almost doesn't require &lt;code&gt;cl-lib&lt;/code&gt; (only &lt;code&gt;cl-defgeneric&lt;/code&gt; and &lt;code&gt;cl-defmethod&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(seq-some (lambda (x) (string-match &quot;foo&quot; x)) '(&quot;f&quot; &quot;fo&quot; &quot;fooo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And a solution that doesn't require &lt;code&gt;cl-lib&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun some-string-matches (search strings)&#xA;  (while (and strings (not (string-match search (car strings))))&#xA;    (setq strings (cdr strings)))&#xA;  strings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just so it would live up to the title.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2016-11-16T17:13:43.207" LastActivityDate="2016-11-16T17:13:43.207" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28690" PostTypeId="2" ParentId="28688" CreationDate="2016-11-16T15:55:59.640" Score="4" Body="&lt;p&gt;Archiving is designed to work on trees or subtrees. i.e., the basic unit to be archived is a heading with all the nested content under that heading. You can't archive arbitrary text without the heading it belongs to. Otherwise, as @lawlist suggests in his question, there's no clearly defined place to archive the text. (and after you've archived one bit of text, where does the next bit go relative to the first bit you archived?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could probably code something yourself that would automatically transfer selected text to a particular location you specify, to 'archive' it. However, you'd be working against the expected workflow for org-mode. Using subheadings (which can be archived) or checkboxes (i.e., &lt;code&gt;- [ ]&lt;/code&gt;) to indicate items that have been dealt with, might be more straightforward.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-11-16T15:55:59.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28692" PostTypeId="2" ParentId="28688" CreationDate="2016-11-16T18:43:25.460" Score="1" Body="&lt;p&gt;I recommend following the answer from @Tyler because it encourages using org-mode as designed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you're &lt;em&gt;absolutely determined to archive a list item&lt;/em&gt; then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Place point on &lt;em&gt;list item&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Move &lt;em&gt;list item&lt;/em&gt; to bottom of the list using &lt;kbd&gt;M-down&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Convert &lt;em&gt;list item&lt;/em&gt; to heading using &lt;kbd&gt;C-c *&lt;/kbd&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Archive header using &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-a&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This should leave the original file that appears similar to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading&#xA;&#xA;** Sub-heading&#xA;&#xA;*** Sub-sub-heading&#xA;&#xA;- plain text&#xA;- even more plain text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and create an entry in archive file that is similar to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* more plain text&#xA;  :PROPERTIES:&#xA;  :ARCHIVE_TIME: 2016-11-16 Wed 11:27&#xA;  :ARCHIVE_FILE: /tmp/sx/emacs/how-to-archive-selected-text-in-org.org&#xA;  :ARCHIVE_OLPATH: Heading/Sub-heading/Sub-sub-heading&#xA;  :ARCHIVE_CATEGORY: how-to-archive-selected-text-in-org&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you have any content under the header after your list &lt;strong&gt;do not archive&lt;/strong&gt; or you'll archive more than you want too. This method only works on very simple use cases such as your example.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Hope that helped!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This answer was tested using &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  org-mode version: 9.0  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-11-16T18:55:32.050" LastActivityDate="2016-11-16T18:55:32.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28693" PostTypeId="2" ParentId="28675" CreationDate="2016-11-16T18:51:56.663" Score="3" Body="&lt;p&gt;By design, &lt;strong&gt;*Helm Help*&lt;/strong&gt; buffers do not use a keymap. Instead, helm hard-codes all navigation in &lt;strong&gt;*Helm Help*&lt;/strong&gt; buffers in a function called &lt;code&gt;helm-help-event-loop&lt;/code&gt;. This can be a bit surprising, as not only does it override any navigation shortcuts you use globally (like your evil bindings), but it also makes it difficult (but not impossible) to customize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach you need to take is to redefine &lt;code&gt;helm-help-event-loop&lt;/code&gt; after it is loaded. The following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;helm-lib&quot;&#xA;  '(defun helm-help-event-loop ()&#xA;    (let ((prompt (propertize&#xA;                   &quot;[SPC,C-v,down,next:NextPage  b,M-v,up,prior:PrevPage C-s/r:Isearch q:Quit]&quot;&#xA;                   'face 'helm-helper))&#xA;          scroll-error-top-bottom)&#xA;      (helm-awhile (read-key prompt)&#xA;        (cl-case it&#xA;          ((?\C-v ? down next) (helm-help-scroll-up helm-scroll-amount))&#xA;          ((?\M-v ?b up prior) (helm-help-scroll-down helm-scroll-amount))&#xA;          (?\C-s (isearch-forward))&#xA;          (?\C-r (isearch-backward))&#xA;          (?\C-a (call-interactively #'move-beginning-of-line))&#xA;          (?\C-e (call-interactively #'move-end-of-line))&#xA;          (?\C-f (call-interactively #'forward-char))&#xA;          (?\C-b (call-interactively #'backward-char))&#xA;          (?\C-n (helm-help-next-line))&#xA;          (?\C-p (helm-help-previous-line))&#xA;          (?\M-a (call-interactively #'backward-sentence))&#xA;          (?\M-e (call-interactively #'forward-sentence))&#xA;          (?\M-f (call-interactively #'forward-word))&#xA;          (?\M-b (call-interactively #'backward-word))&#xA;          (?\C-  (helm-help-toggle-mark))&#xA;          (?\M-w (copy-region-as-kill&#xA;                  (region-beginning) (region-end))&#xA;                 (deactivate-mark))&#xA;          ;; new bindings added here:&#xA;          (?j    (helm-help-next-line))&#xA;          (?k    (helm-help-previous-line))&#xA;          ;; end of new bindings&#xA;          (?q    (cl-return))&#xA;          (t     (ignore)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this example, I've added two new bindings - &lt;code&gt;j&lt;/code&gt; to scroll down one line, and &lt;code&gt;k&lt;/code&gt; to scroll up one line. You should be able to follow the syntax of the other lines to add additional options. Note that, unlike normal keybindings, you use the actual function calls (i.e., &lt;code&gt;(helm-help-next-line)&lt;/code&gt;, rather than referring to the function names (i.e., &lt;code&gt;'helm-help-next-line&lt;/code&gt;). This is because in this context, you are not referring to the functions, but the code directly calls them. Also, you can probably use the regular function calls (i.e., &lt;code&gt;(move-end-of-line)&lt;/code&gt;), rather than wrapping them in &lt;code&gt;(call-interactively ...)&lt;/code&gt;. This latter form is apparently only needed if you use a screen-reader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course use this to remove keybindings as well. However, make sure you leave at least one binding for &lt;code&gt;(cl-return)&lt;/code&gt;, or you'll be stuck in the help window forever. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-11-16T18:51:56.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28694" PostTypeId="2" ParentId="28627" CreationDate="2016-11-16T19:40:45.490" Score="3" Body="&lt;p&gt;In conjunction with the assistance of the original poster in the comments above, here is the final solution:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-icalendar-open-ics-file (file)&#xA;  (start-process &quot;org-icalendar-open-ics-file-process&quot; nil &quot;open&quot; &quot;-a&quot; &quot;/Applications/Calendar.app&quot; file))&#xA;&#xA;(add-hook 'org-icalendar-after-save-hook 'org-icalendar-open-ics-file) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-11-16T19:40:45.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28695" PostTypeId="2" ParentId="28682" CreationDate="2016-11-16T20:46:42.540" Score="1" Body="&lt;p&gt;I am not aware of any Auctex-option that lets the TeX-error buffer window close. But, adding the following stuff to your init file should do the job.&#xA;It deletes the window of the buffer in &lt;code&gt;TeX-error-overview-mode&lt;/code&gt; when it is killed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Delete also the window showing the &lt;code&gt;&quot;*TeX Help*&quot;&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun TeX-error-delete-window ()&#xA;  &quot;Delete TeX error window when there are no errors to show.&quot;&#xA;  (let ((w (get-buffer-window))&#xA;    (b (get-buffer &quot;*TeX Help*&quot;)))&#xA;    (when w&#xA;      (delete-window w))&#xA;    (when b&#xA;      (setq w (get-buffer-window b))&#xA;      (when w&#xA;    (delete-window w)))))&#xA;&#xA;(defun TeX-error-install-delete-window-hook ()&#xA;  &quot;Install `TeX-error-delete-window' in buffer-local `kill-buffer-hook'.&quot;&#xA;  (add-hook 'kill-buffer-hook #'TeX-error-delete-window nil t))&#xA;&#xA;(add-hook 'TeX-error-overview-mode-hook #'TeX-error-install-delete-window-hook)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-16T21:27:39.250" LastActivityDate="2016-11-16T21:27:39.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28696" PostTypeId="1" AcceptedAnswerId="28697" CreationDate="2016-11-16T20:46:49.573" Score="2" ViewCount="193" Body="&lt;p&gt;When writing LaTeX presentations with the beamer class in emacs+auctex I would like to have a function (and keybinding) that does the following three things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;narrow to the next frame environment if currently nothing is narrowed&lt;/li&gt;&#xA;&lt;li&gt;move to the next frame environment when I'm already narrowed to some frame environment.&lt;/li&gt;&#xA;&lt;li&gt;if there is no subsequent frame environment to narrow to, then widen.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I can do this more or less with several keybindings using the features available in the auctex and expand-region packages. But I would love to have this behaviour bound to a single keybinding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="7048" LastActivityDate="2016-11-16T21:13:10.370" Title="Narrow and move between latex environments" Tags="|latex|auctex|narrowing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28697" PostTypeId="2" ParentId="28696" CreationDate="2016-11-16T21:03:06.880" Score="2" Body="&lt;p&gt;Here's a quick &amp;amp; dirty function that meets your requirements:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-frame-dwim ()&#xA;  (interactive)&#xA;  (if (not (buffer-narrowed-p))&#xA;      (if (search-forward &quot;\\begin{frame}&quot; nil t)&#xA;          (LaTeX-narrow-to-environment))&#xA;    (widen)&#xA;    (if (search-forward &quot;\\begin{frame}&quot; nil t)&#xA;        (LaTeX-narrow-to-environment))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To bind that to a key, you could add this to your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;latex&quot;&#xA;  '(define-key LaTeX-mode-map (kbd &quot;C-c f&quot;) 'my-frame-dwim))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-11-16T21:13:10.370" LastActivityDate="2016-11-16T21:13:10.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28698" PostTypeId="1" AcceptedAnswerId="28704" CreationDate="2016-11-16T21:59:45.233" Score="6" ViewCount="512" Body="&lt;p&gt;I have some legal text that is peppered with digressions and interpolations in parentheses, so many that it is hard to keep track of the main text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pasting the text into emacs at least allows me to match parentheses easily, but it occurs to me that it would be handy to be able to hide all text in parentheses. I don't want to delete the text, because then I would have to replace it all at the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of the desired output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The doctor (who was a friend of mine) had graduated from John Hopkins (a well-known school) in 2003 (and as a result of his time there was something of an expert on Baltimore) before moving to Ireland (his grandmother was Irish) in 2008.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After:&#xA;The doctor had graduated from John Hopkins in 2003 before moving to Ireland in 2008.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can emacs be made do this without a ton of elisp? I note a number of other questions related to folding, but they seem to be line-oriented (hiding functions in code, or sections in LaTeX etc.) rather than word-oriented.&lt;/p&gt;&#xA;" OwnerUserId="8393" LastActivityDate="2016-11-17T02:49:07.737" Title="How can I hide general text in parentheses?" Tags="|code-folding|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28699" PostTypeId="1" CreationDate="2016-11-16T23:34:35.003" Score="5" ViewCount="164" Body="&lt;p&gt;I want to be able to tell whether stdout is a pipe in an elisp script. This would allow to distinguish between:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --script foo.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --script foo.el | cat&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this possible in Emacs lisp? Most programming languages &lt;a href=&quot;https://rosettacode.org/wiki/Check_output_device_is_a_terminal&quot; rel=&quot;nofollow noreferrer&quot;&gt;have this in the stdlib&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="105" LastEditDate="2016-11-16T23:46:10.273" LastActivityDate="2016-11-17T08:06:04.330" Title="How can I detect if an elisp script is piped?" Tags="|shell|script|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28700" PostTypeId="2" ParentId="28699" CreationDate="2016-11-16T23:37:24.020" Score="1" Body="&lt;p&gt;On Linux, you can use &lt;code&gt;/proc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((stdout-proc-path&#xA;        (format &quot;/proc/%s/fd/1&quot; (emacs-pid)))&#xA;       (piped-p&#xA;        ;; If following the links gives us a path like&#xA;        ;; &quot;/proc/26783/fd/pipe:[432241]&quot; (which doesn't exist) rather than&#xA;        ;; &quot;/dev/pts/2&quot; (which exists), then we're piped into another&#xA;        ;; process. Assumes Emacs is not running in a GUI.&#xA;        (not (file-exists-p (file-chase-links stdout-proc-path)))))&#xA;  (princ (format &quot;have we been piped? %s\n&quot; piped-p)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this isn't portable: not even OS X has &lt;code&gt;/proc&lt;/code&gt;. Hopefully there are better alternatives.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2016-11-16T23:37:24.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28701" PostTypeId="1" AcceptedAnswerId="28728" CreationDate="2016-11-17T00:03:22.777" Score="3" ViewCount="259" Body="&lt;p&gt;My company uses a version of Perl where you can define by binary number using something like &lt;code&gt;my $var = 'b010110110;&lt;/code&gt; etc. Problem is both &lt;code&gt;perl-mode&lt;/code&gt; and &lt;code&gt;cperl-mode&lt;/code&gt; interpret &lt;code&gt;'&lt;/code&gt; as the start of the string and will apply a string font lock to everything until the next &lt;code&gt;'&lt;/code&gt;. This causes large sections of code are to appear as a string when they are not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked into how Emacs defines strings, and it does not have a &lt;code&gt;string start&lt;/code&gt; or &lt;code&gt;string end&lt;/code&gt;  syntax class. Rather it just has a &lt;code&gt;string quote character&lt;/code&gt; syntax class of which both &lt;code&gt;&quot;&lt;/code&gt; and &lt;code&gt;'&lt;/code&gt; are members of in Perl modes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have modified the syntax table to changed the &lt;code&gt;'&lt;/code&gt; character from the &lt;code&gt;string quote character&lt;/code&gt; class to the &lt;code&gt;punctuation character&lt;/code&gt; class. This fixes the problems of stringifying blocks of code but normal strings quoted with &lt;code&gt;'&lt;/code&gt; are no longer recognized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a really smart person who can show me some code to modify the syntax highlighting of Perl so that strings are recognized as strings and binary notation is recognized as binary notation. How can I accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="12269" LastEditorUserId="12269" LastEditDate="2016-11-17T17:30:53.750" LastActivityDate="2016-11-18T04:47:54.287" Title="modify syntax table for strings in perl modes" Tags="|syntax-highlighting|string|syntax|syntax-table|perl|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28702" PostTypeId="2" ParentId="6021" CreationDate="2016-11-17T00:03:48.113" Score="1" Body="&lt;p&gt;As of Nov. 2016, and the latest &lt;code&gt;magit&lt;/code&gt;, here's a partial solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;P&lt;/code&gt; &lt;code&gt;e&lt;/code&gt; - allows you to push &lt;code&gt;elsewhere&lt;/code&gt;, but it's not remembered&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find a way for magit to &lt;code&gt;--set-upstream&lt;/code&gt;, so I just did this from terminal, kind of a cheat but it got me over this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git push --set-upstream origin &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And now the new upstream is saved, and I can build my next thing :)&lt;/p&gt;&#xA;" OwnerUserId="14007" LastActivityDate="2016-11-17T00:03:48.113" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28703" PostTypeId="1" AcceptedAnswerId="28706" CreationDate="2016-11-17T00:11:58.067" Score="2" ViewCount="935" Body="&lt;p&gt;The icons in speedbar are old-fashioned, I'm trying to replace them, but cannot locate any png files in /home/user/.emacs.d, are they pictures? If they are, where to find them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d70s3.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d70s3.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how can I replace them by specifying new image in emacs init file not actually replace them on disk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&#xA;It works after adopting the answer in the solution, and it is also easy to switch to a png format picture. To load a new picture other than the original ones, first put a png pic in .emacs.d, and then add the following lines to the init file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (require 'speedbar)&#xA; (defezimage ezimage-directory-plus-new&#xA;    ((:type png :file &quot;~/.emacs.d/dir-plus-new.png&quot; :ascent center))&#xA;    &quot;Image used for empty directories.&quot;)&#xA;&#xA;  (setq speedbar-expand-image-button-alist&#xA;        '((&quot;&amp;lt;+&amp;gt;&quot; . ezimage-directory-plus-new))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now my speedbar looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UIwWM.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UIwWM.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="12577" LastEditDate="2016-11-17T17:18:03.527" LastActivityDate="2016-11-17T17:18:03.527" Title="How to replace the icons in speedbar" Tags="|speedbar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28704" PostTypeId="2" ParentId="28698" CreationDate="2016-11-17T00:14:03.900" Score="3" Body="&lt;p&gt;A quick answer.  If I get time I'll try to add a bit more later.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Download &lt;a href=&quot;https://www.emacswiki.org/emacs/download/isearch-prop.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/a&gt;, and load it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use this command to make &lt;code&gt;(...)&lt;/code&gt; invisible:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (defun hide/show-parenthetical-text (&amp;amp;optional show)&#xA;      &quot;Remove parentheses and text between them.&#xA;    With a prefix arg, show all invisible text.&quot;&#xA;      (interactive &quot;P&quot;)&#xA;      (if show&#xA;          (isearchp-make-zones-visible `((,(point-min) ,(point-max))))&#xA;        (let ((isearchp-dim-outside-search-area-flag  nil))&#xA;          (isearchp-regexp-define-contexts (point-min) (point-max) 'invisible &quot;([^)]*)&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-11-17T02:49:07.737" LastActivityDate="2016-11-17T02:49:07.737" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28705" PostTypeId="2" ParentId="27380" CreationDate="2016-11-17T00:16:02.697" Score="0" Body="&lt;p&gt;It works after adding (other-window 1) to start hook in init.el&lt;/p&gt;&#xA;" OwnerUserId="12577" LastActivityDate="2016-11-17T00:16:02.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28706" PostTypeId="2" ParentId="28703" CreationDate="2016-11-17T00:58:35.623" Score="3" Body="&lt;p&gt;The images are XPM located in a directory such as &lt;code&gt;.../Emacs.app/Contents/Resources/etc/images/ezimage&lt;/code&gt;  [Location example is for Emacs built &lt;code&gt;--with-ns&lt;/code&gt;.]  This answer contemplates changing the current XPM images with different XPM images.  It is certainly possible to rewrite the &lt;code&gt;speedbar.el&lt;/code&gt; library and related libraries to insert PNG images (a time-consuming undertaking), but that is beyond the scope of this XPM answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The XPM images can be customized by modifying the values in the variable &lt;code&gt;speedbar-expand-image-button-alist&lt;/code&gt; and by adding additional XPM images to the default location.  The default values are as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;&amp;lt;+&amp;gt;&quot; . ezimage-directory-plus)&#xA;  (&quot;&amp;lt;-&amp;gt;&quot; . ezimage-directory-minus)&#xA;  (&quot;&amp;lt; &amp;gt;&quot; . ezimage-directory)&#xA;  (&quot;[+]&quot; . ezimage-page-plus)&#xA;  (&quot;[-]&quot; . ezimage-page-minus)&#xA;  (&quot;[?]&quot; . ezimage-page)&#xA;  (&quot;[ ]&quot; . ezimage-page)&#xA;  (&quot;{+}&quot; . ezimage-box-plus)&#xA;  (&quot;{-}&quot; . ezimage-box-minus)&#xA;  (&quot;&amp;lt;M&amp;gt;&quot; . ezimage-mail)&#xA;  (&quot;&amp;lt;d&amp;gt;&quot; . ezimage-document-tag)&#xA;  (&quot;&amp;lt;i&amp;gt;&quot; . ezimage-info-tag)&#xA;  (&quot; =&amp;gt;&quot; . ezimage-tag)&#xA;  (&quot; +&amp;gt;&quot; . ezimage-tag-gt)&#xA;  (&quot; -&amp;gt;&quot; . ezimage-tag-v)&#xA;  (&quot;&amp;gt;&quot;   . ezimage-tag)&#xA;  (&quot;@&quot;   . ezimage-tag-type)&#xA;  (&quot;  @&quot; . ezimage-tag-type)&#xA;  (&quot;*&quot;   . ezimage-checkout)&#xA;  (&quot;#&quot;   . ezimage-object)&#xA;  (&quot;!&quot;   . ezimage-object-out-of-date)&#xA;  (&quot;//&quot;  . ezimage-label)&#xA;  (&quot;%&quot;   . ezimage-lock)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For example, let us assume that we want to change the directory plus/minus images for the box plus/minus images, and visa versa:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq speedbar-expand-image-button-alist&#xA;  '((&quot;&amp;lt;+&amp;gt;&quot; . ezimage-box-plus) ;; previously ezimage-directory-plus&#xA;    (&quot;&amp;lt;-&amp;gt;&quot; . ezimage-box-minus) ;; previously ezimage-directory-minus&#xA;    (&quot;&amp;lt; &amp;gt;&quot; . ezimage-directory)&#xA;    (&quot;[+]&quot; . ezimage-page-plus)&#xA;    (&quot;[-]&quot; . ezimage-page-minus)&#xA;    (&quot;[?]&quot; . ezimage-page)&#xA;    (&quot;[ ]&quot; . ezimage-page)&#xA;    (&quot;{+}&quot; . ezimage-directory-plus) ;; previously ezimage-box-plus&#xA;    (&quot;{-}&quot; . ezimage-directory-minus) ;; previously ezimage-box-minus&#xA;    (&quot;&amp;lt;M&amp;gt;&quot; . ezimage-mail)&#xA;    (&quot;&amp;lt;d&amp;gt;&quot; . ezimage-document-tag)&#xA;    (&quot;&amp;lt;i&amp;gt;&quot; . ezimage-info-tag)&#xA;    (&quot; =&amp;gt;&quot; . ezimage-tag)&#xA;    (&quot; +&amp;gt;&quot; . ezimage-tag-gt)&#xA;    (&quot; -&amp;gt;&quot; . ezimage-tag-v)&#xA;    (&quot;&amp;gt;&quot;   . ezimage-tag)&#xA;    (&quot;@&quot;   . ezimage-tag-type)&#xA;    (&quot;  @&quot; . ezimage-tag-type)&#xA;    (&quot;*&quot;   . ezimage-checkout)&#xA;    (&quot;#&quot;   . ezimage-object)&#xA;    (&quot;!&quot;   . ezimage-object-out-of-date)&#xA;    (&quot;//&quot;  . ezimage-label)&#xA;    (&quot;%&quot;   . ezimage-lock)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-17T01:23:23.857" LastActivityDate="2016-11-17T01:23:23.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28707" PostTypeId="2" ParentId="28699" CreationDate="2016-11-17T04:28:34.597" Score="2" Body="&lt;p&gt;There is a work-around by wrapping Emacs in a subshell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ( [ -t 1 ] &amp;amp;&amp;amp; export TTY_P=yes ; emacs ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, the output is a tty:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ( [ -t 1 ] &amp;amp;&amp;amp; export TTY_P=yes ; emacs --batch --eval '(princ (getenv &quot;TTY_P&quot;))' )&#xA;&#xA;yes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the output is not a tty (piped or redirected)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ( [ -t 1 ] &amp;amp;&amp;amp; export TTY_P=yes ; emacs --batch --eval '(princ (getenv &quot;TTY_P&quot;))' ) | cat&#xA;&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-11-17T07:39:50.763" LastActivityDate="2016-11-17T07:39:50.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28708" PostTypeId="2" ParentId="26710" CreationDate="2016-11-17T05:37:32.850" Score="18" Body="&lt;p&gt;&lt;kbd&gt;C-y&lt;/kbd&gt; does work, but you can also paste into the minibuffer from the default register using &lt;code&gt;dotspacemacs-emacs-leader-key&lt;/code&gt; instead of &lt;code&gt;dotspacemacs-leader-key&lt;/code&gt;, in which case you can use: &lt;kbd&gt;leader&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;e&lt;/kbd&gt;&lt;kbd&gt;&quot;&lt;/kbd&gt; or &lt;kbd&gt;leader&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;e&lt;/kbd&gt;&lt;kbd&gt;return&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can search and paste the contents from any register: for example &lt;kbd&gt;leader&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;e&lt;/kbd&gt; &lt;code&gt;phrase you remember&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I've just set &lt;code&gt;dotspacemacs-emacs-leader-key&lt;/code&gt; to an easily accessible key chord and used it everywhere instead of &lt;code&gt;dotspacemacs-leader-key&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13444" LastEditorUserId="13444" LastEditDate="2020-06-09T22:39:17.237" LastActivityDate="2020-06-09T22:39:17.237" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28709" PostTypeId="1" CreationDate="2016-11-17T07:04:37.747" Score="7" ViewCount="271" Body="&lt;p&gt;Since my &lt;code&gt;.emacs.d&lt;/code&gt; is a symbolic link of &lt;code&gt;~/dotfile/dot/.emacs.d&lt;/code&gt;, &lt;code&gt;recentf&lt;/code&gt; keeps duplicated thing like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Users/user/.emacs.d/init/init-editor.el&#xA;/Users/user/dotfile/dot/.emacs.d/init/init-editor.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because some command/functions the symbolic link path and some use the real one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to let &lt;code&gt;recentf&lt;/code&gt; not to remember real path when there's a symbolic link of a parent directory ? The real path is so long, I prefer the short one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar recentf--exclude-remote-regexp &quot;\\/\\w*?:\\w*?@\\w*?:\\/&quot;)&#xA; (defun recentf//file-symbolic-link-in-recentf-list (file)&#xA;   &quot;Test whether there's a symbolic parent of FILE in `recentf-list'.&quot;&#xA;   (cl-some (lambda (x)&#xA;              (and (string= (file-truename x) file)&#xA;                   (not (string= x file))))&#xA;            recentf-list))&#xA;&#xA; (defun recentf//exclude-symbolic-vc-files (file)&#xA;   &quot;Exclude local FILE that has a symbolic parent in `recentf-list'.&quot;&#xA;   ;; Unless the file is local&#xA;   (unless (string-match recentf--exclude-remote-regexp file)&#xA;     (recentf//file-symbolic-link-in-recentf-list file)))&#xA; (add-to-list 'recentf-exclude #'recentf//exclude-symbolic-vc-files)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before, but this is a bit slow which take almost 2 second to handle with a &lt;code&gt;recentf-list&lt;/code&gt;in length of &lt;code&gt;500&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I find that there's &lt;code&gt;recentf-filename-handlers&lt;/code&gt; which may be used to combine with &lt;code&gt;directory-abbrev-alist&lt;/code&gt;. But this require manually add all the mappings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions will be appreciated! Thanks!&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="105" LastEditDate="2017-05-16T22:33:42.573" LastActivityDate="2017-05-16T22:33:42.573" Title="How to let `recentf` not to remember real path when there's a symbolic link?" Tags="|recentf|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28711" PostTypeId="2" ParentId="28699" CreationDate="2016-11-17T08:06:04.330" Score="3" Body="&lt;p&gt;Wrapping &lt;code&gt;isatty(3)&lt;/code&gt; in a dynamic module seems to work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --batch -Q --load isatty.so --eval '(princ  (isatty))'&#xA;t&#xA;&#xA;$ emacs --batch -Q --load isatty.so --eval '(princ  (isatty))' | cat&#xA;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Build the module&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ EMACS_ROOT=/home/xcy/src/emacs/ # /path/to/root/of/emacs/source/code&#xA;$ gcc -I$EMACS_ROOT/src -fPIC -c isatty.c&#xA;$ gcc -shared isatty.o -o isatty.so&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;isatty.c&lt;/code&gt;'s contents:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#include &amp;lt;emacs-module.h&amp;gt;&#xA;#include &amp;lt;stdio.h&amp;gt;&#xA;#include &amp;lt;unistd.h&amp;gt;&#xA;&#xA;int plugin_is_GPL_compatible;&#xA;&#xA;static emacs_value&#xA;Fisatty (emacs_env *env, int argc, emacs_env argv[], void *data)&#xA;{&#xA;  if (isatty (fileno (stdout)))&#xA;    return env-&amp;gt;intern (env, &quot;t&quot;);&#xA;  else&#xA;    return env-&amp;gt;intern (env, &quot;nil&quot;);&#xA;}&#xA;&#xA;static void&#xA;bind_function (emacs_env *env, const char *name, emacs_value Sfun)&#xA;{&#xA;  emacs_value Qfset = env-&amp;gt;intern (env, &quot;fset&quot;);&#xA;  emacs_value Qsym = env-&amp;gt;intern (env, name);&#xA;&#xA;  emacs_value args[] = {Qsym, Sfun};&#xA;&#xA;  env-&amp;gt;funcall (env, Qfset, 2, args);&#xA;}&#xA;&#xA;int emacs_module_init (struct emacs_runtime *ert)&#xA;{&#xA;  emacs_env *env = ert-&amp;gt;get_environment (ert);&#xA;  emacs_value fun = env-&amp;gt;make_function (env,&#xA;                                        0,&#xA;                                        0,&#xA;                                        Fisatty,&#xA;                                        &quot;Return t if stdout is tty, nil otherwise.&quot;,&#xA;                                        NULL);&#xA;  bind_function (env, &quot;isatty&quot;, fun);&#xA;  return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-17T08:06:04.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28713" PostTypeId="1" CreationDate="2016-11-17T10:14:08.677" Score="0" ViewCount="153" Body="&lt;p&gt;I use &lt;code&gt;emacs -Q&lt;/code&gt; for reconstruction of the following problem and the output of &lt;code&gt;emacs-version&lt;/code&gt; is &#xA;&lt;code&gt;GNU Emacs 25.1.1 (x86_64-unknown-cygwin, GTK+ Version 3.18.9) of 2016-09-17&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one tries to complete file-names of files in the root directory &lt;code&gt;&quot;/&quot;&lt;/code&gt;, e.g. by &lt;kbd&gt;M-:&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(file-name-all-completions &quot;cyg&quot; &quot;/&quot;)&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;one obtains the error &lt;code&gt;(file-error &quot;Reading directory&quot; &quot;No such file or directory&quot; &quot;/&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would very much appreciate if someone with a working copy of the last git-version of cygwin-emacs could try to reconstruct this problem and report here whether it is fixed in that version of emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I report this problem?&#xA;Should I report it directly to &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs&lt;/a&gt; or rather to &lt;a href=&quot;https://cygwin.com/ml/cygwin/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://cygwin.com/ml/cygwin/&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asking because &lt;code&gt;file-name-all-completions&lt;/code&gt; is actually a built-in c-function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current clumsy workaround is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar cygwin-root &quot;/cygdrive/c/cygwin64/&quot;&#xA;  &quot;Reference of the root directory within /cygpath/...&quot;)&#xA;&#xA;(defun cygwin-handle-root-dir (operation &amp;amp;rest args)&#xA;  &quot;Several functions don't work for the root-directory \&quot;/\&quot; in cygwin.&#xA;We map this directory here to &quot;&#xA;  (cond ((eq operation 'file-name-all-completions)&#xA;     ;; second arg is the directory &quot;/&quot;&#xA;     (when (string-equal (nth 1 args) &quot;/&quot;)&#xA;       (setf (nth 1 args) cygwin-root)&#xA;       )))&#xA;    ;; Handle any operation we don’t know about.&#xA;  (let ((inhibit-file-name-handlers&#xA;     (cons 'cygwin-handle-root-dir&#xA;           (and (eq inhibit-file-name-operation operation)&#xA;            inhibit-file-name-handlers)))&#xA;    (inhibit-file-name-operation operation))&#xA;    (apply operation args)))&#xA;&#xA;(add-to-list 'file-name-handler-alist '(&quot;^/$&quot; . cygwin-handle-root-dir))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-17T12:16:15.893" LastActivityDate="2017-06-16T23:08:12.237" Title="Where to report problem with file-name resolution/completion for cygwin emacs" Tags="|completion|cygwin|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28714" PostTypeId="1" CreationDate="2016-11-17T10:29:59.410" Score="1" ViewCount="981" Body="&lt;p&gt;In &lt;a href=&quot;/questions/tagged/php-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;php-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;php-mode&lt;/a&gt; – and in many others I believe – indentation of an expression spreading over several lines is computed relative to the starting column of the expression rather than the column of the first non-blank character of the line where the expression starts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is displayed by the following snippet, where the &lt;code&gt;return&lt;/code&gt; keyword is indented four columns counting from the &lt;code&gt;a&lt;/code&gt; starting the &lt;code&gt;array_map(…)&lt;/code&gt; expression:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php&#xA;&#xA;function weights($volumes, $density)&#xA;{&#xA;    $weights = array_map(function ($volume) {&#xA;                   return $volume * $density;&#xA;               }, $volumes);&#xA;    return $weights;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I must follow another indentation style, where the &lt;code&gt;return&lt;/code&gt; keyword is indented four columns counting from the &lt;code&gt;$&lt;/code&gt; of &lt;code&gt;$weights&lt;/code&gt; which is the first non-blank character of the line where the &lt;code&gt;array_map&lt;/code&gt; expression starts.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;?php&#xA;&#xA;function weights($volumes, $density)&#xA;{&#xA;    $weights = array_map(function ($volume) {&#xA;        return $volume * $density;&#xA;    }, $volumes);&#xA;    return $weights;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I configure Emacs and the &lt;a href=&quot;/questions/tagged/c-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;c-mode&lt;/a&gt; to use this second style? I could not find any reference to this behaviour on the &lt;a href=&quot;https://www.emacswiki.org/emacs/AutoIndentation&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-wiki&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The indentation settings in use are the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(c-add-style &quot;my-php-style&quot;&#xA;             '(&quot;gnu&quot;&#xA;               (c-basic-offset . 4)&#xA;               (c-offsets-alist&#xA;                (arglist-cont . 0)&#xA;                (arglist-intro . +)&#xA;                (block-close . 0)&#xA;                (defun-block-intro . +)&#xA;                (defun-close . 0)&#xA;                (defun-open . 0)&#xA;                (statement . 0)&#xA;                (statement-block-intro . +)&#xA;                (topmost-intro . 0)&#xA;                (access-label . -)&#xA;                (annotation-top-cont . 0)&#xA;                (annotation-var-cont . +)&#xA;                (arglist-close . c-lineup-arglist-operators)&#xA;                (arglist-cont-nonempty . c-lineup-math)&#xA;                (block-open . 0)&#xA;                (brace-entry-open . 0)&#xA;                (brace-list-close . 0)&#xA;                (brace-list-entry . 0)&#xA;                (brace-list-intro . +)&#xA;                (brace-list-open . +)&#xA;                (c . c-lineup-C-comments)&#xA;                (case-label . +)&#xA;                (catch-clause . 0)&#xA;                (class-close . 0)&#xA;                (class-open . 0)&#xA;                (comment-intro . c-lineup-comment)&#xA;                (composition-close . 0)&#xA;                (composition-open . 0)&#xA;                (cpp-define-intro c-lineup-cpp-define +)&#xA;                (cpp-macro . -1000)&#xA;                (cpp-macro-cont . +)&#xA;                (do-while-closure . 0)&#xA;                (else-clause . 0)&#xA;                (extern-lang-close . 0)&#xA;                (extern-lang-open . 0)&#xA;                (friend . 0)&#xA;                (func-decl-cont . +)&#xA;                (inclass . +)&#xA;                (incomposition . +)&#xA;                (inexpr-class . +)&#xA;                (inexpr-statement . +)&#xA;                (inextern-lang . +)&#xA;                (inher-cont . c-lineup-multi-inher)&#xA;                (inher-intro . +)&#xA;                (inlambda . c-lineup-inexpr-block)&#xA;                (inline-close . 0)&#xA;                (inline-open . 0)&#xA;                (inmodule . +)&#xA;                (innamespace . +)&#xA;                (knr-argdecl . 0)&#xA;                (knr-argdecl-intro . 5)&#xA;                (label . 0)&#xA;                (lambda-intro-cont . +)&#xA;                (member-init-cont . c-lineup-multi-inher)&#xA;                (member-init-intro . +)&#xA;                (module-close . 0)&#xA;                (module-open . 0)&#xA;                (namespace-close . 0)&#xA;                (namespace-open . 0)&#xA;                (objc-method-args-cont . c-lineup-ObjC-method-args)&#xA;                (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call +)&#xA;                (objc-method-intro .&#xA;                                   [0])&#xA;                (statement-case-intro . +)&#xA;                (statement-case-open . +)&#xA;                (statement-cont . +)&#xA;                (stream-op . c-lineup-streamop)&#xA;                (string . -1000)&#xA;                (substatement . +)&#xA;                (substatement-label . 0)&#xA;                (substatement-open . +)&#xA;                (template-args-cont c-lineup-template-args +)&#xA;                (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="310" LastEditorUserId="310" LastEditDate="2016-12-01T11:27:35.813" LastActivityDate="2017-03-02T17:48:12.077" Title="How to indent relative to start of the previous line rather than relative to the beginning of the expression?" Tags="|indentation|php-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28715" PostTypeId="1" CreationDate="2016-11-17T12:19:37.600" Score="8" ViewCount="4627" Body="&lt;p&gt;In the following example, I create a very simple pandas DataFrame and export results verbatim:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :exports both :results verbatim :return test&#xA;import pandas as pd&#xA;test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;:       A    B&#xA;: 0  1000   60&#xA;: 1  1000  100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I try to have the output as a table, things get messed up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :exports both :results value table :return test&#xA;import pandas as pd&#xA;test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| A    B |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   |    A |   B |&#xA;| 0 | 1000 |  60 |&#xA;| 1 | 1000 | 100 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2017-03-30T15:37:41.503" LastActivityDate="2022-03-17T20:57:40.393" Title="Get pandas data-frame as a table in org-babel" Tags="|org-babel|python|" AnswerCount="5" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28716" PostTypeId="1" CreationDate="2016-11-17T12:59:08.027" Score="1" ViewCount="579" Body="&lt;p&gt;I like smart parentheses as much as the next person, but there is one situation in which I often get frustrated.  Suppose I have a TeX line reading:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I wish to &lt;code&gt;\emph&lt;/code&gt;asize &lt;code&gt;dolor&lt;/code&gt;.  Hence I go before it and write &lt;code&gt;\emph{&lt;/code&gt;, resulting, with &lt;code&gt;electric-pair-mode&lt;/code&gt; and the likes, in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum \emph{}|dolor sit amet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(where | is the point).&#xA;Now the behavior I'd like to have, is that if I only thereafter &lt;em&gt;move&lt;/em&gt; then insert &lt;code&gt;}&lt;/code&gt;, then the automagically inserted &lt;code&gt;}&lt;/code&gt; is removed.  Graphically, I'd like to end up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum \emph{dolor}| sit amet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;rather than:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum \emph{}dolor}| sit amet&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Is there a mode that implements that behavior?  Note that I &lt;em&gt;don't&lt;/em&gt; want to use the transient mark.&lt;/p&gt;&#xA;" OwnerUserId="13946" LastActivityDate="2023-12-12T06:06:25.690" Title="Electric/smart parentheses: allow wrapping in a nontransient way" Tags="|balanced-parentheses|smartparens|electric-pair-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28718" PostTypeId="1" AcceptedAnswerId="28722" CreationDate="2016-11-17T15:46:39.783" Score="0" ViewCount="202" Body="&lt;p&gt;(I haven't find any answer in previous topics)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Smart Tab globally, i.e. I have put the following code in my .emacs :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smart-tab)&#xA;(global-smart-tab-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am writing a program in Fortran, and I often need to indent some lines, which, according to &lt;code&gt;smart-tab&lt;/code&gt; documentation, is done either by prefixing the &lt;code&gt;smart-tab&lt;/code&gt; command (i.e. &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;) by &lt;code&gt;C-u&lt;/code&gt; or by selecting the region to be indented before hitting &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some research, I still don't understand why only the &quot;selecting a region&quot; method works for me : to indent just one line, I need to have it selected, but &lt;code&gt;C-u &amp;lt;tab&amp;gt;&lt;/code&gt; does not work, and always gives to following message (which I don't understand) :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: cl-case&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Being able to indent any line (and just one line) by using &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; in a simple command would solve my problem (while keeping &lt;code&gt;smart-tab&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="13877" LastActivityDate="2016-11-17T18:26:42.207" Title="Smart Tab : indenting with C-u &lt;tab&gt; does not work (beginning of a line)" Tags="|indentation|tabs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28719" PostTypeId="1" CreationDate="2016-11-17T15:47:21.590" Score="7" ViewCount="796" Body="&lt;p&gt;(This is a followup and different from &lt;a href=&quot;https://emacs.stackexchange.com/questions/28654/emacs-fixed-layout&quot;&gt;Emacs Fixed Layout&lt;/a&gt; )&lt;/p&gt;&#xA;&lt;h2&gt;High Level&lt;/h2&gt;&#xA;&lt;p&gt;My typical Emacs Working environment is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;+------------+--------------------------+--------------------------+&#xA;| NeoTree    |  Main                    |  Rhs                     |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;|            |                          |                          |&#xA;+------------+--------------------------+--------------------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;where Main = some *.clj *.cljs file I'm editing, and RHS = cide-repl or cljs repl or eshell&lt;/p&gt;&#xA;&lt;h2&gt;Problem&lt;/h2&gt;&#xA;&lt;p&gt;Sometimes, some emacs functions screw up this layout. Examples: looking up documentation, running cider-debug, showing exceptions, etc ...&lt;/p&gt;&#xA;&lt;h2&gt;What I want:&lt;/h2&gt;&#xA;&lt;p&gt;I would a way to bind some keys, say C-x 1, C-x 2, C-x 3 (yes, I know this is terrible choice, but not focus of question) wherE:&lt;/p&gt;&#xA;&lt;p&gt;C-x 1 = hide all existing windows, fire up 3-pane setup, with Neotree + last edited clj/cljs file, and RHS = cider-repl&#xA;C-x 2 = same as C-x 1, but cljs-repl in RHS&#xA;C-x 3 = same as C-x 1, but eshell in RHS&lt;/p&gt;&#xA;&lt;h2&gt;Question:&lt;/h2&gt;&#xA;&lt;p&gt;The main feature I need in this is a function to say:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;hide all existing windows&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;create this three pane setup&lt;/p&gt;&#xA;&lt;p&gt;How do I do that?&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&lt;h2&gt;Edit: How is this different from original question:&lt;/h2&gt;&#xA;&lt;p&gt;Original question: how can I force emacs to use this 3 pane setup.&lt;/p&gt;&#xA;&lt;p&gt;This question: emacs is going to screw up my 3 pane setup. How do I have a three-key recovery shortcut?&lt;/p&gt;&#xA;" OwnerUserId="13974" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-11-18T15:52:43.210" Title="Forcing Emacs Layout" Tags="|window|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28720" PostTypeId="1" CreationDate="2016-11-17T16:35:02.860" Score="2" ViewCount="324" Body="&lt;p&gt;By default speedbar displays buffers as they are in the buffer list. Is there a way to sort them by their name alphabetically, either automatically or by triggering the sorting?&lt;/p&gt;&#xA;" OwnerUserId="13636" LastEditorUserId="105" LastEditDate="2016-11-17T17:22:02.030" LastActivityDate="2016-11-17T17:25:55.977" Title="Is there a way to sort buffers alphabetically in speedbar" Tags="|sorting|speedbar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28721" PostTypeId="2" ParentId="28720" CreationDate="2016-11-17T17:09:57.477" Score="2" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'speedbar)&#xA;&#xA;(defun speedbar-buffer-buttons-engine (temp)&#xA;  &quot;Create speedbar buffer buttons.&#xA;If TEMP is non-nil, then clicking on a buffer restores the previous display.&quot;&#xA;  (speedbar-insert-separator &quot;Active Buffers:&quot;)&#xA;  (let* ((bl (buffer-list))&#xA;         (abl ;; alphabetized buffer-list&#xA;           (sort&#xA;              bl&#xA;              #'(lambda (e1 e2)&#xA;                  (string-lessp (buffer-name e1) (buffer-name e2)))))&#xA;          (case-fold-search t))&#xA;    (while abl&#xA;      (if (string-match &quot;^[ *]&quot; (buffer-name (car abl)))&#xA;    nil&#xA;  (let* ((known (string-match speedbar-file-regexp&#xA;            (buffer-name (car abl))))&#xA;         (expchar (if known ?+ ??))&#xA;         (fn (if known 'speedbar-tag-file nil))&#xA;         (fname (with-current-buffer (car abl)&#xA;                        (buffer-file-name))))&#xA;    (speedbar-make-tag-line 'bracket expchar fn&#xA;          (if fname (file-name-nondirectory fname))&#xA;          (buffer-name (car abl))&#xA;          'speedbar-buffer-click temp&#xA;          'speedbar-file-face 0)&#xA;    (speedbar-buffers-tail-notes (car abl))))&#xA;      (setq abl (cdr abl)))&#xA;    (setq bl (buffer-list)&#xA;          abl ;; alphabetized buffer-list&#xA;           (sort&#xA;              bl&#xA;              #'(lambda (e1 e2)&#xA;                  (string-lessp (buffer-name e1) (buffer-name e2)))))&#xA;    (speedbar-insert-separator &quot;Scratch Buffers:&quot;)&#xA;    (while abl&#xA;      (if (not (string-match &quot;^\\*&quot; (buffer-name (car abl))))&#xA;    nil&#xA;  (if (eq (car abl) speedbar-buffer)&#xA;      nil&#xA;    (speedbar-make-tag-line 'bracket ?? nil nil&#xA;          (buffer-name (car abl))&#xA;          'speedbar-buffer-click temp&#xA;          'speedbar-file-face 0)&#xA;    (speedbar-buffers-tail-notes (car abl))))&#xA;      (setq abl (cdr abl)))&#xA;    ;; Need to research why this last line is needed (if at all)?&#xA;    (setq bl (buffer-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-17T17:25:55.977" LastActivityDate="2016-11-17T17:25:55.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28722" PostTypeId="2" ParentId="28718" CreationDate="2016-11-17T18:26:42.207" Score="1" Body="&lt;p&gt;As said in the comments on my question, adding &lt;code&gt;(require 'cl)&lt;/code&gt; to my config file solved my problem (following &lt;strong&gt;DoMiNeLa10&lt;/strong&gt;'s suggestion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N.B.: I am using Emacs &lt;strong&gt;24.3.1&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13877" LastActivityDate="2016-11-17T18:26:42.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28723" PostTypeId="2" ParentId="24793" CreationDate="2016-11-17T19:30:27.083" Score="0" Body="&lt;p&gt;One has to change the helm-locate command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-locate-command &quot;locate %s -e -A --regex %s&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(See: &lt;a href=&quot;https://github.com/emacs-helm/helm/issues/940&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/emacs-helm/helm/issues/940&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I want spaces and regex, it is not a fuzzy search what I asked for.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-11-17T19:30:27.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28724" PostTypeId="1" AcceptedAnswerId="28805" CreationDate="2016-11-17T22:54:20.813" Score="3" ViewCount="464" Body="&lt;p&gt;I have an issue outlined &lt;a href=&quot;https://emacs.stackexchange.com/questions/28701/modify-syntax-table-for-strings-in-perl-modes&quot;&gt;here&lt;/a&gt; that I was able to find a partial solution for. The problem involved changing &lt;code&gt;perl-modes&lt;/code&gt; syntax table. One of the commenters pointed me to the function &lt;code&gt;syntax-propertize-function&lt;/code&gt;. Within it, there is macro called &lt;code&gt;syntax-propertize-rules&lt;/code&gt; and I was able to add the following code snippet to it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      (&quot;\\('\\)[bh]&quot; (1 &quot;.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this fixed the syntax problem I was having. However this is a change I made to the source &lt;code&gt;perl-mode.el&lt;/code&gt;. What I need is some way to add this rule to &lt;code&gt;syntax-propertize-rules&lt;/code&gt; from within my .emacs file. I have already tried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/perl-syntax-propertize-function ()&#xA;    (&quot;\\('\\)[bh]&quot; (1 &quot;.&quot;)))&#xA;&#xA;(add-hook 'perl-mode-hook&#xA;          (lambda () (add-function :after (symbol-function 'syntax-propertize-rules) #'my/perl-syntax-propertize-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this does not work. What is the correct way to make this change?&lt;/p&gt;&#xA;" OwnerUserId="12269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-11-21T14:56:46.867" Title="add a rule to syntax-propertize-rules" Tags="|hooks|syntax-highlighting|syntax|syntax-table|perl|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28726" PostTypeId="1" CreationDate="2016-11-18T00:30:16.503" Score="0" ViewCount="77" Body="&lt;p&gt;I'm an amateur in Emacs and I would like to change &lt;code&gt;TAB&lt;/code&gt; with &lt;code&gt;C-q TAB&lt;/code&gt;. I used the code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;TAB&quot;) (kbd&quot;C-q TAB&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But by doing so, I need to press &lt;code&gt;TAB&lt;/code&gt; twice in order to get a indent and under the screen it shows &lt;code&gt;C-q TAB TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would this happen? How can I get the indent only by pressing &lt;code&gt;TAB&lt;/code&gt; once?&lt;/p&gt;&#xA;" OwnerDisplayName="user14018" LastEditorUserId="14825" LastEditDate="2022-11-05T01:12:09.383" LastActivityDate="2022-11-05T01:12:09.383" Title="Translate TAB with C-q TAB" Tags="|keymap|tab-key|" AnswerCount="0" CommentCount="3" ClosedDate="2016-11-18T16:05:53.880" ContentLicense="CC BY-SA 3.0" />
  <row Id="28727" PostTypeId="1" AcceptedAnswerId="28738" CreationDate="2016-11-18T03:48:00.010" Score="1" ViewCount="795" Body="&lt;p&gt;I have installed rainbow-delimiter packages, and I tried to customize it based&#xA;on the code written in &lt;a href=&quot;https://github.com/mariusk/emacs-color&quot; rel=&quot;nofollow noreferrer&quot;&gt;this page&lt;/a&gt;.&#xA;However, I found out that some generated colors are too dark when it is used &#xA;with a theme with a dark background such as Zenburn. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to customize it so that the generated color can be more brighter.&lt;/p&gt;&#xA;" OwnerUserId="14020" LastEditorUserId="105" LastEditDate="2016-11-18T03:52:14.483" LastActivityDate="2016-11-18T12:56:14.787" Title="How to Customize Rainbow-Delimiter and Emacs-Color for a theme with Dark Background" Tags="|init-file|colors|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28728" PostTypeId="2" ParentId="28701" CreationDate="2016-11-18T04:47:54.287" Score="2" Body="&lt;p&gt;So I did some more digging and I was able to find a solution, but not a very clean one. I copied the &lt;code&gt;perl-syntax-propertize-function&lt;/code&gt; from perl-mode.el. I then added this to my .emacs and changed the name to &lt;code&gt;my/perl-syntax-propertize-function&lt;/code&gt; and added the following code after &lt;code&gt;syntax-propertize-rules&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;\\('\\)b[^'a-z]&quot; (1 &quot;.&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then added a &lt;code&gt;perl-mode-hook&lt;/code&gt; after my function redefinition&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'perl-mode-hook&#xA;        (lambda () (setq-local syntax-propertize-function #'my/perl-syntax-propertize-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I reloaded my Emacs and everything worked like I wanted. I still hope that someone can come up with a cleaner solution.&lt;/p&gt;&#xA;" OwnerUserId="12269" LastActivityDate="2016-11-18T04:47:54.287" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28730" PostTypeId="2" ParentId="28719" CreationDate="2016-11-18T05:02:13.367" Score="4" Body="&lt;p&gt;One possible solution entails creating a few core functions that generate or locate the desired buffers (e.g., &lt;code&gt;*NeoTree*&lt;/code&gt;, &lt;code&gt;*eshell*&lt;/code&gt;, &lt;code&gt;*cider-repl*&lt;/code&gt;), but not display them -- i.e., they are all setup and ready to go, but remain in the background waiting to be used.  In this example, I have created two new functions called &lt;code&gt;eshell-get-buffer-create&lt;/code&gt; and &lt;code&gt;neotree-get-buffer-create&lt;/code&gt;.  The latter may need some more work (please let me know), but the former is pretty straight forward and should not need any modifications.  I am unfamiliar with cider-repl, so am only using a &lt;code&gt;*scratch*&lt;/code&gt; buffer for the center &quot;Main&quot; window.  The original poster may wish to create a special function that generates or locates the cider-repl buffer without displaying it, and then replace &lt;code&gt;(get-buffer-create &quot;*scratch*&quot;)&lt;/code&gt; with the said new function (which should return the buffer at the tail end of the function).  I am not using any window registers in this example -- instead, I merely delete all other windows and set-up a new 3-way view each time &lt;code&gt;example-fn&lt;/code&gt; is called.  A keyboard shortcut of &lt;code&gt;f5&lt;/code&gt; is used in this example, but the original poster is free to change it to something else.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl)&#xA;(require 'eshell)&#xA;&#xA;(defun eshell-get-buffer-create (&amp;amp;optional arg)&#xA;&quot;Create an interactive Eshell buffer.  Return the Eshell buffer,&#xA;creating it if needed.  The buffer used for Eshell sessions is&#xA;determined by the value of `eshell-buffer-name'.  A numeric prefix&#xA;arg (as in `C-u 42 M-x eshell RET') switches to the session with&#xA;that number, creating it if necessary.  A nonnumeric prefix arg&#xA;means to createa new session.  Returns the buffer selected (or created).&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (cl-assert eshell-buffer-name)&#xA;  (let ((buf (cond ((numberp arg)&#xA;        (get-buffer-create (format &quot;%s&amp;lt;%d&amp;gt;&quot;&#xA;                 eshell-buffer-name&#xA;                 arg)))&#xA;       (arg&#xA;        (generate-new-buffer eshell-buffer-name))&#xA;       (t&#xA;        (get-buffer-create eshell-buffer-name)))))&#xA;    (cl-assert (and buf (buffer-live-p buf)))&#xA;    (with-current-buffer buf&#xA;      (unless (derived-mode-p 'eshell-mode)&#xA;        (eshell-mode)))&#xA;    buf))&#xA;&#xA;(require 'neotree)&#xA;&#xA;(defun neotree-get-buffer-create (&amp;amp;optional dir)&#xA;&quot;Return the neotree buffer -- creating it if needed.&#xA;The root directory may be set/reset using the optional&#xA;argument of DIR; else if buffer exists already use it&#xA;as-is; else use `neo-path--get-working-dir'.&quot;&#xA;  (let ((valid-start-node-p nil)&#xA;        (buffer (neo-global--get-buffer t)))&#xA;    (neo-global--with-buffer&#xA;      (setf valid-start-node-p (neo-buffer--valid-start-node-p))&#xA;      (when (or dir (not valid-start-node-p))&#xA;        (let ((path (or dir (neo-path--get-working-dir)))&#xA;              start-path)&#xA;          (unless (and (file-exists-p path)&#xA;                       (file-directory-p path))&#xA;            (throw 'error &quot;The path is not a valid directory.&quot;))&#xA;          (setq start-path (expand-file-name (substitute-in-file-name path)))&#xA;          (setq neo-buffer--start-node start-path)&#xA;          (cd start-path)&#xA;          (neo-buffer--save-cursor-pos path nil)&#xA;          (let ((start-node neo-buffer--start-node))&#xA;            (unless start-node&#xA;              (setq start-node default-directory))&#xA;            (neo-buffer--with-editing-buffer&#xA;             ;; starting refresh&#xA;             (erase-buffer)&#xA;             (neo-buffer--node-list-clear)&#xA;             (neo-buffer--insert-banner)&#xA;             (setq neo-buffer--start-line neo-header-height)&#xA;             (neo-buffer--insert-tree start-node 1)&#xA;             (goto-char (point-min)))))))&#xA;    buffer))&#xA;&#xA;(defun example-fn ()&#xA;&quot;To try this example, type:  M-x example-fn&quot;&#xA;(interactive)&#xA;  (let ((a (neotree-get-buffer-create))&#xA;        (b (get-buffer-create &quot;*scratch*&quot;))&#xA;        (c (eshell-get-buffer-create)))&#xA;    (delete-other-windows)&#xA;    (switch-to-buffer b) ;; Main -- center window.&#xA;    ;; See the doc-strings for `split-window' and `window--display-buffer'.&#xA;    (window--display-buffer a (split-window (selected-window) nil 'left)&#xA;      'window `((window-width . ,neo-window-width)) display-buffer-mark-dedicated)&#xA;    (window--display-buffer c (split-window (selected-window) nil 'right)&#xA;      'window nil display-buffer-mark-dedicated)))&#xA;&#xA;(global-set-key [f5] 'example-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-18T15:52:43.210" LastActivityDate="2016-11-18T15:52:43.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28731" PostTypeId="1" AcceptedAnswerId="28868" CreationDate="2016-11-18T05:51:33.190" Score="34" ViewCount="5665" Body="&lt;p&gt;Sometimes, package updates from MELPA can break some part of emacs and when that happens I'd like to be able to revert back to using an older version of the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, I can do it in two ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I've set emacs to delete files by moving to trash and when I update a package, the older version is trashed. I can retrieve the older version and replace the one in &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Go to the github repo of the package that broke functionality, fetch an older version of the package, replace the one in &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; with the one from gitub, byte-recompile the file(s).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both these ways involve a lot of manual work moving things around. Is there an easier(preferably automatic) way to downgrade packages installed from MELPA?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2020-08-08T18:01:48.570" Title="Easiest way to downgrade a package installed via MELPA" Tags="|package|package-repositories|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28732" PostTypeId="2" ParentId="28731" CreationDate="2016-11-18T08:17:06.100" Score="4" Body="&lt;p&gt;Lots of people elect not to commit ELPA packages to version control, but this is an example of why I believe you should do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reverting &lt;em&gt;anything&lt;/em&gt; is trivial if it's all committed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on the state of the upstream ELPA packages is a risk.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-11-18T08:17:06.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28733" PostTypeId="1" CreationDate="2016-11-18T08:27:57.467" Score="2" ViewCount="774" Body="&lt;p&gt;I would like to use org-mode for project management. With the &lt;code&gt;:Effort:&lt;/code&gt; property, I can already track estimates of how much time a certain task will take, and displaying an &lt;code&gt;%Effort{:}&lt;/code&gt; column is a great way of having an overview of the total effort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I would like to track the progress on the task(s), i.e., the time spent on a task as reported by a team member. I could not find a similar tag like &lt;code&gt;:Completed:&lt;/code&gt; or so. Ideally I would like to see, in column view, a percentage of how much of the task has already been completed, and what the remaining effort (and effort sum in a hierarchy of tasks) is. Is this possible? Would I need to &quot;clock times&quot; (although the precise times when a certain task was worked on by a team member are neither important to nor known by me), or is there a better approach?&lt;/p&gt;&#xA;" OwnerUserId="14021" LastEditorUserId="105" LastEditDate="2016-11-18T16:14:54.657" LastActivityDate="2016-11-18T16:14:54.657" Title="Tracking effort and time spent on task for project management" Tags="|org-mode|org-clock|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28734" PostTypeId="1" CreationDate="2016-11-18T08:38:23.690" Score="6" ViewCount="496" Body="&lt;p&gt;Currently, I edit LaTeX files by running &lt;code&gt;latexmk -pvc&lt;/code&gt; in the background to generate PDF automatically upon change to be previewed in Evince. However, when there is a syntax error, AucTeX is not able to show it. How can I complete this integration by jumping to errors given by the &lt;code&gt;latexmk&lt;/code&gt; process?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="184" LastEditDate="2016-11-18T13:04:05.310" LastActivityDate="2018-09-19T20:14:17.847" Title="Use AucTeX with &quot;latexmk -pvc&quot;: jump to errors" Tags="|auctex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28735" PostTypeId="1" AcceptedAnswerId="28883" CreationDate="2016-11-18T09:46:06.717" Score="23" ViewCount="9120" Body="&lt;p&gt;I would like to know if there is a way to get the standard side by side &lt;code&gt;diff&lt;/code&gt; view in &lt;code&gt;magit&lt;/code&gt;. That is, instead of seeing the old code chunk and the new one one after the other, I'd like to see them on the same horizontal alignment.&lt;/p&gt;&#xA;" OwnerUserId="9675" LastEditorUserId="253" LastEditDate="2016-11-18T16:04:18.300" LastActivityDate="2021-09-09T12:51:16.900" Title="Magit diff side by side" Tags="|magit|diff|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28736" PostTypeId="1" AcceptedAnswerId="28746" CreationDate="2016-11-18T10:45:21.637" Score="15" ViewCount="7251" Body="&lt;p&gt;When running &lt;code&gt;previous-line&lt;/code&gt;, &lt;code&gt;C-p&lt;/code&gt; or &lt;code&gt;&amp;lt;up&amp;gt;&lt;/code&gt; the cursor jumps up a line without any issues or lags. When running &lt;code&gt;next-line&lt;/code&gt;, &lt;code&gt;C-n&lt;/code&gt; or &lt;code&gt;&amp;lt;down&amp;gt;&lt;/code&gt; the cursor properly jumps down a line, but with a significant lag. When I hold the down key I can't even see the point moving, it just appears somewhere below. I ran the Emacs profiler and it seems that the culprit is &lt;code&gt;cl-position&lt;/code&gt;. What it works out to be is that &lt;code&gt;previous-line&lt;/code&gt; literally just moves the cursor, while &lt;code&gt;next-line&lt;/code&gt; runs a whole lot of functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Rn5Lx.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Rn5Lx.png&quot; alt=&quot;Profiler output&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the issue and how can it be fixed?&lt;/p&gt;&#xA;" OwnerUserId="13180" LastActivityDate="2020-02-23T01:58:45.217" Title="Emacs point(cursor) movement lag" Tags="|point|motion|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28737" PostTypeId="1" AcceptedAnswerId="28758" CreationDate="2016-11-18T12:39:15.410" Score="2" ViewCount="49" Body="&lt;p&gt;I'd like to start a BBDB search directly with the word at the current cursor &lt;code&gt;point&lt;/code&gt; or with the current selection.  Is there already a short-cut or at least a function for these functionalities?&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2016-11-18T14:59:20.067" LastActivityDate="2016-11-19T08:57:42.840" Title="BBDB (version 3) search at point or for selected text" Tags="|bbdb|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28738" PostTypeId="2" ParentId="28727" CreationDate="2016-11-18T12:56:14.787" Score="1" Body="&lt;p&gt;&lt;em&gt;If&lt;/em&gt; you really want random colors from the code, try giving a higher value for the l parameter, which obviously stands for the lightness in the HSL representation. Maybe also reducing the saturation (s) helps. I.e. something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((... (set-random-rainbow-colors 0.3 0.8))) ;; instead of 0.5 0.49&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If&lt;/em&gt; you just want to have custom colors for &lt;code&gt;rainbow-delimiters-mode&lt;/code&gt;, customize the group &quot;Rainbow delimiters faces&quot;, by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-group &amp;lt;ret&amp;gt; rainbow-delimiters-faces&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I would actually prefer the colors &lt;em&gt;not&lt;/em&gt; to be random, so one immedeately sees &quot;I am on the outer level now&quot; and such.)&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-18T12:56:14.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28739" PostTypeId="2" ParentId="28736" CreationDate="2016-11-18T13:08:00.823" Score="3" Body="&lt;p&gt;I'm not absolutely sure what is the problem, but your profiler report seems to indicate that posn-at-point performs more redisplay than expected, which in turns causes recomputation of the mode-line, and that powerline should make more effort to memoize its computation for the modeline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW, I suggest you &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; and you might also report a bug to the powerline maintainers.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-18T13:08:00.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28741" PostTypeId="2" ParentId="22124" CreationDate="2016-11-18T14:28:03.920" Score="2" Body="&lt;p&gt;This is not exactly a complete answer to your question, but it may help you as a starting point. My evil-colemak-basics provides Qwerty/Colemak best-of-both-worlds key bindings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/wbolster/evil-colemak-basics&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/wbolster/evil-colemak-basics&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use it as a starting point in case you have a different layout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, this is 6 months after you asked your question, so maybe you are using proper Colemak now, in which case this package may be exactly what you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastActivityDate="2016-11-18T14:28:03.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28743" PostTypeId="1" CreationDate="2016-11-18T16:16:37.487" Score="3" ViewCount="218" Body="&lt;p&gt;I'm using spacemacs for react development.  i like it mostly but I have one issue that is annoying.  Currently emacs will try to align certain lines with the last opening paren, so something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;return React.createElement('div', &#xA;                          { class = &quot;className&quot; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would rather the second line not be aligned with the opening paren and instead be indented only one extra 'tab' deep.  So something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;return React.createElement('div',&#xA;    { class = &quot;className&quot; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe my problem is only if I'm stating a new block on the next line, ie I have an opening brace/bracket/paren as the first character on my second line.  For instance I get the indentation I expect if I do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;return React.createElement('div', {&#xA;    class = &quot;className&quot;,&#xA;    style = &quot;whatever&quot;,&#xA;    ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not very experienced with eclipse configuration, I've stolen a mostly configured version for a peer so far.  I have tried following these instructions: &lt;a href=&quot;https://stackoverflow.com/questions/1475279/how-to-control-indentation-after-an-open-parenthesis-in-emacs&quot;&gt;https://stackoverflow.com/questions/1475279/how-to-control-indentation-after-an-open-parenthesis-in-emacs&lt;/a&gt; but they didn't change anything, presumably because I should be setting a different argument to control indentation for opening brackets, though I'm not sure what argument I need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;React-mode seems to use mostly default settings for indentation, I used standard-indent for instance to control indent size, so presumably it's using whatever the default settings are for controlling indentation as well.&lt;/p&gt;&#xA;" OwnerUserId="14027" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-11-18T16:16:37.487" Title="preventing indenting to open paren when creating a new block in react-mode" Tags="|indentation|spacemacs|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28744" PostTypeId="1" CreationDate="2016-11-18T17:59:35.833" Score="0" ViewCount="342" Body="&lt;p&gt;I currently have a keyboard shortcut bound to &lt;code&gt;C-c t&lt;/code&gt; that shows me all of the NEXTACTION items I have, no matter what headline level they're at. It works by using a kbd macro wherein I just typed &lt;code&gt;C-c / N &amp;lt;RET&amp;gt;&lt;/code&gt;, and that was enough to fill in everything I needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I would like that same shortcut to also show me WAITING items. I tried just recording the whole macro of &lt;code&gt;C-c / NEXCTACTION|WAITING &amp;lt;RET&amp;gt;&lt;/code&gt;, and assigning that, but for some reason it still seems to use the old macro. I don't have any idea what's going on there, it's almost like it's ignoring that I've changed the macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the function help for &lt;code&gt;org-sparse-tree&lt;/code&gt; directly, it seems that it accepts optional arguments, but I can't find any documentation describing how to use the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, all I want is a single keyboard shortcut that gives an org-sparse-tree on two keywords at the same time. Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;This is the relevant part of my .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'NEXTACTION-WAITING-org-tree&#xA;   [?\C-c ?/ ?T ?N ?E ?X ?T ?A ?C ?T ?I ?O ?N ?| ?W ?A ?I ?T ?I ?N ?G return])&#xA;&#xA;(defun nextaction-org-tree-fun ()&#xA;  (progn&#xA;    (switch-to-buffer (find-file &quot;~/orgfiles/personalorg.org&quot;))&#xA;    (execute-kbd-macro (symbol-function 'NEXTACTION-WAITING-org-tree))))&#xA;&#xA;(global-set-key (kbd &quot;C-c t&quot;) (lambda ()&#xA;                                (interactive)&#xA;                                (nextaction-org-tree-fun)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9315" LastEditorUserId="9315" LastEditDate="2016-11-22T21:09:11.077" LastActivityDate="2023-12-10T04:08:15.987" Title="org-sparse-tree on multiple keywords" Tags="|org-mode|keyboard-macros|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28745" PostTypeId="1" CreationDate="2016-11-18T18:04:58.180" Score="1" ViewCount="24" Body="&lt;p&gt;Related: &lt;a href=&quot;https://emacs.stackexchange.com/questions/7956/how-to-do-searches-in-mediawiki-mode&quot;&gt;How to do searches in MediaWiki mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the absence of specific support for searching MediaWiki sites, &lt;code&gt;helm&lt;/code&gt; seems like a good framework for search and navigation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one write a helm extension for WikiMedia-powered wikis? Is this even generalizable across wikis in the helm framework? &lt;/p&gt;&#xA;" OwnerUserId="594" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-11-18T18:04:58.180" Title="Writing helm search for MediaWiki-powered wikis" Tags="|helm|search|helm-sources|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28746" PostTypeId="2" ParentId="28736" CreationDate="2016-11-18T18:15:21.997" Score="28" Body="&lt;p&gt;I have found an answer to my question through narrowing down the naughty bit and googling. I have managed to reduce the lag 10 TIMES!!!! I mean....It is insane on how much computing power &lt;code&gt;next-line&lt;/code&gt; was using to move a cursor down ?!?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fix:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this code into your init.el: &lt;code&gt;(setq auto-window-vscroll nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/F28MZ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/F28MZ.png&quot; alt=&quot;Lag reduced significantly&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;next-line&lt;/code&gt; does not trigger &lt;code&gt;line-move-partial&lt;/code&gt; therefore reducing the lag.&#xA;I do not remember setting up &lt;code&gt;auto-window-vscroll&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. It wasn't anywhere in any of my &lt;code&gt;.el&lt;/code&gt; files, I am not sure how it got set to &lt;code&gt;t&lt;/code&gt; to begin with. So if anyone has an performance issues with the cursor movement, then the above fix will reduce the lag from about 50%-80% cpu time to 5% cpu time !!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To quickly check if you are affected just run &lt;code&gt;C-h v auto-window-vscroll&lt;/code&gt;. If it is set to &lt;code&gt;t&lt;/code&gt; you might be having major performance issues. Verify with the Emacs profiler if the cursor movement does indeed cause a lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best of luck fellow Emacs lovers!!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2006-09/msg00814.html&quot; rel=&quot;noreferrer&quot;&gt;Source of fix&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13180" LastActivityDate="2016-11-18T18:15:21.997" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28747" PostTypeId="2" ParentId="28713" CreationDate="2016-11-18T19:17:43.233" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Where can I report this problem? Should I report it directly to&#xA;  &lt;a href=&quot;http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs&lt;/a&gt; or rather to&#xA;  &lt;a href=&quot;https://cygwin.com/ml/cygwin/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://cygwin.com/ml/cygwin/&lt;/a&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &quot;true&quot; answer to this depends on where the bug really is.  Of course, you don't know where it is yet, so you'll have to guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few more things you could do to gather evidence about where the bug lies (ordered by ascending difficulty):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;(directory-files &quot;/&quot;)&lt;/code&gt; instead of &lt;code&gt;file-name-all-completions&lt;/code&gt; to rule out the completion code being the problem (if it &lt;em&gt;is&lt;/em&gt; in fact the completion code, then the bug is almost certainly in Emacs).&lt;/li&gt;&#xA;&lt;li&gt;Check if the problem exists in earlier versions of Emacs (if no, it suggests the bug is in Emacs)&lt;/li&gt;&#xA;&lt;li&gt;Check if the problem exists in earlier versions of Cygwin&lt;/li&gt;&#xA;&lt;li&gt;Try to reproduce the bug in a simple C program that fails to open &quot;/&quot;.  If you can do this, then you have proved&lt;sup&gt;*&lt;/sup&gt; that the bug is in Cygwin &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;*&lt;/sup&gt; Unless there's a mistake in the C program, but since it's small, that should be easy for the Cygwin maintainers to see.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Just going by what you've posted so far, I would suggest reporting an Emacs bug, and if there are no responses in a couple of days, then try sending a message to the Cygwin list pointing to the Emacs bug to see if anyone has some ideas about it.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-11-18T19:17:43.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28748" PostTypeId="1" CreationDate="2016-11-18T20:24:47.107" Score="5" ViewCount="1611" Body="&lt;p&gt;I want that when I choose a project from the list presented by &lt;code&gt;projectile-switch-project&lt;/code&gt;, projectile changes the current working directory to the chosen project's root directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; cd into dir i want, including git-root&#xA;  (defun cd-dwim ()&#xA;      (cd (projectile-project-root)))&#xA;  (setq projectile-switch-project-action 'cd-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Did not work. It projectile-project-root does not receive the new path from the project I just chose. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd love if I was able to write something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-switch-project-action &#xA;'projectile-get-the-root-directory-of-the-project-I-just-chose)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible? &lt;/p&gt;&#xA;" OwnerUserId="12585" LastActivityDate="2016-11-19T07:30:25.030" Title="how do I write a projectile-switch-action that changes the current working directory to the chosen project's root dir?" Tags="|projectile|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28749" PostTypeId="1" CreationDate="2016-11-18T20:56:27.530" Score="3" ViewCount="523" Body="&lt;p&gt;How can I make it so that &lt;code&gt;H-g&lt;/code&gt; followed by &lt;code&gt;a&lt;/code&gt; gives an alpha etc.?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="25" LastEditDate="2016-11-18T21:13:17.607" LastActivityDate="2019-11-18T21:52:09.383" Title="Quickly inserting a single Greek letter" Tags="|input-method|insert|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28750" PostTypeId="1" CreationDate="2016-11-18T21:25:34.397" Score="5" ViewCount="475" Body="&lt;p&gt;I have some code that runs in a hook that I want to change to only execute only if the left mouse button is not currently held down. I don't see any obvious functions or variables that let me directly query the mouse button state. What's the easiest way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2301" LastActivityDate="2017-10-20T13:46:07.017" Title="Detect if mouse button is held down?" Tags="|hooks|mouse|inputs|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28751" PostTypeId="2" ParentId="28749" CreationDate="2016-11-18T21:28:25.317" Score="5" Body="&lt;p&gt;There are several ways. A key difference is how close &lt;code&gt;H-g a&lt;/code&gt; is to typing an actual character α would be if you had that key on your keyboard. For example, you can make &lt;code&gt;H-g a&lt;/code&gt; a macro that inserts the string &lt;code&gt;α&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;H-g a&quot;) &quot;α&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But then &lt;code&gt;H-g a&lt;/code&gt; differs from inserting a character in several ways which may or may not be desirable. For example it won't trigger behaviors specific to &lt;code&gt;self-insert-command&lt;/code&gt; (which is the case in some abbrev expansion/autocompletion packages), it is not grouped with other insertions for undo purposes, etc. This also allows &lt;code&gt;H-g&lt;/code&gt; to be overridden by mode-specific bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the translation really look like a character insertion and work before any ordinary key bindings, but after terminal-specific ones (so if you use a non-window Emacs on a terminal that sends an escape sequence for &lt;code&gt;H-g&lt;/code&gt;, your binding will still work), put it in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Translation-Keymaps.html#index-key_002dtranslation_002dmap&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;key-translation-map&lt;/code&gt;&lt;/a&gt;, which is pretty much designed for what you're doing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key key-translation-map (kbd &quot;H-g a&quot;) &quot;α&quot;)&#xA;…&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs has input methods for inserting characters that aren't on the keyboard, but I don't know how to use an input method for the next character only.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2016-12-13T12:03:14.400" LastActivityDate="2016-12-13T12:03:14.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28752" PostTypeId="1" CreationDate="2016-11-18T21:48:31.337" Score="0" ViewCount="217" Body="&lt;p&gt;I'm using eyebrowse-mode and I want to mantain a separte current-working directory for each eyebrowse-window-config. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like that window-config-1 had it's own current working directory, so that, for example, if I M-x find-file in slot-1 then dired starts at the directory tied to slot-1. if I M-x find-file in slot-2, then dired starts at the directory tied to slot-2. So on and so forth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="12585" LastEditDate="2016-11-19T02:11:22.903" LastActivityDate="2016-11-19T02:11:22.903" Title="how to mantain one current working directory for each window config in eyebrowse mode?" Tags="|window|frames|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28754" PostTypeId="2" ParentId="28749" CreationDate="2016-11-18T22:33:47.820" Score="2" Body="&lt;p&gt;To do this for &lt;strong&gt;all&lt;/strong&gt; Greek letters, download library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/ucs-cmds.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;ucs-cmds.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;, then put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ucs-cmds)&#xA;(ucsc-make-commands &quot;^greek [a-z]+ letter&quot;)))&#xA;(global-set-key (kbd &quot;H-g a&quot;) 'greek-small-letter-alpha)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That defines a command for &lt;em&gt;each&lt;/em&gt; Greek letter, which inserts it.  The command name is the same as the character (letter) it inserts, except that it is lowercase and spaces have been replaced by hyphens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The return value of &lt;code&gt;ucsc-make-commands&lt;/code&gt; is a list of the commands created (their symbols), so you can in fact iterate over it (or a subset) to create a set of key bindings for them all at once, if you like.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-11-19T02:55:26.327" LastActivityDate="2016-11-19T02:55:26.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28755" PostTypeId="1" AcceptedAnswerId="28793" CreationDate="2016-11-18T23:49:20.897" Score="5" ViewCount="74" Body="&lt;p&gt;Suppose I want to find all &lt;code&gt;*tex&lt;/code&gt; files recursively from a given directory containing foo and bar but not doe. I am looking for something like helm-do-ag, but that doesn't seem to support the not operator. So is there anything like that which supports search queries with full boolean operations, i.e. something like: &quot;find all tex files containing (apple AND orange) OR (banana and pear) not apricot&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2016-11-21T01:06:43.960" Title="Search files by content using full boolean expressions" Tags="|grep|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28757" PostTypeId="2" ParentId="28748" CreationDate="2016-11-19T07:30:25.030" Score="5" Body="&lt;p&gt;The default action is &lt;code&gt;projectile-find-file&lt;/code&gt;. Change it to &lt;code&gt;projectile-dired&lt;/code&gt;, and whenever you switch project, you get into a dired buffer of the root of that project:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-switch-project-action 'projectile-dired)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="200" LastActivityDate="2016-11-19T07:30:25.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28758" PostTypeId="2" ParentId="28737" CreationDate="2016-11-19T08:57:42.840" Score="2" Body="&lt;p&gt;I don't think this functionality is already implemented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AFAICS the functionality is provided e.g. by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun bbdb-word-at-point ()&#xA;  &quot;Ask bbdb about word at point.&quot;&#xA;  (interactive)&#xA;  (bbdb (thing-at-point 'word t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2016-11-19T08:57:42.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28759" PostTypeId="1" AcceptedAnswerId="28760" CreationDate="2016-11-19T09:46:22.407" Score="0" ViewCount="311" Body="&lt;p&gt;I have written some code to create a new buffer, it starts up in fundamental mode, the buffer is to display output from commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using this to create the buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-buffer-create &quot;*My Buffer*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I am trying to switch to and change the mode using this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(display-buffer buffer-name)&#xA;(special-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My understanding is that this should switch to the buffer and change the mode which is what actually happens with the added side effect the the original buffer I was using also switches to special-mode so both buffers end up in special-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am i doing this completely wrong ? how can i create a buffer for command output and change the mode of just that buffer ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the working answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(display-buffer buffer-name)&#xA;(with-current-buffer buffer-name (special-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13729" LastEditorUserId="13729" LastEditDate="2016-11-19T11:17:40.640" LastActivityDate="2016-11-19T11:17:40.640" Title="Switching buffer to special mode or any mode?" Tags="|buffers|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28760" PostTypeId="2" ParentId="28759" CreationDate="2016-11-19T09:58:26.113" Score="2" Body="&lt;p&gt;The docstring of &lt;code&gt;display-buffer&lt;/code&gt; says (&lt;code&gt;C-h f display-buffer&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;display-buffer is an interactive compiled Lisp function in&#xA;  `window.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to C-x 4 C-o.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(display-buffer BUFFER-OR-NAME &amp;amp;optional ACTION FRAME)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Display BUFFER-OR-NAME in some window, &lt;strong&gt;without selecting it&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You have to select the buffer for following operations to act on it.  See eg &lt;code&gt;set-buffer&lt;/code&gt; or &lt;code&gt;with-current-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-11-19T09:58:26.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28761" PostTypeId="1" CreationDate="2016-11-19T12:47:00.237" Score="0" ViewCount="42" Body="&lt;p&gt;How can I open a debug window and select it and make it fill the whole frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((help-window-select t))&#xA;  (with-help-window &quot;*Debug*&quot;&#xA;    (dolist (item load-path) &#xA;      (print item)))&#xA;  (delete-other-windows))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this does not work; it seems to delete the help window itself and not the other windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-help-window &quot;*Debug*&quot;&#xA;  (dolist (item load-path) &#xA;    (print item)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will split the frame into two windows, with the &lt;code&gt;&quot;*Debug*&quot;&lt;/code&gt; buffer shown in the lower window. In addition the &lt;code&gt;&quot;*Debug*&quot;&lt;/code&gt; window is not selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((buf (switch-to-buffer &quot;*Debug*&quot;)))&#xA;  (dolist (item load-path) &#xA;    (print item buf))&#xA;  (help-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this creates the &lt;code&gt;&quot;*Debug*&quot;&lt;/code&gt; buffer, but it does not select it (it stays hidden)&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2016-11-19T14:54:01.447" LastActivityDate="2016-11-19T14:54:01.447" Title="Switch to help window and select and maximize it" Tags="|window|" AnswerCount="0" CommentCount="4" ClosedDate="2016-11-28T18:08:57.197" ContentLicense="CC BY-SA 3.0" />
  <row Id="28762" PostTypeId="1" CreationDate="2016-11-19T15:06:27.597" Score="0" ViewCount="108" Body="&lt;p&gt;I try to replace &lt;code&gt;html-mode&lt;/code&gt; with &lt;code&gt;web-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ignore-errors (require 'web-mode))&#xA;&#xA;(when (featurep 'web-mode)&#xA;  (mapc (lambda (spec)&#xA;           (when (eq (cdr spec) 'html-mode) (setcdr spec 'web-mode)))&#xA;        magic-fallback-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and get error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;progn: Attempt to modify read-only object: (&quot;\\(?:&amp;lt;\\?xml[  &#xA;]+[^&amp;gt;]*&amp;gt;\\)?[   &#xA;]*&amp;lt;\\(?:!--\\(?:[^-]\\|-[^-]\\)*--&amp;gt;[    &#xA;]*&amp;lt;\\)*\\(?:!DOCTYPE[   &#xA;]+[^&amp;gt;]*&amp;gt;[   &#xA;]*&amp;lt;[    &#xA;]*\\(?:!--\\(?:[^-]\\|-[^-]\\)*--&amp;gt;[     &#xA;]*&amp;lt;\\)*\\)?[Hh][Tt][Mm][Ll]&quot; . html-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I modify &lt;code&gt;html-mode&lt;/code&gt; to &lt;code&gt;web-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;We have in &lt;code&gt;lisp/files.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar magic-fallback-mode-alist&#xA;  (purecopy ... ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;src/data.c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEFUN (&quot;setcdr&quot;, Fsetcdr, Ssetcdr, 2, 2, 0,&#xA;       doc: /* Set the cdr of CELL to be NEWCDR.  Returns NEWCDR.  */)&#xA;  (register Lisp_Object cell, Lisp_Object newcdr)&#xA;{&#xA;  CHECK_CONS (cell);&#xA;  CHECK_IMPURE (cell, XCONS (cell));&#xA;  XSETCDR (cell, newcdr);&#xA;  return newcdr;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;src/puresize.h&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* Signal an error if OBJ is pure.  PTR is OBJ untagged.  */&#xA;&#xA;#define puresize_h_CHECK_IMPURE(obj, ptr) \&#xA;  (PURE_P (ptr) ? pure_write_error (obj) : (void) 0)&#xA;&#xA;INLINE void&#xA;CHECK_IMPURE (Lisp_Object obj, void *ptr)&#xA;{&#xA;  puresize_h_CHECK_IMPURE (obj, ptr);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;(info &quot;(elisp) Pure Storage&quot;)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Pure storage is used for certain data in the preloaded&#xA;  standard Lisp files—data that should never change during actual use of&#xA;  Emacs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Emacs have no a way to check if object is in pure storage from Elisp ((&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-11-19T15:24:42.483" LastActivityDate="2016-11-19T19:00:17.720" Title="&quot;eval: Attempt to modify read-only object&quot; when setcdr to magic-fallback-mode-alist" Tags="|pure-storage|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28763" PostTypeId="5" CreationDate="2016-11-19T15:16:32.630" Score="0" Body="&lt;p&gt;&lt;code&gt;(info &quot;(elisp)Pure Storage&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;E.2 Pure Storage&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Emacs Lisp uses two kinds of storage for user-created Lisp objects: &lt;strong&gt;normal storage&lt;/strong&gt; and &lt;strong&gt;pure storage&lt;/strong&gt;.  &lt;strong&gt;Normal storage&lt;/strong&gt; is where all the new data created during an Emacs session are kept.  &lt;strong&gt;Pure storage&lt;/strong&gt; is used for certain data in the preloaded standard Lisp files—data that should never change during actual use of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-- Function: purecopy object&#xA;   This function makes a copy in pure storage of OBJECT, and returns it.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-11-19T21:52:35.767" LastActivityDate="2016-11-19T21:52:35.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28764" PostTypeId="4" CreationDate="2016-11-19T15:16:32.630" Score="0" Body=" **Pure storage** is used for certain data in the preloaded standard Lisp files—data that should never change during actual use of Emacs." OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-11-19T21:52:23.593" LastActivityDate="2016-11-19T21:52:23.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28765" PostTypeId="1" CreationDate="2016-11-19T15:24:36.293" Score="1" ViewCount="108" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/ieure/ssh-el&quot; rel=&quot;nofollow noreferrer&quot;&gt;ssh-mode&lt;/a&gt; when I need to work on remote hosts. As I only establish ssh connections to hosts, that are stored in my ssh config file I want this list of hosts to be displayed in a &lt;code&gt;helm-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="253" LastEditDate="2016-11-20T06:28:50.777" LastActivityDate="2016-11-20T06:28:50.777" Title="list hosts of ssh config file with helm when using ssh.el" Tags="|helm|ssh|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28766" PostTypeId="2" ParentId="28762" CreationDate="2016-11-19T15:31:42.307" Score="0" Body="&lt;p&gt;Because C code doesn't expose &lt;code&gt;CHECK_IMPURE&lt;/code&gt; macro to Elisp I make silly check and copy pure object to normal object with &lt;code&gt;copy-tree&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (cl-some (lambda (spec) (eq (cdr spec) 'html-mode))&#xA;               magic-fallback-mode-alist)&#xA;  (setq magic-fallback-mode-alist (copy-tree magic-fallback-mode-alist))&#xA;  (mapc (lambda (spec) (when (eq (cdr spec) 'html-mode) (setcdr spec 'web-mode)))&#xA;        magic-fallback-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastActivityDate="2016-11-19T15:31:42.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28768" PostTypeId="1" CreationDate="2016-11-19T16:39:17.163" Score="2" ViewCount="109" Body="&lt;p&gt;On Nylas N1 email client it is possible to see if receiving person has opened your email. They call this feature &lt;em&gt;open tracking&lt;/em&gt;. Is it possible to configure emacs email client mu4e to have this feature? &lt;/p&gt;&#xA;" OwnerUserId="6848" LastActivityDate="2016-11-23T20:52:46.557" Title="Email open tracking on mu4e" Tags="|mu4e|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28769" PostTypeId="2" ParentId="28744" CreationDate="2016-11-19T18:15:28.563" Score="0" Body="&lt;p&gt;This is an attempt to answer your last question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Idea&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;F3 C-c / r NEXTACTION\|WAITING RET F4&#xA;C-xk b F5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then F5 yields the desired sparse tree.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2016-11-19T18:15:28.563" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28770" PostTypeId="2" ParentId="28762" CreationDate="2016-11-19T18:50:03.700" Score="3" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'subr-x)&#xA;(when-let (elt (rassq 'html-mode magic-fallback-mode-alist))&#xA;  (push (cons (car elt) 'web-mode) magic-fallback-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-11-19T18:50:03.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28771" PostTypeId="2" ParentId="28762" CreationDate="2016-11-19T19:00:17.720" Score="1" Body="&lt;p&gt;In addition to politza's answer, another approach can be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'html-mode 'web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this will simply redirect all uses of &lt;code&gt;html-mode&lt;/code&gt; to &lt;code&gt;web-mode&lt;/code&gt;, regardless if it comes from &lt;code&gt;magic-fallback-mode-alist&lt;/code&gt; or &lt;code&gt;auto-mode-alist&lt;/code&gt; or ...&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-19T19:00:17.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28772" PostTypeId="1" CreationDate="2016-11-19T19:45:43.493" Score="3" ViewCount="1560" Body="&lt;p&gt;I have an init file on a USB drive. I use this USB drive at home and at work for my init file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until recently, my home and work computers were both Windows machines. I am now adding a Linux machine at home and am looking for a way for Emacs to play nicely with all of the machines: Windows and Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of the major problem I see:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(find-file &quot;E:/emacs/org/gtd.org&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linux doesn't use letter drives? What do I do? &lt;/p&gt;&#xA;" OwnerUserId="13432" LastActivityDate="2017-05-10T12:50:31.350" Title="Manage same init file for Linux and Windows" Tags="|init-file|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28773" PostTypeId="2" ParentId="28772" CreationDate="2016-11-19T20:10:40.267" Score="5" Body="&lt;p&gt;Make your configuration system or even machine dependant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can, for example, load system specific init files:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(load-file (expand-file-name&#xA;            (cond ((eq system-type 'windows-nt) &quot;windows.el&quot;)&#xA;                  ((eq system-type 'gnu/linux) &quot;linux.el&quot;)&#xA;                  (t &quot;default-system.el&quot;))&#xA;            user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To load machine depandent files you can use &lt;code&gt;(system-name)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun load-with-warning (file)&#xA;  (when (file-exists-p file)&#xA;    (condition-case err&#xA;        (load-file file)&#xA;      (error (display-warning&#xA;              'init&#xA;              (format &quot;loading file %s:\n\t%s&quot; file (error-message-string err))&#xA;              :warning)))))&#xA;&#xA;(load-with-warning (expand-file-name&#xA;            (system-name)&#xA;            user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-11-22T15:02:45.203" LastActivityDate="2016-11-22T15:02:45.203" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28774" PostTypeId="1" AcceptedAnswerId="28778" CreationDate="2016-11-19T20:50:33.810" Score="6" ViewCount="581" Body="&lt;p&gt;I regularly use &lt;code&gt;calc-eval&lt;/code&gt; in the &lt;code&gt;*scratch*&lt;/code&gt; buffer to work out some quick calculations. I know that I can use some simple functions inside the calculation string, e.g. log. However I am not certain whether I can use the solver in the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to write a &lt;code&gt;calc-eval&lt;/code&gt; expression that solves for, say, a particular variable?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="105" LastEditDate="2016-11-19T20:56:03.940" LastActivityDate="2016-11-20T03:44:59.837" Title="Can I use calc-eval to solve an equation?" Tags="|calc|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28775" PostTypeId="2" ParentId="28774" CreationDate="2016-11-19T22:00:48.983" Score="2" Body="&lt;p&gt;Check out section 11.6 of the Calc manual, which is about solving equations. I just use &lt;code&gt;calc-mode&lt;/code&gt; rather than calling &lt;code&gt;calc-eval&lt;/code&gt; by hand, but it seems like you'd be able to use the functions it describes.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-11-19T22:00:48.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28776" PostTypeId="2" ParentId="26752" CreationDate="2016-11-19T22:19:08.300" Score="3" Body="&lt;p&gt;Here is an example where you can use &lt;code&gt;C-c C-c&lt;/code&gt; to bring up the pdf file in &lt;code&gt;evince&lt;/code&gt; pdf viewer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-custom-grep-cmd ()&#xA;  (interactive)&#xA;  (let* ((candidate      (helm-get-selection))&#xA;         (split          (helm-grep-split-line candidate))         &#xA;         (lineno         (string-to-number (nth 1 split)))&#xA;         (full-name      (substring-no-properties (car split)))&#xA;         (pdf-file       (concat (file-name-sans-extension full-name) &quot;.pdf&quot;)))&#xA;    (start-process &quot;viewpdf&quot; nil &quot;setsid&quot; &quot;/usr/bin/evince&quot; pdf-file)))&#xA;&#xA;(define-key helm-grep-map (kbd &quot;C-c C-c&quot;) 'my-custom-grep-cmd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tested this on Ubuntu 16.04 using Emacs 25.1 and &lt;code&gt;helm-do-grep-ag&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-11-19T22:19:08.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28777" PostTypeId="2" ParentId="26271" CreationDate="2016-11-20T03:41:56.063" Score="0" Body="&#xA;&#xA;&lt;p&gt;This can be implemented with &lt;code&gt;yas--templates-for-key-at-point&lt;/code&gt;, that's an internal function so it's not guaranteed to keep working, but it should be fine for at least the next year or so.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local yas--expandable-keys-overlay nil)&#xA;&#xA;(defun yas-show-expand-keys ()&#xA;  &quot;Put overlay on text which is an expandable snippet key.&#xA;This function is intended to be added to `post-command-hook'.&quot;&#xA;  (let ((keys-at-point (and yas-minor-mode (yas--templates-for-key-at-point)))&#xA;        (have-overlay (overlayp (buffer-local-value 'yas--expandable-keys-overlay (current-buffer)))))&#xA;    (if keys-at-point&#xA;        (let ((beg (nth 1 keys-at-point))&#xA;              (end (nth 2 keys-at-point)))&#xA;          (if have-overlay&#xA;              (move-overlay yas--expandable-keys-overlay beg end)&#xA;            (setq-local yas--expandable-keys-overlay&#xA;                        (make-overlay beg end)))&#xA;          (overlay-put yas--expandable-keys-overlay 'face '(:box t)))&#xA;      (when have-overlay&#xA;        (delete-overlay yas--expandable-keys-overlay)))))&#xA;&#xA;(add-hook 'post-command-hook #'yas-show-expand-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-11-20T03:41:56.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28778" PostTypeId="2" ParentId="28774" CreationDate="2016-11-20T03:44:59.837" Score="8" Body="&lt;p&gt;Yes, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(calc-eval &quot;solve([x+y=3, x-y=1], [x,y])&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;evaluates to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;[x = 2, y = 1]&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might find it more comfortable to use a &lt;code&gt;calc-mode&lt;/code&gt; buffer than running &lt;code&gt;calc-eval&lt;/code&gt; in the scratch buffer, though.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2016-11-20T03:44:59.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28779" PostTypeId="2" ParentId="28765" CreationDate="2016-11-20T06:25:21.717" Score="1" Body="&lt;p&gt;I have found &lt;a href=&quot;http://wikemacs.org/wiki/How_to_write_helm_extensions&quot; rel=&quot;nofollow noreferrer&quot;&gt;How to write helm extensions&lt;/a&gt;. Only thing I had to do was return the list of known hosts with &lt;code&gt;pcmpl-ssh-hosts&lt;/code&gt; for the &lt;code&gt;helm-source&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ssh-helm-source&#xA;      `((name . &quot;Known hosts&quot;)&#xA;        (candidates . ,(pcmpl-ssh-hosts))&#xA;        (action . (lambda (candidate)&#xA;                    (helm-marked-candidates)))))&#xA;&#xA;(defun helm-ssh ()&#xA;  (interactive)&#xA;  (ssh&#xA;   (mapconcat 'identity&#xA;              (helm :sources '(ssh-helm-source))&#xA;              &quot;,&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-11-20T06:25:21.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28781" PostTypeId="1" CreationDate="2016-11-20T10:23:03.750" Score="6" ViewCount="965" Body="&lt;p&gt;I love the option in org-reveal (reveal_single_file:t) that allows me to export a presentation to my students with image support embedded in the html file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched for a way to do it in the normal org to html exporter with no success.  Any clue how that can be done?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="8979" LastEditDate="2017-01-22T06:18:04.773" LastActivityDate="2018-07-16T23:46:21.600" Title="export to single html file (like reveal_single_file:t) in regular html export" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28782" PostTypeId="1" CreationDate="2016-11-20T11:18:50.140" Score="6" ViewCount="650" Body="&lt;p&gt;It must be very simple to get rid of but I could not find something addressing the problem : I would like to avoid underlined spaces between two lines. The following screenshot illustrates the problem in an org itemize:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/6VB9F.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6VB9F.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the classic &lt;code&gt;default-fill-column&lt;/code&gt; of 80. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;describe-char&lt;/code&gt; value of the space character (in place of the red cursor) gives the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; position: 500 of 1353 (37%), column: 0&#xA;        character: SPC (displayed as SPC) (codepoint 32, #o40, #x20)&#xA;preferred charset: ascii (ASCII (ISO646 IRV))&#xA;code point in charset: 0x20&#xA;           script: latin&#xA;           syntax:          which means: whitespace&#xA;         category: .:Base, a:ASCII, l:Latin&#xA;         to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;      buffer code: #x20&#xA;        file code: #x20 (encoded by coding system utf-8-unix)&#xA;          display: terminal code #x20&#xA;&#xA;Character code properties: customize what to show&#xA;  name: SPACE&#xA;  general-category: Zs (Separator, Space)&#xA;  decomposition: (32) (' ')&#xA;&#xA;There are text properties here:&#xA;  face                 org-link&#xA;  font-lock-multiline  t&#xA;  fontified            t&#xA;  help-echo            [Show]&#xA;  keymap               [Show]&#xA;  mouse-face           highlight&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT (by Tobias):&#xA;Org-text for reproduction:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Energy and Numerical Weather Predictin; aussi ce papier sur [[http://web.mit.edu/lorenzcenter/about/LorenzPubs/The_Statistical_Prediction_of_Solutions_1962.pdf][statistic&#xA;  prediction of sol of dynamics equations]]&#xA;&#xA;Local Variables:&#xA;fill-column: 80&#xA;org-hide-emphasis-markers: t&#xA;eval: (progn (setq org-descriptive-links nil) (org-toggle-link-display))&#xA;End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13074" LastEditorUserId="17852" LastEditDate="2017-12-14T15:38:00.587" LastActivityDate="2017-12-14T15:38:00.587" Title="avoiding underlined spaces between two lines" Tags="|org-mode|whitespace|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28783" PostTypeId="1" AcceptedAnswerId="28785" CreationDate="2016-11-20T12:22:27.583" Score="0" ViewCount="229" Body="&lt;p&gt;In my init file I have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook (lambda () (linum-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it shows line numbers only for programming modes. I tried to do the same with &lt;code&gt;hl-line-mode&lt;/code&gt;, but it does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook (lambda () (hl-line-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is that? Both are buffer-local minor modes, according to the documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13865" LastEditorUserId="105" LastEditDate="2016-12-22T17:27:55.740" LastActivityDate="2017-02-20T19:14:33.097" Title="Setting hl-line-mode for programming modes" Tags="|init-file|highlighting|buffer-local|hl-line-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28785" PostTypeId="2" ParentId="28783" CreationDate="2016-11-20T16:12:48.870" Score="1" Body="&lt;p&gt;There was an unrelated problem where a symbolic link was not set so the changes I made to the init file were not being loaded. Now it works.&lt;/p&gt;&#xA;" OwnerUserId="13865" LastActivityDate="2016-11-20T16:12:48.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28788" PostTypeId="1" CreationDate="2016-11-20T18:38:18.473" Score="13" ViewCount="2004" Body="&lt;p&gt;Commands like &lt;code&gt;helm-projectile-grep&lt;/code&gt;, &lt;code&gt;helm-swoop&lt;/code&gt;, &lt;code&gt;projectile-find-file&lt;/code&gt; are extremely useful for jumping around code. However, so far I've not found how I can open a search result in a new window (instead, right now pressing &lt;code&gt;RET&lt;/code&gt; with a search result highlighted opens the search result in the window from which the original search command was executed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to be able to optionally open a search result highlighted in the &lt;code&gt;*helm grep*&lt;/code&gt; mode either in a horizontally or a vertically tiled window. For instance, I'd like the following functionality:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Pressing &lt;code&gt;RET&lt;/code&gt; opens the highlighted result in the current window&lt;/li&gt;&#xA;&lt;li&gt;Pressing &lt;code&gt;C-c h RET&lt;/code&gt; opens the highlighted result in a new, horizontally tiled window&lt;/li&gt;&#xA;&lt;li&gt;Pressing &lt;code&gt;C-c v RET&lt;/code&gt; opens the highlighted result in a new, vertically tiled window&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's an illustration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PS0Xm.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PS0Xm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is something like this possible? Thanks for your time!&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="105" LastEditDate="2016-11-20T21:43:45.840" LastActivityDate="2017-12-13T19:59:09.090" Title="Open helm search result in a new window?" Tags="|helm|window|projectile|window-splitting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28789" PostTypeId="1" AcceptedAnswerId="30018" CreationDate="2016-11-20T18:57:36.830" Score="2" ViewCount="403" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rfntk.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rfntk.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was trying to change defconst value for a tabbar image, the following lines are defined in tabbar.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst tabbar-scroll-left-button-enabled-image&#xA;  '((:type pbm :data &quot;\&#xA;P2 13 13 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255&#xA;255 255 255 255 255 255 255 255 128 16 48 255 255 255 255 255 255 255&#xA;255 144 28 86 128 0 255 255 255 255 255 255 160 44 92 159 135 113 0&#xA;255 255 255 255 160 44 97 165 144 129 120 117 0 255 255 176 44 98 175&#xA;174 146 127 126 127 128 0 255 255 0 160 184 156 143 136 134 135 137&#xA;138 0 255 255 176 32 67 144 146 144 145 146 148 149 0 255 255 255 255&#xA;160 42 75 140 154 158 159 160 0 255 255 255 255 255 255 160 40 74 154&#xA;170 171 0 255 255 255 255 255 255 255 255 160 41 82 163 0 255 255 255&#xA;255 255 255 255 255 255 255 160 32 48 255 255 255 255 255 255 255 255&#xA;255 255 255 255 255 255&#xA;&quot;))&#xA;  &quot;Default image for the enabled scroll left button.&#xA;A disabled button image will be automatically build from it.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So first I put the following lines in my init file but it is not working, but they works if I do replace in the original file tabbar.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst tabbar-scroll-left-button-enabled-image&#xA;  '((:type png :file &quot;~/.emacs.d/new-scroll-left.png&quot; :ascent center))&#xA;  &quot;Default image for the enabled scroll right button.&#xA;A disabled button image will be automatically build from it.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since I still want to redefine the image in my init file not modify tabbar.el directly, then I tried to append the defcustom found in tabbar.el calling tabbar-scroll-left-button-enabled-image also in the init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom tabbar-scroll-left-button&#xA;  (cons (cons &quot; &amp;lt;&quot; tabbar-scroll-left-button-enabled-image)&#xA;        (cons &quot; =&quot; nil))&#xA;  &quot;The scroll left button.&#xA;The variable `tabbar-button-widget' gives details on this widget.&quot;&#xA;  :group 'tabbar&#xA;  :type tabbar-button-widget&#xA;  :set '(lambda (variable value)&#xA;          (custom-set-default variable value)&#xA;          ;; Schedule refresh of button value.&#xA;          (setq tabbar-scroll-left-button-value nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I found no other functions are calling this defcustom in tabbar.el. However so far it is still not working. Anyone who is familar with tabbar loading its images can possibly help to explain a little bit?&lt;/p&gt;&#xA;" OwnerUserId="12577" LastActivityDate="2017-01-15T10:48:29.053" Title="How to overwrite defconst/defcustom value in init file, tabbar arrow button image for example" Tags="|images|tabbar|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28790" PostTypeId="1" AcceptedAnswerId="28855" CreationDate="2016-11-20T19:51:06.733" Score="1" ViewCount="463" Body="&lt;p&gt;Following up on a recent question of mine (&lt;a href=&quot;https://emacs.stackexchange.com/questions/28542/helm-occur-how-to-make-it-behave-more-like-isearch&quot;&gt;here&lt;/a&gt;), I would like &lt;code&gt;helm-swoop&lt;/code&gt; to behave in a certain way when pressing &lt;code&gt;C-s&lt;/code&gt; that parallels the behaviour of &lt;code&gt;isearch&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s&lt;/code&gt; in a buffer: open &lt;code&gt;helm-swoop&lt;/code&gt; with empty search field.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s&lt;/code&gt; in &lt;code&gt;helm-swoop&lt;/code&gt; with &lt;strong&gt;empty&lt;/strong&gt; search field: activate previous search.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-s&lt;/code&gt; in &lt;code&gt;helm-swoop&lt;/code&gt; with &lt;strong&gt;non-empty&lt;/strong&gt; search field: go to next match.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The tricky parts are 2. and 3. obviously. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-11-23T08:05:18.767" Title="helm-swoop: how to make it behave more like isearch?" Tags="|helm|search|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28791" PostTypeId="1" CreationDate="2016-11-20T20:31:03.650" Score="2" ViewCount="2003" Body="&lt;p&gt;When setting multiple tags for emacs headers with the &quot;single key fast selection&quot; all of the selected tags are marked in the list (with color) but only the last one is listed on the &quot;Current&quot; line and actually inserted when I exit. I.e. using single keys I can only insert one single tag, eventhough I select more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I hit &lt;code&gt;!&lt;/code&gt; before selecting tags (&quot;groups&quot;) then it works as I want it. How can I make this behaviour default?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;org-fast-tag-selection-single-key&lt;/code&gt; is set to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5237" LastEditorUserId="5237" LastEditDate="2016-11-20T20:40:08.337" LastActivityDate="2016-12-21T08:14:44.233" Title="Setting multiple tags in org-mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28792" PostTypeId="2" ParentId="22578" CreationDate="2016-11-20T23:06:37.820" Score="1" Body="&lt;p&gt;This problem is related to this code in android-mode.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro android-in-root (body)&#xA;  &quot;Execute BODY form with project root directory as&#xA;``default-directory''.  The form is not executed when no project&#xA;root directory can be found.&quot;&#xA;  `(let ((android-root-dir (android-root)))&#xA;     (if android-root-dir&#xA;       (let ((default-directory android-root-dir))&#xA;         ,body)&#xA;       (error &quot;can't find project root&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you remove the (error &quot;can't find project root&quot;) it will work in this case. I don't know the implications of this removal for other situations, but it is discussed &lt;a href=&quot;https://github.com/remvee/android-mode/issues/50&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://github.com/remvee/android-mode/pull/52&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was having the same problem. I removed the error and it worked.&lt;/p&gt;&#xA;" OwnerUserId="13989" LastActivityDate="2016-11-20T23:06:37.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28793" PostTypeId="2" ParentId="28755" CreationDate="2016-11-21T01:06:43.960" Score="5" Body="&lt;p&gt;Try using the UNIX or GNU/Linux &lt;strong&gt;&lt;code&gt;find&lt;/code&gt;&lt;/strong&gt; command.  It supports Boolean operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs you can, for example, use command &lt;strong&gt;&lt;code&gt;find-dired&lt;/code&gt;&lt;/strong&gt;, which runs &lt;code&gt;find&lt;/code&gt; and puts the set of found files in a Dired buffer.  You can then mark any number of them and then act on the marked files (e.g. &lt;code&gt;A&lt;/code&gt; to search incrementally, &lt;code&gt;Q&lt;/code&gt; to query-replace). (Emacs also has a &lt;code&gt;grep-find&lt;/code&gt; command, at least for some platforms.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;find&lt;/code&gt;&lt;/strong&gt; can search to any depth. It is an amazing command - practically a language unto itself.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-21T01:06:43.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28794" PostTypeId="1" AcceptedAnswerId="30075" CreationDate="2016-11-21T06:50:01.047" Score="3" ViewCount="3374" Body="&lt;p&gt;Emacs fails to load my init.el file after it fails to load .emacs.d/history file from (savehist-mode 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the minimum &lt;code&gt;history&lt;/code&gt; file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq minibuffer-history '(&quot;/home/eugenekim/.emacs.d/init.el&quot; &quot;Enabled&quot; #(&quot;stash&quot; 0 5 (face magit-hash magit-section [cl-struct-magit-section stash &quot;stash@{9}&quot; #&amp;lt;marker (moves after insertion) at 918 in *magit: zibann&amp;gt; nil #&amp;lt;marker at 962 in *magit: zibann&amp;gt; nil nil nil n\&#xA;il nil nil [cl-struct-magit-section stashes &quot;refs/stash&quot; #&amp;lt;marker (moves after insertion) at 602 in *magit: zibann&amp;gt; #&amp;lt;marker at 615 in *magit: zibann&amp;gt; #&amp;lt;marker at 1129 in *magit: zibann&amp;gt; nil nil nil nil nil nil [cl-struct-magit-section status nil #&amp;lt;marker (moves after in\&#xA;sertion) at 1 in *magit: zibann&amp;gt; nil #&amp;lt;marker at 1129 in *magit: zibann&amp;gt; nil nil nil nil nil nil nil ([cl-struct-magit-section branch &quot;feature/review-tag&quot; #&amp;lt;marker (moves after insertion) at 1 in *magit: zibann&amp;gt; #&amp;lt;marker at 47 in *magit: zibann&amp;gt; #&amp;lt;marker at 125 in *magit\&#xA;: zibann&amp;gt; nil nil nil nil nil nil #7 ([cl-struct-magit-section branch #(&quot;origin/feature/review-tag&quot; 0 25 (face magit-branch-remote)) #&amp;lt;marker (moves after insertion) at 47 in *magit: zibann&amp;gt; nil #&amp;lt;marker at 100 in *magit: zibann&amp;gt; nil nil nil nil nil nil #9 nil] [cl-struc\&#xA;t-magit-section tag &quot;saleor&quot; #&amp;lt;marker (moves after insertion) at 100 in *magit: zibann&amp;gt; nil #&amp;lt;marker at 124 in *magit: zibann&amp;gt; nil nil nil nil nil nil #9 nil])] [cl-struct-magit-section unstaged nil #&amp;lt;marker (moves after insertion) at 125 in *magit: zibann&amp;gt; #&amp;lt;marker at 1\&#xA;46 in *magit: zibann&amp;gt; #&amp;lt;marker at 602 in *magit: zibann&amp;gt; nil nil nil nil nil nil #7 ([cl-struct-magit-section file &quot;ios/littlehome/Externals/CTAssetsPickerController&quot; #&amp;lt;marker (moves after insertion) at 146 in *magit: zibann&amp;gt; #&amp;lt;marker at 207 in *magit: zibann&amp;gt; #&amp;lt;marker a\&#xA;t 339 in *magit: zibann&amp;gt; t nil nil nil &quot;diff --git ios/littlehome/Externals/CTAssetsPickerController ios/littlehome/Externals/CTAssetsPickerController&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and here's the error log&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Debugger entered--Lisp error: (invalid-read-syntax &quot;#&quot;)&lt;br&gt;&#xA;  signal(invalid-read-syntax (&quot;#&quot;))   (condition-case errvar (progn&#xA;  (load savehist-file nil (not (interactive-p))) (setq savehist-loaded&#xA;  t)) (error (setq savehist-mode nil) (savehist-uninstall) (signal (car&#xA;  errvar) (cdr errvar))))   (progn (condition-case errvar (progn (load&#xA;  savehist-file nil (not (interactive-p))) (setq savehist-loaded t))&#xA;  (error (setq savehist-mode nil) (savehist-uninstall) (signal (car&#xA;  errvar) (cdr errvar)))))   (if (and (not savehist-loaded)&#xA;  (file-exists-p savehist-file)) (progn (condition-case errvar (progn&#xA;  (load savehist-file nil (not (interactive-p))) (setq savehist-loaded&#xA;  t)) (error (setq savehist-mode nil) (savehist-uninstall) (signal (car&#xA;  errvar) (cdr errvar))))))   (if (not savehist-mode)&#xA;  (savehist-uninstall) (if (and (not savehist-loaded) (file-exists-p&#xA;  savehist-file)) (progn (condition-case errvar (progn (load&#xA;  savehist-file nil (not (interactive-p))) (setq savehist-loaded t))&#xA;  (error (setq savehist-mode nil) (savehist-uninstall)$&lt;br&gt;&#xA;  savehist-mode(1)   eval-buffer(# nil&#xA;  &quot;/home/eugenekim/.emacs.d/init.el&quot; nil t)  ; Reading at buffer&#xA;  position 19074&lt;br&gt;&#xA;  load-with-code-conversion(&quot;/home/eugenekim/.emacs.d/init.el&quot;&#xA;  &quot;/home/eugenekim/.emacs.d/init.el&quot; t t)&lt;br&gt;&#xA;  load(&quot;/home/eugenekim/.emacs.d/init&quot; t t)   #[0 &quot;^H\205\266^@&#xA;  \306=\203^Q^@\307^H\310Q\202?^@&#xA;  \311=\204^^^@\307^H\312Q\202?^@\313\307\314\315#\203*^@\316\202?^@\313\307\314\317#\203&gt;^@\320\321\322!D\nB^R\323\202?^@\316\324^S\325^A\324\211#\210^K\324=\203e^@\326\327\330\307^H\331Q!\&quot;\325^A\324\211#\210^K\324=\203$&#xA;  command-line()   normal-top-level()&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This happens when I open multiple emacs -nw at the same time. Sometimes but not always.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastEditorUserId="306" LastEditDate="2017-01-14T13:59:53.373" LastActivityDate="2017-01-19T12:17:13.957" Title="emacs history (invalid-read-syntax &quot;#&quot;)" Tags="|history|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28795" PostTypeId="2" ParentId="27656" CreationDate="2016-11-21T07:08:11.250" Score="1" Body="&lt;p&gt;This has been accepted as a bug in Emacs, but I don't have a lot of hope that someone is eager to fix it.  (I looked at it, but didn't have enough background to figure out what was happening.)  &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24651&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24651&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you, like me, actually used this feature, you can get a similar result by advising &lt;code&gt;(make-frame)&lt;/code&gt;.  I did it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-make-frame-advice (fcn &amp;amp;rest args)  &#xA;  (let* ((frm (selected-frame))  &#xA;         (geom-parms (mapcar (lambda (parm)  &#xA;                               (cons (parm (frame-parameter frm parm)))  &#xA;                             '(left top height width)))&#xA;         (new-frm (apply fcn args)))  &#xA;    (modify-frame-parameters new-frm geom-parms)&#xA;    new-frm))  &#xA;&#xA;(advice-add #'make-frame :around #'my-make-frame-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4085" LastEditorUserId="4085" LastEditDate="2016-11-23T16:51:06.650" LastActivityDate="2016-11-23T16:51:06.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28797" PostTypeId="2" ParentId="28791" CreationDate="2016-11-21T08:02:51.963" Score="1" Body="&lt;p&gt;I solved the problem - the trick is to remove groups from &lt;code&gt;org-tag-alist&lt;/code&gt; (delimeted by (:startgroup) (:endgroup)) - all tags between them are by default considered exclusive, therefore by default only the most recent is inserted (the highlighting seems to be a (minor) bug to me - this is confusing for the user, because the tags look selected, but are not)&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2016-11-21T08:02:51.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28798" PostTypeId="1" AcceptedAnswerId="28800" CreationDate="2016-11-21T10:51:19.010" Score="3" ViewCount="72" Body="&lt;p&gt;How to refile while keeping a copy of the original object in org-mode? In other words refiling works as a cut&amp;amp;paste while I would like to have a copy&amp;amp;paste.&lt;/p&gt;&#xA;" OwnerUserId="7199" LastActivityDate="2016-11-21T11:38:35.843" Title="Refile and keep the original" Tags="|commands|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28799" PostTypeId="1" AcceptedAnswerId="28859" CreationDate="2016-11-21T11:18:34.830" Score="1" ViewCount="74" Body="&lt;p&gt;I have some snippets in my config, that depend on external tools. For example I use &lt;code&gt;xmodmap&lt;/code&gt; at startup.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (eq window-system 'x)&#xA;    (if (file-exists-p &quot;/usr/bin/xmodmap&quot;)&#xA;        (shell-command &quot;xmodmap -e 'clear Lock' -e 'keycode 66 = F13'&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to install xmodmap automatically if it isn't installed ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Ehvince When I install xmodmap in the else clause, the xmodmap command won't be executed. I think I need some piece of code that waits for the subprocess to be finished before executing the xmodmap command ?&#xA;Another problem is, I can't install a package when I start emacs without sudo. So I need a password prompt, I guess.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2016-11-21T18:14:11.890" LastActivityDate="2016-11-23T11:06:31.357" Title="install missing external packages automatically from within emacs" Tags="|subprocess|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28800" PostTypeId="2" ParentId="28798" CreationDate="2016-11-21T11:38:35.843" Score="5" Body="&lt;p&gt;No big problem, it's documented in the info page &lt;a href=&quot;http://orgmode.org/manual/Refile-and-copy.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;(org) Refile and copy&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c&lt;/code&gt; &lt;code&gt;M-w&lt;/code&gt;     (org-copy)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Copying works like refiling, except that the original note is not deleted.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastActivityDate="2016-11-21T11:38:35.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28801" PostTypeId="1" CreationDate="2016-11-21T12:59:25.343" Score="2" ViewCount="398" Body="&lt;p&gt;Basically I am after a method to find missing times. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I use this code to view times per task.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :link t :maxlevel 10 :block week :scope file &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I can not view if i am missing times with in any particular day.&lt;/p&gt;&#xA;" OwnerUserId="13729" LastEditorUserId="13729" LastEditDate="2016-11-22T09:13:09.717" LastActivityDate="2016-11-22T12:02:42.230" Title="Is there a view that can show time entered per day?" Tags="|org-mode|time-date|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28802" PostTypeId="1" AcceptedAnswerId="28804" CreationDate="2016-11-21T13:59:07.050" Score="8" ViewCount="404" Body="&lt;p&gt;On &lt;a href=&quot;https://www.emacswiki.org/emacs/MultilineRegexp&quot; rel=&quot;noreferrer&quot;&gt;https://www.emacswiki.org/emacs/MultilineRegexp&lt;/a&gt; one finds the hint to use &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[\0-\377[:nonascii:]]*\n&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;instead of the standard &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;.*\n&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;to match any character up to a newline to avoid stack overflow for huge texts (37 KB). Is the overflow the concern here, or is a matching run for the former also more performant than the latter? &lt;/p&gt;&#xA;" OwnerUserId="12623" LastActivityDate="2016-11-21T14:43:34.277" Title="Most performant matching of &quot;any char&quot;" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28803" PostTypeId="1" AcceptedAnswerId="28806" CreationDate="2016-11-21T14:29:14.040" Score="16" ViewCount="2455" Body="&lt;p&gt;I searched accross all Emacs Lisp files in Emacs Git repo, and found &lt;code&gt;(goto-char (point-min))&lt;/code&gt; occurs 3621 times and &lt;code&gt;(goto-char 1)&lt;/code&gt; occurs 31 times. Personally, I see lots of &lt;code&gt;(point-min)&lt;/code&gt; but none &lt;code&gt;1&lt;/code&gt;, even in many cases, it's 100% sure that the region is not narrowed. So here is my question: is &lt;code&gt;(point-min)&lt;/code&gt; still preferred than &lt;code&gt;1&lt;/code&gt; even in un-narrowed buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess &lt;code&gt;1&lt;/code&gt; is faster than &lt;code&gt;(point-min)&lt;/code&gt;, no mater how slight it is, because &lt;code&gt;1&lt;/code&gt; is constant while &lt;code&gt;(point-min)&lt;/code&gt; is a function call. Besides, &lt;code&gt;1&lt;/code&gt; is much shorter than &lt;code&gt;(point-min)&lt;/code&gt;, 1 character v.s. 11 characters.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="737" LastEditDate="2016-11-25T00:23:56.603" LastActivityDate="2016-11-25T00:23:56.603" Title="Why is (point-min) much more popular than 1?" Tags="|buffers|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28804" PostTypeId="2" ParentId="28802" CreationDate="2016-11-21T14:43:34.277" Score="9" Body="&lt;p&gt;In Emacs's regexps, &lt;code&gt;.&lt;/code&gt; does not match all characters.  It is a synonym of &lt;code&gt;[^\n]&lt;/code&gt;.  So the reason for using &lt;code&gt;[\0-\377[:nonascii:]]&lt;/code&gt; is when you want to match &quot;any char, even a newline&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;W.r.t overflowing the stack, &lt;code&gt;.*\n&lt;/code&gt; should be handled very efficiently, i.e. without backtracking and without eating up the stack.  On the contrary &lt;code&gt;[\0-\377[:nonascii:]]*\n&lt;/code&gt; is handled rather inefficiently by Emacs's regexp engine because it will eat up a bit of the stack for every character matched, so on &quot;huge&quot; texts it will tend to overflow the stack.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the emacswiki suggests &lt;code&gt;[\0-\377[:nonascii:]]*&lt;/code&gt; and not &lt;code&gt;[\0-\377[:nonascii:]]*\n&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-21T14:43:34.277" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28805" PostTypeId="2" ParentId="28724" CreationDate="2016-11-21T14:56:46.867" Score="4" Body="&lt;p&gt;The answer is that you can't do it &quot;right&quot;.&#xA;But you can do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'my/perl-syntax-propertize-function&#xA;  (syntax-propertize-rules (&quot;\\('\\)[bh]&quot; (1 &quot;.&quot;))))&#xA;&#xA;(add-hook 'perl-mode-hook&#xA;          (lambda ()&#xA;            (add-function :before (local 'syntax-propertize-function)&#xA;                          #'my/perl-syntax-propertize-function)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;AFAIK the main problem with the above is that it will misfire when &lt;code&gt;'b&lt;/code&gt; is not the beginning of a binary constant but the end of a string followed by &lt;code&gt;b&lt;/code&gt;.  Fixing this would be a lot more ugly, because you'd then need to know if you're already within a string, and to know this, you'd need to apply your rule &lt;em&gt;at the same time&lt;/em&gt; as perl-mode's normal rules rather &lt;code&gt;:after&lt;/code&gt; or &lt;code&gt;:before&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-21T14:56:46.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28806" PostTypeId="2" ParentId="28803" CreationDate="2016-11-21T14:58:33.583" Score="28" Body="&lt;h1&gt;How do you know that the buffer is not narrowed?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Unless you have widened it right before you called the function, you cannot be sure.&#xA;Moreover, &quot;great software&quot; is often defined as &quot;being used in ways the author has never envisioned&quot; - so one should always be prepared for the unusual use of one's code.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Code readability is King&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;When you write &lt;code&gt;(goto-char 1)&lt;/code&gt;, the person reading the code (including you 6 months later) will spend precious brainpower thinking&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;how do we know the buffer is not narrowed?&quot; and &lt;/li&gt;&#xA;&lt;li&gt;&quot;is the first character 0 or 1?&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Basically, unless you have &lt;code&gt;(widen)&lt;/code&gt; right before, you need a comment explaining why you are confident the buffer is not narrowed.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Cost is trivial&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Unless you have profiled your code and found otherwise, a safe assumption is that the cost here will be trivial.&#xA;Compared to all the other things ELisp does (network, disk access, even string matching), &lt;code&gt;(point-min)&lt;/code&gt; will not have a meaningful cost (and might even be &lt;em&gt;cheaper&lt;/em&gt;, see Stefan's answer).&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-11-21T18:33:57.877" LastActivityDate="2016-11-21T18:33:57.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28807" PostTypeId="2" ParentId="28803" CreationDate="2016-11-21T15:27:33.973" Score="18" Body="&lt;p&gt;To complement sds's answer (with which I fully agree), despite appearances, &lt;code&gt;(point-min)&lt;/code&gt; can be more efficient than &lt;code&gt;1&lt;/code&gt;.  In terms of execution speed, my tests don't see any measurable difference, but in terms of size:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (byte-compile '(lambda () (goto-char (point-min))))&#xA;#[nil &quot;eb\207&quot; [] 1]&#xA;&#xA;ELISP&amp;gt; (byte-compile '(lambda () (goto-char 1)))&#xA;#[nil &quot;\300b\207&quot; [1] 1]&#xA;&#xA;ELISP&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's because &lt;code&gt;point-min&lt;/code&gt; has its own byte-code, and is hence encoded and executed very efficiently compared to other function calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, another reason for me to use &lt;code&gt;point-min&lt;/code&gt; is that I consider the historical choice of &lt;code&gt;1&lt;/code&gt; to be a mistake (buffers should have started at 0).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-21T15:27:33.973" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28809" PostTypeId="2" ParentId="28782" CreationDate="2016-11-21T18:43:29.210" Score="3" Body="&lt;p&gt;Putting the following lisp-snippet into your initialization file (e.g., &lt;code&gt;~/.emacs&lt;/code&gt;) should do the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It puts a fontification rule at the very end of the org-specific &lt;code&gt;font-lock-keywords&lt;/code&gt;. This rule clears underlining of spaces at line-beginnings by overriding the faces there.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defface org-dont-underline-indents '((t :underline nil))&#xA;  &quot;Avoid underlining of indentation.&quot;)&#xA;&#xA;(defun org-dont-underline-indents ()&#xA;  &quot;Remove underlining at indents.&quot;&#xA;  (add-to-list 'org-font-lock-extra-keywords '(&quot;^[[:space:]]+&quot; 0 'org-dont-underline-indents t) 'append))&#xA;&#xA;(add-hook 'org-font-lock-set-keywords-hook #'org-dont-underline-indents 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above version is greedy in the sense that it adds the &lt;code&gt;org-dont-underline-indents&lt;/code&gt; face to all (non-empty) indents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this has any negative consequences I am not aware of yet you can use the following version that only adds the &lt;code&gt;org-dont-underline-indents&lt;/code&gt; face if it finds some other face at the beginning of the indent.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defface org-dont-underline-indents '((t :underline nil))&#xA;  &quot;Avoid underlining of indentation.&quot;)&#xA;&#xA;(defun org-search-underlined-indents (limit)&#xA;  &quot;Match function for `org-dont-underline-indents'.&quot;&#xA;  (let (ret face)&#xA;    (while (and (setq ret (re-search-forward &quot;^[[:space:]]+&quot; limit t))&#xA;        (or (null (setq face (plist-get (text-properties-at (match-beginning 0)) 'face)))&#xA;            (eq face 'org-dont-underline-indents))))&#xA;    ret))&#xA;&#xA;(defun org-dont-underline-indents ()&#xA;  &quot;Remove underlining at indents.&quot;&#xA;  (add-to-list 'org-font-lock-extra-keywords '(org-search-underlined-indents 0 'org-dont-underline-indents t) 'append))&#xA;&#xA;(add-hook 'org-font-lock-set-keywords-hook #'org-dont-underline-indents 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-21T19:10:19.737" LastActivityDate="2016-11-21T19:10:19.737" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28810" PostTypeId="1" CreationDate="2016-11-21T18:48:28.207" Score="3" ViewCount="1746" Body="&lt;p&gt;After asking &lt;a href=&quot;https://emacs.stackexchange.com/questions/28740/zip-program-for-odt-export&quot;&gt;this question&lt;/a&gt;, I have downloaded &lt;a href=&quot;http://www.7-zip.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;7zip for Windows&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to export to .odt, I am still getting this: &quot;OpenDocument export failed: Executable &quot;zip&quot; needed for creating OpenDocument files.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is my next step? &lt;/p&gt;&#xA;" OwnerUserId="13432" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2019-11-05T03:53:41.353" Title="Associate Emacs with 7zip for .odt export?" Tags="|odt|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28811" PostTypeId="1" CreationDate="2016-11-21T20:16:16.667" Score="0" ViewCount="738" Body="&lt;p&gt;Was wondering if anyone knew of a way to go into the .emacs file and add an attribute to change the color of a specific string in all files it appears.  The specific example I wish to use this for would be for any given file, if the string &quot;TODO&quot; exists, make the color of that text red.  I want that string to stand out in my java, python, c++, etc. files so I can pick them out when easily looking around.&lt;/p&gt;&#xA;" OwnerUserId="9406" LastEditorUserId="253" LastEditDate="2016-11-21T20:22:22.393" LastActivityDate="2016-12-22T16:42:34.813" Title="Change color of specific text in files" Tags="|font-lock|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28812" PostTypeId="1" AcceptedAnswerId="28813" CreationDate="2016-11-21T20:24:53.113" Score="2" ViewCount="179" Body="&lt;p&gt;I've never quoted nil before, as I can't see any sense in doing that, but I just played around with some code and it seems that in most cases it is possible to quote nil without any effect. However when I use &lt;code&gt;condition-case&lt;/code&gt; with a quoted nil as the first argument, I get an error &lt;code&gt;(wrong-type-argument symbolp (quote nil))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case 'nil&#xA;    (/ 2 0)&#xA;  (error &quot;foo&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why does quoting nil cause problems when using it this way ?&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-11-21T21:39:27.937" Title="When is it not possible to quote nil?" Tags="|elisp|" AnswerCount="1" CommentCount="1" ClosedDate="2016-11-21T21:14:31.227" ContentLicense="CC BY-SA 3.0" />
  <row Id="28813" PostTypeId="2" ParentId="28812" CreationDate="2016-11-21T20:49:28.850" Score="2" Body="&lt;p&gt;Whenever the variable in question is evaluated, &lt;code&gt;'nil&lt;/code&gt; and &lt;code&gt;nil&lt;/code&gt; are the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., all functions (but not necessarily macros and special forms!) get their arguments evaluated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is not evaluated, like the first argument of the special form &lt;code&gt;condition-case&lt;/code&gt;, you cannot quote it because then you are passing a list &lt;code&gt;(quote nil)&lt;/code&gt; instead of the symbol &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-11-21T21:39:27.937" LastActivityDate="2016-11-21T21:39:27.937" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28814" PostTypeId="1" CreationDate="2016-11-21T21:19:16.327" Score="0" ViewCount="453" Body="&lt;p&gt;I have been able to install Emacs 25.1 and AUCTeX 11.89.6 (this is the number that I have after installing it with MELPA directly from Emacs) that I am using on a Windows 7 machine. &#xA;I am trying to use ispell possibly with flyspell but when I type&#xA;M-x flyspell-mode&#xA;I get: Error enabling flysepll &#xA;(Searching for program No such file or directory ispell)&#xA;I have tryied adding&#xA;(require 'ispell)&#xA;(setq ispell-program-name &quot;ispell&quot;)&#xA;and&#xA;(setq ispell-program-name &quot;tex-ispell&quot;)&#xA;I have read that ispell comes with Emacs 25 and I have found isepll.el in the emacs directory. I have also checked that I have that directory on the Emacs path by&#xA;C-h v load-path&#xA;Finally, I have tried to &quot;launch&quot; directly from with emacs in the customization menu but failed.&#xA;It seems like an easy task but I am not being able to make it work.&#xA;Any pointer would be great.&#xA;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13926" LastActivityDate="2016-11-22T02:47:30.313" Title="configuring and using ispell" Tags="|auctex|ispell|" AnswerCount="1" CommentCount="0" ClosedDate="2016-11-28T18:10:31.830" ContentLicense="CC BY-SA 3.0" />
  <row Id="28815" PostTypeId="2" ParentId="28810" CreationDate="2016-11-21T21:31:43.557" Score="1" Body="&lt;p&gt;After you have associated 7zip with files that have a give extension (e.g. &lt;code&gt;.zip&lt;/code&gt;), in the usual way for MS Windows (I don't think that's your question), you can have Emacs open such files using that associated program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do that, start with the Emacs Wiki &lt;a href=&quot;https://www.emacswiki.org/emacs/CategoryWThirtyTwo&quot; rel=&quot;nofollow noreferrer&quot;&gt;Category W32&lt;/a&gt;. There you will find, among other things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/MsShellExecute&quot; rel=&quot;nofollow noreferrer&quot;&gt;MS Shell Execute&lt;/a&gt; - tell Emacs to use Windows programs associated with given file types&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dired+&lt;/a&gt; - open files from Dired using the associated Windows programs&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#WindowsFileAssociations&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bookmark+&lt;/a&gt; - use Windows file associations as bookmark actions&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-21T21:31:43.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28816" PostTypeId="1" AcceptedAnswerId="28850" CreationDate="2016-11-21T21:37:06.960" Score="2" ViewCount="491" Body="&lt;p&gt;Here is an example config to demonstrate the problem I am facing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(package-initialize)&#xA;(package-refresh-contents)&#xA;(package-install 'use-package)&#xA;(setq use-package-always-ensure t)&#xA;(use-package cider)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Previously, this would cause &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt; to install &lt;a href=&quot;https://github.com/clojure-emacs/cider&quot; rel=&quot;nofollow noreferrer&quot;&gt;CIDER&lt;/a&gt; just fine; however, since I removed my &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; directory today to update my packages, I now get this error when I run &lt;code&gt;emacs --debug-init&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function if-let)&#xA;  (if-let ((cons (assoc car alist))) (setcdr cons (list cadr)) (set symbol (cons (list car cadr) alist)))&#xA;  (let ((alist (symbol-value symbol))) (if-let ((cons (assoc car alist))) (setcdr cons (list cadr)) (set symbol (cons (list car cadr) alist))))&#xA;  cider-add-to-alist(cider-jack-in-dependencies &quot;org.clojure/tools.nrepl&quot; &quot;0.2.12&quot;)&#xA;  byte-code(&quot;\300\301\302\303#\210\304\301\305\306#\207&quot; [put cider-jack-in-dependencies risky-local-variable t cider-add-to-alist &quot;org.clojure/tools.nrepl&quot; &quot;0.2.12&quot;] 4)&#xA;  require(cider nil t)&#xA;  (not (require (quote cider) nil (quote t)))&#xA;  (if (not (require (quote cider) nil (quote t))) (ignore (message (format &quot;Cannot load %s&quot; (quote cider)))))&#xA;  (progn (progn (require (quote package)) (use-package-ensure-elpa (quote cider))) (if (not (require (quote cider) nil (quote t))) (ignore (message (format &quot;Cannot load %s&quot; (quote cider))))))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/sam/.emacs&quot; nil t)  ; Reading at buffer position 228&#xA;  load-with-code-conversion(&quot;/home/sam/.emacs&quot; &quot;/home/sam/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I close Emacs and run &lt;code&gt;emacs --debug-init&lt;/code&gt; again, I get a slightly different error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (invalid-function (cons (assoc car alist)))&#xA;  (cons (assoc car alist))()&#xA;  cider-add-to-alist(cider-jack-in-dependencies &quot;org.clojure/tools.nrepl&quot; &quot;0.2.12&quot;)&#xA;  byte-code(&quot;\300\301\302\303#\210\304\301\305\306#\207&quot; [put cider-jack-in-dependencies risky-local-variable t cider-add-to-alist &quot;org.clojure/tools.nrepl&quot; &quot;0.2.12&quot;] 4)&#xA;  require(cider nil t)&#xA;  (not (require (quote cider) nil (quote t)))&#xA;  (if (not (require (quote cider) nil (quote t))) (ignore (message (format &quot;Cannot load %s&quot; (quote cider)))))&#xA;  (progn (progn (require (quote package)) (use-package-ensure-elpa (quote cider))) (if (not (require (quote cider) nil (quote t))) (ignore (message (format &quot;Cannot load %s&quot; (quote cider))))))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/sam/.emacs&quot; nil t)  ; Reading at buffer position 228&#xA;  load-with-code-conversion(&quot;/home/sam/.emacs&quot; &quot;/home/sam/.emacs&quot; t t)&#xA;  load(&quot;~/.emacs&quot; t t)&#xA;  #[0 &quot;\205\262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What exactly is causing this regression? Is it an error in the definition of &lt;a href=&quot;https://github.com/clojure-emacs/cider/blob/adab93a7a2b00e03b75aa6086b0457a2e94cc85e/cider-util.el#L338-L350&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;cider-add-to-alist&lt;/code&gt;&lt;/a&gt;, or in one of that function's usages (with &lt;a href=&quot;https://github.com/clojure-emacs/cider/blob/adab93a7a2b00e03b75aa6086b0457a2e94cc85e/cider.el#L256-L257&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;cider-jack-in-dependencies&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://github.com/clojure-emacs/cider/blob/adab93a7a2b00e03b75aa6086b0457a2e94cc85e/cider.el#L264-L265&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;cider-jack-in-dependencies-exclusions&lt;/code&gt;&lt;/a&gt;, or &lt;a href=&quot;https://github.com/clojure-emacs/cider/blob/adab93a7a2b00e03b75aa6086b0457a2e94cc85e/cider.el#L287-L288&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;cider-jack-in-lein-plugins&lt;/code&gt;&lt;/a&gt;)? Or is it an error in &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;? Is there any workaround for this error that will allow me to continue using &lt;a href=&quot;https://github.com/samestep/env/blob/a1aad46642d1f0164d907e875978195a4ea224ca/init.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;all my packages&lt;/a&gt; until it gets fixed?&lt;/p&gt;&#xA;" OwnerUserId="8900" LastActivityDate="2016-11-23T13:23:43.100" Title="Why do the latest versions of use-package and CIDER break each other?" Tags="|use-package|cider|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28817" PostTypeId="1" CreationDate="2016-11-21T22:42:58.537" Score="2" ViewCount="734" Body="&lt;p&gt;I recently upgraded to emacs 25.1.1 and noticed my org setup wasn't working as usual. in my &lt;code&gt;init.el&lt;/code&gt; I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-directory &quot;~/Dropbox (Personal)/org&quot;)&#xA;(setq org-archive-location &quot;~/Dropbox (Personal)/org/archive/%s_archive::&quot;)&#xA;(setq org-agenda-files (list &quot;~/Dropbox (Personal)/org/journal&quot;&#xA;                             &quot;~/Dropbox (Personal)/org&quot;&#xA;                             &quot;~/Dropbox (Personal)/org/gmail-inbox.org.txt&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I view the agenda I'm not seeing any records from &lt;code&gt;/org/journal&lt;/code&gt; being pulled in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do &lt;code&gt;M-x describe-variable RET org-agenda-files&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-agenda-files is a variable defined in ‘org.el’.&#xA;Its value is&#xA;(&quot;/Users/kevzettler/Dropbox (Personal)/org/personal.org&quot; &quot;/Users/kevzettler/Dropbox (Personal)/org/plebland.org&quot; &quot;/Users/kevzettler/Dropbox (Personal)/org/tilt.org&quot;)&#xA;&#xA;Original value was nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which looks like its only setting it to the what's available in &lt;code&gt;&quot;~/Dropbox (Personal)/org&quot;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12732" LastActivityDate="2024-03-21T12:04:15.623" Title="org-agenda-files not setting after update?" Tags="|org-mode|init-file|org-agenda|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28818" PostTypeId="1" CreationDate="2016-11-21T22:48:45.473" Score="0" ViewCount="166" Body="&lt;p&gt;With the org-evil package, normal state &lt;code&gt;&amp;gt;&lt;/code&gt; on a headline executes&#xA;&lt;code&gt;org-evil-demote&lt;/code&gt;, but on normal text it executes &lt;code&gt;evil-shift-right&lt;/code&gt;.  Two&#xA;questions:  (1) How does this work?  (2) It would be nice (and probably more&#xA;appropriate?) if a similar behaviour were bestowed on insert state &lt;code&gt;C-t&lt;/code&gt;, and&#xA;correspondingly on &lt;code&gt;C-d&lt;/code&gt; (&lt;code&gt;H-t&lt;/code&gt; and &lt;code&gt;H-d&lt;/code&gt; in my configuration), such that&#xA;&lt;code&gt;evil-shift-right-line&lt;/code&gt; and &lt;code&gt;...-left-...&lt;/code&gt; would demote and promote headlines&#xA;when point is on headlines.  How might one achieve that?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2017-01-21T20:41:03.983" Title="Shifting org headlines in evil insert state" Tags="|org-mode|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28819" PostTypeId="1" AcceptedAnswerId="28828" CreationDate="2016-11-22T00:29:03.000" Score="5" ViewCount="1500" Body="&lt;p&gt;when I execute a command on eshell the prompt switches to the bottom of the window. I have to &lt;code&gt;C-l&lt;/code&gt; a few times to get it back on top. Once again after I execute anything it goes back to the bottom of the window. It is infuriating. How do I make sure the eshell prompt stays on 'top' of the window at all times with the previous commands being hidden above the window. I don't know if 'window' is correct terminology. Please correct me if not.&lt;/p&gt;&#xA;" OwnerUserId="13976" LastActivityDate="2020-11-12T09:35:04.060" Title="eshell goes to the bottom of the page after executing a command" Tags="|eshell|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28820" PostTypeId="1" AcceptedAnswerId="28963" CreationDate="2016-11-22T01:07:46.870" Score="6" ViewCount="830" Body="&lt;p&gt;With &lt;code&gt;C-c C-x C-i&lt;/code&gt; and &lt;code&gt;C-c C-x C-o&lt;/code&gt; we can get measurements on how much time we spend on tasks: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:LOGBOOK:&#xA;CLOCK: [2016-11-21 Mon 22:50]--[2016-11-21 Mon 22:57] =&amp;gt;  0:07&#xA;CLOCK: [2016-11-21 Mon 22:30]--[2016-11-21 Mon 22:30] =&amp;gt;  0:00&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the smallest unit is a minute. How can we get measurements in seconds?&lt;/p&gt;&#xA;" OwnerUserId="12585" LastActivityDate="2020-07-06T15:10:43.833" Title="how to get seconds on org-clock measurements?" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28821" PostTypeId="2" ParentId="28819" CreationDate="2016-11-22T02:32:26.127" Score="3" Body="&lt;p&gt;You might check whether &lt;code&gt;eshell-scroll-to-bottom-on-output&lt;/code&gt; is set to &lt;code&gt;nil&lt;/code&gt;. Here's the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Controls whether interpreter output causes window to scroll.&#xA;  If nil, then do not scroll.  If t or ‘all’, scroll all windows showing&#xA;  buffer.  If ‘this’, scroll only the selected window.  If ‘others’,&#xA;  scroll only those that are not the selected window.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2016-11-22T02:32:26.127" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28822" PostTypeId="2" ParentId="28818" CreationDate="2016-11-22T02:42:21.987" Score="1" Body="&lt;p&gt;To get what you want you have to either remap the keys in your &lt;code&gt;init&lt;/code&gt; file or modify evil-org. You probably will want to do the former. And I think &lt;code&gt;org-metaleft&lt;/code&gt; and &lt;code&gt;org-metaright&lt;/code&gt; will do what you want (i.e. either promote or demote header or list item). You just need to set the keys for insert mode. So something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-key 'insert 'org-mode-map&#xA;  &quot;C-t&quot; 'org-metaleft&#xA;  &quot;C-d&quot; 'org-metaright)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should do the trick. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastEditorUserId="11934" LastEditDate="2016-11-22T20:03:21.590" LastActivityDate="2016-11-22T20:03:21.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28823" PostTypeId="2" ParentId="28814" CreationDate="2016-11-22T02:47:30.313" Score="0" Body="&lt;p&gt;You probably have to install it on your system. Here's the page: &lt;a href=&quot;https://lasr.cs.ucla.edu/geoff/ispell.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lasr.cs.ucla.edu/geoff/ispell.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're on OS X you can just install it with &lt;a href=&quot;http://brew.sh&quot; rel=&quot;nofollow noreferrer&quot;&gt;homebrew&lt;/a&gt;: &lt;code&gt;brew install ispell&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2016-11-22T02:47:30.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28824" PostTypeId="1" CreationDate="2016-11-22T03:02:27.593" Score="3" ViewCount="185" Body="&lt;p&gt;My problem is with two of my main use-cases for time-stamped items (essentially events). Consider these two org-mode items:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; * Clojure Dojo at uSwitch &amp;lt;2016-11-14 Mon 19:00&amp;gt;&#xA; * Trip to Jamaica &amp;lt;2016-12-14 Wed&amp;gt;-&amp;lt;2017-01-02 Mon&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For the first item, simple date+time stamped events appear in the agenda on the top in the time-scale view of the day.&lt;/p&gt;&#xA;&lt;p&gt;I use multi-day duration events for the purpose to remind me major contexts (like being abroad, on holiday, etc.), based on which I might have to adjust my priorities for those days.&lt;/p&gt;&#xA;&lt;p&gt;My question is, how can I sort the agenda items, so that all-day events (including multi-day duration) are on top of the agenda?&lt;/p&gt;&#xA;&lt;p&gt;Whether the all-day/multi-day items should appear above the daily time-scale, or below, is not important. Actually, I would look forward to look at both if possible.&lt;/p&gt;&#xA;&lt;p&gt;I was told to look into the &lt;code&gt;org-agenda-sorting-strategy&lt;/code&gt; option, and write a user defined function for it. I would like to ask for an example &lt;code&gt;elisp&lt;/code&gt; code to achieves the above.&lt;/p&gt;&#xA;&lt;p&gt;Might worth noting that I am mostly using day view agenda. Not sure how such changes could affect the yearly, monthly, or other agenda views...&lt;/p&gt;&#xA;" OwnerUserId="10440" LastEditorUserId="10440" LastEditDate="2020-08-15T19:00:45.603" LastActivityDate="2020-08-15T19:00:45.603" Title="order agenda so all-day and multi-day duration items appear on top" Tags="|org-mode|org-agenda|sorting|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28825" PostTypeId="1" CreationDate="2016-11-22T03:55:53.707" Score="3" ViewCount="3690" Body="&lt;p&gt;I want to run &lt;code&gt;tmux&lt;/code&gt; in emacs. I checked that it works in &lt;code&gt;term&lt;/code&gt;, but default colors are awfully hard to read:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/uadUE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uadUE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can they be changed to a sensible setting from &lt;code&gt;.emacs&lt;/code&gt; file?&lt;/p&gt;&#xA;" OwnerUserId="6848" LastActivityDate="2016-12-22T19:32:11.773" Title="How do you set colors for term?" Tags="|colors|term|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28826" PostTypeId="2" ParentId="28596" CreationDate="2016-11-22T04:34:54.727" Score="3" Body="&lt;p&gt;Not the best solution, but certainly a working one: Use &lt;code&gt;[dirtrack-mode]&lt;/code&gt;. The following preparations are needed:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;1. On the remote machine:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Make sure the prompt of the remote shell contains the path including the server login &lt;strong&gt;in TRAMP notation&lt;/strong&gt; (e.g. &lt;code&gt;/user@myserver.com:/home/user&lt;/code&gt;). You can achieve this by setting &lt;code&gt;PS1&lt;/code&gt; (e.g. in the .bashrc file on the remote server):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export PS1=&quot;[/\u@\h:\$PWD]$ &quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;2. In your local Emacs:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Run the following list expression (e.g. in the &lt;code&gt;.emacs&lt;/code&gt; file):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dirtrack-list (quote (&quot;^\\[\\(.*\\)\\]&quot; 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, after establishing a remote shell buffer, issue &lt;code&gt;M-x dirtrack-mode&lt;/code&gt; in that buffer and - voila! - the buffer directory should follow the shell directory properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution isn't perfect, because it is necessary to print out in the remote shell the whole &lt;strong&gt;absolute&lt;/strong&gt; path extended by the server login credentials. (Make sure the home directory gets expanded to the &lt;strong&gt;full&lt;/strong&gt; path!) However it does work reliably.&lt;/p&gt;&#xA;" OwnerUserId="9387" LastEditorUserId="9387" LastEditDate="2016-12-06T09:59:32.117" LastActivityDate="2016-12-06T09:59:32.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28827" PostTypeId="2" ParentId="26765" CreationDate="2016-11-22T04:48:21.413" Score="5" Body="&lt;p&gt;I struggled with this one for quite a while since I wanted the same thing. This is what I did:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/TheBB/spaceline#defining-a-segment&quot; rel=&quot;noreferrer&quot;&gt;Defining a segment&lt;/a&gt; is quite straight forward and the documentation is very good in that sense. But that's not enough to get it to show what you want. So, first define a segment that can show &lt;code&gt;Narrowed&lt;/code&gt; when you narrow into some defun, region or whatever:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spaceline-define-segment narrow&#xA;  &quot;Display Narrowed when buffer is narrowed.&quot;&#xA;  (when (buffer-narrowed-p)&#xA;    &quot;Narrowed&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation isn't quite clear about how you should insert this new segment into the whole thing. I dug around the code and found out that you can pass new segments when initiating the mode line. Since in my case I'm using &lt;code&gt;spaceline-spacemacs-theme&lt;/code&gt; it suffices to pass this new segment to that function call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spaceline-spacemacs-theme 'narrow)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that it will insert this new segment in the right part of the mode-line, next to the line numbers and columns in my case. If you want to reorder the items you'll have to create a new theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code provided here was enough for me, though.&lt;/p&gt;&#xA;" OwnerUserId="13735" LastActivityDate="2016-11-22T04:48:21.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28828" PostTypeId="2" ParentId="28819" CreationDate="2016-11-22T05:14:08.117" Score="3" Body="&lt;p&gt;You can disable the Eshell's scroll feature using:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'eshell-mode-hook&#xA;          (defun chunyang-eshell-mode-setup ()&#xA;            (remove-hook 'eshell-output-filter-functions&#xA;                         'eshell-postoutput-scroll-to-bottom)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notes, &lt;code&gt;(eval-after-load &quot;eshell&quot; (remove-hook ...))&lt;/code&gt; doesn't work correctly according to my experiment, it simply sets &lt;code&gt;eshell-output-filter-functions&lt;/code&gt; to nil, I don't know the cause. You can also use the Custom interface with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-option RET eshell-output-filter-functions RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this way works too and is much easier, since this option is available until Eshell has been invoked, if you can't find this option, type &lt;code&gt;M-x eshell&lt;/code&gt; then try again.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2016-11-22T07:09:37.410" LastActivityDate="2016-11-22T07:09:37.410" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28829" PostTypeId="1" CreationDate="2016-11-22T09:50:37.077" Score="0" ViewCount="373" Body="&lt;p&gt;I have a hard time with fonts. I downloaded the package &lt;code&gt;intlfonts-1.2.1&lt;/code&gt; from the FSF website, and after some &lt;code&gt;configure&lt;/code&gt;, &lt;code&gt;make&lt;/code&gt; and &lt;code&gt;install&lt;/code&gt; I get the following directory where all fonts are installed : &lt;code&gt;/usr/local/share/emacs/fonts/bdf&lt;/code&gt;.&#xA;So I added to my init.el the following line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'bdf-directory-list &quot;/usr/local/share/emacs/fonts/bdf&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I evaluated in a scratch buffer the function &lt;code&gt;font-family-list&lt;/code&gt; but it returns &lt;code&gt;nil&lt;/code&gt;.&#xA;What should I do then? I played around a bit with &lt;code&gt;set-frame-font&lt;/code&gt; but as long as &lt;code&gt;font-family-list&lt;/code&gt; is empty I suppose this is nonsense.&#xA;Thanks for your advice, the documentation I read so far did not help that much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 24.5 under Mac OSX.&lt;/p&gt;&#xA;" OwnerUserId="13074" LastActivityDate="2016-11-22T09:50:37.077" Title="font-family-list function still returning nil" Tags="|fonts|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28830" PostTypeId="2" ParentId="28801" CreationDate="2016-11-22T12:02:42.230" Score="2" Body="&lt;p&gt;Try using the &lt;code&gt;:step day&lt;/code&gt; option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+BEGIN: clocktable :step day :stepskip0 nil :link t :maxlevel 10 :block week :scope file&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the docs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:step day&lt;/code&gt; =&gt; to split the table into chunks by day. To use this, :block or :tstart, :tend are needed.&#xA;&lt;code&gt;:stepskip0 nil&lt;/code&gt; =&gt; explicitly keep empty days in the clocktable (this is the default, though)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further reading about clocktable options: &#xA;&lt;a href=&quot;http://orgmode.org/manual/The-clock-table.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/The-clock-table.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5448" LastActivityDate="2016-11-22T12:02:42.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28831" PostTypeId="2" ParentId="28811" CreationDate="2016-11-22T12:11:33.847" Score="1" Body="&lt;p&gt;A quick example would be this, which adds the &lt;code&gt;font-lock-warning-face&lt;/code&gt; to all regex matches in all modes that derive from prog-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'prog-mode-hook '(lambda ()&#xA;    (font-lock-add-keywords&#xA;        nil '((&quot;\\&amp;lt;\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):&quot; 1 font-lock-warning-face t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Further reading with examples in the emacs wiki:&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/AddKeywords&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/AddKeywords&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5448" LastEditorUserId="10578" LastEditDate="2016-11-22T15:39:43.823" LastActivityDate="2016-11-22T15:39:43.823" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28832" PostTypeId="2" ParentId="28825" CreationDate="2016-11-22T12:55:15.987" Score="4" Body="&lt;p&gt;Since in &lt;code&gt;zenburn&lt;/code&gt; theme terminal colors look good I added the following lines in my &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-faces&#xA;&#xA; '(term-color-black ((t (:foreground &quot;#3F3F3F&quot; :background &quot;#2B2B2B&quot;))))&#xA; '(term-color-red ((t (:foreground &quot;#AC7373&quot; :background &quot;#8C5353&quot;))))&#xA; '(term-color-green ((t (:foreground &quot;#7F9F7F&quot; :background &quot;#9FC59F&quot;))))&#xA; '(term-color-yellow ((t (:foreground &quot;#DFAF8F&quot; :background &quot;#9FC59F&quot;))))&#xA; '(term-color-blue ((t (:foreground &quot;#7CB8BB&quot; :background &quot;#4C7073&quot;))))&#xA; '(term-color-magenta ((t (:foreground &quot;#DC8CC3&quot; :background &quot;#CC9393&quot;))))&#xA; '(term-color-cyan ((t (:foreground &quot;#93E0E3&quot; :background &quot;#8CD0D3&quot;))))&#xA; '(term-color-white ((t (:foreground &quot;#DCDCCC&quot; :background &quot;#656555&quot;))))&#xA;&#xA; '(term-default-fg-color ((t (:inherit term-color-white))))&#xA; '(term-default-bg-color ((t (:inherit term-color-black))))&#xA;&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6848" LastEditorUserId="9995" LastEditDate="2016-11-22T16:05:09.433" LastActivityDate="2016-11-22T16:05:09.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28833" PostTypeId="1" CreationDate="2016-11-22T15:33:17.170" Score="3" ViewCount="465" Body="&lt;p&gt;When inserting the environment &lt;code&gt;equation&lt;/code&gt; (by &lt;code&gt;C-c C-e equation&lt;/code&gt;) in latex-mode, emacs shows a prompt to insert a label. It is desirable to have the same prompt for a theorem-style environment like &lt;code&gt;lem&lt;/code&gt; defined in the document. When I do &lt;code&gt;C-c C-e lem&lt;/code&gt;, the environment &lt;code&gt;lem&lt;/code&gt; is correctly inserted, but a prompt for setting the label does not appear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the procedure in order to have this prompt?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{amsmath,amsthm}&#xA;&#xA;\newtheorem{thm}{Theorem}&#xA;\newtheorem{lem}[thm]{Lemma}&#xA;\begin{document}&#xA;\begin{lem}&#xA;&#xA;\end{lem}&#xA;&#xA;\begin{equation}&#xA;  \label{eq:1}&#xA;&#xA;\end{equation}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-11-22T15:52:29.377" LastActivityDate="2016-11-23T09:19:35.113" Title="Prompt for inserting label when using theorem style environments in latex" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28834" PostTypeId="2" ParentId="28833" CreationDate="2016-11-22T15:53:51.370" Score="3" Body="&lt;p&gt;If you have an up-to-date version of AUCTeX, say from ELPA, you have 2 choices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) Set something like to this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;latex&quot;&#xA;  (add-hook 'LaTeX-mode-hook&#xA;    (lambda () (add-to-list 'LaTeX-label-alist '(&quot;lem&quot; . &quot;lem:&quot;))))&#xA;  (when (boundp 'reftex-label-alist)&#xA;    (add-to-list 'reftex-label-alist&#xA;                 '(&quot;lem&quot; ?m &quot;lem:&quot; &quot;~ref{%s}&quot; nil (&quot;Lemma&quot; &quot;lemma&quot;) nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2.) Set the information on a per-file basis in the local variables of your .tex file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%% Local Variables:&#xA;%%% mode: latex&#xA;%%% TeX-master: t&#xA;%%% eval: (add-to-list 'LaTeX-label-alist '(&quot;lem&quot; . &quot;lem:&quot;))&#xA;%%% eval: (add-to-list 'reftex-label-alist '(&quot;lem&quot; ?m &quot;lem:&quot; &quot;~ref{%s}&quot; nil (&quot;Lemma&quot; &quot;lemma&quot;) nil))&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You need the second &lt;code&gt;eval&lt;/code&gt; only when you're using RefTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then open your .tex file, hit &lt;kbd&gt;C-c C-n&lt;/kbd&gt; so that AUCTeX parses your &lt;code&gt;lem&lt;/code&gt; environment and you should be set.&lt;/p&gt;&#xA;" OwnerUserId="12242" LastEditorUserId="12242" LastEditDate="2016-11-23T09:19:35.113" LastActivityDate="2016-11-23T09:19:35.113" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28835" PostTypeId="1" CreationDate="2016-11-22T15:57:17.163" Score="5" ViewCount="7142" Body="&lt;p&gt;I'm doing a new setup so that I can have an init.el on my dropbox as a one stop shop for my configuration. So far so good but I'm stuck on the theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I setup the code using load-path it all works like it should, all the colors and the modeline. My question is how can I do the same but using the use-package approach?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'custom-theme-load-path &quot;~/.emacs.d/themes/&quot;)&#xA;&#xA;(setq molokai-theme-kit t)&#xA;(load-theme 'molokai t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is something like this possible?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package molokai-theme &#xA;  :ensure t&#xA;  :init&#xA;  (setq molokai-theme-kit t)&#xA;  (load-theme 'molokai t)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14058" LastEditorUserId="105" LastEditDate="2017-02-07T18:56:27.913" LastActivityDate="2017-02-07T18:56:27.913" Title="Setting up a theme using use-package" Tags="|themes|use-package|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28836" PostTypeId="2" ParentId="28835" CreationDate="2016-11-22T16:14:15.933" Score="0" Body="&lt;p&gt;Try a &lt;code&gt;:defer t&lt;/code&gt; in the use-package declaration too.&lt;/p&gt;&#xA;" OwnerUserId="9181" LastActivityDate="2016-11-22T16:14:15.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28837" PostTypeId="1" AcceptedAnswerId="28839" CreationDate="2016-11-22T16:24:02.637" Score="0" ViewCount="138" Body="&lt;p&gt;I have a list that looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1.530 2.895&#xA;4.362 50.14&#xA;3.14  2.7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I want it to look like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1.530&#xA;2.895&#xA;4.362&#xA;50.14&#xA;3.14&#xA;2.7 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I suspect there is a clever way to use a rectangle to do this but I cannot figure it out.&lt;/p&gt;&#xA;" OwnerUserId="10702" LastActivityDate="2016-11-22T16:49:40.220" Title="Inserting line break into a rectangle" Tags="|terminal-emacs|rectangle|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28838" PostTypeId="2" ParentId="28835" CreationDate="2016-11-22T16:34:12.030" Score="5" Body="&lt;p&gt;My &lt;strong&gt;user-emacs-directory&lt;/strong&gt; points to a folder on my Dropbox.&#xA;Apparently &lt;strong&gt;use-package :load-path&lt;/strong&gt; points to the &lt;strong&gt;user-emacs-directory&lt;/strong&gt; by default, I just had to put &quot;themes&quot; and the necessary files inside it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's now working like a charm.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package molokai-theme &#xA;  :ensure t&#xA;  :load-path &quot;themes&quot;&#xA;  :init&#xA;  (setq molokai-theme-kit t)&#xA;  :config&#xA;  (load-theme 'molokai t)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14058" LastActivityDate="2016-11-22T16:34:12.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28839" PostTypeId="2" ParentId="28837" CreationDate="2016-11-22T16:49:40.220" Score="2" Body="&lt;p&gt;You don't need a rectangle for this job.&#xA;Just use &lt;code&gt;(query-replace-regexp &quot;[ ]+&quot; &quot;\n&quot;)&lt;/code&gt; to replace the separating spaces by linebreaks.&#xA;The corresponding key-sequence is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-M-%&lt;/kbd&gt; &lt;code&gt;[ ]+&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;C-q&lt;/kbd&gt; &lt;kbd&gt;C-j&lt;/kbd&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meaning:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-M-%&lt;/kbd&gt;  &lt;code&gt;query-replace-regexp&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[ ]+&lt;/code&gt; the regular expression for the strings to be replaced (one or more spaces)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-q&lt;/kbd&gt; next character is inserted literally (&lt;code&gt;quoted-insert&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-j&lt;/kbd&gt; newline as the only character of the replacement string&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2016-11-22T16:49:40.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28840" PostTypeId="1" CreationDate="2016-11-22T17:06:22.267" Score="12" ViewCount="4872" Body="&lt;p&gt;I believe, there are three ways to build emacs on osx --- x11, ns (nextstep?), and cocoa. Can anyone explain what the build options mean / the difference between these three are?&lt;/p&gt;&#xA;" OwnerDisplayName="user12502" LastEditorUserId="253" LastEditDate="2016-11-22T19:09:41.710" LastActivityDate="2016-11-23T15:18:52.530" Title="OS X emacs: difference between X11 vs NS vs Cocoa?" Tags="|osx|build|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28842" PostTypeId="1" AcceptedAnswerId="28843" CreationDate="2016-11-22T19:45:47.807" Score="3" ViewCount="293" Body="&lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda () (message &quot;%s&quot; x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like &lt;code&gt;x&lt;/code&gt; to be evaluated -- the lambda function should always use that value, instead of the current value of &lt;code&gt;x&lt;/code&gt;. How should I do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preferably lexical-binding is not required.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="105" LastEditDate="2022-09-18T17:28:22.900" LastActivityDate="2022-09-18T17:28:22.900" Title="How to evaluate a symbol in a lambda function when defining it?" Tags="|elisp|backquote|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28843" PostTypeId="2" ParentId="28842" CreationDate="2016-11-22T20:02:08.080" Score="5" Body="&lt;p&gt;If you don't want to use lexical binding then you will need to use a sexp that &lt;em&gt;evaluates&lt;/em&gt; to a lambda form (a list) where &lt;code&gt;x&lt;/code&gt; has been replaced by the value you want (e.g., the value that &lt;code&gt;x&lt;/code&gt; has at the time the list is created).  Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(lambda () (message &quot;%s&quot; ,x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-22T20:02:08.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28844" PostTypeId="2" ParentId="28781" CreationDate="2016-11-22T21:18:51.087" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://pandoc.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pandoc&lt;/a&gt; supports inclusion of images via the &lt;code&gt;--self-contained&lt;/code&gt; option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pandoc -o outfile.html --standalone --self-contained --to html5 your-file.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will generate a single file and include all images as base64-encoded data-URLs.&lt;/p&gt;&#xA;" OwnerUserId="8987" LastActivityDate="2016-11-22T21:18:51.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28845" PostTypeId="1" AcceptedAnswerId="28848" CreationDate="2016-11-22T23:02:13.420" Score="2" ViewCount="305" Body="&lt;p&gt;How can I redefine evil normal state &lt;code&gt;Y&lt;/code&gt; to be equivalent to &lt;code&gt;y$&lt;/code&gt; instead of &lt;code&gt;yy&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2016-11-23T00:11:29.377" Title="Mapping evil normal state Y to y$" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28847" PostTypeId="1" CreationDate="2016-11-22T23:17:50.060" Score="0" ViewCount="46" Body="&lt;p&gt;I use a double spaces after full stops to seperate sentences, and&#xA;this is respected by &lt;code&gt;M-q&lt;/code&gt;.  But with an org footnote mark after&#xA;the full stop, the sentence limit is not recognized, and the space&#xA;is reduced to a single after &lt;code&gt;M-q&lt;/code&gt;.[1] Can I make emacs ignore the&#xA;footnote mark?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Footnotes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;[1] ...&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2016-11-22T23:17:50.060" Title="Org footnote mark prevents end of sentence from being recognized" Tags="|org-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28848" PostTypeId="2" ParentId="28845" CreationDate="2016-11-23T00:11:29.377" Score="5" Body="&lt;p&gt;You can customize the variable &lt;code&gt;evil-want-Y-yank-to-eol&lt;/code&gt; to a non-nil value to get this behavior.&lt;/p&gt;&#xA;" OwnerUserId="14017" LastActivityDate="2016-11-23T00:11:29.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28849" PostTypeId="1" AcceptedAnswerId="28897" CreationDate="2016-11-23T00:15:41.263" Score="1" ViewCount="3685" Body="&lt;p&gt;I started using the graphical interface for emacs again after a bit.&#xA;and I've run into some problems. On boot the theme I'm using Calmer-forest is not getting loaded. However the rest of my .emacs file is getting loaded just fine. (For example I have it set to automatically go maximized on boot, and that is working fine. Along with my repositories.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I checked the Messages buffer I got this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Failed to enable theme: calmer-forest&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also if I go to my .emacs file, and I M-x eval-buffer the theme loads just fine and dandy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already checked &lt;a href=&quot;https://emacs.stackexchange.com/questions/2797/emacs-wont-load-theme-on-startup&quot;&gt;this&lt;/a&gt; question, and I tried the adjustments listed in the answers. And they did not fix the problem, on boot my emacs frame was still in the white stock theme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if any additional details are needed.&#xA;I would like to make note, that this is not a huge problem but more of an annoyance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally I'll attach my .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Initialize preferences &#xA;(tool-bar-mode -1)&#xA;(add-to-list 'default-frame-alist '(fullscreen . maximized))&#xA;(setq inhibit-startup-message t)&#xA;&#xA;; Package repositories&#xA;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))&#xA;(add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;; Custom Packages &#xA;(add-to-list 'custom-theme-load-path &quot;~/.emacs.d/themes&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/lisp&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/lisp/ESS/lisp/&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/lisp/python-django/&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/emms/lisp/&quot;)&#xA;(require 'ess-site)&#xA;(require 'python-django)&#xA;(require 'emms-setup)&#xA;(emms-standard)&#xA;(emms-default-players)&#xA;;; Set your lisp system and, optionally, some contribs&#xA;                    ;Custom Variables&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(custom-enabled-themes (quote (calmer-forest)))&#xA; '(custom-safe-themes&#xA;   (quote&#xA;    (&quot;7997e0765add4bfcdecb5ac3ee7f64bbb03018fb1ac5597c64ccca8c88b1262f&quot; default)))&#xA; '(org-babel-load-languages&#xA;   (quote&#xA;    ((emacs-lisp . t)&#xA;     (R . t)&#xA;     (lisp . t)&#xA;     (ditaa . t)&#xA;     (python . t)&#xA;     (css . t)&#xA;     (sh . t)&#xA;     (ruby . t)&#xA;     (js . t))))&#xA; '(org-babel-python-command &quot;python3&quot;))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&#xA;(setq tramp-default-method &quot;ssh&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11045" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-11-25T10:51:29.317" Title="Theme not loading on startup" Tags="|init-file|themes|customization|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28850" PostTypeId="2" ParentId="28816" CreationDate="2016-11-23T00:44:04.813" Score="5" Body="&lt;p&gt;Commit &lt;a href=&quot;https://github.com/clojure-emacs/cider/commit/70971d0a918053d86e76e4ff8248b25a8646940e&quot; rel=&quot;nofollow noreferrer&quot;&gt;70971d0a918053d86e76e4ff8248b25a8646940e&lt;/a&gt; removed support for emacs 24.3 and below. This removed a file called cider-compat.el and replaced it with an emacs core file subr-x.el Supposedly this allowed the &lt;code&gt;if-let&lt;/code&gt; macro to be from subr-x.el, with the thinking being that this file stayed the same from 24.4+ to 25+. It seems like the &lt;code&gt;if-let&lt;/code&gt; macros did not make it into the emacs branch for 24.x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So long story short, the &lt;code&gt;if-let&lt;/code&gt; macro is undefined. Some people aren't running into this issue as some other projects define &lt;code&gt;if-let&lt;/code&gt;. Some have old .elc files laying around which might be swept up in how emacs reads in files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the quick fix is to install CIDER (edited used to be emacs) from melpa-stable. Another fix is to upgrade emacs. Another fix is for you to run your own copy of cider locally but without the offending commit. And finally, if you can get this function into your personal emacs directory and it loads before cider, you should be good.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro if-let (bindings then &amp;amp;rest else)&#xA;  &quot;Process BINDINGS and if all values are non-nil eval THEN, else ELSE.&#xA;Argument BINDINGS is a list of tuples whose car is a symbol to be&#xA;bound and (optionally) used in THEN, and its cadr is a sexp to be&#xA;evalled to set symbol's value.  In the special case you only want&#xA;to bind a single value, BINDINGS can just be a plain tuple.&quot;&#xA;  (declare (indent 2)&#xA;           (debug ([&amp;amp;or (&amp;amp;rest (symbolp form)) (symbolp form)] form body)))&#xA;  (when (and (&amp;lt;= (length bindings) 2)&#xA;             (not (listp (car bindings))))&#xA;    ;; Adjust the single binding case&#xA;    (setq bindings (list bindings)))&#xA;  `(let* ,(internal--build-bindings bindings)&#xA;     (if ,(car (internal--listify (car (last bindings))))&#xA;         ,then&#xA;       ,@else)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that the above is my copy of &lt;code&gt;if-let&lt;/code&gt; from emacs. I did not write this code and I hope that the sharing of this code in this venue is fine. I'm happy to take it down if anyone thinks that it is out of place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find an issue tracking all of this at &lt;a href=&quot;https://github.com/clojure-emacs/cider/issues/1882&quot; rel=&quot;nofollow noreferrer&quot;&gt;cider issue 1882&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to run emacs locally you can use this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; load local version of cider&#xA;(add-to-list 'load-path &quot;~/projects/cider&quot;)&#xA;(load &quot;cider&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then run &lt;code&gt;git checkout 3be082ae4a3d0b40d360648b20fb7caa14c0a9fc&lt;/code&gt; to get the commit right before it borked.&lt;/p&gt;&#xA;" OwnerUserId="14062" LastEditorUserId="14062" LastEditDate="2016-11-23T13:23:43.100" LastActivityDate="2016-11-23T13:23:43.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28851" PostTypeId="1" AcceptedAnswerId="28864" CreationDate="2016-11-23T01:29:15.707" Score="4" ViewCount="1872" Body="&lt;p&gt;I saw that bracketed paste mode is automatically enabled in Emacs 25.1 running in a terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I want to disable this mode. Because this mode adds text like &lt;code&gt;200~ 201~&lt;/code&gt; to pasted text, bracketed paste mode annoys me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have googled But there is no information about disabling bracketed paste mode in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My development environment is macOS Sierra, and Emacs 25.1.&#xA;How can I turn off bracketed paste mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I frequently copy text from web browser, then paste it into Emacs running in terminal. But something text is added for copied text, e.g. &lt;code&gt;200~hello, world201~&lt;/code&gt;.&#xA;So these annoying characters reduce my productivity because I have to delete them after pasting text. I want to remove these characters.&lt;/p&gt;&#xA;" OwnerUserId="14064" LastEditorUserId="25" LastEditDate="2016-11-23T21:46:46.377" LastActivityDate="2018-10-05T17:03:44.413" Title="How to turn off bracketed paste mode?" Tags="|terminal-emacs|copy-paste|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28852" PostTypeId="2" ParentId="28849" CreationDate="2016-11-23T06:20:23.493" Score="1" Body="&lt;p&gt;Alright, so upon trying again.&#xA;It seemed to be that I was missing this at the bottom of my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(package-initialize)&#xA;(load-theme 'what-ever-theme t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was part of &lt;a href=&quot;https://emacs.stackexchange.com/a/15297/11045&quot;&gt;this&lt;/a&gt; answer, but I'm not sure as to why my theme didn't load properly after working fine for so long. And I'll look into it further.&lt;/p&gt;&#xA;" OwnerUserId="11045" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-11-23T06:20:23.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28854" PostTypeId="1" CreationDate="2016-11-23T08:02:31.990" Score="4" ViewCount="433" Body="&lt;p&gt;I usually debug in console &lt;code&gt;gdb&lt;/code&gt; and now I'm trying to move to Emacs. In my &lt;code&gt;~/.gdbinit&lt;/code&gt; I have the following lines setting up history:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# save history of unlimited size, write always to ~/.gdb_history&#xA;set history save on&#xA;set history size unlimited&#xA;set history filename ~/.gdb_history&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in console &lt;code&gt;gdb&lt;/code&gt; history works perfectly. &lt;code&gt;show history&lt;/code&gt; result there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gdb) show history&#xA;+show history&#xA;expansion:  History expansion on command input is off.&#xA;filename:  The filename in which to record the command history is &quot;/home/ars/.&#xA;gdb_history&quot;.&#xA;save:  Saving of the history record on exit is on.&#xA;size:  The size of the command history is 10000000.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you wonder, history size is 10000000 instead of &lt;code&gt;unlimited&lt;/code&gt; because I have $HISTSIZE=10000000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Emacs, I successfully search for old commands from &lt;code&gt;~/.gdb_history&lt;/code&gt; with &lt;code&gt;comint-history-isearch-backward-regexp&lt;/code&gt;. However, the problem is that commands entered while debugging from Emacs are not appended to &lt;code&gt;~/.gdb_history&lt;/code&gt;. I can still search through them in the current session, i.e. they are saved somewhere in memory, but they will not be written to the file and as a consequence I don't see them in the following sessions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While GDB starts inside Emacs, I see that the config is read:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;+set history save on&#xA;+set history size unlimited&#xA;+set history filename ~/.gdb_history&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And &lt;code&gt;show history&lt;/code&gt; output there is exactly the same like in console GDB:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;show history&#xA;+show history &#xA;expansion:  History expansion on command input is off.&#xA;filename:  The filename in which to record the command history is &quot;/home/ars/.gdb_history&quot;.&#xA;save:  Saving of the history record on exit is on.&#xA;size:  The size of the command history is 10000000.&#xA;(gdb) +info break&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I start &lt;code&gt;gdb&lt;/code&gt; with command like &lt;code&gt;(gdb &quot;gdb -i=mi $PROGTODEBUG&quot;)&lt;/code&gt; and finish debugging with &lt;code&gt;quit&lt;/code&gt;, typed manually or via &lt;code&gt;C-d&lt;/code&gt;. Then I kill the buffer with &lt;code&gt;kill-this-buffer&lt;/code&gt; and exit Emacs. GNU Emacs version is 25.1.&lt;/p&gt;&#xA;" OwnerUserId="12293" LastEditorUserId="12293" LastEditDate="2016-11-24T08:21:44.810" LastActivityDate="2022-04-10T21:00:35.073" Title="Command history not saved while using GDB from Emacs" Tags="|gdb|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28855" PostTypeId="2" ParentId="28790" CreationDate="2016-11-23T08:05:18.767" Score="2" Body="&lt;p&gt;The following works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; C-s in a buffer: open helm-swoop with empty search field&#xA;(global-set-key (kbd &quot;C-s&quot;) 'helm-swoop)&#xA;(with-eval-after-load 'helm-swoop&#xA;    (setq helm-swoop-pre-input-function&#xA;        (lambda () nil)))&#xA;&#xA;;; C-s in helm-swoop with empty search field: activate previous search.&#xA;;; C-s in helm-swoop with non-empty search field: go to next match.&#xA;(with-eval-after-load 'helm-swoop&#xA;    (define-key helm-swoop-map (kbd &quot;C-s&quot;) 'tl/helm-swoop-C-s))&#xA;&#xA;(defun tl/helm-swoop-C-s ()&#xA;    (interactive)&#xA;    (if (boundp 'helm-swoop-pattern)&#xA;            (if (equal helm-swoop-pattern &quot;&quot;)&#xA;                    (previous-history-element 1)&#xA;                (helm-next-line))&#xA;    (helm-next-line)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12336" LastActivityDate="2016-11-23T08:05:18.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28856" PostTypeId="2" ParentId="28840" CreationDate="2016-11-23T09:16:18.373" Score="16" Body="&lt;p&gt;There are a number of Emacs versions for macOS, including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The official Emacs on macOS is build using the &quot;NS&quot; port, also known as the &quot;cocoa&quot; port. As the name suggests, this port of Emacs originates in Emacs for the NextSTEP operating system and has been the official Emacs GUI on macOS since Emacs 23.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Mitsuharu Yamamoto-san maintains the &quot;Mac port&quot; of Emacs. It provides an alternative GUI with a different feature set compared to the NS port. This originates from the Emacs port to Mac OS 8/9 and the &quot;Carbon&quot; port of Emacs 22. (This port is also referred to as the &quot;railway cat&quot; Emacs, as this is where the &lt;code&gt;brew&lt;/code&gt; recipe is hosted.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Aquamacs is based on the NS port of Emacs and contains a number of enhancements making it behave more like traditional macOS applications.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;X11: It is possible to build Emacs with the same GUI as used on X11 system, however it requires a X11 server to run. Unfortunately, the end result will not have macOS look and feel -- things like menus looks as though you were running on a unix-like system. In fact, this is not one GUI but a family of GUI:s as it's possible to build using different X11 support libraries like GTK+.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Terminal only. This gives you an Emacs that only can run in a terminal window, much like a GUI Emacs behaves when passed the &lt;code&gt;-nw&lt;/code&gt; option.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, which should you pick?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are lazy, pick the official Emacs -- you can download a prebuilt version from &lt;a href=&quot;https://emacsformacos.com&quot; rel=&quot;noreferrer&quot;&gt;https://emacsformacos.com&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to spend some time on getting the best Emacs for you, try both the official Emacs and the &quot;mac&quot; port. Overall, they are fairly similar but provides a slightly different feature set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, I would not recommend using the X11 port as you wont get macOS look and feel, however in some situations it might be of interest:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You want a feature only available in the X11 port, like support for &lt;code&gt;xwidget&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;You are accustomed to X11 and want the exact same look and feel when using Emacs on macOS&lt;/li&gt;&#xA;&lt;li&gt;You want a &quot;reference&quot; implementation of Emacs, e.g. when contributing to the NS port of Emacs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2016-11-23T15:18:52.530" LastActivityDate="2016-11-23T15:18:52.530" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28857" PostTypeId="1" CreationDate="2016-11-23T10:04:41.113" Score="3" ViewCount="8003" Body="&lt;p&gt;I use an auto complete tool in emacs, which can complete brackets. But I want to find out that how it determines whether it should complete the bracket. For example, assuming &lt;code&gt;|&lt;/code&gt; stands for the point. In the case of &lt;code&gt;|  abc&lt;/code&gt;, when typing &lt;code&gt;(&lt;/code&gt;, it will auto complete to &lt;code&gt;(|)  abc&lt;/code&gt;. In another case of &lt;code&gt;|abc&lt;/code&gt; , when typing &lt;code&gt;(&lt;/code&gt;, it will not auto complete just like what sublime does.&lt;/p&gt;&#xA;" OwnerUserId="14071" LastEditorUserId="2755" LastEditDate="2017-04-15T13:18:50.697" LastActivityDate="2017-04-15T13:18:50.697" Title="How to complete brackets automatically?" Tags="|balanced-parentheses|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28858" PostTypeId="2" ParentId="28857" CreationDate="2016-11-23T10:26:39.877" Score="3" Body="&lt;p&gt;Add this line to your emacs init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq electric-pair-preserve-balance nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;https://stackoverflow.com/questions/27142996/electric-pair-mode-dont-pair-if-cursor-precedes-a-non-whitespace-character&quot;&gt;https://stackoverflow.com/questions/27142996/electric-pair-mode-dont-pair-if-cursor-precedes-a-non-whitespace-character&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-11-23T10:26:39.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28859" PostTypeId="2" ParentId="28799" CreationDate="2016-11-23T10:46:06.430" Score="0" Body="&lt;p&gt;Thanks to Tobias and this &lt;a href=&quot;https://stackoverflow.com/a/2473152/5883049&quot;&gt;answer&lt;/a&gt; I was able to find a solution.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (eq window-system 'x)&#xA;  (unless (file-exists-p &quot;/usr/bin/xmodmap&quot;)&#xA;    (call-process-shell-command (concat &quot;echo &quot; (shell-quote-argument (read-passwd &quot;Password: &quot;))&#xA;                                        &quot; | sudo -S apt-get install xmodmap&quot;)))&#xA;  (shell-command &quot;xmodmap -e 'clear Lock' -e 'keycode 66 = F13'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;call-process-shell-command&lt;/code&gt; executes aptitude synchronously in a separate process.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-11-23T11:06:31.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28860" PostTypeId="1" CreationDate="2016-11-23T12:51:00.403" Score="1" ViewCount="115" Body="&lt;p&gt;According to the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Display.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt;, emacs&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;displays U+00AD (soft hyphen), U+2010 (hyphen), and U+2011 (non-breaking hyphen) with the escape-glyph face.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which is fine to distinguish them from the ASCII hyphen/dash/minus character, but I'd like to be able to distinguish these three funny hyphens from each other, too.&lt;/p&gt;&#xA;" OwnerUserId="13045" LastActivityDate="2016-11-23T15:08:10.993" Title="Distinguish various hyphens: U+00AD and U+2011" Tags="|highlight-chars|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28861" PostTypeId="2" ParentId="28857" CreationDate="2016-11-23T14:41:53.603" Score="1" Body="&lt;p&gt;A possible way to do that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun jp/insert-parentheses ()&#xA;&quot;Insert a pair of parenthesis if next char is space or newline, or end of buffer&quot;&#xA;  (interactive)&#xA;  (let ((c (char-after (point))))&#xA;    (cond&#xA;     ((or (not c) (= c 32) (= c 10)) (insert &quot;()&quot;))&#xA;     (t (insert &quot;(&quot;)))))&#xA;&#xA;&#xA;(global-set-key &quot;(&quot; #'jp/insert-parentheses)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where 32 is the code for a space character and 10 for newline.  The &lt;code&gt;not&lt;/code&gt; thing is for when point is at end of buffer (&lt;code&gt;char-after&lt;/code&gt; will return &lt;code&gt;nil&lt;/code&gt;, and we want to allow insertion of a pair of parenthesis in this case).&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-11-23T14:41:53.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28863" PostTypeId="2" ParentId="28860" CreationDate="2016-11-23T15:08:10.993" Score="1" Body="&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/highlight-chars.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; you can highlight any characters any way you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Out of the box, you have command &lt;strong&gt;&lt;code&gt;toggle-highlight-hard-hyphens&lt;/code&gt;&lt;/strong&gt;, as well as functions &lt;code&gt;hc-highlight-hard-hyphens&lt;/code&gt; and &lt;code&gt;hc-dont-highlight-hard-hyphens&lt;/code&gt;, all of which control just hard-hyphen (U+2011) highlighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than that, you have general commands and functions to highlight groups of characters.  The most general of these are commands &lt;strong&gt;&lt;code&gt;hc-highlight-chars&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;hc-toggle-highlight-other-chars&lt;/code&gt;&lt;/strong&gt;.   For &lt;code&gt;hc-toggle-highlight-other-chars&lt;/code&gt;, you can also specify characters that are to be &lt;em&gt;excluded&lt;/em&gt; from&#xA;highlighting.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;hc-highlight-chars&lt;/strong&gt; is an interactive compiled Lisp function in&#xA;   &lt;a href=&quot;https://www.emacswiki.org/emacs/download/highlight-chars.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;highlight-chars.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(hc-highlight-chars CHARS FACE &amp;amp;optional OFFP MSGP)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Read a string of characters and a face name, then highlight the chars.&#xA;   With a prefix arg, unhighlight the chars.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;As an alternative to a string of characters, what you enter for the&#xA;   characters can be any of the possibilities for a single entry in&#xA;   &lt;code&gt;hc-other-chars&lt;/code&gt;.  That is, it can be any of the following:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;A cons (C1 . C2), where C1 and C2 are characters, that is, integers,&#xA;  which you can represent using character notation.  This represents&#xA;  the range of characters from C1 through C2.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example, you would enter &lt;code&gt;(?a . ?g)&lt;/code&gt; to mean the characters from&#xA;  &lt;code&gt;a&lt;/code&gt; through &lt;code&gt;g&lt;/code&gt;, inclusive.  Note that you enter the parentheses and&#xA;  the dot, and you can use character read syntax (e.g., &lt;code&gt;?a&lt;/code&gt; for &lt;code&gt;a&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;A character class, such as &lt;code&gt;[:digit:]&lt;/code&gt;.  This matches all characters&#xA;  in the class.  You must type the brackets and colons (&lt;code&gt;:&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;A character set, such as &lt;code&gt;iso-8859-1&lt;/code&gt; or &lt;code&gt;lao&lt;/code&gt;.  This matches all&#xA;  characters in the set.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;If you mistype one of the above representations, then what you type is&#xA;   interpreted as just a string of the characters to highlight.  For&#xA;   example, if you mean to type &lt;code&gt;[:digit:]&lt;/code&gt; but you instead type&#xA;   &lt;code&gt;[:digit]&lt;/code&gt; (no second colon), then the characters highlighted are&#xA;   [, :, d, g, i, t, and ].&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Non-interactively:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;CHARS is a possible value for &lt;code&gt;hc-other-chars&lt;/code&gt;, that is, a list of&#xA;  entries such as described above.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;FACE is the face to use (e.g., a symbol).&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Non-nil OFFP non-nil means turn highlighting off.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-23T15:08:10.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28864" PostTypeId="2" ParentId="28851" CreationDate="2016-11-23T16:51:26.393" Score="8" Body="&lt;p&gt;My crystal ball said you should remove&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-[&quot;) 'previous-multiframe-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from your &lt;code&gt;~/.emacs&lt;/code&gt;.  You might like to &lt;code&gt;M-x report-emacs-bug&lt;/code&gt; and ask for &lt;code&gt;global-set-key&lt;/code&gt; to complain when the key sequence conflicts with something in &lt;code&gt;input-decode-map&lt;/code&gt; (as is the case here, because the byte sequence &lt;code&gt;ESC [&lt;/code&gt; (which corresponds to the &lt;code&gt;M-[&lt;/code&gt; event) is used by text terminal as a prefix for encoding all kinds of special events).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-23T16:51:26.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28865" PostTypeId="2" ParentId="18027" CreationDate="2016-11-23T16:55:25.767" Score="0" Body="&lt;p&gt;I don't think &lt;code&gt;electric-pair-mode&lt;/code&gt; will be of much help to you here.  You &lt;em&gt;could&lt;/em&gt; add &lt;code&gt;(?\s . ?\s)&lt;/code&gt; to &lt;code&gt;electric-pair-pairs&lt;/code&gt; (its alist of characters to automatically double-insert), but that would affect every space you type (there is no way to add conditions as to when it will/won't insert a pair) and will probably play havoc with skipping over whitespace.  Also, w.r.t. automatically deleting a matching space, &lt;code&gt;electric-pair-mode&lt;/code&gt; doesn't do anything magical.  It simply scans its list of characters to insert as pairs and removes the next character if it finds a match with the one you've deleted.  Again, adding &lt;code&gt;(?\s . ?\s)&lt;/code&gt; to &lt;code&gt;electric-pair-pairs&lt;/code&gt; would be a poor solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I solved this by adding my own functions for the purpose...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/c-mode-insert-space (arg)&#xA;  (interactive &quot;*P&quot;)&#xA;  (let ((prev (char-before))&#xA;        (next (char-after)))&#xA;    (self-insert-command (prefix-numeric-value arg))&#xA;    (if (and prev next&#xA;             (string-match-p &quot;[[({]&quot; (string prev))&#xA;             (string-match-p &quot;[])}]&quot; (string next)))&#xA;        (save-excursion (self-insert-command 1)))))&#xA;&#xA;(defun my/c-mode-delete-space (arg &amp;amp;optional killp)&#xA;  (interactive &quot;*p\nP&quot;)&#xA;  (let ((prev (char-before))&#xA;        (next (char-after))&#xA;        (pprev (char-before (- (point) 1))))&#xA;    (if (and prev next pprev&#xA;             (char-equal prev ?\s) (char-equal next ?\s)&#xA;             (string-match &quot;[[({]&quot; (string pprev)))&#xA;        (delete-char 1))&#xA;    (backward-delete-char-untabify arg killp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can bind them in c-mode (and its derivatives) like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'c-mode-common-hook&#xA;          (lambda ()&#xA;            (local-set-key &quot; &quot; 'my/c-mode-insert-space)&#xA;            (local-set-key &quot;\177&quot; 'my/c-mode-delete-space)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8376" LastActivityDate="2016-11-23T16:55:25.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28867" PostTypeId="1" AcceptedAnswerId="31294" CreationDate="2016-11-23T18:40:43.087" Score="3" ViewCount="1617" Body="&lt;p&gt;I often use subordinate shells within Emacs.  (I instantiate these shells with &lt;code&gt;M-x shell&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put all these shells under &lt;code&gt;auto-save-mode&lt;/code&gt; (through my &lt;code&gt;shell-mode-hook&lt;/code&gt;; see below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way that I can have Emacs set an environment variable &lt;em&gt;in a subordinate shell&lt;/em&gt; equal to the value of &lt;code&gt;buffer-auto-save-file-name&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For what it's worth, below is the hook code I use to put my subordinate shells under &lt;code&gt;auto-save-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; NB: I define the global variable auto-saves-dir elsewhere in my init file.&#xA;&#xA;(defun cd-to-auto-saves-dir ()&#xA;  (unless (file-directory-p auto-saves-dir)&#xA;    (make-directory auto-saves-dir t))&#xA;  (cd auto-saves-dir))&#xA;&#xA;(add-hook&#xA;    'shell-mode-hook&#xA;    (lambda ()    &#xA;        ;; the silliness with cd-ing to/fro auto-saves-dir is the&#xA;        ;; only way I've found to trick Emacs into putting the&#xA;        ;; auto-save'd file in auto-saves-dir&#xA;        (let ((orig-dir default-directory))&#xA;           (cd-to-auto-saves-dir)&#xA;           (auto-save-mode)&#xA;           (cd orig-dir))&#xA;        )&#xA;    )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2017-03-01T15:51:15.757" LastActivityDate="2023-04-27T13:44:14.463" Title="How can Emacs set an environment/shell variable in a subordinate shell?" Tags="|shell|comint|subprocess|environment|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28868" PostTypeId="2" ParentId="28731" CreationDate="2016-11-23T20:32:57.900" Score="12" Body="&lt;p&gt;When you update your packages through the &lt;code&gt;M-x list-packages&lt;/code&gt; interface, after the successful installation of the package, you'll get asked if you want to remove the old package. Don't delete them so they stay in place and you could then later remove the newer package through this interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current package list shows 4 versions of magit installed in my ~/.emacs.d/elpa/ directory tree.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  magit              20160827.1549 obsolete              A Git porcelain inside Emacs&#xA;  magit              20160907.945  obsolete              A Git porcelain inside Emacs&#xA;  magit              20161001.1454 obsolete              A Git porcelain inside Emacs&#xA;  magit              20161123.617  installed             A Git porcelain inside Emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can clean-up old versions later with the key &lt;code&gt;~&lt;/code&gt; (package-menu-mark-obsolete-for-deletion) to mark all obsolete packages.  To delete a certain old version move to its line and press &lt;code&gt;d&lt;/code&gt; to mark them for deletion.  After you marked the packages you'd use &lt;code&gt;x&lt;/code&gt; to execute the actions as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;strong&gt;Emacs 25&lt;/strong&gt; the mark all packages for &lt;code&gt;U&lt;/code&gt;pgrade functionality automatically sets all old packages for deletion, and doesn't prompt for confirmation after installing. You have to look for lines that start with a capital &quot;D&quot;, which you can just unmark (best with the following macro)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type the key or chord on the left of the dash from the following lines.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;F3&amp;gt;  - start macro recording&#xA;C-s   - isearch-forward&#xA;C-q   - quoted-insert&#xA;C-j   - linefeed character&#xA;D     - the mark at the start of the line&#xA;&amp;lt;Ret&amp;gt; - stops the isearch on the line with the &quot;D&quot;&#xA;u     - unmark the package for deletion&#xA;&amp;lt;F4&amp;gt;  - stops macro recording - the first package is now unmarked&#xA;&amp;lt;F4&amp;gt;  - executes the macro for the next upgraded package&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there are no further matches for the search the macro will ring the bell and stop, so you could &lt;code&gt;C-u 0 &amp;lt;F4&amp;gt;&lt;/code&gt; to unmark all packages marked for deletion. After this you can e&lt;code&gt;x&lt;/code&gt;ecute the installations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function I declared to be changed in my comment has to be changed in a way I cannot grasp yet, as it's important that the last (cond) block has to be successful in order to not loop endlessly.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastEditorUserId="4068" LastEditDate="2016-11-28T12:31:03.447" LastActivityDate="2016-11-28T12:31:03.447" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28869" PostTypeId="2" ParentId="28842" CreationDate="2016-11-23T20:46:16.660" Score="2" Body="&lt;p&gt;If you are using lexical binding (&lt;code&gt;lexical-binding&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;), then you can store the current value of &lt;code&gt;x&lt;/code&gt; in a closure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lexical-binding t)&#xA;(setq x 42)&#xA;(setq f (let ((x x)) (lambda () (message &quot;%s&quot; x))))&#xA;(setq x 57)&#xA;(funcall f)&#xA;==&amp;gt; &quot;42&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're not using lexical binding, then, as Drew suggested, you must perform some sexp surgery using backquote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq lexical-binding nil)&#xA;(setq x 42)&#xA;(setq f `(lambda () (message &quot;%s&quot; ,x)))&#xA;(setq x 57)&#xA;(funcall f)&#xA;==&amp;gt; &quot;42&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-11-23T20:46:16.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28870" PostTypeId="2" ParentId="28768" CreationDate="2016-11-23T20:52:46.557" Score="2" Body="&lt;p&gt;E-mail tracking is performed by embedding a link to server in a mail, as described &lt;a href=&quot;https://support.nylas.com/hc/en-us/articles/226411088-How-does-Nylas-perform-Open-Tracking-&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for Nylas.  This requires server-side infrastructure which mu4e doesn't provide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It is also not very reliable, since it requires the recipient to enable display of remote images.)&lt;/p&gt;&#xA;" OwnerUserId="2223" LastActivityDate="2016-11-23T20:52:46.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28871" PostTypeId="1" AcceptedAnswerId="28890" CreationDate="2016-11-23T21:16:52.263" Score="5" ViewCount="804" Body="&lt;p&gt;My problem is that every line executing on the remote Linux machine seems to be including a trailing ^M (as is shown as ? in the file name &lt;code&gt;apa?&lt;/code&gt; below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Content of my .org document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Test&#xA;#+BEGIN_SRC sh :dir /plink:pi@raspberry:/home/pi/test&#xA;touch apa&#xA;touch bepa &amp;amp;&amp;amp; echo&#xA;ls -al&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: total 8&#xA;: drwxr-xr-x  2 pi pi 4096 Nov 23 21:35 .&#xA;: drwxr-xr-x 10 pi pi 4096 Nov 23 20:07 ..&#xA;: -rw-r--r--  1 pi pi    0 Nov 23 21:35 apa?&#xA;: -rw-r--r--  1 pi pi    0 Nov 23 21:35 bepa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I ssh to my Linux machine and type the file name using tab completion I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pi@raspberry:~/test $ ls apa^M&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running plink directly from a cmd.exe does not add ^M to the filename:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\&amp;gt;plink.exe -l pi raspberry &quot;cd test &amp;amp;&amp;amp; touch cepa&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have saved the org document with Unix line endings, but I get the same result. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current workaround is to add the &lt;code&gt;&amp;amp;&amp;amp; echo&lt;/code&gt; to eat the ^M, but I'd really like to find a better one...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs 25.1 and org-mode v8.3.6 on Windows 10. My Linux machine is a raspberryPi running raspian jessie.&lt;/p&gt;&#xA;" OwnerUserId="14074" LastEditorUserId="14074" LastEditDate="2016-11-23T21:20:46.327" LastActivityDate="2016-11-25T05:22:48.103" Title="How to remove ^M from org-babel code block executing on Linux from Windows OS?" Tags="|org-babel|microsoft-windows|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28872" PostTypeId="1" CreationDate="2016-11-23T21:45:52.297" Score="3" ViewCount="174" Body="&lt;p&gt;I am using Emacs with the &lt;code&gt;ein&lt;/code&gt; package to edit ipython files. Everything works fine except when I have a line like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fhandle = raw_input('enter your file name: ')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to prompt for a file name. The ipython subprocess that is running inside Emacs stops responding. (there is a little star at &lt;code&gt;In[]&lt;/code&gt; that indicates this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run the same command in the usual jupyter notebook web interface it works fine as usual. (there is a little box where it prompts me for the file name). I am thinking emacs + ein somehow doesn't have this capability?. What am I doing wrong here?. I am using python 2.7.&lt;/p&gt;&#xA;" OwnerUserId="13976" LastEditorUserId="1979" LastEditDate="2017-03-27T16:51:02.107" LastActivityDate="2018-08-22T21:00:28.310" Title="ein + ipython non-responsive with python 'raw_input'" Tags="|python|ipython|ein|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28874" PostTypeId="2" ParentId="3359" CreationDate="2016-11-24T00:35:10.340" Score="1" Body="&lt;p&gt;I suggest using &lt;a href=&quot;https://github.com/Sarcasm/irony-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;irony-mode&lt;/a&gt; with &lt;a href=&quot;https://github.com/Sarcasm/company-irony&quot; rel=&quot;nofollow noreferrer&quot;&gt;company-irony&lt;/a&gt; for completion instead of semantic as semantic is generally too slow and simplistic - ie. it often doesn't offer completions when you would think it should.&lt;/p&gt;&#xA;" OwnerUserId="144" LastActivityDate="2016-11-24T00:35:10.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28875" PostTypeId="2" ParentId="28871" CreationDate="2016-11-24T01:10:51.950" Score="5" Body="&lt;p&gt;It seems that org-babel executes code blocks by dumping them to a temporary file and then loading the file into whatever interpreter is to be used for the designated language (in this case, a shell).  When you specify a remote &lt;code&gt;:dir&lt;/code&gt; argument, the temporary file is placed on the remote host using TRAMP via &lt;code&gt;with-temp-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately it seems this file doesn't inherit the coding system of the org buffer (though I guess that wouldn't make sense anyway).  Nor is its coding system autodetected from the OS running on the remote host (which probably would make sense).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know what the best way to solve this problem is, but it should suffice to set the global default coding system so that new buffers automatically follow unix EOL conventions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default buffer-file-coding-system 'utf-8-unix)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As an Emacs user on Windows, this might prove inconvenient for you in other situations, though.&lt;/p&gt;&#xA;" OwnerUserId="14017" LastActivityDate="2016-11-24T01:10:51.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28876" PostTypeId="2" ParentId="28857" CreationDate="2016-11-24T03:48:34.397" Score="6" Body="&lt;p&gt;The possible solution for this question I found is:&#xA;1) exclude the smartparens for it haven't support such a function. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-excluded-packages '(smartparens)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) add electric package when init&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(electric-pair-mode 1)&#xA;(setq electric-pair-preserve-balance nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14071" LastActivityDate="2016-11-24T03:48:34.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28877" PostTypeId="2" ParentId="27610" CreationDate="2016-11-24T05:40:21.677" Score="6" Body="&lt;h1&gt;Add Code to Org file&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;expand-src-block&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: expand-src-block&#xA;#+BEGIN_SRC elisp :var block-name=&quot;&quot; :var datum=&quot;&quot; :var info=&quot;&quot; :var lang=&quot;&quot; :var body=&quot;&quot; :exports none&#xA;  (save-excursion&#xA;    (org-babel-goto-named-src-block block-name)&#xA;    (setq datum (org-element-at-point))&#xA;    t)&#xA;  (setq info (org-babel-get-src-block-info nil datum))&#xA;  (setq lang (nth 0 info))&#xA;  (setq body (org-babel-expand-src-block nil info))&#xA;  (format &quot;%s&quot; body)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Usage Examples&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;General&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;noweb&lt;/code&gt; Syntax to Export Code with Variables&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Assign original code block a name using &lt;code&gt;#+NAME:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: print-abc&#xA;#+BEGIN_SRC shell :var data=&quot;ABC&quot;&#xA;  echo -n $data&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Prevent original code block from exporting using &lt;code&gt;:exports none&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: print-abc&#xA;#+BEGIN_SRC shell :var data=&quot;ABC&quot; :exports none&#xA;  echo -n $data&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Create new &lt;code&gt;noweb&lt;/code&gt; code block under original block.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: print-abc&#xA;#+BEGIN_SRC shell :var data=&quot;ABC&quot; :exports none&#xA;  echo -n $data&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC shell :noweb yes :exports both &#xA; &amp;lt;&amp;lt;expand-src-block(block-name=&quot;print-abc&quot;)&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exported output should be similar to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data='ABC'&#xA;echo -n $data&#xA;&#xA;ABC&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Question Specific Use Case&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Added &lt;code&gt;expand-src-block&lt;/code&gt; code, &lt;code&gt;:exports none&lt;/code&gt; headers and &lt;code&gt;noweb&lt;/code&gt; code blocks to your original example use case.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: expand-src-block&#xA;#+BEGIN_SRC elisp :var block-name=&quot;&quot; :var datum=&quot;&quot; :var info=&quot;&quot; :var lang=&quot;&quot; :var body=&quot;&quot; :exports none&#xA;  (save-excursion&#xA;    (org-babel-goto-named-src-block block-name)&#xA;    (setq datum (org-element-at-point))&#xA;    t)&#xA;  (setq info (org-babel-get-src-block-info nil datum))&#xA;  (setq lang (nth 0 info))&#xA;  (setq body (org-babel-expand-src-block nil info))&#xA;  (format &quot;%s&quot; body)&#xA;#+END_SRC&#xA;&#xA;* Export with variables&#xA;:PROPERTIES:&#xA;:header-args: :var status=&quot;not_finished&quot;&#xA;:END:&#xA;&#xA;#+NAME: example-table&#xA;| 1 |&#xA;| 2 |&#xA;| 3 |&#xA;| 4 |&#xA;&#xA;Here we import a table.          &#xA;#+NAME: table-length&#xA;#+BEGIN_SRC R :var table=example-table :tangle &quot;./export_var.R&quot; :exports none&#xA;status &amp;lt;- &quot;finished&quot;&#xA;dim(table)&#xA;#+END_SRC&#xA;&#xA;# Export the expanded code&#xA;#+BEGIN_SRC R :noweb yes :exports both &#xA; &amp;lt;&amp;lt;expand-src-block(block-name=&quot;table-length&quot;)&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&#xA;Here we think we import a table&#xA;#+NAME: table-str-length&#xA;#+BEGIN_SRC R :var table=&quot;./filename_example-table.tsv&quot; :tangle &quot;./export_var.R&quot; :exports none&#xA;length(table)&#xA;print(status)&#xA;#+END_SRC&#xA;&#xA;# Export the expanded code&#xA;#+BEGIN_SRC R :noweb yes :exports both &#xA; &amp;lt;&amp;lt;expand-src-block(block-name=&quot;table-str-length&quot;)&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&#xA;*** Some subcase&#xA;&#xA;If I run with the data in =&quot;./other_data.tsv&quot;=&#xA;#+call: table-str-length[ :var table=&quot;./other_data.tsv&quot;]()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exported results should be similar to the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Export with variables&#xA;#+NAME: example-table&#xA;| 1 |&#xA;| 2 |&#xA;| 3 |&#xA;| 4 |&#xA;&#xA;Here we import a table.          &#xA;#+BEGIN_SRC R&#xA;  table &amp;lt;- local({&#xA;       con &amp;lt;- textConnection(&#xA;     &quot;\&quot;1\&quot;&#xA;  \&quot;2\&quot;&#xA;  \&quot;3\&quot;&#xA;  \&quot;4\&quot;&quot;&#xA;       )&#xA;       res &amp;lt;- utils::read.table(&#xA;     con,&#xA;     header    = FALSE,&#xA;     row.names = NULL,&#xA;     sep       = &quot;\t&quot;,&#xA;     as.is     = TRUE&#xA;       )&#xA;       close(con)&#xA;       res&#xA;     })&#xA;  status &amp;lt;- &quot;finished&quot;&#xA;  dim(table)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: &#xA;| 4 |&#xA;| 1 |&#xA;&#xA;Here we think we import a table&#xA;#+BEGIN_SRC R&#xA;  table &amp;lt;- &quot;./filename_example-table.tsv&quot;&#xA;  length(table)&#xA;  print(status)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: &#xA;: not_finished&#xA;&#xA;*** Some subcase&#xA;&#xA;If I run with the data in =&quot;./other_data.tsv&quot;=&#xA;#+RESULTS: &#xA;: not_finished&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Test Info&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;https://github.com/melioratus/nosebutter/blob/master/stackexchange/How_do_I_insert_code_block_header_var_in_exported_code_block_in_org-mode.org#answer---try-2&quot; rel=&quot;noreferrer&quot;&gt;Org Source Code&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This code was tested using&lt;br&gt;&#xA;  GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  org-mode version: 9.0 &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2016-11-24T05:56:14.777" LastActivityDate="2016-11-24T05:56:14.777" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28878" PostTypeId="1" AcceptedAnswerId="28899" CreationDate="2016-11-24T07:35:42.420" Score="3" ViewCount="745" Body="&lt;p&gt;I use &lt;code&gt;auto-revert-mode&lt;/code&gt; and ideally I would like the &lt;code&gt;auto-revert-interval&lt;/code&gt; to be very small, e.g. 0.5 seconds or less. But I am concerned about performance problems when I have many buffers open, especially as I would like to use &lt;code&gt;auto-revert-mode&lt;/code&gt; for &lt;code&gt;dired&lt;/code&gt; buffers too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It occured to me, though, that &lt;code&gt;auto-revert-mode&lt;/code&gt; only really needs to be active for the current buffer. After all, if I'm not looking at a buffer, who cares if it is reverted or not? Other buffers can wait to be reverted until I actually switch to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the easiest/most elegant way to make it so &lt;code&gt;auto-revert-mode&lt;/code&gt; is only active (i.e. polling the filesystem) for the buffer currently being viewed?&lt;/p&gt;&#xA;" OwnerUserId="12534" LastEditorUserId="12534" LastEditDate="2016-11-24T18:37:14.683" LastActivityDate="2017-03-09T21:18:04.377" Title="Only enable auto-revert-mode for the current buffer" Tags="|buffers|osx|hooks|auto-revert-mode|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28879" PostTypeId="2" ParentId="3359" CreationDate="2016-11-24T08:42:06.290" Score="0" Body="&lt;p&gt;First you need to initialize CEDET and ede&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-ede-mode 1)&#xA;(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode 1)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode 1)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode 1)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode 1)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode t)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode t)&#xA;(add-to-list 'semantic-default-submodes 'global-srecode-minor-mode t)&#xA;(add-to-list 'semantic-default-submodes 'global-semantic-decoration-mode t)&#xA;(semantic-mode) ;; Active le mode semantic&#xA;(require 'stickyfunc-enhance) ;; multilines concatene dans la header line&#xA;(require 'cedet-cscope)&#xA;&#xA;(require 'ecb)&#xA;(ede-cpp-root-project &quot;projName&quot;&#xA;                  :name &quot;projName Project&quot;&#xA;                  :file &quot;~/workspaces/projName/proj.txt&quot; ;; an arbitrary file&#xA;                  :include-path '(&quot;/src/main/src&quot;&#xA;                                  &quot;/src/main/include&quot;&#xA;                                  &quot;/src/test/src&quot;&#xA;                                  &quot;/src/test/include&quot;&#xA;                                  ... )&#xA;                  :system-include-path '(&quot;/usr/include/ ~/workspaces/install/proj3/lib/ /usr/include/boost/&quot;)&#xA;                  :spp-table '((&quot;isUnix&quot; . &quot;&quot;) (&quot;BOOST_TEST_DYN_LINK&quot; . &quot;&quot;)))&#xA;;; cedet semantic&#xA;(semanticdb-enable-gnu-global-databases 'c-mode t)&#xA;(semanticdb-enable-gnu-global-databases 'c++-mode t)&#xA;;; You can add this to improve the parse of macro-heavy code:&#xA;(require 'semantic/bovine/c)&#xA;(add-to-list 'semantic-lex-c-preprocessor-symbol-file &quot;/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then you can use company-c-headers (&lt;a href=&quot;https://github.com/randomphrase/company-c-headers&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/randomphrase/company-c-headers&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'company-c-headers)&#xA;     (add-to-list 'company-backends 'company-c-headers)&#xA;     (add-to-list 'company-c-headers-path-system &quot;/usr/include/c++/4.4.7/ /home/me/DEPEDENCIES/LIBXX/lib/ /home/me/DEPEDENCIES/LIBYY/lib /usr/include/boost/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2016-11-24T08:42:06.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28881" PostTypeId="1" CreationDate="2016-11-24T09:29:43.337" Score="4" ViewCount="342" Body="&lt;p&gt;I was wondering if anyone knew of a way or recommend a method to save often use search and replace queries for future use after emacs restarts?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-11-25T06:26:20.060" Title="Save search and replace queries for future use" Tags="|search|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28882" PostTypeId="2" ParentId="28871" CreationDate="2016-11-24T09:34:12.437" Score="1" Body="&lt;p&gt;Does using the DOS &lt;code&gt;cr+lf&lt;/code&gt; (&lt;code&gt;^M^J&lt;/code&gt;) in an org file actually have a benefit? I guess you will only open it in Emacs anyway. (Other editors should be able to come to terms with unix &lt;code&gt;lf&lt;/code&gt; (&lt;code&gt;^J&lt;/code&gt;) line endings too.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To just set the encoding for this one file, do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; M-x set-buffer-file-coding-system &amp;lt;ret&amp;gt; utf-8-unix &amp;lt;ret&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and if necessary remove any ^M with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; M-x replace-string &amp;lt;ret&amp;gt; C-q C-m &amp;lt;ret&amp;gt;&amp;lt;ret&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then of course save the file.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-24T09:34:12.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28883" PostTypeId="2" ParentId="28735" CreationDate="2016-11-24T09:35:56.983" Score="33" Body="&lt;p&gt;The Emacs package for doing this is named Ediff and Magit supports Ediff. To get started press &lt;kbd&gt;e&lt;/kbd&gt; on the change for which you want to see the side-by-side comparison. You might also have to use &lt;kbd&gt;E&lt;/kbd&gt; occasionally to tell Ediff/Magit explicitly what you want to compare.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ediff/index.html&quot; rel=&quot;noreferrer&quot;&gt;Ediff manual&lt;/a&gt; and the node about Ediff &lt;a href=&quot;https://magit.vc/manual/magit/Ediffing.html&quot; rel=&quot;noreferrer&quot;&gt;in the Magit manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-05-08T19:01:39.977" LastActivityDate="2017-05-08T19:01:39.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28884" PostTypeId="2" ParentId="10753" CreationDate="2016-11-24T11:51:28.700" Score="0" Body="&lt;p&gt;Install &lt;code&gt;smart-compile&lt;/code&gt; package inside Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;add this into your &lt;code&gt;init.el&lt;/code&gt; or &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'compile)&#xA;(setq compilation-last-buffer nil)&#xA;;; save all modified buffers without asking before compilation&#xA;(setq compilation-ask-about-save nil)&#xA;(defun compile-again (ARG)&#xA;  &quot;Run the same compile as the last time.&#xA;&#xA;With a prefix argument or no last time, this acts like M-x compile,&#xA;and you can reconfigure the compile args.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  ;; the following two lines create bug: split a new window every time&#xA;  ;; (if (not (get-buffer-window &quot;*compilation*&quot;))&#xA;  ;;      (split-window-below))&#xA;  (if (and (eq ARG 1) compilation-last-buffer)&#xA;      (recompile)&#xA;    (call-interactively 'smart-compile)))&#xA;(bind-key* &quot;C-x C-m&quot; 'compile-again)&#xA;;; create a new small frame to show the compilation info&#xA;;; will be auto closed if no error&#xA;(setq special-display-buffer-names&#xA;      `((&quot;*compilation*&quot; . ((name . &quot;*compilation*&quot;)&#xA;                            ,@default-frame-alist&#xA;                            (left . (- 1))&#xA;                            (top . 0)))))&#xA;(setq compilation-finish-functions&#xA;      (lambda (buf str)&#xA;        (if (null (string-match &quot;.*exited abnormally.*&quot; str))&#xA;            ;;no errors, make the compilation window go away in a few seconds&#xA;            (progn&#xA;              (run-at-time&#xA;               &quot;1 sec&quot; nil 'delete-windows-on&#xA;               (get-buffer-create &quot;*compilation*&quot;))&#xA;              (message &quot;No Compilation Errors!&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-x C-m&lt;/code&gt; to compile your source code, If you are the first time to execute &lt;code&gt;C-x C-m&lt;/code&gt;, it will ask you to change the default command (which is usually enough), otherwise it will execute the command you just used to compile directly and you have to use &lt;code&gt;C-u C-x C-m&lt;/code&gt; to change the command if you want. If you got a &lt;code&gt;Makefile&lt;/code&gt; inside the current directory, it will notice and prompt to ask whether you want to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe this answer is too much for your question, but please try it.&lt;/p&gt;&#xA;" OwnerUserId="794" LastEditorUserId="794" LastEditDate="2016-11-24T14:52:39.017" LastActivityDate="2016-11-24T14:52:39.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28885" PostTypeId="2" ParentId="28878" CreationDate="2016-11-24T13:00:20.093" Score="5" Body="&lt;p&gt;Since Emacs 24.4, &lt;code&gt;auto-revert-mode&lt;/code&gt; does not poll anymore. Instead, it uses file notifications from your underlying OS. There shouldn't be any performance problem; people have reported 600+ buffers in parallel in &lt;code&gt;auto-revert-mode&lt;/code&gt;, IIRC.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-11-24T13:00:20.093" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28886" PostTypeId="1" CreationDate="2016-11-24T13:28:48.860" Score="2" ViewCount="513" Body="&lt;p&gt;Writeroom mode and linum mode are incompatible (leave numbers at&#xA;far left, making them useless for (evil) jumping).  Is there anything&#xA;else I can do to get centered text with (relative) line numbering close to the text?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2018-07-01T19:31:25.323" Title="Centered text with line numbering" Tags="|linum-mode|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28887" PostTypeId="1" CreationDate="2016-11-24T16:33:01.217" Score="0" ViewCount="55" Body="&lt;p&gt;im not very technical and lately i have been getting random crashed the seem to kill emacs and even the emacs daemon. this is an example output from CLI&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fatal error 11: Segmentation fault&#xA;Backtrace:&#xA;emacs[0x507da9]&#xA;emacs[0x4ee96c]&#xA;emacs[0x50654e]&#xA;emacs[0x506773]&#xA;emacs[0x5067df]&#xA;/usr/lib/libpthread.so.0(+0x11080)[0x7f8e10656080]&#xA;emacs[0x4c5207]&#xA;emacs[0x458635]&#xA;emacs[0x45d7f2]&#xA;emacs[0x41c358]&#xA;emacs[0x41e46d]&#xA;emacs[0x41fb1a]&#xA;emacs[0x421bcd]&#xA;emacs[0x454554]&#xA;emacs[0x456155]&#xA;emacs[0x4d6b71]&#xA;emacs[0x4d8625]&#xA;emacs[0x4f4c99]&#xA;emacs[0x4f5bdd]&#xA;emacs[0x5a1f0a]&#xA;emacs[0x5a2727]&#xA;emacs[0x561d23]&#xA;emacs[0x59603b]&#xA;emacs[0x561b5b]&#xA;emacs[0x59603b]&#xA;emacs[0x561b5b]&#xA;emacs[0x561e28]&#xA;emacs[0x560666]&#xA;emacs[0x4ef4d1]&#xA;emacs[0x55fef5]&#xA;emacs[0x4f3b55]&#xA;emacs[0x4fd33b]&#xA;emacs[0x5604b2]&#xA;emacs[0x4eedec]&#xA;emacs[0x560453]&#xA;emacs[0x4eeda9]&#xA;emacs[0x4f3537]&#xA;emacs[0x4f3878]&#xA;emacs[0x418a4e]&#xA;/usr/lib/libc.so.6(__libc_start_main+0xf1)[0x7f8e102c7291]&#xA;emacs[0x4195da]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;can anyone guide me on how to further explore this, what should i report and where?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-11-24T16:33:01.217" Title="How to investigate an emacs crash on linux" Tags="|debugging|" AnswerCount="0" CommentCount="3" ClosedDate="2016-11-28T18:09:30.090" ContentLicense="CC BY-SA 3.0" />
  <row Id="28888" PostTypeId="1" CreationDate="2016-11-24T16:34:54.710" Score="7" ViewCount="4963" Body="&lt;p&gt;My current org file (e.g. &lt;code&gt;work.org&lt;/code&gt;) has 20+ DONE tasks and Org-mode becomes extremely slow: even moving the cursor takes a 2-3 seconds sometimes. I decide I have to archive these DONE tasks, but I found I don't know what Org-mode is actually doing to my text when archiving.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few common options to archive:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;archive subtree using the default command&#xA;C-c C-x C-a&#xA;It moves my subtree (a DONE task) from &lt;code&gt;work.org&lt;/code&gt; to &lt;code&gt;work.org_archive&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;move subtree to archive file&#xA;C-c C-x C-s&#xA;It also moves my subtree from &lt;code&gt;work.org_archive&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;toggle ARCHIVE tag / to ARCHIVE sibling&#xA;C-c C-x a/A&#xA;It greys out my subtree (the DONE task) but the task remains visible on &lt;code&gt;work.org&lt;/code&gt; when I expand the top tree. However, details of the subtree is not expandable, unless I do &quot;force cycling of an ARCHIVEd tree&quot; (C-TAB)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My questions are:&#xA;If I archive using #3, does the content of completed tasks stay in &lt;code&gt;work.org&lt;/code&gt;? And does #3 offer already significantly performance improvement over a large Org file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if I archive using #1 or #2, how can I:&#xA;Search the archived contents on separate files? Do I just include the :archive: only? Or do I need to list and include all these files in my &lt;code&gt;.emacs&lt;/code&gt; under org-agenda-text-search-extra-files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how do I refile a subtree by C-c C-w? Is it similar to refiling in other case: i.e. find the subtree in search by other ways, do a C-c C-w to move the subtree to the section I want, and then just save both the target org file and the .org_archive file in question. Is there other things I have to pay attention to?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs (25.1 64-bit in Windows10) just crashed...&#xA;Emacs (esp. Org mode) has become so slow and almost inoperable that typing on Firefox is quicker.&lt;/p&gt;&#xA;" OwnerUserId="6942" LastEditorDisplayName="user14082" LastEditDate="2016-11-24T16:57:14.803" LastActivityDate="2017-05-14T19:12:29.913" Title="Org-mode: clarify the concept and practice of archiving" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28889" PostTypeId="2" ParentId="28886" CreationDate="2016-11-24T17:01:24.070" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/anler/centered-window-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Centered-window-mode&lt;/a&gt; works with line numbers, though it doesn't provide the numbers directly next to the the text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you are using the latest emacs, it now has &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00318.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;native display of line numbers&lt;/a&gt;. If you set &lt;code&gt;display-line-numbers-type 'relative&lt;/code&gt; or &lt;code&gt;display-line-numbers-type 'visual&lt;/code&gt; and use in combination with &lt;code&gt;centered-window-mode&lt;/code&gt; you'll get the numbers right next to the centered text, and with relative line numbers except for current line. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastEditorUserId="11934" LastEditDate="2017-07-31T16:40:08.160" LastActivityDate="2017-07-31T16:40:08.160" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28890" PostTypeId="2" ParentId="28871" CreationDate="2016-11-24T17:28:30.640" Score="3" Body="&lt;p&gt;Thanks to the explanation from &lt;a href=&quot;https://emacs.stackexchange.com/users/14017/kini&quot;&gt;kini&lt;/a&gt; I have now created a satisfactory solution by adding a parameter to org-babel-sh-evaluate: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :file-coding utf-8-unix :dir /plink:pi@raspberry:/home/pi/test&#xA;touch apa&#xA;touch bepa&#xA;ls -al&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;using the following defadvice: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice org-babel-sh-evaluate (around set-shell activate)&#xA;  &quot;Add header argument :file-coding that sets the buffer-file-coding-system.&quot;&#xA;  (let ((file-coding-param (cdr (assoc :file-coding params))))&#xA;    (if file-coding-param&#xA;        (let ((file-coding (intern file-coding-param))&#xA;        (default-file-coding (default-value 'buffer-file-coding-system)))&#xA;          (setq-default buffer-file-coding-system file-coding)&#xA;          ad-do-it&#xA;          (setq-default buffer-file-coding-system default-file-coding))&#xA;      ad-do-it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14074" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-11-25T05:22:48.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28891" PostTypeId="1" CreationDate="2016-11-24T20:34:30.463" Score="0" ViewCount="639" Body="&lt;p&gt;I've been migrating from Vim to Emacs in evil mode, and I'd like to use &lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow noreferrer&quot;&gt;smartparens&lt;/a&gt;. I know there's a port of surround.vim, but I've always found surround.vim awkward to use, so I'd like to explore an alternative approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I particularly like smartparens' take on wrapping -- select a region and type &lt;code&gt;(&lt;/code&gt; to wrap it in parens. This seems especially nice in concert with &lt;a href=&quot;https://github.com/magnars/expand-region.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;expand-region&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in evil-visual-state, &lt;code&gt;(&lt;/code&gt; is bound to &lt;code&gt;evil-backward-sentence-begin&lt;/code&gt;. The binding originates in evil-motion-state-map, which both normal and visual states inherit from. I've tried a few ways to rebind &lt;code&gt;(&lt;/code&gt; to &lt;code&gt;self-insert-command&lt;/code&gt; in order to let smartparens do its thing, but so far nothing I've tried has worked:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-visual-state-map (kbd &quot;(&quot;) 'self-insert-command)&#xA;(define-key evil-motion-state-map (kbd &quot;(&quot;) 'self-insert-command)&#xA;(define-key evil-motion-state-map (kbd &quot;(&quot;) nil)&#xA;(evil-define-key 'visual evil-visual-state-map (kbd &quot;(&quot;) 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I properly configure this?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-02-09T16:26:36.703" Title="Configure smartparens wrapping to work in evil-visual-state?" Tags="|evil|smartparens|wrapping|wrap-region|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28892" PostTypeId="1" AcceptedAnswerId="28900" CreationDate="2016-11-24T21:53:25.807" Score="3" ViewCount="1409" Body="&lt;p&gt;Sometimes I fall behind in my org-agenda maintenance and have to go back a few days to mark completed tasks. In 90% of cases, I want to mark the task as completed on the day it was due, but &lt;code&gt;org-agenda-todo&lt;/code&gt; always uses the current day and time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the easiest way to mark agenda items as completed on the day currently being viewed in the agenda window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I attempted to adapt the answer to the linked question; ignoring the ugliness of my code, the date seems to be obtained, but &lt;code&gt;org-agenda-todo&lt;/code&gt; ignores &lt;code&gt;org-current-effective-time&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-agenda-todo-view-date (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (cl-letf* ((org-read-date-prefer-future nil)&#xA;             (my-current-time (org-read-date nil t (mapconcat 'number-to-string (append (last (calendar-gregorian-from-absolute org-starting-day)) (butlast (calendar-gregorian-from-absolute org-starting-day))) &quot;-&quot;)))&#xA;             ((symbol-function #'org-current-effective-time)&#xA;              #'(lambda () my-current-time)))&#xA;    (org-agenda-todo arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2016-11-25T07:53:45.353" LastActivityDate="2016-11-27T23:54:23.393" Title="How to mark org agenda item as completed on particular day?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28893" PostTypeId="1" CreationDate="2016-11-24T23:35:03.653" Score="1" ViewCount="282" Body="&lt;p&gt;While I used to use the TPU EDT emulation, this seems to be deprecated in the latest GNU emacs. Is this still available anywhere? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result I'm presently using the edt emulation directly. This works for most keys, except that the space bar isn't working. Is there a way to restore this while using the edt emulation? I'm running emacs on a Mac. &lt;/p&gt;&#xA;" OwnerUserId="14086" LastActivityDate="2017-04-24T20:02:24.613" Title="edt emulation - space bar isn't working" Tags="|key-bindings|osx|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28894" PostTypeId="2" ParentId="28893" CreationDate="2016-11-25T00:05:53.240" Score="1" Body="&lt;p&gt;TPU-EDT was marked obsolete in Emacs-24.5, indeed.  That doesn't mean you can't use it.  It's still there (e.g. &lt;code&gt;(require 'tpu-edt)&lt;/code&gt; should work just as well as before), tho it means it will probably be removed at some point in the future, such as in Emacs-27. for example.  If you'd like to see it live longer, I suggest you lobby the Emacs maintainers so that instead of removing it in some future version, it gets moved to GNU ELPA.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-25T00:05:53.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28895" PostTypeId="2" ParentId="28881" CreationDate="2016-11-25T06:26:20.060" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are asking how to save search &lt;strong&gt;&lt;em&gt;queries&lt;/em&gt;&lt;/strong&gt; then you need only save the variable &lt;strong&gt;&lt;code&gt;search-ring&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;regexp-search-ring&lt;/code&gt;&lt;/strong&gt; (or both) -- those are your search histories.  You can use option &lt;strong&gt;&lt;code&gt;savehist-additional-variables&lt;/code&gt;&lt;/strong&gt; for that (and turn on &lt;code&gt;savehist-mode&lt;/code&gt;: &lt;code&gt;(savehist-mode 1)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are how to save the &lt;strong&gt;&lt;em&gt;results&lt;/em&gt;&lt;/strong&gt; of searches then this is one way: Use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt; and search using &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles search&lt;/a&gt;. With that, the search hits for a given search query are completion candidates. And you can save the current completion candidates anytime and restore them later.  You can &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Persistent_Completions&quot; rel=&quot;nofollow noreferrer&quot;&gt;save them persistently&lt;/a&gt; or just &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Candidate_Sets&quot; rel=&quot;nofollow noreferrer&quot;&gt;for the current session&lt;/a&gt; (e.g. across any number of different actions, including different searches).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-25T06:26:20.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28896" PostTypeId="1" CreationDate="2016-11-25T07:52:48.767" Score="3" ViewCount="1452" Body="&lt;p&gt;I just started using &lt;code&gt;erc&lt;/code&gt; in emacs and I've built emacs with &lt;code&gt;--with-dbus&lt;/code&gt; compile option. I enabled &lt;code&gt;notifications&lt;/code&gt; (so that I can get a notifications when my erc nickname gets mentioned) module in Erc modules list. But, whenever my nick gets mentioned in an erc channel, &lt;code&gt;dbus&lt;/code&gt; gives me this error message:&lt;code&gt;Error: (dbus-error &quot;No connection to bus&quot; :session)&lt;/code&gt;. I've no idea how to fix this :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get notifications to work for macOS?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I've started the dbus process with: &lt;code&gt;brew services start dbus&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-12-01T13:06:19.287" LastActivityDate="2019-06-25T11:21:27.730" Title="How to get notifications from Erc in macOS?" Tags="|erc|notifications|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28897" PostTypeId="2" ParentId="28849" CreationDate="2016-11-25T10:51:29.317" Score="4" Body="&lt;p&gt;If you installed this theme as a package: Packages are initialized after &lt;code&gt;.emacs&lt;/code&gt; is read. To use/configure them from there, use constructions like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'after-init-hook (lambda () (load-theme 'calmer-forest)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and analog to have the commands run after the initialization procedure. Or force the package init inside &lt;code&gt;.emacs&lt;/code&gt; via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;(load-theme 'calmer-forest)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first solution might be more in line with how the startup process is designed, but it should not make a real difference.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-25T10:51:29.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28898" PostTypeId="1" CreationDate="2016-11-25T11:35:32.173" Score="1" ViewCount="171" Body="&lt;p&gt;The package &lt;code&gt;uniquify&lt;/code&gt; has an interesting feature that when visiting two files with the same name, it shows in the mode-line a uniquified version of their name.&#xA;For example if we have two files with the paths &lt;code&gt;.../directory1/file.txt&lt;/code&gt; and &lt;code&gt;.../directory2/file.txt&lt;/code&gt; it shows in the mode-line something like &lt;code&gt;directory1/file.txt&lt;/code&gt; and &lt;code&gt;/directory2/file.txt&lt;/code&gt; not just &lt;code&gt;file.txt&lt;/code&gt;.&#xA;It suffices to put this in the intit file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'uniquify) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this only works in a single instance of emacs.&#xA;Is there any way to have this feature when several instance of emacs are running? I mean how to uniquify the names in all frames and buffers opened in these instances.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-11-25T11:50:37.860" LastActivityDate="2016-11-25T11:50:37.860" Title="How to make buffer file names unique when mutiple instance of emacs are running" Tags="|uniquify|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28899" PostTypeId="2" ParentId="28878" CreationDate="2016-11-25T13:49:45.967" Score="1" Body="&lt;p&gt;The following lisp snippet installs a slight variation of what you want.&#xA;It reverts all buffers that have windows in the current frame.&#xA;So everything what you actually see is reverted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you insist that only the current buffer should be reverted you can change the filter to something like &lt;code&gt;(lambda (buf) (eq (car (window-list)) (get-buffer-window buf)))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;(require 'autorevert)&#xA;&#xA;(defvar auto-revert-some-buffers-filter #'get-buffer-window&#xA;  &quot;Filter for the output of `buffer-list' in `auto-revert-buffers'.&#xA;The function is called with a buffer as argument.&#xA;It should return a non-nil value if this buffer should really be auto-reverted.&quot;)&#xA;&#xA;(defun auto-revert-some-buffers-advice--buffer-list (ret)&#xA;  &quot;Filter output of the first call of `buffer-list' in `auto-revert-buffers'.&#xA;This filter de-installs itself after this call.&quot;&#xA;  (advice-remove #'buffer-list #'auto-revert-some-buffers-advice--buffer-list)&#xA;  (cl-remove-if-not auto-revert-some-buffers-filter ret))&#xA;&#xA;(defun auto-revert-some-buffers-advice (oldfun &amp;amp;rest args)&#xA;  &quot;Filter the buffers to be auto-reverted through `auto-revert-some-buffers-filter' (which see).&quot;&#xA;  (let (ret)&#xA;    (if global-auto-revert-mode&#xA;    (unwind-protect&#xA;        (progn&#xA;          (advice-add #'buffer-list :filter-return #'auto-revert-some-buffers-advice--buffer-list)&#xA;          (setq ret (apply oldfun args)))&#xA;      (advice-remove #'buffer-list #'auto-revert-some-buffers-advice--buffer-list) ;; being over-protective&#xA;      )&#xA;      (let ((old-auto-revert-buffer-list (cl-remove-if-not auto-revert-some-buffers-filter auto-revert-buffer-list))&#xA;        ;; Note: We interpret `auto-revert-remaining-buffers' as transient effect and don't filter this list.&#xA;        deleted-buffers)&#xA;    (let ((auto-revert-buffer-list old-auto-revert-buffer-list))&#xA;      (setq ret (apply oldfun args))&#xA;      (setq deleted-buffers (cl-set-difference old-auto-revert-buffer-list auto-revert-buffer-list)))&#xA;    (setq auto-revert-buffer-list (cl-set-difference auto-revert-buffer-list deleted-buffers))))&#xA;    ret))&#xA;&#xA;(advice-add #'auto-revert-buffers :around #'auto-revert-some-buffers-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An alternative would be to modify &lt;code&gt;auto-revert-buffers&lt;/code&gt;.&#xA;This would only make sense as a feature-request to the package maintainer since there might be incompatible changes in the future development of &lt;code&gt;autorevert&lt;/code&gt;. The following example is based on &lt;code&gt;autorevert.el&lt;/code&gt; shipped with &lt;code&gt;GNU Emacs 25.1.1 (x86_64-unknown-cygwin, GTK+ Version 3.18.9) of 2016-09-17&lt;/code&gt;. The relevant small changes are the introduction of the variable &lt;code&gt;auto-revert-buffer-filter&lt;/code&gt; (should maybe better be a &lt;code&gt;defcustom&lt;/code&gt;) and the insertion of &lt;code&gt;(cl-remove-if-not auto-revert-buffer-filter ...)&lt;/code&gt; into &lt;code&gt;auto-revert-buffers&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl-lib)&#xA;(require 'autorevert)&#xA;&#xA;(defvar auto-revert-buffer-filter #'get-buffer-window&#xA;  &quot;Filter for the output of `buffer-list' in `auto-revert-buffers'.&#xA;The function is called with a buffer as argument.&#xA;It should return a non-nil value if this buffer should really be auto-reverted.&quot;)&#xA;&#xA;(defun auto-revert-buffers ()&#xA;  &quot;Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.&#xA;&#xA;Should `global-auto-revert-mode' be active all file buffers are checked.&#xA;&#xA;Should `auto-revert-mode' be active in some buffers, those buffers&#xA;are checked.&#xA;&#xA;Non-file buffers that have a custom `revert-buffer-function' and&#xA;`buffer-stale-function' are reverted either when Auto-Revert&#xA;Mode is active in that buffer, or when the variable&#xA;`global-auto-revert-non-file-buffers' is non-nil and Global&#xA;Auto-Revert Mode is active.&#xA;&#xA;This function stops whenever there is user input.  The buffers not&#xA;checked are stored in the variable `auto-revert-remaining-buffers'.&#xA;&#xA;To avoid starvation, the buffers in `auto-revert-remaining-buffers'&#xA;are checked first the next time this function is called.&#xA;&#xA;This function is also responsible for removing buffers no longer in&#xA;Auto-Revert mode from `auto-revert-buffer-list', and for canceling&#xA;the timer when no buffers need to be checked.&quot;&#xA;&#xA;  (setq auto-revert-buffers-counter&#xA;        (1+ auto-revert-buffers-counter))&#xA;&#xA;  (save-match-data&#xA;    (let ((bufs (cl-remove-if-not auto-revert-buffer-filter (if global-auto-revert-mode&#xA;            (buffer-list)&#xA;            auto-revert-buffer-list)))&#xA;      remaining new)&#xA;      ;; Partition `bufs' into two halves depending on whether or not&#xA;      ;; the buffers are in `auto-revert-remaining-buffers'.  The two&#xA;      ;; halves are then re-joined with the &quot;remaining&quot; buffers at the&#xA;      ;; head of the list.&#xA;      (dolist (buf auto-revert-remaining-buffers)&#xA;    (if (memq buf bufs)&#xA;        (push buf remaining)))&#xA;      (dolist (buf bufs)&#xA;    (if (not (memq buf remaining))&#xA;        (push buf new)))&#xA;      (setq bufs (nreverse (nconc new remaining)))&#xA;      (while (and bufs&#xA;          (not (and auto-revert-stop-on-user-input&#xA;                (input-pending-p))))&#xA;    (let ((buf (car bufs)))&#xA;          (if (buffer-live-p buf)&#xA;          (with-current-buffer buf&#xA;        ;; Test if someone has turned off Auto-Revert Mode in a&#xA;        ;; non-standard way, for example by changing major mode.&#xA;        (if (and (not auto-revert-mode)&#xA;             (not auto-revert-tail-mode)&#xA;             (memq buf auto-revert-buffer-list))&#xA;            (setq auto-revert-buffer-list&#xA;              (delq buf auto-revert-buffer-list)))&#xA;        (when (auto-revert-active-p)&#xA;          ;; Enable file notification.&#xA;          (when (and auto-revert-use-notify&#xA;                 (not auto-revert-notify-watch-descriptor))&#xA;            (auto-revert-notify-add-watch))&#xA;          (auto-revert-handler)))&#xA;        ;; Remove dead buffer from `auto-revert-buffer-list'.&#xA;        (setq auto-revert-buffer-list&#xA;          (delq buf auto-revert-buffer-list))))&#xA;    (setq bufs (cdr bufs)))&#xA;      (setq auto-revert-remaining-buffers bufs)&#xA;      ;; Check if we should cancel the timer.&#xA;      (when (and (not global-auto-revert-mode)&#xA;         (null auto-revert-buffer-list))&#xA;    (cancel-timer auto-revert-timer)&#xA;    (setq auto-revert-timer nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2016-11-25T17:10:26.773" LastActivityDate="2016-11-25T17:10:26.773" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="28900" PostTypeId="2" ParentId="28892" CreationDate="2016-11-25T15:08:17.563" Score="3" Body="&lt;p&gt;This is similar to &lt;a href=&quot;https://emacs.stackexchange.com/questions/9433/how-to-make-org-prompt-for-a-timestamp-when-changing-state-of-a-todo&quot;&gt;another&lt;/a&gt; question where the goal was to prompt for the date.  Here you just want to use the date under the cursor.  We can basically use the same answer, but we get the date in a different way.  Instead of prompting with &lt;code&gt;org-read-date&lt;/code&gt;, we use &lt;code&gt;org-get-cursor-date&lt;/code&gt;.  With this the &lt;code&gt;CLOSED&lt;/code&gt; property and any logbook entries will be made on whatever date in the agenda you happen to be on when you call &lt;code&gt;org-agenda-todo-view-date&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun org-agenda-todo-view-date (&amp;amp;optional arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((my-current-time (org-get-cursor-date)))&#xA;    (cl-letf* (((symbol-function #'org-current-effective-time)&#xA;                (lambda () my-current-time))&#xA;               ((symbol-function #'org-today)&#xA;                (lambda () (time-to-days (org-current-effective-time)))))&#xA;      (let ((current-prefix-arg arg))&#xA;        (call-interactively 'org-agenda-todo)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the function responsible for updating schedules, &lt;code&gt;org-auto-repeat-maybe&lt;/code&gt;, uses &lt;code&gt;org-today&lt;/code&gt; to get the date instead of &lt;code&gt;org-current-effective-time&lt;/code&gt; (which &lt;code&gt;org-today&lt;/code&gt; apparently does not call) so we modify it as well to match.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2016-11-27T23:54:23.393" LastActivityDate="2016-11-27T23:54:23.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28902" PostTypeId="2" ParentId="28893" CreationDate="2016-11-25T16:01:57.517" Score="0" Body="&lt;p&gt;Thanks for the tips. With TPU I had omitted the (require 'tpu-edt) line since in Emacs 23.1.1 it didn't seem to be needed. Now though with version 25.1 I'm using both lines below in my .emacs file and it works great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(require 'tpu-edt)&#xA;(tpu-edt-on)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll try contact some of the emacs folks about future support, perhaps John Wiegley? TPU works much better for me than the direct edt emulation.&lt;/p&gt;&#xA;" OwnerUserId="14086" LastActivityDate="2016-11-25T16:01:57.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28903" PostTypeId="2" ParentId="26179" CreationDate="2016-11-25T16:49:50.307" Score="11" Body="&lt;p&gt;I'm doing mainly tables with the latex packages &lt;code&gt;#+LaTeX_HEADER: \usepackage{booktabs}&lt;/code&gt;, &lt;code&gt;\usepackage{xcolor}&lt;/code&gt;, &lt;code&gt;\usepackage{colortbl}&lt;/code&gt; and &lt;code&gt;\usepackage{siunitx}&lt;/code&gt;.  Together with export attributes.  For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA; #+LATEX: \definecolor{contiYellow}{RGB}{255,165,0}&#xA; #+LATEX: \rowcolors[]{2}{contiYellow!5}{contiYellow!20}&#xA; #+ATTR_LATEX: :align rS&#xA;| *Type*                                     | *Stiffness* in N/mm |&#xA;|--------------------------------------------+---------------------|&#xA;| Two bearings SKF in radial dir. (supplier) |              167800 |&#xA;| Measurement bearings + rotor + device      |                8398 |&#xA;| Measurement device                         |               14753 |&#xA;| Calculation rotor + bearings               |               19500 |&#xA;|--------------------------------------------+---------------------|&#xA;| Sim. Rotor + &quot;bearings&quot; (package solid)    |               50900 |&#xA;| Sim. Rotor + &quot;joints&quot; (package solid)      |               33320 |&#xA;| Sim. Shaft + &quot;bearings&quot; (without package)  |               12000 |&#xA;| Sim. Shaft + &quot;bearings&quot; 10 mm              |               20030 |&#xA; #+TBLFM: @2$2=2*8.39e4&#xA;&lt;/code&gt;&#xA;gives me&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GdrxV.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GdrxV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2017-02-27T11:56:04.347" LastActivityDate="2017-02-27T11:56:04.347" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28904" PostTypeId="2" ParentId="19560" CreationDate="2016-11-25T18:02:26.470" Score="3" Body="&lt;p&gt;I highly recommend org-download&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/org-download&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/org-download&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;its also very configurable and you can specify where to save the file, size etc&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-11-25T18:02:26.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28905" PostTypeId="1" AcceptedAnswerId="28923" CreationDate="2016-11-25T18:14:37.563" Score="3" ViewCount="1036" Body="&lt;p&gt;a weird question. I want to be able to color specific days in different background in the &lt;em&gt;Org-agenda&lt;/em&gt; buffer (created with org-agenda-list). I want it to be lets say every Monday and Wednesday. The aim is to get a nice visual queue to not schedule meeting during theses days so i can focus on actual work :). Ideally i would like the day header and all the time slots to get a different background on these specific days.&#xA;any clue if that's possible?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11387" LastEditDate="2016-11-26T05:31:24.137" LastActivityDate="2016-11-27T00:31:35.527" Title="color specific days in different background in org agenda" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28906" PostTypeId="1" AcceptedAnswerId="28916" CreationDate="2016-11-25T19:22:22.607" Score="38" ViewCount="21930" Body="&lt;p&gt;Those sounds all the way drive me crazy, but it is uncomfortable to switch off system sounds at all because I need them in other places same time. I didn't find any settings where I could manage the sounds.&lt;/p&gt;&#xA;" OwnerUserId="13321" LastEditorUserId="2418" LastEditDate="2019-12-10T00:59:45.723" LastActivityDate="2023-08-12T22:38:32.767" Title="How to switch off the sounds?" Tags="|bell|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="28909" PostTypeId="1" AcceptedAnswerId="28924" CreationDate="2016-11-25T21:18:34.680" Score="14" ViewCount="6332" Body="&lt;p&gt;In function &quot;shell&quot; this line display shell buffer and almost always its open new shell in random frame. And I have to swap the buffers, it's annoying.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;(pop-to-buffer buffer)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In docs says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If that window is on a different graphical frame, that frame is given&#xA;  input focus if possible.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't understand how I can display buffer in target frame, I'm not good enough in elisp. How I can do that? Thanks if someone could help.&lt;/p&gt;&#xA;" OwnerUserId="11847" LastActivityDate="2022-06-20T16:42:07.530" Title="How i can open shell in current buffer?" Tags="|frames|shell|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28910" PostTypeId="1" CreationDate="2016-11-25T21:25:02.350" Score="1" ViewCount="52" Body="&lt;p&gt;I wrote a function that pastes in the currently selected color from the palette to the buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun palette-paste-in-current-color ()&#xA;  (interactive)&#xA;  (cua-paste (palette-current-rgb-to-kill-ring)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wrote a function that calls the palette from the current content of the kill ring (RGB content):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun palette-launch-from-kill-ring ()&#xA;  (interactive)&#xA;  (palette (concat &quot;#&quot; (substring-no-properties (car kill-ring)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought it would be handy to just move the point to an rgb color in a buffer, then use &lt;code&gt;expand-region&lt;/code&gt; followed by &lt;code&gt;cua-copy-region&lt;/code&gt; to automate the process. So I wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun palette-launch-from-kill-ring ()&#xA;  (interactive)&#xA;  (er/expand-region)&#xA;  (cua-copy-region)&#xA;  (palette (concat &quot;#&quot; (substring-no-properties (car kill-ring)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get an error and I am puzzled on how to run these functions one after another successfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error I get is (can't decipher what is going on here):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Wrong number of arguments: #[(ad--addoit-function arg) &quot;Ä        Å &#xA;!)&quot; [ad-return-value rectangular-region-mode ad--addoit-function arg nil rrm/switch-to-multiple-cursors] 3], 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13180" LastEditorUserId="13180" LastEditDate="2016-11-26T08:16:21.687" LastActivityDate="2016-11-26T08:16:21.687" Title="Launch functions one after another" Tags="|region|kill-ring|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28911" PostTypeId="1" CreationDate="2016-11-25T22:12:25.023" Score="4" ViewCount="2524" Body="&lt;p&gt;I'm cant set org-agenda to start a week on other day that isn't sunday. &lt;/p&gt;&#xA;" OwnerUserId="13992" LastActivityDate="2018-05-27T10:59:36.227" Title="how I can set the org-agenda to start my week on monday?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28912" PostTypeId="1" CreationDate="2016-11-25T22:44:16.817" Score="1" ViewCount="399" Body="&lt;h2&gt;Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Some versions of &lt;code&gt;diff&lt;/code&gt; (notably, &lt;code&gt;busybox diff&lt;/code&gt; in every build of BusyBox I've seen) only produce &quot;unified&quot; diff format output, they don't produce the output that GNU &lt;code&gt;diff&lt;/code&gt; produces by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to run &lt;code&gt;diff-refine-hunk&lt;/code&gt; in a &lt;code&gt;vc-diff&lt;/code&gt; buffer (&lt;code&gt;git&lt;/code&gt; repository, if that matters), it fails, and prints the following error in the minibuffer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unexpected patch hunk header: --- /tmp/diff*&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Where the asterisk is some number of randomly generated characters, obviously.)&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can get &lt;code&gt;diff-refine-hunk&lt;/code&gt; to handle a &lt;code&gt;diff-command&lt;/code&gt; whose output is always just unified diffs?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Detailed Example&lt;/h2&gt;&#xA;&#xA;&lt;h3&gt;Steps&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I start with this dummy file, version-controlled in git:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;00 00&#xA;11 11&#xA;22 22&#xA;33 33&#xA;55 55&#xA;66 66&#xA;77 77&#xA;88 88&#xA;99 99&#xA;bb bb&#xA;cc cc&#xA;dd dd&#xA;ee ee&#xA;ff ff&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I edit/replace it with this, and save it to disk (but don't stage/commit in git):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;00 00&#xA;22 22&#xA;33 33&#xA;44 44&#xA;55 55&#xA;66 66&#xA;7x 77&#xA;88 x8&#xA;99 99&#xA;aa aa&#xA;bx bb&#xA;dd dd&#xA;ex ee&#xA;ff ff&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;vc-diff&lt;/code&gt; with &lt;code&gt;C-x v =&lt;/code&gt;, so far so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;diff-refine-hunk&lt;/code&gt; with &lt;code&gt;C-c C-b&lt;/code&gt;. And if the invoked diff command is BusyBox &lt;code&gt;diff&lt;/code&gt; (or GNU &lt;code&gt;diff&lt;/code&gt; with the &lt;code&gt;-u&lt;/code&gt; option) it fails with the &quot;Unexpected patch hunk header&quot; error. If the diff command is just regular GNU &lt;code&gt;diff&lt;/code&gt; without the default output, it works fine.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Example Output &lt;code&gt;emacs&lt;/code&gt; sees from various &lt;code&gt;diff&lt;/code&gt;s&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From what I've gathered since I first posted this, &lt;code&gt;diff-refine-hunk&lt;/code&gt; runs &lt;code&gt;diff-command&lt;/code&gt; on several temporary files (one for each hunk?), and parses the output from each to refine the hunks. What follows are the output &lt;code&gt;diff-command&lt;/code&gt; produces for one of those hunks (the one with the &quot;77&quot; and &quot;88&quot; 'words'). In the case of the failure cases, this hunk is the one &lt;code&gt;diff-refine-hunk&lt;/code&gt; stops at (in the success case, it keeps calling &lt;code&gt;diff-command&lt;/code&gt; on other hunks).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;GNU &lt;code&gt;diff&lt;/code&gt; output&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;When called by &lt;code&gt;diff-refine-hunk&lt;/code&gt; in the setup above, this isthe output of GNU &lt;code&gt;diff&lt;/code&gt; (normal, successful case):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2,3c2,3&#xA;&amp;lt; 77&#xA;&amp;lt; 77&#xA;---&#xA;&amp;gt; 7&#xA;&amp;gt; x&#xA;12,13c12,13&#xA;&amp;lt; 88&#xA;&amp;lt; 88&#xA;---&#xA;&amp;gt; x&#xA;&amp;gt; 8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;GNU &lt;code&gt;diff -u&lt;/code&gt; output&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;When called by &lt;code&gt;diff-refine-hunk&lt;/code&gt; in the setup above, this is the output of GNU &lt;code&gt;diff -u&lt;/code&gt; (failure case):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--- /tmp/diff122272NoN  2016-11-26 00:43:54.796744201 +0000&#xA;+++ /tmp/diff222272ayT  2016-11-26 00:43:54.832744689 +0000&#xA;@@ -1,6 +1,6 @@&#xA; -&#xA;-77&#xA;-77&#xA;+7&#xA;+x&#xA;&#xA; 77&#xA; 77&#xA;@@ -9,6 +9,6 @@&#xA; 88&#xA; 88&#xA;&#xA;-88&#xA;-88&#xA;+x&#xA;+8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;BusyBox &lt;code&gt;diff&lt;/code&gt; output&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;When called by &lt;code&gt;diff-refine-hunk&lt;/code&gt; in the setup above, this is the output of Busybox &lt;code&gt;diff&lt;/code&gt; (failure case - same output except no datetime in header):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--- /tmp/diff122272bly&#xA;+++ /tmp/diff222272NvB&#xA;@@ -1,6 +1,6 @@&#xA; -&#xA;-77&#xA;-77&#xA;+7&#xA;+x&#xA;&#xA; 77&#xA; 77&#xA;@@ -9,6 +9,6 @@&#xA; 88&#xA; 88&#xA;&#xA;-88&#xA;-88&#xA;+x&#xA;+8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;How I captured the above outputs&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I created a script like this and pointed &lt;code&gt;diff-command&lt;/code&gt; in emacs to it to test each variant and capture the outputs of each background run of diff (unlike a prior edit to this question, this script captures each &lt;code&gt;diff-command&lt;/code&gt; run in a separate file, since &lt;code&gt;diff-refine-hunk&lt;/code&gt; can call the diff backend program multiple times.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;exec busybox diff &quot;$@&quot; | tee &quot;`mktemp /tmp/busybox_diff.XXXXXX`&quot;&#xA;#exec diff -u &quot;$@&quot; | tee &quot;`mktemp /tmp/gnu_diff-u.XXXXXX`&quot;&#xA;#exec diff &quot;$@&quot; | tee &quot;`mktemp /tmp/gnu_diff.XXXXXX`&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Question - Re-Worded&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get &lt;code&gt;diff-refine-hunk&lt;/code&gt; to work correctly when the underlying diff command that it calls in the background on temporary files always produces output in that unified format?&lt;/p&gt;&#xA;" OwnerUserId="13754" LastEditorUserId="13754" LastEditDate="2016-11-28T05:45:27.820" LastActivityDate="2016-12-14T03:56:00.893" Title="diff-refine-hunk with unified diff" Tags="|diff|vc|diff-mode|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28913" PostTypeId="2" ParentId="28911" CreationDate="2016-11-25T22:51:41.513" Score="3" Body="&lt;p&gt;As @ebpa comment set variable set custom variable via: &lt;code&gt;M-x customize-variable&lt;/code&gt; and then &lt;code&gt;org-agenda-start-on-weekday&lt;/code&gt; to set the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you have other methods.&lt;/p&gt;&#xA;" OwnerUserId="13992" LastActivityDate="2016-11-25T22:51:41.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28914" PostTypeId="1" AcceptedAnswerId="44095" CreationDate="2016-11-25T23:17:46.913" Score="13" ViewCount="17575" Body="&lt;p&gt;Is there a spacemacs command that both closes the window and kills the buffer? In other words, the equivalent of Vim's &lt;code&gt;:q&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="13650" LastActivityDate="2019-12-10T10:38:01.147" Title="Spacemacs: kill buffer and kill window in one command?" Tags="|buffers|spacemacs|files|" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28915" PostTypeId="1" CreationDate="2016-11-26T00:32:46.780" Score="2" ViewCount="223" Body="&lt;p&gt;I often use the web service Kobra.io, in which we can edit a specific file with some people together at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there such a package on Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to edit a specific lisp code at the same time with some people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I change some parts in the code, the other people can see the change at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you tell me how to implement this function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd appreciate your help.&lt;/p&gt;&#xA;" OwnerUserId="12815" LastActivityDate="2020-03-26T15:28:57.350" Title="Coedit mode on Emacs" Tags="|package|package-development|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28916" PostTypeId="2" ParentId="28906" CreationDate="2016-11-26T00:34:34.040" Score="37" Body="&lt;p&gt;Turn off the bell, use the visual bell instead, or replace bell-ringing by some other visual indication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set &lt;code&gt;ring-bell-function&lt;/code&gt; to a function such as &lt;code&gt;ignore&lt;/code&gt;, to just turn off all indication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can customize option &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Display-Custom.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;visible-bell&lt;/code&gt;&lt;/a&gt;, to use a frame flash instead of a sound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can use minor mode &lt;code&gt;echo-bell-mode&lt;/code&gt; from library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/echo-bell.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;echo-bell.el&lt;/code&gt;&lt;/a&gt; to get just a brief visual indication in the echo area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Beeping.html&quot; rel=&quot;noreferrer&quot;&gt;Beeping&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-11-26T15:32:32.393" LastActivityDate="2016-11-26T15:32:32.393" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="28918" PostTypeId="1" AcceptedAnswerId="28921" CreationDate="2016-11-26T03:34:18.530" Score="6" ViewCount="1789" Body="&lt;p&gt;When writing elisp for evil mode, how can you check the currently active evil state?&lt;br&gt;(&lt;code&gt;normal&lt;/code&gt;, &lt;code&gt;visual&lt;/code&gt;, &lt;code&gt;insert&lt;/code&gt;... etc)&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="105" LastEditDate="2016-11-26T04:21:37.277" LastActivityDate="2017-08-29T05:14:57.003" Title="How to check the current state in evil mode?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28919" PostTypeId="2" ParentId="28915" CreationDate="2016-11-26T03:55:59.080" Score="1" Body="&lt;p&gt;There's &lt;code&gt;rudel&lt;/code&gt;, available on GNU ELPA, which intends to do that (it supports various protocols of communication between the various Emacs sessions).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-26T03:55:59.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28920" PostTypeId="1" AcceptedAnswerId="28934" CreationDate="2016-11-26T04:01:25.340" Score="4" ViewCount="782" Body="&lt;p&gt;I am using emacs with org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to number a column in a table in hex.&#xA;E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 0x00 | xyz | .. |&#xA;| 0x01 | abc | .. |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to auto generate first column.&#xA;Any ideas how to do this in org mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to generate a list of numbers/alphabets etc. (in hex, decimal) in emacs (need not be org mode)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS&lt;/strong&gt;: Please let me know if there are any linux/bash tricks to do this.&lt;/p&gt;&#xA;" OwnerUserId="14095" LastEditorUserId="14825" LastEditDate="2022-11-05T01:11:26.293" LastActivityDate="2022-11-05T01:11:26.293" Title="How to generate list of hex numbers?" Tags="|org-mode|linux|column|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28921" PostTypeId="2" ParentId="28918" CreationDate="2016-11-26T05:44:54.823" Score="11" Body="&lt;p&gt;The state can be accessed via &lt;code&gt;evil-state&lt;/code&gt;, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cond&#xA; ((eq evil-state 'visual) (do-something))&#xA; ((eq evil-state 'normal) (do-other-thing))&#xA; ((eq evil-state 'insert) (do-another-thing)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="10" LastEditDate="2017-08-29T05:14:57.003" LastActivityDate="2017-08-29T05:14:57.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28922" PostTypeId="1" CreationDate="2016-11-26T06:09:20.387" Score="0" ViewCount="129" Body="&lt;p&gt;weird issues. when i restart emacs it usually starts up pretty fast. BUT any small change i make to my config file makes emacs have a delay of 90-150 seconds each time. im using a org based config and this is what my init.el looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ;;; init.el --- Where all the magic begins&#xA;;;&#xA;;; This file loads Org-mode and then loads the rest of our Emacs initialization from Emacs lisp&#xA;;; embedded in literate Org-mode files.&#xA;;; Load up Org Mode and (now included) Org Babel for elisp embedded in Org Mode files&#xA;&#xA;&#xA;(require 'package)&#xA;&#xA;;since we are using use-package-don't autoload anythings&#xA;(setq package-enable-at-startup nil)&#xA;&#xA;&#xA;(add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;;; org maybe suspect of hanging melpa, if you have hangs disable this first&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))&#xA;;; Initialize installed package&#xA;(package-initialize)  &#xA;&#xA;;; Bootstrap `use-package'&#xA;;(unless (package-installed-p 'use-package)&#xA;;  (package-refresh-contents)&#xA;;  (package-install 'use-package))&#xA;&#xA;(require 'use-package)&#xA;&#xA;;;; org babel magic happens here&#xA;(require 'org)&#xA;(org-babel-load-file&#xA;(expand-file-name &quot;settings.org&quot;&#xA;                   user-emacs-directory))&#xA;&#xA;;; init.el ends here&#xA;&#xA;(put 'dired-find-alternate-file 'disabled nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;again after a successful emacs start i can kill it and quickly restart emacs but any change to my &lt;code&gt;setting.org&lt;/code&gt; file (the actual config being tangles) creates this huge delay&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i have tried binary partitioning of the settings.org file with no success which makes me think its not a conf issue&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: i will add that when i launch emacs from the CLI it seems to be stuck at the point where it says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;│Warning: due to a long standing Gtk+ bug&#xA;│http://bugzilla.gnome.org/show_bug.cgi?id=85715&#xA;│Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lo&#xA;│Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that part halts for a good 2-3 minutes and then it dives into tangeling and i get all the messages like&#xA;&lt;code&gt;&#xA;Wrote /home/zeltak/.emacs.d/settings.el&#xA;&lt;/code&gt;&#xA;any clue?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11387" LastEditDate="2016-11-27T07:02:45.310" LastActivityDate="2016-11-27T07:02:45.310" Title="any change in my init config delays emacs start by 90-150 seconds" Tags="|init-file|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28923" PostTypeId="2" ParentId="28905" CreationDate="2016-11-26T06:56:31.830" Score="5" Body="&lt;p&gt;The following is a custom function, set with the built-in variable &lt;code&gt;org-agenda-day-face-function&lt;/code&gt;, that controls the colors of the date header in the &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer generated by calling &lt;code&gt;org-agenda-list&lt;/code&gt;.  In the context of the function &lt;code&gt;calendar-day-of-week&lt;/code&gt;, Monday is &lt;code&gt;1&lt;/code&gt; and Wednesday is &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If another forum participant would like to tackle the entries that appear underneath this date header, please feel free to write up an alternative answer.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-agenda-get-day-face-fn (date)&#xA;&quot;Return the face DATE should be displayed with.&quot;&#xA;  (let ((day-of-week (calendar-day-of-week date)))&#xA;    (cond&#xA;      ((or (= day-of-week 1) (= day-of-week 3))&#xA;        '(:background &quot;red&quot;))&#xA;      ((org-agenda-todayp date)&#xA;        'org-agenda-date-today)&#xA;      ((member day-of-week org-agenda-weekend-days)&#xA;        'org-agenda-date-weekend)&#xA;      (t 'org-agenda-date))))&#xA;&#xA;(setq org-agenda-day-face-function 'my-org-agenda-get-day-face-fn)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-27T00:31:35.527" LastActivityDate="2016-11-27T00:31:35.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28924" PostTypeId="2" ParentId="28909" CreationDate="2016-11-26T07:45:26.170" Score="6" Body="&lt;p&gt;I am assuming that the original poster means targeting the currently selected window in the same frame.  In the event the original poster is desirous of targeting a specific window in a different frame, then see this related thread for a complex example:  &lt;a href=&quot;https://stackoverflow.com/questions/18346785/how-to-intercept-a-file-before-it-opens-and-decide-which-frame&quot;&gt;https://stackoverflow.com/questions/18346785/how-to-intercept-a-file-before-it-opens-and-decide-which-frame&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I copied the built-in function &lt;code&gt;shell&lt;/code&gt; and created a new one called &lt;code&gt;shell-get-buffer-create&lt;/code&gt;, which uses &lt;code&gt;with-current-buffer ...&lt;/code&gt; instead of &lt;code&gt;pop-to-buffer&lt;/code&gt;.  This new function generates or locates the &lt;code&gt;*shell*&lt;/code&gt; buffer without selecting it in any window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To display the &lt;code&gt;*shell*&lt;/code&gt; buffer in the currently selected window use:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(switch-to-buffer (shell-get-buffer-create))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(pop-to-buffer-same-window (shell-get-buffer-create))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(set-window-buffer (selected-window) (shell-get-buffer-create))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I created a custom function called &lt;code&gt;my-display-buffer&lt;/code&gt; that can display in four directions -- left, right, above, or below.  There are three possibilities:  (1) If a window on the frame already displays the target buffer, then just reuse the same window.  (2) If there is already a window in the specified direction in relation to the selected window, then display the target buffer in said window.  (3) If there is no window in the specified direction, then create one in that direction and display the target buffer in said window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Sample Usage&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(my-display-buffer (shell-get-buffer-create) nil 'left)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(my-display-buffer (shell-get-buffer-create) nil 'right)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(my-display-buffer (shell-get-buffer-create) nil 'above)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(my-display-buffer (shell-get-buffer-create) nil 'below)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Code&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'shell)&#xA;&#xA;(defun shell-get-buffer-create (&amp;amp;optional buffer)&#xA;  &quot;Run an inferior shell, with I/O through BUFFER (which defaults to `*shell*').&#xA;Interactively, a prefix arg means to prompt for BUFFER.&#xA;If `default-directory' is a remote file name, it is also prompted&#xA;to change if called with a prefix arg.&#xA;&#xA;If BUFFER exists but shell process is not running, make new shell.&#xA;If BUFFER exists and shell process is running, just switch to BUFFER.&#xA;Program used comes from variable `explicit-shell-file-name',&#xA; or (if that is nil) from the ESHELL environment variable,&#xA; or (if that is nil) from `shell-file-name'.&#xA;If a file `~/.emacs_SHELLNAME' exists, or `~/.emacs.d/init_SHELLNAME.sh',&#xA;it is given as initial input (but this may be lost, due to a timing&#xA;error, if the shell discards input when it starts up).&#xA;The buffer is put in Shell mode, giving commands for sending input&#xA;and controlling the subjobs of the shell.  See `shell-mode'.&#xA;See also the variable `shell-prompt-pattern'.&#xA;&#xA;To specify a coding system for converting non-ASCII characters&#xA;in the input and output to the shell, use \\[universal-coding-system-argument]&#xA;before \\[shell].  You can also specify this with \\[set-buffer-process-coding-system]&#xA;in the shell buffer, after you start the shell.&#xA;The default comes from `process-coding-system-alist' and&#xA;`default-process-coding-system'.&#xA;&#xA;The shell file name (sans directories) is used to make a symbol name&#xA;such as `explicit-csh-args'.  If that symbol is a variable,&#xA;its value is used as a list of arguments when invoking the shell.&#xA;Otherwise, one argument `-i' is passed to the shell.&#xA;&#xA;\(Type \\[describe-mode] in the shell buffer for a list of commands.)&quot;&#xA;  (interactive&#xA;   (list&#xA;    (and current-prefix-arg&#xA;   (prog1&#xA;       (read-buffer &quot;Shell buffer: &quot;&#xA;        ;; If the current buffer is an inactive&#xA;        ;; shell buffer, use it as the default.&#xA;        (if (and (eq major-mode 'shell-mode)&#xA;           (null (get-buffer-process (current-buffer))))&#xA;            (buffer-name)&#xA;          (generate-new-buffer-name &quot;*shell*&quot;)))&#xA;     (if (file-remote-p default-directory)&#xA;         ;; It must be possible to declare a local default-directory.&#xA;               ;; FIXME: This can't be right: it changes the default-directory&#xA;               ;; of the current-buffer rather than of the *shell* buffer.&#xA;         (setq default-directory&#xA;         (expand-file-name&#xA;          (read-directory-name&#xA;           &quot;Default directory: &quot; default-directory default-directory&#xA;           t nil))))))))&#xA;  (setq buffer (if (or buffer (not (derived-mode-p 'shell-mode))&#xA;                       (comint-check-proc (current-buffer)))&#xA;                   (get-buffer-create (or buffer &quot;*shell*&quot;))&#xA;                 ;; If the current buffer is a dead shell buffer, use it.&#xA;                 (current-buffer)))&#xA;&#xA;  ;; On remote hosts, the local `shell-file-name' might be useless.&#xA;  (if (and (called-interactively-p 'any)&#xA;     (file-remote-p default-directory)&#xA;     (null explicit-shell-file-name)&#xA;     (null (getenv &quot;ESHELL&quot;)))&#xA;      (with-current-buffer buffer&#xA;  (set (make-local-variable 'explicit-shell-file-name)&#xA;       (file-remote-p&#xA;        (expand-file-name&#xA;         (read-file-name&#xA;    &quot;Remote shell path: &quot; default-directory shell-file-name&#xA;    t shell-file-name))&#xA;        'localname))))&#xA;&#xA;  ;; The buffer's window must be correctly set when we call comint (so&#xA;  ;; that comint sets the COLUMNS env var properly).&#xA;  (with-current-buffer buffer&#xA;    (unless (comint-check-proc buffer)&#xA;      (let* ((prog (or explicit-shell-file-name&#xA;           (getenv &quot;ESHELL&quot;) shell-file-name))&#xA;       (name (file-name-nondirectory prog))&#xA;       (startfile (concat &quot;~/.emacs_&quot; name))&#xA;       (xargs-name (intern-soft (concat &quot;explicit-&quot; name &quot;-args&quot;))))&#xA;        (unless (file-exists-p startfile)&#xA;    (setq startfile (concat user-emacs-directory &quot;init_&quot; name &quot;.sh&quot;)))&#xA;        (apply 'make-comint-in-buffer &quot;shell&quot; buffer prog&#xA;         (if (file-exists-p startfile) startfile)&#xA;         (if (and xargs-name (boundp xargs-name))&#xA;       (symbol-value xargs-name)&#xA;           '(&quot;-i&quot;)))&#xA;        (shell-mode))))&#xA;  buffer)&#xA;&#xA;(defun my-display-buffer (buffer alist direction &amp;amp;optional size pixelwise)&#xA;&quot;BUFFER:  The buffer that will be displayed.&#xA;ALIST:  See the doc-string of `display-buffer' for more information.&#xA;DIRECTION:  Must use one of these symbols:  'left 'right 'below 'above&#xA;SIZE:  See the doc-string for `split-window'.&#xA;PIXELWISE:  See the doc-string for `split-window'.&#xA;There are three possibilities:&#xA;-  (1) If a window on the frame already displays the target buffer,&#xA;then just reuse the same window.&#xA;-  (2) If there is already a window in the specified direction in relation&#xA;to the selected window, then display the target buffer in said window.&#xA;-  (3) If there is no window in the specified direction, then create one&#xA;in that direction and display the target buffer in said window.&quot;&#xA;  (let ((window&#xA;          (cond&#xA;            ((get-buffer-window buffer (selected-frame)))&#xA;            ((window-in-direction direction))&#xA;            (t&#xA;              (split-window (selected-window) size direction pixelwise)))))&#xA;    (window--display-buffer buffer window 'window alist display-buffer-mark-dedicated)&#xA;    window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And, here is an &lt;code&gt;eshell-get-buffer-create&lt;/code&gt; that works the same as above ...&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl)&#xA;(require 'eshell)&#xA;&#xA;(defun eshell-get-buffer-create (&amp;amp;optional arg)&#xA;&quot;Create an interactive Eshell buffer.  Return the Eshell buffer,&#xA;creating it if needed.  The buffer used for Eshell sessions is&#xA;determined by the value of `eshell-buffer-name'.  A numeric prefix&#xA;arg (as in `C-u 42 M-x eshell RET') switches to the session with&#xA;that number, creating it if necessary.  A nonnumeric prefix arg&#xA;means to createa new session.  Returns the buffer selected (or created).&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (cl-assert eshell-buffer-name)&#xA;  (let ((buf (cond ((numberp arg)&#xA;        (get-buffer-create (format &quot;%s&amp;lt;%d&amp;gt;&quot;&#xA;                 eshell-buffer-name&#xA;                 arg)))&#xA;       (arg&#xA;        (generate-new-buffer eshell-buffer-name))&#xA;       (t&#xA;        (get-buffer-create eshell-buffer-name)))))&#xA;    (cl-assert (and buf (buffer-live-p buf)))&#xA;    (with-current-buffer buf&#xA;      (unless (derived-mode-p 'eshell-mode)&#xA;        (eshell-mode)))&#xA;    buf))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2018-10-23T04:56:38.387" LastActivityDate="2018-10-23T04:56:38.387" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28925" PostTypeId="2" ParentId="14245" CreationDate="2016-11-26T09:48:23.913" Score="10" Body="&lt;p&gt;Add the follows to your init file and use &lt;code&gt;M-x man&lt;/code&gt; or the &lt;code&gt;man&lt;/code&gt; command in eshell to view man pages: (the colors fits the &lt;code&gt;wombat&lt;/code&gt; theme; you can change them for yourself)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'man)&#xA;(set-face-attribute 'Man-overstrike nil :inherit 'bold :foreground &quot;orange red&quot;)&#xA;(set-face-attribute 'Man-underline nil :inherit 'underline :foreground &quot;forest green&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or to be theme agnostic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'man)&#xA;(set-face-attribute 'Man-overstrike nil :inherit font-lock-type-face :bold t)&#xA;(set-face-attribute 'Man-underline nil :inherit font-lock-keyword-face :underline t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/92046.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/92046.png&quot; alt=&quot;screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2755" LastEditorUserId="2755" LastEditDate="2016-11-26T19:41:31.560" LastActivityDate="2016-11-26T19:41:31.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28926" PostTypeId="2" ParentId="28920" CreationDate="2016-11-26T10:34:28.770" Score="2" Body="&lt;p&gt;This is a partial answer to question 2 -- how generate a list of hex numbers -- based on keyboard macros and calc.&lt;/p&gt;&#xA;&lt;h1&gt;Prepare Calc&lt;/h1&gt;&#xA;&lt;p&gt;Set calc to display in radix 16.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x * c d r 16 RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Optional: Hide the calc buffers by pressing q.&lt;/p&gt;&#xA;&lt;h1&gt;Record a suitable Macro&lt;/h1&gt;&#xA;&lt;p&gt;E.g. do this&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;f3 f3 M-b C-x * w C-x * w C-e RET f4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h1&gt;Use the Macro&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;f4 f4 ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Or do e.g.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-u 256 f4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h1&gt;Beautification Hint&lt;/h1&gt;&#xA;&lt;p&gt;Search and replace may be used to change the format of the list.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastEditorUserId="8943" LastEditDate="2021-08-29T17:19:58.080" LastActivityDate="2021-08-29T17:19:58.080" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28927" PostTypeId="2" ParentId="19385" CreationDate="2016-11-26T11:08:42.310" Score="9" Body="&lt;p&gt;You can use this to exit from your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-current-buffer &quot; *load*&quot;&#xA;  (goto-char (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs uses the &lt;code&gt;load&lt;/code&gt; function to execute lisp file through a temporary buffer, that's &lt;code&gt;&quot; *load*&quot;&lt;/code&gt;, if the name is not already taken. The above code moves the point to the end of the buffer, thus the &lt;code&gt;read&lt;/code&gt; function will not read further code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the last sexp of &lt;code&gt;foo.el&lt;/code&gt; is unbalanced, but there is no error when running it, since Emacs can't go that far, it exits early:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~$ cat foo.el &#xA;(message &quot;Loading %s...&quot; load-file-name)&#xA;&#xA;(with-current-buffer &quot; *load*&quot;&#xA;  (goto-char (point-max)))&#xA;&#xA;(this line does not matter&#xA;~$ emacs --batch --load foo.el&#xA;Loading /home/xcy/foo.el...&#xA;~$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-26T11:08:42.310" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28929" PostTypeId="2" ParentId="28817" CreationDate="2016-11-26T12:11:21.560" Score="0" Body="&lt;p&gt;After install the package you should launch &lt;code&gt;M-x auto-package-update-now&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Remove your setting then &lt;code&gt;M-x package-install org-agenda-property&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then follow the Dropbox information &lt;a href=&quot;https://www.emacswiki.org/emacs/DropBox&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Wiki dropbox&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It explain how&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(add-to-list 'auto-save-file-name-transforms '(&amp;quot;\`.&lt;em&gt;/Dropbox/.&lt;/em&gt;&amp;quot; &amp;quot;/tmp/&amp;quot; t))&lt;/p&gt;&#xA;&lt;p&gt;(add-to-list 'backup-directory-alist '(&amp;quot;\`.&lt;em&gt;/Dropbox/.&lt;/em&gt;&amp;quot; . &amp;quot;/tmp/&amp;quot;))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11664" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-11-26T12:11:21.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28932" PostTypeId="1" AcceptedAnswerId="28933" CreationDate="2016-11-26T13:21:53.900" Score="14" ViewCount="9953" Body="&lt;p&gt;My &lt;code&gt;~/.emacs&lt;/code&gt; (which you can find &lt;a href=&quot;https://github.com/fusion809/emacs/blob/master/.emacs&quot; rel=&quot;noreferrer&quot;&gt;on GitHub&lt;/a&gt;) file loads several different Emacs packages and I would like them to be automatically installed as soon as Emacs starts up, if they are not already installed. This way if I have to reinstall my Ubuntu 16.04 operating system again I will not have to install each package myself manually using &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;package-install&lt;/code&gt;. Is there a way to write an &lt;code&gt;~/.emacs&lt;/code&gt; file so that it will automatically install all loaded packages on startup? I would like this to be done with the minimum of lines as I have over ten different packages loaded so if I have to add extra lines for each individual package it will make my &lt;code&gt;~/.emacs&lt;/code&gt; rather long.&lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="16543" LastEditDate="2019-04-14T19:23:14.040" LastActivityDate="2019-04-14T19:23:14.040" Title="How to automate installation of packages with .emacs file?" Tags="|init-file|package|install|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="28933" PostTypeId="2" ParentId="28932" CreationDate="2016-11-26T14:38:01.373" Score="14" Body="&lt;p&gt;The easiest way is to install &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;use-package&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(package-initialize)&#xA;(require 'package)&#xA;(add-to-list 'package-archives&#xA;    '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;&#xA;(dolist (package '(use-package))&#xA;   (unless (package-installed-p package)&#xA;       (package-install package)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (use-package paredit&#xA;   :ensure t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:ensure t&lt;/code&gt; is what ensures that the package is installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To just load ensure multiple packages are install&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (package '(package-a package-b package-c))&#xA; (unless (package-installed-p package)&#xA;   (package-install package))&#xA;   (require package))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12888" LastEditorUserId="105" LastEditDate="2017-07-04T16:02:10.400" LastActivityDate="2017-07-04T16:02:10.400" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="28934" PostTypeId="2" ParentId="28920" CreationDate="2016-11-26T14:41:07.773" Score="4" Body="&lt;p&gt;Following is a method using an elisp formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| hex  | comment |&#xA;|------+---------|&#xA;| 0x00 |         |&#xA;| 0x01 |         |&#xA;| 0x02 |         |&#xA;| 0x03 |         |&#xA;| 0x04 |         |&#xA;| 0x05 |         |&#xA;| 0x06 |         |&#xA;| 0x07 |         |&#xA;| 0x08 |         |&#xA;| 0x09 |         |&#xA;| 0x0A |         |&#xA;| 0x0B |         |&#xA;| 0x0C |         |&#xA;#+TBLFM: $1='(format &quot;0x%02X&quot; (- @# 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Formatting-Strings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;format&lt;/code&gt;&lt;/a&gt; takes a format string much like printf in C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;@#&lt;/code&gt; gives the current row number, to which I subtract 2 so row 2 displays 0.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2016-11-26T14:41:07.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28935" PostTypeId="1" AcceptedAnswerId="28937" CreationDate="2016-11-26T15:01:40.110" Score="5" ViewCount="1797" Body="&lt;p&gt;According to the documentation the function &lt;strong&gt;get-buffer&lt;/strong&gt; checks if there is a buffer with a specific name. More precisely &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-buffer name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Return the buffer named name (a string).&#xA;If there is no live buffer named name, return nil. See the &lt;a href=&quot;https://stackoverflow.com/a/586753/&quot;&gt;related question&lt;/a&gt; on stackoverflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar way to check if there exists a buffer whose name starting with a specific string?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-11-26T15:50:30.777" Title="Checking if there exists a buffer whose name starting with a particular string" Tags="|buffers|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28936" PostTypeId="2" ParentId="28935" CreationDate="2016-11-26T15:46:46.953" Score="5" Body="&lt;p&gt;You can use the &lt;code&gt;buffer-list&lt;/code&gt; function to get a list of all buffers:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(buffer-list &amp;amp;optional FRAME)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return a list of all existing live buffers.&lt;br&gt;&#xA;  If the optional arg FRAME is a frame, we return the buffer list in the&#xA;  proper order for that frame: the buffers show in FRAME come first,&#xA;  followed by the rest of the buffers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So for example, one can use this to get a list of buffers whose name is starting with &lt;code&gt;*Minibuf-&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; if no such buffer exists:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(seq-filter (lambda (buf) (string-prefix-p &quot; *Minibuf-&quot; (buffer-name buf)))&#xA;            (buffer-list))&#xA;     =&amp;gt; (#&amp;lt;buffer  *Minibuf-1*&amp;gt; #&amp;lt;buffer  *Minibuf-0*&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-26T15:46:46.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28937" PostTypeId="2" ParentId="28935" CreationDate="2016-11-26T15:50:30.777" Score="5" Body="&lt;p&gt;Function &lt;strong&gt;&lt;code&gt;try-completion&lt;/code&gt;&lt;/strong&gt; tests whether a given string can be completed against a given set of completions (e.g. strings).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Function &lt;strong&gt;&lt;code&gt;buffer-list&lt;/code&gt;&lt;/strong&gt; provides the list of buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Function &lt;strong&gt;&lt;code&gt;buffer-name&lt;/code&gt;&lt;/strong&gt; returns the name of a given buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun matches-a-buffer-name? (name)&#xA;  &quot;Return non-nil if NAME matches the name of an existing buffer.&quot;&#xA;  (try-completion name (mapcar #'buffer-name (buffer-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;try-completion&lt;/code&gt; also accepts an optional &lt;code&gt;PREDICATE&lt;/code&gt; argument, which you can use to impose a particular kind of testing, e.g., a particular kind of matching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f try-completion&lt;/code&gt; tells you, part:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return common substring of all completions of &lt;code&gt;STRING&lt;/code&gt; in &lt;code&gt;COLLECTION&lt;/code&gt;.&#xA;  Test each possible completion specified by &lt;code&gt;COLLECTION&lt;/code&gt;&#xA;  to see if it begins with &lt;code&gt;STRING&lt;/code&gt;.  The possible completions may be&#xA;  strings or symbols.  Symbols are converted to strings before testing,&#xA;  see &lt;code&gt;symbol-name&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;All that match &lt;code&gt;STRING&lt;/code&gt; are compared together; the longest initial sequence&#xA;  common to all these matches is the return value.&#xA;  If there is no match at all, the return value is &lt;code&gt;nil&lt;/code&gt;.&#xA;  For a unique match which is exact, the return value is &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-11-26T15:50:30.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28938" PostTypeId="1" AcceptedAnswerId="28941" CreationDate="2016-11-26T16:49:16.227" Score="0" ViewCount="81" Body="&lt;p&gt;In source code, I'd like to display “-” as “−”.  In the font I use, the dash is very short and doesn't match the “+” at all.  This is only to improve visual appearance.  The character in the file must remain the same because it is code, which need to stay correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I've used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (font-lock-add-keywords nil&#xA;                                    '((&quot;\\B-\\B&quot;&#xA;                                       (0 (progn (compose-region (match-beginning 0) (match-end 0)  &quot;−&quot;&#xA;                                                                 'decompose-region)&#xA;                                                 nil)))))&#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;\B-\B&lt;/code&gt; magic is so that this does not apply in &lt;em&gt;text&lt;/em&gt;, i.e. within strings or comments, because I need it still displayed as a dash there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this cause a lot of false negatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to automatically display one character as another outside strings and comments?&lt;/p&gt;&#xA;" OwnerUserId="8794" LastEditorUserId="9995" LastEditDate="2016-11-26T20:09:32.427" LastActivityDate="2016-11-27T01:08:05.673" Title="How do I display dashs as minus signs outside comments and strings?" Tags="|display|characters|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28940" PostTypeId="1" AcceptedAnswerId="28947" CreationDate="2016-11-26T19:59:06.313" Score="3" ViewCount="1706" Body="&lt;p&gt;I use the &lt;strong&gt;monokai&lt;/strong&gt; theme by default in my Emacs configurations. But sometimes I use other themes too, particularly light themes like &lt;strong&gt;leuven&lt;/strong&gt; if the light in the room is more suitable for that. But I don't like the face that &lt;strong&gt;monokai&lt;/strong&gt; uses for &lt;code&gt;org-block&lt;/code&gt; (the background exactly), thus I want to override it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first attempt was this (I use &lt;code&gt;use-package&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package monokai-theme&#xA;  :ensure t&#xA;  :config&#xA;  (custom-theme-set-faces&#xA;   'monokai&#xA;   '(org-block ((t (:foreground &quot;#F8F8F0&quot; :background &quot;#171717&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And works perfectly fine at the start, but if I switch to another theme and then go back to &lt;strong&gt;monokai&lt;/strong&gt; the &lt;code&gt;org-block&lt;/code&gt; face is the default one of the theme again, ignoring my customization. The same happens if I try to wrap that in a &lt;code&gt;(with-eval-after-load &quot;monokai-theme&quot; ... )&lt;/code&gt; function (as in &lt;a href=&quot;https://emacs.stackexchange.com/questions/19286/how-to-change-face-in-particular-theme-locally&quot;&gt;How to change face in particular theme locally?&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I tried another approach, using a hook that I use to reset my &lt;strong&gt;smart-mode-line&lt;/strong&gt; theme every time that I change the theme. The entire solution is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package monokai-theme&#xA;  :ensure t&#xA;  :config&#xA;  (progn&#xA;    (defvar after-load-theme-hook nil&#xA;      &quot;Hook run after a color theme is loaded using `load-theme'.&quot;)&#xA;    (defadvice load-theme (after run-after-load-theme-hook activate)&#xA;      &quot;Run `after-load-theme-hook'.&quot;&#xA;      (run-hooks 'after-load-theme-hook))&#xA;    (defun customize-monokai ()&#xA;      &quot;customize monokai theme&quot;&#xA;      (custom-theme-set-faces&#xA;       'monokai&#xA;       '(org-block ((t (:foreground &quot;#F8F8F0&quot; :background &quot;#171717&quot;))))))&#xA;    (add-hook 'after-load-theme-hook 'customize-monokai)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this works, now every time that I change themes and go back to &lt;strong&gt;monokai&lt;/strong&gt; my custom face is applied as expected. But this also is not a perfect solution because it has side effects, like to switch to a light theme like &lt;strong&gt;leuven&lt;/strong&gt; and have the &lt;code&gt;org-block&lt;/code&gt; background in a dark grey instead of the theme default. If you reload the &lt;strong&gt;leuven&lt;/strong&gt; theme again, then seems to apply the theme default and ignore my customization. But this is not a desirable solution, and in the other hand, in a light theme like &lt;strong&gt;leuven&lt;/strong&gt; is easy to see that something went wrong, but it could not be that easier in another dark themes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked for another solutions but either didn't work, or are generic solutions (for all the themes, not a particular one) or seems too cumbersome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a properly way to persistently overwrite a face only for a particular theme?&lt;/p&gt;&#xA;" OwnerUserId="560" LastActivityDate="2023-09-01T05:14:23.467" Title="How to overwrite properly a face for a particular theme" Tags="|faces|themes|overwrite|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28941" PostTypeId="2" ParentId="28938" CreationDate="2016-11-27T01:08:05.673" Score="2" Body="&lt;p&gt;Testing whether some position is inside a comment or a string is hidden behind the obscurely named function &lt;code&gt;syntax-ppss&lt;/code&gt; and its return value.  I suppose the following will work.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun python-compose-dashs (limit)&#xA;  (while (search-forward &quot;-&quot; limit t)&#xA;    (unless (or (nth 3 (syntax-ppss))   ;string&#xA;                (nth 4 (syntax-ppss)))  ;comment&#xA;      (compose-region&#xA;       (1- (point)) (point) &quot;−&quot; 'decompose-region))))&#xA;&#xA;(add-hook 'python-mode-hook&#xA;          (lambda nil&#xA;            (font-lock-add-keywords nil '((python-compose-dashs)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-11-27T01:08:05.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28942" PostTypeId="1" AcceptedAnswerId="29060" CreationDate="2016-11-27T05:32:39.993" Score="1" ViewCount="1186" Body="&lt;p&gt;I have been trying to use spacemacs on Antergos (Arch Derivative) but when I start emacs it doesn't load spacemacs. it used to work before just fine but not anymore. I'm also very new to emacs so I would appreciate some guidance.&lt;/p&gt;&#xA;" OwnerUserId="14101" LastActivityDate="2016-12-04T18:05:22.760" Title="Spacemacs fails to load after installation on Arch Linux" Tags="|spacemacs|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28943" PostTypeId="1" AcceptedAnswerId="28945" CreationDate="2016-11-27T05:51:28.927" Score="1" ViewCount="102" Body="&lt;p&gt;I wish to &lt;code&gt;map&lt;/code&gt; the text properties onto a list and them insert them on a new buffer. For some reason the following snippet doesn't work. I've used the &lt;code&gt;-map&lt;/code&gt; utility from &lt;code&gt;dash.el&lt;/code&gt; package for the map.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (-map&#xA; (lambda (x) (insert (propertize &quot;a&quot;&#xA;                     'font-lock-face&#xA;                     '(:foreground x))))&#xA;&#xA; '(&quot;red&quot; &quot;green&quot; &quot;orange&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wish to achieve something like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VU506.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VU506.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13129" LastEditorUserId="105" LastEditDate="2016-12-22T03:35:21.450" LastActivityDate="2016-12-22T03:35:21.450" Title="How to use text-properties in a lambda function" Tags="|font-lock|text-properties|list|quote|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28944" PostTypeId="2" ParentId="28914" CreationDate="2016-11-27T06:33:38.577" Score="8" Body="&lt;p&gt;Use &lt;code&gt;kill-buffer-and-window&lt;/code&gt; to close a buffer and its window. But this will keep emacs running. If you also want to kill emacs (the equivalent of &lt;code&gt;:q&lt;/code&gt;) then try &lt;code&gt;evil-quit-all&lt;/code&gt; if you're using evil, and &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt; for standard emacs quit. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2016-11-27T06:33:38.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28945" PostTypeId="2" ParentId="28943" CreationDate="2016-11-27T06:42:31.953" Score="1" Body="&lt;p&gt;I am not familiar with using the &lt;code&gt;dash&lt;/code&gt; library, but the problem likely has to do with using a single quote for the list of face properties instead of using a backtick/comma combination.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(mapc&#xA;  (lambda (x) (insert (propertize &quot;a&quot; 'face `(:foreground ,x))))&#xA;  '(&quot;red&quot; &quot;green&quot; &quot;orange&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is an alternative to the backtick/comma list format, which uses the &lt;em&gt;function&lt;/em&gt; &lt;code&gt;list&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(mapc&#xA;  (lambda (x) (insert (propertize &quot;a&quot; 'face (list :foreground x))))&#xA;  '(&quot;red&quot; &quot;green&quot; &quot;orange&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I have not delved into the usages of the &lt;code&gt;font-lock-face&lt;/code&gt; property described in the manual, so I just used &lt;code&gt;face&lt;/code&gt; for this example since I am more familiar with it.  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here are links to the manual for the quote versus the backquote:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html#Quoting&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Quoting.html#Quoting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html#Backquote&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html#Backquote&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-27T07:10:09.627" LastActivityDate="2016-11-27T07:10:09.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28946" PostTypeId="1" AcceptedAnswerId="28948" CreationDate="2016-11-27T09:02:10.230" Score="3" ViewCount="526" Body="&lt;p&gt;I'm trying to do some processing of values passed in a plist. Processing is quite similar: get a value, convert it to number if necessary, check if within bounds and if yes, return a string with that number, properly formatted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, I decided to create a list of actions, and then map through them, picking up non-nil values:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun knl--initialize-numerics (info)&#xA;  &quot;Makes a string containing initialization of numerical parameters&quot;&#xA;  ;; logic is: convert to number, if satisfies condition print it, skip otherwise&#xA;  (let* ((num-inits '((:knl-width 'identity (-partial '&amp;gt; 0) &quot;%d&quot;)&#xA;                      (:knl-height 'identity (-partial '&amp;gt; 0) &quot;%d&quot;)&#xA;                      (:knl-margin 'string-to-number (-partial '&amp;gt;= 0) &quot;%.2f&quot;)&#xA;                      (:knl-min-scale 'string-to-number (-partial '&amp;gt; 0) &quot;%.2f&quot;)&#xA;                      (:knl-max-scale 'string-to-number (-partial '&amp;gt; 0) &quot;%.2f&quot;))))&#xA;    (--map&#xA;     ;; function&#xA;     (-when-let* (((sym conv cond frm) it)&#xA;                  (oval (plist-get info sym))&#xA;                  (val (funcall conv oval))&#xA;                  (matches? (funcall cond val))&#xA;                  (name (s-lower-camel-case (s-chop-prefix &quot;:knl-&quot; (symbol-name sym))))&#xA;                  (formatted (format frm val)))&#xA;                  )&#xA;       val&#xA;       )&#xA;     ;; data&#xA;     num-inits)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above code fails at &lt;code&gt;(val (funcall conv oval))&lt;/code&gt; in &lt;code&gt;ielm&lt;/code&gt; when I try to execute the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (knl--initialize-numerics '(:knl-width 10 :knl-height 0 :knl-margin 0))&#xA;*** Eval error ***  Invalid function: (quote identity)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was trying the same with a simple function, and it works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (let ((conv 'identity) (val 5)) (funcall conv val ))&#xA;5 (#o5, #x5, ?\C-e)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why doesn't it then work in a more complex example? Is that because of some &lt;code&gt;dash.el&lt;/code&gt; magic?&lt;/p&gt;&#xA;" OwnerUserId="8320" LastEditorUserId="8320" LastEditDate="2016-11-27T10:13:32.660" LastActivityDate="2016-11-27T14:16:06.070" Title="How to invoke functions that are quoted in let?" Tags="|functions|dash.el|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28947" PostTypeId="2" ParentId="28940" CreationDate="2016-11-27T09:04:37.980" Score="5" Body="&lt;p&gt;Well, finally I have a working solution, actually it was so obvious that I don't understand why it took me so long to find out. The answer is to use my previous solution that make use of the custom hook, but only overwrite the face if the &lt;strong&gt;monokai&lt;/strong&gt; theme is loaded. And works perfectly fine.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package monokai-theme&#xA;  :ensure t&#xA;  :config&#xA;  (progn&#xA;    (defvar after-load-theme-hook nil&#xA;      &quot;Hook run after a color theme is loaded using `load-theme'.&quot;)&#xA;    (defadvice load-theme (after run-after-load-theme-hook activate)&#xA;      &quot;Run `after-load-theme-hook'.&quot;&#xA;      (run-hooks 'after-load-theme-hook))&#xA;    (defun customize-monokai ()&#xA;      &quot;Customize monokai theme&quot;&#xA;      (if (member 'monokai custom-enabled-themes)&#xA;          (custom-theme-set-faces&#xA;           'monokai&#xA;           '(org-block ((t (:foreground &quot;#F8F8F0&quot; :background &quot;#171717&quot;)))))))&#xA;    (add-hook 'after-load-theme-hook 'customize-monokai)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I still don't know if this is the better or proper way to do it, If you have a better one, please don't hesitate to share it. Thanks!&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="560" LastActivityDate="2016-11-27T09:04:37.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28948" PostTypeId="2" ParentId="28946" CreationDate="2016-11-27T10:24:13.023" Score="10" Body="&lt;p&gt;There seems to be a fair bit of confusion how quoting works.  In Lisp, symbols and lists fulfill a dual meaning, depending on whether they're quoted or not:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Unquoted symbol: Evaluate the symbol (by looking up its value in the current environment)&lt;/li&gt;&#xA;&lt;li&gt;Quoted symbol: Do not evaluate the symbol (by returning the symbol)&lt;/li&gt;&#xA;&lt;li&gt;Unquoted list: Evaluate the function (by applying its first item to the remaining items)&lt;/li&gt;&#xA;&lt;li&gt;Quoted list: Do not evaluate the list (by returning the list as is)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The last case is particularly important as the quoting applies to everything inside the list.  &lt;code&gt;'(x y z)&lt;/code&gt; evaluates to &lt;code&gt;(x y z)&lt;/code&gt;, the symbols inside the list are &lt;em&gt;not&lt;/em&gt; evaluated.  Therefore, &lt;code&gt;'(x 'y z)&lt;/code&gt; would evaluate to &lt;code&gt;(x (quote y) z)&lt;/code&gt; which is most certainly not what one would want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes you'll want to selectively evaluate parts of a quoted list.  The hard way is to construct the list manually from quoted and not quoted symbols, the easier way is to use the backquote and unquote mechanism to specify what to evaluate in the list.  Assuming &lt;code&gt;y&lt;/code&gt; has the value 42 in the environment, both &lt;code&gt;(list 'x y 'z)&lt;/code&gt; and &lt;code&gt;`(x ,y z)&lt;/code&gt; evaluate to &lt;code&gt;(x 42 z)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Armed with this knowledge, the alist in your example should look like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`((:knl-width identity ,(-partial '&amp;gt; 0) &quot;%d&quot;)&#xA;  (:knl-height identity ,(-partial '&amp;gt; 0) &quot;%d&quot;)&#xA;  (:knl-margin string-to-number ,(-partial '&amp;gt;= 0) &quot;%.2f&quot;)&#xA;  (:knl-min-scale string-to-number ,(-partial '&amp;gt; 0) &quot;%.2f&quot;)&#xA;  (:knl-max-scale string-to-number ,(-partial '&amp;gt; 0) &quot;%.2f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2016-11-27T14:16:06.070" LastActivityDate="2016-11-27T14:16:06.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28950" PostTypeId="1" AcceptedAnswerId="28958" CreationDate="2016-11-27T11:30:02.290" Score="5" ViewCount="1255" Body="&lt;p&gt;I use a lot of embedded latex in my org files with drill mode. It worked fine with org 8, but recently I've upgraded to org 9, and now when I run &lt;code&gt;C-c C-x C-l&lt;/code&gt; I'll get this error. My &lt;code&gt;.emacs&lt;/code&gt; file contains the following code related with org and latex: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-create-formula-image-program 'dvipng) &#xA;(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm new to Emacs. What should I do to fix this?&lt;/p&gt;&#xA;" OwnerUserId="14089" LastActivityDate="2016-11-27T23:43:38.253" Title="Symbol's function definition is void: org-export--get-global-options" Tags="|org-mode|preview-latex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28951" PostTypeId="1" AcceptedAnswerId="28953" CreationDate="2016-11-27T11:34:59.713" Score="0" ViewCount="83" Body="&lt;p&gt;I Think I have an idea, unless i want to be sure. According to &lt;a href=&quot;http://vim.wikia.com/wiki/Using_marks&quot; rel=&quot;nofollow noreferrer&quot;&gt;vim.wikia.com&lt;/a&gt;, &lt;code&gt;[&lt;/code&gt; and &lt;code&gt;]&lt;/code&gt; marks in vim refers to beginning/end of previously changed or yanked text, but there is no built-in &lt;code&gt;^&lt;/code&gt; mark. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must have missed something because I didn't really get deep into evil or vim references manuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any accurate idea ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance, hoping this is not a duplicate.&lt;/p&gt;&#xA;" OwnerUserId="14102" LastActivityDate="2016-11-27T12:56:41.060" Title="What does refeer evil-mode ^ (carry)'s mark to ? (shown in :marks list)" Tags="|evil|mark|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28953" PostTypeId="2" ParentId="28951" CreationDate="2016-11-27T12:56:41.060" Score="0" Body="&lt;p&gt;Yes, this is a special mark that stores the last position where you used the Insert mode. From the Vim help:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;'^  `^                  To the position where the cursor was the last &#xA;  time when Insert mode was stopped.  This is used by the gi command. &#xA;  Not set when the :keepjumps command modifier was used.  {not in Vi}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can learn more about the topic in Vim with &lt;code&gt;:help marks&lt;/code&gt; or in the &lt;a href=&quot;http://vimdoc.sourceforge.net/htmldoc/motion.html#mark-motions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vim online documentation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="560" LastActivityDate="2016-11-27T12:56:41.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28957" PostTypeId="1" CreationDate="2016-11-27T19:08:59.333" Score="2" ViewCount="633" Body="&lt;p&gt;Some people put one sentence or even one paragraph on one line.  When someone fixes a spelling error in such a line it is difficult to spot the change in Magit log.  How can I toggle Magit log to show me the differences at the word rather than the whole-line level?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit1: When I press &lt;code&gt;D t&lt;/code&gt; or &lt;code&gt;magit-diff-refine-hunk&lt;/code&gt; in the Magit log buffer I see no difference.  I.e., single word changes are still shown as very long red/green lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit2: The main developer of Magit does not want to add this feature.  See &lt;a href=&quot;https://github.com/magit/magit/issues/1615&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for his motivation.  (This question cannot be a duplicate of another solved issue, because the current issue apparently cannot be solved within the current version of Magit.)&lt;/p&gt;&#xA;" OwnerUserId="8488" LastEditorUserId="8488" LastEditDate="2016-11-27T21:13:37.657" LastActivityDate="2016-11-27T21:13:37.657" Title="How to show word diffs in Magit?" Tags="|magit|words|" AnswerCount="0" CommentCount="9" ClosedDate="2016-11-28T18:10:50.027" ContentLicense="CC BY-SA 3.0" />
  <row Id="28958" PostTypeId="2" ParentId="28950" CreationDate="2016-11-27T23:43:38.253" Score="6" Body="&lt;p&gt;The problem is solved. I just added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14089" LastActivityDate="2016-11-27T23:43:38.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28959" PostTypeId="1" AcceptedAnswerId="28961" CreationDate="2016-11-27T23:46:16.110" Score="3" ViewCount="3594" Body="&lt;p&gt;I find it convenient to move by multiple lines for quickly scrolling up/down:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; replaces forward-sentence&#xA;(global-set-key (kbd &quot;M-e&quot;)&#xA;                (lambda () (interactive) (next-line 3)))&#xA;&#xA;;; replaces backward-sentence&#xA;(global-set-key (kbd &quot;M-a&quot;)&#xA;                (lambda () (interactive) (previous-line 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this gives doesn't save the column of the cursor after you switch directions.  For example, suppose a buffer contains the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is line 1. &#xA;This is line 2.&#xA;This is line 3.&#xA;&#xA;This is line 5.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put your cursor on the &quot;1&quot; in the first line, then press C-n 3 times, then press C-p 3 times. You should find that you end up back on the &quot;1&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, define M-e and M-a using the above keyboard shortcuts. Try putting your cursor on the &quot;1&quot;, press M-e &lt;em&gt;once&lt;/em&gt;, then M-a &lt;em&gt;once&lt;/em&gt;.  Your cursor ends up at the &lt;em&gt;beginning&lt;/em&gt; of the first line! (Tested on Emacs 24.5.1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can you move multiple lines in one keypress and preserve the column after switching directions? I tried replacing &lt;code&gt;next-line&lt;/code&gt; with &lt;code&gt;forward-line&lt;/code&gt;... no dice.&lt;/p&gt;&#xA;" OwnerUserId="14104" LastEditorUserId="14104" LastEditDate="2016-11-28T01:37:54.387" LastActivityDate="2016-11-28T01:37:54.387" Title="Move cursor up or down multiple lines while preserving column" Tags="|motion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28960" PostTypeId="1" AcceptedAnswerId="28962" CreationDate="2016-11-27T23:52:51.343" Score="1" ViewCount="103" Body="&lt;p&gt;I am trying to learn about the &lt;code&gt;bookmark+&lt;/code&gt; package. I installed the package from &lt;code&gt;M-x list-packages&lt;/code&gt; and I am using Emacs 25.1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like a great package, the only difficulty I have so far, is that&#xA;the formatting of &lt;a href=&quot;https://www.emacswiki.org/emacs/bookmark+-doc.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;the documentation for the mode&lt;/a&gt; is not directly user friendly. Or maybe I am just used to view documentation in another format? Anyway, it seems to be formatted such that it can be read by a program (presumably a document viewer of some sort). At line 115 of the documentation, it says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If you have library `linkd.el' and Emacs 22 or later, load&#xA;;;  `linkd.el' and turn on `linkd-mode' now.  It lets you easily&#xA;;;  navigate around the sections of this doc.  Linkd mode will&#xA;;;  highlight this Index, as well as the cross-references and section&#xA;;;  headings throughout this file.  You can get `linkd.el' here:&#xA;;;  http://dto.freeshell.org/notebook/Linkd.html.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However accessing the link &lt;a href=&quot;http://dto.freeshell.org/notebook/Linkd.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dto.freeshell.org/notebook/Linkd.html&lt;/a&gt;&#xA;gives me &lt;code&gt;500 Internal Server Error&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wondered if there are other ways to view this documentation with &quot;better&quot; formatting? Perhaps from within Emacs itself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x describe-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x info&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x info-emacs-manual&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x view-emacs-FAQ&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but no success so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another documentation page (with better formatting):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/BookmarkPlus&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it is a little bit different from the other documentation, so I suspect it is not up-to-date.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-11-28T02:19:59.620" Title="How to read proper formatted documentation for bookmark+ package?" Tags="|package|documentation|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28961" PostTypeId="2" ParentId="28959" CreationDate="2016-11-28T00:35:36.500" Score="2" Body="&lt;p&gt;The original poster may wish to use the universal-argument to move N lines up or down -- e.g., &lt;code&gt;C-u 3 up&lt;/code&gt; and &lt;code&gt;C-u 3 down&lt;/code&gt;; or &lt;code&gt;C-3 up&lt;/code&gt; and &lt;code&gt;C-3 down&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Internal functions within &lt;code&gt;simple.el&lt;/code&gt; (relating to &lt;code&gt;next-line&lt;/code&gt; and &lt;code&gt;previous-line&lt;/code&gt;) check the value of the &lt;em&gt;variable&lt;/em&gt; &lt;code&gt;last-command&lt;/code&gt;.  Since the original poster created new &lt;code&gt;lambda&lt;/code&gt; functions attached to keyboard shortcuts, it is necessary to expressly set the value of &lt;code&gt;this-command&lt;/code&gt; -- which becomes &lt;code&gt;last-command&lt;/code&gt; towards the end of the current command loop.  &lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; replaces forward-sentence&#xA;(global-set-key (kbd &quot;M-e&quot;)&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (setq this-command 'next-line)&#xA;    (next-line 3)))&#xA;&#xA;;; replaces backward-sentence&#xA;(global-set-key (kbd &quot;M-a&quot;)&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (setq this-command 'previous-line)&#xA;    (previous-line 3)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-11-28T01:32:52.240" LastActivityDate="2016-11-28T01:32:52.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28962" PostTypeId="2" ParentId="28960" CreationDate="2016-11-28T01:02:28.877" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can view the doc on the Web, here: &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;https://www.emacswiki.org/emacs/BookmarkPlus&lt;/code&gt;&lt;/a&gt;.  It is essentially the same doc as what is in &lt;a href=&quot;https://www.emacswiki.org/emacs/download/bookmark%2b-doc.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;bookmark+-doc.el&lt;/code&gt;&lt;/a&gt;, and it is just as up-to-date.  It also shows screenshots.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It says this in the first section of &lt;a href=&quot;https://www.emacswiki.org/emacs/download/bookmark%2b-doc.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;bookmark+-doc.el&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you have library &lt;code&gt;linkd.el&lt;/code&gt; and Emacs 22 or later, load&#xA;   &lt;code&gt;linkd.el&lt;/code&gt; and turn on &lt;code&gt;linkd-mode&lt;/code&gt; now.  It lets you easily&#xA;   navigate around the sections of this doc.  Linkd mode will&#xA;   highlight this Index, as well as the cross-references and section&#xA;  headings throughout this file.  You can get &lt;code&gt;linkd.el&lt;/code&gt; here:&#xA;  &lt;a href=&quot;http://www.emacswiki.org/emacs/download/linkd.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;http://www.emacswiki.org/emacs/download/linkd.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(The URL there was out-of-date. I updated it just now to the correct URL.  It previously said &lt;a href=&quot;http://dto.freeshell.org/notebook/Linkd.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;http://dto.freeshell.org/notebook/Linkd.html&lt;/code&gt;&lt;/a&gt;, which is no longer valid.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use linkd with each of the other Bookmark+ files.  It lets you quickly skip to the various sections of the source code. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is also this doc about the doc, near the beginning of the doc (&lt;code&gt;;-)&lt;/code&gt; in &lt;a href=&quot;https://www.emacswiki.org/emacs/download/bookmark%2b-doc.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;bookmark+-doc.el&lt;/code&gt;&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;     - General Bookmark+ documentation.&#xA;;;&#xA;;;       . Anywhere in Emacs, `M-x bmkp-bmenu-mode-status-help' shows&#xA;;;         detailed information about the current state of the&#xA;;;         bookmark list.  Click button `Doc in Commentary' or button&#xA;;;         `Doc on the Web' to access the complete documentation.&#xA;;;&#xA;;;         (Use button `Customize' to customize all Bookmark+&#xA;;;         faces and options.)&#xA;;;&#xA;;;       . In the bookmark list, `?' and `C-h m' are the same as `M-x&#xA;;;         bmkp-bmenu-mode-status-help'.  (`C-h m' in the bookmark&#xA;;;         list does not show you info about minor modes.  If you want&#xA;;;         that, use `M-x describe-mode'.)&#xA;;;&#xA;;;       . In the `bookmark-plus' group customization buffer (`M-x&#xA;;;         customize-group bookmark-plus'), click button `Commentary'.&#xA;;;&#xA;;;       . From the Emacs-Wiki Web site,&#xA;;;         http://www.emacswiki.org/BookmarkPlus.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;From #3 you can see that you can get to the Commentary section of &lt;a href=&quot;https://www.emacswiki.org/emacs/download/bookmark%2b-doc.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;bookmark+-doc.el&lt;/code&gt;&lt;/a&gt; by clicking &lt;code&gt;Commentary&lt;/code&gt; in either the help from buffer &lt;code&gt;*Bookmark List*&lt;/code&gt; or the Customize buffer for group &lt;code&gt;bookmark-plus&lt;/code&gt; (&lt;code&gt;M-x customize-group bookmark-plus&lt;/code&gt;).  The Commentary is shown in buffer (&lt;code&gt;*Commentary, bookmark+*&lt;/code&gt;), which is in &lt;code&gt;finder-mode&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-11-28T02:19:59.620" LastActivityDate="2016-11-28T02:19:59.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28963" PostTypeId="2" ParentId="28820" CreationDate="2016-11-28T04:58:03.577" Score="3" Body="&lt;p&gt;You might consider using &lt;code&gt;org-timer&lt;/code&gt; instead. For example, you can use &lt;code&gt;M-x org-timer-item RET&lt;/code&gt; to start a bulleted list with a timestamp, and &lt;code&gt;M-RET&lt;/code&gt; to create new timestamped items afterwards. &lt;code&gt;M-x org-timer RET&lt;/code&gt; (&lt;code&gt;C-c C-x .&lt;/code&gt;) inserts a relative time with seconds.&lt;/p&gt;&#xA;" OwnerUserId="364" LastEditorUserId="1979" LastEditDate="2020-07-06T15:10:43.833" LastActivityDate="2020-07-06T15:10:43.833" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="28964" PostTypeId="1" AcceptedAnswerId="29833" CreationDate="2016-11-28T06:11:25.603" Score="6" ViewCount="349" Body="&lt;p&gt;I am unable to figure out a way to save my narrowed indirect buffer window, and restore it as it was. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have a frame with several windows containing several indirect buffers, each narrowed to a different subtree (org mode) or region. What I want to achieve is to save the layout including the frame, all window, and all narrowed indirect buffers as well as their positions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed &lt;code&gt;desktop+&lt;/code&gt;, and used &lt;code&gt;desktop-save-mode&lt;/code&gt;. Later I also used &lt;code&gt;bookmark+&lt;/code&gt;, which provides commands such as &lt;code&gt;bmkp-set-desktop-bookmark&lt;/code&gt;, and &lt;code&gt;bmkp-desktop-jump&lt;/code&gt;. Both give unsatisfactory results when it comes to narrowed indirect buffers: The windows with indirect buffers will only show the complete file/buffer, instead of the narrowed one when I reopen and restore after &lt;code&gt;C-x C-c&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that &lt;code&gt;bookmark+&lt;/code&gt; does provide a way to save regions and late allow you to jump to an clone indirect buffer with that region (along with &lt;code&gt;narrow indirect&lt;/code&gt; package installed). However, it does not provide solutions at the desktop or even file level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's easy if you want to reproduce the results. Set &lt;code&gt;desktop-save-mode&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in your init.el. Then open a file, split the window and create a narrowed indirect buffer (the easiest way is use an org-file, and narrow to a subtree using &lt;code&gt;C-c C-x b&lt;/code&gt;. Exit emacs &lt;code&gt;C-x C-c&lt;/code&gt;, then reopen it. You'll see your indirect buffer shows the full copy instead of the narrowed subtree in your previous desktop. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really appreciate if someone can help me figure it out. &lt;/p&gt;&#xA;" OwnerUserId="14107" LastEditorUserId="105" LastEditDate="2016-12-24T02:32:09.660" LastActivityDate="2017-01-05T22:42:32.607" Title="How to save a desktop with narrowed indirect buffers?" Tags="|bookmarks|narrowing|indirect-buffers|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28965" PostTypeId="1" AcceptedAnswerId="28974" CreationDate="2016-11-28T06:45:18.290" Score="11" ViewCount="1092" Body="&lt;p&gt;Does elisp provide a builtin efficient set data structure, similar to &lt;a href=&quot;https://docs.python.org/3/tutorial/datastructures.html#sets&quot; rel=&quot;noreferrer&quot;&gt;set&lt;/a&gt; in Python and &lt;a href=&quot;http://en.cppreference.com/w/cpp/container/set&quot; rel=&quot;noreferrer&quot;&gt;std::set&lt;/a&gt; in C++?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-11-28T20:25:07.213" Title="An efficient set data structure in elisp" Tags="|elisp|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28966" PostTypeId="1" CreationDate="2016-11-28T07:14:21.387" Score="3" ViewCount="768" Body="&lt;p&gt;Most of the convenient OS X keybindings that GNU Emacs defines, such as &lt;code&gt;s-a&lt;/code&gt; for &lt;code&gt;C-x h&lt;/code&gt;, are not all that useful to me. I'd like to make Super synonymous with Ctrl. Is there a way to easily map all key chords involving Super to the equivalent Ctrl version? Failing that, is there a way to map a key to another key that works for prefix keys as well as non-prefix keys?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using &lt;code&gt;keyboard-translate&lt;/code&gt; and &lt;code&gt;global-set-key&lt;/code&gt; so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(keyboard-translate (kbd &quot;s-a&quot;) (kbd &quot;C-a&quot;))&lt;/code&gt; results in a type error. I'm not sure why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(global-set-key (kbd &quot;s-a&quot;) (kbd &quot;C-a&quot;))&lt;/code&gt; works fine, but &lt;code&gt;(global-set-key (kbd &quot;s-h&quot;) (kbd &quot;C-h&quot;))&lt;/code&gt; does not seem to do much of anything.&lt;/p&gt;&#xA;" OwnerUserId="8921" LastEditorUserId="897" LastEditDate="2016-11-28T08:52:17.697" LastActivityDate="2018-01-04T14:47:22.657" Title="translate a modifier key (Super to Ctrl OS X)" Tags="|key-bindings|osx|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28967" PostTypeId="1" CreationDate="2016-11-28T08:34:31.960" Score="3" ViewCount="446" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/haskell/haskell-mode/blob/d2ea5239bf02f3917a78a5c2dcbc5b6f6dd1b359/haskell-mode.el#L837&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;haskell-mode-hook&lt;/code&gt;&lt;/a&gt; customizable variable in &lt;code&gt;haskell-mode&lt;/code&gt; has a default value of &lt;code&gt;(haskell-indentation-mode interactive-haskell-mode)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, after starting Emacs, its value is &lt;code&gt;nil&lt;/code&gt;; the &quot;original value&quot; is given as &lt;code&gt;(haskell-indentation-mode interactive-haskell-mode)&lt;/code&gt;. This suggests that something else set its value to &lt;code&gt;nil&lt;/code&gt;, but I can't figure out what.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Grepping through &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; doesn't turn up anything that sets &lt;code&gt;haskell-mode-hook&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, and nothing in my &lt;a href=&quot;https://github.com/xiongtx/.emacs.d&quot; rel=&quot;nofollow noreferrer&quot;&gt;init file&lt;/a&gt; does either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone else having this issue?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2017-10-15T18:43:20.637" LastActivityDate="2018-09-24T21:21:41.347" Title="`haskell-mode-hook` is nil?" Tags="|hooks|customize|haskell-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28968" PostTypeId="1" CreationDate="2016-11-28T10:29:01.663" Score="2" ViewCount="721" Body="&lt;p&gt;For some reason, evaluating code blocks stopped working for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example from the manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN_SRC emacs-lisp&#xA;   (defun org-xor (a b)&#xA;      &quot;Exclusive or.&quot;&#xA;      (if a (not b) b))&#xA; #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Gives now &lt;code&gt;Wrong type argument: integer-or-marker-p, &quot;(ref:%s)&quot;&lt;/code&gt;. The same happens also for other languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does somebody know what is going on? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have Org mode version 9.0.1. I believe the problems started when I upgraded (but can't be sure).&lt;/p&gt;&#xA;" OwnerUserId="5237" LastActivityDate="2018-03-24T00:01:55.267" Title="Org-mode code block evaluation error" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28969" PostTypeId="1" AcceptedAnswerId="28985" CreationDate="2016-11-28T10:41:47.987" Score="1" ViewCount="206" Body="&lt;p&gt;Using &lt;code&gt;kmacro-exec-ring-item&lt;/code&gt;, is it possible to wrap this in an elisp macro or function so its much less verbose?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example the only unique part is &lt;code&gt;ds(&lt;/code&gt; and the function name.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset&#xA; 'delete-surround-parens&#xA; (lambda (&amp;amp;optional arg) &quot;&quot; (interactive &quot;p&quot;)&#xA;   (kmacro-exec-ring-item (quote ([?d ?s ?( ] 0 %d)) arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could this be wrapped so it could be written as something more simple, for eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'delete-surround-parens (my-kmacro-wrapper &quot;ds(&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to convert the literal string into an array to pass to &lt;code&gt;kmacro-exec-ring-item&lt;/code&gt;, but interested to know if its possible.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="105" LastEditDate="2016-11-28T15:25:46.870" LastActivityDate="2016-11-29T00:45:42.673" Title="How to simplify macro declaration?" Tags="|keyboard-macros|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28970" PostTypeId="2" ParentId="28969" CreationDate="2016-11-28T10:53:46.970" Score="1" Body="&lt;pre&gt;&lt;code&gt;;; Keyboard Macro&#xA;(fset 'delete-surround-parens &quot;ds(&quot;)&#xA;&#xA;;; or normal Function&#xA;(defun delete-surround-parens ()&#xA;  (interactive)&#xA;  (command-execute &quot;ds(&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ds(&lt;/code&gt; here is valid Emacs key representation, for complex keys, wrap that with &lt;code&gt;kbd&lt;/code&gt;, for example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'next-4-lines (kbd &quot;C-u M-x next-line RET&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-28T10:53:46.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28971" PostTypeId="2" ParentId="28968" CreationDate="2016-11-28T11:56:24.287" Score="2" Body="&lt;p&gt;Not really an answer, not knowing your settings and packages...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The api (like function names and signatures) change a bit with org 9. Maybe there is some package using the old api.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find out, where the error occurs, do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x toggle-debug-on-error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;repeat your &lt;code&gt;C-c C-c&lt;/code&gt;, or how you start your block evaluation, and have a look at the backtrace.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-28T11:56:24.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28972" PostTypeId="1" AcceptedAnswerId="28978" CreationDate="2016-11-28T12:35:51.403" Score="1" ViewCount="507" Body="&lt;p&gt;The post's title pretty much says it all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, I want to find out what happens if I invoke &lt;code&gt;custom-set-variables&lt;/code&gt; twice, with completely different arguments each time.  E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables '(this &quot;foo&quot;))&#xA;(custom-set-variables '(that &quot;bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does this have the same effect as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables '(this &quot;foo&quot;)&#xA;                      '(that &quot;bar&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And ditto for &lt;code&gt;custom-set-faces&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2016-11-28T15:11:58.500" Title="Where is the information passed to `custom-set-variables` and `custom-set-faces` stored?" Tags="|customize|customization|custom|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28973" PostTypeId="1" AcceptedAnswerId="29021" CreationDate="2016-11-28T13:51:09.537" Score="1" ViewCount="710" Body="&lt;p&gt;I've installed &lt;code&gt;ox-reveal&lt;/code&gt; package from MELPA with &lt;code&gt;package-install ox-reveal&lt;/code&gt; and added in the configuration file the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-reveal-root &quot;http://cdn.jsdelivr.net/reveal.js/3.0.0/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I try to export a test presentation with &lt;code&gt;C-c C-e&lt;/code&gt; I don't see an entry for reveal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried requiring the package with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox-reveal)&#xA;(setq org-reveal-root &quot;http://cdn.jsdelivr.net/reveal.js/3.0.0/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that gives me the following error when Emacs starts:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;error: Required feature ‘ox-reveal’ was not provided&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there something I'm missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I'm using Emacs on Cygwing and here's the package versions&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org                20161118&#xA;ox-reveal          20161027.226&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14110" LastActivityDate="2016-11-30T01:15:20.833" Title="ox-reveal not shown in org-export-dispatch" Tags="|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28974" PostTypeId="2" ParentId="28965" CreationDate="2016-11-28T14:00:56.273" Score="13" Body="&lt;p&gt;The standard way to handle sets in lisps is to use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html&quot; rel=&quot;noreferrer&quot;&gt;hash tables&lt;/a&gt;. In fact, this is how sets are implemented in languages which do provide a dedicated interface (like Python). This offers &lt;code&gt;O(1)&lt;/code&gt; access cost, so is perfect for larger sets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun make-set ()&#xA;  (make-hash-table))&#xA;(defun add-to-set (element set)&#xA;  (puthash element t set))&#xA;(defun in-set-p (element set)&#xA;  (gethash element set nil))&#xA;(defun remove-from-set (element set)&#xA;  (remhash element set))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Set-level operations, like union and intersection, require more work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. When I said &quot;lisps&quot; above I kinda lied. Common Lisp actually offers list-based set-level functions (&lt;a href=&quot;http://clhs.lisp.se/Body/14_abb.htm&quot; rel=&quot;noreferrer&quot;&gt;&quot;Lists as Sets&quot;&lt;/a&gt;), but these have access complexity &lt;code&gt;O(N)&lt;/code&gt; and set-level complexity &lt;code&gt;O(N^2)&lt;/code&gt;, so they are only suitable for smaller sets.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-11-28T20:25:07.213" LastActivityDate="2016-11-28T20:25:07.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28975" PostTypeId="2" ParentId="28965" CreationDate="2016-11-28T14:02:49.887" Score="11" Body="&lt;p&gt;There are many different ways to implement sets, with very different efficiency profiles.  In Elisp, the two simplest ways to implement sets are probably:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;As a list:  This tends to have poor algorithmic efficiency (such as O(N) complexity to test membership) but works well for small sets.  Adding an element can be as simple as &lt;code&gt;push&lt;/code&gt; or &lt;code&gt;cl-pushnew&lt;/code&gt;, and testing is just &lt;code&gt;memq&lt;/code&gt; or &lt;code&gt;member&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As a hash table:  This has a higher constant cost, but a better algorithmic efficiency, so it works much better for larger sets.  Adding an element is just &lt;code&gt;(puthash VAL t SET)&lt;/code&gt; and testing membership is just &lt;code&gt;(gethash VAL SET)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-11-28T14:02:49.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28976" PostTypeId="1" CreationDate="2016-11-28T15:00:33.513" Score="1" ViewCount="286" Body="&lt;p&gt;When I typed &lt;code&gt;C-y&lt;/code&gt; to call &lt;code&gt;yank&lt;/code&gt;, I got this.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;apply: Symbol's value as variable is void: n&lt;/p&gt;&#xA;&lt;p&gt;Debugger entered--Lisp error: (void-variable n)&lt;br /&gt;&#xA;ad-Advice-current-kill( ... [interprogram-paste-function interprogram-cut-function kill-ring kill-ring-yank-pointer yank-pop-change-selection 0 nil mapc kill-new error &amp;quot;Kill ring is empty&amp;quot; mod] 6 2016971] 0)&lt;br /&gt;&#xA;apply(ad-Advice-current-kill ... [interprogram-paste-function interprogram-cut-function kill-ring kill-ring-yank-pointer yank-pop-change-selection 0 nil mapc kill-new error &amp;quot;Kill ring is empty&amp;quot; mod] 6 2016971] 0)&lt;br /&gt;&#xA;current-kill(0)&lt;br /&gt;&#xA;yank(nil)&lt;br /&gt;&#xA;call-interactively(yank nil nil)&lt;br /&gt;&#xA;command-execute(yank)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The '...' in the traceback is messy code.&lt;/p&gt;&#xA;&lt;p&gt;I have found it's this sentence that caused this error.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(require 'multiple-cursors)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The contents after querying function &lt;code&gt;current-kill&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;current-kill is a compiled Lisp function in `simple.el'.&lt;/p&gt;&#xA;&lt;p&gt;(current-kill ARG1 &amp;amp;optional ARG2)&lt;/p&gt;&#xA;&lt;p&gt;:around advice: `ad-Advice-current-kill'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;And the contents after pressing &lt;code&gt;ad-Advice-current-kill&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;ad-Advice-current-kill is a compiled Lisp function.&lt;/p&gt;&#xA;&lt;p&gt;(ad-Advice-current-kill AD--ADDOIT-FUNCTION ARG1 &amp;amp;optional ARG2)&lt;/p&gt;&#xA;&lt;p&gt;Before-advice `interprogram-paste-for-all-cursors'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It's really inconvenient that yank can't work. Hoping to solve it quickly, I post the source code for &lt;code&gt;interprogram-paste-for-all-cursors&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice current-kill (before interprogram-paste-for-all-cursors activate)&#xA;  (let ((interprogram-paste (and (= n 0)&#xA;                                 interprogram-paste-function&#xA;                                 (funcall interprogram-paste-function))))&#xA;    (when interprogram-paste&#xA;      ;; Add interprogram-paste to normal kill ring, just&#xA;      ;; like current-kill usually does for itself.&#xA;      ;; We have to do the work for it tho, since the funcall only returns&#xA;      ;; something once. It is not a pure function.&#xA;      (let ((interprogram-cut-function nil))&#xA;        (if (listp interprogram-paste)&#xA;            (mapc 'kill-new (nreverse interprogram-paste))&#xA;          (kill-new interprogram-paste))&#xA;        ;; And then add interprogram-paste to the kill-rings&#xA;        ;; of all the other cursors too.&#xA;        (mc/for-each-fake-cursor&#xA;         (let ((kill-ring (overlay-get cursor 'kill-ring))&#xA;               (kill-ring-yank-pointer (overlay-get cursor 'kill-ring-yank-pointer)))&#xA;           (if (listp interprogram-paste)&#xA;               (mapc 'kill-new (nreverse interprogram-paste))&#xA;             (kill-new interprogram-paste))&#xA;           (overlay-put cursor 'kill-ring kill-ring)&#xA;           (overlay-put cursor 'kill-ring-yank-pointer kill-ring-yank-pointer)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13259" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-01-30T04:29:48.010" Title="I got error when using command yank" Tags="|debugging|yank|" AnswerCount="1" CommentCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="28978" PostTypeId="2" ParentId="28972" CreationDate="2016-11-28T15:11:58.500" Score="3" Body="&lt;p&gt;They both just set the named variables. &lt;code&gt;custom-set-variables&lt;/code&gt; sets the value of the variable as well as several other properties, while &lt;code&gt;custom-set-faces&lt;/code&gt; only sets some properties. You can get these using the &lt;code&gt;symbol-value&lt;/code&gt; and &lt;code&gt;symbol-plist&lt;/code&gt; functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables '(db48x/test 24 t) '(db48x/test 42 t))&#xA;(symbol-value 'db48x/test)&#xA;42&#xA;(symbol-plist 'db48x/test)&#xA;(theme-value ((user 42)) saved-value (42) saved-variable-comment nil force-value t variable-comment nil custom-requests 42)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a face you have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(symbol-plist 'default)&#xA;(face-defface-spec ((t nil)) face-modified nil face 0 face-documentation &quot;Basic default face.&quot; event-symbol-element-mask (default 0) event-symbol-elements (default) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more information about how variables get their values, I recommend section 8.1 &lt;em&gt;Symbol Components&lt;/em&gt; of the ELisp manual. (Use &lt;code&gt;M-: (info &quot;(elisp) Symbol Components&quot;)&lt;/code&gt; to jump right to it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2016-11-28T15:11:58.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28979" PostTypeId="1" AcceptedAnswerId="28980" CreationDate="2016-11-28T15:51:03.593" Score="5" ViewCount="2924" Body="&lt;p&gt;What is the difference between the two functions &lt;code&gt;func1&lt;/code&gt; and &lt;code&gt;func2&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun func1 (arg)&#xA;  (if (listp arg)&#xA;      (mapcar (lambda (x) (func1 x)) arg)&#xA;    arg))&#xA;&#xA;(func1 (list 1 2 3))&#xA;&#xA;(defun func2 (arg)&#xA;  (if (listp arg)&#xA;      (mapcar func2 arg)&#xA;    arg))&#xA;&#xA;(func2 (list 1 2 3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;func1&lt;/code&gt; works fine, but &lt;code&gt;func2&lt;/code&gt; throws &lt;code&gt;void-variable func2&lt;/code&gt;. Why?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="1979" LastEditDate="2019-12-25T17:33:21.060" LastActivityDate="2020-10-14T20:02:11.193" Title="Error void-variable on function name" Tags="|debugging|variables|quote|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28980" PostTypeId="2" ParentId="28979" CreationDate="2016-11-28T15:58:40.670" Score="11" Body="&lt;h1&gt;Short Answer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Replace &lt;code&gt;func2&lt;/code&gt; with &lt;code&gt;#'func2&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun func2 (arg)&#xA;  (if (listp arg)&#xA;      (mapcar #'func2 arg)&#xA;    arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Explanation&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/q/4578574/850781&quot;&gt;Emacs Lisp is a lisp-2 (like Common Lisp), not lisp-1 (unlike, say, Scheme)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e., every symbol in ELisp has a &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;value cell&quot;: accessed by &lt;code&gt;symbol-value&lt;/code&gt;, tested by &lt;code&gt;boundp&lt;/code&gt;, and used by the compiler when the symbol is in the &quot;variable&quot; position, i.e., &lt;em&gt;not&lt;/em&gt; as the first element of a list to be evaluated - like your use of &lt;code&gt;func2&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&quot;function cell&quot;: accessed by &lt;code&gt;symbol-function&lt;/code&gt;, tested by &lt;code&gt;fboundp&lt;/code&gt;, and used by the compiler when the symbol is in the &quot;function&quot; position, i.e., the first element of a list to be evaluated - like your use of &lt;code&gt;func1&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since &lt;code&gt;func2&lt;/code&gt; is in variable position and it has a function binding and not a variable binding, you are getting the &lt;code&gt;void variable&lt;/code&gt; error. You need to tell the compiler to use the function value instead of the variable value, and this is accomplished by prefixing it with &lt;code&gt;#'&lt;/code&gt; (you &lt;em&gt;can&lt;/em&gt; use the &lt;a href=&quot;https://stackoverflow.com/q/2701698/850781&quot;&gt;ordinary quote &lt;code&gt;'&lt;/code&gt;&lt;/a&gt; instead too, but it is a bad idea because it makes code less readable and self-documenting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://stackoverflow.com/q/18390586/850781&quot;&gt;Why use #' before function arguments in emacs-lisp?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-11-28T18:51:11.053" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28981" PostTypeId="1" AcceptedAnswerId="29001" CreationDate="2016-11-28T18:33:53.970" Score="18" ViewCount="7010" Body="&lt;p&gt;How can I bring all files with names that conform a specific regex, recursively in a directory tree, to a single dired buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I can rename/delete them all at once?&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="253" LastEditDate="2016-11-28T19:16:18.953" LastActivityDate="2017-07-30T03:38:47.850" Title="Finding files by names" Tags="|dired|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28982" PostTypeId="1" AcceptedAnswerId="28983" CreationDate="2016-11-28T19:52:35.887" Score="5" ViewCount="765" Body="&lt;p&gt;Is there any way to allow me to type in a new dir name that is not in the completion list generated by ivy-mode?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2018-12-08T17:09:20.577" Title="After enabling ivy-mode, `dired-create-directory' does not allow me to choose an entry not in the completion list" Tags="|dired|ivy|" AnswerCount="2" CommentCount="0" ClosedDate="2019-04-30T17:11:15.317" ContentLicense="CC BY-SA 3.0" />
  <row Id="28983" PostTypeId="2" ParentId="28982" CreationDate="2016-11-28T20:15:59.140" Score="6" Body="&lt;p&gt;Yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are 2 cases. The name you want to create doesn't match anything in the completion list, or when it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it doesn't, you can just type in the name and press enter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it does match, then pressing enter will get ivy to expand the name to the completion. Here you want to call &lt;code&gt;ivy-immediate-done&lt;/code&gt; which is bound to &lt;code&gt;C-M-j&lt;/code&gt; by default after you have typed the name.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="253" LastEditDate="2018-12-08T17:09:20.577" LastActivityDate="2018-12-08T17:09:20.577" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28984" PostTypeId="1" AcceptedAnswerId="29011" CreationDate="2016-11-28T21:54:33.190" Score="4" ViewCount="754" Body="&lt;p&gt;I am not sure what to search for. I have used emacs for 25+ years, but I am not a guru. I use it as a tool, and I don't want to spend much time changing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I generally like to have one window, or two windows that are each half height. I don't like it when some command or mode changes the height of one of the windows to more or less than half. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when I'm in a shell buffer and use tab completion, the buffer with completion options changes the window sizes, and I have to manually restore them to a 50-50 split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I seem to remember fixing this in the past, but I don't remember how. I don't know what command or mode is doing this now, but seems to be very often since the last major release. Can someone fix this or tell me how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if my tone is not pleasant. This is pissing me off much more than it should.&lt;/p&gt;&#xA;" OwnerUserId="11053" LastEditorUserId="262" LastEditDate="2016-11-30T18:30:45.430" LastActivityDate="2016-11-30T18:30:45.430" Title="Completions buffer messes up window sizes" Tags="|window|window-splitting|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28985" PostTypeId="2" ParentId="28969" CreationDate="2016-11-29T00:45:42.673" Score="0" Body="&lt;p&gt;Adding own answer since this cam be written as a macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro kmacro-fn (keys)&#xA;  `(lambda (&amp;amp;optional arg) &quot;&quot; (interactive &quot;p&quot;)&#xA;     (kmacro-exec-ring-item (quote (,keys 0 &quot;%d&quot;)) arg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'delete-surround-backtick     (kmacro-fn [?d ?s ?`]))&#xA;(fset 'delete-surround-single_quote (kmacro-fn [?d ?s ?']))&#xA;(fset 'delete-surround-double_quote (kmacro-fn [?d ?s ?\&quot;]))&#xA;(fset 'delete-surround-paren        (kmacro-fn [?d ?s ?(]))&#xA;(fset 'delete-surround-bracket      (kmacro-fn [?d ?s ?[]))&#xA;(fset 'delete-surround-brace        (kmacro-fn [?d ?s ?{]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2016-11-29T00:45:42.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28986" PostTypeId="2" ParentId="14750" CreationDate="2016-11-29T01:00:54.903" Score="2" Body="&lt;p&gt;&lt;code&gt;org-src-mode&lt;/code&gt; is a minor mode and evil-leader doesn't support these last time I checked. &lt;code&gt;evil-leader/set-key-for-mode&lt;/code&gt; is for major modes. In &lt;code&gt;org-src-mode&lt;/code&gt; the major mode is tied to the language of the source that you are editing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most natural way to accomplish what you want is to use &lt;code&gt;evil-define-minor-mode-key&lt;/code&gt; with the following. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-define-minor-mode-key 'normal 'org-src-mode &quot; s&quot; 'org-edit-src-exit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;evil-define-key&lt;/code&gt; too, but it does not always activate the key bindings for keys in maps connected to minor modes. &lt;/p&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="675" LastEditDate="2016-11-29T06:21:56.653" LastActivityDate="2016-11-29T06:21:56.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28987" PostTypeId="1" AcceptedAnswerId="28988" CreationDate="2016-11-29T03:15:43.883" Score="5" ViewCount="65" Body="&lt;p&gt;By customizing &lt;code&gt;org-agenda-confirm-kill&lt;/code&gt;, I am able to get confirmation when I kill a task in an agenda view. I can set this to &lt;code&gt;t&lt;/code&gt; to always ask for confirmation (which I don't want to do, because I usually just kill one off tasks instead of marking them &lt;code&gt;DONE&lt;/code&gt;), or to a number &lt;code&gt;n&lt;/code&gt; so that I have to confirm when a TODO spans &lt;code&gt;n&lt;/code&gt; or more lines. I currently have this set as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-confirm-kill 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will prevent me from accidentally removing a TODO with notes or other information that I am not seeing when in agenda view. However, I am also worried about accidentally deleting repeating tasks. &lt;strong&gt;Is there any way to get confirmation in the agenda views before killing repeating tasks?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-12-01T00:17:44.680" Title="Ask for confirmation before deleting repeating tasks in org-agenda views" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28988" PostTypeId="2" ParentId="28987" CreationDate="2016-11-29T04:02:59.490" Score="4" Body="&lt;p&gt;Advise &lt;code&gt;org-agenda-kill&lt;/code&gt; to check &lt;code&gt;org-get-repeat&lt;/code&gt; and prompt if there is a repeater.  Use a &lt;code&gt;:before-while&lt;/code&gt; advice so that execution stops if the querying function returns false.  Since we're doing this from the agenda we will first have to find and go to the actual location to check the repeater.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-agenda-repeating-p ()&#xA;  (let ((pos (get-text-property 0 'org-marker (thing-at-point 'line))))&#xA;    (save-window-excursion&#xA;      (org-goto-marker-or-bmk pos)&#xA;      (org-get-repeat))&#xA;    ))&#xA;&#xA;&#xA;(defun query-if-repeating (&amp;amp;rest args)&#xA;  (if (not (org-agenda-repeating-p))&#xA;      t&#xA;    (y-or-n-p &quot;Entry repeats.  Kill?&quot;))&#xA;  )&#xA;&#xA;(advice-add 'org-agenda-kill :before-while 'query-if-repeating)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2016-12-01T00:17:44.680" LastActivityDate="2016-12-01T00:17:44.680" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28989" PostTypeId="1" AcceptedAnswerId="29010" CreationDate="2016-11-29T04:13:33.517" Score="4" ViewCount="515" Body="&lt;p&gt;I am running emacsclient with the command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -t -a &quot;&quot; --eval &quot;some-exp&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;emacsclient -t -a &quot;&quot;&lt;/code&gt; is a must.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, for example, if I run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -t -a &quot;&quot; --eval &quot;nil&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when quitting emacsclient, the command line will have &quot;nil&quot; printed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how to totally stop the printing of the returned value ? (in here, it's nil).&lt;/p&gt;&#xA;" OwnerUserId="14115" LastEditorUserId="105" LastEditDate="2017-02-07T18:55:33.523" LastActivityDate="2017-02-07T18:55:33.523" Title="How to stop &quot;emacsclient -t -a '' --eval&quot; output to stdout?" Tags="|emacsclient|terminal-emacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28990" PostTypeId="1" AcceptedAnswerId="28992" CreationDate="2016-11-29T04:42:39.787" Score="6" ViewCount="1140" Body="&lt;p&gt;I'm having trouble getting Emacs to properly fill a section of text when the last word of a suitable line ends with a period. Emacs seems to think that words separated by a period (and space) are joined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I set the fill-column to 10 and enable auto-fill-mode, and I enter this text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Look up. See the sky?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd expect that emacs would break the line and it would end up...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Look up.&#xA;See the sky?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead, Emacs always breaks the line before the word that ends with a period.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Look&#xA;up. See&#xA;the sky?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to fix this? I appreciate the help!&lt;/p&gt;&#xA;" OwnerUserId="14116" LastActivityDate="2016-11-29T05:19:07.453" Title="How to have fill-paragraph/fill-region break the line after a period?" Tags="|fill-paragraph|auto-fill-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28991" PostTypeId="2" ParentId="27382" CreationDate="2016-11-29T05:02:00.310" Score="0" Body="&lt;p&gt;If your are OK with Ediff, this will do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/diff-buffers (buffer-A buffer-B)&#xA;  &quot;Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B.&quot;&#xA;  (ediff-buffers-internal buffer-A buffer-B nil nil 'ediff-buffers))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and call it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(my/diff-buffers &quot;*temp*&quot; &quot;*temp*&amp;lt;2&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-11-29T05:02:00.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28992" PostTypeId="2" ParentId="28990" CreationDate="2016-11-29T05:07:15.607" Score="5" Body="&lt;p&gt;You have &lt;code&gt;sentence-end-double-space&lt;/code&gt; set to its default value,&#xA;which is &lt;code&gt;t&lt;/code&gt;.  The relevant part of the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Non-&lt;code&gt;nil&lt;/code&gt; means a single space does not end a sentence.&#xA;  This is relevant for filling.  See also &lt;code&gt;sentence-end-without-period&lt;/code&gt;&#xA;  and &lt;code&gt;colon-double-space&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That variable needs to be set to &lt;code&gt;nil&lt;/code&gt; to get the&#xA;wrapping you expect.  So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq sentence-end-double-space nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Sentences.html&quot; rel=&quot;noreferrer&quot;&gt;manual node on Sentences&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-11-29T05:07:15.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28993" PostTypeId="2" ParentId="27731" CreationDate="2016-11-29T05:11:46.983" Score="3" Body="&lt;p&gt;It's true, that style of footnote no longer works. &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/tree/etc/ORG-NEWS&quot; rel=&quot;nofollow noreferrer&quot;&gt;ORG-NEWS&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Footnotes&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[1]-like constructs are not valid footnotes&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Using &lt;code&gt;[1]&lt;/code&gt; as a footnote was already discouraged in the manual, since&#xA;  it introduced too many false-positives in many Org documents.  These&#xA;  constructs are now unsupported.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If you used &lt;code&gt;[N]&lt;/code&gt; in some of your documents, consider turning them into&#xA;  &lt;code&gt;[fn:N]&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="145" LastActivityDate="2016-11-29T05:11:46.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28994" PostTypeId="2" ParentId="28990" CreationDate="2016-11-29T05:19:07.453" Score="2" Body="&lt;p&gt;I'm referring to &lt;a href=&quot;https://www.emacswiki.org/emacs/FillParagraph&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Wiki&lt;/a&gt; to answer your question.  &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Paragraph Boundaries&lt;/h2&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By default, text-mode assumes that empty lines separate paragraphs. The boundaries of paragraphs are determined by two variables. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the premise of your question seems to conflict with the definition of &lt;code&gt;paragraph&lt;/code&gt;.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an example in the same page where they try to add &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt; as members of bullet list and which should be treated as different paragraphs whenever the &lt;code&gt;fill-paragraph&lt;/code&gt; command is called.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq paragraph-start &quot;\f\\|[ \t]*$\\|[ \t]*[-+*] &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try if you could add your &lt;code&gt;.&lt;/code&gt; (full-stop followed by two spaces) to qualify as line break at the end of the line - which will allow fill paragraph to honor &lt;code&gt;.&lt;/code&gt; as line break.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2016-11-29T05:19:07.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28995" PostTypeId="1" AcceptedAnswerId="28999" CreationDate="2016-11-29T06:36:29.527" Score="13" ViewCount="9910" Body="&lt;p&gt;I wrote an alias for a huge command and stored it in &lt;code&gt;.bash_profile&lt;/code&gt; and to my surprise, emacs didn't pick up the alias that I wrote in &lt;code&gt;.bash_profile&lt;/code&gt;. After some searching in the internet, I created a &lt;code&gt;.bashrc&lt;/code&gt; file in my $HOME with the alias command and only after that emacs picked up the alias. I'm confused because &lt;em&gt;terminal.app&lt;/em&gt; takes alias from &lt;code&gt;.bash_profile&lt;/code&gt; but emacs takes alias only in &lt;code&gt;.bashrc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was running &lt;kbd&gt;M-x shell&lt;/kbd&gt; and I'm on macOS. Can someone explain me what's the relationship with emacs and &lt;code&gt;.bashrc&lt;/code&gt; &amp;amp; &lt;code&gt;.bash_profile&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More to the point, &lt;strong&gt;how can I get Emacs to read my &lt;code&gt;.bash_profile&lt;/code&gt; in addition to &lt;code&gt;.bashrc&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="253" LastEditDate="2016-12-14T16:35:23.157" LastActivityDate="2016-12-14T16:35:23.157" Title=".bash_profile or .bashrc for shell in emacs?" Tags="|shell|bash|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28996" PostTypeId="1" AcceptedAnswerId="28997" CreationDate="2016-11-29T08:44:56.430" Score="1" ViewCount="4228" Body="&lt;p&gt;What are the differences between shell-mode and shell-script-mode, or how/where would I read up the differences myself?&lt;/p&gt;&#xA;" OwnerUserId="10755" LastEditorUserId="253" LastEditDate="2016-11-29T14:51:22.390" LastActivityDate="2016-11-29T14:51:22.390" Title="differences of shell-mode vs. shell-script-mode?" Tags="|shell-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28997" PostTypeId="2" ParentId="28996" CreationDate="2016-11-29T10:00:18.120" Score="7" Body="&lt;p&gt;&lt;code&gt;shell-mode&lt;/code&gt; is to run shell inside Emacs, &lt;code&gt;shell-script-mode&lt;/code&gt; is a major mode for shell script editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/ShellMode&quot; rel=&quot;noreferrer&quot;&gt;https://www.emacswiki.org/emacs/ShellMode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/ShMode&quot; rel=&quot;noreferrer&quot;&gt;https://www.emacswiki.org/emacs/ShMode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-11-29T10:00:18.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28998" PostTypeId="2" ParentId="28996" CreationDate="2016-11-29T10:12:53.107" Score="4" Body="&lt;p&gt;&lt;code&gt;shell-mode&lt;/code&gt; is used by the interactive shell (command line) environment started by the &lt;code&gt;shell&lt;/code&gt; command (&lt;code&gt;spc : shell&lt;/code&gt;, or &lt;code&gt;M-x shell&lt;/code&gt; in regular Emacs). It is a variant of the comint mode, which sends lines of interactive input to an external (&quot;inferior&quot;) program -- like a lisp repl, python shell, ..., or your system shell in this case -- and puts its output back into the emacs buffer. In other word, it works like a simple terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shell script mode (&lt;code&gt;sh-mode&lt;/code&gt;) is for editing files that contain shell script, as the name indicates. It contains the syntax highlighting and indentation rules, and at least for regular emacs the keyboard shortcuts, to make editing these scripts more comfortable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shell scripts are little programs interpreted by the shell, like at startup, or when you want to automate things. They contain the same commands and control structures that you can also type on the command line.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-29T10:12:53.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28999" PostTypeId="2" ParentId="28995" CreationDate="2016-11-29T10:30:47.087" Score="17" Body="&lt;p&gt;This is the correct behaviour. &lt;code&gt;.bash_profile&lt;/code&gt; is for so-called login shells. Like when you log in to your computer in text mode, or in a terminal emulator to a different computer via &lt;code&gt;ssh&lt;/code&gt; or &lt;code&gt;telnet&lt;/code&gt; or ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;.bashrc&lt;/code&gt; is meant for non-login shells, like when you are already logged in and start a new xterm, or in this case emacs' &lt;code&gt;shell&lt;/code&gt; mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually the &lt;code&gt;.bash_profile&lt;/code&gt; contains commands to read in the &lt;code&gt;.bashrc&lt;/code&gt;, too:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [ -f ~/.bashrc ]; then&#xA;    . ~/.bashrc&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so the &lt;code&gt;.bashrc&lt;/code&gt; is read at every startup.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So, aliases belong into &lt;code&gt;.bashrc&lt;/code&gt;; it is also customary to create a separate &lt;code&gt;.bash_aliases&lt;/code&gt; and include it in &lt;code&gt;.bashrc&lt;/code&gt; via the same construct:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [ -f ~/.bash_aliases ]; then&#xA;    . ~/.bash_aliases&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-29T10:30:47.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29000" PostTypeId="2" ParentId="21386" CreationDate="2016-11-29T11:01:33.017" Score="3" Body="&lt;p&gt;Unfortunately my Macbook broke last year ... (and working with Emacs was a breeze)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use iTerm&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... I don't remember problems with &lt;code&gt;C-M-&lt;/code&gt;  combinations, maybe because I used iTerm (&lt;a href=&quot;https://www.iterm2.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.iterm2.com/&lt;/a&gt;). But because i found the pressing the keys together uncomfortable, i also used the following solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;ESC remap&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used Karabiner (&lt;a href=&quot;https://pqrs.org/osx/karabiner/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://pqrs.org/osx/karabiner/&lt;/a&gt;) to map Caps Lock to /both/ Esc (tap) and Ctrl (hold), this makes even vi usable ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just have to enable options like &quot;Control_L to Control_L&quot; and &#xA;&quot;when you type Control_L only, send Escape&quot; in Karabiner, and in the&#xA;Keyboard preference pane, click &quot;Modifier Keys…&quot;, and change Caps Lock to Control.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#controlescape&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#controlescape&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;btw: I hope you use a recent version of Emacs, even if you prefer the terminal, the version that comes with Mac OS is usually ancient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install recent GNU emacs via homebrew &lt;a href=&quot;http://brew.sh/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://brew.sh/index.html&lt;/a&gt;, standalone from &lt;a href=&quot;https://emacsformacosx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://emacsformacosx.com/&lt;/a&gt;, or as a os-x-ified distribution &lt;a href=&quot;http://aquamacs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://aquamacs.org/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-29T11:01:33.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29001" PostTypeId="2" ParentId="28981" CreationDate="2016-11-29T11:26:55.227" Score="16" Body="&lt;h1&gt;Wildcard&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x find-name-dired&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to get files according to a wildcard. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Find all files with suffix &quot;org&quot; in directory &quot;~/org/&quot;.  Enter the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x find-name-dired&#xA;~/org&#xA;*org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and enjoy.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Regular Expression&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x find-dired&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with suitable arguments to get files according to a regular expression.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Find all files with suffix &quot;org&quot; in directory &quot;~/org/&quot;.  Enter the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x find-dired&#xA;~/org&#xA;-regex &quot;.*org$&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and enjoy.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2016-11-29T11:26:55.227" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29002" PostTypeId="2" ParentId="28909" CreationDate="2016-11-29T12:24:17.003" Score="5" Body="&lt;p&gt;Not a direct answer to your question, but maybe this is a solution for you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x install-package shell-pop&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To install the package shell-pop from melpa or melpa-stable.&#xA;Then evaluate (for tryout in &lt;code&gt;*scratch*&lt;/code&gt; via &lt;code&gt;C-x C-e&lt;/code&gt;, later in your &lt;code&gt;.emacs&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;C-M-return&amp;gt;&quot;) 'shell-pop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This pops up a shell in the lower part of your frame, in this case when pressing ctrl-meta-ret. Repeating the keyboard sequence returns back where you were.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/kyagi/shell-pop-el&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/kyagi/shell-pop-el&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2016-11-29T12:37:40.403" LastActivityDate="2016-11-29T12:37:40.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29003" PostTypeId="1" AcceptedAnswerId="29004" CreationDate="2016-11-29T12:39:44.017" Score="7" ViewCount="732" Body="&lt;p&gt;I have the following code, which opens a file, inserts some text, saves the file and closes it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun batch (file)&#xA;  (find-file file)&#xA;  (end-of-buffer)&#xA;  (insert &quot;nix&quot;)&#xA;  (save-buffer)&#xA;  (kill-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the file is already visited the buffer gets closed. How to prevent that? How to keep the buffer, if &lt;code&gt;find-file&lt;/code&gt; does not created a new buffer? How to know, if a file has already been opened in a buffer?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="105" LastEditDate="2016-11-29T15:25:49.067" LastActivityDate="2016-11-29T15:25:49.067" Title="How to check, if a file is already visited?" Tags="|buffers|find-file|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29004" PostTypeId="2" ParentId="29003" CreationDate="2016-11-29T12:49:15.687" Score="10" Body="&lt;p&gt;&lt;code&gt;(get-file-buffer filename)&lt;/code&gt; returns the buffer visiting &lt;code&gt;filename&lt;/code&gt;, or &lt;code&gt;nil&lt;/code&gt; if there is none.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-File-Name.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-File-Name.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;a href=&quot;https://emacs.stackexchange.com/users/14114/justbur&quot;&gt;justbur&lt;/a&gt; proposes using &lt;code&gt;(find-buffer-visiting file)&lt;/code&gt; instead, as it also works when the buffer has a different name than the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So one solution would be sth in the lines of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun batch (file)&#xA;  (let ((keep (find-buffer-visiting file)))&#xA;    (find-file file)&#xA;    (end-of-buffer)&#xA;    (insert &quot;nix&quot;)&#xA;    (save-buffer)&#xA;    (unless keep (kill-buffer)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but there may be more elegant solutions.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-11-29T13:09:01.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29005" PostTypeId="1" AcceptedAnswerId="29007" CreationDate="2016-11-29T13:05:20.140" Score="7" ViewCount="691" Body="&lt;p&gt;Suppose that I have an Emacs session running, and that I step away from my computer for, say, 20 minutes.  Upon returning to my Emacs session, at some point I will press some key while the Emacs window has the focus.  This would be an example of the sort of event I'm calling &lt;code&gt;first-keypress-in-a-while&lt;/code&gt; &lt;sup&gt;1&lt;/sup&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a way to have Emacs automatically run some code whenever such an event happens.  IOW, I'm looking for something like a &lt;code&gt;first-keypress-in-a-while-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking through Emacs' &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html&quot; rel=&quot;noreferrer&quot;&gt;standard hooks&lt;/a&gt; I cannot immediately identify a good candidate, but maybe there is a non-obvious one that could do this job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, is there some other way that I could simulate/approximate such a hook's functionality?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;1&lt;/sup&gt; Of course, &lt;code&gt;in-a-while&lt;/code&gt; refers to some user-settable parameter corresponding to some minimum time interval, say 15 minutes.  The event I'm interested in is the first key press after a period of inactivity longer than this interval.  By &quot;inactivity&quot; I mean the state where Emacs detects no user interaction: no key-presses, no mouse clicks, etc.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2016-11-29T15:24:51.520" LastActivityDate="2016-12-06T12:56:56.057" Title="Looking for something like a `first-keypress-in-a-while-hook`" Tags="|hooks|events|idle-timer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29006" PostTypeId="2" ParentId="29005" CreationDate="2016-11-29T13:36:02.643" Score="6" Body="&lt;p&gt;I guess a solution of your problem is setting a flag with an idle timer, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Idle-Timers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Idle-Timers.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and checking/unsetting it with &lt;code&gt;post-self-insert-hook&lt;/code&gt; or a similar hook of your choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar *my-idle-flag* nil)&#xA;(run-with-idle-timer 900 t (lambda () (setq *my-idle-flag* t)))&#xA;(add-hook 'post-self-insert-hook&#xA;      (lambda()&#xA;        (if *my-idle-flag* (message &quot;plong&quot;))&#xA;        (setq *my-idle-flag* nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-11-29T13:36:02.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29007" PostTypeId="2" ParentId="29005" CreationDate="2016-11-29T13:41:08.613" Score="7" Body="&lt;p&gt;You could try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-run-fkpiawh ()&#xA;  (remove-hook 'pre-command-hook #'my-run-fkpiawh)&#xA;  (run-hooks 'first-keypress-in-a-while-hook))&#xA;(run-with-idle-timer 1200 t (lambda ()&#xA;                              (add-hook 'pre-command-hook&#xA;                                        #'my-run-fkpiawh)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After which you can use add functions to &lt;code&gt;first-keypress-in-a-while-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2016-12-06T12:56:56.057" LastActivityDate="2016-12-06T12:56:56.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29008" PostTypeId="1" CreationDate="2016-11-29T14:13:21.833" Score="5" ViewCount="2129" Body="&lt;p&gt;Once I connect to a remote computer using tramp. It connects but tramp keeps trying to open the connection.  This is the output that is printed again and again. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Tramp: Waiting for prompts from remote shell...done&#xA; Tramp: Found remote shell prompt on ‘gnu’&#xA; Tramp: Opening connection for gnu using ssh...done&#xA; Tramp: Opening connection for gnu using ssh...&#xA; Tramp: Sending command ‘exec ssh -q   -o ControlMaster=auto -o   &#xA; ControlPath='tramp.%C' -o ControlPersist=no -e none gnu’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know what's is wrong exactly. Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&#xA;The problem was not really resolved. I looked into &lt;code&gt;recenf&lt;/code&gt; as suggested by @MichaelAlbinus. I default recenf but nothing more. My rencenf config is below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'recentf)&#xA;(setq recentf-auto-cleanup 'never) ;; disable before we start recentf!&#xA;(recentf-mode 1)&#xA;&lt;/code&gt;&#xA;For now I'm getting away with &lt;code&gt;C-g&lt;/code&gt;  until it stop trying to connect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I defined this function when I lose patience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(defun tramp-refresh ()&#xA;  (interactive)&#xA;  (recentf-cleanup)&#xA;  (tramp-cleanup-all-buffers)&#xA;  (tramp-cleanup-all-connections))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="9340" LastEditDate="2017-04-06T15:59:28.967" LastActivityDate="2017-04-06T15:59:28.967" Title="Tramp keeps opening the connection" Tags="|tramp|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29010" PostTypeId="2" ParentId="28989" CreationDate="2016-11-29T15:10:13.213" Score="1" Body="&lt;p&gt;I don't really understand your concern. &lt;code&gt;emacsclient&lt;/code&gt;'s &lt;code&gt;--eval/-e&lt;/code&gt; always eval one expression and print the result to stdout, if you don't care about the result, simply ignore it or redirect it to &lt;code&gt;/dev/null&lt;/code&gt;. Anyway, it's easy to stop printing, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-advice server-eval-and-print (:filter-args (args) no-print)&#xA;  (list (car args) nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to advice &lt;code&gt;server-eval-and-print&lt;/code&gt; to just eval and bypass print. It should be easy to know how it works by taking a look at the function &lt;code&gt;server-eval-and-print&lt;/code&gt; in source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have &lt;code&gt;define-advice&lt;/code&gt;, which was added in Emacs 25.1, use this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun server-eval-and-print@no-print (args)&#xA;  (list (car args) nil))&#xA;&#xA;(advice-add 'server-eval-and-print :filter-args&#xA;            #'server-eval-and-print@no-print)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-11-29T15:10:13.213" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29011" PostTypeId="2" ParentId="28984" CreationDate="2016-11-29T15:33:08.183" Score="5" Body="&lt;p&gt;This appears to be a change in the way completion windows are created/removed. You can avoid it by setting &lt;code&gt;window-combination-resize&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq window-combination-resize t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The current default behaviour for completion buffers is to take all of the space needed from a single window. If this isn't enough to show all the completions, the window is enlarged to fit. Then, when the completion buffer is dismissed, the original buffer is restored, but the window size is left in its new, enlarged state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;code&gt;window-combination-resize&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; changes this behaviour. Instead of the new window getting all of its space from a single original window, it takes space proportionally from all the windows in the frame. And when the window is destroyed, its space is redistributed among the remaining windows. As a consequence, completion buffers 'steal' space from all windows when they are created, and return this stolen space to all windows when they are destroyed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This setting will also have other effects on your window management. Most notably, when you split a frame twice in a row in one direction (i.e., &lt;code&gt;C-x 2 C-x 2&lt;/code&gt; or &lt;code&gt;C-x 3 C-x 3&lt;/code&gt;, you'll get three equal sized windows, instead of one half-size window and two quarter-size windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the comments, I reported the original behaviour as a bug. This was acknowledged as an undesirable state, but from the response it sounds like fixing it is not a trivial task.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-11-29T15:33:08.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29014" PostTypeId="1" AcceptedAnswerId="29046" CreationDate="2016-11-29T18:31:15.590" Score="1" ViewCount="263" Body="&lt;p&gt;I've been using vanilla Emacs on OSX (via MacPorts or from emacsformacosx.com) pretty happily until a bug forced me to try a different version. I was recommended &lt;a href=&quot;https://bitbucket.org/mituharu/emacs-mac&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mituharu's branch&lt;/a&gt;, and have been very happy with its mild enhancements over vanilla Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, over the years I've grown used to using Alt as my Meta key, and Mituharu's branch defaults to Cmd/⌘. This is easily changed by customizing mac-command-modifier, however it lacks the OS X-style shortcuts that vanilla has (⌘-C/V for copy-paste for one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the easiest way to get those shortcuts? The only thing I found was &lt;a href=&quot;https://www.emacswiki.org/emacs/MacKeyMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;mac-key-mode&lt;/a&gt;, but that's not (yet?) packaged anywhere. Is there a better alternative?&lt;/p&gt;&#xA;" OwnerUserId="13026" LastActivityDate="2017-03-01T16:58:20.750" Title="Carbon Emacs ⌘-shortcuts in Mituharu-Emacs?" Tags="|osx|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29015" PostTypeId="1" AcceptedAnswerId="29018" CreationDate="2016-11-29T20:28:59.490" Score="0" ViewCount="1508" Body="&lt;p&gt;I am using Emacs 25.1 on a Mac.&#xA;When I try to &lt;code&gt;view&lt;/code&gt;, &lt;code&gt;preview&lt;/code&gt; or &lt;code&gt;live export&lt;/code&gt; a simple markdown file using markdown-mode in Emacs I obtain the following error: &lt;code&gt;/bin/bash: markdown: command not found&lt;/code&gt;(in my browser or in a &lt;code&gt;eww&lt;/code&gt; buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible a result of a conflict between markdown-mode and pandoc-mode? What can I do to be able to view/preview markdown files using markdown-mode?&lt;/p&gt;&#xA;" OwnerUserId="6988" LastActivityDate="2022-04-15T16:00:24.350" Title="How to compile, view or preview using markdown-mode" Tags="|markdown-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29016" PostTypeId="1" AcceptedAnswerId="29017" CreationDate="2016-11-29T20:49:54.523" Score="5" ViewCount="659" Body="&lt;p&gt;I have recently started using org-mode as an electronic lab notebook for my work, and would like to combine these files with the files that I have set up in my old lab notebook, which was done in LaTeX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way my old notebook works is that each day goes under a file, e.g. &lt;code&gt;20161129.tex&lt;/code&gt;, and this file is added to the notebook using the &lt;code&gt;\input{}&lt;/code&gt; command, so there is no preamble or &lt;code&gt;\begin{document}&lt;/code&gt; in &lt;code&gt;20161129.tex&lt;/code&gt;, and it just starts with &lt;code&gt;\section{2016-11-29 Tuesday}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given my file in &lt;code&gt;org-mode&lt;/code&gt;, e.g.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Logbook&#xA;:PROPERTIES:&#xA;:DATE_TREE:&#xA;:END:&#xA;** 2016&#xA;*** 2016-11 November&#xA;**** 2016-11-29 Tuesday&#xA;***** Validation cases for subgrid&#xA;Some text and some math ($a + b = c$) to export.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to export the 2016-11-09 subtree so that the resulting TeX file only contains the following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{2016-11-29  Tuesday}&#xA;Some text and some math ($a + b = c$) to export.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Preferably, this would be auto-exported and saved with the date (&lt;code&gt;2016-11-29.tex&lt;/code&gt;), but having the same thing in a LaTeX buffer would be almost as good.&lt;/p&gt;&#xA;" OwnerUserId="8972" LastActivityDate="2016-11-29T22:47:24.420" Title="Export org-mode to LaTeX without preamble and document environment" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29017" PostTypeId="2" ParentId="29016" CreationDate="2016-11-29T21:16:32.720" Score="5" Body="&lt;p&gt;&lt;code&gt;C-c C-e&lt;/code&gt; opens the export dialog.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At that point, &lt;code&gt;C-b&lt;/code&gt; to toggles 'body-only' - set this to 'on' to ignore all the preamble stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally, &lt;code&gt;C-s&lt;/code&gt; allows you to select the scope for export. In this case, select subtree and you should have what you're after:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;\section{2016-11-29 Tuesday}&lt;br&gt;&#xA;  \label{sec-1}&lt;br&gt;&#xA;  \subsection{Validation cases for subgrid}&lt;br&gt;&#xA;  \label{sec-1-1}&lt;br&gt;&#xA;  Some text and some math ($a + b = c$) to export.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For details, see &lt;a href=&quot;http://orgmode.org/manual/The-Export-Dispatcher.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(org) The export dispatcher&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-11-29T22:47:24.420" LastActivityDate="2016-11-29T22:47:24.420" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29018" PostTypeId="2" ParentId="29015" CreationDate="2016-11-29T21:21:37.533" Score="2" Body="&lt;p&gt;Since my comment fixed the problem, I'm posting it as an answer here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that you don't have any executable called markdown in your PATH. Installing daringfireball.net/projects/markdown (preferably from some package manager like homebrew) should fix it.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-11-29T21:21:37.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29019" PostTypeId="2" ParentId="19735" CreationDate="2016-11-29T21:22:45.763" Score="2" Body="&lt;pre&gt;&lt;code&gt;mv ~/.Rprofile{,.bak}&#xA;mv .RData{,bak}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think the issue is a nonstandard &lt;code&gt;options('prompt')&lt;/code&gt;. I (re)moved &lt;code&gt;~/.Rpofile&lt;/code&gt; and  the &lt;code&gt;.RData&lt;/code&gt; file for the working directory of the session and no longer had the blocking/endless waiting/frozen issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;prompt as an issue also showed up when octave's default prompt changed:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/27742075/emacs-freezes-when-running-an-octave-code-block-within-org-mode&quot;&gt;https://stackoverflow.com/questions/27742075/emacs-freezes-when-running-an-octave-code-block-within-org-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;setting my prompt is now pretty complicated&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.First &amp;lt;- function(...){&#xA;    updatePrompt &amp;lt;- function(...) {&#xA;      # Emacs Speaks Stats, use default prompt&#xA;      if(options('STERM')=='iESS') &#xA;           options(prompt=&quot;&amp;gt; &quot;); &#xA;      # Rstudio -- time but no colors&#xA;      else if( any(grepl(&quot;RStudio&quot;, .libPaths())) )&#xA;           options(prompt=format(Sys.time(), &quot;\n# %X\n#&amp;gt; &quot;))&#xA;      # command line R&#xA;      else &#xA;            options(prompt=format(Sys.time(),&#xA;                            &quot;\n\e[38;5;197m# \e[38;5;27m%X\e[0;0m\n &quot;))&#xA;      return(TRUE)&#xA;    }&#xA;&#xA;    # add prompt if we're in interactive mode&#xA;    if(interactive()) { &#xA;     addTaskCallback(updatePrompt)&#xA;     updatePrompt()&#xA;    }&#xA; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/LabNeuroCogDevel/dotfiles/blob/master/Rprofile/.Rprofile&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/LabNeuroCogDevel/dotfiles/blob/master/Rprofile/.Rprofile&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14118" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-11-29T21:42:59.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29020" PostTypeId="1" CreationDate="2016-11-30T00:47:07.390" Score="1" ViewCount="1091" Body="&lt;p&gt;I am currently using pweave but will eventually need to switch to org mode on emacs.  The biggest issue i encounter is the persistence of variables and packages imported. &#xA;Here is the pweave code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#' Import module and create a variable:&#xA;import numpy as np&#xA;from numpy import pi, sin&#xA;x = np.arange(-2*pi, 2*pi, 0.1)&#xA;print(x[0:5])&#xA;&#xA;#' now we calculate sin(x)&#xA;y = sin(x)&#xA;print(y[0:5]  &#xA;&#xA;#' let's graph that&#xA;import matplotlib.pyplot as plt&#xA;plt.plot(x,y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is no problem in python's pweave, but in org mode, it fails to keep the variable and its type and the imported modules from one block code to the next. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the org mode attempt: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Import numpy module and create a numpy array:&#xA;#+BEGIN_SRC python :exports both &#xA;import numpy as np&#xA;from numpy import pi, sin &#xA;x = np.arange(-2*pi, 2*pi, 0.1)&#xA;return(x[0:5])&#xA;#+END_SRC&#xA;&#xA;* Then we calculate the sine of the numpy array created in previous block.&#xA;  At this stage, in pweave, both the array created and the module imported&#xA;  are already stored and available for use in the next block. And this is&#xA;  precisely where the bock code hits the road block in org mode because it&#xA;  did not cache the module nor the array for future use.&#xA;#+BEGIN_SRC python :exports both :results file &#xA;y = sin(x)&#xA;import matplotlib.pyplot as plt&#xA;fig = plt.figure()&#xA;plt.plot(x,y)&#xA;plt.savefig('~/fig.pdf')&#xA;return '~/fig.pdf'&#xA;#+END_SRC&#xA;&#xA;* finally, plotting x vs. y:&#xA;#+BEGIN_SRC python :exports both &#xA;return(y[0:5])&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It also raises the following question: do i really need to open a new block code just for the purpose of printing y?  How the previous block code handle 2 returns,the file and the print of variable y?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone has a solution for this, please ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13799" LastEditorUserId="13799" LastEditDate="2016-11-30T22:36:36.153" LastActivityDate="2016-12-01T10:29:00.423" Title="org-mode and python: persistence" Tags="|org-mode|python|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29021" PostTypeId="2" ParentId="28973" CreationDate="2016-11-30T01:15:20.833" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html#index-require&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs manual&lt;/a&gt; states that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If loading the file succeeds but does not provide feature, require&#xA;  signals an error, ‘Required feature &lt;em&gt;feature&lt;/em&gt; was not provided’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The version &quot;20161027.226&quot;, which is the version I also have, seems to work fine.  So my guess is that you might have two or more version of &lt;code&gt;ox-reveal&lt;/code&gt; in your &lt;code&gt;load-path&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens if you launch a new Emacs instance and do &lt;code&gt;M-x load-file&lt;/code&gt; and give &lt;code&gt;~/.emacs.d/elpa/ox-reveal-20161027.226/ox-reveal.el&lt;/code&gt; at the prompt.  And do &lt;code&gt;C-c C-e&lt;/code&gt;?  If this works, the one you just loaded and the one &lt;code&gt;(require 'ox-reveal)&lt;/code&gt; loaded is different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure how you write &lt;code&gt;~/&lt;/code&gt; on Cygwin, though.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastActivityDate="2016-11-30T01:15:20.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29022" PostTypeId="2" ParentId="20626" CreationDate="2016-11-30T01:43:56.210" Score="2" Body="&lt;p&gt;If what you are asking is &quot;how to include source code in my Arch package&quot;, it doesn't seem to belong here but maybe &lt;a href=&quot;https://unix.stackexchange.com/&quot;&gt;https://unix.stackexchange.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Are there configuration options Emacs' makefile that mean make install copies the C sources too?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What's the correct way to set find-function-C-source-directory in the package? Create a site-lisp?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you know, at build time, where your source code package will be installed, you could patch the source code.  But I'd override in site-lisp.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Are there any distros or platforms that already do this?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Not that I know of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because you, as a user, can always download Emacs source code, unpack in your home dir, set &lt;code&gt;find-function-C-source-directory&lt;/code&gt; accordingly to make it work just fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A great thing about &lt;code&gt;find-function&lt;/code&gt; is that it doesn't have to know the exact line number.  It will, instead, search the function in the source file.  So, minor changes or version differences do not affect the ability at all.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="-1" LastEditDate="2017-04-13T12:37:14.680" LastActivityDate="2016-11-30T01:43:56.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29023" PostTypeId="1" AcceptedAnswerId="29024" CreationDate="2016-11-30T04:35:07.510" Score="2" ViewCount="843" Body="&lt;p&gt;While working on a project, it is necessary to pull some branches from remote and merge into current branch. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To update another branch, we have to &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Stash local changes on current branch&lt;/li&gt;&#xA;&lt;li&gt;Checkout to required branch (say &lt;code&gt;foo&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Pull changes&lt;/li&gt;&#xA;&lt;li&gt;Switch back to previous branch&lt;/li&gt;&#xA;&lt;li&gt;Pop stash&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All these steps can be done with single command on terminal using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git fetch origin foo:foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to do the same with magit in single step?&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2016-11-30T05:18:11.130" Title="Magit - How to update a branch without using checkout?" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29024" PostTypeId="2" ParentId="29023" CreationDate="2016-11-30T05:18:11.130" Score="3" Body="&lt;p&gt;In addition to @phils valid observation, there is &lt;code&gt;f&lt;/code&gt; &lt;code&gt;o&lt;/code&gt; for &lt;code&gt;fetch other&lt;/code&gt;, you can then give it &lt;code&gt;origin&lt;/code&gt; and then &lt;code&gt;foo&lt;/code&gt;. This will update the &lt;code&gt;origin/foo&lt;/code&gt; branch, rather than the &lt;code&gt;foo&lt;/code&gt; branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can use &lt;code&gt;f&lt;/code&gt; &lt;code&gt;r&lt;/code&gt; for &lt;code&gt;fetch refspec&lt;/code&gt; and give it &lt;code&gt;origin&lt;/code&gt; and &lt;code&gt;foo:foo&lt;/code&gt; which will do exactly what your command line does.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-11-30T05:18:11.130" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29025" PostTypeId="2" ParentId="10445" CreationDate="2016-11-30T07:51:57.203" Score="1" Body="&lt;p&gt;Stumbled on this question when attempting not to make the &lt;code&gt;hl-line&lt;/code&gt; override the background (although it was indentation guides in this case):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I settled on this, which starts drawing the highlight line &lt;em&gt;after&lt;/em&gt; the indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-hl-line-range-function ()&#xA;  (cons&#xA;   (+ (line-beginning-position 1) (current-indentation))&#xA;   (line-beginning-position 2)))&#xA;(setq hl-line-range-function #'my-hl-line-range-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replacing &lt;code&gt;(+ (line-beginning-position 1) (current-indentation))&lt;/code&gt; with &lt;code&gt;(point)&lt;/code&gt; works too, (starting at the cursor).&lt;/p&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2016-11-30T07:51:57.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29026" PostTypeId="1" AcceptedAnswerId="29030" CreationDate="2016-11-30T09:56:16.003" Score="1" ViewCount="306" Body="&lt;p&gt;I'm trying to understand the seeking behaviour in evil-mode. suppose you have this ([|] is point):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;thi[s] is a text with a 'quote' -&amp;gt; command: ci'&#xA;this is a text with a '[|]'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evil seeks forward to the nearest quote pair, erases what's inside the pair, moves point to there and places you in insert mode. Very powerful. Now, when you try to do that with round brackets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;thi[s] is a text with a (round bracket) -&amp;gt; command: ci(&#xA;thi[s] is a text with a (round bracket) -&amp;gt; nothing happens&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in this case evil does not seek forward. seems that seeking forward only works with single and double quotes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why single and double quotes seek forward by default while the other text objects do not? How can I implement the seeking behaviour for evil text objects? &lt;/p&gt;&#xA;" OwnerUserId="12585" LastActivityDate="2016-11-30T11:33:40.713" Title="In evil-mode, how can I configure the seeking forward behaviour for all text objects?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29027" PostTypeId="1" CreationDate="2016-11-30T10:21:25.283" Score="0" ViewCount="426" Body="&lt;p&gt;Is there any function that can print a symlink's full path in &lt;code&gt;dired&lt;/code&gt; mode? Alternatively is there any function that can print an arbitrary buffers' full path?&lt;/p&gt;&#xA;" OwnerUserId="10753" LastEditorUserId="12585" LastEditDate="2016-11-30T16:32:05.567" LastActivityDate="2016-11-30T16:32:05.567" Title="print absolute path of symlink?" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29028" PostTypeId="2" ParentId="29020" CreationDate="2016-11-30T10:46:42.663" Score="5" Body="&lt;p&gt;Use the &lt;code&gt;:session&lt;/code&gt; option in the source header&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :session :results none&#xA; i = 10&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :session :results output&#xA; i+1&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: 11&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html&lt;/a&gt; for an introduction on python code blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/intro.html#orgheadline14&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/worg/org-contrib/babel/intro.html#orgheadline14&lt;/a&gt;&#xA;for a general introduction on org-babel.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;PS: To set the option for all python blocks in your file, add these lines to the end of it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# eval: (setq-local org-babel-default-header-args:python '((:session . &quot;*Python*&quot;)))&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and reload it (i.e. via &lt;code&gt;revert-buffer&lt;/code&gt;). You will be asked if local variables should be loaded, answer yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, put the &lt;code&gt;(setq-local ...)&lt;/code&gt; somewhere in the file (like an elisp block) and evaluate it with &lt;code&gt;C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;PPS: Applied to the listing of the OP given in their recent edit, after adapting the code a little ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Import numpy module and create a numpy array:&#xA;#+BEGIN_SRC python :session :exports both &#xA; import numpy as npx&#xA; from numpy import pi, sin &#xA; x = np.arange(-2*pi, 2*pi, 0.1)&#xA; x[0:5]&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| -6.28318531 | -6.18318531 | -6.08318531 | -5.98318531 | -5.88318531 |&#xA;&#xA;* Then we calculate the sine of the numpy array created in previous block.&#xA;  At this stage, ....&#xA; #+BEGIN_SRC python :session :exports both :results file &#xA;  y = sin(x)&#xA;  import matplotlib.pyplot as plt&#xA;  fig = plt.figure()&#xA;  plt.plot(x,y)&#xA;  fname=&quot;fig.pdf&quot;&#xA;  plt.savefig(fname)&#xA;  fname&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[file:fig.pdf]] # shows a nice sine curve&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2016-12-01T10:29:00.423" LastActivityDate="2016-12-01T10:29:00.423" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29029" PostTypeId="1" CreationDate="2016-11-30T11:20:20.453" Score="2" ViewCount="1107" Body="&lt;p&gt;These two commands seem identical to me. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="14133" LastActivityDate="2016-11-30T17:53:04.687" Title="What is the difference between kill-ring-save and copy-region-as-kill?" Tags="|yank|kill-ring|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29030" PostTypeId="2" ParentId="29026" CreationDate="2016-11-30T11:33:40.713" Score="1" Body="&lt;p&gt;By default the paren text objects are defined with characters. If you define them with strings/regexps for the opening and closing delimiters, it should seek (because &lt;code&gt;evil-up-block&lt;/code&gt; is now used).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For text objects where the opening/closing delimiter is the same (like &lt;code&gt;evil-inner-single-quote&lt;/code&gt;), you should use &lt;code&gt;evil-select-quote&lt;/code&gt; instead of &lt;code&gt;evil-select-paren&lt;/code&gt; to define the text object, and it should seek correctly.&lt;/p&gt;&#xA;" OwnerUserId="5278" LastActivityDate="2016-11-30T11:33:40.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29031" PostTypeId="2" ParentId="29029" CreationDate="2016-11-30T11:55:12.300" Score="5" Body="&lt;p&gt;Documentation for &lt;code&gt;kill-ring-save&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] This command is similar to ‘copy-region-as-kill’, except that it gives&#xA;  visual feedback indicating the extent of the region being copied.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Documentation for &lt;code&gt;copy-region-as-kill&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] This command’s old key binding has been given to ‘kill-ring-save’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;C-h f &amp;lt;function-name&amp;gt;&lt;/code&gt; to show the help of the function.&lt;/p&gt;&#xA;" OwnerDisplayName="user12181" LastEditorDisplayName="user12181" LastEditDate="2016-11-30T17:53:04.687" LastActivityDate="2016-11-30T17:53:04.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29033" PostTypeId="1" AcceptedAnswerId="29047" CreationDate="2016-11-30T16:12:41.023" Score="0" ViewCount="531" Body="&lt;p&gt;Wanting to export a figure generated by matplotlib to LaTeX (as described &lt;a href=&quot;http://kotfic.github.io/org-mode-export-of-matplotlib-images-etc.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;) I've encountered the following issue (which ultimately I was able to solve as described &lt;a href=&quot;https://emacs.stackexchange.com/a/29047/14127&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My source block has two noweb syntax references&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADER: :var path=&quot;./fig.png&quot;&#xA;#+BEGIN_SRC python :exports results :results file :noweb yes&#xA;&amp;lt;&amp;lt;get-modules&amp;gt;&amp;gt;&#xA;x = np.random.normal(0, 1, 100)&#xA;&amp;lt;&amp;lt;plot-figure&amp;gt;&amp;gt;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where get-modules and plot-figure are defined in the commented headline named Source blocks&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* COMMENT Source blocks&#xA;&#xA;   #+NAME: get-modules&#xA;   #+BEGIN_SRC python&#xA;   import numpy as np&#xA;   import matplotlib.pyplot as plt&#xA;   #+END_SRC&#xA;&#xA;   #+NAME: plot-figure&#xA;   #+BEGIN_SRC python&#xA;   plt.plot(x)&#xA;   plt.savefig(path)&#xA;   return path&#xA;   #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code works properly and after executing (with C-c C-c) I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;[[file:./fig.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, while exporting my document to LaTeX instead of default &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\includegraphics[width=.9\linewidth]{./fig.png}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have just&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\url{}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This problem does not occur when I give up noweb references, so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADER: :var path=&quot;./fig.png&quot;&#xA;#+BEGIN_SRC python :exports results :results file&#xA;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;x = np.random.normal(0, 1, 100)&#xA;plt.plot(x)&#xA;plt.savefig(path)&#xA;return path&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works as expected, but I would like to achieve this with noweb references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use org 8.3.4 version.&lt;/p&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-12-01T13:09:33.693" Title="Exporting a figure generated with org-babel and noweb reference syntax" Tags="|org-mode|org-babel|noweb|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29034" PostTypeId="2" ParentId="29027" CreationDate="2016-11-30T16:16:05.230" Score="2" Body="&lt;p&gt;Yes. this is lifted from &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-prelude&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun prelude-copy-file-name-to-clipboard ()&#xA;      &quot;Copy the current buffer file name to the clipboard.&quot;&#xA;      (interactive)&#xA;  (let ((filename (if (equal major-mode 'dired-mode)&#xA;                      default-directory&#xA;                    (buffer-file-name))))&#xA;    (when filename&#xA;      (kill-new filename)&#xA;      (message &quot;Copied buffer file name '%s' to the clipboard.&quot; filename))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Plus, in the most recent version, &lt;a href=&quot;https://github.com/jaypei/emacs-neotree&quot; rel=&quot;nofollow noreferrer&quot;&gt;neotree&lt;/a&gt; has a function for revealing the full path of the node point is at: &lt;code&gt;neotree-copy-filepath-to-yank-ring&lt;/code&gt;. I even have &lt;a href=&quot;https://github.com/ninrod/dotfiles/blob/57c8eac69132450f91907efff7f39846211e3d44/emacs/boot.org#ninrodneotree-copy-filepath-to-clipboard&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; on my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (defun ninrod/neotree-copy-path ()&#xA;  (interactive)&#xA;  (message (concat &quot;copied path: \&quot;&quot; (neotree-copy-filepath-to-yank-ring) &quot;\&quot; to the clipboard.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12585" LastActivityDate="2016-11-30T16:16:05.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29035" PostTypeId="2" ParentId="29027" CreationDate="2016-11-30T16:18:32.143" Score="3" Body="&lt;p&gt;&lt;code&gt;file-truename&lt;/code&gt; returns the real path of a file and follows symlinks. You can combine it into something like &lt;code&gt;(file-truename (buffer-file-name))&lt;/code&gt; to get the path of the file stored in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Expansion.html#File-Name-Expansion&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Expansion.html#File-Name-Expansion&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-11-30T16:18:32.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29038" PostTypeId="2" ParentId="3397" CreationDate="2016-11-30T20:04:38.490" Score="4" Body="&lt;p&gt;If you know you won't use javascript-mode ever again let auto-mode-alist untouched and add to your init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defalias 'javascript-mode 'js2-mode &quot;Some handy explanation goes here.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="970" LastActivityDate="2016-11-30T20:04:38.490" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29039" PostTypeId="1" AcceptedAnswerId="29848" CreationDate="2016-11-30T21:44:38.867" Score="0" ViewCount="526" Body="&lt;p&gt;This looks like &lt;a href=&quot;https://emacs.stackexchange.com/questions/24453/weird-shell-output-when-using-ipython-5&quot;&gt;Weird shell output when using IPython 5&lt;/a&gt;, but it actually is not. I did set &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter-args &quot;--simple-prompt -i --pylab&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in .emacs, but I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Python 2.7.12 (default, Nov 19 2016, 06:48:10) &#xA;Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&#xA;&#xA;IPython 5.1.0 -- An enhanced Interactive Python.&#xA;?         -&amp;gt; Introduction and overview of IPython's features.&#xA;%quickref -&amp;gt; Quick reference.&#xA;help      -&amp;gt; Python's own help system.&#xA;object?   -&amp;gt; Details about 'object', use 'object??' for extra details.&#xA;Using matplotlib backend: TkAgg&#xA;Warning: disable autoreload in ipython_config.py to improve performance.&#xA;&#xA;In [1]: &#xA;In [2]: &#xA;In [3]: &#xA;In [4]: for i in range(3):&#xA;File &quot;&amp;lt;ipython-input-4-658181e351fb&amp;gt;&quot;, line 1&#xA;for i in range(3):&#xA;                   ^&#xA;SyntaxError: unexpected EOF while parsing&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This appears after I hit return. I was expecting the interpreter to wait for the content of the loop. Note that if I do not set the python-shell-interpreter-args, the prompt is garbage, but there is no error.&lt;/p&gt;&#xA;" OwnerUserId="14129" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-01-06T19:01:15.150" Title="python emacs interpreter doesn't pause for input in loops" Tags="|shell|ipython|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29040" PostTypeId="2" ParentId="28637" CreationDate="2016-12-01T01:21:09.863" Score="0" Body="&lt;p&gt;org-gcal may help you, though it skips the step importing ical data into your ical app.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/myuhe/org-gcal.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/myuhe/org-gcal.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2016-12-01T01:21:09.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29041" PostTypeId="2" ParentId="28976" CreationDate="2016-12-01T02:11:02.790" Score="1" Body="&lt;p&gt;The answer I believe is that the argument list for &lt;code&gt;current-kill&lt;/code&gt; as defined in your session is &lt;code&gt;(ARG1 &amp;amp;optional ARG2)&lt;/code&gt;, whereas the argument list in at least the current release version of emacs is &lt;code&gt;(N &amp;amp;optional DO-NOT-MOVE)&lt;/code&gt;. The important difference is the replacement of &lt;code&gt;N&lt;/code&gt; with &lt;code&gt;ARG1&lt;/code&gt; in your version. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the very beginning of the &lt;code&gt;defadvice&lt;/code&gt; that you posted, it expects &lt;code&gt;N&lt;/code&gt; to be defined. In the release version of emacs, &lt;code&gt;N&lt;/code&gt; is bound when &lt;code&gt;current-kill&lt;/code&gt; is called, but in your case the value that would be bound to &lt;code&gt;N&lt;/code&gt; is bound to &lt;code&gt;ARG1&lt;/code&gt; instead. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking through the git history for emacs quickly, I couldn't find a point at which &lt;code&gt;current-kill&lt;/code&gt; had the same argument list as the definition you provided, so my guess is that in one of your packages (or some code you are loading) &lt;code&gt;current-kill&lt;/code&gt; is being redefined with a different argument list. That's just a guess though. &lt;/p&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="14114" LastEditDate="2016-12-01T03:49:15.797" LastActivityDate="2016-12-01T03:49:15.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29042" PostTypeId="1" AcceptedAnswerId="29052" CreationDate="2016-12-01T08:59:40.543" Score="3" ViewCount="434" Body="&lt;p&gt;I try to use &quot;Easy Customization&quot; for most of my customization of Emacs.  Some of my customizations are changes to the defaults, i. e. &lt;code&gt;sentence-end-base&lt;/code&gt; gets customized from:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;[.?!][]\&quot;'”)}]*&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;[.?!][]\&quot;'””)}]*\\( :-)\\)?&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When a new Emacs version is released, I have to go through all my customizations to see if the default has changed so that I need to reflect that in my customization as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some/most customizable variables have information about when their default value was introduced or changed, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom sentence-end-base &quot;[.?!][]\&quot;'”)}]*&quot;&#xA;  &quot;Regexp matching the basic end of a sentence, not including following     space.&quot;&#xA;  :group 'paragraphs&#xA;  :type 'string&#xA;  :version &quot;22.1&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would a sniplet look like that prompts for the Emacs version used previously and then lists all variables and faces that were customized and whose default has changed since that Emacs version?&lt;/p&gt;&#xA;" OwnerUserId="12068" LastActivityDate="2016-12-01T14:59:02.843" Title="List all customized variables and faces whose default has changed since a specified Emacs version?" Tags="|customization|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29043" PostTypeId="2" ParentId="29042" CreationDate="2016-12-01T09:42:59.523" Score="0" Body="&lt;p&gt;To iterate over all variables, one needs to use &lt;code&gt;mapatoms&lt;/code&gt;.  Variables and faces that have been customized have the properties &lt;code&gt;saved-value&lt;/code&gt; or &lt;code&gt;saved-face&lt;/code&gt; set.  The version when a default was changed is kept in the &lt;code&gt;custom-version&lt;/code&gt; property:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tl-list-customizations-with-changed-defaults (old-emacs-version)&#xA;  &quot;List customizations with changed defaults since OLD-EMACS-VERSION.&quot;&#xA;  (interactive &quot;sOld Emacs version: &quot;)&#xA;  (let (variables-with-changed-defaults)&#xA;    (mapatoms (lambda (symbol)&#xA;                (if (and&#xA;                     (or (get symbol 'saved-face)&#xA;                         (get symbol 'saved-value))&#xA;                     (get symbol 'custom-version)&#xA;                     (version&amp;lt; old-emacs-version (get symbol 'custom-version)))&#xA;                    (add-to-list 'variables-with-changed-defaults (cons (symbol-name symbol) (get symbol 'custom-version))))))&#xA;    (if variables-with-changed-defaults&#xA;        (message &quot;Customizations with changed defaults since %s: %s.&quot;&#xA;                 old-emacs-version&#xA;                 (mapconcat (lambda (v)&#xA;                              (concat (car v) &quot; (&quot; (cdr v) &quot;)&quot;))&#xA;                            (sort variables-with-changed-defaults&#xA;                                  (lambda (a b)&#xA;                                    (string&amp;lt; (car a) (car b))))&#xA;                            &quot;, &quot;))&#xA;      (message &quot;No customizations have changed defaults since %s.&quot; old-emacs-version))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12068" LastActivityDate="2016-12-01T09:42:59.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29044" PostTypeId="1" CreationDate="2016-12-01T10:32:38.107" Score="0" ViewCount="156" Body="&lt;p&gt;The menubar of the mac port emacs &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/5fnmwo/a_few_questions_about_emacs_macport/dalvltv/&quot; rel=&quot;nofollow noreferrer&quot;&gt;can not be disabled&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently use&#xA;&lt;code&gt;&#xA; (define-key global-map [menu-bar file] nil)&#xA; (define-key global-map [menu-bar edit] nil)&#xA; (define-key global-map [menu-bar options] nil)&#xA; (define-key global-map [menu-bar buffer] nil)&#xA; (define-key global-map [menu-bar tools] nil)&#xA; (define-key global-map [menu-bar help-menu] nil)&#xA;&lt;/code&gt;&#xA;to remove items from the global map.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I tried to use a loop to do so but failed&#xA;&lt;code&gt;&#xA;(dolist (menu '(file edit options buffer tools help-menu))&#xA;  (define-key global-map [menu-bar menu] nil))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just get confused with the variable type of &lt;code&gt;menu&lt;/code&gt; in &lt;code&gt;[menubar menu]&lt;/code&gt;. I'm not sure whether it is a symbol or not. So any suggestion on this will be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I'd like to get all the menubar items like from &lt;code&gt;check-doc-minor-map&lt;/code&gt; rather than just the &lt;code&gt;global-map&lt;/code&gt;. Can I achieve it? Or if there's some method to add hook to remove all the items before showing the menubar item, please let me know! Thanks!&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-12-01T10:32:38.107" Title="How to write a loop to remove all the items in menubar?" Tags="|menu-bar|menus|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29045" PostTypeId="2" ParentId="28714" CreationDate="2016-12-01T12:53:01.850" Score="1" Body="&lt;p&gt;Maybe the solution in the section &lt;a href=&quot;https://www.emacswiki.org/emacs/PhpMode#toc18&quot; rel=&quot;nofollow noreferrer&quot;&gt;Indentation of arrays&lt;/a&gt; of the &lt;a href=&quot;https://www.emacswiki.org/emacs/PhpMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs wiki php-mode page&lt;/a&gt;, or a variation of it, is what you are searching for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quotation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'php-mode-hook (lambda ()&#xA;  (defun ywb-php-lineup-arglist-intro (langelem)&#xA;    (save-excursion&#xA;      (goto-char (cdr langelem))&#xA;      (vector (+ (current-column) c-basic-offset))))&#xA;  (defun ywb-php-lineup-arglist-close (langelem)&#xA;    (save-excursion&#xA;      (goto-char (cdr langelem))&#xA;      (vector (current-column))))&#xA;  (c-set-offset 'arglist-intro 'ywb-php-lineup-arglist-intro)&#xA;  (c-set-offset 'arglist-close 'ywb-php-lineup-arglist-close)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Not sure if &lt;code&gt;defun&lt;/code&gt;s in a &lt;code&gt;lambda&lt;/code&gt; are good style, though ...)&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-12-01T12:53:01.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29046" PostTypeId="2" ParentId="29014" CreationDate="2016-12-01T13:00:29.673" Score="0" Body="&lt;p&gt;This is hardly ideal, but &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/term/ns-win.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;ns-win.el&lt;/a&gt; contains the NS port customizations. Here's the relevant bit (starts at line 103):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Here are some Nextstep-like bindings for command key sequences.&#xA;(define-key global-map [?\s-,] 'customize)&#xA;(define-key global-map [?\s-'] 'next-multiframe-window)&#xA;(define-key global-map [?\s-`] 'other-frame)&#xA;(define-key global-map [?\s-~] 'ns-prev-frame)&#xA;(define-key global-map [?\s--] 'center-line)&#xA;(define-key global-map [?\s-:] 'ispell)&#xA;(define-key global-map [?\s-?] 'info)&#xA;(define-key global-map [?\s-^] 'kill-some-buffers)&#xA;(define-key global-map [?\s-&amp;amp;] 'kill-this-buffer)&#xA;(define-key global-map [?\s-C] 'ns-popup-color-panel)&#xA;(define-key global-map [?\s-D] 'dired)&#xA;(define-key global-map [?\s-E] 'edit-abbrevs)&#xA;(define-key global-map [?\s-L] 'shell-command)&#xA;(define-key global-map [?\s-M] 'manual-entry)&#xA;(define-key global-map [?\s-S] 'ns-write-file-using-panel)&#xA;(define-key global-map [?\s-a] 'mark-whole-buffer)&#xA;(define-key global-map [?\s-c] 'ns-copy-including-secondary)&#xA;(define-key global-map [?\s-d] 'isearch-repeat-backward)&#xA;(define-key global-map [?\s-e] 'isearch-yank-kill)&#xA;(define-key global-map [?\s-f] 'isearch-forward)&#xA;(define-key global-map [?\s-g] 'isearch-repeat-forward)&#xA;(define-key global-map [?\s-h] 'ns-do-hide-emacs)&#xA;(define-key global-map [?\s-H] 'ns-do-hide-others)&#xA;(define-key global-map [?\s-j] 'exchange-point-and-mark)&#xA;(define-key global-map [?\s-k] 'kill-this-buffer)&#xA;(define-key global-map [?\s-l] 'goto-line)&#xA;(define-key global-map [?\s-m] 'iconify-frame)&#xA;(define-key global-map [?\s-n] 'make-frame)&#xA;(define-key global-map [?\s-o] 'ns-open-file-using-panel)&#xA;(define-key global-map [?\s-p] 'ns-print-buffer)&#xA;(define-key global-map [?\s-q] 'save-buffers-kill-emacs)&#xA;(define-key global-map [?\s-s] 'save-buffer)&#xA;(define-key global-map [?\s-t] 'ns-popup-font-panel)&#xA;(define-key global-map [?\s-u] 'revert-buffer)&#xA;(define-key global-map [?\s-v] 'yank)&#xA;(define-key global-map [?\s-w] 'delete-frame)&#xA;(define-key global-map [?\s-x] 'kill-region)&#xA;(define-key global-map [?\s-y] 'ns-paste-secondary)&#xA;(define-key global-map [?\s-z] 'undo)&#xA;(define-key global-map [?\s-|] 'shell-command-on-region)&#xA;(define-key global-map [s-kp-bar] 'shell-command-on-region)&#xA;;; (as in Terminal.app)&#xA;(define-key global-map [s-right] 'ns-next-frame)&#xA;(define-key global-map [s-left] 'ns-prev-frame)&#xA;&#xA;(define-key global-map [home] 'beginning-of-buffer)&#xA;(define-key global-map [end] 'end-of-buffer)&#xA;(define-key global-map [kp-home] 'beginning-of-buffer)&#xA;(define-key global-map [kp-end] 'end-of-buffer)&#xA;(define-key global-map [kp-prior] 'scroll-down-command)&#xA;(define-key global-map [kp-next] 'scroll-up-command)&#xA;&#xA;;; Allow shift-clicks to work similarly to under Nextstep.&#xA;(define-key global-map [S-mouse-1] 'mouse-save-then-kill)&#xA;(global-unset-key [S-down-mouse-1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are a few NS specific ones in there, but I imagine you should be&#xA;able to find the Mac port equivalents, if they exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You won't be able to just eval the file, though, as it contains a lot of very specific NS stuff that would probably break on the Mac port.&lt;/p&gt;&#xA;" OwnerUserId="7069" LastActivityDate="2016-12-01T13:00:29.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29047" PostTypeId="2" ParentId="29033" CreationDate="2016-12-01T13:08:33.440" Score="0" Body="&lt;p&gt;Everything came back to normal after removing the COMMENT of the Source block headline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually this behaviour is consistent: commented headline - as expected - is excluded from the exported version of a document. At the same time the code for noweb references is also excluded which results in empty link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second attempt - without noweb references - all code is in one place (in non commented headline) so export is done properly.&lt;/p&gt;&#xA;" OwnerUserId="14127" LastActivityDate="2016-12-01T13:08:33.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29048" PostTypeId="1" CreationDate="2016-12-01T13:16:12.473" Score="2" ViewCount="300" Body="&lt;p&gt;I reinstalled my whole system and after trying to load my previous Emacs config that works in the past, I always obtain an error: &#xA;&lt;code&gt;org-define-error&lt;/code&gt; and I follow de conflict line what is &lt;code&gt;(require 'ox-beamer)&lt;/code&gt; but I can't find this package but in my last installation of Emacs it works. Anybody knows what's happening here?&lt;/p&gt;&#xA;" OwnerUserId="13992" LastEditorUserId="1979" LastEditDate="2017-10-24T20:59:36.847" LastActivityDate="2018-07-22T03:12:41.593" Title="Error at init.el and orgmode export" Tags="|org-mode|init-file|org-export|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29050" PostTypeId="2" ParentId="28413" CreationDate="2016-12-01T13:59:22.673" Score="1" Body="&lt;p&gt;To create a new directory you can use either of the two commands (Ranger v1.7.2-1 on Arch Linux):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;F7&#xA;&#xA;:mkdir&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also assign your custom hotkey by editing file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/.config/ranger/rc.conf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14137" LastActivityDate="2016-12-01T13:59:22.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29052" PostTypeId="2" ParentId="29042" CreationDate="2016-12-01T14:59:02.843" Score="3" Body="&lt;p&gt;Command &lt;code&gt;customize-changed&lt;/code&gt; (unfortunately aliased to &lt;code&gt;customize-changed-options&lt;/code&gt;, even though it applies also to faces) does what you want, if I understand the question correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It opens a Customize buffer showing all of the options and faces that have changed in Emacs since the previous major release.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;customize-changed is an alias for &lt;code&gt;customize-changed-options&lt;/code&gt; in&#xA;  &lt;code&gt;cus-edit.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(customize-changed &amp;amp;optional SINCE-VERSION)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Customize all settings whose meanings have changed in Emacs itself.&#xA;  This includes new user options and faces, and new customization&#xA;  groups, as well as older options and faces whose meanings or&#xA;  default values have changed since the previous major Emacs&#xA;  release.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With argument &lt;code&gt;SINCE-VERSION&lt;/code&gt; (a string), customize all settings&#xA;  that were added or redefined since that version.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-01T14:59:02.843" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29053" PostTypeId="1" AcceptedAnswerId="29054" CreationDate="2016-12-01T20:43:02.147" Score="0" ViewCount="76" Body="&lt;p&gt;Emacs keeps pooping out random &lt;code&gt;.extension~&lt;/code&gt; files that are messing up my program. How do I prevent creation of these files?&lt;/p&gt;&#xA;" OwnerUserId="14138" LastActivityDate="2016-12-01T20:50:28.490" Title="Prevent creation of ~ files" Tags="|auto-save|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29054" PostTypeId="2" ParentId="29053" CreationDate="2016-12-01T20:50:28.490" Score="0" Body="&lt;p&gt;Try putting this in your configuration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq make-backup-files nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more elaborate answer and explanation of the underlying feature&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/151945/how-do-i-control-how-emacs-makes-backup-files&quot;&gt;https://stackoverflow.com/questions/151945/how-do-i-control-how-emacs-makes-backup-files&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13439" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-12-01T20:50:28.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29055" PostTypeId="1" AcceptedAnswerId="29274" CreationDate="2016-12-01T21:55:20.490" Score="1" ViewCount="380" Body="&lt;p&gt;I had this once upon a time but I have misplaced the bit that did it.  In an arbitrary file at point I want to make an external file orgmode link that sticks around long enough to paste elsewhere.  I am sure someone did this before as I used to have it.  But alas, I have misplaced it. &lt;/p&gt;&#xA;" OwnerUserId="11717" LastActivityDate="2016-12-14T06:11:53.483" Title="how do I capture point in arbitrary file as orgmode external file link?" Tags="|org-mode|hyperlinks|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29056" PostTypeId="2" ParentId="29048" CreationDate="2016-12-01T22:07:47.777" Score="1" Body="&lt;p&gt;The problem was the version of org, new is the 8 version but emacs on fedora should come with 7 version, this problem is fixed in sacha sua blogs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sachachua.com/blog/2014/05/update-org-7-comes-emacs-org-8-configuration-better-exports/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://sachachua.com/blog/2014/05/update-org-7-comes-emacs-org-8-configuration-better-exports/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13992" LastActivityDate="2016-12-01T22:07:47.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29057" PostTypeId="1" CreationDate="2016-12-01T23:13:28.500" Score="0" ViewCount="134" Body="&lt;p&gt;Launching &lt;code&gt;emacs&lt;/code&gt; with the &lt;code&gt;-Q&lt;/code&gt; option (default settings) shows TAB being correctly bound to &lt;code&gt;indent-for-tab-command&lt;/code&gt;. If I launch &lt;code&gt;emacs&lt;/code&gt; without the -Q, TAB is always being bound to &lt;code&gt;forward-button&lt;/code&gt; which is absolutely &lt;em&gt;not&lt;/em&gt; what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've commented everything out of my &lt;code&gt;~/.emacs&lt;/code&gt; file and the problem is still persisting. What could be changing the &lt;code&gt;TAB&lt;/code&gt; key behavior?&lt;/p&gt;&#xA;" OwnerUserId="14140" LastEditorUserId="14140" LastEditDate="2016-12-02T17:39:42.047" LastActivityDate="2016-12-02T18:16:31.520" Title="Tab key getting bounded to forward-button" Tags="|indentation|region|tabs|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29058" PostTypeId="2" ParentId="29057" CreationDate="2016-12-02T00:02:14.767" Score="0" Body="&lt;p&gt;Not sure what you experienced before or are expecting now, but you can do either of these things to indent the selected text (region):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-M-\&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;indent-region&lt;/code&gt;): Indent the region text either according to the current mode or using the function that is the value of variable &lt;code&gt;indent-region-function&lt;/code&gt;. (Use &lt;code&gt;C-f indent-region&lt;/code&gt; for more details.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-x TAB&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;indent-rigidly&lt;/code&gt;): Indent the region text a fixed amount. With no prefix arg, you can repeat and back up using the &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;right&lt;/code&gt; arrows. With a numeric prefix arg, indent that many chars (negative means reduce indentation).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If those keys do not seem to be bound as described then take a look at your init file, and adjust it accordingly.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-02T00:02:14.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29060" PostTypeId="2" ParentId="28942" CreationDate="2016-12-02T02:58:52.660" Score="1" Body="&lt;p&gt;I would suggest first installing emacs using pacman:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pacman -Sy emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then installing spacemacs using git:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OR your can use the develop version of spacemacs which is more current and will have more feataures:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git clone -b develop https://github.com/syl20bnr/spacemacs ~/.emacs.d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how yaourt installs spacemacs; I would use the suggested method of installing spacemacs as described in the documentation.&lt;/p&gt;&#xA;" OwnerUserId="12571" LastActivityDate="2016-12-02T02:58:52.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29061" PostTypeId="2" ParentId="28896" CreationDate="2016-12-02T06:19:55.430" Score="1" Body="&lt;p&gt;Thanks to &lt;a href=&quot;https://www.reddit.com/user/jbornhold&quot; rel=&quot;nofollow noreferrer&quot;&gt;jbornhold&lt;/a&gt; answer in &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/5fvibz/how_to_get_notifications_for_erc_in_macos/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; reddit discussion, I was able to enable notifications for erc nick mentions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how you can do it:-&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;install terminal notifier with &lt;code&gt;brew install terminal-notifier&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;install &lt;a href=&quot;https://github.com/julienXX/erc-terminal-notifier.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;erc-terminal-notifier.el&lt;/code&gt;&lt;/a&gt; and add &lt;code&gt;(require 'erc-terminal-notifier)&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You might want to enable &lt;code&gt;-reply&lt;/code&gt; option in &lt;code&gt;erc-terminal-notifier.el&lt;/code&gt; so that you get alert style notifications.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-12-02T06:19:55.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29062" PostTypeId="1" CreationDate="2016-12-02T07:19:07.880" Score="2" ViewCount="1218" Body="&lt;p&gt;I've set &lt;code&gt;fill-column&lt;/code&gt; value to be 80. But, especially for org-mode I want a bit higher fill-column value. Is it possible for &lt;code&gt;org-mode&lt;/code&gt; to have a separate &lt;code&gt;fill-column&lt;/code&gt; value of say 100?&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2022-08-02T04:44:47.580" Title="Separate fill-column value for org-mode" Tags="|org-mode|auto-fill-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29063" PostTypeId="2" ParentId="29062" CreationDate="2016-12-02T08:07:43.517" Score="3" Body="&lt;p&gt;This should do it:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'org-mode-hook &#xA;   (lambda () (setq fill-column 100)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13769" LastEditorUserId="18414" LastEditDate="2022-08-02T04:44:47.580" LastActivityDate="2022-08-02T04:44:47.580" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29064" PostTypeId="1" CreationDate="2016-12-02T08:33:01.910" Score="2" ViewCount="382" Body="&lt;p&gt;i've installed jdee from &lt;code&gt;package-list&lt;/code&gt; it was elpa i think .. color highlight and indentation are working fine . but &lt;/p&gt;&#xA;&#xA;&lt;p&gt;when i run any command ( JDEE commands )  i get this message :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Customize ‘jdee-server-dir’ to point to dir with JDEE jars. See&#xA;  &lt;a href=&quot;http://github.com/jdee-emacs/jdee-server&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://github.com/jdee-emacs/jdee-server&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;will i visited the link i don't know where to find the bundle files ?&lt;/p&gt;&#xA;" OwnerUserId="13722" LastActivityDate="2017-01-09T19:45:28.413" Title="setting JDEE-server in emacs?" Tags="|java|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29065" PostTypeId="2" ParentId="28676" CreationDate="2016-12-02T09:52:37.983" Score="3" Body="&lt;p&gt;Thanks to Marco Wahl and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/auth/Help-for-developers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this emacs documentation&lt;/a&gt; I came up with the following emacs-lisp to put in the PROPERTIES drawer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;...&#xA;:header-args: :dbpassword: (funcall (plist-get (nth 0 (auth-source-search :user &quot;Peter&quot; :port 3306 :require '(:secret))) :secret))&#xA;...&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The :port is not needed but I figured it would help narrow down the search for just MySQL DBs. The :require makes sure that the entry has a passphrase. I personally used this at the head of the file as &lt;code&gt;#+PROPERTY: header-args :dbpassword elisp-func&lt;/code&gt; but the function should work just as well in the PROPERTIES drawer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did try Marco Wahl's answer and it didn't work for me, unfortunately. My solution is very close to his though so I'm sure we looked through similar documentation.&lt;/p&gt;&#xA;" OwnerUserId="14143" LastActivityDate="2016-12-02T09:52:37.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29066" PostTypeId="2" ParentId="21739" CreationDate="2016-12-02T09:55:24.847" Score="1" Body="&lt;p&gt;I finally solved this with help from the Spacemacs Gitter channel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was a deeper issue with the definition of the major mode itself. More specifically (quoting NJBS's answer on Gitter):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Your issue is that sclang-mode doesn't define itself properly by&#xA;  deriving from fundamental-mode, but rather it defines itself using&#xA;  defun. You can change sclang-mode.el's mode definition to the&#xA;  following and your bindings should stick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-derived-mode sclang-mode fundamental-mode &quot;sclang-mode&quot;&#xA;  &quot;Major mode for editing SuperCollider language code.&#xA;\\{sclang-mode-map}&#xA;&quot;&#xA;  (sclang-mode-set-local-variables)&#xA;  (sclang-set-font-lock-keywords)&#xA;  (sclang-init-document)&#xA;  (sclang-make-document))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/dathinaios/spacemacs-supercollider/commit/923774f9885ce3fb7a5d500216ea1bbfea3bbfb3#diff-f40627aeb3458e3661c006ff120c8126&quot; rel=&quot;nofollow noreferrer&quot;&gt;Link to the commit where I fixed the issue.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11442" LastActivityDate="2016-12-02T09:55:24.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29067" PostTypeId="1" CreationDate="2016-12-02T11:49:51.677" Score="1" ViewCount="94" Body="&lt;p&gt;When I compile a file with pdflatex from Auctex one of the buffers that I have opened shows the output of this operation. How to stop this behavior and keep the previously opened buffers?&lt;/p&gt;&#xA;" OwnerUserId="7199" LastActivityDate="2016-12-02T11:49:51.677" Title="Auctex silent compilation" Tags="|auctex|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29068" PostTypeId="1" AcceptedAnswerId="29073" CreationDate="2016-12-02T12:09:21.850" Score="3" ViewCount="111" Body="&lt;p&gt;Org-capture appends its notes to the bottom of my notes.org file. But this places them below the &lt;code&gt;* Footnotes&lt;/code&gt; headline, which is problematic. Is there some way to configure &lt;code&gt;org-capture&lt;/code&gt; so new notes are sent above the &lt;code&gt;* Footnotes&lt;/code&gt; headline?&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-12-02T18:16:23.387" LastActivityDate="2016-12-02T18:16:23.387" Title="org-capture notes above footnotes header?" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29069" PostTypeId="1" AcceptedAnswerId="29074" CreationDate="2016-12-02T12:31:44.557" Score="3" ViewCount="1328" Body="&lt;p&gt;If I place &lt;code&gt;%^g&lt;/code&gt; in my capture template, org will prompt for tags, with completion. But typically, I like to brainstorm on relevant tags, after I finish writing my ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way to get tag completion by running &lt;code&gt;org-set-tags&lt;/code&gt; from within &lt;code&gt;org-capture&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="105" LastEditDate="2016-12-02T18:16:09.850" LastActivityDate="2016-12-02T18:16:09.850" Title="Tags completion from org-capture window" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29070" PostTypeId="1" CreationDate="2016-12-02T14:58:59.310" Score="1" ViewCount="182" Body="&lt;p&gt;When I open for example the file &lt;code&gt;syslog.conf&lt;/code&gt; on four different hosts with Tramp the buffer names are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;syslog.conf&lt;/li&gt;&#xA;&lt;li&gt;syslog.conf&amp;lt;2&gt;&lt;/li&gt;&#xA;&lt;li&gt;syslog.conf&amp;lt;3&gt;&lt;/li&gt;&#xA;&lt;li&gt;syslog.conf&amp;lt;4&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When I try to change the buffer with tab completion, this is all I see.  The information which buffer belongs to which host is not visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to tell Emacs to put the name of the remote host into the buffer name?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prefer the following buffer names for non local files.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;syslog.conf@host1&lt;/li&gt;&#xA;&lt;li&gt;syslog.conf@host2&lt;/li&gt;&#xA;&lt;li&gt;syslog.conf@host3&lt;/li&gt;&#xA;&lt;li&gt;syslog.conf@host4&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2016-12-02T15:27:33.330" Title="How to change the buffer unification suffix for non local files?" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29071" PostTypeId="1" CreationDate="2016-12-02T15:09:05.437" Score="0" ViewCount="117" Body="&lt;p&gt;I am trying to log all my todos in a &lt;code&gt;archive.org&lt;/code&gt; file, by means of the following function:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; (defun mark-done-and-archive ()&#xA;    (interactive)&#xA;    (org-todo 'done)&#xA;    (org-archive-subtree))&#xA;  (define-key global-map &amp;quot;\C-c\C-x\C-s&amp;quot; 'mark-done-and-archive)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The part to move the todos to the archive works,  but &lt;code&gt;(org-todo 'done)&lt;/code&gt; isn't working and in the archive the todo appears as TODO and not  as DONE. If I try to eval &lt;code&gt;(org-todo 'done)&lt;/code&gt; in org-buffer with &lt;code&gt;M-: (org-todo 'done)&lt;/code&gt;, it works so I don't know what's happening.&lt;/p&gt;&#xA;" OwnerUserId="13992" LastEditorUserId="3975" LastEditDate="2020-07-19T19:50:13.030" LastActivityDate="2020-07-19T19:50:13.030" Title="Problem with org-todo done function" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29072" PostTypeId="2" ParentId="29070" CreationDate="2016-12-02T15:10:35.020" Score="1" Body="&lt;p&gt;If the files on each host are in a different directory, you might be able to distinguish them by setting the variable &lt;code&gt;uniquify-buffer-name-style&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Uniquify.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(emacs) Uniquify&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When several buffers visit identically-named files, Emacs must give the buffers distinct names. The default method adds a suffix based on the names of the directories that contain the files. For example, if you visit files /foo/bar/mumble/name and /baz/quux/mumble/name at the same time, their buffers will be named ‘name’ and ‘name’, respectively. Emacs adds as many directory parts as are needed to make a unique name.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can choose from several different styles for constructing unique buffer names, by customizing the option uniquify-buffer-name-style. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emacs should do the right thing here. My settings are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq uniquify-buffer-name-style 'reverse)&#xA;(setq uniquify-separator &quot;/&quot;)&#xA;(setq uniquify-after-kill-buffer-p t) ; rename after killing uniquified&#xA;(setq uniquify-ignore-buffers-re &quot;^\\*&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I get the following buffer names when I open the same file on two hosts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;local &lt;code&gt;/etc/hosts&lt;/code&gt; is &lt;code&gt;hosts&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;remote &lt;code&gt;/etc/hosts&lt;/code&gt; is &lt;code&gt;hosts//scp:&amp;lt;username&amp;gt;@&amp;lt;remotehost&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-12-02T15:27:33.330" LastActivityDate="2016-12-02T15:27:33.330" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29073" PostTypeId="2" ParentId="29068" CreationDate="2016-12-02T15:40:32.860" Score="3" Body="&lt;p&gt;The best option here would be to configure your capture templates to add entries under a certain heading (e.g Tasks or Notes). That way the other content of the target file is not affected. See the examples in the &lt;a href=&quot;http://orgmode.org/manual/Capture-templates.html#Capture-templates&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;t&quot; &quot;Todo&quot; entry (file+headline &quot;~/org/gtd.org&quot; &quot;Tasks&quot;)&#xA;         &quot;* TODO %?\n  %i\n  %a&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another option would be to customize &lt;code&gt;org-reverse-note-order&lt;/code&gt; so that new entries are added at the top of the file rather than the end.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-02T15:49:40.520" LastActivityDate="2016-12-02T15:49:40.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29074" PostTypeId="2" ParentId="29069" CreationDate="2016-12-02T15:45:56.233" Score="3" Body="&lt;p&gt;In the capture window you can use standard Org commands. So at any point you could hit &lt;code&gt;C-c C-q&lt;/code&gt; (the default binding for &lt;code&gt;org-set-tags-command&lt;/code&gt;) to add tags. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to the &lt;a href=&quot;http://orgmode.org/manual/Setting-tags.html#Setting-tags&quot; rel=&quot;nofollow noreferrer&quot;&gt;Setting Tags&lt;/a&gt; section in the Org manual for more details about tag completion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted in the comments, this doesn't quite work. By default tag completion is derived from the current buffer, and the capture buffer is narrowed so that there are no tags to choose from. (You could widen the buffer, but that's clunky.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;org-capture-hook&lt;/code&gt; to set the available tags for the capture buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example you can use Org's global set of tags with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-capture-mode-hook&#xA;          (lambda ()&#xA;            (setq-local org-tag-alist (org-global-tags-completion-table))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will let you picks tags from any of your org agenda files. If you only want to see tags for the capture file, try this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-capture-mode-hook&#xA;          (lambda ()&#xA;            (save-restriction&#xA;              (widen)&#xA;              (setq-local org-tag-alist (org-get-buffer-tags)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-02T17:03:45.583" LastActivityDate="2016-12-02T17:03:45.583" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29075" PostTypeId="2" ParentId="29071" CreationDate="2016-12-02T17:18:46.223" Score="3" Body="&lt;p&gt;Your code works fine, the problem is the key binding. You are binding this key sequence in the global map. When you are in an org buffer, that binding will instead be resolved against &lt;code&gt;org-mode-map&lt;/code&gt;, so you'll get the default archive command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can verify this: in your org buffer, try &lt;code&gt;C-h k C-c C-x C-s&lt;/code&gt; and you'll see it is bound to &lt;code&gt;org-archive-subtree&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various ways to bind the key for org mode. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;          (lambda () (local-set-key &quot;\C-c\C-x\C-s&quot; 'mark-done-and-archive)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-12-02T17:18:46.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29076" PostTypeId="2" ParentId="29057" CreationDate="2016-12-02T18:16:31.520" Score="1" Body="&lt;p&gt;As suggested in the comments, you can check the binding of the TAB key using &lt;code&gt;C-h k TAB&lt;/code&gt;. Try starting emacs with &lt;code&gt;-Q&lt;/code&gt; and &lt;code&gt;-q&lt;/code&gt; to help narrow down where the binding might be set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;-Q&lt;/code&gt; Emacs skips all local init files so you'll get the default behavior. Tab should be bound to &lt;code&gt;indent-for-tab-command&lt;/code&gt;. With &lt;code&gt;-q&lt;/code&gt; Emacs skips your personal init file but will still load any site files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html#Init-File&quot; rel=&quot;nofollow noreferrer&quot;&gt;the Emacs manual&lt;/a&gt; for details about what files are loaded at startup. There may be &lt;code&gt;site-start.el&lt;/code&gt; or &lt;code&gt;default.el&lt;/code&gt; files on your load path that are changing things. You'll want to check the load path (&lt;code&gt;C-h v load-path&lt;/code&gt;) to see where such files might be found -- typically there is a &lt;code&gt;site-lisp&lt;/code&gt; directory in your Emacs installation directory.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-12-02T18:16:31.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29077" PostTypeId="1" AcceptedAnswerId="29078" CreationDate="2016-12-02T18:27:25.227" Score="0" ViewCount="103" Body="&lt;p&gt;I make a lot of notes in org-mode including emacs and elisp notes.&#xA;If I put the following in an org file I would like the find-grep-dired to be highlighted similar to how it is in a &lt;em&gt;Help&lt;/em&gt; buffer. It doesn't necessarily have to provide a link like &lt;em&gt;Help&lt;/em&gt; does but that would be an added bonus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;`find-grep-dired'   find all files containing a grep match&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do that?&lt;/p&gt;&#xA;" OwnerUserId="13934" LastActivityDate="2016-12-06T02:32:13.083" Title="Org mode display of elisp functions" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29078" PostTypeId="2" ParentId="29077" CreationDate="2016-12-02T19:38:55.987" Score="2" Body="&lt;p&gt;Not a direct answer to your question, but Org has a built-in concept of &lt;a href=&quot;http://orgmode.org/manual/External-links.html#External-links&quot; rel=&quot;nofollow noreferrer&quot;&gt;links&lt;/a&gt; that can be used for elisp commands and other things. Links are displayed in a certain way and can be followed using the command &lt;code&gt;org-open-at-point&lt;/code&gt; (&lt;code&gt;C-c C-o&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking at the &lt;em&gt;Help&lt;/em&gt; buffer for a command, try invoking &lt;code&gt;org-store-link&lt;/code&gt;. Then switch to an org buffer and call &lt;code&gt;org-insert-link&lt;/code&gt; (&lt;code&gt;C-c C-l&lt;/code&gt;). This will create a link to that documentation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can create help and lisp links, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; link to command help, displays &quot;help:find-grep-dired&quot;&#xA;[[help:find-grep-dired]]&#xA;&#xA;;; link to command help, displays &quot;find-grep-dired&quot;&#xA;[[help:find-grep-dired][find-grep-dired]]&#xA;&#xA;;; link to execute command, displays &quot;elisp:find-grep-dired&quot;&#xA;[[elisp:find-grep-dired]]&#xA;&#xA;;; link to execute lisp form, displays &quot;find foobar&quot;&#xA;[[elisp:(find-grep-dired &quot;~/org&quot; foobar)][find foobar]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-12-02T19:38:55.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29079" PostTypeId="1" CreationDate="2016-12-02T20:07:50.057" Score="2" ViewCount="169" Body="&lt;p&gt;My git hook would prompt for answer yes/no when do the push. How could I get the prompt and enter my input when using &lt;code&gt;Magit&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2016-12-02T20:33:59.177" Title="Does magit support interactive git hook?" Tags="|magit|hooks|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29080" PostTypeId="1" AcceptedAnswerId="29102" CreationDate="2016-12-02T20:32:49.927" Score="2" ViewCount="1862" Body="&lt;p&gt;I'm trying to get the &lt;a href=&quot;https://github.com/tpapp/unicode-math-input&quot; rel=&quot;nofollow noreferrer&quot;&gt;unicode-math-input&lt;/a&gt; package up and running in spacemacs;&#xA;the package depends on &lt;a href=&quot;https://github.com/vspinu/math-symbol-lists&quot; rel=&quot;nofollow noreferrer&quot;&gt;math-symbol-lists&lt;/a&gt;. Both packages are not featured in the official repositories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I know about spacemacs I think I have to create a custom layer in&#xA;&lt;code&gt;.emacs.d/private/&lt;/code&gt;. I called the layer &lt;code&gt;math&lt;/code&gt; so I have the folder&#xA;&lt;code&gt;.emacs.d/private/math/&lt;/code&gt; with two subfolders &lt;code&gt;math/local/unicode-math-input&lt;/code&gt;&#xA;and &lt;code&gt;math/local/math-symbol-lists&lt;/code&gt; (in which i cloned the respective github repositories).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;.emacs.d/private/math/packages.el&lt;/code&gt; file looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst math-packages&#xA;  '(&#xA;    (math-symbol-lists :location local)&#xA;    (unicode-math-input :location local)&#xA;&#xA;    (defun math/init-math ()&#xA;        (defun math/init-math-symbol-lists ()&#xA;            (use-package math-symbol-lists))&#xA;&#xA;        (defun math/init-unicode-math-input ()&#xA;            (use-package unicode-math-input))&#xA;    )&#xA;   )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Further I added the layer to &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; dotspacemacs-configuration-layers&#xA; '( &#xA;  math&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Spacemacs starts without problem, however the input method &lt;code&gt;unicode-math-input&lt;/code&gt; can't be selected with &lt;code&gt;M-x set-input-method&lt;/code&gt;. What am I missing?&#xA;Many thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="14148" LastEditorUserId="14148" LastEditDate="2016-12-02T20:50:50.740" LastActivityDate="2016-12-04T14:15:15.880" Title="Setting up private layer with local files in spacemacs" Tags="|package|spacemacs|use-package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29081" PostTypeId="1" AcceptedAnswerId="29084" CreationDate="2016-12-02T20:33:05.553" Score="3" ViewCount="300" Body="&lt;p&gt;I'm using &lt;code&gt;natbib&lt;/code&gt; commands like &lt;code&gt;\citep&lt;/code&gt; and &lt;code&gt;\citealt&lt;/code&gt; under BibLaTeX thanks to the option &lt;code&gt;natbib=true&lt;/code&gt;. Yet AUCTeX won't highlight them the way it highlights, for example, &lt;code&gt;\cite&lt;/code&gt; (or &lt;code&gt;\parencite&lt;/code&gt;, which is the BibLaTeX equivalent of &lt;code&gt;\citep&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using AUCTeX 11.89.7 on Emacs 24.5.1 (i686-pc-mingw32).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only files other than the master file seem to be affected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;master file (test.tex):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\usepackage[natbib=true]{biblatex}&#xA;&#xA;\begin{document}&#xA;&#xA;\cite{}&#xA;\parencite{}&#xA;\citep{}&#xA;\citealt{}&#xA;&#xA;\input{test2.tex}&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KvsyL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KvsyL.png&quot; alt=&quot;master file&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;test2.tex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\cite{}&#xA;\parencite{}&#xA;\citep{}&#xA;\citealt{}&#xA;&#xA;&#xA;%%% Local Variables:&#xA;%%% mode: plain-tex&#xA;%%% TeX-master: &quot;test&quot;&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZMnct.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZMnct.png&quot; alt=&quot;test2.tex&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="12336" LastEditDate="2016-12-02T22:10:46.600" LastActivityDate="2016-12-02T22:19:31.987" Title="AUCTeX: Turn on syntax highlighting for natbib commmands under BibLaTeX" Tags="|auctex|syntax-highlighting|bibtex|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29082" PostTypeId="2" ParentId="29079" CreationDate="2016-12-02T20:33:59.177" Score="1" Body="&lt;p&gt;This will likely just work. If not, then you might have to customize &lt;code&gt;magit-process-yes-or-no-prompt-regexp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-12-02T20:33:59.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29083" PostTypeId="1" AcceptedAnswerId="29085" CreationDate="2016-12-02T21:29:21.320" Score="2" ViewCount="659" Body="&lt;p&gt;I have &lt;a href=&quot;https://emacswiki.org/emacs/TabBarMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tabbar&lt;/a&gt; installed and when I am using some function like &lt;code&gt;describe-key&lt;/code&gt; in emacs the resulting &lt;code&gt;*help*&lt;/code&gt; buffer has a tab bar at the top. This is a waste of space and is distracting. How can I disable the tab bar in popup buffers or just special buffers in general?&lt;/p&gt;&#xA;" OwnerUserId="12269" LastActivityDate="2016-12-02T22:25:22.710" Title="Disable tabbar in special buffers" Tags="|buffers|customize|customization|tabbar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29084" PostTypeId="2" ParentId="29081" CreationDate="2016-12-02T22:07:24.057" Score="3" Body="&lt;p&gt;This looks like a bug to me. You added the link to the master file to your file-local variables via &lt;code&gt;C-c _&lt;/code&gt;, as you should. And as you note in the comments, this automatically inserted the &lt;code&gt;mode: plain-tex&lt;/code&gt; line. This isn't what you want though, as the master file is in &lt;code&gt;LaTeX&lt;/code&gt; mode. If you manually change your file-local variables to the following, it should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; %%% Local Variables:&#xA; %%% mode: LaTeX&#xA; %%% TeX-master: &quot;test&quot;&#xA; %%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may need to reparse the file first (&lt;code&gt;C-c C-n&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. To be clear, the bug here is getting the wrong mode variable set by &lt;code&gt;C-c _&lt;/code&gt;. Everything else seems to work as expected.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-12-02T22:19:31.987" LastActivityDate="2016-12-02T22:19:31.987" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29085" PostTypeId="2" ParentId="29083" CreationDate="2016-12-02T22:25:22.710" Score="4" Body="&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'help-mode-hook 'tabbar-local-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tabbar-local-mode&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Toggle local display of the tab bar.&#xA;With prefix argument ARG, turn on if positive, otherwise off.&#xA;Returns non-nil if the new state is enabled.&#xA;When turned on, if a local header line is shown, it is hidden to show&#xA;the tab bar.  The tab bar is locally hidden otherwise.  When turned&#xA;off, if a local header line is hidden or the tab bar is locally&#xA;hidden, it is shown again.  Signal an error if Tabbar mode is off.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-12-02T22:25:22.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29086" PostTypeId="1" AcceptedAnswerId="29167" CreationDate="2016-12-02T23:11:32.137" Score="-1" ViewCount="272" Body="&lt;p&gt;I know about &lt;code&gt;shell-command-on-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to pipe a region through a non-shell command? The &lt;code&gt;start-process&lt;/code&gt; and &lt;code&gt;call-process&lt;/code&gt; functions invoke executables directly, without using the shell. I'd like to avoid shell overhead when piping the contents of a region into an external command, as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be done in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastActivityDate="2016-12-07T21:23:01.160" Title="Non-shell command on region?" Tags="|region|pipe|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29087" PostTypeId="1" AcceptedAnswerId="29088" CreationDate="2016-12-02T23:34:33.503" Score="3" ViewCount="1974" Body="&lt;p&gt;I would think this was really simple. I am trying to match closing delimiters in Emacs Lisp regex. I can match &lt;code&gt;{}()[&lt;/code&gt; no problem, but I cannot match &lt;code&gt;]&lt;/code&gt;. I have been using re-builder and have tried &lt;code&gt;&quot;[\\}\\)\\]]&quot;&lt;/code&gt;, &lt;code&gt;&quot;[\\}\\)]]&quot;&lt;/code&gt;, &lt;code&gt;&quot;[\\}\\)\\\]]&quot;&lt;/code&gt;, &lt;code&gt;&quot;[\\}\\)\\\\]]&quot;&lt;/code&gt;and it still won't match the closing square bracket. The brace and the parenthesis match just fine. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="12269" LastEditorUserId="105" LastEditDate="2016-12-03T00:11:28.520" LastActivityDate="2016-12-03T00:11:28.520" Title="How do I match a closing bracket in Emacs lisp" Tags="|regular-expressions|delimiters|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29088" PostTypeId="2" ParentId="29087" CreationDate="2016-12-02T23:41:55.093" Score="7" Body="&lt;p&gt;Put the &lt;code&gt;]&lt;/code&gt; as the first character after the &lt;code&gt;[&lt;/code&gt; which starts the character class, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[])}]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html&quot; rel=&quot;noreferrer&quot;&gt;This is the manual page&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2016-12-03T00:03:13.230" LastActivityDate="2016-12-03T00:03:13.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29090" PostTypeId="1" CreationDate="2016-12-03T09:42:18.923" Score="2" ViewCount="808" Body="&lt;p&gt;i have added the &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(require 'org-notmuch)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to my config and can verify it loads by seeing the notmuch link type in my org mode links. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;yet when i try to issue &lt;code&gt;org-store-link&lt;/code&gt; in a notmuch buffer i always get the error&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;user-error: No method for storing a link from this buffer&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any clue?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2019-03-28T21:55:52.770" Title="org-notmuch error: user-error: No method for storing a link from this buffer" Tags="|org-mode|notmuch|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29091" PostTypeId="2" ParentId="20651" CreationDate="2016-12-03T13:20:09.183" Score="4" Body="&lt;p&gt;I realize you asked specifically about org-mode,&#xA;but this might be of interest to others reading this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A general variable exists: &lt;code&gt;mouse-highlight&lt;/code&gt;. &#xA;Setting it to nil disables highlighting of clickable text in all modes, keeping intact the click function. &#xA;It is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Mouse-References.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;documented&lt;/a&gt; in the emacs manual. &lt;/p&gt;&#xA;" OwnerUserId="14150" LastActivityDate="2016-12-03T13:20:09.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29093" PostTypeId="1" CreationDate="2016-12-03T22:17:43.447" Score="2" ViewCount="219" Body="&lt;p&gt;While the default is a proportional font, I told &lt;code&gt;org-mode&lt;/code&gt; to use a monospaced font in tables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook (lambda () (variable-pitch-mode t)))&#xA;(with-eval-after-load 'org&#xA;  (set-face-attribute 'org-table nil :inherit 'fixed-pitch))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet for some reason this does not affect links inside tables, which then screw up the alignment (Emacs 24.5, Org-mode  8.2.10):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vgY3c.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vgY3c.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could be the reason for this and how can I fix it? &lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="12336" LastEditDate="2016-12-05T08:45:41.947" LastActivityDate="2016-12-05T08:45:41.947" Title="Links inside org-mode tables are not typeset in monospaced font" Tags="|org-mode|fonts|org-table|org-link|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29094" PostTypeId="1" AcceptedAnswerId="29097" CreationDate="2016-12-04T00:44:57.850" Score="3" ViewCount="166" Body="&lt;p&gt;I'm new to this forum and using VC in emacs so if this question has been answered or is just very basic, I apologize. At my employer we use a Version Control system that is not one of the systems supported by emacs. I was hoping there was a way to add a new mode. Presently I have all the commands as aliases in my .cshrc but would like to know if there is a way to integrate the system with emacs.&lt;/p&gt;&#xA;" OwnerUserId="14157" LastEditorUserId="253" LastEditDate="2016-12-04T03:50:34.833" LastActivityDate="2016-12-04T04:41:22.493" Title="Is there a way to add a new VC mode for a different tool?" Tags="|version-control|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29095" PostTypeId="1" CreationDate="2016-12-04T03:32:52.637" Score="3" ViewCount="1050" Body="&lt;p&gt;I am trying to implement a minor mode that displays in the modeline the current word count and the number of new words since the file was last opened. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some existing implementations with this type of functionality (e.g., nanowrimo.el). But as far as I can tell, all of the implementations I've found so far seem to re-count the entire buffer after each change (i.e. after each character insertion or deletion, kill, yank, undo, etc.) This makes emacs a bit slow and unresponsive on on large files. This would seem to be a very common problem, but I haven't found a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to keep track of the current word count in a variable and use before-change-functions and after-change-functions to update that count after every insertion, deletion, kill, yank, undo, etc. This involves counting only the changed character(s) and the immediately surrounding characters. (For example, if a space is inserted between two non-word characters, the word count increases by 1.) This approach is much faster/more efficient - but I haven't quite figured out all the details to make it work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there existing code that already does this, either using change hooks or any other method? Or, any thoughts about a good approach to do this?&lt;/p&gt;&#xA;" OwnerUserId="14111" LastEditorUserId="105" LastEditDate="2016-12-04T16:06:00.583" LastActivityDate="2017-03-09T03:17:07.680" Title="Fast/efficient way to keep a running word count" Tags="|mode-line|words|" AnswerCount="1" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="29096" PostTypeId="1" CreationDate="2016-12-04T04:15:55.783" Score="11" ViewCount="3992" Body="&lt;p&gt;I add &lt;code&gt;(setq dired-listing-switches &quot;-lXGh --group-directories-first&quot;)&lt;/code&gt; in my init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I go into dired mode. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ls does not support --dired; see ‘dired-use-ls-dired’ for more details.&lt;br&gt;&#xA;  insert-directory: Listing directory failed but ‘access-file’ worked&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;this error occurs. How can I solve this problem?&#xA;I want to sort directories first in dired mode.&#xA;My environment is macOS Sierra and emacs 25.1&lt;/p&gt;&#xA;" OwnerUserId="14064" LastEditorUserId="8604" LastEditDate="2016-12-05T16:42:26.687" LastActivityDate="2022-10-27T03:56:32.473" Title="How to sort directories first in dired?" Tags="|dired|osx|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29097" PostTypeId="2" ParentId="29094" CreationDate="2016-12-04T04:41:22.493" Score="5" Body="&lt;p&gt;Yes, VC is structured so as to be easy to add new backends.  The main code is in &lt;code&gt;vc.el&lt;/code&gt;, and then each backend has a &lt;code&gt;vc-&amp;lt;backend&amp;gt;.el&lt;/code&gt; file.&#xA;Check all the &lt;code&gt;vc-&amp;lt;backend&amp;gt;.el&lt;/code&gt; provided with Emacs to see what is needed.  Basically, you'll want to start by defining a &lt;code&gt;vc-&amp;lt;backend&amp;gt;-registered&lt;/code&gt; function which returns non-nil if the file is under control of &lt;code&gt;&amp;lt;backend&amp;gt;&lt;/code&gt;.  And you'll want to add your &lt;code&gt;&amp;lt;backend&amp;gt;&lt;/code&gt; to &lt;code&gt;vc-handled-backends&lt;/code&gt;.  Then errors will popup whenever a &lt;code&gt;vc-&amp;lt;backend&amp;gt;-&amp;lt;operation&amp;gt;&lt;/code&gt; function is needed.  And that &lt;code&gt;&amp;lt;operation&amp;gt;&lt;/code&gt; is described at the beginning of &lt;code&gt;vc.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-12-04T04:41:22.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29098" PostTypeId="2" ParentId="18808" CreationDate="2016-12-04T04:48:12.700" Score="0" Body="&lt;p&gt;I've had problems with emacs-daemon and themes for a while. I bind this to f5 and just execute it after I open my first frame. Without doing this spacemacs-dark doesn't appear quite right. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun startup-load ()&#xA;  &quot;Reload things because Emacs daemon has strange behavior with frames and themes.&quot;&#xA;  (interactive)&#xA;  (resize-frame-small)&#xA;  (load-theme 'spacemacs-dark t)&#xA;  (theme-setup-set-faces)&#xA;  (resize-frame-left))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastActivityDate="2016-12-04T04:48:12.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29099" PostTypeId="2" ParentId="29039" CreationDate="2016-12-04T04:59:22.597" Score="0" Body="&lt;p&gt;I get the same error with Emacs 25.1.1. Python 3.5.2 and ipython 5 changed things quite a bit and Emacs has not caught up yet. I would file an Emacs bug report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI: &#xA;Use of the pylab import is now discouraged and and the OO interface is recommended for most non-interactive usage&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And --pylab now deprecated from notebooks. I would create a jupiter profile and use plt. and np. conventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     (setq python-shell-interpreter-args &quot;--simple-prompt --pprint&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="13934" LastEditDate="2016-12-04T05:05:25.267" LastActivityDate="2016-12-04T05:05:25.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29100" PostTypeId="2" ParentId="29096" CreationDate="2016-12-04T05:53:22.273" Score="2" Body="&lt;p&gt;To get rid of the error, you could set &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-use-ls-dired  nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-Enter.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;entering dired&lt;/a&gt; in the manual)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I don't know if mac os x's ls now supports sorting in the way you intended, though. I installed coreutils via &lt;a href=&quot;http://brew.sh/&quot; rel=&quot;nofollow noreferrer&quot;&gt;homebrew&lt;/a&gt; to have a GNU &lt;code&gt;ls&lt;/code&gt;. And set &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq insert-directory-program &quot;/usr/local/bin/ls&quot;)&#xA;;; (setq dired-listing-switches &quot;your settings&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If the &lt;code&gt;ls-use-ls-dired&lt;/code&gt; option above does not work for you, and you don't want to install a separate binary, you could use emacs' ls emulation via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ls-lisp-use-insert-directory-program nil)&#xA;(require 'ls-lisp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then set &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ls-lisp-dirs-first t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/ls-in-Lisp.html#ls-in-Lisp&quot; rel=&quot;nofollow noreferrer&quot;&gt;ls in lisp&lt;/a&gt; in the manual.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;nb: Best wrap the options of your choice into a &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'dired-load-hook&#xA;  (lambda () ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2016-12-04T06:07:01.367" LastActivityDate="2016-12-04T06:07:01.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29101" PostTypeId="2" ParentId="29096" CreationDate="2016-12-04T06:03:43.977" Score="8" Body="&lt;p&gt;As @lawlist mentioned, you need to install &lt;code&gt;coreutils&lt;/code&gt; as the &lt;code&gt;ls&lt;/code&gt; command which ships with mac does not have the option to sort directories first. If you have homebrew, you could just type &lt;code&gt;brew install coreutils&lt;/code&gt;. This will also install &lt;code&gt;gls&lt;/code&gt; which emacs can use. Add this to your &lt;code&gt;.emacs&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq insert-directory-program &amp;quot;gls&amp;quot; &#xA;      dired-use-ls-dired t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;After adding this, your Dired listing values will work again on macOS&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="105" LastEditDate="2022-10-27T03:56:32.473" LastActivityDate="2022-10-27T03:56:32.473" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29102" PostTypeId="2" ParentId="29080" CreationDate="2016-12-04T14:15:15.880" Score="3" Body="&lt;p&gt;I just went through the same process in order to create a layer. Only I needed to include one package only:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq math-packages '((math-symbol-lists :location local)))&#xA;&#xA;(defun math/init-math-symbol-lists ()&#xA;  (use-package math-symbol-lists&#xA;    :init&#xA;    (progn&#xA;     ;; init commands&#xA;     )&#xA;    :config&#xA;    (progn&#xA;     ;; config commands (after init).&#xA;     )&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11442" LastActivityDate="2016-12-04T14:15:15.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29103" PostTypeId="2" ParentId="27979" CreationDate="2016-12-04T14:58:05.897" Score="3" Body="&lt;p&gt;cute-jumpers answer is perfectly functional. If you want to bind the action to another key rather than use avy's internal dispatch process then the following adapted code works quite well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-avy-paste-word (char)&#xA;  &quot;Paste a word selected with avy.&quot;&#xA;  (interactive (list (read-char &quot;char:&quot; t)))&#xA;  (let ((avy-action #'avy-action-copy))&#xA;    (when (avy-jump (concat &quot;\\b&quot; (string char)))&#xA;      (yank))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14161" LastEditorUserId="730" LastEditDate="2020-02-05T13:41:02.593" LastActivityDate="2020-02-05T13:41:02.593" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29104" PostTypeId="2" ParentId="29096" CreationDate="2016-12-04T16:05:47.780" Score="8" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use standard Emacs library &lt;code&gt;ls-lisp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ls-lisp)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize these two user options (you can just use &lt;code&gt;setq&lt;/code&gt; to set them in your init file, if you prefer):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;ls-lisp-dirs-first&lt;/code&gt;&lt;/strong&gt; to &lt;code&gt;t&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;ls-lisp-use-insert-directory-program&lt;/code&gt;&lt;/strong&gt; to &lt;code&gt;nil&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want to be able to sort Dired listings in many ways, using a menu, then load library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired-sort-menu.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;dired-sort-menu.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;. (You might also want to use &lt;a href=&quot;http://www.emacswiki.org/emacs/download/dired-sort-menu%2b.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;dired-sort-menu+.el&lt;/code&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-04T16:05:47.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29105" PostTypeId="2" ParentId="26842" CreationDate="2016-12-04T16:21:38.683" Score="0" Body="&lt;p&gt;You can use developer tools provided in your browser and &lt;code&gt;debugger;&lt;/code&gt; statements in code that you write. Web-mode doesn't provide any functionality for debugging JavaScript.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-12-04T16:21:38.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29106" PostTypeId="2" ParentId="28942" CreationDate="2016-12-04T18:05:22.760" Score="0" Body="&lt;p&gt;What worked for me is that I deleted the entire .emacs.d directory and deleted the .spacemacs file in my home directory since I was reinstalling spacemacs. For some odd reason the .spacemacs file wasn't letting Spacemacs reinstall. After that the process that @haff mentions works perfectly fine.&lt;/p&gt;&#xA;" OwnerUserId="14101" LastActivityDate="2016-12-04T18:05:22.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29107" PostTypeId="1" AcceptedAnswerId="29307" CreationDate="2016-12-04T18:19:15.100" Score="3" ViewCount="1655" Body="&lt;p&gt;Is there variable like &lt;code&gt;org-latex-default-class-options&lt;/code&gt; which will set default options for &lt;code&gt;\documentclass&lt;/code&gt; like file variable &lt;code&gt;#+LATEX_CLASS_OPTIONS&lt;/code&gt; do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This situation similar to variables &lt;code&gt;#+LATEX_CLASS&lt;/code&gt; and &lt;code&gt;org-latex-default-class&lt;/code&gt;.  I've found &lt;a href=&quot;https://emacs.stackexchange.com/questions/16864/how-do-i-configure-class-options-for-latex-export-in-my-emacs&quot;&gt;How do I configure class options for latex export in my .emacs?&lt;/a&gt;, but it's one-year-old and not so trivial.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-12-15T11:07:49.713" Title="Org LaTeX export: set default options for documentclass" Tags="|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29108" PostTypeId="2" ParentId="28629" CreationDate="2016-12-04T19:07:27.960" Score="3" Body="&lt;p&gt;I found answer by my own - part of rendering ansi color codes in emacs originally answered &lt;a href=&quot;https://stackoverflow.com/questions/23378271/how-do-i-display-ansi-color-codes-in-emacs-for-any-mode&quot;&gt;here&lt;/a&gt;, I will double it here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ansi-color)&#xA;(defun display-ansi-colors ()&#xA;    (interactive)&#xA;    (ansi-color-apply-on-region (point-min) (point-max)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As for copying tmux buffer to with ansi codes for color - also was already answered &lt;a href=&quot;https://unix.stackexchange.com/questions/103108/capture-colors-with-tmux-buffer-copy-hardcopy&quot;&gt;here&lt;/a&gt;, and it here also:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bind H capture-pane -e \; save-buffer ~/tmux.hardcopy \; delete-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9056" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-12-04T19:07:27.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29109" PostTypeId="1" AcceptedAnswerId="29110" CreationDate="2016-12-04T21:08:32.720" Score="1" ViewCount="827" Body="&lt;p&gt;I have a large number of text files with notes, and would like to add meta data (tags and comments) to each file, and display them when using dired. I am using windows 10, and emacs 25.0.93.1 (x86_w64-mingw32).&lt;/p&gt;&#xA;&lt;p&gt;So I have installed file-props.el for this purpose, with file-props.el in my load path and  the following lines added to my init.el file:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(require 'file-props)&#xA;(file-props-load-properties)&#xA;(file-props-dired-activate-display)&#xA;(file-props-dired-setup-keybindings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But when I try using the&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;file-props-add-to-current-file&lt;/code&gt; (when inside a text file) or&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;file-props-dired-add-tags&lt;/code&gt; (when having marked a text file in dired)&lt;/p&gt;&#xA;&lt;p&gt;I get the following error message:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7QyTz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7QyTz.png&quot; alt=&quot;Error message when using file-props commands&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Can anybody see whats wrong in my use of file-props? Thanks in advance for any help!&lt;/p&gt;&#xA;&lt;p&gt;Are there other functions than file-props to add meta data to text files, when working in emacs?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-04T22:25:22.877" Title="How can I add meta data to text files by using &quot;file-props.el&quot;" Tags="|files|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29110" PostTypeId="2" ParentId="29109" CreationDate="2016-12-04T22:17:24.673" Score="2" Body="&lt;p&gt;(The error message is telling you that something expected a list and instead was passed a symbol (that names the file).  Turn on &lt;code&gt;debug-on-error&lt;/code&gt;, so you can see what the calling function is.  Then use &lt;code&gt;C-h f&lt;/code&gt; for that function, to see how it should be called instead.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I can't speak to &lt;a href=&quot;http://www.emacswiki.org/emacs/download/file-props.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;file-props.el&lt;/code&gt;&lt;/a&gt;.  But I can speak to this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Are there other functions than file-props to add meta data to text files, when working in emacs?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bookmark+&lt;/a&gt; provides tons of functions for adding &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags&quot; rel=&quot;nofollow noreferrer&quot;&gt;tags&lt;/a&gt; to and removing tags from &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#AutofileBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;autofile bookmarks&lt;/a&gt;, which means  arbitrary files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tags are arbitrary names (strings), by default, but they can have associated &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#TagsAsAttributes&quot; rel=&quot;nofollow noreferrer&quot;&gt;values&lt;/a&gt; that are Lisp objects of any kind.  That is, a tag is metadata of the most general sort.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In addition to tags, a bookmark (and thus a file) can have an &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkAnnotations&quot; rel=&quot;nofollow noreferrer&quot;&gt;annotation&lt;/a&gt;, which is a general textual description. The metadata of an annotation can be stored within the bookmark, or it can be &lt;em&gt;external&lt;/em&gt; (which is useful when it is long).  An external annotation can be a file, a URL, or another bookmark.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-12-04T22:25:22.877" LastActivityDate="2016-12-04T22:25:22.877" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29111" PostTypeId="1" CreationDate="2016-12-05T00:06:46.627" Score="1" ViewCount="689" Body="&lt;p&gt;I get the following in my minibuffer and I want to disable these basic help messages. Anyone know how?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Type C-x 1 to delete the help window&#xA;Type &quot;q&quot; in help window to restore it's previous buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looks like it comes from &lt;code&gt;help-window-display-message&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="105" LastEditDate="2016-12-05T01:01:44.707" LastActivityDate="2017-03-05T02:23:54.603" Title="echo-area: disable help messages" Tags="|help|echo-area|inhibit-message|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29112" PostTypeId="2" ParentId="29111" CreationDate="2016-12-05T00:38:15.360" Score="1" Body="&lt;p&gt;I found the answer here:&#xA;&lt;a href=&quot;https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages&quot;&gt;https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You suppress the message with advice-add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun suppress-messages (old-fun &amp;amp;rest args)&#xA;  &quot;Suppress messages from OLD-FUN with ARGS.&#xA;https://superuser.com/questions/669701/emacs-disable-some-minibuffer-messages&quot;&#xA;  (cl-flet ((silence (&amp;amp;rest args1) (ignore)))&#xA;    (advice-add 'message :around #'silence)&#xA;    (unwind-protect&#xA;         (apply old-fun args)&#xA;      (advice-remove 'message #'silence))))&#xA;&#xA;(advice-add 'help-window-display-message :around #'suppress-messages)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="-1" LastEditDate="2017-03-20T10:18:03.373" LastActivityDate="2016-12-05T00:38:15.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29113" PostTypeId="1" AcceptedAnswerId="29125" CreationDate="2016-12-05T02:40:09.807" Score="1" ViewCount="744" Body="&lt;p&gt;*Edit* &lt;code&gt;fci&lt;/code&gt; is no longer supported, emacs-27 supports this feature natively.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The are various &lt;a href=&quot;https://github.com/alpaker/Fill-Column-Indicator/issues&quot; rel=&quot;nofollow noreferrer&quot;&gt;known bugs&lt;/a&gt; with the fill-column indicator, there is one well &lt;a href=&quot;https://github.com/alpaker/Fill-Column-Indicator/issues/44&quot; rel=&quot;nofollow noreferrer&quot;&gt;known bug&lt;/a&gt; that occurs when the window is too narrow for the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Causing a column of &lt;code&gt;$&lt;/code&gt; to show on the right hand side of the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this has been broken for a while.&#xA;Is it possible to simply disable &lt;code&gt;fci-mode&lt;/code&gt; when the window is too narrow to display it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pqaoT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pqaoT.png&quot; alt=&quot;example of the problem&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2020-01-01T11:14:47.010" LastActivityDate="2020-01-01T11:14:47.010" Title="How to disable fill-column-indicator (fci) when it's outside the window?" Tags="|newlines|fill-column|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="29114" PostTypeId="1" CreationDate="2016-12-05T05:39:30.713" Score="3" ViewCount="175" Body="&lt;p&gt;I would like to call a function just before emacs exits. Normally the following can do job:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'kill-emacs-hook 'my-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately when I shutdown the system (MS Windows) or terminating the emacs process by some external tools, this does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it impossible to achieve this goal in such situations?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="454" LastEditDate="2016-12-05T09:42:56.240" LastActivityDate="2016-12-05T09:42:56.240" Title="Calling a function when emacs process is killed (MS Windows)" Tags="|hooks|microsoft-windows|exit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29115" PostTypeId="2" ParentId="29114" CreationDate="2016-12-05T09:36:44.940" Score="2" Body="&lt;p&gt;The manual explicitly states that &lt;code&gt;kill-emacs&lt;/code&gt; is called, running the &lt;code&gt;kill-emacs-hook&lt;/code&gt;, when &lt;code&gt;SIGTERM&lt;/code&gt; or &lt;code&gt;SIGKILL&lt;/code&gt; is recieved. So I would call this a bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Killing-Emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Killing-Emacs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I guess this has to do with how windows kills differently than POSIX, but it should be possible to implement the analog/correct behaviour.)&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-12-05T09:36:44.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29116" PostTypeId="2" ParentId="8182" CreationDate="2016-12-05T11:39:14.320" Score="4" Body="&lt;p&gt;Taken from the &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;online documentation&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;orgmode.org hosts Org ELPA archives.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Add this to your Emacs init file to be able to list the Org mode archives:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(require 'package)&#xA;  (add-to-list 'package-archives '(&quot;org&quot; . &quot;&lt;a href=&quot;http://orgmode.org/elpa/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/elpa/&lt;/a&gt;&quot;) t)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Then M-x list-packages RET will list both the latest org and org-plus-contrib packages.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;org&#xA;      contains the same set of files that are included in GNU Emacs.&#xA;  org-plus-contrib&#xA;      contains these files plus all contribs files, the ones you find in contrib/ from the git repo.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6760" LastActivityDate="2016-12-05T11:39:14.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29117" PostTypeId="1" AcceptedAnswerId="29138" CreationDate="2016-12-05T14:29:10.603" Score="2" ViewCount="1724" Body="&lt;p&gt;When using dired in emacs, how can I open an url file in a web browser outside emacs? &lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="105" LastEditDate="2016-12-05T15:23:01.997" LastActivityDate="2016-12-06T10:06:56.590" Title="How can I open an url file in emacs dired?" Tags="|dired|web-browser|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29118" PostTypeId="5" CreationDate="2016-12-05T15:01:22.147" Score="0" Body="&lt;p&gt;Polymode provides a framework for editing documents that combine multiple languages in a single file. Typical uses include markdown or LaTeX documents that include source code blocks. Polymode allows the user to edit the markdown or LaTeX text in the appropriate mode (ie., markdown-mode or AucTex), and seamlessly switches to the appropriate programming mode for the source code blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Polymode also provides support for compiling documents, with configurable export functions. This allows the user to export a markdown or LaTeX document, along with its embedded source code, into a pdf or html document that includes the results of running the source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/vspinu/polymode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Project hompage&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-12-05T22:00:14.813" LastActivityDate="2016-12-05T22:00:14.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29119" PostTypeId="4" CreationDate="2016-12-05T15:01:22.147" Score="0" Body="Polymode is an emacs package that offers generic support for multiple major modes inside a single emacs buffer. " OwnerUserId="262" LastEditorUserId="262" LastEditDate="2016-12-05T22:00:02.127" LastActivityDate="2016-12-05T22:00:02.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29120" PostTypeId="2" ParentId="28995" CreationDate="2016-12-05T16:21:52.493" Score="13" Body="&lt;p&gt;In addition to the points made by @pingi, you can also use a separate configuration file that will be loaded only for the emacs shell (&lt;code&gt;M-x shell&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the manual page &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Interactive-Shell.html&quot; rel=&quot;noreferrer&quot;&gt;(emacs) Interactive Shell&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs sends the new shell the contents of the file&#xA;  ‘~/.emacs_SHELLNAME’ as input, if it exists, where SHELLNAME is the name&#xA;  of the file that the shell was loaded from.  For example, if you use&#xA;  bash, the file sent to it is ‘~/.emacs_bash’.  If this file is not&#xA;  found, Emacs tries with ‘~/.emacs.d/init_SHELLNAME.sh’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is useful if you want to use a different shell prompt format within Emacs, or to define functions for passing files to emacsclient.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-12-05T16:21:52.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29122" PostTypeId="1" CreationDate="2016-12-05T16:38:01.777" Score="2" ViewCount="383" Body="&lt;p&gt;In Org Mode &lt;code&gt;fill-paragraph&lt;/code&gt; brakes the following paragraph (containing LaTeX displayed equation)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some headline&#xA;   Text text text&#xA;   \[&#xA;   e=mc^2&#xA;   \]&#xA;   text text text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some headline&#xA;  Text text text \[ e=mc^2 \] text text text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so the Org Mode form (with LaTeX preview) no longer reflects the LaTeX layout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent fill-paragraph from breaking LaTeX displayed equations?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; (edited on 11.04.2017)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By hacking &lt;code&gt;org-element.el&lt;/code&gt; file I've modified &lt;code&gt;org-element-paragraph-separate&lt;/code&gt; variable (in place of its definition). Now it includes also the &lt;code&gt;&quot;\\\\\\[&quot;&lt;/code&gt; regexp, so &lt;code&gt;\[&lt;/code&gt; is recognized as a place when new paragraph begins. The attempt to modify the &lt;code&gt;org-element-paragraph-separate&lt;/code&gt; in my init file has failed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately this is only a halfway solution: running &lt;code&gt;fill-paragraph&lt;/code&gt; with cursor point before &lt;code&gt;\[&lt;/code&gt; does not break the equation, as expected, but when I run &lt;code&gt;fill-paragraph&lt;/code&gt; having the cursor after &lt;code&gt;\[&lt;/code&gt; the paragraph changes to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some headline&#xA;  Text text text&#xA;  \[ e=mc^2 \] text text text.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="14127" LastEditDate="2017-04-11T19:09:12.950" LastActivityDate="2017-04-11T19:09:12.950" Title="Prevent fill-paragraph from breaking LaTeX displayed equations in Org Mode" Tags="|org-mode|fill-paragraph|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29123" PostTypeId="1" AcceptedAnswerId="29168" CreationDate="2016-12-05T18:46:51.023" Score="0" ViewCount="987" Body="&lt;p&gt;When I use emacs in a separate Window (under X), if I start slime the window is split horizontally if the window's width is smaller than its height, and vertically otherwise. Is it possible to force the direction of the splitting and make it independent of the dimensions of the emacs window? For example, I would like to have slime always open under my source code buffer. I cannot find anything about this in the documentation.&lt;/p&gt;&#xA;" OwnerUserId="2112" LastActivityDate="2019-01-26T12:32:53.957" Title="How to force the window splitting direction when starting slime?" Tags="|window-splitting|slime|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29125" PostTypeId="2" ParentId="29113" CreationDate="2016-12-05T22:19:07.390" Score="2" Body="&lt;p&gt;Here's a workaround that displays &lt;code&gt;fci&lt;/code&gt; when its needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that while it takes horizontal scroll into account, I couldn't find a hook to run when horizontal scrolling changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if &lt;code&gt;fci-rule-column&lt;/code&gt; isn't set it uses the value for &lt;code&gt;fill-column&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar i42/fci-mode-suppressed nil)&#xA;(make-variable-buffer-local 'i42/fci-mode-suppressed)&#xA;&#xA;(defun fci-width-workaround (frame)&#xA;  (let ((fci-enabled (symbol-value 'fci-mode))&#xA;        (fci-column (if fci-rule-column fci-rule-column fill-column))&#xA;        (current-window-list (window-list frame 'no-minibuf)))&#xA;    (dolist (window current-window-list)&#xA;      (with-selected-window window&#xA;        (if i42/fci-mode-suppressed&#xA;            (when (and (eq fci-enabled nil)&#xA;                       (&amp;lt; fci-column&#xA;                          (+ (window-width) (window-hscroll))))&#xA;              (setq i42/fci-mode-suppressed nil)&#xA;              (turn-on-fci-mode))&#xA;          ;; i42/fci-mode-suppressed == nil&#xA;          (when (and fci-enabled fci-column&#xA;                     (&amp;gt;= fci-column&#xA;                         (+ (window-width) (window-hscroll))))&#xA;            (setq i42/fci-mode-suppressed t)&#xA;            (turn-off-fci-mode)))))))&#xA;(add-hook 'window-size-change-functions 'fci-width-workaround)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="18378" LastEditDate="2018-03-23T21:19:09.607" LastActivityDate="2018-03-23T21:19:09.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29127" PostTypeId="1" AcceptedAnswerId="29133" CreationDate="2016-12-05T23:04:54.297" Score="4" ViewCount="990" Body="&lt;p&gt;I want to create a list how many times one tag use.&#xA;It will make me decide which one to put in &lt;code&gt;org-tag-persistent-alist&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data used can be obtained from &lt;code&gt;org-agenda-files&lt;/code&gt; or a specified file. Is there any emacs function to do that? Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="9923" LastActivityDate="2020-04-16T04:16:59.543" Title="make statistics of the tag use in org mode" Tags="|org-mode|org-tags|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29128" PostTypeId="1" AcceptedAnswerId="29129" CreationDate="2016-12-05T23:34:50.550" Score="3" ViewCount="1302" Body="&lt;p&gt;There exist functions to set tags, keywords, and priority values (&lt;code&gt;org-set-tags-to&lt;/code&gt;, &lt;code&gt;org-todo&lt;/code&gt;, and &lt;code&gt;org-priority&lt;/code&gt; respectively), but what about setting the heading (item) itself?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** TODO [#B] Some existing heading                      :URGENT:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(my/org-set-heading &quot;The new heading&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** TODO [#B] The new heading                            :URGENT:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting the heading is non-trivial; the logic needs to be mindful of outline folding, heading stars, the priority label, and tags-- at the very least.  Is there an org function that accomplishes this (or a 3rd-party library that includes one)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't found any org functions that accomplish this, but my &lt;em&gt;apropos-fu&lt;/em&gt; has certainly failed me before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A fairly thorough search suggests that I'll need to employ &lt;code&gt;org-complex-heading-regexp&lt;/code&gt;, special care to the subtree/folding, and possibly a patch request.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2018-07-01T10:38:58.123" Title="Programmatically setting an org-mode heading" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29129" PostTypeId="2" ParentId="29128" CreationDate="2016-12-05T23:59:14.543" Score="4" Body="&lt;p&gt;Here is a way to get there with org-dp (&lt;a href=&quot;https://github.com/tj64/org-dp&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tj64/org-dp&lt;/a&gt;, and its on MELPA):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org-dp)&#xA;&#xA;(let ((hl (progn&#xA;        (outline-previous-heading)&#xA;        (org-element-context))))&#xA;&#xA;  (org-dp-rewire&#xA;   nil ;; type.&#xA;   (buffer-substring (org-element-property :contents-begin hl)&#xA;             (org-element-property :contents-end hl))&#xA;   t ;; replace&#xA;   '(:title &quot;new headline&quot;)&#xA;   hl))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could wrap this in a function that sets the title to what you want. I think org-dp-rewire is what you want.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-05T23:59:14.543" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29130" PostTypeId="1" CreationDate="2016-12-06T01:25:31.503" Score="1" ViewCount="456" Body="&lt;p&gt;Is there a way to do the following rebase in Magit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;git rebase --onto master next topic&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="13865" LastActivityDate="2016-12-06T03:27:01.743" Title="Rebase --onto with Magit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29131" PostTypeId="1" AcceptedAnswerId="29132" CreationDate="2016-12-06T01:30:03.407" Score="7" ViewCount="1348" Body="&lt;p&gt;The other day I wanted to put the contents of a source code block into a header argument of another block. I couldn't find any ready to use function to do that though, so I came up with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun extract-src-content (name)    &#xA;  (save-excursion&#xA;    (org-babel-goto-named-src-block name)&#xA;    (car (nthcdr 21 (cadr (org-element-at-point))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that doesn't seem to be right. First my elisp experience is not that vast so I don't know how to extract the value for the &lt;code&gt;:value&lt;/code&gt; key out of &lt;code&gt;(cadr (org-element-at-point))&lt;/code&gt; so I just took the 21th element which can't be right and will probably break at the next org update. Second I still think there should be an org-function available to extract the contents of a named source code block, since it has to have a way to do that for export or editing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone has an answer to either question?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What's the right way to extract the value after &lt;code&gt;:value&lt;/code&gt; out of &lt;code&gt;(cadr (org-element-at-point))&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Is there a ready to use org-function (or even org-syntax) to accomplish the same thing?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Bonus question&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I tried to ask this on the #org-mode irc channel, but even though there are a lot of joined users it seems to be dead. Why is it still linked on &lt;a href=&quot;http://orgmode.org/community.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/community.html&lt;/a&gt; then?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="468" LastEditorUserId="468" LastEditDate="2016-12-06T19:56:56.910" LastActivityDate="2021-08-28T09:11:22.293" Title="Get contents of a named source block" Tags="|org-mode|org-babel|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29132" PostTypeId="2" ParentId="29131" CreationDate="2016-12-06T01:47:45.030" Score="10" Body="&lt;p&gt;Sometimes it helps to formulate a question to realize the answer. I did another look into the org-mode sources and found &lt;code&gt;org-element-property&lt;/code&gt; so I can do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-element-property :value (org-element-at-point))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of &lt;code&gt;(car (nthcdr 21 (cadr (org-element-at-point))))&lt;/code&gt; which is much better and according to John Kitchin also the built in way to do it.&lt;/p&gt;&#xA;" OwnerUserId="468" LastEditorUserId="468" LastEditDate="2018-01-24T04:05:32.760" LastActivityDate="2018-01-24T04:05:32.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29133" PostTypeId="2" ParentId="29127" CreationDate="2016-12-06T01:59:40.153" Score="6" Body="&lt;p&gt;I use the following chunk of elisp to create a dynamic block containing a table where each row is a tag and number of use of that tag in the file.  Add the block to your org file and hit &lt;code&gt;C-c C-c&lt;/code&gt; to expand it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: tagblock&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you only want to count certain tags you can add a &lt;code&gt;:tags&lt;/code&gt; option to the block and to add a label to the resulting table use &lt;code&gt;:label&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: tagblock :tags (&quot;tag1&quot; &quot;tag2&quot; &quot;tag3&quot;) :label tag-counts&#xA;| tag1 | 2 |&#xA;| tag2 | 4 |&#xA;| tag3 | 8 |&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the &lt;code&gt;:todo&lt;/code&gt; option, only entries with a todo state (either any or in a list you specify) will be counted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the real work is done by the function &lt;code&gt;org-freq-count&lt;/code&gt; which takes a parameterized search string (the same as an agenda tags search) and replaces &lt;code&gt;%s&lt;/code&gt; in the search with each element of &lt;code&gt;targets&lt;/code&gt;, counting the number of matches.  If &lt;code&gt;cmp&lt;/code&gt; is given, it will be used as a comparison function when sorting the output.  This code requires the external packages &lt;code&gt;dash&lt;/code&gt; and &lt;code&gt;s&lt;/code&gt;, which can be installed from the &lt;a href=&quot;https://melpa.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt; repository&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dash)&#xA;(require 's)&#xA;&#xA;(defun org-freq-count (search targets &amp;amp;optional cmp)&#xA;  (let ((cmp (if (functionp cmp)&#xA;                 cmp&#xA;               (lambda (a b) nil))))&#xA;&#xA;    (mapcar (lambda (x)&#xA;              (list x (length (org-map-entries t (format search x) nil))))&#xA;            (sort&#xA;             (delete-dups&#xA;              (-filter #'stringp targets))&#xA;             cmp)&#xA;            )&#xA;    ))&#xA;&#xA;(defun org--tagblock-all-tags ()&#xA;  (-filter #'stringp (-map #'car (append&#xA;                                  (org-get-buffer-tags)&#xA;                                  org-tag-alist&#xA;                                  org-tag-persistent-alist))))&#xA;&#xA;(defun org-write-freq-count (search targets name)&#xA;  (insert (s-concat&#xA;           (if name (insert (format &quot;#+NAME: %s\n&quot; name)))&#xA;           (mapconcat&#xA;            (lambda (x) (format &quot;| %s | %s |&quot; (nth 0 x) (nth 1 x)))&#xA;            (org-freq-count search targets)&#xA;            &quot;\n&quot;)))&#xA;  (org-table-align)&#xA;  )&#xA;&#xA;(defun org-dblock-write:tagblock (params)&#xA;  (let ((todo (plist-get params :todo))&#xA;        (tags (or (plist-get params :tags) (org--tagblock-all-tags)))&#xA;        (label (plist-get params :label))&#xA;        (caption (plist-get params :caption))&#xA;        )&#xA;    (when caption (insert (format &quot;#+CAPTION: %s\n&quot; caption)))&#xA;    (org-write-freq-count (cond ((equal todo t)&#xA;                                 (format &quot;%%s/%s&quot; (mapconcat 'identity&#xA;                                                             org-not-done-keywords&#xA;                                                             &quot;|&quot;&#xA;                                                             )))&#xA;                                ((listp todo)&#xA;                                 (format &quot;%%s/%s&quot; (mapconcat 'identity&#xA;                                                             todo&#xA;                                                        &quot;|&quot;&#xA;                                                        )))&#xA;                                (t &quot;%s&quot;))&#xA;                        tags&#xA;                        label&#xA;                        )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2020-04-16T04:16:59.543" LastActivityDate="2020-04-16T04:16:59.543" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="29134" PostTypeId="1" CreationDate="2016-12-06T02:26:31.363" Score="2" ViewCount="1513" Body="&lt;p&gt;I like the short notation of org-babel function calls. E.g. you can define a named code block like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: get_date&#xA;#+begin_src http&#xA;GET http://date.jsontest.com&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then hit C-c C-c in some inline call to get the results for some parameters (if it's a single line result that is):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call_get_date[:select &quot;.date&quot;]() {{{results(=12-06-2016=)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you can even do the code definition inline thus getting rid of 4 more lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_http[:select &quot;.date&quot;]{GET http://date.jsontest.com} {{{results(=12-06-2016=)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I find that is pretty cool, and I would like to use it more often. But I don't see a way to set a name for the inline result to reference it for later &lt;code&gt;:var&lt;/code&gt; assignments. Is there any? Or is there some simple elisp which could be employed here?&lt;/p&gt;&#xA;" OwnerUserId="468" LastEditorUserId="105" LastEditDate="2016-12-06T03:58:20.560" LastActivityDate="2017-10-22T10:12:43.147" Title="Get values of an inline result in org-mode" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29135" PostTypeId="2" ParentId="29077" CreationDate="2016-12-06T02:32:13.083" Score="3" Body="&lt;p&gt;I wrote &lt;a href=&quot;https://github.com/jkitchin/scimax/blob/master/emacs-keybinding-command-tooltip-mode.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jkitchin/scimax/blob/master/emacs-keybinding-command-tooltip-mode.el&lt;/a&gt; for this. It highlights things using the emacs documentation syntax:  [find-file] and `find-file'. The first one shows the keybinding, and the second shows the docstring in tooltips, and both are clickable to open the help.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-06T02:32:13.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29136" PostTypeId="2" ParentId="29130" CreationDate="2016-12-06T03:27:01.743" Score="1" Body="&lt;p&gt;Yes, &lt;code&gt;magit-rebase-subset&lt;/code&gt; (&lt;kbd&gt;rs&lt;/kbd&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2016-12-06T03:27:01.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29137" PostTypeId="1" CreationDate="2016-12-06T07:09:27.623" Score="2" ViewCount="1890" Body="&lt;p&gt;I was once able to read and write my Gmail email in Gnus, but now I am unable to and can't figure out the problem. There seem to be several problems -- (a) with my gpg2 setup; (b) with my gnus nnimap and gmane server connections; and (c) with the smtp connection. I have my email address and an app-specifc Gmail password in ~/.authinfo.gpg. I have reviewed other answers on similar topics but can't get it to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using OSX Sierra 12.2.1.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Error messages:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Opening gnus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nntp (news.gmane.org) open error: `'. Continue?(y or n)&#xA;;; y --&amp;gt;&#xA;&quot;Warning: Opening nnimap server on gmail...failed: ; Unable to open server nnimap+gmail due to: GPG error: \&quot;no usable configuration\&quot;, OpenPGP; Opening nntp server on news.gmane.org...failed: ; Server nntp+news.gmane.org previously determined to be down; not retrying; Opening nntp server on news.gmane.org...failed: ; Server nntp+news.gmane.org previously determined to be down; not retrying; Unable to open server nntp+news.gmane.org due to: GPG error: \&quot;no usable configuration\&quot;, OpenPGP&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notwithstanding all of that, I've drafted an email and try to send it, and I get this SMTP error (note that I have &lt;code&gt;starttls-gnutls-program&lt;/code&gt; set to &lt;code&gt;/usr/local/bin/gnutls-cli&lt;/code&gt;; when I run this on the command line outside emacs, I get the message &quot;No hostname specified.&quot;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/bin/bash: gnutls-cli: command not found&#xA;&#xA;Process smtpmail exited abnormally with code 127&#xA;/bin/bash: gnutls-cli: command not found&#xA;&#xA;Process smtpmail exited abnormally with code 127&#xA;2837:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-64/src/ssl/s23_clnt.c:618:&#xA;CONNECTED(00000008)&#xA;&#xA;Process smtpmail finished&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Setup info:&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs version:&#xA;&quot;GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.5.0, NS appkit-1404.47 Version 10.11.5 (Build 15F34))&#xA; of 2016-07-11&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;GPG2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;01:42 name@macbook ~ $ gpg2 --version&#xA;gpg (GnuPG) 2.0.30&#xA;libgcrypt 1.7.3&#xA;&#xA;Home: ~/.gnupg&#xA;Supported algorithms:&#xA;Pubkey: RSA, RSA, RSA, ELG, DSA&#xA;Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,&#xA;        CAMELLIA128, CAMELLIA192, CAMELLIA256&#xA;Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-encryption-mode 'nil)&#xA;&#xA;;; set up gpg agent&#xA;(setq epg-gpg-program &quot;/usr/local/Cellar/gnupg2/2.0.30_2/bin/gpg2&quot;)&#xA;;(setq epg-gpg-program &quot;/usr/local/Cellar/gnupg2/2.0.30_2/bin/gpg2&quot;)&#xA;(epg-config--make-gpg-configuration epg-gpg-program)&#xA;&#xA;(require 'nnir)&#xA;;; (setq gnus-select-method '(nntp &quot;news.gmane.org&quot;)) ;; if you read news groups&#xA;&#xA;(setq user-mail-address &quot;&quot;&#xA;      user-full-name    &quot;&quot;&#xA;      mml2015-signers '(&quot;&quot;))&#xA;(setq gnus-select-method '(nnml &quot;&quot;))&#xA;;; @see http://gnus.org/manual/gnus_397.html&#xA;(setq gnus-select-method&#xA;             '(nnimap &quot;gmail&quot;&#xA;                      (nnimap-address &quot;imap.gmail.com&quot;)&#xA;                      (nnimap-server-port 993)&#xA;                      (nnimap-stream ssl)&#xA;             (nnimap-authinfo-file &quot;~/.authinfo.gpg&quot;)))&#xA;&#xA;;; Read HTML mail&#xA;;; You need install the command line brower 'w3m' and Emacs plugin 'w3m'&#xA;(setq mm-text-html-renderer 'w3m)&#xA;;; Setup to send email through SMTP&#xA;(setq message-send-mail-function 'smtpmail-send-it&#xA;      smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA;      smtpmail-smtp-service 587&#xA;      nntp-authinfo-file &quot;~/.authinfo.gpg&quot;&#xA;      gnus-agent nil&#xA;      gnus-message-archive-group nil&#xA;      mml2015-encrypt-to-self t)&#xA;(setq gnus-thread-sort-functions&#xA;      '((not gnus-thread-sort-by-date)&#xA;        (not gnus-thread-sort-by-number)))&#xA;(setq gnus-thread-hide-subtree t)&#xA;(setq gnus-thread-ignore-subject t)&#xA;(setq gnus-use-correct-string-widths nil)&#xA;(setq gnus-use-cache t)&#xA;(setq gc-cons-threshold 3500000)&#xA;(eval-after-load 'gnus-topic&#xA;  '(progn&#xA;     (setq gnus-message-archive-group '((format-time-string &quot;sent.%Y&quot;)))&#xA;     (setq gnus-server-alist '((&quot;archive&quot; nnfolder &quot;archive&quot; (nnfolder-directory &quot;~/Mail/archive&quot;)&#xA;                                (nnfolder-active-file &quot;~/Mail/archive/active&quot;)&#xA;                                (nnfolder-get-new-mail nil)&#xA;                                (nnfolder-inhibit-expiry t))))&#xA;     (setq gnus-topic-topology '((&quot;Gnus&quot; visible)&#xA;                                 ((&quot;misc&quot; visible)) &#xA;                                ((&quot;gmail&quot; visible nil nil))))&#xA;     (setq gnus-topic-alist '((&quot;gmail&quot; ; the key of topic&#xA;                               &quot;INBOX&quot;&#xA;                               &quot;[Gmail]/Sent Mail&quot;&#xA;                               &quot;[Gmail]/Trash&quot;&#xA;                               &quot;Sent Messages&quot;&#xA;                               &quot;Drafts&quot;)&#xA;                              (&quot;misc&quot; ; the key of topic&#xA;                               &quot;nnfolder+archive:sent.2015-12&quot;&#xA;                               &quot;nnfolder+archive:sent.2016&quot;&#xA;                               &quot;nnfolder+archive:sent.2017&quot;&#xA;                               &quot;nndraft:drafts&quot;)&#xA;                              (&quot;Gnus&quot;)))))&#xA;;; Attempt to encrypt all the mails we'll be sending.&#xA;(add-hook 'message-setup-hook 'mml-secure-message-encrypt)&#xA;;; Add two key bindings for your Gmail experience.&#xA;(add-hook 'gnus-summary-mode-hook 'my-gnus-summary-keys)&#xA;(defun my-gnus-summary-keys ()&#xA;  (local-set-key &quot;y&quot; 'gmail-archive)&#xA;  (local-set-key &quot;$&quot; 'gmail-report-spam))&#xA;(defun gmail-archive ()&#xA;  &quot;Archive the current or marked mails.&#xA;This moves them into the All Mail folder.&quot;&#xA;  (interactive)&#xA;  (gnus-summary-move-article nil &quot;nnimap+imap.gmail.com:[Gmail]/All Mail&quot;))&#xA;(defun gmail-report-spam ()&#xA;  &quot;Report the current or marked mails as spam.&#xA;This moves them into the Spam folder.&quot;&#xA;  (gnus-summary-move-article nil &quot;nnimap+imap.gmail.com:[Gmail]/Spam&quot;))&#xA;;; Encryption&#xA;(require 'epg-config)&#xA; (setq mml2015-use 'epg&#xA;       mml2015-verbose t&#xA;       epg-user-id &quot;&quot;&#xA;       mml2015-encrypt-to-self t&#xA;       mml2015-always-trust nil&#xA;       mml2015-cache-passphrase t&#xA;       mml2015-passphrase-cache-expiry '36000&#xA;       mml2015-sign-with-sender t&#xA;       gnus-message-replyencrypt t&#xA;       gnus-message-replysign t&#xA;       gnus-message-replysignencrypted t&#xA;       gnus-treat-x-pgp-sig t&#xA;;;       mm-sign-option 'guided&#xA;;;       mm-encrypt-option 'guided&#xA;       mm-verify-option 'always&#xA;       mm-decrypt-option 'always&#xA;       gnus-buttonized-mime-types&#xA;       '(&quot;multipart/alternative&quot;&#xA;         &quot;multipart/encrypted&quot;&#xA;         &quot;multipart/signed&quot;)&#xA;      epg-debug t ;;  then read the *epg-debug*&quot; buffer&#xA;)&#xA;  (setq send-mail-function         'smtpmail-send-it&#xA;        message-send-mail-function 'message-smtpmail-send-it&#xA;        smtpmail-smtp-server       &quot;smtp.gmail.com&quot;)&#xA;(setq &#xA; send-mail-function 'smtpmail-send-it&#xA; message-send-mail-function 'smtpmail-send-it&#xA; user-mail-address &quot;email@gmail.com&quot;&#xA; smtpmail-starttls-credentials '((&quot;smtp.gmail.com&quot; &quot;587&quot; nil nil))&#xA; smtpmail-auth-credentials  (expand-file-name &quot;~/.authinfo.gpg&quot;)&#xA; smtpmail-default-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-server &quot;smtp.gmail.com&quot;&#xA; smtpmail-smtp-service 587&#xA; smtpmail-debug-info t&#xA; starttls-extra-arguments nil&#xA; starttls-gnutls-program &quot;/usr/local/bin/gnutls-cli&quot;&#xA; starttls-use-gnutls t&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I appreciate your help; I love emacs but have a lot to learn.&lt;/p&gt;&#xA;" OwnerUserId="13854" LastEditorUserId="13854" LastEditDate="2018-03-27T21:30:05.187" LastActivityDate="2020-09-07T10:06:10.530" Title="Can't get gnus to work with Gmail and GPG" Tags="|gnus|email|gpg|smtpmail|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29138" PostTypeId="2" ParentId="29117" CreationDate="2016-12-06T10:06:56.590" Score="1" Body="&lt;p&gt;You can add a key binding, such as &lt;code&gt;C-RET&lt;/code&gt; to open any files in system defined default external programs such as xdg-open on Linux and open on macOS. In this way, URL files are opened by default browsers. A detailed approach is available on ErgoEmacs: &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_dired_open_file_in_ext_apps.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ergoemacs.org/emacs/emacs_dired_open_file_in_ext_apps.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-12-06T10:06:56.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29139" PostTypeId="2" ParentId="29131" CreationDate="2016-12-06T10:38:20.530" Score="4" Body="&lt;p&gt;I would just use the builtin noweb functionality: set the option &lt;code&gt;:noweb yes&lt;/code&gt; and refer to the quoted code by &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt;&lt;em&gt;blockname&lt;/em&gt;&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; in the other block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: sine&#xA;#+BEGIN_SRC python&#xA;  import math&#xA;&#xA;  x=math.sin(math.pi)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :noweb yes :results output :exports results&#xA;  text=&quot;&quot;&quot;&#xA;  &amp;lt;&amp;lt;sine&amp;gt;&amp;gt;&#xA;  &quot;&quot;&quot;&#xA;  print text&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &#xA;: import math&#xA;: &#xA;: x=math.sin(math.pi)&#xA;:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: To supress the two linebreaks (before and after the code) that are introduced by having the &lt;code&gt;&quot;&quot;&quot;&lt;/code&gt; in separate lines, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :noweb yes :results output :exports results&#xA; text=&quot;&quot;&quot;\&#xA; &amp;lt;&amp;lt;sine&amp;gt;&amp;gt;&#xA; &quot;&quot;&quot;[:-1]&#xA; print text&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this is a python detail -- and python wizards surely know a more elegant way. Other languages might need other solutions, or will be fine directly (not every language complains when a string goes over a line break).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just note, that anything before the &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; will be repeated for every source line, so you can easily comment out this for example.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2016-12-06T10:58:30.733" LastActivityDate="2016-12-06T10:58:30.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29140" PostTypeId="1" CreationDate="2016-12-06T12:14:36.647" Score="4" ViewCount="819" Body="&lt;p&gt;I have update to macOS Sierra after witch spelling in Emacs is broken. &#xA;The error I get is &lt;code&gt;(ispell-phaf: No matching entry for en_GB in ´ispell-hunspell-dict-paths-alist´)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have both install aspell and hunspell via homebrew, I have the following content in my &lt;code&gt;~/Library/Spelling&lt;/code&gt; folder: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.&#xA;├── dynamic-counts.dat&#xA;├── dynamic-text.dat&#xA;├── en_AU.aff&#xA;├── en_AU.dic&#xA;├── en_CA.aff&#xA;├── en_CA.dic&#xA;├── en_GB.aff&#xA;├── en_GB.dic&#xA;├── en_US.aff&#xA;├── en_US.dic&#xA;├── en_ZA.aff&#xA;├── en_ZA.dic&#xA;├── hyph_en_GB.dic&#xA;└── hyph_en_US.dic&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I have the following in my &lt;code&gt;.emacs&lt;/code&gt; file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Set dictonary&#xA;(setenv &quot;DICTIONARY&quot; &quot;en_GB&quot;)&#xA;;;; For loading hunspell insteand of ispell&#xA;(setq ispell-local-dictionary &quot;en_GB&quot;)&#xA;(when (executable-find &quot;hunspell&quot;)&#xA; (setq-default ispell-program-name &quot;hunspell&quot;)&#xA; (setq ispell-really-hunspell t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does someone have an idea as to what is wrong. This worked under MacOS El Capitan and therefore I find it strange that it suddenly does not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;Result of &lt;code&gt;hunspell -D&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;hunspell -D&#xA;SEARCH PATH:&#xA;.:::/Users/larsnielsen/Library/Spelling:/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/Users/larsnielsen/.openoffice.org/3/user/wordbook:.openoffice.org2/user/wordbook:.openoffice.org2.0/user/wordbook:Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo&#xA;AVAILABLE DICTIONARIES (path is not mandatory for -d option):&#xA;/Users/larsnielsen/Library/Spelling/default&#xA;/Users/larsnielsen/Library/Spelling/en_AU&#xA;/Users/larsnielsen/Library/Spelling/en_CA&#xA;/Users/larsnielsen/Library/Spelling/en_GB&#xA;/Users/larsnielsen/Library/Spelling/en_US&#xA;/Users/larsnielsen/Library/Spelling/en_ZA&#xA;/Users/larsnielsen/Library/Spelling/hyph_en_GB&#xA;/Users/larsnielsen/Library/Spelling/hyph_en_US&#xA;Library/Spelling/default&#xA;Library/Spelling/en_AU&#xA;Library/Spelling/en_CA&#xA;Library/Spelling/en_GB&#xA;Library/Spelling/en_US&#xA;Library/Spelling/en_ZA&#xA;Library/Spelling/hyph_en_GB&#xA;Library/Spelling/hyph_en_US&#xA;LOADED DICTIONARY:&#xA;/Users/larsnielsen/Library/Spelling/default.aff&#xA;/Users/larsnielsen/Library/Spelling/default.dic&#xA;Hunspell 1.5.4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12166" LastEditorUserId="12166" LastEditDate="2016-12-06T13:51:52.920" LastActivityDate="2016-12-06T13:51:52.920" Title="ispell-phaf no matching entry for en_Gb after update to macOS Sierra" Tags="|osx|ispell|hunspell|" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="29141" PostTypeId="2" ParentId="29134" CreationDate="2016-12-06T12:24:35.957" Score="2" Body="&lt;p&gt;(Not a solution, just digging into the problem.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can actually assign a name to an intermediate result with &lt;code&gt;#+name:&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: callgetdate&#xA;call_get_date[:select .date]()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then the result will be tagged with the name, and a later &lt;code&gt;call_callgetdate()&lt;/code&gt; will not complain/give an error. &lt;strong&gt;&lt;em&gt;BUT&lt;/em&gt;&lt;/strong&gt; in my tests, this later call always gave &lt;code&gt;nil&lt;/code&gt; results. Idem for the &lt;code&gt;src_&lt;/code&gt; case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this is a bug/irregularity in org.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same happened for me with the longer version of &lt;code&gt;#+call:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: callgetdate2&#xA;#+call: get_date[:select .date]&#xA;#+RESULTS: callgetdate2&#xA;# ... The expected json date ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call_callgetdate2()&#xA;#+RESULTS:&#xA;: nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So this is not only related to inline blocks.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2016-12-06T12:24:35.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29142" PostTypeId="1" AcceptedAnswerId="31278" CreationDate="2016-12-06T14:06:21.953" Score="4" ViewCount="1809" Body="&lt;p&gt;Is there a command for recover the current file from the backup ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a file ~/temp.txt and some backup files !home!djangoliv!temp.txt.~1~ ... !home!djangoliv!temp.txt.~5~, !home!djangoliv!temp.txt.~6~. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to load backup files from the newer version to the older one (like git-time-machine for exemple)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here my backup configuration&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (setq auto-save-default nil)&#xA;  (setq backup-directory-alist '((&quot;.&quot; . &quot;~/.emacs-backup-files/&quot;)))&#xA;  (setq version-control t       &#xA;        vc-make-backup-files t  &#xA;        backup-by-copying t     &#xA;        delete-old-versions -1) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="253" LastEditDate="2016-12-06T14:11:18.210" LastActivityDate="2020-08-13T06:42:14.733" Title="recover backup files" Tags="|backup|recover|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29143" PostTypeId="1" AcceptedAnswerId="29145" CreationDate="2016-12-06T14:23:38.323" Score="1" ViewCount="401" Body="&lt;p&gt;In the answer to a question on Quora, Gilles Castel wrote an answer highlighting the power of vim. &#xA;The Question was:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How would you write a C program to print 1 to 100 without loop, recursion, or goto?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quora.com/How-would-you-write-a-C-program-to-print-1-to-100-without-loop-recursion-or-goto/answer/Gilles-Castel-1?srid=dNMP&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here is the link to his Answer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one go about implementing the same in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="14179" LastActivityDate="2016-12-07T10:28:54.737" Title="Emacs equivalent of the following vim operation" Tags="|commands|c|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29144" PostTypeId="1" AcceptedAnswerId="29147" CreationDate="2016-12-06T14:37:36.130" Score="0" ViewCount="190" Body="&lt;p&gt;I have an interactive command which uses &lt;code&gt;read-from-minibuffer&lt;/code&gt; with a history variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I now would like to have is a helm function that provides a simmilar operation: enlisting history candidates in typical helm manner and using what I typed, if there is no match, adding that to the history variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;what I typed&quot; part reminds me of &lt;code&gt;helm-find-files&lt;/code&gt;, where I can select existing files and optionally create a new one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm asking this to be shure that I did not overlook an existion approach, before I start to implement it on my own.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2016-12-06T14:47:51.517" LastActivityDate="2016-12-06T15:54:27.473" Title="Is there a helm read-from-minibuffer functionality?" Tags="|helm|minibuffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29145" PostTypeId="2" ParentId="29143" CreationDate="2016-12-06T14:38:54.860" Score="3" Body="&lt;p&gt;Emacs has keyboard macros with counter support. The gist of the solution would be (assuming default key bindings):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;F3&lt;/code&gt; to start recording a macro&lt;/li&gt;&#xA;&lt;li&gt;Type &lt;code&gt;printf(&quot;%d&quot;, &quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;F3&lt;/code&gt; to insert the macro counter&lt;/li&gt;&#xA;&lt;li&gt;Type the rest of the line, &lt;code&gt;&quot;);&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;F4&lt;/code&gt; to end recording the macro&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;F4&lt;/code&gt; with a prefix to run the macro n times, e.g. &lt;code&gt;C-u 1 0 0 F4&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to play editor golf and compare with that vim solution, I think the equivalent sequence would be this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&amp;lt;RET&amp;gt;&#xA;int main(){&amp;lt;RET&amp;gt;&#xA;&amp;lt;F3&amp;gt;printf(&quot;%d &quot;, &amp;lt;F3&amp;gt;);&amp;lt;RET&amp;gt;&#xA;&amp;lt;F4&amp;gt;&amp;lt;C-p&amp;gt;&amp;lt;C-S-backspace&amp;gt;&amp;lt;C-u&amp;gt;100&amp;lt;F4&amp;gt;return 0;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-06T22:03:29.330" LastActivityDate="2016-12-06T22:03:29.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29146" PostTypeId="1" CreationDate="2016-12-06T14:51:17.430" Score="1" ViewCount="576" Body="&lt;p&gt;Inside a CSS declaration, you got the &lt;em&gt;property&lt;/em&gt;, the part before the colon, that can mostly always be auto-completed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;strong {&#xA;  color: red;  /* &amp;lt;= color is the property */&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After hitting return from the menu of your completion tool (let's say &lt;a href=&quot;https://company-mode.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Company&lt;/a&gt;), it is very likely you will type&lt;code&gt;:&lt;/code&gt;, the value of your property and then &lt;code&gt;;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I think of is that, after hitting return, the colon and semicolon should be auto-inserted and then the point should be positioned right before the semicolon:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* Point position before completion */&#xA;strong {&#xA;  /*  v */&#xA;  colo    &#xA;}&#xA;&#xA;/* Point position after completion */&#xA;strong {&#xA;  /*     v */&#xA;  color: ;    &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any hints about this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I saw this behavior in Atom CSS plugin.&lt;/p&gt;&#xA;" OwnerUserId="119" LastActivityDate="2016-12-07T02:13:37.880" Title="How can I auto-insert semi-colon and colon after property autocompletion in css-mode?" Tags="|company-mode|completion|css|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29147" PostTypeId="2" ParentId="29144" CreationDate="2016-12-06T15:54:27.473" Score="2" Body="&lt;p&gt;You can use &lt;kbd&gt;C-r&lt;/kbd&gt; (&lt;code&gt;helm-minibuffer-history&lt;/code&gt;) when you are in minibuffer, the key binding is set in &lt;code&gt;helm-config.el&lt;/code&gt; via the option &lt;code&gt;helm-minibuffer-history-key&lt;/code&gt;. However, when there is no match in the helm session, helm will simply do nothing. Your idea looks useful to me, I suggest you consider filing an issue to the helm developers.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-12-06T15:54:27.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29148" PostTypeId="2" ParentId="29123" CreationDate="2016-12-06T16:34:45.257" Score="0" Body="&lt;p&gt;The splitting behavior can be controlled by setting the variable &lt;code&gt;display-buffer-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please refer &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, note &lt;code&gt;display-buffer-below-selected&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An easier to achieve the same is using the package &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow noreferrer&quot;&gt;shackle&lt;/a&gt; (my personal choice)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the below code aligns all &lt;code&gt;helm&lt;/code&gt; buffers to the bottom of the screen, covering 40% of the screen&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shackle-rules '((&quot;\\`\\*helm.*?\\*\\'&quot; :align 'below :size 0.4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could do the same for buffers with a given mode, try something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shackle-rules '((slime-mode :align 'below)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13439" LastEditorUserId="13439" LastEditDate="2016-12-06T17:34:26.910" LastActivityDate="2016-12-06T17:34:26.910" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29149" PostTypeId="2" ParentId="29143" CreationDate="2016-12-06T16:43:47.227" Score="1" Body="&lt;pre class=&quot;lang-c prettyprint-override&quot;&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;void main() { puts (&quot;1 to 100&quot;); }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2016-12-06T16:43:47.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29151" PostTypeId="1" AcceptedAnswerId="30213" CreationDate="2016-12-06T17:30:52.103" Score="1" ViewCount="1592" Body="&lt;p&gt;I'm using &lt;code&gt;GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570&lt;/code&gt; on Windows 7. Somedays (yes, weirdly, it seems to be only some days), Emacs takes a very long time (a few seconds) when reading or writing to disk. This happens most notably when using &lt;code&gt;ido-find-file&lt;/code&gt; or &lt;code&gt;save-buffer&lt;/code&gt;. It happens in fundamental mode, and when i run &lt;code&gt;emacs -q&lt;/code&gt;, so I don't think it is related to my setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't seem to happen in other text-editors, but it might just be that other text-editors does save asynchronously, while emacs is famously single-threaded, and so would block everytime. I suspect that the issue might come from some of the spyware that my employer installs on our computers, but I'm at a loss on how to debug. What could the source of this error be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the profiler to find the source of the slowness. Here is the output for one slow save:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- ...                                                               5  83%&#xA;   Automatic GC                                                     5  83%&#xA;- command-execute                                                   1  16%&#xA; - call-interactively                                               1  16%&#xA;  - profiled-save-buffer                                            1  16%&#xA;   - let                                                            1  16%&#xA;    - save-buffer                                                   1  16%&#xA;     - basic-save-buffer                                            1  16%&#xA;      - basic-save-buffer-1                                         1  16%&#xA;         basic-save-buffer-2                                        1  16%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, this is very weird. The actual save took 13.863000 seconds, the sampling interval is 1000000. If I understand the profiler correctly I should have more than 1000 samples, but here I only got one. Here is the code I use for profiling:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun profiled-save-buffer ()&#xA;    &quot;&quot;&#xA;  (interactive)&#xA;  (profiler-start 'cpu)&#xA;  (measure-time&#xA;   (save-buffer)&#xA;  (profiler-report)&#xA;  (profiler-stop))&#xA;  (select-window (previous-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13253" LastEditorUserId="25" LastEditDate="2020-02-29T22:28:06.580" LastActivityDate="2023-06-25T05:12:02.847" Title="Disk interaction occasionally extremely slow" Tags="|microsoft-windows|files|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29152" PostTypeId="1" AcceptedAnswerId="29222" CreationDate="2016-12-06T19:28:27.930" Score="2" ViewCount="1055" Body="&lt;p&gt;I use emacs with org- and helm-mode in windows, and I store my agenda files in my /journal/ directory:&lt;br&gt;&#xA;&lt;code&gt;(setq org-agenda-files '(&quot;C:/Users/.../journal/&quot;))&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My agenda files mainly contain notes, structured under one or more headlines within each file, and with one or more tag added to each headline. A headline can thus look like this:&lt;br&gt;&#xA;&lt;code&gt;* My note for thursday :family:car:expences:&lt;/code&gt; where the single tags are within a pair of colons.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use the command &lt;code&gt;M-x org-tags-view&lt;/code&gt; I get a list for all tags used in all the .org files in my /journal/ directory. This &lt;code&gt;global tags list&lt;/code&gt; would have been great to have access to when I am tagging headlines inside a single .org file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I use the command &lt;code&gt;M-x org-set-tags&lt;/code&gt;, when my point is within a headline, the resulting helms output is a &lt;code&gt;local tags list&lt;/code&gt;, i.e. a list of tags  collected only from within the single file I am about to tag, and containing no tags from any of the other .org files in the /journal/ directory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) How can I make helms give me access to the &lt;code&gt;global tags list&lt;/code&gt; when I am tagging headlines within a single file inside my /journal/ directory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) How can I easily update the &lt;code&gt;global tags list&lt;/code&gt; if I add tags to a file that is not from within this list?&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="8348" LastEditDate="2016-12-06T19:41:54.920" LastActivityDate="2016-12-10T21:59:30.120" Title="How to use global tags list when tagging text files with org mode and helm?" Tags="|org-mode|helm|org-tags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29153" PostTypeId="2" ParentId="29142" CreationDate="2016-12-06T21:15:03.700" Score="2" Body="&lt;p&gt;How about this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun revert-to-backup ()&#xA;  &quot;Reverts to the latest backup file associated with the current buffer.&quot;&#xA;  (interactive)&#xA;  (let ((file (buffer-file-name)))&#xA;    (when file&#xA;      (let ((bak (file-newest-backup (buffer-file-name))))&#xA;        (if bak&#xA;            (progn&#xA;              (delete-region (point-min) (point-max))&#xA;              (insert-file-contents bak))&#xA;          (message &quot;No backups found!&quot;))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this command you can revert the current buffer to its latest backup. The revert is not saved automatically, I'm assuming you might want to at least look at the content before hitting &lt;code&gt;C-x C-s&lt;/code&gt; to save. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-06T21:30:41.647" LastActivityDate="2016-12-06T21:30:41.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29154" PostTypeId="1" AcceptedAnswerId="29170" CreationDate="2016-12-06T22:15:06.910" Score="3" ViewCount="138" Body="&lt;p&gt;Indentation for R inside functions seems to be broken for pipes and '+'s:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f &amp;lt;- function(something){&#xA;    mutate(something, l=&quot;aaaa&quot;) %&amp;gt;%&#xA;        select(l) %&amp;gt;%&#xA;            str_replace(&quot;a&quot;, &quot;A&quot;) %&amp;gt;%&#xA;                tolower()&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same happens with ggplot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway of fixing this behavior?&lt;/p&gt;&#xA;" OwnerUserId="68" LastEditorUserId="105" LastEditDate="2016-12-07T00:48:24.010" LastActivityDate="2016-12-07T23:42:04.207" Title="ESS indentation inside functions" Tags="|indentation|ess|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29155" PostTypeId="2" ParentId="5939" CreationDate="2016-12-06T23:27:04.347" Score="2" Body="&lt;p&gt;There is the possibility to insert a newline char with &lt;code&gt;C-q C-j&lt;/code&gt; and there are 3 commands to split the line: &lt;code&gt;open-line C-o&lt;/code&gt;, &lt;code&gt;split-line C-M-o&lt;/code&gt; and the &lt;code&gt;newline RET, C-m&lt;/code&gt; you used. If you position the cursor like you said after the &lt;code&gt;a&lt;/code&gt; and press &lt;code&gt;C-o&lt;/code&gt; the current line will be broken after the cursor and every char will be in the next line. split-line will keep the column-position so that an extra blank is inserted before the content. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hmm, interesting, with &lt;code&gt;C-M-o&lt;/code&gt; the current line also gets an extra blank in the end so that the &lt;code&gt;b&lt;/code&gt; and the cursor positions line up after the change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fundamental mode &lt;code&gt;C-j&lt;/code&gt; changes the buffer to your expectation on my machine, and &lt;code&gt;C-j&lt;/code&gt; is bound to &lt;code&gt;electric-newline-and-maybe-indent&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="4068" LastActivityDate="2016-12-06T23:27:04.347" CommentCount="0" CommunityOwnedDate="2016-12-06T23:27:04.347" ContentLicense="CC BY-SA 3.0" />
  <row Id="29156" PostTypeId="2" ParentId="13272" CreationDate="2016-12-06T23:54:43.577" Score="10" Body="&lt;p&gt;As of December 2016, there is now a &lt;strong&gt;64-bit version&lt;/strong&gt; of GNU Emacs for Windows on the official GNU downloads sites. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the FAQ: &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/efaq-w32.html&quot; rel=&quot;noreferrer&quot;&gt;GNU Emacs FAQ for MS Windows&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At time of writing, the latest version of GNU Emacs is version 25.1. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example, in one of the download sites, I notice the following file:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;/gnu/emacs/windows/emacs-25.1-2-x86_64-w64-mingw32.zip &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It seems to be a 64 version. Also,  &lt;em&gt;Cygwin 64&lt;/em&gt; also seems to have a 64-bit emacs-X11; if you update your packages in Cygwin, it should come over as the most-recent version. &lt;/p&gt;&#xA;" OwnerUserId="14182" LastActivityDate="2016-12-06T23:54:43.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29157" PostTypeId="2" ParentId="29146" CreationDate="2016-12-07T02:13:37.880" Score="1" Body="&lt;p&gt;You could do that by having the css-mode's &lt;code&gt;completion-at-point-functions&lt;/code&gt; return an appropriatr &lt;code&gt;:exit-function&lt;/code&gt; property which inserts &quot;: ;&quot; and puts point just before the semi-colon (which it's called with a &lt;code&gt;finished&lt;/code&gt; status).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe a patch along the lines of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el&#xA;index 9e36a88..f8ee3ec 100644&#xA;--- a/lisp/textmodes/css-mode.el&#xA;+++ b/lisp/textmodes/css-mode.el&#xA;@@ -687,7 +687,8 @@ css--font-lock-keywords&#xA;        ;; Even though pseudo-elements should be prefixed by ::, a&#xA;        ;; single colon is accepted for backward compatibility.&#xA;        &quot;\\(?:\\(:&quot; (regexp-opt (append css-pseudo-class-ids&#xA;-                                       css-pseudo-element-ids) t)&#xA;+                                       css-pseudo-element-ids)&#xA;+                               t)&#xA;        &quot;\\|\\::&quot; (regexp-opt css-pseudo-element-ids t) &quot;\\)&quot;&#xA;        &quot;\\(?:([^)]+)\\)?&quot;&#xA;        (if (not sassy)&#xA;@@ -921,10 +922,22 @@ css-completion-at-point&#xA;       (seq-let (prop-beg prop-end prop-table) (css--complete-property)&#xA;         (seq-let (sel-beg sel-end sel-table) (css--complete-selector)&#xA;           (when (or prop-table sel-table)&#xA;+            ;; FIXME: If both prop-table and sel-table are set but&#xA;+            ;; prop-beg/prop-end is different from sel-beg/sel-end&#xA;+            ;; we have a problem!&#xA;             `(,@(if prop-table&#xA;                     (list prop-beg prop-end)&#xA;                   (list sel-beg sel-end))&#xA;-              ,(completion-table-merge prop-table sel-table)))))))&#xA;+              ,(completion-table-merge prop-table sel-table)&#xA;+              :exit-function&#xA;+              ,(lambda (string status)&#xA;+                 (and (eq status 'finished)&#xA;+                      prop-table&#xA;+                      (test-completion string prop-table)&#xA;+                      (not (and sel-table&#xA;+                                (test-completion string sel-table)))&#xA;+                      (progn (insert &quot;: ;&quot;)&#xA;+                             (forward-char -1))))))))))&#xA;&#xA; ;;;###autoload&#xA; (define-derived-mode css-mode prog-mode &quot;CSS&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;could do the trick.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-12-07T02:13:37.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29159" PostTypeId="1" AcceptedAnswerId="29163" CreationDate="2016-12-07T06:01:25.970" Score="5" ViewCount="251" Body="&lt;p&gt;How can I get rid of the state information of evil in the echo area? I've already displayed it in the status bar and there is no need to occupy the echo area.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-12-07T16:51:48.370" Title="Get rid of evil's state info such as ` -- INSERT -- ` in the echo area" Tags="|evil|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29160" PostTypeId="1" AcceptedAnswerId="29166" CreationDate="2016-12-07T08:59:32.293" Score="1" ViewCount="456" Body="&lt;p&gt;I'd like to disable &lt;code&gt;whitespace-mode&lt;/code&gt; while in evil  insert state. The following hooks work, but require refreshing all font colors with &lt;code&gt;(font-lock-fontify-buffer)&lt;/code&gt;, and even then- sometimes it fails to refresh properly to show trailing whitespace. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this example uses evil-mode, similar logic applies to any other hook.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun i42/enter-insert-mode ()&#xA;  (whitespace-mode -1)&#xA;  (font-lock-fontify-buffer))&#xA;(defun i42/exit-insert-mode ()&#xA;  (whitespace-mode 1)&#xA;  (font-lock-fontify-buffer))&#xA;(add-hook 'evil-insert-state-entry-hook 'i42/enter-insert-mode)&#xA;(add-hook 'evil-insert-state-exit-hook  'i42/exit-insert-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to toggle white space mode?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2755" LastEditDate="2016-12-07T11:01:24.947" LastActivityDate="2017-08-06T04:05:56.870" Title="How to toggle whitespace mode in evil insert state?" Tags="|evil|whitespace-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29161" PostTypeId="2" ParentId="29143" CreationDate="2016-12-07T10:28:54.737" Score="0" Body="&lt;p&gt;You can use the command &lt;code&gt;tiny-expand&lt;/code&gt; from the package &lt;code&gt;tiny&lt;/code&gt; on ELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter the following text and call the command (I like to bind it to &lt;kbd&gt;C-o&lt;/kbd&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m1\n10|printf (&quot;%%d &quot;, %d);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The resulting buffer contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;printf (&quot;%d &quot;, 1);&#xA;printf (&quot;%d &quot;, 2);&#xA;printf (&quot;%d &quot;, 3);&#xA;printf (&quot;%d &quot;, 4);&#xA;printf (&quot;%d &quot;, 5);&#xA;printf (&quot;%d &quot;, 6);&#xA;printf (&quot;%d &quot;, 7);&#xA;printf (&quot;%d &quot;, 8);&#xA;printf (&quot;%d &quot;, 9);&#xA;printf (&quot;%d &quot;, 10);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2016-12-07T10:28:54.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29163" PostTypeId="2" ParentId="29159" CreationDate="2016-12-07T16:51:48.370" Score="6" Body="&lt;p&gt;Here's the solution for insert state. You can apply the same idea to other states as you see fit. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-insert-state-message nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2016-12-07T16:51:48.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29164" PostTypeId="2" ParentId="28456" CreationDate="2016-12-07T18:07:41.387" Score="0" Body="&lt;p&gt;You can use some lightweight editor like &lt;a href=&quot;https://homepage.boetes.org/software/mg/&quot; rel=&quot;nofollow noreferrer&quot;&gt;mg&lt;/a&gt; as a replacement for emacs.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-12-07T18:07:41.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29165" PostTypeId="2" ParentId="24496" CreationDate="2016-12-07T19:43:02.587" Score="3" Body="&lt;p&gt;A little bit late to the party but I use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;C-c&quot;) 'cua-copy-region)&#xA;(define-key evil-insert-state-map (kbd &quot;C-v&quot;) 'cua-paste)&#xA;(define-key evil-insert-state-map (kbd &quot;C-x&quot;) 'cua-cut-region)&#xA;(define-key evil-insert-state-map (kbd &quot;C-z&quot;) 'undo-tree-undo)&#xA;(define-key evil-insert-state-map (kbd &quot;C-y&quot;) 'undo-tree-redo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This also includes undo and redo for &lt;code&gt;C-z&lt;/code&gt; and &lt;code&gt;C-y&lt;/code&gt; and requires the &lt;code&gt;undo-tree&lt;/code&gt; package. Keep in mind that if you want to use the usual Emacs shortcuts like &lt;code&gt;C-x C-c&lt;/code&gt; to quit Emacs you'll need to leave &lt;code&gt;Insert State&lt;/code&gt; first.&lt;/p&gt;&#xA;" OwnerUserId="13180" LastActivityDate="2016-12-07T19:43:02.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29166" PostTypeId="2" ParentId="29160" CreationDate="2016-12-07T20:30:45.907" Score="1" Body="&lt;p&gt;One workaround I'd found is to temporarily change the face background color.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Don't show trailing space in insert mode.&#xA;(defvar i42/whitespace-trailing-bg (face-attribute 'whitespace-trailing :background))&#xA;(defun i42/enter-insert-mode ()&#xA;  (set-face-attribute 'whitespace-trailing nil :background nil :foreground nil))&#xA;(defun i42/exit-insert-mode ()&#xA;  (set-face-attribute 'whitespace-trailing nil :background i42/whitespace-trailing-bg :foreground nil))&#xA;&#xA;(add-hook 'evil-insert-state-entry-hook 'i42/enter-insert-mode)&#xA;(add-hook 'evil-insert-state-exit-hook  'i42/exit-insert-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2016-12-08T22:17:34.687" LastActivityDate="2016-12-08T22:17:34.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29167" PostTypeId="2" ParentId="29086" CreationDate="2016-12-07T21:23:01.160" Score="2" Body="&lt;p&gt;I figured it out. It turns out that I can send input to a process invoked via &lt;code&gt;start-process&lt;/code&gt;, and so I don't need to use &lt;code&gt;call-process&lt;/code&gt; at all. Since &lt;code&gt;start-process&lt;/code&gt; doesn't invoke the specified command via the shell, this solves my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simplified example which shows how to do it ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((proc (start-process &quot;procname&quot; &quot;buffname&quot; &quot;/path/to/executable&quot; &quot;arg0&quot; &quot;arg1&quot;)))&#xA;  (process-send-region proc (point-min) (point-max))&#xA;  (process-send-eof proc))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10529" LastActivityDate="2016-12-07T21:23:01.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29168" PostTypeId="2" ParentId="29123" CreationDate="2016-12-07T21:43:09.393" Score="1" Body="&lt;p&gt;According to the doc-string of the variable &lt;code&gt;split-window-preferred-function&lt;/code&gt;, the value should be a &quot;&lt;em&gt;[f]unction called by 'display-buffer' routines to split a window.&lt;/em&gt;&quot;  The default value is &lt;code&gt;split-window-sensibly&lt;/code&gt;, which has a semi-lengthy doc-string that talks about (in part) the variables &lt;code&gt;split-height-threshold&lt;/code&gt; and &lt;code&gt;split-width-threshold&lt;/code&gt;; and, those variables in turn have doc-strings.  In a nutshell, &lt;code&gt;(setq split-width-threshold nil)&lt;/code&gt; will result in &lt;code&gt;split-window-sensibly&lt;/code&gt; never splitting a window horizontally.  For more information, on these functions or variables, type &lt;code&gt;C-h f&lt;/code&gt; or &lt;code&gt;C-h v&lt;/code&gt; to describe functions/variables -- or &lt;code&gt;M-x describe-function&lt;/code&gt; and &lt;code&gt;M-x describe-variable&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-12-07T21:43:09.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29169" PostTypeId="1" AcceptedAnswerId="29189" CreationDate="2016-12-07T22:58:15.737" Score="1" ViewCount="419" Body="&lt;p&gt;I am creating a new, special kind of buffer that I am using to display messages. I want to disable &lt;em&gt;all&lt;/em&gt; keymaps within this new buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This special buffer could be created at any time, and therefore, I don't know which keymaps may or may not currently active at the time of this buffer's creation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to disable each and every active keymap for a given buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2016-12-08T02:43:25.100" LastActivityDate="2016-12-08T14:17:44.663" Title="Disable all keymaps for a specified buffer?" Tags="|frames|keymap|popup|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29170" PostTypeId="2" ParentId="29154" CreationDate="2016-12-07T23:42:04.207" Score="1" Body="&lt;p&gt;Your &lt;code&gt;ess-version&lt;/code&gt; is probably older than 15.09. 15.09 came with a redesigned indentation engine and better defaults in &lt;code&gt;ess-styles-alist&lt;/code&gt;. The relevant part for straight indentation is &lt;code&gt;ess-offset-continued&lt;/code&gt; that is set to &lt;code&gt;straight&lt;/code&gt; for all available styles.  &lt;/p&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2016-12-07T23:42:04.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29171" PostTypeId="2" ParentId="29169" CreationDate="2016-12-08T02:56:48.657" Score="0" Body="&lt;p&gt;Thanks to the pointer from &lt;strong&gt;lawlist&lt;/strong&gt;, I now know how to do this. This over-simplified code gives a general overview of the procedure ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((cam (current-active-maps t))&#xA;      (lm))&#xA;  (while cam&#xA;    (setq lm (copy-keymap (car cam)))&#xA;    (setq cam (cdr cam))&#xA;    (suppress-keymap lm)&#xA;    (use-local-map lm)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2016-12-08T12:30:41.197" LastActivityDate="2016-12-08T12:30:41.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29172" PostTypeId="1" AcceptedAnswerId="29193" CreationDate="2016-12-08T03:18:22.613" Score="2" ViewCount="6781" Body="&lt;p&gt;I would normally be able to do this myself by merely adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-a&quot;) 'select-all)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;~/.emacs&lt;/code&gt; file but &lt;code&gt;select-all&lt;/code&gt; isn't the command for the &quot;Select All&quot; option in the Edit menu (which selects all text in the current buffer). I have tried searching for &quot;select&quot; in the list of commands via pressing &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;h&lt;/kbd&gt;-&lt;kbd&gt;a&lt;/kbd&gt; and typing &quot;select&quot;, but that did not return any result with &quot;Select all&quot; in its description. Any ideas? If it at all relevant I am using the experimental 25.1.90 release (the one tagged in the &lt;a href=&quot;https://github.com/emacs-mirror/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;emacs-mirror/emacs&lt;/code&gt;&lt;/a&gt; GitHub repository) of GNU Emacs.&lt;/p&gt;&#xA;" OwnerUserId="11131" LastActivityDate="2016-12-08T16:05:27.750" Title="How to set the keybinding for &quot;Select All&quot; to Ctrl-A?" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29173" PostTypeId="1" AcceptedAnswerId="29194" CreationDate="2016-12-08T03:46:35.427" Score="3" ViewCount="1577" Body="&lt;p&gt;I have tried using Cua mode (via adding &lt;code&gt;(cua-mode t)&lt;/code&gt; to my &lt;code&gt;~/.emacs&lt;/code&gt; file) but it doesn't seem to set the copy keybinding to &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt;. See for example this screenshot showing my Edit menu:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iM4YN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried adding this line to my &lt;code&gt;~/.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c&quot;) 'kill-ring-save)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but still &lt;code&gt;C-c&lt;/code&gt; doesn't copy selected text in an Emacs buffer (and the Edit menu looks the same as in the above screenshot). If you are wondering whether some other line in my &lt;code&gt;~/.emacs&lt;/code&gt; file is overriding this one, feel free to see for yourself. &lt;a href=&quot;https://github.com/fusion809/emacs/blob/9848e217391a0d2abf92d59da37d8a58f1179267/.emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is my &lt;code&gt;~/.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="11131" LastEditDate="2016-12-08T06:53:15.273" LastActivityDate="2016-12-08T16:31:36.040" Title="How to set copy to C-c in Emacs?" Tags="|key-bindings|copy-paste|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29174" PostTypeId="1" AcceptedAnswerId="29179" CreationDate="2016-12-08T04:10:18.183" Score="3" ViewCount="5794" Body="&lt;p&gt;I have added:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &amp;quot;C-z&amp;quot;) 'undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to my &lt;code&gt;~/.emacs&lt;/code&gt; file. But still when I press &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt; nothing is undone even when I've had GNU Emacs open for a while and done several things in my present buffer. You can even see in my Edit menu that Undo isn't set to my desired key binding: &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;z&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iM4YN.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/fusion809/emacs/blob/a2e42e46dd0109ff8a6ec20f07b5b3622cd978bb/.emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is my &lt;code&gt;~/.emacs&lt;/code&gt; file, if relevant.&lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="105" LastEditDate="2021-12-20T00:32:20.900" LastActivityDate="2021-12-20T00:32:20.900" Title="How to assign the undo command to the Ctrl-z key binding?" Tags="|key-bindings|undo|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="29175" PostTypeId="1" AcceptedAnswerId="29176" CreationDate="2016-12-08T04:26:36.553" Score="10" ViewCount="7980" Body="&lt;p&gt;I use &lt;code&gt;GNU Emacs 24.3.1&lt;/code&gt; and want to create a new buffer and execute that directly without using &lt;code&gt;terminal&lt;/code&gt; and &lt;code&gt;chmod&lt;/code&gt;.  Is there a way to change the permission of a saved buffer (file) directly from emacs?&lt;/p&gt;&#xA;" OwnerUserId="13398" LastEditorUserId="13398" LastEditDate="2016-12-09T06:22:55.200" LastActivityDate="2022-07-31T02:01:15.490" Title="Change permission of file" Tags="|permissions|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29176" PostTypeId="2" ParentId="29175" CreationDate="2016-12-08T05:56:25.410" Score="19" Body="&lt;p&gt;The easy to remember (if you are used to unix) way is&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;M-x chmod&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;which is an alias of &lt;code&gt;set-file-modes&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then there is the question of how to get the filename. The default is the current file but the prompt is misleading as it shows the current directory. You can see the correct filename using &amp;quot;future history&amp;quot;. The standard emacs completion (at least for emacs 29) has a history of completions, and it puts the filename as the first thing into the future. The effect of this is you type on a PC keyboard where &lt;kbd&gt;Alt&lt;/kbd&gt; is the Meta key&lt;/p&gt;&#xA;&lt;p&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;x&lt;/kbd&gt; &lt;kbd&gt;c&lt;/kbd&gt; &lt;kbd&gt;h&lt;/kbd&gt; &lt;kbd&gt;m&lt;/kbd&gt; &lt;kbd&gt;o&lt;/kbd&gt; &lt;kbd&gt;d&lt;/kbd&gt; &lt;kbd&gt;Return&lt;/kbd&gt; to enter the command&#xA;&lt;br&gt;&#xA;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt; &lt;kbd&gt;Return&lt;/kbd&gt; to pull the filename from the future history&lt;br&gt;&#xA;&lt;kbd&gt;+&lt;/kbd&gt; &lt;kbd&gt;x&lt;/kbd&gt; &lt;kbd&gt;Return&lt;/kbd&gt; to switch on execute permissions&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="12895" LastEditDate="2022-07-31T02:01:15.490" LastActivityDate="2022-07-31T02:01:15.490" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="29177" PostTypeId="1" CreationDate="2016-12-08T05:58:22.513" Score="3" ViewCount="165" Body="&lt;p&gt;I observed that directory local variables, defined in &lt;code&gt;.dir-locals.el&lt;/code&gt;, are set for files, dired-buffers, new buffers, but not for &lt;code&gt;shell&lt;/code&gt; or &lt;code&gt;eshell&lt;/code&gt; buffers (well, that is also the case for buffers generated with &lt;code&gt;get-buffer-create&lt;/code&gt; or &lt;code&gt;generate-new-buffer&lt;/code&gt; and surely a ton of other similar functions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question now is, how would I trigger the search and evaluation of &lt;code&gt;.dir-locals.el&lt;/code&gt;, so I could do this in an around advice? Or can I somehow enable it for &lt;code&gt;shell&lt;/code&gt; and &lt;code&gt;shell-command&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2016-12-08T05:58:22.513" Title="Evaluation of .dir-locals.el in shell?" Tags="|shell|eshell|directory-local-variables|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29178" PostTypeId="1" AcceptedAnswerId="29190" CreationDate="2016-12-08T06:15:24.487" Score="0" ViewCount="1063" Body="&lt;p&gt;I have tried using CUA mode but that failed to set this keybinding. I have also tried adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-x&quot;) 'kill-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;~/.emacs&lt;/code&gt; file. Despite this presently the Apropos buffer (started by pressing &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;h&lt;/kbd&gt;+&lt;kbd&gt;a&lt;/kbd&gt;) says the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;kill-region           &amp;lt;menu-bar&amp;gt; &amp;lt;edit&amp;gt; &amp;lt;cut&amp;gt;, &amp;lt;S-delete&amp;gt;, C-w..C-x&#xA;   Cannot open doc string file &quot;DOC&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;about the &lt;code&gt;kill-region&lt;/code&gt; command. Any ideas how to get &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;x&lt;/kbd&gt; as the keybinding for cut. &lt;a href=&quot;https://github.com/fusion809/emacs/blob/9848e217391a0d2abf92d59da37d8a58f1179267/.emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is my &lt;code&gt;~/.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="11131" LastEditDate="2016-12-08T06:53:32.957" LastActivityDate="2016-12-08T14:22:38.380" Title="How to set cut to Ctrl-x in Emacs?" Tags="|key-bindings|" AnswerCount="2" CommentCount="8" ClosedDate="2016-12-14T16:33:20.497" ContentLicense="CC BY-SA 3.0" />
  <row Id="29179" PostTypeId="2" ParentId="29174" CreationDate="2016-12-08T06:16:47.660" Score="7" Body="&lt;p&gt;Turns out that it seems to be related to me still having a &lt;code&gt;(cua-mode t)&lt;/code&gt; line in my &lt;code&gt;~/.emacs&lt;/code&gt; file. After I removed this line, the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-z&quot;) 'undo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my &lt;code&gt;~/.emacs&lt;/code&gt; file worked just fine. &lt;/p&gt;&#xA;" OwnerUserId="11131" LastActivityDate="2016-12-08T06:16:47.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29180" PostTypeId="2" ParentId="26923" CreationDate="2016-12-08T07:08:01.540" Score="6" Body="&lt;p&gt;I had the exact same issue. The refile &lt;code&gt;advice&lt;/code&gt; used to work but stopped at some point. A similar error reported &lt;a href=&quot;https://github.com/bbatsov/helm-projectile/issues/51&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; suggested a solution that works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(advice-add 'org-refile :after&#xA;        (lambda (&amp;amp;rest _)&#xA;        (org-save-all-org-buffers)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11193" LastEditorUserId="8842" LastEditDate="2016-12-08T16:04:47.627" LastActivityDate="2016-12-08T16:04:47.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29181" PostTypeId="2" ParentId="29175" CreationDate="2016-12-08T07:48:09.323" Score="8" Body="&lt;p&gt;&lt;strong&gt;The dired way&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Create the file: &lt;code&gt;C-x C-f&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Save it to disk: &lt;code&gt;C-x C-s&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Open the file in dired mode with &lt;code&gt;C-x C-j&lt;/code&gt; (Emacs 28).&lt;/p&gt;&#xA;&lt;p&gt;Emacs &amp;lt; 28: If you have &lt;code&gt;dired-x&lt;/code&gt; loaded [1], jump to the file in dired using &lt;code&gt;C-x C-j&lt;/code&gt;. Otherwise, you can simply open the directory in dired with &lt;code&gt;C-x C-f RET&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Enter WDired mode: &lt;code&gt;C-x C-q&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Edit the permissions attributes [2]. You might type &lt;code&gt;SPACE&lt;/code&gt; or the respective letter.&lt;/p&gt;&#xA;&lt;p&gt;Activate your changes: &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Type &lt;code&gt;RET&lt;/code&gt; to edit your file.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Alternative workflow&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Enter dired: &lt;code&gt;C-x d&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Create your file: &lt;code&gt;M-!&lt;/code&gt; &amp;gt; your_file.name &lt;code&gt;RET&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Refresh the dired buffer: &lt;code&gt;g&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Search the file and type &lt;code&gt;M&lt;/code&gt; (dired-do-chmode). Both octal numeric modes like ‘644’ and symbolic modes like ‘g+w’&#xA;are supported.&lt;/p&gt;&#xA;&lt;p&gt;Type &lt;code&gt;RET&lt;/code&gt; to edit your file.&lt;/p&gt;&#xA;&lt;p&gt;[1]: In emacs init file: &lt;code&gt;(add-hook 'dired-load-hook (function (lambda () (load &amp;quot;dired-x&amp;quot;))))&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;[2]:  You'll need to make sure you've set &lt;code&gt;wdired-allow-to-change-permissions&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;. In your emacs init file: &lt;code&gt;(setq wdired-allow-to-change-permissions t)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="8979" LastEditDate="2021-09-09T07:20:47.490" LastActivityDate="2021-09-09T07:20:47.490" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="29183" PostTypeId="1" AcceptedAnswerId="29184" CreationDate="2016-12-08T09:52:41.213" Score="9" ViewCount="5093" Body="&lt;p&gt;The following Emacs Lisp you can set the background color of face &lt;code&gt;whitespace-trailing&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'whitespace-trailing nil :background &quot;#ff0000&quot; :foreground nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can a face attribute be read back?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Asking since I'd like to temporarily change a face background color:&lt;br&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/29166/2418&quot;&gt;https://emacs.stackexchange.com/a/29166/2418&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-12-08T16:26:37.793" Title="How to get/read face attributes?" Tags="|faces|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29184" PostTypeId="2" ParentId="29183" CreationDate="2016-12-08T10:53:47.087" Score="14" Body="&lt;p&gt;You can use &lt;code&gt;face-attribute&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To match the example given, the following expression gets the trailing space background color:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(face-attribute 'whitespace-trailing :background)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;face-attribute is a compiled Lisp function in `faces.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(face-attribute FACE ATTRIBUTE &amp;amp;optional FRAME INHERIT)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;:around advice: `ad-Advice-face-attribute'&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return the value of FACE's ATTRIBUTE on FRAME.&#xA;  If the optional argument FRAME is given, report on face FACE in that frame.&#xA;  If FRAME is t, report on the defaults for face FACE (for new frames).&#xA;  If FRAME is omitted or nil, use the selected frame.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If INHERIT is nil, only attributes directly defined by FACE are considered,&#xA;    so the return value may be &lt;code&gt;unspecified&lt;/code&gt;, or a relative value.&#xA;  If INHERIT is non-nil, FACE's definition of ATTRIBUTE is merged with the&#xA;    faces specified by its &lt;code&gt;:inherit&lt;/code&gt; attribute; however the return value&#xA;    may still be &lt;code&gt;unspecified&lt;/code&gt; or relative.&#xA;  If INHERIT is a face or a list of faces, then the result is further merged&#xA;    with that face (or faces), until it becomes specified and absolute.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To ensure that the return value is always specified and absolute, use a&#xA;  value of &lt;code&gt;default&lt;/code&gt; for INHERIT; this will resolve any unspecified or&#xA;  relative values by merging with the &lt;code&gt;default&lt;/code&gt; face (which is always&#xA;  completely specified).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastEditorUserId="2418" LastEditDate="2016-12-08T16:04:38.873" LastActivityDate="2016-12-08T16:04:38.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29185" PostTypeId="2" ParentId="29178" CreationDate="2016-12-08T11:12:40.573" Score="0" Body="&lt;p&gt;Seems to be fixed probably by the &lt;code&gt;(global-set-key (kbd &quot;C-x&quot;) 'kill-region)&lt;/code&gt; line. It just didn't seem to be fixed. I ran &lt;code&gt;C-x&lt;/code&gt; from a &lt;code&gt;~/.emacs&lt;/code&gt; buffer and it cut text fine. It just seemed based on the Edit menu Cut entry and the output of &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;h&lt;/kbd&gt;+&lt;kbd&gt;a&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11131" LastActivityDate="2016-12-08T11:12:40.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29189" PostTypeId="2" ParentId="29169" CreationDate="2016-12-08T14:17:44.663" Score="4" Body="&lt;p&gt;You can use a minor-mode and use a default mapping. Have a look at the &lt;code&gt;define-key&lt;/code&gt; documentation for details about default definitions in keymaps.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-minor-mode disable-keys-mode&#xA;  &quot;Disables all keys.&quot;&#xA;  :lighter &quot; dk&quot;&#xA;  :keymap (let ((map (make-sparse-keymap)))&#xA;            (define-key map (kbd &quot;C-g&quot;) (lambda ()&#xA;                                          (interactive)&#xA;                                          (disable-keys-mode -1)))&#xA;            (define-key map [t] 'ignore)&#xA;            map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2016-12-08T14:17:44.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29190" PostTypeId="2" ParentId="29178" CreationDate="2016-12-08T14:22:38.380" Score="1" Body="&lt;p&gt;It is probably being shadowed by a higher precedence keymap. The global map has the lowest precedence. One solution is to bind it with higher precedence which is easy if you use &lt;code&gt;bind-key*&lt;/code&gt; from &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;use-package&lt;/a&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key* (kbd &quot;C-x&quot;) 'kill-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One source for what the precendence rules are is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-Keymaps.html#Searching-Keymaps&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2016-12-08T14:22:38.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29192" PostTypeId="2" ParentId="20968" CreationDate="2016-12-08T15:48:29.790" Score="1" Body="&lt;p&gt;Turns out this is easy. If you're viewing the message (i.e. in mu4e:view), you can hit &lt;code&gt;a&lt;/code&gt; (for &quot;action&quot;) then &lt;code&gt;s&lt;/code&gt; (for &quot;show this thread&quot;). &lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2016-12-08T15:48:29.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29193" PostTypeId="2" ParentId="29172" CreationDate="2016-12-08T16:05:27.750" Score="7" Body="&lt;p&gt;&lt;code&gt;mark-whole-buffer&lt;/code&gt; is the command you want.  Here are some ways to discover it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;kbd&gt;&lt;kbd&gt;f1&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt;&lt;/kbd&gt; (&lt;code&gt;describe-key&lt;/code&gt;) works on menu items too.  In this case it would tell you&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;menu-bar&amp;gt; &amp;lt;edit&amp;gt; &amp;lt;mark-whole-buffer&amp;gt; runs the command mark-whole-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;mark-whole-buffer&lt;/code&gt; is in the manual's index under &quot;select all&quot;:&#xA;&lt;kbd&gt;&lt;kbd&gt;f1&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;/kbd&gt; to open the manual, &lt;kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;select all&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/kbd&gt; to check the index for &quot;select all&quot;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;‘C-x h’ (‘mark-whole-buffer’) sets up the entire buffer as the&#xA;  region, by putting point at the beginning and the mark at the end.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-12-08T16:05:27.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29194" PostTypeId="2" ParentId="29173" CreationDate="2016-12-08T16:31:36.040" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I have tried using Cua mode (via adding &lt;code&gt;(cua-mode t)&lt;/code&gt; to my&#xA;  &lt;code&gt;~/.emacs&lt;/code&gt; file) but it doesn't seem to set the copy keybinding to&#xA;  &lt;kbd&gt;Ctrl&lt;/kbd&gt;-&lt;kbd&gt;c&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It does, but only when you highlight text, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/CUA-Bindings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;CUA Bindings&lt;/a&gt; &lt;kbd&gt;&lt;kbd&gt;f1&lt;/kbd&gt;&lt;kbd&gt;r&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt;cua&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The command M-x cua-mode sets up key bindings that are compatible with&#xA;  the Common User Access (CUA) system used in many other applications.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When CUA mode is enabled, the keys C-x, C-c, C-v, and C-z invoke&#xA;  commands that cut (kill), copy, paste (yank), and undo respectively.&#xA;  The C-x and C-c keys perform cut and copy only if the region is&#xA;  active. Otherwise, they still act as prefix keys, so that standard&#xA;  Emacs commands like C-x C-c still work. Note that this means the&#xA;  variable mark-even-if-inactive has no effect for C-x and C-c (see&#xA;  Using Region).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For technical reasons, &lt;kbd&gt;&lt;kbd&gt;f1&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt;&lt;kbd&gt;C-c&lt;/kbd&gt;&lt;/kbd&gt; when text is highlighted says &lt;code&gt;C-c runs the command cua--prefix-override-handler&lt;/code&gt; rather than &lt;code&gt;kill-ring-save&lt;/code&gt; or &lt;code&gt;cua-copy-region&lt;/code&gt;, and similarly the menu won't reflect the CUA bindings.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-12-08T16:31:36.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29195" PostTypeId="1" CreationDate="2016-12-08T18:46:21.327" Score="5" ViewCount="961" Body="&lt;p&gt;I would like to have more control on the R session in org-mode so that I only have to chage the session name in one place for the modification to affect the whole buffer.&#xA;The only way I could think this through was to modify the &lt;code&gt;org-babel-default-header-args&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to define a function so that I can modify the default arguments easily. But I don't know how to pass the name of the session as a string. see the code below. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-session-name (&amp;amp;optional r-session-name r-session-directory)&#xA;  (interactive (list&#xA;                (read-from-minibuffer &quot;r-session-name: &quot; &quot;*R*&quot; )&#xA;        (read-from-minibuffer &quot;r-session-directory: &quot; &quot;/home/test/&quot;)))  &#xA;  (setq org-babel-default-header-args:R&#xA;    (cons '(:dir . &quot;%s&quot; r-session-directory))&#xA;    (cons '(:session . r-session-name) &#xA;          (assq-delete-all :session org-babel-default-header-args:R))&#xA;          ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(:dir . &quot;%s&quot; ression directory &quot;/home/test/&quot;)&lt;/code&gt; is obviously wrong. Can you help please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** Some details **&#xA; Let's say that we are in an &lt;code&gt;.org&lt;/code&gt;  buffer and I have a buffer wide header like the following. With the session name being &lt;code&gt;remote-R-remote*&lt;/code&gt; and the ouput being silenced &lt;code&gt;:output silent&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+PROPERTY: header-args:R :session *remote-R-remote*  :exports results :colnames yes :results output silent :output-dir images/ :dir &quot;/ssh:gnu:/home/livelygnu/Documents/R/&quot; :eval yes :cache yes&#xA;&#xA;* Some First steps&#xA;&#xA;    #+Name: &#xA;    #+BEGIN_SRC R &#xA;    do some stuffs&#xA;    #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if in a subtree we want to produce a certain number of graphs but don't want to write &lt;code&gt;:results output graphics&lt;/code&gt; all the time along with the file extension we have to redefine the whole header argument for this subtree.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** output some graphs&#xA;:PROPERTIES:&#xA;:header-args:R: :session *remote-R-remote* :results output graphics :output-dir: images/ :eval yes :file-ext pdf&#xA;:END:&#xA;&#xA;    #+Name: name_of_graphs&#xA;    #+BEGIN_SRC R &#xA;    plot(a)&#xA;    #+END_SRC&#xA;&#xA;    many more graphs possibly&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can do the same for latex output for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** output some results&#xA;:PROPERTIES:&#xA;:header-args:R: :session *remote-R-remote* :results output latex :output-dir: &#xA;:END:&#xA;&#xA;&#xA;#+Name: name_of_graphs&#xA;#+BEGIN_SRC R &#xA;output latex block&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now let's say while our estimation is working on the session remote-R-remote (possibly a long computation), we want to continue to work on some graphs in another session. for that we would have to change the :session names for all the code block that we need. But If instead we  modify the default arguments  in &lt;code&gt;org-babel-default-header-args&lt;/code&gt;. Then changing the key :session there would change the session everywhere. Of course this mean that we would not have to write &lt;code&gt;:session *remote-R-remote*&lt;/code&gt; all the time as well since we can put it as default.&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="5385" LastEditDate="2017-06-07T20:36:08.777" LastActivityDate="2017-08-06T21:27:53.753" Title="modify default org babel default headers" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29196" PostTypeId="1" CreationDate="2016-12-08T19:10:29.577" Score="4" ViewCount="103" Body="&lt;p&gt;I know there are ways to preview markdown as you type but is there a way to avoid this duplication of text (rendered and pain text in different buffers)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I want to type in the preview. What I'm looking for goes like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I type in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Headline&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;, the characters making up the word &quot;Headline&quot; already are being rendered so I see&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;Hea&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and as I type a &quot;d&quot;, it changes to:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;h1&gt;Head&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Or some other convenient way of rendering it live without duplication, for example in every line but the one the pointer is currently in.&lt;/p&gt;&#xA;" OwnerUserId="14203" LastEditorUserId="14203" LastEditDate="2016-12-08T19:20:08.810" LastActivityDate="2016-12-08T19:20:08.810" Title="Typing in Live-Rendered Markdown" Tags="|markdown|previewing|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29197" PostTypeId="1" AcceptedAnswerId="29210" CreationDate="2016-12-08T23:30:52.507" Score="3" ViewCount="411" Body="&lt;p&gt;I am using Emacs 25 in SUSE linux and when I switch to a workspace where Emacs is the front window almost none of the text is visible. I have to call &lt;code&gt;redraw-display&lt;/code&gt; in order to get it refresh the screen so I can see my text. Is there someway that I could make this automatic? Like whenever Emacs gets focused it calls &lt;code&gt;redraw-display&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12269" LastActivityDate="2016-12-09T20:58:37.820" Title="redraw-display when focused" Tags="|display|linux|gui-emacs|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29198" PostTypeId="2" ParentId="29095" CreationDate="2016-12-09T00:53:00.993" Score="1" Body="&lt;p&gt;I went with an approach that uses &lt;code&gt;before-change-functions&lt;/code&gt; and &lt;code&gt;after-change-functions&lt;/code&gt; to update the word count after each buffer modification. A simplified version of the code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Function that counts words in buffer&#xA;(defun wc-buffer ()&#xA;...&#xA;)&#xA;&#xA;;; Function that counts words in a region&#xA;(defun wc-region (rbeg rend)&#xA;...&#xA;)&#xA;&#xA;(defvar-local a1 nil)&#xA;(defvar-local a2 nil)&#xA;(defvar-local curr-wc nil)&#xA;&#xA;(defun init-function ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (setq curr-wc (wc-buffer))&#xA;    )&#xA;  )&#xA;&#xA;(defun wc-update-before (change-beg change-end)&#xA;  (setq pos1 (max 1 (1- change-beg)))&#xA;  (setq pos2 (min (point-max) (1+ change-end)))&#xA;&#xA;  (setq a1 (wc-region pos1 pos2))&#xA;)&#xA;&#xA;(defun wc-update-after (change-beg change-end prev-len)&#xA;  (if (bound-and-true-p a1) &#xA;      (progn&#xA;    (setq pos1 (max 1 (1- change-beg)))&#xA;    (setq pos2 (min (point-max) (1+ change-end)))&#xA;&#xA;    (setq a2 (wc-region pos1 pos2))&#xA;&#xA;    (setq curr-wc (+ curr-wc (- a2 a1)))&#xA;    )&#xA;    nil)&#xA;  )&#xA;&#xA;(init-function)&#xA;(add-hook 'before-change-functions 'wc-update-before nil t) &#xA;(add-hook 'after-change-functions 'wc-update-after nil t)&#xA;(setq inhibit-modification-hooks nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Code for the &lt;code&gt;wc-buffer&lt;/code&gt; and &lt;code&gt;wc-region&lt;/code&gt; functions needs to be added to use this.) The variable &lt;code&gt;curr-wc&lt;/code&gt; holds the current word count. This runs efficiently and causes no noticeable slowdown even on large files (tested with 100,000 words). It seems to work correctly for all modification types I've tried (inserts, deletes, yanks, kills, and undos). The main concern with the approach is that, according to the documentation, the &lt;code&gt;before-change-functions&lt;/code&gt; and &lt;code&gt;after-change-functions&lt;/code&gt; are not necessarily called in pairs. But in my testing so far this doesn't seem to have affected the accuracy of the count.&lt;/p&gt;&#xA;" OwnerUserId="14111" LastActivityDate="2016-12-09T00:53:00.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29199" PostTypeId="2" ParentId="29195" CreationDate="2016-12-09T07:12:00.947" Score="3" Body="&lt;p&gt;I'd apply the buffer wide property syntax (org-mode 9), e.g. for an R (session) buffer called &lt;code&gt;*R*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+PROPERTY: header-args:R :session *R*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;org-mode &amp;lt;9:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+PROPERTY: session *R*&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And do &lt;code&gt;C-c C-c&lt;/code&gt; on this line to activate new settings.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2016-12-09T07:12:00.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29200" PostTypeId="2" ParentId="16497" CreationDate="2016-12-09T08:49:13.440" Score="9" Body="&lt;p&gt;Another solution would be to use &lt;code&gt;ag&lt;/code&gt;(&lt;a href=&quot;https://github.com/ggreer/the_silver_searcher&quot; rel=&quot;noreferrer&quot;&gt;the_silver_searcher&lt;/a&gt;) or &lt;code&gt;rg&lt;/code&gt; (&lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot; rel=&quot;noreferrer&quot;&gt;ripgrep&lt;/a&gt;) to generate project files. Here's how you can do it with &lt;code&gt;rg&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq projectile-enable-caching t)&#xA;&#xA;;;; Default rg arguments&#xA;  ;; https://github.com/BurntSushi/ripgrep&#xA;  (when (executable-find &quot;rg&quot;)&#xA;    (progn&#xA;      (defconst modi/rg-arguments&#xA;        `(&quot;--line-number&quot;                     ; line numbers&#xA;          &quot;--smart-case&quot;&#xA;          &quot;--follow&quot;                          ; follow symlinks&#xA;          &quot;--mmap&quot;)                           ; apply memory map optimization when possible&#xA;        &quot;Default rg arguments used in the functions in `projectile' package.&quot;)&#xA;&#xA;      (defun modi/advice-projectile-use-rg ()&#xA;        &quot;Always use `rg' for getting a list of all files in the project.&quot;&#xA;        (mapconcat 'identity&#xA;                   (append '(&quot;\\rg&quot;) ; used unaliased version of `rg': \rg&#xA;                           modi/rg-arguments&#xA;                           '(&quot;--null&quot; ; output null separated results,&#xA;                             &quot;--files&quot;)) ; get file names matching the regex '' (all files)&#xA;                   &quot; &quot;))&#xA;&#xA;      (advice-add 'projectile-get-ext-command :override #'modi/advice-projectile-use-rg)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your project directory, specify the files you want to ignore in &lt;code&gt;.gitignore&lt;/code&gt; and you're good to go :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code is from &lt;a href=&quot;https://emacs.stackexchange.com/users/115/kaushal-modi&quot;&gt;kaushalmodi's&lt;/a&gt; emacs config.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-12-09T08:49:13.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29201" PostTypeId="1" AcceptedAnswerId="29209" CreationDate="2016-12-09T09:26:33.677" Score="5" ViewCount="1056" Body="&lt;p&gt;I'm facing this problem that when I include some LaTeX specific attributes for my image, then the image doesn't display inside org-mode (although it is displayed fine in my exported LaTeX PDF). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I include an image like this, the image stop showing inside org-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_LATEX: :width 7cm&#xA;[[img/img2.png]] &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However if I remove that LaTeX attribute, then it is displaying fine inside org-mode. &lt;/p&gt;&#xA;" OwnerUserId="13458" LastActivityDate="2016-12-09T19:38:43.217" Title="org-mode doesn't display image when LaTeX Image Attributes are included" Tags="|org-mode|org-export|latex|images|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29202" PostTypeId="1" AcceptedAnswerId="29205" CreationDate="2016-12-09T12:39:47.887" Score="0" ViewCount="776" Body="&lt;p&gt;I have installed the &lt;code&gt;matlab-mode-20160902.459&lt;/code&gt; package from MELPA and whenever I open an m file (i.e., a file with the file extension &lt;code&gt;.m&lt;/code&gt; which is the file extension of most MATLAB/GNU Octave scripts) I get an error message shown in the below screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7g2mC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7g2mC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/fusion809/emacs/blob/050433d763a7676da60b549507b7779ed5f5114e/.emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is my present &lt;code&gt;~/.emacs&lt;/code&gt; file. As you can see on &lt;a href=&quot;https://github.com/fusion809/emacs/blob/050433d763a7676da60b549507b7779ed5f5114e/.emacs#L129&quot; rel=&quot;nofollow noreferrer&quot;&gt;line 129&lt;/a&gt; I have added the line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.m$&quot; . matlab-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to hopefully autoload &lt;code&gt;matlab-mode&lt;/code&gt; whenever I open an m file. I really have no idea how to fix this error as I haven't pressed C-x when I opened this file... If relevant I opened my m files using the Emacs directory browser shown in the screenshot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it perhaps that this &lt;code&gt;~/.emacs&lt;/code&gt; line that sets &lt;code&gt;.m&lt;/code&gt; files to be handled by &lt;code&gt;matlab-mode&lt;/code&gt; conflicts with the default handling of &lt;code&gt;.m&lt;/code&gt; files as Objective C files? Regardless of the cause a solution would be wonderful. I don't ever code in objective C (I am a loyal Linux user with no interest in iOS or macOS development), but I do code in GNU Octave / MATLAB, so setting m files as being associated with &lt;code&gt;matlab-mode&lt;/code&gt; would be ideal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried using &lt;code&gt;octave-mod&lt;/code&gt; instead by adding:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-mode-alist&#xA;      (cons '(&quot;\\.m$&quot; . octave-mode) auto-mode-alist))&#xA;(add-hook 'octave-mode-hook&#xA;          (lambda ()&#xA;            (abbrev-mode 1)&#xA;            (auto-fill-mode 1)&#xA;            (if (eq window-system 'x)&#xA;                (font-lock-mode 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my &lt;code&gt;~/.emacs&lt;/code&gt; file (in accordance with &lt;a href=&quot;https://www.gnu.org/software/octave/doc/v4.0.0/Using-Octave-Mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this guide&lt;/a&gt;). That gave the same error when opening an &lt;code&gt;~/.emacs&lt;/code&gt; file (and yes I did remove the &lt;code&gt;matlab-mode&lt;/code&gt; line before I added these lines to make it a fair test of whether it works). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen &lt;a href=&quot;https://stackoverflow.com/questions/14941995/emacs-change-file-extension-mode-association&quot;&gt;this question&lt;/a&gt; at StackOverflow but neither upvoted answer (which presently are &lt;a href=&quot;https://stackoverflow.com/a/16711771/1876983&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://stackoverflow.com/a/14951267/1876983&quot;&gt;this&lt;/a&gt;) worked for me: they both returned the same error whenever I opened an m file and neither caused syntax-highlighting of the m file to occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The backtrace generated by going to Options&amp;rarr;Enter Debugger on Error was, when I opened the m file &lt;code&gt;/home/fusion809/GitHub/mine/scripts/GNU_Octave/first.m&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Cannot open load file&quot; &quot;No such file or directory&quot; &quot;octave-mode&quot;)&#xA;  octave-mode()&#xA;  set-auto-mode-0(octave-mode nil)&#xA;  set-auto-mode()&#xA;  normal-mode(t)&#xA;  after-find-file(nil t)&#xA;  find-file-noselect-1(#&amp;lt;buffer first.m&amp;gt; &quot;~/GitHub/mine/scripts/GNU_Octave/first.m&quot; nil nil &quot;~/GitHub/mine/scripts/GNU_Octave/first.m&quot; (21370145 2052))&#xA;  find-file-noselect(&quot;/home/fusion809/GitHub/mine/scripts/GNU_Octave/first.m&quot; nil nil nil)&#xA;  find-file-other-window(&quot;/home/fusion809/GitHub/mine/scripts/GNU_Octave/first.m&quot;)&#xA;  dired-mouse-find-file-other-window((mouse-2 (#&amp;lt;window 3 on GNU_Octave&amp;gt; 419 (546 . 123) 39532480 nil 419 (60 . 6) nil (6 . 15) (9 . 18))))&#xA;  funcall-interactively(dired-mouse-find-file-other-window (mouse-2 (#&amp;lt;window 3 on GNU_Octave&amp;gt; 419 (546 . 123) 39532480 nil 419 (60 . 6) nil (6 . 15) (9 . 18))))&#xA;  call-interactively(dired-mouse-find-file-other-window nil nil)&#xA;  command-execute(dired-mouse-find-file-other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With MATLAB mode (instead of Octave mode as in the last backtrace) I get the backtrace &lt;a href=&quot;http://paste2.org/wDE8VcbV&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://paste2.org/wDE8VcbV&lt;/a&gt; (too long to paste here).&lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-09T17:02:26.747" Title="When MATLAB mode is installed opening an m file gives a file mode specification error" Tags="|matlab|octave|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29203" PostTypeId="1" AcceptedAnswerId="29204" CreationDate="2016-12-09T13:32:35.037" Score="2" ViewCount="113" Body="&lt;p&gt;strange issue. when i launch isearh and want to paste text into it, after pressing C-s the paste (S-insert) always pastes the text to the current edited buffer and not the isearch window. has anyone come across anything like this?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2016-12-09T14:38:45.320" LastActivityDate="2016-12-09T14:38:45.320" Title="isearch looses focus when trying to paste into the isearch buffer" Tags="|isearch|yank|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29204" PostTypeId="2" ParentId="29203" CreationDate="2016-12-09T14:37:37.433" Score="3" Body="&lt;p&gt;There is no &quot;strange issue&quot; here - just a misunderstanding.  The behavior you see is by design.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you call the &quot;isearch window&quot; is in reality not a window, and it does not display a buffer.  It is just the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Echo-Area.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;echo area&lt;/a&gt;, which is an &lt;em&gt;output&lt;/em&gt; area for showing messages to the user. It is &lt;strong&gt;not&lt;/strong&gt; an input area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you try to use an ordinary yank (paste) command during Isearch then the text gets yanked to whichever buffer and window are currently selected.  That's what you're seeing when you use &lt;code&gt;S-insert&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isearch &lt;em&gt;reads individual characters&lt;/em&gt; that you type (wherever you type them), and it echoes them to the echo area so you can see that it has added them to the current search string.  It does &lt;em&gt;not&lt;/em&gt; use that area where you see the &quot;prompt&quot; and search string as the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;minibuffer&lt;/a&gt; - it &lt;em&gt;does not read input from there&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You &lt;em&gt;can&lt;/em&gt; yank (paste) text that you copy from elsewhere to Isearch, to be appended to the search string.  For that, you need to use one of the special Isearch yank commands, such as &lt;code&gt;isearch-yank-kill&lt;/code&gt; (bound to &lt;strong&gt;&lt;code&gt;C-y&lt;/code&gt;&lt;/strong&gt; during Isearch).  (You could, if you wanted, bind &lt;code&gt;S-insert&lt;/code&gt; in &lt;code&gt;isearch-mode-map&lt;/code&gt; to the same command.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can use &lt;strong&gt;&lt;code&gt;M-e&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;isearch-edit-string&lt;/code&gt;) to interrupt Isearch to &lt;em&gt;edit&lt;/em&gt; the current search string, using the minibuffer.  There (in the minibuffer) you can yank (paste) text normally - the minibuffer allows general editing.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-09T14:37:37.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29205" PostTypeId="2" ParentId="29202" CreationDate="2016-12-09T16:51:07.467" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/fusion809/emacs/blob/050433d763a7676da60b549507b7779ed5f5114e/.emacs#L104&quot; rel=&quot;nofollow noreferrer&quot;&gt;This part&lt;/a&gt; of your config is causing the problem. You should use something like &lt;code&gt;cua-mode&lt;/code&gt; instead of binding keys like &lt;kbd&gt;C-c&lt;/kbd&gt; and &lt;kbd&gt;C-x&lt;/kbd&gt;, which conflict with commonly used prefixes in emacs. &lt;code&gt;cua-mode&lt;/code&gt; should make some of key combinations you use work as expected, and give you a way to use proper keybindings that begin with &lt;kbd&gt;C-c&lt;/kbd&gt; and &lt;kbd&gt;C-x&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/CUA-Bindings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/CUA-Bindings.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-12-09T16:51:07.467" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29206" PostTypeId="1" AcceptedAnswerId="29235" CreationDate="2016-12-09T18:26:57.767" Score="2" ViewCount="209" Body="&lt;p&gt;I noticed that Wanderlust 2.15.9 (Almost Unreal) does not automatically mark an email as &quot;answered&quot; to which I have written a reply, as some other mail clients do.  How can I make it do so?  I am aware that there are &lt;code&gt;wl-summary-mark-as-answered&lt;/code&gt; and the likes, but I am not sure how to use them from a elisp code.&lt;/p&gt;&#xA;" OwnerUserId="2721" LastActivityDate="2016-12-18T22:09:03.487" Title="How to make Wanderlust mark replied emails as &quot;answered&quot;" Tags="|email|wanderlust|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29208" PostTypeId="2" ParentId="26723" CreationDate="2016-12-09T19:27:19.490" Score="1" Body="&lt;p&gt;Are you using &lt;code&gt;nnmaildir&lt;/code&gt; or &lt;code&gt;nnml&lt;/code&gt;?  It seems to me that the daemon does not work for &lt;code&gt;nnmaildir&lt;/code&gt;. Can someone confirm please. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code for gnus-demon-scan-mail&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun gnus-demon-scan-mail ()&#xA;  (save-window-excursion&#xA;(let ((servers gnus-opened-servers)&#xA;  server&#xA;  (nnmail-fetched-sources (list t)))&#xA;  (while (setq server (car (pop servers)))&#xA;(and (gnus-check-backend-function 'request-scan (car server))&#xA;     (or (gnus-server-opened server)&#xA;     (gnus-open-server server))&#xA;     (gnus-request-scan nil server))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;&#xA;I have found these two functions on the gnus mailing list. They are really helpful to understand how things work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; * check new mail&#xA;;;; ** function def&#xA;(defun gnus-demon-scan-mail-or-news-and-update (level)&#xA;&quot;Scan for new mail, updating the *Group* buffer.&quot;&#xA;  (let ((win (current-window-configuration)))&#xA;    (unwind-protect&#xA;        (save-window-excursion&#xA;          (save-excursion&#xA;            (when (gnus-alive-p)&#xA;              (save-excursion&#xA;                (set-buffer gnus-group-buffer)&#xA;                (gnus-group-get-new-news level)))))&#xA;      (message &quot;scanning for new mail done&quot;)&#xA;      (set-window-configuration win))))&#xA;&#xA;(defun gnus-demon-scan-news-and-update ()&#xA;&quot;Scan for new mail, updating the *Group* buffer.&quot;&#xA;  (gnus-demon-scan-mail-or-news-and-update 3))&#xA;&#xA;;;; ** command&#xA;(gnus-demon-add-handler 'gnus-demon-scan-news-and-update 10 nil)&#xA;(gnus-demon-add-handler 'gnus-demon-scan-mail 10 nil)&#xA;(gnus-demon-init)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I'm using &lt;code&gt;nnml&lt;/code&gt; as my mail back-end with &lt;code&gt;procmail&lt;/code&gt; and &lt;code&gt;fetchmail&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq gnus-select-method '(nnml &quot;&quot;))&#xA;(setq mail-sources  '((file :path &quot;~/.mail/inbox.spool&quot;)&#xA;          ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For mail notification you can use this &lt;a href=&quot;https://stackoverflow.com/a/9611516/2081427&quot;&gt;https://stackoverflow.com/a/9611516/2081427&lt;/a&gt;&#xA;The you get notified in the mode-line each time a mail new mail comes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; I couldn't make &lt;code&gt;gnus-notify.el&lt;/code&gt; work for more than one group. So as far as I know&#xA;if you use nnmail-split-methods and want &lt;code&gt;gnus-notify.el&lt;/code&gt; for more than one group it won't work.&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-05-09T18:52:21.697" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29209" PostTypeId="2" ParentId="29201" CreationDate="2016-12-09T19:38:43.217" Score="3" Body="&lt;p&gt;Try adding:&lt;/p&gt;&#xA;&lt;h1&gt;+ATTR_ORG: :width 300&lt;/h1&gt;&#xA;&lt;p&gt;below the #+ATTR_LATEX: :width 7cm line.&lt;/p&gt;&#xA;&lt;p&gt;I guess org is showing your image scaled to 7 pixels wide, and it is invisible.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-09T19:38:43.217" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29210" PostTypeId="2" ParentId="29197" CreationDate="2016-12-09T20:58:37.820" Score="3" Body="&lt;p&gt;Add a hook to the focus event. &lt;code&gt;(add-hook 'focus-in-hook 'redraw-display)&lt;/code&gt;. Thanks to Håkon Hægland for the Answer!&lt;/p&gt;&#xA;" OwnerUserId="12269" LastActivityDate="2016-12-09T20:58:37.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29211" PostTypeId="1" AcceptedAnswerId="29213" CreationDate="2016-12-09T23:14:45.660" Score="8" ViewCount="405" Body="&lt;p&gt;I'm trying to use AUCTeX edit LaTeX files. The beginning of the document I just wanted to edit looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jjCkv.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not neatly organized, inconsistent in many ways, and I should probably change it but it's readable. (I didn't pick a nice example, I picked the document I wanted to edit which had parts of it copied in from various other documents which is why it's so inconsistent in the header.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after I selected the entire contents of the document and pressed &lt;code&gt;C-c C-q C-r&lt;/code&gt; (&lt;code&gt;LaTeX-fill-region&lt;/code&gt;), it looked like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kwKif.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest of the document looked fine before and still looks fine. The header looked ugly before and now looks utterly ravaged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to correct this behavior?&lt;/p&gt;&#xA;" OwnerUserId="14203" LastActivityDate="2016-12-10T11:02:27.053" Title="Formatting of usepackage commands in LaTeX document" Tags="|latex|auctex|formatting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29213" PostTypeId="2" ParentId="29211" CreationDate="2016-12-10T11:02:27.053" Score="8" Body="&lt;p&gt;If you want a command to stay in a line on its own, add it to &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#index-LaTeX_002dparagraph_002dcommands&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;LaTeX-paragraph-commands&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq LaTeX-paragraph-commands '(&quot;documentclass&quot; &quot;usepackage&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, honestly, I didn't ever see anyone trying to fill the preamble ;-)&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-12-10T11:02:27.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29214" PostTypeId="1" AcceptedAnswerId="29220" CreationDate="2016-12-10T11:42:27.163" Score="1" ViewCount="1484" Body="&lt;p&gt;So after a few months of frustration today i discovered the issue that's been bothering me for a long time..the REALLY slow emacs startup (sometimes 5 minutes or more).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cause is the org mode init file i use. what i currently have in my setup is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A. this init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;;since we are using use-package-don't autoload anythings&#xA;(setq package-enable-at-startup nil)&#xA;&#xA;(add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;;; org maybe suspect of hanging melpa, if you have hangs disable this first&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))&#xA;;; Initialize installed package&#xA;(package-initialize)  &#xA;&#xA;;; Bootstrap `use-package'&#xA;(unless (package-installed-p 'use-package)&#xA;    (package-refresh-contents)&#xA;    (package-install 'use-package))&#xA;&#xA;(org-babel-load-file (expand-file-name &quot;~/.emacs.d/settings.org&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;B. My config stored in settings.org which alot  of lisp code (like 17,000 lines..yeah i like to tinker :))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this method i discovered that every time i make a small change to setting.org and restart emacs the setting.org gets tangled to settings.el and emacs takes nearly 6!!! minutes to start (Init time was 396.10s (395.33s in init.el) , yeah thats painful as you can imagine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT what i discovered today is that if i just stick my config chunks from setting.org (ie the tangled setting.el file) into init.el, emacs starts super fast each time, even when i change the init.el file!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can anyone help me with this, i really would appreciate you guys help with this as its driving me mad :)&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11387" LastEditDate="2016-12-10T11:52:26.490" LastActivityDate="2016-12-15T02:58:09.913" Title="Org based init method slows down emacs startup DRAMATICLLY (6 minute startup)..help needed" Tags="|org-mode|init-file|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29215" PostTypeId="1" AcceptedAnswerId="29217" CreationDate="2016-12-10T12:16:13.557" Score="2" ViewCount="226" Body="&lt;p&gt;If I select everything in LaTeX-mode (AUCTeX) and auto-fill the region, the indentation of all lines is corrected. This is the part I like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it also breaks all long lines (which I think is the actual purpose of that function). But I don't like hard line wrapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can fix the indentation of an entire file without the lines being wrapped in the actual text? Wrapping them in the displayed text is desired.&lt;/p&gt;&#xA;" OwnerUserId="14203" LastActivityDate="2016-12-10T13:11:36.167" Title="Fix indentation of LaTeX code without wrapping lines" Tags="|latex|indentation|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29216" PostTypeId="1" AcceptedAnswerId="29218" CreationDate="2016-12-10T13:06:09.273" Score="10" ViewCount="2355" Body="&lt;p&gt;How do I get keystrokes displayed in the echo area immediately?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: when I enter the key sequence &lt;code&gt;C-u j&lt;/code&gt;, it will not display in the echo area immediately, but then I press key &lt;code&gt;k&lt;/code&gt;, and I discover that I was making a typo beforehand.  So, I think it will helpful for a newbie like me when I hit some keys to call a command for the echo area to show them immediately.&lt;/p&gt;&#xA;" OwnerUserId="14209" LastEditorUserId="105" LastEditDate="2016-12-10T17:12:47.923" LastActivityDate="2016-12-10T17:12:47.923" Title="How to get keystrokes displayed in the echo area immediately?" Tags="|key-bindings|keystrokes|echo-area|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29217" PostTypeId="2" ParentId="29215" CreationDate="2016-12-10T13:11:36.167" Score="5" Body="&lt;p&gt;If you only want to indent a region, you should call an &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Indentation.html#Indentation&quot; rel=&quot;nofollow noreferrer&quot;&gt;indenting function&lt;/a&gt;, not a filling function that, as you guessed, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Filling.html#Filling&quot; rel=&quot;nofollow noreferrer&quot;&gt;is meant to break lines&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you can use &lt;kbd&gt;C-M-\&lt;/kbd&gt; (&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;indent-region&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;) to indent the active region.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-12-10T13:11:36.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29218" PostTypeId="2" ParentId="29216" CreationDate="2016-12-10T13:28:53.727" Score="15" Body="&lt;p&gt;You are looking to adjust the value of the&#xA;variable&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Echo-Area-Customization.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;echo-keystrokes&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read its docstring by entering &lt;code&gt;C-h v echo-keystrokes&lt;/code&gt; (or&#xA;&lt;code&gt;M-x describe-variable echo-keystrokes&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Nonzero means echo unfinished commands after this many seconds of pause.&#xA;  The value may be integer or floating point.&#xA;  If the value is zero, don't echo at all.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that you cannot set the value to 0 and have it echo&#xA;instantaneously, but you can set it to an arbitrarily small&#xA;number, which will feel instantaneous.  You can therefore put&#xA;something like the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq echo-keystrokes .1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-12-10T13:28:53.727" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29219" PostTypeId="1" AcceptedAnswerId="29221" CreationDate="2016-12-10T14:01:50.567" Score="2" ViewCount="790" Body="&lt;p&gt;I'm trying to create a layer where one package in the layer depends on the functionality of another package in the same layer.&#xA;As spacemacs loads the packages alphabetically (I assume) this only works if the dependend package has a name that is loaded after the name of the package with the required functionality - otherwise it doesn't compile.&#xA;Minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs/private/testlayer&#xA;    - packages.el&#xA;    - local&#xA;        - a-package&#xA;            a-package.el&#xA;        - b-package&#xA;            b-package.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;packages.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; the order of the arguments in the package-list doesn't matter&#xA;;; for the loading process&#xA;(defconst testlayer-packages&#xA;  '((a-package :location local)&#xA;    (b-package :location local))&#xA;)&#xA;&#xA;;; the order of the init functions in the file doesn't matter&#xA;;; for the loading process&#xA;(defun testlayer/init-a-package ()&#xA;  (use-package a-package)&#xA;)&#xA;&#xA;(defun testlayer/init-b-package ()&#xA;  (use-package b-package)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;a-package.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'b-package)&#xA;&#xA;(defun a-pack-fun ()&#xA;  (b-pack-fun)&#xA;  )&#xA;&#xA;(provide 'a-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;b-package.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun b-pack-fun ()&#xA;   (message &quot;b-pack-fun&quot;)&#xA;)&#xA;&#xA;(provide 'b-package)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adding &lt;code&gt;testpackage&lt;/code&gt; to &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt; in &lt;code&gt;.spacemacs&lt;/code&gt; and trying to load it results in the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading &#xA;`/home/user/.emacs.d/init.el':&#xA;&#xA;File error: Cannot open load file, no such file or directory, b-package&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the dependencies are the other way around (&lt;code&gt;b-package&lt;/code&gt; calls functionality from &lt;code&gt;a-package&lt;/code&gt;) everything works just fine due to the alphabetical loading order. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how can I specify the loading order so that &lt;code&gt;b-package&lt;/code&gt; is loaded before &lt;code&gt;a-package&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="14148" LastEditorUserId="167" LastEditDate="2016-12-13T16:32:17.667" LastActivityDate="2016-12-13T16:32:17.667" Title="Specifying local package loading order in spacemacs" Tags="|package|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29220" PostTypeId="2" ParentId="29214" CreationDate="2016-12-10T14:03:44.813" Score="4" Body="&lt;p&gt;Not necessarily a solution, but at least an explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’ve seen this myself, although not to the extent of your tangling time. The startup time appears related to the number of separate &lt;code&gt;begin_src&lt;/code&gt; blocks that you’ve got – in the case of a literate programming init.el file you’re likely to have a lot of separate blocks as you intersperse elisp fragments with explanatory text and headings, which leads to the worst case startup time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’ve not investigated this myself, but it’s described in more detail here: &lt;a href=&quot;http://www.holgerschurig.de/en/emacs-init-tangle/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.holgerschurig.de/en/emacs-init-tangle/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(EDIT: zeltak has pointed out an updated approach here: &lt;a href=&quot;http://www.holgerschurig.de/en/emacs-efficiently-untangling-elisp/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.holgerschurig.de/en/emacs-efficiently-untangling-elisp/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That post doesn’t have a solution for “fixing” Org-mode’s tangling time, but it does present an alternative tangling function that avoids this problem. That function isn’t as general as Org-babel, but for this use case it’s quite likely sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I won’t reproduce that function here since it’s not my work, but the above link describes that in more detail. Note that I’ve not used this myself because my tangling time isn’t bad enough to force me down that path and I don’t modify my init.org much any more.&lt;/p&gt;&#xA;" OwnerUserId="737" LastEditorUserId="737" LastEditDate="2016-12-10T17:32:30.260" LastActivityDate="2016-12-10T17:32:30.260" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29221" PostTypeId="2" ParentId="29219" CreationDate="2016-12-10T20:18:18.707" Score="3" Body="&lt;p&gt;You are free to update the &lt;code&gt;load-path&lt;/code&gt; variable anywhere in &lt;code&gt;packages.el&lt;/code&gt; but I would put it in &lt;code&gt;config.el&lt;/code&gt; file though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, add a &lt;code&gt;config.el&lt;/code&gt; file in your layer with the following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path (concat (configuration-layer/get-layer-local-dir 'testlayer)&#xA;                                &quot;b-package/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: you can also use &lt;code&gt;use-package&lt;/code&gt; keyword &lt;code&gt;:load-path&lt;/code&gt;. I suggest you to use this keyword instead of &lt;code&gt;config.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Extending the load-path&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If your package needs a directory added to the load-path in order to load, use :load-path. This takes a symbol, a function, a string or a list of strings. If the path is relative, it is expanded within user-emacs-directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ess-site&#xA;  :load-path &quot;site-lisp/ess/lisp/&quot;&#xA;  :commands R)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2016-12-10T20:23:46.653" LastActivityDate="2016-12-10T20:23:46.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29222" PostTypeId="2" ParentId="29152" CreationDate="2016-12-10T21:59:30.120" Score="4" Body="&lt;p&gt;Try &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setq org-complete-tags-always-offer-all-agenda-tags t)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think you can easily add to this list from non-agenda files.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-10T21:59:30.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29223" PostTypeId="1" AcceptedAnswerId="29224" CreationDate="2016-12-10T22:13:17.923" Score="0" ViewCount="38" Body="&lt;p&gt;How can I easy make a function that display information in headline of buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean that first line of buffer wouldn't be used for displaying file content and instead would be used for showing necessary information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like in &lt;code&gt;info&lt;/code&gt; mode.&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2016-12-11T00:00:23.293" LastActivityDate="2016-12-11T00:00:23.293" Title="Develop headline to show supplementary information" Tags="|header-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29224" PostTypeId="2" ParentId="29223" CreationDate="2016-12-10T22:34:38.200" Score="2" Body="&lt;p&gt;Emacs has support for a header line which works pretty much like the mode line, but at the top of the buffer. See variable &lt;code&gt;header-line-format&lt;/code&gt;, which can be configured in the same way as &lt;code&gt;mode-line-format&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This variable defaults to nil (no header), but you could define a function to set it to display whatever you want. See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Header-Lines.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; for more. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-12-10T22:34:38.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29225" PostTypeId="1" AcceptedAnswerId="29226" CreationDate="2016-12-10T23:58:10.250" Score="3" ViewCount="382" Body="&lt;p&gt;During idle time with &lt;code&gt;run-with-idle-timer&lt;/code&gt; I parse text around a point and update &lt;code&gt;header-line-format&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I can't see update to header line unless I type any key. So I should trigger redisplay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;(redisplay)&lt;/code&gt; header line isn't updated. With &lt;code&gt;(force-window-update)&lt;/code&gt; it is updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what function is appropriated for my usage scenario. There are also &lt;code&gt;redraw-frame&lt;/code&gt; and &lt;code&gt;redraw-display&lt;/code&gt; and possibly many others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What function is more efficient in performance?&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2016-12-11T00:15:19.583" Title="force-window-update vs redisplay" Tags="|header-line|idle-timer|redisplay|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29226" PostTypeId="2" ParentId="29225" CreationDate="2016-12-11T00:15:19.583" Score="2" Body="&lt;p&gt;&lt;code&gt;(force-mode-line-update)&lt;/code&gt;  or all with the optional &lt;code&gt;t&lt;/code&gt;:  &quot;&lt;em&gt;Force redisplay of the current buffer’s mode line and header line.  With optional non-nil ALL, force redisplay of all mode lines and header lines.  This function also forces recomputation of the menu bar menus and the frame title.&lt;/em&gt;&quot;  Here is a link to the manual entry:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Basics.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Basics.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-12-11T00:15:19.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29227" PostTypeId="1" CreationDate="2016-12-11T01:18:28.750" Score="0" ViewCount="111" Body="&lt;p&gt;I have used xemacs for years and have a lot of lisp code I have written.&#xA;Now I want to switch to emacs and convert all the lisp code over to work in emacs.  This is on an winXP machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure I am not the first one to convert code back and forth.  Does anyone know what differences to expect? Are there any documents out there explaining the differences I need to watch for in converting lisp code?&lt;/p&gt;&#xA;" OwnerUserId="14210" LastEditorUserId="2609" LastEditDate="2016-12-11T11:05:25.260" LastActivityDate="2016-12-11T11:05:25.260" Title="converting xemacs lisp to run in emacs" Tags="|elisp|xemacs|" AnswerCount="1" CommentCount="3" ClosedDate="2016-12-11T11:58:54.430" ContentLicense="CC BY-SA 3.0" />
  <row Id="29228" PostTypeId="1" AcceptedAnswerId="29229" CreationDate="2016-12-11T01:20:38.823" Score="12" ViewCount="793" Body="&lt;p&gt;After setting &lt;code&gt;dired-auto-revert-buffer&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;, even when I'm working on a buffer of file that may produce some results, the message keep printing if there is a &lt;code&gt;dired&lt;/code&gt; buffer behind current buffer. This is really annoying. How can I completely disable it? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="105" LastEditDate="2016-12-11T02:36:35.467" LastActivityDate="2016-12-11T02:36:35.467" Title="How to stop dired printing &quot;Reverting buffer ...&quot;" Tags="|dired|auto-revert-mode|revert-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29229" PostTypeId="2" ParentId="29228" CreationDate="2016-12-11T02:25:50.047" Score="13" Body="&lt;p&gt;Customize option &lt;strong&gt;&lt;code&gt;auto-revert-verbose&lt;/code&gt;&lt;/strong&gt; to &lt;code&gt;nil&lt;/code&gt;.  &lt;code&gt;C-h v&lt;/code&gt; tells you this:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;auto-revert-verbose&lt;/code&gt;&lt;/strong&gt; is a variable defined in &lt;code&gt;autorevert.el&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Its value is &lt;code&gt;t&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Documentation:&lt;/p&gt;&#xA;&lt;p&gt;When &lt;code&gt;nil&lt;/code&gt;, Auto-Revert Mode does not generate any messages.&lt;/p&gt;&#xA;&lt;p&gt;When non-&lt;code&gt;nil&lt;/code&gt;, a message is generated whenever a file is reverted.&lt;/p&gt;&#xA;&lt;p&gt;You can &lt;em&gt;customize&lt;/em&gt; this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It's kind of a shame that the doc of &lt;code&gt;auto-revert-mode&lt;/code&gt; does not mention this option. Neither the doc string (&lt;code&gt;C-h v&lt;/code&gt;) nor the Emacs manual (node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html&quot; rel=&quot;noreferrer&quot;&gt;Reverting&lt;/a&gt;) mentions it.&lt;/p&gt;&#xA;&lt;p&gt;(I filed Emacs bug #&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25162&quot; rel=&quot;noreferrer&quot;&gt;25162&lt;/a&gt;, as an enhancement request to mention it.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-11T02:34:42.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29230" PostTypeId="2" ParentId="29227" CreationDate="2016-12-11T02:49:58.640" Score="4" Body="&lt;p&gt;The &lt;em&gt;language&lt;/em&gt; is pretty much the same Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some functionality is different: functions may be missing or be named differently, or accept different argument &amp;amp;c &amp;amp;c.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest that you start with byte-compiling the code and carefully examine all the errors and warnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you fix all of them, chances are you are golden.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-12-11T02:49:58.640" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29231" PostTypeId="1" CreationDate="2016-12-11T03:49:05.647" Score="2" ViewCount="271" Body="&lt;p&gt;Today I went to the EMACS org wiki &lt;a href=&quot;http://orgmode.org/manual/Setting-up-capture.html#Setting-up-capture&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/Setting-up-capture.html#Setting-up-capture&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and copy/pasted this directly into my .emacs file &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-default-notes-file (concat org-directory &quot;/notes.org&quot;))&#xA;     (define-key global-map &quot;\C-cc&quot; 'org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I'm getting this: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (initialization): An error occurred while loading&#xA;  ‘/home/kantuck/.emacs’:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Symbol's value as variable is void: org-directory&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To ensure normal operation, you should investigate and remove the&#xA;  cause of the error in your initialization file.  Start Emacs with the&#xA;  ‘--debug-init’ option to view a complete error backtrace.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I also tried a fresh .emacs file in case of conflicts, and put only that into it, and still it's giving me that error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what's going on?&lt;/p&gt;&#xA;" OwnerUserId="14077" LastEditorUserId="97" LastEditDate="2016-12-11T04:24:39.453" LastActivityDate="2016-12-11T04:27:12.583" Title="Org mode - capture - .emacs problem" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29232" PostTypeId="2" ParentId="29231" CreationDate="2016-12-11T04:27:12.583" Score="7" Body="&lt;p&gt;Is &lt;code&gt;org-directory&lt;/code&gt; a valid variable? You can check that with &lt;kbd&gt;C-h v org-directory&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My emacs reports it as&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-directory is a variable defined in ‘org.el’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you need to load org to get the variable defined. Before your lines above, add this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-12-11T04:27:12.583" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29233" PostTypeId="1" CreationDate="2016-12-11T12:30:21.413" Score="3" ViewCount="690" Body="&lt;p&gt;On Fedora 25 with GNU Emacs 25.1.90 (which I am running via an AppImage, you can download it from &lt;a href=&quot;https://bintray.com/fusion809/AppImages/GNU_Emacs#files&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and test out your theories as to what's wrong if you would like, remember AppImages will only work on Linux though) with a config file &lt;a href=&quot;https://github.com/fusion809/emacs/blob/master/.emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;found here&lt;/a&gt; I get an error whenever I start &lt;code&gt;ansi-term&lt;/code&gt; or &lt;code&gt;term&lt;/code&gt; via &lt;code&gt;M-x ansi-term&amp;lt;RET&amp;gt;&lt;/code&gt; or &lt;code&gt;M-x term&amp;lt;RET&amp;gt;&lt;/code&gt;, respectively, namely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error in process filter: Invalid face: unspecified&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I does not seem to matter too much which shell I use as I have tried my default shell, Z Shell (Zsh) and the more popular Bash shell and I get the exact same error message. Despite this the Bourne shell (&lt;code&gt;/bin/sh&lt;/code&gt;) works fine. The Emacs debugger gives the following backtrace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Invalid face&quot; unspecified)&#xA;  internal-get-lisp-face-attribute(unspecified :foreground nil)&#xA;  face-attribute(unspecified :foreground nil default)&#xA;  face-foreground(unspecified nil default)&#xA;  term-handle-colors-array(1)&#xA;  term-handle-ansi-escape(#&amp;lt;process terminal&amp;gt; 109)&#xA;  term-emulate-terminal(#&amp;lt;process terminal&amp;gt; &quot;[1m[7m%[27m[1m[0m                                                                               &#xA;&#xA;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're wondering why I don't just use GNU Emacs 25.1 installed via the DNF package manager well using it lead to some issues with Octave syntax-highlighting per &lt;a href=&quot;http://chat.stackexchange.com/rooms/49851/discussion-between-tobias-and-brenton-horne&quot;&gt;this chat room discussion&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to be colouring-related as when I comment out the &lt;code&gt;PS1=...&lt;/code&gt; line in my &lt;code&gt;~/.bashrc&lt;/code&gt; file this error goes away and Bash starts without a problem.&lt;/p&gt;&#xA;" OwnerUserId="11131" LastEditorUserId="11131" LastEditDate="2016-12-11T14:32:02.833" LastActivityDate="2016-12-11T14:32:02.833" Title="Terminal Buffer: error in process filter: Invalid face: unspecified" Tags="|ansi-term|term|bash|zsh|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29234" PostTypeId="2" ParentId="28914" CreationDate="2016-12-11T15:43:58.677" Score="18" Body="&lt;p&gt;spacemacs binding for &lt;code&gt;kill-buffer-and-window&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;kbd&gt;x&lt;/kbd&gt;,&lt;kbd&gt;4&lt;/kbd&gt;,&lt;kbd&gt;0&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="10755" LastActivityDate="2016-12-11T15:43:58.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29235" PostTypeId="2" ParentId="29206" CreationDate="2016-12-11T21:11:44.743" Score="2" Body="&lt;p&gt;The following answer is based on a bare-bones default configuration, with the following three steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;From the &lt;code&gt;Summary&lt;/code&gt; buffer, select a message with the space bar (aka &lt;code&gt;wl-summary-read&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;From the &lt;code&gt;&quot; *WL:Message*&quot;&lt;/code&gt; buffer, type &lt;code&gt;M-x mime-preview-follow-current-entity&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;From the &lt;code&gt;&quot;+draft/1&quot;&lt;/code&gt; buffer, press &lt;code&gt;C-c C-c&lt;/code&gt; (aka &lt;code&gt;wl-draft-send-and-exit&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CAVEAT&lt;/strong&gt;:  The default value for &lt;code&gt;mime-preview-following-method-alist&lt;/code&gt; is &lt;code&gt;((wl-original-message-mode . wl-message-follow-current-entity))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'wl)&#xA;&#xA;(defun wl-message-follow-current-entity (buffer)&#xA;  &quot;Follow to current message.  @lawlist redefined this function so that&#xA;`wl-draft-reply' uses the optional argument of NUMBER.  NUMBER will become&#xA;`wl-draft-parent-number' by virtue of `wl-draft-create-buffer'.&quot;&#xA;  (wl-draft-reply  ;; reply to all&#xA;    (wl-message-get-original-buffer)&#xA;    nil&#xA;    wl-message-buffer-cur-summary-buffer&#xA;    wl-message-buffer-cur-number)&#xA;  (let ((mail-reply-buffer buffer))&#xA;    (wl-draft-yank-from-mail-reply-buffer nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-18T22:09:03.487" LastActivityDate="2016-12-18T22:09:03.487" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29236" PostTypeId="1" CreationDate="2016-12-11T21:52:49.203" Score="4" ViewCount="289" Body="&lt;p&gt;Bookmarks in the bookmarks file appear to be saved using absolute paths. This creates conflicts resolving bookmarks in a file that is synced across different computers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Absolute path computer 1: &lt;code&gt;/user/sync/file_with_bookmark&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Absolute path computer 2: &lt;code&gt;C:\sync\file_with_bookmark&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The absolute path of either file is used when writing to the emacs bookmarks file, which is also synced across both computers. Is there a way to save the bookmark in a way that would work on either computer? For example, perhaps the synced path for each computer could be expanded when resolving the bookmark?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 25.1&lt;/p&gt;&#xA;" OwnerUserId="9382" LastEditorUserId="9382" LastEditDate="2016-12-11T22:06:44.313" LastActivityDate="2016-12-15T03:59:39.147" Title="Bookmarks across different computers" Tags="|bookmarks|path|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29237" PostTypeId="2" ParentId="16874" CreationDate="2016-12-11T21:53:02.063" Score="10" Body="&lt;p&gt;The accepted answer is only the correct one in the case of simply wanting to see a user-viewable list of specific buffers in the &lt;code&gt;list-buffers&lt;/code&gt; display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you want to &lt;em&gt;programmatically&lt;/em&gt; retrieve all buffers with a certain mode in your code, then both answers above are terrible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best, most minimalistic, cleanest, built-in solution is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist ($buf (buffer-list (current-buffer)))&#xA;  (with-current-buffer $buf&#xA;    (when some-buffer-local-minor-or-major-mode-variable-you-want-to-find&#xA;      (message &quot;x %s&quot; $buf))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It does the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Retrieve a list of all buffers via &lt;code&gt;buffer-list&lt;/code&gt;, with the currently active buffer at the head of the list (so it's treated first, usually what you want, but leave out the &lt;code&gt;current-buffer&lt;/code&gt; parameter if you don't care).&lt;/li&gt;&#xA;&lt;li&gt;Loop through the buffer list and assign each buffer name to the variable &lt;code&gt;$buf&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;with-current-buffer $buf&lt;/code&gt; to tell Emacs that all code within the body should run as if it was running inside buffer &lt;code&gt;$buf&lt;/code&gt; instead of whatever buffer you're really displaying on screen.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;when &amp;lt;some mode variable&amp;gt;&lt;/code&gt; is the correct way to check if a mode is enabled; you can also use &lt;code&gt;if&lt;/code&gt; and other such methods. Either way, the goal is to check if a minor or major-mode's main mode variable is set in the buffer. Almost all modes define a variable via &quot;defining&quot; a mode, which &lt;em&gt;automatically&lt;/em&gt; causes them to create a buffer-local variable named after the mode, which is how this works. And if they don't have a standard variable, look at their own source code to see how their &quot;toggle&quot; code determines how to toggle them on and off. 99% of them use the existence of their modename's variable (and if they don't, I suggest reporting that as a bug to the mode's author). For example, to check if a buffer has whitespace-mode active, you would say &lt;code&gt;when whitespace-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;After that, it just outputs a message to the Messages buffer, with an &quot;x&quot; and the name of the buffer that had the mode active. That's where you'd put your own code, to do whatever you wanted to do with the discovered buffer.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Enjoy! Onwards to greater and cleaner lisp code!&lt;/p&gt;&#xA;" OwnerDisplayName="user14218" LastActivityDate="2016-12-11T21:53:02.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29238" PostTypeId="1" CreationDate="2016-12-12T03:28:04.910" Score="4" ViewCount="207" Body="&lt;p&gt;Is there a terse idiomatic way of calling a function in the manner of &lt;code&gt;funcall&lt;/code&gt; (dereferencing function symbols) when that function may have a variably shorter function signature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say for example: a hook assumes a signature of (VALUE PARENT), but for convenience it would be nice to also allow functions with the signature (VALUE) or ().  Evaluation using &lt;code&gt;funcall&lt;/code&gt; will throw an error if the signature is any shorter than the arguments of the funcall invocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a demonstration of the behavior I'm looking for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dash)&#xA;&#xA;(defun my/foo (a)&#xA;  (* a a))&#xA;&#xA;(defun my/bar (a b)&#xA; (* a b))&#xA;&#xA;(defun my/easy-going-funcall (fn &amp;amp;rest args)&#xA;  &quot;&quot;&#xA;  (let ((num-args (length (cadr (if (symbolp fn)&#xA;                                      (symbol-function fn)&#xA;                                   fn)))))&#xA;     (apply fn (-slice args 0 num-args))))&#xA;&#xA;(my/easy-going-funcall #'my/foo 2 3 4)  ;; 4&#xA;(my/easy-going-funcall #'my/bar 2 3 4) ;; 6&#xA;(my/easy-going-funcall (lambda () 42) 2 3 4) ;; 42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What equivalent does elisp have for something like &lt;code&gt;my/easy-going-funcall&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I realize this method of reflection doesn't work for built-in C functions and breaks down with argument keywords, but I don't know any better yet!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This really boils down to syntactic sugar for users and developers of a library.  From the user's perspective, if a hook expects functions with signature &lt;code&gt;(ARG1 ARG2 ARG3)&lt;/code&gt; and their function ignores all three arguments they could write &lt;code&gt;(lambda (&amp;amp;rest _unused) ...)&lt;/code&gt; for legibility.  If the hook itself has a mechanism to reliably call functions with shorter signatures (as this question asks) then the user may omit &lt;code&gt;&amp;amp;rest _unused&lt;/code&gt; entirely and write &lt;code&gt;(lambda () ...)&lt;/code&gt; as a matter of convenience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the flip-side, developers have additional flexibility in defining hooks.  Adding an additional argument to a hook signature does not need to be a breaking change.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2020-02-11T15:45:16.617" LastActivityDate="2020-02-11T15:45:16.617" Title="Calling a function with a shorter but unknown argument signature length" Tags="|functions|arguments|funcall|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29239" PostTypeId="1" AcceptedAnswerId="29253" CreationDate="2016-12-12T03:53:33.337" Score="4" ViewCount="538" Body="&lt;p&gt;Is there anything built into elisp for reflection on function argument signatures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have used &lt;code&gt;(length (cadr (symbol-function #'my/function)))&lt;/code&gt;, but this notably fails on built-in C functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure there are probably limitations because of function representation and there being argument keywords and destructuring in different contexts, but the goal here is strictly exploratory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;signature length (arity)&lt;/li&gt;&#xA;&lt;li&gt;has optional args&lt;/li&gt;&#xA;&lt;li&gt;min signature length&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-12-13T02:54:59.607" LastActivityDate="2021-04-27T20:08:43.030" Title="Reflection on function argument signatures" Tags="|elisp|arguments|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29240" PostTypeId="1" AcceptedAnswerId="29244" CreationDate="2016-12-12T04:20:52.663" Score="1" ViewCount="452" Body="&lt;p&gt;I've seen a discussion on someone trying to save the actual state of a Lisp Slime REPL. I just want to save a text version of a Geiser Racket REPL session, e.g., *ch1*, while using org-mode. (Then I can add it to my git.) Could someone point me to some elisp that would create the text file with a name that contains the session name, date-time stamp and file ending &quot;.repl&quot;? I've looked at elisp ref talk about &quot;saving buffer,&quot; but it doesn't seem to have what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I say all this because just trying to do a C-x C-s will indeed give me a text version of REPL session *ch1*, but it renames the live *ch1* REPL buffer to whatever I'm calling the text version, e.g. ch1-12112016-11:04.repl ... which is cool but not what I need. (BTW, the org-mode/geiser system doesn't get confused. It still uses that REPL session even though it's been renamed.) Again, I just want to save off a text version of what's in the REPL buffer with a timestamp and .repl ending.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2016-12-12T18:22:37.543" LastActivityDate="2016-12-12T18:22:37.543" Title="Save REPL buffer as file?" Tags="|buffers|files|saving|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29241" PostTypeId="2" ParentId="28912" CreationDate="2016-12-12T06:52:02.700" Score="1" Body="&lt;p&gt;Documenting my own crude solution for now, in case it helps anyone. I'll happily accept another answer with a better solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution took the form of two parts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Wrapper shell script around BusyBox's &lt;code&gt;diff&lt;/code&gt;, converting its unified output into traditional/&quot;normal&quot; output. (It's now in one of the directories in my PATH as &lt;code&gt;bnudiff&lt;/code&gt;. I put it on GitHub it &lt;a href=&quot;https://github.com/mentalisttraceur/bnudiff/blob/master/bnudiff&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; in case anyone wants to look).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs function advice around &lt;code&gt;smerge-refine-subst&lt;/code&gt; (I initially wrapped &lt;code&gt;diff-refine-hunk&lt;/code&gt;, but then learned from the comments that the actual refining function is the smerge one, and is presumably shared by one or more other modes as well) to make it use &lt;code&gt;bnudiff&lt;/code&gt; instead of &lt;code&gt;diff&lt;/code&gt; as the backend &lt;code&gt;diff-command&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun smerge-refine-subst-wrapper (smerge-refine-subst-real &amp;amp;rest arguments)&#xA; (let ((diff-command &quot;bnudiff&quot;))&#xA;  (apply smerge-refine-subst-real arguments)&#xA; )&#xA;)&#xA;(advice-add 'smerge-refine-subst :around #'smerge-refine-subst-wrapper)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This works perfectly (though I'm not in love with the inherently kludgey nature of it).&lt;/p&gt;&#xA;" OwnerUserId="13754" LastEditorUserId="13754" LastEditDate="2016-12-14T03:56:00.893" LastActivityDate="2016-12-14T03:56:00.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29242" PostTypeId="1" AcceptedAnswerId="29260" CreationDate="2016-12-12T07:22:10.470" Score="6" ViewCount="1014" Body="&lt;p&gt;How do I specify different actions for different export backends in org-mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more specific, I would like to export an pdf figure in latex export, while using a png in html export (in fact, a png thumbnail linking to the pdf, if that is of relevance):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: cation of figure&#xA;#+NAME:    myfig&#xA;# case export to latex: [[file:./figure.pdf]]&#xA;# case export to html:  [[file:./figure.pdf][file:./figure.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried macros and &lt;a href=&quot;https://stackoverflow.com/questions/13611837/how-can-i-use-different-image-formats-for-different-exports-in-org-mode&quot;&gt;this answer&lt;/a&gt;, which did not work. There are also answers on similar cases for tikz pdf/svg/png export like &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2013-07/msg00405.html&quot; rel=&quot;noreferrer&quot;&gt;this thread&lt;/a&gt;, which do not seem to be transferable to my case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I initially posted this question on stackoverflow. It occured to me later that emacs stackexchange is a more appropriate site for this question. So I deleted it on stackoverflow (there were no answers) to repost it here.&lt;/p&gt;&#xA;" OwnerUserId="14220" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2020-11-11T15:48:30.683" Title="How to do backend-dependent actions in org-mode export?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29243" PostTypeId="2" ParentId="29239" CreationDate="2016-12-12T08:14:57.573" Score="2" Body="&lt;p&gt;Stable Emacs releases offer &lt;code&gt;subr-arity&lt;/code&gt; which returns a cons describing the argument length.  This function has been extended to work in a more general fashion on the master branch, check out &lt;code&gt;func-arity&lt;/code&gt; and &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2016-03/msg00944.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the thread leading to it&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd generally advise against using this for more than tools helping you with elisp development (such as better error messages indicating minimum/maximum args).  If you can, find a way to not reach into that bag of tricks.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-12-12T08:14:57.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29244" PostTypeId="2" ParentId="29240" CreationDate="2016-12-12T09:01:33.503" Score="3" Body="&lt;p&gt;Here is a starting point. Modify the date format and other components of the filename to taste.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun save-buffer-copy (filename)&#xA;  (interactive&#xA;   (list (let ((fn (concat&#xA;                    (buffer-name) &quot;_&quot;&#xA;                    (format-time-string &quot;%Ft%T&quot;)&#xA;                    &quot;.repl&quot;)))&#xA;           (read-file-name &quot;Save buffer to file: &quot;&#xA;                           nil (concat default-directory fn) nil fn))))&#xA;  (write-region (point-min) (point-max) filename))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For added usability, you might wish to check the result of &lt;code&gt;(region-active-p)&lt;/code&gt; and save the region instead of the whole buffer if true.&lt;/p&gt;&#xA;" OwnerUserId="962" LastActivityDate="2016-12-12T09:01:33.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29246" PostTypeId="2" ParentId="6028" CreationDate="2016-12-12T12:09:23.850" Score="1" Body="&lt;p&gt;As mentioned earlier, &lt;em&gt;git-gutter&lt;/em&gt; is an extension designed for showing you git information directly in your file, and operating from there, whilst magit focuses on operating on diffs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This feature isn't planned for git gutter any time soon&#xA;(&lt;a href=&quot;https://github.com/syohex/emacs-git-gutter/issues/91&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syohex/emacs-git-gutter/issues/91&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it's the sort of thing that emacs lisp should be very good at wiping up (go through the hunks in a region and stage them out a time).&#xA;Trying this myself this was almost the case, the only problem was git-gutter kicks off a background process after you stage a hunk and doesn't wait for it to finish, so I had to add a little hacky magic to deal with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following emacs lisp function should do what you want. You might want to bind it to some keys.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-git-stage-region ()&#xA;  (interactive)&#xA;  (let ((git-gutter:ask-p nil)&#xA;        (start (region-beginning))&#xA;        (end (region-end)))&#xA;    (save-excursion&#xA;      (goto-char start)&#xA;      (git-gutter:next-hunk 1)&#xA;      (while (&amp;lt; (point) end)&#xA;        (git-gutter:stage-hunk)&#xA;        ;; This is a hack to wait for git-gutter to finish&#xA;        ;; updating information (git-gutter kicks&#xA;        ;; of a process to update the diff information&#xA;        ;; and does not block)&#xA;        (while (get-buffer (git-gutter:diff-process-buffer (git-gutter:base-file)))&#xA;          (sit-for 0.05))&#xA;        (git-gutter:next-hunk 1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14161" LastActivityDate="2016-12-12T12:09:23.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29247" PostTypeId="2" ParentId="29238" CreationDate="2016-12-12T14:14:13.740" Score="4" Body="&lt;p&gt;I generally recommend against doing that (better change the functions to take &lt;code&gt;&amp;amp;optional&lt;/code&gt; or &lt;code&gt;&amp;amp;rest&lt;/code&gt; arguments that are simply ignored), but if you must, the solution I recommend is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case nil&#xA;    (funcall f arg1 arg2 arg3)&#xA;  (wrong-number-of-arguments&#xA;   (condition-case nil&#xA;       (funcall f arg1 arg2)&#xA;     (wrong-number-of-arguments&#xA;      ...))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, some people will object that this is broken: what if the &lt;code&gt;wrong-number-of-arguments&lt;/code&gt; is signaled by some function call internal to &lt;code&gt;f&lt;/code&gt;?  Well, there's really not much you can do, because &quot;internal&quot; is in the eye of the beholder when you consider advice and other wrappers.  E.g. consider what should happen in your example for a case such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(my/easy-going-funcall (lambda (&amp;amp;rest args)&#xA;                         (apply (lambda () 42) args))&#xA;                       2 3 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-12-12T14:14:13.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29248" PostTypeId="2" ParentId="29236" CreationDate="2016-12-12T16:02:26.023" Score="2" Body="&lt;p&gt;It looks like the relevant bookmark function is &lt;code&gt;bookmark-get-filename&lt;/code&gt;. You could advise this to expand or otherwise transform the path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, add some 'filter return' advice to call &lt;code&gt;expand-file-name&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (advice-add 'bookmark-get-filename :filter-return 'expand-file-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be able to share a bookmarks file between systems, you need some way to map between paths. In your example it looks like you have a root 'sync' directory on each system, so you could do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst sync-dir&#xA;  (if (eq system-type 'windows-nt)&#xA;      &quot;C:/sync/&quot;&#xA;    &quot;/user/sync/&quot;))&#xA;&#xA;(defun sync-relative-name (file)&#xA;  (cond &#xA;   ((file-exists-p file)&#xA;    file)&#xA;   ((string-match &quot;^.+/sync/\\(.+\\)&quot; file)&#xA;    (expand-file-name (match-string 1 file) sync-dir))&#xA;   (t file)))&#xA;&#xA;(advice-add 'bookmark-get-filename :filter-return 'sync-relative-name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Define the root path for your sync tree on each system.&lt;/li&gt;&#xA;&lt;li&gt;Define a function that can take the absolute path from one system and convert it to the equivalent on the other system. Here I'm just taking everything after &lt;code&gt;sync/&lt;/code&gt; and using that to build a new path, relative to the local sync dir.&lt;/li&gt;&#xA;&lt;li&gt;Use this function to advise `bookmark-get-filename'. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-15T03:59:39.147" LastActivityDate="2016-12-15T03:59:39.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29251" PostTypeId="1" CreationDate="2016-12-12T20:57:21.117" Score="0" ViewCount="233" Body="&lt;p&gt;After a fresh install of Emacs (GNU Emacs 25.1.1 (i686-w64-mingw32) of 2016-09-18)&#xA;and AUCTeX (last version from ELPA) on Windows Vista, when I open a TeX file, Emacs takes an extremely long time to load the file (&gt;2minutes).&#xA;In the minibuffer I see a message telling &lt;code&gt;Applying style hooks...&lt;/code&gt;; the delay starts exactly when I see this message.&#xA;After this delay, when I open the message buffer I see something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Applying style hooks...&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/geometry.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amssymb.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsmath.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amstext.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsbsy.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsopn.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsthm.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/pdfsync.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/epigraph.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/multicol.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/makeidx.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/fancyhdr.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/footmisc.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/relsize.elc...done&#xA;Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/bm.elc...done&#xA;Applying style hooks... done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Incidentally, the base names of the &lt;code&gt;*.elc&lt;/code&gt; files are the names the packages I use in my TeX file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Emacs 24.5 I didn't have this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how to solve this issue? How to disable the loading of these style hooks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I open an empty TeX file, this delay is significantly reduced.&#xA;If I run emacs without my init file, this delay disappears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Thank you for your comments.&#xA;After your suggestions, I bisected my init file and I localized the code responsible for this delay. That was &lt;code&gt;(setq TeX-parse-self t)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-12-13T19:47:40.077" LastActivityDate="2016-12-13T19:47:40.077" Title="Emacs takes a very long time to open a TeX file" Tags="|latex|auctex|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29253" PostTypeId="2" ParentId="29239" CreationDate="2016-12-12T23:53:02.783" Score="2" Body="&lt;p&gt;Here's the code I have in my dot files. This code evolved over the years while maintaining backward compatibility; it should work with any Emacs or XEmacs version since the late 19.x series. If you only care about recent versions, the code can undoubtedly be simplified.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cond&#xA; ;; XEmacs&#xA; ((fboundp 'compiled-function-arglist)&#xA;  (defalias 'emacsen-compiled-function-arglist 'compiled-function-arglist))&#xA; ;; GNU Emacs&#xA; (t&#xA;  (defun emacsen-make-up-number-arglist (start end tail)&#xA;    (while (&amp;lt; start end)&#xA;      (setq end (1- end))&#xA;      (setq tail (cons (intern (format &quot;a%d&quot; end)) tail)))&#xA;    tail)&#xA;  (defun emacsen-compiled-function-arglist (func)&#xA;    (let ((a (aref func 0)))&#xA;      (if (integerp a)&#xA;          ;; An integer encoding the arity. Encountered in Emacs 24.3.&#xA;          ;; http://emacs.stackexchange.com/questions/971/argspec-or-arity-of-a-bytecode-function-in-emacs-24/973#973&#xA;          (let ((arglist (if (zerop (logand a 128))&#xA;                             nil&#xA;                           '(&amp;amp;rest rest)))&#xA;                (mandatory (logand a 127))&#xA;                (nonrest (lsh a -8)))&#xA;            (if (&amp;gt; nonrest mandatory)&#xA;                (setq arglist (cons '&amp;amp;optional (emacsen-make-up-number-arglist mandatory nonrest arglist))))&#xA;            (emacsen-make-up-number-arglist 0 mandatory arglist))&#xA;        ;; Otherwise: this is the arglist. The only format I've seen up to GNU 23.&#xA;        a)))))&#xA;(defun interactive-spec (function &amp;amp;optional safe)&#xA;  &quot;Return the interactive calling specs of FUNCTION.&#xA;Signal an error if FUNCTION does not have interactive calling specs.&#xA;However, in this case, if optional second argument SAFE is non-nil,&#xA;return nil.&quot;&#xA;  (want-type 'functionp function)&#xA;  (while (symbolp function)&#xA;    (setq function (symbol-function function)))&#xA;  (condition-case e&#xA;      (progn&#xA;        (if (eq (car-safe function) 'autoload)&#xA;            (progn&#xA;              (if (null (fifth function))&#xA;                  (signal 'wrong-type-argument `(interactivep ,function)))&#xA;              (load (third function))))&#xA;        (cond&#xA;         ((byte-code-function-p function)&#xA;          (or (if (fboundp 'compiled-function-interactive)&#xA;                  (compiled-function-interactive function)&#xA;                (aref function 5))&#xA;              (signal 'wrong-type-argument `(interactivep ,function))))&#xA;         ((and (consp function)&#xA;               (eq 'lambda (car function)))&#xA;          (or (cdr (assq 'interactive (cdr (cdr function))))&#xA;              (signal 'wrong-type-argument `(interactivep ,function))))&#xA;         (t&#xA;          (signal 'failure `(interactive-spec ,function ,@(and safe (list safe)))))))&#xA;    (wrong-type-argument (if (and (eq (car-safe (cdr e)) 'interactivep) safe)&#xA;                             nil&#xA;                           (signal 'wrong-type-argument (cdr e))))))&#xA;&#xA;(defun function-argspec (func)&#xA;  &quot;Return a function's argument list.&#xA;For byte-compiled functions in Emacs &amp;gt;=24, some information may be lost as the&#xA;byte compiler sometimes erases argument names. In this case, fake argument names&#xA;are reconstructed.&quot;&#xA;  (if (symbolp func) (setq func (indirect-function func)))&#xA;  (cond&#xA;   ((or (subrp func)&#xA;        (and (consp func)&#xA;             (eq (car func) 'autoload)&#xA;             (consp (cdr func))&#xA;             (consp (cdr (cdr func)))&#xA;             (stringp (car (cdr (cdr func))))))&#xA;    (let ((docstring (documentation func)))&#xA;      (save-match-data&#xA;        (if (string-match &quot;\n.*\\'&quot; docstring)&#xA;            (let ((form (read (match-string 0 docstring))))&#xA;              (cdr form))&#xA;          nil))))&#xA;   ((byte-code-function-p func)&#xA;    (emacsen-compiled-function-arglist func))&#xA;   ((and (consp func)&#xA;         (eq (car func) 'lambda)&#xA;         (consp (cdr func)))&#xA;    (car (cdr func)))&#xA;   ((and (consp func)&#xA;         (eq (car func) 'closure)&#xA;         (consp (cdr func))&#xA;         (consp (cdr (cdr func))))&#xA;    (car (cdr (cdr func))))&#xA;   (t (signal 'wrong-type-argument&#xA;              (list 'functionp func)))))&#xA;&#xA;(defun function-arity (func)&#xA;  &quot;Return a function's arity as (MIN . MAX).&#xA;Return minimum and maximum number of args allowed for SUBR.&#xA;The returned value is a pair (MIN . MAX).  MIN is the minimum number&#xA;of args.  MAX is the maximum number or the symbol `many', for a&#xA;function with `&amp;amp;rest' args, or `unevalled' for a special form.&#xA;&#xA;This function is like `subr-arity', but also works with user-defined&#xA;and byte-code functions. Symbols are dereferenced through&#xA;`indirect-function'.&quot;&#xA;  ;; TODO: keyword support&#xA;  (if (symbolp func) (setq func (indirect-function func)))&#xA;  (cond&#xA;   ((and (subrp func) (fboundp 'subr-arity))&#xA;    (subr-arity func))&#xA;   (t&#xA;    (let ((mandatory 0) (optional 0) (rest nil)&#xA;          (where 'mandatory))&#xA;      (when (and (consp func) (eq 'macro (car func)))&#xA;        (setq func (cdr func))&#xA;        (setq rest 'unevalled))&#xA;      (let ((argspec (function-argspec func)))&#xA;        (dolist (arg argspec)&#xA;          (cond&#xA;           ((eq arg '&amp;amp;optional) (setq where 'optional))&#xA;           ((eq arg '&amp;amp;rest) (unless rest (setq rest 'many)))&#xA;           (t (set where (+ (symbol-value where) 1)))))&#xA;        (cons mandatory (or rest (+ mandatory optional))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For built-in functions, there was no way to obtain parameter information directly before Emacs 25, but the information can be parsed from the docstring.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-12-12T23:53:02.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29254" PostTypeId="2" ParentId="26969" CreationDate="2016-12-13T00:06:38.390" Score="1" Body="&lt;p&gt;Instead of defining multiple versions and picking up the right one each time, it would make more sense to define a single variable according to the system that Emacs is running on.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst somepath (cl-case system-type&#xA;                     ((gnu/linux gnu gnu/kfreebsd) &quot;/home/xxx&quot;)&#xA;                     ((darwin) &quot;/Users/xxx&quot;)&#xA;                     ((windows-nt cygwin) &quot;D:/xxx&quot;)&#xA;                     (t (expand-file-name &quot;~&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that if you want to refer to your home directory, you should call &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Name-Expansion.html#index-expand_002dfile_002dname&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;expand-file-name&lt;/code&gt;&lt;/a&gt; rather than hard-code values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;somepath&lt;/code&gt; refers to a directory, call &lt;code&gt;expand-file-name&lt;/code&gt; to build a path to a file in that directory. To evaluate part of an expression which is otherwise given in literal syntax, use a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html#Backquote&quot; rel=&quot;nofollow noreferrer&quot;&gt;backquote&lt;/a&gt; rather than a quote, and a comma to indicate subexpressions to evaluate.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;     `((&quot;t&quot; &quot;TODO&quot; entry (file+headline ,(expand-file-name &quot;file.org&quot; somepath) &quot;Inbox&quot;)&#xA;          &quot;* TODO %?&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-12-13T00:06:38.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29255" PostTypeId="1" CreationDate="2016-12-13T06:58:59.787" Score="2" ViewCount="421" Body="&lt;p&gt;How can I show all the time spent on org-mode tasks completed within the last&#xA;week?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;clocktable&lt;/code&gt; doesn't include time logged outside the&#xA;&lt;code&gt;block&lt;/code&gt; time.  For a task that's spread over many weeks, the total time is&#xA;misleadingly low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I make the block time larger, e.g. a month, I get too many tasks and I'm&#xA;still not guaranteed to show all the time spent on completed tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example below, &lt;em&gt;Task with work from more than a week ago&lt;/em&gt; doesn't include&#xA;the hour logged on December 2nd.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* DONE Task with work from more than a week ago&#xA;  CLOSED: [2016-12-12 Mon 22:47]&#xA;  :PROPERTIES:&#xA;  :Effort:   0:30&#xA;  :END:&#xA;  :LOGBOOK:&#xA;  CLOCK: [2016-12-02 Fri 21:49]--[2016-12-02 Fri 22:49] =&amp;gt;  1:00&#xA;  CLOCK: [2016-12-12 Mon 22:14]--[2016-12-12 Mon 22:47] =&amp;gt;  0:33&#xA;  :END:&#xA;** TODO Subtask 1&#xA;  :PROPERTIES:&#xA;  :Effort:   0:10&#xA;  :END:&#xA;  :LOGBOOK:&#xA;  CLOCK: [2016-12-12 Mon 21:37]--[2016-12-12 Mon 21:47] =&amp;gt;  0:10&#xA;  :END:&#xA;* DONE Task with all time within a week&#xA;  CLOSED: [2016-12-12 Mon 22:47]&#xA;  :PROPERTIES:&#xA;  :Effort:   0:05&#xA;  :END:&#xA;  :LOGBOOK:&#xA;  CLOCK: [2016-12-12 Mon 23:38]--[2016-12-12 Mon 23:48] =&amp;gt;  0:10&#xA;  :END:&#xA;&#xA;&#xA;#+BEGIN: clocktable :maxlevel 9 :scope file :block thisweek :fileskip0 t :tcolumns 1 :properties (&quot;effort&quot;)&#xA;#+CAPTION: Clock summary at [2016-12-12 Mon 22:49], for week 2016-W50.&#xA;| effort | Headline           |   Time |&#xA;|--------+--------------------+--------|&#xA;|        | *Total time*       | *0:53* |&#xA;|--------+--------------------+--------|&#xA;|   0:30 | DONE Task 1        |   0:43 |&#xA;|   0:10 | \_  TODO Subtask 1 |   0:10 |&#xA;|   0:05 | DONE Task 2        |   0:10 |&#xA;#+END&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-12-13T06:58:59.787" Title="Show effort and *all* clocked time for completed tasks within the last week" Tags="|org-mode|org-clock-table|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29256" PostTypeId="1" AcceptedAnswerId="29947" CreationDate="2016-12-13T07:16:19.707" Score="5" ViewCount="843" Body="&lt;p&gt;I have the following code to replace default eldoc display function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eldoc-display-message-momentary (format-string &amp;amp;rest args)&#xA;    &quot;Display eldoc message near point.&quot;&#xA;    (when format-string&#xA;      ;; (pos-tip-show (apply 'format format-string args))&#xA;      (momentary-string-display&#xA;       (apply 'format format-string args)&#xA;       (save-excursion (forward-line) (point))&#xA;       )&#xA;      ))&#xA;&#xA;(setq eldoc-message-function #'my-eldoc-display-message-momentary)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it does not work smoothly.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it display slowly&lt;/li&gt;&#xA;&lt;li&gt;the exit-char for &lt;code&gt;momentary-string-display&lt;/code&gt; should be excepted in most&#xA;programming code inputting (not SPC, not [a-zA-Z], not [*,-+=!] etc)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope someone can improve it.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2021-11-10T04:21:52.570" Title="display eldoc help info behind point" Tags="|overlays|doc-strings|eldoc|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29258" PostTypeId="1" CreationDate="2016-12-13T08:06:54.703" Score="0" ViewCount="158" Body="&lt;p&gt;recently, some strange behaviour popped up when editing c/c++ files in emacs: Whenever I want to write a comment, the first &lt;code&gt;/&lt;/code&gt; I enter will open a buffer of type &lt;code&gt;*tramp/spc C*&lt;/code&gt; with error message&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ssh: could not resolve hostname c: Name or service not known&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My research has brought me as far as finding out that this is related to tramp-mode, something I never used or even knew that it exists. So, my question is: How can I get rid of this behaviour?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using emacs24, installed from the Ubuntu 16.04 repos, if that matters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any advice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 16/12/16&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this most have something to do with my &lt;code&gt;.emacs&lt;/code&gt; as the buffer is not popping up when starting with &lt;code&gt;emacs -q&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Active modes in my editing buffer are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abbrev Auto-Complete Auto-Composition Auto-Compression Auto-Encryption Blink-Cursor Electric-Indent File-Name-Shadow Font-Lock Global-Auto-Complete Global-Font-Lock Line-Number Menu-Bar Mouse-Wheel Tool-Bar Tooltip Transient-Mark&lt;/p&gt;&#xA;" OwnerUserId="14233" LastEditorUserId="14233" LastEditDate="2016-12-16T11:13:11.950" LastActivityDate="2023-12-11T14:03:30.413" Title="tramp-mode popping up while editing c/c++ files" Tags="|tramp|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29259" PostTypeId="1" AcceptedAnswerId="29264" CreationDate="2016-12-13T10:51:06.453" Score="1" ViewCount="314" Body="&lt;p&gt;Usually when I write Lisp code (in an Emacs-Lisp mode buffer), I can press &lt;code&gt;TAB&lt;/code&gt; (bound to &lt;code&gt;indent-for-tab-command&lt;/code&gt;) to indent code properly. However, if I write a &lt;code&gt;defun&lt;/code&gt; with a docstring (longer than one line) that also contains a left parenthesis (in the first column), &lt;code&gt;TAB&lt;/code&gt; stops working for the given &lt;code&gt;defun&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  &quot;Hello&#xA;(ok) xxx.&quot;&#xA;&#xA;nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I put cursor on &lt;code&gt;n&lt;/code&gt; in &lt;code&gt;nil&lt;/code&gt; and press &lt;code&gt;TAB&lt;/code&gt; I would expect &lt;code&gt;nil&lt;/code&gt; to be indented 2 places, but it does not work ( unless I remove the left parenthesis &lt;code&gt;(&lt;/code&gt; from the first column on the second line of the docstring).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs 25.1 on Ubuntu 16.04.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="105" LastEditDate="2016-12-13T21:05:19.170" LastActivityDate="2016-12-14T10:44:58.470" Title="Emacs-Lisp mode indentation problem when doc string contains left parenthesis in first column" Tags="|indentation|emacs-lisp-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29260" PostTypeId="2" ParentId="29242" CreationDate="2016-12-13T12:23:21.477" Score="4" Body="&lt;p&gt;I finally found a way to do this, using a macro provided by &lt;a href=&quot;https://github.com/fniessen/org-macros/blob/master/org-macros.setup&quot; rel=&quot;nofollow noreferrer&quot;&gt;fniessen&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: if-latex-else (eval (if (org-export-derived-backend-p org-export-current-backend 'latex) &quot;$1&quot; &quot;$2&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If more/other export-backends than LaTeX and HTML are used, a condition statement can be used instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO: if-latex-html-else (eval (cond ((org-export-derived-backend-p org-export-current-backend 'latex) &quot;$1&quot;) ((org-export-derived-backend-p org-export-current-backend 'html) &quot;$2&quot;) (t &quot;$3&quot;) ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage would be something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{{{if-latex-html-else([[file:./figure.pdf]], [[file:./figure.pdf][file:./figure.png]], /Figure *figure.pdf* is supposed to be here/)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not as short as a simple switch, but substantially better than providing native LaTeX/HTML/whatever code for every figure that is to be included.&lt;/p&gt;&#xA;" OwnerUserId="14220" LastEditorUserId="14920" LastEditDate="2019-04-12T14:06:47.200" LastActivityDate="2019-04-12T14:06:47.200" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29262" PostTypeId="1" CreationDate="2016-12-13T15:51:17.440" Score="5" ViewCount="729" Body="&lt;p&gt;For several years, I've been happily using &lt;a href=&quot;https://github.com/magnars/multiple-cursors.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;multiple-cursors&lt;/code&gt;&lt;/a&gt; with &lt;a href=&quot;https://github.com/zk-phi/phi-search&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;phi-search&lt;/code&gt;&lt;/a&gt; to run interactive searches with several cursors at once with Emacs 23. I would create my multiple cursors, &lt;em&gt;then&lt;/em&gt; run &lt;code&gt;phi-search&lt;/code&gt; as needed to navigate, and edit when I arrived at the point I wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My configuration looked like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'multiple-cursors)&#xA;(require 'phi-search)&#xA;(define-key mc/keymap (kbd &quot;C-s&quot;) 'phi-search)&#xA;(define-key mc/keymap (kbd &quot;C-r&quot;) 'phi-search-backward)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in Emacs 24, &lt;code&gt;phi-search&lt;/code&gt; with &lt;code&gt;multiple-cursors&lt;/code&gt; active will only search for a single cursor, and leave the others unchanged. Is there any way to get &lt;code&gt;isearch&lt;/code&gt; like navigation when there are multiple cursors on the screen, assuming I'm using a recent Emacs?&lt;/p&gt;&#xA;" OwnerUserId="5370" LastEditorUserId="253" LastEditDate="2016-12-13T16:30:58.667" LastActivityDate="2017-10-06T06:04:24.607" Title="multiple-cursors + isearch (or phi-search) with Emacs 24+?" Tags="|isearch|multiple-cursors|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29263" PostTypeId="1" CreationDate="2016-12-13T17:00:49.153" Score="2" ViewCount="157" Body="&lt;p&gt;I have this error when I start emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Searching for program, no such file or directory, git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My Git is inside the VM in &lt;code&gt;/usr/bin/git&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I point emacs to it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;tramp&lt;/code&gt; and &lt;code&gt;plink&lt;/code&gt; to communicate the VM and emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried leaving in the &lt;code&gt;.emacs&lt;/code&gt; file &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;/plink:asti@192.168.33.10:/usr/bin/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it didn't help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried to install Git into windows but then when I visit Git repositories in the VM, Git from windows doesn't have access to the remote FS. Specifically, I press &lt;code&gt;M-x magit&lt;/code&gt;, and emacs says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Git repository:&amp;lt;path to where I am&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I press &lt;code&gt;enter&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Create repository in /plink:asti@192.168.33.10:&amp;lt;path to where I am&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whether I press Y or N, it doesn't help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any suggestions? How do I configure Magit to use the git binary on the remote machine?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="8306" LastEditDate="2016-12-13T17:34:18.400" LastActivityDate="2016-12-20T15:41:28.793" Title="VM causing magit not to work" Tags="|magit|tramp|git|exec-path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29264" PostTypeId="2" ParentId="29259" CreationDate="2016-12-13T17:39:46.600" Score="2" Body="&lt;p&gt;TLDR &lt;code&gt;(setq open-paren-in-column-0-is-defun-start nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The docstring for &lt;code&gt;indent-for-tab-command&lt;/code&gt; tells us it calls the function in variable &lt;code&gt;indent-line-function&lt;/code&gt;.  In emacs-lisp mode this is &lt;code&gt;lisp-indent-line&lt;/code&gt;, defined in &lt;code&gt;lisp-mode.el&lt;/code&gt;.  We can see in the source code that it calls &lt;code&gt;calculate-lisp-indent&lt;/code&gt;.  &lt;code&gt;M-x trace&lt;/code&gt;ing these two functions, both with and without the offending &lt;code&gt;(&lt;/code&gt; at first col and looking at &lt;code&gt;calculate-lisp-indent&lt;/code&gt; source code, I saw the call to &lt;code&gt;beginning-of-defun&lt;/code&gt;.  Tried with with &lt;code&gt;M-: (beginning-of-defun)&lt;/code&gt; w/ and w/o the &lt;code&gt;(&lt;/code&gt; in first col showed this was relevant.  Then the docstring says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;beginning-of-defun is an interactive compiled Lisp function in&#xA;  `lisp.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When `open-paren-in-column-0-is-defun-start' is non-nil, a defun&#xA;  is assumed to start where there is a char with open-parenthesis&#xA;  syntax at the beginning of a line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I suspect &lt;code&gt;beginning-of-defun&lt;/code&gt; to at least be slower then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: as found at by @Häkon Hægland this is actually discussed in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Left-Margin-Paren.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Chapter 26.2.1 : Left Margin Convention&lt;/a&gt; of the Emacs manual.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2016-12-14T10:44:58.470" LastActivityDate="2016-12-14T10:44:58.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29265" PostTypeId="2" ParentId="29263" CreationDate="2016-12-13T17:44:51.550" Score="0" Body="&lt;p&gt;The variable &lt;code&gt;magit-git-executable&lt;/code&gt; can be customized. Its documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;magit-git-executable is a variable defined in ‘magit-git.el’. Its&#xA;  value is &quot;git&quot;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation: The Git executable used by Magit.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, you should be able to set it to something like &lt;code&gt;asti@192.168.33.10/usr/bin/git&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq magit-git-executable &quot;asti@192.168.33.10/usr/bin/git&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't have a VM handy to test this with, but that should do it. You might run into problems where Emacs passes fully-qualified paths to git, but that might cause problems with git.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-12-13T17:44:51.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29266" PostTypeId="1" AcceptedAnswerId="29408" CreationDate="2016-12-13T19:11:54.987" Score="8" ViewCount="1952" Body="&lt;p&gt;The key combination is used in Emacs to mark from the point to the end of the line (navigation with shift selection), but a box is overriding that making it unusable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been working in another station with Fedora 24, and the problem doesn't show, so it seems to be derived from Fedora 25 (the version of Emacs is the same in both stations).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a sample of the box (right after the box appears it has the @ symbol):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/slENC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/slENC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another sample, once the box is showing, if I type anything:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/2WAvl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2WAvl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alternatively, once the box is showing, if I do ctrl+x then I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8FKbb.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8FKbb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In order to solve the problem, it is needed to know what the box is, and I think I prove that right, because unsuccessfully spent many hours &quot;googling&quot; for something I don't know how to name or describe, the GUI doesn't show a gloss, apologies for my ignorance.&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2018-06-22T17:00:16.207" LastActivityDate="2018-06-22T17:08:48.557" Title="Ctrl+Shift+e key conflict in Fedora" Tags="|key-bindings|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="29267" PostTypeId="1" CreationDate="2016-12-13T20:30:46.370" Score="3" ViewCount="446" Body="&lt;p&gt;Fairly new to emacs, seemed super awesome for writing a lot of different styles.  Got it working just fine on my desktop using the new bash terminal - 14.04 - on my desktop.&lt;/p&gt;&#xA;&lt;p&gt;Did the exact same setup of emacs on 14.04 on my laptop ( just installing straight from &lt;code&gt;sudo apt-get install emacs&lt;/code&gt; ), when I launch the package manager, if I hit any keys, this happens:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/GP2uq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GP2uq.png&quot; alt=&quot;Emacs crash immediately after launching list-packages and hitting an arrow key&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then, if I just use &lt;code&gt;fg&lt;/code&gt; to try to get back into emacs, my terminal basically stops working and this happens when I press any keys:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3L7Kz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3L7Kz.png&quot; alt=&quot;Emacs crash after fg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I googled around for a long time, and saw no similar crashes, and tried to wipe Emacs/reinstall, and the same thing was happening. I even updated linux to see if that would be a cause, and the exact same bug is happening.&lt;/p&gt;&#xA;&lt;p&gt;I am not sure where to start for the reason behind this or how to approach debugging this.  This does also happen with &lt;code&gt;emacs -q&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Any help super appreciated, would love to use the program, I have been using it on my desktop for a week or two to write C and other things, and it seems like a pretty ideal program if I could get it to work on both my laptop and desktop.&lt;/p&gt;&#xA;&lt;p&gt;This will also happen occasionally when I just enter &lt;code&gt;emacs&lt;/code&gt; or &lt;code&gt;emacs -q&lt;/code&gt; without loading up a file and when I hit any key, the same crash will occur and exhibit the same behavior.  It will always do the exact same thing in list-packages&lt;/p&gt;&#xA;" OwnerUserId="14240" LastEditorUserId="14825" LastEditDate="2021-04-04T21:26:17.343" LastActivityDate="2023-12-21T08:00:35.070" Title="Fresh install 24.5 on Windows 10 bash shell Linux 16.04 crashing on package manager" Tags="|microsoft-windows|package-repositories|crash|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="29268" PostTypeId="1" AcceptedAnswerId="29269" CreationDate="2016-12-13T21:24:14.740" Score="7" ViewCount="645" Body="&lt;p&gt;I would like to use Org-mode as a local wiki, and I have just discovered how to link Org-mode files (Cf. &lt;a href=&quot;http://orgmode.org/manual/External-links.html#External-links&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/External-links.html#External-links&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'd like to link a non-existing Org-mode and when running some command on the link of clicking it, opening it that new Org-mode file in a buffer – similar to creating a new wiki page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to achieve this?  Is there some built-in method in Org-mode?&lt;/p&gt;&#xA;" OwnerUserId="724" LastActivityDate="2022-04-03T12:58:38.773" Title="How to link to a non-existing Org-mode file and then create it?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29269" PostTypeId="2" ParentId="29268" CreationDate="2016-12-13T22:08:43.833" Score="9" Body="&lt;p&gt;Just do it? Create a link, e.g.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[[file:./newfile.org][newfile]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Click on it(*) and emacs creates a new buffer. Then, e.g.,&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to save it.&lt;/p&gt;&#xA;&lt;p&gt;Being emacs, we probably may have some automatic saving solution, but I do not immediately know how.&lt;/p&gt;&#xA;&lt;p&gt;(*) EDIT: or move the cursor over the link and hit RET (return)&lt;/p&gt;&#xA;" OwnerUserId="2637" LastEditorUserId="2637" LastEditDate="2022-04-03T12:58:38.773" LastActivityDate="2022-04-03T12:58:38.773" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="29272" PostTypeId="2" ParentId="29214" CreationDate="2016-12-14T03:59:53.090" Score="2" Body="&lt;p&gt;Another route is to tangle, and compile, upon saving the file. I do this and then the &lt;code&gt;init.el&lt;/code&gt; loads that compiled file. Fast to load, but slower to save.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;~/.emacs.d/init/init-org.org&lt;/code&gt; contains the usual Org structured file with headings and &lt;code&gt;#+BEGIN_SRC emacs-lisp&lt;/code&gt; as described elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define this hook to detect that this file is being saved and tangle and byte-compile after save:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/tangle-dotfiles ()&#xA;   &quot;If the current file is this file, the code blocks are tangled&quot;&#xA;   (when (equal (buffer-file-name) (expand-file-name &quot;~/.emacs.d/init/init-org.org&quot;))&#xA;     (org-babel-tangle nil &quot;~/.emacs.d/init/init-org.el&quot;)&#xA;     (byte-compile-file &quot;~/.emacs.d/init/init-org.el&quot;)))&#xA;&#xA;(add-hook 'after-save-hook #'my/tangle-dotfiles)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;~/.emacs.d/init/init.el&lt;/code&gt; contains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;(load-file &quot;~/.emacs.d/init/init-org.elc&quot;)&#xA;&#xA;(custom-set-variables...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;followed by whatever else Emacs wants to put in there.&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2016-12-15T02:58:09.913" LastActivityDate="2016-12-15T02:58:09.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29273" PostTypeId="1" CreationDate="2016-12-14T05:43:02.813" Score="0" ViewCount="35" Body="&lt;p&gt;How do &lt;em&gt;you&lt;/em&gt; catch the lisp programmer's error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;I typed &lt;code&gt;let&lt;/code&gt;, but I really meant &lt;code&gt;let*&lt;/code&gt; and wasted five to ten seconds for the &lt;strong&gt;nth&lt;/strong&gt; time today!&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I make this mistake all the time.  Usually in a hurry or not anticipating the dependence of symbols I'm declaring I'll write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((foo-bar 42)&#xA;      (baz-bat (* foo-bar 2))&#xA;  (message &quot;I bet you forgot something!&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Resulting in the irritation in realizing that I miskeyed &lt;code&gt;let*&lt;/code&gt; &lt;em&gt;yet again&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lisp error: (void-variable foo-bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2016-12-14T16:01:48.803" LastActivityDate="2016-12-15T08:28:10.653" Title="Flagging or auto-correcting self-referential 'let' expressions" Tags="|let-binding|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29274" PostTypeId="2" ParentId="29055" CreationDate="2016-12-14T06:11:53.483" Score="4" Body="&lt;p&gt;Use &lt;code&gt;org-store-link&lt;/code&gt; to store the position of your current emacs buffer file and in your org file &lt;code&gt;org-insert-link&lt;/code&gt; to insert the stored link. This prompts you with a selection of links and a query for the description to insert.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2016-12-14T06:11:53.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29275" PostTypeId="1" CreationDate="2016-12-14T06:28:38.897" Score="1" ViewCount="1175" Body="&lt;p&gt;I am using web-mode for javascript files that contain jsx:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.html?\\'&quot; . web-mode))&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.js[x]?$&quot; . web-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to enable go to symbol with web-mode?&lt;/p&gt;&#xA;" OwnerUserId="13577" LastActivityDate="2018-09-25T00:09:51.680" Title="go to symbol in javascript with web-mode" Tags="|web-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29277" PostTypeId="1" CreationDate="2016-12-14T10:01:27.087" Score="5" ViewCount="126" Body="&lt;p&gt;I'm wondering how to access the &lt;code&gt;:file&lt;/code&gt; header argument passed to a src block, from inside the src block itself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering specifically for &lt;code&gt;python&lt;/code&gt;, and in this case &lt;code&gt;ipython&lt;/code&gt; with &lt;code&gt;%matplotlib inline&lt;/code&gt; as the example below (here I use the &lt;code&gt;ob-ipython&lt;/code&gt; library)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src ipython :session :file /tmp/py87133eo.png :exports results&#xA;%matplotlib inline&#xA;import matplotlib.pyplot as plt&#xA;import numpy as np&#xA;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="427" LastActivityDate="2017-11-09T19:43:48.063" Title="How can I access the :file src header argument inside the src block" Tags="|python|images|ipython|header-line|inline-image|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29278" PostTypeId="2" ParentId="19339" CreationDate="2016-12-14T10:29:51.637" Score="3" Body="&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; The &lt;a href=&quot;https://stackoverflow.com/questions/9656311/conflict-resolution-with-emacs-ediff-how-can-i-take-the-changes-of-both-version&quot;&gt;duplicate Q&amp;amp;A on StackOverflow&lt;/a&gt; has answers to this question (as pointed out by Tianxiang Xiong in the comments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My answer below is no use, as you evidentially can't get the desired result that way.  I'm only not deleting it because the information it &lt;em&gt;does&lt;/em&gt; give is somewhat relevant, and might still prove interesting information to someone.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Personally I do just edit the merge buffer directly, but you can teach Emacs what to do if you have a standard requirement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;+&lt;/kbd&gt; calls &lt;code&gt;ediff-combine-diffs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Combine Nth diff regions of buffers A and B and place the combination in C.&#xA;  N is a prefix argument.  If nil, combine the current difference regions.&#xA;  Combining is done according to the specifications in variable&#xA;  &lt;code&gt;ediff-combination-pattern&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Pattern to be used for combining difference regions in buffers A and B.&#xA;  The value must be a list of the form&#xA;  &lt;code&gt;(STRING1 bufspec1  STRING2 bufspec2 STRING3 bufspec3 STRING4)&lt;/code&gt;&#xA;  where bufspec is the symbol A, B, or Ancestor. For instance, if the value is&#xA;  &lt;code&gt;'(STRING1 A  STRING2 Ancestor STRING3 B STRING4)&lt;/code&gt; then the&#xA;  combined text will look like this:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;STRING1&lt;br&gt;&#xA;  diff region from variant A&lt;br&gt;&#xA;  STRING2&lt;br&gt;&#xA;  diff region from the ancestor&lt;br&gt;&#xA;  STRING3&lt;br&gt;&#xA;  diff region from variant B&lt;br&gt;&#xA;  STRING4  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that when you think it's doing nothing, it's actually combining the variants using the normal conflict markers. i.e. If you had already selected A or B, then by default &lt;kbd&gt;+&lt;/kbd&gt; is a way to restore the original conflict.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-12-14T22:45:17.200" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29279" PostTypeId="1" CreationDate="2016-12-14T11:05:54.457" Score="1" ViewCount="614" Body="&lt;p&gt;I’ve had some issues with Spacemacs since upgrading. I don’t know if these are genuine bugs or if it’s in my configuration. I’m using Windows 7 and my version of emacs 25.0.92.1&#xA;1. I get the following warnings on start up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Unknown layer unimpaired declared in dotfile.&#xA;- tern binary not found!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[&lt;strong&gt;edit&lt;/strong&gt;: To fix turn follow these instructions - &lt;a href=&quot;https://simpletutorials.com/c/2784/How+to+setup+JavaScript+auto-complete+in+Spacemacs+on+Windows]&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://simpletutorials.com/c/2784/How+to+setup+JavaScript+auto-complete+in+Spacemacs+on+Windows]&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Space Space gives the message: &lt;code&gt;SPC SPC undefined&lt;/code&gt;&#xA;I thought it had changed from &lt;code&gt;evil-avy-goto-word&lt;/code&gt; to &lt;code&gt;M-x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;[&lt;strong&gt;edit&lt;/strong&gt;: My .spacemacs was at fault. I was using a version pre version 2. Reinstalling fixed this]&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;When using a search engine I added (SPC a / Search engine select) I get an error: &lt;code&gt;wrong type argument: commandp, engine/search-mySearch&lt;/code&gt;, though this worked before the upgrade.&#xA;This is how my search is configured -&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;Search Engines&#xA;(push '(mySearch&#xA;      :name &quot;mySearch&quot;&#xA;      :url &quot;http://mySearch/%s&quot;)&#xA;      search-engine-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Are these genuine bugs or is there something I need to correct?&lt;/p&gt;&#xA;" OwnerUserId="9354" LastEditorUserId="9354" LastEditDate="2016-12-22T23:58:28.720" LastActivityDate="2016-12-22T23:58:28.720" Title="Spacemacs issues since upgrading to v.0.2.00.5" Tags="|spacemacs|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29280" PostTypeId="2" ParentId="29275" CreationDate="2016-12-14T11:49:44.623" Score="2" Body="&lt;p&gt;I submit critical patches to both web-mode and js2-mode. Currently as a front end architect, I'm developing a big ReactJS project from the scratch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simple answer is: helm-etags+ctags or counsel-etags(based on ivy)+ctags&lt;/p&gt;&#xA;&#xA;&lt;p&gt;web-mode is good for handling ReactJS files (JSX). Since ctags uses only regular expression, it can work seamlessly with web-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another solution is rjsx-mode (&lt;a href=&quot;https://github.com/felipeochoa/rjsx-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/felipeochoa/rjsx-mode&lt;/a&gt;), it inherits from js2-mode and can handle mixed html/javascript perfectly. But certain js2 commands like &lt;code&gt;js2-jump-to-definition&lt;/code&gt; won't work when you try to jump from html tags inside render() method, you got &lt;code&gt;js2-name-node-name accessing a non-js2-name-node&lt;/code&gt; error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One advantage of use rjsx-mode is you  could jump to the symbol using js2-mode's imenu commands, it works out of box. Here is the screenshot of my imenu in a React component,&#xA;&lt;a href=&quot;https://i.stack.imgur.com/4XWeH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4XWeH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whatever major mode you use, you still need ctags and helm-etags (most people use helm, but some guy prefer ivy). For example, now postcss,es6 are popular in ReactJS developers, if a css class name is embedded inside a es6 template string, ctags is the only solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my ~/.ctags:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--exclude=*.hg*&#xA;--exclude=*.cvs*&#xA;--exclude=*.svn*&#xA;--exclude=*.git*&#xA;--exclude=*compiled*&#xA;--exclude=*public_html*&#xA;--exclude=*.idea*&#xA;--exclude=*bower_components*&#xA;--exclude=*images*&#xA;--exclude=*.DS_Store*&#xA;--exclude=*log*&#xA;--exclude=*target*&#xA;--exclude=*deployment*&#xA;--exclude=*.war&#xA;--exclude=*.jar&#xA;--exclude=*.class&#xA;--exclude=*flymake*&#xA;--exclude=*.min.js&#xA;--exclude=*.min.css&#xA;--exclude=*.pack.js&#xA;--exclude=*.log&#xA;--exclude=*vender*&#xA;--exclude=*.sql&#xA;--exclude=*.sass&#xA;--exclude=*.ftl&#xA;--exclude=tags&#xA;--exclude=TAGS&#xA;--exclude=GTAGS&#xA;--exclude=GPATH&#xA;--exclude=*node_modules*&#xA;--exclude=GRTAGS&#xA;--exclude=*doc*&#xA;--exclude=*tmp*&#xA;--exclude=.#*&#xA;--tag-relative=yes&#xA;--recurse=yes&#xA;--c-kinds=+defgpstux&#xA;&#xA;--langmap=html:.htm.html.erb.cmp.page.component&#xA;--regex-html=/[ \t]+ng-(controller|click|change|show|if|blur|focus|disabled|repeat)[ \t]*=[ \t]*['&quot;][^a-zA-Z0-9$]*([a-zA-Z0-9$]{4,})/\2/o,object/&#xA;&#xA;--langdef=js&#xA;--langmap=js:.js.ts&#xA;--regex-js=/\.controller[ \t]*\([ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,controller/&#xA;--regex-js=/\.controllerAs[ \t]*:[ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,controller/&#xA;--regex-js=/\.filter[ \t]*\([ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,filter/&#xA;--regex-js=/\.state[ \t]*\([ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,state/&#xA;--regex-js=/^[ \t]*state:[ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,state/&#xA;--regex-js=/\.factory[ \t]*\([ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,factory/&#xA;--regex-js=/\.constant[ \t]*\([ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,constant/&#xA;--regex-js=/\.service[ \t]*\([ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,service/&#xA;--regex-js=/\.directive[ \t]*\([ \t]*['&quot;]([A-Za-z0-9_$.]+)['&quot;][ \t]*,/\1/,directive/&#xA;--regex-js=/.*[.][\s]*module\(['&quot;]([a-zA-Z0-9_.-]+)['&quot;], *\[([ ,&quot;'a-zA-Z0-9_.-]+)* *\]\)/\1/m,module/&#xA;--regex-js=/[.](when\(['&quot;][a-zA-Z0-9_\/]+['&quot;])/\1/r,ngRoute/&#xA;--regex-js=/function[ \t]+([A-Za-z0-9_$]+)[ \t]*\([^)]*\)/\1/,function/&#xA;--regex-js=/(,|^|\.)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*[:=][ \t]*function[ \t]*\(/\2/,function/&#xA;--regex-js=/^[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*\([^a-zA-Z0-9, ]*\) *\{ *$/\1/,function/&#xA;--regex-js=/^[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*=[ \t]*\(?[a-zA-Z0-9, ]*\)?[ \t]*=&amp;gt;[ \t]*\{/\1/,function/&#xA;--regex-js=/^[ \t]*export[ \t]+const[ \t]+([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*=/\1/,function/&#xA;&#xA;--langdef=less&#xA;--langmap=less:.less&#xA;--regex-less=/^[ \t]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/&#xA;--regex-less=/^[ \t]*#([A-Za-z0-9_-]+)/\1/i,id,ids/&#xA;--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/&#xA;--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/&#xA;&#xA;--langdef=css&#xA;--langmap=css:.css&#xA;--regex-css=/^[ \t]*(\$[A-Za-z0-9_-]+)[ \t]*:[ \t]*.*;[ \t]*$/\1/c,class/&#xA;--regex-css=/^,?[ \t]*#?[ \t]*\.([A-Za-z_][A-Za-z0-9_:&quot;' \t\-]+)[ \t]*[\{,]/\1/c,class/&#xA;--regex-css=/^[ \t]*\.([A-Za-z_][A-Za-z0-9_:&quot;' \t\-]+)[ \t]*,/\1/c,class/&#xA;--regex-css=/^,?[ \t]*([A-Za-z_][A-Za-z0-9_:()=&quot;' \t\-]+)[ \t]*[\{,]/\1/t,tags/&#xA;&#xA;--langdef=scss&#xA;--langmap=scss:.scss.sass&#xA;--regex-scss=/^[ \t]*@mixin ([A-Za-z0-9_-]+)/\1/m,mixin,mixins/&#xA;--regex-scss=/^[ \t]*\$([A-Za-z0-9_-]+)/\1/m,variable,variables/&#xA;--regex-scss=/^[ \t]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/&#xA;--regex-scss=/^[ \t]*&amp;amp;\.([A-Za-z0-9_-]+)/\1/c,class,classes/&#xA;--regex-scss=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/&#xA;--regex-scss=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/&#xA;--regex-scss=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This answer just covers the basics. Check my blog &lt;a href=&quot;http://blog.binchen.org/categories/emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blog.binchen.org/categories/emacs.html&lt;/a&gt; and my js setup &lt;a href=&quot;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-javascript.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/emacs.d/blob/master/lisp/init-javascript.el&lt;/a&gt; for advanced skills.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2018-09-25T00:09:51.680" LastActivityDate="2018-09-25T00:09:51.680" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29281" PostTypeId="2" ParentId="14785" CreationDate="2016-12-14T12:42:55.307" Score="2" Body="&lt;p&gt;Just in case someone comes across this question; I was able to do this by essentially turning on tab completion from R as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete-config)&#xA;(ac-config-default)&#xA;(define-key ac-completing-map (kbd &quot;M-h&quot;) 'ac-quick-help)&#xA;;; Get tab completion in R script files&#xA;;; See this page here&#xA;;; https://stat.ethz.ch/pipermail/ess-help/2013-March/008719.html&#xA;;; Make sure that this is after the auto-complete package initialization&#xA;(setq  ess-tab-complete-in-script t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10338" LastActivityDate="2016-12-14T12:42:55.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29282" PostTypeId="1" AcceptedAnswerId="29284" CreationDate="2016-12-14T14:14:11.847" Score="2" ViewCount="76" Body="&lt;p&gt;I'm trying to make a function to read a whole buffer and find lines that match with regexp, I think to read the whole buffer and save to list of strings but I read that it's very inefficient. Whats the better form of do this?&lt;/p&gt;&#xA;" OwnerUserId="13992" LastEditorUserId="105" LastEditDate="2016-12-14T15:09:18.907" LastActivityDate="2016-12-14T16:32:44.523" Title="Better way to find regexp in emacs buffer" Tags="|buffers|regular-expressions|search|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29283" PostTypeId="2" ParentId="29258" CreationDate="2016-12-14T14:33:15.263" Score="0" Body="&lt;p&gt;See this: &lt;a href=&quot;https://stackoverflow.com/questions/778716/how-can-i-make-emacs-start-up-faster&quot;&gt;https://stackoverflow.com/questions/778716/how-can-i-make-emacs-start-up-faster&lt;/a&gt;&#xA;for similar problem(s), you need to solve for hostname, by editing /etc/hostname, and /etc/hostsfile. (see the answer of tsar2512).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another solution (worked for me, on my mac): edit ~/.ssh/config file, replace everything you find out there with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host *&#xA;ControlPath ~/.ssh/master-%r@%h:%p&#xA;ControlMaster auto&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12077" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-14T15:14:39.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29284" PostTypeId="2" ParentId="29282" CreationDate="2016-12-14T14:34:17.757" Score="4" Body="&lt;p&gt;It is really unclear what you want to do, but if you are looking for an &quot;end in itself&quot; interactive use, then you are probably covered by one of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Repeating-Search.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;occur&lt;/code&gt; et al&lt;/a&gt;: e.g., &lt;kbd&gt;M-x occur RET TODO RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is a step in a long processing chain, you should start with the sources for the above commands and ask a separate, more specific question.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2016-12-14T16:32:44.523" LastActivityDate="2016-12-14T16:32:44.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29285" PostTypeId="2" ParentId="29277" CreationDate="2016-12-14T15:16:12.160" Score="1" Body="&lt;p&gt;You could wrap the output with next code and create file and link after block&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: attr_wrap&#xA;#+begin_src sh :session :var file=/tmp/py87133eo.png&#xA;  echo &quot;$data&quot; &amp;gt; /tmp/$file&#xA;  ln -s /tmp/$file /tmp/link&#xA;#+end_src&#xA;&#xA;#+begin_src ipython :session :exports results :post attr_wrap(data=*this*) :results output&#xA;  %matplotlib inline&#xA;  import matplotlib.pyplot as plt&#xA;  import numpy as np&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-12-14T15:16:12.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29286" PostTypeId="1" CreationDate="2016-12-14T15:36:55.873" Score="13" ViewCount="2444" Body="&lt;p&gt;I just started using emacs last week and everything is going well so far. I am using tramp to edit remote files as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f&#xA;/ssh:user@server:/file/to/edit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I login to the server using an ssh key, so no password is needed. Therefore I don't do anything special to start tramp and nothing has been added to my .emacs file, I simply type the above in my local emacs and it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The files im editing are mostly python (ie: plain text *.py files) and for the most part everything works correctly. However when I try to open some files they don't open and the following message is displayed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gzip: stdin: unexpected end of file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to get around this issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: As suggested in the comments I enabled &lt;code&gt;(setq tramp-verbose 6)&lt;/code&gt;. The tramp debug buffer is huge (thousands of lines) so I have tried to pick out the parts that appear to be important or where some sort of error is mentioned, hopefully that will aid in figuring out what is happening:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;16:11:29.124528 tramp-sh-handle-file-local-copy (3) # Encoding remote file `/ssh:myuser@myserver:/path/to/python/file.py' with `(gzip &amp;lt;%s | base64)'...done&#xA;&#xA;&#xA;16:11:29.130875 tramp-sh-handle-file-truename (4) # Finding true name for `/ssh:myuser@myserver:/path/to/python/file/'&#xA;&#xA;&#xA;16:11:29.131565 tramp-send-command (6) # \readlink --canonicalize-missing /path/to/python/file/ 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;16:11:29.376133 tramp-wait-for-regexp (6) #&#xA;&#xA;16:11:33.245252 tramp-sh-handle-file-local-copy (3) # Decoding local file `/tmp/tramp.4885Mau.py' with `(lambda (beg end) (base64-decode-region beg end) (let ((coding-system-for-write (quote binary)) (coding-system-for-read (quote binary))) (apply (quote call-process-region) (point-min) (point-max) (car (split-string gzip -d)) t t nil (cdr (split-string gzip -d)))))'...done&#xA;16:11:33.249827 tramp-call-process (6) # `chown 1000:1000 /tmp/tramp.4885Mau.py' nil nil&#xA;16:11:33.252963 tramp-call-process (6) # 0&#xA;16:11:33.255820 tramp-handle-insert-file-contents (3) # Inserting `/ssh:myuser@myserver:/path/to/python/file.py'...done&#xA;&#xA;&#xA;///b47a60d20b86781fc5d02f0fac35ec59#$16:11:34.975322 tramp-send-command-and-check (1) # File error: Couldn't find exit status of `( (test -e /path/to/python/file.py || test -h /path/to/python/file.py) &amp;amp;&amp;amp; \stat -c '((&quot;%N&quot;) %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 &quot;%A&quot; t %ie0 -1)' /path/to/python/file.py || echo nil)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last line appears to be the actual error.&lt;/p&gt;&#xA;" OwnerUserId="14249" LastEditorUserId="14249" LastEditDate="2016-12-17T14:42:51.443" LastActivityDate="2017-06-01T18:43:45.520" Title="Tramp unable to open some files" Tags="|tramp|ssh|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="29287" PostTypeId="1" CreationDate="2016-12-14T16:33:23.400" Score="0" ViewCount="129" Body="&lt;p&gt;I'm confused about some CUA mode implicit behaviour that I got after upgrading Emacs, specifically:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Marking a region automatically copies it, without having to type &lt;code&gt;C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Deleting a region automatically kills it, without having to type &lt;code&gt;C-x&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I find this confusing because I often want to kill a region with &lt;code&gt;C-x&lt;/code&gt;, do a backspace on a second region to delete it and then paste with &lt;code&gt;C-v&lt;/code&gt; to replace with the original region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find however that once I delete the second region, it replaces the first one in the kill ring and I get it pasted right back again after &lt;code&gt;C-v&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Here's an example of what is currently happening. Suppose I have a buffer with these two lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This number is 1&#xA;This number is 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to swap the characters 1 and 2 between the two lines. I try to take these steps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put a region around '1' and cut it with &lt;code&gt;C-x&lt;/code&gt;. The character duly disappears:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This number is &#xA;This number is 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put a region around '2' and type backspace to delete:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This number is&#xA;This number is&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put the cursor at the end of the second line and type &lt;code&gt;C-v&lt;/code&gt; in the hope that it will paste the '1' character. What I get instead is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This number is&#xA;This number is 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, deleting the region around '2' implicitly put it in the kill ring, as if I had typed &lt;code&gt;C-x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar thing happens just by setting the region, which CUA is implicitly copying as if I had typed &lt;code&gt;C-c&lt;/code&gt;. If I then move the cursor somewhere else and type &lt;code&gt;C-v&lt;/code&gt;, I get the region pasted back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this normal behaviour? I would prefer to do the cutting and copying explicitly, without CUA doing it behind my back.&lt;/p&gt;&#xA;" OwnerUserId="14250" LastEditorUserId="253" LastEditDate="2016-12-14T20:10:36.810" LastActivityDate="2016-12-15T14:18:19.287" Title="CUA mode is implictly cutting and copying from region" Tags="|cua-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29289" PostTypeId="1" AcceptedAnswerId="29292" CreationDate="2016-12-14T18:15:13.367" Score="3" ViewCount="681" Body="&lt;p&gt;When I start Emacs with &lt;code&gt;emacs -Q --eval '(set-face-attribute (quote default) nil :height 180)&lt;/code&gt;, the font changes for a split-second, but then returns to its default. Same thing if I put the code in my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I deliberately cause an error with &lt;code&gt;emacs -Q --eval '(progn (set-face-attribute (quote default) nil :height 180) (bing))&lt;/code&gt;, the change sticks. But this doesn't work if I put the code in my init file—I guess that whatever mechanism Emacs uses to recover from init-file errors doesn't prevent the font-size-revert code from running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I get Emacs to accept my default font size?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs 25.1.2 (from &lt;a href=&quot;https://launchpad.net/~kelleyk/+archive/ubuntu/emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;kelleyk's PPA&lt;/a&gt;) on Ubuntu 16.10.&lt;/p&gt;&#xA;" OwnerUserId="14253" LastEditorUserId="253" LastEditDate="2016-12-14T18:21:15.020" LastActivityDate="2016-12-14T19:50:34.260" Title="My change to the default font size reverts at startup" Tags="|fonts|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29290" PostTypeId="2" ParentId="28501" CreationDate="2016-12-14T19:31:58.650" Score="2" Body="&lt;p&gt;you may be looking for &lt;a href=&quot;https://github.com/wbolster/evil-colemak-basics&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/wbolster/evil-colemak-basics&lt;/a&gt; which provides basic rebindings that aren't &quot;a bit annoying&quot; but instead an awesome mix of colemak and qwerty that feels very natural for seasoned vim/evil users switching to colemak.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i am the author.)&lt;/p&gt;&#xA;" OwnerUserId="12785" LastActivityDate="2016-12-14T19:31:58.650" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29291" PostTypeId="2" ParentId="19314" CreationDate="2016-12-14T19:39:01.853" Score="0" Body="&lt;p&gt;unfortunately i think this cannot work. evil commands like &lt;code&gt;d&lt;/code&gt; (&lt;code&gt;evil-delete&lt;/code&gt;) manually read a key sequence to obtain a motion, bypassing emacs' normal key maps.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastActivityDate="2016-12-14T19:39:01.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29292" PostTypeId="2" ParentId="29289" CreationDate="2016-12-14T19:50:34.260" Score="2" Body="&lt;p&gt;&#xA;One option is to add your own command-line switch, and deal with it in your init file, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq big-font-p (member &quot;--big-font&quot; command-line-args))&#xA;(setq command-line-args (delete &quot;--big-font&quot; command-line-args))&#xA;(add-to-list 'default-frame-alist&#xA;             (if big-font-p&#xA;                 '(font . &quot;DejaVu Sans Mono-18&quot;) ;; Big font&#xA;               '(font . &quot;DejaVu Sans Mono-12&quot;))) ;; Default font&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, if the option &lt;code&gt;--big-font&lt;/code&gt; is not specified on the command-line, then your default font will be used.&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2016-12-14T19:50:34.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29293" PostTypeId="2" ParentId="28891" CreationDate="2016-12-14T20:48:15.603" Score="1" Body="&lt;p&gt;&lt;code&gt;self-insert-command&lt;/code&gt; is intended for characters that do produce themselves. it seems this is not what you want, since you want the current region (visual selection) to be to be wrapped. try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-operator wrap-with-parens (beg end)&#xA;  (goto-char beg)&#xA;  (insert &quot;(&quot;)&#xA;  (goto-char (1+ end))&#xA;  (insert &quot;)&quot;))&#xA;&#xA;(evil-define-key 'visual global-map&#xA;  (kbd &quot;(&quot;) 'wrap-with-parens)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but imho evil-surround + visual mode is more powerful and flexible: make a visual selection, activate evil-surround, press the paren you want and it will take care of inserting the surrounding pair, optionally with spaces, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the default binding in visual mode is &lt;code&gt;S&lt;/code&gt;, so &lt;code&gt;S(&lt;/code&gt; and &lt;code&gt;S)&lt;/code&gt; will wrap with &lt;code&gt;(...)&lt;/code&gt;. &lt;code&gt;S[&lt;/code&gt; and lots of others will work too.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastActivityDate="2016-12-14T20:48:15.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29294" PostTypeId="2" ParentId="29287" CreationDate="2016-12-14T20:56:49.010" Score="0" Body="&lt;p&gt;I do not see what you report, when starting Emacs using &lt;code&gt;emacs -Q&lt;/code&gt; (no init file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you? If not, then recursively bisect your init file to find out what part of it is interfering. You can comment out a region of text using command &lt;code&gt;comment-region&lt;/code&gt;. Comment out 1/2, then 3/4, 7/8,... until you locate the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A step-by-step recipe to reproduce a problem should include anything you've done to modify the default Emacs behavior, i.e., what you get using only &lt;code&gt;emacs -Q&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-14T20:56:49.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29295" PostTypeId="2" ParentId="29275" CreationDate="2016-12-14T21:04:35.157" Score="2" Body="&lt;p&gt;for javascript I highly recommend js2-mode. Take a look here &lt;a href=&quot;https://elpa.gnu.org/packages/js2-mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://elpa.gnu.org/packages/js2-mode.html&lt;/a&gt; it has function that you are looking for: &lt;code&gt;js2-jump-to-definition&lt;/code&gt; which is by default bound to M-. &lt;/p&gt;&#xA;" OwnerUserId="14258" LastActivityDate="2016-12-14T21:04:35.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29296" PostTypeId="2" ParentId="28744" CreationDate="2016-12-14T21:51:13.710" Score="0" Body="&lt;p&gt;I ended up solving my own problem with help from Marco Wahl by improving the regex a little:&#xA;In org-mode, these to-do keywords must be surrounded by a space on either side. In my case that differentiates them enough from other instances of similar words. This makes it easy to search for them using the emacs regex:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\s-\(NEXTACTION\|WAITING\|term3\|term4\|...\)\s-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, using emacs macros, type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;F3&#xA;C-c / r \s-\(NEXTACTION\|WAITING\|term3\|term4\|...\)\s-&#xA;RET&#xA;F4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the macro can be assigned, inserted, etc. as you like.&lt;/p&gt;&#xA;" OwnerUserId="9315" LastActivityDate="2016-12-14T21:51:13.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29297" PostTypeId="1" CreationDate="2016-12-14T22:27:19.930" Score="1" ViewCount="153" Body="&lt;p&gt;For &lt;a href=&quot;http://people.csail.mit.edu/kaess/apriltags/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this project&lt;/a&gt;, I cannot seem to get &lt;code&gt;M-x gdb&lt;/code&gt; to work in Emacs 25.1 (on Ubuntu 14.04.5 64-bit if it matters - this should be the case for any Ubuntu-based Linux in general I imagine). Steps to reproduce:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-get install subversion cmake libopencv-dev libeigen3-dev libv4l-dev&#xA;cd ~/Downloads/&#xA;svn co https://svn.csail.mit.edu/apriltags&#xA;cd apriltags&#xA;make BUILD_TYPE=Debug&#xA;./build/bin/apriltags_demo # run program to see that it works&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now fire up Emacs and go to the file located in &lt;code&gt;examples/apriltags_demo.cpp&lt;/code&gt; of the downloaded directory. Running &lt;code&gt;M-x gdb&lt;/code&gt; and accepting the default &lt;code&gt;gdb -i=mi main&lt;/code&gt; as the gdb command, I cannot place breakpoints anywhere by mouse clicking in the left fringe of the &lt;code&gt;gdb-many-windows&lt;/code&gt; view - like I can do for any other simple program that I create and compile with &lt;code&gt;g++ -std=c++11 -g main.cpp -o main&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please try to reproduce my steps/explain how to get this to work? Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: using &lt;a href=&quot;https://github.com/realgud/realgud&quot; rel=&quot;nofollow noreferrer&quot;&gt;realgud&lt;/a&gt; works flawlessly - but I want to see why it doesn't work with Emacs' built-in GDB functionality.&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="13661" LastEditDate="2016-12-14T22:57:52.007" LastActivityDate="2016-12-14T22:57:52.007" Title="Getting gdb to work for this project" Tags="|debugging|c++|c|gdb|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29299" PostTypeId="2" ParentId="28497" CreationDate="2016-12-15T03:47:48.403" Score="3" Body="&lt;p&gt;Insert &lt;code&gt;&quot;\n&quot;&lt;/code&gt; where you want the newline. This works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;8rt&quot; &quot;#+ATTR_HTML: :style color:green\n  *lets try it on your computer!*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't think the &lt;code&gt;nil&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt; are necessary.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2016-12-15T03:47:48.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29300" PostTypeId="1" CreationDate="2016-12-15T07:47:38.693" Score="1" ViewCount="993" Body="&lt;p&gt;In a lot of text editors there is a keystroke used to move the selected lines one &quot;tab&quot; to the right, usually 4 whitespace or one &quot;tab&quot; to the left.&#xA;How can I do this in emacs? I have only found automatic indentation like C-M-|&lt;/p&gt;&#xA;" OwnerUserId="13656" LastActivityDate="2016-12-15T07:55:32.530" Title="How to indent the selected line one &quot;tab&quot; forward or backward" Tags="|indentation|tabs|" AnswerCount="1" CommentCount="1" ClosedDate="2016-12-15T16:01:14.897" ContentLicense="CC BY-SA 3.0" />
  <row Id="29301" PostTypeId="2" ParentId="29300" CreationDate="2016-12-15T07:55:32.530" Score="2" Body="&lt;p&gt;There's some commands starting with the name &lt;code&gt;indent-rigidly&lt;/code&gt;, which indents by whitespace. The base command &lt;code&gt;indent-rigidly&lt;/code&gt; is bound to &lt;code&gt;C-x TAB&lt;/code&gt; by default, and lets you use the arrow keys to indent the region (left/right to indent one space, shift + left/right to indent by tab stops).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of &lt;code&gt;indent-rigidly&lt;/code&gt; you might want to use &lt;code&gt;indent-rigidly-left-to-tab-stop&lt;/code&gt; or &lt;code&gt;indent-rigidly-right-to-tab-stop&lt;/code&gt;, but they have no default key bindings.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastActivityDate="2016-12-15T07:55:32.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29302" PostTypeId="2" ParentId="29273" CreationDate="2016-12-15T08:28:10.653" Score="1" Body="&lt;p&gt;I'm aware of &lt;a href=&quot;https://github.com/Fuco1/letcheck&quot; rel=&quot;nofollow noreferrer&quot;&gt;letcheck&lt;/a&gt; for this, but would prefer to have that kind of linting integrated into one of the tools Flycheck is using, ideally the byte-compiler itself.  While one may argue that an unbound variable in a &lt;code&gt;let&lt;/code&gt; that suspiciously looks like one of the &lt;em&gt;previous&lt;/em&gt; bindings could still be resolved from outer scope, I severely doubt this will ever practically matter.  Have you considered handing in a bug for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I just have it ingrained to return to the head of the let expression if I reuse a previous binding and correct it to &lt;code&gt;let*&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-12-15T08:28:10.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29303" PostTypeId="1" CreationDate="2016-12-15T08:41:59.143" Score="1" ViewCount="655" Body="&lt;p&gt;I do not like the standard keybinding to redo so I would like to customise it.&#xA;How can I remap redo to C-S-/?&#xA;I am not able to find any solution in internet.&lt;/p&gt;&#xA;" OwnerUserId="13656" LastActivityDate="2020-01-13T07:15:19.817" Title="Remap redo to C-S-/" Tags="|undo|mapping|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29304" PostTypeId="1" AcceptedAnswerId="29306" CreationDate="2016-12-15T09:36:02.400" Score="4" ViewCount="1951" Body="&lt;p&gt;When using org build subtree navigation functions to move around, I want to show all the content of current one recursively, and hide any other subtrees that having a higher or same level of the current one. How to achieve this ? Thanks !&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2023-11-11T04:17:30.943" Title="How to show all contents of current subtree and fold all the other subtrees?" Tags="|org-mode|outline-mode|outline|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29305" PostTypeId="2" ParentId="29287" CreationDate="2016-12-15T10:24:33.663" Score="1" Body="&lt;p&gt;I found the culprit. I had this customisation in my &lt;code&gt;.emacs&lt;/code&gt; that I had forgotten about:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(select-enable-primary t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't understand how this would interfere with CUA but I removed this customisation without any observable adverse effects so far.&lt;/p&gt;&#xA;" OwnerUserId="14252" LastEditorUserId="253" LastEditDate="2016-12-15T14:18:19.287" LastActivityDate="2016-12-15T14:18:19.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29306" PostTypeId="2" ParentId="29304" CreationDate="2016-12-15T10:56:54.900" Score="4" Body="&lt;p&gt;&lt;em&gt;Edited in response to first comment&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not quite sure if this is what you want, but here's a function that will show the current subtree (and its children) and fold all other headings to their top level:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ess/org-show-just-me (&amp;amp;rest _)&#xA;  &quot;Fold all other trees, then show entire current subtree.&quot;&#xA;  (interactive)&#xA;  (org-overview)&#xA;  (org-reveal)&#xA;  (org-show-subtree))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can add advices for each command you want to use this function together with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'org-forward-heading-same-level :after #'ess/org-show-just-me)&#xA;(advice-add 'org-backward-heading-same-level :after #'ess/org-show-just-me)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another alternative is to use &lt;code&gt;org-narrow-to-subtree&lt;/code&gt; to hide all other content than the current subtree. It is bound to &lt;code&gt;C-x n s&lt;/code&gt; by default. To go back, use &lt;code&gt;widen&lt;/code&gt;, bound to &lt;code&gt;C-x n w&lt;/code&gt;. A great alternative is &lt;a href=&quot;http://endlessparentheses.com/emacs-narrow-or-widen-dwim.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;narrow-or-widen-dwim&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could add &lt;code&gt;widen&lt;/code&gt; followed by &lt;code&gt;org-narrow-to-subtree&lt;/code&gt; to a function and create this as an advice in the same way as the example above.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="9695" LastEditDate="2016-12-15T13:01:29.897" LastActivityDate="2016-12-15T13:01:29.897" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29307" PostTypeId="2" ParentId="29107" CreationDate="2016-12-15T11:07:49.713" Score="0" Body="&lt;p&gt;Into the documentation &amp;quot;Org Mode/Exporting/LaTeX export/LaTeX header and sectioning structure&amp;quot;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;By default, the LaTeX output uses the class article.&lt;/p&gt;&#xA;&lt;p&gt;You can change this globally by setting a different value for &lt;code&gt;org-latex-default-class&lt;/code&gt; or locally by adding an option like &lt;code&gt;#+LATEX_CLASS: myclass&lt;/code&gt; in your file, or with a &lt;code&gt;EXPORT_LATEX_CLASS&lt;/code&gt; property that applies when exporting a region containing only this (sub)tree. The class must be listed in &lt;code&gt;org-latex-classes&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12616" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-15T11:07:49.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29308" PostTypeId="1" CreationDate="2016-12-15T12:01:39.310" Score="0" ViewCount="1743" Body="&lt;p&gt;I switched to emacs as my C++ ide. I am using irony mode, company, rtags, and since all of my projects are using cmake, cmake-ide.&#xA;I cant realy find something online on how the workflow works with cmake-ide? &#xA;How can I compile targets and run the resulting binarys using cmake-ide? &#xA;Currently I am doing this in terminal mode inside emacs, but I hope I can do this using cmake-ide.&lt;/p&gt;&#xA;" OwnerUserId="14263" LastActivityDate="2023-12-14T16:06:50.853" Title="Building targets using cmake-ide" Tags="|c++|ide|irony-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29309" PostTypeId="1" AcceptedAnswerId="29310" CreationDate="2016-12-15T13:00:44.653" Score="0" ViewCount="686" Body="&lt;p&gt;I have a problem with emacs downloading packages and would appreciate some pointers on how this could be tracked/solved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;disclaimers first&lt;/strong&gt;: I'm a complete noob at emacs, so if something looks/sounds stupid, it most likely is, please let me know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note that I'm running this behind a proxy set-up at $work.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to set-up an emacs install to use &lt;a href=&quot;http://ensime.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ENSIME&lt;/a&gt; for Scala development.&#xA;On the getting started page they have a sample &lt;code&gt;init.el&lt;/code&gt; that is causing me problems:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; global variables&#xA;(setq&#xA; inhibit-startup-screen t&#xA; create-lockfiles nil&#xA; make-backup-files nil&#xA; column-number-mode t&#xA; scroll-error-top-bottom t&#xA; show-paren-delay 0.5&#xA; use-package-always-ensure t&#xA; sentence-end-double-space nil)&#xA;&#xA;;; buffer local variables&#xA;(setq-default&#xA; indent-tabs-mode nil&#xA; tab-width 4&#xA; c-basic-offset 4)&#xA;&#xA;;; modes&#xA;(electric-indent-mode 0)&#xA;&#xA;;; global keybindings&#xA;(global-unset-key (kbd &quot;C-z&quot;))&#xA;&#xA;;; the package manager&#xA;(require 'package)&#xA;(setq&#xA; package-archives '((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;                    (&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;)&#xA;                    (&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;)&#xA;                    (&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;))&#xA; package-archive-priorities '((&quot;melpa-stable&quot; . 1)))&#xA;&#xA;(package-initialize)&#xA;(when (not package-archive-contents)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;(require 'use-package)&#xA;&#xA;(use-package ensime&#xA;  :ensure t&#xA;  :pin melpa-stable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When running &lt;code&gt;emacs --debug-init&lt;/code&gt; I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Package `use-package-' is unavailable&quot;)&#xA;signal(error (&quot;Package `use-package-' is unavailable&quot;))&#xA;error(&quot;Package `%s-%s' is unavailable&quot; use-package &quot;&quot;)&#xA;package-compute-transaction(nil ((use-package)))&#xA;package-install(use-package)&#xA;(progn (package-refresh-contents) (package-install (quote use-package)))&#xA;(if (not package-archive-contents) (progn (package-refresh-contents) (package-install ($&#xA;eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/ubuntu/.emacs.d/init.el&quot; nil t)  ; Reading at $&#xA;load-with-code-conversion(&quot;/home/ubuntu/.emacs.d/init.el&quot; &quot;/home/ubuntu/.emacs.d/init.e$&#xA;load(&quot;/home/ubuntu/.emacs.d/init&quot; t t)&#xA;#[0 &quot;^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\3$&#xA;command-line()&#xA;normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I understand from this error is that &lt;code&gt;use-package&lt;/code&gt; is not available/installed. Which is weird.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do: &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading 00debian-vars...done&#xA;Importing package-keyring.gpg...done&#xA;Using a proxy for http...&#xA;Contacting host: elpa.gnu.org:80 [2 times]&#xA;Failed to download `gnu' archive.&#xA;Contacting host: orgmode.org:80 [2 times]&#xA;Failed to download `org' archive.&#xA;Contacting host: melpa.org:80 [2 times]&#xA;Failed to download `melpa' archive.&#xA;Contacting host: stable.melpa.org:80 [2 times]&#xA;Failed to download `melpa-stable' archive.&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems that emacs understands that it is behind a proxy, but for some reason it fails the download.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I go about finding out the root cause of this and fixing it?&lt;/p&gt;&#xA;" OwnerUserId="14266" LastActivityDate="2017-03-15T17:03:21.420" Title="How to debug emacs connection problems" Tags="|init-file|proxy|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29310" PostTypeId="2" ParentId="29309" CreationDate="2016-12-15T14:12:09.757" Score="0" Body="&lt;p&gt;Never mind, it seems that I've messed up my proxy config on the machine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$http_proxy=proxy.company.lan:1234&#xA;$https_proxy=proxy.company.lan:1234&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but didn't have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$no_proxy=company.lan&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems this was causing emacs to fail.&lt;/p&gt;&#xA;" OwnerUserId="14266" LastActivityDate="2016-12-15T14:12:09.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29311" PostTypeId="1" CreationDate="2016-12-15T14:51:55.783" Score="3" ViewCount="195" Body="&lt;p&gt;Say we have a org buffer with content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* top-level heading&#xA;some text $          # $ denote cursor&#xA;** heading 3&#xA;** heading 2&#xA;** heading 1&#xA;** heading 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now evaluate &lt;code&gt;(save-excursion (org-sort-entries nil ?a))&lt;/code&gt;.  The cursor goes to the beginning of &lt;code&gt;top-level heading&lt;/code&gt;, rather than stays put at &lt;code&gt;$&lt;/code&gt; as I would expect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why does &lt;code&gt;save-excursion&lt;/code&gt; does not work under this situation?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updated: Even with &lt;code&gt;(save-excursion (save-restriction (org-sort-entries nil ?a)))&lt;/code&gt;, the cursor still moves.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="253" LastEditDate="2016-12-15T16:58:25.813" LastActivityDate="2016-12-15T21:53:01.367" Title="save-excursion does not work with `org-sort-entries`" Tags="|org-mode|point|save-excursion|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29312" PostTypeId="1" CreationDate="2016-12-15T16:34:07.203" Score="1" ViewCount="42" Body="&lt;p&gt;I have org-mode files in a git repo and don't want to pollute it with with build files. &lt;a href=&quot;https://stackoverflow.com/questions/41130246/conditional-gitignore/41135495#41135495&quot;&gt;I probably can't tell git to ignore the built files.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I tell Emacs to build the files (see linked question for a list) to a specific folder? I'd prefer the built files to be stored in a common location for all org-mode files, not matter where they are on my system because I don't intend to keep them, but if I can specify that they are put into a certain folder relative to the location of the org-mode document, that's fine, too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried building the file via pandoc because you can run bash scripts from Emacs and in a bash script I could (if I could pass the location of the current file as a parameter) just call pandoc and tell it to store the resulting PDF (pandoc doesn't even create the other files) in the folder I want them to be stored in. However, I wasn't able to make the documents look like the ones org-mode builds.&lt;/p&gt;&#xA;" OwnerUserId="14203" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2016-12-15T16:34:07.203" Title="Build org-mode documents to specific folder" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="2" ClosedDate="2016-12-17T17:19:43.760" ContentLicense="CC BY-SA 3.0" />
  <row Id="29313" PostTypeId="2" ParentId="27911" CreationDate="2016-12-15T16:39:11.670" Score="1" Body="&lt;p&gt;I found only 1 way to refresh the content of the ELPA directory (not only the compiled &lt;code&gt;.elc&lt;/code&gt; files in each package folder) without having to manually work on it in &lt;code&gt;M-x package-list-packages&lt;/code&gt;.&#xA;There is a bootstrapping method used by John Wiegley in his use-package:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; https://github.com/jwiegley/use-package&#xA;(eval-when-compile&#xA;  (require 'use-package))&#xA;(require 'package)&#xA;(setq package-enable-at-startup nil)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(package-initialize)&#xA;&#xA;;; Bootstrap `use-package'&#xA;(unless (package-installed-p 'use-package)&#xA;  (package-refresh-contents)&#xA;  (package-install 'use-package))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One can bootstrap all the packages in his setup on &lt;code&gt;.emacs&lt;/code&gt; however the work required a list of these packages prepared beforehand and writing the bootstrapping routine for every packages in the &lt;code&gt;.emacs&lt;/code&gt; file - which can be more work than just downloading these packages again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this bootstrapping approach is, when it is correctly setup, one can remove all the content of the ELPA folder and the packages will be downloaded again automatically during startup. This is also very convenient for migration.&lt;/p&gt;&#xA;" OwnerUserId="6942" LastEditorUserId="675" LastEditDate="2016-12-15T19:34:01.167" LastActivityDate="2016-12-15T19:34:01.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29314" PostTypeId="2" ParentId="29311" CreationDate="2016-12-15T16:55:43.943" Score="4" Body="&lt;p&gt;This post provides a work-around, but not an answer to &quot;why does&#xA;&lt;code&gt;save-excursion&lt;/code&gt; not work here?&quot;  The problem is interesting.  I find &lt;code&gt;org&lt;/code&gt; internals to be baroque, and a skim through the source code for&#xA;&lt;code&gt;org-sort-entries&lt;/code&gt; seems to conform with that view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless you're deeply interested in the internals, you can use the following&#xA;work-around to save and restore point after calling &lt;code&gt;org-sort-entries&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((home (point)))&#xA;  (org-sort-entries nil ?a)&#xA;  (goto-char home))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tested it only on your example, so YMMV in more complicated&#xA;cases.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-12-15T17:04:20.573" LastActivityDate="2016-12-15T17:04:20.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29315" PostTypeId="2" ParentId="28888" CreationDate="2016-12-15T17:02:09.023" Score="3" Body="&lt;p&gt;It seems Org-mode's archiving function is not popular. Here's what I found:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using toggle ARCHIVE tag / to ARCHIVE sibling C-c C-x a/A, the content of completed tasks stay in work.org.&#xA;It seems to me it does not offer significantly performance improvement over a large Org file - if the chunk you have to archive is really large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can search archived contents on those separate files (in my case .org_archive files) by including them by the variable &quot;org-agenda-text-search-extra-files&quot; so that they are included in search using &quot;C-c a s&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (setq org-agenda-text-search-extra-files&#xA;          (append&#xA;           (sa-find-org-file-recursively &quot;~/Dropbox/Org/&quot; &quot;.org_archive&quot;) ;agenda-archives&#xA;           (sa-find-org-file-recursively &quot;~/Dropbox/Org/journal/&quot; &quot;.txt&quot;) ;journals in .txt&#xA;     ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function &quot;sa-find-org-file-recursively&quot; that recursively look for files in a folder and its sub-folder can be found here:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/11384516/how-to-make-all-org-files-under-a-folder-added-in-agenda-list-automatically&quot;&gt;https://stackoverflow.com/questions/11384516/how-to-make-all-org-files-under-a-folder-added-in-agenda-list-automatically&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One caveat is that only the &quot;text search&quot; searches only the Org header text of various levels, but nothing in its body text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Including the :archive: tag may help when an entry is only tagged :archive: but not really archived. However, when an entry is archived it can only be reached during search when its file is included in the &quot;org-agenda-text-search-extra-files&quot; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To refile an archived entry is quite simple, one can open the corresponding archive file (in Org format) and do a C-c C-w at the entry to be refiled.&lt;/p&gt;&#xA;" OwnerUserId="6942" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-15T17:02:09.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29316" PostTypeId="2" ParentId="19339" CreationDate="2016-12-15T19:17:35.680" Score="9" Body="&lt;p&gt;See &lt;a href=&quot;https://stackoverflow.com/a/29757750/864684&quot;&gt;this StackOverflow answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://stackoverflow.com/users/544024/killdash9&quot;&gt;@killdash9&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Pressing d will copy both A and B to buffer C.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ediff-copy-both-to-C ()&#xA;  (interactive)&#xA;  (ediff-copy-diff ediff-current-difference nil 'C nil&#xA;                   (concat&#xA;                    (ediff-get-region-contents ediff-current-difference 'A ediff-control-buffer)&#xA;                    (ediff-get-region-contents ediff-current-difference 'B ediff-control-buffer))))&#xA;(defun add-d-to-ediff-mode-map () (define-key ediff-mode-map &quot;d&quot; 'ediff-copy-both-to-C))&#xA;(add-hook 'ediff-keymap-setup-hook 'add-d-to-ediff-mode-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-15T19:17:35.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29317" PostTypeId="1" CreationDate="2016-12-15T21:03:25.297" Score="3" ViewCount="1147" Body="&lt;p&gt;I would like the ability to go back and forth through a series of stored recent cursor positions, say up to 100 of them. Specifically, a position should be recorded when I click somewhere, or when I do a find operation that causes me to jump to a different location in the file. Ideally, I would be able to go back to the previous stored position, then back forward again through the list of positions, if I choose to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some preexisting way to do this? Alternatively, is there a relatively easy way to design a function to do this? Say, to set hooks for a cursor position change, then update some global array when such a hook is activated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't care whether positions are stored per-buffer or per-window or per-frame (although per-buffer would probably be better).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;exchange-point-and-mark&lt;/strong&gt; sort of does this (after a find operation; doesn't pay attention to mouse click position), on a much smaller scale.&lt;/p&gt;&#xA;" OwnerUserId="14269" LastEditorUserId="253" LastEditDate="2016-12-15T23:40:42.390" LastActivityDate="2022-01-19T02:36:39.393" Title="Storing previous cursor positions" Tags="|cursor|point|mark|registers|" AnswerCount="8" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29318" PostTypeId="2" ParentId="29311" CreationDate="2016-12-15T21:19:19.620" Score="1" Body="&lt;p&gt;One idea would be to record the headline and search for it to get back there again at the end (but this example will find the last occurrence if there are duplicate headings in the same file):&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((sort-init-pos (point))&#xA;       (heading-regexp &quot;^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*\\(\n.*DEADLINE.*$\\)&quot;)&#xA;       sort-item-whole&#xA;       sort-item-partial)&#xA;  (org-back-to-heading t)&#xA;  (if (and&#xA;        (looking-at org-heading-regexp)&#xA;        (and (looking-at heading-regexp) (match-string 3)))&#xA;    (re-search-forward heading-regexp nil t)&#xA;    (re-search-forward org-heading-regexp nil t))&#xA;  (setq sort-item-whole&#xA;    (regexp-quote (buffer-substring-no-properties (match-beginning 0) (match-end 0))))&#xA;  (setq sort-item-partial&#xA;    (regexp-quote (buffer-substring-no-properties (match-beginning 0) sort-init-pos)))&#xA;  (message &quot;Use `org-sort-entries' at this location.&quot;)&#xA;  (goto-char (point-max))&#xA;  (re-search-backward sort-item-whole nil t)&#xA;  (isearch-highlight (match-beginning 0) (match-end 0))&#xA;  (re-search-forward sort-item-partial nil t)&#xA;  (recenter)&#xA;  (sit-for 0.1)&#xA;  (isearch-dehighlight))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-15T21:53:01.367" LastActivityDate="2016-12-15T21:53:01.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29319" PostTypeId="2" ParentId="29303" CreationDate="2016-12-15T21:49:22.473" Score="2" Body="&lt;p&gt;If you haven't already try &lt;a href=&quot;http://www.dr-qubit.org/undo-tree/undo-tree.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;undo-tree.el&lt;/a&gt;.  It gives Emacs a conventional undo, otherwise you need to undo the undos in order to redo--there is no redo function...  With it you can add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-s-/&quot;) 'undo-tree-redo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your emacs init file, or where ever you keep custom keybindings, and walk back and forward through any change.&lt;/p&gt;&#xA;" OwnerUserId="11494" LastEditorUserId="11494" LastEditDate="2016-12-16T17:06:41.000" LastActivityDate="2016-12-16T17:06:41.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29320" PostTypeId="2" ParentId="29317" CreationDate="2016-12-15T23:18:26.810" Score="1" Body="&lt;p&gt;I was going to suggest &lt;code&gt;helm-all-mark-rings&lt;/code&gt; in the Helm package. It has been mentioned &lt;a href=&quot;https://emacs.stackexchange.com/questions/2807/effectively-using-the-mark-ring&quot;&gt;here&lt;/a&gt; previously, along with some other tips. To me it otherwise sounds like you might be interested in &lt;a href=&quot;https://github.com/joodland/bm&quot; rel=&quot;nofollow noreferrer&quot;&gt;bm&lt;/a&gt;, which is a way to manually add locations to a file (by mouse or keyboard), which you can then jump between.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-12-15T23:18:26.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29321" PostTypeId="2" ParentId="29317" CreationDate="2016-12-15T23:32:07.710" Score="3" Body="&lt;p&gt;The simplest option, although it does not keep positions in a ring, is to&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Position-Registers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;save positions to registers&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The docstring for the command &lt;code&gt;point-to-register&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is bound to &lt;code&gt;C-x r SPC&lt;/code&gt;, &lt;code&gt;C-x r C-SPC&lt;/code&gt;, &lt;code&gt;C-x r C-@&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(point-to-register REGISTER &amp;amp;optional ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Store current location of point in register REGISTER.&#xA;  With prefix argument, store current frame configuration.&#xA;  Use &lt;code&gt;C-x r j&lt;/code&gt; to go to that location or restore that configuration.&#xA;  Argument is a character, naming the register.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And the docstring for &lt;code&gt;jump-to-register&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is bound to &lt;code&gt;C-x r j&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(jump-to-register REGISTER &amp;amp;optional DELETE)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move point to location stored in a register.&#xA;  If the register contains a file name, find that file.&#xA;  (To put a file name in a register, you must use &lt;code&gt;set-register&lt;/code&gt;.)&#xA;  If the register contains a window configuration (one frame) or a frameset&#xA;  (all frames), restore that frame or all frames accordingly.&#xA;  First argument is a character, naming the register.&#xA;  Optional second arg non-nil (interactively, prefix argument) says to&#xA;  delete any existing frames that the frameset doesn't mention.&#xA;  (Otherwise, these frames are iconified.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-12-15T23:32:07.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29322" PostTypeId="2" ParentId="12927" CreationDate="2016-12-16T00:22:05.163" Score="14" Body="&lt;h1&gt;Notmuch&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I use &lt;a href=&quot;https://notmuchmail.org/&quot; rel=&quot;noreferrer&quot;&gt;notmuch&lt;/a&gt; for my emails in emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://notmuchmail.org/screenshots/notmuch-hello.png&quot; alt=&quot;screenshot of the notmuch-hello view&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does only operate on local mails which needed to be &lt;a href=&quot;https://notmuchmail.org/getting-started/#index1h2&quot; rel=&quot;noreferrer&quot;&gt;stored one message per file&lt;/a&gt; and I use maildir folders to which my smtp-server delivers. It should be able to cope with other solutions syncing mails to maildir folders on your computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start using it you install the command-line base and the emacs interface and start configuring via a short text wizard by calling &lt;code&gt;notmuch&lt;/code&gt;, setup a regular call to a filtering script which calls &lt;code&gt;notmuch new&lt;/code&gt; and tags other mails from the threads you tagged (for example mailing list threads you wish to ignore) or tag mails sorted by your mail daemon into special maildirs. In emacs you call &lt;code&gt;M-x notmuch&lt;/code&gt; to see the interface from before. Almost all configuration for the interface can be done via the Customization interface from emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it &lt;a href=&quot;https://notmuchmail.org/getting-started/#index6h2&quot; rel=&quot;noreferrer&quot;&gt;doesn't download messages&lt;/a&gt; from other systems it has no authentication or protocols built-in, apart from using emacs built-in support for sending emails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't use folders as such, but in practice stored searches feel like them for reading mails. It does list all used tags on the notmuch-hello view, so that when you decide how to tag your mail your lists get automatically updated. It doesn't need archiving as it shouldn't slow down when you have a lot of emails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The elisp part of notmuch brings apart from fast full-text and tagged and scoped searches possibilities to list matches and answer to messages. I don't know how drag and drop would work with notmuch as I use it via terminals and remote shells on my server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://notmuchmail.org/screenshots/notmuch-show.png&quot; alt=&quot;Message view within a thread of messages&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://notmuchmail.org/screenshots/notmuch-tree.png&quot; alt=&quot;alternate tree view of search results&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;more screenshots: &lt;a href=&quot;https://notmuchmail.org/screenshots/&quot; rel=&quot;noreferrer&quot;&gt;https://notmuchmail.org/screenshots/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most difficult part about it would be having a synchronized tags when you use notmuch on 2 different computers, but people have worked around that, and from what I gathered from the mailing list it probably works now. Or have a look at &lt;a href=&quot;https://notmuchmail.org/remoteusage/&quot; rel=&quot;noreferrer&quot;&gt;https://notmuchmail.org/remoteusage/&lt;/a&gt; for a new setup I just stumbled upon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are packages for most linux distributions and it is developed in a bazaar environment via the mailing list. If you self-compile from tarballs or the git, it uses C code and has a &lt;a href=&quot;https://git.notmuchmail.org/git/notmuch/blob/HEAD:/INSTALL&quot; rel=&quot;noreferrer&quot;&gt;dependencies&lt;/a&gt; on Xapian for storing the excerpts from the messages, GMime for decoding MIME emails, Talloc for memory management and zlib (which is also a dependency of Xapian).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would probably function well with rss2email or any solution converting rss feeds into maildirs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's usable via the command-line and apart from the default emacs elisp interface other people use it with mutt (copies/hardlinks search results to a maildir folder on the disk) or vim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will probably need some maintenance to keep running if your mail volume exceeds mine (~90k messages, not much mail). &lt;/p&gt;&#xA;" OwnerUserId="4068" LastEditorUserId="4068" LastEditDate="2017-10-04T09:36:39.000" LastActivityDate="2017-10-04T09:36:39.000" CommentCount="1" CommunityOwnedDate="2016-12-16T00:22:05.163" ContentLicense="CC BY-SA 3.0" />
  <row Id="29325" PostTypeId="1" CreationDate="2016-12-16T04:38:16.010" Score="3" ViewCount="1586" Body="&lt;p&gt;I don't mean hybrid line number mode, I want the absolute line number appears for all the lines, not only the current line number.&lt;/p&gt;&#xA;" OwnerUserId="13774" LastActivityDate="2021-05-01T08:03:05.310" Title="Emacs relative and absolute line number at the same time?" Tags="|line-numbers|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29327" PostTypeId="1" CreationDate="2016-12-16T06:46:42.510" Score="1" ViewCount="91" Body="&lt;p&gt;I'm trying to control paging of a PDF file in &lt;code&gt;doc-view&lt;/code&gt; mode. Say we have the following snippet&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((origin-frame (window-frame)))&#xA;  (with-selected-frame (make-frame-command)&#xA;    (let ((pdf-buffer (find-file &quot;./test.pdf&quot;)))&#xA;      (set-window-buffer (get-buffer-window) pdf-buffer)&#xA;      (select-frame-set-input-focus origin-frame)&#xA;      (with-current-buffer pdf-buffer&#xA;        (doc-view-goto-page 5)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;we make a new frame the display the pdf buffer then go back to our origin frame and try to scroll the pdf buffer to page &lt;code&gt;5&lt;/code&gt; in the origin buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eval&lt;/code&gt; the snippet, we can see the pdf buffer is actually displaying the content page &lt;code&gt;5&lt;/code&gt;, while the mode line says &lt;code&gt;P1/12 DocView&lt;/code&gt;.(Note that the first time you open the pdf it may take some time to convert the pdf and causes the snippet fail) Switch to the pdf buffer and press &lt;code&gt;n&lt;/code&gt; which calls &lt;code&gt;doc-view-next-page&lt;/code&gt;, we can see the buffer goes to page &lt;code&gt;2&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, the buffer is &lt;strong&gt;not&lt;/strong&gt; really went to page &lt;code&gt;5&lt;/code&gt; just now but its 'content display' did. Using &lt;code&gt;doc-view-goto-page&lt;/code&gt; in the pdf buffer will not have this problem as the modeling says &lt;code&gt;P5/12 DocView&lt;/code&gt; after evaluation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to fix this? Is &lt;code&gt;with-current-buffer&lt;/code&gt; not the way to go here? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-12-16T06:46:42.510" Title="Calling `doc-view-goto-page` in other buffer" Tags="|buffers|window|frames|docview|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29328" PostTypeId="1" AcceptedAnswerId="29335" CreationDate="2016-12-16T08:45:48.627" Score="1" ViewCount="382" Body="&lt;p&gt;So it occurs offen that the full path always exceeds sr-speedbar window width. Is there a way to hack sr-speedbar to display the fully path seperately in a sufficient long bar or wrap the path if it exceeds the window width?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZFmSN.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZFmSN.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Done by adding the following to my init file:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'speedbar-mode-hook (lambda () (setq truncate-lines nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Was having a hard time to make it also happen in spacemacs, but in case someone has the same issue, note the wrapping will become ineffective when other setttings are present, so better add all the sr-speedbar settings in hooks altogether:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun startup_layout ()&#xA;        (setq sr-speedbar-right-side nil sr-speedbar-width 50)&#xA;        (sr-speedbar-toggle)&#xA;        (with-current-buffer sr-speedbar-buffer-name (setq window-size-fixed 'width))&#xA;    (other-window 1)&#xA;)&#xA;(add-hook 'emacs-startup-hook 'startup_layout)&#xA;(add-hook 'speedbar-mode-hook (lambda () (setq truncate-lines nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And also put in user-init instead of user config. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Knowing Problem:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;When sr-speedbar-width is set less than 50, the name of path cannot be wrapped.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="12577" LastEditDate="2017-01-16T14:13:04.700" LastActivityDate="2017-01-16T14:13:04.700" Title="How to display full name of path in sr-speedbar or wrap it if it exceeds the window width" Tags="|speedbar|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29329" PostTypeId="2" ParentId="29317" CreationDate="2016-12-16T09:10:14.327" Score="3" Body="&lt;p&gt;You are describing a use case of bookmarks. For example, have a look at the visual bookmark package at &lt;a href=&quot;https://github.com/joodland/bm&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/joodland/bm&lt;/a&gt;. You get functions to toggle bookmarks at point and move back and forth between them. Bind them to keys that are convenient for you. &lt;/p&gt;&#xA;" OwnerUserId="903" LastActivityDate="2016-12-16T09:10:14.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29330" PostTypeId="1" AcceptedAnswerId="29332" CreationDate="2016-12-16T11:05:08.313" Score="7" ViewCount="1466" Body="&lt;p&gt;How can I set MUPDF as the default viewer in AUCTeX (I mean setting it in the variable Tex-view-program-selection)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="9099" LastActivityDate="2017-01-01T18:32:05.423" Title="Setting MUpdf as default viewer in AUCTeX" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29331" PostTypeId="1" AcceptedAnswerId="29338" CreationDate="2016-12-16T11:22:55.380" Score="1" ViewCount="1233" Body="&lt;p&gt;Is there a way to set the color of numbers differently to that of regular text? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for example, numbers such as: &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;2F&lt;/code&gt;, &lt;code&gt;2.0f&lt;/code&gt;, &lt;code&gt;0x1234&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be changed by a theme author?&#xA;If not, how can this be modified?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2016-12-18T05:12:15.353" Title="How to change the color of numbers for a theme?" Tags="|themes|numbers|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29332" PostTypeId="2" ParentId="29330" CreationDate="2016-12-16T13:43:40.643" Score="5" Body="&lt;p&gt;Here is (I think) the simplest way to do this. The first adds mupdf as a new view program, while the second specifies it as the default for pdfs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;tex&quot;&#xA;  (add-to-list 'TeX-view-program-list '(&quot;mupdf&quot; &quot;/path/to/mupdf %o&quot;))&#xA;  (setcdr (assq 'output-pdf TeX-view-program-selection) '(&quot;mupdf&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Adding basic synctex support&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In response to a comment, here is how to add support for synctex with mupdf. This only makes mupdf jump to the correct page with &lt;code&gt;C-c C-v&lt;/code&gt;. I believe doing more like inverse search requires some ugly hacks. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;tex&quot;&#xA;  ;; enable synctex support for latex-mode&#xA;  (add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)&#xA;  ;; add a new view program&#xA;  (add-to-list 'TeX-view-program-list&#xA;        '(;; arbitrary name for this view program&#xA;          &quot;my mupdf&quot;&#xA;          (;; mupdf command (may need an absolute path)&#xA;           &quot;mupdf&quot;&#xA;           ;; %o expands to the name of the output file&#xA;           &quot; %o&quot;&#xA;           ;; insert page number if TeX-source-correlate-mode&#xA;           ;; is enabled&#xA;           (mode-io-correlate &quot; %(outpage)&quot;)))&#xA;  ;; use the view command named &quot;my mupdf&quot; for pdf output&#xA;  (setcdr (assq 'output-pdf TeX-view-program-selection) '(&quot;my mupdf&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="14114" LastEditDate="2017-01-01T18:32:05.423" LastActivityDate="2017-01-01T18:32:05.423" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29333" PostTypeId="1" CreationDate="2016-12-16T14:34:19.567" Score="0" ViewCount="175" Body="&lt;p&gt;&lt;code&gt;skewer-mode&lt;/code&gt; has been a very useful tool for me learning JavaScript. I constantly use &lt;code&gt;skewer-eval-last-expression&lt;/code&gt; and &lt;code&gt;skewer-eval-defun&lt;/code&gt; for debugging purposes, but I find that most of the time I want to evaluate the entire script file I am working on, rather than a single function or expression. &lt;strong&gt;Is there a way for me to evaluate the entire buffer, rather than just a function or expression?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current hack to get around this, is to just surround all the code I am working on in curly braces. That way when I call &lt;code&gt;skewer-eval-defun&lt;/code&gt;, all the code within the braces is evaluated. However, it would be nice if there was a solution that didn't involve extra code that needs to be removed later (the extra braces affect indentation as well). &lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-12-16T14:34:19.567" Title="Evaluate entire buffer in skewer-mode" Tags="|javascript|skewer-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29334" PostTypeId="1" CreationDate="2016-12-16T14:56:02.190" Score="1" ViewCount="226" Body="&lt;p&gt;Using the solarized theme from&#xA;&lt;a href=&quot;http://github.com/bbatsov/solarized-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;this repository&lt;/a&gt;, how can I change the&#xA;colour order of org headings?  I like the default order better&#xA;than those defined in the solarized package, but would like the colours&#xA;in low contrast versions.&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorDisplayName="user12563" LastEditDate="2016-12-16T18:46:25.580" LastActivityDate="2016-12-16T18:46:25.580" Title="Changing org colour order with solarized theme" Tags="|org-mode|colors|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29335" PostTypeId="2" ParentId="29328" CreationDate="2016-12-16T15:38:22.313" Score="1" Body="&lt;p&gt;This has nothing to do with &lt;code&gt;sr-speedbar.el&lt;/code&gt;, but rather &lt;code&gt;speedbar.el&lt;/code&gt;.  The former is a hack/modification of the latter.  Try &lt;code&gt;(add-hook 'speedbar-mode-hook (lambda () (setq truncate-lines nil)))&lt;/code&gt; and see if that has the desired effect.  If we type &lt;code&gt;M-x find-function RET speedbar-mode RET&lt;/code&gt; and examine the code, we will see that it expressly states &lt;code&gt;(setq truncate-lines t)&lt;/code&gt; -- this is the behavior that needs modification using something akin to the above-mentioned code.  However, long directory/filenames underneath will also be wrapped at the window edge with this new setting.  [A visual cue as to what is happening is the right arrow in the full path in the screen-shot -- this is a bitmap indicating this is a continuation line made possible by virtue of the variable &lt;code&gt;truncate-lines&lt;/code&gt; being set to &lt;code&gt;t&lt;/code&gt;.  That bitmap image can be changed or eliminated, but it is beyond the scope of the question.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The screenshot provided by the original poster shows two distinct windows within one frame.  The answer to the question of whether the directory name at the top of the speedbar window can span across the screen to occupy the position of the second window on the right, is &quot;no&quot; (sorry).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;One idea, if the original poster is so inclined, would be to spend time modifying the &lt;code&gt;speedbar.el&lt;/code&gt; library to force the frame-title to update with the full path and eliminate the full path from the speedbar window.  However, the user would lose functionality of having that full path within the window itself -- e.g., to jump to a specific previous parent directory.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-16T22:54:57.890" LastActivityDate="2016-12-16T22:54:57.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29336" PostTypeId="1" CreationDate="2016-12-16T17:21:37.990" Score="1" ViewCount="2581" Body="&lt;p&gt;Issuing &lt;code&gt;M-x org-agenda-month-vew&lt;/code&gt; and &lt;code&gt;M-x org-agenda-year-view&lt;/code&gt; yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Wrong type argument: number-or-marker-p, nil&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why am I getting this error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issuing &lt;code&gt;M-x toggle-debug-on-error&lt;/code&gt; before the command yields&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  calendar-gregorian-from-absolute(nil)&#xA;  org-agenda-compute-starting-span(nil month nil)&#xA;  org-agenda-change-time-span(month nil)&#xA;  org-agenda-month-view(nil)&#xA;  call-interactively(org-agenda-month-view record nil)&#xA;  command-execute(org-agenda-month-view record)&#xA;  execute-extended-command(nil &quot;org-agenda-month-view&quot;)&#xA;  call-interactively(execute-extended-command nil nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="2695" LastEditDate="2016-12-16T20:48:52.790" LastActivityDate="2016-12-16T22:49:33.660" Title="Why can't I view my monthly or yearly org agenda?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29337" PostTypeId="1" CreationDate="2016-12-16T17:22:26.570" Score="2" ViewCount="227" Body="&lt;p&gt;I am trying to customize a theme for myself, and now I am finding a way to&#xA;change the highlight color of constant values such as 10 and 10.5677. For example, C mode in Vim highlights those constant values in blue, while c mode in Emacs does not highlight with any distinctive colors (the currently-highlighted color is black) compared with its counterpart. Based on the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces-for-Font-Lock.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs document&lt;/a&gt; of font-lock-faces, there is no font-lock to change the highlight color for the constant values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a solution or have done it before, please let me know.&lt;/p&gt;&#xA;" OwnerUserId="14020" LastEditorUserId="14020" LastEditDate="2016-12-17T03:03:40.920" LastActivityDate="2016-12-17T19:37:55.307" Title="Does emacs have font-lock for constant values?" Tags="|init-file|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29338" PostTypeId="2" ParentId="29331" CreationDate="2016-12-16T18:04:27.890" Score="4" Body="&lt;p&gt;You can achieve highlighting of numbers in the buffers using &lt;a href=&quot;https://github.com/Fanael/highlight-numbers&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;highlight-numbers&lt;/code&gt;&lt;/a&gt; package. The face used for numbering is &lt;code&gt;highlight-numbers-number&lt;/code&gt; and it inherits from &lt;code&gt;font-lock-constant-face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a &lt;code&gt;deftheme&lt;/code&gt; the entry can be written as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(highlight-numbers-number ((t (:foreground &quot;#f0ad6d&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="2418" LastEditDate="2016-12-18T05:12:15.353" LastActivityDate="2016-12-18T05:12:15.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29339" PostTypeId="2" ParentId="19637" CreationDate="2016-12-16T19:54:41.353" Score="1" Body="&lt;p&gt;&lt;code&gt;vc-registered&lt;/code&gt; is correct. You just pass it the file path and it will work with any backend. Use &lt;code&gt;vc-responsible-backend&lt;/code&gt; to get the backend name.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(vc-registered (buffer-file-name))&#xA;;; =&amp;gt; t&#xA;&#xA;(vc-responsible-backend (buffer-file-name))&#xA;;; =&amp;gt; Git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14274" LastEditorUserId="675" LastEditDate="2016-12-16T21:08:16.033" LastActivityDate="2016-12-16T21:08:16.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29341" PostTypeId="2" ParentId="29336" CreationDate="2016-12-16T22:49:33.660" Score="4" Body="&lt;p&gt;The commands &lt;code&gt;org-agenda-month-view&lt;/code&gt; and &lt;code&gt;org-agenda-year-view&lt;/code&gt; are thought to be called from an agenda buffer AFAICS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use the user interface of the agenda to call those functions this constraint is always fullfilled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you feel the need for a different behavior for those functions you could try to discuss this topic at the orgmode mailing list.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastActivityDate="2016-12-16T22:49:33.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29342" PostTypeId="2" ParentId="13603" CreationDate="2016-12-16T23:01:26.803" Score="4" Body="&lt;p&gt;To specifically disable &lt;code&gt;electric-pair-mode&lt;/code&gt; in the minibuffer change elethan's example to use the &lt;code&gt;minibufferp&lt;/code&gt; function. Below is the relevant part from my Emacs configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Enable smart paring&#xA;(electric-pair-mode)&#xA;&#xA;(defun pvj/inhibit-electric-pair-mode (char)&#xA;  (minibufferp))&#xA;&#xA;(setq electric-pair-inhibit-predicate #'pvj/inhibit-electric-pair-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2016-12-16T23:01:26.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29346" PostTypeId="1" CreationDate="2016-12-17T07:23:27.607" Score="1" ViewCount="33" Body="&lt;p&gt;How can I make the functions of &lt;code&gt;multiple-cursors&lt;/code&gt; recenter if the next or previous candidate if not show in current screen automatically? Although I known I can do it by &lt;kbd&gt;C-v&lt;/kbd&gt; and &lt;kbd&gt;M-v&lt;/kbd&gt; manually. Thanks in advance !&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-12-17T14:56:35.487" Title="Recentering if multiple-cursors goes out the screen?" Tags="|multiple-cursors|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29347" PostTypeId="1" CreationDate="2016-12-17T09:19:09.923" Score="0" ViewCount="76" Body="&lt;p&gt;If I invoke emacsclient with &lt;code&gt;emacsclient -na runemacs file1&lt;/code&gt; emacsclients switch to the frame containing file1.&#xA;But if later I invoke emacs with &lt;code&gt;emacsclient -na runemacs file2&lt;/code&gt; emacsclient opens file2 in the existing frame of file1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand &lt;code&gt;emacsclient -cna runemacs file1&lt;/code&gt; always creates a new frame regardless of if file1 is already opened or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer that emacsclient creates a new frame of a file if that file is not already open in the existing frames, otherwise emacsclient switchs to the frame containing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I should send some elisp code by &lt;code&gt;-e&lt;/code&gt; option to the emacsclient for checking this but I was not able to find the right code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a related question &lt;a href=&quot;https://emacs.stackexchange.com/questions/12894/make-emacsclient-create-a-frame-only-if-there-isnt-one-already&quot;&gt;Make emacsclient create a frame only if there isn&amp;#39;t one already&lt;/a&gt; without an accepted answer. The upvoted answer there uses a bash script hence not a pure elisp solution.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-12-17T09:19:09.923" Title="Correct commandline options (by pure elisp) for emacsclient to create a new frame only if the file is not already open otherwise switchs to it" Tags="|frames|emacsclient|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29349" PostTypeId="1" AcceptedAnswerId="29391" CreationDate="2016-12-17T09:36:20.873" Score="0" ViewCount="121" Body="&lt;p&gt;How can we visually add separators in log files, based on conditions between consecutive lines?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample log file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[DEBUG][2016-05-26 10:24:51,714][FileHelper] - [realContextPath]&#xA;[DEBUG][2016-05-26 10:24:52,369][DbConnectionImpl] - [DELETE FROM xct_log]&#xA;[DEBUG][2016-05-26 10:24:56,925][DSRestrictionConverter] - [parseRestrict]&#xA;[DEBUG][2016-05-26 10:24:56,976][DbConnectionImpl] - [UPDATE hd_log]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The goal is to have a visual separator when there is more than 2 seconds between consecutive timestamps. In the above case, it'd be between the 2nd and the 3rd line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make that separator visible, we could use overline or underline properties, for example. No need to physically add something to the buffer...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This is a slightly rewritten version of question &lt;a href=&quot;https://emacs.stackexchange.com/questions/27287/format-sql-code&quot;&gt;Format SQL code&lt;/a&gt;, with a MUCH better title.)&lt;/p&gt;&#xA;" OwnerUserId="12539" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2016-12-18T14:25:49.287" Title="Highlight text based on condition on consecutive lines" Tags="|syntax-highlighting|highlighting|logging|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29350" PostTypeId="1" AcceptedAnswerId="29360" CreationDate="2016-12-17T09:49:35.003" Score="1" ViewCount="780" Body="&lt;p&gt;&lt;br&gt;&#xA;I was lately being teased by a vi user. He said that within few commands, one can do search-replace (both regexp and simple string ), on lines range. And one does not need to do highlight. One inputs start, end, and the string and replacement, pretty much.&lt;br&gt;Is there a way to do that in emacs? I'd hate to lose in a religious war ;-)&lt;/p&gt;&#xA;" OwnerUserId="13534" LastActivityDate="2020-02-16T17:12:55.467" Title="Search and replace on lines range, numerically" Tags="|search|replace|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29351" PostTypeId="1" AcceptedAnswerId="29352" CreationDate="2016-12-17T10:25:37.233" Score="2" ViewCount="289" Body="&lt;p&gt;I have following function as part of my emacs configuration.org settings for publishing org to html.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar website-html-preamble&#xA;&quot;&amp;lt;nav&amp;gt;&#xA; &amp;lt;ul class=&quot;nav nav-tabs&quot;&amp;gt;&#xA;   &amp;lt;li role=&quot;presentation&quot; class=&quot;active&quot;&amp;gt;&amp;lt;a href=&quot;/&quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;   &amp;lt;li role=&quot;presentation&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Profile&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA;   &amp;lt;li role=&quot;presentation&quot;&amp;gt;&amp;lt;a href=&quot;#&quot;&amp;gt;Messages&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#xA; &amp;lt;/ul&amp;gt;&#xA; &amp;lt;/nav&amp;gt;&quot;)&#xA;&#xA; (defvar website-html-postamble &#xA;     &quot;&amp;lt;div class='footer'&amp;gt; Copyright 2016 %a (%v HTML).&amp;lt;br&amp;gt;Last updated %C. &amp;lt;br&amp;gt;   &amp;lt;/div&amp;gt;&quot;)&#xA;&#xA;  (setq org-publish-project-alist&#xA;    '(&#xA;      (&quot;website&quot; :components (&quot;orgfiles&quot;))&#xA;      (&quot;orgfiles&quot;&#xA;       :base-directory  ,org-mode-websrc-directory&#xA;       :base-extension &quot;org&quot;&#xA;       :publishing-directory  ,org-mode-publishing-directory&#xA;       :exclude &quot;*/excluded/*&quot; &#xA;       :recursive t&#xA;       :publishing-function org-twbs-publish-to-html&#xA;       :headline-levels 3&#xA;   :section-numbers nil&#xA;       :with-toc nil&#xA;   :html-preamble ,website-html-preamble&#xA;   :Html-postamble ,website-html-postamble&#xA;      )&#xA;      )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;,var-name&quot;  (eg: ,website-html-preamble) causes following problems (using org-babel-load-file to load config)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Debugger entered--Lisp error: (invalid-read-syntax &quot;#&quot;)&#xA;  eval-buffer(# nil &quot;c:/rahuketu/programming/EMAC/Emacs_Config/.emacs.d/configuration.el&quot;&#xA;  nil t)  ; Reading at buffer position 4284&lt;br&gt;&#xA;  load-with-code-conversion(&quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el&quot;&#xA;  &quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el&quot;&#xA;  nil nil)&lt;br&gt;&#xA;  load(&quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el&quot;&#xA;  nil nil t)&lt;br&gt;&#xA;  load-file(&quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el&quot;)&#xA;  org-babel-load-file(&quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.org&quot;)&#xA;  eval-buffer(# nil&#xA;  &quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init.el&quot; nil t) &#xA;  ; Reading at buffer position 422&lt;br&gt;&#xA;  load-with-code-conversion(&quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init.el&quot;&#xA;  &quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init.el&quot; t t)&lt;br&gt;&#xA;    load(&quot;c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init&quot; t t)&lt;/p&gt;&#xA;  &#xA;  &lt;h1&gt;[0 &quot;\205\262 \306=\203  command-line()   normal-top-level()&lt;/h1&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11958" LastEditorUserId="105" LastEditDate="2016-12-17T22:39:25.320" LastActivityDate="2016-12-17T22:39:25.320" Title="How to use ,var-name (defvar) syntax in org-publish-project-alist? Init file is in form of org-mode" Tags="|org-mode|org-export|org-babel|string|backquote|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29352" PostTypeId="2" ParentId="29351" CreationDate="2016-12-17T11:56:29.390" Score="3" Body="&lt;p&gt;You need to use a back quote if you want the variables with commas to be replaced. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that's not where the error is coming from. You don't appear to have escaped the quote characters inside your preamble string. &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-for-Strings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Reference&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2016-12-17T11:56:29.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29353" PostTypeId="1" AcceptedAnswerId="29354" CreationDate="2016-12-17T12:55:36.933" Score="1" ViewCount="94" Body="&lt;p&gt;How can I get the value of left top and right bottom point value of current working window(the window currently focusing on)?&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-12-17T13:15:29.847" Title="How can I get the value of left top and right bottom point value of current window?" Tags="|window|point|window-point|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29354" PostTypeId="2" ParentId="29353" CreationDate="2016-12-17T13:15:29.847" Score="1" Body="&lt;p&gt;This is described in chapter &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Start-and-End.html#Window-Start-and-End&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Window Start and End Positions&lt;/a&gt; of the elisp manual.  Specifically:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-- Function: window-start &amp;amp;optional window&#xA;       This function returns the display-start position of window WINDOW.&#xA;       If WINDOW is ‘nil’, the selected window is used.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;-- Function: window-end &amp;amp;optional window update&#xA;       This function returns the position where display of its buffer ends&#xA;       in WINDOW.  The default for WINDOW is the selected window.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Be sure to read the whole manual section for details.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-12-17T13:15:29.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29355" PostTypeId="2" ParentId="29350" CreationDate="2016-12-17T13:55:00.633" Score="3" Body="&lt;p&gt;You can switch to evil-mode and use commands similar to the commands in vi.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Precondition: Have Emacs package &quot;evil&quot; installed.  (See &lt;a href=&quot;https://melpa.org/#/evil&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://melpa.org/#/evil&lt;/a&gt;) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let the buffer be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo&#xA;foo foo&#xA;foo foo foo&#xA;foo foo foo foo&#xA;foo foo foo foo foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Activate evil-mode with &lt;code&gt;M-x evil-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To replace &quot;foo&quot; with &quot;bar&quot; in lines 2 to 4 in a buffer&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;type &lt;code&gt;:2,4s/foo/bar/g&lt;/code&gt; hit enter.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The result of the replacement:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo&#xA;bar bar&#xA;bar bar bar&#xA;bar bar bar bar&#xA;foo foo foo foo foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Deactivate evil with a further &lt;code&gt;M-x evil-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8943" LastEditorUserId="8943" LastEditDate="2020-02-16T17:12:55.467" LastActivityDate="2020-02-16T17:12:55.467" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="29356" PostTypeId="2" ParentId="17631" CreationDate="2016-12-17T14:07:01.357" Score="3" Body="&lt;p&gt;Well this has bugged me a lot too (I happen to find the Markdown syntax much more intuitive), and today I looked into the required changes to org.el and there's quite some work.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There should be an &lt;code&gt;org-angle-link-re&lt;/code&gt; in &lt;code&gt;org-make-link-regexps&lt;/code&gt; similar to the other link types,&lt;/li&gt;&#xA;&lt;li&gt;And then it would need to be plumbed down &lt;em&gt;everywhere&lt;/em&gt;:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;into &lt;code&gt;org-any-link-re&lt;/code&gt; in that same function &lt;code&gt;org-make-link-regexps&lt;/code&gt;,&lt;/li&gt;&#xA;&lt;li&gt;a function &lt;code&gt;org-activate-markdown-links&lt;/code&gt; would need to be written and plumbed down into &lt;code&gt;org-set-font-lock-defaults&lt;/code&gt;, with further plumbing required to make the &lt;code&gt;org-highlight-links&lt;/code&gt; work,&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;And then of course, it would be testing and debugging time.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It doesn't look like one can get away with a couple of &lt;code&gt;defadvice&lt;/code&gt;s, so there would need to be a patch, that would immediately start bit-rotting unless it somehow gets accepted upstream. Which sounds like a tough sell ☹&lt;/p&gt;&#xA;" OwnerUserId="11005" LastActivityDate="2016-12-17T14:07:01.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29358" PostTypeId="1" CreationDate="2016-12-17T16:00:15.280" Score="1" ViewCount="213" Body="&lt;p&gt;The default behavior in emacs-25 for the following code is for message citation lines to display the time in UTC, even if (current-time-zone) returns a local time zone such as (-18000 &quot;EST&quot;), and even though (current-time-string) correctly returns a result in local time, and even though my &quot;TZ&quot; environment variable and /etc/localtime are properly set to my local time zone ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq message-citation-line-format &quot;On %a %d-%b-%Y at %T %Z, %f wrote:\n&quot;)&#xA;(setq message-citation-line-function 'message-insert-formatted-citation-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I want the citation line to show the time in local time instead of UTC, I have to wrap message-insert-formatted-citation-line as follows ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-message-insert-formatted-citation-line ()&#xA;  (message-insert-formatted-citation-line nil nil (car (current-time-zone))))&#xA;(setq message-citation-line-function 'my-message-insert-formatted-citation-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, even with this hack, the citation line shows the time zone as a number (e.g., &quot;-0500&quot;) for both the %Z and %z format characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like the citation line to show the time zone using the actual timezone ID from (cdr (current-time-zone)) instead of a number. In my case, that would be &quot;EST&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I'd like the citation lines to look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;On Thu 04-Jul-1776 at 12:34:56 EST, Thomas Jefferson &amp;lt;tommy@colonies.uk.gov&amp;gt; wrote:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the &quot;EST&quot;, which now can only appear as &quot;-0500&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I pass (cdr (current-time-zone)) as the final argument to message-insert-formatted-citation-line, it is ignored, and the time is once again displayed in UTC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of an already-existing alternative function for creating citation lines, which doesn't default to UTC, and which properly shows the local time with the actual name of the time zone?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I could copy the message-insert-formatted-citation-line function from gnus/message.el to a new function called my-message-insert-formatted-citation-line and change how it handles its &quot;tz&quot; parameter. However, that is a long, complicated function, and I'd rather make use of something that has already been written, if such a function exists anywhere, than to hack this existing function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of a pre-existing alternative to message-insert-formatted-citation-line that works the way I'd like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much, in advance.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2016-12-17T16:22:28.483" LastActivityDate="2016-12-17T16:22:28.483" Title="Better display of local time in message-insert-formatted-citation-line?" Tags="|email|quote|format|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29359" PostTypeId="1" CreationDate="2016-12-17T16:50:42.603" Score="2" ViewCount="949" Body="&lt;p&gt;I was trying to use &lt;code&gt;org-drill&lt;/code&gt;, so I installed &lt;code&gt;org-plus-contrib&lt;/code&gt;. That caused me a lot of problems, which I finally resolved by finding out that if emacs loads org related stuff, the installation doesn't work properly. So I deleted my &lt;code&gt;emacs.d&lt;/code&gt; and started over and managed to install it properly and &lt;code&gt;org-drill&lt;/code&gt; was working fine. At this point my &lt;code&gt;init.el&lt;/code&gt; file only consisted of melpa and org elpa references, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;;; Add the melpa package repository&#xA;;; Remember to always use HTTPS&#xA;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;;; org-elpa&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;not my full configuration. Later when I added my previous configuration, org-drill stopped working. Maybe something in my configuration is causing problems, but I can't figure out what. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;&#xA;;; Add the melpa package repository&#xA;;; Remember to always use HTTPS&#xA;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;;; org-elpa&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;&#xA;;; Remove the splash screen&#xA;(setq inhibit-splash-screen t)&#xA;&#xA;;; Remove the tool bar&#xA;(customize-set-variable 'tool-bar-mode nil)&#xA;&#xA;;; Remove the menu bar&#xA;;;(customize-set-variable 'menu-bar-mode nil)&#xA;&#xA;;; Remove scroll bar&#xA;(customize-set-variable 'scroll-bar-mode nil)&#xA;&#xA;;; smoother scrolling&#xA;(setq redisplay-dont-pause t&#xA;      scroll-margin 1&#xA;      scroll-step 1&#xA;      scroll-conservatively 10000&#xA;      scroll-preserve-screen-position 1)&#xA;&#xA;;; load the theme&#xA;(load-theme 'dracula t)&#xA;&#xA;;; remap marker moving keys vim-style&#xA;(global-set-key (kbd &quot;M-j&quot;) 'backward-char) ; was indent-new-comment-line&#xA;(global-set-key (kbd &quot;M-;&quot;) 'forward-char)  ; was downcase-word&#xA;(global-set-key (kbd &quot;M-k&quot;) 'previous-line) ; was tab-to-tab-stop&#xA;(global-set-key (kbd &quot;M-l&quot;) 'next-line)     ; was kill-sentence&#xA;&#xA;;; org-mode&#xA;;; ========&#xA;&#xA;;; Add org-directory&#xA;(setq org-directory &quot;~/org/&quot;)&#xA;&#xA;;; Add my org files folder&#xA;(setq org-agenda-files '(&quot;~/org/&quot;))&#xA;&#xA;;; open project.org file&#xA;(global-set-key (kbd &quot;C-c p&quot;)&#xA;        (lambda()&#xA;          (interactive)&#xA;          (find-file &quot;~/org/projects.org&quot;)))&#xA;&#xA;;; ==========&#xA;;; org-capture&#xA;&#xA;(global-set-key (kbd &quot;C-c c&quot;) 'org-capture)&#xA;&#xA;;; set org-capture file&#xA;(setq org-default-notes-file (concat org-directory &quot;~/org/capture.org&quot;))&#xA;&#xA;;; ====================&#xA;;; insert date and time&#xA;&#xA;(defvar current-date-time-format &quot;%a %b %d %H:%M:%S %Z %Y&quot;&#xA;  &quot;Format of date to insert with `insert-current-date-time' func&#xA;See help of `format-time-string' for possible replacements&quot;)&#xA;&#xA;(defvar current-time-format &quot;%a %H:%M:%S&quot;&#xA;  &quot;Format of date to insert with `insert-current-time' func.&#xA;Note the weekly scope of the command's precision.&quot;)&#xA;&#xA;(defun insert-current-date-time ()&#xA;  &quot;insert the current date and time into current buffer.&#xA;Uses `current-date-time-format' for the formatting the date/time.&quot;&#xA;       (interactive)&#xA;       (insert (format-time-string current-date-time-format (current-time))))&#xA;&#xA;(defun insert-current-time ()&#xA;  &quot;insert the current time (1-week scope) into the current buffer.&quot;&#xA;       (interactive)&#xA;       (insert (format-time-string current-time-format (current-time))))&#xA;&#xA;(global-set-key &quot;\C-c\C-d&quot; 'insert-current-date-time)&#xA;(global-set-key &quot;\C-c\C-t&quot; 'insert-current-time)&#xA;&#xA;;; useful function in the renaming pdf file workflow&#xA;;; =================================================&#xA;&#xA;(defun close-and-kill-next-pane ()&#xA;  &quot;If there are multiple windows, then close the other pane and kill the buffer in it also&quot;&#xA;  (interactive)&#xA;  (other-window 1)&#xA;  (kill-this-buffer)&#xA;;;  (if (not (one-window-p))&#xA;;;      (delete-window))&#xA;  (other-window 1))&#xA;&#xA;(global-set-key (kbd &quot;C-c k&quot;) 'close-and-kill-next-pane)&#xA;&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(org-modules&#xA;   (quote&#xA;    (org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail org-w3m org-drill)))&#xA; '(package-selected-packages (quote (org-plus-contrib dracula-theme)))&#xA; '(scroll-bar-mode nil)&#xA; '(tool-bar-mode nil))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;org-drill&lt;/code&gt; no longer works. I've tried &lt;code&gt;M-x find-library RET org-drill&lt;/code&gt; and it can find the file, but emacs doesn't load it. Org-mode has also stopped working properly. I'm using org version 9.0.2 and emacs 25.1.&lt;/p&gt;&#xA;" OwnerUserId="14281" LastEditorUserId="253" LastEditDate="2016-12-17T17:16:57.953" LastActivityDate="2016-12-17T17:16:57.953" Title="How to configure org-plus-contrib?" Tags="|org-mode|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29360" PostTypeId="2" ParentId="29350" CreationDate="2016-12-17T16:56:11.570" Score="3" Body="&lt;p&gt;In emacs it's not that hard to write your own.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-query-regexp-replace-lines (start end)&#xA;  (interactive &quot;nStart line (inclusive): \nnEnd line (inclusive): &quot;)&#xA;  (let (start-point end-point)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (forward-line (- start 1))&#xA;      (setq start-point (point))&#xA;      (forward-line (1+ (- end start)))&#xA;      (setq end-point (point)))&#xA;    (save-restriction&#xA;      (narrow-to-region start-point end-point)&#xA;      (call-interactively 'query-replace-regexp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As the other answer says evil-mode is great too&lt;/p&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="14114" LastEditDate="2016-12-17T21:27:51.097" LastActivityDate="2016-12-17T21:27:51.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29361" PostTypeId="1" AcceptedAnswerId="29373" CreationDate="2016-12-17T18:09:47.400" Score="3" ViewCount="454" Body="&lt;p&gt;The command &lt;code&gt;make-frame&lt;/code&gt; creates a duplicate frame of a given frame.&#xA;Is there a reverse command which kills all duplicates (if any) of the current frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely assume that the current frame contains a single visible window corresponding to a visiting file. I would like to delete all similar frames (i.e., all frames with the same visiting file and a single visible window), except one of them. Assume that &lt;code&gt;(global-auto-revert-mode 1)&lt;/code&gt; is enabled, hence all visiting files have the same content.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2016-12-17T20:04:51.760" LastActivityDate="2016-12-23T03:31:25.797" Title="How to kill all duplicates of the current frame" Tags="|frames|kill-buffer|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29362" PostTypeId="1" AcceptedAnswerId="29364" CreationDate="2016-12-17T18:12:33.720" Score="2" ViewCount="275" Body="&lt;p&gt;How can I have emacs save my desktop periodically, so it will persist even if I do not exit with &lt;code&gt;C-c C-x&lt;/code&gt; in &lt;code&gt;desktop-save-mode&lt;/code&gt; or save manually?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="253" LastEditDate="2016-12-17T18:52:54.473" LastActivityDate="2016-12-17T18:52:54.473" Title="Periodic desktop save" Tags="|desktop|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29363" PostTypeId="1" AcceptedAnswerId="29859" CreationDate="2016-12-17T18:20:50.243" Score="1" ViewCount="581" Body="&lt;p&gt;I tend to write the commit message as I go along and stage changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I use a scratch buffer for this, but it would be nicer if I could edit it in Magit from the start. Is this possible and if so how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;I should say that I am a little unusual when it comes to commit messages: I write the problem that the commit solves rather than what has changed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. &quot;get_prop(&quot;1&quot;) raises exception&quot; rather than &quot;cast strings to integers in get_prop&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I think this is much more sensible than saying what you've done (which is evident in the the commit already).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently I &lt;em&gt;have&lt;/em&gt; to write the commit message first.&lt;/p&gt;&#xA;" OwnerUserId="3944" LastEditorUserId="3944" LastEditDate="2016-12-17T18:34:27.487" LastActivityDate="2017-01-07T13:04:22.460" Title="Can I edit a commit message in Magit before the commit is started?" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29364" PostTypeId="2" ParentId="29362" CreationDate="2016-12-17T18:52:15.007" Score="2" Body="&lt;p&gt;Ordinarily, one would use a&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Timers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;timer&lt;/a&gt;&#xA;to repeat a task at given time intervals.  However, the manual&#xA;node on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html#Saving-Emacs-Sessions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Saving Emacs&#xA;Sessions&lt;/a&gt;&#xA;states that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When &lt;code&gt;desktop-save-mode&lt;/code&gt; is active and the desktop file exists,&#xA;  Emacs auto-saves it every &lt;code&gt;desktop-auto-save-timeout&lt;/code&gt; seconds,&#xA;  if that is non-&lt;code&gt;nil&lt;/code&gt; and non-zero.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I found this information by looking in the elisp manual on&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Desktop-Save-Mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Desktop Save&#xA;Mode&lt;/a&gt;&#xA;and following the link to the manual node on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html#Saving-Emacs-Sessions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Saving Emacs&#xA;Sessions&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-12-17T18:52:15.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29365" PostTypeId="1" CreationDate="2016-12-17T19:01:21.357" Score="1" ViewCount="1896" Body="&lt;p&gt;Opening a small python file, with &amp;lt;10 buffers open, takes a long time. &lt;a href=&quot;https://gist.github.com/vlad17/afb549b085f280ecbc503389ccf967ae&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here's a gist of the profile&lt;/a&gt; of trying to open this file (giving up with &lt;code&gt;C-g&lt;/code&gt; after 2 minutes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deactivating ido-mode tells more or less the same story. See &lt;a href=&quot;https://gist.github.com/vlad17/dfb8eccc6f0a57b536a41e3c035deedc&quot; rel=&quot;nofollow noreferrer&quot;&gt;this gist&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Messages during the opening of the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CPU profiler started&#xA;Mark saved where search started [3 times]&#xA;Making python-shell-interpreter local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!&#xA;Making python-shell-interpreter-args local to  *Python Internal [792caf12c778150badeeede64c068cee]* while let-bound!&#xA;Waiting for process to die...done&#xA;Quit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's amazing is that after I quit the find-file with &lt;code&gt;C-g&lt;/code&gt;, and re-open &lt;strong&gt;the same&lt;/strong&gt; file with &lt;code&gt;C-x C-f&lt;/code&gt; again, it loads, instantly. If, after this, I try to newly open another small python files, I have the exact same behavior - first time, emacs hangs, second time, emacs opens the file instantaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;None of the minor modes that are active seem threatening (I've removed all the cumbersome ones). Here are the minor modes that are activated in python mode (at least as captured when the file successfully opens the second time). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Version&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Modes for buffer that's open while opening the file (same as the ones for the file that will be opened, except instead of &lt;code&gt;*scratch*&lt;/code&gt;'s lisp-mode it'll be python for the &lt;code&gt;*.py&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption&#xA;Blink-Cursor Column-Number Electric-Indent File-Name-Shadow Font-Lock&#xA;Global-Font-Lock Line-Number Menu-Bar Mouse-Wheel Shell-Dirtrack&#xA;Tool-Bar Tooltip Transient-Mark&#xA;&#xA;(Information about these minor modes follows the major mode info.)&#xA;&#xA;Lisp Interaction mode defined in `lisp-mode.el':&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8378" LastEditorUserId="8378" LastEditDate="2016-12-17T20:56:05.573" LastActivityDate="2020-02-04T14:47:16.263" Title="Why does opening a file take so long in python mode?" Tags="|python|find-file|" AnswerCount="1" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="29367" PostTypeId="1" CreationDate="2016-12-17T19:32:29.340" Score="0" ViewCount="178" Body="&lt;p&gt;I'm rebuilding my emacs configuration, and trying to compile without warnings. I'm using also cask. I have this case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'magit)&#xA;&#xA;;; Enable a right limit of 70 chars for git logs&#xA;(add-hook 'magit-log-edit-mode-hook 'turn-on-auto-fill)&#xA;&#xA;(provide 'my-magit)&#xA;&#xA;(fullframe magit-status magit-mode-quit-window nil)&#xA;(setq magit-last-seen-setup-instructions &quot;1.4.0&quot;)&#xA;&#xA;(global-set-key (kbd &quot;C-c g s&quot;) 'magit-status)&#xA;&#xA;(require 'git-gutter)&#xA;(global-git-gutter-mode +1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Compiling this, give this warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In toplevel form:&#xA;my-magit.el:10:7:Warning: assignment to free variable&#xA;    ‘magit-last-seen-setup-instructions’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I try and changing to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar magit-last-seen-setup-instructions &quot;1.4.0&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works well, without warning, the difference with setq is that after that if another defvar is applied to this variable will ahve no effect, but could I apply it to the other variables like this or I will have issues for that. Another doubt is that I believe that this variable is defined in the package magit that is loaded previously. so I do not get why I get this warning. &lt;/p&gt;&#xA;" OwnerUserId="8892" LastEditorUserId="105" LastEditDate="2022-09-18T17:26:36.063" LastActivityDate="2022-09-18T17:26:36.063" Title="Warning assigning variables" Tags="|magit|variables|byte-compilation|warning|defvar|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29368" PostTypeId="1" CreationDate="2016-12-17T19:36:39.013" Score="3" ViewCount="202" Body="&lt;p&gt;I'm doing literate programming with Python. In my workflow I like to test the block with python-shell-send-buffer and ipdb debugger. However if the block contains a noweb reference then the code is not expanded when sent to the shell and causes syntax error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively I can C-c C-c C-v (org-babel-expand-src-block) and get a read-only version of the buffer with noweb expanded and send this instead. This is not great for interactive work though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I cause python-shell-send-buffer to call org-babel-expand-src-block beforehand, and maintain the noweb references in the C-c ' edit buffer?&lt;/p&gt;&#xA;" OwnerUserId="14283" LastActivityDate="2016-12-17T19:36:39.013" Title="Org-babel noweb expansion when sending C-c ' buffer to python shell" Tags="|org-mode|org-babel|python|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29369" PostTypeId="2" ParentId="29350" CreationDate="2016-12-17T19:42:29.447" Score="5" Body="&lt;p&gt;I'm not sure I understand what's so great about not highlighting the&#xA;lines first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, selecting them is easy. The vi command &lt;code&gt;:20,2003s/foo/bar/g&amp;lt;CR&amp;gt;&lt;/code&gt; would be something like: &lt;code&gt;M-g M-g 20 RET C-SPC M-g M-g 2004 RET M-% foo RET bar RET !&lt;/code&gt;. Yes, the vi version is a full 3 keypresses shorter, and easier to type, but the Emacs one is not too bad. If you plan on doing lots of stuff to that same range of lines besides the search and replace, I recommend using &lt;code&gt;narrow-to-region&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2016-12-19T18:24:56.197" LastActivityDate="2016-12-19T18:24:56.197" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29370" PostTypeId="2" ParentId="29367" CreationDate="2016-12-17T20:17:55.643" Score="1" Body="&lt;p&gt;You declare variables as global with &lt;code&gt;defvar&lt;/code&gt; and optionally initialize them. When you use the &lt;code&gt;setq&lt;/code&gt; the variable apparently hasn't been declared. It sounds like what your after is this construction &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo)&#xA;(setq foo &quot;foo&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first tells the compiler that &lt;code&gt;foo&lt;/code&gt; is a global (dynamic) variable. The second sets it unconditionally. &lt;/p&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2016-12-17T20:17:55.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29371" PostTypeId="1" AcceptedAnswerId="29372" CreationDate="2016-12-17T20:22:31.700" Score="4" ViewCount="784" Body="&lt;p&gt;In an org-mode agenda, how can I shift the time of an item by minutes or hours?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;Shift - Right Arrow&lt;/kbd&gt; shifts by one day, but I want to shift by hours or minutes.&lt;/p&gt;&#xA;" OwnerUserId="256" LastActivityDate="2016-12-20T23:07:28.357" Title="Shift times in org agenda by minutes or hours instead of days" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29372" PostTypeId="2" ParentId="29371" CreationDate="2016-12-17T20:50:39.313" Score="8" Body="&lt;p&gt;The command you are calling with your binding is&#xA;&lt;code&gt;org-agenda-do-date-later&lt;/code&gt;.  As of my &lt;code&gt;org&lt;/code&gt; version,&#xA;&lt;code&gt;describe-function&lt;/code&gt; tells me that there is no docstring for that&#xA;function:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;(org-agenda-do-date-later ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Not documented.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, it &lt;em&gt;does&lt;/em&gt; take an argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you follow the link to the source code for that function, it&#xA;indicates that, if you pass a prefix argument to that command, it&#xA;will call &lt;code&gt;org-agenda-date-later-hours&lt;/code&gt;.  If you pass it two&#xA;prefixes, it will call &lt;code&gt;org-agenda-date-later-minutes&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To delay an item by a day, use &lt;kbd&gt;shift&lt;/kbd&gt;&lt;kbd&gt;right arrow&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;To delay an item by an hour, use &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;shift&lt;/kbd&gt;&lt;kbd&gt;right arrow&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;To delay an item by 5 minutes, use &lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;C-u&lt;/kbd&gt;&lt;kbd&gt;shift&lt;/kbd&gt;&lt;kbd&gt;right arrow&lt;/kbd&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The 5 comes from the variable &lt;code&gt;org-time-stamp-rounding-minutes&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-12-20T23:07:28.357" LastActivityDate="2016-12-20T23:07:28.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29373" PostTypeId="2" ParentId="29361" CreationDate="2016-12-17T21:02:01.577" Score="3" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl) ;; for `copy-list'&#xA;&#xA;(let* ((frame-list (frame-list))&#xA;       (current-frame (selected-frame))&#xA;       (result&#xA;         (delq nil&#xA;           (mapcar&#xA;             (lambda (frame)&#xA;               (with-selected-frame frame&#xA;                 (when (one-window-p)&#xA;                   (with-current-buffer (car (buffer-list frame))&#xA;                     (if (and buffer-file-name (file-exists-p buffer-file-name))&#xA;                       (list frame buffer-file-name))))))&#xA;           frame-list)))&#xA;       (destructable-result (copy-list result)))&#xA;  (mapc&#xA;    (lambda (x)&#xA;      (setq destructable-result (delq x destructable-result))&#xA;      (mapc&#xA;         (lambda (y)&#xA;           (when (equal (cdr x) (cdr y))&#xA;             (if (eq (car x) current-frame)&#xA;                (when (frame-live-p (car y))&#xA;                  (delete-frame (car y))&#xA;                  (setq destructable-result (delq y destructable-result)))&#xA;                (when (frame-live-p (car x))&#xA;                  (delete-frame (car x))))))&#xA;         destructable-result))&#xA;    result))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SHOW YOUR WORK&lt;/strong&gt;:  One of the concerns @lawlist had while creating the above-mentioned solution was whether altering &lt;code&gt;destructable-result&lt;/code&gt; during an ongoing &lt;code&gt;mapc&lt;/code&gt; loop that uses the previous value for &lt;code&gt;SEQUENCE&lt;/code&gt; (i.e., prior to its altercation) would throw an error.  The following example demonstrates that this is a non-issue.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((my-list '(0 1 2 3 4 5 6 7 8 9)))&#xA;  (mapc&#xA;    (lambda (x)&#xA;      (when my-list&#xA;        (setq my-list nil))&#xA;      (message &quot;x: %s | my-list: %s&quot; x my-list))&#xA;    my-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-23T03:31:25.797" LastActivityDate="2016-12-23T03:31:25.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29374" PostTypeId="1" AcceptedAnswerId="29378" CreationDate="2016-12-17T21:19:27.057" Score="2" ViewCount="527" Body="&lt;p&gt;Why does Elisp &lt;code&gt;(member '3 '(1 2 3 4 5 6))&lt;/code&gt; return &lt;code&gt;(3 4 5 6)&lt;/code&gt; instead of &lt;code&gt;t&lt;/code&gt; (true) or &lt;code&gt;3&lt;/code&gt;, or &lt;code&gt;(3)&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see the utility of a function to return the remainder/tail of an ordered list starting from, and including the delimiter element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why have it as a &quot;side-effect&quot; to the function for checking existence in a set?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ever since I first read about &lt;code&gt;member&lt;/code&gt;, I wondered about this, but quietly accepted. Now recently this topic came up, and I have a few ideas, like this being about keeping the number of C-primitives low by adding semantics to the non-false return values? Or is it a &quot;hold-over&quot; from the math paper(s) all of Lisp derived from? Or something else? Is there a (definitive) source out there?&lt;/p&gt;&#xA;" OwnerUserId="12504" LastEditorUserId="2096" LastEditDate="2016-12-18T11:20:39.403" LastActivityDate="2016-12-18T11:20:39.403" Title="Why does the member function return a list's tail rather than t?" Tags="|list|history|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29375" PostTypeId="2" ParentId="29374" CreationDate="2016-12-17T21:29:51.670" Score="1" Body="&lt;p&gt;Every non-nil value in elisp is true, and it might be useful to just return the list starting at the matching value.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2016-12-17T21:29:51.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29376" PostTypeId="2" ParentId="29374" CreationDate="2016-12-17T21:32:13.597" Score="2" Body="&lt;p&gt;It's not a side effect, it's the return value of the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every function returns something.  In elisp, every non-&lt;code&gt;nil&lt;/code&gt;&#xA;value (and &lt;code&gt;(eq nil '())&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt;) is treated as a boolean&#xA;true.  So rather than suppress information by returning &lt;code&gt;t&lt;/code&gt;, the&#xA;function gives you the list from the matching element on, which&#xA;you are free to use or discard as you see fit.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-12-17T21:32:13.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29377" PostTypeId="2" ParentId="29374" CreationDate="2016-12-17T22:29:05.257" Score="3" Body="&lt;p&gt;I wasn't in their head when the original coders of those Lisp primitives made this choice, but my guess is that it seemed like the most useful non-nil value to return among those that were available without doing any extra work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IOW somewhere along the lines of &quot;keeping the number of C-primitives low by adding semantics to the non-false return values&quot;, except that it's not just the number of primitives but also the overall efficiency of the programs.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-12-17T22:29:05.257" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29378" PostTypeId="2" ParentId="29374" CreationDate="2016-12-17T22:30:15.983" Score="6" Body="&lt;p&gt;This is a general Lisp question - a question about Lisp lists. It is not special to Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answers you are getting are all correct, and they say the same thing, so far.  You apparently don't want to hear the answer. ;-) And no, they are &lt;em&gt;not&lt;/em&gt; just rephrasing your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is, as others have said, that the return value is &lt;em&gt;useful&lt;/em&gt; beyond its use as a Boolean indication of membership.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider, for example, that by returning that tail it tells you also &lt;em&gt;how far from the end&lt;/em&gt; of the list the member is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it provides an actual tail of the list argument - &lt;strong&gt;&lt;em&gt;same&lt;/em&gt;&lt;/strong&gt; list, which is important when you are dealing with &lt;em&gt;list structure&lt;/em&gt; (not copies of lists).&#xA;For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo  '(1 2 3 4 5 6))&#xA;(setcdr (member 3 foo) '(8 9 42))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;foo&lt;/code&gt; is &lt;code&gt;(1 2 3 8 9 42)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember too that what is returned is essentially a pointer - the cost is negligible. &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-17T22:30:15.983" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29379" PostTypeId="1" AcceptedAnswerId="29388" CreationDate="2016-12-17T23:03:05.883" Score="1" ViewCount="447" Body="&lt;p&gt;I've been working in a large Ruby project using Vim with ctags. I have a git hook that generates an up-to-date tags file whenever I commit/pull/etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It basically boils down to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git ls-files | \&#xA;  ctags --tag-relative=yes -L - -f &quot;.git/tags&quot; --languages=-javascript,sql&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It takes about 1 second to run, and results in a 7MB tags file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to start using Emacs for this project, but generating etags takes well over a minute and outputs an &lt;strong&gt;&lt;em&gt;8GB&lt;/em&gt;&lt;/strong&gt; TAGS file. Here's the command I'm using to generate etags (only differences from the previous command are the &lt;code&gt;-e&lt;/code&gt; flag and the &lt;code&gt;TAGS&lt;/code&gt; filename:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git ls-files | \&#xA;  ctags --tag-relative=yes -L - -e -f &quot;.git/TAGS&quot; --languages=-javascript,sql&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is it such a huge file, and is there a better tags solution I can try?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2016-12-18T11:07:24.277" Title="Feasible tags solution for a large Ruby codebase?" Tags="|ctags|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29380" PostTypeId="1" AcceptedAnswerId="29382" CreationDate="2016-12-17T23:22:06.140" Score="1" ViewCount="261" Body="&lt;p&gt;A BASH completes &lt;code&gt;..&lt;/code&gt; to &lt;code&gt;../&lt;/code&gt; when pressing &lt;kbd&gt;tab&lt;/kbd&gt;, that is, it just adds a forward slash. Tiny as it might seem, I'm so used to this behaviour that I desperately miss it in eshell. Is there a way to add it?  &lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="12336" LastEditDate="2016-12-17T23:32:38.787" LastActivityDate="2016-12-18T00:14:04.607" Title="How to complete `..` to `../` in eshell" Tags="|completion|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29381" PostTypeId="1" AcceptedAnswerId="29384" CreationDate="2016-12-17T23:49:12.387" Score="3" ViewCount="194" Body="&lt;p&gt;How can I let the cursor colour depend on the current input method?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2016-12-18T06:24:26.500" LastActivityDate="2016-12-18T06:24:26.500" Title="Cursor colour based on input method" Tags="|cursor|input-method|coloring|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29382" PostTypeId="2" ParentId="29380" CreationDate="2016-12-18T00:08:47.810" Score="2" Body="&lt;p&gt;&lt;code&gt;eshell&lt;/code&gt; needs some context to know how to complete, so the following example assumes we have some context like typing &lt;code&gt;cd ..&lt;/code&gt; and then the tab key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default value for &lt;code&gt;eshell-cmpl-dir-ignore&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\`\\(\\.\\.?\\|CVS\\)/\\'&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;pcomplete-dir-ignore&lt;/code&gt; is made buffer-local by &lt;code&gt;eshell&lt;/code&gt; and set to the value of &lt;code&gt;eshell-cmpl-dir-ignore&lt;/code&gt;.  [See the function &lt;code&gt;eshell-cmpl-initialize&lt;/code&gt;.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Prior&lt;/em&gt; to opening up an &lt;code&gt;eshell&lt;/code&gt; buffer, evaluate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq eshell-cmpl-dir-ignore &quot;\\`\\(CVS\\)/\\'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, &lt;em&gt;after&lt;/em&gt; opening an &lt;code&gt;eshell&lt;/code&gt; buffer, in the active buffer evaluate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq pcomplete-dir-ignore &quot;\\`\\(CVS\\)/\\'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, simply put the previous example setting the value of &lt;code&gt;eshell-cmpl-dir-ignore&lt;/code&gt; in your &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;init.el&lt;/code&gt; file and restart Emacs.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-18T00:14:04.607" LastActivityDate="2016-12-18T00:14:04.607" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29383" PostTypeId="2" ParentId="24750" CreationDate="2016-12-18T02:09:54.417" Score="1" Body="&lt;p&gt;An alternative solution to Lompik's is to simply downgrade to ipython4. This might be better anyway, because --simple-prompt argument that lompik suggests removes many of the great features of ipython. For example, now you rely on elpy to do completions, and you can't have multi-line input&lt;/p&gt;&#xA;" OwnerUserId="6554" LastActivityDate="2016-12-18T02:09:54.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29384" PostTypeId="2" ParentId="29381" CreationDate="2016-12-18T02:10:39.650" Score="4" Body="&lt;p&gt;That's exactly what you get with library &lt;a href=&quot;http://www.emacswiki.org/emacs/download/cursor-chg.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;cursor-chg.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just turn on minor mode &lt;strong&gt;&lt;code&gt;change-cursor-mode&lt;/code&gt;&lt;/strong&gt;, and leave option &lt;strong&gt;&lt;code&gt;curchg-change-cursor-on-input-method-flag&lt;/code&gt;&lt;/strong&gt; with its default value of &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cursor color when an input method is used is controlled by option &lt;strong&gt;&lt;code&gt;curchg-input-method-cursor-color&lt;/code&gt;&lt;/strong&gt; (default value &lt;code&gt;&quot;Orange&quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If you do &lt;em&gt;not&lt;/em&gt; also want the cursor color to change to indicate when a buffer is read-only or is in overwrite mode, then set option &lt;code&gt;curchg-change-cursor-on-overwrite/read-only-flag&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Emacs-Wiki page &lt;a href=&quot;https://www.emacswiki.org/emacs/ChangingCursorDynamically&quot; rel=&quot;nofollow noreferrer&quot;&gt;Change Cursor Dynamically&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-18T02:10:39.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29385" PostTypeId="1" AcceptedAnswerId="29389" CreationDate="2016-12-18T07:13:07.377" Score="2" ViewCount="1950" Body="&lt;p&gt;Currently i have around 25 org files each with multiple headings. Everytime i want to go over my notes, i need to &lt;em&gt;remember&lt;/em&gt; the name of the file and open it (faster if its in buffer, else i need to go to the org folder)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to generate a TOC of files/heading1 for all files under the &lt;code&gt;org-directory&lt;/code&gt; and place it under an &lt;code&gt;index.org&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S: Google did not return any good package!&lt;/p&gt;&#xA;" OwnerUserId="14289" LastActivityDate="2016-12-19T23:23:37.040" Title="Generate a TOC (index.org) file out our headings from all org files" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29386" PostTypeId="1" AcceptedAnswerId="29479" CreationDate="2016-12-18T08:11:32.003" Score="2" ViewCount="2170" Body="&lt;p&gt;My exported pdf and and .tex file both include a name inherited from the logged-in unix account, I am having trouble over-riding this setting with #+LATEX_HEADER: \author {}  in the .org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Watch for &lt;strong&gt;Tom Smith&lt;/strong&gt; vs. &lt;strong&gt;Joe Brown&lt;/strong&gt; in this code.&#xA;The question is, where does org-mode derive the &lt;strong&gt;Tom Smith&lt;/strong&gt; from?&#xA;my .bib file includes the lines at the top, I don't see any setting to explain this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% This BibTeX bibliography file was created using BibDesk.&#xA;% Created for Tom Smith at YYYY day t&#xA;% Saved with string encoding Unicode (UTF-8) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my .org file says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER:\author{Joe Brown}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I look in the exported .tex it has 2 lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\author{Joe Brown}&#xA;\author{Tom Smith}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the compiled pdf features &lt;strong&gt;Tom Smith&lt;/strong&gt;&#xA;Where does org-mode get the \author field from if it's not declared in &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER:\author{} ?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it coming from ~/.emacs.d/.init.d ?&#xA;Neither &lt;strong&gt;Tom Smith&lt;/strong&gt; nor &lt;strong&gt;author&lt;/strong&gt; are anywhere in my .spacemacs.&lt;/p&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="10898" LastEditDate="2016-12-21T11:47:05.963" LastActivityDate="2016-12-21T13:59:44.900" Title="where does org-mode get the \author field for latex output" Tags="|org-mode|org-export|latex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29387" PostTypeId="2" ParentId="29386" CreationDate="2016-12-18T08:16:40.280" Score="-2" Body="&lt;p&gt;Emacs &lt;strong&gt;documentation&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x describe variable user-full-name&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;user-full-name is a variable defined in ‘C source code’.&#xA;Its value is &quot;Tom Smith&quot;  ::&#xA;The full name of the user logged in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;strong&gt;customize&lt;/strong&gt; this variable.&lt;br&gt;&#xA;&lt;strong&gt;solution&lt;/strong&gt;: Click on &lt;strong&gt;customize&lt;/strong&gt; and change to Joe Brown inside emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;further explanation&lt;/strong&gt;: the full name of the logged in user is not the same as your short-account-name.  It can be obtained from a shell prompt by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;finger `whoami` | awk -F: '{ print $3 }' | head -n1 | sed 's/^ //'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you desire the pdfs you write in org mode to have a different name than your unix user full name, you can override the value inherited from the os.&lt;/p&gt;&#xA;" OwnerUserId="10898" LastEditorUserId="10898" LastEditDate="2016-12-21T11:44:39.113" LastActivityDate="2016-12-21T11:44:39.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29388" PostTypeId="2" ParentId="29379" CreationDate="2016-12-18T11:07:24.277" Score="2" Body="&lt;p&gt;The &lt;code&gt;etags&lt;/code&gt; program that comes with Emacs is a solid option. In 25.1, Eli added Ruby support, as well as fixed some parsing problems that are still present in the commonly used version of &lt;code&gt;ctags&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Why 8GB&quot; is a good question, though. To try to answer it, you can open the  generated file and look inside. The contents are mostly human-readable. Does it have ridiculously long lines or simply garbage entries (that don't correspond to any symbols)? Does it have duplicates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you find the problem, it would be good to report it to &lt;a href=&quot;https://github.com/universal-ctags/ctags/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/universal-ctags/ctags/&lt;/a&gt;, which is the new project home. You might want to build and try their version first, though, there are quite a few fixes there that still haven't found their way into the popular GNU/Linux distributions.&lt;/p&gt;&#xA;" OwnerUserId="124" LastActivityDate="2016-12-18T11:07:24.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29389" PostTypeId="2" ParentId="29385" CreationDate="2016-12-18T13:57:44.317" Score="1" Body="&lt;p&gt;There are a couple of options. I would not create a permanent index.org file, because it would take some extra effort to keep it up to to date. If you don't mind installing f.el and helm, here is a dynamic way to get a list of all the headings.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-toc ()&#xA;  &quot;Generate a table of contents for org-files in this directory.&quot;&#xA;  (interactive)&#xA;  (let ((org-agenda-files (f-entries &quot;.&quot; (lambda (f) (f-ext? f &quot;org&quot;)) t)))&#xA;    (helm-org-agenda-files-headings)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you really want a buffer with headlines, you could try this approach to make a temporary buffer with links to the headlines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-toc ()&#xA;  (interactive)&#xA;  (let ((headings (delq nil (loop for f in (f-entries &quot;.&quot; (lambda (f) (f-ext? f &quot;org&quot;)) t)&#xA;                  append&#xA;                  (with-current-buffer (find-file-noselect f)&#xA;                    (org-map-entries&#xA;                     (lambda ()&#xA;                       (when (&amp;gt; 2 (car (org-heading-components)))&#xA;                     (cons f (nth 4 (org-heading-components)))))))))))&#xA;    (switch-to-buffer (get-buffer-create &quot;*toc*&quot;))&#xA;    (erase-buffer)&#xA;    (org-mode)&#xA;    (loop for (file . heading) in headings &#xA;      do&#xA;      (insert (format &quot;* [[%s::*%s]]\n&quot; file heading)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-18T13:57:44.317" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29390" PostTypeId="2" ParentId="29367" CreationDate="2016-12-18T14:16:32.600" Score="1" Body="&lt;p&gt;&lt;code&gt;magit-last-seen-setup-instructions&lt;/code&gt; was not well received and has been removed. Also, when it was still in use, you were supposed to set it before loading &lt;code&gt;magit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;magit-log-edit-mode-hook&lt;/code&gt; is also obsolete. &lt;code&gt;magit-log-edit.el&lt;/code&gt; was removed three years ago and support was completely removed two and a half years ago. It's place was taken by &lt;code&gt;git-commit.el&lt;/code&gt; and the hook to use now is &lt;code&gt;git-commit-setup-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-12-18T14:16:32.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29391" PostTypeId="2" ParentId="29349" CreationDate="2016-12-18T14:25:49.287" Score="1" Body="&lt;p&gt;You could do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let (last  ov)&#xA;  (while (re-search-forward &quot;[0-9]\\{4\\}-[01][1-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]&quot; nil t)&#xA;    (when last&#xA;      (when (&amp;lt; 2 (- (float-time (date-to-time (match-string 0)))&#xA;            (float-time (date-to-time last))))&#xA;    (setq ov (make-overlay (line-beginning-position) (line-end-position)))&#xA;    (ov-put ov 'face '(:foreground &quot;red&quot;))))&#xA;    (setq last (match-string 0))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This could be in a function you run on a buffer (maybe in a hook function?) containing the log, and it will make any line that happens more than two seconds after the previous line red.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-18T14:25:49.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29392" PostTypeId="1" AcceptedAnswerId="50136" CreationDate="2016-12-18T16:57:51.023" Score="2" ViewCount="173" Body="&lt;p&gt;Is it possible to have &lt;code&gt;linum-relative&lt;/code&gt; disregard folding?  The default works poorly with evil &lt;code&gt;&amp;lt;count&amp;gt;j/k&lt;/code&gt;-jumping and ex-commands such as &lt;code&gt;-13t.&lt;/code&gt; in org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(To comments: I said 'screen lines' but that's not what I meant. Sorry.)&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2017-01-10T22:17:32.310" LastActivityDate="2019-05-24T19:03:40.483" Title="Can linum-relative disregard folding?" Tags="|linum-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29393" PostTypeId="1" AcceptedAnswerId="29395" CreationDate="2016-12-18T17:42:47.897" Score="0" ViewCount="335" Body="&lt;p&gt;As the title says, I want a number of things to happen when I open an org-mode file: I want a Racket REPL session to start (as in a code block &lt;code&gt;:session mysess1&lt;/code&gt;) and I want various Racket environment-library things to happen, e.g., initialize &lt;code&gt;(require math)&lt;/code&gt;. I've thought about Emacs local file variables, but not sure how it can first start a particular named REPL session, then run the &lt;code&gt;(require math)&lt;/code&gt;. There is also the org mode tag &lt;code&gt;#+STARTUP&lt;/code&gt;, but again I'm not sure how that would happen. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2016-12-18T21:12:02.303" Title="How to initialize Racket libraries, environment at org-mode buffer startup" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29394" PostTypeId="2" ParentId="5957" CreationDate="2016-12-18T21:06:58.077" Score="1" Body="&lt;p&gt;After some testing, I saw the solution, based on the hook &lt;code&gt;after-change-major-mode-hook&lt;/code&gt;, proposed in the question,  works most of the time  to modify the scratch buffer name. Anyway, when killing  &lt;code&gt;scratch&lt;/code&gt; (with the modified name) and when it is the only Emacs  buffer, &lt;code&gt;*scratch*&lt;/code&gt; might be recreated without triggering (the change-mode hook and therefore) the name modification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid this, it is sufficient not to allow to kill &lt;code&gt;scratch&lt;/code&gt;  when it is the last buffer.&#xA;Therefore we need to add a proper hook to &lt;code&gt;kill-buffer-query-functions&lt;/code&gt; which returns &lt;code&gt;nil&lt;/code&gt; in this instance (&lt;code&gt;nil&lt;/code&gt; causes Emacs not execute the kill). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'kill-buffer-query-functions 'check-scratch)&#xA;(defun check-scratch ()&#xA;  (let ((bufs (remq nil&#xA;            (mapcar&#xA;             #'(lambda (x) (string-match &quot;^[^ ]&quot; x)) &#xA;             (mapcar 'buffer-name (buffer-list))))))&#xA;    (if (and (not (buffer-modified-p))&#xA;         (string= (buffer-name) &quot;scratch&quot;) &#xA;         (eq (length bufs) 1))&#xA;    nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2016-12-18T21:06:58.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29395" PostTypeId="2" ParentId="29393" CreationDate="2016-12-18T21:12:02.303" Score="1" Body="&lt;p&gt;I would make a named src block that sets up the racket env you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, use a local variable to go to that block and execute it. Maybe something like this:;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: setup&#xA;#+BEGIN_SRC racket :session mysess1&#xA;(require math)&#xA;#+END_SRC&#xA;&#xA;&#xA;# Local Variables:&#xA;# eval: (progn (org-babel-goto-named-src-block &quot;setup&quot;) (org-babel-execute-src-block))&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will probably get pestered with getting asked to evaluate the local variable when you open the file, but I think this will do what you want.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-18T21:12:02.303" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29396" PostTypeId="1" CreationDate="2016-12-18T21:49:34.853" Score="0" ViewCount="388" Body="&lt;p&gt;I get this error message when trying to configure CEDET:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's function definition is void: ´cedet-gnu-global-version-check´&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is my elisp code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'auto-complete)    ; start auto-complete with emacs&#xA;(require 'auto-complete-config) ; do default config for auto-complete&#xA;(require 'yasnippet)        ; start yasnippet with emacs&#xA;(require 'cc-mode)&#xA;(require 'semantic)&#xA;(require 'semantic/ia)&#xA;(require 'semantic/bovine/gcc)&#xA;&#xA;;; Enables global support for Semanticdb&#xA;(global-semanticdb-minor-mode 1)&#xA;&#xA;;; Activates automatic parsing of source code in the idle time;&#xA;(global-semantic-idle-scheduler-mode 1)&#xA;&#xA;;; Activates highlighting of first line for current tag (function, class, etc.);&#xA;(global-semantic-stickyfunc-mode 1)&#xA;&#xA;;; Activates displaying of possible name completions in the idle&#xA;;; time. Requires that global-semantic-idle-scheduler-mode was enabled;&#xA;(global-semantic-idle-completions-mode 1)&#xA;&#xA;(setq-mode-local c-mode semanticdb-find-default-throttle&#xA;             '(project unloaded system recursive))&#xA;&#xA;(semantic-mode 1)&#xA;&#xA;(when (cedet-gnu-global-version-check t)&#xA;  (semanticdb-enable-gnu-global-databases 'c-mode)&#xA;  (semanticdb-enable-gnu-global-databases 'c++-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Did I forget something? How do I find the function in question?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="12142" LastEditorUserId="253" LastEditDate="2016-12-19T23:06:57.900" LastActivityDate="2016-12-19T23:06:57.900" Title="Missing function in CEDET?" Tags="|package|cedet|load-path|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29397" PostTypeId="2" ParentId="16818" CreationDate="2016-12-19T00:24:40.087" Score="10" Body="&lt;p&gt;Emacs doesn't allow fonts that have hyphens in them. I would rename the font to something that doesn't contain hyphens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this using &lt;a href=&quot;https://github.com/fonttools/fonttools&quot; rel=&quot;noreferrer&quot;&gt;ttx&lt;/a&gt;. For example, assuming you have a font named &lt;code&gt;Inconsolata-dz for Powerline.otf&lt;/code&gt; in your current working directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Convert the font to ttx format (an xml-like font format)&#xA;ttx &quot;Inconsolata-dz for Powerline.otf&quot;&#xA;&#xA;# Replace all instances of &quot;Inconsolata-dz&quot; with &quot;InconsolataDZ&quot; in the ttx file&#xA;sed -i 's/Inconsolata-dz/InconsolataDZ/g' &quot;Inconsolata-dz for Powerline.ttx&quot;&#xA;&#xA;# Convert the resulting ttx file back to an otf file. &#xA;# (Will create a file called &quot;Inconsolata-dz for Powerline#1.otf&quot;.)&#xA;ttx &quot;Inconsolata-dz for Powerline.ttx&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then rename the produced &lt;code&gt;otf&lt;/code&gt; file to whatever you want and move it to your fonts directory.&lt;/p&gt;&#xA;" OwnerUserId="13650" LastActivityDate="2016-12-19T00:24:40.087" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29398" PostTypeId="1" CreationDate="2016-12-19T00:48:51.553" Score="2" ViewCount="167" Body="&lt;p&gt;I have started to use  the  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/ses/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Simple Emacs Spreadsheet&lt;/a&gt; (SES) with &#xA;GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-17.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to mark/highlight a column with &lt;code&gt;(ses-mark-column)&lt;/code&gt;, the selection doesn't operate in vertical mode. The same happens if I set mark at point and move the cursor to the upper or lower cells.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result of this, copy, cut, and paste does not work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I set the mark an move  vertically with arrows, what is highlighted is also copied and pasted, so also adjacent columns.&lt;br&gt;&#xA;With &lt;code&gt;(ses-mark-column)&lt;/code&gt;, when I try to copy, I get the  &quot;Empty range&quot; message in the minibuffer, which in the message buffer is written as &lt;code&gt;ses-copy-region-helper: Empty range&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is to make the question reproducible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After opening a new buffer and setting &lt;code&gt;M-x ses-mode&lt;/code&gt;, I fill the buffer/spreadsheet as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LanxVm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LanxVm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After placing the cursor in cell &lt;code&gt;B2&lt;/code&gt;, typing  &lt;code&gt;(ses-mark-column)&lt;/code&gt;, or the related key binding &lt;code&gt;S-M-h&lt;/code&gt;, gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/q56uOm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/q56uOm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this is not what a column selection is supposed to be.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="3975" LastEditDate="2016-12-20T01:30:02.490" LastActivityDate="2016-12-20T10:47:37.713" Title="Error using the Emacs Spreadsheet" Tags="|mark|table|spreadsheet|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29399" PostTypeId="1" CreationDate="2016-12-19T02:37:27.567" Score="7" ViewCount="491" Body="&lt;p&gt;With point on a TODO item in an &lt;code&gt;.org&lt;/code&gt; file, I can use &lt;code&gt;org-deadline&lt;/code&gt; (&lt;code&gt;C-c C-d&lt;/code&gt;) to insert a deadline for the TODO. &lt;strong&gt;Is there any way to do this, and specify a repeater (e.g., &lt;code&gt;+1w&lt;/code&gt;) at the same time?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I add a deadline using the method described above, then navigate to the end of the timestamp and manually add the repeater to the stamp. It doesn't seem like it will be possible from the &lt;code&gt;org-deadline&lt;/code&gt; UI, because in that context &lt;code&gt;+1w&lt;/code&gt; represents a delta (&quot;a week from...&quot;) rather than a repeating interval. I have also looked through the documentation, and tried searching Emacs for commands of the form &lt;code&gt;org*repeat*&lt;/code&gt;, but haven't come up with anything yet. However, it seems like a fairly common task, so I assumed there would be a related command.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2016-12-19T04:58:17.047" Title="Specify repeater when setting deadline for org-mode TODO" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29400" PostTypeId="2" ParentId="29399" CreationDate="2016-12-19T04:58:17.047" Score="4" Body="&lt;p&gt;[See initial comment underneath the original question for a more robust idea that requires substantial hacking.]&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-deadline (arg &amp;amp;optional time repeat)&#xA;(interactive &quot;P&quot;)&#xA;  (let ((org-time-stamp-formats&#xA;          (if repeat&#xA;            `(,(concat &quot;&amp;lt;%Y-%m-%d %a &quot; repeat &quot;&amp;gt;&quot;) .&#xA;              ,(concat &quot;&amp;lt;%Y-%m-%d %a %H:%M &quot; repeat &quot;&amp;gt;&quot;))&#xA;             org-time-stamp-formats)))&#xA;    (org-deadline arg time)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example Usage&lt;/strong&gt;:  &lt;code&gt;(my-org-deadline nil &quot;December 19, 2016 08:00&quot; &quot;+1w&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-12-19T04:58:17.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29401" PostTypeId="1" AcceptedAnswerId="29402" CreationDate="2016-12-19T07:47:53.810" Score="2" ViewCount="132" Body="&lt;p&gt;so im trying to create a simple script to create a directory in dired with a pre defined string (the current date). i have another script that inputs the current date in a format i want&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z-insert-date (&amp;amp;optional addTimeStamp-p)&#xA;&#xA;&quot;Insert current date and or time. In this format yyyy-mm-dd.&#xA; When called with `universal-argument', insert date and time, e.g.    2012-05-28T07:06:23-07:00&#xA;Replaces text selection.See also `current-date-time-string'.&quot;&#xA;(interactive &quot;P&quot;)&#xA;(when (region-active-p) (delete-region (region-beginning) (region- end)   ) )&#xA;(cond&#xA;((equal addTimeStamp-p nil ) (insert (format-time-string &quot;%d%m%Y&quot;)))&#xA;(t (insert (current-date-time-string))) ) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;now im struggling how to bring it all togheter. i have this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z/dired-insert-date-folder ()&#xA; &quot;&quot;&#xA; (interactive)&#xA; (dired-create-directory (z-insert-date))&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this dosent work and dosent seem the proper way to do it :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can anyone point me in the right direction? maybe the &lt;code&gt;z-insert-date function&lt;/code&gt; isnt really needed (i want my date to have the format of &lt;code&gt;%d%m%Y&lt;/code&gt;though&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-12-19T12:35:30.650" Title="simple function in dired to create a dir with current date?" Tags="|dired|functions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29402" PostTypeId="2" ParentId="29401" CreationDate="2016-12-19T07:59:40.823" Score="6" Body="&lt;p&gt;You seem to be over thinking this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z/dired-insert-date-folder ()&#xA;  &quot;Create new directory with current date&quot;&#xA;  (interactive)&#xA;  (dired-create-directory (format-time-string &quot;%d%m%Y&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your reasons are your own of course, but a format of &lt;code&gt;%Y%m%d&lt;/code&gt; does tend to sort better.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-12-19T07:59:40.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29405" PostTypeId="2" ParentId="29401" CreationDate="2016-12-19T12:35:30.650" Score="0" Body="&lt;p&gt;Function &lt;code&gt;dired-create-directory&lt;/code&gt; expects a string as an argument. Your function &lt;code&gt;z-insert-date&lt;/code&gt; that you use as the argument has some minor issues in addition to not returning anything. It only inserts the string in the current buffer. &lt;/p&gt;&#xA;" OwnerUserId="903" LastActivityDate="2016-12-19T12:35:30.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29406" PostTypeId="1" CreationDate="2016-12-19T13:11:12.827" Score="0" ViewCount="109" Body="&lt;p&gt;I'm really confused with what's happening here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my config for backups I've the line &lt;code&gt;(setq backup-directory-alist '((&quot;&quot; . &quot;~/.emacs.d/backup/per-save&quot;)))&lt;/code&gt; and I've a defined a variable in my &lt;code&gt;init.el&lt;/code&gt; like so: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar user-home-directory (concat (getenv &quot;HOME&quot;) &quot;/&quot;)) &#xA;(setq user-emacs-directory (concat user-home-directory &quot;.emacs.d/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to redefine &lt;code&gt;backup-directory-alist&lt;/code&gt; like so: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq backup-directory-alist '((&quot;&quot; . ((concat user-emacs-directory &quot;backup/per-save/&quot;)))))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm getting the &lt;code&gt;wrong type argument stringp&lt;/code&gt; everytime I try to save the file. What's going on! What am I doing wrong with &lt;em&gt;alist&lt;/em&gt; value data.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="14825" LastEditDate="2020-05-29T17:14:05.107" LastActivityDate="2020-05-29T17:14:05.107" Title="alist error when value created using (concat string1 string2)" Tags="|backquote|" AnswerCount="0" CommentCount="2" ClosedDate="2016-12-19T15:46:40.540" ContentLicense="CC BY-SA 3.0" />
  <row Id="29407" PostTypeId="1" AcceptedAnswerId="29410" CreationDate="2016-12-19T15:00:19.360" Score="5" ViewCount="2918" Body="&lt;p&gt;This might have an obvious answer but I've been trying to fix this issue with no luck. (I'm new to Emacs)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I start Emacs within a Tmux pane, it ignores some of my .emacs settings. These are the contents of the .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;;; custom-set-variables was added by Custom.                                                                                                                                             &#xA;;; If you edit it by hand, you could mess it up, so be careful.                                                                                                                          &#xA;;; Your init file should contain only one such instance.                                                                                                                                 &#xA;;; If there is more than one, they won't work right.                                                                                                                                     &#xA;'(ansi-color-faces-vector&#xA;[default default default italic underline success warning error])&#xA;'(cua-mode t nil (cua-base))&#xA;'(show-paren-mode t)&#xA;'(tool-bar-mode nil))&#xA;&#xA;(custom-set-faces&#xA;;; custom-set-faces was added by Custom.                                                                                                                                                 &#xA;;; If you edit it by hand, you could mess it up, so be careful.                                                                                                                          &#xA;;; Your init file should contain only one such instance.                                                                                                                                 &#xA;;; If there is more than one, they won't work right.                                                                                                                                     &#xA;)&#xA;&#xA;;;Initial GUI frame size and position                                                                                                                                                     &#xA;(when window-system (set-frame-size (selected-frame) 160 50))&#xA;&#xA;;; Resizing window quick shortcuts                                                                                                                                                        &#xA;(global-set-key (kbd &quot;S-C-&amp;lt;left&amp;gt;&quot;) 'shrink-window-horizontally)&#xA;(global-set-key (kbd &quot;S-C-&amp;lt;right&amp;gt;&quot;) 'enlarge-window-horizontally)&#xA;(global-set-key (kbd &quot;S-C-&amp;lt;down&amp;gt;&quot;) 'shrink-window)&#xA;(global-set-key (kbd &quot;S-C-&amp;lt;up&amp;gt;&quot;) 'enlarge-window)&#xA;&#xA;;;Kill buffer without prompt unless there are unsaved changes                                                                                                                             &#xA;(global-set-key (kbd &quot;C-x k&quot;) 'kill-this-buffer)&#xA;&#xA;;;Interactively-do-mode, improves file and interface navigation                                                                                                                           &#xA;(require 'ido)&#xA;(ido-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Settings like IDO mode and kill-this-buffer work fine. But the syntax color scheme and S-C-arrows for resizing the window don't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside Tmux:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Vq0q0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Vq0q0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Outside Tmux (still in gnome-terminal):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/37F7w.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/37F7w.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*Also, is running Emacs inside Tmux a bad idea in general?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="13361" LastEditDate="2016-12-19T16:04:00.703" LastActivityDate="2016-12-19T16:44:28.530" Title="Emacs inside Tmux problem" Tags="|init-file|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="29408" PostTypeId="2" ParentId="29266" CreationDate="2016-12-19T15:45:45.247" Score="8" Body="&lt;p&gt;The box corresponds to a new input method introduced in Fedora 25 for typing emojis (&lt;a href=&quot;https://fedoramagazine.org/using-favorite-emoji-fedora-25/&quot; rel=&quot;noreferrer&quot;&gt;https://fedoramagazine.org/using-favorite-emoji-fedora-25/&lt;/a&gt;), and comes from ibus. The functionality is activated in system startup by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find a way to change the ibus shortcut or to disable it. I tryed uninstalling ibus or stopping the service but this causes other problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation says (or suggests) that the release does not include a mechanism to disable the feature: &lt;a href=&quot;https://fedoraproject.org/wiki/Changes/IBus_Emoji_Typing&quot; rel=&quot;noreferrer&quot;&gt;https://fedoraproject.org/wiki/Changes/IBus_Emoji_Typing&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;s&gt;A trick to temporarily disable the box appearance is to close session and start it again. That's the only workaround I have found so far (this &quot;trick&quot; is actually a bug that was fixed in subsequent versions of Fedora).&lt;/s&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A feature request has been made to customize the ibus functionality:  &lt;a href=&quot;https://bugzilla.redhat.com/show_bug.cgi?id=1405629&quot; rel=&quot;noreferrer&quot;&gt;https://bugzilla.redhat.com/show_bug.cgi?id=1405629&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The issue has been solved by Fedora developers. The solution works in Fedora 26 onwards, it is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ibus-setup&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the ibus setup panel will show, here you can change &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;e&lt;/kbd&gt; to something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I applied this solution in Fedora 28, so I confirm that it works in this version.&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="11856" LastEditDate="2018-06-22T17:08:48.557" LastActivityDate="2018-06-22T17:08:48.557" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="29409" PostTypeId="1" AcceptedAnswerId="29417" CreationDate="2016-12-19T16:12:24.073" Score="1" ViewCount="195" Body="&lt;p&gt;I know that there is &lt;code&gt;RefTeX&lt;/code&gt; with its TOC, and I know how to include &lt;code&gt;\frametitle&lt;/code&gt; there (see &lt;a href=&quot;http://emacsworld.blogspot.de/2008/03/getting-beamer-frame-titles-into-reftex.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;). Nevertheless, I would like to see &lt;code&gt;\frametitle&lt;/code&gt; also appear in &lt;code&gt;imenu&lt;/code&gt;. What would be the minimal way to get to this? &lt;/p&gt;&#xA;" OwnerUserId="12336" LastActivityDate="2016-12-20T13:41:03.783" Title="How to add Beamer `\frametitle` to `imenu`?" Tags="|auctex|reftex-mode|beamer|imenu|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29410" PostTypeId="2" ParentId="29407" CreationDate="2016-12-19T16:38:45.710" Score="6" Body="&lt;p&gt;The following additions to your &lt;code&gt;.tmux.conf&lt;/code&gt; file ought to fix most or your problems:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set-option -g default-terminal &quot;xterm-256color&quot;&#xA;set-window-option -g xterm-keys on&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason that your color themes aren't working as expected is most likely that emacs thinks that it is running in a terminal with only 8 colors.  Setting the terminal to be &lt;code&gt;xterm-256color&lt;/code&gt; tells emacs that your terminal can support 256 colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that your keyboard shortcuts aren't working as expected is that the tmux doesn't know what you expect it to do with modified keys.  Turning &lt;code&gt;xterm-keys&lt;/code&gt; on tells tmux to send the modified keys as escape sequences the same way xterm does.  Since emacs thinks that your terminal is xterm, it will interpret incoming escape sequences as if they were from xterm, and do the right thing.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="93" LastEditDate="2016-12-19T16:44:28.530" LastActivityDate="2016-12-19T16:44:28.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29411" PostTypeId="1" AcceptedAnswerId="29423" CreationDate="2016-12-19T17:39:48.743" Score="8" ViewCount="1585" Body="&lt;p&gt;I'm on a Mac and am having problems with Emacs and libmagick.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, Emacs exits and prints:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Library not loaded: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib&#xA;  Referenced from: /usr/local/Cellar/emacs-plus/24.5/Emacs.app/Contents/MacOS/Emacs&#xA;  reason: image not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, that file &lt;strong&gt;does&lt;/strong&gt; exist.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[I] bheesham.persaud $ file /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib&#xA;/usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.2.dylib: Mach-O 64-bit dynamically linked shared library x86_64&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A similar error pops up in the macOS Report Problem dialog when trying to launch an Emacs GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What do I need to do to get Emacs to recognize the imagemagick library?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional information:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Process:               Emacs [96152]&#xA;Path:                  /usr/local/Cellar/emacs-plus/24.5/Emacs.app/Contents/MacOS/Emacs&#xA;Identifier:            org.gnu.Emacs&#xA;Version:               Version 24.5 (9.0)&#xA;Code Type:             X86-64 (Native)&#xA;Parent Process:        ??? [1]&#xA;Responsible:           Emacs [96152]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14300" LastEditorUserId="14300" LastEditDate="2016-12-19T19:09:18.797" LastActivityDate="2016-12-20T04:25:26.747" Title="Emacs unable to load imagemagick?" Tags="|osx|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29413" PostTypeId="2" ParentId="10597" CreationDate="2016-12-19T20:31:13.327" Score="3" Body="&lt;p&gt;The accepted answer is likely to work, but misses some things. In particular, since it does the refiling itself, it won't trigger the actions from &lt;code&gt;org-log-refile&lt;/code&gt; and the like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based in part on some other code from a site I now can't find, I put together the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-read-datetree-date (d)&#xA;  &quot;Parse a time string D and return a date to pass to the datetree functions.&quot;&#xA;  (let ((dtmp (nthcdr 3 (parse-time-string d))))&#xA;    (list (cadr dtmp) (car dtmp) (caddr dtmp))))&#xA;&#xA;(defun my/org-refile-to-archive-datetree ()&#xA;  &quot;Refile an entry to a datetree under an archive.&quot;&#xA;  (interactive)&#xA;  (require 'org-datetree)&#xA;  (let ((datetree-date (my/org-read-datetree-date (org-read-date t nil))))&#xA;    (org-refile nil nil (list nil (buffer-file-name) nil&#xA;                              (save-excursion&#xA;                                (org-datetree-find-date-create datetree-date)))))&#xA;  (setq this-command 'my/org-refile-to-journal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This passes the target location to &lt;code&gt;org-refile&lt;/code&gt; itself, which can thus do the correct subsidiary processing. My particular setup is to refile to an archive in the same file, which has a &lt;code&gt;DATE_TREE&lt;/code&gt; property in order to cause the datetree functions to work underneath it. If you want to specify a file, you can wrap the call in &lt;code&gt;with-current-buffer&lt;/code&gt; and use &lt;code&gt;find-file&lt;/code&gt; inside.&lt;/p&gt;&#xA;" OwnerUserId="7095" LastActivityDate="2016-12-19T20:31:13.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29414" PostTypeId="1" AcceptedAnswerId="29416" CreationDate="2016-12-19T21:02:30.717" Score="1" ViewCount="68" Body="&lt;p&gt;When tangling latex source from &lt;code&gt;pie.org&lt;/code&gt;, the resulting file is by default &lt;code&gt;pie.latex&lt;/code&gt;.  Is it possible to change the extension for latex code to &lt;code&gt;.tex&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2016-12-19T22:14:25.367" Title="Can I make the latex extension .tex rather than .latex?" Tags="|org-babel|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29415" PostTypeId="2" ParentId="26435" CreationDate="2016-12-19T21:56:05.747" Score="2" Body="&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there any way I can advise python-mode to ignore indentation rules within docstrings?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, in Emacs 25.1 or greater (before that &lt;code&gt;python-indent-context&lt;/code&gt; didn't distinguish string from docstring).  Indentation works by setting &lt;code&gt;indent-line-function&lt;/code&gt; to a mode-specific value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;indent-line-function is a variable defined in ‘indent.el’.&#xA;Its value is ‘python-indent-line-function’&#xA;Local in buffer foo.py; global value is indent-relative&#xA;&#xA;  This variable may be risky if used as a file-local variable.&#xA;&#xA;Documentation:&#xA;Function to indent the current line.&#xA;This function will be called with no arguments.&#xA;If it is called somewhere where auto-indentation cannot be done&#xA;(e.g. inside a string), the function should simply return ‘noindent’.&#xA;Setting this function is all you need to make TAB indent appropriately.&#xA;Don’t rebind TAB unless you really need to.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can advise &lt;code&gt;python-indent-line&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-python-noindent-docstring (&amp;amp;optional _previous)&#xA;  (if (eq (car (python-indent-context)) :inside-docstring)&#xA;      'noindent))&#xA;&#xA;(advice-add 'python-indent-line :before-until #'my-python-noindent-docstring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually, you could technically do it without advice as such, by setting &lt;code&gt;indent-line-function&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-python-indent-line ()&#xA;  (if (eq (car (python-indent-context)) :inside-docstring)&#xA;      'noindent&#xA;    (python-indent-line)))&#xA;&#xA;(defun my-python-mode-hook ()&#xA;  (setq indent-line-function #'my-python-indent-line))&#xA;(add-hook 'python-mode-hook #'my-python-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2016-12-19T21:56:05.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29416" PostTypeId="2" ParentId="29414" CreationDate="2016-12-19T22:14:25.367" Score="1" Body="&lt;p&gt;This behaviour is controlled by the variable &lt;code&gt;org-babel-tangle-lang-exts&lt;/code&gt;, the documentation for which reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alist mapping languages to their file extensions.&#xA;  The key is the language name, the value is the string that should&#xA;  be inserted as the extension commonly used to identify files&#xA;  written in this language.  &lt;strong&gt;If no entry is found in this list,&#xA;  then the name of the language is used.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;By default, there is no entry for latex. This is perhaps a buglet, but you can fix it for yourself by adding the appropriate values in the customize interface.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-12-19T22:14:25.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29417" PostTypeId="2" ParentId="29409" CreationDate="2016-12-19T22:17:15.690" Score="2" Body="&lt;p&gt;Try this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(push '(&quot;frametitle&quot; 2) TeX-outline-extra)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the documentation for &lt;code&gt;TeX-outline-extra&lt;/code&gt;. The first element of the list being added is a regexp and the second is the imenu level. You can also see &lt;code&gt;LaTeX-section-list&lt;/code&gt; for the default levels that imenu uses for latex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As suggested in the comments, it might be a little safer to use the following. This change makes no difference for my use though. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(push '(&quot;\\\\frametitle\\b&quot; 2) TeX-outline-extra)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="14114" LastEditDate="2016-12-20T13:41:03.783" LastActivityDate="2016-12-20T13:41:03.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29418" PostTypeId="2" ParentId="29396" CreationDate="2016-12-19T22:20:45.913" Score="1" Body="&lt;p&gt;The &lt;code&gt;cedet-gnu-global-version-check&lt;/code&gt; is defined within the cedet-global.el file, adding the &lt;code&gt;(require 'cedet-global)&lt;/code&gt; statement solved my issue.&lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2016-12-19T22:20:45.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29419" PostTypeId="1" AcceptedAnswerId="29420" CreationDate="2016-12-19T22:31:14.083" Score="1" ViewCount="187" Body="&lt;p&gt;I've installed a &lt;code&gt;minimap&lt;/code&gt; package and when I disable and save 'show minimap line highlight' it keeps showing the line highlight anyway:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HBmx4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HBmx4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any obvious fixes, or is it just a bug in the package?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="2287" LastEditDate="2016-12-19T23:17:40.453" LastActivityDate="2016-12-19T23:17:40.453" Title="Minimap package line highlight always on" Tags="|package|minimap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29420" PostTypeId="2" ParentId="29419" CreationDate="2016-12-19T23:11:09.887" Score="2" Body="&lt;p&gt;Yes, this is a bug -- the variable &lt;code&gt;minimap-highlight-line&lt;/code&gt; is not anywhere within the workings of minimap -- i.e., it is only defined as a variable and mentioned in the comment (setting the variable will have the same effect as tying your shoe or drinking a cup of coffee).  See an open Github issue #5 regarding this bug:  &lt;a href=&quot;https://github.com/dengste/minimap/issues/5&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/dengste/minimap/issues/5&lt;/a&gt; and related pull-request:  &lt;a href=&quot;https://github.com/dengste/minimap/pull/7&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/dengste/minimap/pull/7&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider commenting out lines 519 to 523:  &lt;a href=&quot;https://github.com/dengste/minimap/blob/master/minimap.el#L519&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/dengste/minimap/blob/master/minimap.el#L519&lt;/a&gt;  If the file is byte-compiled, then &lt;code&gt;M-x byte-compile-file&lt;/code&gt; when you are done editing and saving your edits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, manually implement the same fix suggested in the above-mentioned pull-request.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-19T23:16:43.757" LastActivityDate="2016-12-19T23:16:43.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29421" PostTypeId="2" ParentId="29385" CreationDate="2016-12-19T23:23:37.040" Score="0" Body="&lt;p&gt;Here is another approach I have used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-toc ()&#xA;  (interactive)&#xA;  (let ((files (f-entries &quot;.&quot; (lambda (f) (f-ext? f &quot;org&quot;)) t))&#xA;    (headlines '())&#xA;    choice) &#xA;    (loop for file in files do&#xA;      (with-temp-buffer &#xA;        (insert-file-contents file) &#xA;        (goto-char (point-min))&#xA;        (while (re-search-forward org-heading-regexp nil t)&#xA;          (cl-pushnew (list&#xA;               (format &quot;%-80s (%s)&quot;&#xA;                   (match-string 0)&#xA;                   (file-name-nondirectory file))&#xA;               :file file&#xA;               :position (match-beginning 0))&#xA;              headlines))))&#xA;    (setq choice&#xA;      (completing-read &quot;Headline: &quot; (reverse headlines)))&#xA;    (find-file (plist-get (cdr (assoc choice headlines)) :file))&#xA;    (goto-char (plist-get (cdr (assoc choice headlines)) :position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if you have helm or ivy setup to do completion, it should use them to help pick the headlines. This takes about 4-5 seconds for me on about 3500 headlines.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-19T23:23:37.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29423" PostTypeId="2" ParentId="29411" CreationDate="2016-12-20T04:25:26.747" Score="5" Body="&lt;p&gt;The problem usually happens when you have compiled emacs with &lt;code&gt;--with-imagemagick&lt;/code&gt; configuration option. Here, emacs is compiled with a specific version of imagemagick and the OP updated his imagemagick, but emacs still expects the old version of imagemagick and fails to find the old executable and hence, blows up at startup with an error message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could solve this problem by creating an alias for imagemagick to point to the path of the old executable(the old version of imagemagick is not deleted by default by homebrew) OR you can just reinstall emacs from homebrew with &lt;code&gt;--with-imagemagick&lt;/code&gt; option and let emacs get compiled the latest version of imagemagick. That will fix the error.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-12-20T04:25:26.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29425" PostTypeId="2" ParentId="29398" CreationDate="2016-12-20T10:47:37.713" Score="1" Body="&lt;p&gt;I subscribe to &lt;a href=&quot;https://emacs.stackexchange.com/users/454/phils&quot;&gt;https://emacs.stackexchange.com/users/454/phils&lt;/a&gt; 's recommendation to file a bug report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime you could try this slightly modified version of &lt;code&gt;ses-mark-column&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ses-mark-column ()&#xA;  &quot;Mark the entirety of current column as a range.&quot;&#xA;  (interactive)&#xA;  (ses-check-curcell 'range)&#xA;  (let ((col (cdr (ses-sym-rowcol (or (car-safe ses--curcell) ses--curcell))))&#xA;    (row 0))&#xA;    (push-mark (point))&#xA;    (ses-goto-print (1- ses--numrows) (1+ col))&#xA;    (push-mark (point) nil t)&#xA;    (while (eq '*skip* (ses-cell-value row col))&#xA;      ;;Skip over initial cells in column that can't be selected&#xA;      (setq row (1+ row)))&#xA;    (ses-goto-print row col)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8943" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-12-20T10:47:37.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29426" PostTypeId="1" AcceptedAnswerId="29548" CreationDate="2016-12-20T11:08:35.400" Score="4" ViewCount="1304" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/Bad-ptr/persp-mode.el/&quot; rel=&quot;nofollow noreferrer&quot;&gt;persp-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq-default use-package-always-defer t)&#xA;&#xA;(use-package persp-mode&#xA;  :init&#xA;  (setq-default&#xA;   persp-auto-resume-time 0.1&#xA;   persp-keymap-prefix (kbd &quot;C-c C-w&quot;))&#xA;  (persp-mode 1)&#xA;  :config&#xA;  (setq-default&#xA;   persp-auto-save-fname &quot;.persp&quot;&#xA;   persp-auto-save-num-of-backups 0&#xA;   persp-autokill-buffer-on-remove nil&#xA;   persp-save-dir user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are the steps to reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start Emacs, create a &lt;code&gt;dotemacs&lt;/code&gt; perspective with &lt;code&gt;persp-copy&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Visit &lt;code&gt;dotemacs.org&lt;/code&gt;, it is added to the perspective.&lt;/li&gt;&#xA;&lt;li&gt;Visit then Magit buffer for that file, it is not added to the perspective.&lt;/li&gt;&#xA;&lt;li&gt;Add that Magit buffer with &lt;code&gt;(persp-add-buffer (current-buffer))&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Save &lt;code&gt;.persp&lt;/code&gt; with &lt;code&gt;(persp-save-state-to-file persp-auto-save-fname))&lt;/code&gt;. &lt;a href=&quot;https://bpaste.net/show/3c3ebf87da29&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://bpaste.net/show/3c3ebf87da29&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When I restart Emacs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Persp doesn't restore &lt;code&gt;dotemacs&lt;/code&gt; perspective, perhaps intended but I haven't found a way in the customization menus.&lt;/li&gt;&#xA;&lt;li&gt;The Magit buffer is saved in the &lt;code&gt;.persp&lt;/code&gt; file, but is not open, nor restored.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do I mark &quot;active&quot; a perspective to restore to on startup?&lt;/li&gt;&#xA;&lt;li&gt;How do I make Magit buffers automatically added to my perspectives?&lt;/li&gt;&#xA;&lt;li&gt;What are &quot;leaves&quot; in the &lt;code&gt;.persp&lt;/code&gt; file?&lt;/li&gt;&#xA;&lt;li&gt;What are &quot;weak&quot; perspectives?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-12-24T12:09:01.343" Title="Persp-mode doesn't recover last activated perspective and doesn't restore all buffers" Tags="|persp-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29427" PostTypeId="1" CreationDate="2016-12-20T11:11:50.490" Score="1" ViewCount="72" Body="&lt;p&gt;I want to use &lt;code&gt;org-ref&lt;/code&gt; and &lt;code&gt;org-download&lt;/code&gt; which provide convenient methods drag links into emacs to download the pdf file or image file. But following the config of the readmes, I still can not get both work. When I drag a url into emacs, it just insert a url of current buffer. I wonder whether this is a issue of specific version of emacs. I'm using the &lt;code&gt;emacs-mac&lt;/code&gt; installed by &lt;code&gt;brew&lt;/code&gt;. Any help will be appreciated. Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.s. I can find either a &lt;code&gt;org-ref&lt;/code&gt; tag or &lt;code&gt;org-download&lt;/code&gt; tag, so I tagged this as &lt;code&gt;org-mode&lt;/code&gt;, sorry.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-12-20T11:11:50.490" Title="Problem of dragging links into emacs" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29428" PostTypeId="1" AcceptedAnswerId="29429" CreationDate="2016-12-20T12:45:52.467" Score="3" ViewCount="2393" Body="&lt;p&gt;i often make links in Org Mode to files, which should open in emacs, but in another buffer than the one, which contains the link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be the best, if they open in a buffer next to the one I work in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i do that?&lt;/p&gt;&#xA;" OwnerUserId="14305" LastEditorUserId="105" LastEditDate="2016-12-20T16:15:54.420" LastActivityDate="2017-04-19T17:26:28.947" Title="Is it possible to open links in another buffer (Org Mode)?" Tags="|org-mode|window|window-splitting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29429" PostTypeId="2" ParentId="29428" CreationDate="2016-12-20T14:35:46.467" Score="3" Body="&lt;p&gt;Please have a look at the variable &lt;code&gt;org-link-frame-setup&lt;/code&gt;. In its documentation string you'll find the searched for information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might do this with the keyboard sequence &lt;code&gt;C-h v&lt;/code&gt; and then typing above name.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2016-12-20T14:35:46.467" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29430" PostTypeId="1" CreationDate="2016-12-20T14:56:53.903" Score="4" ViewCount="1593" Body="&lt;p&gt;I want to show all properties of all subtrees while folding all of them is the default option but I can't find a option to this. &lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="105" LastEditDate="2018-12-18T20:50:03.353" LastActivityDate="2018-12-18T20:50:03.353" Title="How to make org show all properties as default?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29431" PostTypeId="1" AcceptedAnswerId="29466" CreationDate="2016-12-20T14:59:55.710" Score="0" ViewCount="301" Body="&lt;p&gt;I'd like to embed &lt;code&gt;org-mode&lt;/code&gt; tables in my latex files and have org mode take care of formatting floating point numbers.&#xA;Based on A.6.2 of the &lt;code&gt;org-mode&lt;/code&gt; manual (&lt;a href=&quot;http://orgmode.org/org.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/org.pdf&lt;/a&gt;) I expected this to work, in particular to produce &lt;code&gt;1.0 &amp;amp; 2.0 \\&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{comment}&#xA;\begin{document}&#xA;\begin{comment}&#xA;  #+ORGTBL: SEND table-name orgtbl-to-latex :splice t :fmt (1 &quot;%.3s&quot; 2 &quot;%.2f&quot;)&#xA; | 1.000 | 2.000 |&#xA;\end{comment}&#xA;\begin{tabular}{lrr}&#xA;  % BEGIN RECEIVE ORGTBL table-name&#xA;  % END RECEIVE ORGTBL table-name&#xA;\end{tabular}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it doesn't. Instead i get an error: &lt;code&gt;Format specifier doesn't match argument type&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? Is &lt;code&gt;%s&lt;/code&gt; the only supported format or am I missing somthing? (Why?)&lt;/p&gt;&#xA;" OwnerUserId="8658" LastEditorUserId="8658" LastEditDate="2016-12-21T06:24:25.880" LastActivityDate="2017-02-20T15:14:22.267" Title="Org-mode radio table orgtbl-to-latex :fmt wont accept float" Tags="|org-mode|latex|auctex|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29432" PostTypeId="1" AcceptedAnswerId="29436" CreationDate="2016-12-20T15:26:41.157" Score="4" ViewCount="328" Body="&lt;p&gt;I often work with Tmux and I really like the ability to have multiple windows where each window has a custom set of panes. This allows me to quickly switch between layouts without losing anything.&lt;/p&gt;&#xA;&lt;p&gt;So far in Emacs I know how to navigate buffers, switch from one buffer to another, close a buffer, open a new buffer, split the window and access a list of buffers. What I haven't been able to do is to have multiple custom setups and be able to quickly switch between them. Like so:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mRGc1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mRGc1.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;How would one go about achieving this?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-20T16:00:54.073" Title="Switching between sets of buffers" Tags="|buffers|window|frames|" AnswerCount="1" CommentCount="0" ClosedDate="2016-12-20T16:26:59.333" ContentLicense="CC BY-SA 3.0" />
  <row Id="29433" PostTypeId="1" AcceptedAnswerId="29437" CreationDate="2016-12-20T15:39:20.157" Score="1" ViewCount="152" Body="&lt;p&gt;I find when I am using emacs in certain modes that configurations made in my init.el files do not apply anymore. E.g. I have my keybinds set up so that &lt;code&gt;tab&lt;/code&gt; is used for indentation, &lt;code&gt;§&lt;/code&gt; for snippet completion and &lt;code&gt;~&lt;/code&gt; for auto-complete completion. In c-mode and python-mode this works fine. However when I attempt to use this in vhdl-mode these commands don't all work. &lt;code&gt;§&lt;/code&gt; still works for snippet completion but &lt;code&gt;tab&lt;/code&gt; is now used to indentation and autocompletion and rather than bringing up a nice menu of the auto-complete options it merely cycles through the options as I press &lt;code&gt;tab&lt;/code&gt;. How can I correct this behaviour? I assume it is set in a seperate init file for that particular mode, in the same way as my snippet and autocompletion don't work in latex-mode for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's particularly problematic because I want to use &lt;code&gt;tab&lt;/code&gt; to indent a block of code and it starts auto-completing if I type &lt;code&gt;tab&lt;/code&gt; in the middle of a line of text.&lt;/p&gt;&#xA;" OwnerUserId="11742" LastEditorUserId="11742" LastEditDate="2016-12-20T15:45:51.430" LastActivityDate="2016-12-20T16:16:13.387" Title="init.el config overwritten in certain modes?" Tags="|major-mode|auto-complete-mode|" AnswerCount="1" CommentCount="0" ClosedDate="2016-12-20T22:29:29.937" ContentLicense="CC BY-SA 3.0" />
  <row Id="29434" PostTypeId="2" ParentId="29263" CreationDate="2016-12-20T15:41:28.793" Score="2" Body="&lt;p&gt;Tramp doesn't use &lt;code&gt;exec-path&lt;/code&gt;, it uses &lt;code&gt;tramp-remote-path&lt;/code&gt;. See &lt;a href=&quot;https://www.gnu.org/software/tramp/#Remote-programs&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/tramp/#Remote-programs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2016-12-20T15:41:28.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29435" PostTypeId="1" AcceptedAnswerId="29438" CreationDate="2016-12-20T15:52:07.973" Score="3" ViewCount="793" Body="&lt;p&gt;I am new to emacs and I been trying to find how to tag multiple files with multiple tags and then filter or search based on the tags. If you are familiar with the way tags work in Evernote or TagSpaces that is pretty much the same idea. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is it possible to do that with emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I was reading about ctag and etag but those look more to be specific to code tags and for navigation within files instead. &lt;/p&gt;&#xA;" OwnerUserId="14307" LastEditorUserId="105" LastEditDate="2017-05-16T22:32:52.133" LastActivityDate="2017-05-16T22:32:52.133" Title="tagging files for filtering" Tags="|files|search|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29436" PostTypeId="2" ParentId="29432" CreationDate="2016-12-20T16:00:54.073" Score="2" Body="&lt;p&gt;This can be done very easily if you are using &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ivy&lt;/code&gt;&lt;/a&gt;. All you got to do is execute the command &lt;code&gt;ivy-push-view&lt;/code&gt; when are on a window setup you like and give it a specific name (by default the name of the ivy-view goes like &lt;code&gt;{} buffer1 buffer2&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you've pushed a window config you like to &lt;code&gt;ivy-views&lt;/code&gt;, you can then change from any window configuration to the one you saved before using &lt;code&gt;switch-to-buffer&lt;/code&gt; and selecting the view you pushed before and the whole window configuration will be restored :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's incredibly simple and so damn useful. Also, if you're using &lt;code&gt;desktop-save-mode&lt;/code&gt; you can also chose to save &lt;code&gt;ivy-views&lt;/code&gt; in it so that everytime you restore the desktop save file, you restore &lt;code&gt;ivy-views&lt;/code&gt; as well.&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-12-20T16:00:54.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29437" PostTypeId="2" ParentId="29433" CreationDate="2016-12-20T16:16:13.387" Score="2" Body="&lt;p&gt;Emacs keybindings are hierarchical. Global keybindings are masked by major-mode keybindings, and major-mode keybindings are masked by minor-mode keybindings. When you set global keybindings in your &lt;code&gt;init.el&lt;/code&gt;, they work as long as they don't conflict with any active major or minor modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, &lt;code&gt;vhdl-mode&lt;/code&gt; is binding &lt;code&gt;tab&lt;/code&gt; to whatever function it uses for indentation/completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to avoid such conflicts? It's a bit tricky, but you have a few options:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;C-c LETTER bindings&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;By convention (usually, but not always, followed), keybindings of the form &lt;code&gt;C-c &amp;lt;letter&amp;gt;&lt;/code&gt; are reserved for users. That means if you bind something to &lt;code&gt;C-c x&lt;/code&gt; (or any other single letter in place of &lt;code&gt;x&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-set-key (kbd &quot;C-c x&quot;) 'my-favorite-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it shouldn't have any conflicts with major or minor modes.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;F5-F9&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Similarly, functions keys 5-9 are reserved for users:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) 'another-cool-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Define a new prefix-key&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Define a new prefix key to give yourself your own personal area for key bindings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'my-keymap)&#xA;(global-set-key (kbd &quot;&amp;lt;f5&amp;gt;&quot;) my-keymap)&#xA;(define-key my-keymap &quot;a&quot; 'function-one) &#xA;(define-key my-keymap &quot;b&quot; 'function-two) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use any key you like for your new prefix key. As long as you use a key that doesn't conflict with a major or minor mode, this gives you a nice way to increase your personal key binding space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I use &lt;code&gt;M-&amp;lt;space&amp;gt;&lt;/code&gt; as my prefix key. This means I lose access to the function it is normally bound to, which is &lt;code&gt;just-one-space&lt;/code&gt;. But I add it to the prefix so I can get it back with one extra key-press:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'tws-keymap)&#xA;(global-set-key &quot;\M- &quot; tws-keymap)&#xA;(define-key tws-keymap &quot; &quot; 'just-one-space) &#xA;(define-key tws-keymap &quot;i&quot; 'toggle-window-split) &#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In theory, if I use a mode that rebinds &lt;code&gt;M-&amp;lt;space&amp;gt;&lt;/code&gt;, it will mess up my prefix-map. However, I haven't run into that problem yet.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Define a new minor mode&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can also create your own minor mode just to hold your keybindings, which will prevent any major-modes from hiding them. That's a bit more involved to include here, but it's an option if you know (or want to learn) more elisp.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-12-20T16:16:13.387" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29438" PostTypeId="2" ParentId="29435" CreationDate="2016-12-20T16:23:46.030" Score="4" Body="&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bookmark+&lt;/a&gt; then yes, you can do this easily. Tagging &lt;em&gt;files&lt;/em&gt; using Bookmark+ means creating &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#AutofileBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;autofile bookmarks&lt;/em&gt;&lt;/a&gt; for the files and then adding &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkTags&quot; rel=&quot;nofollow noreferrer&quot;&gt;tags&lt;/a&gt; for those bookmarks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of an autofile bookmark as just a file wrapper: a way to attach meta information (such as tags) to a file. But you can use an autofile bookmark much as you would use a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then search, or filter bookmarks (or just autofile bookmarks) in several ways. For autofile bookmarks, this means you can search, filter, or query-replace the files.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-20T16:23:46.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29440" PostTypeId="1" CreationDate="2016-12-20T17:29:25.477" Score="1" ViewCount="105" Body="&lt;p&gt;I use the built in parentheses match &lt;code&gt;(show-paren-mode t)&lt;/code&gt;.&#xA;But there seems to be somewhat of a glitch when it highlights the matching parentheses, because it moves the bottom lines further apart when the highlights appear.&lt;/p&gt;&#xA;&lt;p&gt;Like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vfcWk.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vfcWk.gif&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Is this a bug or an intended effect? If the former, how would I go about fixing it?&lt;/p&gt;&#xA;&lt;p&gt;* Solution in comments&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-20T22:16:39.037" Title="Match paren problem in the GUI version of Emacs" Tags="|package|gui-emacs|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29441" PostTypeId="1" AcceptedAnswerId="29443" CreationDate="2016-12-20T17:38:00.017" Score="5" ViewCount="2995" Body="&lt;p&gt;I run both gui frames and tty frames on the same server. I'd like to only have the gui frames have the menu-bar and I want all tty frames to not have a menu bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm confused by the menu bar docs, is there a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="10355" LastActivityDate="2016-12-20T21:06:18.577" Title="How do I disable menu-bar-mode only for tty frames?" Tags="|terminal-emacs|menu-bar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29442" PostTypeId="2" ParentId="26577" CreationDate="2016-12-20T17:39:53.007" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/26577/include-certain-columns-of-a-table#comment40454_26577&quot;&gt;@Juancho's comment&lt;/a&gt; was head on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need a table with a &lt;code&gt;#+NAME:&lt;/code&gt;, which can be referenced via &lt;code&gt;'(identity remote(its-name, @@#$1))&lt;/code&gt;. As an example, take&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* test&#xA;#+NAME: src&#xA;| no | english | french | japanese |&#xA;|----+---------+--------+----------|&#xA;|  1 | one     | un     | ichi     |&#xA;|  2 | two     | deux   | ni       |&#xA;|  3 | three   | trois  | go       |&#xA;* copy&#xA;| no | french |&#xA;|----+--------|&#xA;|  1 | un     |&#xA;|  2 | deux   |&#xA;|  3 | trois  |&#xA;#+TBLFM: $1 = '(identity remote(src, @@#$1)):: $2 = '(identity remote(src, @@#$3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second table is filled by doing &lt;kbd&gt;C-c&lt;/kbd&gt; on the &lt;code&gt;TBLFM&lt;/code&gt;-line. It fills as many rows as the target table has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning &lt;code&gt;#+INCLUDE&lt;/code&gt;: just create a secondary table that holds the needed files and include that. (using the above did not seem to work cross-file)&lt;/p&gt;&#xA;" OwnerUserId="8431" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-12-20T17:39:53.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29443" PostTypeId="2" ParentId="29441" CreationDate="2016-12-20T17:56:48.610" Score="13" Body="&lt;p&gt;The function &lt;code&gt;display-graphic-p&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt; for non-GUI Emacs. So something like the following should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (display-graphic-p)&#xA;   (menu-bar-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;EDIT&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;My original answer only works for Emacs run only in a tty. Since you are using both GUI and TTY frames run from the same server, you need to modify individual frame parameters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun contextual-menubar (&amp;amp;optional frame)&#xA;  &quot;Display the menubar in FRAME (default: selected frame) if on a&#xA;    graphical display, but hide it if in terminal.&quot;&#xA;  (interactive)&#xA;  (set-frame-parameter frame 'menu-bar-lines &#xA;                             (if (display-graphic-p frame)&#xA;                                  1 0)))&#xA;&#xA;(add-hook 'after-make-frame-functions 'contextual-menubar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://stackoverflow.com/questions/24956521/how-can-i-hide-the-menu-bar-from-a-specific-frame-in-emacs&quot;&gt;https://stackoverflow.com/questions/24956521/how-can-i-hide-the-menu-bar-from-a-specific-frame-in-emacs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-20T21:06:18.577" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29444" PostTypeId="2" ParentId="5389" CreationDate="2016-12-20T18:14:46.213" Score="19" Body="&lt;p&gt;Since Org 9.0 you can run the &lt;code&gt;org-lint&lt;/code&gt; function which, among other things, checks for broken local links.&lt;/p&gt;&#xA;" OwnerUserId="14309" LastActivityDate="2016-12-20T18:14:46.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29445" PostTypeId="2" ParentId="29435" CreationDate="2016-12-20T20:32:10.560" Score="0" Body="&lt;p&gt;If you are maintaining a directory of lots of text (or org, markdown, etc) files you could try out &lt;a href=&quot;http://jblevins.org/projects/deft/&quot; rel=&quot;nofollow noreferrer&quot;&gt;deft&lt;/a&gt;. This mode provides dynamic filtering of your set of notes, making it easy to find (or save) a specific bit of text, without having to tag everything.  &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-20T20:38:38.860" LastActivityDate="2016-12-20T20:38:38.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29446" PostTypeId="1" AcceptedAnswerId="29449" CreationDate="2016-12-20T21:07:01.880" Score="2" ViewCount="1635" Body="&lt;p&gt;What short comings can I expect from this mode, and what are some use cases for which I should really prefer my operating system's terminal emulator?&lt;/p&gt;&#xA;" OwnerUserId="6554" LastActivityDate="2016-12-22T01:04:59.180" Title="Can I completely replace xterm with emacs' term mode?" Tags="|term|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29447" PostTypeId="1" CreationDate="2016-12-20T21:44:08.390" Score="7" ViewCount="2546" Body="&lt;p&gt;I am trying to change the style of block quote formatting in org-mode export to PDF via LaTeX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;a href=&quot;https://tex.stackexchange.com/questions/16964/block-quote-with-big-quotation-marks&quot;&gt;this answer&lt;/a&gt;, I defined a new LaTeX environment called &lt;code&gt;fancyquotes&lt;/code&gt;. I am successfully able to create block quotes with this styling by &lt;a href=&quot;https://emacs.stackexchange.com/questions/22698/org-mode-quote-block-environment&quot;&gt;creating a special block&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_fancyquotes&#xA;In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. ---Douglas Adams&#xA;#+END_fancyquotes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This successfully creates the desired TeX output: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{fancyquotes}&#xA;In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. ---Douglas Adams&#xA;\end{fancyquotes}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, for compatibility with org-mode export to HTML, I would prefer to use not a special block, but rather standard quote blocks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_QUOTE&#xA;In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. ---Douglas Adams&#xA;#+END_QUOTE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that, by default, the above gets exported using the &lt;code&gt;quote&lt;/code&gt; label:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{quote}&#xA;In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. ---Douglas Adams&#xA;\end{quote}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I direct org-mode to automatically export standard quote blocks to my newly defined new LaTeX environment and apply the labels &lt;code&gt;\begin{fancyquotes}&lt;/code&gt; and &lt;code&gt;\end{fancyquotes}&lt;/code&gt;? In other words, how do I redefine org-mode quote blocks in LaTeX export, changing it from the default label &lt;code&gt;quote&lt;/code&gt; to the label &lt;code&gt;fancyquotes&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus question: For the &lt;a href=&quot;https://tex.stackexchange.com/questions/16964/block-quote-with-big-quotation-marks&quot;&gt;fancyquotes LaTeX environment I defined&lt;/a&gt;, how do I specify the &lt;code&gt;shadequoteauthor&lt;/code&gt; in my org-mode source?)&lt;/p&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2021-11-16T20:07:30.160" Title="how to style block quotes in org-mode LaTeX export?" Tags="|org-mode|org-export|latex|quote|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29448" PostTypeId="1" CreationDate="2016-12-20T22:13:26.507" Score="0" ViewCount="262" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TlYXb.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TlYXb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As in the picture, when I editing python file, there are two completions. Why is that? Thank you very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following are my init.el related to elpy and completion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(elpy-enable)&#xA;;;(setq elpy-rpc-backend &quot;jedi&quot;)&#xA;;;(autoload 'jedi:setup &quot;jedi&quot; nil t)&#xA;;;(add-hook 'python-mode-hook 'jedi:setup)&#xA;;;(setq jedi:complete-on-dot t)                 ; optional&#xA;(elpy-use-ipython)&#xA;(global-eldoc-mode -1)&#xA;&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;;;(defun my/python-mode-hook ()&#xA; ;; (add-to-list 'company-backends 'company-jedi))&#xA;;;(add-hook 'python-mode-hook 'my/python-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14312" LastEditorUserId="14312" LastEditDate="2016-12-21T01:07:38.237" LastActivityDate="2020-11-24T10:16:09.893" Title="Why do I have two completions when editing python file?" Tags="|python|completion|elpy|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29449" PostTypeId="2" ParentId="29446" CreationDate="2016-12-20T22:33:28.273" Score="4" Body="&lt;p&gt;I use &lt;code&gt;ansi-term&lt;/code&gt; almost exclusively, so I would say &quot;almost&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speed is your main concern -- anything which rapidly generates large amounts of output is going to cause some pain, as Emacs won't keep up with it. If I know I'm about to issue such a shell command, I pull up a dedicated terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're using Emacs 24 then &lt;a href=&quot;https://www.emacswiki.org/emacs/AnsiTermHints#bidi&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/AnsiTermHints#bidi&lt;/a&gt; can cause awful slow-downs in certain situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs commands can potentially put the buffer in an inconsistent state, which is confusing at best. You might find &lt;a href=&quot;https://emacs.stackexchange.com/a/17086&quot;&gt;https://emacs.stackexchange.com/a/17086&lt;/a&gt; helpful.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-12-20T22:33:28.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29450" PostTypeId="2" ParentId="29448" CreationDate="2016-12-20T22:33:57.183" Score="1" Body="&lt;p&gt;You're seeing two popups because you've enabled two different auto-completion systems at the same time.  Elpy activates company-mode, jedi.el activates auto-complete-mode.  I'd suggest removing jedi.el from your config as Elpy handles that part already.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-12-20T22:33:57.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29451" PostTypeId="1" CreationDate="2016-12-20T22:47:49.150" Score="1" ViewCount="237" Body="&lt;p&gt;I use &lt;code&gt;evil&lt;/code&gt; via &lt;code&gt;spacemacs&lt;/code&gt;.  When I use yank, it’s mostly whole line numbers – like &lt;code&gt;y20y&lt;/code&gt;. To a lesser extent, this is often true of delete – &lt;code&gt;d10d&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything I can add to my Spacemacs config to toggle on the relative line numbers when I press the first &lt;code&gt;y&lt;/code&gt; and to toggle it off if I complete or cancel the yank? And the same for delete? This would make it obvious how many lines I need to yank. It feels like something that should already exist because it is a quite common use case.&lt;/p&gt;&#xA;" OwnerUserId="9354" LastEditorUserId="253" LastEditDate="2016-12-20T22:52:17.090" LastActivityDate="2016-12-21T18:11:33.993" Title="How can I change yank/delete to show relative line numbers during the yank/delete in evil?" Tags="|evil|spacemacs|yank|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29452" PostTypeId="1" AcceptedAnswerId="29491" CreationDate="2016-12-20T23:00:09.143" Score="3" ViewCount="1573" Body="&lt;p&gt;I have two elisp functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat ~/myelisp/myoptions.el&#xA;&#xA;(defun get-my-name (arg)&#xA;  &quot;Prompt user to enter a string, with input history support.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (read-string &quot;Enter your name: &quot;)))&#xA;  (message &quot;Your name is %s.&quot; arg))&#xA;&#xA;(defun get-my-directory (arg)&#xA;  &quot;Prompt user to enter a file path, with file name completion&#xA;and input history support.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (read-file-name &quot;Enter your directory: &quot;)))&#xA;  (message &quot;Path is: %s&quot; arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to organize these functions into a menu. Ideally, I would like to be able to issue something like &lt;code&gt;M-x my-info&lt;/code&gt; and have a buffer pop up displaying something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Press key for command:&#xA;----------------------&#xA;n Get user's name&#xA;d Get user's directory&#xA;&#xA;q quit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, pressing &lt;code&gt;n&lt;/code&gt; should call &lt;code&gt;get-my-name&lt;/code&gt; and pressing &lt;code&gt;d&lt;/code&gt; should call &lt;code&gt;get-my-directory&lt;/code&gt;. I've seen similar menus in many emacs packages (like &lt;code&gt;org-agenda&lt;/code&gt;, for example). Is this menu easy to code in &lt;code&gt;elisp&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="105" LastEditDate="2017-06-16T13:58:28.740" LastActivityDate="2019-11-30T04:34:52.030" Title="How can I create custom menu prompts in elisp?" Tags="|completing-read|menus|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29453" PostTypeId="1" AcceptedAnswerId="29456" CreationDate="2016-12-21T00:12:06.753" Score="3" ViewCount="1220" Body="&lt;p&gt;I have in my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package google-c-style&#xA;  ;; provides the Google C/C++ coding style&#xA;  :ensure t&#xA;  :config&#xA;  (add-hook 'c-mode-common-hook 'google-set-c-style))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, a particular C project I'm viewing uses&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq c-default-style &quot;linux&quot;&#xA;      c-basic-offset 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I override the default google C style with this one for this specific project? Something along the lines of putting something inside of &lt;code&gt;.dir-locals.el&lt;/code&gt; placed at the root of the project would be nice.&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2016-12-21T02:59:29.437" Title="Change C indent style for specific project?" Tags="|init-file|c++|c|project|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29454" PostTypeId="1" AcceptedAnswerId="29461" CreationDate="2016-12-21T02:02:00.957" Score="3" ViewCount="715" Body="&lt;p&gt;This is my current Emacs workflow:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon&#xA;emacsclient -c &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then editing few files and saving some of them (and keeping some of them unsaved and open on the server for later edit); then deleting the frame with &lt;code&gt;C-x 5 0&lt;/code&gt; (and later connecting again with &lt;code&gt;emacsclient -c&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is &lt;code&gt;C-x #&lt;/code&gt; (server-edit) for? what does it do? how it can affect my workflow? &lt;/p&gt;&#xA;" OwnerUserId="506" LastActivityDate="2016-12-21T11:08:31.113" Title="What is the use for server-edit (C-x #)" Tags="|emacsclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29455" PostTypeId="2" ParentId="29447" CreationDate="2016-12-21T02:45:29.160" Score="6" Body="&lt;p&gt;Interesting question. I put together this start based on &lt;a href=&quot;https://orgmode.org/manual/Advanced-Export-Configuration.html#Advanced-Export-Configuration&quot; rel=&quot;nofollow noreferrer&quot;&gt;this part of the manual&lt;/a&gt;. How you set this up will depend on how you want to use it. Based on my experiments, it seems easier to define a new exporter, like the manual suggests, than it is to redefine the latex one.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-latex-quote-block (quote-block contents info)&#xA;  &amp;quot;Transcode a QUOTE-BLOCK element from Org to LaTeX.&#xA;CONTENTS holds the contents of the block.  INFO is a plist&#xA;holding contextual information.&amp;quot;&#xA;  (org-latex--wrap-label&#xA;   quote-block&#xA;   (format &amp;quot;\\begin{fancyquotes}\n%s\\end{fancyquotes}&amp;quot; contents) info))&#xA;&#xA;(org-export-define-derived-backend 'my-latex 'latex&#xA;  :translate-alist '((quote-block . my-org-latex-quote-block)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can then test the export with&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(org-export-to-buffer 'my-latex &amp;quot;*Org MY-LATEX Export Results*&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This only does a dump to a buffer, but illustrates the basic idea.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I initially thought just redefining &lt;code&gt;org-latex-quote-block&lt;/code&gt; should work, but it wasn't for me. I know why now. I have org set up to use async by default, which runs a separate emacs process with the default versions of the org functions. Turning off async makes this work too. To use this with async you would have to redefine the function in your &lt;code&gt;org-export-async-init-file&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-latex-quote-block (quote-block contents info)&#xA;  &amp;quot;Transcode a QUOTE-BLOCK element from Org to LaTeX.&#xA;    CONTENTS holds the contents of the block.  INFO is a plist&#xA;    holding contextual information.&amp;quot;&#xA;  (org-latex--wrap-label&#xA;   quote-block&#xA;   (format &amp;quot;\\begin{fancyquotes}\n%s\\end{fancyquotes}&amp;quot; contents) info))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="14825" LastEditDate="2021-11-16T20:06:34.173" LastActivityDate="2021-11-16T20:06:34.173" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29456" PostTypeId="2" ParentId="29453" CreationDate="2016-12-21T02:59:29.437" Score="5" Body="&lt;p&gt;A .dir-locals.el file would certainly do the trick!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to use the function &lt;code&gt;(add-dir-local-variable MODE VARIABLE VALUE)&lt;/code&gt; rather editing .dir-locals.el manually.  For those two values eval&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;~/your/project/path&quot;))&#xA;     (add-dir-local-variable nil 'c-default-style &quot;linux&quot;)&#xA;     (add-dir-local-variable nil 'c-basic-offset 4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and save the created .dir-locals.el file!&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-12-21T02:59:29.437" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29457" PostTypeId="2" ParentId="29430" CreationDate="2016-12-21T03:17:48.043" Score="2" Body="&lt;p&gt;I suspect the the &lt;code&gt;outline-*&lt;/code&gt; set of commands may accomplish what you are looking for.  They do not consider property drawers when unfolding an outline.  In fact, &lt;code&gt;C-u C-u C-u TAB&lt;/code&gt; in org-mode (&lt;code&gt;org-cycle&lt;/code&gt;) actually calls &lt;code&gt;outline-show-all&lt;/code&gt;.  If you don't want property drawers to be collapsed when folding headings you could bind TAB to &lt;code&gt;outline-toggle-children&lt;/code&gt; instead of &lt;code&gt;org-cycle&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-12-21T03:17:48.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29458" PostTypeId="2" ParentId="14811" CreationDate="2016-12-21T03:41:14.350" Score="7" Body="&lt;p&gt;You can disable &lt;code&gt;neo-window-fixed-size&lt;/code&gt; and restart Neotree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/u595N.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/u595N.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5449" LastActivityDate="2016-12-21T03:41:14.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29459" PostTypeId="1" CreationDate="2016-12-21T06:20:41.663" Score="12" ViewCount="2293" Body="&lt;p&gt;I want to use the function to switch to other window when there are only 2 windows in emacs.  I know that the shortcut is &lt;code&gt;C-x o&lt;/code&gt;, but I don't know which function that shortcut calls.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I determine the mapping between shortcut and function?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="253" LastEditDate="2016-12-21T15:23:53.370" LastActivityDate="2016-12-22T15:51:57.300" Title="If I know a keybinding/shortcut, how to get the corresponding function?" Tags="|key-bindings|help|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29460" PostTypeId="2" ParentId="29459" CreationDate="2016-12-21T06:24:03.567" Score="1" Body="&lt;p&gt;Just got it, I could use the function &lt;code&gt;describe-bindings&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="105" LastEditDate="2016-12-21T14:28:52.017" LastActivityDate="2016-12-21T14:28:52.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29461" PostTypeId="2" ParentId="29454" CreationDate="2016-12-21T06:28:33.523" Score="8" Body="&lt;p&gt;emacsclient waits for emacs server. When you do server-edit, the server notifies emacsclient to terminate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It all depends on what you are going to do. In chrome I use the 'edit with emacs' extension, which uses emacs server to edit fields like these. From emacs I must notify chrome that I am done by calling server-edit. It is only at that moment that the text get pasted back into the input box (and the frame I am using to edit gets killed). Also, when the buffer is saved, chrome updates the edit field. But server-edit kills the frame too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But from the command line I don't care to call server-edit. I usually create an alias for emacsclient -n (&lt;code&gt;e='emacsclient -n'&lt;/code&gt; in bash). That way emacsclient does not have to wait for the server. I rarely do server-edit on these buffers.&lt;/p&gt;&#xA;" OwnerUserId="13769" LastEditorUserId="13769" LastEditDate="2016-12-21T11:08:31.113" LastActivityDate="2016-12-21T11:08:31.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29462" PostTypeId="2" ParentId="24630" CreationDate="2016-12-21T06:35:31.317" Score="0" Body="&lt;p&gt;I had the same problem. I resorted to using smart line mode and customize it so I get colours that are very distinctive in the active window. Here is a sample frame. The active window is the one with black mode line with gold letters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NwBbN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NwBbN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure you require smart-mode-line before using this code. I recommend you customize it to the colours you need:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(deftheme smart-mode-line-dmg &quot;dmg theme for smart-mode-line.&quot;)&#xA;(custom-theme-set-faces&#xA; 'smart-mode-line-dmg&#xA;                                        ; '(mode-line-inactive ((t :inverse-video nil)))&#xA;                                        ; '(mode-line     ((t :inverse-video nil)))&#xA; '(mode-line     ((t :foreground &quot;grey70&quot; :background &quot;black&quot; :inverse-video nil)))&#xA; '(mode-line-inactive  ((t :foreground &quot;black&quot; :background &quot;white&quot; :inverse-video nil)))&#xA; '(sml/global    ((t :inherit font-lock-preprocessor-face)))&#xA; '(sml/filename  ((t :inherit sml/global :foreground &quot;gold&quot; :weight bold)))&#xA; '(sml/prefix    ((t :inherit (font-lock-variable-name-face sml/global))))&#xA; '(sml/read-only ((t :inherit (font-lock-type-face sml/not-modified))))&#xA; '(sml/modes     ((t :foreground nil :inherit sml/filename :weight normal))))&#xA;&#xA;(sml/setup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13769" LastEditorUserId="13769" LastEditDate="2016-12-21T07:21:14.363" LastActivityDate="2016-12-21T07:21:14.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29463" PostTypeId="2" ParentId="29431" CreationDate="2016-12-21T06:40:33.110" Score="0" Body="&lt;p&gt;One approach would be to calculate additional columns and skip the originals:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ORGTBL: SEND correlation-detection-outcomes orgtbl-to-latex :splice t :skipcols (1 2)&#xA;| 1 |  2 | &#xA;#+TBLFM: $3=$1;%.2f::$4=$2;%.2f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;note the added &lt;code&gt;#+TBLFM: $3=$1;%.2f::$4=$2;%.2f&lt;/code&gt;, which that has to be executed (?) by putting the point on it an pressing &lt;code&gt;C-c C-c&lt;/code&gt; before doing the same on the table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This do however seem bloaty and unecessarily hackish.&lt;/p&gt;&#xA;" OwnerUserId="8658" LastActivityDate="2016-12-21T06:40:33.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29464" PostTypeId="2" ParentId="26991" CreationDate="2016-12-21T06:50:37.580" Score="2" Body="&lt;p&gt;I use two methods for this. I have some org snippets to help me create the babel headers. For example, this one creates C++-14 headers for Babel. I type &lt;code&gt;&amp;lt;s C++_&lt;/code&gt; and expand:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: c++_header&#xA;# key: C++_&#xA;# --&#xA;C++ :main no :flags -std=c++14 -Wall --pedantic -Werror :results output :exports both&#xA;#include &amp;lt;iostream&amp;gt;&#xA;int main()&#xA;{&#xA;   $0&#xA;&#xA;   return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I use C-c ' which switches to the specific language mode and use the snippets for that language. Then use C-c ' to get back to the org file. It works well.&lt;/p&gt;&#xA;" OwnerUserId="13769" LastActivityDate="2016-12-21T06:50:37.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29465" PostTypeId="1" AcceptedAnswerId="29467" CreationDate="2016-12-21T06:53:16.967" Score="9" ViewCount="3989" Body="&lt;p&gt;How do I evaluate multiple functions simultaneously using emacs --eval on command line? For example I want to combine the followings in a single command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &quot;(toggle-frame-maximized)&quot;&#xA;emacs --eval &quot;(sr-speedbar-toggle)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to wrap them together but all attempts failed. How do I do this?&lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="105" LastEditDate="2016-12-21T14:31:41.357" LastActivityDate="2016-12-21T14:31:41.357" Title="emacs --eval of multiple functions on command line" Tags="|command-line-arguments|eval-expression|eval|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29466" PostTypeId="2" ParentId="29431" CreationDate="2016-12-21T06:54:56.453" Score="0" Body="&lt;p&gt;Exploiting the possibility for &lt;code&gt;:fmt&lt;/code&gt; to be a function it can be done as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{article}&#xA;\usepackage{comment}&#xA;\begin{document}&#xA;\begin{comment}&#xA;  #+ORGTBL: SEND table-name orgtbl-to-latex :splice t :fmt (lambda (str) (format &quot;%.2f&quot; (string-to-number str)))&#xA; | 1.000 | 2.000 |&#xA;\end{comment}&#xA;\begin{tabular}{lrr}&#xA;  % BEGIN RECEIVE ORGTBL table-name&#xA;  % END RECEIVE ORGTBL table-name&#xA;\end{tabular}&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: &lt;code&gt;:fmt&lt;/code&gt; can also be a list with pr. column functions such as &lt;code&gt;(1 fcn1 2 fcn2 ...)&lt;/code&gt;, where &lt;code&gt;fcn1&lt;/code&gt; is applied to column 1 and so on.&lt;/p&gt;&#xA;" OwnerUserId="8658" LastEditorUserId="8658" LastEditDate="2016-12-22T13:54:20.877" LastActivityDate="2016-12-22T13:54:20.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29467" PostTypeId="2" ParentId="29465" CreationDate="2016-12-21T07:04:28.520" Score="15" Body="&lt;p&gt;Simply use &lt;code&gt;(progn )&lt;/code&gt;. This should address your question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &quot;(progn (toggle-frame-maximized) (sr-speedbar-toggle))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that this does not execute the commands simultaneously (as you requested). It executes one command after another.&lt;/p&gt;&#xA;" OwnerUserId="13769" LastEditorUserId="13769" LastEditDate="2016-12-21T07:09:46.483" LastActivityDate="2016-12-21T07:09:46.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29468" PostTypeId="1" AcceptedAnswerId="29473" CreationDate="2016-12-21T07:19:16.490" Score="2" ViewCount="1746" Body="&lt;p&gt;I have a shell script &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat ~/foo.sh&#xA;&#xA;#!/bin/bash&#xA;&#xA;echo $1 $2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm trying to call this from emacs. My &lt;code&gt;elisp&lt;/code&gt; function is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (word1 word2)&#xA;  &quot;Print these two words.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (read-string &quot;Enter first word: &quot;)&#xA;    (read-string &quot;Enter second word: &quot;)))&#xA;  (shell-command-to-string &quot;bash ~/foo.sh %s %s&quot; word1 word2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This, however, yields an error. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="105" LastEditDate="2016-12-21T14:31:22.327" LastActivityDate="2016-12-21T14:31:22.327" Title="What is the proper way to pass variable strings to `shell-command-to-string`?" Tags="|shell|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29470" PostTypeId="1" AcceptedAnswerId="29481" CreationDate="2016-12-21T08:28:46.957" Score="-1" ViewCount="499" Body="&lt;p&gt;I split the emacs into 2 windows, one window is used to edit the python code, say test.py, and another shell window to run shell command &quot;python test.py&quot;, so each time after I edit the python, I need to &#xA;1: save the buffer&#xA;2: switch from python window to shell window&#xA;3: run the last command in shell window&#xA;4: switch back to python window to edit again&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's boring, so I used the following code to automate the process, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun run-shell-command-again ()&#xA;(interactive)&#xA;(save-buffer (buffer-name))&#xA;(other-window)&#xA;(comint-previous-input)&#xA;(other-window))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I run the command using M-x run-shell-command-again in the python window, it throws wierd message as below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;run-shell-command-again: Wrong number of arguments: #[(count &amp;amp;optional all-frames) &lt;/p&gt;&#xA;" OwnerUserId="6697" LastEditorUserId="105" LastEditDate="2016-12-21T14:30:30.773" LastActivityDate="2016-12-21T14:30:30.773" Title="How to run the last shell command from an python window?" Tags="|python|shell|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29471" PostTypeId="1" AcceptedAnswerId="29475" CreationDate="2016-12-21T09:27:55.293" Score="8" ViewCount="9242" Body="&lt;p&gt;I tried to get the &quot;capture&quot;-Feature to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did the following things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Installation of the newest Version of the Org mode&#xA;(now the version 8.2.10)&lt;/li&gt;&#xA;&lt;li&gt;To get the capture feature work &lt;a href=&quot;https://stackoverflow.com/questions/3622603/org-mode-setup-problem-when-trying-to-use-capture&quot;&gt;i added to my .emacs&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;https://stackoverflow.com/questions/3622603/org-mode-setup-problem-when-trying-to-use-capture&#xA;&#xA;;(add-to-list 'load-path &quot;/nils/home/emacs.d/org-7.01h/lisp&quot;)&#xA;&#xA;(require 'org-install)&#xA;&#xA;(require 'org) ;; maybe this line is redundant&#xA;&#xA;;; Verzeichnis für &quot;org-capture&quot; festlegen&#xA; (setq org-default-notes-file (concat org-directory &quot;/notes.org&quot;))&#xA;&#xA;(define-key global-map &quot;\C-cc&quot; 'org-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After these changes i get the error message&lt;br/&gt;&lt;code&gt;Symbol's function definition is void: org-link-types&lt;/code&gt;&lt;br/&gt;when I open a .org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how to handle this error message.&lt;/p&gt;&#xA;" OwnerUserId="14305" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-05-04T04:01:49.500" Title="Error message &quot;Symbol's function definition is void: org-link-types&quot; when I open a .org file" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29472" PostTypeId="2" ParentId="24645" CreationDate="2016-12-21T09:31:36.260" Score="8" Body="&lt;h1&gt;Inside the current buffer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The simplest way is to create a function that does those two things for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you press (&lt;code&gt;C-c C-e h h&lt;/code&gt;) the function &lt;code&gt;org-html-export-to-html&lt;/code&gt; is run&#xA;in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you press (&lt;code&gt;C-c C-v t&lt;/code&gt;) the function &lt;code&gt;org-babel-tangle&lt;/code&gt; is run in the&#xA;current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefor you can use the following function to do both for you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun export-tangle ()&#xA;  &quot;Shortcut for exporting and tangling the current org-mode buffer.&quot;&#xA;  (interactive)&#xA;  (org-html-export-to-html)&#xA;  (org-babel-tangle))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then bind this function to &lt;code&gt;Alt+F2&lt;/code&gt; using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook&#xA; 'org-mode-hook&#xA; (lambda ()&#xA;   (local-set-key (kbd &quot;M-&amp;lt;f2&amp;gt;&quot;) 'export-tangle)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;In a script&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Sometimes you want to do this on files instead of the currently open buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then create a similar function that opens the file for you and runs&#xA;the functions for you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun export-tangle-file (filepath)&#xA;  &quot;Shortcut for exporting and tangling the org-mode file at `filepath'.&quot;&#xA;  (find-file (expand-file-name filepath))&#xA;  (org-html-export-to-html)&#xA;  (org-babel-tangle)&#xA;  (kill-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then use that function in a script for example. Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(export-tangle-file &quot;article.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;For all files in a directory&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You can even setup org-mode to publish and tangle a whole directory tree full&#xA;of org-mode files for you using the setting &lt;code&gt;org-publish-project-alist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some people use this to write blogs in org-mode and then publish the whole&#xA;blog using (&lt;code&gt;C-c C-e P p&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;org-publish-project-alist&lt;/code&gt; you create components that does different&#xA;types of publishing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of how you can set up copying static assets, publishing&#xA;org-mode articles and tangling org-mode articles:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-publish-project-alist&#xA;      '((&quot;assets&quot;&#xA;         :base-directory &quot;~/blog/articles/assets/&quot;&#xA;         :base-extension &quot;css\\|js\\|png\\|jpg\\|gif\\|pdf&quot;&#xA;         :publishing-directory &quot;~/blog/output/assets/&quot;&#xA;         :recursive t&#xA;         :publishing-function org-publish-attachment)&#xA;        (&quot;articles&quot;&#xA;         :base-directory &quot;~/blog/articles/&quot;&#xA;         :publishing-directory &quot;~/blog/output/&quot;&#xA;         :recursive t&#xA;         :publishing-function org-html-publish-to-html)&#xA;        (&quot;tangles&quot;&#xA;         :base-directory &quot;~/blog/articles/&quot;&#xA;         :publishing-directory &quot;~/blog/output/tangles/&quot;&#xA;         :recursive t&#xA;         :publishing-function org-babel-tangle-publish)&#xA;        (&quot;notebook&quot;&#xA;         :components (&quot;assets&quot; &quot;tangles&quot; &quot;articles&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code&gt;org-table-tangle-publish&lt;/code&gt; will put all tangles in the root of the &lt;code&gt;publish-directory&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you have setup tangling with a directory structure, it will be flattened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also encountered an error when the directory &lt;code&gt;publish-directory&lt;/code&gt; didn't exist. &#xA;After creating the directory it worked.&lt;/p&gt;&#xA;" OwnerUserId="14316" LastActivityDate="2016-12-21T09:31:36.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29473" PostTypeId="2" ParentId="29468" CreationDate="2016-12-21T10:21:29.867" Score="2" Body="&lt;p&gt;You can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Formatting-Strings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;format&lt;/code&gt;&lt;/a&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo (word1 word2)&#xA;  &quot;Print these two words.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (read-string &quot;Enter first word: &quot;)&#xA;    (read-string &quot;Enter second word: &quot;)))&#xA;  (shell-command-to-string (format &quot;~/foo.sh %s %s&quot; word1 word2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2016-12-21T10:21:29.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29474" PostTypeId="2" ParentId="29468" CreationDate="2016-12-21T10:37:54.597" Score="3" Body="&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; will tell you that &lt;code&gt;(shell-command-to-string COMMAND)&lt;/code&gt; is the general form for that function, so it is clear that &lt;code&gt;(shell-command-to-string &quot;bash ~/foo.sh %s %s&quot; word1 word2)&lt;/code&gt; is not valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;format&lt;/code&gt; as Håkon Hægland has shown, but you should always process your arguments with &lt;code&gt;shell-quote-argument&lt;/code&gt; to ensure the formatted shell command is correct.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2016-12-21T10:37:54.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29475" PostTypeId="2" ParentId="29471" CreationDate="2016-12-21T10:55:49.470" Score="3" Body="&lt;p&gt;I solved the problems with uninstall all org-packages in elpa.&#xA;Now the my .org files open without the error and the links work fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to Tobias for his hints! &lt;/p&gt;&#xA;" OwnerUserId="14305" LastActivityDate="2016-12-21T10:55:49.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29476" PostTypeId="1" AcceptedAnswerId="29484" CreationDate="2016-12-21T12:07:28.230" Score="3" ViewCount="861" Body="&lt;p&gt;Enabling &lt;code&gt;smartparens-strict-mode&lt;/code&gt; breaks &lt;code&gt;hungry-delete-mode&lt;/code&gt; as it overrides the hungry-delete remaps for &lt;kbd&gt;C-d&lt;/kbd&gt; and &lt;kbd&gt;C-h&lt;/kbd&gt; with smartparens specific functions. Hence, I have disabled &lt;code&gt;smartparens-strict-mode&lt;/code&gt; but I want to have the ability to always delete by pairs. I do not want to use &lt;code&gt;electric-pair-mode&lt;/code&gt; since it overrides some of the functionality of smartparens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this while also preserving &lt;code&gt;hungry-delete-mode&lt;/code&gt; functionality?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="12247" LastEditorUserId="12247" LastEditDate="2016-12-21T18:34:01.087" LastActivityDate="2017-07-09T09:24:03.940" Title="Always remove brackets by pairs - fix hungry-delete-mode and smartparens-strict-mode conflict" Tags="|text-editing|smartparens|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29477" PostTypeId="1" CreationDate="2016-12-21T13:14:31.510" Score="7" ViewCount="491" Body="&lt;p&gt;The &lt;code&gt;scheme-mode&lt;/code&gt; indents application in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define (x)&#xA;  (x 1&#xA;     2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when the function to apply is the result of another application &lt;code&gt;scheme-mode&lt;/code&gt; indents the code this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define (f)&#xA;  ((f) 1&#xA;   2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I would like to indent this in the same way as the first.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define (f)&#xA;  ((f) 1&#xA;       2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2016-12-21T13:14:31.510" Title="How to properly indent application in scheme-mode?" Tags="|indentation|scheme|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29479" PostTypeId="2" ParentId="29386" CreationDate="2016-12-21T13:59:44.900" Score="3" Body="&lt;p&gt;Each export back-end has &lt;code&gt;AUTHOR&lt;/code&gt; keyword, associated with global variable &lt;code&gt;user-full-name&lt;/code&gt;.  If it's empty, the &lt;code&gt;\author&lt;/code&gt; will not be exported.  You could redefine it into the file (buffer) with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+AUTHOR: Joe Brown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set only one &lt;code&gt;\author&lt;/code&gt;, which is defined into the buffer even if the &lt;code&gt;user-full-name&lt;/code&gt; is not empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org didn't check that you define author with &lt;code&gt;LATEX_HEADER: \author&lt;/code&gt;, it just outputs these lines.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-12-21T13:59:44.900" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29480" PostTypeId="2" ParentId="29470" CreationDate="2016-12-21T14:20:19.197" Score="1" Body="&lt;h1&gt;Your question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you insist on playing with your function, you should &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;start with setting &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; and examining the stack trace,&lt;/li&gt;&#xA;&lt;li&gt;then do &lt;kbd&gt;C-h f&lt;/kbd&gt; on all your functions&lt;/li&gt;&#xA;&lt;li&gt;then avoid interactive commands in your function, prefer lower level function&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, you are wasting your time. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The Right Way&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use Python REPL to debug each function in your file separately.&lt;/li&gt;&#xA;&lt;li&gt;To execute your whole file, do &lt;kbd&gt;C-u M-x compile RET python your-file-name.py RET&lt;/kbd&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To make it shorter, do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key mode-specific-map &quot;c&quot; 'compile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then &lt;kbd&gt;C-u C-c c python your-file-name.py RET&lt;/kbd&gt; (first time) after which all you need to do to run your file is &lt;kbd&gt;C-c c&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-12-21T14:20:19.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29481" PostTypeId="2" ParentId="29470" CreationDate="2016-12-21T14:25:20.143" Score="1" Body="&lt;p&gt;The &lt;code&gt;other-window&lt;/code&gt; function takes an argument &lt;code&gt;COUNT&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(other-window COUNT &amp;amp;optional ALL-FRAMES)&#xA;&#xA;Select another window in cyclic ordering of windows.&#xA;COUNT specifies the number of windows to skip, starting with the&#xA;selected window, before making the selection.  If COUNT is&#xA;positive, skip COUNT windows forwards.  If COUNT is negative,&#xA;skip -COUNT windows backwards.  COUNT zero means do not skip any&#xA;window, so select the selected window.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you would call other window like so: &lt;code&gt;(other-window 1)&lt;/code&gt; to get to the next window and &lt;code&gt;(other-window -1)&lt;/code&gt; to get to the previous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will also have to add an argument for the &lt;code&gt;comint-previous-input&lt;/code&gt; since you are not calling it interactively. You will also need to send the previous-input to the shell with &lt;code&gt;comint-send-input&lt;/code&gt;. Something like this works for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun run-shell-command-again ()&#xA;  (interactive)&#xA;  (save-buffer (buffer-name))&#xA;  (other-window 1)&#xA;  (comint-previous-input 1)&#xA;  (comint-send-input)&#xA;  (other-window -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But as @sds said there are some better (built-in) function in emacs that can take care of this for you!&lt;/p&gt;&#xA;" OwnerUserId="11966" LastActivityDate="2016-12-21T14:25:20.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29482" PostTypeId="2" ParentId="29459" CreationDate="2016-12-21T15:14:55.103" Score="22" Body="&lt;p&gt;The &lt;code&gt;describe-key&lt;/code&gt; command (&lt;code&gt;C-h k&lt;/code&gt;) will tell you what command is bound to a given key sequence. To go the other way and find out what keys (if any) are bound to a command, use &lt;code&gt;where-is&lt;/code&gt; (&lt;code&gt;C-h w&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can list all available key bindings using &lt;code&gt;describe-bindings&lt;/code&gt; (&lt;code&gt;C-h b&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of Emacs 25, you can also use &lt;code&gt;view-lossage&lt;/code&gt; (&lt;code&gt;C-h l&lt;/code&gt;) to see the recent history of every key typed and the corresponding commands that were executed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll notice these commands are all bound to the help map (&lt;code&gt;C-h&lt;/code&gt;). You might want to try &lt;code&gt;C-h C-h&lt;/code&gt; to see all the available help commands. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-22T15:51:57.300" LastActivityDate="2016-12-22T15:51:57.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29484" PostTypeId="2" ParentId="29476" CreationDate="2016-12-21T16:12:43.083" Score="2" Body="&lt;p&gt;One approach here is to use a context-specific key binding for the smartparens commands. (See &lt;a href=&quot;https://emacs.stackexchange.com/questions/26295/how-can-i-layer-a-keybinding/26297#26297&quot;&gt;How can I &amp;#39;layer&amp;#39; a keybinding?&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some code to have the smartparens commands for deleting forward or backward only called when the next (or previous) char is not whitespace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'smartparens&#xA;&#xA;  (dolist (key '( [remap delete-char]&#xA;                  [remap delete-forward-char]))&#xA;&#xA;    (define-key smartparens-strict-mode-map key&#xA;      '(menu-item &quot;maybe-sp-delete-char&quot; nil&#xA;                  :filter (lambda (&amp;amp;optional _)&#xA;                            (unless (looking-at-p &quot;[[:space:]\n]&quot;)&#xA;                              #'sp-delete-char)))))&#xA;&#xA;&#xA;  (dolist (key '([remap backward-delete-char-untabify]&#xA;                 [remap backward-delete-char]&#xA;                 [remap delete-backward-char]))&#xA;&#xA;    (define-key smartparens-strict-mode-map key&#xA;      '(menu-item &quot;maybe-sp-backward-delete-char&quot; nil&#xA;                  :filter (lambda (&amp;amp;optional _)&#xA;                            (unless (looking-back &quot;[[:space:]\n]&quot; 1)&#xA;                              #'sp-backward-delete-char))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This makes the smartparens bindings conditional on the char at or before point. For non-whitespace characters these commands are invoked as usual for smartparens strict mode. However when the next (or previous) char is whitespace, these bindings are nil and it falls back to the appropriate hungry-delete commands. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-12-21T16:37:24.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29485" PostTypeId="2" ParentId="29459" CreationDate="2016-12-21T16:24:22.507" Score="0" Body="&lt;p&gt;If you use &lt;code&gt;helm&lt;/code&gt;, you can try &lt;code&gt;helm-descbinds&lt;/code&gt;. It's pretty convenient, when you want to define your own bindings instead of using the preconfigured shortcuts.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2016-12-21T16:24:22.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29488" PostTypeId="1" CreationDate="2016-12-21T16:49:26.063" Score="5" ViewCount="1205" Body="&lt;p&gt;I want to print org files or share them with in emails.  Clean view looks good for these purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to export org files so that the output text file looks exactly like clean view (of course without theme colors)?&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2018-02-20T10:56:19.510" Title="How to export org files to plain text files as it looks like in clean view?" Tags="|org-mode|org-export|email|formatting|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29489" PostTypeId="2" ParentId="29452" CreationDate="2016-12-21T17:13:50.927" Score="1" Body="&lt;p&gt;The function &lt;code&gt;choices&lt;/code&gt; is a variation of &lt;code&gt;org-capture&lt;/code&gt; and the variable &lt;code&gt;choices-template&lt;/code&gt; is a variation of &lt;code&gt;org-capture-templates&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;USAGE&lt;/strong&gt;:  &lt;code&gt;M-x choices&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl)&#xA;&#xA;(defcustom choices-template&#xA;  '((&quot;1&quot; &quot;Group 1&quot;)&#xA;    (&quot;1a&quot; &quot;Sub-Function #1a&quot; butterfly)&#xA;    (&quot;1b&quot; &quot;Sub-Function #1b&quot; help-for-help)&#xA;    (&quot;2&quot; &quot;Function #2&quot; (lambda () &quot;test 2&quot;))&#xA;    (&quot;3&quot; &quot;Function #3&quot; (lambda () &quot;test 3&quot;))&#xA;    (&quot;4&quot; &quot;Function #4&quot; (lambda () &quot;test 4&quot;))&#xA;    (&quot;5&quot; &quot;Function #5&quot; (lambda () &quot;test 5&quot;))&#xA;    (&quot;6&quot; &quot;Function #6&quot; (lambda () &quot;test 6&quot;))&#xA;    (&quot;7&quot; &quot;Function #7&quot; (lambda () &quot;test 7&quot;))&#xA;    (&quot;8&quot; &quot;Function #8&quot; (lambda () &quot;test 8&quot;))&#xA;    (&quot;9&quot; &quot;Function #9&quot; (lambda () &quot;test 9&quot;)))&#xA;  &quot;Templates for the creation of new entries.&#xA;keys         The keys that will select the template, as a string, characters&#xA;             only, for example \&quot;a\&quot; for a template to be selected with a&#xA;             single key, or \&quot;bt\&quot; for selection with two keys.  When using&#xA;             several keys, keys using the same prefix key must be together&#xA;             in the list and preceded by a 2-element entry explaining the&#xA;             prefix key, for example&#xA;                     (\&quot;b\&quot; \&quot;Templates for marking stuff to buy\&quot;)&#xA;             The \&quot;C\&quot; key is used by default for quick access to the&#xA;             customization of the template variable.  But if you want to use&#xA;             that key for a template, you can.&#xA;description  A short string describing the template, will be shown during&#xA;             selection.&#xA;function     The function that will be called -- user either a symbol or a lambda form.&quot;&#xA;  :group 'choices&#xA;  :version &quot;25.1&quot;&#xA;  :type&#xA;  '(repeat&#xA;    (choice :value (&quot;&quot; &quot;&quot; &quot;&quot;)&#xA;      (list :tag &quot;Multikey description&quot;&#xA;        (string :tag &quot;Keys       &quot;)&#xA;        (string :tag &quot;Description&quot;))&#xA;      (list :tag &quot;Template entry&quot;&#xA;        (string :tag &quot;Keys           &quot;)&#xA;        (string :tag &quot;Description    &quot;)&#xA;        (choice :tag &quot;Function       &quot;&#xA;          (const :format &quot;&quot; function)&#xA;          (sexp :tag &quot;  Function&quot;))))))&#xA;&#xA;(defun choices (&amp;amp;optional verbose)&#xA;(interactive)&#xA;  (let* (&#xA;      (orig-buf (current-buffer))&#xA;      (wrap-it-up&#xA;        (lambda ()&#xA;          (when (get-buffer &quot;*CHOICES*&quot;)&#xA;            (when (get-buffer-window &quot;*CHOICES*&quot;)&#xA;              (delete-window (get-buffer-window &quot;*CHOICES*&quot;)))&#xA;            (kill-buffer &quot;*CHOICES*&quot;))))&#xA;      (entry&#xA;        (let ((templates choices-template)&#xA;              (inhibit-quit t)&#xA;              tbl orig-table dkey ddesc des-keys allowed-keys&#xA;              current prefix rtn re pressed)&#xA;            (set-buffer (get-buffer-create &quot;*CHOICES*&quot;))&#xA;            (setq orig-table templates)&#xA;            (catch 'exit&#xA;              (while t&#xA;                (erase-buffer)&#xA;                (insert &quot;Make a choice\n=========================\n\n&quot;)&#xA;                (setq tbl templates&#xA;                      des-keys nil&#xA;                      allowed-keys nil&#xA;                      cursor-type nil&#xA;                      prefix (if current (concat current &quot; &quot;) &quot;&quot;))&#xA;                (while tbl&#xA;                  (cond&#xA;                   ((and (= 2 (length (car tbl))) (= (length (caar tbl)) 1))&#xA;                    ;; This is a description on this level&#xA;                    (setq dkey (caar tbl)&#xA;                          ddesc (cadar tbl))&#xA;                    (pop tbl)&#xA;                    (push dkey des-keys)&#xA;                    (push dkey allowed-keys)&#xA;                    (insert&#xA;                      prefix&#xA;                      &quot;[&quot;&#xA;                      (propertize dkey 'face '(:foreground &quot;magenta&quot;))&#xA;                      &quot;] ... &quot;&#xA;                      ddesc&#xA;                      &quot; ...\n&quot;)&#xA;                    ;; Skip keys which are below this prefix&#xA;                    (setq re (concat &quot;\\`&quot; (regexp-quote dkey)))&#xA;                    (let (case-fold-search)&#xA;                      (while (and tbl (string-match re (caar tbl)))&#xA;                        (pop tbl))))&#xA;                   ((= 2 (length (car tbl)))&#xA;                    ;; Not yet a usable description, skip it&#xA;                    )&#xA;                   (t&#xA;                    ;; usable entry on this level&#xA;                    (insert&#xA;                      (propertize prefix 'face '(:foreground &quot;orangered&quot;))&#xA;                      &quot;[&quot;&#xA;                      (propertize&#xA;                        (if (stringp (caar tbl))&#xA;                          (caar tbl)&#xA;                          (format &quot;%s&quot; (caar tbl)))&#xA;                        'face '(:foreground &quot;red&quot;))&#xA;                      &quot;]  &quot;&#xA;                      (propertize&#xA;                        (if (stringp (nth 1 (car tbl)))&#xA;                          (nth 1 (car tbl))&#xA;                          (format &quot;%s&quot; (nth 1 (car tbl))))&#xA;                        'face '(:foreground &quot;green&quot;))&#xA;                      &quot;  &quot;&#xA;                      (let ((len 15)&#xA;                            (s (if (symbolp (nth 2 (car tbl)))&#xA;                                 (symbol-name (nth 2 (car tbl)))&#xA;                                 (format &quot;%s&quot; (nth 2 (car tbl))))))&#xA;                        (if (&amp;gt; (length s) len)&#xA;                          (concat (substring s 0 len) &quot; ...&quot;)&#xA;                          s))&#xA;                      &quot;\n&quot;)&#xA;                    (push (caar tbl) allowed-keys)&#xA;                    (pop tbl))))&#xA;                (insert &quot;------------------------------------\n&quot;)&#xA;                (let ((sp '((&quot;C&quot; &quot;Customize `choices-template'&quot;)&#xA;                            (&quot;q&quot; &quot;Abort&quot;))))&#xA;                  (while sp&#xA;                    (insert&#xA;                        &quot;[&quot;&#xA;                        (propertize (format &quot;%s&quot; (caar sp))&#xA;                          'face '(:foreground &quot;orange&quot;))&#xA;                        &quot;]  &quot;&#xA;                        (format &quot;%s&quot; (nth 1 (car sp)))&#xA;                        &quot;\n&quot;)&#xA;                    (push (caar sp) allowed-keys)&#xA;                    (pop sp)))&#xA;                (push &quot;\C-g&quot; allowed-keys)&#xA;                (goto-char (point-min))&#xA;                (display-buffer (get-buffer &quot;*CHOICES*&quot;) t)&#xA;                (setq pressed (char-to-string (read-char-exclusive &quot;Choose ...&quot;)))&#xA;                (while (not (member pressed allowed-keys))&#xA;                  (message &quot;Invalid key `%s'&quot; pressed) (sit-for 1)&#xA;                  (setq pressed (char-to-string (read-char-exclusive &quot;Select:  &quot;))))&#xA;                (when (equal pressed &quot;\C-g&quot;)&#xA;                  (let ((debug-on-quit nil))&#xA;                    (funcall wrap-it-up)&#xA;                    (signal 'quit '(&quot;You pressed `C-g' and chose to abort.&quot;))))&#xA;                (when (and (not (assoc pressed templates))&#xA;                           (not (member pressed des-keys))&#xA;                           (assoc pressed '((&quot;C&quot; &quot;Customize `choices-template'&quot;)&#xA;                                            (&quot;q&quot; &quot;Abort&quot;))))&#xA;                  (throw 'exit (setq rtn pressed)))&#xA;                (unless (member pressed des-keys)&#xA;                  (throw 'exit (setq rtn (rassoc (cdr (assoc pressed templates))&#xA;                         orig-table))))&#xA;                (setq current (concat current pressed))&#xA;                (setq templates (mapcar&#xA;                       (lambda (x)&#xA;                   (if (and (&amp;gt; (length (car x)) 1)&#xA;                      (equal (substring (car x) 0 1) pressed))&#xA;                       (cons (substring (car x) 1) (cdr x))&#xA;                     nil))&#xA;                       templates))&#xA;                (setq templates (remove nil templates))))&#xA;            (funcall wrap-it-up)&#xA;            rtn)))&#xA;    (cond&#xA;      ((equal entry &quot;C&quot;)&#xA;        (customize-variable 'choices-template))&#xA;      ((equal entry &quot;q&quot;)&#xA;        (let ((debug-on-quit nil))&#xA;          (when (get-buffer orig-buf)&#xA;            (switch-to-buffer (get-buffer orig-buf)))&#xA;          (signal 'quit '(&quot;You pressed `q'!&quot;))))&#xA;      (t&#xA;        (when (listp entry)&#xA;          (let ((choice (nth 0 entry))&#xA;                (description (nth 1 entry))&#xA;                (function (nth 2 entry)))&#xA;            (if (functionp function)&#xA;              (funcall function)&#xA;              (let ((debug-on-quit nil))&#xA;                (signal 'quit `(&quot;Something is wrong: %s&quot; ,function))))&#xA;            (when verbose&#xA;              (message &quot;choice: %s | description: %s | function: %s&quot;&#xA;                choice description function))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-27T05:51:31.763" LastActivityDate="2016-12-27T05:51:31.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29490" PostTypeId="2" ParentId="29451" CreationDate="2016-12-21T17:44:29.957" Score="1" Body="&lt;p&gt;You'll need to install &lt;a href=&quot;https://github.com/Fanael/relative-line-numbers&quot; rel=&quot;nofollow noreferrer&quot;&gt;relative-line-numbers&lt;/a&gt; for this one&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'relative-line-numbers)&#xA;&#xA;(defun yank-with-numbering ()&#xA;  (interactive)&#xA;  (relative-line-numbers-mode t)&#xA;  (call-interactively 'evil-yank)&#xA;  (relative-line-numbers-mode -1)&#xA;  )&#xA;(define-key&#xA;  evil-normal-state-local-map ;; or `evil-normal-local-map` if you want it globally&#xA;  (kbd &quot;y&quot;)&#xA;  #'yank-with-numbering)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe (I'm not sure) it's a good exercise that you try and code it yourself for deleting. You can find out the function name for &lt;code&gt;d&lt;/code&gt; by doing &lt;code&gt;C-h k d&lt;/code&gt; (&quot;help on key 'd'&quot;).&lt;/p&gt;&#xA;" OwnerUserId="10785" LastEditorUserId="10785" LastEditDate="2016-12-21T18:11:33.993" LastActivityDate="2016-12-21T18:11:33.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29491" PostTypeId="2" ParentId="29452" CreationDate="2016-12-21T17:51:15.913" Score="4" Body="&lt;p&gt;A much simpler way, using a &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow noreferrer&quot;&gt;hydra&lt;/a&gt;, is&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'hydra)&#xA;(defhydra my-info (nil nil :foreign-keys nil :hint nil :exit t)&#xA;  &quot;&#xA;Press key for command:&#xA;----------------------&#xA;_n_ Get user's name&#xA;_d_ Get user's directory&#xA;&#xA;_q_ quit&quot;&#xA;  (&quot;q&quot; nil)&#xA;  (&quot;n&quot; get-my-name)&#xA;  (&quot;d&quot; get-my-directory))&#xA;(global-set-key (kbd &quot;C-c u&quot;) 'my-info/body)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2016-12-21T17:51:15.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29492" PostTypeId="1" CreationDate="2016-12-21T17:51:46.257" Score="1" ViewCount="614" Body="&lt;p&gt;What is the best way to load in emacs the environment variables of a virtualenv?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I seem to have got virtualenvwrapper.el working.  For example, after using &lt;code&gt;venv-workon my_venv&lt;/code&gt;, then &lt;code&gt;M-! printenv&lt;/code&gt; shows that the environment variable &lt;code&gt;VIRTUAL_ENV&lt;/code&gt; has been set to &lt;code&gt;my_venv&lt;/code&gt;.  Likewise, different virtualenvs load different python versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also seems that I've got the package exec-path-from-shell.el working.  For example, in the terminal outside of any virtualenv the command  &lt;code&gt;printenv&lt;/code&gt; shows &lt;code&gt;MY_ENV_VARIABLE=oy&lt;/code&gt;. Now after doing &lt;code&gt;(exec-path-from-shell &quot;MY_ENV_VARIABLE&quot;)&lt;/code&gt; inside emacs, &lt;code&gt;M-! printenv&lt;/code&gt; confirms that &lt;code&gt;MY_ENV_VARIABLE=oy&lt;/code&gt; inside emacs as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I tried doing &lt;code&gt;venv-workon my_venv&lt;/code&gt; and then  &lt;code&gt;exec-path-from-shell MY_VENV_VARIABLE&lt;/code&gt;, which has been set in &lt;code&gt;my_venv&lt;/code&gt;.  Then, &lt;code&gt;exec-path-from-shell&lt;/code&gt; seems to find the value of &lt;code&gt;MY_VENV_VARIABLE&lt;/code&gt; to be &lt;code&gt;nil&lt;/code&gt; while actually it is &lt;code&gt;voy&lt;/code&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="11148" LastEditorUserId="11148" LastEditDate="2016-12-21T18:02:06.397" LastActivityDate="2016-12-21T18:02:06.397" Title="load environment variables of virtual environment in emacs" Tags="|python|variables|environment|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29493" PostTypeId="1" AcceptedAnswerId="29494" CreationDate="2016-12-21T18:10:57.673" Score="0" ViewCount="717" Body="&lt;p&gt;I am trying out &lt;a href=&quot;http://exercism.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;exercism.io&lt;/a&gt; and whenever I fetch any problem and build, it gets added to &lt;code&gt;projectile-known-projects&lt;/code&gt; and now I've  a whole bunch of projects under &lt;code&gt;projectile-known-projects&lt;/code&gt; which I do not want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is there a way to ignore all the &lt;em&gt;git&lt;/em&gt; projects under a directory, in my case &lt;code&gt;~/exercism/&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried adding &lt;code&gt;~/exercism/&lt;/code&gt; to &lt;code&gt;projectile-ignored-projects&lt;/code&gt; but that did not work(looks like it expects &lt;strong&gt;only&lt;/strong&gt; the path to an actual project directory not a non-project directory which &lt;em&gt;contains&lt;/em&gt; projects inside it)&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2016-12-21T18:33:37.833" Title="Ignore all git projects under a directory for projectile" Tags="|projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29494" PostTypeId="2" ParentId="29493" CreationDate="2016-12-21T18:27:04.560" Score="2" Body="&lt;p&gt;You can customize &lt;code&gt;projectile-ignored-project-function&lt;/code&gt; to specify a custom function that gets called when projectile is about to add a project to the known projects list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here is a how you might tell projectile to ignore any projects under &lt;code&gt;foo&lt;/code&gt;. (This uses the &lt;code&gt;f&lt;/code&gt; library for convenience. If you don't want to install another package you can use string functions or some other mechanism to decide if the given project root should be ignored.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'projectile&#xA;  (require 'f)&#xA;  (defun my-projectile-ignore-project (project-root)&#xA;    (f-descendant-of? project-root (expand-file-name &quot;/foo&quot;)))&#xA;  (setq projectile-ignored-project-function #'my-projectile-ignore-project))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you only want to ignore git projects you can add additional checks to the &lt;code&gt;my-projectile-ignore-project&lt;/code&gt; function, such as checking for a .git subdirectory: &lt;code&gt;(and ... (file-exists-p (expand-file-name &quot;.git&quot; project-root)))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-21T18:33:37.833" LastActivityDate="2016-12-21T18:33:37.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29495" PostTypeId="1" CreationDate="2016-12-21T18:29:10.380" Score="1" ViewCount="54" Body="&lt;p&gt;I'm interested in displaying adjacent boxed text using the &lt;code&gt;:box t&lt;/code&gt; face property in the following manner for adjacent text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hVBgI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hVBgI.png&quot; alt=&quot;visibly delimited adjacent boxes&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there an accepted convention for delimiting/isolating text properties between otherwise uninterrupted text?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For review (from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Attributes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Face Attributes&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;:box&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Whether or not a box should be drawn around characters, its&#xA;  color, the width of the box lines, and 3D appearance.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since face and text properties are attached to characters this particular face property is sort of an odd member among text/face properties.  Almost all other properties I can think of would not be expected to make a visual distinction that a text property was &quot;interrupted&quot; between adjacent visible characters.  Whereas with &lt;code&gt;:box&lt;/code&gt; you may wish to have a box boundary between respective &quot;boxes&quot;.  I can also imagine wanting to &quot;reset&quot; a stipple pattern (thereby potentially interrupting the tiling pattern).  If you can think of any other circumstances please comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only approach that came to mind other than using a null character (which doesn't work) was to include an arbitrary string and mark it invisible:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert&#xA; (concat&#xA;  (propertize &quot;foo&quot;&#xA;              'font-lock-ignore t&#xA;              'face '(:box t))&#xA;  (propertize &quot;X&quot;&#xA;              'invisible t)&#xA;  (propertize &quot;bar&quot;&#xA;              'font-lock-ignore t&#xA;              'face '(:box t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Incidentally I suspect that I found a rendering bug in emacs while considering this.  The following code renders as follows, but transitions to the desired rendering when the cursor moves to adjacent to the invisible character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/V0fi0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/V0fi0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2016-12-21T18:29:10.380" Title="Displaying adjacent boxed text (Zero-length/invisible delimiters for text properties?)" Tags="|faces|text-properties|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29496" PostTypeId="1" CreationDate="2016-12-21T23:07:44.063" Score="15" ViewCount="1101" Body="&lt;p&gt;I've got a heap of org-mode files which I publish into HTML for a knowledge base, sometimes the publishing crashes out due to a broken link or something and it's hard to find the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been recently using org-lint to find the problems. Is there a way to run this automatically through flycheck?&lt;/p&gt;&#xA;" OwnerUserId="9463" LastActivityDate="2019-09-05T17:20:08.897" Title="Automatically run org-lint through flycheck" Tags="|org-mode|flycheck|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29497" PostTypeId="2" ParentId="26569" CreationDate="2016-12-22T01:00:50.873" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.masteringemacs.org/article/running-shells-in-emacs-overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;This&lt;/a&gt; is a really nice overview of various shell options in emacs. Which shell you use depends on what you need. &lt;a href=&quot;https://github.com/adamrt/sane-term&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sane term&lt;/a&gt; is a nice basic terminal emulator. You can also look at the various settings &lt;a href=&quot;https://github.com/mclear-tools/dotemacs/blob/master/config.org#shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;I use&lt;/a&gt; if you like. I tend to use eshell for most things, but occasionally use sane term for more computation heavy tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is another way to call a terminal, if you use &lt;a href=&quot;https://www.iterm2.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;iterm&lt;/a&gt; (which you should) on OS X. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     (defun open-dir-in-iterm ()&#xA;    &quot;Open the current directory of the buffer in iTerm.&quot;&#xA;    (interactive)&#xA;    (let* ((iterm-app-path &quot;/Applications/iTerm.app&quot;)&#xA;           (iterm-brew-path &quot;/opt/homebrew-cask/Caskroom/iterm2/2.1.4/iTerm.app&quot;)&#xA;           (iterm-path (if (file-directory-p iterm-app-path)&#xA;                           iterm-app-path&#xA;                         iterm-brew-path)))&#xA;      (shell-command (concat &quot;open -a &quot; iterm-path &quot; .&quot;))))&#xA;      (global-set-key (kbd &quot;C-x t&quot;) 'open-dir-in-iterm)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2016-12-22T01:00:50.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29498" PostTypeId="2" ParentId="29446" CreationDate="2016-12-22T01:04:59.180" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://www.masteringemacs.org/article/running-shells-in-emacs-overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;This &lt;/a&gt;is a helpful overview of ways to use the various shells and terminals in emacs. I use eshell for most things (here's &lt;a href=&quot;https://github.com/mclear-tools/dotemacs/blob/master/config.org#eshell&quot; rel=&quot;nofollow noreferrer&quot;&gt;my config for eshell&lt;/a&gt;) if you care to take a look. But as the other answer notes, if you're going to be dumping a lot of text in a terminal, emacs will likely be too slow. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2016-12-22T01:04:59.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29499" PostTypeId="1" AcceptedAnswerId="29500" CreationDate="2016-12-22T02:45:13.647" Score="2" ViewCount="6214" Body="&lt;p&gt;There is a nice example of how to open neotree in the project root&lt;br&gt;see:&#xA; &lt;a href=&quot;https://www.emacswiki.org/emacs/NeoTree&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/NeoTree&lt;/a&gt; (&lt;code&gt;find-file-in-project&lt;/code&gt; and &lt;code&gt;Projectile&lt;/code&gt; sections).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'd like to &lt;strong&gt;toggle&lt;/strong&gt; neotree, so I can easily open and close it, while having the root set to the project path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2022-02-22T02:25:53.380" Title="How to toggle neotree in the project directory?" Tags="|files|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29500" PostTypeId="2" ParentId="29499" CreationDate="2016-12-22T03:03:23.697" Score="3" Body="&lt;p&gt;Using a slightly modified version of &lt;a href=&quot;https://github.com/jaypei/emacs-neotree/issues/149#issuecomment-263074312&quot; rel=&quot;nofollow noreferrer&quot;&gt;this post&lt;/a&gt;, I managed to get this working:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-neotree-project-dir-toggle ()&#xA;  &amp;quot;Open NeoTree using the project root, using projectile, find-file-in-project,&#xA;or the current buffer directory.&amp;quot;&#xA;  (interactive)&#xA;  (require 'neotree)&#xA;  (let* ((filepath (buffer-file-name))&#xA;         (project-dir&#xA;          (with-demoted-errors &amp;quot;neotree-project-dir-toggle error: %S&amp;quot;&#xA;              (cond&#xA;               ((featurep 'projectile)&#xA;                (projectile-project-root))&#xA;               ((featurep 'find-file-in-project)&#xA;                (ffip-project-root))&#xA;               (t ;; Fall back to version control root.&#xA;                (if filepath&#xA;                    (vc-call-backend&#xA;                     (vc-responsible-backend filepath) 'root filepath)&#xA;                  nil)))))&#xA;         (neo-smart-open t))&#xA;&#xA;    (if (and (fboundp 'neo-global--window-exists-p)&#xA;             (neo-global--window-exists-p))&#xA;        (neotree-hide)&#xA;      (neotree-show)&#xA;      (when project-dir&#xA;        (neotree-dir project-dir))&#xA;      (when filepath&#xA;        (neotree-find filepath)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Key binding to toggle, example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &amp;quot;M-e&amp;quot;) 'my-neotree-project-dir-toggle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2022-02-22T02:25:53.380" LastActivityDate="2022-02-22T02:25:53.380" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29501" PostTypeId="1" AcceptedAnswerId="29503" CreationDate="2016-12-22T10:58:47.673" Score="2" ViewCount="398" Body="&lt;p&gt;Based on this &lt;a href=&quot;https://stackoverflow.com/a/27048263&quot;&gt;answer&lt;/a&gt; my question is whether there is a (simple) way to automatically turn on &lt;code&gt;hl-line-mode&lt;/code&gt; whenever the cursor is within an org-mode table in an org-mode file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to find a hook for entering or leaving an org-mode table but I was not successful.&lt;/p&gt;&#xA;" OwnerUserId="10405" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-22T17:25:42.390" Title="Automatically turn on hl-line-mode inside org-mode tables" Tags="|org-mode|org-table|hl-line-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29502" PostTypeId="1" AcceptedAnswerId="29532" CreationDate="2016-12-22T11:19:22.570" Score="2" ViewCount="1491" Body="&lt;p&gt;I make a function that move from &lt;code&gt;TODO&lt;/code&gt; state to &lt;code&gt;DONE&lt;/code&gt; and archive it in the archives files, and I set &lt;code&gt;org-mode-map&lt;/code&gt; to make this function by a keybinding, but in agenda it doesn't change the &lt;code&gt;TODO&lt;/code&gt; state. I tried to find a &lt;code&gt;org-agenda-mode-map&lt;/code&gt; or something similar but I can't find it. My function is: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mark-done-and-archive ()&#xA;   (interactive)&#xA;   (org-todo 'done)&#xA;   (org-archive-subtree))&#xA; (define-key org-mode-map &quot;\C-c\C-x\C-s&quot; 'mark-done-and-archive)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;EDIT&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;So when in my &lt;code&gt;TODOS.org&lt;/code&gt; file I hit &lt;code&gt;C-c C-x C-s&lt;/code&gt; the todo automatically is marked as &lt;code&gt;DONE&lt;/code&gt; and move from &lt;code&gt;TODOS.org&lt;/code&gt; to &lt;code&gt;archive.org&lt;/code&gt; but when I make this in org-agenda buffer the todo is moved from his file well, the only problem is that it isn't marked as done. As example:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Archive todos.org&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;* TODO one todo from todo.org&#xA; * TODO Another todo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I open &lt;code&gt;todos.org&lt;/code&gt; and complete the first todo so I hit &lt;code&gt;C-c C-x C-s&lt;/code&gt; and the file &lt;code&gt;todos.org&lt;/code&gt; now contains:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;* TODO Another todo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;archive.org&lt;/code&gt; contains:&#xA;&lt;code&gt;DONE one todo from todo.org&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I show my org-agenda and &lt;code&gt;* TODO Another todo&lt;/code&gt; it's show, I try to complete and move to my archive file, again with &lt;code&gt;C-c C-x C-s&lt;/code&gt; but I obtain the following in archive.org:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;* DONE one todo from todo.org&#xA; * TODO Another todo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;todos.org&lt;/code&gt; it's empty.&lt;/p&gt;&#xA;" OwnerUserId="13992" LastEditorUserId="13992" LastEditDate="2016-12-22T17:43:49.997" LastActivityDate="2016-12-23T15:24:25.723" Title="archive todos from org agenda" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29503" PostTypeId="2" ParentId="29501" CreationDate="2016-12-22T14:41:13.497" Score="4" Body="&lt;p&gt;Org mode does provide the &lt;code&gt;org-at-table-p&lt;/code&gt; function that can be used to determine if the cursor is inside an org table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would need to check this every time the cursor moves, which could be done using the &lt;code&gt;post-command-hook&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun highlight-current-table-line ()&#xA;  (interactive)&#xA;  (if (org-at-table-p)&#xA;      (hl-line-mode 1)&#xA;    (hl-line-mode -1)))&#xA;&#xA;(defun setup-table-highlighting ()&#xA;  (add-hook 'post-command-hook #'highlight-current-table-line nil t))&#xA;&#xA;(add-hook 'org-mode-hook #'setup-table-highlighting)&#xA;(add-hook 'orgtbl-mode-hook #'setup-table-highlighting)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This adds a hook that runs after every command when you are in an org (or orgtbl) buffer, and toggles &lt;code&gt;hl-line-mode&lt;/code&gt; accordingly. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2016-12-22T15:06:36.647" LastActivityDate="2016-12-22T15:06:36.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29505" PostTypeId="1" AcceptedAnswerId="29506" CreationDate="2016-12-22T15:36:39.597" Score="2" ViewCount="480" Body="&lt;p&gt;this question is related to the question &#xA;&lt;a href=&quot;https://emacs.stackexchange.com/questions/2959/&quot;&gt;How to know my buffer&amp;#39;s visible/focused status?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to check if there exists a frame in which a given buffer is visible.&#xA;I tried the following but it gives true even if &lt;code&gt;scratch&lt;/code&gt; is invisible.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-buffer-window (find-buffer-visiting &quot;*scratch*&quot;) 'visible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-12-22T15:48:38.177" Title="How to check if there exists a frame in which a given buffer is visible" Tags="|buffers|frames|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29506" PostTypeId="2" ParentId="29505" CreationDate="2016-12-22T15:48:38.177" Score="5" Body="&lt;p&gt;It's not clear why you want the call to &lt;code&gt;find-buffer-visiting&lt;/code&gt;.&#xA;The following works as expected:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get-buffer-window &quot;*scratch*&quot; 'visible)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2016-12-22T15:48:38.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29507" PostTypeId="2" ParentId="29325" CreationDate="2016-12-22T15:48:49.537" Score="0" Body="&lt;p&gt;This is done in the &lt;a href=&quot;https://github.com/coldnew/linum-relative&quot; rel=&quot;nofollow noreferrer&quot;&gt;linum-relative&lt;/a&gt; package&lt;/p&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2016-12-22T15:48:49.537" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29508" PostTypeId="1" CreationDate="2016-12-22T16:39:30.193" Score="9" ViewCount="325" Body="&lt;p&gt;I've run into a problem viewing pdf documentation files with AucTex. I use &lt;code&gt;pdf-tools&lt;/code&gt; to view PDF files from within Emacs, and I've set &lt;code&gt;emacsclient -n&lt;/code&gt; as my default pdf-viewer (via xdg-mime on Debian Linux). This works fine in most circumstances, but it breaks the &lt;code&gt;(Tex-documentation-texdoc ...)&lt;/code&gt; function of Auctex (&lt;code&gt;C-c ?&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've narrowed the problem down to a single line of code. When I try to view the documentation for the &lt;code&gt;listings&lt;/code&gt; package, &lt;code&gt;TeX-documentation-texdoc&lt;/code&gt; turns this into the following sexp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string &quot;texdoc --view  listings&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;texdoc&lt;/code&gt; in turn calls &lt;code&gt;emacsclient&lt;/code&gt; to actually open the file (based on how I've configured my desktop via xdg). However, at this point, the Emacs hangs and I need to quit (&lt;code&gt;C-g&lt;/code&gt;) to get control back. After that, no new pdf is opened. The same thing happens if I try to call emacsclient directly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(shell-command-to-string &quot;emacsclient -n tmp.pdf&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both commands work at the command line (i.e., &lt;code&gt;emacsclient -n tmp.pdf&lt;/code&gt; and &lt;code&gt;texdoc --view listings&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, in an instance like this, how do I call emacsclient from within Emacs? (and I know I could just open the pdf file with &lt;code&gt;find-file&lt;/code&gt;; that's not an option here as I need to call an external process (texdoc) to find the file, and that process then invokes emacsclient).&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2016-12-24T17:39:09.047" Title="Call emacsclient from a program called by Emacs" Tags="|auctex|emacsclient|pdf-tools|" AnswerCount="2" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="29509" PostTypeId="2" ParentId="28811" CreationDate="2016-12-22T16:42:34.813" Score="0" Body="&lt;p&gt;If this is specifically about TODO-style comments, there are various packages available from &lt;a href=&quot;https://melpa.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA&lt;/a&gt; that provide highlighting and related commands such as jumping to the next/previous such comment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/tarsius/hl-todo&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;hl-todo&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/rolandwalker/fixmee&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;fixmee&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastActivityDate="2016-12-22T16:42:34.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29510" PostTypeId="1" CreationDate="2016-12-22T17:18:37.043" Score="3" ViewCount="5286" Body="&lt;p&gt;I've installed this great theme &lt;code&gt;atom-one-dark&lt;/code&gt; and I love it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, one thing I'd like to change is the modeline colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, the &lt;em&gt;grey&lt;/em&gt; one is the &lt;strong&gt;inactive&lt;/strong&gt; one and the &lt;em&gt;black&lt;/em&gt; one is the &lt;strong&gt;active&lt;/strong&gt; one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jbHJm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jbHJm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to change it to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;grey (filled)&lt;/em&gt; = &lt;strong&gt;active&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;grey (border-only)&lt;/em&gt; = &lt;strong&gt;inactive&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have no Idea how to go about it and the theme file has a lot of lisp code. I'd appreciate if someone could at least point me in the right direction in terms of what I would have to change in the theme file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the contents of &lt;code&gt;atom-one-dark-theme.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ;;; atom-one-dark-theme.el --- Atom One Dark color theme&#xA;;;&#xA;;; Copyright 2016 Jonathan Chu&#xA;;;&#xA;;; Author: Jonathan Chu &amp;lt;me@jonathanchu.is&amp;gt;&#xA;;; URL: https://github.com/jonathanchu/atom-one-dark-theme&#xA;;; Package-Version: 20161101.1955&#xA;;; Version: 0.4.0&#xA;;;&#xA;;;; Commentary:&#xA;;;&#xA;;; An Emacs port of the Atom One Dark theme from Atom.io.&#xA;;;&#xA;;;; Code:&#xA;&#xA;(deftheme atom-one-dark&#xA;  &quot;Atom One Dark - An Emacs port of the Atom One Dark theme from Atom.io.&quot;)&#xA;&#xA;(defvar atom-one-dark-colors-alist&#xA;  '((&quot;atom-one-dark-accent&quot;   . &quot;#528BFF&quot;)&#xA;    (&quot;atom-one-dark-fg&quot;       . &quot;#ABB2BF&quot;)&#xA;    (&quot;atom-one-dark-bg&quot;       . &quot;#282C34&quot;)&#xA;    (&quot;atom-one-dark-bg-1&quot;     . &quot;#121417&quot;)&#xA;    (&quot;atom-one-dark-bg-hl&quot;    . &quot;#2F343D&quot;)&#xA;    (&quot;atom-one-dark-gutter&quot;   . &quot;#666D7A&quot;)&#xA;    (&quot;atom-one-dark-accent&quot;   . &quot;#AEB9F5&quot;)&#xA;    (&quot;atom-one-dark-mono-1&quot;   . &quot;#ABB2BF&quot;)&#xA;    (&quot;atom-one-dark-mono-2&quot;   . &quot;#828997&quot;)&#xA;    (&quot;atom-one-dark-mono-3&quot;   . &quot;#5C6370&quot;)&#xA;    (&quot;atom-one-dark-cyan&quot;     . &quot;#56B6C2&quot;)&#xA;    (&quot;atom-one-dark-blue&quot;     . &quot;#61AFEF&quot;)&#xA;    (&quot;atom-one-dark-purple&quot;   . &quot;#C678DD&quot;)&#xA;    (&quot;atom-one-dark-green&quot;    . &quot;#98C379&quot;)&#xA;    (&quot;atom-one-dark-red-1&quot;    . &quot;#E06C75&quot;)&#xA;    (&quot;atom-one-dark-red-2&quot;    . &quot;#BE5046&quot;)&#xA;    (&quot;atom-one-dark-orange-1&quot; . &quot;#D19A66&quot;)&#xA;    (&quot;atom-one-dark-orange-2&quot; . &quot;#E5C07B&quot;)&#xA;    (&quot;atom-one-dark-gray&quot;     . &quot;#3E4451&quot;)&#xA;    (&quot;atom-one-dark-silver&quot;   . &quot;#AAAAAA&quot;)&#xA;    (&quot;atom-one-dark-black&quot;    . &quot;#0F1011&quot;))&#xA;  &quot;List of Atom One Dark colors.&quot;)&#xA;&#xA;(defmacro atom-one-dark-with-color-variables (&amp;amp;rest body)&#xA;  &quot;Bind the colors list around BODY.&quot;&#xA;  (declare (indent 0))&#xA;  `(let ((class '((class color) (min-colors 89)))&#xA;         ,@ (mapcar (lambda (cons)&#xA;                      (list (intern (car cons)) (cdr cons)))&#xA;                    atom-one-dark-colors-alist))&#xA;     ,@body))&#xA;&#xA;(atom-one-dark-with-color-variables&#xA;  (custom-theme-set-faces&#xA;   'atom-one-dark&#xA;&#xA;   `(default ((t (:foreground ,atom-one-dark-fg :background ,atom-one-dark-bg))))&#xA;   `(success ((t (:foreground ,atom-one-dark-green))))&#xA;   `(warning ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(error ((t (:foreground ,atom-one-dark-red-1 :weight bold))))&#xA;   `(link ((t (:foreground ,atom-one-dark-blue :underline t :weight bold))))&#xA;   `(link-visited ((t (:foreground ,atom-one-dark-blue :underline t :weight normal))))&#xA;   `(cursor ((t (:background ,atom-one-dark-accent))))&#xA;   `(fringe ((t (:background ,atom-one-dark-bg))))&#xA;   `(region ((t (:background ,atom-one-dark-gray))))&#xA;   `(highlight ((t (:background ,atom-one-dark-gray))))&#xA;   `(hl-line ((t (:background ,atom-one-dark-bg-hl))))&#xA;   `(vertical-border ((t (:foreground ,atom-one-dark-mono-3))))&#xA;   `(secondary-selection ((t (:background ,atom-one-dark-bg-1))))&#xA;   `(query-replace ((t (:inherit (isearch)))))&#xA;   `(minibuffer-prompt ((t (:foreground ,atom-one-dark-silver))))&#xA;&#xA;   `(font-lock-builtin-face ((t (:foreground ,atom-one-dark-cyan))))&#xA;   `(font-lock-comment-face ((t (:foreground ,atom-one-dark-mono-3))))&#xA;   `(font-lock-comment-delimiter-face ((default (:inherit (font-lock-comment-face)))))&#xA;   `(font-lock-doc-face ((t (:inherit (font-lock-string-face)))))&#xA;   `(font-lock-function-name-face ((t (:foreground ,atom-one-dark-blue))))&#xA;   `(font-lock-keyword-face ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(font-lock-preprocessor-face ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(font-lock-string-face ((t (:foreground ,atom-one-dark-green))))&#xA;   `(font-lock-type-face ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(font-lock-constant-face ((t (:foreground ,atom-one-dark-cyan))))&#xA;   `(font-lock-variable-name-face ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(font-lock-warning-face ((t (:foreground ,atom-one-dark-mono-3 :bold t))))&#xA;&#xA;   ;; mode-line&#xA;   `(mode-line ((t (:background ,atom-one-dark-black :foreground ,atom-one-dark-silver))))&#xA;   `(mode-line-buffer-id ((t (:weight bold))))&#xA;   `(mode-line-emphasis ((t (:weight bold))))&#xA;   `(mode-line-inactive ((t (:background ,atom-one-dark-gray))))&#xA;&#xA;   ;; ido&#xA;   `(ido-first-match ((t (:foreground ,atom-one-dark-purple :weight bold))))&#xA;   `(ido-only-match ((t (:foreground ,atom-one-dark-red-1 :weight bold))))&#xA;   `(ido-subdir ((t (:foreground ,atom-one-dark-blue))))&#xA;   `(ido-virtual ((t (:foreground ,atom-one-dark-mono-3))))&#xA;&#xA;   ;; ace-jump&#xA;   `(ace-jump-face-background ((t (:foreground ,atom-one-dark-mono-3 :background ,atom-one-dark-bg-1 :inverse-video nil))))&#xA;   `(ace-jump-face-foreground ((t (:foreground ,atom-one-dark-red-1 :background ,atom-one-dark-bg-1 :inverse-video nil))))&#xA;&#xA;   ;; company-mode&#xA;   `(company-tooltip ((t (:foreground ,atom-one-dark-fg :background ,atom-one-dark-bg-1))))&#xA;   `(company-tooltip-annotation ((t (:foreground ,atom-one-dark-mono-2 :background ,atom-one-dark-bg-1))))&#xA;   `(company-tooltip-selection ((t (:foreground ,atom-one-dark-fg :background ,atom-one-dark-gray))))&#xA;   `(company-tooltip-mouse ((t (:background ,atom-one-dark-gray))))&#xA;   `(company-tooltip-common ((t (:foreground ,atom-one-dark-orange-2 :background ,atom-one-dark-bg-1))))&#xA;   `(company-tooltip-common-selection ((t (:foreground ,atom-one-dark-orange-2 :background ,atom-one-dark-gray))))&#xA;   `(company-preview ((t (:background ,atom-one-dark-bg))))&#xA;   `(company-preview-common ((t (:foreground ,atom-one-dark-orange-2 :background ,atom-one-dark-bg))))&#xA;   `(company-scrollbar-fg ((t (:background ,atom-one-dark-mono-1))))&#xA;   `(company-scrollbar-bg ((t (:background ,atom-one-dark-bg-1))))&#xA;&#xA;   ;; compilation&#xA;   `(compilation-face ((t (:foreground ,atom-one-dark-fg))))&#xA;   `(compilation-line-number ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(compilation-column-number ((t (:foreground ,atom-one-dark-mono-2))))&#xA;&#xA;   ;; isearch&#xA;   `(isearch ((t (:foreground ,atom-one-dark-bg :background ,atom-one-dark-purple))))&#xA;   `(isearch-fail ((t (:foreground ,atom-one-dark-red-2 :background nil))))&#xA;   `(lazy-highlight ((t (:foreground ,atom-one-dark-purple :background ,atom-one-dark-bg-1 :underline ,atom-one-dark-purple))))&#xA;&#xA;   ;; diff-hl (https://github.com/dgutov/diff-hl)&#xA;   '(diff-hl-change ((t (:foreground &quot;#E9C062&quot; :background &quot;#8b733a&quot;))))&#xA;   '(diff-hl-delete ((t (:foreground &quot;#CC6666&quot; :background &quot;#7a3d3d&quot;))))&#xA;   '(diff-hl-insert ((t (:foreground &quot;#A8FF60&quot; :background &quot;#547f30&quot;))))&#xA;&#xA;   ;; dired-mode&#xA;   '(dired-directory ((t (:inherit (font-lock-keyword-face)))))&#xA;   '(dired-flagged ((t (:inherit (diff-hl-delete)))))&#xA;   '(dired-symlink ((t (:foreground &quot;#FD5FF1&quot;))))&#xA;&#xA;   ;; helm&#xA;   `(helm-header ((t (:foreground ,atom-one-dark-mono-2&#xA;                      :background ,atom-one-dark-bg&#xA;                      :underline nil&#xA;                      :box (:line-width 6 :color ,atom-one-dark-bg)))))&#xA;   `(helm-source-header ((t (:foreground ,atom-one-dark-orange-2&#xA;                             :background ,atom-one-dark-bg&#xA;                             :underline nil&#xA;                             :weight bold&#xA;                             :box (:line-width 6 :color ,atom-one-dark-bg)))))&#xA;   `(helm-selection ((t (:background ,atom-one-dark-gray))))&#xA;   `(helm-selection-line ((t (:background ,atom-one-dark-gray))))&#xA;   `(helm-visible-mark ((t (:foreground ,atom-one-dark-bg :foreground ,atom-one-dark-orange-2))))&#xA;   `(helm-candidate-number ((t (:foreground ,atom-one-dark-green :background ,atom-one-dark-bg-1))))&#xA;   `(helm-separator ((t (:background ,atom-one-dark-bg :foreground ,atom-one-dark-red-1))))&#xA;   `(helm-M-x-key ((t (:foreground ,atom-one-dark-orange-1))))&#xA;   `(helm-bookmark-addressbook ((t (:foreground ,atom-one-dark-orange-1))))&#xA;   `(helm-bookmark-directory ((t (:foreground nil :background nil :inherit helm-ff-directory))))&#xA;   `(helm-bookmark-file ((t (:foreground nil :background nil :inherit helm-ff-file))))&#xA;   `(helm-bookmark-gnus ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(helm-bookmark-info ((t (:foreground ,atom-one-dark-green))))&#xA;   `(helm-bookmark-man ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(helm-bookmark-w3m ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(helm-match ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(helm-ff-directory ((t (:foreground ,atom-one-dark-cyan :background ,atom-one-dark-bg :weight bold))))&#xA;   `(helm-ff-file ((t (:foreground ,atom-one-dark-fg :background ,atom-one-dark-bg :weight normal))))&#xA;   `(helm-ff-executable ((t (:foreground ,atom-one-dark-green :background ,atom-one-dark-bg :weight normal))))&#xA;   `(helm-ff-invalid-symlink ((t (:foreground ,atom-one-dark-red-1 :background ,atom-one-dark-bg :weight bold))))&#xA;   `(helm-ff-symlink ((t (:foreground ,atom-one-dark-orange-2 :background ,atom-one-dark-bg :weight bold))))&#xA;   `(helm-ff-prefix ((t (:foreground ,atom-one-dark-bg :background ,atom-one-dark-orange-2 :weight normal))))&#xA;   `(helm-buffer-not-saved ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(helm-buffer-process ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(helm-buffer-saved-out ((t (:foreground ,atom-one-dark-fg))))&#xA;   `(helm-buffer-size ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(helm-buffer-directory ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(helm-grep-cmd-line ((t (:foreground ,atom-one-dark-cyan))))&#xA;   `(helm-grep-file ((t (:foreground ,atom-one-dark-fg))))&#xA;   `(helm-grep-finish ((t (:foreground ,atom-one-dark-green))))&#xA;   `(helm-grep-lineno ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(helm-grep-finish ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(helm-grep-match ((t (:foreground nil :background nil :inherit helm-match))))&#xA;&#xA;   ;; git-commit&#xA;   `(git-commit-comment-action  ((t (:foreground ,atom-one-dark-green :weight bold))))&#xA;   `(git-commit-comment-branch  ((t (:foreground ,atom-one-dark-blue :weight bold))))&#xA;   `(git-commit-comment-heading ((t (:foreground ,atom-one-dark-orange-2 :weight bold))))&#xA;&#xA;   ;; js2-mode&#xA;   `(js2-function-call ((t (:inherit (font-lock-function-name-face)))))&#xA;   `(js2-function-param ((t (:foreground ,atom-one-dark-mono-1))))&#xA;   `(js2-jsdoc-tag ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(js2-jsdoc-type ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(js2-jsdoc-value((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(js2-object-property ((t (:foreground ,atom-one-dark-red-1))))&#xA;&#xA;   ;; magit&#xA;   `(magit-section-highlight ((t (:background ,atom-one-dark-bg-hl))))&#xA;   `(magit-section-heading ((t (:foreground ,atom-one-dark-orange-2 :weight bold))))&#xA;   `(magit-section-heading-selection ((t (:foreground ,atom-one-dark-fg :weight bold))))&#xA;   `(magit-diff-file-heading ((t (:weight bold))))&#xA;   `(magit-diff-file-heading-highlight ((t (:background ,atom-one-dark-gray :weight bold))))&#xA;   `(magit-diff-file-heading-selection ((t (:foreground ,atom-one-dark-orange-2 :background ,atom-one-dark-bg-hl :weight bold))))&#xA;   `(magit-diff-hunk-heading ((t (:foreground ,atom-one-dark-mono-2 :background ,atom-one-dark-gray))))&#xA;   `(magit-diff-hunk-heading-highlight ((t (:foreground ,atom-one-dark-mono-1 :background ,atom-one-dark-mono-3))))&#xA;   `(magit-diff-hunk-heading-selection ((t (:foreground ,atom-one-dark-purple :background ,atom-one-dark-mono-3))))&#xA;   `(magit-diff-context ((t (:foreground ,atom-one-dark-fg))))&#xA;   `(magit-diff-context-highlight ((t (:background ,atom-one-dark-bg-1 :foreground ,atom-one-dark-fg))))&#xA;   `(magit-diffstat-added ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-diffstat-removed ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(magit-process-ok ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-process-ng ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(magit-log-author ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(magit-log-date ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(magit-log-graph ((t (:foreground ,atom-one-dark-silver))))&#xA;   `(magit-sequence-pick ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(magit-sequence-stop ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-sequence-part ((t (:foreground ,atom-one-dark-orange-1))))&#xA;   `(magit-sequence-head ((t (:foreground ,atom-one-dark-blue))))&#xA;   `(magit-sequence-drop ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(magit-sequence-done ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(magit-sequence-onto ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(magit-bisect-good ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-bisect-skip ((t (:foreground ,atom-one-dark-orange-1))))&#xA;   `(magit-bisect-bad ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(magit-blame-heading ((t (:background ,atom-one-dark-bg-1 :foreground ,atom-one-dark-mono-2))))&#xA;   `(magit-blame-hash ((t (:background ,atom-one-dark-bg-1 :foreground ,atom-one-dark-purple))))&#xA;   `(magit-blame-name ((t (:background ,atom-one-dark-bg-1 :foreground ,atom-one-dark-orange-2))))&#xA;   `(magit-blame-date ((t (:background ,atom-one-dark-bg-1 :foreground ,atom-one-dark-mono-3))))&#xA;   `(magit-blame-summary ((t (:background ,atom-one-dark-bg-1 :foreground ,atom-one-dark-mono-2))))&#xA;   `(magit-dimmed ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(magit-hash ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(magit-tag  ((t (:foreground ,atom-one-dark-orange-1 :weight bold))))&#xA;   `(magit-branch-remote  ((t (:foreground ,atom-one-dark-green :weight bold))))&#xA;   `(magit-branch-local   ((t (:foreground ,atom-one-dark-blue :weight bold))))&#xA;   `(magit-branch-current ((t (:foreground ,atom-one-dark-blue :weight bold :box t))))&#xA;   `(magit-head           ((t (:foreground ,atom-one-dark-blue :weight bold))))&#xA;   `(magit-refname        ((t (:background ,atom-one-dark-bg :foreground ,atom-one-dark-fg :weight bold))))&#xA;   `(magit-refname-stash  ((t (:background ,atom-one-dark-bg :foreground ,atom-one-dark-fg :weight bold))))&#xA;   `(magit-refname-wip    ((t (:background ,atom-one-dark-bg :foreground ,atom-one-dark-fg :weight bold))))&#xA;   `(magit-signature-good      ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-signature-bad       ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(magit-signature-untrusted ((t (:foreground ,atom-one-dark-orange-1))))&#xA;   `(magit-cherry-unmatched    ((t (:foreground ,atom-one-dark-cyan))))&#xA;   `(magit-cherry-equivalent   ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(magit-reflog-commit       ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-reflog-amend        ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(magit-reflog-merge        ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-reflog-checkout     ((t (:foreground ,atom-one-dark-blue))))&#xA;   `(magit-reflog-reset        ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(magit-reflog-rebase       ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(magit-reflog-cherry-pick  ((t (:foreground ,atom-one-dark-green))))&#xA;   `(magit-reflog-remote       ((t (:foreground ,atom-one-dark-cyan))))&#xA;   `(magit-reflog-other        ((t (:foreground ,atom-one-dark-cyan))))&#xA;&#xA;   ;; rainbow-delimiters&#xA;   `(rainbow-delimiters-depth-1-face ((t (:foreground ,atom-one-dark-fg))))&#xA;   `(rainbow-delimiters-depth-2-face ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(rainbow-delimiters-depth-3-face ((t (:foreground ,atom-one-dark-blue))))&#xA;   `(rainbow-delimiters-depth-4-face ((t (:foreground ,atom-one-dark-cyan))))&#xA;   `(rainbow-delimiters-depth-5-face ((t (:foreground ,atom-one-dark-green))))&#xA;   `(rainbow-delimiters-depth-6-face ((t (:foreground ,atom-one-dark-orange-1))))&#xA;   `(rainbow-delimiters-depth-7-face ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(rainbow-delimiters-depth-8-face ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(rainbow-delimiters-depth-9-face ((t (:foreground ,atom-one-dark-red-2))))&#xA;   `(rainbow-delimiters-depth-10-face ((t (:foreground ,atom-one-dark-mono-1))))&#xA;   `(rainbow-delimiters-depth-11-face ((t (:foreground ,atom-one-dark-mono-2))))&#xA;   `(rainbow-delimiters-depth-12-face ((t (:foreground ,atom-one-dark-mono-3))))&#xA;   `(rainbow-delimiters-unmatched-face ((t (:foreground ,atom-one-dark-black))))&#xA;&#xA;   ;; rbenv&#xA;   `(rbenv-active-ruby-face ((t (:foreground ,atom-one-dark-green))))&#xA;&#xA;   ;; smartparens&#xA;   `(sp-show-pair-mismatch-face ((t (:foreground ,atom-one-dark-red-1 :background ,atom-one-dark-gray :weight bold))))&#xA;   `(sp-show-pair-match-face ((t (:background ,atom-one-dark-gray :weight bold))))&#xA;&#xA;   ;; web-mode&#xA;   `(web-mode-symbol-face ((t (:foreground ,atom-one-dark-orange-1))))&#xA;&#xA;   ;; flx-ido&#xA;   `(flx-highlight-face ((t (:inherit (link) :weight bold))))&#xA;&#xA;   ;; rpm-spec-mode&#xA;   `(rpm-spec-tag-face ((t (:foreground ,atom-one-dark-blue))))&#xA;   `(rpm-spec-obsolete-tag-face ((t (:foreground &quot;#FFFFFF&quot; :background ,atom-one-dark-red-2))))&#xA;   `(rpm-spec-macro-face ((t (:foreground ,atom-one-dark-orange-2))))&#xA;   `(rpm-spec-var-face ((t (:foreground ,atom-one-dark-red-1))))&#xA;   `(rpm-spec-doc-face ((t (:foreground ,atom-one-dark-purple))))&#xA;   `(rpm-spec-dir-face ((t (:foreground ,atom-one-dark-cyan))))&#xA;   `(rpm-spec-package-face ((t (:foreground ,atom-one-dark-red-2))))&#xA;   `(rpm-spec-ghost-face ((t (:foreground ,atom-one-dark-red-2))))&#xA;   `(rpm-spec-section-face ((t (:foreground ,atom-one-dark-orange-2))))&#xA;&#xA;   ;; term&#xA;   `(term-color-black ((t :foreground ,atom-one-dark-mono-1)))&#xA;   `(term-color-blue ((t (:foreground ,atom-one-dark-blue))))&#xA;   `(term-color-cyan ((t :foreground ,atom-one-dark-cyan)))&#xA;   `(term-color-green ((t (:foreground ,atom-one-dark-green))))&#xA;   `(term-color-magenta ((t :foreground ,atom-one-dark-purple)))&#xA;   `(term-color-red ((t :foreground ,atom-one-dark-red-1)))&#xA;   `(term-color-white ((t :foreground ,atom-one-dark-fg)))&#xA;   `(term-color-yellow ((t (:foreground ,atom-one-dark-orange-1))))&#xA;&#xA;   ;; linum&#xA;   `(linum ((t (:foreground ,atom-one-dark-gutter :background ,atom-one-dark-bg))))&#xA;   ;; hlinum&#xA;   `(linum-highlight-face ((t (:foreground ,atom-one-dark-accent :background ,atom-one-dark-bg))))&#xA;   ))&#xA;&#xA;(atom-one-dark-with-color-variables&#xA;  (custom-theme-set-variables&#xA;   'atom-one-dark&#xA;;;;;; fill-column-indicator&#xA;   `(fci-rule-color ,atom-one-dark-gray)&#xA;   ))&#xA;&#xA;(defvar atom-one-dark-theme-force-faces-for-mode t&#xA;  &quot;If t, atom-one-dark-theme will use Face Remapping to alter the theme faces for&#xA;the current buffer based on its mode in an attempt to mimick the Atom One Dark&#xA;Theme from Atom.io as best as possible.&#xA;The reason this is required is because some modes (html-mode, jyaml-mode, ...)&#xA;do not provide the necessary faces to do theming without conflicting with other&#xA;modes.&#xA;Current modes, and their faces, impacted by this variable:&#xA;* js2-mode: font-lock-constant-face, font-lock-doc-face, font-lock-variable-name-face&#xA;&quot;)&#xA;&#xA;;; Many modes in Emacs do not define their own faces and instead use standard Emacs faces when it comes to theming.&#xA;;; That being said, to have a real &quot;Atom One Dark Theme&quot; for Emacs, we need to work around this so that these themes look&#xA;;; as much like &quot;Atom One Dark Theme&quot; as possible.  This means using per-buffer faces via &quot;Face Remapping&quot;:&#xA;;;&#xA;;;   http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html&#xA;;;&#xA;;; Of course, this might be confusing to some when in one mode they see keywords highlighted in one face and in another&#xA;;; mode they see a different face.  That being said, you can set the `atom-one-dark-theme-force-faces-for-mode` variable to&#xA;;; `nil` to disable this feature.&#xA;(defun atom-one-dark-theme-change-faces-for-mode ()&#xA;  (interactive)&#xA;  (and (eq atom-one-dark-theme-force-faces-for-mode t)&#xA;       (cond&#xA;        ((member major-mode '(js2-mode))&#xA;         ;; atom-one-dark-orange-1&#xA;         (face-remap-add-relative 'font-lock-constant-face :foreground &quot;#D19A66&quot;)&#xA;         (face-remap-add-relative 'font-lock-doc-face '(:inherit (font-lock-comment-face)))&#xA;         ;; atom-one-dark-mono-1&#xA;         (face-remap-add-relative 'font-lock-variable-name-face :foreground &quot;#ABB2BF&quot;))&#xA;        )))&#xA;&#xA;(add-hook 'after-change-major-mode-hook 'atom-one-dark-theme-change-faces-for-mode)&#xA;&#xA;;;;###autoload&#xA;(and load-file-name&#xA;    (boundp 'custom-theme-load-path)&#xA;    (add-to-list 'custom-theme-load-path&#xA;                 (file-name-as-directory&#xA;                  (file-name-directory load-file-name))))&#xA;;; Automatically add this theme to the load path&#xA;&#xA;(provide-theme 'atom-one-dark)&#xA;&#xA;;; Local Variables:&#xA;;; no-byte-compile: t&#xA;;; End:&#xA;;;; atom-one-dark-theme.el ends here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2016-12-22T17:24:36.423" LastActivityDate="2017-05-27T13:53:05.387" Title="Changing emacs theme modeline colors" Tags="|themes|mode-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29511" PostTypeId="1" AcceptedAnswerId="29530" CreationDate="2016-12-22T17:34:29.687" Score="2" ViewCount="801" Body="&lt;p&gt;I often use text scaling, but it only seems to work on the default face.  This is a problem, for instance, when I write text that also has italics (e.g., markdown, org text).  The text scale commands change the size of the text with the default face but do not change the size of the text with italics face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define these faces like this (Inconsolata does not have an italic version):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute  'default nil&#xA;                     :family &quot;Inconsolata&quot; &#xA;                     :height 130&#xA;                     :foreground &quot;gray90&quot;&#xA;                     :background &quot;gray25&quot;)&#xA;&#xA;(set-face-attribute  'italic nil&#xA;                     :family &quot;Cousine&quot; &#xA;                     :height 100&#xA;                     :slant 'italic&#xA;                     :underline nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make the text scale commands work on the italic face as well?&lt;/p&gt;&#xA;" OwnerUserId="14325" LastEditorUserId="105" LastEditDate="2016-12-22T18:45:07.513" LastActivityDate="2016-12-23T15:20:05.460" Title="text-scale for all faces in buffer" Tags="|faces|text-properties|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29512" PostTypeId="1" AcceptedAnswerId="29519" CreationDate="2016-12-22T18:53:05.580" Score="6" ViewCount="945" Body="&lt;p&gt;I know that emacs can open a file while evaluating an expression:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs file --eval &quot;(toggle-frame-maximized)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However I failed to replicate this with emacsclient:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1.emacsclient can open a file:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient file&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2.And it can also evaluate an expression:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &quot;(toggle-frame-maximized)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3.But a problem happens when the two are put together:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient file --eval &quot;(toggle-frame-maximized)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It starts to report error and does not open the file. &#xA;So is it possible to use emacsclient to open a file while still do eval?&lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="13594" LastEditDate="2016-12-23T07:54:35.013" LastActivityDate="2020-11-05T16:19:46.740" Title="emacsclient opens a file and does eval simultaneously" Tags="|emacsclient|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29513" PostTypeId="2" ParentId="29511" CreationDate="2016-12-22T21:22:14.323" Score="-1" Body="&lt;p&gt;How about not setting &lt;code&gt;:height 100&lt;/code&gt; for &quot;Cousine&quot;, but use &lt;code&gt;face-font-rescale-alist&lt;/code&gt; for &quot;Cousine&quot; to set the ratio of it to &quot;Inconsolata&quot;.&lt;/p&gt;&#xA;" OwnerUserId="9377" LastActivityDate="2016-12-22T21:22:14.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29514" PostTypeId="1" CreationDate="2016-12-22T21:28:56.763" Score="0" ViewCount="67" Body="&lt;p&gt;Is there a function that checks if a specific character sequence - &quot;abc&quot; - is on a line and puts point there if it is? And returning something (presumably nil) if &quot;abc&quot; isn't on the current line?&lt;/p&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="105" LastEditDate="2016-12-22T23:01:27.803" LastActivityDate="2016-12-24T00:28:13.283" Title="Go to specific character sequence if on line programmatically" Tags="|search|motion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29515" PostTypeId="2" ParentId="29496" CreationDate="2016-12-22T23:45:07.960" Score="9" Body="&lt;p&gt;I tried to restrict the linting to one checker with &lt;code&gt;(org-lint '(link-to-local-file))&lt;/code&gt;, however the parsing is still going to induce a noticable delay. Maybe limiting the linter to the current subtree or using the &lt;code&gt;async&lt;/code&gt; library can improve the performance. Anyways, below is a rather simple flycheck setup for &lt;code&gt;org-lint&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(flycheck-define-generic-checker 'org-lint&#xA;  &quot;Syntax checker for org-lint.&quot;&#xA;  :start 'flycheck-org-lint-start&#xA;  :modes '(org-mode))&#xA;&#xA;(defun flycheck-org-lint-start (checker callback)&#xA;    (funcall&#xA;     callback 'finished&#xA;     (save-excursion&#xA;       (mapcar&#xA;        (lambda (err)&#xA;          (goto-char (car err))&#xA;          (flycheck-error-new-at&#xA;           (org-current-line) (1+ (current-column))&#xA;           'warning (cadr err) :checker checker))&#xA;        (org-lint-link-to-local-file (org-element-parse-buffer))))))&#xA;&#xA;(add-to-list 'flycheck-checkers 'org-lint)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2016-12-23T18:38:01.683" LastActivityDate="2016-12-23T18:38:01.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29517" PostTypeId="1" CreationDate="2016-12-23T05:45:29.853" Score="4" ViewCount="377" Body="&lt;p&gt;I practice python literate programming with tangling to generate a full project structure. There are dependencies between modules and packages, and so I will say in the &lt;code&gt;C-c '&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src python tangle: &quot;src/foo/bar.py&quot;&#xA;  def do_stuff():&#xA;      pass&#xA;#+end_src&#xA;&#xA;#+begin_src python tangle: &quot;src/foo/baz.py&quot;&#xA;  from foo.bar import do_stuff&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And so the project structure looks like this (omitting init.py):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;project.org&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;src&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;foo&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;bar.py&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;baz.py&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But the &lt;code&gt;C-c '&lt;/code&gt; edit buffer is in the same directory as project.org so anaconda-mode won't recognize the import statement. All code is run from the tangled source rather than within the project.org buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the tangle file names and dirs as elisp variables. It would be nice if I could have anaconda completion on project source code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I point anaconda-mode to look from within the tangle, ie. source code file path?&lt;/p&gt;&#xA;" OwnerUserId="14283" LastEditorUserId="2274" LastEditDate="2016-12-23T14:54:14.930" LastActivityDate="2016-12-23T14:54:14.930" Title="Org-babel and anaconda-mode in src blocks" Tags="|org-mode|org-babel|python|anaconda-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29518" PostTypeId="1" CreationDate="2016-12-23T07:20:38.513" Score="2" ViewCount="77" Body="&lt;p&gt;Since emacsclient depends on emacs server, when I first start emacs server and then try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -n -a emacs --eval &quot;(sr-speedbar-open)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It reports that sr-speedbar is arlready opened. Is it possible to have individual sr-speedbar for every emacsclient -c new frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now the best I can do is to first close sr-speedbar then reopen it in a new frame.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c -n -e &quot;(progn (sr-speedbar-close) (sr-speedbar-open))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But sr-speedbar will be closed in all the other frames. &lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="13594" LastEditDate="2016-12-24T19:10:59.443" LastActivityDate="2016-12-24T19:10:59.443" Title="emacsclient -c new frame cannot have an individual new sr-speedbar" Tags="|frames|emacsclient|speedbar|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29519" PostTypeId="2" ParentId="29512" CreationDate="2016-12-23T07:24:58.773" Score="2" Body="&lt;p&gt;After several attempts I think I found the solution, basically just put everything into eval and concatenate them use progn:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &quot;(progn (find-file \&quot;file\&quot;) (toggle-frame-maximized))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13594" LastActivityDate="2016-12-23T07:24:58.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29520" PostTypeId="1" AcceptedAnswerId="29522" CreationDate="2016-12-23T08:10:35.257" Score="1" ViewCount="133" Body="&lt;p&gt;emacs gives me an error when i try the bind keys to wdired-mode-map:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key wdired-mode-map (kbd &quot;TAB&quot;) 'my-mark-file-name-forward )&#xA;(define-key wdired-mode-map (kbd &quot;-&quot;) 'my-mark-file-name-backward )&#xA;(define-key wdired-mode-map (kbd &quot;&amp;lt;f2&amp;gt;&quot;) 'my-mark-file-name-for-rename )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the error is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's value as variable is void: wdired-mode-map&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;any clue what im doing wrong here? i always define-key for other modes like this an never encountered an issue&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2016-12-23T16:35:12.770" LastActivityDate="2016-12-23T16:35:12.770" Title="emacs error on startup when i try and bind keys to wdired-mode-map" Tags="|key-bindings|init-file|keymap|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29521" PostTypeId="2" ParentId="29520" CreationDate="2016-12-23T08:32:21.193" Score="1" Body="&lt;p&gt;In general, when a variable or function is &lt;code&gt;void&lt;/code&gt;, the most likely suspect is that the applicable library has not yet been loaded.  Two common approaches are to &lt;code&gt;require&lt;/code&gt; the library beforehand with &lt;code&gt;(require 'wdired)&lt;/code&gt; or use &lt;code&gt;(eval-after-load &quot;wdired&quot; '(progn ...))&lt;/code&gt;.  Many people prefer the second option because Emacs starts up faster.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2016-12-23T08:32:21.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29522" PostTypeId="2" ParentId="29520" CreationDate="2016-12-23T08:38:38.537" Score="2" Body="&lt;p&gt;&lt;code&gt;wdired-mode-map&lt;/code&gt; only becomes available after wdired-mode is used, if you want&#xA;to change the keymap, you can use &quot;mode hook&quot; (&lt;code&gt;wdired-mode-hook&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'wdired-mode-hook&#xA;          (lambda () (define-key wdired-mode-map ...)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or &lt;code&gt;with-eval-after-load&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;wdired&quot;&#xA;  (define-key wdired-mode-map ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-12-23T08:38:38.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29523" PostTypeId="1" CreationDate="2016-12-23T09:34:10.283" Score="2" ViewCount="325" Body="&lt;p&gt;so i used to use the auto generation of hydra hints with the&#xA;&lt;code&gt;:hint nil and :column 3&lt;/code&gt; argument&#xA;i recently find a need to have better control on whats presented in the hint area of some huge hydras i have so im trying to edit and write my own hints. the problem is that it seems VERY tedious to create and maintain this as every time you add an entry all the alignment changes such as in this example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Main                                    Extra Hydras                         Misc &#xA;─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── &#xA;[_&amp;lt;f1&amp;gt;_]                                [_e_]                                [_e_]&#xA;[__]                                    [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                         [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_n_] work on same buffer               [_o_] org edits                      [_e_]&#xA;[_k_] Mark ring                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;[_e_]                                   [_e_]                                [_e_]&#xA;&#xA;&#xA;^^^^^^^^------------------------------EXTRA Info-------------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;one can see how adding text after the hints takes everything out of alignment. is there a more reasonable way of creating these nice aligned columns when you edit text and keep them aligned?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2022-07-25T18:07:26.687" Title="advice on easy formating of hydra docstring" Tags="|text-editing|hydra|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29524" PostTypeId="1" AcceptedAnswerId="29533" CreationDate="2016-12-23T09:39:50.620" Score="7" ViewCount="516" Body="&lt;p&gt;I had a couple of bookmarks for a given file, then I decided to rename the directory of the file. Now &lt;code&gt;list-bookmarks&lt;/code&gt; ( I am using the &lt;code&gt;bookmark+&lt;/code&gt; package) shows all the bookmarks for the given file in yellow (indicating that they are no longer valid). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I easily repair the bookmark file?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2020-01-16T17:19:13.373" Title="Bookmark Plus: Correct bookmark file after directory/file rename" Tags="|bookmarks|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29525" PostTypeId="1" CreationDate="2016-12-23T10:42:21.767" Score="6" ViewCount="586" Body="&lt;p&gt;In vim, all instances of &lt;code&gt;an apple tree&lt;/code&gt; can be replaced by &lt;code&gt;an orange tree&lt;/code&gt; with &lt;code&gt;:%s/an \zsapple\ze tree/orange/g&lt;/code&gt;.&lt;br&gt;&#xA;&lt;code&gt;\zs&lt;/code&gt; and &lt;code&gt;\ze&lt;/code&gt; mark the start and end of the passage to be operated on.&#xA;Is there something equivalent in emacs?&#xA;As far as I know, evil mode needs the much less elegant&#xA;&lt;code&gt;:%s/\(an \)\(apple\)\( tree\)/\1orange\3/g&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2019-07-03T15:54:06.993" LastActivityDate="2019-07-03T15:54:06.993" Title="Equivalents to vim \zs and \ze?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="29526" PostTypeId="2" ParentId="29525" CreationDate="2016-12-23T10:57:23.790" Score="1" Body="&lt;p&gt;You could use &lt;code&gt;M-x query-replace-regexp&lt;/code&gt;and use &lt;code&gt;apple\( tree\)&lt;/code&gt; as search text and &lt;code&gt;orange\1&lt;/code&gt; as replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;query-replace-regexp&lt;/code&gt; will search for the first string and will ask you to replace the second string.  You can use the exclamation mark &lt;code&gt;!&lt;/code&gt; to replace all of them without further questions.&lt;/p&gt;&#xA;" OwnerUserId="14190" LastEditorUserId="105" LastEditDate="2016-12-23T15:58:26.330" LastActivityDate="2016-12-23T15:58:26.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29527" PostTypeId="1" CreationDate="2016-12-23T10:57:42.573" Score="1" ViewCount="867" Body="&lt;p&gt;i have this function you guys helped me write&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun z/dired-shell-other-window-beets ()&#xA;   (interactive)&#xA;   (let ((command (concat &quot;beet import &quot; (format &quot;%S&quot; (dired-get-filename)))))&#xA;     (switch-to-buffer (shell)&#xA;       (insert command)&#xA;       (comint-send-input))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is there a way to 1. rename the buffer to &lt;em&gt;beets&lt;/em&gt; when created and 2.auto close (kill) the &lt;em&gt;beets&lt;/em&gt; buffer when the command i run &lt;code&gt;beet import&lt;/code&gt; finishes running?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2017-07-22T20:40:38.180" Title="auto kill a shell buffer when command finishes" Tags="|shell|functions|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29528" PostTypeId="2" ParentId="29523" CreationDate="2016-12-23T14:10:29.727" Score="1" Body="&lt;p&gt;I agree that editing hydra hints manually is tedious, but in this particular case you could use &lt;code&gt;M-x overwrite-mode&lt;/code&gt; (bound to &lt;code&gt;&amp;lt;insert&amp;gt;&lt;/code&gt; for me). That would preserve the column widths.&lt;/p&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2016-12-23T14:10:29.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29530" PostTypeId="2" ParentId="29511" CreationDate="2016-12-23T15:20:05.460" Score="1" Body="&lt;p&gt;As &lt;code&gt;text-scale-mode&lt;/code&gt; docstring says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...&#xA;  The amount of scaling is determined by the variable&#xA;  &lt;code&gt;text-scale-mode-amount&lt;/code&gt;: one step scales the global default&#xA;  face size by the value of the variable &lt;code&gt;text-scale-mode-step&lt;/code&gt;&#xA;  (a negative amount shrinks the text).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The &lt;code&gt;text-scale-increase&lt;/code&gt;, &lt;code&gt;text-scale-decrease&lt;/code&gt;, and&#xA;  &lt;code&gt;text-scale-set&lt;/code&gt; functions may be used to interactively modify&#xA;  the variable &lt;code&gt;text-scale-mode-amount&lt;/code&gt; (they also enable or&#xA;  disable `text-scale-mode' as necessary).&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So only the default face is affected.  Looking at &lt;code&gt;face-remap.el&lt;/code&gt;, we&#xA;see this works by setting the variable &lt;code&gt;face-remapping-alist&lt;/code&gt;, whose&#xA;docstring includes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alist of face remappings.&#xA;  Each element is of the form:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(FACE . REPLACEMENT),&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;which causes display of the face FACE to use REPLACEMENT instead.&#xA;  REPLACEMENT is a face specification, i.e. one of the following:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(1) a face name&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(2) a property list of attribute/value pairs, or&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(3) a list in which each element has the form of (1) or (2).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed if we display this variable value w/o text-scale-mode we see:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;face-remapping-alist is a variable defined in ‘C source code’.&#xA;  Its value is nil&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And after having typed &lt;code&gt;C-x C-+&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Its value is ((default (:height 1.2) default))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Directly setting &lt;code&gt;face-remapping-alist&lt;/code&gt; seems to work, ie try:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq face-remapping-alist '((default (:height 2.4) default)&#xA;                             (italic (:height 2.4) italic)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The functions used by &lt;code&gt;text-scale-mode&lt;/code&gt; to change&#xA;&lt;code&gt;face-remapping-alist&lt;/code&gt; are &lt;code&gt;face-remap-add-relative&lt;/code&gt; and&#xA;&lt;code&gt;face-remap-remove-relative&lt;/code&gt;.  We could modify &lt;code&gt;text-scale-mode&lt;/code&gt; to&#xA;call them for both &lt;code&gt;'default&lt;/code&gt; and &lt;code&gt;'italic&lt;/code&gt; fonts.  Alternatively, we&#xA;can &lt;strong&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html#Advising-Functions&quot; rel=&quot;nofollow noreferrer&quot;&gt;advise&lt;/a&gt;&lt;/strong&gt; both functions so that a remapping for the &lt;code&gt;'italic&lt;/code&gt;&#xA;font is added/removed as well.  Here's the code to do that:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/face-remap-add-relative-advice (face &amp;amp;rest specs)&#xA;  &quot;advice to add remap for italic font&quot;&#xA;  (if (eq face 'default)&#xA;      (setq my/italic-cookie (apply #'face-remap-add-relative 'italic specs))))&#xA;&#xA;(defun my/face-remap-remove-relative-advice (cookie)&#xA;  &quot;advice to remove remap for italic font&quot;&#xA;  (if (eq (car cookie) 'default)&#xA;      (face-remap-remove-relative my/italic-cookie)))&#xA;&#xA;(advice-add #'face-remap-add-relative :after #'my/face-remap-add-relative-advice)&#xA;(advice-add #'face-remap-remove-relative :after #'my/face-remap-remove-relative-advice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's a quick hack, it would need more work to handle more fonts, the clean solution may be to change &lt;code&gt;text-scale-mode&lt;/code&gt; so that it can handle any font,  but it seems to do what you need.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastActivityDate="2016-12-23T15:20:05.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29532" PostTypeId="2" ParentId="29502" CreationDate="2016-12-23T15:24:25.723" Score="1" Body="&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; maintains two sets of functions for most things.  The 'normal' version (like &lt;code&gt;org-todo&lt;/code&gt;) and the agenda version (&lt;code&gt;org-agenda-todo&lt;/code&gt;).  If you rewrite your function to use the agenda version, all will be well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun agenda-mark-done-and-archive ()&#xA;   (interactive)&#xA;   (org-agenda-todo 'done)&#xA;   (org-agenda-archive))&#xA; (define-key org-agenda-mode-map &quot;\C-c\C-x\C-s&quot; 'agenda-mark-done-and-archive)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Internally, &lt;code&gt;org-agenda-archive&lt;/code&gt; works by calling &lt;code&gt;org-archive-subtree&lt;/code&gt;.  So if we use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;advice&lt;/a&gt; we can modify &lt;code&gt;org-archive-subtree&lt;/code&gt; to first mark things as done and then do whatever it normally does:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-archive-done (&amp;amp;optional arg)&#xA;  (org-todo 'done))&#xA;&#xA;(advice-add 'org-archive-subtree :before 'org-archive-done)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This version changes the normal and agenda versions simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the help for &lt;code&gt;org-archive-subtree&lt;/code&gt; says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The tree will be moved to that location, the subtree&#xA;  heading be marked DONE, and the current time will be added. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So this should already be happening.  If it isn't, there may be some other issue.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-12-23T15:24:25.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29533" PostTypeId="2" ParentId="29524" CreationDate="2016-12-23T16:33:22.183" Score="7" Body="&lt;p&gt;The location (file) of a bookmark is in literal (string) form in the bookmark data, which is in variable &lt;code&gt;bookmark-list&lt;/code&gt; and which is saved in your bookmark file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have these options, to change the file name of one or more bookmarks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use command &lt;code&gt;bmkp-edit-bookmark-name-and-location&lt;/code&gt;, which is bound to &lt;strong&gt;&lt;code&gt;C-x p r&lt;/code&gt;&lt;/strong&gt; globally.  (A similar command is bound to &lt;strong&gt;&lt;code&gt;r&lt;/code&gt;&lt;/strong&gt; in the bookmark-list display.)  With no prefix arg you are prompted for a new bookmark name (just hit &lt;code&gt;RET&lt;/code&gt; for the same name) and a new bookmark location (file).  With a prefix arg an editing buffer opens for the full bookmark record (what you see in the bookmark file).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use command &lt;code&gt;bmkp-edit-bookmark-record&lt;/code&gt;, which is bound to &lt;strong&gt;&lt;code&gt;C-x p E&lt;/code&gt;&lt;/strong&gt; globally.  (A similar command is bound to &lt;strong&gt;&lt;code&gt;e&lt;/code&gt;&lt;/strong&gt; in the bookmark-list display.)  This is like &lt;code&gt;C-u C-x p r&lt;/code&gt;: An editing buffer opens for the full bookmark record.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the bookmark-list display (buffer &lt;code&gt;*Bookmark List*&lt;/code&gt;), you can use command &lt;code&gt;bmkp-bmenu-relocate-marked&lt;/code&gt;, which is bound to &lt;strong&gt;&lt;code&gt;M-R&lt;/code&gt;&lt;/strong&gt;.  It relocates the target files of all (visible) bookmarks that are marked &lt;code&gt;&amp;gt;&lt;/code&gt;.&#xA;You are prompted for the relocation target directory.  Omitted bookmarks are excluded, by default (so you can hide some bookmarks from this operation without unmarking them).  With a prefix arg, any omitted bookmarks that are marked are included.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the bookmark-list display (buffer &lt;code&gt;*Bookmark List*&lt;/code&gt;), you can use command &lt;code&gt;bmkp-bmenu-edit-marked&lt;/code&gt;, which is bound to &lt;strong&gt;&lt;code&gt;E&lt;/code&gt;&lt;/strong&gt;, to edit the full bookmark records of the bookmarks that are marked &lt;code&gt;&amp;gt;&lt;/code&gt;.  An editing buffer opens for all of the full bookmark records together.  Omitted bookmarks are excluded, by default.  With a negative prefix arg, any omitted bookmarks that are marked are included.  With a non-negative prefix arg, the edit buffer includes &lt;em&gt;all&lt;/em&gt; bookmarks.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can open your bookmark file as any file, and edit the text.  You can use &lt;code&gt;query-replace&lt;/code&gt; etc.  However, it is probably a better idea to use &lt;code&gt;C-u E&lt;/code&gt; in the bookmark list -- see previous (but be aware that &lt;code&gt;C-u E&lt;/code&gt; works with the current &lt;code&gt;bookmark-list&lt;/code&gt;, not the bookmark file, which is the last-saved &lt;code&gt;bookmark-list&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There might be other possibilities, that I'm not thinking of at the moment. Use &lt;code&gt;C-h m&lt;/code&gt; in the bookmark-list display for more information.  Or check the &lt;strong&gt;&lt;code&gt;Bookmark+&lt;/code&gt;&lt;/strong&gt; menu in the bookmark-list display.  Or check the &lt;strong&gt;&lt;code&gt;Bookmarks&lt;/code&gt;&lt;/strong&gt; menu anywhere (under &lt;code&gt;Edit&lt;/code&gt; in vanilla Emacs).  Or use &lt;code&gt;apropos-command&lt;/code&gt;...&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-23T16:33:22.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29534" PostTypeId="1" CreationDate="2016-12-23T17:19:47.717" Score="3" ViewCount="2401" Body="&lt;p&gt;&lt;strong&gt;[2016.12.23]:&lt;/strong&gt;&#xA;I'm trying to make emacs be usable for working with python code.&#xA;By 'usable' I mean I could rely on it with code navigation and completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using spacemacs + anaconda-mode for it, but I'm not 100% satisfied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when I try to visit definition of 'get' function with M-. (anaconda-mode-find-definitions), I end up with message: &quot;no definitions found&quot;. On the other hand, PyCharm does the job with it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python&#xA;&#xA;from avocado import Test&#xA;&#xA;class MyTest(Test):   # M-. on 'Test' ends up in test class. This is fine.&#xA;&#xA;    def test_mine(self):&#xA;        myParam = self.params.get(key='myParm', path='/', default=None)  ## M-. on 'get' fails. PyCharm does the job.&#xA;&#xA;if __name__ == &quot;__main__&quot;:&#xA;    main()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried to use elpy+jedi, but no luck as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is Your experience with this simple example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code above uses avocado testing framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;regards&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[2016.12.27]:&lt;/strong&gt;&#xA;Below is another example, yet one I need, but hopefully also using more maintainable library, scapy: the packet forging library. All three imports are legal to execute the code, but only the last one makes emacs be able to jump to definition&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#from scapy.all import *     # imports all from scapy.layers.all, but it is not enough for emacs to see IP() def.&#xA;#from scapy.layers.all import * # gets all from scapy.layers.inet, but it is not enough for emacs to see IP() def.&#xA;from scapy.layers.inet import *   #. ok with this.&#xA;&#xA;packet = IP()&#xA;print packet.mysummary()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Question is is it possible to make emacs jump to definition when either first or second header is used instead of third one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[2016.12.28]:&lt;/strong&gt;&#xA;Here is another example where my emacs python environment neither completes nor jumps to definition, although the code runs without error. it requires &quot;pip install pyvim pyvmomi&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from pyVmomi import vim&#xA;&#xA;vim.vm.CloneSpec()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How about Your emacs environments, do they handle such cases?&lt;/p&gt;&#xA;" OwnerUserId="14334" LastEditorUserId="14334" LastEditDate="2016-12-28T10:05:39.750" LastActivityDate="2016-12-28T10:05:39.750" Title="emacs as python IDE vs pycharm: spacemacs and code navigation" Tags="|python|spacemacs|anaconda-mode|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="29535" PostTypeId="1" CreationDate="2016-12-23T17:55:02.343" Score="0" ViewCount="620" Body="&lt;p&gt;Not just parenthesis, but any surround. We are given the advantage of a pair being made and the cursor conveniently placed within. That's only 1/2 the procedure; what about jumping out? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Previous (which covers only parens): &lt;a href=&quot;https://emacs.stackexchange.com/questions/14556/how-do-i-jump-out-of-enclosing-parentheses&quot;&gt;how-do-i-jump-out-of-enclsing-parentheses&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evil mode in Spacemacs. Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: okay, 'pair' instead of 'surround' keyword:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/13222/a-elisp-function-to-jump-between-matched-pair&quot;&gt;A elisp function to jump between matched pair&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13118" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-12-23T18:08:59.580" Title="How to jump out of any surrounds?" Tags="|evil|cursor|motion|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29536" PostTypeId="2" ParentId="29535" CreationDate="2016-12-23T18:01:48.867" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Fuco1/smartparens&quot; rel=&quot;nofollow noreferrer&quot;&gt;smartparens&lt;/a&gt; (described in the other answer you refer to) works well with quotes, too, just like inside parens.  It's very useful even outside of lisps -- on just about anything that has open and close semantics, including strings and blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your case, use &lt;code&gt;C-M-u&lt;/code&gt; (&lt;code&gt;sp-backward-up-sexp&lt;/code&gt;) to jump &lt;strong&gt;u&lt;/strong&gt;p and out to the front of the string you're in.  And if you want to jump to the right side instead, do the prior and then &lt;code&gt;C-M-f&lt;/code&gt; (&lt;code&gt;sp-forward-sexp&lt;/code&gt;) to get there.&lt;/p&gt;&#xA;" OwnerUserId="11025" LastEditorUserId="11025" LastEditDate="2016-12-23T18:08:59.580" LastActivityDate="2016-12-23T18:08:59.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29537" PostTypeId="2" ParentId="2410" CreationDate="2016-12-23T18:36:45.463" Score="1" Body="&lt;p&gt;You can use the &lt;strong&gt;Firefox&lt;/strong&gt; add-on&#xA;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/its-all-text/&quot; rel=&quot;nofollow noreferrer&quot;&gt;It's All Text&lt;/a&gt;.&#xA;This will add a tiny &quot;edit&quot; button to the bottom of any text area.&#xA;Clicking it (or using a hot-key, default &lt;code&gt;C-S-v&lt;/code&gt;) fires up Emacs with&#xA;the content in a temporary buffer.  Write the buffer (repeatedly) and&#xA;the text area updates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My config for it is simply setting &lt;em&gt;Editor&lt;/em&gt; to &lt;code&gt;/usr/bin/emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11025" LastActivityDate="2016-12-23T18:36:45.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29538" PostTypeId="2" ParentId="5389" CreationDate="2016-12-23T22:40:19.527" Score="4" Body="&lt;p&gt;I wrote a Python script &lt;a href=&quot;https://github.com/cashTangoTangoCash/orgFixLinks&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/cashTangoTangoCash/orgFixLinks&lt;/a&gt; that attempts to repair broken links to local files, within one or more org files on a local drive in the Ubuntu OS.  It is certainly an amateur command line script, but might be worth playing with.  There is a GitHub wiki that provides a degree of documentation: &lt;a href=&quot;https://github.com/cashTangoTangoCash/orgFixLinks/wiki&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/cashTangoTangoCash/orgFixLinks/wiki&lt;/a&gt;.  Please check the warnings in the README.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sorry that this Python script is not a part of Org, but completely separate/stand-alone.  I hope no-one is bothered that I am not answering the question of the OP directly; I just thought someone might like playing with the Python script.&lt;/p&gt;&#xA;" OwnerUserId="14337" LastActivityDate="2016-12-23T22:40:19.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29540" PostTypeId="2" ParentId="29508" CreationDate="2016-12-24T00:24:55.180" Score="5" Body="&lt;p&gt;The solution is to run &lt;code&gt;texdoc&lt;/code&gt; within an asynchronous process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way to do that is probably to use &lt;code&gt;start-file-process&lt;/code&gt; instead of &lt;code&gt;shell-command-to-string&lt;/code&gt; (which is a handy function for quick&amp;amp;dirty code when it's more expedient to write a little shell script than the corresponding Elisp code, but is otherwise better avoided in my experience).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it will require substantial changes to the surrounding code, since &lt;code&gt;start-file-process&lt;/code&gt; does not return the process's output directly, instead it lets you indicate in which buffer to place the output and then you have to use &lt;code&gt;set-process-sentinel&lt;/code&gt; to a callback function that fetches the output from that buffer and does &quot;whatever needs to be done with it&quot; when the command finishes.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-12-24T00:24:55.180" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29541" PostTypeId="2" ParentId="29514" CreationDate="2016-12-24T00:28:13.283" Score="1" Body="&lt;p&gt;No, but it's easy to write one (guaranteed 100% untested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun search-like-alex-seems-to-want (regexp)&#xA;  (let ((pos (save-excursion&#xA;               (forward-line 0) ;; Go to BOL.&#xA;               (re-search-forward regexp (line-end-position) t))))&#xA;    (when pos (goto-char pos))&#xA;    pos))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-12-24T00:28:13.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29542" PostTypeId="2" ParentId="29527" CreationDate="2016-12-24T01:52:26.440" Score="2" Body="&lt;p&gt;&lt;strong&gt;CAVEAT&lt;/strong&gt;:  The two snippets below are examples using the function &lt;code&gt;ls&lt;/code&gt; that is available on most *nix systems.  Copy and paste snippets to the &lt;code&gt;*scratch*&lt;/code&gt; buffer, place the cursor immediately following the last parentheses of either snippet, and press:  &lt;code&gt;C-x C-e&lt;/code&gt; (aka &lt;code&gt;eval-last-sexp&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following snippet is an example using the function &lt;code&gt;shell&lt;/code&gt; to process a string with &lt;code&gt;comint-simple-send&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((kill-buffer-query-functions nil)&#xA;      (buf (shell &quot;*OUTPUT-BUFFER*&quot;)))&#xA;   (comint-simple-send buf &quot;ls -la&quot;)&#xA;   (sit-for 2)&#xA;   (kill-process (get-buffer-process buf))&#xA;   (when (and (not (one-window-p)) (get-buffer-window buf))&#xA;      (delete-window (get-buffer-window buf)))&#xA;   (kill-buffer buf))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The following snippet is with &lt;code&gt;start-process&lt;/code&gt; and &lt;code&gt;set-process-sentinel&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(set-process-sentinel&#xA;  (start-process&#xA;    &quot;my-process-name&quot;&#xA;    &quot;*OUTPUT-BUFFER*&quot;&#xA;    &quot;ls&quot;&#xA;    &quot;-la&quot;)&#xA;  (lambda (p e)&#xA;    (when (= 0 (process-exit-status p))&#xA;      (let ((buf (process-buffer p)))&#xA;        (when (get-buffer buf)&#xA;          (display-buffer buf t)&#xA;          (sit-for 2)&#xA;          (delete-window (get-buffer-window buf))&#xA;          (kill-buffer buf))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-24T17:45:23.217" LastActivityDate="2016-12-24T17:45:23.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29543" PostTypeId="1" CreationDate="2016-12-24T03:13:12.390" Score="4" ViewCount="47" Body="&lt;p&gt;Is there a way to modify &lt;code&gt;sh-mode&lt;/code&gt; to highlight variables inside a double parentheses construct when not using the dollar sign prefix?&#xA;For example I want the &lt;code&gt;i&lt;/code&gt; to be highlighted in &lt;code&gt;((i++))&lt;/code&gt; without the need of writing &lt;code&gt;$i&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14338" LastActivityDate="2016-12-24T03:13:12.390" Title="Highlight variables without $ inside (( )) when in sh-mode?" Tags="|bash|sh-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29544" PostTypeId="1" CreationDate="2016-12-24T06:25:58.023" Score="1" ViewCount="234" Body="&lt;p&gt;Exporting org mode documents to html with &lt;code&gt;(setq org-src-fontify-natively t)&lt;/code&gt; will carry syntax highlighting into the exported code blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Zenburn looks awful exported while Leuven/others looks fantastic. I do all my work in Zenburn.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can html-export use a specified font for source code highlighting? Running (in spacemacs) the command &lt;code&gt;Space T n&lt;/code&gt; changes the font, but it is not practical to keep going back and forth whenever I wish to html-export.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following article &lt;a href=&quot;http://emacs-fu.blogspot.com/2010/05/using-zenburn-for-org-mode-generated.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emacs-fu.blogspot.com/2010/05/using-zenburn-for-org-mode-generated.html&lt;/a&gt; I found during my search but the provided solution is neither the same nor works.&lt;/p&gt;&#xA;" OwnerUserId="14283" LastActivityDate="2016-12-24T06:25:58.023" Title="Choosing which font for html export syntax highlighting?" Tags="|org-mode|org-export|org-babel|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29545" PostTypeId="1" CreationDate="2016-12-24T07:17:28.383" Score="0" ViewCount="417" Body="&lt;p&gt;I'm using GNU Emacs 26.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.5) of 2016-12-20, with arch linux (antergos), I want to start with the option tcp  server, so I added and assigment to the variable server-use-tcp, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setq server-use-tcp t)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I get this warning: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In toplevel form:&#xA;init.el:15:7:Warning: assignment to free variable ‘server-use-tcp’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this variable deleted?, or is the wrong way to this? or what library I need to require before setting that variable?&lt;/p&gt;&#xA;" OwnerUserId="8892" LastActivityDate="2016-12-24T07:17:28.383" Title="Start emacs as tcp server" Tags="|server|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29546" PostTypeId="1" CreationDate="2016-12-24T08:58:42.643" Score="2" ViewCount="246" Body="&lt;p&gt;I've a small problem with ERC, if I go away from keyboard for a while, it automatically disconnects the channels I've logged into and when I reopen emacs, it reconnects to the channels automatically. But I do not want this to happen. I want the erc channels to be kept alive even if I'm, away for any period of time. How can I achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps. I'm on macOS Sierra&lt;/p&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2022-03-31T23:03:00.313" Title="how to get persistent ERC sessions?" Tags="|erc|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29547" PostTypeId="1" CreationDate="2016-12-24T11:01:48.610" Score="1" ViewCount="416" Body="&lt;p&gt;in the spirit of Xmas maybe this year ill finally get this working. so ive been trying to get mu4e working for me for a year or so switching between offline imap to mbsybc etc and always it the same old issue. i cant get mu4e to reliably get new messages to show up in my inbox view. this is what i expect to work. i open mu4e, i use &lt;code&gt;j&lt;/code&gt; &gt; &lt;code&gt;i&lt;/code&gt; and i get my inbox header view. i know mbsync is working (i call it from within mu4e via &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq mu4e-get-mail-command &quot;/usr/bin/mbsync -a&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and i can see its indexing every X minutes (&lt;code&gt;[mu4e] Found 500 matching messages&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the issue is i never get the inbox view to show (auto refresh) the headers and show me the new mail like in every other email application. i try to use &lt;code&gt;g&lt;/code&gt; sometimes to refresh yet this is hit or miss. sometimes it does show the new mails after &lt;code&gt;g&lt;/code&gt; and sometimes it dosent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i can use `C-S-u' to start manually retrieving mail (this opens a buffer that shows the mu4e process working) and that usually fixes the issues and the new mail are presented in the header view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any help to try and finally debug this. my mu4e config is here if this helps: &lt;a href=&quot;https://paste.xinu.at/1JZv/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://paste.xinu.at/1JZv/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2019-08-16T18:56:10.113" Title="Need all the help i can get to figure out why mu4e isnt updating for me" Tags="|mu4e|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29548" PostTypeId="2" ParentId="29426" CreationDate="2016-12-24T12:09:01.343" Score="3" Body="&lt;p&gt;Due to the lack of support for this package, I'm now using &lt;code&gt;desktop&lt;/code&gt; and &lt;a href=&quot;https://github.com/wasamasa/eyebrowse&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;eyebrowse&lt;/code&gt;&lt;/a&gt; which I think is a better alternative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my configuration for the 2: &lt;a href=&quot;https://github.com/angrybacon/dotemacs/blob/master/dotemacs.org#23-windows&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/angrybacon/dotemacs/blob/master/dotemacs.org#23-windows&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2397" LastActivityDate="2016-12-24T12:09:01.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29549" PostTypeId="2" ParentId="3520" CreationDate="2016-12-24T13:37:32.437" Score="0" Body="&lt;p&gt;When you start bongo,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;code&gt;M-x bongo-playlist&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;not &lt;code&gt;M-x bongo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;C-u C-c C-n&lt;/code&gt; on bongo buffer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do it again.&lt;/p&gt;&#xA;" OwnerUserId="14341" LastEditorUserId="9995" LastEditDate="2016-12-25T17:46:22.137" LastActivityDate="2016-12-25T17:46:22.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29550" PostTypeId="2" ParentId="29508" CreationDate="2016-12-24T17:39:09.047" Score="1" Body="&lt;p&gt;If you only need to feed back a request to Emacs, without waiting for an answer, then you can run &lt;code&gt;emacsclient&lt;/code&gt; in the background. Under Unix-style OSes (Linux, macOS, Cygwin, …):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient … &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Under native Windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;start emacsclient …&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastActivityDate="2016-12-24T17:39:09.047" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29551" PostTypeId="2" ParentId="7617" CreationDate="2016-12-24T19:36:35.103" Score="3" Body="&lt;p&gt;The following proposed solution is intended to permit users to send input programmatically underneath the &lt;code&gt;eshell&lt;/code&gt; hood, rather than inserting the command into the &lt;code&gt;eshell&lt;/code&gt; buffer following command prompt.  @lawlist has submitted a feature request for the Emacs development team to consider: &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25270&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25270&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SAMPLE USAGE&lt;/strong&gt;:  &lt;code&gt;(eshell-send-input nil nil nil &quot;ls -la /&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'eshell)&#xA;&#xA;(defun eshell-send-input (&amp;amp;optional use-region queue-p no-newline input-string-a)&#xA;  &quot;Send the input received to Eshell for parsing and processing.&#xA;After `eshell-last-output-end', sends all text from that marker to&#xA;point as input.  Before that marker, calls `eshell-get-old-input' to&#xA;retrieve old input, copies it to the end of the buffer, and sends it.&#xA;-  If USE-REGION is non-nil, the current region (between point and mark)&#xA;will be used as input.&#xA;-  If QUEUE-P is non-nil, input will be queued until the next prompt,&#xA;rather than sent to the currently active process.  If no process, the&#xA;input is processed immediately.&#xA;-  If NO-NEWLINE is non-nil, the input is sent without an implied final&#xA;newline.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  ;; Note that the input string does not include its terminal newline.&#xA;  (let ((proc-running-p&#xA;          (and (eshell-interactive-process)&#xA;               (not queue-p)))&#xA;        (inhibit-point-motion-hooks t)&#xA;        after-change-functions)&#xA;    (unless (and proc-running-p&#xA;                 (not (eq (process-status (eshell-interactive-process)) 'run)))&#xA;      (if (or proc-running-p&#xA;              (&amp;gt;= (point) eshell-last-output-end))&#xA;        (goto-char (point-max))&#xA;        ;; This is for a situation when point is before `point-max'.&#xA;        (let ((copy (or input-string-a (eshell-get-old-input use-region))))&#xA;          (goto-char eshell-last-output-end)&#xA;          (insert-and-inherit copy)))&#xA;      (unless (or no-newline&#xA;                  (and eshell-send-direct-to-subprocesses&#xA;                       proc-running-p))&#xA;        (insert-before-markers-and-inherit ?\n))&#xA;      (if proc-running-p&#xA;        (progn&#xA;          (eshell-update-markers eshell-last-output-end)&#xA;          (if (or eshell-send-direct-to-subprocesses&#xA;                  (= eshell-last-input-start eshell-last-input-end))&#xA;            (unless no-newline&#xA;              (process-send-string (eshell-interactive-process) &quot;\n&quot;))&#xA;                (process-send-region (eshell-interactive-process)&#xA;                   eshell-last-input-start&#xA;                   eshell-last-input-end)))&#xA;        (if (and (null input-string-a) (= eshell-last-output-end (point)))&#xA;          ;; This next line is for a situation when nothing is there --&#xA;          ;; i.e., just make a new command prompt.&#xA;          (run-hooks 'eshell-post-command-hook)&#xA;          (let (input)&#xA;            (eshell-condition-case err&#xA;              (progn&#xA;                (setq input (or input-string-a&#xA;                                (buffer-substring-no-properties&#xA;                                   eshell-last-output-end (1- (point)))))&#xA;                (run-hook-with-args 'eshell-expand-input-functions&#xA;                        eshell-last-output-end (1- (point)))&#xA;                (let ((cmd (eshell-parse-command-input&#xA;                             eshell-last-output-end (1- (point)) nil input-string-a)))&#xA;                  (when cmd&#xA;                    (eshell-update-markers eshell-last-output-end)&#xA;                    (setq input (buffer-substring-no-properties&#xA;                                  eshell-last-input-start&#xA;                                  (1- eshell-last-input-end)))&#xA;                    (run-hooks 'eshell-input-filter-functions)&#xA;                    (and (catch 'eshell-terminal&#xA;                           (ignore&#xA;                             (if (eshell-invoke-directly cmd)&#xA;                               (eval cmd)&#xA;                               (eshell-eval-command cmd input))))&#xA;                         (eshell-life-is-too-much)))))&#xA;                  (quit&#xA;                    (eshell-reset t)&#xA;                    (run-hooks 'eshell-post-command-hook)&#xA;                    (signal 'quit nil))&#xA;                  (error&#xA;                    (eshell-reset t)&#xA;                    (eshell-interactive-print&#xA;                      (concat (error-message-string err) &quot;\n&quot;))&#xA;                    (run-hooks 'eshell-post-command-hook)&#xA;                    (insert-and-inherit input)))))))))&#xA;&#xA;(defun eshell-parse-command-input (beg end &amp;amp;optional args input-string-b)&#xA;  &quot;Parse the command input from BEG to END.&#xA;The difference is that `eshell-parse-command' expects a complete&#xA;command string (and will error if it doesn't get one), whereas this&#xA;function will inform the caller whether more input is required.&#xA;-  If nil is returned, more input is necessary (probably because a&#xA;multi-line input string wasn't terminated properly).  Otherwise, it&#xA;will return the parsed command.&quot;&#xA;  (let (delim command)&#xA;    (if (setq delim (catch 'eshell-incomplete&#xA;                      (ignore&#xA;                        (setq command&#xA;                              (eshell-parse-command&#xA;                                (cons beg end) args t input-string-b)))))&#xA;      (ignore&#xA;        (message &quot;Expecting completion of delimiter %c ...&quot;&#xA;          (if (listp delim)&#xA;              (car delim)&#xA;            delim)))&#xA;      command)))&#xA;&#xA;(defun eshell-parse-command (command &amp;amp;optional args toplevel input-string-c)&#xA;  &quot;Parse the COMMAND, adding ARGS if given.&#xA;COMMAND can either be a string, or a cons cell demarcating a buffer&#xA;region.  TOPLEVEL, if non-nil, means that the outermost command (the&#xA;user's input command) is being parsed, and that pre and post command&#xA;hooks should be run before and after the command.&quot;&#xA;  (let* (&#xA;      eshell--sep-terms&#xA;      (terms&#xA;        (if input-string-c&#xA;          (eshell-parse-arguments--temp-buffer input-string-c)&#xA;          (append&#xA;            (if (consp command)&#xA;              (eshell-parse-arguments (car command) (cdr command))&#xA;              (let ((here (point))&#xA;                    (inhibit-point-motion-hooks t))&#xA;                (with-silent-modifications&#xA;                  ;; FIXME: Why not use a temporary buffer and avoid this&#xA;                  ;; &quot;insert&amp;amp;delete&quot; business?  --Stef&#xA;                  (insert command)&#xA;                  (prog1&#xA;                      (eshell-parse-arguments here (point))&#xA;                    (delete-region here (point))))))&#xA;            args)))&#xA;      (commands&#xA;        (mapcar&#xA;          (function&#xA;            (lambda (cmd)&#xA;              (setq cmd (if (or (not (car eshell--sep-terms))&#xA;                                (string= (car eshell--sep-terms) &quot;;&quot;))&#xA;                          (eshell-parse-pipeline cmd)&#xA;                          `(eshell-do-subjob&#xA;                              (list ,(eshell-parse-pipeline cmd)))))&#xA;              (setq eshell--sep-terms (cdr eshell--sep-terms))&#xA;              (if eshell-in-pipeline-p&#xA;                cmd&#xA;                `(eshell-trap-errors ,cmd))))&#xA;          (eshell-separate-commands terms &quot;[&amp;amp;;]&quot; nil 'eshell--sep-terms))) )&#xA;    (let ((cmd commands))&#xA;      (while cmd&#xA;        (if (cdr cmd)&#xA;            (setcar cmd `(eshell-commands ,(car cmd))))&#xA;        (setq cmd (cdr cmd))))&#xA;    (if toplevel&#xA;      `(eshell-commands (progn&#xA;                                (run-hooks 'eshell-pre-command-hook)&#xA;                                (catch 'top-level (progn ,@commands))&#xA;                                (run-hooks 'eshell-post-command-hook)))&#xA;      (macroexp-progn commands))))&#xA;&#xA;(defun eshell-parse-arguments--temp-buffer (input-string-d)&#xA;  &quot;Parse all of the arguments at point from BEG to END.&#xA;Returns the list of arguments in their raw form.&#xA;Point is left at the end of the arguments.&quot;&#xA;  (with-temp-buffer&#xA;    (insert input-string-d)&#xA;    (let ((inhibit-point-motion-hooks t)&#xA;          (args (list t))&#xA;          delim)&#xA;      (with-silent-modifications&#xA;        (remove-text-properties (point-min) (point-max)&#xA;                                '(arg-begin nil arg-end nil))&#xA;        (goto-char (point-min))&#xA;        (if (setq&#xA;             delim&#xA;             (catch 'eshell-incomplete&#xA;               (while (not (eobp))&#xA;                 (let* ((here (point))&#xA;                        (arg (eshell-parse-argument)))&#xA;                   (if (= (point) here)&#xA;                       (error &quot;Failed to parse argument '%s'&quot;&#xA;                              (buffer-substring here (point-max))))&#xA;                   (and arg (nconc args (list arg)))))))&#xA;            (throw 'eshell-incomplete (if (listp delim)&#xA;                                          delim&#xA;                                        (list delim (point) (cdr args)))))&#xA;        (cdr args)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-25T19:20:55.823" LastActivityDate="2016-12-25T19:20:55.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29552" PostTypeId="1" CreationDate="2016-12-24T21:12:37.867" Score="2" ViewCount="692" Body="&lt;p&gt;[OS X 11.6, Emacs 25.1, but also Emacs 24]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;python-mode&lt;/code&gt; (from &lt;code&gt;python.el&lt;/code&gt;), any of the commands that use &lt;code&gt;python-send-string&lt;/code&gt; (e.g., &lt;code&gt;python-send-region&lt;/code&gt;) print a mess like this at the prompt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)&#xA;import codecs, os;__pyfile = codecs.open('''/var/folders/9l/wcyszrfx3kg7s1sv0bp68_740000j7/T/py201356GE''', encoding='''utf-8''');__code = __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/9l/wcyszrfx3kg7s1sv0bp68_740000j7/T/py201356GE''');exec(compile(__code, '''PATH-TO-THE--PYTHONFILE-I-AM-EDITING''', 'exec'));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is this about and how can I stop it?&lt;/p&gt;&#xA;" OwnerUserId="11515" LastActivityDate="2017-01-25T00:08:36.343" Title="python-send-string echo begins with print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) import codecs, os;__pyfile" Tags="|python|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29554" PostTypeId="1" CreationDate="2016-12-24T21:54:05.070" Score="1" ViewCount="52" Body="&lt;p&gt;I would like to write a function that does the equivalent of the shell command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vim $MY_FILE &amp;amp;&amp;amp; $MY_COMMAND&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words, I would like to open a file in a buffer, and then when I save/close that buffer, I want it to run a certain shell command. How would I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the shell command must be run in &lt;code&gt;su&lt;/code&gt; mode, so I need to either run it in an interactive shell so that the &lt;code&gt;sudo&lt;/code&gt; mode prompts for the password, or maybe have a popup that asks for the superuser password somehow.&lt;/p&gt;&#xA;" OwnerUserId="13650" LastEditorUserId="105" LastEditDate="2017-05-16T22:32:20.883" LastActivityDate="2017-05-16T22:32:20.883" Title="How to write a function for editing a file and then running a command?" Tags="|files|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29555" PostTypeId="1" AcceptedAnswerId="29588" CreationDate="2016-12-24T22:11:51.657" Score="2" ViewCount="1565" Body="&lt;p&gt;When I run any sudo command using shell-command—for example, &lt;code&gt;(shell-command &quot;sudo ls&quot;)&lt;/code&gt;—I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo: no tty present and no askpass program specified&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get around this? I'm guessing it should be possible to tell Emacs somehow what my askpass program is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, the correct askpass program is currently stored in the environment variable &lt;code&gt;$SSH_ASKPASS&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13650" LastActivityDate="2016-12-26T12:42:56.150" Title="How to run sudo commands using shell-command?" Tags="|shell-command|sudo|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29556" PostTypeId="1" CreationDate="2016-12-25T01:10:55.783" Score="2" ViewCount="1374" Body="&lt;p&gt;I would like to choose which printer is used for printing in Emacs.  Before I can set &lt;code&gt;printer-name&lt;/code&gt; to something, I need to know the names of the available printers.  Under Windows, I can see the available printers in the &quot;Devices and Printers&quot; control panel, but that does not give me names I can use in Emacs.  Under BSD or Linux I could use &lt;code&gt;lpstat -d&lt;/code&gt;, but lpstat doesn't seem to be available in either Windows or the Cygwin command sets.  &lt;code&gt;cygcheck -p /lpstat&lt;/code&gt; only returns entries related to lpstat and not the tool its self.  Is there another way to enumerate the available printers under Cygwin/Windows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Windows 10 Professional Ver 10.0 Build 14393&#xA;emacs-w32                  25.1-1&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="14345" LastActivityDate="2016-12-27T01:33:38.403" Title="Under Cygwin, how do we get a list of available printers?" Tags="|print|cygwin|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29557" PostTypeId="1" CreationDate="2016-12-25T02:31:28.467" Score="0" ViewCount="457" Body="&lt;p&gt;How I can replace auto-complete-mode with company-mode in all major mode using it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. make all modes which activating auto-complete-mode (e.g. c-mode or sh-mode etc), activate company-mode instead (and don't activate auto-complete-mode).&lt;/p&gt;&#xA;" OwnerUserId="506" LastActivityDate="2016-12-25T05:32:42.667" Title="How replace auto-complete-mode with company-mode in all major mode using it?" Tags="|hooks|major-mode|auto-complete-mode|minor-mode|aliases|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29558" PostTypeId="2" ParentId="29557" CreationDate="2016-12-25T04:23:03.520" Score="1" Body="&lt;p&gt;Uninstall &lt;code&gt;emacs-auto-complete&lt;/code&gt; using &lt;code&gt;yum&lt;/code&gt; or &lt;code&gt;dnf&lt;/code&gt; and install &lt;code&gt;company&lt;/code&gt; using the emacs package manager. Turn company on with &lt;code&gt;(global-company-mode)&lt;/code&gt; ur use &lt;code&gt;*mode-hook&lt;/code&gt;s to turn it on for specific modes.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2016-12-25T04:23:03.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29559" PostTypeId="2" ParentId="29557" CreationDate="2016-12-25T04:38:19.670" Score="0" Body="&lt;p&gt;Fedora supplies some system-wide init files which turns on AC mode on some major modes.&lt;br&gt;&#xA;this will do what I asked in the question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'company)&#xA;(add-hook 'prog-mode-hook 'company-mode)&#xA;(defun my_auto-complete-mode-hook_1 ()&#xA;                     (when auto-complete-mode (auto-complete-mode 0))&#xA;                     (company-mode 1))&#xA;(add-hook 'auto-complete-mode-hook 'my_auto-complete-mode-hook_1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="506" LastEditorUserId="12247" LastEditDate="2016-12-25T05:32:42.667" LastActivityDate="2016-12-25T05:32:42.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29560" PostTypeId="1" AcceptedAnswerId="29561" CreationDate="2016-12-25T07:52:01.447" Score="0" ViewCount="152" Body="&lt;p&gt;I'd like to use a super small value of &lt;code&gt;company-minimum-prefix-length&lt;/code&gt;, for example, &lt;code&gt;2&lt;/code&gt;. This is really handy and I don't feel any performance issue. The only thing that annoys me is, when in inferior shell mode(inferior-python-mode, inferior-ess-mode, shell-mode ...), some commands are short, i.e. &lt;code&gt;ls&lt;/code&gt;, what I actually want is to run the command after I press &lt;code&gt;RET&lt;/code&gt; even there was company tooltip displaying the candidates before I press &lt;code&gt;RET&lt;/code&gt;. But what I got is &lt;code&gt;company&lt;/code&gt; did the completion and I need to press &lt;code&gt;RET&lt;/code&gt; to run the command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because this will happen even when &lt;code&gt;company-minimum-prefix-length&lt;/code&gt; is set to a large value, for example, &lt;code&gt;5&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Lrc29.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Lrc29.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than set a larger value of &lt;code&gt;company-minimum-prefix-length&lt;/code&gt;, I'd like to tell &lt;code&gt;company&lt;/code&gt; to do completion and and run the command of &lt;code&gt;RET&lt;/code&gt; of current major mode if current candidate is already exactly the same as the prefix I typed ? Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-12-29T04:27:21.543" Title="Do complete and run RET in company" Tags="|company-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29561" PostTypeId="2" ParentId="29560" CreationDate="2016-12-25T08:45:56.357" Score="2" Body="&lt;p&gt;Here is a dirty solution&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun company-immediate-completion-and-run (orig-func &amp;amp;rest args)&#xA;  (let ((prefix company-prefix)&#xA;        (candidate (nth company-selection company-candidates)))&#xA;    (prog1 (apply orig-func args)&#xA;      (if (string= prefix candidate)&#xA;          (call-interactively (key-binding (kbd &quot;RET&quot;)))))))&#xA;(advice-add 'company-complete-selection :around #'company-immediate-completion-and-run)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a hook &lt;code&gt;company-completion-finished-hook&lt;/code&gt; but it seems that we must record the &lt;code&gt;prefix&lt;/code&gt; and &lt;code&gt;candidate&lt;/code&gt; before finished because once the completion is finished, &lt;code&gt;company&lt;/code&gt; will set both back to &lt;code&gt;nil&lt;/code&gt;. More elegant solutions are welcome.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="8373" LastEditDate="2016-12-29T04:27:21.543" LastActivityDate="2016-12-29T04:27:21.543" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29562" PostTypeId="1" CreationDate="2016-12-25T09:08:01.233" Score="2" ViewCount="1137" Body="&lt;p&gt;Currently all my settings that come from the customize interface are placed in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;&#xA;  '(menu-bar-mode nil)&#xA;  '(ivy-mode t)&#xA;  '(blink-cursor-mode nil)&#xA;  '(hl-line-mode nil)&#xA;  '(inhibit-startup-buffer-menu t)&#xA;  '(inhibit-startup-screen t)&#xA;  '(initial-scratch-message nil)&#xA;  '(scroll-bar-mode nil)&#xA;  '(show-paren-mode t)&#xA;  '(tool-bar-mode nil)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, these settings eventually get buried inside the auto generated code that accumulates over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to move some of these settings outside of the customize-interface into their own dedicated section so that I can keep track of them easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I understand I can't create a second custom-set-variables section because that's reserved for the auto generated code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know elisp well enough to know how to do this effectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some guides suggest placing this anywhere in the init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(menu-bar-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've also seen this version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(menu-bar-mode 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this doesn't seem to work for all settings and some of them just give errors at startup. like this one for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ivy-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: ivy-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what is the right way to organize settings outside of the customize-interface? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how do these formats differ? &lt;code&gt;-1&lt;/code&gt; &lt;code&gt;0&lt;/code&gt; &lt;code&gt;1&lt;/code&gt; &lt;code&gt;t&lt;/code&gt; &lt;code&gt;nil&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** Answer in comments.&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2016-12-25T17:00:34.857" LastActivityDate="2016-12-25T17:00:34.857" Title="Separating Customize settings from other Init-file settings" Tags="|init-file|customize|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29563" PostTypeId="1" AcceptedAnswerId="29564" CreationDate="2016-12-25T09:11:28.023" Score="0" ViewCount="37" Body="&lt;p&gt;im looking for a way/function to kill/delete alll whitespace/empty area in a region to start of line. for example if i have this snippet&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defhydra hydra-copy-paste  (:color blue  :columns 4 :hints nil)&#xA;  &quot;copy paste operations&quot;&#xA;     (&quot;0&quot; z/copy-buffer-file-path  &quot;copy current buffer to path&quot; )&#xA;(&quot;a&quot; align-regexp &quot;align-regexp&quot; )&#xA;  (&quot;c&quot; copy-to-register  &quot;copy to register&quot;) &#xA;(&quot;e&quot; hydra-edit-extra/body  &quot;Extra editing commands&quot; :face 'hydra-face-purple)&#xA;&#xA;    (&quot;d&quot; downcase-region  &quot;downcase &quot; )&#xA;(&quot;p&quot; insert-register  &quot;paste from register&quot;) &#xA;(&quot;v&quot; view-register  &quot;view register&quot;) &#xA;    (&quot;r&quot; z/open-this-file-as-other-user  &quot;edit as root&quot; :face 'hydra-face-red )&#xA;    (&quot;u&quot; upcase-region  &quot;upcase &quot; )&#xA;(&quot;q&quot; nil &quot;cancel&quot; nil)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i want it to run and format the section by killing all whitespace till start of line so it looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defhydra hydra-copy-paste  (:color blue  :columns 4 :hints nil)&#xA;&quot;copy paste operations&quot;&#xA;(&quot;0&quot; z/copy-buffer-file-path  &quot;copy current buffer to path&quot; )&#xA;(&quot;a&quot; align-regexp &quot;align-regexp&quot; )&#xA;(&quot;c&quot; copy-to-register  &quot;copy to register&quot;) &#xA;(&quot;e&quot; hydra-edit-extra/body  &quot;Extra editing commands&quot; :face 'hydra-face-purple)&#xA;(&quot;d&quot; downcase-region  &quot;downcase &quot; )&#xA;(&quot;p&quot; insert-register  &quot;paste from register&quot;) &#xA;(&quot;v&quot; view-register  &quot;view register&quot;) &#xA;(&quot;r&quot; z/open-this-file-as-other-user  &quot;edit as root&quot; :face 'hydra-face-red )&#xA;(&quot;u&quot; upcase-region  &quot;upcase &quot; )&#xA;(&quot;q&quot; nil &quot;cancel&quot; nil)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-12-25T10:12:05.597" Title="looking for a way/function to kill/delete alll whitespace/empty area in a region to start of line" Tags="|text-editing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29564" PostTypeId="2" ParentId="29563" CreationDate="2016-12-25T10:12:05.597" Score="3" Body="&lt;p&gt;One possibility would be to look at the implementation of &lt;code&gt;(delete-trailing-whitespace)&lt;/code&gt;, but certainly, the easiest way would be to select the region and hit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x replace-regexp RET ^[[:space:]]+ RET RET&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can bundle that into an interactive function if need be. &lt;/p&gt;&#xA;" OwnerUserId="13946" LastActivityDate="2016-12-25T10:12:05.597" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29565" PostTypeId="1" CreationDate="2016-12-25T10:27:34.813" Score="0" ViewCount="806" Body="&lt;p&gt;I'd like to have an Org file with the following structure&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Books&#xA;** Fantasy&#xA;*** TOREAD Fantasy Book 1&#xA;*** READING Fantasy Book 2&#xA;*** TOREAD Fantasy Book 3&#xA;&#xA;** Comedy&#xA;*** TOREAD Comedy Book 1&#xA;&#xA;* Articles&#xA;** Science&#xA;*** TOREAD Article 1&#xA;&#xA;&#xA;* Archive&#xA;** Books&#xA;*** Fantasy&#xA;**** READ Fantasy Book X&#xA;**** WONTREAD Fantasy Book X&#xA;*** Comedy&#xA;** Articles&#xA;*** Science&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In words, some hierarchy, and an archived version of that hierarchy with items flagged as done (here READ and WONTREAD).  The goal is for the archiving to be done automagically when flagging the item as done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example: If &lt;code&gt;Fantasy Book 2&lt;/code&gt; were to be set as &lt;code&gt;READ&lt;/code&gt;, it would fall under &lt;code&gt;Archive&amp;gt;Books&amp;gt;Fantasy&lt;/code&gt;, at the bottom of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;  Is this doable?  Is this legal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My org-foo is in its infancy, and help would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="13946" LastEditorUserId="13946" LastEditDate="2016-12-25T17:57:41.077" LastActivityDate="2016-12-25T17:57:41.077" Title="A read list in Org" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29566" PostTypeId="1" CreationDate="2016-12-25T11:28:42.493" Score="4" ViewCount="1177" Body="&lt;p&gt;I am preparing a question bank type book which contains problems as well as answer keys to all the problems. I'm doing this using &lt;code&gt;org-mode&lt;/code&gt;. This will be exported to LaTeX PDF for my final book. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is a problem I'm running into. To put it very simply, here is the problem:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;My book will have 2 sections: one containing problems, and the other containing answers to those problems. In org-mode, I have one major heading for &lt;strong&gt;Problems&lt;/strong&gt;, under which I create sub-headings for each new problem. Inside each problem sub-heading, I have another sub-heading which contains the answer to that problem. In my final book, I wish the answers to be in a separate chapter and not directly after the problem. However, in &lt;code&gt;org-mode&lt;/code&gt;, I am adding the answers as a new sub-heading inside each problem itself for my own convenience of writing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I  want to somehow to segregate out the answers' subheadings and push them into new section during my LaTeX export. Can this be done? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you suggest some other methodology for writing a question-answer type book, where we have answers in a separate section of the book? &lt;/p&gt;&#xA;" OwnerUserId="13458" LastActivityDate="2016-12-26T12:54:50.283" Title="Writing a Question-Answer type book in org-mode" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29567" PostTypeId="2" ParentId="29565" CreationDate="2016-12-25T11:34:43.917" Score="1" Body="&lt;p&gt;You could use &lt;code&gt;org-after-todo-state-change-hook&lt;/code&gt;, which&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hook which is run after the state of a TODO item was changed.&#xA;  The new state (a string with a TODO keyword, or nil) is available in the&#xA;  Lisp variable ‘org-state’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-after-todo-state-change-hook 'konstantin/org-archive-when-done)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the function to be hooked is the &lt;code&gt;konstantin/org-archive-when-done&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun konstantin/org-archive-when-done ()&#xA;  &quot;Archive item when TODO state changed to DONE&quot;&#xA;  (if (member org-state '(&quot;DONE&quot; &quot;DELEGATED&quot;))&#xA;      (org-archive-subtree)&#xA;    ()))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here you can see list of stages like &lt;code&gt;(&quot;DONE&quot; &quot;DELEGATED&quot;)&lt;/code&gt;, which means to be like DONE.  In your case it is &lt;code&gt;(&quot;READ&quot; &quot;WONTREAD&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For automatically load this function, put its into &lt;code&gt;init.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2016-12-25T11:34:43.917" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29568" PostTypeId="1" AcceptedAnswerId="29574" CreationDate="2016-12-25T11:40:21.620" Score="2" ViewCount="10998" Body="&lt;p&gt;I have emacs version 23.3.1, the default color has dark purple text against a grey background which hurts my eyes.&lt;/p&gt;&#xA;&lt;p&gt;I have read documentation* to try and look through the list of default preloaded emacs themes and pick a new color theme.&lt;/p&gt;&#xA;&lt;p&gt;*where can I find emacs documentation specific to an older version?&lt;/p&gt;&#xA;&lt;p&gt;I have tried M-x and the following commands, however all of them return with &amp;quot;[No Match]&amp;quot;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;M-x color-theme-select&lt;/p&gt;&#xA;&lt;p&gt;M-x customize-themes&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;When I try &amp;quot;customize-themes&amp;quot; on my local terminal I can see a list of themes and can pick between them (v24.5.1).&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Is there anyway to achieve this on the older version of emacs?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="14348" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-25T16:49:57.487" Title="Emacs 23: Change Theme" Tags="|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29569" PostTypeId="1" CreationDate="2016-12-25T13:11:03.907" Score="1" ViewCount="104" Body="&lt;p&gt;Im looking for a way to copy (clone) a file into same dired buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if i have a &lt;code&gt;test.zip&lt;/code&gt; file in &lt;code&gt;~&lt;/code&gt; i would issue it and it would copy &lt;code&gt;test.zip&lt;/code&gt; file to &lt;code&gt;~&lt;/code&gt;. a bonus would be if one can assign a number/string to the new cloned file like &lt;code&gt;test1.zip&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2016-12-25T13:11:03.907" Title="copy (clone) a file into same dired buffer" Tags="|dired|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29570" PostTypeId="1" AcceptedAnswerId="29572" CreationDate="2016-12-25T13:55:33.693" Score="1" ViewCount="487" Body="&lt;p&gt;I've been learning how to use modules using the &lt;code&gt;cider-mode&lt;/code&gt; source code but I've run into a very basic issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contents of my files are &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;main.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt; (require 'main-module)&#xA;&#xA;   (main-module-message)&#xA;&#xA;   (provide 'main)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;main-module.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun main-module-message ()&#xA;  (message-box &quot;this is defined in the module&quot;)&#xA;&#xA;(provide 'module)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;code&gt;(load &quot;~/Projects/modules-test/main.el&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can't sense the&lt;code&gt;main-module.el&lt;/code&gt; file kept inside the same directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please point to the relevant documentation, I can't seem to find anything useful on &lt;code&gt;require&lt;/code&gt; and &lt;code&gt;provide&lt;/code&gt; apart from a couple paragraphs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13129" LastEditorUserId="105" LastEditDate="2016-12-25T16:21:17.187" LastActivityDate="2016-12-25T16:21:17.187" Title="How to load libraries (Lisp files), wherever they are located" Tags="|load-path|require|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29571" PostTypeId="1" CreationDate="2016-12-25T14:16:39.793" Score="3" ViewCount="1423" Body="&lt;p&gt;I'm trying to port my tagging workflow from Vim &amp;amp; ctags to Emacs &amp;amp; etags. I currently use git hooks to write a tags file to &lt;code&gt;.git/tags&lt;/code&gt; in ctags format whenever I commit/merge/etc. This keeps each project indexed with an up-to-date tags file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/tpope/vim-fugitive&quot; rel=&quot;nofollow noreferrer&quot;&gt;fugitive.vim&lt;/a&gt; makes sure Vim will look for tags in the &lt;code&gt;.git&lt;/code&gt; directory associated with the current buffer. For a Ruby project that uses gems, &lt;a href=&quot;https://github.com/tpope/vim-bundler&quot; rel=&quot;nofollow noreferrer&quot;&gt;bundler.vim&lt;/a&gt; ensures Vim will look for tags in each included gem's directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This lets me navigate freely throughout various projects without having to tell Vim where to find tags. I've added a git hook to write tags to &lt;code&gt;.git/etags&lt;/code&gt; in the etags format, but I'm not sure how to get Emacs to find tags files automatically. I'd like to avoid hard-coding the value of &lt;code&gt;tags-table-list&lt;/code&gt; if possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before I reinvent the wheel and translate the logic of fugitive.vim and bundler.vim into elisp, is there an existing solution for this kind of thing?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2016-12-25T16:25:48.427" LastActivityDate="2018-10-10T21:08:34.377" Title="Automatically locate &amp; use the right etags file for each project?" Tags="|ctags|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29572" PostTypeId="2" ParentId="29570" CreationDate="2016-12-25T15:56:55.427" Score="4" Body="&lt;p&gt;What you are looking for is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/Projects/modules-test&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See docs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Libraries.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lisp Libraries&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Library-Search.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Library Search&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The best thing you can do is &lt;kbd&gt;C-h v load-path RET&lt;/kbd&gt; and follow links in the &lt;code&gt;*Help*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2016-12-25T15:56:55.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29573" PostTypeId="1" CreationDate="2016-12-25T16:05:24.440" Score="1" ViewCount="218" Body="&lt;p&gt;Is it possible to do completion without evaluating the buffer in &lt;code&gt;ess-mode&lt;/code&gt;/&lt;code&gt;R-mode&lt;/code&gt; which uses &lt;code&gt;company-R-objects&lt;/code&gt; and &lt;code&gt;company-R-args&lt;/code&gt; as backends ? Backends like &lt;code&gt;company-jedi&lt;/code&gt; can do completion without evaluating any statement of current buffer. Thanks in advance !&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="105" LastEditDate="2016-12-25T16:19:22.663" LastActivityDate="2016-12-25T16:19:22.663" Title="Get company completion without evaluation in ess" Tags="|company-mode|completion|ess|r|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29574" PostTypeId="2" ParentId="29568" CreationDate="2016-12-25T16:49:57.487" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/CustomThemes&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Custom&lt;/em&gt; themes&lt;/a&gt; are not really available for Emacs releases prior to Emacs 24.  (They are available in a rudimentary form, which does not correspond to what you think of as a theme.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;a href=&quot;https://www.emacswiki.org/emacs/ColorThemes&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;color&lt;/em&gt; themes&lt;/a&gt; are available for pretty much any Emacs release.  You need library &lt;a href=&quot;http://www.nongnu.org/color-theme/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;color-theme.el&lt;/code&gt;&lt;/a&gt; to use color themes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two libraries that you can use (either of them) to choose among available themes, &lt;em&gt;seeing the effect of each or any before choosing&lt;/em&gt;. Each library lets you cycle among either color themes or custom themes.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/DoReMi&quot; rel=&quot;nofollow noreferrer&quot;&gt;Do Re Mi&lt;/a&gt;&lt;/strong&gt; - commands &lt;strong&gt;&lt;code&gt;doremi-color-themes+&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;doremi-custom-themes+&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt;&lt;/strong&gt; - &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow noreferrer&quot;&gt;(multi-)&lt;/a&gt;commands &lt;strong&gt;&lt;code&gt;icicle-color-theme&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;icicle-custom-theme&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For Icicles, you have these user options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;icicle-color-themes&lt;/code&gt;&lt;/strong&gt; is a list of color themes to&#xA;cycle through when you use command &lt;code&gt;icicle-color-theme&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Option &lt;strong&gt;&lt;code&gt;icicle-custom-themes&lt;/code&gt;&lt;/strong&gt; is a list of Emacs custom themes&#xA;to cycle through when you use command &lt;code&gt;icicle-custom-theme&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Option &lt;strong&gt;&lt;code&gt;icicle-custom-themes-accumulate-flag&lt;/code&gt;&lt;/strong&gt; determines whether such&#xA;cycling keeps the effects of previously applied themes or&#xA;replaces each theme with the next one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Option &lt;strong&gt;&lt;code&gt;icicle-custom-themes-update-flag&lt;/code&gt;&lt;/strong&gt; determines whether the&#xA;command automatically saves changes made.  A prefix argument&#xA;flips this option value for the invocation of the command.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-25T16:49:57.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29575" PostTypeId="2" ParentId="29562" CreationDate="2016-12-25T16:57:59.480" Score="5" Body="&lt;p&gt;Set variable &lt;code&gt;custom-file&lt;/code&gt;.  If defined, that is the file the Customize uses, to save and update your custom settings, instead of using your init file (e.g. &lt;code&gt;~/.emacs&lt;/code&gt;).  Just add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-file &quot;/LOCATION/OF/YOUR/INIT/FILE/FILENAME&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And load that file at an appropriate place in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file custom-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lets you reserve your init file for Lisp customizations/settings that you make.  It keeps Customize out of your init file, so the two of you don't step on each other.  (Everyone should use &lt;code&gt;custom-file&lt;/code&gt; (or some similar mechanism), IMHO.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-25T16:57:59.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29576" PostTypeId="1" AcceptedAnswerId="29582" CreationDate="2016-12-25T19:41:09.123" Score="4" ViewCount="1751" Body="&lt;p&gt;When I double click to open a file, a new Emacs session is launched, like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qtQ1w.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qtQ1w.jpg&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;So now there are two sessions. What I want to do is that when I double click a file, it will be opened in another window in the existing session, so there is only one session. I know I can use &lt;code&gt;C-x C-f&lt;/code&gt; to open a file, but the point is &amp;quot;double click&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;I am using emacs 25.1.1, linuxmint 18.1. How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="14312" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2016-12-26T16:01:17.253" Title="How to open a file in another window by clicking on a file in my window manager?" Tags="|emacsclient|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29577" PostTypeId="1" CreationDate="2016-12-25T19:54:05.240" Score="6" ViewCount="418" Body="&lt;p&gt;I am trying to debug some bizarre issues with my exec-path settings.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I debug PATH in shell, the key tool is &quot;which&quot;, which tells me the absolute path we resolve for a given binary, i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(701) % which ifconfig&#xA;/sbin/ifconfig&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there some equivalent to tell me, for example, what binary Tramp will get when it asks to execute &quot;ssh&quot;?&lt;/p&gt;&#xA;" OwnerUserId="14350" LastEditorUserId="2287" LastEditDate="2016-12-25T23:04:29.003" LastActivityDate="2016-12-25T23:04:29.003" Title="equivalent of unix &quot;which&quot; for exec-path?" Tags="|tramp|exec-path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29578" PostTypeId="2" ParentId="29577" CreationDate="2016-12-25T20:27:38.880" Score="8" Body="&lt;p&gt;You can attempt locating an executable in &lt;code&gt;exec-path&lt;/code&gt; with &lt;code&gt;executable-find&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(executable-find &quot;ls&quot;) ;=&amp;gt; &quot;/usr/bin/ls&quot;&#xA;(executable-find &quot;sl&quot;) ;=&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2016-12-25T20:27:38.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29579" PostTypeId="2" ParentId="29552" CreationDate="2016-12-25T23:01:43.780" Score="1" Body="&lt;p&gt;I used to have a similar problem with the message output for every &lt;code&gt;send-region&lt;/code&gt; command, see &lt;a href=&quot;https://stackoverflow.com/questions/33726268/emacs-inferior-python-shell-shows-the-send-message-with-each-python-shell-send-r?noredirect=1#comment68473819_33726268&quot;&gt;this link&lt;/a&gt;. You may wanna invoke &lt;code&gt;ipython&lt;/code&gt; if you get this problem with python interpreter. Using &lt;code&gt;ipython&lt;/code&gt; this message no longer appears for me. Put the following in your &lt;code&gt;.emacs&lt;/code&gt; to start ipython when starting an inferior python shell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter &quot;ipython2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9915" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2016-12-25T23:01:43.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29580" PostTypeId="2" ParentId="29577" CreationDate="2016-12-25T23:03:15.547" Score="0" Body="&lt;p&gt;Tramp provides a debugging buffer, usually &lt;code&gt;*debug tramp...*&lt;/code&gt; that provides a lot of information. For example...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; GNU Emacs: 24.4.51.2 Tramp: 2.2.9-24.4 -*- mode: outline; -*-&#xA;17:54:29.340451 tramp-maybe-open-connection (3) # Opening connection for schwern.net using scp...&#xA;17:54:29.369182 tramp-maybe-open-connection (3) # Sending command `exec ssh   -o ControlPath=/var/folders/0b/7xp2lxbd7yl0tcpms06fr3d40000gn/T/tramp.40010Dqz.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none schwern.net'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see, it's running &lt;code&gt;exec ssh&lt;/code&gt; which will pick up the normal &lt;code&gt;ssh&lt;/code&gt; from your &lt;code&gt;PATH&lt;/code&gt;. If you want to be sure you can run &lt;code&gt;M-x shell&lt;/code&gt; and check &lt;code&gt;which ssh&lt;/code&gt; or &lt;a href=&quot;https://emacs.stackexchange.com/a/29578/14352&quot;&gt;use the commands in @wasamasa's answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What tramp will use to login is controlled by the &lt;code&gt;tramp-login-program&lt;/code&gt; argument to the particular method in the &lt;code&gt;tramp-methods&lt;/code&gt; variable. For example, here's the ssh method.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (&quot;ssh&quot;&#xA;  (tramp-login-program &quot;ssh&quot;)&#xA;  (tramp-login-args&#xA;   ((&quot;-l&quot; &quot;%u&quot;)&#xA;    (&quot;-p&quot; &quot;%p&quot;)&#xA;    (&quot;%c&quot;)&#xA;    (&quot;-e&quot; &quot;none&quot;)&#xA;    (&quot;%h&quot;)))&#xA;  (tramp-async-args&#xA;   ((&quot;-q&quot;)))&#xA;  (tramp-remote-shell &quot;/bin/sh&quot;)&#xA;  (tramp-remote-shell-args&#xA;   (&quot;-c&quot;))&#xA;  (tramp-gw-args&#xA;   ((&quot;-o&quot; &quot;GlobalKnownHostsFile=/dev/null&quot;)&#xA;    (&quot;-o&quot; &quot;UserKnownHostsFile=/dev/null&quot;)&#xA;    (&quot;-o&quot; &quot;StrictHostKeyChecking=no&quot;)))&#xA;  (tramp-default-port 22))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14352" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2016-12-25T23:03:15.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29582" PostTypeId="2" ParentId="29576" CreationDate="2016-12-25T23:45:26.500" Score="8" Body="&lt;p&gt;Run this in terminal (copy-paste it, then press &lt;code&gt;Enter&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat - &amp;lt;&amp;lt;EOFEOF &amp;gt; ~/.local/share/applications/my_emacsclient.desktop&#xA;[Desktop Entry]&#xA;Name=my Emacsclient&#xA;Exec=/usr/bin/emacsclient --alternate-editor=&quot;&quot; %F&#xA;Icon=emacs&#xA;Type=Application&#xA;EOFEOF&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then open your file-manager and change the default program for opening that file type(s) you desire, to &lt;code&gt;my emacsclient&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will open your files in your current frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, if you want to open your files in your current emacs session, but in another frame, run this, and open your files with &lt;code&gt;my emacsclient new frame&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat - &amp;lt;&amp;lt;EOFEOF &amp;gt; ~/.local/share/applications/my_emacsclient_new_frame.desktop&#xA;[Desktop Entry]&#xA;Name=my Emacsclient new frame&#xA;Exec=/usr/bin/emacsclient -c --alternate-editor=&quot;&quot; %F&#xA;Icon=emacs&#xA;Type=Application&#xA;EOFEOF&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="506" LastEditorUserId="506" LastEditDate="2016-12-26T16:01:17.253" LastActivityDate="2016-12-26T16:01:17.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29583" PostTypeId="2" ParentId="12880" CreationDate="2016-12-26T03:57:13.323" Score="1" Body="&lt;p&gt;The following command hides parentless subtrees, and leaves text&#xA;before the first header visible:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun outline-hide-parentless-subtrees ()&#xA;  &quot;Hide subtrees below parentless headings.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    ;; edge case: is the first line a header?&#xA;    (if (outline-on-heading-p)&#xA;        (hide-subtree))&#xA;    ;; cycle through headings, hiding successively higher ones&#xA;    ;; watch out for headers on last line, which would get us stuck&#xA;    (while (and (progn (outline-next-visible-heading 1)&#xA;                       (outline-on-heading-p))&#xA;                (&amp;lt; (point-at-eol) (point-max)))&#xA;      (hide-subtree))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tested this function lightly, and it seems to work as&#xA;advertised.  There may be some edge cases that didn't occur to&#xA;me.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2016-12-26T17:06:20.697" LastActivityDate="2016-12-26T17:06:20.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29584" PostTypeId="2" ParentId="28915" CreationDate="2016-12-26T04:43:11.843" Score="1" Body="&lt;p&gt;There is &lt;a href=&quot;https://github.com/Floobits/floobits-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;floobits&lt;/a&gt;. It works OK.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2016-12-26T04:43:11.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29585" PostTypeId="1" CreationDate="2016-12-26T07:58:33.797" Score="3" ViewCount="597" Body="&lt;p&gt;I have created TODO/Tag match agenda view as follows,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;====+=======================================================================&#xA;##### ##### ##### project dept + 3d&#xA;work:       TODO E&amp;amp;H TT PROBLEM in ALE                             :project:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It matches project tag and scheduled &amp;lt; 3days from today. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have matched following key-binding to operate through single key in agenda itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;⚫ Function to reschedule agenda items by a day:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/org-agenda-reschedule-week ()   &#xA;(interactive)   &#xA;  (org-agenda-date-later 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This function can schedule org &quot;agenda&quot; item by 1 day recursively.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;⚫ Relevant key-bindings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;org-agenda&quot;  &#xA;  '(progn  &#xA;    (define-key org-agenda-mode-map &quot;m&quot; 'my/org-agenda-reschedule-week)  &#xA;    (define-key org-agenda-mode-map &quot;x&quot; 'my/org-agenda-done)  &#xA;    (define-key org-agenda-mode-map &quot;X&quot; 'my/org-agenda-mark-done-and-add-followup)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem is that the above-mentioned key-bindings do not work in todo/tag match list in agenda.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gives this error,  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;----- start -----  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Not allowed in tags-type agenda buffers&quot;)  &#xA;signal(error **(&quot;Not allowed in tags-type agenda buffers&quot;)**)  &#xA;error(&quot;Not allowed in %s-type agenda buffers&quot; tags)  &#xA;org-agenda-check-type(t agenda timeline)  &#xA;org-agenda-date-later(1)  &#xA;my/org-agenda-reschedule-week()  &#xA;funcall-interactively(my/org-agenda-reschedule-week)  &#xA;call-interactively(my/org-agenda-reschedule-week nil nil)  &#xA;command-execute(my/org-agenda-reschedule-week)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;----- end -----&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says that this commands only available in scheduled agenda type buffer, not available in tags type agenda buffer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any ways to align these tag match list with scheduled agenda items ?&lt;br&gt;&#xA;what is equivalent for org-agenda-date-later function in tag matched list of agenda?&lt;/p&gt;&#xA;" OwnerUserId="10810" LastEditorUserId="2287" LastEditDate="2016-12-26T18:20:48.813" LastActivityDate="2017-09-24T00:38:30.720" Title="key binding to reschedule agenda todo list by n days" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29586" PostTypeId="1" AcceptedAnswerId="29593" CreationDate="2016-12-26T11:57:08.460" Score="4" ViewCount="302" Body="&lt;p&gt;Instead of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   | some value         |&#xA;|-- +--------------------|&#xA;| a | aaaaaaaa           |&#xA;|---+--------------------|&#xA;| b | bbbbbbb bbbbbbbbb  |&#xA;|---+--------------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|   | some value         |&#xA;|-- +--------------------|&#xA;| a | aaaaaaaa           |&#xA;|---+--------------------|&#xA;| b | bbbbbbb            |&#xA;|   | bbbbbbbbb          |&#xA;|---+--------------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because sometimes the table is too long to display and I have to use scroll commands or bol/eol to view the table. Also I have no idea about how to get it nicely export to LaTeX. Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2016-12-26T18:50:17.737" Title="How to &lt;return&gt; in a org table?" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29587" PostTypeId="2" ParentId="29571" CreationDate="2016-12-26T12:14:10.460" Score="4" Body="&lt;p&gt;You can write a hook for loading &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsTags#toc6&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;visit-tags-table&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'c++-mode-hook (lambda ()&#xA;  (locate-dominating-file (file-name-directory (buffer-file-name)) &quot;.git/etags&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although, from what &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Select-Tags-Table.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;I'm reading at the docs&lt;/a&gt;, the &lt;code&gt;tags-table-list&lt;/code&gt; is the way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Shortened code per @phils&lt;/p&gt;&#xA;" OwnerUserId="10785" LastEditorUserId="10785" LastEditDate="2016-12-27T12:45:51.420" LastActivityDate="2016-12-27T12:45:51.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29588" PostTypeId="2" ParentId="29555" CreationDate="2016-12-26T12:42:56.150" Score="7" Body="&lt;p&gt;When &lt;code&gt;default-directory&lt;/code&gt; points to a sudo-ized path, &lt;code&gt;shell-command&lt;/code&gt; uses this environment. Try&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(let ((default-directory &quot;/sudo::&quot;))&#xA; (shell-command &quot;ls&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The password will be asked interactively.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2016-12-26T12:42:56.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29589" PostTypeId="2" ParentId="29566" CreationDate="2016-12-26T12:54:50.283" Score="4" Body="&lt;p&gt;Consider the following org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+EXCLUDE_TAGS: q&#xA;&#xA;* Questions&#xA;** Question 1&#xA;*** Question :q:&#xA;    How many sides does a square have?&#xA;*** Answer :a:&#xA;    Four.&#xA;** Question 2 &#xA;*** Question :q:&#xA;    Today is Tuesday, what is tomorrow?&#xA;*** Answer :a:&#xA;    Wednesday.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you export it, you'll get the headings plus answers only. If you change the EXCLUDE_TAGS to &quot;a&quot; and press &lt;code&gt;C-c C-c&lt;/code&gt; on the header to update the info, export will export only the questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This functionality can be used programmatically, and can thereby serve as a basis for a more automatic solution. One approach would be to write a simple &lt;a href=&quot;http://orgmode.org/manual/Publishing.html#Publishing&quot; rel=&quot;nofollow noreferrer&quot;&gt;publishing&lt;/a&gt; function that exported the q&amp;amp;a file twice, each time excluding one of the two tags. If the file is exported as latex, body-only, the resulting files could be directly included into a bigger latex file of the whole book.&lt;/p&gt;&#xA;" OwnerUserId="9716" LastActivityDate="2016-12-26T12:54:50.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29590" PostTypeId="1" CreationDate="2016-12-26T14:02:31.757" Score="2" ViewCount="125" Body="&lt;p&gt;I'm trying to load an xpm image file looking like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* XPM */&#xA;static char *_0[] = {&#xA;/* columns rows colors chars-per-pixel */&#xA;&quot;15 16 3 1 &quot;,&#xA;&quot;w c white&quot;,&#xA;&quot;b c black&quot;,&#xA;&quot;  c None&quot;,&#xA;/* pixels */&#xA;&quot;               &quot;,&#xA;&quot;               &quot;,&#xA;&quot;               &quot;,&#xA;&quot;     wwwbbb    &quot;,&#xA;&quot;    wwwwbbbb   &quot;,&#xA;&quot;   wwwwwbbbbb  &quot;,&#xA;&quot;   wwwwwbbbbb  &quot;,&#xA;&quot;  wwwwwwbbbbbb &quot;,&#xA;&quot;  wwwwwwbbbbbb &quot;,&#xA;&quot;   wwwwbbbbbb  &quot;,&#xA;&quot;   wwwbbbbbbb  &quot;,&#xA;&quot;    wbbbbbbb   &quot;,&#xA;&quot;     bbbbbb    &quot;,&#xA;&quot;               &quot;,&#xA;&quot;               &quot;,&#xA;&quot;               &quot;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the elisp I use to load it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(insert-image (create-image &quot;path/to/file.xpm&quot;&#xA;                            'xpm&#xA;                            nil&#xA;                            :color-symbols '((&quot;black&quot; . &quot;blue&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I run that sexp, I get the file as-is, without the blacks substituted for blues. What am I doing wrong here?&lt;/p&gt;&#xA;" OwnerUserId="13447" LastActivityDate="2016-12-26T14:02:31.757" Title="xpm-images: `:color-symbols` not working?" Tags="|images|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29591" PostTypeId="1" AcceptedAnswerId="29629" CreationDate="2016-12-26T17:49:04.003" Score="5" ViewCount="166" Body="&lt;p&gt;How can I prevent Emacs from auto-reverting only when the file size is over 10 GB? I know that there's the &lt;em&gt;large-file-warning-threshold&lt;/em&gt; option but it doesn't work for auto-reverting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm dealing with a file that I frequently overwrite programmatically. It's a small file most of the time, but it sometimes becomes unexpectedly large so I'd like to prevent Emacs from freezing when I leave that file open.  &lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-12-28T03:18:55.950" Title="Prevent Emacs from auto-reverting when the file size is over 10 GB" Tags="|auto-revert-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29592" PostTypeId="2" ParentId="29591" CreationDate="2016-12-26T18:19:07.820" Score="4" Body="&lt;p&gt;Maybe use &lt;code&gt;add-file-hook&lt;/code&gt; to turn off &lt;code&gt;auto-revert-mode&lt;/code&gt; for a file buffer that is larger than some limit.  This seems to work OK (tested minimally):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-max-auto-revert-size 1000000000&#xA;  &quot;Do not auto-revert file buffers larger than this.&quot;)&#xA;&#xA;(add-hook 'find-file-hook&#xA;          (lambda ()&#xA;            (when (&amp;gt; (buffer-size) my-max-auto-revert-size)&#xA;              (setq global-auto-revert-ignore-buffer  t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(FWIW, I just added an enhancement request to make this kind of thing easier: Emacs &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25277&quot; rel=&quot;nofollow noreferrer&quot;&gt;bug #25277&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-12-26T18:34:25.653" LastActivityDate="2016-12-26T18:34:25.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29593" PostTypeId="2" ParentId="29586" CreationDate="2016-12-26T18:43:40.310" Score="3" Body="&lt;p&gt;It's possible to make text to wrap by pressing M-, take a look at the &lt;a href=&quot;http://orgmode.org/manual/Built_002din-table-editor.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;table editor docs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for export into latex, M-x org-table-export and specifying file name with .tex extension should work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I got for your second table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{tabular}{ll}&#xA; &amp;amp; some value\\&#xA;\hline&#xA;a &amp;amp; aaaaaaaa\\&#xA;\hline&#xA;b &amp;amp; bbbbbbb\\&#xA; &amp;amp; bbbbbbbbb\\&#xA;\hline&#xA;\end{tabular}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It adds an explicit break though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please, see also answers for this question: &lt;a href=&quot;https://emacs.stackexchange.com/questions/22318/org-table-is-it-possible-to-have-automatic-line-wrapping-inside-org-tables&quot;&gt;Org-table: is it possible to have automatic line wrapping inside org-tables?&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="11466" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2016-12-26T18:50:17.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29594" PostTypeId="2" ParentId="29571" CreationDate="2016-12-26T19:05:46.523" Score="7" Body="&lt;p&gt;I use &lt;a href=&quot;https://www.emacswiki.org/emacs/EtagsTable&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;etags-table&lt;/code&gt;&lt;/a&gt;, available as a package from Marmalade. Install the package and put&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq etags-table-search-up-depth 99)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your init file. Then, then you do a tag lookup, Emacs will look for a &lt;code&gt;TAGS&lt;/code&gt; file in the directory containing the current file and in the parent directories recursively up to 99 levels. More generally, Emacs remembers the associated tag table file for every buffer. You can set the variable &lt;code&gt;etags-table-alist&lt;/code&gt; to match file name patterns to tag file names if your tag file are not called &lt;code&gt;TAGS&lt;/code&gt; or not stored at the root of each project.&lt;/p&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2018-10-10T21:08:34.377" LastActivityDate="2018-10-10T21:08:34.377" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="29595" PostTypeId="2" ParentId="29585" CreationDate="2016-12-26T21:35:07.070" Score="3" Body="&lt;p&gt;The author of &lt;code&gt;org-agenda-date-later&lt;/code&gt; has expressly determined that this function should &lt;em&gt;not&lt;/em&gt; be used in an &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer created by a tags search -- e.g., by using &lt;code&gt;org-tags-view&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we examine the function at issue by typing &lt;code&gt;M-x find-function RET org-agenda-date-later RET&lt;/code&gt;, we see that the first line of code after the &lt;code&gt;interactive&lt;/code&gt; statement is &lt;code&gt;(org-agenda-check-type t 'agenda 'timeline)&lt;/code&gt;.  As we can see, only &lt;code&gt;agenda&lt;/code&gt; and &lt;code&gt;timeline&lt;/code&gt; type agenda views are supported -- &lt;em&gt;not&lt;/em&gt; &lt;code&gt;tags&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the above-mentioned analysis explains why we cannot use &lt;code&gt;org-agenda-date-later&lt;/code&gt; in said buffer.  To the extent that another forum participant wishes to write up and test a new function that will work similar to &lt;code&gt;org-agenda-date-later&lt;/code&gt; in a &lt;code&gt;tags&lt;/code&gt; buffer, or modify the existing function, please feel free to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the event that anyone wishes to experiment by modifying &lt;code&gt;org-agenda-date-later&lt;/code&gt; to support the &lt;code&gt;tags&lt;/code&gt; view buffer, step one might be to add the &lt;code&gt;'tags&lt;/code&gt; symbol to the aforementioned line of code; e.g., &lt;code&gt;(org-agenda-check-type t 'agenda 'timeline 'tags)&lt;/code&gt;.  I would imagine that there will be some glitches since the author of &lt;code&gt;org-agenda-date-later&lt;/code&gt; clearly could have added that feature had he/she really wanted to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Opinion/Guess&lt;/strong&gt;:  @lawlist opines/guesses that &lt;code&gt;org-agenda-date-later&lt;/code&gt; does not support the &lt;code&gt;tags&lt;/code&gt; view agenda buffer because not all entries will contain timestamps; whereas, the &lt;code&gt;agenda&lt;/code&gt; and &lt;code&gt;timeline&lt;/code&gt; buffers contain entries with timestamps.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-27T03:16:36.707" LastActivityDate="2016-12-27T03:16:36.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29596" PostTypeId="1" AcceptedAnswerId="29599" CreationDate="2016-12-26T21:53:41.023" Score="0" ViewCount="377" Body="&lt;p&gt;I am writing an e-lisp function in my .emacs file to help process Bibtex entries I copy from Google-Scholar. Let's consider this example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@article{jacobsen2011full,&#xA;  title={A full hydro-and morphodynamic description of breaker bar development},&#xA;  author={Jacobsen, Niels Gj{\o}l},&#xA;  year={2011},&#xA;  publisher={DTU Mechanical Engineering}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to extract the entry name &quot;jacobsen2011full&quot; that will always be between &quot;{&quot; and &quot;,&quot; but the position from the start is not always constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how to go on about that???&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I do not process the text inside a buffer. As mentioned I want to write an e-lisp function.&lt;/em&gt; &lt;/p&gt;&#xA;" OwnerUserId="14356" LastEditorUserId="14356" LastEditDate="2016-12-26T22:08:51.780" LastActivityDate="2016-12-27T00:37:38.500" Title="How to write an e-lisp function to extract a sub-string between two given characters (not their positions) in a given string?" Tags="|regular-expressions|bibtex|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29598" PostTypeId="2" ParentId="29596" CreationDate="2016-12-26T23:45:08.927" Score="0" Body="&lt;p&gt;I found the solution using the &quot;s&quot; package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 's)&#xA;(setq entryName (s-chop-prefix &quot;{&quot; (car (cdr (s-slice-at &quot;[{,]&quot; string)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you have a suggestion for a more elegant/better solution please share it. Thanks!! &lt;/p&gt;&#xA;" OwnerUserId="14356" LastActivityDate="2016-12-26T23:45:08.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29599" PostTypeId="2" ParentId="29596" CreationDate="2016-12-27T00:37:38.500" Score="0" Body="&lt;p&gt;You should do something like this. Assuming your point is somewhere in the entry. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((entry (save-excursion&#xA;             (bibtex-beginning-of-entry)&#xA;             (bibtex-parse-entry))))&#xA;      (cdr (assoc &quot;=key=&quot; entry))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2016-12-27T00:37:38.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29600" PostTypeId="1" CreationDate="2016-12-27T01:14:05.283" Score="6" ViewCount="7137" Body="&lt;p&gt;How can I move focus from currently focused frame to a neighboring frame-- e.g. right next frame-- via a keyboard shortcut? I'd like to cycle through frames in &quot;z&quot; direction. If I had frames a to h like below on my desktop&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  a   b  c&#xA;d  e  f  &#xA;&#xA;g       h &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to move in the order of a, b, c, d, e, f, g, h, then go back to a and repeat. &lt;/p&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="10707" LastEditDate="2016-12-27T02:30:43.177" LastActivityDate="2017-10-25T23:36:52.060" Title="Switch to a neighboring frame?" Tags="|frames|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29601" PostTypeId="2" ParentId="29556" CreationDate="2016-12-27T01:33:38.403" Score="2" Body="&lt;p&gt;Well it turns out that the long-complicated-names-with-goobers listed in the &quot;Devices and Printers&quot; &quot;Control Panel&quot; / &quot;Windows Settings&quot; really are the printer names...  ick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq printer-name &quot;Microsoft Print to PDF&quot;)&#xA;M-x ps-print-buffer&lt;/code&gt;&lt;br/&gt;&#xA;does in fact generate a PDF file via Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The list of names in the &quot;Control Panel&quot; is confirmed by:&#xA;&lt;code&gt;cscript.exe prnmngr.vds -l&lt;/code&gt; and &lt;code&gt;get-wmiobject -class win32_printer&lt;/code&gt; in PowerShell.  &lt;code&gt;get-printer&lt;/code&gt; also lists the printer names, but it truncates the long ones so it's useless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, printers can be renamed with &lt;code&gt;rename-printer -name &quot;HP Color LaserJet Pro MFP M477&quot; -newname &quot;hp477&quot;&lt;/code&gt; in PowerShell, or through &quot;Printer properties&quot; in the GUI.  (The printer must be on.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, it seems that the built in printers, such as the Microsoft PDF printer, don't allow their lengthy names to be changed at all.&lt;/p&gt;&#xA;" OwnerUserId="14345" LastActivityDate="2016-12-27T01:33:38.403" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29602" PostTypeId="2" ParentId="29600" CreationDate="2016-12-27T02:33:19.873" Score="10" Body="&lt;p&gt;There is an inherent order of the visible frames, but it does not coincide with any particular user-wished order.  To cycle through frames in that inherent order you can use command &lt;code&gt;other-frame&lt;/code&gt; (&lt;code&gt;C-x 5 o&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To move through frames in an arbitrary order that you choose, you would need to create a list or alist of them in that order, and cycle through it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;noreferrer&quot;&gt;Icicles&lt;/a&gt; then you can at least choose a frame by its name, using completion, with command &lt;code&gt;icicle-select-frame&lt;/code&gt; (bound to &lt;code&gt;C-x 5 o&lt;/code&gt; in Icicle mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can sort the completion candidates in various ways, and then cycle through candidates in that sort order.  You can also define your own sort orders, so if you have a set layout of frames then you can use a custom sort order than cycles through them in the order you want.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-27T02:33:19.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29603" PostTypeId="1" AcceptedAnswerId="29604" CreationDate="2016-12-27T08:04:44.273" Score="0" ViewCount="203" Body="&lt;p&gt;I'm trying to set the default font for my Emacs based on a variable (so I can use a different font on a different machine):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq fontspec (concat ck-font-name &quot;-&quot; (number-to-string ck-font-size)))&#xA;(set-default-font fontspec)&#xA;(set-fontset-font &quot;fontset-default&quot; nil&#xA;                  (font-spec :size ck-font-size :name ck-font-name))&#xA;(add-to-list 'default-frame-alist '(font . fontspec))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This basically works but the last line throws a warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;frame-notice-user-settings: Invalid font: fontspec&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know what the problem is (&lt;code&gt;fontspec&lt;/code&gt; seems to not be defined when the list gets evaluated), but I don't know how to fix this; my elisp-fu is not good enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody explain me or give me a pointer where I can read how to fix this?&lt;/p&gt;&#xA;" OwnerUserId="2037" LastEditorUserId="105" LastEditDate="2016-12-27T16:46:59.560" LastActivityDate="2016-12-27T16:46:59.560" Title="Problems with setting the default font" Tags="|list|backquote|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29604" PostTypeId="2" ParentId="29603" CreationDate="2016-12-27T08:10:48.460" Score="2" Body="&lt;p&gt;Ok, I just found out about &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html#Backquote&quot; rel=&quot;nofollow noreferrer&quot;&gt;backquoting&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'default-frame-alist `(font . ,fontspec))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This quotes the &lt;code&gt;(font .&lt;/code&gt; part and evaluates the &lt;code&gt;fontspec&lt;/code&gt;. Nice!&lt;/p&gt;&#xA;" OwnerUserId="2037" LastActivityDate="2016-12-27T08:10:48.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29605" PostTypeId="1" AcceptedAnswerId="29612" CreationDate="2016-12-27T09:41:10.247" Score="6" ViewCount="515" Body="&lt;p&gt;Issuing &lt;code&gt;M-x org-agenda a v y&lt;/code&gt; allows me to view my agenda for the &lt;em&gt;current&lt;/em&gt; year. Is it possible to view my agenda for &lt;em&gt;next&lt;/em&gt; year? More generally, is it possible to view my agenda for a &lt;em&gt;specific&lt;/em&gt; year or for a specified block of time?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-12-28T02:03:39.533" Title="Can org-agenda view specific years?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29606" PostTypeId="1" AcceptedAnswerId="29609" CreationDate="2016-12-27T10:10:32.327" Score="5" ViewCount="151" Body="&lt;p&gt;I want to create a key binding like &lt;code&gt;C-c C-f C-c&lt;/code&gt; to get &lt;code&gt;\mathscr{}&lt;/code&gt; inside math environment. This is because there is no default key binding for getting &lt;code&gt;\mathscr&lt;/code&gt;. How to do this? Remember that &lt;code&gt;C-c C-f C-c&lt;/code&gt; is already in use to get  &lt;code&gt;\textsc&lt;/code&gt; in the text mode.&lt;/p&gt;&#xA;" OwnerUserId="9656" LastEditorUserId="105" LastEditDate="2016-12-27T16:46:33.527" LastActivityDate="2016-12-27T16:46:33.527" Title="Define a new key binding for font (Auctex)" Tags="|key-bindings|auctex|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29608" PostTypeId="1" AcceptedAnswerId="29610" CreationDate="2016-12-27T10:32:50.173" Score="0" ViewCount="38" Body="&lt;p&gt;I'd like to make a list of parameters of each frame such as the top coordinate, left coordinate, and name to achieve what I asked in &lt;a href=&quot;https://emacs.stackexchange.com/questions/29600/switch-to-a-neighboring-frame?noredirect=1#comment45502_29600&quot;&gt;my previous question&lt;/a&gt;. I'm trying to follow the advice I got there and wrote a snippet to print the top coordinates of each frame, but it doesn't work. Could anyone tell me which part is wrong? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;%s&quot; (mapcar (cdr (assq 'top (frame-parameters)))) (frame-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It returns &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid function:(mapcar (cdr (assq 'top (frame-parameters))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2016-12-27T16:43:55.077" Title="Mapping a function over `frame-list` to get a list of the `top` frame-parameter values" Tags="|list|mapping|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29609" PostTypeId="2" ParentId="29606" CreationDate="2016-12-27T10:53:57.347" Score="9" Body="&lt;p&gt;Customize &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#index-LaTeX_002dfont_002dlist&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;LaTeX-font-list&lt;/code&gt;&lt;/a&gt;: &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-variable&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;LaTeX-font-list&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;.  Select &lt;code&gt;Math Prefix:&lt;/code&gt; for &lt;code&gt;^C&lt;/code&gt; key (the prefix &lt;kbd&gt;C-c C-f&lt;/kbd&gt; is omitted) and add &lt;code&gt;\mathscr{&lt;/code&gt; to &quot;Math Prefix:&quot; field and &lt;code&gt;}&lt;/code&gt; to &quot;Math Suffix&quot;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-12-27T10:53:57.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29610" PostTypeId="2" ParentId="29608" CreationDate="2016-12-27T13:38:12.080" Score="0" Body="&lt;p&gt;It turned out that I needed lambda. This worked.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(message &quot;%s&quot; (mapcar  (lambda (x) (cdr (assq 'top (frame-parameters x) )))(frame-list) )) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2016-12-27T13:38:12.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29611" PostTypeId="1" CreationDate="2016-12-27T13:59:41.917" Score="2" ViewCount="95" Body="&lt;p&gt;&lt;code&gt;electric-pair&lt;/code&gt; has an &lt;code&gt;electric-pair-skip-whitespace&lt;/code&gt; config that accepts &lt;code&gt;'chomp&lt;/code&gt; to delete any whitespace between point and the matched closing delimiter. Does &lt;code&gt;smartparens&lt;/code&gt; have something like that? I haven't found anything like that in the sample configs o wiki, but maybe it has a different name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify the behavior I'm looking for is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{ abcd |&#xA;}&#xA;&#xA;:=&amp;gt; type '}'&#xA;&#xA;{ abcd }|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9356" LastEditorUserId="9356" LastEditDate="2016-12-27T14:06:51.953" LastActivityDate="2017-01-10T15:06:25.640" Title="Chomp whitespace when autoclosing with smartparens?" Tags="|smartparens|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29612" PostTypeId="2" ParentId="29605" CreationDate="2016-12-27T15:31:43.510" Score="9" Body="&lt;p&gt;The year (as well as day, month, week etc.) can take a prefix argument specifying the period you want to view.  To view a specific year (e.g. 2017) pass the year using &lt;code&gt;C-u&lt;/code&gt; while in the agenda: &lt;code&gt;C-u 2017 v y&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works by calling the function &lt;code&gt;org-agenda-year-view&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(org-agenda-year-view &amp;amp;optional YEAR)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Switch to yearly view for agenda.&#xA;  With argument YEAR, switch to that year.  Years ranging from 70&#xA;  years ago to 30 years in the future can also be written as&#xA;  2-digit years.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you want to view this frequently you can save it as a custom agenda command.  The period shown is controlled by &lt;code&gt;org-agneda-span&lt;/code&gt; (how much to show) and &lt;code&gt;org-agenda-start-day&lt;/code&gt; (when to start).  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;y&quot; &quot;2017 agenda&quot;&#xA;               agenda &quot;&quot;&#xA;               ((org-agenda-span 'year)&#xA;                (org-agenda-start-day &quot;2017-01-01&quot;)&#xA;               )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2016-12-28T02:03:39.533" LastActivityDate="2016-12-28T02:03:39.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29614" PostTypeId="2" ParentId="20759" CreationDate="2016-12-27T17:30:16.923" Score="2" Body="&lt;p&gt;Hoping below function would help&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; add func to perform imenu for all headings at one level&#xA;(defun org-imenu-get-heading ()&#xA;  &quot;Produce the index for Imenu.&quot;&#xA;  (mapc (lambda (x) (move-marker x nil)) org-imenu-markers)&#xA;  (setq org-imenu-markers nil)&#xA;  (let* ((n org-imenu-depth)&#xA;         (re (concat &quot;^&quot; (org-get-limited-outline-regexp)))&#xA;         (subs (make-vector (1+ n) nil))&#xA;         m level head0 head)&#xA;    (save-excursion&#xA;      (save-restriction&#xA;        (widen)&#xA;        (goto-char (point-max))&#xA;        (while (re-search-backward re nil t)&#xA;          (setq level (org-reduced-level (funcall outline-level)))&#xA;          (when (and (&amp;lt;= level n)&#xA;                     (looking-at org-complex-heading-regexp)&#xA;                     (setq head0 (org-match-string-no-properties 4)))&#xA;            (setq head (org-link-display-format head0)&#xA;                  m (org-imenu-new-marker))&#xA;            (org-add-props head nil 'org-imenu-marker m 'org-imenu t)&#xA;            (push (cons head m) (aref subs 1))))))&#xA;    (aref subs 1)))&#xA;&#xA;(advice-add #'org-imenu-get-tree :override #'org-imenu-get-heading)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14363" LastActivityDate="2016-12-27T17:30:16.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29615" PostTypeId="1" CreationDate="2016-12-27T17:44:59.787" Score="1" ViewCount="15" Body="&lt;p&gt;[OS X 11.6, Emacs 25.1]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using my Apple Extended Keyboard I just stumbled on an Emacs key called &lt;code&gt;&amp;lt;select-window&amp;gt;&lt;/code&gt;. It is bound, naturally, to &lt;code&gt;select-window&lt;/code&gt;. I discovered the key by  accidentally hitting it, seeing something happen, and checking what key I hit by viewing Lossage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What key (possibly modified) is this?? I can't find it anywhere.&lt;/p&gt;&#xA;" OwnerUserId="11515" LastActivityDate="2016-12-27T17:44:59.787" Title="What is the &lt;select-window&gt; key on the Apple extended keyboard?" Tags="|key-bindings|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29617" PostTypeId="1" CreationDate="2016-12-27T19:07:04.100" Score="1" ViewCount="1196" Body="&lt;p&gt;On TeX.SE arouse some questions, on how to add the &lt;code&gt;-excape-shell&lt;/code&gt; option to the actual TeX processor (LaTeX, luaLaTeX, ...).  One offered solution would be, to use a &lt;code&gt;%%% Local Variables&lt;/code&gt; section at the end of the LaTeX-file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But Emacs would not be Emacs, if he could not set this feature by his self.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, AUCTeX comes with a lot of predefined supporting Lisp files.  Unfortunately, there seems to be no package for the LaTeX package &lt;code&gt;minted&lt;/code&gt;.  At least, my AUCTeX did not have one.  Meanwhile I found an &lt;code&gt;minted.el&lt;/code&gt; on &lt;a href=&quot;https://github.com/giordano/auctex/blob/master/style/minted.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/giordano/auctex/blob/master/style/minted.el&lt;/a&gt;.  (Why didn't I see that earlier??) Having not found such file, I sat down and hacked a (not so little) lisp file away.  The main gimmick is the last block &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq LaTeX-command-style '((&quot;&quot; &quot;%(PDF)%(latex) -shell-escape %S%(PDFout)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This was copied from the brilliant TeX.SE article &lt;a href=&quot;https://tex.stackexchange.com/questions/157242/adding-an-option-to-the-pdflatex-call-from-auctex&quot;&gt;https://tex.stackexchange.com/questions/157242/adding-an-option-to-the-pdflatex-call-from-auctex&lt;/a&gt; .  Other parts where copied and adapted from &lt;code&gt;babel.el&lt;/code&gt; or &lt;code&gt;scrbase.el&lt;/code&gt;.  I am of plan, to send this file to the AUCTeX-team, for accepting it to be distributed with AUCTeX.  But before I do so, I would ask to help me, to get an even better file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, I am having a rather dumb solution, to insert minted-options for some commands and environments (not to be mixed up, with the options for the package itself!).  Right now, my function will only ask for one and only key word.  I was not possible to to code it in such a way, that you can insert more than one keyword or even present some appropriate values for the given key(s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a snippet from the file &lt;code&gt;minted.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun LaTeX-minted-package-options ()&#xA;  &quot;Prompt for package options for the minted package.&quot;&#xA;  (TeX-read-key-val&#xA;   t&#xA;   '((&quot;chapter&quot;)&#xA;     (&quot;section&quot;)&#xA;     (&quot;cache&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;cachedir&quot;)&#xA;     (&quot;finalizecache&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;frozencache&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;draft&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;final&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;kpsewhich&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;langlinenos&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;newfloat&quot; (&quot;true&quot; &quot;false&quot;))&#xA;     (&quot;outputdir&quot;))))&#xA; (defvar LaTeX-minted-language-list&#xA;  '(&quot;abap&quot;&#xA;    &quot;abnf&quot;&#xA;    &quot;ada&quot; &quot;ada95&quot; &quot;ada2005&quot;&#xA;    &quot;adl&quot;&#xA;    &quot;agda&quot;    &quot;yaml&quot;&#xA;    &quot;zephir&quot;)&#xA;  &quot;List of supported languages in package minted.  To obtain the actual list, issue 'pygmentize -L lexers' in a shell.&quot;)&#xA;&#xA;;; stolen from babel.el.gz&#xA;(defun TeX-arg-minted-lang (optional &amp;amp;optional prompt)&#xA;  &quot;Prompt for a language with completion and insert it as argument.&quot;&#xA;  (TeX-argument-insert&#xA;   (completing-read &quot;Language: &quot; LaTeX-minted-language-list) nil))&#xA;&#xA;;; also stolen from babel.el.gz&#xA;(defun LaTeX-env-minted-lang (env)&#xA;  &quot;Prompt for a language with completion and insert it as argument of ENV.&quot;&#xA;  (LaTeX-insert-environment&#xA;   env (format &quot;{%s}&quot; (completing-read &quot;Language: &quot;&#xA;                       LaTeX-minted-language-list))))&#xA;(defvar LaTeX-minted-style-list&#xA;  '(&quot;manni&quot;&#xA;    &quot;igor&quot;&#xA;    &quot;lovelace&quot;&#xA;    &quot;xcode&quot;&#xA;    &quot;vim&quot;&#xA;    &quot;autumn&quot;&#xA;    &quot;vs&quot;&#xA;    &quot;rrt&quot;&#xA;    &quot;native&quot;&#xA;    &quot;perldoc&quot;&#xA;    &quot;borland&quot;&#xA;    &quot;tango&quot;&#xA;    &quot;emacs&quot;&#xA;    &quot;friendly&quot;&#xA;    &quot;monokai&quot;&#xA;    &quot;paraiso-dark&quot;&#xA;    &quot;colorful&quot;&#xA;    &quot;murphy&quot;&#xA;    &quot;bw&quot;&#xA;    &quot;pastie&quot;&#xA;    &quot;algol_nu&quot;&#xA;    &quot;paraiso-light&quot;&#xA;    &quot;trac&quot;&#xA;    &quot;default&quot;&#xA;    &quot;algol&quot;&#xA;    &quot;fruity&quot;)&#xA;  &quot;List of supported styles in package minted.  List was obtained from command 'pygmentize -L styles'.&quot;)&#xA;&#xA;(defun TeX-arg-minted-style (optional &amp;amp;optional prompt)&#xA;  &quot;Prompt for a style with completion and insert is as optional argument.&quot;&#xA;  (TeX-argument-insert&#xA;   (completing-read &quot;Minted color style: &quot; LaTeX-minted-style-list) nil))&#xA;(defvar LaTeX-minted-option-list&#xA;  '(&quot;autogobble&quot;            ; boolean&#xA;    &quot;baselinestretch&quot;           ; dimension&#xA;    &quot;breakafter&quot;            ; string&#xA;    &quot;breakaftergroup&quot;           ; booelan&#xA;    &quot;xleftmargin&quot;           ; dimension&#xA;    &quot;xrightmargin&quot;)         ; dimension&#xA;  &quot;List of options to be given in minted commands and environments.&quot;)&#xA;&#xA;(defun TeX-arg-minted-opts (optional &amp;amp;optional prompt)&#xA;  &quot;Prompt for an option with completion and insert it as an argument.&quot;&#xA;  (TeX-argument-insert&#xA;   (completing-read &quot;Minted Option: &quot; LaTeX-minted-option-list) nil))&#xA;(TeX-add-style-hook&#xA; &quot;minted&quot;&#xA; (lambda ()&#xA;   (TeX-run-style-hooks&#xA;    &quot;keyval&quot; &quot;kvoptions&quot; &quot;fancyvrb&quot; &quot;float&quot;&#xA;    &quot;ifthen&quot; &quot;calc&quot; &quot;shellesc&quot; &quot;ifplatform&quot;&#xA;    &quot;pdftexcmds&quot; &quot;etoolbox&quot; &quot;xstring&quot; &quot;lineno&quot;&#xA;    &quot;framed&quot; &quot;xcolor&quot; &quot;newfloat&quot;)&#xA;   (TeX-add-symbols&#xA;    '(&quot;mint&quot; [ TeX-arg-minted-opts ] TeX-arg-minted-lang)&#xA;    '(&quot;mintinline&quot; [ TeX-arg-minted-opts ] TeX-arg-minted-lang 1)&#xA;    '(&quot;inputminted&quot; [ TeX-arg-minted-opts ] TeX-arg-minted-lang TeX-arg-file-name)&#xA;    '(&quot;usemintedstyle&quot; [TeX-arg-minted-lang] TeX-arg-minted-style)&#xA;    '(&quot;setminted&quot; [TeX-arg-minted-lang] TeX-arg-minted-opts)&#xA;    '(&quot;setmintedinline&quot; [TeX-arg-minted-lang] TeX-arg-minted-opts)&#xA;    &quot;listoflistings&quot;&#xA;    &quot;listingscaption&quot;&#xA;    &quot;listoflistingscaption&quot;&#xA;    &quot;listoflistings&quot;&#xA;    '(&quot;newminted&quot; [&quot;new environment name&quot;] TeX-arg-minted-lang TeX-arg-minted-opts)&#xA;    '(&quot;newmint&quot; [&quot;new macro name&quot;] TeX-arg-minted-lang TeX-arg-minted-opts)&#xA;    '(&quot;newmintinline&quot; [&quot;new macro name&quot;] TeX-arg-minted-lang TeX-arg-minted-opts)&#xA;    '(&quot;newmintedfile&quot; [&quot;new macro name&quot;] TeX-arg-minted-lang TeX-arg-minted-opts))&#xA;   (LaTeX-add-environments&#xA;    &quot;Verbatim&quot; &#xA;    '(&quot;minted&quot; LaTeX-env-minted-lang)&#xA;    &quot;listings&quot;&#xA;    )&#xA;   (LaTeX-add-counters&#xA;    &quot;FancyVerbLineBreakLast&quot;)&#xA;   (LaTeX-add-saveboxes&#xA;    &quot;FV&quot;)))&#xA;;; This is from&#xA;;; https://tex.stackexchange.com/questions/157242/adding-an-option-to-the-pdflatex-call-from-auctex&#xA;(setq LaTeX-command-style '((&quot;&quot; &quot;%(PDF)%(latex) -shell-escape %S%(PDFout)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My file is somewhat longer, as I excluded some of the never ending list of languages and command options.  Despite, this should be a MWE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody give me some hints on how to improve the function &lt;code&gt;TeX-arg-minted-opts&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sure, there will be an &lt;code&gt;alist&lt;/code&gt; involved.  On the one side of the alist, there need to be all allowed options, on the other side, there must be a function, to insert &lt;code&gt;t&lt;/code&gt; or &lt;code&gt;nil&lt;/code&gt; for a boolean, e. g. &lt;code&gt;5pt&lt;/code&gt; for a dimension, ...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The left side of the alist is already present in my file.  The right side is completely missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: meanwhile I found some &lt;code&gt;minted.el&lt;/code&gt; on github.  I will study that.  Just for the learning effect: any answers are still appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to code this?&lt;/p&gt;&#xA;" OwnerUserId="14190" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2016-12-28T12:17:17.620" Title="AUCTeX and package minted" Tags="|auctex|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29618" PostTypeId="1" CreationDate="2016-12-27T19:41:50.657" Score="1" ViewCount="133" Body="&lt;p&gt;I want to schedule a task every day for the next four days from 9:15am to 10:45am. My &lt;code&gt;org&lt;/code&gt; file is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: My Agenda&#xA;&#xA;* Exercise&#xA;** Elliptical Workout&#xA;   &amp;lt;2016-12-28 Wed 09:15-10:45&amp;gt;--&amp;lt;2016-12-31 Sat&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My agenda exports as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Week-agenda (W52):&#xA;Monday     26 December 2016 W52&#xA;Tuesday    27 December 2016&#xA;Wednesday  28 December 2016&#xA;  tasks:       9:15am-10:45am (1/4):  Elliptical Workout&#xA;Thursday   29 December 2016&#xA;  tasks:      (2/4):  Elliptical Workout&#xA;Friday     30 December 2016&#xA;  tasks:      (3/4):  Elliptical Workout&#xA;Saturday   31 December 2016&#xA;  tasks:      (4/4):  Elliptical Workout&#xA;Sunday      1 January 2017&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Only the first date has the &lt;code&gt;9:15am-10:45am&lt;/code&gt; timeframe. Can this be altered?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-12-27T19:41:50.657" Title="Can recurring tasks in org-agenda have a time block?" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29619" PostTypeId="1" CreationDate="2016-12-27T20:33:58.800" Score="2" ViewCount="1052" Body="&lt;p&gt;I have a recurring event that takes place in a specific location:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Title: My Agenda&#xA;&#xA;* Coffee&#xA;** Drink Coffee&#xA;   :PROPERTIES:&#xA;   :LOCATION: Room 237&#xA;   :END:&#xA;   &amp;lt;2017-01-01 Sun 09:00-10:00 +1w&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My agenda, however, ignores the location of my event:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Month-agenda (W52-W05):&#xA;Sunday      1 January 2017&#xA;  tasks:       9:00am-10:00am Drink Coffee&#xA;Monday      2 January 2017 W01&#xA;Tuesday     3 January 2017&#xA;Wednesday   4 January 2017&#xA;Thursday    5 January 2017&#xA;Friday      6 January 2017&#xA;Saturday    7 January 2017&#xA;Sunday      8 January 2017&#xA;  tasks:       9:00am-10:00am Drink Coffee&#xA;Monday      9 January 2017 W02&#xA;Tuesday    10 January 2017&#xA;Wednesday  11 January 2017&#xA;Thursday   12 January 2017&#xA;Friday     13 January 2017&#xA;Saturday   14 January 2017&#xA;Sunday     15 January 2017&#xA;  tasks:       9:00am-10:00am Drink Coffee&#xA;Monday     16 January 2017 W03&#xA;Tuesday    17 January 2017&#xA;Wednesday  18 January 2017&#xA;Thursday   19 January 2017&#xA;Friday     20 January 2017&#xA;Saturday   21 January 2017&#xA;Sunday     22 January 2017&#xA;  tasks:       9:00am-10:00am Drink Coffee&#xA;Monday     23 January 2017 W04&#xA;Tuesday    24 January 2017&#xA;Wednesday  25 January 2017&#xA;Thursday   26 January 2017&#xA;Friday     27 January 2017&#xA;Saturday   28 January 2017&#xA;Sunday     29 January 2017&#xA;  tasks:       9:00am-10:00am Drink Coffee&#xA;Monday     30 January 2017 W05&#xA;Tuesday    31 January 2017&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to view the location of my event in my agenda?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2023-10-03T22:18:42.987" Title="Can properties of events be viewed in org-agenda?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29620" PostTypeId="2" ParentId="26476" CreationDate="2016-12-27T20:45:29.507" Score="4" Body="&lt;p&gt;Specific answer: The default configuration for smartparens should cover this, but perhaps you aren't loading the default config. Make sure that &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smartparens-config)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is in your &lt;code&gt;.emacs.d&lt;/code&gt; instead of just &lt;code&gt;(require 'smartparens)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, to see the delimiters that smartparens is currently tracking, inspect variable &lt;code&gt;sp-pair-list&lt;/code&gt;. You can use the functions &lt;code&gt;sp-pair&lt;/code&gt; and &lt;code&gt;sp-local-pair&lt;/code&gt; to configure it. For example to globally disable autoinsertion of closing single quotes you can write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-pair &quot;'&quot; &quot;'&quot; :actions nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or to disable for specific modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair '(emacs-lisp-mode) &quot;'&quot; &quot;'&quot; :actions nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14364" LastEditorUserId="14364" LastEditDate="2016-12-27T23:32:21.860" LastActivityDate="2016-12-27T23:32:21.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29622" PostTypeId="2" ParentId="29617" CreationDate="2016-12-27T22:03:23.137" Score="1" Body="&lt;p&gt;&lt;strong&gt;Preamble&lt;/strong&gt;: contrary to what you're claiming, a &lt;code&gt;minted.el&lt;/code&gt; is in AUCTeX since December 2014 and is pretty advanced, please base your future work on it.  Maybe you're using an outdated version of AUCTeX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The github repository you linked is my personal mirror of the official AUCTeX repository, as clearly explained in the description to the repository.  See &lt;a href=&quot;https://savannah.gnu.org/git/?group=auctex&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://savannah.gnu.org/git/?group=auctex&lt;/a&gt; for how to access the official repository.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt;: the function &lt;code&gt;TeX-arg-minted-opts&lt;/code&gt; you proposed (which, BTW, should be named &lt;code&gt;LaTeX-arg-minted-opts&lt;/code&gt; for consistency with other functions) is useless as it can be replaced by &lt;code&gt;(TeX-arg-key-val LaTeX-minted-package-options-list)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="620" LastActivityDate="2016-12-27T22:03:23.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29623" PostTypeId="1" AcceptedAnswerId="29626" CreationDate="2016-12-27T22:38:15.627" Score="2" ViewCount="657" Body="&lt;p&gt;I'm working on an agenda file to organize my teaching each semester. I'd like to be able to view my agenda by semester. For example, my fall semester in 2017 will begin during week #2 and will end on week #18. Thus, I'd like to view my agenda starting from &lt;code&gt;Monday 9 January 2017&lt;/code&gt; to &lt;code&gt;Sunday 7 May 2017&lt;/code&gt;. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2016-12-28T02:02:32.063" Title="Can agenda views be customized?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29624" PostTypeId="1" AcceptedAnswerId="30382" CreationDate="2016-12-27T23:59:05.523" Score="3" ViewCount="792" Body="&lt;p&gt;The command &lt;code&gt;#'toggle-frame-fullscreen&lt;/code&gt; does exactly what it says; it &lt;em&gt;toggles&lt;/em&gt; between fullscreen and not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What command can I run to make sure the frame is fullscreen? That is, if not fullscreen, make it fullscreen; if already fullscreen, don't do anything.&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-02-02T05:44:20.187" Title="How do I make sure a frame is fullscreen?" Tags="|frames|fullscreen|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29625" PostTypeId="2" ParentId="29619" CreationDate="2016-12-28T01:50:56.520" Score="1" Body="&lt;p&gt;You can use &lt;a href=&quot;https://orgmode.org/manual/Agenda-Column-View.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;column view&lt;/a&gt; to display any set of properties you like.  Activate column view using &lt;code&gt;C-c C-x C-c&lt;/code&gt; in the agenda and deactivate it using &lt;code&gt;q&lt;/code&gt;.  You can control what columns appear by  setting the &lt;code&gt;COLUMNS&lt;/code&gt; property.  Either at the file level or for a particular subtree (in which case it applies to all its children). You can also set &lt;code&gt;org-agenda-overriding-columns-format&lt;/code&gt; to select the columns for a custom agenda command.&lt;/p&gt;&#xA;&lt;p&gt;In this particular example, to show only the headline and the value of the &lt;code&gt;LOCATION&lt;/code&gt; you can add:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; #+COLUMNS: %25ITEM %LOCATION&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to the top of the file.  Any property can be show and a variety of &lt;a href=&quot;http://orgmode.org/manual/Column-attributes.html#Column-attributes&quot; rel=&quot;nofollow noreferrer&quot;&gt;formatting&lt;/a&gt; options are available.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="17096" LastEditDate="2023-10-03T22:18:42.987" LastActivityDate="2023-10-03T22:18:42.987" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29626" PostTypeId="2" ParentId="29623" CreationDate="2016-12-28T02:02:32.063" Score="3" Body="&lt;p&gt;You can set up custom agendas of various types by using &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;custom commands&lt;/a&gt;.  Basically you add a description of the agenda you want to view and settings for various options to the list &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, you want to set &lt;code&gt;org-agenda-start-day&lt;/code&gt; to &lt;code&gt;&quot;2017-1-9&lt;/code&gt;&quot; and &lt;code&gt;org-agenda-span&lt;/code&gt; to &lt;code&gt;119&lt;/code&gt; (that's 17 weeks * 7 days).  The code for your &lt;code&gt;.emacs&lt;/code&gt; file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;S&quot; &quot;Semester Winter 2017&quot;&#xA;               agenda &quot;&quot;&#xA;               ((org-agenda-start-day &quot;2017-01-09&quot;)&#xA;                (org-agenda-span 119)&#xA;                (org-agenda-overriding-header &quot;Semester Winter 2017&quot;)&#xA;                ))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because a semester is a lot of days, this agenda will take some time to generate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The entries in the list giving the custom command are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A shortcut key using after &lt;code&gt;C-c a&lt;/code&gt; to access the agenda.&lt;/li&gt;&#xA;&lt;li&gt;A description.&lt;/li&gt;&#xA;&lt;li&gt;The type of agenda (&lt;code&gt;agenda&lt;/code&gt; in this case).  &lt;code&gt;agenda&lt;/code&gt;, &lt;code&gt;todo&lt;/code&gt; and &lt;code&gt;tags&lt;/code&gt; are the most useful types.&lt;/li&gt;&#xA;&lt;li&gt;For &lt;code&gt;tags&lt;/code&gt; and &lt;code&gt;todo&lt;/code&gt; types this is the tags or todo items to search for.  For the &lt;code&gt;agenda&lt;/code&gt; type it should be an empty string.&lt;/li&gt;&#xA;&lt;li&gt;A list of pairs &lt;code&gt;(variable value)&lt;/code&gt; giving various settings to customize the agenda.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2016-12-28T02:02:32.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29627" PostTypeId="1" CreationDate="2016-12-28T02:39:23.403" Score="3" ViewCount="88" Body="&lt;p&gt;I want to create new folder then move file that is marked to that folder in emacs dired mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In macOS Finder, you can use the new folder with selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a feature like this in emacs or emacs dired mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 25.1.&lt;/p&gt;&#xA;" OwnerUserId="14064" LastEditorUserId="105" LastEditDate="2016-12-28T05:16:31.297" LastActivityDate="2016-12-28T05:16:31.297" Title="Does Dired have something like &quot;New Folder with Selection&quot; of macOS Finder?" Tags="|dired|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29628" PostTypeId="1" CreationDate="2016-12-28T03:00:23.520" Score="5" ViewCount="580" Body="&lt;p&gt;The geiser documentation suggests that setting &lt;code&gt;geiser-default-implementation&lt;/code&gt; is one way to prevent &lt;code&gt;run-geiser&lt;/code&gt; from prompting for a scheme implementation. Another approach suggested by the geiser docs is to set the &lt;code&gt;geiser-implementations-alist&lt;/code&gt; to the following value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(((regexp &quot;\\.scm\\'&quot;) guile)&#xA; ((regexp &quot;\\.ss\\'&quot;) racket)&#xA; ((regexp &quot;\\.rkt\\'&quot;) racket))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In neither case do the docs give examples of how to set. I've tried various incantations involving &lt;code&gt;setq&lt;/code&gt;, &lt;code&gt;defcustom&lt;/code&gt;, etc., but I continue to be prompted for the desired scheme implementation whenever I run &lt;code&gt;run-geiser&lt;/code&gt;. The alist doesn't even evaluate properly: for one thing, the regexp function seems not to exist; for another, I'm thinking some sort of quoting is needed to prevent errors on the undefined guile/racket symbols. Would be grateful if someone could give an example of exactly what would need to be added (e.g.) to .emacs in both cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would also like to understand why something like...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq geiser-default-implementation 'racket)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...doesn't seem to work.&lt;/p&gt;&#xA;" OwnerUserId="13438" LastEditorUserId="1979" LastEditDate="2020-01-11T22:59:05.007" LastActivityDate="2020-01-11T22:59:05.007" Title="How to make racket the default implementation for geiser mode" Tags="|repl|scheme|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29629" PostTypeId="2" ParentId="29591" CreationDate="2016-12-28T03:18:55.950" Score="3" Body="&lt;p&gt;Assuming you're not using &lt;code&gt;auto-revert-tail-mode&lt;/code&gt;, you might be able to just tell Emacs that if the file is too large, then the buffer is not &quot;stale&quot;.  E.g. something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-not-too-big (&amp;amp;rest _)&#xA;  (or (not buffer-file-name)&#xA;      (let ((size (nth 7 (file-attributes buffer-file-name))))&#xA;        (&amp;lt; size 10000000000))))&#xA;(add-function :after-while buffer-stale-function&#xA;              #'my-not-too-big)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Rather than doing that globally, you could use &lt;code&gt;(add-function :after-while (local buffer-stale-function) #'my-not-too-big)&lt;/code&gt; in a mode hook to only do that in the specific buffers you care about.           &lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2016-12-28T03:18:55.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29630" PostTypeId="2" ParentId="2545" CreationDate="2016-12-28T03:21:07.377" Score="1" Body="&lt;p&gt;With &lt;a href=&quot;https://www.emacswiki.org/emacs/Isearch%2b&quot; rel=&quot;nofollow noreferrer&quot;&gt;Isearch+&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-M-s .+function.+&lt;/code&gt;&lt;/strong&gt;, to search for whole lines that contain &lt;code&gt;function&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-z .&lt;/code&gt;&lt;/strong&gt; followed by a regexp for something you want to look for in the lines that contain &lt;code&gt;function&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(Optional) Repeat #2 with other patterns (regexps) to match in the same line.  The matches can be in any order within the line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of step #1, you can start with &lt;strong&gt;&lt;code&gt;C-M-s .+ C-z . function&lt;/code&gt;&lt;/strong&gt;.  The point is to search for whole lines that contain &lt;code&gt;function&lt;/code&gt; along with any other patterns you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How &lt;strong&gt;&lt;code&gt;C-z .&lt;/code&gt;&lt;/strong&gt; works: It prompts you for an inline pattern to match (e.g. &lt;code&gt;function&lt;/code&gt;).  It wraps that with &lt;code&gt;.*&lt;/code&gt; on each side, to get a full-line pattern (e.g. &lt;code&gt;.*function.*&lt;/code&gt;). It adds a filter predicate that requires that your current search string (&lt;code&gt;.+&lt;/code&gt;) also match that pattern (e.g. &lt;code&gt;.*function.*&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/DynamicIsearchFiltering&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dynamic Isearch Filtering&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-28T03:21:07.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29632" PostTypeId="1" CreationDate="2016-12-28T06:23:17.970" Score="19" ViewCount="7067" Body="&lt;p&gt;Calendar (invoked by &lt;kbd&gt;M-x calendar&lt;/kbd&gt;) has diary integration feature.&#xA;By this, one can view any special date on the calendar buffer (the day will be colored if there is diary entry for that day),&#xA;and view the day's detailed entry by &lt;kbd&gt;d&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since org-mode also has feature of timestamp, integrating it to the calendar, just like the diary entry, would be nice.&#xA;It doesn't necessarily be integration with &lt;code&gt;calendar&lt;/code&gt;, but somthing that enables view of dates as in calendar format and then open the detailed date view from that calendar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: is there such feature?&lt;/p&gt;&#xA;" OwnerUserId="9371" LastActivityDate="2018-05-24T14:55:52.450" Title="Org-mode calendar integration?" Tags="|org-mode|calendar|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29633" PostTypeId="1" CreationDate="2016-12-28T06:53:15.053" Score="1" ViewCount="242" Body="&lt;p&gt;I want this function: assume that I am inside a function, and in line 100, now I want to go to the definition of this function, say 80, and set mark, then go back to 100. So now I have an active region between 80 and 100. I write this function like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-select-fun ()&#xA;  (interactive)&#xA;  (setq myline 'line-number-at-pos ) &#xA;  (beginning-of-defun)&#xA;  (set-mark)&#xA;  (goto-line myline)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it is not working, and I get an error: &lt;code&gt;Wrong number of arguments: (1 . 1), 0&lt;/code&gt;. Sorry for not be familiar with emacs lisp, could someone help me to implement this simple function? Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="14312" LastEditorUserId="25" LastEditDate="2016-12-28T17:43:33.887" LastActivityDate="2016-12-28T17:43:33.887" Title="Set the mark at the beginning of the current function definition" Tags="|debugging|mark|" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29634" PostTypeId="2" ParentId="29633" CreationDate="2016-12-28T07:19:08.733" Score="2" Body="&lt;p&gt;The function set-mark takes an argument, POS, and you didn't supply one.  That's why you're getting the error.&#xA;Have a look at the docs for set-mark (using C-h f set-mark).  You probably want (push-mark (point)) instead.&lt;/p&gt;&#xA;" OwnerUserId="8273" LastActivityDate="2016-12-28T07:19:08.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29636" PostTypeId="1" CreationDate="2016-12-28T08:05:52.173" Score="3" ViewCount="1117" Body="&lt;p&gt;I currently export my org agenda to html by issuing &lt;code&gt;C-x C-w &amp;lt;NAME OF HTML FILE&amp;gt; RET&lt;/code&gt;. I'd like to have a shell script that does this automatically. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="2695" LastActivityDate="2018-07-07T14:49:04.183" Title="Can org agendas be exported to html with a command line script?" Tags="|org-mode|org-export|org-agenda|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29637" PostTypeId="2" ParentId="29633" CreationDate="2016-12-28T08:53:00.627" Score="1" Body="&lt;p&gt;As jeffkowalski mentioned, you have to pass the position as an argument. And I think you can't use &lt;code&gt;set-mark&lt;/code&gt; for this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-select-fun (arg)&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((myline (line-number-at-pos))))&#xA;    (beginning-of-defun)&#xA;    (set-mark-command arg)&#xA;    (goto-line myline)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="10578" LastEditDate="2016-12-28T11:26:40.570" LastActivityDate="2016-12-28T11:26:40.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29638" PostTypeId="1" CreationDate="2016-12-28T10:18:43.747" Score="1" ViewCount="120" Body="&lt;p&gt;I'm using emacs 26.0.50.1 in my spanish laptop and keyboard. Emacs has binding to the ! key for examle&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M-! =&gt; M-x shell-command&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a Spanish keyboard this is impossible (at least for me) to amke with one hand&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I write this to the init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(global-set-key (kbd &quot;M-¡&quot;) 'shell-command)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now i use two hands also but it is better than M-shift-1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In magit there are key binding to !-p, so how can I change ! (shift-1) to ¡, for my emacs globally but still can write !&lt;/p&gt;&#xA;" OwnerUserId="8892" LastActivityDate="2016-12-28T10:18:43.747" Title="Spanish keyboard set ! to ¡" Tags="|key-bindings|keymap|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29639" PostTypeId="2" ParentId="29617" CreationDate="2016-12-28T12:17:17.620" Score="0" Body="&lt;p&gt;@giordano has stated correctly, that my AUCTeX-version is slightly outdated.  I've got version 11.88 from November 2014.  I'll update, I promise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, it was a very good coding lesson for myself.  According to @giordano tip to use &lt;code&gt;TeX-arg-key-val&lt;/code&gt;, I searched for, but couldn't also find that in my version of AUCTeX.  Therefore I changed over to use &lt;code&gt;TeX-read-key-val&lt;/code&gt;, which I have previously used before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my solution, to insert &lt;code&gt;minted&lt;/code&gt;-commands or environments and asking in the minibuffer the list of possible options with key=value and completion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my complete function, with all possible options.  It still could be polished even more :-)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun TeX-arg-minted-opts (optional &amp;amp;optional prompt)&#xA;  &quot;Prompt for an option with completion and insert it as an argument.&quot;&#xA;  (TeX-argument-insert&#xA;   (TeX-read-key-val&#xA;    optional&#xA;    '((&quot;autogobble&quot; (&quot;true&quot; &quot;false&quot;))          ; boolean&#xA;      (&quot;baselinestretch&quot; (&quot;1.5pt&quot;))        ; dimension&#xA;      (&quot;breakafter&quot; (&quot;string&quot;))            ; string&#xA;      (&quot;breakaftergroup&quot; (&quot;true&quot; &quot;false&quot;))     ; booelan&#xA;      (&quot;breakaftersymbolpre&quot; (&quot;string&quot;))       ; string&#xA;      (&quot;breakaftersymbolpost&quot; (&quot;string&quot;))      ; string&#xA;     (&quot;breakanywhere&quot; (&quot;true&quot; &quot;false&quot;))        ; boolean&#xA;     (&quot;breakanywheresymbolpre&quot; (&quot;string&quot;))     ; string&#xA;     (&quot;breakanywheresymbolpost&quot; (&quot;string&quot;))    ; string&#xA;     (&quot;breakautoindent&quot; (&quot;true&quot; &quot;false&quot;))      ; boolean&#xA;     (&quot;breakbefore&quot; (&quot;string&quot;))            ; string&#xA;     (&quot;breakbeforegroup&quot; (&quot;true&quot; &quot;false&quot;))     ; boolean&#xA;     (&quot;breakbeforesymbolpre&quot; (&quot;string&quot;))       ; string&#xA;     (&quot;breakbeforesymbolpost&quot; (&quot;string&quot;))      ; string&#xA;     (&quot;breakbytoken&quot; (&quot;true&quot; &quot;false&quot;))         ; boolean&#xA;     (&quot;breakbytokenanywhere&quot; (&quot;true&quot; &quot;false&quot;)) ; boolean&#xA;     (&quot;breakindent&quot; (&quot;1.5pt&quot;))             ; dimension&#xA;     (&quot;breaklines&quot; (&quot;true&quot; &quot;false&quot;))           ; boolean&#xA;     (&quot;breaksymbol&quot; (&quot;string&quot;))            ; string&#xA;     (&quot;breaksymbolright&quot; (&quot;string&quot;))           ; string&#xA;     (&quot;breaksymbolindent&quot; (&quot;1.5pt&quot;))           ; dimension&#xA;     (&quot;breaksymbolindentleft&quot; (&quot;1.5pt&quot;))       ; dimension&#xA;     (&quot;breaksymbolindentright&quot; (&quot;1.5pt&quot;))      ; dimension&#xA;     (&quot;breaksymbolsep&quot; (&quot;1.5pt&quot;))          ; dimension&#xA;     (&quot;breaksymbolsepleft&quot; (&quot;1.5pt&quot;))          ; dimension&#xA;     (&quot;breaksymbolsepright&quot; (&quot;1.5pt&quot;))         ; dimension&#xA;     (&quot;bgcolor&quot; (&quot;string&quot;))            ; string&#xA;     (&quot;codetagify&quot; (&quot;list of strings&quot;))        ; list of strings&#xA;     (&quot;curlyquotes&quot; (&quot;true&quot; &quot;false&quot;))          ; boolean&#xA;     (&quot;encoding&quot; (&quot;string&quot;))               ; string&#xA;     (&quot;escapeinside&quot; (&quot;string&quot;))           ; string&#xA;     (&quot;firstline&quot; (&quot;5&quot;))               ; integer&#xA;     (&quot;firstnumber&quot; (&quot;5&quot;))             ; integer&#xA;     (&quot;fontfamily&quot; (&quot;string&quot;))             ; string&#xA;     (&quot;fontseries&quot; (&quot;string&quot;))             ; string&#xA;     (&quot;fontsize&quot; (&quot;string&quot;))               ; string&#xA;     (&quot;fontshape&quot; (&quot;string&quot;))              ; string&#xA;     (&quot;Formatcom&quot; (&quot;\cmd&quot;))            ; macro&#xA;     (&quot;frame&quot;)                     ;&#xA;     (&quot;framerule&quot;)                 ;&#xA;     (&quot;framesep&quot; (&quot;1.5pt&quot;))            ; dimension&#xA;     (&quot;funcnamehighlighting&quot; (&quot;true&quot; &quot;false&quot;)) ; boolean&#xA;     (&quot;gobble&quot; (&quot;5&quot;))                  ; integer&#xA;     (&quot;highlightcolor&quot; (&quot;string&quot;))         ; string&#xA;     (&quot;highlightcolor&quot; (&quot;string&quot;))         ; string&#xA;     (&quot;keywordcase&quot; (&quot;string&quot;))            ; string&#xA;     (&quot;label&quot; (&quot;string&quot;))              ; string&#xA;     (&quot;labelposition&quot;)                 ;&#xA;     (&quot;lastline&quot; (&quot;5&quot;))                ; integer&#xA;     (&quot;linenos&quot; (&quot;true&quot; &quot;false&quot;))          ; boolean&#xA;     (&quot;numberfirstline&quot; (&quot;true&quot; &quot;false&quot;))      ; boolena&#xA;     (&quot;numbers&quot;)                   ; &#xA;     (&quot;mathescape&quot; (&quot;true&quot; &quot;false&quot;))           ; boolean&#xA;     (&quot;numberblanklines&quot; (&quot;true&quot; &quot;false&quot;))     ; boolean&#xA;     (&quot;numbersep&quot; (&quot;1.5pt&quot;))               ; dimension&#xA;     (&quot;obeytabs&quot; (&quot;true&quot; &quot;false&quot;))         ; boolean&#xA;     (&quot;outencoding&quot; (&quot;string&quot;))            ; string&#xA;     (&quot;python3&quot; (&quot;true&quot; &quot;false&quot;))          ; boolean&#xA;     (&quot;resetmargins&quot; (&quot;true&quot; &quot;false&quot;))         ; boolean&#xA;     (&quot;rulecolor&quot; (&quot;color-cmd&quot;))           ; color command&#xA;     (&quot;samepage&quot; (&quot;true&quot; &quot;false&quot;))         ; booelan&#xA;     (&quot;showspaces&quot; (&quot;true&quot; &quot;false&quot;))           ; boolean&#xA;     (&quot;showtabs&quot; (&quot;true&quot; &quot;false&quot;))         ; boolean&#xA;     (&quot;space&quot; (&quot;\cmd&quot;))                ; macro&#xA;     (&quot;spacecolor&quot; (&quot;string&quot;))             ; string&#xA;     (&quot;startinline&quot; (&quot;true&quot; &quot;false&quot;))          ; boolean&#xA;     (&quot;style&quot; (&quot;string&quot;))              ; string&#xA;     (&quot;stepnumber&quot; (&quot;5&quot;))              ; integer&#xA;     (&quot;stepnumberfromfirst&quot; (&quot;true&quot; &quot;false&quot;))  ; boolean&#xA;     (&quot;stepnumberoffsetvalues&quot; (&quot;true&quot; &quot;false&quot;)) ; boolean&#xA;     (&quot;stripall&quot; (&quot;true&quot; &quot;false&quot;))         ; boolean&#xA;     (&quot;stripnl&quot; (&quot;true&quot; &quot;false&quot;))          ; boolean&#xA;     (&quot;tab&quot; (&quot;\cmd&quot;))                  ; macro&#xA;     (&quot;tabcolor&quot; (&quot;string&quot;))               ; string&#xA;     (&quot;tabsize&quot; (&quot;5&quot;))                 ; integer&#xA;     (&quot;texcl&quot; (&quot;true&quot; &quot;false&quot;))            ; boolean&#xA;     (&quot;texcomments&quot; (&quot;true&quot; &quot;false&quot;))          ; boolean&#xA;     (&quot;xleftmargin&quot; (&quot;1.5pt&quot;))             ; dimension&#xA;     (&quot;xrightmargin&quot; (&quot;1.5pt&quot;))            ; dimension&#xA;      )&#xA;    ) optional prompt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14190" LastActivityDate="2016-12-28T12:17:17.620" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29640" PostTypeId="1" AcceptedAnswerId="29641" CreationDate="2016-12-28T12:57:39.840" Score="13" ViewCount="2965" Body="&lt;p&gt;I wanted to get rid if the red boxes in TOC that we obtain when exporting org to pdf. The red boxes looks absolutely ugly and spoil the appearance of the entire document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/76V2J.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/76V2J.png&quot; alt=&quot;ugly red boxes around toc links&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6864" LastEditorUserId="6864" LastEditDate="2016-12-28T13:26:14.370" LastActivityDate="2017-01-27T18:23:09.767" Title="How do I get rid of the red boxes around the links in the TOC?" Tags="|org-export|pdf|" AnswerCount="1" CommentCount="2" ClosedDate="2016-12-30T14:40:47.990" ContentLicense="CC BY-SA 3.0" />
  <row Id="29641" PostTypeId="2" ParentId="29640" CreationDate="2016-12-28T13:21:10.817" Score="18" Body="&lt;p&gt;Following the links given &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2012-04/msg01167.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, you can get rid of the ugly red boxes by adding the following line in the beginning of your org file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+latex_header: \hypersetup{colorlinks=true}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EranB.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EranB.png&quot; alt=&quot;Red&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If red isn't your color, then add the following line:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+latex_header: \hypersetup{colorlinks=true,linkcolor=blue}&lt;/code&gt; for a blue color.&lt;/p&gt;&#xA;" OwnerUserId="6864" LastEditorUserId="6864" LastEditDate="2017-01-27T18:23:09.767" LastActivityDate="2017-01-27T18:23:09.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29643" PostTypeId="1" CreationDate="2016-12-28T14:59:05.333" Score="1" ViewCount="888" Body="&lt;p&gt;Every time I open emacs I run the following set of commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-X&#xA;load-theme&#xA;danneskjold&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wanted to set things up so this happens &lt;em&gt;automatically&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put the following things ~/emacs.d/init.el file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-initialize)&#xA;(load-theme 'danneskjold t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading ...init.el&#xA;&#xA;Symbol's function definition is void: package-initialize&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also tried the following in init.el file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-theme 'danneskjold t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Get a different error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong number of arguments: #[(theme) ^H\211^X   &amp;gt;)\203^_^@\304^H!\210\305^H\306\307#\210\305^H\310\307#\210\305^H\311\307#\210\312!\203+^@^KB\202,^@^K^[\313\314\315^H!!!)\207&#xA;[theme custom-known-themes custom-theme-directory load-path disable-theme put theme-settings nil theme-feature theme-documentation file-directory-p load symbol-name custom-make-theme-feature] 5 1722891 SCustom theme name: ], 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not really sure what all the symbols are supposed to mean, is there something else going wrong with my emacs?&lt;/p&gt;&#xA;" OwnerUserId="14348" LastActivityDate="2016-12-28T14:59:05.333" Title="Running an M-X command automatically" Tags="|themes|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29645" PostTypeId="2" ParentId="29633" CreationDate="2016-12-28T16:29:25.193" Score="1" Body="&lt;p&gt;I solved this problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-select-fun ()&#xA;  (interactive)&#xA;  (setq myline (line-number-at-pos))&#xA;  (beginning-of-defun)&#xA;  (set-mark (point))&#xA;  (goto-line myline)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to other answers though.&lt;/p&gt;&#xA;" OwnerUserId="14312" LastActivityDate="2016-12-28T16:29:25.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29646" PostTypeId="2" ParentId="29633" CreationDate="2016-12-28T16:30:30.613" Score="0" Body="&lt;p&gt;It sounds like all you really want is to &lt;em&gt;select the defun that is around point&lt;/em&gt;. &lt;code&gt;C-M-h&lt;/code&gt; (command &lt;code&gt;mark-defun&lt;/code&gt;) does that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to return to the original position then just write a command that binds a variable to &lt;code&gt;(point)&lt;/code&gt; at the outset, then calls &lt;code&gt;mark-defun&lt;/code&gt;, then uses &lt;code&gt;goto-char&lt;/code&gt; to return to the position saved in that variable.  To prevent the region from becoming deactivated after using your command, end it with &lt;code&gt;(setq deactivate-mark  nil)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-28T16:30:30.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29647" PostTypeId="1" AcceptedAnswerId="29648" CreationDate="2016-12-28T16:51:12.710" Score="4" ViewCount="67" Body="&lt;p&gt;There is a key on my keyboard which I do &lt;em&gt;not&lt;/em&gt; want to do anything. By default when I press it I get a message in my mini-buffer reading &lt;code&gt;&amp;lt;cancel&amp;gt; is not defined&lt;/code&gt;. I want to silence that message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I successfully achieved that with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;&amp;lt;cancel&amp;gt;&quot;) (lambda () (interactive)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But wanted to know if there is a more semantic way of achieving this.&lt;/p&gt;&#xA;" OwnerUserId="14344" LastEditorUserId="1979" LastEditDate="2016-12-28T17:58:10.550" LastActivityDate="2016-12-28T17:58:10.550" Title="Silence `&lt;key&gt; is not defined` notification" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29648" PostTypeId="2" ParentId="29647" CreationDate="2016-12-28T17:50:14.207" Score="10" Body="&lt;p&gt;You can bind it to the function &lt;code&gt;ignore&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;cancel&amp;gt;&quot;) #'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="897" LastActivityDate="2016-12-28T17:50:14.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29649" PostTypeId="1" CreationDate="2016-12-28T18:42:06.007" Score="1" ViewCount="1157" Body="&lt;p&gt;I am using emacs 24.5 and I ran into a problem with file local variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working on a git project where file local variables are set like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/* -*- Mode:C++; c-file-style:&quot;gnu&quot;; indent-tabs-mode:nil; -*- */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, they seem to be using unindented namespaces.&#xA;But when I indent the whole buffer I also get namespaces indented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the desired default behaviour? How can I override the namespace indendation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the answer mentioned here:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/2619853/emacs-override-indentation&quot;&gt;https://stackoverflow.com/questions/2619853/emacs-override-indentation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I want to do this only for the current project, thus I tried to put it in a .dir-locals.el file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((cc-mode (eval add-hook 'c++-mode-hook  (lambda() (c-set-offset innamespace [0])))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ((cc-mode . (c-offsets-alist . ((innamespace . [0])))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried changing the style in my dir-locals.el, but none of them seem to override the file local setting. Is this a priority issue of file local variables?&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="253" LastEditDate="2017-07-27T15:59:31.717" LastActivityDate="2017-12-24T18:53:07.727" Title="emacs indentation style in file local variables" Tags="|indentation|file-local-variables|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29650" PostTypeId="1" AcceptedAnswerId="29653" CreationDate="2016-12-28T19:40:31.567" Score="3" ViewCount="1387" Body="&lt;p&gt;I use Spacemacs, and I often use &lt;code&gt;SPC b b&lt;/code&gt; to list buffers so that I can kill the buffers I no longer want. Unfortunately, this process takes a while because I have to repeatedly press &lt;code&gt;SPC b b&lt;/code&gt;, navigate to a buffer I want to kill, open it, and then hit &lt;code&gt;SPC b d&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was looking for something that allows me to open up a list of buffers, in a new buffer, and quickly navigate through them and delete them easily. Kind of like Dired (in Evil mode), which allows you to use &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; to navigate through the list of files and &lt;code&gt;D&lt;/code&gt; to delete a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does something like this currently exist in Spacemacs, or in some well-known package?&lt;/p&gt;&#xA;" OwnerUserId="13650" LastActivityDate="2016-12-29T01:00:59.073" Title="Dired-like browser for buffers?" Tags="|spacemacs|buffers|kill-buffer|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29651" PostTypeId="2" ParentId="29650" CreationDate="2016-12-28T19:55:49.863" Score="0" Body="&lt;p&gt;From HELM Mini (&lt;code&gt;SPC b b&lt;/code&gt;), you can do &lt;code&gt;C-c d&lt;/code&gt; to kill a buffer without exiting HELM Mini.&lt;/p&gt;&#xA;" OwnerUserId="13650" LastActivityDate="2016-12-28T19:55:49.863" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29653" PostTypeId="2" ParentId="29650" CreationDate="2016-12-28T20:24:50.163" Score="8" Body="&lt;p&gt;What you want is built-in to emacs. Put &lt;code&gt;(require 'ibuffer)&lt;/code&gt; in your config file, then bind a key to 'ibuffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-x\C-b&quot; 'ibuffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Be sure to check out its help documentation. It has a lot of features. &lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2016-12-28T20:24:50.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29654" PostTypeId="1" AcceptedAnswerId="29705" CreationDate="2016-12-28T20:58:13.793" Score="0" ViewCount="263" Body="&lt;p&gt;When using ECB, the lines for function names are often long and get cut-off in the sidebar:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/27FcP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/27FcP.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to show the full line that the cursor is at in the mini buffer when it is cut off due to its window not being wide enough?&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="105" LastEditDate="2016-12-29T00:51:06.427" LastActivityDate="2016-12-31T11:51:13.907" Title="Show cut-off line in mini buffer?" Tags="|mode-line|echo-area|wrapping|ecb|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29655" PostTypeId="1" AcceptedAnswerId="29660" CreationDate="2016-12-28T21:26:55.453" Score="1" ViewCount="256" Body="&lt;p&gt;I have two frames opened in emacs (one in each monitor, but this is irrelevant). I would like to have a lisp function to switch the buffer in the other frame (in the other monitor), whose focus is in an arbitrary buffer. The buffer I want to switch to in the other frame has a process (say Python) that is already running. When doing this, I want to keep the final focus in the current frame and buffer I ran the lisp function. Only now the other frame will show the buffer with the process. How could I have a lisp function to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edited: I ended up doing this, but maybe there is a better way&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun go-to-python-buffer ()&#xA;  &quot;Create or visit a Python buffer.&quot;&#xA;  (interactive)&#xA;  (if (null (process-live-p (get-process &quot;Python&quot;))) ; (note that this line is different for python b/c get-process return different types in that case)&#xA;      (progn&#xA;        (split-window-sensibly (selected-window))&#xA;        (other-window 1)&#xA;        (run-python))&#xA;    (progn&#xA;      (split-window-sensibly (selected-window))&#xA;      (switch-to-buffer (process-buffer (get-process &quot;Python&quot;)))&#xA;      (other-window -1)) ) )&#xA;&#xA;(defun go-to-python-frame ()&#xA;  &quot;Create or visit a Python buffer in another frame.&quot;&#xA;  (interactive)&#xA;  ;; check if there is a python process already open, if not, start one&#xA;  (if (not (stringp (get-process &quot;Python&quot;))) ; (note that this line is different for R b/c get-process return different types in that case)&#xA;      (run-python))&#xA;  (if (= (list-length (frame-list)) 1)&#xA;      ;; if there is just one frame, create another, put the focus, and show the buffer with the python process&#xA;      (progn&#xA;        (switch-to-buffer-other-frame (process-buffer (get-process &quot;Python&quot;)))&#xA;        (other-window-or-frame -1))&#xA;    (progn&#xA;      ;; if there is another frame already open, show the python buffer, and keep the focus&#xA;      (select-frame (next-frame))&#xA;      (switch-to-buffer (process-buffer (get-process &quot;Python&quot;)) )&#xA;      (other-window-or-frame -1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4052" LastEditorUserId="4052" LastEditDate="2016-12-29T23:14:01.607" LastActivityDate="2016-12-30T00:09:29.627" Title="How to show process in another already opened frame?" Tags="|buffers|frames|process|focus|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29656" PostTypeId="1" CreationDate="2016-12-28T23:18:47.430" Score="-1" ViewCount="129" Body="&lt;p&gt;I am trying to build a URL from several components, format function seems to do what I want. However, it prints the url instead of assigning it to a variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do in Emacs equivalent of (format nil &quot;String&quot;) from Common Lisp.&lt;/p&gt;&#xA;" OwnerUserId="8952" LastActivityDate="2016-12-28T23:47:43.267" Title="I want to make format out its result to a variable instead of printing it" Tags="|formatting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29657" PostTypeId="2" ParentId="29656" CreationDate="2016-12-28T23:47:43.267" Score="6" Body="&lt;p&gt;&lt;code&gt;#'format&lt;/code&gt; actually returns the formatted value; it doesn't print it out. However, many ways of evaluating code &lt;em&gt;do&lt;/em&gt; print the returned value -- e.g., &lt;code&gt;#'eval-last-sexp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some code (run in ielm) that saves the result to a variable, then checks that variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (setq myvar (format &quot;some %s here&quot; &quot;text&quot;))&#xA;&quot;some text here&quot;&#xA;ELISP&amp;gt; myvar&#xA;&quot;some text here&quot;&#xA;ELISP&amp;gt; (string-equal myvar &quot;some text here&quot;)&#xA;t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2016-12-28T23:47:43.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29658" PostTypeId="2" ParentId="14331" CreationDate="2016-12-29T00:39:53.970" Score="1" Body="&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/dash -e&#xA;if [ &quot;${1#/}&quot; != &quot;$1&quot; ]&#xA;then k=$(cygpath -w &quot;$1&quot;)&#xA;elif [ &quot;$#&quot; != 0 ]&#xA;then k=$1&#xA;fi&#xA;exec emacsclient ${k+&quot;$k&quot;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If no path, pass no path&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If path is empty, pass empty path&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If path is relative, pass as is&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If path is absolute, convert to Windows format&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then I set these variables:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;export EDITOR=emacsclient.sh&#xA;export GIT_EDITOR='dash /usr/local/bin/emacsclient.sh'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;EDITOR allows script to work with Git&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;GIT_EDITOR allows script to work with &lt;a href=&quot;//hub.github.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hub commands&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;//github.com/svnpenn/dotfiles/tree/6a614d4/notepad2&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14343" LastEditorUserId="14343" LastEditDate="2017-04-13T00:11:35.563" LastActivityDate="2017-04-13T00:11:35.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29659" PostTypeId="2" ParentId="29650" CreationDate="2016-12-29T01:00:59.073" Score="2" Body="&lt;p&gt;As mentioned, Ibuffer (&lt;code&gt;ibuffer&lt;/code&gt;) and Buffer Menu (&lt;code&gt;buffer-menu&lt;/code&gt;) are the closest to a Dired-like interface.  But you can also list and act on multiple buffers using just completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt;, commands that show you buffer names for completion let you use &lt;strong&gt;&lt;code&gt;S-&amp;lt;delete&amp;gt;&lt;/code&gt;&lt;/strong&gt; on any number of them to kill those buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, &lt;strong&gt;&lt;code&gt;C-x k&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;icicle-kill-buffer&lt;/code&gt;, in Icicle mode) lets you kill any number of buffers during the same command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Buffer-Name_Input&quot; rel=&quot;nofollow noreferrer&quot;&gt;Buffer-Name Input&lt;/a&gt; for more about buffer-name completion&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Multi-Commands&quot; rel=&quot;nofollow noreferrer&quot;&gt;Multi-Commands&lt;/a&gt; for info about acting on multiple completion candidates during the same command&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-29T01:00:59.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29660" PostTypeId="2" ParentId="29655" CreationDate="2016-12-29T01:13:43.850" Score="1" Body="&lt;p&gt;Start from &lt;code&gt;emacs -q&lt;/code&gt;, switch to the &lt;code&gt;*scratch*&lt;/code&gt; buffer, copy and paste the example below to the &lt;code&gt;*scratch*&lt;/code&gt; buffer, place the cursor immediately following the last closing parenthesis, and press:  &lt;code&gt;C-x C-e&lt;/code&gt; (aka &lt;code&gt;eval-last-sexp&lt;/code&gt;).  Then type &lt;code&gt;M-x my-example&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;STEP BY STEP&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Step #1:  Create or retrieve the process buffer (in this example we use &lt;code&gt;run-python&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;[The default behavior when &lt;code&gt;run-python&lt;/code&gt; is executed is to display the process buffer in another window on the existing frame.  This example does not seek to alter the default behavior -- e.g., we are not deleting windows; we are not seeking to prevent windows from being split.]&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #2:  Make a new frame named &lt;strong&gt;MISCELLANEOUS&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #3:  Make a new frame named &lt;strong&gt;PROCESSES&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #4:  Cycle through all existing frames looking for the frame named &lt;strong&gt;PROCESSES&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #5:  Display the process buffer in the largest window on the frame named &lt;strong&gt;PROCESSES&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #6:  Select the original frame where the user was just before starting this example.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #7:  Sit for just three (3) seconds and quickly observe what happened.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #8:  Clean up the example by deleting the frame named &lt;strong&gt;MISCELLANEOUS&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #9:  Clean up the example by deleting the frame named &lt;strong&gt;PROCESSES&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step #10:  Display a message thanking the user for trying out this example.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my-example ()&#xA;&quot;Example for @Diogo.&quot;&#xA;(interactive)&#xA;  (let ((python-buffer&#xA;          (progn&#xA;            (require 'python)&#xA;            (or (python-shell-get-buffer)&#xA;                (process-buffer (run-python)))))&#xA;        (original-frame (selected-frame))&#xA;        (a (make-frame '((name . &quot;MISCELLANEOUS&quot;)&#xA;                         (height . 20)&#xA;                         (width . 80)&#xA;                         (top . 0)&#xA;                         (left . 625))))&#xA;        (b (make-frame '((name . &quot;PROCESSES&quot;)&#xA;                         (height . 20)&#xA;                         (width . 80)&#xA;                         (top . 400)&#xA;                         (left . 625))))&#xA;        (frame-list (frame-list)))&#xA;    (catch 'break&#xA;      (mapc&#xA;        (lambda (frame)&#xA;          (let ((frame-name&#xA;                  (cdr (assq 'name (frame-parameters frame)))))&#xA;            (when (and python-buffer (equal frame-name &quot;PROCESSES&quot;))&#xA;              (throw 'break (progn&#xA;                (with-selected-frame frame&#xA;                   (unless (get-buffer-window python-buffer)&#xA;                    (set-window-buffer (get-largest-window) python-buffer))))))))&#xA;        frame-list)&#xA;      ;; Just in case there was an error above, throw a break.&#xA;      (throw 'break nil))&#xA;    (select-frame original-frame 'norecord)&#xA;    (raise-frame original-frame)&#xA;    (sit-for 3)&#xA;    (delete-frame a)&#xA;    (delete-frame b)&#xA;    (message &quot;Thank you for testing this example.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-30T00:09:29.627" LastActivityDate="2016-12-30T00:09:29.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29661" PostTypeId="1" CreationDate="2016-12-29T06:17:25.700" Score="2" ViewCount="1578" Body="&lt;p&gt;Hello I'm having trouble while trying to use &lt;code&gt;flake8&lt;/code&gt; and &lt;code&gt;flycheck&lt;/code&gt;, I know this probably this isn't a issue with &lt;code&gt;flycheck&lt;/code&gt; per se but I need some guidance about what is happening.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The problem&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;On a python file when I run &lt;code&gt;flycheck-buffer&lt;/code&gt; I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Suspicious state from syntax checker python-flake8: Flycheck checker python-flake8 returned non-zero exit code 1, but its output contained no errors: Traceback (most recent call last):&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/checker.py&quot;, line 501, in run_ast_checks&#xA;    ast = self.processor.build_ast()&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/processor.py&quot;, line 211, in build_ast&#xA;    return compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST)&#xA;UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc3' in position 1850: surrogates not allowed&#xA;&#xA;During handling of the above exception, another exception occurred:&#xA;&#xA;Traceback (most recent call last):&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/bin/flake8&quot;, line 11, in &amp;lt;module&amp;gt;&#xA;    sys.exit(main())&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/main/cli.py&quot;, line 16, in main&#xA;    app.run(argv)&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/main/application.py&quot;, line 322, in run&#xA;    self._run(argv)&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/main/application.py&quot;, line 306, in _run&#xA;    self.run_checks()&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/main/application.py&quot;, line 244, in run_checks&#xA;    self.file_checker_manager.run()&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/checker.py&quot;, line 350, in run&#xA;    self.run_serial()&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/checker.py&quot;, line 334, in run_serial&#xA;    checker.run_checks(self.results_queue, self.statistics_queue)&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/checker.py&quot;, line 606, in run_checks&#xA;    self.run_ast_checks()&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/checker.py&quot;, line 504, in run_ast_checks&#xA;    row, column = self._extract_syntax_information(exception)&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/checker.py&quot;, line 476, in _extract_syntax_information&#xA;    if column &amp;gt; 0 and token and isinstance(exception, SyntaxError):&#xA;TypeError: unorderable types: str() &amp;gt; int()&#xA;&#xA;Try installing a more recent version of python-flake8, and please open a bug report if the issue persists in the latest release.  Thanks!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the pointed position is just a word with an accented character in the document block of a function. But that's not my problem here, because when I run &lt;code&gt;flake8&lt;/code&gt; on the file from my zshell it works just fine.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;What I've tried&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A lot of related issues suggest updating &lt;code&gt;flake8&lt;/code&gt; but as of today I have the most recent version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~ ❯ flake8 --version&#xA;3.2.1 (mccabe: 0.5.3, pycodestyle: 2.2.0, pyflakes: 1.3.0) CPython 3.6.0 on Darwin&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Within emacs using &lt;code&gt;M-: (process-lines &quot;flake8&quot; &quot;--version&quot;)&lt;/code&gt; this is recognized as well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;3.2.1 (pyflakes: 1.3.0, mccabe: 0.5.3, pycodestyle: 2.2.0) CPython 3.5.2 on Darwin&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another similar issues on internet suggest there's something wrong with the environment, and that could be the problem but in this case I'm not so sure since &lt;code&gt;flake8&lt;/code&gt; on emacs works without issues, only flycheck fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the &lt;code&gt;flycheck-verify-setup&lt;/code&gt; output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Syntax checkers for buffer views.py in python-mode:&#xA;&#xA;  python-flake8&#xA;    - may enable:         yes&#xA;    - executable:         Found at /Users/lcl/.pyenv/shims/flake8&#xA;    - configuration file: Not found&#xA;&#xA;  python-pylint&#xA;    - may enable:         yes&#xA;    - executable:         Found at /usr/local/bin/pylint&#xA;    - configuration file: Not found&#xA;&#xA;  python-pycompile&#xA;    - may enable: yes&#xA;    - executable: Found at /Users/lcl/.pyenv/shims/python&#xA;&#xA;The following checker is explicitly selected for this buffer:&#xA;&#xA;  python-flake8&#xA;    - major mode:         `python-mode' supported&#xA;    - may enable:         yes&#xA;    - executable:         Found at /Users/lcl/.pyenv/shims/flake8&#xA;    - configuration file: Not found&#xA;&#xA;Flycheck Mode is enabled.  Use M-x universal-argument C-c ! x to&#xA;enable disabled checkers.&#xA;&#xA;--------------------&#xA;&#xA;Flycheck version: 31snapshot (package: 20161216.1227)&#xA;Emacs version:    25.1.1&#xA;System:           x86_64-apple-darwin16.3.0&#xA;Window system:    mac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can notice that I use &lt;code&gt;pyenv&lt;/code&gt; I have globally installed &lt;code&gt;python 3.6.0&lt;/code&gt; and have a &lt;code&gt;pyenv-virtualenv&lt;/code&gt; with &lt;code&gt;python 3.5.2&lt;/code&gt; activated, I use &lt;code&gt;pyenv-mode&lt;/code&gt; to activate the pyenv virtualenv. This virtualenv is the one who has &lt;code&gt;flake8&lt;/code&gt; installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my &lt;code&gt;flycheck-compile&lt;/code&gt; while using the checker &lt;code&gt;python-flake8&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: compilation; default-directory: &quot;~/Documents/nextgen/devel/ticket.dev/nextgen/users/&quot; -*-&#xA;Compilation started at Thu Dec 29 00:03:12&#xA;&#xA;/Users/lcl/.pyenv/shims/flake8 --format\=default --stdin-display-name /Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py - &amp;lt; /Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py&#xA;Traceback (most recent call last):&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/checker.py&quot;, line 501, in run_ast_checks&#xA;    ast = self.processor.build_ast()&#xA;  File &quot;/Users/lcl/.pyenv/versions/3.5.2/envs/ticket/lib/python3.5/site-packages/flake8/processor.py&quot;, line 211, in build_ast&#xA;    return compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST)&#xA;UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc3' in position 1850: surrogates not allowed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We see the same error as I told you but listen to this, if I run &lt;code&gt;M-x shell&lt;/code&gt; and then copy the same command used by flycheck, it all works fine!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Output in &lt;code&gt;M-x shell&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Users/lcl/.pyenv/shims/flake8 --format=default --stdin-display-name /Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py - &amp;lt; /Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py&#xA;&amp;lt;panel.dev/nextgen/users/views.py - &amp;lt; /Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py&#xA;/Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py:179:5: C901 'UserActions.post' is too complex (19)&#xA;/Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py:327:5: C901 'UserUpdateView.form_valid' is too complex (14)&#xA;/Users/lcl/Documents/nextgen/devel/ticket.dev/nextgen/users/views.py:507:5: C901 'UserCreateView.form_valid' is too complex (15)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I did started to use the &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;exec-path-from-shell&lt;/code&gt;&lt;/a&gt; package but the error is still happening, what could be happening? &lt;strong&gt;Why is &lt;code&gt;flycheck&lt;/code&gt; the only missing the party?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="12340" LastEditorUserId="12340" LastEditDate="2016-12-29T06:22:41.210" LastActivityDate="2017-05-27T16:47:03.043" Title="Flycheck checker python-flake8 returned non-zero exit code 1, but its output contained no errors" Tags="|python|flycheck|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29662" PostTypeId="2" ParentId="29649" CreationDate="2016-12-29T08:21:09.103" Score="1" Body="&lt;p&gt;I figured out a way to do it, i don't know if it is elegant, but it works quite well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I created a new MAJORMODE-local-vars-hook by adding this to my init.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Provide a new MAJORMODE-local-vars-hook&#xA; (add-hook 'hack-local-variables-hook 'run-local-vars-mode-hook)&#xA; (defun run-local-vars-mode-hook ()&#xA;   &quot;Run a hook for the major-mode after the local variables have been processed.&quot;&#xA;   (run-hooks (intern (concat (symbol-name major-mode) &quot;-local-vars-hook&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then i added the c++-mode-local-vars-hook in my dir-locals&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nil . (eval . (add-hook 'c++-mode-local-vars-hook  (lambda () (c-set-offset 'innamespace 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess just adding a c++-mode hook did not do the job because mode hooks execute before local variables are processed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know why the other method failed though.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastActivityDate="2016-12-29T08:21:09.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29664" PostTypeId="1" AcceptedAnswerId="30278" CreationDate="2016-12-29T08:52:59.213" Score="6" ViewCount="706" Body="&lt;p&gt;Most everyone who uses &lt;code&gt;paredit&lt;/code&gt; has used &lt;code&gt;paredit-kill&lt;/code&gt; (i.e., &lt;code&gt;C-k&lt;/code&gt;), which allows one to delete a line forwards whilst keeping delimiters balanced properly. But how does one do this in the reverse direction? When one does &lt;code&gt;C-0 C-k&lt;/code&gt;, &lt;a href=&quot;http://emacsredux.com/blog/2013/04/08/kill-line-backward/&quot; rel=&quot;noreferrer&quot;&gt;which is something that's typically used to kill the line backwards&lt;/a&gt;, &lt;code&gt;paredit-kill&lt;/code&gt; actually calls the built-in &lt;code&gt;kill-line&lt;/code&gt; to handle it. Unfortunately, this loses the delimiter-balancing that is otherwise had with &lt;code&gt;paredit-kill&lt;/code&gt;. Since discovering that &lt;code&gt;C-0 C-k&lt;/code&gt; does not work quite right, I've tried implementing a &lt;code&gt;paredit-backward-kill-line&lt;/code&gt; function that will kill backwards &lt;em&gt;and&lt;/em&gt; balance delimiters a la &lt;code&gt;paredit-kill&lt;/code&gt;. However, I've not had much luck with this and have only come up with an implementation which uses &lt;code&gt;paredit-backward-delete&lt;/code&gt; under certain conditions. This solution has only worked marginally well for me thus far. I've also tried reworking some of &lt;code&gt;paredit&lt;/code&gt;'s functions that relate to killing lines, but it seems that they are all hard-coded to work with forwards deletion. This is making certain functions here significantly difficult to rework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, this seems like a lot of work to get something working that seems like it should be relatively simple, given that &lt;code&gt;paredit&lt;/code&gt; already works as well as it does. So, I guess my question is: is there a way to do a backwards &lt;code&gt;paredit-kill&lt;/code&gt; which retains all the delimiter-balancing functionality that is had from a normal, forwards &lt;code&gt;paredit-kill&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2017-01-02T16:22:47.010" LastActivityDate="2020-12-24T06:50:00.340" Title="How to do paredit-kill backwards?" Tags="|paredit|deletion|kill-text|delimiters|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29665" PostTypeId="1" AcceptedAnswerId="29676" CreationDate="2016-12-29T12:39:58.533" Score="0" ViewCount="107" Body="&lt;p&gt;Id like to use a diff on my repository to quickly navigate changes, without keeping the buffer open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to make a function that runs 'Jump to source', and deletes the diff buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(Am looking to make a key-binding, but expect this will involve writing a function)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2016-12-29T12:52:55.873" LastActivityDate="2017-01-29T22:25:19.177" Title="How to delete a diff buffer, after running 'Jump to source'?" Tags="|diff-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29666" PostTypeId="1" CreationDate="2016-12-29T13:23:45.083" Score="2" ViewCount="149" Body="&lt;p&gt;I came across a problem when I run tsun in an inferior ansi-term (or term, eshell) buffer of emacs(24.4.1) in Debian 8.5. The tsun REPL echos every character while I input as shown in the following picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PQE8Q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PQE8Q.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, the similar issues occur with comint-run, ts-node, etc.&#xA;How should I fix such a mess? &lt;/p&gt;&#xA;" OwnerUserId="14375" LastEditorDisplayName="user8748" LastEditDate="2019-02-03T00:12:34.993" LastActivityDate="2024-02-07T10:07:46.017" Title="tsun in inferior term prompts each character of input" Tags="|repl|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29667" PostTypeId="1" AcceptedAnswerId="29675" CreationDate="2016-12-29T13:39:31.187" Score="3" ViewCount="429" Body="&lt;p&gt;Wanderlust doesn't update the number of new/unread/total mails in the &quot;Folder&quot; view. I have configured it to use my dovecot imap server and I didn't find any way to configure an update interval or even a keybinding or a function to update this information. Currently, the only way is to press &quot;RET&quot; on a folder to update it. With some 30 folders, this is of course not the way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely, there has to be some most simple way to do it, but I'm too dumb to find it :(&lt;/p&gt;&#xA;" OwnerUserId="10128" LastActivityDate="2016-12-29T18:35:42.050" Title="How can I (automatically) check for new mail in Wanderlust?" Tags="|email|wanderlust|imap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29669" PostTypeId="1" CreationDate="2016-12-29T13:50:26.283" Score="1" ViewCount="177" Body="&lt;p&gt;Is there a package/function for shuffling the paragraphs in the buffer? &#xA;(I mean to sort the paragraphs with a random order, not changing the paragraphs, just randomizing their order).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Motivation&lt;/strong&gt;: For learning vocabulary of a foreign language, research shows that it is better to change the order of the words you study. &lt;em&gt;There is such a thing as “serial” learning such that a fixed order becomes itself a trigger in remembering the word.&lt;/em&gt; See &lt;a href=&quot;http://rharriso.sites.truman.edu/vocabulary-and-word-formation/vocabulary-home/tips-on-learning-vocabulary/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://rharriso.sites.truman.edu/vocabulary-and-word-formation/vocabulary-home/tips-on-learning-vocabulary/&lt;/a&gt;. Imagine you have a buffer in which every paragraph contains a word and its meaning. It would be great to change the order of paragraphs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Based on the idea given by Politza, here is a solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun random-sort-paragraphs (reverse beg end)&#xA;  (interactive &quot;P\nr&quot;)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (if (region-active-p) (narrow-to-region beg end))&#xA;      (goto-char (point-min))&#xA;      (sort-subr reverse&#xA;                 (function&#xA;                  (lambda ()&#xA;                    (while (and (not (eobp)) (looking-at paragraph-separate))&#xA;                      (forward-line 1))))&#xA;                 'forward-paragraph nil nil&#xA;                 (lambda (s1 s2) (eq (random 2) 0))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2017-01-01T04:53:15.803" LastActivityDate="2017-01-01T04:53:15.803" Title="shuffling the paragraphs in a buffer" Tags="|sorting|paragraphs|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29670" PostTypeId="1" CreationDate="2016-12-29T13:56:13.857" Score="2" ViewCount="945" Body="&lt;p&gt;Is it possible to have new buffers created by a spesific command (&lt;code&gt;vc-diff&lt;/code&gt; for example) use the same viewable area as the current buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently it creates a split window, which I need to manually close after using the buffer and deleting it.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2016-12-30T00:42:01.070" LastActivityDate="2016-12-30T00:42:01.070" Title="How to prevent some new buffers from splitting the window?" Tags="|window-splitting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29671" PostTypeId="2" ParentId="29670" CreationDate="2016-12-29T14:07:56.227" Score="3" Body="&lt;p&gt;There is a global option to prevent splits from being opened:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq pop-up-windows nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When writing scripts you can locally assign this which won't apply outside the scope of the function, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vc-root-diff-fullscreen ()&#xA;  &quot;Open a diff of the repository in the current frame.&quot;&#xA;  (interactive)&#xA;  (let ((pop-up-windows nil))&#xA;    (vc-root-diff nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2016-12-29T14:28:49.833" LastActivityDate="2016-12-29T14:28:49.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29672" PostTypeId="2" ParentId="29669" CreationDate="2016-12-29T16:33:18.830" Score="2" Body="&lt;p&gt;In a comment, @politza provided the best answer (and hopefully @politza will post it as an answer): use &lt;code&gt;sort-paragraphs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, you can use &lt;strong&gt;&lt;code&gt;transpose-paragraphs&lt;/code&gt;&lt;/strong&gt; to move the previous paragraph down past the next one (or up, with a negative prefix arg).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can repeat &lt;code&gt;transpose-paragraphs&lt;/code&gt; (easiest if bound to a key) to, essentially, drag a paragraph down to a given spot.  Not a replacement for &lt;code&gt;sort-paragraphs&lt;/code&gt;, by any means, but a quick way to interactively make some changes in paragraph order.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-29T16:33:18.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29673" PostTypeId="2" ParentId="29666" CreationDate="2016-12-29T16:39:19.330" Score="0" Body="&lt;p&gt;Sounds like option &lt;strong&gt;&lt;code&gt;echo-keystrokes&lt;/code&gt;&lt;/strong&gt; might be the culprit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try setting it to zero (&lt;code&gt;0&lt;/code&gt;): &lt;code&gt;M-x customize-option echo-keystrokes&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it does not stay off then look for some code that you are using that is the culprit: check your init file, recursively bisecting it to find the part that turns it back on.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-12-30T03:17:13.727" LastActivityDate="2016-12-30T03:17:13.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29675" PostTypeId="2" ParentId="29667" CreationDate="2016-12-29T17:02:44.137" Score="1" Body="&lt;p&gt;Configure &lt;code&gt;wl-biff-check-folder-list&lt;/code&gt; and the function &lt;code&gt;wl&lt;/code&gt; will activate &lt;code&gt;wl-biff-start&lt;/code&gt; when launching Wanderlust.  There are other variables that begin with &lt;code&gt;wl-biff-...&lt;/code&gt; that the original poster may wish to customize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To read where this configuration takes place, type:  &lt;code&gt;M-x find-function RET wl RET&lt;/code&gt; (after the &lt;code&gt;wl&lt;/code&gt; library has been loaded, of course).  The relevant code snippet is:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(when wl-biff-check-folder-list&#xA;  (unless arg (wl-biff-check-folders))&#xA;  (wl-biff-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;NOTE: @lawlist doesn't use this because there were some issues with &lt;code&gt;Blocking call to accept-process-output with quit inhibited!!&lt;/code&gt;. See:  &lt;a href=&quot;https://github.com/wanderlust/wanderlust/issues/38&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/wanderlust/wanderlust/issues/38&lt;/a&gt;  @lawlist also does not keep Wanderlust connected all the time -- after an operation, @lawlist chooses to turn the plug off &lt;code&gt;(wl-toggle-plugged 'off)&lt;/code&gt;. Perhaps the original poster will have better luck with checking email on a timer.  Alternatives include, but are not limited to:  keeping a cell phone with email notification on the desk, and/or put an email notifier in the menu-bar of the OS. :)&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2016-12-29T18:35:42.050" LastActivityDate="2016-12-29T18:35:42.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29676" PostTypeId="2" ParentId="29665" CreationDate="2016-12-29T17:40:45.660" Score="2" Body="&lt;p&gt;Here are 2 functions I came up with that open a fullscreen diff and close it when jumping to the line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Override pop-up-windows&#xA;(defun diff-goto-source-and-close ()&#xA;  &quot;Go to the source and close the current diff buffer.&quot;&#xA;  (interactive)&#xA;  (let ((buf (current-buffer))&#xA;        (pop-up-windows nil))&#xA;    (diff-goto-source)&#xA;    (kill-buffer buf)))&#xA;&#xA;(defun vc-root-diff-fullscreen ()&#xA;  &quot;Open a diff of the repository in the current frame.&quot;&#xA;  (interactive)&#xA;  (let ((pop-up-windows nil))&#xA;    (call-interactively 'vc-root-diff)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;pop-up-windows&lt;/code&gt; needed to be set so the window isn't opened in a split, for both opening the diff and switching to the buffer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;vc-root-diff&lt;/code&gt; is used to get a diff on the entire project (not just the current file).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-01-29T22:25:19.177" LastActivityDate="2017-01-29T22:25:19.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29678" PostTypeId="1" CreationDate="2016-12-29T23:24:29.963" Score="1" ViewCount="78" Body="&lt;p&gt;I am playing with &lt;a href=&quot;https://en.wikipedia.org/wiki/LFE_(programming_language)&quot; rel=&quot;nofollow noreferrer&quot;&gt;LFE language&lt;/a&gt; and I try to improve documentation lookup. Some of my efforts can be seen on &lt;a href=&quot;https://github.com/bigos/Pyrulis/blob/master/Emacs/vendor/lfe-doc-finder.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;my Github repo&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a function &lt;strong&gt;sexp-at-point&lt;/strong&gt; which return a string enclosed by round brackets. That function is used by &lt;strong&gt;helpme&lt;/strong&gt; function, which reads the string converting it to an Elisp list. That in turn, is processed to look up the documentation. The problem is that read sometimes fails on valid LFE syntax. so far I found it fails on vectors&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #(1 2 3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to parse usually short strings into lists. In LFE number of arguments is important and I try to make documentation lookup reflect arity as well. Also, an LFE function can have different forms.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(model:function arg1) (: model function arg1) (function arg1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So using something similar to &lt;code&gt;read&lt;/code&gt; is the best option in my humble opinion. Please correct me if I am wrong. If you agree with my approach please suggest how I could improve it. Is there a parsing library that I could use?&lt;/p&gt;&#xA;" OwnerUserId="8952" LastActivityDate="2016-12-29T23:24:29.963" Title="How do I read and parse other Lisps in Emacs" Tags="|parsing|read|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29679" PostTypeId="1" CreationDate="2016-12-30T01:46:53.673" Score="2" ViewCount="392" Body="&lt;p&gt;I'm trying to set the faces of &lt;a href=&quot;https://github.com/DarthFennec/highlight-indent-guides&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight-indent-guides&lt;/a&gt; automatically whenever a new theme is loaded by making small adjustments to the background color of the default face. I have everything working &lt;a href=&quot;http://ivanmalison.github.io/dotfiles/#highlightindentguides&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, but I've been forced to resort to the following horrible hack:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun imalison:set-highlight-indent-guides-faces-load-theme (&amp;amp;rest args)&#xA;  (if (face-background 'default)&#xA;      (imalison:set-highlight-indent-guides-faces)&#xA;    (run-at-time &quot;1 sec&quot; nil 'imalison:set-highlight-indent-guides-faces-load-theme)))&#xA;&#xA;(advice-add 'load-theme&#xA;            :after 'imalison:set-highlight-indent-guides-faces-load-theme)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason the timer is needed is because &lt;code&gt;(face-background 'default)&lt;/code&gt; is nil immediately after the call to &lt;code&gt;load-theme&lt;/code&gt;, even though it is properly set a few seconds later. As I mention in &lt;a href=&quot;https://github.com/DarthFennec/highlight-indent-guides/issues/9&quot; rel=&quot;nofollow noreferrer&quot;&gt;the issue&lt;/a&gt; that I filed against &lt;a href=&quot;https://github.com/DarthFennec/highlight-indent-guides&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight-indent-guides&lt;/a&gt;, I suspect that &lt;code&gt;load-theme&lt;/code&gt; might rely on a callback somewhere when setting face values, which would explain why the face is not set when the function returns. Does anyone who is more familiar with emacs' theme system know what is going on here? Is there a reason there is &lt;a href=&quot;https://emacs.stackexchange.com/questions/22686/is-there-a-universal-after-theme-load-hook&quot;&gt;no &lt;code&gt;after-load-theme&lt;/code&gt; hook&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2564" LastEditorUserId="105" LastEditDate="2017-08-12T17:41:37.783" LastActivityDate="2017-08-12T17:41:37.783" Title="Faces not set immediately after load-theme" Tags="|hooks|faces|themes|advice|emacs-daemon|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29680" PostTypeId="1" CreationDate="2016-12-30T01:52:21.027" Score="4" ViewCount="344" Body="&lt;p&gt;in org-mode, is there a command to select the entire text in one column in one row? I know i can move to the beginning/set-mark/goto the end of the column. But i am wondering if there is one command already for that. &lt;/p&gt;&#xA;" OwnerUserId="13769" LastEditorUserId="13769" LastEditDate="2017-01-01T08:07:23.200" LastActivityDate="2017-01-01T08:11:23.890" Title="how to select one row of a column of a table in org-mode (i.e. a cell of a table)" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29681" PostTypeId="1" CreationDate="2016-12-30T10:07:31.527" Score="1" ViewCount="569" Body="&lt;p&gt;I am using Emacs 25.1.1 with spacemacs. Everytime I run iESS, I get the warning about locale as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;During startup - Warning messages:&#xA;1: Setting LC_CTYPE failed, using &quot;C&quot; &#xA;2: Setting LC_COLLATE failed, using &quot;C&quot; &#xA;3: Setting LC_TIME failed, using &quot;C&quot; &#xA;4: Setting LC_MESSAGES failed, using &quot;C&quot; &#xA;5: Setting LC_MONETARY failed, using &quot;C&quot; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have tried the solution from followings,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/30264526/why-does-my-ess-r-session-fall-back-to-c-locale&quot;&gt;https://stackoverflow.com/questions/30264526/why-does-my-ess-r-session-fall-back-to-c-locale&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/9689104/installing-r-on-mac-warning-messages-setting-lc-ctype-failed-using-c&quot;&gt;https://stackoverflow.com/questions/9689104/installing-r-on-mac-warning-messages-setting-lc-ctype-failed-using-c&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the problem is still there. The strange this about this problem is that, when I run emacs with &lt;code&gt;-nw&lt;/code&gt; switch (on terminal) I get no error, but when I open it with frame, I get the error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me with this!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My R session info when I run emacs with frame is,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R version 3.3.2 (2016-10-31)&#xA;Platform: x86_64-apple-darwin13.4.0 (64-bit)&#xA;Running under: macOS Sierra 10.12.2&#xA;&#xA;locale:&#xA;[1] C&#xA;&#xA;attached base packages:&#xA;[1] stats     graphics  grDevices utils     datasets  methods   base     &#xA;&#xA;loaded via a namespace (and not attached):&#xA;[1] compiler_3.3.2 tools_3.3.2   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and in terminal without frame is,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R version 3.3.2 (2016-10-31)&#xA;Platform: x86_64-apple-darwin13.4.0 (64-bit)&#xA;Running under: macOS Sierra 10.12.2&#xA;&#xA;locale:&#xA;[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8&#xA;&#xA;attached base packages:&#xA;[1] stats     graphics  grDevices utils     datasets  methods   base     &#xA;&#xA;loaded via a namespace (and not attached):&#xA;[1] compiler_3.3.2 tools_3.3.2   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14241" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-01-10T16:38:04.553" Title="ess R startup warning locale" Tags="|spacemacs|start-up|ess|r|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29683" PostTypeId="2" ParentId="26728" CreationDate="2016-12-30T14:00:46.993" Score="2" Body="&lt;p&gt;I have this in my latex config, but I forget where it come from ...it does (b)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice TeX-LaTeX-sentinel&#xA;    (around mg-TeX-LaTeX-sentinel-open-output activate)&#xA;  &quot;Open output when there are errors.&quot;&#xA;  ;; Run `TeX-LaTeX-sentinel' as usual.&#xA;  ad-do-it&#xA;  ;; Check for the presence of errors.&#xA;  (when&#xA;      (with-current-buffer TeX-command-buffer&#xA;        (plist-get TeX-error-report-switches (intern (TeX-master-file))))&#xA;    ;; If there are errors, open the output buffer.&#xA;    (TeX-recenter-output-buffer nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="8373" LastEditDate="2016-12-30T14:08:39.207" LastActivityDate="2016-12-30T14:08:39.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29684" PostTypeId="1" CreationDate="2016-12-30T14:40:54.170" Score="2" ViewCount="730" Body="&lt;p&gt;Slime (and elisp-slime-nav) uses &lt;code&gt;M-.&lt;/code&gt; to navigate to the symbol at point, and &lt;code&gt;M-,&lt;/code&gt; to pop back to previous marks. I like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evil uses &lt;code&gt;.&lt;/code&gt; to repeat the previous editing command, &lt;code&gt;C-.&lt;/code&gt; to replace a just repeated command with a previously executed command, and &lt;code&gt;M-.&lt;/code&gt; to do the same in the reverse direction (useful if you overshoot with &lt;code&gt;C-.&lt;/code&gt;). I like this as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to use &lt;code&gt;M-.&lt;/code&gt; for slime-style navigation except when the previous command was &lt;code&gt;C-.&lt;/code&gt; (&lt;code&gt;evil-repeat-pop&lt;/code&gt;), in which case I'd like &lt;code&gt;M-.&lt;/code&gt; to run &lt;code&gt;evil-repeat-pop-next&lt;/code&gt;. I'm not sure how to go about implementing this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm considering removing the evil &lt;code&gt;M-.&lt;/code&gt; binding and defining a &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;nofollow noreferrer&quot;&gt;hydra&lt;/a&gt; that's entered upon running &lt;code&gt;evil-repeat-pop&lt;/code&gt; (&lt;code&gt;C-.&lt;/code&gt;) and which binds &lt;code&gt;M-.&lt;/code&gt; to &lt;code&gt;evil-repeat-pop-next&lt;/code&gt; in a transient keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also considered binding &lt;code&gt;M-.&lt;/code&gt; to a wrapper function like,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (eql last-command 'evil-repeat-pop)&#xA;    (evil-repeat-pop-next)&#xA;  (elisp-slime-nav-find-elisp-thing-at-point))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I want the &quot;else&quot; clause to do whatever &lt;code&gt;M-.&lt;/code&gt; would have done if evil wasn't enabled. This might be &lt;code&gt;elisp-slime-nav-find-elisp-thing-at-point&lt;/code&gt;, &lt;code&gt;xref-find-definitions&lt;/code&gt;, &lt;code&gt;ggtags-find-tag-dwim&lt;/code&gt;, etc. depending on what modes and code-tagging approaches I'm using.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="1979" LastEditDate="2020-03-01T21:12:32.523" LastActivityDate="2020-03-01T21:12:32.523" Title="Conditional key binding: Evil vs Slime conflict for &quot;M-.&quot;" Tags="|key-bindings|evil|slime|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29685" PostTypeId="2" ParentId="26164" CreationDate="2016-12-30T15:28:00.937" Score="0" Body="&lt;pre&gt;&lt;code&gt;;;; auto prefix with comment char when create code ref in src block with&#xA;;;; `org-store-link'.&#xA;(advice-add 'org-store-link :before #'comment-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2016-12-30T15:28:00.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29686" PostTypeId="2" ParentId="29684" CreationDate="2016-12-30T15:53:11.097" Score="5" Body="&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I also considered binding M-. to a wrapper function [...] but I want the &quot;else&quot; clause to do whatever M-. would have done if evil wasn't enabled.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could bind it to a conditional binding, the manual explains it for menu items, but it works for key bindings as well, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Extended-Menu-Items.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(elisp) Extended Menu Items&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the extended format binding looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (menu-item ITEM-NAME REAL-BINDING&#xA;     . ITEM-PROPERTY-LIST)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;:filter FILTER-FN&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; This property provides a way to compute the menu item dynamically.&#xA; The property value FILTER-FN should be a function of one argument;&#xA; when it is called, its argument will be REAL-BINDING.  The&#xA; function should return the binding to use instead.&#xA;&#xA; Emacs can call this function at any time that it does redisplay or&#xA; operates on menu data structures, so you should write it so it can&#xA; safely be called at any time.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(see also &lt;a href=&quot;https://stackoverflow.com/a/36684318/319698&quot;&gt;https://stackoverflow.com/a/36684318/319698&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this: (not sure if you would need bind in a different keymap than &lt;code&gt;global-map&lt;/code&gt; since you're using &lt;code&gt;evil&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key global-map (kbd &quot;M-.&quot;)&#xA;  `(menu-item &quot;&quot; evil-repeat-pop :filter&#xA;              ,(lambda (cmd) (if (eq last-command 'evil-repeat-pop) cmd))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The transient keymap approach might make more sense for your case though.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2016-12-30T15:53:11.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29687" PostTypeId="1" CreationDate="2016-12-30T15:57:11.053" Score="-1" ViewCount="248" Body="&lt;p&gt;Does anyone know a package that can make helm faster when selecting &lt;strong&gt;buffer&lt;/strong&gt; (helm-buffer-lists) or &lt;strong&gt;command&lt;/strong&gt; (helm-M-x)?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;add number for helm-buffer-lists (just like&#xA;original &lt;strong&gt;recentf-open-files&lt;/strong&gt; ) ,I can use an alternative number selection for buffers.&lt;/li&gt;&#xA;&lt;li&gt;match commands for helm-M-x like this, &lt;strong&gt;open-config-file&lt;/strong&gt; (as &lt;strong&gt;ocf&lt;/strong&gt;), I think it can be an alternative selection when I type &lt;strong&gt;ocf&lt;/strong&gt;. When select, place these selections at &lt;strong&gt;top&lt;/strong&gt; (I think there are few additions than original matchs)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11595" LastEditorUserId="9995" LastEditDate="2016-12-30T16:41:02.543" LastActivityDate="2017-01-03T11:12:48.223" Title="Make Helm Faster: add number for helm-buffer-lists and select command by first alphas" Tags="|helm|helm-for-files|helm-selection|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29689" PostTypeId="1" AcceptedAnswerId="29690" CreationDate="2016-12-30T16:54:40.347" Score="6" ViewCount="338" Body="&lt;p&gt;In &lt;a href=&quot;https://www.youtube.com/watch?v=B6jfrrwR10k&amp;amp;feature=youtu.be&amp;amp;t=1087&quot; rel=&quot;noreferrer&quot;&gt;this video&lt;/a&gt; (time-linked, only a few seconds) the word &lt;code&gt;function&lt;/code&gt; is displayed as &lt;em&gt;&lt;code&gt;f&lt;/code&gt;&lt;/em&gt;, but can still be edited so the underlying text remains as-is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be done in emacs? (using plugins or built in features).&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2016-12-31T08:16:34.650" LastActivityDate="2017-03-20T16:17:36.323" Title="How to display whole words as a different symbol?" Tags="|display|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29690" PostTypeId="2" ParentId="29689" CreationDate="2016-12-30T17:38:08.997" Score="7" Body="&lt;p&gt;Prettify-symbols-mode comes with emacs; &lt;a href=&quot;http://emacsredux.com/blog/2014/08/25/a-peek-at-emacs-24-dot-4-prettify-symbols-mode/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here's a blog post about it&lt;/a&gt;. You need to add the substitution to &lt;code&gt;prettify-symbols-alist&lt;/code&gt; in whatever mode you want it in. Here's an example for javascript-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'javascript-mode-hook&#xA;        (lambda ()&#xA;          (push '(&quot;function&quot; . ?λ) prettify-symbols-alist)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;prettify-symbols-mode&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid having to set this manually, it can be enabled globally from your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-prettify-symbols-mode t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2418" LastEditDate="2016-12-31T08:44:51.757" LastActivityDate="2016-12-31T08:44:51.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29691" PostTypeId="1" CreationDate="2016-12-30T18:23:57.867" Score="3" ViewCount="132" Body="&lt;p&gt;I have enabled the inclusion of deadlines in the ical export of orgmode by setting the preference &lt;code&gt;org-icalendar-use-deadline '(todo-due event-if-todo)&lt;/code&gt;. How can I exclude an orgmode heading from exporting when it is marked as done? At the moment my calendar is cluttered with completed tasks.&lt;/p&gt;&#xA;" OwnerUserId="14395" LastActivityDate="2016-12-30T18:23:57.867" Title="Exclude completed deadlines from orgmode's ical export" Tags="|org-mode|org-export|ical|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29692" PostTypeId="2" ParentId="7375" CreationDate="2016-12-30T19:59:46.433" Score="5" Body="&lt;p&gt;Emacs provides the function &lt;code&gt;hi-lock-face-buffer&lt;/code&gt; &lt;kbd&gt;M-s h r&lt;/kbd&gt;which highlights a regular expression in the buffer as you type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All we need is a regular expression which matches any number which is not 1 or 2 and is within the cell of a table. Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| *\(-[0-9]+\|[03-9]\|[0-9][0-9]+\) *|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You can recall previous expressions with &lt;kbd&gt;M-n&lt;/kbd&gt; and &lt;kbd&gt;M-p&lt;/kbd&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="14397" LastActivityDate="2016-12-30T19:59:46.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29694" PostTypeId="1" AcceptedAnswerId="29981" CreationDate="2016-12-30T21:43:40.593" Score="0" ViewCount="1780" Body="&lt;p&gt;I recently started using Spacemacs. With the default configuration, everithing works fine, but I would like to change a few configurations to org-mode, so i changed the &lt;code&gt;dotspacemacs/user-config&lt;/code&gt; function to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  (with-eval-after-load 'org&#xA;    (unless (boundp 'org-latex-classes)&#xA;      (setq org-latex-classes nil))&#xA;    (add-to-list 'org-latex-classes&#xA;                 '(&quot;koma-article&quot;&#xA;                   &quot;\\documentclass{scrartcl}&quot;&#xA;                   (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;                   (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;                   (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;)&#xA;                   (&quot;\\paragraph{%s}&quot; . &quot;\\paragraph*{%s}&quot;)&#xA;                   (&quot;\\subparagraph{%s}&quot; . &quot;\\subparagraph*{%s}&quot;)))&#xA;    (org-babel-do-load-languages 'org-babel-load-languages&#xA;                                 '((dot . t)&#xA;                                   (maxima . t)&#xA;                                   (python . t)))&#xA;    (setq org-babel-python-command &quot;python3&quot;)&#xA;    ;; Settings to export code with `minted' instead of `verbatim'.&#xA;    (setq org-export-latex-listings t)&#xA;    (setq org-latex-listings 'minted&#xA;          org-latex-packages-alist '((&quot;&quot; &quot;minted&quot;))&#xA;          org-latex-pdf-process&#xA;          '(&quot;pdflatex -shell-escape -intera&quot;)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that, every time I try to export an org file to LaTeX I receive the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user-error: Unknown LaTeX class ‘article’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is happening? What did I do wrong? How do I fix it?&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2017-01-12T17:54:01.600" LastActivityDate="2017-01-12T20:12:35.237" Title="Spacemacs and org-mode configuration problem" Tags="|org-mode|org-export|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29695" PostTypeId="1" AcceptedAnswerId="29699" CreationDate="2016-12-30T22:18:54.150" Score="5" ViewCount="185" Body="&lt;p&gt;There is an &lt;code&gt;unfill-paragraph&lt;/code&gt; mentioned &lt;a href=&quot;https://emacs.stackexchange.com/questions/2606/opposite-of-fill-paragraph&quot;&gt;here&lt;/a&gt; that does the opposite of &lt;code&gt;fill-paragraph&lt;/code&gt;. I would like to bind the key like the follows. &lt;code&gt;M-q&lt;/code&gt; once to &lt;code&gt;fill-paragraph&lt;/code&gt;. If the cursor does not move, push &lt;code&gt;M-q&lt;/code&gt; again to &lt;code&gt;unfill-paragraph&lt;/code&gt;. What is an elegant way to implement this in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2016-12-31T17:28:27.823" Title="Key mapping: Push `M-q` once for fill-paragraph and twice for unfill-paragraph" Tags="|key-bindings|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29696" PostTypeId="2" ParentId="29695" CreationDate="2016-12-30T22:54:34.197" Score="3" Body="&lt;p&gt;Something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xuhdev/fill-paragraph ()&#xA;  (interactive)&#xA;  (if (eq last-command this-command)&#xA;      (unfill-paragraph)&#xA;    (fill-paragraph)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then binding xuhdev/fill-paragraph to M-q perhaps? I can't say I am  a great fan of the idea, and I am leaving off support for arguments to fill-paragraph...  &lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2016-12-30T22:54:34.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29697" PostTypeId="1" CreationDate="2016-12-30T23:00:52.203" Score="4" ViewCount="2467" Body="&lt;p&gt;As of now, org-mode always adds a &lt;em&gt;\centering&lt;/em&gt; into the Latex export for figures. This makes my figures appear centered. But I want them to be alligned to the left. For tables, some suggested using &lt;em&gt;:center nil&lt;/em&gt;. But there is no such thing for figures. Someone else suggested modifying an elisp variable but I looked and there is no such variable. If I add &lt;em&gt;:float nil&lt;/em&gt; then &lt;em&gt;\centering&lt;/em&gt; is removed but this ignores captions as well. So how can I make Latex export not add \centering before \includegraphics by default? I want to retain captions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I manually edit resulting tex file and remove &lt;em&gt;\centering&lt;/em&gt;, I get my images as intended. But this time caption stays centered, only the image moves.&lt;/p&gt;&#xA;" OwnerUserId="11312" LastEditorUserId="11312" LastEditDate="2016-12-30T23:08:36.480" LastActivityDate="2022-03-30T09:16:27.113" Title="org-mode figures always centered" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29698" PostTypeId="2" ParentId="29697" CreationDate="2016-12-30T23:33:06.517" Score="6" Body="&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt; 8.3 or later, this is controlled by the variable &lt;code&gt;org-latex-images-centered&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When non-nil, images are centered.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The default is &lt;code&gt;t&lt;/code&gt;; you want to set it to &lt;code&gt;nil&lt;/code&gt;.  This can be done either by setting it globally in your Emacs config: &lt;code&gt;(setq org-latex-images-centered nil)&lt;/code&gt; or by using a &lt;code&gt;BIND&lt;/code&gt; option in each org file where you want this setting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BIND: org-latex-images-centered nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the latter case you have to set &lt;code&gt;org-export-allow-bind-keywords&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; in your Emacs config to allow the &lt;code&gt;BIND&lt;/code&gt; keyword to do anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To set this per figure (or table) you can set latex &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot; rel=&quot;noreferrer&quot;&gt;attributes&lt;/a&gt;.  Adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_LATEX: :center nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will suppress the centering for that float only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For tables there is a corresponding variable &lt;code&gt;org-latex-tables-centered&lt;/code&gt; that behaves the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I recommend the &lt;code&gt;BIND&lt;/code&gt; version as it makes the document more portable and reproducible, especially if you have co-authors.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2016-12-31T00:47:29.250" LastActivityDate="2016-12-31T00:47:29.250" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29699" PostTypeId="2" ParentId="29695" CreationDate="2016-12-31T01:01:53.487" Score="5" Body="&lt;p&gt;The answer provided by @icarus does not let you keep toggling back and forth.  If you want that then you also need to set &lt;code&gt;this-command&lt;/code&gt;, so that it alternates.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-fill-paragraph (&amp;amp;optional arg)&#xA;  &quot;Fill or unfill paragraph.  If repeated, alternate.&#xA;A prefix arg for filling means justify (as for `fill-paragraph').&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((fillp  (not (eq last-command 'fill-paragraph))))&#xA;    (apply (setq this-command  (if fillp 'fill-paragraph 'unfill-paragraph))&#xA;           (and fillp  arg  '(full t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2016-12-31T17:28:27.823" LastActivityDate="2016-12-31T17:28:27.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29700" PostTypeId="1" CreationDate="2016-12-31T01:18:51.443" Score="2" ViewCount="83" Body="&lt;p&gt;running org-cycle appears to hang sometimes. I've run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x profiler-start&#xA;&amp;lt;tab&amp;gt; ;; bound to org-cycle&#xA;C-g ;; to cancel apparently-hung command&#xA;M-x profiler-report&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I see that a bunch of time is spent deleting from some cache&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- command-execute                                                5756  75%&#xA; - call-interactively                                            5756  75%&#xA;  - funcall-interactively                                        5694  74%&#xA;   - org-cycle                                                   5684  74%&#xA;    - org-cycle-internal-local                                   5684  74%&#xA;     - org-show-entry                                            5684  74%&#xA;      - org-cycle-hide-drawers                                   5684  74%&#xA;       - org-element-at-point                                    5684  74%&#xA;        - org-element--cache-sync                                5684  74%&#xA;         - org-element--cache-process-request                    4206  55%&#xA;          - avl-tree-delete                                      3756  49%&#xA;           - avl-tree--do-delete                                 3627  47%&#xA;            - avl-tree--do-delete                                3244  42%&#xA;             - avl-tree--do-delete                               2830  37%&#xA;              - avl-tree--do-delete                              2203  28%&#xA;               - avl-tree--do-delete                             1607  21%&#xA;                - avl-tree--do-delete                            1217  15%&#xA;                 - avl-tree--do-delete                            674   8%&#xA;                  - avl-tree--do-delete                           326   4%&#xA;                     org-element--cache-compare                    83   1%&#xA;                     avl-tree--do-delete                           16   0%&#xA;                    org-element--cache-compare                     67   0%&#xA;                   org-element--cache-compare                     127   1%&#xA;                  org-element--cache-compare                       76   0%&#xA;                 org-element--cache-compare                       151   1%&#xA;                org-element--cache-compare                        159   2%&#xA;               org-element--cache-compare                          61   0%&#xA;              org-element--cache-compare                           85   1%&#xA;   + execute-extended-command                                      10   0%&#xA;  + byte-code                                                      62   0%&#xA;+ ...                                                            1887  24%&#xA;+ eldoc-schedule-timer                                              1   0%&#xA;+ timer-event-handler                                               1   0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;how can I dig into this further?&lt;/p&gt;&#xA;" OwnerUserId="9459" LastEditorUserId="105" LastEditDate="2016-12-31T05:26:07.570" LastActivityDate="2016-12-31T05:26:07.570" Title="how can I debug or fix slowness in org-cycle?" Tags="|org-mode|debugging|performance|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29701" PostTypeId="1" AcceptedAnswerId="29800" CreationDate="2016-12-31T06:53:24.080" Score="3" ViewCount="156" Body="&lt;p&gt;&lt;strong&gt;START WITH&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((my-list '((12 1 2016)&#xA;                 (12 2 2016)&#xA;                 (12 3 2016)&#xA;                 (12 1 2016)&#xA;                 (12 4 2016)&#xA;                 (12 5 2016)&#xA;                 (12 1 2016))))&#xA;    INSERT MAGIC HERE&#xA;  my-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;DESIRED RESULT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;'(((12 1 2016)&#xA;   (12 1 2016)&#xA;   (12 1 2016))&#xA;  (12 2 2016)&#xA;  (12 3 2016)&#xA;  (12 4 2016)&#xA;  (12 5 2016))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;START WITH (a more complicated example)&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((my-list '(((12 1 2016) (&quot;foo string&quot; . foo-symbol))&#xA;                 ((12 6 2016) (&quot;bar string&quot; . bar-symbol))&#xA;                 ((12 3 2016) (&quot;baz string&quot; . baz-symbol))&#xA;                 ((12 6 2016) (&quot;doe string&quot; . doe-symbol))&#xA;                 ((12 4 2016) (&quot;roe string&quot; . roe-symbol))&#xA;                 ((12 5 2016) (&quot;moe string&quot; . moe-symbol))&#xA;                 ((12 6 2016) (&quot;joe string&quot; . joe-symbol)))))&#xA;    INSERT MAGIC HERE&#xA;  my-list)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;DESIRED RESULT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;'(((12 1 2016) (&quot;foo string&quot; . foo-symbol))&#xA;  ((12 3 2016) (&quot;baz string&quot; . baz-symbol))&#xA;  ((12 4 2016) (&quot;roe string&quot; . roe-symbol))&#xA;  ((12 5 2016) (&quot;moe string&quot; . moe-symbol))&#xA;  (((12 6 2016) (&quot;bar string&quot; . bar-symbol))&#xA;   ((12 6 2016) (&quot;doe string&quot; . doe-symbol))&#xA;   ((12 6 2016) (&quot;joe string&quot; . joe-symbol))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-01T05:20:18.820" LastActivityDate="2017-01-05T08:56:07.973" Title="List manipulation -- appending duplicate equal lists" Tags="|list|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29702" PostTypeId="1" CreationDate="2016-12-31T09:55:19.593" Score="2" ViewCount="132" Body="&lt;p&gt;I have (human-)language-specific abbrev-tables named like &lt;code&gt;lang-francais-mode-abbrev-table&lt;/code&gt;, &lt;code&gt;lang-castellano8-mode-abbrev-table&lt;/code&gt; backed by my &lt;code&gt;~/.emacs.d/abbrev_defs&lt;/code&gt; file. The language names are the ispell dictionary names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't just load all the abbreviations into memory in &lt;code&gt;global-abbrev&lt;/code&gt;, because I then have &quot;collisions&quot;, e.g. &quot;dont&quot; stays &quot;dont&quot; in French, but should become &quot;don't&quot; for English. And &quot;ten&quot; and &quot;men&quot; should stay as is in English, but become &quot;m'en&quot; and &quot;t'en&quot; for French.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To cycle between flyspell languages, I use this function from the &lt;a href=&quot;https://www.emacswiki.org/emacs/FlySpell&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs flyspell wiki page&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((langs '(&quot;american&quot; &quot;francais&quot; &quot;deutsch8&quot; &quot;castellano8&quot;)))&#xA;  (setq lang-ring (make-ring (length langs)))&#xA;  (dolist (elem langs) (ring-insert lang-ring elem)))&#xA;&#xA;(defun cycle-ispell-languages ()&#xA;  (interactive)&#xA;  (let ((lang (ring-ref lang-ring -1)))&#xA;    (ring-insert lang-ring lang)&#xA;    (ispell-change-dictionary lang)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to change &lt;code&gt;cycle-ispell-languages&lt;/code&gt; to also cycle the active language table for this buffer. How would I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know, I can &lt;code&gt;setq local-abbrev-table lang-francais-mode-abbrev-table&lt;/code&gt;, but that then removes(?) the other active abbrev-tables, that other (major) modes might add, or does it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I edited out a significant portion describing me at an earlier point of the same problem.&lt;/p&gt;&#xA;" OwnerUserId="12504" LastEditorUserId="105" LastEditDate="2016-12-31T22:59:52.790" LastActivityDate="2016-12-31T22:59:52.790" Title="How to cycle between language specific abbrev tables in a buffer?" Tags="|abbrev|flyspell|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29703" PostTypeId="2" ParentId="29689" CreationDate="2016-12-31T10:21:28.623" Score="3" Body="&lt;p&gt;While the current answer is useful, this example shows how to set many characters at once and enable globally when in graphical mode.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when local-cfg/use-prettify-symbols&#xA;  (add-hook&#xA;   'rust-mode-hook&#xA;   (lambda ()&#xA;     (setq&#xA;      prettify-symbols-alist&#xA;      '(&#xA;        (&quot;fn&quot;         . ?ƒ)&#xA;        (&quot;Fn&quot;         . ?)&#xA;        (&quot;-&amp;gt;&quot;         . ?→)&#xA;        (&quot;=&amp;gt;&quot;         . ?⇒)&#xA;        (&quot;&amp;gt;=&quot;         . ?≥)&#xA;        (&quot;&amp;lt;=&quot;         . ?≤)&#xA;        (&quot;==&quot;         . ?≡)&#xA;        (&quot;!=&quot;         . ?≢)&#xA;        (&quot;..&quot;         . ?‥)&#xA;        (&quot;...&quot;        . ?…)&#xA;&#xA;        ; (&quot;*&quot;          . ?×)&#xA;        ; (&quot;/&quot;          . ?÷)&#xA;        )&#xA;      )&#xA;     )&#xA;   )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-03-20T16:17:36.323" LastActivityDate="2017-03-20T16:17:36.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29704" PostTypeId="2" ParentId="29701" CreationDate="2016-12-31T11:04:50.430" Score="1" Body="&lt;p&gt;There is one way: count the number of elements and save the result into alist, then expand the alist to what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((my-list '((12 1 2016)&#xA;                  (12 2 2016)&#xA;                  (12 3 2016)&#xA;                  (12 1 2016)&#xA;                  (12 4 2016)&#xA;                  (12 5 2016)&#xA;                  (12 1 2016)))&#xA;       ;; ⇒ (((12 1 2016) . 3) ((12 2 2016) . 1) ((12 3 2016) . 1) ((12 4 2016) . 1) ((12 5 2016) . 1))&#xA;       (counted&#xA;        (loop with res = nil&#xA;              for i in my-list&#xA;              if (assoc i res) do (incf (cdr (assoc i res)))&#xA;              else do (push (cons i 1) res)&#xA;              finally return (nreverse res)))&#xA;       (expanded&#xA;        (loop for al in counted&#xA;              if (= 1 (cdr al)) collect (car al)&#xA;              else collect (make-list (cdr al) (car al)))))&#xA;  expanded)&#xA;     ⇒ (((12 1 2016)&#xA;         (12 1 2016)&#xA;         (12 1 2016))&#xA;        (12 2 2016)&#xA;        (12 3 2016)&#xA;        (12 4 2016)&#xA;        (12 5 2016))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2016-12-31T11:04:50.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29705" PostTypeId="2" ParentId="29654" CreationDate="2016-12-31T11:51:13.907" Score="0" Body="&lt;p&gt;For the specific case of ECB, I solved this by realizing that on mouse hover over the method in ECB's methods buffer, a tooltip is shown with the full function definition. I then put this into my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; show tooltips in echo area&#xA;(tooltip-mode -1)&#xA;(setq tooltip-use-echo-area t)&#xA;(global-set-key (kbd &quot;C-x t&quot;) 'display-local-help) ;; show tooltip&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, putting the point over a cut-off function in ECB's methods area and pressing &lt;code&gt;C-x t&lt;/code&gt; shows the full function in the echo area, as I wanted:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZythJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZythJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2016-12-31T11:51:13.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29706" PostTypeId="2" ParentId="293" CreationDate="2016-12-31T15:24:36.753" Score="12" Body="&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use &lt;code&gt;.emacs.d/init.el&lt;/code&gt; instead of &lt;code&gt;.emacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;make your &lt;code&gt;.gitignore&lt;/code&gt; a white list&lt;/li&gt;&#xA;&lt;li&gt;use a package manager&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;.emacs.d/init.el&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;.emacs.d/init.el&lt;/code&gt; instead of &lt;code&gt;.emacs&lt;/code&gt; since this setup allows me to put &lt;code&gt;.emacs.d&lt;/code&gt; under git.  Having &lt;code&gt;~/.emacs&lt;/code&gt; makes you to create a symbolic link to git repository or to have git repo at your home directory.  If you use &lt;code&gt;.emacs.d&lt;/code&gt;, all is solved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;.gitignore&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My .gitignore is white listing instead of the default black listing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*&#xA;&#xA;!.gitignore&#xA;!init.el&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This configuration allows you to concentrate on what you really need instead of what you don't need.  &lt;code&gt;.emacs.d&lt;/code&gt; is not like source code repository, meaning that not only your code resides but also all other auto-generated or temporary files goes there.  You don't really know what will go in.  So, &quot;&lt;em&gt;ignore all by default and add files you care&lt;/em&gt;&quot; is better strategy, IMO.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, I keep most of configuration in the &lt;code&gt;init.el&lt;/code&gt;, instead of using multi-file scheme.  The reason is that a big file allows me to a) use standard tools like &lt;code&gt;occur&lt;/code&gt; or &lt;code&gt;isearch-forward&lt;/code&gt; to move to the configuration I want, b) use &lt;a href=&quot;https://github.com/tj64/outshine&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;outshine&lt;/code&gt;&lt;/a&gt; which makes my &lt;code&gt;init.el&lt;/code&gt; &lt;code&gt;org-cycle&lt;/code&gt;-able, c) not change my &lt;code&gt;.gitignore&lt;/code&gt; all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Package Manager&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless you have special needs to sync Emacs version and or Packages version on &lt;em&gt;all&lt;/em&gt; your system, do not put packages under git.  &lt;code&gt;Package.el&lt;/code&gt; is fine.  &lt;code&gt;use-package&lt;/code&gt; is also fine.  Cask is nice.  Pick your package manager and commit only your configuration file but not the package itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ie. One of special needs I can think of would be to have two systems, a development and deployment and they must have exactly the same Emacs configuration.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2017-10-05T04:41:50.283" LastActivityDate="2017-10-05T04:41:50.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29707" PostTypeId="1" CreationDate="2016-12-31T15:38:46.983" Score="14" ViewCount="7255" Body="&lt;p&gt;When an error occur in compiling a program in Ghostscript, the error message  gives a &quot;Current file position is ...&quot; with a number. I use emacs to edit the program file, so I would like to be able easily to find that position in the file (if that is indeed what it is). Please how do I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry I can't find a more appropriate tag.&lt;/p&gt;&#xA;" OwnerUserId="6777" LastEditorUserId="105" LastEditDate="2016-12-31T17:43:17.413" LastActivityDate="2016-12-31T19:08:45.440" Title="Find position in file by character number" Tags="|buffers|motion|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29708" PostTypeId="2" ParentId="16840" CreationDate="2016-12-31T15:43:35.813" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;text typed in yellow foreground and green background&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In my case, this was a symptom of having &lt;code&gt;TERM=xterm&lt;/code&gt; instead of &lt;code&gt;TERM=xterm-256color&lt;/code&gt;.  I've seen the same colors when running inside tmux with &lt;code&gt;TERM=screen&lt;/code&gt; instead of &lt;code&gt;TERM=screen-256color&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4030" LastActivityDate="2016-12-31T15:43:35.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29709" PostTypeId="1" AcceptedAnswerId="29712" CreationDate="2016-12-31T16:02:53.230" Score="3" ViewCount="495" Body="&lt;p&gt;I'm trying to change the color of this part of the UI (top heading bar) in my theme file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tFd77.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tFd77.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this have a specific name that I could use to change its color?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other parts of the interface are referred to like so, but this element isn't there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   `(cursor ((t (:background ,atom-one-dark-accent))))&#xA;   `(fringe ((t (:background ,atom-one-dark-bg))))&#xA;   `(region ((t (:background ,atom-one-dark-gray))))&#xA;   `(highlight ((t (:background ,atom-one-dark-gray))))&#xA;   `(hl-line ((t (:background ,atom-one-dark-bg-hl))))&#xA;   `(vertical-border ((t (:foreground ,atom-one-dark-mono-3))))&#xA;   `(secondary-selection ((t (:background ,atom-one-dark-bg-1))))&#xA;   `(query-replace ((t (:inherit (isearch)))))&#xA;   `(minibuffer-prompt ((t (:foreground ,atom-one-dark-silver))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2016-12-31T17:42:21.937" LastActivityDate="2016-12-31T17:42:21.937" Title="Does this have a name?" Tags="|header-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29710" PostTypeId="1" AcceptedAnswerId="29711" CreationDate="2016-12-31T16:32:28.243" Score="23" ViewCount="9859" Body="&lt;p&gt;What is the difference between &lt;code&gt;setq&lt;/code&gt; and &lt;code&gt;defvar&lt;/code&gt; in Emacs lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see common lisp version of the same question at &lt;a href=&quot;https://stackoverflow.com/questions/3855862&quot;&gt;https://stackoverflow.com/questions/3855862&lt;/a&gt;.  Are they same in Elisp?&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-12-27T02:37:50.953" Title="What's the difference between setq and defvar" Tags="|defvar|setq|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29711" PostTypeId="2" ParentId="29710" CreationDate="2016-12-31T17:38:13.870" Score="32" Body="&lt;p&gt;You should &lt;strong&gt;ask Emacs&lt;/strong&gt; this question: &lt;strong&gt;&lt;code&gt;C-h i&lt;/code&gt;&lt;/strong&gt;, choose the Elisp manual (&lt;strong&gt;&lt;code&gt;m Elisp&lt;/code&gt;&lt;/strong&gt;), and search the index for &quot;defvar&quot; (&lt;strong&gt;&lt;code&gt;i defvar&lt;/code&gt;&lt;/strong&gt;).  That takes you to node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;Defining Variables&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs tells you that &lt;code&gt;defvar&lt;/code&gt; allows attaching a &lt;em&gt;doc string&lt;/em&gt;, and that if the variable &lt;em&gt;already has a value then it does nothing&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also tells you about the use of &lt;code&gt;defvar&lt;/code&gt; with no value to be assigned: &lt;code&gt;(defvar foo)&lt;/code&gt;.  It tells you that that &lt;em&gt;declares the variable to be dynamically scoped&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;setq&lt;/code&gt; has none of those properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;defvar&lt;/code&gt; and &lt;code&gt;setq&lt;/code&gt; are similar, but not quite the same, in Emacs Lisp and Common Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;Read more, to learn more.&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="14203" LastEditDate="2017-12-27T02:37:50.953" LastActivityDate="2017-12-27T02:37:50.953" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="29712" PostTypeId="2" ParentId="29709" CreationDate="2016-12-31T17:40:05.353" Score="3" Body="&lt;p&gt;Yes, it's the &lt;strong&gt;header line&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize its appearance using &lt;strong&gt;&lt;code&gt;M-x customize-face header-line&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Header-Lines.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Header Lines&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2016-12-31T17:40:05.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29713" PostTypeId="2" ParentId="28896" CreationDate="2016-12-31T19:03:03.930" Score="6" Body="&lt;p&gt;Another way is to use the &lt;code&gt;ns-do-applescript&lt;/code&gt; elisp function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ns-do-applescript &quot;display notification \&quot;hello world\&quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ns-do-applescript &quot;display notification \&quot;hello world\&quot; with title \&quot;some title\&quot;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to run AppleScript from Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info on what commands are available in AppleScript:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html&quot; rel=&quot;noreferrer&quot;&gt;https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14399" LastActivityDate="2016-12-31T19:03:03.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29714" PostTypeId="2" ParentId="29707" CreationDate="2016-12-31T19:08:45.440" Score="18" Body="&lt;p&gt;Depending on what is that number, e.g., 47 (line, character-position, etc) you can do M-x goto-line 47 or M-x-goto-char 47.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2016-12-31T19:08:45.440" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29720" PostTypeId="1" AcceptedAnswerId="29898" CreationDate="2017-01-01T06:46:29.220" Score="1" ViewCount="690" Body="&lt;p&gt;I sometimes need to open links in org (mainly for image link) in an external editor (let's say gimp). Is there any way to do that? That is, instead of the default open link, add a open with option or if not maybe open the current link in dired? I'm using Arch Linux in case that matters. &lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorDisplayName="user8748" LastEditDate="2017-05-07T09:16:22.347" LastActivityDate="2017-05-07T09:16:22.347" Title="On orgmode link- dired like open with or open in dired current link?" Tags="|org-mode|dired|org-link|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29721" PostTypeId="2" ParentId="29680" CreationDate="2017-01-01T08:11:23.890" Score="2" Body="&lt;p&gt;I asked the question in the org-mailing list. I was pointed to&#xA;this function which does what I needed: &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2016-05/msg00240.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lists.gnu.org/archive/html/emacs-orgmode/2016-05/msg00240.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (defun org-table-mark-field ()&#xA;      &quot;Mark the current table field.&quot;&#xA;      (interactive)&#xA;      ;; Do not try to jump to the beginning of field if the point is already there&#xA;      (when (not (looking-back &quot;|\\s-?&quot;))&#xA;        (org-table-beginning-of-field 1))&#xA;      (set-mark-command nil)&#xA;      (org-table-end-of-field 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13769" LastActivityDate="2017-01-01T08:11:23.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29722" PostTypeId="1" AcceptedAnswerId="29723" CreationDate="2017-01-01T09:36:45.203" Score="3" ViewCount="134" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/syohex/emacs-git-messenger/issues/25&quot; rel=&quot;nofollow noreferrer&quot;&gt;this issue&lt;/a&gt; in &lt;code&gt;git-messenger&lt;/code&gt;'s issue tracker it was suggested that it should optionally use &lt;code&gt;magit-commit-mode&lt;/code&gt; to show commits in a separate buffer. And that issue was closed as resolved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it appears that &lt;code&gt;magit-commit-mode&lt;/code&gt; does not exists now. Is there a way to use Magit here anyway?&lt;/p&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="306" LastEditDate="2017-01-06T15:34:12.943" LastActivityDate="2017-01-06T15:34:12.943" Title="Does git-messenger support showing a commit using Magit?" Tags="|magit|hooks|git|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29723" PostTypeId="2" ParentId="29722" CreationDate="2017-01-01T10:35:38.077" Score="2" Body="&lt;p&gt;It's called &lt;code&gt;magit-revision-mode&lt;/code&gt; now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But just turning on the mode as suggested in the documentation of &lt;code&gt;git-messenger&lt;/code&gt; won't work. It should be using&lt;code&gt;magit-show-commit&lt;/code&gt; instead. And no, just adding that to the hook instead won't work; that function has to be called with the commit as first argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words you have to ask the maintainer of &lt;code&gt;git-messenger&lt;/code&gt; to add explicit support for Magit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; &lt;code&gt;git-messenger&lt;/code&gt; now supports Magit, see &lt;a href=&quot;https://github.com/syohex/emacs-git-messenger/issues/25&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syohex/emacs-git-messenger/issues/25&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-01-06T12:57:02.070" LastActivityDate="2017-01-06T12:57:02.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29724" PostTypeId="1" AcceptedAnswerId="29725" CreationDate="2017-01-01T12:12:49.607" Score="1" ViewCount="177" Body="&lt;p&gt;I've got this from a YouTube video about Evil mode but I can't see the entire init file, so I think it's incomplete because it gives me an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to disable Evil mode in some modes. This is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom dotemacs-evil-emacs-state-modes&#xA;  '(special-mode&#xA;    eshell-mode&#xA;    comint-mode&#xA;    project-explorer-mode&#xA;    git-commit-mode&#xA;    diff-mode&#xA;    custom-mode&#xA;    dired-mode&#xA;    calendar-mode&#xA;    help-mode)&#xA;  `Doc...&#xA;  :type '(repeat (symbol))&#xA;  :group 'dotemacs)&#xA;&#xA;(dolist (mode dotemacs-evil-emacs-state-modes)&#xA;  (evil-set-initial-state mode 'emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run it, it says &lt;code&gt;Error: invalid syntax &quot;)&quot;&lt;/code&gt; and it's referring to this block: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  '(special-mode&#xA;    eshell-mode&#xA;    comint-mode&#xA;    project-explorer-mode&#xA;    git-commit-mode&#xA;    diff-mode&#xA;    custom-mode&#xA;    dired-mode&#xA;    calendar-mode&#xA;    help-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's wrong with this variable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*** The final solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom dotemacs-evil-emacs-state-modes&#xA;  '(special-mode&#xA;    eshell-mode&#xA;    comint-mode&#xA;    project-explorer-mode&#xA;    git-commit-mode&#xA;    diff-mode&#xA;    custom-mode&#xA;    dired-mode&#xA;    calendar-mode&#xA;    help-mode)&#xA;  &quot;Documentation...&quot;&#xA;  :type '(repeat (symbol))&#xA;  :group 'dotemacs)&#xA;&#xA;(dolist (mode dotemacs-evil-emacs-state-modes)&#xA;  (evil-set-initial-state mode 'emacs))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I changed the DOC to a string variable and made sure that the STANDARD variable is properly spaced with white spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the &quot;)&quot; syntax error was just some package telling me I miss-typed it not an actual run-time error.&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="13361" LastEditDate="2017-01-01T13:18:30.673" LastActivityDate="2017-01-01T13:18:30.673" Title="What's missing here" Tags="|init-file|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29725" PostTypeId="2" ParentId="29724" CreationDate="2017-01-01T12:25:52.273" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;When I run it, it says &lt;code&gt;Error: Doc string is missing&lt;/code&gt; which I don't understand.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It means that &lt;code&gt;defcustom&lt;/code&gt; expects a documentation string but you did not provide one. Use &lt;kbd&gt;C-h f&lt;/kbd&gt; &lt;code&gt;defcustom&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to learn where the doc-string is supposed to go and then add it.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-01-01T12:49:50.403" LastActivityDate="2017-01-01T12:49:50.403" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="29726" PostTypeId="1" AcceptedAnswerId="29727" CreationDate="2017-01-01T15:08:44.203" Score="9" ViewCount="2788" Body="&lt;p&gt;I am trying to use tufte-book document class in org-mode. But for some reason, org-mode doesn't let me use it and says it is unrecognized. So I am going to the resulting &lt;em&gt;.tex&lt;/em&gt; file and manually changing &lt;code&gt;article&lt;/code&gt; to &lt;code&gt;tufte-book&lt;/code&gt;. But doing this everytime got worrysome. So I want a way to make org-mode recognize tufte-book. I looked for the manual and found something about &lt;code&gt;org-article&lt;/code&gt; class but couldn't make much sense out of it for my own problem.&lt;/p&gt;&#xA;" OwnerUserId="11312" LastEditorUserId="11312" LastEditDate="2020-09-27T11:18:03.697" LastActivityDate="2020-09-27T11:18:03.697" Title="org-mode different latex document class" Tags="|org-mode|org-export|latex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29727" PostTypeId="2" ParentId="29726" CreationDate="2017-01-01T15:42:44.140" Score="12" Body="&lt;p&gt;By default &lt;code&gt;org-mode&lt;/code&gt; only knows about the &lt;code&gt;article&lt;/code&gt;, &lt;code&gt;report&lt;/code&gt; and &lt;code&gt;book&lt;/code&gt; classes.  To teach it a new one you have to add an entry to it to &lt;code&gt;org-latex-classes&lt;/code&gt;.  I'm not familiar with &lt;code&gt;tufte-book&lt;/code&gt; but most of the time it suffices to copy the existing values and just change the &lt;code&gt;\documentclass&lt;/code&gt; part.  Adding something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-latex-classes&#xA;             '(&quot;tufte-book&quot;&#xA;               &quot;\\documentclass{tufte-book}&quot;&#xA;               (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;               (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;               (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;)&#xA;               (&quot;\\paragraph{%s}&quot; . &quot;\\paragraph*{%s}&quot;)&#xA;               (&quot;\\subparagraph{%s}&quot; . &quot;\\subparagraph*{%s}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your config file should enable the class&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2017-01-01T15:42:44.140" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29728" PostTypeId="2" ParentId="29720" CreationDate="2017-01-01T16:05:33.343" Score="2" Body="&lt;p&gt;file+sys:image.png should open with the system application.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-01-01T16:05:33.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29729" PostTypeId="1" CreationDate="2017-01-01T16:34:03.810" Score="4" ViewCount="166" Body="&lt;p&gt;Does anyone know how to add a &lt;strong&gt;column&lt;/strong&gt; to &lt;strong&gt;helm-buffers-list&lt;/strong&gt; ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to hack it, but just find &lt;strong&gt;helm-buffers-list-cache&lt;/strong&gt; contains&#xA;buffers names and can't find how to add size or directory (which exists&#xA;acquiescently)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defclass helm-source-buffers (helm-source-sync helm-type-buffer)&#xA;   ((buffer-list&#xA;   :initarg :buffer-list&#xA;   :initform #'helm-buffer-list&#xA;   :custom function&#xA;   :documentation&#xA;   &quot;  A function with no arguments to create buffer list.&quot;)&#xA;    (init :initform 'helm-buffers-list--init)&#xA;    (candidates :initform helm-buffers-list-cache) ;;****!!!!!here is candidates&#xA;    (multimatch :initform nil)&#xA;    (match :initform 'helm-buffers-match-function)&#xA;    (persistent-action :initform 'helm-buffers-list-persistent-action)&#xA;    (resume :initform (lambda ()&#xA;                   (run-with-idle-timer&#xA;                    0.1 nil (lambda ()&#xA;                              (with-helm-buffer&#xA;                                (helm-force-update))))))&#xA;    (keymap :initform helm-buffer-map)&#xA;    (migemo :initform 'nomultimatch)&#xA;    (volatile :initform t)&#xA;    (resume :initform (lambda () (setq helm-buffers-in-project-p nil)))&#xA;    (help-message :initform 'helm-buffer-help-message)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I modify helm-buffers-list?&lt;/p&gt;&#xA;" OwnerUserId="11595" LastActivityDate="2017-01-01T16:34:03.810" Title="Helm: add a column to helm-buffers-list" Tags="|helm|helm-sources|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29730" PostTypeId="1" CreationDate="2017-01-01T17:26:13.267" Score="1" ViewCount="962" Body="&lt;p&gt;I found &lt;a href=&quot;https://stackoverflow.com/questions/7467870/org-mode-html-export&quot;&gt;this&lt;/a&gt; discussion, and the last response gives this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Test&#xA;#+AUTHOR: Blah&#xA;#+LATEX_CLASS: article&#xA;#+LATEX_CLASS_OPTIONS: [american]&#xA;#&#xA;# Setup tikz package for both LaTeX and HTML export:&#xA;#+LATEX_HEADER: \usepackage{tikz}&#xA;#+PROPERTY: header-args:latex+ :packages '((&quot;&quot; &quot;tikz&quot;))&#xA;#&#xA;#+PROPERTY: header-args:latex+ :exports results&#xA;&#xA;* One Diamond&#xA;&#xA;#+name: diamond&#xA;#+header: :file (by-backend (latex &quot;diamond.tikz&quot;) (t &quot;diamond.svg&quot;))&#xA;#+begin_src latex :results raw file&#xA;  \begin{tikzpicture}&#xA;    \draw (1,0) -- (0,1) -- (-1,0) -- (0,-1) -- cycle;&#xA;    % \node at (0,0) {\(x_i\)};&#xA;  \end{tikzpicture}&#xA;#+end_src&#xA;&#xA;#+caption: A diamond.&#xA;#+attr_latex: :float t :width &quot;&quot;&#xA;#+results: diamond&#xA;&#xA;* COMMENT setup&#xA;&#xA;#+name: setup&#xA;#+begin_src emacs-lisp :results silent :exports none&#xA;  ;; (setq org-babel-latex-htlatex &quot;htlatex&quot;)&#xA;  (defmacro by-backend (&amp;amp;rest body)&#xA;    `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))&#xA;#+end_src&#xA;&#xA;# Local variables:&#xA;# eval: (org-sbe &quot;setup&quot;)&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First, the local variable call to elisp block &lt;code&gt;setup&lt;/code&gt; doesn't seem to work. But then I don't really understand what &lt;code&gt;by-backend&lt;/code&gt; is doing. Where can I learn about such a macro and why is it used in this situation? Also, why is so much placed in the org-mode header, i.e., what exactly are these doing?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_CLASS: article&#xA;#+LATEX_CLASS_OPTIONS: [american]&#xA;#&#xA;# Setup tikz package for both LaTeX and HTML export:&#xA;#+LATEX_HEADER: \usepackage{tikz}&#xA;#+PROPERTY: header-args:latex+ :packages '((&quot;&quot; &quot;tikz&quot;))&#xA;#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've seen TikZ code like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass[tikz, margin=3mm]{standalone}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and org-mode doesn't seem to like it. Where and how would it be utilized? Basically, I'm trying to put together a comprehensive tutorial on TikZ in org-mode. I'm seeing lots of one-off tunneling. Need a good tutorial, I'd say. . . .&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-01-01T17:26:13.267" Title="Understanding Emacs macro and org mode tikz behavior" Tags="|latex|elisp-macros|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29732" PostTypeId="1" AcceptedAnswerId="29747" CreationDate="2017-01-01T20:31:05.500" Score="2" ViewCount="205" Body="&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/Wilfred/ag.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;ag.el&lt;/a&gt; as a front-end for the &lt;a href=&quot;http://geoff.greer.fm/ag/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ag&lt;/a&gt; search utility. The results are displayed in a compilation buffer in the form &lt;code&gt;&amp;lt;file&amp;gt;:&amp;lt;line&amp;gt;:&amp;lt;column&amp;gt;:&amp;lt;matching-text&amp;gt;&lt;/code&gt;. The matching-text includes leading-whitespace, and this makes the results harder to scan visually, in my opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I dug around in the bowels of compile.el and ag.el hoping to find a way to strip the leading whitespace, but came up empty. Is there a way to accomplish this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of search results in Emacs:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/t0l92.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/t0l92.png&quot; alt=&quot;emacs-results&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same results in Vim (note the stripped whitespace):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/J6e1J.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/J6e1J.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-01-02T22:19:47.107" Title="grep/ag/etc results buffer: how to strip leading whitespace?" Tags="|search|compilation-mode|grep|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29733" PostTypeId="1" CreationDate="2017-01-01T21:53:17.580" Score="3" ViewCount="651" Body="&lt;p&gt;I use a terminal from within Emacs via &lt;code&gt;M-x RET ansi-term RET&lt;/code&gt;. The problem is that when I run a program which echoes a lot of output, ansi-term first scrolls with the output (such that the last line of the echoed output is always at the bottom of the terminal) but the scrolling often &quot;breaks&quot; such that ansi-term stops scrolling with the echoed output - i.e. I am looking at some line where scrolling &quot;broke&quot; and there is a lot of new output that I don't see unless I press &lt;code&gt;C-n&lt;/code&gt; which puts me to the newest echoed line. But then the scrolling breaks again soon... Does anybody know how to fix this? I can provide any debug output you wish.&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2017-02-02T23:17:08.580" Title="ansi-term scroll problem on fast output" Tags="|ansi-term|term|scrolling|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29736" PostTypeId="2" ParentId="22687" CreationDate="2017-01-02T05:57:58.230" Score="0" Body="&lt;p&gt;I'd recommend instead of a an alias to open Excel with a specific&#xA;file, an alias to open a file with whatever application it is&#xA;associated with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias o w32-shell-execute open $1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2017-01-02T05:57:58.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29737" PostTypeId="1" CreationDate="2017-01-02T08:46:52.927" Score="0" ViewCount="442" Body="&lt;p&gt;Specifically, I'd like to sort a column in a table in org-mode. However, the column only has year and month information, like 2016-02 or May 2016. It can't sort for now as it's not recognised as timestamp. How can I make it to work properly?&lt;/p&gt;&#xA;" OwnerUserId="14407" LastEditorUserId="10578" LastEditDate="2017-01-02T08:55:09.177" LastActivityDate="2017-01-02T23:29:07.310" Title="Is there any way to use just year and month as timestamp in org-mode?" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29738" PostTypeId="1" AcceptedAnswerId="29740" CreationDate="2017-01-02T11:24:30.880" Score="1" ViewCount="940" Body="&lt;p&gt;I've recenly started to convert my &lt;code&gt;init.el&lt;/code&gt; to using &lt;code&gt;use-package&lt;/code&gt;, and have so far not found any problems with that -- except that I can't get ESS to work for all languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have installed the package &lt;code&gt;ess&lt;/code&gt; from Melpa. If I don't mention this at all in the init file, normal &quot;.r&quot; files get opened with &lt;code&gt;ess-mode&lt;/code&gt; (showing as up as &lt;code&gt;ESS[S]&lt;/code&gt;) as major mode, so there seems to be some automatic configuration going on. &quot;.Rnw&quot; files, on the other hand, don't get opened in ESS. Additionally, I want to use &lt;code&gt;julia-mode&lt;/code&gt; in ESS (which is supposed to work &lt;a href=&quot;https://github.com/emacs-ess/ESS/wiki/Julia&quot; rel=&quot;nofollow noreferrer&quot;&gt;automatically&lt;/a&gt;; the &lt;code&gt;julia-mode&lt;/code&gt; package is also installed). So I added the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ess&#xA;  :mode ((&quot;\\.[rR]\\'&quot; . R-mode)&#xA;         (&quot;\\.[rR]nw\\'&quot; . Rnw-mode)&#xA;         (&quot;\\.jl\\'&quot; . julia-mode)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this does not help anything. When opening a &quot;.jl&quot; file, there is no &lt;code&gt;julia&lt;/code&gt; function available, as there should; and there's always a warning&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;File mode specification error: (error Autoloading failed to define&#xA;  function Rnw-mode)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, how am I supposed to set that up? I see that in most &lt;a href=&quot;http://ess.r-project.org/Manual/ess.html#Installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentations&lt;/a&gt;, ESS mode is compiled by hand and loaded by &lt;code&gt;(require 'ess-site)&lt;/code&gt; -- does that make the difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 25.1.&lt;/p&gt;&#xA;" OwnerUserId="14414" LastEditorUserId="14414" LastEditDate="2017-01-02T12:15:47.353" LastActivityDate="2017-01-02T13:58:35.643" Title="ESS language modes with use-package" Tags="|use-package|ess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29739" PostTypeId="1" AcceptedAnswerId="29746" CreationDate="2017-01-02T12:33:36.777" Score="2" ViewCount="637" Body="&lt;p&gt;Every time I use the package manager it puts auto generated code in the init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(ansi-color-faces-vector&#xA;   [default default default italic underline success warning error])&#xA; ...&#xA; )&#xA;&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(fringe ((t (:background &quot;grey10&quot;))))&#xA; ...&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem to be doing anything critical and only messes up my interface and theme colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to stop Custom generated code? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or at least this specific code (I'm assuming it's coming from the packages I have installed).&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2017-01-02T17:51:11.460" LastActivityDate="2017-01-02T17:51:11.460" Title="Auto generated code in the init file when updating packages" Tags="|init-file|customize|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29740" PostTypeId="2" ParentId="29738" CreationDate="2017-01-02T13:58:35.643" Score="3" Body="&lt;p&gt;The file associations should all be set up for you. It works for me on Emacs 25.1 with just the following in my init:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ess&#xA;  :init (require 'ess-site))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set the associations for R-mode, julia-mode and Rnw-mode. If that doesn't work for you, the most likely explanation is that something else in your configuration is causing the problem (ie., by changing the assocations with R-mode etc).&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-02T13:58:35.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29741" PostTypeId="1" CreationDate="2017-01-02T15:00:16.810" Score="1" ViewCount="27" Body="&lt;p&gt;When I have something todo regarding to a URL, I often just capture the URL, e.g. like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO [[http://example.org/foo/bar]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this leads to the problem, that I get empty headings when I &lt;code&gt;org-publish&lt;/code&gt; my org files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I doing something wrong? I understand that a link in a heading is a problem since the headings itself are links, on the other hand just leaving them out is not a very good solution. Is there a workaround? The URL as unlinked text would be a viable solution for me.&lt;/p&gt;&#xA;" OwnerUserId="2037" LastActivityDate="2017-01-02T15:00:16.810" Title="Export: links in headings missing" Tags="|org-mode|org-publish|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29742" PostTypeId="1" AcceptedAnswerId="29744" CreationDate="2017-01-02T15:15:42.560" Score="2" ViewCount="141" Body="&lt;p&gt;when copy and pasting from any web site a paragraph and pasting into emacs with S-insert, the paragraph is always a very long line. is there anyway to keep the paragraph structure?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2017-01-02T17:45:36.470" LastActivityDate="2022-01-19T17:54:13.523" Title="pasting from websites results in 1 long line..anyway to keep the paragraph format?" Tags="|text-editing|copy-paste|fill-paragraph|paragraphs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29743" PostTypeId="1" AcceptedAnswerId="29745" CreationDate="2017-01-02T15:29:54.237" Score="1" ViewCount="490" Body="&lt;p&gt;I have an init file called &lt;code&gt;settings.org&lt;/code&gt; (using &lt;code&gt;#+BEGIN_SRC #+END_SRC&lt;/code&gt; blocks for elisp code) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to generate &lt;code&gt;settings.el&lt;/code&gt; from it, so that I can load it inside &lt;code&gt;init.el&lt;/code&gt; easily. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2017-01-02T17:44:04.777" LastActivityDate="2017-01-02T17:44:04.777" Title="Generating file.el from file.org" Tags="|org-mode|init-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29744" PostTypeId="2" ParentId="29742" CreationDate="2017-01-02T15:38:18.633" Score="4" Body="&lt;p&gt;Just run &lt;code&gt;fill-paragraph&lt;/code&gt; bound by default to &lt;code&gt;M-q&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on where you are copying from, remember that the paragraph is one logical object, how it shows depends on the width of the browser on your screen. Emacs is doing the correct thing by not inserting extra newlines.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="105" LastEditDate="2017-01-02T17:44:59.940" LastActivityDate="2017-01-02T17:44:59.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29745" PostTypeId="2" ParentId="29743" CreationDate="2017-01-02T16:59:27.200" Score="2" Body="&lt;p&gt;After some research this is the solution I managed to find:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add &lt;code&gt;:tangle yes&lt;/code&gt; to each block of code you want to export&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\#+BEGIN_SRC emacs-lisp :tangle yes&#xA;elisp code...&#xA;\#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then inside the .org file use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x org-babel-tangle&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will create a file with the same name but with the &lt;code&gt;.el&lt;/code&gt; extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case I generated &lt;code&gt;settings.el&lt;/code&gt; and included it in &lt;code&gt;init.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be automated with &lt;code&gt;(org-babel-load-file)&lt;/code&gt; to directly load the org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I personally prefer the extra step, to make sure I know what I'm loading and when.&lt;/p&gt;&#xA;" OwnerUserId="13361" LastActivityDate="2017-01-02T16:59:27.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29746" PostTypeId="2" ParentId="29739" CreationDate="2017-01-02T17:47:26.087" Score="2" Body="&lt;p&gt;Set option &lt;strong&gt;&lt;code&gt;custom-file&lt;/code&gt;&lt;/strong&gt; (to a different file from your init file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then Customize will use your &lt;code&gt;custom-file&lt;/code&gt; instead of your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is good practice. It keeps your manually edited code apart from Customize's automatically managed code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One minor caveat: Even though &lt;code&gt;custom-file&lt;/code&gt; is a user option, &lt;em&gt;set it in your init file&lt;/em&gt; instead of using Customize to manage it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you set &lt;code&gt;custom-file&lt;/code&gt; in your init file, explicitly &lt;em&gt;load it&lt;/em&gt; from your init file: &lt;code&gt;(load-file custom-file)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-02T17:47:26.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29747" PostTypeId="2" ParentId="29732" CreationDate="2017-01-02T20:02:25.987" Score="1" Body="&lt;p&gt;Kudos to @wvxvw for pointing me in the right direction. I was able to normalize the whitespace by advising &lt;code&gt;ag-filter&lt;/code&gt;, which ag adds to &lt;code&gt;compilation-filter-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivan/filter-whitespace (prefix-pattern)&#xA;  (save-excursion&#xA;    (forward-line 0)&#xA;    (let ((end (point)) beg)&#xA;      (goto-char compilation-filter-start)&#xA;      (forward-line 0)&#xA;      (setq beg (point))&#xA;      (when (&amp;lt; (point) end)&#xA;        (setq end (copy-marker end))&#xA;&#xA;        ;; normalize whitespace between prefix-pattern and rest of line&#xA;        (while (re-search-forward prefix-pattern end 1)&#xA;          (and (re-search-forward &quot;[[:blank:]]*&quot; end 1)&#xA;               (replace-match &quot; &quot; t t)))))))&#xA;&#xA;(defun ivan/filter-ag-whitespace ()&#xA;  (ivan/filter-whitespace ag/file-column-pattern))&#xA;&#xA;(advice-add 'ag-filter :after #'ivan/filter-ag-whitespace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The structure of the filter is identical to &lt;code&gt;ag-filter&lt;/code&gt; itself, just the &lt;code&gt;while&lt;/code&gt; loop differs. I thought it might be nice to apply the same filter to the *Occur* buffer, but when all the results are from the same file I think the indentation lends worthwhile context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final result:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/wyCLQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wyCLQ.png&quot; alt=&quot;normalized-whitespace&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However&lt;/em&gt;, the downside is this breaks wgrep functionality, probably because wgrep is looking for an exact match. I had to rig up a workaround that recompiles the search results with whitespace intact when wgrep is engaged.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key ag-mode-map&#xA;  [remap wgrep-change-to-wgrep-mode] #'ivan/init-wgrep-mode)&#xA;&#xA;(defun ivan/init-wgrep-mode ()&#xA;  (interactive)&#xA;  (advice-remove 'ag-filter #'ivan/filter-ag-whitespace)&#xA;  (add-hook 'ag-search-finished-hook #'ivan/enable-wgrep-mode)&#xA;  (recompile))&#xA;&#xA;(defun ivan/enable-wgrep-mode ()&#xA;  (remove-hook 'ag-search-finished-hook #'ivan/enable-wgrep-mode)&#xA;  (advice-add 'ag-filter :after #'ivan/filter-ag-whitespace)&#xA;  (wgrep-change-to-wgrep-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2017-01-02T22:19:47.107" LastActivityDate="2017-01-02T22:19:47.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29748" PostTypeId="1" AcceptedAnswerId="29750" CreationDate="2017-01-02T20:06:42.367" Score="4" ViewCount="6094" Body="&lt;p&gt;I would like to install the emacs speaks statistics package from melpa.&#xA;I found the following snipped&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (use-package ess&#xA;  :init (require 'ess-site))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on this side &lt;a href=&quot;https://emacs.stackexchange.com/a/29740/14419&quot;&gt;https://emacs.stackexchange.com/a/29740/14419&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error (use-package): ess :init: Cannot open load file: Datei oder Verzeichnis nicht gefunden, ess-site&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have used 'use-package successfully to install other packages and have the following path in my config&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Standard package repositories&#xA;(add-to-list 'package-archives '(&quot;org-plus-contrib&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;marmalade&quot; . &quot;http://marmalade-repo.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;elpy&quot; . &quot;https://jorgenschaefer.github.io/packages/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using emacs 25.1.1.&lt;/p&gt;&#xA;" OwnerUserId="14419" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-01-02T21:24:02.033" Title="Install ESS with use-package" Tags="|use-package|ess|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29749" PostTypeId="2" ParentId="29748" CreationDate="2017-01-02T21:00:18.160" Score="1" Body="&lt;p&gt;That snippet doesn't install &lt;code&gt;ESS&lt;/code&gt;, it loads it after you've already installed it. To install it, try the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x package-install-packages&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will open the list of packages available. Find ess and type &lt;code&gt;i&lt;/code&gt; to mark it for installation. Then type &lt;code&gt;x&lt;/code&gt; to install it.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-02T21:00:18.160" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29750" PostTypeId="2" ParentId="29748" CreationDate="2017-01-02T21:24:02.033" Score="7" Body="&lt;p&gt;I was missing ':ensure t .&#xA;Now the ess package gets automatically installed at first use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information on how to load packages from ELPA with package.el and use-package see: &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/jwiegley/use-package&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (use-package ess&#xA;  :ensure t&#xA;  :init (require 'ess-site))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14419" LastActivityDate="2017-01-02T21:24:02.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29752" PostTypeId="1" CreationDate="2017-01-02T21:58:20.587" Score="0" ViewCount="329" Body="&lt;p&gt;I am using spacemacs, anaconda-mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In file main.py, I imported a class from file a.py. Then I pressed &lt;code&gt;C-c C-p&lt;/code&gt; to launch an ipython shell, and run main.py, everything is OK. But then I modified the class in a.py, and save, and rerun main.py, I found that the class in a.py was the previous version, which means ipython did not update the content in a.py! Only when I killed the python buffer, and relaunched the ipython shell, did the content in a.py be updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested this in Spyder, which is a python IDE, and it worked perfect as I expected. But what's wrong with emacs? Are there some configurations that I missed?  &lt;/p&gt;&#xA;" OwnerUserId="14312" LastActivityDate="2017-03-04T00:48:50.510" Title="Emacs python can not update imported files?" Tags="|python|spacemacs|ipython|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29754" PostTypeId="2" ParentId="29737" CreationDate="2017-01-02T23:29:07.310" Score="2" Body="&lt;p&gt;An &lt;code&gt;org-mode&lt;/code&gt; timestamp must have a day.  However if you give the months in the form &quot;2016-02&quot; then time sorting and alphabetical sorting are the same (so long as you're careful to keep everything padded to the same length).&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2017-01-02T23:29:07.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29755" PostTypeId="2" ParentId="29752" CreationDate="2017-01-03T00:42:59.370" Score="1" Body="&lt;p&gt;I have solved this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First method:&#xA;In ipython console, type &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%load_ext autoreaload&#xA;%autoreload 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Second method:&#xA;Create configuration &quot;dev&quot; (or whatever):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ipython profile create dev&#xA;[ProfileCreate] Generating default config file: u'/home/username/.config/ipython/profile_dev/ipython_config.py'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And add these lines to &quot;ipython_config.py&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c.InteractiveShellApp.extensions = ['autoreload']&#xA;c.InteractiveShellApp.exec_lines = ['%autoreload 2']&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then set variables in Emacs config for python-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA;   python-shell-interpreter &quot;ipython&quot;&#xA;   python-shell-interpreter-args &quot;--profile=dev&quot;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;IPython started with this config will reload modules when you resend code to it.&lt;/p&gt;&#xA;" OwnerUserId="14312" LastActivityDate="2017-01-03T00:42:59.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29757" PostTypeId="2" ParentId="12772" CreationDate="2017-01-03T00:54:52.023" Score="3" Body="&lt;p&gt;For those who want to run stable emacs 25.1 on Ubuntu 16.10, I pulled the source package from zenity-proposed and pushed it to my ppa for yakkety, so you can install as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo add-apt-repository ppa:aperomsik/aap-ppa&#xA;sudo apt-get update&#xA;sudo apt-get install emacs25&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12296" LastEditorUserId="8823" LastEditDate="2017-01-03T21:53:44.780" LastActivityDate="2017-01-03T21:53:44.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29758" PostTypeId="1" AcceptedAnswerId="36483" CreationDate="2017-01-03T02:22:20.833" Score="4" ViewCount="1262" Body="&lt;p&gt;In org mode, the TAB key maps to yas-next-field-or-maybe-expand. But it is not working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I run yas-expand (by hand) it works as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TAB does expand in other modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what might be wrong with my configuration? where to start debugging my (long) startup configuration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="13769" LastActivityDate="2017-10-31T23:57:29.713" Title="yasnippets and org-mode: yas-next-field-or-maybe-expand does not expand" Tags="|org-mode|yasnippet|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29759" PostTypeId="2" ParentId="18830" CreationDate="2017-01-03T03:04:18.723" Score="2" Body="&lt;p&gt;Or if you want to export &lt;code&gt;DONE&lt;/code&gt; items but not &lt;code&gt;TODO&lt;/code&gt; items, set it (&lt;code&gt;tasks&lt;/code&gt;) to &lt;code&gt;done&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9500" LastActivityDate="2017-01-03T03:04:18.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29761" PostTypeId="1" AcceptedAnswerId="29762" CreationDate="2017-01-03T07:32:15.200" Score="1" ViewCount="223" Body="&lt;p&gt;I have placed my autosave and backup files in a single directory &lt;code&gt;.emacs-saves&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Backup files appear as &lt;code&gt;~foo&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Autosave files appear as &lt;code&gt;#foo#&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But Emacs seems to also generate &lt;code&gt;.#foo&lt;/code&gt; in the current directory whenever a change is made in a buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the purpose of these files and is there a way to specify their default directory?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2022-04-04T15:42:02.250" LastActivityDate="2022-04-04T15:42:02.250" Title="What are .#foo files?" Tags="|lock-files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29762" PostTypeId="2" ParentId="29761" CreationDate="2017-01-03T08:40:25.590" Score="1" Body="&lt;p&gt;These are lock files. See &lt;a href=&quot;https://emacs.stackexchange.com/questions/5967/save-lock-files-to-a-directory-instead-of-disabling-them&quot;&gt;Save lock-files to a directory instead of disabling them&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are accessing files remotely (think &lt;code&gt;tramp&lt;/code&gt; or &lt;code&gt;nfs&lt;/code&gt;) then it is a lot simpler to have the lock files in the same directory as the file being edited.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-01-03T08:40:25.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29763" PostTypeId="1" CreationDate="2017-01-03T08:41:45.883" Score="2" ViewCount="3071" Body="&lt;p&gt;I'm looking to be able to do the same thing as &lt;code&gt;ESS&lt;/code&gt; but for python, ie to be able to have two windows side by side one with python shell and the other with text file and send current line or block pressing C-enter or C-p. So I tried to install &lt;code&gt;(python-x)&lt;/code&gt; but I don't seem to be able to do that, I tried to install &lt;code&gt;(eval-in-repl)&lt;/code&gt; (all this through the MELPA system) but none of it seems to work as when I select &lt;code&gt;python-mode or python-activate&lt;/code&gt; nothing happens, and when I open &lt;code&gt;M-x shell&lt;/code&gt; then split windows with a python file &lt;code&gt;C-ret&lt;/code&gt; isn't binded. Me adding &lt;code&gt;(python-x-setup)&lt;/code&gt; in my &lt;code&gt;.spacemacs&lt;/code&gt; raise an error at the start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how I am supposed to install and setup a package so I can send lines to python shell (or any shell in general) ? I got spacemacs based on emacs 25.1.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can run &lt;code&gt;run-python&lt;/code&gt; however it opens a shell but how do I get to feed it from a persistent text file ?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastEditorUserId="11673" LastEditDate="2017-01-03T08:48:51.157" LastActivityDate="2017-06-09T09:25:15.527" Title="How to get python-x (eval-in-repl) to work?" Tags="|python|spacemacs|repl|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29764" PostTypeId="2" ParentId="29763" CreationDate="2017-01-03T09:47:48.900" Score="2" Body="&lt;p&gt;Elpy can do that &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jorgenschaefer/elpy&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command you are looking for would be &lt;code&gt;elpy-shell-send-current-statement&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also try &lt;code&gt;elpy-shell-send-region-or-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Send the active region or the buffer to the Python shell.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If there is an active region, send that. Otherwise, send the whole&#xA;  buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2017-01-03T09:47:48.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29765" PostTypeId="2" ParentId="29687" CreationDate="2017-01-03T11:12:48.223" Score="0" Body="&lt;p&gt;I find how to add number for helm-buffers-list,just redefine this function with two points (in codes with comments) for adding line numbers. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (defun helm-highlight-buffers (buffers _source)&#xA;     &quot;Transformer function to highlight BUFFERS list.&#xA;   Should be called after others transformers i.e (boring buffers).&quot;&#xA;&#xA;     (cl-loop for i in buffers&#xA;    ;;; **1. create number***************************************&#xA;         for number from 1 to (length buffers) &#xA;         for (name size mode meta) = (if helm-buffer-details-flag&#xA;                         (helm-buffer--details i 'details)&#xA;                    (helm-buffer--details i))&#xA;           for truncbuf = (if (&amp;gt; (string-width name) helm-buffer-max-length)&#xA;                              (helm-substring-by-width&#xA;                               name helm-buffer-max-length&#xA;                               helm-buffers-end-truncated-string)&#xA;                            (concat name&#xA;                                    (make-string&#xA;                     (- (+ helm-buffer-max-length&#xA;                                                (length helm-buffers-end-truncated-string))&#xA;                                             (string-width name)) ? )))&#xA;&#xA;           for len = (length mode)&#xA;           when (&amp;gt; len helm-buffer-max-len-mode)&#xA;           do (setq helm-buffer-max-len-mode len)&#xA;           for fmode = (concat (make-string&#xA;                                (- (max helm-buffer-max-len-mode len) len) ? )&#xA;                               mode)&#xA;&#xA;           for formatted-size = (and size (format &quot;%7s&quot; size))&#xA;           collect (cons (if helm-buffer-details-flag&#xA;;;; **** 2. concat number at first ****************************&#xA;                             (concat (int-to-string number) &quot; &quot; truncbuf &quot;\t&quot; formatted-size&#xA;                                     &quot;  &quot; fmode &quot;  &quot; meta)&#xA;                           name)&#xA;            (get-buffer i))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To select buffer like recentf-open-files, I define some keys for helm-map for selecting by alt+number.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;       ;;; add alt+number to select nth line&#xA;       (require 'cl)&#xA;       (cl-loop for n from 1 to 9&#xA;           for key = (format &quot;M-%d&quot; n)&#xA;           for fn = `(lambda ()&#xA;               (interactive)&#xA;               (helm-next-line ,(- n 1))&#xA;               (helm-maybe-exit-minibuffer)&#xA;               )&#xA;           do (progn&#xA;            (define-key helm-map (kbd key) fn)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11595" LastActivityDate="2017-01-03T11:12:48.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29766" PostTypeId="2" ParentId="29664" CreationDate="2017-01-03T11:33:34.963" Score="0" Body="&lt;p&gt;You could use &lt;code&gt;lispy&lt;/code&gt;. What you describe can be achieved by marking a sexp (&lt;kbd&gt;m&lt;/kbd&gt; or &lt;kbd&gt;M-m&lt;/kbd&gt;), switching to the different side of the region (&lt;kbd&gt;d&lt;/kbd&gt;), and growing the region by as many sexps as possible (&lt;code&gt;0&amp;gt;&lt;/code&gt;).&#xA;At this point you have marked the stuff that you want killed or deleted. Press &lt;kbd&gt;C-w&lt;/kbd&gt; or &lt;kbd&gt;C-d&lt;/kbd&gt; appropriately.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2017-01-03T11:33:34.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29768" PostTypeId="1" AcceptedAnswerId="29773" CreationDate="2017-01-03T13:36:10.433" Score="5" ViewCount="1950" Body="&lt;p&gt;My echo area blinks whenever I move the cursor up to end-of-buffer or beginning of buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Nx2yK.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Nx2yK.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens even when I comment out everything in my &lt;code&gt;.emacs&lt;/code&gt; file.  &lt;strong&gt;Where does this feature come from and how do I remove it?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="9638" LastEditorUserId="253" LastEditDate="2017-01-03T19:13:57.497" LastActivityDate="2017-01-03T19:13:57.497" Title="How to stop Emacs from blinking?" Tags="|echo-area|bell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29769" PostTypeId="1" AcceptedAnswerId="29771" CreationDate="2017-01-03T13:44:28.193" Score="2" ViewCount="118" Body="&lt;p&gt;Is there a command that will jump cursor to other iteration of the variable or function name under the cursor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose it wouldn't matter if the text is specifically a variable or function, but just another iteration of the same text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I have &lt;code&gt;foobar&lt;/code&gt; under my cursor can I jump to the next &lt;code&gt;foobar&lt;/code&gt; in the file?&lt;/p&gt;&#xA;" OwnerUserId="14390" LastEditorUserId="14390" LastEditDate="2017-01-03T13:53:30.480" LastActivityDate="2017-01-03T14:19:49.387" Title="Finding Like Variables or Functions" Tags="|commands|motion|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29770" PostTypeId="1" CreationDate="2017-01-03T13:59:57.857" Score="4" ViewCount="61" Body="&lt;p&gt;Sometimes my latex commands (with &lt;code&gt;#+LATEX:&lt;/code&gt;) get buried within my org document. Can I disable the visibility cycle behavior for single lines? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A preferred behavior would be to leave non-indented lines always visible.&lt;/p&gt;&#xA;" OwnerUserId="12463" LastActivityDate="2017-01-07T22:56:01.903" Title="How to prevent single lines from disappearing when cycle with TAB key?" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29771" PostTypeId="2" ParentId="29769" CreationDate="2017-01-03T14:19:49.387" Score="3" Body="&lt;p&gt;Different modes (e.g. languages) have different notions of variables and functions, so finding them can be mode-specific.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A general answer, which lets you move forward among occurrences of the &lt;em&gt;name&lt;/em&gt; at the cursor, is to use &lt;code&gt;C-s&lt;/code&gt; followed by successive &lt;code&gt;C-w&lt;/code&gt; to pick up the name at point, then repeated &lt;code&gt;C-s&lt;/code&gt; to move to successive occurrences of the name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That picks up the name starting at the cursor.  If the cursor is in the middle of the name it may still be enough to distinguish the occurrences.  If not, before using it move the cursor back to the name beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This just searches for a name.  It does not distinguish whether that name represents a function or a variable or something else.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/isearch%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;isearch+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; then you can use &lt;code&gt;C-_&lt;/code&gt; instead of &lt;code&gt;C-w&lt;/code&gt;.  That picks up symbols instead of words, for the search string.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For Emacs-Lisp functions and variables: If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/hl-defined.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;hl-defined.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; then you can use command &lt;strong&gt;&lt;code&gt;hdefd-highlight-mode&lt;/code&gt;&lt;/strong&gt; to highlight all Lisp functions and variables (or just one or the other).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you also use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/isearch-prop.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;isearch-prop.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; then you can use command &lt;strong&gt;&lt;code&gt;isearchp-property-forward&lt;/code&gt;&lt;/strong&gt; to search among zones of a given text (or overlay) property, including property &lt;code&gt;face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means you can use it to move among the function and variable occurrences highlighted by &lt;code&gt;hdefd-highlight-mode&lt;/code&gt;.  You just tell &lt;code&gt;isearchp-property-forward&lt;/code&gt; that the property you want to search is &lt;code&gt;face&lt;/code&gt; and the faces you want to search are &lt;strong&gt;&lt;code&gt;hdefd-functions&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;hdefd-variables&lt;/code&gt;&lt;/strong&gt; (or just one or the other).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x hdefd-highlight-mode      ; Turn on function &amp;amp; variable highlighting.&#xA;&#xA;M-x isearchp-property-forward RET RET hdefd-functions RET hdefd-variables RET RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This prompts you for whether to search text properties or overlay properties, or both.  Both is the default, so just hit &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it prompts you for the property. &lt;code&gt;face&lt;/code&gt; is the default, so just hit &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it prompts you for a face.  Enter &lt;code&gt;hdefd-functions&lt;/code&gt;.  It prompts you again for a face -- enter &lt;code&gt;hdefd-variables&lt;/code&gt;.  It prompts you again for a face -- just hit &lt;code&gt;RET&lt;/code&gt; without typing another face name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are now searching within the highlighted function and variable occurrences.  Just type a few characters that match a function or variable name, and you move to its occurrences (by repeating &lt;code&gt;C-s&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-03T14:19:49.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29772" PostTypeId="1" CreationDate="2017-01-03T14:34:23.523" Score="2" ViewCount="81" Body="&lt;p&gt;With a C like language, it might be nice to be able to display:&lt;br&gt; &lt;code&gt;(var * t)&lt;/code&gt; as &lt;code&gt;(var x t)&lt;/code&gt; - using the unicode multiply symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this causes problems with casting. eg:&lt;br&gt;&lt;code&gt;void fn(MyStruct *s)&lt;/code&gt; becomes &lt;code&gt;void fn(MyStruct xs)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to only replace a symbol when its surrounded by white-space? &lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Matching &lt;code&gt;&quot; * &quot;&lt;/code&gt; works but removes the spaces on either side.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Am aware spacing in this context is just a convention, nevertheless, would be interested to know if its possible.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2017-01-03T14:34:23.523" Title="Possible to take whitespace into account with prettify symbols? (without removing whitespace)" Tags="|prettify-symbols-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29773" PostTypeId="2" ParentId="29768" CreationDate="2017-01-03T15:42:58.033" Score="7" Body="&lt;p&gt;You probably have the variable &lt;code&gt;visible-bell&lt;/code&gt; set to a non-&lt;code&gt;nil&lt;/code&gt;&#xA;value (have a look at the manual node on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Beeping.html&quot; rel=&quot;noreferrer&quot;&gt;Beeping&lt;/a&gt; for more information).  Here's the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Non-&lt;code&gt;nil&lt;/code&gt; means try to flash the frame to represent a bell.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See also &lt;code&gt;ring-bell-function&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You may also wish to set the &lt;code&gt;ring-bell-function&lt;/code&gt;.  Here's its&#xA;docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&#xA;  Non-&lt;code&gt;nil&lt;/code&gt; means call this function to ring the bell.&#xA;  The function should accept no arguments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Put the following in your init file, which should eliminate the&#xA;visible bell issues.  The first is &lt;em&gt;probably&lt;/em&gt; sufficient, but you may wish to eliminate the bell entirely (I know I do), which is why the second part is in there.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq visible-bell       nil&#xA;      ring-bell-function #'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-03T15:42:58.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29774" PostTypeId="1" AcceptedAnswerId="29776" CreationDate="2017-01-03T16:19:06.443" Score="5" ViewCount="1201" Body="&lt;p&gt;I'm trying to setup some keybinds using functions from the &lt;code&gt;python-x&lt;/code&gt; package. While it works for the simple call &lt;code&gt;(global-set-key (kbd &quot;C-c C-j&quot;) 'python-shell-send-line)&lt;/code&gt;, when I try to chain multiple functions using the lambda trick I get &lt;code&gt;&amp;lt;C-return&amp;gt; is undefined&lt;/code&gt; despite having no error at startup. Here is the command I put in the &lt;code&gt;user-config&lt;/code&gt; in .spacemacs :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-RET&quot;) (lambda () (interactive) (python-shell-send-line) (next-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;python-x&lt;/code&gt; works with python mode but the simple keybind is available everywhere while the chained keybinds are all undefined. Where does it go wrong ?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastEditorUserId="25" LastEditDate="2017-01-03T22:38:21.057" LastActivityDate="2017-01-03T22:38:21.057" Title="Binding for (kbd &quot;C-RET&quot;) not working" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29775" PostTypeId="1" AcceptedAnswerId="29806" CreationDate="2017-01-03T16:39:35.963" Score="2" ViewCount="291" Body="&lt;p&gt;I'm using org-mode + org-babel to execute Bash commands that execute Docker commands. Here's an example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC sh :exports both :dir ~/Dev/Docker/sample&#xA;&#xA;sudo docker build -t tompurl/nginx .&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I run this command within Emacs I get the following output:&lt;/p&gt;&#xA;&lt;h1&gt;+RESULTS:&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;| Sending        | build                | context                   | to                                               | Docker                | daemon                | 4.096                 | kB       |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| Step           | 1                    | :                         | FROM                                             | ubuntu:16.04          |                       |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| ---&amp;gt;           | 104bec311bcd         |                           |                                                  |                       |                       |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| Step           | 2                    | :                         | MAINTAINER                                       | Tom                   | Purl                  | &amp;lt;tom@tompurl.com&amp;gt;     |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| ---&amp;gt;           | Running              | in                        | dcd4c9dca196                                     |                       |                       |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| ---&amp;gt;           | 282dcb00cc8b         |                           |                                                  |                       |                       |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| Removing       | intermediate         | container                 | dcd4c9dca196                                     |                       |                       |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| Step           | 3                    | :                         | ENV                                              | REFRESHED_AT          | 2017-01-03            |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| ---&amp;gt;           | Running              | in                        | 5c0aef4cfeca                                     |                       |                       |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| ---&amp;gt;           | 6dc275877c48         |                           |                                                  |                       |                       |                       |          |           |               |          |          |                |          |       |               |           |                                             |                              |                                      |                  |                                     |                      |                          |                                     |          |     |                                               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |               |          |     |                |          |     |      |       |     |             |           |             |&#xA;| &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is just the first 10 lines, there are well over 100 in the total output. Notice how the output seems to be squeezed into a table.&lt;/p&gt;&#xA;&lt;p&gt;Here's the output from the same command when executed from the command line:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo docker build .                            &#xA;Sending build context to Docker daemon 4.096 kB&#xA;Step 1 : FROM ubuntu:16.04&#xA; ---&amp;gt; 104bec311bcd&#xA;Step 2 : MAINTAINER Tom Purl &amp;quot;&amp;lt;tom@tompurl.com&amp;gt;&amp;quot;&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 282dcb00cc8b&#xA;Step 3 : ENV REFRESHED_AT 2017-01-03&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 6dc275877c48&#xA;Step 4 : RUN apt-get -yqq update &amp;amp;&amp;amp; apt-get -yqq install nginx&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 91a8bef9ea0b&#xA;Step 5 : RUN mkdir -p /var/www/html/website&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; c28fa568b3c2&#xA;Step 6 : ADD global.conf /etc/nginx/conf.d/&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 365c3e022248&#xA;Step 7 : ADD nginx.conf /etc/nginx/nginx.conf&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 726d0c223e77&#xA;Step 8 : EXPOSE 80&#xA; ---&amp;gt; Using cache&#xA; ---&amp;gt; 9035336945b0&#xA;Successfully built 9035336945b0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Is there something that I'm doing to squeeze everything into a table like this?&lt;/p&gt;&#xA;" OwnerUserId="8228" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-01-04T04:55:40.063" Title="Ouput Of Org Src Block Is Squeezed Into A Table" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29776" PostTypeId="2" ParentId="29774" CreationDate="2017-01-03T17:09:40.530" Score="7" Body="&lt;p&gt;&lt;code&gt;(kbd &quot;C-RET&quot;)&lt;/code&gt; does not actually refer to &quot;Control return&quot;, the way it looks like it will.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find out how a key should be written, press &lt;kbd&gt;C-h c&lt;/kbd&gt; and then the key. If we do that, we get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;C-return&amp;gt; is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, use &lt;code&gt;C-&amp;lt;return&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-&amp;lt;return&amp;gt;&quot;) (lambda () (interactive) (python-shell-send-line) (next-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-01-03T17:09:40.530" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29777" PostTypeId="1" CreationDate="2017-01-03T17:22:04.820" Score="5" ViewCount="782" Body="&lt;p&gt;Font and encoding (in a broad sense, internationalization) are causing problems in many software scenarios, like web browser and editor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Unicode U+201C and U+201D are double quotation marks. These two marks are covered by most (if not all) fonts. There are no different code points of double quotation mark for different languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to achieve in Emacs is the following. Set the default font to English monospace font (Font A) and use other fonts for characters in certain Unicode range. For example, use Font B for Han characters and Font C for Cyrillic characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;~/.emacs&lt;/code&gt;, I have the following Elisp code.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'default nil :family &quot;Lucida Sans Typewriter&quot; :height 120)&#xA;&#xA;(set-fontset-font &quot;fontset-default&quot; '(#x2000 . #x206f)   ; doesn't work&#xA;          &quot;Microsoft YaHei&quot; nil 'prepend)&#xA;&#xA;(set-fontset-font &quot;fontset-default&quot; 'han                 ; works&#xA;          &quot;Microsoft YaHei&quot; nil 'prepend)&#xA;&#xA;(set-fontset-font &quot;fontset-default&quot; 'cjk-misc            ; works&#xA;          &quot;Microsoft YaHei&quot; nil 'prepend)&#xA;&#xA;(set-fontset-font &quot;fontset-default&quot; 'cyrillic            ; works&#xA;          &quot;Consolas&quot; nil 'prepend)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All calls to &lt;code&gt;set-fontset-font&lt;/code&gt; work fine except the first that tries to use &lt;em&gt;Microsoft YaHei&lt;/em&gt; for General Punctuation section in Unicode. I have also tried changing the order of these &lt;code&gt;set-fontset-font&lt;/code&gt; calls, but to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why it doesn't work, I suspect, is that Emacs only use fallback fonts only if the default font doesn't have the glyphs for the corresponding code points. Since the double quotation marks exist in many languages and thus many fonts have the glyphs for them. &lt;em&gt;Consolas&lt;/em&gt;, &lt;em&gt;Lucida Console&lt;/em&gt;, &lt;em&gt;Courier&lt;/em&gt;, etc. all have the glyphs for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way in Emacs to force to use the specified fonts even if the default font has the glyphs for them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When coding HTML for Firefox, I have encountered similar situation. I can easily walk around by using the &lt;code&gt;lang=&quot;zh&quot;&lt;/code&gt; attribute in the &lt;code&gt;body&lt;/code&gt; or &lt;code&gt;html&lt;/code&gt; tag to tell the browser the document is in Chinese. Is there an Emacs counterpart?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My environment is Emacs 25.1.1 on Windows 7 (en-US).&lt;/p&gt;&#xA;" OwnerUserId="11507" LastEditorUserId="11507" LastEditDate="2017-01-04T09:42:54.390" LastActivityDate="2017-01-04T09:42:54.390" Title="In Emacs, how do you force using a fallback font?" Tags="|init-file|microsoft-windows|fonts|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29778" PostTypeId="2" ParentId="12383" CreationDate="2017-01-03T18:33:48.543" Score="4" Body="&lt;p&gt;You don't need to unset a key before you rebind it to something else. This should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; create a new prefix map&#xA;(define-prefix-command 'my-keymap)&#xA;;; bind the new keymap to C-e &#xA;(global-set-key &quot;\C-e&quot; my-keymap)&#xA;;; bind the individual commands:&#xA;(define-key my-keymap &quot;e&quot; 'move-end-of-line)&#xA;(define-key my-keymap &quot;r&quot; 'end-of-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now hitting &lt;code&gt;C-e&lt;/code&gt; is a prefix, and &lt;code&gt;C-e e&lt;/code&gt; calls &lt;code&gt;end-of-line&lt;/code&gt; etc. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-03T18:33:48.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29779" PostTypeId="1" AcceptedAnswerId="29781" CreationDate="2017-01-03T18:38:08.280" Score="3" ViewCount="126" Body="&lt;p&gt;I understand that &lt;code&gt;(eq '(3 . d) '(3 . d))&lt;/code&gt; returns &lt;code&gt;nil&lt;/code&gt;, and &lt;code&gt;(eq 3 3)&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt;.  But I do not understand why &lt;code&gt;delq&lt;/code&gt; is deleting one &lt;code&gt;(3 . d)&lt;/code&gt; in the second example each loop when &lt;code&gt;y&lt;/code&gt; is &lt;code&gt;(3 . d)&lt;/code&gt;.  Is &lt;code&gt;mapc&lt;/code&gt; placing some type of invisible symbol on one of the &lt;code&gt;(3 . d)&lt;/code&gt; but not the others such that &lt;em&gt;only&lt;/em&gt; one (1) of them in the sequence is &lt;code&gt;eq&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((original '(0 1 2 3 3 3 3 4 5 6))&#xA;       (copy (copy-list original)))&#xA;  (mapc (lambda (x)&#xA;          (mapc (lambda (y)&#xA;                  (message &quot;y: %s | copy: %s&quot; y copy)&#xA;                  (setq copy (delq y copy)))&#xA;                copy))&#xA;        original))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the second example, one &lt;code&gt;(3 . d)&lt;/code&gt; is deleted each loop when &lt;code&gt;y&lt;/code&gt; is &lt;code&gt;(3 . d)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((original '((0 . a) (1 . b) (2 . c) (3 . d) (3 . d)&#xA;                   (3 . d) (3 . d) (4 . e) (5 . f) (6 . g)))&#xA;       (copy (copy-list original)))&#xA;  (mapc (lambda (x)&#xA;          (mapc (lambda (y)&#xA;                  (message &quot;y: %s | copy: %s&quot; y copy)&#xA;                  (setq copy (delq y copy)))&#xA;                copy))&#xA;        original))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;Note: &lt;code&gt;copy-sequence&lt;/code&gt; is an alternative to &lt;code&gt;copy-list&lt;/code&gt; a.k.a. &lt;code&gt;cl-copy-list&lt;/code&gt; (defined in &lt;code&gt;cl.el&lt;/code&gt;).&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorDisplayName="user19761" LastEditDate="2019-07-09T08:49:36.590" LastActivityDate="2019-07-09T08:49:36.590" Title="Does `mapc` place a symbol on the active element of the sequence?" Tags="|list|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29780" PostTypeId="1" CreationDate="2017-01-03T18:54:02.250" Score="3" ViewCount="395" Body="&lt;p&gt;Right now, my argument lists are indented by &lt;code&gt;js-mode&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_long_function_name( one_argument,&#xA;                         another_argument );&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get them to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_long_function_name( one_argument,&#xA;    another_argument );&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(My &lt;code&gt;c-basic-offset&lt;/code&gt; is already set to 4.)&lt;/p&gt;&#xA;" OwnerUserId="14427" LastActivityDate="2017-08-07T16:50:55.127" Title="Changing how argument lists are indented in JavaScript" Tags="|indentation|javascript|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29781" PostTypeId="2" ParentId="29779" CreationDate="2017-01-03T19:05:02.220" Score="2" Body="&lt;p&gt;I think you basically explained what's going on when you explained the&#xA;&lt;code&gt;eq&lt;/code&gt; business: In the first loop, the first time you hit a &lt;code&gt;3&lt;/code&gt;, &lt;code&gt;delq&lt;/code&gt;&#xA;removes all the &lt;code&gt;3&lt;/code&gt;s, because they are &lt;code&gt;eq&lt;/code&gt; to each other. In the&#xA;second loop, each time you hit a &lt;code&gt;(3 . d)&lt;/code&gt;, the call to &lt;code&gt;delq&lt;/code&gt; removes&#xA;that particular &lt;code&gt;(3 . d)&lt;/code&gt; and not the other &lt;code&gt;(3 . d)&lt;/code&gt; because they are&#xA;not &lt;code&gt;eq&lt;/code&gt; to each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess you want to know how Emacs implements cons cells and &lt;code&gt;eq&lt;/code&gt; to&#xA;make different occurrences of &lt;code&gt;(3 . d)&lt;/code&gt; not be &lt;code&gt;eq&lt;/code&gt; to each other.&#xA;Every time you evaluate a &lt;code&gt;(3 . d)&lt;/code&gt;, Emacs allocates some fresh,&#xA;unused portion of memory for a cons cell and sets the &lt;code&gt;car&lt;/code&gt; to &lt;code&gt;3&lt;/code&gt; and&#xA;the &lt;code&gt;cdr&lt;/code&gt; to &lt;code&gt;d&lt;/code&gt;, for cons cells &lt;code&gt;eq&lt;/code&gt; tests whether or not they are&#xA;stored in the same location in memory (if you are familiar with&#xA;pointers, as they occur in C, for example, you'd say that for cons&#xA;cells &lt;code&gt;eq&lt;/code&gt; performs a pointer equality test). So there's no &quot;extra&#xA;symbol&quot; required to make &lt;code&gt;eq&lt;/code&gt; work that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Strictly speaking to explain the results you also need to know that&#xA;&lt;code&gt;copy-list&lt;/code&gt; allocates new space for the list it returns, but reuses&#xA;exactly the same contents as the input list.)&lt;/p&gt;&#xA;" OwnerUserId="2221" LastEditorUserId="2221" LastEditDate="2017-01-03T19:13:52.153" LastActivityDate="2017-01-03T19:13:52.153" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29782" PostTypeId="2" ParentId="27759" CreationDate="2017-01-03T19:10:25.577" Score="2" Body="&lt;p&gt;The following will prevent messages to email addresses in&#xA;&lt;code&gt;blacklist-addresses&lt;/code&gt; from invoking &lt;code&gt;mml-secure-message-sign&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar blacklist-addresses nil&#xA;  &quot;List of email addresses (as strings) to blacklist for&#xA;  `mml-secure-message-sign'.&quot;)&#xA;&#xA;(defun secure-sign-maybe ()&#xA;  &quot;Use `mml-secure-message-sign' unless the addressee is in the&#xA;`blacklist-addresses'.&quot;&#xA;  (let ((addresses (mapcar (lambda (address)&#xA;                             (when (string-match&#xA;                                    &quot;\\(&amp;lt;?\\)\\([^@&amp;lt; ]+@[^@&amp;gt; ]+\\)\\(&amp;gt;?\\)&quot;&#xA;                                    address)&#xA;                               (match-string 2 address)))&#xA;                           ;; (split-string (message-field-value &quot;To&quot;)&#xA;                           ;;               &quot;,&quot; t &quot;[[:blank:]]+&quot;))))&#xA;                           (split-string (concat (message-field-value &quot;To&quot;)&#xA;                                                 &quot;, &quot;&#xA;                                                 (message-field-value &quot;Cc&quot;))&#xA;                                         &quot;,&quot; t &quot;[[:blank:]]+&quot;))))&#xA;    ;; skip secure signing when an address is blacklisted&#xA;    (unless (delq nil (mapcar (lambda (address)&#xA;                                (car (member address blacklist-addresses)))&#xA;                              addresses))&#xA;      (mml-secure-message-sign))))&#xA;&#xA;(add-hook 'message-send-hook #'secure-sign-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Right now, the code looks for addresses in the &quot;To&quot; and &quot;Cc&quot;&#xA;fields.  If you want it to check only the &quot;To&quot; field, comment out&#xA;the existing call to &lt;code&gt;split-string&lt;/code&gt; and uncomment the commented&#xA;version.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2017-01-04T21:22:30.277" LastActivityDate="2017-01-04T21:22:30.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29783" PostTypeId="1" CreationDate="2017-01-03T19:42:04.940" Score="6" ViewCount="941" Body="&lt;p&gt;I have two simple text files on my &lt;code&gt;D:&lt;/code&gt; drive, as shown below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D:\我.txt&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;D:\你.txt&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After I execute &lt;code&gt;M-x diff&lt;/code&gt; and type the correct filenames (Yes, I can&#xA;input Chinese and filename autocomplete works fine for Chinese), the output&#xA;give the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff -u &quot;d:/我.txt&quot; &quot;d:/你.txt&quot;&#xA;diff: &quot;d:/æˆ‘.txt&quot;: No such file or directory&#xA;diff: &quot;d:/ä½ .txt&quot;: No such file or directory&#xA;&#xA;Diff finished (diff error).  Wed Jan  4 02:13:20 2017&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have MSYS2 installed with &lt;code&gt;diff&lt;/code&gt; residing on &lt;code&gt;D:\msys32\usr\bin\diff.exe&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run Emacs 25.1.1 on Windows 7 (en-US), so the&#xA;&lt;code&gt;w32-unicode-filenames&lt;/code&gt; is set to &lt;code&gt;t&lt;/code&gt;, which means the native Windows&#xA;Unicode APIs is used when passing file names to the OS.  This is good,&#xA;Unicode file names display correctly in &lt;code&gt;dired-mode&lt;/code&gt;, and autocomplete&#xA;for Unicode file names also works seamlessly.  So I suspect that&#xA;Unicode file names only cause problem when creating subprocesses with&#xA;Unicode arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To verify that, I execute &lt;code&gt;M-x shell&lt;/code&gt; and do the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Microsoft Windows [Version 6.1.7601]&#xA;Copyright (c) 2009 Microsoft Corporation.  All rights reserved.&#xA;&#xA;$ cd&#xA;cd&#xA;d:\&#xA;&#xA;$ type 我.txt&#xA;type 我.txt&#xA;The system cannot find the file specified.&#xA;&#xA;$ type 你.txt&#xA;type 你.txt&#xA;The system cannot find the file specified.&#xA;Error occurred while processing: \344\275.&#xA;The system cannot find the file specified.&#xA;Error occurred while processing: .txt.&#xA;&#xA;$ where cat&#xA;where cat&#xA;D:\msys32\usr\bin\cat.exe&#xA;&#xA;$ cat 我.txt&#xA;cat 我.txt&#xA;cat: ''$'\303\246\313\206\342\200\230''.txt': No such file or directory&#xA;&#xA;$ cat 你.txt&#xA;cat 你.txt&#xA;cat: ''$'\303\244\302\275\302\240''.txt': No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Autocomplete for Unicode file name also ceases to work in &lt;code&gt;shell-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I also try similar commands in &lt;code&gt;eshell-mode&lt;/code&gt; invoked by &lt;code&gt;M-x eshell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Welcome to the Emacs shell&#xA;&#xA;d:/ $ which which&#xA;eshell/which is a compiled Lisp function in ‘esh-cmd.el’&#xA;d:/ $ which cat&#xA;eshell/cat is a compiled Lisp function in ‘em-unix.el’&#xA;d:/ $ cat 我.txt&#xA;I&#xA;d:/ $ cat 你.txt&#xA;You&#xA;d:/ $ which ls&#xA;eshell/ls is a compiled Lisp function in ‘em-ls.el’&#xA;d:/ $ ls 我.txt &#xA;我.txt&#xA;d:/ $ ls 你.txt &#xA;你.txt&#xA;d:/ $ which ls.exe&#xA;d:/msys32/usr/bin/ls.exe&#xA;d:/ $ ls.exe 我.txt &#xA;/usr/bin/ls: cannot access ''$'\303\246\313\206\342\200\230''.txt': No such file or directory&#xA;d:/ $ ls.exe 你.txt &#xA;/usr/bin/ls: cannot access ''$'\303\244\302\275\302\240''.txt': No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It almost confirms to me the issue is about the subprocess encoding.&#xA;Calling internal Elisp functions with Unicode arguments works fine but&#xA;calling external executables with Unicode arguments doesn't work.  I&#xA;also experiment with various encoding for subprocess. I set them in my&#xA;init file like this.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq default-process-coding-system '(raw-text-dos . raw-text-unix))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But to no avail, none of my attempts work.&lt;/p&gt;&#xA;" OwnerUserId="11507" LastEditorUserId="11507" LastEditDate="2017-01-03T19:50:07.593" LastActivityDate="2024-03-31T11:03:35.380" Title="Under Windows, Emacs cannot handle encodings correctly for subprocesses, can it?" Tags="|init-file|microsoft-windows|character-encoding|unicode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29784" PostTypeId="2" ParentId="29783" CreationDate="2017-01-03T20:29:57.367" Score="0" Body="&lt;p&gt;This is not an Emacs issue per se. It has to do with the command interpreter default code page. You need to change the &quot;shell&quot; code page to &lt;code&gt;utf8&lt;/code&gt; with &lt;code&gt;chcp 65001&lt;/code&gt;. By default it sets the code page to Latin-1 or CP850 (which I believe are the same).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated answer after doing some more research&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out Emacs has a history of problems with Chinese fonts. There's a mode called &lt;code&gt;chinese-fonts-setup&lt;/code&gt; &lt;a href=&quot;https://github.com/tumashu/chinese-fonts-setup&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; I installed it and that fixed the problem in my machine (I'm running GNU Emacs 24.5.1 (i686-pc-mingw32) on Windows 8.1). BTW install instructions are in Chinese, had to Google Translate + guess&lt;/p&gt;&#xA;" OwnerUserId="14428" LastEditorUserId="14428" LastEditDate="2017-07-05T11:42:18.910" LastActivityDate="2017-07-05T11:42:18.910" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="29785" PostTypeId="1" AcceptedAnswerId="29828" CreationDate="2017-01-03T20:44:38.833" Score="2" ViewCount="287" Body="&lt;p&gt;Recently I was looking for run emacs as daemon in linux, whats give me the oportunity to use org-carture from everywhere in the sistem for example. My first aproach was start it in the init.el file, but the I discover that I can run emacs --daemon in my sistem init, but there is a problem. when I try to exec: &lt;code&gt;emacsclient -ne &quot;(make-capture-frame)&quot;&lt;/code&gt; which open a new frame directly in org-capture I get an error: &lt;code&gt;*ERROR*: Unknown terminal type&lt;/code&gt;, but if I irun server from an emacs instance and not an emacsclient, The function works well so I cant find my mistake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone knows what it's happening?&lt;/p&gt;&#xA;" OwnerUserId="13992" LastActivityDate="2017-03-06T12:49:35.957" Title="Error loading new emacsclient frame" Tags="|frames|emacsclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29786" PostTypeId="1" AcceptedAnswerId="29791" CreationDate="2017-01-03T21:13:28.293" Score="11" ViewCount="11618" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt;  How to remove / delete nth element of a list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CAVEAT&lt;/strong&gt;:  Do &lt;strong&gt;not&lt;/strong&gt; remove all occurrences / members matching nth element -- e.g., &lt;code&gt;eq&lt;/code&gt; or &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;:  Remove the 17th element of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(a b c d e f g h i j k l m n o p q r s t u v w x y z)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;nth ELEMENT -- CHEAT SHEET / LEGEND&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;element 0:   a&#xA;element 1:   b&#xA;element 2:   c&#xA;element 3:   d&#xA;element 4:   e&#xA;element 5:   f&#xA;element 6:   g&#xA;element 7:   h&#xA;element 8:   i&#xA;element 9:   j&#xA;element 10:  k&#xA;element 11:  l&#xA;element 12:  m&#xA;element 13:  n&#xA;element 14:  o&#xA;element 15:  p&#xA;element 16:  q&#xA;element 17:  r&#xA;element 18:  s&#xA;element 19:  t&#xA;element 20:  u&#xA;element 21:  v&#xA;element 22:  w&#xA;element 23:  x&#xA;element 24:  y&#xA;element 25:  z&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2020-04-11T21:24:47.143" Title="How to remove / delete nth element of a list" Tags="|list|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29788" PostTypeId="1" CreationDate="2017-01-03T21:18:50.727" Score="2" ViewCount="127" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/swiper#swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;Swiper&lt;/a&gt; creates a minibuffer many lines in height.  This height is borrowed equally from my existing, vertically-arranged, windows.  When Swiper is dismissed, this space is recovered by the windows and they all grow slightly, moving down the screen as they do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The consequence of this is that the text that I've just searched for jumps down the screen.  I find this jarring, and would like to prevent it from happening.  Any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation suggests that setting &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Recombining-Windows.html#index-window_002dcombination_002dresize&quot; rel=&quot;nofollow noreferrer&quot;&gt;window-combination-resize&lt;/a&gt; to &lt;code&gt;nil&lt;/code&gt; should do what I want, but this is already set to &lt;code&gt;nil&lt;/code&gt;; it seems that either this doesn't apply to minibuffers, or something is preventing it from taking effect in this case.&lt;/p&gt;&#xA;" OwnerUserId="14429" LastEditorUserId="105" LastEditDate="2017-01-03T23:33:21.100" LastActivityDate="2017-01-04T12:37:04.600" Title="Prevent text jumping up the screen when dismissing Swiper" Tags="|window|minibuffer|window-splitting|swiper|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29789" PostTypeId="2" ParentId="29786" CreationDate="2017-01-03T21:30:05.200" Score="3" Body="&lt;p&gt;Here's a simple function to remove the nth element from a list:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-nth (n list)&#xA;  &quot;Remove the nth element of a list.&quot;&#xA;  (if (&amp;gt; n (length list))&#xA;      list&#xA;    (append (cl-subseq list 0 n)&#xA;            (cl-subseq list (1+ n)))))&#xA;&#xA;(setq test-list '(a b c d e))&#xA;(remove-nth 3 test-list)                ; =&amp;gt; (a b c e)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Two notes: it requires &lt;code&gt;cl-lib&lt;/code&gt;, and it's not terribly efficient,&#xA;as it walks through the list a few times.  The latter is probably&#xA;only noticeable for long lists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are destructive and non-destructive versions that don't&#xA;require &lt;code&gt;cl-lib&lt;/code&gt; (again, not terribly efficient):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun delete-nth (n list)&#xA;  &quot;Delete the nth element of a list (destructive).&quot;&#xA;  (if (&amp;gt;= n (length list))&#xA;      list&#xA;    (setf (nthcdr n list) (nthcdr (1+ n) list))))&#xA;&#xA;(defun remove-nth (n list)&#xA;  &quot;Remove the nth element of a list.&quot;&#xA;  (if (&amp;gt;= n (length list))&#xA;      list&#xA;    (let ((list (copy-tree list)))&#xA;      (setf (nthcdr n list) (nthcdr (1+ n) list))&#xA;      list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2017-01-03T21:49:22.127" LastActivityDate="2017-01-03T21:49:22.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29790" PostTypeId="2" ParentId="29780" CreationDate="2017-01-03T21:37:17.917" Score="1" Body="&lt;p&gt;This isn't quite what you're looking for, but you can get &lt;code&gt;another_argument&lt;/code&gt; to be where you want by putting a newline before &lt;code&gt;one_argument&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some_long_function_name( &#xA;    one_argument,&#xA;    another_argument&#xA;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14429" LastActivityDate="2017-01-03T21:37:17.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29791" PostTypeId="2" ParentId="29786" CreationDate="2017-01-03T21:38:53.673" Score="9" Body="&lt;p&gt;Well, here's a destructive version I'd be happy with:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-nth-element (nth list)&#xA;  (if (zerop nth) (cdr list)&#xA;    (let ((last (nthcdr (1- nth) list)))&#xA;      (setcdr last (cddr last))&#xA;      list)))&#xA;&#xA;(remove-nth-element 0 (list 1 2 3 4 5))&#xA;(2 3 4 5)&#xA;&#xA;(remove-nth-element 1 (list 1 2 3 4 5))&#xA;(1 3 4 5)&#xA;&#xA;(remove-nth-element 2 (list 1 2 3 4 5))&#xA;(1 2 4 5)&#xA;&#xA;(remove-nth-element 3 (list 1 2 3 4 5))&#xA;(1 2 3 5)&#xA;&#xA;(remove-nth-element 4 (list 1 2 3 4 5))&#xA;(1 2 3 4)&#xA;&#xA;(remove-nth-element 5 (list 1 2 3 4 5))&#xA;(1 2 3 4 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="563" LastActivityDate="2017-01-03T21:38:53.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29792" PostTypeId="2" ParentId="29733" CreationDate="2017-01-03T22:06:03.487" Score="3" Body="&lt;p&gt;Solved it by myself. Just needed to add the following lines to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;term&quot;&#xA;  '(progn&#xA;     ;; ensure that scrolling doesn't break on output&#xA;     (setq term-scroll-to-bottom-on-output t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2017-01-03T22:06:03.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29793" PostTypeId="2" ParentId="29786" CreationDate="2017-01-03T22:12:37.173" Score="3" Body="&lt;p&gt;Here is another non-destructive version which uses &lt;code&gt;cl-loop&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun remove-nth-element (nth list)&#xA;  &quot;Return a copy of a LIST, with NTH element removed.&quot;&#xA;  (loop for i in list&#xA;        for idx from 0&#xA;        unless (= idx nth)&#xA;        collect i))&#xA;     ⇒ remove-nth-element&#xA;&#xA;(remove-nth-element 0 (list 1 2 3 4 5))&#xA;     ⇒ (2 3 4 5)&#xA;&#xA;(remove-nth-element 1 (list 1 2 3 4 5))&#xA;     ⇒ (1 3 4 5)&#xA;&#xA;(remove-nth-element 2 (list 1 2 3 4 5))&#xA;     ⇒ (1 2 4 5)&#xA;&#xA;(remove-nth-element 3 (list 1 2 3 4 5))&#xA;     ⇒ (1 2 3 5)&#xA;&#xA;(remove-nth-element 4 (list 1 2 3 4 5))&#xA;     ⇒ (1 2 3 4)&#xA;&#xA;(remove-nth-element 5 (list 1 2 3 4 5))&#xA;     ⇒ (1 2 3 4 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-01-03T22:12:37.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29795" PostTypeId="1" CreationDate="2017-01-03T22:45:57.780" Score="1" ViewCount="187" Body="&lt;p&gt;I want to cycle through the org-agenda-files who's value is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-agenda-files is a variable defined in ‘org.el’.&#xA;Its value is (&quot;/home/jenia/Documents/org/&quot;)&#xA;Original value was nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I press &lt;code&gt;C-'&lt;/code&gt; I'm only taken to the very first (alphabetically) file in that dir.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I cycle through all the files in the dir?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the dir contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  -rw-r--r--  1 jenia jenia    965 10-02 20:03 arch.org&#xA;  -rw-r--r--  1 jenia jenia   2000 10-15 18:00 bash.org&#xA;  -rw-r--r--  1 jenia jenia    412 2016-04-03  calc.org&#xA;   ....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8306" LastEditorUserId="105" LastEditDate="2017-01-03T23:32:38.623" LastActivityDate="2017-01-03T23:32:38.623" Title="org-agenda-files is a dir, but can't cycle" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29796" PostTypeId="1" AcceptedAnswerId="29817" CreationDate="2017-01-03T23:42:04.987" Score="0" ViewCount="97" Body="&lt;p&gt;A strange thing happens when editing source blocks within an extra buffer with &lt;kbd&gt;C-c '&lt;/kbd&gt;: the face of just this source block changes upon returning, i.e. the face settings are not used any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/G6CIB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/G6CIB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PDlwC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PDlwC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 25.1 with org-mode 8.2.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could be causing this?&lt;/p&gt;&#xA;" OwnerUserId="12336" LastActivityDate="2017-01-04T21:22:16.380" Title="Face of org-mode source block changes when returning from edit buffer" Tags="|org-mode|org-babel|faces|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29797" PostTypeId="1" AcceptedAnswerId="29809" CreationDate="2017-01-04T00:20:15.553" Score="1" ViewCount="880" Body="&lt;p&gt;I want to create both PDF and HTML figures using Tikz for both purposes. I am doing as it is explained in &lt;a href=&quot;https://stackoverflow.com/questions/7467870/org-mode-html-export&quot;&gt;here&lt;/a&gt;, answer of nberth.&#xA;To do this, I installed imagemagick for windows because this solution uses imagemagick's  convert tool. But I think Windows version of imagemagick does not include convert tool and even if it did, convert is a Windows file system utility. So I can't get SVG outputs working in Windows. Has anyone achieved this on Windows? What would you suggest. &lt;/p&gt;&#xA;" OwnerUserId="11312" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-01-04T12:02:53.723" Title="svg pictures from tikz in html export in windows" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29798" PostTypeId="2" ParentId="12464" CreationDate="2017-01-04T02:11:58.963" Score="5" Body="&lt;p&gt;With respect to a &quot;proper API&quot;, I think the short answer, at present, is &quot;no&quot; -- unless you are willing to rely on an external library. &lt;code&gt;url-http-end-of-headers&lt;/code&gt; seems to be as good as it gets, although it isn't mentioned in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/url.html&quot; rel=&quot;noreferrer&quot;&gt;URL Programmer's Manual&lt;/a&gt; nor does it appear to be documented in &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/url/url-http.el&quot; rel=&quot;noreferrer&quot;&gt;emacs source&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3995" LastActivityDate="2017-01-04T02:11:58.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29799" PostTypeId="1" AcceptedAnswerId="29803" CreationDate="2017-01-04T02:30:18.567" Score="6" ViewCount="283" Body="&lt;p&gt;Trying to utilize a small screen, and I did this once before, so I know it's possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to hide the username in magit-log so that only the commit message is visible?&lt;/p&gt;&#xA;" OwnerUserId="13116" LastActivityDate="2017-01-04T03:37:14.040" Title="How to hide the username in magit-log?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29800" PostTypeId="2" ParentId="29701" CreationDate="2017-01-04T02:34:03.870" Score="1" Body="&lt;p&gt;In my opinion, your two examples look like the same algorithm but comparing with different keys. In the first example, the elements of the outer list are being compared to each other directly while in the second, the car's of the elements are being compared.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can handle both cases using a group-by operation with the proper key and a little post-processing. Vanilla Emacs has an implementation in seq.el.  There's also one in dash.el and it's easy enough to implement yourself by using a hash table. We'll use our own implementation here.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'cl)&#xA;(require 'subr-x)&#xA;&#xA;(defun lex&amp;lt; (list list2)&#xA;  (cond&#xA;   ((null list) nil)&#xA;   ((&amp;lt; (car list) (car list2))&#xA;    t)&#xA;   ((= (car list) (car list2))&#xA;    (lex&amp;lt; (cdr list) (cdr list2)))))&#xA;&#xA;(defun reorder-date (date)&#xA;  (list (caddr date) (car date) (cadr date)))&#xA;&#xA;(defun date&amp;lt; (date date2)&#xA;  (lex&amp;lt; (reorder-date date) (reorder-date date2)))&#xA;&#xA;(defun group-by (key-fn list)&#xA;  (let ((groups (make-hash-table :test 'equal))&#xA;        grouped-list)&#xA;    (dolist (x list)&#xA;      (setf (gethash (funcall key-fn x) groups)&#xA;            (cons x (gethash (funcall key-fn x) groups))))&#xA;    (dolist (key (hash-table-keys groups))&#xA;      (push (reverse (gethash key groups)) grouped-list))&#xA;    grouped-list))&#xA;&#xA;(defun unwrap-singleton (x)&#xA;  (if (and (consp x)&#xA;           (null (cdr x)))&#xA;      (car x)&#xA;    x))&#xA;&#xA;(defun group-dates (key-fn list)&#xA;  (mapcar 'unwrap-singleton (sort (group-by key-fn list)&#xA;                                  (lambda (x y)&#xA;                                    (date&amp;lt; (funcall key-fn (car x))&#xA;                                           (funcall key-fn (car y)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then handle your examples like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(group-dates 'identity '((12 1 2016)&#xA;                         (12 2 2016)&#xA;                         (12 3 2016)&#xA;                         (12 1 2016)&#xA;                         (12 4 2016)&#xA;                         (12 5 2016)&#xA;                         (12 1 2016)))&#xA;&#xA;(group-dates 'car '(((12 1 2016) (&quot;foo string&quot; . foo-symbol))&#xA;                    ((12 6 2016) (&quot;bar string&quot; . bar-symbol))&#xA;                    ((12 3 2016) (&quot;baz string&quot; . baz-symbol))&#xA;                    ((12 6 2016) (&quot;doe string&quot; . doe-symbol))&#xA;                    ((12 4 2016) (&quot;roe string&quot; . roe-symbol))&#xA;                    ((12 5 2016) (&quot;moe string&quot; . moe-symbol))&#xA;                    ((12 6 2016) (&quot;joe string&quot; . joe-symbol))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's also possible to write a more general key function that works for both examples, but it's hard to write one that isn't arbitrary without knowing more about the context.&lt;/p&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="7146" LastEditDate="2017-01-05T08:56:07.973" LastActivityDate="2017-01-05T08:56:07.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29801" PostTypeId="1" AcceptedAnswerId="29805" CreationDate="2017-01-04T02:43:09.253" Score="0" ViewCount="198" Body="&lt;p&gt;Today when reviewing changes to my .emacs.d before committing, I noticed a file called &lt;code&gt;tramp&lt;/code&gt;. The contents of this file are as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- emacs-lisp -*- &amp;lt;16/12/28 15:56:06 /home/ethan/.emacs.d/tramp&amp;gt;&#xA;;; Tramp connection history.  Don't change this file.&#xA;;; You can delete it, forcing Tramp to reapply the checks.&#xA;&#xA;(([&quot;scp&quot; nil &quot;fcp&quot; nil nil]&#xA;  nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am curious how/why this file was created. I can see from &lt;a href=&quot;https://www.gnu.org/software/tramp/#Connection-caching&quot; rel=&quot;nofollow noreferrer&quot;&gt;the documentation&lt;/a&gt; what this file does, and how to disable the creation of the file, but I am wondering why it has suddenly appeared since I have never used &lt;code&gt;tramp&lt;/code&gt;, and have never seen this file generated before.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2017-01-04T04:50:55.393" Title="Tramp connection history mysteriously appearing in .emacs.d" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29802" PostTypeId="2" ParentId="29701" CreationDate="2017-01-04T02:53:13.533" Score="1" Body="&lt;p&gt;Here's my attempt. I split it up into several little functions to show the steps.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-list-to-sortable-date (date-list)&#xA;  (string-to-number&#xA;   (format &quot;%d%02d%02d&quot; (nth 2 date-list) (nth 0 date-list) (nth 1 date-list))))&#xA;&#xA;(defun my-sort-predicate (a b)&#xA;  (let ((a-dt (my-list-to-sortable-date (car a)))&#xA;        (b-dt (my-list-to-sortable-date (car b))))&#xA;    (&amp;lt;= a-dt b-dt)))&#xA;&#xA;(defun my-unwrap-singles (list)&#xA;  (if (&amp;gt; (length list) 1) list (car list)))&#xA;&#xA;(defun my-sort-and-collect (list)&#xA;  (let* ((sorted (sort list #'my-sort-predicate))&#xA;         (res (list (list (car sorted))))&#xA;         (last-key (caar sorted)))&#xA;    (dolist (curr (cdr sorted))&#xA;      (let* ((curr-key (car curr)))&#xA;        (if (equal curr-key last-key)&#xA;            (push curr (car res))&#xA;          (push (list curr) res))&#xA;        (setq last-key curr-key)))&#xA;    (nreverse (mapcar #'my-unwrap-singles res))))&#xA;&#xA;(let ((my-list '(((12 1 2016) (&quot;foo string&quot; . foo-symbol))&#xA;                 ((12 6 2016) (&quot;bar string&quot; . bar-symbol))&#xA;                 ((12 3 2016) (&quot;baz string&quot; . baz-symbol))&#xA;                 ((12 6 2016) (&quot;doe string&quot; . doe-symbol))&#xA;                 ((12 4 2016) (&quot;roe string&quot; . roe-symbol))&#xA;                 ((12 5 2016) (&quot;moe string&quot; . moe-symbol))&#xA;                 ((12 6 2016) (&quot;joe string&quot; . joe-symbol)))))&#xA;  (my-sort-and-collect my-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-01-04T02:53:13.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29803" PostTypeId="2" ParentId="29799" CreationDate="2017-01-04T03:24:43.057" Score="6" Body="&lt;p&gt;You can hide the margin by calling &lt;code&gt;magit-toggle-margin&lt;/code&gt;&#xA;(&lt;kbd&gt;LL&lt;/kbd&gt; as of verion 2.9.0, &lt;kbd&gt;Lt&lt;/kbd&gt; previously).  To&#xA;change the default visibility, you can customize &lt;code&gt;magit-log-margin&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Documentation:&#xA;Format of the margin in ‘magit-log-mode’ buffers.&#xA;&#xA;The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).&#xA;&#xA;If INIT is non-nil, then the margin is shown initially.&#xA;STYLE controls how to format the committer date.  It can be one&#xA;  of ‘age’ (to show the age of the commit), ‘age-abbreviated’ (to&#xA;  abbreviate the time unit to a character), or a string (suitable&#xA;  for ‘format-time-string’) to show the actual date.&#xA;WIDTH controls the width of the margin.  This exists for forward&#xA;  compatibility and currently the value should not be changed.&#xA;AUTHOR controls whether the name of the author is also shown by&#xA;  default.&#xA;AUTHOR-WIDTH has to be an integer.  When the name of the author&#xA;  is shown, then this specifies how much space is used to do so.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;customize-apropos&lt;/code&gt; with &quot;magit margin&quot; will show a list of&#xA;the other margin-related options.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2017-01-04T03:37:14.040" LastActivityDate="2017-01-04T03:37:14.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29804" PostTypeId="2" ParentId="29786" CreationDate="2017-01-04T03:44:46.233" Score="3" Body="&lt;p&gt;Here's an answer using just recursion. First we check to see if the list is empty, in which case we return the empty list. Then we check to see if we are removing the 0&lt;sup&gt;th&lt;/sup&gt; element of the list, in which case all we want is the &lt;code&gt;cdr&lt;/code&gt; of the list. If we haven't hit one of those base cases, we recur by removing the n-1&lt;sup&gt;th&lt;/sup&gt; element of the &lt;code&gt;cdr&lt;/code&gt; of the list, and then &lt;code&gt;cons&lt;/code&gt; the &lt;code&gt;car&lt;/code&gt; of the original list onto the result from the recursive call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should be very efficient. Runs in linear time.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun remove-nth-element (nth list)&#xA;  (cond&#xA;   ((equal nil list) list)&#xA;   ((zerop nth) (cdr list))&#xA;   (t (cons (car list)&#xA;            (remove-nth-element (- nth 1)&#xA;                                (cdr list))))))&#xA;&#xA;;; Examples:&#xA;(remove-nth-element 5 '(0 1 2 3 4 5 6 7))&#xA;  ;; '(0 1 2 3 4 6 7)&#xA;(remove-nth-element 9 '(0 1 2 3 4 5 6 7))&#xA;  ;; '(0 1 2 3 4 5 6 7)&#xA;(remove-nth-element 0 '(0 1 2 3 4 5 6 7))&#xA;  ;; '(1 2 3 4 5 6 7)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14432" LastActivityDate="2017-01-04T03:44:46.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29805" PostTypeId="2" ParentId="29801" CreationDate="2017-01-04T04:40:02.907" Score="1" Body="&lt;p&gt;Loading &lt;code&gt;tramp-cache&lt;/code&gt; causes this to happen:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless noninteractive&#xA;  (add-hook 'kill-emacs-hook 'tramp-dump-connection-properties))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(which writes that file when emacs exits.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Undoubtedly &lt;code&gt;tramp-cache&lt;/code&gt; &lt;em&gt;was&lt;/em&gt; loaded, either unwittingly by yourself, or by some other library that you use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That particular library is loaded automatically by other tramp functionality, so most likely something else triggered it indirectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if you don't mean to use the functionality, it's not particularly difficult to trigger tramp by accidentally typing a filename with a tramp handler. Emacs won't know it was a typo, after all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Or maybe you only &lt;em&gt;think&lt;/em&gt; you don't use tramp? Perhaps you've used &lt;code&gt;/sudo::/path/to/file&lt;/code&gt; to edit a system file, for instance?)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-01-04T04:50:55.393" LastActivityDate="2017-01-04T04:50:55.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29806" PostTypeId="2" ParentId="29775" CreationDate="2017-01-04T04:55:40.063" Score="3" Body="&lt;p&gt;The default for Babel results blocks (in most languages) is try to&#xA;guess what the best format is. Here Babel seems to be guessing&#xA;incorrectly that the output of your block is tabular data. You can use&#xA;&lt;code&gt;:results verbatim&lt;/code&gt; to tell Babel that the result should be treated as&#xA;literal text. (There is also &lt;code&gt;:results table&lt;/code&gt; to force the results to&#xA;be in a table.)&lt;/p&gt;&#xA;" OwnerUserId="2221" LastActivityDate="2017-01-04T04:55:40.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29807" PostTypeId="1" CreationDate="2017-01-04T09:21:15.077" Score="1" ViewCount="57" Body="&lt;p&gt;Sample file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* hello&#xA;* goodbye&#xA;* some source&#xA;#+BEGIN_SRC ipython :session :file py224158lK.png :exports code&#xA;  print (&quot;this will not work&quot;)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The text in this file will yield error `No output was produced to write to a file' when I attempt to export it to any format (org-export-as-html, org-export-to-markdown, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is incredibly frustrating, because, not only can I not figure out what I've done to cause this failure (this used to work), but this is the worst possible moment for this error. Why might this be failing here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relevant: If the &lt;code&gt;*some source&lt;/code&gt; header is removed, the code does export to file successfully,. In fact, the file seemingly successfully exports so long as the &lt;code&gt;:file&lt;/code&gt; specification is not included.&lt;/p&gt;&#xA;" OwnerUserId="6554" LastActivityDate="2017-01-04T09:21:15.077" Title="org export: &quot;no output was produced to write to file&quot;" Tags="|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29808" PostTypeId="2" ParentId="29786" CreationDate="2017-01-04T10:31:02.220" Score="4" Body="&lt;p&gt;&lt;code&gt;setcar&lt;/code&gt; returns NEWCAR, which is an uninterned symbol &lt;code&gt;G&amp;lt;N&amp;gt;&lt;/code&gt; deleted with &lt;code&gt;delq&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((l '(1 2 3 4 5 6 7)))&#xA;  (delq (setcar (nthcdr 5 l) (gensym)) l)) ;⇒ (1 2 3 4 5 7)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may also use &lt;code&gt;nil&lt;/code&gt; for example as NEWCAR when there are no nil values in the list.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2017-01-04T10:36:08.927" LastActivityDate="2017-01-04T10:36:08.927" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29809" PostTypeId="2" ParentId="29797" CreationDate="2017-01-04T12:02:53.723" Score="2" Body="&lt;p&gt;Here is what I did to resolve the issue, I went for doing things with PNG rather than SVG:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First we are going to use Imagemagick to convert from PDF to SVG or PNG. For this purposes, Imagemagick uses &lt;code&gt;gswin32c&lt;/code&gt; on Windows which comes when you install Ghostscript. So firts install these two programs and add their executable directories to your PATH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Windows, the program Imagemagick uses for conversion is called &lt;code&gt;magick&lt;/code&gt;, not &lt;code&gt;convert&lt;/code&gt;. Org-mode assumes it is &lt;code&gt;convert&lt;/code&gt; by default. We need to change this. Open &lt;code&gt;ob-latex.el&lt;/code&gt;which you can find under your Emacs installation or your .emacsd folder. There you will find a function definition like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun convert-pdf (pdffile out-file im-in-options im-out-options)&#xA;    &quot;Generate a file from a pdf file using imagemagick.&quot;&#xA;     (let ((cmd (concat &quot;convert &quot; im-in-options &quot; &quot; pdffile &quot; &quot;&#xA;            im-out-options &quot; &quot; out-file)))&#xA;     (message (concat &quot;Converting pdffile file &quot; cmd  &quot;...&quot;))&#xA;     (shell-command cmd)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Change the &lt;code&gt;&quot;convert &quot;&lt;/code&gt; part into &lt;code&gt;&quot;magick &quot;&lt;/code&gt;. This should now work. For example, I have folowing Tikz picture in my org-file.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: fsa&#xA;#+HEADER: :iminoptions -density 300 &#xA;#+HEADER: :imoutoptions -resize 240x360 &#xA;#+HEADER: :file (by-backend (latex &quot;./img/fsa.png&quot;) (t &quot;./img/fsa.png&quot;))&#xA;#+BEGIN_SRC latex :results raw file&#xA;  \usetikzlibrary{trees}&#xA;  \begin{tikzpicture}&#xA;    \node [circle, draw, fill=red!20] at (-3,0) {1}&#xA;     child { node [circle, draw, fill=blue!30] {2}&#xA;     child { node [circle, draw, fill=green!30] {3} }&#xA;     child { node [circle, draw, fill=yellow!30] {4} }};&#xA;  \end{tikzpicture}&#xA;#+END_SRC&#xA;&#xA;#+CAPTION: An FSA drawing&#xA;#+BEGIN_marginfig&#xA;  #+ATTR_LaTeX: :width 0.6 \marginparwidth&#xA;  #+RESULTS: fsa&#xA;#+END_marginfig&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I call export, this will embed &lt;code&gt;fsa.png&lt;/code&gt; into my document. I first call HTML export because that what's creating PNG from the Tikz code. Then if I export to Latex after, that PNG file is included in &lt;code&gt;\includegraphics&lt;/code&gt;. &lt;code&gt;marginfig&lt;/code&gt; is a special block I defined for margin figures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hardcoded nature of &lt;code&gt;convert&lt;/code&gt; program may be patched to handle OS nuances by org developers. For now, this is the fastest solution I have found.&lt;/p&gt;&#xA;" OwnerUserId="11312" LastActivityDate="2017-01-04T12:02:53.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29811" PostTypeId="1" CreationDate="2017-01-04T14:29:35.870" Score="2" ViewCount="137" Body="&lt;p&gt;I've had my emacs (v. 25.1.1) working with elpy (1.13) under Python 2.7 for a while.  I decided to switch to Python 3 recently, and cannot get it to interact with emacs properly.  Normally, when I want to run a script in emacs I C-c C-c, which opens an ipython interpreter.  Since switching to Python3, the ipython interpreter still opens, but with problems.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I get the following backtrace error:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range &quot;Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) &#xA;Type \&quot;copyright\&quot;, \&quot;credits\&quot; or \&quot;license\&quot; for more information.&#xA;&#xA;IPython 5.1.0 -- An enhanced Interactive Python.&#xA;?         -&amp;gt; Introduction and overview of IPython's features.&#xA;%quickref -&amp;gt; Quick reference.&#xA;help      -&amp;gt; Python's own help system.&#xA;object?   -&amp;gt; Details about 'object', use 'object??' for extra details.&#xA;&#xA;[6n[0m&#xA;[0m[J&#xA;&quot; 427)&#xA;  string-match(&quot;&quot; &quot;Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \&quot;copyright\&quot;, \&quot;credits\&quot; or \&quot;license\&quot; for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -&amp;gt; Introduction and overview of IPython's features.\n%quickref -&amp;gt; Quick reference.\nhelp      -&amp;gt; Python's own help system.\nobject?   -&amp;gt; Details about 'object', use 'object??' for extra details.\n\n[6n[0m&#xA;[0m[J&#xA;&quot; 427)&#xA;  ansi-color-filter-apply(&quot;Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \&quot;copyright\&quot;, \&quot;credits\&quot; or \&quot;license\&quot; for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -&amp;gt; Introduction and overview of IPython's features.\n%quickref -&amp;gt; Quick reference.\nhelp      -&amp;gt; Python's own help system.\nobject?   -&amp;gt; Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m&#xA;[0m[J&#xA;[?12l[?25h&quot;)&#xA;  python-shell-comint-watch-for-first-prompt-output-filter(&quot;Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \&quot;copyright\&quot;, \&quot;credits\&quot; or \&quot;license\&quot; for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -&amp;gt; Introduction and overview of IPython's features.\n%quickref -&amp;gt; Quick reference.\nhelp      -&amp;gt; Python's own help system.\nobject?   -&amp;gt; Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m&#xA;[0m[J&#xA;[?12l[?25h&quot;)&#xA;  run-hook-with-args(python-shell-comint-watch-for-first-prompt-output-filter &quot;Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \&quot;copyright\&quot;, \&quot;credits\&quot; or \&quot;license\&quot; for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -&amp;gt; Introduction and overview of IPython's features.\n%quickref -&amp;gt; Quick reference.\nhelp      -&amp;gt; Python's own help system.\nobject?   -&amp;gt; Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m&#xA;[0m[J&#xA;[?12l[?25h&quot;)&#xA;  comint-output-filter(#&amp;lt;process Python&amp;gt; &quot;Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \nType \&quot;copyright\&quot;, \&quot;credits\&quot; or \&quot;license\&quot; for more information.\n\nIPython 5.1.0 -- An enhanced Interactive Python.\n?         -&amp;gt; Introduction and overview of IPython's features.\n%quickref -&amp;gt; Quick reference.\nhelp      -&amp;gt; Python's own help system.\nobject?   -&amp;gt; Details about 'object', use 'object??' for extra details.\n\n[?1l[6n[?2004h[?25l[?7l[0m&#xA;[0m[J&#xA;[?12l[?25h&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;The ipython interpreter looks &quot;funky&quot; as well.  Normally, line numbers would show up as:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In  [1]: 7/9&#xA;&#xA;Out [1]: 0.77777777777777778&#xA;&#xA;In  [2]:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I get something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[6n[JIn [2]: [8D[8C7/9&#xA;&#xA;[8D[JIn [2]: 7/9[11D&#xA;&#xA;[JOut[2]: 0.7777777777777778&#xA;&#xA;[6n[JIn [3]: [8D[8C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the life of me I cannot figure out why the ipython interpreter is so hosed.  Any help will be appreciated.  &lt;/p&gt;&#xA;" OwnerUserId="13395" LastEditorUserId="253" LastEditDate="2017-01-04T15:18:51.767" LastActivityDate="2017-01-04T15:18:51.767" Title="Lisp error with elpy under Python 3" Tags="|ipython|elpy|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29812" PostTypeId="1" AcceptedAnswerId="29818" CreationDate="2017-01-04T15:36:58.877" Score="4" ViewCount="409" Body="&lt;p&gt;I have several strings in my org file, which look like as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;something&lt;/li&gt;&#xA;&lt;li&gt;something else&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When I org-export this file to html, these strings are automatically converted to lists, starting with 1. How to prevent that and export literal strings? Better with some specific #+OPTION or something like that. And how to disable offsets and padding for such strings?&lt;/p&gt;&#xA;" OwnerUserId="14438" LastActivityDate="2017-01-05T18:31:58.133" Title="How to org-export literal list?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29813" PostTypeId="1" AcceptedAnswerId="29823" CreationDate="2017-01-04T16:27:49.390" Score="6" ViewCount="274" Body="&lt;p&gt;I've read &lt;a href=&quot;https://emacs.stackexchange.com/questions/10949/what-is-inhibit-point-motion-hooks&quot;&gt;What is inhibit-point-motion-hooks?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume some minor-mode &lt;code&gt;my-mode&lt;/code&gt; that wants to do point-motion-y&#xA;things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume &lt;code&gt;my--point-entered&lt;/code&gt; and &lt;code&gt;my--point-left&lt;/code&gt; functions that work&#xA;fine in Emacs &amp;lt; 25, when &lt;code&gt;my-mode&lt;/code&gt; sets &lt;code&gt;point-entered&lt;/code&gt; and&#xA;&lt;code&gt;point-left&lt;/code&gt; props to use them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume I'd like to have the mode keep working on Emacs &amp;lt; 25, but also&#xA;do the right thing if it finds itself on 25+. What is the right thing&#xA;to do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could &lt;code&gt;(setq-local inhibit-point-motion-hooks nil)&lt;/code&gt; and call it a day. But that var is described as &quot;obsolete&quot;, which seems stronger than&#xA;&quot;deprecated&quot;. So that seems like not the right thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the following a good template to use instead?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; When mode is enabled&#xA;(when (fboundp 'cursor-sensor-mode)&#xA;  (cursor-sensor-mode 1))&#xA;&#xA;;; When mode is disabled&#xA;(when (fboundp 'cursor-sensor-mode)&#xA;  (cursor-sensor-mode -1))&#xA;&#xA;(defun my--cursor-sensor-function (window old dir)&#xA;  (let ((new (window-point window))) ;is this correct ???&#xA;    (pcase dir&#xA;      (`entered (my--point-entered old new))&#xA;      (`left    (my--point-left    old new)))))&#xA;;; where my--point-* are existing point motion functions&#xA;&#xA;;; Where the props are added:&#xA;(let ((motion-props (if (fboundp 'cursor-sensor-mode)&#xA;                              (list 'cursor-sensor-functions&#xA;                                    (list #'my--cursor-sensor-function))&#xA;                            (list 'point-entered #'my--point-entered&#xA;                                  'point-left    #'my--point-left))))&#xA;  (add-text-properties beg&#xA;                       end&#xA;                       (append (list 'some-other-prop some-val)&#xA;                               motion-props)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or if that's not a good approach, what is the recommended way to work&#xA;with both older and newer versions of Emacs?&lt;/p&gt;&#xA;" OwnerUserId="849" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-06-20T15:59:10.057" Title="Point motion strategy for Emacs 25 and older" Tags="|motion|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29816" PostTypeId="1" AcceptedAnswerId="29821" CreationDate="2017-01-04T20:21:56.913" Score="4" ViewCount="1162" Body="&lt;p&gt;The code below is an org-mode file that will not load &lt;code&gt;by-backend&lt;/code&gt;. But if I put the org code block &lt;code&gt;setup&lt;/code&gt; anywhere else besides under &lt;code&gt;* COMMENT&lt;/code&gt; it does run and &lt;code&gt;(fbound 'by-backend)&lt;/code&gt; gives &lt;code&gt;t&lt;/code&gt;. What is it about &lt;code&gt;COMMENT&lt;/code&gt; that blocks local variable from doing &lt;code&gt;setup&lt;/code&gt; upon loading the org file? I'm in org-mode 9.0.2 from elpa and Emacs 25.1.1.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* COMMENT&#xA;  #+name: setup&#xA;  #+begin_src emacs-lisp :results silent :exports none&#xA;  ;; (setq org-babel-latex-htlatex &quot;htlatex&quot;)&#xA;  (defmacro by-backend (&amp;amp;rest body)&#xA;    `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))&#xA;  #+end_src&#xA;&#xA;  # Local variables:&#xA;  # eval: (org-sbe &quot;setup&quot;)&#xA;  # End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2017-01-05T02:14:08.143" Title="Org-mode COMMENT blocks local variable eval?" Tags="|org-mode|file-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29817" PostTypeId="2" ParentId="29796" CreationDate="2017-01-04T21:22:16.380" Score="0" Body="&lt;p&gt;I was able to remedy this issue simply through upgrading org-mode to version 9.0.3. So there's probably a bug in 8.2.10.&lt;/p&gt;&#xA;" OwnerUserId="12336" LastActivityDate="2017-01-04T21:22:16.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29818" PostTypeId="2" ParentId="29812" CreationDate="2017-01-04T22:02:38.700" Score="2" Body="&lt;p&gt;To export literal text you'll need to use the &lt;a href=&quot;http://orgmode.org/manual/Literal-examples.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;literal example&lt;/a&gt; syntax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Original text&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;5. something&#xA;6. something else&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Literal Example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_EXAMPLE&#xA; 5. something&#xA; 6. something else&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exports to HTML as &lt;code&gt;PRE&lt;/code&gt; tags&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;lt;pre class=&quot;example&quot;&amp;gt;&#xA;    5. something&#xA;    6. something else&#xA;    &amp;lt;/pre&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;An Alternative solution using &lt;a href=&quot;http://orgmode.org/manual/Special-symbols.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org entities&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;replace-regexp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Original text&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;5. something&#xA;6. something else&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Entities Example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\nbsp5. something&#xA;\nbsp6. something else&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exports to HTML as &lt;code&gt;&amp;amp;nbsp;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp;5. something&#xA;&amp;amp;nbsp;6. something else&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I used following command to do the search &amp;amp; replace:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt;&lt;kbd&gt;replace-regexp&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;kbd&gt;([0-9]+. )&lt;/kbd&gt;&lt;kbd&gt;\nbsp\1&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Tested using &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GNU Emacs 24.5.1 (x86_64-unknown-cygwin, GTK+ Version 3.14.13)&lt;br&gt;&#xA;  org-mode: 9.0&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastEditorUserId="388" LastEditDate="2017-01-05T18:31:58.133" LastActivityDate="2017-01-05T18:31:58.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29819" PostTypeId="1" AcceptedAnswerId="29820" CreationDate="2017-01-04T22:09:41.120" Score="1" ViewCount="159" Body="&lt;p&gt;I am using &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;bookmark+.el&lt;/code&gt;&lt;/a&gt; in Emacs 25.1. When I press &lt;code&gt;C-x r m&lt;/code&gt; (bound to &lt;code&gt;bookmark-set&lt;/code&gt;) and point is on a symbol, it will be used as the default candidate for the new bookmark to be created. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to change this behavior slightly, such the the current line number (as given by &lt;code&gt;line-number-at-pos&lt;/code&gt;) is appended to the name. So for example if point is on a symbol &lt;code&gt;my-test-function&lt;/code&gt; at line 31 in a buffer &lt;code&gt;my-lisp-functions.el&lt;/code&gt; and I press &lt;code&gt;C-x r m&lt;/code&gt; the default candidate should be &lt;code&gt;my-test-function:31&lt;/code&gt; (and not just &lt;code&gt;my-test-function&lt;/code&gt; as is the current behavior).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After browsing the file &lt;a href=&quot;https://www.emacswiki.org/emacs/bookmark%2B-1.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;bookmark+-1.el&lt;/code&gt;&lt;/a&gt;, I think I have to customize the variable &lt;code&gt;bmkp-new-bookmark-default-names&lt;/code&gt;. I would like to do this from lisp code (i.e. not use the &lt;code&gt;M-x customize&lt;/code&gt; gui).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation of the variable &lt;code&gt;bmkp-new-bookmark-default-names&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The option value is a list of functions that do not require an&#xA;  argument and return a string (or nil).  They are invoked, in order, to&#xA;  produce the default names.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="260" LastEditorUserId="105" LastEditDate="2017-01-04T23:24:40.477" LastActivityDate="2017-01-04T23:24:40.477" Title="How to use bmkp-new-bookmark-default-names in bookmark+?" Tags="|customize|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29820" PostTypeId="2" ParentId="29819" CreationDate="2017-01-04T23:15:23.937" Score="1" Body="&lt;p&gt;Use something like this as one of the functions:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (let* ((ff    (function-called-at-point))&#xA;         (ff    (and ff  (symbolp ff)  (symbol-name ff)))&#xA;         (line  (format &quot;%d&quot; (line-number-at-pos))))&#xA;    (if ff (concat ff &quot;:&quot; line) line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Could just use that as an anonymous function - don't need to name it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example with only one function (that one) -- put this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq bmkp-new-bookmark-default-names  (list 'foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you &lt;em&gt;do&lt;/em&gt; use Customize then just click &lt;code&gt;INS&lt;/code&gt; and add &lt;code&gt;foo&lt;/code&gt; (if defined) or the equivalent lambda expression; then save.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See also &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#AutonamedBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;Autonamed Bookmarks&lt;/a&gt; for examples of providing names for autonamed bookmarks, in case that is really what you want.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-01-04T23:21:02.227" LastActivityDate="2017-01-04T23:21:02.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29821" PostTypeId="2" ParentId="29816" CreationDate="2017-01-05T00:43:47.907" Score="5" Body="&lt;p&gt;A section with a &lt;code&gt;COMMENT&lt;/code&gt; keyword is just that, a comment, not to be evaluated.  So speaks the &lt;a href=&quot;http://orgmode.org/manual/Comment-lines.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Finally, a ‘COMMENT’ keyword at the beginning of an entry, but after&#xA;  any other keyword or priority cookie, comments out the entire subtree.&#xA;  In this case, the subtree is not exported and &lt;strong&gt;no code block within it&#xA;  is executed either&lt;/strong&gt;. [emphasis mine] &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If what you want is to have the setup code evaluated, but not exported you can use the &lt;code&gt;noexport&lt;/code&gt; tag, thusly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Setup                         :noexport:&#xA;  #+name: setup&#xA;  #+begin_src emacs-lisp :results silent :exports none&#xA;  ;; (setq org-babel-latex-htlatex &quot;htlatex&quot;)&#xA;  (defmacro by-backend (&amp;amp;rest body)&#xA;    `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))&#xA;  #+end_src&#xA;&#xA;  # Local variables:&#xA;  # eval: (org-sbe &quot;setup&quot;)&#xA;  # End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-sbe&lt;/code&gt; is still able to find the &lt;code&gt;setup&lt;/code&gt; block, but the entire section, including the source block and its results, will be excluded from export.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2017-01-05T02:14:08.143" LastActivityDate="2017-01-05T02:14:08.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29823" PostTypeId="2" ParentId="29813" CreationDate="2017-01-05T04:33:26.140" Score="3" Body="&lt;p&gt;The two systems work in fundamentally different ways, so you can't easily have a 100% solution that unifies the two, but your approach looks OK.  The only thing I'd recommend is to do the emulation the other way around: write your code for &lt;code&gt;cursor-sensor-mode&lt;/code&gt; mostly and then write my-point-entered and my-point-left functions that call my-cursor-sensor-function.  The reason for that is that it is &quot;optimized for the future&quot; rather than &quot;optimized for the past&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-06-20T15:59:10.057" LastActivityDate="2017-06-20T15:59:10.057" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="29824" PostTypeId="1" CreationDate="2017-01-05T09:10:30.420" Score="1" ViewCount="176" Body="&lt;p&gt;In Emacs version 25.1.1 (and probably other versions), tab completion not work for function names unless they are enclosed in parentheses or quoted.  For instance, after running emacs -Q, setting &lt;code&gt;tab-always-indent&lt;/code&gt; to &lt;code&gt;'complete&lt;/code&gt; and attempting to complete &quot;seq-&quot; after &lt;code&gt;(require 'seq)&lt;/code&gt;, no completions are offered.  However, &quot;(seq-&quot; completes as one would expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to complete function names outside of quotes? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: this issue also occurs with normal functions and not just generic ones as pointed out in the comments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: If helm is used for completion, one approach is to use the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook (lambda ()&#xA;                                  (setq-local completion-at-point-functions '(helm-lisp-completion-at-point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="7146" LastEditDate="2017-01-05T22:40:30.480" LastActivityDate="2017-01-06T00:15:34.840" Title="Tab-completing functions in Emacs outside of parentheses or quotes" Tags="|completion|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="29826" PostTypeId="1" AcceptedAnswerId="29827" CreationDate="2017-01-05T11:43:57.337" Score="3" ViewCount="298" Body="&lt;p&gt;When I save my file, I can see output of some commands in the echo area. The thing is, that it's very fast and the next message will overwrite the previous one. So I just see the message &lt;code&gt;Wrote FILE&lt;/code&gt;. Is there a way, how can I look on the previous messages?&lt;/p&gt;&#xA;" OwnerUserId="13704" LastEditorUserId="105" LastEditDate="2017-01-05T15:58:04.337" LastActivityDate="2017-01-05T15:58:04.337" Title="Inspect message output" Tags="|echo-area|message|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29827" PostTypeId="2" ParentId="29826" CreationDate="2017-01-05T11:47:57.827" Score="7" Body="&lt;p&gt;&lt;code&gt;M-x view-echo-area-messages RET&lt;/code&gt; or &lt;code&gt;C-h e&lt;/code&gt; will open the &lt;code&gt;*Messages*&lt;/code&gt; buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This buffer can even contain some stuff that's not shown in the minibuffer, see &lt;code&gt;inhibit-message&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="730" LastEditDate="2017-01-05T12:09:04.853" LastActivityDate="2017-01-05T12:09:04.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29828" PostTypeId="2" ParentId="29785" CreationDate="2017-01-05T12:23:13.273" Score="0" Body="&lt;p&gt;I'd recommend just making emacsclient start the daemon on demand, using &lt;code&gt;emacsclient --alternate-editor=&quot;&quot;&lt;/code&gt;. That way you can exit or crash emacs, and the emacsclient-using scripts or aliases will just start it again when needed.&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2017-01-05T12:23:13.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29829" PostTypeId="1" AcceptedAnswerId="29830" CreationDate="2017-01-05T14:56:09.883" Score="2" ViewCount="309" Body="&lt;p&gt;I want to ignore a subtree temporarily.&#xA;I can do this by setting the property &lt;code&gt;:header-args:&lt;/code&gt; to &lt;code&gt;:tangle&#xA;no&lt;/code&gt;, but this is not usually visible.  Could I have this property&#xA;set automatically by all subtrees tagged with &lt;code&gt;:notangle:&lt;/code&gt;, and&#xA;removed when the tag is removed; or something to a similar effect?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2019-07-06T19:33:44.783" Title="Ignoring subtrees with a certain tag" Tags="|org-babel|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29830" PostTypeId="2" ParentId="29829" CreationDate="2017-01-05T15:51:34.263" Score="3" Body="&lt;p&gt;You could comment the subtree with &lt;code&gt;C-c ;&lt;/code&gt; (&lt;code&gt;org-toggle-comment&lt;/code&gt;).  If the subtree marked &lt;code&gt;COMMENT&lt;/code&gt;, it will not be tangled.  I use it into my init files (with &lt;code&gt;org-babel-load-file&lt;/code&gt;) to temporary exclude some code.&lt;/p&gt;&#xA;" OwnerUserId="12616" LastActivityDate="2017-01-05T15:51:34.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29831" PostTypeId="1" CreationDate="2017-01-05T17:05:01.053" Score="9" ViewCount="2718" Body="&lt;p&gt;When processing my tasks in org-mode I use a custom view that displays my unscheduled/undeadlined TODOs, as well as the next two days of my &lt;code&gt;days-agenda&lt;/code&gt;. I would like to use &lt;code&gt;SCHEDULED&lt;/code&gt; dates as the start date for a task, i.e., this task cannot even be started until the &lt;code&gt;SCHEDULED&lt;/code&gt; date &lt;em&gt;and time&lt;/em&gt; have past. With this in mind, a task that is scheduled for 5pm tomorrow is not only useless to me today, it is equally useless tomorrow &lt;em&gt;until after&lt;/em&gt; 5pm. Is there any way to hide &lt;code&gt;SCHEDULED&lt;/code&gt; tasks from TODO lists &lt;strong&gt;&lt;em&gt;and agendas&lt;/em&gt;&lt;/strong&gt; if it is before their due date and time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of the settings &lt;code&gt;(setq org-agenda-todo-ignore-scheduled 'future)&lt;/code&gt;&#xA;and &lt;code&gt;(setq org-agenda-tags-todo-honor-ignore-options t)&lt;/code&gt;. However, the former seems only to apply to the global todo list, and the latter is for tags-todo search; neither setting seems to have any effect on the daily/weekly agenda. In addition, the settings mentioned above only seem to consider the scheduled &lt;em&gt;date&lt;/em&gt; not the scheduled time, so even in the global todo list, items scheduled for tomorrow at noon will be visible from tomorrow after midnight on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume this is possible because the agenda is date and time aware, but I have not been able to find a solution.&lt;/p&gt;&#xA;" OwnerUserId="8430" LastActivityDate="2017-01-27T16:21:35.683" Title="Hide SCHEDULED items in org-agenda until they are past their scheduled date and time" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29832" PostTypeId="1" CreationDate="2017-01-05T18:07:50.250" Score="2" ViewCount="460" Body="&lt;p&gt;What is the emacs theme that is used on org-mode site?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/img/main.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/img/main.jpg&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14451" LastActivityDate="2020-01-05T23:02:41.907" Title="What is the emacs theme that is used on org-mode site?" Tags="|org-mode|themes|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29833" PostTypeId="2" ParentId="28964" CreationDate="2017-01-05T22:42:32.607" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bookmark+&lt;/a&gt; lets you combine multiple bookmarks as a &lt;a href=&quot;http://www.emacswiki.org/emacs/BookmarkPlus#FunctionSequenceVarlistBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;sequence bookmark&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could try a sequence bookmark that first restores the desktop (using a &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#DesktopBookmarks&quot; rel=&quot;nofollow noreferrer&quot;&gt;desktop bookmark&lt;/a&gt;) and then restores a particular narrowing (using a &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#BookmarkedRegion&quot; rel=&quot;nofollow noreferrer&quot;&gt;region bookmark&lt;/a&gt; and, say, &lt;code&gt;bmkp-region-jump-narrow-indirect-other-window&lt;/code&gt;). &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-05T22:42:32.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29835" PostTypeId="1" AcceptedAnswerId="29837" CreationDate="2017-01-06T01:40:15.470" Score="2" ViewCount="169" Body="&lt;p&gt;&lt;strong&gt;Idea&lt;/strong&gt; I will like to construct a simple emacs function that copies the &lt;code&gt; yy &lt;/code&gt; functionality in vim. &#xA;The function should yank a visual-line into kill ring without deleting the line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Function&lt;/strong&gt; &#xA;Here is the function I came up with. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;pre&gt;&lt;code&gt;&#xA;(defun vim-line-yank-func()&#xA;    (interactive)&#xA;    (beginning-of-visual-line)&#xA;    (mark-end-of-sentence 1)&#xA;    (end-of-visual-line)&#xA;    (copy-region-as-kill (mark) (point))&#xA;)&#xA;&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us run this program on some data. Consider the following text with original line breaks (&amp;#9658; is position of the mark &quot;\n&quot; = newline mark). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;pre&gt;&lt;code&gt;&#xA;Pellentesque dapibus suscipit ligula. &amp;#9658; Donec posuere augue in quam.  Etiam \n&#xA;vel tortor sodales tellus ultricies commodo.  Suspendisse potenti. \n&#xA;Aenean in sem ac leo mollis blandit. &#xA;&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected answer is &#xA;&lt;pre&gt;&lt;code&gt;&#xA;Pellentesque dapibus suscipit ligula.  Donec posuere augue in quam.  Etiam&#xA;&lt;/pre&gt;&lt;/code&gt;&#xA;but the answer I keep getting is the following:&#xA;&lt;pre&gt;&lt;code&gt;&#xA; Donec posuere augue in quam.  Etiam&#xA;&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am befuddled as to why this is happening. When I run these commands in succession things seem to work fine. &#xA;Thank you for your help!&lt;/p&gt;&#xA;" OwnerUserId="14093" LastEditorUserId="105" LastEditDate="2017-01-06T02:43:41.243" LastActivityDate="2017-01-06T02:43:41.243" Title="What is the problem with this yank function in elisp in emacs?" Tags="|region|yank|mark|visual-line-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29836" PostTypeId="1" AcceptedAnswerId="29884" CreationDate="2017-01-06T01:47:47.833" Score="12" ViewCount="7368" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can &lt;code&gt;org-mode&lt;/code&gt; be configured so that &lt;code&gt;(org-entry-get nil &quot;title&quot;)&lt;/code&gt; returns the headline title?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen three variations of &lt;code&gt;org-entry-get&lt;/code&gt; where the string argument &lt;code&gt;title&lt;/code&gt; is in all lowercase, all uppercase, or initial caps.  The default &lt;code&gt;org-mode&lt;/code&gt; configuration does not return anything in all three cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Active [#A] 0 @ index. :lawlist:&#xA;  DEADLINE: &amp;lt;2016-12-31 Sat&amp;gt;&#xA;  :PROPERTIES:&#xA;  :Effort:&#xA;  :Hash: 8ae546845cebbc4d25ccdcf23eade44e&#xA;  :ToodledoFolder: TASKS&#xA;  :ToodledoGoal:&#xA;  :ToodledoID: 394554265&#xA;  :ToodledoLocation:&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords '((sequence&#xA;  &quot;Active(a)&quot;&#xA;  &quot;Next Action(n)&quot;&#xA;  &quot;Canceled(c)&quot;&#xA;  &quot;Hold(h)&quot;&#xA;  &quot;Reference(r)&quot;&#xA;  &quot;Delegated(d)&quot;&#xA;  &quot;Waiting(w)&quot;&#xA;  &quot;Postponed(P)&quot;&#xA;  &quot;Someday(s)&quot;&#xA;  &quot;Planning(p)&quot;&#xA;  &quot;|&quot;&#xA;  &quot;None(N)&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is a function I found that uses &lt;code&gt;org-get-heading&lt;/code&gt; if &lt;code&gt;org-entry-get&lt;/code&gt; fails:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((title (if (org-entry-get nil &quot;title&quot;)&#xA;                 (org-entry-get nil &quot;title&quot;)&#xA;                 (org-get-heading t t))))&#xA;  (substring-no-properties title))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And, here is yet another method:  &lt;code&gt;(org-element-property :title (org-element-at-point))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-08T18:16:40.730" LastActivityDate="2017-01-09T12:31:39.443" Title="How to get the headline title using org-entry-get" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29837" PostTypeId="2" ParentId="29835" CreationDate="2017-01-06T01:59:30.007" Score="5" Body="&lt;p&gt;Why &lt;code&gt;mark-end-of-sentence&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd do it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vim-line-yank-func()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (beginning-of-visual-line)&#xA;    (copy-region-as-kill (point)&#xA;                         (progn (end-of-visual-line) (point)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-01-06T01:59:30.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29838" PostTypeId="2" ParentId="29831" CreationDate="2017-01-06T02:47:32.577" Score="6" Body="&lt;p&gt;See the doc-strings for &lt;code&gt;org-agenda-skip-function&lt;/code&gt; and/or &lt;code&gt;org-agenda-skip-function-global&lt;/code&gt;.  &lt;a href=&quot;http://orgmode.org/manual/Special-agenda-views.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Special-agenda-views.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; Entry in `org-agenda-custom-commands':&#xA;;;  (org-agenda-skip-function '(org-agenda-skip-if-scheduled-later))&#xA;(defun org-agenda-skip-if-scheduled-later ()&#xA;&quot;If this function returns nil, the current match should not be skipped.&#xA;Otherwise, the function must return a position from where the search&#xA;should be continued.&quot;&#xA;  (ignore-errors&#xA;    (let ((subtree-end (save-excursion (org-end-of-subtree t)))&#xA;          (scheduled-seconds&#xA;            (time-to-seconds&#xA;              (org-time-string-to-time&#xA;                (org-entry-get nil &quot;SCHEDULED&quot;))))&#xA;          (now (time-to-seconds (current-time))))&#xA;       (and scheduled-seconds&#xA;            (&amp;gt;= scheduled-seconds now)&#xA;            subtree-end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The example in the &lt;code&gt;org-mode&lt;/code&gt; manual uses the point end of the subtree as the value for the &lt;code&gt;org-agenda&lt;/code&gt; search to continue after evaluating the skip function.  This is presumably because said skip function &lt;em&gt;may&lt;/em&gt; move point.  In this example, point does not need to be moved to determine whether a scheduled entry is greater than or equal to the current time.  It &lt;em&gt;may&lt;/em&gt; be possible to save a split second [multiplied by each entry] by using &lt;code&gt;(point)&lt;/code&gt; instead of &lt;code&gt;(save-excursion (org-end-of-subtree t))&lt;/code&gt; -- and change the wording of &lt;code&gt;subtree-end&lt;/code&gt; in both places with the word &lt;code&gt;point&lt;/code&gt; so as to avoid confusion.  [However, @lawlist has not actually tested that hypothesis with this example.]  Since users who read this thread may move point as part of their own custom skip function, @lawlist is leaving the textbook example that uses point at the end of the subtree.  The goal is to prevent a never ending loop.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-27T16:21:35.683" LastActivityDate="2017-01-27T16:21:35.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29839" PostTypeId="1" AcceptedAnswerId="29840" CreationDate="2017-01-06T04:35:42.567" Score="1" ViewCount="106" Body="&lt;p&gt;Could you please tell me how I can write a function&#xA;which creates and visits a buffer in a particular directory (a default directory name is hard coded, but it would be nice to have an opportunity to change the directory) with some predefined prefix (current date in the format &lt;code&gt;yyyymmdd&lt;/code&gt;) and then offers to finish the title (eg &lt;code&gt;20170106EMACS_QUESTION.tex&lt;/code&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, when the function is called, it would do the following in order:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) ask for a directory path of the buffer (if &lt;code&gt;nil&lt;/code&gt;, autocomplete with the hard coded default)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) ask for a file name, with the timestamp &lt;code&gt;yyyymmdd&lt;/code&gt; already filled in at the beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) create and visit a buffer with the above metadata&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;completing-read&lt;/code&gt;, &lt;code&gt;read-string&lt;/code&gt; and &lt;code&gt;find-file&lt;/code&gt; seem to be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also find the following code helpful, which I do not know how to change to comply with the description:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun add-note (d)&#xA;  (interactive &quot;d&quot;)&#xA;  (let ((default-directory d))&#xA;    (find-file (format-time-string &quot;%Y%m%d-CUSTOM-TITLE&quot;&#xA;    (current-time))))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14456" LastEditorUserId="14456" LastEditDate="2017-01-06T17:03:06.830" LastActivityDate="2017-01-06T17:03:06.830" Title="Interactive Function to Create a Buffer in a Default Folder with Autocompletion of the File Name with the Predefined Prefix" Tags="|buffers|files|find-file|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29840" PostTypeId="2" ParentId="29839" CreationDate="2017-01-06T05:55:06.817" Score="1" Body="&lt;p&gt;What do you mean by &quot;create a file&quot;?  Do you mean visit a file buffer, so that you can save the buffer as a file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you are just looking for function &lt;strong&gt;&lt;code&gt;read-file-name&lt;/code&gt;&lt;/strong&gt;.  It reads a file name, prompting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(read-file-name PROMPT &amp;amp;optional DIR DEFAULT-FILENAME MUSTMATCH INITIAL PREDICATE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-h f read-file-name&lt;/code&gt;&lt;/strong&gt; tells you more.  But basically &lt;code&gt;DIR&lt;/code&gt; is the directory for completion and &lt;code&gt;DEFAULT-FILENAME&lt;/code&gt; is the default (relative) file name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for more than this or something different, please clarify your question a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading the file name, you can visit a buffer for it. See the code that defines &lt;code&gt;find-file&lt;/code&gt; for using &lt;code&gt;find-file-noselect&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you could just use &lt;strong&gt;&lt;code&gt;find-file&lt;/code&gt;&lt;/strong&gt;.  It uses &lt;code&gt;read-file-name&lt;/code&gt; (see &lt;code&gt;find-file-read-args&lt;/code&gt;).  But it does not let you provide a default file name.  If you do that, bind &lt;code&gt;default-directory&lt;/code&gt; to the directory you want, before you call &lt;code&gt;find-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update after your comment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a file-name prefix automatically inserted then provide that as the &lt;strong&gt;&lt;code&gt;INITIAL&lt;/code&gt;&lt;/strong&gt; argument to &lt;code&gt;read-file-name&lt;/code&gt;.  That's what it's for.  Please read the doc: &lt;code&gt;C-h f read-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fifth arg INITIAL specifies text to start with.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If DEFAULT-FILENAME is omitted or&#xA;nil, then if INITIAL is non-nil, the default is DIR combined with&#xA;INITIAL; otherwise, if the current buffer is visiting a file,&#xA;that file serves as the default; otherwise, the default is simply&#xA;the string inserted into the minibuffer.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-01-06T14:41:16.707" LastActivityDate="2017-01-06T14:41:16.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29841" PostTypeId="2" ParentId="27561" CreationDate="2017-01-06T09:59:44.217" Score="3" Body="&lt;p&gt;Finally I found a fix for the problem on &lt;a href=&quot;https://www.emacswiki.org/emacs/Comments_on_CopyAndPaste&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacswiki&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-select-enable-primary t)&#xA;(setq select-enable-primary t)&#xA;(setq mouse-drag-copy-region t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Quick tip&lt;/strong&gt;: if you’re here looking to fix the fact that in Emacs shift-insert no longer pastes that text you highlighted with the mouse in your browser, the 2014 answer is to set &lt;strong&gt;x-select-enable-primary&lt;/strong&gt; to true, and set &lt;strong&gt;mouse-drag-copy-region&lt;/strong&gt; to true to go the other way - I can’t imagine why this excellent default was changed but it’s very hard to find the answer in the verbiage below.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But this works only for emacs installed from sources &lt;a href=&quot;https://github.com/emacs-mirror/emacs/archive/master.zip&quot; rel=&quot;nofollow noreferrer&quot;&gt;github/emacs-mirror&lt;/a&gt;, not 25.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found that it depends on terminal. xterm fails, while vt100 works good&lt;/p&gt;&#xA;" OwnerUserId="13536" LastEditorUserId="13536" LastEditDate="2017-01-12T15:43:18.987" LastActivityDate="2017-01-12T15:43:18.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29842" PostTypeId="1" CreationDate="2017-01-06T11:26:35.213" Score="2" ViewCount="1585" Body="&lt;p&gt;would like to use a custom tikz library with org-mode.&#xA;&lt;a href=&quot;https://github.com/jluttine/tikz-bayesnet&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jluttine/tikz-bayesnet&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example works fine. :)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src latex :file fsa.pdf :packages '((&quot;&quot; &quot;tikz&quot;)) :border 1em&#xA;  % Define block styles&#xA;  \usetikzlibrary{shapes,arrows}&#xA;  \tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize, fill=blue!25]&#xA;  \tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize, fill=red!25]&#xA;&#xA;  \begin{tikzpicture}[-&amp;gt;,&amp;gt;=stealth', shorten &amp;gt;=1pt, auto, node distance=2.8cm, semithick]&#xA;    \node [astate] (1) at (0,0) {1};&#xA;    \node [astate] (2) at (1,0) {2};&#xA;    \node [rstate] (3) at (2,0) {3};&#xA;    \path (1) edge [bend left] node {b} (2)&#xA;          (2) edge node {b} (3)&#xA;          (2) edge [bend left] node {a} (1)&#xA;          (3) edge [loop above] node {(a, b)} (3);&#xA;  \end{tikzpicture}&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but using the downloaded bayesnet library doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src latex :file figs/fmc_model.png :packages '((&quot;&quot; &quot;tikz&quot;)) :border 1em&#xA;  % \usetikzlibrary{bayesnet}&#xA;  % \include{tikzlibrarybayesnet.code.tex}&#xA;  \begin{tikzpicture}&#xA;    % Define nodes&#xA;&#xA;    % Y&#xA;    \node[obs]          (y)   {$y$}; %&#xA;    \factor[above=of y] {y-f} {left:$\mathcal{N}$} {} {} ; %&#xA;&#xA;    % W and X&#xA;    \node[det, above=of y]            (dot) {dot} ; % &#xA;    \node[latent, above left=1.2 of dot]  (w)   {$\mathbf{w}$}; %&#xA;    \node[latent, above right=1.2 of dot] (x)   {$\mathbf{x}$}; %&#xA;&#xA;    % W hyperparameters&#xA;    \node[const, above=1.2 of w, xshift=-0.5cm] (mw) {$\mu_w$} ; %&#xA;    \node[const, above=1.2 of w, xshift=0.5cm]  (aw) {$\alpha_w$} ; %&#xA;&#xA;    % X hyperparameters&#xA;    \node[const, above=1.2 of x, xshift=-0.5cm] (mx) {$\mu_x$} ; %&#xA;    \node[const, above=1.2 of x, xshift=0.5cm]  (ax) {$\alpha_x$} ; %&#xA;&#xA;    % noise&#xA;    \node[latent, right=2.5cm of y-f]         (t)   {$\tau$}; %&#xA;    \node[const, above=of t, xshift=-0.5cm] (at)  {$\alpha_\tau$} ; %&#xA;    \node[const, above=of t, xshift=0.5cm]  (bt)  {$\beta_\tau$} ; %&#xA;&#xA;    % Factors&#xA;    \factor[above=of w] {w-f} {left:$\mathcal{N}$} {mw,aw} {w} ; %&#xA;    \factor[above=of x] {x-f} {left:$\mathcal{N}$} {mx,ax} {x} ; %&#xA;    \factor[above=of t] {t-f} {left:$\mathcal{G}$} {at,bt} {t} ; %&#xA;    \factoredge {dot,t} {y-f} {y} ; %&#xA;&#xA;    % Connect w and x to the dot node&#xA;    \edge[-] {w,x} {dot} ;&#xA;&#xA;    % Plates&#xA;    \plate {yx} { %&#xA;      (y)(y-f)(y-f-caption) %&#xA;      (x)(x-f)(x-f-caption) %&#xA;      (dot) %&#xA;    } {$N$} ;&#xA;    \plate {} {%&#xA;      (y)(y-f)(y-f-caption) %&#xA;      (w)(w-f)(w-f-caption) %&#xA;      (dot) %&#xA;      (yx.north west)(yx.south west) %&#xA;    } {$M$} ;&#xA;&#xA;  \end{tikzpicture}&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result is the same as when I compile the figure in a standalone latex file without '\usetikzlibrary{bayesnet}'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I include the library in the org-mode fragement doesn't compile.&#xA;In latex the '\usetikzlibrary{bayesnet}' command finds the library when it's located in the same folder (which it is) and produces the expected result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I make org-mode aware of the file tikzlibrarybayesnet.code.tex which is located in the project directory?&lt;/p&gt;&#xA;" OwnerUserId="14419" LastActivityDate="2017-01-06T11:26:35.213" Title="use local tikz library in org-mode" Tags="|org-mode|latex|org-babel|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29843" PostTypeId="1" CreationDate="2017-01-06T11:51:25.480" Score="5" ViewCount="1730" Body="&lt;p&gt;I have the same question as &lt;a href=&quot;https://emacs.stackexchange.com/a/20710/10291&quot;&gt;this question&lt;/a&gt; except that I don't see how to do so other than in elisp.  I am using Ruby, but I suppose the question applies to other languages as well.  If I return an array of arrays as the value result of some code, I want to have it formatted as a table headed with the column names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the solution to what I want in elisp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results value table&#xA;  '((&quot;First&quot; &quot;Second&quot;)&#xA;    hline&#xA;    (a b) (c d))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| First | Second |&#xA;|-------+--------|&#xA;| a     | b      |&#xA;| c     | d      |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I've tried variants of this in Ruby with no luck.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ruby :results value table&#xA;    [ [ 'First', 'Second'],&#xA;      :hline,&#xA;      [ :a, :b ],&#xA;      [ :c, :d ]&#xA;    ]&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| (First Second) | :hline | (:a :b) | (:c :d) |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is not what I want.  So, what is the incantation to use here?&lt;/p&gt;&#xA;" OwnerUserId="10291" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-02-06T20:33:43.140" Title="How to return an org mode table with headings and hline from Ruby" Tags="|org-babel|org-table|ruby|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29844" PostTypeId="1" CreationDate="2017-01-06T12:59:25.940" Score="2" ViewCount="71" Body="&lt;p&gt;Is it possible to tell &lt;code&gt;scheme-send-last-sexp&lt;/code&gt; to echo the expression in the &lt;code&gt;*scheme*&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2017-01-06T12:59:25.940" Title="How to tell scheme-send-last-sexp to echo the expression?" Tags="|scheme|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29845" PostTypeId="1" CreationDate="2017-01-06T14:37:21.860" Score="2" ViewCount="191" Body="&lt;p&gt;I'd like to encrypt different headings in my org file to different keys, e.g., &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading 1&#xA;* Heading 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;Heading 1&lt;/code&gt; should be encrypted to &lt;code&gt;me1@example.com&lt;/code&gt; and &lt;code&gt;Heading 2&lt;/code&gt; should be encrypted to &lt;code&gt;me2@example.com&lt;/code&gt;, using gpg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="1985" LastActivityDate="2018-12-17T21:02:45.557" Title="How to encrypt different headings to different keys" Tags="|org-mode|encryption|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29846" PostTypeId="2" ParentId="21112" CreationDate="2017-01-06T17:07:06.297" Score="0" Body="&lt;p&gt;Assuming your auctex is up-to-date and that you followed the instructions for installing the package, including the &lt;code&gt;M-x package-install-file RET pdf-tools-${VERSION}.tar RET&lt;/code&gt; step, all you should need is&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Initialize the package (this should autoload it too)&#xA;(pdf-tools-install)&#xA;;; Select PDF Tools as your viewer for PDF files&#xA;(setcdr (assq 'output-pdf TeX-view-program-selection) '(&quot;PDF Tools&quot;))&#xA;;; If you want synctex support, this should be sufficient assuming &#xA;;; you are using LaTeX-mode&#xA;(add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-01-06T17:07:06.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29848" PostTypeId="2" ParentId="29039" CreationDate="2017-01-06T19:01:15.150" Score="1" Body="&lt;p&gt;This issue was &lt;a href=&quot;https://github.com/ipython/ipython/issues/9816&quot; rel=&quot;nofollow noreferrer&quot;&gt;brought up to the ipython team&lt;/a&gt;. It sounds unlikely that there will be progress from that side. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One option they suggest is reinstalling ipython 4.x (for instance in an Anaconda prompt &lt;code&gt;pip install --force-reinstall ipython==4.2.1&lt;/code&gt;. If like me, ipython 4.x doesn't work at all, you can reinstall the latest version with &lt;code&gt;pip install --upgrade --ignore-installed ipython&lt;/code&gt;, as described &lt;a href=&quot;https://stackoverflow.com/questions/19548957/can-i-force-pip-to-reinstall-the-current-version&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option they brought up is &lt;a href=&quot;https://github.com/millejoh/emacs-ipython-notebook&quot; rel=&quot;nofollow noreferrer&quot;&gt;using EIN&lt;/a&gt;, which is probably overkill, but it seems to be the best option to me.&lt;/p&gt;&#xA;" OwnerUserId="14468" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-01-06T19:01:15.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29849" PostTypeId="1" AcceptedAnswerId="29855" CreationDate="2017-01-06T19:33:14.577" Score="2" ViewCount="1442" Body="&lt;p&gt;According to &lt;a href=&quot;http://orgmode.org/manual/Export-settings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;the org-mode manual&lt;/a&gt; (emphasis added by me):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The tags that exclude a tree from export (org-export-exclude-tags). The default value is :noexport:. Entries with the :noexport: tag will be unconditionally excluded from the export, even if they have an :export: tag. &lt;strong&gt;Code blocks contained in excluded subtrees will still be executed during export even though the subtree is not exported.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;However, I have an org mode document featuring python code blocks for which code blocks in :noexport: headings does not execute on export:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;* Setup Code             :noexport:&#xA;Here's some general text!&#xA;#+BEGIN_SRC ipython :session :exports none :tangle ./politics.py&#xA;  %matplotlib inline&#xA;  import matplotlib.pyplot as plt&#xA;  # . . .&#xA;  # . . .&#xA;#+END_SRC&#xA;&#xA;* Introduction&#xA;. . .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;When I export, it throws python throws &lt;code&gt;NameError: name 'plt' not defined&lt;/code&gt;. Clearly org isn't executing blocks in these :noexport: headings on export. It does work when I remove the :noexport: tag. Am I missing something, or is this an error in the documentation?&lt;/p&gt;&#xA;&lt;p&gt;I'm using org 8.2.10&lt;/p&gt;&#xA;" OwnerUserId="6554" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-01-07T23:35:44.327" Title="Running :noexport: code on export" Tags="|org-mode|org-export|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29850" PostTypeId="1" CreationDate="2017-01-06T19:42:32.850" Score="6" ViewCount="843" Body="&lt;p&gt;I was wondering if there is a way to visit the matches listed in the &lt;em&gt;grep&lt;/em&gt; buffer without actually switching to the match buffer, similarly to &lt;code&gt;C-o&lt;/code&gt; with Occur.&lt;/p&gt;&#xA;" OwnerUserId="14469" LastEditorUserId="105" LastEditDate="2017-01-07T01:26:36.227" LastActivityDate="2023-02-20T21:48:15.383" Title="rgrep : visiting matches without switching buffer" Tags="|grep|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29851" PostTypeId="2" ParentId="29849" CreationDate="2017-01-06T20:12:36.677" Score="2" Body="&lt;p&gt;New features around Org 8.2.10 mean that code evaluates on export even if it isn't exported into the document. Evaluating and exporting into the exported document are not the same. You'll need to add &lt;code&gt;:eval no-export&lt;/code&gt; to the babel header block.&lt;/p&gt;&#xA;" OwnerUserId="91" LastActivityDate="2017-01-06T20:12:36.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29852" PostTypeId="2" ParentId="29850" CreationDate="2017-01-06T22:11:12.123" Score="8" Body="&lt;p&gt;By default &lt;kbd&gt;C-o&lt;/kbd&gt; does exactly what you want in grep buffers as well as in occur buffers.&lt;/p&gt;&#xA;&lt;p&gt;You can also simply navigate up and down inside the grep results buffer with &lt;kbd&gt;p&lt;/kbd&gt; and &lt;kbd&gt;n&lt;/kbd&gt; (&lt;code&gt;previous-error-no-select&lt;/code&gt;, &lt;code&gt;next-error-no-select&lt;/code&gt;), and the other buffer will be updated each time.&lt;/p&gt;&#xA;&lt;p&gt;Outside of the grep results buffer, &lt;kbd&gt;M-g&lt;/kbd&gt;&lt;kbd&gt;M-p&lt;/kbd&gt; and &lt;kbd&gt;M-g&lt;/kbd&gt;&lt;kbd&gt;M-n&lt;/kbd&gt; (&lt;code&gt;previous-error&lt;/code&gt;, &lt;code&gt;next-error&lt;/code&gt;) will visit the previous/next grep hit without you needing to select the grep buffer at all.&lt;/p&gt;&#xA;&lt;p&gt;Note that these are all generic &lt;code&gt;compilation-mode&lt;/code&gt; behaviours, which is why the command names use the term &amp;quot;error&amp;quot;, as the functionality was originally written to make it easy to navigate the sources of compiler errors.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2023-02-20T21:48:15.383" LastActivityDate="2023-02-20T21:48:15.383" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="29853" PostTypeId="1" AcceptedAnswerId="29862" CreationDate="2017-01-06T23:31:45.317" Score="16" ViewCount="787" Body="&lt;p&gt;I want to get the effect of a static variable by using &lt;code&gt;defun&lt;/code&gt; inside of &lt;code&gt;let&lt;/code&gt; with lexical binding to create a closure. However, when byte-compiling the file, I get a warning. Am I doing something wrong, or if not, is there a way to suppress this warning?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've created an MCVE:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;&#xA;(let ((count 0))&#xA;  (defun increase-count ()&#xA;    (interactive)&#xA;    (setq count (1+ count))&#xA;    (message &quot;Count is: %d&quot; count))&#xA;&#xA;  ;; The warning happens here.&#xA;  (increase-count))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code works as expected: the function &lt;code&gt;increase-count&lt;/code&gt; prints out &quot;Count is: n&quot; where n increases each time it is called. However, when byte-compiling this file, I get the following warning:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;In end of data:&#xA;mcve.el:11:1:Warning: the function ‘increase-count’ is not known to be&#xA;    defined.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems to me that &lt;code&gt;increase-count&lt;/code&gt; should always be defined before it is called at the end of the let-block. Is this not the case?&lt;/p&gt;&#xA;" OwnerUserId="12508" LastEditorUserId="105" LastEditDate="2017-01-07T01:25:25.843" LastActivityDate="2018-03-16T14:36:19.113" Title="Defun inside let with lexical binding gives byte-compile warning &quot;the function is not known to be defined&quot;" Tags="|byte-compilation|lexical-scoping|defun|lexical-binding|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29854" PostTypeId="1" CreationDate="2017-01-07T05:20:15.623" Score="4" ViewCount="3119" Body="&lt;p&gt;I followed &lt;a href=&quot;http://chenla.org/2016/08/07/capturing-bibtext-entries-with-org-bibtex-mode-google-scholar.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; and can grab stuff (with Google Scholar) and put it in my &lt;code&gt;ref.org&lt;/code&gt;, as described. However when I create a &lt;code&gt;testbibtex.org&lt;/code&gt; with this lone line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\bibliography{ref}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;all I get with Latex export is the word &quot;Contents.&quot; I've copied the contents of &lt;code&gt;ref.org&lt;/code&gt; to &lt;code&gt;ref.bib&lt;/code&gt;, entries such as this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@book{burton2006elementary,&#xA;  title={Elementary number theory},&#xA;  author={Burton, David M},&#xA;  year={2006},&#xA;  publisher={Tata McGraw-Hill Education}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but nothing of this is included in the Latex export. So, yeah, I really need a beginner's tutorial in this whole process.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2019-09-03T15:32:04.063" Title="org-mode and bibtex latex export problem" Tags="|org-mode|org-export|bibtex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29855" PostTypeId="2" ParentId="29849" CreationDate="2017-01-07T06:16:42.410" Score="0" Body="&lt;p&gt;I fixed my issue by upgrading to org version 9 + contrib files. Uninstall org (&lt;code&gt;package-list-packages&lt;/code&gt;, find &lt;code&gt;org&lt;/code&gt;, press &lt;code&gt;d&lt;/code&gt; to mark for deletion, then press &lt;code&gt;x&lt;/code&gt; to delete), add the following code to init.el (before any piece of code that loads &lt;code&gt;org&lt;/code&gt;), then restart emacs (if you don't have use-package, install it). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;(use-package org&#xA;  :mode ((&quot;\\.org$&quot; . org-mode))&#xA;  :ensure org-plus-contrib)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;org-version&lt;/code&gt; to confirm upgrade.&lt;/p&gt;&#xA;" OwnerUserId="6554" LastEditorUserId="6554" LastEditDate="2017-01-07T23:35:44.327" LastActivityDate="2017-01-07T23:35:44.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29856" PostTypeId="1" CreationDate="2017-01-07T08:18:01.577" Score="5" ViewCount="193" Body="&lt;p&gt;I have a file a.org which contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: a &#xA;#+DATE: &amp;lt;2017-01-07 Sat&amp;gt;&#xA;* b.org&#xA;  #+INCLUDE: b.org &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and b.org which contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: b &#xA;#+DATE: &amp;lt;2017-01-07 Sat&amp;gt;&#xA;* content in b &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I export a.org to html or latex, things like &lt;code&gt;#+TITLE&lt;/code&gt; and &lt;code&gt;#+DATE&lt;/code&gt; mess up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VQsPz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VQsPz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I want to maintain each &lt;code&gt;b*.org&lt;/code&gt; and a master &lt;code&gt;a.org&lt;/code&gt; containing all the &lt;code&gt;b*.org&lt;/code&gt; as subtrees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I tell org to ignore the properties in all the &lt;code&gt;b*.org&lt;/code&gt; files and use the properties in &lt;code&gt;a.org&lt;/code&gt; when exporting in &lt;code&gt;a.org&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="9995" LastEditDate="2017-01-08T20:24:40.000" LastActivityDate="2017-01-08T20:24:40.000" Title="Handling org properties when include files" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="3" ClosedDate="2017-01-10T15:56:56.090" ContentLicense="CC BY-SA 3.0" />
  <row Id="29857" PostTypeId="2" ParentId="29854" CreationDate="2017-01-07T09:45:12.520" Score="4" Body="&lt;p&gt;I'm doing latex bibliography exports in Org9 with a regular bibtex file (literature.bib).  At the location where I want the references to appear in the result, I put &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+BIBLIOGRAPHY: /HOME/uidg1626/literature apalike&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;into my org file or sub-header (for sub-tree export). Citing is done with org links e.g. &lt;code&gt;[[cite:key_of_bibtex_entry]]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before the above can work the org pdf compiling process hast to be configured (e.g. in init.el) to include a bibtex run: &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'ox-bibtex)&#xA;(setq org-latex-pdf-process&#xA;      '(&quot;pdflatex -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;bibtex %b&quot;&#xA;        &quot;pdflatex -interaction nonstopmode -output-directory %o %f&quot;&#xA;        &quot;pdflatex -interaction nonstopmode -output-directory %o %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I got it from here: &lt;a href=&quot;http://orgmode.org/worg/exporters/anno-bib-template-worg.html#sec-5&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/worg/exporters/anno-bib-template-worg.html#sec-5&lt;/a&gt; which is working for my tex-live system.&lt;/p&gt;&#xA;" OwnerUserId="8979" LastEditorUserId="24053" LastEditDate="2019-09-03T15:32:04.063" LastActivityDate="2019-09-03T15:32:04.063" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="29858" PostTypeId="1" AcceptedAnswerId="29861" CreationDate="2017-01-07T11:10:08.700" Score="3" ViewCount="713" Body="&lt;p&gt;I'm using GNU Emacs 24.5.1 (GUI version) on Mac OS X 10.11.1 with Evil mode and installed &lt;a href=&quot;https://github.com/timcharper/evil-surround&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;evil-surround&lt;/code&gt;&lt;/a&gt; through the built-in package manager of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I can add all surroundings, for example, surround a word by &lt;code&gt;/&lt;/code&gt; with &lt;code&gt;viwS/&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, changing and deleting surroundings works only with certain types of surroundings, for example, &lt;code&gt;&quot;&lt;/code&gt;, &lt;code&gt;'&lt;/code&gt;, &lt;code&gt;)&lt;/code&gt;, &lt;code&gt;]&lt;/code&gt;, but not with &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;=&lt;/code&gt; (which are used in org-mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I move the cursor, for example, on the text &lt;code&gt;/word/&lt;/code&gt;, and type &lt;code&gt;ds/&lt;/code&gt;, then after typing &lt;code&gt;ds&lt;/code&gt; the word &lt;code&gt;delete&lt;/code&gt; appears in the minibuffer, but then upon typing &lt;code&gt;/&lt;/code&gt; the minibuffer is emptied, but nothing changes in the surrounded word, i.e. the &lt;code&gt;/&lt;/code&gt; are still there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to fix this, i.e. allow surroundings like &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;=&lt;/code&gt; to work properly?&lt;/p&gt;&#xA;" OwnerUserId="14473" LastEditorUserId="253" LastEditDate="2017-01-07T14:17:04.537" LastActivityDate="2017-01-07T15:52:11.567" Title="evil-surround: change and delete not working with all surroundings" Tags="|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29859" PostTypeId="2" ParentId="29363" CreationDate="2017-01-07T13:04:22.460" Score="4" Body="&lt;p&gt;As explained in the comments, you can start by creating an empty commit (a commit that doesn't actually change any files) to write the message first. Then you can stage as usual, and finally you can amend the staged changes to the &lt;code&gt;HEAD&lt;/code&gt; commit using &lt;kbd&gt;c e&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need to make some tweaks to the message you can then use &lt;kbd&gt;c w&lt;/kbd&gt;, or you can combine these two steps using c a .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To create an empty commit use &lt;kbd&gt;c - e c&lt;/kbd&gt;, but since you are doing this regularly, you should enable the &lt;code&gt;--allow-empty&lt;/code&gt; switch permanently, which you can do using &lt;kbd&gt;c - e C-x C-s&lt;/kbd&gt; once.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-01-07T13:04:22.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29860" PostTypeId="1" AcceptedAnswerId="29864" CreationDate="2017-01-07T15:04:03.320" Score="4" ViewCount="532" Body="&lt;p&gt;I have just explore how to use mark rings in emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two kind of mark type &lt;code&gt;mark-ring&lt;/code&gt; and  &lt;code&gt;global-mark-ring&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the differences between them and is there any option to push all marks to global to reaching from everywhere?&lt;/p&gt;&#xA;" OwnerUserId="8426" LastEditorUserId="105" LastEditDate="2017-01-07T17:11:03.670" LastActivityDate="2017-01-07T17:26:08.070" Title="What are the differences mark-ring and global-mark-ring?" Tags="|mark|mark-ring|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29861" PostTypeId="2" ParentId="29858" CreationDate="2017-01-07T15:35:10.283" Score="3" Body="&lt;p&gt;Installing the packages &lt;a href=&quot;https://github.com/cute-jumper/embrace.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;embrace&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/cute-jumper/evil-embrace.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;evil-embrace&lt;/code&gt;&lt;/a&gt; fixes the problem.  After that you must define new pairs with &lt;code&gt;embrace&lt;/code&gt;.  I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package embrace&#xA;    :ensure embrace)&#xA;(use-package evil-embrace&#xA;    :ensure evil-embrace)&#xA;(evil-embrace-enable-evil-surround-integration)&#xA;(setq evil-embrace-show-help-p nil)&#xA;(add-hook 'LaTeX-mode-hook&#xA;    (lambda ()&#xA;        (embrace-add-pair ?a &quot;`&quot; &quot;'&quot;)&#xA;        (embrace-add-pair ?e &quot;\\emph{&quot; &quot;}&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="253" LastEditDate="2017-01-07T15:52:11.567" LastActivityDate="2017-01-07T15:52:11.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29862" PostTypeId="2" ParentId="29853" CreationDate="2017-01-07T16:07:08.400" Score="9" Body="&lt;p&gt;The byte-compiler's way to decide whether a function will be defined or not is very &quot;naive&quot; and gets fooled even in your &quot;obvious&quot; case.&#xA;But you can write it in a way that lets the compiler understand what happens:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defalias 'increase-count&#xA;  (let ((count 0))&#xA;    (lambda ()&#xA;      (interactive)&#xA;      (setq count (1+ count))&#xA;      (message &quot;Count is: %d&quot; count))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, even better would be to improve the byte-compiler's logic: patches welcome for that.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-01-07T16:07:08.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29863" PostTypeId="1" CreationDate="2017-01-07T16:39:36.227" Score="2" ViewCount="2610" Body="&lt;p&gt;I am looking for method to use two different config files - init files. &#xA;First config: when I am coding in full Emacs windows (open file as &lt;code&gt;emacs namefile&lt;/code&gt; this define ~/.emacs_conf2)&#xA;Second: when I would fast open file (without all packages, only some shortcuts etc) into terminal (commend- &lt;code&gt;emacs namefile - nw&lt;/code&gt; this define ~/.emacs_conf2)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for answer and explanation of your methods, regards!&lt;/p&gt;&#xA;" OwnerUserId="13092" LastEditorUserId="13092" LastEditDate="2017-01-07T17:03:24.000" LastActivityDate="2017-01-10T13:51:43.323" Title="two different config files for Emacs" Tags="|init-file|start-up|config|configuration-files|" AnswerCount="3" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29864" PostTypeId="2" ParentId="29860" CreationDate="2017-01-07T17:08:47.993" Score="4" Body="&lt;p&gt;You should pose only one question per question here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For your first question: *What are the differences between the &lt;code&gt;mark-ring&lt;/code&gt; and the &lt;code&gt;global-mark-ring&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is answered very well in the Emacs manual, nodes &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Mark-Ring.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mark Ring&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Global-Mark-Ring.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Global Mark Ring&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You really owe it to yourself to learn to &lt;strong&gt;&lt;em&gt;ask Emacs&lt;/em&gt;&lt;/strong&gt;: &lt;code&gt;C-h r&lt;/code&gt; is your starting point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From node &lt;strong&gt;Global Mark Ring&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In addition to the ordinary mark ring that &lt;em&gt;belongs to each buffer&lt;/em&gt;, Emacs&#xA;  has a &lt;em&gt;single&lt;/em&gt; &quot;&lt;strong&gt;global mark ring&lt;/strong&gt;&quot;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Each time you set a mark, this is&#xA;  recorded in the global mark ring in addition to the current buffer’s own&#xA;  mark ring, &lt;strong&gt;&lt;em&gt;if you have switched buffers since the previous mark setting.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hence, the global mark ring records a sequence of &lt;strong&gt;&lt;em&gt;buffers that you have&#xA;  been in&lt;/em&gt;&lt;/strong&gt;, and, for each buffer, &lt;em&gt;a place&lt;/em&gt; where you set the mark.  The&#xA;  length of the global mark ring is controlled by &lt;code&gt;global-mark-ring-max&lt;/code&gt;,&#xA;  and is 16 by default.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If there is something unclear about that then please refine your question or pose another one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Your second question is unclear to me: &lt;em&gt;Is there any option to push all marks to global to reaching from everywhere?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you asking whether the &lt;code&gt;global-mark-ring&lt;/code&gt; could just include all marks from all buffers?  If so, the answer is no, there is no such option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you use &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt; then you have command &lt;strong&gt;&lt;code&gt;icicle-goto-any-marker&lt;/code&gt;&lt;/strong&gt;, which does let you go to any marker from any buffer.  It is bound to &lt;strong&gt;&lt;code&gt;C-0 C-SPC&lt;/code&gt;&lt;/strong&gt;. (Perhaps Helm has something similar?) You also have commands &lt;code&gt;icicle-goto-marker&lt;/code&gt;, bound to &lt;strong&gt;&lt;code&gt;C-- C-SPC&lt;/code&gt;&lt;/strong&gt;, and &lt;code&gt;icicle-goto-global-marker&lt;/code&gt;, bound to &lt;strong&gt;&lt;code&gt;C-- C-x C-SPC&lt;/code&gt;&lt;/strong&gt;, which let you navigate among only markers in a given buffer or only global markers, respectively.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;icicle-goto-any-marker&lt;/code&gt;&lt;/strong&gt; is an interactive compiled Lisp function in&#xA;  &lt;a href=&quot;https://www.emacswiki.org/emacs/download/icicles-cmd2.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;icicles-cmd2.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;code&gt;menu-bar search goto icicles icicle-goto-any-marker&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(icicle-goto-any-marker)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Like &lt;code&gt;icicle-goto-marker&lt;/code&gt;, but lets you visit markers in all buffers.&#xA;  If user option &lt;strong&gt;&lt;code&gt;icicle-show-multi-completion-flag&lt;/code&gt;&lt;/strong&gt; is non-nil, then&#xA;  each completion candidate is has two parts, the first of which is the&#xA;  name of the marker's buffer, and the second of which is the text from&#xA;  the marker's line.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;By default, candidates are sorted in buffer order and then marker&#xA;  order, that is, buffer positions.  Use &lt;code&gt;C-M-,&lt;/code&gt; or &lt;code&gt;C-,&lt;/code&gt; to change the&#xA;  sort order.  Remember too that you can use &lt;code&gt;C-A&lt;/code&gt; to toggle&#xA;  case-sensitivity (e.g., for buffer names).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;See also command &lt;code&gt;icicle-goto-global-marker&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-01-07T17:26:08.070" LastActivityDate="2017-01-07T17:26:08.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29865" PostTypeId="2" ParentId="29863" CreationDate="2017-01-07T17:16:12.217" Score="3" Body="&lt;p&gt;You can achieve this &quot;fast load, slow load&quot; using the server/client functionality of emacs, which works like this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs can be started as a server. This can either be done as a stand-alone, running a server in the background. Or, if you want to, say, run a main GUI instance of emacs, the GUI and server can be started at the same time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the server is started, it can be connected to using the &lt;code&gt;emacsclient&lt;/code&gt; application, which will connect to the presently running emacs server. This is vastly faster to activate than starting emacs from scratch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;To start emacs as a server, in the background, in your terminal, issue &lt;code&gt;emacs --daemon&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;To start the emacs server while you load emacs -- for instance, if you're using the emacs GUI, add &lt;code&gt;(server-start)&lt;/code&gt; to your &lt;code&gt;init.el&lt;/code&gt; (or init.el equivalent). &lt;/li&gt;&#xA;&lt;li&gt;To connect to the server, use &lt;code&gt;emacsclient&lt;/code&gt;. To force &lt;code&gt;emacsclient&lt;/code&gt; to open the file in question in the terminal, use the &lt;code&gt;-t&lt;/code&gt; argument. E.g.: &lt;code&gt;emacsclient -t foo.txt&lt;/code&gt;. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you run Emacs as a server, you might also appreciate having a command to stop running it: &lt;code&gt;emacsclient -e '(kill-emacs)'&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2017-01-07T17:16:12.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29866" PostTypeId="2" ParentId="29863" CreationDate="2017-01-07T17:29:43.673" Score="4" Body="&lt;p&gt;As I can see from one of your comments, the main point is to run Emacs faster in some cases. Then there are several options for you.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can load your GUI-related configuration only when you run Emacs in GUI mode. You can use something like the following code (just place your GUI-related configuration in &lt;code&gt;init_gui.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when window-system&#xA;  (load &quot;~/.emacs.d/init_gui.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: &lt;code&gt;load&lt;/code&gt; function should get the &lt;em&gt;full path&lt;/em&gt; to your &lt;code&gt;init_gui.el&lt;/code&gt;, otherwise it will search for the file in your &lt;code&gt;load-path&lt;/code&gt;. Of course, it is also possible to put the location of you &lt;code&gt;init_gui.el&lt;/code&gt; to &lt;code&gt;load-path&lt;/code&gt; with &lt;code&gt;(add-to-list 'load-path &quot;path_to_the_directory_with_your_file&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;You can autorun Emacs server and then just use &lt;code&gt;emacsclient&lt;/code&gt; to connect to it. (As far as I know Emacs server will &lt;em&gt;not&lt;/em&gt; work on Windows.) It will be quite fast even in GUI mode. In this case you need to put the following code to you configuration file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(unless (server-running-p)&#xA;  (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also, you can look at &lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;use-package&lt;/a&gt;, which can help you &quot;to isolate package configuration in your &lt;code&gt;.emacs&lt;/code&gt; file&quot;.&lt;/p&gt;&#xA;" OwnerUserId="14438" LastEditorUserId="14438" LastEditDate="2017-01-10T13:51:43.323" LastActivityDate="2017-01-10T13:51:43.323" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29867" PostTypeId="2" ParentId="29238" CreationDate="2017-01-07T18:38:15.243" Score="1" Body="&lt;p&gt;I can't say I like the idea... but maybe I only need to get used to it. Anyway, I think you can come very close to your goal :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;help-function-arglist&lt;/code&gt; tries hard to find the signature of any given function/subr ; this can be a starting point for rewriting your &lt;code&gt;easy-going-funcall&lt;/code&gt; to handle more cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another starting point is the source code of &lt;code&gt;funcall&lt;/code&gt;, which you could change to suit your needs. It's defined in C, though, so it might not be possible to do it entirely in Lisp, but otoh you probably don't need the bits that are not doable from lisp.&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2017-01-07T18:38:15.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29868" PostTypeId="2" ParentId="29843" CreationDate="2017-01-07T19:48:07.417" Score="5" Body="&lt;p&gt;For others who may want to know the answer, I finally figured it out.  In the case of ruby, you should insert a nil where you want the hline to appear.  Org represents a table as an array of arrays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I used to discover the right incantation for ruby:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: test&#xA;|  Ref | Value |&#xA;|------+-------|&#xA;| 0001 | blue  |&#xA;| 0002 | red   |&#xA;&#xA;#+HEADER: :colnames no&#xA;#+HEADER: :hlines yes&#xA;#+HEADER: :results value raw&#xA;#+BEGIN_SRC ruby :var tab=test&#xA; tab&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[&quot;Ref&quot;, &quot;Value&quot;], nil, [1, &quot;blue&quot;], [2, &quot;red&quot;]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So to generate a table with column headers and an hline, just produce an array of arrays with the first sub-array an array of headings and the second element a nil instead of a sub-array.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just use a SRC block for your favorite language to discover how it represents headings.&lt;/p&gt;&#xA;" OwnerUserId="10291" LastActivityDate="2017-01-07T19:48:07.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29869" PostTypeId="2" ParentId="29856" CreationDate="2017-01-07T20:42:32.827" Score="1" Body="&lt;p&gt;May be you could use &lt;code&gt;#+INCLUDE: b.org :minlevel 2  :lines &quot;3-&quot;&lt;/code&gt;. This will skip the  first two lines in the file b.org and therefore will not include the unwanted title and date. &lt;/p&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2017-01-07T20:42:32.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29870" PostTypeId="2" ParentId="20986" CreationDate="2017-01-07T22:10:19.423" Score="1" Body="&lt;p&gt;I just made the package &lt;code&gt;russian-holidays&lt;/code&gt; because of lack of this info for Emacs. The package reflects the current state of official holidays in Russian Federation. It also includes optional dates for regional holidays in republics of Russia. Data based mostly on Wikipedia articles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/grafov/russian-holidays&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/grafov/russian-holidays&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some official holidays in Russian regions use dates counted as offsets from Orthodox Easter like for example Радоница (&quot;Radonitsa&quot;) as 9th day after Easter or based on dates of Islamic lunar calendar like Курбан-Байрам (Eid al-Adha). So for Emacs you will need use functions from &lt;code&gt;lunar&lt;/code&gt; package and something for evaluating offsets for Orthodox Easter. For the Easter there are functions in my package mentioned above (I took them from &lt;a href=&quot;https://github.com/abo-abo/ukrainian-holidays&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/ukrainian-holidays&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the mostly full list of Russian holidays in the article &lt;a href=&quot;https://en.wikipedia.org/wiki/Public_holidays_in_Russia&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Public_holidays_in_Russia&lt;/a&gt;. Russian translation  of this article has (not complete) list of official holidays in Russian regions.&lt;/p&gt;&#xA;" OwnerUserId="2548" LastActivityDate="2017-01-07T22:10:19.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29871" PostTypeId="1" CreationDate="2017-01-07T23:05:20.810" Score="5" ViewCount="2976" Body="&lt;p&gt;I wish to embed the svg file output of gnuplot as inline svg code in the html export. Currently I do the following:&#xA;1. Manually remove the RESULTS block.&#xA;2. INCLUDE the svg file as shown in the MWE below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i configure the RESULTS block to do what I want automatically?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC gnuplot :file example-plot.svg :exports code&#xA;plot sin(x)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[file:example-plot.svg]]&#xA;&#xA;# I manually remove the above RESULTS block&#xA;# and insert the following INCLUDE&#xA;&#xA;#+INCLUDE: &quot;example-plot.svg&quot; export html&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14476" LastActivityDate="2020-03-28T20:40:10.490" Title="How to embed svg output of org-mode src block as inline svg in html export?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29872" PostTypeId="1" AcceptedAnswerId="29877" CreationDate="2017-01-08T00:11:12.320" Score="5" ViewCount="944" Body="&lt;p&gt;After far too many years of counting the number of characters in the region by doing &lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(- (point) (mark))&lt;/code&gt;, I just discovered &lt;kbd&gt;M-=&lt;/kbd&gt; (&lt;code&gt;count-words-region&lt;/code&gt;).  Much better!  But now I'm looking for a way to obtain the number of bytes that the characters in the region occupy in the buffer's coding system--typically, or always really, UTF-8.  Is there an easy way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For context, I've been doing some code golfing on codegolf.stackexchange.com in a language that supports various Unicode operators, and I need to know how many bytes my submission occupies.  So far I've been saving the region to a file, doing &lt;code&gt;ls -l&lt;/code&gt; on it, then deleting it.  I could easily whip up a function to do this automatically, but it seems rather inelegant.&lt;/p&gt;&#xA;" OwnerUserId="2463" LastEditorUserId="105" LastEditDate="2017-01-08T05:58:08.097" LastActivityDate="2017-01-10T03:19:35.650" Title="How many bytes are in the region?" Tags="|character-encoding|region|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29873" PostTypeId="1" AcceptedAnswerId="29876" CreationDate="2017-01-08T00:45:57.787" Score="4" ViewCount="1096" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uR6FZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uR6FZ.png&quot; alt=&quot;shot-1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using a dark theme, so it's a bit hard to see, but there is a black line between the modeline and the echo area in the shot above. You can also see it between the modeline and a hydra, and the hydra and the echo area below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mQ1sE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mQ1sE.png&quot; alt=&quot;shot-2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what this is, so I can get rid of it if possible?&lt;/p&gt;&#xA;" OwnerUserId="14378" LastActivityDate="2017-01-08T03:26:38.967" Title="What's this line between the modeline and the echo area?" Tags="|window|themes|mode-line|echo-area|gui-emacs|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29875" PostTypeId="1" AcceptedAnswerId="29879" CreationDate="2017-01-08T03:19:29.230" Score="1" ViewCount="256" Body="&lt;p&gt;Let us take an example such as &lt;code&gt;(max 0 (/ 8 0))&lt;/code&gt; -- the problem is the argument to &lt;code&gt;/&lt;/code&gt; -- i.e., DIVISORS cannot be 0.  The debugging output looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (arith-error)&#xA;  /(8 0)&#xA;  (max 0 (/ 8 0))&#xA;  eval((max 0 (/ 8 0)) nil)&#xA;  elisp--eval-last-sexp(nil)&#xA;  eval-last-sexp(nil)&#xA;  funcall-interactively(eval-last-sexp nil)&#xA;  call-interactively(eval-last-sexp nil nil)&#xA;  command-execute(eval-last-sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I modify &lt;code&gt;debugger-mode&lt;/code&gt; so that the problem function &lt;code&gt;/&lt;/code&gt; (on the second line from the top) is a different color -- e.g., text-property &quot;red&quot;; and, perhaps an indication that the problem is the DIVISORS argument?&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-08T03:33:19.957" LastActivityDate="2017-01-08T09:06:55.043" Title="Debugging -- debugger-mode -- how to highlight the culprit" Tags="|debug|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29876" PostTypeId="2" ParentId="29873" CreationDate="2017-01-08T03:26:38.967" Score="3" Body="&#xA;&#xA;&lt;p&gt;Since you're using my &lt;a href=&quot;https://github.com/hlissner/emacs-doom-theme&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs theme&lt;/a&gt; and could be using my &lt;a href=&quot;https://github.com/hlissner/.emacs.d&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs.d config&lt;/a&gt;, I suspect you have &lt;code&gt;window-divider-mode&lt;/code&gt; enabled, which adds this border. You can either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Set the bottom border's width to 0: &lt;code&gt;(setq window-divider-default-bottom-width 0)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Turn off the bottom border: &lt;code&gt;(setq window-divider-default-places 'right-only)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;or turn off &lt;code&gt;window-divider-mode&lt;/code&gt; altogether: &lt;code&gt;(window-divider-mode -1)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For reference, here is my &lt;code&gt;window-divider-mode&lt;/code&gt; config, taken from &lt;a href=&quot;https://github.com/hlissner/.emacs.d/blob/master/core/core-ui.el#L103&quot; rel=&quot;nofollow noreferrer&quot;&gt;core/core-ui.el&lt;/a&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; `window-divider-mode' gives us finer control over the border between windows.&#xA;;; The native border &quot;consumes&quot; a pixel of the left fringe on righter-most splits&#xA;;; (in Yamamoto's emacs-mac at least), window-divider does not.&#xA;;; NOTE Only available on Emacs 25.1+&#xA;(when (boundp 'window-divider-mode)&#xA;  (setq window-divider-default-places t&#xA;        window-divider-default-bottom-width 1&#xA;        window-divider-default-right-width 1)&#xA;  (window-divider-mode +1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10182" LastActivityDate="2017-01-08T03:26:38.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29877" PostTypeId="2" ParentId="29872" CreationDate="2017-01-08T05:57:18.247" Score="4" Body="&lt;p&gt;Sounds like you are asking for something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun region-bytes ()&#xA;  (interactive)&#xA;  (let ((strg  (if (use-region-p)&#xA;                   (buffer-substring-no-properties (region-beginning) (region-end))&#xA;                 &quot;&quot;)))&#xA;    (message &quot;Region has %d bytes&quot; (string-bytes strg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You might also be interested in showing the region size in the mode line. You can do that with library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/modeline-posn.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;modeline-posn.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; -- see &lt;a href=&quot;https://www.emacswiki.org/emacs/ModeLinePosition&quot; rel=&quot;noreferrer&quot;&gt;Mode Line Position&lt;/a&gt;.  One of the style choice is to show the number of bytes in the active region -- just what you are asking for here.  The difference is that it would always be shown (when the region is active), instead of being reported as a message only on demand (as per the command above).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-01-08T06:34:02.763" LastActivityDate="2017-01-08T06:34:02.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29879" PostTypeId="2" ParentId="29875" CreationDate="2017-01-08T08:03:37.740" Score="1" Body="&lt;p&gt;The following answer only addresses the issue of highlighting all the C source code functions in the &lt;code&gt;*Backtrace*&lt;/code&gt;.  The unmodified stock version of &lt;code&gt;debugger-make-xrefs&lt;/code&gt; searches the debugging buffer for matches of &lt;code&gt;(symbol-file sym 'defun)&lt;/code&gt;, which necessarily excludes the built-in C source code functions.  Note that the C source code files must be installed to jump to the function definition -- e.g., the source code directory can be configured as follows:  &lt;code&gt;(setq find-function-C-source-directory &quot;/path/to/src&quot;)&lt;/code&gt;.  Here is the link to the new feature request:  &lt;a href=&quot;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25393&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25393&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'debug)&#xA;&#xA;(defun debugger-make-xrefs (&amp;amp;optional buffer)&#xA;  &quot;Attach cross-references to function names in the `*Backtrace*' buffer.&quot;&#xA;  (interactive &quot;b&quot;)&#xA;  (with-current-buffer (or buffer (current-buffer))&#xA;    (save-excursion&#xA;      (setq buffer (current-buffer))&#xA;      (let ((inhibit-read-only t)&#xA;      (old-end (point-min)) (new-end (point-min)))&#xA;  (if debugger-previous-backtrace&#xA;      (let (old-start new-start (all-match t))&#xA;        (goto-char (point-max))&#xA;        (with-temp-buffer&#xA;    (insert debugger-previous-backtrace)&#xA;    (while (and all-match (not (bobp)))&#xA;      (setq old-end (point))&#xA;      (forward-line -1)&#xA;      (setq old-start (point))&#xA;      (with-current-buffer buffer&#xA;        (setq new-end (point))&#xA;        (forward-line -1)&#xA;        (setq new-start (point)))&#xA;      (if (not (zerop&#xA;          (let ((case-fold-search nil))&#xA;            (compare-buffer-substrings&#xA;             (current-buffer) old-start old-end&#xA;             buffer new-start new-end))))&#xA;          (setq all-match nil))))&#xA;        (delete-region new-end (point-max))&#xA;        (goto-char (point-max))&#xA;        (insert (substring debugger-previous-backtrace&#xA;         (- old-end (point-min))))&#xA;        (narrow-to-region (point-min) new-end)))&#xA;  (goto-char (point-min))&#xA;  (while (progn&#xA;     (goto-char (+ (point) 2))&#xA;     (skip-syntax-forward &quot;^w_&quot;)&#xA;     (not (eobp)))&#xA;    (let* ((beg (point))&#xA;           (end (progn (skip-syntax-forward &quot;w_&quot;) (point)))&#xA;           (fn (function-called-at-point)) ;; MODIFICATION&#xA;           (sym (intern-soft (buffer-substring-no-properties beg end)))&#xA;           ;; MODIFICATION -- excerpt borrowed from `describe-function-1'&#xA;           (file &#xA;             (if fn&#xA;               (let* (&#xA;                  (function fn)&#xA;                  (advised (and (symbolp function)&#xA;                      (featurep 'nadvice)&#xA;                      (advice--p (advice--symbol-function function))))&#xA;                   ;; If the function is advised, use the symbol that has the&#xA;                   ;; real definition, if that symbol is already set up.&#xA;                   (real-function&#xA;                    (or (and advised&#xA;                                    (advice--cd*r (advice--symbol-function function)))&#xA;                        function))&#xA;                   ;; Get the real definition.&#xA;                   (def (if (symbolp real-function)&#xA;                     (or (symbol-function real-function)&#xA;                         (signal 'void-function (list real-function)))&#xA;                   real-function))&#xA;                   (aliased (or (symbolp def)&#xA;                         ;; Advised &amp;amp; aliased function.&#xA;                         (and advised (symbolp real-function)&#xA;                        (not (eq 'autoload (car-safe def))))))&#xA;                   (file-name (find-lisp-object-file-name function (if aliased 'defun&#xA;                                                                        def))))&#xA;                 file-name)&#xA;               (and sym (symbol-file sym 'defun)))))&#xA;      (when file&#xA;        (goto-char beg)&#xA;        (re-search-forward &quot;\\(\\sw\\|\\s_\\)+&quot;)&#xA;        (help-xref-button 0 'help-function-def sym file)))&#xA;    (forward-line 1))&#xA;  (widen))&#xA;      (setq debugger-previous-backtrace (buffer-string)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-08T09:06:55.043" LastActivityDate="2017-01-08T09:06:55.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29880" PostTypeId="2" ParentId="29064" CreationDate="2017-01-08T10:01:13.883" Score="-1" Body="&lt;p&gt;If you follow instructions for building jdee-server you will find the bundle files in 'target' directory. All the instructions are under the link.&lt;/p&gt;&#xA;" OwnerUserId="828" LastEditorUserId="828" LastEditDate="2017-01-09T19:45:28.413" LastActivityDate="2017-01-09T19:45:28.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29881" PostTypeId="2" ParentId="29871" CreationDate="2017-01-08T10:03:34.170" Score="7" Body="&lt;p&gt;The cleanest solution would be if the babel authors would include it as a option for blocks that can produce SVG output. The solution I give here uses a :post option that invokes another src code block filtering the results of the current block. This is a powerful technique, but it can also make the code more difficult to read and debug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I define the postFileToIclude filter function to use in the later code block, and I test it by giving it a file link string (someplot.svg) explicitely.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  #+NAME: postFileToInclude&#xA;  #+HEADER: :var text=&quot;[[file:someplot.svg]]&quot;&#xA;  #+BEGIN_SRC elisp :results value raw drawer&#xA;    (with-temp-buffer&#xA;      (erase-buffer)&#xA;      (cl-assert text nil &quot;PostFileToInclude received nil instead of text &quot;)&#xA;      (insert text)&#xA;      (beginning-of-buffer)&#xA;      (if (re-search-forward org-any-link-re nil t)&#xA;    (progn (let ((fname (match-string 2)))&#xA;         (replace-match&#xA;          (format &quot;#+INCLUDE: \&quot;%s\&quot; export html&quot; fname))&#xA;         ))&#xA;        (error &quot;PostFileToInclude: Was not able to find link in output&quot;))&#xA;      (buffer-string)&#xA;      )&#xA;  #+END_SRC&#xA;&#xA;  #+RESULTS: postFileToInclude&#xA;  :RESULTS:&#xA;  #+INCLUDE: &quot;file:someplot.svg&quot; export html&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we use this function in a :post argument for filtering your src block. One also needs to add a :results option, so that the output is not in an example environment. I also add a drawer, so that repeated executions will be able to correctly replace the results of previous evaluations.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  #+BEGIN_SRC gnuplot :file example-plot.svg :exports code :post postFileToInclude :results raw drawer&#xA;    plot sin(x)&#xA;  #+END_SRC  &#xA;&#xA;  #+RESULTS:&#xA;  :RESULTS:&#xA;  #+INCLUDE: &quot;file:example-plot.svg&quot; export html&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2017-01-08T10:03:34.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29882" PostTypeId="1" CreationDate="2017-01-08T10:28:07.170" Score="2" ViewCount="71" Body="&lt;p&gt;I cannot use &lt;code&gt;Gnus&lt;/code&gt; anymore because of the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gnus-group-make-group: Could not create group on server: NO (ALREADYEXISTS) Duplicate folder name Agenda (Failure)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I couldn't find anything about this error on the Web and I have no idea where to remove this duplicate on my computer.&lt;/p&gt;&#xA;" OwnerUserId="5267" LastActivityDate="2017-01-08T10:28:07.170" Title="gnus-group-make-group error: Duplicate folder name" Tags="|gnus|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29883" PostTypeId="1" CreationDate="2017-01-08T13:10:34.783" Score="1" ViewCount="336" Body="&lt;p&gt;I would like to apply the steps in:&#xA;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-google-sync.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/worg/org-tutorials/org-google-sync.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am starting with updating my Org-mode entries in my Google calender.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, to have an ics file online for Google calender automatic update, I tried to publish the file through MEGAsync as a shared file/directory and supplying the link to Google, which did not work (Google complaining about no ics file). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to automate the export (eventually cron-job) from Org to ics and the update on the online server and just wait for Google to update it (once a day is Okay for me).    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So any help is appreciated!&lt;/p&gt;&#xA;" OwnerUserId="14356" LastActivityDate="2017-01-08T13:10:34.783" Title="On exporting Org-agenda to Google Calender via online ics file" Tags="|org-mode|calendar|ical|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29884" PostTypeId="2" ParentId="29836" CreationDate="2017-01-08T14:21:06.350" Score="17" Body="&lt;p&gt;First to fix terminology, I think you are asking for the &quot;heading&quot; of the entry.  &quot;Title&quot; usually refers to the document title in &lt;code&gt;org-mode&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;org-mode&lt;/code&gt; version &lt;code&gt;9.0.3&lt;/code&gt; there is a function to retrieve elements of the heading, `org-heading-components', which returns a list whose 5th element is the title.  Thus the title my be retrieved by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(nth 4 (org-heading-components))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;org-mode&lt;/code&gt; also maps the heading to a property.  Its name is not quite logical, but running &lt;code&gt;org-entry-properties&lt;/code&gt; reveals that it is stored under &lt;code&gt;ITEM&lt;/code&gt;.  Thus you are looking for &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-entry-get nil &quot;ITEM&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2710" LastEditDate="2017-01-09T12:31:39.443" LastActivityDate="2017-01-09T12:31:39.443" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29885" PostTypeId="1" CreationDate="2017-01-08T16:49:04.550" Score="1" ViewCount="556" Body="&lt;p&gt;&lt;strong&gt;Important Note&lt;/strong&gt;: As of Spring 2020, &lt;code&gt;ob-stata.el&lt;/code&gt; via Emacs Speaks Statistics has been deprecated.  Even the updated version described below in this thread is broken.  I (the author of the updated &lt;code&gt;ob-stata.el&lt;/code&gt; mentioned below ) have switched over to &lt;code&gt;stata_kernel&lt;/code&gt;, &lt;a href=&quot;https://rlhick.people.wm.edu/posts/stata_kernel_emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;More details here&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have built the latest Emacs 26.0.50.1 on a Debian OS 8 (Jessie) that&#xA;uses Linux version 3.14.5. Then I installed org-mode version 9.0.3. I&#xA;want to use the proprietary data analysis and statistical software&#xA;Stata version 14. I have checked that it runs alright within Emacs&#xA;thanks to ESS by typing  &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;stata&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;However, I also want to evaluate Stata code in org-mode documents. For that I have&#xA;downloaded the script &lt;code&gt;ob-stata.el&lt;/code&gt; by Ista Zahn and I have saved it&#xA;together with the other &lt;code&gt;ob-sth.el&lt;/code&gt; files in&#xA;&lt;code&gt;~/.emacs.d/elpa/org-20161224&lt;/code&gt;. Moreover, I have edited the entry:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-babel-stata-command inferior-STA-program-name&#xA;  &amp;quot;Name of command to use for executing stata code.&amp;quot;&#xA;  :group 'org-babel&#xA;  :version &amp;quot;24.1&amp;quot;&#xA;  :package-version '(Org . &amp;quot;8.3&amp;quot;)&#xA;  :type 'string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;to reflect my current version of Org, so this piece of code currently&#xA;stands as follows in my version of  &lt;code&gt;ob-stata.el&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-babel-stata-command inferior-STA-program-name&#xA;  &amp;quot;Name of command to use for executing stata code.&amp;quot;&#xA;  :group 'org-babel&#xA;  :version &amp;quot;24.1&amp;quot;&#xA;  :package-version '(Org . &amp;quot;9.0.3&amp;quot;)&#xA;  :type 'string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;However, if I add &lt;code&gt;(stata . t)&lt;/code&gt; to =org-babel-do-load-languages= as follows:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(org-babel-do-load-languages&#xA;   'org-babel-load-languages&#xA;  '((emacs-lisp . t)&#xA;    (sh . t)&#xA;    (R . t)&#xA;    (perl . t)&#xA;    (ruby . t)&#xA;    (python . t)&#xA;    (js . t)&#xA;    (haskell . t)&#xA;    (stata . t)&#xA;    (shell . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I get the following message when I restart emacs:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Debugger entered--Lisp error: (void-variable inferior-STA-program-name)&lt;br /&gt;&#xA;eval(inferior-STA-program-name)&lt;br /&gt;&#xA;custom-initialize-reset(org-babel-stata-command inferior-STA-program-name)&lt;br /&gt;&#xA;custom-declare-variable(org-babel-stata-command inferior-STA-program-name   &amp;quot;Name of command to use for executing stata code.&amp;quot; :group org-babel :version   &amp;quot;24.1&amp;quot; :package-version (Org . &amp;quot;9.0.3&amp;quot;) :type string)&lt;br /&gt;&#xA;....&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I have checked that the file &lt;code&gt;ess-sta-d.el&lt;/code&gt; located in&#xA;&lt;code&gt;/.emacs.d/elpa/ess-20161101.215/lisp&lt;/code&gt; has the line&#xA;&lt;code&gt;(inferior-ess-program  . inferior-STA-program-name)&lt;/code&gt; included in the&#xA;definition of the variable =STA-customize-alist= as follows:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar STA-customize-alist&#xA;  '((ess-local-customize-alist     . 'STA-customize-alist)&#xA;    (ess-language                  . &amp;quot;STA&amp;quot;)&#xA;    (ess-dialect                   . STA-dialect-name)&#xA;    (ess-suffix                    . &amp;quot;ado&amp;quot;)&#xA;    (ess-mode-editing-alist        . STA-editing-alist)&#xA;    (ess-mode-syntax-table         . STA-syntax-table)&#xA;    (ess-mode-edit                 . 'STA-mode)&#xA;    (ess-help-sec-regex            . ess-help-STA-sec-regex)&#xA;    (ess-help-sec-keys-alist       . ess-help-STA-sec-keys-alist)&#xA;    (ess-loop-timeout              . 500000 )&#xA;    (ess-object-name-db-file       . &amp;quot;ess-sta-namedb.el&amp;quot; )&#xA;    (ess-help-web-search-command   . &amp;quot;http://www.stata.com/search/?q=%s&amp;amp;restrict=&amp;amp;btnG=Search&amp;amp;client=stata&amp;amp;num=&amp;amp;output=xml_no_dtd&amp;amp;site=stata&amp;amp;ie=&amp;amp;oe=UTF-8&amp;amp;sort=&amp;amp;proxystylesheet=stata&amp;quot;)&#xA;    (ess-eval-linewise-function    . #'stata-eval-linewise)&#xA;    (inferior-ess-font-lock-defaults . ess-STA-mode-font-lock-defaults)&#xA;    (inferior-ess-program          . inferior-STA-program-name)&#xA;    (inferior-ess-objects-command  . &amp;quot;describe\n&amp;quot;)&#xA;    (inferior-ess-help-command     . &amp;quot;help %s\n&amp;quot;) ;; assumes set more off&#xA;    (inferior-ess-exit-command     . &amp;quot;exit\n&amp;quot;)&#xA;    ;; --more-- is necessary here (hangs otherwise if startup stata.msg is big)&#xA;    (inferior-ess-primary-prompt   . &amp;quot;[.:] \\|--more--&amp;quot;)&#xA;    (inferior-ess-secondary-prompt . &amp;quot;--more--&amp;quot;)&#xA;    (comint-use-prompt-regexp      . t)&#xA;    (inferior-ess-start-file       . inferior-STA-start-file) ;&amp;quot;~/.ess-stata&amp;quot;)&#xA;    (inferior-ess-start-args       . inferior-STA-start-args)&#xA;    (ess-get-help-topics-function  . 'ess-get-STA-help-topics)&#xA;    (inferior-ess-search-list-command   . &amp;quot;set more off\n search()\n&amp;quot;)&#xA;    (comment-start                . &amp;quot;/\* &amp;quot;)&#xA;    (comment-end                  . &amp;quot; \*/&amp;quot;)&#xA;    (comment-start-skip           . &amp;quot;/\\*+ *&amp;quot;)&#xA;    (comment-use-syntax           . t) ;; needed for multiline&#xA;    (ess-execute-screen-options-command . &amp;quot;set linesize %s\n&amp;quot;)&#xA;    )&#xA;  &amp;quot;Variables to customize for Stata.&amp;quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;From here on I am lost. I have checked the corresponding scripts for&#xA;other languages and in them &lt;code&gt;inferior-ess-program&lt;/code&gt; is also and correctly&#xA;assigned to their inferior program name. I don't understand why this&#xA;does not happen with Stata.&lt;/p&gt;&#xA;&lt;p&gt;Any help is greatly appreciated! I normally use R but Stata is&#xA;the industry standard in econometrics and I am bound to use it when&#xA;working with colleagues.&lt;/p&gt;&#xA;&lt;p&gt;Thank you very much,&#xA;Daniel&lt;/p&gt;&#xA;&lt;p&gt;News: Thanks to an email from Nicolas Goaziou I've managed to solve this problem. First, I've reverted to&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom org-babel-stata-command inferior-STA-program-name&#xA;  &amp;quot;Name of command to use for executing stata code.&amp;quot;&#xA;  :group 'org-babel&#xA;  :version &amp;quot;24.4&amp;quot;&#xA;  :package-version '(Org . &amp;quot;8.3&amp;quot;)&#xA;  :type 'string)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;in &lt;code&gt;ob-stata.el&lt;/code&gt; because as Nicolas noted, &lt;em&gt;package-version is used to specify when a defcustom was introduced or when its default value last changed&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then I placed&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'ess) &#xA;(require 'ob-stata)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;before&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;  (org-babel-do-load-languages&#xA;   'org-babel-load-languages&#xA;  '((emacs-lisp . t)&#xA;    (sh . t)&#xA;    (R . t)&#xA;    (perl . t)&#xA;    (ruby . t)&#xA;    (python . t)&#xA;    (js . t)&#xA;    (haskell . t)&#xA;    (stata . t)&#xA;    (shell . t)&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;in my &lt;code&gt;init.el&lt;/code&gt; file.&lt;/p&gt;&#xA;&lt;p&gt;With this setup emacs started without complaining at all. However, when I tried to run &lt;code&gt;stata&lt;/code&gt; code in org mode gave me an error,&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;org-babel-get-header not defined&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;that is well reported &lt;a href=&quot;https://github.com/pope/ob-go/issues/10&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-orgmode/2016-01/msg00486.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;  (recall the &lt;code&gt;ob-stata.el&lt;/code&gt; is a fork of &lt;code&gt;ob-julia.el&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;So I wrote:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(let ((vars (mapcar #'cdr (org-babel--get-vars params))))&lt;/code&gt; in &lt;code&gt;ob-stata.el&lt;/code&gt; instead of the original&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(let ((vars (mapcar #'cdr (org-babel-get-header params :var))))&lt;/code&gt; in &lt;code&gt;ob-stata.el&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;With all this, now stata code in org mode runs smoothly. Another issue is that export to &lt;code&gt;html&lt;/code&gt; is alright but I have found out that neither the &lt;code&gt;minted&lt;/code&gt; nor the &lt;code&gt;listings&lt;/code&gt; packages in LaTeX recognize &lt;code&gt;stata&lt;/code&gt; and so I cannot get a pdf with the code and its output... but this is another story.&lt;/p&gt;&#xA;&lt;p&gt;Again, thank you very much, Nicolas! Daniel&lt;/p&gt;&#xA;" OwnerUserId="14478" LastEditorUserId="105" LastEditDate="2023-06-16T22:10:53.907" LastActivityDate="2023-06-16T22:10:53.907" Title="Error when (stata . t) added to org-babel-do-load-languages in an attempt to evaluate Stata code in org-mode" Tags="|org-mode|babel|" AnswerCount="1" CommentCount="4" ClosedDate="2019-04-11T18:19:01.750" ContentLicense="CC BY-SA 4.0" />
  <row Id="29886" PostTypeId="1" CreationDate="2017-01-08T21:47:31.570" Score="1" ViewCount="898" Body="&lt;p&gt;I have written code that returns lists of symbols representing modules and exported functions of a programming language. How do I integrate it with some autocompletion in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at company and completion-at-point-functions. I managed to run simple example successfully, and then I realised that all these examples use a predefined list of completion candidates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last code sample on the following page is a good example&#xA;&lt;a href=&quot;http://sixty-north.com/blog/writing-the-simplest-emacs-company-mode-backend&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://sixty-north.com/blog/writing-the-simplest-emacs-company-mode-backend&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not know what the completion candidates will be at this point. How do I create a dynamic list of candidates generated when I run M-x company-sample-backend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, the example at sixty-north.com can be easily modified to use dynamic completion. The problem lies elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing constant&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst sample-completions&#xA;  '(&quot;alan&quot; &quot;john&quot; &quot;ada&quot; &quot;don&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with a function returning strings with random content and calling that function at the bottom of the backend function works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end I have settled on following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'company)&#xA;&#xA;(defun company-lfe-backend (command &amp;amp;optional arg &amp;amp;rest ignored)&#xA;  (interactive (list 'interactive))&#xA;&#xA;  (case command&#xA;    (interactive (company-begin-backend 'company-lfe-backend))&#xA;    ;; unfinished code related to major modes&#xA;    (prefix (and (or t&#xA;                     (eq major-mode 'fundamental-mode))&#xA;                 (company-grab-symbol)))&#xA;    (candidates&#xA;     (-map 'symbol-name&#xA;           (-flatten&#xA;            ;; following function returns the structure containing possible&#xA;            ;; auto completions&#xA;            (lfedoc-sexp-autocompletion-at-point))))))&#xA;&#xA;(add-to-list 'company-backends 'company-lfe-backend)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8952" LastEditorUserId="8952" LastEditDate="2017-01-09T13:26:59.457" LastActivityDate="2017-01-09T13:26:59.457" Title="How do I add autocompletion for a new language?" Tags="|company-mode|auto-complete-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29887" PostTypeId="1" CreationDate="2017-01-08T22:51:06.697" Score="1" ViewCount="126" Body="&lt;p&gt;It's hard to say what was broken in my .emacs but with new Emacs 25.1.1 after opening file from &lt;code&gt;recentf&lt;/code&gt; point is placed at the beginning of buffer whereas with Emacs 24 it opens in last viewed location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion to make Emacs 25 place point in last viewed position between file re-opening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this: &lt;a href=&quot;http://hg.defun.work/dot-emacs/file/tip/.emacs-my&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://hg.defun.work/dot-emacs/file/tip/.emacs-my&lt;/a&gt; work in Emacs 24 and doesn't in Emacs 25...&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-01-09T00:23:19.443" Title="Keep point position between re-opening files with recentf/ido" Tags="|point|recentf|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29888" PostTypeId="2" ParentId="29887" CreationDate="2017-01-09T00:23:19.443" Score="2" Body="&lt;p&gt;Seems that I used deprecated way for activating minor mode (this works across Emacs 21-24):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default save-place t)&#xA;(require 'saveplace)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Today way to activate this minor mode is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-place-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;strong&gt;Drew&lt;/strong&gt; for hint!&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-01-09T00:23:19.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29889" PostTypeId="2" ParentId="29836" CreationDate="2017-01-09T02:41:21.553" Score="2" Body="&lt;p&gt;The current stable version of Emacs as of 01/08/2017 is 25.1.1, which was released on or about 09/20/2016.  The version of &lt;code&gt;org-mode&lt;/code&gt; that ships with the aforementioned version of Emacs is 8.2.10.  The current stable of release of &lt;code&gt;org-mode&lt;/code&gt; as of 01/08/2017 is 9.0.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to &lt;code&gt;org-mode&lt;/code&gt; version 8.2.10, &lt;code&gt;&quot;ITEM&quot;&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; a member of &lt;code&gt;org-special-properties&lt;/code&gt; by default.  As to &lt;code&gt;org-mode&lt;/code&gt; version 8.2.10, the function &lt;code&gt;org-entry-properties&lt;/code&gt; does &lt;em&gt;not&lt;/em&gt; have a subsection specifically allocated to extracting the &lt;code&gt;&quot;ITEM&quot;&lt;/code&gt;.  Here is what the &lt;em&gt;missing&lt;/em&gt; snippet would look like if someone wanted to add this feature -- the logical place to plug this snippet in would be between the section dealing with &lt;code&gt;&quot;PRIORITY&quot;&lt;/code&gt; and the section dealing with &lt;code&gt;&quot;FILE&quot;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(when (or (not specific) (string= specific &quot;ITEM&quot;))&#xA;  (let ((case-fold-search nil))&#xA;    (when (looking-at org-complex-heading-regexp)&#xA;      (push (cons &quot;ITEM&quot;&#xA;                  (let ((title (match-string-no-properties 4)))&#xA;                    (if (org-string-nw-p title)&#xA;                      (org-remove-tabs title)&#xA;                      &quot;&quot;)))&#xA;            props))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As to &lt;code&gt;org-mode&lt;/code&gt; version 9.0.3, &lt;code&gt;&quot;ITEM&quot;&lt;/code&gt; &lt;strong&gt;is&lt;/strong&gt; a member of &lt;code&gt;org-special-properties&lt;/code&gt; by default.  As to &lt;code&gt;org-mode&lt;/code&gt; version 9.0.3, the function &lt;code&gt;org-entry-properties&lt;/code&gt; already has a dedication section to deal with &lt;code&gt;&quot;ITEM&quot;&lt;/code&gt; -- said function has also evolved in other aspects since 8.2.10 (e.g., &lt;code&gt;catch 'exit&lt;/code&gt; and &lt;code&gt;throw exit ...&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since most people will likely upgrade to the most recent version of &lt;code&gt;org-mode&lt;/code&gt;, @lawlist will accept the answer of @Andrew Swann.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-01-09T02:41:21.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29891" PostTypeId="1" AcceptedAnswerId="31957" CreationDate="2017-01-09T03:40:08.517" Score="7" ViewCount="291" Body="&lt;p&gt;I'd like to run &lt;a href=&quot;http://nongnu.org/txr/txr-lisp.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;txr lisp&lt;/a&gt; as an inferior-lisp process in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From bash in xterm I can start a repl with &lt;code&gt;txr -i&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1fGwR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1fGwR.png&quot; alt=&quot;txr -i works from xterm&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I first need to change the &lt;code&gt;inferior-lisp-program&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq inferior-lisp-program &quot;txr -i&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I try to run it:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;M-x run-lisp&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After I type the expression I want to evaluate I press the &lt;code&gt;enter&lt;/code&gt; key and I see escape codes rather than the evaluation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xDftQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xDftQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also observe this behavior on a fresh instance of emacs started with &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the txr man page:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The interactive listener is based on 8 bit  character  processing. &#xA;  Its&#xA;         editing functions do not recognize UTF-8 multi-byte characters.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've tried changing the buffer coding system with &lt;code&gt;set-buffer-process-coding-system&lt;/code&gt; to &lt;code&gt;raw-text&lt;/code&gt; and &lt;code&gt;us-ascii&lt;/code&gt; with no luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How might I debug/fix this?&lt;/p&gt;&#xA;" OwnerUserId="55" LastEditorUserId="55" LastEditDate="2017-01-19T02:56:55.217" LastActivityDate="2017-04-05T19:51:15.460" Title="Trying to run a lisp-dialect through inferior-lisp, but can't evaluate code" Tags="|inferior-lisp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29892" PostTypeId="1" AcceptedAnswerId="29904" CreationDate="2017-01-09T05:05:39.933" Score="4" ViewCount="314" Body="&lt;p&gt;I've set up &lt;code&gt;ert&lt;/code&gt; test results to display in a separate frame, if one exists, and in a bottom side-window otherwise:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'display-buffer-alist&#xA;             '(&quot;\\`\\*ert\\*\\'&quot;&#xA;               (display-buffer-reuse-window&#xA;                display-buffer-in-side-window)&#xA;               (reusable-frames      . visible)&#xA;               (inhibit-switch-frame . t)&#xA;               (side                 . bottom)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In either case, I don't want the results window to gain focus, as I'd rather keep focus on the window I was editing in. So far, I can't find a way to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even when I've broken off a separate frame for the results, and despite specifying &lt;code&gt;(inhibit-switch-frame . t)&lt;/code&gt;, the results frame+window steals focus every time I trigger tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I even tried implementing a wrapper function to reselect the original window &amp;amp; frame, but even that isn't working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-ert ()&#xA;  (let ((original-frame  (selected-frame))&#xA;        (original-window (selected-window)))&#xA;    (ert-run-tests-interactively t)&#xA;    (select-frame  original-frame)&#xA;    (select-window original-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="105" LastEditDate="2017-01-09T15:47:03.650" LastActivityDate="2017-01-09T15:47:03.650" Title="Stop ERT results frame from stealing focus" Tags="|frames|ert|selected-window|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29894" PostTypeId="1" AcceptedAnswerId="29900" CreationDate="2017-01-09T06:53:29.847" Score="2" ViewCount="1349" Body="&lt;p&gt;Is there a way to commit only the lines with non-white-space changes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;(add-hook 'before-save-hook 'delete-trailing-whitespace)&lt;/code&gt; in my &lt;code&gt;.init.el&lt;/code&gt; and this usually helps me avoid committing trailing white spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I'm working on a project that does not care about those trailing white spaces, the setting makes a huge diff on files I've saved.  It might be possible to make the setting &lt;em&gt;per project&lt;/em&gt;, but I'm looking for a way to tell Magit to handle it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found a similar question for git proper at &lt;a href=&quot;https://stackoverflow.com/questions/3515597&quot;&gt;https://stackoverflow.com/questions/3515597&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;git diff&lt;/code&gt; has a variety of options for white spaces &lt;code&gt;--ignore-space-at-eol&lt;/code&gt;, &#xA;&lt;code&gt;--ignore-space-change&lt;/code&gt;, &lt;code&gt;--ignore-all-space&lt;/code&gt;, and &lt;code&gt;--ignore-blank-lines&lt;/code&gt;.  It would be nice if we could select those options at magit's popup window.&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-01-09T13:06:30.790" Title="magit: commit without whitespace-only changes" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29895" PostTypeId="1" AcceptedAnswerId="29896" CreationDate="2017-01-08T21:04:05.330" Score="1" ViewCount="1054" Body="&lt;p&gt;The screenshot below is my current emacs powerline:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/F2suK.png&quot; alt=&quot;emacs-powerline&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty happy with the theme, but I'd like to slightly change the color of the text in the blue areas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I put in my &lt;code&gt;.emacs&lt;/code&gt; file to achieve this? &lt;/p&gt;&#xA;" OwnerUserId="14499" OwnerDisplayName="adc" LastActivityDate="2017-01-09T08:04:13.120" Title="How can I slightly modify an emacs powerline theme?" Tags="|themes|powerline|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29896" PostTypeId="2" ParentId="29895" CreationDate="2017-01-09T08:04:13.120" Score="2" Body="&lt;p&gt;The best place to start is with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x list-faces-display&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will open a buffer which shows the names for all currently defined faces and show their current setting. If you click on one of the face names, it will open up a customiz-face buffer where you can change the face settings. Save the changes and they will be written to the custom section of your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that powerline uses a combination of powerline specific faces and mode-line specific faces. I cannot tell exactly which faces are involved from your screen shot, but you should be able to identify them with the list-faces-display command. &lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2017-01-09T08:04:13.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29897" PostTypeId="1" CreationDate="2017-01-09T10:11:27.330" Score="3" ViewCount="308" Body="&lt;p&gt;I am using the diary both to save my calendar appointments and to write notes. Consequently I always read and write my diary file (on the same window, which means I open the real diary file), and I appreciate to have the entries chronologically ordered when I am about to write something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the function that allows to write diary entries from Calendar (e.g. with &lt;code&gt;i d&lt;/code&gt;) because it avoids mistakes when typing the date. But adding diary entries this way only appends the entry at the end of the diary file, and I would like them to be automatically put at the right chronological place in this file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did not find any solution in the manual. Is there a way to do this ?&lt;/p&gt;&#xA;" OwnerUserId="13877" LastActivityDate="2017-02-08T14:33:14.790" Title="Adding diary entries in chronological order rather than appending to the file" Tags="|calendar|diary|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29898" PostTypeId="2" ParentId="29720" CreationDate="2017-01-09T10:39:04.210" Score="0" Body="&lt;p&gt;as @John Kitchin suggested the perfect solution was to add it to the org-file list . this code now allows me to C-c C-o on the link and open it in a editor program to quick edit photos&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;(eval-after-load &quot;org&quot;&#xA;(lambda ()&#xA;(if (assoc &quot;\\.avi\\'&quot; org-file-apps)&#xA;(setcdr (assoc &quot;\\.avi\\'&quot; org-file-apps) &quot;vlc %s&quot;)&#xA;(add-to-list 'org-file-apps '(&quot;\\.avi\\'&quot; . &quot;vlc %s&quot;) t))&#xA;(if (assoc &quot;\\.png\\'&quot; org-file-apps)&#xA;(setcdr (assoc &quot;\\.png\\'&quot; org-file-apps) &quot;pinta %s&quot;)&#xA;(add-to-list 'org-file-apps '(&quot;\\.png\\'&quot; . &quot;pinta %s&quot;) t))&#xA;(if (assoc &quot;\\.mp4\\'&quot; org-file-apps)&#xA;(setcdr (assoc &quot;\\.mp4\\'&quot; org-file-apps) &quot;vlc %s&quot;)&#xA;(add-to-list 'org-file-apps '(&quot;\\.mp4\\'&quot; . &quot;vlc %s&quot;) t))))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2017-01-09T10:39:04.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29899" PostTypeId="2" ParentId="29897" CreationDate="2017-01-09T11:37:31.723" Score="1" Body="&lt;p&gt;Have you looked at &lt;code&gt;org-sort-entries&lt;/code&gt;? That can sort a subtree of org items by a variety of means -- it prompts you if you call this interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'd have to manually call that rather than inserting them in your preferred order. It would be reasonably straightforward to automate that sorting on a hook if you required.&lt;/p&gt;&#xA;" OwnerUserId="737" LastActivityDate="2017-01-09T11:37:31.723" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29900" PostTypeId="2" ParentId="29894" CreationDate="2017-01-09T13:04:33.633" Score="3" Body="&lt;p&gt;Some of these options are already available in the diff popup. If you need any of the others, then you have to add them as described &lt;a href=&quot;https://magit.vc/manual/magit-popup/Customizing-Existing-Popups.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;in the manual&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next issue you will run into is that if you save the default arguments using &lt;kbd&gt;C-x C-s&lt;/kbd&gt;, that will affect all repositories. There currently is no mechanism for saving the arguments for just one repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you could set &lt;code&gt;magit-diff-arguments&lt;/code&gt; and &lt;code&gt;magit-diff-section-arguments&lt;/code&gt; manually in &lt;code&gt;.dir-locals.el&lt;/code&gt; as described &lt;a href=&quot;https://magit.vc/manual/magit/Per_002dRepository-Configuration.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;in the manual&lt;/a&gt;. That's a bit cumbersome but it's all we have now.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-01-09T13:04:33.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29901" PostTypeId="1" AcceptedAnswerId="29903" CreationDate="2017-01-09T13:48:34.423" Score="8" ViewCount="1124" Body="&lt;p&gt;Looking at this &lt;a href=&quot;https://stackoverflow.com/questions/3973896/emacs-org-mode-file-viewer-associations#3985552&quot;&gt;stackoverflow answer&lt;/a&gt; on an old way for specifying the &lt;code&gt;org-file-apps&lt;/code&gt; list, I can see that there is a backslash followed by a single-quote character after each file type extension, e.g. ...&lt;code&gt;pdf\\'&quot;&lt;/code&gt;... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does it mean? What purpose does the backslash plus quote serve?&lt;/p&gt;&#xA;" OwnerUserId="8231" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-04-15T13:15:33.290" Title="What does a backslash followed by a single quote mean in a regular expression?" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29902" PostTypeId="1" CreationDate="2017-01-09T13:54:24.660" Score="4" ViewCount="3532" Body="&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/Changes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;release notes&lt;/a&gt; for the changed method of specifing how to open links in org files say that &lt;code&gt;org-file-apps&lt;/code&gt; no longer accepts an S-expression but you need to put in a function (and gives an example with a lambda). But the example does not escape any quotes, nor explain what is the &quot;file&quot; and what is the &quot;link&quot; that are being passed to this function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have noticed that libreoffice .ods files are opening up in emacs, and not being opened by libreoffice, but I cannot figure out how to add a case to org-file-apps to do this successfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;General question: please explain the new methods for org-file-apps orgmode v 9.0 with more detail. Specific question: assuming /usr/bin/libreoffice exists, what should the addition to org-file-apps be to get libreoffice to launch a file with extension .ods rather than open it up in emacs.&lt;/p&gt;&#xA;" OwnerUserId="8231" LastActivityDate="2018-12-20T00:19:29.970" Title="More detailed description of how to set-up org-file-apps for orgmode 9.0" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29903" PostTypeId="2" ParentId="29901" CreationDate="2017-01-09T14:10:39.543" Score="11" Body="&lt;p&gt;It's a special construct in emacs regexp that matches the end of a string (not just the end of a line). Quoting the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html#Regexp-Backslash&quot; rel=&quot;noreferrer&quot;&gt;the manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;\'&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;matches the empty string, but only at the end of the string or buffer (or its accessible portion) being matched against.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-01-09T14:10:39.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29904" PostTypeId="2" ParentId="29892" CreationDate="2017-01-09T15:41:34.370" Score="3" Body="&lt;p&gt;Some window managers, such as MS Windows, automatically give a new frame the focus after they create it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need to focus another frame at that point then you will likely need to use function &lt;code&gt;select-frame-set-input-focus&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-09T15:41:34.370" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29905" PostTypeId="1" CreationDate="2017-01-09T15:59:27.037" Score="2" ViewCount="1465" Body="&lt;p&gt;Since upgrading to Emacs 24.5.1 and org-mode 8.3.3 (Kubuntu 16.04), I can no longer export org-mode files as ODT; only as iCal, HTML, LaTeX, or plain text. Is that normal? Is there a way to get ODT export back?&lt;/p&gt;&#xA;" OwnerUserId="12461" LastActivityDate="2017-12-14T13:59:10.527" Title="org-mode export to odt gone?" Tags="|org-mode|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29907" PostTypeId="1" AcceptedAnswerId="29916" CreationDate="2017-01-10T01:08:37.977" Score="6" ViewCount="616" Body="&lt;p&gt;Some commit messages contain sha1 hashes of older commits in order to reference these commits, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixes: deadbeef  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to visit the referenced commit from the first commit message?   &lt;/p&gt;&#xA;" OwnerUserId="14493" LastEditorUserId="105" LastEditDate="2017-01-10T02:03:57.063" LastActivityDate="2020-09-30T22:17:18.603" Title="How to follow commit hashes in commit messages?" Tags="|magit|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29908" PostTypeId="1" AcceptedAnswerId="29910" CreationDate="2017-01-10T01:35:35.230" Score="4" ViewCount="475" Body="&lt;p&gt;I have a symlink&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/link -&amp;gt; ~/a/really/long/path&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;code&gt;^&lt;/code&gt; in the buffer, it takes me to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I want to go to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;~/a/really/long&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a right way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question is, if I'm on a symlink file's buffer, how can I find out the buffer's physical path?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I'm reading a markdown file &lt;code&gt;~/a/really/long/path/readme.md&lt;/code&gt;, what command can print out the physical path of it?&lt;/p&gt;&#xA;" OwnerUserId="10753" LastActivityDate="2017-01-10T02:17:51.130" Title="Dired up to parent directory on symlink" Tags="|helm|dired|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29910" PostTypeId="2" ParentId="29908" CreationDate="2017-01-10T02:17:51.130" Score="6" Body="&lt;p&gt;I don't know of a command to do this, or a setting that you can modify to make &lt;code&gt;^&lt;/code&gt; do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on MS Windows without symlinks, but you might try defining a command that uses the same definition as &lt;code&gt;dired-up-directory&lt;/code&gt; but that converts &lt;code&gt;dired-current-directory&lt;/code&gt; to its symlink target by wrapping it in &lt;strong&gt;&lt;code&gt;file-truename&lt;/code&gt;&lt;/strong&gt;, which follows symlinks (untested):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Same as `dired-up-directory', except for wrapping with `file-truename'.&#xA;(defun my-dired-up-directory (&amp;amp;optional other-window)&#xA;  &quot;Run Dired on parent directory of current directory.&#xA;Follows symlinks for current directory.&#xA;Find the parent directory either in this buffer or another buffer.&#xA;Creates a buffer if necessary.&#xA;If OTHER-WINDOW (the optional prefix arg), display the parent&#xA;directory in another window.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let* ((dir  (file-truename (dired-current-directory)))&#xA;         (up   (file-name-directory (directory-file-name dir))))&#xA;    (or (dired-goto-file (directory-file-name dir))&#xA;        ;; Only try dired-goto-subdir if buffer has more than one dir.&#xA;        (and (cdr dired-subdir-alist)  (dired-goto-subdir up))&#xA;        (progn (if other-window (dired-other-window up) (dired up))&#xA;               (dired-goto-file dir)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If no one offers an existing way to do this, you might want to file an enhancement request to make &lt;code&gt;dired-up-directory&lt;/code&gt; be able to do this (i.e., optionally).  That could be done via a particular prefix-arg value or via a variable binding.  Alternatively, you could just ask for such an alternative command, so users can bind it to a key.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-10T02:17:51.130" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29911" PostTypeId="2" ParentId="29863" CreationDate="2017-01-10T03:08:30.420" Score="0" Body="&lt;p&gt;FWIW, here's what I do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in &lt;code&gt;~/.emacs&lt;/code&gt; I define a function &lt;code&gt;full-fledged-emacs&lt;/code&gt; which has settings which only apply to when I start my main Emacs session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if I start a &quot;normal&quot; &lt;code&gt;emacs &amp;lt;file&amp;gt;&lt;/code&gt; those settings aren't applied.  And when I want to start my main Emacs session, I do &lt;code&gt;emacs -f full-fledged-emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-01-10T03:08:30.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29912" PostTypeId="2" ParentId="29872" CreationDate="2017-01-10T03:19:35.650" Score="4" Body="&lt;p&gt;While Drew's answer will work correctly in many cases (where utf-8 is pervasive and if you don't use DOS-style EOLs), if you want to make it work reliably for &quot;all&quot; buffers, you could do something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun region-bytes (start end)&#xA;  &quot;Return the number of bytes used by the region.&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (message &quot;Region has %d bytes&quot;&#xA;           (- (bufferpos-to-filepos end 'exact)&#xA;              (bufferpos-to-filepos start 'exact))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and for cases where efficiency is more important than precision, you could pass &lt;code&gt;approximate&lt;/code&gt; instead of &lt;code&gt;exact&lt;/code&gt;, in which case &lt;code&gt;bufferpos-to-filepos&lt;/code&gt; will always be very fast tho it will not handle correctly cases like GBK or utf-2022 encodings.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-01-10T03:19:35.650" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29914" PostTypeId="1" AcceptedAnswerId="29915" CreationDate="2017-01-10T03:57:00.623" Score="7" ViewCount="2527" Body="&lt;p&gt;When using stock &lt;code&gt;find-file&lt;/code&gt; or &lt;code&gt;counsel-find-file&lt;/code&gt;, is there a way to ignore certain files that I almost never want to open by hand? Examples include &lt;code&gt;.elc&lt;/code&gt; files and backups.&lt;/p&gt;&#xA;" OwnerUserId="2788" LastEditorUserId="2292" LastEditDate="2023-07-08T08:38:39.033" LastActivityDate="2023-07-08T08:38:39.033" Title="How to ignore certain filename patterns in `find-file`/`counsel-find-file`?" Tags="|ivy|counsel|" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29915" PostTypeId="2" ParentId="29914" CreationDate="2017-01-10T04:08:54.057" Score="9" Body="&lt;p&gt;Yes, use &lt;code&gt;counsel-find-file-ignore-regexp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the simple example you provide use&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;    (setq counsel-find-file-ignore-regexp &quot;\\.elc\\'&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The are more examples in the docstring for that variable.&lt;/p&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-01-10T04:08:54.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29916" PostTypeId="2" ParentId="29907" CreationDate="2017-01-10T04:34:30.550" Score="6" Body="&lt;p&gt;I'm not aware of any builtin command that works on an arbitrary hash&#xA;at point.  You can copy the hash, call &lt;code&gt;C-u magit-show-commit&lt;/code&gt;, and&#xA;then yank the hash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I use the following command for this purpose.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun km/magit-show-commit-at-point (&amp;amp;optional choose-project)&#xA;  &quot;Show commit point.&#xA;If there is no current project or if the prefix argument&#xA;CHOOSE-PROJECT is non-nil, prompt for the project name.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (if (save-excursion (skip-chars-backward &quot;A-z0-9&quot;)&#xA;                      (looking-at &quot;\\b[A-z0-9]\\{4,40\\}\\b&quot;))&#xA;      (let* ((hash (match-string-no-properties 0))&#xA;             (project&#xA;              (and (or choose-project&#xA;                       (not (projectile-project-p))&#xA;                       (not (magit-rev-verify (concat hash &quot;^{commit}&quot;))))&#xA;                   (completing-read &quot;Project: &quot;&#xA;                                    (projectile-relevant-known-projects))))&#xA;             (default-directory (or project default-directory)))&#xA;        (magit-show-commit hash (car (magit-diff-arguments))))&#xA;    (user-error &quot;No hash found at point&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've written this to work with Projectile.  It prompts for a project&#xA;if the hash doesn't seem to belong to the current project or there is&#xA;no current project.  However, you could easily remove those parts, if&#xA;you don't use Projectile.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2017-01-10T04:34:30.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29917" PostTypeId="1" CreationDate="2017-01-10T06:44:33.067" Score="0" ViewCount="412" Body="&lt;p&gt;I think I've setup company mode correctly, yet I can't get company-dabbrv to work as default. I can launch it manually with &lt;code&gt;company-dabbrv&lt;/code&gt;, but it won't auto-suggest completions in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the output of &lt;code&gt;company-diag&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Emacs 25.1.1 (x86_64-unknown-linux-gnu) of 2016-12-17 on foutrelis&#xA;Company 0.9.2&#xA;&#xA;company-backends: (company-abbrev company-ispell company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files&#xA;        (company-dabbrev-code company-gtags company-etags company-keywords)&#xA;        company-oddmuse company-dabbrev)&#xA;&#xA;Used backend: company-abbrev&#xA;Prefix: &quot;&quot;&#xA;Completions:&#xA;  &quot;wokr&quot;&#xA;  &quot;willbe&quot;&#xA;  &quot;vulnerible&quot;&#xA;  &quot;tkaes&quot;&#xA;  &quot;tjhe&quot;&#xA;  &quot;specifc&quot;&#xA;  &quot;similiar&quot;&#xA;  &quot;sepcific&quot;&#xA;  &quot;relize&quot;&#xA;  &quot;propertiers&quot;&#xA;  &quot;proffesors&#xA;   ... (this goes on...) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems to me dabbrv mode is loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (use-package company &#xA;   :ensure t&#xA;   :config&#xA;  (add-hook 'after-init-hook 'global-company-mode)&#xA;&#xA;  (setq company-idle-delay 0)&#xA;  (setq company-minimum-prefix-length 2) &#xA;&#xA;&#xA; (defun my-org-mode-hook ()&#xA;  (set (make-local-variable 'company-backends)&#xA;       '((company-capf company-files company-dabbrv))))&#xA;&#xA;&#xA;   (add-hook 'org-mode-hook #'my-org-mode-hook)&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to debug this?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="97" LastEditDate="2017-04-06T18:20:26.057" LastActivityDate="2017-04-06T18:20:26.057" Title="Can't get company-dabbrv mode to work" Tags="|company-mode|completion|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="29918" PostTypeId="1" CreationDate="2017-01-10T07:14:14.920" Score="1" ViewCount="338" Body="&lt;p&gt;I have tried to use the dictation feature of Mac OS in Emacs and it works quite well, except that it doesn’t seem to recognise spaces between words if I pause shortly and also omits spaces between sentences. Example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a testAnd dictation in Emacs. It seems like spaces are omittedIf you use the dictation Feature.Is this possible to solve?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Reading &lt;a href=&quot;https://apple.stackexchange.com/questions/201389/how-can-i-fix-missing-spaces-when-using-dictation-with-macvim-or-terminal&quot;&gt;this answer on apple.stackexchange&lt;/a&gt; it seems like it has to do with the interaction between the feature in the OS and the application, in this case Emacs.&lt;/p&gt;&#xA;" OwnerUserId="13027" LastEditorUserId="-1" LastEditDate="2017-04-13T12:45:30.630" LastActivityDate="2021-02-01T06:35:01.073" Title="Dictation in Mac OS doesn’t leave spaces between words in Emacs" Tags="|osx|text-editing|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29919" PostTypeId="1" CreationDate="2017-01-10T11:40:55.143" Score="5" ViewCount="475" Body="&lt;p&gt;I am using &lt;a href=&quot;https://github.com/ch11ng/exwm/&quot; rel=&quot;noreferrer&quot;&gt;EXWM&lt;/a&gt; on Arch as my windows manager. Substantially my &lt;code&gt;startx&lt;/code&gt; launches&#xA;&lt;code&gt;exec dbus-launch --exit-with-session emacs&lt;/code&gt; so I am running only emacs and living inside it. I would like to define a function &lt;code&gt;shutdown&lt;/code&gt; to properly handle the shutdown of my computer terminating&#xA;every process in a graceful way. This function has to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Execute &lt;code&gt;(save-some-buffers)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Check in every frame if there are running processes that I've personally started&lt;/li&gt;&#xA;&lt;li&gt;Ask if I want to continue&lt;/li&gt;&#xA;&lt;li&gt;Send &lt;code&gt;SIGHUP&lt;/code&gt; to each of these process&lt;/li&gt;&#xA;&lt;li&gt;Check if those process have quit, if not send them a stronger signal&lt;/li&gt;&#xA;&lt;li&gt;Exit emacs&lt;/li&gt;&#xA;&lt;li&gt;Shutdown the computer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I want to kill processes with &lt;code&gt;SIGHUP&lt;/code&gt;, which is the signal &lt;code&gt;(kill-buffer)&lt;/code&gt;&#xA;sends, because using &lt;code&gt;(save-buffer-kill-emacs)&lt;/code&gt; kills them too brutally.&#xA;For example Chromium always asks me if I want to restore previous session,&#xA;whereas killing Chromium with &lt;code&gt;SIGHUP&lt;/code&gt; makes it restore the correct session the&#xA;next time I start it.&#xA;I want to properly quit emacs before shutting down the computer because if I use &lt;code&gt;(shell-command &quot;shutdown now&quot;)&lt;/code&gt; it prevents emacs to correctly run every exit-hook (for&#xA;example it doesn't remove the &lt;code&gt;desktop-file.lock&lt;/code&gt; of &lt;code&gt;(desktop-save-mode)&lt;/code&gt;.&#xA;My workaround for this problem is to schedule a shutdown 3 seconds in the&#xA;future, so emacs can properly quit, but it is not very elegant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do?&lt;/p&gt;&#xA;" OwnerUserId="14496" LastActivityDate="2017-01-10T11:40:55.143" Title="Shutting down computer from emacs killing gracefully emacs itself" Tags="|window|process|shell-command|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29920" PostTypeId="1" CreationDate="2017-01-10T11:40:56.347" Score="7" ViewCount="1510" Body="&lt;p&gt;I would like to have different font sizes for the buffer windows in Emacs. That is, I would like to have a bigger font in the buffer where i write the code, and a smaller font in the buffer where i use the term to browse and run the scripts. Is it possible ?&lt;/p&gt;&#xA;" OwnerUserId="12612" LastActivityDate="2021-06-09T06:38:40.880" Title="Is it possible to change the font size in specific buffers?" Tags="|buffers|fonts|customize|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29921" PostTypeId="1" AcceptedAnswerId="29922" CreationDate="2017-01-10T11:43:12.397" Score="4" ViewCount="485" Body="&lt;p&gt;I am using Auctex in Aquamacs. Everytime I type underline &quot;_&quot;, it will show as &lt;code&gt;$_{}$&lt;/code&gt; automatically which is very annoying. I am wondering how could I turn off this function. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13700" LastEditorUserId="25" LastEditDate="2017-01-10T12:39:03.677" LastActivityDate="2017-01-11T02:06:01.573" Title="How can I type simple underline &quot;_&quot; in Auctex" Tags="|auctex|aquamacs|insert|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29922" PostTypeId="2" ParentId="29921" CreationDate="2017-01-10T12:38:52.720" Score="5" Body="&lt;p&gt;You can always insert a character literally by typing &lt;code&gt;C-q&lt;/code&gt; first (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Inserting-Text.html#Inserting-Text&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;quoted-insert&lt;/code&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many “electric” characters (that's what Emacs usually calls characters whose insertion has extra effects such as inserting extra braces, reindenting, etc.) are designed to revert to a plain insertion if you pass a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html#Arguments&quot; rel=&quot;nofollow noreferrer&quot;&gt;numeric prefix argument&lt;/a&gt;, i.e. type &lt;code&gt;ESC 1 _&lt;/code&gt; or &lt;code&gt;M-1 _&lt;/code&gt; to insert one underscore. I don't know if this is the case specifically for the command you're using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see the effect of the &lt;code&gt;_&lt;/code&gt; key, type &lt;code&gt;C-h k&lt;/code&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Key-Help.html#Key-Help&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;describe-key&lt;/code&gt;&lt;/a&gt;) followed by &lt;code&gt;_&lt;/code&gt;. That will give you a description of the command, and perhaps a way to customize it. By default, in AUCTeX, &lt;code&gt;_&lt;/code&gt; runs &lt;code&gt;TeX-insert-sub-or-superscript&lt;/code&gt; which just inserts a &lt;code&gt;_&lt;/code&gt; unless &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#index-TeX_002delectric_002dsub_002dand_002dsuperscript&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;TeX-electric-sub-and-superscript&lt;/code&gt;&lt;/a&gt; is turned on, and even then it only inserts braces if already in math mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out that you're using &lt;a href=&quot;https://github.com/cdominik/cdlatex&quot; rel=&quot;nofollow noreferrer&quot;&gt;cdlatex&lt;/a&gt;, where &lt;code&gt;_&lt;/code&gt; is bound to &lt;a href=&quot;https://github.com/cdominik/cdlatex/blob/a0e0ad9efa3ffc918d4c23fa7db7563b1bef0dae/cdlatex.el#L768&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;cdlatex-sub-superscript&lt;/code&gt;&lt;/a&gt;. If you want to keep using cdlatex but deactivate the electric behavior of &lt;code&gt;_&lt;/code&gt;, you can remove &lt;code&gt;_&lt;/code&gt; from the cdlatex keymap after the package is loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-after-load-cdlatex ()&#xA;  (define-key cdlatex-mode-map &quot;_&quot; nil)&#xA;  t)&#xA;(eval-after-load &quot;cdlatex&quot; '(my-after-load-cdlatex))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may wish to activate AUCTeX's less invasive electric &lt;code&gt;_&lt;/code&gt; by setting &lt;code&gt;TeX-electric-sub-and-superscript&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq TeX-electric-sub-and-superscript t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25" LastEditorUserId="25" LastEditDate="2017-01-11T02:06:01.573" LastActivityDate="2017-01-11T02:06:01.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29923" PostTypeId="1" CreationDate="2017-01-10T14:22:50.540" Score="0" ViewCount="56" Body="&lt;p&gt;Is it possible for emacs to detect a press and immediate release of a meta key?&#xA;I would consider binding this to &lt;code&gt;toggle-input-method&lt;/code&gt;.  I know there are external programs that can make tapping a modifier equivalent to a different key, but I would like to keep the ability to bring up a menu by tapping &lt;code&gt;alt&lt;/code&gt;/&lt;code&gt;meta&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2017-01-10T14:22:50.540" Title="Detection of tapped meta" Tags="|key-bindings|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29924" PostTypeId="2" ParentId="29902" CreationDate="2017-01-10T14:57:09.443" Score="2" Body="&lt;p&gt;A partial answer to the specific question applies to linux if your system defaults to using libreoffice for ods files. Edit the &lt;code&gt;org-file-apps&lt;/code&gt; variable to include &lt;code&gt;(&quot;ods&quot; . system)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8231" LastActivityDate="2017-01-10T14:57:09.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29925" PostTypeId="1" AcceptedAnswerId="48651" CreationDate="2017-01-10T15:00:18.883" Score="2" ViewCount="325" Body="&lt;p&gt;I am using org-mode to write my labbook. Each experiment is an org-file that is exported to PDF when finished. Currently, I am linking to previous experiments by using the resulting PDF. Is it possible to link to org-files instead and have org-mode convert the link to PDF once exported?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would make it easier to jump from experiment to experiment inside Emacs and from PDF to PDF once exported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that this is done for HTML export. How do I set this up for LaTeX export?&lt;/p&gt;&#xA;" OwnerUserId="13452" LastActivityDate="2019-03-29T09:43:28.140" Title="org-html-link-org-files-as-html for LaTeX export?" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29926" PostTypeId="2" ParentId="29611" CreationDate="2017-01-10T15:06:25.640" Score="1" Body="&lt;p&gt;You can do this by providing some post-hooks manually (feel free to contribute useful code :).  Another setting is to enable &lt;code&gt;sp-navigate-reindent-after-up&lt;/code&gt; which will reformat your sexps when you call &lt;code&gt;sp-up-sexp&lt;/code&gt; (which in strict mode will be called when you hit &lt;code&gt;}&lt;/code&gt; in your example --- or you can set &lt;code&gt;sp-autoskip-closing-pair&lt;/code&gt; to &lt;code&gt;always&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no global setting like the one electric-pair has, global settings led to great many problems in smartparens so we are trying to eliminate as much of them as possible.&lt;/p&gt;&#xA;" OwnerUserId="14498" LastActivityDate="2017-01-10T15:06:25.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29927" PostTypeId="2" ParentId="28543" CreationDate="2017-01-10T15:19:38.607" Score="2" Body="&lt;p&gt;Advices suck.  Much easier is to just define a new function and bind it to &lt;code&gt;C-w&lt;/code&gt;.  This is what I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-kill-region-or-word (&amp;amp;optional arg)&#xA;  &quot;Kill active region or one word backward.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (if (use-region-p)&#xA;      (sp-kill-region (region-beginning) (region-end))&#xA;    (if smartparens-strict-mode&#xA;        (sp-backward-kill-word arg)&#xA;      (backward-kill-word arg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace the else branch with &lt;code&gt;sp-kill-whole-line&lt;/code&gt;, so this code should work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-kill-region-or-line (&amp;amp;optional arg)&#xA;  &quot;Kill active region or current line.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (if (use-region-p)&#xA;      (sp-kill-region (region-beginning) (region-end)) ;; strict-mode version of kill-region&#xA;    (sp-kill-whole-line))) ;; strict-mode version of kill-whole-line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can of course make it strict-mode aware by wrapping the commands with if as I do in my function.&lt;/p&gt;&#xA;" OwnerUserId="14498" LastEditorUserId="11377" LastEditDate="2017-01-10T19:56:49.413" LastActivityDate="2017-01-10T19:56:49.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29928" PostTypeId="2" ParentId="28891" CreationDate="2017-01-10T15:27:24.257" Score="0" Body="&lt;p&gt;You can use the helper fucntion &lt;code&gt;sp-wrap-with-pair&lt;/code&gt; to trigger wrapping behaviour of SP: either next expression or region if one is active.  To use concrete pair, use a lambda like so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda (&amp;amp;optional arg) (interactive &quot;P&quot;) (sp-wrap-with-pair &quot;(&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure which map to put this in evil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are lots of &quot;ports&quot; of smartparens for evil, called evil-smartparens and similar, look over github a bit, I'm sure at least one of those works.&lt;/p&gt;&#xA;" OwnerUserId="14498" LastActivityDate="2017-01-10T15:27:24.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29929" PostTypeId="2" ParentId="29681" CreationDate="2017-01-10T16:38:04.553" Score="1" Body="&lt;p&gt;For other persons who are having the same problem, I just want to answer my own question. I solved this issue by setting copying the shell environment to emacs as,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(exec-path-from-shell-copy-env &quot;LC_ALL&quot;)&#xA;(exec-path-from-shell-copy-env &quot;LANG&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you, everyone, for your help. I got my answer from &lt;a href=&quot;https://stat.ethz.ch/pipermail/r-sig-mac/2015-October/011701.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://stat.ethz.ch/pipermail/r-sig-mac/2015-October/011701.html&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14241" LastActivityDate="2017-01-10T16:38:04.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29931" PostTypeId="1" CreationDate="2017-01-10T18:49:07.643" Score="2" ViewCount="110" Body="&lt;p&gt;When I use &lt;code&gt;list-packages&lt;/code&gt; it shows the archive for packages that are not installed, but not for ones that are. The same for package descriptions. Is there any way to find out which archive an installed package came from?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Yes, I can search each archive I use, but I was hoping for something quicker &amp;amp; easier.)&lt;/p&gt;&#xA;" OwnerUserId="6594" LastActivityDate="2017-05-17T20:42:59.183" Title="Which archive did an installed package come from?" Tags="|package|package-repositories|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29932" PostTypeId="2" ParentId="27297" CreationDate="2017-01-10T19:57:19.783" Score="11" Body="&lt;p&gt;You have to use :header-args: property instead. Like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** New Chapter&#xA;:PROPERTIES:&#xA;:header-args: :tangle code/src/test.hs&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This behaviour changed with the Org-mode 9 (see &lt;a href=&quot;http://orgmode.org/Changes.html#org343de47&quot; rel=&quot;noreferrer&quot;&gt;changes&lt;/a&gt;). There is also entry on &lt;a href=&quot;http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html&quot; rel=&quot;noreferrer&quot;&gt;org-mode manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13378" LastEditorUserId="13378" LastEditDate="2017-01-14T09:17:33.373" LastActivityDate="2017-01-14T09:17:33.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29933" PostTypeId="1" AcceptedAnswerId="30637" CreationDate="2017-01-10T20:22:02.413" Score="3" ViewCount="263" Body="&lt;p&gt;Say I want to open new connections to &lt;code&gt;superlongusername1@superlongdomain1.org&lt;/code&gt;, &lt;code&gt;superlongusername2@superlongdomain2.org&lt;/code&gt; and &lt;code&gt;superlongusername3@superlongdomain3.org&lt;/code&gt; frequently, but I don't want to type each one every time. It would be nice if the target was saved the on the first successful connection and then presented to me as an option for ever connection thereafter which then could be incrementally filtered with Helm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By analogy, it would be very similar to &lt;code&gt;helm-recentf&lt;/code&gt; but instead of the file names they would be tramp targets.&lt;/p&gt;&#xA;" OwnerUserId="14501" LastActivityDate="2017-02-11T21:19:49.667" Title="Is there a way to save tramp targets and then incrementally filter them with Helm?" Tags="|helm|tramp|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29934" PostTypeId="1" CreationDate="2017-01-10T21:50:05.950" Score="3" ViewCount="810" Body="&lt;p&gt;I have the following customizations in my .spacemacs file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/layers ()&#xA;   dotspacemacs-additional-packages '(smart-tabs-mode))&#xA;&#xA;(defun dotspacemacs/user-config ()&#xA;&#xA;  (setq-default font-latex-fontify-script nil)&#xA;&#xA;  (add-hook 'LaTeX-mode-hook&#xA;            (lambda ()&#xA;              (setq indent-tabs-mode t&#xA;                    indent-line-function 'indent-relative)&#xA;              (smart-tabs-mode-enable)&#xA;              (smart-tabs-advice indent-relative tab-width)&#xA;              (electric-indent-mode -1)&#xA;              )))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use indent-relative since Latex-mode does not use tabs at all apparently (see &lt;a href=&quot;https://emacs.stackexchange.com/questions/14820&quot;&gt;How can I configure AUCTeX to use tab characters for leading indentation?&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, in LaTeX-mode, I indent a line with an indentation that starts with a tab and is followed by spaces, and then hit Enter + Tab, &lt;code&gt;smart-tabs-mode&lt;/code&gt; takes care that the next line will be indented exactly the same way, i.e. the combination of tabs and spaces ist preserved. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I use &lt;code&gt;newline-and-indent&lt;/code&gt; to get a newline (or leave &lt;code&gt;electric-indent-mode&lt;/code&gt; on), the indentation is spaces only. Is that a limitation of &lt;code&gt;smart-tabs-mode&lt;/code&gt; or am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="14503" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-01-11T00:54:47.257" Title="Smart Tab and newline-and-indent" Tags="|indentation|spacemacs|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29935" PostTypeId="1" AcceptedAnswerId="29936" CreationDate="2017-01-10T22:29:45.657" Score="1" ViewCount="715" Body="&lt;p&gt;This is a follow-up to &lt;a href=&quot;https://emacs.stackexchange.com/questions/12791/customize-org-mode-priorities&quot;&gt;this question&lt;/a&gt; about changing labels on priorities. The question refers to setting the org-mode priorities to something like &lt;code&gt;#1 #2 #3 #4 #5&lt;/code&gt; instead of &lt;code&gt;#A #B #C&lt;/code&gt;. Now, from the org-mode documentation it appears that &lt;code&gt;org-highest-priority&lt;/code&gt;, &lt;code&gt;org-lowest-priority&lt;/code&gt;, and &lt;code&gt;org-default-priority&lt;/code&gt; must be in alphabetical order. In addition, these priorities are chars, and thus cannot be replaced with a string. I take it this is because org-mode computes display order of priorities in the agenda using direct comparison operators on the priorities. Now, the question becomes, is there an easy way to &lt;em&gt;display&lt;/em&gt; the priorities as something like &lt;code&gt;High&lt;/code&gt;, &lt;code&gt;Medium&lt;/code&gt;, and &lt;code&gt;Low&lt;/code&gt;, even if underneath it treats it as &lt;code&gt;#A #B #C&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5510" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-01-10T23:33:56.837" Title="Customize Org Priorities with Strings" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29936" PostTypeId="2" ParentId="29935" CreationDate="2017-01-10T23:14:06.477" Score="2" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:  Emacs converts the priority letters or numbers into character numbers for purposes of sorting, etc. -- e.g., &lt;code&gt;(string-to-char &quot;A&quot;)&lt;/code&gt; is 65.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option #1:  Use a tag.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Active [#A] Hello-world. :TOP:@home:&#xA;  DEADLINE: &amp;lt;2017-01-10 Tue&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Option #2:  Use a heading priority separator and sort (at least in part) by priorities:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Active [#A] .;;;;;;;;;;;;;;;;;;;;;;;;; TOP ;;;;;;;;;;;;;;;;;;;;;;;;;. :TOP:@home:&#xA;DEADLINE: &amp;lt;2017-01-10 Tue&amp;gt;&#xA;&#xA;* Active [#A] Hello-world. :@home:&#xA;  DEADLINE: &amp;lt;2017-01-10 Tue&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Option #3:  Use a properties drawer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option #4:  Play with overlays and display them in the location desired -- some assembly required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option #5:  Do not look for the easy way out and invest the time to modify the behavior of &lt;code&gt;org-mode&lt;/code&gt; to support priorities such as those indicated in the question hereinabove.  To begin on this quest, have a look at the variable &lt;code&gt;org-get-priority-function&lt;/code&gt; and the function &lt;code&gt;org-get-priority&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-10T23:33:56.837" LastActivityDate="2017-01-10T23:33:56.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29937" PostTypeId="2" ParentId="16919" CreationDate="2017-01-10T23:38:03.400" Score="5" Body="&lt;p&gt;This is what I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; don't use desktop mode for terminal&#xA;(when (display-graphic-p)&#xA;  (desktop-save-mode 1);; is x window&#xA;  ())&#xA;&#xA;;; Add variables to desktop saving&#xA;(add-to-list 'desktop-globals-to-save 'register-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14505" LastActivityDate="2017-01-10T23:38:03.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29938" PostTypeId="1" AcceptedAnswerId="30719" CreationDate="2017-01-11T00:39:09.230" Score="1" ViewCount="886" Body="&lt;p&gt;I just started using spacemacs, and I would like to achieve the following:&#xA;press f then d, and this for example types the word &quot;fraction&quot;. I know package key-chord does this, but I think this is not compatible with spacemacs because it key-chord uninstalls when spacemacs is started&lt;/p&gt;&#xA;" OwnerUserId="14402" LastActivityDate="2017-02-14T22:52:36.783" Title="spacemacs and key chording" Tags="|spacemacs|key-chord-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29939" PostTypeId="1" CreationDate="2017-01-11T01:57:33.807" Score="5" ViewCount="2110" Body="&lt;p&gt;I'm not finding a lot of examples/documentation for the non-REPL world of C/C++ in Emacs org-mode babel. For example, is there a way to break a program up into separate source code blocks, i.e., a block for &lt;code&gt;main&lt;/code&gt;, then separate blocks for its &lt;code&gt;func1&lt;/code&gt;, &lt;code&gt;func2&lt;/code&gt;, ... called by &lt;code&gt;main&lt;/code&gt;? Or, is there any way to have just a stand-alone function &lt;code&gt;lonefunc&lt;/code&gt; in a block, then call it from another place? I suppose this is all a form of literate programming, but typically you're pulling it all together with tangling. I'd like not to tangle, but have things running in the org-mode session.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2017-02-10T07:37:01.163" Title="C/C++ coding in Emacs org-mode's babel" Tags="|org-mode|org-babel|c|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29940" PostTypeId="1" CreationDate="2017-01-11T06:10:53.773" Score="3" ViewCount="239" Body="&lt;p&gt;According to the documentation of the command &lt;code&gt;server-edit&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Switch to next server editing buffer; say &quot;Done&quot; for current buffer.&#xA;  If a server buffer is current, it is marked &quot;done&quot; and optionally saved.&#xA;  The buffer is also killed if it did not exist before the clients asked for it. When all of a client's buffers are marked as &quot;done&quot;, the client is notified.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have seen many sources which mention this command. For example &lt;a href=&quot;https://emacs.stackexchange.com/a/29461&quot;&gt;https://emacs.stackexchange.com/a/29461&lt;/a&gt; says &lt;em&gt;emacsclient waits for emacs server. When you do server-edit, the server notifies emacsclient to terminate.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is when do I actually need to call this command?  I have the following in my init file. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'server)&#xA;(unless (server-running-p) (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I open the files with emacsclient -n. Do I ever need &lt;code&gt;server-edit&lt;/code&gt; command?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added&lt;/strong&gt;: Occasionally (for the reasons that I don't know) emacsclient fails to connect to the server and &lt;code&gt;emacsclient -n&lt;/code&gt; opens a new instance of emacs and even when I completely exit from emacs and restart emacs, this inconvenient phenomenon continues. I don't know why this happens despite the fact that I always call emacsclient by &lt;code&gt;-n&lt;/code&gt; option. Later,  I discovered that by running &lt;code&gt;server-edit&lt;/code&gt; this issue can be resolved. Despite the fact that the post linked by YoungFrog claims that I don't need to call &lt;code&gt;server-edit&lt;/code&gt; in this situation, it seems that &lt;code&gt;server-edit&lt;/code&gt; performs a magic even in this situation. Thus I decided to ask this question to know more about the command &lt;code&gt;server-edit&lt;/code&gt; beyond the existing documentation and few posts on this subject in this site, because I felt that I don't completely understand this command.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-01-12T16:29:06.140" Title="What are the actual usage of the command `server-edit`?" Tags="|emacsclient|server|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29941" PostTypeId="2" ParentId="29939" CreationDate="2017-01-11T06:40:28.313" Score="3" Body="&lt;p&gt;You can do this by using the noweb reference syntax:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First we define some named code blocks&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: srcMyfunc&#xA;#+BEGIN_SRC C &#xA;  void myfunc() {&#xA;    printf(&quot;print from function\n&quot;);&#xA;  }&#xA;#+END_SRC  &#xA;&#xA;&#xA;#+NAME: srcMain&#xA;#+BEGIN_SRC C&#xA;  int main(int argc,char **argv) {&#xA;    printf(&quot;Hello World\n&quot;);&#xA;    myfunc();&#xA;    exit(0);&#xA;  }&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we define a block which includes the other code blocks by referencing them with the &amp;lt;&gt; syntax (needs the&#xA;:noweb yes option). We could tangle this block, but we can also&#xA;execute it directly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC C :results output :noweb yes&#xA;  #include &quot;stdlib.h&quot;&#xA;  #include &quot;stdio.h&quot;&#xA;&#xA;  &amp;lt;&amp;lt;srcMyfunc&amp;gt;&amp;gt;&#xA;  &amp;lt;&amp;lt;srcMain&amp;gt;&amp;gt;&#xA;&#xA;  #+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: Hello World&#xA;: print from function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I prefer to do it in the way that I have one code block for combining all the others, because the &amp;lt;&gt; tend to mess up the language buffer, except when I just want to test an isolated function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not think that this is very useful for bigger programs, but I used it extensively in a parallel programming course to write notes and documentation.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2017-01-11T06:40:28.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29942" PostTypeId="1" AcceptedAnswerId="29949" CreationDate="2017-01-11T08:04:24.093" Score="0" ViewCount="2392" Body="&lt;p&gt;I can't get helm-projectile-find-file to work on Windows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run it I get the error message &quot;FIND: Parameter format not correct&quot;. Given how similar that is to the native windows find.exe default text I'm guessing that is what it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the git for windows folder at the very top of my path:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LnqbQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LnqbQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running find and grep on a cmd.exe terminal do indeed show the the right executable files are being used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/v14zu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/v14zu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other things I have tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add find.exe and grep.exe to the Emacs bin directory&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set the executable path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (add-to-list 'exec-path &quot;C:\\\&quot;Program Files (x86)\&quot;\\Git\\bin&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Set the binary locations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq find-program &quot;C:\\\&quot;Program Files (x86)\&quot;\\Git\\bin\\find.exe&quot;&#xA;  grep-program &quot;C:\\\&quot;Program Files (x86)\&quot;\\Git\\bin\\grep.exe&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Same error message in all cases.&lt;/p&gt;&#xA;" OwnerUserId="14510" LastEditorUserId="780" LastEditDate="2017-01-11T20:18:00.110" LastActivityDate="2017-01-11T20:55:24.287" Title="Projectile indexing won't work on Windows" Tags="|helm|microsoft-windows|projectile|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29943" PostTypeId="2" ParentId="29920" CreationDate="2017-01-11T10:50:51.407" Score="7" Body="&lt;p&gt;Yes, you can use a hook:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'term-mode-hook (lambda () (text-scale-decrease 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8842" LastEditorUserId="8842" LastEditDate="2021-06-09T06:38:40.880" LastActivityDate="2021-06-09T06:38:40.880" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29944" PostTypeId="1" CreationDate="2017-01-11T11:00:45.930" Score="0" ViewCount="257" Body="&lt;p&gt;Using web-mode and evil I get a really strange behaviour when pressing return after curly braces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let StubMapsService = Ember.Service.extend({&#xA;    getMapElement(location) { (RET)&#xA;        }&#xA;});&#xA;&#xA;let f = function(assert) { (RET)&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;RET is set to &quot;evil-ret&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When writing java-files the Indentation is correct after inserting }.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also when I press C-c TAB in web-mode, so web-mode auto-indents the buffer, then everything looks correct:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let StubMapsService = Ember.Service.extend({&#xA;    getMapElement(location) {&#xA;    }&#xA;});&#xA;&#xA;let f = function(assert) {&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I searched for an hour for a solution. I tried changing c-indent-offset, setting web-mode-code-indent-offset, but nothing helped. Turning off electric-indent-mode I get no indentation after pressing RET. Any Idea what is going wrong? &lt;/p&gt;&#xA;" OwnerUserId="12284" LastActivityDate="2017-01-11T11:00:45.930" Title="web-mode-indentation wrong" Tags="|indentation|evil|web-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29946" PostTypeId="2" ParentId="29933" CreationDate="2017-01-11T13:47:03.427" Score="2" Body="&lt;p&gt;I use tramp in conjunction with bookmarks, so you avoid having to type in long names repeatedly. And there is a command helm-bookmarks, which lets you choose among your bookmarks.&lt;/p&gt;&#xA;" OwnerUserId="2415" LastActivityDate="2017-01-11T13:47:03.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29947" PostTypeId="2" ParentId="29256" CreationDate="2017-01-11T13:56:57.913" Score="4" Body="&lt;p&gt;As with the comment, &lt;code&gt;pos-tip-show&lt;/code&gt; works fine for me too.&lt;/p&gt;&#xA;&lt;p&gt;I did hack together a better (but not perfect) version of the &lt;code&gt;momentary-string-display&lt;/code&gt; version. I just rewrote the display function so that it deleted the overlay passively through a hook instead of waiting for an exit-char, which doesn't seem appropriate for what you are trying to do. The display function I put together temporarily overwrites the next line of the buffer with the message. See if you like it.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar my-display-overlay nil)&#xA;&#xA;(defun my-delete-string-display ()&#xA;  (when (overlayp my-display-overlay)&#xA;    (delete-overlay my-display-overlay))&#xA;  (remove-hook 'post-command-hook 'my-delete-string-display))&#xA;&#xA;(defun my-string-display-next-line (string)&#xA;  &amp;quot;Overwrite contents of next line with STRING until next command.&amp;quot;&#xA;  (let ((str (concat&#xA;               (make-string (1+ (current-indentation)) 32)&#xA;               (propertize (copy-sequence string) 'face '(:background &amp;quot;#3e4451&amp;quot; :extend t))))&#xA;         (start-pos nil)&#xA;         (end-pos nil))&#xA;    (unwind-protect&#xA;      (save-excursion&#xA;        (my-delete-string-display)&#xA;        (forward-line)&#xA;        (setq start-pos (point))&#xA;        (end-of-line)&#xA;        (setq end-pos (point))&#xA;        (setq my-display-overlay (make-overlay start-pos end-pos))&#xA;        ;; Hide full line&#xA;        (overlay-put my-display-overlay 'display &amp;quot;&amp;quot;)&#xA;        ;; Display message&#xA;        (overlay-put my-display-overlay 'before-string str))&#xA;      (add-hook 'post-command-hook 'my-delete-string-display))))&#xA;&#xA;(defun my-eldoc-display-message-momentary (format-string &amp;amp;rest args)&#xA;  &amp;quot;Display eldoc message near point.&amp;quot;&#xA;  (when format-string&#xA;    (my-string-display-next-line (apply 'format format-string args))))&#xA;&#xA;(setq eldoc-message-function #'my-eldoc-display-message-momentary)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="2418" LastEditDate="2021-11-10T04:21:52.570" LastActivityDate="2021-11-10T04:21:52.570" CommentCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="29948" PostTypeId="1" AcceptedAnswerId="29977" CreationDate="2017-01-11T14:25:26.203" Score="8" ViewCount="6227" Body="&lt;p&gt;I'm following the tutorial &lt;a href=&quot;http://endlessparentheses.com/init-org-Without-org-mode.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; to implement my &lt;code&gt;init.el&lt;/code&gt; file in org mode. I therefore cleaned out my &lt;code&gt;init.el&lt;/code&gt; file and added this only:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'org)&#xA;(org-babel-load-file&#xA; (expand-file-name &quot;emacs-init.org&quot;&#xA;                   user-emacs-directory))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I do I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-type-argument stringp nil)&#xA;  expand-file-name(nil)&#xA;  load-file(nil)&#xA;  org-babel-load-file(&quot;/home/tom/.emacs.d/emacs-init.org&quot;)&#xA;  mapc(org-babel-load-file (&quot;/home/tom/.emacs.d/emacs-init.org&quot;))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/tom/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 1065&#xA;  load-with-code-conversion(&quot;/home/tom/.emacs.d/init.el&quot; &quot;/home/tom/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/tom/.emacs.d/init&quot; t t)&#xA;  ...&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that the &lt;code&gt;expand-file-name&lt;/code&gt; function is working, but for some reason &lt;code&gt;nil&lt;/code&gt; is being passed to the &lt;code&gt;load-file&lt;/code&gt; function. Is that a proper reading of this stack trace? And if so, then why is that happening?&lt;/p&gt;&#xA;" OwnerUserId="8228" LastEditorUserId="105" LastEditDate="2017-01-12T00:41:58.823" LastActivityDate="2018-03-05T12:46:46.157" Title="'wrong-type-argument stringp nil' Error With org-babel-load-file Function" Tags="|org-mode|debugging|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29949" PostTypeId="2" ParentId="29942" CreationDate="2017-01-11T15:11:38.983" Score="5" Body="&lt;p&gt;This question does not seem to be about Projectile or Helm, but more generally about using grep/find with Emacs on Windows. Have you tried any of the built-in Emacs commands like &lt;code&gt;rgrep&lt;/code&gt;, &lt;code&gt;find-grep-dired&lt;/code&gt;, etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple things to try:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Evaluate &lt;code&gt;(executable-find &quot;find&quot;)&lt;/code&gt; to see where Emacs finds the &lt;code&gt;find&lt;/code&gt; executable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Evaluate &lt;code&gt;(getenv &quot;PATH&quot;)&lt;/code&gt; to see what PATH is set to in your Emacs environment. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've generally found I want to update both &lt;code&gt;exec-path&lt;/code&gt; and &lt;code&gt;PATH&lt;/code&gt; on Windows. Here's a bit of code I'm currently using to make sure my unix shell tools are ahead of any Windows executables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Windows path&#xA;(when (eq system-type 'windows-nt)&#xA;&#xA;  ;; Make sure Unix tools are in front of `exec-path'&#xA;  (let ((bash (executable-find &quot;bash&quot;)))&#xA;    (when bash&#xA;      (push (file-name-directory bash) exec-path)))&#xA;&#xA;  ;; Update PATH from exec-path&#xA;  (let ((path (mapcar 'file-truename&#xA;                      (append exec-path&#xA;                              (split-string (getenv &quot;PATH&quot;) path-separator t)))))&#xA;    (setenv &quot;PATH&quot; (mapconcat 'identity (delete-dups path) path-separator))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This finds my unix bin dir (by looking for &lt;code&gt;bash&lt;/code&gt;) and makes sure it is at the front of &lt;code&gt;exec-path&lt;/code&gt;. Then I change the PATH variable to match the &lt;code&gt;exec-path&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update: Details about projectile use of find&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few details about projectile, if this is really specific to projectile:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;On Windows, projectile defaults to setting &lt;code&gt;projectile-indexing-method&lt;/code&gt; to &lt;code&gt;native&lt;/code&gt;, which does not use external tools like &lt;code&gt;find&lt;/code&gt;. If it is calling find then you may have changed the configuration to use &lt;code&gt;alien&lt;/code&gt; indexing, which looks for external tools.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use &lt;code&gt;alien&lt;/code&gt; indexing, projectile will first check if the project uses a version control tool that provides fast searching, e.g. git. Otherwise it will fall back to using &lt;code&gt;projectile-generic-command&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The default value for &lt;code&gt;projectile-generic-command&lt;/code&gt; is &lt;code&gt;&quot;find . -type f -print0&quot;&lt;/code&gt;. Note that this is a string passed to &lt;code&gt;shell-command-to-string&lt;/code&gt;, and so it expects that the shell will have &lt;code&gt;find&lt;/code&gt; on the PATH. Changing e.g. &lt;code&gt;find-program&lt;/code&gt; and &lt;code&gt;exec-path&lt;/code&gt; are not relevant here, since those do not affect a shell process created by Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So if projectile is failing to use the right find command, you probably want to make sure that your shell (as determined by &lt;code&gt;shell-file-name&lt;/code&gt;) is running with the right PATH. As I noted above, you can setenv PATH within Emacs, and this will affect the environment of shell processes that Emacs creates. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-01-11T20:55:24.287" LastActivityDate="2017-01-11T20:55:24.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29951" PostTypeId="2" ParentId="29940" CreationDate="2017-01-11T16:33:38.103" Score="4" Body="&lt;p&gt;Some programs run your editor and ask you to edit some text. (For instance: writing a commit message in git when you didn't specify one in your command.) They expect you to turn off your editor when you're done with editing, but turning off your entire Emacs server would be pointless. &lt;code&gt;server-edit&lt;/code&gt; exists so you can use Emacs with programs that work like that easily.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2017-01-11T16:33:38.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29953" PostTypeId="1" CreationDate="2017-01-11T17:47:56.870" Score="0" ViewCount="363" Body="&lt;p&gt;In emacs, I press M-x shell to create a shell in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the shell, I can use autocomplete file names with respect to the current working directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If outside the shell e.g. in Nautilus, I move the current directory somewhere else, then back in the shell, the autocompletion of file names will not be working correctly, still with respect to the old pathname of the current working directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to refresh the buffer of the shell by M-x revert-buffer, but it didn't work because the buffer didn't open a file but a shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I solve the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2017-01-14T10:29:07.083" Title="Autocompletion of filename doesn't work in a shell in a buffer, when the current working directory is moved" Tags="|shell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29954" PostTypeId="2" ParentId="29942" CreationDate="2017-01-11T18:00:37.813" Score="0" Body="&lt;p&gt;OK so I finally figured this out. Everything was set up correctly but projectile seems to remember the last place it found the find.exe. After deleting all of the projectile related files from my .emacs.d fold helm-projectile-find-file began to work.&lt;/p&gt;&#xA;" OwnerUserId="14510" LastActivityDate="2017-01-11T18:00:37.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29955" PostTypeId="1" CreationDate="2017-01-11T18:20:13.130" Score="3" ViewCount="473" Body="&lt;p&gt;If some people send emails to me, they use outlook or other modern email client, writing html email with image. When I reply these html emails, mu4e usually converted them into text content, it make other people uncomfortable. They complain to me why use this email client(mu4e).&#xA;I want to know if it has a way to keep email original format without changing it when replying emails using mu4e(maybe org mode can help, but I do not know).&lt;/p&gt;&#xA;" OwnerUserId="14517" LastActivityDate="2017-01-11T18:20:13.130" Title="prevent mu4e convert html email to text when replying email" Tags="|mu4e|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29956" PostTypeId="1" AcceptedAnswerId="29961" CreationDate="2017-01-11T19:14:43.940" Score="8" ViewCount="1029" Body="&lt;p&gt;Scenario: I have several (more than 2) windows open. I actively work with two of them. How do I best jump from one window to another, and back, with &lt;em&gt;one&lt;/em&gt; command?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use ace-window; it's great but I don't want to press window number every time.&#xA;I know about &lt;code&gt;next-window&lt;/code&gt; / &lt;code&gt;prev-window&lt;/code&gt;, but these are two different commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm looking for is something that remembers what the previous windows was when I select another window, and gets back to it. Invoked repeatedly, it would switch between the last two windows, &lt;kbd&gt;Alt&lt;/kbd&gt;-&lt;kbd&gt;Tab&lt;/kbd&gt;-style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do I look?&lt;/p&gt;&#xA;" OwnerUserId="9370" LastEditorUserId="9370" LastEditDate="2017-01-11T22:33:54.947" LastActivityDate="2019-05-07T04:33:52.757" Title="How to cycle between two windows when I have more than two open?" Tags="|window|" AnswerCount="3" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29957" PostTypeId="2" ParentId="29956" CreationDate="2017-01-11T19:40:46.730" Score="4" Body="&lt;p&gt;Here's a simple command, lightly tested, that will switch you to&#xA;the most recently visited window:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar recent-window nil&#xA;  &quot;The most recently visited window.&quot;)&#xA;&#xA;(defun switch-to-recent-window ()&#xA;  &quot;Switch to the most recently visited window, as stored in&#xA;`recent-window'.&quot;&#xA;  (interactive)&#xA;  (let ((current (car (window-list))))&#xA;    (if recent-window&#xA;        (select-window recent-window)&#xA;      (message (concat &quot;No recent window selected, &quot;&#xA;                       &quot;so I'm setting this window &quot;&#xA;                       &quot;as the most recent.&quot;)))&#xA;    (setq recent-window current)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-11T19:40:46.730" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29958" PostTypeId="2" ParentId="29953" CreationDate="2017-01-11T19:58:47.153" Score="1" Body="&lt;p&gt;&lt;code&gt;M-enter&lt;/code&gt; will re-sync the directory. It is bound to &lt;code&gt;shell-resync-dirs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic functionality of the function is to call &lt;code&gt;command dirs&lt;/code&gt; This can be altered by changing variable &lt;code&gt;shell-dirstack-query&lt;/code&gt;. Because output is read directly from the buffer code can get confused, if it reads wrong line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes Emacs says &quot;Couldn’t cd: (error No such directory found via CDPATH environment variable)&quot;. One of the reason is that the resync command does not read the right path from the output. It does not expect command to be echoed by the shell process. In this case change &lt;code&gt;comint-process-echoes&lt;/code&gt; to true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all else fails directory can be set manually using invoking cd-function (&lt;code&gt;M-x cd&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="13378" LastEditorUserId="13378" LastEditDate="2017-01-14T10:29:07.083" LastActivityDate="2017-01-14T10:29:07.083" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29959" PostTypeId="1" CreationDate="2017-01-11T20:19:28.467" Score="2" ViewCount="98" Body="&lt;p&gt;I can add LaTeX equation in my org file using for instance.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{equation}&#xA;x^2 + y^2 = z^2&#xA;\end{equation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case when I export to html everything works fine. However, when I try to use a special command from a specific package for instance slashed command (\usepackage{slashed})&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{equation}&#xA;\slashed{p} + y^2 = z^2&#xA;\end{equation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and export to html I can not see the output. How can I use specific commands from Latex packages while exporting to html?&lt;/p&gt;&#xA;" OwnerUserId="9735" LastEditorUserId="97" LastEditDate="2017-01-12T23:51:40.390" LastActivityDate="2017-01-12T23:51:40.390" Title="How can we use a specific command from LaTeX package while exporting to html?" Tags="|org-mode|org-export|latex|html|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29960" PostTypeId="2" ParentId="29956" CreationDate="2017-01-11T20:28:20.980" Score="6" Body="&lt;p&gt;If you are already using &lt;code&gt;ace-window&lt;/code&gt;, then you can use the command &lt;code&gt;aw-flip-window&lt;/code&gt; to flip back and forth between two windows. By default this is bound to &lt;code&gt;n&lt;/code&gt; in the ace-window &lt;code&gt;aw-dispatch-alist&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means that you can invoke ace-window and hit &lt;code&gt;n&lt;/code&gt; instead of a window number to flip back to the previous window. You could also bind &lt;code&gt;aw-flip-window&lt;/code&gt; to some other key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this will only flip back to a window that was previously selected by ace-window. If you often switch windows with other commands you may want a more general solution. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-01-12T00:00:44.090" LastActivityDate="2017-01-12T00:00:44.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29961" PostTypeId="2" ParentId="29956" CreationDate="2017-01-11T20:40:13.180" Score="6" Body="&lt;p&gt;One way to write your own command is to use the built in &lt;code&gt;get-mru-window&lt;/code&gt; function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-flip-window ()&#xA;  (interactive)&#xA;  (let ((win  (get-mru-window nil nil t)))&#xA;    (when win (select-window win))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This looks for the most-recently-used window in the current frame that is not the currently selected window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a variation that works across visible frames:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-flip-window ()&#xA;  (interactive)&#xA;  (let ((win  (get-mru-window 'visible nil t)))&#xA;    (when win&#xA;      (select-frame-set-input-focus (window-frame win))&#xA;      (select-window win))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the comments, here's a variation that works when there's only one window (switching to the most recent buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun flip-window ()&#xA;  (interactive)&#xA;  (let ((win  (get-mru-window 'visible t t)))&#xA;    (if win&#xA;        (progn&#xA;          (select-frame-set-input-focus (window-frame win))&#xA;          (select-window win))&#xA;      (mode-line-other-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2019-05-07T04:33:52.757" LastActivityDate="2019-05-07T04:33:52.757" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="29962" PostTypeId="1" AcceptedAnswerId="29967" CreationDate="2017-01-11T21:25:55.650" Score="1" ViewCount="317" Body="&lt;p&gt;When I enter &lt;code&gt;C-x ESC&lt;/code&gt; I want the sequence to stop or cancel and I don't want Evil to wait for the next key or key chord in the sequence. Is there a way to achieve that?&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="600" LastEditDate="2017-01-11T23:07:49.033" LastActivityDate="2017-02-11T00:58:06.153" Title="How can I abort key sequence with the escape key in Evil?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29963" PostTypeId="1" AcceptedAnswerId="29964" CreationDate="2017-01-11T23:07:05.433" Score="2" ViewCount="451" Body="&lt;p&gt;I'd like to be able to toggle &lt;code&gt;M-x font-lock-mode&lt;/code&gt; with a custom key binding like &lt;kbd&gt;C-c l&lt;/kbd&gt; for example (or any minor mode for that matter).&lt;/p&gt;&#xA;&lt;p&gt;Can this be done relatively easily?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastEditorUserId="105" LastEditDate="2021-12-20T00:19:50.740" LastActivityDate="2021-12-20T00:19:50.740" Title="Toggle a minor mode with a custom key binding" Tags="|key-bindings|minor-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29964" PostTypeId="2" ParentId="29963" CreationDate="2017-01-11T23:53:02.687" Score="4" Body="&lt;p&gt;Add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c l&quot;) 'font-lock-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can follow the same pattern for any minor mode, because all minor modes are &lt;em&gt;commands&lt;/em&gt; (meaning they can be bound to key sequences).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, anything you can invoke via &lt;code&gt;M-x&lt;/code&gt; is a command and can be bound to a key sequence (and using the key binding is equivalent to calling it via &lt;code&gt;M-x&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n.b. Your choice of &lt;code&gt;C-c l&lt;/code&gt; is a good one, as &lt;code&gt;C-c&lt;/code&gt; followed by an upper- or lower-case letter is always a key sequence reserved for use by end-users, so it should never conflict with any other keymap.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-01-11T23:58:28.317" LastActivityDate="2017-01-11T23:58:28.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29966" PostTypeId="2" ParentId="29948" CreationDate="2017-01-12T00:40:58.280" Score="5" Body="&lt;p&gt;Load the source file that defines org-babel-load-file (&lt;code&gt;*.el&lt;/code&gt;, not &lt;code&gt;*.elc&lt;/code&gt;). Then &lt;code&gt;M-x debug-on-entry org-babel-load-file&lt;/code&gt;. Use &lt;code&gt;d&lt;/code&gt; to step through the execution, to see why, given the argument &lt;code&gt;&quot;/home/tom/.emacs.d/emacs-init.org&quot;&lt;/code&gt;, it ends up trying to load &lt;code&gt;nil&lt;/code&gt; and not a file name.  You can use &lt;code&gt;c&lt;/code&gt; to skip through any steps you are not interested in digging into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Function-Debugging.html&quot; rel=&quot;noreferrer&quot;&gt;Function Debugging&lt;/a&gt; (and its parent node, &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Debugger.html&quot; rel=&quot;noreferrer&quot;&gt;Debugger&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-12T00:40:58.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29967" PostTypeId="2" ParentId="29962" CreationDate="2017-01-12T00:41:30.157" Score="1" Body="&lt;p&gt;Assuming you're in the GUI version of emacs, this is not too hard. The terminal is a different story. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a function from my &lt;a href=&quot;https://melpa.org/#/which-key&quot; rel=&quot;nofollow noreferrer&quot;&gt;which-key&lt;/a&gt; package to help get you started. The idea is bind &lt;code&gt;&amp;lt;escape&amp;gt;&lt;/code&gt; at every level of every keymap. There might be &quot;simpler&quot; but more error prone ways to do this, but it's not clear to me that they will be better. Try this to start. It will hit every key in the global-map. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun which-key-define-key-recursively (map key def &amp;amp;optional at-root)&#xA;  &quot;Recursively bind KEY in MAP to DEF on every level of MAP except the first.&#xA;If AT-ROOT is non-nil the binding is also placed at the root of MAP.&quot;&#xA;  (when at-root (define-key map key def))&#xA;  (map-keymap&#xA;   (lambda (_ev df)&#xA;     (when (keymapp df)&#xA;       (which-key-define-key-recursively df key def t)))&#xA;   map))&#xA;&#xA;(which-key-define-key-recursively global-map [escape] 'ignore)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-01-12T00:41:30.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29968" PostTypeId="1" AcceptedAnswerId="30259" CreationDate="2017-01-12T01:21:01.587" Score="2" ViewCount="642" Body="&lt;p&gt;I use org-mode clocks to keep track of my work hours, and the timesheet is expected to be grouped by day. The thing is, I sometimes work late at night, and the daily view shows work splitted up like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Daily report: [2017-01-11 Wed]&#xA;  | Headline                                   | Time   |      |&#xA;  |--------------------------------------------+--------+------|&#xA;  | *Total time*                               | *1:06* |      |&#xA;  |--------------------------------------------+--------+------|&#xA;  | something                                  | 1:06   |      |&#xA;  | \emsp Some task                            |        | 1:06 |&#xA;&#xA;  Daily report: [2017-01-12 Thu]&#xA;  | Headline                                   | Time   |      |&#xA;  |--------------------------------------------+--------+------|&#xA;  | *Total time*                               | *3:10* |      |&#xA;  |--------------------------------------------+--------+------|&#xA;  | something                                  | 3:10   |      |&#xA;  | \emsp Some task                            |        | 3:10 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to have the clocking command put all hours in the first day's report? Maybe by providing an offset for when a day starts?&lt;/p&gt;&#xA;" OwnerUserId="14525" LastActivityDate="2017-01-27T13:00:29.963" Title="Org mode clock report shift day range" Tags="|org-mode|org-clock-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29970" PostTypeId="1" CreationDate="2017-01-12T02:11:35.233" Score="3" ViewCount="2198" Body="&lt;p&gt;I am trying to customize org-agenda-* faces such as org-agenda-date, &#xA;org-agenda-date-today, and org-agenda-date-weekend in my .emacs file. Normally,&#xA;I install the use-package package to lazily load each package to reduce emacs init time. At first, in the code below I call set-face-attribute to customize those faces, but it is in vain.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org-mode&#xA;    :config&#xA;    (set-face-attribute 'org-agenda-date-today nil&#xA;                        :foreground &quot;#FFFFEF&quot;&#xA;                        :background &quot;#3F3F3F&quot;&#xA;                        :bold t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next, I found that other emacs users invoke the defface function to customize those faces instead, and it does also work in my setup.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package zenburn-theme&#xA;    :ensure t&#xA;    :config&#xA;    (load-theme 'zenburn t)&#xA;    (defface org-agenda-date&#xA;       '((t (:foreground &quot;#BFEBBF&quot;&#xA;             :background &quot;#3F3F3F&quot;&#xA;             :bold nil)))&#xA;    &quot;Face used in agenda for weekdays.&quot;&#xA;      :group 'org-faces))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: Lawlist's comment reminds me of using M-x customize-face to customize these faces and it works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Between the three approaches defface, set-face-attribute, and customize-face, which one is the best way to customize faces? In case you have an alternative way to customize them, please share your approach here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="14020" LastEditorUserId="14020" LastEditDate="2017-01-12T03:40:17.077" LastActivityDate="2020-04-04T12:00:40.200" Title="How to customize org-agenda-* faces in .emacs file?" Tags="|init-file|faces|themes|customize|use-package|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29971" PostTypeId="1" CreationDate="2017-01-12T03:28:43.223" Score="4" ViewCount="2245" Body="&lt;p&gt;I'm trying to setup a lint for javascript files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the relevant setup I have. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package&#xA;  js2-mode&#xA;  :ensure t&#xA;  :init&#xA;  (progn&#xA;&#xA;    (add-to-list 'auto-mode-alist '(&quot;\\.js?\\'&quot; . js2-jsx-mode))&#xA;    )&#xA;  )&#xA;&#xA;(use-package&#xA;  flycheck&#xA;  :ensure t&#xA;  :init&#xA;  (progn&#xA;    (add-hook 'after-init-hook #'global-flycheck-mode)&#xA;    (setq flycheck-highlighting-mode 'lines)&#xA;&#xA;    ;; https://github.com/mooz/js2-mode/issues/292&#xA;&#xA;    (defun setup-js2-mode ()&#xA;      (flycheck-select-checker 'javascript-eslint)&#xA;      (flycheck-mode))&#xA;&#xA;    (add-hook 'js2-mode-hook #'setup-js2-mode)&#xA;    (add-hook 'js2-jsx-mode-hook #'setup-js2-mode)&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;also I know emacs can find eslint&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-: (executable-find &quot;eslint&quot;)&#xA;&quot;/home/eugenekim/.nvm/versions/node/v6.4.0/bin/eslint&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get no errors with &lt;code&gt;flycheck-list-errors&lt;/code&gt; when I deliverately make errors on *.js files &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I found the following weird. (not sure relevant)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x flycheck-select-checker (enter) javascript-eslint&#xA;&#xA;Can’t use syntax checker javascript-eslint in this buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2017-01-12T03:28:43.223" Title="flycheck eslint for javascript" Tags="|flycheck|javascript|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29973" PostTypeId="1" AcceptedAnswerId="73828" CreationDate="2017-01-12T09:25:25.427" Score="3" ViewCount="866" Body="&lt;p&gt;Using &lt;code&gt;javascript-mode&lt;/code&gt;, functions are indented like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;console.log('Example',&#xA;            var1,&#xA;            var2);&#xA;&#xA;test('Example2',&#xA;     var1,&#xA;     var2);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to change this so that subsequent lines are intended by one tab instead, which is represented here with two spaces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;console.log('Example',&#xA;  var1,&#xA;  var2);&#xA;&#xA;test('Example2',&#xA;  var1,&#xA;  var2);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can this be done?  I can't find any options for &lt;code&gt;javascript-mode&lt;/code&gt; that control this part of the indent process.&lt;/p&gt;&#xA;" OwnerUserId="13009" LastActivityDate="2022-09-26T10:28:32.043" Title="Stop javascript-mode from lining up function parameters after newline" Tags="|indentation|javascript|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29975" PostTypeId="2" ParentId="29973" CreationDate="2017-01-12T12:19:48.830" Score="3" Body="&lt;p&gt;The code that handles this is the function &lt;code&gt;js--proper-indentation&lt;/code&gt;, based on analysis from &lt;code&gt;syntax-ppss&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Easiest solution (if you can tolerate it) is to write your code like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;console.log(&#xA;    'Example',&#xA;    var1,&#xA;    var2);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Otherwise, you're going to have to modify the code.  (I see no customization option in &lt;code&gt;js.el&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, you need to do something different from this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If there is something following the opening&#xA;;; paren/bracket, everything else should be indented at&#xA;;; the same level.&#xA;(unless same-indent-p&#xA;  (forward-char)&#xA;  (skip-chars-forward &quot; \t&quot;))&#xA;(current-column))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you feel adventuresome, you might try modifying that function.  In &lt;em&gt;very brief&lt;/em&gt; experimentation, this seemed to work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find the conditional that begins with this line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (looking-at &quot;[({[]\\s-*\\(/[/*]\\|$\\)&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you remove the &lt;code&gt;if&lt;/code&gt; (that whole line above) and the s-expressions that are the &lt;code&gt;else&lt;/code&gt; part of the &lt;code&gt;if&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If there is something following the opening&#xA;;; paren/bracket, everything else should be indented at&#xA;;; the same level.&#xA;(unless same-indent-p&#xA;  (forward-char)&#xA;  (skip-chars-forward &quot; \t&quot;))&#xA;(current-column)) ;; &amp;lt;- that is the end of the &quot;if&quot;&#xA;))                ;; keep those last two close parens.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;then&lt;/em&gt;, I think you will just get your normal indention level for lines after the start of a function.  That worked for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my modified &lt;code&gt;defun&lt;/code&gt; which you can use as &lt;code&gt;:override&lt;/code&gt; advice:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-js--proper-indentation (parse-status)&#xA;  &quot;Return the proper indentation for the current line.&quot;&#xA;  (save-excursion&#xA;    (back-to-indentation)&#xA;    (cond ((nth 4 parse-status)    ; inside comment&#xA;           (js--get-c-offset 'c (nth 8 parse-status)))&#xA;          ((nth 3 parse-status) 0) ; inside string&#xA;          ((eq (char-after) ?#) 0)&#xA;          ((save-excursion (js--beginning-of-macro)) 4)&#xA;          ;; Indent array comprehension continuation lines specially.&#xA;          ((let ((bracket (nth 1 parse-status))&#xA;                 beg)&#xA;             (and bracket&#xA;                  (not (js--same-line bracket))&#xA;                  (setq beg (js--indent-in-array-comp bracket))&#xA;                  ;; At or after the first loop?&#xA;                  (&amp;gt;= (point) beg)&#xA;                  (js--array-comp-indentation bracket beg))))&#xA;          ((js--ctrl-statement-indentation))&#xA;          ((js--multi-line-declaration-indentation))&#xA;          ((nth 1 parse-status)&#xA;       ;; A single closing paren/bracket should be indented at the&#xA;       ;; same level as the opening statement. Same goes for&#xA;       ;; &quot;case&quot; and &quot;default&quot;.&#xA;           (let ((same-indent-p (looking-at &quot;[]})]&quot;))&#xA;                 (switch-keyword-p (looking-at &quot;default\\_&amp;gt;\\|case\\_&amp;gt;[^:]&quot;))&#xA;                 (continued-expr-p (js--continued-expression-p)))&#xA;             (goto-char (nth 1 parse-status)) ; go to the opening char&#xA;             (progn ; nothing following the opening paren/bracket&#xA;               (skip-syntax-backward &quot; &quot;)&#xA;               (when (eq (char-before) ?\)) (backward-list))&#xA;               (back-to-indentation)&#xA;               (js--maybe-goto-declaration-keyword-end parse-status)&#xA;               (let* ((in-switch-p (unless same-indent-p&#xA;                                     (looking-at &quot;\\_&amp;lt;switch\\_&amp;gt;&quot;)))&#xA;                      (same-indent-p (or same-indent-p&#xA;                                         (and switch-keyword-p&#xA;                                              in-switch-p)))&#xA;                      (indent&#xA;                       (cond (same-indent-p&#xA;                              (current-column))&#xA;                             (continued-expr-p&#xA;                              (+ (current-column) (* 2 js-indent-level)&#xA;                                 js-expr-indent-offset))&#xA;                             (t&#xA;                              (+ (current-column) js-indent-level&#xA;                                 (pcase (char-after (nth 1 parse-status))&#xA;                                   (?\( js-paren-indent-offset)&#xA;                                   (?\[ js-square-indent-offset)&#xA;                                   (?\{ js-curly-indent-offset)))))))&#xA;                 (if in-switch-p&#xA;                     (+ indent js-switch-indent-offset)&#xA;                   indent)))))&#xA;&#xA;          ((js--continued-expression-p)&#xA;           (+ js-indent-level js-expr-indent-offset))&#xA;          (t 0))))&#xA;&#xA;(advice-add 'js--proper-indentation :override 'my-js--proper-indentation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2017-01-12T12:19:48.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29976" PostTypeId="1" AcceptedAnswerId="30014" CreationDate="2017-01-12T14:13:28.040" Score="1" ViewCount="472" Body="&lt;p&gt;For a year or so I've used Bernt Hansen's good org-mode workflow and init file, with a couple small adaptations. &lt;a href=&quot;http://doc.norang.ca/org-mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://doc.norang.ca/org-mode.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm almost done setting up org-mode on a new computer (new job) but I can't get refile working properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the agenda, when I use &lt;code&gt;C-c C-w&lt;/code&gt; for single refile or &lt;code&gt;m B r&lt;/code&gt; for bulk refile, I get the &lt;code&gt;Refile to:&lt;/code&gt; prompt as expected. But there are no target options displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my previous computer, I had a nice list of target locations to select from (similar in look+functionality to &lt;code&gt;C-x b&lt;/code&gt;, but the &lt;code&gt;Refile to:&lt;/code&gt; list also included headlines ... I'm not sure what this is called ... IDO?). I would like to have this functionality again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This part of &lt;code&gt;init.el&lt;/code&gt; looks correct:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Targets include this file and any file contributing to the agenda - up to 9 levels deep&#xA;(setq org-refile-targets (quote ((nil :maxlevel . 9)&#xA;                                 (org-agenda-files :maxlevel . 9))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and IDO is turned on:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; Use IDO for both buffer and file completion and ido-everywhere to t&#xA;(setq org-completion-use-ido t)&#xA;(setq ido-everywhere t)&#xA;(setq ido-max-directory-size 100000)&#xA;(ido-mode (quote both))&#xA;; Use the current window when visiting files and buffers with ido&#xA;(setq ido-default-file-method 'selected-window)&#xA;(setq ido-default-buffer-method 'selected-window)&#xA;; Use the current window for indirect buffer display&#xA;(setq org-indirect-buffer-display 'current-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where can I look next to troubleshoot this?&lt;/p&gt;&#xA;" OwnerUserId="14530" LastEditorUserId="14530" LastEditDate="2017-01-16T20:12:56.897" LastActivityDate="2017-01-16T20:12:56.897" Title="org-mode agenda refile doesn't provide buffer options" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29977" PostTypeId="2" ParentId="29948" CreationDate="2017-01-12T14:20:23.397" Score="1" Body="&lt;p&gt;Ok, after using Drew's debugging steps I learned that &lt;code&gt;org-babel-load-file&lt;/code&gt; basically does the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Load your &lt;code&gt;emacs-init.org&lt;/code&gt; file in org-mode.&lt;/li&gt;&#xA;&lt;li&gt;Strip out all of the emacs-lisp code blocks that contain your emacs config.&lt;/li&gt;&#xA;&lt;li&gt;Put those emacs-lisp code blocks into a file called &lt;code&gt;emacs-init.el&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;It then executes the code in that file.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My issue was that my &lt;code&gt;emacs-init.org&lt;/code&gt; file didn't yet contain any emacs-lisp code blocks so it couldn't create the &lt;code&gt;emacs-init.el&lt;/code&gt; file, which is why &lt;code&gt;nil&lt;/code&gt; is being passed to &lt;code&gt;load-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's what I'm doing instead that is working much better. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I added the code snippet in my question to the top of my existing &lt;code&gt;init.el&lt;/code&gt; file.&lt;/li&gt;&#xA;&lt;li&gt;I then created an &lt;code&gt;emacs-init.org&lt;/code&gt; file in the &lt;code&gt;.emacs.d&lt;/code&gt; dir.&lt;/li&gt;&#xA;&lt;li&gt;I then moved a couple lines of config from &lt;code&gt;init.el&lt;/code&gt; to &lt;code&gt;emacs-init.org&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;I then start a second emacs process to test everything.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My plan is to move everything in chunks like this.&lt;/p&gt;&#xA;" OwnerUserId="8228" LastActivityDate="2017-01-12T14:20:23.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29978" PostTypeId="2" ParentId="14882" CreationDate="2017-01-12T14:37:56.450" Score="0" Body="&lt;p&gt;Answering my own question here, but I recently found out about &lt;a href=&quot;https://gitlab.com/vancan1ty/emacs-backward-forward/&quot; rel=&quot;nofollow noreferrer&quot;&gt;forward-backward-mode&lt;/a&gt; and it has solved my use case pretty well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also available on &lt;a href=&quot;http://www.melpa.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;Melpa&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="450" LastActivityDate="2017-01-12T14:37:56.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29979" PostTypeId="1" CreationDate="2017-01-12T16:26:08.913" Score="2" ViewCount="754" Body="&lt;p&gt;I need something like &lt;code&gt;get-host-by-name&lt;/code&gt; or &lt;code&gt;getent-hosts&lt;/code&gt; but I can not find any. Do they exist?&lt;/p&gt;&#xA;" OwnerUserId="2787" LastActivityDate="2019-03-04T03:07:57.823" Title="How to get the IP address of a host in Elisp?" Tags="|networking|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29981" PostTypeId="2" ParentId="29694" CreationDate="2017-01-12T20:12:35.237" Score="2" Body="&lt;p&gt;You blew the default value of &lt;code&gt;org-latex-classes&lt;/code&gt; away in line 4. Try this instead. I'm waiting for &lt;code&gt;ox-latex&lt;/code&gt; to load before touching &lt;code&gt;org-latex-classes&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  (with-eval-after-load 'org&#xA;    (org-babel-do-load-languages 'org-babel-load-languages&#xA;                                 '((dot . t)&#xA;                                   (maxima . t)&#xA;                                   (python . t)))&#xA;    (setq org-babel-python-command &quot;python3&quot;))&#xA;  (with-eval-after-load 'ox-latex&#xA;    (add-to-list 'org-latex-classes&#xA;                 '(&quot;koma-article&quot;&#xA;                   &quot;\\documentclass{scrartcl}&quot;&#xA;                   (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;                   (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;                   (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;)&#xA;                   (&quot;\\paragraph{%s}&quot; . &quot;\\paragraph*{%s}&quot;)&#xA;                   (&quot;\\subparagraph{%s}&quot; . &quot;\\subparagraph*{%s}&quot;)))&#xA;    ;; Settings to export code with `minted' instead of `verbatim'.&#xA;    (setq org-export-latex-listings t)&#xA;    (setq org-latex-listings 'minted&#xA;          org-latex-packages-alist '((&quot;&quot; &quot;minted&quot;))&#xA;          org-latex-pdf-process&#xA;          '(&quot;pdflatex -shell-escape -intera&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-01-12T20:12:35.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29982" PostTypeId="1" CreationDate="2017-01-12T21:19:08.637" Score="1" ViewCount="77" Body="&lt;p&gt;If I have an org-mode file where I want to embed a TikZ rendering at a certain place, I've found the simplest is just to throw something like this in where you want it, i.e., no code block necessary:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{figure}&#xA;    \centering&#xA;    \newlength\figureheight &#xA;    \newlength\figurewidth &#xA;    \setlength\figureheight{6cm} &#xA;    \setlength\figurewidth{8cm}&#xA;    \input{x2vxlogx.tikz}&#xA;    %\caption{A graph}&#xA;    %\label{fig:graph}&#xA;\end{figure}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Works just fine. But in order to have it work, I've had to change my file headers, i.e., before I had&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# this makes MathJax work, but the tex code import not&#xA;#+OPTIONS: tex:t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;versus&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# This makes MathJax not work, but the tex code import work&#xA;#+OPTIONS: tex:imagemagick&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there anyway to get both, i.e., have my math done by MathJax &lt;em&gt;and&lt;/em&gt; my tikz file import work too? I could leave it with &lt;code&gt;#+OPTIONS: tex:imagemagick&lt;/code&gt;, but then my math formulae are done as little pngs, which line up poorly on the page.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2017-01-12T21:19:08.637" Title="Import and run tizk code in org-mode" Tags="|org-mode|org-export|latex|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29983" PostTypeId="1" AcceptedAnswerId="29985" CreationDate="2017-01-13T04:07:22.007" Score="1" ViewCount="161" Body="&lt;p&gt;I accidentally smashed my hand on the bottom right of my keyboard and got the following prompt in the echo area: (I was in the &lt;code&gt;analyzeDiscussion()&lt;/code&gt; function in js-mode when this happened)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Send analyzeDiscussion to Mozilla? (y or n) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What command could have caused this? I tried &lt;code&gt;C-h l&lt;/code&gt; to get the last keys pressed, but I had already pressed too many keys and it had gone off the top of the buffer.&lt;/p&gt;&#xA;" OwnerUserId="14427" LastActivityDate="2017-01-13T05:34:02.713" Title="Mysterious command to send code to Mozilla?" Tags="|key-bindings|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29985" PostTypeId="2" ParentId="29983" CreationDate="2017-01-13T05:34:02.713" Score="1" Body="&lt;p&gt;&lt;code&gt;#'js-eval-defun&lt;/code&gt; is bound to &lt;kbd&gt;C-M-x&lt;/kbd&gt; in js-mode. Its docstring is &quot;Update a Mozilla tab using the JavaScript defun at point.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside it, it has a block of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (y-or-n-p (format &quot;Send %s to Mozilla? &quot;&#xA;                                      (mapconcat #'identity defun-info &quot;.&quot;)))&#xA;              (message &quot;&quot;) ; question message lingers until next command&#xA;              (cl-return-from js-eval-defun))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-01-13T05:34:02.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29986" PostTypeId="2" ParentId="17863" CreationDate="2017-01-13T06:07:21.323" Score="3" Body="&lt;p&gt;You could also use the &lt;a href=&quot;https://melpa.org/#/sml-modeline&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;sml-modeline&lt;/code&gt;&lt;/a&gt; package. It works pretty well in the terminal (imo) and is a nice alternative when &lt;a href=&quot;https://github.com/m2ym/yascroll-el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;yascroll&lt;/code&gt;&lt;/a&gt; doesn't work so well. However, you might want to apply the following monkey patch to &lt;code&gt;sml-modeline-mode&lt;/code&gt; if you don't want it messing with stuff that's already in your modeline:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'sml-modeline)&#xA;(defun sml-modeline-mode&#xA;    (&amp;amp;optional arg)&#xA;  &quot;Show buffer size and position like scrollbar in mode line.&#xA;You can customize this minor mode, see option `sml-modeline-mode'.&#xA;&#xA;    Note: If you turn this mode on then you probably want to turn off&#xA;option `scroll-bar-mode'.&quot;&#xA;  (interactive&#xA;   (list&#xA;    (or current-prefix-arg 'toggle)))&#xA;  (let&#xA;      ((last-message&#xA;        (current-message)))&#xA;    (setq-default sml-modeline-mode&#xA;                  (if&#xA;                      (eq arg 'toggle)&#xA;                      (not&#xA;                       (default-value 'sml-modeline-mode))&#xA;                    (&amp;gt;&#xA;                     (prefix-numeric-value arg)&#xA;                     0)))&#xA;    (if sml-modeline-mode&#xA;        (progn&#xA;          (unless sml-modeline-old-car-mode-line-position&#xA;            (setq sml-modeline-old-car-mode-line-position&#xA;                  (car mode-line-position)))&#xA;          (add-to-list 'mode-line-position ;; this line is patched and...&#xA;                       '(:eval&#xA;                         (list&#xA;                          (sml-modeline-create)))))&#xA;      (add-to-list 'mode-line-position sml-modeline-old-car-mode-line-position)) ;; this line is patched&#xA;                                                                                 ;; (they use `add-to-list' instead of `setcar')&#xA;    (run-hooks 'sml-modeline-mode-hook&#xA;               (if&#xA;                   (default-value 'sml-modeline-mode)&#xA;                   'sml-modeline-mode-on-hook 'sml-modeline-mode-off-hook))&#xA;    (if&#xA;        (called-interactively-p 'any)&#xA;        (progn&#xA;          (customize-mark-as-set 'sml-modeline-mode)&#xA;          (unless&#xA;              (and&#xA;               (current-message)&#xA;               (not&#xA;                (equal last-message&#xA;                       (current-message))))&#xA;            (let&#xA;                ((local &quot;&quot;))&#xA;              (message &quot;Sml-Modeline mode %sabled%s&quot;&#xA;                       (if&#xA;                           (default-value 'sml-modeline-mode)&#xA;                           &quot;en&quot; &quot;dis&quot;)&#xA;                       local))))))&#xA;  (force-mode-line-update)&#xA;  (default-value 'sml-modeline-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, only two lines there are patched which just make sure that it uses &lt;code&gt;add-to-list&lt;/code&gt; instead of &lt;code&gt;setcar&lt;/code&gt; (this keeps it from overriding anything that's the &lt;code&gt;car&lt;/code&gt; of &lt;code&gt;mode-line-position&lt;/code&gt;). Also, I have the following settings in my Custom file for &lt;code&gt;sml-modeline&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA;...&#xA; '(sml-modeline-borders (quote (&quot;[&quot; . &quot;] &quot;)))&#xA; '(sml-modeline-len 17)&#xA; '(sml-modeline-numbers (quote percentage))&#xA; ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The only real quirks I've seen for this mode are that it's not really accurate in things like &lt;code&gt;Info-mode&lt;/code&gt; (because it seems that &lt;code&gt;Info-mode&lt;/code&gt; buffers are actually one big buffer given the illusion of being multiple ones) and sometimes the &quot;scrollbar&quot; disappears between the percent symbol and the number adjacent to it when the &quot;scrollbar&quot; is really small. Other than that, &lt;code&gt;sml-modeline&lt;/code&gt; works pretty nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just found two hacky &quot;fixes&quot; for the aforementioned bugs. For the bug regarding &lt;code&gt;Info-mode&lt;/code&gt; et al. scrolling, if you remove the &lt;code&gt;(widen)&lt;/code&gt; invocations from &lt;code&gt;sml-modeline-create&lt;/code&gt;, you'll get the expected behavior. Note that I've only tested this in &lt;code&gt;Info-mode&lt;/code&gt;, so don't expect this &quot;fix&quot; to give desired behavior everywhere. For the other bug regarding the &quot;scrollbar&quot; disappearing, you can eliminate this effect by &lt;em&gt;not&lt;/em&gt; setting the &lt;code&gt;sml-modeline-borders&lt;/code&gt; variable. Not exactly sure why that works, but it does so whatever.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2017-01-22T02:26:26.777" LastActivityDate="2017-01-22T02:26:26.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29988" PostTypeId="1" AcceptedAnswerId="29991" CreationDate="2017-01-13T06:18:27.353" Score="2" ViewCount="543" Body="&lt;p&gt;When pull from magit on windows 10 (spacemacs), the error is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  1 C:/Program Files/Git/mingw64/libexec/git-core/git … pull origin&#xA;&#xA;fatal: Could not read from remote repository.&#xA;&#xA;Please make sure you have the correct access rights&#xA;and the repository exists.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if pull from command line it works. Is there any setting in magit to fix it?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C:\code\python\db-in-box&amp;gt;&quot;C:/Program Files/Git/mingw64/libexec/git-core/git&quot; --version&#xA;git version 2.11.0.windows.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14537" LastEditorUserId="11699" LastEditDate="2017-01-17T09:02:19.500" LastActivityDate="2017-01-17T09:02:19.500" Title="pull failed from magit, but pull works on command line (windows 10)" Tags="|magit|microsoft-windows|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29990" PostTypeId="1" AcceptedAnswerId="29995" CreationDate="2017-01-13T09:13:50.913" Score="5" ViewCount="3732" Body="&lt;p&gt;I installed &lt;code&gt;clang-format&lt;/code&gt; package from the MELPA repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added it to the &lt;code&gt;load-path&lt;/code&gt; in my init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I try to use it it says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Searching for program: No such file or directory, clang-format&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would assume this is because I don't have some kind of style file. Is this correct? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, how would I create such a file?&lt;/p&gt;&#xA;" OwnerUserId="13361" LastActivityDate="2017-01-13T13:21:57.230" Title="How to use clang-format package?" Tags="|package|clang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29991" PostTypeId="2" ParentId="29988" CreationDate="2017-01-13T10:27:26.527" Score="2" Body="&lt;p&gt;There's a number of things that could be wrong, for example Emacs and Windows might not agree on where &lt;code&gt;$HOME&lt;/code&gt; is. Or maybe you are trying to use password authentication, which does not work on Windows. But it's hard to tell because you don't provide much information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a whole wiki page dedicated to, well, &lt;em&gt;pushing&lt;/em&gt; on Windows. But if pushing works, then pulling works too. Check it out: &lt;a href=&quot;https://github.com/magit/magit/wiki/Pushing-with-Magit-from-Windows&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pushing with Magit from Windows&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linking to the documentation usually isn't an acceptable approach to answering a question on Stackexchange, but here I feel it is appropriate. But once you figured out what the issue in your particular case was, you are of course free to provide your own answer here, and maybe even adjust your question accordingly.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-01-13T10:27:26.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29992" PostTypeId="1" CreationDate="2017-01-13T12:48:02.627" Score="1" ViewCount="148" Body="&lt;p&gt;Currently I can grep (in command line) the gzip files I receive using the command &lt;code&gt;zgrep -a something logs.tar.gz&lt;/code&gt; it outputs every line inside the &lt;code&gt;logs.tar.gz&lt;/code&gt; but without the file where it was found, so is 80% useful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I turned to emacs but when I do the equivalent command &lt;code&gt;zrgrep&lt;/code&gt; I get only the &lt;code&gt;Binary file ./logs.tar.gz matches&lt;/code&gt;, when I click it opens the tar.gz file, but I don't see the matches.  I tried to visualise it by installing ascii with el-get without success and read over the different greps. Unfortunately I didn't find any clue on how to grep the open gz file in the buffer, it always refers to a physical dir. So currently I need to uncompress it and do the regular grep (that works well)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have the possibility to pass the command -a to get it in ascii text?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any possibility to run a grep (or equivalent command) on the buffer I have the gz file open?&lt;/p&gt;&#xA;" OwnerDisplayName="user12383" LastActivityDate="2017-01-13T12:48:02.627" Title="Can emacs emulate zgrep -a in zrgrep?" Tags="|grep|compression|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29993" PostTypeId="1" CreationDate="2017-01-13T12:48:39.333" Score="4" ViewCount="104" Body="&lt;p&gt;I have two modes that bind a key. How can I choose which one should get to do its thing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm asking generally but currently the situation is that when I'm in a certain mode, I want to use its bindings (which are currently shadowed by another mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I even tried to add a hook that &lt;code&gt;local-set-key&lt;/code&gt;s at the end of my init file but that doesn't work, it gets shadowed too.&lt;/p&gt;&#xA;" OwnerUserId="2540" LastActivityDate="2017-01-13T12:48:39.333" Title="How to prioritize key bindings between modes?" Tags="|key-bindings|" AnswerCount="0" CommentCount="4" ClosedDate="2018-12-07T17:53:18.213" ContentLicense="CC BY-SA 3.0" />
  <row Id="29994" PostTypeId="1" CreationDate="2017-01-13T13:05:12.767" Score="1" ViewCount="1786" Body="&lt;p&gt;I really need to get spellchecker on emacs (there are few who don't), and hunspell seems like the best option. The other options (aspell and ispell) are said to be ancient and also require a fair amount of configuration, so I figure there is no benefit to using those. Most instructions tell you to get a 4-year old pre-compiled 32-bit hunspell binary from ezwinports, though I've heard that it no longer works (and may not even be compatible with 64 bit emacs). So I'd like to compile it from the newest source from scratch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already have compiled hunspell for windows 10 x64 using msys2, per instructions from  &lt;a href=&quot;https://github.com/hunspell/hunspell&quot; rel=&quot;nofollow noreferrer&quot;&gt;hunspell&lt;/a&gt;. All I have now is just the &lt;strong&gt;DLL&lt;/strong&gt; and no dictionaries or executables. Does anyone know where to go from here to set up spell checking? I've seen the instructions on how to modify the .emacs file, but none seem tell you how to actually what a hunspell installation ought to look like. (and I don't see anything along the lines of &quot;point Emacs to the .dll; then point emacs to the dictionaries directory).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. does anyone know why this is so difficult? :) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- thanks for bearing with me.&lt;/p&gt;&#xA;" OwnerUserId="14543" LastEditorUserId="14543" LastEditDate="2017-01-13T13:11:05.780" LastActivityDate="2017-01-13T13:11:05.780" Title="Spell checking and hunspell on windows (preferably from scratch)" Tags="|microsoft-windows|ispell|hunspell|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29995" PostTypeId="2" ParentId="29990" CreationDate="2017-01-13T13:21:57.230" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/LoadPath&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;load_path&lt;/code&gt;&lt;/a&gt; is used for emacs lisp libraries, what you're looking for is &lt;a href=&quot;https://www.emacswiki.org/emacs/ExecPath&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;exec-path&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (append exec-path '(&quot;/path/to/clang-format&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or you can customize &lt;code&gt;clang-format-executable&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2017-01-13T13:21:57.230" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29996" PostTypeId="1" CreationDate="2017-01-13T14:15:10.753" Score="1" ViewCount="276" Body="&lt;p&gt;Autocompletion in &lt;code&gt;python-mode.el&lt;/code&gt; opens another completion window with available completions. It looks like this&lt;a href=&quot;https://i.stack.imgur.com/HfxgT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HfxgT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I need to use &lt;code&gt;company&lt;/code&gt; completion like default inferior python shell&#xA;&lt;a href=&quot;https://i.stack.imgur.com/p74Fe.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/p74Fe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I enable this in &lt;code&gt;python-mode.el&lt;/code&gt;? Or maybe I can use default inferior shell with &lt;code&gt;python-mode.el&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for my bad English.&lt;/p&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="105" LastEditDate="2017-02-07T18:52:29.103" LastActivityDate="2017-02-07T18:52:29.103" Title="How can I set python-mode.el shell completion like default inferior shell?" Tags="|python|company-mode|repl|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29997" PostTypeId="1" CreationDate="2017-01-13T14:17:07.597" Score="2" ViewCount="905" Body="&lt;p&gt;I had a problem with execution of &lt;code&gt;(comint-simple-send process command)&lt;/code&gt;. My previous example would not show the last output because I didn't use the hook and the result was being dispalyed before the command finished it's execution. Als I didn't know about having to restart the process to reflect the code changes.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;My solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The following code works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'comint-output-filter-functions&#xA;          '(lambda (txt) (message (format  &quot; output ----------- %c%s&quot; 10 txt))))&#xA;&#xA;(let* ((process-buffer (make-comint-in-buffer &quot;StrangeTerm&quot; &quot;*strange-term*&quot; &quot;/bin/bash&quot;))&#xA;       (p (get-buffer-process process-buffer)))&#xA;  (comint-simple-send p &quot;ls -l /&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The lambda has the expected output, which I can see in &lt;em&gt;Messages&lt;/em&gt; and in future I can do what I want with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please confirm if this is the correct approach.&lt;/p&gt;&#xA;" OwnerUserId="8952" LastEditorUserId="8952" LastEditDate="2017-01-13T20:34:17.877" LastActivityDate="2017-01-13T20:34:17.877" Title="I need example of correct using of comint and getting last comand output" Tags="|comint|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29998" PostTypeId="1" AcceptedAnswerId="32675" CreationDate="2017-01-13T15:08:57.440" Score="3" ViewCount="1129" Body="&lt;p&gt;When I use default inferior shell I can set something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq python-shell-interpreter &quot;python&quot;&#xA;    python-shell-interpreter-args &quot;-i /absolute/path/to/manage.py shell_plus&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How set this with &lt;code&gt;python-mode.el&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="105" LastEditDate="2017-02-07T18:52:09.353" LastActivityDate="2017-05-09T03:33:42.723" Title="How set python shell arguments with python-mode.el?" Tags="|python|repl|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29999" PostTypeId="1" AcceptedAnswerId="30009" CreationDate="2017-01-13T15:11:06.333" Score="5" ViewCount="4383" Body="&lt;p&gt;I want to use Mac CMD+C for copy and CMD+V for paste in Spacemacs but I think it redefined CMD to Meta. How do I change this mapping behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found mac-key-mode but that package seems old and I don't know how to add it to Spacemacs.&lt;/p&gt;&#xA;" OwnerUserId="14544" LastEditorUserId="2287" LastEditDate="2017-01-13T15:56:44.437" LastActivityDate="2017-01-14T02:46:21.253" Title="How do I use Mac/OSX key bindings with Spacemacs?" Tags="|spacemacs|osx|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30003" PostTypeId="2" ParentId="29997" CreationDate="2017-01-13T19:13:26.413" Score="3" Body="&lt;p&gt;One crude non-robust way to get the last output in &lt;code&gt;term-mode&lt;/code&gt;is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun term-recommended-hook ()&#xA;  &quot;Hook function recommended as `term-mode-hook'. (See file \&quot;term.el\&quot;.)&quot;&#xA;  (setq term-prompt-regexp &quot;^[^#$%&amp;gt;\n]*[#$%&amp;gt;] *&quot;)&#xA;  (setq-local mouse-yank-at-point t)&#xA;  (setq-local transient-mark-mode nil)&#xA;  (auto-fill-mode -1)&#xA;  (setq tab-width 8 ))&#xA;&#xA;(add-hook #'term-mode-hook #'term-recommended-hook)&#xA;&#xA;(let ((p (get-buffer-process &quot;*ansi-term*&quot;)))&#xA;  (comint-simple-send p &quot;ls ~/Desktop&quot;)&#xA;  (with-current-buffer (get-buffer &quot;*ansi-term*&quot;)&#xA;    (buffer-substring-no-properties (save-excursion (term-previous-prompt 1) (forward-line) (point)) (line-beginning-position))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2017-01-13T19:13:26.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30004" PostTypeId="1" AcceptedAnswerId="30005" CreationDate="2017-01-13T20:52:04.277" Score="6" ViewCount="214" Body="&lt;p&gt;I've defined a function that is supposed to iterate over an alist, and use the CAR and CDR of each element in the list to populate the regexp in &lt;code&gt;re-search-forward&lt;/code&gt; and the replacement string in &lt;code&gt;replace-match&lt;/code&gt;, respectively. Here is what I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun search-and-replace ()&#xA;  (let ((alist '((&quot;regexp&quot; &quot;replacement-str&quot;)&#xA;                 ...)))&#xA;    (dolist (search-pair alist)&#xA;      (point-min)&#xA;      (while (re-search-forward (car search-pair) nil t)&#xA;        (replace-match (cdr search-pair))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns an error: &lt;code&gt;Wrong type argument: stringp, (&quot;replacement-str&quot;)&lt;/code&gt;. What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help. Here's what I ended up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun search-and-replace (alist)&#xA;  (save-excursion&#xA;    (goto-char (point-min))&#xA;    (dolist (search-pair alist)&#xA;      (while (re-search-forward (car search-pair) nil t)&#xA;        (replace-match (cdr search-pair)))&#xA;      (goto-char (point-min))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where each item in &lt;code&gt;ALIST&lt;/code&gt; is a cons cell of &lt;code&gt;(&quot;regexp&quot; . &quot;replacement-string&quot;)&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="14378" LastEditorUserId="14378" LastEditDate="2017-01-15T12:27:02.303" LastActivityDate="2017-01-15T12:27:02.303" Title="How do I properly populate a function by iterating over an alist?" Tags="|iteration|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30005" PostTypeId="2" ParentId="30004" CreationDate="2017-01-13T20:58:39.350" Score="5" Body="&lt;p&gt;You want &lt;code&gt;(cadr search-pair)&lt;/code&gt;, not &lt;code&gt;(cdr search-pair)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either that or use an alist whose entries are dotted pairs, with the cdrs being your replacement strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error message tells you that a string was expected and instead the list &lt;code&gt;(&quot;replacement-str&quot;)&lt;/code&gt; was passed.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-13T20:58:39.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30006" PostTypeId="1" CreationDate="2017-01-13T23:07:48.673" Score="2" ViewCount="448" Body="&lt;p&gt;I am using spacemacs. When enabling &lt;code&gt;highlight-indentation-mode&lt;/code&gt; in &lt;code&gt;python-mode&lt;/code&gt;, I found that the vertical lines are not continue, they will be interrupted if there is an empty line. How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RCR4l.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RCR4l.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14312" LastActivityDate="2017-01-13T23:07:48.673" Title="highlight-indentation-mode discontinue" Tags="|indentation|python|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30007" PostTypeId="2" ParentId="9564" CreationDate="2017-01-14T01:10:06.523" Score="1" Body="&lt;p&gt;The following two pieces of advice appear to result in the desired behavior:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice electric-pair-post-self-insert-function&#xA;    (around single-electricity activate)&#xA;  &quot;If current command is an electric brace command, do nothing.&quot;&#xA;  (if (not (eq this-command 'LaTeX-insert-left-brace))&#xA;      ad-do-it))&#xA;&#xA;(defadvice LaTeX-common-initialization&#xA;    (after electric-pair-anyway activate)&#xA;  &quot;Re-enable electric-pair-mode.&quot;&#xA;  (set (make-local-variable 'electric-pair-mode) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10149" LastActivityDate="2017-01-14T01:10:06.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30008" PostTypeId="1" AcceptedAnswerId="32993" CreationDate="2017-01-14T01:43:35.037" Score="2" ViewCount="6722" Body="&lt;p&gt;I know this has been asked many times, but the answers don't seem to do it for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you get Flyspell to work with hunspell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After installing the hunspell executables via mingw-64-hunspell using MSYS 2 and adding dictionaries, I can successfully check words with the from MSYS shell like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ echo baddword | hunspell -d en_US&#xA;Hunspell 1.4.0&#xA;&amp;amp; baddword 1 0: broadsword&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On emacs i set the following in my config (.spacemacs dotspacemacs/user-config)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq ispell-dictionary nil)&#xA;  (setq ispell-program-name &quot;c:/msys64/mingw64/bin/hunspell.exe&quot;)&#xA;  ;; &quot;en_US&quot; is key to lookup in `ispell-local-dictionary-alist`, please note it will be passed to hunspell CLI as &quot;-d&quot; parameter&#xA;  (setq ispell-local-dictionary &quot;en_US&quot;) &#xA;  (setq ispell-local-dictionary-alist&#xA;        '((&quot;en_US&quot; &quot;[[:alpha:]]&quot; &quot;[^[:alpha:]]&quot; &quot;[']&quot; nil (&quot;-d&quot; &quot;en_US&quot;) nil utf-8)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Saved the config and restarted the program. When I type nonsense words, nothing is highlighted. However, I can do spell-check via the &lt;code&gt;spell check buffer&lt;/code&gt; command. The bizarre thing however that this command only worked a couple of times and only on the &lt;code&gt;.spacemacs file&lt;/code&gt;. Whenever I open a new empty buffer, it complains that it &quot;can't open affix or dictionary files for dictionary ENU&quot;. I never specified an &quot;ENU&quot; dictionary anywhere, so that's not surprising. Also it starts a new &quot;ispell process&quot; every time I open a new file, which slows down performance by about 5 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: how do you get a working spell checker that behaves like the spell-checker in your browser?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bcheckers/spell-checking&quot; rel=&quot;nofollow noreferrer&quot;&gt;more on spell-checking in spacemacs, though I don't see any useful info there&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I used a slightly different config before that and it worked with warnings. After adding DICTPATH and the this code to init, everything works well.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setenv &quot;LANG&quot; &quot;en_US, ru_RU&quot;)&#xA;  (setq-default  ispell-program-name &quot;c:/msys64/mingw64/bin/hunspell.exe&quot;)&#xA;  (with-eval-after-load &quot;ispell&quot;&#xA;    (setq ispell-really-hunspell t)&#xA;    (setq ispell-program-name &quot;hunspell&quot;)&#xA;    (setq ispell-dictionary &quot;en_US,ru_RU&quot;)&#xA;    ;; ispell-set-spellchecker-params has to be called&#xA;    ;; before ispell-hunspell-add-multi-dic will work&#xA;    (ispell-set-spellchecker-params)&#xA;    (ispell-hunspell-add-multi-dic &quot;en_US,ru_RU&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14543" LastEditorUserId="14543" LastEditDate="2017-05-24T00:13:16.710" LastActivityDate="2017-05-25T10:32:36.983" Title="Hunspell flyspell and Emacs on windows" Tags="|spacemacs|microsoft-windows|flyspell|hunspell|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30009" PostTypeId="2" ParentId="29999" CreationDate="2017-01-14T02:46:21.253" Score="9" Body="&lt;p&gt;Spacemacs has a &quot;layer&quot; called &quot;osx&quot; that should do everything you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bos/osx&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bos/osx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just put &lt;code&gt;osx&lt;/code&gt; in the &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt; section and you should be all set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If instead you just want to have some particular os x keybindings, you might find the ones below helpful:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (let ((is-mac (string-equal system-type &quot;darwin&quot;)))&#xA;(when is-mac&#xA;  ;; make fonts look better with anti-aliasing&#xA;  (setq mac-allow-anti-aliasing t)&#xA;  ;; delete files by moving them to the trash&#xA;  (setq delete-by-moving-to-trash t)&#xA;  (setq trash-directory &quot;~/.Trash&quot;)&#xA;&#xA;  ;; Don't make new frames when opening a new file with Emacs&#xA;  (setq ns-pop-up-frames nil)&#xA;&#xA;  ;; non-lion fullscreen&#xA;  (setq ns-use-native-fullscreen nil)&#xA;&#xA;  ;; Set modifier keys&#xA;  (setq mac-option-modifier 'meta) ;; Bind meta to ALT&#xA;  (setq mac-command-modifier 'super) ;; Bind apple/command to super if you want&#xA;  (setq mac-function-modifier 'hyper) ;; Bind function key to hyper if you want &#xA;  (setq mac-right-option-modifier 'none) ;; unbind right key for accented input&#xA;&#xA;  ;; Make forward delete work &#xA;  (global-set-key (kbd &quot;&amp;lt;H-backspace&amp;gt;&quot;) 'delete-forward-char)&#xA;&#xA;  ;; Keybindings&#xA;  (global-set-key (kbd &quot;s-=&quot;) 'scale-up-font)&#xA;  (global-set-key (kbd &quot;s--&quot;) 'scale-down-font)&#xA;  (global-set-key (kbd &quot;s-0&quot;) 'reset-font-size)&#xA;  (global-set-key (kbd &quot;s-q&quot;) 'save-buffers-kill-terminal)&#xA;  (global-set-key (kbd &quot;s-v&quot;) 'yank)&#xA;  (global-set-key (kbd &quot;s-c&quot;) 'evil-yank)&#xA;  (global-set-key (kbd &quot;s-a&quot;) 'mark-whole-buffer)&#xA;  (global-set-key (kbd &quot;s-x&quot;) 'kill-region)&#xA;  (global-set-key (kbd &quot;s-w&quot;) 'delete-window)&#xA;  (global-set-key (kbd &quot;s-W&quot;) 'delete-frame)&#xA;  (global-set-key (kbd &quot;s-n&quot;) 'make-frame)&#xA;  (global-set-key (kbd &quot;s-z&quot;) 'undo-tree-undo)&#xA;  (global-set-key (kbd &quot;s-s&quot;)&#xA;                  (lambda ()&#xA;                    (interactive)&#xA;                    (call-interactively (key-binding &quot;\C-x\C-s&quot;))))&#xA;  (global-set-key (kbd &quot;s-Z&quot;) 'undo-tree-redo)&#xA;  (global-set-key (kbd &quot;C-s-f&quot;) 'toggle-frame-fullscreen)&#xA;  ;; Emacs sometimes registers C-s-f as this weird keycode&#xA;  (global-set-key (kbd &quot;&amp;lt;C-s-268632070&amp;gt;&quot;) 'toggle-frame-fullscreen)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;))&lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2017-01-14T02:46:21.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30012" PostTypeId="1" AcceptedAnswerId="30037" CreationDate="2017-01-14T18:22:48.457" Score="5" ViewCount="771" Body="&lt;p&gt;When I'm using &lt;code&gt;emacs-shell&lt;/code&gt;, I often try to run files for which a backup (with &lt;code&gt;~&lt;/code&gt; ending) exists. &#xA;&lt;br&gt;&#xA;I use Helm, and if I try to auto-complete the name of a file called, say, &lt;code&gt;seed-rand.rb&lt;/code&gt;, with an existing backup, I get a result like the image below:&#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/QkaHW.png&quot; alt=&quot;annoying-completion-at-point&quot;&gt;&#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;&lt;code&gt;completion-at-point&lt;/code&gt; really isn't helping me here—is there any way of telling it to ignore files ending with &lt;code&gt;~&lt;/code&gt;? (That's what it does when &lt;code&gt;helm-mode&lt;/code&gt; is turned off.) &#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;And if that's not possible, is there any way of just turning this helm feature off without toggling &lt;code&gt;helm-mode&lt;/code&gt; every time I want to do so?&lt;/p&gt;&#xA;" OwnerUserId="14499" LastEditorUserId="105" LastEditDate="2022-04-04T15:41:39.640" LastActivityDate="2022-04-04T15:41:39.640" Title="How can I tell Helm's `completion-at-point` to ignore certain file endings?" Tags="|helm|completion|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30013" PostTypeId="1" AcceptedAnswerId="30023" CreationDate="2017-01-14T20:04:27.303" Score="0" ViewCount="261" Body="&lt;p&gt;Here follows Common Lisp code, using a datastore library named bknr.datastore&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ql:quickload :bknr.datastore)&#xA;&#xA;(defclass userdata (bknr.datastore:store-object)&#xA;  ((email :initarg :email&#xA;      :index-type bknr.indices:unique-index&#xA;      :index-values all-users)&#xA;   (name :initarg :name))&#xA;  (:metaclass bknr.datastore:persistent-class))&#xA;&#xA;(let ((object-subsystem (make-instance 'bknr.datastore:store-object-subsystem)))&#xA;  (make-instance 'bknr.datastore:store&#xA;         :directory *default-pathname-defaults*&#xA;                 :subsystems (list object-subsystem)))&#xA;&#xA;(make-instance 'userdata :email &quot;m@b.com&quot; :name &quot;Maria&quot;)&#xA;(make-instance 'userdata :email &quot;k@g.com&quot; :name &quot;Katerina&quot;)&#xA;&#xA;(setf (slot-value (first (all-users)) 'name) &quot;Elena&quot;)&#xA;; Attempt to modify persistent slot NAME of #&amp;lt;USERDATA ID: 0&amp;gt; outside of a transaction&#xA;;   [Condition of type BKNR.DATASTORE::PERSISTENT-SLOT-MODIFIED-OUTSIDE-OF-TRANSACTION]&#xA;&#xA;(bknr.datastore:with-transaction ()&#xA;  (setf (slot-value (first (all-users)) 'name) &quot;Elena&quot;))&#xA;; runs successfully, the above wrap in with-transaction () is necessary&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use the Slime inspector to view the datastore, so in the minibuffer after C-c C-I Inspect value (evaluated):&#xA;I input&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(all-users)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can see the data but not edit it in the slime inspector, because the same condition is thrown as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can the slime inspector be customized in a way that it wraps calls to setf inside transactions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: if you run the above code, a directory named &quot;current&quot; will be created in your lisp's working directory. It saves the datastore on disk.&lt;/p&gt;&#xA;" OwnerUserId="14553" LastActivityDate="2017-01-15T14:58:04.237" Title="Slime inspector customization (Common Lisp development)" Tags="|slime|common-lisp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30014" PostTypeId="2" ParentId="29976" CreationDate="2017-01-14T21:17:53.860" Score="1" Body="&lt;p&gt;See section 7.1 (&quot;&lt;strong&gt;Refile Setup&lt;/strong&gt;&quot;) of the source cited by the original poster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One option would be to enable &lt;code&gt;ido-mode&lt;/code&gt; and set the variable &lt;code&gt;org-completion-use-ido&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to use the tab key to open up the completions buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to use the up/down arrow keys to navigate potential completions in the mini-buffer.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-01-14T21:17:53.860" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30016" PostTypeId="1" CreationDate="2017-01-15T04:21:08.517" Score="1" ViewCount="97" Body="&lt;p&gt;I use &lt;code&gt;flyspell-prog-mode&lt;/code&gt;, and quite often I comment a region, the source code was checked, and the font lock of dirty words will left after I uncomment the source code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/42U3i.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/42U3i.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/t0P2X.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/t0P2X.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/fIJnA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fIJnA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;How can I fixes this? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2017-01-24T05:38:51.177" Title="Remove the left font lock of flyspell after uncomment" Tags="|font-lock|flyspell|ispell|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30017" PostTypeId="1" CreationDate="2017-01-15T09:04:55.543" Score="3" ViewCount="284" Body="&lt;p&gt;I would like to use curly braces inside a body of the &lt;a href=&quot;http://orgmode.org/manual/Structure-of-code-blocks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-mode inline source block&lt;/a&gt;. Since the body itself is delimited with curly braces it seems impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem occurs when additional pairs of curly braces are used inside the body. For instance the following LaTeX code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_latex[:results raw]{$x=\frac{1}{2}$}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when executed (with C-c C-c) gets broken into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;src_latex[:results raw]{$x=\frac{1} $x=\frac{1{2}$}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course this can be easily overcome with the classic (multiline) form of the source block, but the inline counterpart would be more convenient for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any other way to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Gnu Emacs 25.1.1 with Org-mode 8.3.4.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out (after short discussion on #org-mode IRC) that this issue does not apply to the Org Mode version 9.0.3 (at the time of writing this, 9.0.3 is the latest version available on Melpa). In fact, &lt;strong&gt;after upgrading my Org Mode the problem disappears!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beware of &lt;a href=&quot;https://emacs.stackexchange.com/questions/28441/org-mode-9-unable-to-eval-code-blocks&quot;&gt;this issue&lt;/a&gt; when updating to 9.X version!&lt;/p&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-01-18T14:28:12.250" Title="Curly braces inside a body of the org-mode inline source block" Tags="|org-mode|org-babel|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30018" PostTypeId="2" ParentId="28789" CreationDate="2017-01-15T10:48:29.053" Score="1" Body="&lt;p&gt;By adding the following lines to init&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; Load a new tabbar arrow image&#xA;  (setq tabbar-scroll-left-button-enabled-image-one '((:type png :file &quot;~/tabbar-scroll-left.png&quot; :ascent center)))&#xA;  (setq tabbar-scroll-left-button&#xA;        (cons (cons &quot; &amp;lt;&quot; tabbar-scroll-left-button-enabled-image-one)&#xA;              (cons &quot; =&quot; nil)))&#xA;  (setq tabbar-scroll-right-button-enabled-image-one '((:type png :file &quot;~/tabbar-scroll-right.png&quot; :ascent center)))&#xA;  (setq tabbar-scroll-right-button&#xA;        (cons (cons &quot; &amp;gt;&quot; tabbar-scroll-right-button-enabled-image-one)&#xA;              (cons &quot; =&quot; nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was able to replace the image.&lt;/p&gt;&#xA;" OwnerUserId="12577" LastActivityDate="2017-01-15T10:48:29.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30019" PostTypeId="1" AcceptedAnswerId="30053" CreationDate="2017-01-15T11:45:09.430" Score="1" ViewCount="62" Body="&lt;p&gt;I replaced the image for tabbar scroll. Original:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hM3bm.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hM3bm.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replaced them with the following lines in the init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  ;; Load a new tabbar arrow image&#xA;  (setq tabbar-scroll-left-button-enabled-image-one '((:type png :file &quot;~/tabbar-scroll-left.png&quot; :ascent center)))&#xA;  (setq tabbar-scroll-left-button&#xA;        (cons (cons &quot; &amp;lt;&quot; tabbar-scroll-left-button-enabled-image-one)&#xA;              (cons &quot; =&quot; nil)))&#xA;  (setq tabbar-scroll-right-button-enabled-image-one '((:type png :file &quot;~/tabbar-scroll-right.png&quot; :ascent center)))&#xA;  (setq tabbar-scroll-right-button&#xA;        (cons (cons &quot; &amp;gt;&quot; tabbar-scroll-right-button-enabled-image-one)&#xA;              (cons &quot; =&quot; nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I replaced them with a colored picture, but they are only colored when there are multiple tabs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With only one tab (both scroll pictures are greyed out):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BMxVq.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BMxVq.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With two tabs (Right scroll icon is showing as colored, which is desired when they are always colored):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PeiU2.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PeiU2.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The desired scenario is to have the two scroll image always colored. I investigated tabbar.el but did not have a clue where it defines behavior of graying out a colored picture. Can anybody help?&lt;/p&gt;&#xA;" OwnerUserId="12577" LastActivityDate="2017-03-18T07:11:01.970" Title="tabbar scroll picture button grayed out when only one tab is active" Tags="|tabbar|buttons|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30020" PostTypeId="1" CreationDate="2017-01-15T11:58:13.850" Score="1" ViewCount="84" Body="&lt;p&gt;&lt;strong&gt;Environment&lt;/strong&gt; Cygwin, emacs-w32 variant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use case&lt;/strong&gt; Setting up my editor for git commits from the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&#xA;When I do a git commit from a terminal, I have it setup to do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get a new frame as expected, and Emacs brings it to the front and focuses it correctly. However, it also brings to the front (but without focusing), my main Emacs window. So now I have two Emacs frames on top, indeed I can see the buffer I am editing in both of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By main Emacs window, I mean the one that I usually start when I login. This is annoying, because I often minimize that window while I work on other things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect it may be caused because I call &lt;code&gt;server-start&lt;/code&gt; in my .emacs file, but I don't know a way to work around it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Aim&lt;/strong&gt;&#xA;I really just want to popup the new frame, leaving the old frame completely alone, then I will close the new frame after typing in my git commit message. It's sort of a &quot;throw-away, quick edit&quot;, completely focused on the job in hand.&lt;/p&gt;&#xA;" OwnerUserId="10231" LastActivityDate="2018-06-03T19:12:13.760" Title="Preventing emacsclient -c from bringing both Emacs frames to the front" Tags="|emacsclient|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30021" PostTypeId="2" ParentId="12704" CreationDate="2017-01-15T13:37:44.877" Score="2" Body="&lt;p&gt;Another method based on the fact that an &lt;code&gt;interactive-form&lt;/code&gt; property in the function's plist overrides the form specified in code: (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;ref&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(put 'org-insert-subheading&#xA;     'interactive-form&#xA;     '(interactive (progn (if current-prefix-arg&#xA;                              '(nil)&#xA;                            '((4))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;(interactive-form 'function)&lt;/code&gt; to get the current spec, it's possible to handle more complex specs too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the best solution (if possible) is to wrap the function with &lt;code&gt;(let ((prefix-arg (not current-prefix-arg)))&lt;/code&gt; though&lt;/p&gt;&#xA;" OwnerUserId="9434" LastActivityDate="2017-01-15T13:37:44.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30022" PostTypeId="1" AcceptedAnswerId="30028" CreationDate="2017-01-15T14:31:04.120" Score="0" ViewCount="1091" Body="&lt;p&gt;I'm using spacemacs in evil mode and I'd like to remap my escape key to the right arrow key (It's easily accessible for me due to a global remapping which is useful in another application). I had most success so far with either of these commands:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;right&amp;gt;&quot;) (kbd &quot;&amp;lt;escape&amp;gt;&quot;))&#xA;(global-set-key (kbd &quot;&amp;lt;right&amp;gt;&quot;) 'evil-escape)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, there is one thing I didn't manage to get right yet. When I press, for example 'd', it expects another key (like another 'd' to delete the whole line), but pressing  won't abort that key sequence. How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="14560" LastEditorUserId="14560" LastEditDate="2017-01-26T18:55:51.443" LastActivityDate="2017-01-26T18:55:51.443" Title="How to quit key sequence using evil / spacemacs?" Tags="|key-bindings|spacemacs|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30023" PostTypeId="2" ParentId="30013" CreationDate="2017-01-15T14:58:04.237" Score="1" Body="&lt;p&gt;Not sure if that's applicable here, but there is a chance to do that on the CLOS level, if the CLOS implementation supports the meta-object protocol (MOP).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Clozure CL - a Common Lisp implementation - here. This maybe a little bit different depending on the implementation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;; we need to define a new meta-class, which is a subclass from&#xA;; standard-class, the class of standard classes.&#xA;(defclass my-standard-class (standard-class) ())&#xA;&#xA;; we need to tell CLOS that this is a valid superclass&#xA;(defmethod validate-superclass ((class my-standard-class)&#xA;                                (superclass standard-class))&#xA;  t)&#xA;&#xA;; note that in your example the USERDATA class already&#xA;; has a different metaclass, so above would not be necessary&#xA;; and one probably could use that metaclass in the example below.&#xA;&#xA;; now we define our class with one slot and the specific metaclass.&#xA;; The class foobar, will be an instance of class my-standard-class&#xA;&#xA;(defclass foobar () ((a :initform 21))&#xA;  (:metaclass my-standard-class))&#xA;&#xA;; the CLOS MOP provides a generic function named (setf slot-value-using-class).&#xA;; this method will be called by setting the slot-value.&#xA;; But one can not extend it&#xA;;  with new methods. But (setf slot-value-using-class) is&#xA;;  a generic function and we can extend it.&#xA;&#xA;(defmethod (setf slot-value-using-class) :around &#xA;  (value&#xA;   (class my-standard-class)&#xA;   object&#xA;   slot)&#xA;  (with-something ()&#xA;    (call-next-method)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Above function will be called with four arguments:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the new value&lt;/li&gt;&#xA;&lt;li&gt;the class&lt;/li&gt;&#xA;&lt;li&gt;the instance&lt;/li&gt;&#xA;&lt;li&gt;the slot&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus a call  to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (setf (slot-value (make-instance 'foobar) 'a) 42)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would run above &lt;code&gt;:around&lt;/code&gt; method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method is an &lt;code&gt;:around&lt;/code&gt; method and we can wrap our &lt;code&gt;WITH-SOMETHING&lt;/code&gt; macro around the call of the next method. Replace the &lt;code&gt;WITH-SOMETHING&lt;/code&gt; for example with a macro call which ensures a transaction. This then would mean that all uses of setting the SLOT-VALUE for classes of this metaclass will run in a transaction. You can also further specify the class or type of the value, to ensure that the transaction is only used for certain types of values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(setf (slot-value (make-instance 'foobar) 'a) 42)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would mean that anything which tries to set such a slot for instances of our metaclass using the &lt;code&gt;(SETF SLOT-VALUE)&lt;/code&gt; form will use a transaction - even something like an external inspector, which would update the slot of such an instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;(setf slot-value-using-clss)&lt;/code&gt; is really a function name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;? #'(setf slot-value-using-class)&#xA;#&amp;lt;STANDARD-GENERIC-FUNCTION (SETF SLOT-VALUE-USING-CLASS) #x30200002C50F&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9120" LastActivityDate="2017-01-15T14:58:04.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30024" PostTypeId="1" CreationDate="2017-01-15T17:36:35.587" Score="1" ViewCount="322" Body="&lt;p&gt;On the 2016 MacBook Pro, monospaced fonts are not lining up. It happens to just some buffers and can only be fixed by changing the default font size then changing it back. My font setting is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(default ((t (:family &quot;Ubuntu Mono&quot; :foundry &quot;nil&quot; :slant normal :weight normal :height 181 :width normal)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the exact same Emacs configuration on two other Macs and never experience this problem.&lt;/p&gt;&#xA;" OwnerUserId="11330" LastEditorUserId="2096" LastEditDate="2017-04-15T17:46:56.903" LastActivityDate="2017-04-15T17:46:56.903" Title="Monospaced font not lining up" Tags="|fonts|gui-emacs|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30025" PostTypeId="1" AcceptedAnswerId="30083" CreationDate="2017-01-15T20:14:21.720" Score="10" ViewCount="5501" Body="&lt;p&gt;Since emacsclient can handle long package loading time proerly, I really want to keep &lt;strong&gt;at least one emacs process, and most of the time only one emacs process&lt;/strong&gt;, open as a background process and better hide GUI. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I defined the following function in .bashrc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emc () &#xA;{ &#xA;    if [[ $# -eq 0 ]]; then&#xA;        emacs --eval &quot;(suspend-frame)&quot; &amp;amp;&#xA;        return&#xA;    fi&#xA;    args=($*);&#xA;    setsid emacsclient -c -e &quot;(find-file \&quot;${args[*]}\&quot;)&quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And also have the following line in .bashrc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So everytime I open up a shell, I will end up having a new emacs process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is I will have many additional unnecessary emacs process after opening up many shells. However, I only want to &lt;strong&gt;maintain one single emacs process all the time from startup better hide GUI&lt;/strong&gt;. &lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="13594" LastEditDate="2017-01-19T14:59:08.340" LastActivityDate="2018-12-28T10:52:50.057" Title="Emacsclient: One single emacs process all the time from start up &amp; never close &amp; better hide GUI" Tags="|emacsclient|gui|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30028" PostTypeId="2" ParentId="30022" CreationDate="2017-01-16T01:56:48.497" Score="0" Body="&lt;p&gt;Set &lt;code&gt;(define-key evil-motion-state-map (kbd &quot;&amp;lt;right&amp;gt;&quot;) 'evil-normal-state)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation for evil-scape is here: &lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION.html#escaping&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://spacemacs.org/doc/DOCUMENTATION.html#escaping&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11934" LastEditorUserId="11934" LastEditDate="2017-01-26T18:54:00.250" LastActivityDate="2017-01-26T18:54:00.250" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="30030" PostTypeId="2" ParentId="29998" CreationDate="2017-01-16T08:09:19.430" Score="0" Body="&lt;p&gt;Customize default Python shell as `py-shell-name'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;py-shell-name' might be an installed default executable as shell&#xA;  command&lt;/code&gt;type' would display, but also a PATH/TO/EXECUTABLE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If different flavours of Python are installed, customize&#xA;  py-python-command versions&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  py-python-command (default)&#xA;  py-python2-command&#xA;  py-python3-command&#xA;  py-ipython-command&#xA;&#xA;  py-python-command-args&#xA;  py-python2-command-args&#xA;  py-python3-command-args&#xA;  py-ipython-command-args&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3940" LastActivityDate="2017-01-16T08:09:19.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30031" PostTypeId="1" AcceptedAnswerId="30108" CreationDate="2017-01-16T09:15:35.470" Score="10" ViewCount="968" Body="&lt;p&gt;How to make an overlay in Emacs like the following (maybe it's not overlay, I don't know, it's from &lt;a href=&quot;https://github.com/cpitclaudel/company-coq&quot;&gt;company-coq&lt;/a&gt; inline-docs):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pmJjs.gif&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pmJjs.gif&quot; alt=&quot;overlay like this screencast&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2017-01-16T09:21:49.057" LastActivityDate="2022-01-26T16:43:24.257" Title="How to display overlay like this screencast?" Tags="|overlays|documentation|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30032" PostTypeId="2" ParentId="14706" CreationDate="2017-01-16T09:54:31.710" Score="3" Body="&lt;p&gt;You can use following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-suppressed-message (&amp;amp;rest body)&#xA;  &quot;Suppress new messages temporarily in the echo area and the `*Messages*' buffer while BODY is evaluated.&quot;&#xA;  (declare (indent 0))&#xA;  (let ((message-log-max nil))&#xA;    `(with-temp-message (or (current-message) &quot;&quot;) ,@body)))&#xA;&#xA;(with-suppressed-message (save-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of &lt;code&gt;(save-buffer)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6860" LastActivityDate="2017-01-16T09:54:31.710" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30033" PostTypeId="1" AcceptedAnswerId="30034" CreationDate="2017-01-16T10:29:18.887" Score="0" ViewCount="189" Body="&lt;p&gt;I'm having a problem with putting vdiff-refine-all-hunks or ediff-update-diffs into --eval for startup. Take vdiff as example, I'm calling it using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &quot;(progn (vdiff-files file1 file2) (vdiff-refine-all-hunks))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the function&lt;code&gt;vdiff-refine-all-hunks&lt;/code&gt; here acts just like &lt;code&gt;ediff-update-diffs&lt;/code&gt; in ediff, which actually highlights the difference. Without running these two function the diffs are almost plain text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://emacs.stackexchange.com/questions/28271/diff-mode-refine-all-hunks-when-opening-a-diff-file&quot;&gt;diff-mode: refine all hunks when opening a diff file?&lt;/a&gt;, I added function &lt;code&gt;sit-for&lt;/code&gt; before &lt;code&gt;vdiff-refine-all-hunks&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &quot;(progn (vdiff-files file1 file2) (sit-for 3) (vdiff-refine-all-hunks))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which works. However the loading time of vdiff really differs for different size of file. Setting 3 seconds works for a relatively large files but is too wasteful for two small one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not understand why it takes so much time for ediff/vdiff to warm up, and is there an existing nice way to avoid the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using vdiff-auto-refine, it works if put &lt;code&gt;(setq vdiff-auto-refine t)&lt;/code&gt; into init.el, or just implement it in eval:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --eval &quot;(progn (setq vdiff-auto-refine t) (vdiff-files file1 file2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, known issue is that it is still not working for emacsclient no matter I setq in init or include it in eval:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c --eval &quot;(progn (setq vdiff-auto-refine t) (vdiff-files file1 file2))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-01-24T16:05:00.713" Title="vdiff-refine-all-hunks/ediff-update-diffs in startup eval" Tags="|ediff|diff|eval|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30034" PostTypeId="2" ParentId="30033" CreationDate="2017-01-16T11:51:46.020" Score="2" Body="&lt;p&gt;vdiff processes the output of diff asynchronously which takes a nonzero amount of time. Instead of guessing when to run &lt;code&gt;vdiff-refine-all-hunks&lt;/code&gt; just set &lt;code&gt;vdiff-auto-refine&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; to let vdiff run it at the right time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're having a performance issue, first check how long diff takes on the command line, then see if refining all hunks is slow, and finally report it to me on github if something seems off. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all of the above ediff does comparable operations in the background explaining the similarities. &lt;/p&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-01-16T11:51:46.020" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30036" PostTypeId="2" ParentId="14035" CreationDate="2017-01-16T15:19:33.023" Score="0" Body="&lt;p&gt;In &lt;a href=&quot;https://github.com/owainlewis/emacs-color-themes/blob/4648b68e96bfde26d6e4af9f919971eef2768e5f/themes/spolsky-theme.el#L97&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;spolsky-theme.el&lt;/code&gt;&lt;/a&gt;, you can edit the line &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(vertical-border ((t (:foreground, *background*))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to use another color than that of &lt;a href=&quot;https://github.com/owainlewis/emacs-color-themes/blob/4648b68e96bfde26d6e4af9f919971eef2768e5f/themes/spolsky-theme.el#L29&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;background&lt;/code&gt;&lt;/a&gt; (which is &lt;code&gt;#161A1F&lt;/code&gt;; also used for window background). Note that the fringe background also use the same color, so only changing the &lt;code&gt;vertical-border&lt;/code&gt; to a constrasting color (e.g. silver, &lt;code&gt;#C0C0C0&lt;/code&gt;) gives quite a clean minimal dividing line, as the fringe can not be differentiated from the background.&lt;/p&gt;&#xA;" OwnerUserId="14574" LastActivityDate="2017-01-16T15:19:33.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30037" PostTypeId="2" ParentId="30012" CreationDate="2017-01-16T18:00:10.443" Score="2" Body="&lt;p&gt;@xuchunyang solved this (see the comments section):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;When the global minor mode &lt;code&gt;helm-mode&lt;/code&gt; is off (it is by default), the behavior of &lt;code&gt;completion-at-point&lt;/code&gt; will not be changed by helm at all. If you want to turn on &lt;code&gt;helm-mode&lt;/code&gt; and don't want it to change &lt;code&gt;completion-at-point&lt;/code&gt;, customize user option &lt;code&gt;helm-completing-read-handlers-alist&lt;/code&gt;.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had success when performing this solution via &lt;code&gt;M-x customize&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14499" LastActivityDate="2017-01-16T18:00:10.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30038" PostTypeId="2" ParentId="30031" CreationDate="2017-01-16T18:18:27.397" Score="8" Body="&lt;p&gt;Indeed it does accomplish that behavior using overlays.  Specifically- it uses the &lt;code&gt;'after-string&lt;/code&gt; property to show the documentation (see: &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlay-Properties.html&quot;&gt;Overlay Properties&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you examine the function &lt;code&gt;company-coq--show-definition-overlay-at-point&lt;/code&gt; (ex: via &lt;code&gt;M-x find-function&lt;/code&gt;) you can see exactly how it's created:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq company-coq-definition-overlay (make-overlay ins-pos ins-pos))&#xA;(overlay-put company-coq-definition-overlay 'after-string ins-str)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A reference to the overlay is kept in &lt;code&gt;company-coq-definition-overlay&lt;/code&gt; to make it easy to remove the overlay later:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(delete-overlay company-coq-definition-overlay)&#xA;(setq company-coq-definition-overlay nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-01-16T18:18:27.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30039" PostTypeId="1" CreationDate="2017-01-16T20:47:18.077" Score="2" ViewCount="201" Body="&lt;p&gt;The &lt;code&gt;fill-paragraph&lt;/code&gt; function isn't aware of the &lt;a href=&quot;http://orgmode.org/manual/Structure-of-code-blocks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;inline Org Mode source block&lt;/a&gt; syntax and is able to destroy it. For instance the following paragraph&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur src_emacs-lisp[:var x='adipiscing]{x} elit.&#xA;Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi.  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(after invoking the &lt;code&gt;fill-paragraph&lt;/code&gt;) is rearranged into&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur src_emacs-lisp[:var&#xA;x='adipiscing]{x} elit. Proin nibh augue, suscipit a, scelerisque&#xA;sed, lacinia in, mi.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the source block functionality is broken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I prevent fill-paragraph from breaking Org Mode inline source block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had this issue in Org Mode version 8.3.4. The problem does not apply to the Org Mode version 9.0.3 (at the time of writing this, 9.0.3 is the latest version available on Melpa).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beware of &lt;a href=&quot;https://emacs.stackexchange.com/questions/28441/org-mode-9-unable-to-eval-code-blocks&quot;&gt;this issue&lt;/a&gt; when updating to 9.X version!&lt;/p&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-19T13:05:02.547" Title="Prevent fill-paragraph from breaking Org Mode inline source block" Tags="|org-mode|fill-paragraph|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30040" PostTypeId="1" AcceptedAnswerId="31788" CreationDate="2017-01-16T21:26:16.063" Score="2" ViewCount="90" Body="&lt;p&gt;I like reading my documentation using emacs. The nature of documentation is that you often want to read documentation immediately after installing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whilst running emacs I installed the documentation for gnuplot (&lt;code&gt;sudo apt-get install gnuplot-doc&lt;/code&gt;), and the command &lt;code&gt;info gnuplot&lt;/code&gt; shows me documentation. However, &lt;code&gt;helm-info&lt;/code&gt; doesn't list gnuplot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now obviously I could restart emacs... but I don't like restarting emacs for obvious reasons. I've tried running  &lt;code&gt;(setq helm-info--pages-cache nil)&lt;/code&gt; and killing then &lt;code&gt;*helm Info*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="14161" LastActivityDate="2017-03-31T17:02:13.200" Title="helm-info list of info pages cannot find newly installed packages?" Tags="|helm|info|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30042" PostTypeId="1" CreationDate="2017-01-16T22:17:36.260" Score="3" ViewCount="246" Body="&lt;p&gt;What techniques exist to render rotated text in emacs?  By this I mean physical rotation of text by an arbitrary angle and shown inline in a buffer as shown here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qQisa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qQisa.png&quot; alt=&quot;two examples of rotated text&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(alignment of text in my sample is not significant)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inserting an SVG image containing the rotated text comes to mind, but that is subject to emacs being built with SVG and naturally it wouldn't enable text selection.  Maybe it could still accommodate search if shown as an overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm open to any suggestions.  Even limited solutions are highly relevant.  For example: if emacs could rotate individual glyphs/characters, but only rotated by 90 degrees or mirrored that would still be plenty useful!&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2017-07-11T07:48:53.563" LastActivityDate="2017-07-11T07:48:53.563" Title="Techniques for rendering rotated text in emacs?" Tags="|rendering|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30044" PostTypeId="1" AcceptedAnswerId="56163" CreationDate="2017-01-17T00:04:09.097" Score="22" ViewCount="3128" Body="&lt;p&gt;I wish to alter a package, test it and hopefully submit a pull request afterwards. How do I do it in a safe and efficient way? The question might feel too broad, I will accept the answer that covers the following issues:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I'd expect to install a separate branch of a package and be able to switch between it and stable branch on a whim, with recompilation performed automatically when it's necessary, but &lt;code&gt;package.el&lt;/code&gt; doesn't seem to offer a straightforward way to do that. &lt;a href=&quot;https://emacs.stackexchange.com/a/523/8710&quot;&gt;This answer&lt;/a&gt; on emacs-SE informs us that “If multiple copies of a package are installed, then the first one will be loaded” so I guess one could manually mess with &lt;code&gt;load-path&lt;/code&gt; but this doesn't feel robust. What is the standard way to select a specific version of package among those installed?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Even if I manage to expose several branches to Emacs, for significant tweaks I need to make sure the unpatched branch is “unloaded” and its side-effects isolated. Does &lt;code&gt;unload-feature&lt;/code&gt; handle this properly or maybe it has idiosyncrasies that every tester of multi-versioned packages should know about?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do I install and test the local version? The answer appears to be dependent on whether the package is simple (= one file) or multifile. EmacsWiki says about multifile packages: “&lt;a href=&quot;https://www.emacswiki.org/emacs/MakingPackages&quot;&gt;MELPA builds packages for you&lt;/a&gt;”. I doubt that I have to (or should) talk to MELPA every time I change a &lt;code&gt;defun&lt;/code&gt; form in a multifile package but the question remains. At least I need to tell package manager about local version, and if so, how do I do it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What names should I assign to local versions of packages? Suppose I want to work on multiple features or bugs simultaneously, which means having several branches. Emacs won't allow to name versions in a descriptive manner (along the lines of &lt;code&gt;20170117.666-somebugorfeature&lt;/code&gt;). I guess I could rename the package itself, a suffix per branch, but again, like manually messing with &lt;code&gt;load-path&lt;/code&gt; in Q1, this is an ugly hack, so I won't try it with something I intend to send upstream unless it's a widely accepted practice.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The questions probably are naive, since I never wrote a patch neither applied one with git or a similar vcs. However, for plenty of Emacs users, patching an Emacs package might be their first ever (or maybe the only one) social programming endeavour, which is why, I believe, answers to this question would still be valuable.&lt;/p&gt;&#xA;" OwnerUserId="8710" LastActivityDate="2020-03-15T06:15:04.503" Title="How do I patch an Emacs package?" Tags="|package-development|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30046" PostTypeId="2" ParentId="30044" CreationDate="2017-01-17T00:24:43.397" Score="2" Body="&lt;p&gt;These are all good questions!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs works on a memory-image model, where loading new code alters the memory image of the running instance. Defining new functions and variables is easily undone, if you keep a list of them, but there are a lot of side effects a module might have that you would want to undo. It looks like &lt;code&gt;unload-feature&lt;/code&gt; does make a pretty good go of it though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think what you're going to want to do is a combination of live coding and occasionally relaunching Emacs, loading the module you're working on from your branch rather than from where it's installed. If you do end up with a lot of these branches you might want a shell script that launches emacs with the correct &lt;code&gt;load-path&lt;/code&gt; for the one you're working on at the moment. In any case I wouldn't rename the package; I think that would be even more confusing since emacs could then load them both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you develop your patches you can start by simply redefining the functions that you are changing right in your live Emacs session. This lets you test the new definitions immediately, without leaving Emacs. Specifically, as you edit an elisp file you can use &lt;code&gt;C-M-x&lt;/code&gt; (&lt;code&gt;eval-defun&lt;/code&gt;) to evaluate the current function in your current Emacs session. You can then call it to make sure it works. If you're changing something that happens at Emacs startup then you'll likely have to start and stop Emacs to test it; you might do that by starting and stopping a separate Emacs process so that your editing session isn't interrupted.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-01-17T00:24:43.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30047" PostTypeId="1" CreationDate="2017-01-17T02:17:26.443" Score="6" ViewCount="884" Body="&lt;p&gt;I have created a comint mode for using mongo. The mode works fine in the buffer, and now I am trying to use it programmatically where I need to get the output from commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Getting input to the process works fine. Getting output from the process though has remained tricky. What I want is to send a cmd to the mongo process, and have the function that sent the command return the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have setup a filter function where I save the output into a variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mongo-output-filter (output)&#xA;  &quot;Hook function for handling process output.&quot; &#xA;  (setq mongo-output output))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I setup a function to take a command like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ts (cmd)&#xA;  (comint-simple-send (get-buffer-process &quot;*Mongo*&quot;) cmd)&#xA;  mongo-output)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The trouble is that sometimes it works, and sometimes it doesn't. What does work is I see the output in the &lt;em&gt;Mongo&lt;/em&gt; buffer, but it isn't always returned by the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried adding (accept-process-output (get-buffer-process &quot;&lt;em&gt;Mongo&lt;/em&gt;&quot;)), but that does not always give me the output. Sometimes it does, and sometimes I just get a prompt. It doesn't seem to matter if I use any optional arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the right way to go about this? None of the other questions on SO seem to answer this question.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="105" LastEditDate="2017-01-17T04:31:46.880" LastActivityDate="2017-01-17T04:31:46.880" Title="How do I reliably get output from a process?" Tags="|process|comint|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30048" PostTypeId="1" CreationDate="2017-01-17T05:52:18.277" Score="2" ViewCount="4212" Body="&lt;p&gt;I'm a current Neovim user who happens to be interested in Emacs. I like Org mode, as well as some other features of Emacs. However, every time I've tried to use evil mode, it's felt crippled. (The Emacs side has been fine, however.) The reason for this, I believe, isn't that Evil is an imperfect vim implementation, but that I would never in a million years want to use stock vim for editing. I use lots of plugins for vim (35 at the moment), and most of them don't have an equivalent in Emacs that &lt;em&gt;works fluidly inside of evil mode&lt;/em&gt;. I've tried spacemacs, and it's also not really satisfying. I believe, however, that there is a good solution to this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neovim, as a project, makes vim better-suited to be used as a component in an IDE. It can be run inside of other programs rather cleanly. Some examples of projects using this functionality are NyaoVim and ONI vim, as well as some projects which use Qt, Electron, etc. I would like to know if anyone has tried to run Neovim within Emacs, or if it's likely to gain some attention soon. It would be wonderful to have Neovim work inside of Emacs so that I could use Emacs as my development environment, then use standalone Neovim for other purposes, all with the same configuration and functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit: (not sure if this should be in main post or a comment)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now use spacemacs (emacs with a configuration that gives it better evil integration and makes it more useful out of the box), and have found that evil suits the vast majority of my needs, and I don't miss vim much if at all. One of the things I miss is the way that keybindings were handled. map, noremap, nmap, nnoremap, inoremap, etc. were all so easy to use and had their own syntax, true to the composable nature of vim's keybindings. However, the modes really are different in emacs. Transient states are great in spacemacs, so is the major/minor mode setup. I would still love to see the neovim team get their editor (&quot;the future of vim&quot;) to lower the barrier of entry to arbitrary programs having vim keybindings by simply allowing programs to connect to a neovim backend. That would be great in my opinion. Evil really isn't vim, but it allows you to use most of vim with emacs. However, for now, Spacemacs is great, and offers the strength and ease of configuration of emacs.&lt;/p&gt;&#xA;" OwnerUserId="14580" LastEditorUserId="14580" LastEditDate="2018-01-09T02:14:48.910" LastActivityDate="2018-01-09T02:14:48.910" Title="Neovim inside of Emacs as an alternative to Evil mode" Tags="|evil|text-editing|vim-emulation|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30049" PostTypeId="1" AcceptedAnswerId="30052" CreationDate="2017-01-17T06:02:44.233" Score="1" ViewCount="221" Body="&lt;p&gt;After last update, the &lt;code&gt;*magit-refs&lt;/code&gt; buffer no longer switches to the branch under point when pressing &lt;kbd&gt;RET&lt;/kbd&gt;, instead, it shows last commit from the branch I wanted to check out (completely useless behavior, at least for me). Is there any way to have &lt;kbd&gt;RET&lt;/kbd&gt; work as it used to?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured I could do &lt;kbd&gt;b&lt;/kbd&gt;&lt;kbd&gt;b&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;, to achieve the same effect, but I'm too used to &lt;kbd&gt;RET&lt;/kbd&gt; working as it used to, and when accidentally I press it, Emacs hangs because the diff may be quite large.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2017-01-17T07:19:58.727" LastActivityDate="2017-01-17T07:19:58.727" Title="Magit refs buffer no longer able to switch branches" Tags="|key-bindings|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30052" PostTypeId="2" ParentId="30049" CreationDate="2017-01-17T06:29:04.930" Score="5" Body="&lt;p&gt;As highlighted in the &lt;a href=&quot;https://emacsair.me/2016/12/07/magit-2.9/&quot; rel=&quot;noreferrer&quot;&gt;release notes for version 2.9&lt;/a&gt; (which explains at some length why this change was made):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Please note that you can trivially revert this change locally, by adding &lt;code&gt;(setq magit-visit-ref-behavior '(checkout-any focus-on-ref))&lt;/code&gt; to your init file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you're reverting to that behaviour, you may appreciate this safety-net for preventing accidental check-outs:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; I keep unintentionally checking out branches from the refs buffer.&#xA;(defadvice magit-visit-ref (around my-protect-accidental-checkout)&#xA;  &quot;Protect against expensive accidental checkout of a reference.&quot;&#xA;  (if (derived-mode-p 'magit-refs-mode)&#xA;      (if (y-or-n-p &quot;Checkout reference? &quot;)&#xA;          ad-do-it&#xA;        (message &quot;Aborted.&quot;))&#xA;    ad-do-it))&#xA;(ad-activate 'magit-visit-ref)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-01-17T06:35:26.333" LastActivityDate="2017-01-17T06:35:26.333" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30053" PostTypeId="2" ParentId="30019" CreationDate="2017-01-17T07:02:22.400" Score="0" Body="&lt;p&gt;The function &lt;code&gt;tabbar-line-buttons&lt;/code&gt; chooses between the &lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt; of the three variables for which there is an on/off depending upon different circumstances:  &lt;code&gt;tabbar-home-button-value&lt;/code&gt;; &lt;code&gt;tabbar-scroll-left-button-value&lt;/code&gt;; and &lt;code&gt;tabbar-scroll-right-button-value&lt;/code&gt;.  For the arrows, the starting tab is compared to the number of tabs.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;tabbar-line-button&lt;/code&gt; sets the above-mentioned three variables.  I put the three variables in comments near this function, because I would never think to search for &lt;code&gt;&quot;tabbar-%s-button-value&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-01-17T07:02:22.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30054" PostTypeId="1" CreationDate="2017-01-17T07:26:31.173" Score="2" ViewCount="610" Body="&lt;p&gt;My main font doesn't render the minor modes glyphs correctly, they are smaller, so I wanted to force the glyphs of the minor modes list to use the default source code pro font which renders them at the right height, without changing the font of the entire modeline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see here, minor modes are unaligned and smaller than they should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JKwsm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JKwsm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13338" LastEditorUserId="9995" LastEditDate="2017-01-17T16:54:53.390" LastActivityDate="2017-08-16T08:02:26.297" Title="how to change the font of only the minor-modes list in the mode line?" Tags="|spacemacs|fonts|faces|mode-line|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30055" PostTypeId="2" ParentId="30048" CreationDate="2017-01-17T08:56:32.263" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Imagine a disclaimer about future predictions usually being flat-out wrong&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I consider it rather unlikely to happen.  The reason one implements Vim in Emacs is to have first-class integration into it.  In Evil, you can customize a significant amount of tunables (the most important one being the list of modes per initial state as it makes or breaks your editing experience), extend it by writing your own hook functions and inspect its current state and code to write your own packages for it.  You would have none of that in a Neovim client for Emacs.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-01-17T08:56:32.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30056" PostTypeId="1" CreationDate="2017-01-17T10:11:03.150" Score="3" ViewCount="1942" Body="&lt;p&gt;I have setup org-mode and org-mode's agenda view almost exactly as I like it. &#xA;Almost, because there is something I still find annoying:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every scheduled item has a &quot;&lt;code&gt;Scheduled:&lt;/code&gt; &quot; in front of it. To me, that is unnecessary clutter and destroys the alignment of my items. So what I want to accomplish is, that items, for which a time is provided (not only date) don't have the &quot;&lt;code&gt;Scheduled:&lt;/code&gt; &quot; in front. Thus, they would perfectly align with those that don't have a time provided. Se the white square in my screenshot.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/DT6T0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DT6T0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is something like this possible? Alternatively I would like to remove the &quot;&lt;code&gt;Scheduled:&lt;/code&gt; &quot; for all items, but keep the &quot;Deadline: &quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that I am pretty new to emacs and org-mode and not proficient with lisp. So any help is welcome.&lt;/p&gt;&#xA;" OwnerUserId="14584" LastEditorUserId="17852" LastEditDate="2019-05-31T07:34:05.670" LastActivityDate="2019-05-31T07:34:05.670" Title="In Org-Mode Agenda view dont show &quot;Scheduled: &quot; if time is provided" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30057" PostTypeId="1" CreationDate="2017-01-17T12:58:24.370" Score="14" ViewCount="3761" Body="&lt;p&gt;Is it possible to automatically create backlinks to org-mode links? When a link to file B is added to file A, then also a link to file A is added to file B (i.e. the links are symmetrical - going both ways). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A concrete example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two files &lt;code&gt;a.org&lt;/code&gt; and &lt;code&gt;b.org&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside &lt;code&gt;a.org&lt;/code&gt; in heading &lt;strong&gt;Links&lt;/strong&gt; I insert an org-link (with a new function &lt;code&gt;org-link-with-backlink&lt;/code&gt;) to the file &lt;code&gt;b.org&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So file &lt;code&gt;a.org&lt;/code&gt; looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Links&#xA;  [[~/org/b.org][b]]&#xA;&#xA;* Heading 1&#xA;  lorem ipsum....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like this to happen automatically: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;the file &lt;code&gt;b.org&lt;/code&gt; is opened (if not open already) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;and inside &lt;em&gt;its&lt;/em&gt; &lt;strong&gt;Links&lt;/strong&gt; heading a link to &lt;code&gt;a.org&lt;/code&gt; is created. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If &lt;strong&gt;Links&lt;/strong&gt; doesn't exist yet, create it by prepending the file and add the link. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;b.org&lt;/code&gt; already has a link to &lt;code&gt;a.org&lt;/code&gt; in its &lt;strong&gt;Links&lt;/strong&gt; heading then do nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that &lt;code&gt;b.org&lt;/code&gt; looks like this after the operation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Links&#xA;  [[~/org/a.org][a]]&#xA;&#xA;* Heading X&#xA;  foo bar....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If now I inside file &lt;code&gt;c.org&lt;/code&gt; add also a link to &lt;code&gt;b.org&lt;/code&gt;, then &lt;code&gt;b.org&lt;/code&gt; now looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Links&#xA;  [[~/org/a.org][a]]&#xA;  [[~/org/c.org][c]]&#xA;&#xA;* Heading X&#xA;  foo bar....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think some sort of advice around &lt;code&gt;org-link&lt;/code&gt; should accomplish this, but unfortunately this is beyond my elisp skills... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS [optional]: I intend to use it in conjunction with &lt;a href=&quot;https://github.com/caiorss/org-wiki&quot; rel=&quot;noreferrer&quot;&gt;org-wiki&lt;/a&gt;, to the solution could use the wiki style links as an alternative.&lt;/p&gt;&#xA;" OwnerUserId="5237" LastEditorUserId="5237" LastEditDate="2017-01-19T03:20:13.203" LastActivityDate="2020-04-12T09:45:51.743" Title="How to get automatic backlinks when linking files in in org-mode?" Tags="|org-mode|org-link|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30058" PostTypeId="1" CreationDate="2017-01-17T14:50:24.173" Score="0" ViewCount="79" Body="&lt;p&gt;One of Github's features i like is that it &quot;flattens&quot; path if a folder contains only one subfolder, i.e you have a &lt;code&gt;src&lt;/code&gt; folder which has only &lt;code&gt;main&lt;/code&gt; folder, so by clicking on &lt;code&gt;src&lt;/code&gt; you go to the content of &lt;code&gt;main&lt;/code&gt;. I'm using &lt;a href=&quot;https://github.com/ralesi/ranger.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;ranger&lt;/a&gt; for navigation and want to achieve the same behaviour. I've decided to try advices for the first time, but can't get it working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defadvice ranger-find-file (before flatten-subfolder (entity ignore-history))&#xA;    (interactive &quot;DInitialDirectory: &quot;)&#xA;    (message &quot;Calling ADVICE&quot;)&#xA;    (let ((folder (or entity (dired-get-filename nil t))))&#xA;      (when (and folder (file-directory-p folder))&#xA;        (let* ((subfolder (f-directories folder))&#xA;               (nr-of-subfolders (length subfolder)))&#xA;          (if (eq nr-of-subfolders 1)&#xA;              (flatten-subfolder (car subfolder))&#xA;            entity)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My understanding was that when i call &lt;a href=&quot;https://github.com/ralesi/ranger.el/blob/master/ranger.el#L1240&quot; rel=&quot;nofollow noreferrer&quot;&gt;ranger-find-file&lt;/a&gt;, which has the following signature:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ranger-find-file (&amp;amp;optional entry ignore-history) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would first invoke my advice (&lt;code&gt;flatten-subfolder&lt;/code&gt;) which would flatten (go down the path) folders and invoke &lt;code&gt;ranger-find-file&lt;/code&gt; with the result of the advice above. Obviously it doesn't work, is there any way to do this?&lt;/p&gt;&#xA;" OwnerUserId="2361" LastEditorUserId="2361" LastEditDate="2017-01-17T15:01:05.457" LastActivityDate="2017-01-17T15:01:05.457" Title="Using advices to flatten a single subfolder" Tags="|advice|navigation|ranger|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30059" PostTypeId="2" ParentId="30044" CreationDate="2017-01-17T15:00:52.233" Score="2" Body="&lt;p&gt;I don't think there's a good answer to that yet (I expect you can get a partial solution with Cask, tho I'm not sufficient familiar with it to give you a good answer using it; hopefully someone else will), but here's what I do (I rarely use a Elisp package without making local changes to it, so it's really my &quot;normal&quot; way):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;cd ~/src; git clone ..../elpa.git&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;for each package &lt;code&gt;cd ~/src/elisp; git clone ....thepackage.git&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cd ~/src/elpa/packages; ln -s ~/src/elisp/* .&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cd ~/src/elpa; make&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;in your &lt;code&gt;~/.emacs&lt;/code&gt; add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load 'package&#xA; '(add-to-list 'package-directory-list&#xA;               &quot;~/src/elpa/packages&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This way, all packages are installed &quot;straight from the Git&quot;, a simple &lt;code&gt;cd ~/src/elpa; make&lt;/code&gt; will recompile those that need it, and &lt;code&gt;C-h o thepackage-function&lt;/code&gt; will jump to a source file that's under Git.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To &quot;switch between it and stable branch on a whim&quot;, you'll need to &lt;code&gt;git checkout &amp;lt;branch&amp;gt;; cd ~/src/elpa; make&lt;/code&gt;; and if you want it to affect running Emacs sessions it'll take more work.  I generally recommend not to use &lt;code&gt;unload-feature&lt;/code&gt; except in exceptional situations (it's a good feature, but it's not currently reliable enough).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also doesn't satisfy many of your requirements.  And it has some extra downsides, mostly the fact that many packages's Git clone doesn't quite match the layout and contents expected by elpa.git's makefile, so you'll need to begin by tweaking those packages (typically things that have to do with &lt;code&gt;&amp;lt;pkg&amp;gt;-pkg.el&lt;/code&gt;, since elpa.git's makefile expects to build this file from &lt;code&gt;&amp;lt;pkg&amp;gt;.el&lt;/code&gt; rather than have it be provided, but more problematically, the compilation is performed differently, so sometimes you need to play with the &lt;code&gt;require&lt;/code&gt;s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh and of course, this basically means you're installing those packages by hand, so you have to pay attention to dependencies.  This setup does properly interact with other packages installed by &lt;code&gt;package-install&lt;/code&gt;, tho, so it's not that terrible.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-01-17T15:00:52.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30060" PostTypeId="2" ParentId="30044" CreationDate="2017-01-17T16:18:33.370" Score="11" Body="&lt;p&gt;To chime in with a slightly different work flow for loading different versions of packages, here's a couple of variations of what I do, both of which use the &lt;code&gt;load-path&lt;/code&gt; to control which version I'm using (changing the name of the package is a bad idea if there are dependencies). I have the current version of &quot;nice-package&quot; installed in &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; using &lt;code&gt;M-x package-install&lt;/code&gt;, and the package repo clone in &lt;code&gt;~/src/nice-package&lt;/code&gt; with &lt;code&gt;git clone ...&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;With use-package&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In init.el, I have&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package nice-package&#xA;  :load-path &quot;~/src/nice-package&quot;&#xA;  ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the &lt;code&gt;:load-path&lt;/code&gt; line uncommented, this will use the git version of the package. Commenting this line out, and reloading emacs uses the elpa version. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Similar without use-package&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In init.el, &#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/src/nice-package&quot;)&#xA;(require 'nice-package)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now do the same commenting trick with the first line. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Using &lt;code&gt;emacs -L&lt;/code&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is the same idea, but manipulating the &lt;code&gt;load-path&lt;/code&gt; from the command line. You can load an instance of emacs with the git version of the package with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -L ~/src/nice-package&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which just prepends this path to the front of the load-path. That way, you can launch &lt;code&gt;emacs&lt;/code&gt; from a different terminal and get the old and the new versions of the package running side-by-side. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Misc comments&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;M-x eval-buffer&lt;/code&gt; after editing a package file to load the new definitions you've created.&lt;/li&gt;&#xA;&lt;li&gt;Checking what the compiler says with &lt;code&gt;M-x emacs-lisp-byte-compile&lt;/code&gt; is handy too&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="14114" LastEditorUserId="9977" LastEditDate="2018-06-03T10:59:31.093" LastActivityDate="2018-06-03T10:59:31.093" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30061" PostTypeId="1" CreationDate="2017-01-17T18:27:46.573" Score="2" ViewCount="113" Body="&lt;p&gt;I am having a fairly big &lt;code&gt;.emacs&lt;/code&gt; file with lots of stuff inside, parts of which I have copied from somewhere else. At some point in the file I am setting the font size to some value but this setting later on gets overwritten by some other function that I am unable to find unfortunately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a possibility to evaluate an &lt;code&gt;elisp&lt;/code&gt; file function by function (so I could see at which point the font-size changes) or is there some other method to debug such a case (e.g. specify a variable and have a debugger tell me which functions are changing it)? &lt;/p&gt;&#xA;" OwnerUserId="8472" LastEditorUserId="105" LastEditDate="2017-01-17T18:36:27.593" LastActivityDate="2017-01-17T18:45:08.750" Title="Debugging in elisp" Tags="|init-file|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30062" PostTypeId="2" ParentId="29931" CreationDate="2017-01-17T18:43:11.550" Score="1" Body="&lt;p&gt;Emacs only stores which packages you selected for installation, AFAIK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With 2 steps you can sort the package list to guess where you installed from:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;list-packages&lt;/code&gt; use &quot;&lt;code&gt;(&lt;/code&gt;&quot; package-menu-toggle-hiding, position you point in column 3 where the package names begin and hit &lt;code&gt;S&lt;/code&gt; for tabulated-list-sort to sort by package names. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The installed and available versions are now displayed right next to each other and should give a hint where the package was installed from.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastActivityDate="2017-01-17T18:43:11.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30063" PostTypeId="2" ParentId="30061" CreationDate="2017-01-17T18:45:08.750" Score="1" Body="&lt;p&gt;You want to find out which part of your init file (or some other Lisp file) is causing some change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably do &lt;em&gt;not&lt;/em&gt; want to just evaluate the file sequentially, one sexp (e.g. function definition) at a time, checking the resulting behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, consider &lt;strong&gt;bisecting the file recursively&lt;/strong&gt;.  That is, evaluate 1/2 of it (sequentially), to determine which half causes the problem.  Then do the same with 1/2 of that half, etc.  This way you narrow down the problem from 1/2 to 1/4, 1/8/, 1/16,..., which is a &lt;strong&gt;binary search&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is very quick, even though it might not seem that way in the beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To evaluate only part of a file, you can select that part and use &lt;code&gt;M-x eval-region&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for recursively bisecting a file that you load (e.g. your init file), the easiest way to proceed is to &lt;strong&gt;comment out the part that you do not want to evaluate&lt;/strong&gt;, then load the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use command &lt;strong&gt;&lt;code&gt;comment-region&lt;/code&gt;&lt;/strong&gt; to comment out the region.  You can use it with plain &lt;strong&gt;&lt;code&gt;C-u&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;un&lt;/strong&gt;comment the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your init file, you will typically need to restart Emacs after each such edit (commenting out part of the file).  Even so, this is quick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not only is this a quick way to find the culprit; it is also &lt;em&gt;sure&lt;/em&gt;.  When you instead think that you can guess this or that, you can easily miss something.  This blind and dumb approach doesn't have that weakness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And of course if you do have some good guesses then you can combine this blind method with a bit of guessing.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-17T18:45:08.750" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30064" PostTypeId="1" AcceptedAnswerId="30071" CreationDate="2017-01-17T22:28:12.163" Score="4" ViewCount="227" Body="&lt;p&gt;Given a function that calls &lt;code&gt;not&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-not (x)&#xA;  (not x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x disassemble&lt;/code&gt; gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;byte code for my-not:&#xA;  doc:   ...&#xA;  args: (arg1)&#xA;0       dup       &#xA;1       not       &#xA;2       return    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was surprised that this didn't do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;constant not&#xA;stack-ref 1&#xA;call 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because otherwise I cannot redefine &lt;code&gt;not&lt;/code&gt; and affect the original function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine this is done for performance. Which functions does apply to, and where it is it documented? &lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2017-01-18T07:03:22.820" Title="Which functions cannot be redefined after byte compilation?" Tags="|byte-compilation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30065" PostTypeId="1" AcceptedAnswerId="30231" CreationDate="2017-01-18T02:27:35.467" Score="2" ViewCount="907" Body="&lt;p&gt;I am trying to run a source code block and have the outputted figure go into a LaTeX document as a figure. Basically I am doing this in a way slightly similar to Jupyter notebooks, but with the ability to work in &lt;code&gt;org&lt;/code&gt; and have access to LaTeX export. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have already come across &lt;a href=&quot;https://emacs.stackexchange.com/questions/12150/add-caption-to-an-image-generated-by-a-code-block&quot;&gt;this answer&lt;/a&gt; which does an example for Python, which does not seem to resolve my issue and I still have a problem with the Python version of this answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My MWE for the org file is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Testing source&#xA;&#xA;#+NAME: fig:20170117&#xA;#+BEGIN_SRC R  :file test.png :session org_org :results graphics&#xA;x &amp;lt;- c(0, 3, 8, 9, 0)&#xA;y &amp;lt;- c(1, 4, 5, 6, 7)&#xA;plot.new()&#xA;plot(x, y, xlab=&quot;test_x&quot;, ylab=&quot;test_y&quot;)&#xA;mtext(&quot;Some plot&quot;)&#xA;#+END_SRC&#xA;#+CAPTION: Output caption&#xA;#+LABEL: fig:20170117&#xA;#+ATTR_LATEX: :width 0.75\textwidth&#xA;#+RESULTS: fig:20170117&#xA;[[file:test.png]]&#xA;&#xA;&#xA;#+NAME: fig:org_fig&#xA;#+BEGIN_SRC python :file org.png  :session org_py :results graphics&#xA;clf()&#xA;plot(np.sin(np.arange(0,7,0.1)))&#xA;plt.savefig('org.png', transparent=True, bbox_inches='tight')&#xA;'org.png'&#xA;#+END_SRC&#xA;#+CAPTION: Org Fig&#xA;#+LABEL: fig:org_fig&#xA;#+ATTR_LATEX: :width 0.5\textwidth&#xA;#+RESULTS: fig:org_fig&#xA;[[file:org.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And exporting both of these gives the LaTeX body with the code but not the correct labels or either of the figures. If I comment out the &lt;code&gt;#+RESULTS:&lt;/code&gt; line I will get the figures, but without the captions and labels.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\section{Testing source}&#xA;\label{sec:orge034bc3}&#xA;&#xA;\lstset{language=r,label=org47910a7,caption= ,captionpos=b,numbers=none}&#xA;\begin{lstlisting}&#xA;x &amp;lt;- c(0, 3, 8, 9, 0)&#xA;y &amp;lt;- c(1, 4, 5, 6, 7)&#xA;plot.new()&#xA;plot(x, y, xlab=&quot;test_x&quot;, ylab=&quot;test_y&quot;)&#xA;mtext(&quot;Some plot&quot;)&#xA;\end{lstlisting}&#xA;\lstset{language=Python,label=org677e653,caption= ,captionpos=b,numbers=none}&#xA;\begin{lstlisting}&#xA;clf()&#xA;plot(np.sin(np.arange(0,7,0.1)))&#xA;plt.savefig('org.png', transparent=True, bbox_inches='tight')&#xA;'org.png'&#xA;\end{lstlisting}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8972" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-27T09:31:59.603" Title="Outputting figure from R to LaTeX in source block with caption" Tags="|org-mode|org-export|org-babel|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30066" PostTypeId="1" AcceptedAnswerId="30076" CreationDate="2017-01-18T02:54:28.673" Score="1" ViewCount="722" Body="&lt;p&gt;I'm looking to use org-mode to typeset homework for a math class I'm taking and was wondering if there is a way to export only certain LaTex blocks to the final PDF using org-babel.  As an example consider &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO [#A] Question 1&#xA;   DEADLINE: &amp;lt;2017-01-17 Tue&amp;gt;&#xA;   Notes about the problem and links to resources would go here.&#xA;   #+BEGIN_SRC latex&#xA;     \begin{exercise}{1}&#xA;       Prove the theorem&#xA;     \end{exercise}&#xA;     \begin{proof}&#xA;       Let $x \in A$ blah blah.....&#xA;     \end{proof}&#xA;   #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When exporting to PDF I would only want the LaTex code to show up in the PDF but not the TODO heading or any of the other notes and links that might be below it.  Is there a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="6626" LastActivityDate="2017-01-18T14:58:25.443" Title="Org-mode only export LaTex Source Blocks" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30067" PostTypeId="1" CreationDate="2017-01-18T03:28:33.457" Score="1" ViewCount="1279" Body="&lt;p&gt;On Windows 10, after staging a file in magit and attempting to commit it I get this error message instead&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;empty ident name (for &amp;lt;(null)&amp;gt;) not allowed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12751" LastActivityDate="2017-01-18T03:28:33.457" Title="magit &quot;empty ident name (for &lt;(null)&gt;) not allowed&quot; on commit" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30068" PostTypeId="2" ParentId="30067" CreationDate="2017-01-18T03:28:33.457" Score="2" Body="&lt;p&gt;The error message occurs because magit can not find the &lt;code&gt;user.name&lt;/code&gt; and &lt;code&gt;user.email&lt;/code&gt; git configuration settings. These can be set by &lt;a href=&quot;https://emacs.stackexchange.com/questions/487/magit-how-to-set-default-username&quot;&gt;magit: how to set default username?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is when this is set globally. Git for Windows will put this in &lt;code&gt;~/.gitconfig&lt;/code&gt; but the default location for your &lt;code&gt;~&lt;/code&gt; as described in &lt;a href=&quot;https://stackoverflow.com/questions/189490/where-can-i-find-my-emacs-file-for-emacs-running-on-windows&quot;&gt;Where can I find my .emacs file for Emacs running on Windows?&lt;/a&gt; will be in &lt;code&gt;AppData/..&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that it can't find the global config file by &lt;code&gt;M-x magit-command config --list&lt;/code&gt; but the same command run from Git for Windows &lt;code&gt;git config --list&lt;/code&gt; displays the correct user.name and user.email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fixed this by setting the &lt;code&gt;HOME&lt;/code&gt; variable to &lt;code&gt;%USERPFOFILE%&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12751" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-01-18T03:28:33.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30069" PostTypeId="2" ParentId="30054" CreationDate="2017-01-18T04:20:06.467" Score="2" Body="&lt;p&gt;The mode-line can become rather complex -- e.g., powerline, etc.  Answering a mode-line question is somewhat like opening a &quot;Pandora's Box&quot; due to the seemingly endless combinations users may have in their own setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer only deals with the &lt;code&gt;minor-mode-alist&lt;/code&gt; component -- the lighters are green and the mouse-over is red.  The &lt;code&gt;'face&lt;/code&gt; property can be changed to whatever components are supported -- e.g., &lt;code&gt;:foreground &quot;yellow&quot; :family &quot;Times&quot; :height 180&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq mode-line-format (list&#xA;    `(:propertize (&quot;&quot; minor-mode-alist)&#xA;      face '(:foreground &quot;green&quot;)&#xA;      mouse-face '(:foreground &quot;red&quot;)&#xA;      help-echo &quot;Minor mode\n\&#xA;mouse-1: Display minor mode menu\n\&#xA;mouse-2: Show help for minor mode\n\&#xA;mouse-3: Toggle minor modes&quot;&#xA;      local-map ,mode-line-minor-mode-keymap)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-18T04:50:26.483" LastActivityDate="2017-01-18T04:50:26.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30070" PostTypeId="1" CreationDate="2017-01-18T04:37:15.720" Score="2" ViewCount="368" Body="&lt;p&gt;So I have a package I would like to add from an ELPA repository different than MELPA. The repository is called &quot;billpiel&quot; and the link is &lt;a href=&quot;http://billpiel.com/emacs-packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://billpiel.com/emacs-packages/&lt;/a&gt;. I would like to add the package &lt;code&gt;sayid&lt;/code&gt; to a layer (specifically the clojure layer, though that is unimportant). How would I do this in spacemacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried adding this line to the top of the layer file, to my &lt;code&gt;user-init&lt;/code&gt; method and to the &lt;code&gt;dot-spacemacs/layers&lt;/code&gt; method (I know, I shouldn't): &lt;code&gt;(add-to-list 'configuration-layer--elpa-archives '(&quot;billpiel&quot; . &quot;http://billpiel.com/emacs-packages/&quot;))&lt;/code&gt; and then installing the sayid package as an additional package but that didn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to add the package as &lt;code&gt;(sayid :location &quot;http://billpiel.com/emacs-packages/&quot;)&lt;/code&gt; also failed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package documentation is here: &lt;a href=&quot;https://bpiel.github.io/sayid/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://bpiel.github.io/sayid/&lt;/a&gt;. How can I add this package to a layer in a way that I can distribute the layer?&lt;/p&gt;&#xA;" OwnerUserId="14595" LastActivityDate="2017-01-18T04:37:15.720" Title="Adding package from non-standard ELPA Repository to Layer" Tags="|package|spacemacs|package-repositories|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30071" PostTypeId="2" ParentId="30064" CreationDate="2017-01-18T07:03:22.820" Score="5" Body="&lt;p&gt;If you look at &lt;code&gt;(symbol-plist 'not)&lt;/code&gt; you will see that it has a &lt;code&gt;byte-opcode&lt;/code&gt; property with value &lt;code&gt;byte-not&lt;/code&gt;. So the elisp compiler will use this rather than a general function call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not looked for documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the &lt;code&gt;lisp/emacs-lisp/bytecomp.el&lt;/code&gt; file in the source you will find a whole series of byte-XXXX values which are used in this way, so for example &lt;code&gt;(point-min)&lt;/code&gt; is also compiled to a single byte rather than a generic function call.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2017-01-18T07:03:22.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30072" PostTypeId="1" CreationDate="2017-01-18T11:15:48.693" Score="1" ViewCount="248" Body="&lt;p&gt;Some of Python files I work on have the following file-local variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Local Variables:&#xA;# mode: python&#xA;# python-indent-offset: 4&#xA;# tab-width: 4&#xA;# indent-tabs-mode: t&#xA;# coding: utf-8&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When viewing diffs in &lt;code&gt;magit&lt;/code&gt; it displays tabs using tab-width 8, rather than the file local variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make &lt;code&gt;magit&lt;/code&gt; honour file-local tab-width variable?&lt;/p&gt;&#xA;" OwnerUserId="14600" LastActivityDate="2017-01-26T01:30:44.740" Title="magit to honour file-local tab-width variable" Tags="|magit|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30073" PostTypeId="1" CreationDate="2017-01-18T11:18:06.013" Score="0" ViewCount="914" Body="&lt;p&gt;I'm using magit and magit-gerrit, for easy changes, and reviews it works well, but I cannot figure out how to add a new patchset to a change that it is in gerrit&lt;/p&gt;&#xA;" OwnerUserId="8892" LastActivityDate="2017-03-08T08:51:23.260" Title="How to create a new patch set in gerrit" Tags="|magit|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30074" PostTypeId="2" ParentId="30056" CreationDate="2017-01-18T12:11:20.110" Score="3" Body="&lt;p&gt;Ok,&#xA;the entry that needs to be modified is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom org-agenda-scheduled-leaders '(&quot;Scheduled: &quot; &quot;Sched.%2dx: &quot;)&#xA;  &quot;Text preceding scheduled items in the agenda view.&#xA;This is a list with two strings.  The first applies when the item is&#xA;scheduled on the current day.  The second applies when it has been scheduled&#xA;previously, it may contain a %d indicating that this is the nth time that&#xA;this item is scheduled, due to automatic rescheduling of unfinished items&#xA;for the following day.  So this number is one larger than the number of days&#xA;that passed since this item was scheduled first.&quot;&#xA;  :group 'org-agenda-line-format&#xA;  :version &quot;24.4&quot;&#xA;  :package-version '(Org . &quot;8.0&quot;)&#xA;  :type '(list&#xA;      (string :tag &quot;Scheduled today     &quot;)&#xA;      (string :tag &quot;Scheduled previously&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from the org source code.&#xA;I can do this by adding &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-scheduled-leaders '(&quot;&quot; &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to my .emacs. sweet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gets rid of all the &quot;Scheduled: &quot; entrys. I still have not found a way to only remove those, for which a timestamp is provided.&lt;/p&gt;&#xA;" OwnerUserId="14584" LastActivityDate="2017-01-18T12:11:20.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30075" PostTypeId="2" ParentId="28794" CreationDate="2017-01-18T13:06:13.633" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;Lisp error: (invalid-read-syntax &quot;#&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At the core it is obvious what is happening here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Something reads a string from a Magit buffer and does not remove properties.&lt;/li&gt;&#xA;&lt;li&gt;That string is given to &lt;code&gt;completing-read&lt;/code&gt;, or similar, as INITIAL-INPUT, DEF, or a member of COLLECTION. &lt;code&gt;completing-read&lt;/code&gt; does not remove the properties, you select the propertized string, and it is saved in a history variable.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;savehist&lt;/code&gt;, or similar, saves the value of that history variable without removing the properties.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;savehist&lt;/code&gt; tries to read the saved and unreadable value. It contains properties that form a recursive datastructure, and the reader fails at &lt;code&gt;#1&lt;/code&gt;, which isn't valid read syntax.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Obviously something(tm) should remove the properties. I don't know who is considered to be responsible for doing it. It seems to me it would be a good idea to do it in (2). If (1) is responsible for doing it, then that is many different packages, and there will always be one who fails to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it isn't done in (2) upfront for performance reasons. COLLECTION might be very large, and removing all properties from all members would be costly. But once the user has chosen a candidate doing it is very cheap, since its a single string. Infact &lt;code&gt;completing-read&lt;/code&gt; does it, but &lt;code&gt;ido-completing-read&lt;/code&gt; does not. You can observe that using &lt;code&gt;emacs -Q&lt;/code&gt;. Evaluate each of these forms and select &quot;bar&quot;. The first time you get a string with no properties, the second time you get one with properties.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(completing-read &quot;: &quot; (list &quot;foo&quot; (propertize &quot;bar&quot; 'face 'font-lock-error) &quot;baz&quot;))&#xA;(ido-completing-read &quot;: &quot; (list &quot;foo&quot; (propertize &quot;bar&quot; 'face 'font-lock-error) &quot;baz&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ido then also stores that propertized string in the HIST variable. So this should probably be considered a bug in Ido.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend you switch to Ivy, as I did a few weaks ago.  But until a few weeks ago I did use Ido, and I did not have this issue then either, which means that for me (1) and/or (3) behaved differently than for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;savehist&lt;/code&gt; does not contain code to remove properties.  It does however contain code which checks whether the value can be read back and otherwise doesn't print it for good.  Here is that code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun savehist-save (&amp;amp;optional auto-save)&#xA;  ...&#xA;      (dolist (symbol savehist-additional-variables)&#xA;        (when (boundp symbol)&#xA;          (let ((value (symbol-value symbol)))&#xA;            (when (savehist-printable value)&#xA;              (prin1 `(setq ,symbol ',value) (current-buffer))&#xA;              (insert ?\n)))))&#xA;  ...)        &#xA;&#xA;(defun savehist-printable (value)&#xA;  &quot;Return non-nil if VALUE is printable.&quot;&#xA;  (cond&#xA;   ;; Quick response for oft-encountered types known to be printable.&#xA;   ((numberp value))&#xA;   ((symbolp value))&#xA;   ;; String without properties&#xA;   ((and (stringp value)&#xA;         (equal-including-properties value (substring-no-properties value))))&#xA;   (t&#xA;    ;; For others, check explicitly.&#xA;    (with-temp-buffer&#xA;      (condition-case nil&#xA;          (let ((print-readably t) (print-level nil))&#xA;          ;; Print the value into a buffer...&#xA;          (prin1 value (current-buffer))&#xA;          ;; ...and attempt to read it.&#xA;          (read (point-min-marker))&#xA;          ;; The attempt worked: the object is printable.&#xA;          t)&#xA;        ;; The attempt failed: the object is not printable.&#xA;        (error nil))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It appears to me that this code is actually doing what it is supposed to be doing, which makes me wonder whether it is actually run in your case.  Maybe you have an old copy of &lt;code&gt;savehist.el&lt;/code&gt; laying around on the &lt;code&gt;load-path&lt;/code&gt;?  Or you use have an extension to &lt;code&gt;savehist&lt;/code&gt; installed which bypasses this code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A final remark about (1).  As I said, it is very likely that there are many packages out there that do not remove text properties every time the call &lt;code&gt;completing-read&lt;/code&gt; (which may be redefined by things like Ido).  But since &lt;code&gt;completing-read&lt;/code&gt; does remove text properties I don't really think that should be considered a bug.  I did use Ido for a long time, and there were some instances in Magit and my other packages where properties were not removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I started using Ido I also started noticing these issues and fixed them.  However I never had the issue you are having, probably because for me (3) did work as intended.  The one instance where this did cause me issues was when I stored the propertized string in a sqlite database which eventually lead to &quot;foreign key constraint failed&quot;.  As you can imagine going from a database error to &quot;somehow &lt;code&gt;completing-read&lt;/code&gt; returns a propertized string&quot; as the root cause was some detective work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think Magit is the one who messes up at (1).  When Magit uses the section at point as the default completion candidate, it doesn't feed the completing function a string it extracts from the buffer, instead it uses the value of the section object.  In the past there were some instances where that value was a propertized string.  But as far as I remember that was all fixed and only involved branch names.  The error you posted involves stashes and I had a brief look at all stash related completion and also did run some tests, just in case.  But I never got any properties. So maybe it is an extension to Magit that does not remove the properties?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In summary: I don't think Magit passes propertizes strings, and even if it did that should not matter because &lt;code&gt;completing-read&lt;/code&gt; removes them. &lt;code&gt;ido-completing-read&lt;/code&gt; fails to do so, but again that should not result in the observed behavior, because &lt;code&gt;savehist-save&lt;/code&gt; deals with that issue. Why that's not the case for you, I cannot figure out from here.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-01-19T12:17:13.957" LastActivityDate="2017-01-19T12:17:13.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30076" PostTypeId="2" ParentId="30066" CreationDate="2017-01-18T14:58:25.443" Score="2" Body="&lt;p&gt;From &lt;a href=&quot;https://www.reddit.com/r/orgmode/comments/5omspv/is_it_possible_to_only_export_latex_source_blocks/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this reddit thread&lt;/a&gt;, I found that this can be accomplished using &lt;a href=&quot;http://orgmode.org/manual/Extracting-source-code.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-babel-tangle&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6626" LastActivityDate="2017-01-18T14:58:25.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30078" PostTypeId="1" CreationDate="2017-01-18T16:02:36.960" Score="3" ViewCount="1951" Body="&lt;p&gt;I'm trying to configure company-mode to activate in all buffers, with the appropriate back-ends depending on file-type. To that end, I've added the following to my &lt;code&gt;init.el&lt;/code&gt; file. However, regardless of which file-type I open, company-mode does &lt;strong&gt;not&lt;/strong&gt; automatically activate. Help in sorting this out is appreciated. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Enable global company mode&#xA;(require 'company)&#xA;(add-hook 'after-init-hook 'global-company-mode)&#xA;(setq company-idle-delay 0.1)&#xA;(setq company-minimum-prefix-length 1)&#xA;(setq company-backends '((company-capf company-files company-elisp company-inf-ruby company-anaconda company-go company-irony company-clang company-cmake company-css company-yasnippet) (company-dabbrev company-dabbrev-code)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Complete init.el posted here: &lt;a href=&quot;http://pastebin.com/eyvvzUPW&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://pastebin.com/eyvvzUPW&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14603" LastEditorUserId="14603" LastEditDate="2017-01-19T16:46:25.793" LastActivityDate="2017-01-19T16:46:25.793" Title="Company Mode in All Buffers" Tags="|init-file|company-mode|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30079" PostTypeId="1" CreationDate="2017-01-18T17:05:18.767" Score="2" ViewCount="1561" Body="&lt;p&gt;I'm using emacs for editing a bunch of matlab files. The only gripe that I have is that the syntax highlighting provided by &lt;code&gt;octave-mode&lt;/code&gt; is pretty poor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NeM7Z.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;This&lt;/a&gt; is the syntax highlighting provided by sublime text, while &lt;a href=&quot;https://i.stack.imgur.com/8cg3x.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; is emacs. On the right side is &lt;code&gt;octave-mode&lt;/code&gt;, on the left is &lt;code&gt;matlab-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I have syntax highlighting for the keywords and numbers in emacs?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I just found &lt;code&gt;highlight-numbers-mode&lt;/code&gt; for the numbers, the only problem left is the keywords highlighting.&lt;/p&gt;&#xA;" OwnerUserId="14605" LastEditorUserId="14605" LastEditDate="2017-01-18T17:21:15.700" LastActivityDate="2017-02-18T20:12:40.107" Title="Better syntax highlighting in MATLAB/Octave" Tags="|syntax-highlighting|matlab|octave|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30081" PostTypeId="1" AcceptedAnswerId="30084" CreationDate="2017-01-18T18:03:29.240" Score="4" ViewCount="168" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I test (programmatically) whether a variable has been defined, but not initialized?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (my-test foo)&#xA;  (message &quot;%s has been defined, but not initialized.&quot; foo)&#xA;  (message &quot;%s has been defined AND initialized.&quot; foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-01-18T20:30:16.573" Title="Test whether variable is defined, but not initialized" Tags="|defvar|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30082" PostTypeId="1" CreationDate="2017-01-18T18:13:20.780" Score="19" ViewCount="13778" Body="&lt;p&gt;I've got this problem with my 25.1 and Python 3.5 on Ubuntu 16.10, but I don't see it being solved anywhere. Wondering what the latest status was. Reproducing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; emacs -Q --eval '(setq python-shell-interpreter &quot;python3&quot;)'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x run-python&lt;/code&gt; gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native’ was t and &quot;python3&quot; is not part of the ‘python-shell-completion-native-disabled-interpreters’ list.  Native completions have been disabled locally.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I saw one idea where an &lt;code&gt;M-x find-function python-shell-completion-native-try&lt;/code&gt; would pull up the function from deep &lt;code&gt;(/usr/local/share/emacs/25.1/lisp/progmodes/python.el.gz&lt;/code&gt; and the very last line was supposed to be &lt;code&gt;nil &quot;_&quot;)))&lt;/code&gt; and not &lt;code&gt;nil &quot;&quot;)))&lt;/code&gt;. Another conversation &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; talks about changing &lt;code&gt;inputrc&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I switched to another user and I was able to use `run-python' without &#xA;  any warnings. Turns out it was my readline settings. Bash 4.3 added a&#xA;  new readline feature: &quot;set colored-stats on&quot; which I had in .inputrc&#xA;  Removing that line fixed my issue, I think this should be reproducible&#xA;  for all.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Anybody know what the latest is on this? BTW, running Python2 (&lt;code&gt;(setq org-babel-python-command &quot;python2&quot;)&lt;/code&gt;) doesn't have this problem.&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2022-05-23T02:42:31.380" Title="Your ‘python-shell-interpreter’ doesn’t seem to support readline" Tags="|python|repl|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30083" PostTypeId="2" ParentId="30025" CreationDate="2017-01-18T19:07:10.050" Score="15" Body="&lt;p&gt;I do this by starting an emacs daemon when I login. Where you put this command depends on your desktop manager. I use &lt;code&gt;i3&lt;/code&gt;, which is configured to run a script on login that includes the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs --daemon &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that, emacs is always running in the background, and I open a new client with &lt;code&gt;emacsclient -c -n&lt;/code&gt;, bound to a convenient keybinding in the window manager. If you're working in a terminal, you only need a simple alias like &lt;code&gt;alias emc='emacsclient'&lt;/code&gt;, possibly with &lt;code&gt;-n&lt;/code&gt;, &lt;code&gt;-c&lt;/code&gt; or &lt;code&gt;-t&lt;/code&gt; arguments, depending on how you use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do check out the options for emacsclient in the manual: (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html&quot;&gt;(emacs) emacsclient Options&lt;/a&gt;, accessible from Emacs by &lt;code&gt;C-h r m emacsclient options &amp;lt;enter&amp;gt;&lt;/code&gt;). You can use the &lt;code&gt;-a&lt;/code&gt; flag to automatically start an emacs daemon if it isn't running already, and &lt;code&gt;-c&lt;/code&gt; or &lt;code&gt;-t&lt;/code&gt; to open a new frame or terminal client, rather than reusing an existing one (in the same session):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;‘-a COMMAND’&#xA;‘--alternate-editor=COMMAND’&#xA;     Specify a command to run if ‘emacsclient’ fails to contact Emacs.&#xA;     This is useful when running ‘emacsclient’ in a script.&#xA;&#xA;     As a special exception, if COMMAND is the empty string, then&#xA;     ‘emacsclient’ starts Emacs in daemon mode (as ‘emacs --daemon’) and&#xA;     then tries connecting again.&#xA;&#xA;‘-c’&#xA;‘--create-frame’&#xA;     Create a new graphical “client frame”, instead of using an existing&#xA;     Emacs frame.  See below for the special behavior of ‘C-x C-c’ in a&#xA;     client frame.  If Emacs cannot create a new graphical frame (e.g.,&#xA;     if it cannot connect to the X server), it tries to create a text&#xA;     terminal client frame, as though you had supplied the ‘-t’ option&#xA;     instead.&#xA;&#xA;‘-t’&#xA;‘--tty’&#xA;‘-nw’&#xA;     Create a new client frame on the current text terminal, instead of&#xA;     using an existing Emacs frame.  This behaves just like the ‘-c’&#xA;     option, described above, except that it creates a text terminal&#xA;     frame (*note Non-Window Terminals::).&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-01-18T19:17:31.547" LastActivityDate="2017-01-18T19:17:31.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30084" PostTypeId="2" ParentId="30081" CreationDate="2017-01-18T20:30:16.573" Score="6" Body="&#xA;&#xA;&lt;p&gt;The following works only with lexical binding, because with dynamic binding &lt;code&gt;(defvar foo)&lt;/code&gt; has no real effect.  It checks whether let-binding the variable affects the dynamic value or not.  I used the term &quot;declared&quot; instead of &quot;defined&quot;, because &lt;code&gt;(defvar foo)&lt;/code&gt; doesn't quite feel like a full definition to me (e.g., it only applies to the file it's in) so it's more like C's &quot;declare&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; -*- lexical-binding: t -*-&#xA;&#xA;(defvar foo 2)&#xA;(defvar bar)&#xA;&#xA;(defmacro check-var (var)&#xA;  `(message &quot;%s %s&quot;&#xA;            ',var&#xA;            (cond ((boundp ',var) &quot;has been initialized&quot;)&#xA;                  ((let ((,var t)) (boundp ',var))&#xA;                   &quot;has been declared, but not initialized&quot;)&#xA;                  (t &quot;has NOT been declared nor initialized&quot;))))&#xA;&#xA;(check-var foo)&#xA;(check-var bar)&#xA;(check-var qux)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-01-18T20:30:16.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30085" PostTypeId="1" AcceptedAnswerId="30086" CreationDate="2017-01-19T06:37:48.317" Score="4" ViewCount="198" Body="&lt;p&gt;What's the idiomatic Emacs way to soft-require a feature, then use that feature if it's available?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html#index-require&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;require&lt;/code&gt; function allows “soft require”&lt;/a&gt; by specifying a non-nil third argument:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'projectile nil 'missing-okay)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the best way to then use that feature to do more things, only if the feature is now present?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(if succeeds&#xA; (require 'projectile nil 'missing-okay)&#xA; (do-some-stuff-that-needs-projectile))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'projectile nil 'missing-okay)&#xA;(when feature-is-available 'projectile&#xA; (do-some-stuff-that-needs-projectile))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or something else?&lt;/p&gt;&#xA;" OwnerUserId="2506" LastEditorUserId="2506" LastEditDate="2017-01-28T12:49:22.333" LastActivityDate="2017-01-28T12:49:22.333" Title="Soft-require a feature, then conditionally run more commands" Tags="|require|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30086" PostTypeId="2" ParentId="30085" CreationDate="2017-01-19T06:43:45.677" Score="8" Body="&lt;p&gt;You just test with &lt;code&gt;featurep&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'projectile nil t)&#xA;(when (featurep 'projectile)&#xA; (do-some-stuff-that-needs-projectile))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or you use that the &lt;code&gt;require&lt;/code&gt; returns nil if it is not possible to load:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(when (require 'projectile nil t)&#xA;  (do-some-stuff-that-needs-projectile)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2710" LastEditorUserId="2506" LastEditDate="2017-01-20T03:03:24.460" LastActivityDate="2017-01-20T03:03:24.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30087" PostTypeId="1" CreationDate="2017-01-19T09:40:06.947" Score="3" ViewCount="858" Body="&lt;p&gt;I am working on a corporate installation. They have emacs, and it has tcl mode. The issue is that the command lassign is not highlighted, unlike, for example, set, or return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What that I would like, is that w/o changing the original, installed, Tcl-Mode ELISP code, add lassign (and others) to the list/dict that are highlighted.&lt;/p&gt;&#xA;" OwnerUserId="13534" LastEditorUserId="591" LastEditDate="2017-01-19T20:26:52.590" LastActivityDate="2017-01-19T20:26:52.590" Title="Adding new commands to the syntax highlighting of a language mode" Tags="|font-lock|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30088" PostTypeId="1" AcceptedAnswerId="30098" CreationDate="2017-01-19T10:13:18.750" Score="2" ViewCount="852" Body="&lt;p&gt;&lt;code&gt;text-properties-at&lt;/code&gt; returns a list of various text properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to remove:  &lt;code&gt;display (image :type xpm :file /Users/HOME/.0.data/.0.emacs/.0.images/ezimage/box-plus.xpm :scale 1.1070588235294117 :ascent center)&lt;/code&gt;.  The image may change, so I'd like a general approach that targets the &lt;code&gt;display&lt;/code&gt; property and any value that may exist in relation thereto.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I was dealing with a &lt;code&gt;plist&lt;/code&gt; and I read about &lt;code&gt;remprop&lt;/code&gt;, but it strips everything in the entire list -- i.e., it makes the whole list &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;    (let ((props (text-properties-at 0 OBJECT)))&#xA;      (setq props (remprop 'props 'display)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="105" LastEditDate="2017-01-19T14:45:28.537" LastActivityDate="2017-01-19T18:36:15.997" Title="How to remove certain text-properties from a list of properties" Tags="|text-properties|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30089" PostTypeId="1" CreationDate="2017-01-19T10:33:21.840" Score="3" ViewCount="128" Body="&lt;p&gt;I am connecting to my office GNU/Linux box from a windows laptop through a putty ssh tunnel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also on the laptop the java WeirdX X11 server, that is declared in putty to use the &lt;code&gt;localhost:2&lt;/code&gt; (default) display, while the &quot;enable X11 forwarding&quot; is enabled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once connected on my Linux, the X11 export seems correctly configured by putty with &lt;code&gt;DISPLAY=localhost:10.0&lt;/code&gt; as I can start &lt;code&gt;xlogo&lt;/code&gt;, &lt;code&gt;xeyes&lt;/code&gt; or even Firefox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when invoking &lt;code&gt;emacsclient -c&lt;/code&gt; I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Waiting for Emacs...&#xA;*ERROR*: Display localhost:10.0 can't be opened&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For what I understand, &lt;code&gt;emacsclient&lt;/code&gt; finds the running Emacs (confirmed if I use &lt;code&gt;emacsclient -nw&lt;/code&gt;: I can get my running emacs session) but Emacs cannot use my distant display. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And when I join my session with &lt;code&gt;emacsclient -nw&lt;/code&gt; then &lt;code&gt;M-x make-frame-on-display RET localhost:10.0&lt;/code&gt; I get the same &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Display localhost:10.0 can't be opened&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Do you have some tip that can help?&lt;/p&gt;&#xA;" OwnerUserId="226" LastEditorUserId="105" LastEditDate="2017-01-19T14:44:23.343" LastActivityDate="2017-01-19T14:44:23.343" Title="make-frame-on-display &amp; emacsclient fail w/ exported display while other apps are fine" Tags="|frames|emacsclient|ssh|x11|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30090" PostTypeId="2" ParentId="30087" CreationDate="2017-01-19T10:34:19.513" Score="5" Body="&lt;p&gt;You can do this using the function &lt;code&gt;font-lock-add-keywords&lt;/code&gt;. It takes two arguments, the first is the major mode to extend. Alternatively, you can pass nil which mean the current buffer, which is useful if you call the function from a hook. The second is a list of &lt;em&gt;font-lock keywords&lt;/em&gt;. This is a special data structure described in the documentation of the variable &lt;code&gt;font-lock-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, it could look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-c-mode-hook ()&#xA;  (font-lock-add-keywords nil&#xA;    '((&quot;\\_&amp;lt;\\(k[A-Z0-9][a-zA-Z0-9_]*\\)\\_&amp;gt;&quot; (0 font-lock-constant-face)))))&#xA;(add-hook 'c-mode-hook #'my-c-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The font-lock keyword match words like &lt;code&gt;kThisIsAConstant&lt;/code&gt; using a regular expression (or regexp). The 0 mean that the entire match should be highlighted and &lt;code&gt;font-lock-constant-face&lt;/code&gt; is used to highlight the match&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2017-01-19T10:34:19.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30091" PostTypeId="1" AcceptedAnswerId="30396" CreationDate="2017-01-19T10:47:57.573" Score="2" ViewCount="924" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yqq3i.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yqq3i.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;why is it so big? almost twice the size of 25.1&lt;br&gt;&#xA;what's new with it? &lt;/p&gt;&#xA;" OwnerUserId="10287" LastEditorUserId="105" LastEditDate="2017-01-19T14:43:55.043" LastActivityDate="2017-02-02T19:42:19.050" Title="Why is the emacs-25.1-2 binary for Windows so big?" Tags="|microsoft-windows|install|binary|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30093" PostTypeId="1" AcceptedAnswerId="30101" CreationDate="2017-01-19T11:28:41.117" Score="3" ViewCount="923" Body="&lt;p&gt;I'm currently working with a lot of javascript in my org files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I introduce a local buffer variable that will automatically insert &lt;code&gt;javascript&lt;/code&gt; as language identifier in my file whenever I use &lt;code&gt;&amp;lt;s TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how I've done it, it's inspired by the mailing list post &lt;a href=&quot;https://emacs.stackexchange.com/questions/8314/set-default-language-for-code-blocks-in-orgmode&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- org-structure-template-alist: ((&quot;s&quot; &quot;#+BEGIN_SRC javascript\n?\n#+END_SRC&quot;)); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I put this as first line in my org file it will complete &lt;code&gt;&amp;lt;s&lt;/code&gt; to the desired.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC javascript&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I look up the definition &lt;code&gt;C-h v org-structure-template-alist&lt;/code&gt; the current value is just.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;s&quot; &quot;#+BEGIN_SRC javascript\n?\n#+END_SRC&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While the original value was: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;s&quot; &quot;#+BEGIN_SRC ?\n\n#+END_SRC&quot; &quot;&amp;lt;src lang=\&quot;?\&quot;&amp;gt;\n\n&amp;lt;/src&amp;gt;&quot;)&#xA; (&quot;e&quot; &quot;#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE&quot; &quot;&amp;lt;example&amp;gt;\n?\n&amp;lt;/example&amp;gt;&quot;)&#xA; (&quot;q&quot; &quot;#+BEGIN_QUOTE\n?\n#+END_QUOTE&quot; &quot;&amp;lt;quote&amp;gt;\n?\n&amp;lt;/quote&amp;gt;&quot;)&#xA; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So is it possible to access the global definition of &lt;code&gt;org-structure-template-alist&lt;/code&gt; inside the local org defining block and just replace the default binding to &lt;code&gt;&amp;lt;s&lt;/code&gt; with my definition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way I can use &lt;code&gt;&amp;lt;s&lt;/code&gt; to get the javascript, but also use the other defined shortcuts like &lt;code&gt;&amp;lt;e&lt;/code&gt; for Example block. Currently the buffer in which I define &lt;code&gt;org-structure-template-alist&lt;/code&gt; will only complete &lt;code&gt;&amp;lt;s&lt;/code&gt; and ignore all things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this but it doesn't seem to evaluate the &lt;code&gt;add-to-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- org-structure-template-alist: (add-to-list 'org-structure-template-alist ((&quot;s&quot; &quot;#+BEGIN_SRC javascript\n?\n#+END_SRC&quot; &quot;&amp;lt;src lang=\&quot;javascript\&quot;&amp;gt;\n\n&amp;lt;/src&amp;gt;&quot;))); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is now my final solution based on the answer of Tyler. I include the following code as &lt;strong&gt;last&lt;/strong&gt; statement in my org file. It is marked as a comment so it won't get exported, which was also a requirement. Loading the file now ask if I want to apply local variables, but this is not a problem right now.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* COMMENT &#xA;### Local Variables:&#xA;### eval: (make-variable-buffer-local 'org-structure-template-alist)&#xA;### eval: (add-to-list 'org-structure-template-alist '(&quot;s&quot; &quot;#+BEGIN_SRC javascript :tangle yes\n?\n#+END_SRC&quot; &quot;&amp;lt;src lang=\&quot;javascript\&quot;&amp;gt;\n\n&amp;lt;/src&amp;gt;&quot;))&#xA;### End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2315" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-01-20T11:13:01.033" Title="Access and adjust global variable from org-mode as local buffer variable" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30094" PostTypeId="1" CreationDate="2017-01-19T12:56:57.117" Score="2" ViewCount="140" Body="&lt;p&gt;In Org Mode I have an &lt;a href=&quot;http://orgmode.org/manual/Attachments.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;attachment&lt;/a&gt; associated with some task&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Some task                                                          :ATTACH:&#xA;  :PROPERTIES:&#xA;  :Attachments: some_file.png&#xA;  :ID:       da335ac9-00ac-494b-9073-d17e70457bc8&#xA;  :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to obtain a full path, in a string format, to &lt;code&gt;some_file.png&lt;/code&gt; based on its ID?&lt;/p&gt;&#xA;" OwnerUserId="14127" LastActivityDate="2017-01-19T12:56:57.117" Title="In Org Mode, how to get path of an attachment - given its ID - in a string format?" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30095" PostTypeId="1" AcceptedAnswerId="30113" CreationDate="2017-01-19T13:36:40.707" Score="8" ViewCount="2354" Body="&lt;p&gt;When using &lt;a href=&quot;https://github.com/jkitchin/org-ref&quot; rel=&quot;noreferrer&quot;&gt;org-ref&lt;/a&gt;, the &lt;code&gt;bibliography:ref.bib&lt;/code&gt; directive in the &lt;code&gt;notes.org&lt;/code&gt; file can be used to direct it to the corresponding &lt;code&gt;ref.bib&lt;/code&gt; bibliography. Is there a similar such directive or approach to enable the &lt;code&gt;ref.bib&lt;/code&gt; file to &quot;discover&quot; its corresponding &lt;code&gt;notes.org&lt;/code&gt; file and &lt;code&gt;bibtex-pdfs&lt;/code&gt; folder?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can set the following within their &lt;code&gt;init.el&lt;/code&gt;, or &lt;code&gt;emacs-init.org&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-ref-bibliography-notes &quot;~/Dropbox/bibliography/notes.org&quot;&#xA;      org-ref-default-bibliography '(&quot;~/Dropbox/bibliography/references.bib&quot;)&#xA;      org-ref-pdf-directory &quot;~/Dropbox/bibliography/bibtex-pdfs/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, in the case of multiple projects, each with their own &lt;code&gt;notes.org&lt;/code&gt; and &lt;code&gt;ref.bib&lt;/code&gt; files, and &lt;code&gt;bibtex-pdfs&lt;/code&gt; directories, how can one specify and associated a &lt;code&gt;ref.bib&lt;/code&gt; file with a specific &lt;code&gt;notes.org&lt;/code&gt; file and &lt;code&gt;bibtex-pdfs&lt;/code&gt; folders?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically when working on an article within a project, it's pretty neat to click on a reference that's been inserted with &lt;code&gt;C-c ]&lt;/code&gt;, and then &quot;Add Notes&quot; to that particular reference &lt;code&gt;3 RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without the above snippet in my &lt;code&gt;init.el&lt;/code&gt;, I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-ref-open-bibtex-notes: Org-ref-bib-bibliography-notes is not set to anything&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This error persists even after setting up file local variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* File Local Variables&#xA;# Local Variables:&#xA;# org-ref-bibliography-notes: &quot;~/Dropbox/bibliography/notes.org&quot;&#xA;# org-ref-pdf-directory: &quot;~/Dropbox/bibliography/bibtex-pdfs/&quot;&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- org-ref-bibliography-notes: &quot;~/Dropbox/bibliography/notes.org&quot;; -*-&#xA;# -*- org-ref-pdf-directory: &quot;~/Dropbox/bibliography/bibtex-pdfs/&quot;; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="9134" LastEditDate="2017-01-20T17:37:00.867" LastActivityDate="2017-01-20T17:37:00.867" Title="Org-Ref: Managing multiple projects, each with own notes.org files and bibtex-pdfs folders" Tags="|org-mode|file-local-variables|reftex-mode|bibtex|org-ref|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30096" PostTypeId="2" ParentId="30088" CreationDate="2017-01-19T14:09:12.470" Score="1" Body="&lt;p&gt;cl-remprop deletes a property that is &lt;em&gt;associated with the symbol&lt;/em&gt; &lt;code&gt;props&lt;/code&gt; itself. This property list is &lt;code&gt;nil&lt;/code&gt; already. (And remprop only returns true if something was found+deleted, and nil otherwise.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, the property list you want to change is the value the symbol happens to be bound to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function you search is likely &lt;code&gt;remove-text-properties&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html#Changing-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html#Changing-Properties&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-01-19T14:09:12.470" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30098" PostTypeId="2" ParentId="30088" CreationDate="2017-01-19T18:36:15.997" Score="0" Body="&lt;p&gt;&lt;code&gt;org-mode&lt;/code&gt; contains a handy function called &lt;code&gt;org-plist-delete&lt;/code&gt; inside &lt;code&gt;org-macs.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((props (text-properties-at 0 OBJECT)))&#xA;  (setq props (org-plist-delete props 'display)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-01-19T18:36:15.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30099" PostTypeId="2" ParentId="30079" CreationDate="2017-01-19T19:44:04.900" Score="2" Body="&lt;p&gt;&lt;code&gt;octave-mode&lt;/code&gt; does have some keywords &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/octave.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;(see source)&lt;/a&gt;. Even so, you can &lt;a href=&quot;https://www.emacswiki.org/emacs/AddKeywords&quot; rel=&quot;nofollow noreferrer&quot;&gt;add your own&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(font-lock-add-keywords 'octave-mode&#xA;                        '((&quot;\\&amp;lt;load\\&amp;gt;&quot;. font-lock-keyword-face)                                                                                                                           &#xA;                          (&quot;\\&amp;lt;clear\\&amp;gt;&quot;. font-lock-keyword-face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2017-01-19T19:44:04.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30100" PostTypeId="1" AcceptedAnswerId="30208" CreationDate="2017-01-19T20:40:24.957" Score="5" ViewCount="467" Body="&lt;p&gt;Recently I am indulging in Emacs. I tried to use it as my LaTeX tool, so I installed pdf-tools. If I add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(pdf-tools-install)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my init file, it will take about 2 seconds to start Emacs. So I want to write a function such that &quot;pdf-tools-install&quot; will run after I open a pdf file. But &quot;add-hook&quot; only works when a major mode is recognized, and we can recognize pdf only after pdf-tools is installed. I think it may relate to regex, but I don't know much about it. Could you help me with this function? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="14618" LastActivityDate="2017-01-25T23:14:28.757" Title="Emacs pdf-tools writing function" Tags="|functions|pdf|pdf-tools|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30101" PostTypeId="2" ParentId="30093" CreationDate="2017-01-19T20:52:30.023" Score="3" Body="&lt;p&gt;Once you define a variable as buffer local, I don't think you can access the global value from a buffer where it has a new local value. However, you can change your local variable definition to include the global value. File-local variable definitions are not evaluated, so you have to use the special keyword &lt;code&gt;eval:&lt;/code&gt; to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## Local Variables:&#xA;## eval: (make-variable-buffer-local 'org-structure-template-alist)&#xA;## eval: (add-to-list 'org-structure-template-alist '(&quot;s&quot; &quot;#+BEGIN_SRC javascript\n?\n#+END_SRC&quot; &quot;&amp;lt;src lang=\&quot;javascript\&quot;&amp;gt;\n\n&amp;lt;/src&amp;gt;&quot;))&#xA;## End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could include the first line in your .emacs, so you don't need it in every org buffer where you're doing this. It shouldn't make any difference when you don't use a local value for &lt;code&gt;org-structure-template-alist&lt;/code&gt; - it will default to the global value in any buffer where you don't set it explicitly.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As @AndrewSwann points out, you can indeed lookup the default value of a local variable. In this case, I don't think that's actually what you want to do: better to define your local value to incorporate the default value in the first place.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-01-19T22:34:51.763" LastActivityDate="2017-01-19T22:34:51.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30102" PostTypeId="2" ParentId="30093" CreationDate="2017-01-19T21:43:23.380" Score="4" Body="&lt;p&gt;The global value is the &lt;code&gt;default&lt;/code&gt; value.  It can be examined with &lt;code&gt;default-value&lt;/code&gt; and set with &lt;code&gt;setq-default&lt;/code&gt;.  See the section on &quot;Buffer-Local Variables&quot; in the Elisp manual.&lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2017-01-19T21:43:23.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30104" PostTypeId="1" CreationDate="2017-01-20T00:36:16.020" Score="2" ViewCount="67" Body="&lt;p&gt;In dash.el, there are anaphoric macros (it saves to write &quot;lambda&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(--map (* it 2) '(1 2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of &lt;code&gt;(-map (lambda (it) (* it 2)) '(1 2))&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;seq.el&lt;/code&gt; is more generic, it works on strings and vectors too, but it doesn't include anaphoric macros (and doesn't intend to, AFAIK).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you aware of a library that implements them ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit&lt;/strong&gt;: in the needs, wrote a couple of them: &lt;a href=&quot;https://gitlab.com/emacs-stuff/anaphoric-seq&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gitlab.com/emacs-stuff/anaphoric-seq&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="739" LastEditorUserId="105" LastEditDate="2017-01-20T02:25:10.973" LastActivityDate="2017-01-20T02:25:10.973" Title="Do we have anaphoric macros of seq.el?" Tags="|mapping|sequences|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30105" PostTypeId="1" CreationDate="2017-01-20T02:09:03.387" Score="1" ViewCount="131" Body="&lt;p&gt;Evil has a beautiful &lt;code&gt;:s(ubstitute)&lt;/code&gt; implementation, which shows the regexp inline as you type:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nNNtd.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nNNtd.gif&quot; alt=&quot;Evil&amp;#39;s Substitute command&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the feature doesn't exist for the global command, &lt;code&gt;:g&lt;/code&gt; (such that &lt;code&gt;:%g/emacs/...&lt;/code&gt; will find the line as expected, but nothing will appear until the command is executed). Do there exist easy ways to include this feature, and bind to the Evil substitute command?&lt;/p&gt;&#xA;" OwnerUserId="8486" LastActivityDate="2017-02-19T13:35:30.673" Title="Highlight with Evil's `:g` command" Tags="|evil|highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30106" PostTypeId="1" CreationDate="2017-01-20T03:26:40.037" Score="0" ViewCount="57" Body="&lt;p&gt;I am trying to locate .emacs file . I have installed emacs auctex from a zip file obtained from ctan.org on windows 7. &#xA;I tried to search.emacs within directory but nothing returned. &#xA;Kindly help &lt;/p&gt;&#xA;" OwnerUserId="14627" LastActivityDate="2017-01-20T03:26:40.037" Title=".emacs location" Tags="|microsoft-windows|configuration-files|" AnswerCount="0" CommentCount="4" ClosedDate="2017-01-20T22:06:08.247" ContentLicense="CC BY-SA 3.0" />
  <row Id="30108" PostTypeId="2" ParentId="30031" CreationDate="2017-01-20T10:06:05.477" Score="1" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defvar inline-docs-overlay nil)&#xA;&#xA;(defgroup inline-docs nil&#xA;  &amp;quot;Show inline contextual docs in Emacs.&amp;quot;&#xA;  :group 'docs)&#xA;&#xA;(defcustom inline-docs-border-symbol ?―&#xA;  &amp;quot;Specify symbol for inline-docs border.&amp;quot;&#xA;  :group 'inline-docs)&#xA;&#xA;(defcustom inline-docs-prefix-symbol ?\s&#xA;  &amp;quot;Specify symbol for inline-docs prefix.&amp;quot;&#xA;  :group 'inline-docs)&#xA;&#xA;(defcustom inline-docs-indicator-symbol &amp;quot;➜&amp;quot;&#xA;  &amp;quot;Specify symbol for inline-docs indicator.&amp;quot;&#xA;  :group 'inline-docs)&#xA;&#xA;(defface inline-docs-face&#xA;  '((t (:inherit italic)))&#xA;  &amp;quot;Face for `inline-docs-mode'.&amp;quot;&#xA;  :group 'inline-docs)&#xA;&#xA;(defface inline-docs-border-face&#xA;  '((t (:inherit font-lock-doc-face)))&#xA;  &amp;quot;Face for inline docs border lines.&amp;quot;&#xA;  :group 'inline-docs)&#xA;&#xA;(defface inline-docs-prefix-face&#xA;  '((t (:inherit default)))&#xA;  &amp;quot;Face for inline docs prefix.&amp;quot;&#xA;  :group 'inline-docs)&#xA;&#xA;(defface inline-docs-indicator-face&#xA;  '((t (:inherit font-lock-doc-face)))&#xA;  &amp;quot;Face for inline docs indicator.&amp;quot;&#xA;  :group 'inline-docs)&#xA;&#xA;(defun inline-docs--clear-overlay ()&#xA;  &amp;quot;Clear inline-docs overlays.&amp;quot;&#xA;  (when (overlayp inline-docs-overlay)&#xA;    (delete-overlay inline-docs-overlay))&#xA;  (remove-hook 'post-command-hook 'inline-docs--clear-overlay))&#xA;&#xA;(defun inline-docs--string-display-next-line (string apply-face)&#xA;  &amp;quot;Show STRING contents below point line until next command with APPLY-FACE.&amp;quot;&#xA;  (let* ((border-line (make-string (window-body-width) inline-docs-border-symbol))&#xA;         (prefix (make-string&#xA;                  (if (= (current-indentation) 0) ; fix (wrong-type-argument wholenump -1) when current indentation is 0 minus 1 will caused wholenump exception.&#xA;                      (current-indentation)&#xA;                    (- (current-indentation) 1))&#xA;                  inline-docs-prefix-symbol))&#xA;         (str (concat (propertize border-line&#xA;                                  'face 'inline-docs-border-face)&#xA;                      &amp;quot;\n&amp;quot;&#xA;                      prefix&#xA;                      (propertize (concat inline-docs-indicator-symbol &amp;quot; &amp;quot;)&#xA;                                  'face 'inline-docs-indicator-face)&#xA;                      (copy-sequence string) ; original eldoc string with format.&#xA;                      &amp;quot;\n&amp;quot;&#xA;                      (propertize border-line&#xA;                                  'face 'inline-docs-border-face)&#xA;                      &amp;quot;\n&amp;quot;&#xA;                      ))&#xA;         start-pos end-pos)&#xA;    (unwind-protect&#xA;        (save-excursion&#xA;          (inline-docs--clear-overlay)&#xA;          (forward-line)&#xA;          (setq start-pos (point))&#xA;          (end-of-line)&#xA;          (setq end-pos (point))&#xA;          (setq inline-docs-overlay (make-overlay start-pos end-pos (current-buffer)))&#xA;          ;; change the face&#xA;          (if apply-face&#xA;              (overlay-put inline-docs-overlay 'face 'inline-docs-face))&#xA;          ;; hide full line&#xA;          ;; (overlay-put inline-docs-overlay 'display &amp;quot;&amp;quot;)&#xA;          ;; (overlay-put inline-docs-overlay 'display :height 20)&#xA;          ;; pre-pend indentation spaces&#xA;          ;; (overlay-put inline-docs-overlay 'line-prefix prefix)&#xA;          ;; auto delete overlay&#xA;          (overlay-put inline-docs-overlay 'evaporate t)&#xA;          ;; display message&#xA;          (overlay-put inline-docs-overlay 'before-string str))&#xA;      (add-hook 'post-command-hook 'inline-docs--clear-overlay))))&#xA;&#xA;(defun inline-docs-display-docs-momentary (format-string &amp;amp;rest args)&#xA;  &amp;quot;Display inline docs FORMAT-STRING under point with extra ARGS.&amp;quot;&#xA;  (when format-string&#xA;    (inline-docs--string-display-next-line&#xA;     (apply 'format format-string args)&#xA;     t)))&#xA;&#xA;;;;###autoload&#xA;(defalias 'inline-docs 'inline-docs-display-docs-momentary)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastEditorUserId="-1" LastEditDate="2022-01-26T16:43:24.257" LastActivityDate="2022-01-26T16:43:24.257" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="30109" PostTypeId="1" AcceptedAnswerId="46881" CreationDate="2017-01-20T11:56:38.787" Score="0" ViewCount="124" Body="&lt;p&gt;I'd like the size of the default face be read in an environment variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently my &lt;code&gt;.emacs&lt;/code&gt; reads the frame size from the EMACS_HEIGHT var thanks to the following code in the &lt;code&gt;(custom-set-variables ...)&lt;/code&gt; list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(default-frame-alist&#xA;    (cons&#xA;       (cons (quote height) (string-to-int (getenv &quot;EMACS_HEIGHT&quot;)))&#xA;       (quote ((menu-bar-lines . 1) (tool-bar-lines . 0) (width . 82)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to adapt it to &quot;insert&quot; a similar getenv directive into the line which sets the default face (in &lt;code&gt;(custom-set-faces ...)&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(default ((t (:inherit nil :stipple nil :background &quot;grey80&quot; :foreground &quot;black&quot;&#xA;               :inverse-video nil :box nil :strike-through nil :overline nil &#xA;               :underline nil :slant normal :weight normal :height 110 &#xA;               :width normal foundry :&quot;unknown&quot; :family &quot;Droid Sans Mono&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but didn't succeed. Or, rather, I may achieve my goal with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cons ':inherit (cons nil (cons ':weight (cons 'normal (cons ':height (cons&#xA;(string-to-int (getenv &quot;EMACS_HEIGHT&quot;)) '(:foundry &quot;unknown&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but using one &lt;code&gt;cons&lt;/code&gt; per item looks like much ado (and a waste of parentheses).&lt;/p&gt;&#xA;" OwnerUserId="14630" LastEditorUserId="14630" LastEditDate="2017-01-20T13:22:44.697" LastActivityDate="2019-01-03T10:34:21.790" Title="Size of default face from environment variable" Tags="|faces|customize|system-environment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30110" PostTypeId="1" AcceptedAnswerId="30116" CreationDate="2017-01-20T12:23:27.137" Score="0" ViewCount="650" Body="&lt;p&gt;I am using emacs with org-mode on OSX. Since I have a lot of .org files added to my agenda and it would be good for clean-up purpose if I could cycle through them and maybe also remove them if not needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this, I tried using org-cycle-agenda-files&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It only goes to the file that is at the top of the agenda list and does not cycle through remaining files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some configuration change that I can do to fix it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On evaluation of expression &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-agenda-files t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can see the list of my agenda files&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;~/work/pubsub/onCall/File4OnCall.org&quot; &quot;~/work/pubsub/tasks/DocumentExistingAlarms/DocumentExistingAlarms.org&quot; &quot;~/work/pubsub/tasks/1739_alarmCBOpen/TaskAnalysis.org&quot; &#xA;&quot;~/work/docs/workNotes/OfficsTasks.org&quot; &quot;~/work/docs/workNotes/GeneralTodos.org&quot; &quot;~/work/pubsub/documents/notes/general/CodeLooks.org&quot; &quot;~/work/pubsub/documents/notes/general/Tasks2Do.org&quot; ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10110" LastActivityDate="2019-09-05T04:22:49.107" Title="Cycle through agenda files list not working" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30111" PostTypeId="2" ParentId="30109" CreationDate="2017-01-20T12:42:47.463" Score="1" Body="&lt;p&gt;It's a wonder it should work in the first example. The &lt;code&gt;'&lt;/code&gt; (is a macro that) translates into &lt;code&gt;(quote ...)&lt;/code&gt;, so it inserts everything verbatim, without evaluating it. (i.e. without executing the cons forms.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to evaluate part of a quoted template, you can use quasiquote (aka backquote) using the ``` character, and &quot;unquoting&quot; the respective parts with &lt;code&gt;,&lt;/code&gt;. For your example that means (tested and works for me):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;EMACS_FRAME_HEIGHT&quot; &quot;100&quot;) ;for easier testing&#xA;(setenv &quot;EMACS_FONT_HEIGHT&quot; &quot;110&quot;)&#xA;&#xA;(setq default-frame-alist&#xA;      `((height . ,(string-to-int(getenv &quot;EMACS_FRAME_HEIGHT&quot;)))&#xA;        (menu-bar-lines . 1) (tool-bar-lines . 0) (width . 82) ))&#xA;&#xA;(custom-set-faces `(default ((t (:inherit nil :stipple nil :background &quot;grey80&quot; :foreground &quot;black&quot;&#xA;               :inverse-video nil :box nil :strike-through nil :overline nil &#xA;               :underline nil :slant normal :weight normal&#xA;               :height ,(string-to-int (getenv &quot;EMACS_FONT_HEIGHT&quot;))&#xA;               :width normal foundry :&quot;unknown&quot; :family &quot;Droid Sans Mono&quot;)))))  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you edit the part inserted by configure into your init files, it will likely mess with your changes if you use configure later. On the other hand, you can also set it somewhere else (in your init files or elsewhere.)&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-01-20T12:42:47.463" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30112" PostTypeId="2" ParentId="30105" CreationDate="2017-01-20T13:15:01.223" Score="1" Body="&lt;p&gt;It's not an easy task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ex command interface (pressing &lt;kbd&gt;:&lt;/kbd&gt;) is a mini-language itself. Ex uses an &lt;a href=&quot;https://bitbucket.org/lyro/evil/src/f2648b841f9bcded8764ce63410065d2b8c5f856/evil-ex.el?at=default&amp;amp;fileviewer=file-view-default#evil-ex.el-37&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;argument handler&quot;&lt;/a&gt; to provide completion and interactive feedback (as for &lt;code&gt;:s&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the &lt;a href=&quot;https://bitbucket.org/lyro/evil/src/f2648b841f9bcded8764ce63410065d2b8c5f856/evil-search.el?at=default&amp;amp;fileviewer=file-view-default#evil-search.el-1139&quot; rel=&quot;nofollow noreferrer&quot;&gt;handler for &lt;code&gt;:s&lt;/code&gt;&lt;/a&gt; you can get an idea of where to plug this now handler. However, you'll have to work out a &quot;execute this code that can be undone&quot; way to handle your input&lt;/p&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2017-01-20T13:15:01.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30113" PostTypeId="2" ParentId="30095" CreationDate="2017-01-20T15:21:24.717" Score="8" Body="&lt;p&gt;I think you need to put the local variables in two places, which is the org file and the bib file. The issue is that the notes functions are called while the bibtex buffer is active, so the local variables in the org file do not affect them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my org file I put something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* File Local Variables&#xA;# Local Variables:&#xA;# org-ref-bibliography-notes: &quot;/Users/jkitchin/tmp/org-ref-issue-368/notes.org&quot;&#xA;# org-ref-default-bibliography: (&quot;/Users/jkitchin/tmp/org-ref-issue-368/test.bib&quot;)&#xA;# bibtex-completion-notes-path: &quot;/Users/jkitchin/tmp/org-ref-issue-368/notes/&quot;&#xA;# org-ref-pdf-directory: &quot;/Users/jkitchin/tmp/org-ref-issue-368/bibtex-pdfs/&quot;&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the bib file I put &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- org-ref-bibliography-notes: &quot;/Users/jkitchin/tmp/org-ref-issue-368/notes.org&quot;; bibtex-completion-notes-path: &quot;/Users/jkitchin/tmp/org-ref-issue-368/notes/&quot;; org-ref-pdf-directory: &quot;/Users/jkitchin/tmp/org-ref-issue-368/bibtex-pdfs/&quot;; -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;at the top in one line. That seems to be the only way to get the right thing to happen since the doi utils append to the end of the file and don't look for local variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There might still be a notes issue I am looking into, but this is what should be required to work with project specific variables I think.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-01-20T15:21:24.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30114" PostTypeId="2" ParentId="26323" CreationDate="2017-01-20T15:38:58.413" Score="1" Body="&lt;p&gt;Based on @Adam Spiers' answer, I ran the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (buffer (buffer-list))&#xA;  (with-current-buffer buffer&#xA;    (when (bound-and-true-p isearch-mode)&#xA;      (message &quot;Try isearch-ing in %s&quot; buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which identified a buffer.  I then went to that buffer, started &lt;code&gt;isearch&lt;/code&gt;, exited &lt;code&gt;isearch&lt;/code&gt; normally, and then things went back to normal.  The issue for me was that &lt;code&gt;isearch-mode&lt;/code&gt; was non-&lt;code&gt;nil&lt;/code&gt; (so it thought it had to call isearch-cancel), but &lt;code&gt;isearch--current-buffer&lt;/code&gt; was &lt;code&gt;nil&lt;/code&gt; (so cancelling threw an error).&lt;/p&gt;&#xA;" OwnerUserId="12986" LastActivityDate="2017-01-20T15:38:58.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30115" PostTypeId="2" ParentId="30008" CreationDate="2017-01-20T15:46:44.713" Score="1" Body="&lt;p&gt;I also have had issues with hunspell.&#xA;Using the famous trial and error pattern, I ended-up with the following configuration:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;&lt;code&gt;.emacs&lt;/code&gt;&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;C:\\Path\\To\\Hunspell\\bin&quot;)&#xA;(setq ispell-program-name &quot;hunspell&quot;)&#xA;(use-package ispell&#xA; :init&#xA; (setq ispell-dictionary-alist &#xA;  '(&#xA;    (nil&#xA;     &quot;[[:alpha:]]&quot;&#xA;     &quot;[^[:alpha:]]&quot;&#xA;     &quot;[']&quot;&#xA;     t&#xA;     (&quot;-d&quot; &quot;default&quot; &quot;-p&quot; &quot;C:\\Path\\To\\HunspellDicts\\default&quot;)&#xA;     nil&#xA;     iso-8859-1)&#xA;&#xA;    (&quot;en_GB&quot;&#xA;     &quot;[[:alpha:]]&quot;&#xA;     &quot;[^[:alpha:]]&quot;&#xA;     &quot;[']&quot;&#xA;     t&#xA;     (&quot;-d&quot; &quot;en_GB&quot; &quot;-p&quot; &quot;C:\\Path\\To\\HunspellDicts\\en_GB&quot;)&#xA;     nil&#xA;     iso-8859-1)&#xA;    ))&#xA;(setq ispell-dictionary &quot;en_GB&quot;)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2451" LastActivityDate="2017-01-20T15:46:44.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30116" PostTypeId="2" ParentId="30110" CreationDate="2017-01-20T17:06:02.777" Score="2" Body="&lt;p&gt;The function &lt;code&gt;org-cycle-agenda-files&lt;/code&gt; is broken in &lt;code&gt;org-mode&lt;/code&gt; version 8.2.10 (which ships with Emacs 25.1).  Here is a working function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(when (version= org-version &quot;8.2.10&quot;)&#xA;  (defun org-cycle-agenda-files ()&#xA;    &quot;Cycle through the files in `org-agenda-files'.&#xA;If the current buffer visits an agenda file, find the next one in the list.&#xA;If the current buffer does not, find the first agenda file.&quot;&#xA;    (interactive)&#xA;    (let* ((fs (org-agenda-files t))&#xA;           (files (append fs (list (car fs))))&#xA;           (tcf (if buffer-file-name (file-truename buffer-file-name)))&#xA;           file)&#xA;      (unless files (user-error &quot;No agenda files&quot;))&#xA;      (catch 'exit&#xA;        (while (setq file (pop files))&#xA;          (if (equal (file-truename file) tcf)&#xA;              (when (car files)&#xA;                (find-file (car files))&#xA;                (throw 'exit t))))&#xA;        (find-file (car fs)))&#xA;      (if (buffer-base-buffer) (org-pop-to-buffer-same-window (buffer-base-buffer))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="105" LastEditDate="2019-09-05T04:22:49.107" LastActivityDate="2019-09-05T04:22:49.107" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30117" PostTypeId="1" AcceptedAnswerId="30195" CreationDate="2017-01-20T17:33:20.177" Score="1" ViewCount="533" Body="&lt;p&gt;I want to write a Makefile that handles org-export with ox-bibtex, e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%.pdf: %.org&#xA;        emacs $&amp;lt; --batch -l emacs-load.el -f org-latex-export-to-pdf --kill&#xA;&#xA;%.html: %.org&#xA;        emacs $&amp;lt; --batch -l emacs-load.el -f org-html-export-to-html --kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;emacs-load.el&lt;/code&gt; contains any elisp needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here start my problems:&#xA;I so far have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'exec-path &quot;./bibtex2html-1.98-linux/&quot;)&#xA;(add-to-list 'load-path &quot;./elisp&quot;)&#xA;(require 'org)&#xA;(load &quot;ox-bibtex.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the &lt;a href=&quot;http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/lisp/ox-bibtex.el;hb=HEAD&quot; rel=&quot;nofollow noreferrer&quot;&gt;ox-bibtex.el&lt;/a&gt; copied to &lt;code&gt;elisp&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the above configuration, I get &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol's function definition is void: org-element-insert-before&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I provide a function definition (i.e. from &lt;a href=&quot;https://github.com/yyr/org-mode/blob/master/lisp/org-element.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-element.el&lt;/a&gt;) org-link-types is void, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, I am missing something, but as it stands I do not know what to do in order to make ox-bibtex work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want the Makefile to be fully portable (i.e. not depend on a custom emacs configuration) for org-version &gt;= 8.0. (But its OK to require some files in the same directory or a subdirectory.)&lt;/p&gt;&#xA;" OwnerUserId="14220" LastActivityDate="2017-01-25T10:15:07.057" Title="org-export with ox-bibtex outside emacs" Tags="|org-mode|org-export|bibtex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30119" PostTypeId="1" AcceptedAnswerId="30120" CreationDate="2017-01-20T20:00:53.400" Score="-1" ViewCount="387" Body="&lt;p&gt;I'm looking for a way to set a variable that isn't buffer local in such a way that it will act like one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's possible to do it with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;nofollow noreferrer&quot;&gt;file local variables&lt;/a&gt;, but I haven't found a way to set a variable in this way from elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to rely on defining file local variables with comments inside of them.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastEditorUserId="105" LastEditDate="2017-01-20T21:09:43.543" LastActivityDate="2017-01-20T21:22:39.313" Title="Set a buffer/file local variable in elisp like a file local variable" Tags="|buffer-local|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30120" PostTypeId="2" ParentId="30119" CreationDate="2017-01-20T20:11:53.907" Score="5" Body="&lt;p&gt;If you want to set a buffer-local value for a variable, use &lt;code&gt;setq-local&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on what you are actually trying to accomplish, you may also want to look at the help for &lt;code&gt;make-local-variable&lt;/code&gt; and &lt;code&gt;make-variable-buffer-local&lt;/code&gt;. These functions do not actually set a value, but arrange for a variable to have a buffer-local value when set.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-01-20T21:22:39.313" LastActivityDate="2017-01-20T21:22:39.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30121" PostTypeId="2" ParentId="12910" CreationDate="2017-01-20T20:21:47.670" Score="0" Body="&lt;p&gt; helm-grep-do-git-grep&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if your are in hybrid mode, you need in &lt;strong&gt;'insert mode'&lt;/strong&gt;, because when you are in &lt;strong&gt;'emacs mode'&lt;/strong&gt;, you can use C-u to add an &lt;strong&gt;Prefix&lt;/strong&gt; and then use helm-grep-do-git-grep&lt;/p&gt;&#xA;" OwnerUserId="14634" LastActivityDate="2017-01-20T20:21:47.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30123" PostTypeId="1" CreationDate="2017-01-21T00:51:51.593" Score="1" ViewCount="402" Body="&lt;p&gt;I don't know Lisp unfortunately. I have a friend, and I really liked his color scheme/default Emacs setup. However, I hate his hotkeys and I am used to the ones that come as default with Emacs. Is there any relatively painless way to go into the .emacs file that he gave me and basically just remove &lt;em&gt;only&lt;/em&gt; his key bindings/hotkeys but keep all the visuals the way he has them? Again, please excuse my ignorance and frankly I usually get Emacs to &quot;just work&quot; to the point where I rarely actually have to edit the Lisp. &lt;strong&gt;By the way, I'm on Fedora 25.&lt;/strong&gt; Thank you.&lt;/p&gt;&#xA;" OwnerUserId="12555" LastActivityDate="2017-01-21T00:51:51.593" Title="Remove all custom key bindings/Reset key bindings to default" Tags="|key-bindings|init-file|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30124" PostTypeId="2" ParentId="30117" CreationDate="2017-01-21T00:55:59.233" Score="1" Body="&lt;p&gt;I'm pretty sure the reason that's happening is because the org contributed libraries are not in your load-path.  Ensure that directory is in your load path, and it should work.  See &lt;a href=&quot;http://orgmode.org/manual/Installation.html#Installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Installation - The Org Manual&lt;/a&gt; if you don't already have it installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you already have it locally something like this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/path/to/orgdir/contrib/lisp&quot; t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My preferred method of installing using the emacs package system.  Here's a link to the org package &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;repository&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-01-21T00:55:59.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30128" PostTypeId="1" CreationDate="2017-01-21T16:54:47.297" Score="1" ViewCount="640" Body="&lt;p&gt;I have some questions about emacs internal actions related to charset and fonts shown by &lt;code&gt;describe-char&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I use &lt;code&gt;utf-8&lt;/code&gt; as character encording scheme (CES) on emacs, so charsets shown by &lt;code&gt;describe-char&lt;/code&gt; are supposed to &quot;unicode&quot;. But since I often use Japanese kanji, the following configuration&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-language-environment &quot;Japanese&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is added. Then charset of kanjis is changed to &quot;japanese-jisx0208&quot; keeping CES to be &lt;code&gt;utf-8&lt;/code&gt; like the below (ex.kanji &quot;字&quot;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             position: 813 of 2102 (39%), column: 51&#xA;            character: 字 (displayed as 字) (codepoint 23383, #o55527, #x5b57)&#xA;    preferred charset: japanese-jisx0208 (JISX0208.1983/1990 Japanese Kanji: ISO-IR-87)&#xA;code point in charset: 0x3B7A&#xA;               script: han&#xA;               syntax: w    which means: word&#xA;             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable&#xA;             to input: type &quot;C-x 8 RET 5b57&quot;&#xA;          buffer code: #xE5 #xAD #x97&#xA;            file code: #xE5 #xAD #x97 (encoded by coding system utf-8-unix)&#xA;              display: by this font (glyph code)&#xA;    xft:-VL  -VL Gothic-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1 (#x15A9)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: CJK IDEOGRAPH-5B57&#xA;  general-category: Lo (Letter, Other)&#xA;  decomposition: (23383) ('字')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I considered &lt;code&gt;utf-8&lt;/code&gt; transforms characters of Unicode to byte codes not &quot;japanese-jisx0208&quot;, but the shown charset is &quot;japanese-jisx0208&quot;. So I have following two questions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Setting language environment of emacs &quot;Japanese&quot;, is the encording with &lt;code&gt;utf-8&lt;/code&gt; executed after the shwon charset &quot;japanese-jisx0208&quot; is transformed to &quot;unicode&quot; inside emacs?&lt;/li&gt;&#xA;&lt;li&gt;Depending on my first question, why the font of unicode (&lt;code&gt;-VL Gothic-normal-normal-normal-*-18-*-*-*-*-0-iso10646-1&lt;/code&gt;) is applied?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12626" LastEditorUserId="105" LastEditDate="2017-01-21T17:37:48.327" LastActivityDate="2017-01-21T17:37:48.327" Title="Charset and fonts shown by `describe-char`" Tags="|fonts|character-encoding|unicode|japanese|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30129" PostTypeId="1" CreationDate="2017-01-21T17:12:07.093" Score="6" ViewCount="778" Body="&lt;p&gt;From the &lt;em&gt;Vim User Manual&lt;/em&gt;: &lt;em&gt;02.5&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There's a special version of the undo command, the &quot;U&quot; (undo line)&#xA;  command. The undo line command undoes all the changes made on the last&#xA;  line that was edited.  Typing this command twice cancels the preceding&#xA;  &quot;U&quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I get this functionality when using evil-mode in Emacs? &lt;code&gt;U&lt;/code&gt; currently does nothing.&lt;/p&gt;&#xA;" OwnerUserId="14499" LastActivityDate="2018-07-16T21:46:21.030" Title="How can I implement Vim's `undo line` command in Emacs' evil-mode?" Tags="|evil|undo|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30130" PostTypeId="1" AcceptedAnswerId="30133" CreationDate="2017-01-21T17:51:14.237" Score="2" ViewCount="507" Body="&lt;p&gt;I have an org file and buffer named test.org that contains this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[https://en.wikipedia.org/wiki/Emacs#/media/File:Emacs_Dired_buffers.png][myimg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to put my cursor/point somewhere on this link and then run a function that downloads this png file and adjusts the link to something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[file:img/Emacs_Dired_buffers.png][myimg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use img/ because I prefer relative paths. So I'd like to download the picture to a subfolder which is in the same folder as my org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I can't find a solution.&lt;/p&gt;&#xA;" OwnerUserId="14096" LastActivityDate="2023-03-06T18:47:44.053" Title="org - hyperlink to external image: Function to download it and adjust link to local location?" Tags="|org-mode|hyperlinks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30131" PostTypeId="2" ParentId="30129" CreationDate="2017-01-21T20:32:19.787" Score="0" Body="&lt;p&gt;Typing &lt;code&gt;C-x u&lt;/code&gt; undoes one change on the last line edited.  If you follow that with a command that breaks the undo sequence, like &lt;code&gt;C-f&lt;/code&gt;, then hitting &lt;code&gt;C-x u&lt;/code&gt; again will cancel that undo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking to undo a change made to any arbitrary line, though, regardless of whether it is the last line edited, you can try out &quot;selective undo&quot;.  Type &lt;code&gt;M-x mark-line&lt;/code&gt;, then hit C-x u: hitting it repeatedly will take you through previous states of the line in the undo history, without touching the rest of the buffer.&lt;/p&gt;&#xA;" OwnerUserId="12422" LastActivityDate="2017-01-21T20:32:19.787" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30133" PostTypeId="2" ParentId="30130" CreationDate="2017-01-22T07:31:27.640" Score="2" Body="&lt;p&gt;You can easily build this functionality by getting at abo-abo's &lt;a href=&quot;https://github.com/abo-abo/org-download&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;org-download&quot;&gt;org-download&lt;/a&gt; package. Look at the command &lt;code&gt;org-download-image&lt;/code&gt; which takes an image address as its argument and downloads it to an attachment directory.&lt;/p&gt;&#xA;&lt;p&gt;For associating an image directory with an org document, I would always recommend to use the org attachment mechanism. I prefer to have a clear naming convention for attachments and my org documents. For an agenda it may be appropriate to have an attachment directory associated to a particular heading (task), but for authoring documents, I usually prefer a single attachment directory for the whole document. Currently I do this by setting the attachment dir to a directory I conventionally name &lt;code&gt;{documentname}-att/&lt;/code&gt;. Else an attachment will be created in &lt;code&gt;data/&lt;/code&gt; + some hash based on the current headline ID. I also add the &lt;em&gt;inherit&lt;/em&gt; property, so that all sub-headlines also inherit this setting.&lt;code&gt;C-c C-a&lt;/code&gt; brings you to the attachment dialogue where you get a menu for all of these options.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="38531" LastEditDate="2023-03-06T18:47:44.053" LastActivityDate="2023-03-06T18:47:44.053" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30135" PostTypeId="1" AcceptedAnswerId="30136" CreationDate="2017-01-22T14:27:09.177" Score="2" ViewCount="396" Body="&lt;p&gt;I'm trying to autoexport a file from orgmode to html, so I decided to make a function to check the major mode of the buffer and check if the buffer has open the file that I want to export but when I try it the function export all the orgmode files and not the one that I want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-mode-export-hook()&#xA;&quot;Auto export html&quot;&#xA;(when (eq major-mode 'org-mode)&#xA;    (when (eq buffer-file-name &quot;/home/rafa/org/to-read.org&quot;)&#xA;        (org-twbs-export-to-html t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me what I'm doing wrong?? &lt;/p&gt;&#xA;" OwnerUserId="13992" LastEditorUserId="105" LastEditDate="2017-01-22T15:55:45.423" LastActivityDate="2017-01-22T15:55:45.423" Title="Check if buffername is equal to file name" Tags="|org-mode|org-export|string|equality|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30136" PostTypeId="2" ParentId="30135" CreationDate="2017-01-22T15:49:38.860" Score="2" Body="&lt;p&gt;First, you don't want to test string-content equality using &lt;code&gt;eq&lt;/code&gt;. Use &lt;strong&gt;&lt;code&gt;equal&lt;/code&gt;&lt;/strong&gt; instead.  Or you can use &lt;code&gt;string-equal&lt;/code&gt;, if you are sure that &lt;code&gt;buffer-file-name&lt;/code&gt; will return a string in your context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, nodes &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Equality-Predicates.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Equality Predicates&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Comparison.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Text Comparison&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, consider using function &lt;code&gt;buffer-file-name&lt;/code&gt; instead of variable &lt;code&gt;buffer-file-name&lt;/code&gt;.  Not necessary, but a good habit, IMO.  (And you can use it in other contexts, where you pass a &lt;code&gt;BUFFER&lt;/code&gt; argument.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, you might need/want to use function &lt;code&gt;buffer-file-truename&lt;/code&gt; instead of &lt;code&gt;buffer-file-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only the first is important, probably: You cannot test string content using &lt;code&gt;eq&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-01-22T15:55:25.373" LastActivityDate="2017-01-22T15:55:25.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30137" PostTypeId="1" CreationDate="2017-01-22T15:59:39.117" Score="2" ViewCount="7646" Body="&lt;p&gt;I am using Emacs 24.4 on Windows 10. I only ever use it in &lt;code&gt;-nw&lt;/code&gt; (no-window) mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like Emacs to paste from the Windows clipboard &lt;em&gt;only&lt;/em&gt; on &lt;code&gt;Shift-Insert&lt;/code&gt; and not on yank (&lt;code&gt;Ctrl-y&lt;/code&gt;). I have tried this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-select-enable-clipboard nil)&#xA;(setq x-select-enable-primary nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this disables pasting from the Windows clipboard on &lt;em&gt;both&lt;/em&gt; &lt;code&gt;Shift-Insert&lt;/code&gt; and yank. I want &lt;code&gt;Shift-Insert&lt;/code&gt; to paste only from the Window clipboard and yank to paste only from the Emacs kill ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of what I want:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Copy the text &lt;code&gt;hello&lt;/code&gt; to the Windows clipboard.&lt;/li&gt;&#xA;&lt;li&gt;Start emacs.&lt;/li&gt;&#xA;&lt;li&gt;Do a yank (&lt;code&gt;Ctrl-y&lt;/code&gt;); desired result: nothing is inserted.&lt;/li&gt;&#xA;&lt;li&gt;Do a &lt;code&gt;Shift-Insert&lt;/code&gt;; desired result: &lt;code&gt;hello&lt;/code&gt; is inserted.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is this possible? If so, how?&lt;/p&gt;&#xA;" OwnerUserId="14651" LastEditorUserId="105" LastEditDate="2017-01-22T20:34:13.103" LastActivityDate="2017-05-24T13:13:44.433" Title="Paste Windows clipboard with Shift-Insert but not by yanking" Tags="|microsoft-windows|yank|kill-ring|clipboard|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30138" PostTypeId="1" CreationDate="2017-01-22T17:44:46.493" Score="1" ViewCount="222" Body="&lt;p&gt;I have a rather tall table (200-300 lines) being exported to html.  It would be nice to have the header visible at all times when scrolling to the lower entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far no googling has turned up a builtin solution, although &lt;a href=&quot;https://stackoverflow.com/a/29812382/5754992&quot;&gt;this&lt;/a&gt; shows how it can be done in general using only css.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-01-22T18:16:15.157" Title="Exporting tables to html with fixed header when scrolling" Tags="|org-mode|org-export|html|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30139" PostTypeId="2" ParentId="30138" CreationDate="2017-01-22T18:16:15.157" Score="3" Body="&lt;p&gt;This isn't a question about emacs behavior as much as it is about html and css.  Org mode adds several custom css classes, and these as well as standard css classes can be modified (see &lt;a href=&quot;http://orgmode.org/manual/CSS-support.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/CSS-support.html&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to modify this is by using &lt;code&gt;#+HTML_HEAD:&lt;/code&gt; in the file, with appropriate html. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD: &amp;lt;style type=&quot;text/css&quot;&amp;gt; thead tr{display:block;} tbody{overflow:auto;display:block;height:90vh;} &amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will give the desired behavior with tables, although it would be good to move to a css file if it gets much more complex.&lt;/p&gt;&#xA;" OwnerUserId="2823" LastActivityDate="2017-01-22T18:16:15.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30140" PostTypeId="2" ParentId="14263" CreationDate="2017-01-22T19:24:07.370" Score="7" Body="&lt;p&gt;You can use &lt;a href=&quot;https://github.com/dimitri/el-get&quot; rel=&quot;nofollow noreferrer&quot;&gt;el-get&lt;/a&gt; to install any specific revision of any package, from a git repo. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(el-get-bundle git-timemachine&#xA;  :checkout &quot;3.0&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will clone git-timemachine from github and checkout tag 3.0 and require git-timemachine. &lt;/p&gt;&#xA;" OwnerUserId="10428" LastEditorUserId="10428" LastEditDate="2018-06-08T16:48:24.333" LastActivityDate="2018-06-08T16:48:24.333" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="30141" PostTypeId="2" ParentId="30137" CreationDate="2017-01-22T20:16:01.100" Score="2" Body="&lt;p&gt;By default (at least in Emacs 25), &lt;code&gt;&amp;lt;S-Insert&amp;gt;&lt;/code&gt; is bound to the same command as &lt;code&gt;C-y&lt;/code&gt;: they both invoke the &lt;code&gt;yank&lt;/code&gt; command. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could try rebinding one of the them to &lt;code&gt;clipboard-yank&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;S-Insert&amp;gt;&quot;) #'clipboard-yank)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-01-22T20:16:01.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30142" PostTypeId="2" ParentId="918" CreationDate="2017-01-22T20:47:37.307" Score="1" Body="&lt;p&gt;Before loading your locally installed package in your ~.emacs~, make sure to unload the site-wide installed package.  The emacs-lisp function &lt;code&gt;unload-feature&lt;/code&gt; is your friend.  I do not which features provides CEDET in particular.  For a system-wide installed &lt;code&gt;auctex&lt;/code&gt;, however, you would do &lt;code&gt;(unload-feature 'tex-site)&lt;/code&gt;, for example. &lt;/p&gt;&#xA;" OwnerUserId="5254" LastActivityDate="2017-01-22T20:47:37.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30143" PostTypeId="1" AcceptedAnswerId="30145" CreationDate="2017-01-22T21:14:10.133" Score="1" ViewCount="464" Body="&lt;p&gt;On loading large files (&lt;a href=&quot;https://github.com/rust-lang/rust/blob/aedb49cbc9977fee56bb51a20980b380aca53659/src/libcollections/vec.rs&quot; rel=&quot;nofollow noreferrer&quot;&gt;~2000+ lines for example&lt;/a&gt;), flyspell takes a few seconds to Run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to have flyspell delay applying to the entire buffer on load?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only run on visible text for instance? Or run multiple processes to get the job done faster?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: this was caused by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'flyspell-mode-hook 'flyspell-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Think this question should be closed.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2019-05-23T13:12:48.677" LastActivityDate="2019-05-23T13:12:48.677" Title="How to improve flyspell performance loading files?" Tags="|flyspell|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="30144" PostTypeId="1" CreationDate="2017-01-22T21:51:47.567" Score="1" ViewCount="1072" Body="&lt;p&gt;The org mode export utilities in &lt;code&gt;ox-extra&lt;/code&gt; are very useful. However because these utilities are enabled in my &lt;code&gt;init.el&lt;/code&gt; file, I do not know how to enable or disable the utilities and a per document basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, my init.el contains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ox-extra)&#xA;(ox-extras-activate '(notignore-headlines))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This activates &lt;code&gt;notignore-headlines&lt;/code&gt; globally. Can this instead be activated  on a per document basis?&lt;/p&gt;&#xA;" OwnerUserId="9382" LastActivityDate="2017-07-23T01:43:38.360" Title="Activate ox-extras on a per document basis" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30145" PostTypeId="2" ParentId="30143" CreationDate="2017-01-22T22:00:15.417" Score="1" Body="&lt;p&gt;While not delaying flyspell, this suggestion is offered by the &lt;a href=&quot;https://www.emacswiki.org/emacs/FlySpell&quot; rel=&quot;nofollow noreferrer&quot;&gt;wiki&lt;/a&gt; for flyspell performance in general:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I highly suggest setting ‘flyspell-issue-message-flag’ to nil, as&#xA;  printing messages for every word (when checking the entire buffer)&#xA;  causes an enormous slowdown. – nschum&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9382" LastActivityDate="2017-01-22T22:00:15.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30146" PostTypeId="2" ParentId="918" CreationDate="2017-01-22T22:52:18.073" Score="0" Body="&lt;p&gt;From the Debian policy document that you link to:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;/etc/emacs/site-start.el is a conffile, and is owned by&#xA;    emacsen-common.  This file should not be modified by &lt;em&gt;any&lt;/em&gt; add-on&#xA;    packages, or by any emacsen package maintainer.  It is solely for&#xA;    the use of the local admin.  It should be empty unless the local&#xA;    admin modifies it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That means, there shouldn't be anything in &lt;code&gt;/etc/emacs/site-start.el&lt;/code&gt; unless you (or whomever administers your computer) explicitly put it there. If that's not the case, this is a bug that should be reported to the Ubuntu or Debian maintainers.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-22T22:52:18.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30147" PostTypeId="1" AcceptedAnswerId="30148" CreationDate="2017-01-22T23:13:48.280" Score="17" ViewCount="2254" Body="&lt;p&gt;I don't like the way electric indent mode works in latex-mode. Everywhere else (at least everywhere I use), it's great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I permanently disable electric indent mode for latex mode only, but keep it everywhere else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm guessing it's a one-line lisp hack in my config file, or something like that, but I'm horrible at lisp, so I can't figure it out.&lt;/p&gt;&#xA;" OwnerUserId="14652" LastActivityDate="2017-01-23T01:19:44.793" Title="Disabling electric-indent-mode for one mode (latex mode) only" Tags="|major-mode|minor-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30148" PostTypeId="2" ParentId="30147" CreationDate="2017-01-23T01:19:44.793" Score="15" Body="&lt;p&gt;The command you need is &lt;code&gt;electric-indent-local-mode&lt;/code&gt;. You can use this to turn off electric-indent-mode in any buffer by calling it manually: &lt;code&gt;M-x electric-indent-local-mode&lt;/code&gt;. This is a toggle, so calling it again in the same buffer turns it back on again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this automatically from your init file, you need to set up a hook. First, define the hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun remove-electric-indent-mode ()&#xA;  (electric-indent-local-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then add it to the appropriate mode hooks. To turn off electric-indent-mode for the LaTeX mode provided by AUCTex, use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'LaTeX-mode-hook 'remove-electric-indent-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the default texmode, use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'tex-mode-hook 'remove-electric-indent-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same pattern holds for any other mode you want to turn off electric indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more details on mode hooks, see the built-in Emacs manual node &lt;code&gt;[(emacs) Hooks][1]&lt;/code&gt;. You can get there from Emacs via &lt;code&gt;C-h i r m Hooks &amp;lt;enter&amp;gt;&lt;/code&gt;: &lt;code&gt;C-h&lt;/code&gt; for help, &lt;code&gt;i&lt;/code&gt; for info, &lt;code&gt;r&lt;/code&gt; for read the manual, &lt;code&gt;m&lt;/code&gt; for menu item, and &lt;code&gt;Hooks&lt;/code&gt; to pick the menu item. (or you can follow the link above to see the html version).&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-23T01:19:44.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30149" PostTypeId="2" ParentId="9528" CreationDate="2017-01-23T03:16:38.390" Score="4" Body="&lt;p&gt;The manual on &lt;a href=&quot;http://orgmode.org/manual/Special-symbols.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Special Symbols&lt;/a&gt; says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you would like to see entities displayed as UTF-8 characters, use&#xA;  the following command:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;C-c C-x \&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Toggle display of entities as UTF-8 characters. This does not change the buffer content which remains plain ASCII, but it overlays&#xA;  the UTF-8 character for display purposes only.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can turn this on by default by setting the variable &lt;code&gt;org-pretty-entities&lt;/code&gt;, or on a per-file base with the option &lt;code&gt;#+STARTUP: entitiespretty&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12751" LastActivityDate="2017-01-23T03:16:38.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30150" PostTypeId="2" ParentId="26991" CreationDate="2017-01-23T04:02:32.960" Score="9" Body="&#xA;&#xA;&lt;p&gt;As of 2017, Jan 22, if you set &lt;code&gt;org-src-tab-acts-natively&lt;/code&gt; and &lt;code&gt;org-src-fontify-natively&lt;/code&gt;, then TAB in source blocks will expand snippets of the block's language.  You may want to set &lt;code&gt;yas-buffer-local-condition&lt;/code&gt; to stop org mode snipppets from shadowing the block mode's snippets:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-org-mode-hook ()&#xA;  (setq-local yas-buffer-local-condition&#xA;              '(not (org-in-src-block-p t))))&#xA;(add-hook 'org-mode-hook #'my-org-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://github.com/joaotavora/yasnippet/issues/761&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/joaotavora/yasnippet/issues/761&lt;/a&gt;, &lt;a href=&quot;https://github.com/joaotavora/yasnippet/pull/760&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/joaotavora/yasnippet/pull/760&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-01-23T04:02:32.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30151" PostTypeId="2" ParentId="30144" CreationDate="2017-01-23T05:25:06.287" Score="1" Body="&lt;p&gt;It looks like that support is on the &lt;code&gt;org-extra&lt;/code&gt; to-do list (from &lt;code&gt;org-extra.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; TODO:&#xA;;; - add a function to org-mode-hook that looks for a ox-extras local&#xA;;;   variable and activates the specified extras buffer-locally&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the meantime you can circumvent &lt;code&gt;ox-extras-activate&lt;/code&gt; by adding something like this to the top of the file you want it active for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- eval: (progn (require 'ox-extra) (add-hook 'org-export-filter-parse-tree-functions 'org-export-notignore-headlines nil t)); -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(judging from this commit: &lt;a href=&quot;https://github.com/boykov/org-mode/compare/ox-extra-notignore&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/boykov/org-mode/compare/ox-extra-notignore&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you need to pass the &lt;code&gt;LOCAL&lt;/code&gt; &lt;code&gt;t&lt;/code&gt; argument to &lt;code&gt;add-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2017-01-23T05:30:39.913" LastActivityDate="2017-01-23T05:30:39.913" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30152" PostTypeId="1" CreationDate="2017-01-23T05:42:37.927" Score="3" ViewCount="647" Body="&lt;p&gt;In linux, the desktop environment stores the proxy settings. These proxy settings are then picked up by applications running for that instance of the desktop environment for a particular user. Your browsers. terminal etc, pick up these settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of the GNOME terminal, it sets the HTTP_PROXY and HTTPS_PROXY variable while starting the shell. The values for these variables are set by terminal when it starts up and are valid for the duration of the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we do something similarly in emacs other than setting up the proxy using the &lt;code&gt;set_proxy&lt;/code&gt; function in our init file? Can we set up a generic function that will pick up these settings from the desktop environment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Starting emacs from the terminal and it picking up the proxy variables from the terminal environment is not the answer what I am looking for. I am specifically trying to find how emacs accesses Desktop Environment settings.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="12901" LastEditorUserId="262" LastEditDate="2019-05-01T19:38:21.667" LastActivityDate="2019-05-01T19:38:21.667" Title="Can we pick our emacs proxy settings from the Broader settings set by our desktop environment?" Tags="|proxy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30153" PostTypeId="1" AcceptedAnswerId="31122" CreationDate="2017-01-23T07:22:29.197" Score="0" ViewCount="449" Body="&lt;p&gt;I am aware of the syntax for creating repeated tasks in org-mode, but for some reason I am now unable to manually edit the text of the &quot;Scheduled&quot; and &quot;Deadline&quot; date fields to do this, unless I do the workaround described below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example date field as it appears in my org-buffer:&#xA;&lt;code&gt;&#xA;    **** TODO [#B] Order kitty litter&#xA;DEADLINE: &amp;lt;2017-02-07&amp;gt;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example date field as copied and pasted:&#xA;&lt;code&gt;&#xA;    **** TODO [#B] Order kitty litter&#xA;DEADLINE: &amp;lt;2017-02-07 Tue + = &amp;gt;&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I place the point before the closing angle bracket, as I would normally do to add repeating-event syntax, I cannot type. The only way I can edit this date field manually is if I first move the point to the opening angle bracket and destroy the syntax by adding a random character, e.g. &lt;code&gt;&amp;lt;a2017-02-07.&lt;/code&gt;, which turns the filed into plain text. I can then move the point to the closing bracket, add the repeat syntax, and then remove the character I inserted to make it editable. But this is not behavior I have encountered before, so something must have changed in my config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone point me to a config variable or other problem that might be the culprit? For example, where is that hidden &lt;code&gt;+ =&lt;/code&gt; text before the closing bracket coming from? &lt;/p&gt;&#xA;" OwnerUserId="13854" LastActivityDate="2017-02-28T11:03:42.510" Title="I cannot manually edit date fields before closing bracket in org-mode buffer" Tags="|org-mode|org-agenda|time-date|calendar|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30155" PostTypeId="2" ParentId="30152" CreationDate="2017-01-23T10:39:38.947" Score="1" Body="&lt;p&gt;As per &lt;a href=&quot;https://stackoverflow.com/a/38385856/7456937&quot;&gt;M.W.'s Answer to a Similar Question&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs populates the &lt;code&gt;url-proxy-services&lt;/code&gt; variable from the &lt;code&gt;http_proxy&lt;/code&gt;, &lt;code&gt;https_proxy&lt;/code&gt; and &lt;code&gt;no_proxy&lt;/code&gt; environment variables if they are set. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can then start your &lt;code&gt;emacsclient&lt;/code&gt; from you GNOME terminal, just make sure that all variants (lowercase and capitalized) of the proxy variables are exported in your &lt;code&gt;~/.bashrc&lt;/code&gt;, or &lt;code&gt;~/.zshrc&lt;/code&gt;, or &lt;code&gt;~/.profile&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case your &lt;code&gt;emacs&lt;/code&gt; session will obviously be bound to the instance of your GNOME terminal.&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-01-23T10:39:38.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30156" PostTypeId="2" ParentId="28835" CreationDate="2017-01-23T11:03:16.160" Score="-2" Body="&lt;p&gt;I would suggest you keep your &lt;code&gt;init.el&lt;/code&gt; under version control either publicly in Github or privately in BitBucket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, have you considered using the community-driven Emacs distribution called &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Spacemacs&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjusting themes is particularly &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bthemes/theming&quot; rel=&quot;nofollow noreferrer&quot;&gt;easy&lt;/a&gt; in Spacemacs, and there is a vast &lt;a href=&quot;http://themegallery.robdor.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;vast number&lt;/a&gt; of themes to choose from.&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="13326" LastEditDate="2017-01-23T11:20:58.970" LastActivityDate="2017-01-23T11:20:58.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30158" PostTypeId="2" ParentId="28835" CreationDate="2017-01-23T15:34:04.847" Score="0" Body="&lt;p&gt;Yes you can add this to your init.el but I recomend you to create a init.el in your home directory, and make this file to load the one you have in dropbox. So yo create a file wich have the following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load-file &quot;&amp;lt;your-path-to-dropbox&amp;gt;/yourdropboxinit.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think this is the better solution for you.&lt;/p&gt;&#xA;" OwnerUserId="13992" LastActivityDate="2017-01-23T15:34:04.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30159" PostTypeId="2" ParentId="28810" CreationDate="2017-01-23T18:02:40.323" Score="1" Body="&lt;p&gt;Might be a little late for an answer but here it goes anyway. If you search &lt;code&gt;ox-odt.el&lt;/code&gt; you can see that the error message you're getting comes from &lt;code&gt;org-odt--export-wrap&lt;/code&gt; which is the macro called by &lt;code&gt;org-odt-export-to-odf&lt;/code&gt; and &lt;code&gt;org-odt-export-to-odt&lt;/code&gt; to create the actual &lt;code&gt;ODT&lt;/code&gt; file. Inside &lt;code&gt;ox-odt--export-wrap&lt;/code&gt; there is this little piece of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(unless (executable-find &quot;zip&quot;)&#xA;     ;; Not at all OSes ship with zip by default&#xA;     (error &quot;Executable \&quot;zip\&quot; needed for creating OpenDocument files&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that will prevent the process to continue unless the &lt;code&gt;zip&lt;/code&gt; excecutable exists in your &lt;code&gt;PATH&lt;/code&gt;. Also a few lines below there's this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(cmds `((&quot;zip&quot; &quot;-mX0&quot; ,target-name &quot;mimetype&quot;)&#xA;          (&quot;zip&quot; &quot;-rmTq&quot; ,target-name &quot;.&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which defines how to call the &lt;code&gt;zip&lt;/code&gt; command in order to create an &lt;code&gt;ODT&lt;/code&gt; file. Considering all of the above you have at least three options here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Modify the &lt;code&gt;ox-odt.el&lt;/code&gt; file so it uses the &lt;code&gt;7z&lt;/code&gt; command instead of &lt;code&gt;zip&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Wrap your calls to &lt;code&gt;7z&lt;/code&gt; into some kind of &lt;code&gt;zip.cmd&lt;/code&gt; command.&lt;/li&gt;&#xA;&lt;li&gt;Download &lt;code&gt;zip&lt;/code&gt; for Windows, in fact you should get &lt;a href=&quot;http://wiki.github.com/bmatzelle/gow/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU on Windows&lt;/a&gt; or &lt;a href=&quot;http://wiki.github.com/bmatzelle/gow/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cygwin&lt;/a&gt;, any of them will save you a lot of troubles while working with Emacs.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="14428" LastActivityDate="2017-01-23T18:02:40.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30160" PostTypeId="1" AcceptedAnswerId="30163" CreationDate="2017-01-23T19:12:59.447" Score="3" ViewCount="600" Body="&lt;p&gt;I defined emacsclient as default editor in &lt;code&gt;.bashrc&lt;/code&gt; so emacs -daemon will be called upon startup:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;export ALTERNATE_EDITOR=&amp;quot;&amp;quot;&#xA;export EDITOR=emacsclient&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But compared to a normal load without client, if I call &lt;code&gt;emacsclient afile&lt;/code&gt;, then some ui elements are missing, like the scrollbar, which will disappear, and the speedbar pictures, which will be replaced with &amp;quot;+&amp;quot; sign. Apparently the init file is not fully loaded by emacs daemon? What could possibly caused the difference and how can it be fixed?&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3P9to.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3P9to.jpg&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;a)&lt;/strong&gt; Above is a normal load with &lt;strong&gt;emacs afile&lt;/strong&gt;, same with &lt;strong&gt;emacs ; emacsclient -c afile&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;b)&lt;/strong&gt; Below is a client load with &lt;strong&gt;emacsclient -c afile&lt;/strong&gt; after &lt;strong&gt;emacs --daemon &amp;amp;&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="13594" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-01-23T20:43:06.523" Title="emacs --daemon is not loading gui elements" Tags="|emacsclient|daemon|emacs-daemon|speedbar|scroll-bars|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30162" PostTypeId="1" AcceptedAnswerId="30164" CreationDate="2017-01-23T20:35:37.507" Score="1" ViewCount="2020" Body="&lt;p&gt;Suppose I already opened a emacs but its in the background. So, is there an emacsclient eval option that I can type in the shell like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &quot;(bring-existing-emacs-window-to-front)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To bring the background emacs window to the front?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be pretty handy, since I'm always using &#xA;&lt;code&gt;emacsclient -c --eval &quot;(find-file \&quot;afile\&quot;)&quot;&lt;/code&gt;. Which unfortunately opens the frame in the background instead of front. &lt;/p&gt;&#xA;" OwnerUserId="13594" LastActivityDate="2017-01-23T20:44:08.640" Title="emacsclient --eval command to bring a background emacs window to front" Tags="|emacsclient|find-file|eval|eval-expression|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30163" PostTypeId="2" ParentId="30160" CreationDate="2017-01-23T20:43:06.523" Score="3" Body="&lt;p&gt;I imagine you have code running at init time which checks to see whether or not you are running a GUI emacs (via &lt;code&gt;display-graphic-p&lt;/code&gt; or similar), and configures certain settings based on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(display-graphic-p)&lt;/code&gt; returns &lt;code&gt;t&lt;/code&gt; at init time when a GUI non-daemon Emacs starts, because a graphical frame is created beforehand; but that function call returns &lt;code&gt;nil&lt;/code&gt; at init time when a daemon starts, as no GUI frame is current at that time (and obviously the daemon has no idea whether any GUI frames are ever &lt;em&gt;going&lt;/em&gt; to exist).&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-01-23T20:43:06.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30164" PostTypeId="2" ParentId="30162" CreationDate="2017-01-23T20:44:08.640" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;select-frame-set-input-focus&lt;/code&gt; to give focus to a given frame:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval '(progn&#xA;                      (find-file &quot;file.txt&quot;)&#xA;                      (select-frame-set-input-focus (selected-frame)))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, if you only want to open a file, don't use &lt;code&gt;--eval&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c file.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2526" LastActivityDate="2017-01-23T20:44:08.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30165" PostTypeId="1" CreationDate="2017-01-23T21:11:17.107" Score="3" ViewCount="1585" Body="&lt;p&gt;I want to install the company mode, but searching in the &lt;code&gt;M-x list-packages&lt;/code&gt; i find no company mode found, but a bunch of company backends for different languages. How should i install company? &#xA;PS: This is my init.el file beginning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package) &#xA;&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;) t)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;melpa-stable&quot; . &quot;https://stable.melpa.org/packages/&quot;) t)&#xA;;; elpy&#xA;(add-to-list 'package-archives&#xA;         '(&quot;elpy&quot; . &quot;http://jorgenschaefer.github.io/packages/&quot;) t)&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;&#xA;(package-initialize) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user12021" LastEditorDisplayName="user12021" LastEditDate="2017-01-26T20:54:48.750" LastActivityDate="2017-01-26T20:54:48.750" Title="No company mode found in packages list" Tags="|company-mode|completion|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30168" PostTypeId="1" CreationDate="2017-01-23T23:16:00.573" Score="1" ViewCount="693" Body="&lt;p&gt;In an &lt;code&gt;org-mode&lt;/code&gt; table, I have a cell with a long line of text.  How do I fold that line/cell so that its column won't be too wide on the screen?&lt;/p&gt;&#xA;" OwnerUserId="12702" LastEditorUserId="253" LastEditDate="2017-01-23T23:32:00.870" LastActivityDate="2017-01-23T23:32:00.870" Title="How to fold a cell of table in org mode?" Tags="|org-mode|org-table|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30169" PostTypeId="1" AcceptedAnswerId="30175" CreationDate="2017-01-23T23:53:39.540" Score="5" ViewCount="2182" Body="&lt;p&gt;I'm using org to store a list of links, I capture the links with org-capture and a custom template, but I want to write the new entries at top of the file. how I can do this?&lt;/p&gt;&#xA;" OwnerUserId="13992" LastActivityDate="2020-01-10T08:24:14.593" Title="Set org-capture datetree write on top of the file" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30170" PostTypeId="2" ParentId="30165" CreationDate="2017-01-24T01:52:25.130" Score="3" Body="&lt;p&gt;The bit of configuration you provided does not actually evaluate, so I suspect your package list is not configured correctly. (Try it: copy your &lt;code&gt;add-to-list&lt;/code&gt; code above in to a scratch buffer and then call &lt;code&gt;M-x eval-buffer&lt;/code&gt; to see the error.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;C-h v package-archives&lt;/code&gt; to check the value. Or try the Customize interface, with: &lt;code&gt;M-x customize-option package-archives&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;company&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; part of the standard Emacs distribution and must be installed. However, it &lt;em&gt;is&lt;/em&gt; available in the GNU ELPA repository, which should already be configured in the default &lt;code&gt;package-archives&lt;/code&gt;. So you should be able to start Emacs without any custom configuration and use &lt;code&gt;package-install&lt;/code&gt; to install it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;https://elpa.gnu.org/packages/company.html&quot;&gt;https://elpa.gnu.org/packages/company.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-01-24T01:52:25.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30171" PostTypeId="1" CreationDate="2017-01-24T05:28:41.307" Score="6" ViewCount="8983" Body="&lt;p&gt;I want to be able to toggle soft-wrapped lines in org-mode. My &lt;code&gt;.emacs&lt;/code&gt; file has this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;;;;;;;;;;;;&#xA;;; Org Mode ;;&#xA;;;;;;;;;;;;;;;&#xA;&#xA;(global-set-key &quot;\C-cl&quot; 'org-store-link)&#xA;(global-set-key &quot;\C-ca&quot; 'org-agenda)&#xA;(global-set-key &quot;\C-cc&quot; 'org-capture)&#xA;(global-set-key &quot;\C-cb&quot; 'org-iswitchb)&#xA;&#xA;;; Start-up with soft-wrap enabled&#xA;(setq org-startup-truncated nil)  ; This works&#xA;;; Toggle soft-wrap with super-q&#xA;(define-key org-mode-map &quot;s-q&quot; 'toggle-truncate-lines)  ; This doesn't&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to map it to something like &lt;code&gt;super-q&lt;/code&gt; or &lt;code&gt;F7&lt;/code&gt;. Is there something wrong with my syntax? Neither works.&lt;/p&gt;&#xA;" OwnerUserId="14662" LastEditorUserId="105" LastEditDate="2017-01-24T16:52:14.347" LastActivityDate="2023-07-01T03:06:07.203" Title="How do I toggle soft-wrapped lines in org-mode?" Tags="|org-mode|wrapping|line-truncation|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30172" PostTypeId="2" ParentId="30165" CreationDate="2017-01-24T06:25:27.120" Score="2" Body="&lt;p&gt;&lt;code&gt;'package-archives&lt;/code&gt; is a list of dotted pairs. So your code should be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives&#xA;      '((&quot;elpy&quot; . &quot;http://jorgenschaefer.github.io/packages/&quot;)&#xA;        (&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)&#xA;        (&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;        (&quot;melpa-stable&quot; . &quot;https://stable.melpa.org/packages/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14378" LastActivityDate="2017-01-24T06:25:27.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30173" PostTypeId="1" AcceptedAnswerId="30174" CreationDate="2017-01-24T07:02:52.187" Score="2" ViewCount="342" Body="&lt;p&gt;Suppose you save the following code to some file test.el and then do &lt;code&gt;load-file test.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; -*- lexical-binding: t -*-&#xA;&#xA;(let ((closure-vbl 0))&#xA;  (defun tst ()&#xA;    (eval 'closure-vbl)))&#xA;&#xA;(tst)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You get the error &lt;code&gt;tst: Symbol's value as variable is void: closure-vbl&lt;/code&gt;. (Replacing &lt;code&gt;(eval 'closure-vbl)&lt;/code&gt; with &lt;code&gt;(symbol-function 'closure-vbl)&lt;/code&gt; gives the same error.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this? I don't understand what is wrong with the above code? Am I miunderstanding some property of emacs closures? Or are they simply not developed enough to deal with non-trivial situations.&lt;/p&gt;&#xA;" OwnerUserId="12148" LastActivityDate="2017-01-24T08:03:05.023" Title="Why does this straightforward use of a closure fail?" Tags="|lexical-scoping|closures|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30174" PostTypeId="2" ParentId="30173" CreationDate="2017-01-24T08:03:05.023" Score="4" Body="&lt;p&gt;There's a few pitfalls here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Using &lt;code&gt;eval&lt;/code&gt; with &lt;code&gt;lexical-binding&lt;/code&gt; will fail unless you pass it an alist environment argument holding the bindings in question (see &lt;code&gt;F1 f eval&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Looking up symbol slots only behaves correctly with dynamic scoping, if you attempt it despite this, you'll get the global value (see &lt;code&gt;F1 f symbol-value&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;FWIW, this is what I'd call the straight-forward use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- lexical-binding: t; -*-&#xA;&#xA;(let ((closure-variable 0))&#xA;  (defun test ()&#xA;    closure-variable))&#xA;&#xA;(test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-01-24T08:03:05.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30175" PostTypeId="2" ParentId="30169" CreationDate="2017-01-24T08:10:47.517" Score="9" Body="&lt;p&gt;From the &lt;a href=&quot;http://orgmode.org/manual/Template-elements.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org-Mode Manual&lt;/a&gt;, you can add the following template element to your custom captures:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;:prepend t&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Normally new captured information will be appended at the target location (last child, last table line, last list item...).&#xA;  Setting this property will change that.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the related post &lt;a href=&quot;https://stackoverflow.com/questions/11116712/using-properties-in-org-mode-capture-templates#11127795&quot;&gt;Using properties in org-mode capture templates&lt;/a&gt;, where for example you can achieve the desired effect by using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;w&quot; &quot;Default template&quot; entry (file+headline (concat (file-name-as-directory org-directory) &quot;journal.org&quot;) &quot;Notes&quot;)&#xA; &quot;* TODO [#C] %^{Title} %?&quot; :prepend t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="21299" LastEditDate="2020-01-10T08:24:14.593" LastActivityDate="2020-01-10T08:24:14.593" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="30176" PostTypeId="1" CreationDate="2017-01-24T11:44:30.663" Score="3" ViewCount="926" Body="&lt;p&gt;Occasionally I get error from &lt;code&gt;mu4e&lt;/code&gt; &lt;code&gt;error in process sentinel: Database is locked by another process&lt;/code&gt;. To solve this issue I usually end up to kill the process in &lt;code&gt;list-process&lt;/code&gt; or sometimes &lt;code&gt;pkill emacs&lt;/code&gt; in bash. That had been very frustrating so I thought about killing &lt;code&gt;*mu4e-prcess*&lt;/code&gt; every time some &lt;code&gt;mu4e&lt;/code&gt; command ends up executing. In a lisp I do implement it with advice&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-mu4e-kill (frm &amp;amp;rest args)&#xA;  (mu4e~proc-kill)&#xA;)&#xA;&#xA;(advice-add 'mu4e~proc-send-command :after #'my-mu4e-kill)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Briefly testing I was able to open multiple &lt;code&gt;mu4e&lt;/code&gt; instances and look into maildirs and mail. But I came across two issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First one is that &lt;code&gt;mu4e&lt;/code&gt; does not wait for update process to finish before it exits. Second one is that I no longer are able to open &lt;code&gt;mu4e&lt;/code&gt; starting it with command &lt;code&gt;emacsclient -c -e &quot;(mu4e)&quot;&lt;/code&gt; from which I get an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*ERROR*: Lisp nesting exceeds ‘max-lisp-eval-depth’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while &lt;code&gt;emacs --eval &quot;(mu4e)&quot;&lt;/code&gt; works fine!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why I am getting these errors and is it possible to resolve them in my &lt;code&gt;.emacs&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="6848" LastActivityDate="2017-01-24T11:44:30.663" Title="mu4e without mu server process" Tags="|mu4e|advice|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30177" PostTypeId="1" CreationDate="2017-01-24T13:02:25.757" Score="4" ViewCount="3531" Body="&lt;p&gt;i'm trying to have the key TAB to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Indent my code (like in any other text editor)&lt;/li&gt;&#xA;&lt;li&gt;Trigger Yasnippet&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have theses lines in my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;TAB&quot;) 'yas-expand)&#xA;(global-set-key (kbd &quot;TAB&quot;) 'self-insert-command);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When i comment one, the other work perfectly, but when i uncomment both, only the last one work. Is it possible to have two functions assign to the same key and emacs know when it should use one instead of the other ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: If i comment both lines, neither indent or yas-expand work :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i comment both line, writing a snippet and pressing TAB doesn't expand it. If i press TAB anywhere in my code, it doesn't add a tabulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With only one line uncommented, the function work perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With two lines uncommented, only the last line work (i guess it override the other as i use the same key).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i press &lt;strong&gt;C-h k TAB&lt;/strong&gt;, i have this with both lines commented:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;tab runs the command widget-forward (found in spacemacs-buffer-mode-map),&#xA;  which is an interactive compiled Lisp function in ‘wid-edit.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to TAB, J, ,  TAB.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(widget-forward ARG)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Move point to the next field or button.&#xA;  With optional ARG, move across that many fields.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My config file (note that i use Spacemacs, a special version of Emacs):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; -*- mode: emacs-lisp -*-&#xA;;; This file is loaded by Spacemacs at startup.&#xA;;; It must be stored in your home directory.&#xA;&#xA;(defun dotspacemacs/layers ()&#xA;  &quot;Configuration Layers declaration.&#xA;You should not put any user code in this function besides modifying the variable&#xA;values.&quot;&#xA;  (setq-default&#xA;   ;; Base distribution to use. This is a layer contained in the directory&#xA;   ;; `+distribution'. For now available distributions are `spacemacs-base'&#xA;   ;; or `spacemacs'. (default 'spacemacs)&#xA;   dotspacemacs-distribution 'spacemacs&#xA;   ;; Lazy installation of layers (i.e. layers are installed only when a file&#xA;   ;; with a supported type is opened). Possible values are `all', `unused'&#xA;   ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers&#xA;   ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will&#xA;   ;; lazy install any layer that support lazy installation even the layers&#xA;   ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy&#xA;   ;; installation feature and you have to explicitly list a layer in the&#xA;   ;; variable `dotspacemacs-configuration-layers' to install it.&#xA;   ;; (default 'unused)&#xA;   dotspacemacs-enable-lazy-installation 'unused&#xA;   ;; If non-nil then Spacemacs will ask for confirmation before installing&#xA;   ;; a layer lazily. (default t)&#xA;   dotspacemacs-ask-for-lazy-installation t&#xA;   ;; If non-nil layers with lazy install support are lazy installed.&#xA;   ;; List of additional paths where to look for configuration layers.&#xA;   ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')&#xA;   dotspacemacs-configuration-layer-path '()&#xA;   ;; List of configuration layers to load.&#xA;   dotspacemacs-configuration-layers&#xA;   '(&#xA;     python&#xA;     c-c++&#xA;     ;; ----------------------------------------------------------------&#xA;     ;; Example of useful layers you may want to use right away.&#xA;     ;; Uncomment some layer names and press &amp;lt;SPC f e R&amp;gt; (Vim style) or&#xA;     ;; &amp;lt;M-m f e R&amp;gt; (Emacs style) to install them.&#xA;     ;; ----------------------------------------------------------------&#xA;     helm&#xA;     auto-completion&#xA;     ;; better-defaults&#xA;     emacs-lisp&#xA;     ;; git&#xA;     ;; markdown&#xA;     ;; org&#xA;     ;; (shell :variables&#xA;     ;;        shell-default-height 30&#xA;     ;;        shell-default-position 'bottom)&#xA;     ;; spell-checking&#xA;     syntax-checking&#xA;     ;; version-control&#xA;     latex&#xA;     themes-megapack&#xA;     )&#xA;   ;; List of additional packages that will be installed without being&#xA;   ;; wrapped in a layer. If you need some configuration for these&#xA;   ;; packages, then consider creating a layer. You can also put the&#xA;   ;; configuration in `dotspacemacs/user-config'.&#xA;   dotspacemacs-additional-packages '()&#xA;   ;; A list of packages that cannot be updated.&#xA;   dotspacemacs-frozen-packages '()&#xA;   ;; A list of packages that will not be installed and loaded.&#xA;   dotspacemacs-excluded-packages '()&#xA;   ;; Defines the behaviour of Spacemacs when installing packages.&#xA;   ;; Possible values are `used-only', `used-but-keep-unused' and `all'.&#xA;   ;; `used-only' installs only explicitly used packages and uninstall any&#xA;   ;; unused packages as well as their unused dependencies.&#xA;   ;; `used-but-keep-unused' installs only the used packages but won't uninstall&#xA;   ;; them if they become unused. `all' installs *all* packages supported by&#xA;   ;; Spacemacs and never uninstall them. (default is `used-only')&#xA;   dotspacemacs-install-packages 'used-only))&#xA;&#xA;(defun dotspacemacs/init ()&#xA;  &quot;Initialization function.&#xA;This function is called at the very startup of Spacemacs initialization&#xA;before layers configuration.&#xA;You should not put any user code in there besides modifying the variable&#xA;values.&quot;&#xA;  ;; This setq-default sexp is an exhaustive list of all the supported&#xA;  ;; spacemacs settings.&#xA;  (setq-default&#xA;   ;; If non nil ELPA repositories are contacted via HTTPS whenever it's&#xA;   ;; possible. Set it to nil if you have no way to use HTTPS in your&#xA;   ;; environment, otherwise it is strongly recommended to let it set to t.&#xA;   ;; This variable has no effect if Emacs is launched with the parameter&#xA;   ;; `--insecure' which forces the value of this variable to nil.&#xA;   ;; (default t)&#xA;   dotspacemacs-elpa-https t&#xA;   ;; Maximum allowed time in seconds to contact an ELPA repository.&#xA;   dotspacemacs-elpa-timeout 5&#xA;   ;; If non nil then spacemacs will check for updates at startup&#xA;   ;; when the current branch is not `develop'. Note that checking for&#xA;   ;; new versions works via git commands, thus it calls GitHub services&#xA;   ;; whenever you start Emacs. (default nil)&#xA;   dotspacemacs-check-for-update nil&#xA;   ;; If non-nil, a form that evaluates to a package directory. For example, to&#xA;   ;; use different package directories for different Emacs versions, set this&#xA;   ;; to `emacs-version'.&#xA;   dotspacemacs-elpa-subdirectory nil&#xA;   ;; One of `vim', `emacs' or `hybrid'.&#xA;   ;; `hybrid' is like `vim' except that `insert state' is replaced by the&#xA;   ;; `hybrid state' with `emacs' key bindings. The value can also be a list&#xA;   ;; with `:variables' keyword (similar to layers). Check the editing styles&#xA;   ;; section of the documentation for details on available variables.&#xA;   ;; (default 'vim)&#xA;   dotspacemacs-editing-style 'nil&#xA;   ;; If non nil output loading progress in `*Messages*' buffer. (default nil)&#xA;   dotspacemacs-verbose-loading nil&#xA;   ;; Specify the startup banner. Default value is `official', it displays&#xA;   ;; the official spacemacs logo. An integer value is the index of text&#xA;   ;; banner, `random' chooses a random text banner in `core/banners'&#xA;   ;; directory. A string value must be a path to an image format supported&#xA;   ;; by your Emacs build.&#xA;   ;; If the value is nil then no banner is displayed. (default 'official)&#xA;   dotspacemacs-startup-banner 'official&#xA;   ;; List of items to show in startup buffer or an association list of&#xA;   ;; the form `(list-type . list-size)`. If nil then it is disabled.&#xA;   ;; Possible values for list-type are:&#xA;   ;; `recents' `bookmarks' `projects' `agenda' `todos'.&quot;&#xA;   ;; List sizes may be nil, in which case&#xA;   ;; `spacemacs-buffer-startup-lists-length' takes effect.&#xA;   dotspacemacs-startup-lists '((recents . 5)&#xA;                                (projects . 7))&#xA;   ;; True if the home buffer should respond to resize events.&#xA;   dotspacemacs-startup-buffer-responsive t&#xA;   ;; Default major mode of the scratch buffer (default `text-mode')&#xA;   dotspacemacs-scratch-mode 'text-mode&#xA;   ;; List of themes, the first of the list is loaded when spacemacs starts.&#xA;   ;; Press &amp;lt;SPC&amp;gt; T n to cycle to the next theme in the list (works great&#xA;   ;; with 2 themes variants, one dark and one light)&#xA;   dotspacemacs-themes '(spacemacs-dark&#xA;                         spacemacs-light)&#xA;   ;; If non nil the cursor color matches the state color in GUI Emacs.&#xA;   dotspacemacs-colorize-cursor-according-to-state t&#xA;   ;; Default font, or prioritized list of fonts. `powerline-scale' allows to&#xA;   ;; quickly tweak the mode-line size to make separators look not too crappy.&#xA;   dotspacemacs-default-font '(&quot;Source Code Pro&quot;&#xA;                               :size 13&#xA;                               :weight normal&#xA;                               :width normal&#xA;                               :powerline-scale 1.1)&#xA;   ;; The leader key&#xA;   dotspacemacs-leader-key &quot;SPC&quot;&#xA;   ;; The key used for Emacs commands (M-x) (after pressing on the leader key).&#xA;   ;; (default &quot;SPC&quot;)&#xA;   dotspacemacs-emacs-command-key &quot;SPC&quot;&#xA;   ;; The key used for Vim Ex commands (default &quot;:&quot;)&#xA;   dotspacemacs-ex-command-key &quot;:&quot;&#xA;   ;; The leader key accessible in `emacs state' and `insert state'&#xA;   ;; (default &quot;M-m&quot;)&#xA;   dotspacemacs-emacs-leader-key &quot;M-m&quot;&#xA;   ;; Major mode leader key is a shortcut key which is the equivalent of&#xA;   ;; pressing `&amp;lt;leader&amp;gt; m`. Set it to `nil` to disable it. (default &quot;,&quot;)&#xA;   dotspacemacs-major-mode-leader-key &quot;,&quot;&#xA;   ;; Major mode leader key accessible in `emacs state' and `insert state'.&#xA;   ;; (default &quot;C-M-m&quot;)&#xA;   dotspacemacs-major-mode-emacs-leader-key &quot;C-M-m&quot;&#xA;   ;; These variables control whether separate commands are bound in the GUI to&#xA;   ;; the key pairs C-i, TAB and C-m, RET.&#xA;   ;; Setting it to a non-nil value, allows for separate commands under &amp;lt;C-i&amp;gt;&#xA;   ;; and TAB or &amp;lt;C-m&amp;gt; and RET.&#xA;   ;; In the terminal, these pairs are generally indistinguishable, so this only&#xA;   ;; works in the GUI. (default nil)&#xA;   dotspacemacs-distinguish-gui-tab nil&#xA;   ;; If non nil `Y' is remapped to `y$' in Evil states. (default nil)&#xA;   dotspacemacs-remap-Y-to-y$ nil&#xA;   ;; If non-nil, the shift mappings `&amp;lt;' and `&amp;gt;' retain visual state if used&#xA;   ;; there. (default t)&#xA;   dotspacemacs-retain-visual-state-on-shift t&#xA;   ;; If non-nil, J and K move lines up and down when in visual mode.&#xA;   ;; (default nil)&#xA;   dotspacemacs-visual-line-move-text nil&#xA;   ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command.&#xA;   ;; (default nil)&#xA;   dotspacemacs-ex-substitute-global nil&#xA;   ;; Name of the default layout (default &quot;Default&quot;)&#xA;   dotspacemacs-default-layout-name &quot;Default&quot;&#xA;   ;; If non nil the default layout name is displayed in the mode-line.&#xA;   ;; (default nil)&#xA;   dotspacemacs-display-default-layout nil&#xA;   ;; If non nil then the last auto saved layouts are resume automatically upon&#xA;   ;; start. (default nil)&#xA;   dotspacemacs-auto-resume-layouts nil&#xA;   ;; Size (in MB) above which spacemacs will prompt to open the large file&#xA;   ;; literally to avoid performance issues. Opening a file literally means that&#xA;   ;; no major mode or minor modes are active. (default is 1)&#xA;   dotspacemacs-large-file-size 1&#xA;   ;; Location where to auto-save files. Possible values are `original' to&#xA;   ;; auto-save the file in-place, `cache' to auto-save the file to another&#xA;   ;; file stored in the cache directory and `nil' to disable auto-saving.&#xA;   ;; (default 'cache)&#xA;   dotspacemacs-auto-save-file-location 'cache&#xA;   ;; Maximum number of rollback slots to keep in the cache. (default 5)&#xA;   dotspacemacs-max-rollback-slots 5&#xA;   ;; If non nil, `helm' will try to minimize the space it uses. (default nil)&#xA;   dotspacemacs-helm-resize nil&#xA;   ;; if non nil, the helm header is hidden when there is only one source.&#xA;   ;; (default nil)&#xA;   dotspacemacs-helm-no-header nil&#xA;   ;; define the position to display `helm', options are `bottom', `top',&#xA;   ;; `left', or `right'. (default 'bottom)&#xA;   dotspacemacs-helm-position 'bottom&#xA;   ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching&#xA;   ;; in all non-asynchronous sources. If set to `source', preserve individual&#xA;   ;; source settings. Else, disable fuzzy matching in all sources.&#xA;   ;; (default 'always)&#xA;   dotspacemacs-helm-use-fuzzy 'always&#xA;   ;; If non nil the paste micro-state is enabled. When enabled pressing `p`&#xA;   ;; several times cycle between the kill ring content. (default nil)&#xA;   dotspacemacs-enable-paste-transient-state nil&#xA;   ;; Which-key delay in seconds. The which-key buffer is the popup listing&#xA;   ;; the commands bound to the current keystroke sequence. (default 0.4)&#xA;   dotspacemacs-which-key-delay 0.4&#xA;   ;; Which-key frame position. Possible values are `right', `bottom' and&#xA;   ;; `right-then-bottom'. right-then-bottom tries to display the frame to the&#xA;   ;; right; if there is insufficient space it displays it at the bottom.&#xA;   ;; (default 'bottom)&#xA;   dotspacemacs-which-key-position 'bottom&#xA;   ;; If non nil a progress bar is displayed when spacemacs is loading. This&#xA;   ;; may increase the boot time on some systems and emacs builds, set it to&#xA;   ;; nil to boost the loading time. (default t)&#xA;   dotspacemacs-loading-progress-bar t&#xA;   ;; If non nil the frame is fullscreen when Emacs starts up. (default nil)&#xA;   ;; (Emacs 24.4+ only)&#xA;   dotspacemacs-fullscreen-at-startup nil&#xA;   ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen.&#xA;   ;; Use to disable fullscreen animations in OSX. (default nil)&#xA;   dotspacemacs-fullscreen-use-non-native nil&#xA;   ;; If non nil the frame is maximized when Emacs starts up.&#xA;   ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.&#xA;   ;; (default nil) (Emacs 24.4+ only)&#xA;   dotspacemacs-maximized-at-startup nil&#xA;   ;; A value from the range (0..100), in increasing opacity, which describes&#xA;   ;; the transparency level of a frame when it's active or selected.&#xA;   ;; Transparency can be toggled through `toggle-transparency'. (default 90)&#xA;   dotspacemacs-active-transparency 90&#xA;   ;; A value from the range (0..100), in increasing opacity, which describes&#xA;   ;; the transparency level of a frame when it's inactive or deselected.&#xA;   ;; Transparency can be toggled through `toggle-transparency'. (default 90)&#xA;   dotspacemacs-inactive-transparency 90&#xA;   ;; If non nil show the titles of transient states. (default t)&#xA;   dotspacemacs-show-transient-state-title t&#xA;   ;; If non nil show the color guide hint for transient state keys. (default t)&#xA;   dotspacemacs-show-transient-state-color-guide t&#xA;   ;; If non nil unicode symbols are displayed in the mode line. (default t)&#xA;   dotspacemacs-mode-line-unicode-symbols t&#xA;   ;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth&#xA;   ;; scrolling overrides the default behavior of Emacs which recenters point&#xA;   ;; when it reaches the top or bottom of the screen. (default t)&#xA;   dotspacemacs-smooth-scrolling t&#xA;   ;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'&#xA;   ;; derivatives. If set to `relative', also turns on relative line numbers.&#xA;   ;; (default nil)&#xA;   dotspacemacs-line-numbers nil&#xA;   ;; Code folding method. Possible values are `evil' and `origami'.&#xA;   ;; (default 'evil)&#xA;   dotspacemacs-folding-method 'evil&#xA;   ;; If non-nil smartparens-strict-mode will be enabled in programming modes.&#xA;   ;; (default nil)&#xA;   dotspacemacs-smartparens-strict-mode nil&#xA;   ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes&#xA;   ;; over any automatically added closing parenthesis, bracket, quote, etc…&#xA;   ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)&#xA;   dotspacemacs-smart-closing-parenthesis nil&#xA;   ;; Select a scope to highlight delimiters. Possible values are `any',&#xA;   ;; `current', `all' or `nil'. Default is `all' (highlight any scope and&#xA;   ;; emphasis the current one). (default 'all)&#xA;   dotspacemacs-highlight-delimiters 'all&#xA;   ;; If non nil, advise quit functions to keep server open when quitting.&#xA;   ;; (default nil)&#xA;   dotspacemacs-persistent-server nil&#xA;   ;; List of search tool executable names. Spacemacs uses the first installed&#xA;   ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'.&#xA;   ;; (default '(&quot;ag&quot; &quot;pt&quot; &quot;ack&quot; &quot;grep&quot;))&#xA;   dotspacemacs-search-tools '(&quot;ag&quot; &quot;pt&quot; &quot;ack&quot; &quot;grep&quot;)&#xA;   ;; The default package repository used if no explicit repository has been&#xA;   ;; specified with an installed package.&#xA;   ;; Not used for now. (default nil)&#xA;   dotspacemacs-default-package-repository nil&#xA;   ;; Delete whitespace while saving buffer. Possible values are `all'&#xA;   ;; to aggressively delete empty line and long sequences of whitespace,&#xA;   ;; `trailing' to delete only the whitespace at end of lines, `changed'to&#xA;   ;; delete only whitespace for changed lines or `nil' to disable cleanup.&#xA;   ;; (default nil)&#xA;   dotspacemacs-whitespace-cleanup nil&#xA;&#xA;   ))&#xA;&#xA;(defun dotspacemacs/user-init ()&#xA;  &quot;Initialization function for user code.&#xA;It is called immediately after `dotspacemacs/init', before layer configuration&#xA;executes.&#xA; This function is mostly useful for variables that need to be set&#xA;before packages are loaded. If you are unsure, you should try in setting them in&#xA;`dotspacemacs/user-config' first.&quot;&#xA;  )&#xA;&#xA;(defun dotspacemacs/user-config ()&#xA;  &quot;Configuration function for user code.&#xA;This function is called at the very end of Spacemacs initialization after&#xA;layers configuration.&#xA;This is the place where most of your configurations should be done. Unless it is&#xA;explicitly specified that a variable should be set before a package is loaded,&#xA;you should place your code here.&quot;&#xA;  ;;(global-set-key (kbd &quot;TAB&quot;) 'yas-expand)&#xA;  (global-set-key (kbd &quot;M-/&quot;) (kbd &quot;\\&quot;))&#xA;  ;;(global-set-key (kbd &quot;TAB&quot;) 'self-insert-command);&#xA;  (setq-default mac-right-option-modifier nil)&#xA;  )&#xA;&#xA;;; Do not write anything past this comment. This is where Emacs will&#xA;;; auto-generate custom variable definitions.&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(package-selected-packages&#xA;   (quote&#xA;    (disaster company-c-headers cmake-mode clang-format zonokai-theme zenburn-theme zen-and-art-theme underwater-theme ujelly-theme twilight-theme twilight-bright-theme twilight-anti-bright-theme tronesque-theme toxi-theme tao-theme tangotango-theme tango-plus-theme tango-2-theme sunny-day-theme sublime-themes subatomic256-theme subatomic-theme spacegray-theme soothe-theme soft-stone-theme soft-morning-theme soft-charcoal-theme smyx-theme seti-theme reverse-theme railscasts-theme purple-haze-theme professional-theme planet-theme phoenix-dark-pink-theme phoenix-dark-mono-theme pastels-on-dark-theme organic-green-theme omtose-phellack-theme oldlace-theme occidental-theme obsidian-theme noctilux-theme niflheim-theme naquadah-theme mustang-theme monokai-theme monochrome-theme molokai-theme moe-theme minimal-theme material-theme majapahit-theme lush-theme light-soap-theme jbeans-theme jazz-theme ir-black-theme inkpot-theme heroku-theme hemisu-theme hc-zenburn-theme gruvbox-theme gruber-darker-theme grandshell-theme gotham-theme gandalf-theme flatui-theme flatland-theme firebelly-theme farmhouse-theme espresso-theme dracula-theme django-theme darktooth-theme darkokai-theme darkmine-theme darkburn-theme dakrone-theme cyberpunk-theme color-theme-sanityinc-tomorrow color-theme-sanityinc-solarized clues-theme cherry-blossom-theme busybee-theme bubbleberry-theme birds-of-paradise-plus-theme badwolf-theme apropospriate-theme anti-zenburn-theme ample-zen-theme ample-theme alect-themes afternoon-theme flycheck-pos-tip pos-tip flycheck yapfify pyvenv pytest pyenv-mode py-isort pip-requirements live-py-mode hy-mode helm-pydoc cython-mode company-anaconda anaconda-mode pythonic helm-company helm-c-yasnippet company-statistics company-auctex company auto-yasnippet yasnippet auctex ac-ispell auto-complete ws-butler window-numbering which-key volatile-highlights vi-tilde-fringe uuidgen use-package toc-org spaceline powerline restart-emacs request rainbow-delimiters popwin persp-mode pcre2el paradox spinner org-plus-contrib org-bullets open-junk-file neotree move-text macrostep lorem-ipsum linum-relative link-hint info+ indent-guide ido-vertical-mode hydra hungry-delete hl-todo highlight-parentheses highlight-numbers parent-mode highlight-indentation hide-comnt help-fns+ helm-themes helm-swoop helm-projectile helm-mode-manager helm-make projectile pkg-info epl helm-flx helm-descbinds helm-ag google-translate golden-ratio flx-ido flx fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state smartparens evil-indent-plus evil-iedit-state iedit evil-exchange evil-escape evil-ediff evil-args evil-anzu anzu evil goto-chg undo-tree eval-sexp-fu highlight elisp-slime-nav dumb-jump f s diminish define-word column-enforce-mode clean-aindent-mode bind-map bind-key auto-highlight-symbol auto-compile packed dash aggressive-indent adaptive-wrap ace-window ace-link ace-jump-helm-line helm avy helm-core popup async quelpa package-build spacemacs-theme)))&#xA; '(send-mail-function (quote sendmail-send-it)))&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14665" LastEditorUserId="25" LastEditDate="2017-01-24T21:24:36.573" LastActivityDate="2023-09-24T12:07:05.907" Title="How to assign TAB to indentation and to yasnippet expand key" Tags="|key-bindings|indentation|spacemacs|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30178" PostTypeId="1" CreationDate="2017-01-24T15:07:12.530" Score="4" ViewCount="1484" Body="&lt;p&gt;I can not figure out how to change the C stack size for R in ESS. I can change it in terminal as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;X:~$ ulimit -s&#xA;8192&#xA;X:~$ R --slave -e 'Cstack_info()[&quot;size&quot;]'&#xA;   size &#xA;7969177 &#xA;X:~$ ulimit -s 16384&#xA;X:~$ R --slave -e 'Cstack_info()[&quot;size&quot;]'&#xA;    size &#xA;15938355 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As suggested by an answer to this &lt;a href=&quot;https://stackoverflow.com/questions/14719349/error-c-stack-usage-is-too-close-to-the-limit&quot;&gt;question&lt;/a&gt; on stackoverflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After restarting an R session in emacs (M-x R) I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; options(STERM='iESS', str.dendrogram.last=&quot;'&quot;, editor='emacsclient', show.error.locations=TRUE)&#xA;&amp;gt; options(width=113, length=99999)&#xA;&amp;gt; Cstack_info()[&quot;size&quot;]&#xA;   size &#xA;8284000 &#xA;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using GNU Emacs 24.5.1 and ESS version 20150622.413. I'm wondering how to make the ESS interactive R shell pick up the new C stack size?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not found a way to set the C stack size within R and that is why I'm posting this question.&lt;/p&gt;&#xA;" OwnerUserId="14668" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2019-05-08T02:02:00.387" Title="How to increase C stack size for R in ESS?" Tags="|ess|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30179" PostTypeId="1" CreationDate="2017-01-24T15:50:15.347" Score="1" ViewCount="763" Body="&lt;p&gt;This took me way too long to figure out so I'm asking the question and answering it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs/init.el&lt;/code&gt; I was trying many things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(with-eval-after-load 'evil-maps&#xA;    (define-key evil-insert-state-map (kbd &quot;\t&quot;) '[???]))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the value I put in there? All I want to do is to have the tab key get me from insert mode to normal mode!&lt;/p&gt;&#xA;" OwnerUserId="14670" LastEditorUserId="105" LastEditDate="2017-01-24T16:45:01.527" LastActivityDate="2017-01-25T21:41:14.030" Title="How to remap the tab key in emacs evil mode to act as escape key?" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="5" ClosedDate="2017-01-24T18:04:18.833" ContentLicense="CC BY-SA 3.0" />
  <row Id="30180" PostTypeId="2" ParentId="30179" CreationDate="2017-01-24T15:53:00.573" Score="1" Body="&lt;p&gt;This works on emacs 24.5.1 from the Ubuntu 16.04 repositories:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(with-eval-after-load 'evil-maps&#xA;    (define-key evil-insert-state-map (kbd &quot;TAB&quot;) 'evil-normal-state))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: However, this is not recommended as the TAB key is often used for core functionality in many packages. Credit: @Dan for answering &lt;a href=&quot;https://emacs.stackexchange.com/questions/30181/why-is-my-repeat-last-action-dot-operator-is-not-working&quot;&gt;this&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14670" LastEditorUserId="14670" LastEditDate="2017-01-25T21:41:14.030" LastActivityDate="2017-01-25T21:41:14.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30181" PostTypeId="1" AcceptedAnswerId="30182" CreationDate="2017-01-24T17:04:35.303" Score="3" ViewCount="1159" Body="&lt;p&gt;I'm a vim user moving to emacs evil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just added this line to my &lt;code&gt;.init.el&lt;/code&gt; file and it broke my dot functionality.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;TAB&quot;) 'evil-force-normal-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why? I'm not even sure what to search for to start debugging this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my whole &lt;code&gt;init.el&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;))&#xA;&#xA;(setq package-enable-at-startup nil)&#xA;(package-initialize)&#xA;&#xA;(global-linum-mode 1)&#xA;&#xA;(require 'evil)&#xA;(evil-mode t)&#xA;&#xA;&#xA;;;;; Keymappings                                                                  &#xA;(with-eval-after-load 'evil-maps&#xA;  (define-key evil-motion-state-map (kbd &quot;:&quot;) 'evil-repeat-find-char)&#xA;  (define-key evil-motion-state-map (kbd &quot;;&quot;) 'evil-ex))&#xA;  (define-key evil-insert-state-map (kbd &quot;TAB&quot;) 'evil-force-normal-state)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I don't comment out that line, the &lt;code&gt;.&lt;/code&gt; in normal mode just deletes the current line as if I'm doing a &lt;code&gt;dd&lt;/code&gt;. I tried adding stuff to the end of a line then repeating it on a few lines with &lt;code&gt;.&lt;/code&gt;. All I got was fewer lines!&lt;/p&gt;&#xA;" OwnerUserId="14670" LastEditorUserId="253" LastEditDate="2017-01-24T17:25:15.533" LastActivityDate="2017-01-24T17:25:15.533" Title="Why is my &quot;repeat last action&quot; (dot) operator is not working?" Tags="|evil|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30182" PostTypeId="2" ParentId="30181" CreationDate="2017-01-24T17:22:08.263" Score="3" Body="&lt;h3&gt;Short version&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Switch your code to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;TAB&quot;) 'evil-normal-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Explanatory version&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I presume that you're trying to use the &lt;kbd&gt;TAB&lt;/kbd&gt; key as a&#xA;substitute for the &lt;kbd&gt;ESC&lt;/kbd&gt; key because the latter is harder&#xA;to reach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an editorial aside, let me suggest you try remapping the&#xA;&lt;kbd&gt;ESC&lt;/kbd&gt; key to the &lt;kbd&gt;CAPS LOCK&lt;/kbd&gt; key at the system&#xA;level, as many Emacs packages use &lt;kbd&gt;TAB&lt;/kbd&gt; for core&#xA;functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to the narrow issue.  In &lt;em&gt;insert&lt;/em&gt; state, &lt;kbd&gt;ESC&lt;/kbd&gt; is&#xA;bound by default to &lt;code&gt;evil-normal-state&lt;/code&gt;, &lt;em&gt;not&lt;/em&gt;&#xA;&lt;code&gt;evil-force-normal-state&lt;/code&gt; (which is its binding in &lt;em&gt;normal&lt;/em&gt;&#xA;state).  That's an important point because the &lt;em&gt;latter&lt;/em&gt; aborts the&#xA;repeater.  Here's the code that shows you:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-define-command evil-force-normal-state ()&#xA;  &quot;Switch to normal state without recording current command.&quot;&#xA;  :repeat abort             ;; here's the culprit&#xA;  :suppress-operator t&#xA;  (evil-normal-state))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(NB: you can check out the source code with &lt;code&gt;C-h f evil-force-normal-state&lt;/code&gt; and follow the links.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-24T17:22:08.263" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30183" PostTypeId="1" CreationDate="2017-01-24T17:23:17.673" Score="2" ViewCount="1159" Body="&lt;p&gt;In orgmode, is there an easy way to tell the exporter to ignore the first heading level and start exporting at the second level? I imagine something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in org:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Toplevel&#xA;** Head_1&#xA;  content 1&#xA;** Head_2&#xA;  content 2&#xA;** Head_3&#xA;  content 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to be exported to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. Head_1&#xA;  content 1&#xA;2. Head_2&#xA;  content 2&#xA;3. Head_3&#xA;  content 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** &lt;strong&gt;Update&lt;/strong&gt; **&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the comment by @artscan I revisited the :ignore: tag, and it indeed achieves what I need. To use it you need to add to the .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/path/to/orgdir/contrib/lisp&quot; t)&#xA;(require 'ox-extra)&#xA;(ox-extras-activate '(ignore-headlines))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that this also requires org-mode 8.3+&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once ox-extra is installed, simply tag the *Toplevel headline with :ignore:&lt;/p&gt;&#xA;" OwnerUserId="14672" LastEditorUserId="14672" LastEditDate="2017-01-26T14:17:27.367" LastActivityDate="2017-01-26T14:17:27.367" Title="orgmode export - skip/ignore first headline level" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30187" PostTypeId="1" AcceptedAnswerId="30191" CreationDate="2017-01-24T22:45:13.447" Score="5" ViewCount="1049" Body="&lt;p&gt;I know that to repeat the last command, there is &lt;code&gt;C-x z&lt;/code&gt; and then to keep using &lt;code&gt;z&lt;/code&gt; to easily keep the last command in operation, but what can be done for the 2nd or 4th last command? Or is that information lost?&lt;/p&gt;&#xA;" OwnerUserId="2340" LastActivityDate="2017-01-25T02:36:51.567" Title="Repeat n(th) last command in emacs?" Tags="|commands|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30188" PostTypeId="1" AcceptedAnswerId="30194" CreationDate="2017-01-24T22:49:17.407" Score="8" ViewCount="6643" Body="&lt;p&gt;I am using org-mode to organize my life. I got used to planning with &lt;strong&gt;DEADLINE&lt;/strong&gt;. Additionally, I am using &lt;strong&gt;Effort&lt;/strong&gt; property to predict how much effort that I have to show to finish all tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;org-agenda-columns C-c C-x C-c&lt;/strong&gt; provide good interface to estimate effort in agenda. &lt;em&gt;org-agenda&lt;/em&gt; shows today tasks, but it also shows future and overdue tasks at the same view like below in the picture. So, it makes really hard to understand how many hours that I have to spend today because it sums automatically all efforts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IyPh9.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IyPh9.png&quot; alt=&quot;agenda-column-view&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prepared small customized view to show just today tasks as I wanted, but these tasks are filtered with kind of regexp, so that reason, it's not possible to see next or previous days by using &lt;strong&gt;org-agenda-earlier&lt;/strong&gt; and &lt;strong&gt;org-agenda-later&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TLDR;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any option to show only today's(not overdue and future) tasks in org-agenda?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Things that can help&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Main&#xA;** Today 1st task&#xA;   DEADLINE: &amp;lt;2017-01-25 Wed&amp;gt;&#xA;   :PROPERTIES:&#xA;   :EFFORT:   01:00&#xA;   :END:&#xA;**  Today 2nd task&#xA;   DEADLINE: &amp;lt;2017-01-25 Wed&amp;gt;&#xA;   :PROPERTIES:&#xA;   :EFFORT:   00:30&#xA;   :END:&#xA;** Yesterday Overdue&#xA;   DEADLINE: &amp;lt;2017-01-24 Tue&amp;gt;&#xA;   :PROPERTIES:&#xA;   :EFFORT:   02:00&#xA;   :END:&#xA;** Future task&#xA;   DEADLINE: &amp;lt;2017-01-30 Mon&amp;gt;&#xA;   :PROPERTIES:&#xA;   :EFFORT:   00:30&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My non-interactive filter&lt;/strong&gt; that shows todays tasks &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;      '((&quot;d&quot; &quot;daily&quot;&#xA;         tags &quot;DEADLINE&amp;gt;=\&quot;&amp;lt;today&amp;gt;\&quot;&amp;amp;DEADLINE&amp;lt;=\&quot;&amp;lt;now&amp;gt;\&quot;&quot;&#xA;         ((org-agenda-sorting-strategy '(todo-state-down)))&#xA;         (org-agenda-overriding-header &quot;TODAY tasks&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example &lt;strong&gt;Interactive agenda-view&lt;/strong&gt; that shows just A priority &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;            '(&quot;f&quot; agenda &quot;&quot;&#xA;              ((org-agenda-skip-function&#xA;                (lambda nil&#xA;                  (org-agenda-skip-entry-if (quote notregexp) &quot;\\=.*\\[#A\\]&quot;)))&#xA;               (org-agenda-ndays 0)&#xA;               (org-agenda-overriding-header &quot;Today's Priority #A tasks: &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8426" LastEditorDisplayName="user31220" LastEditDate="2022-10-17T08:41:41.110" LastActivityDate="2022-10-17T08:41:41.110" Title="Show only today's tasks in org-agenda" Tags="|org-mode|org-agenda|org-ql|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30189" PostTypeId="2" ParentId="30187" CreationDate="2017-01-24T22:53:48.043" Score="3" Body="&lt;p&gt;As far as I can tell, in its current implementation, only the&#xA;most recent command is kept.  Everything before that is lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at the source code for &lt;code&gt;repeat&lt;/code&gt; (the command to which&#xA;&lt;code&gt;C-x z&lt;/code&gt; is bound), and it uses the variable&#xA;&lt;code&gt;last-repeatable-command&lt;/code&gt;.  Its docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;last-repeatable-command&lt;/code&gt; is a variable defined in &lt;code&gt;C source code&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Last command that may be repeated.&#xA;  The last command executed that was not bound to an input event.&#xA;  This is the command &lt;code&gt;repeat&lt;/code&gt; will try to repeat.&#xA;  Taken from a previous value of &lt;code&gt;real-this-command&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;last-repeatable-command&lt;/code&gt; stores an atom, not a list, and gets&#xA;overwritten with the value of &lt;code&gt;real-this-command&lt;/code&gt; every time you&#xA;invoke a command.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-24T22:53:48.043" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30190" PostTypeId="1" AcceptedAnswerId="30192" CreationDate="2017-01-25T02:19:08.417" Score="0" ViewCount="1340" Body="&lt;p&gt;Is it possible to use the control key to exit Evil's insert mode? I'm currently using the following code to do it with TAB, but since control only seems to work as a modifier key, I'm not having any luck with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;  ;; Map single control to ESC&#xA;  (with-eval-after-load 'evil-maps&#xA;    (define-key evil-insert-state-map (kbd &quot;TAB&quot;) 'evil-force-normal-state))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="14677" LastActivityDate="2017-01-25T03:59:28.163" Title="Leave evil insert mode with control key" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30191" PostTypeId="2" ParentId="30187" CreationDate="2017-01-25T02:36:51.567" Score="4" Body="&lt;p&gt;What @Dan said is correct, and it answers your question, which is about &lt;em&gt;any&lt;/em&gt; command repeated in any way -- including a command invoked using a key bound to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some additional information, which pertains only to so-called &lt;em&gt;complex&lt;/em&gt; commands, which means those executed via &lt;strong&gt;&lt;code&gt;M-x&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Command &lt;strong&gt;&lt;code&gt;repeat-complex-command&lt;/code&gt;&lt;/strong&gt;, bound to &lt;strong&gt;&lt;code&gt;C-x ESC ESC&lt;/code&gt;&lt;/strong&gt;, gives you access to the complete complex-command history. And you can access any command in the history directly by way of a prefix argument -- e.g., &lt;code&gt;M-2&lt;/code&gt; means access the second-from-last command.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/cmds-menu.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;cmds-menu.el&lt;/code&gt;&lt;/a&gt; (see &lt;a href=&quot;https://www.emacswiki.org/emacs/RecentCommandsMenu&quot; rel=&quot;nofollow noreferrer&quot;&gt;Recent Commands Menu&lt;/a&gt;) then you can access any command in the history directly by choosing it in the menu-bar menu &lt;strong&gt;Tools&lt;/strong&gt; &gt; &lt;strong&gt;Recent Commands&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-01-25T02:36:51.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30192" PostTypeId="2" ParentId="30190" CreationDate="2017-01-25T03:59:28.163" Score="3" Body="&lt;p&gt;No, you cannot, at least not within Emacs.  Emacs only understands modifier keys that actually modify something, so &lt;kbd&gt;CTRL&lt;/kbd&gt; alone will not be recognized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some programs (&lt;a href=&quot;https://github.com/alols/xcape&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;xcape&lt;/code&gt;&lt;/a&gt;, for instance) allow you to bind a modifier key to do something when it modifies something, and a different thing when you tap and release it.  A common use case is to modify the &lt;kbd&gt;CTRL&lt;/kbd&gt; key to act as &lt;kbd&gt;ESC&lt;/kbd&gt; when tapped and released.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-25T03:59:28.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30193" PostTypeId="1" AcceptedAnswerId="30250" CreationDate="2017-01-25T07:36:16.607" Score="1" ViewCount="354" Body="&lt;p&gt;If I am copying files using dired having previously called &lt;code&gt;(dired-async-mode)&lt;/code&gt; to make it copy asynchronously, how do I know when it has successfully finished copying the files?  &lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2017-01-27T05:18:30.680" Title="How to know when dired is done if called async?" Tags="|dired|async|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30194" PostTypeId="2" ParentId="30188" CreationDate="2017-01-25T08:05:50.243" Score="8" Body="&lt;p&gt;&lt;strong&gt;COMPATIBLE WITH ORG-MODE 9.0.3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;org-agenda-skip-deadline-if-not-today&lt;/code&gt; is designed to be used in conjunction with the &lt;code&gt;org-agenda-skip-function&lt;/code&gt; and an &lt;code&gt;agenda&lt;/code&gt; entry in the &lt;code&gt;org-agenda-custom-commands&lt;/code&gt; that contains &lt;em&gt;proposed&lt;/em&gt; entries such as:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-to-list 'org-agenda-custom-commands&#xA;             '(&quot;b&quot; agenda &quot;Today's Deadlines&quot;&#xA;               ((org-agenda-span 'day)&#xA;                (org-agenda-skip-function '(org-agenda-skip-deadline-if-not-today))&#xA;                (org-agenda-entry-types '(:deadline))&#xA;                (org-agenda-overriding-header &quot;Today's Deadlines &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-agenda-skip-deadline-if-not-today ()&#xA;&quot;If this function returns nil, the current match should not be skipped.&#xA;Otherwise, the function must return a position from where the search&#xA;should be continued.&quot;&#xA;  (ignore-errors&#xA;    (let ((subtree-end (save-excursion (org-end-of-subtree t)))&#xA;          (deadline-day&#xA;            (time-to-days&#xA;              (org-time-string-to-time&#xA;                (org-entry-get nil &quot;DEADLINE&quot;))))&#xA;          (now (time-to-days (current-time))))&#xA;       (and deadline-day&#xA;            (not (= deadline-day now))&#xA;            subtree-end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;COMPATIBLE WITH ORG-MODE 8.2.10&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version 25.1 ships with &lt;code&gt;org-mode&lt;/code&gt; version 8.2.10.  Within said release, there is an undocumented dynamically scoped variable called &lt;code&gt;org-agenda-only-exact-dates&lt;/code&gt;, which can be used to accomplish the goal of the original poster.  Within the &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;, set &lt;code&gt;(org-agenda-only-exact-dates t)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-agenda-only-exact-dates&lt;/code&gt; is used by &lt;code&gt;org-agenda-get-deadlines&lt;/code&gt;, which is one of the functions responsible for the behavior the original poster wishes to customize.  It is also used by &lt;code&gt;org-agenda-get-scheduled&lt;/code&gt;.  The function &lt;code&gt;org-timeline&lt;/code&gt; is what sets this dynamically scoped variable to &lt;code&gt;t&lt;/code&gt;.  This answer (above) takes advantage of said variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CAVEAT&lt;/strong&gt;:  Many people are using the latest release of &lt;code&gt;org-mode&lt;/code&gt; which does not ship with Emacs -- e.g., &lt;code&gt;org-mode&lt;/code&gt; version 9.0.4.  I grepped 9.0.3 and did not see &lt;code&gt;org-agenda-only-exact-dates&lt;/code&gt; used within either &lt;code&gt;org-agenda-get-deadlines&lt;/code&gt; or &lt;code&gt;org-agenda-get-scheduled&lt;/code&gt;.  I'm not sure why the &lt;code&gt;org-mode&lt;/code&gt; team removed that variable or whether something else replaced its functionality in the latest release.  To the extent that another forum participant would like to research the code of 9.0.4 and post an alternative answer that works with the latest release, please feel free to do so.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-01-28T16:33:03.940" LastActivityDate="2017-01-28T16:33:03.940" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30195" PostTypeId="2" ParentId="30117" CreationDate="2017-01-25T10:15:07.057" Score="1" Body="&lt;p&gt;The order of the emacs call seems to be the problem. Should be &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    emacs --batch -l emacs-load.el $&amp;lt; -f org-latex-export-to-pdf --kill&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Moreover, I needed to invoke the Makefile located in the org lisp directory hat I placed in my load-path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It work as expected with the above modifications.&lt;/p&gt;&#xA;" OwnerUserId="14220" LastActivityDate="2017-01-25T10:15:07.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30196" PostTypeId="1" CreationDate="2017-01-25T10:15:18.930" Score="11" ViewCount="5069" Body="&lt;p&gt;There is a folder with many sub-folders, files and I would like to search for a given piece of text in all of these files with Emacs on a Windows 10 machine. (I know about M-x grep, but it does not work in Windows environment.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to start such recursive search from within Emacs on Windows 10 without installing additional software or extensions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The question marked as a &quot;possible duplicate&quot; is different. My question is about searching in files' contents. The another question is about searching for files.)&lt;/p&gt;&#xA;" OwnerDisplayName="user14685" LastEditorDisplayName="user14685" LastEditDate="2017-01-25T16:21:44.753" LastActivityDate="2021-11-17T10:47:46.040" Title="How to search in multiple files with Emacs without grep?" Tags="|search|" AnswerCount="4" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30197" PostTypeId="1" AcceptedAnswerId="30199" CreationDate="2017-01-25T12:37:54.787" Score="1" ViewCount="157" Body="&lt;p&gt;First of all, I made a new keyboard macro called 'mac'.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;[F3] abcd [F4]&lt;/p&gt;&#xA;&lt;p&gt;M-x name-last-kbd-macro mac&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Then, I can get 'abcd' by typing [F4] or M-x mac. I tried to get 'abcd' five times. So I made a new keyboard macro of keyboard macro.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;[F3] C-u 5 M-x mac [F4]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I expected to see 'abcdabcdabcdabcdabcd' when I typed [F4]. However, keyboard macro of keyboard macro made 'abcdabcdabcdabcdabcdabcdabcdabcdabcdabcd' which is 10 times of 'abcd', rather than 5. What's wrong with it?&lt;/p&gt;&#xA;" OwnerUserId="14687" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-03-04T15:26:43.623" Title="How to use double keyboard macro, or keyboard macro of keyboard macro?" Tags="|keyboard-macros|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30198" PostTypeId="2" ParentId="29664" CreationDate="2017-01-25T15:31:50.860" Score="0" Body="&lt;p&gt;Good question. I've come up with this (still, first) draft. As queried it's about killing line backward from point including keeping &lt;code&gt;sexp&lt;/code&gt; balance as paredit does watch for it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun paredit-kill-backward-from-point ()&#xA;     (interactive)&#xA;     (let ((prev-pos (point)))&#xA;       (paredit-backward-up)&#xA;       (paredit-forward-down)&#xA;       (kill-region (point) prev-pos)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11198" LastEditorUserId="11198" LastEditDate="2017-01-25T15:44:51.867" LastActivityDate="2017-01-25T15:44:51.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30199" PostTypeId="2" ParentId="30197" CreationDate="2017-01-25T16:20:04.740" Score="4" Body="&lt;p&gt;This looks like a bug. Using &lt;code&gt;insert-kbd-macro&lt;/code&gt; You can look at what's actually stored in the macros:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'm&#xA;   &quot;a&quot;)&#xA;&#xA;(fset 'n&#xA;   [?\M-x ?m return ?a])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I created a macro called &lt;code&gt;m&lt;/code&gt; that just prints 'a', then created a second macro called &lt;code&gt;n&lt;/code&gt; that calls &lt;code&gt;m&lt;/code&gt;. It seems the second macro records the call to &lt;code&gt;m&lt;/code&gt;, then records the output of &lt;code&gt;m&lt;/code&gt; as though it's keyboard input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only solution I can find is to create the second macro, then use &lt;code&gt;edit-kbd-macro&lt;/code&gt; to remove the doubled text. Not very convenient, really.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Update:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I believe this has now been &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25860&quot; rel=&quot;nofollow noreferrer&quot;&gt;fixed in the master branch&lt;/a&gt;, so should work from Emacs 26 on.&lt;/p&gt;&#xA;" OwnerUserId="7069" LastEditorUserId="7069" LastEditDate="2017-03-04T15:26:43.623" LastActivityDate="2017-03-04T15:26:43.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30200" PostTypeId="2" ParentId="30196" CreationDate="2017-01-25T16:29:35.637" Score="7" Body="&#xA;&#xA;&lt;p&gt;You can use Windows' builtin &lt;code&gt;findstr&lt;/code&gt; command with &lt;code&gt;M-x rgrep&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (eq system-type 'windows-nt)&#xA;  (with-eval-after-load 'grep&#xA;    ;; findstr can handle the basic find|grep use case&#xA;    (grep-apply-setting 'grep-find-template&#xA;                        &quot;findstr /S /N /D:. /C:&amp;lt;R&amp;gt; &amp;lt;F&amp;gt;&quot;)&#xA;    (setq find-name-arg nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not as versatile as &lt;code&gt;grep&lt;/code&gt;, but it's fine for searching for fixed strings.  Also note that Emacs sometimes suggests globs like &lt;code&gt;*.[ch]&lt;/code&gt; but you need to use &lt;code&gt;*.c *.h&lt;/code&gt; instead (use &lt;kbd&gt;C-q SPC&lt;/kbd&gt; to enter the space).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-01-25T16:29:35.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30201" PostTypeId="1" CreationDate="2017-01-25T16:57:11.137" Score="2" ViewCount="106" Body="&lt;p&gt;When I use &lt;code&gt;docview&lt;/code&gt; to view PDFs on my work computer (a redhat linux system) it always works, &lt;em&gt;except&lt;/em&gt; in PDFs coming from Springer-Verlag articles and chapters.  In that case it gives this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Invalid format operation %A&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I &lt;em&gt;can&lt;/em&gt; view such files using &lt;code&gt;gs&lt;/code&gt; directly.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no such problem on my home iMac.  The version of &lt;code&gt;gs&lt;/code&gt; that I have at work is 9.07, and the version of emacs is 24.3.1.  I checked customize and there are no nonstandard settings there for &lt;code&gt;doc-view&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why is &lt;code&gt;docview&lt;/code&gt; failing to load this PDF, even though &lt;code&gt;gs&lt;/code&gt; can do it?  How do I fix the problem?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="11391" LastEditorUserId="253" LastEditDate="2017-01-25T17:05:12.060" LastActivityDate="2017-01-25T17:05:12.060" Title="doc-view failing for some PDFs, but ghostscript can view them?" Tags="|pdf|docview|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30202" PostTypeId="1" CreationDate="2017-01-25T18:21:52.077" Score="1" ViewCount="1436" Body="&lt;p&gt;I want to use emacs with imagemagick to enable dynamic resizing of images in org-mode (&lt;a href=&quot;https://www.reddit.com/r/emacs/comments/44id5o/how_to_install_emacs_with_imagemagick_support/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.reddit.com/r/emacs/comments/44id5o/how_to_install_emacs_with_imagemagick_support/&lt;/a&gt;). This used to work before I decided to upgrade homebrew. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have installed imagemagick with homebrew, and it seems to work because I have a working &lt;code&gt;convert&lt;/code&gt; command:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;$ convert --version&#xA;Version: ImageMagick 7.0.4-5 Q16 x86_64 2017-01-23 http://www.imagemagick.org&#xA;Copyright: © 1999-2017 ImageMagick Studio LLC&#xA;License: http://www.imagemagick.org/script/license.php&#xA;Features: Cipher DPC HDRI Modules&#xA;Delegates (built-in): bzlib cairo fftw fontconfig freetype jng jpeg ltdl lzma png rsvg tiff x xml zlib&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then installed emacs with homebrew on mac, using the following command:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;brew install emacs --with-cocoa --with-gnutls --with-librsvg --with-imagemagick&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The installation completes without issues. Starting emacs works fine, and I use exec-path-from-shell in my .emacs to get the right PATH:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(use-package exec-path-from-shell&#xA;  :ensure t&#xA;  :if (eq system-type 'darwin)&#xA;  :config (exec-path-from-shell-initialize)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to work, since the command&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-: (getenv &quot;PATH&quot;)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;/Users/my_user_name/Library/Python/2.7/bin:/Users/my_user_name/perl5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the images in my org mode file do not resize properly (which they used to before I decided to upgrade homebrew, forcing me to reinstall emacs). Checking if imagemagick works by running the following command just returns &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-: (image-type-available-p 'imagemagick) RET&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="12681" LastActivityDate="2017-02-13T17:09:41.760" Title="Emacs is compiled with imagemagick and has right PATH but still cannot use it" Tags="|org-mode|osx|images|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30204" PostTypeId="1" AcceptedAnswerId="30214" CreationDate="2017-01-25T20:54:09.653" Score="7" ViewCount="9034" Body="&lt;p&gt;There are certain files I never access from Helm, such as those in my global .gitignore file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Emacs backup files #&#xA;##############################&#xA;*~&#xA;*#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way of telling Helm to ignore these files?&lt;/p&gt;&#xA;" OwnerUserId="14499" LastEditorUserId="105" LastEditDate="2017-01-25T21:07:48.557" LastActivityDate="2020-03-01T06:04:23.040" Title="How to tell Helm to ignore certain files?" Tags="|helm|helm-selection|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30205" PostTypeId="1" AcceptedAnswerId="30207" CreationDate="2017-01-25T21:39:14.770" Score="3" ViewCount="202" Body="&lt;p&gt;My idea was kind of this (but I'm open for other suggestions):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a functions to get names of windows (not frames)&lt;/li&gt;&#xA;&lt;li&gt;a way to read the current window configuration.&#xA;e.g. &lt;code&gt;(vertically-split a (horizontally-split b c))&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;a functions to transpose 2 windows / modify window configuration.&#xA;e.g. &lt;code&gt;(vertically-split a (horizontally-split b c))&lt;/code&gt; -&gt; &lt;code&gt;(vertically-split (horizontally-split b c) a)&lt;/code&gt; -&gt; &lt;code&gt;(vertically-split (horizontally-split c b) a)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="14692" LastEditorUserId="253" LastEditDate="2017-01-25T22:12:29.887" LastActivityDate="2017-01-25T23:57:06.170" Title="command to transpose two adjacent windows when I have more than two windows?" Tags="|window|" AnswerCount="3" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30206" PostTypeId="2" ParentId="30205" CreationDate="2017-01-25T22:03:29.267" Score="4" Body="&lt;p&gt;The &lt;code&gt;ace-swap-window&lt;/code&gt; command in the &lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;nofollow noreferrer&quot;&gt;ace-window package&lt;/a&gt; does exactly this. If you install that package, the command &lt;code&gt;C-u M-x ace-window&lt;/code&gt; will swap the contents of the current window with the one you select. If you do that a lot you'll want to bind it to something more convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand what your point #3 has to do with points 1 and 2. I use the following function to toggle back and forth between a 2-window horizontal configuration and a 2-window vertical configuration.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun toggle-window-split ()&#xA;  (interactive)&#xA;  (if (= (count-windows) 2)&#xA;      (let* ((this-win-buffer (window-buffer))&#xA;             (next-win-buffer (window-buffer (next-window)))&#xA;             (this-win-edges (window-edges (selected-window)))&#xA;             (next-win-edges (window-edges (next-window)))&#xA;             (this-win-2nd (not (and (&amp;lt;= (car this-win-edges)&#xA;                                         (car next-win-edges))&#xA;                                     (&amp;lt;= (cadr this-win-edges)&#xA;                                         (cadr next-win-edges)))))&#xA;             (splitter&#xA;              (if (= (car this-win-edges)&#xA;                     (car (window-edges (next-window))))&#xA;                  'split-window-horizontally&#xA;                'split-window-vertically)))&#xA;        (delete-other-windows)&#xA;        (let ((first-win (selected-window)))&#xA;          (funcall splitter)&#xA;          (if this-win-2nd (other-window 1))&#xA;          (set-window-buffer (selected-window) this-win-buffer)&#xA;          (set-window-buffer (next-window) next-win-buffer)&#xA;          (select-window first-win)&#xA;          (if this-win-2nd (other-window 1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-25T22:03:29.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30207" PostTypeId="2" ParentId="30205" CreationDate="2017-01-25T22:12:06.270" Score="1" Body="&lt;p&gt;M-x package-install buffer-move&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'buf-move-left&#xA;'buf-move-right&#xA;'buf-move-up&#xA;'buf-move-down&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;were exactly what i'm looking for.&#xA;thanks @npostavs for pointing me to &lt;a href=&quot;https://www.emacswiki.org/emacs/TransposeWindows&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/TransposeWindows&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14692" LastEditorUserId="14692" LastEditDate="2017-01-25T22:19:51.400" LastActivityDate="2017-01-25T22:19:51.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30208" PostTypeId="2" ParentId="30100" CreationDate="2017-01-25T23:14:28.757" Score="2" Body="&lt;p&gt;Got it to work! Thanks guys!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.pdf\\'&quot; . doc-view-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'doc-view-mode-hook #'pdf-tools-install)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14618" LastActivityDate="2017-01-25T23:14:28.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30209" PostTypeId="2" ParentId="30204" CreationDate="2017-01-25T23:53:08.387" Score="1" Body="&lt;p&gt;For grepping, there's &lt;code&gt;helm-grep-ignored-files&lt;/code&gt; and &lt;code&gt;helm-grep-ignored-directories&lt;/code&gt;. There's nothing like that for &lt;code&gt;helm-find-files&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2017-01-26T01:31:12.793" LastActivityDate="2017-01-26T01:31:12.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30210" PostTypeId="2" ParentId="30205" CreationDate="2017-01-25T23:57:06.170" Score="0" Body="&lt;p&gt;Here, check this out.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun window-children (window)&#xA;  &quot;Return the children of WINDOW.&quot;&#xA;  (let ((child (window-child window))&#xA;        children)&#xA;    (while child&#xA;      (push child children)&#xA;      (setq child (window-next-sibling child)))&#xA;    (nreverse children)))&#xA;&#xA;(defun window-transpose-siblings (&amp;amp;optional n k)&#xA;  &quot;Transpose the K-th parent with its N-th sibling.&#xA;&#xA;K defaults to 0 and N to 1, i.e. transpose the `selected-window'&#xA;with its right (or below) sibling.&#xA;&#xA;Interactively, K is 0 and N the prefix-arg.  Unless this argument&#xA;is negative, in which case K is minus the prefix-arg and N equals&#xA;1.  The command remembers the last set value of K across&#xA;different invocations.&quot;&#xA;  (interactive&#xA;   (let ((n (prefix-numeric-value current-prefix-arg))&#xA;         (k (get this-command 'k)))&#xA;     (when (&amp;lt;= n 0)&#xA;       (setq k (- n) n 1)&#xA;       (put this-command 'k k))&#xA;     (list n k)))&#xA;  (unless n (setq n 1))&#xA;  (unless k (setq k 0))&#xA;  (let* ((w0 (selected-window)))&#xA;    ;; Go up K window nodes.&#xA;    (dotimes (_ k)&#xA;      (setq w0 (window-parent w0)))&#xA;    ;; Figure out the window to transpose with and do it.&#xA;    (let* ((siblings (window-children (window-parent w0)))&#xA;           (w1 (nth (mod (+ n (cl-position w0 siblings))&#xA;                         (length siblings))&#xA;                    siblings))&#xA;           (s0 (window-state-get w0))&#xA;           (s1 (window-state-get w1)))&#xA;      (unless (eq w0 w1)&#xA;        (window-state-put s1 w0)&#xA;        (window-state-put s0 w1))&#xA;      nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-01-25T23:57:06.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30211" PostTypeId="2" ParentId="30072" CreationDate="2017-01-26T00:43:26.503" Score="3" Body="&lt;p&gt;As you say, it appears that you are just seeing the tabs from the git output being expanded using the default Emacs value for &lt;code&gt;tab-width&lt;/code&gt; (8), so you can set it to your desired value in any magit buffer and see it how you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do this for every magit status buffer, you could do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-magit-status-mode-hook ()&#xA;  (setq tab-width 4))&#xA;(add-hook 'magit-status-mode-hook 'my-magit-status-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14636" LastEditorUserId="14636" LastEditDate="2017-01-26T01:30:44.740" LastActivityDate="2017-01-26T01:30:44.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30212" PostTypeId="2" ParentId="3669" CreationDate="2017-01-26T00:48:11.440" Score="3" Body="&lt;p&gt;I had the same problem, and &lt;a href=&quot;http://www.hydrus.org.uk/journal/emacs-netlogon.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;it seems like it is being caused by the windows netlogon service&lt;/a&gt;. The simplest solution is to turn it off when outside your company network, by running the following command in the command line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;net stop netlogon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When you are back on the company network, start it again using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;net start netlogon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13253" LastActivityDate="2017-01-26T00:48:11.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30213" PostTypeId="2" ParentId="29151" CreationDate="2017-01-26T00:51:05.790" Score="1" Body="&lt;p&gt;The problem was caused by the windows netlogon service. This questions seems to be a duplicate of &lt;a href=&quot;https://emacs.stackexchange.com/questions/3669/emacs-on-windows-7-very-slow-when-computer-is-outside-company-network/30212#3021&quot;&gt;this one&lt;/a&gt; and too which I've answered with the solution I found &lt;a href=&quot;http://www.hydrus.org.uk/journal/emacs-netlogon.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-26T00:51:05.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30214" PostTypeId="2" ParentId="30204" CreationDate="2017-01-26T01:03:52.007" Score="4" Body="&lt;p&gt;This doesn't exactly answer your question directly, but if you are working on something Projectile recognizes as a project, you could try using &lt;code&gt;helm-projectile-find-file&lt;/code&gt; instead of &lt;code&gt;helm-find-files&lt;/code&gt;.  The functionality is rather different (it searches all file names and paths in the project simultaneously, rather than letting you navigate to individual directories in the project), but it does have the benefit that it understands and uses &lt;code&gt;.gitignore&lt;/code&gt; files.&lt;/p&gt;&#xA;" OwnerUserId="14017" LastEditorUserId="14017" LastEditDate="2017-01-26T01:23:27.243" LastActivityDate="2017-01-26T01:23:27.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30215" PostTypeId="2" ParentId="14360" CreationDate="2017-01-26T01:32:58.407" Score="1" Body="&lt;p&gt;This is an extremely late answer, but two additional possibilities exist:&#xA;&lt;a href=&quot;https://github.com/ruediger/emacs-firefox-remote&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-firefox-remote&lt;/a&gt; and &lt;a href=&quot;https://github.com/segv/jss&quot; rel=&quot;nofollow noreferrer&quot;&gt;jss&lt;/a&gt;. Neither has unfortunately been maintained in a rather long time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former does seem to at least have the ability to connect to firefox, retrieve some sort of information, and disconnect, though not very much else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter is designed to be more extensive, providing support for debugging chromium as well. (However, I have not tested it, as in its case the code seems to be far too extensive to casually inspect, to ensure that it doesn't do something crazy.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that this is of some value to somebody.&lt;/p&gt;&#xA;" OwnerUserId="12521" LastActivityDate="2017-01-26T01:32:58.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30216" PostTypeId="2" ParentId="29600" CreationDate="2017-01-26T02:46:03.583" Score="4" Body="&lt;p&gt;This isn't what you're actually asking for, but &lt;a href=&quot;https://www.emacswiki.org/emacs/FrameMove&quot; rel=&quot;nofollow noreferrer&quot;&gt;framemove&lt;/a&gt; lets you switch focus to the next frame in a specified direction from the current frame, exactly like &lt;code&gt;windmove&lt;/code&gt; lets you select another window by direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also works beautifully as an extension of windmove, so that you use the same keybindings for both (moving between frames when there is no window in the given direction).&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-01-26T02:46:03.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30217" PostTypeId="2" ParentId="30196" CreationDate="2017-01-26T03:19:46.450" Score="7" Body="&lt;p&gt;you can try the xah-find package.&#xA;&lt;a href=&quot;https://github.com/xahlee/xah-find&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/xahlee/xah-find&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is pure elisp, and designed just for emacs without external grep tools.&lt;/p&gt;&#xA;" OwnerUserId="305" LastActivityDate="2017-01-26T03:19:46.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30218" PostTypeId="2" ParentId="29600" CreationDate="2017-01-26T04:40:55.053" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/ace-window/blob/master/README.md&quot; rel=&quot;nofollow noreferrer&quot;&gt;ace-window&lt;/a&gt; provides quick access to any window. By default all windows in all frames are available, so you can use it to jump to any frame. It requires one extra keypress than what you asked for - it doesn't cycle through frames in a fixed order, you have to pick the frame you're moving to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic use is &lt;code&gt;M-x ace-window K&lt;/code&gt;, where K is a single letter corresponding to one of the available windows. When you call &lt;code&gt;ace-window&lt;/code&gt;, each window is temporarily labeled with a letter, so you can see which letter gets you to the window you want.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-26T04:40:55.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30221" PostTypeId="1" AcceptedAnswerId="30222" CreationDate="2017-01-26T10:25:34.817" Score="12" ViewCount="18125" Body="&lt;p&gt;I'm using emacs 25.1.1 with the &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;noreferrer&quot;&gt;prelude&lt;/a&gt; config. In Atom I used to have a setting that made my lines wrap at 80 characters (without cutting words) for better readability. I've searched on the web for something similar for emacs but I have not found anything. Any ideas on how to do this?&lt;/p&gt;&#xA;" OwnerUserId="14695" LastEditorUserId="105" LastEditDate="2017-01-26T14:58:09.130" LastActivityDate="2022-03-09T12:44:25.210" Title="Wrap lines at 80 characters" Tags="|prelude|wrapping|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30222" PostTypeId="2" ParentId="30221" CreationDate="2017-01-26T10:58:17.187" Score="14" Body="&lt;p&gt;&lt;code&gt;auto-fill-mode&lt;/code&gt; is what you're looking for. You can enable it automatically for editing text by adding this to your config:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'text-mode-hook #'auto-fill-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You can customize how long lines in your text documents should be by customizing the &lt;code&gt;fill-column&lt;/code&gt; variable. For example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default fill-column 80)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you want to to make sure that lines don't split on your screen as you're typing things, you can set up &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Visual-Line-Mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;visual line mode&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To enable this for code files add:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook #'auto-fill-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This code needs to be added in your initialization file (&lt;code&gt;~/.emacs&lt;/code&gt; or similar). That will make the change effective the next time you start emacs, so either do that now or close and reopen files that are already open.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastEditorUserId="14825" LastEditorDisplayName="user12563" LastEditDate="2022-03-09T12:44:25.210" LastActivityDate="2022-03-09T12:44:25.210" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="30223" PostTypeId="1" CreationDate="2017-01-26T11:43:14.300" Score="1" ViewCount="39" Body="&lt;p&gt;Bookmarks remember the file together with the place of the cursor when the file is bookmarked.  But I just want the cursor to start in the beginning of the file when visiting it through bookmarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then how to stop bookmarks from remembering the cursor place?&lt;/p&gt;&#xA;" OwnerUserId="774" LastActivityDate="2017-01-26T11:43:14.300" Title="How to stop bookmarks from remembering the cursor place?" Tags="|bookmarks|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30225" PostTypeId="1" CreationDate="2017-01-26T12:59:13.793" Score="1" ViewCount="152" Body="&lt;p&gt;In its more recent versions, &lt;code&gt;shell-script&lt;/code&gt; mode tailors its behavior in response to the &lt;code&gt;sh-shell&lt;/code&gt; variable's value, which indicates the shell variant (&lt;code&gt;zsh&lt;/code&gt;, &lt;code&gt;bash&lt;/code&gt;, etc.) that the script is for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've written this simple snippet (for &lt;code&gt;shell-script&lt;/code&gt; mode) that uses the value of &lt;code&gt;sh-shell&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: shebang&#xA;# key: shebang&#xA;# --&#xA;#!/usr/bin/env ${1:`(symbol-name sh-shell)`}&#xA;# -*- mode: shell-script ; sh-shell: $1 -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After one types &lt;code&gt;shebang&amp;lt;TAB&amp;gt;&lt;/code&gt;, and assuming that &lt;code&gt;sh-shell&lt;/code&gt; is set to &lt;code&gt;bash&lt;/code&gt;, the following text is inserted&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env bash&#xA;# -*- mode: shell-script ; sh-shell: bash -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...with the cursor positioned at the beginning of the first &lt;code&gt;bash&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point one has the option to type the name of a different shell, which would replace both occurrences of &lt;code&gt;bash&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to modify the snippet so that, once the value of the &lt;code&gt;$1&lt;/code&gt; field is finalized, this value is stored in &lt;code&gt;sh-shell&lt;/code&gt;?  In this way the snippet would serve, in addition to inserting some text, as a way to re-set &lt;code&gt;sh-shell&lt;/code&gt; to a new value.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I know that I can always run &lt;code&gt;M-x normal-mode&lt;/code&gt; after updating the &lt;code&gt;$1&lt;/code&gt; field, to have Emacs read the new buffer mode settings from the &lt;code&gt;-*- ... -*-&lt;/code&gt; line, but it'd be nice to get the same end-result automatically once the snippet is finalized.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2017-01-26T16:57:37.233" LastActivityDate="2017-01-26T16:57:37.233" Title="How to save a yasnippet placeholder's final value in an Elisp variable?" Tags="|major-mode|yasnippet|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30226" PostTypeId="2" ParentId="30082" CreationDate="2017-01-26T13:00:11.483" Score="5" Body="&lt;p&gt;I had this disturbing warning in Emacs 25.1 too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401&quot; rel=&quot;noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401&lt;/a&gt; has proper solution to enable &lt;code&gt;colored-stats&lt;/code&gt; only for Bash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat ~/.inputrc&#xA;$if Bash&#xA;set colored-stats on&#xA;$endif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-01-26T13:00:11.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30227" PostTypeId="1" CreationDate="2017-01-26T13:55:16.043" Score="3" ViewCount="960" Body="&lt;p&gt;I want to define a yasnippet for &lt;code&gt;shell-script&lt;/code&gt; mode that would insert a chunk of text whose content depends on the setting of the &lt;code&gt;sh-shell&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the possible different text insertions are several lines long, and are quite different from each other, so doing this with conditional fields of the form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${N:`(case sh-shell (zsh  &quot;foo&quot;)&#xA;                    (bash &quot;bar&quot;)&#xA;                    (sh   &quot;baz&quot;)&#xA;                    (t    &quot;frobozz&quot;))`}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...would all but eliminate the convenient formatting one this sort of template for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; To clarify: the code above is not useful to me, because I need to insert multi-line formatted text, not little, one-word strings like &lt;code&gt;&quot;foo&quot;&lt;/code&gt;, &lt;code&gt;&quot;bar&quot;&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If I were to use an unholy mix of Elisp and &lt;code&gt;bash&lt;/code&gt; to represent what I'm looking for, this is how I'd represent it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`(case sh-shell (zsh &amp;lt;&amp;lt;EOZSH)&#xA;zsh version&#xA;    of&#xA;    snippet&#xA;    looks&#xA;    like&#xA;    this&#xA;EOZSH&#xA;                   (bash &amp;lt;&amp;lt;EOBASH)&#xA;bash version of snippet looks like this&#xA;EOZSH&#xA;                   (sh   &amp;lt;&amp;lt;EOSH)&#xA;sh&#xA; version&#xA;  of&#xA;   snippet&#xA;    looks&#xA;     like&#xA;      this&#xA;EOSH&#xA;                   (t    &amp;lt;&amp;lt;EODEFAULT)&#xA;default version&#xA;  of snippet&#xA;    looks&#xA;    like&#xA;    this&#xA;EOSH&#xA;)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;IOW, the snippet would consist of a single embedded Elisp &lt;code&gt;case&lt;/code&gt; expression, where the key of each key-value pair is a possible value of &lt;code&gt;sh-shell&lt;/code&gt;, and the value is a (formatted) snippet/template; I've represented the latter using (totally invalid) &lt;code&gt;heredoc&lt;/code&gt; notation.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Is there a (syntactically sound) way to implement this idea?&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2017-01-27T00:34:31.977" LastActivityDate="2018-03-23T07:57:47.960" Title="How to define a yasnippet whose content depends on the value of an Elisp variable?" Tags="|yasnippet|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30228" PostTypeId="1" AcceptedAnswerId="30244" CreationDate="2017-01-26T14:12:55.423" Score="0" ViewCount="215" Body="&lt;p&gt;Long time ago I added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives '((&quot;elpa&quot; . &quot;http://tromey.com/elpa/&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://tromey.com/elpa/elpa.rss&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tromey.com/elpa/elpa.rss&lt;/a&gt; latest package is from &lt;code&gt;2010-08-15 22:11&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that right that modern package repositories are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq package-archives&#xA;      '((&quot;gnu&quot; . &quot;https://elpa.gnu.org/packages/&quot;)&#xA;        (&quot;marmalade&quot; . &quot;https://marmalade-repo.org/packages/&quot;)&#xA;        (&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; Seems that Tom Tromey is initial author of &lt;code&gt;package.el&lt;/code&gt; &lt;a href=&quot;http://tromey.com/blog/?page_id=333&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tromey.com/blog/?page_id=333&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2017-01-26T15:00:39.617" LastActivityDate="2017-01-26T22:47:59.110" Title="Is http://tromey.com/elpa/ deprecated?" Tags="|package-repositories|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30229" PostTypeId="1" AcceptedAnswerId="30233" CreationDate="2017-01-26T14:21:36.723" Score="14" ViewCount="2739" Body="&lt;p&gt;I need many lines in my org-export latex header.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage[main=british,polutonikogreek]{babel}&#xA;#+LATEX_HEADER: \usepackage{fontspec}&#xA;#+LATEX_HEADER: \usepackage{hanging}&#xA;#+LATEX_HEADER: \setmainfont{ebgaramond}[Contextuals=Alternate]&#xA;#+LATEX_HEADER: \newcount\instr \instr=1 % hide/show instructions&#xA;#+LATEX_HEADER: \babelhyphenation[british]{philo-sophy}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an alternative to putting &lt;code&gt;#+LATEX_HEADER&lt;/code&gt; in front of each?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="12497" LastEditDate="2019-09-27T11:31:24.820" LastActivityDate="2019-09-27T11:31:24.820" Title="Long org-export latex header" Tags="|org-export|latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="30230" PostTypeId="2" ParentId="30065" CreationDate="2017-01-26T14:30:13.657" Score="0" Body="&lt;p&gt;You can put the caption above the results like below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+CAPTION: bLa&#xA; #+RESULTS:&#xA; [[file:tmp.png]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But first you have to create the result tag, evaluate the block and then evaluate the whole construct. (I'm on org 9.0.4)&lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2017-01-26T14:30:13.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30231" PostTypeId="2" ParentId="30065" CreationDate="2017-01-26T15:13:53.770" Score="3" Body="&lt;p&gt;By default, org exports code but not the results of the code. You need to ask it to do both with the &lt;code&gt;:exports&lt;/code&gt; argument. You can then add the caption before the &lt;code&gt;#+RESULTS:&lt;/code&gt; tag:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Testing source&#xA;&#xA;#+NAME: fig:20170117&#xA;#+BEGIN_SRC R  :file test.png :session org_org :exports both&#xA;x &amp;lt;- c(0, 3, 8, 9, 0)&#xA;y &amp;lt;- c(1, 4, 5, 6, 7)&#xA;plot(x, y, xlab=&quot;test_x&quot;, ylab=&quot;test_y&quot;)&#xA;mtext(&quot;Some plot&quot;)&#xA;#+END_SRC&#xA;&#xA;#+CAPTION: My first figure&#xA;#+RESULTS: fig:20170117&#xA;[[file:test.png]]&#xA;&#xA;&#xA;#+NAME: fig:org_fig&#xA;#+BEGIN_SRC python :file org.png  :session org_py :exports both&#xA;clf()&#xA;plot(np.sin(np.arange(0,7,0.1)))&#xA;plt.savefig('org.png', transparent=True, bbox_inches='tight')&#xA;'org.png'&#xA;#+END_SRC&#xA;&#xA;#+CAPTION: My second figure&#xA;#+RESULTS: fig:org_fig&#xA;[[file:org.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Exporting this to LaTeX produces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;\section*{Testing source}&#xA;\label{sec:org1a89d52}&#xA;&#xA;\lstset{backgroundcolor=\color[gray]{0.95},keywordstyle=\color{blue},frame=single,commentstyle=\color{BrickRed},columns=fixed,basicstyle=\ttfamily,stringstyle=\color{Red},keepspaces=true,showstringspaces=false,deletekeywords={ps,scan},language=R,label=org129c1a7,caption= ,captionpos=b,numbers=none}&#xA;\begin{lstlisting}&#xA;x &amp;lt;- c(0, 3, 8, 9, 0)&#xA;y &amp;lt;- c(1, 4, 5, 6, 7)&#xA;## plot.new() not needed!&#xA;plot(x, y, xlab=&quot;test_x&quot;, ylab=&quot;test_y&quot;)&#xA;mtext(&quot;Some plot&quot;)&#xA;\end{lstlisting}&#xA;&#xA;\begin{figure}[htbp]&#xA;\centering&#xA;\includegraphics[width=.9\linewidth]{test.png}&#xA;\caption{My first figure}&#xA;\end{figure}&#xA;&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-26T15:13:53.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30232" PostTypeId="1" CreationDate="2017-01-26T15:26:27.997" Score="2" ViewCount="397" Body="&lt;p&gt;I use emacs org-mode and find feature of source code blocks extremely useful. However, If I want to say highlight a couple of lines in my source code block, is it possible to achieve?&#xA;e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC java&#xA;int i = 0;&#xA;m() //this is new call&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here when I export my org-mode to HTML or some other format, I want &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m() //this is new call&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to stand out. The intention is convey your message as clearly as possible.&lt;/p&gt;&#xA;" OwnerUserId="10110" LastEditorUserId="105" LastEditDate="2017-01-26T15:46:13.360" LastActivityDate="2017-03-27T17:04:18.843" Title="Selectively Highlight lines in source code block" Tags="|org-mode|org-export|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30233" PostTypeId="2" ParentId="30229" CreationDate="2017-01-26T15:29:21.390" Score="16" Body="&lt;p&gt;A possible solution is to write a file with the LaTeX preamble, like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% This is the file MyTeXHeader.tex&#xA;\usepackage[main=british,polutonikogreek]{babel}&#xA;\usepackage{fontspec}&#xA;\usepackage{hanging}&#xA;\setmainfont{ebgaramond}[Contextuals=Alternate]&#xA;\newcount\instr \instr=1 % hide/show instructions&#xA;\babelhyphenation[british]{philo-sophy}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then use a single call of &lt;code&gt;#+latex_header&lt;/code&gt; in your org file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+title: A shortcut in my LaTeX header&#xA;#+author: Stan Lee&#xA;#+latex_header: \input{/path/to/your/MyTeXHeader.tex}&#xA;&#xA;* Introduction&#xA;  bla bla bla&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="2441" LastEditDate="2017-01-30T06:32:26.930" LastActivityDate="2017-01-30T06:32:26.930" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30234" PostTypeId="2" ParentId="30232" CreationDate="2017-01-26T15:46:05.093" Score="1" Body="&lt;p&gt;One option for highlighting (not specific to org-mode) would be the built in &lt;code&gt;hi-lock&lt;/code&gt; commands. You can use commands interactively to highlight a line or phrase matching a pattern, then save those patterns in the file for future use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-s h l this is a new call&lt;/code&gt; to highlight the line&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;M-s h w&lt;/code&gt; to write the current hi-lock patterns to the file&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you close and then re-open the file, you can run &lt;code&gt;M-x hi-lock-mode&lt;/code&gt; and have the option to read the patterns from the file and re-apply them. If you always want this you can set up an org-mode hook to enable hi-lock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Highlight-Interactively.html#Highlight-Interactively&quot; rel=&quot;nofollow noreferrer&quot;&gt;Highlight Interactively&lt;/a&gt; in the Emacs manual for details.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-01-26T15:46:05.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30235" PostTypeId="2" ParentId="29585" CreationDate="2017-01-26T15:59:38.613" Score="2" Body="&lt;p&gt;Lawlist's answer has a good survey of why &lt;code&gt;org-agenda-date-later&lt;/code&gt; won't work here.  Here's the function I wrote to remedy the problem when I ran into it for myself:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun aph/org-agenda-date-later (arg)&#xA;  &quot;As `org-agenda-date-later' but also work in TODO agendas.&#xA;&#xA;Unlike `org-agenda-date-later', there is some question of which&#xA;timestamp to use.  If the entry contains a timestamp for today's&#xA;date, that timestamp is changed; otherwise, the first active&#xA;timestamp in the entry is changed.&#xA;&#xA;Unlike `org-agenda-date-later', this command does not support&#xA;changing timestamps by increments other than days.&quot;&#xA;  ;; TODO: Make this undoable.&#xA;  (interactive &quot;p&quot;)&#xA;  (if (org-agenda-check-type nil 'agenda 'timeline)&#xA;      (org-agenda-date-later arg)&#xA;    (let ((marker (or (org-get-at-bol 'org-marker)&#xA;                      (org-agenda-error)))&#xA;          stamp)&#xA;      (org-agenda-with-point-at-orig-entry nil &#xA;        ;; First try today's date, then find any active timestamp.&#xA;        (unless (or (aph/org-find-timestamp nil 'active&#xA;                                            (aph/org-relative-timestamp))&#xA;                    (aph/org-find-timestamp nil 'active))&#xA;          (error &quot;Could not find a timestamp to change&quot;))&#xA;        (org-timestamp-up-day arg)&#xA;        (setq stamp (aph/org-timestamp-at-point)))&#xA;      (org-agenda-show-new-time marker stamp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to make this work, I have to actively search the entry text to find an appropriate timestamp (since, unlike in &lt;code&gt;agenda&lt;/code&gt;-type agendas, the timestamp isn't part of the agenda entry information).  To do so, I use the following subroutines.  (Sorry there are so many of them; I find the &lt;code&gt;org&lt;/code&gt; code is very bad about providing the end user with tools at the appropriate level of abstraction for many common tasks, so I tend to write a lot of these things.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun aph/org-timestamp-at-point (&amp;amp;optional pos)&#xA;  &quot;Return timestamp at point, or nil if none.&#xA;&#xA;If POS is non-nil, it is used in place of point.&quot;&#xA;  (save-excursion&#xA;    (goto-char (or pos (point)))&#xA;    (when (org-at-timestamp-p)&#xA;      (match-string 0))))&#xA;&#xA;(defun aph/org-find-timestamp (&amp;amp;optional pos type date)&#xA;  &quot;Move point to timestamp in entry at POS, and return point.&#xA;If no timestamp is found, return nil and do not move point.&#xA;&#xA;POS defaults to point if omitted.&#xA;&#xA;The TYPE parameter has the same meaning as in `org-re-timestamp'&#xA;and restricts which timestamps are considered.  The&#xA;first (earliest appearing) allowable timestamp is used.&#xA;&#xA;If DATE is supplied (as a timestamp), only timestamps for that&#xA;date are considered.&quot;&#xA;  (let ((target&#xA;         (save-excursion&#xA;           (save-restriction&#xA;             (widen)&#xA;             (goto-char (or pos (point)))&#xA;             (org-back-to-heading)&#xA;             (aph/org-narrow-to-entry)&#xA;             (let ((regexp (org-re-timestamp type)))&#xA;               (catch 'found&#xA;                 (while (re-search-forward regexp nil :noerror)&#xA;                   (when (or (not date)&#xA;                             (org-time=&#xA;                              (aph/org-timestamp-date-only (match-string 1))&#xA;                              (aph/org-timestamp-date-only date)))&#xA;                     (throw 'found (point))))))))))&#xA;    (when target (goto-char target))))&#xA;&#xA;(defun aph/org-narrow-to-entry ()&#xA;  &quot;Narrow buffer to current entry.&#xA;&#xA;An entry is the text between a heading and the start of its first&#xA;child.&quot;&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (outline-show-subtree)&#xA;    (narrow-to-region&#xA;     (progn (org-back-to-heading)        (point))&#xA;     (progn (org-next-visible-heading 1) (point)))))&#xA;&#xA;(defun aph/org-timestamp-date-only (timestamp)&#xA;  &quot;Remove time info from TIMESTAMP and return new timestamp.&#xA;TIMESTAMP is not modified.&quot;&#xA;  (replace-regexp-in-string &quot; ?[0-9][0-9]:[0-9][0-9]&quot; &quot;&quot; timestamp))&#xA;&#xA;(defun aph/org-relative-timestamp (&amp;amp;optional days hours inactive)&#xA;  &quot;Return a properly-formatted Org timestamp relative to today.&#xA;&#xA;The timestamp differs from the current time by DAYS and HOURS;&#xA;positive values are in the future.  The hours are only included&#xA;in the timestamp if HOURS is supplied.  (To get the current&#xA;timestamp, including the hour, supply 0 for HOURS.)&#xA;&#xA;The timestamp is active unless INACTIVE is non-nil.&quot;&#xA;  (let* ((format  (funcall (if hours #'cdr #'car) org-time-stamp-formats))&#xA;         (time    (current-time))&#xA;         (hours   (+ (or hours 0) (* 24 (or days 0)))))&#xA;    (cl-incf (nth 1 time) (* 60 60 hours))&#xA;    (when inactive&#xA;      (setq format (concat &quot;[&quot; (substring format 1 -1) &quot;]&quot;)))&#xA;    (format-time-string format time)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8647" LastActivityDate="2017-01-26T15:59:38.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30236" PostTypeId="1" AcceptedAnswerId="30239" CreationDate="2017-01-26T16:21:48.943" Score="8" ViewCount="3050" Body="&lt;p&gt;What is the difference between &lt;code&gt;add-to-list&lt;/code&gt; vs &lt;code&gt;add-hook&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I see in &lt;code&gt;progmodes/make-mode.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'completion-at-point-functions&#xA;          #'makefile-completions-at-point nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of &lt;code&gt;add-to-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;add-hook&lt;/code&gt; has interesting properties - it binds non-existing symbol! And it is convenient to use in &lt;code&gt;.emacs&lt;/code&gt;  to avoid &lt;code&gt;if&lt;/code&gt;/&lt;code&gt;when&lt;/code&gt; &lt;code&gt;boundp&lt;/code&gt; or &lt;code&gt;(defvar ...)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use &lt;code&gt;add-hook&lt;/code&gt; instead of &lt;code&gt;add-to-list&lt;/code&gt; in general? Or requirement to be a function for second argument of &lt;code&gt;add-hook&lt;/code&gt; is mandatory?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2018-04-15T15:12:44.407" LastActivityDate="2018-04-15T15:12:44.407" Title="add-to-list vs add-hook?" Tags="|hooks|list|coding-conventions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30237" PostTypeId="1" CreationDate="2017-01-26T16:25:31.740" Score="1" ViewCount="110" Body="&lt;p&gt;In my Org Mode document I have the following two blocks&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: fcn&#xA;#+BEGIN_SRC elisp :var pt=(point)&#xA;  (list pt (point))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: fcn&#xA;| 56 | 56 |&#xA;&#xA;#+NAME: second_block&#xA;#+BEGIN_SRC elisp :var a=(point) b=fcn(pt=(point))&#xA;  (list a b)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: second_block&#xA;| 213 | (13 13) | &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to determine a position of the &lt;code&gt;second_block&lt;/code&gt; and pass it to &lt;code&gt;fcn&lt;/code&gt;.  As a result of the &lt;code&gt;second_block&lt;/code&gt; I am expecting to obtain something like this &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| XYZ | (XYZ 13) | &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;XYZ&lt;/code&gt; is a position of the &lt;code&gt;second_block&lt;/code&gt; (it can be any point that belongs to the &lt;code&gt;second_block&lt;/code&gt;: ultimately &lt;code&gt;XYZ&lt;/code&gt; should work with &lt;a href=&quot;http://orgmode.org/manual/Using-the-property-API.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;property API functions&lt;/a&gt; as a &lt;code&gt;POM&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, I would like to have a solution &lt;strong&gt;that works independent of the current cursor position&lt;/strong&gt;. For instance It should work properly also when the cursor position doesn't point to the &lt;code&gt;second_block&lt;/code&gt;, for example after executing all code blocks in current buffer (with &lt;code&gt;C-c C-v b&lt;/code&gt;). &lt;strong&gt;In this context the &lt;code&gt;point&lt;/code&gt; function might be incorrectly applied here&lt;/strong&gt;, which I am aware of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, why is &lt;code&gt;b&lt;/code&gt; variable equal to &lt;code&gt;(13 13)&lt;/code&gt; after execution of the &lt;code&gt;second_block&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="14127" LastEditDate="2017-01-30T20:42:08.490" LastActivityDate="2017-01-30T20:42:08.490" Title="Determine a position of the Org Mode code block?" Tags="|org-mode|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30238" PostTypeId="2" ParentId="30236" CreationDate="2017-01-26T17:17:55.597" Score="6" Body="&lt;p&gt;In some cases you can use either function to add an element to a list.  That you &lt;em&gt;can&lt;/em&gt; do that does not mean that you &lt;em&gt;should&lt;/em&gt;, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The recommendation by Emacs is to use only &lt;code&gt;add-hook&lt;/code&gt; for a hook.  And &lt;code&gt;pushnew&lt;/code&gt; (&lt;code&gt;cl-pushnew&lt;/code&gt;) is generally recommended in place of &lt;code&gt;add-to-list&lt;/code&gt;.  (Common Lisp does not even have something like &lt;code&gt;add-to-list&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, unlike &lt;code&gt;add-to-list&lt;/code&gt;, &lt;code&gt;pushnew&lt;/code&gt; does not require its second argument to evaluate to a symbol (variable) -- it is a very general macro.  But it is a &lt;em&gt;macro&lt;/em&gt;, not a function, so you cannot map it (e.g. &lt;code&gt;cl-mapcar&lt;/code&gt;), &lt;code&gt;funcall&lt;/code&gt; it, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;add-to-list&lt;/code&gt; can typically be replaced by macro &lt;code&gt;pushnew&lt;/code&gt;.  The first &lt;code&gt;add-to-list&lt;/code&gt; arg is a symbol that is used as a list-valued variable.  Its second is any Lisp value.  Its fourth, &lt;code&gt;COMPARE-FN&lt;/code&gt; is a function that tests whether the element to add is already present - it has no counterpart in &lt;code&gt;add-hook&lt;/code&gt;, which always tests using &lt;code&gt;equal&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first &lt;code&gt;add-hook&lt;/code&gt; arg, the hook variable, need not have a list as its value -- it can be a single function.  The second arg should be a function, but there is no check that it is.  (That answers your second question.)  And its fourth arg, &lt;code&gt;LOCAL&lt;/code&gt;, means update the buffer-local, not the global, value of the hook - it has no counterpart in &lt;code&gt;add-to-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you mention about their difference, that &lt;code&gt;add-hook&lt;/code&gt; binds an unbound symbol, is true.  That's important for a hook, in particular, because most hook variables are not created by default. They are implicit in the definition of a mode, and they are created on the fly only when they are actually needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that bind-if-not-bound behavior what you really want for every add-something-to-a-list use case?  I'm guessing probably not.  But if that's important to you for some reason then you can easily add such behavior to your own function that adds an element to a variable that should be list-valued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;code&gt;C-h f&lt;/code&gt; for other differences, or (better) check their definitions in &lt;code&gt;subr.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you understand the differences then you can of course use each any way you like, taking its behavior into account.  But for &lt;em&gt;readability&lt;/em&gt; by others (or by you, later on), even in contexts where the behavior differences might not matter, it generally makes sense to use them as they were intended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using them in the intended/expected way, you do not mislead readers of your code.  The principal reason for using each as it is intended is to signal the intention/use to others and to yourself later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I differ from SDS's fine answer in this respect:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;add-to-list&lt;/code&gt; is not just for &quot;&lt;em&gt;other global customization variables&lt;/em&gt;&quot;.  It has nothing particularly to do with customization variables or with &lt;code&gt;.emacs&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not the case that &lt;code&gt;add-hook&lt;/code&gt; and &lt;code&gt;add-to-list&lt;/code&gt; are only for your &lt;code&gt;.emacs&lt;/code&gt; and that &lt;code&gt;pushnew&lt;/code&gt; is only for Lisp code.  For one thing, &lt;code&gt;.emacs&lt;/code&gt; contains Lisp code. ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is perfectly fine, and common, for Lisp code to use &lt;code&gt;add-hook&lt;/code&gt; and &lt;code&gt;add-to-list&lt;/code&gt; (though &lt;code&gt;pushnew&lt;/code&gt; is more common than &lt;code&gt;add-to-list&lt;/code&gt; nowadays).  (For decades Emacs did not even have &lt;code&gt;pushnew&lt;/code&gt;; &lt;code&gt;add-to-list&lt;/code&gt; was then recommended for all non-hook lists.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it is perfectly fine for your &lt;code&gt;.emacs&lt;/code&gt; file to use &lt;code&gt;pushnew&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The simple rule to remember is just this:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;add-hook&lt;/code&gt; only with hook variables, and &lt;code&gt;add-to-list&lt;/code&gt; or &lt;code&gt;pushnew&lt;/code&gt; only to add an element to a (non-hook) list value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really need or want something different, it is pretty easy to define it, and a good place to start is to look at the existing code for &lt;code&gt;add-hook&lt;/code&gt; and either &lt;code&gt;add-to-list&lt;/code&gt; or &lt;code&gt;pushnew&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-01-27T04:47:56.817" LastActivityDate="2017-01-27T04:47:56.817" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30239" PostTypeId="2" ParentId="30236" CreationDate="2017-01-26T17:54:54.680" Score="15" Body="&lt;h1&gt;The question you asked&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The biggest difference is the last argument: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;local&lt;/code&gt; for &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/subr.el#n1501&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;add-hook&lt;/code&gt;&lt;/a&gt; and &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;compare-fn&lt;/code&gt; for &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/subr.el#n1662&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;add-to-list&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This means that you have no control over how &lt;code&gt;add-hook&lt;/code&gt; decides whether it already contains what you are adding, while &lt;code&gt;add-to-list&lt;/code&gt; cannot control buffer-local status of the symbol you are modifying.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The question you meant to ask&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;These two functions are &lt;strong&gt;not&lt;/strong&gt; interchangeable: even in a situation when either would do what you want, there is &lt;strong&gt;one&lt;/strong&gt; that you &lt;em&gt;should&lt;/em&gt; use and the other that you should &lt;em&gt;not&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;add-hook&lt;/code&gt; is for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html&quot; rel=&quot;noreferrer&quot;&gt;hooks&lt;/a&gt;, i.e., variables described as such in their docs; their name usually ends with &lt;code&gt;-functions&lt;/code&gt; or &lt;code&gt;-hook&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;add-to-list&lt;/code&gt; is for other global customization variables, like &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Auto-Major-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;auto-mode-alist&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Subprocess-Creation.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;exec-path&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both are primarily for your &lt;code&gt;.emacs&lt;/code&gt;, not for programming.&#xA;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/List-Variables.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;push&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/Modify-Macros.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;cl-pushnew&lt;/code&gt;&lt;/a&gt; when programming instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you should not use these functions for the purposes they are not intended to is relatively &quot;soft&quot;.&#xA;Mostly it has to do with &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;code readability (what you write today will have to be read by others - including yourself 6 months from now) and &lt;/li&gt;&#xA;&lt;li&gt;robustness (what if the Emacs maintainers decide to change the behavior of these very high-level functions? these are not &lt;code&gt;car&lt;/code&gt; and &lt;code&gt;cdr&lt;/code&gt; whose meaning is set in stone!)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In other words, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;... a computer language is not just a way of getting a computer to perform operations, but rather ... it is a novel formal medium for expressing ideas about methodology&quot;&#xA;  Abelson/Sussman &quot;Structure and Interpretation of Computer Programs&quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When writing code, you are communicating with HUMANS &lt;em&gt;first&lt;/em&gt;.&#xA;The fact that there is a computer which can and will execute the code is (almost) inconsequential.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2017-01-29T13:45:59.700" LastActivityDate="2017-01-29T13:45:59.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30240" PostTypeId="2" ParentId="332" CreationDate="2017-01-26T17:55:20.737" Score="0" Body="&lt;p&gt;Paths to executable on partial prefix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(locate-file-completion-table&#xA;   exec-path&#xA;   exec-suffixes&#xA;   ;; here is prefix like &quot;emacs&quot; gives &quot;emacs21&quot;/&quot;emacs22&quot;/&quot;emacs-nox&quot;&#xA;   (thing-at-point 'filename)&#xA;   'identity&#xA;   t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-01-26T17:55:20.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30241" PostTypeId="1" CreationDate="2017-01-26T18:03:22.960" Score="0" ViewCount="72" Body="&lt;p&gt;With respect to this &lt;a href=&quot;https://emacs.stackexchange.com/a/3468/174&quot;&gt;answer&lt;/a&gt;, is there any way to enable syntax highlighting for the text printed in echo area by &lt;code&gt;blink-matching-open&lt;/code&gt;? I am asking for something similar to what &lt;a href=&quot;https://github.com/tr37ion/lua-block-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lua Block mode&lt;/a&gt; does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4n5Lh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4n5Lh.png&quot; alt=&quot;Lua_Block&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, this is the current behaviour:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kLEbZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kLEbZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="174" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-01-26T18:03:22.960" Title="Syntax highlight the opening parenthesis line printed in echo area" Tags="|balanced-parentheses|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30243" PostTypeId="1" CreationDate="2017-01-26T19:15:21.883" Score="0" ViewCount="630" Body="&lt;p&gt;Something I've found useful in other editors is the ability to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;take the selected text&lt;/li&gt;&#xA;&lt;li&gt;run an external command and pass the selection to its &lt;code&gt;stdin&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;take the external commands &lt;code&gt;stdout&lt;/code&gt; and replace the current selection with it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This way you can write useful text tools which operate on the selection using any language that can do basic io.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be done with emacs using the selection?&#xA;... a single character, word, paragraph... etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Directly in the command line, or via a key binding?)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Note&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The reason I'm asking this question is because I would like to operate on the selection. (i.e., the text that would be removed if &lt;code&gt;x&lt;/code&gt; was pressed).&#xA;In evil-mode &lt;code&gt;!sort&lt;/code&gt; for example only works on a line-level.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="105" LastEditDate="2017-01-27T03:03:09.623" LastActivityDate="2017-01-27T16:32:09.600" Title="How to use an external command to modify selected words and lines?" Tags="|shell-command|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30244" PostTypeId="2" ParentId="30228" CreationDate="2017-01-26T20:50:59.610" Score="4" Body="&lt;p&gt;Tom Tromey, who happens to be the author of package.el, put up the very first ELPA which is still available on his domain.  However &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/3m3j3n/whats_up_with_tromeycom/&quot; rel=&quot;nofollow noreferrer&quot;&gt;you should no longer use it&lt;/a&gt; and instead just refer to GNU ELPA which happens to be the default repository in &lt;code&gt;package-archives&lt;/code&gt;.  Maybe add another package archive while you're at it ;)&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2017-01-26T22:47:59.110" LastActivityDate="2017-01-26T22:47:59.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30247" PostTypeId="2" ParentId="30227" CreationDate="2017-01-26T23:45:08.833" Score="2" Body="&lt;p&gt;You can call any elisp function from your snippet definition, so if you can use a helper function defined in your init file to keep the snippet file tidier. In your &lt;code&gt;.emacs&lt;/code&gt; or &lt;code&gt;.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun snippet-helper ()&#xA;  (cond ((string-equal sh-shell &quot;zsh&quot;) &quot;foo&quot;)&#xA;        ((string-equal sh-shell &quot;bash&quot;) &quot;bar&quot;)&#xA;        ((string-equal sh-shell &quot;sh&quot;) &quot;baz&quot;)&#xA;        (t &quot;foo&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(note that the &lt;code&gt;case&lt;/code&gt; form doesn't work when comparing strings that aren't the same object, so I used &lt;code&gt;cond&lt;/code&gt; instead).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then your snippet becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: hhh&#xA;# key: hhh&#xA;# --&#xA;${N:`(snippet-helper)`}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-26T23:45:08.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30248" PostTypeId="1" CreationDate="2017-01-26T23:52:57.907" Score="4" ViewCount="721" Body="&lt;p&gt;When creating a list in org-mode, one can press M-RET to create a new line which already has a list item of the same indentation as the line above it in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one achieve the same thing but with a checkbox added if (and only if) the line one presses M-RET in has a checkbox?&lt;/p&gt;&#xA;" OwnerUserId="14203" LastActivityDate="2017-01-26T23:52:57.907" Title="Automatically create checkbox in new line" Tags="|org-mode|list|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30249" PostTypeId="2" ParentId="13092" CreationDate="2017-01-27T01:37:08.270" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/13122&quot;&gt;Improvement on answer above by Shingo Fukuyama.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This version checks for duplicate lines in active region but if there is none, searches the whole buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ov)&#xA;(defun highlight-duplicate-lines-in-region-or-buffer ()&#xA;(interactive)&#xA;&#xA;  (let* (&#xA;    ($beg (if mark-active (region-beginning) (point-min)))&#xA;    ($end (if mark-active (region-end) (point-max)))&#xA;    ($st (buffer-substring-no-properties $beg $end))&#xA;    ($lines)&#xA;    ($dup))&#xA;  (deactivate-mark t)&#xA;  (save-excursion&#xA;    (goto-char $beg)&#xA;    (while (&amp;lt; (point) $end)&#xA;      (let* (($b (point))&#xA;         ($e (point-at-eol))&#xA;         ($c (buffer-substring-no-properties $b $e))&#xA;         ($a (assoc $c $lines)))&#xA;    (when (not (eq $b $e))&#xA;      (if $a&#xA;          (progn&#xA;        (setq $dup (cons $b $dup))&#xA;        (setq $dup (cons (cdr $a) $dup)))&#xA;        (setq $lines&#xA;          (cons (cons $c $b) $lines)))))&#xA;      (forward-line 1))&#xA;    (mapc (lambda ($p)&#xA;        (ov-set (ov-line $p) 'face '(:foreground &quot;red&quot;)))&#xA;      (sort (delete-dups $dup) '&amp;lt;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14701" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-27T01:37:08.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30250" PostTypeId="2" ParentId="30193" CreationDate="2017-01-27T05:18:30.680" Score="1" Body="&lt;p&gt;The final status information of the process is reported on the mode&#xA;line for 3 seconds, however if you enter some keys during the 3&#xA;seconds, it will disappear immediately, thus if you are using Emacs&#xA;actively, you might miss that easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change the default behavior via the user option&#xA;&lt;code&gt;dired-async-message-function&lt;/code&gt;. Notes that the corresponding docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Function to use to notify result when operation finish.&lt;br&gt;&#xA;  Should take same args as `message'.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is not 100% correct, it actually takes &lt;code&gt;(text face &amp;amp;rest args)&lt;/code&gt;, which&#xA;is not the same as &lt;code&gt;message&lt;/code&gt;. Use the default value as an example, if&#xA;you want to change it. Here is another example which notifies via&#xA;voice by using say(1) which provided by macOS.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq dired-async-message-function&#xA;      (lambda (text face &amp;amp;rest args)&#xA;        (shell-command (format &quot;say '%s'&quot; (apply #'format text args)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-01-27T05:18:30.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30251" PostTypeId="1" CreationDate="2017-01-27T06:06:45.113" Score="0" ViewCount="1151" Body="&lt;p&gt;I was using emacs-ipython-notebook for data visualisation for some days.But then I started getting the error -&lt;strong&gt;ein failed to login to 8888&lt;/strong&gt;.I checked my ipyhton notebook server and it's running on default port 8888 and I also tried to change the port number and login again but failed.I tried &lt;strong&gt;ein:dev-bug-report-template&lt;/strong&gt; and here goes my system info&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## System info:&#xA;&#xA;```cl&#xA;(&quot;EIN system info&quot;&#xA; :emacs-version&#xA; &quot;GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)&#xA; of 2014-03-07 on lamiak, modified by Debian&quot;&#xA; :emacs-bzr-version nil&#xA; :window-system x&#xA; :emacs-variant nil&#xA; :os&#xA; (:uname&#xA;  &quot;Linux jamesbondu-HP-Pavilion-g6-Notebook-PC 4.2.0-41-generic #48~14.04.1-Ubuntu SMP Fri Jun 24 17:09:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux&#xA;&quot;&#xA;  :lsb-release&#xA;  &quot;No LSB modules are available.&#xA;Distributor ID: Ubuntu&#xA;Description:    Ubuntu 14.04.4 LTS&#xA;Release:    14.04&#xA;Codename:   trusty&#xA;&quot;)&#xA; :image-types&#xA; (svg imagemagick png gif tiff jpeg xpm xbm pbm postscript)&#xA; :image-types-available&#xA; (svg imagemagick png gif tiff jpeg xpm xbm pbm postscript)&#xA; :request&#xA; (:backend curl)&#xA; :ein&#xA; (:version &quot;0.12.1&quot;&#xA;       :source-dir &quot;/home/jamesbondu/.emacs.d/elpa/ein-20170119.927/&quot;)&#xA; :lib&#xA; ((:name &quot;websocket&quot;&#xA;     :path &quot;~/.emacs.d/elpa/websocket-20161113.1736/websocket.elc&quot;&#xA;     :featurep t&#xA;     :version-var websocket-version&#xA;     :version &quot;1.5&quot;)&#xA;  (:name &quot;request&quot;&#xA;     :path &quot;~/.emacs.d/elpa/request-20161221.1711/request.elc&quot;&#xA;     :featurep t&#xA;     :version-var request-version&#xA;     :version &quot;0.2.0&quot;)&#xA;  (:name &quot;popup&quot;&#xA;     :path &quot;~/.emacs.d/elpa/popup-20160709.729/popup.el&quot;&#xA;     :featurep nil&#xA;     :version-var nil&#xA;     :version nil)&#xA;  (:name &quot;python&quot;&#xA;     :path &quot;/usr/share/emacs/24.3/lisp/progmodes/python.elc&quot;&#xA;     :featurep t&#xA;     :version-var nil&#xA;     :version nil)))&#xA;```&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me with this?&lt;/p&gt;&#xA;" OwnerUserId="13546" LastEditorUserId="8431" LastEditDate="2017-05-28T19:19:50.770" LastActivityDate="2018-10-21T08:00:48.140" Title="ein failed to login to 8888" Tags="|python|emacsclient|ipython|ein|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30254" PostTypeId="1" CreationDate="2017-01-27T09:01:39.080" Score="0" ViewCount="512" Body="&lt;p&gt;I love using &lt;code&gt;org-ref&lt;/code&gt; in my &lt;code&gt;org&lt;/code&gt; files, and then export them to PDF (or even LaTeX). However, I have a lot of LaTeX manuscript which I don't want to translate into &lt;code&gt;org&lt;/code&gt;, and I could use an &lt;code&gt;org-ref&lt;/code&gt;-like way of managing the references within these files.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Is is possible? And How?&lt;/p&gt;&#xA;" OwnerUserId="2441" LastActivityDate="2017-01-27T09:01:39.080" Title="Is it possible to use `org-ref` in LaTeX mode?" Tags="|org-mode|latex|org-ref|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30255" PostTypeId="2" ParentId="30065" CreationDate="2017-01-27T09:31:59.603" Score="0" Body="&lt;p&gt;Additionaly, I was having problems where the figure would not be exported even with the &lt;code&gt;:exports both&lt;/code&gt; tag. I fixed this problem by installing the R package &amp;quot;tikzDevice&amp;quot; and add this to &lt;code&gt;~/.Rprofile&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;old &amp;lt;- getOption(&amp;quot;defaultPackages&amp;quot;)&lt;/p&gt;&#xA;&lt;p&gt;options(defaultPackages = c(old,&amp;quot;tikzDevice&amp;quot;))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Note that I had this problem in MacOS and not sure if this is required in Linux or Windows.&lt;/p&gt;&#xA;" OwnerUserId="13784" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-01-27T09:31:59.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30256" PostTypeId="1" AcceptedAnswerId="30257" CreationDate="2017-01-27T09:51:51.017" Score="7" ViewCount="917" Body="&lt;p&gt;If for some reason I am stuck to a keyboard with English layout and I often have to enter text in German - can emacs translate &lt;code&gt;ae&lt;/code&gt; to &lt;code&gt;ä&lt;/code&gt; (or &lt;code&gt;ue&lt;/code&gt; to &lt;code&gt;ü&lt;/code&gt;) for me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do have a not-working solution like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq abbrev-file-name &quot;~/.emacs.d/abbrev_defs&quot;&#xA;  save-abbrevs t) ;; save abbrevs when file is saved and emacs quits&#xA;&#xA;(if (file-exists-p abbrev-file-name)&#xA;(quietly-read-abbrev-file))&#xA;&#xA;(add-hook 'post-self-insert-hook 'expand-abbrev)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where in my &lt;code&gt;abbrev_defs&lt;/code&gt; I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-abbrev-table 'global-abbrev-table&#xA;  '(&#xA;    (&quot;ue&quot; &quot;ü&quot; nil 0)&#xA;    (&quot;ae&quot; &quot;ä&quot; nil 0)&#xA;    (&quot;sz&quot; &quot;ß&quot; nil 0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this only works at the beginning of a word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a solution for this available?&lt;/p&gt;&#xA;" OwnerUserId="970" LastEditorUserId="-1" LastEditDate="2017-01-27T20:07:04.453" LastActivityDate="2017-02-02T17:39:23.553" Title="Translate ae to ä on non-German keyboard" Tags="|unicode|input-method|characters|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30257" PostTypeId="2" ParentId="30256" CreationDate="2017-01-27T10:23:54.040" Score="13" Body="&lt;p&gt;You should be able to press &lt;code&gt;C-\ (toggle-input-method)&lt;/code&gt; and give it &lt;code&gt;german-postfix&lt;/code&gt; as an argument if asked (or with prefix) and then be able to type as you described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minibuffer will show you hints how to enter the diacritics. As always you can ask Emacs to show the documentation for a key with &lt;code&gt;C-h K&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4068" LastActivityDate="2017-01-27T10:23:54.040" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30258" PostTypeId="1" AcceptedAnswerId="30265" CreationDate="2017-01-27T11:31:48.447" Score="0" ViewCount="1141" Body="&lt;p&gt;I use &lt;code&gt;shell&lt;/code&gt; inside emacs but by default it prints output in 1 color.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I use &lt;code&gt;grep&lt;/code&gt;, I would like to see substring I'm searching highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see colors, I can manually type &lt;code&gt;TERM=ansi&lt;/code&gt; when shell starts, but I wonder if there is a way to run shell with &lt;code&gt;TERM&lt;/code&gt; defined?&lt;/p&gt;&#xA;" OwnerUserId="13536" LastActivityDate="2017-01-27T15:02:43.337" Title="Run 'TERM=ansi' when shell starts" Tags="|shell|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30259" PostTypeId="2" ParentId="29968" CreationDate="2017-01-27T13:00:29.963" Score="2" Body="&lt;p&gt;I assume that you use something like &lt;code&gt;:block thisweek&lt;/code&gt; and &lt;code&gt;:step day&lt;/code&gt;. I am not aware of a way to set an offset for this setup but there's a way to have one report per &quot;day&quot;/24h. For this, you have to create a clocktable for each day and instead of &lt;code&gt;:block&lt;/code&gt; and &lt;code&gt;:step&lt;/code&gt; you specifiy the start and end with &lt;code&gt;:tstart&lt;/code&gt; and &lt;code&gt;:tend&lt;/code&gt;, e.g. &lt;code&gt;:tstart &quot;[2017-01-30 Mon 06:00]&quot; :tend &quot;[2017-01-31 Tue 06:00]&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To automate things, you can use &lt;code&gt;org-clone-subtree-with-time-shift&lt;/code&gt; for copying the clocktable with a time shift of one day, e.g. &lt;code&gt;M-x org-clone-subtree-with-time-shift 6 +1d&lt;/code&gt;. This way, you can create the clocktables for one week, and if you have that, you can clone the subtree with the week clocktables again with a timeshift of &lt;code&gt;+1w&lt;/code&gt; to get as many clocktables as you'd like to have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this is not as convenient as having one table per week, it has the advantage that you don't commit to a fixed &quot;end-of-day time&quot;. In case, you start early one day, you can always adjust the clocktable for that day only.&lt;/p&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-01-27T13:00:29.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30260" PostTypeId="1" CreationDate="2017-01-27T13:28:25.430" Score="3" ViewCount="2116" Body="&lt;p&gt;I use &lt;code&gt;super&lt;/code&gt; modifier because it is transparent to any keymap (for example there is no need for &lt;kbd&gt;C-c C-j&lt;/kbd&gt; or &lt;kbd&gt;C-c C-x o&lt;/kbd&gt; in &lt;code&gt;term&lt;/code&gt; terminal mode, any &lt;code&gt;s-...&lt;/code&gt; command just works). Under X I use &lt;code&gt;xmodmap&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Under Windows 10 it is hard to use &lt;kbd&gt;Win&lt;/kbd&gt; key with letters and arrows key because this key binding is native to Windows (only &lt;kbd&gt;Win+F2&lt;/kbd&gt; - &lt;kbd&gt;Win+F12&lt;/kbd&gt;, &lt;kbd&gt;Win+Ins&lt;/kbd&gt;, &lt;kbd&gt;Win+Del&lt;/kbd&gt;, &lt;kbd&gt;Win+PgUp&lt;/kbd&gt;, &lt;kbd&gt;Win+PgDown&lt;/kbd&gt; passed back to Emacs) and:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq w32-pass-lwindow-to-system nil&#xA;      w32-pass-rwindow-to-system nil&#xA;      w32-pass-apps-to-system nil&#xA;      w32-lwindow-modifier 'super ; Left Windows key&#xA;      w32-rwindow-modifier 'super ; Right Windows key&#xA;      w32-apps-modifier 'hyper) ; Menu key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;doesn't help for LWin in Cygwin &lt;code&gt;emacs-w32&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I wonder if it's possible to use &lt;kbd&gt;CapsLock&lt;/kbd&gt; as &lt;code&gt;super&lt;/code&gt; modifier in Windows native and Cygwin emacs-w32...&lt;/p&gt;&#xA;&lt;p&gt;My laptop has only LWin and the only useless key is &lt;kbd&gt;CapsLock&lt;/kbd&gt;... There is num-pad but it is far from my hands usual position...&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2020-06-17T11:58:17.910" LastActivityDate="2020-06-17T12:00:25.070" Title="Emacs super key modifier on Caps Lock in Windows native and Cygwin emacs-w32" Tags="|key-bindings|window|keyboard-layout|emacs-w32|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30261" PostTypeId="1" CreationDate="2017-01-27T13:35:56.410" Score="2" ViewCount="23" Body="&lt;p&gt;How can I modify the prompt of another interactive command without copy-pasting too much?&#xA;Can I override only the interactive form?&lt;/p&gt;&#xA;" OwnerUserId="2126" LastActivityDate="2017-01-27T14:07:51.430" Title="How can I modify the prompt of another command?" Tags="|completing-read|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30262" PostTypeId="2" ParentId="30256" CreationDate="2017-01-27T13:52:39.133" Score="3" Body="&lt;p&gt;You could have a look at &lt;a href=&quot;https://github.com/vlevit/key-seq.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;key-seq&lt;/a&gt; or &lt;a href=&quot;https://www.emacswiki.org/emacs/key-chord.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;key-chord&lt;/a&gt;. Both lets you bind keys pressed together to a command, so if you press &quot;ae&quot; at the same time, you can bind it to &quot;ä&quot;.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastActivityDate="2017-01-27T13:52:39.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30263" PostTypeId="2" ParentId="30260" CreationDate="2017-01-27T13:58:22.413" Score="4" Body="&lt;p&gt;I feel your pain. Coming up with a decent hyper/super key binding which will work across all my keyboards is an ongoing search, especially given the widely varying laptop keyboard layouts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I dislike using the Windows key because it is actually useful when I am in Windows, and Windows steals an ever-increasing set of Win- keypresses at a low level which Emacs cannot intercept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach I am taking is to turn CapsLock into Control, then turn the left Control key into Apps (because not all my keyboards have Apps). Then I do the &lt;code&gt;w32-apps-modifier&lt;/code&gt; thing to turn it into a hyper key as you are doing in your question. This works well for emacs-w32, you get a genuine non-sticky modifier. In the terminal, it functions as a sticky modifier bound to &lt;code&gt;&amp;lt;print&amp;gt;&lt;/code&gt; See my question at &lt;a href=&quot;https://emacs.stackexchange.com/questions/18245/making-terminal-emacs-treat-apps-aka-menu-key-as-super-modifier?rq=1&quot;&gt;Making terminal Emacs treat APPS (aka MENU) key as super modifier&lt;/a&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I achieved the key remapping using a €15 tool called kbedit &lt;a href=&quot;http://www.kbdedit.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.kbdedit.com/&lt;/a&gt;. You could probably achieve something similar using AutoHotkey but I like kbdedit because it actually installs a new keyboard layout in Windows rather than intercepting messages. Just feels much cleaner.&lt;/p&gt;&#xA;" OwnerUserId="10231" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-27T17:28:45.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30264" PostTypeId="2" ParentId="30261" CreationDate="2017-01-27T14:07:51.430" Score="2" Body="&lt;p&gt;If the interactive form is smaller, I can copy and paste the form, and then call the original function.&lt;/p&gt;&#xA;" OwnerUserId="2126" LastActivityDate="2017-01-27T14:07:51.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30265" PostTypeId="2" ParentId="30258" CreationDate="2017-01-27T15:02:43.337" Score="1" Body="&lt;p&gt;Presumably you are using bash?  If you add &lt;code&gt;TERM=ansi&lt;/code&gt; to your &lt;code&gt;.bashrc&lt;/code&gt; all interactive non-login shells that are opened will have it set (including emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise if You only want that set in emacs you can create a file &lt;code&gt;~/.emacd.d/init_bash.sh&lt;/code&gt; (replacing &quot;bash&quot; with your default shell if not bash) containing &lt;code&gt;TERM=ansi&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;code&gt;shell&lt;/code&gt; docstring (&lt;code&gt;C-h f shell&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If a file ‘~/.emacs_SHELLNAME’ exists, or&#xA;  ‘~/.emacs.d/init_SHELLNAME.sh’, it is given as initial input...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-01-27T15:02:43.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30266" PostTypeId="1" CreationDate="2017-01-27T15:05:56.047" Score="4" ViewCount="271" Body="&lt;p&gt;I am a little new to emacs and have managed to get the color theme to my liking. However, I want to be able to use the same theme on a different machine and have been struggling to get it to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used M-x color-theme-print, to extract the current theme settings, saved the file, moved it to the new computer, placed it under ~/.emacs.d/name-theme.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when I try M-x color-theme-select, my theme is not in the list, but when I go into M-x customize-themes, and try to select my new theme I get the error: &quot;Undefined Custom theme&quot;. But now when I try, M-x color-theme-select, I can see my theme and can select it!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would very much appreciate some help with getting this fixed and setting up my emacs so I can load this theme at start up. Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code to my color theme: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(eval-when-compile    (require 'color-theme))&#xA;(defun my-color-theme ()&#xA;  &quot;Color theme by JS, created 2017-01-27.&quot;&#xA;  (interactive)&#xA;  (color-theme-install&#xA;   '(my-color-theme&#xA;     ((background-color . &quot;black&quot;)&#xA;      (background-mode . dark)&#xA;      (cursor-color . &quot;thistle&quot;)&#xA;      (foreground-color . &quot;wheat&quot;))&#xA;     ((list-matching-lines-buffer-name-face . underline)&#xA;      (list-matching-lines-face . match)&#xA;      (list-matching-lines-prefix-face . shadow)&#xA;      (widget-mouse-face . highlight))&#xA;     (default ((t (:stipple nil :background &quot;black&quot; :foreground &quot;wheat&quot; :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 1 :width normal :foundry &quot;default&quot; :family &quot;default&quot;))))&#xA;     (bold ((t (:bold t :weight bold))))&#xA;     (bold-italic ((t (:italic t :bold t :slant italic :weight bold))))&#xA;     (border ((t (nil))))&#xA;     (buffer-menu-buffer ((t (:bold t :weight bold))))&#xA;     (button ((t (:underline t :foreground &quot;cyan&quot;))))&#xA;     (comint-highlight-input ((t (:bold t :weight bold))))&#xA;     (comint-highlight-prompt ((t (:foreground &quot;cyan&quot;))))&#xA;     (completions-annotations ((t (:italic t :slant italic))))&#xA;     (completions-common-part ((t (nil))))&#xA;     (completions-first-difference ((t (:bold t :weight bold))))&#xA;     (cursor ((t (:background &quot;thistle&quot;))))&#xA;     (error ((t (:foreground &quot;salmon1&quot;))))&#xA;     (escape-glyph ((t (:foreground &quot;cyan&quot;))))&#xA;     (file-name-shadow ((t (:foreground &quot;grey70&quot;))))&#xA;     (fixed-pitch ((t (:family &quot;Monospace&quot;))))&#xA;     (font-lock-builtin-face ((t (:foreground &quot;LightSteelBlue&quot;))))&#xA;     (font-lock-comment-delimiter-face ((t (:foreground &quot;SpringGreen3&quot;))))&#xA;     (font-lock-comment-face ((t (:foreground &quot;SpringGreen3&quot;))))&#xA;     (font-lock-constant-face ((t (:foreground &quot;turquoise&quot;))))&#xA;     (font-lock-doc-face ((t (:foreground &quot;dark khaki&quot;))))&#xA;     (font-lock-function-name-face ((t (:foreground &quot;pale green&quot;))))&#xA;     (font-lock-keyword-face ((t (:foreground &quot;white&quot;))))&#xA;     (font-lock-negation-char-face ((t (nil))))&#xA;     (font-lock-preprocessor-face ((t (:foreground &quot;LightSteelBlue&quot;))))&#xA;     (font-lock-regexp-grouping-backslash ((t (:bold t :weight bold))))&#xA;     (font-lock-regexp-grouping-construct ((t (:bold t :weight bold))))&#xA;     (font-lock-string-face ((t (:foreground &quot;dark khaki&quot;))))&#xA;     (font-lock-type-face ((t (:foreground &quot;aquamarine&quot;))))&#xA;     (font-lock-variable-name-face ((t (:foreground &quot;yellow green&quot;))))&#xA;     (font-lock-warning-face ((t (:foreground &quot;salmon1&quot;))))&#xA;     (fringe ((t (:background &quot;grey10&quot;))))&#xA;     (glyphless-char ((t (:underline t))))&#xA;     (header-line ((t (:box (:line-width -1 :style released-button) :foreground &quot;black&quot; :background &quot;grey75&quot; :inverse-video nil :underline t))))&#xA;     (help-argument-name ((t (:italic t :slant italic))))&#xA;     (highlight ((t (:background &quot;dark green&quot; :foreground &quot;white&quot;))))&#xA;     (isearch ((t (:background &quot;dark goldenrod&quot; :foreground &quot;white&quot;))))&#xA;     (isearch-fail ((t (:background &quot;red4&quot;))))&#xA;     (italic ((t (:italic t :slant italic))))&#xA;     (lazy-highlight ((t (:background &quot;gray25&quot;))))&#xA;     (link ((t (:foreground &quot;cyan&quot; :underline t))))&#xA;     (link-visited ((t (:foreground &quot;dark cyan&quot; :underline t))))&#xA;     (match ((t (:background &quot;RoyalBlue3&quot;))))&#xA;     (menu ((t (nil))))&#xA;     (message-cited-text ((t (:foreground &quot;SpringGreen3&quot;))))&#xA;     (message-header-cc ((t (:foreground &quot;yellow green&quot;))))&#xA;     (message-header-name ((t (:foreground &quot;dark turquoise&quot;))))&#xA;     (message-header-newsgroups ((t (:italic t :bold t :foreground &quot;yellow&quot; :slant italic :weight bold))))&#xA;     (message-header-other ((t (:foreground &quot;dark khaki&quot;))))&#xA;     (message-header-subject ((t (:foreground &quot;pale turquoise&quot;))))&#xA;     (message-header-to ((t (:foreground &quot;pale green&quot;))))&#xA;     (message-header-xheader ((t (:foreground &quot;DeepSkyBlue1&quot;))))&#xA;     (message-mml ((t (:foreground &quot;MediumSpringGreen&quot;))))&#xA;     (message-separator ((t (:foreground &quot;deep sky blue&quot;))))&#xA;     (minibuffer-prompt ((t (:foreground &quot;cyan&quot;))))&#xA;     (mm-command-output ((t (:foreground &quot;ForestGreen&quot;))))&#xA;     (mode-line ((t (:background &quot;grey75&quot; :foreground &quot;black&quot; :box (:line-width -1 :style released-button)))))&#xA;     (mode-line-buffer-id ((t (:bold t :weight bold))))&#xA;     (mode-line-emphasis ((t (:bold t :weight bold))))&#xA;     (mode-line-highlight ((t (:box (:line-width 2 :color &quot;grey40&quot; :style released-button)))))&#xA;     (mode-line-inactive ((t (:background &quot;grey30&quot; :foreground &quot;grey80&quot; :box (:line-width -1 :color &quot;grey40&quot; :style nil) :weight light))))&#xA;     (mouse ((t (nil))))&#xA;     (next-error ((t (:foreground &quot;white&quot; :background &quot;dark green&quot;))))&#xA;     (nobreak-space ((t (:foreground &quot;cyan&quot; :underline t))))&#xA;     (pp^L-highlight ((t (nil))))&#xA;     (query-replace ((t (:foreground &quot;white&quot; :background &quot;dark goldenrod&quot;))))&#xA;     (region ((t (:background &quot;dark green&quot; :foreground &quot;white&quot;))))&#xA;     (scroll-bar ((t (nil))))&#xA;     (secondary-selection ((t (:background &quot;dark slate gray&quot;))))&#xA;     (shadow ((t (:foreground &quot;grey70&quot;))))&#xA;     (show-paren-match ((t (:background &quot;steelblue3&quot;))))&#xA;     (show-paren-mismatch ((t (:background &quot;purple&quot; :foreground &quot;white&quot;))))&#xA;     (success ((t (:foreground &quot;yellow green&quot;))))&#xA;     (tool-bar ((t (:foreground &quot;black&quot; :box (:line-width 1 :style released-button)))))&#xA;     (tooltip ((t (:family &quot;Sans Serif&quot; :background &quot;lightyellow&quot; :foreground &quot;black&quot;))))&#xA;     (trailing-whitespace ((t (:background &quot;red1&quot;))))&#xA;     (tty-menu-disabled-face ((t (:background &quot;blue&quot; :foreground &quot;lightgray&quot;))))&#xA;     (tty-menu-enabled-face ((t (:bold t :background &quot;blue&quot; :foreground &quot;yellow&quot; :weight bold))))&#xA;     (tty-menu-selected-face ((t (:background &quot;red&quot;))))&#xA;     (underline ((t (:underline t))))&#xA;     (variable-pitch ((t (:family &quot;Sans Serif&quot;))))&#xA;     (vertical-border ((t (:weight light :box (:line-width -1 :color &quot;grey40&quot; :style nil) :foreground &quot;grey80&quot; :background &quot;grey30&quot;))))&#xA;     (warning ((t (:foreground &quot;orange&quot;))))&#xA;     (widget-button ((t (:bold t :weight bold))))&#xA;     (widget-button-pressed ((t (:foreground &quot;red1&quot;))))&#xA;     (widget-documentation ((t (:foreground &quot;lime green&quot;))))&#xA;     (widget-field ((t (:background &quot;yellow3&quot; :foreground &quot;black&quot;))))&#xA;     (widget-inactive ((t (:foreground &quot;grey70&quot;))))&#xA;     (widget-single-line-field ((t (:background &quot;green3&quot; :foreground &quot;black&quot;))))&#xA;     (window-divider ((t (:foreground &quot;gray60&quot;))))&#xA;     (window-divider-first-pixel ((t (:foreground &quot;gray80&quot;))))&#xA;     (window-divider-last-pixel ((t (:foreground &quot;gray40&quot;)))))))&#xA;(add-to-list 'color-themes '(my-color-theme  &quot;JS&quot; &quot;JS&quot;))&#xA;&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="14706" LastActivityDate="2017-03-02T01:02:11.427" Title="Shifting Emacs Theme from one Computer to Another" Tags="|themes|customize|colors|customization|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30267" PostTypeId="1" AcceptedAnswerId="30269" CreationDate="2017-01-27T16:06:54.653" Score="4" ViewCount="126" Body="&lt;p&gt;This is what I have so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun find-and-toggle ()&#xA;  (interactive)&#xA;  (find-dired &quot;~/my-project&quot; &quot;-name *.py&quot;)&#xA;  (dired-toggle-marks))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This switches to the find-dired buffer, but dired-toggle-marks appears to do nothing. What am I doing incorrectly?&lt;/p&gt;&#xA;" OwnerUserId="3944" LastEditorUserId="105" LastEditDate="2017-01-27T17:10:26.870" LastActivityDate="2017-01-27T17:32:02.493" Title="How to run `find-dired` and toggle all files?" Tags="|dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30268" PostTypeId="1" CreationDate="2017-01-27T16:18:30.497" Score="6" ViewCount="336" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; (how) can I get &lt;code&gt;org&lt;/code&gt; timestamps to include time zones?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working with colleagues who live in different time zones.&#xA;When we set up phone calls and appointments, we often do the&#xA;elaborate and error-prone &quot;X o'clock your time, X-Y o'clock mine&quot;&#xA;dance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to schedule (or set a deadline for) a call&#xA;with an explicit time zone (e.g., &quot;X o'clock &lt;strong&gt;EST&lt;/strong&gt;&quot;), and then&#xA;let &lt;code&gt;org&lt;/code&gt; mode worry about doing the mental math for me based on&#xA;the time zone I happen to be in at the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Can I get timezone-aware timestamps in &lt;code&gt;org-mode&lt;/code&gt;, and how?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-27T16:18:30.497" Title="Org timestamps with timezones?" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ClosedDate="2017-01-27T17:13:50.307" ContentLicense="CC BY-SA 3.0" />
  <row Id="30269" PostTypeId="2" ParentId="30267" CreationDate="2017-01-27T16:20:32.400" Score="4" Body="&lt;p&gt;Your code is doing what you want - almost.  The problem is that it does not wait for the Dired buffer to be filled with the listing before it executes the toggling of marks.  It toggles marks before any files are actually listed - so it does nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see this if you add, e.g., &lt;code&gt;(sleep-for 2.0)&lt;/code&gt; or similar after your call to &lt;code&gt;find-dired&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A real solution involves not just waiting arbitrarily but checking to see when the &lt;code&gt;find&lt;/code&gt; command is finished before toggling the marks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can put the mark-toggling on a hook such as &lt;code&gt;dired-readin-hook&lt;/code&gt;.  However, since you also want to remove that action from the hook after it is done, the function that you add to the hook should do both of these things: (1) toggle the marks and then (2) remove itself from the hook.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun find-and-toggle ()&#xA;  (interactive)&#xA;  (add-hook 'dired-after-readin-hook 'f-dired-toggle-marks)&#xA;  (find-dired &quot;~/my-project&quot; &quot;-name *.py&quot;))&#xA;&#xA;(defun f-dired-toggle-marks ()&#xA;  (dired-toggle-marks)&#xA;  (remove-hook 'dired-after-readin-hook 'f-dired-toggle-marks))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Oops.  For that to work you need to use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/find-dired%2b.el&quot;&gt;&lt;code&gt;find-dired+.el&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some code that works without that library:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun find-and-toggle ()&#xA;  (interactive)&#xA;  (advice-add 'find-dired-sentinel :after 'f-dired-toggle-marks)&#xA;  (find-dired &quot;~/my-project&quot; &quot;-name *.py&quot;))&#xA;&#xA;(defun f-dired-toggle-marks (&amp;amp;rest ignore)&#xA;  (dired-toggle-marks)&#xA;  (advice-remove 'find-dired-sentinel 'f-dired-toggle-marks))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Among other enhancements, the version of &lt;code&gt;find-dired-sentinel&lt;/code&gt; in library &lt;code&gt;find-dired+.el&lt;/code&gt; runs hooks &lt;strong&gt;&lt;code&gt;find-dired-hook&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;dired-after-readin-hook&lt;/code&gt;&lt;/strong&gt;.  Without that library you need to &lt;em&gt;advise&lt;/em&gt; function &lt;code&gt;find-dired-sentinel&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an older version of Emacs, which does not have the new advice system (&lt;code&gt;advice-add&lt;/code&gt;, &lt;code&gt;advice-remove&lt;/code&gt;) then you will need to use the old advice system (&lt;code&gt;defadvice&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-01-27T17:32:02.493" LastActivityDate="2017-01-27T17:32:02.493" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30270" PostTypeId="2" ParentId="30243" CreationDate="2017-01-27T16:32:09.600" Score="2" Body="&lt;p&gt;You can use the function&#xA;&lt;a href=&quot;https://www.masteringemacs.org/article/executing-shell-commands-emacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;shell-command-on-region&lt;/code&gt;&lt;/a&gt; to&#xA;pipe some text into an external command.  For example, the&#xA;following simple command will give you a word count of the active&#xA;region by sending the selected text to the shell command &lt;code&gt;wc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun wc-region (beg end)&#xA;  &quot;Count words in the active region.&quot;&#xA;  (interactive &quot;*r&quot;)&#xA;  (if (region-active-p)&#xA;      (shell-command-on-region beg end &quot;wc -w&quot;)&#xA;    (message &quot;No active region&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can adapt other members of the &lt;code&gt;shell-command&lt;/code&gt; family as&#xA;necessary if you're not interested in using the region (e.g., if&#xA;you'd like to use &lt;code&gt;thing-at-point&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-27T16:32:09.600" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30271" PostTypeId="2" ParentId="30260" CreationDate="2017-01-27T19:17:54.990" Score="1" Body="&lt;p&gt;There is a solution for my problem, that possible &lt;em&gt;without any external dependencies&lt;/em&gt;!!&lt;/p&gt;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Keyboard.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Keyboard.html&lt;/a&gt; native Emacs can:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;w32-apps-modifier&#xA;  Variable: Modifier to use for the &amp;quot;Apps&amp;quot; key.&#xA;w32-lwindow-modifier&#xA;  Variable: Modifier to use for the left &amp;quot;Windows&amp;quot; key.&#xA;w32-rwindow-modifier&#xA;  Variable: Modifier to use for the right &amp;quot;Windows&amp;quot; key.&#xA;w32-scroll-lock-modifier&#xA;  Variable: Modifier to use for the Scroll Lock ON state.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In article &lt;a href=&quot;https://msdn.microsoft.com/windows/hardware/drivers/hid/keyboard-and-mouse-class-drivers&quot; rel=&quot;nofollow noreferrer&quot;&gt;Keyboard and mouse class drivers&lt;/a&gt; it is mentioned that it is possible to adjust keyboard layout (for all user) playing with &lt;strong&gt;keycodes&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There is &lt;a href=&quot;http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc&quot; rel=&quot;nofollow noreferrer&quot;&gt;Keyboard Scan Code Specification for PS/2 compatible keyboards&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Firstly I try to use &lt;code&gt;w32-scroll-lock-modifier&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq w32-scroll-lock-modifier 'super)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;in order to keep other modifiers without changes:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Windows Registry Editor Version 5.00&#xA;&#xA;[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]&#xA;; CapsLock =&amp;gt; ScrollLock&#xA;&amp;quot;Scancode Map&amp;quot;=hex:00,00,00,00,00,00,00,00,02,00,00,00,46,00,3a,00,00,00,00,00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;but &lt;kbd&gt;Scroll Lock&lt;/kbd&gt; &lt;strong&gt;keeps state&lt;/strong&gt;, so releasing after first pressing keeps &lt;code&gt;scroll&lt;/code&gt; &lt;strong&gt;on&lt;/strong&gt; as if super key is still pressed and not released.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;It can be emacs-w32 v24 Cygwin bug.&lt;/em&gt; So I moved further and succeeded with:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(when (eq window-system 'w32)&#xA;  (setq w32-apps-modifier 'super))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But my hands trained to work with &lt;kbd&gt;LWin&lt;/kbd&gt;, and not with &lt;kbd&gt;Caps Lock&lt;/kbd&gt;. So I made 2 swaps and with:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;; CapsLock (3a,00) =&amp;gt; LWin (5b,e0); LWin (5b,e0) =&amp;gt; Apps (5d,e0)&#xA;&amp;quot;Scancode Map&amp;quot;=hex:00,00,00,00,00,00,00,00,03,00,00,00,5b,e0,3a,00,5d,e0,5b,e0,00,00,00,00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;kbd&gt;LWin&lt;/kbd&gt; key is actually &lt;kbd&gt;Apps&lt;/kbd&gt; key and &lt;kbd&gt;LWin&lt;/kbd&gt; moved to &lt;kbd&gt;Caps Lock&lt;/kbd&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now my &lt;strong&gt;Windows&lt;/strong&gt; keyboard workflow doesn't differ from &lt;strong&gt;X&lt;/strong&gt; workflow.&lt;/p&gt;&#xA;&lt;p&gt;Of course I disabled layout switching to preserve &lt;kbd&gt;Ctrl&lt;/kbd&gt; / &lt;kbd&gt;Alt&lt;/kbd&gt; / &lt;kbd&gt;Shift&lt;/kbd&gt; solely to Emacs with:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[HKEY_CURRENT_USER\Keyboard Layout\Toggle]&#xA;; The value 1 specifies that LEFT ALT+SHIFT switches locales.&#xA;; The value 2 specifies CTRL+SHIFT.&#xA;; 3 disables the key sequence altogether.&#xA;; I decide use AutoHotkey to switch locales.&#xA;;&#xA;; These customisations have affect at least after logout/login.&#xA;&amp;quot;Hotkey&amp;quot;=&amp;quot;3&amp;quot;&#xA;&amp;quot;Language Hotkey&amp;quot;=&amp;quot;3&amp;quot;&#xA;&amp;quot;Layout Hotkey&amp;quot;=&amp;quot;3&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There is a way to switch layout in Windows 10 with &lt;kbd&gt;Win + Space&lt;/kbd&gt; (or &lt;kbd&gt;Caps Lock + Space&lt;/kbd&gt; after keyboard layout twicks)!&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="947" LastEditDate="2020-06-17T12:00:25.070" LastActivityDate="2020-06-17T12:00:25.070" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30272" PostTypeId="1" CreationDate="2017-01-27T19:50:36.593" Score="12" ViewCount="7457" Body="&lt;p&gt;How do I get the output of &lt;code&gt;(shell-command &quot;df&quot;)&lt;/code&gt; (or some other more complex command, that I don't want to retype often) in the current buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run it by typing &lt;code&gt;C-c p&lt;/code&gt; after it, but then it opens another buffer and sends the output there.&lt;/p&gt;&#xA;" OwnerUserId="14708" LastEditorUserId="253" LastEditDate="2017-01-27T20:05:40.627" LastActivityDate="2017-01-31T12:16:52.257" Title="Get output of external command in the buffer" Tags="|commands|shell-command|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30273" PostTypeId="2" ParentId="30272" CreationDate="2017-01-27T20:02:56.953" Score="3" Body="&lt;p&gt;Here's a very simple function that will insert the shell&#xA;command's output at point it the current buffer.  Note that it&#xA;makes no effort to do error checking, but you can adapt it to do&#xA;so if needed:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-shell-command-output (command)&#xA;  &quot;Get shell COMMAND output and insert it at point in current&#xA;buffer.&quot;&#xA;  (insert (shell-command-to-string command)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example: &lt;code&gt;M-: (insert-shell-command-output &quot;echo 'puppies'&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this function as the basis for an interactive command, and then bind that command to a key, once you know which shell command you'd like to run over and over again:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun insert-puppies-output ()&#xA;  &quot;Insert my command output into the buffer.&quot;&#xA;  (interactive)&#xA;  (insert-shell-command-output &quot;echo 'puppies'&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-27T20:02:56.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30274" PostTypeId="1" CreationDate="2017-01-27T21:45:08.713" Score="1" ViewCount="78" Body="&lt;p&gt;I am executing a src block on a table that is determined by a prompt. A minimal example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: a-table&#xA;| Value  |&#xA;&#xA;#+begin_src emacs-lisp :var (princ (format &quot;table=a-table&quot; (read-string &quot;Select: &quot;)))&#xA;table&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;| Value |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All is fine except that read-string is executed twice and takes the second prompts value. In reality I'm using helm to select from a list of tables and the helm prompt also appears twice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moving &lt;code&gt;:var&lt;/code&gt; to a &lt;code&gt;header-args&lt;/code&gt; property changes nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Org mode version 9.0.3&lt;/code&gt; and &lt;code&gt;GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="14283" LastActivityDate="2017-01-28T09:21:59.083" Title="Org-babel variables argument reading twice" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30275" PostTypeId="1" AcceptedAnswerId="30276" CreationDate="2017-01-28T00:16:04.330" Score="5" ViewCount="478" Body="&lt;p&gt;In my &lt;code&gt;init&lt;/code&gt; file, I have &lt;code&gt;C-)&lt;/code&gt; bound to a &lt;code&gt;smartparens&lt;/code&gt; &quot;slurp&quot; command. This works great on linux, but when I try to use the same keybinding on my Windows machine, nothing happens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To troubleshoot on my Windows machine, I've tried &lt;code&gt;C-h c&lt;/code&gt; followed by &lt;code&gt;C-)&lt;/code&gt;—emacs doesn't register that any keys have been hit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried a couple of similar key sequences: &lt;code&gt;M-)&lt;/code&gt; and &lt;code&gt;C-0&lt;/code&gt; both register fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea why &lt;code&gt;C-)&lt;/code&gt; doesn't register, and any idea how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="14499" LastActivityDate="2017-01-28T02:14:26.727" Title="C-) not recognized on Windows 10" Tags="|key-bindings|microsoft-windows|keystrokes|prefix-keys|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30276" PostTypeId="2" ParentId="30275" CreationDate="2017-01-28T02:14:26.727" Score="5" Body="&lt;p&gt;I found a solution—the following works for me:&lt;br&gt;&#xA;&lt;code&gt;Control Panel&lt;/code&gt; &gt; &lt;br&gt;&#xA;&lt;code&gt;Language&lt;/code&gt; &gt; &lt;br&gt;&#xA;&lt;code&gt;Advanced Settings&lt;/code&gt; &gt; &lt;br&gt;&#xA;&lt;code&gt;Change language bar hot keys&lt;/code&gt; &gt; &lt;br&gt;&#xA;Ensure &lt;code&gt;Between input languages&lt;/code&gt; is highlighted &gt; &lt;br&gt;&#xA;&lt;code&gt;Change Key Sequence...&lt;/code&gt; &gt;&lt;br&gt;&#xA;Change &lt;code&gt;Switch Keyboard Layout&lt;/code&gt; from &lt;code&gt;Ctrl + Shift&lt;/code&gt; to &lt;code&gt;Not Assigned&lt;/code&gt;.&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar process is outlined &lt;a href=&quot;https://groups.google.com/forum/#!topic/leo-editor/XqAQ48gE40Y&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="14499" LastActivityDate="2017-01-28T02:14:26.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30277" PostTypeId="1" CreationDate="2017-01-28T06:01:09.317" Score="1" ViewCount="103" Body="&lt;p&gt;I would like to quickly access my org-contacts stored in the file ~/org/contacts.org through rofi.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;egrep &quot;^\* &quot; ~/org/contacts.org |rofi -dmenu -i&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;allows me to select the contact through rofi. However, I fail to forward the selection to emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient --eval &quot;(org-narrow-to-subtree $(egrep &quot;^\* &quot; ~/org/contacts.org |rofi -dmenu -i))&quot; ~/org/contacts.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want to do is: start emacsclient, then open the contacts.org file and narrow the subtree to the selection I made in rofi. Is this somehow possible?&lt;/p&gt;&#xA;" OwnerUserId="14712" LastActivityDate="2017-01-28T06:01:09.317" Title="Jump to narrowed subtree" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30278" PostTypeId="2" ParentId="29664" CreationDate="2017-01-28T08:14:45.827" Score="1" Body="&lt;p&gt;Since no one here has come up with an answer that is sufficient for my needs, I've continued with my aforementioned implementation which uses &lt;code&gt;paredit-backward-delete&lt;/code&gt; under certain conditions. What I've come up with isn't very pretty (nor very efficient), but it works well enough and seems to keep true to the spirit of &lt;code&gt;paredit&lt;/code&gt; from an end-user perspective. Here is the actual function itself, which I named &lt;code&gt;paredit-backward-delete-line&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun paredit-backward-delete-line ()&#xA;  &quot;Delete line backwards, preserving delimiters and not adding to the kill ring.&quot;&#xA;  (interactive)&#xA;  ;; These variables are set upon invocation. The first one indicates whether this command&#xA;  ;; was invoked inside of a string and the second one is a placeholder variable that will&#xA;  ;; be used later.&#xA;  (setq-local paredit--started-in-string-p (paredit-in-string-p))&#xA;  (setq-local paredit--backward-region-p nil)&#xA;&#xA;  ;; If a sexp or a string is behind us, and&#xA;  ;; * it's not an escaped character&#xA;  ;; * it's not a comment&#xA;  ;; * we're not in a string&#xA;  ;; ...&#xA;  (if (or (and (not (paredit-in-char-p (1- (point))))&#xA;               (not (paredit-in-comment-p))&#xA;               (eq (char-syntax (char-before)) ?\) ))&#xA;          (and (not (paredit-in-string-p))&#xA;               (eq (char-syntax (char-before)) ?\&quot; )))&#xA;      (progn&#xA;        ;; Select the region...&#xA;        (set-mark-command nil)&#xA;        (setq deactivate-mark nil)&#xA;        ;; Do a `paredit-backward'...&#xA;        (paredit-backward)&#xA;        ;; Save the region as a string and indicate that this block of code has been visited.&#xA;        (setq-local paredit--backward-region (buffer-substring (region-beginning) (region-end)))&#xA;        (setq-local paredit--backward-region-p t)&#xA;        ;; Then delete the selected region.&#xA;        (delete-active-region)))&#xA;  ;; If the previous `progn' block has not been run or the region that was selected is only one line...&#xA;  (if (or (null paredit--backward-region-p) (&amp;lt;= (s-count-matches &quot;\n&quot; paredit--backward-region) 1))&#xA;      ;; Do the following in a loop for the number of the current column...&#xA;      (dotimes (i (current-column))&#xA;        ;; If a sexp is (still) behind us, recur (this will cause the previous `progn' block to run&#xA;        ;; and get rid of that sexp).&#xA;        (if (and (not (paredit-in-char-p (1- (point))))&#xA;                 (not (paredit-in-comment-p))&#xA;                 (eq (char-syntax (char-before)) ?\) ))&#xA;            (paredit-backward-delete-line))&#xA;        ;; Otherwise, make sure: we're not in a comment, that the thing behind us isn't an escaped character,&#xA;        ;; that it's the beginning of a form or list, and that we're in an empty form / list. If that check does&#xA;        ;; not pass, see whether we started in a string and if we're in an empty string currently. If either of&#xA;        ;; these checks pass, do nothing.&#xA;        (unless (or (and (not (paredit-in-char-p (1- (point))))&#xA;                         (not (paredit-in-comment-p))&#xA;                         (eq (char-syntax (char-before)) ?\( )&#xA;                         (eq (char-after) (matching-paren (char-before))))&#xA;                    (and paredit--started-in-string-p&#xA;                         (eq (1- (point)) (car (paredit-string-start+end-points)))&#xA;                         (eq (point) (cdr (paredit-string-start+end-points)))))&#xA;          ;; If neither of those checks pass, delete backwards when we're in a comment or do a `paredit-backward-delete'&#xA;          ;; otherwise.&#xA;          (if (paredit-in-comment-p) (delete-backward-char 1) (paredit-backward-delete 1)))))&#xA;  ;; Finally, clear the echo area (`paredit-backward-delete' can be noisy).&#xA;  (message nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that it does not &lt;em&gt;kill&lt;/em&gt; the line backwards, but rather &lt;em&gt;deletes&lt;/em&gt; it. This is actually the behavior that I really wanted in the first place, but I asked the question with killing in mind because I thought it would be easier for someone to implement that because &lt;code&gt;paredit-kill&lt;/code&gt; already exists and does this sort of thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I bound this function to &lt;code&gt;&amp;lt;C-backspace&amp;gt;&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(define-key paredit-mode-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;) 'paredit-backward-delete-line)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And now I enjoy backwards deletion of lines which respects delimiters. Feel free to convert this function to utilize killing instead; it would be fairly easy to do.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2017-04-25T19:39:00.340" LastActivityDate="2017-04-25T19:39:00.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30279" PostTypeId="1" CreationDate="2017-01-28T08:46:44.103" Score="1" ViewCount="39" Body="&lt;p&gt;I want to visualize coverage data from the D compiler DMD on the fringe. &lt;a href=&quot;https://github.com/mattharrison/pycoverage.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;This packages&lt;/a&gt; makes use of &lt;code&gt;linum-.*&lt;/code&gt;. Is this the best way to visualize such things in the margin?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs package &lt;a href=&quot;https://github.com/dgutov/diff-hl/blob/master/diff-hl.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;diff-hl&lt;/a&gt; seems to be a good template. But does it have to be this complicated?&lt;/p&gt;&#xA;" OwnerUserId="12001" LastEditorUserId="12001" LastEditDate="2017-01-28T12:49:21.000" LastActivityDate="2017-01-28T12:49:21.000" Title="Visualizing D language coverage results in the fringe" Tags="|fringe|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30280" PostTypeId="1" AcceptedAnswerId="42202" CreationDate="2017-01-28T09:20:50.687" Score="9" ViewCount="1677" Body="&lt;p&gt;Sometimes I want to add a clock entry for something I did after it was already done. For example I may want to add an entry  &lt;code&gt;CLOCK: [2017-01-28 Sa 09:35]--[2017-01-28 Sa 10:12] =&amp;gt;  0:37&lt;/code&gt; at 10:30.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There doesn't seem to be any easy way to do it. The two methods I can currently think of are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Copy a previous entry and modify its time, then press &lt;code&gt;C-c C-c&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Invoke &lt;code&gt;org-time-stamp-inactive&lt;/code&gt; twice, and then manually type in all the rest (&lt;code&gt;CLOCK:&lt;/code&gt;, &lt;code&gt;--&lt;/code&gt; etc.), and then press &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can do it easier, or should I just try to define a custom function for this purpose?&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2023-05-25T02:13:33.570" Title="How to conveniently insert a clock entry?" Tags="|org-mode|org-clock|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30281" PostTypeId="2" ParentId="30274" CreationDate="2017-01-28T09:21:59.083" Score="1" Body="&lt;p&gt;Could it be that you have eldoc-mode or global-eldoc-mode active? I get the same behavior and other strange behavior (and I get prompted when just having the cursor on the argument line).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My way to debug such issues often is to enable &lt;code&gt;debug-on-quit&lt;/code&gt;. When I'm in the select prompt I hit &lt;code&gt;C-g&lt;/code&gt; and then from the backtrace I can see where the invocation originated. Eldoc mode definitely gets messed up with this kind of interactive prompting in the header argument. Depending on what modes you have active, could also originate from another tool trying to parse the code block arguments.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2017-01-28T09:21:59.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30282" PostTypeId="2" ParentId="30272" CreationDate="2017-01-28T10:52:23.230" Score="1" Body="&lt;p&gt;If you want to do this without installing any more functions or customizing exiting ones or tweaking init file, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u M-| df RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;df&lt;/code&gt; is the shell command you want run. The output of &lt;code&gt;df&lt;/code&gt; is inserted in the currently active buffer (and not the echo area) because of the &lt;code&gt;C-u&lt;/code&gt; prefix. Also note no quotes around the shell command, which makes it quicker to type and execute. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addendum: though &lt;code&gt;M-|&lt;/code&gt; is &lt;code&gt;shell-command-on-region&lt;/code&gt;, it does not require a region to be active when calling this command. But it also works when you need to send a region as well. In that sense, doubles as &lt;code&gt;M-!&lt;/code&gt; also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you don't want to retype long commands, you can cycle through previous shell commands with &lt;code&gt;M-p&lt;/code&gt; and &lt;code&gt;M-n&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u M-| M-p &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-01-29T05:01:36.907" LastActivityDate="2017-01-29T05:01:36.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30283" PostTypeId="1" CreationDate="2017-01-28T13:56:36.793" Score="2" ViewCount="105" Body="&lt;p&gt;When I run the code bellow directly in orgmode it outputs the correct result&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src sh :var value=1234 :tangle a.sh&#xA;echo &quot;value  = &quot; $value&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;value = 1234&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But when tangled, it generates file a.sh with only&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;echo &quot;value  = &quot; $value&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How do I get the assignment &quot;value=1234&quot; in a.sh ? &lt;/p&gt;&#xA;" OwnerUserId="14714" LastActivityDate="2017-01-28T20:17:39.273" Title="How to get values of :var arguments in ob-shell assigned when tangling?" Tags="|org-mode|tangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30285" PostTypeId="2" ParentId="30283" CreationDate="2017-01-28T20:17:39.273" Score="4" Body="&lt;p&gt;In my emacs 25.1.1. + org version 9.0.4 the tangled a.out file correctly contains&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;value='1234'&#xA;echo &quot;value  = &quot; $value&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have used these kind of functions and tangling extensively and for a long time, so I can only guess that you may be running a very old version of org mode. Try to update it from &lt;a href=&quot;http://orgmode.org/elpa/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/elpa/&lt;/a&gt; using the package manager.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2017-01-28T20:17:39.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30286" PostTypeId="2" ParentId="30280" CreationDate="2017-01-28T20:40:53.460" Score="7" Body="&lt;p&gt;I need to do what you describe quite often. My goal is to do everything from the agenda view, i.e. having to go to the org source files as few as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to insert a colck interval for a specific task I use &lt;code&gt;helm-org-agenda-files-headings&lt;/code&gt; (mapped to a keyboard shortcut) which allows me to find tasks very fast. I have defined an additional helm action for this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; extend helm for org headings with the clock in action&#xA;    (defun dfeich/helm-org-clock-in (marker)&#xA;      &quot;Clock into the item at MARKER&quot;&#xA;      (with-current-buffer (marker-buffer marker)&#xA;      (goto-char (marker-position marker))&#xA;      (org-clock-in)&#xA;      (org-clock-out)))&#xA;&#xA;    (eval-after-load 'helm-org&#xA;      '(nconc helm-org-headings-actions&#xA;          (list&#xA;           (cons &quot;Clock into task&quot; #'dfeich/helm-org-clock-in))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This inserts a clock interval with clock-in and clock-out times set to the present time. I then use my own module &lt;a href=&quot;https://github.com/dfeich/org-clock-convenience&quot; rel=&quot;noreferrer&quot;&gt;org-clock-convenience&lt;/a&gt; (also available from MELPA) to fast adjust the times directly from the agenda view screen (need to have log lines enabled):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This involves first moving the initial time somewhere into the range between the clock out of the previous task and the next task, then hitting &lt;code&gt;g&lt;/code&gt; (this rebuilds the screen with the task now being correctly placed in the interval). Then using &lt;code&gt;org-clock-convenience-fill-gap-both&lt;/code&gt; to have clock-in and clock-out expand to the full iterval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe have a look at the animated gif on the &lt;a href=&quot;https://github.com/dfeich/org-clock-convenience&quot; rel=&quot;noreferrer&quot;&gt;org-clock-convenience&lt;/a&gt; module page to get an idea how the clock modification from the agenda buffer works.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2017-01-28T20:40:53.460" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30287" PostTypeId="2" ParentId="30272" CreationDate="2017-01-28T21:04:39.437" Score="13" Body="&lt;p&gt;Actually the shortest way of doing it is to use &lt;code&gt;shell-command&lt;/code&gt; with a prefix argument. This is mapped to &lt;code&gt;C-u M-!&lt;/code&gt;. The &lt;code&gt;C-u&lt;/code&gt; prefix argument changes the standard &lt;code&gt;M-!&lt;/code&gt; to insert the output in the current buffer instead of just echoing it in the messages buffer. So, the full command for the df example is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u M-! df RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;C-u M-|&lt;/code&gt; that Emacs User is describing, is actually &lt;code&gt;shell-command-on-region&lt;/code&gt; which is a very cool command, too. You can use it e.g. to do a word count on the current selected region. It is even more useful with the prefix argument, because then the current region is replaced by the output of the shell command. I e.g. use this to pretty format an XML buffer by selecting the whole buffer and then using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-u M-| xmllint --format - RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to replace the whole buffer with the output from xmllint.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastActivityDate="2017-01-28T21:04:39.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30288" PostTypeId="2" ParentId="18533" CreationDate="2017-01-29T01:42:30.640" Score="2" Body="&lt;p&gt;Placing the following snippet in &lt;code&gt;user-init-file&lt;/code&gt; (&lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; in my case) worked for me. I also set ctrl-insert and shift-insert to copy/paste.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(when (eq system-type 'darwin)&#xA;  ;; when using Windows keyboard on Mac, the insert key is mapped to &amp;lt;help&amp;gt;&#xA;  ;; copy ctrl-insert, paste shift-insert on windows keyboard&#xA;  (global-set-key [C-help] #'clipboard-kill-ring-save)&#xA;  (global-set-key [S-help] #'clipboard-yank)&#xA;  ;; insert to toggle `overwrite-mode'&#xA;  (global-set-key [help] #'overwrite-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14722" LastEditorUserId="2731" LastEditDate="2017-09-27T03:46:00.767" LastActivityDate="2017-09-27T03:46:00.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30289" PostTypeId="1" CreationDate="2017-01-29T07:18:25.193" Score="1" ViewCount="158" Body="&lt;p&gt;I have emacs 25.1.1 installed on my kubuntu 16.10 with gtk-3.18.9.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those popup messages that you get with emacs when you exit without saving:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those are looking very strange and taking up my full screen. (I don't know what they are called and it is making it very hard to isolate the issue)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am attaching the screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SW3sL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SW3sL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see the popup takes up my entire screen and looks weird.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone experienced similar issues, or can at least point me in the right direction so i can find out what is causing the issue.&#xA;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This Seems to be solved when I force geometry restrictions on the windows manager settings.&#xA;But that kind of breaks the UI with some interleaving black blocks when I try to maximize.&#xA;To solve that I resized manually, instead of maximizing, and forced the window manager to remember size and position.&#xA;Pretty lame workaround, but I am happy with it for now.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-01-29T17:24:57.843" LastActivityDate="2017-01-29T17:24:57.843" Title="Weird emacs graphics on popup windows" Tags="|buffers|frames|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30290" PostTypeId="2" ParentId="24058" CreationDate="2017-01-29T07:37:12.540" Score="2" Body="&lt;p&gt;Use the function &lt;code&gt;org-agenda-clock-in&lt;/code&gt; instead of &lt;code&gt;org-clock-in&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:  &lt;a href=&quot;http://orgmode.org/manual/Agenda-commands.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/Agenda-commands.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-01-29T07:37:12.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30291" PostTypeId="1" CreationDate="2017-01-29T12:21:50.223" Score="1" ViewCount="46" Body="&lt;p&gt;I found a way to auto indent when I type one of &lt;kbd&gt;}&lt;/kbd&gt;, &lt;kbd&gt;;&lt;/kbd&gt; or &lt;kbd&gt;)&lt;/kbd&gt; using this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mode-autoindent-list '(javascript-mode js-mode php-mode web-mode))&#xA;(defun mode-autoindent ()&#xA;  (when (and (member major-mode mode-autoindent-list) (looking-back &quot;[});]&quot;))&#xA;    (indent-for-tab-command)))&#xA;&#xA;(add-hook 'post-self-insert-hook 'mode-autoindent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;inspired by the code in this answer on stack overflow &lt;a href=&quot;https://stackoverflow.com/a/23648867/387194&quot;&gt;Auto indent after inserting a semicolon or curly brace&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way, maybe build in mode?&lt;/p&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-01-29T12:21:50.223" Title="How to indent when type } ) or ;" Tags="|indentation|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30292" PostTypeId="2" ParentId="21822" CreationDate="2017-01-29T15:00:26.280" Score="8" Body="&lt;p&gt;The file &lt;code&gt;org-save-clock.el&lt;/code&gt; is used to store two kinds of information:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the active clock if emacs is shut down while a task is active&#xA;(gets stored in &lt;code&gt;org-clock-stored-resume-clock&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;the history of the n last clocked tasks (in a list of conses in&#xA;&lt;code&gt;org-clock-stored-history&lt;/code&gt;), where n is determined by the&#xA;number stored in &lt;code&gt;org-clock-history-length&lt;/code&gt; (default is 5)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Whether both of these variables are saved to the file depends on&#xA;the setting of &lt;code&gt;org-clock-persist&lt;/code&gt;. If you set it to &lt;code&gt;t&lt;/code&gt; both&#xA;informations are kept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A short look at the source code in &lt;code&gt;org-clock.el&lt;/code&gt; reveals that the&#xA;&lt;code&gt;org-save-clock.el&lt;/code&gt; file is read by the &lt;code&gt;org-clock-load&lt;/code&gt;&#xA;function. It checks whether the file belonging to the recorded task&#xA;exists, and if yes, it prompts the user whether the clock shall be&#xA;resumed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Important: The active clock is only saved to &lt;code&gt;org-clock-stored-resume-clock&lt;/code&gt;&#xA;when emacs is shut down; this can be seen in &lt;code&gt;org.el&lt;/code&gt; where the &lt;code&gt;org-clock-save&lt;/code&gt;&#xA;function is added to the &lt;code&gt;kill-emacs-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contents of &lt;code&gt;org-clock-stored-history&lt;/code&gt; are used in more&#xA;places. But mostly it serves as a clock-in convenience when using&#xA;the &lt;code&gt;org-clock-select-task&lt;/code&gt; interactive function that lets you&#xA;choose from the last few clocked tasks by using the tasks saved&#xA;in that variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The information in the initial line of the &lt;code&gt;org-clock-save.el&lt;/code&gt; file (the host and date information in the org-persist line) is not used at all inside the code. The file gets loaded as lisp code and there this line is just a comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, after all these facts, to your question:&#xA;&lt;strong&gt;Is it safe to add &lt;code&gt;org-clock-save.el&lt;/code&gt; to the &lt;code&gt;.gitignore&lt;/code&gt; file?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to be able and resume a clock on computer B that you&#xA;clocked in to on computer A before shutting down emacs on A, then&#xA;you would need to have it synced. Else you lose the information of&#xA;the active clocked-in task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But on the other hand, your loss is not&#xA;big, because the more important state is always conserved in the&#xA;tasks in the org files themselves, where for each clock interval&#xA;you have a CLOCK line, and org will warn you if there is a&#xA;&lt;em&gt;dangling&lt;/em&gt; clock item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, I think git is anyhow not the best thing for syncing such&#xA;state files. I think it is easier to keep these frequently changing&#xA;state files on a dropbox-like service. Else your commit history&#xA;fills up with a lot of trivial stuff. Git is good for the rest of&#xA;the &lt;code&gt;emacs.d&lt;/code&gt; directory to track the configuration changes. So, my&#xA;personal choice would actually be to define the position of the&#xA;&lt;code&gt;org-clock-save.el&lt;/code&gt; file to be on a dropbox-like storage and take&#xA;it out of the git repo (you could change the location by setting&#xA;another path by redefining the &lt;code&gt;org-clock-persist-file&lt;/code&gt; variable).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole clock saving mechanism naturally falls short if there are&#xA;two open emacs sessions working at the same time with the&#xA;&lt;code&gt;org-clock-save.el&lt;/code&gt; file or also if you forget to sync. This can&#xA;lead to minor conflicts (but that is trivially true for many use&#xA;cases where files are synched but do not get locked). However, as&#xA;already noted: The most important information is kept in the org&#xA;files themselves (the CLOCK lines), so the information there is&#xA;authoritative and overrides the state information in&#xA;&lt;code&gt;org-clock-save.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="2025" LastEditDate="2017-01-30T14:06:18.587" LastActivityDate="2017-01-30T14:06:18.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30293" PostTypeId="1" AcceptedAnswerId="30294" CreationDate="2017-01-29T16:06:00.630" Score="2" ViewCount="111" Body="&lt;p&gt;I'm trying to open a file with a given encoding and running into the problem that C-m is the same as RET.  There is an answer &lt;a href=&quot;https://emacs.stackexchange.com/questions/20240/how-to-distinguish-c-m-from-return&quot;&gt;here&lt;/a&gt;.  However, I don't want to bind a specific function; I want to restore all C-x C-m key bindings to their intended behavior; so, the next time I look up how to do something, it just works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This raises the question of why there even are C-x C-m bindings if they don't work.  Note I'm assuming this &lt;a href=&quot;https://www.emacswiki.org/emacs/ChangingEncodings&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt; is correct.  I don't know how to look up the command for the binding.  If I use C-h k to describe the command, I'm still stuck with the problem of how to type C-x C-m!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also looked at &lt;a href=&quot;https://emacs.stackexchange.com/questions/17509/how-to-distinguish-c-i-from-tab&quot;&gt;this answer&lt;/a&gt;, but I'm not clear if he's saying it can't be done, or is it only in a terminal that it's a problem?  I'm only using emacs in a GUI; I can't remember the last time I used it in a terminal.  I'm open to workarounds, such as using a different key.  The trouble with this is I won't remember it has been remapped unless I use it frequently...&lt;/p&gt;&#xA;" OwnerUserId="14727" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-29T18:05:01.010" Title="Bind all C-x C-m sequences properly" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30294" PostTypeId="2" ParentId="30293" CreationDate="2017-01-29T18:05:01.010" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Note I'm assuming this &lt;a href=&quot;https://www.emacswiki.org/emacs/ChangingEncodings&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt; is correct.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's basically correct, it sometimes puts &lt;code&gt;C-m&lt;/code&gt; instead of &lt;code&gt;RET&lt;/code&gt;.  In a default configured Emacs those are the same anyway and you might find it easier to type &lt;code&gt;C-x C-m&lt;/code&gt; than &lt;code&gt;C-x &amp;lt;return&amp;gt;&lt;/code&gt;.  Note that the official documentation uses &lt;code&gt;RET&lt;/code&gt; uniformly in this case, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Coding.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;(emacs) Text Coding&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;dt&gt;&lt;kbd&gt;C-x RET f coding RET&lt;/kbd&gt;&lt;/dt&gt;&#xA;  &lt;dd&gt;Use coding system coding to save or revisit the file in&#xA;  the current buffer (&lt;code&gt;set-buffer-file-coding-system&lt;/code&gt;).&#xA;  &lt;/dd&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I also looked at this &lt;a href=&quot;https://emacs.stackexchange.com/questions/17509/how-to-distinguish-c-i-from-tab&quot;&gt;answer&lt;/a&gt;, but I'm not clear if he's saying it can't be done, or is it only in a terminal that it's a problem?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's explaining that in a terminal, it's not possible to have &lt;code&gt;C-m&lt;/code&gt; and &lt;code&gt;RET&lt;/code&gt; be different.  You &lt;em&gt;can&lt;/em&gt; make them different in a GUI Emacs, but you probably shouldn't.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-01-29T18:05:01.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30295" PostTypeId="1" CreationDate="2017-01-29T19:33:27.870" Score="1" ViewCount="1143" Body="&lt;p&gt;I am using spacemacs. When writing .html file, it shows that it is in &lt;code&gt;web-mode&lt;/code&gt;. I want to indent, press &lt;code&gt;TAB&lt;/code&gt;, but nothing happened. So I can only use &lt;code&gt;SPC&lt;/code&gt; to indent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq web-mode-markup-indent-offset 4)&#xA;(setq web-mode-css-indent-offset 4)&#xA;(setq web-mode-code-indent-offset 4)&#xA;(setq web-mode-indent-style 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to .spacemacs file, but it did not work. I also tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-web-mode-hook ()&#xA;  &quot;Hooks for Web mode.&quot;&#xA;  (setq web-mode-markup-indent-offset 4)&#xA;  (setq web-mode-css-indent-offset 4)&#xA;  (setq web-mode-code-indent-offset 4)&#xA;  (setq web-mode-indent-style 4)&#xA;  )&#xA;(add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it did not work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what I should do to make it indent using &lt;code&gt;TAB&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;C-h k tab&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;tab&amp;gt; runs the command spacemacs/emmet-expand, which is an interactive Lisp&#xA;function in ‘../../../html/funcs.el’.&#xA;&#xA;It is bound to &amp;lt;tab&amp;gt;, TAB, &amp;lt;hybrid-state&amp;gt; &amp;lt;tab&amp;gt;, &amp;lt;hybrid-state&amp;gt; TAB,&#xA;&amp;lt;emacs-state&amp;gt; &amp;lt;tab&amp;gt;, &amp;lt;emacs-state&amp;gt; TAB, &amp;lt;insert-state&amp;gt; &amp;lt;tab&amp;gt;, &amp;lt;insert-state&amp;gt;&#xA;TAB.&#xA;&#xA;(spacemacs/emmet-expand)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14312" LastEditorUserId="14312" LastEditDate="2017-01-30T18:07:46.927" LastActivityDate="2017-01-30T18:07:46.927" Title="spacemacs, web-mode, cannot indent" Tags="|indentation|spacemacs|web-mode|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30296" PostTypeId="1" CreationDate="2017-01-29T23:04:56.633" Score="1" ViewCount="604" Body="&lt;p&gt;I am trying to turn on &lt;code&gt;linum-mode&lt;/code&gt; and &lt;code&gt;fci-mode&lt;/code&gt; for C++ editing. Here is my configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'&#xA;;; derivatives. If set to `relative', also turns on relative line numbers.&#xA;;; (default nil)&#xA;dotspacemacs-line-numbers t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following is included in &lt;code&gt;dotspacemacs/user-init ()&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Activate column indicator in prog-mode and text-mode, except for org-mode&#xA;(add-hook 'prog-mode-hook 'turn-on-fci-mode)&#xA;(add-hook 'text-mode-hook 'turn-on-fci-mode)&#xA;(add-hook 'org-mode-hook 'turn-off-fci-mode 'append)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which should work according to &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/4741&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/issues/4741&lt;/a&gt;. However the linum and fci modes are turned on for lisp but not for C++ mode. Anyone knows why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SJV9K.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SJV9K.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My emacs version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ emacs --version&#xA;GNU Emacs 25.1.91.1&#xA;Copyright (C) 2016 Free Software Foundation, Inc.&#xA;GNU Emacs comes with ABSOLUTELY NO WARRANTY.&#xA;You may redistribute copies of GNU Emacs&#xA;under the terms of the GNU General Public License.&#xA;For more information about these matters, see the file named COPYING.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10828" LastEditorUserId="10828" LastEditDate="2017-01-30T00:01:53.433" LastActivityDate="2017-01-30T00:01:53.433" Title="prog-mode-hook not run for C++ mode" Tags="|spacemacs|c++|prog-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30298" PostTypeId="1" CreationDate="2017-01-30T03:38:16.463" Score="2" ViewCount="232" Body="&lt;p&gt;I use surface book with 3000x2000 native resolution scaled 200%. I just reinstalled (spac)emacs with 25.1 version and a new emacs frame will start the right size then immediately halve in size as it starts to load and does not respect the 200% scale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried starting emacs on 100% then scaling up and all other such combinations to no success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A partial solution exists:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (add-to-list 'default-frame-alist '(font . &quot;Fira Code&quot;))&#xA;  (set-face-attribute 'default t :font &quot;Fira Code&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will set the frame to a good level but has two issues:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It overwrites &lt;code&gt;dotspacemacs-default-font&lt;/code&gt; options like bold, width.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Not everything is scaled back - in particular pylint code analysis popups are extremely small.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Once it is zoomed in it uses proper hdpi after setting &lt;code&gt;Disable display scaling on high DPI settings&lt;/code&gt; option on emacs.exe.&lt;/p&gt;&#xA;" OwnerUserId="14283" LastActivityDate="2017-01-30T03:38:16.463" Title="Updated from 24.5.1 to 25.1, not respecting default app scaling" Tags="|spacemacs|microsoft-windows|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30299" PostTypeId="1" CreationDate="2017-01-30T04:13:33.773" Score="2" ViewCount="818" Body="&lt;p&gt;I am using emacs on windows 7. Emacs is located on a usb on a university computer with no admin access but correctly loads the .emacs file. In my .emacs file I have &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; '(package-archives&#xA;   (quote&#xA;    ((&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)&#xA;     (&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;)))))&#xA;(custom-set-faces)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I try load package-list I get &#xA;Failed to download ‘melpa-stable’ archive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="14732" LastEditorUserId="105" LastEditDate="2017-01-30T06:01:30.490" LastActivityDate="2017-01-30T06:01:30.490" Title="melpa won't load on emacs windows" Tags="|package-repositories|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30300" PostTypeId="2" ParentId="30196" CreationDate="2017-01-30T08:15:51.943" Score="2" Body="&lt;p&gt;You could try &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Helm&lt;/a&gt; which is available to install from &lt;a href=&quot;http://stable.melpa.org/#/helm&quot; rel=&quot;nofollow noreferrer&quot;&gt;MELPA Stable&lt;/a&gt;. The &lt;code&gt;Helm&lt;/code&gt; framework allows you to easily and intuitively work with files, directories and buffers. Moreover, it provide simple access to common Helm commands such as &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;locate&lt;/code&gt;, etc...&lt;/p&gt;&#xA;" OwnerUserId="13326" LastActivityDate="2017-01-30T08:15:51.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30301" PostTypeId="2" ParentId="18687" CreationDate="2017-01-30T08:38:33.020" Score="2" Body="&lt;p&gt;In a similar approach to @giordano, I would suggest you have a look at the excellent &lt;a href=&quot;https://github.com/jkitchin/org-ref&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org-Ref&lt;/a&gt;, which is a collection of &lt;em&gt;org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools&lt;/em&gt;; together with &lt;a href=&quot;https://github.com/tmalsburg/helm-bibtex&quot; rel=&quot;nofollow noreferrer&quot;&gt;Helm-Bibtex&lt;/a&gt;, which can be used in unison with &lt;code&gt;org-ref&lt;/code&gt; to search and manage your bibliographies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With your insert reference or citation, etc, bound to &lt;code&gt;helm-bibtex&lt;/code&gt; you will now be given a list of options from entries that exist in you bibliographies &lt;code&gt;.bib&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, should you also decide to author you LaTeX documents in &lt;code&gt;org-mode&lt;/code&gt; files, using &lt;code&gt;org-ref&lt;/code&gt; and highlight non-existant references, citations or bibliogoraphy files, it will notify you with a &lt;code&gt;File does not exist&lt;/code&gt;, warning in the modeline.&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="13326" LastEditDate="2017-02-01T06:28:33.383" LastActivityDate="2017-02-01T06:28:33.383" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30302" PostTypeId="1" CreationDate="2017-01-30T11:37:51.773" Score="2" ViewCount="203" Body="&lt;p&gt;Even turning off &lt;code&gt;font-lock-mode&lt;/code&gt; and set &lt;code&gt;(setq python-shell-font-lock-enable nil)&lt;/code&gt;, the output of an ipython shell &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq python-shell-interpreter &quot;ipython&quot;)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;seems &lt;strong&gt;much&lt;/strong&gt; slow than the python shell&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq python-shell-interpreter &quot;python&quot;)&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A test snippet would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;np.set_printoptions(precision=8, threshold=10000, linewidth=120)&#xA;np.random.randn(99, 99)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My emacs version is &lt;code&gt;GNU Emacs 25.1.1 (x86_64-apple-darwin16.3.0, Carbon Version 157 AppKit 1504.76) of 2017-01-14&lt;/code&gt; and ipython version is &lt;code&gt;5.1.0&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to speed up the output of ipython shell ? Any help will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2017-01-30T11:37:51.773" Title="Output of ipython shell much slower than python shell" Tags="|python|font-lock|ipython|comint|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30303" PostTypeId="1" AcceptedAnswerId="30398" CreationDate="2017-01-30T14:05:00.307" Score="2" ViewCount="1147" Body="&lt;p&gt;What is the reverse method of &lt;code&gt;org-id-get-create&lt;/code&gt; -- i.e., remove the ID property drawer and also remove the corresponding entry in the &lt;code&gt;org-id-locations-file&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2018-01-12T17:54:15.203" Title="How to remove org- ID drawer + location file entry" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30304" PostTypeId="1" AcceptedAnswerId="30306" CreationDate="2017-01-30T16:54:26.507" Score="8" ViewCount="2484" Body="&lt;p&gt;I'd like to be able to select a specific cell in an org-mode table and add a background color to that cell for a pdf export. Such that &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| This Cell is formatted normally | This cell is greyed a bit|&#xA;| This cell is greyed as well     | This cell is white again |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12467" LastActivityDate="2018-04-11T22:30:35.547" Title="Add cell background colors to org-mode table in pdf export" Tags="|org-mode|org-export|org-table|pdf|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30305" PostTypeId="1" CreationDate="2017-01-30T17:10:43.093" Score="1" ViewCount="26" Body="&lt;p&gt;I have a very annoying bug in my isearch behaviour; the buffer gets indented (modified) when I enter the first letter during isearch. I've checked all hooks named &lt;code&gt;isearch.*hook&lt;/code&gt; but I can't find anything that differs from Vanilla Emacs. I think it only happens in &lt;code&gt;auto-indent-mode&lt;/code&gt;. I need ideas on how to track down such bugs and this one in particular.&lt;/p&gt;&#xA;" OwnerUserId="12001" LastActivityDate="2017-01-30T17:10:43.093" Title="Pinpointing an I-search Bug" Tags="|isearch|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30306" PostTypeId="2" ParentId="30304" CreationDate="2017-01-30T18:01:40.793" Score="9" Body="&lt;p&gt;Getting inspiration from &lt;a href=&quot;https://tex.stackexchange.com/questions/50349/color-only-a-cell-of-a-table&quot;&gt;this answer&lt;/a&gt;, the following works. You must install the xcolor package as instructed there.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_HEADER: \usepackage[table]{xcolor}&#xA;&#xA;* table test&#xA;&#xA;| hi   | there                              |&#xA;|------+------------------------------------|&#xA;| this | @@latex:\cellcolor{blue!25}@@ that |&#xA;| one  | two                                |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="53" LastEditorUserId="17985" LastEditDate="2018-04-11T22:30:35.547" LastActivityDate="2018-04-11T22:30:35.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30307" PostTypeId="1" AcceptedAnswerId="62253" CreationDate="2017-01-30T18:10:09.853" Score="1" ViewCount="1098" Body="&lt;p&gt;Pressing &lt;kbd&gt;q&lt;/kbd&gt; in an agenda view restores the window layout if &lt;code&gt;org-agenda-restore-windows-after-quit&lt;/code&gt; is non-nil. Is there a way to do the same on &lt;kbd&gt;RET&lt;/kbd&gt; (&lt;code&gt;org-agenda-switch-to&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="2290" LastActivityDate="2020-12-13T12:55:37.283" Title="How to restore window layout on `org-agenda-switch-to`?" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30308" PostTypeId="1" AcceptedAnswerId="30333" CreationDate="2017-01-30T18:11:59.270" Score="5" ViewCount="1735" Body="&lt;p&gt;Is there any way to use MathJax in emacs org-mode html export &lt;em&gt;without&lt;/em&gt; an internet connection?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that MathJax can be downloaded, but when I provide &lt;code&gt;org-html-mathjax-options&lt;/code&gt; with the path to &lt;code&gt;MathJax.js&lt;/code&gt;, the html file doesn't use MathJax at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated. Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; -- this has been answered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When in &lt;code&gt;org-html-mathjax-options&lt;/code&gt;, set &lt;code&gt;path&lt;/code&gt; to &lt;code&gt;/&amp;lt;path-to-mathjax&amp;gt;/MathJax/MathJax.js?config=TeX-AMS_HTM‌​L,local/local&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="14743" LastEditorUserId="14743" LastEditDate="2017-02-09T18:43:33.847" LastActivityDate="2019-12-10T08:26:01.630" Title="Use MathJax offline in org-mode export" Tags="|org-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30309" PostTypeId="1" CreationDate="2017-01-30T18:13:09.407" Score="5" ViewCount="616" Body="&lt;p&gt;LaTeX preview with &lt;code&gt;C-c C-x C-l&lt;/code&gt; looks very tiny on my HiDPI screen. What can I do to solve this?&lt;a href=&quot;https://i.stack.imgur.com/eWrEL.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eWrEL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14695" LastActivityDate="2017-01-31T09:03:41.240" Title="LaTeX preview on HiDPI display" Tags="|latex|preview-latex|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30310" PostTypeId="2" ParentId="30309" CreationDate="2017-01-30T18:34:55.843" Score="5" Body="&lt;p&gt;The variable &lt;code&gt;preview-scale-function&lt;/code&gt; in the &lt;code&gt;preview-appearance&lt;/code&gt; group controls this. From the customization menu:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Preview Scale Function: [Value Menu] preview-scale-from-face&lt;br&gt;&#xA;  Calculate preview scale from ‘preview-reference-face’.&lt;br&gt;&#xA;  This calculates the scale of EPS images from a document assumed&#xA;  to have a default font size given by function ‘preview-document-pt’&#xA;  so that they match the reference face in height.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Scale factor for included previews.&lt;br&gt;&#xA;  This can be either a function to calculate the scale, or a fixed number.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Try setting the value to various fixed numbers. The preview sizes should shift up or down accordingly.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-01-30T18:34:55.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30311" PostTypeId="2" ParentId="30266" CreationDate="2017-01-30T18:51:44.340" Score="2" Body="&lt;p&gt;Sounds to me like your theme isn't being loaded at first. Let me explain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Emacs to be able to use the code in a file, two things need to be true: Emacs needs to be able to find it; it must be loaded with &lt;code&gt;require&lt;/code&gt;. I haven't seen a color theme set up like yours before, but I also don't know a reason why it wouldn't work. What you need is to &quot;hook it up&quot; to the rest of Emacs. (My hypothesis is that one of the functions you're calling is able to find and evaluate your theme, making it &quot;available&quot; to Emacs. What I imagine you'd want is to have that happen automatically -- when you turn emacs on, say.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Emacs loads, it loads a configuration file. Per emacs, this file can be configured in a plethora of different ways; for now I'll assume a bog-standard/out-of-the-box configuration, which goes like this: if &lt;code&gt;$HOME/.emacs.d&lt;/code&gt; is an emacs lisp file, load it; if it isn't, load &lt;code&gt;$HOME/.emacs.d/init.el&lt;/code&gt;. Your init file is the perfect place to put stuff like this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would do is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Remove the line &lt;code&gt;(add-to-list 'color-themes '(my-color-theme  &quot;JS&quot; &quot;JS&quot;))&lt;/code&gt; from your theme. Add the line, &lt;code&gt;(provides 'name-theme)&lt;/code&gt; (Where &lt;code&gt;name-theme&lt;/code&gt; is the name of the file your theme is living in.&lt;/li&gt;&#xA;&lt;li&gt;In your init file, add these lines:&#xA;&lt;code&gt;&#xA;(require 'name-theme) ;; the name of your file and &quot;module&quot;&#xA;(my-color-theme)      ;; calling the theme function you defined within your module.&#xA;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm not familiar with wrapping a theme in a function the way you have; if this doesn't get you where you need to be, you may also need to add &lt;code&gt;(load-theme 'my-color-theme)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I also use a custom theme, but approach it slightly differently; happy to link to examples if it would be helpful.)&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2017-01-30T18:51:44.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30312" PostTypeId="1" CreationDate="2017-01-30T19:32:30.390" Score="1" ViewCount="583" Body="&lt;p&gt;I am using AUCTeX with the following configuration.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tex)&#xA;(setq TeX-auto-save t)&#xA;(setq TeX-parse-self t)&#xA;(setq-default TeX-master &quot;main&quot;)&#xA;(setq latex-run-command &quot;pdflatex&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Trying to build my document with &lt;code&gt;C-c C-a&lt;/code&gt; gives me the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ERROR: Undefined control sequence.&#xA;&#xA;--- TeX said ---&#xA;l.1 \documentclass{IEEEtran}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;main.tex&lt;/code&gt; file looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\documentclass{IEEEtran}&#xA;\usepackage[latin1]{inputenc}&#xA;\usepackage{amsmath}&#xA;\usepackage{amsfonts}&#xA;\usepackage{amssymb}&#xA;\usepackage[ngerman]{babel}&#xA;\usepackage{caption}&#xA;\usepackage{graphicx}&#xA;\usepackage{import}&#xA;\usepackage{url}&#xA;\def\UrlBreaks{\do\/\do-}&#xA;\renewcommand\_{\textunderscore\allowbreak}&#xA;&#xA;\begin{document}&#xA;&#xA;\title{foo bar}&#xA;\author{foo}&#xA;\maketitle&#xA;&#xA;\begin{abstract}&#xA;\end{abstract}&#xA;&#xA;\begin{IEEEkeywords}&#xA;  Blockchain&#xA;\end{IEEEkeywords}&#xA;&#xA;&#xA;% Einleitung&#xA;\import{./}{intro.tex}&#xA;&#xA;&#xA;\nocite{*}&#xA;\bibliographystyle{unsrt}&#xA;&#xA;\bibliography{references}&#xA;&#xA;&#xA;&#xA;\end{document}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;pdflatex&lt;/code&gt; on the terminal is just working fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does my &lt;code&gt;emacs&lt;/code&gt; say different? I though internally is just a &lt;code&gt;pdflatex&lt;/code&gt; call and... violá.&lt;/p&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2017-01-30T19:32:30.390" Title="AUCTeX/LaTeX - ERROR: Undefined control sequence. documentclass" Tags="|latex|auctex|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30313" PostTypeId="2" ParentId="30266" CreationDate="2017-01-30T23:08:18.667" Score="3" Body="&lt;p&gt;First, you are mixing up 2 different color theme types. &lt;a href=&quot;http://www.nongnu.org/color-theme/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;color-theme&quot;&gt;color-theme&lt;/a&gt; is a separate package that predates emacs 24's built-in theme support (so your middle attempt to customize-theme will never do what you want). Why does your 1st attempt fail, but your 2nd doesn't?  Apparently something in the intermediate, abortive attempt to &lt;code&gt;customize-theme&lt;/code&gt; provides a necessary ingredient. I have some suggestions to get the color-theme working. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Examine the value of &lt;code&gt;load-path&lt;/code&gt; before and after your 1st and 3rd attempt. It needs to include both the file color-theme.el, and the actual file you created with your new color theme. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You probably also want to unconditionally require 'color-theme. Currently you're only doing so when compiling; but this is also needed at runtime. (I was never able to autoload color-theme on demand back when I used it, but always had to load it up front. This is one reason I consider emacs 24 and later's built-in theme support superior.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Call &lt;code&gt;(color-theme-initialize)&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You may also want to consider moving to the new &lt;code&gt;(load-theme)&lt;/code&gt; supported by recent emacs. &lt;/p&gt;&#xA;" OwnerUserId="6615" LastActivityDate="2017-01-30T23:08:18.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30316" PostTypeId="1" CreationDate="2017-01-31T06:51:51.573" Score="0" ViewCount="57" Body="&lt;p&gt;When an Emacs session is created and closed before either Hibernate or Sleep options are used in Windows-7, Emacs exits normally.&lt;/p&gt;&#xA;&lt;p&gt;But whenever either Hibernate or Sleep options are used with an Emacs session is open and after coming back from hibernate or sleep, &lt;s&gt;there is no clean exit&lt;/s&gt; &lt;strong&gt;the Emacs window does not close&lt;/strong&gt;. I see the following message when I close Emacs using &lt;code&gt;C-x C-c&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vysdt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vysdt.png&quot; alt=&quot;exit_message&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have enabled &lt;code&gt;ido&lt;/code&gt; mode. I'm wondering if that could be a cause for this strange behavior.&lt;/p&gt;&#xA;&lt;p&gt;If I click on the close button or press &lt;code&gt;C-x C-c&lt;/code&gt; there is not effect. Finally, I'm forced to kill Emacs from Windows Task Manager using &lt;code&gt;End Task&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Is there way to fix this?&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-02-01T05:05:25.460" Title="Unable to close emacs sessions in Windows (after Hibernate or Sleep)" Tags="|microsoft-windows|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30317" PostTypeId="1" CreationDate="2017-01-31T08:18:26.580" Score="1" ViewCount="163" Body="&lt;p&gt;i have a strange behaviour of my emacs (25.1.1) running in cygwin within a terminal window (mintty 2.7.3). Every time when doing TAB-competion (eg. M-x describe-func) I got following messages in the echo area:&quot;user-error: Cannot decrease the default face height more than it already is&quot;. I can not debug that kind of error, because it is an user-error. All modifications, which are related to &quot;set-face-attribute&quot; were commented one by one and new reloaded. I already tried to set debug-ignored-erros to nil, but no success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a bit research:&#xA;I am using &lt;strong&gt;icicles&lt;/strong&gt; and i found out it has something to do with the face configuration of icicles completion menu. The hook which narrow down the selecetion appropiately to user input kicks that user-error in the echo area by pressing TAB-key.&#xA;But setting all faces used in that completion menu to a high value of 110pt doesn't gave me the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a bit more research:&#xA;Setting in &lt;strong&gt;icicles&lt;/strong&gt; icicle-show-Completions-initially-flag or icicle-incremental-completion to t for having an ido-completion feeling then the icicle command completion combined with the output of above mentioned user-error message every time you extend your input (no TAB-Key) makes icicles in that way useless. By the way the error message has changed with these settings to &quot;icicle-execute-extended-command: Cannot decrease the default face height more than it already is&quot;, but any way it means the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any hints, background information I would be very thankful.&#xA;Falk&lt;/p&gt;&#xA;" OwnerUserId="14749" LastEditorUserId="14749" LastEditDate="2017-02-02T16:25:26.380" LastActivityDate="2017-02-02T16:25:26.380" Title="Icicles showing user-error message in echo area during TAB-completion" Tags="|fonts|faces|completion|echo-area|icicles|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30318" PostTypeId="2" ParentId="30309" CreationDate="2017-01-31T09:03:41.240" Score="0" Body="&lt;p&gt;In order to see the rendered LaTeX equations scaled&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.4))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The scale 1.4 is Ok in my setup... try it, and change the number to fit your needs.&lt;/p&gt;&#xA;" OwnerUserId="2441" LastActivityDate="2017-01-31T09:03:41.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30320" PostTypeId="1" AcceptedAnswerId="30354" CreationDate="2017-01-31T09:40:29.370" Score="3" ViewCount="2508" Body="&lt;p&gt;Unfortunately, I forgot to start the emacs-server at work, running on Linux. Is there now any option to connect to my remote graphical X11 emacs session via ssh?&lt;/p&gt;&#xA;" OwnerUserId="209" LastEditorUserId="12895" LastEditDate="2017-02-01T12:35:33.930" LastActivityDate="2017-02-02T19:28:52.667" Title="connect to remote emacs session via ssh" Tags="|ssh|server|x11|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30321" PostTypeId="1" CreationDate="2017-01-31T11:21:25.603" Score="0" ViewCount="445" Body="&lt;p&gt;I had the following tags for a given file.&lt;br&gt;&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TAGS: @Completed(c) @Doubts(d) @Discuss(D) @Not_Implemented(n) @KR28(R28) @KR29(R29)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I added the last two tags today and they did not get populated when I pressed &lt;code&gt;C-c C-q&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2017-01-31T11:21:25.603" Title="Adding tags to an org file" Tags="|org-tags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30322" PostTypeId="2" ParentId="30321" CreationDate="2017-01-31T11:21:25.603" Score="1" Body="&lt;p&gt;I read through the &lt;a href=&quot;http://orgmode.org/manual/Setting-tags.html#fn-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;org documentation&lt;/a&gt; and found that the user had to keep cursor on the &lt;code&gt;#+TAGS:&lt;/code&gt; line and  press &lt;code&gt;C-c C-c&lt;/code&gt; in order to update the local setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quote from the org manual&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Don't forget to press C-c C-c with the cursor in one of these lines to activate any changes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After pressing &lt;code&gt;C-c C-c&lt;/code&gt; - org mode will give a message like &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Local setup has been refreshed&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Tag shortcut&lt;/strong&gt;&lt;br&gt;&#xA;The other thing that the user should keep in mind is that, one is not allowed to use more than one characters within the parenthesis.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;code&gt;@KR28(R28)&lt;/code&gt; would not work as &lt;code&gt;R28&lt;/code&gt; is present within the parenthesis. This should be either one letter or one number.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if the &lt;em&gt;user does not define a shortcut&lt;/em&gt; for a particular tag, org by itself will assign a shortcut for that tag. (&lt;em&gt;Citations required - if available&lt;/em&gt;)&lt;/p&gt;&#xA;" OwnerUserId="10936" LastActivityDate="2017-01-31T11:21:25.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30323" PostTypeId="1" AcceptedAnswerId="30328" CreationDate="2017-01-31T11:21:51.097" Score="2" ViewCount="118" Body="&lt;p&gt;I'm new to yassnipet and it's been awesome but I hit a wall.&#xA;I have the following snippet:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$1 = errors.WithMessage($1, $2))$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&#xA;In most of the use cases on &lt;code&gt;$1&lt;/code&gt; I enter &lt;code&gt;err&lt;/code&gt; which expands to another snippet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to temporary disable &lt;code&gt;yas-triggers-in-field&lt;/code&gt; for this snippet only, is there a way to do it?&lt;/p&gt;&#xA;" OwnerUserId="11350" LastActivityDate="2017-01-31T18:16:59.287" Title="How to temporary disable yassnipet snippet in snippet" Tags="|yasnippet|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30324" PostTypeId="1" AcceptedAnswerId="30338" CreationDate="2017-01-31T11:24:21.000" Score="2" ViewCount="613" Body="&lt;p&gt;once use the command below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x RET C-\ TeX RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I try to make some math formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\sqrt{}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it can't be automatic translated to √,&#xA;then I check the symbol list:&lt;code&gt;C-h I&lt;/code&gt;&#xA;and also can't find the \sqrt tex item,&#xA;so is there a config I have missed?&lt;/p&gt;&#xA;" OwnerUserId="14750" LastActivityDate="2017-01-31T22:40:07.227" Title="how to make all special symbols available in org latex?" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30325" PostTypeId="2" ParentId="26449" CreationDate="2017-01-31T11:26:22.813" Score="2" Body="&lt;p&gt;To enable this feature in Spacemacs add &lt;code&gt;(setq-default evil-search-module 'evil-search)&lt;/code&gt; in &lt;code&gt;dotspacemacs/user-init ()&lt;/code&gt; section.&lt;/p&gt;&#xA;" OwnerUserId="14751" LastActivityDate="2017-01-31T11:26:22.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30326" PostTypeId="2" ParentId="30272" CreationDate="2017-01-31T12:16:52.257" Score="0" Body="&lt;p&gt;If you didn't actually need a feature of the shell, you could also do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(call-process &quot;df&quot; nil t nil &quot;-h&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The 't' is what tells it to insert into the current buffer.  I added the '-h' to show where the args go. You can add more.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2017-01-31T12:16:52.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30327" PostTypeId="1" CreationDate="2017-01-31T14:10:33.143" Score="3" ViewCount="1303" Body="&lt;p&gt;I have recently started using &lt;strong&gt;Spacemacs&lt;/strong&gt; instead of VIM, because of great VHDL mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In vim (neovim) I used to use VIM as terminal emulator.&#xA;In Emacs I have encountered a bit of strange colour behaviour.&#xA;To be exact I don't mean different palette for &quot;System colours&quot;,&#xA;that is not a problem.&#xA;Problem is missing colors in &quot;Color cube&quot; and completely discolored Powerline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RGotv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RGotv.png&quot; alt=&quot;bad colours&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I would expect this (&lt;strong&gt;KDE Konsole&lt;/strong&gt; or &lt;strong&gt;neovim&lt;/strong&gt; terminal):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xnVwH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xnVwH.png&quot; alt=&quot;correct colours&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything is set to &lt;strong&gt;xterm-256&lt;/strong&gt;, so I don't know what is the problem. This occurs in both -nw (terminal) mode and GUI mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that 256 color are somewhat degraded by emacs, see comparison of &lt;code&gt;colortest-256&lt;/code&gt; command in &lt;strong&gt;Emacs&lt;/strong&gt; and &lt;strong&gt;Konsole&lt;/strong&gt; and also notice how &lt;strong&gt;Powerline&lt;/strong&gt; is not coloured anymore. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that colours in &lt;strong&gt;Powerline&lt;/strong&gt; are wrong for both &lt;em&gt;background&lt;/em&gt; and &lt;em&gt;letters&lt;/em&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this strange colour behaviour and get the shell &lt;strong&gt;Powerline&lt;/strong&gt; (github.com/powerline/powerline) working under &lt;strong&gt;Shell&lt;/strong&gt; or &lt;strong&gt;Term&lt;/strong&gt; mode in Emacs?&lt;/p&gt;&#xA;" OwnerUserId="14754" LastEditorUserId="14754" LastEditDate="2017-01-31T16:08:27.870" LastActivityDate="2017-01-31T16:08:27.870" Title="How to get Powerline colours working in Emacs Shell/Term mode?" Tags="|shell|powerline|coloring|" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="30328" PostTypeId="2" ParentId="30323" CreationDate="2017-01-31T18:16:59.287" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In most of the use cases on &lt;code&gt;$1&lt;/code&gt; I enter &lt;code&gt;err&lt;/code&gt; which expands to another snippet.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then you might want to instead use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;${1:err} = errors.WithMessage($1, $2))$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That way you don't even have to type the &lt;code&gt;err&lt;/code&gt; in, and since the cursor will be the beginning of the field, typing &lt;code&gt;TAB&lt;/code&gt; will switch to the next one rather than expanding it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to temporary disable &lt;code&gt;yas-triggers-in-field&lt;/code&gt; for this snippet only, is there a way to do it?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, add it to the &lt;a href=&quot;http://joaotavora.github.io/yasnippet/snippet-development.html#sec-2-5&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;expand-env&lt;/code&gt; directive&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# name: errors-with-message&#xA;# key: emsg&#xA;# expand-env: ((yas-triggers-in-field nil))&#xA;# --&#xA;$1 = errors.WithMessage($1, $2))$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this requires a recent yasnippet which includes &lt;a href=&quot;https://github.com/joaotavora/yasnippet/commit/4ee3835adf3352406aaa7dacc24f676f97b3cac2&quot; rel=&quot;nofollow noreferrer&quot;&gt;this update&lt;/a&gt;.  It's not included in 0.11 (the latest stable release as of this writing).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-01-31T18:16:59.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30329" PostTypeId="2" ParentId="13296" CreationDate="2017-01-31T19:27:32.123" Score="0" Body="&lt;p&gt;In my case I must have had a typo in my &lt;code&gt;.emacs&lt;/code&gt; file, so opening the &lt;code&gt;custom themes&lt;/code&gt; menu and reselecting my theme fixed the weird background for me. Same logic as the accepted answer.&lt;/p&gt;&#xA;" OwnerUserId="14757" LastActivityDate="2017-01-31T19:27:32.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30330" PostTypeId="1" AcceptedAnswerId="30339" CreationDate="2017-01-31T20:16:18.817" Score="8" ViewCount="5515" Body="&lt;p&gt;I want to execute R code blocks in &lt;code&gt;org-mode&lt;/code&gt; and export the &lt;em&gt;results&lt;/em&gt; to a PDF/html. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Some text here...&#xA;&#xA;#+begin_src R :results output latex&#xA;library(xtable)&#xA;x &amp;lt;- rnorm(100)&#xA;y &amp;lt;- x + rnorm(100)&#xA;xtable(summary(lm(y ~ x)))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to export the &lt;em&gt;results&lt;/em&gt; (here, the output of &lt;code&gt;xtable(summary(lm(y ~ x)))&lt;/code&gt;), but I can't figure out how to do it.  When I export it to LaTeX or html, the text and code is exported nicely, but no table is produced in the output pdf / html file. &lt;strong&gt;This is the core problem I need help with. How do I get the &lt;em&gt;results&lt;/em&gt; to export, and not just the code?&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried several experiments but not sure what settings I need to change. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If I execute the code inline (using &lt;code&gt;C-c C-c&lt;/code&gt;), I am asked to allow for execution, and when allowed a beautiful LaTeX table is generated below the code as expected. Not sure why this is not happening when exporting to LaTeX or html.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I know that code is executing: If I modify the switches as below and then export to LaTeX/html, an output file is produced with appropriate name, but no results are integrated into resultant LaTeX pdf or html file. The syntax coloring is still present. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :results output latex :session *myR* :dir &quot;.&quot; :file r-output.org&#xA;library(xtable)&#xA;x &amp;lt;- rnorm(100)&#xA;y &amp;lt;- x + rnorm(100)&#xA;xtable(summary(lm(y ~ x)))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13502" LastEditorUserId="253" LastEditDate="2017-01-31T22:50:40.450" LastActivityDate="2023-10-11T18:28:49.653" Title="export R code results in org-mode?" Tags="|org-mode|org-babel|ess|r|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30331" PostTypeId="1" AcceptedAnswerId="30335" CreationDate="2017-01-31T20:37:47.310" Score="4" ViewCount="297" Body="&lt;p&gt;I write a lot of text in German and English and I'm getting tired of switching the dictionary of my spell-checker all the time.  In true Emacs spirit, I decided to do something about this and dusted off my grandpa's parentheses.  The code I wrote guesses the language of the current paragraph and then changes the language in ispell and typo-mode.  It also reruns flyspell on the current paragraph, but only on that paragraph because sometimes I also write documents in multiple languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All this is working really nicely and I will publish this code after some more testing, so other people can use it, too.  However, I want the process of switching languages to be fully automatic so I don't have to think about it at all.  This means that my function should run every once in a while during text editing.  Perhaps it's overkill to run it on every key stroke but I thought it might be good to run it every time I start a new word, i.e., when I enter a space or newline.  Alternatively, it might also be enough to run it only when I enter punctuation marks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt; How can I fire off the function when certain characters are inserted in the buffer?  Is there a hook for that?  Thanks for your help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI: Here is my code: &lt;a href=&quot;https://github.com/tmalsburg/guess-language.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tmalsburg/guess-language.el&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2017-01-31T22:24:00.630" LastActivityDate="2017-01-31T22:24:00.630" Title="How can I execute a function every time I insert certain characters in the buffer?" Tags="|hooks|text-editing|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30332" PostTypeId="1" AcceptedAnswerId="30611" CreationDate="2017-01-31T20:39:28.917" Score="4" ViewCount="288" Body="&lt;p&gt;If I load up emacs and go to my .emacs file (a fragment of which is given below), and I press SPC f or C-c C-f then it does find-file, which is the expected behaviour. However, if I type M-x eval-buffer, or load-file, suddenly SPC f doesn't work, but C-c C-f still does. If I press SPC, it just goes to the next character as it would without evil-leader. What gives?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'evil) &#xA;(evil-mode 1)&#xA;&#xA;(require 'evil-leader)&#xA;(global-evil-leader-mode)&#xA;&#xA;(evil-leader/set-leader &quot;&amp;lt;SPC&amp;gt;&quot;)&#xA;&#xA;(evil-leader/set-key &quot;f&quot; 'find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(x-posted from superuser.com)&lt;/p&gt;&#xA;" OwnerUserId="14759" LastActivityDate="2017-02-10T15:15:51.543" Title="Evil-leader stops working when I eval-buffer" Tags="|evil|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30333" PostTypeId="2" ParentId="30308" CreationDate="2017-01-31T21:10:27.140" Score="3" Body="&lt;p&gt;This works for me, as a local setting, instead of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_MATHJAX:  path:&quot;http://localhost/&amp;lt;path-to-mathjax&amp;gt;/MathJax.js&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_MATHJAX:  path:&quot;http://localhost/&amp;lt;path-to-mathjax&amp;gt;/MathJax.js?config=TeX-AMS_HTML&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do not know why, both manuals from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Math-formatting-in-HTML-export.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs&lt;/a&gt; and &lt;a href=&quot;http://orgmode.org/mathjax/docs/html/configuration.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-mode&lt;/a&gt; do not use this  &lt;code&gt;config&lt;/code&gt;, so any further explanation is welcome. I got there by noting that the default value includes this &lt;code&gt;config&lt;/code&gt; option, not a plain path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to user14743's comment, in &lt;code&gt;org-html-mathjax-options&lt;/code&gt;, set the path to &lt;code&gt;/&amp;lt;path-to-mathjax&amp;gt;/MathJax/MathJax.js?config=TeX-AMS-MML_HTM‌​LorMML,local/local&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I note that &lt;code&gt;file://...&lt;/code&gt; does not work either way.&lt;/p&gt;&#xA;" OwnerUserId="2637" LastEditorUserId="2637" LastEditDate="2017-02-02T20:39:28.267" LastActivityDate="2017-02-02T20:39:28.267" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30334" PostTypeId="1" AcceptedAnswerId="30337" CreationDate="2017-01-31T21:14:28.613" Score="2" ViewCount="104" Body="&lt;p&gt;I am looking for a way to bulk generate emails in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any plugin I am not aware of?&#xA;I need to read 'name', 'surname', 'email', and an additional field from a CSV and place those values in a template and send them out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be very grateful for help.&lt;/p&gt;&#xA;" OwnerUserId="9901" LastEditorUserId="105" LastEditDate="2017-01-31T22:31:21.080" LastActivityDate="2017-01-31T22:31:21.080" Title="bulk mail using emacs" Tags="|email|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30335" PostTypeId="2" ParentId="30331" CreationDate="2017-01-31T21:16:18.107" Score="4" Body="&lt;p&gt;Here's a simple function that you can use to check if the&#xA;character you just entered should set off your&#xA;&lt;code&gt;do-my-awesome-thing&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun do-awesome-thing-maybe ()&#xA;  (when (memq (char-before) '(?\  ?\t))&#xA;    (message &quot;You should do-my-awesome-thing now&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, it checks if the character you just entered was either a&#xA;space or a tab (which seems like a reasonable compromise between&#xA;doing it after every character, which is probably overkill, and&#xA;doing it on a timer, which would require you to stop typing for a&#xA;while).  If so, you would &lt;code&gt;do-my-awesome-thing&lt;/code&gt;.  You can then&#xA;add it to the hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'post-self-insert-hook #'do-awesome-thing-maybe)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-01-31T21:16:18.107" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="30337" PostTypeId="2" ParentId="30334" CreationDate="2017-01-31T21:56:04.947" Score="1" Body="&lt;p&gt;You might find &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/obsolete/gulp.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;gulp&lt;/a&gt; useful as a start for your own code (I wrote is 20+ years ago, I am not sure if RMS actually ever used it).&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2017-01-31T21:56:04.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30338" PostTypeId="2" ParentId="30324" CreationDate="2017-01-31T22:25:00.153" Score="1" Body="&lt;p&gt;No, you're not missing anything. For whatever reason, the TeX input method doesn't include include the macro &lt;code&gt;\sqrt&lt;/code&gt;. You can get that symbol under its secret name, &lt;code&gt;\surd&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is arguably a bug which could be fixed by inserting a rule for &lt;code&gt;\sqrt&lt;/code&gt; in the &lt;code&gt;latin-ltx--define-rules&lt;/code&gt; form in the file &lt;code&gt;leim/quail/latin-ltx.el&lt;/code&gt;. I don't follow that macro, but it would probably also be possible to add the rule in your config if you knew the name of the appropriate variable (which I don't as of yet).&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Bug report submitted to &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25594&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25594&lt;/a&gt;  ...&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-01-31T22:40:07.227" LastActivityDate="2017-01-31T22:40:07.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30339" PostTypeId="2" ParentId="30330" CreationDate="2017-01-31T23:06:17.010" Score="18" Body="&lt;p&gt;You need to use the &lt;code&gt;:exports both&lt;/code&gt; header argument. By default, org only exports R code, not the results. From the &lt;a href=&quot;https://orgmode.org/manual/Exporting-Code-Blocks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org manual&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;h1&gt;14.8.2.8 :exports&lt;/h1&gt;&#xA;&lt;p&gt;The :exports header argument is to specify if that part of the Org file is exported to, say, HTML or LaTeX formats. Note that :exports affects only ‘src’ code blocks and not inline code.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;code&lt;/code&gt; The default. The body of code is included into the exported file.&lt;br /&gt;&#xA;Example: :exports code.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;results&lt;/code&gt; The results of evaluation of the code is included in the exported file.&lt;br /&gt;&#xA;Example: &lt;code&gt;:exports results&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;both&lt;/code&gt; Both the code and results of evaluation are included in the exported file.&lt;br /&gt;&#xA;Example: &lt;code&gt;:exports both&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;none&lt;/code&gt; Neither the code nor the results of evaluation is included in the exported file. Whether the code is evaluated at all depends on other options.&lt;br /&gt;&#xA;Example: &lt;code&gt;:exports none&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2023-10-11T18:28:49.653" LastActivityDate="2023-10-11T18:28:49.653" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="30340" PostTypeId="1" AcceptedAnswerId="30350" CreationDate="2017-01-31T23:37:17.113" Score="1" ViewCount="330" Body="&lt;p&gt;When I export an .org file to .odt, it changes my em dashes (---) as expected (which is great for HTML). However, the .odt file in this case needs to retain standard manuscript format em dashes ( -- ) unfixed. Basically a space, two hyphens, and a space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to get this result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In org mode:&lt;/strong&gt; Application of em dash here---looks like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Export to LibreOffice:&lt;/strong&gt; Application of em dash here -- looks like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If possible.&lt;/p&gt;&#xA;" OwnerUserId="14390" LastActivityDate="2017-02-01T07:21:03.723" Title="Org Mode .odt Export with em Dash" Tags="|org-mode|org-export|libreoffice|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30341" PostTypeId="1" CreationDate="2017-02-01T00:28:45.297" Score="4" ViewCount="2917" Body="&lt;p&gt;All I could find to configure was &lt;code&gt;org-latex-to-pdf-process&lt;/code&gt; and &lt;code&gt;org-latex-create-formulat-image-program&lt;/code&gt;. The first one only controls the process, when I want to export the entire document, the second one only controls the process that gets executed after the latex command. But how do I customize the latex command that gets used for the fragments?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My use case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got minted finally working to export my org file with code samples in colors. But since then, the preview is broken, because the latex snippets have now the minted package imported, too. Then the pdflatex process for the snippets fails, because it needs the &lt;code&gt;-shell-escape&lt;/code&gt; flag passed. But I do not know how I can pass that flag to that process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;second use case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to use the unicodemath package for xelatex. But that package is only available in xelatex, and therefor the process for the latex fragments needs to be xelatex, too.&lt;/p&gt;&#xA;" OwnerUserId="13003" LastActivityDate="2020-04-15T23:00:34.720" Title="How do I customize the process that gets triggered in org-preview-latex-fragment?" Tags="|org-mode|preview-latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30342" PostTypeId="1" AcceptedAnswerId="30365" CreationDate="2017-02-01T02:33:12.250" Score="0" ViewCount="195" Body="&lt;p&gt;I'm following an &lt;a href=&quot;http://rspec.codeschool.com/levels/1&quot; rel=&quot;nofollow noreferrer&quot;&gt;entry-level tutorial on rspec here&lt;/a&gt;, and I've created a very simple test at &lt;code&gt;spec\lib\zombie_spec.rb&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require &quot;spec_helper&quot;&#xA;describe &quot;A Zombie&quot; do&#xA;  #Your 'examples' (tests) go here.&#xA;  it &quot;is named Ash&quot;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I run this test from the gnome-terminal, everything works as expected: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Pending: (Failures listed here are expected and do not affect your suite's status)&#xA;&#xA;  1) A Zombie is named Ash&#xA;     # Not yet implemented&#xA;     # ./spec/lib/zombie_spec.rb:4&#xA;&#xA;&#xA;Finished in 0.00049 seconds (files took 0.09118 seconds to load)&#xA;1 example, 0 failures, 1 pending&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I try to run the same code from emacs' &lt;code&gt;shell&lt;/code&gt; or &lt;code&gt;ansi-term&lt;/code&gt;, I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The program 'rspec' is currently not installed. You can install it by typing:&#xA;sudo apt install ruby-rspec-core&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After installing &lt;code&gt;ruby-rspec-core&lt;/code&gt; and trying to run the test again, I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/home/adc/odin-project/web-development-101/20-code-school-rspec/zombie/spec/spec_helper.rb:48:in `block in &amp;lt;top (required)&amp;gt;': undefined method `shared_context_metadata_behavior=' for #&amp;lt;RSpec::Core::Configuration:0x00000000eed1d0&amp;gt; (NoMethodError)&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core.rb:97:in `configure'&#xA;    from /home/adc/odin-project/web-development-101/20-code-school-rspec/zombie/spec/spec_helper.rb:19:in `&amp;lt;top (required)&amp;gt;'&#xA;    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'&#xA;    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/configuration.rb:1295:in `block in requires='&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/configuration.rb:1295:in `each'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/configuration.rb:1295:in `requires='&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/configuration_options.rb:109:in `block in process_options_into'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/configuration_options.rb:108:in `each'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/configuration_options.rb:108:in `process_options_into'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/configuration_options.rb:21:in `configure'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:105:in `setup'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:92:in `run'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:78:in `run'&#xA;    from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:45:in `invoke'&#xA;    from /usr/bin/rspec:4:in `&amp;lt;main&amp;gt;'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I fix this so that rspec runs successfully from within the emacs shell?&lt;/p&gt;&#xA;" OwnerUserId="14499" LastActivityDate="2017-02-01T15:19:00.403" Title="How to run rspec from the emacs shell?" Tags="|shell|ansi-term|testing|ruby|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30343" PostTypeId="1" AcceptedAnswerId="30377" CreationDate="2017-02-01T02:40:13.733" Score="10" ViewCount="1066" Body="&lt;p&gt;How to do the following in &lt;code&gt;org-mode&lt;/code&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;define a constant in the beginning of file, and &lt;/li&gt;&#xA;&lt;li&gt;than use it in the text or even compute on it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Following methods didn't work for me:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CONSTANTS: t=10&#xA;&#xA;The temperature is `$t`, and twice of that is `2*$t`.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to do both of these?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The temperature is src_R{t=10; 2*t}, and twice of that is scr_R{4*t}.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here value of &lt;code&gt;t&lt;/code&gt; is defined in the first R code block (&lt;code&gt;src_R{t=10; 2*t}&lt;/code&gt;), and the second  block (&lt;code&gt;scr_R{4*t}&lt;/code&gt;) is trying to compute on the definition of &lt;code&gt;t&lt;/code&gt;. First block is replaced by &lt;code&gt;20&lt;/code&gt; as expected, but the second block is not even interpreted as an R code. How can these two be connected?&lt;/p&gt;&#xA;" OwnerUserId="13502" LastEditorUserId="253" LastEditDate="2017-02-01T04:23:02.787" LastActivityDate="2017-02-01T21:02:03.500" Title="Using constants inline" Tags="|org-mode|r|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30344" PostTypeId="1" AcceptedAnswerId="30345" CreationDate="2017-02-01T04:05:46.543" Score="2" ViewCount="3730" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I create a link in &lt;code&gt;org-mode&lt;/code&gt; to a specific page of a PDF file, which can be opened (in either Skim or Adobe) with a mouse-click?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My example heading. :tag:&#xA;  [[pdf:/path/to/file.pdf#105][My description.]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-02-01T04:19:05.847" LastActivityDate="2019-10-01T07:47:29.323" Title="How to link and open a PDF file to a specific page -- skim / adobe?" Tags="|org-mode|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30345" PostTypeId="2" ParentId="30344" CreationDate="2017-02-01T04:12:02.353" Score="2" Body="&lt;p&gt;The following answer is for &lt;code&gt;Skim&lt;/code&gt; on OSX, and it utilizes &lt;code&gt;applescript&lt;/code&gt;.  Skim does not have any command-line options to open a PDF file to a specific page, unless it is a forward-search situation dealing with a TeX file and the built-in Skim &lt;code&gt;displayline&lt;/code&gt; utility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example heading in &lt;code&gt;org-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My example heading. :tag:&#xA;  [[pdf:/path/to/file.pdf#105][My description.]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'org)&#xA;&#xA;(org-add-link-type &quot;pdf&quot; 'org-pdf-open nil)&#xA;&#xA;(defun org-pdf-open (link)&#xA;&quot;Where page number is 105, the link should look like:&#xA;[[pdf:/path/to/file.pdf#105][My description.]]&quot;&#xA;  (let* ((path+line (split-string link &quot;#&quot;))&#xA;         (pdf-file (car path+line))&#xA;         (base-filename (file-name-nondirectory pdf-file))&#xA;         (page (car (cdr path+line)))&#xA;         (script&#xA;          (format&#xA;            &quot;tell document \&quot;%s\&quot; of application \&quot;Skim\&quot; to go to page %s&quot;&#xA;            base-filename page))&#xA;         (skim-program &quot;/Applications/Skim.app/Contents/MacOS/Skim&quot;))&#xA;    (set-process-sentinel&#xA;      (start-process &quot;skim-process&quot; nil &quot;open&quot; &quot;-a&quot; skim-program pdf-file)&#xA;      `(lambda (p e) (when (= 0 (process-exit-status p))&#xA;        (when ,page ;; just in case user wants to omit the page number from the link&#xA;          (start-process &quot;goto-page&quot; nil &quot;osascript&quot; &quot;-e&quot; ,script)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-02-02T03:14:16.563" LastActivityDate="2017-02-02T03:14:16.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30346" PostTypeId="2" ParentId="30344" CreationDate="2017-02-01T05:32:18.877" Score="3" Body="&lt;p&gt;On OSX (now macOS), you can simply use &lt;a href=&quot;http://orgmode.org/worg/org-contrib/org-mac-link.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-mac-link.el&lt;/code&gt;&lt;/a&gt;, it supports Skim and Adobe Acrobat Pro. To use, open pdf file in Skim and go to the page you want to link, then type &lt;code&gt;M-x org-mac-grab-link&lt;/code&gt; from Emacs, it should insert an org link (like the following) at point.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[skim:///Users/xcy/Downloads/calccard.pdf::2][calccard.pdf, p. 2]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then when you click the link, the pdf file will be opened in Skim and goto page 2, no matter if Skim is running.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can get &lt;code&gt;org-mac-link.el&lt;/code&gt; from&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-mac-link&lt;/code&gt; on Melpa&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-plus-contrib&lt;/code&gt; on Org Elpa&lt;/li&gt;&#xA;&lt;li&gt;Org Mode's git repo&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;unless you install &lt;code&gt;org-mac-link&lt;/code&gt; on Melpa via &lt;code&gt;package.el&lt;/code&gt;, you have to autoload &lt;code&gt;org-mac-grab-link&lt;/code&gt; etc or require &lt;code&gt;org-mac-link.el&lt;/code&gt; somewhere by yourself.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-02-01T05:32:18.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30347" PostTypeId="2" ParentId="30343" CreationDate="2017-02-01T05:50:24.293" Score="4" Body="&lt;p&gt;I think the defined constant can be used in tables, and only there.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CONSTANTS: t=10&#xA;&#xA;| 1 | 10 |&#xA;| 2 | 20 |&#xA;#+TBLFM: $2=$1*$t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, you can add the header argument &lt;code&gt;:session&lt;/code&gt; to make your second method working:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The temperature is src_R[:session]{t=10; 2*t}, and twice of that is src_R[:session]{4*t}.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also do a (not so pretty) trick. You could use a named table and assign that to a &lt;code&gt;:var&lt;/code&gt; header argument:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: t&#xA;| 10 |&#xA;#+TBLFM: $1=$t&#xA;&#xA;The temperature is src_R[:var t=t]{t=10; 2*t}, and twice of that is src_R[:var t=t]{4*t}.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2017-02-01T06:15:11.863" LastActivityDate="2017-02-01T06:15:11.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30349" PostTypeId="1" CreationDate="2017-02-01T07:15:43.447" Score="1" ViewCount="521" Body="&lt;p&gt;Here's the situation. I start &lt;code&gt;M-x ansi-term&lt;/code&gt;, which launches it in &lt;code&gt;term-char-mode&lt;/code&gt;. I type the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo &quot;hello world&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and press RET, which outputs on the next line the expected output &lt;code&gt;hello world&lt;/code&gt;. Now I press &lt;code&gt;C-p&lt;/code&gt; which brings up the previous statement that I just typed (&lt;code&gt;echo &quot;hello world&quot;&lt;/code&gt; in this example) and I place the cursor with repeated &lt;code&gt;C-b&lt;/code&gt; just before the word &lt;code&gt;world&lt;/code&gt; (in other words before &lt;code&gt;w&lt;/code&gt;). Now I do &lt;code&gt;M-x term-line-mode&lt;/code&gt; and I do some edits to the command. &lt;strong&gt;Weird stuff happens at this point&lt;/strong&gt;. Sometimes the edits are not registered after I go back to &lt;code&gt;M-x term-char-mode&lt;/code&gt; and execute the edited command, sometimes the text jumbles, etc. A screencast shows these possibilities: &lt;a href=&quot;https://i.stack.imgur.com/wVGxk.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://i.stack.imgur.com/wVGxk.jpg&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my setup in &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; related to &lt;code&gt;ansi-term&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;;;; Improving ansi-term&#xA;;; make that C-c t e launches an ansi-term buffer in the current window&#xA;(global-set-key (kbd &quot;C-c t e&quot;) 'ansi-term)&#xA;;; avoid ansi-term asking always which shell to run (always run bash)&#xA;(defvar my-term-shell &quot;/bin/bash&quot;)&#xA;(defadvice ansi-term (before force-bash)&#xA;  (interactive (list my-term-shell)))&#xA;(ad-activate 'ansi-term)&#xA;;; display of certain characters and control codes to UTF-8&#xA;(defun my-term-use-utf8 ()&#xA;  (set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix))&#xA;(add-hook 'term-exec-hook 'my-term-use-utf8)&#xA;;; clickable URLs&#xA;(defun my-term-hook ()&#xA;  (goto-address-mode))&#xA;(add-hook 'term-mode-hook 'my-term-hook)&#xA;;; make that typing exit in ansi-term (which exits the shell) also&#xA;;; closes the buffer&#xA;(defadvice term-sentinel (around my-advice-term-sentinel (proc msg))&#xA;  (if (memq (process-status proc) '(signal exit))&#xA;      (let ((buffer (process-buffer proc)))&#xA;        ad-do-it&#xA;        (kill-buffer buffer))&#xA;    ad-do-it))&#xA;(ad-activate 'term-sentinel)&#xA;;; fix the problem of moving cursor left/right being captured by emacs&#xA;;; instead of underlying terminal, leading to jumbling when jumping&#xA;;; words then editing the middle of a command. Same for deleting&#xA;;; backward/forward whole words.&#xA;(eval-after-load &quot;term&quot;&#xA;  '(progn&#xA;     ;; rename buffer&#xA;     (define-key term-raw-map (kbd &quot;C-c r&quot;) 'rename-buffer)&#xA;&#xA;     ;; make sure typical key combos work in term-char-mode&#xA;     (define-key term-raw-map (kbd &quot;M-x&quot;) 'nil)&#xA;     (define-key term-raw-map (kbd &quot;M-&amp;amp;&quot;) 'nil)&#xA;     (define-key term-raw-map (kbd &quot;M-!&quot;) 'nil)&#xA;&#xA;     ;; make sure C-c t e launches a new ansi-term buffer when current&#xA;     ;; buffer is also ansi-term&#xA;     (define-key term-raw-map (kbd &quot;C-c t e&quot;) 'nil)&#xA;&#xA;     ;; move by whole words fix&#xA;     (define-key term-raw-map (kbd &quot;C-&amp;lt;right&amp;gt;&quot;) 'term-send-Cright)&#xA;     (define-key term-raw-map (kbd &quot;C-&amp;lt;left&amp;gt;&quot;) 'term-send-Cleft)&#xA;     (defun term-send-Cright () (interactive) (term-send-raw-string &quot;\e[1;5C&quot;))&#xA;     (defun term-send-Cleft  () (interactive) (term-send-raw-string &quot;\e[1;5D&quot;))&#xA;     (defun term-send-Mbackspace () (interactive)(term-send-raw-string &quot;\e\d&quot;))&#xA;&#xA;     ;; word deletion fix&#xA;     (define-key term-raw-map (kbd &quot;C-w&quot;) 'term-send-Mbackspace)&#xA;     (define-key term-raw-map (kbd &quot;M-&amp;lt;backspace&amp;gt;&quot;) 'term-send-Mbackspace)     &#xA;&#xA;     ;; switch between char and line mode with logical keystrokes&#xA;     (add-hook 'term-mode-hook (lambda () (local-set-key (kbd &quot;C-c t c&quot;) 'term-char-mode)))&#xA;     (define-key term-raw-map (kbd &quot;C-c t l&quot;) 'term-line-mode)&#xA;&#xA;     ;; copy/paste native Emacs keystrokes&#xA;     (define-key term-raw-map (kbd &quot;C-k&quot;) 'term-send-raw)&#xA;     (define-key term-raw-map (kbd &quot;C-y&quot;) 'term-paste)&#xA;&#xA;     ;; ensure that scrolling doesn't break on output&#xA;     ;;(setq term-scroll-show-maximum-output t)&#xA;     (setq term-scroll-to-bottom-on-output t)&#xA;&#xA;     ;; max history (# lines) to keep (0 == keep everything)&#xA;     (setq term-buffer-maximum-size 50000)))&#xA;;; ansi-term bi-directional text support problem fix, which seems to&#xA;;; be the cause of text jumbling when going back commands in&#xA;;; ansi-term. This fixes it, yay!&#xA;(add-hook 'term-mode-hook 'my-term-mode-hook)&#xA;(defun my-term-mode-hook ()&#xA;  ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20611&#xA;  (setq bidi-paragraph-direction 'left-to-right))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please help me to resolve this issue.&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2017-02-01T07:15:43.447" Title="ansi-term changes in line-mode not registered after char-mode" Tags="|shell|ansi-term|term|bash|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30350" PostTypeId="2" ParentId="30340" CreationDate="2017-02-01T07:21:03.723" Score="2" Body="&lt;p&gt;The simplest method would probably be to add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: -:nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the file.  This will disable conversion of all &lt;em&gt;special strings&lt;/em&gt; like &lt;code&gt;--&lt;/code&gt; (to &lt;code&gt;–&lt;/code&gt;) and &lt;code&gt;...&lt;/code&gt; (to &lt;code&gt;…&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="8987" LastActivityDate="2017-02-01T07:21:03.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30351" PostTypeId="2" ParentId="30320" CreationDate="2017-02-01T07:56:14.983" Score="-1" Body="&lt;p&gt;If you have &lt;code&gt;ssh&lt;/code&gt; access to the respective server at work you can start the emacs server at work using the command (with the respective username and server host name):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ssh -X myuser@myserver.work.domain emacs --daemon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: If your emacs is already started on the server than just kill it and add automatic server start in your .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ ssh myuser@myserver.work.domain killall emacs&#xA;$ ssh myuser@myserver.work.domain sh -c &quot;echo '(server-start)' &amp;gt;&amp;gt; ~/.emacs&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now you can start emacs in daemon mode as described on the first command. The added server-start command would enable the server on the opened emacs session.&lt;/p&gt;&#xA;" OwnerUserId="12943" LastEditorUserId="12943" LastEditDate="2017-02-02T19:28:52.667" LastActivityDate="2017-02-02T19:28:52.667" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30352" PostTypeId="2" ParentId="30320" CreationDate="2017-02-01T08:02:35.500" Score="1" Body="&lt;p&gt;Not answering the direct question, but I suggest the following in your init file to prevent this from happening in future.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Start server (but don't restart).&#xA;(require 'server)&#xA;(unless (server-running-p)&#xA;  (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively (but still not helpful for your present situation), under the &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsAsDaemon#toc21&quot; rel=&quot;nofollow noreferrer&quot;&gt;FUBAR: Impossible to connect&lt;/a&gt; heading on the &quot;Emacs As Daemon&quot; EmacsWiki page, there's an ingenious approach to enabling a server start to be triggered with a process signal.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-02-01T08:15:22.287" LastActivityDate="2017-02-01T08:15:22.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30353" PostTypeId="2" ParentId="10469" CreationDate="2017-02-01T08:04:13.383" Score="1" Body="&lt;p&gt;You can use a virtual display solution, such as &lt;code&gt;xpra&lt;/code&gt;, to retain the X display session of emacs even after disconnecting from the remote server. Then, if you set &lt;code&gt;DISPLAY&lt;/code&gt; environment to the virtual display of &lt;code&gt;xpra&lt;/code&gt; when you create the emacs server instance it would keep your emacs session alive across network disconnections as if you are using a local display in the server. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See more details about &lt;code&gt;xpra&lt;/code&gt; at: &lt;a href=&quot;http://xpra.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://xpra.org/&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="12943" LastActivityDate="2017-02-01T08:04:13.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30354" PostTypeId="2" ParentId="30320" CreationDate="2017-02-01T09:27:48.567" Score="3" Body="&lt;p&gt;Since this is running on X, it might be possible to use a program like &lt;a href=&quot;http://manpages.ubuntu.com/manpages/trusty/man1/xdotool.1.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;xdotool&lt;/a&gt; , &lt;a href=&quot;https://github.com/baskerville/xdo&quot; rel=&quot;nofollow noreferrer&quot;&gt;xdo&lt;/a&gt;, or &lt;a href=&quot;https://www.freedesktop.org/wiki/Software/wmctrl/&quot; rel=&quot;nofollow noreferrer&quot;&gt;wmctrl&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All these programs allow you to list windows, select one, and simulate typing on them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach would be to run &lt;a href=&quot;http://www.karlrunge.com/x11vnc/&quot; rel=&quot;nofollow noreferrer&quot;&gt;x11vnc&lt;/a&gt; on the remote machine and connect to it with a local vnc viewer. The referenced manual page tells you how to forward needed ports using ssh.&lt;/p&gt;&#xA;" OwnerUserId="12895" LastActivityDate="2017-02-01T09:27:48.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30355" PostTypeId="1" CreationDate="2017-02-01T10:45:33.423" Score="6" ViewCount="784" Body="&lt;p&gt;Recently, I'd wanted to commit to my git repository from within emacs. Instead of running some git mode commands, I opened up a terminal buffer and run &lt;code&gt;git commit&lt;/code&gt; inside. This works fine, except that the commit message editor is, of course, emacs. Out of habit, I tried to save-close the editor after inserting the commit message, but that closed my parent emacs...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I run emacs in client/server mode, I can simply reconnect and have all the buffers still open. But how do I close the child emacs (apart from killing it from within another terminal)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, how do I send ctrl/meta to a program running in the terminal buffer?&lt;/p&gt;&#xA;" OwnerUserId="14763" LastEditorUserId="105" LastEditDate="2017-02-01T15:33:59.253" LastActivityDate="2023-07-25T21:48:57.017" Title="Exit emacs client that runs inside emacs terminal buffer" Tags="|term|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30356" PostTypeId="1" AcceptedAnswerId="30359" CreationDate="2017-02-01T12:18:28.180" Score="3" ViewCount="317" Body="&lt;p&gt;I wrote a &lt;a href=&quot;https://github.com/tmalsburg/guess-language.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;minor mode for automatically detecting the language&lt;/a&gt; in which the user is typing.  For this to work, I have to load some files containing language statistics.  These files are in a subdirectory of the (m)elpa package.  How can I determine the path to these files?  Is there a function that gives me the base directory of a package?&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2017-02-01T14:23:36.330" Title="How can I find the path of files in an (m)elpa package?" Tags="|package-repositories|path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30357" PostTypeId="2" ParentId="30356" CreationDate="2017-02-01T12:34:32.450" Score="3" Body="&lt;p&gt;One (imperfect) solution is to use &lt;code&gt;find-function-library&lt;/code&gt;.  Given a function, this returns a pair &lt;code&gt;(ORIG-FUNCTION . LIBRARY)&lt;/code&gt;.  Quote from the documentation: &lt;code&gt;ORIG-FUNCTION&lt;/code&gt; is the original name, after removing all advice and resolving aliases.  LIBRARY is an absolute file name, a relative file name inside the C sources directory, or a name of an autoloaded feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The benefit of this solution is that it works independently of whether the function is defined in an elpa package or not.  However, if the user redefines the function, the path changes.  So it would still be desirable to have a way to find the base directory of an elpa package.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2017-02-01T13:21:55.060" LastActivityDate="2017-02-01T13:21:55.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30358" PostTypeId="2" ParentId="24133" CreationDate="2017-02-01T13:49:58.257" Score="4" Body="&lt;p&gt;Facing a similar problem, I realize this behavior is due to &lt;code&gt;find-file&lt;/code&gt; in particular. I didn't try using &lt;code&gt;save-window-excursion&lt;/code&gt; instead of &lt;code&gt;save-excursion&lt;/code&gt;. What I used instead was&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (find-file-noselect &quot;just-a-test&quot;)&#xA; (insert &quot;blah&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That way, &lt;code&gt;just-a-test&lt;/code&gt; is loaded or switched to if it already visited in the background. It remains open. As far as I can see, for this simple example the two methods (this and the one by phils) is a matter of taste.&lt;/p&gt;&#xA;" OwnerUserId="13752" LastActivityDate="2017-02-01T13:49:58.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30359" PostTypeId="2" ParentId="30356" CreationDate="2017-02-01T14:23:36.330" Score="2" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar guess-language-data-dir&#xA;  (expand-file-name &quot;trigrams&quot;&#xA;                    (file-name-directory&#xA;                     (or load-file-name buffer-file-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;load-file-name&lt;/code&gt; is set when the elisp file is loading (and requiring), &lt;code&gt;buffer-file-name&lt;/code&gt; is set when user use &lt;code&gt;M-x eval-buffer&lt;/code&gt; to load the file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notes that it can't detect directory changes, for example, your package probably stops working after user upgrades it without restart Emacs since upgrading also means deleting old package by default. But I guess it's OK since restarting Emacs is necessary to make the new package takes effect after upgrading(?)&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-02-01T14:23:36.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30360" PostTypeId="2" ParentId="30355" CreationDate="2017-02-01T14:35:54.650" Score="6" Body="&lt;p&gt;If you're in &lt;code&gt;term&lt;/code&gt; buffer in &lt;code&gt;char mode&lt;/code&gt;, you have to escape &lt;code&gt;C-c&lt;/code&gt;. So, if you're running a terminal Emacs instance inside the term buffer, running &lt;code&gt;save-buffers-kill-terminal&lt;/code&gt; requires an extra &lt;code&gt;C-c&lt;/code&gt;: &lt;code&gt;C-x C-c C-c&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If you're running an Emacs instance in a &lt;code&gt;term&lt;/code&gt; buffer in &lt;code&gt;line mode&lt;/code&gt;, I don't think there's a direct way to kill the nested Emacs. You have to switch back to char mode first, via &lt;code&gt;C-c C-k&lt;/code&gt;. Then you can call &lt;code&gt;C-x C-c C-c&lt;/code&gt; as above.&lt;/p&gt;&#xA;&lt;p&gt;That said, rather than starting an Emacs instance from your term buffer, you should call &lt;code&gt;emacsclient&lt;/code&gt; instead. That will open up your file in a regular Emacs buffer in the current Emacs instance, without all the confusing nesting of Emacs-inside-term-inside-Emacs.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2023-07-25T21:48:57.017" LastActivityDate="2023-07-25T21:48:57.017" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30362" PostTypeId="2" ParentId="30343" CreationDate="2017-02-01T14:49:42.290" Score="5" Body="&lt;p&gt;You need to set the &lt;code&gt;:session&lt;/code&gt; header argument. This tells org that all R calculations will take place in the same session. For example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;#+PROPERTY: header-args:R :session orgR&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I set my constant here src_R{t=10; 2*t}.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Write some more text.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;And reuse the constant here src_R{t * 4}.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On export, this generates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9lfWo.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9lfWo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-01T14:49:42.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30363" PostTypeId="1" AcceptedAnswerId="30374" CreationDate="2017-02-01T14:50:31.550" Score="3" ViewCount="599" Body="&lt;p&gt;I code in Erlang, and I dislike the default indentation style that &lt;code&gt;erlang.el&lt;/code&gt; provides: it tends to push code way too far to the right for my likings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to have a simple automatic indentation scheme: (1) pressing RET creates a newline with the same indentation level as the previous line; (2) pressing TAB moves the indentation level one level up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured out (2) by adding &lt;code&gt;(defalias 'erlang-indent-command 'tab-to-tab-stop)&lt;/code&gt; to my &lt;code&gt;init.el&lt;/code&gt;, but I can't find a proper command to use for RET to solve (1).&lt;/p&gt;&#xA;" OwnerUserId="14766" LastEditorUserId="897" LastEditDate="2017-05-23T09:30:04.217" LastActivityDate="2017-05-23T09:30:04.217" Title="Mapping RET to use the same indentation level as the previous line" Tags="|indentation|newlines|erlang-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30364" PostTypeId="2" ParentId="30363" CreationDate="2017-02-01T14:58:03.563" Score="0" Body="&lt;p&gt;I think you are looking for &lt;code&gt;newline-and-indent&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;newline-and-indent is an interactive compiled Lisp function in ‘simple.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(newline-and-indent)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Insert a newline, then indent according to major mode.&#xA;  Indentation is done using the value of ‘indent-line-function’.&#xA;  In programming language modes, this is the same as TAB.&#xA;  In some text modes, where TAB inserts a tab, this command indents to the&#xA;  column specified by the function ‘current-left-margin’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-01T14:58:03.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30365" PostTypeId="2" ParentId="30342" CreationDate="2017-02-01T15:19:00.403" Score="0" Body="&lt;p&gt;It turns out this was a problem with ruby gems as a whole, not just &lt;code&gt;rspec&lt;/code&gt;. And there's an emacs package that fixes the problem: &lt;code&gt;rvm&lt;/code&gt;, &lt;a href=&quot;https://stackoverflow.com/questions/14124112/emacs-fails-to-load-ruby-gems-unless-invoked-from-zsh&quot;&gt;as outlined here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, a step by step solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x package-install&#xA;rvm&#xA;M-x rvm-use-default&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also add &lt;code&gt;(rvm-use-default)&lt;/code&gt; to your &lt;code&gt;init&lt;/code&gt; file to enable the package from startup.&lt;/p&gt;&#xA;" OwnerUserId="14499" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-02-01T15:19:00.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30366" PostTypeId="1" CreationDate="2017-02-01T15:20:45.047" Score="0" ViewCount="218" Body="&lt;p&gt;I use this function to reopen a file killed by mistake.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun undo-kill-buffer ()&#xA;    (interactive)&#xA;    (let ((active-files (loop for buf in (buffer-list)&#xA;                              when (buffer-file-name buf) collect it)))&#xA;      (loop for file in recentf-list&#xA;            unless (member file active-files) return (find-file file))))&#xA;  (global-set-key (kbd &quot;C-x K&quot;) 'undo-kill-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that I would like to reopen the file at the right place (&lt;code&gt;save-place-mode&lt;/code&gt;) only in this case. If I open a file with another function (&lt;code&gt;find-file&lt;/code&gt;, &lt;code&gt;find-alternate-file&lt;/code&gt;, &lt;code&gt;find-file-at-point&lt;/code&gt;, ...) I don't want to remember the last position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not found a solution to activate save-place-mode in some cases only.&#xA;Is it possible to write a &lt;code&gt;find-file-with-saveplace&lt;/code&gt; function without modify &lt;code&gt;find-file&lt;/code&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;" OwnerUserId="8842" LastActivityDate="2017-11-29T19:53:46.710" Title="undo-kill-buffer and save-place-mode" Tags="|kill-buffer|saveplace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30369" PostTypeId="1" AcceptedAnswerId="30497" CreationDate="2017-02-01T17:32:23.927" Score="1" ViewCount="46" Body="&lt;pre&gt;&lt;code&gt;In magit-repolist-mode:&#xA;magit-repos.el:151:9:Warning: assignment to free variable ‘x-stretch-cursor’&#xA;&#xA;In magit-submodule-list-mode:&#xA;magit-submodule.el:332:9:Warning: assignment to free variable&#xA;‘x-stretch-cursor’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any way I can stop that?&lt;/p&gt;&#xA;" OwnerUserId="11053" LastActivityDate="2017-02-06T16:09:15.667" Title="I get a warning loading magit sometimes" Tags="|magit|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30370" PostTypeId="1" AcceptedAnswerId="30371" CreationDate="2017-02-01T18:54:30.223" Score="3" ViewCount="456" Body="&lt;p&gt;I know one can mark the whole buffer with &lt;code&gt;mark-whole-buffer&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but how does one mark from point (that line) to start of buffer?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastActivityDate="2017-02-01T21:17:28.947" Title="emacs mark from point to start of buffer?" Tags="|mark|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30371" PostTypeId="2" ParentId="30370" CreationDate="2017-02-01T18:57:40.463" Score="5" Body="&lt;p&gt;I would do this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-SPC&lt;/code&gt; to set the mark&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;M-&amp;lt;&lt;/code&gt; to go to the beginning of the buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Or, if you want to finish with point where you started:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;M-&amp;lt;&lt;/code&gt; to go to the beginning of the buffer (which sets the mark at point but does not activate the mark)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-x&lt;/code&gt; to activate the mark and swap mark and point.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you do this a lot, you can define a command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mark-to-beginning-of-buffer ()&#xA;  &quot;Marks the region from the beginning of the buffer to point.&quot;&#xA;  (interactive)&#xA;  (push-mark (point-min) nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="25" LastEditDate="2017-02-01T21:17:28.947" LastActivityDate="2017-02-01T21:17:28.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30373" PostTypeId="2" ParentId="30366" CreationDate="2017-02-01T19:06:12.337" Score="1" Body="&lt;p&gt;Take a look at the source for &lt;code&gt;save-place--setup-hooks&lt;/code&gt;, since you want a subset of this behavior. I haven't tested this out, but I believe you want:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;(add-hook 'kill-buffer-hook #'save-place-to-alist)&lt;/code&gt; so that the place is saved when a buffer is killed. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Modify your undo command to call &lt;code&gt;save-place-find-file-hook&lt;/code&gt; after it calls &lt;code&gt;find-file&lt;/code&gt;, with the restored buffer as the current buffer. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;: The &lt;code&gt;save-place-to-alist&lt;/code&gt; function checks whether save-place is set, so you probably need your own function here too:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun always-save-place-to-alist ()&#xA;  (let ((save-place t))&#xA;    (save-place-to-alist)))&#xA;&#xA;(add-hook 'kill-buffer-hook #'always-save-place-to-alist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the hook that restores the position also enables save-place, so you probably want this too:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun restore-save-place ()&#xA;  (save-place-find-file-hook)&#xA;  (setq save-place nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-02-02T14:25:17.787" LastActivityDate="2017-02-02T14:25:17.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30374" PostTypeId="2" ParentId="30363" CreationDate="2017-02-01T19:37:28.410" Score="3" Body="&lt;p&gt;Maybe something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun newline-and-indent-same-level ()&#xA;  &quot;Insert a newline, then indent to the same column as the current line.&quot;&#xA;  (interactive)&#xA;  (let ((col (save-excursion&#xA;               (back-to-indentation)&#xA;               (current-column))))&#xA;    (newline)&#xA;    (indent-to-column col)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-02-01T19:37:28.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30375" PostTypeId="1" AcceptedAnswerId="30376" CreationDate="2017-02-01T19:46:26.910" Score="2" ViewCount="391" Body="&lt;p&gt;From where is the current date as known by org-mode taken? Do I need to perhaps adjust some TimeZone settings? Or is the date determined by the date my Emacs session was started. I close emacs pretty rarely. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some more info:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a restart, &lt;code&gt;org-date-from-calendar&lt;/code&gt; give me&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No buffer named *Calendar*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However if I first do &lt;code&gt;org-time-stamp&lt;/code&gt; which will pop up a Calendar buffer to let me select a date, and then later use &lt;code&gt;org-date-from-calendar&lt;/code&gt; we're back in business and the date is current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it seems that the Calendar buffer needs to be initialized an also refreshed somehow. &lt;/p&gt;&#xA;" OwnerUserId="12467" LastEditorUserId="12467" LastEditDate="2017-02-01T20:55:57.863" LastActivityDate="2017-02-01T21:05:43.937" Title="org-date-from-calendar returns yesterday's date: how to initialize and refresh Calendar Buffer" Tags="|org-mode|calendar|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30376" PostTypeId="2" ParentId="30375" CreationDate="2017-02-01T20:55:12.690" Score="2" Body="&lt;p&gt;I don't think you'd ordinarily call &lt;code&gt;org-date-from-calendar&lt;/code&gt; directly. It returns the date under point in a calendar buffer. But it doesn't actually show you the calendar, so calling it without one of the helper functions associated is going to be confusing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably easier is to use &lt;code&gt;org-timestamp&lt;/code&gt; (&lt;code&gt;C-c .&lt;/code&gt;)or &lt;code&gt;org-timestamp-inactive&lt;/code&gt; (&lt;code&gt;C-c !&lt;/code&gt;), which do show you the calendar so you can see what you're selecting.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-02-01T21:05:43.937" LastActivityDate="2017-02-01T21:05:43.937" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30377" PostTypeId="2" ParentId="30343" CreationDate="2017-02-01T21:02:03.500" Score="7" Body="&lt;p&gt;&lt;strong&gt;Try this&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Define &lt;code&gt;t&lt;/code&gt; as default header argument with using &lt;code&gt;:var t=10&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+PROPERTY: header-args:R :var t=10&#xA;&#xA;The temperature is src_R{2*t}, and twice of that is src_R{4*t}.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Fixed typo in second in-line block and removed &lt;code&gt;t=10;&lt;/code&gt; assignment.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Exports as&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The temperature is `20', and twice of that is `40'.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Hope that helped!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Tested Using&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;emacs version:&lt;/strong&gt;     GNU Emacs 24.5.1&lt;br&gt;&#xA;  &lt;strong&gt;org-mode version:&lt;/strong&gt;               9.0 &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="388" LastActivityDate="2017-02-01T21:02:03.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30378" PostTypeId="1" AcceptedAnswerId="30554" CreationDate="2017-02-01T21:24:47.987" Score="1" ViewCount="242" Body="&lt;p&gt;I like to automatically publish my org files using a cron job once an hour. I therefore run a cron job that executes the following script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Load everything ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;&#xA;(require 'org)&#xA;(org-babel-load-file&#xA; (expand-file-name &quot;emacs-init.org&quot;&#xA;                   user-emacs-directory))&#xA;&#xA;;;; Publish ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;&#xA;(org-publish-project &quot;org-notes&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that my &lt;code&gt;org-notes&lt;/code&gt; project uses the &lt;code&gt;org-html-publish-to-html&lt;/code&gt; publishing function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if this job runs while I'm visiting an unsaved file in another Emacs instance the script hangs with a message like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...foo.org locked by tom@pam... (pid 12320): (s, q, p, ?)?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Based on the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Interlocking.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs interlocking help page&lt;/a&gt; it looks like I should get an error like this is I try to &lt;strong&gt;edit&lt;/strong&gt; a file that contains unsaved edits that were made by another Emacs instance. However, I don't see why &lt;code&gt;org-publish-project&lt;/code&gt; would try to &lt;strong&gt;edit&lt;/strong&gt; any org files. It was my impression that it just read the org files from the disk and then converted them into HTML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would &lt;code&gt;org-html-publish-to-html&lt;/code&gt; actually try to edit an org file?&lt;/p&gt;&#xA;" OwnerUserId="8228" LastActivityDate="2017-02-08T14:06:42.263" Title="org-html-publish-to-html Tries To Edit .org Files" Tags="|org-mode|org-publish|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30379" PostTypeId="1" AcceptedAnswerId="30383" CreationDate="2017-02-01T22:56:56.223" Score="6" ViewCount="1605" Body="&lt;p&gt;Anyway to have an org-mode doc open in 1 pane and a live buffer export in a second pane?&lt;/p&gt;&#xA;" OwnerUserId="12732" LastActivityDate="2017-02-02T06:58:25.220" Title="How to get Org-mode live buffer export?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30380" PostTypeId="1" AcceptedAnswerId="30413" CreationDate="2017-02-02T00:41:07.093" Score="0" ViewCount="149" Body="&lt;p&gt;I would like to use ediff-current-file to jump to some of my previous changes/edits.  However, when I type 'q' to quit ediff after calling ediff-current-file and navigation (using 'p'/'n'), the cursor always jumps to the change near the end of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to stay at the line I chosen during ediff?&lt;/p&gt;&#xA;" OwnerUserId="12987" LastActivityDate="2017-02-03T08:15:13.163" Title="How to keep cursor position after calling ediff-current-file?" Tags="|cursor|ediff|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30381" PostTypeId="1" CreationDate="2017-02-02T00:49:58.750" Score="1" ViewCount="255" Body="&lt;p&gt;I want to turn of the security confirmation for the R language, as described here:&#xA;&lt;a href=&quot;http://orgmode.org/manual/Code-evaluation-security.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/Code-evaluation-security.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I tried putting the following code in the &lt;code&gt;dotspacemacs/user-config ()&lt;/code&gt; section of my &lt;code&gt;.spacemacs&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-org-confirm-babel-evaluate (lang body)&#xA;            (not (string= lang &quot;R&quot;)))  &#xA;          (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't have any effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to &lt;code&gt;customize-varibale&lt;/code&gt; as elaborated on the link above, &lt;code&gt;org-confirm-babel-evaluate&lt;/code&gt;, I always get an error saying that the function is invalid. I have tried combinations with and without the the &lt;code&gt;setq&lt;/code&gt; command and with and without the brackets around the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can turn off the &lt;code&gt;org-confirm-babel-evaluate&lt;/code&gt; variable for all code blocks, and it works too, but that's not the ideal case as now any code block of any language would be executed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how would I add an additional language (say python) to the function above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new to emacs and am using the following version of spacemacs. &#xA;Using: 0.200.7@25.1.1 (spacemacs)&lt;/p&gt;&#xA;" OwnerUserId="13502" LastActivityDate="2017-02-02T00:49:58.750" Title="Spacemacs: Code evaluation and security issue" Tags="|org-mode|spacemacs|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30382" PostTypeId="2" ParentId="29624" CreationDate="2017-02-02T05:44:20.187" Score="3" Body="&lt;p&gt;Properties of frames are called &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Frame-Parameters.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;frame parameters&lt;/a&gt;. Whether a frame is maximized this way or not is controlled by the &lt;code&gt;'fullscreen&lt;/code&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Size-Parameters.html#Size-Parameters&quot; rel=&quot;nofollow noreferrer&quot;&gt;parameter&lt;/a&gt;. We want this parameter to be &lt;code&gt;'fullboth&lt;/code&gt;. And we can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Parameter-Access.html#Parameter-Access&quot; rel=&quot;nofollow noreferrer&quot;&gt;set&lt;/a&gt; a frame parameter using &lt;code&gt;#'set-frame-parameter&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's code to make sure the &lt;code&gt;'fullscreen&lt;/code&gt; parameter is &lt;code&gt;'fullboth&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-parameter nil 'fullscreen 'fullboth)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-02-02T05:44:20.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30383" PostTypeId="2" ParentId="30379" CreationDate="2017-02-02T06:51:01.317" Score="8" Body="&lt;p&gt;There is no generic way of doing it. However, if HTML preview is good enough for you, there is &lt;a href=&quot;https://github.com/lujun9972/org-preview-html&quot; rel=&quot;noreferrer&quot;&gt;org-preview-html&lt;/a&gt; that updates on save.&lt;/p&gt;&#xA;" OwnerUserId="903" LastEditorUserId="903" LastEditDate="2017-02-02T06:58:25.220" LastActivityDate="2017-02-02T06:58:25.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30384" PostTypeId="1" CreationDate="2017-02-02T07:59:51.370" Score="1" ViewCount="1256" Body="&lt;p&gt;I'm struggling to find a way to define keys only for eshell. Looking at the emacs wiki I saw examples using the &lt;code&gt;eshell-mode-map&lt;/code&gt; yet I get errors when trying to define it. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;progn: Symbol’s value as variable is void: eshell-mode-map&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm trying to get the f-keys to work as nornal f-keys after using them to quick launch functions in global mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I tried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key eshell-mode-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) (kbd &quot;&amp;lt;f9&amp;gt;&quot;)  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="11172" LastEditDate="2017-09-08T11:57:56.240" LastActivityDate="2017-09-08T11:57:56.240" Title="Define custom keys only for eshell" Tags="|key-bindings|eshell|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30385" PostTypeId="2" ParentId="30384" CreationDate="2017-02-02T09:03:47.210" Score="3" Body="&lt;pre&gt;&lt;code&gt;(add-hook 'eshell-mode-hook&#xA;          (lambda ()&#xA;            (define-key eshell-mode-map (kbd &quot;&amp;lt;f9&amp;gt;&quot;) #'emacs-version)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-02-02T09:03:47.210" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="30386" PostTypeId="1" CreationDate="2017-02-02T09:07:14.593" Score="1" ViewCount="151" Body="&lt;p&gt;&lt;code&gt;wl-summary-goto-folder&lt;/code&gt; (keybinding &lt;kbd&gt;g&lt;/kbd&gt; in &lt;a href=&quot;http://www.gohome.org/wl/doc/wl_35.html#SEC76&quot; rel=&quot;nofollow noreferrer&quot;&gt;Summary mode&lt;/a&gt;), permits to jump to a folder whose name is entered interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'd like is to pass it the folder name by argument, in order to call it at emacs startup time, with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c --eval &quot;(wl-folder-goto-folder 'folder_name)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can do that ?&lt;/p&gt;&#xA;" OwnerUserId="2047" LastActivityDate="2017-09-01T10:42:54.180" Title="How to go to a folder programmatically?" Tags="|wanderlust|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30387" PostTypeId="1" CreationDate="2017-02-02T09:54:01.530" Score="2" ViewCount="3924" Body="&lt;p&gt;The Haskell stack build doesn't install ghc to the system, only for itself, and using spacemacs without a systemwide configured ghc have been a painful experience (to me).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, there is a correct way of configuring emacs/spacemacs for using with stack, or users are supposed to install a systemwide ghc and stack to work with emacs/spacemacs and haskell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Creating a layer specific to deal with stack seems to me to be the right  solution, but I don't know how to do this, I'm a beginner on both stack and emacs, so... &lt;/p&gt;&#xA;" OwnerUserId="11753" LastActivityDate="2017-08-19T02:44:34.590" Title="How to configure spacemacs to work correctly with haskell Stack?" Tags="|spacemacs|haskell-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30388" PostTypeId="2" ParentId="29763" CreationDate="2017-02-02T14:17:19.320" Score="1" Body="&lt;p&gt;Install &lt;code&gt;eval-in-repl&lt;/code&gt; from MELPA and configure it as described in the readme at &lt;a href=&quot;https://github.com/kaz-yos/eval-in-repl/blob/master/README.md&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/kaz-yos/eval-in-repl/blob/master/README.md&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current instructions from the readme suggest&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Python support ;; &#xA;(require 'python) ; if not done elsewhere &#xA;(require 'eval-in-repl-python)&#xA; (add-hook 'python-mode-hook&#xA; '(lambda ()&#xA; (local-set-key (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) 'eir-eval-in-python))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for python support.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2017-02-02T14:17:19.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30389" PostTypeId="1" CreationDate="2017-02-02T14:46:32.053" Score="0" ViewCount="76" Body="&lt;p&gt;Using &lt;code&gt;yasnippet&lt;/code&gt;, whenever I use the &lt;code&gt;yas-expand&lt;/code&gt; function to expand a snippet, the result depends on whether the emacs session is in an X window or not.  If I am in an in-terminal session of emacs, then the snippet is correctly expanded.  If I am in an X window, on the other hand, I get an error message &lt;code&gt;call-interactively: Wrong number of arguments: (2 . 2), 0&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have others encountered this problem, and is there a solution to it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using yasnippet, with the latest version 20170127.2128 installed from melpa, using emacs 24.4.1 installed from the &lt;code&gt;emacs24&lt;/code&gt; package on Debian 8 (Jessie).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: With &lt;code&gt;toggle-debug-on-error&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 0)&#xA;  py-indent-region()&#xA;  call-interactively(py-indent-region nil nil)&#xA;  command-execute(py-indent-region)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like I was entirely mistaken about which function was being run.  I have &lt;code&gt;yas-expand&lt;/code&gt; bound to &lt;code&gt;C-c &amp;lt;tab&amp;gt;&lt;/code&gt;, but something else in my configuration overwrote that binding.&lt;/p&gt;&#xA;" OwnerUserId="14780" LastEditorUserId="14780" LastEditDate="2017-02-02T15:32:28.427" LastActivityDate="2017-02-02T15:32:28.427" Title="yasnippet, &quot;Wrong number of arguments&quot; when in X11 window" Tags="|yasnippet|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30390" PostTypeId="1" AcceptedAnswerId="30408" CreationDate="2017-02-02T15:36:49.057" Score="5" ViewCount="870" Body="&lt;p&gt;Is it possible to configure &lt;code&gt;org-mode&lt;/code&gt; to export to PDF in and asynchronous way?&lt;/p&gt;&#xA;" OwnerUserId="2441" LastActivityDate="2017-02-03T02:03:25.023" Title="Asynchronous export to PDF from org-mode" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30392" PostTypeId="1" AcceptedAnswerId="30393" CreationDate="2017-02-02T16:38:30.853" Score="5" ViewCount="1096" Body="&lt;p&gt;I've came across &lt;a href=&quot;https://github.com/timcharper/evil-surround/issues/86#issuecomment-258552759&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; comment in an &lt;a href=&quot;https://github.com/timcharper/evil-surround&quot; rel=&quot;nofollow noreferrer&quot;&gt;evil-surround&lt;/a&gt; issue, which stated this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; use non-spaced pairs when surrounding with an opening brace&#xA;(evil-add-to-alist&#xA; 'evil-surround-pairs-alist&#xA; ?\( '(&quot;(&quot; . &quot;)&quot;)&#xA; ?\[ '(&quot;[&quot; . &quot;]&quot;)&#xA; ?\{ '(&quot;{&quot; . &quot;}&quot;)&#xA; ?\) '(&quot;( &quot; . &quot; )&quot;)&#xA; ?\] '(&quot;[ &quot; . &quot; ]&quot;)&#xA; ?\} '(&quot;{ &quot; . &quot; }&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it actually works. but what are those strange &lt;code&gt;?\&lt;/code&gt; symbols? What are they doing? What do they mean? &lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="105" LastEditDate="2017-02-02T18:46:05.483" LastActivityDate="2017-02-02T18:46:05.483" Title="What are the ?\(, ?\[, ?\{ symbols in emacs lisp?" Tags="|characters|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30393" PostTypeId="2" ParentId="30392" CreationDate="2017-02-02T16:55:25.930" Score="5" Body="&lt;p&gt;Emacs represents&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Char-Syntax.html#Basic-Char-Syntax&quot; rel=&quot;noreferrer&quot;&gt;characters&lt;/a&gt;&#xA;with the &lt;code&gt;?a&lt;/code&gt; syntax (or &lt;code&gt;?\X&lt;/code&gt; for special characters, where &lt;code&gt;X&lt;/code&gt; is one of them).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(characterp &quot;a&quot;)                        ; =&amp;gt; nil&#xA;(characterp ?a)                         ; =&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They evaluate to integers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(integerp ?a)                           ; =&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They are &lt;em&gt;not&lt;/em&gt; single-character strings, so the following will throw an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-equal &quot;a&quot; ?a)                   ; =&amp;gt; (throws an error)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/String-Conversion.html&quot; rel=&quot;noreferrer&quot;&gt;convert&lt;/a&gt; them to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Strings.html#Creating-Strings&quot; rel=&quot;noreferrer&quot;&gt;strings&lt;/a&gt; using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(char-to-string ?a)                     ; =&amp;gt; &quot;a&quot;, note: semi-obsolete&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or just a plain old:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string ?a)                             ; =&amp;gt; &quot;a&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So now you have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-equal &quot;a&quot; (string ?a))          ; =&amp;gt; t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And for your special characters like parentheses and braces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(list (string-equal &quot;(&quot; (string ?\())&#xA;      (string-equal &quot;[&quot; (string ?\[))&#xA;      (string-equal &quot;{&quot; (string ?\{)))  ; =&amp;gt; (t t t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-02-02T16:55:25.930" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30394" PostTypeId="2" ParentId="30256" CreationDate="2017-02-02T17:39:23.553" Score="9" Body="&lt;p&gt;Without switching input methods there is direct access to all the german extra characters via &lt;code&gt;C-x 8 &quot;&lt;/code&gt;.  In particular&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x 8 &quot; a&lt;/code&gt; gives &lt;code&gt;ä&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x 8 &quot; A&lt;/code&gt; gives &lt;code&gt;Ä&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;etc. and&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x 8 &quot; s&lt;/code&gt; gives &lt;code&gt;ß&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Similarly &lt;code&gt;C-x 8 ' a&lt;/code&gt; gives &lt;code&gt;á&lt;/code&gt;, &lt;code&gt;C-x 8 ` a&lt;/code&gt; gives &lt;code&gt;à&lt;/code&gt;, &lt;code&gt;C-x 8 ^ a&lt;/code&gt; gives &lt;code&gt;â&lt;/code&gt; and &lt;code&gt;C-x 8 , c&lt;/code&gt; gives &lt;code&gt;ç&lt;/code&gt; and other accents may be obtained in a comparable way.  &lt;code&gt;C-h b&lt;/code&gt; shows all current key bindings, but it is a long list, so knowing to look under &lt;code&gt;C-x 8&lt;/code&gt; for european characters is useful. &lt;/p&gt;&#xA;" OwnerUserId="2710" LastActivityDate="2017-02-02T17:39:23.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30396" PostTypeId="2" ParentId="30091" CreationDate="2017-02-02T19:42:19.050" Score="2" Body="&lt;p&gt;It's compiled with different compiler options to address performance issues.&#xA;&lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-devel/2016-11/msg00284.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lists.gnu.org/archive/html/emacs-devel/2016-11/msg00284.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14785" LastActivityDate="2017-02-02T19:42:19.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30397" PostTypeId="1" CreationDate="2017-02-02T19:55:51.363" Score="6" ViewCount="3963" Body="&lt;p&gt;I'm running a GUI Emacs compiled from the &lt;code&gt;master&lt;/code&gt; git branch on MacOS El Capitan. I'm using the package &lt;code&gt;exec-path-from-shell&lt;/code&gt; to set several environment variables I have configured in my &lt;code&gt;~/.zshenv&lt;/code&gt; file. However, none of them inherited in Emacs. &lt;code&gt;GOPATH&lt;/code&gt; and &lt;code&gt;SHELL&lt;/code&gt; are not set and &lt;code&gt;PATH&lt;/code&gt; is not the PATH I have configured in my `~/.zshenv Currently I have the package configured with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package exec-path-from-shell&#xA;  :ensure t&#xA;  :defer f&#xA;  :config&#xA;  (exec-path-from-shell-copy-env &quot;GOPATH&quot;)&#xA;  (exec-path-from-shell-copy-env &quot;SHELL&quot;)&#xA;  (exec-path-from-shell-copy-env &quot;PATH&quot;)&#xA;  (when (memq window-system '(mac ns x))&#xA;    (exec-path-from-shell-initialize)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After launching Emacs, &lt;code&gt;M-x getenv&lt;/code&gt; for &lt;code&gt;PATH&lt;/code&gt; returns &lt;code&gt;/usr/bin:/usr/sbin/:/bin/:/sbin&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, executing &lt;code&gt;shell-command&lt;/code&gt; via &lt;code&gt;M-!&lt;/code&gt; with &lt;code&gt;zsh -l -i -c 'echo $PATH&lt;/code&gt;returns the PATH as I have set it in my &lt;code&gt;~/.zshenv&lt;/code&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;~/.zshenv&lt;/code&gt; looks like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export PATH=&quot;/Users/idclark/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/Users/idclark/Library/Android/sdk/tools:/Users/idclark/Library/Android/sdk/platform-tools&quot;&#xA;export JAVA_HOME=&quot;$(/usr/libexec/java_home)&quot;&#xA;export MANPATH=&quot;/usr/local/man:$MANPATH&quot;&#xA;export NVM_DIR=&quot;~/.nvm&quot;&#xA;export GOPATH=&quot;/Users/idclark/go/bin&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this a problem with my zsh config or how how I'm initializing the &lt;code&gt;exec-path-from-shell&lt;/code&gt; package?&lt;/p&gt;&#xA;" OwnerUserId="763" LastActivityDate="2017-02-03T12:28:53.520" Title="Package `exec-path-from-shell` isn't setting PATH variables from `.zshenv` on MacOS" Tags="|use-package|path|environment|zsh|exec-path|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30398" PostTypeId="2" ParentId="30303" CreationDate="2017-02-02T20:38:16.020" Score="2" Body="&lt;p&gt;&lt;code&gt;org-id-get-create&lt;/code&gt; calls &lt;code&gt;org-id-get&lt;/code&gt;, which calls &lt;code&gt;org-id-add-location&lt;/code&gt;, which updates the global &lt;code&gt;org-id-locations&lt;/code&gt; hash-table.  This does not automatically update the &lt;code&gt;org-id-locations-file&lt;/code&gt;.  I have chosen to add &lt;code&gt;org-id-locations-save&lt;/code&gt; to a custom version of &lt;code&gt;org-id-get&lt;/code&gt; -- just after the call to &lt;code&gt;org-id-add-location&lt;/code&gt;.  However, that is not mission critical since there are other methods such as the &lt;code&gt;kill-emacs-hook&lt;/code&gt; that trigger &lt;code&gt;org-id-locations-save&lt;/code&gt;.  [I simply want my database updated forthwith.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following function will remove the &lt;code&gt;ID&lt;/code&gt; property drawer and update both the &lt;code&gt;org-id-locations&lt;/code&gt; hash-table and the &lt;code&gt;org-id-locations-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun org-id-remove-entry ()&#xA;&quot;Remove/delete the ID entry and update the databases.&#xA;Update the `org-id-locations' global hash-table, and update the&#xA;`org-id-locations-file'.  `org-id-track-globally' must be `t`.&quot;&#xA;(interactive)&#xA;  (save-excursion&#xA;    (org-back-to-heading t)&#xA;    (when (org-entry-delete (point) &quot;ID&quot;)&#xA;      (org-id-update-id-locations nil 'silent))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-02T20:38:16.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30399" PostTypeId="1" AcceptedAnswerId="30400" CreationDate="2017-02-02T20:44:06.063" Score="0" ViewCount="179" Body="&lt;p&gt;From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/emacs.html#Displaying-Buffers&quot; rel=&quot;nofollow noreferrer&quot;&gt;GNU Emacs Manual: 20.6.2:&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you prefer Emacs to display a temporary buffer in a different&#xA;  fashion, we recommend to customize the variable &lt;code&gt;display-buffer-alist&lt;/code&gt;&#xA;  (see Choosing a Window for Display in The Emacs Lisp Reference&#xA;  Manual). For example, to display &lt;code&gt;*Completions*&lt;/code&gt; by splitting a window&#xA;  as described in the previous section, use the following form in your&#xA;  initialization file (see Init File):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(customize-set-variable  &#xA;'display-buffer-alist  &#xA;'((&quot;\\*Completions\\* display-buffer-pop-up-window)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've used the code above in my &lt;code&gt;init&lt;/code&gt; file, and it works, but I have a question. What are the &lt;code&gt;\\&lt;/code&gt;s doing in the &lt;code&gt;Completions&lt;/code&gt; buffer name? Does it make any difference if you just write &lt;code&gt;&quot;*Completions*&quot;&lt;/code&gt; instead? I've tried this, and I can't see any difference, but I'm worried I might be missing something. &lt;/p&gt;&#xA;" OwnerUserId="14499" LastEditorUserId="105" LastEditDate="2017-02-02T21:34:27.867" LastActivityDate="2017-02-02T21:49:07.560" Title="Why is &quot;*\\Completions\\*&quot; formatting used when specifying buffer names for display-buffer-alist?" Tags="|regular-expressions|string|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30400" PostTypeId="2" ParentId="30399" CreationDate="2017-02-02T21:03:49.223" Score="1" Body="&lt;p&gt;Take a look at the documentation for &lt;code&gt;display-buffer-alist&lt;/code&gt; (Use &lt;code&gt;C-h v&lt;/code&gt; to describe the variable). You'll see that each entry consists of a condition and an action, and that the condition is either a regular expression or a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, the string is interpreted as a regular expression. To match a literal &lt;code&gt;*&lt;/code&gt; character, you can escape it (&lt;code&gt;\\*&lt;/code&gt;) or put it in a character alternative  (&lt;code&gt;[*]&lt;/code&gt;) . Generally a &lt;code&gt;*&lt;/code&gt; in a regular expression means &quot;zero or more&quot; of whatever precedes it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It happens to work in your example, but it could match names other than just &lt;code&gt;*Completions*&lt;/code&gt;. More specifically, without the slashes you are creating a regular expression that will match &quot;*Completion&quot; followed by zero or more &quot;s&quot; characters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The double slash is required by the Lisp string syntax, because a single slash is itself interpreted as a special character. (E.g. &lt;code&gt;&quot;\n&quot;&lt;/code&gt; to represent a newline character.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the Lisp string &lt;code&gt;&quot;\\*foo\\*&quot;&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;represents the character sequence &lt;code&gt;\*foo\*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;which, when interpreted as a regular expression, will match the literal sequence of characters &lt;code&gt;*foo*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-02-02T21:49:07.560" LastActivityDate="2017-02-02T21:49:07.560" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30401" PostTypeId="1" AcceptedAnswerId="30404" CreationDate="2017-02-02T21:26:59.053" Score="6" ViewCount="1639" Body="&lt;p&gt;I'm looking for a way to reduce what Emacs kills when I use &lt;code&gt;backward-kill-word&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)&#xA;{&#xA;    if (PropertyChanged != null)&#xA;        PropertyChanged(this, e);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I'm editing the above code in Emacs and I place my cursor on the very last character (the &lt;code&gt;}&lt;/code&gt;) and I call &lt;code&gt;backward-kill-word&lt;/code&gt;, the entirety of &lt;code&gt;e);&lt;/code&gt; is killed, since Emacs only considers the &lt;code&gt;e&lt;/code&gt; to be a word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example is if you place your cursor on the 'P' of &lt;code&gt;PropertyChanged(this, e)&lt;/code&gt; and call &lt;code&gt;backward-kill-word&lt;/code&gt;, the entirety of &lt;code&gt;null)&lt;/code&gt; before it is killed. The closed parenthesis is simply considered to not be a word.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how I can eliminate this behavior. I want characters like &lt;code&gt;)&lt;/code&gt;, &lt;code&gt;'&lt;/code&gt;, &lt;code&gt;}&lt;/code&gt;, etc. to be treated as words by &lt;code&gt;backward-kill-word&lt;/code&gt;. This means that &lt;code&gt;backward-kill-word&lt;/code&gt; kills these characters and the cursor replaces them, just how &lt;code&gt;backward-kill-word&lt;/code&gt; typically behaves for one-character-long words like &lt;code&gt;e&lt;/code&gt;. One possible solution I've thought of is to somehow edit what Emacs considers to be words and simply add the characters I want to the list. Regardless, thanks for the help!&lt;/p&gt;&#xA;" OwnerUserId="14787" LastEditorUserId="14787" LastEditDate="2017-02-02T22:02:37.033" LastActivityDate="2017-02-02T23:09:40.840" Title="backward-kill-word kills too much, how to make it more intelligent?" Tags="|syntax|words|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30402" PostTypeId="2" ParentId="30401" CreationDate="2017-02-02T21:35:56.893" Score="3" Body="&lt;p&gt;Emacs uses &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;syntax tables&lt;/a&gt; to decide what is and is not a word. Each major mode will have its own syntax table. Commands that move over or delete words will use the values in this table to determine how far to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key syntax class in this case is the 'word constituent'. Deleting a word in Emacs works by deleting &lt;strong&gt;whole groups&lt;/strong&gt; of adjacent word constituents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add characters to the 'word constituent' class you can use &lt;code&gt;modify-syntax-entry&lt;/code&gt;. For example, to add the character &lt;code&gt;)&lt;/code&gt;, you'd use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?) &quot;w&quot;) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, this will modify the current syntax table. You'll need to do a bit more to target the syntax table for a particular mode. For example, I have the following in my &lt;code&gt;.init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;bibtex&quot;&#xA;     (modify-syntax-entry ?% &quot;_&quot; bibtex-mode-syntax-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will modify the syntax table for bibtex-mode after it's loaded, changing the &lt;code&gt;%&lt;/code&gt; character to a 'symbol constituent'. See the linked manual page for more details on the different syntax classes and how to set them.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Caution&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As @politza points out, changing the syntax table may have unintended consequences. Syntax classes are a pretty fundamental structure in Emacs, and many different functions depend on them, not just movement and deletion commands. So you might find surprising bugs arise as a consequence of such changes. &lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-02-02T22:23:04.093" LastActivityDate="2017-02-02T22:23:04.093" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30403" PostTypeId="2" ParentId="27576" CreationDate="2017-02-02T22:17:30.350" Score="3" Body="&lt;p&gt;Finally, figured it out:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;code&gt;M-x customize-group&lt;/code&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;org-export-pdf&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;org-latex-to-pdf-process&lt;/code&gt; (As explained &lt;a href=&quot;https://tex.stackexchange.com/questions/317810/emacsxetex-org-latex-export-to-pdf-to-create-pdfs-out-of-txt-files-saved-as-org&quot;&gt;here&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;change this option:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;%latex -interaction nonstopmode -output-directory %o %f&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;to this option:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;xelatex -interaction nonstopmode -output-directory %o %f&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;in all places!&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With this set, the latex headers in the question are redundant. Just type Devanagari text, and export will work fine in LaTeX!&lt;/p&gt;&#xA;" OwnerUserId="13502" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2017-02-21T00:21:27.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30404" PostTypeId="2" ParentId="30401" CreationDate="2017-02-02T22:31:05.607" Score="6" Body="&lt;p&gt;Here's a quick attempt at a custom function that may do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun backward-kill-char-or-word ()&#xA;  &quot;Delete the character or word before point.&quot;&#xA;  (interactive)&#xA;  (if (looking-back &quot;\\w&quot; 1)&#xA;      (backward-kill-word 1)&#xA;    (backward-delete-char 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This looks back one character to decide what to do. If it sees a word constituent character it kills the word, otherwise it just deletes one character. There may be other cases you needed to handle, this is &quot;lightly tested&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can revise this to handle whitespace in different ways. If you want to delete spaces along with the next word (which is what &lt;code&gt;backward-kill-word&lt;/code&gt; does), try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun backward-kill-char-or-word ()&#xA;  (interactive)&#xA;  (if (looking-back (rx (char word blank)) 1)&#xA;      (backward-kill-word 1)&#xA;    (backward-delete-char 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to delete a sequence of whitespace as a unit but stop at a word, try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun backward-kill-char-or-word ()&#xA;  (interactive)&#xA;  (cond &#xA;   ((looking-back (rx (char word)) 1)&#xA;    (backward-kill-word 1))&#xA;   ((looking-back (rx (char blank)) 1)&#xA;    (delete-horizontal-space t))&#xA;   (t&#xA;    (backward-delete-char 1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-02-02T23:09:40.840" LastActivityDate="2017-02-02T23:09:40.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30405" PostTypeId="1" AcceptedAnswerId="30406" CreationDate="2017-02-03T00:20:13.813" Score="2" ViewCount="375" Body="&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute 'hl-line nil&#xA;                      (cl-case (alist-get 'background-mode (frame-parameters))&#xA;                        ('light ; darker percent 5%&#xA;                         :background (color-darken-name (face-background 'highlight) 5)&#xA;                         )&#xA;                        ('dark&#xA;                         :background (color-lighten-name (face-background 'default) 3)&#xA;                         ))&#xA;                      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The upper code does not work. I hope some one can correct this code.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2017-02-03T01:08:24.397" Title="How to set face to different property by detecting the background-mode" Tags="|faces|" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30406" PostTypeId="2" ParentId="30405" CreationDate="2017-02-03T01:02:40.687" Score="1" Body="&lt;p&gt;The arguments to &lt;code&gt;set-face-attribute&lt;/code&gt; after the &lt;code&gt;FRAME&lt;/code&gt; arg need to come in pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you are passing only the new color value, not the pair &lt;code&gt;:background&lt;/code&gt; followed by that new color value.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(set-face-attribute &#xA; 'hl-line &#xA; nil &#xA; :background    ; &amp;lt;===== THIS WAS MISSING&#xA; (cl-case (alist-get 'background-mode (frame-parameters))&#xA;   ('light :background (color-darken-name (face-background 'highlight) 5))&#xA;   ('dark :background (color-lighten-name (face-background 'default) 3))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-02-03T01:08:24.397" LastActivityDate="2017-02-03T01:08:24.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30407" PostTypeId="1" CreationDate="2017-02-03T01:53:58.757" Score="0" ViewCount="119" Body="&lt;p&gt;Lately, I have seen some cases where I use re-search-forward to find a pattern, and then try to do something with the match, only to find that the match-data is apparently not correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in a file I might have this text:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:RESULTS:&#xA;async-abcd-1234-output&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would expect this code to replace async-abcd-1234-output with &quot;string&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (re-search-forward &quot;async-abcd-1234-\\(output\\|value\\)&quot; nil t)&#xA;  (let ((result-type (match-string 1)))&#xA;    (cond ((string= result-type &quot;output&quot;)&#xA;           (replace-match &quot;string&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That works when I run it in a buffer, but when I run it from a callback function I find that (match-string 1) is nil, and even (match-string 0) is &quot;&quot;. What could be causing this? I feel like sometimes it works, and then stops working. It is baffling. Any ideas on how to debug this? When I use edebug, I can see the search appears to work, but the match-data isn't correct.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2017-02-03T19:10:37.473" LastActivityDate="2017-03-05T19:35:34.477" Title="How do I debug when match-data is not getting set?" Tags="|debugging|replace|match-data|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30408" PostTypeId="2" ParentId="30390" CreationDate="2017-02-03T02:03:25.023" Score="8" Body="&lt;p&gt;Have you tried the async dispatch option?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c C-e C-a&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;toggles the async export.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-02-03T02:03:25.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30409" PostTypeId="2" ParentId="30407" CreationDate="2017-02-03T02:37:16.667" Score="1" Body="&lt;p&gt;I think you want to give the function a single string &lt;code&gt;REGEXP&lt;/code&gt; argument, not two separate strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(re-search-forward &quot;async-abcd-1234-\\(output\\|value\\)&quot; nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And you want to replace only the first match group, not the entire match, so you want this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-match &quot;string&quot; nil nil nil 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo ()&#xA;  (interactive)&#xA;  (when (re-search-forward &quot;async-abcd-1234-\\(output\\|value\\)&quot; nil t)&#xA;    (let ((result-type (match-string 1)))&#xA;      (cond ((string= result-type &quot;output&quot;)&#xA;             (replace-match &quot;string&quot; nil nil nil 1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-03T02:37:16.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30410" PostTypeId="1" CreationDate="2017-02-03T04:41:36.810" Score="5" ViewCount="540" Body="&lt;p&gt;I make substantial use of &lt;code&gt;prettify-symbols&lt;/code&gt; in my programming buffers. A snippet of some of my python symbols:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;        (lambda ()&#xA;          (mapc (lambda (pair) (push pair prettify-symbols-alist))&#xA;                '((&quot;for&quot; .      ?∀)&#xA;                  (&quot;in&quot; .       ?∊)&#xA;                  (&quot;not in&quot; .   ?∉)&#xA;                  (&quot;return&quot; .  ?⟼)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works fine for all cases except (html) exporting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pretty symbols from source code, or even directly from org-mode text, will not transfer over after exporting.&lt;/p&gt;&#xA;" OwnerUserId="14283" LastEditorUserId="14283" LastEditDate="2017-02-03T04:57:26.463" LastActivityDate="2024-03-29T19:03:25.357" Title="Export pretty symbols in org source blocks?" Tags="|org-mode|org-export|prettify-symbols-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30411" PostTypeId="2" ParentId="30386" CreationDate="2017-02-03T05:45:30.113" Score="1" Body="&lt;p&gt;Thanks to &lt;a href=&quot;https://emacs.stackexchange.com/questions/30386/how-to-go-to-a-folder-programmatically?noredirect=1#comment46780_30386&quot;&gt;lawlist comment&lt;/a&gt;, the answer is to call the internal function &lt;code&gt;wl-summary-goto-folder-subr&lt;/code&gt; with the right parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What ends up working for me is :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -c --eval &quot;(wl-summary-goto-folder-subr '\&quot;.INBOX\&quot; t nil nil t)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last &lt;code&gt;t&lt;/code&gt; is the &lt;code&gt;INTERACTIVE&lt;/code&gt; parameter and without it, it &quot;seems to do nothing&quot; (someone more knowledgeable at elisp please explain). The first &lt;code&gt;t&lt;/code&gt; is the &lt;code&gt;SCAN-TYPE&lt;/code&gt; parameter, and prevents a prompt (&lt;code&gt;Range (update):&lt;/code&gt;) at start time. No, I have no idea what I'm doing.&lt;/p&gt;&#xA;" OwnerUserId="2047" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-02-03T05:45:30.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30412" PostTypeId="2" ParentId="24322" CreationDate="2017-02-03T05:56:33.393" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://groups.google.com/d/msg/emacs-helm/3jqLhizElFE/GliufHvFCAAJ&quot; rel=&quot;nofollow noreferrer&quot;&gt;From Helm's author&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The only way is to suspend update (&lt;code&gt;C-!&lt;/code&gt;) at startup, it is  useful for example to enter a long regexp and not be annoyed by the constant update each time you enter character.  I use it also a lot when debugging. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, there's no way to automatically stop updating the Helm source when the pattern is changed.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-02-03T05:56:33.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30413" PostTypeId="2" ParentId="30380" CreationDate="2017-02-03T06:37:37.663" Score="1" Body="&lt;p&gt;As Tobias mentioned, Emacs 25 shows exactly my wanted behavior.  I found that the problem comes from the following codes I copied from &lt;a href=&quot;https://www.emacswiki.org/emacs/EdiffMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/EdiffMode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'ediff-load-hook&#xA;         (lambda ()&#xA;               (add-hook 'ediff-before-setup-hook&#xA;                     (lambda ()&#xA;                       (setq ediff-saved-window-configuration (current-window-configuration))))&#xA;               (let ((restore-window-configuration&#xA;                  (lambda ()&#xA;                    (set-window-configuration ediff-saved-window-configuration))))&#xA;             (add-hook 'ediff-quit-hook restore-window-configuration 'append)&#xA;             (add-hook 'ediff-suspend-hook restore-window-configuration 'append))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To fix it, I changed the last lambda function to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(lambda ()&#xA;  (save-excursion&#xA;     (set-window-configuration ediff-saved-window-configuration))&#xA;  (recenter nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12987" LastEditorUserId="12987" LastEditDate="2017-02-03T08:15:13.163" LastActivityDate="2017-02-03T08:15:13.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30414" PostTypeId="1" AcceptedAnswerId="35995" CreationDate="2017-02-03T08:01:47.603" Score="3" ViewCount="911" Body="&lt;p&gt;In most modern editors, after canceling a selection by a left/right motion, the cursor will be moved to the beginning/end of the previously-selected region correspondingly.  Similarly, if we cancel a selection by a up/down motion, the cursor will be moved up/down one line from the beginning/end of the previously-selected region correspondingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could we have the same behaviors in Emacs under &lt;code&gt;shift-select-mode&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to define my own movement function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-key* &quot;M-l&quot;&#xA;  (lambda (arg)&#xA;    (interactive &quot;^p&quot;)&#xA;    (if (use-region-p)&#xA;        (goto-char (region-end))&#xA;      (syntax-subword-forward arg))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work.  The &lt;code&gt;goto-char&lt;/code&gt; never run even if I am selecting a region.  Is it because I used &lt;code&gt;(interactive &quot;^p&quot;)&lt;/code&gt;?  Any solution?&lt;/p&gt;&#xA;" OwnerUserId="12987" LastEditorUserId="12987" LastEditDate="2017-10-03T07:06:42.783" LastActivityDate="2017-10-11T03:10:50.977" Title="How to move the cursor to the beginning/end of a shift-selected region by a left/right motion?" Tags="|region|motion|shift-selection|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30415" PostTypeId="2" ParentId="30410" CreationDate="2017-02-03T08:17:18.450" Score="0" Body="&lt;p&gt;The code below was too long to post as a comment, so I'm posting an answer even though it doesn't work. I thought it might be of some help. The problem I encountered was that &lt;code&gt;prettify-symbols-alist&lt;/code&gt; was empty.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ess/org-pretty-symbols-to-html (backend)&#xA;  (when (equal backend 'html)&#xA;    (goto-char (point-max))&#xA;    (while (ignore-errors (org-babel-previous-src-block))&#xA;      (org-narrow-to-element)&#xA;      (mapc&#xA;       (lambda (x)&#xA;         (goto-char (point-max))&#xA;         (while (re-search-backward (car x) nil t)&#xA;           (replace-match (cdr x) nil t)))&#xA;       prettify-symbols-alist)&#xA;      (widen))))&#xA;&#xA;(add-hook 'org-export-before-parsing-hook 'ess/org-pretty-symbols-to-html)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastActivityDate="2017-02-03T08:17:18.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30416" PostTypeId="2" ParentId="30397" CreationDate="2017-02-03T12:28:53.520" Score="5" Body="&lt;p&gt;You should remove &lt;code&gt;:defer f&lt;/code&gt;, because you don't want &lt;code&gt;exec-path-from-shell&lt;/code&gt; to be defer loaded and you are going to use function from it when Emacs starts. Try something like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package exec-path-from-shell&#xA;  :ensure t&#xA;  :if (memq window-system '(mac ns x))&#xA;  :config&#xA;  (setq exec-path-from-shell-variables '(&quot;PATH&quot; &quot;GOPATH&quot;))&#xA;  (exec-path-from-shell-initialize))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(I don't know why you need to set &lt;code&gt;SHELL&lt;/code&gt;, Emacs sets it automatically and correctly for me, like &lt;code&gt;HOME&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not sure if you are using &lt;code&gt;use-package&lt;/code&gt; correctly, expand it via something like &lt;code&gt;emacs-lisp-macroexpand&lt;/code&gt; and check the result.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-02-03T12:28:53.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30417" PostTypeId="1" AcceptedAnswerId="43756" CreationDate="2017-02-03T12:35:34.867" Score="5" ViewCount="193" Body="&lt;p&gt;I try to globally set header properties for &lt;code&gt;C++&lt;/code&gt; source examples, with no success. I would have expected that the following works&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt; #+PROPERTY: header-args:C++ :var x=1.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What did work is using general header args property:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt; #+PROPERTY: header-args :var x=1.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also specific property drawer worked:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;* Resources&#xA;:PROPERTIES:&#xA;:header-args:C++: :var x=1.2&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And of course using plain old header arguments works:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-org prettyprint-override&quot;&gt;&lt;code&gt;#+header: :exports results&#xA;#+header: :includes &amp;lt;iostream&amp;gt;&#xA;#+header: :var x=1.3&#xA;#+begin_src C++&#xA;std::cout &amp;lt;&amp;lt; x;&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could that be a bug or am I doing something wrong?&lt;/p&gt;&#xA;" OwnerUserId="10578" LastEditorUserId="10578" LastEditDate="2018-07-24T05:18:00.327" LastActivityDate="2021-09-09T06:22:09.750" Title="Globally set C++ source block header arguments" Tags="|org-mode|c++|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30418" PostTypeId="1" CreationDate="2017-02-03T13:37:27.257" Score="2" ViewCount="332" Body="&lt;p&gt;I recently upgraded to Emacs 25.1.2, and &lt;code&gt;transient-mark-mode&lt;/code&gt; no longer works properly - &lt;em&gt;sometimes&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behavior I see is that pressing &lt;code&gt;C-spc&lt;/code&gt; and moving the cursor to select an area of text doesn't automatically highlight the area. If I move to another window and return, or switch to a different window and come back, I see the selection highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also see the section highlighted if the cursor comes across a parenthesis. Since I have show-paren-mode turned on, the parens get highlighted, and the selection also gets highlighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's suddenly working as expected as I type this, but it wasn't working for the past couple of days, in spite of restarts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I debug what might be happening?&lt;/p&gt;&#xA;" OwnerUserId="14724" LastEditorUserId="14724" LastEditDate="2017-02-03T16:36:42.723" LastActivityDate="2017-09-10T09:39:06.470" Title="transient-mark-mode highlighting doesn't work until buffer display is refreshed" Tags="|highlighting|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30419" PostTypeId="1" CreationDate="2017-02-03T14:40:05.913" Score="0" ViewCount="199" Body="&lt;p&gt;&lt;br&gt;&#xA;I use this plugin relative-line-numbers of Fanael on Github.&#xA;how to add extra spaces on the both sides of the relative number sides?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Form this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rmldi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rmldi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d8trG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d8trG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14791" LastActivityDate="2017-02-04T19:02:42.027" Title="How can I change the format of relative numbers?" Tags="|line-numbers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30420" PostTypeId="1" AcceptedAnswerId="30444" CreationDate="2017-02-03T14:55:29.580" Score="6" ViewCount="3297" Body="&lt;p&gt;When I maximize the Emacs frame, it uses the full width of the screen, no background showing. But if I e.g. snap-to-edge (in XFCE), it shows a little &quot;margin&quot; of background outside the frame. And if I drag to resize, it always over- or undershoots the edge – it looks like it wants to always resize by whole lines/characters. Is there a way to have a 50% size Emacs frame that aligns with the edge of the screen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm using 20170203:93058-ce88155-emacs-25.1~ubuntu16.04.1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mousepad can take exactly 50% width and 100%height, with height from the top of the screen down to the panel:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ZYaE0.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZYaE0.png&quot; alt=&quot;mousepad can take exactly 50% width and 100%height&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs seems to overshoot/undershoot:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/YXy4V.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YXy4V.png&quot; alt=&quot;emacs overshoots&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Adn1x.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Adn1x.png&quot; alt=&quot;emacs overshoots on the right too&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I &quot;snap&quot; Emacs to the edges with XFCE, it fits the width on my laptop, but not on my external monitor. It never matches the full height.&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="730" LastEditDate="2017-02-04T08:06:25.577" LastActivityDate="2020-05-04T05:26:51.953" Title="resize Emacs (GUI) window to exactly half the screen?" Tags="|frames|gui|" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30421" PostTypeId="1" AcceptedAnswerId="30427" CreationDate="2017-02-03T16:36:34.413" Score="6" ViewCount="652" Body="&lt;p&gt;I am using AUCTeX to edit Latex files and use the &lt;code&gt;minted&lt;/code&gt; package to highlight source-code within documents. Unfortunately the character &lt;code&gt;$&lt;/code&gt; is still recognized as a delimiter for a math-mode even though it is located within a minted-block and should have no special meaning whatsoever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8KRCl.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8KRCl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This totally breaks syntax-highlighting and makes emacs think I am editing in math-mode although I am not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to configure AUCTex in such a way as to give characters within a minted environment no special meaning? Or do I have to apply some sort of quoting to &lt;code&gt;$&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="8472" LastActivityDate="2024-04-01T10:20:52.150" Title="Don't switch to math-mode when entering `$` in a `minted` environment" Tags="|latex|auctex|syntax-highlighting|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30422" PostTypeId="1" AcceptedAnswerId="30445" CreationDate="2017-02-03T16:54:13.110" Score="3" ViewCount="808" Body="&lt;p&gt;I want to install org-mode from Github repository and override that from ELPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My emacs configuration runs from an org-file, these are the lines relevant to package management and org-mode load path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;    (require 'package)&#xA;    (package-initialize)                    &#xA;    (setq load-path (cons &quot;~/.emacs.d/org-mode/lisp/&quot; load-path))&#xA;    (setq load-path (cons &quot;~/.emacs.d/org-mode/contrib/lisp/&quot; load-path))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I installed org-mode version 9.0.4 from Github repo with these lines of bash code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd ~/.emacs.d/&#xA;git clone git://orgmode.org/org-mode.git&#xA;make autoloads&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I deleted the &lt;code&gt;org&lt;/code&gt; mode from ELPA folder inside &lt;code&gt;.emacs.d&lt;/code&gt;. &#xA;When I fire up emacs I get this error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading `~/.emacs.d/init.el':&#xA;&#xA;Symbol's function definition is void: org-define-error&#xA;&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with&#xA;the `--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I missing here? Your help would be much appreciated. Any suggestions to improve my Emacs setup file are also welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&#xA;whey I hit &lt;code&gt;M-x org-version&lt;/code&gt; it takes the version info from another location which is &lt;code&gt;/usr/share/emacs/24.5/lisp/org/&lt;/code&gt;. What I want to achieve that emacs run org-mode from the new cloned location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs-version: GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian&lt;/li&gt;&#xA;&lt;li&gt;Org-version: Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/24.5/lisp/org/)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2017-02-04T09:14:54.783" LastActivityDate="2017-02-04T19:24:06.217" Title="Help me install the development version of org-mode from Github repo" Tags="|org-mode|init-file|load-path|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30423" PostTypeId="1" CreationDate="2017-02-03T17:10:08.517" Score="2" ViewCount="506" Body="&lt;p&gt;What's the best source of emacs release notes - especially for reading prior to installing an update?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I searched Google for &quot;emacs release notes&quot;. There are some posts about specific releases (and some, &lt;a href=&quot;https://www.masteringemacs.org/article/whats-new-in-emacs-25-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;like this about Emacs 25.1&lt;/a&gt;, are really good), but no definitive source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's another question on this site which discusses &lt;a href=&quot;https://emacs.stackexchange.com/questions/2173/what-are-the-major-features-planned-for-gnu-emacs-25&quot;&gt;what's new in Emacs 25&lt;/a&gt;. The answers and comments there point to some source locations - are those generalizable?&lt;/p&gt;&#xA;" OwnerUserId="11315" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2023-09-10T21:09:27.323" Title="Finding emacs release notes" Tags="|help|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30424" PostTypeId="2" ParentId="30423" CreationDate="2017-02-03T17:10:08.517" Score="3" Body="&lt;p&gt;The Emacs NEWS file is the &quot;history of user-visible changes.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The NEWS file on the emacs master git branch shows the latest in development &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS&lt;/a&gt;. As of this writing, it shows features planned for Emacs 26.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need release notes for an earlier version, browse the &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/&quot; rel=&quot;nofollow noreferrer&quot;&gt;etc&lt;/a&gt; directory for files like &lt;code&gt;NEWS.25&lt;/code&gt;, &lt;code&gt;NEWS.24&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, browse starting at the &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/&quot; rel=&quot;nofollow noreferrer&quot;&gt;top of the repository&lt;/a&gt;, click on one branch (e.g. &lt;code&gt;emacs-25&lt;/code&gt; and navigate to &lt;code&gt;etc/NEWS&lt;/code&gt; to see the news of that branch.&lt;/p&gt;&#xA;" OwnerUserId="11315" LastActivityDate="2017-02-03T17:10:08.517" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30425" PostTypeId="2" ParentId="28645" CreationDate="2017-02-03T18:03:14.570" Score="1" Body="&lt;p&gt;Upgraded my mobaXterm ( from release 7 to 9.4 ) and this also fixed the &quot;12;rgb:0000/0000/0000&quot; problem for me. &lt;/p&gt;&#xA;" OwnerUserId="14794" LastActivityDate="2017-02-03T18:03:14.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30426" PostTypeId="1" CreationDate="2017-02-03T18:03:37.767" Score="4" ViewCount="1225" Body="&lt;p&gt;Every time I publish html files in org-mode, I clutter up my directory with them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to automatically export html files to a specific directory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried this solution: &lt;a href=&quot;https://stackoverflow.com/questions/9559753/emacs-org-mode-export-to-another-directory#9560534&quot;&gt;https://stackoverflow.com/questions/9559753/emacs-org-mode-export-to-another-directory#9560534&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there is no &lt;code&gt;org-export-publishing-directory&lt;/code&gt; in my emacs. I'm not sure why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;" OwnerUserId="14743" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2023-08-22T16:20:31.860" Title="Automatically org-export-html to a specific directory" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30427" PostTypeId="2" ParentId="30421" CreationDate="2017-02-03T18:39:21.887" Score="5" Body="&lt;p&gt;You can add minted environments to the latex-verbatim-environment variable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x customize-variable latex-verbatim-environments&lt;/code&gt;, insert a new string &quot;minted&quot;, and save your changes. You may need to reload your .tex file for the changes to take effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After doing this, &lt;code&gt;minted&lt;/code&gt; environments will not be fontified at all, so it won't matter if you include &lt;code&gt;$&lt;/code&gt; symbols.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-03T18:39:21.887" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30428" PostTypeId="2" ParentId="27742" CreationDate="2017-02-03T19:47:57.230" Score="0" Body="&lt;p&gt;Okay, so I've come up with a couple of hacky fixes for these problems and have been able to sufficiently enable auto-completion with &lt;code&gt;auto-complete-mode&lt;/code&gt; via said fixes. I managed to get &lt;code&gt;web-mode&lt;/code&gt; completion working by adjusting my configuration to be in accordance with &lt;a href=&quot;http://web-mode.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;the code from their website for setting up auto-completion&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun setup-ac-for-web-mode ()&#xA;       (setq web-mode-ac-sources-alist&#xA;             '((&quot;css&quot;  . (ac-source-css-property))&#xA;               (&quot;html&quot; . (ac-source-words-in-buffer ac-source-abbrev)))))&#xA;    ...&#xA;    (add-to-list 'ac-modes 'web-mode)&#xA;    ...&#xA;    (add-hook 'web-mode-before-auto-complete-hooks 'setup-ac-for-web-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Mind you this new setup for &lt;code&gt;web-mode&lt;/code&gt; is no longer using &lt;code&gt;ac-html&lt;/code&gt;, but it seems that &lt;code&gt;web-mode&lt;/code&gt; has provided their own &lt;code&gt;auto-complete&lt;/code&gt; sources, which work well enough for me. The next fix that I've made enables &lt;code&gt;ac-html&lt;/code&gt;to work for &lt;code&gt;html-mode&lt;/code&gt; itself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'html-mode-hook&#xA;          #'(lambda ()&#xA;              (run-with-idle-timer 0.1 nil (lambda () (progn&#xA;                                                        (auto-complete-mode 1)&#xA;                                                        (auto-complete-mode -1)&#xA;                                                        (auto-complete-mode 1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, it's quite crude and all that it does is automate the process of turning &lt;code&gt;auto-complete-mode&lt;/code&gt; on, off, and on again shortly after &lt;code&gt;html-mode&lt;/code&gt; is initially invoked in a given buffer. I'm not sure why that works, but it does and now I have auto-completion for &lt;code&gt;html-mode&lt;/code&gt; as well as &lt;code&gt;web-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10761" LastEditorUserId="10761" LastEditDate="2017-04-26T22:51:17.093" LastActivityDate="2017-04-26T22:51:17.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30430" PostTypeId="2" ParentId="30421" CreationDate="2017-02-03T20:46:44.467" Score="4" Body="&lt;p&gt;I'd like to give an answer which is complementary to the one given by @Tyler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd recommend that you set this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-parse-self t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;restart your Emacs and open your .tex file again.  The difference is that AUCTeX provides a support file &lt;code&gt;minted.el&lt;/code&gt; for &lt;code&gt;minted&lt;/code&gt; package which does a lot more besides fixing the fontification in environments and macros provided by &lt;code&gt;minted&lt;/code&gt; package.  You can hit &lt;kbd&gt;C-c C-e minted RET&lt;/kbd&gt; and will be asked for optional argument and the language for your code; both with auto-completion.  Your .tex file could look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-tex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\usepackage[newfloat]{minted}&#xA;&#xA;\begin{document}&#xA;&#xA;\begin{minted}{bash}&#xA;$ echo &quot;Hello&quot;&#xA;$ echo World&#xA;\end{minted}&#xA;&#xA;\begin{Minted}&#xA;  $ echo &quot;Hello&quot;&#xA;  $ echo World&#xA;\end{Minted}&#xA;&#xA;\end{document}&#xA;&#xA;%%% Local Variables:&#xA;%%% mode: latex&#xA;%%% TeX-master: t&#xA;%%% TeX-command-extra-options: &quot;-shell-escape&quot;&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;Minted&lt;/code&gt; is just an arbitrary environment to show the difference that code will be indented with 2 spaces where spaces are significant.  Here a screenshot for the fontification:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AXtXv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AXtXv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%% TeX-command-extra-options: &quot;-shell-escape&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;allows you to use &lt;kbd&gt;C-c C-a&lt;/kbd&gt; in Emacs and your file gets compiled correctly with &lt;code&gt;minted&lt;/code&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="12242" LastEditorUserId="12242" LastEditDate="2017-02-04T09:46:36.170" LastActivityDate="2017-02-04T09:46:36.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30432" PostTypeId="1" CreationDate="2017-02-03T21:11:10.133" Score="3" ViewCount="517" Body="&lt;p&gt;I am trying to select the content of @media in CSS with regexp in Emacs (elisp) to make a slight change in the color of the background or font, so I can easily see that I am editing inside of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already came up with this regexp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@media.*\{\\(.*[^]]*?\}\\)[ \t\n]*\}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this is selecting the content most of the times, but I'm having a problem when I have comments or leading spaces after the last bracket before the closing bracket of the @media statement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to match just the content inside every @media query brackets. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/*... css above*/&#xA;/*tablet*/&#xA;@media (max-width: 800px){&#xA;    ._desktop-only {display:none !important;}&#xA;    ._tablet-only {display:initial;}&#xA;    ._mobile-only {display:none;}&#xA;}&#xA;/*mobile*/&#xA;@media (max-width: 480px){&#xA;     ._desktop-only {display:none;}&#xA;     ._tablet-only {display:none !important;}&#xA;     ._mobile-only {display:initial;} /* comment */&#xA;}&#xA;/*more css below...*/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some people might suggest that I should create separated files. I usually do that, but sometimes I have to edit the files as they are. And don't mind much the sample, because my goal is to edit large CSS files with a lot of statements inside of them, and I want to be able to see if I am editing the main statements or the variation of them.&lt;/p&gt;&#xA;" OwnerUserId="9644" LastEditorUserId="9644" LastEditDate="2017-02-04T06:19:48.653" LastActivityDate="2018-06-24T15:13:23.667" Title="How can I select only the content of a @media in CSS with regexp in Emacs?" Tags="|regular-expressions|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30434" PostTypeId="1" AcceptedAnswerId="30443" CreationDate="2017-02-03T21:58:47.890" Score="2" ViewCount="1069" Body="&lt;p&gt;Any quick way to export an org-mode document into a text file with no formatting and no org markup characters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of &lt;code&gt;C-c C-e&lt;/code&gt; &lt;code&gt;[t] Export to Plain Text&lt;/code&gt; unfortunatly those options add formatting to the document&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Header 1&#xA;═══════════════════════════════════&#xA;&#xA;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do &#xA;eiusmod tempor incididunt ut labore et dolore magna aliqua. &#xA;&#xA;&#xA;&#xA;Header2&#xA;────────────────────────────────────────&#xA;&#xA;  ┌────&#xA;  │ code block&#xA;  └────&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The format I'm looking for is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Header 1&#xA;&#xA;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do &#xA;eiusmod tempor incididunt ut labore et dolore magna aliqua.&#xA;&#xA;Header 2&#xA;&#xA;code block&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12732" LastEditorUserId="12732" LastEditDate="2017-02-03T22:48:44.673" LastActivityDate="2017-02-04T08:01:16.160" Title="org-mode how to export raw text no formatting?" Tags="|org-mode|org-export|text|utf-8|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30435" PostTypeId="2" ParentId="30420" CreationDate="2017-02-03T22:47:34.373" Score="2" Body="&lt;p&gt;Here is an example using some of the functions mentioned in the comment and link underneath the original question hereinabove:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let ((frame (selected-frame))&#xA;      (one-half-display-pixel-width (/ (display-pixel-width) 2)))&#xA;  (set-frame-width frame one-half-display-pixel-width nil 'pixelwise)&#xA;  (set-frame-position frame 0 0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FYI&lt;/strong&gt;:  Feature request #21415 was incorporated into Emacs 25 -- frame creation may now include a pixel specification -- this includes items such as the &lt;code&gt;initial-frame-alist&lt;/code&gt;, &lt;code&gt;default-frame-alist&lt;/code&gt;, and the &lt;code&gt;make-frame&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of usage for the &lt;code&gt;width&lt;/code&gt; parameter:  &lt;code&gt;'(width . (text-pixels . 1900))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of usage for the &lt;code&gt;height&lt;/code&gt; parameter:  &lt;code&gt;'(height . (text-pixels . 1054))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-02-03T23:49:03.060" LastActivityDate="2017-02-03T23:49:03.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30436" PostTypeId="2" ParentId="27605" CreationDate="2017-02-03T22:55:06.063" Score="1" Body="&lt;p&gt;This is &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24637&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bug#24637&lt;/a&gt;, as explained there, the problem is due to a bug in old versions of Texinfo.  It should be solved by upgrading to version 4.13 or higher.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would upgrade but it sounds like I'd have to force link it&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't exactly know what &quot;force link&quot; means, but you should be able to do &lt;code&gt;./configure MAKEINFO=/path/to/new/makeinfo&lt;/code&gt; when building emacs without having to override makeinfo in other contexts.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-02-03T22:55:06.063" CommentCount="0" CommunityOwnedDate="2017-02-03T22:55:06.063" ContentLicense="CC BY-SA 3.0" />
  <row Id="30437" PostTypeId="1" AcceptedAnswerId="34770" CreationDate="2017-02-03T22:55:36.803" Score="3" ViewCount="1196" Body="&lt;p&gt;I am trying to quickly search and replace in multiple files using dired. The steps I follow are from this &lt;a href=&quot;https://stackoverflow.com/questions/270930/using-emacs-to-recursively-find-and-replace-in-text-files-not-already-open/271136#271136&quot;&gt;question&lt;/a&gt; (Chris Conway's and Frank Henard's answers), I am pretty sure the instructions are correct since it seems like I am the only person having this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simplify the problem, the steps I am doing are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Open a folder in dired&lt;/li&gt;&#xA;&lt;li&gt;Mark a file with &lt;strong&gt;&lt;code&gt;m&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;Q&lt;/code&gt;&lt;/strong&gt; to search and replace in the marked file, this command will ask for two arguments, in the search query argument I type &lt;strong&gt;&lt;code&gt;div&lt;/code&gt;&lt;/strong&gt;, and in the replacement query argument I type &lt;strong&gt;&lt;code&gt;foo&lt;/code&gt;&lt;/strong&gt; (to replace div with foo).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After I do these simple steps, the search throws no results, the buffer says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;No matches for: div&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I know plenty divs are spreaded all over the file. Perhaps I am not entering the arguments in the correct format, I tryed many things, like enclosing the string in quotes or double quotes, and running emacs with the -q argument in the shell to disable my dotfile. The instructions looked pretty simple, I don't know what I am doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version: 25.1.1&lt;/p&gt;&#xA;" OwnerUserId="11856" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-08-09T14:04:30.757" Title="Dired search and replace is throwing no results" Tags="|dired|query-replace|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30438" PostTypeId="1" AcceptedAnswerId="30441" CreationDate="2017-02-03T23:52:41.020" Score="2" ViewCount="2413" Body="&lt;p&gt;I wrote this command and key binding to use with cider for Clojure development:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun reload-and-eval-in-repl ()&#xA;  &quot;Set the ns of the repl to the one in the current buffer, then eval the region of the whole buffer in the repl and switch to it.&quot;&#xA;  (interactive)&#xA;  (cider-repl-set-ns (cider-current-ns))&#xA;  (if (region-active-p)&#xA;      (cider-insert-region-in-repl (region-beginning) (region-end)))&#xA;  (cider-load-buffer-and-switch-to-repl-buffer))&#xA;&#xA;(define-key clojure-mode-map (kbd &quot;s-e&quot;) 'reolad-and-eval-in-repl)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works just as I expected if I run it like &lt;code&gt;M-x reload-and-eval-in-repl&lt;/code&gt; or I eval the expression &lt;code&gt;(reload-and-eval-in-repl)&lt;/code&gt;, but when I try to use the keybinding &lt;code&gt;s-e&lt;/code&gt; I get the error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Wrong type argument: commandp, reolad-and-eval-in-repl&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that error usually means you forgot the &lt;code&gt;(interactive)&lt;/code&gt; call, but this isn't the case, so I'm a bit lost.&lt;/p&gt;&#xA;" OwnerUserId="14798" LastActivityDate="2017-02-04T01:15:34.743" Title="command works with M-x but gives &quot;Wrong type argument: commandp&quot; when calling through key binding" Tags="|commands|cider|" AnswerCount="1" CommentCount="1" ClosedDate="2017-02-04T20:03:03.857" ContentLicense="CC BY-SA 3.0" />
  <row Id="30439" PostTypeId="1" AcceptedAnswerId="30451" CreationDate="2017-02-03T23:54:36.473" Score="3" ViewCount="937" Body="&lt;p&gt;I want to have a &lt;code&gt;log.org&lt;/code&gt; file, in my &lt;code&gt;.../Study/&lt;/code&gt; directory, which lists all the folders, files in the subdirs and hyperlink to them. In that way I can add notes about the files I read and, if I click on a link it opens the file for me outside emacs (pdf, video, etc.). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I might delete or add files in the subdirs, I want dynamic symbolic links to the updated subdirs structure inside the &lt;code&gt;org&lt;/code&gt; file (without compromising the notes taken).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to get something like that done?&lt;/p&gt;&#xA;" OwnerUserId="14744" LastEditorUserId="253" LastEditDate="2017-02-04T13:41:29.663" LastActivityDate="2017-02-04T18:30:54.090" Title="Study with Emacs org-mode" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30440" PostTypeId="2" ParentId="30439" CreationDate="2017-02-04T00:23:36.013" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;...lists all the folders and files in the sub dirs and hyperlink...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-fstree&lt;/code&gt; by Andreas Burtzlaff is a package that does this. Also has options to filter the files through options on the fstree block. See the comments in the &lt;a href=&quot;https://github.com/emacsmirror/org-fstree/blob/master/org-fstree.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-fstree.el&lt;/a&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An easier way might be to just have one link:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:/home/username/Study&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the org file; then click on it to open files and sub folders. This way you solved the update/refresh problem as well. With Org-fstree, you'll have to remember to &lt;code&gt;C-c C-c&lt;/code&gt; to refresh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addendum:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;does org-fstree list the files in the log.org document? the idea is to keep adding notes under each file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, it only provides &lt;a href=&quot;http://orgmode.org/manual/External-links.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;external links&lt;/a&gt; to the files that when clicked open in new buffers. To keep the contents of external files in one master file for editing, then use org mode's &lt;a href=&quot;http://orgmode.org/manual/Extracting-source-code.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;tangle feature&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-04T14:29:40.237" LastActivityDate="2017-02-04T14:29:40.237" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30441" PostTypeId="2" ParentId="30438" CreationDate="2017-02-04T01:15:34.743" Score="3" Body="&lt;p&gt;You have bound an imaginary command: &lt;code&gt;reolad-and-eval-in-repl&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your command is named &lt;code&gt;reload-and-eval-in-repl&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-04T01:15:34.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30442" PostTypeId="2" ParentId="18722" CreationDate="2017-02-04T01:58:36.017" Score="0" Body="&lt;p&gt;This isn't exactly an answer, but it kind of is. I just don't have rep to comment other wise I would.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens to me as well, except I do not use xmonad, I use i3wm, but it goes away if I have the chromium window tiled with another window on the same screen. I also experience this with steam/steam games.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running htop reveals no process utilizing large amounts of CPU. I speculate that the problem is in an thread that typically &quot;waits&quot; synchronously rather than asynchronously somewhere in Emacs.&lt;/p&gt;&#xA;" OwnerUserId="14796" LastActivityDate="2017-02-04T01:58:36.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30443" PostTypeId="2" ParentId="30434" CreationDate="2017-02-04T08:01:16.160" Score="3" Body="&lt;p&gt;You could try &lt;a href=&quot;http://pandoc.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandoc&lt;/a&gt;, e.g. with &lt;a href=&quot;https://github.com/kawabata/ox-pandoc&quot; rel=&quot;nofollow noreferrer&quot;&gt;ox-pandoc&lt;/a&gt;.  The command line would be like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pandoc -t plain -o outfile.txt YOUR_ORG_FILE.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;HEADER 1&#xA;&#xA;&#xA;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod&#xA;tempor incididunt ut labore et dolore magna aliqua.&#xA;&#xA;&#xA;Header 2&#xA;&#xA;    code block&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8987" LastActivityDate="2017-02-04T08:01:16.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30444" PostTypeId="2" ParentId="30420" CreationDate="2017-02-04T08:25:12.940" Score="6" Body="&lt;p&gt;Reading &lt;code&gt;C-h f set-frame-width&lt;/code&gt; as &lt;a href=&quot;https://emacs.stackexchange.com/a/30435/730&quot;&gt;mentioned&lt;/a&gt; by user @lawlist, I saw a mention of &lt;code&gt;frame-resize-pixelwise&lt;/code&gt;. Putting this in .emacs.d/init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq frame-resize-pixelwise t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;makes the window &quot;snap&quot; to the right height in XFCE (haven't tried on my external monitor yet, so don't know if it gets the exact right width too); it also snaps to the right height when I set the height with &lt;a href=&quot;https://gist.github.com/unhammer/975e062eafda946be99c&quot; rel=&quot;noreferrer&quot;&gt;my wmctrl scripts&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-02-04T08:25:12.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30445" PostTypeId="2" ParentId="30422" CreationDate="2017-02-04T09:36:12.200" Score="3" Body="&lt;p&gt;I had a similar problem with my installation, but I'm using the command &lt;code&gt;org-babel-load-file&lt;/code&gt; to load an &lt;code&gt;org&lt;/code&gt; file as &lt;code&gt;init&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I believe it was causing the problem (might not be it) is that &lt;code&gt;org&lt;/code&gt; was not initialized when I need it to compile the pointed &lt;code&gt;org&lt;/code&gt; file. Therefore, I called it! &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;My Configuration&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is my init.el localed on .emacs.d/&#xA;(require 'package)&#xA;(package-initialize)&#xA;(require 'org)&#xA;(org-babel-load-file &quot;~/.emacs.d/configuration.org&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Right after that, I call the repositories&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is my configuration.org located on .emacs.d/&#xA;(add-to-list 'package-archives&#xA;         '(&quot;melpa&quot; . &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;(add-to-list 'package-archives &#xA;             '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t)&#xA;&#xA;;; After this line all your configurations&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that I use the &lt;code&gt;org&lt;/code&gt; repository, instead of a local &lt;em&gt;github&lt;/em&gt;. &lt;strong&gt;Important:&lt;/strong&gt; At this point I haven't installed any &lt;code&gt;org&lt;/code&gt; version, but the built-in.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Installing the updated version&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now is the time to start your &lt;code&gt;emacs&lt;/code&gt;. If everything goes OK: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Run the command &lt;code&gt;M-x list-packages&lt;/code&gt;. Wait for the list to appear.&lt;/li&gt;&#xA;&lt;li&gt;Search for &lt;code&gt;org&lt;/code&gt; and &lt;code&gt;org-plus-contrib&lt;/code&gt;; both from the &lt;code&gt;org&lt;/code&gt; repository.&lt;/li&gt;&#xA;&lt;li&gt;Mark the two packages to install them. Use the letter &lt;code&gt;i&lt;/code&gt; to mark them.&lt;/li&gt;&#xA;&lt;li&gt;(opt) sellect any other package you want to install.&lt;/li&gt;&#xA;&lt;li&gt;Execute the actions you marked, using the letter &lt;code&gt;x&lt;/code&gt;. Wait for the process to finish.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Finally, resetart your &lt;code&gt;emacs&lt;/code&gt; session.&lt;/p&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="2441" LastEditDate="2017-02-04T19:24:06.217" LastActivityDate="2017-02-04T19:24:06.217" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30446" PostTypeId="1" CreationDate="2017-02-04T09:56:44.943" Score="2" ViewCount="108" Body="&lt;p&gt;I am trying to get auctex on emacs to preview formulas but it doesnt seem to work and when I click preview, it produces the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PDF2DSC sentinel: Wrong type argument: arrayp, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have emacs, auctex and ghostscript installed on a windows 10 machine. Any help would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="14801" LastEditorUserId="9995" LastEditDate="2017-02-04T16:21:27.130" LastActivityDate="2017-02-04T16:21:27.130" Title="auctex failing to render formula previews" Tags="|latex|auctex|preview-latex|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30448" PostTypeId="1" AcceptedAnswerId="30449" CreationDate="2017-02-04T17:33:29.953" Score="6" ViewCount="688" Body="&lt;p&gt;At the last weekday of the month I want to be reminded to prepare&#xA;invoice/expenses so I get them filed by the first. It's no use just&#xA;getting reminded on the last day of the month, if this is a Saturday&#xA;or Sunday. Nor do I want to be reminded several days before the end&#xA;of the month, so using &lt;code&gt;diary-float&lt;/code&gt; is not applicable.&lt;/p&gt;&#xA;" OwnerUserId="10625" LastActivityDate="2017-02-04T17:44:40.030" Title="How to create calendar entry for last weekday of every month?" Tags="|calendar|diary|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30449" PostTypeId="2" ParentId="30448" CreationDate="2017-02-04T17:33:29.953" Score="5" Body="&lt;p&gt;Answering myself, I came up with this. I created a function to&#xA;detect whether a given date is the last weekday of the month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's two main cases: if it's the last day of the month &lt;strong&gt;and&lt;/strong&gt;&#xA;it's a weekday, then obviously it's the last weekday of the month.&#xA;Otherwise, the last weekday of the month &lt;strong&gt;must&lt;/strong&gt; be a Friday, and it&#xA;will be either the last-but-one or last-but-two day of the month.&#xA;This logic can be easily expressed in emacs-lisp (put it in your&#xA;&lt;code&gt;~/.emacs&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun last-weekday-of-month-p (date)&#xA;  (let* ((day-of-week (calendar-day-of-week date))&#xA;         (month (calendar-extract-month date))&#xA;         (year (calendar-extract-year date))&#xA;         (last-month-day (calendar-last-day-of-month month year))&#xA;         (month-day (cadr date)))&#xA;&#xA;    (or&#xA;     ;; it's the last day of the month &amp;amp; it is a weekday&#xA;     (and (eq month-day last-month-day)&#xA;          (memq day-of-week '(1 2 3 4 5)))&#xA;&#xA;     ;; it's a friday, and it's the last-but-one or last-but-two day&#xA;     ;; of the month&#xA;     (and (eq day-of-week 5)&#xA;          (or (eq month-day (1- last-month-day))&#xA;              (eq month-day (1- (1- last-month-day))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can then be used from my Diary file like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%(last-weekday-of-month-p date) File Invoice&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10625" LastEditorUserId="10625" LastEditDate="2017-02-04T17:44:40.030" LastActivityDate="2017-02-04T17:44:40.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30450" PostTypeId="1" CreationDate="2017-02-04T18:30:08.543" Score="3" ViewCount="311" Body="&lt;p&gt;I'm building my composite agenda view in org-mode. I want to exclude some entries shown in the lower block from the upper block since they are redundant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf org-agenda-custom-commands&#xA;        '((&quot;a&quot; &quot;Agenda&quot;&#xA;           ((tags &quot;PRIORITY=\&quot;A\&quot;&quot;&#xA;                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))&#xA;                   (org-agenda-overriding-header &quot;Tareas de alta prioridad por terminar:&quot;)))&#xA;            (agenda &quot;&quot;&#xA;                    ((org-agenda-span 'day)&#xA;                     (tags-todo &quot;-cumpleaños|-aniversario|-santoral&quot;)&#xA;                     (org-agenda-overriding-header &quot;Para hoy:&quot;)))&#xA;            (agenda &quot;&quot;&#xA;                    ((org-agenda-span 'week)&#xA;                     (tags-todo &quot;-cita|-evento&quot;)&#xA;                     (org-agenda-files '(&quot;~/org/fechas.org&quot;))&#xA;                     (org-agenda-overriding-header &quot;Cumpleaños, aniversarios y santoral:&quot;)))&#xA;            (alltodo &quot;&quot;&#xA;                     ((org-agenda-skip-function&#xA;                       '(or (air-org-skip-subtree-if-habit)&#xA;                           (air-org-skip-subtree-if-priority ?A)&#xA;                           (org-agenda-skip-if nil '(scheduled deadline))))&#xA;                      (org-agenda-overriding-header &quot;Todas las tareas de prioridad normal:&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this is how it looks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tareas de alta prioridad por terminar:&#xA;&#xA;=========================================================================================================================================================&#xA;Para hoy:&#xA;Saturday    4 February 2017&#xA;  cosas por hacer:Sched. 8x:  POR-HACER Revisar el backlog          :repetitivo:&#xA;  fechas:     Scheduled:  POR-HACER Prueba de evento                    :evento:&#xA;  fechas:     Scheduled:  POR-HACER cumpleaños de prueba            :cumpleaños:&#xA;  cosas por hacer:66 d. ago:  POR-HACER Pagar deuda con Kolbi por factura atrazada :factura:&#xA;&#xA;=========================================================================================================================================================&#xA;Cumpleaños, aniversarios y santoral:&#xA;Monday     30 January 2017 W05&#xA;Tuesday    31 January 2017&#xA;Wednesday   1 February 2017&#xA;Thursday    2 February 2017&#xA;Friday      3 February 2017&#xA;Saturday    4 February 2017&#xA;  fechas:     Scheduled:  POR-HACER Prueba de evento                    :evento:&#xA;  fechas:     Scheduled:  POR-HACER cumpleaños de prueba            :cumpleaños:&#xA;Sunday      5 February 2017&#xA;&#xA;=========================================================================================================================================================&#xA;Todas las tareas de prioridad normal:&#xA;  cosas por hacer:POR-HACER Comprar alguno de estos 3 cursos sobre freelancing en Udemy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Somehow I cannot filter things tagged as &lt;code&gt;evento&lt;/code&gt; from the block called &lt;code&gt;Cumpleaños, aniversarios y santoral:&lt;/code&gt; and the same for things tagged &lt;code&gt;cumpleaños&lt;/code&gt; from the &lt;code&gt;Para hoy:&lt;/code&gt; block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Also, is there a way to hide empty days in a week?&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="11315" LastEditDate="2023-02-02T21:42:20.793" LastActivityDate="2024-02-28T01:07:11.027" Title="How to exclude several tags from view blocks?" Tags="|org-mode|org-agenda|org-tags|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30451" PostTypeId="2" ParentId="30439" CreationDate="2017-02-04T18:30:54.090" Score="5" Body="&lt;p&gt;Org is designed to let you create notes that are associated with some context. In the ideal case the context is something that you can visit in Emacs directly, but you can define other kinds of links. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you are reading a text file in Emacs and want to create a note, the command &lt;code&gt;org-store-link&lt;/code&gt; can be used to capture a link to your current place in the file and then you can create a corresponding note in your org file that includes the link. Later when reviewing your notes you might use &lt;code&gt;org-open-at-point&lt;/code&gt; on the link to jump to the text associated with the note. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My point here is that creating and maintaining an up-to-date representation of an entire file system tree may not be necessary. Your use case sounds like a common org use case where you want a &quot;my study notes&quot; org file where each time you add a new note you want to include a link to some source file. I would suggest looking at the &lt;code&gt;org-capture&lt;/code&gt; and org's &lt;a href=&quot;http://orgmode.org/manual/External-links.html#External-links&quot;&gt;external link support&lt;/a&gt;. This has the added benefit that you can rearrange and sort your notes in to some meaningful hierarchy that may not be the same as the file system hierarchy of your external resources, or that may include links to web resources etc. that are outside your file system tree.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-02-04T18:30:54.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30452" PostTypeId="2" ParentId="30419" CreationDate="2017-02-04T19:02:42.027" Score="1" Body="&lt;p&gt;From the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;relative-line-numbers-format&lt;/strong&gt; is a variable defined in&#xA;  &lt;strong&gt;‘relative-line-numbers.el’&lt;/strong&gt;. Its value is&#xA;  &lt;strong&gt;relative-line-numbers-default-format&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;br&gt;&#xA;  The function used to format the line numbers. The function should take&#xA;  one integer argument: the line’s distance, in lines, from the current&#xA;  line, and return a string.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You will have first to define somewhere in your configuration file, a function to use for formatting, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-relative-line-numbers-default-format (offset)&#xA;  &quot;The default formatting function.                                                                                        &#xA;Return the absolute value of OFFSET, converted to string.&quot;&#xA;  (concat &quot; - &quot; (number-to-string (abs offset)) &quot; + &quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you will have to call &lt;code&gt;M-x customize-variable&lt;/code&gt; then type &lt;code&gt;relative-line-numbers-format&lt;/code&gt;. You'll be shown a window inside with you can change the name of the function used for formatting, use your custom function defined above. Then you'll have to apply and save.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2017-02-04T19:02:42.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30454" PostTypeId="1" AcceptedAnswerId="30475" CreationDate="2017-02-05T01:44:35.920" Score="11" ViewCount="2122" Body="&lt;p&gt;I know that if I set:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq confirm-kill-emacs 'y-or-n-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs prompts me before I &lt;em&gt;kill&lt;/em&gt; it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I want emacs to prompt me before I close my last gui frame (prompting me before killing &lt;em&gt;any&lt;/em&gt; frame would be very helpful already). When you run &#xA;emacs in daemon-mode, closing the last gui frame does not kill emacs and thus the aforementioned setting does not work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that sometimes I overpress my keybind to quit emacs windows (&lt;code&gt;evil-quit&lt;/code&gt;) and I endup quiting also my current gui frame, which is annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that before deleting the frame, emacs runs the functions that are listed in the variable &lt;code&gt;delete-frame-functions&lt;/code&gt;, so I thought I could include a function there that would prompt me to query if I really wanted to kill the frame. But it is not clear from the documentation what I would have to do inside that function to stop the process of killing the frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another idea would be to add an advice to evil-quit, like: if daemon-p is &lt;code&gt;t&lt;/code&gt; then evil-quit have to prompt me to quit my current frame. Something like that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run GUI emacs from both OSx and GNU/Linux.&lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="101" LastEditDate="2017-02-05T23:12:31.327" LastActivityDate="2017-02-07T16:51:07.840" Title="how to make emacs prompt me before closing the last emacs gui frame when running emacs as a daemon?" Tags="|frames|emacs-daemon|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30455" PostTypeId="1" CreationDate="2017-02-05T08:50:59.540" Score="2" ViewCount="759" Body="&lt;p&gt;I've been reading various tutorials on alist/plist access but can't figure this out. Let's say i have this file, &lt;code&gt;test.txt&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;oranges 1&#xA;apples 2&#xA;grapes 3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to iterate this file line by line, and push it's elements as pairs into a plist or alist. So later when requesting &quot;2&quot; from that plist, I get apples etc. I was thinking something in the line of this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun testRead ()&#xA;(interactive)&#xA; (setq myList&#xA;    (split-string&#xA;     (with-temp-buffer&#xA;       (insert-file-contents &quot;test.txt&quot;)&#xA;       (buffer-substring-no-properties&#xA;        (point-min)&#xA;        (point-max)))&#xA;     &quot;\n&quot; t))&#xA;(dolist&#xA;  (temp myList)&#xA;  (split-string temp &quot; &quot;)&#xA;  (plist-put testlist temp)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course above does not work because the &lt;code&gt;dolist&lt;/code&gt; part is messed up. First i read the file into &lt;code&gt;myList&lt;/code&gt; and split the lines based on newline, then the idea is to iterate this &lt;code&gt;myList&lt;/code&gt; and split each element with empty space and push it into a plist. I'm pretty new in lisp and functional programming but I suspect there are more elegant and faster ways to do such thing (parse the file directly into plist) but how?&lt;/p&gt;&#xA;" OwnerUserId="14809" LastEditorUserId="105" LastEditDate="2017-02-05T15:46:18.703" LastActivityDate="2017-02-05T15:46:18.703" Title="Read file lines into plist" Tags="|association-lists|property-lists|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30456" PostTypeId="1" AcceptedAnswerId="31065" CreationDate="2017-02-05T11:00:23.223" Score="0" ViewCount="95" Body="&lt;p&gt;How to open external sourcecode files inside org-mode codeblocks, in a way that files can be viewed and saved while saving the org-mode document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kinda of a 'Nested Buffers' feature?&lt;/p&gt;&#xA;" OwnerUserId="14744" LastEditorUserId="14744" LastEditDate="2017-02-07T09:39:59.353" LastActivityDate="2017-03-30T12:06:44.420" Title="Nested Buffers - Opening external sourcecode files inside org-mode codeblocks" Tags="|org-mode|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="30457" PostTypeId="1" AcceptedAnswerId="30466" CreationDate="2017-02-05T12:40:53.953" Score="3" ViewCount="431" Body="&lt;p&gt;I am playing around with some LaTeX's DocStrip package.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For those interested: it is a LaTeX package, to create documented code, in order to write e.g. a style file and incorporate the documentation in one file.  DocStrip will Strip the Documentation and generate a clean and fast loadable Stylefile but is also able, to create an exhaustive documentation on that style file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use DocStrip you usually have two kind of files: the &lt;code&gt;.dtx&lt;/code&gt; containing both documentation and the code and a second file, which is similar to a Makefile.  Usually it has the file extension &lt;code&gt;.ins&lt;/code&gt; to be not mixed up with normal LaTeX files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to extract the style file (or any other package), you have to run LaTeX on your &quot;Makefile&quot;, that is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; latex sample.ins&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to be able, to use the normal &lt;code&gt;C-c C-c&lt;/code&gt; key, to start this compilation.  But AUCTeX is adding the extra file extension &lt;code&gt;.tex&lt;/code&gt;, so that the real call is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; pdflatex -file-line-error  --synctex=1 -interaction=nonstopmode &quot;\input&quot; sample.ins.tex''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ho do I configure Emacs/AUCTeX to run &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; pdflatex -file-line-error  --synctex=1 -interaction=nonstopmode &quot;\input&quot; sample.ins''&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already tried to define the master file to be &quot;sample.ins&quot;, but even than &lt;code&gt;.tex&lt;/code&gt; is added.&lt;/p&gt;&#xA;" OwnerUserId="14190" LastActivityDate="2017-02-05T16:50:57.583" Title="AUCTeX: how to compile a file, which does end in '.ins'" Tags="|auctex|compilation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30458" PostTypeId="1" AcceptedAnswerId="30464" CreationDate="2017-02-05T13:52:25.117" Score="2" ViewCount="932" Body="&lt;p&gt;Suppose that I have a &lt;code&gt;*shell*&lt;/code&gt; buffer (i.e. a subordinate shell, started with &lt;code&gt;M-x shell&lt;/code&gt;).  Suppose also that at this shell's prompt, I can execute some command &lt;code&gt;foo&lt;/code&gt; that sends some output to &lt;code&gt;stdout&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that, in general, I can always select the region in the &lt;code&gt;*shell*&lt;/code&gt; buffer corresponding to &lt;code&gt;foo&lt;/code&gt;'s output and add it to the kill-ring with &lt;code&gt;C-w&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like, however, to pipe &lt;code&gt;foo&lt;/code&gt;'s output &lt;em&gt;directly&lt;/em&gt; to the kill-ring, so that it never appears in the &lt;code&gt;*shell*&lt;/code&gt; buffer (and thus obviating the need to select the appropriate region and run &lt;code&gt;C-w&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, is there some Unix command &lt;code&gt;bar&lt;/code&gt; such that running&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% foo | bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...in the &lt;code&gt;*shell*&lt;/code&gt; buffer will cause the output of &lt;code&gt;foo&lt;/code&gt; to be added to Emacs's kill-ring?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In case there's a difference between them, I'd like to know the answer to this question for 3 different cases (in order of importance):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Emacs is running as an X11 application (Debian Linux + Xfce4 + Xfwm4);&lt;/li&gt;&#xA;&lt;li&gt;Emacs is running in &quot;text-only mode&quot; (e.g. started with &lt;code&gt;emacs -nw&lt;/code&gt;);&lt;/li&gt;&#xA;&lt;li&gt;Emacs is running as a Cocoa application in OS X (i.e. it is &lt;code&gt;/Applications/Emacs.app&lt;/code&gt;, installed from &lt;a href=&quot;https://emacsformacosx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;);&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;PS: I just learned that &lt;code&gt;eshell&lt;/code&gt; (not to be confused with &lt;code&gt;M-x shell&lt;/code&gt;/&lt;code&gt;comint&lt;/code&gt;) implements the &lt;code&gt;/dev/kill&lt;/code&gt; pseudo-file, which solve's this post's problem (i.e. &lt;code&gt;foo &amp;gt; /dev/kill&lt;/code&gt; adds &lt;code&gt;foo&lt;/code&gt;'s output to the kill-ring).  Unfortunately, IME, using &lt;code&gt;eshell&lt;/code&gt; has always been an &lt;em&gt;absolute nightmare&lt;/em&gt;, since so little of what I know from &lt;code&gt;bash&lt;/code&gt; works with &lt;code&gt;eshell&lt;/code&gt;; I don't want to learn a whole new---and totally weird--shell from the bottom up just to solve this post's problem.  Therefore, at the moment at least, &lt;code&gt;eshell&lt;/code&gt;-based solutions are out of the question.  This may change, however, depending on the answers I get to &lt;a href=&quot;https://emacs.stackexchange.com/q/30463/882&quot;&gt;another question&lt;/a&gt; I just posted.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-02-05T15:53:28.507" Title="How to send *shell* stdout directly to kill-ring?" Tags="|shell|shell-mode|kill-ring|clipboard|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30459" PostTypeId="1" AcceptedAnswerId="30460" CreationDate="2017-02-05T14:59:33.120" Score="5" ViewCount="425" Body="&lt;p&gt;When I type &lt;code&gt;H-z&lt;/code&gt;, emacs waits for more input, so I assume&#xA;something is bound to &lt;code&gt;H-z&lt;/code&gt; plus something else, only in this case&#xA;&lt;code&gt;C-h k H-z&lt;/code&gt; also just waits for more input.  How can I find out&#xA;what is bound to what starting with &lt;code&gt;H-z&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="105" LastEditDate="2017-02-05T15:51:04.787" LastActivityDate="2017-02-05T15:51:04.787" Title="What bindings start with H-z?" Tags="|key-bindings|help|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30460" PostTypeId="2" ParentId="30459" CreationDate="2017-02-05T15:16:36.663" Score="5" Body="&lt;p&gt;Emacs has a special case for this, hitting the help character (default: either &lt;code&gt;C-h&lt;/code&gt; or &lt;code&gt;F1&lt;/code&gt;) after an incomplete key sequence will execute &lt;code&gt;describe-prefix-bindings&lt;/code&gt; and show you possible commands starting with it.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-02-05T15:16:36.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30461" PostTypeId="2" ParentId="30459" CreationDate="2017-02-05T15:17:56.770" Score="5" Body="&lt;p&gt;You can find the bindings that start with a prefix by pressing &lt;code&gt;C-h&lt;/code&gt; or &lt;code&gt;&amp;lt;F1&amp;gt;&lt;/code&gt; after the prefix.  In your case, pressing &lt;code&gt;H-z C-h&lt;/code&gt;will list all bindings that start with &lt;code&gt;H-z&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this stackoverflow answer for more info about the convention that allows this to work: &lt;a href=&quot;https://stackoverflow.com/a/10330564/3101625&quot;&gt;https://stackoverflow.com/a/10330564/3101625&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7146" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-02-05T15:17:56.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30462" PostTypeId="2" ParentId="30455" CreationDate="2017-02-05T15:22:08.690" Score="3" Body="&lt;p&gt;Some things to consider wrt your code (in no special order):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why use a plist instead of an alist?  Either choice is OK, but at least ask yourself the question.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What final plist do you expect to get? Plists generally use symbols, not strings, as the keys.  So if you have strings you will want to use &lt;code&gt;intern&lt;/code&gt; to get symbols.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If your input is a buffer of such text lines, why convert it to a string and then process that string?  In Emacs, it is usually better (easier and faster) to work directly with the buffer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why use a global variable for &lt;code&gt;testList&lt;/code&gt;?  (Maybe there is a good reason?)  Why not just bind it within the function and return its value at the end?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;plist-put&lt;/code&gt; requires &lt;em&gt;two&lt;/em&gt; args in addition to the plist to modify: a key and a value.  You passed only one arg, which is a string of both key and value.  &lt;code&gt;split-string&lt;/code&gt; returns a list of the split components - it does &lt;em&gt;not&lt;/em&gt; change the value of the variable that points to the original string.  If you want to use the list returned then you need to use it explicitly - the variable is not set by &lt;code&gt;split-string&lt;/code&gt; to the resulting list.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The key of a plist is typically a symbol.  In your case, the key is (&lt;code&gt;intern&lt;/code&gt; applied to) the &lt;code&gt;car&lt;/code&gt; of what &lt;code&gt;split-string&lt;/code&gt; returns for &lt;code&gt;temp&lt;/code&gt;, and the value is (&lt;code&gt;string-to-number&lt;/code&gt; applied to) the &lt;code&gt;cadr&lt;/code&gt; (second element).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Set the plist variable to the result returned by &lt;code&gt;plist-put&lt;/code&gt;. You usually need to do this for a destructive operation like &lt;code&gt;plist-put&lt;/code&gt;.   &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This code does what I think you want.  It is &lt;em&gt;not&lt;/em&gt; the best way to do it.  But it corresponds most closely with the approach you were taking, so hopefully it can point out some places where you went a bit wrong.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar testList () &quot;...&quot;)&#xA;&#xA;(defun testRead ()&#xA;  (interactive)&#xA;  (let ((myList  (split-string (with-temp-buffer&#xA;                                 (insert-file-contents &quot;test.txt&quot;)&#xA;                                 (buffer-substring-no-properties (point-min) (point-max)))&#xA;                               &quot;\n&quot;&#xA;                               t)))&#xA;    (let (f+n)&#xA;      (dolist (temp  myList)&#xA;        (setq f+n  (split-string temp &quot; &quot;))&#xA;        (setq testList  (plist-put testList &#xA;                                   (intern (car f+n))&#xA;                                   (string-to-number (cadr f+n))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A good exercise is to do &lt;code&gt;M-x debug-on-entry RET testRead RET&lt;/code&gt;, then &lt;code&gt;M-x testRead RET&lt;/code&gt;, and then walk through the debugger (using &lt;code&gt;d&lt;/code&gt;), to see what happens when Emacs Lisp invokes &lt;code&gt;testRead&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or insert calls to &lt;code&gt;message&lt;/code&gt; at various points, to print out the values of certain expressions (e.g. variables), so you can see if things correspond to what you expected at those points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In those ways you not only debug your code yourself, you teach yourself Emacs Lisp by seeing just what happens, incrementally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Property Lists&lt;/a&gt; and its subnodes, including node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Plists-and-Alists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Plists and Alists&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-02-05T15:39:35.860" LastActivityDate="2017-02-05T15:39:35.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30464" PostTypeId="2" ParentId="30458" CreationDate="2017-02-05T15:41:17.003" Score="5" Body="&lt;h2&gt;Emacs Command&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Instead of select-and-copy manually, you can also write a command and&#xA;let it do the work for you:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Adapted from `comint-delete-output'&#xA;(defun comint-copy-output ()&#xA;  &quot;Copy all output from interpreter since last input.&quot;&#xA;  (interactive)&#xA;  (let ((proc (get-buffer-process (current-buffer))))&#xA;    (save-excursion&#xA;      (let ((pmark (progn (goto-char (process-mark proc))&#xA;              (forward-line 0)&#xA;              (point-marker))))&#xA;    (kill-new (buffer-substring comint-last-input-end pmark))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;foo | bar&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Your idea can also be achieved by a simple shell script. It assumes&#xA;Emacs server is running, if it is not, you can start it via the&#xA;command &lt;code&gt;server-start&lt;/code&gt; or run Emacs as a daemon.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;#!/bin/bash&#xA;&#xA;cat /dev/stdin &amp;gt; /tmp/clip&#xA;&#xA;emacsclient --eval '(kill-new (my-file-contents &quot;/tmp/clip&quot;))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Becuase it's not easy to embedding Lisp code in shell,&#xA;&lt;code&gt;my-file-contents&lt;/code&gt; is defined in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-file-contents (file)&#xA;  (with-temp-buffer&#xA;    (insert-file-contents file)&#xA;    (buffer-string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now in shell, &lt;code&gt;% foo | bar&lt;/code&gt; should do what you want (assuming &lt;code&gt;bar&lt;/code&gt;&#xA;is the shell script and it is in your PATH).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;foo &gt; /tmp/kill&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In Eshell, you can save output to the kill ring by redirecting output&#xA;to &lt;code&gt;/dev/kill&lt;/code&gt;. You can do the similar in any shell:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;redirect output to &lt;code&gt;/tmp/kill&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;when the contents of &lt;code&gt;/tmp/kill&lt;/code&gt; changes, make Emacs copies the new&#xA;contents to the kill ring&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(notes that your Emacs should be compiled with support of watching&#xA;filesystem, I guess it means &lt;code&gt;(require 'filenotify)&lt;/code&gt; should return&#xA;non-nil)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun save-to-kill-ring-if-changes (event)&#xA;  ;; (message &quot;Event %S&quot; event)&#xA;  (when (eq (cadr event) 'changed)&#xA;    (kill-new (my-file-contents &quot;/tmp/kill&quot;))))&#xA;&#xA;;; Create /tmp/kill firstly&#xA;(write-region &quot;&quot; nil &quot;/tmp/kill&quot;)&#xA;(file-notify-add-watch &quot;/tmp/kill&quot; '(change) 'save-to-kill-ring-if-changes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then in any shell, &lt;code&gt;% foo &amp;gt; /tmp/kill&lt;/code&gt; should copy the output of &lt;code&gt;foo&lt;/code&gt;&#xA;to the kill ring.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2017-02-05T15:53:28.507" LastActivityDate="2017-02-05T15:53:28.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30465" PostTypeId="1" AcceptedAnswerId="30515" CreationDate="2017-02-05T16:11:44.787" Score="2" ViewCount="228" Body="&lt;p&gt;text-scale-mode uses a buffer-local &lt;code&gt;face-remapping-alist&lt;/code&gt; to scale the buffer's text, adding values like &lt;code&gt;(:height 1.2)&lt;/code&gt;. It stores a &quot;cookie&quot; with the scaling it has applied in another local variable, &lt;code&gt;text-scale-mode-remapping&lt;/code&gt;, and uses this to locate and remove previous scalings whenever the height needs to be reset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neither &lt;code&gt;face-remapping-alist&lt;/code&gt; nor &lt;code&gt;text-scale-mode-remapping&lt;/code&gt; are marked as permanent-local, so any event that wipes out buffer-local variables (e.g. changing major-modes) will clear them both. From text-scale-mode's perspective, this is fine: clearing &lt;code&gt;face-remapping-alist&lt;/code&gt; causes the height to be reset, so there's no need to preserve &lt;code&gt;text-scale-mode-remapping&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;face-remapping-alist&lt;/code&gt; to change the background color of certain buffers, and want this to persist even when buffer-local variables are cleared, so I've marked it as permanent-local. This causes problems for text-scale-mode when local variables are cleared: it's height adjustments survive, but its memory of having applied them is lost when &lt;code&gt;text-scale-mode-remapping&lt;/code&gt; is cleared. I can increase/decrease the height, but attempting to reset it to its true default just resets it to the height it had last time local variables were cleared.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've fixed this by marking &lt;code&gt;text-scale-mode-remapping&lt;/code&gt; permanent-local as well. I considered submitting a bug-report for text-scale-mode, but it only makes sense to mark &lt;code&gt;text-scale-mode-remapping&lt;/code&gt; permanent local if &lt;code&gt;face-remapping-alist&lt;/code&gt; is permanent-local too, and I don't know if that's a desireable default. I prefer it that way, but maybe there are other use-cases where it's not?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-02-07T13:11:41.327" Title="Why isn't face-remapping-alist permanent-local by default?" Tags="|faces|variables|buffer-local|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30466" PostTypeId="2" ParentId="30457" CreationDate="2017-02-05T16:50:57.583" Score="6" Body="&lt;p&gt;Known extensions to AUCTeX are controlled by the variable &lt;code&gt;TeX-file-extensions&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;TeX-file-extensions is a variable defined in ‘tex.el’.&lt;br&gt;&#xA;  Its value is (&quot;tex&quot; &quot;sty&quot; &quot;cls&quot; &quot;ltx&quot; &quot;texi&quot; &quot;txi&quot; &quot;texinfo&quot; &quot;dtx&quot;)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;br&gt;&#xA;  *File extensions used by manually generated TeX files.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can use the customize interface to add &lt;code&gt;&quot;ins&quot;&lt;/code&gt; to this list or with something like this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load &quot;tex&quot;&#xA;  (add-to-list 'TeX-file-extensions &quot;ins&quot; t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12242" LastActivityDate="2017-02-05T16:50:57.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30467" PostTypeId="1" AcceptedAnswerId="30469" CreationDate="2017-02-05T17:02:10.607" Score="3" ViewCount="122" Body="&lt;p&gt;Often times I need to debug code wrapped in the BODYFORM of &lt;code&gt;condition-case&lt;/code&gt;; however, the debugger is suppressed even though I have &lt;code&gt;debug-on-error&lt;/code&gt; set to &lt;code&gt;t&lt;/code&gt;.  The doc-string states that we can add &lt;code&gt;debug&lt;/code&gt; to the list of handlers, but I didn't find a good example by Googling of how this might be accomplished.  Modifying the code of something that I am trying to debug to add a handler seems rather inefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an approach to force &lt;code&gt;condition-case&lt;/code&gt; to always generate a debugging message without modifying the section of code that I am trying to debug?  If not, then an explanation why along with a sample of how to use &lt;code&gt;debug&lt;/code&gt; as a handler would be an acceptable answer.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-05T17:38:21.193" Title="How to force `condition-case` to activate the debugger" Tags="|debug|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30469" PostTypeId="2" ParentId="30467" CreationDate="2017-02-05T17:38:21.193" Score="4" Body="&lt;p&gt;Try using &lt;code&gt;condition-case-unless-debug&lt;/code&gt; instead of &lt;code&gt;condition-case&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to &lt;code&gt;M-x debug-on-entry&lt;/code&gt; either &lt;code&gt;foo&lt;/code&gt; or &lt;code&gt;bar&lt;/code&gt; in this context:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun foo ()&#xA;  (condition-case-unless-debug nil&#xA;      (bar)&#xA;    (error nil)))&#xA;&#xA;(defun bar ()&#xA;  (message &quot;Cuckoo!&quot;)&#xA;  (pp-eval-expression '(cons 42 49)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;condition-case-unless-debug&lt;/code&gt; just does this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(macroexpand '(condition-case-unless-debug nil (bar) (error nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(condition-case nil&#xA;    (bar)&#xA;  ((debug error)&#xA;   nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-05T17:38:21.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30470" PostTypeId="2" ParentId="17619" CreationDate="2017-02-05T17:54:45.197" Score="3" Body="&lt;p&gt;Building on Sean Allred's answer, this worked great for me (no need to link to / tweak external style sheet, e.g. for a one-off use):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@@html:&#xA;&amp;lt;style&amp;gt;&#xA;.figure-number {&#xA;    display: none;&#xA;}&#xA;&amp;lt;/style&amp;gt;&#xA;@@&#xA;&#xA;#+CAPTION: Lisp is a language of timeless elegance.&#xA;https://imgs.xkcd.com/comics/lisp_cycles.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="505" LastActivityDate="2017-02-05T17:54:45.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30472" PostTypeId="1" CreationDate="2017-02-05T23:32:12.803" Score="2" ViewCount="2472" Body="&lt;p&gt;I already checked around the stack exchange and internet for a while to why this issue is occurring, but I can't seem to find the solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I try to enable a disabled command in Emacs, it tells me the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Saving file c:/.emacs...&#xA;basic-save-buffer-2: Opening output file: Permission denied, c:/.emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no clue how to fix it because I thought that Emacs only loads it's .emacs on startup or when told to refresh and it wouldn't cause an issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is extremely appreciated.&lt;/p&gt;&#xA;" OwnerUserId="14817" LastActivityDate="2017-02-06T19:37:26.403" Title="Emacs won't write to .emacs" Tags="|init-file|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30473" PostTypeId="2" ParentId="30472" CreationDate="2017-02-05T23:38:46.153" Score="2" Body="&lt;p&gt;Does this happen when you start Emacs using &lt;code&gt;emacs -Q&lt;/code&gt; (no init file)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like you do not have permission to save your init file at the top of the &lt;code&gt;C:\&lt;/code&gt; drive (which is likely a good thing).  (In the old days, the top of the &lt;code&gt;C:\&lt;/code&gt; drive was considered your home directory.  Nowadays, that's kind of frowned upon.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When in Emacs, use &lt;code&gt;C-h r g init file&lt;/code&gt; to go to the &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Init File&lt;/a&gt; page. There you will see where you can put your init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first thing you should do, on MS Windows, is to define your &lt;code&gt;HOME&lt;/code&gt; folder, which you do by defining the system (aka environment) variable &lt;code&gt;HOME&lt;/code&gt;.  Then save your init file in that folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your &lt;code&gt;HOME&lt;/code&gt; variable is not already defined, or if you want to change your home-folder location, go to &lt;em&gt;Control Panel &gt; System &gt; Advanced system settings &gt; Environment Variables&lt;/em&gt;.  Click &lt;em&gt;New&lt;/em&gt; (if it is not yet defined) or &lt;em&gt;Edit&lt;/em&gt; (if it is defined) and enter &lt;code&gt;HOME&lt;/code&gt; as the &lt;em&gt;Variable name&lt;/em&gt; and the location of the folder you want as the &lt;em&gt;Variable value&lt;/em&gt;. Save your changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the manual tells you, you can save your init file (in your &lt;code&gt;HOME&lt;/code&gt; folder) in any of a few names:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs looks for your init file using the filenames &lt;code&gt;~/.emacs&lt;/code&gt;, &lt;code&gt;~/.emacs.el&lt;/code&gt;, or&#xA;  &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;; you can choose to use any one of these three names.  Here, &lt;code&gt;~/&lt;/code&gt; stands for your home directory.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-02-05T23:43:46.480" LastActivityDate="2017-02-05T23:43:46.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30474" PostTypeId="1" AcceptedAnswerId="30900" CreationDate="2017-02-05T23:39:09.933" Score="1" ViewCount="4211" Body="&lt;p&gt;I'm using the latest version of emacs, with and without a custom MacOS build (&lt;a href=&quot;https://github.com/d12frosted/homebrew-emacs-plus&quot; rel=&quot;nofollow noreferrer&quot;&gt;homebrew-emacs-plus&lt;/a&gt;). So, I'm trying to use spacemacs on MacOS, and I can't get it to pick up the &lt;code&gt;$PATH&lt;/code&gt; on my host system. So when I try to run a command like &lt;code&gt;M-x magit-status&lt;/code&gt;, I get the error message. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Searching for program: No such file or directory, git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Spacemacs is using Steve Purcell's &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;exec-path-from-shell&lt;/a&gt;. This &lt;a href=&quot;https://emacs.stackexchange.com/questions/30397/package-exec-path-from-shell-isnt-setting-path-variables-from-zshenv-on-ma&quot;&gt;SO question&lt;/a&gt; isn't quite solving it. And I've tried the below configuration (not using exec-path-from-shell), but no dice. I can get it working on my custom emacs configuration. But I’m trying to transition to spacemacs. And this is a blocker. Anyone know howto solve this? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((path (shell-command-to-string &quot;. ~/.bash_profile; echo -n $PATH&quot;)))&#xA;  (setenv &quot;PATH&quot; path)&#xA;  (setq exec-path &#xA;        (append&#xA;         (split-string-and-unquote path &quot;:&quot;)&#xA;         exec-path)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10528" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-02-20T18:51:45.423" Title="How to get Exec-path-from-shell working in Spacemacs" Tags="|magit|spacemacs|path|exec-path|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30475" PostTypeId="2" ParentId="30454" CreationDate="2017-02-05T23:51:50.037" Score="8" Body="&lt;p&gt;You may want to define a function that will ask you to confirm before closing a frame. Then you'll check if Emacs was started as a daemon, if it is the case, update the &lt;code&gt;C-x C-c&lt;/code&gt; shortcut. Something in that spirit:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ask-before-closing ()&#xA;  &quot;Close only if y was pressed.&quot;&#xA;  (interactive)&#xA;  (if (y-or-n-p (format &quot;Are you sure you want to close this frame? &quot;))&#xA;      (save-buffers-kill-emacs)                                                                                            &#xA;    (message &quot;Canceled frame close&quot;)))&#xA;&#xA;(when (daemonp)&#xA;  (global-set-key (kbd &quot;C-x C-c&quot;) 'ask-before-closing))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: &lt;em&gt;As the OP is not near to know how to do that&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just copy the snippet above and paste it inside your Emacs init file. It may be  &lt;code&gt;~/.emacs&lt;/code&gt;, &lt;code&gt;~/.emacs.el&lt;/code&gt;, or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. Then, relaunch Emacs.&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="101" LastEditDate="2017-02-07T16:51:07.840" LastActivityDate="2017-02-07T16:51:07.840" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30477" PostTypeId="1" AcceptedAnswerId="30502" CreationDate="2017-02-06T03:07:29.160" Score="2" ViewCount="1541" Body="&lt;p&gt;I want to clear the &lt;code&gt;ghci&lt;/code&gt; screen of the &lt;code&gt;haskell-mode&lt;/code&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used &lt;code&gt;erase-buffer&lt;/code&gt; in emacs shell, and I works, but when I do so with &lt;code&gt;ghci&lt;/code&gt; inside emacs, This message appears:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Text is read-only&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14791" LastEditorUserId="253" LastEditDate="2017-02-06T19:51:58.930" LastActivityDate="2017-02-06T20:11:06.780" Title="Clear ghci screen of haskell-mode" Tags="|haskell-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30478" PostTypeId="2" ParentId="5553" CreationDate="2017-02-06T03:24:41.013" Score="2" Body="&lt;p&gt;You can suppress that window for a single command instead of globally using &lt;code&gt;let&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((display-buffer-alist&#xA;       (cons (cons &quot;\\*Async Shell Command\\*.*&quot;&#xA;                   (cons #'display-buffer-no-window nil))&#xA;             display-buffer-alist))) ;; suppress async shell command window&#xA;  (async-shell-command command))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3853" LastEditorUserId="3853" LastEditDate="2017-02-06T07:16:17.517" LastActivityDate="2017-02-06T07:16:17.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30480" PostTypeId="1" CreationDate="2017-02-06T05:44:37.387" Score="2" ViewCount="29" Body="&lt;p&gt;In a compilation buffer, when I set buffer local variable like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-local foo 'bar)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing a &lt;code&gt;(recompile)&lt;/code&gt; will unset this variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to keep the buffer local value permanent through recompiles?&lt;/p&gt;&#xA;" OwnerUserId="13067" LastActivityDate="2017-02-06T05:44:37.387" Title="How to preserve buffer local variables through `recompile`?" Tags="|buffer-local|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30481" PostTypeId="1" CreationDate="2017-02-06T06:19:13.833" Score="1" ViewCount="373" Body="&lt;p&gt;A natural approach to sorting an outline recursively would be the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-map-entries (lambda ()&#xA;                   (org-sort-entries nil ?f 'my/sort-function)&#xA;                   nil 'tree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This doesn't work; it stops after sorting the top-level heading because &lt;code&gt;org-sort-entries&lt;/code&gt; throws an error on any leaf node:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;user-error: Nothing to sort&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do any alternatives exist?&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-03-18T19:41:21.343" Title="org-sort-entries recursively" Tags="|org-mode|sorting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30482" PostTypeId="2" ParentId="30481" CreationDate="2017-02-06T06:19:13.833" Score="1" Body="&lt;p&gt;I've convinced myself that my particular example should be treated as a bug since no explicitly recursive sorting mechanism appears to exist.  In a pinch you can use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-map-entries (lambda ()&#xA;                         (condition-case x&#xA;                             (org-sort-entries nil ?f 'my/sort-function)&#xA;                           (user-error)))&#xA;                       nil 'tree)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm going to submit it as a bug unless someone suggests a compelling explanation otherwise.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-02-06T06:19:13.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30483" PostTypeId="1" CreationDate="2017-02-06T10:05:58.433" Score="0" ViewCount="128" Body="&lt;p&gt;I just installed &lt;code&gt;auto-complete-auctex&lt;/code&gt; from melpa repository. At package documentation says to enable by putting in my &lt;code&gt;.init&lt;/code&gt; file the following command&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(require 'auto-complete-auctex)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, when i launch emacs i get the following error&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's value as variable is void: ac-modes&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can i solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="10809" LastActivityDate="2017-02-06T10:05:58.433" Title="Cannot install auto-complete-auctex" Tags="|package|auctex|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30484" PostTypeId="1" AcceptedAnswerId="30499" CreationDate="2017-02-06T11:13:05.377" Score="3" ViewCount="432" Body="&lt;p&gt;the &lt;code&gt;org-mode-ndays&lt;/code&gt; setting stopped having any effect on my agenda view after updating all packages. I would like to get this working again. :)&#xA;When I open the agenda the Week-agenda is shown (should be day-agenda), if I change it to day-agenda&#xA;and then refresh I'm back in Week-agenda. This is really annoying but I have no idea how to investigate this issue. Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my setup&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq org-agenda-custom-commands&#xA;        '((&quot;d&quot; &quot;Daily agenda and all TODOs&quot;&#xA;           (&#xA;            (agenda &quot;&quot;&#xA;                    ((org-agenda-ndays 1)&#xA;                     (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo 'any))))&#xA;            )&#xA;       )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2016-10-20&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org mode version 9.0.4 (9.0.4-elpaplus @ /home/ibayer/.emacs.d/elpa/org-plus-contrib-20170124/)&lt;/p&gt;&#xA;" OwnerUserId="14419" LastActivityDate="2017-02-06T17:58:00.227" Title="org-agenda-ndays stopped working after package update" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30485" PostTypeId="2" ParentId="28382" CreationDate="2017-02-06T11:22:24.587" Score="2" Body="&lt;p&gt;I had the same issue but now it should be &lt;a href=&quot;https://github.com/emacs-ess/ESS/pull/398&quot; rel=&quot;nofollow noreferrer&quot;&gt;fixed&lt;/a&gt; in the &lt;a href=&quot;http://ess.r-project.org/Manual/ess.html#Installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;development version&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14224" LastActivityDate="2017-02-06T11:22:24.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30486" PostTypeId="1" AcceptedAnswerId="30488" CreationDate="2017-02-06T12:29:52.590" Score="6" ViewCount="64" Body="&lt;p&gt;For example, I want &lt;kbd&gt;Control&lt;/kbd&gt; key to be displayed not as &lt;kbd&gt;C&lt;/kbd&gt; but as &lt;kbd&gt;⎈&lt;/kbd&gt; (U+2388 HELM SYMBOL) in the minibuffer.&lt;br&gt;&#xA;Trying to personalize my Emacs and display all function keys as ISO symbols. And sequences to be displayed as something like &lt;code&gt;⎈ + x, ⎈ + f&lt;/code&gt;.&lt;br&gt;&#xA;Is there a way to do it?&lt;/p&gt;&#xA;" OwnerUserId="14822" LastEditorUserId="105" LastEditDate="2017-02-06T14:52:41.673" LastActivityDate="2017-02-06T14:52:41.673" Title="How do I customize the way Emacs prints out certain keys and key sequences?" Tags="|key-bindings|unicode|help|customization|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30487" PostTypeId="1" AcceptedAnswerId="30496" CreationDate="2017-02-06T12:50:27.063" Score="5" ViewCount="801" Body="&lt;p&gt;Is there a way to easily copy the current branch name in Magit via &lt;code&gt;M-x&lt;/code&gt;?&#xA;At the moment I open the status pop up &lt;code&gt;magit-status&lt;/code&gt; and copy the name from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best &amp;amp; thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="14631" LastEditorUserId="14631" LastEditDate="2017-02-07T18:09:23.573" LastActivityDate="2017-02-07T18:09:23.573" Title="Add (copy) to kill ring current branch name with Magit" Tags="|magit|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30488" PostTypeId="2" ParentId="30486" CreationDate="2017-02-06T13:02:13.153" Score="7" Body="&lt;p&gt;Yes. There is a function &lt;code&gt;key-description&lt;/code&gt; that takes a list or vector of keys and returns a string that describes them. This is used by the built-in help facilities such as &lt;code&gt;describe-key&lt;/code&gt; and &lt;code&gt;describe-function&lt;/code&gt; to display information about key bindings. It calls &lt;code&gt;single-key-description&lt;/code&gt; on each element of the input list. Both of these are written in C rather than Lisp, but you could in principle override both of these to do what you want by adding advice to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;key-description&lt;/code&gt; is even called by the Info system to render the correct key bindings in the documentation, even once the user starts customizing them.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2017-02-06T13:17:35.680" LastActivityDate="2017-02-06T13:17:35.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30489" PostTypeId="1" AcceptedAnswerId="39382" CreationDate="2017-02-06T13:05:40.720" Score="2" ViewCount="1016" Body="&lt;p&gt;In my current Emacs setup the org agenda takes a ridiculous amount of time to start up, up to 2 minutes. It happens both on Ubuntu and MacOS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Version information: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Emacs: &lt;code&gt;GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2018-02-18&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Orgmode: &lt;code&gt;Org mode version 9.1.6 (9.1.6-44-ge6f891-elpaplus @ /home/jx/.emacs.d/elpa/develop/org-plus-contrib-20180205/)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm using &lt;a href=&quot;https://github.com/syl20bnr/spacemacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Spacemacs'&lt;/a&gt; develop branch. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, this problem happens on both Ubuntu 16.04 LTS and the latest MacOS. Actually it has persisted for a very long period of time so I doubt if it's related to any particular Emacs/Org version. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only information I was able to gather from the &lt;code&gt;Messages&lt;/code&gt; buffer during start up is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Using vacuous schema [2 times]&#xA;There is no ElDoc support in this buffer&#xA;Showing all blocks ... done&#xA;Using vacuous schema&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why by starting up org agenda Emacs would have something to do with &quot;ElDoc support&quot; and &quot;vacuous schema&quot;. It seems to me that those are something related to editing with some other programming languages instead of purely org mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything I configured wrong that I should try to improve? Are the above messages related to some &lt;code&gt;#BEGIN_SRC&lt;/code&gt; blocks in the org files included in the agenda list? I don't think I would ever need source code blocks when I'm viewing an agenda buffer. How can I speed up the startup process? Or is it simply that I have too many files as &lt;code&gt;org-agenda-files&lt;/code&gt; (currently dozens)? I'd think this amount of agenda files is still quite normal and there must be optimization that I can perform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I ran the elp profiling and here are the results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function Name, Call Count, Elapsed Time, Average Time&#xA;&#xA;org-agenda                                                    1           116.6048159   116.6048159&#xA;org-agenda-list                                               1           116.29427357  116.29427357&#xA;org-agenda-prepare                                            1           109.15345470  109.15345470&#xA;org-agenda-prepare-buffers                                    1           108.98258905  108.98258905&#xA;org-agenda-get-day-entries                                    1288        7.0089191339  0.0054417074&#xA;org-agenda-get-scheduled                                      1288        3.726361062   0.0028931374&#xA;org-agenda-get-deadlines                                      1288        2.1579713230  0.0016754435&#xA;org-agenda--timestamp-to-absolute                             14544       1.1317418120  7.781...e-05&#xA;org-agenda-get-timestamps                                     1288        0.3673404320  0.0002852021&#xA;org-agenda-get-sexps                                          1288        0.3438970410  0.0002670008&#xA;org-agenda-get-restriction-and-command                        1           0.310503975   0.310503975&#xA;org-agenda-get-blocks                                         1288        0.3083237900  0.0002393818&#xA;org-agenda-prepare-window                                     1           0.157091024   0.157091024&#xA;org-agenda-skip                                               8624        0.0781296389  9.059...e-06&#xA;org-agenda-files                                              49          0.026090686   0.0005324629&#xA;org-agenda-finalize                                           1           0.013325178   0.013325178&#xA;org-agenda-mode                                               1           0.009848546   0.009848546&#xA;org-agenda-finalize-entries                                   23          0.006178961   0.0002686504&#xA;org-agenda-today-p                                            2604        0.0061717839  2.370...e-06&#xA;org-agenda-skip-eval                                          16968       0.0052723920  3.107...e-07&#xA;org-agenda-highlight-todo                                     112         0.0039840550  3.557...e-05&#xA;org-agenda-format-item                                        112         0.0038309749  3.420...e-05&#xA;org-agenda-new-marker                                         208         0.0031529359  1.515...e-05&#xA;org-agenda-format-date-aligned                                28          0.0007373120  2.633...e-05&#xA;org-agenda-add-time-grid-maybe                                28          0.0003810809  1.361...e-05&#xA;org-agenda-fix-displayed-tags                                 112         0.000342384   3.057e-06&#xA;org-agenda-fontify-priorities                                 1           0.00018465    0.00018465&#xA;org-agenda-align-tags                                         1           0.000160119   0.000160119&#xA;org-agenda-get-day-face                                       28          0.000156385   5.585...e-06&#xA;org-agenda-get-category-icon                                  112         7.702...e-05  6.877...e-07&#xA;org-agenda-span-name                                          23          4.4484e-05    1.934...e-06&#xA;org-agenda-span-to-ndays                                      1           2.3496e-05    2.3496e-05&#xA;org-agenda-fit-window-to-buffer                               1           2.0877e-05    2.0877e-05&#xA;org-agenda-time-of-day-to-ampm-maybe                          21          1.124...e-05  5.353...e-07&#xA;org-agenda-set-mode-name                                      1           9.226e-06     9.226e-06&#xA;org-agenda-mark-header-line                                   1           8.774e-06     8.774e-06&#xA;org-agenda-reset-markers                                      1           4.829e-06     4.829e-06&#xA;org-agenda-deadline-face                                      4           4.761e-06     1.19025e-06&#xA;org-agenda-update-agenda-type                                 1           1.575e-06     1.575e-06&#xA;org-agenda-ndays-to-span                                      2           1.174e-06     5.87e-07&#xA;org-agenda-mark-clocking-task                                 1           7.16e-07      7.16e-07&#xA;org-agenda-use-sticky-p                                       1           5.02e-07      5.02e-07&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure if this says much though.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastEditorUserId="7097" LastEditDate="2018-02-18T16:59:25.830" LastActivityDate="2024-02-01T00:11:04.793" Title="What could cause org agenda to take very long to start up?" Tags="|org-mode|org-agenda|optimization|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30490" PostTypeId="1" AcceptedAnswerId="30494" CreationDate="2017-02-06T13:25:23.463" Score="3" ViewCount="548" Body="&lt;p&gt;Does Emacs have a key binding to yank the word/character under point into the minibuffer? I know isearch has &amp;quot;C-w&amp;quot; (&lt;code&gt;isearch-yank-word-or-char&lt;/code&gt;) and &amp;quot;C-M-y&amp;quot; (&lt;code&gt;isearch-yank-char&lt;/code&gt;). I often wish I could use something similar in other uses of the minibuffer.&lt;/p&gt;&#xA;&lt;p&gt;A common use-case is when I'm reading some elisp and see a variable whose value I've set in my init file, but can't remember what I set it to. I'll run &lt;code&gt;eval-expression&lt;/code&gt; and type in its name. But if the cursor is on that variable, I'd like to run &lt;code&gt;eval-expression&lt;/code&gt; and hit some key to yank it into the minibuffer.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="105" LastEditDate="2021-12-20T00:31:54.580" LastActivityDate="2023-03-27T14:21:57.640" Title="Key binding to yank word/char under cursor into minibuffer?" Tags="|key-bindings|minibuffer|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30492" PostTypeId="2" ParentId="30487" CreationDate="2017-02-06T14:55:18.947" Score="1" Body="&lt;p&gt;You already have the right approach. But if you're looking for a command, this extracts the branch name&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ALT+! git rev-parse --abbrev-ref HEAD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where ALT+! is the &lt;code&gt;shell-command&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are on Mac OS X (though you did not mention what OS you are using), copy to the clipboard, assuming that is where you want to copy to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ALT+! git rev-parse --abbrev-ref HEAD | pbcopy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To paste back, use the usual OS Cmd-v to paste it back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If on the other hand, you just want to copy to other parts of magit or emacs, then use one of any number of magit functions to find the branch name. As tarsus has pointed out use &lt;code&gt;(magit-get-current-branch)&lt;/code&gt;. But you still have to M-w the name to insert it someplace else. That's why your first instinct was the right one: takes the least number of keystrokes.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-06T17:14:12.093" LastActivityDate="2017-02-06T17:14:12.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30494" PostTypeId="2" ParentId="30490" CreationDate="2017-02-06T15:03:11.467" Score="4" Body="&lt;p&gt;Vanilla Emacs doesn't, but &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt; does.  See &lt;a href=&quot;https://www.emacswiki.org/emacs/Icicles_-_Inserting_Text_from_Cursor&quot; rel=&quot;nofollow noreferrer&quot;&gt;Inserting Text from Cursor&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key sequence &lt;strong&gt;&lt;code&gt;M-.&lt;/code&gt;&lt;/strong&gt; grabs one or more text things at point (the cursor position) in the current buffer and inserts them at point in the minibuffer. This is available whenever the minibuffer is active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize the behavior of &lt;code&gt;M-.&lt;/code&gt;, and when you use it you can control what it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use &lt;code&gt;M-.&lt;/code&gt; repeatedly it can either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Grab something different each time, (removing the last one inserted), giving you a way to use &lt;code&gt;M-.&lt;/code&gt; to cycle to a particular thing at point.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Grab another thing of the same kind, giving you a way to insert successive things of a given type (e.g. word) in the minibuffer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Which it does by default is controlled by an option, but you can use a prefix argument to flip the behavior temporarily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is really simple to use, even if it is also very configurable and you can change its behavior on the fly (i.e., as you use it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[And yes, vanilla Emacs &lt;em&gt;should&lt;/em&gt; have something similar - at least some way to grab something at point and insert it into the minibuffer.  Suggestions for that have gone nowhere, alas.  Such a feature is available for incremental search (Isearch), at least, and has been for decades.]&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-06T15:03:11.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30495" PostTypeId="1" CreationDate="2017-02-06T15:56:39.950" Score="4" ViewCount="1271" Body="&lt;p&gt;I really enjoy writing bidirectional text in org-mode using Emacs as it supports the rt-to-left direction out of the box. However, when it comes to org tables alignment things become very &lt;em&gt;unorg&lt;/em&gt;anized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this setup in my &lt;code&gt;init.el&lt;/code&gt; file for correct RTL display in org file taken from &lt;a href=&quot;https://stackoverflow.com/a/35959156/1288722&quot;&gt;this&lt;/a&gt; post:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun set-bidi-env ()&#xA;  &quot;interactive&quot;&#xA;  (setq bidi-paragraph-direction 'nil))&#xA;(add-hook 'org-mode-hook 'set-bidi-env)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;MWE with a table in English vs Arabic to show the difference&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Tables in English (no alignment problems)&#xA;&#xA;| No | Name           |             Tel |  Rate | Result |&#xA;|----+----------------+-----------------+-------+--------|&#xA;|  1 | John Doe       | +1-541-754-3010 | 34.99 | Fail   |&#xA;|  2 | Johnson Kirton | +1-541-754-3010 | 55.89 | Pass   |&#xA;|  3 | Debbie Cannon  | +1-541-754-3456 | 66.45 | Pass   |&#xA;&#xA;* Tables in Arabic (problems with alignment)&#xA;&#xA;| رقم | الاسم         |          الهاتف | المعدل | النتيجة |&#xA;|-----+---------------+-----------------+--------+---------|&#xA;| ١   | جون دو        | +1-541-754-3010 | ٣٤.٩٩  | فشل     |&#xA;| ٢   | جونسون كيرتون | +1-541-754-3010 | ٥٥.٨٩  | نجاح    |&#xA;| ٣   | ديبي كانون    | +1-541-754-3456 | ٦٦.٤٥  | نجاح    | &#xA;&#xA;* And this text in English after the tables&#xA;&#xA;* وهذا نص باللغة العربية بعد ادراج الجداول&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Screenshot to show the display&lt;/strong&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/jPBY3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jPBY3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the alignment in the Arabic table below how it is different from that of the table in English as ugly to neat. Is there any fix to get it right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using an Arabic monospaced font (Kawkab Mono) as kindly suggested by @Do didn't solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Not a Duplicate&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar issue has been reported for Japanese &lt;a href=&quot;https://emacs.stackexchange.com/q/10464/2443&quot;&gt;here&lt;/a&gt;, but the solutions presented there didn't help solve my problem. Changing the font to &quot;Inconsolata-12&quot; for example didn't change anything in the table alignment, this could be only applicable to the Japanese characters but not to Arabic ones. Neither font type nor size did improve the appearance of the alignment. The second solution in the same post, to my understanding (article in Chinese) is to try out specific pair sizes for English and the SECOND language but as I said, changing font size didn't work for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KGUbt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KGUbt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Another Monospaced Font&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying out &lt;code&gt;Droid Sans Mono&lt;/code&gt; did improve the appearance but it didn't solve it completely and in a larger table the bad alignment would be much worse. I ran out of ways to seek a TYPICAL monospaced Arabic font that will fix it. I wonder if such a font does exist!! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/C9LWL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/C9LWL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-02-08T15:11:22.930" Title="The org-mode table alignment issue in right-to-left languages" Tags="|org-mode|org-table|align|right-to-left|" AnswerCount="0" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="30496" PostTypeId="2" ParentId="30487" CreationDate="2017-02-06T15:59:47.660" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;(magit-get-current-branch)&lt;/code&gt; and wrap that in a interactive command. Something like this should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun magit-add-current-buffer-to-kill-ring ()&#xA;  &quot;Show the current branch in the echo-area and add it to the `kill-ring'.&quot;&#xA;  (interactive)&#xA;  (let ((branch (magit-get-current-branch)))&#xA;    (if branch&#xA;        (progn (kill-new branch)&#xA;               (message &quot;%s&quot; branch))&#xA;      (user-error &quot;There is not current branch&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-02-07T12:15:55.900" LastActivityDate="2017-02-07T12:15:55.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30497" PostTypeId="2" ParentId="30369" CreationDate="2017-02-06T16:09:15.667" Score="2" Body="&lt;p&gt;This was fixed in &lt;a href=&quot;https://github.com/magit/magit/commit/04e7e017aa718ac9e1cd9bc5c3d71d919a82f9f2&quot; rel=&quot;nofollow noreferrer&quot;&gt;this commit&lt;/a&gt;, on the &lt;code&gt;master&lt;/code&gt; branch. The first release to contain that commit will be &lt;code&gt;v2.10.2&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-02-06T16:09:15.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30498" PostTypeId="2" ParentId="30489" CreationDate="2017-02-06T17:50:26.767" Score="0" Body="&lt;p&gt;The standard answer to questions of this sort is: profile the code while executing the function that takes a long time. One way to do that is to say&#xA;&lt;code&gt;M-x elp-instrument package RET org RET&lt;/code&gt;, then create the agenda, then say &lt;code&gt;M-x elp-results&lt;/code&gt;. That should give you an idea of where the time is spent and maybe a hint of where things are going wrong. If you are still stumped, I would urge you to post the profile to the org mode mailing list (and don't forget to mention version numbers for everything). BTW, elp is one profiler, but there is a built-in profile in emacs (see commands &lt;code&gt;profiler-start&lt;/code&gt;, &lt;code&gt;profiler-end&lt;/code&gt; and &lt;code&gt;profiler-report&lt;/code&gt;) and there may be others.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastActivityDate="2017-02-06T17:50:26.767" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30499" PostTypeId="2" ParentId="30484" CreationDate="2017-02-06T17:56:59.767" Score="4" Body="&lt;p&gt;The new setting is called &lt;code&gt;org-agenda-span&lt;/code&gt;. Try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-span 'day)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="253" LastEditDate="2017-02-06T17:58:00.227" LastActivityDate="2017-02-06T17:58:00.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30500" PostTypeId="1" AcceptedAnswerId="30503" CreationDate="2017-02-06T19:05:08.483" Score="0" ViewCount="60" Body="&lt;p&gt;I want to be able to jump directly via a keybind to a specific mailbox summary view in gnus. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for example in the groups view i have a mailbox &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;*        0: nnimap+zeltak:INBOX&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i want to be able to jumo directly to the summary view of the above bookmark. anyone know if thats possible?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2017-02-07T01:51:18.123" LastActivityDate="2017-02-07T01:51:18.123" Title="create a keybind to jump directly to a specific gnus mailbox summary view?" Tags="|key-bindings|gnus|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30501" PostTypeId="2" ParentId="30472" CreationDate="2017-02-06T19:37:26.403" Score="1" Body="&lt;p&gt;So the answer is very similar to Drew's but you need to keep in mind that whatever you set your &lt;code&gt;HOME&lt;/code&gt; variable to one that you have permission of, such as &lt;code&gt;C:/Users/Your User/home/&lt;/code&gt; so that emacs will be able to write to it, at least if you are setting it per user. That should fix it completely&lt;/p&gt;&#xA;" OwnerUserId="14826" LastActivityDate="2017-02-06T19:37:26.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30502" PostTypeId="2" ParentId="30477" CreationDate="2017-02-06T20:06:48.207" Score="2" Body="&lt;p&gt;In &lt;code&gt;haskell-mode&lt;/code&gt;, &lt;code&gt;C-c C-l&lt;/code&gt; calls &lt;code&gt;haskell-process-load-or-reload&lt;/code&gt;, and you go into a sub-mode called &lt;code&gt;haskell-cabal-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that mode there is a command &lt;code&gt;haskell-interactive-mode-clear&lt;/code&gt; to clear the &lt;code&gt;ghci&lt;/code&gt; buffer. (&lt;code&gt;erase-buffer&lt;/code&gt; does not work, because the buffer is read-only so you cannot erase it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So You can map &lt;code&gt;haskell-interactive-mode-clear&lt;/code&gt; like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(eval-after-load 'haskell-cabal '(progn&#xA;  (define-key haskell-cabal-mode-map (kbd &quot;C-c C-k&quot;) 'haskell-interactive-mode-clear)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="14791" LastEditorUserId="253" LastEditDate="2017-02-06T20:11:06.780" LastActivityDate="2017-02-06T20:11:06.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30503" PostTypeId="2" ParentId="30500" CreationDate="2017-02-06T20:12:09.077" Score="1" Body="&lt;p&gt;You may try something like this (put it into your &lt;code&gt;.gnus.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun goto-group-XXX ()&#xA;  &quot;Jump to group XXX.&quot;&#xA;  (interactive)&#xA;  (gnus-group-jump-to-group &quot;XXX&quot;)&#xA;  (gnus-group-select-group))&#xA;&#xA;(define-key gnus-group-mode-map (kbd &quot;v j&quot;)&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (goto-group-XXX)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace the &lt;code&gt;XXX&lt;/code&gt; by the group name (&lt;code&gt;nnimap+zeltak:INBOX&lt;/code&gt;)&#xA;Also have a look at the &lt;code&gt;gnus-group-quick-select-group&lt;/code&gt; function.&lt;/p&gt;&#xA;" OwnerUserId="14829" LastActivityDate="2017-02-06T20:12:09.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30504" PostTypeId="1" AcceptedAnswerId="30507" CreationDate="2017-02-06T21:12:09.770" Score="2" ViewCount="1674" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I hide all &lt;code&gt;org-mode&lt;/code&gt; blocks under the current&#xA;header?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to fold all source code blocks &lt;em&gt;under the current heading&#xA;only&lt;/em&gt;.  I know that I can use &lt;code&gt;org-hide-block-all&lt;/code&gt; to fold&#xA;&lt;em&gt;all&lt;/em&gt; blocks in the buffer, and &lt;code&gt;org-hide-block-toggle&lt;/code&gt; to toggle&#xA;the &lt;em&gt;current&lt;/em&gt; block (i.e., the one at point).  But how about all&#xA;blocks under the current heading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* header 1&#xA;   #+name: block-1&#xA;   #+begin_src R&#xA;     x &amp;lt;- 1:10&#xA;   #+end_src&#xA;   #+name: block-2&#xA;   #+begin_src R&#xA;     y &amp;lt;- 1:10&#xA;   #+end_src&#xA;   #+name: block-3&#xA;   #+begin_src R&#xA;     z &amp;lt;- x + y&#xA;   #+end_src&#xA;* header 2&#xA;   #+name: dont-fold-me-1&#xA;   #+begin_src R&#xA;     a &amp;lt;- &quot;puppies&quot;&#xA;   #+end_src&#xA;   #+name: dont-fold-me-2&#xA;   #+begin_src R&#xA;     b &amp;lt;- &quot;kitties&quot;&#xA;   #+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to fold all blocks under &lt;code&gt;header 1&lt;/code&gt; but leave&#xA;the rests of the blocks (under &lt;code&gt;header 2&lt;/code&gt;) alone.  How would I do that?&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-02-07T15:03:03.633" Title="How to fold all org blocks under the current header line?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30505" PostTypeId="1" AcceptedAnswerId="30508" CreationDate="2017-02-06T21:32:49.440" Score="3" ViewCount="1167" Body="&lt;p&gt;I've taken to using org-mode for keeping track of my open tasks each week, notes on various tasks, and to generate a LaTeX formatted report at the end of each week that breaks down my time by task and subtask per day. This has all been great. I'm curious, however, if there's not some way to export this timesheet data for analysis in some other system or import into a holistic database. I like to use historical task data for estimates and the current structure makes it hard to aggregate my data and analyze it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there was some way to export my logbook entries into something like a CSV file so I can import it into Excel or write a Python script to analyze it or something. If it might make this export easier, I'm considering moving from a 1 file per week organizational structure to one long running file per project. This should at least keep related log entries in physical proximity and more likely to be logged under the same entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="11734" LastActivityDate="2017-02-07T03:42:11.770" Title="Export Org-Mode Timesheet Data?" Tags="|org-mode|org-export|csv|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30506" PostTypeId="1" CreationDate="2017-02-07T00:30:35.097" Score="1" ViewCount="92" Body="&lt;p&gt;Consider the following comments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; This is the first line of a comment.&#xA;;;&#xA;;; This is the second line, which begins a paragraph. If I have&#xA;;;auto-fill-mode enabled, I lose the leading space!&#xA;&#xA;;; However, suppose instead the first paragraph of the comment is&#xA;;; actually more than one line.&#xA;;;&#xA;;; In that case, once I get to the end of a paragraph, the leading&#xA;;; space is preserved as desired!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that if the first paragraph of a comment is only one line, then &lt;code&gt;auto-fill-mode&lt;/code&gt; does not fill &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Adaptive-Fill.html#Adaptive-Fill&quot; rel=&quot;nofollow noreferrer&quot;&gt;adaptively&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that a block of lines starting with &lt;code&gt;;;&lt;/code&gt; constitutes a single paragraph to Emacs. So the behavior is unsurprising in light of the following information from the manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the paragraph has two or more lines, the fill prefix is taken from the paragraph’s second line, but only if it appears on the first line as well.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this case, because the second line of the paragraph has content &lt;code&gt;;;&lt;/code&gt; and &lt;em&gt;not&lt;/em&gt; &lt;code&gt;;; &lt;/code&gt; (i.e. there is no trailing whitespace), Emacs thinks the second line has no fill prefix, and therefore infers that the rest of the paragraph ought not to be filled with a prefix either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I noticed the following additional information on the same manual page:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the prefix found on the first line matches &lt;code&gt;adaptive-fill-first-line-regexp&lt;/code&gt;, or if it appears to be a comment-starting sequence (this depends on the major mode), then the prefix found is used for filling the paragraph, provided it would not act as a paragraph starter on subsequent lines.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since my comment is in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, I would have thought the first line would qualify as a &quot;comment-starting sequence&quot; and therefore its fill prefix (a single space &lt;code&gt; &lt;/code&gt;) would be used, as desired. But this does not happen—what am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I've checked the documentation strings and source code of relevant functions, read the relevant manual pages, checked the Internet for references to this problem, etc. No dice.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce the problem, just open &lt;code&gt;emacs -Q&lt;/code&gt;, run &lt;code&gt;M-x auto-fill-mode&lt;/code&gt;, and type the comments above into the &lt;code&gt;*scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="12534" LastActivityDate="2017-02-07T00:30:35.097" Title="auto-fill-mode fails in comment with empty second line" Tags="|whitespace|comment|fill-paragraph|auto-fill-mode|paragraphs|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30507" PostTypeId="2" ParentId="30504" CreationDate="2017-02-07T03:38:13.453" Score="5" Body="&lt;p&gt;How about using buffer narrowing? &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my/org-hide-block-subtree ()&#xA;  &quot;Hide blocks only below current heading.&quot;&#xA;  (interactive)&#xA;  (save-restriction&#xA;    (widen)&#xA;    (org-narrow-to-subtree)&#xA;    (org-hide-block-all)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's situations like this that I wish &lt;code&gt;org-map-entries&lt;/code&gt; could map over more than just headings...&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="253" LastEditDate="2017-02-07T15:03:03.633" LastActivityDate="2017-02-07T15:03:03.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30508" PostTypeId="2" ParentId="30505" CreationDate="2017-02-07T03:42:11.770" Score="4" Body="&lt;p&gt;There's a relatively new package called &lt;a href=&quot;https://github.com/atheriel/org-clock-csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-clock-csv&lt;/a&gt; that does exactly this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why you'd want to use anything other than org-mode to analyze the data though... ;-)&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-02-07T03:42:11.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30509" PostTypeId="2" ParentId="30474" CreationDate="2017-02-07T03:52:57.220" Score="0" Body="&lt;p&gt;I have no experience with Spacemacs, but if it's just magit you need to get working right now, you may want to try setting &lt;code&gt;magit-git-executable&lt;/code&gt; to the full path (e.g., '/usr/local/bin/git' instead of 'git') as a workaround to getting your path set correctly.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-02-07T03:52:57.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30510" PostTypeId="2" ParentId="28966" CreationDate="2017-02-07T04:23:39.970" Score="1" Body="&lt;p&gt;So I think:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(keyboard-translate (kbd &quot;s-a&quot;) (kbd &quot;C-a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in a type error because &lt;code&gt;keyboard-translate&lt;/code&gt; takes character parameters, but &lt;code&gt;kbd&lt;/code&gt; returns an &quot;internal Emacs key representation&quot;, something very different than a character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I don't think your use of &lt;code&gt;global-set-key&lt;/code&gt; is doing what you think it's doing: when you say &lt;code&gt;(global-set-key (kbd &quot;s-a&quot;) (kbd &quot;C-a&quot;))&lt;/code&gt;, you are actually binding the key &lt;code&gt;s-a&lt;/code&gt; to the &lt;em&gt;output of the command&lt;/em&gt; &lt;code&gt;(kbd &quot;C-a&quot;)&lt;/code&gt;.  Apparently (surprisingly, to me) that happens to do what you meant for a single-key command, but it makes sense to me that it wouldn't work at all for prefix-map keybindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As lawlist said in the link in their comment, setting &lt;code&gt;ns-command-modifier&lt;/code&gt; is the  way to do what you want here.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastEditorUserId="897" LastEditDate="2017-06-07T17:00:29.633" LastActivityDate="2017-06-07T17:00:29.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30512" PostTypeId="1" AcceptedAnswerId="34450" CreationDate="2017-02-07T08:33:20.917" Score="4" ViewCount="254" Body="&lt;p&gt;I am using OrgMode to schedule appointments and tasks. For a simple scheduled event like a phone call, I usually add a simple timestamp by &lt;kbd&gt;CTRL&lt;/kbd&gt;+&lt;kbd&gt;.&lt;/kbd&gt;. Then the cursor is moved to the minibuffer and a calendar pops up in which I can easily move with &lt;kbd&gt;Shift&lt;/kbd&gt; and the cursor keys. Also, since I add the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%(org-diary :timestamp :sexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my diary file, the dates where I do have appointments are highlighted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I found no way to open a buffer that shows me the scheduled appointments for that day when using the scheduling features of OrgMode (moving through the calendar by using the &lt;kbd&gt;Shift&lt;/kbd&gt; key etc.). The usual command in the calendar which is invoked by pressing &lt;kbd&gt;d&lt;/kbd&gt; does not work, because the cursor is in the minibuffer. How can I get this view, when using the OrgMode scheduling features?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/WYeq4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WYeq4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14833" LastActivityDate="2017-07-27T13:12:10.557" Title="Show tasks during orgmode scheduling" Tags="|org-mode|calendar|diary|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30513" PostTypeId="1" AcceptedAnswerId="40852" CreationDate="2017-02-07T08:39:47.300" Score="2" ViewCount="666" Body="&lt;p&gt;I am developing a feature to adapt a mode-line to the width of the window. I have developped it so far using buffer-local variables to store the state of the mode-line, however, when I open the same buffer in several windows they all share the same mode-line state even if they have different window widths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve that I would need window-local variables instead of buffer-local, but it seems that Emacs only provides &lt;code&gt;make-variable-buffer-local&lt;/code&gt; and &lt;code&gt;make-variable-frame-local&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is there a way of emulating window-local variables for my use-case ?&lt;/li&gt;&#xA;&lt;li&gt;Is there any thread in Emacs developpers mailing lists discussing this issue ?&lt;/li&gt;&#xA;&lt;li&gt;More specifically, would Emacs maintainers be opened to this being implemented ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11911" LastActivityDate="2018-04-05T13:10:06.923" Title="Making a variable window-local" Tags="|window|buffer-local|local-variables|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30514" PostTypeId="1" CreationDate="2017-02-07T10:29:49.423" Score="3" ViewCount="37" Body="&lt;p&gt;For example i have this text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;select * from T1 ; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;select * from T2 ; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;select * from T3 ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My objetive is replace the text by this other:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;select * from T1_H ; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;select * from T2_H ; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;select * from T3_H ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when i looking for the regexp, i put the next:&#xA;&quot;from .* ; , but i whant replace only the part &quot;.*&quot; with the same text that has before plus &quot;_H&quot;. How could i do this?&lt;/p&gt;&#xA;" OwnerUserId="14835" LastActivityDate="2017-02-07T14:16:12.317" Title="how can i do for replace a part of a regexp" Tags="|regular-expressions|replace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30515" PostTypeId="2" ParentId="30465" CreationDate="2017-02-07T13:11:41.327" Score="6" Body="&lt;p&gt;&lt;code&gt;permanent-local&lt;/code&gt; is fundamentally a way to distinguish whether the variable's buffer-local value is really specific to this buffer or is specific to the mode currently in use in this buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sadly, in practice, for many buffer-local variables which are not specific to a particular package, whether the setting belongs to the buffer or to the mode will depend not so much on the variable itself but on the package that uses this variable.  IOW it should sometimes be &lt;code&gt;permanent-local&lt;/code&gt; and sometimes not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you report this as a bug, and take advantage of it to request another way to specify &quot;permanent-localness&quot;.  One which can be set locally by a package and only affects this package's own use of that variable.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-02-07T13:11:41.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30516" PostTypeId="1" CreationDate="2017-02-07T14:07:46.190" Score="6" ViewCount="474" Body="&lt;p&gt;When I grep something inside emacs and click to open one of the matching files. The matching line is always displayed at the bottom of the screen, and I have to scroll it up for a better view. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to focus the matching line at the center of the screen automatically when opening one of the grep results? &lt;/p&gt;&#xA;" OwnerUserId="13594" LastActivityDate="2017-08-30T08:07:21.240" Title="Show the matching line in the center of the screen instead of the bottom when opening a grep result" Tags="|buffers|grep|focus|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30517" PostTypeId="2" ParentId="30514" CreationDate="2017-02-07T14:16:12.317" Score="3" Body="&lt;p&gt;You need to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Replace.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;group&lt;/a&gt; the part of the matching string so you can refer to it in the replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a couple of ways to do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;replace &lt;code&gt;\(from\ \w*\b\)&lt;/code&gt; with &lt;code&gt;\1_H&lt;/code&gt;: here &lt;code&gt;\1&lt;/code&gt; refers to the first group (the part between brackets). &lt;code&gt;\b&lt;/code&gt; refers to the end of word (the place between &lt;em&gt;T1&lt;/em&gt; and the space in your example).&lt;/li&gt;&#xA;&lt;li&gt;replace &lt;code&gt;from\ \w*\b&lt;/code&gt; with &lt;code&gt;\&amp;amp;_H&lt;/code&gt;: here &lt;code&gt;\&amp;amp;&lt;/code&gt; refers to the complete matched string.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="53" LastActivityDate="2017-02-07T14:16:12.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30518" PostTypeId="1" AcceptedAnswerId="30542" CreationDate="2017-02-07T14:20:01.220" Score="1" ViewCount="273" Body="&lt;p&gt;when I write code (Javascript, specifically) in a web-mode buffer which chains methods across newlines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;object.foo()&#xA;.bar()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;web-mode seems to want to align it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;object.foo()&#xA;      .bar()// hitting enter here will dot-align my code&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;how can I get it to ignore alignment in this case and instead perform  javascript-mode style indentation like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;object.foo()&#xA;    .bar()// adding the closing paren here will indent code by four spaces&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?  &lt;code&gt;web-mode-code-indent-offset&lt;/code&gt; is set to 4, which works in all other cases like functions and other blocks, but not here, and nothing else in &lt;code&gt;M-x customize-group web-mode&lt;/code&gt; seemed immediately applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Emacs 26.0 and web-mode 20170131.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks!&lt;/p&gt;&#xA;" OwnerUserId="14773" LastActivityDate="2017-02-08T03:41:35.263" Title="how to get web-mode to ignore alignment in favor of indentation during method chaining?" Tags="|indentation|web-mode|align|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30519" PostTypeId="2" ParentId="18404" CreationDate="2017-02-07T15:45:13.313" Score="3" Body="&lt;p&gt;The best I have found so far is to do it using &lt;code&gt;org-insert-link&lt;/code&gt;. After having attached a PNG for example, the properties drawer looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;:Attachments: ipython-notebook-in-emacs-with-ein.png&#xA;:ID:       91ededb1-20cc-4b88-9e6d-a03f48e985e3&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then do &lt;code&gt;M-x org-insert-link&lt;/code&gt; (&lt;code&gt;C-x C-l&lt;/code&gt;). When prompted, I select &lt;code&gt;file:&lt;/code&gt; and then select the file in the subdirectory &lt;code&gt;data/91/ededb.../ipython...&lt;/code&gt; (the &lt;code&gt;data&lt;/code&gt; is standard, the &lt;code&gt;91&lt;/code&gt; and the rest you can deduce from the ID and the attachment name).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After completing this, I am left with a &lt;code&gt;file:&lt;/code&gt; link to the relative position of the attachment. With &lt;code&gt;M-x org-toggle-inline-images&lt;/code&gt; you can make the linked attachment show up inline.&lt;/p&gt;&#xA;" OwnerUserId="8743" LastActivityDate="2017-02-07T15:45:13.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30520" PostTypeId="1" AcceptedAnswerId="30528" CreationDate="2017-02-07T16:25:05.037" Score="20" ViewCount="5298" Body="&lt;p&gt;For below org mode code example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC plantuml :file test.png&#xA;Alice -&amp;gt; Bob: synchronous call&#xA;Alice -&amp;gt;&amp;gt; Bob: asynchronous call&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[file:test.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After press C-c C-c, the result is as above. If I need to show it as image, I have to run &quot;M-x org-display-inline-image&quot; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to combine the &quot;C-c C-c&quot; and &quot;M-x org-display-inline-image&quot; together? It's better to still use &quot;C-c C-c&quot; shortcut.&lt;/p&gt;&#xA;" OwnerUserId="14840" LastActivityDate="2017-02-07T22:11:16.503" Title="Org mode C-c C-c to display inline image" Tags="|org-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30521" PostTypeId="1" AcceptedAnswerId="30529" CreationDate="2017-02-07T16:58:58.267" Score="13" ViewCount="2550" Body="&lt;p&gt;Comments in source code often contain URL's.  It would be nice to have these (or links in any plain text context) rendered as clickable links for the convenience factor when navigating a file using the mouse.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there built-in emacs functionality or a package that automatically render text segments that appear to be URL's as clickable links?&lt;/p&gt;&#xA;&lt;p&gt;If this doesn't already exist, I'm inclined to implement it as a minor mode using &lt;code&gt;auto-overlays&lt;/code&gt;.  If you have implementation advice I would appreciate it!&lt;/p&gt;&#xA;&lt;p&gt;Note:  I'm aware that &lt;code&gt;browse-url&lt;/code&gt; defaults to the URL at point.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edit for clarification:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I am specifically interested in rendering URL's so that &lt;code&gt;http://www.google.com&lt;/code&gt; found anywhere within a buffer to which the link rendering behavior has been applied automatically render as&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KVZeF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KVZeF.png&quot; alt=&quot;google link rendering example&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It has:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a distinct underlined link face applied&lt;/li&gt;&#xA;&lt;li&gt;a keymap applied to that segment&lt;/li&gt;&#xA;&lt;li&gt;a mouse face applied to emphasize that it is clickable&lt;/li&gt;&#xA;&lt;li&gt;a 'help-echo value set that decodes url-encoded characters for readability&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I only mention &lt;code&gt;browse-url&lt;/code&gt; for completeness regarding the suggestion that fontifying the link is unnecessary.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2024-03-08T14:49:08.143" LastActivityDate="2024-03-08T14:49:08.143" Title="Rendering URLs as clickable links" Tags="|hyperlinks|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30522" PostTypeId="2" ParentId="30521" CreationDate="2017-02-07T17:22:46.023" Score="4" Body="&lt;p&gt;It's not 100% clear if you want only the ability to click on URLs,&#xA;or if you want to change their faces in the buffer.  For the&#xA;former, you can use either &lt;code&gt;browse-url&lt;/code&gt; as you suggest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [mouse-1] #'browse-url) ; pick your preferred mouse button&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, if you just want it to open without having to confirm the URL,&#xA;you could use &lt;code&gt;ffap-at-mouse&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [mouse-1] #'ffap-at-mouse)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the docstring for &lt;code&gt;browse-url&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Ask a WWW browser to load URL.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Prompts for a URL, defaulting to the URL at or before point.  Variable&#xA;  &lt;code&gt;browse-url-browser-function&lt;/code&gt; says which browser to use.&#xA;  If the URL is a mailto: URL, consult &lt;code&gt;browse-url-mailto-function&lt;/code&gt;&#xA;  first, if that exists.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And here's the docstring for &lt;code&gt;ffap-at-mouse&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Find file or URL guessed from text around mouse click.&#xA;  Interactively, calls &lt;code&gt;ffap-at-mouse-fallback&lt;/code&gt; if no guess is found.&#xA;  Return value:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;if a guess string is found, return it (after finding it)&lt;/li&gt;&#xA;  &lt;li&gt;if the fallback is called, return whatever it returns&lt;/li&gt;&#xA;  &lt;li&gt;otherwise, nil&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-02-07T17:22:46.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30523" PostTypeId="2" ParentId="30521" CreationDate="2017-02-07T17:24:14.130" Score="8" Body="&lt;p&gt;My &lt;a href=&quot;https://github.com/tarsius/orglink&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;orglink&lt;/code&gt;&lt;/a&gt; package does that. It &quot;implements support for some Org Mode link types in other major modes.  Links can be opened and edited like in Org Mode&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are some examples of links that it does and does not support:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[Code]]&#xA;[[Code][start of code]]&#xA;[[define-derived-mode orglink-mode][orglink-mode]]&#xA;&amp;lt;mailto:jonas@bernoul.li&amp;gt;&#xA;man:info&#xA;&amp;lt;info:man&amp;gt;&#xA;https://github.com/tarsius/orglink&#xA;TODO support Emacs Lisp xref links like (in) `help-mode'.&#xA;TODO support footnote.el links (only)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-02-07T17:24:14.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30524" PostTypeId="1" CreationDate="2017-02-07T17:32:39.403" Score="0" ViewCount="955" Body="&lt;p&gt;This question concerns &lt;code&gt;org-mode&lt;/code&gt; and its &lt;code&gt;org-html-export&lt;/code&gt; feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When exporting from &lt;code&gt;.org&lt;/code&gt; to &lt;code&gt;.html&lt;/code&gt;, the highest headlines (those with the fewest &lt;code&gt;*&lt;/code&gt;s) export to a gigantic font.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to reduce the size of this font?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;" OwnerUserId="14743" LastActivityDate="2017-07-08T07:17:53.050" Title="How to change headline fonts in org-html-export?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30526" PostTypeId="2" ParentId="30524" CreationDate="2017-02-07T18:14:26.290" Score="1" Body="&lt;p&gt;Yes, there is. You can write a CSS stylesheet and include it in your exported html files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can set the global variables &lt;code&gt;org-html-head&lt;/code&gt; and/or &lt;code&gt;org-html-head-extra&lt;/code&gt; to any HTML that you want to include in every exported file, or you can add directives to your .org files that override these variables just for that specific file. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+HTML_HEAD: &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style1.css&quot; /&amp;gt;&#xA; #+HTML_HEAD_EXTRA: &amp;lt;link rel=&quot;alternate stylesheet&quot; type=&quot;text/css&quot; href=&quot;style2.css&quot; /&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This and other useful information can be found in chapter 12.6.11 of the Org Mode manual. You can run &lt;code&gt;M-: (info &quot;(org)CSS Support&quot;)&lt;/code&gt; to jump right to it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-07T18:14:26.290" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30527" PostTypeId="1" AcceptedAnswerId="30640" CreationDate="2017-02-07T19:14:41.443" Score="1" ViewCount="271" Body="&lt;p&gt;I was wondering if there is any way of searching (incremental search) for a UTF-8 character in &lt;a href=&quot;https://github.com/JuliaEditorSupport/julia-emacs/blob/master/julia-mode.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;julia mode&lt;/a&gt;, other than typing the character and copying it into the minibuffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you can use special input modes to enter unicode characters, but julia-mode is not using the standard &lt;a href=&quot;https://github.com/JuliaLang/julia/issues/8947&quot; rel=&quot;nofollow noreferrer&quot;&gt;tex input mode&lt;/a&gt;.  Instead, it defines (kbd &quot;TAB&quot;) on julia-mode-map which expands to the entry in the hash table, julia-latexsubs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I don't want to have to look-up the unicode character in the hash table and enter it manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to attempt a brief explanation of &lt;a href=&quot;https://emacs.stackexchange.com/a/30640/14727&quot;&gt;Stefan's code&lt;/a&gt;.  The tab key is redefined for isearch-mode-map.  First, the binding of newstr creates a temporary buffer and inserts the text from isearch-string.  Then run the julia-latexsub function to see if the previous characters are a hash table entry for a utf-8 character.  If not, newstr will be nil; otherwise, it will now contain the new character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If newstr is nil, continue on with isearch as normal; otherwise, update isearch-string with newstr.  Then there is some code copied directly from isearch.  I'm not familiar with it, but presumably the purpose is to update what happens in the major mode buffer when the isearch-string has changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also &lt;a href=&quot;https://stackoverflow.com/a/11488539/675216&quot;&gt;found a way&lt;/a&gt; to limit the new behavior to Julia-mode.  The following seems to work.  Insert following newstr.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (eq (buffer-local-value 'major-mode (get-buffer (buffer-name))) &#xA;        'julia-mode)&#xA;    code-to-evaluate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14727" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-02-19T13:20:36.477" Title="Incremental Search on UTF-8 in Julia Mode" Tags="|isearch|utf-8|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30528" PostTypeId="2" ParentId="30520" CreationDate="2017-02-07T19:25:44.157" Score="5" Body="&lt;p&gt;Why not redefine &lt;code&gt;C-c C-c&lt;/code&gt; in Org mode then? Use this keybinding. Put it in your emacs init.el file and restart emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-c C-c&quot;)&#xA;  (lambda () (interactive) (org-ctrl-c-ctrl-c)&#xA;                           (org-display-inline-image)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;addendum: is this global or local?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Local to org-mode only.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-07T20:52:56.610" LastActivityDate="2017-02-07T20:52:56.610" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30529" PostTypeId="2" ParentId="30521" CreationDate="2017-02-07T19:28:17.500" Score="24" Body="&lt;p&gt;Emacs offers &lt;code&gt;goto-address-mode&lt;/code&gt; for making a number of things, including HTTP links, clickable.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-02-07T19:28:17.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30530" PostTypeId="1" AcceptedAnswerId="30538" CreationDate="2017-02-07T19:34:51.443" Score="0" ViewCount="52" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I display this let-bound &lt;code&gt;lambda&lt;/code&gt; expression as a symbol -- i.e., display it as &lt;code&gt;my-func&lt;/code&gt; instead of &lt;code&gt;(lambda (arg1 ...))&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like the best of both worlds -- i.e., be able to use &lt;code&gt;funcall&lt;/code&gt; in one area of the code, yet extract a pretty name &lt;code&gt;my-func&lt;/code&gt; from &lt;code&gt;my-list&lt;/code&gt; elsewhere in the code.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(let* (&#xA;    (my-func&#xA;      (lambda (arg1 arg2 arg3)&#xA;        (message &quot;arg1: %s | arg2: %s | arg3: %s&quot; arg1 arg2 arg3)))&#xA;    (my-list (list my-func '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;))))&#xA;  (apply 'funcall (car my-list) (car (cdr my-list)))&#xA;  (message &quot;I want my-func to appear as \&quot;my-func\&quot;:  %s&quot; (car my-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-07T20:59:10.883" Title="Display lambda expression as let-bound symbol" Tags="|symbol-function|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30532" PostTypeId="1" CreationDate="2017-02-07T19:55:57.630" Score="5" ViewCount="228" Body="&lt;p&gt;I work a lot with Typescript files for Angular 2. The whole HTML structure is packaged in a quote. I would like to select that quote, and edit it in another mode (HTML/Web mode), then save it back to the buffer with the Typescript mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I knew there is another package for that, but I cannot find it back. Even not on emacs.zeef.com and Google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone recognize which package I mean? &lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2018-02-14T00:11:11.180" Title="Package for inline editing in another major mode" Tags="|major-mode|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30533" PostTypeId="1" AcceptedAnswerId="30541" CreationDate="2017-02-07T19:58:39.740" Score="13" ViewCount="6341" Body="&lt;p&gt;How do I highlight a region and it make it remain highlighted when point moves on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would I want that? So I can make important snippets of code stand out when I review it later. &lt;/p&gt;&#xA;" OwnerUserId="14842" LastActivityDate="2022-07-07T10:16:28.947" Title="Highlight region" Tags="|highlighting|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30534" PostTypeId="1" CreationDate="2017-02-07T20:07:36.540" Score="2" ViewCount="239" Body="&lt;p&gt;&lt;code&gt;add-face-text-property&lt;/code&gt; is very convenient for adjusting the face of text based on text properties (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Changing Text Properties&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; Is there an existing equivalent to &lt;code&gt;add-face-text-property&lt;/code&gt; to add face properties to &lt;em&gt;overlays&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise something like this should be sufficient (and maybe should be a feature request):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/add-face-overlay-property (overlay face &amp;amp;optional append)&#xA;  &quot;Add the face property to OVERLAY.  FACE specifies the face to add.&#xA;It should be a valid value of the `face' property (typically a&#xA;face name or a plist of face attributes and values).&#xA;&#xA;If the overlay already has a non-nil `face' property, those&#xA;face(s) are retained.  This is done by setting the `face'&#xA;property to a list of faces, with FACE as the first element (by&#xA;default) and the pre-existing faces as the remaining elements.&#xA;&#xA;If optional fourth argument APPEND is non-nil, append FACE to the end&#xA;of the face list instead.&quot;&#xA;  (overlay-put overlay 'face&#xA;               (if (plist-member overlay 'face)&#xA;                   (if append&#xA;                       (list (plist-get overlay 'face) face)&#xA;                     (list face (plist-get overlay 'face)))&#xA;                 face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-02-07T20:07:36.540" Title="Equivalent of add-face-text-property for overlays?" Tags="|faces|overlays|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30535" PostTypeId="2" ParentId="19317" CreationDate="2017-02-07T20:08:11.087" Score="0" Body="&lt;p&gt;As strictly defining in the &lt;a href=&quot;http://orgmode.org/manual/Quoting-HTML-tags.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; there are several methods how to quote literal code. I've tested this one and it works fine in Org-mode 9.0.4&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_EXPORT html                                                                                                            &#xA;---                                                                                                                            &#xA;layout: post                                                                                                                   &#xA;title: Write Python programs                                                                                                   &#xA;tagline: &quot; by means of Emacs' toolbox&quot;                                                                                         &#xA;permalink: /coding/codewars-toy-tasks.html                                                                                     &#xA;categories: [literate programming, Python, CodeWars, emacs]                                                                    &#xA;tags: [coding, algorithms, org-mode-9, practice, TDD]                                                                          &#xA;---                                                                                                                            &#xA;#+END_EXPORT &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11191" LastActivityDate="2017-02-07T20:08:11.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30537" PostTypeId="2" ParentId="30533" CreationDate="2017-02-07T20:36:08.910" Score="7" Body="&lt;p&gt;Are you looking for &lt;code&gt;hi-lock-mode&lt;/code&gt;? You can highlight matching regexps or highlight regions by using highlight-phrase: &lt;code&gt;C-x w p phrase RET face RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Highlight-Interactively.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Highlight-Interactively.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9881" LastActivityDate="2017-02-07T20:36:08.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30538" PostTypeId="2" ParentId="30530" CreationDate="2017-02-07T20:59:10.883" Score="2" Body="&#xA;&#xA;&lt;p&gt;Assuming you are using dynamic binding you can search through the obarray for your value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;; Assumes dynamic binding.  This is a macro because a function would&#xA;;;; introduce more bound variables that could hide the thing we're&#xA;;;; looking for.&#xA;(defmacro find-local-val (val)&#xA;  (let ((sym-var (make-symbol &quot;sym&quot;))&#xA;        (val-var (make-symbol &quot;val&quot;)))&#xA;    `(catch 'varname&#xA;       (let ((,val-var ,val))&#xA;         (mapatoms (lambda (,sym-var)&#xA;                     (when (and (boundp ,sym-var)&#xA;                                (eq (symbol-value ,sym-var) ,val-var))&#xA;                       (throw 'varname ,sym-var))))&#xA;         (error &quot;Couldn't find a name for %S&quot; ,val-var)))))&#xA;&#xA;(let* ((my-func&#xA;        (lambda (arg1 arg2 arg3)&#xA;          (message &quot;arg1: %s | arg2: %s | arg3: %s&quot; arg1 arg2 arg3)))&#xA;       (my-list (list my-func '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;))))&#xA;  (apply (car my-list) (car (cdr my-list)))&#xA;  (message &quot;I want my-func to appear as \&quot;my-func\&quot;:  %s&quot;&#xA;           (find-local-val (car my-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This won't work if &lt;code&gt;my-func&lt;/code&gt; is a lexical variable.  Another possibility which always works is to bind with &lt;code&gt;cl-letf&lt;/code&gt; and call it by symbol instead of value:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(cl-letf (((symbol-function 'my-func)&#xA;           (lambda (arg1 arg2 arg3)&#xA;             (message &quot;arg1: %s | arg2: %s | arg3: %s&quot; arg1 arg2 arg3))))&#xA;  (let ((my-list (list #'my-func '(&quot;foo&quot; &quot;bar&quot; &quot;baz&quot;))))&#xA;    (apply (car my-list) (car (cdr my-list)))&#xA;    (message &quot;I want my-func to appear as \&quot;my-func\&quot;:  %s&quot;&#xA;             (car my-list))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-02-07T20:59:10.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30539" PostTypeId="2" ParentId="30520" CreationDate="2017-02-07T22:04:50.030" Score="27" Body="&lt;p&gt;There is both a hook for evaluating code blocks (&lt;code&gt;org-babel-after-execute-hook&lt;/code&gt;), and a function for updating inline images. (&lt;code&gt;org-redisplay-inline-images&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combine these two and you should be good to go!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fkTRE.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fkTRE.gif&quot; alt=&quot;C-c C-c updating inline images&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2039" LastEditorUserId="2039" LastEditDate="2017-02-07T22:11:16.503" LastActivityDate="2017-02-07T22:11:16.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30540" PostTypeId="2" ParentId="595" CreationDate="2017-02-07T23:23:20.630" Score="4" Body="&lt;p&gt;&lt;strong&gt;[WARNING]&lt;/strong&gt; Mouse dependency&lt;/p&gt;&#xA;&lt;p&gt;What about &lt;code&gt;artist-mode&lt;/code&gt; + &lt;code&gt;ditaa&lt;/code&gt; ?&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;artist-mode&lt;/code&gt;- Mouse use drawer in ASCII style like simple analog &lt;a href=&quot;https://monodraw.helftone.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Monodraw&lt;/a&gt; for macOS. On exit we have text file in ASCII graph.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;ditaa&lt;/code&gt; - can convert ur text file to image/html etc.&lt;/p&gt;&#xA;&lt;p&gt;its useful for start using emacs for build UML. But this way use mouse so hard.&#xA;However, I'm hate mouse, like most emacs users, and I'm use &lt;a href=&quot;https://github.com/skuro/plantuml-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;plantUML&lt;/a&gt; in org-mode. Its keyboard friendly and epic useful tool for any uml styles.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.lysator.liu.se/%7Etab/artist/&quot; rel=&quot;nofollow noreferrer&quot;&gt;artis-mode&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://ditaa.sourceforge.net&quot; rel=&quot;nofollow noreferrer&quot;&gt;ditaa&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14847" LastEditorUserId="14847" LastEditDate="2023-08-31T13:16:14.317" LastActivityDate="2023-08-31T13:16:14.317" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="30541" PostTypeId="2" ParentId="30533" CreationDate="2017-02-08T00:13:25.647" Score="12" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/HighlightLibrary&quot; rel=&quot;noreferrer&quot;&gt;Highlight&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/highlight.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;highlight.el&lt;/code&gt;&lt;/a&gt;) lets you highlight any number of regions in various ways, including using regexps, using any number of faces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One easy way to highlight an expanse of text (and have it persist until you remove it) is to sweep your mouse over it - &lt;em&gt;like using a highlighter pen&lt;/em&gt;.  This is command &lt;strong&gt;&lt;code&gt;hlt-highlighter&lt;/code&gt;&lt;/strong&gt;.  By default, the command is bound to &lt;code&gt;C-x down-mouse-2&lt;/code&gt;, which means that you use it by hitting &lt;code&gt;C-x X&lt;/code&gt; and then pressing and dragging &lt;code&gt;mouse-2&lt;/code&gt; (the second or middle mouse button) across the text.  With a prefix argument (i.e., &lt;code&gt;C-u C-x X&lt;/code&gt; + drag &lt;code&gt;mouse-2&lt;/code&gt;) you are prompted for the face to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(By default, &lt;strong&gt;&lt;code&gt;C-x X&lt;/code&gt;&lt;/strong&gt; is the prefix key that keymap &lt;code&gt;hlt-map&lt;/code&gt; is bound to.  Lots of highlighting and highlight-erasing keys are bound in that map.  You can put the keymap on any other prefix key or bind individual highlighting and erasing commands to more convenient keys.  I put &lt;code&gt;hlt-highlighter&lt;/code&gt; on &lt;code&gt;C-x down-mouse-2&lt;/code&gt;, for example.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A quick and easy way to highlight a &lt;em&gt;single&lt;/em&gt; region of text, and have that highlighting persist until you put it on a different region, is to use the &lt;a href=&quot;https://www.emacswiki.org/emacs/SecondarySelection&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;secondary selection&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that, just press and hold the Meta key (typically &lt;code&gt;Alt&lt;/code&gt;) while you drag &lt;code&gt;mouse-1&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/second-sel.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;second-sel.el&lt;/code&gt;&lt;/a&gt; then you can access any number of such secondary selections on a ring, among other features.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2019-01-15T05:12:37.403" LastActivityDate="2019-01-15T05:12:37.403" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="30542" PostTypeId="2" ParentId="30518" CreationDate="2017-02-08T03:41:35.263" Score="2" Body="&lt;p&gt;ah, turns out it's the &lt;code&gt;web-mode-indentation-params&lt;/code&gt; list:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-to-list '(web-mode-indentation-params) '(&quot;lineup-calls&quot; . nil))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="14773" LastActivityDate="2017-02-08T03:41:35.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30543" PostTypeId="1" AcceptedAnswerId="30545" CreationDate="2017-02-08T06:20:43.657" Score="3" ViewCount="757" Body="&lt;p&gt;I have the command &lt;code&gt;kill-this-buffer&lt;/code&gt; bound to &lt;code&gt;C-x C-x&lt;/code&gt;. yet it seems it doesn't work in all buffers (such as the calendar month view etc. yet the emacs menu &lt;code&gt;close&lt;/code&gt; always does work. whats the difference between the two (the menu &lt;code&gt;close&lt;/code&gt; doesn't seem to have a keybind) and how does one bind it to a key?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="253" LastEditDate="2017-02-08T14:41:58.033" LastActivityDate="2017-02-09T00:46:13.760" Title="kill-this-buffer doesn't work in all buffers yet the emacs menu &quot;close&quot; does, what's the difference?" Tags="|key-bindings|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30544" PostTypeId="1" CreationDate="2017-02-08T06:42:18.263" Score="2" ViewCount="150" Body="&lt;p&gt;How can I get sensible stack-like behavior from a bottom side-window? I've configured both Ag and Help to display their buffers using &lt;code&gt;display-buffer-in-side-window&lt;/code&gt;. I like to maintain a window configuration like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+-----------+    +-----------+&#xA;|           |    |           |&#xA;|           |    |     A     | &amp;lt;- main workspace&#xA;|     A     | OR |           |&#xA;|           |    +-----------+&#xA;|           |    |     B     | &amp;lt;- search/compilation/help&#xA;+-----------+    +-----------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;strong&gt;A&lt;/strong&gt; is my main work area, and &lt;strong&gt;B&lt;/strong&gt; is acts as a drawer for things like search results, compilation errors, and Help buffers. In most cases, I'd like hitting &lt;code&gt;q&lt;/code&gt; in &lt;strong&gt;B&lt;/strong&gt; to bury the buffer and delete the window. If &lt;strong&gt;B&lt;/strong&gt; was displaying something else prior, I'd like &lt;code&gt;q&lt;/code&gt; to bury the current buffer and reveal the previous buffer. Once I've &lt;code&gt;q&lt;/code&gt;'d out of all the buffers that were displayed in &lt;strong&gt;B&lt;/strong&gt; since it popped up, I'd like the window to be deleted. The buffer in &lt;strong&gt;A&lt;/strong&gt; should &lt;em&gt;not&lt;/em&gt; be part of this buffer stack.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, say I start with &lt;code&gt;my_code.rb&lt;/code&gt; in &lt;strong&gt;A&lt;/strong&gt;. I run a search and Ag pops up &lt;strong&gt;B&lt;/strong&gt; to display the results. Hitting &lt;code&gt;q&lt;/code&gt; buries the Ag buffer and deletes &lt;strong&gt;B&lt;/strong&gt;, leaving me with a clean view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But say instead of &lt;code&gt;q&lt;/code&gt;'ing out of the search results, I ran a help command like describe-variable. A *Help* buffer supplants the search results in &lt;strong&gt;B&lt;/strong&gt;. Hitting &lt;code&gt;q&lt;/code&gt; buries *Help* and the search results are visible again. I hit &lt;code&gt;q&lt;/code&gt; again, expecting it to bury the search results and delete &lt;strong&gt;B&lt;/strong&gt;, but instead it displays &lt;code&gt;my_code.rb&lt;/code&gt; in &lt;strong&gt;B&lt;/strong&gt;, leaving me with an unwanted split view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like the &lt;code&gt;quit-restore&lt;/code&gt; window-parameter controls this, but I'm not sure how to manage it. I inspected its value using at various points during the above flow, and found the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;search results displayed in &lt;strong&gt;B&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(window&#xA;window&#xA;#&amp;lt;window A on my_code.rb&amp;gt;&#xA;#&amp;lt;buffer *ag search text:my-search-term dir:~/my/path/*&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;help buffer displayed in &lt;strong&gt;B&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(other&#xA;(#&amp;lt;buffer *ag search text:my-search-term dir:~/my/path/*&amp;gt; 225&#xA; #&amp;lt;marker (moves after insertion) at 225 in *ag search text:my-search-term dir:~/my/path/*&amp;gt; 12)&#xA;#&amp;lt;window 72 on *ag search text:my-search-term dir:~/my/path/*&amp;gt;&#xA;#&amp;lt;buffer *Help*&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;search results again displayed in &lt;strong&gt;B&lt;/strong&gt; after quitting the Help buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it seems that quitting the Help buffer is causing the &lt;code&gt;quit-restore&lt;/code&gt; window parameter to be discarded wholesale?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, this is my &lt;code&gt;display-buffer-alist&lt;/code&gt; configuration:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; display-buffer-alist&#xA; `((,(rx bos&#xA;         (or (and &quot;*ag &quot; (1+ not-newline) &quot;*&quot;)&#xA;             &quot;*Help*&quot;)&#xA;         eos)&#xA;     (display-buffer-reuse-window&#xA;      display-buffer-in-side-window)&#xA;     (side . bottom))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-02-08T06:42:18.263" Title="Sensible stack-like quit-restore behavior in side-window?" Tags="|window|window-splitting|selected-window|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30545" PostTypeId="2" ParentId="30543" CreationDate="2017-02-08T07:39:23.180" Score="5" Body="&lt;p&gt;In whatever buffer your keyboard shortcut does not work as expected, type &lt;code&gt;C-h k&lt;/code&gt; or &lt;code&gt;M-x describe-key&lt;/code&gt; and then your keyboard shortcut to see what function it is actually bound to -- major-modes and minor-modes can override global key bindings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in the &lt;code&gt;*Calendar*&lt;/code&gt; buffer type &lt;code&gt;C-h k C-x C-x&lt;/code&gt; and see that it is bound to &lt;code&gt;calendar-exchange-point-and-mark&lt;/code&gt;, which is defined in the &lt;code&gt;calendar-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some people like a global minor-mode for custom keybindings, whereas others may chose to unset / remove major-mode and minor-mode bindings that conflict with global-bindings.  And others may choose to assign additional major-mode / minor-mode bindings for certain functions.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-08T07:39:23.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30546" PostTypeId="1" CreationDate="2017-02-08T09:08:08.867" Score="3" ViewCount="381" Body="&lt;p&gt;I have tried running the official Fedora build of emacs under valgrind. It very quickly errors out due to thinking it has run out of memory. This is a known issue mentioned in the Valgrind documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Valgrind documentation says to rebuild emacs with system malloc, so I tried rebuilding emacs from the Fedora srpm, modifying the &lt;code&gt;configure&lt;/code&gt; file to set &lt;code&gt;system_malloc=yes&lt;/code&gt; always. But this has the same issue - it turns out that my modification didn't take effect because &lt;code&gt;configure&lt;/code&gt; gets overwritten by &lt;code&gt;make bootstrap&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So then I modified both &lt;code&gt;configure.ac&lt;/code&gt; and &lt;code&gt;configure&lt;/code&gt; in the same way. This segfaults during the build.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then ran the bootstrap version of emacs (the one that was segfaulting during the build) under Valgrind, which produced what are described as spurious errors. It turns out that dumping doesn't work with Valgrind, so it's recommended to run &lt;code&gt;temacs&lt;/code&gt; instead of &lt;code&gt;emacs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I tried running &lt;code&gt;temacs&lt;/code&gt; from the incomplete build, but it failed to start:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading loadup.el (source)...&#xA;Using load-path (/home/robin/rpmbuild/BUILD/emacs-25.1/build-gtk/../lisp)&#xA;Loading emacs-lisp/byte-run (source)...&#xA;Loading emacs-lisp/byte-run (source)...done&#xA;Loading emacs-lisp/backquote (source)...&#xA;Loading emacs-lisp/backquote (source)...done&#xA;Loading subr (source)...&#xA;Loading subr (source)...done&#xA;Loading version (source)...&#xA;Symbol’s function definition is void: pcase&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;etc/DEBUG&lt;/code&gt; in the emacs source, the following advice is given:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;** Running Emacs built with malloc debugging packages&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If Emacs exhibits bugs that seem to be related to use of memory&#xA;  allocated off the heap, it might be useful to link Emacs with a&#xA;  special debugging library, such as Electric Fence (a.k.a. efence) or&#xA;  GNU Checker, which helps find such problems.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Emacs compiled with such packages might not run without some hacking,&#xA;  because Emacs replaces the system's memory allocation functions with&#xA;  its own versions, and because the dumping process might be&#xA;  incompatible with the way these packages use to track allocated&#xA;  memory.  Here are some of the changes you might find necessary:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&lt;p&gt;Edit configure, to set system_malloc and CANNOT_DUMP to &quot;yes&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Configure with a different --prefix= option.  If you use GCC,&#xA;  version 2.7.2 is preferred, as some malloc debugging packages&#xA;  work a lot better with it than with 2.95 or later versions.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Type &quot;make&quot; then &quot;make -k install&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;If required, invoke the package-specific command to prepare&#xA;  src/temacs for execution.&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;cd ..; src/temacs&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;(Note that this runs 'temacs' instead of the usual 'emacs' executable.&#xA;  This avoids problems with dumping Emacs mentioned above.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, these instructions are not detailed enough to be self-contained - I don't understand how to follow these instructions - beyond setting system_malloc to yes, which I have done.&lt;/p&gt;&#xA;" OwnerUserId="6790" LastActivityDate="2017-02-08T09:08:08.867" Title="How to run emacs under valgrind correctly?" Tags="|build|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30547" PostTypeId="1" AcceptedAnswerId="30553" CreationDate="2017-02-08T10:59:45.993" Score="4" ViewCount="684" Body="&lt;p&gt;I was wondering if org-mode offers a function to sort a list by the item states? So that checked items appear on top and unchecked items at the bottom? For example with this list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [ ] Not yet done&#xA;- [x] Already done&#xA;- [ ] Not yet done&#xA;- [x] Already done&#xA;- [ ] Not yet done&#xA;- [x] Already done&#xA;- [ ] Not yet done&#xA;- [x] Already done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would get this list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- [x] Already done&#xA;- [x] Already done&#xA;- [x] Already done&#xA;- [x] Already done&#xA;- [ ] Not yet done&#xA;- [ ] Not yet done&#xA;- [ ] Not yet done&#xA;- [ ] Not yet done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="970" LastActivityDate="2022-09-15T23:37:14.507" Title="Sort list by checked/unchecked state" Tags="|org-mode|list|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30548" PostTypeId="2" ParentId="26094" CreationDate="2017-02-08T11:33:21.713" Score="5" Body="&lt;p&gt;This can be done very easily with hooks for major-modes like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook (lambda ()&#xA;                              (highlight-indent-guides-mode -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If for some reason this did not work, you could try something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (add-hook 'prog-mode-hook (lambda ()&#xA;                              (unless (eq major-mode 'python-mode)&#xA;                                (highlight-indent-guides-mode))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12247" LastActivityDate="2017-02-08T11:33:21.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30549" PostTypeId="1" CreationDate="2017-02-08T11:35:37.233" Score="2" ViewCount="292" Body="&lt;p&gt;I have the following folder structure:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;~/org/notes/x.org&lt;/code&gt; with notes in org files&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;~/org/presentations/y.org&lt;/code&gt; with reveal.js presentations in org files&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;~/org/img/demo.png&lt;/code&gt; with static images used in notes and presentations&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I now want to publish all of them to &lt;code&gt;~/public_html/&lt;/code&gt;. My spacemacs config contains the following configuration, which does not work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-publish-project-alist&#xA;    '(&#xA;      (&quot;org-presentations&quot;&#xA;       :base-directory &quot;~/org/presentations&quot;&#xA;       :base-extension &quot;org&quot;&#xA;       :publishing-directory &quot;~/public_html/presentations&quot;&#xA;       :recursive t&#xA;       :auto-sitemap t&#xA;       :publishing-function org-reveal-export-to-html&#xA;       :with-sub-superscript nil&#xA;       :headline-levels 4             ; Just the default for this project.&#xA;       :auto-preamble t)&#xA;&#xA;      (&quot;org-notes&quot;&#xA;       :base-directory &quot;~/org/notes&quot;&#xA;       :base-extension &quot;org&quot;&#xA;       :publishing-directory &quot;~/public_html/notes&quot;&#xA;       :recursive t&#xA;       :auto-sitemap t&#xA;       :publishing-function org-twbs-publish-to-html&#xA;       ;;:publishing-function org-publish&#xA;       :with-sub-superscript nil&#xA;       :headline-levels 4             ; Just the default for this project.&#xA;       :auto-preamble t)&#xA;&#xA;      (&quot;org-static&quot;&#xA;       :base-directory &quot;~/org/img/&quot;&#xA;       :base-extension &quot;css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf&quot;&#xA;       :publishing-directory &quot;~/public_html/img/&quot;&#xA;       :recursive t&#xA;       :publishing-function org-publish-attachment)&#xA;&#xA;      (&quot;org&quot; :components (&quot;org-notes&quot; &quot;org-presentations&quot; &quot;org-static&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The presentations don't get published. Any idea for the correct publishing-function for reveal.js presentations?&lt;/p&gt;&#xA;" OwnerUserId="10903" LastActivityDate="2017-12-13T16:41:56.580" Title="Include reveal.js presentation in publish process" Tags="|org-mode|org-publish|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30550" PostTypeId="1" AcceptedAnswerId="30552" CreationDate="2017-02-08T12:09:46.277" Score="1" ViewCount="226" Body="&lt;p&gt;With company-mode on in shell-mode, if I'm in ~/bin I can get completions if I type &lt;code&gt;~/bin/someprog&lt;/code&gt; or even &lt;code&gt;../bin/someprog&lt;/code&gt; but not &lt;code&gt;./someprog&lt;/code&gt; – is there some setting to fix this?&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2017-03-10T13:13:16.640" Title="company-mode in shell-mode doesn't complete ./executables" Tags="|company-mode|shell-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30551" PostTypeId="2" ParentId="30547" CreationDate="2017-02-08T12:11:59.413" Score="1" Body="&lt;p&gt;I don't know if Org has the function, but since the list is well-organized,&#xA;you can simply use Emacs' sorting commands (see&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Sorting.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(info &quot;(emacs) Sorting&quot;)&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't mind changing exiting order, select the list and &lt;code&gt;M-x sort-lines&lt;/code&gt;, this command simply sorts lines in region alphabetically. If you mind, you can use &lt;strong&gt;one&lt;/strong&gt; of the following two methods.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select the region from the first &lt;code&gt;[&lt;/code&gt; to the last &lt;code&gt;]&lt;/code&gt; and &lt;code&gt;C-u M-x sort-columns&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Select the list and type &lt;code&gt;C-u M-x sort-regexp-fields RET ^.*$ RET \[.\] RET&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Note that &lt;code&gt;- [ ]&lt;/code&gt; is lexicographically smaller than &lt;code&gt;- [x]&lt;/code&gt; since ASCII code of &lt;code&gt;&lt;/code&gt; (white space) is 32 and &lt;code&gt;x&lt;/code&gt;'s is 120).&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-02-08T12:11:59.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30552" PostTypeId="2" ParentId="30550" CreationDate="2017-02-08T12:20:54.630" Score="1" Body="&lt;p&gt;This seems to be the reason: &lt;a href=&quot;https://stackoverflow.com/a/220960/69663&quot;&gt;https://stackoverflow.com/a/220960/69663&lt;/a&gt;&#xA;A &lt;code&gt;M-x shell-resync-dirs&lt;/code&gt; after using &lt;a href=&quot;https://github.com/clvv/fasd&quot; rel=&quot;nofollow noreferrer&quot;&gt;fasd&lt;/a&gt; to change dirs fixes it. It'd be nice if &lt;code&gt;comint-dynamic-complete-filename&lt;/code&gt; or what it is could simply check &lt;code&gt;/proc/$$/cwd&lt;/code&gt; instead …&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-02-08T12:20:54.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30553" PostTypeId="2" ParentId="30547" CreationDate="2017-02-08T13:51:10.107" Score="4" Body="&lt;p&gt;&lt;code&gt;org-sort&lt;/code&gt; (bound to &lt;kbd&gt;C-c ^&lt;/kbd&gt;) on a plain list will prompt for the sort method. One of the sorting options is &lt;em&gt;[x]checked&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So &lt;kbd&gt;C-c ^ x&lt;/kbd&gt; will do the job.&lt;/p&gt;&#xA;&lt;p&gt;If you want to sort the items from checked to unchecked, use a capital &lt;kbd&gt;X&lt;/kbd&gt;&lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="38365" LastEditDate="2022-09-15T23:37:14.507" LastActivityDate="2022-09-15T23:37:14.507" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30554" PostTypeId="2" ParentId="30378" CreationDate="2017-02-08T14:06:42.263" Score="0" Body="&lt;p&gt;I've done a bit of additional research on this and it looks like the org-html-publish-to-html function just doesn't work with files that are being edited. I found one workaround, but it requires that your files be checked into a git repo. This would ensure that none of your files are in the process of being edited when the publish function runs, but it's also not something that I'm interested in for this particular site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I'll just have to use org to remind me to periodically publish my site manually :-) &lt;/p&gt;&#xA;" OwnerUserId="8228" LastActivityDate="2017-02-08T14:06:42.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30555" PostTypeId="1" AcceptedAnswerId="30556" CreationDate="2017-02-08T15:41:45.747" Score="1" ViewCount="1010" Body="&lt;p&gt;I have spacemacs and when I edit a &lt;code&gt;.py&lt;/code&gt; or &lt;code&gt;.c&lt;/code&gt; file line numbering is turned on no problem, however when I open a &lt;code&gt;.R&lt;/code&gt; file it isn't there (the mode is named &lt;code&gt;ESS[S]&lt;/code&gt; to be precise). How can I turn it on here too ?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastActivityDate="2017-02-08T16:03:06.027" Title="How to turn on line numbering on modes that doesn't have by default?" Tags="|spacemacs|line-numbers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30556" PostTypeId="2" ParentId="30555" CreationDate="2017-02-08T16:03:06.027" Score="1" Body="&lt;p&gt;You have to turn &lt;code&gt;linum-mode&lt;/code&gt; on after starting &lt;code&gt;ess-mode&lt;/code&gt;. This mode takes care of adding line numbers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(add-hook 'ess-mode-hook 'linum-mode)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2017-02-08T16:03:06.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30557" PostTypeId="1" CreationDate="2017-02-08T16:19:47.377" Score="0" ViewCount="105" Body="&lt;p&gt;I'm using Emacs 24 in Ubuntu 14.04 and when first compiling a TeX file after start up, a frame called &lt;code&gt;*tex-shell*&lt;/code&gt; is automatically opened and all further compilation processes run in this frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually move this frame to another workspace (&quot;desktop&quot;), so my editing appears in my main workspace and compilation in a secondary one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be optimal if this new frame appeared directly in this secondary workspace, but I presume that this is kinda difficult. In any case, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to know if there is a way of choosing the geometry of the frame, in the sense that it has the same size and the same position in the screen every time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Actually, it seems that the geometry is always the same, but when I changed from Emacs 23 to Emacs 24 this parameter changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any help, and specially if you know something about automatically selecting workspaces.&lt;/p&gt;&#xA;" OwnerUserId="14849" LastActivityDate="2017-02-08T16:19:47.377" Title="How to specify the geometry of the *tex-shell* frame?" Tags="|latex|frames|ubuntu|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30558" PostTypeId="2" ParentId="30490" CreationDate="2017-02-08T16:38:12.003" Score="2" Body="&lt;p&gt;Instead of typing its name manually, you can also copy-and-paste if it&#xA;is easier. Though implementing isearch's completely means lots of&#xA;work, you can make a very simple one which might suit 80% of your&#xA;needs&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-minibuffer-yank-word ()&#xA;  &amp;quot;Yank word at point in the buffer when entering text into minibuffer.&amp;quot;&#xA;  (interactive)&#xA;  (with-selected-window (minibuffer-selected-window)&#xA;    (when-let ((word (current-word)))&#xA;      (with-selected-window (active-minibuffer-window)&#xA;        (insert word)))))&#xA;&#xA;(define-key minibuffer-local-map &amp;quot;\C-w&amp;quot; #'my-minibuffer-yank-word)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If you use Helm, (&lt;kbd&gt;C-w&lt;/kbd&gt;) already does what you want. Helm provides the similar feature on the same keybinding (&lt;kbd&gt;C-w&lt;/kbd&gt;) like isearch.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="19526" LastEditDate="2023-03-27T14:21:57.640" LastActivityDate="2023-03-27T14:21:57.640" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30559" PostTypeId="1" AcceptedAnswerId="31403" CreationDate="2017-02-08T16:40:22.117" Score="14" ViewCount="11852" Body="&lt;p&gt;I wish to display org mode inline image (in emacs) with width 400 but actually it always show it as original size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My steps as below:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install ImageMagick with below command:&#xA;&lt;code&gt;&#xA;sudo port install imagemagick&#xA;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Install emacs with below command:&#xA;&lt;code&gt;&#xA;brew install emacs --HEAD --use-git-head --cocoa --with-gnutls --with-rsvg --with-imagemagick&#xA;&lt;/code&gt;&#xA;Then I check it, emacs version is &lt;code&gt;GNU Emacs 26.0.50.1&lt;/code&gt;, but &lt;code&gt;(image-type-available-p 'imagemagick)&lt;/code&gt; result is &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Edit ~/.emacs.d/init.el to add below line:&#xA;&lt;code&gt;&#xA;(setq org-image-actual-width nil)&#xA;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Write below org code in test.org:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;    #+ATTR_ORG: :width 400&#xA;    [[file:test.png]]&#xA;&lt;/code&gt;&#xA;5. After run &lt;code&gt;C-c C-x C-v&lt;/code&gt;,Image not displayed as 400 but actual size.&lt;/p&gt;&#xA;" OwnerUserId="14840" LastEditorUserId="105" LastEditDate="2017-02-08T18:33:04.267" LastActivityDate="2018-10-16T10:21:04.393" Title="org mode inline image display size" Tags="|org-mode|images|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30560" PostTypeId="2" ParentId="30559" CreationDate="2017-02-08T17:14:34.710" Score="14" Body="&lt;pre&gt;&lt;code&gt;(setq org-image-actual-width 400)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should do the job. The documentation of the variable (&lt;code&gt;C-h v org-image-actual-width RET&lt;/code&gt;) gives more detail:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-image-actual-width is a variable defined in ‘org.el’.&#xA;  Its value is t&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&#xA;  Should we use the actual width of images when inlining them?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When set to t, always use the image width.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When set to a number, use imagemagick (when available) to set&#xA;  the image’s width to this value.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When set to a number in a list, try to get the width from any&#xA;  #+ATTR.* keyword if it matches a width specification like&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :width 300px&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;and fall back on that number if none is found.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;When set to nil, try to get the width from an #+ATTR.* keyword&#xA;  and fall back on the original width if none is found.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This requires Emacs &gt;= 24.1, build(sic) with imagemagick support.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2018-10-16T10:21:04.393" LastActivityDate="2018-10-16T10:21:04.393" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="30562" PostTypeId="1" AcceptedAnswerId="30565" CreationDate="2017-02-08T17:26:03.060" Score="0" ViewCount="134" Body="&lt;p&gt;I'm using iTerm2 and have my &lt;code&gt;left option&lt;/code&gt; key set to &lt;code&gt;+Esc&lt;/code&gt;. I can backwards delete words in &lt;code&gt;bash&lt;/code&gt; with &lt;code&gt;M-Del&lt;/code&gt; (&lt;code&gt;option-Del&lt;/code&gt;) but in emacs, &lt;code&gt;M-Del&lt;/code&gt; doesn't backwards delete words, it just changes the location of the cursor/point ~150 lines down in the text and then displays &lt;code&gt;Mark set&lt;/code&gt; in the echo area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone know what's going on?&lt;/p&gt;&#xA;" OwnerUserId="14852" LastActivityDate="2017-02-08T18:30:07.100" Title="emacs doesn't backwards delete words with M-Del" Tags="|keymap|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30563" PostTypeId="1" CreationDate="2017-02-08T17:27:26.857" Score="2" ViewCount="151" Body="&lt;p&gt;When working on huge files, it seems that when &lt;code&gt;hide-show&lt;/code&gt; collapses a large multi-line block, &lt;code&gt;linum&lt;/code&gt; still creates hidden overlays for every line in the hidden block leading to unresponsive emacs. Is there a way to fix &lt;code&gt;linum&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To reproduce: Create a new file, enable &lt;code&gt;c-mode&lt;/code&gt;, &lt;code&gt;hs-minor-mode&lt;/code&gt; and &lt;code&gt;linum-mode&lt;/code&gt;,&#xA;create a huge block by typing: &lt;code&gt;{ C-u 10000 RET }&lt;/code&gt;&#xA;then execute &lt;code&gt;hs-hide-all&lt;/code&gt; and watch Emacs become unresponsive.&lt;/p&gt;&#xA;" OwnerUserId="14853" LastActivityDate="2017-02-08T17:27:26.857" Title="hide-show with linum" Tags="|performance|linum-mode|hideshow|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30564" PostTypeId="2" ParentId="30559" CreationDate="2017-02-08T17:56:43.943" Score="6" Body="&lt;p&gt;In your step 2, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(image-type-available-p 'imagemagick)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should return &lt;code&gt;t&lt;/code&gt;. &lt;code&gt;nil&lt;/code&gt; is for unavailable. Perhaps the reason you get &lt;code&gt;nil&lt;/code&gt; is the paths from macports install of imagemagick is not being picked up by the brew install of emacs. Have you noticed any compile errors to that effect? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, adjust the path to imagemagick manually or install it from brew as well. Installing both imagemagick and emacs from macports works for me.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-02-08T17:56:43.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30565" PostTypeId="2" ParentId="30562" CreationDate="2017-02-08T18:30:07.100" Score="0" Body="&lt;p&gt;The issue was in my iTerm2 settings. I had the &lt;code&gt;Option - Delete&lt;/code&gt; mapped to send certain hex codes in the &quot;Keys&quot; tab in settings. NB, there are key mapping settings in the &quot;Keys&quot; and &quot;Profiles&quot; tabs in settings, so you could have key mappings in either place doing something with unintended effects.&lt;/p&gt;&#xA;" OwnerUserId="14852" LastActivityDate="2017-02-08T18:30:07.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30566" PostTypeId="2" ParentId="9583" CreationDate="2017-02-08T19:13:00.110" Score="0" Body="&lt;p&gt;I actually quite like this behavior since I might want to just edit a part of the word and keep the other parts intact. If I want to go over the whole word I can always use &lt;code&gt;E&lt;/code&gt;, &lt;code&gt;W&lt;/code&gt; or &lt;code&gt;B&lt;/code&gt;, the uppercase variants. This gives me more fine-grained control.&lt;/p&gt;&#xA;" OwnerUserId="7097" LastActivityDate="2017-02-08T19:13:00.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30567" PostTypeId="5" CreationDate="2017-02-08T20:23:37.127" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-08T20:23:37.127" LastActivityDate="2017-02-08T20:23:37.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30568" PostTypeId="4" CreationDate="2017-02-08T20:23:37.127" Score="0" Body="MobileOrg is a companion mobile app that runs on iOS and Android devices. MobileOrg enables offline-views and capture support for an Org mode system that is rooted on a “real” computer. MobileOrg can record changes to existing entries.&#xD;&#xA;&#xD;&#xA;Use mobileorg tag for both the external application and org-mobile-push and org-mobile-pull features of Org mode." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-08T22:05:29.893" LastActivityDate="2017-02-08T22:05:29.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30570" PostTypeId="1" AcceptedAnswerId="30572" CreationDate="2017-02-08T22:39:02.367" Score="9" ViewCount="2225" Body="&lt;p&gt;I'm trying to perform a search and replace in &lt;code&gt;spacemacs&lt;/code&gt; but I need it to be case sensitive when by default it appears to be case insensitive. So I try to do &lt;code&gt;:set noignorecase&lt;/code&gt; but then I have this error message :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;State noignore case cannot be set as initial evil state&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Any idea how to perform a case sensitive search and replace with &lt;code&gt;spacemacs&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="11673" LastEditorUserId="105" LastEditDate="2017-02-08T23:06:12.797" LastActivityDate="2023-02-25T10:03:27.207" Title="how do I do case sensitive searches using evil/spacemacs?" Tags="|spacemacs|evil|search|replace|case-folding|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30571" PostTypeId="2" ParentId="30543" CreationDate="2017-02-08T22:39:05.640" Score="1" Body="&lt;p&gt;The menu bar's &lt;code&gt;close&lt;/code&gt; invokes &lt;code&gt;kill-this-buffer&lt;/code&gt;. The problem, as &lt;a href=&quot;https://emacs.stackexchange.com/a/30545/10269&quot;&gt;@lawlist describes&lt;/a&gt;, is that your global &lt;code&gt;C-x C-x&lt;/code&gt; binding is being overwritten by &lt;code&gt;calendar-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c &amp;lt;letter&amp;gt;&lt;/code&gt; key sequences are &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Major-Mode-Conventions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;reserved for the user&lt;/a&gt;, so try a global binding such as &lt;code&gt;C-c k&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that &lt;code&gt;kill-this-buffer&lt;/code&gt; is part of the &lt;code&gt;menu-bar&lt;/code&gt; package (written long before the convention that all symbols of a package need to be prefixed by the package name was strictly enforced). The code is as below:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun kill-this-buffer ()  ; for the menu bar&#xA;  &quot;Kill the current buffer.&#xA;When called in the minibuffer, get out of the minibuffer&#xA;using `abort-recursive-edit'.&quot;&#xA;  (interactive)&#xA;  (cond&#xA;   ;; Don't do anything when `menu-frame' is not alive or visible&#xA;   ;; (Bug#8184).&#xA;   ((not (menu-bar-menu-frame-live-and-visible-p)))&#xA;   ((menu-bar-non-minibuffer-window-p)&#xA;    (kill-buffer (current-buffer)))&#xA;   (t&#xA;    (abort-recursive-edit))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've experienced issues with it not working sometimes (presumably when &lt;code&gt;(not (menu-bar-menu-frame-live-and-visible-p))&lt;/code&gt;), so I just bind &lt;code&gt;C-c k&lt;/code&gt; to &lt;code&gt;(lambda () (interactive) (kill-buffer (current-buffer)))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-02-09T00:46:13.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30572" PostTypeId="2" ParentId="30570" CreationDate="2017-02-08T22:52:06.823" Score="8" Body="&lt;h3&gt;Short and narrow answer&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You need to set the variable &lt;code&gt;case-fold-search&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in order&#xA;to have case sensitive search.  So: put this somewhere in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq case-fold-search nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See the manual node&#xA;on&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Search-Case.html&quot; rel=&quot;noreferrer&quot;&gt;Searching and Case&lt;/a&gt; for&#xA;more details.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Some background explanation&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;spacemacs&lt;/code&gt; relies heavily on &lt;code&gt;evil&lt;/code&gt;, which emulates Vim.  In&#xA;general, you should not expect it to accept all (or even most) of&#xA;Vim's syntax.  &lt;code&gt;:set noignorecase&lt;/code&gt; is straight out of Vim, but&#xA;there is no &lt;code&gt;set&lt;/code&gt; command in &lt;code&gt;evil&lt;/code&gt;'s limited set of &lt;code&gt;ex&lt;/code&gt;&#xA;commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you got the error messages you did is (I think) because&#xA;&lt;code&gt;evil&lt;/code&gt; tries to match partially completed commands.  In browsing&#xA;through the list of &lt;code&gt;ex&lt;/code&gt; commands &lt;code&gt;evil&lt;/code&gt; emulates (hit &lt;code&gt;C-h v&#xA;evil-ex-commands&lt;/code&gt; to see the list), the &lt;em&gt;only&lt;/em&gt; command that starts&#xA;with &lt;code&gt;set&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;set-initial-state&quot; . evil-ex-set-initial-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, in effect, you tried to tell Emacs to set &lt;code&gt;evil&lt;/code&gt;'s initial&#xA;state to &lt;code&gt;noignorecase&lt;/code&gt; -- which doesn't exist, and is not at all what you intended to do.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-02-08T22:52:06.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30574" PostTypeId="1" AcceptedAnswerId="30576" CreationDate="2017-02-09T01:13:14.630" Score="1" ViewCount="180" Body="&lt;p&gt;To know which theme is active ATM one could look in &lt;code&gt;custom-enabled-themes&lt;/code&gt;, which is a list containing the theme name as a symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But consider the following example case. You've installed the latest version of &lt;code&gt;leuven-theme&lt;/code&gt; from MELPA and now it is your current loaded theme. Since Emacs ships an older version of &lt;code&gt;leuven-theme&lt;/code&gt;, which one is active, the version from MELPA or the default in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can you get the current theme's file path instead of just the name?&lt;/p&gt;&#xA;" OwnerUserId="920" LastActivityDate="2017-02-09T01:39:39.883" Title="Retrieve current theme's file path instead of its name as a symbol" Tags="|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30575" PostTypeId="1" AcceptedAnswerId="30892" CreationDate="2017-02-09T01:21:09.507" Score="5" ViewCount="5460" Body="&lt;p&gt;In latex export of orgmode, I would like to be able to add &lt;code&gt;#+LATEX: \newpage&lt;/code&gt; before a heading with &lt;code&gt;newpage&lt;/code&gt; tag, so I don't have to manually specify &lt;code&gt;#+LATEX: \newpage&lt;/code&gt; when I want a heading to be on a new page. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems I can add a hook to &lt;code&gt;org-export-before-parsing-hook&lt;/code&gt;, but I have not been able to do it. The following code successfully adds &lt;code&gt;#+LATEX: \newpage&lt;/code&gt; before a heading with &lt;code&gt;newpage&lt;/code&gt; tag, but when I try to add &lt;code&gt;\n&lt;/code&gt; (&lt;code&gt;(insert-string &quot;#+LATEX: \\newpage\n&quot;)&lt;/code&gt;), exporting gets stuck with the message &lt;code&gt;org-babel-exp process txt at position 280541...&lt;/code&gt;. I suspect inserting &lt;code&gt;\n&lt;/code&gt; messes up the position.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org/parse-headings (backend)&#xA;  (if (member backend '(latex))&#xA;      (org-map-entries&#xA;       (lambda ()&#xA;         (progn&#xA;           (insert-string &quot;#+LATEX: \\newpage&quot;)&#xA;           ))&#xA;       &quot;+newpage&quot;)&#xA;    )&#xA;)&#xA;&#xA;(add-hook 'org-export-before-parsing-hook 'org/parse-headings)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6807" LastActivityDate="2017-04-05T08:04:57.970" Title="Adding #+LATEX: \newpage before a heading" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30576" PostTypeId="2" ParentId="30574" CreationDate="2017-02-09T01:39:39.883" Score="2" Body="&lt;p&gt;&lt;code&gt;load-theme&lt;/code&gt; does &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/custom.el#L1212&quot; rel=&quot;nofollow noreferrer&quot;&gt;the following&lt;/a&gt; to get the theme's path:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(locate-file (concat (symbol-name theme) &quot;-theme.el&quot;)&#xA;             (custom-theme--load-path)&#xA;             '(&quot;&quot; &quot;c&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if you just did &lt;code&gt;M-x load-theme leuven&lt;/code&gt;, that'll be your path.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-02-09T01:39:39.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30577" PostTypeId="1" AcceptedAnswerId="30641" CreationDate="2017-02-09T05:58:31.963" Score="2" ViewCount="83" Body="&lt;p&gt;On creation of an overlay it's possible to specify the &quot;insertion type&quot; / advance behavior of the beginning and end markers:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(make-overlay BEG END &amp;amp;optional BUFFER FRONT-ADVANCE REAR-ADVANCE)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's possible to change the insertion behavior for markers directly:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(set-marker-insertion-type MARKER TYPE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Set the insertion-type of MARKER to TYPE.&#xA;  If TYPE is t, it means the marker advances when you insert text at it.&#xA;  If TYPE is nil, it means the marker stays behind when you insert text at it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Managing-Overlays.html#Managing-Overlays&quot; rel=&quot;nofollow noreferrer&quot;&gt;Managing Overlays&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Do not try modifying the markers in the overlay by hand, as that fails to update other vital data structures and can cause some overlays to be lost.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I get that markers are not easily accessible for the purposes of encapsulation, but I really want to temporarily change the insertion behavior temporarily! :-)  I suppose that I can destructively re-create the overlay twice, but that involves copying properties and any costs associated with underlying overlay data structures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I efficiently modify overlay marker insertion types?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were to circumvent the intended information-hiding and obtained a reference to individual markers, would modifying the insertion type temporarily (and inserting text) violate an essential invariant for overlay data structures?&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-06-12T14:37:47.917" Title="Modifying the insertion type of overlay markers after creation" Tags="|overlays|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30578" PostTypeId="2" ParentId="21584" CreationDate="2017-02-09T07:58:57.547" Score="1" Body="&lt;p&gt;@Tim, I think you've answered your own question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running an &lt;code&gt;emacsclient&lt;/code&gt; / &lt;code&gt;daemon&lt;/code&gt; from within an existing &lt;code&gt;tmux&lt;/code&gt; session&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ tmux attach&#xA;$ emacsclient -c -a &quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will reconnect you to the existing &lt;code&gt;Emacs&lt;/code&gt; deamon, on an attached &lt;em&gt;(possibly remote)&lt;/em&gt; &lt;code&gt;tmux&lt;/code&gt; session.&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="13326" LastEditDate="2017-02-10T07:15:45.993" LastActivityDate="2017-02-10T07:15:45.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30579" PostTypeId="1" AcceptedAnswerId="30594" CreationDate="2017-02-09T09:06:24.540" Score="3" ViewCount="589" Body="&lt;p&gt;It seems that when using &lt;code&gt;define-derived-mode&lt;/code&gt;, the new mode's keymap is merged with that of the parent mode. Is there a way to avoid this? That is, to inherit font-lock, etc. from the parent mode, but have a completely new keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar foo-mode-map&#xA;  (let ((map (copy-keymap special-mode-map)))&#xA;    (define-key map (kbd &quot;n&quot;) #'next-line)&#xA;    (define-key map (kbd &quot;p&quot;) #'previous-line)&#xA;    map)&#xA;  &quot;Keymap for foo-mode.&quot;)&#xA;&#xA;(define-derived-mode foo-mode java-mode &quot;Foo&quot;&#xA;  &quot;Major mode derived from `java-mode'.&#xA;&#xA;\\{foo-mode-map}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like &lt;code&gt;foo-mode&lt;/code&gt; to use &lt;code&gt;foo-mode-map&lt;/code&gt; without any key sequences from &lt;code&gt;java-mode-map&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-02-10T14:12:09.183" Title="Derived mode without merging keymap" Tags="|major-mode|keymap|derived-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30580" PostTypeId="1" AcceptedAnswerId="30586" CreationDate="2017-02-09T09:59:32.050" Score="0" ViewCount="346" Body="&lt;p&gt;Is it possible to disable warning for functions that not always return value in js2-mode?&lt;/p&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="105" LastEditDate="2017-02-09T15:36:44.897" LastActivityDate="2017-02-09T17:01:04.247" Title="How to disable warning in js2-mode: function does not always return a value?" Tags="|major-mode|javascript|js2-mode|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30582" PostTypeId="1" AcceptedAnswerId="30618" CreationDate="2017-02-09T11:30:54.500" Score="3" ViewCount="1241" Body="&lt;p&gt;The mode line shows &lt;code&gt;&amp;lt;N&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;I&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;V&amp;gt;&lt;/code&gt; and I would like it to show &lt;code&gt;NORMAL&lt;/code&gt;, &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;VISUAL&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm new to Emacs so my Elisp skills are non-existent.&lt;/p&gt;&#xA;" OwnerUserId="14857" LastEditorUserId="253" LastEditDate="2017-02-09T12:27:25.523" LastActivityDate="2017-02-10T18:03:04.120" Title="How do I change the mode indicators for evil-mode in the spaceline mode line package?" Tags="|spacemacs|evil|mode-line|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30585" PostTypeId="1" AcceptedAnswerId="30878" CreationDate="2017-02-09T15:44:27.287" Score="8" ViewCount="1093" Body="&lt;p&gt;When editing TeX files, programming, upgrading packages, &lt;em&gt;etc.&lt;/em&gt; we often need to perform tasks - such as compiling code or downloading files from internet - that take a long time to achieve. We can do all of them in Emacs, however executing such commands &lt;em&gt;freezes&lt;/em&gt; the session: is there a way to execute heavy commands in the background, for example using another thread ?&lt;/p&gt;&#xA;" OwnerUserId="11799" LastEditorUserId="253" LastEditDate="2017-02-09T15:49:49.413" LastActivityDate="2017-02-19T23:30:27.243" Title="How to run a process without Emacs freezing?" Tags="|process|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30586" PostTypeId="2" ParentId="30580" CreationDate="2017-02-09T17:01:04.247" Score="3" Body="&lt;p&gt;The variable responsible for this is &lt;code&gt;js2-strict-inconsistent-return-warning&lt;/code&gt;. Just set it to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="193" LastActivityDate="2017-02-09T17:01:04.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30587" PostTypeId="1" AcceptedAnswerId="30590" CreationDate="2017-02-09T17:22:56.670" Score="1" ViewCount="747" Body="&lt;p&gt;I have this config in my init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;(add-to-list 'auto-mode-alist '(&quot;\\.html?\\'&quot; . web-mode))&#xA;(defun my-web-mode-hook ()&#xA;  &quot;Hooks for Web mode.&quot;&#xA;  (setq web-mode-markup-indent-offset 2)&#xA;  (setq web-mode-css-indent-offset 2)&#xA;  (setq web-mode-code-indent-offset 4)&#xA;  (setq web-mode-enable-auto-pairing t)&#xA;  (setq web-mode-enable-auto-closing t)&#xA;  (setq web-mode-enable-current-element-highlight t)&#xA;  (setq web-mode-enable-current-column-highlight t)&#xA;)&#xA;(add-hook 'web-mode-hook  'my-web-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And when I have script tag I only have javascript code indented by 1 space instead of 2. Is there a way to fix that?&lt;/p&gt;&#xA;" OwnerUserId="14862" LastActivityDate="2017-02-09T19:03:12.257" Title="Web-mode uses 1 space indent instead of 2" Tags="|web-mode|html|javascript|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30588" PostTypeId="1" AcceptedAnswerId="30589" CreationDate="2017-02-09T17:36:55.683" Score="2" ViewCount="225" Body="&lt;p&gt;When running &lt;code&gt;M-x LaTeX-fill-environment&lt;/code&gt; I don't want code in a &lt;code&gt;minted&lt;/code&gt; environments to be formatted. I tried adding &lt;code&gt;minted&lt;/code&gt; to &lt;code&gt;LaTeX-fill-excluded-macros&lt;/code&gt; but that didn't have any effect on the filling. Any ideas on how to exclude certain environments from the command?&lt;/p&gt;&#xA;" OwnerUserId="8472" LastEditorUserId="8472" LastEditDate="2017-02-09T17:47:57.480" LastActivityDate="2017-02-09T18:19:38.417" Title="Don't fill minted environments in AUCTex" Tags="|latex|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30589" PostTypeId="2" ParentId="30588" CreationDate="2017-02-09T18:19:38.417" Score="2" Body="&lt;p&gt;&lt;code&gt;LaTeX-fill-excluded-macros&lt;/code&gt; should contain name of macros for whose arguments filling should be disabled, e.g. &lt;code&gt;\macro{do not fill this}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your specific case, I suggest you use the support file for &lt;code&gt;minted.sty&lt;/code&gt; coming with AUCTeX and activate it by putting this in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq TeX-parse-self t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Restart Emacs and open your .tex file again.  If you have an up to date AUCTeX, you'll get access to all features provided by &lt;code&gt;minted.sty&lt;/code&gt; within Emacs.&lt;/p&gt;&#xA;" OwnerUserId="12242" LastActivityDate="2017-02-09T18:19:38.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30590" PostTypeId="2" ParentId="30587" CreationDate="2017-02-09T19:03:12.257" Score="2" Body="&lt;p&gt;Try &lt;code&gt;(setq web-mode-script-padding 2)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should also call &lt;code&gt;my-web-mode-hook&lt;/code&gt; only once, after you first load &lt;code&gt;web-mode&lt;/code&gt; and not every time the mode is activated:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'web-mode&#xA;  (my-web-mode-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="193" LastActivityDate="2017-02-09T19:03:12.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30591" PostTypeId="1" CreationDate="2017-02-09T19:21:11.447" Score="4" ViewCount="103" Body="&lt;p&gt;I currently have in my config:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(desktop-save-mode 1)&#xA;(setq desktop-restore-eager 10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which on startup, will eagerly restore 10 buffers, and then when Emacs is idle,&#xA;restore all the others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can tell Emacs &quot;I want you to restore the most recently used 10&#xA;buffers, and then don't restore any others&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now it seems like the options are either eagerly restoring every buffer,&#xA;or eagerly restoring a subset and then lazily restoring every other buffer.&lt;/p&gt;&#xA;" OwnerUserId="379" LastActivityDate="2017-02-09T19:21:11.447" Title="How to have desktop-mode restore only the &lt;n&gt; most recently used buffers" Tags="|desktop|session|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30592" PostTypeId="1" AcceptedAnswerId="30593" CreationDate="2017-02-09T19:33:06.013" Score="1" ViewCount="93" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How to fix &lt;code&gt;elmo-unintern&lt;/code&gt; to use 2 arguments instead of 1, or silence the byte-compiler on this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the macro definition:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro elmo-unintern (string)&#xA;&quot;Delete the symbol named NAME, if any, from OBARRAY.&#xA;The value is t if a symbol was found and deleted, nil otherwise.&#xA;NAME may be a string or a symbol.  If it is a symbol, that symbol&#xA;is deleted, if it belongs to OBARRAY--no other symbol is deleted.&#xA;OBARRAY, if nil, defaults to the value of the variable `obarray'.&quot;&#xA;  (static-if (fboundp 'unintern)&#xA;      (list 'unintern string)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the bye-compile message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In elmo-imap4-parse-response:&#xA;&#xA;filename.el:92495:45:Warning: unintern called with 1 argument, but requires 2&#xA;&#xA;filename.el:92513:46:Warning: unintern called with 1 argument, but requires 2&#xA;&#xA;filename.el:92516:38:Warning: unintern called with 1 argument, but requires 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the comment by @Stefan from a previous bug report:  &lt;a href=&quot;https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-04/msg00560.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-04/msg00560.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; Loading this file works as expected, but compiling it generates the&#xA;&amp;gt; warning&#xA;&amp;gt;     unintern called with 1 argument, but requires 2&#xA;&amp;gt; But `unintern' doesn't require 2 arguments.&#xA;&#xA;That's the `advertized-calling-convention' at work here.  IOW calling&#xA;the function with only one argument still works but is deprecated.&#xA;&#xA;        Stefan&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-12T03:05:35.673" Title="byte compile warning: `unintern` called with 1 argument, but requires 2" Tags="|byte-compilation|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30593" PostTypeId="2" ParentId="30592" CreationDate="2017-02-09T20:09:39.803" Score="3" Body="&lt;h3&gt;Note: see &lt;a href=&quot;https://emacs.stackexchange.com/a/30642/5296&quot;&gt;Stefan's answer&lt;/a&gt; for why using &lt;code&gt;unintern&lt;/code&gt; is probably a bad idea.&lt;/h3&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Omitting an optional argument is equivalent to passing &lt;code&gt;nil&lt;/code&gt;, so you can do that explicitly to get the same effect:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro elmo-unintern (string)&#xA;  (static-if (fboundp 'unintern)&#xA;      (list 'unintern string nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the particular case of &lt;code&gt;unintern&lt;/code&gt;, it's explained that &lt;code&gt;nil&lt;/code&gt; is equivalent to &lt;code&gt;obarray&lt;/code&gt;, so you might prefer to be even more explicit and use that instead of &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro elmo-unintern (string)&#xA;  (static-if (fboundp 'unintern)&#xA;      (list 'unintern string 'obarray)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More readable version using backquote:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defmacro elmo-unintern (string)&#xA;  (static-if (fboundp 'unintern)&#xA;      `(unintern ,string obarray)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;By the way, I'm not sure exactly what &lt;code&gt;static-if&lt;/code&gt; is, but assuming it tries to do a &quot;compile time&quot; conditional, that's redundant because it's already compile time by virtue of being called in a macro: you could just use &lt;code&gt;if&lt;/code&gt; instead.  Although I don't see much point in trying to push things into compile time anyway (uninterning should be rare, so performance is unlikely to be a concern), just use a function:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun elmo-unintern (string)&#xA;  (if (fboundp 'unintern) ; `unintern' is new in Emacs 19.29&#xA;      (unintern string obarray)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-02-12T03:05:35.673" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30594" PostTypeId="2" ParentId="30579" CreationDate="2017-02-09T21:23:10.710" Score="4" Body="&lt;p&gt;From the manual &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Derived-Modes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(elisp) Derived Modes&lt;/a&gt;, &lt;code&gt;define-derived-mode&lt;/code&gt; defines keymaps using the following rules:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The new mode has its own sparse keymap, named ‘VARIANT-map’.&#xA;            ‘define-derived-mode’ makes the parent mode’s keymap the&#xA;            parent of the new map, &lt;strong&gt;unless ‘VARIANT-map’ is already set and&#xA;            already has a parent&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You've used &lt;code&gt;copy-keymap&lt;/code&gt; to create your keymap, and this doesn't set a parent keymap. If you do that explicitly, your new keymap won't inherit from java-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar foo-mode-map&#xA;  (let ((map (copy-keymap special-mode-map)))&#xA;    (define-key map (kbd &quot;n&quot;) #'next-line)&#xA;    (define-key map (kbd &quot;p&quot;) #'previous-line)&#xA;     ;; Set parent map for foo-mode-map:&#xA;    (set-keymap-parent map special-mode-map)&#xA;     map)&#xA;  &quot;Keymap for foo-mode.&quot;)&#xA;&#xA;(define-derived-mode foo-mode java-mode &quot;Foo&quot;&#xA;  &quot;Major mode derived from `java-mode'.&#xA;&#xA;\\{foo-mode-map}&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-02-10T14:12:09.183" LastActivityDate="2017-02-10T14:12:09.183" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30595" PostTypeId="1" AcceptedAnswerId="30598" CreationDate="2017-02-10T00:08:06.710" Score="7" ViewCount="1885" Body="&lt;p&gt;I have successfully used org-capture, and have many templates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently I have written a new template, where I want the target to be the location from where I am calling the capture command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried many things, and the only way I have been able to get it to work is using the &lt;em&gt;Target location:&lt;/em&gt; &lt;code&gt;Current clocking task:&lt;/code&gt;. This works just the way I like, except for the fact that I have to start clocking in order to capture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can still gain the same functionality, without the need for clocking?&lt;/p&gt;&#xA;" OwnerUserId="13502" LastActivityDate="2017-02-10T00:38:19.727" Title="How to Org Capture at current location?" Tags="|org-capture|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30596" PostTypeId="1" AcceptedAnswerId="30599" CreationDate="2017-02-10T00:15:40.963" Score="8" ViewCount="3401" Body="&lt;p&gt;How can I increase the level of headers recursively? example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; * Top header&#xA; ** Sub header&#xA; *** Sub sub header&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Top header&#xA;*** Sub Header&#xA;**** Sub sub header&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12732" LastEditorUserId="16543" LastEditDate="2020-02-17T15:45:15.637" LastActivityDate="2020-02-17T15:45:15.637" Title="org-mode how to increase header level recusively in org file?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30597" PostTypeId="1" AcceptedAnswerId="30600" CreationDate="2017-02-10T00:18:05.357" Score="4" ViewCount="839" Body="&lt;p&gt;org-mode section numbers (when exported to html) by default starts count from 1, however it is traditional in computer science to start counting from zero. How to make org-mode section numbers start counting from 0 instead of 1?&lt;/p&gt;&#xA;" OwnerUserId="14744" LastEditorUserId="9982" LastEditDate="2017-02-10T00:58:40.560" LastActivityDate="2020-01-16T16:41:12.237" Title="how to make org-mode section numbers start counting from 0 instead of 1?" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30598" PostTypeId="2" ParentId="30595" CreationDate="2017-02-10T00:32:04.810" Score="5" Body="&lt;p&gt;You may be looking for this, from the &lt;code&gt;org-capture&lt;/code&gt; doc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;When called with a ‘C-0’ (zero) prefix, insert a template at point.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So if you have &lt;code&gt;org-capture&lt;/code&gt; bound to for example &lt;code&gt;C-c c&lt;/code&gt;, then you could use &lt;code&gt;C-0 C-c c&lt;/code&gt; to choose a capture template and insert in the current buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can always bind this to some other key sequence, if using a prefix isn't convenient. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-capture-at-point ()&#xA;  &quot;Insert an org capture template at point.&quot;&#xA;  (interactive)&#xA;  (org-capture 0))&#xA;&#xA;(global-set-key (kbd &quot;C-c C-c&quot;) #'org-capture-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-02-10T00:38:19.727" LastActivityDate="2017-02-10T00:38:19.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30599" PostTypeId="2" ParentId="30596" CreationDate="2017-02-10T00:40:17.770" Score="17" Body="&lt;p&gt;Put point at the top header and try &lt;code&gt;&amp;lt;M-S-right&amp;gt;&lt;/code&gt; (meta+shift+right arrow). This calls the command &lt;code&gt;org-shiftmetaright&lt;/code&gt;, which moves the current heading and its subtree a level deeper. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-02-10T00:40:17.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30600" PostTypeId="2" ParentId="30597" CreationDate="2017-02-10T00:57:50.793" Score="1" Body="&lt;p&gt;Plain lists are turned into HTML by the function &lt;code&gt;org-html-plain-list&lt;/code&gt;, which calls &lt;code&gt;org-html-begin-plain-list&lt;/code&gt;. &lt;code&gt;org-html-begin-plain-list&lt;/code&gt; outputs the &lt;code&gt;&amp;lt;ol&amp;gt;&lt;/code&gt; tag, and has a provision for outputting a &lt;code&gt;start&lt;/code&gt; attribute as well, but &lt;code&gt;org-html-plain-list&lt;/code&gt; doesn't use it. Interestingly, in the version of &lt;code&gt;org-mode&lt;/code&gt; that I happen to have (which is 6 months old), there's a commented out section of code that looks like someone was thinking about implementing this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-html-plain-list (plain-list contents info)&#xA;  &quot;Transcode a PLAIN-LIST element from Org to HTML.&#xA;CONTENTS is the contents of the list.  INFO is a plist holding&#xA;contextual information.&quot;&#xA;  (let* (arg1 ;; (assoc :counter (org-element-map plain-list 'item&#xA;     (type (org-element-property :type plain-list)))&#xA;    (format &quot;%s\n%s%s&quot;&#xA;        (org-html-begin-plain-list type)&#xA;        contents (org-html-end-plain-list type))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It looks like it would look for a &lt;code&gt;COUNTER&lt;/code&gt; property nearby in the org file. Of course, that would still make you put something in for every single list you used, but it would be a start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you could do is use &lt;code&gt;add-advice&lt;/code&gt; to override &lt;code&gt;org-html-begin-plain-list&lt;/code&gt;, so that it always outputs a &lt;code&gt;start=&quot;0&quot;&lt;/code&gt; attribute on ordered lists. You might double-check what the latest version of &lt;code&gt;org-mode&lt;/code&gt; does as well; perhaps they've improved it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-10T00:57:50.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30601" PostTypeId="2" ParentId="29902" CreationDate="2017-02-10T02:45:55.113" Score="2" Body="&lt;p&gt;On the latest version of org-mode I have the following set-up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq org-file-apps&#xA;    '((&quot;\\.docx\\'&quot; . default)&#xA;      (&quot;\\.mm\\'&quot; . default)&#xA;      (&quot;\\.x?html?\\'&quot; . default)&#xA;      (&quot;\\.pdf\\'&quot; . default)&#xA;      (auto-mode . emacs)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would assume that you could use something like &lt;code&gt;(&quot;\\.ods\\'&quot; . default)&lt;/code&gt; for opening with libreoffice. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastEditorUserId="11934" LastEditDate="2017-02-11T23:20:43.417" LastActivityDate="2017-02-11T23:20:43.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30602" PostTypeId="1" CreationDate="2017-02-10T06:11:36.043" Score="8" ViewCount="1877" Body="&lt;p&gt;I have been using the setup described on the top comment  &lt;a href=&quot;https://news.ycombinator.com/item?id=11070797&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; to manage my dotfiles using git. In short, I have this in my .bashrc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias config='/usr/bin/env git --git-dir=$HOME/.myconf/ --work-tree=$HOME'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then can run any git command using &lt;code&gt;config add &amp;lt;file&amp;gt;&lt;/code&gt;, etc. Is there anyway to get this working with magit, so I can commit changes to my configuration files without dropping into a shell?&lt;/p&gt;&#xA;" OwnerUserId="14865" LastActivityDate="2024-03-26T21:35:13.893" Title="use nonstandard `.git` directory with magit" Tags="|magit|" AnswerCount="5" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30603" PostTypeId="1" AcceptedAnswerId="30619" CreationDate="2017-02-10T06:52:20.753" Score="2" ViewCount="178" Body="&lt;p&gt;I'd like to create a customizable variable &lt;code&gt;foo-paths&lt;/code&gt; with certain options. &lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom foo-paths nil&#xA;  &quot;Paths for foo-related things.&quot;&#xA;  :group 'foo&#xA;  :options '(foo-1 foo-2)&#xA;  :type '(alist :key-type symbol :value-type (file :must-match t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like for the user to &lt;em&gt;only&lt;/em&gt; be able to provide values for the specified keys in &lt;code&gt;:options&lt;/code&gt;, not to add new options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Composite-Types.html#Composite-Types&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; doesn't offer a way to do this--the user can add new elements to the alist through the Customize interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to achieve this? The functionality may not be impacted by the addition of new alist elements, but it seems strange that there's no way to specify a variable that has certain options and &lt;em&gt;only&lt;/em&gt; those options.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2017-02-10T17:23:18.057" LastActivityDate="2017-02-11T02:54:48.233" Title="Customizable variable with predefined alist keys" Tags="|customize|customization|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30604" PostTypeId="1" CreationDate="2017-02-10T06:59:02.917" Score="1" ViewCount="39" Body="&lt;p&gt;When specifying a customizable variable &lt;code&gt;foo-paths&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom foo-paths nil&#xA;  &amp;quot;Paths for foo-related things.&amp;quot;&#xA;  :group 'foo&#xA;  :options '(foo-1 foo-2)&#xA;  :type '(alist :key-type symbol :value-type (file :must-match t)))&#xA;  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;There doesn't seem to be any enforcement of the value type in the Customize interface. I can enter any text I want for the values, not just a file (let alone an &lt;em&gt;existing&lt;/em&gt; file).&lt;/p&gt;&#xA;&lt;p&gt;Am I missing something here? The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Simple-Types.html#Simple-Types&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; says:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;(file :must-match t)&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The value must be a file name for an existing file. The widget provides completion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;What completion is the widget providing? I don't see any; all I see is a plain text box.&lt;/p&gt;&#xA;&lt;p&gt;I'm using Emacs 25.1.1.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-02-10T06:59:02.917" Title="Enforcement of customization types" Tags="|customize|customization|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30606" PostTypeId="2" ParentId="30602" CreationDate="2017-02-10T11:35:21.663" Score="3" Body="&lt;p&gt;This won't work. I recommend you set it up like this instead:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;cd $HOME&#xA;echo &amp;quot;gitdir: ./.myconf&amp;quot; &amp;gt; .git&#xA;cd .myconf                     # conceptually, not really necessary&#xA;git config --unset core.bare&#xA;git config core.worktree ../&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;At that point git and thus magit know that &lt;code&gt;$HOME&lt;/code&gt; is a working tree and where the data is.&lt;/p&gt;&#xA;&lt;p&gt;Then again, it seems that's what you are trying to prevent (at least for git, why not for magit also?). Because otherwise what is the benefit of storing the git data in &lt;code&gt;$HOME/.myconf&lt;/code&gt; instead of in &lt;code&gt;$HOME/.git&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;p&gt;If that is so, then I have another question: what's the benefit of &lt;em&gt;that&lt;/em&gt;? I mean I see the appeal of &lt;a href=&quot;https://github.com/RichiH/vcsh&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;vcsh&lt;/code&gt;&lt;/a&gt; (which also won't work with Magit), it allows you to use different repositories for the configuration files of multiple packages even though they are all in the same place. But from what you have said, it doesn't appear that this is what you are after.&lt;/p&gt;&#xA;&lt;p&gt;So it seems the answer is &amp;quot;you can't&amp;quot;. In theory you could advice a bunch of Magit functions, and that might kind of work - but there would be bugs, and you would be solely responsible for dealing with them. I would strongly recommend against attempting this.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="29440" LastEditDate="2024-03-26T21:35:13.893" LastActivityDate="2024-03-26T21:35:13.893" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="30607" PostTypeId="1" AcceptedAnswerId="30608" CreationDate="2017-02-10T11:41:22.883" Score="0" ViewCount="560" Body="&lt;p&gt;I have a working snippet that advices both kill-buffer and kill-this-buffer to not kill the &lt;em&gt;scratch&lt;/em&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (defun ninrod/scratch-bodyguard (buffer-assassin &amp;amp;rest arguments)&#xA;    (let ((buffer-to-kill (buffer-name (current-buffer))))&#xA;      (if (equal buffer-to-kill &quot;*scratch*&quot;)&#xA;          (message &quot;DENIED! don't kill my precious *scratch*!!&quot;)&#xA;        (apply buffer-assassin arguments))))&#xA;  (defun ninrod/scratch-protection (buffer-assassin &amp;amp;rest arguments)&#xA;    (let ((buffer-to-kill (car arguments)))&#xA;      (if (equal buffer-to-kill &quot;*scratch*&quot;)&#xA;          (message &quot;DENIED! don't kill my precious *scratch*!!&quot;)&#xA;        (apply buffer-assassin arguments))))&#xA;  (advice-add #'kill-this-buffer :around #'ninrod/scratch-bodyguard)&#xA;  (advice-add #'kill-buffer :around #'ninrod/scratch-protection)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that these lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (message &quot;DENIED! don't kill my precious *scratch*!!&quot;)&#xA; (apply buffer-assassin arguments))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are repeated in both functions, so I thought that I could apply the DRY principle and refactor the snippet to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ninrod--protection (buffer-assassin buffer-to-kill &amp;amp;rest arguments)&#xA;  (if (equal buffer-to-kill &quot;*scratch*&quot;)&#xA;      (message &quot;DENIED! don't kill my precious *scratch*!!&quot;)&#xA;    (apply buffer-assassin arguments)))&#xA;(defun ninrod/scratch-bodyguard (buffer-assassin &amp;amp;rest arguments)&#xA;  (let ((buffer-to-kill (buffer-name (current-buffer))))&#xA;    (ninrod--protection 'buffer-assassin buffer-to-kill arguments)))&#xA;(defun ninrod/scratch-protection (buffer-assassin &amp;amp;rest arguments)&#xA;  (let ((buffer-to-kill (car arguments)))&#xA;    (ninrod--protection 'buffer-assassin buffer-to-kill arguments)))&#xA;(advice-add #'kill-this-buffer :around #'ninrod/scratch-bodyguard)&#xA;(advice-add #'kill-buffer :around #'ninrod/scratch-protection)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This causes all hell to break loose. Now I can't even close emacs, because apparently emacs tries to kill all buffers&#xA;and as I've just tampered with the kill buffer functions, well, it's bad. Very bad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I mean well, but I'm must be doing something very stupid. For starters, I don't know if I can really pass around&#xA;functions as parameters? So it could be that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you refactor that snippet to apply the dry principle?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this works: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ninrod--protection (buffer-assassin buffer-to-kill &amp;amp;rest arguments)&#xA;  (if (equal buffer-to-kill &quot;*scratch*&quot;)&#xA;      (message &quot;DENIED! don't kill my precious *scratch*!!&quot;)&#xA;    (apply buffer-assassin arguments)))&#xA;&#xA;(defun ninrod/scratch-bodyguard (buffer-assassin &amp;amp;rest arguments)&#xA;  (let ((buffer-to-kill (buffer-name (current-buffer))))&#xA;    (ninrod--protection 'buffer-assassin buffer-to-kill arguments)))&#xA;&#xA;(advice-add #'kill-this-buffer :around #'ninrod/scratch-bodyguard)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so the problem lies exactly here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ninrod/scratch-protection (buffer-assassin &amp;amp;rest arguments)&#xA;  (let ((buffer-to-kill (car arguments)))&#xA;    (ninrod--protection 'buffer-assassin buffer-to-kill arguments)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;edit2: quoting or unquoting the function &lt;code&gt;buffer-assassin&lt;/code&gt; does not make a difference&lt;/p&gt;&#xA;" OwnerUserId="12585" LastEditorUserId="105" LastEditDate="2018-09-10T16:09:17.380" LastActivityDate="2018-09-10T16:09:17.380" Title="how to correctly pass around function as parameters?" Tags="|functions|quote|symbols|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30608" PostTypeId="2" ParentId="30607" CreationDate="2017-02-10T12:22:57.603" Score="5" Body="&lt;p&gt;Don't quote &lt;code&gt;buffer-assassin&lt;/code&gt; when passing it to &lt;code&gt;ninrod--protection&lt;/code&gt;. In your advice-functions, &lt;code&gt;buffer-assassin&lt;/code&gt; is a variable, the value of which is the originial function. When you pass it quoted, &lt;code&gt;buffer-assassin&lt;/code&gt; in &lt;code&gt;ninrod--protection&lt;/code&gt; will have the value &lt;code&gt;'buffer-assassin&lt;/code&gt; (i.e. the symbol itself), so &lt;code&gt;apply&lt;/code&gt; will try calling a (global) function named like that, not the value of the caller's local variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: A somewhat cleaner solution (i.e. without advising) would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'kill-buffer-query-functions &#xA;  (lambda () (not (eq (current-buffer) (get-buffer &quot;*scratch*&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="735" LastEditorUserId="735" LastEditDate="2017-02-10T13:07:10.790" LastActivityDate="2017-02-10T13:07:10.790" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30609" PostTypeId="2" ParentId="30607" CreationDate="2017-02-10T12:30:11.670" Score="0" Body="&lt;p&gt;Edit: I misread the code, go with ChrisRs answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can definitely pass around functions, but you do it indirectly by passing the symbol the function is stored in. When you write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(f 'myfunction)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are passing the symbol &lt;code&gt;'myfunction&lt;/code&gt; as an argument to the function f. Specifically when you intend to pass a symbol in order to pass a function, you should actually write &lt;code&gt;#'myfunction&lt;/code&gt; because that hints to emacs you're intending to pass a function and you get better error messages. Emacs is a lisp-2, meaning that a single symbol can hold both a variable value and a function value, but generally if a function takes a &quot;function&quot; as an argument, it will assume that for the symbol you pass in you intend to use the function value associated with it, not the variable value, and will extract it for you.&lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="2301" LastEditDate="2017-02-10T13:22:18.733" LastActivityDate="2017-02-10T13:22:18.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30610" PostTypeId="2" ParentId="23764" CreationDate="2017-02-10T13:40:19.350" Score="1" Body="&lt;p&gt;You can have company-go insert the arguments for a function when you complete it, like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Stp5Y.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Stp5Y.png&quot; alt=&quot;go autocomplete arguments&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not quite a hotkey for the function arguments but not too far off. If that is not enough based on &lt;a href=&quot;https://github.com/nsf/gocode/pull/251&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/nsf/gocode/pull/251&lt;/a&gt; gocode can provide the function arguments for a given function, so showing a popup should not be too hard.&lt;/p&gt;&#xA;" OwnerUserId="11640" LastEditorUserId="15747" LastEditDate="2017-07-11T05:44:42.393" LastActivityDate="2017-07-11T05:44:42.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30611" PostTypeId="2" ParentId="30332" CreationDate="2017-02-10T15:15:51.543" Score="3" Body="&lt;p&gt;&lt;code&gt;global-evil-leader-mode&lt;/code&gt; adds a function to enable &lt;code&gt;evil-leader-mode&lt;/code&gt; through the hook &lt;code&gt;evil-local-mode-hook&lt;/code&gt;. This means that &lt;code&gt;evil-leader-mode&lt;/code&gt; is enabled in a buffer after enabling &lt;code&gt;evil-local-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you are enabling &lt;code&gt;evil-local-mode&lt;/code&gt; (through the global &lt;code&gt;evil-mode&lt;/code&gt;) and then adding to the hook, meaning the hook is run before you added the &lt;code&gt;evil-leader-mode&lt;/code&gt; function to it. If you reverse the order of &lt;code&gt;(global-evil-leader-mode)&lt;/code&gt; and &lt;code&gt;(evil-mode 1)&lt;/code&gt;, the problem will be fixed.&lt;/p&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-02-10T15:15:51.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30612" PostTypeId="1" CreationDate="2017-02-10T15:57:04.747" Score="0" ViewCount="29" Body="&lt;p&gt;i have this simple function i wrote (tbh i have zero coding skills.i gathered stuff from the web :)):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z/dired-media-filebot (file)&#xA;(interactive (list (expand-file-name (dired-file-name-at-point))))&#xA;(start-process &quot;filebot&quot; nil &quot;filebot&quot; file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;problem is it always send only the current marked folder at point while i want to send all marked folders. How does one send all marked folders?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="105" LastEditDate="2017-02-10T17:17:44.340" LastActivityDate="2017-02-10T17:17:44.340" Title="dired function i wrote passes only current marked folder at point, can i send all marked folder?" Tags="|dired|shell|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30613" PostTypeId="1" AcceptedAnswerId="30615" CreationDate="2017-02-10T16:22:47.930" Score="16" ViewCount="7697" Body="&lt;p&gt;I just installed Emacs 25.1 for windows.&#xA;I want to modify the TODO keyword list, and I use this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (setq org-todo-keywords&#xA;  '((sequence &quot;TODO&quot;&#xA;      &quot;MAYBE&quot;&#xA;      &quot;NEXT&quot;&#xA;      &quot;STARTED&quot;&#xA;      &quot;WAITING&quot;&#xA;      &quot;DELEGATED&quot;&#xA;      &quot;|&quot;&#xA;      &quot;DONE&quot;&#xA;      &quot;DEFERRED&quot;&#xA;      &quot;CANCELLED&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the TODO items keep cycling between the standard keywords.&#xA;Strangely enough, if I check the variable 'org-todo-keywords from within the customization buffer, I do see all the keywords I've defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints on why the do not appear when cycling?&lt;/p&gt;&#xA;" OwnerUserId="9642" LastActivityDate="2017-02-10T21:11:44.410" Title="Adding/Modifying TODO keywords" Tags="|org-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30614" PostTypeId="1" CreationDate="2017-02-10T17:19:04.740" Score="3" ViewCount="2460" Body="&lt;p&gt;I'm trying to follow the instructions in the README of this repo: &lt;a href=&quot;https://github.com/jorgenschaefer/elpy&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jorgenschaefer/elpy&lt;/a&gt; . Everything goes smoothly until I get to the point where I am to install the package. After typing elpy and pressing enter I get a [No match] result. Any thoughts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what happens in detail. I copy and paste:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;(add-to-list 'package-archives&#xA;             '(&quot;elpy&quot; . &quot;https://jorgenschaefer.github.io/packages/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into my scratch buffer. I then type M-x ev-b RET and see no response in the minibuffer. I then type M-x package-refresh-contents RET and see a few quick messages fly by including what seems to be a connection to the github repo and culminates in a 'Package refresh done' message. Finally, when running M-x package-install RET elpy RET I receive a 'No Match' message and a prompt for 'Install package:'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After all this, upon running C-h v package-archives I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;package-archives is a variable defined in ‘package.el’.&#xA;Its value is ((&quot;gnu&quot; . &quot;&lt;a href=&quot;http://elpa.gnu.org/packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://elpa.gnu.org/packages/&lt;/a&gt;&quot;))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This variable may be risky if used as a file-local variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation:&#xA;An alist of archives from which to fetch.&#xA;The default value points to the GNU Emacs package repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each element has the form (ID . LOCATION).&#xA; ID is an archive name, as a string.&#xA; LOCATION specifies the base location for the archive.&#xA;  If it starts with &quot;http:&quot;, it is treated as a HTTP URL;&#xA;  otherwise it should be an absolute directory name.&#xA;  (Other types of URL are currently not supported.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only add locations that you trust, since fetching and installing&#xA;a package can run arbitrary code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This variable was introduced, or its default value was changed, in&#xA;version 24.1 of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[back]&lt;/p&gt;&#xA;" OwnerDisplayName="user14871" LastEditorDisplayName="user14871" LastEditDate="2017-02-12T23:16:42.167" LastActivityDate="2024-01-21T10:05:55.723" Title="elpy [No match] when installing package" Tags="|python|elpy|" AnswerCount="2" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="30615" PostTypeId="2" ParentId="30613" CreationDate="2017-02-10T17:32:53.923" Score="11" Body="&lt;p&gt;Org-mode caches various things on load.  In this case &lt;code&gt;org-todo&lt;/code&gt; relies on todo keyword state cached in &lt;code&gt;org-todo-kwd-alist&lt;/code&gt; which is generated by &lt;code&gt;org-set-regexps-and-options&lt;/code&gt; which is run when setting the mode to org-mode for the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If some org-mode customization doesn't seem to be taking effect it's usually a good idea to refresh things by reloading the buffer.  Either by saving, closing, and re-opening the file or reverting the file by &lt;code&gt;C-x C-v [return]&lt;/code&gt; (&lt;code&gt;find-alternate-file&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would personally consider this a bug.  When emacs gets watchpoints (in v26.1 hopefully) minor caching issues like this should be easily addressed.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2017-02-10T17:39:23.597" LastActivityDate="2017-02-10T17:39:23.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30616" PostTypeId="1" CreationDate="2017-02-10T17:36:02.783" Score="0" ViewCount="238" Body="&lt;p&gt;How can I replace &lt;code&gt;py-hungry-delete-backwards&lt;/code&gt; for the traditional &lt;code&gt;backward-kill-word&lt;/code&gt; in python-mode.el? I tried to define the &lt;kbd&gt;C-DEL&lt;/kbd&gt; key in the python-mode hook but it just get ignored. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is, I want to use the &lt;code&gt;backward-kill-word&lt;/code&gt; command with &lt;kbd&gt;C-DEL&lt;/kbd&gt; in a python environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="14873" LastEditorUserId="1979" LastEditDate="2017-02-10T18:15:40.983" LastActivityDate="2017-05-11T21:04:04.933" Title="&quot;py-hungry-delete-backwards&quot; instead &quot; backward-kill-word&quot; in python-mode.el" Tags="|key-bindings|python|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30617" PostTypeId="2" ParentId="30616" CreationDate="2017-02-10T17:41:59.167" Score="1" Body="&lt;p&gt;Well, I found the solution in a bugreport:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;          (lambda ()&#xA;            (define-key python-mode-map (kbd &quot;&amp;lt;C-backspace&amp;gt;&quot;) 'backward-kill-word)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason my implementation of a similar hook was not working.&lt;/p&gt;&#xA;" OwnerUserId="14873" LastEditorUserId="10" LastEditDate="2017-02-10T18:15:22.263" LastActivityDate="2017-02-10T18:15:22.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30618" PostTypeId="2" ParentId="30582" CreationDate="2017-02-10T18:03:04.120" Score="4" Body="&lt;p&gt;You can modify how the mode-line shows the evil state by setting the corresponding tag variable. You'll need these lines somewhere in your emacs init file.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq evil-normal-state-tag &quot;NORMAL&quot;)&#xA;(setq evil-insert-state-tag &quot;INSERT&quot;)&#xA;(setq evil-visual-state-tag &quot;VISUAL&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14114" LastActivityDate="2017-02-10T18:03:04.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30619" PostTypeId="2" ParentId="30603" CreationDate="2017-02-10T18:16:36.920" Score="1" Body="&lt;p&gt;Only a partial answer.  The &lt;code&gt;:must-match&lt;/code&gt; requirement seems broken (a bug?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alist is extensible by definition.  And &lt;code&gt;:options&lt;/code&gt; does not enforce using its values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Custom type &lt;code&gt;list&lt;/code&gt; specifies a list of prescribed length and element types. Use &lt;code&gt;repeat&lt;/code&gt; of &lt;code&gt;list&lt;/code&gt;.  In other words,&lt;code&gt;repeat&lt;/code&gt; lists of two elements of given types.  For your permissible keys, use &lt;code&gt;choice&lt;/code&gt; with &lt;code&gt;const&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom foo-paths nil&#xA;  &quot;Paths for foo-related things.&quot;&#xA;  :group 'foo&#xA;  :type '(repeat (list (choice (const foo-1) (const foo-2))&#xA;                       (file :must-match t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom foo-paths nil&#xA;  &quot;Paths for foo-related things.&quot;&#xA;  :group 'foo&#xA;  :options '(foo-1 foo-2)&#xA;  :type '(alist&#xA;          :key-type (choice (const foo-1) (const foo-2))&#xA;          :value-type (file :must-match t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Based on your comments, it's not very clear what you really want.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-02-11T02:54:48.233" LastActivityDate="2017-02-11T02:54:48.233" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30620" PostTypeId="1" AcceptedAnswerId="30622" CreationDate="2017-02-10T18:23:09.463" Score="1" ViewCount="425" Body="&lt;p&gt;I want to export (not sure if that's the right word) a single column of an org-table as text, with the elements separated by commas. Eg if the table is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| x  | y  |&#xA;|----+----|&#xA;|  0 |  1 |&#xA;|  2 |  3 |&#xA;|  4 |  5 |&#xA;|  6 |  7 |&#xA;|  8 |  9 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to get the result &lt;code&gt;0,2,4,6,8&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case I want the first column, but I'd like a solution that allows me to export any single column.&lt;/p&gt;&#xA;" OwnerUserId="6692" LastActivityDate="2017-02-10T20:10:11.323" Title="Exporting a single column of an org-table" Tags="|org-mode|org-export|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30622" PostTypeId="2" ParentId="30620" CreationDate="2017-02-10T20:10:11.323" Score="2" Body="&lt;p&gt;You can make a function to get the desired column and create a string with all the values. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: tbl&#xA;| x  | y  |&#xA;|----+----|&#xA;|  0 |  1 |&#xA;|  2 |  3 |&#xA;|  4 |  5 |&#xA;|  6 |  7 |&#xA;|  8 |  9 |&#xA;&#xA;#+begin_src elisp :var x=tbl col=0&#xA;(mapconcat (lambda (r) (number-to-string (nth col r))) x &quot;,&quot;)&#xA;#+end_src&#xA;&#xA;#+RESULTS:&#xA;: 0,2,4,6,8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;nth&lt;/code&gt; selects the desired column for a row. In order to concatenate all into a string, the number must be converted to a string with &lt;code&gt;number-to-string&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the above operation is passed to &lt;code&gt;mapconcat&lt;/code&gt;, which will form the string with the desired delimiter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want the actual table in the exported output, &lt;a href=&quot;https://emacs.stackexchange.com/a/10063/53&quot;&gt;wrap it inside a COMMENT block&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-02-10T20:10:11.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30623" PostTypeId="2" ParentId="30613" CreationDate="2017-02-10T21:11:44.410" Score="17" Body="&lt;p&gt;As others have mentioned, &lt;code&gt;org-mode&lt;/code&gt;  caches things like the todo keywords when it starts.  You can close and reopen the files, but &lt;code&gt;org-mode&lt;/code&gt; provides a function &lt;code&gt;org-mode-restart&lt;/code&gt; you can use.  If some setting doesn't seem to be taking effect, try &lt;code&gt;M-x org-mode-restart&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2017-02-10T21:11:44.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30624" PostTypeId="1" CreationDate="2017-02-10T21:56:39.003" Score="0" ViewCount="265" Body="&lt;p&gt;Whenever I try to open &lt;code&gt;.po&lt;/code&gt; (Portable Object) files in emacs, I get a &quot;find-file-noselect-1: Wrong type argument: arrayp, nil&quot; error and the file is not displayed. However, if I change the file extension to something else (like &lt;code&gt;.txt&lt;/code&gt;), it opens in emacs fine. It seems as though emacs is trying to run the file because of its extension instead of just display it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get emacs to simply display &lt;code&gt;.po&lt;/code&gt; files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a possibly relevant side note, whenever I execute &lt;code&gt;M-x po-mode&lt;/code&gt;, it fails with the error &quot;Cannot open load file: po-mode.&quot;&lt;/p&gt;&#xA;" OwnerUserId="12866" LastEditorUserId="105" LastEditDate="2017-02-11T02:43:33.930" LastActivityDate="2017-02-11T02:43:33.930" Title="Cannot open .po files: &quot;Wrong type argument&quot;" Tags="|debugging|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30625" PostTypeId="1" CreationDate="2017-02-10T22:41:22.293" Score="0" ViewCount="649" Body="&lt;p&gt;I am creating several org-mode documents to track code example and would like to be able to view the results of tangling or executing these code blocks in a browser. In the example below, I've created a source code block that starts a browsersync session; this which should reflect my changes in the web browser when I tangle a CSS or HTML file. How can I run this process in the background so it doesn't freeze Emacs? Currently, executing this code makes Emacs unusable in the same way that starting it in a shell would make the shell unusable. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC bash :tangle no :exports none&#xA;browser-sync start --server --browser &quot;Google Chrome&quot; --files &quot;*.css, css3_by_example.html&quot; &amp;amp;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13854" LastActivityDate="2020-04-16T09:08:48.297" Title="How can I start a server in the background from a source code block without freezing emacs?" Tags="|org-mode|org-babel|shell|process|server|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30626" PostTypeId="1" AcceptedAnswerId="30638" CreationDate="2017-02-11T00:38:34.667" Score="2" ViewCount="1488" Body="&lt;p&gt;I'm trying to understand why this doesn't work, and how to make it work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar test/var-1 nil)&#xA;(defvar test/var-2 nil)&#xA;&#xA;(defun make-setter (var-to-set)&#xA;  (lambda (val-to-set)&#xA;    (setq var-to-set val-to-set)))&#xA;&#xA;(defun do-the-thing ()&#xA;  (let ((the-val 5))&#xA;    (funcall (make-setter test/var-2) the-val)))&#xA;&#xA;(do-the-thing) ;; After this function is called, I'd expect &#xA;               ;; test/var-2 to have the value 5, but it's nil.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;assume&lt;/em&gt; the problem is that the call to &lt;code&gt;setq&lt;/code&gt; is setting the value of the symbol &lt;code&gt;var-to-set&lt;/code&gt;, overwriting the previous value of &lt;code&gt;test/var-2&lt;/code&gt; with 5. How do I pass in the name of the variable to set and and set the value of that variable?&lt;/p&gt;&#xA;" OwnerUserId="10319" LastEditorUserId="105" LastEditDate="2022-09-18T17:26:02.863" LastActivityDate="2022-09-18T17:26:02.863" Title="Passing a symbol as an argument to a function" Tags="|elisp|variables|elisp-macros|arguments|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30627" PostTypeId="2" ParentId="30625" CreationDate="2017-02-11T00:50:29.657" Score="1" Body="&lt;p&gt;By default, Org src block evaluation is synchronous -- Emacs will wait for evaluation to finish, potentially forever. However, there are some very nice async functions built in to Emacs Lisp. You might consider creating a regular emacs lisp function built around &lt;code&gt;start-process&lt;/code&gt;, which can manage your browser-sync session and let you preview your tangling. You could even use an non-tangling elisp src block to do the same thing, if you really want to keep it all in babel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There are also some approaches out there in Google Land for doing async block evaluation in babel, but I haven't evaluated any of it.)&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2017-02-11T00:50:29.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30628" PostTypeId="2" ParentId="3900" CreationDate="2017-02-11T01:16:51.277" Score="3" Body="&lt;p&gt;Have you considered &lt;a href=&quot;https://github.com/vermiculus/magithub&quot; rel=&quot;nofollow noreferrer&quot;&gt;magithub&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't let you view the pull request of the current branch, but it gives you a full list of pull requests which you can visit by pressing &lt;code&gt;RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FB762.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FB762.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note this requires &lt;a href=&quot;https://github.com/vermiculus/magithub/issues/44&quot; rel=&quot;nofollow noreferrer&quot;&gt;hub 2.2&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2017-02-11T01:16:51.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30629" PostTypeId="1" CreationDate="2017-02-11T07:28:36.233" Score="2" ViewCount="536" Body="&lt;p&gt;I'm a Vim user trying to learn Spacemacs. In Vim, I execute a Scheme program by typing &lt;code&gt;:mit-scheme &amp;lt; xxx.scm&lt;/code&gt;. After the program exits, I can continue editing simply by press &lt;kbd&gt;Enter&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6CC2Q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6CC2Q.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, doing this in Spacemacs (in evil mode, of course) would create a new buffer, which I have to kill manually by typing three characters: &lt;code&gt;&amp;lt;space&amp;gt; b d&lt;/code&gt;. This is quite inconvenient for me, because I'm a inexperienced programmer who needs to execute programs &lt;em&gt;very&lt;/em&gt; frequently while debugging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AeGTS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AeGTS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make execute a program more efficiently in Spacemacs? For example, I want close the output window/buffer in one keystroke. I'm also glad to know if I can replace &lt;code&gt;:mit-scheme &amp;lt; xxx.scm&lt;/code&gt; with some key bindings.&lt;/p&gt;&#xA;" OwnerUserId="14867" LastEditorUserId="14867" LastEditDate="2017-02-11T07:36:22.703" LastActivityDate="2017-06-11T13:48:44.413" Title="Executing programs the efficient way with Spacemacs" Tags="|key-bindings|spacemacs|evil|major-mode|scheme|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30630" PostTypeId="2" ParentId="30629" CreationDate="2017-02-11T12:00:17.823" Score="1" Body="&lt;p&gt;I've got an workaround: open an terminal in Emacs with the &lt;a href=&quot;http://spacemacs.org/layers/+tools/shell/README.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shell layer&lt;/a&gt;. After installing the Shell layer, you can toggle a shell window using &lt;code&gt;SPC '​&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can execute &lt;code&gt;mit-scheme &amp;lt; xxx.scm&lt;/code&gt; in that terminal, which seems more convenient to me than using the &lt;a href=&quot;http://spacemacs.org/layers/+lang/scheme/README.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Scheme layer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FiAof.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FiAof.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14867" LastActivityDate="2017-02-11T12:00:17.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30631" PostTypeId="1" CreationDate="2017-02-11T12:17:37.353" Score="2" ViewCount="31" Body="&lt;p&gt;I am new on Emacs and I am working on modifying firefox interface. XUL is implemented as an XML dialect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just need basic syntax highlighting for XUL. I found that VIM and gedit are working out of box. If I change the file extension to .xml, it works perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts? &lt;/p&gt;&#xA;" OwnerUserId="14881" LastEditorUserId="25" LastEditDate="2017-02-11T20:33:11.070" LastActivityDate="2017-02-11T20:33:11.070" Title="Adding XUL file syntax highlighting support?" Tags="|major-mode|xml|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30632" PostTypeId="2" ParentId="30631" CreationDate="2017-02-11T12:39:55.710" Score="1" Body="&lt;p&gt;I found the solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq auto-mode-alist &#xA;  (append '((&quot;.*\\.xul\\'&quot; . nxml-mode))&#xA;          auto-mode-alist))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14881" LastEditorUserId="25" LastEditDate="2017-02-11T20:32:37.437" LastActivityDate="2017-02-11T20:32:37.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30633" PostTypeId="1" AcceptedAnswerId="30645" CreationDate="2017-02-11T13:46:09.897" Score="1" ViewCount="1614" Body="&lt;p&gt;The &lt;code&gt;smartparens&lt;/code&gt; minor mode is quite annoying to me, so I want to have it disabled on default. However, I don't want to uninstall it, in case I need it someday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I disable a minor mode without uninstalling it?&lt;/p&gt;&#xA;" OwnerUserId="14867" LastEditorUserId="10" LastEditDate="2017-02-11T21:50:43.737" LastActivityDate="2017-02-12T02:16:55.997" Title="How to stop a minor mode from auto-loading in Spacemacs?" Tags="|spacemacs|package|minor-mode|install|autoload|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30634" PostTypeId="2" ParentId="30633" CreationDate="2017-02-11T18:15:03.797" Score="1" Body="&lt;p&gt;There is another approach besides the ones mentioned in the comments. All of these choices expand the configurability of Emacs. You may want to look into Shingo Fukuyama's package, &lt;a href=&quot;https://github.com/ShingoFukuyama/manage-minor-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;manage-minor-mode&lt;/a&gt;, which is also on MELPA.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can I disable a minor mode without uninstalling it?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. With &lt;code&gt;M-x manage-minor-mode&lt;/code&gt;, you can toggle any &lt;a href=&quot;/questions/tagged/minor-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;minor-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;minor-mode&lt;/a&gt; selectively and temporarily. How selective and how temporary is up for your exploration, but this is an option to consider. I use it for seeing the list of currently active minor modes. I'd think &lt;a href=&quot;/questions/tagged/spacemacs&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;spacemacs&amp;#39;&quot; rel=&quot;tag&quot;&gt;spacemacs&lt;/a&gt; would have had a feature like this.  &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-11T18:23:22.867" LastActivityDate="2017-02-11T18:23:22.867" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30635" PostTypeId="1" CreationDate="2017-02-11T18:27:16.583" Score="1" ViewCount="103" Body="&lt;p&gt;Sunrise commander used to work fine. At some stage, and I am unaware when it happened, Sunrise now fails to launch. The error message I get is &lt;code&gt;Window #&amp;lt;window 3 on init.el&amp;gt; too small for splitting&lt;/code&gt;.  I have also tried setting up these: &lt;code&gt;(split-height-threshold 5) (split-width-threshold 5)&lt;/code&gt;, unfortunately this does not work either. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="13180" LastActivityDate="2018-06-08T05:13:49.450" Title="Sunrise-commander fails to launch, cannot split window" Tags="|sunrise-commander|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30636" PostTypeId="1" CreationDate="2017-02-11T19:01:44.983" Score="0" ViewCount="130" Body="&lt;p&gt;I am trying to use emacs-lisp to interact with a MongoDB. Here is an example of a string that mongo returns, that emacs cannot read. The problem is the unquoted ObjectId and ISODate items (if I put quotes around them, then it parses fine).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(json-read-from-string &quot;[ { \&quot;_id\&quot; : ObjectId(\&quot;589f59860a25be50ecd9a6d0\&quot;), \&quot;date-added\&quot; : ISODate(\&quot;2017-02-11T18:35:50.046Z\&quot;) }, { \&quot;_id\&quot; : ObjectId(\&quot;589f598c0a25be50ecd9a6d1\&quot;), \&quot;date-added\&quot; : ISODate(\&quot;2017-02-11T18:35:56.634Z\&quot;) } ]&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get the json library to read this kind of json? Right now what I do is &quot;quote&quot; and &quot;dequote&quot; the json string, but it means I have to keep it up to date with all the things that mongo might return one day. &lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="105" LastEditDate="2017-02-11T23:27:50.983" LastActivityDate="2017-02-11T23:27:50.983" Title="Get emacs to read unquoted strings in json" Tags="|string|json|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30637" PostTypeId="2" ParentId="29933" CreationDate="2017-02-11T21:19:49.667" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/masasam/emacs-helm-tramp&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-tramp&lt;/code&gt;&lt;/a&gt; might be what you are looking for. It reads the connections in &lt;code&gt;~/.ssh/config&lt;/code&gt; and pushes them to the &lt;code&gt;helm&lt;/code&gt; interface. I haven't tried &lt;code&gt;helm-tramp&lt;/code&gt; yet myself, though.&lt;/p&gt;&#xA;" OwnerUserId="12336" LastActivityDate="2017-02-11T21:19:49.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30638" PostTypeId="2" ParentId="30626" CreationDate="2017-02-11T22:10:55.370" Score="3" Body="&lt;p&gt;First of all, closures won't work in Emacs Lisp without setting &lt;code&gt;lexical-binding&lt;/code&gt; to t for the file. Dynamic scoping (which is used by default) makes it impossible to create closures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To turn on lexical scoping, put this as the first line of the file with your code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; -*- lexical-binding: t -*-&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to set the value of an arbitrary symbol, use &lt;code&gt;set&lt;/code&gt; instead of &lt;code&gt;setq&lt;/code&gt;, which quotes the name of the symbol you want to set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When passing a symbol as an argument, make sure you quote it by putting an apostrophe in front of it. &lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2017-02-11T22:10:55.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30640" PostTypeId="2" ParentId="30527" CreationDate="2017-02-11T23:28:20.200" Score="1" Body="&lt;p&gt;AFAIK julia-mode's ad-hoc way to enter non-ASCII characters does not prevent you from using Emacs's input-methods such as &lt;code&gt;C-u C-\ TeX RET&lt;/code&gt;, so you can simply use that.  Of course, you can additionally use your OS's input method.  E.g. I usually type &lt;code&gt;é&lt;/code&gt; with &lt;kbd&gt;Multi_key ' e&lt;/kbd&gt; rather than by using an Emacs input method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, often I circumvent entering non-ASCII characters in text searches by using regexp isearch and using &lt;code&gt;.&lt;/code&gt; for the non-ASCII chars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you really want to have exactly julia-mode's input system in Isearch, you can try something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun sm-isearch-julia-latexsub ()&#xA;  (interactive)&#xA;  (let ((newstr&#xA;         (with-temp-buffer&#xA;           (insert isearch-string)&#xA;           (if (julia-latexsub) nil&#xA;             (buffer-substring (point-min) (point-max))))))&#xA;    (if (null newstr)&#xA;        ;; Run the usual binding of TAB in isearch-mode-map.&#xA;        (call-interactively 'isearch-printing-char)&#xA;      (setq isearch-string newstr)&#xA;      ;; Magic code copied from `isearch-del-char`.&#xA;      (setq isearch-message&#xA;            (mapconcat #'isearch-text-char-description&#xA;                       isearch-string &quot;&quot;))&#xA;      (funcall (or isearch-message-function #'isearch-message)&#xA;               nil t)&#xA;      (if isearch-other-end (goto-char isearch-other-end))&#xA;      (isearch-search)&#xA;      (isearch-push-state)&#xA;      (isearch-update))))&#xA;&#xA;(define-key isearch-mode-map [?\t] 'sm-isearch-julia-latexsub)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &quot;magic code&quot; is ugly and depends on Isearch internals, so it's probably not really appropriate for julia-mode.el.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-02-12T20:26:28.590" LastActivityDate="2017-02-12T20:26:28.590" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30641" PostTypeId="2" ParentId="30577" CreationDate="2017-02-11T23:38:52.817" Score="2" Body="&lt;p&gt;It would be safe to let the user change the insertion type of the start/end position of an overlay.  It just hasn't been needed until now.  I guess those people who have needed such a thing haven't been vocal enough, or manually adjusting the overlay position (rather than its insertion type) was easy enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[ BTW: the fact that overlays use markers is an internal implementation detail.  It will hopefully change in the future.  ]&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-06-12T14:37:47.917" LastActivityDate="2017-06-12T14:37:47.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30642" PostTypeId="2" ParentId="30592" CreationDate="2017-02-12T00:04:51.190" Score="2" Body="&lt;p&gt;The reason for making the second arg explicit is because in 99.99% of the cases, using &lt;code&gt;unintern&lt;/code&gt; with its default 2nd argument (i.e. with the global &lt;code&gt;obarray&lt;/code&gt;) is a very bad idea which will occasionally render your Emacs session unusable or cause &lt;em&gt;very&lt;/em&gt; odd behavior.  IOW you should only use it when you &lt;em&gt;really&lt;/em&gt; know what you're doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the code, I don't think any part of the code actually needs those symbols to be uninterned (and I'm not convinced the author &lt;em&gt;really&lt;/em&gt; knows what he's getting himself into), so it looks like the uninterning was mostly performed out of fear of excessive resource use.  My guess is that the best fix would be to start by removing those calls to &lt;code&gt;elmo-unintern&lt;/code&gt; (along with the definition, rendered useless).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-02-12T00:04:51.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30644" PostTypeId="1" AcceptedAnswerId="30654" CreationDate="2017-02-12T00:39:16.790" Score="4" ViewCount="212" Body="&lt;p&gt;After a crash, I can &lt;code&gt;recover-this-file&lt;/code&gt;, but, if I don't know which of many files may have been unsaved at the time of the crash, how can I find out?  Can I recover them all in one go?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2017-02-12T10:51:47.953" Title="Recovering multiple files" Tags="|recover|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30645" PostTypeId="2" ParentId="30633" CreationDate="2017-02-12T02:11:42.523" Score="1" Body="&lt;p&gt;First, to know what Spacemacs configures about smartparens you can &lt;code&gt;SPC h SPC&lt;/code&gt; and type &lt;code&gt;smartparens&lt;/code&gt;, you'll get a list of all the places where smartparens is configured, choose the candidate &lt;code&gt;smartparens (owner: spacemacs-editing layer)&lt;/code&gt; to go to the code configuring the package. In the code you can see that in the &lt;code&gt;:init&lt;/code&gt; section of &lt;code&gt;use-package&lt;/code&gt; we setup some hooks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spacemacs enables an hidden feature of use-package which allows to define hooks for &lt;code&gt;:init&lt;/code&gt; and &lt;code&gt;:config&lt;/code&gt; blocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can add a &lt;code&gt;:post-init&lt;/code&gt; use-package hook in your &lt;code&gt;dotspacemacs/user-init&lt;/code&gt; function whose job is to remove the hooks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(spacemacs|use-package-add-hook smartparens&#xA;  :post-init&#xA;  (remove-hook 'prog-mode-hook 'smartparens-mode)&#xA;  (remove-hook 'comint-mode-hook 'smartparens-mode)&#xA;  (remove-hook 'minibuffer-setup-hook&#xA;               'spacemacs//conditionally-enable-smartparens-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="167" LastEditorUserId="167" LastEditDate="2017-02-12T02:16:55.997" LastActivityDate="2017-02-12T02:16:55.997" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30647" PostTypeId="1" AcceptedAnswerId="30667" CreationDate="2017-02-12T03:32:05.243" Score="2" ViewCount="152" Body="&lt;p&gt;I'm working on a package and I want to present a list to the users that they can select from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package allows editing of remote Dokuwiki pages from Emacs which can be found here: &lt;a href=&quot;https://github.com/accidentalrebel/emacs-dokuwiki&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/accidentalrebel/emacs-dokuwiki&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to list pages that users can scroll up and down, once they press enter it should open the page they have selected. I'm thinking this can be done by listing the selection in a new buffer, then just code it in a way it can only accept up, down, and enter commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there other alternatives to doing this? I can use helm too but want to know if there are other simpler options.&lt;/p&gt;&#xA;" OwnerUserId="10481" LastEditorUserId="253" LastEditDate="2017-02-13T01:53:53.867" LastActivityDate="2017-02-13T01:53:53.867" Title="how can I make a selectable list?" Tags="|package|helm-selection|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30649" PostTypeId="1" AcceptedAnswerId="30666" CreationDate="2017-02-12T04:53:06.537" Score="1" ViewCount="1244" Body="&lt;p&gt;I've added these keybinding configuration in my Spacemacs dot file, so that I can toggle the terminal by press the &lt;kbd&gt;\&lt;/kbd&gt; key.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Keybindings&#xA;(define-key evil-normal-state-map (kbd &quot;\\&quot;) 'spacemacs/default-pop-shell)&#xA;(define-key evil-motion-state-map (kbd &quot;\\&quot;) 'spacemacs/default-pop-shell)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, the terminal starts in &lt;strong&gt;evil-insert-state&lt;/strong&gt;. However, I have to go to &lt;strong&gt;evil-normal-state&lt;/strong&gt; to close the terminal window with  &lt;kbd&gt;\&lt;/kbd&gt;, which means, when I open the terminal again, it would be in &lt;strong&gt;evil-normal-state&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This inconsistence makes me feel bad. How can I make the popup terminal start in evil-normal-state?&lt;/p&gt;&#xA;" OwnerUserId="14867" LastEditorUserId="14867" LastEditDate="2017-02-12T07:36:00.153" LastActivityDate="2017-02-13T03:06:21.610" Title="Spacemacs - start popup terminal window in evil-normal-state" Tags="|spacemacs|evil|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30650" PostTypeId="1" AcceptedAnswerId="30651" CreationDate="2017-02-12T08:27:06.920" Score="4" ViewCount="2398" Body="&lt;pre&gt;&lt;code&gt;;; Specify the startup banner. Default value is `official', it displays&#xA;;; the official spacemacs logo. An integer value is the index of text&#xA;;; banner, `random' chooses a random text banner in `core/banners'&#xA;;; directory. A string value must be a path to an image format  supported&#xA;;; by your Emacs build.&#xA;;; If the value is nil then no banner is displayed. (default 'official)&#xA;dotspacemacs-startup-banner 'random&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I set &lt;code&gt;dotspacemacs-startup-banner&lt;/code&gt; to &lt;code&gt;'random&lt;/code&gt; in my dot file, I got the following warning message when executing &lt;code&gt;emacs --debug-init&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function insert-string)&#xA;  (insert-string (let ((temp-buffer (generate-new-buffer &quot; *temp*&quot;))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents file) (let ((banner-width 0)) (while (not ...) (let ... ...) (forward-line 1)) (goto-char 0) (let (...) (while ... ... ...))) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))&#xA;  spacemacs-buffer/insert-ascii-banner-centered(&quot;/Users/sunqingyao/.emacs.d/core/banners/000-banner.txt&quot;)&#xA;  (if (image-type-available-p (intern (file-name-extension banner))) (spacemacs-buffer//insert-image-banner banner) (spacemacs-buffer/insert-ascii-banner-centered banner))&#xA;  (progn (spacemacs-buffer/message (format &quot;Banner: %s&quot; banner)) (if (image-type-available-p (intern (file-name-extension banner))) (spacemacs-buffer//insert-image-banner banner) (spacemacs-buffer/insert-ascii-banner-centered banner)) (spacemacs-buffer//inject-version))&#xA;  (if banner (progn (spacemacs-buffer/message (format &quot;Banner: %s&quot; banner)) (if (image-type-available-p (intern (file-name-extension banner))) (spacemacs-buffer//insert-image-banner banner) (spacemacs-buffer/insert-ascii-banner-centered banner)) (spacemacs-buffer//inject-version)))&#xA;  (progn (if banner (progn (spacemacs-buffer/message (format &quot;Banner: %s&quot; banner)) (if (image-type-available-p (intern (file-name-extension banner))) (spacemacs-buffer//insert-image-banner banner) (spacemacs-buffer/insert-ascii-banner-centered banner)) (spacemacs-buffer//inject-version))) (spacemacs-buffer//insert-buttons) (spacemacs//redisplay))&#xA;  (let ((banner (spacemacs-buffer//choose-banner)) (buffer-read-only nil)) (progn (if banner (progn (spacemacs-buffer/message (format &quot;Banner: %s&quot; banner)) (if (image-type-available-p (intern (file-name-extension banner))) (spacemacs-buffer//insert-image-banner banner) (spacemacs-buffer/insert-ascii-banner-centered banner)) (spacemacs-buffer//inject-version))) (spacemacs-buffer//insert-buttons) (spacemacs//redisplay)))&#xA;  spacemacs-buffer/insert-banner-and-buttons()&#xA;  (save-excursion (if (&amp;gt; (buffer-size) 0) (progn (set (quote save-line) (line-number-at-pos)) (let ((inhibit-read-only t)) (erase-buffer)))) (spacemacs-buffer/set-mode-line &quot;&quot;) (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if (and (boundp (quote spacemacs-initialized)) spacemacs-initialized) (progn (configuration-layer/display-summary emacs-start-time) (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer//insert-footer) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (quote spacemacs-buffer//startup-hook) t)))&#xA;  (save-current-buffer (set-buffer (get-buffer-create spacemacs-buffer-name)) (page-break-lines-mode) (save-excursion (if (&amp;gt; (buffer-size) 0) (progn (set (quote save-line) (line-number-at-pos)) (let ((inhibit-read-only t)) (erase-buffer)))) (spacemacs-buffer/set-mode-line &quot;&quot;) (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if (and (boundp (quote spacemacs-initialized)) spacemacs-initialized) (progn (configuration-layer/display-summary emacs-start-time) (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer//insert-footer) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (quote spacemacs-buffer//startup-hook) t))))&#xA;  (progn (setq spacemacs-buffer--banner-length (window-width) spacemacs-buffer--last-width spacemacs-buffer--banner-length) (save-current-buffer (set-buffer (get-buffer-create spacemacs-buffer-name)) (page-break-lines-mode) (save-excursion (if (&amp;gt; (buffer-size) 0) (progn (set (quote save-line) (line-number-at-pos)) (let ((inhibit-read-only t)) (erase-buffer)))) (spacemacs-buffer/set-mode-line &quot;&quot;) (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if (and (boundp (quote spacemacs-initialized)) spacemacs-initialized) (progn (configuration-layer/display-summary emacs-start-time) (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startupify-lists))) (spacemacs-buffer//insert-footer) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (quote spacemacs-buffer//startup-hook) t)))) (if save-line (progn (goto-char (point-min)) (forward-line (1- save-line)) (forward-to-indentation 0)) (spacemacs-buffer/goto-link-line)) (switch-to-buffer spacemacs-buffer-name) (spacemacs//redisplay))&#xA;  (if (or (not (eq spacemacs-buffer--last-width (window-width))) (not buffer-exists) refresh) (progn (setq spacemacs-buffer--banner-length (window-width) spacemacs-buffer--last-width spacemacs-buffer--banner-length) (save-current-buffer (set-buffer (get-buffer-create spacemacs-buffer-name)) (page-break-lines-mode) (save-excursion (if (&amp;gt; (buffer-size) 0) (progn (set (quote save-line) (line-number-at-pos)) (let (...) (erase-buffer)))) (spacemacs-buffer/set-mode-line &quot;&quot;) (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if (and (boundp (quote spacemacs-initialized)) spacemacs-initialized) (progn (configuration-layer/display-summary emacs-start-time) (if dotspacemacs-startup-lists (progn ...)) (spacemacs-buffer//insert-footer) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (quote spacemacs-buffer//startup-hook) t)))) (if save-line (progn (goto-char (point-min)) (forward-line (1- save-line)) (forward-to-indentation 0)) (spacemacs-buffer/goto-link-line)) (switch-to-buffer spacemacs-buffer-name) (spacemacs//redisplay)))&#xA;  (let ((buffer-exists (buffer-live-p (get-buffer spacemacs-buffer-name))) (save-line nil)) (if (or (not (eq spacemacs-buffer--last-width (window-width))) (not buffer-exists) refresh) (progn (setq spacemacs-buffer--banner-length (window-width) spacemacs-buffer--last-width spacemacs-buffer--banner-length) (save-current-buffer (set-buffer (get-buffer-create spacemacs-buffer-name)) (page-break-lines-mode) (save-excursion (if (&amp;gt; (buffer-size) 0) (progn (set ... ...) (let ... ...))) (spacemacs-buffer/set-mode-line &quot;&quot;) (setq spacemacs-buffer--note-widgets nil) (spacemacs-buffer/insert-banner-and-buttons) (if (and (boundp ...) spacemacs-initialized) (progn (configuration-layer/display-summary emacs-start-time) (if dotspacemacs-startup-lists ...) (spacemacs-buffer//insert-footer) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (force-mode-line-update) (spacemacs-buffer-mode)) (add-hook (quote emacs-startup-hook) (quote spacemacs-buffer//startup-hook) t)))) (if save-line (progn (goto-char (point-min)) (forward-line (1- save-line)) (forward-to-indentation 0)) (spacemacs-buffer/goto-link-line)) (switch-to-buffer spacemacs-buffer-name) (spacemacs//redisplay))))&#xA;  spacemacs-buffer/goto-buffer()&#xA;  spacemacs/init()&#xA;  (if (not (version&amp;lt;= spacemacs-emacs-min-version emacs-version)) (message (concat &quot;Your version of Emacs (%s) is too old. &quot; &quot;Spacemacs requires Emacs version %s or above.&quot;) emacs-version spacemacs-emacs-min-version) (load-file (concat (file-name-directory load-file-name) &quot;core/core-load-paths.el&quot;)) (require (quote core-spacemacs)) (spacemacs/init) (spacemacs/maybe-install-dotfile) (configuration-layer/sync) (spacemacs-buffer/display-info-box) (spacemacs/setup-startup-hook) (require (quote server)) (if (server-running-p) nil (server-start)))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/Users/sunqingyao/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 1302&#xA;  load-with-code-conversion(&quot;/Users/sunqingyao/.emacs.d/init.el&quot; &quot;/Users/sunqingyao/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/Users/sunqingyao/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\266   \306=\203\307\310Q\202? \311=\204\307\312Q\202?\313\307\314\315#\203*\316\202?\313\307\314\317#\203&amp;gt;\320\321\322!D\nB\323\202?\316\324\325\324\211#\210\324=\203e\326\327\330\307\331Q!\&quot;\325\324\211#\210\324=\203d\210\203\247\332!\333\232\203\247\334!\211\335P\336!\203\201\211\202\214\336!\203\213\202\214\314\262\203\245\337\&quot;\203\243\340\341#\210\342\343!\210\266\f?\205\264\314\325\344\324\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; initialization format-message &quot;`_emacs' init file is deprecated, please use `.emacs'&quot; &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14867" LastActivityDate="2019-12-11T14:20:11.963" Title="Symbol's function definition is void: insert-string" Tags="|init-file|spacemacs|osx|functions|error-handling|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30651" PostTypeId="2" ParentId="30650" CreationDate="2017-02-12T08:39:01.907" Score="7" Body="&lt;p&gt;See &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/pull/7676&quot; rel=&quot;noreferrer&quot;&gt;this issue&lt;/a&gt;. This problem should be fixed in the next release.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quick fix:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change the function &lt;code&gt;insert-string&lt;/code&gt; to &lt;code&gt;insert&lt;/code&gt; in &lt;code&gt;~/.emacs.d/core/core-spacemacs-buffer.el&lt;/code&gt;, and everything works well.&lt;/p&gt;&#xA;" OwnerUserId="14867" LastActivityDate="2017-02-12T08:39:01.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30653" PostTypeId="1" CreationDate="2017-02-12T10:06:17.693" Score="2" ViewCount="274" Body="&lt;p&gt;After running &lt;code&gt;flyspell-buffer&lt;/code&gt;, all misspelled words are highlighted. However, after saving a word, all of the highlighting is gone. How can I avoid that? My &lt;code&gt;flyspell-persistent-highlight&lt;/code&gt; is set &lt;code&gt;t&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2023-12-12T12:01:50.187" Title="flyspell's highlight cleared after a &quot;save word&quot; action" Tags="|flyspell|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30654" PostTypeId="2" ParentId="30644" CreationDate="2017-02-12T10:51:47.953" Score="4" Body="&lt;p&gt;From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Recover.html&quot;&gt;documentation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If Emacs or the computer crashes, you can recover all the files you&#xA;  were editing from their auto save files with the command &lt;code&gt;M-x&#xA;  recover-session&lt;/code&gt;. This first shows you a list of recorded interrupted&#xA;  sessions. Move point to the one you choose, and type &lt;code&gt;C-c C-c&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Then recover-session asks about each of the files that were being&#xA;  edited during that session, asking whether to recover that file. If&#xA;  you answer y, it calls &lt;code&gt;recover-file&lt;/code&gt;, which works in its normal&#xA;  fashion. It shows the dates of the original file and its auto-save&#xA;  file, and asks once again whether to recover that file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="101" LastActivityDate="2017-02-12T10:51:47.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30656" PostTypeId="1" AcceptedAnswerId="31915" CreationDate="2017-02-12T13:48:54.847" Score="1" ViewCount="430" Body="&lt;p&gt;Since the last upgrade of org-plus-contrib to 20170210 I can no longer create clock tables in org mode. Computing the begin statement creates an empty table (see below) and throws the error &lt;code&gt;org-clocktable-write-default: Wrong type argument: char-or-string-p, nil&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: clocktable :maxlevel 5 :scope tree2 :tcolumns 1&#xA;#+CAPTION:  [2017-02-12 So 14:42]&#xA;|&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have not changed anything in the clocked tree nor in the init file. So, to me it seems that the error results from changes in the org-clocktable command. Have you also run into this error? Has anybody found a solution to that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE from 27.02.2017: The clocktable command works if I duplicate a single org file and run it as a different user with a not customised init file. Does anybody has a tip how to interpret the error message, so I can find the causing error in the init file?&lt;/p&gt;&#xA;" OwnerUserId="14395" LastEditorUserId="14395" LastEditDate="2017-02-27T15:18:58.243" LastActivityDate="2017-04-04T11:27:44.963" Title="Clock table report broken after upgrade" Tags="|org-mode|org-clock-table|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30659" PostTypeId="5" CreationDate="2017-02-12T20:11:33.667" Score="0" Body="&lt;p&gt;&lt;code&gt;use-package&lt;/code&gt; is the name of a package and the name of a macro that it provides. This macro is used in the &lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt; to configure packages using deferred and delayed loading to speed the start up of Emacs. &lt;code&gt;use-package&lt;/code&gt; also consolidates configuration steps before and after loading a package. It is also used to consolidate &lt;a href=&quot;/questions/tagged/key-bindings&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;key-bindings&amp;#39;&quot; rel=&quot;tag&quot;&gt;key-bindings&lt;/a&gt; to minimize overlaps and conflicts. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/jwiegley/use-package&quot; rel=&quot;nofollow noreferrer&quot;&gt;Use-package on Github&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="25" LastEditDate="2017-02-13T21:28:47.967" LastActivityDate="2017-02-13T21:28:47.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30660" PostTypeId="4" CreationDate="2017-02-12T20:11:33.667" Score="0" Body="is a macro package to isolate Emacs configuration lines in the init file. By isolating related lines, the configuration performs better and is easier to maintain. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-13T21:28:58.673" LastActivityDate="2017-02-13T21:28:58.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30661" PostTypeId="2" ParentId="30635" CreationDate="2017-02-12T20:20:24.377" Score="1" Body="&lt;p&gt;I was not able to narrow down what was causing the problem. I hacked Sunrise's code instead. If you suffer from a similar problem then follow my solution(hacky) solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit sunrise-commander.el, roughly on line 1370 there is a line that looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(split-window (selected-window) sr-panes-height)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change it to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(split-window (selected-window))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now preferably run &lt;code&gt;M-x byte-compile-file&lt;/code&gt; and select sunrise-commander.el to compile it and thus making it faster.&lt;/p&gt;&#xA;" OwnerUserId="13180" LastActivityDate="2017-02-12T20:20:24.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30662" PostTypeId="1" CreationDate="2017-02-12T20:47:49.557" Score="3" ViewCount="3060" Body="&lt;p&gt;I've just began playing with org-taskjuggler&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-taskjuggler.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/worg/org-tutorials/org-taskjuggler.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Although I've tried all sorts of .org examples, every time I end with efforts of length zero.  As show in the above tutorial I provided various values for the &amp;quot;Effort&amp;quot; property like&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;** Specification&#xA;   :PROPERTIES:&#xA;   :Effort:   20d      &#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lFTvK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lFTvK.png&quot; alt=&quot;Accounting Software Example&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Where does this come from?  What do I have to do to fix this?&lt;/p&gt;&#xA;&lt;p&gt;Using tj3 v3.6.0&lt;/p&gt;&#xA;" OwnerUserId="14892" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-03-19T23:55:25.563" Title="orgmode and taskjuggler" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30663" PostTypeId="1" AcceptedAnswerId="30812" CreationDate="2017-02-12T21:37:36.690" Score="2" ViewCount="1235" Body="&lt;p&gt;Within the emacs org-mode agenda timeline view, where items are separated by what I'm calling &quot;date headings&quot;, I'd like to be able to control how the dates appear.  Specifically, I'd like to abbreviate the day names and the month names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the default seems to be usage of full-names for the days and months:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Week-agenda (W06):&#xA;Monday      6 February 2017 W06&#xA;  Dated:      Scheduled:  TODO Backup laptop.&#xA;  Dated:      Scheduled:  PROJ Figure out quantum gravity.&#xA;  Habit:      TODO Feed pet whale.&#xA;Tuesday     7 February 2017&#xA;  Dated:      Scheduled:  TODO Buy new toothbrush.&#xA;  Dated:      Scheduled:  PROJ Resolve the Hodge conjecture.&#xA;Wednesday   8 February 2017&#xA;  Dated:      Scheduled:  TODO Clean finger nails.&#xA;  Dated:      Scheduled:  PROJ Create artificial life-form.&#xA;.&#xA;.&#xA;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'd like it to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Week-agenda (W06):&#xA;Mon       6 Feb 2017 W06&#xA;  Dated:    Scheduled:  TODO Backup laptop.&#xA;  Dated:    Scheduled:  PROJ Figure out quantum gravity.&#xA;  Habit:    TODO Feed pet whale.&#xA;Tue       7 Feb 2017&#xA;  Dated:    Scheduled:  TODO Buy new toothbrush.&#xA;  Dated:    Scheduled:  PROJ Resolve the Hodge conjecture.&#xA;Wed       8 Feb 2017&#xA;  Dated:    Scheduled:  TODO Clean finger nails.&#xA;  Dated:    Scheduled:  PROJ Create artificial life-form.&#xA;.&#xA;.&#xA;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to know how to make this change, and ideally I'd also like to know how I could have figured out how to do this by myself.  I tried browsing variables using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x org-customize RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but didn't see anything that seemed appropriate to modify.  I was thinking maybe I should be looking at the source code of org-mode to see if I could figure it out.&lt;/p&gt;&#xA;" OwnerUserId="14890" LastEditorUserId="14890" LastEditDate="2017-02-14T16:44:04.080" LastActivityDate="2017-02-18T00:11:47.513" Title="How to customize date headings in agenda timeline view?" Tags="|org-agenda|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30664" PostTypeId="2" ParentId="26945" CreationDate="2017-02-12T21:47:33.850" Score="2" Body="&lt;p&gt;Its a long time since I asked that question, and I have found an answer by myself now. For others I would like to post my findings here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically there are two different implementations of source code completion frameworks in spacemacs right now, one is company the other is ycmd. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to now company-clang does not support doc-strings for C++ code out of performance reasons. Ycmd does support them however I found them quite lacking, i.e. I did not receive doc-strings for system headers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More importantly ycmd did not integrate nicely into the C++ layer for example it did not share the path to the C++ system headers with company-header causing it to only show C headers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I have changed back to company now. Doc-strings are only shown for elisp and shell-script mode however I am not longer that dependent on it. I am now quite used to just searching the web when I am not sure what a certain function does or I just jump to the function definition and have a look for myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some words to the spacemacs beginner, as I have written this post I was not yet sure whether spacemacs would be able to be a real substitute for my good old graphical IDE. Now after some month of actually working with it I have to say that spacemacs really exceeded my expectations, it did not only prove that it could provide me with the same tools as Netbeans. It did also exceed it more than once and has not stopped yet to surprise me, which is a good thing. So if you also look for a better tool than the usual Eclipse or Netbeans I would suggest to have a look at spacemacs. &lt;/p&gt;&#xA;" OwnerUserId="14891" LastActivityDate="2017-02-12T21:47:33.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30665" PostTypeId="2" ParentId="30662" CreationDate="2017-02-12T23:17:43.600" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Where does this come from? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It comes from &lt;code&gt;Estimate the Effort&lt;/code&gt; section of the link you gave in the question.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What do I have to do to fix this?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Enter a property under each item like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** Specification&#xA;   :PROPERTIES:&#xA;   :Effort:   20d&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-02-12T23:17:43.600" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30666" PostTypeId="2" ParentId="30649" CreationDate="2017-02-13T01:42:06.680" Score="4" Body="&lt;p&gt;Perhaps &lt;code&gt;(evil-set-initial-state 'term-mode 'normal)&lt;/code&gt; will do what you want. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastEditorUserId="11934" LastEditDate="2017-02-13T03:06:21.610" LastActivityDate="2017-02-13T03:06:21.610" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30667" PostTypeId="2" ParentId="30647" CreationDate="2017-02-13T01:49:04.110" Score="3" Body="&lt;p&gt;Already referred by comments, &lt;code&gt;completing-read&lt;/code&gt; is the way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the code below may give you some insight, also includes helm/counsel integration below.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/lurdan/moomin-el/blob/lurdan/counsel-support/moomin.el#L323&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/lurdan/moomin-el/blob/lurdan/counsel-support/moomin.el#L323&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2017-02-13T01:49:04.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30668" PostTypeId="2" ParentId="30614" CreationDate="2017-02-13T02:07:53.950" Score="0" Body="&lt;p&gt;The &lt;code&gt;add-to-list&lt;/code&gt; form you show above should have the effect of adding the elpy repository to your &lt;code&gt;package-archives&lt;/code&gt;. So &lt;code&gt;C-h v package-archives&lt;/code&gt; should tell you:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;package-archives is a variable defined in ‘package.el’.&#xA;  Its value is ((&quot;elpy&quot; . &quot;&lt;a href=&quot;https://jorgenschaefer.github.io/packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://jorgenschaefer.github.io/packages/&lt;/a&gt;&quot;)&#xA;   (&quot;gnu&quot; . &quot;&lt;a href=&quot;http://elpa.gnu.org/packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://elpa.gnu.org/packages/&lt;/a&gt;&quot;))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Original value was &#xA;  ((&quot;gnu&quot; . &quot;&lt;a href=&quot;http://elpa.gnu.org/packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://elpa.gnu.org/packages/&lt;/a&gt;&quot;))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The fact that this isn't happening suggests that &lt;code&gt;add-to-list&lt;/code&gt; isn't getting executed properly. I'm not sure why this would be, given the steps you've described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to accomplish the same thing is to add the code (the &lt;code&gt;require&lt;/code&gt; and &lt;code&gt;add-to-list&lt;/code&gt; forms you quote) to your config file  (~/.emacs or ~/.emacs.d/init.el) and restart emacs. There's no harm in running those two lines every time you start emacs, and that should definitely set your &lt;code&gt;package-archives&lt;/code&gt; properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At that point, you should be able to proceed with installing elpy: &lt;code&gt;M-x package-refresh-contents&lt;/code&gt; followed by &lt;code&gt;M-x package-install RET elpy RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a bit odd though, as what you've described should work.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-13T02:07:53.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30669" PostTypeId="1" CreationDate="2017-02-13T03:14:35.393" Score="1" ViewCount="562" Body="&lt;p&gt;In the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Interactive-Shell.html#Interactive-Shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation for shell-mode&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emacs sends the new shell the contents of the file&#xA;  &lt;code&gt;~/.emacs_shellname&lt;/code&gt; as input, if it exists, where shellname is the&#xA;  name of the file that the shell was loaded from. For example, if you&#xA;  use bash, the file sent to it is &lt;code&gt;~/.emacs_bash&lt;/code&gt;. If this file is not&#xA;  found, Emacs tries with &lt;code&gt;~/.emacs.d/init_shellname.sh&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Everything works as expected when I enter shell-mode with &lt;code&gt;M-x shell&lt;/code&gt;. However, this doesn't work when I call &lt;code&gt;term&lt;/code&gt; or &lt;code&gt;ansi-term&lt;/code&gt; in Emacs. I have both &lt;code&gt;~/.emacs_bash&lt;/code&gt; and &lt;code&gt;~/.emacs.d/init_shellname.sh&lt;/code&gt; containing &lt;code&gt;export PS1='\h:\W$ '&lt;/code&gt;, but the prompt is still &lt;code&gt;bash-3.2$&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to set a startup shell script for term-mode?&lt;/p&gt;&#xA;" OwnerUserId="14867" LastActivityDate="2017-02-13T04:07:24.083" Title="Startup script for term-mode" Tags="|spacemacs|osx|shell|ansi-term|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30670" PostTypeId="2" ParentId="30669" CreationDate="2017-02-13T04:01:01.457" Score="3" Body="&lt;p&gt;If you run &lt;code&gt;bash&lt;/code&gt; in a &lt;code&gt;term&lt;/code&gt; buffer, bash will do all of its normal bash initialisation things, just as it would when you run it inside any other terminal emulator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can set your prompt in your &lt;code&gt;~/.bashrc&lt;/code&gt; file, no differently to the way you do it without Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you particularly wish to detect that the shell is running inside Emacs (in order to set some non-standard prompt, for instance), then there's an &lt;code&gt;INSIDE_EMACS&lt;/code&gt; environment variable you can test for. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;if [ -n &quot;$INSIDE_EMACS&quot; ]; then&#xA;    # [...]&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These days the value of &lt;code&gt;$INSIDE_EMACS&lt;/code&gt; varies in useful ways. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;M-x shell RET&#xA;$ echo $INSIDE_EMACS&#xA;25.2.1,comint&#xA;&#xA;M-x ansi-term RET /bin/bash RET&#xA;$ echo $INSIDE_EMACS&#xA;25.2.1,term:0.96&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-02-13T04:07:24.083" LastActivityDate="2017-02-13T04:07:24.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30671" PostTypeId="1" AcceptedAnswerId="30675" CreationDate="2017-02-13T04:38:21.517" Score="1" ViewCount="62" Body="&lt;p&gt;I have known using &lt;code&gt;(setq split-width-threshold 1)&lt;/code&gt; splitting windows in horizontal by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I want to only split a window such as &lt;code&gt;slime&lt;/code&gt; in horizontal and other window is vertical by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="14416" LastActivityDate="2017-02-13T06:58:26.350" Title="Split a special windows in horizontal" Tags="|window-splitting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30673" PostTypeId="1" CreationDate="2017-02-13T05:28:00.100" Score="3" ViewCount="182" Body="&lt;p&gt;I would like to have a single shortcut to jump to the next item on the imenu of current buffer.  E.g., if the current buffer is in org mode, next-imenu-item = org-next-visible-heading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone did that before?&lt;/p&gt;&#xA;" OwnerUserId="12987" LastActivityDate="2020-03-14T02:29:56.210" Title="next/prev-imenu-item function" Tags="|motion|imenu|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30674" PostTypeId="2" ParentId="3173" CreationDate="2017-02-13T06:34:19.157" Score="1" Body="&lt;p&gt;I was initially annoyed by the lack of a built-in solution to this problem, then realized that there was a built-in solution: kill-rectangle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you have text like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AAA BBBBBBBBB&#xA;AAA BBB&#xA;AAA BBBBBBB&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But want the 'B' part of the text somewhere else, like between these C and D lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CCCCC&#xA;CCC&#xA;DDDD&#xA;DD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you copy the B rectangle (&lt;code&gt;C-x r M-w&lt;/code&gt;) and then place point at the first 'D', then yank the rectangle back (&lt;code&gt;C-x r y&lt;/code&gt;), you end up with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CCCCC&#xA;CCC&#xA;BBBBBBBBBDDDD&#xA;BBB      DD&#xA;BBBBBBB  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where you really wanted&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CCCCC&#xA;CCC&#xA;BBBBBBBBB&#xA;BBB&#xA;BBBBBBB&#xA;DDDD&#xA;DD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It might seem natural to copy the rectangle of 'B's and yank them to the new location, but a better solution is to simply copy the lines 'A and 'B' lines and and yank them in their entirety between the 'C' and 'D' lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, mark the rectangle containing the 'A's and use &lt;code&gt;kill-rectangle&lt;/code&gt; (&lt;code&gt;C-x r k&lt;/code&gt;) to end with the desired result.&lt;/p&gt;&#xA;" OwnerUserId="4085" LastActivityDate="2017-02-13T06:34:19.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30675" PostTypeId="2" ParentId="30671" CreationDate="2017-02-13T06:58:26.350" Score="0" Body="&lt;p&gt;Thanks for @lawlist .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have find the solution and known more about &lt;code&gt;split-width-threshold&lt;/code&gt; and &lt;code&gt;split-height-thershold&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, emacs will split window in horizontal when the window's columns greater then 160 columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting a integer number to split window sensibly or set &lt;code&gt;split-window-preferred-function&lt;/code&gt; for a custom function for splitting.&lt;/p&gt;&#xA;" OwnerUserId="14416" LastActivityDate="2017-02-13T06:58:26.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30676" PostTypeId="1" AcceptedAnswerId="30681" CreationDate="2017-02-13T09:04:50.197" Score="7" ViewCount="719" Body="&lt;p&gt;If I'm in dired and have a subfolder with another dired buffer (a common situation when navigating up/down directory) and want to delete a folder, I hit &lt;code&gt;Dx&lt;/code&gt; to mark for deletion, then execute. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs then asks if I want to trash the folder. I confirm, then it asks if I want to kill the dired buffer of the folder as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't think of a situation where I'd like to trash the folder but keep the buffer. Is there a way to always trash the buffer when trashing the folder? &lt;/p&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="105" LastEditDate="2017-02-13T17:44:39.267" LastActivityDate="2017-02-13T17:44:39.267" Title="How to always kill dired buffer when deleting a folder?" Tags="|buffers|dired|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30677" PostTypeId="1" CreationDate="2017-02-13T09:39:58.253" Score="1" ViewCount="113" Body="&lt;p&gt;I am using projectile in a project with many externals (hg subrepositories). Each subrepository is treated as a separate project by Projectile. Is there any way to configure Projectile to automatically include subrepos to the main project? Or can/must this be done manually?&lt;/p&gt;&#xA;" OwnerUserId="14899" LastActivityDate="2017-02-13T09:39:58.253" Title="include hg subrepository in projectile" Tags="|projectile|mercurial|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30678" PostTypeId="1" AcceptedAnswerId="30679" CreationDate="2017-02-13T09:45:02.350" Score="4" ViewCount="256" Body="&lt;p&gt;When installing a package from the package menu, can/will &lt;code&gt;package-install&lt;/code&gt; do automatic byte compilation of the installed package files? Or is this something the user must do manually himself afterwards? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have installed &lt;code&gt;auctex&lt;/code&gt; from the package menu, but there are no &lt;code&gt;*.elc&lt;/code&gt; files in my &lt;code&gt;~/.emacs.d/elpa/auctex-11.89.5&lt;/code&gt; directory. Also I see from the &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;source of &lt;code&gt;package.el&lt;/code&gt;&lt;/a&gt; that there is a function &lt;code&gt;package--compile&lt;/code&gt; at line 942 (so that should indicate that it can byte-compile)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no mention of byte-compilation &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html#Package-Installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;in the Manual&lt;/a&gt; as far as I can see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also wondering that I might have deleted the &lt;code&gt;*.elc&lt;/code&gt; files myself and forgotten about it.&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2017-02-13T10:54:20.303" Title="Does package-install do byte-compilation?" Tags="|package|byte-compilation|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30679" PostTypeId="2" ParentId="30678" CreationDate="2017-02-13T10:54:20.303" Score="4" Body="&lt;p&gt;&lt;code&gt;package-install&lt;/code&gt; does byte-compile the files, yes.  Not sure how/why your auctex install doesn't have any .elc files, tho.  Maybe a bug, or a pilot error.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-02-13T10:54:20.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30680" PostTypeId="2" ParentId="30676" CreationDate="2017-02-13T11:12:52.090" Score="3" Body="&lt;p&gt;You can add the following snippet in your init file:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load  'dired                                                                                                               &#xA;  '(defun dired-clean-up-after-deletion (fn)&#xA;     &quot;My. Clean up after a deleted file or directory FN.                                                                               &#xA;Remove expanded subdir of deleted dir, if any.&quot;&#xA;     (save-excursion (and (cdr dired-subdir-alist)&#xA;                          (dired-goto-subdir fn)&#xA;                          (dired-kill-subdir)))&#xA;&#xA;     ;; Offer to kill buffer of deleted file FN.                                                                                       &#xA;     (if dired-clean-up-buffers-too&#xA;         (progn&#xA;           (let ((buf (get-file-buffer fn)))&#xA;             (and buf&#xA;                  (save-excursion ; you never know where kill-buffer leaves you                                                        &#xA;                    (kill-buffer buf))))&#xA;           (let ((buf-list (dired-buffers-for-dir (expand-file-name fn)))&#xA;                 (buf nil))&#xA;             (and buf-list&#xA;                  (while buf-list&#xA;                    (save-excursion (kill-buffer (car buf-list)))&#xA;                    (setq buf-list (cdr buf-list)))))))&#xA;     ;; Anything else?                                                                                                                 &#xA;     ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Courtesy of &lt;a href=&quot;https://stackoverflow.com/a/11567921/4055832&quot;&gt;pmielke&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also want to browse this Emacs wiki page about &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredReuseDirectoryBuffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;buffer reuse in Dired&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="101" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-02-13T11:12:52.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30681" PostTypeId="2" ParentId="30676" CreationDate="2017-02-13T11:14:40.880" Score="3" Body="&lt;p&gt;I think it is for safety. since it can be surprising if Emacs deletes an ordinary buffer without asking user. You can file a bug report if you want to. Meanwhile you can always advice &lt;code&gt;y-or-n-p&lt;/code&gt; to do what you want.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-advice dired-clean-up-after-deletion&#xA;    (:around (old-fun &amp;amp;rest r) kill-dired-buffer-quietly)&#xA;  (define-advice y-or-n-p (:around (old-fun prompt) just-yes)&#xA;    (if (string-prefix-p &quot;Kill Dired buffer&quot; prompt)&#xA;        t&#xA;      (funcall old-fun prompt)))&#xA;  (unwind-protect (apply old-fun r)&#xA;    (advice-remove 'y-or-n-p #'y-or-n-p@just-yes)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-02-13T11:14:40.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30683" PostTypeId="1" AcceptedAnswerId="30688" CreationDate="2017-02-13T12:56:59.107" Score="2" ViewCount="136" Body="&lt;p&gt;I want to define a struct for chores&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defstruct chore name sector assignments)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the &lt;code&gt;assignments&lt;/code&gt; slot is a vector with seven positions. I know that the above syntax will generate the getters &lt;code&gt;chore-name&lt;/code&gt;, &lt;code&gt;chore-sector&lt;/code&gt; and &lt;code&gt;chore-assignments&lt;/code&gt;. But I would like to have something like this &lt;code&gt;(chore-assignment 1 c)&lt;/code&gt;. Is there any syntax that will give me this “for free” or should I code the function myself?&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="105" LastEditDate="2017-02-13T17:27:11.977" LastActivityDate="2017-02-13T18:57:43.593" Title="Is there a syntax in Elisp for indexed getters and setters?" Tags="|syntax|data-structures|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30684" PostTypeId="1" CreationDate="2017-02-13T14:42:03.370" Score="0" ViewCount="395" Body="&lt;p&gt;I have a personal LaTeX class called &lt;code&gt;MyThesis&lt;/code&gt;, and I want to be able of exporting from &lt;code&gt;org&lt;/code&gt; to &lt;code&gt;LaTeX&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How can I call this class that is not in the main tree of &lt;code&gt;texlive&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this in my &lt;code&gt;.emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org&#xA;  :defer t&#xA;  :config&#xA;  (use-package ox-latex&#xA;    :defer 5&#xA;    :config&#xA;    (add-to-list 'org-latex-classes&#xA;         '(&quot;MyThesis&quot;&#xA;           &quot;\\documentclass{MyThesis}&quot;&#xA;           (&quot;\\part{%s}&quot; . &quot;\\part*{%s}&quot;)&#xA;           (&quot;\\chapter{%s}&quot; . &quot;\\chapter*{%s}&quot;)&#xA;           (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;           (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;           (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;))&#xA;         )&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I don't know how to tell it where if the file! (Shame on me!)&lt;/p&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="105" LastEditDate="2017-02-13T17:26:10.210" LastActivityDate="2017-02-13T19:29:13.380" Title="Exporting an `org` file to a personal LaTeX class" Tags="|org-mode|org-export|init-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30685" PostTypeId="2" ParentId="30251" CreationDate="2017-02-13T15:04:48.483" Score="0" Body="&lt;p&gt;I was experimenting similar issues and it was solved by step three in EIN guide to solve problems. Have you tried it?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[  ] I read &quot;Avoid standard Emacs traps&quot; section in&#xA;https://github.com/tkf/emacs-ipython-notebook/blob/master/CONTRIBUTING.md&#xA;[  ] I checked that IPython works with the browser interface.&#xA;[  ] I checked that the problem was not due to badly compiled&#xA;files. Removing *.elc files from source directory of EIN and&#xA;its dependencies did not solve the problem.&#xA;[  ] I checked that the libraries are loaded from intended place.&#xA;(You can check the location in the &quot;System info&quot; section below)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14902" LastActivityDate="2017-02-13T15:04:48.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30686" PostTypeId="2" ParentId="30202" CreationDate="2017-02-13T17:09:41.760" Score="2" Body="&lt;p&gt;The best &quot;solution&quot; I was able to find was to use the &quot;emacs-mac&quot; port of emacs (&lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/railwaycat/homebrew-emacsmacport&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew tap railwaycat/emacsmacport&#xA;&#xA;brew cask install emacs-mac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Although the emacs-mac port works very well (perhaps better than the nextstep port you get through brew install emacs), this is not a perfect answer because it would be nice to be able to compile standard emacs too.&lt;/p&gt;&#xA;" OwnerUserId="12681" LastActivityDate="2017-02-13T17:09:41.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30687" PostTypeId="2" ParentId="30684" CreationDate="2017-02-13T18:40:04.420" Score="1" Body="&lt;p&gt;Follow @tyler's advice first for finding locations in your TeX installation, but for the syntax for using use-package in your init.el, use this pared down example below. Note defer is implied. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org&#xA; :config&#xA;    (add-to-list 'org-latex-classes&#xA;        '(&quot;MyThesis&quot;&#xA;               &quot;\\documentclass{MyThesis}&quot;&#xA;               (&quot;\\part{%s}&quot; . &quot;\\part*{%s}&quot;)&#xA;               (&quot;\\chapter{%s}&quot; . &quot;\\chapter*{%s}&quot;)&#xA;               (&quot;\\section{%s}&quot; . &quot;\\section*{%s}&quot;)&#xA;               (&quot;\\subsection{%s}&quot; . &quot;\\subsection*{%s}&quot;)&#xA;               (&quot;\\subsubsection{%s}&quot; . &quot;\\subsubsection*{%s}&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-13T19:29:13.380" LastActivityDate="2017-02-13T19:29:13.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30688" PostTypeId="2" ParentId="30683" CreationDate="2017-02-13T18:57:43.593" Score="4" Body="&lt;p&gt;Yes and no. No, because &lt;code&gt;chore-assignment&lt;/code&gt; doesn't let you modify what's inside the value of the assignment slot; it only lets you modify the assignment slot itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, Lisp has &lt;code&gt;setf&lt;/code&gt;, which has some really good tricks up its sleeves. The first argument to &lt;code&gt;setf&lt;/code&gt; is a &lt;code&gt;PLACE&lt;/code&gt;, which is any expression which can be interpreted as a place to store a value. Often this is just a variable name, but it can be much more complex. Just based on your question, I think you've already been using something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf (chore-assignments c) (vector foo bar baz))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also do more:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setf (aref (chore-assignments c) 1) 42)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;code&gt;PLACE&lt;/code&gt; in this assignment is not the whole assignments vector, it's one individual element inside the vector, exactly as you wanted.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-13T18:57:43.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30689" PostTypeId="1" AcceptedAnswerId="30692" CreationDate="2017-02-13T19:56:32.040" Score="3" ViewCount="1183" Body="&lt;p&gt;I've got a file containing an emacs s-expression and I want to pretty print it from the command line: Is there an easy way of doing this? Paranoia suggests I want to do as little parsing of this data as possible&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Context (stack exchange loves context...): I'm doing some processing or org file data externally in a python process. I'm pushing out s-expressions and parsing them in python (with &lt;code&gt;sexpdata&lt;/code&gt;) because this is easier than munging stuff into json in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm considering coding up my own parser, or using sexpdata to parse it, or trying to use &lt;code&gt;emacsclient -exec&lt;/code&gt; or similar.&lt;/p&gt;&#xA;" OwnerUserId="14161" LastEditorUserId="105" LastEditDate="2017-02-13T21:18:59.760" LastActivityDate="2017-02-13T21:18:59.760" Title="Pretty print s expressions from the command line" Tags="|command-line-arguments|parsing|sexp|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30690" PostTypeId="1" AcceptedAnswerId="30704" CreationDate="2017-02-13T20:01:31.920" Score="13" ViewCount="3554" Body="&lt;p&gt;In a big C++ project I use dabberv-expand (aka M-/). Rtags, ctags, csope etc do not work by different reasons. Unfortunately I do not know how to enforce dabbrev to use a fuzzy search. So I decided to use ivy. The following code does almost everything I want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ivy-complete ()&#xA;  (interactive)&#xA;  (dabbrev--reset-global-variables)&#xA;  (let* ((abbrev (dabbrev--abbrev-at-point))&#xA;         (candidates (dabbrev--find-all-expansions abbrev t)))&#xA;    (when (not (null candidates))&#xA;      (let* ((found-match (ivy-read &quot;matches &quot; candidates&#xA;                                :preselect (thing-at-point 'word)&#xA;                                :sort t))&#xA;            (abbrev-length (length abbrev)))&#xA;        (insert (substring found-match abbrev-length))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One thing is missed. The completion shows the candidates in the minibuffer. I want them to be displayed in a popup window near the entry point. I tried to use     ivy-display-function-popup and ivy-display-function-overlay but failed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions: &#xA;how to show the candidates in a popup or overlay window? May be it is possible to use ivy as a backend for some other packet like company?&lt;/p&gt;&#xA;" OwnerUserId="14904" LastActivityDate="2017-02-14T11:08:02.827" Title="Code auto completion with ivy" Tags="|completion|ivy|counsel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30691" PostTypeId="2" ParentId="21171" CreationDate="2017-02-13T20:18:20.677" Score="3" Body="&lt;p&gt;Inspired by a comment from @cutejumper, I went ahead and wrote a simple company backend that recognizes the &lt;code&gt;^#+&lt;/code&gt; prefix to start using &lt;code&gt;pcomplete&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-keyword-backend (command &amp;amp;optional arg &amp;amp;rest ignored)&#xA;  (interactive (list 'interactive))&#xA;  (cl-case command&#xA;    (interactive (company-begin-backend 'org-keyword-backend))&#xA;    (prefix (and (eq major-mode 'org-mode)&#xA;                 (cons (company-grab-line &quot;^#\\+\\(\\w*\\)&quot; 1)&#xA;                       t)))&#xA;    (candidates (mapcar #'upcase&#xA;                        (cl-remove-if-not&#xA;                         (lambda (c) (string-prefix-p arg c))&#xA;                         (pcomplete-completions))))&#xA;    (ignore-case t)&#xA;    (duplicates t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use it with &lt;code&gt;(add-to-list 'company-backends 'org-keyword-backend)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want it to wait a certain number of characters into the keyword before offering completion, change line 7 from &lt;code&gt;t&lt;/code&gt; to the number you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want it to wait according to &lt;code&gt;company-minimum-prefix-length&lt;/code&gt;, change lines 6 / 7 from &lt;code&gt;(cons (company-grab-line ...) t)&lt;/code&gt; to just &lt;code&gt;(company-grab-line ...)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2017-02-13T20:18:20.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30692" PostTypeId="2" ParentId="30689" CreationDate="2017-02-13T20:29:52.310" Score="3" Body="&lt;p&gt;I think you should be able to do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient -e '(pp (with-temp-buffer (insert-file-contents &quot;my-file-containing sexp&quot;) (read (current-buffer))))'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that this will print a &lt;em&gt;string&lt;/em&gt; (e.g., &lt;code&gt;&quot;[foo\n bar]&quot;&lt;/code&gt;), so to see it on the screen you will need&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo -e $(emacsclient ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can control the behavior of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Output-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;pp&lt;/code&gt;&lt;/a&gt; with &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Output-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;many variables&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2017-02-13T20:29:52.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30694" PostTypeId="1" CreationDate="2017-02-13T20:54:47.820" Score="2" ViewCount="217" Body="&lt;p&gt;In emacs, the command &lt;code&gt;M-x grep&lt;/code&gt; runs &lt;code&gt;grep&lt;/code&gt; program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a command in emacs for running &lt;code&gt;find&lt;/code&gt; in &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwi4isaY-o3SAhXGOhQKHYRbALsQjBAIIjAB&amp;amp;url=https%3A%2F%2Fwww.gnu.org%2Fsoftware%2Ffindutils%2Fmanual%2Ffind.html&amp;amp;usg=AFQjCNGZXm0XqkPF-djvP--5guSlhO0XmQ&quot; rel=&quot;nofollow noreferrer&quot;&gt;findutils&lt;/a&gt;, or do similar thing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="105" LastEditDate="2017-05-16T22:30:57.880" LastActivityDate="2017-05-16T22:30:57.880" Title="Is there a command in emacs similar to `find` in findutils?" Tags="|files|grep|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30695" PostTypeId="2" ParentId="30694" CreationDate="2017-02-13T21:03:55.037" Score="3" Body="&lt;p&gt;&lt;code&gt;find-dired&lt;/code&gt; will run &lt;code&gt;find&lt;/code&gt; for you.&lt;/p&gt;&#xA;" OwnerUserId="13752" LastActivityDate="2017-02-13T21:03:55.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30696" PostTypeId="2" ParentId="30694" CreationDate="2017-02-14T01:24:37.223" Score="1" Body="&lt;p&gt;Also if you are specifically looking to combine &lt;code&gt;find&lt;/code&gt; with &lt;code&gt;grep&lt;/code&gt;, see &lt;code&gt;rgrep&lt;/code&gt;, &lt;code&gt;lgrep&lt;/code&gt;, and &lt;code&gt;grep-find&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-02-14T01:24:37.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30697" PostTypeId="2" ParentId="19170" CreationDate="2017-02-14T01:44:24.960" Score="7" Body="&lt;p&gt;It sounds like you may not be familiar with Emacs' built-in accented character input system?  Run &lt;code&gt;toggle-input-method&lt;/code&gt; and you can pick from tons of different input methods.  Start with something simple like &lt;code&gt;latin-postfix&lt;/code&gt; and every time you type a character that has possible combining accents defined for the input method, there is an indicator in the minibuffer of the choices of keys you can strike to accent or modify the first character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMHO once you get familiar with one of these input methods it is much simpler and faster to use this than the &quot;Press and Hold&quot; dialog model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more about this in the &lt;code&gt;info&lt;/code&gt; manual section &quot;International Character Set Support&quot;.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-02-14T01:44:24.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30698" PostTypeId="2" ParentId="30694" CreationDate="2017-02-14T02:34:44.203" Score="1" Body="&lt;p&gt;There are many &lt;code&gt;find&lt;/code&gt; commands that you could use directly or configure to specifically use the external &lt;code&gt;find&lt;/code&gt; command from &lt;code&gt;findutils&lt;/code&gt;. Here are some (besides the ones already mentioned by others above) that you can explore via &lt;code&gt;C-h f&lt;/code&gt; documentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;find-file&#xA;find-grep&#xA;find-library&#xA;find-function&#xA;find-variable&#xA;find-name-dired&#xA;find-dired&#xA;grep-find&#xA;helm-find&#xA;find-grep-dired&#xA;ido-find-file &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-02-14T02:34:44.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30699" PostTypeId="1" AcceptedAnswerId="30718" CreationDate="2017-02-14T02:49:00.820" Score="7" ViewCount="196" Body="&lt;p&gt;Is there a way to highlight (set the background color for example) the space before a line, when it's indentation isn't aligned to the current indentation-width?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 spaces indentation for eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fn my_func() {&#xA;    if foo() {&#xA;        ##bar();&#xA;        blob();&#xA;    ###fez();&#xA;        baz();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the &lt;code&gt;#&lt;/code&gt; characters represent the background showing a different color, back until the indentation is aligned to 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this is only useful when code follows strict indentation conventions.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note that I'm aware of emacs advanced auto-indentation features and indent-highlighting plugins, but would prefer something less intrusive that only shows up when there is an issue. A little like highlighting trailing spaces.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-02-14T23:44:44.360" LastActivityDate="2017-02-16T07:51:20.737" Title="How to highlight preceeding space-indentation that isn't rounded to current width?" Tags="|indentation|whitespace|highlighting|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30700" PostTypeId="1" AcceptedAnswerId="30701" CreationDate="2017-02-14T03:29:42.453" Score="1" ViewCount="759" Body="&lt;p&gt;I'd like to use a captured columnview block as a variable for another source block. The Block of which looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+Name: Room-Table&#xA;#+BEGIN: columnview :skip-empty-rows t   &#xA;|Big ol table|&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I checked that the table properly exports, which it does. However if I try to use the data in that table like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :var t=Room-Table&#xA;t&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get an error that reads:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Reference not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a different error than if you try to use a variable that doesn't appear in the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried a few things, like tangling the block out, which doesn't work or calling it the the #+CALL: header which doesn't seem to do anything either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally I looked online, however the only documentation on Dynamic blocks is very sparse, and lacking anything besides setting them up.&lt;/p&gt;&#xA;" OwnerUserId="11045" LastEditorUserId="11045" LastEditDate="2017-02-14T18:44:53.067" LastActivityDate="2017-02-14T18:44:53.067" Title="Calling Dynamic Blocks" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30701" PostTypeId="2" ParentId="30700" CreationDate="2017-02-14T05:53:00.527" Score="3" Body="&lt;p&gt;I figured it out:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN: columnview :skip-empty-rows t&#xA;#+Name: Room-Table   &#xA;|Big ol table|&#xA;#+END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You just have to have the name inside the dynamic block.&lt;/p&gt;&#xA;" OwnerUserId="11045" LastActivityDate="2017-02-14T05:53:00.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30703" PostTypeId="1" AcceptedAnswerId="35027" CreationDate="2017-02-14T10:54:12.067" Score="2" ViewCount="1027" Body="&lt;p&gt;How does one navigate up one directory whilst in speedbar without using the mouse?&lt;/p&gt;&#xA;" OwnerUserId="3944" LastEditorUserId="3944" LastEditDate="2017-02-14T16:53:03.587" LastActivityDate="2017-08-21T00:15:29.367" Title="Command to navigate up one directory in speedbar?" Tags="|speedbar|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30704" PostTypeId="2" ParentId="30690" CreationDate="2017-02-14T11:08:02.827" Score="11" Body="&lt;p&gt;What you want can be achieved by adding a new source to &lt;code&gt;completion-at-point-functions&lt;/code&gt;. This isn't specific to &lt;code&gt;ivy&lt;/code&gt;, but &lt;code&gt;ivy&lt;/code&gt; makes use of it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cl prettyprint-override&quot;&gt;&lt;code&gt;(defun dabbrev-complation-at-point ()&#xA;  (dabbrev--reset-global-variables)&#xA;  (let* ((abbrev (dabbrev--abbrev-at-point))&#xA;         (candidates (dabbrev--find-all-expansions abbrev t))&#xA;         (bnd (bounds-of-thing-at-point 'symbol)))&#xA;    (list (car bnd) (cdr bnd) candidates)))&#xA;(add-to-list 'completion-at-point-functions 'dabbrev-complation-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After this setup (make sure to do it for the proper &lt;code&gt;major-mode&lt;/code&gt; using its hook), press &lt;kbd&gt;C-M-i&lt;/kbd&gt; (&lt;code&gt;complete-symbol&lt;/code&gt;) to get the list of completions.&#xA;If you have &lt;code&gt;ivy-mode&lt;/code&gt; on, this list will be shown inline for recent versions of &lt;code&gt;ivy&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2017-02-14T11:08:02.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30705" PostTypeId="2" ParentId="28535" CreationDate="2017-02-14T11:32:36.403" Score="2" Body="&lt;p&gt;UPDATE as of 2017-02-14: With &lt;a href=&quot;https://github.com/flycheck/flycheck/pull/1199&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; pull-request merged, now you just have to set &lt;code&gt;sentence-end-double-space&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; and that's it. More information &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/1212&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12585" LastActivityDate="2017-02-14T11:32:36.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30706" PostTypeId="1" AcceptedAnswerId="30717" CreationDate="2017-02-14T13:08:58.430" Score="2" ViewCount="239" Body="&lt;p&gt;So I'm trying to send a bunch of marked files to picard with dired's '&amp;amp;' (&lt;code&gt;dired-do-async-shell-command&lt;/code&gt;).&#xA;In the normal command line this opens one instance of picard with all the selected files:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;picard 01\ -\ Snail\ -\ Underwater.ogg 02\ -\ Alain\ Johannes\ -\ Kaleidoscope.ogg &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in dired when I mark a few files and issue &lt;code&gt;&amp;amp; picard&lt;/code&gt; I get two instances of picard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one make dired send all mark files into one picard instance?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorUserId="13981" LastEditDate="2017-02-14T17:02:18.437" LastActivityDate="2017-02-14T21:58:27.277" Title="multiple marked files in `dired-do-async-shell-command ` open seperate instances of app (picard)..how does one pass them as a list?" Tags="|dired|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30707" PostTypeId="1" CreationDate="2017-02-14T14:40:52.597" Score="1" ViewCount="261" Body="&lt;p&gt;Is there a way to prevent emacs from folding the buffer menu? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example, when I Control + 'right click' on a buffer I see a menu like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Buffer Menu&#xA;-----------&#xA;JavaScript &amp;gt;&#xA;XQuery &amp;gt;&#xA;Custom &amp;gt;&#xA;Others &amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Sometimes, I have to look in under 2 or 3 submenus to find the file I'm looking for. I'd like just to see a list of all files, even if there are many.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried customizing buffer menu but I did not see the option. &lt;/p&gt;&#xA;" OwnerUserId="10933" LastEditorUserId="105" LastEditDate="2017-02-14T14:47:49.853" LastActivityDate="2017-02-14T14:47:49.853" Title="how to prevent buffer menu from folding" Tags="|buffers|customize|menus|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30708" PostTypeId="2" ParentId="30706" CreationDate="2017-02-14T14:51:11.920" Score="0" Body="&lt;p&gt;You can use &lt;strong&gt;&lt;code&gt;w&lt;/code&gt;&lt;/strong&gt; in Dired to copy the names of the marked files to the &lt;code&gt;kill-ring&lt;/code&gt;, for later yanking (pasting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, when you use a command such as &lt;code&gt;&amp;amp;&lt;/code&gt; (&lt;code&gt;dired-do-async-shell-command&lt;/code&gt;), you can yank that list of files into the shell command input where needed.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-14T14:51:11.920" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30709" PostTypeId="1" AcceptedAnswerId="30710" CreationDate="2017-02-14T15:06:03.303" Score="4" ViewCount="241" Body="&lt;p&gt;&lt;code&gt;M-x revert-buffer&lt;/code&gt; resets the active minor modes to the defaults for the underlying file. How can I preserve the minor modes active while reverting the buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun revert ()&#xA;  (interactive)&#xA;  (let ((active-modes minor-mode-list))&#xA;   (revert-buffer t t)&#xA;   (setq minor-mode-list active-modes)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seemed broadly reasonable. Save minor-mode-list, revert the buffer, setq to restore. Calling (revert) seems to be exactly equivalent to calling revert-buffer and I'm not sure how to debug this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="12719" LastActivityDate="2017-02-14T15:32:17.970" Title="How to revert a buffer without changing active modes?" Tags="|buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30710" PostTypeId="2" ParentId="30709" CreationDate="2017-02-14T15:32:17.970" Score="7" Body="&lt;p&gt;I think you're missing the third argument to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Reverting.html&quot;&gt;revert-buffer&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Optional third argument PRESERVE-MODES non-nil means don’t alter&#xA;  the files modes.  Normally we reinitialize them using ‘normal-mode’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That should do exactly what you want, without requiring any further book-keeping on your part.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-14T15:32:17.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30711" PostTypeId="1" AcceptedAnswerId="30716" CreationDate="2017-02-14T15:44:38.717" Score="1" ViewCount="651" Body="&lt;p&gt;I'd like to apply a &lt;code&gt;line-height&lt;/code&gt; property to all text in all buffers to add space above each line (so &lt;code&gt;line-spacing&lt;/code&gt; doesn't work, I think).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added a function to &lt;code&gt;'buffer-list-update-hook&lt;/code&gt; to create and propertize an overlay that spans the entire buffer (also set to grow with text on either end). This works, but feels like a big hack for something this simple. Is there no better way of doing this?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar fov-line-height-overlay nil&#xA;  &quot;Overlay used to manage line-height across the buffer&quot;)&#xA;(make-variable-buffer-local 'fov-line-height-overlay)&#xA;&#xA;(defun fov-update-line-height-overlays ()&#xA;  &quot;Run through the list of buffers and ensure they have an overlay for line-height.&quot;&#xA;  (dolist (buf (buffer-list))&#xA;    (with-current-buffer buf&#xA;      (unless fov-line-height-overlay&#xA;        (setq fov-line-height-overlay (make-overlay (point-min) (point-max) nil nil t))&#xA;        (overlay-put fov-line-height-overlay 'line-height 1.2)))))&#xA;&#xA;(add-hook 'buffer-list-update-hook 'fov-update-line-height-overlays)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS&lt;/strong&gt;: The reason I'm doing this is I've set the &lt;code&gt;hl-line&lt;/code&gt; face to have a box with &lt;code&gt;:line-width -1&lt;/code&gt; (to avoid jitter while moving) but now I need more space for the text.&lt;/p&gt;&#xA;" OwnerUserId="9356" LastActivityDate="2017-04-15T21:19:18.197" Title="Robust way of applying line-height everywhere" Tags="|line-spacing|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30712" PostTypeId="5" CreationDate="2017-02-14T17:02:17.590" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-14T17:02:17.590" LastActivityDate="2017-02-14T17:02:17.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30713" PostTypeId="4" CreationDate="2017-02-14T17:02:17.590" Score="0" Body="is the code searching tool similar to `ack` but uses `pthreads` for faster searches. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-14T21:20:58.563" LastActivityDate="2017-02-14T21:20:58.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30714" PostTypeId="1" CreationDate="2017-02-14T17:19:42.280" Score="6" ViewCount="314" Body="&lt;p&gt;I'm running code in development using docker.  I do that using the &lt;code&gt;-v&lt;/code&gt; flag to &lt;code&gt;docker run&lt;/code&gt; to mount my code in the container.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've set &lt;code&gt;directory-abbrev-alist&lt;/code&gt; and configured &lt;code&gt;compilation-error-regexp-alist-alist&lt;/code&gt; appropriately, so I can click on links in stack traces and jump to the corresponding place in the source code (e.g. in &lt;code&gt;bt&lt;/code&gt; output from &lt;code&gt;M-x pdb&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, that doesn't give me gud's debug arrow pointing to the current line of the active stack frame.  For example, when I run the &lt;code&gt;bt&lt;/code&gt; command in pdb, I don't see a window open visiting the appropriate file with the arrow in the fringe pointing at the line of the python stack frame I'm currently on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past I've resorted to creating symlinks on the docker host (for example from &lt;code&gt;/opt/someproject&lt;/code&gt; to &lt;code&gt;/home/me/dev/someproject&lt;/code&gt;).  That fixes the problem.  But these may differ from one container to another.  It's inconvenient to keep these up-to-date, not to mention a bit hacky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I fix this using elisp configuration rather than via symlinks?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2019-01-04T12:06:03.543" LastActivityDate="2019-01-04T12:06:03.543" Title="How to map file paths when using docker" Tags="|gud|path|docker|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30715" PostTypeId="1" CreationDate="2017-02-14T18:40:56.447" Score="1" ViewCount="290" Body="&lt;p&gt;Given the following file, named as &lt;code&gt;x.cpp&lt;/code&gt; I get the following unexpected indentation behavior:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;class X {&#xA;public:&#xA;     X()&#xA;          {  // &amp;lt;-- Why the indent?&#xA;               printf(&quot;Hello!&quot;);&#xA;          }&#xA;};&#xA;int main() { X x; }&#xA;&#xA;// Local Variables:&#xA;// c-file-style: &quot;k&amp;amp;r&quot;&#xA;// End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that this file is not valid C source, but if I rename the file to &lt;code&gt;x.c&lt;/code&gt; and re-indent, I suddenly get the expected indentation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;&#xA;class X {&#xA;public:&#xA;     X()&#xA;     {  // &amp;lt;-- Looks good&#xA;          printf(&quot;Hello!&quot;);&#xA;     }&#xA;};&#xA;int main() { X x; }&#xA;&#xA;// Local Variables:&#xA;// c-file-style: &quot;k&amp;amp;r&quot;&#xA;// End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, the problem is a difference in the way the file is parsed syntactically in the two different major modes.  In C mode, the brace on line 5 is seen as &lt;code&gt;substatement-open&lt;/code&gt;, while in C++ mode it is seen as &lt;code&gt;inline-open&lt;/code&gt;.  Since the emacs definition of &quot;k&amp;amp;r&quot; style doesn't specify an indent for &lt;code&gt;inline-open&lt;/code&gt; it defaults to something silly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question then, is whether it is reasonable to expect that &quot;k&amp;amp;r&quot; indentation style should work in C++.  In other words, should I file an emacs bug for this?  Or am I missing something that would make this work as expected?&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2017-02-14T18:40:56.447" Title="Should K&amp;R indentation work in C++ code?" Tags="|indentation|c++|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30716" PostTypeId="2" ParentId="30711" CreationDate="2017-02-14T20:19:27.293" Score="4" Body="&lt;p&gt;Add a function to &lt;code&gt;buffer-access-fontify-functions&lt;/code&gt; that calls &lt;code&gt;put-text-properties&lt;/code&gt; on the required substring. This is called by buffer-substring to lazily set up the text properties, so this will ensure that everything has the property as soon as it is needed, without mucking about with overlays. See section 31.19.7 Lazy Computation of Text Properties of the Emacs manual for the details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either way it is a bit of a hack, simply because Emacs doesn't have a very sophisticated or complete rendering model. This feels like less of a hack, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want something that's even nicer, I recommend diving into the rendering code and changing it so that &lt;code&gt;line-spacing&lt;/code&gt; can be a list of two numbers, one for space below and one for space above the line. Then push that change out to the mailing list and see what they think of it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-14T20:19:27.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30717" PostTypeId="2" ParentId="30706" CreationDate="2017-02-14T21:58:27.277" Score="3" Body="&lt;p&gt;Please read the docstring of &lt;code&gt;dired-do-shell-command&lt;/code&gt;, in particular this part:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If there is a ‘*’ in COMMAND, surrounded by whitespace, this runs&#xA;COMMAND just once with the entire file list substituted there.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This means you can run the command once just with &lt;code&gt;&amp;amp; picard * RET&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="478" LastActivityDate="2017-02-14T21:58:27.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30718" PostTypeId="2" ParentId="30699" CreationDate="2017-02-14T22:08:28.343" Score="3" Body="&lt;p&gt;Using font-lock...&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(font-lock-add-keywords nil&#xA;  '((&quot;^ \\{4\\}*\\( \\{1,3\\}\\)[^ ]&quot; 1 'match)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastEditorUserId="5253" LastEditDate="2017-02-16T05:03:07.287" LastActivityDate="2017-02-16T05:03:07.287" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30719" PostTypeId="2" ParentId="29938" CreationDate="2017-02-14T22:52:36.783" Score="2" Body="&lt;p&gt;You may not be installing it using Spacemacs conventions. You should add &lt;code&gt;key-chord&lt;/code&gt; to &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt; in &lt;code&gt;dotspacemacs/layers&lt;/code&gt;. &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt; may already be present in your .spacemacs file, but if not, add it like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dotspacemacs-additional-packages '(key-chord)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an &lt;a href=&quot;https://github.com/NJBS/dotfiles/blob/master/.spacemacs#L74&quot; rel=&quot;nofollow noreferrer&quot;&gt;example&lt;/a&gt; of a .spacemacs file that includes &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may need to restart Spacemacs after adding it, or &lt;code&gt;SPC f e R&lt;/code&gt; (to reload configuration) may be sufficient. You can find additional documentation on the subject in &lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION#without-a-layer&quot; rel=&quot;nofollow noreferrer&quot;&gt;this section&lt;/a&gt; of the documentation.&lt;/p&gt;&#xA;" OwnerUserId="14915" LastActivityDate="2017-02-14T22:52:36.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30720" PostTypeId="2" ParentId="21867" CreationDate="2017-02-14T23:02:42.273" Score="0" Body="&lt;p&gt;Extension &lt;a href=&quot;https://www.emacswiki.org/emacs/tabbar.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tabbar&lt;/a&gt; exactly what I looking for.&lt;/p&gt;&#xA;" OwnerUserId="11847" LastActivityDate="2017-02-14T23:02:42.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30721" PostTypeId="5" CreationDate="2017-02-14T23:51:41.327" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-14T23:51:41.327" LastActivityDate="2017-02-14T23:51:41.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30722" PostTypeId="4" CreationDate="2017-02-14T23:51:41.327" Score="0" Body="refers to the shape of the selected text area; it can be any arbitrary rectangular area of the text buffer extending multiple lines and need not include the entire line." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T15:30:38.567" LastActivityDate="2017-02-15T15:30:38.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30723" PostTypeId="5" CreationDate="2017-02-14T23:56:50.713" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-14T23:56:50.713" LastActivityDate="2017-02-14T23:56:50.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30724" PostTypeId="4" CreationDate="2017-02-14T23:56:50.713" Score="0" Body="is the application of styles to source code and markup text content for printing purposes. Styles may be as simple as line wrapping to complex layouts, indentations, coloring, fonts, and syntax highlighting." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T15:29:39.273" LastActivityDate="2017-02-15T15:29:39.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30725" PostTypeId="5" CreationDate="2017-02-14T23:59:19.023" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-14T23:59:19.023" LastActivityDate="2017-02-14T23:59:19.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30726" PostTypeId="4" CreationDate="2017-02-14T23:59:19.023" Score="0" Body="specifying fonts and font enhancements, and in Emacs, fonts are closely associated with `face` and `font-lock` features. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T15:30:28.343" LastActivityDate="2017-02-15T15:30:28.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30727" PostTypeId="5" CreationDate="2017-02-15T00:02:16.923" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-15T00:02:16.923" LastActivityDate="2017-02-15T00:02:16.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30728" PostTypeId="4" CreationDate="2017-02-15T00:02:16.923" Score="0" Body="are configuration parameters for the graphical X client applications. They are usually specified in user-level configuration `dotfile`, typically located at ~/.Xresources." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T15:30:46.907" LastActivityDate="2017-02-15T15:30:46.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30729" PostTypeId="1" CreationDate="2017-02-15T04:39:45.893" Score="0" ViewCount="343" Body="&lt;p&gt;I really, really like Clojure-style maps:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{:keyword &quot;value&quot;&#xA; :keyword2 'value2}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which can be used like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(get my-map :keyword)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or, even better,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(:keyword my-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I teach Elisp how to do this?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-04-23T02:06:31.660" Title="Is it possible to define all keywords' function definitions as plist-get?" Tags="|syntax|property-lists|" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30730" PostTypeId="2" ParentId="30729" CreationDate="2017-02-15T04:44:14.080" Score="1" Body="&lt;p&gt;I don't believe it's possible to teach Elisp to default to this behavior, but you can write a function that does the job for a defined set of keywords:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun defgetters (&amp;amp;rest keywords)&#xA;  (when-let ((this-keyword (car keywords)))&#xA;    (defalias this-keyword&#xA;      (lambda (plist) (plist-get plist this-keyword)))&#xA;    (apply #'defgetters (cdr keywords))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2017-02-15T05:28:23.010" LastActivityDate="2017-02-15T05:28:23.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30732" PostTypeId="2" ParentId="14708" CreationDate="2017-02-15T08:37:39.120" Score="0" Body="&lt;p&gt;(Answering the general question on the title of this question)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try using &lt;a href=&quot;https://github.com/dholm/benchmark-init-el&quot; rel=&quot;nofollow noreferrer&quot;&gt;benchmark-init package&lt;/a&gt;. It provides detailed timing information on the package 'require' operations and other load times during Emacs initialization.&lt;/p&gt;&#xA;" OwnerUserId="12943" LastActivityDate="2017-02-15T08:37:39.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30734" PostTypeId="1" AcceptedAnswerId="30809" CreationDate="2017-02-15T09:14:48.913" Score="6" ViewCount="79" Body="&lt;p&gt;The regex info material suggests that &lt;code&gt;\\c6&lt;/code&gt; should match digit characters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In UTF-8 encoded buffers it doesn't; some of the other category letters work as expected (&lt;code&gt;l&lt;/code&gt;, &lt;code&gt;|&lt;/code&gt;, &lt;code&gt;a&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shouldn't &lt;code&gt;\\c6*&lt;/code&gt; match &lt;code&gt;456&lt;/code&gt; in &lt;code&gt;test456test&lt;/code&gt;? What do I overlook, misunderstand? &lt;/p&gt;&#xA;" OwnerUserId="295" LastActivityDate="2017-02-17T22:03:10.200" Title="Matching categories '\cX' and digit" Tags="|regular-expressions|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30735" PostTypeId="1" AcceptedAnswerId="30737" CreationDate="2017-02-15T09:21:35.893" Score="0" ViewCount="1654" Body="&lt;p&gt;This question is related to the solution &lt;a href=&quot;https://emacs.stackexchange.com/users/654/nanny&quot;&gt;nanny&lt;/a&gt; provides to the xml beautifying problem on this answer: &lt;a href=&quot;https://emacs.stackexchange.com/questions/14197/how-to-prettify-format-an-xml-buffer/14201#14201&quot;&gt;How to prettify/format an XML buffer?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;This works for me on Emacs 24.5 on Windows, but I want to know what does &amp;quot;xmllint --format -&amp;quot; parameter of the shell-command-on-region function mean? Apparently &amp;quot;xmllint --format&amp;quot; does not work and when I run &amp;quot;xmllint --format -&amp;quot; in the Windows shell it waits for my input instead of returning to the command interpreter. I am able to input an xml document data from the console and after pressing Ctrl-z RET get my input beautified back to the console.&lt;/p&gt;&#xA;&lt;p&gt;I am curious what exactly the role of the trailing dash in the shell command execution string is.&lt;/p&gt;&#xA;" OwnerUserId="14919" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-02-15T19:54:45.343" Title="What does trailing dash mean in the shell command parameter list?" Tags="|shell|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30736" PostTypeId="2" ParentId="30735" CreationDate="2017-02-15T10:00:58.510" Score="3" Body="&lt;p&gt;This isn't really an Emacs question, and it's not even really a question about command shells. It's a convention adopted by a fair number of command-line programs that take filenames as command-line arguments. When you specify &lt;code&gt;-&lt;/code&gt; as the filename, they instead read from stdin (or write to stdout).&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-15T10:00:58.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30737" PostTypeId="2" ParentId="30735" CreationDate="2017-02-15T10:01:42.607" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;A token consisting of a single hyphen character is interpreted as an ordinary non-option argument. By convention, it is used to specify input from or output to the standard input and output streams.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Taken from: &lt;a href=&quot;https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, this means that arguments will come from standard input.&lt;/p&gt;&#xA;" OwnerUserId="563" LastActivityDate="2017-02-15T10:01:42.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30738" PostTypeId="1" CreationDate="2017-02-15T10:44:10.867" Score="5" ViewCount="3493" Body="&lt;p&gt;When writing scientific papers within &lt;code&gt;org-mode&lt;/code&gt;, the usual way to go is to specify citations, e.g., with the help of &lt;code&gt;org-ref&lt;/code&gt; and then to export the whole thing to LaTeX/PDF, which does also resolve the citations based on a BibTeX database. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this works out very well in everyday work, I would be curious to learn whether it is also possible to stay within &lt;code&gt;org-mode&lt;/code&gt; proper, hence to have all the references &lt;strong&gt;automatically&lt;/strong&gt; resolved and printed at the end of the &lt;code&gt;org-mode&lt;/code&gt; file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would have two nice consequences that I miss so far:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The export to HTML would also include resolved references.&lt;/li&gt;&#xA;&lt;li&gt;Similarly, the export with &lt;code&gt;ox-reveal&lt;/code&gt; (for outputting slides) would include them too. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turned out that the desired consequences are actually not so difficult to achieve. Using &lt;code&gt;org-ref&lt;/code&gt;, don't forget (as I did) to make use of &lt;code&gt;bibliography:your-bib-file.bib&lt;/code&gt; and &lt;code&gt;bibliographystyle:your-bst-file.bst&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet the underlying question about self-contained org-mode files still remains.&lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="12336" LastEditDate="2017-02-17T11:08:19.093" LastActivityDate="2017-02-17T11:08:19.093" Title="How to resolve citations within an org-mode file?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30739" PostTypeId="1" AcceptedAnswerId="30744" CreationDate="2017-02-15T11:53:15.140" Score="3" ViewCount="3320" Body="&lt;p&gt;I am trying to find an emacs mode for the Cronell Note taking system. It doesn't have to be exact, but allows for SQ3R(Skim, Question, Read, Recite, Review) or a similar variation. Something more creative like counting the lines and if a certain number is exceeded automatically a new heading is created with similar structure (a way to create pages) and hopefully this could be exported nicely into pdf. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Cornell method provides a systematic format for condensing and organizing notes. The student divides the paper into two columns: the note-taking column (usually on the right) is twice the size of the questions/key word column (on the left). The student should leave five to seven lines, or about two in (5 cm), at the bottom of the page.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Cornell_Notes&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Cornell_Notes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14744" LastEditorUserId="14744" LastEditDate="2017-02-15T15:17:55.843" LastActivityDate="2017-02-15T16:29:53.307" Title="Cornell Note Taking System" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30740" PostTypeId="2" ParentId="26218" CreationDate="2017-02-15T12:20:53.593" Score="1" Body="&lt;p&gt;I use next function to run rails console on remote host.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that run-ruby doesn't care how REPL is started, so I pass it an ssh command. Most important part is the command itself:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;-t&lt;/code&gt; for pseudo-terminal mode, without it repl won't work;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;bash --login&lt;/code&gt; to get usual shell (for &lt;code&gt;rbenv&lt;/code&gt;, &lt;code&gt;rvm&lt;/code&gt; or other stuff that initialised on shell startup). If you use zsh, you can share init code somewhere in &lt;code&gt;.profile&lt;/code&gt; and add &lt;code&gt;source $HOME/.profile&lt;/code&gt; to both: &lt;code&gt;.zshrc&lt;/code&gt; and &lt;code&gt;.bashrc&lt;/code&gt; ;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;-c&lt;/code&gt; is a bash option with command to run in single quotes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also there are &lt;code&gt;cd&lt;/code&gt; to set working directory and for my case - environment type (production, testing, etc..)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun rails-console-remote (&amp;amp;optional host &amp;amp;optional path &amp;amp;optional env &amp;amp;optional user-cmd)&#xA;  &quot;Call `run-ruby'.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((default-cmd '&quot;bundle exec rails console&quot;))&#xA;    (run-ruby&#xA;     (format &quot;/usr/bin/ssh -t %s cd %s; /bin/bash --login -c '%s %s'&quot;&#xA;             (or host (read-string &quot;host: &quot;))&#xA;             (or path (read-string &quot;path: &quot;))&#xA;             (if user-cmd&#xA;                 user-cmd&#xA;               (read-string &quot;rails console: &quot; default-cmd))&#xA;             (or env &quot;production&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;P.S.: &lt;code&gt;&amp;amp;optional&lt;/code&gt; and &lt;code&gt;(or var (read-string &quot;prompt: &quot;))&lt;/code&gt; to make it more interactive.&lt;/p&gt;&#xA;" OwnerUserId="14923" LastEditorUserId="14923" LastEditDate="2017-02-15T21:04:45.820" LastActivityDate="2017-02-15T21:04:45.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30741" PostTypeId="2" ParentId="30699" CreationDate="2017-02-15T12:47:45.693" Score="3" Body="&lt;p&gt;This can be done using &lt;code&gt;font-lock-add-keywords&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example below shows you can can selectively enable this feature in your configuration - for different formats.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Note the indentation is read from &lt;code&gt;tab-width&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;This example uses &lt;code&gt;whitespace-trailing&lt;/code&gt;, you may want to use &lt;code&gt;match&lt;/code&gt; or any other color.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;eg:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; highlight non-aligning indent offset&#xA;(defun highlight-indent-offset ()&#xA; (font-lock-add-keywords&#xA;  nil&#xA;  `((,(lambda (limit)&#xA;        (re-search-forward&#xA;         (format &quot;^ \\{%d\\}*\\( \\{1,%d\\}\\)[^ ]&quot; tab-width (- tab-width 1))&#xA;         limit t))&#xA;     1 'whitespace-trailing))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then this function can be called for spesific modes: eg,&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook&#xA; 'rust-mode-hook&#xA; (lambda ()&#xA;   (setq tab-width 4)&#xA;   (highlight-indent-offset)&#xA;   (setq indent-tabs-mode nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This is a minor changes to @politza's answer.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="5253" LastEditDate="2017-02-16T07:51:20.737" LastActivityDate="2017-02-16T07:51:20.737" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30742" PostTypeId="2" ParentId="30739" CreationDate="2017-02-15T14:38:46.273" Score="5" Body="&lt;p&gt;I can't think of an easy way to manage the two-column layout, and the idea of a 'page' with a bottom margin doesn't translate well to a text file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, you could reorient this structure to use org-mode. Org files are fundamentally hierarchical,so perhaps using separate subheadings for your notes and question/key words would make sense. That would allow you to hide the notes when drilling on the questions. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Lecture one  &#xA;** Questions and Keywords&#xA;   - hierarchical structure&#xA;   - folding subtrees&#xA;   - tags&#xA;   - links&#xA;** Notes&#xA;   Org mode provides lots of features for taking notes such as this, &#xA;   that and also the other things including blah blah blah&#xA;** Summary&#xA;   Here's a summary of the key points in the lesson.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;During your 'recite' phase, you use org-modes folding feature to hide the Notes section, so you'd see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Lecture one  &#xA;** Questions and Keywords&#xA;   - hierarchical structure&#xA;   - folding subtrees&#xA;   - tags&#xA;   - links&#xA;** Notes...&#xA;** Summary...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-15T14:38:46.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30743" PostTypeId="1" CreationDate="2017-02-15T15:18:10.547" Score="0" ViewCount="1529" Body="&lt;p&gt;I get the following when trying to check a header file;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*- mode: compilation; default-directory: &quot;~/devel/projects/SHARED/&quot; -*-&#xA;Compilation started at Wed Feb 15 16:06:41&#xA;&#xA;gcc -fshow-column -fno-diagnostics-show-caret -fno-diagnostics-show-    option -iquote /home/micke/devel/projects/SHARED/ -Wall -Wextra -I ../SHARED -I ../Shared_Memory -I ../IDL -I /usr/local/cppenv/CppEnv/linux/ace/5.4/ACE_wrappers -I /usr/local/cppenv/CppEnv/linux/ace/5.4/ACE_wrappers/TAO -I /usr/local/cppenv/CppEnv/linux/roguewave -I /usr/local/cppenv/CppEnv/linux/boost/1.38.0/include/boost-1_38 -x c -S -o /dev/null - &amp;lt; /home/micke/devel/projects/SHARED/globtypes.h&#xA;&amp;lt;stdin&amp;gt;:39:1: error: unknown type name ‘namespace’&#xA;&amp;lt;stdin&amp;gt;:40:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token&#xA;&amp;lt;stdin&amp;gt;:71:1: error: unknown type name ‘namespace’&#xA;&amp;lt;stdin&amp;gt;:72:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token&#xA;&amp;lt;stdin&amp;gt;:91:1: error: unknown type name ‘namespace’&#xA;&amp;lt;stdin&amp;gt;:92:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token&#xA;&amp;lt;stdin&amp;gt;:127:45: error: unknown type name ‘e_ivr_app_state’&#xA;&amp;lt;stdin&amp;gt;:156:1: error: unknown type name ‘namespace’&#xA;&amp;lt;stdin&amp;gt;:157:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token&#xA;&amp;lt;stdin&amp;gt;:485:19: warning: ‘CAUSE_OVERFLOW’ initialized and declared ‘extern’&#xA;&#xA;Compilation exited abnormally with code 1 at Wed Feb 15 16:06:41&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code is C++ and not C but the fact that gcc doesn't recognize the keyword 'namespace' leads me to belive gcc is compiling for C and not C++. I also had a warning earlier that cc1 thinks the parameter -std=c++98 is invalid for C but not for C++, I removed the parameter from the configuration of Flycheck in my .emacs. But it also leads me to the same conclusion that gcc is compiling C and not C++. How do I configure Flycheck so that gcc compiles C++ and not C?&lt;/p&gt;&#xA;" OwnerUserId="14924" LastActivityDate="2017-02-15T15:18:10.547" Title="Flycheck c/c++-gcc doesn't understand C++" Tags="|flycheck|c++|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30744" PostTypeId="2" ParentId="30739" CreationDate="2017-02-15T16:29:53.307" Score="3" Body="&lt;p&gt;Org mode is &lt;a href=&quot;http://orgmode.org/manual/Outlines.html#Outlines&quot; rel=&quot;nofollow noreferrer&quot;&gt;hierarchical&lt;/a&gt; while Cornell is a simple &lt;a href=&quot;https://www.cocooa.com/wp-content/uploads/2011/09/cornell-method-template.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;parallel&lt;/a&gt; structure. Yet Org's &lt;a href=&quot;/questions/tagged/org-table&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-table&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-table&lt;/a&gt; may help within an overall hierarchy for, say, courses -- lectures hierarchy of consolidated notes. In short, making Cornell system a subset of an hierarchically organized file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a simple workflow suggestion if you must use &lt;a href=&quot;/questions/tagged/org-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-mode&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Record stage: take notes as usual in class in a flat file or blank org file. One line per note.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Questions stage: convert that into two columns using this keybinding in &lt;a href=&quot;/questions/tagged/org-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-mode&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-c |     (org-table-create-or-convert-from-region)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Insert a blank first column for your questions. Keep the second column populated with your notes. The overall org file's hierarchy is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Course 1&#xA;** Lecture 1&#xA;Insert notes table here for this lecture&#xA;** Lecture 2&#xA;Insert notes table here for this lecture&#xA;* Course 2&#xA;** Lecture 1&#xA;Insert notes table here for this lecture&#xA;** Lecture 2 &#xA;Insert notes table here for this lecture&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Recite stage: Hide the notes column with &amp;lt;1&gt; or something short for the notes column header as shown in the &lt;a href=&quot;http://orgmode.org/manual/Column-width-and-alignment.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org manual&lt;/a&gt;. To export just that one table use &lt;a href=&quot;/questions/tagged/org-export&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-export&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-export&lt;/a&gt; with Export Scope of &lt;code&gt;subtree&lt;/code&gt; with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-e C-s&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Reflect stage: this is where org-mode can really shine: adding &lt;a href=&quot;http://orgmode.org/manual/Hyperlinks.html#Hyperlinks&quot; rel=&quot;nofollow noreferrer&quot;&gt;internal and external links&lt;/a&gt; to your current and previous notes, to other courses, to other resources outside your file system, say to the class syllabus, previous questions, &lt;a href=&quot;https://github.com/jkitchin/org-ref&quot; rel=&quot;nofollow noreferrer&quot;&gt;bibliography&lt;/a&gt;, references, and an &lt;a href=&quot;http://orgmode.org/manual/Generating-an-index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;indexing system&lt;/a&gt;. Each of these is an entirely separate feature in org-mode that you can explore further.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Review stage: this is where you can tap into &lt;a href=&quot;http://orgmode.org/manual/LaTeX-export.html#LaTeX-export&quot; rel=&quot;nofollow noreferrer&quot;&gt;latex export&lt;/a&gt; for a nicely formatted PDF output with &lt;a href=&quot;http://orgmode.org/manual/Table-of-contents.html#Table-of-contents&quot; rel=&quot;nofollow noreferrer&quot;&gt;TOC&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/manual/Include-files.html#Include-files&quot; rel=&quot;nofollow noreferrer&quot;&gt;include files&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/manual/Source-blocks-in-LaTeX-export.html#Source-blocks-in-LaTeX-export&quot; rel=&quot;nofollow noreferrer&quot;&gt;source code blocks&lt;/a&gt;, etc. Depending on how you want to &lt;a href=&quot;http://orgmode.org/manual/Tables-in-LaTeX-export.html#Tables-in-LaTeX-export&quot; rel=&quot;nofollow noreferrer&quot;&gt;format the table&lt;/a&gt;, you may want to try several options. At a minimum you'd need the &lt;code&gt;longtable&lt;/code&gt; environment for notes tables to flow nicely into next pages. It also relieves you of the burden of sizing tables on each page:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+ATTR_LATEX: :environment longtable   &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In short all the parts are there in org-mode for you to pick and choose your workflow based on how deep you want to incorporate these features over your simple note taking. For example, you may even embed your schedules and time clocking. Perhaps you could even update this question with a template for your particular workflow.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-02-15T16:29:53.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30745" PostTypeId="1" AcceptedAnswerId="30777" CreationDate="2017-02-15T16:39:50.547" Score="3" ViewCount="332" Body="&lt;p&gt;I get the following indentation for my bash script&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in *; {&#xA;    echo $i&#xA;}&#xA;         echo done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last indent is wrong and should be zero spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be fixed?&lt;/p&gt;&#xA;" OwnerUserId="14927" LastEditorUserId="105" LastEditDate="2017-02-15T18:28:20.067" LastActivityDate="2017-02-17T10:01:31.670" Title="Wrong indent with emacs 24 and 25 in shell-script-mode?" Tags="|indentation|shell|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30746" PostTypeId="1" AcceptedAnswerId="31013" CreationDate="2017-02-15T18:55:14.780" Score="2" ViewCount="1045" Body="&lt;p&gt;I have this in my &lt;code&gt;init.el&lt;/code&gt; to enable block code syntax highlighting in org-mode: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-fontify-natively t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also this for &lt;code&gt;org-babel&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(org-babel-do-load-languages&#xA; 'org-babel-load-languages&#xA; '((emacs-lisp . t)&#xA;   (ditaa . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when I insert source code &lt;kbd&gt;&amp;lt;&lt;/kbd&gt; &lt;kbd&gt;s&lt;/kbd&gt; followed by &lt;kbd&gt;TAB&lt;/kbd&gt; to draw something using &lt;a href=&quot;http://ditaa.sourceforge.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ditaa&lt;/a&gt; (same problem with &lt;code&gt;emacs-lisp&lt;/code&gt; code, it seems to be a general SRC code block problem), the syntax highlighting breaks when I write this line: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC ditaa :file &quot;./foo.png&quot; :cmdline -r&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;No syntax highlighting but code can be evaluated&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3ksCv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3ksCv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I leave only &lt;code&gt;#+BEGIN_SRC&lt;/code&gt; sitting alone in the first line I get the highlighting right, but code will not be evaluated in this case when I hit &lt;code&gt;C-c C-c&lt;/code&gt;. Even one space after &lt;code&gt;SRC&lt;/code&gt; is enough to break that syntax highlighting. What is going on? Can anyone help me fix it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Syntax highlighting is right but code cannot be evaluated&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PacUs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PacUs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian)&lt;/li&gt;&#xA;&lt;li&gt;GNU Emacs 25.1.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-09-29; nothing changed.&lt;/li&gt;&#xA;&lt;li&gt;Org mode version 9.0.4 (release_9.0.4-248-gdef8a8)&lt;/li&gt;&#xA;&lt;li&gt;Org mode version 9.0.5 (release_9.0.5-288-g4caad0) problem presists&lt;/li&gt;&#xA;&lt;li&gt;theme used is &lt;code&gt;moe-dark&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run &lt;code&gt;emacs --vanilla&lt;/code&gt; from the terminal, the problem disappears. So what is going on? What to do next to find the cause from here?&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="2443" LastEditDate="2017-02-24T09:25:49.397" LastActivityDate="2017-02-24T10:17:08.523" Title="Block syntax highlighting breaks in org-mode in this case, how to fix?" Tags="|org-mode|themes|syntax-highlighting|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30747" PostTypeId="1" AcceptedAnswerId="30771" CreationDate="2017-02-15T19:32:34.257" Score="2" ViewCount="200" Body="&lt;p&gt;Some document said emacs-lisp is more powerful than perl/Python to parser text file, but I still didn't see good example for reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if input below text block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.util.ArrayMap.allocArrays(ArrayMap.java:175)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.util.ArrayMap.put(ArrayMap.java:463)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.os.BaseBundle.putInt(BaseBundle.java:455)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.content.Intent.putExtra(Intent.java:7174)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService$VolumeStreamState.setIndex(AudioService.java:4289)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.setStreamVolumeInt(AudioService.java:1929)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.onSetStreamVolume(AudioService.java:1670)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1769)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1683)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wish to produce below output: (extract the file name, function name and line number, then reformat as plantuml input text)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-&amp;gt; AudioService:setStreamVolume():1683&#xA;AudioService -&amp;gt; AudioService:setStreamVolume():1769&#xA;AudioService -&amp;gt; AudioService:onSetStreamVolume():1670&#xA;AudioService -&amp;gt; AudioService:setStreamVolumeInt():1929&#xA;AudioService -&amp;gt; AudioService:setStreamVolumeInt():4289&#xA;AudioService -&amp;gt; Intent:putExtra():7174&#xA;Intent -&amp;gt; BaseBundle:putInt():455&#xA;BaseBundle -&amp;gt; ArrayMap:put():463&#xA;ArrayMap -&amp;gt; ArrayMap:allocArrays():175&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then we can use plantuml to covert it to a UML diagram (org mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we do that with emacs-lisp (maybe in org mode)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is put the input text in a code block, then run the emacs-lisp code in another code block. The result will be the output as expected above&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: myinput&#xA;#+BEGIN_EXAMPLE :session &#xA;input text here&#xA;#+END_EXAMPLE&#xA;&#xA;#+BEGIN_SRC emacs-lisp :exports both&#xA;(message 'process myinput here')&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: output reformat result here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14840" LastEditorUserId="105" LastEditDate="2017-02-15T22:41:34.610" LastActivityDate="2017-02-17T16:00:48.680" Title="Emacs - Lisp to parser text block to plantuml" Tags="|text-editing|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30748" PostTypeId="2" ParentId="30738" CreationDate="2017-02-15T19:42:28.447" Score="4" Body="&lt;p&gt;You could try exporting via &lt;a href=&quot;https://github.com/kawabata/ox-pandoc&quot; rel=&quot;nofollow noreferrer&quot;&gt;ox-pandoc&lt;/a&gt; (requires &lt;a href=&quot;http://pandoc.org/installing.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandoc&lt;/a&gt;, which you could also use directly).  This will expand your citations, allows you to choose the citation style, and can export to many formats, including revealjs.  An additional benefit is support for an alternative citation syntax &lt;code&gt;[prefix @citekey postfix]&lt;/code&gt; which might be more suitable for people in the humanities. The downside is that some advanced org-mode features may not be supported.&lt;/p&gt;&#xA;" OwnerUserId="8987" LastActivityDate="2017-02-15T19:42:28.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30749" PostTypeId="1" CreationDate="2017-02-15T19:44:57.490" Score="1" ViewCount="1699" Body="&lt;p&gt;I am currently trying to install spacemacs on my Arch Linux. I am following the standard installation instructions that have been put up &lt;a href=&quot;https://github.com/syl20bnr/spacemacs#default-installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I am at the part where I need to launch emacs (Instruction no.3 of the Default Installation bit). This is the one after the one below: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I get the error below when emacs comes up. What's wrong with the installation? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (initialization): An error occurred while loading&#xA;‘/home/sharand/.emacs.d/init.el’Warning (initialization): An error&#xA;occurred while loading ‘/home/sharand/.emacs.d/init.el’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What should I do?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Debugging&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I ran it with &lt;code&gt;--debug-init&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (file-error &quot;Creating directory&quot; &quot;Permission denied&quot; &quot;/home/sharand/.emacs.d/.cache/&quot;)&#xA;  make-directory-internal(&quot;/home/sharand/.emacs.d/.cache/&quot;)&#xA;  make-directory(&quot;/home/sharand/.emacs.d/.cache/&quot;)&#xA;  (if (file-exists-p spacemacs-cache-directory) nil (make-directory spacemacs-cache-directory))&#xA;  eval-buffer(#&amp;lt;buffer  *load*-432897&amp;gt; nil &quot;/home/sharand/.emacs.d/core/core-load-paths.el&quot; nil t)  ; Reading at buffer position 2713&#xA;  load-with-code-conversion(&quot;/home/sharand/.emacs.d/core/core-load-paths.el&quot; &quot;/home/sharand/.emacs.d/core/core-load-paths.el&quot; nil nil)&#xA;  load(&quot;/home/sharand/.emacs.d/core/core-load-paths.el&quot; nil nil t)&#xA;  load-file(&quot;/home/sharand/.emacs.d/core/core-load-paths.el&quot;)&#xA;  (if (not (version&amp;lt;= spacemacs-emacs-min-version emacs-version)) (message (concat &quot;Your version of Emacs (%s) is too old. &quot; &quot;Spacemacs requires Emacs version %s or above.&quot;) emacs-version spacemacs-emacs-min-version) (load-file (concat (file-name-directory load-file-name) &quot;core/core-load-paths.el&quot;)) (require (quote core-spacemacs)) (spacemacs/init) (spacemacs/maybe-install-dotfile) (configuration-layer/sync) (spacemacs-buffer/display-info-box) (spacemacs/setup-startup-hook) (require (quote server)) (if (server-running-p) nil (server-start)))&#xA;  eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil &quot;/home/sharand/.emacs.d/init.el&quot; nil t)  ; Reading at buffer position 1302&#xA;  load-with-code-conversion(&quot;/home/sharand/.emacs.d/init.el&quot; &quot;/home/sharand/.emacs.d/init.el&quot; t t)&#xA;  load(&quot;/home/sharand/.emacs.d/init&quot; t t)&#xA;  #[0 &quot;\205\266 \306=\203\307\310Q\202? \311=\204\307\312Q\202?\313\307\314\315#\203*\316\202?\313\307\314\317#\203&amp;gt;\320\321\322!D\nB\323\202?\316\324\325\324\211#\210\324=\203e\326\327\330\307\331Q!\&quot;\325\324\211#\210\324=\203d\210\203\247\332!\333\232\203\247\334!\211\335P\336!\203\201\211\202\214\336!\203\213\202\214\314\262\203\245\337\&quot;\203\243\340\341#\210\342\343!\210\266\f?\205\264\314\325\344\324\211#)\262\207&quot; [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos &quot;~&quot; &quot;/_emacs&quot; windows-nt &quot;/.emacs&quot; directory-files nil &quot;^\\.emacs\\(\\.elc?\\)?$&quot; &quot;~/.emacs&quot; &quot;^_emacs\\(\\.elc?\\)?$&quot; initialization format-message &quot;`_emacs' init file is deprecated, please use `.emacs'&quot; &quot;~/_emacs&quot; t load expand-file-name &quot;init&quot; file-name-as-directory &quot;/.emacs.d&quot; file-name-extension &quot;elc&quot; file-name-sans-extension &quot;.el&quot; file-exists-p file-newer-than-file-p message &quot;Warning: %s is newer than %s&quot; sit-for 1 &quot;default&quot;] 7]()&#xA;  command-line()&#xA;  normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14928" LastEditorUserId="14928" LastEditDate="2017-02-20T06:34:07.710" LastActivityDate="2018-01-16T15:41:49.313" Title="Cannot install spacemacs" Tags="|spacemacs|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30750" PostTypeId="2" ParentId="30735" CreationDate="2017-02-15T19:54:45.343" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;... what exactly the role of the trailing dash in the shell command execution ... &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's a parameter that stands for STDIN or STDOUT, depending on context.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-02-15T19:54:45.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30751" PostTypeId="2" ParentId="801" CreationDate="2017-02-15T20:39:53.633" Score="1" Body="&lt;p&gt;I've been using &lt;a href=&quot;https://github.com/atilaneves/cmake-ide&quot; rel=&quot;nofollow noreferrer&quot;&gt;cmake-ide&lt;/a&gt; to configure rtags, flycheck, irony, and company-clang. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can configure your build system &lt;em&gt;and&lt;/em&gt; your favorite static analysis emacs plugins at the same time!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Note that company clang provides autocompletions, which was the feature you were looking for. cmake-ide can also configure flycheck and rtags, which adds several more IDE-like features.&lt;/p&gt;&#xA;" OwnerUserId="14930" LastEditorUserId="14930" LastEditDate="2017-02-16T16:28:15.360" LastActivityDate="2017-02-16T16:28:15.360" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30752" PostTypeId="5" CreationDate="2017-02-15T21:43:41.617" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-15T21:43:41.617" LastActivityDate="2017-02-15T21:43:41.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30753" PostTypeId="4" CreationDate="2017-02-15T21:43:41.617" Score="0" Body="refers to the pitch of a `font` or a `face` in Emacs. It is specified as the number of characters printed per inch. For fixed width fonts, the pitch is constant. For variable fonts, the pitch varies. Font size and pitch size are two independent settings. A large font with lower pitch squishes text. A small font with higher pitch widens text." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T23:36:29.137" LastActivityDate="2017-02-15T23:36:29.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30754" PostTypeId="5" CreationDate="2017-02-15T21:50:01.767" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-15T21:50:01.767" LastActivityDate="2017-02-15T21:50:01.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30755" PostTypeId="4" CreationDate="2017-02-15T21:50:01.767" Score="0" Body="The golden ratio ϕ is equal to the constant 1.618, but more often used as comparison between two quantities. In Emacs, window resizing algorithms use this ratio to set the width to length ratio." OwnerUserId="7045" LastEditorUserId="253" LastEditDate="2017-02-15T23:36:21.133" LastActivityDate="2017-02-15T23:36:21.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30756" PostTypeId="5" CreationDate="2017-02-15T21:51:36.393" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-15T21:51:36.393" LastActivityDate="2017-02-15T21:51:36.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30757" PostTypeId="4" CreationDate="2017-02-15T21:51:36.393" Score="0" Body="is OpenDocument Text (.odt) file format used by some word processing applications. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T23:34:53.550" LastActivityDate="2017-02-15T23:34:53.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30758" PostTypeId="5" CreationDate="2017-02-15T22:00:46.420" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-15T22:00:46.420" LastActivityDate="2017-02-15T22:00:46.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30759" PostTypeId="4" CreationDate="2017-02-15T22:00:46.420" Score="0" Body="Representational State Transfer (REST) is a style of client-server architecture that streamlines resource discovery and exchange in stateless communications. For example, `restclients` exchange URIs and URLs with `RESTful` web services." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T23:34:45.887" LastActivityDate="2017-02-15T23:34:45.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30760" PostTypeId="5" CreationDate="2017-02-15T22:08:37.793" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-15T22:08:37.793" LastActivityDate="2017-02-15T22:08:37.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30761" PostTypeId="4" CreationDate="2017-02-15T22:08:37.793" Score="0" Body="refers to TAB completions (or other keystroke shortcuts) to selecting the target element from a list of many. Often useful for menus, navigations, searching, jumping, folding, and other forms of &quot;narrowing&quot; the list of available choices." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-15T23:34:34.747" LastActivityDate="2017-02-15T23:34:34.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30762" PostTypeId="5" CreationDate="2017-02-16T00:10:34.913" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Agenda-views.html#Agenda-views&quot; rel=&quot;nofollow noreferrer&quot;&gt;Agenda Views&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Agenda-dispatcher.html#Agenda-dispatcher&quot; rel=&quot;nofollow noreferrer&quot;&gt;Agenda dispatcher&lt;/a&gt; (showing default menu keys)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-05T13:41:58.370" LastActivityDate="2017-03-05T13:41:58.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30763" PostTypeId="4" CreationDate="2017-02-16T00:10:34.913" Score="0" Body="Org-agenda is the Org mode facility that generates agenda views, handles files for agendas, dispatches keyboard shortcuts for agenda operations, sorts agendas, and performs agenda-related functions in conjunction with other org-mode features. Use additional org-mode tags for questions about interoperation of agenda with other Org features." OwnerUserId="7045" LastEditorUserId="262" LastEditDate="2024-03-20T19:01:07.767" LastActivityDate="2024-03-20T19:01:07.767" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30764" PostTypeId="5" CreationDate="2017-02-16T00:16:58.923" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-16T00:16:58.923" LastActivityDate="2017-02-16T00:16:58.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30765" PostTypeId="4" CreationDate="2017-02-16T00:16:58.923" Score="0" Body="for font colors, menu colors, screen colors, and other presentation elements of Emacs interface. For questions about colors related to exports, printing, and external programs, include additional tags. Also add tags for running Emacs on handheld or newer portable devices." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-16T16:10:47.757" LastActivityDate="2017-02-16T16:10:47.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30766" PostTypeId="5" CreationDate="2017-02-16T00:35:41.670" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-16T00:35:41.670" LastActivityDate="2017-02-16T00:35:41.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30767" PostTypeId="4" CreationDate="2017-02-16T00:35:41.670" Score="0" Body="use this tag for Elisp `functions` for their usage, definitions, re-definitions, defining aliases, and other standard features of function execution fundamental to Lisp programming languages. Add additional Elisp tags when the functions are about specific Emacs features." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-16T16:10:58.547" LastActivityDate="2017-02-16T16:10:58.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30768" PostTypeId="1" CreationDate="2017-02-16T01:32:04.937" Score="0" ViewCount="75" Body="&lt;p&gt;Every time I open a new file in emacs, hl-line-mode is enabled. I have put &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-hl-line-mode -1)&#xA;(hl-line-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my init.el, but to no avail. What am I doing wrong???&lt;/p&gt;&#xA;" OwnerUserId="14932" LastActivityDate="2017-02-16T01:32:04.937" Title="Disabling automatic line highlighting" Tags="|minor-mode|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30769" PostTypeId="1" AcceptedAnswerId="30770" CreationDate="2017-02-16T04:02:15.407" Score="1" ViewCount="179" Body="&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I &lt;code&gt;grep&lt;/code&gt; thousands of emails within Wanderlust while avoiding the dreaded error of &quot;&lt;strong&gt;Too many arguments&lt;/strong&gt;&quot; or finding zero matches (when there should be one or more)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wanderlust (and related &lt;code&gt;elmo&lt;/code&gt; libraries) support searching the contents of emails by using &lt;code&gt;grep&lt;/code&gt;:  &lt;a href=&quot;http://wanderlust.github.io/wl-docs/wl.html#grep&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://wanderlust.github.io/wl-docs/wl.html#grep&lt;/a&gt; .  This works well for a small number of emails in the directory to be searched, but does not work when there are thousands of files in the directory -- i.e., zero results are returned even though there should have been one or more hits.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-16T06:16:42.723" Title="Wanderlust -- how to grep the contents of thousands of emails" Tags="|wanderlust|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30770" PostTypeId="2" ParentId="30769" CreationDate="2017-02-16T04:14:49.627" Score="1" Body="&lt;p&gt;The limitation of the number of files is due to the number of arguments &lt;code&gt;grep&lt;/code&gt; can accept before throwing an error of &quot;&lt;strong&gt;Too many arguments&lt;/strong&gt;&quot;.  Wanderlust and &lt;code&gt;elmo&lt;/code&gt; related libraries are filled with &lt;code&gt;condition-case&lt;/code&gt; statements that mask errors and make troubleshooting extremely time consuming.  The default configuration for &lt;code&gt;grep&lt;/code&gt; uses the function &lt;code&gt;elmo-search-grep-target&lt;/code&gt;, which creates a listing of files -- sometimes too many.  In researching this answer, I found it helpful to inspect the functions &lt;code&gt;elmo-search-engine-do-search&lt;/code&gt; and &lt;code&gt;elmo-map-folder-list-message-locations&lt;/code&gt;, the latter of which when supplied with a handy &lt;code&gt;(message ...)&lt;/code&gt; told me that the problem was due to &quot;&lt;strong&gt;Too many arguments&lt;/strong&gt;&quot;.  This error message led me to an answer by &lt;code&gt;Barmar&lt;/code&gt; suggesting to use the recursive grep feature and supply a directory, rather than a zillion files.  [ &lt;a href=&quot;https://stackoverflow.com/a/29727258/2112489&quot;&gt;https://stackoverflow.com/a/29727258/2112489&lt;/a&gt; ]  The upshot is that I had also been wanting to enable recursive grepping, which the default configuration did not provide.  So, we create a new function called &lt;code&gt;elmo-search-rgrep-target&lt;/code&gt; and add the &lt;code&gt;r&lt;/code&gt; argument to the &lt;code&gt;grep&lt;/code&gt; search.  The method of searching is essentially the same, from with the Summary or Folder buffer, type the letter &quot;g&quot; and then enter into the minibuffer something like &lt;code&gt;[hello-world]/path/to/be/recursively/searched!grep&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun elmo-search-rgrep-target (engine pattern)&#xA;  (let ((dirname (expand-file-name (elmo-search-engine-param-internal engine))))&#xA;    dirname))&#xA;&#xA;;;; Setup `elmo-search-engine-alist'&#xA;(unless noninteractive&#xA;  (or (assq 'namazu elmo-search-engine-alist)&#xA;      (elmo-search-register-engine&#xA;        'namazu 'local-file&#xA;        :prog &quot;namazu&quot;&#xA;        :args '(&quot;--all&quot; &quot;--list&quot; &quot;--early&quot; pattern elmo-search-namazu-index)&#xA;        :charset 'iso-2022-jp))&#xA;  (or (assq 'mu elmo-search-engine-alist)&#xA;      (elmo-search-register-engine&#xA;       'mu 'local-file&#xA;       :prog &quot;/path/to/executable/mu&quot;&#xA;       :args '(&quot;find&quot; pattern &quot;--fields&quot; &quot;l&quot; &quot;--muhome=/path/to/muhome/.mu&quot;)&#xA;       :charset 'utf-8))&#xA;  (or (assq 'grep elmo-search-engine-alist)&#xA;      (elmo-search-register-engine&#xA;       'grep 'local-file&#xA;       :prog &quot;grep&quot;&#xA;       ;; :args '(&quot;-l&quot; &quot;-e&quot; pattern elmo-search-grep-target)&#xA;       :args '(&quot;-rle&quot; pattern elmo-search-rgrep-target))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I've opened up an issue on Github for Wanderlust, but am unsure whether anyone would be interested in this solution given that it could be viewed as relating more to the &lt;code&gt;elmo&lt;/code&gt; related libraries.  &lt;a href=&quot;https://github.com/wanderlust/wanderlust/issues/140&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/wanderlust/wanderlust/issues/140&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-02-16T06:16:42.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30771" PostTypeId="2" ParentId="30747" CreationDate="2017-02-16T04:47:16.757" Score="2" Body="&lt;p&gt;Try below org sample:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: input-log&#xA;#+BEGIN_EXAMPLE&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.util.ArrayMap.allocArrays(ArrayMap.java:175)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.util.ArrayMap.put(ArrayMap.java:463)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.os.BaseBundle.putInt(BaseBundle.java:455)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at android.content.Intent.putExtra(Intent.java:7174)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService$VolumeStreamState.setIndex(AudioService.java:4289)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.setStreamVolumeInt(AudioService.java:1929)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.onSetStreamVolume(AudioService.java:1670)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1769)&#xA;12-22 07:43:14.699  1640  2722 E JavaBinder:    at com.android.server.audio.AudioService.setStreamVolume(AudioService.java:1683)&#xA;#+END_EXAMPLE&#xA;&#xA;#+HEADER: :var inputlog=input-log&#xA;#+BEGIN_SRC emacs-lisp :file test.png :exports results&#xA;(defun logme(instr)&#xA;  (let ((matches)(prevObj &quot;&quot;)&#xA;    (regexstr &quot;\\.\\([a-zA-Z]+\\)(\\([a-zA-Z]+\\).java:\\([0-9]+\\)&quot;))&#xA;    (with-temp-buffer&#xA;      (insert instr)&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward regexstr nil t)&#xA;    (push (list (match-string 1) (match-string 2) (match-string 3)) matches))&#xA;      (concat &quot;&#xA;scale 800*400&#xA;hide footbox&#xA;skinparam shadowing false&#xA;skinparam monochrome true&#xA;&quot;&#xA;       (mapconcat (lambda(x)&#xA;      (format &quot;%s -&amp;gt; %s:%s():%s&quot; prevObj&#xA;      (setq prevObj (nth 1 x))&#xA;      (car x)&#xA;      (nth 2 x))) matches &quot;\n&quot;)))))&#xA;(org-babel-execute:plantuml (logme inputlog) params)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works but need more work to make it better!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output graph is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3BQkR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3BQkR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="14843" LastEditDate="2017-02-17T16:00:48.680" LastActivityDate="2017-02-17T16:00:48.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30773" PostTypeId="1" AcceptedAnswerId="30774" CreationDate="2017-02-16T06:49:13.893" Score="5" ViewCount="765" Body="&lt;p&gt;I have some Emacs Lisp code blocks in an Org file which I evaluate to get tables of results.  It would be nice if I could include horizontal separators to separate individual lines of data from headers and summary lines, because that makes it easier to use &lt;code&gt;org-sort&lt;/code&gt;.  Concretely, I have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;'((foo bar baz) (1 2 3) (4 5 6))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| foo | bar | baz |&#xA;|   1 |   2 |   3 |&#xA;|   4 |   5 |   6 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but it would be nice if I could make the output automatically format itself more like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;| foo | bar | baz |&#xA;|-----+-----+-----|&#xA;|   1 |   2 |   3 |&#xA;|   4 |   5 |   6 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do this?  I thought that including &lt;code&gt;nil&lt;/code&gt; in place of a row of results might do the trick, but it seems not to do the trick.&lt;/p&gt;&#xA;" OwnerDisplayName="user1968" LastEditorDisplayName="user1968" LastEditDate="2017-02-16T21:38:44.090" LastActivityDate="2017-02-16T21:38:44.090" Title="In org-mode, can I include a horizontal separator in a result table generated by an Emacs Lisp code block?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30774" PostTypeId="2" ParentId="30773" CreationDate="2017-02-16T09:14:24.260" Score="6" Body="&lt;p&gt;Looking at &lt;code&gt;org-babel-get-colnames&lt;/code&gt;, the easiest way to do this probably is adding an &lt;code&gt;hline&lt;/code&gt; as second element of your list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;'((foo bar baz) hline (1 2 3) (4 5 6))&#xA;#+END_SRC&#xA;&#xA;#+results:&#xA;| foo | bar | baz |&#xA;|-----+-----+-----|&#xA;|   1 |   2 |   3 |&#xA;|   4 |   5 |   6 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastActivityDate="2017-02-16T09:14:24.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30775" PostTypeId="1" CreationDate="2017-02-16T11:05:49.733" Score="4" ViewCount="553" Body="&lt;p&gt;Git hosting web services like Bitbucket Server and GitHub provide a branch view that shows whether branches are ahead or behind master:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vKcPX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vKcPX.png&quot; alt=&quot;github branches&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is great for finding remote branches which have been merged and can be deleted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I see whether remote branches are behind or ahead with magit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;https://github.com/magit/magit/issues/1550&quot; rel=&quot;nofollow noreferrer&quot;&gt;issue 1550&lt;/a&gt; but that just shows the age and author, not the number of commits. &lt;code&gt;L L&lt;/code&gt; gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dkA1Y.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dkA1Y.png&quot; alt=&quot;magit branches&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="304" LastActivityDate="2017-02-16T14:28:48.377" Title="Can magit show if a branch is ahead or behind?" Tags="|magit|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30776" PostTypeId="2" ParentId="30775" CreationDate="2017-02-16T14:28:48.377" Score="5" Body="&lt;p&gt;I'm not aware of a place where this is available in a unified view.&#xA;As @wvxvw comments, the refs buffer will show ahead/behind counts&#xA;against the upstream branch but not an arbitrary branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest the refs buffer curently gets is showing the number of&#xA;commits each branch is ahead of a selected branch or revision.  By&#xA;default, things are compared to HEAD, but you can use &lt;kbd&gt;C-u y&lt;/kbd&gt;&#xA;to select another branch.  Then, in the refs buffer, &lt;kbd&gt;C-y b&lt;/kbd&gt;&#xA;will show the ahead counts for each branch.  If you press tab on a&#xA;line, it will expand to show the commits (with an indication of&#xA;whether each commit has been applied to the selected branch).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could fairly easily produce the GitHub-like view by iterating over&#xA;the branches and calling &#xA;&lt;code&gt;(magit-rev-diff-count &quot;master&quot; &amp;lt;branch&amp;gt;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2017-02-16T14:28:48.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30777" PostTypeId="2" ParentId="30745" CreationDate="2017-02-16T17:19:42.110" Score="3" Body="&lt;p&gt;I have reported this as emacs bug 25768 at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25768&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25768&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is not the only indentation problem. More can be found in the &lt;a href=&quot;https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs;include=subject%3Aindentation&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs bug tracker&lt;/a&gt; and others should be reported via &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14927" LastEditorUserId="14927" LastEditDate="2017-02-17T10:01:31.670" LastActivityDate="2017-02-17T10:01:31.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30778" PostTypeId="1" AcceptedAnswerId="30783" CreationDate="2017-02-16T20:18:23.367" Score="5" ViewCount="2054" Body="&lt;p&gt;With below setup, my ielm mode has autocompletion function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ANK1P.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ANK1P.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ac-slime)&#xA;(add-hook 'slime-mode-hook 'set-up-slime-ac)&#xA;(add-hook 'slime-repl-mode-hook 'set-up-slime-ac)&#xA;(eval-after-load &quot;auto-complete&quot;&#xA;   '(add-to-list 'ac-modes 'slime-repl-mode 'emacs-lisp-mode))&#xA;&#xA;(defun ielm-auto-complete ()                               &#xA;  &quot;Enables `auto-complete' support in \\[ielm].&quot;           &#xA;  (setq ac-sources '(ac-source-functions                   &#xA;                     ac-source-variables                   &#xA;                     ac-source-features                    &#xA;                     ac-source-symbols                     &#xA;                     ac-source-words-in-same-mode-buffers))&#xA;  (add-to-list 'ac-modes 'inferior-emacs-lisp-mode)        &#xA;  (auto-complete-mode 1))                                  &#xA;(add-hook 'ielm-mode-hook 'ielm-auto-complete)&#xA;&#xA;(add-hook 'ielm-mode-hook #'enable-paredit-mode)&#xA;(add-hook 'ielm-mode-hook (lambda () (set (make-local-variable 'company-backends) '(company-elisp))))&#xA;&#xA;(add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)&#xA;(add-hook 'emacs-lisp-mode-hook (lambda () (set (make-local-variable 'company-backends) '(company-elisp))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it doesn't work when edit a .el file. I guess I can not share the same function call ielm-auto-complete but don't know how to change it.&lt;/p&gt;&#xA;" OwnerUserId="14840" LastEditorUserId="1979" LastEditDate="2017-02-18T18:58:54.183" LastActivityDate="2017-02-18T18:58:54.183" Title="Emacs - elisp code autocompletion in emacs-lisp-mode" Tags="|company-mode|completion|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30780" PostTypeId="1" AcceptedAnswerId="30799" CreationDate="2017-02-16T20:55:42.837" Score="1" ViewCount="51" Body="&lt;p&gt;I don't like the function that Customize uses to select color. It spawns a new buffer that messes up window configuration, and is also difficult to search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to replace this function with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun helm-insert-color-hex ()&#xA;  &quot;Insert the hex value at point for the color selected via helm&quot;&#xA;  (interactive)&#xA;  (insert (apply 'color-rgb-to-hex (color-name-to-rgb (helm-colors)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I do this? I can't seem to find what that &quot;Choose&quot; button does (for example, when setting a foreground color for some face)&lt;/p&gt;&#xA;" OwnerUserId="6554" LastEditorUserId="262" LastEditDate="2017-02-17T18:02:03.870" LastActivityDate="2017-02-17T18:21:09.570" Title="What function is used when selecting a color in a Customize buffer?" Tags="|customize|colors|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30782" PostTypeId="1" AcceptedAnswerId="30806" CreationDate="2017-02-16T21:58:14.403" Score="1" ViewCount="460" Body="&lt;p&gt;I would like to create a function that runs a command only after a previous command that takes some input from the user finishes running. In particular, I would like to write a function that runs a command after magit-pull:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test ()&#xA;  (interactive)&#xA;  (call-interactively 'magit-pull)&#xA;  (read-key)&#xA;  (command)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above function works only when magit-pull does not ask me for a password. However, when magit-pull asks me to enter my password in the minibufer, the above code won't work. I suppose I need to add some code that will only run &quot;command&quot; only after magit-pull is finished. Does anyone know of how I can implement this? &lt;/p&gt;&#xA;" OwnerUserId="14944" LastEditorUserId="105" LastEditDate="2017-02-17T16:47:04.553" LastActivityDate="2017-02-18T16:06:50.563" Title="Write function that runs a command only after a previous command finishes" Tags="|magit|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30783" PostTypeId="2" ParentId="30778" CreationDate="2017-02-16T22:57:06.963" Score="3" Body="&lt;p&gt;Add below line should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook 'ielm-auto-complete)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2017-02-16T22:57:06.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30784" PostTypeId="5" CreationDate="2017-02-17T03:10:51.497" Score="0" Body="&lt;p&gt;Displaying &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Images.html#Images&quot; rel=&quot;nofollow noreferrer&quot;&gt;image (i.e. picture) files&lt;/a&gt; such as GIF, PNG, JPEG, PostScript, SVG, etc. in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has extensive support for images for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Image-Descriptors.html#Image-Descriptors&quot; rel=&quot;nofollow noreferrer&quot;&gt;displaying&lt;/a&gt;, editing, searching, file management, image caching, etc. If Emacs was compiled with support for the ImageMagick library, it can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/ImageMagick-Images.html#ImageMagick-Images&quot; rel=&quot;nofollow noreferrer&quot;&gt;ImageMagick to render&lt;/a&gt; a wide variety of images. For thumbnails, Emacs uses the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Image_002dDired.html#Image_002dDired&quot; rel=&quot;nofollow noreferrer&quot;&gt;Image-Dired&lt;/a&gt; package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has a separate &lt;a href=&quot;/questions/tagged/image-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;image-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;image-mode&lt;/a&gt; for editing images and image metadata.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unrelated to &lt;a href=&quot;/questions/tagged/images&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;images&amp;#39;&quot; rel=&quot;tag&quot;&gt;images&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/image-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;image-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;image-mode&lt;/a&gt; is the &lt;a href=&quot;/questions/tagged/picture-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;picture-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;picture-mode&lt;/a&gt;, which is for &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Picture-Mode.html#Picture-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;editing ASCII art&lt;/a&gt;, tables, and aligning text columns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the appropriate combination of tags, and describe which image operations or packages, if any, pertain to your question. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="25" LastEditDate="2017-02-22T17:20:11.690" LastActivityDate="2017-02-22T17:20:11.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30785" PostTypeId="4" CreationDate="2017-02-17T03:10:51.497" Score="0" Body="for Emacs support (edit, display, etc.) of images (e.g., jpeg, png, svg). For questions about image metadata, use the tag 'image-mode." OwnerUserId="7045" LastEditorUserId="253" LastEditDate="2017-02-18T00:40:26.707" LastActivityDate="2017-02-18T00:40:26.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30786" PostTypeId="1" AcceptedAnswerId="30787" CreationDate="2017-02-17T07:27:44.410" Score="0" ViewCount="208" Body="&lt;p&gt;Subtract a buffer's (the file's) size from a variable before killing it. Emacs 26.&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar cumulative-open-bytes '0 )&#xA;&#xA;(defun buffer-settings-calc-bytes ()&#xA;  (interactive)&#xA;  (let ((current-open-file-size (file-attribute-size (file-attributes buffer-file-name))))&#xA;    (setq cumulative-open-bytes (- current-open-file-size cumulative-open-bytes))&#xA;    (message (propertize (format &quot;Cumulative Open Bytes: (%d) after closing %s (%d bytes).&quot; &#xA;                                  cumulative-open-bytes buffer-file-name current-open-file-size) &#xA;                         'face 'warning))))&#xA;&#xA;(add-hook 'kill-buffer-hook 'buffer-settings-calc-bytes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Results in the following message:&lt;br/&gt;&lt;strong&gt;setq: Wrong type argument: number-or-marker-p, nil&lt;/strong&gt;&lt;br/&gt;This appears just after the string message from the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried &lt;code&gt;setq&lt;/code&gt; in place of the &lt;code&gt;let&lt;/code&gt;, and removing &lt;code&gt;interactive&lt;/code&gt;.&#xA;Emacs will not load with the above, and evaluating it in place breaks&#xA;most navigation and buffer features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notably &lt;code&gt;toggle-debug-on-error&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following also appears invoking arbitrary commands in addition to the above:&lt;br/&gt;&#xA;&lt;strong&gt;Error running timer: (wrong-type-argument number-or-marker-p nil)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a local binding issue? How should this hook be set?&lt;/p&gt;&#xA;" OwnerUserId="14878" LastEditorUserId="14878" LastEditDate="2017-02-17T21:00:48.757" LastActivityDate="2017-02-17T21:00:48.757" Title="Adding to kill-buffer-hook results in &quot;setq: Wrong type argument&quot;" Tags="|hooks|file-local-variables|buffer-local|kill-buffer|defun|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30787" PostTypeId="2" ParentId="30786" CreationDate="2017-02-17T08:37:30.460" Score="1" Body="&lt;p&gt;What happens here is that you try to use a non-number when subtracting numbers, more specifically &lt;code&gt;nil&lt;/code&gt;.  Your code assumes &lt;code&gt;buffer-file-name&lt;/code&gt; always returns a file name pointing to a file you can query the attributes from which is wrong, buffers don't have to point at files and can return &lt;code&gt;nil&lt;/code&gt; in this case.  Your hook must handle this case to not error out prematurely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-cumulative-open-bytes 0)&#xA;&#xA;(defun my-buffer-settings-calc-bytes ()&#xA;  (let ((size (nth 7 (file-attributes buffer-file-name))))&#xA;    (when size&#xA;      (setq my-cumulative-open-bytes (- size my-cumulative-open-bytes))&#xA;      (message&#xA;       (propertize&#xA;        (format &quot;Cumulative Open Bytes: (%d) after closing %s (%d bytes).&quot;&#xA;                my-cumulative-open-bytes buffer-file-name size)&#xA;        'face 'warning)))))&#xA;&#xA;(add-hook 'kill-buffer-hook 'my-buffer-settings-calc-bytes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS: This hook might slow down your Emacs as it's run when every single temporary buffer is killed, so consider achieving your goal in a different way.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="105" LastEditDate="2017-02-17T16:32:17.970" LastActivityDate="2017-02-17T16:32:17.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30788" PostTypeId="1" AcceptedAnswerId="30789" CreationDate="2017-02-17T08:49:05.197" Score="6" ViewCount="1857" Body="&lt;p&gt;I'm using Emacs and SLIME to edit Lisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, Emacs indents my Lisp LOOP constructs like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(loop for x across dna1 &#xA;   for y across dna2 &#xA;   count (not (eql x y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I expect it to line up subsequent lines with the first parameter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(loop for x across dna1 &#xA;      for y across dna2 &#xA;      count (not (eql x y)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This still works fine for other functions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(+ 1&#xA;   2&#xA;   3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone explain to me why this is happening? Is it because LOOP is a macro? Is there a way to fix it? Should I fix it?&lt;/p&gt;&#xA;" OwnerUserId="14948" LastEditorUserId="9120" LastEditDate="2017-02-17T12:05:13.040" LastActivityDate="2019-09-01T18:54:39.480" Title="Why does Emacs indent my Lisp LOOP construct weirdly?" Tags="|indentation|slime|common-lisp|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30789" PostTypeId="2" ParentId="30788" CreationDate="2017-02-17T11:53:26.573" Score="7" Body="&lt;p&gt;You can use indentation provided by a SLIME contribution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'slime-cl-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may want to add that to the list &lt;code&gt;slime-contribs&lt;/code&gt;- see &lt;a href=&quot;https://www.common-lisp.net/project/slime/doc/html/Loading-Contribs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Loading Contribs&lt;/a&gt; in the SLIME manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can add it to the list of &lt;em&gt;SLIME contributions&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'slime-contribs 'slime-cl-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9120" LastEditorUserId="9120" LastEditDate="2017-02-19T09:54:03.740" LastActivityDate="2017-02-19T09:54:03.740" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30790" PostTypeId="1" AcceptedAnswerId="30791" CreationDate="2017-02-17T12:13:23.847" Score="2" ViewCount="723" Body="&lt;p&gt;I currently have the following settings for &lt;code&gt;hippie-expand&lt;/code&gt; in my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq hippie-expand-try-functions-list&#xA;  '(try-expand-dabbrev&#xA;    try-expand-dabbrev-all-buffers&#xA;    try-expand-dabbrev-from-kill&#xA;    try-complete-file-name-partially&#xA;    try-complete-file-name&#xA;    try-expand-all-abbrevs&#xA;    try-expand-list&#xA;    try-expand-line&#xA;    try-complete-lisp-symbol-partially&#xA;    try-complete-lisp-symbol))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, there is one thing annoying me: The order of suggestions I get when I use the completion function. I want it to suggest the shortest completion first, not the longest one. For example when I write a text and I know I used the word I am currently writing and other variations before in the text, I want it to suggest the &quot;lowest common denominator&quot; of those words and not the longest of the words. Then I can simply type the next letter &quot;giving emacs another hint&quot; and use completion again. This can go on until I got the complete word. I like this more than switching through a long list of words. For code it is similar. I don't want the first suggestion to be the longest expression, which it can find in the buffers, but the shortest one, because the longest one might confuse, because it might be several lines long (for example s-expressions in any Lisp).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I reverse the order of suggestions or make it show the shortest first?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I now think it always suggests the least recently used completion. In text this seems OK, although I am used to having the shortest one first. However in Code, for example for some s-expressions, this is terrible, as it will insert whole blocks of code, when I only want it to complete some name of a procedure or a variable name.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10090" LastEditorUserId="105" LastEditDate="2017-02-17T16:31:21.997" LastActivityDate="2023-02-02T19:13:51.253" Title="Reverse suggestions from hippie-expand" Tags="|completion|sorting|hippie-expand|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30791" PostTypeId="2" ParentId="30790" CreationDate="2017-02-17T12:39:13.910" Score="3" Body="&lt;p&gt;I'm a bit confused by your question, because &lt;code&gt;hippie-expand&lt;/code&gt; &lt;em&gt;doesn't&lt;/em&gt; provide results in longest-to-shortest order, and it also &lt;em&gt;doesn't&lt;/em&gt; provide &quot;lowest common denominator&quot; results which aren't actual completions, so there's no way for you to achieve your aim by any kind of re-ordering process, so you're actually looking for a different kind of functionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To order the results at all, you'll need to generate them all up front (which &lt;code&gt;hippie-expand&lt;/code&gt; doesn't do), so you might look at the &lt;a href=&quot;https://www.emacswiki.org/emacs/HippieExpand#toc10&quot; rel=&quot;nofollow noreferrer&quot;&gt;Expansion menu&lt;/a&gt; approach on the Emacs Wiki for a starting point, in which I use the following to obtain a list of the completion options:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-hippie-expand-completions (&amp;amp;optional hippie-expand-function)&#xA;  &quot;Return the full list of possible completions generated by `hippie-expand'.&#xA;The optional argument can be generated with `make-hippie-expand-function'.&quot;&#xA;  (let ((this-command 'my-hippie-expand-completions)&#xA;        (last-command last-command)&#xA;        (buffer-modified (buffer-modified-p))&#xA;        (hippie-expand-function (or hippie-expand-function 'hippie-expand)))&#xA;    (flet ((ding)) ; avoid the (ding) when hippie-expand exhausts its options.&#xA;      (while (progn&#xA;               (funcall hippie-expand-function nil)&#xA;               (setq last-command 'my-hippie-expand-completions)&#xA;               (not (equal he-num -1)))))&#xA;    ;; Evaluating the completions modifies the buffer, however we will finish&#xA;    ;; up in the same state that we began.&#xA;    (set-buffer-modified-p buffer-modified)&#xA;    ;; Provide the options in the order in which they are normally generated.&#xA;    (delete he-search-string (reverse he-tried-table))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-02-17T23:50:46.217" LastActivityDate="2017-02-17T23:50:46.217" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30792" PostTypeId="1" CreationDate="2017-02-17T13:26:54.620" Score="1" ViewCount="59" Body="&lt;p&gt;I'm creating a 'form' of sorts in a buffer that has a few required arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Title:&#xA;Labels:&#xA;&#xA;content content content&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the form is presented, I'd like to be able to edit any and all text after each &lt;code&gt;Header:&lt;/code&gt; without being able to move point &lt;em&gt;into&lt;/em&gt; &lt;code&gt;Header:&lt;/code&gt; -- kindof like a minibuffer prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After looking at the definition of &lt;code&gt;read-from-minibuffer&lt;/code&gt; for the right properties, here's what I've got so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my--insert-header (header &amp;amp;optional default-value)&#xA;  ;; inhibit point from moving inside the field&#xA;  (setq-local inhibit-point-motion-hooks nil)&#xA;  ;; insert Header: Default-Value pairs&#xA;  (let ((props1 '(front-sticky t rear-non-sticky t field t read-only t intangible t face magit-header-line))&#xA;        (props2 '(front-sticky nil rear-non-sticky nil field nil read-only nil intangible nil)))&#xA;    (insert (apply #'propertize (format &quot;%s: &quot; header) props1))&#xA;    (insert (apply #'propertize (or value &quot;&quot;) props2))&#xA;    (insert (apply #'propertize &quot;\n&quot; props1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run this code in a scratch buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn&#xA;  (insert &quot;\n\n\n&quot;)&#xA;  (my--insert-header &quot;Title&quot; &quot;some title&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get an error.  I think it's because &lt;code&gt;(insert (apply #'propertize (or value &quot;&quot;) props2))&lt;/code&gt; is trying to insert at read-only text, but I'm not sure how to go about fixing that without compromising the desired behavior.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-02-17T13:26:54.620" Title="How do I insert read-only, HTTP-style headers with editable values?" Tags="|text-properties|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30793" PostTypeId="5" CreationDate="2017-02-17T15:49:49.363" Score="0" Body="&lt;p&gt;A &lt;a href=&quot;/questions/tagged/minor-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;minor-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;minor-mode&lt;/a&gt; is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Minor-Modes.html#Minor-Modes&quot; rel=&quot;nofollow noreferrer&quot;&gt;one&lt;/a&gt; of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Modes.html#Modes&quot; rel=&quot;nofollow noreferrer&quot;&gt;two main modes&lt;/a&gt; in Emacs for grouping definitions and customizing editing features. Modes can be turned on and off while editing. They are not just a programming feature, but an essential part of Emacs interaction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;a href=&quot;/questions/tagged/minor-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;minor-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;minor-mode&lt;/a&gt; can be enabled individually or in combination with other modes. Most minor modes handle features independent of the &lt;a href=&quot;/questions/tagged/major-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;major-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;major-mode&lt;/a&gt;. Some modes depend on each other, but those are exceptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;a href=&quot;/questions/tagged/minor-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;minor-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;minor-mode&lt;/a&gt; can have its own &lt;a href=&quot;/questions/tagged/keymap&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;keymap&amp;#39;&quot; rel=&quot;tag&quot;&gt;keymap&lt;/a&gt; and visual cues in the &lt;a href=&quot;/questions/tagged/modeline&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;modeline&amp;#39;&quot; rel=&quot;tag&quot;&gt;modeline&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A typical Emacs installation could have a dozen or more minor modes. &lt;code&gt;C-h v minor-mode-list&lt;/code&gt; shows a complete list. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-18T00:41:04.007" LastActivityDate="2017-02-18T00:41:04.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30794" PostTypeId="4" CreationDate="2017-02-17T15:49:49.363" Score="0" Body="provides optional features that users may enable or disable independently of the choice of major mode. Minor modes can be enabled individually or in combination with other modes." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-18T00:37:50.970" LastActivityDate="2017-02-18T00:37:50.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30795" PostTypeId="5" CreationDate="2017-02-17T16:02:27.197" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-17T16:02:27.197" LastActivityDate="2017-02-17T16:02:27.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30796" PostTypeId="4" CreationDate="2017-02-17T16:02:27.197" Score="0" Body="for Emacs support of mouse. Emacs mouse interface supports click events, drag events, button-down events, and motion events. Whereas the current buffer handles keystrokes, mouse events in a clicked buffer are independent of the current buffer." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-18T00:40:34.423" LastActivityDate="2017-02-18T00:40:34.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30797" PostTypeId="1" AcceptedAnswerId="30802" CreationDate="2017-02-17T16:44:52.017" Score="1" ViewCount="259" Body="&lt;p&gt;When a golang function signature is split with a linebreak it does not appear in &lt;code&gt;imenu&lt;/code&gt; nor &lt;code&gt;helm-imenu&lt;/code&gt;. I would like to jump between functions using &lt;code&gt;helm-imenu&lt;/code&gt;, but this issue is in my way. Not hard-wrapping the function signatures is not a solution because others on my team have other preferences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// This function does _not_ appear in imenu.&#xA;func (b *Foo) LongFunction(ctx context.Context, a A,&#xA;    b B, c C) foobar.Bazzybaz {&#xA;...&#xA;}&#xA;&#xA;// But this one does!&#xA;func (b *Foo) ShortFunction(ctx context.Context, d D) foobar.Wazoo {&#xA;...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Short of fixing the problem for me, it would be super helpful if you could point me towards where &lt;code&gt;helm-menu&lt;/code&gt;/&lt;code&gt;imenu&lt;/code&gt; gets its symbol list in the first place. Or another package suggestion for fuzzy-searching the file's function list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs 24.5 (9.0)&lt;br&gt;&#xA;osx 10.12.3&lt;/p&gt;&#xA;" OwnerUserId="14952" LastActivityDate="2017-03-19T18:55:46.553" Title="Imenu is missing multi-line golang function signatures" Tags="|helm|imenu|golang|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30798" PostTypeId="1" CreationDate="2017-02-17T17:22:21.027" Score="1" ViewCount="87" Body="&lt;p&gt;I have a gmail account, and have set up gnus to read my email over IMAP. I'm also subscribed to a few mailing lists, and want them to be placed in individual directories, e.g. ml-openstack, ml-dpdk etc. so that when I open gnus, I have them not in INBOX, but in ml-openstack, ml-dpdk and so forth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I tweak in emacs/gnus configuration to achieve this?&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="14953" LastActivityDate="2017-06-19T01:45:58.813" Title="make gnus to place inbound emails per folders" Tags="|gnus|email|imap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30799" PostTypeId="2" ParentId="30780" CreationDate="2017-02-17T18:21:09.570" Score="1" Body="&lt;p&gt;The function used to display the list of colors is &lt;code&gt;list-colors-display&lt;/code&gt;. This function is actually called from the &lt;code&gt;color&lt;/code&gt; widget, so that's the code you'll need to work with. Emacs widgets are documented in their &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/widget.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;own manual&lt;/a&gt;, available from Emacs via &lt;code&gt;C-h i widget &amp;lt;ret&amp;gt;&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-17T18:21:09.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30800" PostTypeId="1" AcceptedAnswerId="30801" CreationDate="2017-02-17T18:43:04.090" Score="6" ViewCount="322" Body="&lt;p&gt;I saw this &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/mapcar.html&quot; rel=&quot;noreferrer&quot;&gt;example&lt;/a&gt; code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mapcar '1+ '(2 4 6))&#xA;     ⇒ (3 5 7)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I do not understand &lt;code&gt;'1+&lt;/code&gt; here. it will apply a function to a list but this style obviously not like a function. If means add, the function should be +, what does &lt;code&gt;'1+&lt;/code&gt; mean?&lt;/p&gt;&#xA;" OwnerUserId="14840" LastEditorUserId="105" LastEditDate="2017-02-17T20:11:25.913" LastActivityDate="2017-02-18T06:08:21.340" Title="Emacs - Understand elisp syntax (mapcar '1+ '(2 4 6))" Tags="|mapping|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30801" PostTypeId="2" ParentId="30800" CreationDate="2017-02-17T18:45:38.667" Score="8" Body="&lt;p&gt;It's really a function, which means add 1. you can try below example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ELISP&amp;gt; (1+ 3)&#xA;4 (#o4, #x4, ?\C-d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The implementation is at data.c:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEFUN (&quot;1+&quot;, Fadd1, Sadd1, 1, 1, 0,&#xA;       doc: /* Return NUMBER plus one.  NUMBER may be a number or a marker.&#xA;Markers are converted to integers.  */)&#xA;  (register Lisp_Object number)&#xA;{&#xA;  CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (number);&#xA;&#xA;  if (FLOATP (number))&#xA;    return (make_float (1.0 + XFLOAT_DATA (number)));&#xA;&#xA;  XSETINT (number, XINT (number) + 1);&#xA;  return number;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="14843" LastEditDate="2017-02-17T19:31:29.180" LastActivityDate="2017-02-17T19:31:29.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30802" PostTypeId="2" ParentId="30797" CreationDate="2017-02-17T18:49:15.303" Score="1" Body="&lt;p&gt;Fixed it by changing the value of &lt;code&gt;imenu-generic-expression&lt;/code&gt; to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'((&quot;type&quot; &quot;^[ \t]*type *\\([^ \t\n\r\f]*[ \t]*\\(struct\\|interface\\)\\)&quot; 1)&#xA;  (&quot;func&quot; &quot;^func *\\(.*\\)&quot; 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which has two advantages over the original value. it recognizes split-line functions, and it notices embedded types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll probably submit a PR to &lt;code&gt;go-mode&lt;/code&gt;, but until then to get this rolling you can do&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Go mode.&#xA;(defun my-go-mode-hook ()&#xA;  ; Custom imenu regexes&#xA;  (setq imenu-generic-expression&#xA;        '((&quot;type&quot; &quot;^[ \t]*type *\\([^ \t\n\r\f]*[ \t]*\\(struct\\|interface\\)\\)&quot; 1)&#xA;          (&quot;func&quot; &quot;^func *\\(.*\\)&quot; 1)))&#xA;  )&#xA;&#xA; (add-hook 'go-mode-hook 'my-go-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks for the tip about &lt;code&gt;imenu-generic-expression&lt;/code&gt; Drew!&lt;/p&gt;&#xA;" OwnerUserId="14952" LastActivityDate="2017-02-17T18:49:15.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30803" PostTypeId="2" ParentId="30800" CreationDate="2017-02-17T19:34:27.307" Score="1" Body="&lt;p&gt;&lt;code&gt;'1+&lt;/code&gt; is a reference to the function stored in that symbol, in this case it returns number incremented by 1. &lt;code&gt;mapcar&lt;/code&gt; applies it to every element of the list, and then returns the resulting list.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2017-02-17T19:34:27.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30804" PostTypeId="1" CreationDate="2017-02-17T20:01:09.777" Score="0" ViewCount="87" Body="&lt;p&gt;Command &lt;code&gt;comment-line&lt;/code&gt; is not recognized by my version of emacs. How can I install this function? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: It may be relevant that my system shows at least two emacs, at /usr/local/bin/emacs; and at /usr/bin/emacs24. The second one is what I use; the first one cannot be launched. I have periodically removed and reinstalled emacs for reasons I cannot now recall. &lt;/p&gt;&#xA;" OwnerUserId="14932" LastEditorUserId="14932" LastEditDate="2017-02-19T22:50:46.390" LastActivityDate="2017-02-19T22:50:46.390" Title="My emacs doesn't contain a function in the online emacs manual" Tags="|functions|commands|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30805" PostTypeId="2" ParentId="30804" CreationDate="2017-02-17T20:08:35.153" Score="1" Body="&lt;p&gt;What makes you think that your version of Emacs does not have command &lt;code&gt;comment-line&lt;/code&gt;? What does &lt;code&gt;C-h f comment-line&lt;/code&gt; tell you?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What version of Emacs do you have? &lt;code&gt;M-x emacs-version&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;comment-line&lt;/code&gt; is defined in library &lt;code&gt;newcomment.el&lt;/code&gt;, which is available with Emacs 23 and later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you try to invoke &lt;code&gt;comment-line&lt;/code&gt; (e.g. &lt;code&gt;M-x comment-line&lt;/code&gt;), library &lt;code&gt;newcomment.el&lt;/code&gt; should be loaded automatically, defining the command completely. But this assumes you have Emacs 23 or later.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-17T20:08:35.153" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30806" PostTypeId="2" ParentId="30782" CreationDate="2017-02-17T20:26:37.333" Score="2" Body="&lt;p&gt;A general solution to &quot;do something after another command&quot; is to use advice, as suggested in the comments above. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun after-magit-pull ()&#xA;  &quot;Some function to run after `magit-pull`.&quot;)&#xA;  (whatever))&#xA;&#xA;(advice-add 'magit-pull :after 'after-magit-pull)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whether this is the best way to accomplish your goal is a slightly different question. Using a git hook may be more appropriate, again as noted in the comments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at &lt;code&gt;magit-pull&lt;/code&gt; a bit more, using advice does not seem appropriate for this particular case. Magit starts git processes asynchronously and uses &lt;code&gt;magit-process-sentinel&lt;/code&gt; to wait for the git process to complete so that it can do some additional work (like refreshing buffers). So &lt;code&gt;:after&lt;/code&gt; advice on a command like &lt;code&gt;magit-pull&lt;/code&gt; will probably run before the underlying git process actually completes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To take some action after a git command finishes you might be able to use the &lt;code&gt;magit-post-refresh-hook&lt;/code&gt;. I haven't tried this, but you could create your own command that adds an additional function to the post-refresh hook -- one that removes itself when it is done -- and then calling &lt;code&gt;magit-pull&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-02-18T16:06:50.563" LastActivityDate="2017-02-18T16:06:50.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30807" PostTypeId="1" AcceptedAnswerId="68346" CreationDate="2017-02-17T20:33:18.627" Score="1" ViewCount="136" Body="&lt;p&gt;in &lt;code&gt;cperl-mode&lt;/code&gt;, here docs are colored with a &lt;code&gt;font-lock-string-face&lt;/code&gt;. However if you used any function that inserts a newline on a blank line (e.g. &lt;code&gt;M-: (insert &quot;\n&quot;)&lt;/code&gt;) it will cause all code after the newline to be highlighted with &lt;code&gt;font-lock-comment-face&lt;/code&gt;. The only way to fix it is try and &quot;mess with&quot; here doc tags so that cperl re-parses and corrects the font-lock. I have a feeling this may have something to do with &lt;a href=&quot;https://emacs.stackexchange.com/questions/13320/why-does-inserting-a-newline-break-highlighting-with-syntax-propertize-function&quot;&gt;this&lt;/a&gt; issue since it is also dealing with multi-line syntax highlighting. Is there an expert out there who can help me find a way to fix this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/usr/bin/env perl&#xA;&#xA;my $here_doc = &amp;lt;&amp;lt;'_HERE_';&#xA;this is here doc line&#xA;&amp;lt;--- call (insert &quot;\n&quot;) when cursor is here&#xA;_HERE_&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2021-09-01T15:08:12.330" Title="Cperl-mode syntax highlighting breaks when inserting a newline into a here doc" Tags="|major-mode|font-lock|syntax-highlighting|string|perl|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30808" PostTypeId="2" ParentId="30807" CreationDate="2017-02-17T21:45:48.937" Score="2" Body="&lt;p&gt;The package &lt;a href=&quot;https://github.com/Lindydancer/highlight-refontification&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight-refontification&lt;/a&gt; visualizes how font-lock refontifies a buffer. In this case, it starts at the line where the point is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to handle this is to add a function to &lt;code&gt;font-lock-extend-region-functions&lt;/code&gt; to expand the region to include the full heredoc comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing that is curious is that the highlighting becomes correct when pressing &lt;code&gt;return&lt;/code&gt; but not when evaluating &lt;code&gt;(insert &quot;\n&quot;)&lt;/code&gt;, something I have no explanation for.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="10" LastEditDate="2017-02-17T21:50:26.440" LastActivityDate="2017-02-17T21:50:26.440" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30809" PostTypeId="2" ParentId="30734" CreationDate="2017-02-17T22:03:10.200" Score="5" Body="&lt;p&gt;It seems the main problem is that the ascii characters &lt;code&gt;0..9&lt;/code&gt; aren't in the digit category, &lt;code&gt;C-u C-x =&lt;/code&gt; shows &lt;code&gt;category: .:Base, a:ASCII, l:Latin, r:Roman&lt;/code&gt; (it also has &lt;code&gt;general-category: Nd (Number, Decimal Digit)&lt;/code&gt;, but apparently that's not what &lt;code&gt;\cC&lt;/code&gt; looks for).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Shouldn't &lt;code&gt;\\c6*&lt;/code&gt; match &lt;code&gt;456&lt;/code&gt; in &lt;code&gt;test456test&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also note that &lt;code&gt;\\c6*&lt;/code&gt; matches the empty string.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((str &quot;test456test&quot;))&#xA;  (list (progn (string-match &quot;[0-9]*&quot; str) (match-string 0 str))&#xA;        (progn (string-match &quot;[0-9]+&quot; str) (match-string 0 str)))) ;=&amp;gt; (&quot;&quot; &quot;456&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-02-17T22:03:10.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30811" PostTypeId="1" CreationDate="2017-02-17T22:47:56.300" Score="1" ViewCount="67" Body="&lt;p&gt;In the org manual one finds the &lt;code&gt;H&lt;/code&gt; option for exporting. It says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;H:&#xA;Set the number of headline levels for export (org-export-headline-levels). ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: Is there an export option for setting the initial level for export?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to skip the first level when exporting.&lt;/p&gt;&#xA;" OwnerUserId="2441" LastActivityDate="2017-02-17T22:47:56.300" Title="Export option &quot;opposite&quot; to `H`" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30812" PostTypeId="2" ParentId="30663" CreationDate="2017-02-18T00:11:47.513" Score="2" Body="&lt;p&gt;A Solution (below) &amp;amp; How To Get It&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How To&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's one way to find the answer to this question for oneself:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Formulate the (base) question and problem statement(s) to be clear, accurate, precise, and concise (and potentially formulate multiple versions of the question with different wording or perspective).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Imagine potential solutions to the base question, and ways that one could find those potential solutions.  This leads to &lt;em&gt;further questions&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, since I thought I might be able to manipulate variables to control the timeline view formatting, I should imagine, hmm, how could I discover the appropriate variable? Is there a way to search through all the variables? Is there a way to search for relevant variables?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a method for &lt;em&gt;browsing&lt;/em&gt; the variables, but that wasn't good enough.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Review &lt;a href=&quot;http://www.catb.org/esr/faqs/smart-questions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;How To Ask Questions The Smart Way&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Search online for potential solutions.  (But if base question isn't answered, use the &lt;em&gt;further questions&lt;/em&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Skim/Read the Emacs &lt;a href=&quot;https://www.gnu.org/software/emacs/documentation.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Documentation&lt;/a&gt;/&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Manual&lt;/a&gt; and Org-mode &lt;a href=&quot;http://orgmode.org/#docs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Documentation&lt;/a&gt;/&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Manual&lt;/a&gt;, and do some more web searches when necessary.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Doing all this, I find:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Searching online for (how to search for emacs variable), I find the first hit is (GNU Emacs Manual: Apropos).  I find these two useful commands: &lt;code&gt;M-x apropos&lt;/code&gt; and &lt;code&gt;M-x apropos-variable&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Trying &lt;code&gt;M-x apropos-variable RET agenda&lt;/code&gt;, I get a list of many variables that I can search (not just browse), and can select (by hitting &lt;code&gt;RET&lt;/code&gt;) to get more information.  Searching for (date) yields &lt;code&gt;org-agenda-format-date&lt;/code&gt;. Its info gives its value as &lt;code&gt;org-agenda-format-date-aligned&lt;/code&gt; and says this is defined in the file &lt;code&gt;org-agenda.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hitting &lt;code&gt;RET&lt;/code&gt; on the file name &lt;code&gt;org-agenda.el&lt;/code&gt; (which is also a link) shows the file contents at the relevant location!  Here, &lt;code&gt;org-agenda-format-date&lt;/code&gt; and &lt;code&gt;org-agenda-format-date-aligned&lt;/code&gt; are defined, and one can see that the latter is a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out, I could also find this variable by browsing via &lt;code&gt;M-x org-customize RET&lt;/code&gt; &gt; Org &gt; Org Agenda &gt; Org Agenda Daily/Weekly &gt; Org Agenda Format Date. This reveals even more explicitly that the value (&lt;code&gt;org-agenda-format-date-aligned&lt;/code&gt;) is a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the function definition, the variable names inside it, and already being able to recognize common syntax for displaying text/numbers, I see that this is the function I should be modifying or replacing with my own function (as suggested by &lt;a href=&quot;https://emacs.stackexchange.com/users/2287/lawlist&quot;&gt;lawlist&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I investigate the sub-functions to find out how to modify them (referring to the Emacs Lisp &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/index.html#SEC_Contents&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intro&lt;/a&gt;/&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Manual&lt;/a&gt; when necessary to figure out optional arguments and confirm syntax).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Looking in the most immediately relevant manual, I find: The Org (Mode) Manual &gt; Agenda Views &gt; Custom agenda views &gt; Setting Options.  It gives an example using &lt;code&gt;org-agenda-custom-commands&lt;/code&gt;.  This is not really relevant, although it does show a usage of &lt;code&gt;setq&lt;/code&gt; that inspires me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; initialization file, I use &lt;code&gt;setq&lt;/code&gt; (see solution below), instead of &lt;code&gt;defalias&lt;/code&gt;, as suggested by &lt;a href=&quot;https://emacs.stackexchange.com/users/2287/lawlist&quot;&gt;lawlist&lt;/a&gt;, to set &lt;code&gt;org-agenda-format-date&lt;/code&gt; to a new function that I define: &lt;code&gt;my-org-agenda-format-date-aligned&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I restart emacs with this new initialization file, check my agenda, see that the day and month names are now abbreviated, but I'll have to make further adjustments to reduce some of the horizontal spacing.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Further investigation reveals &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; to be the relevant variable.  I use &lt;code&gt;setq&lt;/code&gt; again in my &lt;code&gt;.emacs&lt;/code&gt; file to modify this variable.  (I'm not sure if this is really the proper use of &lt;code&gt;setq&lt;/code&gt;, but it works!)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: this may be a bad hacky kluge, since I barely know what I'm doing here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; initialization file, I added the following.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Modify agenda display (spacing and name abbreviations)&#xA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;&#xA;;; modify agenda &quot;date headings&quot; format (to abbreviate day and month names)&#xA;(setq org-agenda-format-date 'my-org-agenda-format-date-aligned)&#xA;&#xA;(defun my-org-agenda-format-date-aligned (date)                                                                                                                                             &#xA;  &quot;Format a DATE string for display in the daily/weekly agenda, or timeline.&#xA;This function makes sure that dates are aligned for easy reading.&quot;&#xA;  (require 'cal-iso)&#xA;  (let* ((dayname (calendar-day-name date 1 nil))&#xA;         (day (cadr date))&#xA;         (day-of-week (calendar-day-of-week date))&#xA;         (month (car date))&#xA;         (monthname (calendar-month-name month 1))&#xA;         (year (nth 2 date))&#xA;         (iso-week (org-days-to-iso-week&#xA;                    (calendar-absolute-from-gregorian date)))&#xA;         (weekyear (cond ((and (= month 1) (&amp;gt;= iso-week 52))&#xA;                          (1- year))&#xA;                         ((and (= month 12) (&amp;lt;= iso-week 1))&#xA;                          (1+ year))&#xA;                         (t year)))&#xA;         (weekstring (if (= day-of-week 1)&#xA;                         (format &quot; W%02d&quot; iso-week)&#xA;                       &quot;&quot;)))&#xA;         (format &quot;%-8s %2d %s %4d%s&quot;&#xA;            dayname day monthname year weekstring)))&#xA;&#xA;; modify spacing too:&#xA;(setq org-agenda-prefix-format&#xA;  '((agenda  . &quot; %i %-10:c%?-12t% s&quot;)&#xA;    (timeline  . &quot;  % s&quot;)&#xA;    (todo  . &quot; %i %-12:c&quot;)&#xA;    (tags  . &quot; %i %-12:c&quot;)&#xA;    (search . &quot; %i %-12:c&quot;))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14890" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-02-18T00:11:47.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30813" PostTypeId="1" AcceptedAnswerId="30816" CreationDate="2017-02-18T06:43:30.273" Score="19" ViewCount="5662" Body="&lt;p&gt;Documentation for &lt;code&gt;evil-normal-state-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Keymap for Normal state.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Documentation for &lt;code&gt;evil-motion-state-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Keymap for Motion state.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does Vim have a so-called &quot;motion mode&quot;? In Vim, executing &lt;code&gt;:help Normal-mode&lt;/code&gt; would give you the documentation on Vim modes, while &lt;code&gt;:help Motion-mode&lt;/code&gt; tells me &lt;code&gt;E149: Sorry, no help for Motion-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when mapping keys in evil-state, which statement should I use?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &amp;lt;key&amp;gt;) &amp;lt;command&amp;gt;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(define-key evil-motion-state-map (kbd &amp;lt;key&amp;gt;) &amp;lt;command&amp;gt;)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm using Spacemace, in case it's relevant.&lt;/p&gt;&#xA;" OwnerUserId="14867" LastEditorUserId="10" LastEditDate="2017-02-18T10:19:54.797" LastActivityDate="2017-02-18T10:19:54.797" Title="Differences between evil-normal-state-map and evil-motion-state-map" Tags="|key-bindings|evil|keymap|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30814" PostTypeId="1" AcceptedAnswerId="30815" CreationDate="2017-02-18T07:23:20.153" Score="0" ViewCount="482" Body="&lt;p&gt;I am new to emacs/spacemacs and I saw some really cool videos and read through some articles and I really want to get it working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when I hit SPC + ' it says &quot;SPC ' is undefined&quot; Anyone know how to fix this or what the problem might be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;according to the documentation this is supposed to open an eshell window. (I am using MacOS). If I hit just SPC to see what is bound there is no SPC ' bind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read through so many articles trying to figure this out. &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Btools/shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Btools/shell&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something? I wish there was a spacemacs wiki! I would go and use full emacs and try to get it to a point where maybe it is similar to spacemacs... but I am so new to this I thought something fully packaged was best.&lt;/p&gt;&#xA;" OwnerUserId="14956" LastActivityDate="2017-02-18T10:17:07.880" Title="Can't open eshell in spacemacs" Tags="|spacemacs|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30815" PostTypeId="2" ParentId="30814" CreationDate="2017-02-18T10:17:07.880" Score="1" Body="&lt;p&gt;You need install shell layer first, see install section of shell layer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can run eshell function directly, &quot;SPC : eshell RET&quot; or &quot;M-x eshell RET&quot;.&lt;/p&gt;&#xA;" OwnerUserId="14959" LastActivityDate="2017-02-18T10:17:07.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30816" PostTypeId="2" ParentId="30813" CreationDate="2017-02-18T10:19:34.693" Score="24" Body="&lt;p&gt;Motion state is an Evil-specific thing, intended for modes where you don't edit text, but still want Vim-style movement available, with all other keys of that mode passing through.  Help buffers are an example of such a case, the package.el listing is another one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically you want commands moving point in &lt;code&gt;evil-motion-state-map&lt;/code&gt; and everything else in &lt;code&gt;evil-normal-state-map&lt;/code&gt;.  As Evil is set up to look up keys in &lt;code&gt;evil-normal-state-map&lt;/code&gt; first, then in &lt;code&gt;evil-motion-state-map&lt;/code&gt;, movements will be available in normal state as well.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-02-18T10:19:34.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30817" PostTypeId="1" AcceptedAnswerId="30825" CreationDate="2017-02-18T11:01:38.947" Score="2" ViewCount="308" Body="&lt;p&gt;I'd like to perform a regexp search, capture part of a matched string, and save&#xA;that part to a list. (Eventually the plan is to save this list to a file in a &#xA;particular format, but for now a simple list will do.) I've tried the&#xA;following, but it doesn't seem to do anything when I &lt;code&gt;M-x eval-region&lt;/code&gt; over the&#xA;whole document and &lt;code&gt;M-x first-words-in-numbered-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun first-words-in-numbered-list ()&#xA;  &quot;gets the first word in lines that start with numbered list and builds those&#xA;   words into a list, e.g. running the function on the following text:&#xA;&#xA;   foo&#xA;   bar&#xA;   1. alpha zulu&#xA;   2. bravo tango&#xA;   quux schmucks&#xA;   3. charlie foxtrot&#xA;   10. kilo romeo&#xA;&#xA;   should produce a list (\&quot;kilo\&quot; \&quot;charlie\&quot; \&quot;bravo\&quot; \&quot;alpha\&quot;)&quot;&#xA;  (interactive)&#xA;  (goto-char 1)&#xA;  (setq first-words '())&#xA;  (while (re-search-forward&#xA;          &quot;^[[:space:]]*[[:digit:]]+[.)]?[[:space:]]+\([[:word:]]\)&quot;&#xA;          nil t)&#xA;    ;; for debugging&#xA;    (message (match-string 1))&#xA;    (sleep-for 2)&#xA;    ;; for actually storing the list&#xA;    (setq first-words (cons (match-string 1) first-words))))&#xA;&#xA;(defun print-list-elements (list)&#xA;  &quot;Print each element of LIST on a line of its own.&quot;&#xA;  (while list&#xA;    (print (car list))&#xA;    (setq list (cdr list))))&#xA;(print-list-elements first-words)&#xA;&#xA;foo&#xA;bar&#xA;1. alpha&#xA;2. bravo&#xA;quux&#xA;3. charlie&#xA;10. kilo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: I've updated the file to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun first-words-in-numbered-list ()&#xA;  &quot;gets the first word in lines that start with numbered list and builds those&#xA;   words into a list, e.g. running the function on the following text:&#xA;&#xA;   foo&#xA;   bar&#xA;   1. alpha zulu&#xA;   2. bravo tango&#xA;   quux schmucks&#xA;   3. charlie foxtrot&#xA;   10. kilo romeo&#xA;&#xA;   should produce a list (\&quot;kilo\&quot; \&quot;charlie\&quot; \&quot;bravo\&quot; \&quot;alpha\&quot;)&quot;&#xA;  (interactive)&#xA;  (goto-char 1)&#xA;  (setq first-words '())&#xA;  (while (re-search-forward&#xA;          &quot;^[[:digit:]]+[.)]?[[:space:]]+\\([[:word:]]+\\)&quot;&#xA;          nil t)&#xA;    (setq first-words (cons (match-string 1) first-words))))&#xA;&#xA;foo&#xA;bar&#xA;1. alpha&#xA;2. bravo&#xA;quux&#xA;3. charlie&#xA;10. kilo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is most of the way there! The problem is that when I &lt;code&gt;C-h v first-words &amp;lt;RET&amp;gt;&lt;/code&gt;, I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;first-words's value is (#(&quot;kilo&quot; 0 4&#xA;   (fontified t))&#xA; #(&quot;charlie&quot; 0 7&#xA;   (fontified t))&#xA; #(&quot;bravo&quot; 0 5&#xA;   (fontified t))&#xA; #(&quot;alpha&quot; 0 5&#xA;   (fontified t)))&#xA;&#xA;&#xA;Documentation:&#xA;Not documented as a variable.&#xA;&#xA;[back]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why am I not getting plain strings like I wanted?&lt;/p&gt;&#xA;" OwnerUserId="9013" LastEditorUserId="105" LastEditDate="2017-02-18T18:16:14.553" LastActivityDate="2017-02-19T10:07:03.893" Title="Building a list of strings with a regexp while loop" Tags="|regular-expressions|search|string|list|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30818" PostTypeId="1" AcceptedAnswerId="30824" CreationDate="2017-02-18T12:08:56.820" Score="3" ViewCount="133" Body="&lt;p&gt;I want to write my &lt;code&gt;emacs-lisp-mode&lt;/code&gt; modification which respects&#xA;some of my preferences. In particular, I want to override indentation for vector literals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs treats vector literal as quoted list while applying indentation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[if &quot;emacs&quot;&#xA;    &quot;why do you&quot;&#xA;  &quot;indent things this way&quot;]&#xA;&#xA;[1 2&#xA;   3 4]&#xA;&#xA;[(foo 1) ;; this one is OK without modifications&#xA; (bar 2)&#xA; &quot;this&quot;&#xA; &quot;is good&quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want this result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[if &quot;emacs&quot;&#xA; &quot;why do you&quot;&#xA; &quot;indent things this way&quot;]&#xA;&#xA;[1 2&#xA; 3 4]&#xA;&#xA;[(foo 1) &#xA; (bar 2)&#xA; &quot;this&quot;&#xA; &quot;is good&quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="14886" LastActivityDate="2017-02-18T17:00:54.683" Title="Vector literal indentation" Tags="|indentation|major-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30819" PostTypeId="2" ParentId="30532" CreationDate="2017-02-18T13:52:24.350" Score="1" Body="&lt;p&gt;You are probably looking for &lt;a href=&quot;https://github.com/Fanael/edit-indirect&quot; rel=&quot;nofollow noreferrer&quot;&gt;edit-indirect&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit regions in separate buffers, like `org-edit-src-code' but for arbitrary&#xA;   regions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9198" LastActivityDate="2017-02-18T13:52:24.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30821" PostTypeId="1" CreationDate="2017-02-18T15:39:10.920" Score="1" ViewCount="671" Body="&lt;p&gt;I would like to automate the following when emacs start:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;open a new buffer&lt;/li&gt;&#xA;&lt;li&gt;launch a foo function (create-name) that writes something&#xA;on the buffer and copy to clipboard a name YYY for the buffer&lt;/li&gt;&#xA;&lt;li&gt;save the buffer with name YYY&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thanks for suggestions!&lt;/p&gt;&#xA;" OwnerUserId="11940" LastEditorUserId="105" LastEditDate="2017-02-18T18:14:59.313" LastActivityDate="2017-10-19T14:31:56.163" Title="Start Emacs, create new file and execute functions" Tags="|start-up|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30822" PostTypeId="5" CreationDate="2017-02-18T17:00:08.160" Score="0" Body="&lt;p&gt;Org mode provides facilities for simple tables that conveniently allow one to create and manipulate tables. The facility assumes that tables use a fixed-width font in order to facilitate alignment. In addition to the basic functionality, Org mode tables can function as simple spreadsheets: formulas can be defined to calculate entries, based on other entries of this table or even other tables. For more information, consult the &amp;quot;Tables&amp;quot; chapter in the &lt;a href=&quot;https://orgmode.org/manual/Tables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org mode manual&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="14825" LastEditDate="2022-11-05T00:30:58.227" LastActivityDate="2022-11-05T00:30:58.227" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30823" PostTypeId="4" CreationDate="2017-02-18T17:00:08.160" Score="0" Body="For questions about Org mode's ASCII table editor. Use this tag for its spreadsheet calculations and plotting features as well.  " OwnerUserId="7045" LastEditorUserId="14825" LastEditDate="2022-11-05T00:30:58.227" LastActivityDate="2022-11-05T00:30:58.227" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30824" PostTypeId="2" ParentId="30818" CreationDate="2017-02-18T17:00:54.683" Score="2" Body="&lt;p&gt;This is a slightly modified version of &lt;code&gt;lisp-indent-function&lt;/code&gt;, which indents to the last indentation if&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;containing form is not a proper list (e.g. vector)&lt;/li&gt;&#xA;&lt;li&gt;symbol to indent is a keyword&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun ap/lisp-indent-function (indent-point state)&#xA;  &quot;See `lisp-indent-function'.&quot;&#xA;  (let ((normal-indent (current-column)))&#xA;    (goto-char (1+ (elt state 1)))&#xA;    (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)&#xA;    (if (or (not (eq ?\( (char-before)))&#xA;            (and (elt state 2)&#xA;                 (not (and (looking-at &quot;\\sw\\|\\s_&quot;)&#xA;                           (not (eq ?: (char-after)))))))&#xA;        ;; indent as data&#xA;        (progn&#xA;          (if (not (&amp;gt; (save-excursion (forward-line 1) (point))&#xA;                      calculate-lisp-indent-last-sexp))&#xA;              (progn (goto-char calculate-lisp-indent-last-sexp)&#xA;                     (beginning-of-line)&#xA;                     (parse-partial-sexp (point)&#xA;                                         calculate-lisp-indent-last-sexp 0 t)))&#xA;          ;; Indent under the list or under the first sexp on the same&#xA;          ;; line as calculate-lisp-indent-last-sexp.  Note that first&#xA;          ;; thing on that line has to be complete sexp since we are&#xA;          ;; inside the innermost containing sexp.&#xA;          (backward-prefix-chars)&#xA;          (current-column))&#xA;      ;; indent as function&#xA;      (let ((function (buffer-substring (point)&#xA;                                        (progn (forward-sexp 1) (point))))&#xA;            method)&#xA;        (setq method (or (function-get (intern-soft function)&#xA;                                       'lisp-indent-function)&#xA;                         (get (intern-soft function) 'lisp-indent-hook)))&#xA;        (cond ((or (eq method 'defun)&#xA;                   (and (null method)&#xA;                        (&amp;gt; (length function) 3)&#xA;                        (string-match &quot;\\`def&quot; function)))&#xA;               (lisp-indent-defform state indent-point))&#xA;              ((integerp method)&#xA;               (lisp-indent-specform method state&#xA;                                     indent-point normal-indent))&#xA;              (method&#xA;               (funcall method indent-point state)))))))&#xA;&#xA;(setq-default lisp-indent-function 'ap/lisp-indent-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-02-18T17:00:54.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30825" PostTypeId="2" ParentId="30817" CreationDate="2017-02-18T17:24:30.933" Score="2" Body="&lt;p&gt;Let me start with some general comments about the code below:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Since your code will move point around, it might be a good idea to put the body inside &lt;code&gt;save-excursion&lt;/code&gt; so the point will be at the same place where you started when you're finished.  But that depends on your application.&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;code&gt;(goto-char (point-min))&lt;/code&gt; instead of &lt;code&gt;1&lt;/code&gt; (check documentation for reason).&lt;/li&gt;&#xA;&lt;li&gt;You can use a local &lt;code&gt;let&lt;/code&gt;-bound variable to pass the list between your functions.  Setting and using &lt;code&gt;first-words&lt;/code&gt; is not really necessary.&lt;/li&gt;&#xA;&lt;li&gt;As @mutbuerger already mentioned, you have to quote &lt;code&gt;\&lt;/code&gt; in your regexp, hence the final part should look like &lt;code&gt;\\([[:word:]]+\\)&lt;/code&gt;.  You can use the command &lt;kbd&gt;M-x re-builder RET&lt;/kbd&gt; to test your regexps.&lt;/li&gt;&#xA;&lt;li&gt;As @politza said, use &lt;code&gt;match-string-no-properties&lt;/code&gt; to get the results of last search without properties.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Putting it together, I would suggest something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun first-words-in-numbered-list ()&#xA;  &quot;Gets the first word in lines that start with numbered list and&#xA;builds those words into a list, e.g. running the function on the&#xA;following text: ...&quot;&#xA;  (interactive)&#xA;  (let (words)&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward&#xA;              &quot;^[[:digit:]]+[.)]?[[:space:]]+\\([[:word:]]+\\)&quot;&#xA;              nil t)&#xA;        (push (match-string-no-properties 1) words)))&#xA;    words))&#xA;&#xA;(defun print-list-elements (list)&#xA;  &quot;Print each element of LIST on a line of its own.&quot;&#xA;  (while list&#xA;    (print (car list))&#xA;    (setq list (cdr list))))&#xA;&#xA;(print-list-elements (first-words-in-numbered-list))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12242" LastEditorUserId="12242" LastEditDate="2017-02-19T10:07:03.893" LastActivityDate="2017-02-19T10:07:03.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30826" PostTypeId="5" CreationDate="2017-02-18T17:28:10.843" Score="0" Body="&lt;p&gt;Tag &lt;a href=&quot;/questions/tagged/display&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;display&amp;#39;&quot; rel=&quot;tag&quot;&gt;display&lt;/a&gt; refers to how text and other visual objects appear in Emacs.&#xA;Emacs has many commands and settings that affect display.  They are &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/emacs.html#Display&quot; rel=&quot;nofollow noreferrer&quot;&gt;summarized in the manual&lt;/a&gt;.  This includes highlighting, the fringe, whitespace, text wrapping, cursor and mouse-pointer appearance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some display features have their own tags, such as &lt;a href=&quot;/questions/tagged/faces&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;faces&amp;#39;&quot; rel=&quot;tag&quot;&gt;faces&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/fonts&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;fonts&amp;#39;&quot; rel=&quot;tag&quot;&gt;fonts&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/font-lock&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;font-lock&amp;#39;&quot; rel=&quot;tag&quot;&gt;font-lock&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/scrolling&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;scrolling&amp;#39;&quot; rel=&quot;tag&quot;&gt;scrolling&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/narrowing&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;narrowing&amp;#39;&quot; rel=&quot;tag&quot;&gt;narrowing&lt;/a&gt;, &lt;a href=&quot;/questions/tagged/mode-line&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;mode-line&amp;#39;&quot; rel=&quot;tag&quot;&gt;mode-line&lt;/a&gt;, and &lt;a href=&quot;/questions/tagged/text-properties&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;text-properties&amp;#39;&quot; rel=&quot;tag&quot;&gt;text-properties&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-18T22:20:26.300" LastActivityDate="2017-02-18T22:20:26.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30827" PostTypeId="4" CreationDate="2017-02-18T17:28:10.843" Score="0" Body="is for Emacs display features, which includes scrolling, fonts, colors, and placement of text or images. " OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-18T22:21:57.767" LastActivityDate="2017-02-18T22:21:57.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30828" PostTypeId="5" CreationDate="2017-02-18T17:42:30.690" Score="0" Body="&lt;p&gt;&lt;code&gt;C-x C-f&lt;/code&gt; invokes the &lt;code&gt;find-file&lt;/code&gt; command, which then accepts a file name typed in the mini buffer area. On &lt;code&gt;RET&lt;/code&gt; key, Emacs &lt;code&gt;visits&lt;/code&gt; the file, which entails &lt;code&gt;creating&lt;/code&gt; a buffer, &lt;code&gt;copying&lt;/code&gt; the contents of the file into the buffer, &lt;code&gt;formatting&lt;/code&gt; the contents according to the relevant settings and mode of the file, and then &lt;code&gt;displaying&lt;/code&gt; the buffer for &lt;code&gt;editing&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs has dozens of other commands related to the &lt;code&gt;find-file&lt;/code&gt; command that can be used for more specialized needs. For example, &lt;code&gt;find-file-read-only&lt;/code&gt; opens the file for viewing only. Use the &lt;a href=&quot;/questions/tagged/find-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;find-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;find-file&lt;/a&gt; tag for questions pertaining to all such file commands.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-19T16:37:31.430" LastActivityDate="2017-02-19T16:37:31.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30829" PostTypeId="4" CreationDate="2017-02-18T17:42:30.690" Score="0" Body="is the most frequently used command for opening files in Emacs. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-19T16:37:16.687" LastActivityDate="2017-02-19T16:37:16.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30830" PostTypeId="1" CreationDate="2017-02-18T17:50:18.790" Score="1" ViewCount="65" Body="&lt;p&gt;I'd like to keep the clock entries simple and clean. I am thinking of defining an function to remove the most recent entry if it is less then 3 minutes when I clock out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's an similar function called &lt;code&gt;org-remove-empty-drawer-at&lt;/code&gt; in the org library but it's looks rather complex to me. So I wonder if any one had wrote one before?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="4044" LastActivityDate="2017-02-18T17:50:18.790" Title="Remove recent clock entry if it is less than X minutes" Tags="|org-mode|org-clock|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30831" PostTypeId="1" CreationDate="2017-02-18T17:56:57.210" Score="3" ViewCount="86" Body="&lt;p&gt;I wonder if there's an easy way to merge adjacent clock entries if they are within X minutes range? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:LOGBOOK:  &#xA;CLOCK: [2015-06-28 Sun 11:54]--[2015-06-28 Sun 12:12] =&amp;gt;  0:18&#xA;CLOCK: [2015-05-18 Mon 11:07]--[2015-05-18 Mon 11:54] =&amp;gt;  0:47&#xA;:END:         &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would be simplified as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:LOGBOOK:  &#xA;CLOCK: [2015-05-18 Mon 11:07]--[2015-05-18 Mon 12:12] =&amp;gt;  01:05&#xA;:END: &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4044" LastActivityDate="2017-02-18T17:56:57.210" Title="Merge org-clock entries" Tags="|org-mode|org-clock|" AnswerCount="0" CommentCount="0" ClosedDate="2019-10-03T17:22:48.100" ContentLicense="CC BY-SA 3.0" />
  <row Id="30832" PostTypeId="2" ParentId="30821" CreationDate="2017-02-18T18:55:36.453" Score="1" Body="&lt;p&gt;In my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun make-buffer-notes()&#xA;  &quot;Make notes-file at NOTES default folder (on desktop for windows)&quot;&#xA;  (setq notes-path &quot;c:/default/path/for/notes/&quot;)&#xA;  (setq notes-timestamp (concatenate 'string &quot;NOTES-&quot; (format-time-string &quot;%Y-%_0m-%d-%H%M&quot; (current-time))))&#xA;  (setq notes-full-path (concatenate 'string notes-path notes-timestamp  &quot;.org&quot;))&#xA;  (find-file notes-full-path)&#xA;  (insert &quot;* &quot; notes-timestamp  &quot; :NOTES:\b\n&quot;))&#xA;&#xA;(make-buffer-notes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11940" LastEditorUserId="10269" LastEditDate="2017-03-21T20:30:41.477" LastActivityDate="2017-03-21T20:30:41.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30835" PostTypeId="1" AcceptedAnswerId="30840" CreationDate="2017-02-18T21:15:08.033" Score="2" ViewCount="523" Body="&lt;p&gt;This is my first time trying to write my own elisp code, so bear with me. I have the following &lt;code&gt;cl-loop&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;data&lt;/code&gt; contains the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((refs . [((file . &quot;api/user.js&quot;) (start . 266) (end . 269)) ((file . &quot;api/user.js&quot;) (start . 292) (end . 295)) ((file . &quot;api/user.js&quot;) (start . 304) (end . 307)) ((file . &quot;api/user.js&quot;) (start . 320) (end . 323)) ((file . &quot;api/user.js&quot;) (start . 554) (end . 557)) ((file . &quot;api/user.js&quot;) (start . 575) (end . 578))]) (type . &quot;local&quot;) (name . &quot;req&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (cl-loop for ref across (cdr (assq 'refs data))&#xA;           for start = (1+ (cdr (assq 'start ref))) and&#xA;           file = (expand-file-name (cdr (assq 'file ref)) (tern-project-dir))&#xA;           if (string= buffer-file-name file)&#xA;           if (let ((a 1))&#xA;                (print ref)&#xA;                (print start)&#xA;                (&amp;lt; start (point)))&#xA;           collect start into prev-refs&#xA;           else collect start into next-refs&#xA;           finally return (list file (sort prev-refs '&amp;gt;) (sort next-refs '&amp;lt;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which currently outputs the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;((file . &quot;api/user.js&quot;) (start . 266) (end . 269))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;267&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;((file . &quot;api/user.js&quot;) (start . 292) (end . 295))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;267&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;((file . &quot;api/user.js&quot;) (start . 304) (end . 307))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;293&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;((file . &quot;api/user.js&quot;) (start . 320) (end . 323))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;305&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;((file . &quot;api/user.js&quot;) (start . 554) (end . 557))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;321&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;((file . &quot;api/user.js&quot;) (start . 575) (end . 578))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;555&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This seems to be close, but I don't understand why &lt;code&gt;start&lt;/code&gt; stays the same for the first 2 iterations of the loop (causing it to miss the &lt;code&gt;start&lt;/code&gt; value in the last iteration). What I'm hoping to do is to define the variables to be used within the loop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using &lt;code&gt;with&lt;/code&gt; instead of the second &lt;code&gt;for&lt;/code&gt;, but that didn't work. I've gotten it to work by using the full code for &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;file&lt;/code&gt; in the various places where they're used, but that produces some quite ugly code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;btw, I just added that &lt;code&gt;let&lt;/code&gt; statement only so I could execute those &lt;code&gt;print&lt;/code&gt; statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help on getting the desired outcome would be greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="3852" LastEditorUserId="3852" LastEditDate="2017-02-18T22:09:02.217" LastActivityDate="2017-02-18T23:06:24.867" Title="Using local variables in cl-loop" Tags="|elisp-macros|local-variables|cl-lib|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30837" PostTypeId="1" CreationDate="2017-02-18T22:27:30.957" Score="14" ViewCount="3576" Body="&lt;p&gt;In org it is possible to set a column width like follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|---+------------------------------|               |---+----------------| &#xA;|   |                              |               |   | &amp;lt;14&amp;gt;           | &#xA;| 1 | one                          |               | 1 | one            | &#xA;| 2 | two                          |     ----\     | 2 | two            | &#xA;| 3 | This is a long chunk of text |     ----/     | 3 | This is a lo=&amp;gt; | &#xA;| 4 | four                         |               | 4 | four           | &#xA;|---+------------------------------|               |---+----------------| &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to obtain this layout instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|---+----------------|&#xA;|   | &amp;lt;14&amp;gt;           |&#xA;| 1 | one            |&#xA;| 2 | two            |&#xA;| 3 | This is a long |&#xA;|   | chunk of text  |&#xA;| 4 | four           |&#xA;|---+----------------|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course I can use &lt;code&gt;M-S-&amp;lt;down&amp;gt;&lt;/code&gt;  and &lt;code&gt;M-&amp;lt;ret&amp;gt;&lt;/code&gt; to insert a new row and wrap the long field.&lt;br&gt;&#xA;However, for many fields, this is inconvenient. Is there any hack or package to speed up this process?&lt;/p&gt;&#xA;" OwnerUserId="3975" LastEditorUserId="14825" LastEditDate="2022-11-05T01:10:24.483" LastActivityDate="2022-11-05T01:10:24.483" Title="Org tables: Wrap all fields in column to a given size" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30838" PostTypeId="2" ParentId="21796" CreationDate="2017-02-18T22:56:16.547" Score="1" Body="&lt;p&gt;You might find that &lt;a href=&quot;https://github.com/thomp/dired-launch&quot; rel=&quot;nofollow noreferrer&quot;&gt;dired-launch&lt;/a&gt; is of some value. I developed it as a launcher specifically for &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;dired-mode&lt;/a&gt; (unlike &lt;code&gt;openwith&lt;/code&gt;... which tries to work in a variety of settings). &lt;code&gt;dired-launch&lt;/code&gt; provides a keybinding (&lt;code&gt;J&lt;/code&gt;) which allows one to launch the default external application corresponding to that file.&lt;/p&gt;&#xA;" OwnerUserId="3995" LastActivityDate="2017-02-18T22:56:16.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30839" PostTypeId="2" ParentId="7148" CreationDate="2017-02-18T23:03:41.903" Score="3" Body="&lt;p&gt;If I may be allowed a plug, take a look at my &quot;m-buffer&quot; library.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(m-buffer-match buffer &quot;foo&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Returns a list of markers to matches to &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5228" LastActivityDate="2017-02-18T23:03:41.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30840" PostTypeId="2" ParentId="30835" CreationDate="2017-02-18T23:06:24.867" Score="2" Body="&lt;p&gt;Thanks to &lt;code&gt;bpalmer&lt;/code&gt; in &lt;code&gt;#emacs&lt;/code&gt; for helping me solve this. The issue was with the &lt;code&gt;and&lt;/code&gt; after &lt;code&gt;for start...&lt;/code&gt;; instead, it needed to be another &lt;code&gt;for&lt;/code&gt; (or &lt;code&gt;as&lt;/code&gt;). I chose to use &lt;code&gt;as&lt;/code&gt; instead of the other &lt;code&gt;for&lt;/code&gt;s since it seems a bit more intuitive, but either will work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (cl-loop for ref across (cdr (assq 'refs data))&#xA;           as start = (1+ (cdr (assq 'start ref)))&#xA;           as file = (expand-file-name (cdr (assq 'file ref)) (tern-project-dir))&#xA;           if (string= buffer-file-name file)&#xA;           if (let ((a 1))&#xA;                (print ref)&#xA;                (print start)&#xA;                (&amp;lt; start (point)))&#xA;           collect start into prev-refs&#xA;           else collect start into next-refs&#xA;           finally return (list file (sort prev-refs '&amp;gt;) (sort next-refs '&amp;lt;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3852" LastActivityDate="2017-02-18T23:06:24.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30841" PostTypeId="2" ParentId="30798" CreationDate="2017-02-18T23:45:49.867" Score="1" Body="&lt;p&gt;In Gnus it's called &quot;splitting&quot; the mail. It's covered in section 6.4.3 of the Gnus manual. (run &lt;code&gt;M-: (info &quot;(gnus)Splitting Mail&quot;)&lt;/code&gt; to jump right to it. Here's an example from the manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nnmail-split-methods&#xA;  '((&quot;mail.junk&quot; &quot;^From:.*Lars Ingebrigtsen&quot;)&#xA;    (&quot;mail.crazy&quot; &quot;^Subject:.*die\\|^Organization:.*flabby&quot;)&#xA;    (&quot;mail.other&quot; &quot;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see that it takes a list of folders to split into, and regexes to match against.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you're using IMAP, however, you want to set the variable &lt;code&gt;nnimap-split-methods&lt;/code&gt; instead. It works the same way, but only applies to IMAP. See section 6.3.3 of the manual for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you might consider setting up filters in the Gmail UI instead, so that email is always sorted correctly even when you're not running Gnus.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-18T23:45:49.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30842" PostTypeId="1" CreationDate="2017-02-19T01:09:53.530" Score="1" ViewCount="342" Body="&lt;p&gt;I'm often making typing mistakes which will kick me out of the current function block (hitting M-n when I meant C-n). In such cases it would be nice to be able to return immediately to the previous cursor position. My understanding (correct me if I'm wrong) is that the mark ring is not ideally suited to this purpose because it requires setting the mark at positions ahead of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I'm asking for a 'trailing mark ring' that stores all cursor positions, say, 2 or 3 moves back...or something like that. &lt;/p&gt;&#xA;" OwnerUserId="14932" LastActivityDate="2017-03-22T00:50:31.343" Title="How to navigate to previous cursor positions without using the mark?" Tags="|navigation|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30843" PostTypeId="1" AcceptedAnswerId="30844" CreationDate="2017-02-19T02:22:04.387" Score="0" ViewCount="1029" Body="&lt;p&gt;using meta + x then package install I tried installing a theme. I am able to apply it and it looks great... problem is if i restart spacemacs the following happens:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Found 1 orphan package(s) to delete...&#xA;--&gt; deleting color-theme-sanityinc-tomorrow... [1/1]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;anyone know how to fix this? I tried googling and changing my settings (specially this setting dotspacemacs-install-packages 'used-only)), but nothing seems to help. &lt;/p&gt;&#xA;" OwnerUserId="14956" LastActivityDate="2017-02-19T03:35:53.557" Title="spacemacs themes auto deleted?" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30844" PostTypeId="2" ParentId="30843" CreationDate="2017-02-19T03:35:53.557" Score="2" Body="&lt;p&gt;Don't install packages with package install. See the FAQ here: &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/blob/master/doc/FAQ.org#why-are-packages-installed-with-package-install-automatically-deleted-by-spacemacs-when-it-boots&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/blob/master/doc/FAQ.org#why-are-packages-installed-with-package-install-automatically-deleted-by-spacemacs-when-it-boots&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, install packages with &lt;code&gt;dotspacemacs-additional-packages&lt;/code&gt;, or create a layer, or set the variable &lt;code&gt;dotspacemacs-install-packages&lt;/code&gt; to &lt;code&gt;used-but-keep-unused&lt;/code&gt; which will prevent Spacemacs from removing the packages you installed manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for themes, just install the &lt;code&gt;themes-megapack&lt;/code&gt; layer to get a bunch of different themes. The page for it is here: &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bthemes/themes-megapack&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bthemes/themes-megapack&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2017-02-19T03:35:53.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30845" PostTypeId="1" AcceptedAnswerId="30846" CreationDate="2017-02-19T04:51:33.817" Score="7" ViewCount="1006" Body="&lt;p&gt;Say I define a buffer-local variable &lt;code&gt;foo&lt;/code&gt;, and its default value is &quot;a&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo &quot;a&quot;)&#xA;(make-variable-buffer-local 'foo)&#xA;(default-value 'foo) ;; =&amp;gt; &quot;a&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Immediately after this I run the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((foo &quot;b&quot;))&#xA;  (with-temp-buffer&#xA;    (message &quot;foo: %s&quot; foo))) ;; =&amp;gt; &quot;b&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result is &quot;b&quot;, which is the value I set in &lt;code&gt;let&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if I use &lt;code&gt;setq&lt;/code&gt; to set the variable, then rerun the exact same code as before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo &quot;c&quot;) ;; =&amp;gt; &quot;c&quot;&#xA;&#xA;(let ((foo &quot;b&quot;))&#xA;  (with-temp-buffer&#xA;    (message &quot;foo: %s&quot; foo))) ;; =&amp;gt; &quot;a&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result is &quot;a&quot;, which is the default value now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question&lt;/strong&gt;: for a temporary buffer, the default value of &lt;code&gt;foo&lt;/code&gt; is not set until I use &lt;code&gt;setq&lt;/code&gt;? And as long as I don't use &lt;code&gt;setq&lt;/code&gt;, I can use &lt;code&gt;let&lt;/code&gt; to change the default value in other buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: as @npostavs said, this is what &lt;code&gt;make-varible-buffer-local&lt;/code&gt; really means. If I use &lt;code&gt;make-variable-buffer-local&lt;/code&gt; myself, I can always use &lt;code&gt;setq&lt;/code&gt; after that. But this becomes really tricky for the &quot;built-in&quot; buffer-local variables like &lt;code&gt;case-fold-search&lt;/code&gt;. if I, as a package author, bind &lt;code&gt;case-fold-search&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in the outer &lt;code&gt;let&lt;/code&gt;, and I want to use the default value (it might or might not be set by the user) in the &lt;code&gt;with-temp-buffer&lt;/code&gt;, I have to use &lt;code&gt;setq&lt;/code&gt; before &lt;code&gt;with-temp-buffer&lt;/code&gt; to make sure the default value is actually being used in case the user doesn't have that &lt;code&gt;setq&lt;/code&gt; in his/her &lt;code&gt;init.el&lt;/code&gt;. For buffer-local variables, it probably means &lt;code&gt;setq&lt;/code&gt; is always safer than &lt;code&gt;let&lt;/code&gt; when we want to set the value. I wonder whether the design or the documentation could be improved.&lt;/p&gt;&#xA;" OwnerUserId="5482" LastEditorUserId="5482" LastEditDate="2017-02-19T06:17:35.283" LastActivityDate="2018-11-03T16:36:51.947" Title="The default value of buffer-local variable not set until first `setq`" Tags="|elisp|variables|buffer-local|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30846" PostTypeId="2" ParentId="30845" CreationDate="2017-02-19T05:17:45.297" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I, as a package author, bind &lt;code&gt;case-fold-search&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; in the outer let, and I want to use the default value (it might or might not be set by the user) in the &lt;code&gt;with-temp-buffer&lt;/code&gt;,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this case I would recommend&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((case-fold-search (progn (make-local-variable 'case-fold-search)&#xA;                               nil)))&#xA;  (with-temp-buffer&#xA;    ...))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The important thing to note here is that &lt;code&gt;make-variable-buffer-local&lt;/code&gt; does not make a variable buffer-local!  It only arranges for it to become buffer-local &lt;strong&gt;after it is set&lt;/strong&gt;.  You might want to use &lt;code&gt;make-local-variable&lt;/code&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(make-variable-buffer-local VARIABLE)&#xA;&#xA;Make VARIABLE become buffer-local whenever it is set.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second thing to note is the interaction of &lt;code&gt;let&lt;/code&gt; with buffer-local variables, from &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Intro-to-Buffer_002dLocal.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;(elisp) Intro to Buffer-Local&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Warning:&lt;/em&gt; When a variable has buffer-local bindings in one or more&#xA;  buffers, &lt;code&gt;let&lt;/code&gt; rebinds the binding that's currently in effect.  For&#xA;  instance, if the current buffer has a buffer-local value, &lt;code&gt;let&lt;/code&gt;&#xA;  temporarily rebinds that.  If no buffer-local bindings are in effect,&#xA;  &lt;code&gt;let&lt;/code&gt; rebinds the default value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So in the first case you &lt;strong&gt;bind the global value&lt;/strong&gt; to &lt;code&gt;&quot;b&quot;&lt;/code&gt; and that shows up in the temp buffer.  In the second case, after you have set the local value in &lt;code&gt;*scratch*&lt;/code&gt; to &lt;code&gt;&quot;c&quot;&lt;/code&gt;, you then &lt;strong&gt;bind the local value&lt;/strong&gt; to &lt;code&gt;&quot;b&quot;&lt;/code&gt;, but other buffers still see the global value of &lt;code&gt;&quot;a&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2017-02-19T06:29:51.897" LastActivityDate="2017-02-19T06:29:51.897" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30847" PostTypeId="1" CreationDate="2017-02-19T05:38:59.257" Score="1" ViewCount="97" Body="&lt;p&gt;I have recently started using &lt;code&gt;spacemacs&lt;/code&gt;. After sifting through their documentation I found that &lt;code&gt;spacemacs&lt;/code&gt; ships with a custom layout for &lt;code&gt;org-mode&lt;/code&gt;. However, I cannot seem to find the layout by following their &lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION#custom-layouts&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me?&lt;/p&gt;&#xA;" OwnerUserId="9837" LastActivityDate="2017-04-20T09:31:35.080" Title="Cannot find @Org Custom Layout in spacemacs" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30849" PostTypeId="1" AcceptedAnswerId="47323" CreationDate="2017-02-19T07:31:22.140" Score="4" ViewCount="672" Body="&lt;p&gt;Question: How to generate inline plot image result in Org-mode babel clojure src block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried some ways:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First way: use &lt;code&gt;:results file :file &quot;clojure-babel-figure-result.png&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC clojure :session :results file :file &quot;clojure-babel-figure-result.png&quot; :dir &quot;data/images&quot;&#xA;(use '(incanter core stats datasets charts io pdf))&#xA;&#xA;(def my-plot (histogram (sample-normal 1000)))&#xA;&#xA;(save my-plot &quot;clojure-babel-figure-result.png&quot;)&#xA;;; (view my-plot)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[file:/home/stardiviner/Org/Wiki/Computer Technology/Programming/Emacs/modes/Org-mode/data/images/clojure-babel-figure-result.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that the generated plot image should be in upper link path. But&#xA;it is save to CIDER working directory&#xA;&lt;code&gt;/home/stardiviner/clojure-babel-figure-result.png&lt;/code&gt;.&#xA;or Emacs buffer working directory &lt;code&gt;default-directory&lt;/code&gt; in &lt;code&gt;/home/stardiviner/Org/Wiki/Emacs/Org-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second way: use Clojure code to specify the image path.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC clojure :session :results file :file &quot;clojure-babel-figure-result.png&quot; :var fname=&quot;clojure-babel-figure-result.png&quot;&#xA;(use '(incanter core stats datasets charts io pdf))&#xA;(import 'java.io.FileOutputStream)&#xA;&#xA;(def output-file (FileOutputStream. fname))&#xA;&#xA;(def my-plot (histogram (sample-normal 1000)))&#xA;&#xA;(save my-plot output-file)&#xA;&#xA;(.close output-file)&#xA;;; (view my-plot)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I found &lt;code&gt;ob-clojure.el&lt;/code&gt; does not use &lt;code&gt;fname&lt;/code&gt; header argument variable when I&#xA;inspect variable &lt;code&gt;output-file&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to let &lt;code&gt;ob-clojure.el&lt;/code&gt; change working directory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some ideas:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;let ob-clojure.el use babel header argument &lt;code&gt;:dir&lt;/code&gt; as working directory.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My environment info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;My Emacs version: &lt;code&gt;26.0.50&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;My Org-mode version: &lt;code&gt;9.0.5&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is &lt;em&gt;the generated file save to current working directory&lt;/em&gt;&#xA;&lt;code&gt;default-directory&lt;/code&gt; , not in Org-mode babel block specified ~:dir~ path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC clojure :session :results file :dir &quot;data/images&quot; :var fname=&quot;clojure-babel-figure-result.png&quot;&#xA;(use '(incanter core stats charts io))&#xA;(def my-plot (function-plot sin -10 10))&#xA;(save my-plot &quot;clojure-babel-figure-result.png&quot;)&#xA;my-plot&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[file:/home/stardiviner/Org/Wiki/Computer Technology/Programming/Emacs/modes/Org-mode/data/images/#object[org.jfree.chart.JFreeChart 0x49b53c9e &quot;org.jfree.chart.JFreeChart@49b53c9e&quot;]]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;BTW, How to make Org-mode babel generate inline image result with relative path instead of absolute path? Relative path is useful for blog publish etc.&lt;/p&gt;&#xA;" OwnerUserId="411" LastEditorUserId="411" LastEditDate="2017-06-06T04:38:36.680" LastActivityDate="2019-01-22T00:47:41.983" Title="How to generate inline plot result for ob-clojure?" Tags="|org-mode|org-babel|clojure|inline-image|babel|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30850" PostTypeId="2" ParentId="30847" CreationDate="2017-02-19T08:09:20.860" Score="1" Body="&lt;p&gt;Finally got it. I had to enable the &lt;code&gt;org&lt;/code&gt; layer in the spacemacs dotfile (&lt;code&gt;.spacemacs&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-configuration-layers&#xA;   '(&#xA;     ;; ----------------------------------------------------------------&#xA;     ;; Example of useful layers you may want to use right away.&#xA;     ;; Uncomment some layer names and press &amp;lt;SPC f e R&amp;gt; (Vim style) or&#xA;     ;; &amp;lt;M-m f e R&amp;gt; (Emacs style) to install them.&#xA;     ;; ----------------------------------------------------------------&#xA;     helm&#xA;     auto-completion&#xA;     ;; better-defaults&#xA;     emacs-lisp&#xA;     ;; git&#xA;     ;; markdown&#xA;     org&#xA;     ;; (shell :variables&#xA;     ;;        shell-default-height 30&#xA;     ;;        shell-default-position 'bottom)&#xA;     spell-checking&#xA;     syntax-checking&#xA;     ;; version-control&#xA;     )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9837" LastActivityDate="2017-02-19T08:09:20.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30852" PostTypeId="1" CreationDate="2017-02-19T10:24:27.603" Score="4" ViewCount="1397" Body="&lt;p&gt;I want to move &lt;code&gt;point&lt;/code&gt; to where the mouse is pointing. This is easy to do interactively: just click and &lt;code&gt;point&lt;/code&gt; will move to where the mouse is pointing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I need to do this inside elisp code. I tried to find a nice way by inspecting the source for mouse-drag-region and by reading the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Mouse-Position.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Manual&quot;&gt;manual on Mouse Position&lt;/a&gt; but did not manage :-( &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone has an elegant solution?&lt;/p&gt;&#xA;" OwnerUserId="1992" LastActivityDate="2021-07-29T04:10:52.160" Title="How can I move point to where the mouse is pointing now" Tags="|mouse|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30853" PostTypeId="2" ParentId="30821" CreationDate="2017-02-19T10:45:49.970" Score="1" Body="&lt;p&gt;The earlier answers give some good help. Here are a few more hints that you may find helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(generate-new-buffer &quot;foo&quot;)&lt;/code&gt; will create a new buffer that is not associated with any file. This new buffer if not made current buffer so, in order to write into it, you want to do &lt;code&gt;(switch-to-buffer (generate-new-buffer &quot;foo&quot;))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(kill-new &quot;YYY&quot;)&lt;/code&gt; will not only push &quot;YYY&quot; on top of the kill ring, it will copy it to the clipboard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(write-file &quot;YYY&quot;)&lt;/code&gt; will save the current buffer in file YYY where YYY might be a relative or an absolute path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(kill-buffer)&lt;/code&gt; will delete the current buffer.&lt;/p&gt;&#xA;" OwnerUserId="1992" LastActivityDate="2017-02-19T10:45:49.970" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30854" PostTypeId="2" ParentId="24630" CreationDate="2017-02-19T12:27:13.643" Score="-1" Body="&lt;p&gt;You can try doing something like the following to highlight the currently selected window. Beware that this doesn't work if the buffers in multiple windows are the same. This dims all other windows except the selected one. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar dim-window-face&#xA;  '((t  (:background &quot;grey40&quot;)))&#xA;  &quot;Face for a dimmed window in the current frame.&quot;)&#xA;&#xA;(defvar current-window-face&#xA;  '((t  (:background &quot;black&quot;)))&#xA;  &quot;Face for a dimmed window in the current frame.&quot;)&#xA;&#xA;(defvar window-&amp;gt;overlay (make-hash-table)&#xA;  &quot;A hash table of window to dimmed overlay.&quot;)&#xA;&#xA;(defun dim-windows ()&#xA;  &quot;Dim all windows except the `selected-window' in current frame.&quot;&#xA;  (interactive)&#xA;  (walk-windows (lambda (w)&#xA;                  ;; Delete existing overlay on window W&#xA;                  (when-let ((ol (gethash w window-&amp;gt;overlay)))&#xA;                    (delete-overlay ol))&#xA;                  (let ((ol (make-overlay (window-start w)&#xA;                                          (window-end w)&#xA;                                          (window-buffer w))))&#xA;                    (overlay-put ol 'face (if (eql (selected-window) w)&#xA;                                              current-window-face&#xA;                                            dim-window-face))&#xA;                    (puthash w ol window-&amp;gt;overlay)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14967" LastActivityDate="2017-02-19T12:27:13.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30855" PostTypeId="1" AcceptedAnswerId="30868" CreationDate="2017-02-19T12:38:51.540" Score="8" ViewCount="2050" Body="&lt;p&gt;I hope it's a simple problem..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to search for the regexp 'thisWord' only in the marked files of a dired buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually I used in the dired buffer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x grep&lt;/code&gt; and then in the mini-buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;grep -r -nH 'thisWord' .&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But this searches all the files of the directory not just the marked ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, the dired mode of emacs has the possibility to restrict the search on the marked files with just using &lt;code&gt;A&lt;/code&gt;  (&lt;code&gt;dired-do-find-regexp&lt;/code&gt;). But the results are listed in the unusual &quot;xref format&quot;, I need the &quot;grep format&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;./file-a.org:16253: ..thisWord...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I there a simple way to get the search results of the marked files in the &quot;grep format&quot;?&lt;/p&gt;&#xA;" OwnerUserId="11498" LastActivityDate="2017-02-19T18:43:33.337" Title="How to grep marked files in the dired mode of emacs?" Tags="|dired|regular-expressions|mark|grep|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30856" PostTypeId="2" ParentId="30852" CreationDate="2017-02-19T14:11:10.803" Score="2" Body="&lt;p&gt;You can do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun jump-to-cursor ()&#xA;  &quot;Jump to the position under the mouse cursor if possible.&quot;&#xA;  (interactive)&#xA;  (when-let ((cursor-pos (mouse-position))&#xA;         (line (cddr cursor-pos))&#xA;         (col  (cadr cursor-pos))&#xA;         (p (save-excursion&#xA;          (goto-char (window-start))&#xA;          (forward-line line)&#xA;          (if (&amp;gt; (- (line-end-position) (line-beginning-position)) col)&#xA;              (progn  (move-to-column col) (1- (point)))&#xA;            nil))))&#xA;    (goto-char p)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That function tries to compute the position under the cursor and then go to it if it can. &lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-02-19T14:11:10.803" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30857" PostTypeId="1" AcceptedAnswerId="31169" CreationDate="2017-02-19T15:39:37.710" Score="12" ViewCount="1883" Body="&lt;p&gt;I am trying to run clojure code from my org file in order to do some literate programming. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is not working:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I execute the source code block I get &lt;code&gt;No output produced&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Sample src code block&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src clojure&#xA;(+ 2 2)&#xA;#+end_src clojure&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is working:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;cider-jack-in&lt;/code&gt; is working and I am able to execute code in the nREPL&lt;/li&gt;&#xA;&lt;li&gt;I am able to execute code from a &lt;code&gt;.clj&lt;/code&gt; file&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Details&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 25.1 using Spacemacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org-Mode 9.0.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org babel configuration&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/user-config ()&#xA;  (require 'ob)&#xA;  (require 'ob-clojure)&#xA;  (require 'paredit)&#xA;  (require 'org-babel-clojure)&#xA;  (setq org-babel-clojure-backend 'cider)&#xA;  (require 'cider)&#xA;  (org-babel-do-load-languages&#xA;   'org-babel-load-languages&#xA;   '((clojure . t)))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please let me know if you need any other information&lt;/p&gt;&#xA;" OwnerUserId="10027" LastEditorUserId="105" LastEditDate="2017-02-19T18:20:13.387" LastActivityDate="2017-03-09T20:15:44.580" Title="Clojure code evaluation in org-mode produces no output" Tags="|org-mode|org-babel|clojure|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30858" PostTypeId="2" ParentId="30387" CreationDate="2017-02-19T15:51:41.060" Score="1" Body="&lt;p&gt;I use &lt;strong&gt;intero&lt;/strong&gt; for programming Haskell in Emacs. It has superior stack support. Check it out at &lt;a href=&quot;https://commercialhaskell.github.io/intero/&quot; rel=&quot;nofollow noreferrer&quot;&gt;its homepage&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7052" LastActivityDate="2017-02-19T15:51:41.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30859" PostTypeId="2" ParentId="30857" CreationDate="2017-02-19T16:57:40.643" Score="0" Body="&lt;p&gt;You need to have header arguments in the block telling org-babel what you want to include in the results produced - result of evaluation or output to stdout or both. In your case, there is no output that the evaluation of &lt;code&gt;(+ 1 1)&lt;/code&gt; produces. Try &lt;code&gt;(println (+ 1 1))&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: Lazy Sequences in Clojure&#xA;#+begin_src clojure&#xA; (def a-lazy-sequence (cons 1 (lazy-seq (cons (+1 2) ()))))&#xA;#+end_src&#xA;&#xA;#+name: List comprehensions in Clojure&#xA;#+begin_src clojure :results output&#xA; (println (str (for [x (range 3)&#xA;                     y #{:a :b :c}]&#xA;                 [x y])))&#xA;&#xA;#+end_src&#xA;&#xA;#+RESULTS: List comprehensions in Clojure&#xA; : (c l o j u r e . l a n g . L a z y S e q @ e a a 0 1 c e 7)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14967" LastActivityDate="2017-02-19T16:57:40.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30860" PostTypeId="1" CreationDate="2017-02-19T17:00:29.153" Score="1" ViewCount="1005" Body="&lt;p&gt;I have been writing a document with a not monospaced font, because it is not code but only text. This is a document written in reStructuredText, with the file ending &lt;code&gt;.rst&lt;/code&gt; and when it is opened in emacs, it enters the correct mode and shows &lt;code&gt;reST&lt;/code&gt; as mode in the bar at the bottom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Earlier, I was looking how to always display current row and column of the cursor, in order to know, how long the underlining characters of a heading in reST have to be, when using a not monospaced font. Everything worked find, but then I realized, that there is an error in the document. Some heading was not recognized properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is, that emacs shows a wrong column count of the cursor when there is a &lt;code&gt;ü&lt;/code&gt; in that line. Since I entered as many underlining characters as emacs told me the number of the column was when being at the last position in the heading text line, I entered one underlining characters too many.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want emacs to only count &lt;code&gt;äöü&lt;/code&gt; and &lt;code&gt;ÄÖÜ&lt;/code&gt; and potentially &lt;code&gt;ß&lt;/code&gt; as one column, which it also looks like, so that I can have the correct number of underlining characters for a heading and do not need to check for German umlaute in a heading before entering the correct number of underlining characters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specific example in my case is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Schlussfolgerungen bezüglich Code-Editoren&#xA;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(note that with not monospaced font, this will not be as nicely aligned)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When I place the cursor at the end of the text line, the column count shows: &lt;code&gt;43&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;When I place the cursor at the end of the underlining characters line, the column count shows: &lt;code&gt;42&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already tried adding a preferred encoding to my &lt;code&gt;~/.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prefer-coding-system 'utf-8)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and a coding line in the first row of my file &lt;code&gt;.. # -*- coding: utf-8 -*-&lt;/code&gt;. Note the two dots &lt;code&gt;..&lt;/code&gt;. They are necessary, because the file will be automatically processed and I do not want any &quot;coding: bla&quot; to show up in the end result, so maybe that this line does not help at all.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit 1&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The output of &lt;code&gt;C-u C-x =&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             position: 106656 of 143714 (74%), column: 22&#xA;            character: ü (displayed as ü) (codepoint 252, #o374, #xfc)&#xA;    preferred charset: chinese-gbk (GBK Chinese simplified.)&#xA;code point in charset: 0xA8B9&#xA;               script: latin&#xA;               syntax: w    which means: word&#xA;             category: .:Base, L:Left-to-right (strong), c:Chinese, j:Japanese, l:Latin&#xA;             to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;          buffer code: #xC3 #xBC&#xA;            file code: #xC3 #xBC (encoded by coding system utf-8-unix)&#xA;              display: by this font (glyph code)&#xA;    xft:-DAMA-Ubuntu-light-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#xD7)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: LATIN SMALL LETTER U WITH DIAERESIS&#xA;  old-name: LATIN SMALL LETTER U DIAERESIS&#xA;  general-category: Ll (Letter, Lowercase)&#xA;  decomposition: (117 776) ('u' '̈')&#xA;&#xA;There are text properties here:&#xA;  face                 (rst-level-3)&#xA;  font-lock-multiline  t&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It says &lt;code&gt;preferred charset: chinese-gbk (GBK Chinese simplified.)&lt;/code&gt; there, that might be because of one environment variable I had to set, to be able to write Chinese characters in emacs using &lt;code&gt;fcitx&lt;/code&gt;. I start emacs with the following command inside a launcher of XFCE desktop environment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/bin/bash -c &quot;XMODIFIERS=@im=fcitx LC_CTYPE=\&quot;zh_CN.UTF-8\&quot; emacs %F&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I only need this for writing Chinese in emacs, not because of any other preferences, so if there is an alternative for this, I am open to hearing it. So far this is the only workaround I found. That this is the cause is only a guess though.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit 2&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;When I start emacs with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The count is &lt;code&gt;42&lt;/code&gt; for both lines. So I guess it is my config then? Here is my &lt;code&gt;~/.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; deactivate version control integration, so that emacs starts up faster&#xA;(setq vc-handled-backends ())&#xA;;(setq-default vc-handled-backends nil)&#xA;;(eval-after-load &quot;vc&quot; '(remove-hook 'find-file-hooks 'vc-find-file-hook))&#xA;&#xA;;; Installation of el-get&#xA;(add-to-list 'load-path &quot;~/.emacs.d/el-get/el-get&quot;)&#xA;    (unless (require 'el-get nil 'noerror)&#xA;        (with-current-buffer&#xA;            (url-retrieve-synchronously &quot;https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el&quot;)&#xA;            (goto-char (point-max))&#xA;            (eval-print-last-sexp)))&#xA;(add-to-list 'el-get-recipe-path &quot;~/.emacs.d/el-get-user/recipes&quot;)&#xA;(el-get 'sync)&#xA;&#xA;;; other stuff&#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA;  '(ansi-color-names-vector&#xA;     [&quot;#212526&quot; &quot;#ff4b4b&quot; &quot;#b4fa70&quot; &quot;#fce94f&quot; &quot;#729fcf&quot; &quot;#ad7fa8&quot; &quot;#8cc4ff&quot; &quot;#eeeeec&quot;])&#xA; '(column-number-mode t)&#xA; '(custom-enabled-themes (quote (suscolors)))&#xA;  '(custom-safe-themes&#xA;     (quote&#xA;       (&quot;b9b1a8d2ec1d5c17700e1a09256f33c2520b26f49980ed9e217e444c381279a9&quot; default)))&#xA; '(lisp-body-indent 2)&#xA; '(lisp-indent-offset 2)&#xA; '(neo-show-hidden-files t)&#xA; '(neo-theme (quote ascii))&#xA;  '(org-agenda-files&#xA;     (quote&#xA;       (&quot;~/development/datax/master-thesis/master-thesis/paper/note.org&quot;)))&#xA; '(python-shell-buffer-name &quot;Python Console&quot;)&#xA; '(send-mail-function (quote smtpmail-send-it))&#xA; '(show-paren-mode t)&#xA; '(size-indication-mode t)&#xA; '(smtpmail-smtp-server &quot;smtp.gmail.com&quot;)&#xA; '(smtpmail-smtp-service 25)&#xA; '(tool-bar-mode nil)&#xA; '(word-wrap t))&#xA;&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(cursor ((t (:background &quot;gold&quot; :foreground &quot;#151718&quot;))))&#xA; '(mode-line ((t (:background &quot;black&quot; :foreground &quot;#4499FF&quot;))))&#xA; '(neo-dir-link-face ((t (:foreground &quot;deep sky blue&quot; :slant normal :weight bold :height 120 :family &quot;Fantasque Sans Mono&quot;))))&#xA; '(neo-file-link-face ((t (:foreground &quot;White&quot; :weight normal :height 120 :family &quot;Fantasque Sans Mono&quot;))))&#xA; '(neo-root-dir-face ((t (:foreground &quot;lightblue&quot; :weight bold))))&#xA; '(show-paren-match ((t (:background &quot;#000000&quot; :foreground &quot;spring green&quot; :underline nil :weight ultra-bold))))&#xA; '(show-paren-mismatch ((t (:foreground &quot;red&quot; :weight bold)))))&#xA;&#xA;;; MELPA&#xA;(require 'package) ;; You might already have this line&#xA;(add-to-list 'package-archives '(&quot;melpa&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(add-to-list 'package-archives '(&quot;melpa-stable&quot; . &quot;https://melpa.org/packages/&quot;))&#xA;(when (&amp;lt; emacs-major-version 24)&#xA;  ;; For important compatibility libraries like cl-lib&#xA;  (add-to-list 'package-archives '(&quot;gnu&quot; . &quot;http://elpa.gnu.org/packages/&quot;)))&#xA;(package-initialize) ;; You might already have this line&#xA;&#xA;&#xA;&#xA;; SAVE SESSIONS - save sessions to restore buffers on next startup&#xA;(desktop-save-mode 1)&#xA;;; remember cursor position in file&#xA;(require 'saveplace)&#xA;(setq-default save-place t)&#xA;&#xA;; load theme on startup&#xA;(add-hook 'emacs-startup-hook (load-theme 'suscolors))&#xA;(set-face-attribute 'region nil :foreground &quot;#FF00FF&quot; :background &quot;#000&quot;)&#xA;&#xA;;; ===== FONT SETTINGS =====&#xA;(set-default-font &quot;Inconsolata LGC-10:weight=normal:antialias=1&quot;)&#xA;&#xA;;; functions for having buffer specific fonts&#xA;&#xA;;; Use variable width font faces in current buffer&#xA;(defun my-buffer-face-mode-variable ()&#xA;  &quot;Set font to a variable width (proportional) fonts in current buffer&quot;&#xA;  (interactive)&#xA;  (setq buffer-face-mode-face '(:family &quot;Ubuntu Light&quot; :height 120 :weight light)) ;;light thin regular book&#xA;  (buffer-face-mode))&#xA;&#xA;;; Use monospaced font faces in current buffer&#xA;(defun my-buffer-face-mode-fixed ()&#xA;  &quot;Sets a fixed width (monospace) font in current buffer&quot;&#xA;  (interactive)&#xA;  (setq buffer-face-mode-face '(:family &quot;Inconsolata LGC&quot; :height 100 :weight normal))&#xA;  (buffer-face-mode))&#xA;&#xA;;; Set default font faces for Info and ERC modes&#xA;(add-hook 'rst-mode-hook 'my-buffer-face-mode-variable)&#xA;&#xA;&#xA;;; ===== turn on highlighting current line =====&#xA;(global-hl-line-mode 1)&#xA;(set-face-background 'hl-line &quot;#303030&quot;)&#xA;(set-face-foreground 'highlight nil) ;; To keep syntax highlighting in the current line&#xA;&#xA;;; highlight matching parenthesis&#xA;(show-paren-mode 1)&#xA;(setq-default show-paren-delay 0) ;; 0 delay&#xA;(setq-default show-paren-style 'parenthesis) ;;'parenthesis is another possible value, only highlighting the brackets&#xA;&#xA;;; TAB WIDTH&#xA;(setq-default tab-width 4)&#xA;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-stop-list (number-sequence 4 200 4))&#xA;&#xA;(defvaralias 'c-indent-level 'tab-width)&#xA;(defvaralias 'c-basic-offset 'tab-width)&#xA;(defvaralias 'sgml-indent-level 'tab-width)&#xA;(defvaralias 'sgml-basic-offset 'tab-width)&#xA;&#xA;(add-hook 'racket-mode-hook&#xA;          (function (lambda ()&#xA;                      (setq indent-tabs-mode nil&#xA;                            tab-width 2))))&#xA;(add-hook 'pythonracket-mode-hook&#xA;          (function (lambda ()&#xA;                      (setq indent-tabs-mode nil&#xA;                            tab-width 4)&#xA;                      (setq-default python-indent 4))))&#xA;;; word wrap&#xA;;; for reStructuredText mode&#xA;(add-hook 'rst-mode-hook&#xA;  (function (lambda ()&#xA;          (setq word-wrap t))))&#xA;(add-hook 'org-mode-hook&#xA;  (function (lambda ()&#xA;          (global-set-key (kbd &quot;C-c t&quot;) 'toggle-truncate-lines))))&#xA;&#xA;;; make return key also do indent, globally&#xA;(electric-indent-mode 1)&#xA;&#xA;;; SCROLL SPEED&#xA;(setq-default mouse-wheel-scroll-amount '(5 ((shift) . 5))) ;; two lines at a time    &#xA;(setq-default mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling&#xA;(setq-default mouse-wheel-follow-mouse 't) ;; scroll window under mouse    &#xA;(setq-default scroll-step 5) ;; keyboard scroll one line at a time&#xA;(scroll-bar-mode -1)&#xA;&#xA;;; case-insensitive minibuffer completion&#xA;(setq read-buffer-completion-ignore-case t)&#xA;(setq read-file-name-completion-ignore-case t)&#xA;&#xA;;; MULTIPLE CURSORS&#xA;(require 'multiple-cursors)&#xA;&#xA;;; LINE NUMBERS&#xA;(require 'linum)&#xA;(add-hook 'prog-mode-hook 'linum-on)&#xA;;; set fontsize&#xA;(eval-after-load &quot;linum&quot;&#xA;  '(set-face-attribute 'linum nil :height 80))&#xA;&#xA;;; DELETE SELECTED TEXT WHEN TYPING&#xA;(delete-selection-mode 1)&#xA;&#xA;&#xA;;; DEFINE A FUNCTION FOR DUPLICATING A LINE&#xA;(defun duplicate-line()&#xA;  (interactive)&#xA;  (move-beginning-of-line 1)&#xA;  (kill-line)&#xA;  (yank)&#xA;  (newline)&#xA;  (yank))&#xA;&#xA;;; INDENT / UNINDENT REGION&#xA;(defun my-indent-region (N)&#xA;  (interactive &quot;p&quot;)&#xA;  (if (use-region-p)&#xA;      (progn (indent-rigidly (region-beginning) (region-end) (* N 4))&#xA;         (setq deactivate-mark nil))&#xA;    (self-insert-command N)))&#xA;&#xA;(defun my-unindent-region (N)&#xA;  (interactive &quot;p&quot;)&#xA;  (if (use-region-p)&#xA;      (progn (indent-rigidly (region-beginning) (region-end) (* N -4))&#xA;         (setq deactivate-mark nil))&#xA;    (self-insert-command N)))&#xA;&#xA;;; This function toggles the case of the selected text.&#xA;(defun toggle-case ()&#xA;  (interactive)&#xA;  (when (region-active-p)&#xA;    (let&#xA;      ((i 0)&#xA;       (return-string &quot;&quot;)&#xA;       (input (buffer-substring-no-properties (region-beginning) (region-end))))&#xA;      (while (&amp;lt; i (- (region-end) (region-beginning)))&#xA;    (let&#xA;      ((current-char (substring input i (+ i 1))))&#xA;      (if&#xA;        (string= (substring input i (+ i 1)) (downcase (substring input i (+ i 1))))&#xA;        (setq return-string&#xA;          (concat return-string (upcase (substring input i (+ i 1)))))&#xA;        (setq return-string&#xA;          (concat return-string (downcase (substring input i (+ i 1)))))))&#xA;    (setq i (+ i 1)))&#xA;&#xA;    (delete-region (region-beginning) (region-end))&#xA;    (insert return-string))))&#xA;&#xA;;; set options for completion&#xA;(setq hippie-expand-try-functions-list&#xA;  '(try-expand-dabbrev&#xA;    try-expand-dabbrev-all-buffers&#xA;    try-expand-dabbrev-from-kill&#xA;    ;; try-complete-file-name-partially&#xA;    ;; try-complete-file-name&#xA;    try-expand-all-abbrevs&#xA;    ;; try-expand-list&#xA;    ;; try-expand-line&#xA;    try-complete-lisp-symbol-partially&#xA;    ;;try-complete-lisp-symbol)&#xA;     ))&#xA;&#xA;(line-number-mode)&#xA;(column-number-mode)&#xA;&#xA;;; PDF VIEWING&#xA;(setq-default doc-view-pdfdraw-program &quot;mudraw&quot;)&#xA;(setq-default doc-view-continuous t)&#xA;&#xA;;; SPELLING&#xA;(require 'ispell)&#xA;(add-to-list 'ispell-local-dictionary-alist '(&quot;deutsch-hunspell&quot;&#xA;                                          &quot;[[:alpha:]]&quot;&#xA;                                          &quot;[^[:alpha:]]&quot;&#xA;                                          &quot;[']&quot;&#xA;                                          t&#xA;                                          (&quot;-d&quot; &quot;de_DE&quot;); Dictionary file name&#xA;                                          nil&#xA;                                          iso-8859-1))&#xA;&#xA;(add-to-list 'ispell-local-dictionary-alist '(&quot;english-hunspell&quot;&#xA;                                          &quot;[[:alpha:]]&quot;&#xA;                                          &quot;[^[:alpha:]]&quot;&#xA;                                          &quot;[']&quot;&#xA;                                          t&#xA;                                          (&quot;-d&quot; &quot;en_US&quot;)&#xA;                                          nil&#xA;                                          iso-8859-1))&#xA;&#xA;(setq ispell-program-name &quot;hunspell&quot;          ; Use hunspell to correct mistakes&#xA;      ispell-dictionary   &quot;deutsch-hunspell&quot;) ; Default dictionary to use&#xA;&#xA;(defun switch-dictionary-de-en ()&#xA;  &quot;Switch german and english dictionaries.&quot;&#xA;  (interactive)&#xA;  (let* ((dict ispell-current-dictionary)&#xA;     (new (if (string= dict &quot;deutsch-hunspell&quot;) &quot;english-hunspell&quot;&#xA;               &quot;deutsch-hunspell&quot;)))&#xA;    (ispell-change-dictionary new)&#xA;    (message &quot;Switched dictionary from %s to %s&quot; dict new)))&#xA;&#xA;;; PREFERRED ENCODING&#xA;(prefer-coding-system 'utf-8)&#xA;&#xA;&#xA;;; KEY DEFINITIONS&#xA;(dolist (key '(&quot;\C-g&quot;))&#xA;  (global-unset-key key))&#xA;&#xA;&#xA;&#xA;(define-key global-map (kbd &quot;RET&quot;) 'newline-and-indent)&#xA;(define-key global-map (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) 'newline)&#xA;(global-set-key (kbd &quot;&amp;lt;C-mouse-5&amp;gt;&quot;) (lambda () (interactive) (text-scale-decrease 1)))&#xA;(global-set-key (kbd &quot;&amp;lt;C-mouse-4&amp;gt;&quot;) (lambda () (interactive) (text-scale-increase 1)))&#xA;(global-set-key (kbd &quot;C-S-c C-S-c&quot;) 'mc/edit-lines)&#xA;(global-set-key (kbd &quot;C-n&quot;) 'set-mark-command)&#xA;(global-set-key (kbd &quot;C-d&quot;) 'duplicate-line)&#xA;(global-set-key (kbd &quot;C-&amp;gt;&quot;) 'my-indent-region)&#xA;(global-set-key (kbd &quot;C-&amp;lt;&quot;) 'my-unindent-region)&#xA;(global-set-key (kbd &quot;&amp;lt;C-tab&amp;gt;&quot;) 'hippie-expand)&#xA;(global-set-key (kbd &quot;&amp;lt;f8&amp;gt;&quot;) 'neotree-toggle)&#xA;(global-set-key (kbd &quot;C-~&quot;) 'toggle-case)&#xA;(global-set-key (kbd &quot;C-d&quot;) 'kill-whole-line)&#xA;(global-set-key (kbd &quot;M-&amp;lt;left&amp;gt;&quot;) 'backward-sexp)&#xA;(global-set-key (kbd &quot;M-&amp;lt;right&amp;gt;&quot;) 'forward-sexp)&#xA;;; moving between windows&#xA;(global-set-key (kbd &quot;s-&amp;lt;left&amp;gt;&quot;) 'windmove-left)&#xA;(global-set-key (kbd &quot;s-&amp;lt;right&amp;gt;&quot;) 'windmove-right)&#xA;(global-set-key (kbd &quot;s-&amp;lt;up&amp;gt;&quot;) 'windmove-up)&#xA;(global-set-key (kbd &quot;s-&amp;lt;down&amp;gt;&quot;) 'windmove-down)&#xA;;; rebinding combination for zap-to-char to the installed zop-to-char&#xA;(global-set-key [remap zap-to-char] 'zop-up-to-char)&#xA;(global-set-key (kbd &quot;C-g l&quot;) 'goto-last-change)&#xA;;; spelling change dictionary&#xA;(global-set-key (kbd &quot;C-c d&quot;) 'switch-dictionary-de-en)&#xA;(global-set-key (kbd &quot;C-c S-h&quot;) 'highlight-regexp)&#xA;(global-set-key (kbd &quot;C-c h&quot;) 'highlight-phrase)&#xA;(global-set-key (kbd &quot;C-c u&quot;) 'unhighlight-regexp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is probably a bit much. There are comments at least describing what the purpose of things is. I am not an elisp expert, so it is rather a collection of a lot of copied stuff from here or there as fixes for getting emacs customized.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit 3&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The environment variables do not seem to be the cause. I just tried running:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XMODIFIERS=@im=fcitx LC_CTYPE=\&quot;zh_CN.UTF-8\&quot; emacs -Q &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And that did not show the described issue of wrong count of columns. So I guess it really is something in my &lt;code&gt;~/.emacs&lt;/code&gt; file, except if the &lt;code&gt;-Q&lt;/code&gt; option somehow makes emacs ignore these environment variables. The &lt;code&gt;C-u C-x =&lt;/code&gt; on &lt;code&gt;ü&lt;/code&gt; in this case results in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         position: 214 of 276 (77%), column: 22&#xA;        character: ü (displayed as ü) (codepoint 252, #o374, #xfc)&#xA;    preferred charset: unicode-bmp (Unicode Basic Multilingual Plane (U+0000..U+FFFF))&#xA;code point in charset: 0xFC&#xA;           script: latin&#xA;           syntax: w    which means: word&#xA;         category: .:Base, L:Left-to-right (strong), c:Chinese, j:Japanese, l:Latin&#xA;         to input: type &quot;C-x 8 RET HEX-CODEPOINT&quot; or &quot;C-x 8 RET NAME&quot;&#xA;      buffer code: #xC3 #xBC&#xA;        file code: #xC3 #xBC (encoded by coding system utf-8-unix)&#xA;          display: by this font (glyph code)&#xA;    xft:-PfEd-DejaVu Sans Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 (#xBE)&#xA;&#xA;Character code properties: customize what to show&#xA;  name: LATIN SMALL LETTER U WITH DIAERESIS&#xA;  old-name: LATIN SMALL LETTER U DIAERESIS&#xA;  general-category: Ll (Letter, Lowercase)&#xA;  decomposition: (117 776) ('u' '̈')&#xA;&#xA;There are text properties here:&#xA;  fontified            t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which shows a more appropriate preferred encoding. That might be the difference.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit 4&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Apparently the counting issue only appears with lower case &lt;code&gt;ü&lt;/code&gt;, not with the other Umlaute.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit 5&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As suggested in one of the answers, I tried running emacs with the following command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XMODIFIERS=@im=fcitx LC_CTYPE=&quot;zh_CN.UTF-8&quot; emacs -q&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running it like this, the issue persists. I read in the &lt;code&gt;--help&lt;/code&gt; of emacs, that this tells emacsnot to load  the &lt;code&gt;~/.emacs&lt;/code&gt; and &lt;code&gt;default.el&lt;/code&gt; file. I am using a &lt;code&gt;~/.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit 6&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I regenerated locales as described in &lt;a href=&quot;https://askubuntu.com/a/359932&quot;&gt;this post&lt;/a&gt; and set the locale to &lt;code&gt;en_US.utf-8&lt;/code&gt; using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export LC_ALL=&quot;en_US.utf-8&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that I closed the terminal in which I did that. Then when starting emacs using either &lt;code&gt;-q&lt;/code&gt; or &lt;code&gt;-Q&lt;/code&gt;, the issue is gone. So I went about trying to comment out more and more of my &lt;code&gt;.emacs&lt;/code&gt; file and starting emacs again by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/bin/bash -c &quot;XMODIFIERS=@im=fcitx LC_CTYPE=\&quot;zh_CN.UTF-8\&quot; emacs&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, even when the &lt;em&gt;complete&lt;/em&gt; &lt;code&gt;.emacs&lt;/code&gt; file is commented out, the issue persists. So I went ahead and started emacs without any parameters:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the issue is gone. So a bad premonition came up in my head: &quot;Great, do I now have to choose between being able to write Chinese and having the correct column count?&quot; So I tried again a slightly different start, still with everything commented out in the &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XMODIFIERS=@im=fcitx emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The issue is gone. But I cannot use my input method fcitx anymore :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess I'll simply have to remember this when I want to write some Chinese or create a second launcher for that purpose.&lt;/p&gt;&#xA;" OwnerUserId="10090" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2017-02-21T09:02:11.137" Title="emacs counts German umlaut as two columns" Tags="|character-encoding|characters|column|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30861" PostTypeId="2" ParentId="30855" CreationDate="2017-02-19T17:34:27.500" Score="4" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-grep-marked-files ()&#xA;&quot;`i` case insensitive; `n` print line number;&#xA;`I` ignore binary files; `E` extended regular expressions.&quot;&#xA;(interactive)&#xA;  (let* ((files (dired-get-marked-files))&#xA;         (search-term (read-string &quot;regex:  &quot;))&#xA;         (grep-command&#xA;           (concat&#xA;             grep-program&#xA;             &quot; &quot;&#xA;             &quot;-inIE --color=always -C2&quot;&#xA;             &quot; &quot;&#xA;             search-term&#xA;             &quot; &quot;&#xA;             (mapconcat 'identity files &quot; &quot;))))&#xA;    (when (and files search-term grep-command)&#xA;      (compilation-start grep-command 'grep-mode (lambda (mode) &quot;*grep*&quot;) nil))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-02-19T17:41:33.063" LastActivityDate="2017-02-19T17:41:33.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30862" PostTypeId="5" CreationDate="2017-02-19T18:03:27.193" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-19T18:03:27.193" LastActivityDate="2017-02-19T18:03:27.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30863" PostTypeId="4" CreationDate="2017-02-19T18:03:27.193" Score="0" Body="A process is a running instance of a program. Use this tag for how Emacs interacts with programs that it runs (compilers, viewers, network backends, etc.)" OwnerUserId="7045" LastEditorUserId="25" LastEditDate="2017-02-22T17:22:19.283" LastActivityDate="2017-02-22T17:22:19.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30864" PostTypeId="1" AcceptedAnswerId="30865" CreationDate="2017-02-19T18:06:01.350" Score="2" ViewCount="83" Body="&lt;p&gt;ibuffer uses &lt;kbd&gt;/&lt;/kbd&gt; as a prefix key for filter commands, like &lt;em&gt;ibuffer-filter-by-name&lt;/em&gt; (&lt;kbd&gt;/&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an evil user, I wanted to use a different prefix, since evil uses &lt;kbd&gt;/&lt;/kbd&gt; for searching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;kbd&gt;space&lt;/kbd&gt; as a leader-key, so I decided to put the filter commands behind &lt;kbd&gt;space&lt;/kbd&gt;&lt;kbd&gt;/&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ibuffer &lt;kbd&gt;/&lt;/kbd&gt; prefix is an anonymous keymap, so I had to bind my new key to the result of a &lt;em&gt;lookup-key&lt;/em&gt; call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(bind-map-for-mode-inherit ivan/ibuffer-leader-map ivan/leader-map&#xA;  :major-modes (ibuffer-mode)&#xA;  :bindings&#xA;  (&quot;/&quot; (lookup-key ibuffer-mode-map &quot;/&quot;)))  ; &amp;lt;= here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works, but is there a cleaner way to do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I say it's an anonymous keymap because I wasn't able to find any variable bound to it. Running &lt;code&gt;(lookup-key ibuffer-mode-map &quot;/&quot;)&lt;/code&gt; just prints out the keymap body:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(keymap&#xA; (92 . ibuffer-clear-filter-groups)&#xA; ...&#xA; (109 . ibuffer-filter-by-used-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="105" LastEditDate="2017-02-19T18:19:00.657" LastActivityDate="2017-02-19T18:19:00.657" Title="Relocating an anonymous prefix keymap" Tags="|key-bindings|keymap|ibuffer|prefix-keys|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30865" PostTypeId="2" ParentId="30864" CreationDate="2017-02-19T18:18:31.527" Score="2" Body="&lt;p&gt;It looks like the answer is yes, you are right.  And there is no cleaner way to deal with it - but see below, for one suggestion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd suggest filing an enhancement request that Emacs add a variable for this keymap: &lt;code&gt;M-x report-emacs-bug&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course define your own map variable for this, basing its value on the current &lt;code&gt;ibuffer.el&lt;/code&gt; code.  But that won't automatically pick up future changes to the Ibuffer code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, I think it is a good idea for prefix keys to have associated keymap variables.  That makes it easy for users to, e.g., move such a map to a different prefix key.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-19T18:18:31.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30866" PostTypeId="2" ParentId="30855" CreationDate="2017-02-19T18:26:37.850" Score="6" Body="&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;noreferrer&quot;&gt;Dired+&lt;/a&gt; (&lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/a&gt;) then you can use command &lt;strong&gt;&lt;code&gt;dired-do-grep&lt;/code&gt;&lt;/strong&gt; (bound by default to &lt;code&gt;M-g&lt;/code&gt; in Dired mode) to do what you request.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;diredp-do-grep&lt;/code&gt;&lt;/strong&gt; is an interactive compiled Lisp function in &lt;code&gt;dired+.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(diredp-do-grep COMMAND-ARGS)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Run &lt;code&gt;grep&lt;/code&gt; on marked (or next prefix arg) files.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A prefix argument behaves according to the &lt;code&gt;ARG&lt;/code&gt; argument of&#xA;  &lt;code&gt;dired-get-marked-files&lt;/code&gt;.  In particular, &lt;code&gt;C-u C-u&lt;/code&gt; operates on all&#xA;  files in the Dired buffer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-19T18:26:37.850" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30867" PostTypeId="2" ParentId="182" CreationDate="2017-02-19T18:32:24.883" Score="1" Body="&lt;p&gt;Late answer, but here's a simple version that doesn't modify the&#xA;buffer if the text doesn't change.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-fill-paragraph (&amp;amp;optional justify region)&#xA;  &quot;Fill paragraph, but don't modify the buffer if filling doesn't&#xA;change the text.  See `fill-paragraph' for details.&quot;&#xA;  (interactive (progn&#xA;                 (barf-if-buffer-read-only)&#xA;                 (list (if current-prefix-arg 'full) t)))&#xA;  (if (buffer-modified-p)&#xA;      ;; if modified: use standard fill-paragraph&#xA;      (fill-paragraph justify region)&#xA;    ;; if unmodified: get a candidate filled version&#xA;    (save-excursion&#xA;      (let* ((col fill-column)&#xA;             (beg (progn (forward-paragraph -1)&#xA;                         (skip-syntax-forward &quot; &amp;gt;&quot;)&#xA;                         (point)))&#xA;             (end (progn (forward-paragraph 1)&#xA;                         (skip-syntax-backward &quot; &amp;gt;&quot;)&#xA;                         (point)))&#xA;             (old (buffer-substring-no-properties beg end))&#xA;             (new (with-temp-buffer&#xA;                    (setq fill-column col)&#xA;                    (insert old)&#xA;                    (fill-paragraph justify region)&#xA;                    (buffer-string))))&#xA;        ;; don't modify unless the old and new versions differ&#xA;        (unless (string-equal old new)&#xA;          (delete-region beg end)&#xA;          (insert new))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It adapts some of the ideas in @JorgenSchäfer's answer, but works&#xA;only with the current paragraph, and only in a simple,&#xA;whitespace-separated way (see comments on @JorgenSchäfer's answer&#xA;about complications under the hood).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is about the only use case that's relevant for my own&#xA;purposes (ie, interactive use with &quot;normal&quot; prose, no active&#xA;region), so I'm posting it in case anyone wants to use it or&#xA;improve it for more complicated use cases.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2017-02-20T02:21:19.853" LastActivityDate="2017-02-20T02:21:19.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30868" PostTypeId="2" ParentId="30855" CreationDate="2017-02-19T18:43:33.337" Score="3" Body="&lt;p&gt;Eshell's grep is compatible with grep(1) and uses Emacs's internal grep interface, thus you can try something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x dired-do-eshell-command RET grep -nH --color your-search--pattern RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dired-do-eshell-command (command)&#xA;  &quot;Run an Eshell command on the marked files.&quot;&#xA;  (interactive &quot;sEshell command: &quot;)&#xA;  (let ((files (dired-get-marked-files t)))&#xA;    (eshell-command&#xA;     (format &quot;%s %s&quot; command (mapconcat #'identity files &quot; &quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-02-19T18:43:33.337" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30869" PostTypeId="1" AcceptedAnswerId="30870" CreationDate="2017-02-19T19:04:29.533" Score="5" ViewCount="1183" Body="&lt;p&gt;I sometimes find myself using a command repeatedly (using &lt;code&gt;M-x&lt;/code&gt;) but I do not want to bind it to a key in my init-file, because I only use it in certain sessions. How would I bind a command to a key interactively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I want to bind &lt;code&gt;bury-buffer&lt;/code&gt; to &lt;code&gt;C-c q&lt;/code&gt;. I could use &lt;code&gt;M-: (bind-key &quot;C-c q&quot; 'bury-buffer)&lt;/code&gt; (I'm using &lt;code&gt;use-package&lt;/code&gt;), but that's a lot of typing. What I want is to complete from a list of all interactive commands, and then input a &lt;code&gt;kbd&lt;/code&gt;-string to which the chosen command should be bound.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastActivityDate="2017-02-24T16:34:26.240" Title="Create temporary keybinding interactively" Tags="|key-bindings|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30870" PostTypeId="2" ParentId="30869" CreationDate="2017-02-19T19:27:08.360" Score="6" Body="&lt;p&gt;&lt;code&gt;M-x global-set-key RET&lt;/code&gt; prompts you to hit a key sequence and then to say what command to bind globally to that key sequence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x global-set-key RET C-c q bury-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The key binding remains in effect only for the current session, and only until you change or delete the binding for that key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Completion is available for the command name.  For the key, you just hit the key you want - no need to fiddle with any key description (e.g. &lt;code&gt;kbd&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike &lt;code&gt;define-key&lt;/code&gt;, &lt;code&gt;global-set-key&lt;/code&gt; is a command, not just a (non-interactive) function. There is also command &lt;code&gt;local-set-key&lt;/code&gt;, for binding a key in the local keymap of the current buffer, that is, (typically) the keymap of the buffer's major mode.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-02-19T23:59:10.487" LastActivityDate="2017-02-19T23:59:10.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30871" PostTypeId="2" ParentId="30837" CreationDate="2017-02-19T19:52:00.497" Score="11" Body="&lt;p&gt;I am new to the Org API and I would be glad if you could give a look to the code and share some comments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the proposed solution, consider the following table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|---+--------------------------------+---|&#xA;| 1 | one                            | a |&#xA;| 2 | two                            | b |&#xA;| 3 | This is a long chunk of text   | c |&#xA;| 4 | four                           | d |&#xA;| 5 | Yet another long chunk of text | e |&#xA;|---+--------------------------------+---|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Put the cursor anywhere in the second column and type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x org-table-wrap-to-width&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Enter a column  width as requested. E.g., entering  &lt;code&gt;15&lt;/code&gt;, you get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|---+----------------+---|&#xA;| 1 | one            | a |&#xA;| 2 | two            | b |&#xA;| 3 | This is a long | c |&#xA;|   | chunk of text  |   |&#xA;| 4 | four           | d |&#xA;| 5 | Yet another    | e |&#xA;|   | long chunk of  |   |&#xA;|   | text           |   |&#xA;|---+----------------+---|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you are dissatisfied with this width and want to try a different value, use the Emacs standard undo, which will restore the previous layout, so you can rerun the  wrap function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code. If you know Org, please, give feedback.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-table-wrap-to-width (width)&#xA;  &quot;Wrap current column to WIDTH.&quot;&#xA;  (interactive (list (read-number &quot;Enter column width: &quot;)))&#xA;  (org-table-check-inside-data-field)&#xA;  (org-table-align)&#xA;&#xA;  (let (cline (ccol (org-table-current-column)) new-row-count (more t))&#xA;    (org-table-goto-line 1)&#xA;    (org-table-goto-column ccol)&#xA;&#xA;    (while more&#xA;      (setq cline (org-table-current-line))&#xA;&#xA;      ;; Cut current field&#xA;      (org-table-copy-region (point) (point) 'cut)&#xA;&#xA;      ;; Justify for width&#xA;      (setq org-table-clip &#xA;            (mapcar 'list (org-wrap (caar org-table-clip) width nil)))&#xA;&#xA;      ;; Add new lines and fill&#xA;      (setq new-row-count (1- (length org-table-clip)))&#xA;      (if (&amp;gt; new-row-count 0)&#xA;          (org-table-insert-n-row-below new-row-count)) &#xA;      (org-table-goto-line cline)&#xA;      (org-table-goto-column ccol)&#xA;      (org-table-paste-rectangle)&#xA;      (org-table-goto-line (+ cline new-row-count))&#xA;&#xA;      ;; Move to next line&#xA;      (setq more (org-table-goto-line (+ cline new-row-count 1)))&#xA;      (org-table-goto-column ccol))&#xA;&#xA;    (org-table-goto-line 1)&#xA;    (org-table-goto-column ccol)))&#xA;&#xA;(defun org-table-insert-n-row-below (n)&#xA;  &quot;Insert N new lines below the current.&quot;&#xA;  (let* ((line (buffer-substring (point-at-bol) (point-at-eol)))&#xA;         (new (org-table-clean-line line)))&#xA;    ;; Fix the first field if necessary&#xA;    (if (string-match &quot;^[ \t]*| *[#$] *|&quot; line)&#xA;        (setq new (replace-match (match-string 0 line) t t new)))&#xA;    (beginning-of-line 2)&#xA;    (setq new&#xA;      (apply 'concat (make-list n (concat new &quot;\n&quot;))))&#xA;    (let (org-table-may-need-update) (insert-before-markers new))  ;;; remove? &#xA;    (beginning-of-line 0)&#xA;    (re-search-forward &quot;| ?&quot; (point-at-eol) t)&#xA;    (and (or org-table-may-need-update org-table-overlay-coordinates) ;;; remove? &#xA;         (org-table-align))&#xA;    (org-table-fix-formulas &quot;@&quot; nil (1- (org-table-current-dline)) n)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2017-02-19T19:52:00.497" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30872" PostTypeId="2" ParentId="30860" CreationDate="2017-02-19T19:55:29.650" Score="1" Body="&lt;p&gt;Q: How can I fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A1: Now that you know that the environment variable makes the difference, see if you can get the intended effect without it. Searching the net for &quot;LANG vs. LC_CTYPE&quot;, this question pops up: &lt;a href=&quot;https://stackoverflow.com/questions/30479607/explain-the-effects-of-export-lang-lc-ctype-lc-all&quot;&gt;https://stackoverflow.com/questions/30479607/explain-the-effects-of-export-lang-lc-ctype-lc-all&lt;/a&gt;, which explains:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;LC_CTYPE This variable determines the locale category for character handling functions, such as tolower(), toupper() and isalpha(). This environment variable determines the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters), the classification of characters (for example, alpha, digit, graph) and the behaviour of character classes. Additional semantics of this variable, if any, are implementation-dependent.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I understand that you want the &lt;code&gt;LC_CTYPE&lt;/code&gt; setting for editing of chinese text. Now, a single Emacs instance can hold texts in multiple languages, at the same time - the issue is triggered with german text, after all. However, as documented in Info node &quot;Language Environments&quot;, the environment applies to the entire instance, which may not be what you need. Maybe it is possible to use a buffer-specific approach for some aspects. Leave the environment in its default state (&lt;code&gt;de_DE.utf-8&lt;/code&gt;, for example), and see if Emacs provides a way to specify chinese character input and handling in a buffer-local fashion. In particular, see &lt;code&gt;set-input-method&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BEGIN EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Judging by your use of fctix and XMODIFIERS, your OS is Linux or BSD based and your window system is X11.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Up to now I had not bothered to look up &quot;fctix&quot;. I did now, and I see that it is not a concrete input method, but an input method framework. I assume that a concrete input method needs to be chosen to make it actually do any work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the years, I have tried multiple times to understand how &quot;input methods&quot; work on the technical level, and this time is not much different. In particular, the layering is not clear to me. What happens where?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you mentioned fonts, I assume that you are using Emacs as a GUI program. As such, I assume that Emacs receives a stream of events that describe what happened on the &quot;physical&quot; input device, e.g. keycodes, and that Emacs translates this event stream into a stream of code points on its own, using its own input method framework. Since different buffers may need different input methods, it seems to me that any input processing outside of Emacs might interfere with Emacs' own input processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Side note: I also assume that when Emacs runs as a terminal program, Emacs receives something that is more like a stream of characters, not a stream of event descriptors. Depending on the value of LC_CTYPE and related variables, this character stream may already have been through an &quot;input method&quot; processor at the terminal level, so that no further &quot;input method&quot; processing is required of the application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(To be continued)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;END EDIT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A2: Not a direct answer, rather a strategy to find one. Since I can't comment, I can only provide this as a formal answer. To fix it, you need to first identify what causes your issue (you know that much of course). Use &quot;divide and conquer&quot; to do that. You have already used &lt;code&gt;-Q&lt;/code&gt; to determine that the issue is related to some config file code. Have you tried &lt;code&gt;-q&lt;/code&gt;? If the issue persists with this option, the cause is in the site files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(By site files I mean those whose execution &lt;code&gt;-Q&lt;/code&gt; suppresses that &lt;code&gt;-q&lt;/code&gt; doesn't. Quoting from Emacs -&gt; &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;info&lt;/code&gt; -&gt; Emacs -&gt; Entering Emacs -&gt; Emacs Invocation -&gt; Initial Options:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;‘--no-site-file’&#xA; Do not load ‘site-start.el’ (*note Init File::).  The ‘-Q’ option&#xA; does this too, but other options like ‘-q’ do not.&#xA;&#xA;‘--no-site-lisp’&#xA; Do not include the ‘site-lisp’ directories in ‘load-path’ (*note&#xA; Init File::).  The ‘-Q’ option does this too.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whether such files exist so that this actually makes a difference depends on your installation. It may be that your distribution includes such files, or that your sysadmin has created such files. )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, it's in your user's config file(s). In that case, successively bisect your init file. Divide it roughly in half, preferring to keep related entries together, delete one half, start a second emacs instance (avoiding Emacs-Server), see if the issue persists. If the issue persists, the trigger is in the remaining half, so continue by bisecting it. If the issue is gone, the removed half must have triggered the issue, so re-add it and continue by bisecting that. Continue until you have a minimal set of config entries that triggers the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I share your pain. Pervasive correct handling of non-ASCII characters is still a way off. :-) I applaud everyone who improves this situation, including people who precisely report bugs.&lt;/p&gt;&#xA;" OwnerUserId="14971" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-02-21T09:02:11.137" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30873" PostTypeId="1" CreationDate="2017-02-19T20:02:09.357" Score="2" ViewCount="144" Body="&lt;p&gt;I'm using &lt;code&gt;undo-tree&lt;/code&gt; with AUCTeX, and I am persisting my undo files like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq undo-tree-auto-save-history t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this regularly results in large (~1MB) undo save files which cause my Emacs to hang when they're loaded. The reason for this is the large number of text-properties that AUCTeX puts on its buffer contents, which bloats the file by orders of magnitude.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it safe to remove these properties from the save file, and if so, how can I do so?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2017-02-28T20:30:35.407" Title="text-properties bloat persistent undo files" Tags="|text-properties|undo-tree-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30874" PostTypeId="1" CreationDate="2017-02-19T21:18:28.513" Score="6" ViewCount="6184" Body="&lt;p&gt;I've seen the question here but I'm not sure if the same solution would apply to me&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/17866/magit-how-to-use-systems-ssh-agent-and-dont-ask-for-password/17890#17890&quot;&gt;Magit, how to use system&amp;#39;s ssh agent and don&amp;#39;t ask for password&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'm on Emacs 25.1 / Ubuntu 16.04. I've just set up SSH-keys according to &lt;a href=&quot;https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/&lt;/a&gt; and I've added the public key to my GitHub account.&lt;/p&gt;&#xA;&lt;p&gt;When I try to push though, Magit prompts me for my password to my account foobar@github.com (as always) rather than seeing that I've set an SSH-key into ssh-agent.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;M-x getenv SSH_AGENT_PID&lt;/code&gt; doesn't exist and &lt;code&gt;M-x getenv SSH_AUTH_SOCK&lt;/code&gt; is  &lt;code&gt;/run/user/1000/keyring/ssh&lt;/code&gt;. &lt;code&gt;echo $SSH_AGENT_PID&lt;/code&gt; is 18145. What is the next step from here?&lt;/p&gt;&#xA;" OwnerUserId="11700" LastEditorUserId="19227" LastEditDate="2021-01-28T18:22:58.017" LastActivityDate="2021-01-28T18:22:58.017" Title="Magit how to use ssh key rather than being prompted for password" Tags="|magit|git|ssh|github|passwords|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30875" PostTypeId="2" ParentId="30860" CreationDate="2017-02-19T21:45:00.003" Score="0" Body="&lt;p&gt;It seems there was something inherently wrong with setting &lt;code&gt;LC_CTYPE=\&quot;zh_CN.UTF-8\&quot;&lt;/code&gt; in the command to run emacs, which caused this issue. I now created another launcher for emacs, which starts it without this environment variable set. So I have two launchers now:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For enabling Chinese input via fcitx:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/bin/bash -c &quot;XMODIFIERS=@im=fcitx LC_CTYPE=\&quot;zh_CN.UTF-8\&quot; emacs&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and for my daily default usage:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/bin/bash -c &quot;XMODIFIERS=@im=fcitx emacs&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Gave the one for Chinese input a nice icon, and am satisfied for now. Well, if someone can provide a better workaround or even fix, that will be still appreciated ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a guess what the issue behind the scenes might be. In Chinese Pinyin, the phonetic script, the character &lt;code&gt;ü&lt;/code&gt; exists, while the other ones &lt;code&gt;äöÜÄÖß&lt;/code&gt; do not exist. So maybe when I set the &lt;code&gt;LC_CTYPE&lt;/code&gt; environment variable, it recognizes the difference between characters belonging to Chinese or its phonetic script and everything else. Since Chinese characters are counted as two columns wide (since they are wider or need more space to be readable), it might also count that &lt;code&gt;ü&lt;/code&gt; as a special character and thus it becomes a +2 character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the only difference between the Umlaute, which has anything to do with Chinese at least.&lt;/p&gt;&#xA;" OwnerUserId="10090" LastEditorUserId="10090" LastEditDate="2017-02-20T21:30:38.493" LastActivityDate="2017-02-20T21:30:38.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30876" PostTypeId="2" ParentId="30874" CreationDate="2017-02-19T23:06:37.083" Score="5" Body="&lt;p&gt;Edit &lt;code&gt;~/.ssh/config&lt;/code&gt; so that it contains the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host github.com&#xA;  IdentitiesOnly yes&#xA;  IdentityFile ~/.ssh/your_ssh_key&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then whenever magit asks git to ask ssh to talk to github.com, ssh will know what key to use; saves a lot of mucking about.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-19T23:06:37.083" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30877" PostTypeId="1" CreationDate="2017-02-19T23:08:17.433" Score="1" ViewCount="1659" Body="&lt;p&gt;Whenever I create &lt;code&gt;org-mode&lt;/code&gt; entries using &lt;code&gt;org-capture&lt;/code&gt; they automatically get an ID property. Is it possible to disable that? I'm using org mode version 9.0.5.&lt;/p&gt;&#xA;" OwnerUserId="9695" LastActivityDate="2022-07-18T19:00:35.083" Title="How to use org-capture without creating ID property?" Tags="|org-mode|org-capture|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30878" PostTypeId="2" ParentId="30585" CreationDate="2017-02-19T23:30:27.243" Score="2" Body="&lt;p&gt;You need to use process sentinels. Try for example this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'tex-site)&#xA;(defun build-view ()&#xA;  &quot;Build LaTeX and view if file is dirty. View only otherwise.&quot;&#xA;  (interactive)&#xA;  (if (buffer-modified-p)&#xA;      (let (build-proc&#xA;        (TeX-save-query nil)&#xA;        (LaTeX-command-style '((&quot;&quot; &quot;%(PDF)%(latex) -shell-escape -file-line-error %S%(PDFout)&quot;))))&#xA;    (TeX-save-document (TeX-master-file))&#xA;    (setq build-proc (TeX-command &quot;LaTeX&quot; 'TeX-master-file -1))&#xA;    (set-process-sentinel  build-proc  'build-sentinel))&#xA;    (TeX-view)))&#xA;&#xA;(defun build-sentinel (process event)&#xA;&quot;Sentinel to run viewer after successful LaTeXing&quot;&#xA;  (if (string= event &quot;finished\n&quot;)&#xA;      (TeX-view)&#xA;    (message &quot;Errors! Check with C-c `&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case,  when the LaTeX buffer has been modified,  &lt;code&gt;(set-process-sentinel  build-proc  'build-sentinel)&lt;/code&gt;&#xA;runs the build process &lt;code&gt;(TeX-command &quot;LaTeX&quot; 'TeX-master-file -1)&lt;/code&gt; in the background.&#xA;Sentinel functions, here &lt;code&gt;build-sentinel&lt;/code&gt;, monitor a process running in the background without blocking Emacs. In this case, when &lt;code&gt;build-sentinel&lt;/code&gt; detects the build process is finished, it starts the PDF viewer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other functions involved, for example &lt;code&gt;LaTeX-command-style&lt;/code&gt; defines what flavour of LaTeX command you will actually run; but the main point to craft an asynchronous process is in the function setting the sentinel.&lt;/p&gt;&#xA;" OwnerUserId="3975" LastActivityDate="2017-02-19T23:30:27.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30879" PostTypeId="2" ParentId="30842" CreationDate="2017-02-20T00:20:13.757" Score="1" Body="&lt;p&gt;This is doubtless a little simplistic, but I expect it would deal with most cases.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local my-track-prev-pos-marker nil&#xA;  &quot;Buffer-local marker to remember the previous editing position.&quot;)&#xA;&#xA;(add-hook 'pre-command-hook 'my-track-prev-pos-pre-command)&#xA;&#xA;(defun my-track-prev-pos-pre-command ()&#xA;  &quot;Track the previous editing position in `my-track-prev-pos-marker'.&quot;&#xA;  (unless (eq this-command 'my-track-prev-pos-jump)&#xA;    (if (markerp my-track-prev-pos-marker)&#xA;        (set-marker my-track-prev-pos-marker (point))&#xA;      (setq my-track-prev-pos-marker (point-marker)))))&#xA;&#xA;(add-hook 'kill-buffer-hook 'my-track-prev-pos-kill-buffer-hook)&#xA;&#xA;(defun my-track-prev-pos-kill-buffer-hook ()&#xA;  &quot;Reclaim the buffer-local marker.&quot;&#xA;  (setq my-track-prev-pos-marker nil))&#xA;&#xA;(defun my-track-prev-pos-jump ()&#xA;  &quot;Jump to the previous editing position.&quot;&#xA;  (interactive)&#xA;  (when (markerp my-track-prev-pos-marker)&#xA;    (let ((prev (marker-position my-track-prev-pos-marker)))&#xA;      (set-marker my-track-prev-pos-marker (point))&#xA;      (goto-char prev))))&#xA;&#xA;(global-set-key (kbd &quot;C-c b&quot;) 'my-track-prev-pos-jump)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-02-20T00:20:13.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30880" PostTypeId="2" ParentId="24283" CreationDate="2017-02-20T00:27:53.887" Score="0" Body="&lt;p&gt;&lt;strike&gt;Doing the simple&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq indent-tabs-mode nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;fixed it for me...&lt;/p&gt;&#xA;&lt;p&gt;Org mode doesn't really like tabs anyway, it seems, so this works just fine.&#xA;&lt;/strike&gt;&lt;/p&gt;&#xA;&lt;p&gt;EDIT: Nope nope nope I'm an idiot. But this worked for me, at least (I use two space tabs, change that as necessary):&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-pdf-process '(&amp;quot;sed -ie 's/  /  /g' %f&amp;quot;&#xA;                        &amp;quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&amp;quot;&#xA;                        &amp;quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&amp;quot;&#xA;                        &amp;quot;pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f&amp;quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14976" LastEditorUserId="10036" LastEditDate="2021-06-25T14:32:55.050" LastActivityDate="2021-06-25T14:32:55.050" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30881" PostTypeId="2" ParentId="30852" CreationDate="2017-02-20T00:31:52.837" Score="1" Body="&lt;p&gt;&lt;code&gt;(mouse-position)&lt;/code&gt; returns line+column relative to the frame, not the window. You need to subtract &lt;code&gt;window-top-line&lt;/code&gt; and &lt;code&gt;window-left-column&lt;/code&gt; to get line+column relative to window.&lt;/p&gt;&#xA;" OwnerUserId="14959" LastEditorUserId="17852" LastEditDate="2021-06-19T13:32:56.300" LastActivityDate="2021-06-19T13:32:56.300" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30882" PostTypeId="2" ParentId="30874" CreationDate="2017-02-20T03:25:30.613" Score="4" Body="&lt;p&gt;The issue was that the remote url was set to https rather than ssh&lt;/p&gt;&#xA;&#xA;&lt;p&gt;following these steps fixed the issue &lt;a href=&quot;https://help.github.com/articles/changing-a-remote-s-url/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://help.github.com/articles/changing-a-remote-s-url/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11700" LastActivityDate="2017-02-20T03:25:30.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30883" PostTypeId="1" CreationDate="2017-02-20T06:41:48.377" Score="0" ViewCount="876" Body="&lt;p&gt;I am currently trying to install spacemacs on my Arch Linux. I am following the standard installation instructions that have been put up &lt;a href=&quot;https://github.com/syl20bnr/spacemacs#default-installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now after cloning the &lt;code&gt;.emacs.d&lt;/code&gt; from the &lt;code&gt;spacemacs&lt;/code&gt; repository, whenever I open &lt;code&gt;emacs&lt;/code&gt;, I get the error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Creating directory, Permission denied, /home/sharand/.emacs.d/. cache&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After which, the suggestion on &lt;a href=&quot;https://emacs.stackexchange.com/questions/30749/cannot-install-spacemacs&quot;&gt;this&lt;/a&gt; question prompted me to create a &lt;code&gt;.cache&lt;/code&gt; folder inside &lt;code&gt;.emacs.d&lt;/code&gt;. But after this, I reopened &lt;code&gt;emacs&lt;/code&gt; to get this error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File error: Creating directory, Permission denied, /home/sharand/.emacs.d/.cache/auto-save&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I am stuck in a cycle of creating folders and reopening &lt;code&gt;emacs&lt;/code&gt;. I just want to know how to change the writing permissions of &lt;code&gt;emacs&lt;/code&gt;. Invoking a &lt;code&gt;sudo emacs&lt;/code&gt;, just makes it go to the default &lt;code&gt;emacs&lt;/code&gt; and does not bring up &lt;code&gt;spacemacs&lt;/code&gt; (does anyone know why this is the case?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I go about making sure that I have writing permissions for &lt;code&gt;emacs&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="14928" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-02-20T07:08:05.283" Title="Change the writing permissions of emacs" Tags="|spacemacs|writing|" AnswerCount="0" CommentCount="5" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30884" PostTypeId="2" ParentId="30877" CreationDate="2017-02-20T08:26:53.417" Score="0" Body="&lt;p&gt;So I think I've found a way, but its not very elegant:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-remove-id-from-last-capture ()&#xA;  &quot;Remove ID property from last `org-capture' entry, save capture buffer.&quot;&#xA;  (let* ((properties (org-entry-properties org-capture-last-stored-marker))&#xA;         (file (cdr (assoc &quot;FILE&quot; properties)))) &#xA;    (when (org-entry-delete org-capture-last-stored-marker &quot;ID&quot;)&#xA;      (with-current-buffer (get-file-buffer file)&#xA;        (save-buffer)))))&#xA;&#xA;(add-hook 'org-capture-after-finalize-hook #'org-remove-id-from-last-capture)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastActivityDate="2017-02-20T08:26:53.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30885" PostTypeId="2" ParentId="30749" CreationDate="2017-02-20T10:05:54.307" Score="1" Body="&lt;p&gt;If writing permission is all you want, just run &quot;chmod -R +w ~/.emacs.d&quot;, maybe sudo is needed.&#xA;But I think the best solution is to reinstall spacemacs without sudo or su previlege.&lt;/p&gt;&#xA;" OwnerUserId="14959" LastActivityDate="2017-02-20T10:05:54.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30886" PostTypeId="1" AcceptedAnswerId="30887" CreationDate="2017-02-20T10:22:18.600" Score="3" ViewCount="426" Body="&lt;p&gt;&lt;em&gt;Q&lt;/em&gt;:  How to test whether all elements of two lists are the same even though the order may be different?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EXAMPLE:  &lt;code&gt;(test-fn '(answered cached unread) '(unread answered cached))&lt;/code&gt; =&gt; &lt;strong&gt;t&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-20T22:40:44.083" Title="Compare all elements of 2 lists, not necessarily in same order" Tags="|list|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30887" PostTypeId="2" ParentId="30886" CreationDate="2017-02-20T11:05:35.083" Score="3" Body="&lt;p&gt;Perhaps you could &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/cl/Lists-as-Sets.html#Lists-as-Sets&quot; rel=&quot;nofollow noreferrer&quot;&gt;use your list as a set&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(cl-set-exclusive-or '(1 2 3) '(3 2 1))&lt;/code&gt; =&gt; nil&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;(cl-set-exclusive-or '(1 2 3) '(3 2 1 0))&lt;/code&gt; =&gt; (0)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You could put it into a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun order-independent-list-equal (list1 list2)&#xA;  &quot;Test if LIST1 and LIST2 hold the same values.&#xA;The order of values may be different.&quot;&#xA;  (not (cl-set-exclusive-or list1 list2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;(order-independent-list-equal '(answered cached unread) '(unread answered cached))&lt;/code&gt; =&gt; t&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There will be a problem if you have multiple instances of the same value though. A more complex version would be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun order-independent-list-equal (list1 list2)&#xA;  &quot;Test if LIST1 and LIST2 hold the same values.&#xA;The order of values may be different.&quot;&#xA;  (and (equal (length list1) (length list2))&#xA;       (not (cl-set-exclusive-or list1 list2))&#xA;       (let ((uniques (remove-duplicates list1)))&#xA;         (cl-every&#xA;          (lambda (x)&#xA;            (equal (cl-count x list1)&#xA;                   (cl-count x list2)))&#xA;          uniques))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="9695" LastEditDate="2017-02-20T22:40:44.083" LastActivityDate="2017-02-20T22:40:44.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30888" PostTypeId="1" AcceptedAnswerId="30891" CreationDate="2017-02-20T11:48:22.307" Score="1" ViewCount="59" Body="&lt;p&gt;I'm trying to configure my org based init file to work on 2 different machines where some of my org file would be accessed remotely. &#xA;For example I want to define within the same config different org capture based on which machine I'm currently on (hostname).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this initial code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (string= system-name &quot;home&quot;)&#xA;&#xA;(add-to-list 'org-capture-templates&#xA;'(&quot;z&quot; &quot;web capture &quot; item&#xA;         (file+headline &quot;/home/zeltak/org/files/web/wbookmarks.org&quot; &quot;Temporary Links&quot;)&#xA;         &quot;%?\nEntered on %U\n \%i\n %a&quot;))&#xA;)&#xA;&#xA;&#xA;(when (string= system-name &quot;work&quot;)&#xA;&#xA;(add-to-list 'org-capture-templates&#xA;'(&quot;z&quot; &quot;web capture &quot; item&#xA;         (file+headline &quot;/sshx:work:~/org/files/wbookmarks.org&quot; &quot;Temporary Links&quot;)&#xA;         &quot;%?\nEntered on %U\n \%i\n %a&quot;))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have 30 captures like this where I have to reproduce for both machines. I am sure there is a more intelligent way to do this and am looking for suggestions. Perhaps define a Path variable that changes based on machine?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorDisplayName="user8748" LastEditDate="2017-05-07T01:31:35.097" LastActivityDate="2017-05-07T01:31:35.097" Title="Complex multi machine init setup: suggestions on improving the Lisp code" Tags="|org-mode|init-file|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30889" PostTypeId="1" AcceptedAnswerId="30890" CreationDate="2017-02-20T12:05:22.147" Score="4" ViewCount="267" Body="&lt;p&gt;The default in &lt;code&gt;dired&lt;/code&gt; is to mark files and folders with &lt;kbd&gt;m&lt;/kbd&gt;, and to unmark them with &lt;kbd&gt;u&lt;/kbd&gt;. Instead of this, I'd rather like to use &lt;kbd&gt;shift-up&lt;/kbd&gt; and &lt;kbd&gt;shift-down&lt;/kbd&gt; for marking or unmarking lines (in a DWIM fashion). So &lt;kbd&gt;shift-up&lt;/kbd&gt; would mark/unmark the current line and move the cursor one line up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is nothing particularly fancy, I guess, and I would preferably use something already built in into &lt;code&gt;dired&lt;/code&gt; or provided by some extra package. But I haven't come across something like this so far.  &lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="105" LastEditDate="2017-02-20T18:01:42.570" LastActivityDate="2017-02-20T18:01:42.570" Title="Use shift-up/down keys to mark/unmark lines in dired?" Tags="|key-bindings|dired|region|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30890" PostTypeId="2" ParentId="30889" CreationDate="2017-02-20T13:42:47.050" Score="3" Body="&lt;p&gt;Dired has a function for toggling marks, &lt;code&gt;t&lt;/code&gt;. However, it works on all files at once. We can use narrowing to restrict it to the current line only. With that feature sorted, the rest is fairly straightforward:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-dired-toggle (arg)&#xA;  (save-restriction&#xA;    (narrow-to-region (point-at-bol) (point-at-eol))&#xA;    (dired-toggle-marks))&#xA;  (dired-previous-line arg))&#xA;&#xA;(defun my-dired-mark-up ()&#xA;  (interactive)&#xA;  (my-dired-toggle 1))&#xA;&#xA;(defun my-dired-mark-down ()&#xA;  (interactive)&#xA;  (my-dired-toggle -1))&#xA;&#xA;(define-key dired-mode-map (kbd &quot;&amp;lt;S-up&amp;gt;&quot;) 'my-dired-mark-up)&#xA;(define-key dired-mode-map (kbd &quot;&amp;lt;S-down&amp;gt;&quot;) 'my-dired-mark-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="25" LastEditDate="2017-02-20T15:19:37.710" LastActivityDate="2017-02-20T15:19:37.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30891" PostTypeId="2" ParentId="30888" CreationDate="2017-02-20T14:12:48.553" Score="1" Body="&lt;p&gt;I think your idea is fine:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(if (string= system-name &quot;home&quot;)&#xA;    (setq my-org-path &quot;/home/zeltak/org/files/&quot;)&#xA;  (setq my-org-path &quot;/sshx:work:~/org/files/&quot;))&#xA;&#xA;(add-to-list 'org-capture-templates&#xA;             '(&quot;z&quot; &quot;web capture &quot; item&#xA;               (file+headline (expand-file-name &quot;web/wbookmarks.org&quot; my-org-path) &quot;Temporary Links&quot;)&#xA;               &quot;%?\nEntered on %U\n \%i\n %a&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're only going to use &lt;code&gt;my-org-path&lt;/code&gt; in the context of setting the org-capture-templates list, you could isolate it in a &lt;code&gt;let&lt;/code&gt; form:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((my-org-path &#xA;       (if (string= system-name &quot;home&quot;)&#xA;           &quot;/home/zeltak/org/files/&quot;&#xA;         &quot;/sshx:work:~/org/files/&quot;)))&#xA;&#xA;  (add-to-list 'org-capture-templates&#xA;               '(&quot;z&quot; &quot;web capture &quot; item&#xA;                 (file+headline (expand-file-name &quot;web/wbookmarks.org&quot; my-org-path) &quot;Temporary Links&quot;)&#xA;                 &quot;%?\nEntered on %U\n \%i\n %a&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the advantage of not polluting your global name space with &lt;code&gt;my-org-path&lt;/code&gt; if you're not going to use it after loading your config. Probably not a big deal either way.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-02-20T15:03:07.017" LastActivityDate="2017-02-20T15:03:07.017" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30892" PostTypeId="2" ParentId="30575" CreationDate="2017-02-20T15:00:34.027" Score="4" Body="&lt;p&gt;You need simple modification of &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.orgmode/93971&quot; rel=&quot;nofollow noreferrer&quot;&gt;Rasmus solution&lt;/a&gt; given by &lt;a href=&quot;https://emacs.stackexchange.com/users/91/mankoff&quot;&gt;mankoff&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org/get-headline-string-element  (headline backend info)&#xA;  (let ((prop-point (next-property-change 0 headline)))&#xA;    (if prop-point (plist-get (text-properties-at prop-point headline) :parent))))&#xA;&#xA;(defun org/ensure-latex-clearpage (headline backend info)&#xA;  (when (org-export-derived-backend-p backend 'latex)&#xA;    (let ((elmnt (org/get-headline-string-element headline backend info)))&#xA;      (when (member &quot;newpage&quot; (org-element-property :tags elmnt))&#xA;        (concat &quot;\\clearpage\n&quot; headline)))))&#xA;&#xA;(add-to-list 'org-export-filter-headline-functions&#xA;             'org/ensure-latex-clearpage)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that &lt;code&gt;\clearpage&lt;/code&gt; suits here better than &lt;code&gt;\newpage&lt;/code&gt; (check &lt;a href=&quot;https://tex.stackexchange.com/questions/45609/is-it-wrong-to-use-clearpage-instead-of-newpage&quot;&gt;here&lt;/a&gt; for more info).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All credits goes to &lt;a href=&quot;http://permalink.gmane.org/gmane.emacs.orgmode/93971&quot; rel=&quot;nofollow noreferrer&quot;&gt;Rasmus&lt;/a&gt; and &lt;a href=&quot;https://emacs.stackexchange.com/users/91/mankoff&quot;&gt;mankoff&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-04-05T08:04:57.970" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30893" PostTypeId="1" CreationDate="2017-02-20T15:24:46.227" Score="5" ViewCount="427" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/manual/noweb.html#noweb&quot; rel=&quot;noreferrer&quot;&gt;This&lt;/a&gt; says that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Noweb insertions now honor prefix characters that appear before &lt;code&gt;&amp;lt;&amp;lt;reference&amp;gt;&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And because of that trying to use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC clojure :noweb-ref dep-cljsbuild&#xA;[lein-figwheel &quot;0.5.9&quot;]&#xA;[lein-cljsbuild &quot;1.1.5&quot; :exclusions [[org.clojure/clojure]]]&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:plugins [&amp;lt;&amp;lt;dep-cljsbuild&amp;gt;&amp;gt;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives me&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:plugins [[lein-figwheel &quot;0.5.9&quot;]&#xA;:plugins [[lein-cljsbuild &quot;1.1.5&quot; :exclusions [[org.clojure/clojure]]]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is obviously not what I want. I can workaround issue by moving &lt;code&gt;&amp;lt;&amp;lt;dep-cljsbuild&amp;gt;&amp;gt;&lt;/code&gt; to the new line, but it looks ugly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you recommend any proper way to point org-mode that in particular place I don't want prefixes to be preserved? (Or at least how to disable it globally)&lt;/p&gt;&#xA;" OwnerUserId="14983" LastActivityDate="2022-07-15T13:00:35.113" Title="How to disable noweb prefix lines?" Tags="|org-mode|org-babel|noweb|tangle|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30894" PostTypeId="1" CreationDate="2017-02-20T17:24:47.123" Score="8" ViewCount="1688" Body="&lt;p&gt;I'm using &lt;code&gt;org-mode&lt;/code&gt; with really huge files (what I love in &lt;code&gt;org-mode&lt;/code&gt; is having everything in a single file).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know where I am in the file by having a look at the modeline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have the following :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Foo&#xA;** Bar&#xA;*** Dump&#xA;[cursor being here]&#xA;** Egg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like the modeline to show me something like &lt;code&gt;Foo &amp;gt; Bar &amp;gt; Dump&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to achieve that?&lt;/p&gt;&#xA;" OwnerUserId="9816" LastEditorUserId="253" LastEditDate="2017-02-20T17:55:28.300" LastActivityDate="2024-03-22T00:54:03.053" Title="Show current org-mode outline position in modeline" Tags="|org-mode|mode-line|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30895" PostTypeId="1" CreationDate="2017-02-20T17:34:03.053" Score="0" ViewCount="1609" Body="&lt;p&gt;I have a script to launch OSX GUI emacs from command line at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;/usr/local/bin/emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The script looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/sh&#xA;$(/Applications/Emacs.app/Contents/MacOS/Emacs --chdir $PWD &quot;$@&quot;) &amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have configured a bash &lt;code&gt;$EDITOR&lt;/code&gt; environment variable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;export EDITOR=/usr/local/bin/emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want git to open the GUI emacs for commit messages and rebase messages&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to commit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;evs-MBP:skeletal-animation-system kev$ echo &quot;cool&quot; &amp;gt;&amp;gt; fake.js&#xA;Kevs-MBP:skeletal-animation-system kev$ git add fake.js&#xA;Kevs-MBP:skeletal-animation-system kev$ git commit&#xA;Aborting commit due to empty commit message.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will launch the GUI prepopulated with the correct commit prompt however I believe because the command runs in the emacs command runs in the background git thinks it immediately quits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similiar undesired behavior happens with a rebase.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Kevs-MBP:skeletal-animation-system kev$ git rebase -i origin/master&#xA;Successfully rebased and updated refs/heads/rebase-test.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The rebase is automatically completed. I'm assuming again because the processes detaches and git thinks it completed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a way to use GUI emacs with the git command line tool.&lt;/p&gt;&#xA;" OwnerUserId="12732" LastActivityDate="2017-02-23T01:08:30.650" Title="How to use OSX command line GUI emacs as git $EDITOR" Tags="|osx|git|gui-emacs|command-line-arguments|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30896" PostTypeId="2" ParentId="30894" CreationDate="2017-02-20T17:54:20.483" Score="1" Body="&lt;p&gt;The following is an interactive command that will give you your&#xA;location within the current &lt;code&gt;org-mode&lt;/code&gt; tree:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-where-am-i ()&#xA;  &quot;Returns a string of headers indicating where point is in the&#xA;current tree.&quot;&#xA;  (interactive)&#xA;  (let (headers)&#xA;    (save-excursion&#xA;      (while (condition-case nil&#xA;                 (progn&#xA;                   (push (nth 4 (org-heading-components)) headers) &#xA;                   (outline-up-heading 1))&#xA;               (error nil))))&#xA;    (message (mapconcat #'identity headers &quot; &amp;gt; &quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd actually suggest &lt;em&gt;not&lt;/em&gt; putting it in the modeline, if for no&#xA;other reason than the fact that it'll take over the whole thing.&#xA;Instead, I'd suggest you bind the command to a key and call it&#xA;whenever you want to know where you are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: if you &lt;em&gt;really&lt;/em&gt; want to put it in the modeline, you'll&#xA;want to remove the call to &lt;code&gt;message&lt;/code&gt; in the last line.)&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-02-20T17:54:20.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30897" PostTypeId="2" ParentId="30889" CreationDate="2017-02-20T17:59:59.693" Score="4" Body="&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dired+&lt;/a&gt; then you get similar behavior out of the box.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Command &lt;code&gt;diredp-mark-region-files&lt;/code&gt; marks the files in the active region.  (Similarly, &lt;code&gt;diredp-unmark-region-files&lt;/code&gt; unmarks them.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And shift-selection with the cursor keys works to select text (active region).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;diredp-mark-region-files&lt;/code&gt; is not bound to a key by default, but you can bind it.  E.g., if you bind it to, say &lt;code&gt;C-o&lt;/code&gt; then just hit &lt;code&gt;C-o&lt;/code&gt; after using, say &lt;code&gt;S-down...&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a reason that simply using shift-selection (e.g. &lt;code&gt;S-down...&lt;/code&gt;) does not, by itself, mark or unmark files: With Dired+ you can do &lt;strong&gt;&lt;em&gt;lots&lt;/em&gt;&lt;/strong&gt; of different things with the active region.  So the act of selecting is separated from the various actions on the selected files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to mark files using the region is to drag the mouse (&lt;code&gt;mouse-1&lt;/code&gt;).  Just click &lt;code&gt;mouse-3&lt;/code&gt; to then see a &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus#DiredPlusPopupRegionMenu&quot; rel=&quot;nofollow noreferrer&quot;&gt;whole bunch of things&lt;/a&gt; you can do to the files in the region, one of which is to mark them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/download/dired%2b.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;dired+.el&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-20T17:59:59.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30898" PostTypeId="1" AcceptedAnswerId="30903" CreationDate="2017-02-20T18:01:07.797" Score="3" ViewCount="4495" Body="&lt;p&gt;I have just install a version of emacs (GNU Emacs 24.5.1 i686-pc-mingw32) on a Windows 8 Machine. On trying to open an example SML file (Standard ML Language). An error occurred:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;File mode specification error: (error &quot;Autoloading failed to define function sml-mode&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On deeper inspection the debugger shows this: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Debugger entered--Lisp error: (error &quot;Autoloading failed to define function sml-mode&quot;) &lt;br&gt;&#xA;    sml-mode() &lt;br&gt;&#xA;    set-auto-mode-0(sml-mode nil) &lt;br&gt;&#xA;    set-auto-mode()&lt;br&gt;&#xA;    normal-mode(t) &lt;br&gt;&#xA;    after-find-file(nil t) &lt;br&gt;&#xA;    find-file-noselect-1(# &quot;g:/example00.sml&quot; nil nil &quot;g:/example00.sml&quot; ((512 4 . 8192) (48259 . 42323))) &lt;br&gt; &#xA;    find-file-noselect(&quot;g:/example00.sml&quot; nil nil nil)&lt;br&gt;&#xA;    find-file(&quot;g:/example00.sml&quot;) &lt;br&gt;&#xA;    find-file-existing(&quot;g:/example00.sml&quot;) &lt;br&gt;&#xA;    menu-find-file-existing() &lt;br&gt;&#xA;    call-interactively(menu-find-file-existing nil nil) &lt;br&gt;&#xA;    command-execute(menu-find-file-existing) &lt;br&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I resolve this error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit : I installed sml-mode via &lt;code&gt;list-packages&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14984" LastEditorUserId="14984" LastEditDate="2017-02-20T18:09:12.377" LastActivityDate="2017-02-20T19:43:12.447" Title="How to solve &quot;Autoloading failed to define function sml-mode&quot;?" Tags="|debugging|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30899" PostTypeId="1" AcceptedAnswerId="30909" CreationDate="2017-02-20T18:49:19.293" Score="3" ViewCount="339" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I extract an &lt;code&gt;org-mode&lt;/code&gt; link label?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given an &lt;code&gt;org-mode&lt;/code&gt; &lt;a href=&quot;http://orgmode.org/manual/Internal-links.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;internal link&lt;/a&gt; with the following format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[link-target][link-label]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How do I extract &lt;code&gt;link-label&lt;/code&gt;?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to process the link &lt;em&gt;as a string&lt;/em&gt;, not interactively in an &lt;code&gt;org-mode&lt;/code&gt; buffer.  I could write a regexp to do this, but am wondering if there's a function already built in.&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2017-02-20T19:14:17.427" LastActivityDate="2017-02-20T23:59:25.390" Title="Get org-mode link label from internal link?" Tags="|org-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30900" PostTypeId="2" ParentId="30474" CreationDate="2017-02-20T18:51:45.423" Score="2" Body="&lt;p&gt;Ok, solved this one. It turns out that there was an &lt;code&gt;export PATH&lt;/code&gt; in my &lt;em&gt;&lt;strong&gt;.bashrc&lt;/strong&gt;&lt;/em&gt; (as well as &lt;em&gt;&lt;strong&gt;.bash-profile&lt;/strong&gt;&lt;/em&gt;). &lt;em&gt;&lt;strong&gt;exec-path-from-shell&lt;/strong&gt;&lt;/em&gt; doesn't like this, and only wants that export to happen in &lt;em&gt;&lt;strong&gt;.bash-profile&lt;/strong&gt;&lt;/em&gt;. This warning message gives a hint of the expectation. But I didn't realize that the package doesn't work if the condition isn't satisfied. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hth&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (emacs): You appear to be setting environment variables&#xA;  (&quot;PATH&quot;) in your .bashrc or .zshrc: those files are only read by&#xA;  interactive shells, so you should instead set environment variables in&#xA;  startup files like .bash_profile or .zshenv. Refer to your shell's man&#xA;  page for more info.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10528" LastActivityDate="2017-02-20T18:51:45.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30901" PostTypeId="2" ParentId="30894" CreationDate="2017-02-20T19:01:06.350" Score="9" Body="&lt;p&gt;The &lt;code&gt;which-function&lt;/code&gt; minor mode by default shows part of the org outline path in the mode line; you can turn it on using &lt;code&gt;M-x which-function-mode&lt;/code&gt;.  In general, &lt;code&gt;which-function&lt;/code&gt; tries to show the current function in the mode line.  It works in most languages.&lt;/p&gt;&#xA;&lt;p&gt;If you want to see the entire path, you just have to add a new function to the variable &lt;code&gt;which-func-functions&lt;/code&gt;.  The first function in this list that returns non-nil is what &lt;code&gt;which-function&lt;/code&gt; uses.  Here is a function that uses &lt;code&gt;org-get-outline-path&lt;/code&gt; to get the full path, if the current major mode is &lt;code&gt;org-mode&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-which-function ()&#xA;  (interactive)&#xA;  (when (eq major-mode 'org-mode)&#xA;    (mapconcat 'identity (org-get-outline-path t)&#xA;               &amp;quot; &amp;gt; &amp;quot;)&#xA;  ))&#xA;&#xA;&#xA;(add-to-list 'which-func-functions #'org-which-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You will quickly run out of room in your mode line, so try putting it in the header line instead.  For example, this snippet will put the current buffer name and the outline path in the header:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq header-line-format&#xA;  '(:eval&#xA;   (list&#xA;    (header-buffer-name)&#xA;    &amp;quot; &amp;quot;&#xA;    (header-function-name))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;[EDIT] Here, the fuctions &lt;code&gt;header-buffer-name&lt;/code&gt; and &lt;code&gt;header-function-name&lt;/code&gt; are the author's private functions, and defined in &lt;a href=&quot;https://emacs.stackexchange.com/a/58682&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Dqebp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Dqebp.png&quot; alt=&quot;Emacs 29.1 NEWS in org-mode, header generated by org-which-function &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="10927" LastEditDate="2024-03-22T00:54:03.053" LastActivityDate="2024-03-22T00:54:03.053" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="30902" PostTypeId="2" ParentId="30899" CreationDate="2017-02-20T19:08:45.100" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://orgmode.org/org.html#index-org_002dcopy_002dvisible-76&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;org-copy-visible&lt;/code&gt;&lt;/a&gt;, bound to &lt;kbd&gt;C-c C-x v&lt;/kbd&gt;, should do the job for you.&lt;/p&gt;&#xA;" OwnerUserId="12336" LastActivityDate="2017-02-20T19:08:45.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30903" PostTypeId="2" ParentId="30898" CreationDate="2017-02-20T19:43:12.447" Score="7" Body="&lt;p&gt;This is a problem of conflicting libraries in &lt;code&gt;load-path&lt;/code&gt;. &#xA;I think you should inspect your &lt;code&gt;load-path&lt;/code&gt; to see if you have &lt;code&gt;sml-mode&lt;/code&gt; directory in it twice. The first directory probably doesn't contain a definition for &lt;code&gt;sml-mode&lt;/code&gt; and hence Emacs fails to load it from there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do &lt;code&gt;M-x list-load-path-shadows&lt;/code&gt; to see if some &lt;code&gt;sml-mode&lt;/code&gt; like file is shadowing the original file with the right definitions. &lt;/p&gt;&#xA;" OwnerUserId="14967" LastActivityDate="2017-02-20T19:43:12.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30904" PostTypeId="1" AcceptedAnswerId="30920" CreationDate="2017-02-20T20:08:13.160" Score="6" ViewCount="243" Body="&lt;p&gt;I want to add difficulty markers to &lt;code&gt;TODO&lt;/code&gt;s similar to how priorities are added. For example, the one below is a normal task with a priority of &quot;A&quot; assigned.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO [#A] Ask at StackExchange on how to add difficulty markers&#xA;** TODO [#B] Work on adding difficulty markers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want is something like the one below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;** TODO [#A][1] Ask at StackExchange on how to add difficulty markers&#xA;** TODO [#B][9] Work on adding difficulty markers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The numbers denote how difficult the task will be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to do this? Is there a package that does something similar that I can look into?&lt;/p&gt;&#xA;" OwnerUserId="10481" LastEditorUserId="253" LastEditDate="2017-02-20T22:04:55.353" LastActivityDate="2017-02-21T08:23:34.780" Title="Adding a &quot;difficulty&quot; marker to Org TODOs" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30905" PostTypeId="1" CreationDate="2017-02-20T21:26:47.103" Score="0" ViewCount="72" Body="&lt;p&gt;Is that possible to Emacs to respect &lt;code&gt;.gitattributes&lt;/code&gt; and &lt;code&gt;.hgeol&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am again on Windows with Cygwin &lt;code&gt;emacs-w32&lt;/code&gt; and would like if Emacs honor project specific CR/LF settings for new files...&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-02-22T06:08:59.973" Title="Is that possible to Emacs to respect .gitattributes and .hgeol?" Tags="|git|mercurial|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30906" PostTypeId="1" CreationDate="2017-02-20T22:03:29.000" Score="4" ViewCount="465" Body="&lt;p&gt;It's basically &quot;What links here?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;a href=&quot;http://orgmode.org/manual/Handling-links.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org mode links&lt;/a&gt;, I'd like to be able to &lt;strong&gt;get the list of headings which contain a link to a specific heading&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Target&#xA;  :PROPERTIES:&#xA;  :ID: 509039F8-5B43-4C9B-8FA3-F37E3A2EEC10&#xA;  :END:&#xA;&#xA;* Heading containing link&#xA;&#xA;  id:509039F8-5B43-4C9B-8FA3-F37E3A2EEC10&#xA;&#xA;* Another heading containing the same link&#xA;&#xA;  id:509039F8-5B43-4C9B-8FA3-F37E3A2EEC10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the cursor is at &lt;code&gt;Target&lt;/code&gt;, I'd like to get the list of all headings that link to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Heading containing link&#xA;* Another heading containing the same link&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2775" LastEditorUserId="2775" LastEditDate="2017-02-21T22:30:27.917" LastActivityDate="2017-02-22T14:22:23.883" Title="Show all Org mode entries that contain a link to the current entry" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30909" PostTypeId="2" ParentId="30899" CreationDate="2017-02-20T23:59:25.390" Score="3" Body="&lt;p&gt;You want something like this. The regexp you want is already defined in the variable org-bracket-link-regexp.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((s &quot;[[link-target][link-label]]&quot;))&#xA;  (string-match org-bracket-link-regexp s)&#xA;  (list&#xA;   (match-string 1 s)&#xA;   (match-string 3 s)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should return a list of (&quot;link-target&quot; &quot;link-label&quot;)&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-02-20T23:59:25.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30910" PostTypeId="2" ParentId="30906" CreationDate="2017-02-21T00:17:01.977" Score="1" Body="&lt;p&gt;A different approach in a single file is below. It avoids the direct use of regular expressions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-headings-with-links ()&#xA;  (let ((tid (org-id-get)))&#xA;    (org-element-map (org-element-parse-buffer) 'link&#xA;      (lambda (link)&#xA;    (when (and (string= (org-element-property :type link) &quot;id&quot;)&#xA;           (string= (org-element-property :path link) tid))&#xA;      (save-excursion&#xA;        (goto-char (org-element-property :begin link))&#xA;        (org-get-heading)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-02-21T00:17:01.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30911" PostTypeId="5" CreationDate="2017-02-21T03:01:05.800" Score="0" Body="&lt;h3&gt;Useful links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Variables.html#Variables&quot; rel=&quot;nofollow noreferrer&quot;&gt;Variables in the Emacs manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-21T03:13:51.443" LastActivityDate="2017-02-21T03:13:51.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30912" PostTypeId="4" CreationDate="2017-02-21T03:01:05.800" Score="0" Body="for variables in Emacs Lisp, which are symbols with values. The symbol’s name is also called the variable name. Most variable names, by convention, consist of lowercase, ordinary words separated by hyphens." OwnerUserId="7045" LastEditorUserId="253" LastEditDate="2017-02-21T03:14:31.427" LastActivityDate="2017-02-21T03:14:31.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30913" PostTypeId="1" CreationDate="2017-02-21T03:19:04.697" Score="1" ViewCount="55" Body="&lt;p&gt;I have the following widget:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(widget-create 'editable-field :size 76 :format &quot;Title: %v&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I create this widget and edit its value, I can use C-j to insert new lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I restrict the widget to one line?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Runnable code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun widget-example ()&#xA;  (interactive)&#xA;  (switch-to-buffer &quot;*Widget Example*&quot;)&#xA;  (kill-all-local-variables)&#xA;  (let ((inhibit-read-only t))&#xA;    (erase-buffer))&#xA;  (remove-overlays)&#xA;&#xA;  (widget-create 'editable-field :size 76 :format &quot;Title: %v&quot;)&#xA;&#xA;  (use-local-map widget-keymap)&#xA;  (widget-setup))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-02-21T23:28:25.563" Title="How can I stop newlines from being entered in an editable-field widget?" Tags="|widget|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30914" PostTypeId="2" ParentId="30913" CreationDate="2017-02-21T03:51:02.373" Score="1" Body="&lt;p&gt;I recommend using the &lt;code&gt;:validate&lt;/code&gt; option (works on any widget type) or the &lt;code&gt;:valid-regexp&lt;/code&gt; option (for the &lt;code&gt;editable-field&lt;/code&gt; widget only) to reject inputs that you don't like. See section 5.5 of the Widget Library manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, however, that validation doesn't appear to happen automatically. It appears to be the case that you must explicitly use &lt;code&gt;(widget-apply widget :validate)&lt;/code&gt; on all of your widgets at some point. The documentation doesn't seem to state this anywhere, but I suppose it makes sense; the widget library doesn't need to make many assumptions about what you're going to do with the values the user enters, leaving that up to your own code. Since mostly the widgets are used by the customization system, it just looks like this is automatic. The &lt;code&gt;group&lt;/code&gt; widget will automatically validate its children when validated; using one could simplify your code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are, of course, a few other options. The most promising is to simply remove newlines from the value when you process the form. This is not much extra work for you, and saves the user from the cognitive overhead of remembering not to enter newlines, or of following extra directions on some fields, or of having to go back and fix up the value when they get an error. The more I consider it, the more I like this option in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility, if you're really dead-set on not letting the user enter a newline at all, is to modify the keymap used while editing the value. All widgets take a &lt;code&gt;:keymap&lt;/code&gt; argument, and &lt;code&gt;editable-field&lt;/code&gt; widgets have a special keymap that remaps &lt;code&gt;&amp;lt;RET&amp;gt;&lt;/code&gt;. You could extend that keymap to also remap &lt;code&gt;C-j&lt;/code&gt;. Note however that the user could also use &lt;code&gt;C-q C-j&lt;/code&gt; to enter a newline, and that you don't want to completely prevent them from using &lt;code&gt;C-q&lt;/code&gt;; it's far too useful. This is probably more work than it's worth.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2017-02-21T23:28:25.563" LastActivityDate="2017-02-21T23:28:25.563" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30916" PostTypeId="1" CreationDate="2017-02-21T05:59:52.533" Score="4" ViewCount="253" Body="&lt;p&gt;What is the easiest way to access files that require admin privilege in windows?&#xA;I could see similar questions &lt;a href=&quot;https://stackoverflow.com/questions/4470213/how-do-i-switch-to-admin-user-in-emacs-on-windows&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://superuser.com/questions/896122/open-file-with-emacs-as-administrator-on-windows&quot;&gt;here&lt;/a&gt;.  But I think this would be the right forum to find the best solution for this problem.&lt;/p&gt;&#xA;" OwnerUserId="11289" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-02-21T08:20:53.197" Title="What is the equivalent of /sudo:root@localhost:/ in windows?" Tags="|microsoft-windows|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30917" PostTypeId="1" AcceptedAnswerId="30918" CreationDate="2017-02-21T06:06:21.520" Score="2" ViewCount="1438" Body="&lt;p&gt;I was reading through:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bthemes/colors&quot; rel=&quot;nofollow noreferrer&quot;&gt;Spacemacs Colors Layer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because I want to get &lt;code&gt;nyan-mode&lt;/code&gt; working using the hot keys &lt;code&gt;SPC t m n&lt;/code&gt; as shown on &lt;a href=&quot;https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bthemes/colors/local/nyan-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Github&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to do this part:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;To use this configuration layer, add it to your ~/.spacemacs. You  &#xA;will need to add **colors** to the existing dotspacemacs-configuration-&#xA;layers list in this file.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However I do not understand how to enable it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where does&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default dotspacemacs-configuration-layers '(&#xA;  (colors :variables colors-enable-nyan-cat-progress-bar t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;go? I see nothing in my .spacemacs for it or am I missing how to do this completely?&lt;/p&gt;&#xA;" OwnerUserId="14956" LastEditorUserId="13326" LastEditDate="2017-02-21T15:24:29.630" LastActivityDate="2017-02-21T15:24:29.630" Title="enable nyan-mode spacemacs?" Tags="|spacemacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30918" PostTypeId="2" ParentId="30917" CreationDate="2017-02-21T07:55:11.907" Score="2" Body="&lt;p&gt;Please (re)-read the &lt;a href=&quot;http://spacemacs.org/doc/FAQ.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;FAQ&lt;/a&gt; and &lt;a href=&quot;http://spacemacs.org/doc/DOCUMENTATION.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;DOCUMENTATION&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to add custom layers look for the following lines in your &lt;code&gt;.spacemacs&lt;/code&gt; configuration file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun dotspacemacs/layers()&#xA;  ...&#xA;    (setq-default&#xA;    ...&#xA;        dotspacemacs-configuration-layers&#xA;        '(&#xA;         ...&#xA;         ;; git&#xA;         ;; company&#xA;         ;; PLACE NEW CONFIGURATION LAYER HERE&#xA;         (colors: variables colors-enable-nyan-cat-progress-bar t)&#xA;     ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that there could be text in between hence the ellipses &quot;...&quot;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="13326" LastEditDate="2017-02-21T08:01:58.970" LastActivityDate="2017-02-21T08:01:58.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30919" PostTypeId="2" ParentId="30916" CreationDate="2017-02-21T08:20:53.197" Score="5" Body="&lt;p&gt;For Tramp, this is not available. One would need to write a new package tramp-runas.el or tramp-elevate.el, which implements it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I'm not using MS Windows myself, it is unlikely that I'll implement this. However, contributions are welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm the Tramp maintainer)&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-02-21T08:20:53.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30920" PostTypeId="2" ParentId="30904" CreationDate="2017-02-21T08:23:34.780" Score="4" Body="&lt;p&gt;You may be interested in looking at &lt;a href=&quot;http://orgmode.org/manual/Effort-estimates.html&quot; rel=&quot;noreferrer&quot;&gt;Org-Mode Effort Estimates&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These allow you to attach &lt;em&gt;time&lt;/em&gt; estimates of how long you anticipate that certain tasks will take. If you also &lt;code&gt;org-clock&lt;/code&gt; your tasks, you can then compare your &lt;em&gt;Effort Estimates&lt;/em&gt; to your actual working time, and hopefully improve how accurately you schedule your tasks going forward.&lt;/p&gt;&#xA;" OwnerUserId="13326" LastActivityDate="2017-02-21T08:23:34.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30921" PostTypeId="1" CreationDate="2017-02-21T08:30:20.943" Score="0" ViewCount="96" Body="&lt;p&gt;How can I disable &lt;code&gt;and&lt;/code&gt; / &lt;code&gt;or&lt;/code&gt; keywords substitution in Python mode in Emacs 25.1?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cygwin &lt;code&gt;emacs-w32&lt;/code&gt; can't find appropriate fonts in Windows (for &lt;code&gt;∧&lt;/code&gt; and &lt;code&gt;∨&lt;/code&gt;)...&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-02-21T08:43:43.027" Title="Disable and / or keywords substitution in Python mode in Emacs 25.1" Tags="|python|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30922" PostTypeId="2" ParentId="30921" CreationDate="2017-02-21T08:43:43.027" Score="1" Body="&lt;p&gt;Unfortunately this doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/python-mode-hook ()&#xA;  (when (eq window-system 'w32)&#xA;    (setq prettify-symbols-alist nil)))&#xA;(add-hook 'python-mode-hook 'my/python-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/python-mode-hook ()&#xA;  (when (and (eq window-system 'w32) (fboundp 'prettify-symbols-mode))&#xA;    (prettify-symbols-mode -1)))&#xA;(add-hook 'python-mode-hook 'my/python-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem because I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-prettify-symbols-mode 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that I set 2 years ago...&lt;/p&gt;&#xA;" OwnerUserId="947" LastActivityDate="2017-02-21T08:43:43.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30923" PostTypeId="1" AcceptedAnswerId="30936" CreationDate="2017-02-21T10:03:19.673" Score="2" ViewCount="403" Body="&lt;p&gt;Js2-mode is showing error when there are not registered globals. I've try this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun js2-hook ()&#xA;  ;; setting symbols instead of strings also don't work&#xA;  (dolist (global '(&quot;angular&quot; &quot;$&quot; &quot;jQuery&quot; &quot;console&quot; &quot;_&quot; &quot;window&quot; &quot;setTimeout&quot;))&#xA;    (add-to-list 'js2-additional-externs global)))&#xA;&#xA;(add-hook 'js2-mode-hook 'js2-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this don't work. How can I set globals, setting js2-additional-externs directly don't work also, because describe-variable says that this variable is automatically local when set.&lt;/p&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="10438" LastEditDate="2017-02-21T10:19:10.183" LastActivityDate="2017-02-21T20:29:00.253" Title="How to set globals for js2-mode?" Tags="|js2-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30926" PostTypeId="5" CreationDate="2017-02-21T13:49:26.770" Score="0" Body="&lt;h3&gt;Useful Link:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/ComintMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs comint-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-21T16:20:43.033" LastActivityDate="2017-02-21T16:20:43.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30927" PostTypeId="4" CreationDate="2017-02-21T13:49:26.770" Score="0" Body="is the command interpreter mode for interacting with external processes. Using the base comint-mode, Emacs provides derived modes for specific process-in-a-buffer. Common ones are shell, lisp, scheme, cmutex (for TeX and LaTeX). Support for programming languages with REPL interfaces, such as Haskell, are also derived from comint-mode. Such buffers share the same key bindings, shortcuts, and history manipulation facilities." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-21T16:21:05.160" LastActivityDate="2017-02-21T16:21:05.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30928" PostTypeId="1" AcceptedAnswerId="30953" CreationDate="2017-02-21T14:42:30.717" Score="2" ViewCount="450" Body="&lt;p&gt;I am trying to be able to control where a new window should go, when I use &lt;code&gt;helm-find-files&lt;/code&gt;. I am aware of &lt;code&gt;split-height-threshold&lt;/code&gt; and &lt;code&gt;split-width-threshold&lt;/code&gt;, and it works if I set them to behave appropriately (&lt;code&gt;setq&lt;/code&gt; outside the defuns). But what I am trying to do is set them temporarily before calling the function that actually splits the window (here, &lt;code&gt;helm-ff-run-switch-other-window&lt;/code&gt;). However, even though these 2 variables have the correct values (using &lt;code&gt;let&lt;/code&gt;), the functions don't seem to do anything. Perhaps the code will explain it better:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/helm-switch-other-window-horizontally ()&#xA;  (interactive)&#xA;  (let ((split-height-threshold 0)&#xA;        (split-width-threshold nil))&#xA;    (helm-ff-run-switch-other-window)))&#xA;&#xA;&#xA;(defun my/helm-switch-other-window-vertically ()&#xA;  (interactive)&#xA;  (let ((split-height-threshold nil)&#xA;        (split-width-threshold 0))&#xA;    (helm-ff-run-switch-other-window)))&#xA;&#xA;(define-key helm-find-files-map (kbd &quot;C-c s&quot;) 'my/helm-switch-other-window-horizontally)&#xA;(define-key helm-find-files-map (kbd &quot;C-c v&quot;) 'my/helm-switch-other-window-vertically)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess I'm doing something wrong with variable binding?&lt;/p&gt;&#xA;" OwnerUserId="14525" LastEditorUserId="105" LastEditDate="2017-02-21T15:27:21.947" LastActivityDate="2020-11-04T14:10:56.543" Title="Control window splitting while opening on files with helm" Tags="|helm|window-splitting|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30930" PostTypeId="2" ParentId="3762" CreationDate="2017-02-21T16:35:01.200" Score="1" Body="&lt;p&gt;You can just add the mapping to the comment style list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'c-doc-comment-style '(c++-mode . javadoc))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is more portable and just extends the list instead of replacing it.&lt;/p&gt;&#xA;" OwnerUserId="9248" LastEditorUserId="9248" LastEditDate="2017-02-28T13:40:48.463" LastActivityDate="2017-02-28T13:40:48.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30931" PostTypeId="1" AcceptedAnswerId="30937" CreationDate="2017-02-21T18:17:04.640" Score="3" ViewCount="1274" Body="&lt;p&gt;I have an org file that I use to create a pdf with &lt;code&gt;org-beamer-export-to-pdf&lt;/code&gt;. The file has things like this at the top:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE: Training&#xA;#+OPTIONS: H:2 toc:1 num:t&#xA;#+LATEX_CLASS: beamer&#xA;#+LATEX_CLASS_OPTIONS: [presentation]&#xA;#+BEAMER_THEME: Montpellier&#xA;&#xA;# No Navigation Symbols&#xA;#+LaTeX:\setbeamercovered{transparent}&#xA;#+LaTeX:\setbeamertemplate{navigation symbols}{} %remove navigation symbols&#xA;#+LaTeX:\setbeamercovered{invisible} %No transparent layers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Along with some color configurations, too. These changes (for exmaple, getting rid of the navigation symobls) work on all the body slides. However nothing I do affects the appearance of the Title Page or the Table of Contents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even explicitly setting something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LaTeX:\setbeamercolor*{title page}{fg=mycolor, bg=myothercolor}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;has no effect on the title page. This holds true for &lt;code&gt;titlelike&lt;/code&gt; &lt;code&gt;title&lt;/code&gt; &lt;code&gt;subtitle&lt;/code&gt; &lt;code&gt;author&lt;/code&gt; or &lt;code&gt;section in toc&lt;/code&gt; or &lt;code&gt;subsection in toc&lt;/code&gt; and so forth. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why can't I configure the 1st two slides of my presentation? &lt;/p&gt;&#xA;" OwnerUserId="12467" LastActivityDate="2017-02-21T20:33:24.827" Title="org-mode Beamer export: can't change format of title page and TOC" Tags="|org-mode|org-export|latex|pdf|beamer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30932" PostTypeId="5" CreationDate="2017-02-21T18:40:23.937" Score="0" Body="&lt;h3&gt;Useful links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Document-View.html#Document-View&quot; rel=&quot;nofollow noreferrer&quot;&gt;PDF Document Viewing in Emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/politza/pdf-tools&quot; rel=&quot;nofollow noreferrer&quot;&gt;PDF Tools, a potential replacement for docview&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Portable_Document_Format&quot; rel=&quot;nofollow noreferrer&quot;&gt;PDF Format&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="253" LastEditDate="2017-02-21T19:13:49.717" LastActivityDate="2017-02-21T19:13:49.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30933" PostTypeId="4" CreationDate="2017-02-21T18:40:23.937" Score="0" Body="is for PDF format. Emacs supports creating and viewing PDF files. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-21T19:12:09.803" LastActivityDate="2017-02-21T19:12:09.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30934" PostTypeId="2" ParentId="30931" CreationDate="2017-02-21T18:45:04.317" Score="0" Body="&lt;p&gt;Did you try the &lt;code&gt;\documentclass[usepdftitle=false]{beamer}&lt;/code&gt; option with &lt;code&gt;#+LATEX_CLASS:&lt;/code&gt;? That would at least allow for customizing the title page to your liking, possibly.&lt;/p&gt;&#xA;" OwnerUserId="11660" LastActivityDate="2017-02-21T18:45:04.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30936" PostTypeId="2" ParentId="30923" CreationDate="2017-02-21T20:29:00.253" Score="4" Body="&lt;p&gt;It seems that the variable you want to set is &lt;code&gt;js2-global-externs&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;js2-additional-externs&lt;/code&gt; is intended for setting globals on per-buffer basis, not for all buffers with &lt;code&gt;js2-mode&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2017-02-21T20:29:00.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30937" PostTypeId="2" ParentId="30931" CreationDate="2017-02-21T20:33:24.827" Score="7" Body="&lt;p&gt;Instead of &lt;code&gt;#+LaTeX:&lt;/code&gt; you should try &lt;code&gt;#+BEAMER_HEADER:&lt;/code&gt; for all beamer specific configuration lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;code&gt;#+BEAMER_HEADER: \setbeamertemplate{navigation symbols}{}&lt;/code&gt; removes navigation symbols in all slides including title page and toc.&lt;/p&gt;&#xA;" OwnerUserId="9245" LastActivityDate="2017-02-21T20:33:24.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30938" PostTypeId="1" CreationDate="2017-02-21T22:12:45.630" Score="1" ViewCount="72" Body="&lt;p&gt;All I want is to just quit entering patterns and go back to searching a different directory. C-g quits the whole search process. &lt;/p&gt;&#xA;" OwnerUserId="14999" LastEditorUserId="105" LastEditDate="2017-02-21T23:22:14.900" LastActivityDate="2017-02-23T12:28:17.023" Title="In helm-find-files, how do you quit entering pattern and go back to selecting files?" Tags="|helm|search|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30939" PostTypeId="5" CreationDate="2017-02-21T22:37:36.713" Score="0" Body="&lt;p&gt;Manipulating strings of characters in Emacs Lisp.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Strings in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html#Registers&quot; rel=&quot;nofollow noreferrer&quot;&gt;registers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Strings in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Search.html#Search&quot; rel=&quot;nofollow noreferrer&quot;&gt;searches&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Strings in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Incremental-Search.html#Incremental-Search&quot; rel=&quot;nofollow noreferrer&quot;&gt;incremental searches&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Strings in &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Strings-and-Characters.html#Strings-and-Characters&quot; rel=&quot;nofollow noreferrer&quot;&gt;Elisp programming&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="25" LastEditDate="2017-02-22T17:16:14.683" LastActivityDate="2017-02-22T17:16:14.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30940" PostTypeId="4" CreationDate="2017-02-21T22:37:36.713" Score="0" Body="A string is a sequence of characters, which can be user data or used internally in Emacs. For example, string to search, replace, save in a register and so on, file name, etc." OwnerUserId="7045" LastEditorUserId="25" LastEditDate="2017-02-22T17:18:12.547" LastActivityDate="2017-02-22T17:18:12.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30941" PostTypeId="2" ParentId="30938" CreationDate="2017-02-22T01:12:46.640" Score="-1" Body="&lt;p&gt;Answering myself after going through the source:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-resume-previous-session-after-quit&lt;/code&gt; (&lt;code&gt;C-x b&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="15001" LastEditorUserId="25" LastEditDate="2017-02-23T12:28:17.023" LastActivityDate="2017-02-23T12:28:17.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30942" PostTypeId="1" AcceptedAnswerId="30943" CreationDate="2017-02-22T04:11:16.720" Score="5" ViewCount="815" Body="&lt;p&gt;I want to use &lt;kbd&gt;C-u M-:&lt;/kbd&gt;, then &lt;code&gt;(format-time-string &quot;%m/%d/%Y&quot;)&lt;/code&gt; to insert a customized date string. But it is inserted into the current buffer with double quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any trick to remove these quotes?&lt;/p&gt;&#xA;" OwnerUserId="12018" LastEditorUserId="25" LastEditDate="2017-02-22T10:52:06.117" LastActivityDate="2017-02-22T18:13:28.627" Title="Insert a string from eval-expression without the quotes" Tags="|insert|eval-expression|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30943" PostTypeId="2" ParentId="30942" CreationDate="2017-02-22T05:11:01.410" Score="5" Body="&lt;p&gt;Rather than ask &lt;kbd&gt;M-:&lt;/kbd&gt; to insert the output of the Elisp code, just write the Elisp code that inserts the text you want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;code&gt;M-: (insert (format-time-string &quot;%m/%d/%Y&quot;)) RET&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-02-22T05:11:01.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30944" PostTypeId="2" ParentId="30906" CreationDate="2017-02-22T05:37:11.577" Score="0" Body="&lt;p&gt;I ended up simply using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun what-links-here ()&#xA;  (interactive)&#xA;  (let ((id (org-entry-get nil &quot;ID&quot;)))&#xA;    (if (&amp;gt; (length id) 0)&#xA;        (org-search-view nil (concat &quot;id:&quot; id))&#xA;      (message &quot;No ID - nothing can be linking here&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2775" LastEditorUserId="1979" LastEditDate="2017-02-22T14:22:23.883" LastActivityDate="2017-02-22T14:22:23.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30945" PostTypeId="2" ParentId="30905" CreationDate="2017-02-22T06:08:59.973" Score="2" Body="&lt;p&gt;Not directly an answer to your question, but I would try out editorconfig:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/editorconfig/editorconfig-emacs#readme&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/editorconfig/editorconfig-emacs#readme&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will allow you to add a config file which will set line endings, line length, indent style, and more and have it respected by every editor with a plugin.&lt;/p&gt;&#xA;" OwnerUserId="9361" LastActivityDate="2017-02-22T06:08:59.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30946" PostTypeId="2" ParentId="17662" CreationDate="2017-02-22T06:13:40.937" Score="0" Body="&lt;p&gt;At some point, there was an org update which fixed this issue. If you run into this issue, I would reccomend pulling the latest org from elpa (9.x), which resolved this issue completely for me. On 8.10.x, this issue is reduced, but still happens occasionally.&lt;/p&gt;&#xA;" OwnerUserId="9361" LastActivityDate="2017-02-22T06:13:40.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30947" PostTypeId="2" ParentId="30928" CreationDate="2017-02-22T10:08:49.753" Score="0" Body="&lt;p&gt;The variables in let can not be accessed by functions outside.&#xA;&lt;code&gt;setq-local split-height-threshold nil&lt;/code&gt; should work.&lt;/p&gt;&#xA;" OwnerUserId="14959" LastActivityDate="2017-02-22T10:08:49.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30950" PostTypeId="2" ParentId="30857" CreationDate="2017-02-22T14:05:39.847" Score="0" Body="&lt;p&gt;Try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src clojure :results value&#xA;(+ 2 2)&#xA;#+end_src clojure&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which prints the returned value instead of output.&lt;/p&gt;&#xA;" OwnerUserId="13911" LastActivityDate="2017-02-22T14:05:39.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30951" PostTypeId="2" ParentId="27938" CreationDate="2017-02-22T15:30:46.753" Score="1" Body="&lt;p&gt;Check the answers to the following question where they discuss this in detail:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/9311538/how-to-make-non-breaking-spaces-ties-in-org-mode-that-exports-properly-to-late&quot;&gt;How to make non-breaking spaces (ties) in Org-mode that exports properly to LaTeX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They show four different ways to insert a literal space:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;e.g.~example&#xA;&#xA;e.g. example&#xA;&#xA;#+BEGIN_LaTeX&#xA;  e.g.~example&#xA;#+END_LaTeX&#xA;&#xA;e.g. example&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I had the exact same problem handling the space between &lt;em&gt;Mr.&lt;/em&gt; and the lastname. What worked for me was the suggestion on &lt;a href=&quot;https://stackoverflow.com/questions/9311538/how-to-make-non-breaking-spaces-ties-in-org-mode-that-exports-properly-to-late#comment36588321_21936300&quot;&gt;this comment&lt;/a&gt;, because I consider it to be the least visually intrusive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just insert &lt;strong&gt;&lt;code&gt;C-x 8 SPC&lt;/code&gt;&lt;/strong&gt; where I want a literal space.&lt;/p&gt;&#xA;" OwnerUserId="15006" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-02-22T19:03:52.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30952" PostTypeId="2" ParentId="30895" CreationDate="2017-02-22T16:25:14.333" Score="1" Body="&lt;p&gt;For my settings I have the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the shell script:&lt;br&gt;&#xA;&lt;code&gt;#!/bin/sh&#xA;/Applications/Emacs.app/Contents/MacOS/Emacs &quot;$@&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;.zshrc&lt;/code&gt;: &lt;code&gt;export EDITOR=&quot;/usr/local/bin/emacsclient&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;code&gt;init.el&lt;/code&gt;: &lt;code&gt;(global-git-commit-mode t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With these settings any git work from the command line moves to the GUI emacs. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2017-02-22T16:25:14.333" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30953" PostTypeId="2" ParentId="30928" CreationDate="2017-02-22T16:43:40.780" Score="0" Body="&lt;p&gt;The following is based on your own code, which works as expected from here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/helm-switch-other-window-horizontally ()&#xA;  (interactive)&#xA;  (with-helm-alive-p&#xA;    (helm-exit-and-execute-action&#xA;     (lambda (candidate)&#xA;       (let ((split-height-threshold 0)&#xA;             (split-width-threshold nil))&#xA;         (helm-find-files-other-window candidate))))))&#xA;&#xA;(defun my/helm-switch-other-window-vertically ()&#xA;  (interactive)&#xA;  (with-helm-alive-p&#xA;    (helm-exit-and-execute-action&#xA;     (lambda (candidate)&#xA;       (let ((split-height-threshold nil)&#xA;             (split-width-threshold 0))&#xA;         (helm-find-files-other-window candidate))))))&#xA;&#xA;(define-key helm-find-files-map (kbd &quot;C-c s&quot;) 'my/helm-switch-other-window-horizontally)&#xA;(define-key helm-find-files-map (kbd &quot;C-c v&quot;) 'my/helm-switch-other-window-vertically)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I don't have answer on why your let-binding don't work since I am not familiar with the internal of helm. Maybe the following may provide a clue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar x nil)&#xA;(defun foo ()&#xA;  (message &quot;-&amp;gt; %s&quot; x))&#xA;&#xA;(let ((x 42))&#xA;  (foo))&#xA;;; Print &quot;-&amp;gt; 42&quot;&#xA;&#xA;(let ((x 42))&#xA;  (run-at-time nil nil 'foo))&#xA;;; Print &quot;-&amp;gt; nil&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as you can see let-binding &lt;code&gt;x&lt;/code&gt; doesn't work for &lt;code&gt;run-at-time&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastEditorUserId="3889" LastEditDate="2017-02-23T04:36:08.087" LastActivityDate="2017-02-23T04:36:08.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30954" PostTypeId="5" CreationDate="2017-02-22T17:27:42.183" Score="0" Body="&lt;h3&gt;Useful link:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Highlight-Interactively.html#Highlight-Interactively&quot; rel=&quot;nofollow noreferrer&quot;&gt;Interactive highlighting&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-23T17:15:11.473" LastActivityDate="2017-02-23T17:15:11.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30955" PostTypeId="4" CreationDate="2017-02-22T17:27:42.183" Score="0" Body="is for changes to fonts and colors for highlighting text. Emacs uses highlighting extensively to set apart portions of visible text in a buffer. Highlighting can also apply to dynamic text during search and replace operations, syntax highlighting in programming modes, and for alerts for errors during debugging." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-23T15:15:10.350" LastActivityDate="2017-02-23T15:15:10.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30956" PostTypeId="5" CreationDate="2017-02-22T17:37:16.000" Score="0" Body="&lt;h3&gt;Useful link:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Byte-Compilation.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Byte compilation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-23T15:14:32.980" LastActivityDate="2017-02-23T15:14:32.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30957" PostTypeId="4" CreationDate="2017-02-22T17:37:16.000" Score="0" Body="is for the Emacs Lisp compiler in Emacs that compiles lisp code to byte-code for faster execution compared to uncompiled lisp code. Byte-compiled code is read by the byte-code interpreter." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-23T00:46:57.140" LastActivityDate="2017-02-23T00:46:57.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30958" PostTypeId="5" CreationDate="2017-02-22T17:41:31.813" Score="0" Body="&lt;p&gt;Use separate tags for &lt;a href=&quot;/questions/tagged/association-lists&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;association-lists&amp;#39;&quot; rel=&quot;tag&quot;&gt;association-lists&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/property-lists&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;property-lists&amp;#39;&quot; rel=&quot;tag&quot;&gt;property-lists&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs provides additional functions for using &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sets-And-Lists.html#Sets-And-Lists&quot; rel=&quot;nofollow noreferrer&quot;&gt;lists as sets&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs Lisp extends the basic &lt;a href=&quot;/questions/tagged/list&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;list&amp;#39;&quot; rel=&quot;tag&quot;&gt;list&lt;/a&gt; structure to more complex &lt;a href=&quot;/questions/tagged/data-structures&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;data-structures&amp;#39;&quot; rel=&quot;tag&quot;&gt;data-structures&lt;/a&gt;, such as &lt;a href=&quot;/questions/tagged/sequences&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;sequences&amp;#39;&quot; rel=&quot;tag&quot;&gt;sequences&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Lists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lists&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-25T18:26:15.763" LastActivityDate="2017-02-25T18:26:15.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30959" PostTypeId="4" CreationDate="2017-02-22T17:41:31.813" Score="0" Body="is for the list object in Lisp programming. A list represents a sequence of zero or more elements. Emacs Lisp relies extensively on the list data structure; it is a fundamental building block. Emacs provides many facilities for building, modifying, extending, and efficiently handling list data structures. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-27T16:44:49.943" LastActivityDate="2017-02-27T16:44:49.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30960" PostTypeId="2" ParentId="30942" CreationDate="2017-02-22T18:13:28.627" Score="0" Body="&lt;p&gt;I think you should not change &lt;kbd&gt;M-:&lt;/kbd&gt; for this. I have setup &lt;kbd&gt;C-c +&lt;/kbd&gt; to call the &lt;code&gt;vicarie/eval-replace-last-sexp&lt;/code&gt; defined below. So, I just type &lt;code&gt;(format-time-string &quot;%Y/%m/%d&quot;)&lt;/code&gt; and do &lt;code&gt;C-c +&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vicarie/eval-last-sexp-and-do (f)&#xA;  &quot;Eval the last sexp and call F on its value.&quot;&#xA;  (let ((standard-output (current-buffer))&#xA;        (value (eval-last-sexp nil)))&#xA;    (funcall f value)))&#xA;&#xA;&#xA;(defun vicarie/eval-print-last-sexp ()&#xA;    &quot;Evaluate and print the last sexp on the same line.&quot;&#xA;  (interactive)&#xA;  (vicarie/eval-last-sexp-and-do (lambda (value)&#xA;                                   (insert (format &quot; (= %s ) &quot; value)))))&#xA;&#xA;(defun vicarie/eval-replace-last-sexp ()&#xA;  &quot;Evaluate and replace last sexp with its value.&quot;&#xA;  (interactive)&#xA;  (vicarie/eval-last-sexp-and-do (lambda (value)&#xA;                                   (backward-kill-sexp)&#xA;                                   (insert (format &quot;%s&quot; value)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14967" LastActivityDate="2017-02-22T18:13:28.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30961" PostTypeId="1" CreationDate="2017-02-22T21:12:47.740" Score="1" ViewCount="410" Body="&lt;p&gt;I like to use &lt;code&gt;ido&lt;/code&gt; for completing file paths and &lt;code&gt;helm&lt;/code&gt; for all other things. I have tried setting &lt;code&gt;magit-completing-read-function&lt;/code&gt; to &lt;code&gt;magit-ido-completing-read&lt;/code&gt;. This doesn't change &lt;code&gt;magit-status&lt;/code&gt; behaviour which calls &lt;code&gt;read-directory-name&lt;/code&gt;. Here is what I have set for &lt;code&gt;ido&lt;/code&gt; and &lt;code&gt;helm&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package ido&#xA;  :doc &quot;I like `ido' for file paths' completion. Currently, the&#xA;  vector syntax [remap ..] is broken and using strings there is a&#xA;  workaround: https://github.com/jwiegley/use-package/issues/166&quot;&#xA;  :ensure t&#xA;  :bind ((&quot;&amp;lt;remap&amp;gt; &amp;lt;read-file-name&amp;gt;&quot; . ido-read-file-name)&#xA;         (&quot;&amp;lt;remap&amp;gt; &amp;lt;read-directory-name&amp;gt;&quot; . ido-read-directory-name))&#xA;  :config&#xA;  (ido-mode 1)&#xA;  (setq ido-enable-flex-matching t&#xA;        ido-auto-merge-work-directories-length -1&#xA;        ido-save-directory-list-file (expand-file-name &quot;ido.last&quot;&#xA;                                                       temp-files-directory)&#xA;        ido-ignore-buffers '(&quot;\\` &quot;  &quot;^#.*&quot; &quot;.*freenode\.net.*&quot;&#xA;                             &quot;.*irc\.slack\.com.*&quot; &quot;\\*helm.*&quot;)&#xA;        ido-decorations '(&quot;\n-&amp;gt; &quot; &quot;&quot; &quot;\n   &quot; &quot;\n   ...&quot; &quot;[&quot; &quot;]&quot; &quot; [No match]&quot;&#xA;                          &quot; [Matched]&quot; &quot; [Not readable]&quot; &quot; [Too big]&quot;&#xA;                          &quot; [Confirm]&quot;)))&#xA;&#xA;(use-package helm&#xA;  :doc &quot;Helm for everything except file paths.&quot;&#xA;  :ensure t&#xA;  :diminish helm-mode&#xA;  :bind ((&quot;M-x&quot; . helm-M-x)&#xA;         (&quot;M-y&quot; . helm-show-kill-ring)&#xA;         (&quot;C-. C-r&quot; . helm-grep-it))&#xA;&#xA;  :config&#xA;  (helm-mode 1)&#xA;&#xA;  ;; For some reason, this doesn't work. For example, `magit-status'&#xA;  ;; always uses `helm' for `read-file-name'.&#xA;  (add-to-list 'helm-completing-read-handlers-alist&#xA;               '(find-file . ido))&#xA;  (add-to-list 'helm-completing-read-handlers-alist&#xA;               '(dired . ido))&#xA;  (add-to-list 'helm-completing-read-handlers-alist&#xA;               '(read-file-name . ido-read-file-name)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14967" LastActivityDate="2017-02-24T18:47:57.403" Title="Using ido completion for selecting a repository for magit" Tags="|helm|magit|ido|completing-read|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30962" PostTypeId="1" CreationDate="2017-02-22T21:20:52.820" Score="2" ViewCount="393" Body="&lt;p&gt;Is it possible to define multi-character pairs (like LaTeX displayed equation pair &lt;code&gt;\[ ... \]&lt;/code&gt; or markdown bold &lt;code&gt;** ... **&lt;/code&gt;) for electric-pair-mode?&lt;/p&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="2788" LastEditDate="2017-07-23T18:18:30.570" LastActivityDate="2018-04-19T22:42:07.643" Title="Is it possible to define multi-character pair for electric-pair-mode?" Tags="|electric-pair-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30963" PostTypeId="1" AcceptedAnswerId="30965" CreationDate="2017-02-22T23:39:02.023" Score="0" ViewCount="752" Body="&lt;p&gt;I see variable and function names in Info pages rendered with a different font in Emacs recently, how can I change this font?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SfBQL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SfBQL.png&quot; alt=&quot;Sample Image&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here ^ &lt;code&gt;this-comamnd&lt;/code&gt; and &lt;code&gt;last-command&lt;/code&gt; are in a font. I would like to customize this font. I think this same font is used in &lt;code&gt;eww&lt;/code&gt; and I find it ugly, eww.&lt;/p&gt;&#xA;" OwnerUserId="14967" LastActivityDate="2017-02-22T23:48:02.120" Title="Changing font of non-monospace text in Emacs" Tags="|fonts|font-lock|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30964" PostTypeId="1" CreationDate="2017-02-22T23:47:02.970" Score="6" ViewCount="137" Body="&lt;p&gt;I often have long-running processes in comint shells (e.g. SQL or fitting statistical models, both usually via an R/ESS shell).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While they're running I navigate away and do something in another buffer, and try to remember to check-back periodically. I often check-back too soon, and then get distracted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be ideal if I could write a function to trigger an informative system notification using notifications.el, whenever a process left running in a comint buffer completed (for any process, which, say, had already taken longer than 90 seconds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I write such a function, to produce a system-notification such-as &quot;A process in [buffer-name] has completed.&quot;?&lt;/p&gt;&#xA;" OwnerUserId="15016" LastEditorUserId="105" LastEditDate="2017-02-23T00:28:33.280" LastActivityDate="2017-02-23T00:28:33.280" Title="Return System Notification When Long-running Comint Process Completes?" Tags="|ess|process|comint|notifications|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30965" PostTypeId="2" ParentId="30963" CreationDate="2017-02-22T23:48:02.120" Score="2" Body="&lt;p&gt;Put your text cursor on that text, then use &lt;code&gt;C-u&lt;/code&gt; &lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;=&lt;/code&gt; (&lt;code&gt;what-cursor-position&lt;/code&gt;) to see what face it's using. I believe it's using &lt;code&gt;Info-quoted&lt;/code&gt; in this instance. You can then &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;customize-face&lt;/code&gt; to change it.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-02-22T23:48:02.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30966" PostTypeId="2" ParentId="30962" CreationDate="2017-02-23T00:15:12.210" Score="1" Body="&lt;p&gt;Looking at the source code for the minor-mode, I couldn't find any way of doing it. But if you really want to implement it for multi-char strings, you can write your own function and add it to &lt;code&gt;post-self-insert-hook&lt;/code&gt;. This function would be called every time an self-inserting character is typed in the buffer, i.e. characters that you care about here. To see the last character you typed, use the value of the variable &lt;code&gt;last-command-event&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a very fragile implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar star-state :no-stars)&#xA;(defun star-electric ()&#xA;  (cond&#xA;   ((and (eq this-command 'self-insert-command)&#xA;         (eq last-command-event ?*)&#xA;         (eq star-state :no-stars))&#xA;    (setq star-state :one-beg-star))&#xA;   ((and (eq this-command 'self-insert-command)&#xA;         (eq last-command-event ?*)&#xA;         (eq star-state :one-beg-star))&#xA;    (progn (insert &quot;**&quot;)&#xA;           (backward-char 2)&#xA;           (setq star-state :two-beg-stars)))&#xA;   ((and (eq this-command 'self-insert-command)&#xA;         (eq last-command-event ?*)&#xA;         (eq star-state :two-beg-stars))&#xA;    (progn &#xA;      (setq star-state :one-end-star)&#xA;      (when (looking-at &quot;\\s-*\\*&quot;)&#xA;        (delete-char -1)&#xA;        (search-forward &quot;*&quot;))))&#xA;&#xA;    ((and (eq this-command 'self-insert-command)&#xA;          (eq last-command 'self-insert-command)&#xA;          (eq last-command-event ?*)&#xA;          (eq star-state :one-end-star))&#xA;     (delete-char -1)&#xA;     (forward-char 1)&#xA;     (setq star-state :no-stars))))&#xA;&#xA;(add-hook 'post-self-insert-hook 'star-electric)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14967" LastEditorUserId="105" LastEditDate="2017-02-23T00:30:17.083" LastActivityDate="2017-02-23T00:30:17.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30967" PostTypeId="2" ParentId="30895" CreationDate="2017-02-23T01:08:30.650" Score="1" Body="&lt;p&gt;Just set your EDITOR to run &lt;code&gt;emacsclient -a &quot;&quot; -c&lt;/code&gt; (yours will be at &lt;code&gt;/Applications/Emacs.app/Contents/MacOS/bin/emacsclient&lt;/code&gt;, I personally use some symbolic links to make life easier). Problem solved.  The &lt;code&gt;global-git-commit-mode&lt;/code&gt; is nice but not necessary.  When you're done editing the message, save and &lt;code&gt;C-x #&lt;/code&gt; to close the buffer and stop the emacsclient process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;'-a &quot;&quot;'&lt;/code&gt; option to emacsclient will cause a new emacs in daemon mode to be started if it's not already.  The &lt;code&gt;-c&lt;/code&gt; option opens up a new GUI frame, otherwise if you didn't have one open already it would open up a terminal frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you haven't already, you should look into &lt;code&gt;magit&lt;/code&gt;. No finer integration between git and Emacs exists.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-02-23T01:08:30.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30968" PostTypeId="1" CreationDate="2017-02-23T02:07:40.553" Score="3" ViewCount="1150" Body="&lt;p&gt;How can I display file size in MB or KB in the mode line? I have the icon for  encoding setting, title of the buffer, etc but have no file size in there. &lt;/p&gt;&#xA;" OwnerUserId="10707" LastActivityDate="2017-02-23T06:23:41.943" Title="How to display file size in the mode line" Tags="|mode-line|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30969" PostTypeId="2" ParentId="30968" CreationDate="2017-02-23T02:38:13.040" Score="4" Body="&lt;p&gt;Sure, just run &lt;code&gt;M-x size-indication-mode&lt;/code&gt;. See section 14.18 of the Emacs manual for other things you can do.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-23T02:38:13.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30970" PostTypeId="2" ParentId="30082" CreationDate="2017-02-23T03:36:29.280" Score="12" Body="&lt;p&gt;If you don't want to get a 25.2 rc, you can apply the bug fix by adding this to your init.el file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(with-eval-after-load 'python&#xA;  (defun python-shell-completion-native-try ()&#xA;    &quot;Return non-nil if can trigger native completion.&quot;&#xA;    (let ((python-shell-completion-native-enable t)&#xA;          (python-shell-completion-native-output-timeout&#xA;           python-shell-completion-native-try-output-timeout))&#xA;      (python-shell-completion-native-get-completions&#xA;       (get-buffer-process (current-buffer))&#xA;       nil &quot;_&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25753#44&quot; rel=&quot;noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25753#44&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-02-23T03:36:29.280" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30972" PostTypeId="2" ParentId="30968" CreationDate="2017-02-23T06:23:41.943" Score="1" Body="&lt;p&gt;Or use mode-line-format &lt;code&gt;%-constructs&lt;/code&gt; (&lt;code&gt;%I&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2017-02-23T06:23:41.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30973" PostTypeId="1" AcceptedAnswerId="30978" CreationDate="2017-02-23T10:17:50.350" Score="5" ViewCount="370" Body="&lt;p&gt;I'm keeping my config-files in a git repository to use it on multiple different machines. I'm using the emacs package manager, but I &lt;em&gt;don't&lt;/em&gt; want to add the packages to git, because which packages have to be available differs from machine to machint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short question: which folders and files do I have to exclude from the repository?&lt;/p&gt;&#xA;" OwnerUserId="10128" LastActivityDate="2017-02-23T20:19:19.740" Title="Package manager: which files not to add to git?" Tags="|package|git|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30974" PostTypeId="1" CreationDate="2017-02-23T12:58:41.597" Score="1" ViewCount="57" Body="&lt;p&gt;I want to set &lt;code&gt;-&lt;/code&gt; as a word character for all &lt;code&gt;reStructuredText&lt;/code&gt; files. In order to do this, I acted according to the &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsSyntaxTable&quot; rel=&quot;nofollow noreferrer&quot;&gt;wiki&lt;/a&gt; and added the following to my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'misc)&#xA;(defvar my-restructuredtext-syntax-table&#xA;  (let&#xA;    ((table (make-syntax-table)))&#xA;    (modify-syntax-entry ?- &quot;w&quot; table)&#xA;    table))&#xA;&#xA;(add-hook 'text-mode-hook&#xA;  (lambda ()&#xA;    (set-syntax-table my-restructuredtext-syntax-table)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This loads without errors on emacs startup, but as soon as I switch to my reStructuredText containing buffer, I have 30 seconds 100 CPU usage on one core. After that emacs behaves normal and the dashes or minuses are part of words. Also when I switch buffer away from rst and back to my rst buffer it does not repeat this high CPU load behavior. Nevertheless this behavior of 30 seconds lag is quite annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried to hook into rst-mode the result was the same lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I add &lt;code&gt;-&lt;/code&gt; to the word characters without this lag?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Info&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GNU Emacs 24.5.1&lt;/li&gt;&#xA;&lt;li&gt;Xubuntu 16.04.1 using XFCE&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="10090" LastActivityDate="2017-02-23T12:58:41.597" Title="Setting syntax table leads to high CPU load" Tags="|syntax-table|words|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30975" PostTypeId="1" AcceptedAnswerId="30976" CreationDate="2017-02-23T13:14:53.330" Score="2" ViewCount="228" Body="&lt;p&gt;I'm trying to write a complex (to me) dired function, where I want to open a xterm window which will launch an application (fbot) with many arguments and input all marked dired files into that statement. This is based on that if I run in dired &lt;code&gt;&amp;amp;&lt;/code&gt; followed by this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xterm -e filebot -script fn:amc  /home/zeltak/mounts/lraid/raid/ztmp/amc  --output &quot;/home/zeltak/mounts/lraid/raid/ztmp/&quot; --def @/home/zeltak/.config/filebot/Q.txt --action move --conflict skip -non-strict  --mode interactive *&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works exactly as expected. So I tried fiddling with a function based on that and this is where I am in now which doesn't seem to work: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun z/dired-media-filebot-xterm ()&#xA;&quot;filebot amc interactive&quot;&#xA;(interactive)&#xA;(start-process &quot;xterm -e filebot -script fn:amc  /home/zeltak/mounts/lraid/raid/ztmp/amc  --output &quot;/home/zeltak/mounts/lraid/raid/ztmp/&quot; --def @/home/zeltak/.config/filebot/Q.txt --action move --conflict skip -non-strict  --mode interactive * &amp;amp;&quot; nil &quot;filebot&quot; file)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11387" LastEditorDisplayName="user8748" LastEditDate="2017-05-06T17:37:08.630" LastActivityDate="2017-05-06T17:37:08.630" Title="Writing a complex dired function to open xterm and execute a command on all current marked files in dired" Tags="|dired|term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30976" PostTypeId="2" ParentId="30975" CreationDate="2017-02-23T13:41:12.070" Score="1" Body="&lt;p&gt;Do you need to use xterm? Dired already has a function to run shell commands on a list of files: &lt;code&gt;dired-do-shell-command&lt;/code&gt;, that seems like an easier place to start. If for some reason you do need to run your command through xterm, it might be simpler to wrap it up in a shell script, then call that shell script via &lt;code&gt;dired-do-shell-command&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;xterm -e filebot &amp;lt;argument list&amp;gt; @1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I don't have filebot available to test with, but this works for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#!/bin/bash&#xA;xterm -e nano $1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If that works for you, your problem must be with filebot. If it doesn't work for you, I'm not sure what else to try.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-02-23T14:49:51.363" LastActivityDate="2017-02-23T14:49:51.363" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30977" PostTypeId="1" AcceptedAnswerId="31597" CreationDate="2017-02-23T13:42:43.510" Score="2" ViewCount="108" Body="&lt;p&gt;I'm using this yasnippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name : case : {...}&#xA;# key: case&#xA;# --&#xA;`(indent-region (- (point) 20) (+ (point) 20) nil)`case ${2:constexpr}: ${3:\{}&#xA;    $0&#xA;    break;&#xA;${3:$(if (string-match &quot;\{&quot; yas-text) &quot;\}&quot; &quot;&quot;)}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think it's some default, but I'm not sure.  Until recently, this snippet worked fine, but now I get a &lt;code&gt;t&lt;/code&gt; inserted into my buffer, and I think it comes from &lt;code&gt;(indent-region)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        break;&#xA;t      case constexpr: {&#xA;&#xA;          break;&#xA;        }&#xA;      case&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I get rid of this &lt;code&gt;t&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10128" LastEditorUserId="2710" LastEditDate="2017-02-23T17:15:33.623" LastActivityDate="2017-03-20T23:06:00.053" Title="Why does (indent-region ...) insert a 't' into my buffer?" Tags="|indentation|yasnippet|" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="30978" PostTypeId="2" ParentId="30973" CreationDate="2017-02-23T13:56:21.387" Score="2" Body="&lt;p&gt;Packages installed via the Emacs package manager are stored in the &lt;code&gt;elpa&lt;/code&gt; directory. If you exclude that directory you won't have any package files in your git repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only other consideration is that you may need to modify your init file, in case there's code in there that requires packages only available on one or the other of your machines. If that's the case, you'll need to do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (string= (system-name) &quot;my-home-computer&quot;)&#xA;      &amp;lt;code that only runs on your home computer&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Beyond this, some packages may create files or directories in &lt;code&gt;~/.emacs.d/&lt;/code&gt;, but there's no general rule that would allow you to identify them. However, when this happens it's usually a way for the package to store data that is used by the package code, but not any actual code. Storing these files in git won't cause you any problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in my &lt;code&gt;~/.emacs.d/&lt;/code&gt; I have a directory created by &lt;code&gt;auctex&lt;/code&gt;, which contains style information used by &lt;code&gt;auctex&lt;/code&gt; in different situations. If that file got synced to a computer that didn't have &lt;code&gt;auctex&lt;/code&gt;, it wouldn't cause any problems, as no other code would use it. (&lt;code&gt;auctex&lt;/code&gt; may not be a great example as I think it's installed by default)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have a &lt;code&gt;snippet&lt;/code&gt; directory created/managed by the &lt;code&gt;yas-snippet&lt;/code&gt; package, which is similarly inert on a machine that doesn't have &lt;code&gt;yas-snippet&lt;/code&gt; installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're really concerned about space, you need to go through your &lt;code&gt;~/.emacs.d/&lt;/code&gt; directory 'by hand' and figure out where everything there came from. But in practice, only &lt;code&gt;~/.emacs.d/elpa&lt;/code&gt; has any real impact on what gets loaded and used by emacs packages.&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-02-23T14:18:20.723" LastActivityDate="2017-02-23T14:18:20.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30979" PostTypeId="2" ParentId="30973" CreationDate="2017-02-23T14:27:34.807" Score="1" Body="&lt;p&gt;Additional to the answer of @Tyler you may also like to exclude:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*.elc&#xA;#*#&#xA;*~&#xA;abbrev_defs&#xA;bookmarks&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Always keep an eye on files that changed in the repository. If there occurs something not written by you it is candidate to exclude.&lt;/p&gt;&#xA;" OwnerUserId="10578" LastActivityDate="2017-02-23T14:27:34.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30981" PostTypeId="1" CreationDate="2017-02-23T15:22:46.030" Score="2" ViewCount="33" Body="&lt;p&gt;When using &lt;code&gt;which-function-mode&lt;/code&gt;, emacs displays not only the current function name but also the name of the module I am in. Is there a way to have &lt;code&gt;which-function-mode&lt;/code&gt; display &lt;em&gt;only&lt;/em&gt; the immediate function name, without the module name?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, instead of seeing this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;MyApp::Controller::some_function&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to only see:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;some_function&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12866" LastActivityDate="2017-02-23T15:22:46.030" Title="Don't display module name in which-function-mode" Tags="|which-function-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30982" PostTypeId="1" AcceptedAnswerId="31083" CreationDate="2017-02-23T15:30:59.723" Score="6" ViewCount="319" Body="&lt;p&gt;Sometimes I want parts of the text within an org buffer to be 'masked' by default. The reason is that I may want to look at that file with someone looking over my shoulder, where they should be able to see most of what's there, but some information I'd rather they not, a name for example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way I've discovered to do this is to use a faux link. So this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On Jan. 30, Mary Smith contacted me with concerns about the project's budget.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is entered as this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On Jan. 30, [[Mary Smith][**********]] contacted me with concerns about the project's budget.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and displays like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On Jan. 30, ********** contacted me with concerns about the project's budget.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There's an added benefit that hovering over the 'link' shows the hidden text. It's a little kludgy, but it meets my needs. Obviously isn't for information that requires a high degree of security, and that's not what I'm after. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is whether there is maybe a better way to go about this. A better solution should make it easy to format text so that it's hidden AND to access the original, hidden text.&lt;/p&gt;&#xA;" OwnerUserId="14124" LastEditorUserId="14124" LastEditDate="2017-02-23T17:42:03.197" LastActivityDate="2017-02-27T13:32:09.387" Title="masking text in an org-mode buffer" Tags="|org-mode|text-properties|" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30983" PostTypeId="1" AcceptedAnswerId="30984" CreationDate="2017-02-23T16:04:44.247" Score="0" ViewCount="181" Body="&lt;p&gt;I'd like to run the &lt;a href=&quot;http://www.gprolog.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;gprolog&lt;/code&gt;&lt;/a&gt; interactive interpreter in an Emacs sub-process shell (started with &lt;code&gt;M-x shell&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interactive interpret starts without a problem, but it does not respond to some keystrokes as expected.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To illustrate the problem, I first show a simple interaction as it occurs when I run &lt;code&gt;gprolog&lt;/code&gt; in a &quot;top-level shell&quot; (i.e. not one running as a subprocess of Emacs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In the excerpts below, please regard the delimiters &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; and &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; as &quot;markup&quot; to indicate the text I type.  In the actual interaction, I don't type any &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt; or &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; sequences.  Neither do I type the &lt;code&gt;▮&lt;/code&gt; characters, which I'm using only to indicate the position of &lt;code&gt;point&lt;/code&gt;.  &lt;em&gt;With the exception of the text enclosed by &lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt;...&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; and &lt;code&gt;▮&lt;/code&gt;, all text shown in the excerpts below is produced by &lt;code&gt;gprolog&lt;/code&gt;.&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Staring from top-level shell&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I type the following query:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ?- &amp;lt;&amp;lt;member(X, [a,b,c]).&amp;gt;&amp;gt;▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I hit the &lt;kbd&gt;Enter&lt;/kbd&gt; key (shown below as &lt;code&gt;[RET]&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ?- &amp;lt;&amp;lt;member(X, [a,b,c]).[RET]&amp;gt;&amp;gt;&#xA;&#xA;X = a ? ▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I hit &lt;kbd&gt;;&lt;/kbd&gt; once:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ?- &amp;lt;&amp;lt;member(X, [a,b,c]).[RET]&amp;gt;&amp;gt;&#xA;&#xA;X = a ? &amp;lt;&amp;lt;;&amp;gt;&amp;gt;&#xA;&#xA;X = b ? ▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that pressing &lt;code&gt;;&lt;/code&gt; was all that I had to do to elicit the next response from &lt;code&gt;gprolog&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally I hit &lt;kbd&gt;;&lt;/kbd&gt; twice more, thereby exhausting the list of remaining results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ?- &amp;lt;&amp;lt;member(X, [a,b,c]).[RET]&amp;gt;&amp;gt;&#xA;&#xA;X = a ? &amp;lt;&amp;lt;;&amp;gt;&amp;gt;&#xA;&#xA;X = b ? &amp;lt;&amp;lt;;&amp;gt;&amp;gt;&#xA;&#xA;X = c ? &amp;lt;&amp;lt;;&amp;gt;&amp;gt;&#xA;&#xA;no&#xA;| ?- ▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Staring from Emacs sub-process shell&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next I show what an attempt to run the same interaction in an instance of &lt;code&gt;gprolog&lt;/code&gt; invoked from an Emacs sub-process shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Up to this point, it looks the same as before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ?- &amp;lt;&amp;lt;member(X, [a,b,c]).[RET]&amp;gt;&amp;gt;&#xA;&#xA;X = a ? ▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now, if when I press &lt;code&gt;;&lt;/code&gt;, the semicolon character gets inserted, but &lt;code&gt;gprolog&lt;/code&gt; does not respond:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ?- &amp;lt;&amp;lt;member(X, [a,b,c]).[RET]&amp;gt;&amp;gt;&#xA;X = a ? &amp;lt;&amp;lt;;&amp;gt;&amp;gt;▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If now I hit &lt;kbd&gt;Enter&lt;/kbd&gt;, &lt;code&gt;gprolog&lt;/code&gt; (basically) prints out one more result and terminates the query (prematurely):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| ?- &amp;lt;&amp;lt;member(X, [a,b,c]).[RET]&amp;gt;&amp;gt;&#xA;&#xA;X = a ? &amp;lt;&amp;lt;;[RET]&amp;gt;&amp;gt;&#xA;;&#xA;&#xA;X = b ? &#xA;&#xA;yes&#xA;| ?- ▮&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I encountered a similar problem with &lt;code&gt;swipl&lt;/code&gt; (Swiss-Prolog), but found that starting it with the &lt;code&gt;-tty&lt;/code&gt; flag made it usable under an Emacs sub-process shell (though the interface behaves a little differently).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did not find anything like &lt;code&gt;swipl&lt;/code&gt;'s &lt;code&gt;-tty&lt;/code&gt; flag for &lt;code&gt;gprolog&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="882" LastActivityDate="2017-02-23T16:49:31.093" Title="How to run `gprolog` under an Emacs sub-process shell?" Tags="|shell|term|shell-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30984" PostTypeId="2" ParentId="30983" CreationDate="2017-02-23T16:49:31.093" Score="1" Body="&lt;p&gt;The best way to run an interactive prolog session under Emacs is to use &lt;code&gt;M-x run-prolog&lt;/code&gt;.  It includes the code needed to send single characters at a time, rather than the line-based interaction of &lt;code&gt;M-x shell&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-02-23T16:49:31.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30986" PostTypeId="2" ParentId="30982" CreationDate="2017-02-23T19:11:10.037" Score="3" Body="&lt;p&gt;Another quick workaround might be to use &lt;code&gt;highlight-regexp&lt;/code&gt; with a face that masks the text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, define a new face that is just black on black: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface mask '((t (:background &quot;black&quot; :foreground &quot;black&quot;))) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in any buffer you can use &lt;code&gt;M-s h r&lt;/code&gt; or &lt;code&gt;M-s h p&lt;/code&gt; (&lt;code&gt;highlight-regexp&lt;/code&gt; or &lt;code&gt;highlight-phrase&lt;/code&gt;) to match some text and &quot;highlight&quot; with the &lt;code&gt;mask&lt;/code&gt; face. You can remove the mask with &lt;code&gt;M-s h u&lt;/code&gt;, &lt;code&gt;unhighlight-regexp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @db48x suggested in the comments, you can define your own markup syntax and a corresponding regexp. For example, maybe you want to use &lt;code&gt;%%this should be masked%%&lt;/code&gt; and a regexp to highlight text surrounded by %% delimiters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One caveat with this approach, though: other kinds of highlighting might reveal the masked text. For example if you mark the region or turn on &lt;code&gt;hl-line-mode&lt;/code&gt; you might inadvertently reveal something.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-02-24T15:22:03.880" LastActivityDate="2017-02-24T15:22:03.880" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30987" PostTypeId="5" CreationDate="2017-02-23T19:22:29.433" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Point.html#Point&quot; rel=&quot;nofollow noreferrer&quot;&gt;Point&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Position-Info.html#Position-Info&quot; rel=&quot;nofollow noreferrer&quot;&gt;Position Information&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Secondary-Selection.html#Secondary-Selection&quot; rel=&quot;nofollow noreferrer&quot;&gt;Point and Selections&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-23T19:49:44.357" LastActivityDate="2017-02-23T19:49:44.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30988" PostTypeId="4" CreationDate="2017-02-23T19:22:29.433" Score="0" Body="is the location where most editing commands take effect, which is by default indicated by the cursor in the selected window. Emacs remembers the last location of the point for each buffer and when a buffer is activated, Emacs returns the cursor to the last known point." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-23T19:49:32.050" LastActivityDate="2017-02-23T19:49:32.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30989" PostTypeId="1" CreationDate="2017-02-23T19:58:51.113" Score="2" ViewCount="833" Body="&lt;p&gt;I have a decent number of different org files I use to store useful information.&#xA;I can easily search and navigate org files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lately I've been reading the emacs (and other packages) manual which is in GNU &quot;Info format&quot;. I'm considering converting some or all of my personal notes into Info format to see if I can improve my workflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like the idea that Info format is the standard emacs manual format but org-mode has a lot of capability and is really flexible for changing or moving content. It has tables, latex support etc that are all really nice features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the advantages of &quot;Info format&quot; compared to org mode?&lt;/p&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="13934" LastEditDate="2017-02-23T21:02:31.367" LastActivityDate="2017-02-23T21:42:38.537" Title="Org mode vs GNU &quot;Info format&quot;" Tags="|org-mode|info|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30990" PostTypeId="2" ParentId="30973" CreationDate="2017-02-23T20:13:49.307" Score="1" Body="&lt;p&gt;I have a directory in .emacs.d that I store all my version controlled information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;.emacs.d/home/emacs_config/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that folder I have all my .el files including init.el&#xA;Then I create a soft link in .emacs.d/ so init.el is loaded.&#xA;init.el -&gt; home/emacs-config/init.el&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This adds my directory to load path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path (substitute-in-file-name &quot;$HOME/.emacs.d/home/emacs-config/&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also use a custom file to reduce clutter in init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq custom-file &quot;~/.emacs.d/home/emacs-config/custom.el&quot;)&#xA;(when (file-exists-p custom-file)&#xA;   (load custom-file :noerror))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My .emacs.d/home has other folders too (system, org-files, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I change machines I just bring my .emacs.d/home and I'm ready to go after the package manager installs all my required packages. That way I keep track of what I need instead of keeping track of what I'm ignoring. As you add more packages your ~/.emacs.d/ will become more and more cluttered (I have about 25 different files and directories right now).&lt;/p&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="13934" LastEditDate="2017-02-23T20:19:19.740" LastActivityDate="2017-02-23T20:19:19.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30991" PostTypeId="1" CreationDate="2017-02-23T21:15:18.877" Score="1" ViewCount="146" Body="&lt;p&gt;I've created two functions, &lt;code&gt;scroll-window-up&lt;/code&gt; and &lt;code&gt;scroll-window-down&lt;/code&gt;, and want to add these to ace-window's dispatch list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'aw-dispatch-alist&#xA;             '(?S gpolonkai/scroll-window-down &quot; Scroll window down&quot;))&#xA;(add-to-list 'aw-dispatch-alist&#xA;             '(?s gpolonkai/scroll-window-up &quot; Scroll window up&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;code&gt;s&lt;/code&gt; in dispatch time, the selected window scrolls up,but for &lt;code&gt;S&lt;/code&gt; it says &lt;s&gt;there is no such candidate&lt;/s&gt;. I remember it worked on my other machine, so there may be some differences in how the two OS handles keys. If I'm right, is there a more reliable way to distinguish between upper and lower case characters? If not, can I specify C-s or M-s where it needs a character?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: it seems I messed up a bit… the error message I get when pressing &lt;code&gt;S&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Args out of range: &quot;S&quot;, 0, 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="507" LastEditorUserId="507" LastEditDate="2017-02-23T22:49:45.227" LastActivityDate="2017-02-24T00:04:49.727" Title="Add both `s` and `S` to ace-window's dispatch list" Tags="|key-bindings|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30992" PostTypeId="2" ParentId="30989" CreationDate="2017-02-23T21:23:39.767" Score="5" Body="&lt;p&gt;This is the key point for me:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;org-mode has a lot of capability and is really flexible for changing or moving content&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Texinfo is great for static manuals, and has nice features for navigation, tables of contents, indexes and bookmarking. But it is a &quot;compiled&quot; language, meaning you write in &lt;code&gt;.texinfo&lt;/code&gt; format, and then compile to &lt;code&gt;.info&lt;/code&gt; files that are then installed in &lt;code&gt;dir&lt;/code&gt; files before you can read them. Consequently, you write in one file, and read in another, with a processing step in between.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Org files, on the other hand, are read-write. You read and write to the same file, with no processing. For anything that you will regularly modify and update, this is going to be much easier to manage than texinfo. The main features missing from org mode are menus and indexes. You can get some of those features back with links, but it won't be quite as powerful or automated as texinfo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you're writing yourself &lt;em&gt;lengthy&lt;/em&gt; and &lt;em&gt;detailed&lt;/em&gt; (i.e., complex enough you want tables of contents and indexes) reference material that you don't need to modify much, texinfo might be nice. But if you are frequently adding notes to these references, org mode will be much easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Another nice thing about org-mode is that you can link to any other file or webpage. I'm not sure if texinfo does that?)&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-23T21:23:39.767" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30993" PostTypeId="2" ParentId="30989" CreationDate="2017-02-23T21:42:38.537" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;...if I can improve my workflow.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You'll have to describe whatever that workflow is precisely to be able to get answers that will help you decide. Otherwise its just random feature comparisons thrown around, which will devolve into opinions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update your question with an explanation of your workflow. But first why not try both formats for your workflow and see which makes intuitive sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, you may not realize this but both &lt;code&gt;info&lt;/code&gt; and &lt;code&gt;org&lt;/code&gt; formats can be intermediate formats for each other depending on the final destination formats in your workflow.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastActivityDate="2017-02-23T21:42:38.537" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30994" PostTypeId="5" CreationDate="2017-02-23T21:50:35.733" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Split-Window.html#Split-Window&quot; rel=&quot;nofollow noreferrer&quot;&gt;Split Window&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-24T02:19:19.827" LastActivityDate="2017-02-24T02:19:19.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30995" PostTypeId="4" CreationDate="2017-02-23T21:50:35.733" Score="0" Body="is for splitting an Emacs window into two. Multiple windows can display different buffers, or different parts of one buffer. Emacs has several default key bindings for splitting windows." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-28T16:21:16.347" LastActivityDate="2017-02-28T16:21:16.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30996" PostTypeId="2" ParentId="30991" CreationDate="2017-02-23T22:45:02.617" Score="1" Body="&lt;p&gt;I'm not sure why &lt;code&gt;S&lt;/code&gt; might not be working for you, but you can use a modifier key. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this: invoke ace-window, and hit for example &lt;code&gt;C-s&lt;/code&gt; at the dispatch prompt. The error message actually tells you what character was sent, e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;No such candidate, 19&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can use that to add &lt;code&gt;C-s&lt;/code&gt; to your dispatch list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'aw-dispatch-alist '(19 some-command &quot; Do Something&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-02-23T22:45:02.617" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30998" PostTypeId="1" CreationDate="2017-02-24T00:30:23.453" Score="1" ViewCount="435" Body="&lt;p&gt;I'd like to find a way to evaluate my R code remotely, but insert images into my local org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use R code blocks in my org files and insert images into the org file with something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :exports results :results graphics :file test.png&#xA;  plot(1)&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When ESS prompts me with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ESS (*R*, R (default)) starting data directory?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I enter a remote location, e.g. /ssh:server:~/project/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The figure is then created in the remote directory and a link is inserted in the #+RESULTS, however this link &quot;cannot determine image type&quot;.  Basically the image isn't local and so isn't viewable.  If I copy the image to the local directory, the link works and I see the image as if I had evaluated the code chunk locally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried adding a :dir header argument and the full path to the image, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src R :exports results :results graphics :dir erker@krusty:~/ :file /tmp/test2.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I specify somehow in the header arguments to write the file to a local directory so that it is inserted in the org file?&lt;/p&gt;&#xA;" OwnerUserId="11064" LastEditorUserId="11064" LastEditDate="2017-02-24T14:10:53.133" LastActivityDate="2017-02-24T14:10:53.133" Title="Can I write to a local file from a remote session using an Org-babel R code block?" Tags="|org-mode|org-babel|tramp|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30999" PostTypeId="1" CreationDate="2017-02-24T02:10:25.550" Score="1" ViewCount="341" Body="&lt;p&gt;I've got a function that behaves more like a macro in that it does compile-time environment definitions.  For various reasons (at this point, one of those reasons is 'because it is easier to grok in my head'), I'd like to keep it as a function.  When I use the function, how can I have emacs color it like it would a macro?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun test-func ())&#xA;(defmacro test-macro ())&#xA;&#xA;(test-func)  ; not colored&#xA;(test-macro) ; colored&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-02-24T02:36:48.717" Title="How can I syntax-highlight a function like a macro?" Tags="|syntax-highlighting|colors|elisp-macros|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31000" PostTypeId="2" ParentId="30999" CreationDate="2017-02-24T02:36:48.717" Score="1" Body="&lt;p&gt;Perhaps you want to better understand why this is the default behavior, or perhaps you want a simpler solution, but here is at least one quick solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Load library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/hl-defined.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;hl-defined&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; and turn on minor mode &lt;code&gt;hdefd-highlight-mode&lt;/code&gt;. To get exactly the same face for functions as you see for &lt;code&gt;test-macro&lt;/code&gt;, customize face &lt;code&gt;hdefd-functions&lt;/code&gt; to be the same as (i.e., just inherit from) face &lt;code&gt;font-lock-keyword-face&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If you don't want to also highlight &lt;em&gt;variables&lt;/em&gt;, customize option &lt;code&gt;hdefd-highlight-type&lt;/code&gt; to just the value &lt;code&gt;functions&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-24T02:36:48.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31001" PostTypeId="1" AcceptedAnswerId="31019" CreationDate="2017-02-24T02:57:25.957" Score="5" ViewCount="234" Body="&lt;p&gt;I've defined a lot of abbrevs in &lt;code&gt;latex-mode-abbrev-table&lt;/code&gt; and I'd like to use all the contents in &lt;code&gt;latex-mode-abbrev-table&lt;/code&gt; and &lt;code&gt;org-mode-abbrev-table&lt;/code&gt; when in &lt;code&gt;org-mode&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible &quot;solution&quot; would be to write all the abbrevs in &lt;code&gt;global-abbrev-table&lt;/code&gt; but I'd like to keep the global table clean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I use the &lt;em&gt;merged&lt;/em&gt; version(LaTeX + Org) of abbrev table in &lt;code&gt;org-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="253" LastEditDate="2017-02-24T16:19:04.997" LastActivityDate="2018-10-30T03:47:48.347" Title="How to inherit one abbrev table in another abbrev table?" Tags="|org-mode|latex|abbrev|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31002" PostTypeId="5" CreationDate="2017-02-24T03:15:58.247" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Editing-Format-Info.html#Editing-Format-Info&quot; rel=&quot;nofollow noreferrer&quot;&gt;Format Info&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Formatting-Strings.html#Formatting-Strings&quot; rel=&quot;nofollow noreferrer&quot;&gt;Formatting Strings&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Format-Properties.html#Format-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;Format Properties&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-24T16:27:15.750" LastActivityDate="2017-02-24T16:27:15.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31003" PostTypeId="4" CreationDate="2017-02-24T03:15:58.247" Score="0" Body="is for text formatting and manipulating text attributes. Emacs formatting facilities include adding, changing, and describing fonts, faces, and colors. The complexity of the formatting functions depends on the major mode and customizations. Use this tag for questions about formatting time strings and mode-line also." OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-24T23:34:54.690" LastActivityDate="2017-02-24T23:34:54.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31004" PostTypeId="5" CreationDate="2017-02-24T03:25:11.013" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Comments.html#Comments&quot; rel=&quot;nofollow noreferrer&quot;&gt;Manipulating Comments&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Comments.html#Comments&quot; rel=&quot;nofollow noreferrer&quot;&gt;Comments&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html#Comment-Tips&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tips for writing comments&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-24T16:27:27.053" LastActivityDate="2017-02-24T16:27:27.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31005" PostTypeId="4" CreationDate="2017-02-24T03:25:11.013" Score="0" Body="is for distinguishing comment lines from code. Emacs uses the same key bindings for manipulating comments in different modes. Emacs handles all the different ways of inserting comments for each of the major modes. Use additional tags to indicate language-specific modes for questions about comments." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-24T23:31:04.050" LastActivityDate="2017-02-24T23:31:04.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31006" PostTypeId="1" AcceptedAnswerId="31012" CreationDate="2017-02-24T05:14:34.057" Score="3" ViewCount="1035" Body="&lt;p&gt;I need to create a weekly agenda that has the same outline.  I currently have a Word template file that I use, but would like to convert it to emacs.  I want the emacs &quot;template&quot; to pre-fill the common text and present me with fields for updating the information that changes week to week.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked into &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/forms.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Forms Mode&lt;/a&gt;, but that looks more database oriented.  I read some information about using &lt;a href=&quot;https://www.emacswiki.org/emacs/SkeletonMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Skeleton Mode&lt;/a&gt;, but I would like to have fillable fields that I could quickly enter throughout the skeleton text.&lt;/p&gt;&#xA;" OwnerUserId="15021" LastEditorUserId="13326" LastEditDate="2017-02-24T16:27:07.300" LastActivityDate="2017-02-24T16:27:07.300" Title="Creating templates in emacs" Tags="|org-agenda|org-capture|template|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31007" PostTypeId="1" AcceptedAnswerId="31035" CreationDate="2017-02-24T06:10:53.980" Score="1" ViewCount="560" Body="&lt;p&gt;Attempting to bind &lt;code&gt;M-ESC M-ESC&lt;/code&gt; in the global map to a command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;M-ESC M-ESC&quot;) #'my-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;results in the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Key sequence M-ESC M-ESC starts with non-prefix key M-ESC ESC&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I supposed this is due to &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Functions-for-Key-Lookup.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;meta-prefix-char&lt;/code&gt;&lt;/a&gt; being &lt;code&gt;ESC&lt;/code&gt; by default, so &lt;code&gt;M-&amp;lt;char&amp;gt;&lt;/code&gt; gets translated into &lt;code&gt;ESC-&amp;lt;char&amp;gt;&lt;/code&gt;. Therefore, &lt;code&gt;M-ESC M-ESC&lt;/code&gt; is &lt;code&gt;ESC ESC ESC ESC&lt;/code&gt;, and &lt;code&gt;ESC ESC ESC&lt;/code&gt; is already bound to &lt;code&gt;keyboard-escape-quit&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a safe way to separate the &lt;code&gt;Meta&lt;/code&gt; and &lt;code&gt;ESC&lt;/code&gt; keys so a binding like &lt;code&gt;M-ESC M-ESC&lt;/code&gt; is possible? If so, how?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2017-02-24T23:31:37.640" LastActivityDate="2017-02-25T04:05:30.037" Title="Binding `M-ESC M-ESC`" Tags="|key-bindings|escape|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31008" PostTypeId="1" AcceptedAnswerId="31028" CreationDate="2017-02-24T06:16:43.150" Score="0" ViewCount="64" Body="&lt;p&gt;I have the following custom implementation of &lt;code&gt;insert-pair&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun *-insert-pair (&amp;amp;optional arg open close)&#xA;  &quot;Wrap next ARG sexps in parentheses.&#xA;&#xA;If there is no next sexp, insert a new pair of parentheses.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((arg (or arg 1))&#xA;        (exists-next-sexp t))&#xA;    (save-excursion&#xA;      (condition-case nil&#xA;          (forward-sexp)&#xA;        (scan-error (setq exists-next-sexp nil))))&#xA;    (if exists-next-sexp&#xA;        (insert-pair arg open close)&#xA;      (insert-pair nil open close))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I don't like the use of the boolean var &lt;code&gt;exist-next-sexp&lt;/code&gt;. Is there a more idiomatic way to write this so I can get rid of it?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2017-02-24T16:36:06.970" LastActivityDate="2017-02-24T18:21:00.683" Title="Idiomatic way to improve `insert-pair`" Tags="|local-variables|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31009" PostTypeId="2" ParentId="22653" CreationDate="2017-02-24T06:56:48.880" Score="0" Body="&lt;p&gt;The applescript version above didn't seem to work for me--this version is also potentially faster since it requires no &lt;code&gt;delay&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun brds/open-Terminal-here ()&#xA;    (interactive)&#xA;    (shell-command&#xA;     (concat &quot;open -a Terminal &quot;&#xA;             (shell-quote-argument (expand-file-name&#xA;                                    default-directory))) nil nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13444" LastEditorUserId="13444" LastEditDate="2017-07-16T17:52:37.910" LastActivityDate="2017-07-16T17:52:37.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31010" PostTypeId="1" AcceptedAnswerId="31025" CreationDate="2017-02-24T07:15:05.973" Score="22" ViewCount="2728" Body="&lt;p&gt;VC blame mode has a nifty &lt;code&gt;a&lt;/code&gt; hotkey &quot;show me blame of the file before the commit I'm pointing at&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an equivalent in magit?&lt;/p&gt;&#xA;" OwnerUserId="15022" LastActivityDate="2017-02-25T20:24:34.353" Title="magit blame: is there an equivalent for &quot;show me the file before this commit&quot; from VC?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31011" PostTypeId="1" CreationDate="2017-02-24T08:00:11.550" Score="7" ViewCount="1952" Body="&lt;p&gt;Let's say I have an &lt;code&gt;org-mode&lt;/code&gt; file at &lt;code&gt;~/myorg.org&lt;/code&gt;, looking like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO My TODO list&#xA;** TODO Play games&#xA;** TODO Build a boat&#xA;** DONE Do something else&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want to modify this document using &lt;code&gt;org-element&lt;/code&gt;. Let's say I want to change all TODO items to DONE. I thought something like this would work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer (find-file-noselect &quot;~/myorg.org&quot;) &#xA;  (org-element-map (org-element-parse-buffer) 'headline&#xA;    (lambda (h)&#xA;      (org-element-put-property h :todo-keyword &quot;DONE&quot;)))&#xA;  (save-buffer))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The structure returned from &lt;code&gt;org-element-map&lt;/code&gt; seems fine, but the code doesn't modify the file. Do I have to replace the whole buffer text using &lt;code&gt;org-element-interpret-data&lt;/code&gt;, or is there some other way?&lt;/p&gt;&#xA;" OwnerUserId="9695" LastEditorUserId="105" LastEditDate="2017-02-24T16:35:30.710" LastActivityDate="2018-05-22T07:38:31.237" Title="How to modify content of org-mode document using org-element API?" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31012" PostTypeId="2" ParentId="31006" CreationDate="2017-02-24T08:31:13.183" Score="4" Body="&lt;p&gt;You'll want to take a look at &lt;a href=&quot;http://orgmode.org/manual/Agenda-Views.html&quot; rel=&quot;noreferrer&quot;&gt;Agenda Views&lt;/a&gt;, &lt;a href=&quot;http://orgmode.org/manual/Capture-templates.html#Capture-templates&quot; rel=&quot;noreferrer&quot;&gt;Org-Mode Capture Templates&lt;/a&gt; and / or &lt;a href=&quot;https://github.com/joaotavora/yasnippet&quot; rel=&quot;noreferrer&quot;&gt;YASnippet&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;Org-Mode&lt;/code&gt; you can set up capture templates for various tasks and for different target locations, and consolidate all that information in &lt;code&gt;Agenda Views&lt;/code&gt;. Morever you can quickly store notes with little interruption to your workflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a &lt;a href=&quot;http://orgmode.org/worg/org-gtd-etc.html&quot; rel=&quot;noreferrer&quot;&gt;wealth of information&lt;/a&gt; for implementing &lt;em&gt;David Allen's&lt;/em&gt; &lt;a href=&quot;http://gettingthingsdone.com/&quot; rel=&quot;noreferrer&quot;&gt;GTD&lt;/a&gt; - &lt;em&gt;Getting Things Done&lt;/em&gt; stratergies within an Emacs environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;YASnippet&lt;/strong&gt; &lt;em&gt;is a template system for Emacs that allows you to type an abbreviation and quickly expand it into function templates&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining the powerful tools of &lt;code&gt;Org-Mode&lt;/code&gt; together with &lt;code&gt;YASnippet&lt;/code&gt; should allow you to realise the desired weekly templated agendas.&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="13326" LastEditDate="2017-02-24T08:43:20.513" LastActivityDate="2017-02-24T08:43:20.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31013" PostTypeId="2" ParentId="30746" CreationDate="2017-02-24T10:04:51.923" Score="0" Body="&lt;p&gt;By commenting out this line in my &lt;code&gt;init.el&lt;/code&gt; problem was removed, the line was related to &lt;a href=&quot;https://github.com/vspinu/polymode&quot; rel=&quot;nofollow noreferrer&quot;&gt;polymode&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'auto-mode-alist '(&quot;\\.org&quot; . poly-org-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's it. This &lt;a href=&quot;https://emacs.stackexchange.com/questions/28429/how-do-i-troubleshoot-emacs-problems&quot;&gt;post&lt;/a&gt; was very helpful.&lt;/p&gt;&#xA;" OwnerUserId="2443" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-02-24T10:17:08.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31015" PostTypeId="1" AcceptedAnswerId="31048" CreationDate="2017-02-24T13:48:30.373" Score="1" ViewCount="83" Body="&lt;p&gt;Is there a variable I can set to disable the call of &lt;code&gt;octave-sync-function-file-names&lt;/code&gt; after saving a file?&lt;/p&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2018-04-20T09:31:37.820" Title="Octave-mode disable octave-sync-function-file-names on save" Tags="|octave|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31016" PostTypeId="1" AcceptedAnswerId="31037" CreationDate="2017-02-24T15:27:30.597" Score="1" ViewCount="984" Body="&lt;p&gt;Tramp with dired-mode can use the &lt;code&gt;authinfo&lt;/code&gt; file to automatically login.  This avoids setting up keys in the &lt;code&gt;.ssh&lt;/code&gt; directory and also on the remote server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I modify the behavior of &lt;code&gt;eshell&lt;/code&gt; to access the &lt;code&gt;authinfo&lt;/code&gt; file to automatically login to a remote server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[CAVEAT:  I do not want to piggy-back by opening a Tramp &lt;code&gt;dired-mode&lt;/code&gt; buffer and then launching &lt;code&gt;eshell&lt;/code&gt; -- i.e., I want &lt;code&gt;eshell&lt;/code&gt; to access the &lt;code&gt;authinfo&lt;/code&gt; file without the help of &lt;code&gt;dired-mode&lt;/code&gt;.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[I am aware of the option to use a utility called &lt;code&gt;sshpass&lt;/code&gt;, but I'd like to use the &lt;code&gt;authinfo&lt;/code&gt; file.]&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-25T08:13:38.727" Title="Eshell -- how to use authinfo for login credentials" Tags="|eshell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31017" PostTypeId="2" ParentId="30982" CreationDate="2017-02-24T15:29:54.267" Score="2" Body="&lt;p&gt;Put such text in drawers - which have very similar functionality. They are not hidden because of the fear from shoulder surfers, but they are considered to be unsightly, under the covers stuff so nearly always hidden. Drawers seem more idiomatic in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/org/Drawers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/org/Drawers.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could then define a column mode to display such properties, or just press TAB on the drawer to expand it.&lt;/p&gt;&#xA;" OwnerUserId="11609" LastActivityDate="2017-02-24T15:29:54.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31018" PostTypeId="2" ParentId="31011" CreationDate="2017-02-24T15:42:30.147" Score="7" Body="&lt;p&gt;The &lt;code&gt;org-element-put-property&lt;/code&gt; command does not modify the buffer content, it just returns the new element. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would approach your use case differently: call &lt;code&gt;save-excursion&lt;/code&gt;, then jump to the top of the buffer (or region, etc). Move forward using &lt;code&gt;outline-next-heading&lt;/code&gt;. At each heading you can call &lt;code&gt;org-entry-is-todo-p&lt;/code&gt; and &lt;code&gt;(org-todo 'done)&lt;/code&gt; to mark each one done. Then save the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally: if you want to use the org-element API to apply changes, I think you are correct that you would need to call &lt;code&gt;org-element-interpret-data&lt;/code&gt; to convert the updated AST back to text and then replace the buffer content. See &lt;a href=&quot;http://orgmode.org/worg/dev/org-element-api.html&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/worg/dev/org-element-api.html&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-02-24T15:54:30.857" LastActivityDate="2017-02-24T15:54:30.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31019" PostTypeId="2" ParentId="31001" CreationDate="2017-02-24T16:17:43.617" Score="3" Body="&lt;p&gt;Use the&#xA;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Abbrev-Table-Properties.html#Abbrev-Table-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;:parents&lt;/code&gt; property&lt;/a&gt; to&#xA;hold a list of tables from which to inherit abbrevs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you can do:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(abbrev-table-put org-mode-abbrev-table&#xA;                  :parents (list latex-mode-abbrev-table))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-02-24T16:17:43.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31020" PostTypeId="1" AcceptedAnswerId="31029" CreationDate="2017-02-24T16:17:54.240" Score="1" ViewCount="879" Body="&lt;p&gt;Do &lt;code&gt;.elc&lt;/code&gt; files take precedence over &lt;code&gt;.el&lt;/code&gt; files when using &lt;code&gt;load&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have two files in my load path: &lt;code&gt;foo.el&lt;/code&gt; and &lt;code&gt;foo.elc&lt;/code&gt;. If I call &lt;code&gt;(load &quot;foo&quot;)&lt;/code&gt;, will the byte-compiled version (&lt;code&gt;foo.elc&lt;/code&gt;) always be loaded instead of the uncompiled &lt;code&gt;foo.el&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12866" LastActivityDate="2017-02-24T18:30:26.633" Title="Does `load` prefer .elc files over .el files?" Tags="|byte-compilation|load-path|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31021" PostTypeId="2" ParentId="31020" CreationDate="2017-02-24T16:17:54.240" Score="0" Body="&lt;p&gt;Yes, &lt;code&gt;.elc&lt;/code&gt; files take precedence over &lt;code&gt;.el&lt;/code&gt; files, even if they both exist in your load path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://www.emacswiki.org/emacs/LoadPath&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacswiki.org&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When both a byte-compiled file (&lt;em&gt;.elc) and a source file (&lt;/em&gt;.el) are found for the same library, preference is given to byte-compiled file.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12866" LastActivityDate="2017-02-24T16:17:54.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31022" PostTypeId="2" ParentId="30869" CreationDate="2017-02-24T16:30:58.243" Score="1" Body="&lt;p&gt;If you use a &lt;a href=&quot;https://www.emacswiki.org/emacs/KeyboardMacros&quot; rel=&quot;nofollow noreferrer&quot;&gt;macro&lt;/a&gt;, you get 2 advantages :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Inbuilt, idiomatic way in Emacs to assign a key binding to a series of actions - even though in your case the series of actions is just a single action. So you don't have to look for methods that are likely to break with new packages, Emacs releases etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If ever you want to repeat more than one commands, you have a well practised skill in your head to make your life easier.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11609" LastEditorUserId="253" LastEditDate="2017-02-24T16:34:26.240" LastActivityDate="2017-02-24T16:34:26.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31023" PostTypeId="5" CreationDate="2017-02-24T17:00:10.040" Score="0" Body="&lt;h3&gt;Useful Link:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Capture.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Capture&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-24T21:11:16.573" LastActivityDate="2017-02-24T21:11:16.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31024" PostTypeId="4" CreationDate="2017-02-24T17:00:10.040" Score="0" Body="is for capturing notes in Org mode with minimal interruption. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-27T16:43:47.897" LastActivityDate="2017-02-27T16:43:47.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31025" PostTypeId="2" ParentId="31010" CreationDate="2017-02-24T17:01:31.590" Score="37" Body="&lt;p&gt;Yes, just invoke &lt;code&gt;magit-blame&lt;/code&gt; again. You can do so using &lt;kbd&gt;b b&lt;/kbd&gt;. To move back in the other direction use &lt;kbd&gt;q&lt;/kbd&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-02-25T20:24:34.353" LastActivityDate="2017-02-25T20:24:34.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31026" PostTypeId="2" ParentId="30961" CreationDate="2017-02-24T17:19:22.870" Score="2" Body="&lt;p&gt;Magit only used &lt;code&gt;magit-completing-read&lt;/code&gt; when reading &quot;magit-specific&quot; things. When reading things that other packages also need to read, then it uses the specialized functions provided by Emacs instead. For files and directories the work is ultimately done by &lt;code&gt;read-file-name-default&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I like to use &lt;code&gt;ido&lt;/code&gt; for completing file paths and &lt;code&gt;helm&lt;/code&gt; for all other things.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So this doesn't really have anything to do with Magit. Unless you meant &quot;use &lt;code&gt;ido&lt;/code&gt; for completing file paths if and only if that is needed by Magit&quot;, which the following suggests:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I have tried setting &lt;code&gt;magit-completing-read-function&lt;/code&gt; to &lt;code&gt;magit-ido-completing-read&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, I don't think that it would make sense for Magit to support reading file/directory names using a framework different from what every other package uses. I assume nearly everyone would want to use the same mechanism for reading files across all of Emacs. So if you meant that, then you are out of luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a different completion mechanism for files (regardless of what packages needs the user to select a file) than for anything else does make some sense though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That appears to be supported. From &lt;code&gt;helm-completing-read-handlers-alist&lt;/code&gt;'s doc-string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Ido is also supported, you can use `ido-completing-read' and&#xA;`ido-read-file-name' as value of an entry or just 'ido.&#xA;...&#xA;Note that you don't need to enable `ido-mode' for this to work.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-02-24T17:47:08.787" LastActivityDate="2017-02-24T17:47:08.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31027" PostTypeId="2" ParentId="30073" CreationDate="2017-02-24T17:40:17.990" Score="1" Body="&lt;p&gt;I don't know anything about gerrit (yet), but after just scrolling through &lt;code&gt;magit-gerrit.el&lt;/code&gt; and noticing that new reviews are created using &lt;code&gt;magit-gerrit-create-review&lt;/code&gt;, which uses &lt;code&gt;magit-gerrit-push-review&lt;/code&gt;, which simply does &lt;code&gt;git push ...&lt;/code&gt;, I would assume that you can (and apparently are expected to) just push to the same branch as before using regular git/magit push commands.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-02-24T17:40:17.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31028" PostTypeId="2" ParentId="31008" CreationDate="2017-02-24T18:21:00.683" Score="1" Body="&lt;p&gt;The use of &lt;code&gt;let&lt;/code&gt; vs &lt;code&gt;setq&lt;/code&gt; for optional argument defaults is subjective, see &lt;a href=&quot;https://emacs.stackexchange.com/a/14203/780&quot;&gt;https://emacs.stackexchange.com/a/14203/780&lt;/a&gt; for some discussion in the comments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't mind using setq here, you can combine the comments from @Drew and @npostavs for something fairly concise:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun *-insert-pair (&amp;amp;optional arg open close)&#xA;  (interactive &quot;p&quot;)&#xA;  (setq arg (or arg 1))&#xA;  (save-excursion&#xA;    (condition-case nil&#xA;        (forward-sexp)&#xA;      (scan-error (setq arg nil))))&#xA;  (insert-pair arg open close))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also use &lt;code&gt;let&lt;/code&gt; and combine things in to a single argument like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun *-insert-pair (&amp;amp;optional arg open close)&#xA;  (interactive &quot;p&quot;)&#xA;  (let ((arg (save-excursion&#xA;               (condition-case nil&#xA;                   (progn&#xA;                     (forward-sexp)&#xA;                     (or arg 1))&#xA;                 (scan-error nil)))))&#xA;&#xA;    (insert-pair arg open close)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-02-24T18:21:00.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31029" PostTypeId="2" ParentId="31020" CreationDate="2017-02-24T18:30:26.633" Score="5" Body="&lt;p&gt;By default the &lt;code&gt;.elc&lt;/code&gt; would be loaded rather than the &lt;code&gt;.el&lt;/code&gt;, as noted in the other answers/comments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few things can affect this behavior, however:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Set &lt;code&gt;load-prefer-newer&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; if you want to load whichever file is newer. In that case the &lt;code&gt;.el&lt;/code&gt; will be loaded if it has been modified more recently than the corresponding &lt;code&gt;.elc&lt;/code&gt; file. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;See the variable &lt;code&gt;load-suffixes&lt;/code&gt;, which defines the suffixes that &lt;code&gt;load&lt;/code&gt; will try, in order of preference. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-02-24T18:30:26.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31030" PostTypeId="2" ParentId="30961" CreationDate="2017-02-24T18:47:57.403" Score="2" Body="&lt;p&gt;Finally, I found the solution to my problem. &lt;code&gt;magit-status&lt;/code&gt; ultimately calls &lt;code&gt;read-file-name&lt;/code&gt;. The &lt;code&gt;read-file-name&lt;/code&gt; function uses &lt;code&gt;read-file-name-function&lt;/code&gt; variable to find the function that it can call for reading a file path. &lt;code&gt;helm-mode&lt;/code&gt; sets it to &lt;code&gt;helm--generic-read..&lt;/code&gt; and it doesn't respect the value of &lt;code&gt;helm-completing-read-handlers&lt;/code&gt; for me somehow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way I could make it use &lt;code&gt;ido&lt;/code&gt; was with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq read-file-name-function 'ido-read-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14967" LastActivityDate="2017-02-24T18:47:57.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31031" PostTypeId="1" AcceptedAnswerId="31032" CreationDate="2017-02-24T19:26:14.710" Score="2" ViewCount="709" Body="&lt;p&gt;I was wondering if anyone could help me figure out why the compilation-error-regexp for IAR ( compilation-error-regexp-alist-alist, in compile.el ) does not work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regexp is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(iar&#xA; &quot;^\&quot;\\(.*\\)\&quot;,\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:&quot;&#xA; 1 2 nil (3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An IAR EWARM (7.80.4) error/warning message has the following format:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c:\someFolder\someFile.cpp(18) : Error[Pe018]: expected a &quot;)&quot;&#xA;c:\someFolder\someFile.cpp(26) : Warning[Pe012]: parsing restarts here after previous syntax error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no experience with Emacs regular expressions, so any help would be greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the error/warning features of compile.el work for python, so it does not seem to be a configuration issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs version: emacs-25.1.1 (x86_64-w64-mingw32)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;Thanks! That was very helpful. Using M-x re-builder I was able to use the pattern you provided to make the following expression : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;\\(^..*\\.cpp\\|^..*\\.c\\|^..*\\.hpp\\|^..*\\.h\\)(\\([0-9]+\\))\\s-+:\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[Pe0-9]+\\]:.*&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It detects the filename and line number. I am however still not able to make it work in compilation mode, as I don't quite understand the remaining arguments of compilation-error-regexp-alist-alist. The documentation states:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Each elt has the form (REGEXP FILE [LINE COLUMN TYPE HYPERLINK&#xA;HIGHLIGHT...]).  If REGEXP matches, the FILE'th subexpression&#xA;gives the file name, and the LINE'th subexpression gives the line&#xA;number.  The COLUMN'th subexpression gives the column number on&#xA;that line.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell the complete expression should be something like: &#xA;&lt;code&gt;(iarbuild&#xA;     &quot;\\(^..*\\.cpp\\|^..*\\.c\\|^..*\\.hpp\\|^..*\\.h\\)(\\([0-9]+\\))\\s-+:\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[Pe0-9]+\\]:.*&quot; 1 2 nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't get it to work. Any tips?&lt;/p&gt;&#xA;" OwnerUserId="14899" LastEditorUserId="14899" LastEditDate="2017-03-04T14:35:10.673" LastActivityDate="2018-09-14T23:28:31.023" Title="help with regexp for compilation-mode (IAR EWARM )" Tags="|regular-expressions|compile-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31032" PostTypeId="2" ParentId="31031" CreationDate="2017-02-24T19:44:43.763" Score="1" Body="&lt;p&gt;I suggest you use &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;re-builder&lt;/code&gt; on the compilation errors buffer (or just a buffer containing the text you want to match).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you start with this edited pattern:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;(\\([0-9]+\\))\\s-+:\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[Pe0-9]+\\]:&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll probably be able to figure it out from there?&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;I imagine something like the following might do the trick?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;'(&quot;\\(^.+\\.\\(?:cpp\\|c\\|hpp\\|h\\)\\)(\\([0-9]+\\))\\s-+:\\s-+\\(?:Error\\|\\(Warning\\)\\|\\(Info\\)\\).*&quot;&#xA;  1 2 (3 . 4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm guessing at the &quot;Info&quot; part, just because the &lt;code&gt;(WARNING . INFO)&lt;/code&gt; syntax looks like it requires some kind of Info group. It's possible that just &lt;code&gt;(WARNING)&lt;/code&gt; would suffice, but I've not checked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Groups &lt;code&gt;\\( ... \\)&lt;/code&gt; are numbered from 1, but note that instances of &lt;code&gt;\\(?: ... \\)&lt;/code&gt; are non-capturing groups, which aren't numbered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence 1 is the FILE group; 2 is the LINE number group; and (3 . 4) is (WARNING . INFO)&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Here's an &lt;code&gt;rx&lt;/code&gt; equivalent for that regexp:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(rx (group bol (one-or-more not-newline) &quot;.&quot; (or &quot;cpp&quot; &quot;c&quot; &quot;hpp&quot; &quot;h&quot;))&#xA;    &quot;(&quot; (group (one-or-more digit)) &quot;)&quot;&#xA;    (one-or-more whitespace) &quot;:&quot; (one-or-more whitespace)&#xA;    (or &quot;Error&quot; (group &quot;Warning&quot;) (group &quot;Info&quot;))&#xA;    (zero-or-more not-newline))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note also Lindydancer's comments -- you may wish to introduce &lt;code&gt;&quot;Remark&quot;&lt;/code&gt; into this.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2018-09-14T23:28:31.023" LastActivityDate="2018-09-14T23:28:31.023" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31033" PostTypeId="1" CreationDate="2017-02-24T21:00:35.163" Score="6" ViewCount="1176" Body="&lt;p&gt;My &lt;code&gt;elpy&lt;/code&gt; uses &lt;code&gt;ipython&lt;/code&gt; as the interactive interpreter.  It does not, however, emulate &lt;code&gt;ipython&lt;/code&gt;'s history-informed autocomplete feature (for lack of a better term).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is: within an &lt;code&gt;ipython&lt;/code&gt; session launched from the terminal, if you want to execute a line previously executed, you can type the first part of the line, and up-arrow will only display consistent previous commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;code&gt;ipython&lt;/code&gt; shell launched from &lt;code&gt;elpy&lt;/code&gt; (with &lt;code&gt;C-c C-c&lt;/code&gt;), I can execute previous commands with &lt;code&gt;C-p&lt;/code&gt;, but I cannot view only those commands consistent with a given partial command. How can I utilize this very useful feature of &lt;code&gt;ipython&lt;/code&gt; within the emacs &lt;code&gt;elpy&lt;/code&gt; shell?&lt;/p&gt;&#xA;" OwnerUserId="14932" LastEditorUserId="253" LastEditDate="2017-02-24T21:03:19.977" LastActivityDate="2017-04-26T02:19:02.593" Title="Ipython completion in elpy" Tags="|python|ipython|elpy|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31034" PostTypeId="2" ParentId="31033" CreationDate="2017-02-24T23:36:11.437" Score="6" Body="&lt;p&gt;I don't use eply, I use emacs 25.1.1 with company-jedi with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; python-shell-interpreter &quot;ipython3&quot;&#xA; python-shell-interpreter-args &quot;--simple-prompt --pprint&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inside emacs *Python* &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python 3.6.0, Anaconda 4.3.0, Ipython 5.1.0&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In[1]: x = 10&#xA;In[2]: x = 125&#xA;In[3]: x =      # type M-p &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get history items 1 and 2 and Input restored.&#xA;That example seems to be working for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please share what your emacs version, (I)python version and a code snippet. &#xA;It may be useful to file a bug report with elpy if that is the problem.&lt;/p&gt;&#xA;" OwnerUserId="13934" LastActivityDate="2017-02-24T23:36:11.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31035" PostTypeId="2" ParentId="31007" CreationDate="2017-02-24T23:44:55.893" Score="2" Body="&lt;p&gt;It's not a prefix key because it is not bound to a keymap. See &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Keys.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(elisp) Prefix Keys&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-prefix-command 'foo)&#xA;(global-set-key (kbd &quot;M-ESC&quot;) 'foo)&#xA;(global-set-key (kbd &quot;M-ESC M-ESC&quot;) 'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-24T23:44:55.893" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31036" PostTypeId="2" ParentId="31007" CreationDate="2017-02-25T04:05:30.037" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a safe way to separate the &lt;code&gt;Meta&lt;/code&gt; and &lt;code&gt;ESC&lt;/code&gt; keys so a binding like &lt;code&gt;M-ESC M-ESC&lt;/code&gt; is possible? If so, how?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could bind &lt;code&gt;&amp;lt;escape&amp;gt;&lt;/code&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key global-map (kbd &quot;M-&amp;lt;escape&amp;gt;  M-&amp;lt;escape&amp;gt;&quot;) #'my-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This only works in a GUI frame though.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-02-25T04:05:30.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31037" PostTypeId="2" ParentId="31016" CreationDate="2017-02-25T08:13:38.727" Score="1" Body="&lt;p&gt;All operations in eshell dedicated for a remote server are mapped to Tramp. If you are in a local directory, you could switch to a remote directory like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Welcome to the Emacs shell&#xA;&#xA;~ $ cd /sudo::&#xA;/sudo:root@detlef:/root $ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will ask you for the password via Tramp, meaning &lt;code&gt;authinfo&lt;/code&gt;. What exactly does not work for you?&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-02-25T08:13:38.727" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31038" PostTypeId="1" CreationDate="2017-02-25T11:20:20.703" Score="1" ViewCount="154" Body="&lt;p&gt;Given the file &lt;code&gt;test.c&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main()&#xA;{&#xA;    if (a)&#xA;        foo();&#xA;    else&#xA;    if (b)      // line 6&#xA;        bar();&#xA;    else&#xA;        baz();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whenever a comma or paren is typed while point is on line 6 (second &lt;code&gt;if&lt;/code&gt;), Emacs reindents the line one indent level deeper, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main()&#xA;{&#xA;    if (a)&#xA;        foo();&#xA;    else&#xA;        if (b)&#xA;        bar();&#xA;    else&#xA;        baz();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to disable this annoying behaviour just for this situation?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm aware that I could use &lt;code&gt;else if&lt;/code&gt; on one line instead of putting &lt;code&gt;else&lt;/code&gt; and &lt;code&gt;if&lt;/code&gt; on separate lines. However:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I don't like this style, as the &lt;code&gt;if&lt;/code&gt; conditions are no longer aligned&lt;/li&gt;&#xA;&lt;li&gt;I'm working on existing projects with an existing code style&lt;/li&gt;&#xA;&lt;li&gt;The editor should not dictate the code style anyway.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;I'm aware that I could disable electric indentation entirely, however this disables useful behaviour such as correct indentation after typing &lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Electric-C.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Emacs manual&lt;/a&gt; lists which characters trigger electric indentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The electric characters are &lt;code&gt;{&lt;/code&gt;, &lt;code&gt;}&lt;/code&gt;, &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;#&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;,&lt;/code&gt;, &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;(&lt;/code&gt;, and &lt;code&gt;)&lt;/code&gt;. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, there is no mention of any way to customizing them. I think leaving just &lt;code&gt;{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt; would be fine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6695" LastActivityDate="2017-02-25T15:07:19.143" Title="Stop reindenting `if` after `else`" Tags="|indentation|cc-mode|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31039" PostTypeId="2" ParentId="31038" CreationDate="2017-02-25T11:37:18.180" Score="2" Body="&lt;p&gt;I guess one way is to simply unmap the undesired keys from the mode's keymap:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-when-compile&#xA;  (require 'cc-mode))&#xA;(defun my-c-mode-hook ()&#xA;  &quot;My `c-mode' hook.&quot;&#xA;  (define-key c-mode-map (kbd &quot;,&quot;) nil)&#xA;  (define-key c-mode-map (kbd &quot;(&quot;) nil)&#xA;  (define-key c-mode-map (kbd &quot;)&quot;) nil))&#xA;(add-hook 'c-mode-hook 'my-c-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6695" LastEditorUserId="6695" LastEditDate="2017-02-25T15:07:19.143" LastActivityDate="2017-02-25T15:07:19.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31041" PostTypeId="2" ParentId="31038" CreationDate="2017-02-25T14:17:19.110" Score="2" Body="&lt;p&gt;You could make &lt;code&gt;c-mode&lt;/code&gt; follow your style like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun lineup-if-with-else (context)&#xA;  (pcase context&#xA;    (`(substatement . ,anchor)&#xA;     (save-excursion&#xA;       (back-to-indentation)&#xA;       (when (looking-at-p &quot;if\\_&amp;gt;&quot;)&#xA;         (goto-char anchor)&#xA;         (when (looking-at-p &quot;else\\_&amp;gt;&quot;)&#xA;           0))))))&#xA;&#xA;(defun my-c-mode-hook ()&#xA;  &quot;My `c-mode' hook.&quot;&#xA;  (c-set-offset 'substatement '(lineup-if-with-else +)))&#xA;(add-hook 'c-mode-hook 'my-c-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-02-25T14:17:19.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31042" PostTypeId="1" CreationDate="2017-02-25T16:36:59.603" Score="4" ViewCount="103" Body="&lt;p&gt;I've got a few functions in &lt;a href=&quot;https://github.com/vermiculus/apiwrap.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;api-wrap.el&lt;/code&gt;&lt;/a&gt; that I'll refer to as 'macro code', here simplified to clarify the question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;function &lt;code&gt;(generate-form prefix kind &amp;amp;rest args)&lt;/code&gt; returns an unevaluated form that would define a new specific function&lt;/li&gt;&#xA;&lt;li&gt;macro &lt;code&gt;(generate-macros prefix &amp;amp;rest args)&lt;/code&gt; loops over &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;GET&lt;/code&gt;, etc. and defines macros that use &lt;code&gt;generate-form&lt;/code&gt; as a definition&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, calling order: &lt;code&gt;generate-macros&lt;/code&gt; creates macros (here called factories) that dip into &lt;code&gt;generate-form&lt;/code&gt; to create the definition.  These factory-macros are what actually defines each target function in application code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the question: &lt;a href=&quot;https://github.com/vermiculus/apiwrap.el/#using-the-generated-macros&quot; rel=&quot;nofollow noreferrer&quot;&gt;when I define one of these target functions&lt;/a&gt; in application code, I get a docstring that looks like the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some-awesomely-generated-function is a Lisp function.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't get any link to where the function was defined in application code like I would if I was describing a normally-defined function.  The same applies for the macros generated by &lt;code&gt;generate-macros&lt;/code&gt;, though I'm less concerned for those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't get any link to where the function was defined like I would if I was describing a normally-defined function.  How can I declare where these functions are actually created, i.e., at macro-use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my explanation is unclear, refer to the real &lt;a href=&quot;https://github.com/vermiculus/apiwrap.el/blob/60f5a4e54144d24d7fb8a1674e879c4045fb118a/apiwrap.el#L152&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;generate-form&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://github.com/vermiculus/apiwrap.el/blob/60f5a4e54144d24d7fb8a1674e879c4045fb118a/apiwrap.el#L240&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;generate-macros&lt;/code&gt;&lt;/a&gt; code; each function is well-documented.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2017-02-25T17:58:36.250" LastActivityDate="2017-02-25T20:05:28.400" Title="How can I record where a function is defined if it's done indirectly?" Tags="|functions|elisp-macros|documentation|doc-strings|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31043" PostTypeId="5" CreationDate="2017-02-25T18:55:40.353" Score="0" Body="&lt;p&gt;Emacs Lisp uses the &lt;a href=&quot;/questions/tagged/list&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;list&amp;#39;&quot; rel=&quot;tag&quot;&gt;list&lt;/a&gt; data structure for &lt;a href=&quot;/questions/tagged/association-lists&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;association-lists&amp;#39;&quot; rel=&quot;tag&quot;&gt;association-lists&lt;/a&gt;, also called an &quot;alist&quot;.  Alists are different from &lt;a href=&quot;/questions/tagged/property-lists&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;property-lists&amp;#39;&quot; rel=&quot;tag&quot;&gt;property-lists&lt;/a&gt; (plists) and &lt;a href=&quot;/questions/tagged/hash-tables&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;hash-tables&amp;#39;&quot; rel=&quot;tag&quot;&gt;hash-tables&lt;/a&gt;, which also associate keys with values. Each has its advantages.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Association Lists&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hash Tables&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Property Lists&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-25T20:57:45.620" LastActivityDate="2017-02-25T20:57:45.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31044" PostTypeId="4" CreationDate="2017-02-25T18:55:40.353" Score="0" Body="or alist for short, maps keys to values. It is a list of key-value pairs, where each pair is a cons whose car is the key and whose cdr is the value. " OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-25T20:52:24.377" LastActivityDate="2017-02-25T20:52:24.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31045" PostTypeId="1" CreationDate="2017-02-25T19:09:37.107" Score="0" ViewCount="113" Body="&lt;p&gt;To effectively use a service's API, I'm leveraging &lt;code&gt;json-read&lt;/code&gt; to turn the JSON response into an understandable data structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((json-object-type 'alist)&#xA;      (json-array-type  'list)&#xA;      (json-key-type    'symbol)&#xA;      (json-false       nil)&#xA;      (json-null        nil))&#xA;  (json-read))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works &lt;em&gt;great&lt;/em&gt;, but gives me a &lt;em&gt;bunch&lt;/em&gt; of garbage that I don't care about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want a function &lt;code&gt;keep-structure&lt;/code&gt; that works through this alist and filters out all of the junk:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(keep-structure '((owner login) name)&#xA;                '((owner (login . &quot;octocat&quot;) (avatar . &quot;blah&quot;))&#xA;                  (name . &quot;Hello-World&quot;)&#xA;                  (some-url . &quot;https://some-domain&quot;)&#xA;                  (stars . 42)))&#xA;&#xA;;; =&amp;gt; ((owner (login . &quot;octocat&quot;))&#xA;       (name . &quot;Hello-World&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2017-02-25T21:10:41.337" LastActivityDate="2017-02-25T21:13:39.347" Title="How do I filter an alist to just the properties I care about?" Tags="|json|association-lists|filtering|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31046" PostTypeId="2" ParentId="31045" CreationDate="2017-02-25T19:09:37.107" Score="0" Body="&lt;p&gt;Take this for a spin:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dash)  ;; also needs emacs-25 for `if-let'&#xA;(defun keep-structure (structure object)&#xA;  (let* ((only-tops (mapcar (lambda (el)&#xA;                              (if (consp el) (car el) el))&#xA;                            structure))&#xA;         (top-pass (--filter (memq (car it) only-tops)&#xA;                             object)))&#xA;    (mapcar&#xA;     (lambda (subobj)&#xA;       (if-let ((substructure&#xA;                 (cdar (--filter (and (consp it)&#xA;                                      (eq (car subobj)&#xA;                                          (car it)))&#xA;                                 structure))))&#xA;           (cons (car subobj)&#xA;                 (keep-structure substructure (cdr subobj)))&#xA;         subobj))&#xA;     top-pass)))&#xA;&#xA;(keep-structure '((owner login) name)&#xA;                '((owner (login . &quot;octocat&quot;) (avatar . &quot;blah&quot;))&#xA;                  (name . &quot;Hello-World&quot;)&#xA;                  (some-url . &quot;https://some-domain&quot;)&#xA;                  (stars . 42)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2017-02-25T21:13:39.347" LastActivityDate="2017-02-25T21:13:39.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31047" PostTypeId="2" ParentId="31042" CreationDate="2017-02-25T19:53:42.910" Score="0" Body="&lt;p&gt;Normally, you should get a link to the right file &lt;em&gt;if&lt;/em&gt; you &lt;em&gt;load&lt;/em&gt; the file.  If you instead &lt;em&gt;evaluate&lt;/em&gt; the expression with &lt;code&gt;C-x C-e&lt;/code&gt; or &lt;code&gt;C-M-x&lt;/code&gt;, then indeed Emacs won't remember where the definition took place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Emacs only remembers the file name, so when you click on the link, it will try to guess where is the definition within the file (basically by looking for the function's name), and in your case it will likely fail, but it should at least get you to the right file.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-02-25T19:53:42.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31048" PostTypeId="2" ParentId="31015" CreationDate="2017-02-25T20:01:45.907" Score="1" Body="&lt;p&gt;There's no such variable.  However, you can still do this, by removing the function from &lt;code&gt;before-save-hook&lt;/code&gt;.  This is untested, but try:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(remove-hook  'before-save-hook 'octave-sync-function-file-names t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll have to do this in each octave-mode buffer, so you should probably do it from &lt;code&gt;octave-mode-hook&lt;/code&gt; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-octave-deactivate-sync-function ()&#xA;  &quot;Don't check equality of function and file names.&#xA;Add this to `octave-mode-hook'.&quot;&#xA;  (remove-hook 'before-save-hook 'octave-sync-function-file-names t))&#xA;&#xA;(add-hook 'octave-mode-hook #'my-octave-deactivate-sync-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="822" LastEditorUserId="2370" LastEditDate="2018-04-20T09:31:37.820" LastActivityDate="2018-04-20T09:31:37.820" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31049" PostTypeId="2" ParentId="31042" CreationDate="2017-02-25T20:05:28.400" Score="3" Body="&lt;p&gt;I think, you can do one of two things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define your own type to search for via find-func.el. This is how it's done in ert.el (Search for &lt;code&gt;current-load-list&lt;/code&gt; and &lt;code&gt;find-function-regexp-alist&lt;/code&gt;.)  But I don't think that this will work with help-mode buffers, i.e. no linkage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or extend find-function-regexp: Ordinarily this variable evaluates to a regexp to search for, so you could try to extend it, such that it also matches your macro constructs.  If that's not possible: The value of &lt;code&gt;(cdr (assq nil find-function-regexp-alist))&lt;/code&gt; may also be a function.  In this case you need to somehow determine that the search is about one of your symbols and do it; or fallback to the search  for a ordinary function.  &lt;code&gt;add-function&lt;/code&gt; may be helpful here, if you care for scalability:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun find-function-search-function-default (symbol)&#xA;  ;;Perform regular search here.&#xA;  )&#xA;&#xA;(defun find-my-function (next symbol)&#xA;  (if (not (my-function-p symbol))&#xA;      (funcall next symbol)&#xA;    (search-my-function-in-current-buffer)))&#xA;&#xA;(unless (functionp (cdr (assq nil find-function-regexp-alist)))&#xA;  (setcdr (assq nil find-function-regexp-alist) #'find-function-search-function-default))&#xA;&#xA;(add-function :around (cdr (assq nil find-function-regexp-alist)) #'find-my-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-02-25T20:05:28.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31050" PostTypeId="2" ParentId="31045" CreationDate="2017-02-25T20:38:56.580" Score="2" Body="&lt;p&gt;Recursion for the win.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun json-filter-paths (json paths)&#xA;  (mapcar (lambda (elt)&#xA;            (if (consp elt)&#xA;                (cons (car elt)&#xA;                      (json-filter-paths (cdr (assoc (car elt) json)) (cdr elt)))&#xA;              (cons elt (cdr (assoc elt json)))))&#xA;          paths))&#xA;&#xA;(json-filter-paths'((owner (login . &quot;octocat&quot;) (avatar . &quot;blah&quot;)&#xA;                           (meta (x . &quot;42&quot;) (y . &quot;43&quot;)))&#xA;                    (name . &quot;Hello-World&quot;)&#xA;                    (some-url . &quot;https://some-domain&quot;)&#xA;                    (stars . 42))&#xA;                  '(name (owner login (meta x))))&#xA;;; ((name . &quot;Hello-World&quot;) (owner (login . &quot;octocat&quot;) (meta (x . &quot;42&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-02-25T20:38:56.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31051" PostTypeId="1" CreationDate="2017-02-25T20:42:42.720" Score="1" ViewCount="92" Body="&lt;p&gt;I have a similar problem to the one asked here &lt;a href=&quot;https://emacs.stackexchange.com/questions/14763/exporting-org-file-breaks-when-upgrading-to-orgmode-8-3&quot;&gt;Exporting org file breaks when upgrading to orgmode 8.3&lt;/a&gt;, org-mode cannot export org files and raises this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Wrong type argument: listp, #(&quot;Peter's Emacs Config&quot; 0 19 (:parent (#0)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The solution &lt;strong&gt;aw&lt;/strong&gt; has given works for me, that is, &lt;code&gt;C-u M-x org-reload&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonetheless, I wanted to know why Emacs broke and how to fix such problems once and for all. Have not found anything on the Internet or on the GitHub page of org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;em&gt;GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8)&#xA; of 2016-10-26&lt;/em&gt; and org-version &lt;em&gt;9.0.5&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14548" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-02-25T21:07:23.023" Title="Exporting org file breaks" Tags="|org-mode|org-export|debugging|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31052" PostTypeId="2" ParentId="31051" CreationDate="2017-02-25T21:07:23.023" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The error message says that function &lt;code&gt;apply&lt;/code&gt; raised an error because it expected a list argument but was passed a (propertized) string argument.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;C-h f apply&lt;/code&gt; tells you that the last argument must be a list. It is likely that the last argument passed to &lt;code&gt;apply&lt;/code&gt; is the string that is cited in the error message.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can see more if you set variable &lt;code&gt;debug-on-error&lt;/code&gt; to &lt;code&gt;t&lt;/code&gt; and then provoke the error again. That will show you a backtrace of function calls. The backtrace will be more helpful if you first load the source code where the error is raised, that is, the &lt;code&gt;*.el&lt;/code&gt; file, not the &lt;code&gt;*.elc&lt;/code&gt; file, which is byte-compiled.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The backtrace will show you which function called &lt;code&gt;apply&lt;/code&gt; erroneously.  You can use &lt;code&gt;M-x debug-on-entry FUN&lt;/code&gt;, where &lt;code&gt;FUN&lt;/code&gt; is that function. That will open the interactive debugger each time function &lt;code&gt;FUN&lt;/code&gt; is called.  You can use &lt;code&gt;d&lt;/code&gt; in the debugger to step through evaluation. Or you can use &lt;code&gt;c&lt;/code&gt; to skip through an evaluation without going into its details.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-25T21:07:23.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31053" PostTypeId="1" CreationDate="2017-02-25T22:25:48.377" Score="2" ViewCount="126" Body="&lt;p&gt;Opening a new *shell* buffer takes over any window other than the one I type the command into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What variable changes this behavior?  I have a guess the choices will be the same as these:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hide Erc Join Buffer: Value Menu Bury in new buffer&#xA;    State : CHANGED outside Customize.&#xA;   Determines how to display a newly created IRC buffer. Hide&#xA;&#xA;   The available choices are:&#xA;&#xA;     ‘window’          - in another window,&#xA;     ‘window-noselect’ - in another window, but don’t select that one,&#xA;     ‘frame’           - in another frame,&#xA;     ‘bury’            - bury it in a new buffer,&#xA;     ‘buffer’          - in place of the current buffer,&#xA;     any other value  - in place of the current buffer.&#xA;Groups: Erc Buffers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That variable is &lt;code&gt;erc-join-buffer&lt;/code&gt;.  Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6682" LastActivityDate="2017-02-25T22:25:48.377" Title="Window placement of new shell buffer" Tags="|window|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31054" PostTypeId="5" CreationDate="2017-02-25T22:49:36.383" Score="0" Body="&lt;p&gt;For generic questions, use the tag &lt;a href=&quot;/questions/tagged/javascript&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;javascript&amp;#39;&quot; rel=&quot;tag&quot;&gt;javascript&lt;/a&gt;. For the latest &lt;a href=&quot;/questions/tagged/major-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;major-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;major-mode&lt;/a&gt; for &lt;a href=&quot;/questions/tagged/javascript&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;javascript&amp;#39;&quot; rel=&quot;tag&quot;&gt;javascript&lt;/a&gt;, use the &lt;a href=&quot;/questions/tagged/js2-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;js2-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;js2-mode&lt;/a&gt; tag. Unrelated to &lt;a href=&quot;/questions/tagged/javascript&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;javascript&amp;#39;&quot; rel=&quot;tag&quot;&gt;javascript&lt;/a&gt; is the support for the &lt;a href=&quot;/questions/tagged/java&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;java&amp;#39;&quot; rel=&quot;tag&quot;&gt;java&lt;/a&gt; language in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/JavaScriptMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Javascript support in Emacs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/Js2Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;js2mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-27T16:44:27.437" LastActivityDate="2017-02-27T16:44:27.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31055" PostTypeId="4" CreationDate="2017-02-25T22:49:36.383" Score="0" Body="for the use (typically editing) of JavaScript code in Emacs." OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-26T00:01:36.243" LastActivityDate="2017-02-26T00:01:36.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31056" PostTypeId="1" CreationDate="2017-02-25T23:28:23.993" Score="0" ViewCount="201" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first time I run &lt;code&gt;magit-status&lt;/code&gt; after starting Emacs, I get a series of 7 alert dialogs popping up. Each one just says &quot;emacsclient 25.1&quot; and has an OK button. They don't seem to do anything at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nothing in the &lt;code&gt;*Messages*&lt;/code&gt; buffer seems to relate to this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw some reference in the Magit manual about needing to locate emacsclient, so I did put &lt;code&gt;C:\Emacs\bin&lt;/code&gt; into my path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only happens the first time. After that, &lt;code&gt;magit-status&lt;/code&gt; works fine without any popups at all. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt; More information... It looks like this is coming from within Magit's &lt;code&gt;with-editor-locate-emacsclient&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just tried running that function directly. Got the same bunch of dialogs. After confirming them all (they only have &quot;OK&quot; buttons, so confirm it is, I guess!) I get something in &lt;code&gt;*Warnings*&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning (with-editor): Cannot determine a suitable Emacsclient&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Determining an Emacsclient executable suitable for the current Emacs&#xA;  instance failed.  For more information please see&#xA;  &lt;a href=&quot;https://github.com/magit/magit/wiki/Emacsclient&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/magit/magit/wiki/Emacsclient&lt;/a&gt;. Warning&#xA;  (with-editor): Cannot determine a suitable Emacsclient&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Determining an Emacsclient executable suitable for the current Emacs&#xA;  instance failed.  For more information please see&#xA;  &lt;a href=&quot;https://github.com/magit/magit/wiki/Emacsclient&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/magit/magit/wiki/Emacsclient&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It looks a lot like a path problem, even though the directory that has emacsclient.exe is on my path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;System Config&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Magit 2.10.2&lt;/li&gt;&#xA;&lt;li&gt;Windows 10&lt;/li&gt;&#xA;&lt;li&gt;Emacs 25.1.1&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user11238" LastEditorDisplayName="user11238" LastEditDate="2017-02-26T02:20:53.237" LastActivityDate="2017-02-26T02:33:33.217" Title="Magit + Emacs + Windows: 7 alert dialogs on first use?" Tags="|magit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31057" PostTypeId="2" ParentId="17830" CreationDate="2017-02-26T00:07:41.107" Score="1" Body="&lt;p&gt;OK, I think I've narrowed this down (at least for my case). the problem appears to be with goto-address-prog-mode. Below is a minimal init.el which will load the latest org-plus-contrib from org and a simple test.org file. I start emacs with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/usr/local/bin/emacs -q -l ./init.el --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and will get the org-mode fontification error message when I open test.org. Remove the hook line to load goto-address-prog-mode and all is OK. If I use the org-mode which comes with emcas 25.1, no error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The init file is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;&#xA;(setq package-enable-at-startup nil)&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))&#xA;(package-initialize)&#xA;&#xA;(unless (package-installed-p 'org-plus-contrib)&#xA;  (package-refresh-contents)&#xA;  (package-install 'org-plus-contrib))&#xA;&#xA;(require 'org)&#xA;&#xA;(require 'goto-addr)&#xA;&#xA;(add-hook 'prog-mode-hook 'goto-address-prog-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the test.org file is simply&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; * Test   &#xA;   This is a simple test org file&#xA;&#xA;   #+BEGIN_SRC emacs-lisp&#xA;     (message &quot;A Test&quot;)  &#xA;   #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is emacs 25.1 running on Ubuntu built from the tarball. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)&#xA;of 2017-02-25&lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2017-02-26T00:07:41.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31058" PostTypeId="1" AcceptedAnswerId="31063" CreationDate="2017-02-26T00:32:38.230" Score="3" ViewCount="2650" Body="&lt;p&gt;When I start Emacs (by clicking on a desktop icon), its frame is too big for the screen, so the mode-line/mini-buffer area is not visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not difficult to resize and reposition the frame, but it is irritating to have to do this every time one starts Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I preserve the size of the Emacs window across sessions?&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2017-02-26T02:04:28.733" LastActivityDate="2017-02-26T17:19:36.347" Title="How to make size of Emacs frame persistent?" Tags="|frames|microsoft-windows|customize|start-up|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31059" PostTypeId="2" ParentId="31058" CreationDate="2017-02-26T02:03:01.780" Score="3" Body="&lt;p&gt;Customize option &lt;code&gt;default-frame-alist&lt;/code&gt;, in particular by providing a helpful value for frame parameter &lt;code&gt;height&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x customize-option RET default-frame-alist RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Be sure to save your changes to the value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, nodes &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Initial-Parameters.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Initial Parameters&lt;/a&gt; and &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Size-Parameters.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Size Parameters&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-02-26T02:03:01.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31060" PostTypeId="1" CreationDate="2017-02-26T02:09:27.260" Score="4" ViewCount="2119" Body="&lt;p&gt;The manual says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For the daily/weekly agenda, the items for each day are sorted. The&#xA;  default order is to first collect all items containing an explicit&#xA;  time-of-day specification.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    8:30-13:00 Arthur Dent lies in front of the bulldozer&#xA;    12:45...... Ford Prefect arrives and takes Arthur to the pub&#xA;    14:00-15:00 TODO Call John regarding memo&#xA;    19:00...... The Vogon reads his poem&#xA;    20:30-22:15 Marvin escorts the Hitchhikers to the bridge&#xA;    TODO send newsletter to mailing list&#xA;    TODO buy John birthday gift           :errands:&#xA;    Internship period for Alex&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I tweak `org-agenda-sorting-strategy' so that I can first display all items containing no time-of-day specification like in&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Internship period for Alex&#xA;    TODO send newsletter to mailing list&#xA;    TODO buy John birthday gift           :errands:&#xA;    8:30-13:00 Arthur Dent lies in front of the bulldozer&#xA;    12:45...... Ford Prefect arrives and takes Arthur to the pub&#xA;    14:00-15:00 TODO Call John regarding memo&#xA;    19:00...... The Vogon reads his poem&#xA;    20:30-22:15 Marvin escorts the Hitchhikers to the bridge&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14892" LastEditorUserId="14892" LastEditDate="2017-03-02T06:34:20.093" LastActivityDate="2020-04-09T13:23:59.667" Title="org-agenda-sorting-strategy: items containing no time-of-day specification first" Tags="|org-mode|sorting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31061" PostTypeId="2" ParentId="31056" CreationDate="2017-02-26T02:33:33.217" Score="1" Body="&lt;p&gt;&lt;strong&gt;Solved&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Magit has a library called &lt;code&gt;with-editor&lt;/code&gt; that attempts to locate a suitable &lt;code&gt;emacsclient&lt;/code&gt; on the host machine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason, the &lt;code&gt;emacsclient.exe&lt;/code&gt; in Emacs 25.1 for Windows doesn't report its version to the console. Instead it pops up the dialog box I've been seeing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/magit/with-editor/issues/21&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/magit/with-editor/issues/21&lt;/a&gt; for another report of the same issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As suggested by the maintainer of Magit, I set &lt;code&gt;with-editor-emacsclient-executable&lt;/code&gt; to nil, but only on Windows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (eq system-type 'windows-nt)&#xA;    (setq with-editor-emacsclient-executable nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that, no more popups.&lt;/p&gt;&#xA;" OwnerDisplayName="user11238" LastActivityDate="2017-02-26T02:33:33.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31062" PostTypeId="2" ParentId="31060" CreationDate="2017-02-26T02:40:06.583" Score="1" Body="&lt;p&gt;Check the current setting of &lt;code&gt;org-agenda-sorting-strategy&lt;/code&gt;. It should be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((agenda time-up priority-down category-keep)&#xA; (todo priority-down category-keep)&#xA; (tags priority-down category-keep)&#xA; (search category-keep))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Changing the order of sorting strategies for the agenda should do what you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-sorting-strategy &#xA;    '((agenda priority-down category-keep time-up)&#xA;      (todo priority-down category-keep)&#xA;      (tags priority-down category-keep)&#xA;      (search category-keep)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Read the documentation of the variable for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: As the OP points out in the comments, this does not work. It &lt;em&gt;should&lt;/em&gt; be possible to do what he wants using a user-defined comparison function as described in my comment below, but that is TBD.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2017-02-27T18:48:16.507" LastActivityDate="2017-02-27T18:48:16.507" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31063" PostTypeId="2" ParentId="31058" CreationDate="2017-02-26T02:57:03.547" Score="3" Body="&lt;p&gt;Just as @Drew states.&#xA;I use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defconst frame-default-top      0  &quot;The 'top'  position property of a frame.&quot;)&#xA;(defconst frame-default-left     0  &quot;The 'left' position property of a frame.&quot;)&#xA;(defconst frame-default-height  60  &quot;The default frame height.&quot;)&#xA;(defconst frame-default-width  188  &quot;The default frame width.&quot;)&#xA;&#xA;(add-to-list 'default-frame-alist (cons 'left   frame-default-left))&#xA;(add-to-list 'default-frame-alist (cons 'top    frame-default-top))&#xA;(add-to-list 'default-frame-alist (cons 'height frame-default-height))&#xA;(add-to-list 'default-frame-alist (cons 'width  frame-default-width))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want only the initial frame use initial-frame-alist. I set both which is probably overkill.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'initial-frame-alist (cons 'left   frame-default-left))&#xA;(add-to-list 'initial-frame-alist (cons 'top    frame-default-top))&#xA;(add-to-list 'initial-frame-alist (cons 'height frame-default-height))&#xA;(add-to-list 'initial-frame-alist (cons 'width  frame-default-width))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="13934" LastEditDate="2017-02-26T03:02:04.513" LastActivityDate="2017-02-26T03:02:04.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31065" PostTypeId="2" ParentId="30456" CreationDate="2017-02-26T09:40:46.277" Score="0" Body="&lt;p&gt;I can think of a few variations and options one might want to add, but this seems to work for me. Try it, @zotherstupidguy, and get back to me with suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upon saving the org file it will look for any heading containing a property of &lt;code&gt;SAVE-TO-FILE&lt;/code&gt; whose value is the filename to save to, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;:SAVE-TO-FILE: ~/my-ext-file&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It will save everything in that heading, including the heading itself and the property drawer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun save-headings-external ()&#xA;&quot;Save all heading containing special property to an external file&quot;&#xA;(interactive)&#xA;(when (string= major-mode &quot;org-mode&quot;)&#xA;  (goto-char (point-min))&#xA;  (let (-extfname -start)&#xA;    (while (re-search-forward &quot;:PROPERTIES:&quot; nil t)&#xA;      (when (setq -extfname (org-entry-get (point) &quot;SAVE-TO-FILE&quot;))&#xA;        (save-excursion&#xA;          (org-back-to-heading)&#xA;          (setq -start (point))&#xA;          (org-forward-heading-same-level 1 t)&#xA;          (write-region -start (point) -extfname)&#xA;          (message &quot;Wrote '%s'&quot; -extfname)))))))&#xA;&#xA;(add-hook 'write-file-hooks 'save-headings-external)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(You can delete the &lt;code&gt;(message...)&lt;/code&gt; if you want)&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2017-02-28T11:54:32.830" LastActivityDate="2017-02-28T11:54:32.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31067" PostTypeId="1" CreationDate="2017-02-26T15:44:47.903" Score="2" ViewCount="682" Body="&lt;p&gt;I am building a database application to index org-mode files (&lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2017/01/03/Find-stuff-in-org-mode-anywhere/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2017/01/03/Find-stuff-in-org-mode-anywhere/&lt;/a&gt;). The first iteration used emacsql, which worked well for a proof of concept, but it builds a database that isn't easily compatible with other ways to interact with the database because it stores things as lisp-readable values. I would like to try using sql strings in the scripts more directly for CRUD operations on the database so that other scripts, e.g. in Python, or the shell could also interact with the database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another way to use sql inside of emacs-lisp scripts? In particular a library that would enable syntax like this where ? (or something like it) is a placeholder for values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(sql-execute &quot;SELECT * FROM stocks WHERE symbol=?&quot; t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is apparently a more secure way (&lt;a href=&quot;https://xkcd.com/327/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://xkcd.com/327/&lt;/a&gt;) to do this than:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(sql-execute (format &quot;SELECT * FROM stocks WHERE symbol=%s&quot; t))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command would return a list of results? It is not essential that it work on sqlite, eventually I will use a server like postgresql or mysql I think. I have found many sql-modes, repls, etc. but nothing that seems designed for working in scripts.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="105" LastEditDate="2017-02-26T22:00:52.970" LastActivityDate="2017-02-26T22:00:52.970" Title="How do you perform sql queries in emacs-lisp scripts?" Tags="|sql|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31068" PostTypeId="2" ParentId="22278" CreationDate="2017-02-26T16:38:07.913" Score="2" Body="&lt;p&gt;The built-in &lt;code&gt;bs&lt;/code&gt; library has support for defining one or more configurations that you can use to cycle between buffers. The commands &lt;code&gt;bs-cycle-next&lt;/code&gt; and &lt;code&gt;bs-cycle-previous&lt;/code&gt; move back and forth between the buffers defined by the current configuration (&lt;code&gt;bs-current-configuration&lt;/code&gt;). Configurations can define a subset of buffers, as well as a sort order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be able to customize this library to meet your needs. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-02-26T16:38:07.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31069" PostTypeId="2" ParentId="31058" CreationDate="2017-02-26T17:19:36.347" Score="3" Body="&lt;p&gt;A slightly more concise version:&#xA;&lt;code&gt;&#xA;  ;; Set Frame width/height&#xA;  (setq default-frame-alist&#xA;        '((top . 25) (left . 275) (width . 105) (height . 60)))&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes the frame centered and approximately 2/3 of a 13inch laptop screen.&lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2017-02-26T17:19:36.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31070" PostTypeId="1" AcceptedAnswerId="31071" CreationDate="2017-02-26T17:58:16.123" Score="3" ViewCount="1326" Body="&lt;p&gt;I am using org-mode as a labbook and it is working pretty nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often have the situation where I need to state which material/reagents were used in an experiment and those are an ever growing pool that are used in multiple experiments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to collect all the used material/reagents in one file and be able to link to them using the mini-buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have org-ref in mind and the way it accesses bibtex files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea would be to run a command that shows me a list of all the reagents/materials in a table and me being able to search the table and insert the names and other information of the reagents/materials.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do it already? If not, what do I need to look into to make it possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example table that would sit in a file called materials.org&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name      | Manufacturer  | Catalog Number | Molecular Weight | Stock conc. |&#xA;|-----------+---------------+----------------+------------------+-------------|&#xA;| TWEEN® 20 | Sigma-Aldrich | P9416 SIGMA    |             1228 |        100% |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it would be nice to access this via a search in the minibuffer and insert that line of the table into the new file.&lt;/p&gt;&#xA;" OwnerUserId="13452" LastEditorUserId="13452" LastEditDate="2017-02-26T19:26:25.390" LastActivityDate="2017-03-29T01:12:08.820" Title="Small database-like org files that can be accessed in other org files?" Tags="|org-mode|org-ref|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31071" PostTypeId="2" ParentId="31070" CreationDate="2017-02-27T00:12:33.483" Score="3" Body="&lt;p&gt;Suppose instead of putting all your reagents in one file, and then looking them up you use a syntax like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+attr_org: :type reagents&#xA;| Tween 20 | Sigma-Aldrich | batch-1 |&#xA;| acetone  | Fisher        |    3456 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your notebook entries. then, you can loop through your notebook files and collect them, and use that information in a completion tool like helm. It might look something like this. Here we specify a list of files (one in this case) and loop through them collecting all the tables with an attr_org type of reagents. We eliminate duplicates, and then construct the helm candidates. Finally the helm command gives you the list, you mark what you want, and they are inserted. It doesn't offer any promise the fields are all in the same order or anything. ou could pretty easily adapt this to a single table in a single file that had a long list of reagents. After many years (maybe even months) though the table might get large, with entries you ran out of a while ago though.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq notebook-files '(&quot;blog.org&quot;))&#xA;&#xA;(defun insert-reagent ()&#xA;  &quot;Insert a reagent as a table row.&quot;&#xA;  (interactive)&#xA;  (let ((candidates '()))&#xA;    (loop for nbfile in notebook-files&#xA;      do&#xA;      (setq candidates (append candidates (-flatten-n 1&#xA;                           (org-element-map (org-element-parse-buffer) 'table&#xA;                         (lambda (table)&#xA;                           (when (string=&#xA;                              &quot;reagents&quot;&#xA;                              (plist-get (org-export-read-attribute :attr_org table) :type))&#xA;                             (save-excursion&#xA;                               (goto-char (org-element-property :contents-begin table))&#xA;                               (org-babel-read-table)))))))))&#xA;    ;; get unique reagents&#xA;    (setq candidates (-uniq candidates))&#xA;    (setq candidates (mapcar (lambda (s)&#xA;                   (cons (mapconcat (lambda (e) (format &quot;%s&quot; e)) s &quot; | &quot;) s))&#xA;                 candidates))&#xA;    (helm :sources&#xA;      (helm-build-sync-source &quot;Reagents&quot;&#xA;        :candidates candidates&#xA;        :action '((&quot;Insert&quot; . (lambda (_)&#xA;                    (loop for choice in (helm-marked-candidates)&#xA;                      do &#xA;                      (insert &quot;| &quot;&#xA;                          (mapconcat&#xA;                           (lambda (e)&#xA;                             (format &quot;%s&quot; e)) choice &quot; | &quot;)&#xA;                          &quot; |&quot;)&#xA;                      (org-ctrl-c-ctrl-c)&#xA;                      (insert &quot;\n&quot;)))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;An alternative might be to use org-headings and properties to store your information. You could then link to them with org-id for example, and have an easy way to find all the experiments that used a particular reagent.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-02-27T00:12:33.483" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31072" PostTypeId="1" AcceptedAnswerId="31114" CreationDate="2017-02-27T02:43:16.617" Score="0" ViewCount="37" Body="&lt;p&gt;I would like to run a custom function whenever a new &lt;code&gt;*Scratch*&lt;/code&gt; buffer is created because the last uninteresting buffer was killed.  I looked at both the C source code and &lt;code&gt;window.el&lt;/code&gt; and it appears that &lt;code&gt;Lisp&lt;/code&gt; has nothing to do with the &lt;code&gt;*Scratch*&lt;/code&gt; buffer being displayed in a particular window, but I'm not 100% certain.  It appears as though &lt;code&gt;tem = Fother_buffer (buffer, Qnil, Qnil)&lt;/code&gt; within &lt;code&gt;kill-buffer&lt;/code&gt; is what leads to the creation of a new &lt;code&gt;*Scratch*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything other than the &lt;code&gt;buffer-list-update-hook&lt;/code&gt; that I could use to trigger my custom function when a new &lt;code&gt;*Scratch*&lt;/code&gt; gets spawned?  I don't think that &lt;code&gt;replace-buffer-in-windows&lt;/code&gt; is any help in this context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[I don't really want to advise &lt;code&gt;get-buffer-create&lt;/code&gt;.]&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-02-28T06:06:47.397" Title="Trigger custom function when `*Scratch*` is recreated" Tags="|scratch-buffer|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31073" PostTypeId="1" AcceptedAnswerId="31077" CreationDate="2017-02-27T03:11:04.253" Score="2" ViewCount="690" Body="&lt;p&gt;I want to print elisp code result as original but currently it will output with &quot;|&quot; separated.&#xA;for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(setq my-list '(apple orange peach))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code block will output as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;| apple | orange | peach |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get output as original style like below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+RESULTS:&#xA; (apple orange peach)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14840" LastEditorUserId="9340" LastEditDate="2017-02-28T00:46:09.123" LastActivityDate="2017-03-02T15:29:25.253" Title="Elisp code output style in org mode" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31074" PostTypeId="1" AcceptedAnswerId="31079" CreationDate="2017-02-27T03:13:17.540" Score="0" ViewCount="809" Body="&lt;p&gt;I'd like to use a fractional font size throughout Emacs.  I have been able to set my default font size on launch using &lt;code&gt;custom-set-faces&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA; '(default ((t (:inherit nil :stipple nil :background &quot;#212121&quot;&#xA;    :foreground &quot;#e8e8d3&quot; :inverse-video nil :box nil&#xA;    :strike-through nil :overline nil :underline nil :slant normal&#xA;    :weight normal :height 185 :width normal :foundry &quot;nil&quot; :family &quot;Menlo&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above configuration works fine on launch after Emacs finally settles on its default frame size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I create a new frame, this font is not utilized.  I understand that I can use &lt;code&gt;default-frame-alist&lt;/code&gt; to configure the new frame font, but &lt;code&gt;default-frame-alist&lt;/code&gt; uses entirely different configuration data which does not seem to support fractional sizes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist&#xA;        '((width . 142)&#xA;          (height . 54)&#xA;          (font . &quot;-*-Menlo-normal-normal-normal-*-18.5-185-*-*-m-0-iso10646-1&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above configuration does not work as expected -- the fractional portion is ignored and I simply receive a frame with an 18 point font.&lt;/p&gt;&#xA;" OwnerUserId="11661" LastActivityDate="2017-03-29T10:24:58.070" Title="How to configure new frame font using custom-set-faces?" Tags="|init-file|fonts|" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31075" PostTypeId="1" AcceptedAnswerId="31076" CreationDate="2017-02-27T03:22:39.277" Score="1" ViewCount="560" Body="&lt;p&gt;Org mode only print the last line into result block, can I get all print code into result block?&#xA;for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(setq my-list '(apple orange peach))&#xA;(print (car my-list))&#xA;(print (cdr my-list))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;| orange | peach |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now it only capture the last print statement, I wish to capture:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: apple&#xA;| orange | peach |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2022-11-14T15:36:09.697" Title="elisp - multiple line print in org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31076" PostTypeId="2" ParentId="31075" CreationDate="2017-02-27T03:40:31.353" Score="2" Body="&lt;p&gt;By default, code blocks return the &lt;code&gt;value&lt;/code&gt; of the last statement in the block. In your example, this is the value returned by &lt;code&gt;(print (cdr my-list))&lt;/code&gt;, which is the same as the value returned by &lt;code&gt;(cdr my-list)&lt;/code&gt;. You can use the &lt;code&gt;:results&lt;/code&gt; flag to switch to &lt;code&gt;output&lt;/code&gt; mode, where the output produced by your entire code block is returned:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results output&#xA;(setq my-list '(apple orange peach))&#xA;(print (car my-list))&#xA;(print (cdr my-list))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &#xA;: apple&#xA;: &#xA;: (orange peach)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The various flags and their options are described in &lt;a href=&quot;https://orgmode.org/manual/Results-of-Evaluation.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;(org) Results of Evaluation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2022-11-14T15:36:09.697" LastActivityDate="2022-11-14T15:36:09.697" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="31077" PostTypeId="2" ParentId="31073" CreationDate="2017-02-27T04:00:02.963" Score="5" Body="&lt;p&gt;Add &lt;code&gt;:results output&lt;/code&gt; to the header line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results output&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-27T04:00:02.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31078" PostTypeId="1" CreationDate="2017-02-27T05:35:56.877" Score="0" ViewCount="515" Body="&lt;p&gt;Consider the following very simple Python project tree:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.&#xA;├── main.py&#xA;└── second.py&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;main.py:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import second as s&#xA;&#xA;def foo(arg):&#xA;    arg.helloWorld()&#xA;&#xA;foo(s)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;second.py:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def helloWorld():&#xA;    print(&quot;Hello World!&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My Jedi setup in ~/.emacs.d/init.el is the same as &lt;a href=&quot;https://github.com/wernerandrew/jedi-starter/blob/master/jedi-starter.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;this file&lt;/a&gt;, but you can also see my exact setup &lt;a href=&quot;https://github.com/dmalyuta/dotfiles/blob/master/.emacs.d/init.el#L555&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This project runs fine (&lt;code&gt;python main.py&lt;/code&gt; outputs &lt;code&gt;Hello World!&lt;/code&gt;) but running &lt;code&gt;jedi:goto-definition&lt;/code&gt; on the &lt;code&gt;helloWorld&lt;/code&gt; in &lt;code&gt;arg.helloWorld()&lt;/code&gt; gives &lt;code&gt;Definition not found.&lt;/code&gt;. However, if I were to change &lt;code&gt;main.py&lt;/code&gt; directly to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import second as s&#xA;&#xA;s.helloWorld()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;jedi:goto-definition&lt;/code&gt; works and jumps to the &lt;code&gt;def helloWorld()&lt;/code&gt; in &lt;code&gt;second.py&lt;/code&gt;! So it looks to be a problem with Jedi not recognizing &lt;code&gt;arg&lt;/code&gt; as coming from &lt;code&gt;s&lt;/code&gt;? I am new to Python and maybe there is an intricacy that I am missing... but the bottom line is that I want Jedi to jump to the definition of &lt;code&gt;helloWorld&lt;/code&gt;. How do I achieve this? Thanks for helping!&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2017-02-27T13:44:43.473" Title="Python definitions not found by Jedi" Tags="|python|auto-complete-mode|jedi|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31079" PostTypeId="2" ParentId="31074" CreationDate="2017-02-27T08:19:54.377" Score="1" Body="&lt;p&gt;Configuring the &lt;code&gt;default&lt;/code&gt; font is the best way to go, rather than using frame parameters. As you can see, the &lt;code&gt;font&lt;/code&gt; frame parameter is equivalent only to the &lt;code&gt;:font&lt;/code&gt; attribute of the default face. It can be any font name your system supports, so you can probably use an xft-style font name as well. The older style of font name that you're using basically pre-dates vector fonts, so it's integers all the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would turn off all of your frame parameter customizations and see if you can get back to having it just work with the &lt;code&gt;default&lt;/code&gt; font. That's the default behavior, so something must be changing it.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-27T08:19:54.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31080" PostTypeId="1" AcceptedAnswerId="31082" CreationDate="2017-02-27T09:31:44.973" Score="1" ViewCount="255" Body="&lt;p&gt;I'm using avy to select and insert symbols on screen with the help of &lt;code&gt;thing-at-point&lt;/code&gt;. Is there an obvious way to get this to include periods? At the moment if I select &lt;code&gt;self.blah&lt;/code&gt; I get just &lt;code&gt;self&lt;/code&gt; (or &lt;code&gt;blah&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can &lt;del&gt;obviously&lt;/del&gt; do this using regular expressions, &lt;code&gt;save-excursion&lt;/code&gt;, and searching back and forward. But a standard approach seems less verbose and likely a better thing to learn.&lt;/p&gt;&#xA;" OwnerUserId="14161" LastEditorUserId="14161" LastEditDate="2017-02-28T10:58:37.860" LastActivityDate="2017-02-28T10:58:37.860" Title="Get thing-at-point to include periods" Tags="|copy-paste|syntax-table|avy|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31081" PostTypeId="2" ParentId="31078" CreationDate="2017-02-27T10:33:04.320" Score="0" Body="&lt;p&gt;&lt;code&gt;foo&lt;/code&gt; can be called with any &lt;code&gt;arg&lt;/code&gt;, (&lt;code&gt;arg&lt;/code&gt; should have a &lt;code&gt;helloWorld&lt;/code&gt; method if you don't want to raise an exception, but it doesn't have to...), so it is impossible to know what &lt;code&gt;arg&lt;/code&gt; could be in the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import second as s&#xA;&#xA;class Hello:&#xA;    def helloWorld(self):&#xA;        print('I can say hello too!')&#xA;&#xA;def foo(arg):&#xA;    arg.helloWorld() # Where could helloWorld come from?&#xA;&#xA;foo(s)         # from s?&#xA;foo(Hello())   # from Hello?&#xA;foo(2)         # doesn't even exist&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, &lt;code&gt;jedi&lt;/code&gt; can't know...&lt;/p&gt;&#xA;" OwnerUserId="15026" LastActivityDate="2017-02-27T10:33:04.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31082" PostTypeId="2" ParentId="31080" CreationDate="2017-02-27T11:26:08.560" Score="5" Body="&lt;p&gt;What about this.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun dotted-symbol-at-point ()&#xA;  (with-syntax-table (make-syntax-table (syntax-table))&#xA;    (modify-syntax-entry ?. &quot;_&quot;)&#xA;    (thing-at-point 'symbol)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-02-27T11:26:08.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31083" PostTypeId="2" ParentId="30982" CreationDate="2017-02-27T13:32:09.387" Score="0" Body="&lt;p&gt;In the end, I'm going to stick with my original solution of using faux links to mask text. It's pretty simple and it does serve my needs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks everyone for your help and creative thinking on the subject.&lt;/p&gt;&#xA;" OwnerUserId="14124" LastActivityDate="2017-02-27T13:32:09.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31084" PostTypeId="1" AcceptedAnswerId="31087" CreationDate="2017-02-27T13:42:32.867" Score="4" ViewCount="998" Body="&lt;p&gt;I have run into an error with latest version of org-mode and cannot seem to find how to track it down. I have reported the issue on the org mail list, but so far the only response indicates they could not reproduce the issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have tried the following&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Ensured it is not a mixed version issue. A common org problem occurs when you try to install a new version, but some of the old version has already been loaded. I used all the standard techniques to avoid this problem and even deleted the version of org which comes with emacs 25. So I'm pretty sure it is not a mixed version problem.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I have tried with both emacs 25.1 and emacs 25.2-rc2. Same issue&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I have tried using different accounts (same desktop) - one of which was a completely fresh account. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I've check for load-file shadows, but all looks correct. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I get the same issue with both the org and org-plus-contgrib packages&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also tried the org package in elpa (which is same version as the one in the org archive). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I have downloaded and built the package from sources. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I have tried opening an org file without source blocks, which is fine, but then when I open the first one with a source block, I get the error. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I have tried org-reload with and without the arg to load from *.el before opening the org file with source blocks and it makes no difference.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The error only occurs when I am also loading the goto-address-prog-mode mode (part of goto-addr package in emacs). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you first visit an org file with a src_block, you get the error org-mode fontificaiton error at line x. It doesn't seem to matter what the src-block type is i.e. emacs-lisp or sh both give the same error. The code in the sr block is not fontified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you then kill the buffer and then re-open the org file a second time, it loads fine - no errors and src blocks are fontified. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes me suspect that org is loading something, but is not loading it until after it has loaded the org file - possibly goto-address-prog-mode is holding things up. However, I cannot work out how to generate a stacktrace. Setting debug-on-error has no effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been using the goto-address-prog-mode with org for some time and only noticed this problem when updating most recent version from org repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas? Suggestions? How can I dig into this to find out what the problem is? How can I get a debug backtrace? Can anyone else reproduce this issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minimal init.el file I use to reproduce this problem is below. I ensure there is nothing in my .emacs.d/elpa directory (in fact, I delete it before starting). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;&#xA;(setq package-enable-at-startup nil)&#xA;(add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;))&#xA;(package-initialize)&#xA;&#xA;(unless (package-installed-p 'org-plus-contrib)&#xA;  (package-refresh-contents)&#xA;  (package-install 'org-plus-contrib))&#xA;&#xA;(require 'org)&#xA;&#xA;(require 'goto-addr)&#xA;&#xA;(add-hook 'prog-mode-hook 'goto-address-prog-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the test org file I use is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Test&#xA;  This is a test of fontification in org files which contain source blocks&#xA;&#xA;  First, we test an sh block&#xA;&#xA;  #+BEGIN_SRC sh&#xA;    echo &quot;Hello world&quot;&#xA;  #+END_SRC&#xA;&#xA;  Next, a simple emacs lisp source block&#xA;&#xA;  #+BEGIN_SRC emacs-lisp&#xA;    ;; A simple test&#xA;    (message &quot;A Test&quot;)&#xA;  #+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I start emacs with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs -Q -l .emacs.d/init.el --debug-init&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2017-02-28T14:37:34.137" Title="Debugging org-mode fontification error" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31085" PostTypeId="2" ParentId="31078" CreationDate="2017-02-27T13:44:43.473" Score="1" Body="&lt;p&gt;Works as expected for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ pip show jedi&#xA;---&#xA;Name: jedi&#xA;Version: 0.10.0&#xA;Location: /usr/local/lib/python2.7/dist-packages&#xA;Requires:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Ensure the latest version of Jedi:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pip install --upgrade jedi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2017-02-27T13:44:43.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31086" PostTypeId="1" CreationDate="2017-02-27T14:03:09.020" Score="2" ViewCount="88" Body="&lt;p&gt;I need to use a version of &lt;code&gt;prolog.el&lt;/code&gt; not older than 1.25, so I defined the function &lt;code&gt;maybe-reload-prolog-el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun maybe-reload-prolog-el ()&#xA;  (when (version&amp;lt; prolog-mode-version &quot;1.25&quot;)&#xA;    (add-to-list&#xA;     'load-path&#xA;     (file-name-as-directory (concat my-lib-path &quot;prolog-el&quot;)))&#xA;    (load-library &quot;prolog&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...which adds the path to my personal copy of &lt;code&gt;prolog.el&lt;/code&gt; to &lt;code&gt;load-path&lt;/code&gt; (and then reloads &lt;code&gt;prolog&lt;/code&gt;) if it detects that &lt;code&gt;prolog-mode-version&lt;/code&gt; is too old &lt;sup&gt;1&lt;/sup&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I put a call to &lt;code&gt;maybe-reload-prolog-el&lt;/code&gt; in a hook I already had for &lt;code&gt;prolog-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(add-hook 'prolog-mode-hook&#xA;  (lambda ()&#xA;    ;; ;; some keyboard settings, like&#xA;    ;; (local-set-key [f10] ...)&#xA;    ;; (local-set-key  [f9] ...)&#xA;    ;; ;; etc&#xA;    (&lt;b&gt;maybe-reload-prolog-el&lt;/b&gt;)))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main problem with this approach is that &lt;code&gt;prolog.el&lt;/code&gt; is responsible for more than &lt;code&gt;prolog-mode&lt;/code&gt;.  For example, it has the code for the autoloaded function &lt;code&gt;run-prolog&lt;/code&gt;, which I use to run a Prolog sub-process in an Emacs buffer.  AFAICT, &lt;code&gt;prolog-mode-hook&lt;/code&gt; does not get triggered when I run &lt;code&gt;run-prolog&lt;/code&gt;, so I end up running an outdated version of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there some way to trigger &lt;code&gt;maybe-reload-prolog-el&lt;/code&gt; &lt;em&gt;right after&lt;/em&gt; &lt;code&gt;prolog.el&lt;/code&gt; is loaded, before any of its code gets executed?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;BTW, as currently written, &lt;code&gt;maybe-reload-prolog-el&lt;/code&gt; can run only after &lt;code&gt;prolog.el&lt;/code&gt; is loaded, because it relies on the variable &lt;code&gt;prolog-mode-version&lt;/code&gt;, which is defined in &lt;code&gt;prolog.el&lt;/code&gt;, to decide whether to load my local copy of &lt;code&gt;prolog.el&lt;/code&gt;.  IOW, if I simply put the following code in my init file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (version&amp;lt; prolog-mode-version &quot;1.25&quot;)&#xA;  (add-to-list&#xA;   'load-path&#xA;   (file-name-as-directory (concat my-lib-path &quot;prolog-el&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...it fails with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol’s value as variable is void: prolog-mode-version&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there were some way to test the version of the default &lt;code&gt;prolog.el&lt;/code&gt;'s version before loading it (let's call this method &lt;code&gt;PROLOG-OLDER-THAN-1.25-p&lt;/code&gt;, then I would just put this in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(if (PROLOG-OLDER-THAN-1.25-p)&#xA;  (add-to-list&#xA;   'load-path&#xA;   (file-name-as-directory (concat my-lib-path &quot;prolog-el&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please let me know if there's a way to implement a &lt;code&gt;PROLOG-OLDER-THAN-1.25-p&lt;/code&gt; that does not require &lt;code&gt;prolog.el&lt;/code&gt; to be loaded.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Of course, I know that I can always use my copy of &lt;code&gt;prolog.el&lt;/code&gt;, unconditionally.  IOW, I can just put this in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list&#xA; 'load-path&#xA; (file-name-as-directory (concat my-lib-path &quot;prolog-el&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This approach works in the short-term, of course, but it requires more maintenance long-term.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;&lt;sup&gt;1&lt;/sup&gt; Please let me know if what my &lt;code&gt;maybe-reload-prolog-el&lt;/code&gt; function does is the best way to conditionally reload &lt;code&gt;prolog.el&lt;/code&gt;.  I'm not too confident that &lt;code&gt;(load-library &quot;prolog&quot;)&lt;/code&gt; is the right thing to do here.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2017-02-27T14:19:38.863" LastActivityDate="2019-11-05T18:16:32.077" Title="How to load personal prolog.el only if system's one is outdated?" Tags="|hooks|autoload|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31087" PostTypeId="2" ParentId="31084" CreationDate="2017-02-27T14:14:51.717" Score="3" Body="&lt;p&gt;I can reproduce this with a &quot;more-minimal&quot; example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run &lt;code&gt;emacs -Q&lt;/code&gt;, then evaluate the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'package)&#xA;(setq package-load-list&#xA;      '((org-plus-contrib t)))&#xA;(package-initialize)&#xA;&#xA;(add-hook 'prog-mode-hook 'goto-address-prog-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error you describe appears on first loading your test org file, but not if I close and re-open it. Further, it only occurs with the addition of the &lt;code&gt;goto-address-prog-mode&lt;/code&gt; hook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that it only comes up on the first load of the org file suggests there is a problem with code not getting loaded in the correct order or at the correct time. The fact that I can reproduce this with such a minimal example suggests it's a true bug, and not a misconfiguration on your part. I would report this as a bug to org-mode and/or emacs. &lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-27T14:14:51.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31088" PostTypeId="1" CreationDate="2017-02-27T14:40:48.817" Score="0" ViewCount="55" Body="&lt;p&gt;When I copy some text with single quote and paste (by right clicking and choosing paste) into a emacs buffer with fundamental mode, the single quote seems interpreted as repeating the character that follows the single quote. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;what's&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is interpreted as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;whatsssssssssssssssssssssssssssssssssssssss&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why does this happen?  Should I paste into a buffer with a different mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running emacs in cmd terminal of Windows 10 by &lt;code&gt;emacs -nw&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run emacs in GUI by &lt;code&gt;emacs -Q&lt;/code&gt;, then the problem doesn't happen.&lt;/p&gt;&#xA;" OwnerUserId="120" LastEditorUserId="120" LastEditDate="2017-02-27T21:02:04.670" LastActivityDate="2017-02-27T21:02:04.670" Title="Is the single quote interpreted as repeating the character that follows the single quote?" Tags="|microsoft-windows|terminal-emacs|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31089" PostTypeId="1" AcceptedAnswerId="31117" CreationDate="2017-02-27T15:08:20.210" Score="5" ViewCount="1168" Body="&lt;p&gt;It has been difficult to see immediately the types of variables in C++ codes because they are defined using 'auto', 'template' and 'decltype'.&lt;br&gt;&#xA;If you use IDE, you can detect the type after the compilation by being a cursor on the variable.&lt;br&gt;&#xA;My question is, does an emacs package exist to achieve such a function?&lt;/p&gt;&#xA;" OwnerUserId="15047" LastEditorUserId="15047" LastEditDate="2017-02-28T11:12:52.910" LastActivityDate="2017-02-28T11:12:52.910" Title="Displaying the type of variable in C++ code with cursor" Tags="|c++|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31090" PostTypeId="2" ParentId="31072" CreationDate="2017-02-27T15:09:55.150" Score="0" Body="&lt;p&gt;The &lt;code&gt;*scratch*&lt;/code&gt; buffer isn't special; it's just a regular buffer with a fixed name. There are no special hooks just for it, so &lt;code&gt;buffer-list-update-hook&lt;/code&gt; is the way to go.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-27T15:09:55.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31091" PostTypeId="1" AcceptedAnswerId="31092" CreationDate="2017-02-27T15:21:50.503" Score="2" ViewCount="167" Body="&lt;p&gt;Below is an example of the situation described in the question's title, using the variable &lt;code&gt;prolog-mode-version&lt;/code&gt; as test case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my Emacs init file consists of &lt;em&gt;just&lt;/em&gt; the code shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun show-pmv (hook-name)&#xA;  (let ((pmv (if (boundp 'prolog-mode-version)&#xA;                 prolog-mode-version&#xA;               &quot;undefined&quot;)))&#xA;    (message &quot;%s: prolog-mode-version: %s&quot; hook-name pmv)))&#xA;&#xA;(add-hook 'after-init-hook    (lambda () (show-pmv &quot;after-init&quot;)))&#xA;(add-hook 'emacs-startup-hook (lambda () (show-pmv &quot;emacs-startup&quot;)))&#xA;(add-hook 'window-setup-hook  (lambda () (show-pmv &quot;window-setup&quot;)))&#xA;&#xA;(setq inhibit-startup-screen t)&#xA;(switch-to-buffer &quot;*Messages*&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and I start up Emacs, my &lt;code&gt;*Messages*&lt;/code&gt; buffer contains the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;after-init: prolog-mode-version: undefined&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;emacs-startup: prolog-mode-version: undefined&#xA;window-setup: prolog-mode-version: undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...but if, &lt;em&gt;right after startup&lt;/em&gt;, I inspect the value of &lt;code&gt;prolog-mode-version&lt;/code&gt; (using &lt;code&gt;C-h v&lt;/code&gt;), I get a non-void value (&lt;code&gt;&quot;1.22&quot;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;prolog-mode-version&lt;/code&gt; is not an isolated case.  In fact, many other symbols defined in &lt;code&gt;prolog.el&lt;/code&gt; seem to be available right after startup, even though my init file does not load/require this package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find this extremely confusing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do symbols that were void during startup become suddenly defined &lt;em&gt;right after&lt;/em&gt; startup?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely, is there some way for my init file to access the value of &lt;code&gt;prolog-mode-version&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;a href=&quot;https://emacs.stackexchange.com/q/31086/882&quot;&gt;Related.&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-02-27T22:24:25.587" Title="Why do symbols become suddenly defined right after startup?" Tags="|start-up|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31092" PostTypeId="2" ParentId="31091" CreationDate="2017-02-27T16:23:11.710" Score="2" Body="&lt;p&gt;It's autoloaded. Or rather, I should say that the library is autoloaded, so that the variable only starts existing once you've caused Emacs to actually load the library (usually by calling a function or using a macro from the library).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, autoloading isn't available when processing the init files. Instead, explicitly load the library with &lt;code&gt;(require 'prolog)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Autoloading is a moderately complex subject, so I recommend reading section 15.5 of the Elisp manual. Actually, all of chapter 15 is quite interesting.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-02-27T16:23:11.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31093" PostTypeId="1" CreationDate="2017-02-27T16:46:55.093" Score="1" ViewCount="80" Body="&lt;p&gt;I'm trying to make this little convenience function work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-make-hook (when procedure)&#xA;     (let ((hook-symbol (intern (concat&#xA;                                 (substring (symbol-name when) 1)&#xA;                                 &quot;-&quot;&#xA;                                 (symbol-name procedure)&#xA;                                 &quot;-hook&quot;))))&#xA;       (unless (boundp hook-symbol)&#xA;         (set hook-symbol nil)&#xA;         (advice-add procedure when (lambda (&amp;amp;rest _) (run-hooks hook-symbol)))&#xA;         hook-symbol)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'm getting an error that the interned symbol is void, and I believe I may actually be somehow setting the value of the symbol &lt;code&gt;hook-symbol&lt;/code&gt; itself, rather than the symbol that &lt;code&gt;hook-symbol&lt;/code&gt; evaluates to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I'm calling it with, e.g., (my-make-hook :after 'load-theme).&lt;/p&gt;&#xA;" OwnerUserId="15049" LastEditorUserId="14825" LastEditDate="2017-02-27T21:01:22.713" LastActivityDate="2017-03-22T13:41:56.417" Title="How can I set the global value of a symbol created from a string?" Tags="|hooks|symbols|" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31094" PostTypeId="1" CreationDate="2017-02-27T17:02:48.947" Score="8" ViewCount="2469" Body="&lt;p&gt;I would like to use 2-space indents all the time like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sidekiq_options({&#xA;  retry: true&#xA;})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've tried setting &lt;code&gt;.emacs.d/init.el&lt;/code&gt; to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 2)&#xA;(setq indent-line-function 'insert-tab)&#xA;&#xA;(setq ruby-deep-indent-paren nil)&#xA;(setq ruby-deep-indent-paren-style nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I still get stuff looking like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sidekiq_options({&#xA;                  retry: true&#xA;                })&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15050" LastEditorUserId="15050" LastEditDate="2017-03-02T01:01:46.420" LastActivityDate="2018-03-16T13:21:55.850" Title="Ruby always indent 2 spaces?" Tags="|indentation|ruby|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31095" PostTypeId="1" AcceptedAnswerId="31100" CreationDate="2017-02-27T17:13:11.800" Score="4" ViewCount="856" Body="&lt;p&gt;The situation I have is this.  First, I run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'prolog)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...which loads the system's default version of &lt;code&gt;prolog.el&lt;/code&gt;, and makes the variable &lt;code&gt;prolog-mode-version&lt;/code&gt; available.  It has value &lt;code&gt;&quot;1.22&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I know that my personal copy of this package, in &lt;code&gt;/path/to/my/own/private/prolog.el&lt;/code&gt;, starts with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar prolog-mode-version &quot;1.25&quot;&#xA;  &quot;Prolog mode version number&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;/path/to/my/own/private/prolog.el&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...expecting that, after doing so, &lt;code&gt;prolog-mode-version&lt;/code&gt; will now have value &lt;code&gt;&quot;1.25&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not what happens, though: according to &lt;code&gt;describe-variable&lt;/code&gt; at least, the value of &lt;code&gt;prolog-mode-version&lt;/code&gt; is still &lt;code&gt;&quot;1.22&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What must I need to do to (re-)load &lt;code&gt;'prolog&lt;/code&gt; from &lt;code&gt;/path/to/my/own/private/prolog.el&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2017-02-27T21:23:00.447" LastActivityDate="2017-03-01T14:45:31.563" Title="How to re-load a package?" Tags="|start-up|libraries|eval|load|" AnswerCount="2" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="31096" PostTypeId="5" CreationDate="2017-02-27T17:37:19.967" Score="0" Body="&lt;p&gt;Emacs covers a wide range of topics related to &lt;a href=&quot;/questions/tagged/syntax&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;syntax&amp;#39;&quot; rel=&quot;tag&quot;&gt;syntax&lt;/a&gt;, which typically applies to programming (and data) languages, especially to Emacs Lisp. Some of these topics also have their own tags. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Char-Syntax.html#Basic-Char-Syntax&quot; rel=&quot;nofollow noreferrer&quot;&gt;basic character syntax&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html#Syntax-Tables&quot; rel=&quot;nofollow noreferrer&quot;&gt;syntax tables&lt;/a&gt; for determining words, symbols, and other syntactic boundaries&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Tag-Syntax.html#Tag-Syntax&quot; rel=&quot;nofollow noreferrer&quot;&gt;source file tag syntax&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/init-file&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;init-file&amp;#39;&quot; rel=&quot;tag&quot;&gt;init-file&lt;/a&gt; syntax is &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Syntax.html#Init-Syntax&quot; rel=&quot;nofollow noreferrer&quot;&gt;documented separately&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/regexp&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;regexp&amp;#39;&quot; rel=&quot;tag&quot;&gt;regexp&lt;/a&gt; syntax has its own &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html#Regexps&quot; rel=&quot;nofollow noreferrer&quot;&gt;rules and conventions&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/debugging&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;debugging&amp;#39;&quot; rel=&quot;tag&quot;&gt;debugging&lt;/a&gt; syntax &lt;a href=&quot;http://Debugging%20Invalid%20Lisp%20Syntax&quot; rel=&quot;nofollow noreferrer&quot;&gt;errors&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Flymake.html#Flymake&quot; rel=&quot;nofollow noreferrer&quot;&gt;finding syntax errors&lt;/a&gt; with &lt;a href=&quot;/questions/tagged/flymake&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;flymake&amp;#39;&quot; rel=&quot;tag&quot;&gt;flymake&lt;/a&gt; or &lt;a href=&quot;/questions/tagged/flycheck&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;flycheck&amp;#39;&quot; rel=&quot;tag&quot;&gt;flycheck&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Use additional tags besides &lt;a href=&quot;/questions/tagged/syntax&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;syntax&amp;#39;&quot; rel=&quot;tag&quot;&gt;syntax&lt;/a&gt; as appropriate.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-27T23:44:09.510" LastActivityDate="2017-02-27T23:44:09.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31097" PostTypeId="4" CreationDate="2017-02-27T17:37:19.967" Score="0" Body="is for grammar, structure, and order of language elements. Emacs provides many facilities for correcting syntax errors, building complex syntactic structures from simpler ones, and applying rules of composition with syntactical correctness." OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-27T23:44:57.490" LastActivityDate="2017-02-27T23:44:57.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31098" PostTypeId="5" CreationDate="2017-02-27T17:58:10.220" Score="0" Body="&lt;p&gt;While the tag is properly spelled as the noun &lt;a href=&quot;/questions/tagged/advice&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;advice&amp;#39;&quot; rel=&quot;tag&quot;&gt;advice&lt;/a&gt;, the Emacs manuals and Stack Exchange questions also use &lt;code&gt;advise&lt;/code&gt;(the verb form) and &lt;code&gt;advising&lt;/code&gt;. Try these alternate spellings when searching.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Link:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Advising a function&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-28T16:21:31.203" LastActivityDate="2017-02-28T16:21:31.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31099" PostTypeId="4" CreationDate="2017-02-27T17:58:10.220" Score="0" Body="is for the Elisp advice feature that changes an existing definition of a function in a way that lets you undo the change easily. This tag applies to both old and new advice features. The old advice feature uses `defadvice`. The new advice feature uses functions and macros such as `advice-add` and `add-function`." OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-27T23:39:51.423" LastActivityDate="2017-02-27T23:39:51.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31100" PostTypeId="2" ParentId="31095" CreationDate="2017-02-27T18:02:02.453" Score="7" Body="&lt;p&gt;You can unload the system prolog mode first, this unbinds all its variables, so that the new &lt;code&gt;defvar&lt;/code&gt; init-forms will take effect:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(require 'prolog)&#xA;(when (version&amp;lt; prolog-mode-version &quot;1.25&quot;)&#xA;  (unload-feature 'prolog)&#xA;  (load &quot;/path/to/my/own/private/prolog.el&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;unload-feature&lt;/code&gt; is not a commonly used function, so it's possible you may hit some bugs.  Most packages are not written with unloading in mind.  Glancing at prolog.el, I don't see anything that should be a problem though (examples of &lt;em&gt;potentially&lt;/em&gt; &quot;problematic&quot; forms would be side-effecting top-level calls, apart from the usual &lt;code&gt;defun&lt;/code&gt;, &lt;code&gt;defvar&lt;/code&gt;, &lt;code&gt;defconst&lt;/code&gt;, &lt;code&gt;defcustom&lt;/code&gt;, etc).&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="5296" LastEditDate="2017-03-01T14:45:31.563" LastActivityDate="2017-03-01T14:45:31.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31101" PostTypeId="2" ParentId="31095" CreationDate="2017-02-27T18:15:19.947" Score="3" Body="&lt;p&gt;As an alternative to &lt;code&gt;unload-feature&lt;/code&gt;, you could use this to check the version of the default package without actually loading the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((version (with-temp-buffer&#xA;                 (insert-file (find-library-name &quot;prolog&quot;))&#xA;                 (re-search-forward &quot;(defvar prolog-mode-version \&quot;\\([^\&quot;]+\\)&quot;)&#xA;                 (string-to-number (match-string 1)))))&#xA;  (if (&amp;lt; version 1.25)&#xA;      (load &quot;/path/to/my/own/private/prolog.el&quot;)&#xA;    (require 'prolog)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-02-27T18:15:19.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31104" PostTypeId="2" ParentId="31094" CreationDate="2017-02-27T19:51:13.653" Score="1" Body="&lt;p&gt;I'm not a ruby user but you can try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default indent-tabs-mode nil)&#xA;(setq-default tab-width 4)   ;; change this to 2 if that is the width&#xA;(setq indent-line-function 'insert-tab)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastActivityDate="2017-02-27T19:51:13.653" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31105" PostTypeId="2" ParentId="20201" CreationDate="2017-02-27T20:42:37.037" Score="3" Body="&lt;p&gt;There's no built-in way to do this--see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Unloading.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Unloading&lt;/a&gt; in the Elisp manual. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;unload-feature&lt;/code&gt; takes a &lt;code&gt;force&lt;/code&gt; argument that allows forcibly unloading &lt;code&gt;P&lt;/code&gt; even if other packages depend on &lt;code&gt;P&lt;/code&gt;; is that sufficient for your needs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, you can try to create a recursive version of &lt;code&gt;unload-feature&lt;/code&gt; containing:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let* ((file (feature-file feature))&#xA;       (dependents (delete file (copy-sequence (file-dependents file))))) &#xA;  (when dependents&#xA;    (mapc #'unload-feature-recursive (mapcan #'file-provides dependents))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="25" LastEditDate="2017-02-27T21:16:27.200" LastActivityDate="2017-02-27T21:16:27.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31106" PostTypeId="2" ParentId="31093" CreationDate="2017-02-27T21:06:23.227" Score="1" Body="&lt;p&gt;My crystal ball says that the above code is written in a file that does not have the magic cookie &lt;code&gt;-*- lexical-binding:t -*-&lt;/code&gt;, and hence the let-binding of &lt;code&gt;hook-symbol&lt;/code&gt; is dynamic rather than lexical, and by the time the advice is run, that variable doesn't exist any more, so you get a void-variable error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence: place &lt;code&gt;;; -*- lexical-binding:t -*-&lt;/code&gt; on the first line of the file in which you wrote your function, then re-load the file, and that should hopefully fix it.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="105" LastEditDate="2017-02-27T21:23:44.180" LastActivityDate="2017-02-27T21:23:44.180" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31107" PostTypeId="1" AcceptedAnswerId="31111" CreationDate="2017-02-27T21:39:23.733" Score="3" ViewCount="262" Body="&lt;p&gt;I just stumbled across the archives directory of my .emacs.d/archives/ . Here's the beginning of &lt;code&gt;.../archives/gnu/archive-contents&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(1&#xA; (ace-window .&#xA;         [(0 9 0)&#xA;          ((avy&#xA;        (0 2 0)))&#xA;          &quot;Quickly switch windows.&quot; single&#xA;          ((:url . &quot;https://github.com/abo-abo/ace-window&quot;)&#xA;           (:keywords &quot;window&quot; &quot;location&quot;))])&#xA; (ack .&#xA;      [(1 5)&#xA;       nil &quot;interface to ack-like tools&quot; tar&#xA;       ((:keywords &quot;tools&quot; &quot;processes&quot; &quot;convenience&quot;)&#xA;    (:url . &quot;https://github.com/leoliu/ack-el&quot;))]) ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone &quot;deep in the lore&quot; enlighten me to what this is about, specifically, how this s-expression AST(?) is built, on what criteria. What is the data schema used here, et cetera....&lt;/p&gt;&#xA;" OwnerUserId="8349" LastEditorUserId="105" LastEditDate="2019-06-21T22:52:22.993" LastActivityDate="2019-06-21T22:52:22.993" Title="ELPA archives directory contents: the data structure used?" Tags="|package-repositories|data-structures|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31108" PostTypeId="1" CreationDate="2017-02-27T21:49:33.443" Score="2" ViewCount="154" Body="&lt;p&gt;I have a file (a log) with unique identifiers.  I know I can exclude a single unique identifier in emacs using M-x flush-lines.  I sometimes need to exclude more than one unique identifier, and for up to ten or twenty this is not a problem as I can do it by hand. This is usually sufficient for my needs.  However, there is the occasional need to exclude significantly more. Today, for instance, I need to exclude some 80k instances of unique identifiers (out of a file that might have over 300k unique ids. (I'm trying to locate the proverbial needle in a haystack and have a way to identify one kind of 'not needle' that is present 'and now I need a way to get them out of the way quickly) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to loop through flush-lines over a list of regex? (and when I say 'loop', I'm purely being descriptive: I don't, necessarily, mean the function loop.  I'm given to understand 'while' and 'dolist' are similar functions... I don't know how to use any of them in this case)   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="15055" LastActivityDate="2017-02-27T22:32:14.603" Title="loop (iterate) flush-lines on a list of regex for large files" Tags="|regular-expressions|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31109" PostTypeId="2" ParentId="31091" CreationDate="2017-02-27T22:24:25.587" Score="3" Body="&lt;p&gt;Symbols defined &lt;em&gt;only&lt;/em&gt; in the &lt;code&gt;prolog&lt;/code&gt; library will be bound only if that library has actually been loaded. You can establish &lt;em&gt;when&lt;/em&gt; it is being loaded by invoking the debugger:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'after-load-functions 'my-load-debug)&#xA;&#xA;(defun my-load-debug (file)&#xA;  (when (string= &quot;prolog&quot; (file-name-base file))&#xA;    (debug)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or just:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load &quot;prolog&quot; '(debug))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there are &lt;em&gt;autoload&lt;/em&gt; definitions for the symbols, then they would be bound (without loading the &lt;code&gt;prolog&lt;/code&gt; library), as soon as the appropriate &lt;code&gt;loaddefs.el&lt;/code&gt; (or equivalent) file defining those autoloads has been loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;C-h v&lt;/code&gt; and &lt;code&gt;C-h f&lt;/code&gt; will indicate when a given variable or function is an autoload definition.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-02-27T22:24:25.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31110" PostTypeId="2" ParentId="31108" CreationDate="2017-02-27T22:32:14.603" Score="1" Body="&lt;p&gt;You might like to read those 80K identifiers, then combine them into a single regexp with &lt;code&gt;regexp-opt&lt;/code&gt; and then pass that to a single &lt;code&gt;flush-lines&lt;/code&gt; call.  This said, maybe it'll fail because the resulting regexp is too large (Emacs has a limit on the size of its regexps).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-02-27T22:32:14.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31111" PostTypeId="2" ParentId="31107" CreationDate="2017-02-28T00:18:08.810" Score="2" Body="&lt;p&gt;This is a list of packages available in the specific ELPA repository.&#xA;It's created by the admin of that repository and downloaded by Emacs&#xA;to know what's installable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a pseudo-grammar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PACKAGE-ARCHIVES: (PACKAGE-ARCHIVE-VERSION PACKAGE ...)&#xA;PACKAGE-ARCHIVE-VERSION: &amp;lt;integer&amp;gt;&#xA;PACKAGE: (PACKAGE-NAME . PACKAGE-DESCRIPTOR)&#xA;PACKAGE-NAME: &amp;lt;symbol&amp;gt;&#xA;PACKAGE-DESCRIPTOR: [VERSION DEPENDENCIES DESCRIPTION TYPE METADATA]&#xA;VERSION: (&amp;lt;integer&amp;gt; ...)&#xA;DEPENDENCIES: ((PACKAGE-NAME VERSION) ...)&#xA;DESCRIPTION: &amp;lt;string&amp;gt;&#xA;TYPE: single | tar&#xA;METADATA: (METADATUM ...)&#xA;METADATUM: (&amp;lt;keyword&amp;gt; ARG ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-02-28T00:18:08.810" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31112" PostTypeId="5" CreationDate="2017-02-28T00:56:07.927" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Scrolling.html#Scrolling&quot; rel=&quot;nofollow noreferrer&quot;&gt;scrolling&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Recentering.html#Recentering&quot; rel=&quot;nofollow noreferrer&quot;&gt;recentering&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Scrolling.html#Auto-Scrolling&quot; rel=&quot;nofollow noreferrer&quot;&gt;auto scrolling&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Horizontal-Scrolling.html#Horizontal-Scrolling&quot; rel=&quot;nofollow noreferrer&quot;&gt;horizontal scrolling&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-28T05:34:09.007" LastActivityDate="2017-02-28T05:34:09.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31113" PostTypeId="4" CreationDate="2017-02-28T00:56:07.927" Score="0" Body="is for commands to move text up and down and sideways in a window. Scrolling forward moves the buffer text upwards and scrolling backward moves downwards. Horizontal scrolling moves the buffer text left or right. Emacs provides many functions, key bindings, and programming facilities for scrolling." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-02-28T16:21:40.233" LastActivityDate="2017-02-28T16:21:40.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31114" PostTypeId="2" ParentId="31072" CreationDate="2017-02-28T05:33:22.273" Score="1" Body="&lt;p&gt;The function assigned to the variable &lt;code&gt;initial-major-mode&lt;/code&gt; is &lt;em&gt;only&lt;/em&gt; called when &lt;code&gt;*Scratch*&lt;/code&gt; is created by Emacs (e.g., &lt;code&gt;startup.el&lt;/code&gt;, or when certain criteria is met when killing a buffer).  It can be a custom function -- e.g., set the &lt;code&gt;major-mode&lt;/code&gt; and do anything else under the sun.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq initial-major-mode (lambda () (lisp-interaction-mode) (message &quot;*scratch*&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-02-28T06:06:47.397" LastActivityDate="2017-02-28T06:06:47.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31115" PostTypeId="1" CreationDate="2017-02-28T06:26:54.027" Score="5" ViewCount="3060" Body="&lt;p&gt;I am a beginner of helm-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why remapping of arrow keys (&lt;code&gt;(kbd &quot;&amp;lt;left&amp;gt;&quot;)&lt;/code&gt;, &lt;code&gt;(kbd &quot;right&quot;)&lt;/code&gt;, ...) on &lt;code&gt;helm-map&lt;/code&gt; doesn't work while others work fine?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the entire settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm-config)&#xA;(helm-mode 1)&#xA;(define-key global-map (kbd &quot;C-;&quot;) 'helm-mini)&#xA;(define-key global-map (kbd &quot;M-y&quot;) 'helm-show-kill-ring)&#xA;(define-key global-map (kbd &quot;C-x C-r&quot;) 'helm-recentf)&#xA;(define-key global-map [remap find-file] 'helm-find-files) ;&#xA;(define-key global-map [remap execute-extended-command] 'helm-M-x)&#xA;(define-key helm-map (kbd &quot;C-h&quot;) 'delete-backward-char)&#xA;(define-key helm-find-files-map (kbd &quot;&amp;lt;left&amp;gt;&quot;) 'backward-char)&#xA;(define-key helm-find-files-map (kbd &quot;&amp;lt;right&amp;gt;&quot;) 'forward-char)&#xA;&#xA;;; no effects and default key bind works for following two lines&#xA;(define-key helm-map (kbd &quot;&amp;lt;left&amp;gt;&quot;) 'backward-char)&#xA;(define-key helm-map (kbd &quot;&amp;lt;right&amp;gt;&quot;) 'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="15060" LastEditorUserId="105" LastEditDate="2017-02-28T15:29:47.870" LastActivityDate="2020-05-11T00:40:46.853" Title="Arrow keys on helm mini buffer" Tags="|key-bindings|helm|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31117" PostTypeId="2" ParentId="31089" CreationDate="2017-02-28T08:20:30.110" Score="5" Body="&lt;p&gt;With &lt;a href=&quot;https://github.com/Sarcasm/irony-mode/&quot; rel=&quot;noreferrer&quot;&gt;irony-mode&lt;/a&gt;, you can use &lt;code&gt;M-x irony-get-type RET&lt;/code&gt;. This probably won't work for everything but it worked for the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-cpp prettyprint-override&quot;&gt;&lt;code&gt;int main()&#xA;{&#xA;   auto var = 1.0;&#xA;   return var;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Having the cursor on any of the two &lt;code&gt;var&lt;/code&gt;, and calling &lt;code&gt;M-x irony-get-type RET&lt;/code&gt;, returns: &lt;code&gt;double&lt;/code&gt; in the minibuffer.&lt;/p&gt;&#xA;" OwnerUserId="901" LastActivityDate="2017-02-28T08:20:30.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31118" PostTypeId="5" CreationDate="2017-02-28T08:41:59.740" Score="0" Body="&lt;p&gt;The &lt;code&gt;Text Properties&lt;/code&gt; menu item under the &lt;code&gt;Edit&lt;/code&gt; menu of Emacs by default has several options for displaying or editing &lt;a href=&quot;/questions/tagged/text-properties&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;text-properties&amp;#39;&quot; rel=&quot;tag&quot;&gt;text-properties&lt;/a&gt;. The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html#Text-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;manual&lt;/a&gt; describes the various &lt;a href=&quot;/questions/tagged/text-propeties&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;text-propeties&amp;#39;&quot; rel=&quot;tag&quot;&gt;text-propeties&lt;/a&gt;, including &lt;code&gt;face&lt;/code&gt; and some &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;special properties&lt;/a&gt;, &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Format-Properties.html#Format-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;margins&lt;/a&gt;, and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sticky-Properties.html#Sticky-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;stickiness and inheritance&lt;/a&gt; characteristics that are not in the menu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strings with text properties &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Props-and-Strings.html#Text-Props-and-Strings&quot; rel=&quot;nofollow noreferrer&quot;&gt;have a special read and print syntax&lt;/a&gt;. Emacs uses a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html#Property-Lists&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;property-list&lt;/code&gt;&lt;/a&gt; (&lt;code&gt;plist&lt;/code&gt; for short) for text properties. See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;category property&lt;/a&gt; for setting &lt;code&gt;default properties&lt;/code&gt;. See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Fields.html#Fields&quot; rel=&quot;nofollow noreferrer&quot;&gt;fields&lt;/a&gt; for specifying properties by &lt;code&gt;strings&lt;/code&gt;, and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Not-Intervals.html#Not-Intervals&quot; rel=&quot;nofollow noreferrer&quot;&gt;intervals&lt;/a&gt; for when to use &lt;a href=&quot;/questions/tagged/overlays&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;overlays&amp;#39;&quot; rel=&quot;tag&quot;&gt;overlays&lt;/a&gt; (overlay properties) instead of text properties. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Search.html#Property-Search&quot; rel=&quot;nofollow noreferrer&quot;&gt;searching&lt;/a&gt; for locating (text or overlay) property changes in the buffer. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-28T15:26:50.050" LastActivityDate="2017-02-28T15:26:50.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31119" PostTypeId="4" CreationDate="2017-02-28T08:41:59.740" Score="0" Body="is for any text property, such as `face`, that Emacs can associate with text. Emacs moves, copies, or displays the text using the text properties, which are specified as name-value pairs along with the text in a special Lisp structure. Emacs uses a special read and print syntax for text properties." OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-28T15:22:20.407" LastActivityDate="2017-02-28T15:22:20.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31120" PostTypeId="1" CreationDate="2017-02-28T09:06:02.093" Score="0" ViewCount="27" Body="&lt;p&gt;I have a situation where I have a lot of similar tasks under a header like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Header &#xA;** READY Task 1&#xA;** NREADY Task 2&#xA;** READY Task 3&#xA;** READY Task 4&#xA;** NREADY Task 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and so on. What I would like is to have the next READY task (the highest READY task under Header) appear in my agenda every other day or so. Is that possible? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="10276" LastActivityDate="2017-02-28T09:06:02.093" Title="Show READY items from org header in agenda" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31121" PostTypeId="1" AcceptedAnswerId="31274" CreationDate="2017-02-28T10:36:43.797" Score="0" ViewCount="220" Body="&lt;p&gt;How to autoinstall fonts to system (e.g. for all-the-icon support) on first init run like autoinstalling emacs packages. I need crossplatfom solution (mac and linux). Or what is best practice to avoid it? For example, I don't remember that I installed fonts manually when I tried spacemacs. Thanks!  &lt;/p&gt;&#xA;" OwnerUserId="15063" LastEditorUserId="15063" LastEditDate="2017-02-28T13:06:52.887" LastActivityDate="2017-03-06T22:36:48.417" Title="Autoinstall custom fonts" Tags="|fonts|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31122" PostTypeId="2" ParentId="30153" CreationDate="2017-02-28T11:03:42.510" Score="3" Body="&lt;p&gt;Have you enabled &lt;a href=&quot;http://orgmode.org/manual/Custom-time-format.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-toggle-time-stamp-overlays&lt;/a&gt; via &lt;code&gt;C-c C-x C-t&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this enabled you cannot place the cursor onto a timestamp anymore, only before or after. &lt;/p&gt;&#xA;" OwnerUserId="12751" LastActivityDate="2017-02-28T11:03:42.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31125" PostTypeId="1" AcceptedAnswerId="31128" CreationDate="2017-02-28T15:01:37.593" Score="5" ViewCount="1780" Body="&lt;p&gt;This is the block of text that I intend to copy as rectangle (without the line numbers).  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;   1. ALM_KRmet_DCDO_RPMP_START&#xA;   2. ALM_KRmet_DCDO_RPMP_STOP&#xA;   3. ALM_KRmet_DIDC_RPMP_TRIP&#xA;   4. ALM_KRmet_RPMP_J_H&#xA;   5. ALM_KRmet_DIDO_PUMPOUT&#xA;   6. ALM_KRmet_RPMP_VIBR_H&#xA;&#xA;&lt;/pre&gt;  &#xA;&#xA;&lt;p&gt;Steps:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I keep the cursor in the first line (after the 1.)&lt;/li&gt;&#xA;&lt;li&gt;Press &lt;code&gt;C-x SPC&lt;/code&gt; - This enables rectangle-mark-mode&lt;/li&gt;&#xA;&lt;li&gt;I move down along the same column to the last line&lt;/li&gt;&#xA;&lt;li&gt;When I reach the end of the text in the last row, the cursor wouldn't move further to the end of the text in the first row.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When I copy or cut, it leaves the un-highlighted portion (or unselected portion) of the text in the previous lines and copies / cuts only that is selected.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;What should I do, if I intend to copy the entire block of text (with the smallest length text in the last row)&lt;/em&gt;&lt;br&gt;&#xA; Is there a straight forward way to achieve this? Sublime text is able to do it without any issues.&lt;/p&gt;&#xA;" OwnerUserId="10936" LastEditorUserId="105" LastEditDate="2017-02-28T15:29:24.977" LastActivityDate="2017-02-28T17:59:15.190" Title="Copy text as rectangle" Tags="|region|copy-paste|rectangle|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31126" PostTypeId="1" CreationDate="2017-02-28T15:21:52.393" Score="2" ViewCount="172" Body="&lt;p&gt;It would be convenient if I could arrange for visit-tags-table to open the TAGS file automatically with the correct syntax table for the language of the files being indexed in it.  That way regular expressions would work the same way in the TAGS file as in the files indexed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to do that?&lt;/p&gt;&#xA;" OwnerUserId="10511" LastActivityDate="2017-03-01T03:06:24.343" Title="specifying a syntax-table for use with TAGS file for etags" Tags="|syntax-table|ctags|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31127" PostTypeId="2" ParentId="31125" CreationDate="2017-02-28T17:44:27.273" Score="3" Body="&lt;p&gt;I usually do this by moving point to the end of the last line in the block, just as you have described, but then I insert spaces at the end of the line until point is in the last column that I want to cut. Then C-x r k cuts the entire rectangle; spaces will be added to the ends of any lines that are shorter than the width of the block.&lt;/p&gt;&#xA;" OwnerUserId="8699" LastActivityDate="2017-02-28T17:44:27.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31128" PostTypeId="2" ParentId="31125" CreationDate="2017-02-28T17:59:15.190" Score="8" Body="&lt;p&gt;My crystal ball tells me you're using Emacs-24.5, which indeed had this limitation.  This has been fixed in Emacs-25 where &lt;code&gt;rectangle-mark-mode&lt;/code&gt; has been improved so you can move the cursor past the &quot;end&quot; of a line (and where you can use &lt;code&gt;C-x C-x&lt;/code&gt; to go to another corner of the rectangle as well).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-02-28T17:59:15.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31129" PostTypeId="1" CreationDate="2017-02-28T19:23:47.877" Score="1" ViewCount="38" Body="&lt;p&gt;I am having a problem in &lt;code&gt;cperl-mode&lt;/code&gt; described in &lt;a href=&quot;https://emacs.stackexchange.com/questions/30807/cperl-mode-syntax-highlighting-breaks-when-inserting-a-newline-into-a-here-doc&quot;&gt;this&lt;/a&gt; question. Basically inserting a newline at the start of a line in here doc in &lt;code&gt;cperl-mode&lt;/code&gt; is breaking the syntax highlighting. One of the answers suggested using font-lock-extend-region-functions to extend the font lock region to include all of the here doc. I have done that with the code below and verified it with &lt;a href=&quot;https://github.com/Lindydancer/highlight-refontification&quot; rel=&quot;nofollow noreferrer&quot;&gt;highlight-refontification&lt;/a&gt;. However even though the region is extended, when I insert a newline, the region splits and the syntax highlighting still breaks. My function is shown below  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/cperl-font-lock-extend-region-here ()&#xA;  (save-excursion&#xA;    (goto-char font-lock-beg)&#xA;    (if (re-search-backward &quot;=&amp;lt;&amp;lt;\s*['\&quot;]?[0-9a-zA-Z_]+['\&quot;]?\s*;&quot; nil t)&#xA;        (if (string-match &quot;=&amp;lt;&amp;lt;\s*['\&quot;]?\\([0-9a-zA-Z_]+\\)['\&quot;]?\s*;&quot; (thing-at-point 'line t))&#xA;            (let ((here-tag (concat &quot;^&quot; (match-string 1 (thing-at-point 'line t)) &quot;$&quot;)))&#xA;              (beginning-of-line)&#xA;              (let ((here-start (point)))&#xA;                (goto-char font-lock-end)&#xA;                (if (re-search-forward here-tag nil t)&#xA;                    (progn&#xA;                      (end-of-line)&#xA;                      (if (&amp;lt; font-lock-end (point))&#xA;                          (setq font-lock-end (point)))))&#xA;                (if (&amp;gt; font-lock-beg here-start)&#xA;                    (setq font-lock-beg here-start))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is, does any smart person know an approach to prevent syntax highlighting from breaking in &lt;code&gt;cperl-mode&lt;/code&gt; here docs? &lt;/p&gt;&#xA;" OwnerUserId="12269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-02-28T19:23:47.877" Title="Cperl font lock regions in here docs" Tags="|major-mode|font-lock|syntax-highlighting|string|perl|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31130" PostTypeId="2" ParentId="30873" CreationDate="2017-02-28T20:30:35.407" Score="2" Body="&lt;p&gt;Here is the solution I eventually came up with. (Thanks to @phils for optimizations). As far as I can tell, it seems to be working without issues.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun nadvice/undo-tree-ignore-text-properties (old-fun &amp;amp;rest args)&#xA;  (dolist (item buffer-undo-list)&#xA;    (and (consp item)&#xA;         (stringp (car item))&#xA;         (setcar item (substring-no-properties (car item)))))&#xA;  (apply old-fun args))&#xA;&#xA;(advice-add 'undo-list-transfer-to-tree :around&#xA;            #'nadvice/undo-tree-ignore-text-properties)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2017-02-28T20:30:35.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31131" PostTypeId="1" CreationDate="2017-02-28T20:40:49.710" Score="0" ViewCount="242" Body="&lt;p&gt;I like the hollow option because I know where the cursor is when I switch windows. I use ace-window to change windows. My problem is the ace character is difficult to read when the hollow cursor is on the first character and first line of the frame. Is there any good way to change cursor-in-non-selected-windows to nil when the cursor is on the first char of the first line. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default cursor-in-non-selected-windows 'hollow)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="105" LastEditDate="2017-02-28T22:16:10.180" LastActivityDate="2017-03-01T16:01:53.513" Title="Custom behavior for cursor-in-non-selected-windows on first line" Tags="|cursor|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31132" PostTypeId="5" CreationDate="2017-02-28T22:34:55.767" Score="0" Body="&lt;p&gt;Emacs uses &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term&amp;#39;&quot; rel=&quot;tag&quot;&gt;term&lt;/a&gt; synonymously for the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Terminal-emulator.html#Terminal-emulator&quot; rel=&quot;nofollow noreferrer&quot;&gt;text terminal emulator&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs runs &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt; by default in &lt;a href=&quot;/questions/tagged/term-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;term-mode&lt;/a&gt;, which can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html#Term-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;use or switch&lt;/a&gt; between the two &lt;code&gt;input modes:&lt;/code&gt; &lt;a href=&quot;/questions/tagged/shell-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-mode&lt;/a&gt; and &lt;code&gt;character mode.&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For controlling the appearance of terminal screens, Emacs supports &lt;a href=&quot;/questions/tagged/ansi-term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ansi-term&amp;#39;&quot; rel=&quot;tag&quot;&gt;ansi-term&lt;/a&gt; escape sequences recognized by such modern terminals as &lt;code&gt;xterm&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within a text &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt;, which is a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Non_002dWindow-Terminals.html#Non_002dWindow-Terminals&quot; rel=&quot;nofollow noreferrer&quot;&gt;non-window terminal&lt;/a&gt;, Emacs can display only one &lt;a href=&quot;/questions/tagged/frame&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;frame&amp;#39;&quot; rel=&quot;tag&quot;&gt;frame&lt;/a&gt; at a time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Editing-Types.html#Editing-Types&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Lisp provides&lt;/a&gt; &lt;code&gt;terminal type&lt;/code&gt; as one of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Terminal-Type.html#Terminal-Type&quot; rel=&quot;nofollow noreferrer&quot;&gt;extended data types&lt;/a&gt; for programming editing features.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using the tags &lt;a href=&quot;/questions/tagged/term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term&amp;#39;&quot; rel=&quot;tag&quot;&gt;term&lt;/a&gt; or &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt;, use additional tags where appropriate or describe with appropriate Emacs terminology related to terminal emulators.  &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T15:48:54.703" LastActivityDate="2017-03-01T15:48:54.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31133" PostTypeId="4" CreationDate="2017-02-28T22:34:55.767" Score="0" Body="is for the Emacs text terminal emulator, which by default runs in a sub-shell in a buffer named `*terminal*` with `term-mode`. `M-x term` command starts a terminal." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T15:49:03.447" LastActivityDate="2017-03-01T15:49:03.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31134" PostTypeId="5" CreationDate="2017-02-28T22:52:03.157" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/efaq/Termcap_002fTerminfo-entries-for-Emacs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Where is terminfo entry&lt;/a&gt; for &lt;code&gt;emacs&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cygwin.com/ml/cygwin/2009-06/msg00259.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Why use terminfo file&lt;/a&gt; distributed with Emacs to solve &lt;a href=&quot;/questions/tagged/cygwin&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;cygwin&amp;#39;&quot; rel=&quot;tag&quot;&gt;cygwin&lt;/a&gt; problems? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T15:48:35.653" LastActivityDate="2017-03-01T15:48:35.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31135" PostTypeId="4" CreationDate="2017-02-28T22:52:03.157" Score="0" Body="is for termcap and terminfo capabilities in Emacs. The termcap entry for terminal type `emacs` is ordinarily put in the `TERMCAP` environment variable of subshells." OwnerUserId="7045" LastEditorUserId="105" LastEditDate="2017-02-28T22:54:53.720" LastActivityDate="2017-02-28T22:54:53.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31136" PostTypeId="1" CreationDate="2017-02-28T23:03:19.250" Score="3" ViewCount="134" Body="&lt;p&gt;I have an org file that I want to export to both latex and html. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The file contains a bibliography, so I want to make sure that my org-exporter processes it correctly for both export backends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Latex things are easy, all I have to do is add the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_EXPORT latex&#xA;\printbibliography&#xA;#+END_EXPORT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For html, things are also simple. All I have to do is add the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bibliography:~/org/library.bib&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that, when I export to latex, I get &lt;code&gt;\bibliography{../../org/library}&lt;/code&gt; written at the end of the file, which is unnecessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want, thus, is to wrap the call to bibliography within an &lt;code&gt;IGNORE_LATEX&lt;/code&gt; block. How can I achieve that?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# # What I would like to have:&#xA;&#xA;#+IGNORE_LATEX&#xA;bibliography:~/org/library.bib&#xA;#+END_IGNORE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-03-01T18:39:42.450" Title="Ignoring line when exporting with latex backend" Tags="|org-mode|org-export|latex|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31137" PostTypeId="1" CreationDate="2017-02-28T23:30:33.087" Score="0" ViewCount="114" Body="&lt;p&gt;FWIW, I'm on Mac OS X running this with &lt;code&gt;emacs -Q&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G1108)) of 2016-11-11&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I click the little &quot;maximize&quot; button I get a frame with the &lt;code&gt;(fullscreen . fullboth)&lt;/code&gt; parameter.  According to ancient tradition, let us all praise Emacs' distinctive naming conventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a maximized frame, I cannot get &lt;code&gt;(make-frame)&lt;/code&gt; to create a non-maximized frame.  I've tried setting the &lt;code&gt;fullscreen&lt;/code&gt;, &lt;code&gt;height&lt;/code&gt;, and &lt;code&gt;width&lt;/code&gt; options of &lt;code&gt;default-frame-alist&lt;/code&gt;, and I've tried passing various combinations of the same into the &lt;code&gt;make-frame&lt;/code&gt; function.  No joy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="372" LastActivityDate="2017-02-28T23:30:33.087" Title="Why does make-frame automatically maximize new frames?" Tags="|frames|fullscreen|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31138" PostTypeId="5" CreationDate="2017-03-01T01:20:04.793" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html#Syntax-Tables&quot; rel=&quot;nofollow noreferrer&quot;&gt;Syntax Tables&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Table-Functions.html#Syntax-Table-Functions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Syntax Table Functions&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html#Syntax-Class-Table&quot; rel=&quot;nofollow noreferrer&quot;&gt;Table of Syntax Classes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Table-Internals.html#Syntax-Table-Internals&quot; rel=&quot;nofollow noreferrer&quot;&gt;Syntax Table Internals&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Properties.html#Syntax-Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;Overriding with text properties&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T15:48:23.673" LastActivityDate="2017-03-01T15:48:23.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31139" PostTypeId="4" CreationDate="2017-03-01T01:20:04.793" Score="0" Body="is an Emacs Lisp data structure in which each character's syntactic role is defined. Other Emacs facilities, such as font lock, navigation, parsing, etc., scan these syntax tables to determine where words, symbols, and other syntactic constructs begin and end. Syntax tables are unique to every major mode. They are customizable and even overridable with text properties." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T15:49:15.187" LastActivityDate="2017-03-01T15:49:15.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31140" PostTypeId="2" ParentId="31126" CreationDate="2017-03-01T02:55:54.427" Score="1" Body="&lt;p&gt;the list of tags is stored in &lt;code&gt;tags-table-list&lt;/code&gt;, when you load a file, you know the full path of that file (&lt;code&gt;C-h v buffer-file-name&lt;/code&gt;), so you can tweak &lt;code&gt;tags-table-list&lt;/code&gt; by &lt;code&gt;buffer-file-name&lt;/code&gt; and make it &lt;code&gt;buffer local&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, you need create individual TAGS for each language. For example, one TAGS for javascript, another TAGS for PHP. That's pretty easy if you follow the suggestion from Emacs manual (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Create-Tags-Table.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Create-Tags-Table.html&lt;/a&gt;) by using &lt;code&gt;Find&lt;/code&gt; and &lt;code&gt;Ctags&lt;/code&gt; &lt;strong&gt;together&lt;/strong&gt; because you can specify the file extension when scanning files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You still need write a little bit Emacs Lisp code but &lt;a href=&quot;https://github.com/redguardtoo/find-and-ctags&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/redguardtoo/find-and-ctags&lt;/a&gt; help you write less code.&lt;/p&gt;&#xA;" OwnerUserId="202" LastEditorUserId="202" LastEditDate="2017-03-01T03:06:24.343" LastActivityDate="2017-03-01T03:06:24.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31143" PostTypeId="2" ParentId="31115" CreationDate="2017-03-01T08:35:55.807" Score="4" Body="&lt;p&gt;I searched in GitHub repository by &quot;left&quot;, then the problem solved by inserting &lt;code&gt;(setq helm-ff-lynx-style-map nil)&lt;/code&gt; before &lt;code&gt;(helm-mode 1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/emacs-helm/helm/blob/91ced00ad8bac63ca1311a39b0045677f9b2caae/helm-files.el#L409&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/emacs-helm/helm/blob/91ced00ad8bac63ca1311a39b0045677f9b2caae/helm-files.el#L409&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence my complete settings will be following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'helm-config)&#xA;(setq helm-ff-lynx-style-map nil)&#xA;(helm-mode 1)&#xA;(define-key global-map (kbd &quot;C-;&quot;) 'helm-mini)&#xA;(define-key global-map (kbd &quot;M-y&quot;) 'helm-show-kill-ring)&#xA;(define-key global-map (kbd &quot;C-x C-r&quot;) 'helm-recentf)&#xA;(define-key global-map [remap find-file] 'helm-find-files) ;&#xA;(define-key global-map [remap execute-extended-command] 'helm-M-x)&#xA;(define-key helm-map (kbd &quot;C-h&quot;) 'delete-backward-char)&#xA;(define-key helm-map (kbd &quot;&amp;lt;left&amp;gt;&quot;) 'backward-char)&#xA;(define-key helm-map (kbd &quot;&amp;lt;right&amp;gt;&quot;) 'forward-char)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15060" LastActivityDate="2017-03-01T08:35:55.807" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31144" PostTypeId="1" CreationDate="2017-03-01T08:41:37.387" Score="1" ViewCount="581" Body="&lt;p&gt;When using the fill-column-indicator package with org mode, I get wrong argument errors when exiting the source block editing window, issues with utf-8 character artefacts in source blocks exported to html and some other minor quirks. How can you fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current emacs 25.1 and org-mode 9.0.5&lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2018-05-25T15:21:58.027" Title="org-mode and file column indicator (fci-mode)" Tags="|org-mode|fill-column|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31145" PostTypeId="2" ParentId="31144" CreationDate="2017-03-01T08:41:37.387" Score="1" Body="&lt;p&gt;This is a known issue with org-mode and fci-mode. See &lt;a href=&quot;https://github.com/alpaker/Fill-Column-Indicator/issues/45&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://www.mail-archive.com/emacs-orgmode@gnu.org/msg90441.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for a discussion and some suggested solutions. Personally, I found the cure to be worse than the symptom and it didn't quite fit with what I wanted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have instead found an alternative which works with org-mode and still provides me with the sort of information I was after with fci-mode. I found it was trivial to get similar functionality with whitespace-mode. Rather than a vertical line indicating the fill column, a face is used to colour all characters past the fill line with a different colour. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (use-package whitespace-cleanup-mode&#xA;    :ensure t&#xA;    :diminish whitespace-cleanup-mode&#xA;    :init&#xA;    (setq whitespace-cleanup-mode-only-if-initially-clean nil&#xA;          whitespace-line-column 80&#xA;          whitespace-style '(face lines-tail))&#xA;    :config&#xA;    (global-whitespace-mode)&#xA;    (global-whitespace-cleanup-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2017-03-01T08:41:37.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31146" PostTypeId="2" ParentId="31136" CreationDate="2017-03-01T08:58:53.877" Score="0" Body="&lt;p&gt;Have you tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+BIBLIOGRAPHY: bib/file/name apalike&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;at the document location where you want to have the bibliography? (Org-mode 9.0.5, Emacs-25.1)&lt;/p&gt;&#xA;" OwnerUserId="8979" LastActivityDate="2017-03-01T08:58:53.877" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31147" PostTypeId="1" AcceptedAnswerId="31148" CreationDate="2017-03-01T12:36:41.100" Score="2" ViewCount="336" Body="&lt;p&gt;Using evil mode, pressing &lt;code&gt;*&lt;/code&gt; runs &lt;code&gt;evil-search-word-forward&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for some reason C/C++ mode uses &lt;code&gt;_&lt;/code&gt; as a delimiter, meaning &lt;code&gt;ID_FOO&lt;/code&gt; will only match the first term &lt;code&gt;ID&lt;/code&gt; when searching for the next term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to configure these delimiter characters?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-03-01T12:50:23.737" LastActivityDate="2017-03-01T12:50:23.737" Title="How to configure the delimiter for evil-search-word for C/C++ modes?" Tags="|evil|delimiters|" AnswerCount="1" CommentCount="0" ClosedDate="2017-03-01T14:54:16.383" ContentLicense="CC BY-SA 3.0" />
  <row Id="31148" PostTypeId="2" ParentId="31147" CreationDate="2017-03-01T12:50:08.117" Score="1" Body="&lt;p&gt;Even though I had:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?_ &quot;w&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Set, some modes ignore this (C/C++ for example)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Found solution is to set this for spesific modes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(modify-syntax-entry ?_ &quot;w&quot; c-mode-syntax-table)&#xA;(modify-syntax-entry ?_ &quot;w&quot; c++-mode-syntax-table)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2017-03-01T12:50:08.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31149" PostTypeId="1" AcceptedAnswerId="31156" CreationDate="2017-03-01T15:30:40.110" Score="3" ViewCount="1805" Body="&lt;p&gt;I was trying to write 2 raised to 3 in italics inside an &lt;code&gt;org-mode&lt;/code&gt; buffer and it did not work (i.e., no visual change happens to the text in the buffer).  That is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The text does not change to italic&lt;/li&gt;&#xA;&lt;li&gt;The ^ does not disappears and the superscript letter does not become a superscript like in a word document.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tried both:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;/2^3/&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;/2^{3}/&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Could you suggest a solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(PS: I have tried toggling &lt;code&gt;C-c C-x \&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="15077" LastEditorUserId="14825" LastEditDate="2017-03-01T18:48:06.220" LastActivityDate="2018-03-27T09:34:08.720" Title="superscript or subscript inside italics in org buffer does *not* change text appearance" Tags="|org-mode|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31150" PostTypeId="2" ParentId="31131" CreationDate="2017-03-01T16:01:53.513" Score="1" Body="&lt;p&gt;abo-abo provided the answer on the ace-window github page. advice is definitely the way to go. Thank you abo-abo!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-advice aw-select (:around (fun &amp;amp;rest r) cursor-stuff)&#xA;  (let ((cursor-in-non-selected-windows nil))&#xA;    (apply fun r)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastActivityDate="2017-03-01T16:01:53.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31151" PostTypeId="5" CreationDate="2017-03-01T17:08:41.113" Score="0" Body="&lt;p&gt;Emacs uses &lt;a href=&quot;/questions/tagged/term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term&amp;#39;&quot; rel=&quot;tag&quot;&gt;term&lt;/a&gt; and &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt; synonymously for the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Terminal-emulator.html#Terminal-emulator&quot; rel=&quot;nofollow noreferrer&quot;&gt;text terminal emulator&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs runs &lt;a href=&quot;/questions/tagged/term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term&amp;#39;&quot; rel=&quot;tag&quot;&gt;term&lt;/a&gt; by default in &lt;a href=&quot;/questions/tagged/term-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;term-mode&lt;/a&gt;, which can &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html#Term-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;use or switch&lt;/a&gt; between the two &lt;code&gt;input modes:&lt;/code&gt; &lt;a href=&quot;/questions/tagged/shell-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-mode&lt;/a&gt; and &lt;code&gt;character mode.&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For controlling the appearance of terminal screens, Emacs supports &lt;a href=&quot;/questions/tagged/ansi-term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;ansi-term&amp;#39;&quot; rel=&quot;tag&quot;&gt;ansi-term&lt;/a&gt; escape sequences recognized by such modern terminals as &lt;code&gt;xterm&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within a text &lt;a href=&quot;/questions/tagged/term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term&amp;#39;&quot; rel=&quot;tag&quot;&gt;term&lt;/a&gt;, which is a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Non_002dWindow-Terminals.html#Non_002dWindow-Terminals&quot; rel=&quot;nofollow noreferrer&quot;&gt;non-window terminal&lt;/a&gt;, Emacs can display only one &lt;a href=&quot;/questions/tagged/frame&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;frame&amp;#39;&quot; rel=&quot;tag&quot;&gt;frame&lt;/a&gt; at a time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Editing-Types.html#Editing-Types&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Lisp provides&lt;/a&gt; &lt;code&gt;terminal type&lt;/code&gt; as one of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Terminal-Type.html#Terminal-Type&quot; rel=&quot;nofollow noreferrer&quot;&gt;extended data types&lt;/a&gt; for programming editing features.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using the tags &lt;a href=&quot;/questions/tagged/term&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;term&amp;#39;&quot; rel=&quot;tag&quot;&gt;term&lt;/a&gt; or &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt;, use additional tags where appropriate or describe with appropriate Emacs terminology related to terminal emulators.&lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T17:29:54.557" LastActivityDate="2017-03-01T17:29:54.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31152" PostTypeId="4" CreationDate="2017-03-01T17:08:41.113" Score="0" Body="is for the Emacs text terminal emulator, which by default runs in a sub-shell in a buffer named `*terminal*` with `term-mode`. `M-x term` command starts a terminal." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T17:29:40.893" LastActivityDate="2017-03-01T17:29:40.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31153" PostTypeId="2" ParentId="28578" CreationDate="2017-03-01T17:11:42.480" Score="3" Body="&lt;p&gt;My solution was to create a virtual machine with Centos where I have admin rights, and compile emacs there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When building, I added a prefix to &lt;code&gt;configure&lt;/code&gt;.&#xA;That way &lt;code&gt;make install&lt;/code&gt; put everything within a folder that mimicked the directory tree of the machine where I have no admin rights.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Install Centos on a virtual machine and grab all dependencies.&lt;/li&gt;&#xA;&lt;li&gt;Get the emacs repository and run &lt;code&gt;autogen.sh&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Configure the build with &lt;code&gt;configure -prefix=/home/USERNAME/local/emacs&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Build emacs with &lt;code&gt;make install&lt;/code&gt;. The installation directory is all we need.&lt;/li&gt;&#xA;&lt;li&gt;Copy the install directory to the machine where you have no admin rights.&lt;/li&gt;&#xA;&lt;li&gt;DONE!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2018-07-04T00:01:36.050" LastActivityDate="2018-07-04T00:01:36.050" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31154" PostTypeId="5" CreationDate="2017-03-01T17:18:50.490" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Mark.html#Mark&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Mark and the Region&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/The-Mark.html#The-Mark&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Mark in Elisp&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T17:29:30.440" LastActivityDate="2017-03-01T17:29:30.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31155" PostTypeId="4" CreationDate="2017-03-01T17:18:50.490" Score="0" Body="is for marking the start of a region of text in a buffer. Emacs uses `mark` and `point` to highlight a region. Highlighting indicates that the mark and region are active." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T17:29:26.967" LastActivityDate="2017-03-01T17:29:26.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31156" PostTypeId="2" ParentId="31149" CreationDate="2017-03-01T17:45:28.550" Score="2" Body="&lt;pre&gt;&lt;code&gt;/2^3 ./&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Superscript (and subscript) requires a space after (even when {} are used).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also for italics to work there should NOT be a space before the ending / . Hence the need to do a &quot;something/&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15077" LastEditorUserId="15077" LastEditDate="2017-03-01T18:07:35.050" LastActivityDate="2017-03-01T18:07:35.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31157" PostTypeId="5" CreationDate="2017-03-01T17:45:48.207" Score="0" Body="&lt;p&gt;Shell buffers run in &lt;a href=&quot;/questions/tagged/shell-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-mode&lt;/a&gt;, which is derived from &lt;code&gt;comint-mode&lt;/code&gt; that runs subshells for &lt;a href=&quot;/questions/tagged/comint&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;comint&amp;#39;&quot; rel=&quot;tag&quot;&gt;comint&lt;/a&gt;, a command interpreter, in a &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;/questions/tagged/shell-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-mode&lt;/a&gt; and &lt;code&gt;character mode&lt;/code&gt; are two &lt;code&gt;input modes&lt;/code&gt; Emacs provides for running a &lt;a href=&quot;/questions/tagged/terminal&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;terminal&amp;#39;&quot; rel=&quot;tag&quot;&gt;terminal&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Mode.html#Shell-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shell Mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://%20https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html#Term-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Switching&lt;/a&gt; between &lt;a href=&quot;/questions/tagged/shell-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;shell-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;shell-mode&lt;/a&gt; and &lt;code&gt;character mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T18:48:13.740" LastActivityDate="2017-03-01T18:48:13.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31158" PostTypeId="4" CreationDate="2017-03-01T17:45:48.207" Score="0" Body="is for the major mode for shell buffers. Use `C-c` prefix for accessing `M-x commands`." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-01T17:53:41.427" LastActivityDate="2017-03-01T17:53:41.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31159" PostTypeId="1" AcceptedAnswerId="31170" CreationDate="2017-03-01T17:48:35.857" Score="1" ViewCount="387" Body="&lt;p&gt;When I attempt to start Spacemacs with the Python layer enabled, I see a warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error (use-package): python :init: Invalid version syntax: '[?1034h4.0.0'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Restarting emacs using &lt;code&gt;--debug-init&lt;/code&gt; shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Invalid version syntax: '[?1034h4.0.0'&quot;)&#xA;  signal(error (&quot;Invalid version syntax: '[?1034h4.0.0'&quot;))&#xA;  error(&quot;Invalid version syntax: '%s'&quot; &quot;[?1034h4.0.0&quot;)&#xA;  version-to-list(&quot;[?1034h4.0.0&quot;)&#xA;  version&amp;lt;(&quot;[?1034h4.0.0&quot; &quot;5&quot;)`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Plus a lot more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I comment out the python layer from &lt;code&gt;dotspacemacs-configuration-layers&lt;/code&gt;  in the .spacemacs file, the error goes away (but, of course, no Python layer is enabled). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any clues as to how to debug this would be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is running on OS X 10.12.2 With GNU Emacs 24.5.1 and Spacemacs v.0.200.7&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And running &lt;code&gt;(executable-find &quot;ipython&quot;)&lt;/code&gt; results in &lt;code&gt;/Users/xxx/anaconda/bin/ipython&lt;/code&gt; Same executable for &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12467" LastActivityDate="2017-03-31T23:46:13.203" Title="Spacemacs Python Layer Invalid version syntax: '[?1034h4.0.0'" Tags="|spacemacs|python|ipython|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31160" PostTypeId="1" AcceptedAnswerId="35866" CreationDate="2017-03-01T18:09:00.137" Score="9" ViewCount="12583" Body="&lt;p&gt;I can't find a clear tutorial for how to install GNU Emacs on Windows 10. Normally there are a few tricks required to get it running properly, so I thought I would ask here before trying one of the Windows 8 tutorials.&lt;/p&gt;&#xA;&lt;p&gt;The specific “flavour” of Emacs is not particularly important.&lt;/p&gt;&#xA;" OwnerUserId="15082" LastEditorUserId="16575" LastEditDate="2021-06-09T05:24:20.130" LastActivityDate="2021-06-09T05:24:20.130" Title="How to install GNU Emacs on Windows 10 Pro?" Tags="|microsoft-windows|emacsclient|install|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="31161" PostTypeId="2" ParentId="31136" CreationDate="2017-03-01T18:39:42.450" Score="4" Body="&lt;p&gt;I see what you want I think. If I use this org file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A citation cite:akhade-2011-effec.&#xA;&#xA;&#xA;bibliographystyle:unsrt&#xA;bibliography:~/Dropbox/bibliography/references.bib&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then it exports with bibliography to both html and latex. I use bibtex for the bibliography for latex, and org generates a minimal bibliography for html.  In general there is not a good way to get high quality bibliographies in html. The only option is unsorted, and there is no easy way to change it. The bibliography style is not used for the html export. You could check out &lt;a href=&quot;http://kitchingroup.cheme.cmu.edu/blog/2015/12/11/Introduction-to-a-citation-processor-in-org-ref/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://kitchingroup.cheme.cmu.edu/blog/2015/12/11/Introduction-to-a-citation-processor-in-org-ref/&lt;/a&gt;, which lays out what is needed to do that. It is basically a citation processor (which is what bibtex is for latex).&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-03-01T18:39:42.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31162" PostTypeId="1" CreationDate="2017-03-01T18:39:55.890" Score="1" ViewCount="212" Body="&lt;p&gt;In an interactive shell, I have a script I run that changes my directory (via &lt;code&gt;pushd&lt;/code&gt;) and then launches an interactive program.  At this point I issue &lt;code&gt;M-x cd&lt;/code&gt; and provide Emacs with the new directory that the script placed me in.  What I'd like to do is &lt;code&gt;M-x pushd&lt;/code&gt; (or equivalent) so that when I exit the program, my subsequent command-line &lt;code&gt;popd&lt;/code&gt; will be recognized by Emacs to adjust my directory accordingly.&lt;/p&gt;&#xA;" OwnerUserId="12977" LastActivityDate="2017-03-01T18:39:55.890" Title="`pushd` command for shell buffer" Tags="|shell|directory|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31163" PostTypeId="2" ParentId="28867" CreationDate="2017-03-01T18:52:45.577" Score="1" Body="&lt;p&gt;Add the following to the end of your lambda() routine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(goto-char (point-max))&#xA;(insert (concat &quot;export EMACS_AS_FILE=&quot; buffer-auto-save-file-name))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The shell command to assign your variable will automatically appear on the command line; simply hit enter to set it.&lt;/p&gt;&#xA;" OwnerUserId="12977" LastActivityDate="2017-03-01T18:52:45.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31164" PostTypeId="2" ParentId="28867" CreationDate="2017-03-01T19:16:00.603" Score="1" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((process-environment&#xA;       `(,(concat &quot;BUFFER_AUTO_SAVE_FILE_NAME=&quot;&#xA;                   buffer-auto-save-file-name)&#xA;         ,@process-environment)))&#xA;  (shell))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-03-01T19:16:00.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31165" PostTypeId="1" CreationDate="2017-03-01T20:03:51.340" Score="4" ViewCount="1972" Body="&lt;p&gt;&lt;strong&gt;Preface&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been dabbling with python programming for a mere few months now. Previously, I spent most of my programming time using C# with Visual Studio. In the Python world, I've been using PyCharm for my projects. It has excellent code-completion (much like the IntelliSense I'm used to) and a nice level of customizability. However, at the end of the day, I want something a little bit lighter and less clunky. I have seen videos of developers using Emacs with Python and I'm quite interested in learning it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Python 3.6.0 is installed.&lt;/li&gt;&#xA;&lt;li&gt;I have downloaded &lt;a href=&quot;http://ftp.gnu.org/gnu/emacs/windows/&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-25.1-x86_64-w64-mingw32.zip&lt;/a&gt; from the Emacs website.&lt;/li&gt;&#xA;&lt;li&gt;I have created a folder &lt;code&gt;C:\emacs&lt;/code&gt; and extracted the zip file to this location&lt;/li&gt;&#xA;&lt;li&gt;I have identified the Emacs home folder as &lt;code&gt;C:\Users\joshu\AppData\Roaming\.emacs.d&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;I have created an &lt;code&gt;init.el&lt;/code&gt; file in this directory since one did not exist&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Python Integration&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, this is where I'm struggling. I'm still extremely new to the software so it's a bit hard to piece together information from the internet. Using &lt;a href=&quot;https://realpython.com/blog/python/emacs-the-best-python-editor/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this tutorial&lt;/a&gt; I have developed a baseline &lt;code&gt;init.el&lt;/code&gt; file. Due to my reputation points, I cannot include a third link here. The Gist containing my &lt;code&gt;init.el&lt;/code&gt; file is commented below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I open Emacs and open a python file, editing works. However, I'm running into the issues outlined below:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;C-c C-c&lt;/code&gt; returns an error. It seems to be a relatively wide-spread error upon Googling. By simply typing &lt;code&gt;C-c C-c&lt;/code&gt; again, the shell will appear with the code being executed; however, it gives me the line &lt;code&gt;python.el: native completion setup failed&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: The error is &lt;code&gt;Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support&#xA;    readline, yet ‘python-shell-completion-native’ was t and &quot;python3&quot; is not&#xA;    part of the ‘python-shell-completion-native-disabled-interpreters’ list.&#xA;    Native completions have been disabled locally.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Python autocomplete doesn't seem to be working properly. When using PyCharm, I get a much, much more robust offering of completions. In the case of Emacs, if I begin typing something such as &lt;code&gt;from tkint&lt;/code&gt; it will not suggest &lt;code&gt;tkinter&lt;/code&gt;. Similarly, if I start typing &lt;code&gt;from math import a&lt;/code&gt; it will not suggest &lt;code&gt;abs&lt;/code&gt;. I'm not sure at all how to configure Python autocompletion. I've read a few things about using &lt;code&gt;pip install jedi&lt;/code&gt; and so on, but I haven't done any of that.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I realize this may be just as much a python question as an Emacs question in some regards. Any insight is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15085" LastEditorUserId="15085" LastEditDate="2017-03-01T21:10:48.353" LastActivityDate="2020-02-15T10:04:36.673" Title="Emacs 25.1 &amp; Python 3.6.0 Integration [Newbie]" Tags="|init-file|python|elpy|jedi|" AnswerCount="4" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="31166" PostTypeId="1" AcceptedAnswerId="31175" CreationDate="2017-03-01T20:17:42.163" Score="2" ViewCount="476" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I get &lt;code&gt;smartparens&lt;/code&gt; &lt;em&gt;not&lt;/em&gt; to insert a pair of ``LaTeX'' quotes?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The goal&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I set up &lt;code&gt;smartparens&lt;/code&gt; to insert a pair of quotation marks&#xA;&lt;em&gt;unless&lt;/em&gt; point is just before a word or just after it, where &lt;code&gt;*&lt;/code&gt;&#xA;is point:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;some text * some more text ==&amp;gt; some text &quot;*&quot; some more text&#xA;*some text                 ==&amp;gt; &quot;*some text&#xA;some text*                 ==&amp;gt; some text&quot;*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have it set up for &lt;code&gt;text-mode&lt;/code&gt; and &lt;code&gt;org-mode&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair '(text-mode org-mode) &quot;\&quot;&quot; nil&#xA;               :unless '(sp-point-before-word-p&#xA;                         sp-point-after-word-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;The problem&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;LaTeX is goofy with ``double quotes'' and `single quotes'.  That is: double quotes are done with &lt;em&gt;two&lt;/em&gt; backticks on the front and &lt;em&gt;two&lt;/em&gt; ticks at the end.  This&#xA;doesn't work: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sp-local-pair '(latex-mode) &quot;\&quot;&quot; nil&#xA;               :unless '(sp-point-before-word-p&#xA;                         sp-point-after-word-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;The ugly &quot;solution&quot;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;After much tinkering, the following works somewhat:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load &quot;latex&quot;&#xA;  (sp-local-pair '(latex-mode) &quot;`&quot; nil&#xA;                 :unless '(sp-point-before-word-p))&#xA;  (sp-local-pair '(latex-mode) &quot;'&quot; nil&#xA;                 :unless '(sp-point-after-word-p))&#xA;  (sp-local-pair '(latex-mode) &quot;``&quot; nil&#xA;                 :unless '(sp-point-before-word-p))&#xA;  (sp-local-pair '(latex-mode) &quot;''&quot; nil&#xA;                 :unless '(sp-point-after-word-p)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that seems a little ludicrous for such simple functionality.  It's also far from perfect, in that I get new and sometimes baffling errors from &lt;code&gt;yasnippet&lt;/code&gt;, of all things.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The mournful appeal&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Am I missing some simple, LaTeX-specific way of doing this?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastEditorUserId="253" LastEditDate="2017-03-02T13:20:45.697" LastActivityDate="2017-04-01T14:12:19.943" Title="smartparens NOT insert pair of LaTeX quotes?" Tags="|latex|smartparens|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="31167" PostTypeId="5" CreationDate="2017-03-01T20:25:36.850" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emacswiki.org/emacs/LineNumbers&quot; rel=&quot;nofollow noreferrer&quot;&gt;Line Numbers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T02:27:39.877" LastActivityDate="2017-03-02T02:27:39.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31168" PostTypeId="4" CreationDate="2017-03-01T20:25:36.850" Score="0" Body="for line numbering modes, such as `linum-mode` and `line-number-mode` minor modes that show line numbers on the left screen edge for ease of editing and navigating. They do not insert line numbers in the file. `line-number-mode` also has a `column-number-mode`, which shows in the mode line." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T13:51:58.197" LastActivityDate="2017-03-02T13:51:58.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31169" PostTypeId="2" ParentId="30857" CreationDate="2017-03-01T22:54:49.340" Score="10" Body="&lt;p&gt;I'm seeing he same issue. In a little digging, I think I've identified the&#xA;problem. However, not sure who this should be reported to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is in the org-babel-execute:clojure function. This function has the&#xA;following bit of code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq result&#xA;       (nrepl-dict-get&#xA;    (nrepl-sync-request:eval&#xA;     expanded (cider-current-connection) (cider-current-session))&#xA;    (if (or (member &quot;output&quot; result-params)&#xA;        (member &quot;pp&quot; result-params))&#xA;        &quot;out&quot;&#xA;      &quot;value&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is in the call to nrepl-sync-request:eval. The documentation states&#xA;for this function &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(nrepl-sync-request:eval INPUT CONNECTION &amp;amp;optional NS)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Send the INPUT to the nREPL server synchronously.&#xA;  The request is dispatched via CONNECTION.&#xA;  If NS is non-nil, include it in the request.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note the last optional argument NS. This is supposed to be a clojure&#xA;namespace. However, the org-babel-execute:clojure function is calling this&#xA;function with the output from cider-current-session, which returns a unique ID&#xA;representing the current session. As a result, the call is returning a data structure with an error and no output (perhaps some error handling is required). The returned result is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dict status (namespace-not-found done error done state state) id 17 session 43e9fd6c-82ed-49fe-9624-0cfc6f56f8b1 changed-namespaces (dict) repl-type cljclj)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the &lt;em&gt;namespace-not-found&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either the argument should be a call to (cider-current-ns) or perhaps it should&#xA;just be left out as I don't see how you can pass the namespace as part of the&#xA;block evaluation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: here is a simple patch which appears to fix the problem. Generated against current head of org git repo&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---&#xA; lisp/ob-clojure.el | 5 +++--&#xA; 1 file changed, 3 insertions(+), 2 deletions(-)&#xA;&#xA;diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el&#xA;index d407105..e542a29 100644&#xA;--- a/lisp/ob-clojure.el&#xA;+++ b/lisp/ob-clojure.el&#xA;@@ -44,6 +44,7 @@&#xA;&#xA; (declare-function cider-current-connection &quot;ext:cider-client&quot; (&amp;amp;optional type))&#xA; (declare-function cider-current-session &quot;ext:cider-client&quot; ())&#xA;+(declare-function cider-current-ns &quot;ext:cider-client&quot; ())&#xA; (declare-function nrepl--merge &quot;ext:nrepl-client&quot; (dict1 dict2))&#xA; (declare-function nrepl-dict-get &quot;ext:nrepl-client&quot; (dict key))&#xA; (declare-function nrepl-dict-put &quot;ext:nrepl-client&quot; (dict key value))&#xA;@@ -118,7 +119,7 @@ using the :show-process parameter.&quot;&#xA;                org-babel-clojure-sync-nrepl-timeout))&#xA;               (nrepl-sync-request:eval expanded&#xA;                        (cider-current-connection)&#xA;-                       (cider-current-session))))&#xA;+                       (cider-current-ns))))&#xA;           (setq result&#xA;             (concat&#xA;              (nrepl-dict-get response&#xA;@@ -153,7 +154,7 @@ using the :show-process parameter.&quot;&#xA;        ;; Update the status of the nREPL output session.&#xA;        (setq status (nrepl-dict-get response &quot;status&quot;)))&#xA;          (cider-current-connection)&#xA;-         (cider-current-session))&#xA;+         (cider-current-ns))&#xA;&#xA;         ;; Wait until the nREPL code finished to be processed.&#xA;         (while (not (member &quot;done&quot; status))&#xA;-- &#xA;2.7.4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also sent the patch to the emacs-orgmode list&lt;/p&gt;&#xA;" OwnerUserId="5498" LastEditorUserId="5498" LastEditDate="2017-03-03T04:19:09.093" LastActivityDate="2017-03-03T04:19:09.093" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31170" PostTypeId="2" ParentId="31159" CreationDate="2017-03-01T23:10:42.557" Score="1" Body="&lt;p&gt;Ok, the lesson here is to take care with you system Python installation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had conflicting Python version installed alternately via &lt;code&gt;brew&lt;/code&gt; and from &lt;code&gt;Anaconda.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To resolve this I had to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;/usr/local/bin/pip2 uninstall flake8&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then reinstall with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pip install flake8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which uses /Users/xxx/anaconda/bin/pip which is the pip/python installation that emacs attempts to use. Gnarly. &lt;/p&gt;&#xA;" OwnerUserId="12467" LastActivityDate="2017-03-01T23:10:42.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31171" PostTypeId="5" CreationDate="2017-03-02T01:17:01.410" Score="0" Body="&lt;h3&gt;Useful links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Insert-in-Picture.html#Insert-in-Picture&quot; rel=&quot;nofollow noreferrer&quot;&gt;motion after insert&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shift-Selection.html#Shift-Selection&quot; rel=&quot;nofollow noreferrer&quot;&gt;shift selection and cursor motion&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Outline-Motion.html#Outline-Motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;outline motion&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Motion-in-C.html#Motion-in-C&quot; rel=&quot;nofollow noreferrer&quot;&gt;motion&lt;/a&gt; in &lt;a href=&quot;/questions/tagged/c&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;c&amp;#39;&quot; rel=&quot;tag&quot;&gt;c&lt;/a&gt; &lt;a href=&quot;/questions/tagged/major-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;major-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;major-mode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-Navigation.html#Dired-Navigation&quot; rel=&quot;nofollow noreferrer&quot;&gt;motion&lt;/a&gt; in &lt;a href=&quot;/questions/tagged/dired&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;dired&amp;#39;&quot; rel=&quot;tag&quot;&gt;dired&lt;/a&gt; buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Calendar-Motion.html#Calendar-Motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;motion&lt;/a&gt; in &lt;a href=&quot;/questions/tagged/calendar&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;calendar&amp;#39;&quot; rel=&quot;tag&quot;&gt;calendar&lt;/a&gt; buffer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T04:18:50.303" LastActivityDate="2017-03-02T04:18:50.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31172" PostTypeId="4" CreationDate="2017-03-02T01:17:01.410" Score="0" Body="is for moving the cursor around the buffer. Emacs provides key-bindings for alternative ways of moving the cursor interactively: by syntactical elements such as characters and words; by forward and backward searches; by arbitrary lines; by units such as sentences, paragraphs, and s-expressions; and by other methods unique to certain modes." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T13:52:03.910" LastActivityDate="2017-03-02T13:52:03.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31173" PostTypeId="2" ParentId="31165" CreationDate="2017-03-02T04:46:00.300" Score="2" Body="&lt;p&gt;This seems to be bug in emacs and its fixed &lt;a href=&quot;https://github.com/emacs-mirror/emacs/commit/dbb341022870ecad4c9177485a6770a355633cc0&quot; rel=&quot;nofollow noreferrer&quot;&gt;in this commit&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As npostavs mentioned, you can use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'python&#xA;  (defun python-shell-completion-native-try ()&#xA;    &quot;Return non-nil if can trigger native completion.&quot;&#xA;    (let ((python-shell-completion-native-enable t)&#xA;          (python-shell-completion-native-output-timeout&#xA;           python-shell-completion-native-try-output-timeout))&#xA;      (python-shell-completion-native-get-completions&#xA;       (get-buffer-process (current-buffer))&#xA;       nil &quot;_&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can read entire &lt;a href=&quot;https://github.com/jorgenschaefer/elpy/issues/887&quot; rel=&quot;nofollow noreferrer&quot;&gt;discussion here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2017-03-02T04:46:00.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31175" PostTypeId="2" ParentId="31166" CreationDate="2017-03-02T13:42:21.290" Score="1" Body="&lt;p&gt;I &lt;em&gt;believe&lt;/em&gt; I have it.  The goal is to get &lt;code&gt;smartparens&lt;/code&gt; to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;insert a pair of &lt;em&gt;``LaTeX quotes''&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;unless at the beginning of a word, when it inserts the&#xA;&lt;em&gt;``opening quote&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;unless at the end of a word, when it inserts the &lt;em&gt;closing quote''&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's the code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'smartparens-latex)&#xA;&#xA;(sp-local-pair '(tex-mode plain-tex-mode latex-mode LaTeX-mode)&#xA;               &quot;``&quot; &quot;''&quot;&#xA;               :trigger &quot;\&quot;&quot;&#xA;               :unless '(sp-latex-point-after-backslash&#xA;                         sp-point-before-word-p&#xA;                         sp-point-after-word-p)&#xA;               :pre-handlers  '(sp-latex-pre-slurp-handler)&#xA;               :post-handlers '(sp-latex-skip-double-quote))&#xA;&#xA;(sp-local-pair '(tex-mode plain-tex-mode latex-mode LaTeX-mode)&#xA;               &quot;`&quot; &quot;'&quot;&#xA;               :trigger &quot;'&quot;&#xA;               :unless '(sp-latex-point-after-backslash&#xA;                         sp-point-before-word-p&#xA;                         sp-point-after-word-p)&#xA;               :pre-handlers  '(sp-latex-pre-slurp-handler)&#xA;               :post-handlers '(sp-latex-skip-double-quote))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that this modifies the settings I found when digging around&#xA;in the code base&#xA;in&#xA;&lt;a href=&quot;https://github.com/Fuco1/smartparens/blob/master/smartparens-latex.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;smartparens-latex&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; this only seems to work if you redefine the local pair for&#xA;&lt;em&gt;both&lt;/em&gt; the double quotes and the single quotes.  If you do only&#xA;the former, this is what you get when trying to insert a double&#xA;quote at the beginning of a word:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;``'gasp, clutch my pearls&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-03-02T13:42:21.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31177" PostTypeId="5" CreationDate="2017-03-02T14:28:17.663" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://emacs.stackexchange.com/a/5438/7045&quot;&gt;How can I troubleshoot a very slow Emacs?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Other related tags: &lt;a href=&quot;/questions/tagged/benchmarking&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;benchmarking&amp;#39;&quot; rel=&quot;tag&quot;&gt;benchmarking&lt;/a&gt; and  &lt;a href=&quot;/questions/tagged/profiler&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;profiler&amp;#39;&quot; rel=&quot;tag&quot;&gt;profiler&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T17:24:35.613" LastActivityDate="2017-03-02T17:24:35.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31178" PostTypeId="4" CreationDate="2017-03-02T14:28:17.663" Score="0" Body="is for Emacs performance-related issues. Use additional tags to indicate which aspects of Emacs the performance issue is about: startup, navigation, search, screen updates, compilation, execution, debugging, and so on. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T17:24:22.973" LastActivityDate="2017-03-02T17:24:22.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31179" PostTypeId="5" CreationDate="2017-03-02T14:54:18.180" Score="0" Body="&lt;p&gt;Other related tags include &lt;a href=&quot;/questions/tagged/preview-latex&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;preview-latex&amp;#39;&quot; rel=&quot;tag&quot;&gt;preview-latex&lt;/a&gt; for LaTeX buffers and &lt;a href=&quot;/questions/tagged/image&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;image&amp;#39;&quot; rel=&quot;tag&quot;&gt;image&lt;/a&gt; for image files. &lt;/p&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T17:24:38.853" LastActivityDate="2017-03-02T17:24:38.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31180" PostTypeId="4" CreationDate="2017-03-02T14:54:18.180" Score="0" Body="for preview of markup buffers, such as latex or markdown. Preview feature displays the editing buffer without an additional step of generating a preview." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T17:24:27.927" LastActivityDate="2017-03-02T17:24:27.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31181" PostTypeId="5" CreationDate="2017-03-02T15:09:10.077" Score="0" Body="&lt;p&gt;Use additional tags to indicate if the preview feature is being embedded in other modes, such as &lt;a href=&quot;/questions/tagged/org-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/auctex/preview-latex.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Preview Latex&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T17:24:43.130" LastActivityDate="2017-03-02T17:24:43.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31182" PostTypeId="4" CreationDate="2017-03-02T15:09:10.077" Score="0" Body="for preview of LaTeX markup buffers to ease the edit-compile-preview cycle. Preview LaTeX is part of the AUCTeX package that replaces snippets, such as math formulas, with a graphical image of the typeset version. " OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T17:24:31.377" LastActivityDate="2017-03-02T17:24:31.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31183" PostTypeId="2" ParentId="31073" CreationDate="2017-03-02T15:29:25.253" Score="1" Body="&lt;p&gt;You can change the default result output type by adding the following code to your &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'org-babel-default-header-args:emacs-lisp&#xA;             '(:results . &quot;output&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="411" LastActivityDate="2017-03-02T15:29:25.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31184" PostTypeId="1" AcceptedAnswerId="31210" CreationDate="2017-03-02T16:29:43.727" Score="2" ViewCount="218" Body="&lt;p&gt;I would like to repeat actions (preferably as a keyboard macro, but I am open to other solutions), in some kind of automated, &quot;slow motion&quot;.  By &quot;slow motion&quot;, I mean at a speed that is close to human pace, rather than usual full speed of &lt;code&gt;C-x e&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to be able to prepare actions then play them again during a presentation, or in order to capture them in a screencast (a bit like the GIF at the top of &lt;a href=&quot;http://developer.atlassian.com/blog/2015/11/scripting-with-node/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://developer.atlassian.com/blog/2015/11/scripting-with-node/&lt;/a&gt;, or the videos in &lt;a href=&quot;http://emacsgifs.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://emacsgifs.github.io/&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are of course a lot of information about automating tasks, and creating macros in Emacs, but nothing about slowing their repetition.&lt;/p&gt;&#xA;" OwnerUserId="11334" LastEditorUserId="11334" LastEditDate="2017-03-04T01:39:20.660" LastActivityDate="2018-02-02T10:45:25.603" Title="Repeat actions in slow motion, for presentation purposes" Tags="|keyboard-macros|automation|screencast|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31187" PostTypeId="2" ParentId="28714" CreationDate="2017-03-02T17:48:12.077" Score="1" Body="&lt;p&gt;Following the steps in &lt;a href=&quot;https://stackoverflow.com/a/1365821&quot;&gt;this answer over at Stack Overflow&lt;/a&gt; I was able to fix this by tweaking the underlying c-mode like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-php-mode-hook ()&#xA;  (c-set-offset 'arglist-cont-nonempty '+))&#xA;&#xA;(add-hook 'php-mode-hook 'my-php-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15094" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-02T17:48:12.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31188" PostTypeId="5" CreationDate="2017-03-02T18:15:03.237" Score="0" Body="&lt;p&gt;Other time-related tags and topics not included in the &lt;a href=&quot;/questions/tagged/time-date&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;time-date&amp;#39;&quot; rel=&quot;tag&quot;&gt;time-date&lt;/a&gt; tag are: &lt;code&gt;processor run time&lt;/code&gt;, &lt;a href=&quot;/questions/tagged/idle-timer&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;idle-timer&amp;#39;&quot; rel=&quot;tag&quot;&gt;idle-timer&lt;/a&gt;, and &lt;a href=&quot;/questions/tagged/timers&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;timers&amp;#39;&quot; rel=&quot;tag&quot;&gt;timers&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-of-Day.html#Time-of-Day&quot; rel=&quot;nofollow noreferrer&quot;&gt;Time of Day&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Parsing.html#Time-Parsing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Parsing and Formatting Times&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Zone-Rules.html#Time-Zone-Rules&quot; rel=&quot;nofollow noreferrer&quot;&gt;Time Zones Rules&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Conversion.html#Time-Conversion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Time Conversion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Calculations.html#Time-Calculations&quot; rel=&quot;nofollow noreferrer&quot;&gt;Time Calculations&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T20:14:59.570" LastActivityDate="2017-03-02T20:14:59.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31189" PostTypeId="4" CreationDate="2017-03-02T18:15:03.237" Score="0" Body="is for time of day, handling date and time formats, interfacing with the operating system for date and time values, converting time zones, and calculating date and time arithmetic." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-02T20:15:23.970" LastActivityDate="2017-03-02T20:15:23.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31191" PostTypeId="1" CreationDate="2017-03-02T20:53:15.100" Score="2" ViewCount="127" Body="&lt;p&gt;Is there a way of splitting a src block into several blocks while keeping them together with noweb reference syntax and editing them using org-edit-special in such a way that would take into account all the noweb referenced blocks?&lt;/p&gt;&#xA;" OwnerUserId="14725" LastActivityDate="2017-03-02T20:53:15.100" Title="noweb reference aware org-edit-special" Tags="|org-mode|org-babel|noweb|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31192" PostTypeId="2" ParentId="31165" CreationDate="2017-03-02T21:26:28.587" Score="1" Body="&lt;p&gt;I use the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; python-shell-interpreter &quot;ipython3&quot;&#xA; python-shell-interpreter-args &quot;--simple-prompt --pprint&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For python 3.6 I found jedi with company to be the most reliable but others may have different experiences. &quot;mypath&quot; below are the paths to packages I've created that I want autocomplete.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company-jedi      &#xA; :config&#xA;  (setq jedi:environment-virtualenv (list (expand-file-name &quot;~/.emacs.d/.python-environments/&quot;)))&#xA;  (add-hook 'python-mode-hook 'jedi:setup)&#xA;  (setq jedi:complete-on-dot t)&#xA;  (setq jedi:use-shortcuts t)&#xA;  (setq jedi:server-args&#xA;  '(&quot;--sys-path&quot; &quot;mypath1&quot;&#xA;    &quot;--sys-path&quot; &quot;mypath2&quot;))&#xA;&#xA;  (defun config/enable-company-jedi ()&#xA;    (add-to-list 'company-backends 'company-jedi))&#xA;  (add-hook 'python-mode-hook 'config/enable-company-jedi))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastActivityDate="2017-03-02T21:26:28.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31193" PostTypeId="1" CreationDate="2017-03-02T21:27:02.960" Score="0" ViewCount="374" Body="&lt;p&gt;My system has emacs 24.5.1 with a built-in ruby-mode. I want to update to the latest ruby-mode from emacs 25.1 in order to get &lt;a href=&quot;https://lists.gnu.org/archive/html/emacs-diffs/2016-01/msg00342.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;improved syntax highlighting&lt;/a&gt;. Upgrading the entire emacs installation is more than I want to chew off (many servers times many users).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I copied the improved ruby-mode.el to my home dir and added to my .emacs file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(load &quot;~/ruby-mode&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get no error messages upon reloading emacs, but also no upgraded ruby-mode (squiggly heredocs still not properly highlighted).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I replace the built-in ruby-mode with my own local copy?&lt;/p&gt;&#xA;" OwnerUserId="15099" LastEditorUserId="15099" LastEditDate="2017-03-02T23:20:53.050" LastActivityDate="2017-05-02T01:13:16.137" Title="Upgrading a built-in package" Tags="|ruby-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31194" PostTypeId="2" ParentId="31193" CreationDate="2017-03-02T21:45:24.980" Score="1" Body="&lt;p&gt;Ah, I've answered a different question. I somehow managed to completely ignore the &lt;code&gt;~/&lt;/code&gt; in &lt;code&gt;(load &quot;~/ruby-mode&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've now edited that out of the paths I've used below, in order that what I've written is coherent. It might still be useful info, so I'll not delete it, but it's not what you were asking...&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Emacs looks for libraries in the directories specified in &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;v&lt;/kbd&gt; &lt;code&gt;load-path&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default your home directory is not in that list (and nor would I recommend adding it), so &lt;code&gt;(load &quot;ruby-mode&quot;)&lt;/code&gt; would continue to find and load the default library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not already have a directory for your own local lisp libraries, I would suggest creating a &lt;code&gt;~/.emacs.d/lisp&lt;/code&gt; directory, and adding that to your load-path like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path (expand-file-name &quot;~/.emacs.d/lisp&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With &lt;code&gt;ruby-mode.el&lt;/code&gt; in that directory, &lt;code&gt;(load &quot;ruby-mode&quot;)&lt;/code&gt; would then find that version before the default version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the newer library works and you wish to roll this out to your multi-user servers, you would use the appropriate &lt;code&gt;site-lisp&lt;/code&gt; directory on those servers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember to byte-compile it.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-02T23:05:57.923" LastActivityDate="2017-03-02T23:05:57.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31195" PostTypeId="1" CreationDate="2017-03-02T22:28:15.600" Score="1" ViewCount="63" Body="&lt;p&gt;In org mode, &lt;code&gt;\Cc &amp;amp;&lt;/code&gt; goes back to the reference to a link; but this binding is suppressed by yasnippet.  Do I have to redefine it, or can I prevent yasnippet from creating these bindings in the first place?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastActivityDate="2017-03-02T22:28:15.600" Title="Conflict between org and yas: \Cc &amp;" Tags="|org-mode|yasnippet|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31197" PostTypeId="2" ParentId="13476" CreationDate="2017-03-03T00:33:40.047" Score="2" Body="&lt;p&gt;You can do it by modifying the python-run and forcing the Python process to restart:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Run python and pop-up its shell.&#xA;;; Kill process to solve the reload modules problem.&#xA;(defun my-python-shell-run ()&#xA;  (interactive)&#xA;  (when (get-buffer-process &quot;*Python*&quot;)&#xA;     (set-process-query-on-exit-flag (get-buffer-process &quot;*Python*&quot;) nil)&#xA;     (kill-process (get-buffer-process &quot;*Python*&quot;))&#xA;     ;; Uncomment If you want to clean the buffer too.&#xA;     ;;(kill-buffer &quot;*Python*&quot;)&#xA;     ;; Not so fast!&#xA;     (sleep-for 0.5))&#xA;  (run-python (python-shell-parse-command) nil nil)&#xA;  (python-shell-send-buffer)&#xA;  ;; Pop new window only if shell isnt visible&#xA;  ;; in any frame.&#xA;  (unless (get-buffer-window &quot;*Python*&quot; t) &#xA;    (python-shell-switch-to-shell)))&#xA;&#xA;(defun my-python-shell-run-region ()&#xA;  (interactive)&#xA;  (python-shell-send-region (region-beginning) (region-end))&#xA;  (python-shell-switch-to-shell))&#xA;&#xA;(eval-after-load &quot;python&quot;&#xA;  '(progn&#xA;     (define-key python-mode-map (kbd &quot;C-c C-c&quot;) 'my-python-shell-run)&#xA;     (define-key python-mode-map (kbd &quot;C-c C-r&quot;) 'my-python-shell-run-region)&#xA;     (define-key python-mode-map (kbd &quot;C-h f&quot;) 'python-eldoc-at-point)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://lgmoneda.github.io/2017/02/19/emacs-python-shell-config-eng.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lgmoneda.github.io/2017/02/19/emacs-python-shell-config-eng.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14902" LastActivityDate="2017-03-03T00:33:40.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31198" PostTypeId="1" AcceptedAnswerId="31199" CreationDate="2017-03-03T06:03:50.903" Score="15" ViewCount="5952" Body="&lt;p&gt;For a test purpose, I enabled the org-mode by &lt;code&gt;M-x org-mode&lt;/code&gt; in a buffer (e.g., in scratch buffer). How to disable it? Doing again an &lt;code&gt;M-x org-mode&lt;/code&gt; does not turn it off. &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="105" LastEditDate="2017-03-03T06:33:49.917" LastActivityDate="2017-03-03T07:12:58.160" Title="How to disable the org-mode in a buffer" Tags="|org-mode|major-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31199" PostTypeId="2" ParentId="31198" CreationDate="2017-03-03T07:12:58.160" Score="23" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Doing again an M-x org-mode does not turn it off.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This convention is for minor-modes - Doing a M-x &quot;minor-mode-name&quot; again disables that minor mode. org-mode is a major mode. When you do this, emacs has no clue which major mode to go into. There must be a major mode always active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, rather than disable org-mode, you have to think in terms of which major mode to go into. Fundamental mode, as described in a comment is a choice as good as any.&lt;/p&gt;&#xA;" OwnerUserId="11609" LastActivityDate="2017-03-03T07:12:58.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31201" PostTypeId="1" CreationDate="2017-03-03T10:20:17.157" Score="4" ViewCount="458" Body="&lt;p&gt;I want to find all todo's except type TASK without having to list all the other types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following but no luck:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '( (&quot;h&quot; &quot;Everything not a task&quot;&#xA; ( (todo &quot;-TASK&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Gives an empty list.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '( (&quot;h&quot; &quot;Everything not a task&quot;&#xA; ( (todo &quot;.*|-TASK&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Gives me everything, also TASK&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '( (&quot;h&quot; &quot;Everything not a task&quot;&#xA; ( (todo &quot;TODO|-TASK&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Gives me all TODO, and not TASK but I don't want to also maintain the list of types here.&lt;/p&gt;&#xA;" OwnerUserId="15105" LastEditorUserId="13358" LastEditDate="2017-03-03T20:10:27.243" LastActivityDate="2017-03-03T20:12:36.197" Title="How to do a search that matches all todo's except a specific one?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31202" PostTypeId="1" CreationDate="2017-03-03T14:11:54.550" Score="1" ViewCount="192" Body="&lt;p&gt;Emacs has the &lt;code&gt;scroll-all-mode&lt;/code&gt;, which scrolls two buffers synchronously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to edit about 8 files on 8 different hosts synchronously.  This can be achieved by running &lt;code&gt;vi&lt;/code&gt; in &lt;a href=&quot;https://www.mankier.com/1/cssh&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;cssh&lt;/code&gt;&lt;/a&gt;.  Is the same possible with Emacs using Tramp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By editing files synchronously I mean that I type one word and the word gets inserted in 8 different files opened in 8 different buffers. And when I move the cursor, the point in 8 different buffers are moved. And when I mark a word, 8 words in 8 buffers are marked. And when I kill a region, 8 regions in 8 different buffers are killed. And when I save one buffer all 8 buffers are saved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can copy the files with &lt;code&gt;scp&lt;/code&gt;, but the files are not identical. Just some parts at different positions are equal.&lt;/p&gt;&#xA;" OwnerUserId="2787" LastEditorUserId="2787" LastEditDate="2017-03-07T16:22:40.543" LastActivityDate="2017-03-07T16:22:40.543" Title="Can I edit several files synchronously?" Tags="|text-editing|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31203" PostTypeId="1" AcceptedAnswerId="39233" CreationDate="2017-03-03T15:44:24.507" Score="6" ViewCount="4109" Body="&lt;p&gt;If I am editing a python file, and start a python shell using &lt;code&gt;elpy-shell-switch-to-shell&lt;/code&gt; the process appears to set the working directory as the containing directory of the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the file itself is in a subfolder of a git repo. So, I would expect the working directory to be that of the containing .git directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set the project root directory using &lt;code&gt;elpy-set-project-root&lt;/code&gt; but that didn't seem to change the behaviour of &lt;code&gt;elpy-shell-switch-to-shell&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong here?&lt;/p&gt;&#xA;" OwnerUserId="3944" LastActivityDate="2023-04-10T16:53:29.457" Title="How to start python shell in appropriate working directory?" Tags="|python|shell|elpy|" AnswerCount="6" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31205" PostTypeId="2" ParentId="31201" CreationDate="2017-03-03T19:39:07.453" Score="5" Body="&lt;p&gt;This should return all todo's except those with a today keyword of TASK&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '( (&quot;h&quot; &quot;Everything not a task&quot;&#xA;                                     ( (tags-todo &quot;+TODO&amp;lt;&amp;gt;\&quot;TASK\&quot;&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you could also use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands '( (&quot;h&quot; &quot;Everything not a task&quot;&#xA;                                     ( (tags-todo &quot;/-TASK&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is based on the documentation &lt;a href=&quot;http://orgmode.org/worg/org-tutorials/advanced-searching.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13358" LastEditorUserId="13358" LastEditDate="2017-03-03T20:12:36.197" LastActivityDate="2017-03-03T20:12:36.197" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31206" PostTypeId="2" ParentId="13476" CreationDate="2017-03-03T19:42:08.847" Score="5" Body="&lt;p&gt;This is my workflow. I set emacs to use ipython&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq&#xA; python-shell-interpreter &quot;ipython3&quot;&#xA; python-shell-interpreter-args &quot;--simple-prompt --pprint&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in ~/.ipython/profile_default/startup/00-ipython_init.py I put the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ip = get_ipython()&#xA;ip.magic('load_ext autoreload')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I type this whenever I modify and want to reload my modules in ipython. I like this because it works for all modules and I don't have to worry about import dependencies.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%autoreload&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13934" LastActivityDate="2017-03-03T19:42:08.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31207" PostTypeId="1" CreationDate="2017-03-03T22:06:12.490" Score="2" ViewCount="301" Body="&lt;p&gt;A lot of times I have to change the input language of the keyboard (from English to a different one) causing the problem of the Emacs commands to not be recognized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally when you press Ctrl+A you move to the beginning of the line. When I have a different language than English selected then it says &quot;C-α undefined&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to make them independent of the language selected? All editors support this by default so I am sure that there has to be a way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Ubuntu 16.04 and I installed Emacs through the terminal. It is the 24.5.1 version. I haven't configured the keyboard at all except having included one more language as a possible input.&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="25" LastEditDate="2017-03-03T22:28:10.590" LastActivityDate="2017-03-03T22:28:10.590" Title="Key bindings are not recognized with non-Latin keyboard layouts on Ubuntu" Tags="|key-bindings|ubuntu|x11|keyboard-layout|localization|" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="31208" PostTypeId="1" CreationDate="2017-03-03T22:43:12.680" Score="1" ViewCount="801" Body="&lt;p&gt;I'm using powerline for my modeline and I have placed a clock within the modeline. This clock is only updating when I'm within that buffer, if I have another buffer up the clock freezes until that buffer is activated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;Initalise powerline mode line theme. Used with moe-theme&#xA;&#xA;(use-package powerline&#xA;  :defer 5&#xA;  :config&#xA;  ;; Time &amp;amp; Date&#xA;  (display-time-mode)&#xA;  (defpowerline display-time display-time-string)&#xA;  (setq display-time-format &quot;%H:%M&quot;) &#xA;&#xA;  ;; Display battery&#xA;  (display-battery-mode)&#xA;  (defpowerline display-battery display-battery-string)&#xA;  (setq battery-mode-line-format &quot;%L %b%p%%&quot;) ; &quot;[%L %b%p%% %t]&quot;&#xA;&#xA;  (defvar lunaryorn-vc-mode-line&#xA;    '(&quot; &quot; (:propertize&#xA;           ;; Strip the backend name from the VC status information&#xA;           (:eval (let ((backend (symbol-name (vc-backend (buffer-file-name)))))&#xA;                    (substring vc-mode (+ (length backend) 2))))&#xA;           face font-lock-variable-name-face))&#xA;    &quot;Mode line format for VC Mode.&quot;)&#xA;  (put 'lunaryorn-vc-mode-line 'risky-local-variable t)&#xA;&#xA;  ;; Setup my mode line&#xA;  (setq-default mode-line-format&#xA;                (list &quot;%e&quot; ; print error message about full memory.&#xA;                      '(:eval (append&#xA;                               (list&#xA;                                (powerline-lcl             'left nil  )&#xA;                                (powerline-rmw             'left nil  )&#xA;                                (powerline-buffer-id       'left nil   powerline-color1                 )&#xA;                                (powerline-major-mode      'left       powerline-color1                 )&#xA;                                (powerline-minor-modes     'left       powerline-color1                 )&#xA;                                (powerline-narrow          'left       powerline-color1 powerline-color2)&#xA;                                (lunaryorn-vc-mode-line    'center     powerline-color2                 )&#xA;&#xA;                                (powerline-pull-right (list &#xA;                                                       (powerline-row             'right     powerline-color1 powerline-color2)&#xA;                                                       (powerline-make-text       &quot;:&quot;        powerline-color1)&#xA;                                                       (powerline-column          'right     powerline-color1)&#xA;                                                       (powerline-percent         'right nil powerline-color1)&#xA;                                                       (powerline-display-time    'right nil )&#xA;                                                       (powerline-display-battery 'right nil)&#xA;                                                       (powerline-make-text       &quot; &quot;    nil)))&#xA;                                )))))&#xA;&#xA;&#xA;  ;; Remove the load&#xA;  (setq display-time-default-load-average nil)&#xA;&#xA;  ;; Remove the mail&#xA;  (setq display-time-mail-string &quot;&quot;)&#xA;  (setq display-time-use-mail-icon nil)&#xA;&#xA;  ;; Turn buffer size off&#xA;  (setq size-indication-mode &quot;&quot;)&#xA;&#xA;  (setq visible-bell 1)&#xA;&#xA;  (force-mode-line-update)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9463" LastActivityDate="2017-03-03T22:43:12.680" Title="mode line time not updating" Tags="|mode-line|time-date|powerline|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31209" PostTypeId="1" AcceptedAnswerId="31286" CreationDate="2017-03-04T01:30:28.493" Score="2" ViewCount="441" Body="&lt;p&gt;I'm having a weird problem opening files as root. From emacs -Q, I issue &lt;code&gt;(require 'tramp)&lt;/code&gt;, customize tramp-verbose to 10, and try to open a file as root: &lt;code&gt;C-x C-f /su::/etc/fstab&lt;/code&gt;. I'm then prompted for my root password. Entering the password, Emacs pauses for ca. 10 seconds, then appears to open a new file called fstab, but it's not the fstab that already exists in /etc/fstab. The message about calling make-directory to create the parent directories shows up, so I've apparently opened a new file somewhere. I can't see where, exactly, as &lt;code&gt;C-x C-f&lt;/code&gt;, or even &lt;code&gt;M-x shell-commmand pwd&lt;/code&gt; both prompt me for the root password, and then fail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despite having turned &lt;code&gt;tramp-verbose&lt;/code&gt; to the maximum value, there's not much in my &lt;strong&gt;*Messages*&lt;/strong&gt; buffer after all this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Creating customization setup...done&lt;br&gt;&#xA;  Tramp: Opening connection for root@onottra672626p using su...&lt;br&gt;&#xA;  Tramp: Sending command ‘exec su - root’&lt;br&gt;&#xA;  Tramp: Waiting for prompts from remote shell...&lt;br&gt;&#xA;  Tramp: Sending Password&lt;br&gt;&#xA;  Tramp: Waiting for prompts from remote shell...failed&lt;br&gt;&#xA;  Tramp: Opening connection for root@onottra672626p using su...failed&lt;br&gt;&#xA;  Use M-x make-directory RET RET to create the directory and its parents  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Tramp: Checking ‘vc-registered’ for /su:root@onottra672626p:  /etc/fstab...failed&lt;br&gt;&#xA;  Use M-x make-directory RET RET to create the directory and its parents&lt;br&gt;&#xA;  Tramp: Opening connection for root@ using su...&lt;br&gt;&#xA;  Tramp: Sending command ‘exec su - root’&lt;br&gt;&#xA;  Tramp: Waiting for prompts from remote shell...&lt;br&gt;&#xA;  Tramp: Sending Password&lt;br&gt;&#xA;  Tramp: Waiting for prompts from remote shell...failed&lt;br&gt;&#xA;  Tramp: Opening connection for root@onottra672626p using su...failed&lt;br&gt;&#xA;  Quit  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is all on a laptop, I'm not trying to connect to another machine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs 25.1.91.1, and confirmed again with Emacs 25.2.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions for further troubleshooting, or is this just a regular bug?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Update&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The problem was due to my use of the &lt;a href=&quot;https://github.com/banga/powerline-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;powerline prompt&lt;/a&gt;. The debug-log contained the lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;08:34:24.189824 tramp-accept-process-output (10) # *tramp/su root@....* run *tramp/su root@....*&#xA;&#xA;[30;41m~ [0;31m [m&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;&lt;/code&gt; symbol is provided by powerline. Tramp needs to detect shell prompts, and this unexpected character was confusing it. The fix required modifying the variable &lt;code&gt;tramp-shell-prompt-pattern&lt;/code&gt; to include the new symbol:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Original value was: &#xA;&quot;\(?:^\|&#xA;\)[^]#$%&gt;\n]*#?[]#$%&gt;] &lt;em&gt;\(\[[0-9;]&lt;/em&gt;[a-zA-Z] &lt;em&gt;\)&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;New new, corrected value is&#xA;&quot;\(?:^\|&#xA;\)[^]#$%&gt;\n]*#?[]#$%&gt;&lt;code&gt;&lt;/code&gt;] &lt;em&gt;\(\[[0-9;]&lt;/em&gt;[a-zA-Z] &lt;em&gt;\)&lt;/em&gt;&quot;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-03-13T19:08:55.757" LastActivityDate="2017-03-13T19:08:55.757" Title="Tramp using su fails with powerline prompt" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31210" PostTypeId="2" ParentId="31184" CreationDate="2017-03-04T01:46:46.403" Score="4" Body="&lt;p&gt;Actually, I've just discovered the tag &lt;code&gt;screencast&lt;/code&gt; (I added it to my question as well), which contained 2 questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/27162/&quot;&gt;how to repeat actions in slow motion&lt;/a&gt;, which contains a link to &lt;a href=&quot;https://github.com/vermiculus/package-demo&quot; rel=&quot;nofollow noreferrer&quot;&gt;package-demo&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/questions/798/&quot;&gt;how to record an Emacs frame&lt;/a&gt; and transform it to a GIF, with a link to &lt;a href=&quot;https://github.com/Bruce-Connor/camcorder.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;camcorder.el&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Even though &lt;code&gt;package-demo&lt;/code&gt; is quite simple, it is enough for my simple needs, and combining them together allows to develop the screencast incrementally and repeat the recording.  Here is a simple example how to mix them both:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(package-demo--run-demo&#xA; '((M-x eshell)&#xA;   (M-x camcorder-record)&#xA;   (pause 1)&#xA;   (typewriter &quot;ls -aol&quot;)&#xA;   (pause 1)&#xA;   (kbd &quot;RET&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/fgeorges/mlproj-web/blob/master/dev/gif-script.md&quot; rel=&quot;nofollow noreferrer&quot;&gt;This file&lt;/a&gt; contains more notes and examples.  The result is &lt;a href=&quot;https://github.com/fgeorges/mlproj-web/blob/master/src/images/mlproj-intro.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;there&lt;/a&gt; or live on &lt;a href=&quot;http://mlproj.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mlproj.org/&lt;/a&gt; homepage.&lt;/p&gt;&#xA;" OwnerUserId="11334" LastEditorUserId="11334" LastEditDate="2018-02-02T10:45:25.603" LastActivityDate="2018-02-02T10:45:25.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31211" PostTypeId="1" AcceptedAnswerId="31216" CreationDate="2017-03-04T04:29:32.503" Score="7" ViewCount="2611" Body="&lt;p&gt;I wish to write full latex code then show result as a image in org mode. My idea is: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use EXAMPLE block to write full latex code.&lt;/li&gt;&#xA;&lt;li&gt;Use emacs-lisp to compile the latex code to png.&lt;/li&gt;&#xA;&lt;li&gt;Show png file but &quot;file:latex.png&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Code as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: latexcircle&#xA;#+BEGIN_EXAMPLE&#xA;\documentclass[convert={outfile=latex.png},border=2pt]{standalone}&#xA;\usepackage{tikz}&#xA;\begin{document}&#xA;\begin{tikzpicture}&#xA;\draw[red] (0,0) circle (1cm);   &#xA;\end{tikzpicture}&#xA;\end{document}&#xA;#+END_EXAMPLE&#xA;&#xA;#+BEGIN_SRC emacs-lisp :var latexcode=latexcircle&#xA;(setq latexfile &quot;tmp.tex&quot;)&#xA;(write-region latexcode nil latexfile)&#xA;(setq latexcmd (format &quot;pdflatex --shell-escape %s&quot; latexfile))&#xA;(shell-command-to-string latexcmd)&#xA;&quot;file:latex.png&quot;&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: file:latex.png&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The file latex.png is created successfully but the result doesn't show the image.&#xA;I try to use &quot;file latex.png but it doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2017-03-04T15:10:16.930" Title="How to display latex image in org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31213" PostTypeId="1" AcceptedAnswerId="31214" CreationDate="2017-03-04T12:10:57.067" Score="2" ViewCount="121" Body="&lt;p&gt;I want to execute the &lt;code&gt;source&lt;/code&gt; shell command from the &lt;em&gt;eshell&lt;/em&gt; environment in Emacs. But the &lt;code&gt;source&lt;/code&gt; is also a lisp function, so the two command confilicts, and eshell always execute the &lt;code&gt;source&lt;/code&gt; function, instead of the &lt;code&gt;source&lt;/code&gt; shell command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to prevent this?&lt;/p&gt;&#xA;" OwnerUserId="12018" LastActivityDate="2017-05-03T13:43:59.120" Title="How to prevent eshell interpret bash shell command?" Tags="|eshell|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31214" PostTypeId="2" ParentId="31213" CreationDate="2017-03-04T12:19:24.347" Score="1" Body="&lt;p&gt;Just found this &lt;a href=&quot;https://www.masteringemacs.org/article/complete-guide-mastering-eshell&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog&lt;/a&gt;. Quote:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;All commands evaluated by Eshell have an evaluation order, which is an ordered list your command must pass through to determine what part of Eshell handles it. If there is nothing on the list that wants to evaluate your command, you will be told your command is invalid.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the problem is that the lisp &lt;code&gt;source&lt;/code&gt; function comes before the &lt;code&gt;source&lt;/code&gt; command. To fix this, we need to tell &lt;code&gt;eshell&lt;/code&gt; explicitly that we want to execute a shell command. And the answer is in this variable:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;eshell-explicit-command-char (default is *)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12018" LastEditorUserId="12018" LastEditDate="2017-03-04T13:25:39.360" LastActivityDate="2017-03-04T13:25:39.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31216" PostTypeId="2" ParentId="31211" CreationDate="2017-03-04T15:10:16.930" Score="9" Body="&lt;p&gt;Refer to &lt;a href=&quot;http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; link&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADER: :headers '(&quot;\\usepackage{tikz}&quot;)&#xA;#+BEGIN_SRC latex :fit yes :file latex.png :imagemagick yes :iminoptions -density 600 &#xA;\begin{tikzpicture}&#xA;\draw[red] (0,0) circle (1cm);&#xA;\end{tikzpicture}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/YlWPi.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YlWPi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14840" LastActivityDate="2017-03-04T15:10:16.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31217" PostTypeId="2" ParentId="14197" CreationDate="2017-03-04T15:19:07.850" Score="0" Body="&lt;p&gt;Following the hint of the answer above, and assuming you have &lt;code&gt;tidy&lt;/code&gt; installed a variation could be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;`C-x h M-| tidy -quiet -xml -utf8 -indent -`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will open a new buffer &lt;code&gt;*Shell Command Output*&lt;/code&gt; instead of directly replacing the contents of the buffer. After checking the result, replace the old contents with the new with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x h M-insert-buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;choose the suggested default which will probably be &lt;code&gt;*Shell Command Output*&lt;/code&gt;. You can save the command for later with a keyboard macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x ( C-x h M-| tidy -quiet -xml -utf8 -indent - C-x)&#xA;C-x C-k n pretty-xml&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this you can execute &lt;code&gt;M-x pretty-xml&lt;/code&gt; to reformat the buffer.  &lt;/p&gt;&#xA;" OwnerUserId="15116" LastActivityDate="2017-03-04T15:19:07.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31218" PostTypeId="2" ParentId="14197" CreationDate="2017-03-04T15:34:49.620" Score="33" Body="&lt;p&gt;The built-in &lt;code&gt;sgml-mode&lt;/code&gt; has a command to do this: &lt;code&gt;sgml-pretty-print&lt;/code&gt;. If you're in &lt;code&gt;nxml-mode&lt;/code&gt; it looks like you need switch to &lt;code&gt;sgml-mode&lt;/code&gt; first. You could write a command to temporarily switch to sgml-mode, run pretty-print, then switch back to nxml-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, here is a command that will pretty-print the region, optionally with auto-fill enabled:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun xml-pretty-print (beg end &amp;amp;optional arg)&#xA;  &quot;Reformat the region between BEG and END.&#xA;    With optional ARG, also auto-fill.&quot;&#xA;  (interactive &quot;*r\nP&quot;)&#xA;  (let ((fill (or (bound-and-true-p auto-fill-function) -1)))&#xA;    (sgml-mode)&#xA;    (when arg (auto-fill-mode))&#xA;    (sgml-pretty-print beg end)&#xA;    (nxml-mode)&#xA;    (auto-fill-mode fill)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-04T16:08:01.660" LastActivityDate="2017-03-04T16:08:01.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31219" PostTypeId="2" ParentId="2431" CreationDate="2017-03-04T15:41:34.013" Score="0" Body="&lt;p&gt;&lt;kbd&gt;C-a&lt;/kbd&gt; and &lt;kbd&gt;C-e&lt;/kbd&gt; both take a prefix argument that lets you skip lines. For example, &lt;kbd&gt;C-2&lt;/kbd&gt; &lt;kbd&gt;C-a&lt;/kbd&gt; will jump to the beginning of the next line and &lt;kbd&gt;C-2&lt;/kbd&gt; &lt;kbd&gt;C-e&lt;/kbd&gt; will jump to the end of the next line. A prefix argument of &lt;strong&gt;3&lt;/strong&gt; moves two lines, and so on. You can also use negative arguments to move to previous lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly these aren't much use when you need the cursor to stay in the same column, but I find most of my macros involve going to the start or end of a line anyway, so they're very convenient.&lt;/p&gt;&#xA;" OwnerUserId="7069" LastActivityDate="2017-03-04T15:41:34.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31220" PostTypeId="2" ParentId="31203" CreationDate="2017-03-04T15:58:57.367" Score="0" Body="&lt;p&gt;Generally Emacs will run any command in the same directory as the open file. You can open the root directory of your project in dired and run the python shell from there:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;C-f&lt;/kbd&gt; /path/to/dir/ &lt;kbd&gt;RET&lt;/kbd&gt; &lt;kbd&gt;M-x&lt;/kbd&gt; elpy-shell-switch-to-shell &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't look like &lt;em&gt;elpy&lt;/em&gt; provides any special way of doing this.&lt;/p&gt;&#xA;" OwnerUserId="7069" LastActivityDate="2017-03-04T15:58:57.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31221" PostTypeId="1" AcceptedAnswerId="31223" CreationDate="2017-03-04T16:22:06.350" Score="2" ViewCount="502" Body="&lt;p&gt;Whilst playing around with &lt;code&gt;compilation-mode&lt;/code&gt; for running tests and using HIGHLIGHT faces for failed expectations I've encountered a bit of a conundrum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; why does my &lt;code&gt;compilation-errors-regexp-alist&lt;/code&gt; fail to match when the matching group/s are preceded by more than a certain number of characters. And how best to mitigate this given my matching requirements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me try and demonstrate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-01-14&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some minimal code that reproduces the issue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defface face-frame&#xA;  '((t :foreground &quot;white&quot; :background &quot;black&quot; :weight bold)) &quot;frames out for a failing test&quot;)&#xA;&#xA;(defface face-wrong&#xA;  '((t :foreground &quot;white&quot; :background &quot;darkred&quot; :weight bold)) &quot;highlight incorrect output in red&quot;)&#xA;&#xA;(defface face-expected&#xA;  '((t :foreground &quot;white&quot; :background &quot;darkgreen&quot; :weight bold)) &quot;show expected output in green&quot;)&#xA;&#xA;(defconst error-regexp-alist&#xA;  '((&quot;^Received\n\\(\\(.\\|\n\\)+?\\)\nExpected\n\\(\\(.\\|\n\\)+?\\)\n\\(.*\\):\\([[:digit:]]+\\)\n--$&quot;&#xA;     5 6 nil nil nil (0 'face-frame) (1 'face-wrong) (3 'face-expected))))&#xA;&#xA;(define-derived-mode weird-compilation-mode compilation-mode &quot;Fixture Compilation&quot;&#xA;  (set (make-local-variable 'compilation-error-regexp-alist)&#xA;       error-regexp-alist))&#xA;&#xA;(defun demonstrate-weirdness ()&#xA;  (interactive)&#xA;  (with-current-buffer (get-buffer-create &quot;*weird-regexp-matching-issue*&quot;)&#xA;    (compilation-start &quot;./fixture.sh&quot; 'weird-compilation-mode (lambda (m) (buffer-name)))&#xA;    ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To reproduce:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Clone &lt;a href=&quot;https://github.com/codeasone/compile-mode-weirdness.git&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/codeasone/compile-mode-weirdness.git&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;cd compile-mode-weirdness&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Load &lt;code&gt;compile-mode-weirdness.el&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;M-x demonstrate-weirdness&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A &lt;code&gt;compilation-mode&lt;/code&gt; buffer should appear with the output of &lt;code&gt;fixture.sh&lt;/code&gt;, which produces test output to match against.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JPMME.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JPMME.png&quot; alt=&quot;all-good&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks good to me and it's what I want; output &lt;strong&gt;Received&lt;/strong&gt; in error is highlighted RED and &lt;strong&gt;Expected&lt;/strong&gt; output is highlighted GREEN, for both error cases&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt;, add a single addition &lt;code&gt;1&lt;/code&gt; (or any other character) to the start of &lt;code&gt;fixture.sh&lt;/code&gt; (after the &lt;code&gt;cat &amp;lt;&amp;lt; HERE&lt;/code&gt; of course) then switch back to the &lt;code&gt;*weird-regexp-matching-issue*&lt;/code&gt; buffer and hit &lt;code&gt;g&lt;/code&gt; to &lt;code&gt;(recompile)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1SeXY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1SeXY.png&quot; alt=&quot;boo-hoo&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I designed the regexp to group everything between &lt;code&gt;Received&lt;/code&gt; and &lt;code&gt;Expected&lt;/code&gt; including new-lines, and similarly between &lt;code&gt;Expected&lt;/code&gt; and &lt;code&gt;file:line&lt;/code&gt; information:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;^Received\n\\(\\(.\\|\n\\)+?\\)\nExpected\n\\(\\(.\\|\n\\)+?\\)\n\\(.*\\):\\([[:digit:]]+\\)\n--$&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; it's a shame Emacs doesn't support &lt;code&gt;lookbehind&lt;/code&gt; and &lt;code&gt;lookahead&lt;/code&gt; facilities as it would have made things easier...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears to work fine outside the context of &lt;code&gt;compilation-mode&lt;/code&gt;. I've tested it using various input strings via &lt;code&gt;regex-tool&lt;/code&gt;, &lt;code&gt;helm-regex&lt;/code&gt;, and using &lt;code&gt;(s-match ...)&lt;/code&gt; to check my own sanity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regular expressions can be such a wind up...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why is the matching and highlighting failing when the &quot;preamble&quot; output is extended beyond a certain length?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps someone with more experience with Emacs regular expressions or &lt;code&gt;compilation-mode&lt;/code&gt; internals can help me out. Hopefully the code + examples will help others who find themselves in a similar boat using &lt;code&gt;compilation-mode&lt;/code&gt; in the future. &lt;/p&gt;&#xA;" OwnerUserId="15111" LastEditorUserId="15111" LastEditDate="2017-03-04T17:17:22.520" LastActivityDate="2017-03-04T18:00:05.910" Title="A compilation-mode conundrum - matching and highlighting" Tags="|regular-expressions|highlighting|compilation-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31222" PostTypeId="1" CreationDate="2017-03-04T17:05:55.030" Score="1" ViewCount="790" Body="&lt;p&gt;I recently found out you can run python from emacs (Python Mode -&gt; py-shell) and I've been running my scripts through the py-shell due to only needing to C-c C-c, but I've been running into a problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;code&gt;import requests&lt;/code&gt; among other external libraries I have installed (through pip), but the python shell in Emacs can't find the modules. Is there a way I can change PATH variables in such a way that Emacs finds these modules? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the error the python shell gives (not sure if it helps, but this runs on the &quot;Py:run Shell-Compile&quot; buffer):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;exec(compile(open(r'/Users/r/Desktop/name.py').read(), r'/Users/r/Desktop/name.py', 'exec')) # PYTHON-MODE&#xA;Traceback (most recent call last):&#xA;  File &quot;&amp;lt;stdin&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;  File &quot;/Users/r/Desktop/name.py&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;    import requests&#xA;ImportError: No module named requests&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(As proof that I do have requests installed, I ran this on the terminal with &lt;code&gt;python name.py&lt;/code&gt; and it worked as expected)&lt;/p&gt;&#xA;" OwnerUserId="15097" LastActivityDate="2017-08-02T16:06:40.937" Title="Including pip-installed libraries on emacs python shell" Tags="|python|shell|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31223" PostTypeId="2" ParentId="31221" CreationDate="2017-03-04T18:00:05.910" Score="3" Body="&lt;p&gt;I think this is what's going on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The shell command produces output and at the same time compile.el wants to put font-lock properties on it using a list of regexps.  But how should it know, whether enough text has been produced in order to satisfy all regexp's requirements ?  For example, there could be one matching the start &lt;em&gt;and&lt;/em&gt; end of buffer, which would only succeed, if the complete output would be matched at once.  But that's not how compile.el operates:  It uses font-lock, which parses the output in batches as they arrive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same applies to your test case, albeit in a less severe way.  We can see what's going on, if we trace the function &lt;code&gt;compilation--ensure-parse&lt;/code&gt; using &lt;code&gt;trace-function-background&lt;/code&gt;. Here is a partial result, when applied to the erroneous case (with an added 1).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;======================================================================&#xA;1 -&amp;gt; (compilation--ensure-parse 184)&#xA;1 &amp;lt;- compilation--ensure-parse: nil&#xA;======================================================================&#xA;1 -&amp;gt; (compilation--ensure-parse 684)&#xA;1 &amp;lt;- compilation--ensure-parse: nil&#xA;======================================================================&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Checking the position 684 in the compilation buffer, we see that it corresponds to the beginning of this sub-string.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/path/to/test:1234&#xA;--&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it becomes clear, why this doesn't work: Your regexp requires the text to end in a double-hyphen, but font-lock has stopped just two lines short of the first occurrence of this string, so the first part of the output does not match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do about it, is to make sure, the buffer gets reparsed after all of the commands output was produced, e.g like in the following code.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun compilation-reparse-buffer (&amp;amp;rest _ignored)&#xA;  (interactive)&#xA;  (compilation--flush-parse (point-min) (point-max))&#xA;  (compilation--ensure-parse (point-max)))&#xA;&#xA;(add-hook 'weird-compilation-mode-hook&#xA;          (lambda nil&#xA;            (add-hook 'compilation-finish-functions #'compilation-reparse-buffer nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-03-04T18:00:05.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31224" PostTypeId="1" CreationDate="2017-03-04T18:12:47.153" Score="8" ViewCount="854" Body="&lt;p&gt;The &lt;code&gt;server-running-p&lt;/code&gt; predicate will evaluate to &lt;code&gt;t&lt;/code&gt; if the Emacs server is running, irrespective of which Emacs session currently &quot;owns&quot; the server process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, when there are two or more independent Emacs sessions running simultaneously, &lt;code&gt;server-running-p&lt;/code&gt; does not really test whether the &lt;strong&gt;&lt;em&gt;current&lt;/em&gt;&lt;/strong&gt; Emacs session is running the server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a more specific test, one that will evaluate to &lt;code&gt;t&lt;/code&gt; &lt;em&gt;if and only if&lt;/em&gt; the current session (i.e. the session performing the test) is running the Emacs server.&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="882" LastEditDate="2017-03-04T20:33:34.013" LastActivityDate="2017-03-06T12:52:35.820" Title="How to test (programmatically) whether the current Emacs session (among several) is running the Emacs server?" Tags="|server|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31225" PostTypeId="1" AcceptedAnswerId="31226" CreationDate="2017-03-04T18:27:43.547" Score="28" ViewCount="5575" Body="&lt;p&gt;By a &quot;decorated string&quot; I mean something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#(&quot;foo&quot; 0 4 (fontified t face font-lock-function-name-face))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...as opposed to the &quot;plain string&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;foo&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(If Elisp code reads a string directly from a buffer, it may be decorated like this.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the simplest way to convert a decorated string to a plain one (by stripping all the decorations)?&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2017-03-05T02:17:47.660" LastActivityDate="2017-03-05T02:17:47.660" Title="How to strip decorations (text properties) from a string?" Tags="|string|text-properties|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31226" PostTypeId="2" ParentId="31225" CreationDate="2017-03-04T18:45:13.423" Score="25" Body="&lt;p&gt;[Your propertized string looks wrong - perhaps you copied it wrong.  &lt;code&gt;foo&lt;/code&gt; has only 3 characters, so it is impossible for it to be fontified on chars 0 to 4 (i.e., chars 0, 1, 2, and 3 - that's 4 chars).  I use 3 instead of 4 in the example here.]&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((foo    #(&quot;foo&quot; 0 3 (fontified t face font-lock-function-name-face)))&#xA;       (start  0)&#xA;       (end    (length foo)))&#xA;  (set-text-properties start end nil foo)&#xA;  foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;set-text-properties&lt;/code&gt; is a built-in function in &lt;code&gt;C source code&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(set-text-properties START END PROPERTIES &amp;amp;optional OBJECT)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Completely replace properties of text from &lt;code&gt;START&lt;/code&gt; to &lt;code&gt;END&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The third argument &lt;code&gt;PROPERTIES&lt;/code&gt; is the new property list.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the optional fourth argument &lt;code&gt;OBJECT&lt;/code&gt; is a buffer (or nil, which means&#xA;  the current buffer), &lt;code&gt;START&lt;/code&gt; and &lt;code&gt;END&lt;/code&gt; are buffer positions (integers or&#xA;  markers).  If &lt;code&gt;OBJECT&lt;/code&gt; is a string, &lt;code&gt;START&lt;/code&gt; and &lt;code&gt;END&lt;/code&gt; are 0-based indices into it.&#xA;  If &lt;code&gt;PROPERTIES&lt;/code&gt; is nil, the effect is to remove all properties from&#xA;  the designated part of OBJECT.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the Elisp manual, node &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html&quot; rel=&quot;noreferrer&quot;&gt;Changing Properties&lt;/a&gt;.  There you will see this, under function &lt;code&gt;remove-text-properties&lt;/code&gt; (which you could also use to do the job):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To remove &lt;strong&gt;all&lt;/strong&gt; text properties from certain text, use &lt;code&gt;set-text-properties&lt;/code&gt; and specify &lt;code&gt;nil&lt;/code&gt; for the new property list.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As @Dan mentioned, you can also use &lt;code&gt;substring-no-properties&lt;/code&gt;, but be aware that it returns a new string.  It does not modify the actual string object that you pass it.  Both &lt;code&gt;remove-text-properties&lt;/code&gt; and &lt;code&gt;set-text-properties&lt;/code&gt; change the string you pass them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo #(&quot;foo&quot; 0 3 (fontified t face font-lock-function-name-face)))&#xA;(setq bar foo)&#xA;(set-text-properties 0 (length foo) nil foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both &lt;code&gt;foo&lt;/code&gt; and &lt;code&gt;bar&lt;/code&gt; are now just &lt;code&gt;&quot;foo&quot;&lt;/code&gt;, with no properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq foo #(&quot;foo&quot; 0 3 (fontified t face font-lock-function-name-face)))&#xA;(setq bar foo)&#xA;(setq foo (substring-no-properties foo))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now &lt;code&gt;foo&lt;/code&gt; has no properties but &lt;code&gt;bar&lt;/code&gt; still has them.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-03-04T22:11:18.450" LastActivityDate="2017-03-04T22:11:18.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31227" PostTypeId="1" CreationDate="2017-03-04T21:33:44.233" Score="1" ViewCount="500" Body="&lt;p&gt;I want to use gnus for reading and sending mails from my openmailbox address via IMAP, but can't configure it properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In /.gnus.el I wrote&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq user-mail-address &quot;email@openmailbox.org&quot;&#xA;      user-full-name    &quot;My Name&quot;)&#xA;&#xA;(setq gnus-select-method&#xA;      '(nnimap &quot;openmailbox&quot;&#xA;           (nnimap-address &quot;imap.openmailbox.org&quot;)&#xA;           (nnimap-server-port &quot;imaps&quot;)&#xA;           (nnimap-stream ssl)&#xA;           (nnimap-authinfo-file &quot;/home/user/.authinfo.gpg&quot;)))&#xA;&#xA;(setq smtpmail-smtp-server &quot;smtp.openmailbox.org&quot;&#xA;      smtpmail-smtp-service 465)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and in /.authinfo.gpg&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;machine imap.openmailbox.org login &amp;lt;LOGIN&amp;gt; password &amp;lt;PASSWORD&amp;gt; port imaps&#xA;machine smtp.openmailbox.org login &amp;lt;LOGIN&amp;gt; password &amp;lt;PASSWORD&amp;gt; port 465&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when I'm trying to log in it gives me the following error&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;nnimap (openmailbox) open error: 'NO (AUTHENTICATIONFAILED)&#xA;  Authentication failed.' Continue? (y or n)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I also tried with port 587 but it fails with the same output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody help me to configure gnus? You can find all necessary protocols on &lt;a href=&quot;https://www.openmailbox.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;openmailbox&lt;/a&gt; website.&lt;/p&gt;&#xA;" OwnerUserId="14784" LastActivityDate="2017-03-04T21:33:44.233" Title="Unable to configure gnus with openmailbox server" Tags="|gnus|email|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31228" PostTypeId="2" ParentId="31224" CreationDate="2017-03-04T22:34:44.407" Score="6" Body="&lt;p&gt;You might check:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(and (boundp 'server-process)&#xA;     (processp server-process)&#xA;     (server-running-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That should work provided that you've avoided starting a server in the other instances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a socket-based server, if you were to start a second Emacs instance, and forcibly delete and then restart the server process from that second instance, then the above code will still return non-nil in the original instance (as the same socket directory will be in use), leaving you in the original situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Obviously this isn't ideal, so there may well be a better solution.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;server-running-p&lt;/code&gt; tells you whether a particular named server (defaulting to &lt;code&gt;server-name&lt;/code&gt;) is running; so if your &lt;code&gt;server-name&lt;/code&gt; is the same in all of your instances, then you can avoid starting an already-running server like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Start server (but don't restart).&#xA;(require 'server)&#xA;(unless (server-running-p)&#xA;  (server-start))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-06T12:52:35.820" LastActivityDate="2017-03-06T12:52:35.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31229" PostTypeId="1" CreationDate="2017-03-04T23:49:23.677" Score="3" ViewCount="753" Body="&lt;p&gt;Let's say that I have the following snippet in Emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name: frac&#xA;# key: frac&#xA;# --&#xA;\frac{${1:numerator}}{${2:denominator}}$0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem is that when I write a snippet inside this snippet and press tab then the snippet is not expanding but the cursor is moving to the next placeholder. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make it to first expand the snippet and then, with the next tab ro move, to the next placeholder?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastActivityDate="2017-05-19T21:55:15.583" Title="Nested Snippets" Tags="|yasnippet|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31230" PostTypeId="2" ParentId="14215" CreationDate="2017-03-05T00:26:24.603" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/kai2nenobu/guide-key&quot; rel=&quot;nofollow noreferrer&quot;&gt;Guide-Key&lt;/a&gt; work nice for me for all configured prefixes.&lt;/p&gt;&#xA;" OwnerUserId="210" LastActivityDate="2017-03-05T00:26:24.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31231" PostTypeId="5" CreationDate="2017-03-05T03:40:12.600" Score="0" Body="&lt;p&gt;Since other major modes, such as &lt;a href=&quot;/questions/tagged/org-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-mode&lt;/a&gt; depend on the &lt;a href=&quot;/questions/tagged/calendar&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;calendar&amp;#39;&quot; rel=&quot;tag&quot;&gt;calendar&lt;/a&gt; functionality, include those tags as well when pertinent. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Calendar_002fDiary.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Calendar and the Diary&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Calendars.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Calendar Conversions&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Time-Conversion.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Time Conversions&lt;/a&gt; based on Calendars&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-05T13:41:53.023" LastActivityDate="2017-03-05T13:41:53.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31232" PostTypeId="4" CreationDate="2017-03-05T03:40:12.600" Score="0" Body="is for the desk calendar in Emacs, which also provides a diary for events that can be used for managing projects and appointments. `M-x calendar` displays an interactive calendar for picking dates in a `calendar-mode` buffer." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-05T13:42:06.493" LastActivityDate="2017-03-05T13:42:06.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31233" PostTypeId="1" CreationDate="2017-03-05T09:25:25.497" Score="1" ViewCount="225" Body="&lt;p&gt;In this SO question &lt;a href=&quot;https://stackoverflow.com/questions/2007329/emacs-23-1-50-1-hangs-ramdomly-for-6-8-seconds-on-windows-xp&quot;&gt;Emacs 23.1.50.1 hangs ramdomly for 6-8 seconds on Windows XP&lt;/a&gt; the OP show logs from Emacs that may cause errors, where can I find those logs?&lt;/p&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-05T09:25:25.497" Title="Where can I find emacs logs on Windows?" Tags="|microsoft-windows|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31234" PostTypeId="1" AcceptedAnswerId="31754" CreationDate="2017-03-05T11:36:58.180" Score="3" ViewCount="252" Body="&lt;p&gt;When I type any text in docstring I've got an exception right at cursor place. May be it's some &lt;code&gt;python-mode.el&lt;/code&gt; addon, I don't know. How should I fix it?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/JoQ56.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JoQ56.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;company-jedi&lt;/code&gt; and &lt;code&gt;python-mode.el&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13871" LastActivityDate="2017-06-27T16:27:29.400" Title="Errors in python buffer when type docstrings" Tags="|python|company-mode|jedi|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31235" PostTypeId="1" CreationDate="2017-03-05T12:51:28.027" Score="2" ViewCount="128" Body="&lt;p&gt;Is there a way to configure the number of recent files that will be in the &lt;code&gt;Recentf&lt;/code&gt; section of a &lt;code&gt;helm-mini&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="12449" LastEditorUserId="105" LastEditDate="2017-03-05T19:47:19.817" LastActivityDate="2017-03-05T19:47:19.817" Title="How to increase the number of recent file listings in helm-mini?" Tags="|init-file|helm|recentf|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31236" PostTypeId="1" CreationDate="2017-03-05T13:00:40.310" Score="0" ViewCount="242" Body="&lt;p&gt;If &lt;code&gt;evil-scroll-line-down&lt;/code&gt; is not given a count argument, the last count is used.  This is not the behaviour of vim, which scrolls one line if no count is specified. How can I get vim behaviour?&lt;/p&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="105" LastEditDate="2017-03-05T19:46:52.793" LastActivityDate="2020-08-18T09:00:55.077" Title="Disabling reusage of evil scroll count" Tags="|evil|scrolling|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31238" PostTypeId="1" CreationDate="2017-03-05T14:37:38.633" Score="4" ViewCount="584" Body="&lt;p&gt;Is there a way to have &lt;em&gt;all&lt;/em&gt; of my Org-mode sections export as Beamer frames? For instance, if I have a document like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* A&#xA;** B&#xA;** C&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I would like a slide for each of &lt;code&gt;A&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;, and &lt;code&gt;C&lt;/code&gt;. Setting &lt;code&gt;H:2&lt;/code&gt; gives me slides for the latter two, and &lt;code&gt;H:1&lt;/code&gt; gives me a single slide for all three. I've tried setting &lt;code&gt;BEAMER_env: frame&lt;/code&gt; on every single heading, but org-mode complains: 'Wrong block type at a headline named &quot;B&quot;'. Is there another way of achieving this slide structure?&lt;/p&gt;&#xA;" OwnerUserId="15125" LastActivityDate="2024-03-15T04:05:20.610" Title="Export all org-mode sections as Beamer frames?" Tags="|org-mode|org-export|beamer|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31239" PostTypeId="2" ParentId="27289" CreationDate="2017-03-05T14:45:29.663" Score="3" Body="&lt;p&gt;You can use the following (per the comments above and my own testing) to do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;n&quot; &quot;Next&quot;&#xA;  ((todo &quot;DONE|DROPPED&quot; ((org-agenda-overriding-header &quot;Done/Dropped:&quot;)))&#xA;  (todo &quot;NEXT&quot; ((org-agenda-overriding-header &quot;Next:&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13358" LastActivityDate="2017-03-05T14:45:29.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31240" PostTypeId="1" AcceptedAnswerId="31618" CreationDate="2017-03-05T16:06:35.457" Score="1" ViewCount="1779" Body="&lt;p&gt;I'd like to add &lt;a href=&quot;https://github.com/sellout/emacs-color-theme-solarized&quot; rel=&quot;nofollow noreferrer&quot;&gt;this solarized theme&lt;/a&gt; to my spacemacs. How do I do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I added &lt;code&gt;(load-theme 'solarized t)&lt;/code&gt; to my .spacemacs and I included it to my themes list. what I don't know is, where to put the downloaded directory from github.&lt;/p&gt;&#xA;" OwnerUserId="12463" LastEditorUserId="12463" LastEditDate="2017-03-05T16:44:00.180" LastActivityDate="2017-03-21T22:47:49.470" Title="how to add custom theme to spacemacs?" Tags="|spacemacs|themes|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31241" PostTypeId="2" ParentId="27289" CreationDate="2017-03-05T16:57:21.090" Score="5" Body="&lt;p&gt;You can to this with a plain &lt;code&gt;tags&lt;/code&gt; query just by dropping the &lt;code&gt;+&lt;/code&gt; from the search:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;n&quot; &quot;Next&quot;&#xA;  ((tags &quot;/DONE|DROPPED&quot; ((org-agenda-overriding-header &quot;Done/Dropped:&quot;)))&#xA;  (todo &quot;NEXT&quot; ((org-agenda-overriding-header &quot;Next:&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;+&lt;/code&gt; operator on a keyword or tag makes entries &lt;em&gt;require&lt;/em&gt; the tag to match.  So &lt;code&gt;+DONE|+DROPPED&lt;/code&gt; requires both &lt;code&gt;DONE&lt;/code&gt; and &lt;code&gt;DROPPED&lt;/code&gt;, which is impossible since an entries can have only one todo keyword. &lt;code&gt;+&lt;/code&gt; is essential the &lt;code&gt;AND&lt;/code&gt; operator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternate way to do the same thing is to use the regular expression syntax: &lt;code&gt;TODO={DONE\\|DROPPED}&lt;/code&gt;.  This is the only way to &lt;em&gt;avoid&lt;/em&gt; a set of keywords since the search syntax doesn't allow grouping.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastEditorUserId="2274" LastEditDate="2017-03-05T23:55:13.773" LastActivityDate="2017-03-05T23:55:13.773" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31242" PostTypeId="5" CreationDate="2017-03-05T17:02:42.680" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://orgmode.org/manual/Clocking-work-time.html#Clocking-work-time&quot; rel=&quot;nofollow noreferrer&quot;&gt;Clocking work time&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-05T21:56:33.480" LastActivityDate="2017-03-05T21:56:33.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31243" PostTypeId="4" CreationDate="2017-03-05T17:02:42.680" Score="0" Body="is for the Org mode feature for clocking work time by specific tasks in a project. Org clock records time spent on tasks, maintains a history time spent on tasks, and computes total time spent." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-05T21:56:25.437" LastActivityDate="2017-03-05T21:56:25.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31244" PostTypeId="1" AcceptedAnswerId="31247" CreationDate="2017-03-05T17:06:40.773" Score="5" ViewCount="3579" Body="&lt;p&gt;I have the following in my &lt;code&gt;init.el&lt;/code&gt;, and it does a great job of automatically disabling evil in certain emacs modes: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dolist (mode '(git-rebase-mode&#xA;        flycheck-error-list-mode&#xA;        inf-ruby-mode&#xA;        term-mode))&#xA;  (add-to-list 'evil-emacs-state-modes mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this will not work for &lt;code&gt;help-mode&lt;/code&gt;, which is frustrating, as &lt;code&gt;help-mode&lt;/code&gt; has some great keybindings I'd like to take advantage of. I've also tried this: &lt;code&gt;(add-to-list 'evil-emacs-state-modes 'help-mode)&lt;/code&gt;, but it didn't work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I turn off evil in &lt;code&gt;help-mode&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="14499" LastEditorUserId="105" LastEditDate="2017-03-05T19:46:29.077" LastActivityDate="2017-03-05T19:46:29.077" Title="How can I disable evil in help-mode?" Tags="|evil|help-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31245" PostTypeId="5" CreationDate="2017-03-05T17:20:58.460" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Local Variables in Files&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Safe-File-Variables.html#Safe-File-Variables&quot; rel=&quot;nofollow noreferrer&quot;&gt;Safety of File Variables&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;/questions/tagged/org-mode&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;org-mode&amp;#39;&quot; rel=&quot;tag&quot;&gt;org-mode&lt;/a&gt; in buffer &lt;a href=&quot;http://orgmode.org/manual/In_002dbuffer-settings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;settings&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-06T13:09:51.640" LastActivityDate="2017-03-06T13:09:51.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31246" PostTypeId="4" CreationDate="2017-03-05T17:20:58.460" Score="0" Body="File local variables are set automatically from -*-specifications-*- or &quot;Local Variables:&quot; specifications when visiting a buffer. These specifications are included in the file itself and therefore only affect this file (hence &quot;file local variables&quot;)." OwnerUserId="7045" LastEditorUserId="14825" LastEditDate="2019-07-27T22:35:42.547" LastActivityDate="2019-07-27T22:35:42.547" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31247" PostTypeId="2" ParentId="31244" CreationDate="2017-03-05T18:37:59.827" Score="14" Body="&lt;p&gt;The reason this fails is because &lt;code&gt;help-mode&lt;/code&gt; is in &lt;code&gt;evil-motion-state-modes&lt;/code&gt; by default, adding it to &lt;code&gt;evil-emacs-state-modes&lt;/code&gt; will therefore not have the desired effect as Evil looks it up in &lt;code&gt;evil-motion-state-modes&lt;/code&gt; first to determine the initial state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct way to change the initial state of a mode is by using &lt;code&gt;evil-set-initial-state&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-set-initial-state 'help-mode 'emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This helper function ensures that a given mode cannot be in more than one of the &lt;code&gt;evil-*-state-modes&lt;/code&gt; variables.  Alternatively customize every initial state variable to hold the correct modes and make sure you're not introducing any duplicates.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-03-05T18:37:59.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31248" PostTypeId="5" CreationDate="2017-03-05T23:52:26.443" Score="0" Body="&lt;h3&gt;Useful Links:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlays.html#Overlays&quot; rel=&quot;nofollow noreferrer&quot;&gt;Overlays&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-06T01:55:24.620" LastActivityDate="2017-03-06T01:55:24.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31249" PostTypeId="4" CreationDate="2017-03-05T23:52:26.443" Score="0" Body="an Emacs presentation feature that alters the appearance of a buffer’s text on the screen, without changing the buffer content" OwnerUserId="7045" LastEditorUserId="25" LastEditDate="2017-03-06T13:09:43.930" LastActivityDate="2017-03-06T13:09:43.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31250" PostTypeId="5" CreationDate="2017-03-06T00:06:31.443" Score="0" Body="&lt;h3&gt;Useful Links&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Abbrevs.html#Abbrevs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Abbrevs and Abbrev Expansion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/eintr/Mail-Aliases.html#Mail-Aliases&quot; rel=&quot;nofollow noreferrer&quot;&gt;Abbreviations in mail&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-06T01:55:07.303" LastActivityDate="2017-03-06T01:55:07.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31251" PostTypeId="4" CreationDate="2017-03-06T00:06:31.443" Score="0" Body="is for the abbreviation feature of Emacs where a string of characters are expanded to a longer string. Mainly used to reduce typing, `abbrev`  are recorded in a table that is shared locally, among buffers of the same major mode, or even globally. Some Emacs features, such as mail, implement their own `abbrev` functionality. Use additional tags when appropriate." OwnerUserId="7045" LastEditorUserId="7045" LastEditDate="2017-03-06T01:55:01.667" LastActivityDate="2017-03-06T01:55:01.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31252" PostTypeId="1" AcceptedAnswerId="31254" CreationDate="2017-03-06T01:57:04.417" Score="6" ViewCount="102" Body="&lt;p&gt;I'm writing a lispy documentation engine with elisp and to make things easier, I'm trying to modify the following behavior&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prin1-to-string '(cons 'a 'b))&#xA;;; =&amp;gt; &quot;(cons (quote a) (quote b))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(prin1-to-string '(cons 'a 'b))&#xA;;; =&amp;gt; &quot;(cons 'a 'b)&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to instruct &lt;code&gt;prin1-to-string&lt;/code&gt; to reinstate reader macros like this?  Reading through the C sources, I don't think it's possible since by the time the object has been read, we've already &lt;em&gt;used&lt;/em&gt; the reader-macro to turn &lt;code&gt;'a&lt;/code&gt; into &lt;code&gt;(quote a)&lt;/code&gt; and that &lt;code&gt;'&lt;/code&gt; is lost forever.  Is my only hope regex-replace?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="105" LastEditDate="2017-03-06T02:04:43.190" LastActivityDate="2017-03-06T03:28:44.177" Title="Can I tell prin1-to-string to use reader-macros?" Tags="|quote|print|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31253" PostTypeId="1" AcceptedAnswerId="31255" CreationDate="2017-03-06T03:05:45.983" Score="2" ViewCount="265" Body="&lt;p&gt;I'm trying to write a macro that will define a function exactly once where I don't really care what the name of the function is.  My thought was to generate a symbol, use &lt;code&gt;defun&lt;/code&gt; with that, and then put a special property on the symbol.  The next time the macro is called, it looks for a symbol with this property first and generates a new symbol if it can't find one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my code:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'dash)&#xA;(require 'cl-lib)&#xA;&#xA;(defun lispdoc-find-handler (key)&#xA;  (--find (and (functionp it)&#xA;               (-&amp;gt; (symbol-plist it)&#xA;                   (plist-get 'lispdoc-section-handler)&#xA;                   (eq key)))&#xA;          (append obarray nil)))&#xA;&#xA;(defmacro lispdoc-defsechandler (key &amp;amp;rest body)&#xA;  (let ((sym (or (lispdoc-find-handler key)   ;; use existing symbol if defined&#xA;                 (cl-gensym))))&#xA;    `(progn (defun ,sym ,@body)&#xA;            (put ',sym 'lispdoc-section-handler ,key)&#xA;            (cons ,key ',sym))))&#xA;&#xA;;; test&#xA;&#xA;(lispdoc-defsechandler :test (examples)&#xA;  (prin1-to-string examples))&#xA;&#xA;(when-let ((f (lispdoc-find-handler :test)))&#xA;  (funcall f '(1 2 3 4 5)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I &lt;code&gt;eval-defun&lt;/code&gt; my call to &lt;code&gt;lispdoc-defsechandler&lt;/code&gt;, I get a different symbol every time (where I'm very clearly checking to see if it already exists first).  When I &lt;code&gt;macroexpand-last-sexp&lt;/code&gt; it, I get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(progn (defun G564 (meta examples)&#xA;         (prin1-to-string examples))&#xA;  (put 'G564 'lispdoc-section-handler :test)&#xA;  (cons :test 'G564))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Evaluating this gives me the same ultimate return value (i.e., &lt;code&gt;(:test . G564)&lt;/code&gt;), but now the macro always gives the same result, too (i.e., the function has &lt;em&gt;actually&lt;/em&gt; been defined).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if I minimize the macro to just the following&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defmacro lispdoc-defsechandler (key &amp;amp;rest body)&#xA;  (let ((sym (or (lispdoc-find-handler key)&#xA;                 (cl-gensym))))&#xA;    `(defun ,sym ,@body)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I still get the generated &lt;code&gt;sym&lt;/code&gt; as a return value, but its function-value isn't defined.  What's going on here?  If the function isn't being defined, how is it getting evaluated at all?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2264" LastEditDate="2017-03-06T03:23:28.403" LastActivityDate="2017-03-06T15:29:58.770" Title="Why does my function-generating macro only work when I evaluate its expansion?" Tags="|elisp-macros|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31254" PostTypeId="2" ParentId="31252" CreationDate="2017-03-06T03:28:44.177" Score="6" Body="&lt;p&gt;Just bind &lt;code&gt;print-quoted&lt;/code&gt; to a non-nil value around the call to prin1(-to-string).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-06T03:28:44.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31255" PostTypeId="2" ParentId="31253" CreationDate="2017-03-06T03:36:38.623" Score="3" Body="&lt;p&gt;My crystal ball tells me you're confused by the fact the the generated symbols are not interned: while the symbol's name is &lt;code&gt;G564&lt;/code&gt; it is not the same symbol you get if you &lt;code&gt;(read-from-string &quot;G564&quot;)&lt;/code&gt; because it is not added to &lt;code&gt;obarray&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe the simplest fix is to &lt;code&gt;(put ',key 'lispdoc-section-handler ,sym)&lt;/code&gt; so you can just check &lt;code&gt;(get key 'lispdoc-section-handler)&lt;/code&gt; rather than having to loop over the obarray.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-03-06T15:29:58.770" LastActivityDate="2017-03-06T15:29:58.770" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31257" PostTypeId="2" ParentId="31253" CreationDate="2017-03-06T05:07:18.387" Score="0" Body="&lt;p&gt;For added clarity...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;printed representation&lt;/em&gt; of any symbol is its name, regardless of whether the symbol is interned. Hence the printed representations of any two symbols with the same name are indistinguishable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Emacs &lt;em&gt;reads&lt;/em&gt; a printed representation of your macro expansion, the lisp reader naturally &lt;em&gt;interns&lt;/em&gt; the symbol names, even though the symbols in question could have been uninterned in the original evaluation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when you are dealing with an object containing uninterned symbols, obtaining its printed representation and reading that representation back into lisp objects results in a distinctly different form to the one you started with.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-06T08:59:36.157" LastActivityDate="2017-03-06T08:59:36.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31258" PostTypeId="1" AcceptedAnswerId="31265" CreationDate="2017-03-06T11:20:15.263" Score="2" ViewCount="1377" Body="&lt;p&gt;I wanted to set up auctex to use mupdf as the pdf viewer it ran when I do &lt;code&gt;C-c C-v&lt;/code&gt;. So I &lt;code&gt;customize-variable&lt;/code&gt; on &lt;code&gt;TeX-view-program-list&lt;/code&gt; to include a line for MuPDF and &lt;code&gt;customize-variable&lt;/code&gt; on &lt;code&gt;TeX-view-program-selection&lt;/code&gt; to select MuPDF. But when I run &lt;code&gt;C-c C-v&lt;/code&gt;, I get the error: &lt;code&gt;Cannot find &quot;MuPDF&quot; viewer&lt;/code&gt;. My &lt;code&gt;.emacs&lt;/code&gt; contains the following relevant lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(TeX-view-program-list (quote ((&quot;MuPDF&quot; (&quot;mupdf %s.pdf&quot;) &quot;&quot;))))&#xA; '(TeX-view-program-selection&#xA;   (quote&#xA;    (((output-dvi has-no-display-manager)&#xA;      &quot;dvi2tty&quot;)&#xA;     ((output-dvi style-pstricks)&#xA;      &quot;dvips and gv&quot;)&#xA;     (output-dvi &quot;xdvi&quot;)&#xA;     (output-pdf &quot;MuPDF&quot;)&#xA;     (output-html &quot;xdg-open&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what on earth is going on!? &lt;code&gt;getenv PATH&lt;/code&gt; returns a list of paths that includes the location of mupdf, but I don't think that's relevant since the error has &quot;MuPDF&quot; capitalised... Pretty much exactly the same set-up works fine on my laptop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on emacs 24 (installed with the package manager on ubuntu) and auctex 11.90.0 (installed through emacs with &lt;code&gt;list-packages&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2017-03-06T13:48:28.950" Title="AucTeX doesn't seem to be aware of my TeX-view-program-list" Tags="|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31259" PostTypeId="1" AcceptedAnswerId="31323" CreationDate="2017-03-06T11:43:41.187" Score="0" ViewCount="840" Body="&lt;p&gt;I'd like to open multiple playlists with &lt;code&gt;M-x emms-play-playlist&lt;/code&gt; and have each one in a seperate *EMMS Playlist* buffer - at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have &lt;em&gt;different&lt;/em&gt; &quot;*EMMS Playlist*&quot; buffers - at the same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My init.el has for EMMS just these lines of &lt;a href=&quot;https://www.gnu.org/software/emms/manual/#Quickstart-Guide&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emms/manual/#Quickstart-Guide&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/elisp/emms/lisp/&quot;)  &#xA;(require 'emms-setup)  &#xA;(emms-all)  &#xA;(emms-default-players)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11498" LastEditorUserId="11498" LastEditDate="2017-03-08T18:49:46.380" LastActivityDate="2019-01-03T22:36:45.837" Title="EMMS with different playlists" Tags="|emms|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31260" PostTypeId="1" AcceptedAnswerId="31498" CreationDate="2017-03-06T12:18:47.423" Score="4" ViewCount="786" Body="&lt;p&gt;I am writing documentation for an API in org-mode, and exporting to HTML. I would like the exported HTML source blocks to have an associated button that copies the code to the clipboard, achieving something like the following:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/hXOSH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hXOSH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that I'll need to fiddle with the HTML export code, but I'm not sure where to start, exactly.&#xA;For the required JS part, I'm thinking of doing something along the lines described here: &lt;a href=&quot;https://stackoverflow.com/a/30810322/885262&quot;&gt;https://stackoverflow.com/a/30810322/885262&lt;/a&gt; and defining one button per source block, and associating the block's contents to its event listener, so that when the button is clicked, the code is copied to the clipboard. &lt;/p&gt;&#xA;" OwnerUserId="3924" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2019-11-17T07:11:21.177" Title="What would be the simplest way to add a &quot;Copy to clipboard&quot; button to html-exported source blocks in an org-mode file?" Tags="|org-export|buttons|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31261" PostTypeId="1" AcceptedAnswerId="31263" CreationDate="2017-03-06T13:07:35.387" Score="0" ViewCount="73" Body="&lt;p&gt;I was debugging some of my elisp code and realized that, in a tex-mode buffer, the newline character at end of line did not match [[:space:]].&#xA;In most other textmodes or progmodes, ie, the few I tested before posting :-), newline does match [[:space:]].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above situation breaks a lot of my old pattern-matching code and raises two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the rationale for this design?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case I want to change the status of ?\n so that it matches [[:space:]], are there hidden inconvenients to using &lt;code&gt;(modify-syntax-entry ?\n &quot; &quot; st)&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="1992" LastActivityDate="2017-03-06T13:29:52.127" Title="How come newline does not match [[:space:]] in tex-mode and bibtex-mode?" Tags="|latex|syntax-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31262" PostTypeId="2" ParentId="31236" CreationDate="2017-03-06T13:20:09.957" Score="0" Body="&lt;p&gt;In the meantime, you should re-bind &lt;code&gt;C-e&lt;/code&gt; (and &lt;code&gt;C-y&lt;/code&gt;) as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-command my/evil-scroll-line-down (count)&#xA;  :repeat nil&#xA;  :keep-visual t&#xA;  (interactive &quot;&amp;lt;c&amp;gt;&quot;)&#xA;  (progn&#xA;    ;; scroll...&#xA;    (evil-scroll-line-down count)&#xA;    ;; ...then, reset counter&#xA;    (setq evil-scroll-line-count 1)))&#xA;(define-key evil-normal-state-map (kbd &quot;C-e&quot;) #'my/evil-scroll-line-down)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2017-03-06T13:20:09.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31263" PostTypeId="2" ParentId="31261" CreationDate="2017-03-06T13:29:52.127" Score="2" Body="&lt;p&gt;&lt;code&gt;describe-char&lt;/code&gt; tells us that the newline has syntax:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                   (...)&#xA;            character: C-j (displayed as C-j) (codepoint 10, #o12, #xa)&#xA;                   (...)&#xA;               syntax: &amp;gt;    which means: endcomment&#xA;                   (...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It counts as a whitespace in &lt;code&gt;fundamental-mode&lt;/code&gt;, but not in &lt;code&gt;emacs-lisp-mode&lt;/code&gt;, and, I suspect, not in any progmode for a language having a comment syntax starting with a character and ending with a newline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing the syntax value of the character could break some comments-related features of latex modes. Now, given how latex modes like to handle stuff without using general emacs facilities, it may still work fine, so you can always try it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it may also matter for your regexps, given the following *tex idiom:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;this is not a word%&#xA;boundary&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="184" LastActivityDate="2017-03-06T13:29:52.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31264" PostTypeId="1" AcceptedAnswerId="31345" CreationDate="2017-03-06T13:31:03.417" Score="0" ViewCount="280" Body="&lt;p&gt;I'm running emacs on macOS, and I've run into problems with &lt;code&gt;ansi-term&lt;/code&gt;. Using bash itself works fine, but as soon as I run a simple application with a command line interface, my &lt;code&gt;&amp;lt;delete&amp;gt;&lt;/code&gt; and arrow keys break. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of the usual delete behaviour, emacs prints &lt;code&gt;^h&lt;/code&gt;, and instead of moving in the direction indicated by the arrow keys, emacs prints &lt;code&gt;^[OA&lt;/code&gt;, &lt;code&gt;^[OB&lt;/code&gt;, &lt;code&gt;^[OC&lt;/code&gt;, and &lt;code&gt;^[OD&lt;/code&gt;. How can I fix this?&lt;/p&gt;&#xA;" OwnerUserId="14499" LastEditorUserId="105" LastEditDate="2017-03-06T15:42:02.427" LastActivityDate="2017-04-08T15:35:21.057" Title="How to fix &lt;delete&gt; and arrow keys in ansi-term on macOS" Tags="|key-bindings|osx|ansi-term|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31265" PostTypeId="2" ParentId="31258" CreationDate="2017-03-06T13:34:48.107" Score="2" Body="&lt;p&gt;Part of docstring from &lt;code&gt;TeX-view-program-list&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;TeX-view-program-list is a variable defined in ‘tex.el’.&lt;br&gt;&#xA;  Its value is nil&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;br&gt;&#xA;  List of viewer specifications. This variable can be&#xA;  used to specify how a viewer is to be invoked and thereby add new&#xA;  viewers on top of the built-in list of viewers defined in&#xA;  ‘TeX-view-program-list-builtin’ or override entries in the latter.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;AUCTeX comes with a lot of viewers pre-configured.  They are stored in &lt;code&gt;TeX-view-program-list-builtin&lt;/code&gt;.  Checking this variable is helpful if you plan to switch your viewer.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] The&#xA;  second element can be a command line to be run as a process or a Lisp&#xA;  function to be executed.  The command line can either be specified as&#xA;  a single string or a list of strings and two-part lists.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is what I suggested: Putting the command line in a single string &lt;code&gt;&quot;mupdf %o&quot;&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that the command line can&#xA;  contain placeholders as defined in ‘TeX-expand-list’ which are&#xA;  expanded before the viewer is called.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is for the &lt;code&gt;%o&lt;/code&gt; part: &lt;code&gt;%o&lt;/code&gt; expands to output file incl. the file extension.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The third element of the item is&#xA;  optional and is a string, or a list of strings, with the name of the&#xA;  executable, or executables, needed to open the output file in the&#xA;  viewer.  Placeholders defined in ‘TeX-expand-list’ can be used here. &#xA;  This element is used to check whether the viewer is actually available&#xA;  on the system.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is for the last &lt;code&gt;&quot;mupdf&quot;&lt;/code&gt;.  Putting it together, &lt;code&gt;(&quot;MuPDF&quot; &quot;mupdf %o&quot; &quot;mupdf&quot;)&lt;/code&gt; should do the job.  I'm not sure if MuPDF has synctex support, though.  If yes, this should be added in the second string.&lt;/p&gt;&#xA;" OwnerUserId="12242" LastEditorUserId="12242" LastEditDate="2017-03-06T13:48:28.950" LastActivityDate="2017-03-06T13:48:28.950" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31266" PostTypeId="2" ParentId="20898" CreationDate="2017-03-06T14:35:16.767" Score="1" Body="&lt;p&gt;&lt;code&gt;M-x emms-seek-to&lt;/code&gt; with the argument &lt;code&gt;n&lt;/code&gt;  jumps to &lt;code&gt;n&lt;/code&gt;-th second of the track (for n=601 you get 10:01).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x emms-seek&lt;/code&gt; is also helpful.&#xA;From emms.el:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;defun emms-seek (seconds): &quot;Seek the current player SECONDS seconds. This can be a floating point number for sub-second fractions. It can also be negative to seek backwards.&quot; &lt;/p&gt;&#xA;" OwnerUserId="11498" LastEditorUserId="11498" LastEditDate="2017-03-06T15:33:54.077" LastActivityDate="2017-03-06T15:33:54.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31267" PostTypeId="1" CreationDate="2017-03-06T15:12:34.737" Score="3" ViewCount="3074" Body="&lt;p&gt;I've learned &lt;a href=&quot;https://emacs.stackexchange.com/questions/27525/changing-the-variable-pitch-font&quot;&gt;here&lt;/a&gt; that I can customize my variable-pitch font.&#xA;For org-mode, I'm using that customization together with the following snippet to get a mix of variable and fixed-pitch fonts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'org-mode-hook&#xA;            '(lambda ()&#xA;               (variable-pitch-mode 1)&#xA;               (mapc&#xA;                (lambda (face)&#xA;                  (set-face-attribute face nil :inherit 'fixed-pitch))&#xA;                (list 'org-code&#xA;                      'org-link &#xA;                      'org-block&#xA;                      'org-table&#xA;                      'org-block-begin-line&#xA;                      'org-block-end-line&#xA;                      'org-meta-line&#xA;                      'org-document-info-keyword))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything except for normal text is displayed in fixed-pitch, which is displayed with variable-pitch. The problem with my solution is that the &lt;strong&gt;font-size for both fonts is different and the variable-pitch looks really small and hard to read.&lt;/strong&gt; How can I adapt my solution so that both fonts have the same size?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I also have the feeling that my solution is not ideal because I get buffer fontification problems every now and then in SRC blocks when opening files..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example image:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sMU2q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sMU2q.png&quot; alt=&quot;different-fonts&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-11-17T09:19:25.793" Title="Variable-pitch and fixed-pitch with the same font-size?" Tags="|org-mode|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31271" PostTypeId="1" AcceptedAnswerId="31280" CreationDate="2017-03-06T18:20:43.490" Score="7" ViewCount="1764" Body="&lt;p&gt;I use org-mode to write documents that are both exported into PDF via latex and HTML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the package siunitx to typeset numbers with si-units. It is a bit tedious to do but I got used to it (unless I figure out how to make &lt;a href=&quot;https://www.emacswiki.org/emacs/siunitx.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; work under org-mode).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I export to HTML the things written in the siunitx-syntax are exported as plain text. I found out that org-mode uses MathJax for its HTML export. There is a &lt;a href=&quot;https://github.com/mathjax/MathJax-third-party-extensions/tree/master/siunitx&quot; rel=&quot;nofollow noreferrer&quot;&gt;third-party extensions&lt;/a&gt;  for MathJax that is supposed to export siunitx syntax correctly to HTML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get org-mode to use this third party extension when exporting via HTML?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the suggestion from @Nick I pasted the code into my user.el file. The code appears correctly in the &lt;code&gt;org-html-mathjax-template&lt;/code&gt; variable. The HTML did not how the units correctly in a test file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the HTML file, the script appears just before the &lt;code&gt;&amp;lt;/head&amp;gt;&lt;/code&gt;and beginning of the document in this form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML&quot;&amp;gt;&amp;lt;/script&amp;gt;&#xA;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&#xA;&amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/&#xA;    MathJax.Hub.Config({&#xA;        // Only one of the two following lines, depending on user settings&#xA;        // First allows browser-native MathML display, second forces HTML/CSS&#xA;        jax: [&quot;input/TeX&quot;, &quot;output/HTML-CSS&quot;],&#xA;        extensions: [&quot;tex2jax.js&quot;,&quot;TeX/AMSmath.js&quot;,&quot;TeX/AMSsymbols.js&quot;,&#xA;                     &quot;TeX/noUndefined.js&quot;, &quot;[Contrib]/siunitx/siunitx.js&quot;, &quot;[Contrib]/mhchem/mhchem.js&quot;],&#xA;        tex2jax: {&#xA;            inlineMath: [ [&quot;\\(&quot;,&quot;\\)&quot;] ],&#xA;            displayMath: [ ['$$','$$'], [&quot;\\[&quot;,&quot;\\]&quot;], [&quot;\\begin{displaymath}&quot;,&quot;\\end{displaymath}&quot;] ],&#xA;            skipTags: [&quot;script&quot;,&quot;noscript&quot;,&quot;style&quot;,&quot;textarea&quot;,&quot;pre&quot;,&quot;code&quot;],&#xA;            ignoreClass: &quot;tex2jax_ignore&quot;,&#xA;            processEscapes: false,&#xA;            processEnvironments: true,&#xA;            preview: &quot;TeX&quot;&#xA;        },&#xA;        TeX: {extensions: [&quot;AMSmath.js&quot;,&quot;AMSsymbols.js&quot;,  &quot;[Contrib]/siunitx/siunitx.js&quot;, &quot;[Contrib]/mhchem/mhchem.js&quot;]},&#xA;        showProcessingMessages: true,&#xA;        displayAlign: &quot;center&quot;,&#xA;        displayIndent: &quot;0em&quot;,&#xA;&#xA;        &quot;HTML-CSS&quot;: {&#xA;             scale: 100,&#xA;             availableFonts: [&quot;STIX&quot;,&quot;TeX&quot;],&#xA;             preferredFont: &quot;TeX&quot;,&#xA;             webFont: &quot;TeX&quot;,&#xA;             imageFont: &quot;TeX&quot;,&#xA;             showMathMenu: true,&#xA;        },&#xA;        MMLorHTML: {&#xA;             prefer: {&#xA;                 MSIE:    &quot;MML&quot;,&#xA;                 Firefox: &quot;MML&quot;,&#xA;                 Opera:   &quot;HTML&quot;,&#xA;                 other:   &quot;HTML&quot;&#xA;             }&#xA;        }&#xA;    });&#xA;/*]]&amp;gt;*///--&amp;gt;&#xA;&amp;lt;/script&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;@Nick also suggested to check the developer mode in the browser (Chromium on OSX in my case). However, I have no idea what to look for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**UPDATE:*&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since MathJax is not hosted on its normal cdn.mathjax.org siunitx and mchem are not working (in addition to accesibility-menu.js ??). I am not able to solve the issue but this is as for as I got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-html-mathjax-template&#xA;      &quot;&#xA;&amp;lt;script type=\&quot;text/javascript\&quot; src=\&quot;%PATH\&quot;&amp;gt;&amp;lt;/script&amp;gt;&#xA;&amp;lt;script type=\&quot;text/javascript\&quot;&amp;gt;&#xA;&amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/&#xA;MathJax.Ajax.config.path['mhchem'] = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.2.0';&#xA;MathJax.Ajax.config.path['siunitx']  = 'http://rawgit.com/burnpanck/MathJax-siunitx/master/';&#xA;    MathJax.Hub.Config({&#xA;        jax: [\&quot;input/TeX\&quot;, \&quot;output/HTML-CSS\&quot;],&#xA;        extensions: [\&quot;tex2jax.js\&quot;,\&quot;TeX/AMSmath.js\&quot;,\&quot;TeX/AMSsymbols.js\&quot;,&#xA;                     \&quot;TeX/noUndefined.js\&quot;, \&quot;[siunitx]/siunitx.js\&quot;, \&quot;[mhchem]/mhchem.js\&quot;],&#xA;tex2jax: {&#xA;inlineMath:[[\&quot;\\\\(\&quot;,\&quot;\\\\)\&quot;] ],&#xA;displayMath: [ ['$$','$$'], [\&quot;\\\\[\&quot;,\&quot;\\\\]\&quot;], [\&quot;\\\\begin{displaymath}\&quot;,\&quot;\\\\end{displaymath}\&quot;] ],&#xA;skipTags: [\&quot;script\&quot;,\&quot;noscript\&quot;,\&quot;style\&quot;,\&quot;textarea\&quot;,\&quot;pre\&quot;,\&quot;code\&quot;],&#xA;ignoreClass: \&quot;tex2jax_ignore\&quot;,&#xA;processEscapes: false,&#xA;processEnvironments: true,&#xA;preview: \&quot;TeX\&quot;&#xA;},&#xA;TeX: {extensions: [\&quot;AMSmath.js\&quot;,\&quot;AMSsymbols.js\&quot;,  \&quot;[siunitx]/siunitx.js\&quot;, \&quot;[mhchem]/mchem.js\&quot;]},&#xA;showProcessingMessages: true,&#xA;displayAlign: \&quot;%ALIGN\&quot;,&#xA;displayIndent: \&quot;%INDENT\&quot;,&#xA;&#xA;\&quot;HTML-CSS\&quot;: {&#xA;scale: %SCALE,&#xA;availableFonts: [\&quot;STIX\&quot;,\&quot;TeX\&quot;],&#xA;preferredFont: \&quot;TeX\&quot;,&#xA;webFont: \&quot;TeX\&quot;,&#xA;imageFont: \&quot;TeX\&quot;,&#xA;showMathMenu: true,&#xA;},&#xA;MMLorHTML: {&#xA;prefer: {&#xA;MSIE:    \&quot;MML\&quot;,&#xA;Firefox: \&quot;MML\&quot;,&#xA;Opera:   \&quot;HTML\&quot;,&#xA;other:   \&quot;HTML\&quot;&#xA;}&#xA;}&#xA;});&#xA;&#xA;&#xA;/*]]&amp;gt;*///--&amp;gt;&#xA;&amp;lt;/script&amp;gt;&quot;&#xA;      )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea how to get them running again? @Nick&lt;/p&gt;&#xA;" OwnerUserId="13452" LastEditorUserId="13452" LastEditDate="2018-02-04T20:46:21.563" LastActivityDate="2018-02-04T20:46:21.563" Title="siunitx, MathJax, org-mode and html export" Tags="|org-mode|html|mathjax|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31272" PostTypeId="1" CreationDate="2017-03-06T18:44:46.937" Score="8" ViewCount="505" Body="&lt;p&gt;Mac OSX has autocorrect for spelling that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Doesn't require pressing any buttons to make a retroactive change.&lt;/li&gt;&#xA;&lt;li&gt;Doesn't require manually inputting these corrections/abbrevs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6vbyN.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6vbyN.gif&quot; alt=&quot;wnat to want, tihs to this, plaese to please&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to get this same autocorrection in Emacs.  I know there is already &lt;a href=&quot;https://emacs.stackexchange.com/questions/2793/is-it-possible-to-auto-correct-spelling-on-space&quot;&gt;another thread on autocorrection&lt;/a&gt;, but here's the twist that makes this question different.  TextEdit does not actually do autocorrection itself: that part is done at the Mac OSX system level.  &lt;strong&gt;How can I get Emacs to use the OSX spell correction facility?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="14883" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-03-07T00:04:31.727" Title="How to get Emacs to use the Mac system-level spell correction capabilities?" Tags="|osx|spell-checking|" AnswerCount="0" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="31273" PostTypeId="2" ParentId="28631" CreationDate="2017-03-06T19:36:58.620" Score="1" Body="&lt;p&gt;Supposedly, this is a bug in MATLAB R2016b. A solution is to downgrade to R2016a!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I installed R2016b to find out that MATLAB crashes upon start up. What is strange however, is that I managed to run R2016b from Emacs once. My first thought was a bad configuration, but it kept crashing despite having cleared the config from &lt;code&gt;~/Library/Application\ Support/MathWorks/MATLAB/&lt;/code&gt; (which is the new configuration path for R2016b).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's difficult to point fingers from the stack trace (not knowing the source code), but around a &quot;Run Path Dependent Initialization&quot; is where mine crashes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have reported the segmentation fault to MathWorks (with a link to this question).&lt;/p&gt;&#xA;" OwnerUserId="15130" LastActivityDate="2017-03-06T19:36:58.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31274" PostTypeId="2" ParentId="31121" CreationDate="2017-03-06T22:36:48.417" Score="2" Body="&lt;p&gt;Installing fonts can be done in many different ways and needs to be done in different ways in different cases (depending on the underlying system, depending on whether you want it to be available globally or not).  You can probably come up with some ad-hoc code which tries to handle the most common cases, but it would probably be better to do it as a shell script than as an Elisp program (so that it can be reused elsewhere, since it's fundamentally unrelated to Emacs itself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think such a script/tool exists already, sadly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the best practice to deal with the problem, it likely depends on why you need to install a font, but I'd guess that the best practice is to arrange for your package not to depend on the presence of a particular font (e.g. just use standard and common Unicode chars and nothing more exotic).&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-06T22:36:48.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31276" PostTypeId="1" AcceptedAnswerId="31277" CreationDate="2017-03-06T23:03:05.793" Score="6" ViewCount="384" Body="&lt;p&gt;In &lt;code&gt;org-mode&lt;/code&gt;, when I cycle through the visibility of the document via the &lt;kbd&gt;TAB&lt;/kbd&gt; key (&lt;code&gt;org-cycle&lt;/code&gt;), the text sometimes gets repositioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is enough text below the headline such that it will not all fit within the window when it is expanded, Emacs will reposition the headline line (the line my cursor is currently on) to the top of the window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I make &lt;code&gt;org-cycle&lt;/code&gt; cycle through visibility, but &lt;em&gt;not&lt;/em&gt; move the text in the window?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="15134" LastEditorUserId="105" LastEditDate="2017-03-07T00:33:52.360" LastActivityDate="2023-06-07T02:03:05.410" Title="How to prevent org-mode from repositioning text in the window when cycling visibility?" Tags="|org-mode|scrolling|visibility|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31277" PostTypeId="2" ParentId="31276" CreationDate="2017-03-06T23:25:05.563" Score="3" Body="&lt;p&gt;The &lt;kbd&gt;TAB&lt;/kbd&gt; key runs the command &lt;code&gt;org-cycle&lt;/code&gt;, which does a&#xA;whole bunch of stuff under the hood.  In the context you're&#xA;talking about, &lt;code&gt;org-cycle&lt;/code&gt; cycles through the visibility of the&#xA;buffer, hiding and showing the entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short, &lt;code&gt;org-cycle&lt;/code&gt; runs &lt;code&gt;org-cycle-hook&lt;/code&gt;.  The first&#xA;part of the docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hook that is run after &lt;code&gt;org-cycle&lt;/code&gt; has changed the buffer visibility...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One of the functions in that hook,&#xA;&lt;code&gt;org-optimize-window-after-visibility-change&lt;/code&gt;, is responsible for&#xA;repositioning the text in the window.  To stop it from doing so,&#xA;add the following to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(remove-hook 'org-cycle-hook&#xA;             #'org-optimize-window-after-visibility-change)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-03-06T23:25:05.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31278" PostTypeId="2" ParentId="29142" CreationDate="2017-03-06T23:25:58.333" Score="6" Body="&lt;p&gt;Le Wang's &lt;a href=&quot;https://github.com/lewang/backup-walker&quot; rel=&quot;noreferrer&quot;&gt;backup-walker&lt;/a&gt; library facilitates this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;traverse incremental diffs between backup versions&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;open backup in traversal mode if the diff seems interesting&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;traverse backups&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Once a backup is opened, traversing amongst backups is easy using the same keys.&lt;/li&gt;&#xA;  &lt;li&gt;the point kept the same as much as possible while traversing backups as much as possible by parsing diff output on the fly.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;blame&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;find the version of backup where a line disappeared.&#xA;  Of course this works best if you have comprehensive backup history.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;cleanup&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;optionally kill all open backups when quiting&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-06T23:25:58.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31280" PostTypeId="2" ParentId="31271" CreationDate="2017-03-07T04:43:31.287" Score="5" Body="&lt;p&gt;You have to set the variable &lt;code&gt;org-html-mathjax-template&lt;/code&gt; appropriately. Assuming you are using the default configuration, loading mathjax from &lt;code&gt;cdn.mathjax.org&lt;/code&gt;, then the following setting (which loads the &lt;code&gt;mhchem&lt;/code&gt; extension, as well as the &lt;code&gt;siunitx&lt;/code&gt; extension, but also contains ancient cruft that might no longer be needed, or might even cause problems) works for me, but I would suggest you look at and save your current setting, before trying to reset it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; modify path and mathml&#xA;(setq org-html-mathjax-options&#xA;  '((path &quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;)&#xA;    (scale &quot;100&quot;)&#xA;    (align &quot;center&quot;)&#xA;    (indent &quot;2em&quot;)&#xA;    (mathml t)))&#xA;&#xA;(setq org-html-mathjax-template&#xA;              &quot;&#xA;&amp;lt;script type=\&quot;text/javascript\&quot; src=\&quot;%PATH\&quot;&amp;gt;&amp;lt;/script&amp;gt;&#xA;&amp;lt;script type=\&quot;text/javascript\&quot;&amp;gt;&#xA;&amp;lt;!--/*--&amp;gt;&amp;lt;![CDATA[/*&amp;gt;&amp;lt;!--*/&#xA;    MathJax.Hub.Config({&#xA;        jax: [\&quot;input/TeX\&quot;, \&quot;output/HTML-CSS\&quot;],&#xA;        extensions: [\&quot;tex2jax.js\&quot;,\&quot;TeX/AMSmath.js\&quot;,\&quot;TeX/AMSsymbols.js\&quot;,&#xA;                     \&quot;TeX/noUndefined.js\&quot;, \&quot;[Contrib]/siunitx/siunitx.js\&quot;, \&quot;[Contrib]/mhchem/mhchem.js\&quot;],&#xA;        tex2jax: {&#xA;            inlineMath: [ [\&quot;\\\\(\&quot;,\&quot;\\\\)\&quot;] ],&#xA;            displayMath: [ ['$$','$$'], [\&quot;\\\\[\&quot;,\&quot;\\\\]\&quot;], [\&quot;\\\\begin{displaymath}\&quot;,\&quot;\\\\end{displaymath}\&quot;] ],&#xA;            skipTags: [\&quot;script\&quot;,\&quot;noscript\&quot;,\&quot;style\&quot;,\&quot;textarea\&quot;,\&quot;pre\&quot;,\&quot;code\&quot;],&#xA;            ignoreClass: \&quot;tex2jax_ignore\&quot;,&#xA;            processEscapes: false,&#xA;            processEnvironments: true,&#xA;            preview: \&quot;TeX\&quot;&#xA;        },&#xA;        TeX: {extensions: [\&quot;AMSmath.js\&quot;,\&quot;AMSsymbols.js\&quot;,  \&quot;[Contrib]/siunitx/siunitx.js\&quot;, \&quot;[Contrib]/mhchem/mhchem.js\&quot;]},&#xA;        showProcessingMessages: true,&#xA;        displayAlign: \&quot;%ALIGN\&quot;,&#xA;        displayIndent: \&quot;%INDENT\&quot;,&#xA;&#xA;        \&quot;HTML-CSS\&quot;: {&#xA;             scale: %SCALE,&#xA;             availableFonts: [\&quot;STIX\&quot;,\&quot;TeX\&quot;],&#xA;             preferredFont: \&quot;TeX\&quot;,&#xA;             webFont: \&quot;TeX\&quot;,&#xA;             imageFont: \&quot;TeX\&quot;,&#xA;             showMathMenu: true,&#xA;        },&#xA;        MMLorHTML: {&#xA;             prefer: {&#xA;                 MSIE:    \&quot;MML\&quot;,&#xA;                 Firefox: \&quot;MML\&quot;,&#xA;                 Opera:   \&quot;HTML\&quot;,&#xA;                 other:   \&quot;HTML\&quot;&#xA;             }&#xA;        }&#xA;    });&#xA;/*]]&amp;gt;*///--&amp;gt;&#xA;&amp;lt;/script&amp;gt;&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The principal changes are the addition of the two extensions to the extensions field as well as to the TeX.extensions field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the value of &lt;code&gt;org-html-mathjax-template&lt;/code&gt; is a single long string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Just for completeness, the last piece that was missing is that the LaTeX code in the org file &lt;em&gt;has to be surrounded by math delimiters&lt;/em&gt; - that's what MathJax is looking for in order to process the LaTeX snippet(s). See the comments below for more details.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2017-03-08T03:04:17.150" LastActivityDate="2017-03-08T03:04:17.150" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="31281" PostTypeId="2" ParentId="2793" CreationDate="2017-03-07T04:45:03.860" Score="1" Body="&lt;p&gt;Late answer inspired by &lt;a href=&quot;https://emacs.stackexchange.com/questions/31272/how-to-autocorrect-spelling-like-in-scrivener&quot;&gt;another question about autocorrect&lt;/a&gt; and&#xA;&lt;a href=&quot;https://emacs.stackexchange.com/a/2794/253&quot;&gt;@legoscia's answer&lt;/a&gt;.  Here's a quick minor mode that will&#xA;autocorrect on the fly, using &lt;code&gt;flyspell&lt;/code&gt;.  It is, in&#xA;effect, &quot;global&quot; in that it advises &lt;code&gt;self-insert-command&lt;/code&gt;, but&#xA;only fires in buffers that have &lt;code&gt;flyspell-mode&lt;/code&gt; turned on.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun flyspell-ac-word (&amp;amp;optional arg)&#xA;  &quot;Autocorrect a word when entering a non-word character.&quot;&#xA;  (when flyspell-mode&#xA;    (unless (eq ?w (char-syntax (string-to-char (this-command-keys))))&#xA;      (when (or (bobp)&#xA;                (eq ?w (char-syntax (char-before))))&#xA;        (flyspell-auto-correct-word)))))&#xA;&#xA;(define-minor-mode flyspell-autocorrect-mode&#xA;  &quot;Toggle `flyspell-autocorrect-mode'.  Fires flyspell on a&#xA;just-completed word.  Only operates when `flyspell-mode' is on.&quot;&#xA;  :init-value nil&#xA;  :lighter (&quot; AC&quot;)&#xA;  (if flyspell-autocorrect-mode&#xA;      (progn &#xA;        (require 'flyspell)&#xA;        (advice-add #'self-insert-command :before #'flyspell-ac-word))&#xA;    (advice-remove #'self-insert-command #'flyspell-ac-word)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-03-07T16:14:14.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31282" PostTypeId="1" CreationDate="2017-03-07T05:54:26.013" Score="1" ViewCount="689" Body="&lt;p&gt;I have a python file which defines a function and calls it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def remove_whitespace(input_file, output_file):&#xA;    with open(input_file) as f:&#xA;        f.readlines()&#xA;        # do something&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I execute this file in Emacs (version 24.5.1), I recieve the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;UnicodeEncodeError: 'ascii' codec can't encode character '\u2013' in position 1798: ordinal not in range(128)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I followed the error message and found many known issues relating to encoding. I altered my function to try filtering out anything outside of the &lt;a href=&quot;http://www.asciitable.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ascii range 0-128&lt;/a&gt; (leaving standard-ish only characters). I got the same error messages. So python is unable to read the file in the first place it seems. I should've recognised that sooner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then used the &lt;code&gt;codecs&lt;/code&gt; module to open the file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import codecs&#xA;with codecs.open(my_file, encoding=&quot;utf-8&quot;) as f:&#xA;    # do something&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... but still received the same error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just out of curiousity, I exectued the file from terminal with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;python3 remove_whitespace.py&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which worked! No errors, the output file was as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked into elpy's congig with &lt;code&gt;M-x elpy-config&lt;/code&gt; and saw that the &lt;code&gt;shell-interpreter-arguments&lt;/code&gt; contains an additional &lt;code&gt;-i&lt;/code&gt; flag. This simply puts the shell into interactive mode after executing the script, so I assume cannot affect anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then preformed one last test - executing the file from an Emacs terminal: &lt;code&gt;eshell&lt;/code&gt;. This gave me the same error as before, which again points the blame to Emacs itself (and less so at elpy!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody shed light onto this Emacs/Elpy issue? Where is Emacs assuming/enforcing some encoding? I am not printing those non-ascii characters within my function, so didn't imagine Emacs even tries to interpret them itself. &lt;/p&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="9558" LastEditDate="2017-03-07T07:34:46.603" LastActivityDate="2017-03-08T19:10:45.683" Title="UnicodeEncodeError executing python in Emacs - not in Terminal" Tags="|python|character-encoding|elpy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31283" PostTypeId="2" ParentId="31282" CreationDate="2017-03-07T07:38:56.933" Score="3" Body="&lt;p&gt;A solution that I found over on Stackoverflow was the following &lt;a href=&quot;https://emacs.stackexchange.com/questions/3878/unicodedecodeerror-in-my-inferior-python-buffer?rq=1&quot;&gt;proposed here&lt;/a&gt; for a UnicodeDecodingError, which did work for me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;LANG&quot; &quot;en_US.UTF-8&quot;)&#xA;(setenv &quot;LC_ALL&quot; &quot;en_US.UTF-8&quot;)&#xA;(setenv &quot;LC_CTYPE&quot; &quot;en_US.UTF-8&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I only actually required the first of the three lines in my case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further suggestions specific to Python are in &lt;a href=&quot;https://stackoverflow.com/questions/14172576/why-unicodeencodeerror-raised-only-in-emacss-python-shell&quot;&gt;this post&lt;/a&gt;, namely to add this to your &lt;code&gt;.emacs&lt;/code&gt; init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setenv &quot;PYTHONIOENCODING&quot; &quot;utf-8&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9558" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-08T19:10:45.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31284" PostTypeId="1" CreationDate="2017-03-07T07:41:26.883" Score="3" ViewCount="1701" Body="&lt;p&gt;I never use the left control key, so I'd like to rebind it as Hyper, but ONLY inside Emacs. Is there a way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I'm running Emacs on a linux system. &lt;/p&gt;&#xA;" OwnerUserId="10276" LastEditorUserId="10276" LastEditDate="2017-03-08T05:53:38.997" LastActivityDate="2017-03-08T09:53:03.490" Title="How to have Emacs treat left Ctrl as Hyper?" Tags="|key-bindings|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31285" PostTypeId="1" CreationDate="2017-03-07T09:03:50.693" Score="1" ViewCount="544" Body="&lt;p&gt;When I open a file via tramp on a remote machine and then start a shell with &lt;code&gt;M-x shell&lt;/code&gt; I get an infinite loop because of my .cshrc file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use a newer gcc version in CentOS so I have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-csh prettyprint-override&quot;&gt;&lt;code&gt;set X=&quot;`gcc -dumpversion`&quot;&#xA;if ($x != &quot;4.8.2&quot;) then&#xA;  scl enable devtoolset-2 tcsh&#xA;endif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems that inside emacs the &lt;code&gt;gcc -dumpversion&lt;/code&gt; always gives 4.4.7 and the &lt;code&gt;scl enable&lt;/code&gt; is run an infinite number of times. (The &lt;code&gt;scl enable&lt;/code&gt; starts a new shell.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I ssh into this machine it starts fine with gcc 4.8.2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I have to use any settings to get the shell in emacs tramp to work?&lt;/p&gt;&#xA;" OwnerUserId="15139" LastEditorUserId="454" LastEditDate="2017-03-07T21:33:25.173" LastActivityDate="2018-07-01T14:31:25.607" Title="Remote shell (tramp) and login script" Tags="|shell|tramp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31286" PostTypeId="2" ParentId="31209" CreationDate="2017-03-07T09:06:45.470" Score="2" Body="&lt;p&gt;For the records, this has been discussed on the &lt;a href=&quot;https://debbugs.gnu.org/25963&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs bugtracker&lt;/a&gt;. It's not a Tramp error, but an unusual prompt from the remote machine.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-03-07T09:06:45.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31288" PostTypeId="1" AcceptedAnswerId="31292" CreationDate="2017-03-07T11:05:07.173" Score="2" ViewCount="95" Body="&lt;p&gt;I am working on literate programming in LaTeX.  Actually, I am coding a lot of &lt;code&gt;dtx&lt;/code&gt; files, which contain both the code and its documentation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When working in Emacs, it uses AUCTeX and switches into TeXDoc-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quite often, I have to insert docstrip options or tags, which look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%&amp;lt;*option&amp;gt;&#xA;...&#xA;%&amp;lt;/option&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(That is: a percent sign in the first column and than the tag which is enclosed in less/greater brackets &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt;.  The opening tag begins with a asteriks &lt;code&gt;*&lt;/code&gt;, the closing tag has a slash &lt;code&gt;/&lt;/code&gt;.  Of course, the name of the tag (here: option) has to be spelled identically.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to have some kind of Emacs function, which inserts this special kind of enviroment.  Using the classical &lt;code&gt;LaTeX-environment&lt;/code&gt; is not suited, as it inserts &lt;code&gt;\begin&lt;/code&gt; and '\end`, which is not what I need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't find a hint in the manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit: I had a &lt;a href=&quot;https://emacs.stackexchange.com/questions/31413/docstrip-support-in-auctex&quot;&gt;second question&lt;/a&gt; related to this theme.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="14190" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-03-12T20:54:45.253" Title="How to insert a docstrip tag environment in AUCTeX" Tags="|auctex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31289" PostTypeId="1" CreationDate="2017-03-07T11:53:43.800" Score="4" ViewCount="1202" Body="&lt;p&gt;In org agenda mode, pressing &lt;code&gt;t&lt;/code&gt; advances the TODO state of the item one step forward (to the next TODO keyword in order).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I add a binding to move the TODO state backwards by one step? I have a setup with several states, and advancing one step too far is very annoying as I have to toggle all states until I restore the previous state.&lt;/p&gt;&#xA;" OwnerUserId="12222" LastActivityDate="2017-03-07T17:54:53.933" Title="Org agenda - toggle TODO state backwards?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31290" PostTypeId="1" CreationDate="2017-03-07T12:19:54.477" Score="1" ViewCount="83" Body="&lt;p&gt;When I copy a word and paste it at the end of an existing sentence (between the last word and the full stop), I'd like it to be pasted in such a way that the space between the pasted word and the previously last word is automatically inserted.  Similarly, when I copy a word with spaces around the words, I'd like the spaces to be automatically removed if they are not necessary (i.e. if there would be too many).  Basically, I always want a properly formatted text without having to think about white spaces (similar to &lt;a href=&quot;https://github.com/jorgenschaefer/typoel&quot; rel=&quot;nofollow noreferrer&quot;&gt;typo-mode&lt;/a&gt;). Does something like this exist?  For context, I'm using evil but I suppose this would also be useful for users of plain Emacs.&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="105" LastEditDate="2017-03-07T16:09:07.210" LastActivityDate="2017-03-07T16:09:07.210" Title="Is there a way to get copy &amp; paste to be context-aware wrt whitespace and formatting?" Tags="|text-editing|copy-paste|formatting|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31292" PostTypeId="2" ParentId="31288" CreationDate="2017-03-07T13:59:57.750" Score="2" Body="&lt;p&gt;You could write your own function and hook it into &lt;code&gt;docTeX&lt;/code&gt; mode with a key binding, e.g. &lt;kbd&gt;C-c g&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun my/docTeX-guards ()&#xA;  (interactive)&#xA;  (let ((guard (TeX-read-string &quot;Guard: &quot;)))&#xA;    (LaTeX-newline)&#xA;    (unless (equal (char-before) ?%)&#xA;      (insert &quot;%&quot;))&#xA;    (insert (concat &quot;&amp;lt;*&quot; guard &quot;&amp;gt;&quot;))&#xA;    (newline)&#xA;    (save-excursion&#xA;      (newline)&#xA;      (insert (concat &quot;%&amp;lt;/&quot; guard &quot;&amp;gt;&quot;)))))&#xA;&#xA;(add-hook 'docTeX-mode-hook&#xA;           (lambda ()&#xA;           (define-key docTeX-mode-map &quot;\C-cg&quot;&#xA;                       #'my/docTeX-guards)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12242" LastEditorUserId="12242" LastEditDate="2017-03-07T15:43:00.077" LastActivityDate="2017-03-07T15:43:00.077" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31293" PostTypeId="1" CreationDate="2017-03-07T14:06:36.247" Score="4" ViewCount="119" Body="&lt;p&gt;I want to get a list of recently finished things out of org mode. &lt;code&gt;org-agenda&lt;/code&gt; and &lt;code&gt;org-agenda-sorting-strategy&lt;/code&gt; seem like the way to go, however none of the options (see &lt;code&gt;describe-variable&lt;/code&gt; on this) seem to be pay attention to org-clock. Clocking information is the only real time entry that a lot of the things I do have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to get a list of finished tasks ordered by when they were last clocked?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-agenda-log-mode&lt;/code&gt; is one approach, but this gives me duplicate entries.&lt;/p&gt;&#xA;" OwnerUserId="14161" LastActivityDate="2017-03-07T14:06:36.247" Title="Org agenda sort by clocked time" Tags="|org-agenda|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31294" PostTypeId="2" ParentId="28867" CreationDate="2017-03-07T14:55:22.420" Score="2" Body="&lt;p&gt;After (re)reading the code of the &lt;code&gt;shell&lt;/code&gt; function, here's what I'd do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(advice-add 'make-comint-in-buffer :around&#xA;            #'my-enable-auto-save-in-shell)&#xA;&#xA;(defun my-enable-auto-save-in-shell (origfun procname &amp;amp;rest args)&#xA;  (if (not (equal procname &quot;shell&quot;))&#xA;      (apply origfun procname args)   ;; Not a shell, nothing to do.&#xA;    ;; Enable auto-save-mode.&#xA;    (let ((default-directory auto-saves-dir)) (auto-save-mode))&#xA;    ;; Pass the auto-save file name to the subprocess.&#xA;    (let ((process-environment&#xA;           `(,(concat &quot;EMACS_AUTO_SAVE_FILE_NAME=&quot;&#xA;                      buffer-auto-save-file-name)&#xA;             . ,process-environment)))&#xA;      (apply origfun procname args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-07T14:55:22.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31295" PostTypeId="1" CreationDate="2017-03-07T16:09:49.597" Score="3" ViewCount="380" Body="&lt;p&gt;When I'm reviewing a patch series in magit I want to be able to look in detail at each patch in a tree. However there doesn't seem to be an easy way to navigate to the next/previous commit from inside magit-revision-mode. I end up having to switch back to log mode to select the next commit which is inefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does magit-revision-mode have any context for where in the log view it was when it was called?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2021-06-12T17:03:41.327" Title="How can I navigate up/down a log from magit-rev-mode?" Tags="|magit|navigation|" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31296" PostTypeId="2" ParentId="31289" CreationDate="2017-03-07T16:29:43.363" Score="5" Body="&lt;p&gt;&lt;code&gt;org-agenda-todo-previousset&lt;/code&gt; should do what you want by shifting the TODO state backwards.  From the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Switch TODO entry to previous sequence.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;By default it's bound to &lt;kbd&gt;C-S-left&lt;/kbd&gt;.  You can set it to a different binding with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(require 'org-agenda) (define-key org-agenda-mode-map &quot;y&quot; 'org-agenda-todo-previousset)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which would set &lt;kbd&gt;y&lt;/kbd&gt; to call the function (note &lt;kbd&gt;y&lt;/kbd&gt; is already bound to &lt;code&gt;org-agenda-year-view&lt;/code&gt; by default, you may want to choose another key).&lt;/p&gt;&#xA;" OwnerUserId="13358" LastActivityDate="2017-03-07T16:29:43.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31297" PostTypeId="2" ParentId="31295" CreationDate="2017-03-07T17:13:32.537" Score="7" Body="&lt;p&gt;That isn't supported yet but you can do it &quot;the other way around&quot;. Instead of pressing &lt;kbd&gt;RET&lt;/kbd&gt; to show &lt;em&gt;and select&lt;/em&gt; the revision buffer, press &lt;kbd&gt;SPC&lt;/kbd&gt; to show the revision buffer &lt;em&gt;but stay in the log buffer&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you move to another revision in the log buffer, the revision buffer is automatically updated. And you can press &lt;kbd&gt;SPC&lt;/kbd&gt; again to scroll the revision buffer, while staying in the log buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course some things are not possible when you stay in the log buffer, e.g. you cannot collapse any sections in the revision buffer from the log buffer. So yes, it would be nice to move to the next/previous revision while in the revision buffer. Please open a feature request for that.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-03-07T17:13:32.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31298" PostTypeId="2" ParentId="31289" CreationDate="2017-03-07T17:54:53.933" Score="6" Body="&lt;p&gt;You can also use &lt;code&gt;org-use-fast-todo-selection&lt;/code&gt; and define shortcut keys to your TODO states. Then when you hit &lt;code&gt;t&lt;/code&gt; in your agenda you'll be prompted for a second character to pick the specific TODO state you want. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe fast selection is enabled by default, so you may just need to tweak the definition of your TODO states. See &lt;a href=&quot;http://orgmode.org/manual/Fast-access-to-TODO-states.html#Fast-access-to-TODO-states&quot; rel=&quot;noreferrer&quot;&gt;Fast access to TODO states&lt;/a&gt; in the org manual for more -- you can either configure your &lt;code&gt;org-todo-states&lt;/code&gt; globally or use the in-buffer &lt;code&gt;#TODO&lt;/code&gt; setting,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the default bindings, that would allow you to use &lt;code&gt;t&lt;/code&gt; followed by another key to jump to a specific state; or you can use &lt;code&gt;C-S-left&lt;/code&gt; and &lt;code&gt;C-S-right&lt;/code&gt; to switch states according to the defined sequence. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-07T17:54:53.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31299" PostTypeId="1" CreationDate="2017-03-07T18:42:46.597" Score="0" ViewCount="57" Body="&lt;p&gt;If I'm typing along in org mode, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This is a sentence|. It is followed by another sentence on the same line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And point is indicated by the &lt;code&gt;|&lt;/code&gt;, and I hit &lt;code&gt;C-e&lt;/code&gt;, I get a perfectly normal result -- I jump to the end of the sentence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But! Now imagine I'm using org markup tags with a tool like &lt;code&gt;smartparens&lt;/code&gt; that inserts pairs. I'm here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I'm going to type a *bold|*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Press &lt;code&gt;C-e&lt;/code&gt;; I want to wind up on the other side of the second asterisk. Instead, I wind up here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I'm going to type a *bold*&#xA;|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All the way on the next line. Now I have to move point a line up and &lt;code&gt;C-e&lt;/code&gt; again, which jumps me to where I want to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone familiar enough with &lt;code&gt;org-end-of-line&lt;/code&gt; to know if this is intended? My current approach is to try and concoct an advice for &lt;code&gt;org-end-of-line&lt;/code&gt; to make it go to end of line properly, but I'm not sure it's the right solution. Suggestions?&lt;/p&gt;&#xA;" OwnerUserId="10319" LastActivityDate="2017-03-07T18:42:46.597" Title="Modifying `org-end-of-line` within markup tags" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31300" PostTypeId="1" CreationDate="2017-03-07T18:54:56.997" Score="7" ViewCount="1165" Body="&lt;p&gt;I currently use the following to enable &lt;code&gt;flyspell&lt;/code&gt; in &lt;code&gt;prog-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook 'flyspell-prog-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This checks spelling automatically in comments and strings. However, I would like to disable spell checking in strings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I enable &lt;code&gt;flyspell&lt;/code&gt; for comments but not strings?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="12866" LastEditorUserId="253" LastEditDate="2017-03-07T19:15:28.313" LastActivityDate="2017-03-07T19:15:28.313" Title="Can you turn on flyspell for comments but NOT strings?" Tags="|flyspell|spell-checking|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31301" PostTypeId="1" AcceptedAnswerId="31617" CreationDate="2017-03-07T19:11:34.290" Score="0" ViewCount="153" Body="&lt;p&gt;EDIT: I closed and reopened Emacs again and the same behavior happened. But this time the text inserted was from my last kill or &lt;code&gt;M-w&lt;/code&gt;—&lt;code&gt;(add-hook 'before-save-hook 'time-stamp)&lt;/code&gt;—to copy it to the system clipboard for the purposes of writing the last lines of my question. So it appears to be more a Mac OS X copy-paste thing than a problem with &lt;code&gt;org-special-edit&lt;/code&gt;. Still annoying and any help would be appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ORIGINAL QUESTION: This might be something of a longshot. I am using Emacs 25.0.95 with Org 8.2.10 on OS X Yosemite. I have my init file in an &lt;code&gt;.org&lt;/code&gt; file. Lately I have begun to find the contents of org source buffers (the ones that you open at point with &lt;code&gt;C-c '&lt;/code&gt; and save and exit with &lt;code&gt;C-c '&lt;/code&gt;) make their way into another location in the original org buffer. Just now it happened after making a few edits to my configuration of &lt;code&gt;zenburn-theme&lt;/code&gt;. I hit &lt;code&gt;C-c '&lt;/code&gt; for &lt;code&gt;org-edit-special&lt;/code&gt;, set up &lt;code&gt;zenburn-theme&lt;/code&gt; how I wanted it, and hit &lt;code&gt;C-c '&lt;/code&gt; again. Then I closed Emacs to reload the init and completely refresh the way the was theme displaying. So I started Emacs up again, and it loads everything OK; yet when I opened my init file again, I find that the file has been somehow edited—in fact, the text I saved with &lt;code&gt;org-edit-special&lt;/code&gt; has inserted itself towards the top of my init file. So where originally I had this—&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle yes&#xA;  ;; set up 'package&#xA;  (require 'package)&#xA;  (setq package-enable-at-startup nil)&#xA;  (add-to-list 'package-archives&#xA;                '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;) t)&#xA;  (add-to-list 'package-archives&#xA;                '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;  (package-initialize)&#xA;&#xA;  ;; bootstrap 'use-package&#xA;  (unless (package-installed-p 'use-package)&#xA;    (package-refresh-contents)&#xA;    (package-install 'use-package))&#xA;  (eval-when-compile&#xA;    (require 'use-package))&#xA;  ;; load 'use-package dependencies: 'bind-key and 'diminish&#xA;  (require 'bind-key)                     ; (bundled with `use-package')&#xA;  (use-package diminish&#xA;    :ensure t)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;—the contents of my last &lt;code&gt;org-edit-special&lt;/code&gt; buffer (from last session)—&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package zenburn-theme&#xA;  :ensure t&#xA;  :config&#xA;  ;; customize zenburn faces (http://emacs.stackexchange.com/a/17962)&#xA;  (zenburn-with-color-variables&#xA;    (custom-theme-set-faces&#xA;     'zenburn&#xA;     ;; change some org-mode faces to make org-blocks more legible à la leuven-theme&#xA;     ;; (https://github.com/bbatsov/zenburn-emacs/pull/175/commits/0c27021b8708464236b78a40546971279d5ae404)&#xA;     `(org-block                   ((t (:foreground ,zenburn-fg :background ,zenburn-bg+1))))&#xA;     `(org-block-background        ((t (:background ,zenburn-bg+1))))&#xA;     `(org-block-begin-line        ((t (:foreground ,zenburn-fg :background ,zenburn-bg+05 :underline ,zenburn-bg))))&#xA;     `(org-block-end-line          ((t (:foreground ,zenburn-fg :background ,zenburn-bg+05 :overline ,zenburn-bg))))))&#xA;  (load-theme 'zenburn t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;—have been yanked or pasted somehow such that I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :tangle yes&#xA;  ;; set up 'package&#xA;  (requir(use-package zenburn-theme&#xA;    :ensure t&#xA;    :config&#xA;    ;; customize zenburn faces (http://emacs.stackexchange.com/a/17962)&#xA;    (zenburn-with-color-variables&#xA;      (custom-theme-set-faces&#xA;       'zenburn&#xA;       ;; change some org-mode faces to make org-blocks more legible à la leuven-theme&#xA;;; (https://github.com/bbatsov/zenburn-emacs/pull/175/commits/0c27021b8708464236b78a40546971279d5ae404)&#xA;       `(org-block                   ((t (:foreground ,zenburn-fg :background ,zenburn-bg+1))))&#xA;       `(org-block-background        ((t (:background ,zenburn-bg+1))))&#xA;       `(org-block-begin-line        ((t (:foreground ,zenburn-fg :background ,zenburn-bg+05 :underline ,zenburn-bg))))&#xA;       `(org-block-end-line          ((t (:foreground ,zenburn-fg :background ,zenburn-bg+05 :overline ,zenburn-bg))))))&#xA;       (load-theme 'zenburn t))e 'package)&#xA;  (setq package-enable-at-startup nil)&#xA;  (add-to-list 'package-archives&#xA;                '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;) t)&#xA;  (add-to-list 'package-archives&#xA;                '(&quot;melpa&quot; . &quot;http://melpa.org/packages/&quot;) t)&#xA;  (package-initialize)&#xA;&#xA;  ;; bootstrap 'use-package&#xA;  (unless (package-installed-p 'use-package)&#xA;    (package-refresh-contents)&#xA;    (package-install 'use-package))&#xA;  (eval-when-compile&#xA;    (require 'use-package))&#xA;  ;; load 'use-package dependencies: 'bind-key and 'diminish&#xA;  (require 'bind-key)                     ; (bundled with `use-package')&#xA;  (use-package diminish&#xA;    :ensure t)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words, unless I am mistaken, the text saved with &lt;code&gt;org-edit-special&lt;/code&gt; from an earlier session has survived into a new Emacs session and yanked itself into my buffer without my doing anything. It's annoying because, unless I am vigilant, my init will be broken next time I launch Emacs. Does this have something to do with org-mode or is a kill-ring problem? or does it have something to do with how the file is saving? (I have &lt;code&gt;(add-hook 'before-save-hook 'time-stamp)&lt;/code&gt; in my init in order to automatically update the date in the &lt;code&gt;Time-stamp: &amp;lt;&amp;gt;&lt;/code&gt; format.)&lt;/p&gt;&#xA;" OwnerUserId="12311" LastEditorUserId="12311" LastEditDate="2017-03-07T19:38:14.407" LastActivityDate="2017-03-21T20:22:03.860" Title="Accidental yank or paste into org buffer" Tags="|org-mode|osx|copy-paste|yank|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31302" PostTypeId="2" ParentId="31300" CreationDate="2017-03-07T19:14:52.300" Score="10" Body="&lt;p&gt;Here's a quick trip down the &lt;code&gt;flyspell&lt;/code&gt; source code rabbit hole. (Try &lt;code&gt;C-h l flyspell&lt;/code&gt; to get to it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;flyspell-prog-mode&lt;/code&gt; uses &lt;code&gt;flyspell-generic-progmode-verify&lt;/code&gt;.&#xA;That function uses text properities to decide whether or not to fire&#xA;based on whether or not the text property of the previous character&#xA;is a member of &lt;code&gt;flyspell-prog-text-faces&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the &lt;code&gt;flyspell-prog-text-faces&lt;/code&gt; docstring tells me that, by&#xA; default:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;flyspell-prog-text-faces&lt;/code&gt; is a variable defined in &lt;code&gt;flyspell.el&lt;/code&gt;.&#xA;  Its value is &lt;code&gt;(font-lock-string-face font-lock-comment-face font-lock-doc-face)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Faces corresponding to text in programming-mode buffers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So we can just remove &lt;code&gt;font-lock-string-face&lt;/code&gt; from this list:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq flyspell-prog-text-faces&#xA;      (delq 'font-lock-string-face&#xA;            flyspell-prog-text-faces))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Et voila.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-03-07T19:14:52.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31303" PostTypeId="2" ParentId="31300" CreationDate="2017-03-07T19:15:09.360" Score="1" Body="&lt;p&gt;You can specify what flyspell-prog considers &quot;text to be spelled&quot; by customizing the &lt;code&gt;flyspell-prog-text-faces&lt;/code&gt; variable:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; original value: '(font-lock-string-face font-lock-comment-face font-lock-doc-face)&#xA;(setq flyspell-prog-text-faces '(font-lock-comment-face font-lock-doc-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2017-03-07T19:15:09.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31304" PostTypeId="1" CreationDate="2017-03-07T21:12:42.743" Score="2" ViewCount="147" Body="&lt;p&gt;I want to enforce only one GUI instance for Emacs, so I want to check if at least one GUI frame is open or not (i.e. the frame that is open with &lt;code&gt;emacsclient -c&lt;/code&gt;), and ignore the ones opened in Terminal. How do I do that? I already tried &lt;code&gt;visible-frame-list&lt;/code&gt; function but this seems to count all frames.&lt;/p&gt;&#xA;" OwnerUserId="8937" LastActivityDate="2017-03-28T19:29:22.287" Title="Count only frame opened outside of terminal?" Tags="|frames|emacsclient|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31305" PostTypeId="2" ParentId="14282" CreationDate="2017-03-07T21:59:12.333" Score="22" Body="&lt;p&gt;There's also a package on MELPA for this now: dashboard: &lt;a href=&quot;https://github.com/rakanalh/emacs-dashboard&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/rakanalh/emacs-dashboard&lt;/a&gt;. The package allows you to have a splash screen as in the image below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jYBAm.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jYBAm.png&quot; alt=&quot;dashboard screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the &lt;code&gt;use-package&lt;/code&gt; snippet from my config to set it up with a custom banner image and line of text, as well as a list of recent files and bookmarks:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package dashboard&#xA;    :ensure t&#xA;    :diminish dashboard-mode&#xA;    :config&#xA;    (setq dashboard-banner-logo-title &quot;your custom text&quot;)&#xA;    (setq dashboard-startup-banner &quot;/path/to/image&quot;)&#xA;    (setq dashboard-items '((recents  . 10)&#xA;                            (bookmarks . 10)))&#xA;    (dashboard-setup-startup-hook))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12311" LastEditorUserId="12311" LastEditDate="2017-03-08T02:35:26.100" LastActivityDate="2017-03-08T02:35:26.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31306" PostTypeId="2" ParentId="12173" CreationDate="2017-03-07T23:05:18.537" Score="1" Body="&lt;p&gt;This is in addition to &lt;a href=&quot;https://emacs.stackexchange.com/users/50/malabarba&quot;&gt;Malabarba's&lt;/a&gt; &lt;a href=&quot;https://emacs.stackexchange.com/a/12217/15021&quot;&gt;answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had this same issue.  I realized that the indent-tabs-mode value was being persisted in each buffer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have the problem and can't resolve it, make sure to regenerate your buffers (kill buffer and re-open files).  I am new to emacs, so there probably is a better solution, but this worked for me.&lt;/p&gt;&#xA;" OwnerUserId="15021" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-03-07T23:05:18.537" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31307" PostTypeId="1" CreationDate="2017-03-07T23:14:03.080" Score="1" ViewCount="424" Body="&lt;p&gt;I'm trying to learn how to use the noweb syntax and advance my knowledge on the possibilities of org babel. For that, I'm trying to get the following an example to work that 1. uses noweb syntax and 2. calls the tangled function later on in the code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# This is the function that needs to be tangled&#xA;#+NAME: fast-multiplication&#xA;#+BEGIN_SRC scheme :noweb yes :var a=1 :var b=1&#xA;(define (fast-multiplication a b)&#xA;&amp;lt;&amp;lt;double&amp;gt;&amp;gt;&#xA;&amp;lt;&amp;lt;halve&amp;gt;&amp;gt;&#xA;(cond ((= b 0) 0)&#xA;      ((even? b) (fast-multiplication (double a) (halve b)))&#xA;      (else (+ a (fast-multiplication a (- b 1))))))&#xA;#+END_SRC&#xA;&#xA;Now, we'll need procedures for doubling and halving. We can write them down here:&#xA;&#xA;#+NAME: double&#xA;#+BEGIN_SRC scheme&#xA;(define (double a)&#xA;  (+ a a))&#xA;#+END_SRC &#xA;&#xA;#+NAME: halve&#xA;#+BEGIN_SRC scheme&#xA;(define (halve a)&#xA;  (/ a 2))&#xA;#+END_SRC &#xA;&#xA;# I couldn't find examples in the documentation to check my syntax.&#xA;# I think this line here is wrong..&#xA;#+call: fast-multiplication(a=5,b=7)&#xA;&#xA;#+RESULTS:&#xA;: &quot;An error occurred.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I get an error, which I think comes from the way I'm calling the function? Everything works fine if I try it directly on the REPL.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-03-07T23:14:03.080" Title="How can I use #+CALL with multiple arguments?" Tags="|org-mode|org-babel|noweb|" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31308" PostTypeId="2" ParentId="31284" CreationDate="2017-03-07T23:24:38.443" Score="2" Body="&lt;p&gt;If you are on a Mac you can try adding the following to your init.el&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq mac-control-modifier 'hyper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I believe &lt;code&gt;(setq ns-control-modifier 'hyper)&lt;/code&gt; would be the general solution for other OSes, I wouldn't know it, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To change the right control key you'd similarly use &lt;code&gt;(setq mac-right-control-modifier 'hyper)&lt;/code&gt;. To control the behaviour of other &quot;meta&quot; keys change &lt;code&gt;control&lt;/code&gt; for either &lt;code&gt;option&lt;/code&gt;, &lt;code&gt;command&lt;/code&gt; or &lt;code&gt;function&lt;/code&gt;, e.g., &lt;code&gt;mac-command-modifier&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-03-07T23:24:38.443" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31309" PostTypeId="1" AcceptedAnswerId="31310" CreationDate="2017-03-08T03:08:00.870" Score="0" ViewCount="93" Body="&lt;p&gt;To avoid conflicts with highlighting indentation, I made the highlight line begin after the current indentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works well, except when tabs are used as leading white space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could the &lt;code&gt;my-hl-line-range-function&lt;/code&gt; calculate offsets taking tabs into account?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-hl-line-mode 1)&#xA;&#xA;;; don't draw over indentation (annoying/distracting with indent guides)&#xA;(defun my-hl-line-range-function ()&#xA;  (cons&#xA;   ;; (point)  ;; works nice too, cursor instead of indentation&#xA;   (+ (line-beginning-position 1) (current-indentation))&#xA;   (line-beginning-position 2)))&#xA;(setq hl-line-range-function #'my-hl-line-range-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="105" LastEditDate="2017-03-08T04:02:31.687" LastActivityDate="2017-03-08T04:49:23.573" Title="How to account for tabs in `hl-line-range-function`?" Tags="|whitespace|highlighting|tabs|hl-line-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31310" PostTypeId="2" ParentId="31309" CreationDate="2017-03-08T04:49:23.573" Score="1" Body="&lt;p&gt;How 'bout&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-hl-line-range-function ()&#xA;  (cons&#xA;   ;; (point)  ;; works nice too, cursor instead of indentation&#xA;   (save-excursion (back-to-indentation) (point))&#xA;   (line-beginning-position 2)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-08T04:49:23.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31311" PostTypeId="1" AcceptedAnswerId="31312" CreationDate="2017-03-08T05:22:54.153" Score="0" ViewCount="688" Body="&lt;p&gt;Using C/C++ (cc-mode), emacs sometimes re-indents text as I'm typing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example (# for indentation, the first 4 are a tab):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;enum {&#xA;####/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Typing &lt;code&gt;*&lt;/code&gt;, becomes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;enum {&#xA;######/*&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(inserting 2 extra spaces)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Is there a way to disable this?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-03-08T09:49:57.777" LastActivityDate="2017-03-08T09:51:32.510" Title="How to stop emacs re-indenting while typing? (cc-mode)" Tags="|indentation|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31312" PostTypeId="2" ParentId="31311" CreationDate="2017-03-08T05:47:49.667" Score="1" Body="&lt;p&gt;It turns out &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html%5Fnode/emacs/Electric-C.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;electric-mode&lt;/a&gt; causes re-indentation, it can be disabled:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable, add this to your startup.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;An alternative is to disable re-indenting just for comment characters (since its handy to keep for braces).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Prefer no indentation for comment chars.&#xA;(define-key c-mode-base-map &quot;/&quot; 'self-insert-command)&#xA;(define-key c-mode-base-map &quot;*&quot; 'self-insert-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-03-08T09:51:32.510" LastActivityDate="2017-03-08T09:51:32.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31313" PostTypeId="2" ParentId="31285" CreationDate="2017-03-08T08:42:07.563" Score="1" Body="&lt;p&gt;I'm not sure that your setup will work. You use &lt;code&gt;csh&lt;/code&gt;, but Tramp supports only POSIX-like shells. Settings like &lt;code&gt;$PATH&lt;/code&gt;, you might have in your &lt;code&gt;.login&lt;/code&gt; or &lt;code&gt;.cshrc&lt;/code&gt;, won't be applied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you play with &lt;code&gt;tramp-remote-path&lt;/code&gt; and alike, in order to get better results.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-03-08T08:42:07.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31314" PostTypeId="2" ParentId="30073" CreationDate="2017-03-08T08:51:23.260" Score="1" Body="&lt;p&gt;As suggested by Tarsius. A simple gerrit-push-review does the trick. For this answer I believe that is pretty important to understand &lt;a href=&quot;https://emacs.stackexchange.com/questions/22557/add-change-to-a-previous-commit-with-magit&quot;&gt;this&lt;/a&gt; answer as well&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's supose that we have something like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Head:     master add important line&#xA;Merge:    origin/master little nonsense&#xA;&#xA;Reviews (1)&#xA;25249     add important line                                                                                                               Antonio Querol&#xA;&#xA;Unmerged into origin/master (1)&#xA;5c960ac master add important line&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the reviewer told me that I need to add a paths set to this line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;modified   presentation-text/Entornos-y-despliegues.org&#xA;@@ -509,6 +509,7 @@ Help IT with this things and the deployment will be never like today&#xA; * vamos a ver si esto funciona&#xA; * creo el patch set y un peque√±o cambio =&amp;gt; mira como si pongo un cambio&#xA; * a√±ado una peque√±a tonteria&#xA;+* Let's add this a very important line&#xA; * Q &amp;amp; A&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since is the alst commit I made the shanges in the code and then ammend it, like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stage the changes and then over the changes press c and then a to ammend the last commit. Edit what you want, the message of the commit or type C-c C-c to finish it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then over the commit push R and P so now in gerrit you can see the path for the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Antonio Querol&#xA;Uploaded patch set 1.&#xA;9:40 AM&#xA;Antonio Querol&#xA;Uploaded patch set 2.&#xA;9:48 AM&#xA;Powered by Gerrit Code Review (2.10-rc1) | Report Bug | Press '?' to view keyboard shortcuts&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this helps&lt;/p&gt;&#xA;" OwnerUserId="8892" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-03-08T08:51:23.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31315" PostTypeId="1" AcceptedAnswerId="31319" CreationDate="2017-03-08T09:15:44.150" Score="0" ViewCount="648" Body="&lt;p&gt;I have a setup where I use EDE from CEDET for C projects development (among other things) and the real good flycheck on-the-fly syntax checking. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have defined ede-cpp-root-project in my .emacs file for several projects where I have set project include-path variable to include the whole set of my project includes for each project. This works splendidly; auto-complete works and the all the includes are found by the semantic package for every project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now the question is how to set up this same include path for flycheck without heavy duplication?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I'm using gcc with flycheck, although I guess it doesn't make too much difference compare to clang.&lt;/p&gt;&#xA;" OwnerUserId="13558" LastEditorUserId="13558" LastEditDate="2017-03-08T12:39:44.383" LastActivityDate="2017-03-09T13:01:03.503" Title="flycheck include path from ede" Tags="|flycheck|c|cedet|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31316" PostTypeId="2" ParentId="31284" CreationDate="2017-03-08T09:53:03.490" Score="3" Body="&lt;p&gt;You'll be able to change what the control modifier is mapped to &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24822&quot; rel=&quot;nofollow noreferrer&quot;&gt;in the upcoming major Emacs release&lt;/a&gt;.  While this isn't as fine-grained as it could be to remap only one of both control modifiers, it allows remapping them to hyper in Emacs only:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-ctrl-keysym 'hyper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Feel free to open a bug report for individual modifier remappings.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-03-08T09:53:03.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31318" PostTypeId="1" AcceptedAnswerId="31325" CreationDate="2017-03-08T12:38:53.390" Score="2" ViewCount="610" Body="&lt;p&gt;I'm trying to print the path of $HISTFILE in emacs, but it doesn't work with &lt;code&gt;(getenv &quot;HISTFILE&quot;)&lt;/code&gt; or &lt;code&gt;(shell-command-to-string &quot;echo $HISTFILE&quot;)&lt;/code&gt;. It is working with $PATH and every other variable I've tried.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2017-03-08T18:28:43.003" Title="how to print $HISTFILE?" Tags="|shell|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31319" PostTypeId="2" ParentId="31315" CreationDate="2017-03-08T14:24:11.657" Score="0" Body="&lt;p&gt;Found an answer at: &lt;a href=&quot;https://ogbe.net/emacsconfig.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ogbe.net/emacsconfig.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Copy-paste from the page:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Projects&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In some projects, flycheck needs some information about the projects include path. Since we want to use EDE for C and C++ projects anyways, we can grab the include path from there.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ede)&#xA;(global-ede-mode t)&#xA;(require 'flycheck-cedet)&#xA;&#xA;(defun dennis-flycheck-get-ede-includes ()&#xA; (interactive)&#xA; &quot;Check if the current file is part of an EDE project.&#xA;  If yes, set up `flycheck-clang-include-path'&quot;&#xA; (make-variable-buffer-local 'flycheck-clang-include-path)&#xA; (let* ((rel-includes&#xA;          (flycheck-cedet-get-cpp-includes &quot;&quot; (buffer-file-name)))&#xA;         (dirname (when rel-includes&#xA;                    (ede-cpp-root-project-root default-directory))))&#xA;    (when rel-includes&#xA;      (when (string-match &quot;\\(.*\\)/$&quot; dirname)&#xA;        (setq dirname (substring dirname (match-beginning 1) (match-end 1))))&#xA;      (setq incl-paths&#xA;            (mapcar '(lambda (arg) (concat dirname arg))&#xA;                    rel-includes))&#xA;      (setq flycheck-clang-include-path&#xA;            (append flycheck-clang-include-path incl-paths)))))&#xA;&#xA;(add-hook 'c-mode-common-hook 'dennis-flycheck-get-ede-includes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We can now list our current EDE projects. This is not being exported.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This one is referencing flycheck-cedet. It can be found here:&#xA;&lt;a href=&quot;https://github.com/dholm/flycheck-cedet&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/dholm/flycheck-cedet&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13558" LastActivityDate="2017-03-08T14:24:11.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31320" PostTypeId="1" AcceptedAnswerId="31321" CreationDate="2017-03-08T14:54:43.180" Score="9" ViewCount="837" Body="&lt;p&gt;When searching for a string with &lt;code&gt;C-s&lt;/code&gt;, I want to be able to hit some key to exit search mode &lt;em&gt;but still maintain the selection of the match.&lt;/em&gt; That way I can immediately start typing and replace the last match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say I have the following document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The quick brown fox jumps over the lazy dog.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I search for &quot;lazy&quot;, emacs will select that word like so (square brackets are selection, pipe is cursor):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The quick brown fox jumps over the [lazy|] dog.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, if I press &lt;kbd&gt;return&lt;/kbd&gt;, emacs will maintain my cursor position, but it will deselect &quot;lazy&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The quick brown fox jumps over the lazy| dog.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of this, I want a shortcut that will exit search mode but maintain the current match selection, like in the second state above.&lt;/p&gt;&#xA;" OwnerUserId="12866" LastEditorUserId="105" LastEditDate="2017-03-08T17:16:25.657" LastActivityDate="2017-11-09T08:55:15.620" Title="Selecting (i.e., as the region) the current match in incremental search" Tags="|search|region|isearch|selection|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31321" PostTypeId="2" ParentId="31320" CreationDate="2017-03-08T15:58:16.207" Score="7" Body="&lt;p&gt;Here's one approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun isearch-exit-mark-match ()&#xA;  &quot;Exit isearch and mark the current match.&quot;&#xA;  (interactive)&#xA;  (isearch-exit)&#xA;  (push-mark isearch-other-end)&#xA;  (activate-mark))&#xA;&#xA;(define-key isearch-mode-map (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) #'isearch-exit-mark-match)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This binds a different key (C-return) to exit the current isearch and also leave the last match selected. This will work with &lt;code&gt;isearch-forward-regexp&lt;/code&gt; as well, which is handy.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-10T14:20:22.193" LastActivityDate="2017-03-10T14:20:22.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31322" PostTypeId="2" ParentId="31320" CreationDate="2017-03-08T16:39:14.123" Score="4" Body="&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Isearch+&lt;/a&gt; lets you &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus#isearchp-set-region-flag&quot; rel=&quot;nofollow noreferrer&quot;&gt;do that easily&lt;/a&gt;, and even toggle it on/off on the fly.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Non-nil option &lt;strong&gt;&lt;code&gt;isearchp-set-region-flag&lt;/code&gt;&lt;/strong&gt; automatically sets the region (selection) around the last search target when you quit isearch.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Command &lt;code&gt;isearchp-toggle-set-region&lt;/code&gt;, bound to &lt;strong&gt;&lt;code&gt;M-s M-SPC&lt;/code&gt;&lt;/strong&gt; during isearch toggles option &lt;code&gt;isearchp-set-region-flag&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Command &lt;strong&gt;&lt;code&gt;set-region-around-search-target&lt;/code&gt;&lt;/strong&gt; manually sets the region around the last search target. (So even if the option is not set, so you don't get automatic selection, you can do it manually.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Library &lt;a href=&quot;https://www.emacswiki.org/emacs/ReplacePlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Replace+&lt;/a&gt; lets you &lt;a href=&quot;https://www.emacswiki.org/emacs/ReplacePlus#set-region-around-search-target&quot; rel=&quot;nofollow noreferrer&quot;&gt;do the same thing&lt;/a&gt; for &lt;code&gt;query-replace&lt;/code&gt; etc.  It puts the region around (i.e., selects) the last replacement occurrence. It uses the same option, &lt;code&gt;isearchp-set-region-flag&lt;/code&gt;, to control this, and command &lt;code&gt;set-region-around-search-target&lt;/code&gt; has the same effect.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-03-08T16:44:55.973" LastActivityDate="2017-03-08T16:44:55.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31323" PostTypeId="2" ParentId="31259" CreationDate="2017-03-08T17:32:24.410" Score="1" Body="&lt;p&gt;You can just &lt;code&gt;rename-buffer&lt;/code&gt; and create a new playlist. EMMS functions keep a list of playlist buffers internally. You can see this list at any time by calling &lt;code&gt;(emms-playlist-buffer-list)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The playlist/buffer that's being &quot;currently&quot; playing is pointed by &lt;code&gt;emms-playlist-buffer&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I thought that &quot;the current playlist-buffer&quot; was updated automagically, but that doesn't seem to be your case. You can use &lt;strong&gt;&lt;code&gt;(emms-playlist-set-playlist-buffer)&lt;/code&gt;&lt;/strong&gt; to choose the buffer used as &quot;current playlist&quot;&lt;/p&gt;&#xA;" OwnerUserId="10785" LastEditorUserId="10785" LastEditDate="2017-03-09T15:02:18.557" LastActivityDate="2017-03-09T15:02:18.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31324" PostTypeId="1" AcceptedAnswerId="31339" CreationDate="2017-03-08T18:20:57.303" Score="1" ViewCount="246" Body="&lt;p&gt;My &lt;code&gt;default-directory&lt;/code&gt; is:  &lt;code&gt;/ssh:lawlist@12.34.567.89#2222:/home3/lawlist&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;code&gt;.authinfo&lt;/code&gt; file contains:  &lt;code&gt;machine 12.34.567.89 login lawlist password abcdefg&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above-combination works just fine.  However, I would like to remove &lt;code&gt;#2222&lt;/code&gt; from the &lt;code&gt;default-directory&lt;/code&gt; and add &lt;code&gt;port 2222&lt;/code&gt; to my &lt;code&gt;.authinfo&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remove &lt;code&gt;#2222&lt;/code&gt; from the &lt;code&gt;default-directory&lt;/code&gt; and add &lt;code&gt;port 2222&lt;/code&gt; to my &lt;code&gt;.authinfo&lt;/code&gt; file, neither Eshell nor Dired permit me to login to the remote server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eshell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Waiting for prompts from remote shell ...&#xA;Timeout reached, see buffer `*tramp/ssh lawlist@12.34.567.89*` for details.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  How can I remove &lt;code&gt;#2222&lt;/code&gt; from my &lt;code&gt;default-directory&lt;/code&gt; and force Eshell and/or Dired to extract &lt;code&gt;port 2222&lt;/code&gt; from my &lt;code&gt;.authinfo&lt;/code&gt; file?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:  The following is rough draft to add this new feature.  A maintainer of Tramp, @Michael Albinus, has suggested that this may break other aspects of Tramp and he has invited a discussion on tramp-devel@gnu.org regarding this issue.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Ensure you are using a version of Emacs containing the December 17, 2015 bug fix to &lt;code&gt;auth-source-ensure-strings&lt;/code&gt; that was resolved by commit 9384953:  &lt;a href=&quot;https://github.com/jwiegley/emacs/commit/938495317a02b06a6c512832d0c6d9530fcd7f2b&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jwiegley/emacs/commit/938495317a02b06a6c512832d0c6d9530fcd7f2b&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Define the following function:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun get-auth-info (host user &amp;amp;optional port)&#xA;  (let ((info (nth 0 (auth-source-search&#xA;                      :host host&#xA;                      :user user&#xA;                      :port port&#xA;                      :require '(:user :secret)&#xA;                      :create t))))&#xA;    (if info&#xA;       (let* ((port (plist-get info :port))&#xA;              (secret-maybe (plist-get info :secret))&#xA;              (secret&#xA;                (if (functionp secret-maybe)&#xA;                  (funcall secret-maybe)&#xA;                  secret-maybe)))&#xA;           (list port secret))&#xA;       nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Comment out &lt;code&gt;:port tramp-current-method&lt;/code&gt; in &lt;code&gt;tramp-read-passwd&lt;/code&gt;.  &lt;code&gt;tramp-current-method&lt;/code&gt; is &lt;code&gt;&quot;ssh&quot;&lt;/code&gt; and this prevents &lt;code&gt;auth-source-search&lt;/code&gt; from returning a result if &lt;code&gt;.authinfo&lt;/code&gt; contains a specified port other than &lt;code&gt;ssh&lt;/code&gt;; e.g., &lt;code&gt;port 2222&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Within &lt;code&gt;tramp-maybe-open-connection&lt;/code&gt;, comment out and replace this section as follows:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;  ;; (when (string-match tramp-host-with-port-regexp l-host)&#xA;  ;;   (setq l-port (match-string 2 l-host)&#xA;  ;;         l-host (match-string 1 l-host)))&#xA;&#xA;  (cond&#xA;    ((string-match tramp-host-with-port-regexp l-host)&#xA;      (setq l-port (match-string 2 l-host)&#xA;            l-host (match-string 1 l-host)))&#xA;    ((and l-host l-user)&#xA;      (let ((port (car (get-auth-info l-host l-user))))&#xA;        (when port&#xA;           (setq l-port port)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-03-09T19:11:03.040" LastActivityDate="2017-03-09T19:11:03.040" Title="Eshell and Dired are unable to extract port number from authinfo file" Tags="|dired|tramp|eshell|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31325" PostTypeId="2" ParentId="31318" CreationDate="2017-03-08T18:28:43.003" Score="3" Body="&lt;p&gt;I'm assuming you're using the bash-shell.  The HISTFILE environment variable is either set implicitly by the shell or by setting it in some script file, e.g. ~/.bashrc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs inherits the environment from the process that started it, which is usually some X-window-manager, while &lt;code&gt;shell-command-to-string&lt;/code&gt; starts a non-interactive shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, either there is no shell involved, or it is, but neither does it set this variable implicitly, nor does it read any initialization scripts, where it may have been set.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-03-08T18:28:43.003" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31326" PostTypeId="1" CreationDate="2017-03-08T19:56:19.677" Score="3" ViewCount="1734" Body="&lt;p&gt;I am trying to insert a column in a table in org-mode and I get the content moved.&lt;br&gt;&#xA;For example, I have this table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name   | Age |&#xA;|--------+-----|&#xA;| Tarzan |  40 |&#xA;| Jane   |  39 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want to insert a column between Name and Age.&lt;br&gt;&#xA;So I add a pipe (&lt;code&gt;|&lt;/code&gt;) just after Name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name  | | Age |&#xA;|--------+-----|&#xA;| Tarzan |  40 |&#xA;| Jane   |  39 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the press &lt;kbd&gt;TAB&lt;/kbd&gt;.&lt;br&gt;&#xA;I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name   |    | Age |&#xA;|--------+----+-----|&#xA;| Tarzan | 40 |     |&#xA;| Jane   | 39 |     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;While what I would expect is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name   |    | Age |&#xA;|--------+----+-----|&#xA;| Tarzan |    |  40 |&#xA;| Jane   |    |  39 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems kind of simple to fix manually for that table, but... I haven't told you all the story.&lt;br&gt;&#xA;In the real table I have Boy, Cheeta, Cheeta's family, the herd of elephants, lions, tigers, crocodiles, etc... and all the &lt;em&gt;psychological relationships&lt;/em&gt; between them...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to avoid that column content move?&lt;/p&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="6957" LastEditDate="2017-03-08T22:35:25.873" LastActivityDate="2017-03-08T22:35:25.873" Title="Insert column in org-mode moves the content" Tags="|org-mode|org-table|column|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31327" PostTypeId="2" ParentId="31326" CreationDate="2017-03-08T20:42:57.700" Score="7" Body="&lt;p&gt;Just positioning at the column:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       cursor here&#xA;          |&#xA;          V&#xA;| Name   |■Age |&#xA;|--------+-----|&#xA;| Tarzan |  40 |&#xA;| Jane   |  39 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and using &lt;kbd&gt;M-S-right&lt;/kbd&gt; &lt;code&gt;(org-table-insert-column)&lt;/code&gt; makes it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Name   |   | Age |&#xA;|--------+---+-----|&#xA;| Tarzan |   |  40 |&#xA;| Jane   |   |  39 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the org-mode manual:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-S-&amp;lt;right&amp;gt;     (org-table-insert-column)&#xA;Insert a new column to the left of the cursor position. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6957" LastEditorUserId="253" LastEditDate="2017-03-08T21:26:01.857" LastActivityDate="2017-03-08T21:26:01.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31328" PostTypeId="1" CreationDate="2017-03-08T22:47:11.810" Score="0" ViewCount="163" Body="&lt;p&gt;The docstring of &lt;code&gt;scan-sexps&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the beginning or end is reached between groupings but before count is used up, nil is returned.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Putting point (&lt;code&gt;|&lt;/code&gt;) before the first element of a list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(|a b c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and calling &lt;code&gt;backward-sexp&lt;/code&gt;, however, throws an error such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(scan-error &quot;Containing expression ends prematurely&quot; 1600 1600)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's unclear whether this is &lt;em&gt;expected&lt;/em&gt; behavior when there's text in the buffer before &lt;code&gt;(a b c)&lt;/code&gt;. It seems to me that &lt;code&gt;nil&lt;/code&gt; should be returned instead--or am I misunderstanding the docstring.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="105" LastEditDate="2017-03-08T22:54:51.893" LastActivityDate="2017-03-08T23:11:16.830" Title="Unclear expectation of behavior from `scan-sexps`" Tags="|documentation|help|sexp|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31329" PostTypeId="2" ParentId="31324" CreationDate="2017-03-08T22:52:53.733" Score="0" Body="&lt;p&gt;TRAMP doesn't look for port numbers in the authinfo file; you can see the function &lt;code&gt;tramp-parse-netrc-group&lt;/code&gt; for details. It looks like you could modify &lt;code&gt;tramp-host-regexp&lt;/code&gt;, but I don't know off-hand if that would work out; later users of that information might fail if it's not just a hostname.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-03-08T22:52:53.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31330" PostTypeId="2" ParentId="31328" CreationDate="2017-03-08T23:11:16.830" Score="1" Body="&lt;p&gt;Here is the whole paragraph.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the beginning or end of (the accessible part of) the buffer is reached&#xA;  in the middle of a parenthetical grouping, an error is signaled.&#xA;  If the beginning or end is reached between groupings&#xA;  but before count is used up, nil is returned.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &quot;beginning or end&quot; in this sentence refers to point-min resp. -max.  It doesn't matter if there is text before &lt;code&gt;(|a b c)&lt;/code&gt;, since you don't get out of the expression anyway and thus don't reach these positions.  The fact that the function signals an error in this case is not mentioned at all, but rather needs to be infered from the positive description of its behaviour (&quot;balanced expressions&quot;), I suppose.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-03-08T23:11:16.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31332" PostTypeId="2" ParentId="5740" CreationDate="2017-03-09T03:28:59.853" Score="2" Body="&lt;p&gt;This function can do it for you: from &lt;a href=&quot;https://github.com/chrisdone/chrisdone-emacs/blob/master/config/org.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;chrisdone/chrisdone-emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key org-mode-map (kbd &quot;C-#&quot;) 'org-begin-template)&#xA;(defun org-begin-template ()&#xA;  &quot;Make a template at point.&quot;&#xA;  (interactive)&#xA;  (if (org-at-table-p)&#xA;      (call-interactively 'org-table-rotate-recalc-marks)&#xA;    (let* ((choices '((&quot;s&quot; . &quot;SRC&quot;)&#xA;                      (&quot;e&quot; . &quot;EXAMPLE&quot;)&#xA;                      (&quot;q&quot; . &quot;QUOTE&quot;)&#xA;                      (&quot;v&quot; . &quot;VERSE&quot;)&#xA;                      (&quot;c&quot; . &quot;CENTER&quot;)&#xA;                      (&quot;l&quot; . &quot;LaTeX&quot;)&#xA;                      (&quot;h&quot; . &quot;HTML&quot;)&#xA;                      (&quot;a&quot; . &quot;ASCII&quot;)))&#xA;           (key&#xA;            (key-description&#xA;             (vector&#xA;              (read-key&#xA;               (concat (propertize &quot;Template type: &quot; 'face 'minibuffer-prompt)&#xA;                       (mapconcat (lambda (choice)&#xA;                                    (concat (propertize (car choice) 'face 'font-lock-type-face)&#xA;                                            &quot;: &quot;&#xA;                                            (cdr choice)))&#xA;                                  choices&#xA;                                  &quot;, &quot;)))))))&#xA;      (let ((result (assoc key choices)))&#xA;        (when result&#xA;          (let ((choice (cdr result)))&#xA;            (cond&#xA;             ((region-active-p)&#xA;              (let ((start (region-beginning))&#xA;                    (end (region-end)))&#xA;                (goto-char end)&#xA;                (insert &quot;\n#+END_&quot; choice)&#xA;                (goto-char start)&#xA;                (insert &quot;#+BEGIN_&quot; choice &quot;\n&quot;)))&#xA;             (t&#xA;              (insert &quot;#+BEGIN_&quot; choice &quot;\n&quot;)&#xA;              (save-excursion (insert &quot;\n#+END_&quot; choice))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2004" LastActivityDate="2017-03-09T03:28:59.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31333" PostTypeId="1" CreationDate="2017-03-09T06:57:46.253" Score="2" ViewCount="46" Body="&lt;p&gt;Is it possible to setup emacs to indent C code, with tabs for blocks &lt;code&gt;{ ... }&lt;/code&gt; and spaces with other wrapping (argument, for example)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;--&amp;gt;if (foo) {&#xA;&amp;lt;--&amp;gt;&amp;lt;--&amp;gt;function(a, b,&#xA;&amp;lt;--&amp;gt;&amp;lt;--&amp;gt;.........c, d);&#xA;&amp;lt;--&amp;gt;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently emacs uses tabs with spaces for padding.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;--&amp;gt;if (foo) {&#xA;&amp;lt;--&amp;gt;&amp;lt;--&amp;gt;function(a, b,&#xA;&amp;lt;--&amp;gt;&amp;lt;--&amp;gt;&amp;lt;--&amp;gt;&amp;lt;--&amp;gt;.c, d);&#xA;&amp;lt;--&amp;gt;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(where &lt;code&gt;&amp;lt;--&amp;gt;&lt;/code&gt; is for tabs and &lt;code&gt;.&lt;/code&gt; for spaces).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QtCreator has the option to: &lt;em&gt;Align continuation lines --&gt; with spaces&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible in emacs?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update, I wasn't aware at time of asking but this is sometimes called &lt;em&gt;&quot;smart-tabs&quot;&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-03-11T11:09:02.163" LastActivityDate="2017-03-11T11:09:02.163" Title="Auto-indenting C code with tabs for blocks and spaces for other wrapping?" Tags="|indentation|whitespace|" AnswerCount="0" CommentCount="1" ClosedDate="2017-03-11T15:11:14.160" ContentLicense="CC BY-SA 3.0" />
  <row Id="31334" PostTypeId="1" AcceptedAnswerId="31337" CreationDate="2017-03-09T08:48:17.697" Score="2" ViewCount="1259" Body="&lt;p&gt;When searching for text in evil mode using &lt;code&gt;/&lt;/code&gt; key, then entering text. The value searched for isn't saved as it is in vim, where the up/down arrow keys can cycle search history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible for emacs/evil mode to store each search as it does with &lt;code&gt;:&lt;/code&gt; commands?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update, &lt;code&gt;isearch&lt;/code&gt; keys aren't configured for vim-like behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked into this and the isearch keymap can be modified, will add own answer.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-03-09T09:38:41.103" LastActivityDate="2020-03-29T02:53:26.210" Title="History of search terms for evil mode?" Tags="|evil|search|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31335" PostTypeId="2" ParentId="31315" CreationDate="2017-03-09T09:33:49.833" Score="0" Body="&lt;p&gt;Other option is not to use EDE but to use projectile! See &lt;a href=&quot;https://github.com/bbatsov/projectile&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/bbatsov/projectile&lt;/a&gt; . Add .projectile file to the project root to make it a projectile project and this to .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'projectile)&#xA;(defun setup-flycheck-gcc-includes ()&#xA;  &quot;Set gcc includes for flycheck using projectile.&quot;&#xA;  (let ((root (ignore-errors (projectile-project-root))))&#xA;    (when root&#xA;      (setq-local flycheck-gcc-include-path&#xA;                  (mapcar (lambda (dir-x)&#xA;                            (concat root dir-x)) (projectile-current-project-dirs))))))&#xA;&#xA;(add-hook 'c-mode-common-hook 'setup-flycheck-gcc-includes)                  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that this adds every subdir that the projectile considers as project directory as a possible include directory. One might want to filter the list with some magic regex or something if one has better knowledge on which dirs are include dirs.&lt;/p&gt;&#xA;" OwnerUserId="13558" LastEditorUserId="13558" LastEditDate="2017-03-09T13:01:03.503" LastActivityDate="2017-03-09T13:01:03.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31336" PostTypeId="2" ParentId="31334" CreationDate="2017-03-09T09:39:35.537" Score="1" Body="&lt;p&gt;To have up/down arrow keys cycle history as with vim, you can define isearch keymap.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key isearch-mode-map (kbd &quot;&amp;lt;down&amp;gt;&quot;) 'isearch-ring-advance)&#xA;(define-key isearch-mode-map (kbd &quot;&amp;lt;up&amp;gt;&quot;) 'isearch-ring-retreat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2017-03-09T09:39:35.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31337" PostTypeId="2" ParentId="31334" CreationDate="2017-03-09T12:28:46.630" Score="6" Body="&lt;p&gt;You will find things more Vim like with the Evil search module rather than isearch search module with Evil : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-select-search-module 'evil-search-module 'evil-search)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11609" LastEditorUserId="2679" LastEditDate="2020-03-29T02:53:26.210" LastActivityDate="2020-03-29T02:53:26.210" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="31338" PostTypeId="2" ParentId="10842" CreationDate="2017-03-09T12:30:36.017" Score="2" Body="&lt;p&gt;This package has exactly what you are looking for:&lt;br&gt;&#xA;&lt;a href=&quot;https://github.com/syohex/emacs-helm-ag&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syohex/emacs-helm-ag&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command's name is helm-do-ag.&lt;/p&gt;&#xA;" OwnerUserId="4077" LastActivityDate="2017-03-09T12:30:36.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31339" PostTypeId="2" ParentId="31324" CreationDate="2017-03-09T14:15:11.887" Score="1" Body="&lt;p&gt;In auth-source.el, the port specification for Tramp is redefined. It must contain the Tramp method name, you cannot define the port number ssh is using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I recommend to use a proper entry in &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Host 12.34.567.89&#xA;    Port    2222&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, you could add other attributes like &lt;code&gt;HostName&lt;/code&gt; and &lt;code&gt;User&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-03-09T14:15:11.887" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31340" PostTypeId="1" AcceptedAnswerId="31341" CreationDate="2017-03-09T14:16:04.100" Score="0" ViewCount="129" Body="&lt;p&gt;I like &lt;code&gt;auto-fill-mode&lt;/code&gt; a lot because it makes text fit into my screen even when I have two buffers side-by-side.&#xA;My problem is that a &lt;strong&gt;small wording change may trigger auto-fill to reformat a whole paragraph&lt;/strong&gt;, and that doesn't play well with version controlling, i.e., git.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't track my small changes anymore, because the whole paragraph is changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if anyone has a suggestion on how to deal with this problem.&#xA;Is there a &quot;visual-auto-fill&quot;, which doesn't take care of newlines but just visually displays text in a proper manner?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I plan to export files to LaTeX and HTML, I don't care if there are no newlines at all in the saved document.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2024-01-07T18:47:34.783" Title="Strategy for proper version control of &quot;auto-filled&quot; text files" Tags="|org-mode|version-control|auto-fill-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31341" PostTypeId="2" ParentId="31340" CreationDate="2017-03-09T14:25:08.647" Score="2" Body="&lt;p&gt;Yes, you want &lt;code&gt;visual-line-mode&lt;/code&gt;. See the Emacs manual section 14.22 (run &lt;code&gt;M-: (info &quot;(emacs)Visual Line Mode&quot;)&lt;/code&gt; to jump right to it inside Emacs).&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-03-09T14:25:08.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31344" PostTypeId="1" CreationDate="2017-03-09T15:07:59.910" Score="2" ViewCount="149" Body="&lt;p&gt;Just spinning up on emacs and &lt;code&gt;org-mode&lt;/code&gt;.  Apologies if this is a trivial question, but haven't come across an answer yet after a fair amount of searching.  I have my &lt;code&gt;#+SEQ_TODO&lt;/code&gt; set up to record completion dates, and my archive file set as &lt;code&gt;&quot;file&quot;_archive.org::datetree/&lt;/code&gt;. When I archive a task in the &lt;code&gt;DONE&lt;/code&gt; state, I would like to have it archived to the datetree under a &lt;strong&gt;completion&lt;/strong&gt; date heading, not under the date that I get around to archiving it.  Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15164" LastEditorUserId="253" LastEditDate="2017-03-09T15:34:48.993" LastActivityDate="2017-03-09T15:34:48.993" Title="Archive TODO by completion date, not archive date" Tags="|org-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31345" PostTypeId="2" ParentId="31264" CreationDate="2017-03-09T15:30:56.603" Score="1" Body="&lt;p&gt;I've found a solution. &lt;code&gt;C-c C-j&lt;/code&gt; switches the terminal from &lt;code&gt;term-char-mode&lt;/code&gt; to &lt;code&gt;term-line-mode&lt;/code&gt;, and fixes the behaviour inside the application. Once I'm finished with the application, &lt;code&gt;C-c C-k&lt;/code&gt; switches the terminal back to &lt;code&gt;term-char-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Info found &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14499" LastActivityDate="2017-03-09T15:30:56.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31347" PostTypeId="1" CreationDate="2017-03-09T16:59:24.667" Score="3" ViewCount="115" Body="&lt;p&gt;Is there a way to get to the top of a buffer that is not necessarily active?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to do is run a shell command on the word at point and then show the top of the output in the &lt;code&gt;*Async Shell Command*&lt;/code&gt; buffer (if the output is longer than the screen).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have now is:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(evil-leader/set-key &quot;l&quot;&#xA;  (lambda ()&#xA;    (interactive)&#xA;    (async-shell-command&#xA;     (concat &quot;parse &quot; (thing-at-point 'word 'no-properties)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12497" LastEditorUserId="15748" LastEditDate="2018-05-10T13:15:58.800" LastActivityDate="2018-05-10T13:15:58.800" Title="Show top of *Async Shell Command* buffer" Tags="|process|shell-command|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31348" PostTypeId="1" AcceptedAnswerId="31359" CreationDate="2017-03-09T17:17:57.063" Score="2" ViewCount="229" Body="&lt;p&gt;The following &lt;code&gt;.emacs&lt;/code&gt; file works as expected, so long as I invoke emacs the &quot;normal&quot; way (ie by launching the &lt;code&gt;emacs&lt;/code&gt; executable directly).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-unset-key (kbd &quot;C-]&quot;))&#xA;(global-set-key (kbd &quot;H-C-]&quot;) 'abort-recursive-edit)&#xA;(define-key local-function-key-map (kbd &quot;C-]&quot;) 'event-apply-hyper-modifier)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I start emacs via &lt;code&gt;emacsclient -n -c -a  &quot;&quot;&lt;/code&gt;, the value of &lt;code&gt;local-function-key-map&lt;/code&gt; gets overwritten somewhere along the way.  I have used print statements to make sure that my &lt;code&gt;.emacs&lt;/code&gt; file is getting run, and that the value of &lt;code&gt;local-function-key-map&lt;/code&gt; gets updated.  But by the time I land in the &lt;code&gt;*scratch*&lt;/code&gt; buffer, my binding is missing from &lt;code&gt;local-function-key-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone experienced this before, or knows a reason why &lt;code&gt;local-function-key-map&lt;/code&gt; would get clobbered when starting emacs via &lt;code&gt;emacsclient&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running emacs-25.1 on CentOS 7&lt;/p&gt;&#xA;" OwnerUserId="93" LastActivityDate="2023-02-12T18:25:51.883" Title="local-function-key-map gets overwritten by emacsclient" Tags="|emacsclient|keymap|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31349" PostTypeId="1" AcceptedAnswerId="41331" CreationDate="2017-03-09T18:01:04.960" Score="2" ViewCount="363" Body="&lt;h1&gt;Need&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Default emacs font for most buffers is okay.&#xA;But for coding-related activities I need a smaller, crisp font.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What works&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;In the spirit of &lt;a href=&quot;https://emacs.stackexchange.com/questions/29920/is-it-possible-to-change-the-font-size-in-specific-buffers&quot;&gt;Is it possible to change the font size in specific buffers? - Emacs Stack Exchange&lt;/a&gt;&#xA;I've followed&#xA;&lt;a href=&quot;https://www.emacswiki.org/emacs/FacesPerBuffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/FacesPerBuffer&lt;/a&gt;&#xA;and it works for most modes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those work very well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'emacs-lisp-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'graphviz-dot-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'text-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'c-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'c++-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'objc-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'cmake-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'compilation-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'shell-dirtrack-mode-hook 'my-buffer-face-mode-fixed)&#xA;...(and many others)...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;What fails&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;When using &lt;code&gt;M-x gdb&lt;/code&gt;, a multi-buffer interface appears, and I can't set the font for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;describe-mode&lt;/code&gt; reports &lt;code&gt;Gdb-Many-Windows&lt;/code&gt; and many others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'gdb-many-windows-hook 'my-buffer-face-mode-fixed)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it had no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then browsed &lt;a href=&quot;https://github.com/Hawstein/my-emacs/blob/master/_emacs/multi-gdb-ui.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/Hawstein/my-emacs/blob/master/_emacs/multi-gdb-ui.el&lt;/a&gt; and added all the lines below, to hook, well, on every hook visible in that source code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'prog-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-local-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdba-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-breakpoints-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-frames-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-threads-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-registers-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-memory-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-info-locals-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-locals-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'gdb-assembler-mode-hook 'my-buffer-face-mode-fixed)&#xA;(add-hook 'global-ede-mode-hook 'my-buffer-face-mode-fixed)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Still no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's tedious to manually change font every time in the ~5 buffers at each gdb invocation.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;What now?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;How to set font for &lt;code&gt;gdb&lt;/code&gt; emacs interface buffers?&lt;/p&gt;&#xA;" OwnerUserId="10614" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2018-05-04T06:11:24.540" Title="Use a specific font face for gdb buffers" Tags="|fonts|gdb|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31350" PostTypeId="2" ParentId="31349" CreationDate="2017-03-09T18:20:07.877" Score="0" Body="&lt;p&gt;Found a hack that works...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-frame-font &quot;Envy Code R-9&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ;; Use monospaced font faces in current buffer&#xA; (defun my-buffer-face-mode-fixed ()&#xA;   &quot;Sets a fixed width (monospace) font in current buffer&quot;&#xA;   (interactive)&#xA;   (setq buffer-face-mode-face '(:family &quot;Envy Code R&quot; :height 100))&#xA;   (set-frame-font &quot;Envy Code R-9&quot;)&#xA;   (buffer-face-mode))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a result, the whole frame gets the smaller font I need, not the buffer.&#xA;Opening the same buffer in another frame doesn't get the font, but, well, that's a hack.&#xA;Also, at startup emacs window changes appearance even more than before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like a cleaner answer.&lt;/p&gt;&#xA;" OwnerUserId="10614" LastActivityDate="2017-03-09T18:20:07.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31351" PostTypeId="2" ParentId="31348" CreationDate="2017-03-09T19:05:44.687" Score="3" Body="&lt;h1&gt;tl;dr&lt;/h1&gt;&#xA;&lt;p&gt;&lt;code&gt;local-function-key-map&lt;/code&gt; is a terminal-local version of &lt;code&gt;function-key-map&lt;/code&gt;, so defining my binding in &lt;code&gt;function-key-map&lt;/code&gt; fixed the problem&lt;/p&gt;&#xA;&lt;h1&gt;Why?&lt;/h1&gt;&#xA;&lt;p&gt;The reason for the behavior seems to be that &lt;code&gt;local-function-key-map&lt;/code&gt; is a terminal-local variable.  When using &lt;code&gt;emacsclient&lt;/code&gt;, two distinct terminals are created: one in the tty, and one for the X-windows. Calling &lt;code&gt;(terminal-list)&lt;/code&gt; after starting emacs via &lt;code&gt;emacsclient&lt;/code&gt; returns this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;(#&amp;lt;terminal 0 on initial_terminal&amp;gt; #&amp;lt;terminal 1 on :0&amp;gt;)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;So &lt;code&gt;local-function-key-map&lt;/code&gt; in &amp;quot;terminal 0&amp;quot; (the tty) has my binding defined, but the one in &amp;quot;terminal 1&amp;quot; (the graphical frames) does not.&lt;/p&gt;&#xA;&lt;p&gt;None of the following hooks seemed to run &lt;em&gt;after&lt;/em&gt; the new terminal-local definition of &lt;code&gt;local-function-key-map&lt;/code&gt; had been created.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;after-init-hook&#xA;before-make-frame-hook&#xA;tty-setup-hook&#xA;term-setup-hook&#xA;emacs-startup-hook&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So finally, I ended up using &lt;code&gt;local-function-key-map&lt;/code&gt;'s parent map, &lt;code&gt;function-key-map&lt;/code&gt;, because it is not terminal-local.  I still find it strange that I cannot find a way to automatically modify &lt;code&gt;local-function-key-map&lt;/code&gt; after a new terminal is created.&lt;/p&gt;&#xA;" OwnerUserId="93" LastEditorUserId="10927" LastEditDate="2023-02-12T18:25:51.883" LastActivityDate="2023-02-12T18:25:51.883" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31352" PostTypeId="2" ParentId="28878" CreationDate="2017-03-09T19:18:37.050" Score="0" Body="&lt;p&gt;The second solution provided by @Tobias can be improved using my library &lt;a href=&quot;https://github.com/raxod502/el-patch&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;el-patch&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(el-patch-defun auto-revert-buffers ()&#xA;  &quot;Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.&#xA;&#xA;Should `global-auto-revert-mode' be active all file buffers are checked.&#xA;&#xA;Should `auto-revert-mode' be active in some buffers, those buffers&#xA;are checked.&#xA;&#xA;Non-file buffers that have a custom `revert-buffer-function' and&#xA;`buffer-stale-function' are reverted either when Auto-Revert&#xA;Mode is active in that buffer, or when the variable&#xA;`global-auto-revert-non-file-buffers' is non-nil and Global&#xA;Auto-Revert Mode is active.&#xA;&#xA;This function stops whenever there is user input.  The buffers not&#xA;checked are stored in the variable `auto-revert-remaining-buffers'.&#xA;&#xA;To avoid starvation, the buffers in `auto-revert-remaining-buffers'&#xA;are checked first the next time this function is called.&#xA;&#xA;This function is also responsible for removing buffers no longer in&#xA;Auto-Revert mode from `auto-revert-buffer-list', and for canceling&#xA;the timer when no buffers need to be checked.&quot;&#xA;&#xA;  (setq auto-revert-buffers-counter&#xA;        (1+ auto-revert-buffers-counter))&#xA;&#xA;  (save-match-data&#xA;    (let ((bufs (el-patch-wrap 2&#xA;                  (cl-remove-if-not&#xA;                   #'get-buffer-window&#xA;                   (if global-auto-revert-mode&#xA;                       (buffer-list)&#xA;                     auto-revert-buffer-list))))&#xA;          remaining new)&#xA;      ;; Partition `bufs' into two halves depending on whether or not&#xA;      ;; the buffers are in `auto-revert-remaining-buffers'.  The two&#xA;      ;; halves are then re-joined with the &quot;remaining&quot; buffers at the&#xA;      ;; head of the list.&#xA;      (dolist (buf auto-revert-remaining-buffers)&#xA;        (if (memq buf bufs)&#xA;            (push buf remaining)))&#xA;      (dolist (buf bufs)&#xA;        (if (not (memq buf remaining))&#xA;            (push buf new)))&#xA;      (setq bufs (nreverse (nconc new remaining)))&#xA;      (while (and bufs&#xA;                  (not (and auto-revert-stop-on-user-input&#xA;                            (input-pending-p))))&#xA;        (let ((buf (car bufs)))&#xA;          (if (buffer-live-p buf)&#xA;              (with-current-buffer buf&#xA;                ;; Test if someone has turned off Auto-Revert Mode in a&#xA;                ;; non-standard way, for example by changing major mode.&#xA;                (if (and (not auto-revert-mode)&#xA;                         (not auto-revert-tail-mode)&#xA;                         (memq buf auto-revert-buffer-list))&#xA;                    (setq auto-revert-buffer-list&#xA;                          (delq buf auto-revert-buffer-list)))&#xA;                (when (auto-revert-active-p)&#xA;                  ;; Enable file notification.&#xA;                  (when (and auto-revert-use-notify&#xA;                             (not auto-revert-notify-watch-descriptor))&#xA;                    (auto-revert-notify-add-watch))&#xA;                  (auto-revert-handler)))&#xA;            ;; Remove dead buffer from `auto-revert-buffer-list'.&#xA;            (setq auto-revert-buffer-list&#xA;                  (delq buf auto-revert-buffer-list))))&#xA;        (setq bufs (cdr bufs)))&#xA;      (setq auto-revert-remaining-buffers bufs)&#xA;      ;; Check if we should cancel the timer.&#xA;      (when (and (not global-auto-revert-mode)&#xA;                 (null auto-revert-buffer-list))&#xA;        (cancel-timer auto-revert-timer)&#xA;        (setq auto-revert-timer nil)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12534" LastActivityDate="2017-03-09T19:18:37.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31353" PostTypeId="2" ParentId="30857" CreationDate="2017-03-09T20:15:44.580" Score="0" Body="&lt;p&gt;This problem is not necessarily specific to Spacemacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the OP may have implicitly sought a solution &lt;em&gt;within&lt;/em&gt; Spacemacs, this seems like a good place to mention another alternative (esp. for non-Spacemacs users who are experiencing the same problem after updating some piece of their emacs/org-mode configuration, which is what happened to me).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After trying &lt;strong&gt;many&lt;/strong&gt; re-installs of various emacs and org versions, I finally found that &lt;a href=&quot;http://aquamacs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Aquamacs&lt;/a&gt; (!) and Org 9.0.5 (downloaded as a tar.gz as instructed on &lt;a href=&quot;http://orgmode.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/&lt;/a&gt;) succeeded in getting around the &lt;code&gt;code block produced no output&lt;/code&gt; problem this poster also experienced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While Aquamacs may not be a long-term solution for everybody, it certainly can help others who are highly dependent on using org-babel with clojure get around this problem until the above solution is fully recognized and implemented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The version of emacs used by Aquamacs as of this March 9 2017 is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Aquamacs 3.3  GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109)) of 2016-09-19 on 24a02dbf6b34ae061ef4df89f15bfbc5d3ed497e&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9409" LastActivityDate="2017-03-09T20:15:44.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31354" PostTypeId="2" ParentId="28878" CreationDate="2017-03-09T21:18:04.377" Score="0" Body="&lt;p&gt;You can use something like this to toggle auto-revert (or some other minor mode) on and off when the current buffer changes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun auto-revert-active-buffer (window)&#xA;  (with-current-buffer (window-buffer window)&#xA;    (auto-revert-mode&#xA;     (or (eq (current-buffer) (window-buffer (selected-window))) -1))))&#xA;&#xA;(add-hook 'buffer-list-update-hook (lambda () (walk-windows #'auto-revert-active-buffer nil t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-09T21:18:04.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31355" PostTypeId="1" AcceptedAnswerId="31360" CreationDate="2017-03-10T00:59:26.297" Score="0" ViewCount="142" Body="&lt;p&gt;I need a function that return major version of &quot;current&quot; python interpreter. Possible choices are 2 or 3. How can I get it? Please, help me with this func.&lt;/p&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="105" LastEditDate="2017-03-10T01:46:06.980" LastActivityDate="2017-03-13T13:54:03.453" Title="How get python major version without any additional package?" Tags="|python|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31356" PostTypeId="2" ParentId="21205" CreationDate="2017-03-10T02:10:42.897" Score="0" Body="&lt;p&gt;I'm on windows and this wasn't working for me, I think the file-executable-p or perhaps the flycheck internals were failing to locate the correct file. As when its working it is pointing to the &lt;code&gt;.cmd&lt;/code&gt; file and not the &lt;code&gt;.js&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a comment in &lt;a href=&quot;https://github.com/flycheck/flycheck/issues/1087#issuecomment-246783846&quot; rel=&quot;nofollow noreferrer&quot;&gt;flycheck-eslint does not use version of eslint installed in JavaScript project&lt;/a&gt; and their &lt;a href=&quot;https://www.simplify.ba/articles/2016/02/14/node-modules-bin-in-path/&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog post&lt;/a&gt; to use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;directory variables&lt;/a&gt; instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the root directory of the project create a file &lt;code&gt;.dir-locals.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil . ((eval . (progn&#xA;                   (add-to-list 'exec-path (concat (locate-dominating-file default-directory &quot;.dir-locals.el&quot;) &quot;node_modules/.bin/&quot;)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when I visit the javascript file &lt;code&gt;flycheck-verify-setup&lt;/code&gt; correctly finds the file &lt;code&gt;&amp;lt;dir&amp;gt;/node_modules/.bin/eslint.cmd&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12751" LastActivityDate="2017-03-10T02:10:42.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31357" PostTypeId="1" CreationDate="2017-03-10T02:16:10.387" Score="3" ViewCount="282" Body="&lt;p&gt;&lt;a href=&quot;http://tkf.github.io/emacs-jedi/latest/#automatically-use-appropriate-python-version&quot; rel=&quot;nofollow noreferrer&quot;&gt;Documentation&lt;/a&gt; says that it can be done by making some variables buffer local. But how to make it correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody show me example how to configure this &lt;code&gt;jedi.el&lt;/code&gt; behaviour correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I have two virtualenv with installed jedi for python 2 and 3. When I change working virtualenv or python buffer, I'll check current python version and if it has changed i call &lt;a href=&quot;https://gitlab.com/cryptomaniac/emacs.d/blob/master/my-conf/functions.el#L40&quot; rel=&quot;nofollow noreferrer&quot;&gt;this function&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun cm:jedi-setup-server ()&#xA;  &quot;Setup Jedi server, update and reload.&quot;&#xA;  (interactive)&#xA;  (if (not (equal python-environment-default-root-name (cm:jedi-environment-root-name)))&#xA;      (progn&#xA;        (custom-set-variables&#xA;         '(python-environment-default-root-name (cm:jedi-environment-root-name))&#xA;         '(jedi:server-command&#xA;           (concat (venv-name-to-dir (cm:jedi-environment-root-name)) &quot;bin/jediepcserver&quot;)))&#xA;        (jedi:install-server-block))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="13871" LastEditDate="2017-03-11T06:57:01.857" LastActivityDate="2017-03-11T06:57:01.857" Title="Automatically use appropriate Python version with Jedi.el" Tags="|python|jedi|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31358" PostTypeId="1" AcceptedAnswerId="31409" CreationDate="2017-03-10T04:03:17.297" Score="3" ViewCount="1224" Body="&lt;p&gt;I can see inline image in emacs but when export to html,the image is not displayed. Even if in pdf export, it display a text ([[file:latex.jpg]]) but not the output image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;:exports both&quot; is there but only code exported!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HEADER: :headers '(&quot;\\usepackage{tikz} \\usetikzlibrary{chains}&quot;)&#xA;#+BEGIN_SRC latex :fit yes :imagemagick yes :iminoptions -density 300 :exports both :file latex.jpg&#xA;\newcommand\ann[3][]{&#xA;    \draw[arr,#1,shorten &amp;gt;=1pt,shorten &amp;lt;=1pt] ([yshift=-0.5cm]#2.south) node[below] {#3} -- (#2.south);&#xA;}&#xA;\definecolor{col1}{RGB} {238,51,34}&#xA;\definecolor{col2}{RGB} {153,221,153}&#xA;\definecolor{col3}{RGB} {255,255,51}&#xA;\tiny\begin{tikzpicture}[start chain=C1 going right,&amp;gt;=latex,node distance=0pt,text height=1.5ex,text depth=.25ex,&#xA;box/.style={draw,fill=yellow!5,rectangle, minimum width=.5cm,minimum height=.5cm,outer sep=0},&#xA;arr/.style={-&amp;gt;,line width=0.2pt}&#xA;]&#xA;\foreach \val/\col [count=\i] in {1/col1,2/col1,3/col1,6/col2,5/col2,2/col2,4/col3} {&#xA;  \node[box,fill=\col,on chain] (N\i) {\val};&#xA;}&#xA;\ann[black]{N3}{cur};&#xA;\ann[black]{N5}{index};&#xA;\ann[black]{N7}{key};&#xA;\end{tikzpicture}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2017-03-12T02:31:10.443" Title="org mode - export latex inline image to html" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31359" PostTypeId="2" ParentId="31348" CreationDate="2017-03-10T04:13:53.170" Score="2" Body="&lt;p&gt;&lt;em&gt;(n.b. Refer to nispio's answer for details of why this approach can solve the problem.)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;after-make-frame-functions&lt;/code&gt; when dealing with terminal-local settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; Per-frame/terminal configuration.&#xA;(defun my-frame-behaviours (&amp;amp;optional frame)&#xA;  &quot;Make frame- and/or terminal-local changes.&quot;&#xA;  (with-selected-frame (or frame (selected-frame))&#xA;    ;; do things&#xA;    (message &quot;new frame %S&quot; (selected-frame))&#xA;    ))&#xA;;; Run now, for non-daemon Emacs...&#xA;(my-frame-behaviours)&#xA;;; ...and later, for new frames / emacsclient&#xA;(add-hook 'after-make-frame-functions 'my-frame-behaviours)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-13T22:52:43.957" LastActivityDate="2017-03-13T22:52:43.957" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31360" PostTypeId="2" ParentId="31355" CreationDate="2017-03-10T04:16:31.243" Score="4" Body="&lt;p&gt;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Synchronous-Processes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;shell-command-to-string&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Strings.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;split-string&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(second (split-string (shell-command-to-string &quot;python --version&quot;)))&#xA;==&amp;gt; &quot;2.7.12+&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you insist on a major version &lt;em&gt;number&lt;/em&gt;, you can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/String-Conversion.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;string-to-number&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(string-to-number (first (split-string (second (split-string (shell-command-to-string &quot;python --version&quot;))) &quot;\\.&quot;)))&#xA;==&amp;gt; 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or (see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Search.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;string-match&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Simple-Match-Data.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;match-string&lt;/code&gt;&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((pv (shell-command-to-string &quot;python --version&quot;)))&#xA;  (if (string-match &quot;Python \\([0-9]+\\)\\.&quot; pv)&#xA;      (string-to-number (match-string 1 pv))&#xA;      (error &quot;Unexpected `python --version` output [%s]&quot; pv)))&#xA;==&amp;gt; 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that in all cases you will get the version of whatever &lt;code&gt;python&lt;/code&gt; executable found in the &lt;a href=&quot;https://emacs.stackexchange.com/q/550/795&quot;&gt;&lt;code&gt;exec-path&lt;/code&gt;&lt;/a&gt;.&#xA;IOW, &lt;em&gt;normally&lt;/em&gt; this would be the system-wide &lt;code&gt;/usr/bin/python&lt;/code&gt;, unless you started Emacs in a &lt;a href=&quot;http://docs.python-guide.org/en/latest/dev/virtualenvs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;virtual environment&lt;/a&gt; or set it &lt;a href=&quot;https://github.com/porterjamesj/virtualenvwrapper.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;inside Emacs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="795" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-03-13T13:54:03.453" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31363" PostTypeId="1" AcceptedAnswerId="31386" CreationDate="2017-03-10T07:38:11.150" Score="0" ViewCount="96" Body="&lt;p&gt;When using Gnus, how can I display old messages from a certain time period in article buffer?&lt;/p&gt;&#xA;" OwnerUserId="11047" LastEditorUserId="1979" LastEditDate="2017-03-10T10:39:21.180" LastActivityDate="2017-03-11T02:39:16.393" Title="How to limit gnus article buffer to specific time period?" Tags="|gnus|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31364" PostTypeId="1" CreationDate="2017-03-10T08:13:10.670" Score="4" ViewCount="2942" Body="&lt;pre&gt;&lt;code&gt;M-x (cider-jack-in)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;cider-jack-in: Symbol's function definition is void: clojure-project-dir &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;lein run  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Hello World!&quot;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cat ~/.lein/profiles.clj  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;{:user {:plugins [[cider/cider-nrepl &quot;0.14.0&quot;]]}}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;clojure-mode is installed. I forked and used &lt;a href=&quot;https://github.com/ChipNowacek/emacs-for-clojure&quot; rel=&quot;nofollow noreferrer&quot;&gt;Brave Clojure's&lt;/a&gt; .emacs.d as the starting point. I am not familiar enough with emacs to know what makes his .emacs.d configuration different. I went through his install and upgrade procedures which I quote from the link above:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;WARNING&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This project uses an outdated version of&#xA;CIDER, the package that&#xA;provides much of the functionality for Clojure development. If you run&#xA;into issues, try upgrading (instructions below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why not just update this package to use the latest CIDER, you ask?&#xA;This project uses CIDER 0.8.1 so that&#xA;&lt;a href=&quot;http://www.braveclojure.com/basic-emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Clojure for the Brave and True&lt;/a&gt;&#xA;readers are less likely to get confused as they use Emacs for the&#xA;first time.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Installing&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Close Emacs.&lt;/li&gt;&#xA;&lt;li&gt;Delete &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d&lt;/code&gt; if they exist. (Windows users, your&#xA;emacs files will probably live in&#xA;&lt;code&gt;C:\Users\your_user_name\AppData\Roaming\&lt;/code&gt;. So, for example, you&#xA;would delete &lt;code&gt;C:\Users\jason\AppData\Roaming\.emacs.d&lt;/code&gt;.) This is&#xA;where Emacs looks for configuration files, and deleting these files&#xA;and directories will ensure that you start with a clean slate.&lt;/li&gt;&#xA;&lt;li&gt;Download the Emacs&#xA;configuration zip file&#xA;and unzip it. Its contents should be a folder,&#xA;&lt;code&gt;emacs-for-clojure-book1&lt;/code&gt;. Run &lt;code&gt;mv path/to/emacs-for-clojure-book1&#xA;~/.emacs.d&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Create the file &lt;code&gt;~/.lein/profiles.clj&lt;/code&gt; (Windows users, this is&#xA;probably &lt;code&gt;C:\Users\your_user_name\.lein\profiles.clj&lt;/code&gt;) and add this&#xA;line to it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{:user {:plugins [[cider/cider-nrepl &quot;0.8.1&quot;]]}} &#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then open Emacs.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Upgrading&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Before upgrading, ensure that your &lt;code&gt;.emacs.d&lt;/code&gt; directory is under&#xA;version control so that you can always revert to a known good state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To upgrade:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Edit &lt;code&gt;.emacs.d/init.el&lt;/code&gt;, adding these lines after line 12:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'package-archives&#xA;    '(&quot;melpa-stable&quot; . &quot;http://stable.melpa.org/packages/&quot;) t&#xA;(add-to-list 'package-pinned-packages '(cider . &quot;melpa-stable&quot;) t)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Close Emacs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Run &lt;code&gt;rm -Rf .emacs.d/elpa/cider-*&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Open Emacs. You'll probably see some errors and your theme won't&#xA;load. That's ok.&lt;/li&gt;&#xA;&lt;li&gt;In Emacs, run &lt;code&gt;M-x package-refresh contents&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In Emacs, run &lt;code&gt;M-x package-install cider&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Close and re-open Emacs.&lt;/li&gt;&#xA;&lt;li&gt;Open &lt;code&gt;.lein/profiles.clj&lt;/code&gt; and remove &lt;code&gt;[cider/cider-nrepl &quot;0.8.1&quot;]&lt;/code&gt; from it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That should install the latest version. Enjoy!&lt;/p&gt;&#xA;" OwnerUserId="15171" LastEditorUserId="15171" LastEditDate="2017-03-10T13:48:24.747" LastActivityDate="2019-06-10T16:25:01.463" Title="cider-jack-in: Symbol's function definition is void: clojure-project-dir with closure-mode installed" Tags="|clojure|cider|" AnswerCount="7" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31365" PostTypeId="2" ParentId="31358" CreationDate="2017-03-10T08:51:35.673" Score="0" Body="&lt;p&gt;Can you find the image in the jpeg file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This configuration works for me. But I don't know how it works exactly.&#xA;The best info I can give you is from this post &lt;a href=&quot;https://emacs.stackexchange.com/questions/17765/how-can-we-convert-a-range-of-table-types-latex-org-to-html-when-org-exporting&quot;&gt;How can we convert a range of table types (latex,org) to html when org-exporting to html?&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using this macro which I found in the link above. I recommend putting it in your init file. From my understanding you can handle how latex export blocks depending whether you export to latex or html. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  #+BEGIN_SRC emacs :export no&#xA;   (setq org-babel-latex-htlatex &quot;htlatex&quot;)&#xA;   (defmacro by-backend (&amp;amp;rest body)&#xA;   `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body))&#xA;   #+END_SRC&#xA;&#xA;&#xA;&#xA;#+LATEX_HEADER:\usetikzlibrary{chains}&#xA;#+LATEX_HEADER:\usepackage{tikz}&#xA;#+OPTIONS: tex:imagemagick&#xA;&#xA;&#xA;&#xA;#+header: :results (by-backend (pdf &quot;latex&quot;) (t &quot;raw&quot;))&#xA;#+BEGIN_SRC latex :results output graphics :file test.png&#xA;\newcommand\ann[3][]{&#xA;    \draw[arr,#1,shorten &amp;gt;=1pt,shorten &amp;lt;=1pt] ([yshift=-0.5cm]#2.south) node[below] {#3} -- (#2.south);&#xA;}&#xA;\definecolor{col1}{RGB} {238,51,34}&#xA;\definecolor{col2}{RGB} {153,221,153}&#xA;\definecolor{col3}{RGB} {255,255,51}&#xA;\tiny\begin{tikzpicture}[start chain=C1 going right,&amp;gt;=latex,node distance=0pt,text height=1.5ex,text depth=.25ex,&#xA;box/.style={draw,fill=yellow!5,rectangle, minimum width=.5cm,minimum height=.5cm,outer sep=0},&#xA;arr/.style={-&amp;gt;,line width=0.2pt}&#xA;]&#xA;\foreach \val/\col [count=\i] in {1/col1,2/col1,3/col1,6/col2,5/col2,2/col2,4/col3} {&#xA;  \node[box,fill=\col,on chain] (N\i) {\val};&#xA;}&#xA;\ann[black]{N3}{cur};&#xA;\ann[black]{N5}{index};&#xA;\ann[black]{N7}{key};&#xA;\end{tikzpicture}&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-03-10T08:51:35.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31366" PostTypeId="2" ParentId="31347" CreationDate="2017-03-10T09:18:52.220" Score="2" Body="&lt;p&gt;I think you don't want to use &lt;code&gt;async-shell-command&lt;/code&gt; but &lt;code&gt;start-process&lt;/code&gt; instead.  That will let you decide when and how you display the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. something like (guaranteed 100% untested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-parse-command ()&#xA;  (interactive)&#xA;  (let* ((buf (get-buffer-create &quot;*my-output-buffer*&quot;))&#xA;         (proc (start-process&#xA;                &quot;my-parse-proc&quot; buf&#xA;                &quot;parse&quot; (thing-at-point 'word 'no-properties))))&#xA;    (set-process-sentinel&#xA;     proc&#xA;     (lambda (proc _state)&#xA;       (with-current-buffer (process-buffer proc)&#xA;         (save-excursion&#xA;           (goto-char (point-min))&#xA;           (if (&amp;gt;= (line-beginning-position 2) (point-max))&#xA;               ;; A single line of output, show in echo area&#xA;               (message &quot;%s&quot; (buffer-substring))&#xA;             (let ((win (display-buffer (current-buffer))))&#xA;               (when win&#xA;                 (fit-window-to-buffer win))))))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-10T09:18:52.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31367" PostTypeId="1" AcceptedAnswerId="31382" CreationDate="2017-03-10T09:36:20.443" Score="7" ViewCount="1404" Body="&lt;p&gt;I am using &lt;a href=&quot;https://github.com/tlh/workgroups.el&quot; rel=&quot;noreferrer&quot;&gt;workgroups&lt;/a&gt; and I have the following code in my &lt;code&gt;init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (defun my-start-emacs (_)&#xA;   (interactive)&#xA;   (message &quot;HI&quot;)&#xA;   (sleep-for 1)&#xA;   (if (daemonp)&#xA;       (progn&#xA;         (if (not (boundp 'server-wg))&#xA;             (progn&#xA;               (wg-create-workgroup &quot;server&quot;)&#xA;               (setq server-wg (wg-current-workgroup)))&#xA;           (progn&#xA;             (setq current-wg (condition-case nil&#xA;                                  (wg-current-workgroup)&#xA;                                (error nil)))&#xA;             (if (not current-wg)&#xA;                 (wg-switch-to-workgroup server-wg)&#xA;               (if (not (eq current-wg server-wg))&#xA;                   (wg-switch-to-workgroup server-wg))))))))&#xA;&#xA; (add-to-list 'after-make-frame-functions #'my-start-emacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;my-start-emacs&lt;/code&gt; function creates the &quot;server&quot; workgroup if it does not exist, and loads it if it does. Using it manually via &lt;code&gt;M-x my-start-emacs&lt;/code&gt; works perfectly, however for some reason even though it is called when I start the &lt;code&gt;emacsclient -t&lt;/code&gt; (attach to server after &lt;code&gt;emacs --daemon&lt;/code&gt;), nothing happens (i.e. the server workgroup is created, but is not changed to)... Why?&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="253" LastEditDate="2017-03-10T21:27:06.957" LastActivityDate="2017-03-10T21:27:06.957" Title="after-make-frame-functions does nothing for an otherwise working function" Tags="|init-file|server|daemon|workgroups|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31368" PostTypeId="1" AcceptedAnswerId="31383" CreationDate="2017-03-10T10:00:17.773" Score="8" ViewCount="1746" Body="&lt;p&gt;Unlike &lt;code&gt;isearch&lt;/code&gt;, evil-search mode ignores &lt;code&gt;case-fold-search&lt;/code&gt; option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using evil-search like this for eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq-default evil-search-module 'evil-search)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to make evil-search case sensitive?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2022-10-01T00:43:08.927" Title="How to do case sensitive searches using evil's evil-search?" Tags="|evil|case-folding|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31370" PostTypeId="1" AcceptedAnswerId="39173" CreationDate="2017-03-10T10:16:19.260" Score="9" ViewCount="823" Body="&lt;p&gt;I've got a new language I'm working on that I'm documenting in an Org file.  Code samples for this language can be written in &lt;code&gt;lisp-mode&lt;/code&gt;, but I want to use the new language's name for the &lt;code&gt;SRC&lt;/code&gt; blocks for when I eventually write an Emacs mode for the language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I alias &lt;code&gt;#+BEGIN_SRC my-new-lang&lt;/code&gt; to open in &lt;code&gt;lisp-mode&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2018-03-01T23:34:24.243" Title="Can I alias a language for org-babel SRC blocks?" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31371" PostTypeId="1" CreationDate="2017-03-10T10:21:33.407" Score="2" ViewCount="293" Body="&lt;p&gt;EMMS shows only the playing time, not the track length, e.g.:&lt;br&gt;&#xA;02:37         not&lt;br&gt;&#xA;02:37/05:49.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable &lt;code&gt;emms-playing-time-display-short-p&lt;/code&gt; has the correct value: nil.&#xA;My default player is mplayer, but I've tried also vlc. I never get the track length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get the format 'playing time/length' ( 02:37/05:49)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My init.el has for EMMS just these lines of &lt;a href=&quot;https://www.gnu.org/software/emms/manual/#Quickstart-Guide&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emms/manual/#Quickstart-Guide&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/elisp/emms/lisp/&quot;)  &#xA;(require 'emms-setup)  &#xA;(emms-all)  &#xA;(emms-default-players) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11498" LastActivityDate="2024-03-21T13:03:25.410" Title="EMMS doesn't show the track length" Tags="|emms|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31372" PostTypeId="1" AcceptedAnswerId="31379" CreationDate="2017-03-10T11:39:43.767" Score="2" ViewCount="169" Body="&lt;p&gt;I was using &lt;a href=&quot;https://stackoverflow.com/a/88828/921319&quot;&gt;this&lt;/a&gt; to implement line duplication in emacs and decided to bind it to &lt;code&gt;C-c d&lt;/code&gt; and it works without problems&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be cooler though is if I can use &lt;code&gt;C-c d&lt;/code&gt; do duplicate a line and then be able to make further duplications of this line by simply typing &lt;code&gt;d&lt;/code&gt;. If I want 4 duplications, then the call would be &lt;code&gt;C-c d&lt;/code&gt;, &lt;code&gt;d&lt;/code&gt;, &lt;code&gt;d&lt;/code&gt;, &lt;code&gt;d&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way to achieve this? I assumed it would be activating a minor mode with &lt;code&gt;C-c d&lt;/code&gt; that, when it starts, duplicates a line and then has the &lt;code&gt;duplicate-line&lt;/code&gt; function bound to &quot;d&quot; in it's keymap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with this is that you have to disable the minor mode when a key is pressed that is not in it's keymap. Can this be done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or am I approaching this problem completely wrong?&lt;/p&gt;&#xA;" OwnerUserId="8401" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-10T16:12:41.887" Title="Disable minor mode when keys not in it's keymap are pressed" Tags="|key-bindings|minor-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31373" PostTypeId="1" AcceptedAnswerId="31401" CreationDate="2017-03-10T11:41:36.977" Score="0" ViewCount="96" Body="&lt;p&gt;I would like to write pieces of code (I don't need to evaluate it---yet---) of &lt;code&gt;Cadabra&lt;/code&gt; &lt;a href=&quot;http://cadabra.science/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;see the web page&lt;/a&gt; which is based in &lt;code&gt;python&lt;/code&gt;. However, it uses the symbol &lt;code&gt;#&lt;/code&gt; as part of the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I define a new babel language (based in python) which treats the &lt;code&gt;#&lt;/code&gt; symbol differently?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important thing I want to keep is the code highlighting.&lt;/p&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="253" LastEditDate="2017-03-10T22:04:52.603" LastActivityDate="2017-03-11T18:08:23.030" Title="Define a new babel src (based in python)" Tags="|org-mode|org-babel|python|syntax-highlighting|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31374" PostTypeId="1" CreationDate="2017-03-10T13:58:24.663" Score="2" ViewCount="169" Body="&lt;p&gt;Oftentimes there are gaps in a side-by-side differential.  That is some lines were added, some were removed.  As I currently see it, &lt;code&gt;ediff&lt;/code&gt; does not fill this gap by default.  Thus, vertical alignment between the two compared buffers is non-existent even if scrolled together.  Does anybody have a recipe to achieve such filling (potentially with newlines and/or filler characters)?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Examples&lt;/h1&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;GUI&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6pjo9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6pjo9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;TUI (&lt;code&gt;vimdiff&lt;/code&gt;)&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod                                                    |  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod&#xA;  tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At                                                     |  tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At&#xA;  vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,                                                   |  vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,&#xA;  -----------------------------------------------------------------------------------------------------------------------------------|  vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,                                                   &#xA;  -----------------------------------------------------------------------------------------------------------------------------------|  no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit                                                      &#xA;  -----------------------------------------------------------------------------------------------------------------------------------|  amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut                                                       &#xA;  no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit                                                      |  no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit&#xA;  amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut                                                       |  amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut&#xA;  labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam                                                    |  labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam&#xA;  et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata                                                       |  et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata&#xA;  sanctus est Lorem ipsum dolor sit amet.                                                                                            |  sanctus est Lorem ipsum dolor sit amet.&#xA;                                                                                                                                     |  &#xA;  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod                                                    |  Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod&#xA;  tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At                                                     |  tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At&#xA;  vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,                                                   |  -----------------------------------------------------------------------------------------------------------------------------------&#xA;  no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit                                                      |  -----------------------------------------------------------------------------------------------------------------------------------&#xA;  amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut                                                       |  -----------------------------------------------------------------------------------------------------------------------------------&#xA;  labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam                                                    |  labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam&#xA;  et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata                                                       |  et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata&#xA;  sanctus est Lorem ipsum dolor sit amet.                                                                                            |  sanctus est Lorem ipsum dolor sit amet.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt;  So, in fact, looking for &lt;code&gt;vimdiff&lt;/code&gt;-like solution to &lt;code&gt;ediff&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2454" LastEditorUserId="105" LastEditDate="2017-03-10T16:13:35.560" LastActivityDate="2017-03-10T16:13:35.560" Title="Ediff: How to fill missing lines (gap) to achieve vertical alignment?" Tags="|ediff|" AnswerCount="0" CommentCount="9" ClosedDate="2017-03-13T15:14:02.603" ContentLicense="CC BY-SA 3.0" />
  <row Id="31375" PostTypeId="1" AcceptedAnswerId="31378" CreationDate="2017-03-10T14:20:47.350" Score="8" ViewCount="7077" Body="&lt;p&gt;I am able to bind &lt;kbd&gt;M + RET&lt;/kbd&gt; with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-keys-mode-map (kbd &quot;&amp;lt;M-RET&amp;gt;&quot;) 'my-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I bind &lt;kbd&gt;C + RET&lt;/kbd&gt; with the above format?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;kbd &quot;&amp;lt;C-RET&amp;gt;&quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;kbd &quot;C-&amp;lt;RET&amp;gt;&quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;kbd &quot;C-RET&quot;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But none of these work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is impossible with &lt;code&gt;define-key&lt;/code&gt; and &lt;code&gt;kbd&lt;/code&gt;, is there another way to bind &lt;kbd&gt;C + RET&lt;/kbd&gt; in the mode &lt;code&gt;my-keys-mode-map&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12866" LastActivityDate="2017-11-04T23:46:56.490" Title="How can I bind C-return with define-key and kbd?" Tags="|key-bindings|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31376" PostTypeId="2" ParentId="31375" CreationDate="2017-03-10T14:31:57.457" Score="1" Body="&lt;p&gt;Does this work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-keys-mode-map (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) 'my-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More generally, try using &lt;code&gt;describe-key&lt;/code&gt; to see what Emacs &quot;sees&quot; for a given key combination. &lt;code&gt;C-h&lt;/code&gt; followed by your key sequence (control + return) gives me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;C-return&amp;gt; is undefined&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I can use &lt;code&gt;&quot;&amp;lt;C-return&amp;gt;&quot;&lt;/code&gt; as the argument for &lt;code&gt;kbd&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-10T14:31:57.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31377" PostTypeId="2" ParentId="31372" CreationDate="2017-03-10T14:42:07.153" Score="4" Body="&lt;p&gt;This is exactly the use case for the &lt;a href=&quot;https://github.com/abo-abo/hydra&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;hydra&lt;/code&gt;&lt;/a&gt; package, which you can install via &lt;code&gt;package-install&lt;/code&gt; from melpa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defhydra hydra-duplicate-line ()&#xA;  &quot;duplicate line&quot;&#xA;  (&quot;d&quot; duplicate-line nil))&#xA;&#xA;(global-set-key (kbd &quot;C-c d&quot;) 'hydra-duplicate-line/duplicate-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will bind &lt;code&gt;C-c d&lt;/code&gt; to a command that will duplicate the current line and leave in a &quot;temporary mode&quot; where pressing d will duplicate the line again, and any other key will exit the hydra and do its usual function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hydra can do lots more, but this is a good place to start!&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-10T14:42:07.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31378" PostTypeId="2" ParentId="31375" CreationDate="2017-03-10T16:10:53.980" Score="13" Body="&lt;p&gt;You need not &lt;em&gt;guess&lt;/em&gt; how Emacs represents the key sequence that corresponds to your pressing and holding the &lt;kbd&gt;Ctrl&lt;/kbd&gt; key while pressing the &lt;kbd&gt;Enter&lt;/kbd&gt; or &lt;kbd&gt;Return&lt;/kbd&gt; key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can instead ask Emacs itself to tell you. Just do &lt;code&gt;C-h k&lt;/code&gt; followed by using those keys.  In my Emacs, with my keyboard, Emacs tells me this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;C-return&amp;gt; runs the command ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I know that what I need to pass to &lt;code&gt;kbd&lt;/code&gt; is the string &lt;code&gt;&quot;&amp;lt;C-return&amp;gt;&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as @glucas says, I can use this (and you probably can too - but ask Emacs just how it sees those keys):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key my-keys-mode-map (kbd &quot;&amp;lt;C-return&amp;gt;&quot;) 'my-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-03-10T16:10:53.980" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31379" PostTypeId="2" ParentId="31372" CreationDate="2017-03-10T16:12:41.887" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;set-transient-map&lt;/code&gt;. First, make a sparse keymap with the binding you want for repetition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq duplicate-line-keymap&#xA;      (let ((map (make-sparse-keymap)))&#xA;        (define-key map (kbd &quot;d&quot;) #'my-duplicate-line)&#xA;        map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, you can make your function, and at the end, call &lt;code&gt;set-transient-map&lt;/code&gt;, and give it the keymap:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-duplicate-line ()&#xA;  (interactive)&#xA;  (duplicate-line)&#xA;  (set-transient-map duplicate-line-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, when you call &lt;code&gt;#'my-duplicate-line&lt;/code&gt;, if you press &quot;d&quot; again, it'll repeat the call to &lt;code&gt;#'my-duplicate-line&lt;/code&gt;, but if you press anything else, it'll do that behavior instead. You can put a message in the minibuffer to indicate what's going on:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-duplicate-line ()&#xA;  (interactive)&#xA;  (duplicate-line)&#xA;  (message &quot;press d to duplicate again!&quot;)&#xA;  (set-transient-map duplicate-line-keymap))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-03-10T16:12:41.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31380" PostTypeId="2" ParentId="2573" CreationDate="2017-03-10T17:21:13.280" Score="3" Body="&lt;p&gt;nowadays you would likely want to use &lt;a href=&quot;https://github.com/wbolster/emacs-direnv&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/wbolster/emacs-direnv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it works similar to the hook that direnv installs in your shell. the emacs environment is updated on request (or automatically when switching buffers) to match what direnv states is the correct environment for the current directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by modifying &lt;code&gt;exec-path&lt;/code&gt; and &lt;code&gt;process-environment&lt;/code&gt; emacs will behave like your shell would do: execute programs from the right paths and with the right environment.&lt;/p&gt;&#xA;" OwnerUserId="12785" LastEditorUserId="12785" LastEditDate="2017-03-14T10:37:41.193" LastActivityDate="2017-03-14T10:37:41.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31381" PostTypeId="2" ParentId="31364" CreationDate="2017-03-10T19:49:46.140" Score="1" Body="&lt;p&gt;Working with old .emacs.d stuff is too tiring. I've started working with &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow noreferrer&quot;&gt;Prelude&lt;/a&gt;. It is developed by the maintainer of CIDER and clojure-mode.&lt;/p&gt;&#xA;" OwnerUserId="15171" LastActivityDate="2017-03-10T19:49:46.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31382" PostTypeId="2" ParentId="31367" CreationDate="2017-03-10T21:12:41.383" Score="8" Body="&lt;p&gt;That FRAME argument to &lt;code&gt;after-make-frame-functions&lt;/code&gt; that you're explicitly ignoring? Don't ignore it.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-start-emacs (frame)&#xA;  &quot;Switch client frames of an emacs daemon to the 'server' workgroup.&quot;&#xA;  (interactive)&#xA;  (with-selected-frame frame&#xA;    (when (daemonp)&#xA;      (if (not (boundp 'server-wg))&#xA;          (progn&#xA;            (wg-create-workgroup &quot;server&quot;)&#xA;            (setq server-wg (wg-current-workgroup)))&#xA;        (setq current-wg (condition-case nil&#xA;                             (wg-current-workgroup)&#xA;                           (error nil)))&#xA;        (if (not current-wg)&#xA;            (wg-switch-to-workgroup server-wg)&#xA;          (if (not (eq current-wg server-wg))&#xA;              (wg-switch-to-workgroup server-wg)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-10T21:12:41.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31383" PostTypeId="2" ParentId="31368" CreationDate="2017-03-10T23:00:37.017" Score="11" Body="&lt;h3&gt;What to do&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You can customize the variable &lt;code&gt;evil-ex-search-case&lt;/code&gt; to tell it&#xA;what you want &lt;code&gt;evil&lt;/code&gt; to do when searching.  Here's the docstring:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;evil-ex-search-case&lt;/code&gt; is a variable defined in &lt;code&gt;evil-vars.el&lt;/code&gt;.&#xA;  Its value is smart&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The case behaviour of the search command.&#xA;  Smart case means that the pattern is case sensitive if and only&#xA;  if it contains an upper case letter, otherwise it is case&#xA;  insensitive.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can customize this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you dig into the source code, this is the variable in question:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defcustom evil-ex-search-case 'smart&#xA;  &quot;The case behaviour of the search command.&#xA;Smart case means that the pattern is case sensitive if and only&#xA;if it contains an upper case letter, otherwise it is case&#xA;insensitive.&quot;&#xA;  :type '(radio (const :tag &quot;Case sensitive.&quot; sensitive)&#xA;                (const :tag &quot;Case insensitive.&quot; insensitive)&#xA;                (const :tag &quot;Smart case.&quot; smart))&#xA;  :group 'evil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now: you can either use the &lt;code&gt;customize&lt;/code&gt; interface to choose your&#xA;option, or you could put the following in your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-ex-search-case 'sensitive)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Here's how I found this information.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;First, I asked apropos to tell me about various functions and variables related to evil searches (&lt;code&gt;M-x apropos evil search&lt;/code&gt;).  I then searched that list for mentions of &quot;case,&quot; and checked out the variable &lt;code&gt;evil-ex-search-case&lt;/code&gt;.  When that looked like the relevant variable, I followed the link in the help window to the source code to figure out what value I needed to set it to.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-03-10T23:00:37.017" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31385" PostTypeId="1" AcceptedAnswerId="31387" CreationDate="2017-03-11T01:33:36.997" Score="2" ViewCount="635" Body="&lt;p&gt;When export to html,the inline image has been overrided by inline image:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: toc:nil&#xA;#+TITLE:&#xA;#+STARTUP: showeverything &#xA;#+STARTUP: indent&#xA;#+OPTIONS: html-postamble:nil&#xA;#+HTML_HEAD: &amp;lt;style&amp;gt;pre.src {background-color: #eff0f1;width 50%;}&amp;lt;/style&amp;gt;&#xA;#+ATTR_HTML: :style border:12px solid black;float:right;&#xA;&#xA;* Unit circle&#xA;#+ATTR_HTML: &amp;lt;style&amp;gt;pre {width 50%;}&amp;lt;/style&amp;gt;&#xA;#+BEGIN_SRC gnuplot :exports both :file unitcircle.png &#xA;reset&#xA;set border lw 1.5&#xA;set style line 1 lc rgb '#0060ad' lt 1 lw 2     # --- blue&#xA;set style line 2 lc rgb '#dd181f' lt 1 lw 2     # --- red&#xA;&#xA;unset key; unset tics; unset border&#xA;set size ratio -1&#xA;set xrange [-1.2:1.2]&#xA;set yrange [-1.2:1.2]&#xA;set trange [0:2*pi]&#xA;&#xA;set parametric&#xA;&#xA;r = 1.0&#xA;h = r / sqrt(2.)&#xA;set arrow from 0,0 to h,h nohead ls 2&#xA;set label 'r' at 0.28,0.45 textcolor ls 2&#xA;&#xA;fx(t) = r*cos(t)&#xA;fy(t) = r*sin(t)&#xA;&#xA;plot fx(t),fy(t) ls 1&#xA;#+END_SRC&#xA;#+CAPTION: Fig. 1 Unitcircle&#xA;#+ATTR_HTML: :style border:2px solid red;float:right; :width:50%&#xA;#+RESULTS:&#xA;[[file:unitcircle.png]]&#xA;&#xA;* Cosine&#xA;#+BEGIN_SRC gnuplot :exports both :file cosine.png&#xA;reset &#xA;set xrange [-1*pi:1*pi]&#xA;set yrange [-1.5:1.5]&#xA;f(x) = cos(x)&#xA;g(x) = 0&#xA;plot f(x) title 'cos(x)' with lines linestyle 1, \&#xA;     g(x) notitle with lines linestyle 2&#xA;#+END_SRC&#xA;#+CAPTION: Fig. 2 cosine&#xA;#+ATTR_HTML: :style border:2px solid red;float:right; :width:50%&#xA;#+RESULTS:&#xA;[[file:cosine.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ln4Lm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ln4Lm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I wish:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The codeblock should not override the inline image.&lt;/li&gt;&#xA;&lt;li&gt;The Caption lines should float with the image (above the image exactly).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="14840" LastActivityDate="2017-03-11T19:33:46.703" Title="org mode - inline image float to right overrided by codeblock" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31386" PostTypeId="2" ParentId="31363" CreationDate="2017-03-11T02:39:16.393" Score="1" Body="&lt;p&gt;Look in the Gnus Info page &lt;strong&gt;Gnus &gt; Summary Buffer &gt; Limiting&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Limiting&lt;/em&gt; means you limit the summary buffer to just show some subset of the articles currently in the group. The particular command you are looking for is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;‘/ t’&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Ask for a number and then limit the summary buffer to articles&#xA; older than (or equal to) that number of days&#xA; (‘gnus-summary-limit-to-age’).  If given a prefix, limit to&#xA; articles younger than that number of days.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(as Arash mentioned)&lt;/p&gt;&#xA;" OwnerUserId="8558" LastActivityDate="2017-03-11T02:39:16.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31387" PostTypeId="2" ParentId="31385" CreationDate="2017-03-11T04:48:30.670" Score="2" Body="&lt;p&gt;Use CSS to customize div.org-src-container element.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: toc:nil&#xA;#+TITLE:&#xA;#+STARTUP: showeverything &#xA;#+STARTUP: indent&#xA;#+OPTIONS: html-postamble:nil&#xA;#+HTML_HEAD: &amp;lt;style type=&quot;text/css&quot;&amp;gt;div.org-src-container{border:1px solid green;width:50%;float:left;}&amp;lt;/style&amp;gt;&#xA;#+HTML_HEAD: &amp;lt;style&amp;gt;pre.src {background-color: #eff0f1;margin:0 0 0 0;}&amp;lt;/style&amp;gt;&#xA;#+HTML_HEAD: &amp;lt;style type=&quot;text/css&quot;&amp;gt;div.figure{border:1px solid green;overflow:auto;}&amp;lt;/style&amp;gt;&#xA;# #+ATTR_HTML: :style border:12px solid black;float:right;&#xA;# #+ATTR_HTML: :style border:2px solid red;float:right; :width:50%&#xA;* Unit circle&#xA;#+BEGIN_SRC gnuplot :exports both :file unitcircle.png &#xA;reset&#xA;set border lw 1.5&#xA;set style line 1 lc rgb '#0060ad' lt 1 lw 2&#xA;set style line 2 lc rgb '#dd181f' lt 1 lw 2&#xA;&#xA;unset key; unset tics; unset border&#xA;set size ratio -1&#xA;set xrange [-1.2:1.2]&#xA;set yrange [-1.2:1.2]&#xA;set trange [0:2*pi]&#xA;&#xA;set parametric&#xA;&#xA;r = 1.0&#xA;h = r / sqrt(2.)&#xA;set arrow from 0,0 to h,h nohead ls 2&#xA;set label 'r' at 0.28,0.45 textcolor ls 2&#xA;&#xA;fx(t) = r*cos(t)&#xA;fy(t) = r*sin(t)&#xA;&#xA;plot fx(t),fy(t) ls 1&#xA;#+END_SRC&#xA;#+CAPTION: Unitcircle&#xA;#+RESULTS:&#xA;[[file:unitcircle.png]]&#xA;&#xA;* Cosine&#xA;#+BEGIN_SRC gnuplot :exports both :file cosine.png&#xA;reset&#xA;unset key; unset tics; unset border &#xA;set xrange [-1*pi:1*pi]&#xA;set yrange [-1.5:1.5]&#xA;f(x) = cos(x)&#xA;g(x) = 0&#xA;plot f(x) title 'cos(x)' with lines linestyle 1, \&#xA;     g(x) notitle with lines linestyle 2&#xA;#+END_SRC&#xA;#+CAPTION: cosine&#xA;#+RESULTS:&#xA;[[file:cosine.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tLrMt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tLrMt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="14840" LastEditDate="2017-03-11T19:33:46.703" LastActivityDate="2017-03-11T19:33:46.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31388" PostTypeId="1" CreationDate="2017-03-11T05:52:03.760" Score="3" ViewCount="775" Body="&lt;p&gt;Is there an elegant way to have margin notes for &lt;code&gt;org-html-export-to-html&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, as they appear in this page: &lt;a href=&quot;https://www.cs.virginia.edu/~lat7h/blog/posts/124.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cs.virginia.edu/~lat7h/blog/posts/124.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="14743" LastActivityDate="2017-04-11T01:42:40.650" Title="How to do margin notes in org-html-export?" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31389" PostTypeId="1" CreationDate="2017-03-11T06:44:16.993" Score="4" ViewCount="188" Body="&lt;p&gt;How can I connect to remote python with &lt;code&gt;jedi.el&lt;/code&gt;? I need to use remote virtualenv for getting possible completions, docs, etc.&lt;/p&gt;&#xA;" OwnerUserId="13871" LastEditorUserId="105" LastEditDate="2017-03-11T15:19:17.277" LastActivityDate="2017-03-11T15:19:17.277" Title="How to connect to remote python with jedi.el?" Tags="|python|jedi|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31390" PostTypeId="1" CreationDate="2017-03-11T06:47:32.150" Score="2" ViewCount="1802" Body="&lt;p&gt;I want keybinding &lt;em&gt;X&lt;/em&gt; to do one thing in &lt;code&gt;c-mode&lt;/code&gt; and another thing in other modes.  I'm trying to figure out how to do this in &lt;code&gt;evil&lt;/code&gt;, specifically &lt;code&gt;evil&lt;/code&gt;'s &lt;code&gt;insert-state&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried setting the keybinding in a mode hook:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'c-mode-hook (lambda ()&#xA;                         (define-key evil-insert-state-map (kbd &quot;RET&quot;)&#xA;                           'c-indent-new-comment-line)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And left everything else defined in my init file as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key evil-insert-state-map (kbd &quot;RET&quot;) 'comment-indent-new-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the problem is that the hook does not seem to override my default keybinding.  &lt;strong&gt;How do I override a key binding in &lt;code&gt;evil&lt;/code&gt; based on a mode?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="253" LastEditDate="2017-03-11T15:07:24.473" LastActivityDate="2021-07-30T22:43:56.530" Title="How to define mode-specific keys in evil-mode?" Tags="|key-bindings|evil|" AnswerCount="1" CommentCount="0" ClosedDate="2017-03-11T15:33:30.157" ContentLicense="CC BY-SA 3.0" />
  <row Id="31391" PostTypeId="2" ParentId="31390" CreationDate="2017-03-11T07:02:37.080" Score="3" Body="&lt;p&gt;The standard way to set mode-specific keybindings in &lt;code&gt;evil&lt;/code&gt; is to use:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; default&#xA;(define-key evil-insert-state-map (kbd &amp;quot;RET&amp;quot;) 'comment-indent-new-line)&#xA;;; for other mode&#xA;(evil-define-key 'insert 'c-mode-map (kbd &amp;quot;RET&amp;quot;) 'c-indent-new-comment-line)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;N.b. &lt;code&gt;c-mode-map&lt;/code&gt; is quoted.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="35683" LastEditDate="2021-07-30T22:43:56.530" LastActivityDate="2021-07-30T22:43:56.530" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31392" PostTypeId="1" AcceptedAnswerId="35015" CreationDate="2017-03-11T07:29:36.717" Score="5" ViewCount="3998" Body="&lt;p&gt;Is it possible to syntax highlight doxygen in C/C++ code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QtCreator and Vim both support basic highlighting so &lt;code&gt;\param&lt;/code&gt;, &lt;code&gt;\note&lt;/code&gt;... etc are highlighted differently.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-08-19T23:52:57.593" LastActivityDate="2023-04-11T09:09:06.823" Title="Syntax highlight doxygen comments in C/C++? (c-doc-comment-style)" Tags="|syntax-highlighting|c|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31393" PostTypeId="1" CreationDate="2017-03-11T09:07:51.250" Score="9" ViewCount="3934" Body="&lt;p&gt;I am using the zenburn theme and my mini-buffer prompt is unreadable (image attached). Please help me. I am just learning emacs.&lt;a href=&quot;https://i.stack.imgur.com/IwnrQ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IwnrQ.png&quot; alt=&quot;Image&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15180" LastEditorUserId="105" LastEditDate="2017-03-11T15:17:47.227" LastActivityDate="2017-03-11T15:17:47.227" Title="How do I change the color of the prompt in the mini-buffer?" Tags="|faces|minibuffer|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31394" PostTypeId="1" AcceptedAnswerId="31399" CreationDate="2017-03-11T10:12:59.450" Score="0" ViewCount="40" Body="&lt;p&gt;I have installed again pabbrev and whenever I activate the mode &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I constantly get theses 2 errors.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error running timer ‘pabbrev-idle-timer-function’: (invalid-function pabbrev-debug-message)&#xA;Error running timer ‘pabbrev-short-idle-timer’: (invalid-function pabbrev-debug-message)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know that &lt;code&gt;pabbrev-debug-message&lt;/code&gt; is a macro but I cannot debug further than this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help please?&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="105" LastEditDate="2017-03-11T15:18:16.070" LastActivityDate="2017-03-11T16:53:29.230" Title="pabbrev-mode idle timer error" Tags="|debugging|idle-timer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31395" PostTypeId="2" ParentId="31393" CreationDate="2017-03-11T14:33:31.753" Score="9" Body="&lt;p&gt;It's not obvious how to find out what face it is. The usual way is to put your cursor on some text and then use &lt;code&gt;C-u&lt;/code&gt; &lt;code&gt;C-x&lt;/code&gt; &lt;code&gt;=&lt;/code&gt; but that's harder to do in the minibuffer. The other way I know of is to use &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;list-faces-display&lt;/code&gt; to see all the defined faces, and then you can look for something that has the same colors as the text you want to change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case the face you're looking for is &lt;code&gt;minibuffer-prompt&lt;/code&gt;. Try &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;customize-face&lt;/code&gt; &lt;code&gt;minibuffer-prompt&lt;/code&gt;; you can set a foreground and background color there.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-03-11T14:33:31.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31396" PostTypeId="1" AcceptedAnswerId="31397" CreationDate="2017-03-11T15:42:28.807" Score="3" ViewCount="551" Body="&lt;p&gt;Sometimes my &lt;code&gt;LocalWords&lt;/code&gt; can get very long.  In Org documents, it's awkward to have this 'appendix' of dictionary junk.  I'd like to move this to a separate file (&lt;code&gt;.dir-locals.el&lt;/code&gt; if possible).&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-03-11T15:42:28.807" Title="Can I instruct ispell to insert LocalWords in a different file?" Tags="|ispell|spell-checking|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31397" PostTypeId="2" ParentId="31396" CreationDate="2017-03-11T15:42:28.807" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;ispell-buffer-session-localwords&lt;/code&gt; for this purpose.  In your &lt;code&gt;.dir-locals.el&lt;/code&gt;, configure the variable for &lt;code&gt;org-mode&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;((org-mode&#xA;  (ispell-buffer-session-localwords&#xA;   &quot;my&quot; &quot;special&quot; &quot;words&quot; &quot;here&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-03-11T15:42:28.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31398" PostTypeId="2" ParentId="31259" CreationDate="2017-03-11T16:40:11.033" Score="0" Body="&lt;p&gt;With the help of @Felipe Lema  I've found the following function. It works well for me. But I'm not sure about the code! So please be careful if you use it! Certainly an elisp programmer would find a better solution..&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-emms-play-playlist (filename &amp;amp;optional wildcards)&#xA;  &quot;makes a new EMMS playlist buffer from the playlist of filename&quot; &#xA;  (interactive&#xA;   (find-file-read-args &quot;Find file: &quot;&#xA;                        (confirm-nonexistent-file-or-buffer)))&#xA;  (emms-playlist-new (file-name-base filename))&#xA;  (switch-to-buffer (file-name-base filename))&#xA;  (emms-playlist-set-playlist-buffer)&#xA;  (emms-play-playlist filename)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11498" LastEditorUserId="11498" LastEditDate="2017-03-11T16:55:02.403" LastActivityDate="2017-03-11T16:55:02.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31399" PostTypeId="2" ParentId="31394" CreationDate="2017-03-11T16:53:29.230" Score="1" Body="&lt;p&gt;The error means that the file was mis-compiled.  More specifically, for some reason, when the file was byte-compiled, Emacs had no knowledge about the &lt;code&gt;pabbrev-debug-message&lt;/code&gt; macro and hence assumed it must be a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How did you install pabbrev?  The 4.2.1 version on GNU ELPA doesn't seem to suffer from such a problem on my end.  I suggest you file a bug-report to the place from which you downloaded it.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-11T16:53:29.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31400" PostTypeId="2" ParentId="31364" CreationDate="2017-03-11T17:03:41.627" Score="0" Body="&lt;p&gt;For the unwashed (and those who haven't touched it in 25 years), emacs is a world unto itself. Configurations are tantamount to new products for those unsure how to navigate the customizations. Hell, every blesses line of emacs &lt;em&gt;is&lt;/em&gt; a customization. Power tools can hurt you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that, my answer is 2-fold:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;As with most software, if you're just starting and going to use a customization, make sure it ain't too old and the developer did a good job. &lt;a href=&quot;https://github.com/bbatsov/prelude&quot; rel=&quot;nofollow noreferrer&quot;&gt;Prelude&lt;/a&gt;, for example, has turned out to be a good experience once I got a vanilla emacs install.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I wouldn't use Homebrew's services facility or cask system for emacs. I love Homebrew — and this has been a rare stone in the shoe. Stick with &lt;code&gt;brew install emacs&lt;/code&gt;. Plain vanilla. Maybe others are smart enough to get the mac-centric &lt;a href=&quot;https://emacsformacosx.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://emacsformacosx.com&lt;/a&gt; to work. I can't linger longer trying.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;May our unwashedness pass quickly.&lt;/p&gt;&#xA;" OwnerUserId="15171" LastActivityDate="2017-03-11T17:03:41.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31401" PostTypeId="2" ParentId="31373" CreationDate="2017-03-11T18:08:23.030" Score="2" Body="&lt;p&gt;It doesn't look like cadabra is too much like python; but if all you wanted was python syntax highlighting without # as a comment, you can get it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(define-derived-mode cadabra-mode python-mode &quot;cadabra&quot;&#xA;  ; make #a symbol constituent&#xA;  (modify-syntax-entry ?# &quot;_&quot; cadabra-mode-syntax-table))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;+RESULTS:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;: cadabra-mode&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.emacswiki.org/emacs/EmacsSyntaxTable&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/EmacsSyntaxTable&lt;/a&gt; for more info about the syntax table.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-03-11T18:08:23.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31402" PostTypeId="1" AcceptedAnswerId="31427" CreationDate="2017-03-11T22:55:02.283" Score="11" ViewCount="2065" Body="&lt;p&gt;Even using default settings (&lt;code&gt;emacs -Q&lt;/code&gt;) I've found large C files can be slow to scroll with Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for example, I open a large file and hold &lt;kbd&gt;Page-Down&lt;/kbd&gt;. It will scroll down 1-2 pages, then hang for a second or two, on releasing the document is scrolled many pages down (20 pages or so). *&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know Emacs is capable of less erratic behavior because if I quickly tap &lt;kbd&gt;page down&lt;/kbd&gt;, it manages to keep up and doesn't hang as before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have Emacs not attempt to handle multiple events at once, and instead redraw between events?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or somehow become more responsive instead of hanging while it attempts to process many events?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;* &lt;sub&gt;The actual slow-down in this case is caused by syntax highlighting, since if I scroll the entire document once, after that all scrolling is fast. I've looked into different options relating to font locking and concluded that the font locking defaults are reasonable and tweaking them doesn't solve the problem, mentioning this since I've already investigated that and don't think it's an important part of this question.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="1979" LastEditDate="2017-08-28T14:38:11.967" LastActivityDate="2017-08-28T14:38:11.967" Title="How to avoid scrolling with large files hanging for short periods of time? (holding page keys for example)" Tags="|performance|redisplay|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31403" PostTypeId="2" ParentId="30559" CreationDate="2017-03-11T23:04:57.813" Score="8" Body="&lt;p&gt;Imagemagick version not match. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change brew install command as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;brew install emacs --with-cocoa --with-gnutls --with-dbus --with-librsvg --with-imagemagick@6 --with-mailutils --devel&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then run &lt;code&gt;brew info emacs&lt;/code&gt; to check if magicmagick is fine!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs: stable 25.1 (bottled), devel 25.2-rc2, HEAD&#xA;GNU Emacs text editor&#xA;https://www.gnu.org/software/emacs/&#xA;/usr/local/Cellar/emacs/25.2-rc2 (4,051 files, 120.1MB) *&#xA;  Built from source on 2017-03-11 at 16:56:47 with: --with-cocoa --with-gnutls --with-dbus --with-librsvg --with-imagemagick@6 --with-mailutils&#xA;From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/emacs.rb&#xA;==&amp;gt; Dependencies&#xA;Build: pkg-config ✔&#xA;Optional: dbus ✔, gnutls ✔, librsvg ✔, imagemagick@6 ✔, mailutils ✔&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If imagemagick@6 is checked, then everything should be fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In emacs, run below command to check if imagemagick package available:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*** Welcome to IELM ***  Type (describe-mode) for help.&#xA;ELISP&amp;gt; (image-type-available-p 'imagemagick)&#xA;t&#xA;ELISP&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2017-03-11T23:04:57.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31404" PostTypeId="2" ParentId="31402" CreationDate="2017-03-11T23:20:20.380" Score="2" Body="&lt;p&gt;Posting this since its a &lt;em&gt;weak&lt;/em&gt; solution but better than nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of changing all of emacs behavior its possible to write functions that force-redraw after every operation, which avoids hanging and makes scrolling more responsive for page up/down and mouse wheel.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-elisp prettyprint-override&quot;&gt;&lt;code&gt;(global-set-key [next]&#xA; (lambda () (interactive)&#xA;   (condition-case nil (scroll-up)&#xA;     (end-of-buffer (goto-char (point-max))))&#xA;   (redisplay)))&#xA;&#xA;(global-set-key [prior]&#xA; (lambda () (interactive)&#xA;   (condition-case nil (scroll-down)&#xA;     (beginning-of-buffer (goto-char (point-min))))&#xA;   (redisplay)))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-4&amp;gt;&quot;)&#xA; (lambda () (interactive) (scroll-down mouse-wheel-scroll-amount) (redisplay)))&#xA;(global-set-key (kbd &quot;&amp;lt;mouse-5&amp;gt;&quot;)&#xA; (lambda () (interactive) (scroll-up mouse-wheel-scroll-amount) (redisplay)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-08-28T05:08:54.627" LastActivityDate="2017-08-28T05:08:54.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31405" PostTypeId="1" CreationDate="2017-03-12T00:25:51.897" Score="8" ViewCount="187" Body="&lt;p&gt;Trying to debug a problem with &lt;code&gt;debug-on-error&lt;/code&gt;. Backtrace appears for a second and then some other parts of the system make it disappear and emacs becomes dysfunctional so I can never read it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get emacs to write the backtrace to a file when its generated?&lt;/p&gt;&#xA;" OwnerUserId="12337" LastEditorUserId="105" LastEditDate="2017-03-12T16:51:40.973" LastActivityDate="2017-03-12T16:51:40.973" Title="Can emacs auto-save backtrace?" Tags="|spacemacs|debugging|backtrace|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31406" PostTypeId="2" ParentId="31388" CreationDate="2017-03-12T01:17:22.180" Score="1" Body="&lt;p&gt;The link you provide looks a bit like &lt;a href=&quot;https://edwardtufte.github.io/tufte-css/&quot; rel=&quot;nofollow noreferrer&quot;&gt;tufte-css&lt;/a&gt;. You might try &lt;a href=&quot;https://github.com/dakrone/ox-tufte&quot; rel=&quot;nofollow noreferrer&quot;&gt;ox-tufte&lt;/a&gt; to get the sidenotes and the right fonts, etc. &lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2017-03-12T01:17:22.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31407" PostTypeId="2" ParentId="31405" CreationDate="2017-03-12T01:49:20.363" Score="2" Body="&lt;p&gt;Do you see the same problem when you start Emacs using &lt;code&gt;emacs -Q&lt;/code&gt; (no init file)? If not then recursively bisect your init file to find out what is causing the problem (e.g. &lt;code&gt;*Backtrace*&lt;/code&gt; seeming to disappear and Emacs becoming dysfunctional).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you still see the problem with &lt;code&gt;emacs -Q&lt;/code&gt; then consider reporting an Emacs bug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If buffer &lt;code&gt;*Backtrace*&lt;/code&gt; has not been killed then you can visit it again (&lt;code&gt;C-x b&lt;/code&gt;) and then write it to a file using &lt;code&gt;C-x C-w&lt;/code&gt;.  (Since it is not visiting a file there is no autosaving or backup file produced for the buffer.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Your question is anyway unclear in some respects. Specify what exactly you mean by &quot;emacs becomes dysfunctional&quot;, for example.]&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-03-12T01:49:20.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31408" PostTypeId="1" CreationDate="2017-03-12T02:18:41.017" Score="0" ViewCount="2834" Body="&lt;p&gt;I am a brand new emacs user and I want to be able to view snippets of LaTeX in my .org file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My OS is Ubuntu 16.04, I have installed texlive-full, and I have installed AucTex and org using the Emacs package manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been trying to follow the first example in this guide:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orgmode.org/worg/org-tutorials/org-latex-preview.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;latex preview example&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have put in my &lt;code&gt;.emacs&lt;/code&gt; file the single line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-latex-create-formula-image-program 'imagemagick)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the imagemagick package installed in Ubuntu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet when I try to see the first example by pressing &lt;code&gt;C-c C-x C-l&lt;/code&gt;, I get this error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-compile-file: File &quot;/tmp/orgtex32228nYH.pdf&quot; wasn't produced.  Please adjust 'imagemagick' part of `org-preview-latex-process-alist'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I press &lt;code&gt;C-h v&lt;/code&gt; I can inspect the variable, but I have no idea what to change...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking in &lt;code&gt;/tmp&lt;/code&gt; there is no corresponding &lt;code&gt;.log&lt;/code&gt; file, only a &lt;code&gt;.tex&lt;/code&gt; file, which doesn't reveal any error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody please help me?&lt;/p&gt;&#xA;" OwnerUserId="15185" LastEditorUserId="14825" LastEditDate="2017-03-13T14:56:33.080" LastActivityDate="2022-10-28T15:40:37.817" Title="error message when previewing latex snippet in .org file" Tags="|org-mode|auctex|" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31409" PostTypeId="2" ParentId="31358" CreationDate="2017-03-12T02:31:10.443" Score="3" Body="&lt;p&gt;Because the output has a extra tag BEGIN_LaTex/END_LaTex there, it will impact on HTML render.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;#+BEGIN_LaTeX&#xA;[[file:latex.jpg]]&#xA;#+END_LaTeX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add &lt;code&gt;:results raw file&lt;/code&gt; will remove the extra tag then the inline image will show on HTML output.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;[[file:latex.jpg]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14840" LastActivityDate="2017-03-12T02:31:10.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31411" PostTypeId="1" CreationDate="2017-03-12T09:18:33.217" Score="1" ViewCount="737" Body="&lt;p&gt;Short of building a debug version of emacs and adding break points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whats the best way to know whats happening during a 'pause' while emacs runs? &lt;em&gt;(assuming the pause is long enough to manually run an operation)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to press Ctrl-C in the terminal to get a stack trace or something similar?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2017-03-12T15:28:04.257" Title="How to troubleshoot random hangs / pauses?" Tags="|debugging|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31412" PostTypeId="1" CreationDate="2017-03-12T10:34:15.673" Score="0" ViewCount="675" Body="&lt;p&gt;I have opened a terminal using &lt;code&gt;M-x ansi-term&lt;/code&gt;.  Everything else seems to work as expected.  However, when I use the node.js repl, or the mongdb repl, or any other interactive node program, backspace rewrites the whole line like this:&#xA;    $ node&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;console&gt; consol&gt; conso&gt; cons&gt; con&gt; co&gt; c&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This also happens with interactive node js programs written with nodejs's 'readline' module.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the following versions on ubuntu:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ node --version&#xA;v6.9.1&#xA;$ emacs --version&#xA;GNU Emacs 24.5.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All other REPLs seem to work as expected. (bash, python, irb)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="15188" LastEditorUserId="105" LastEditDate="2017-03-12T16:53:35.027" LastActivityDate="2017-06-02T21:02:16.853" Title="backspace and backarrow don't work properly in node.js repl in emacs term" Tags="|key-bindings|ansi-term|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31413" PostTypeId="1" AcceptedAnswerId="31506" CreationDate="2017-03-12T10:39:12.573" Score="2" ViewCount="95" Body="&lt;p&gt;Right now, I am documenting a larger LaTeX package project by converting the files into DocStrip files.  Therefore I am currently creating a lot of &lt;code&gt;.ins&lt;/code&gt; and &lt;code&gt;.dtx&lt;/code&gt;-files in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually I am using AUCTeX, but its support for this tasks lacks a lot of the usual comfort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: in the &lt;code&gt;.ins&lt;/code&gt;-batchfiles, I very often need to insert constructs as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\generate{%&#xA;  \usepreamble\stonepreamble%&#xA;  \file{tuc-stone.sty}{%&#xA;    \from{tuc-version.dtx}{package}%&#xA;    \from{tuc-fonts.dtx}{package,tuc-stone}%&#xA;    \from{tuc-options.dtx}{default,tuc-stone}%&#xA;    \from{tuc-fonts.dtx}{tuc-stone}}%&#xA;}%  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can of course type &lt;kbd&gt;C-c&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt; to insert the macro &lt;code&gt;\file&lt;/code&gt;.  But in that case, only &lt;code&gt;\file{}&lt;/code&gt; is inserted.  As you can see, &lt;code&gt;\file&lt;/code&gt; originally uses two arguments, and I would like Emacs/AUCTeX to ask me for the file name to generate and---ideally---also to ask my from which sources and optionally guards to use, before inserting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\file{&amp;lt;filename&amp;gt;}{%&#xA;   \from{&amp;lt;sourcefile&amp;gt;}{&amp;lt;guard&amp;gt;}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as result in the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same applies to the &lt;code&gt;\generate&lt;/code&gt;-macro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't found any clues on the internet.  Are there any packages, which support this behaviour or do I need to code them myself?&lt;/p&gt;&#xA;" OwnerUserId="14190" LastActivityDate="2017-03-16T20:20:48.470" Title="DocStrip support in AUCTeX" Tags="|auctex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31414" PostTypeId="1" AcceptedAnswerId="31415" CreationDate="2017-03-12T11:14:39.717" Score="14" ViewCount="4054" Body="&lt;p&gt;Using Rust/Racer/Eldoc is causing performance problems while navigating around the file (hanging while &lt;code&gt;eldoc&lt;/code&gt; is fetching the docs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running &lt;code&gt;eldoc-mode&lt;/code&gt; reports that it's disabled but still runs Racer's &lt;code&gt;eldoc&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to globally disable &lt;code&gt;eldoc&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="253" LastEditDate="2017-03-13T15:14:52.370" LastActivityDate="2017-03-13T15:14:52.370" Title="How to globally disable eldoc?" Tags="|eldoc|" AnswerCount="1" CommentCount="0" ClosedDate="2017-03-13T15:15:09.190" ContentLicense="CC BY-SA 3.0" />
  <row Id="31415" PostTypeId="2" ParentId="31414" CreationDate="2017-03-12T11:42:26.100" Score="22" Body="&lt;p&gt;Since Emacs 25.1 a new global minor mode &lt;code&gt;global-eldoc-mode&lt;/code&gt; exists, and is enabled by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To disable it, simply add this to your init file:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(global-eldoc-mode -1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can alternatively &lt;code&gt;(setq-local eldoc-documentation-function #'ignore)&lt;/code&gt; in buffers for which you wish eldoc to have no effect, without disabling it elsewhere.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-12T11:49:00.977" LastActivityDate="2017-03-12T11:49:00.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31417" PostTypeId="1" AcceptedAnswerId="31425" CreationDate="2017-03-12T14:50:48.997" Score="2" ViewCount="859" Body="&lt;p&gt;I'm wondering if anyone knows of a way to have a function (that I can bind to a key) that pastes the current text in the clipboard as a formatted org table? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also as a bonus (since this is used to create as ingredients table for a cookbook) it would be great to be able to define the columns in advance so that the amount|type|ingredients are nicely separated. For example take this list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;3/4 cup milk&#xA;2 tablespoons white vinegar &#xA;1 cup all-purpose flour&#xA;2 tablespoons white sugar&#xA;1 teaspoon baking powder&#xA;1/2 teaspoon baking soda&#xA;1/2 teaspoon salt&#xA;1 egg&#xA;2 tablespoons butter, melted&#xA;cooking spray &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I mark this as a region and issue &lt;code&gt;org-table-create-or-convert-from-region&lt;/code&gt; this is the result&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|     3/4 | cup         | milk        |         |      |        |     |       |         |&#xA;|       2 | tablespoons | white       | vinegar | (%or | better | yet | lemon | juice%) |&#xA;|       1 | cup         | all-purpose | flour   |      |        |     |       |         |&#xA;|       2 | tablespoons | white       | sugar   |      |        |     |       |         |&#xA;|       1 | teaspoon    | baking      | powder  |      |        |     |       |         |&#xA;|     1/2 | teaspoon    | baking      | soda    |      |        |     |       |         |&#xA;|     1/2 | teaspoon    | salt        |         |      |        |     |       |         |&#xA;|       1 | egg         |             |         |      |        |     |       |         |&#xA;|       2 | tablespoons | butter,     | melted  |      |        |     |       |         |&#xA;| cooking | spray       |             |         |      |        |     |       |         |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see it got the amount (1/2) and the unit (cup) right yet the actual ingredients is cut into several columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't really know how to deal with this. Is there a more intelligent way of auto directing the conversion to split it the correct way?&lt;/p&gt;&#xA;" OwnerUserId="11387" LastEditorDisplayName="user8748" LastEditDate="2017-05-04T13:21:43.790" LastActivityDate="2017-05-04T13:21:43.790" Title="Function to paste text as a orgmode table" Tags="|org-mode|org-table|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31418" PostTypeId="2" ParentId="31411" CreationDate="2017-03-12T15:28:04.257" Score="1" Body="&lt;p&gt;&lt;code&gt;toggle-debug-on-quit&lt;/code&gt; is designed for this purpose.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(toggle-debug-on-quit &amp;amp;optional INTERACTIVELY)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Toggle whether to enter Lisp debugger when C-g is pressed.&#xA;  In an interactive call, record this option as a candidate for saving&#xA;  by &quot;Save Options&quot; in Custom buffers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When you press &lt;code&gt;C-g&lt;/code&gt; is will break the running code and display the stack trace.  From there you can examine the state of execution and cancel/resume execution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can enable/disable it by &lt;code&gt;M-x toggle-debug-on-quit&lt;/code&gt; or through the menu bar &lt;code&gt;Options &amp;gt; Enter Debugger on Quit/C-g&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-03-12T15:28:04.257" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31419" PostTypeId="1" AcceptedAnswerId="31420" CreationDate="2017-03-12T16:31:45.007" Score="1" ViewCount="274" Body="&lt;p&gt;This is a follow-up question to &lt;a href=&quot;https://emacs.stackexchange.com/q/31396/2264&quot;&gt;Can I instruct ispell to insert LocalWords in a different file?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now that I've got a way to use a separate file for my local dictionary, is there any way to move the words in my file to &lt;code&gt;.dir-locals.el&lt;/code&gt; automatically?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-03-12T16:31:45.007" Title="How can I move all my file-local LocalWords to .dir-locals.el?" Tags="|ispell|spell-checking|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31420" PostTypeId="2" ParentId="31419" CreationDate="2017-03-12T16:31:45.007" Score="1" Body="&lt;p&gt;Take these functions out for a spin and use &lt;code&gt;M-x *-ispell-move-buffer-words-to-dir-locals&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;; Adapted from ispell.el:ispell-buffer-local-words&#xA;(defun *-ispell-buffer-local-words-list ()&#xA;  (let (words)&#xA;    (or ispell-buffer-local-name&#xA;        (setq ispell-buffer-local-name (buffer-name)))&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (search-forward ispell-words-keyword nil t)&#xA;        (let ((end (point-at-eol))&#xA;              (ispell-casechars (ispell-get-casechars))&#xA;              string)&#xA;          (while (re-search-forward &quot; *\\([^ ]+\\)&quot; end t)&#xA;            (setq string (match-string-no-properties 1))&#xA;            (if (and (&amp;lt; 1 (length string))&#xA;                     (equal 0 (string-match ispell-casechars string)))&#xA;                (push string words))))))&#xA;    words))&#xA;&#xA;(defun *-ispell-move-buffer-words-to-dir-locals ()&#xA;  (interactive)&#xA;  (unless (buffer-file-name)&#xA;    (user-error &quot;buffer not attached to file&quot;))&#xA;  (let ((words (*-ispell-buffer-local-words-list)))&#xA;    (save-excursion&#xA;      (add-dir-local-variable&#xA;       major-mode&#xA;       'ispell-buffer-session-localwords&#xA;       (setq ispell-buffer-session-localwords&#xA;             (cl-remove-duplicates&#xA;              (append ispell-buffer-session-localwords words)&#xA;              :test #'string=)))&#xA;      (when (y-or-n-p &quot;Save .dir-locals.el?&quot;)&#xA;        (save-buffer))&#xA;      (bury-buffer))&#xA;    (or ispell-buffer-local-name&#xA;        (setq ispell-buffer-local-name (buffer-name)))&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (search-forward ispell-words-keyword nil t)&#xA;        (delete-region (point-at-bol) (1+ (point-at-eol)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This solution won't limit your dictionary to a single file, though; changes will apply to all buffers of the same major mode.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2017-03-12T16:31:45.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31421" PostTypeId="2" ParentId="31412" CreationDate="2017-03-12T17:54:12.443" Score="1" Body="&lt;p&gt;I've tested this in Emacs and found that when backspacing, &lt;code&gt;M-x term&lt;/code&gt; has to handle the escapes &lt;code&gt;G&lt;/code&gt; and &lt;code&gt;H&lt;/code&gt;, but only handles &lt;code&gt;H&lt;/code&gt; correctly.  I've handed in a patch to handle &lt;code&gt;G&lt;/code&gt; properly &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23303&quot; rel=&quot;nofollow noreferrer&quot;&gt;last year&lt;/a&gt;, therefore the misbehavior should not be present in Emacs 26 (which you can obtain by building from Git).&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-03-12T17:54:12.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31423" PostTypeId="1" CreationDate="2017-03-12T22:57:21.237" Score="2" ViewCount="737" Body="&lt;p&gt;I have a large set of tagged tasks in an org file and I want to shift all their dates by one week. Dates could be scheduled, deadlines, or plain dates. What is the easiest way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I attempted this using bulk actions via the agenda tag view, but I get a warning message about bulk actions not supporting tag views when I attempt to apply my custom &lt;code&gt;org-agenda-date-later 7&lt;/code&gt; function. I don't know how to do this in agenda without a tag view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2017-06-19&lt;/strong&gt;:&#xA;I have not solved this yet, but I made some headway. You can shift a date three days relative to its current value using &lt;code&gt;++3d&lt;/code&gt; in the date prompt. Agenda bulk actions does not work with this because it relies on &lt;code&gt;org-read-date&lt;/code&gt; to prompt for a new date that will be applied to ALL selected items, meaning there is no chance of the currents dates of each item to be considered. So first, that must be fixed, which will require calculating a new date per selected item. Next, bulk actions need to be added to search results. I will try to take care of these one-by-one, but will take awhile.&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="315" LastEditDate="2017-06-19T21:03:30.810" LastActivityDate="2017-06-19T21:03:30.810" Title="Shift dates in bulk using org-mode" Tags="|org-mode|org-agenda|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31424" PostTypeId="1" AcceptedAnswerId="31428" CreationDate="2017-03-12T23:20:28.807" Score="1" ViewCount="427" Body="&lt;p&gt;I want to build a ring of symbols in my init.el for the purpose of rotating themes. I could do it like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((themes '(doom-one zenburn leuven))&#xA;       (ring (make-ring (length themes))))&#xA;  (mapc (lambda (x) (ring-insert ring x))&#xA;        themes)&#xA;  (setq my-theme-ring ring))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which results in the following data-structure&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(0 3 . [doom-one zenburn leuven])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, I could build it more directly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((vector [doom-one zenburn leuven])&#xA;       (ring `(0 ,(length vector) . ,vector)))&#xA;  (setq my-theme-ring ring)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first approach goes through the ring.el public API and makes no assumptions about its implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second approach does less work, but could break if ring.el changes its implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; I can use &lt;em&gt;eval-when-compile&lt;/em&gt; to get the best of both worlds:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-theme-ring&#xA;      (eval-when-compile&#xA;        (let* ((themes '(doom-one zenburn leuven))&#xA;               (ring (make-ring (length themes))))&#xA;          (mapc (lambda (x) (ring-insert ring x))&#xA;                themes)&#xA;          ring)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or maybe even:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-when-compile&#xA;  (let* ((themes '(doom-one zenburn leuven))&#xA;         (ring (make-ring (length themes))))&#xA;    (mapc (lambda (x) (ring-insert ring x))&#xA;          themes)&#xA;    (setq my-theme-ring ring)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I compile my init file, it will iterate over the themes and add them one-by-one to the ring. When I start Emacs and load my already compiled init file, however, it will just read the already populated ring that resulted during compilation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that right? And if so, can I nest the &lt;em&gt;setq&lt;/em&gt; call within the &lt;em&gt;eval-when-compile&lt;/em&gt; body too, as I've done in the last code snippet, or can I only use the compiled result for the value it returns?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-03-13T02:29:18.027" Title="eval-when-compile: Is my understanding correct?" Tags="|compilation|eval|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31425" PostTypeId="2" ParentId="31417" CreationDate="2017-03-12T23:36:50.057" Score="1" Body="&lt;p&gt;You need something that basically parses your recipe. Here is one that seems to do what you want. You highlight the recipe ingredients and run it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun recipe-to-org (start end)&#xA;  &quot;Split an ingredient list to a table.&#xA;Column 1 is a the quantity, column two is the ingredient.&#xA;We split on spaces, then handle these cases:&#xA;&#xA;1. first word starts with a number, and the number of words is two&#xA;  1 egg&#xA;&#xA;2. The first word does not start with a number&#xA;  cooking spray&#xA;&#xA;3. Everything else.&#xA;  2 tablespoons butter, melted&#xA;&quot;&#xA;  (interactive &quot;r&quot;)&#xA;  (let* ((lines (split-string (buffer-substring-no-properties start end) &quot;\n&quot;))&#xA;     tokens&#xA;     (table&#xA;      (mapconcat&#xA;       'identity (loop for line in lines&#xA;               do&#xA;               (setq tokens (split-string line))&#xA;               collect&#xA;               (cond&#xA;                ;; 1 egg&#xA;                ((and (string-match &quot;^[0-9]&quot; (car tokens))&#xA;                  (= 2 (length tokens)))&#xA;                 (format &quot;| %s | %s |&quot; (nth 0 tokens) (nth 1 tokens)))&#xA;                ;; line not starting with a number&#xA;                ((not (string-match &quot;^[0-9]&quot; (car tokens)))&#xA;                 (format &quot;| | %s |&quot; line))&#xA;                ;; everything else.&#xA;                (t&#xA;                 (format&#xA;                  &quot;| %s | %s&quot;&#xA;                  (concat (nth 0 tokens) &quot; &quot; (nth 1 tokens))&#xA;                  (mapconcat 'identity (cddr tokens) &quot; &quot;)))))&#xA;       &quot;\n&quot;)))&#xA;&#xA;    (setf (buffer-substring start end) table)&#xA;    (org-table-align)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This converts your recipe ingredients to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| 3/4 cup       | milk              |&#xA;| 2 tablespoons | white vinegar     |&#xA;| 1 cup         | all-purpose flour |&#xA;| 2 tablespoons | white sugar       |&#xA;| 1 teaspoon    | baking powder     |&#xA;| 1/2 teaspoon  | baking soda       |&#xA;| 1/2 teaspoon  | salt              |&#xA;| 1             | egg               |&#xA;| 2 tablespoons | butter, melted    |&#xA;|               | cooking spray     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-03-12T23:36:50.057" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31427" PostTypeId="2" ParentId="31402" CreationDate="2017-03-13T02:26:27.370" Score="12" Body="&lt;p&gt;As you noticed, this basically happens when the redisplay is too slow for some reason.  There's not much we can do in the general case (when it's &quot;much too slow&quot;) but when it's &quot;just a tad bit too slow&quot; you can try one of those (or both, tho it probably doesn't do anything more than only one of the two):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq jit-lock-defer-time 0)&#xA;(setq fast-but-imprecise-scrolling t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that they're both new in Emacs-25.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-03-13T19:10:18.667" LastActivityDate="2017-03-13T19:10:18.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31428" PostTypeId="2" ParentId="31424" CreationDate="2017-03-13T02:29:18.027" Score="2" Body="&lt;p&gt;Moving the &lt;code&gt;setq&lt;/code&gt; into the &lt;code&gt;eval-when-compile&lt;/code&gt; means that the variable will be assigned during byte-compilation but not when you load &lt;code&gt;init.elc&lt;/code&gt;, so it's probably not what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, I'd recommend &lt;code&gt;(dolist (x '(doom-one zenburn leuven)) (ring-insert ring x))&lt;/code&gt; over using &lt;code&gt;mapc&lt;/code&gt;, tho it's largely a question of taste.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-13T02:29:18.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31429" PostTypeId="1" AcceptedAnswerId="31431" CreationDate="2017-03-13T03:30:23.267" Score="0" ViewCount="170" Body="&lt;p&gt;Any easy way to get forward/backword word movement with &quot;word&quot; defined as everything non-whitespace, similar to vim's W and E?&lt;/p&gt;&#xA;" OwnerUserId="12025" LastActivityDate="2017-03-13T04:13:50.453" Title="Want equivalent of vim W and E" Tags="|navigation|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31430" PostTypeId="2" ParentId="31429" CreationDate="2017-03-13T04:09:52.720" Score="1" Body="&lt;p&gt;I found (foward-whitespace) I think it's close enough.&lt;/p&gt;&#xA;" OwnerUserId="12025" LastActivityDate="2017-03-13T04:09:52.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31431" PostTypeId="2" ParentId="31429" CreationDate="2017-03-13T04:13:50.453" Score="2" Body="&lt;p&gt;I don't know exactly what vim does, but something like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;-&lt;/code&gt; and &lt;code&gt;^-&lt;/code&gt; represents whitespace syntax and non-whitespace syntax respectively.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-forward-word ()&#xA;  &quot;Forward to the end of the 'word at point' (vim-like).&quot;&#xA;  (interactive)&#xA;  (skip-syntax-forward &quot;-&quot;)&#xA;  (skip-syntax-forward &quot;^-&quot;))&#xA;&#xA;(defun my-backward-word ()&#xA;  &quot;Backward to the start of the 'word at point' (vim-like).&quot;&#xA;  (interactive)&#xA;  (skip-syntax-backward &quot;-&quot;)&#xA;  (skip-syntax-backward &quot;^-&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-13T04:13:50.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31432" PostTypeId="1" CreationDate="2017-03-13T05:29:56.397" Score="0" ViewCount="74" Body="&lt;p&gt;When Emacs starts, it reports a non-existent file is removed from recentf. However, that removal was never saved to the &lt;code&gt;recentf-save-file&lt;/code&gt;: the next time Emacs starts, the same removal is reported again. How can I ask Emacs to actually save that removal to the actual file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I'm using Emacs server and client.&lt;/p&gt;&#xA;" OwnerUserId="2755" LastActivityDate="2017-03-13T05:29:56.397" Title="recentf cleanup upon mode enabled: not saved in the actual recentf-save-file" Tags="|emacsclient|recentf|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31433" PostTypeId="5" CreationDate="2017-03-13T05:32:00.247" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-03-13T05:32:00.247" LastActivityDate="2017-03-13T05:32:00.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31434" PostTypeId="4" CreationDate="2017-03-13T05:32:00.247" Score="0" Body="`recentf-mode` is a mode that enables the &quot;Open Recent&quot; submenu, giving you quick access to files used recently, including in previous Emacs sessions. It can also be used without GUI by using the `recentf-open-files` command." OwnerUserId="2755" LastEditorUserId="105" LastEditDate="2017-03-13T14:00:30.167" LastActivityDate="2017-03-13T14:00:30.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31435" PostTypeId="1" CreationDate="2017-03-13T05:38:58.820" Score="1" ViewCount="45" Body="&lt;p&gt;Are there any popular Emacs packages that incorporate &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Generators.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;generators&lt;/a&gt; in any of their user-facing functions / API?  I'm thinking of the core Emacs lisp implementation (&lt;code&gt;iter-defun&lt;/code&gt;, &lt;code&gt;iter-yield&lt;/code&gt;, etc.), but package use of alternatives would be fair too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since generators are quite new to Emacs (only introduced in v25.1?) I'm curious about what patterns/practices have been followed in applying them on a package's surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;a href=&quot;https://github.com/Wilfred/elisp-refs&quot; rel=&quot;nofollow noreferrer&quot;&gt;elisp-refs&lt;/a&gt; I found that none of my installed packages use any Emacs core generators yet and a relatively thorough search on GitHub failed to find published package usages.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-03-13T05:38:58.820" Title="Packages with user-facing generators / generator logic?" Tags="|libraries|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31436" PostTypeId="1" AcceptedAnswerId="31441" CreationDate="2017-03-13T06:34:52.413" Score="3" ViewCount="206" Body="&lt;p&gt;Any existing package that can do incremental search inside a function definition instead of the whole buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the best I can do is to turn on &lt;code&gt;semantic-mode&lt;/code&gt; along with &lt;code&gt;semantic-stickyfunc-mode&lt;/code&gt; and carefully search within its scope. &lt;/p&gt;&#xA;" OwnerUserId="12577" LastEditorUserId="105" LastEditDate="2017-03-13T17:28:04.317" LastActivityDate="2017-03-13T17:28:04.317" Title="Limiting Emacs incremental search to a function definition" Tags="|isearch|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31438" PostTypeId="1" AcceptedAnswerId="62726" CreationDate="2017-03-13T09:15:13.097" Score="12" ViewCount="5193" Body="&lt;p&gt;Every so often I run into bugs in undo-tree, where I can't redo, with the following:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;primitive-undo: Unrecognized entry in undo list undo-tree-canary&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Links to references to this issue:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://lists.ourproject.org/pipermail/implementations-list/2014-November/002091.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bug report.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/syl20bnr/spacemacs/issues/298&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bug report.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.reddit.com/r/emacs/comments/85t95p/undo_tree_unrecognized_entry_in_undo_list/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Reddit thread&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This is &lt;strong&gt;really bad&lt;/strong&gt; and can cause loss of work if you didn't happen to save the newest version of the file.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Since I never use the branching undo tree functionality, is it possible to use emacs linear undo with evil mode?&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Note: I've tried setting &lt;code&gt;(global-undo-tree-mode -1)&lt;/code&gt; directly after &lt;code&gt;(evil-mode 1)&lt;/code&gt; which disables undo tree, but redo (Ctrl-R) doesnt work after doing this.&lt;/p&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2022-04-05T07:05:56.277" LastActivityDate="2023-07-05T00:53:16.120" Title="Possible not to use undo-tree in evil mode?" Tags="|evil|undo|undo-tree-mode|" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="31439" PostTypeId="1" AcceptedAnswerId="31481" CreationDate="2017-03-13T10:31:54.613" Score="6" ViewCount="6369" Body="&lt;p&gt;Colored syntax highlighting of code blocks in &lt;code&gt;.org&lt;/code&gt; files works well when executed through the main &lt;code&gt;init.el&lt;/code&gt; file. However, when setting up Emacs and Org-mode to publish projects &lt;strong&gt;asynchronously&lt;/strong&gt;, colored synatax highlighting is not present and only bold and underlined formatting is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following minimal example:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;init.el&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/modes/org-mode-8.2.10/lisp&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/modes/htmlize-1.6.1/&quot;)&#xA;(require 'org) &#xA;(require 'htmlize)&#xA;&#xA;(setq org-src-fontify-natively t)    &#xA;&#xA;(setq org-publish-project-alist&#xA;      '(&#xA;        (&quot;prj&quot;&#xA;         :base-directory &quot;~/tmp/org-export-test/&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;~/tmp/org-export-pub/&quot;&#xA;         :recursive t&#xA;         :publishing-function org-html-publish-to-html&#xA;         )))&#xA;&#xA;;; async export options&#xA;(setq org-export-async-debug t)&#xA;(setq org-export-async-init-file&#xA;      (expand-file-name &quot;export-async-init-file.el&quot;&#xA;            (file-name-directory user-init-file)))&#xA;&#xA;(global-set-key (kbd &quot;C-c C-8&quot;)&#xA;                (lambda () (interactive) (org-publish &quot;prj&quot;)))&#xA;;;      (lambda () (interactive) (org-publish &quot;prj&quot; :ASYNC t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;export-async-init-file.el&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'load-path &quot;~/.emacs.d/modes/org-mode-8.2.10/lisp&quot;)&#xA;(add-to-list 'load-path &quot;~/.emacs.d/modes/htmlize-1.6.1/&quot;)&#xA;(require 'org) &#xA;(require 'htmlize)&#xA;&#xA;(setq org-src-fontify-natively t)&#xA;&#xA;(setq org-export-async-debug t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Org file in the project folder&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Hello world example code:&#xA;&#xA;#+BEGIN_SRC python&#xA;def hello_world(name):&#xA;    print(name)&#xA;#+END_SRC&#xA;&#xA;The above should be colored and highlighted.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the above settings I get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uUNVs.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uUNVs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When switching on the asynchronous export however (switching the comment on the last two lines of &lt;code&gt;init.el&lt;/code&gt;), I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/U8T2O.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/U8T2O.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set up the above configuration to get color highlighting in asynchronous export as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: While I would like to make colored syntax highlighting work in Org-mode 8.2.10, I have also tried the above example with the latest Org-mode 9.0.5 and have found the same behavior.)&lt;/p&gt;&#xA;" OwnerUserId="338" LastEditorUserId="338" LastEditDate="2017-03-14T18:26:19.650" LastActivityDate="2017-11-09T17:52:05.880" Title="How to get colored syntax highlighting of code blocks in asynchronous Org-mode exports to HTML?" Tags="|org-mode|org-export|syntax-highlighting|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31440" PostTypeId="1" AcceptedAnswerId="31442" CreationDate="2017-03-13T13:07:35.010" Score="2" ViewCount="151" Body="&lt;p&gt;I see a word in buffer1. I want to look for it in buffer2.  I select the word in buffer1. I select buffer2 as my current buffer, hit &lt;code&gt;C-s&lt;/code&gt;, and press &lt;code&gt;mouse-2&lt;/code&gt; (the middle mouse button).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs converts the word to lowercase, and I can't find it...  The word has both lower and upper cases in it. How can I prevent Emacs from downcasing the search pattern?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs version 23.1.1 on RHEL 6.&lt;/p&gt;&#xA;" OwnerUserId="13534" LastEditorUserId="105" LastEditDate="2017-03-13T17:26:05.263" LastActivityDate="2017-03-13T17:26:05.263" Title="How can i keep the case when I am using select and paste to C-s input field?" Tags="|copy-paste|isearch|case-folding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31441" PostTypeId="2" ParentId="31436" CreationDate="2017-03-13T14:08:29.023" Score="3" Body="&lt;p&gt;As @xuchunyang said in a comment to your question, you can first narrow the buffer to the function definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can use library &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Isearch+&lt;/a&gt;, which lets you &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus#isearchp-restrict-to-region-flag&quot; rel=&quot;nofollow noreferrer&quot;&gt;search just the active region&lt;/a&gt;, without narrowing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-&lt;code&gt;nil&lt;/code&gt; option &lt;code&gt;isearchp-restrict-to-region-flag&lt;/code&gt; does this. You can use &lt;code&gt;C-x n&lt;/code&gt; (command &lt;code&gt;isearchp-toggle-region-restriction&lt;/code&gt;) during search to toggle this option value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, deactivation of the active region when you search is controlled by option &lt;code&gt;isearchp-deactivate-region-flag&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(NOTE: For search to be limited to the active region in &lt;em&gt;Info&lt;/em&gt;, you&#xA;must also use library &lt;a href=&quot;https://www.emacswiki.org/emacs/InfoPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Info+&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-03-13T14:08:29.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31442" PostTypeId="2" ParentId="31440" CreationDate="2017-03-13T15:27:44.280" Score="1" Body="&lt;p&gt;The relevant configuration option is &lt;code&gt;search-upper-case&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As with many things, you can find this information in Emacs itself. For example, use &lt;code&gt;C-h r&lt;/code&gt; to open the Emacs manual, and use &lt;code&gt;i&lt;/code&gt; to search the index for &lt;code&gt;isearch&lt;/code&gt;. This leads to the Incremental Search topic, which includes a section on Isearch Yank with this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Normally, when the search is case-insensitive, text yanked into the&#xA;  search string is converted to lower case, so that the search remains&#xA;  case-insensitive.  However, if the&#xA;  value of the variable ‘search-upper-case’  is other than ‘not-yanks’, that disables this down-casing.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The next logical step would be to check the documentation for the variable mentioned (&lt;code&gt;C-h v search-upper-case&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If non-nil, upper case chars disable case fold searching.&#xA;  That is, upper and lower case chars must match exactly.&#xA;  This applies no matter where the chars come from, but does not&#xA;  apply to chars in regexps that are prefixed with &lt;code&gt;\&lt;/code&gt;.&#xA;  If this value is &lt;code&gt;not-yanks&lt;/code&gt;, text yanked into the search string&#xA;  in Isearch mode is always downcased.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can customize it using &lt;code&gt;M-x customize-option search-upper-case&lt;/code&gt;.&#xA;You can also just set it in your init file: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq search-upper-case t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="105" LastEditDate="2017-03-13T17:22:54.137" LastActivityDate="2017-03-13T17:22:54.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31444" PostTypeId="2" ParentId="31402" CreationDate="2017-03-13T17:54:32.027" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;One thing you can do is to pass a numeric prefix argument to the scroll command, instead of just pressing and holding down its key to invoke it repeatedly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you are using the &lt;code&gt;&amp;lt;next&amp;gt;&lt;/code&gt; key (aka &lt;code&gt;PageDown&lt;/code&gt;) then the command it invokes is &lt;code&gt;scroll-up-command&lt;/code&gt;.  And &lt;code&gt;C-h f scroll-up-command&lt;/code&gt; tells you that a numeric prefix arg says to scroll that many lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: Suppose that your buffer has 50,000 lines and the cursor is at the top of it (on the first line). If you do &lt;code&gt;C-u 25000 &amp;lt;next&amp;gt;&lt;/code&gt; then it will scroll half-way down the buffer (25,000 lines).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There will still be a pause, but it will be somewhat shorter.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another possibility is to move down by a certain number of large Emacs thingies.  If your buffer separates sections of text using &lt;code&gt;^L&lt;/code&gt; (Control-L, form-feed) characters then you can use the page-navigation commands, such as &lt;code&gt;forward-page&lt;/code&gt;, which is bound to &lt;strong&gt;&lt;code&gt;C-x ]&lt;/code&gt;&lt;/strong&gt;. Again, you can pass it a numeric prefix argument, to move forward that many pages at once.  If there are no &lt;code&gt;^L&lt;/code&gt; chars you can use &lt;code&gt;forward-paragraph&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;C-&amp;lt;down&amp;gt;&lt;/code&gt;&lt;/strong&gt;) or &lt;code&gt;forward-line&lt;/code&gt; or another motion command with a prefix arg.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Similarly, you can use command &lt;code&gt;goto-line&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;M-g M-g&lt;/code&gt;&lt;/strong&gt;) to go to a particular line number. (Pick a large number.)  Command &lt;code&gt;what-line&lt;/code&gt; tells you what the current line number is (you can also have it displayed in the mode-line).  (&lt;code&gt;M-&amp;gt;&lt;/code&gt; takes you to the end of the buffer, where &lt;code&gt;M-x what-line&lt;/code&gt; will tell you how many lines there are altogether.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(Added after your comment about skimming until you see this or that.) Use incremental search for navigation. Search forward for something near where you want to scroll, using either &lt;code&gt;C-s&lt;/code&gt; or (for regexp search) &lt;code&gt;C-M-s&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use library &lt;a href=&quot;https://www.emacswiki.org/emacs/IsearchPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Isearch+&lt;/a&gt; then you can also incorporate &lt;a href=&quot;https://www.emacswiki.org/emacs/DynamicIsearchFiltering&quot; rel=&quot;nofollow noreferrer&quot;&gt;arbitrary &lt;em&gt;predicates&lt;/em&gt;&lt;/a&gt; into your search, on the fly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, you need not search using only pattern matching. You could, for example, search to (1) match a pattern that selects a whole comment block or a complete &lt;code&gt;switch&lt;/code&gt; statement, and (2) require that the match have a certain size (number of chars).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isearch+ also lets you search for matches to multiple patterns or search for a match to one pattern within a given distance to (&quot;near&quot;) a match for another pattern (where the distance is measured in chars, words, sexps, lists, sentences...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-03-13T19:52:33.443" LastActivityDate="2017-03-13T19:52:33.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31445" PostTypeId="1" AcceptedAnswerId="31447" CreationDate="2017-03-13T19:29:07.100" Score="2" ViewCount="407" Body="&lt;p&gt;Is there a way to programmatically determine whether a given unicode character will render as tofu in some context in Emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some bug-flavored (U+1F41B) tofu renders in a face using DejaVu Sans Mono:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ayazN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ayazN.png&quot; alt=&quot;helm-unicode display of U+1F41B&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-03-14T13:54:46.733" Title="Programmatically check whether a unicode character will render as tofu" Tags="|unicode|rendering|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31446" PostTypeId="2" ParentId="13133" CreationDate="2017-03-13T20:20:47.347" Score="3" Body="&lt;p&gt;i had to fiddle with it for a while, but here's a working version of Gilles's answer. just stuff this at the end of your &lt;code&gt;~/.config/fish/config.fish&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# emacs dir tracking&#xA;if [ -n &quot;$INSIDE_EMACS&quot; ]&#xA;  function prompt_AnSiT -e fish_prompt&#xA;    printf &quot;\eAnSiTc %s\n&quot; &quot;$PWD&quot;&#xA;  end&#xA;  printf &quot;\eAnSiTu %s\n&quot; &quot;$USER&quot;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the relevant differences are... &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;this uses the &lt;code&gt;$INSIDE_EMACS&lt;/code&gt; variable being set, instead of relying on the value of &lt;code&gt;$TERM&lt;/code&gt;. either approach should work unless you've configured emacs to mimic some other terminal, in which case this should still work, but the other version won't. up to you which you want to use.&lt;/li&gt;&#xA;&lt;li&gt;this also prints an escape code of your current user which is what i'm assuming was causing the earlier TRAMP error. you'll notice the string it's complaining about has a host but lacks a username.&lt;/li&gt;&#xA;&lt;li&gt;you gotta have a space between the escape character and the value.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15200" LastEditorUserId="15200" LastEditDate="2017-07-05T19:55:49.470" LastActivityDate="2017-07-05T19:55:49.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31447" PostTypeId="2" ParentId="31445" CreationDate="2017-03-13T20:24:24.517" Score="1" Body="&lt;p&gt;Like Tianxiang said this is a question of the font being used. Emacs still allows some introspection in that respect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;internal-char-font&lt;/code&gt; function allows you to see if a character is defined in the current font. There is a comment describing the function in &lt;code&gt;font.c&lt;/code&gt;. It says&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;It returns nil in the following cases:&#xA;   (1) The window system doesn't have a font for the character (thus&#xA;   it is displayed by an empty box).&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means that you can do something like: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(internal-char-font nil (string-to-char &quot;\u0034&quot;))&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;to see if the character represented by &quot;\u0034&quot; has a character in the current font&lt;/p&gt;&#xA;" OwnerUserId="11272" LastActivityDate="2017-03-13T20:24:24.517" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31448" PostTypeId="1" AcceptedAnswerId="31450" CreationDate="2017-03-13T20:28:28.670" Score="8" ViewCount="1182" Body="&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; how do I get only the duplicate elements in a list?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;delete-dups&lt;/code&gt; (and &lt;code&gt;cl-delete-duplicates&lt;/code&gt;) &lt;em&gt;deletes&lt;/em&gt; all duplicate&#xA;elements from a list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(delete-dups '(a b c c d d))            ; =&amp;gt; '(a b c d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want the reverse: is there a function that returns &lt;em&gt;only&lt;/em&gt; the&#xA;duplicates in a list?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(mystery-function '(a b c c d d))       ; =&amp;gt; '(c d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastEditorUserId="105" LastEditDate="2017-03-13T22:27:07.163" LastActivityDate="2019-10-08T22:59:38.093" Title="Report duplicates in a list?" Tags="|list|" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31449" PostTypeId="2" ParentId="31448" CreationDate="2017-03-13T20:55:05.980" Score="7" Body="&lt;p&gt;Using dash:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun find-duplicates (list)&#xA;  &quot;Return a list that contains each element from LIST that occurs more than once.&quot;&#xA;  (--&amp;gt; list&#xA;       (-group-by #'identity it)&#xA;       (-filter (lambda (ele) (&amp;gt; (length ele) 2)) it)&#xA;       (mapcar #'car it)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A quick test suite:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ert-deftest nothing ()&#xA;  (should-not (find-duplicates '())))&#xA;&#xA;(ert-deftest no-duplicates ()&#xA;  (should-not (find-duplicates '(1 2 3 4 5 6 7 &quot;eight&quot;))))&#xA;&#xA;(ert-deftest single-duplicate ()&#xA;  (should (equal (find-duplicates '(1 2 3 4 1))&#xA;                 '(1))))&#xA;&#xA;(ert-deftest multiple-duplicates ()&#xA;  (should (equal (sort (find-duplicates '(1 2 3 4 1 6 7 8 9 2))&#xA;                       #'&amp;lt;)&#xA;                 '(1 2))))&#xA;&#xA;(ert-deftest string-duplicates ()&#xA;  (should (equal (find-duplicates '(1 2 &quot;three&quot; 4 &quot;three&quot;))&#xA;                 '(&quot;three&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It currently seems to return the items in the order of the first occurrence of each duplicate, but I don't see anything in &lt;code&gt;-group-by&lt;/code&gt; that guarantees that, so I don't think that can be relied on. It could possibly be more efficient, using hashtables, but this works.&lt;/p&gt;&#xA;" OwnerUserId="97" LastEditorUserId="97" LastEditDate="2017-03-13T21:10:09.993" LastActivityDate="2017-03-13T21:10:09.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31450" PostTypeId="2" ParentId="31448" CreationDate="2017-03-13T20:55:22.630" Score="6" Body="&lt;p&gt;I think the easiest way is to use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;hash tables&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun get-duplicates (list &amp;amp;optional test)&#xA;  (let ((ht (make-hash-table :test (or test #'equal))) &#xA;        ret)&#xA;    (dolist (x list)&#xA;      (incf (gethash x ht 0)))&#xA;    (maphash (lambda (key value)&#xA;               (when (&amp;gt; value 1)&#xA;                 (push key ret)))&#xA;             ht)&#xA;    ret))&#xA;(get-duplicates '(a 2 a b 3 2))&#xA;==&amp;gt; (2 a)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2017-03-13T21:16:23.160" LastActivityDate="2017-03-13T21:16:23.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31451" PostTypeId="1" CreationDate="2017-03-13T21:09:29.713" Score="3" ViewCount="526" Body="&lt;p&gt;Sometimes I use &lt;code&gt;ansi-term&lt;/code&gt; in emacsclient instead of directly using my shell. When I do this, it is not an infrequent occurrence that I forget where I am and call &lt;code&gt;emacsclient someFile&lt;/code&gt;, which freezes the terminal window and doesn't let me start a new emacsclient process. Is there a way to make invocations of emacsclient in &lt;code&gt;ansi-term&lt;/code&gt; instead open the file? Or some other way to unfreeze this? The only solution I have found is to &lt;code&gt;kill&lt;/code&gt; the server process.&lt;/p&gt;&#xA;" OwnerUserId="10211" LastEditorUserId="10211" LastEditDate="2017-03-14T22:51:11.103" LastActivityDate="2023-12-11T01:02:40.397" Title="Calling emacsclient from ansi-term makes emacsclient hang, how do I get around this?" Tags="|emacsclient|ansi-term|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31452" PostTypeId="2" ParentId="31451" CreationDate="2017-03-13T21:33:38.490" Score="0" Body="&lt;p&gt;It looks like &lt;code&gt;ansi-term&lt;/code&gt; sets the &lt;code&gt;TERM&lt;/code&gt; environment variable to &lt;code&gt;eterm&lt;/code&gt;, possibly extended to &lt;code&gt;eterm-color&lt;/code&gt; or similar. You can use this to define &lt;code&gt;emacs&lt;/code&gt; to an appropriate alias whenever you're already in &lt;code&gt;ansi-term&lt;/code&gt; inside emacs. Something like this in your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;case &quot;$TERM&quot; in &#xA;     eterm*)&#xA;         alias emacs=emacsclient&#xA;         ;;&#xA;     *)&#xA;         ## code to run for non-eterm shells&#xA;         ;;&#xA;esac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If that doesn't work, another option is the environment variable &lt;code&gt;INSIDE_EMACS&lt;/code&gt;, which is set to &lt;code&gt;&amp;lt;emacs version&amp;gt;,term&amp;lt;term version&amp;gt;&lt;/code&gt;. Note that &lt;code&gt;shell-mode&lt;/code&gt; sets this to &lt;code&gt;&amp;lt;emacs version&amp;gt;,comint&lt;/code&gt;, so if you use both you'll want to distinguish between them with your test:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;case &quot;$INSIDE_EMACS&quot; in &#xA;     *term*)&#xA;         alias emacs=emacsclient&#xA;         ;;&#xA;     *comint*)&#xA;         ## code to run for shell-mode&#xA;         ;;&#xA;     *)&#xA;         ## code for non-emacs shells&#xA;esac&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-03-14T02:45:43.010" LastActivityDate="2017-03-14T02:45:43.010" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31454" PostTypeId="1" AcceptedAnswerId="32374" CreationDate="2017-03-13T23:43:41.917" Score="5" ViewCount="1807" Body="&lt;p&gt;When I copy line three below in evil-mode &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function foo() {&#xA;}&#xA;var bar; #copy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and paste it at line two, I get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function foo() {&#xA;var bar; #paste&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of the correctly indented&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function foo() {&#xA;  var bar; #paste&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to automatically indent my newly-pasted lines of code, and in vim, the fix for this is to remap the &lt;code&gt;p&lt;/code&gt; key to &quot;nnoremap gp p`[v`]=&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured that I could use the following in my &lt;code&gt;init.el&lt;/code&gt; file to replicate the behaviour:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(fset 'paste-and-indent&#xA;  &quot;p`[v`]=&quot;)&#xA;(define-key evil-normal-state-map (kbd &quot;p&quot;) 'paste-and-indent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I try to use the code, upon pressing &lt;code&gt;p&lt;/code&gt; I get &lt;code&gt;&quot;After 0 kbd macro iterations: Lisp nesting exceeds 'max-lisp-eval-depth'.&quot;&lt;/code&gt; I'm confused by this, as &lt;code&gt;max-lisp-eval-depth&lt;/code&gt; is set to &lt;code&gt;800&lt;/code&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone offer advice on how to implement this behaviour in evil-mode emacs?&lt;/p&gt;&#xA;" OwnerUserId="14499" LastEditorUserId="14499" LastEditDate="2017-03-13T23:52:26.983" LastActivityDate="2023-08-29T14:27:10.073" Title="Evil mode: How to run evil-indent on the text I've just pasted" Tags="|evil|copy-paste|keyboard-macros|vim-emulation|" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31455" PostTypeId="2" ParentId="31454" CreationDate="2017-03-14T00:20:29.937" Score="-1" Body="&lt;p&gt;Your solution failed because it has unbounded recursion; the first thing it does is call whatever is bound to the &quot;p&quot; key, which is itself. Try something like this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun paste-and-indent ()&#xA;  (interactive)&#xA;  (evil-paste-after 0)&#xA;  (indent-region))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9982" LastEditorUserId="9982" LastEditDate="2017-03-14T00:30:31.883" LastActivityDate="2017-03-14T00:30:31.883" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31456" PostTypeId="2" ParentId="26673" CreationDate="2017-03-14T03:27:14.413" Score="0" Body="&lt;p&gt;This seems to work for me.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun vc-annotate-revision-next-to-line ()&#xA;  &quot;Visit the annotation of the revision after the revision at line.&#xA;This is the dual to `vc-annotate-revision-previous-to-line'.&quot;&#xA;  (interactive)&#xA;  (if (not (equal major-mode 'vc-annotate-mode))&#xA;  (message &quot;Cannot be invoked outside of a vc annotate buffer&quot;)&#xA;(let* ((rev-at-line (vc-annotate-extract-revision-at-line))&#xA;       (next-rev nil)&#xA;       (rev (car rev-at-line))&#xA;       (fname (cdr rev-at-line)))&#xA;  (if (not rev-at-line)&#xA;      (message &quot;Cannot extract revision number from the current line&quot;)&#xA;    (setq next-rev&#xA;      (vc-call-backend vc-annotate-backend 'next-revision&#xA;               fname rev))&#xA;    (vc-annotate-warp-revision next-rev fname)))))&#xA;;; vc-annotate-revision-previous-to-line is bound to &quot;a&quot;; use &quot;e&quot; for symmetry.&#xA;(eval-after-load &quot;vc-annotate&quot;&#xA;  '(define-key vc-annotate-mode-map &quot;e&quot; 'vc-annotate-revision-next-to-line))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9799" LastEditorUserId="9799" LastEditDate="2017-03-14T04:53:21.913" LastActivityDate="2017-03-14T04:53:21.913" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31457" PostTypeId="1" AcceptedAnswerId="31464" CreationDate="2017-03-14T11:18:45.910" Score="1" ViewCount="474" Body="&lt;p&gt;I had set up an Agenda view for showing today's tasks and TODOs with tags &quot;UPCOMING&quot; or &quot;PROJECT&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;       '((&quot;w&quot; &quot;Agenda + TODOs&quot;&#xA;          ((agenda &quot;&quot; ((org-agenda-ndays 1)))&#xA;           (tags-todo &quot;UPCOMING&quot;)&#xA;           (tags-todo &quot;PROJECT&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, after updating org-mode yesterday, it still works fine, but instead of showing just today's tasks, it shows the entire week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea what might have caused this?&lt;/p&gt;&#xA;" OwnerUserId="12446" LastActivityDate="2017-03-14T15:14:04.597" Title="Changes in org-agenda-custom-commands?" Tags="|org-mode|org-agenda|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31458" PostTypeId="2" ParentId="20199" CreationDate="2017-03-14T11:38:56.823" Score="1" Body="&lt;p&gt;The problem went away after I have updated to GNU Emacs 25.1.1 (x86_64-w64-mingw32)&lt;/p&gt;&#xA;" OwnerUserId="10128" LastActivityDate="2017-03-14T11:38:56.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31459" PostTypeId="1" AcceptedAnswerId="31461" CreationDate="2017-03-14T13:44:20.360" Score="2" ViewCount="178" Body="&lt;p&gt;How can I navigate to a certain paragraph number?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to move to the 33rd &lt;em&gt;line&lt;/em&gt; in a file, I execute &lt;code&gt;M-x goto-line &amp;lt;RET&amp;gt; 33&lt;/code&gt;, but there does not seem to be an equivalent &lt;code&gt;goto-paragraph&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could write a function to do this for me (i.e. go to beginning of file, then execute &lt;code&gt;forward-paragraph&lt;/code&gt; X number of times), but I am wondering if there is a built-in function for this already.&lt;/p&gt;&#xA;" OwnerUserId="12866" LastActivityDate="2017-03-17T00:41:53.310" Title="Navigate to a certain paragraph number" Tags="|navigation|paragraphs|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31460" PostTypeId="2" ParentId="31445" CreationDate="2017-03-14T13:54:46.733" Score="2" Body="&lt;p&gt;The function &lt;code&gt;char-displayable-p&lt;/code&gt; was added for that kind of purpose, but I'm not sure it does what it purports to in all cases.  If it doesn't work for you, please report it as a bug.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-14T13:54:46.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31461" PostTypeId="2" ParentId="31459" CreationDate="2017-03-14T14:16:28.793" Score="5" Body="&lt;p&gt;I'm not aware of a built-in function for this, but as you already noted you can write one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun goto-paragraph (arg)&#xA;  &quot;Go to paragraph ARG.&quot;&#xA;  (interactive &quot;nGoto paragraph: &quot;)&#xA;  (goto-char (point-min))&#xA;  (forward-paragraph arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-14T18:01:26.787" LastActivityDate="2017-03-14T18:01:26.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31462" PostTypeId="1" AcceptedAnswerId="31463" CreationDate="2017-03-14T14:38:05.093" Score="0" ViewCount="94" Body="&lt;p&gt;How would you bind the useless œ (or 2-square) key from azerty keywords to enter ` (backtick, backquote, or however you want to call the symbol needed for code blocks in markdown) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problems are : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am not sure know how to express this key as a (kbd ...) form&lt;/li&gt;&#xA;&lt;li&gt;I don't know how to express &quot;insert this char&quot;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This does &lt;em&gt;NOT&lt;/em&gt; work : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;œ&quot;) (lambda () (insert &quot;`&quot;)))&#xA;(global-set-key (kbd &quot;œ&quot;) '(lambda () (insert &quot;`&quot;)))&#xA;(global-set-key (kbd &quot;œ&quot;) '(insert &quot;`&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6920" LastActivityDate="2017-03-14T14:56:07.177" Title="Bind 'œ' key to '`'" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31463" PostTypeId="2" ParentId="31462" CreationDate="2017-03-14T14:56:07.177" Score="0" Body="&lt;p&gt;You can find out which key Emacs thinks œ is by hitting &lt;code&gt;C-h k œ&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you want a key simply to enter a string, you can just tell&#xA;it to do so without invoking a function.  Hence, this binding&#xA;should work, assuming the &quot;œ&quot; part is correct:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;œ&quot; &quot;`&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may have to replace the &quot;œ&quot; part with whatever Emacs thinks that key is.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-03-14T14:56:07.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31464" PostTypeId="2" ParentId="31457" CreationDate="2017-03-14T15:14:04.597" Score="3" Body="&lt;p&gt;Depending on which version you upgraded to, you might find that &lt;code&gt;org-agenda-ndays&lt;/code&gt; does not exist any longer. Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-agenda-custom-commands&#xA;   '((&quot;w&quot; &quot;Agenda + TODOs&quot;&#xA;      ((agenda &quot;&quot; ((org-agenda-span (quote day))))&#xA;       (tags-todo &quot;UPCOMING&quot;)&#xA;       (tags-todo &quot;PROJECT&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastActivityDate="2017-03-14T15:14:04.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31465" PostTypeId="2" ParentId="31448" CreationDate="2017-03-14T15:19:44.380" Score="3" Body="&lt;p&gt;Here is a non-hash version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;(defun find-duplicates (list)&#xA;  (loop for (item . count) in (let ((counts '())&#xA;                    place)&#xA;                (dolist (el list)&#xA;                  (setq place (assoc el counts))&#xA;                  (if place&#xA;                      (incf (cdr place))&#xA;                    (push (cons el 1) counts)))&#xA;                counts)&#xA;    if (&amp;gt; count 1)&#xA;    collect item))&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-03-14T15:19:44.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31466" PostTypeId="1" AcceptedAnswerId="31467" CreationDate="2017-03-14T17:00:37.820" Score="6" ViewCount="8280" Body="&lt;p&gt;I'm trying to customize my todos a bit. Currently, I use different categories for my todos as such:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO customize colors of categories&#xA;  :CATEGORY: emacs&#xA;* TODO get groceries&#xA;  :CATEGORY: errands&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then when I view my todos via &lt;code&gt;C-c a t&lt;/code&gt;, I get a listing of my todos. I have them sorted via category, using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Global agenda: sort todos by category&#xA;(setq org-agenda-sorting-strategy&#xA;      '((agenda category-up)&#xA;        (todo priority-down category-up)&#xA;        (tags priority-down category-keep)&#xA;        (search category-keep)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I would like each category todo to appear in a different color. Alternatively, an easier solution for me might be to put a line break between each section of categories. I don't know how to do either these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I'm at it, is there a better way to organize my todos, or is :CATEGORY: the way to go?&lt;/p&gt;&#xA;" OwnerUserId="11887" LastActivityDate="2017-03-14T18:44:19.780" Title="All todos: how to set different colors for different categories?" Tags="|org-mode|todo|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31467" PostTypeId="2" ParentId="31466" CreationDate="2017-03-14T17:37:14.233" Score="10" Body="&lt;p&gt;I prefer to use sub todos inside of a larger parent todo, instead of using categories. E.g:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Write Tutorial [0/2]&#xA;** TODO Create Outline&#xA;** TODO Collect Data&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then as I complete them I can see how close the larger parent todo is to being completed. Simply adding [/] to the end of the parent and C-c C-c to initialize it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is how I color my sequence of todos:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-todo-keywords&#xA;  '(&#xA;(sequence &quot;TODO&quot; &quot;DOING&quot; &quot;|&quot; &quot;DELEGATED&quot; &quot;POSTPONED&quot; &quot;DONE&quot; &quot;CANCELED&quot;)&#xA;(sequence &quot;SENT&quot; &quot;APPROVED&quot; &quot;|&quot; &quot;PAID&quot;)&#xA;))&#xA;&#xA;(setq org-todo-keyword-faces&#xA;  '((&quot;TODO&quot; . (:foreground &quot;#ff39a3&quot; :weight bold))&#xA;(&quot;STARTED&quot; . &quot;#E35DBF&quot;)&#xA;(&quot;CANCELED&quot; . (:foreground &quot;white&quot; :background &quot;#4d4d4d&quot; :weight bold))&#xA;(&quot;DELEGATED&quot; . &quot;pink&quot;)&#xA;(&quot;POSTPONED&quot; . &quot;#008080&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15208" LastActivityDate="2017-03-14T17:37:14.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31468" PostTypeId="2" ParentId="31466" CreationDate="2017-03-14T18:31:32.407" Score="3" Body="&lt;p&gt;Org does not have built-in support for assigning faces (colors, etc) to specific categories. You can assign colors to specific TODO keywords (&lt;code&gt;org-todo-keyword-faces&lt;/code&gt;) or to specific tags (&lt;code&gt;org-tag-faces&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to look at &lt;code&gt;org-agenda-category-icon-alist&lt;/code&gt;, which lets you associate an icon with a category. (I've never used this, but found it in the customization options. Try &lt;code&gt;M-x customize-group org-agenda-line-format&lt;/code&gt; to find more options.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be able to use a general mechanism such as &lt;code&gt;highlight-lines-matching-regexp&lt;/code&gt; and set things up to enable &lt;code&gt;hi-lock-mode&lt;/code&gt; and set your patterns / faces in your agenda buffers. That's not related to org, just matching text patterns and applying a specific face. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sticking with org features: tags might be an alternative, depending on your workflow. Tags can still be used to sort or filter an agenda view, have configurable faces, and you can put multiple tags on a single todo item. You can easily filter an agenda view by tags (default binding &lt;code&gt;/&lt;/code&gt;). You can customize &lt;code&gt;org-agenda-prefix-format&lt;/code&gt; if you want e.g. to replace the category with tag info in the agenda line prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As suggested in another answer you can also define headings for your different categories, and put todo items under them. The org features around capture and refile are useful here: you can have an inbox file where you collect todos and then refile them in to suitable sub-headings later. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-14T18:44:19.780" LastActivityDate="2017-03-14T18:44:19.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31469" PostTypeId="1" AcceptedAnswerId="31470" CreationDate="2017-03-14T19:14:38.957" Score="3" ViewCount="807" Body="&lt;p&gt;It seems to me that org-capture requires templates to start with a heading (*). Can I not have a template like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;d&quot; &quot;Daily Tasks&quot; entry (file+datetree+prompt &quot;daily.org&quot;)&#xA;     &quot;- [ ] %?&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that does not start with a *.&lt;/p&gt;&#xA;" OwnerUserId="15210" LastActivityDate="2017-03-14T19:28:17.777" Title="Can I create a checklist entry using org-capture?" Tags="|org-mode|org-capture|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31470" PostTypeId="2" ParentId="31469" CreationDate="2017-03-14T19:28:17.777" Score="4" Body="&lt;p&gt;You have to change the third element the template (&quot;entry type&quot;).  From the help:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;type         The type of entry.  Valid types are:&#xA;               entry       an Org node, with a headline.  Will be filed&#xA;                           as the child of the target entry or as a&#xA;                           top-level entry.&#xA;               item        a plain list item, will be placed in the&#xA;                           first plain list at the target&#xA;                           location.&#xA;               checkitem   a checkbox item.  This differs from the&#xA;                           plain list item only is so far as it uses a&#xA;                           different default template.&#xA;               table-line  a new line in the first table at target location.&#xA;               plain       text to be inserted as it is.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For a checkbox you want &lt;code&gt;checkitem&lt;/code&gt; instead of &lt;code&gt;entry&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2017-03-14T19:28:17.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31471" PostTypeId="1" CreationDate="2017-03-14T20:01:00.120" Score="1" ViewCount="170" Body="&lt;p&gt;When I'm editing my code, I'd like to open the documentation via &lt;code&gt;helm-dash-at-point&lt;/code&gt; in a new split besides my source code. But it only opens in the same window. I don't really care if it uses &lt;code&gt;eww&lt;/code&gt; or &lt;code&gt;w3m&lt;/code&gt; as long as it works (eww would be slightly better).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the latest Spacemacs with the newest Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(There are a couple of solutions that are supposed to work with Emacs proper but don't with Spacemacs)&lt;/p&gt;&#xA;" OwnerUserId="11347" LastActivityDate="2017-03-14T20:01:00.120" Title="Open helm-dash in emacs in a new window" Tags="|helm|spacemacs|dash.el|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31472" PostTypeId="1" AcceptedAnswerId="31477" CreationDate="2017-03-14T20:05:34.500" Score="0" ViewCount="54" Body="&lt;p&gt;I am trying to install a newer version (2.3.1) of Tramp than is currently running with my Emacs. When I run &lt;code&gt;./configure&lt;/code&gt; in &lt;code&gt;tramp&lt;/code&gt; ala the instructions &lt;a href=&quot;https://www.gnu.org/software/tramp/#Installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, I get the error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; checking for 24.5.1... no&#xA; configure: error: no not found&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My understanding is that somehow the script is able to see the version of my emacs (I confirmed this is the correct version) but is not able to find the Emacs folder/binary - not sure if that is exactly it as the configure script is quite large and complicated. What steps should I take to fix this?&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2017-03-15T11:58:54.057" Title="Tramp configure can't find Emacs" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31473" PostTypeId="1" CreationDate="2017-03-15T00:13:35.793" Score="2" ViewCount="165" Body="&lt;p&gt;I'm writing a lot of Markdown for input to pandoc, so my files contain a lot of Unicode non-breaking spaces (U+00A0).  I'd like those to search as whitespace with &lt;code&gt;isearch-forward&lt;/code&gt;, so I tried adding the character to my &lt;code&gt;search-whitespace-regexp&lt;/code&gt; variable.  But it doesn't work.  I suspect there might be a UTF-8 issue somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set (make-local-variable 'search-whitespace-regexp)&#xA; &quot;[ \t\r\n\f~\u00a0]+&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I've also tried just hard-coding the character between the square brackets.  Neither works.  By contrast, I can search the &lt;code&gt;~&lt;/code&gt; character as white space just fine---so I know something is working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I persuade Emacs that the U+00A0 should be accepted as a space character, for purposes of search?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running Emacs 24.5, a stock Emacs from Debian jessie.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edited to add&lt;/strong&gt;: following a comment from steveooo, I've determined that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x eval (search-forward-regexp &quot;cise[ \t\r\n\f~\u00a0]6&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;correctly finds the string I'm looking for, but &lt;code&gt;isearch-forward&lt;/code&gt; still does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edited to add&lt;/strong&gt;: In Emacs 25, nothing seems to have changed.&lt;/p&gt;&#xA;" OwnerUserId="9343" LastEditorUserId="9343" LastEditDate="2017-07-08T16:53:03.957" LastActivityDate="2017-07-08T16:53:03.957" Title="How can I define `search-whitespace-regexp` so it accepts a Unicode &quot;no-break space&quot;?" Tags="|whitespace|isearch|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31475" PostTypeId="1" CreationDate="2017-03-15T04:41:22.317" Score="3" ViewCount="6470" Body="&lt;p&gt;I've been able to partially modify how emacs highlights syntax of python files. For example I find highlighting the definition of variable to be disturbing and I've done this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(font-lock-constant-face ((t (:foreground &quot;#2aa198&quot; :weight normal))))&#xA; '(font-lock-keyword-face ((t (:foreground &quot;#859900&quot; :weight normal))))&#xA; '(font-lock-variable-name-face ((t (:foreground &quot;#839496&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'd also like imports to be highlighted with different color, stop highlighting &quot;sys.exit()&quot; as a constant etc, treat print as a builtin function, not as keyword etc. So I need to change how emacs parses python code. In vim you can do this by creating a custom syntax file and placing it in special folder, how to do the same for emacs?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from abc import ABC&#xA;print('some')&#xA;map(int, ('1',))&#xA;int('1')&#xA;&#xA;&#xA;@cached&#xA;def name(a, abc='abc'):&#xA;    pass&#xA;&#xA;name(1, abc='bca')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AMC0p.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AMC0p.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right one is how I want syntax highlighting to look and the left one is emacs.&lt;/p&gt;&#xA;" OwnerUserId="15216" LastEditorUserId="15216" LastEditDate="2017-03-16T21:31:24.910" LastActivityDate="2017-03-24T07:39:15.897" Title="How to change syntax highlighting for mode?" Tags="|python|syntax-highlighting|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31476" PostTypeId="2" ParentId="19379" CreationDate="2017-03-15T05:41:03.873" Score="10" Body="&lt;p&gt;Sorry, this is super old, but I thought I'd post the solution for people who find this in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;use &lt;code&gt;:wrap &quot;x&quot;&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put whatever text you want in for x.&#xA;This gives similar results for raw, but doesn't have the repeating issue.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: hello-world &#xA;#+BEGIN_SRC latex :wrap &quot;test&quot;&#xA;\LaTeX&#xA;#+END_SRC&#xA;&#xA;#+RESULTS: hello-world&#xA;#+BEGIN_test&#xA;\LaTeX&#xA;#+END_test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15218" LastActivityDate="2017-03-15T05:41:03.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31477" PostTypeId="2" ParentId="31472" CreationDate="2017-03-15T11:58:54.057" Score="1" Body="&lt;p&gt;Call &lt;code&gt;./configure --with-emacs=/path/to/emacs&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-03-15T11:58:54.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31479" PostTypeId="1" CreationDate="2017-03-15T15:19:32.227" Score="2" ViewCount="253" Body="&lt;p&gt;I started using Spacemacs with GUI Emacs on Windows and all was fine apart from using Tramp with plink so I decided to use Cygwin with emacs-32 (and Spacemacs) because there is proper ssh there.&lt;br&gt;&#xA;Now everything is a bit quicker and Tramp works really solidly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now (in emacs-w32) there are DOS line endings in the game (meaning &lt;code&gt;^M&lt;/code&gt;) and that breaks some stuff. One example would be that a version check of ipython throws an error because the string containing the version also contains the line ending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that Emacs makes these line endings transparent (I still don't see them in GUI Emacs on Windows. So what's happening here? Is it because Cygwin is a weird combination of DOS and UNIX and is inconsistent in using just one type of line ending?&lt;/p&gt;&#xA;" OwnerUserId="11347" LastActivityDate="2017-06-21T15:37:03.393" Title="DOS line endings in Cygwin break emacs" Tags="|spacemacs|microsoft-windows|cygwin|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31481" PostTypeId="2" ParentId="31439" CreationDate="2017-03-15T15:42:55.363" Score="10" Body="&lt;p&gt;With &lt;code&gt;ox-html&lt;/code&gt;?  See the docstring of &lt;code&gt;org-html-htmlize-output-type&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Output type to be used by htmlize when formatting code snippets.&#xA;  Choices are &lt;code&gt;css&lt;/code&gt; to export the CSS selectors only,&lt;code&gt;inline-css&lt;/code&gt;&#xA;  to export the CSS attribute values inline in the HTML or &lt;code&gt;nil&lt;/code&gt; to&#xA;  export plain text.  We use as default &lt;code&gt;inline-css&lt;/code&gt;, in order to&#xA;  make the resulting HTML self-containing.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;However, this will fail when using Emacs in batch mode for export, because&#xA;  then no rich font definitions are in place.  It will also not be good if&#xA;  people with different Emacs setup contribute HTML files to a website,&#xA;  because the fonts will represent the individual setups.  In these cases,&#xA;  it is much better to let Org/Htmlize assign classes only, and to use&#xA;  a style file to define the look of these classes.&#xA;  To get a start for your css file, start Emacs session and make sure that&#xA;  all the faces you are interested in are defined, for example by loading files&#xA;  in all modes you want.  Then, use the command&#xA;  &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;org-html-htmlize-generate-css&lt;/code&gt; to extract class definitions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here's an example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+bind: org-html-htmlize-output-type css&#xA;#+BEGIN_SRC emacs-lisp :var css-file=&quot;code.css&quot; :results raw&#xA;  (unless noninteractive&#xA;    (org-html-htmlize-generate-css)&#xA;    (with-current-buffer &quot;*html*&quot;&#xA;      (write-file css-file))&#xA;    (format &quot;#+html_head_extra: &amp;lt;link rel=\&quot;stylesheet\&quot; type=\&quot;text/css\&quot; href=\&quot;%s\&quot;/&amp;gt;&quot;&#xA;        css-file))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;#+html_head_extra: &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;code.css&quot;/&amp;gt;&#xA;&#xA;Hello world example code:&#xA;&#xA;#+BEGIN_SRC python&#xA;def hello_world(name):&#xA;    print(name)&#xA;#+END_SRC&#xA;&#xA;The above should be colored and highlighted.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The file above is made to be self-contained and should work from &lt;code&gt;emacs -q&lt;/code&gt;.&#xA;&lt;a href=&quot;http://orgmode.org/org.html#Export-settings&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;#+bind&lt;/code&gt;&lt;/a&gt; is used for setting variables on a file basis, typically variables that cannot be changed via &lt;code&gt;#+options&lt;/code&gt;.  To use &lt;code&gt;#+bind&lt;/code&gt;, &lt;code&gt;org-export-allow-bind-keywords&lt;/code&gt; should be non-&lt;code&gt;nil&lt;/code&gt;. Here,&lt;code&gt;#+bind&lt;/code&gt; can be thought of as &lt;code&gt;(setq-local org-html-htmlize-output-type 'css)&lt;/code&gt; in the org export buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/org.html#Working-with-source-code&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;src-block&lt;/code&gt;&lt;/a&gt; is a fancy way to (0) generate &lt;code&gt;code.css&lt;/code&gt; via &lt;code&gt;org-html-htmlize-generate-css&lt;/code&gt; and (1) generate the &lt;code&gt;ox-html&lt;/code&gt; instruction to include this stylesheet, namely &lt;code&gt;#+html_head_extra: &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;code.css&quot;/&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1974" LastEditorUserId="1974" LastEditDate="2017-03-22T09:08:07.693" LastActivityDate="2017-03-22T09:08:07.693" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31482" PostTypeId="1" CreationDate="2017-03-15T16:47:57.277" Score="2" ViewCount="498" Body="&lt;p&gt;I saw many post about use org mode to post blog with Jekyll. one method is use emacs to export html with some modified publish function, another method is use a Jekyll plugin to call Org mode API do it directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But after some try, both mode not work as expected. method 1 will handle the inline pictures but the output is totally in to the root directory, but I wish it been export to separate directory blog by blog. method 2 actually didn't handle inline pictures at all, so the output html will not include the inline image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way to write blog with org mode for Jekyll?&lt;/p&gt;&#xA;" OwnerUserId="14840" LastActivityDate="2017-03-15T16:47:57.277" Title="Org mode blog post with Jekyll" Tags="|org-mode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31484" PostTypeId="1" CreationDate="2017-03-15T19:48:06.130" Score="3" ViewCount="206" Body="&lt;p&gt;I'm using the custom keyboard layout found at &lt;a href=&quot;https://www.kaufmann.no/roland/dvorak/macosx.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.kaufmann.no/roland/dvorak/macosx.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use Emacs in gui mode, most keys are fine, but the 10-keys -- which the layout redefines like a telephone keypad -- are not remapped. That is, they give the number written on the key and not the remapped one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm curious: how is it even possible for Emacs to see keys differently from every other application?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Another example, emacs binds cmd-left and cmd-right to switch between frames. It also ignores my settings in macos Settings which are usually cmd-` but I have them on cmd-$ for Move Focus Next Window. How can emacs override the system-wide keys?&lt;/p&gt;&#xA;" OwnerUserId="12337" LastEditorUserId="12337" LastEditDate="2017-03-21T02:42:21.817" LastActivityDate="2017-03-21T02:42:21.817" Title="Why does Emacs not pick up all of my Mac OSX keyboard layout?" Tags="|osx|keyboard-layout|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31486" PostTypeId="1" AcceptedAnswerId="31496" CreationDate="2017-03-15T23:36:46.163" Score="1" ViewCount="553" Body="&lt;p&gt;Is there a way to run magit commands so that the the command is run within a new window or a different frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when running &lt;code&gt;magit-log-all-branches&lt;/code&gt; (&lt;code&gt;l b&lt;/code&gt;) from the &lt;code&gt;magit-status&lt;/code&gt; window it would be nice to optionally split the window a la &lt;code&gt;switch-to-buffer-other-window&lt;/code&gt;, so that it's possible to see both the log the status buffer at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell there are no prefix arguments or switches that accomplish this.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2017-03-16T00:23:05.013" LastActivityDate="2017-03-16T11:35:27.177" Title="Run magit command in other-window/frame?" Tags="|magit|window|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31488" PostTypeId="1" AcceptedAnswerId="31500" CreationDate="2017-03-16T03:13:51.937" Score="0" ViewCount="843" Body="&lt;p&gt;I needed to specify stdlib options in a certain environment, so I changed the flycheck executable to &lt;code&gt;clang -std=c++11 -stdlib=libc++&lt;/code&gt;, which is needed to compile the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I got the error &lt;code&gt;Error while checking syntax automatically: (error &quot;Output file descriptor of flycheck-c/c++-clang is closed&quot;)&lt;/code&gt; after doing so, and searches don't turn anything up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I help flycheck out?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2017-03-16T14:24:08.170" Title="How do you add command line options to flycheck's C++ checker?" Tags="|flycheck|c++|clang|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31489" PostTypeId="1" AcceptedAnswerId="31490" CreationDate="2017-03-16T03:54:25.847" Score="0" ViewCount="91" Body="&lt;p&gt;I wish to define a variable to replace the hardcode string below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-publish-project-alist&#xA;      '(&#xA;        (&quot;blog&quot; :components (&quot;org-blog-docs&quot; &quot;org-blog-static&quot;))&#xA;&#xA;        (&quot;org-blog-docs&quot;&#xA;         :base-directory &quot;~/myblog/_org&quot;&#xA;         :base-extension &quot;org&quot;&#xA;         :publishing-directory &quot;~/myblog/_posts&quot;&#xA;         :recursive t&#xA;         :publishing-function blog-html-publish-to-html&#xA;         :headline-levels 4&#xA;         :html-extension &quot;html&quot;&#xA;         :body-only t&#xA;         )&#xA;&#xA;        (&quot;org-blog-static&quot;&#xA;         :base-directory &quot;~/myblog/_org&quot;&#xA;         :base-extension &quot;css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf&quot;&#xA;         :publishing-directory &quot;~/myblog/assets&quot;&#xA;         :recursive t&#xA;         :publishing-function org-publish-attachment&#xA;         )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq base-dir &quot;~/myblog/_org&quot;)&#xA;...&#xA;:base-directory base-dir&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But such a replace doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What's this data struture? is it a association or alist?&lt;/li&gt;&#xA;&lt;li&gt;How can I replace the string with a variable?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="105" LastEditDate="2017-03-16T14:40:35.083" LastActivityDate="2021-11-08T19:49:35.673" Title="elisp - simplify a stranger data structure" Tags="|variables|eval|" AnswerCount="1" CommentCount="1" ClosedDate="2017-03-17T17:23:56.463" ContentLicense="CC BY-SA 3.0" />
  <row Id="31490" PostTypeId="2" ParentId="31489" CreationDate="2017-03-16T05:20:53.627" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;s&gt;It's not an association list, strictly speaking, even though the name seems to say it is.&lt;/s&gt; An alist is a list of (key . value) dotted pairs. &lt;code&gt;org-publish-project-alist&lt;/code&gt; is just a list of lists, where each of the sublists contains a tag (the first element) and a property list (the rest of it). But property lists consist of key-value pairs (pairs in a more general sense, not lisp dotted pairs). See the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Lists.html#Lists&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs lisp manual&lt;/a&gt; for more details.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;EDIT: As @phils points out, this is wrong: it &lt;em&gt;is&lt;/em&gt; an alist. Each sublist is a pair, whose car is the tag and whose cdr is the property list. Apologies for my mistake.&lt;/p&gt;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;The quote at the beginning inhibits evaluation of everything inside, so any variables don't get evaluated - try it:&lt;/p&gt;&#xA;&lt;p&gt;(setq x 3)&#xA;(setq l '(1 2 x))&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The value of l is the list &lt;code&gt;(1 2 x)&lt;/code&gt;, &lt;em&gt;not&lt;/em&gt; &lt;code&gt;(1 2 3)&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To allow partial evaluation of expressions inside a mostly quoted structure, you need to use the backquote mechanism:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq x 3)&#xA;(setq l `(1 2 ,x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now the value of l is &lt;code&gt;(1 2 3)&lt;/code&gt;. Note the backquote instead of the quote, and the comma in front of the variable. You can find more info &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Applying this to your case becomes&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq base-dir &amp;quot;~/myblog/_org&amp;quot;)&#xA;(setq org-publish-project-alist&#xA;  `(&#xA;     ...&#xA;     :base-directory ,base-dir&#xA;     ...&#xA;  ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2021-11-08T19:49:35.673" LastActivityDate="2021-11-08T19:49:35.673" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="31491" PostTypeId="1" CreationDate="2017-03-16T07:14:00.983" Score="1" ViewCount="279" Body="&lt;p&gt;When hitting &lt;code&gt;C-j&lt;/code&gt; in the minibuffer while executing &lt;code&gt;helm-find-files&lt;/code&gt; and no match is possible, helm creates a new buffer with the name of the completion. E.g. I do &lt;code&gt;M-x helm-find-files&lt;/code&gt;, type &lt;code&gt;foo&lt;/code&gt; there is only the default match:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XVkho.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XVkho.png&quot; alt=&quot;helm with default match&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I hi &lt;code&gt;C-j&lt;/code&gt; and a new buffer gets created, named &lt;code&gt;foo&lt;/code&gt;. How can I disable this behavior?&lt;/p&gt;&#xA;" OwnerUserId="2037" LastEditorUserId="105" LastEditDate="2017-03-16T14:40:10.250" LastActivityDate="2017-04-15T16:09:51.967" Title="helm-find-files (and others): how to prevent C-j from creating buffer when no match" Tags="|helm|buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31492" PostTypeId="1" CreationDate="2017-03-16T08:01:10.953" Score="0" ViewCount="263" Body="&lt;p&gt;I installed Emacs 25.1.2 on Windows 10 machine, then installed yasnippet library from Elpa. Copied all my snippets from Linux machine. But for some reason none of them work. When I open a file I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;File mode specification error: (wrong-type-argument integerp nil)&#xA;[yas] Loading for `cperl-mode', just-in-time: &#xA;      (lambda nil (yas--load-directory-1 &#xA;          (quote D:/me/.emacs.d/yasnippets/cperl-mode) (quote cperl-mode)))!&#xA;[yas] Loading compiled snippets from D:/me/.emacs.d/yasnippets/cperl-mode&#xA;while: Wrong type argument: integerp, nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe, something is wrong with installed library?&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2017-03-16T08:01:10.953" Title="yasnippet doesn't work on Windows" Tags="|yasnippet|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31493" PostTypeId="1" AcceptedAnswerId="56130" CreationDate="2017-03-16T08:16:52.687" Score="2" ViewCount="289" Body="&lt;p&gt;The compilation buffer prints out start and end date for my compilation. How can I make it also tell me how many minutes &amp;amp; seconds it spent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like something like:&#xA;&lt;code&gt;&#xA;Compilation started at Thu Mar 16 09:10:44&#xA;[..]&#xA;Compilation finished at Thu Mar 16 09:13:04&#xA;Compilation took n hours n minutes n seconds&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="9721" LastActivityDate="2022-09-18T06:22:14.973" Title="Print elapsed time in compilation buffer" Tags="|compilation-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31494" PostTypeId="2" ParentId="31491" CreationDate="2017-03-16T08:38:47.807" Score="1" Body="&lt;p&gt;I don't know why you hit &lt;code&gt;C-j&lt;/code&gt; on no match in the first place. &lt;code&gt;C-j&lt;/code&gt; is used for previewing the content of a file and there is no needs to preview a non-exist file. But to kill the buffer, simply hit &lt;code&gt;C-j&lt;/code&gt; again, for example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-x C-f non-existent-filename C-j C-j&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the first &lt;code&gt;C-j&lt;/code&gt; opens a buffer named &lt;code&gt;non-existent-filename&lt;/code&gt; and the second kills it. I learnt this by reading the documentation. To read the documentation of &lt;code&gt;helm-find-files&lt;/code&gt;, open a &lt;code&gt;helm-find-files&lt;/code&gt; session then hit &lt;code&gt;C-h m&lt;/code&gt; (this is shown in the mode line), or &lt;code&gt;M-x helm-documentation&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-03-16T08:38:47.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31495" PostTypeId="1" AcceptedAnswerId="31523" CreationDate="2017-03-16T09:57:09.663" Score="1" ViewCount="2881" Body="&lt;p&gt;I would like to make some change on  spacemacs's default buffer &lt;code&gt;*spacemacs*&lt;/code&gt;,like&#xA;move recently files and projects to left and show my TODO list in the right or bottom from another file&lt;/p&gt;&#xA;" OwnerUserId="15227" LastEditorUserId="15227" LastEditDate="2017-03-17T00:53:59.187" LastActivityDate="2020-10-14T15:33:52.650" Title="how do I customize spacemacs default buffer" Tags="|spacemacs|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31496" PostTypeId="2" ParentId="31486" CreationDate="2017-03-16T11:35:27.177" Score="3" Body="&lt;p&gt;This can be configured exactly to your liking, but it won't be easy and require quite a bit of reading. Start by reading about &lt;code&gt;magit-display-buffer-function&lt;/code&gt; and friends &lt;a href=&quot;https://magit.vc/manual/magit/Switching-Buffers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. That's just a wrapper around &lt;code&gt;display-alist&lt;/code&gt;, so read &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;about that&lt;/a&gt; too.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-03-16T11:35:27.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31497" PostTypeId="1" CreationDate="2017-03-16T11:54:29.600" Score="1" ViewCount="87" Body="&lt;p&gt;When I run &lt;code&gt;(+ 1 1)&lt;/code&gt; using &lt;code&gt;eval-print-last-sexp&lt;/code&gt; in a buffer, this function inserts a newline and outputs 2. I'd rather its output were just ' 2' (space and 2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change this? &lt;/p&gt;&#xA;" OwnerUserId="9320" LastEditorUserId="9320" LastEditDate="2017-03-16T18:42:06.780" LastActivityDate="2017-03-20T19:25:08.637" Title="Changing default output of a function" Tags="|functions|print|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31498" PostTypeId="2" ParentId="31260" CreationDate="2017-03-16T12:20:26.933" Score="2" Body="&lt;p&gt;I finally had some time to look at this again, and managed to implement a relatively simple solution, by extending the &lt;code&gt;html&lt;/code&gt; export backend. &#xA;The code to do it is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   (require 'ox)&#xA;   (require 's)&#xA;   (require 'uuidgen)&#xA;   (defun mvr-html-src-block (src-block contents info)&#xA;     &quot;Transcode a SRC-BLOCK element from Org to HTML, adding a 'copy to clipboard' button.&quot;&#xA;     (if (not (org-export-read-attribute :attr_html src-block :copy-button))&#xA;      (org-export-with-backend 'html src-block contents info)&#xA;      (let*((b-id (concat &quot;btn_&quot; (s-replace &quot;-&quot; &quot;&quot; (uuidgen-4))))&#xA;        (content (let ((print-escape-newlines t))(prin1-to-string (org-export-format-code-default src-block info))))&#xA;        (content- (s-chop-prefix &quot;\&quot;&quot; (s-chop-suffix &quot;\&quot;&quot; (s-replace &quot;`&quot; &quot;\\`&quot; content))))&#xA;        (btn- &quot;button&quot;)&#xA;        (scr- &quot;script&quot;)&#xA;        (bquote- &quot;`&quot;)&#xA;        (script (concat &quot;\n&amp;lt;&quot; scr- &quot; type='text/javascript'&amp;gt;\n var copyBtn&quot; b-id &quot;=document.querySelector('&quot; btn- &quot;[name=&quot; b-id &quot;]');\n&quot;&#xA;                        &quot;copyBtn&quot; b-id &quot;.addEventListener('click', function(event) {\n&quot;&#xA;                        &quot;copyTextToClipboard(&quot; bquote- content- bquote- &quot;);\n});\n&amp;lt;/&quot; scr- &quot;&amp;gt;\n&quot;))&#xA;        (button (concat &quot;&amp;lt;&quot; btn- &quot; class='copyBtn' name=&quot; b-id &quot;&amp;gt;Copy to clipboard&amp;lt;/&quot; btn- &quot;&amp;gt;&quot;)))&#xA;        (concat (org-export-with-backend 'html src-block contents info)  button script))))&#xA;&#xA;   (org-export-define-derived-backend 'mvr-html 'html&#xA;     :translate-alist '((src-block . mvr-html-src-block)))&#xA;&#xA;  (defun org-export-to-html-with-button (file)&#xA;  &quot;Exports the current org-mode buffer to an HTML file, adding 'copy to clipboard' &#xA;  buttons to source code blocks.&quot;&#xA;  (interactive &quot;FFile Name: &quot;)&#xA;  (org-export-to-file 'mvr-html file))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The copy button is then enabled by adding &lt;code&gt;#+ATTR_HTML: :copy-button t&lt;/code&gt; to the relevant source blocks, like so&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :copy-button t&#xA;#+BEGIN_SRC....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remember to add the JS code referenced in the &lt;a href=&quot;https://stackoverflow.com/a/30810322/885262&quot; title=&quot;linked SO answer&quot;&gt;linked SO answer&lt;/a&gt; (the &quot;complex example&quot;), and you're good to go. The buttons are added with a &quot;copyBtn&quot; class, so they can be styled as needed.&lt;/p&gt;&#xA;" OwnerUserId="3924" LastEditorUserId="17757" LastEditDate="2019-11-17T07:11:21.177" LastActivityDate="2019-11-17T07:11:21.177" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31500" PostTypeId="2" ParentId="31488" CreationDate="2017-03-16T14:24:08.170" Score="1" Body="&lt;p&gt;You don't change the executable, but rather modify &lt;a href=&quot;http://www.flycheck.org/en/latest/languages.html#c-c&quot; rel=&quot;nofollow noreferrer&quot;&gt;flycheck's variables that get translated into a command&lt;/a&gt;. In your case, you have to change them like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq flycheck-clang-language-standard &quot;c++11&quot;)&#xA;(setq flycheck-clang-standard-library &quot;libc++&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also customize these variables (by running &lt;code&gt;M-x customize-variable&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="10785" LastActivityDate="2017-03-16T14:24:08.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31501" PostTypeId="1" CreationDate="2017-03-16T15:19:33.853" Score="1" ViewCount="81" Body="&lt;p&gt;I know I have eclim setup correctly because everything else works, I.E I can do autocomplete, jump to definition etc. I can even see problems with eclim-problems. However, when I make a syntax error, the error is not being highlighted with a red line like I thought it should do. Is there anything I have to turn on? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I even checked my faces and found eclim-problems-highlight-error-face and it has a nice red underline like it should. Everything works except for the highlighting itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: O.K weirdly the problem seems to have half fixed itself. It must have been hung or something. However, there is now a new problem. When I mouse over the problems highlighted, it doesn't tell me what the problem is in the minibuffer like I would expect&lt;/p&gt;&#xA;" OwnerUserId="15220" LastEditorUserId="15220" LastEditDate="2017-03-16T16:40:42.553" LastActivityDate="2017-03-16T16:40:42.553" Title="Eclim problems not being highlighted/problems not being shown in minibuffer" Tags="|syntax-highlighting|java|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31502" PostTypeId="1" CreationDate="2017-03-16T17:35:43.113" Score="0" ViewCount="2458" Body="&lt;p&gt;I am editing a file on a remote server via Tramp, and I decide that I want to open up an &lt;code&gt;ansi-term&lt;/code&gt; session on the remote server (as opposed to relying on &lt;code&gt;shell-command&lt;/code&gt;). How do I do this? When I run &lt;code&gt;ansi-term&lt;/code&gt;, it just opens up a new session on my local computer.&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2021-12-17T11:10:34.997" Title="How do I open an ansi-term on a remote server via Tramp?" Tags="|tramp|ssh|ansi-term|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31503" PostTypeId="1" AcceptedAnswerId="33524" CreationDate="2017-03-16T17:36:29.003" Score="2" ViewCount="1606" Body="&lt;p&gt;I recently setup mu4e. My Setup :&#xA;emacs25, mu 0.9.18, macOS Sierra&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used &lt;code&gt;mbsync&lt;/code&gt; to download my emails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do &lt;code&gt;M-x mu4e&lt;/code&gt;, I get error &lt;code&gt;error in process sentinel: Database empty; try indexing some messages&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked &lt;code&gt;mu4e-maildir&lt;/code&gt;. It is correct (which is where &lt;code&gt;mbsync&lt;/code&gt; has downloaded the messages.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mu index&lt;/code&gt; (as well as &lt;code&gt;mu index --maildir=~/Maildir&lt;/code&gt; just in case) also worked well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can use &lt;code&gt;mu find &amp;lt;pattern&amp;gt;&lt;/code&gt; successfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;code&gt;mu4e&lt;/code&gt; can't seem to find the DB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this is some configuration mismatch. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I troubleshoot this ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;References : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;About 4 year old issue, without conclusive solution with exact same error : &lt;a href=&quot;https://github.com/djcb/mu/issues/198&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/djcb/mu/issues/198&lt;/a&gt; (Edit: I read &lt;a href=&quot;http://comments.gmane.org/gmane.mail.mu.general/938&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://comments.gmane.org/gmane.mail.mu.general/938&lt;/a&gt; thread. I mentioned above, I am &lt;strong&gt;not&lt;/strong&gt; using &lt;code&gt;procmail&lt;/code&gt;. Using &lt;code&gt;mbsync&lt;/code&gt; as mentioned above)&lt;/li&gt;&#xA;&lt;li&gt;I have asked this question first on reddit (Albeit it started in slightly different context where I couldn't even get &lt;code&gt;mu4e&lt;/code&gt; to work. But now I'm past that. &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/5srva7/mu4e_0918_emailing_with_emacs_now_even_better/deyf717/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.reddit.com/r/emacs/comments/5srva7/mu4e_0918_emailing_with_emacs_now_even_better/deyf717/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11877" LastEditorUserId="11877" LastEditDate="2017-03-16T19:01:38.810" LastActivityDate="2017-06-14T09:03:19.743" Title="mu4e error : Database empty; try indexing some messages" Tags="|mu4e|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31504" PostTypeId="1" AcceptedAnswerId="31517" CreationDate="2017-03-16T18:44:44.750" Score="1" ViewCount="919" Body="&lt;p&gt;I am trying to understand, what some functions are doing, in order to code something similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following example was copied from the file &lt;code&gt;acro.el&lt;/code&gt; from the AUCTeX package.  This is just a random example, as any other style-file from AUCTeX will do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;acro.el&lt;/code&gt; you will find&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;...&#xA; (TeX-add-symbols&#xA;    ;; Creating New Acronyms&#xA;    '(&quot;DeclareAcronym&quot; LaTeX-arg-define-acro-acronym&#xA;      (LaTeX-arg-acro-key-val &quot;Definition of acronym (k=v)&quot;&#xA;                  LaTeX-acro-declareacronym-keys))&#xA;...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do interpret this, that if you want to insert the macro &lt;code&gt;\DeclareAcronym&lt;/code&gt; into your LaTeX-buffer, (by running the command &lt;code&gt;TeX-insert-macro&lt;/code&gt;, bound to &lt;KBD&gt;CTRL-c&lt;/KBD&gt;&lt;KBD&gt;CTRL-m&lt;/KBD&gt;) AUCTeX will first run the function &lt;code&gt;LaTeX-arg-define-acro-acronym&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This---in return---is defined this way:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun LaTeX-arg-define-acro-acronym (optional &amp;amp;optional prompt)&#xA;  &quot;Prompt for an acronym completing with known acronyms.&#xA;If OPTIONAL is non-nil, insert the resulting value as an optional&#xA;argument, otherwise as a mandatory one.  Use PROMPT as the prompt&#xA;string.&quot;&#xA;  (LaTeX-arg-acro-acronym optional prompt t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far, as I have understood LISP, the function &lt;code&gt;LaTeX-arg-define-acro-acronym&lt;/code&gt; has to be called with one mandatory argument.  You may also give it a second, optional argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, calls as this&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(LaTeX-arg-define-acro-acronym t)&#xA;(LaTeX-arg-define-acro-acronym t &quot;Acronym to define: &quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should be correct.  In fact, I can execute those commands in the &lt;em&gt;scratch&lt;/em&gt; buffer without error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, as you saw above, the function is called without the mandatory argument and even without the parentheses &lt;code&gt;()&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;LaTeX-arg-define-acro-acronym&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone explain to me, why this is working and why emacs is not throwing an error?  When I try this in the &lt;code&gt;*scratch*&lt;/code&gt;-buffer, I get an error&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbol's value as variable is void&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I add parentheses, I get this error message in the minibuffer&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wrong number of arguments&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Digging further into the code, I found, that &lt;code&gt;LaTeX-arg-define-acro-acronym&lt;/code&gt; calls the function &lt;code&gt;LaTeX-arg-acro-acronym&lt;/code&gt;.  This time, the mandatory OPTIONAL and both optional arguments PROMPT and DEFINITION are handed over. Again, copied from acro.el:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(LaTeX-arg-acro-acronym optional prompt t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This time the parentheses &lt;code&gt;()&lt;/code&gt; are used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asking myself, what value OPTIONAL, PROMPT and DEFINITION do get, as they haven't been defined (as far as I can see).  (Are there any defaults, I have missed?)&lt;/p&gt;&#xA;" OwnerUserId="14190" LastEditorUserId="14190" LastEditDate="2017-03-17T08:12:02.197" LastActivityDate="2017-03-17T08:12:02.197" Title="using functions with mandatory and optional arguments" Tags="|functions|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31505" PostTypeId="2" ParentId="31497" CreationDate="2017-03-16T18:50:15.727" Score="1" Body="&lt;p&gt;Here's the code for &lt;code&gt;evaluate-print-last-sexp&lt;/code&gt;, minus the docstring.  (Note: I found this with &lt;code&gt;C-h f evaluate-print-last-sexp&lt;/code&gt;, and following the link to the source code.)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun eval-print-last-sexp (&amp;amp;optional eval-last-sexp-arg-internal)&#xA;  &quot;(DOCSTRING HERE)&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((standard-output (current-buffer)))&#xA;    (terpri)&#xA;    (eval-last-sexp (or eval-last-sexp-arg-internal t))&#xA;    (terpri)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It calls the function &lt;code&gt;terpri&lt;/code&gt;, whose docstring reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;terpri&lt;/code&gt; is a built-in function in `C source code'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(terpri &amp;amp;optional PRINTCHARFUN)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Output a newline to stream PRINTCHARFUN.&#xA;  If PRINTCHARFUN is omitted or &lt;code&gt;nil&lt;/code&gt;, the value of &lt;code&gt;standard-output&lt;/code&gt; is used.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;terpri&lt;/code&gt; hardcodes your extra newlines.  Your simplest&#xA;solution is probably to rewrite this function and strip out the calls to &lt;code&gt;terpri&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-eval-print-last-sexp (&amp;amp;optional eval-last-sexp-arg-internal)&#xA;  &quot;I hate newlines.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (let ((standard-output (current-buffer)))&#xA;    (eval-last-sexp (or eval-last-sexp-arg-internal t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-03-16T18:50:15.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31506" PostTypeId="2" ParentId="31413" CreationDate="2017-03-16T20:20:48.470" Score="1" Body="&lt;p&gt;AUCTeX doesn't have a style file for &lt;code&gt;docstrip&lt;/code&gt;.  If you're going to write it for your own purposes, please consider submitting it to AUCTeX as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have to assign the copyright to FSF.  If you want to start the process, please follow the instructions &lt;a href=&quot;http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/Copyright/request-assign.future;hb=HEAD&quot; rel=&quot;nofollow noreferrer&quot;&gt;described here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12242" LastActivityDate="2017-03-16T20:20:48.470" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31507" PostTypeId="2" ParentId="31502" CreationDate="2017-03-16T21:06:37.297" Score="2" Body="&lt;p&gt;You can use the following function&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun dfeich/ansi-terminal (&amp;amp;optional path name)&#xA;  &quot;Opens an ansi terminal at PATH. If no PATH is given, it uses&#xA;the value of `default-directory'. PATH may be a tramp remote path.&#xA;The ansi-term buffer is named based on `name' &quot;&#xA;  (interactive) &#xA;  (unless path (setq path default-directory))&#xA;  (unless name (setq name &quot;ansi-term&quot;))&#xA;  (ansi-term &quot;/bin/bash&quot; name)&#xA;  (let ((path (replace-regexp-in-string &quot;^file:&quot; &quot;&quot; path))&#xA;    (cd-str &#xA;     &quot;fn=%s; if test ! -d $fn; then fn=$(dirname $fn); fi; cd $fn;&quot;)&#xA;    (bufname (concat &quot;*&quot; name &quot;*&quot; )))&#xA;    (if (tramp-tramp-file-p path)&#xA;    (let ((tstruct (tramp-dissect-file-name path)))&#xA;      (cond &#xA;       ((equal (tramp-file-name-method tstruct) &quot;ssh&quot;)&#xA;        (process-send-string bufname (format&#xA;                      (concat  &quot;ssh -t %s '&quot;&#xA;                           cd-str&#xA;                           &quot;exec bash'; exec bash; clear\n&quot;)&#xA;                      (tramp-file-name-host tstruct)&#xA;                      (tramp-file-name-localname tstruct))))&#xA;       (t (error &quot;not implemented for method %s&quot;&#xA;             (tramp-file-name-method tstruct)))))&#xA;      (process-send-string bufname (format (concat cd-str &quot; exec bash;clear\n&quot;)&#xA;                       path)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code is also linked &lt;a href=&quot;https://gist.github.com/dfeich/1bcb09b0e2fc5f55fecec8f498862683&quot; rel=&quot;nofollow noreferrer&quot;&gt;this gist&lt;/a&gt;. I have a similar gist for opening gnome-terminals at the current path (or any given path) &lt;a href=&quot;https://gist.github.com/dfeich/50ee86c3d4338dbc878b&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the ansi terminal there may just some small but non-critical problem with the remote server not knowing the 'eterm-color' type. E.g. look at this &lt;a href=&quot;https://stackoverflow.com/questions/22083177/eterm-color-unknown-terminal-type&quot;&gt;stackoverflow question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2025" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-03-16T21:12:53.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31508" PostTypeId="1" CreationDate="2017-03-16T21:44:34.887" Score="1" ViewCount="1407" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/X7xYp.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/X7xYp.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;I'd like to make current line number in relative line number mode more distinguishable&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq nlinum-format-function 'myformat)&#xA;(defun myformat (line width)&#xA;  (if&#xA;    (eq line (what-line)) &quot;123  &quot;&#xA;    &quot;321&quot;&#xA;  )&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice padding to the right of the current line number in vim which very subtly makes it easily distinguishable.&lt;/p&gt;&#xA;" OwnerUserId="15216" LastEditorUserId="15216" LastEditDate="2017-03-16T21:51:04.240" LastActivityDate="2017-07-15T13:22:57.647" Title="How to add right padding to the current line number in emacs in nlinum-mode" Tags="|linum-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31510" PostTypeId="2" ParentId="31459" CreationDate="2017-03-17T00:41:53.310" Score="2" Body="&lt;p&gt;Not sure if you were already aware of this or not, but you can interactively do this without writing a function per se, using the universal argument -- in my emacs &lt;code&gt;forward-paragraph&lt;/code&gt; is bound to &lt;code&gt;&quot;M-}&quot;&lt;/code&gt;, so you can go to beginning of buffer, &lt;code&gt;&quot;C-u-33-M-}&quot;&lt;/code&gt; and it will jump forward 33 paragraphs. You could even capture this to a keyboard macro with a &lt;code&gt;kbd-macro-query&lt;/code&gt; inside to ask you how many paragraphs, and then save that macro off and bind it to a key. Just to let you know that there are ways to do this without writing any Emacs Lisp at all.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-03-17T00:41:53.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31511" PostTypeId="2" ParentId="31504" CreationDate="2017-03-17T00:43:49.863" Score="3" Body="&lt;p&gt;You're correct about what required and optional arguments are. I think that you've missed a key detail about that first snippet of code, which I reproduce here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(TeX-add-symbols&#xA;  ;; Creating New Acronyms&#xA;  '(&quot;DeclareAcronym&quot; LaTeX-arg-define-acro-acronym&#xA;    (LaTeX-arg-acro-key-val &quot;Definition of acronym (k=v)&quot;&#xA;                LaTeX-acro-declareacronym-keys))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This starts with a call to the function &lt;code&gt;TeX-add-symbols&lt;/code&gt;, passing it one argument. That argument is a quoted list (it looks like &lt;code&gt;'(...)&lt;/code&gt;). When you quote something in a lisp, you're telling the compiler &lt;em&gt;not&lt;/em&gt; to evaluate it, but instead to keep it around as a data structure. This means that the &lt;code&gt;LaTeX-arg-define-acro-acronym&lt;/code&gt; that you see there is &lt;em&gt;not&lt;/em&gt; a call to that function at all; it's just the &lt;em&gt;name&lt;/em&gt; of the function. The function &lt;code&gt;TeX-add-symbols&lt;/code&gt; must use that name in one way or another, probably by looking up what function is assigned to it, then calling that function at the necessary time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another detail you might be missing is that Emacs Lisp is what is called a &quot;Lisp-2&quot;. In a &quot;Lisp-2&quot;, all names can have two values. One value is used when the name is used in a function call, and the other value is used when the name is used as a variable. (Other Lisp languages are called &quot;Lisp-1&quot; because ever variable can have only one value, either a function value or a &quot;normal&quot; value.) For example, take a look at this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo 42)&#xA;(defun foo () (message &quot;function foo was called&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here we define a variable called &lt;code&gt;foo&lt;/code&gt; with a value of 42. Then we define a function called &lt;code&gt;foo&lt;/code&gt;, and have it display a message. If you evaluate these in your scratch buffer, then evaluate &lt;code&gt;foo&lt;/code&gt;, you'll get the 42 back. If you evaluate &lt;code&gt;(foo)&lt;/code&gt;, on the other hand, it will call the function and display the message. This is why, when you evaluated &lt;code&gt;LaTeX-arg-define-acro-acronym&lt;/code&gt; you got an error saying that the variable was undefined. You can use the functions &lt;code&gt;symbol-value&lt;/code&gt; and &lt;code&gt;symbol-function&lt;/code&gt; to access these two values in an explicit way; they both take a single symbol as an argument: &lt;code&gt;(symbol-value 'foo)&lt;/code&gt; gives &lt;code&gt;42&lt;/code&gt;, while &lt;code&gt;symbol-function 'foo)&lt;/code&gt; gives a lambda expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you found some code that makes a call to this function, which looks like &lt;code&gt;(LaTeX-arg-acro-acronym optional prompt t)&lt;/code&gt;. You asked about &lt;code&gt;optional&lt;/code&gt; and &lt;code&gt;propmt&lt;/code&gt; here, because they didn't seem to be defined. These are likely local variables, only defined inside the scope of the code you were looking at. They could be passed in as arguments to the function, or defined as a variable using &lt;code&gt;let&lt;/code&gt; or &lt;code&gt;let*&lt;/code&gt;, or even one of the less common facilities that introduce local variables such as &lt;code&gt;dolist&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given your questions here, I'd say it's time you started reading the Elisp Manual. It goes into quite a lot of detail that you'll eventually need, in addition to covering the basics. (For example, it also tells you about the &lt;em&gt;other&lt;/em&gt; two components that are associated with every variable name, aside from the value and the function.) Luckily, this manual (and many others), is included with Emacs. You can open up the list of manuals by typing &lt;code&gt;C-h i&lt;/code&gt;. Navigate down to the Elisp manual and hit enter (you could also type &lt;code&gt;m&lt;/code&gt; at this point to jump to a menu item by name, with autocompletion) to follow the link.&lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-03-17T00:43:49.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31513" PostTypeId="2" ParentId="30662" CreationDate="2017-03-17T04:41:51.993" Score="1" Body="&lt;p&gt;I tried to reproduce your problem but I couldn't.  Seems like everything is working properly when I take your example org task and use it as part of a project in an org file that gets exported.  My OS and software versions are,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ uname -a&#xA;OpenBSD mymachine.mydomain.org 6.0 GENERIC.MP#2319 amd64&#xA;&#xA;$ emacs --version&#xA;GNU Emacs 26.0.50&#xA;&#xA;$ tj323 --version&#xA;TaskJuggler v3.6.0 - A Project Management Software&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I went ahead and made a second test project to see if I could make anything go wrong there instead.  Here's the org file (/tmp/testing.org):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* test project                                          :taskjuggler_project:&#xA;  :PROPERTIES:&#xA;  :start:    2017-03-25&#xA;  :END:&#xA;&#xA;** Milestones&#xA;&#xA;the milestones for the project&#xA;&#xA;*** Start&#xA;    :PROPERTIES:&#xA;    :task_id:  start&#xA;    :END:&#xA;&#xA;the start of the project.&#xA;&#xA;*** End&#xA;    :PROPERTIES:&#xA;    :task_id:  end&#xA;    :depends:  blah&#xA;    :END:&#xA;&#xA;this is the end of the project&#xA;&#xA;** tasks&#xA;&#xA;*** TODO Some task&#xA;    DEADLINE: &amp;lt;2017-03-29 Wed&amp;gt; SCHEDULED: &amp;lt;2017-03-27 Mon&amp;gt;&#xA;    :PROPERTIES:&#xA;    :task_id:  first_task&#xA;    :Effort:   4:00&#xA;    :depends:  start&#xA;    :complete: 50&#xA;    :ALLOCATE: sdude&#xA;    :END:&#xA;&#xA;this is a test of the system.&#xA;&#xA;*** TODO Another task&#xA;    DEADLINE: &amp;lt;2017-03-29 Wed&amp;gt; SCHEDULED: &amp;lt;2017-03-28 Tue&amp;gt;&#xA;    :PROPERTIES:&#xA;    :task_id:  second_task&#xA;    :Effort:   4:00&#xA;    :depends:  first_task&#xA;    :complete: 50&#xA;    :ALLOCATE: sdude&#xA;    :END:&#xA;&#xA;* Resources                                            :taskjuggler_resource:&#xA;  :PROPERTIES:&#xA;  :workinghours: sat, sun off&#xA;  :END:&#xA;&#xA;These are the resources available to the project.&#xA;&#xA;** Some Dude&#xA;   :PROPERTIES:&#xA;   :resource_id: sdude&#xA;   :limits:   { dailymax 8.0h }&#xA;   :workinghours: mon - fri 9:00 - 12:00, 13:00 - 18:00&#xA;   :END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then exported to tjp in emacs using &lt;strong&gt;C-c C-e J j&lt;/strong&gt; which resulted in the following &lt;strong&gt;testing.tjp&lt;/strong&gt; file:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;project nil &quot;test project&quot; &quot;1.0&quot; 2017-03-25 +280d {&#xA;}&#xA;shift s40 &quot;Part time shift&quot; {&#xA;  workinghours wed, thu, fri off&#xA;}&#xA;resource sdude &quot;Some Dude&quot; {&#xA;  limits { dailymax 8.0h }&#xA;  workinghours mon - fri 9:00 - 12:00, 13:00 - 18:00&#xA;}&#xA;task test &quot;test project&quot; {&#xA;  start 2017-03-25&#xA;  task milestones &quot;Milestones&quot; {&#xA;    task start &quot;Start&quot; {&#xA;      milestone&#xA;    }&#xA;    task end &quot;End&quot; {&#xA;      milestone&#xA;    }&#xA;  }&#xA;  task tasks &quot;tasks&quot; {&#xA;    task first_task &quot;Some task&quot; {&#xA;      depends !!milestones.start&#xA;      purge allocate&#xA;      allocate sdude&#xA;      complete 50&#xA;      effort 4.0h&#xA;    }&#xA;    task second_task &quot;Another task&quot; {&#xA;      depends !first_task&#xA;      purge allocate&#xA;      allocate sdude&#xA;      complete 50&#xA;      effort 4.0h&#xA;    }&#xA;  }&#xA;}&#xA;textreport report &quot;Plan&quot; {&#xA;  formats html&#xA;  header '== test project =='&#xA;&#xA;  center -8&amp;lt;-&#xA;    [#Plan Plan] | [#Resource_Allocation Resource Allocation]&#xA;    ----&#xA;    === Plan ===&#xA;    &amp;lt;[report id=&quot;plan&quot;]&amp;gt;&#xA;    ----&#xA;    === Resource Allocation ===&#xA;    &amp;lt;[report id=&quot;resourceGraph&quot;]&amp;gt;&#xA;  -&amp;gt;8-&#xA;}&#xA;&#xA;# A traditional Gantt chart with a project overview.&#xA;taskreport plan &quot;&quot; {&#xA;  headline &quot;Project Plan&quot;&#xA;  columns bsi, name, start, end, effort, chart&#xA;  loadunit shortauto&#xA;  hideresource 1&#xA;}&#xA;&#xA;# A graph showing resource allocation. It identifies whether each&#xA;# resource is under- or over-allocated for.&#xA;resourcereport resourceGraph &quot;&quot; {&#xA;  headline &quot;Resource Allocation Graph&quot;&#xA;  columns no, name, effort, weekly&#xA;  loadunit shortauto&#xA;  hidetask ~(isleaf() &amp;amp; isleaf_())&#xA;  sorttasks plan.start.up&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then in an eshell buffer I compiled &lt;strong&gt;testing.tjp&lt;/strong&gt; using taskjuggler:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/tmp $ tj323 testing.tjp                                                                                          &#xA;TaskJuggler v3.6.0 - A Project Management Software                                                                &#xA;&#xA;Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016                                    &#xA;              by Chris Schlaeger &amp;lt;cs@taskjuggler.org&amp;gt;                                                             &#xA;&#xA;This program is free software; you can redistribute it and/or modify it under                                     &#xA;the terms of version 2 of the GNU General Public License as published by the                                      &#xA;Free Software Foundation.                                                                                         &#xA;&#xA;Reading file testing.tjp                                     [      Done      ]                                   &#xA;Preparing scenario Plan Scenario                             [      Done      ]                                   &#xA;Scheduling scenario Plan Scenario                            [      Done      ]                                   &#xA;Checking scenario Plan Scenario                              [      Done      ]                                   &#xA;Report Plan                                                  [      Done      ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and opened up the resulting /tmp/Plan.html in firefox and it all looked fine:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Dfnqz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Dfnqz.png&quot; alt=&quot;screen shot of resulting gantt and resource charts&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So not sure what's going on with your set up but at least we can confirm that it all should be working provided you are using the latest versions of emacs and taskjuggler.  The lengths of the tasks are correct and when I examine the exported tjp file it seems that properties on the tasks are translated over to the taskjuggler format correctly.&lt;/p&gt;&#xA;" OwnerUserId="2259" LastEditorUserId="2259" LastEditDate="2017-03-19T23:55:25.563" LastActivityDate="2017-03-19T23:55:25.563" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31514" PostTypeId="2" ParentId="17566" CreationDate="2017-03-17T05:02:43.997" Score="2" Body="&lt;p&gt;Drew's answer is not right, it doesn't work for directories, only work for files. I think the other way is better (open dir in the same window and open files in the other window).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to open files in the same window too, change find-file-other-window to find-file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The working code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired)&#xA;(defun dired-mouse-find-file (event)&#xA;  &quot;In Dired, visit the file or directory name you click on.&quot;&#xA;  (interactive &quot;e&quot;)&#xA;  (let (window pos file)&#xA;    (save-excursion&#xA;      (setq window (posn-window (event-end event))&#xA;            pos (posn-point (event-end event)))&#xA;      (if (not (windowp window))&#xA;          (error &quot;No file chosen&quot;))&#xA;      (set-buffer (window-buffer window))&#xA;      (goto-char pos)&#xA;      (setq file (dired-get-file-for-visit)))&#xA;    (if (file-directory-p file)&#xA;        (or (and (cdr dired-subdir-alist)&#xA;                 (dired-goto-subdir file))&#xA;            (progn&#xA;              (select-window window)&#xA;              (dired file)))&#xA;      (select-window window)&#xA;      (find-file-other-window (file-name-sans-versions file t)))))&#xA;&#xA;(define-key dired-mode-map [mouse-2] 'dired-mouse-find-file)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15233" LastActivityDate="2017-03-17T05:02:43.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31515" PostTypeId="1" AcceptedAnswerId="31640" CreationDate="2017-03-17T07:00:09.547" Score="0" ViewCount="194" Body="&lt;p&gt;For some reason, some garbage is prepended to my PATH variable in emacs.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Testing from eshell: (M+x eshell):&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;~/projects/rust/logentries-parser/src $ echo $PATH&#xA;bash: cannot set terminal process group (-1): Inappropriate ioctl for devicebash: no job control in this shell:/home/renat/.cargo/bin:/home/renat/lib/google-cloud-sdk/bin: ... other stuff&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Testing from shell: (M+x shell):&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;renat@hp-envy ~/projects/rust/logentries-parser/src $ echo $PATH&#xA;:/home/renat/.cargo/bin:/home/renat/lib/google-cloud-sdk/bin: ... other stuff&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Testing using the getenv: (getenv RET PATH):&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;bash: cannot set terminal process group (-1): Inappropriate ioctl for devicebash: no job control in this shell:/home/renat/.cargo/bin:/home/renat/lib/google-cloud-sdk/bin: ... other stuff&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did anybody encounter anything similar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A new update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I'm starting emacs with a &lt;code&gt;-nw&lt;/code&gt; switch - it works fine and PATH is not polluted.&lt;/p&gt;&#xA;" OwnerUserId="15235" LastEditorUserId="15235" LastEditDate="2017-03-23T07:21:03.440" LastActivityDate="2017-03-23T10:39:21.263" Title="Garbage prepended to PATH" Tags="|bash|environment|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31517" PostTypeId="2" ParentId="31504" CreationDate="2017-03-17T08:03:01.470" Score="4" Body="&lt;p&gt;The answer to your question is actually in &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex.html#Adding-Macros&quot; rel=&quot;nofollow noreferrer&quot;&gt;AUCTeX manual&lt;/a&gt;; it may sound cryptic when you read it for the first time, but it is quite accurate:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Function: &lt;strong&gt;TeX-add-symbols&lt;/strong&gt; &lt;em&gt;symbol&lt;/em&gt; ...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Add each symbol to the list of known symbols.&#xA;  Each argument to &lt;code&gt;TeX-add-symbols&lt;/code&gt; is a list describing one symbol.&#xA;  The head of the list is the name of the symbol, the remaining elements&#xA;  describe each argument. [...]&lt;br&gt;&#xA;  You can use the following types of specifiers for arguments:&#xA;  [...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;other symbols&lt;/code&gt;: Call the symbol as a function. You can define your own&#xA;  hook, or use one of the predefined argument hooks.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;list&lt;/code&gt;: If the car is a string, insert it as a prompt and the next element&#xA;  as initial input. Otherwise, call the car of the list with the remaining&#xA;  elements as arguments.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;vector&lt;/code&gt;: Optional argument. If it has more than one element, parse it&#xA;  as a list, otherwise parse the only element as above.  Use square brackets&#xA;  instead of curly braces, and is not inserted on empty user input. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...] The first argument to all hooks is a flag indicating if it is an&#xA;  optional argument. It is up to the hook to determine what to do with&#xA;  the remaining arguments, if any.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The last part means: all hooks must have a first mandatory argument &lt;code&gt;optional&lt;/code&gt; which will be passed to the function by AUCTeX itself depending on being inside square brackets &lt;code&gt;[ ]&lt;/code&gt; (see &lt;code&gt;vector&lt;/code&gt; item above) and not by the style author.  The author has to deal with the remaining arguments, if any.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the style file &lt;code&gt;acro.el&lt;/code&gt;, you have:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(TeX-add-symbols&#xA;  ;; Creating New Acronyms&#xA;  '(&quot;DeclareAcronym&quot; LaTeX-arg-define-acro-acronym&#xA;     (LaTeX-arg-acro-key-val &quot;Definition of acronym (k=v)&quot;&#xA;                             LaTeX-acro-declareacronym-keys)) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The head of the list is the string &lt;code&gt;&quot;DeclareAcronym&quot;&lt;/code&gt;, the name of the macro provided by the LaTeX package.  Next element is &lt;code&gt;LaTeX-arg-define-acro-acronym&lt;/code&gt;.  This element is parsed as symbol and called as function.  It is defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun LaTeX-arg-define-acro-acronym (optional &amp;amp;optional prompt)&#xA;  &quot;Prompt for an acronym completing with known acronyms.&#xA;If OPTIONAL is non-nil, insert the resulting value as an optional&#xA;argument, otherwise as a mandatory one.  Use PROMPT as the prompt&#xA;string.&quot;&#xA;  (LaTeX-arg-acro-acronym optional prompt t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It has one mandatory argument &lt;code&gt;optional&lt;/code&gt;, &lt;code&gt;prompt&lt;/code&gt; is &amp;amp;optional and omitted in the call.  Now, when you invoke &lt;kbd&gt;C-c C-m DeclareAcronym RET&lt;/kbd&gt;, AUCTeX runs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(LaTeX-arg-define-acro-acronym nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will then run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(LaTeX-arg-acro-acronym nil nil t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun LaTeX-arg-acro-acronym (optional &amp;amp;optional prompt definition)&#xA;  &quot;Prompt for an acronym completing with known acronyms.&#xA;If OPTIONAL is non-nil, insert the resulting value as an optional&#xA;argument, otherwise as a mandatory one.  Use PROMPT as the prompt&#xA;string.  If DEFINITION is non-nil, add the chosen acronym to the&#xA;list of defined acronyms.&quot;&#xA;  (let ((acronym (completing-read (TeX-argument-prompt optional prompt &quot;Acronym&quot;)&#xA;                  (LaTeX-acro-acronym-list) nil nil nil&#xA;                  'LaTeX-acro-acronym-history)))&#xA;    (if (and definition (not (string-equal &quot;&quot; acronym)))&#xA;    (LaTeX-add-acro-acronyms acronym))&#xA;    (TeX-argument-insert acronym optional optional)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The argument &lt;code&gt;optional&lt;/code&gt; (here &lt;code&gt;nil&lt;/code&gt;) is ultimately passed to &lt;code&gt;TeX-argument-prompt&lt;/code&gt; and &lt;code&gt;TeX-argument-insert&lt;/code&gt; with the effect that in mini-buffer, AUCTeX does not prefix the prompt &lt;code&gt;Acronym:&lt;/code&gt; with &lt;code&gt;(Optional)&lt;/code&gt; and insert user input in braces &lt;code&gt;{}&lt;/code&gt; and not in brackets &lt;code&gt;[]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next part:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(LaTeX-arg-acro-key-val &quot;Definition of acronym (k=v)&quot;&#xA;                         LaTeX-acro-declareacronym-keys)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is a list.  Since the car of the list is not string, AUCTeX calls the car as a function with rest as arguments.  &lt;code&gt;LaTeX-arg-acro-key-val&lt;/code&gt; is defined as:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun LaTeX-arg-acro-key-val (optional prompt key-val-alist)&#xA;  &quot;Prompt for keys and values in KEY-VAL-ALIST.&#xA;&amp;lt;SPC&amp;gt; key binding in minibuffer is removed temporarily.  Insert&#xA;the given value as a TeX macro argument.  If OPTIONAL is non-nil,&#xA;insert it as an optional argument.  Use PROMPT as the prompt&#xA;string.  KEY-VAL-ALIST is an alist.  The car of each element&#xA;should be a string representing a key and the optional cdr should&#xA;be a list with strings to be used as values for the key.&quot;&#xA;  (let ((crm-local-completion-map&#xA;         (remove (assoc 32 crm-local-completion-map) crm-local-completion-map)))&#xA;    (TeX-arg-key-val optional key-val-alist prompt)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It takes 3 mandatory arguments where only 2 are supplied in the hook.  Again, AUCTeX feeds the function with &lt;code&gt;optional&lt;/code&gt; (here &lt;code&gt;nil&lt;/code&gt;) itself so you don't have to cater for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to dive into details, check the functions &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/tree/tex.el#n3365&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;TeX-parse-macro&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/tree/tex.el#n3459&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;TeX-parse-arguments&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://git.savannah.gnu.org/cgit/auctex.git/tree/tex.el#n3487&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;TeX-parse-argument&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12242" LastActivityDate="2017-03-17T08:03:01.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31518" PostTypeId="1" AcceptedAnswerId="31519" CreationDate="2017-03-17T08:56:40.177" Score="4" ViewCount="855" Body="&lt;p&gt;Is there a way to reopen the last &lt;code&gt;helm&lt;/code&gt; buffer including minibuffer content and cursor position ? This would be especially convenient, when using &lt;code&gt;helm-find-files&lt;/code&gt; to navigate remote filesystems.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastActivityDate="2017-03-17T09:19:16.037" Title="how to restore last helm session?" Tags="|helm|buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31519" PostTypeId="2" ParentId="31518" CreationDate="2017-03-17T09:19:16.037" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;helm-resume&lt;/code&gt; to resume last helm session, and with prefix argument, you can even list all past helm sessions that can be resumed. See also &lt;a href=&quot;https://github.com/emacs-helm/helm/wiki/Resume&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/emacs-helm/helm/wiki/Resume&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3889" LastActivityDate="2017-03-17T09:19:16.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31520" PostTypeId="1" CreationDate="2017-03-17T09:48:42.323" Score="2" ViewCount="258" Body="&lt;p&gt;When exporting an &lt;em&gt;org&lt;/em&gt; document to &lt;em&gt;pdf&lt;/em&gt; via &lt;em&gt;LaTeX&lt;/em&gt;, &lt;code&gt;C-c C-e l o&lt;/code&gt;, if the pdf to be generated has already been visited in an existing buffer, neither of the variables &lt;code&gt;auto-revert-mode&lt;/code&gt; nor &lt;code&gt;global-auto-revert-mode&lt;/code&gt; are respected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the export process, &lt;code&gt;org-export-dispatch&lt;/code&gt; calls &lt;code&gt;org-open-file&lt;/code&gt; which in turn calls &lt;code&gt;find-file-other-window&lt;/code&gt;, which in turn causes part of the problem by calling &lt;code&gt;find-file-noselect&lt;/code&gt; with its &lt;em&gt;nowarn&lt;/em&gt; argument set to &lt;em&gt;nil&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure of the best way to go about this, but I believe the solution would be to modify the &lt;code&gt;yes-or-no-p&lt;/code&gt; statement, lines 2040 - 2055 of ...&lt;em&gt;/emacs/26.0.50/lisp/files.el.gz&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        ((yes-or-no-p&#xA;          (if (string= (file-name-nondirectory filename)&#xA;                   (buffer-name buf))&#xA;              (format&#xA;               (if (buffer-modified-p buf)&#xA;               &quot;File %s changed on disk.  Discard your edits? &quot;&#xA;             &quot;File %s changed on disk.  Reread from disk? &quot;)&#xA;               (file-name-nondirectory filename))&#xA;            (format&#xA;             (if (buffer-modified-p buf)&#xA;             &quot;File %s changed on disk.  Discard your edits in %s? &quot;&#xA;               &quot;File %s changed on disk.  Reread from disk into %s? &quot;)&#xA;             (file-name-nondirectory filename)&#xA;             (buffer-name buf))))&#xA;         (with-current-buffer buf&#xA;           (revert-buffer t t)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that when the buffer is &lt;strong&gt;not&lt;/strong&gt; modified and &lt;code&gt;(global-)auto-revert-mode&lt;/code&gt; is set, then automatically return &lt;code&gt;yes&lt;/code&gt; without prompt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if this should be filed as a bug?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I compile the corresponding &lt;em&gt;tex&lt;/em&gt; file that is generated as part of the &lt;code&gt;org-export&lt;/code&gt; process, &lt;code&gt;(global-)auto-revert-mode&lt;/code&gt; is respected, and the &lt;em&gt;pdf&lt;/em&gt; buffer is automatically reverted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This issue does &lt;strong&gt;not&lt;/strong&gt; manifest itself when I start a &lt;em&gt;standalone&lt;/em&gt; Emacs session, and &lt;em&gt;manually&lt;/em&gt; open the compiled pdf with &lt;code&gt;C-x C-f&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does however, when I am working within a daemon, through &lt;code&gt;emacsclient -c -a &quot;&quot;&lt;/code&gt;. Emacsclient is my &lt;em&gt;default application&lt;/em&gt; for opening pdfs. I.e. in my init file, I have &lt;code&gt;(setq org-file-apps '((&quot;\\.pdf\\'&quot; . &quot;emacsclient \&quot;%s\&quot;&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="13326" LastEditDate="2017-03-18T16:19:16.887" LastActivityDate="2017-03-18T16:19:16.887" Title="Org-Export does not respect (global-)auto-revert-mode" Tags="|org-export|auto-revert-mode|global-auto-revert-mode|" AnswerCount="0" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31522" PostTypeId="2" ParentId="31508" CreationDate="2017-03-17T10:52:26.080" Score="1" Body="&lt;p&gt;package &lt;code&gt;nlinum&lt;/code&gt; has option &lt;code&gt;nlinum-format&lt;/code&gt;.&#xA;You can set option to value like this: &lt;code&gt;(setq nlinum-format &quot;%d &quot;)&lt;/code&gt;. Just like package &lt;code&gt;linum&lt;/code&gt; can be configured like this: &lt;code&gt;(setq linum-format &quot;%4d \u2502&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="411" LastActivityDate="2017-03-17T10:52:26.080" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31523" PostTypeId="2" ParentId="31495" CreationDate="2017-03-17T12:27:45.600" Score="3" Body="&lt;p&gt;Use &lt;a href=&quot;https://github.com/rakanalh/emacs-dashboard&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-dashboard&lt;/a&gt; ? It is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A shameless extraction of Spacemac's startup screen &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Displays an awesome Emacs banner!&lt;/li&gt;&#xA;  &lt;li&gt;Recent files&lt;/li&gt;&#xA;  &lt;li&gt;Bookmarks list&lt;/li&gt;&#xA;  &lt;li&gt;Recent projectile projects list (Depends on &lt;code&gt;projectile&lt;/code&gt; package)&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;they're working to make it easily customisable, AFAIK.&lt;/p&gt;&#xA;" OwnerUserId="739" LastActivityDate="2017-03-17T12:27:45.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31524" PostTypeId="1" CreationDate="2017-03-17T14:33:25.290" Score="5" ViewCount="122" Body="&lt;p&gt;I just discovered &lt;code&gt;undo-tree-mode&lt;/code&gt; and it's amazing. &#xA;My use case is finding changes that I've made before so that I can re-apply them. However I'm having difficulty finding the changes I've made.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to get output like &lt;code&gt;git log -p&lt;/code&gt; or better &lt;code&gt;git log -p  --graph&lt;/code&gt; from this so that I could grep it? The existence of &lt;code&gt;undo-tree-visualizer-toggle-diff&lt;/code&gt; suggests that most of the code to do this is already there.&lt;/p&gt;&#xA;" OwnerUserId="14161" LastActivityDate="2017-07-26T03:44:02.123" Title="undo-tree output like git log" Tags="|undo|undo-tree-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31525" PostTypeId="2" ParentId="31495" CreationDate="2017-03-17T15:21:28.783" Score="1" Body="&lt;p&gt;It seems like you're looking for something more along the lines of &lt;strong&gt;&lt;code&gt;Workgroups2&lt;/code&gt;&lt;/strong&gt;, a session manager for emacs that saves and restores open buffers along with thier locations and sizes. Also supports multiple workspaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comprehensive info is available at readthedocs: &lt;a href=&quot;http://workgroups2.readthedocs.io/en/latest/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Workgroups for Emacs Official Documentation&quot;&gt;Workgroups2 - Emacs Session Manager&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And git: &lt;a href=&quot;https://github.com/pashinin/workgroups2&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Workgroups for Emacs @ GIT&quot;&gt;Workgroups for Emacs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Emacs works differently than other editors you may have used in the past and Spacemacs is really &quot;just&quot; a configuration of layers and extensions that make Emacs more accessible to new users. A key difference, as Dan points out, is that &lt;em&gt;everything&lt;/em&gt; begins in a buffer... and is only later written to a file type.&lt;/li&gt;&#xA;&lt;li&gt;For instance, having the Scratch buffer always available is very handy. One can immediately enter anything here (an org TODO, a Clojure script, a LISP fragment).&lt;/li&gt;&#xA;&lt;li&gt;It only &lt;em&gt;becomes&lt;/em&gt; something else when you &lt;em&gt;do&lt;/em&gt; something &lt;em&gt;to&lt;/em&gt; the buffer; that is, when you save it to a file (foo.org, foo.clj, foo.lisp, etc). Saving a buffer &lt;em&gt;as&lt;/em&gt; something changes its nature from general to specific, from potentiality to actuality.&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This has interesting philosophical considerations!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15241" LastEditorUserId="15241" LastEditDate="2017-03-17T17:09:35.430" LastActivityDate="2017-03-17T17:09:35.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31526" PostTypeId="1" AcceptedAnswerId="31527" CreationDate="2017-03-17T16:22:49.580" Score="1" ViewCount="522" Body="&lt;p&gt;I have emacs 25.1.1 on Ubuntu 16.04 and have been trying to browse with its built in &lt;code&gt;eww&lt;/code&gt; browser. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start with &lt;code&gt;M-x eww&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I type in my search keyword. DuckDuckgo displays a list of search results as expected. However if I navigate (using &lt;code&gt;C-n&lt;/code&gt;, &lt;code&gt;C-p&lt;/code&gt;, &lt;code&gt;C-f&lt;/code&gt;, and &lt;code&gt;C-b&lt;/code&gt;) to a link and try to follow it (&lt;code&gt;return&lt;/code&gt;) DuckDuckgo fails, displaying:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;'Oops, there was an error. Please try again.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If it persists, please email ops@duckduckgo.com'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Any ideas as to how to diagnose this problem? Essentially I cannot browse with &lt;code&gt;eww&lt;/code&gt;, although firefox and google-chrome work fine (whether I use DuckDuckgo or google search).&lt;/p&gt;&#xA;" OwnerUserId="15274" LastEditorUserId="253" LastEditDate="2017-03-17T17:21:52.300" LastActivityDate="2017-03-17T20:04:34.457" Title="eww cannot follow links displayed after keyword search" Tags="|eww|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31527" PostTypeId="2" ParentId="31526" CreationDate="2017-03-17T20:04:34.457" Score="0" Body="&lt;p&gt;I think the problem occurs because DDG is doing a JavaScript redirect to the selected link.  You can disable this by adding &quot;kd=-1&quot; into the URL query string.  This doesn't help specifically with running eww (although I'm sure it's easy enough to fix) but you can work around it by using a custom function to kick off a DDG search:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(defun duckduckgo (search-string)&#xA;  &quot;Search Duck Duck Go for SEARCH-STRING.&#xA;&#xA;Use kd=-1 to turn off redirecting - seems to be required in order&#xA;for result links to work in DDG.&quot;&#xA;  (interactive &quot;sDuckDuckGo for: &quot;)&#xA;  (let ((url-format &quot;https://duckduckgo.com/html/?q=%s&amp;kd=-1&quot;))&#xA;    (eww (format url-format (url-hexify-string search-string)))))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit - in fact it looks as if you ought to be able to just set eww-search-prefix to something like &quot;&lt;a href=&quot;https://duckduckgo.com/html/?kd=-1&amp;amp;q=&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://duckduckgo.com/html/?kd=-1&amp;amp;q=&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-17T20:04:34.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31528" PostTypeId="1" AcceptedAnswerId="31557" CreationDate="2017-03-17T21:41:51.337" Score="3" ViewCount="2335" Body="&lt;p&gt;I wish to change the code block background color in org mode but below example doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :background-color #eff0f1;&#xA;#+BEGIN_EXAMPLE&#xA;hello world!&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I insert inline css code with #+ATT_HTML&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="105" LastEditDate="2017-03-17T23:04:18.180" LastActivityDate="2019-03-10T09:18:52.860" Title="Org mode - change code block background color" Tags="|org-mode|coloring|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31529" PostTypeId="1" AcceptedAnswerId="31532" CreationDate="2017-03-17T23:05:36.797" Score="2" ViewCount="61" Body="&lt;p&gt;I found a function, that will kill all buffers except the current buffer that's open.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun kill-other-buffers () &#xA;  &quot;Kill all buffers but the current one.&#xA;Doesn't mess with special buffers.&quot;&#xA;  (interactive)&#xA;  (when (y-or-n-p &quot;Are you sure you want to kill all buffers but the current one? &quot;)&#xA;    (seq-each&#xA;     #'kill-buffer&#xA;     (delete (current-buffer) (seq-filter #'buffer-file-name (buffer-list))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It works great. However, when I have two windows open with a different buffer in each window, I noticed it kills the visible buffer in the other window too, except for the buffer where the cursor currently in is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I studied the manuals of Emacs, in order to detect the open buffers that are visible  in all windows. But I found not one. So I'm wondering if anyone have a good suggestion for this?&lt;/p&gt;&#xA;" OwnerUserId="6915" LastActivityDate="2017-03-18T00:51:37.700" Title="How modify this function, that it will detect the visibile buffers in all windows?" Tags="|buffers|window|kill-buffer|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31531" PostTypeId="1" CreationDate="2017-03-18T00:40:19.863" Score="1" ViewCount="163" Body="&lt;p&gt;&lt;code&gt;(define-key evil-normal-state-map (kbd &quot;C b&quot;) 'buffer-menu)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This obviously gives &lt;code&gt;Key sequence starts with non-prefix key&lt;/code&gt;&#xA;But I don't know what I need to unset to make it work.&lt;/p&gt;&#xA;" OwnerUserId="15216" LastEditorUserId="15216" LastEditDate="2017-03-18T08:58:50.427" LastActivityDate="2017-03-18T08:58:50.427" Title="How to bind &quot;control b&quot; (that is b pressed after control not with it) to buffer-menu?" Tags="|key-bindings|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31532" PostTypeId="2" ParentId="31529" CreationDate="2017-03-18T00:51:37.700" Score="3" Body="&lt;p&gt;You can iterate over the &lt;code&gt;window-list&lt;/code&gt; of each frame in &lt;code&gt;frame-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(delete (current-buffer) &#xA;        (seq-filter #'buffer-file-name (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could use:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let (buflist)&#xA;  (dolist (frame (frame-list))&#xA;    (dolist (window (window-list frame t))&#xA;      (push (window-buffer window) buflist)))&#xA;  (seq-filter (lambda (buf)&#xA;                (and (buffer-file-name buf)&#xA;                     (not (memq buf buflist))))&#xA;              (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could simplify that slightly using &lt;code&gt;walk-windows&lt;/code&gt; which accepts an ALL-FRAMES parameter:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let (buflist)&#xA;  (walk-windows (lambda (window)&#xA;                  (push (window-buffer window) buflist))&#xA;                t t)&#xA;  (seq-filter (lambda (buf)&#xA;                (and (buffer-file-name buf)&#xA;                     (not (memq buf buflist))))&#xA;              (buffer-list)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-18T00:51:37.700" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="31533" PostTypeId="2" ParentId="31531" CreationDate="2017-03-18T02:49:33.817" Score="3" Body="&lt;p&gt;You're missing a dash between &quot;C b&quot;, unless that's a typo.&lt;/p&gt;&#xA;" OwnerUserId="15208" LastActivityDate="2017-03-18T02:49:33.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31535" PostTypeId="2" ParentId="31531" CreationDate="2017-03-18T08:53:56.263" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This obviously gives Key sequence starts with non-prefix key But I don't know what I need to unset to make it work.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;k&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt; tells me:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;C runs the command evil-change-line (found in evil-normal-state-map),&#xA;which is an interactive compiled Lisp function in ‘evil-commands.el’.&#xA;&#xA;It is bound to C.&#xA;&#xA;(evil-change-line BEG END &amp;amp;optional TYPE REGISTER YANK-HANDLER)&#xA;&#xA;Change to end of line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That is the non-prefix binding for &lt;code&gt;C&lt;/code&gt; which you would need to unset.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-18T08:53:56.263" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31536" PostTypeId="1" AcceptedAnswerId="31537" CreationDate="2017-03-18T09:27:30.443" Score="0" ViewCount="437" Body="&lt;p&gt;I have the following function attached to &lt;code&gt;f2&lt;/code&gt; key in latex mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun latex-compile ()&#xA;      &quot;Runs pdflatex on current file&quot;&#xA;      (interactive)&#xA;      (let* ((file-name (shell-quote-argument (buffer-file-name)))&#xA;            (process (start-process-shell-command&#xA;                           &quot;pdflatex&quot;&#xA;                           &quot;*async pdflatex*&quot;&#xA;                           (concat &quot;pdflatex &quot; file-name))))&#xA;            (set-process-sentinel process 'latex-sentinel)&#xA;            (setq new-window (split-window-below 30))&#xA;            (set-window-buffer new-window &quot;*async pdflatex*&quot;)&#xA;            (other-window 1)&#xA;            (set-process-query-on-exit-flag process nil)&#xA;            (local-set-key (kbd &quot;z&quot;) 'latex-kill-async-pdflatex)&#xA;            ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;pdflatex&lt;/code&gt; program is located in &lt;code&gt;/usr/local/texlive/2016/bin/i386-linux&lt;/code&gt;. I have the following in .bash_profile and .bashrc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PATH=$PATH:/usr/local/texlive/2016/bin/i386-linux&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I click &lt;code&gt;&amp;lt;f2&amp;gt;&lt;/code&gt; in GUI Emacs, it says: &quot;/usr/bin/bash: pdflatex: command not found&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in console Emacs it works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq exec-path (append exec-path '(&quot;/usr/local/texlive/2016/bin/i386-linux&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to .emacs, but it didn't help.&lt;/p&gt;&#xA;" OwnerUserId="2389" LastActivityDate="2017-03-18T13:14:30.463" Title="External command doesn't run in GUI mode" Tags="|bash|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31537" PostTypeId="2" ParentId="31536" CreationDate="2017-03-18T11:20:26.050" Score="3" Body="&lt;p&gt;&lt;code&gt;exec-path&lt;/code&gt; is how Emacs finds executables, but you're not asking Emacs to find &lt;code&gt;pdflatex&lt;/code&gt;, you're only asking it to find a shell, and the shell is then trying to run &lt;code&gt;pdflatex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The shell will be using the &lt;code&gt;PATH&lt;/code&gt; in its environment. Your problem is probably that the way in which you start your GUI Emacs does not involve setting that &lt;code&gt;PATH&lt;/code&gt; value in its environment, whereas when you start terminal Emacs you're doing so from a bash session in which your bash init files have run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(How &lt;em&gt;do&lt;/em&gt; you start your GUI Emacs?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either ensure that when GUI Emacs is started it has the desired PATH, or else you can set the value in the &lt;code&gt;process-environment&lt;/code&gt; variable in Emacs using &lt;code&gt;setenv&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this temporarily for a command if you prefer. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((process-environment (copy-sequence process-environment)))&#xA;  (setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:/usr/local/texlive/2016/bin/i386-linux&quot;))&#xA;  (start-process-shell-command &quot;path&quot; &quot;*path*&quot; &quot;echo $PATH&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;A modified version of the original function might look like:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun latex-compile ()&#xA;  &quot;Runs pdflatex on current file&quot;&#xA;  (interactive)&#xA;  (let ((process-environment (copy-sequence process-environment)))&#xA;    (setenv &quot;PATH&quot; &quot;$PATH:/usr/local/texlive/2016/bin/i386-linux&quot; t)&#xA;    (let* ((file-name (shell-quote-argument (buffer-file-name)))&#xA;           (process (start-process-shell-command&#xA;                     &quot;pdflatex&quot;&#xA;                     &quot;*async pdflatex*&quot;&#xA;                     (concat &quot;pdflatex &quot; file-name))))&#xA;      (set-process-sentinel process 'latex-sentinel)&#xA;      (setq new-window (split-window-below 30))&#xA;      (set-window-buffer new-window &quot;*async pdflatex*&quot;)&#xA;      (other-window 1)&#xA;      (set-process-query-on-exit-flag process nil)&#xA;      (local-set-key (kbd &quot;z&quot;) 'latex-kill-async-pdflatex))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-18T13:14:30.463" LastActivityDate="2017-03-18T13:14:30.463" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31538" PostTypeId="2" ParentId="31528" CreationDate="2017-03-18T12:33:00.403" Score="4" Body="&lt;p&gt;You can try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+HTML_HEAD: &amp;lt;style type=&quot;text/css&quot;&amp;gt;.example {background-color: #eff0f1; color: #ff0000;}&amp;lt;/style&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10801" LastActivityDate="2017-03-18T12:33:00.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31539" PostTypeId="2" ParentId="26886" CreationDate="2017-03-18T13:03:17.350" Score="1" Body="&lt;p&gt;You have hopefully figured this out by now but I think you need &lt;code&gt;(setq smtpmail-stream-type 'starttls)&lt;/code&gt;. You've specified TLS directly which won't work if the service expects unencrypted connections at first with starttls support.&lt;/p&gt;&#xA;" OwnerUserId="15250" LastActivityDate="2017-03-18T13:03:17.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31542" PostTypeId="2" ParentId="17901" CreationDate="2017-03-18T15:42:22.287" Score="0" Body="&lt;p&gt;I hit exactly the same problem when upgrading to Ubuntu 16.04 (from U14.04 LTS). The new value of the TERM variable (as mentioned in several other answers) seemed to be a culprit. The solution was to set the TERM variable to value 'xterm' instead of the current default 'xterm-256color':&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TERM=xterm emacs -nw&lt;/p&gt;&#xA;&#xA;&lt;p&gt;brought back the old colors, legible on dark backgrounds.&#xA;NB. The new 256 color palette seems to be optimized for a dark text on a light background...&lt;/p&gt;&#xA;" OwnerUserId="15251" LastActivityDate="2017-03-18T15:42:22.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31543" PostTypeId="1" AcceptedAnswerId="31547" CreationDate="2017-03-18T16:49:40.447" Score="3" ViewCount="221" Body="&lt;p&gt;I would like to convert .doc files to plain text when opening them in Emacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command line tool antiword can read Word files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I pass them to antiword and then get the result in an emacs buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be done automatically so it happens each time i open a doc file in dired?&lt;/p&gt;&#xA;" OwnerUserId="14988" LastEditorUserId="14988" LastEditDate="2017-03-18T18:10:45.270" LastActivityDate="2022-08-12T17:06:25.583" Title="How do I convert .doc file to plain text on demand?" Tags="|dired|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31545" PostTypeId="2" ParentId="30481" CreationDate="2017-03-18T19:41:21.343" Score="0" Body="&lt;p&gt;I came to this question looking for a simple way to sort all the headings in an Org buffer, recursively. Building on the answer by @ebpa, this is what I came up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-sort-buffer ()&#xA;  &quot;Sort all entries in the current buffer, recursively.&quot;&#xA;  (interactive)&#xA;  (org-map-entries (lambda ()&#xA;                     (condition-case x&#xA;                         (org-sort-entries nil ?a)&#xA;                       (user-error)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12534" LastActivityDate="2017-03-18T19:41:21.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31546" PostTypeId="1" AcceptedAnswerId="31604" CreationDate="2017-03-18T20:41:04.557" Score="1" ViewCount="662" Body="&lt;p&gt;I would like to change the &quot;electric-indent&quot; behavior in emacs, at least in the LaTeX major mode, but possibly in some other ones as well.  What I would like is to retain the behavior that when hitting return, the next line is automatically indented to the level that the previous line was indented, but to disable all other ways of setting off auto indentation.  So for example, in LaTeX mode, when I type \begin{equation} followed by return, the next line should &lt;em&gt;not&lt;/em&gt; be indented automatically any further than the \begin{equation} may have already been.  But after I manually indent the next line, the following line would then be indented to that level.  E.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{equation} % No *auto* indent when hitting 'return' on this line&#xA;  y = f(x), % Manually indented; but now 'return' should indent next line&#xA;  x \in D &#xA;\end{equation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the behavior I'm used to from using TeXShop.  It also seems to be the behavior of emacs in the Text major mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it helps I should note that I am a new emacs user (I've gone through the very first tutorial, am currently going through the &quot;Emacs Lisp Intro&quot;, and have cut-and-paste lisp code into my .emacs file from various places online to get certain customized behavior, but do not understand all of it yet).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have searched through other questions, and there are many similar ones, for example &lt;a href=&quot;https://emacs.stackexchange.com/questions/20896/change-the-behaviour-of-ret-with-electric-indent-to-only-indent-the-new-line&quot;&gt;this&lt;/a&gt;, &lt;a href=&quot;https://emacs.stackexchange.com/questions/30147/disabling-electric-indent-mode-for-one-mode-latex-mode-only&quot;&gt;this&lt;/a&gt;, &lt;a href=&quot;https://emacs.stackexchange.com/questions/24610/how-to-see-the-implementation-of-the-auto-indent-procedure&quot;&gt;this&lt;/a&gt;, &lt;a href=&quot;https://emacs.stackexchange.com/questions/3440/customize-newline-and-indent-function&quot;&gt;this&lt;/a&gt;, and &lt;a href=&quot;https://emacs.stackexchange.com/questions/3083/how-to-indent-items-in-latex-auctex-itemize-environments&quot;&gt;this&lt;/a&gt;, but I couldn't find something exactly fitting this one.  But it could be I missed it, or simply didn't understand how to adapt one of the answers to these to my situation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, this should perhaps be a separate question, but if anyone could recommend to me a good way to learn how emacs works, something appropriate to my experience level, I would appreciate it.  &lt;/p&gt;&#xA;" OwnerUserId="15252" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-03-21T12:04:46.173" Title="Customize electric indent" Tags="|indentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31547" PostTypeId="2" ParentId="31543" CreationDate="2017-03-18T21:13:37.393" Score="4" Body="&lt;p&gt;You could use a custom file handler to automatically convert the doc file whenever Emacs tries to load it.  To do this you need a function like:&lt;/p&gt;&#xA;&lt;pre&gt;&#xA;(defun antiword-file-handler (name &amp;rest args)&#xA;  (assert (eq name 'insert-file-contents))&#xA;  (let ((file-name (expand-file-name (car args))))&#xA;    (call-process &quot;antiword&quot; nil t nil file-name)&#xA;    (setq buffer-file-name file-name)&#xA;    ;; This prevents a &quot;File exists, but cannot be read&quot; error:&#xA;    (set-visited-file-modtime)&#xA;    ;; insert-file-contents should return the filename and size in characters&#xA;    (list file-name (point))))&#xA;&lt;/pre&gt;&#xA;&lt;p&gt;and you need to set the following property on it:&lt;/p&gt;&#xA;&lt;pre&gt;&#xA;(put 'antiword-file-handler 'operations '(insert-file-contents))&#xA;&lt;/pre&gt;&#xA;&lt;p&gt;finally, add the following to file-name-handler-alist:&lt;/p&gt;&#xA;&lt;pre&gt;&#xA;(&quot;\\.doc&quot; . antiword-file-handler)&#xA;&lt;/pre&gt;&#xA;&lt;p&gt;Whenever Emacs tries to load a file with a .doc extension it should then decode it by running it through antiword and inserting the contents into the buffer.  The above should work (it worked for me) but it may well need extending as there are various other arguments to insert-file-contents that probably ought to be handled correctly...&lt;/p&gt;&#xA;" OwnerUserId="8583" LastEditorUserId="859" LastEditDate="2022-08-12T17:06:25.583" LastActivityDate="2022-08-12T17:06:25.583" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="31548" PostTypeId="1" AcceptedAnswerId="31551" CreationDate="2017-03-18T23:41:29.723" Score="3" ViewCount="1130" Body="&lt;p&gt;I'm trying to open a remote shell after connecting to a machine using Tramp with the plink method on MS Windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However every time I call &lt;code&gt;shell&lt;/code&gt; it prompts me for 'Remote shell path' and suggests a local directory.  I think I have to type &lt;code&gt;/plink:Server:/bin/bash&lt;/code&gt; to be able to run the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to avoid having to do this every time I want to run &lt;code&gt;shell&lt;/code&gt; on a remote machine?&lt;/p&gt;&#xA;" OwnerUserId="13358" LastEditorUserId="105" LastEditDate="2017-03-19T00:56:56.800" LastActivityDate="2017-03-19T09:54:20.530" Title="MS Windows Tramp Remote Shell" Tags="|microsoft-windows|shell|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31549" PostTypeId="1" CreationDate="2017-03-19T02:21:26.500" Score="1" ViewCount="576" Body="&lt;p&gt;I'm using &lt;code&gt;flycheck&lt;/code&gt; in &lt;code&gt;cc-mode&lt;/code&gt; and it reminds me when I'm typing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;member reference type 'ListNode *' is a pointer; did you mean to use '-&amp;gt;'?&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know if there's any package can convert &lt;code&gt;.&lt;/code&gt; into &lt;code&gt;-&amp;gt;&lt;/code&gt; automatically when typing in C/C++ code, just like Qt Creator's default behavior?&lt;/p&gt;&#xA;" OwnerUserId="515" LastActivityDate="2017-03-19T12:34:49.637" Title="Auto convert dot `.` to arrow `-&gt;` in C/C++?" Tags="|flycheck|c++|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31550" PostTypeId="2" ParentId="6111" CreationDate="2017-03-19T07:26:49.287" Score="0" Body="&lt;p&gt;This issue is not specific to Emacs. Users of other programs that can be controlled with keybindings suffer too. Emacs has it to a greater degree because it has more commands. The fundamental reason is that there are not enough keys for all commands we need. If you are not interested in theory, skip to the last paragraph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An obvious solution is to add an additional keyboard for Emacs commands. Then you will have 200 keys in total. Then you will type even slower. Actually, 100 keys on the standard keyboard is too many for touch-typing. I estimate that a human can reach at most 22 keys with one hand without moving the wrist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To type quicker, you move modifier keys under the fingers. Then there is not enough keys for Latin letters. For example, 'j' is a modifier key, pressing 'j' and then pressing 'd' produces the letter 'j'. If you don't like pressing a modifier key for every letter, you use &lt;em&gt;modes&lt;/em&gt; and modal editors. For example, in the insert mode, 'j' produces the letter 'j'; in the command mode, 'j' preforms cut (kill); there are keys to switch modes. (These examples are not implemented in any editor, they are just examples.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vim is a renowned modal editor. It was mentioned above. As Emacs is programmable, there is &lt;a href=&quot;https://github.com/chrisdone/god-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;a modal minor mode called the God Mode&lt;/a&gt;. It serves the need, though it can be improved. In the God Mode, you don't need to learn a new keybinding for every Emacs command, however, you need to translate every keybinding into a sequence of keys in your head. For example, 'g w' produces the command bound to 'M-w'.&lt;/p&gt;&#xA;" OwnerUserId="15052" LastActivityDate="2017-03-19T07:26:49.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31551" PostTypeId="2" ParentId="31548" CreationDate="2017-03-19T09:54:20.530" Score="3" Body="&lt;p&gt;You can use &lt;code&gt;explicit-shell-file-name&lt;/code&gt; for this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq explicit-shell-file-name &quot;/bin/bash&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The disadvantage is, that this setting is valid for all shell buffers you open, local and remote ones. In the upcoming Emacs 26, there is support for connection-local variables. This will give you the ability to set &lt;code&gt;explicit-shell-file-name&lt;/code&gt; for different remote machines with a different value.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-03-19T09:54:20.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31552" PostTypeId="1" CreationDate="2017-03-19T12:16:14.403" Score="2" ViewCount="61" Body="&lt;p&gt;If the cursor is on &lt;code&gt;file&lt;/code&gt; of a line &lt;code&gt;\input{file}&lt;/code&gt; in a latex file, &lt;code&gt;helm-find-files&lt;/code&gt; doesn't recognize that I want to open &lt;code&gt;file.tex&lt;/code&gt;, however calling &lt;code&gt;ffap&lt;/code&gt; does. If I write &lt;code&gt;\input{file.tex}&lt;/code&gt; it also works with helm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I make helm to recognize this case (same with &lt;code&gt;\include&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2323" LastActivityDate="2017-03-19T12:16:14.403" Title="Make helm-find-files work with `\input{file}` in latex files" Tags="|helm|auctex|ffap|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31553" PostTypeId="2" ParentId="31549" CreationDate="2017-03-19T12:24:16.910" Score="2" Body="&lt;p&gt;Not completely automatic, but &lt;code&gt;flycheck-ycmd&lt;/code&gt; supports that because it uses Clang under the hood and Clang's fix-its are available from Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Position the point under the variable, just do &lt;code&gt;M-x ycmd-fixit&lt;/code&gt; and accept the proposed fix-it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can disable the prompt before applying a fix-it by eval'ing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq ycmd-confirm-fixit nil)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="15258" LastEditorUserId="15258" LastEditDate="2017-03-19T12:34:49.637" LastActivityDate="2017-03-19T12:34:49.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31554" PostTypeId="1" AcceptedAnswerId="31566" CreationDate="2017-03-19T14:01:18.580" Score="1" ViewCount="225" Body="&lt;p&gt;In &lt;code&gt;compilation-mode&lt;/code&gt;, how can I make the default py.test output have clickable links to source code (when using py.test's default formatting of tracebacks)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does somebody already have appropriate &lt;code&gt;compilation-error-regexp-alist-alist&lt;/code&gt; entries?&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="5495" LastEditDate="2017-03-23T23:11:37.727" LastActivityDate="2017-03-24T05:50:08.003" Title="Clickable links to py.test stack frame lines in compilation-mode" Tags="|python|compilation-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31556" PostTypeId="2" ParentId="28583" CreationDate="2017-03-19T15:40:22.293" Score="1" Body="&lt;p&gt;Turns out that this was removed in source blocks in &lt;a href=&quot;http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=f8b42e8&quot; rel=&quot;nofollow noreferrer&quot;&gt;this commit&lt;/a&gt;, and presumably the same goes for quote &amp;amp; verse blocks as well.&lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2017-03-19T15:40:22.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31557" PostTypeId="2" ParentId="31528" CreationDate="2017-03-19T17:50:26.713" Score="7" Body="&lt;p&gt;Yes, you can do what you want with &lt;code&gt;#+ATTR_HTML&lt;/code&gt;. However, your HTML is incorrect. If you look at the output you will see &lt;code&gt;&amp;lt;pre class=&quot;example&quot; background-color=&quot;#eff0f1;&quot;&amp;gt;&lt;/code&gt; but there is no background-color attribute in HTML. Instead, use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_HTML: :style background-color:#eff0f1;&#xA;#+BEGIN_EXAMPLE&#xA;hello world!&#xA;#+END_EXAMPLE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will generate &lt;code&gt;&amp;lt;pre class=&quot;example&quot; style=&quot;background-color:#eff0f1;&quot;&amp;gt;&lt;/code&gt;, which will apply color to that block only.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-03-19T17:50:26.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31558" PostTypeId="1" AcceptedAnswerId="31569" CreationDate="2017-03-19T20:04:48.740" Score="3" ViewCount="1511" Body="&lt;p&gt;I want to replace below example&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;line1 ![img](170319_first.png &quot;test&quot;) &#xA;line2 ![img](170319_second.png)&#xA;line3 ![img](/assets/170319_second.png) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;line1 ![img](/assets/170319_first.png &quot;test&quot;) &#xA;line2 ![img](/assets/170319_second.png)&#xA;line3 ![img](/assets/170319_second.png) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which means:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do not replace line3 case (file name start with &quot;/assets&quot; already)&lt;/li&gt;&#xA;&lt;li&gt;Add &quot;/assets/&quot; to file name for line1 case (end with a space)&lt;/li&gt;&#xA;&lt;li&gt;Add &quot;/assets/&quot; to file name for line2 case also (end with a ')').&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I try to use below code but it doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq str &quot;&#xA;line1 ![img](170319_first.png \&quot;test\&quot;) &#xA;line2 ![img](170319_second.png)&#xA;line3 ![img](/assets/170319_second.png)&#xA;&quot;)&#xA;(with-temp-buffer&#xA;  (insert str)&#xA;  (goto-char (point-min))&#xA;  (setq regex1 &quot;\\!\\[img\\](\\([^/]*?\\)\\([ \\|)]\\)&quot;)&#xA;  (while (re-search-forward regex1 nil t)&#xA;    (setq regex2 (format &quot;![img](/assets/%s&quot; (match-string 1)))&#xA;    (replace-match regex2 nil t))&#xA;  (print (buffer-string))&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the result not correct:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;line1 ![img](/assets/170319_first.png\&quot;test\&quot;) &#xA;line2 ![img](/assets/170319_second.png&#xA;line3 ![img](/assets/170319_second.png)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously, the ' ' and ')' has been replaced also. but I didn't include it in the match group.&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="105" LastEditDate="2017-03-19T21:12:20.047" LastActivityDate="2017-03-22T21:43:16.537" Title="elisp - regex to replace substring with multiple conditions" Tags="|regular-expressions|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31559" PostTypeId="1" CreationDate="2017-03-19T21:51:11.517" Score="2" ViewCount="422" Body="&lt;p&gt;I successfully managed to add birthdays with &lt;a href=&quot;https://julien.danjou.info/projects/emacs-packages#org-contacts&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-contacts&lt;/a&gt; using the &lt;code&gt;:BIRTHDAY:&lt;/code&gt; property, but what about some other kind of anniversaries such as wedding anniversaries? How can I set them? Can I use the &lt;code&gt;:WEDDING:&lt;/code&gt; property for example?&lt;/p&gt;&#xA;" OwnerDisplayName="user14082" LastActivityDate="2017-03-19T21:51:11.517" Title="Wedding anniversaries with org-contacts" Tags="|org-mode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31560" PostTypeId="1" AcceptedAnswerId="31565" CreationDate="2017-03-19T23:22:19.583" Score="3" ViewCount="662" Body="&lt;p&gt;I cannot use C-x o to switch to another frame while in a term frame. Here are the steps to replicate the issue:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;press &lt;code&gt;C-x 2&lt;/code&gt; to split frame&lt;/li&gt;&#xA;&lt;li&gt;press &lt;code&gt;C-x o&lt;/code&gt; to change focus to new frame&lt;/li&gt;&#xA;&lt;li&gt;press &lt;code&gt;M-x term RETURN RETURN&lt;/code&gt; to switch new frame to term window with bash&lt;/li&gt;&#xA;&lt;li&gt;press &lt;code&gt;C-x o&lt;/code&gt; to return to previous frame &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;*Messages*&lt;/code&gt; says &lt;code&gt;C-x o is undefined&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="15184" LastEditorUserId="15184" LastEditDate="2017-03-24T10:01:13.213" LastActivityDate="2017-03-24T10:01:13.213" Title="unable to use C-x o to switch frame focus while in term frame" Tags="|key-bindings|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31561" PostTypeId="1" CreationDate="2017-03-20T00:08:43.523" Score="2" ViewCount="676" Body="&lt;p&gt;I'm new to Emacs, and would like to know how to append my init.el file to use specific fonts for different languages. Specifically, for English (and other Latin-based languages, I guess) I would like Emacs to use DeJaVu Mono, but for Thai I would like it to use TH Sarabun&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Fontsets.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Fontsets.html&lt;/a&gt; and will admit that I understand nothing on that page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm actually trying to set up emacs to be an environment to write linguistic documentation, and am not a programmer, though I am willing to learn, though perhaps I need some hand holding, as I've never attempted something like this before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15265" LastActivityDate="2017-06-19T17:55:44.193" Title="Set different fonts for different charsets" Tags="|init-file|fonts|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31562" PostTypeId="1" CreationDate="2017-03-20T01:32:29.893" Score="1" ViewCount="566" Body="&lt;p&gt;I'm trying to setup the F1 key for documentation within typescript mode only. Here is what I got so far.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package tide&#xA;  :init&#xA;  ;; (add-hook 'before-save-hook 'tide-format-before-save)  ;; formats the buffer before saving&#xA;  (add-hook 'js2-mode-hook #'setup-tide-mode)  ;; JS Setup&#xA;  (add-hook 'typescript-mode-hook #'setup-tide-mode)&#xA;  :defer 5&#xA;  :config&#xA;  ;; TIDE setup&#xA;  (defun setup-tide-mode ()&#xA;    (interactive)&#xA;    (tide-setup)&#xA;    (flycheck-mode +1)&#xA;    (setq flycheck-check-syntax-automatically '(save mode-enabled))&#xA;    (eldoc-mode +1)&#xA;    ;; company is an optional dependency. You have to&#xA;    ;; install it separately via package-install&#xA;    (company-mode +1)&#xA;    (local-set-key [f1] 'tide-documentation-at-point))&#xA;&#xA;  ;; aligns annotation to the right hand side&#xA;  (setq company-tooltip-align-annotations t)&#xA;&#xA;  ;; Set tide-tsserver&#xA;  (setq tide-tsserver-executable &quot;node_modules/typescript/bin/tsserver&quot;)&#xA;&#xA;  ;; Add node to the path&#xA;  (setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:~/n/bin&quot;))&#xA;  (setq exec-path (append exec-path '(&quot;~/n/bin&quot;)))&#xA;&#xA;  ;; format options&#xA;  (setq tide-format-options '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil))&#xA;  ;; see https://github.com/Microsoft/TypeScript/blob/cc58e2d7eb144f0b2ff89e6a6685fb4deaa24fde/src/server/protocol.d.ts#L421-473 for the full list available options&#xA;  )&#xA;&#xA;(use-package web-mode&#xA;  :init&#xA;  ;; TSX setup&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.tsx\\'&quot; . web-mode))&#xA;  (add-hook 'web-mode-hook&#xA;            (lambda ()&#xA;              (when (string-equal &quot;tsx&quot; (file-name-extension buffer-file-name))&#xA;                (setup-tide-mode))))&#xA;&#xA;  ;; JSX Setup&#xA;  (add-to-list 'auto-mode-alist '(&quot;\\.jsx\\'&quot; . web-mode))&#xA;  (add-hook 'web-mode-hook&#xA;            (lambda ()&#xA;              (when (string-equal &quot;jsx&quot; (file-name-extension buffer-file-name))&#xA;                (setup-tide-mode))))&#xA;  :defer 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If try the following in sketch it also doesn't work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun setup-tide-shortcuts ()&#xA;  (local-set-key [f1] 'tide-documentation-at-point))&#xA;&#xA;(add-hook 'typescript-mode-hook #'setup-tide-shortcuts)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I set the hook up using global it works&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [f1] 'tide-documentation-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Problem here is that it is set to global so when I work on non-typescript files it asks me to start a tide server and I would like to setup F1 as the documentation key for all different languages.&lt;/p&gt;&#xA;" OwnerUserId="9463" LastActivityDate="2019-10-07T22:00:45.113" Title="Setup a local key for help in tide" Tags="|key-bindings|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31563" PostTypeId="2" ParentId="31558" CreationDate="2017-03-20T01:47:15.177" Score="3" Body="&lt;p&gt;Since the condition of 2 and 3 can be simplified to: the character after &quot;![img](&quot; not be '/', below code works for this case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq str &quot;&#xA;line1 ![img](170319_first.png \&quot;test\&quot;) &#xA;line2 ![img](170319_second.png)&#xA;line3 ![img](/assets/170319_second.png)&#xA;&quot;)&#xA;(setq regex1 &quot;\\!\\[img\\](\\([^/]\\)&quot;)&#xA;(setq str (replace-regexp-in-string regex1 &quot;/assets/\\1&quot; str nil nil 1))&#xA;(print str)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;line1 ![img](/assets/170319_first.png \&quot;test\&quot;) &#xA;line2 ![img](/assets/170319_second.png)&#xA;line3 ![img](/assets/170319_second.png)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14840" LastActivityDate="2017-03-20T01:47:15.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31564" PostTypeId="1" AcceptedAnswerId="31743" CreationDate="2017-03-20T04:09:14.977" Score="1" ViewCount="264" Body="&lt;p&gt;I'd like to know how to indent multiple lines while Python is my major mode. The link below answers my question for the most part:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/2585091/emacs-bulk-indent-for-python&quot;&gt;https://stackoverflow.com/questions/2585091/emacs-bulk-indent-for-python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, is there a way to accomplish this while you have the following line in your &lt;code&gt;.emacs&lt;/code&gt; file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(cua-mode t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I attempt &lt;code&gt;C-c &amp;gt;&lt;/code&gt; while &lt;code&gt;cue-mode&lt;/code&gt; is enabled, nothing happens.&lt;/p&gt;&#xA;" OwnerUserId="15184" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2019-02-12T22:10:28.000" Title="Emacs bulk indent for Python while `cua-mode` is enabled" Tags="|key-bindings|indentation|cua-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31565" PostTypeId="2" ParentId="31560" CreationDate="2017-03-20T04:33:27.220" Score="5" Body="&lt;p&gt;See:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-c char&lt;/code&gt; -- &quot;This is equivalent to &lt;code&gt;C-x char&lt;/code&gt; in normal Emacs. For example, &lt;code&gt;C-c o&lt;/code&gt; invokes the global binding of &lt;code&gt;C-x o&lt;/code&gt;, which is normally &lt;code&gt;other-window&lt;/code&gt;.&quot;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-03-20T04:33:27.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31566" PostTypeId="2" ParentId="31554" CreationDate="2017-03-20T05:30:49.047" Score="1" Body="&lt;p&gt;Running &lt;code&gt;py.test&lt;/code&gt; should automatically do it. Go to any directory or python file, run &lt;code&gt;M-x compile RET py.test RET&lt;/code&gt;, you will get colorized output and traceback with hyperlinks like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rboNV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rboNV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is better to use elpy as it provides better integration with test runners.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastEditorUserId="5187" LastEditDate="2017-03-24T05:50:08.003" LastActivityDate="2017-03-24T05:50:08.003" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31567" PostTypeId="1" AcceptedAnswerId="31568" CreationDate="2017-03-20T08:40:32.713" Score="2" ViewCount="452" Body="&lt;p&gt;I want to mark some messages as &quot;important&quot;, and later on I can search for all emails marked as important. This is like Gmail's custom label function. Can I do it with mu4e?&lt;/p&gt;&#xA;" OwnerUserId="15267" LastActivityDate="2017-03-20T09:18:14.583" Title="how to do &quot;mark-as-important&quot; in mu4e?" Tags="|email|mu4e|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31568" PostTypeId="2" ParentId="31567" CreationDate="2017-03-20T09:18:14.583" Score="3" Body="&lt;p&gt;I think you want to &lt;code&gt;flag&lt;/code&gt; messages. Try using &lt;code&gt;+&lt;/code&gt; in the headers view.&lt;/p&gt;&#xA;" OwnerUserId="15268" LastActivityDate="2017-03-20T09:18:14.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31569" PostTypeId="2" ParentId="31558" CreationDate="2017-03-20T09:53:34.730" Score="1" Body="&lt;p&gt;You want to replace &lt;code&gt;SUBEXP&lt;/code&gt; (group) 1 only, so you should pass that argument to &lt;code&gt;replace-match&lt;/code&gt; and then reduce the replacement string to only what is needed for that group.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also suggest &lt;em&gt;not&lt;/em&gt; passing &lt;code&gt;LITERAL&lt;/code&gt; as you can then simply use a back-reference &lt;code&gt;&quot;\\1&quot;&lt;/code&gt; in the replacement string to substitute the original text matched by group 1, which eliminates the need to separately construct a replacement string using &lt;code&gt;(match-string 1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That leaves us with just:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(while (re-search-forward regex1 nil t)&#xA;  (replace-match &quot;/assets/\\1&quot; nil nil nil 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-22T21:43:16.537" LastActivityDate="2017-03-22T21:43:16.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31570" PostTypeId="1" CreationDate="2017-03-20T10:02:40.407" Score="3" ViewCount="1191" Body="&lt;p&gt;I'd like to calculate duration time between two dates in &lt;code&gt;calc&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;2017-03-21 Mon 18:45&amp;gt; - &amp;lt;2017-03-20 Mon 18:45&amp;gt; = 24 hr&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can insert a date to &lt;code&gt;calc&lt;/code&gt; by typing &lt;code&gt;' &amp;lt;2017-03-20 18:45&amp;gt;&lt;/code&gt; at &lt;code&gt;calc&lt;/code&gt; prompt.  I can change the date format by typing &lt;code&gt;dd10&lt;/code&gt; to &lt;code&gt;org-format&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I subtract &lt;code&gt;&amp;lt;2017-03-20 Mon 18:45&amp;gt;&lt;/code&gt; from &lt;code&gt;&amp;lt;2017-03-21 Mon 18:45&amp;gt;&lt;/code&gt;, I got &lt;code&gt;1.000035&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i get duration in hours and minutes?&lt;/p&gt;&#xA;" OwnerUserId="2055" LastEditorUserId="2055" LastEditDate="2017-03-21T00:05:45.177" LastActivityDate="2017-03-25T17:46:55.903" Title="How can I calc duration between two dates" Tags="|calc|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31571" PostTypeId="1" AcceptedAnswerId="31574" CreationDate="2017-03-20T11:16:39.947" Score="0" ViewCount="418" Body="&lt;p&gt;If I wanted a list of all TODO entries with a certain tag, or set of tags, how would I search for them in org-mode?&lt;/p&gt;&#xA;" OwnerUserId="3945" LastActivityDate="2017-03-20T13:36:42.423" Title="How to find all TODO with a certain tag?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31572" PostTypeId="1" CreationDate="2017-03-20T12:39:40.453" Score="3" ViewCount="394" Body="&lt;p&gt;Is it possible to detect and set the correct ispell language based on the contents of the buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And beyond that: A markdown file can contain multiple human languages at the same time, perhaps Swedish in paragraphs but english in code sections, is it possible to use different dictionaries for different parts of the buffer?&lt;/p&gt;&#xA;" OwnerUserId="2325" LastActivityDate="2021-11-14T15:27:37.033" Title="Detect language in buffer" Tags="|ispell|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31574" PostTypeId="2" ParentId="31571" CreationDate="2017-03-20T13:36:42.423" Score="4" Body="&lt;p&gt;To do this interactively type C-c a m &#xA;then type:&#xA;tag+TODO=&quot;TODO&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;replace tag with the one you want to search on.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-03-20T13:36:42.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31575" PostTypeId="1" CreationDate="2017-03-20T13:59:04.233" Score="1" ViewCount="38" Body="&lt;p&gt;My package depends upon &lt;strong&gt;org 9&lt;/strong&gt;. I want to use cask to enforce this dependency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way to specify this in my cask file would seem to be &lt;code&gt;(depends-on &quot;org&quot; &quot;9.0.1&quot;)&lt;/code&gt; as documented&#xA;&lt;a href=&quot;https://cask.github.io/dsl.html#depends-on&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However cask seems to be ignoring the version specified.&#xA;The following is some sample output demonstrating this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; cat Cask &amp;amp;&amp;amp; cask install &amp;amp;&amp;amp; cask update &amp;amp;&amp;amp; cask eval &quot;(progn (require 'org) (message (org-version)))&quot; &amp;amp;&amp;amp; cask --version &amp;amp;&amp;amp; emacs -q --eval &quot;(progn (require 'org) (message (org-version)))&quot; --batch&#xA;(source gnu)&#xA;(source melpa)&#xA;&#xA;(package &quot;org-db-link&quot; &quot;0.1.0&quot; &quot;Quickly navigate and search your emacs org trees&quot;)&#xA;(files &quot;org-db-link.el&quot;)&#xA;&#xA;(depends-on &quot;org&quot; &quot;9.0.1&quot;)&#xA;8.2.10&#xA;0.8.1&#xA;Loading 00debian-vars...&#xA;Loading /etc/emacs/site-start.d/50autoconf.el (source)...&#xA;&#xA;Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...&#xA;Loading debian-ispell...&#xA;Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...&#xA;Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...&#xA;Loading /etc/emacs/site-start.d/50ecasound-el.el (source)...&#xA;Loading /etc/emacs/site-start.d/50festival.el (source)...&#xA;Loading /etc/emacs/site-start.d/50pylint.el (source)...&#xA;Loading /etc/emacs/site-start.d/50python-docutils.el (source)...&#xA;Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;    8.2.10&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;```&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried running &lt;code&gt;cask upgrade&lt;/code&gt; but this did not help.&lt;/p&gt;&#xA;" OwnerUserId="14161" LastActivityDate="2017-03-20T13:59:04.233" Title="Cask seems to be ignoring depends upon" Tags="|cask|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31577" PostTypeId="1" AcceptedAnswerId="31580" CreationDate="2017-03-20T14:43:15.547" Score="3" ViewCount="1194" Body="&lt;p&gt;I generated a &lt;code&gt;.dir-locals.el&lt;/code&gt; by calling the function &lt;code&gt;add-dir-local-variable&lt;/code&gt;, giving it the path for the project for which I want the variable, the variable itself, and its value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The generated file went to my home directory (not the project path as I expected), and had the following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;; Directory Local Variables&#xA;;;; For more information see (info &quot;(emacs) Directory Variables&quot;)&#xA;&#xA;((&quot;~/tmp/test_test_dir_local&quot;&#xA;  (indent-tabs-mode . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I went on and created a file &lt;code&gt;a.c&lt;/code&gt; in that directory, and copied &lt;code&gt;.dir-locals.el&lt;/code&gt; there for good measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The indent in that file is still set as spaces, as per my &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;. I expected it to be tabs, as per the local &lt;code&gt;.dir-locals.el&lt;/code&gt;. I tried restarting emacs, but that did not work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What did I do wrong, or misunderstand?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am on Mac OS Sierra.&lt;/p&gt;&#xA;" OwnerUserId="6655" LastEditorUserId="6655" LastEditDate="2017-03-20T15:26:24.857" LastActivityDate="2017-03-20T15:38:08.447" Title=".dir-local.el misunderstanding" Tags="|local-variables|directory-local-variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31580" PostTypeId="2" ParentId="31577" CreationDate="2017-03-20T15:38:08.447" Score="10" Body="&lt;p&gt;When you call &lt;code&gt;add-dir-local-variable&lt;/code&gt;, it assumes you are already in the directory you want to apply the directory-local variable to. When it prompts for a directory, it's asking if you want the variable applied to a &lt;em&gt;subdirectory&lt;/em&gt; of your current directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I expect giving it the &lt;em&gt;absolute&lt;/em&gt; path to a directory is causing your problem. In your case, I think what you need is a &lt;code&gt;.dir-locals.el&lt;/code&gt; file in the directory you're targeting (i.e., &lt;code&gt;~/tmp/test_test_dir_local&lt;/code&gt;) that contains the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((nil&#xA;  (indent-tabs-mode . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;nil&lt;/code&gt; symbol indicates that this variable will be applied to all files in all subdirectories of the &lt;code&gt;~/tmp/test_test_dir_local&lt;/code&gt;. You can change it to indicate you only want it applied to a certain subdirectory (in quotes):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((&quot;src&quot;&#xA;  (indent-tabs-mode . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or a particular major mode (no quotes):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((c-mode&#xA;  (indent-tabs-mode . t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-03-20T15:38:08.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31581" PostTypeId="1" AcceptedAnswerId="31593" CreationDate="2017-03-20T17:38:01.483" Score="3" ViewCount="210" Body="&lt;p&gt;I'm recursively grepping a large project using &lt;code&gt;M-x rgrep&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a few seconds pass I see the text I was searching for. At this point how can I cancel the search whilst preserving the buffer contents?&lt;/p&gt;&#xA;" OwnerUserId="15043" LastActivityDate="2017-03-20T21:47:26.777" Title="Cancel rgrep during execution" Tags="|rgrep|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31582" PostTypeId="1" AcceptedAnswerId="31588" CreationDate="2017-03-20T18:05:34.680" Score="7" ViewCount="263" Body="&lt;p&gt;The only times I've ever found a use for transpose-words or transpose-chars is when I accidentally hit one of them unintentionally, in which case a backward-word followed by transpose-words again would undo the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like the use case is something along the lines of accidentally typing &lt;code&gt;food dog&lt;/code&gt; while meaning to type &lt;code&gt;dog food&lt;/code&gt;, in which case transposition is helpful. For characters, I've always found backspace twice + retyping the two characters just as fast and less error-prone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have never, ever had this &quot;word dyslexia&quot; problem in my history of using Emacs. Given the relatively &quot;important&quot; key bindings that &lt;code&gt;transpose&lt;/code&gt; commands get, it seems like I may be missing an important use case. Am I?&lt;/p&gt;&#xA;" OwnerUserId="8378" LastActivityDate="2017-03-20T21:39:17.497" Title="What kinds of mistakes does transpose fix?" Tags="|text-editing|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31584" PostTypeId="1" CreationDate="2017-03-20T18:22:40.933" Score="2" ViewCount="529" Body="&lt;p&gt;I recently installed python-mode (via &lt;code&gt;package-list-packages&lt;/code&gt;). Since then, whenever I put my cursor by a function I've defined, it jumps to it, and if I put my cursor by a builtin function or operator (or some installed third party thing, like a module name), it opens &lt;code&gt;python-help&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to stop this happening. Any ideas on how to stop this, or even really what might be doing this if it's not python-mode would be very helpful. &lt;/p&gt;&#xA;" OwnerUserId="8934" LastActivityDate="2019-08-15T17:37:15.887" Title="Stop python mode jumping to function definition?" Tags="|python|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31585" PostTypeId="2" ParentId="31582" CreationDate="2017-03-20T18:54:37.137" Score="1" Body="&lt;p&gt;I use &lt;code&gt;transpose-chars&lt;/code&gt; when fixing bad TeX code (I am an editor for mathematical publications). Authors will often include, for instance, a comma inside math, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;So we have $x=y,$ which implies that...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For technical reasons we don't want the comma inside the dollar signs, so rather than killing the two characters and retyping them I place point on the second $ and use &lt;code&gt;transpose-chars&lt;/code&gt;. For letters it might not make much difference but it's easier to hit &lt;code&gt;C-t&lt;/code&gt; than to type &lt;code&gt;$,&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Admittedly this is a rather specialized use case.&lt;/p&gt;&#xA;" OwnerUserId="6692" LastActivityDate="2017-03-20T18:54:37.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31586" PostTypeId="1" CreationDate="2017-03-20T19:11:37.750" Score="3" ViewCount="305" Body="&lt;p&gt;When I run grep by &lt;code&gt;M-x grep&lt;/code&gt;, I get results in a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i run grep again &lt;code&gt;M-x grep&lt;/code&gt;, the new results overwrite the previous ones in the same buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I create a new buffer for the second run of grep, to avoid overwriting the results of the first run of grep?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="120" LastActivityDate="2017-03-21T14:36:00.473" Title="How can I create a new buffer for the second run of grep, to avoid overwriting the results of the first run of grep?" Tags="|buffers|grep|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31587" PostTypeId="2" ParentId="31497" CreationDate="2017-03-20T19:25:08.637" Score="1" Body="&lt;p&gt;You might simply use &lt;code&gt;eval-last-sexp&lt;/code&gt; with a prefix instead of &lt;code&gt;eval-print-last-sexp&lt;/code&gt;. For me this is already bound to &lt;code&gt;C-x C-e&lt;/code&gt;, so I just need to type &lt;code&gt;C-U C-x C-e&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8633" LastActivityDate="2017-03-20T19:25:08.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31588" PostTypeId="2" ParentId="31582" CreationDate="2017-03-20T19:34:28.780" Score="8" Body="&lt;p&gt;While &lt;code&gt;transpose-chars&lt;/code&gt; is useful for typos in any kind of buffer, I suspect &lt;code&gt;transpose-words&lt;/code&gt; is not particularly useful when writing prose but might be useful in programming or dealing with other kinds of text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;transpose-words&lt;/code&gt; preserves punctuation. For example (with | indicating point): &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Starting with &lt;code&gt;[1][2][|3]&lt;/code&gt;, use &lt;code&gt;M-t&lt;/code&gt; to get: &lt;code&gt;[1][3][2|]&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Starting with &lt;code&gt;foo += |bar&lt;/code&gt;, use &lt;code&gt;M-t&lt;/code&gt; to get: &lt;code&gt;bar += foo|&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Starting with &lt;code&gt;one|, two, three, four,&lt;/code&gt;, use &lt;code&gt;M-3 M-t&lt;/code&gt; to get &lt;code&gt;two, three, four, one|,&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The last example uses a prefix argument to jump a word forward 3 places. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also useful is the 0 prefix argument (&lt;code&gt;M-0 M-t&lt;/code&gt;) to exchange the word at point with the word at mark. This can be a faster way to swap a couple words at arbitrary locations then using kill/yank. For example, type: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;John, Ringo, George, and Paul|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That looks wrong, so use this sequence to fix it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C-r rin    ; jump back to Ringo, leaving mark where you started&#xA;RET        ; quit the search&#xA;M-0 M-t    ; swap word at point (Ringo) with word at mark (Paul)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And voilà:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;John, Paul, George, and Ringo|&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-20T21:39:17.497" LastActivityDate="2017-03-20T21:39:17.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31589" PostTypeId="2" ParentId="31586" CreationDate="2017-03-20T19:41:29.347" Score="3" Body="&lt;p&gt;&lt;code&gt;M-x rename-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;M-n&lt;/code&gt; to retrieve the current name, and edit it. E.g., &lt;code&gt;M-n&lt;/code&gt; puts &lt;code&gt;*grep*&lt;/code&gt;in the minibuffer. Type &lt;code&gt;1&lt;/code&gt; to change it to &lt;code&gt;*grep*1&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then just use &lt;code&gt;M-x grep&lt;/code&gt; again, to have the new search output go to the (new) buffer &lt;code&gt;*grep*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I bind &lt;code&gt;rename-buffer&lt;/code&gt; to &lt;code&gt;C-M-S-&amp;lt;f1&amp;gt;&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As @JeanPierre pointed out in a comment, you will need to first make another buffer, besides the grep-output buffer, current (or change the mode of that buffer, so that it is not &lt;code&gt;grep-mode&lt;/code&gt;), before you issue the second &lt;code&gt;grep&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because &lt;code&gt;grep&lt;/code&gt; uses &lt;code&gt;compilation-buffer-name&lt;/code&gt; to determine which buffer to use, and that function returns the name of the current buffer if the buffer is in the same mode as the command - in this case, &lt;code&gt;grep-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't want to change to another buffer manually, you could change to another buffer temporarily as part of a command that wraps &lt;code&gt;grep&lt;/code&gt;. Or you can set or bind variable &lt;code&gt;compilation-buffer-name-function&lt;/code&gt; to a function that returns &quot;&lt;em&gt;grep&lt;/em&gt;&quot;.  If that variable is non-nil then its function value is used by &lt;code&gt;compilation-buffer-name&lt;/code&gt; to determine the name of the buffer to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (_mode)&#xA;  &quot;Return \&quot;*grep*\&quot; as the name of the buffer to use.&quot;&#xA;  &quot;*grep*&quot;)&#xA;&#xA;(defun my-grep ()&#xA;  &quot;`grep`, but always use buffer `*grep*'.&quot;&#xA;  (interactive)&#xA;  (let ((compilation-buffer-name-function  'foo))&#xA;    (call-interactively 'grep)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can use command &lt;code&gt;my-grep&lt;/code&gt; instead of &lt;code&gt;grep&lt;/code&gt;, even from a buffer that is in mode &lt;code&gt;grep-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I just use &lt;code&gt;grep&lt;/code&gt; from another buffer.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-03-21T14:36:00.473" LastActivityDate="2017-03-21T14:36:00.473" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31590" PostTypeId="2" ParentId="31584" CreationDate="2017-03-20T19:46:20.930" Score="0" Body="&lt;p&gt;Does this happen also when you start Emacs using &lt;code&gt;emacs -Q&lt;/code&gt; (no init file), and you just load the python-mode package? If not, bisect your init file to find the problem. If yes, check the doc or code of that package for a way out.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-03-20T19:46:20.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31592" PostTypeId="2" ParentId="31582" CreationDate="2017-03-20T19:50:13.583" Score="4" Body="&lt;p&gt;In addition to what other have said:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;transpose-sexps&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;C-M-t&lt;/code&gt;&lt;/strong&gt;) is &lt;em&gt;very handy&lt;/em&gt;. I use it quite often in Emacs-Lisp mode.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Think keyboard macros. Any command such as &lt;code&gt;transpose-words&lt;/code&gt; can be useful from a macro or from Lisp code. IOW, you might not find it useful to use it only once, as a one-off, but you might find it useful if you have to carry out hundreds of similar transpositions as part of a text or code transformation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-03-20T19:50:13.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31593" PostTypeId="2" ParentId="31581" CreationDate="2017-03-20T19:53:33.563" Score="4" Body="&lt;p&gt;&lt;strong&gt;&lt;code&gt;C-c C-k&lt;/code&gt;&lt;/strong&gt; should be bound to &lt;code&gt;kill-compilation&lt;/code&gt;, which should do the job.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-03-20T21:47:26.777" LastActivityDate="2017-03-20T21:47:26.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31594" PostTypeId="2" ParentId="24541" CreationDate="2017-03-20T21:44:10.823" Score="1" Body="&lt;p&gt;Emacs comes with hs-minor-mode which can be used selectively hide/show code and comment blocks in several languages, including JavaScript.  By default this will let you hide and show JSON blocks delimited by '{' and '}' but it is easily modified to allow '[' and ']' as block delimeters as well.  To do this we need to modify the &lt;code&gt;js-mode&lt;/code&gt; entry in &lt;code&gt;hs-special-modes-alist&lt;/code&gt; with something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;(setcdr (assoc 'js-mode hs-special-modes-alist) '(&quot;[{[]&quot; &quot;[}\\]]&quot; &quot;/[*/]&quot; nil))&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should then find that [...] blocks can be hidden and shown as well as {...} blocks.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-20T21:44:10.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31595" PostTypeId="1" AcceptedAnswerId="31610" CreationDate="2017-03-20T22:49:29.173" Score="1" ViewCount="171" Body="&lt;p&gt;Is it possible to add a key binding &lt;code&gt;M-RET&lt;/code&gt; to &lt;code&gt;helm-mini&lt;/code&gt; which would open the selected buffer in a new frame instead of in the current window?&lt;/p&gt;&#xA;" OwnerUserId="600" LastEditorUserId="105" LastEditDate="2017-03-20T23:09:39.330" LastActivityDate="2017-03-21T17:13:36.023" Title="M-RET to open buffer in new frame in helm-mini?" Tags="|key-bindings|helm|buffers|frames|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31597" PostTypeId="2" ParentId="30977" CreationDate="2017-03-20T23:06:00.053" Score="1" Body="&lt;p&gt;The meaning of backquotes in a snippet is to insert the &lt;strong&gt;value&lt;/strong&gt; of the form within the backquotes into the snippet expansion.  However, &lt;code&gt;indent-region&lt;/code&gt; works by side-effect, and in recent Emacs versions happens to return &lt;code&gt;t&lt;/code&gt;.  As politza suggested in the comments, you can use &lt;code&gt;(progn (indent-region ...) nil)&lt;/code&gt; to drop the return value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this still performs a side effect inside backquotes which will stop being supported in some future version (it triggers a warning in versions 0.11 and higher).  In this case, the indentation effect can be written much clearer by binding &lt;code&gt;yas-also-auto-indent-first-line&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -*- mode: snippet -*-&#xA;# name : case : {...}&#xA;# key: case&#xA;# expand-env: ((yas-also-auto-indent-first-line t))&#xA;# --&#xA;case ${2:constexpr}:${3: \{}&#xA;    $0&#xA;    break;&#xA;${3:$(if (string-match &quot;\{&quot; yas-text) &quot;\}&quot; &quot;&quot;)}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This modification has just been accepted at &lt;a href=&quot;https://github.com/AndreaCrotti/yasnippet-snippets/pull/176&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/AndreaCrotti/yasnippet-snippets/pull/176&lt;/a&gt;, and will come with the next yasnippet version (0.12), at least for MELPA packages which integrate snippets from that repo.  For other examples of avoiding side effects within backquotes, see &lt;a href=&quot;https://emacs.stackexchange.com/questions/24060/yasnippet-truncates-clipboard-contents&quot;&gt;yasnippet truncates clipboard contents&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-03-20T23:06:00.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31599" PostTypeId="2" ParentId="31570" CreationDate="2017-03-21T02:19:36.057" Score="1" Body="&lt;p&gt;It looks like the part that's missing is printing the value on the top of the stack in the desired format.  Try this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/days-to-time-string (days)&#xA;  &quot;Format number of DAYS as a string (HH:MM:SS).&quot;&#xA;  (let* ((hours (* days 24))&#xA;         (minutes (* (mod hours 1) 60))&#xA;         (seconds (* (mod minutes 1) 60)))&#xA;    (format &quot;%02d:%02d:%02d&quot; (floor hours) (floor minutes) (floor seconds))))&#xA;&#xA;(defmath days-to-time-string ()&#xA;  &quot;Print the value on calc stack as days converted to hours.&quot;&#xA;  (interactive)&#xA;  (let ((days (string-to-number (calc-eval 1 'top))))&#xA;    (message (my/days-to-time-string days))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unless you create a binding you would use it with &lt;code&gt;M-x calc-days-to-time-string&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2017-03-25T17:46:55.903" LastActivityDate="2017-03-25T17:46:55.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31600" PostTypeId="2" ParentId="31561" CreationDate="2017-03-21T02:38:15.703" Score="1" Body="&#xA;&#xA;&lt;p&gt;I used the following function to set Latin characters and Japanese characters separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full configuration: &lt;a href=&quot;https://github.com/kaz-yos/emacs/blob/5fe90b4256de8d85c1c85fa39139a7ba944ea073/init.d/200_language-and-font-related.el#L33-L65&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/kaz-yos/emacs/blob/5fe90b4256de8d85c1c85fa39139a7ba944ea073/init.d/200_language-and-font-related.el#L33-L65&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun update-current-frame-fontset-mac ()&#xA;  &quot;Update current frame fontset with Japanese font setting (macOS)&quot;&#xA;  (let* (;; Ascii font name (pick from (font-family-list))&#xA;         (my-ascii-font &quot;Menlo&quot;)&#xA;         ;; Japanese font name (pick from (font-family-list))&#xA;         (my-jp-font    &quot;Hiragino Maru Gothic ProN&quot;)&#xA;         ;; Create :family-only font specifications (use later)&#xA;         ;; #&amp;lt;font-spec nil nil Menlo nil nil nil nil nil nil nil nil nil nil&amp;gt;&#xA;         (my-ascii-fontspec (font-spec :family my-ascii-font))&#xA;         ;; #&amp;lt;font-spec nil nil Hiragino\ Maru\ Gothic\ ProN nil nil nil nil nil nil nil nil nil nil&amp;gt;&#xA;         (my-jp-fontspec    (font-spec :family my-jp-font)))&#xA;    ;;&#xA;    ;; Return the value of FACE’s ATTRIBUTE on (current) FRAME.&#xA;    ;; (face-attribute 'default :fontset) returns the current frame's fontset,&#xA;    ;; which can be updated for some letters via set-fontset-font&#xA;&#xA;    ;; For these Japanese character sets, use my-jp-fontspec&#xA;    (set-fontset-font (face-attribute 'default :fontset)&#xA;                      'japanese-jisx0213.2004-1 my-jp-fontspec    nil 'append)&#xA;    (set-fontset-font (face-attribute 'default :fontset)&#xA;                      'japanese-jisx0213-2      my-jp-fontspec    nil 'append)&#xA;    ;; For Half-sized katakana characters, use my-jp-fontspec&#xA;    (set-fontset-font (face-attribute 'default :fontset)&#xA;                      'katakana-jisx0201        my-jp-fontspec    nil 'append)&#xA;    ;;&#xA;    ;; For the characters in the range #x0080 - #x024F, use my-ascii-fontspec&#xA;    ;; Latin with pronounciation annotations&#xA;    (set-fontset-font (face-attribute 'default :fontset)&#xA;                      '(#x0080 . #x024F)        my-ascii-fontspec nil 'append)&#xA;    ;; For the characters in the range #x0370 - #x03FF, use my-ascii-fontspec&#xA;    ;; Greek characters&#xA;    (set-fontset-font (face-attribute 'default :fontset)&#xA;                      '(#x0370 . #x03FF)        my-ascii-fontspec nil 'append)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9377" LastEditorUserId="15748" LastEditDate="2017-05-20T17:46:08.640" LastActivityDate="2017-05-20T17:46:08.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31601" PostTypeId="2" ParentId="7368" CreationDate="2017-03-21T03:32:45.247" Score="1" Body="&lt;p&gt;Like wasamasa suggested, put the cursor on the character or highlighted area and do&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;M-x describe-char&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose the face is &quot;whitespace-empty&quot; (I was looking to get rid of the yellow highlight)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-faces&#xA;  '(whitespace-empty ((t (:background &quot;grey20&quot; :foreground &quot;gray30&quot;))))&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in your &lt;code&gt;~/.emacs&lt;/code&gt; file.&lt;/p&gt;&#xA;" OwnerUserId="15281" LastActivityDate="2017-03-21T03:32:45.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31602" PostTypeId="2" ParentId="31572" CreationDate="2017-03-21T09:27:42.220" Score="3" Body="&lt;p&gt;As for the first question, there is a package &lt;code&gt;guess-language&lt;/code&gt; that you can use. See also this post by Manuel Uberti &lt;a href=&quot;http://manuel-uberti.github.io/emacs/2017/02/04/guess-language/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://manuel-uberti.github.io/emacs/2017/02/04/guess-language/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15268" LastActivityDate="2017-03-21T09:27:42.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31604" PostTypeId="2" ParentId="31546" CreationDate="2017-03-21T12:04:46.173" Score="1" Body="&lt;p&gt;I'd suggest you try and use a dumb-indentation function, then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'latex-mode-hook&#xA;          (lambda ()&#xA;            (setq-local indent-line-function #'indent-relative)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[ And use &lt;code&gt;LaTeX-mode-hook&lt;/code&gt; instead if you're using AUCTeX.  ]&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-21T12:04:46.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31605" PostTypeId="2" ParentId="31586" CreationDate="2017-03-21T12:47:25.903" Score="1" Body="&lt;p&gt;For the same task, I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key &quot;\C-s&quot; 'counsel-grep-or-swiper)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Search interactively for what I need, and press &lt;kbd&gt;C-c C-o&lt;/kbd&gt; to save the results to a buffer, similarly to how &lt;code&gt;grep&lt;/code&gt; or &lt;code&gt;occur&lt;/code&gt; do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A new buffer is generated for each &lt;kbd&gt;C-c C-o&lt;/kbd&gt;. Each buffer name contains the search string.&lt;/p&gt;&#xA;" OwnerUserId="2094" LastActivityDate="2017-03-21T12:47:25.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31607" PostTypeId="1" AcceptedAnswerId="52097" CreationDate="2017-03-21T13:39:48.087" Score="2" ViewCount="1196" Body="&lt;p&gt;As my org files keep growing, it is getting more complicated to find what I'm looking for. For now I'm using &lt;code&gt;helm-occur&lt;/code&gt; to find strings and &lt;code&gt;helm-org-in-buffer-headings&lt;/code&gt; to find headings in org files. However I want to be able to limit the scope of the search to the current heading including subheadings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found &lt;code&gt;helm-org-parent-headings&lt;/code&gt;, but I couldn't find &quot;helm-org-child-headings&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;org-narrow-to-subtree&lt;/code&gt; mentioned by Tobias is a good solution, however I'm looking for a command that does not change the contents of the org buffer (I still can't figure out how to return to the &quot;original&quot; buffer without killing the buffer created by &lt;code&gt;org-narrow-to-subtree&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;helm-org-parent-headings&lt;/code&gt; displays headings like &lt;code&gt;helm-org-in-buffer-headings&lt;/code&gt; WITHOUT changing the buffer, but as the name suggests it only displays parents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what I am looking for is a command that does the opposite and only displays children of the heading in a helm buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore I want to modify &lt;code&gt;helm-occur&lt;/code&gt; to search only for strings, that belong to children of the heading at point.&lt;/p&gt;&#xA;" OwnerUserId="11377" LastEditorUserId="11377" LastEditDate="2017-03-21T20:21:49.530" LastActivityDate="2019-08-10T06:04:47.293" Title="search for strings and subheadings in org heading" Tags="|org-mode|helm|search|" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31608" PostTypeId="1" AcceptedAnswerId="31609" CreationDate="2017-03-21T15:35:38.710" Score="3" ViewCount="102" Body="&lt;p&gt;Say I have the following document:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sir Bedevere&#xA;------------&#xA;Well, now, uh, Lancelot, Galahad, and I, wait until nightfall, and then leap out of the rabbit, taking the French by surprise - not only by surprise, but totally unarmed!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I execute &lt;code&gt;M-x fill-paragraph&lt;/code&gt;, I get this result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sir Bedevere ------------ Well, now, uh, Lancelot, Galahad, and&#xA;I, wait until nightfall, and then leap out of the rabbit, taking&#xA;the French by surprise - not only by surprise, but totally&#xA;unarmed!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I would like it to produce this output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sir Bedevere&#xA;------------&#xA;Well, now, uh, Lancelot, Galahad, and I, wait until nightfall,&#xA;and then leap out of the rabbit, taking the French by surprise -&#xA;not only by surprise, but totally unarmed!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way to get &lt;code&gt;fill-paragraph&lt;/code&gt; to not auto-fill past a horizontal rule like this?&lt;/strong&gt; Ideally it would work with other rule-like lines (made up of asterisks, octothorpes, etc.).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Can this be made to work in comments too? In this case, the horizontal rule would appear after the comment symbol(s), like in these examples:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# -----&#xA;&#xA;// **********&#xA;&#xA;/*&#xA; * ##############&#xA; */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12866" LastEditorUserId="12866" LastEditDate="2017-03-21T18:07:25.390" LastActivityDate="2017-03-21T18:07:25.390" Title="Prevent fill-paragraph from wrapping past horizontal rules" Tags="|fill-paragraph|auto-fill-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31609" PostTypeId="2" ParentId="31608" CreationDate="2017-03-21T16:37:04.600" Score="3" Body="&lt;p&gt;You can add the following lines to your init-file. Additionally to the default setting, they define lines consisting of at least two equal non-alphanumerical characters as paragraph start and delimiter.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq paragraph-start &quot;^\\([^[:alnum:]]\\)\\1+\n\\|\f\\|[   ]*$&quot;)&#xA;(setq paragraph-separate &quot;\\([^[:alnum:]]\\)\\1+\n\\|[  \f]*$&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can also customize the variables &lt;code&gt;paragraph-start&lt;/code&gt; and &lt;code&gt;paragraph-separate&lt;/code&gt; with &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;customize-option&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; as follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;paragraph-start&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;^-[-]+&#xA;\|↪\|[  ]*$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;paragraph-separate&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-[-]+&#xA;\|[     ↪]*$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;respectively. In that case use &lt;kbd&gt;C-q C-j&lt;/kbd&gt; to input a newline and &lt;kbd&gt;C-q C-l&lt;/kbd&gt; for form feed &lt;code&gt;↪&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2017-03-21T16:51:23.940" LastActivityDate="2017-03-21T16:51:23.940" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31610" PostTypeId="2" ParentId="31595" CreationDate="2017-03-21T17:13:36.023" Score="2" Body="&lt;p&gt;This should already be available as &lt;code&gt;helm-buffer-switch-other-frame&lt;/code&gt;, bound to &lt;code&gt;C-c C-o&lt;/code&gt;. You can see available actions by hitting &lt;code&gt;TAB&lt;/code&gt; while in a Helm buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To bind &lt;code&gt;M-RET&lt;/code&gt; to &lt;code&gt;helm-buffer-switch-other-frame&lt;/code&gt;, add the binding to &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/v2.5.4/helm-buffers.el#L148&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-buffer-map&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(define-key helm-buffer-map (kbd &quot;M-RET&quot;) #'helm-buffer-switch-other-frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-03-21T17:13:36.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31611" PostTypeId="1" CreationDate="2017-03-21T17:25:11.420" Score="2" ViewCount="8335" Body="&lt;p&gt;Long time vim user, finally decided to try emacs for orgmode. As usual, lost in configuration and found out about spacemacs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excited to try, unfortunately after all the attempts I still can't get couple of things.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The UI doesn't look correct (as per their home page). I am not sure what is gone wrong. (I have tried in terminal as well as iterm2) &lt;/li&gt;&#xA;&lt;li&gt;Inline image preview (C-x C-c C-v) is not working in orgmode/emacs. The same issue with vanila homebrew emacs as well. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7at7n.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7at7n.png&quot; alt=&quot;Spacemacs ui&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/zQXgs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zQXgs.png&quot; alt=&quot;inline images&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have followed the steps: &lt;a href=&quot;https://github.com/syl20bnr/spacemacs#macos&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/syl20bnr/spacemacs#macos&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15288" LastActivityDate="2017-03-23T13:41:35.290" Title="Spacemacs setup on mac" Tags="|spacemacs|osx|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31613" PostTypeId="2" ParentId="31558" CreationDate="2017-03-21T18:40:31.457" Score="0" Body="&lt;pre&gt;&#xA;(let (&#xA;      (str-sample &quot;&#xA;line1 ![img](170319_first.png \&quot;test\&quot;) &#xA;line2 ![img](170319_second.png)&#xA;line3 ![img](/assets/170319_second.png)&#xA;&quot;)&#xA;      )&#xA;  (with-temp-buffer&#xA;    (insert str-sample)&#xA;    ;; just trash&#xA;    (insert &quot;foobar\n&quot;)&#xA;    (insert &quot;line4 ![img](/s/170319_second.png)&quot;)&#xA;    (insert &quot;\nDone ...\n&quot;)&#xA;    ;; well&#xA;    (goto-char (point-min))&#xA;    (while (re-search-forward &quot;\\(.*\\)\\((\\)\\([0-9]+.*$\\)&quot; nil t)&#xA;      (replace-match &quot;\\1\\2/assets/\\3&quot;)&#xA;      )&#xA;    (print (buffer-string))&#xA;    )&#xA;'ok&#xA;)&#xA;&lt;/pre&gt;&#xA;" OwnerUserId="12899" LastActivityDate="2017-03-21T18:40:31.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31614" PostTypeId="1" AcceptedAnswerId="31662" CreationDate="2017-03-21T19:59:08.883" Score="5" ViewCount="1336" Body="&lt;p&gt;How can I determine (from within Emacs) the current directory as it was when the Shell launched &lt;code&gt;emacs&lt;/code&gt; from the command line?&lt;/p&gt;&#xA;" OwnerUserId="260" LastActivityDate="2017-03-24T03:13:21.673" Title="How to determine the initial current directory when emacs is run from command line?" Tags="|shell|environment|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31615" PostTypeId="2" ParentId="31614" CreationDate="2017-03-21T19:59:08.883" Score="1" Body="&lt;p&gt;According to the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Section 38.3&lt;/a&gt; &lt;em&gt;&quot;Operating System Environment&quot;&lt;/em&gt; in the GNU Emacs Lisp Reference Manual:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Variable: initial-environment&lt;/strong&gt; This variable holds the list of&#xA;  environment variables Emacs inherited from its parent process when&#xA;  Emacs started.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you can scan the list and check for any item starting with &lt;code&gt;PWD=&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;&#xA;(defun my--get-initial-pwd ()&#xA;  (let ((var) (value))&#xA;    (cl-dolist (str initial-environment)&#xA;      (when (string-match &quot;^\\(.*?\\)=\\(.*\\)&quot; str)&#xA;        (setq var (match-string 1 str))&#xA;        (setq value (match-string 2 str))&#xA;        (when (string= var &quot;PWD&quot;)&#xA;          (cl-return))))&#xA;    value))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="260" LastActivityDate="2017-03-21T19:59:08.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31616" PostTypeId="1" AcceptedAnswerId="32114" CreationDate="2017-03-21T20:17:33.900" Score="5" ViewCount="424" Body="&lt;p&gt;How can I monitor when Emacs loads a library because of an autoloaded function, and also know the name of that function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EXAMPLE&lt;/strong&gt;:  I type &lt;code&gt;M-x eval-buffer&lt;/code&gt; in a buffer where one of the functions uses &lt;code&gt;setf&lt;/code&gt; (and I have not previously used this function during my Emacs session).  I would like to see a message similar to:  &quot;&lt;strong&gt;&lt;code&gt;setf&lt;/code&gt; called within &lt;code&gt;name-of-function&lt;/code&gt;, causing it to load &lt;code&gt;macroexp.el&lt;/code&gt; by virtue of a &lt;code&gt;require&lt;/code&gt; statement within &lt;code&gt;gv.el&lt;/code&gt;.&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a start ...&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun load-tracing-function (orig-fun &amp;amp;rest args)&#xA;  (message &quot;`load' called with args %S&quot; args)&#xA;  (let ((res (apply orig-fun args)))&#xA;    (message &quot;`load' returned %S&quot; res)&#xA;    res))&#xA;(advice-add 'load :around #'load-tracing-function)&#xA;&#xA;(defun require-tracing-function (orig-fun &amp;amp;rest args)&#xA;  (message &quot;`require' called with args %S&quot; args)&#xA;  (let ((res (apply orig-fun args)))&#xA;    (message &quot;`require' returned %S&quot; res)&#xA;    res))&#xA;(advice-add 'require :around #'require-tracing-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-04-12T22:30:40.630" LastActivityDate="2020-11-14T04:25:55.493" Title="How to know which function triggered an autoload of a library" Tags="|debugging|autoload|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31617" PostTypeId="2" ParentId="31301" CreationDate="2017-03-21T20:22:03.860" Score="0" Body="&lt;p&gt;I discovered that &lt;a href=&quot;https://github.com/rakanalh/emacs-dashboard&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-dashboard&lt;/a&gt; was the culprit. It's a wonderful package, but disabling it fixed the problem.&lt;/p&gt;&#xA;" OwnerUserId="12311" LastActivityDate="2017-03-21T20:22:03.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31618" PostTypeId="2" ParentId="31240" CreationDate="2017-03-21T22:47:49.470" Score="2" Body="&lt;p&gt;It should be enough to simple add &lt;i&gt;solarized-light (solarized-dark)&lt;/i&gt; into &lt;i&gt;dotspacemacs-themes&lt;/i&gt; list in &lt;i&gt;.spacemacs&lt;/i&gt; file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dotspacemacs-themes '(solarized-light&#xA;                      solarized-dark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Spacemacs should figure it out on its own and no additional steps are necessary.&lt;/p&gt;&#xA;" OwnerUserId="15293" LastActivityDate="2017-03-21T22:47:49.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31619" PostTypeId="2" ParentId="31607" CreationDate="2017-03-22T00:28:54.883" Score="0" Body="&lt;p&gt;It isn't quite the same as &lt;code&gt;helm-occur&lt;/code&gt;, but the agenda is a useful tool to find things.  Agenda searches can be restricted to the current buffer or subtree using &lt;code&gt;&amp;lt;&lt;/code&gt; in the &lt;a href=&quot;http://orgmode.org/manual/Agenda-dispatcher.html#Agenda-dispatcher&quot; rel=&quot;nofollow noreferrer&quot;&gt;agenda dispatcher&lt;/a&gt;.  &lt;code&gt;C-c a &amp;lt; &amp;lt;&lt;/code&gt; will restrict the agenda search to just the current subtree.  You can search for tags, properties or just strings.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2017-03-22T00:28:54.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31620" PostTypeId="1" AcceptedAnswerId="31624" CreationDate="2017-03-22T08:49:29.483" Score="1" ViewCount="685" Body="&lt;p&gt;I'm using org-mode and doing an ssh multihop into a remote server from our faculty. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;:header-args: :dir &quot;/ssh:user@remote|ssh:user@remote2:/home/user&quot;&#xA;:END:&#xA;&#xA;#+BEGIN_SRC sh&#xA;ls -al&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I notice that Tramp hangs forever and then quits with a &quot;File not found&quot; error when trying to read back results into the org-buffer. I also notice that the problem goes away when I remove my &lt;code&gt;.bashrc&lt;/code&gt; file on the remote server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fear that the problem has to do with my &lt;code&gt;PS1&lt;/code&gt; and &lt;code&gt;PS2&lt;/code&gt; prompt settings on the remote, because they contain some escape sequences to change the prompt coloring - which I believe Tramp doesn't understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to ask Tramp not to read my .bashrc?! Is that even possible?&#xA;Do you guys have any recommendation on the best way to approach my problem?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-05-21T12:08:28.500" Title="Tramp problems with remote .bashrc" Tags="|org-mode|tramp|ssh|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31621" PostTypeId="1" AcceptedAnswerId="31622" CreationDate="2017-03-22T08:57:29.660" Score="7" ViewCount="2520" Body="&lt;p&gt;If Emacs or the system crashes when &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;desktop-save-mode&lt;/code&gt;&lt;/a&gt; is active, Emacs leaves a stale desktop lock file. The next time the desktop is loaded (from another Emacs process ID), loading is interrupted with a question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning: desktop file appears to be in use by PID xxx.&lt;br&gt;&#xA;  Using it may cause conflicts. Use it anyway? (y or n)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;even if if the process with PID xxx (substitute a process ID for xxx) is no longer alive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is minimal example: First run &lt;code&gt;emacs -Q -l init.el&lt;/code&gt; with the following init file (&lt;code&gt;init.el&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'desktop)&#xA;(let ((dir &quot;/home/hakon/my-emacs-desktop-test&quot;))&#xA;  (setq desktop-path (list dir))&#xA;  (desktop-save-mode 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then open some new buffers, and exit emacs. This will generate a new desktop file. Now, create a fake lock file (with process ID 999 or substitute any integer that does not represent a running process ID)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;echo &quot;999&quot; &amp;gt; /home/hakon/my-emacs-desktop-test/.emacs.desktop.lock&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and rerun Emacs with a new init file &lt;code&gt;emacs -Q -l init2.el&lt;/code&gt;, where &lt;code&gt;init2.el&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'desktop)&#xA;(let ((dir &quot;/home/hakon/my-emacs-desktop-test&quot;))&#xA;  (setq desktop-path (list dir))&#xA;  (desktop-save-mode 1))&#xA;(desktop-read)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should bring up the warning (&lt;em&gt;&quot;desktop file appears to be in use&quot;&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we get rid of this message?&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="10898" LastEditDate="2017-07-26T07:53:47.303" LastActivityDate="2023-03-10T18:07:43.610" Title="Handle stale desktop lock files after emacs/system crash" Tags="|start-up|desktop|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31622" PostTypeId="2" ParentId="31621" CreationDate="2017-03-22T08:57:29.660" Score="6" Body="&lt;p&gt;You can check if the process is still alive using system command &lt;code&gt;ps -p $PID&lt;/code&gt;, then delete the lock file if the process is not still alive. The following modification of &lt;code&gt;init2.el&lt;/code&gt; above shows how this can be done from within Emacs. Note that I use two private functions from &lt;code&gt;desktop.el&lt;/code&gt;, namely &lt;code&gt;desktop-owner&lt;/code&gt; and &lt;code&gt;desktop-full-lock-name&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'desktop)&#xA;(defun my-remove-stale-lock-file (dir)&#xA;  (let ((pid (desktop-owner dir)))&#xA;    (when pid&#xA;      (let ((infile nil)&#xA;            (destination nil)&#xA;            (display nil))&#xA;        (unless (= (call-process &quot;ps&quot; infile destination display &quot;-p&quot;&#xA;                                 (number-to-string pid)) 0)&#xA;          (let ((lock-fn (desktop-full-lock-name dir)))&#xA;            (delete-file lock-fn)))))))&#xA;&#xA;(let ((dir &quot;/home/hakon/my-emacs-desktop-test&quot;))&#xA;  (my-remove-stale-lock-file dir)&#xA;  (setq desktop-path (list dir))&#xA;  (desktop-save-mode 1))&#xA;(desktop-read)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now using this approach, the lock file should not exist at the time when &lt;code&gt;desktop-read&lt;/code&gt; is called, and the warning is no longer issued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a variable &lt;code&gt;desktop-load-locked-desktop&lt;/code&gt; in &lt;code&gt;desktop.el&lt;/code&gt;. Setting this variable to &lt;code&gt;t&lt;/code&gt; will load a desktop even if the lock file exist (and prevent the warning). But as far as I can see this does not check if the process is alive or not. So it might not be such a good idea in the case there is an alive Emacs process using the same desktop.&lt;/p&gt;&#xA;" OwnerUserId="260" LastEditorUserId="260" LastEditDate="2017-03-22T09:06:51.913" LastActivityDate="2017-03-22T09:06:51.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31623" PostTypeId="2" ParentId="27467" CreationDate="2017-03-22T09:15:23.373" Score="4" Body="&lt;p&gt;I use the following piece of code that goes some of the way.  It's not perfect.  Maybe it will become a proper &lt;code&gt;minor-mode&lt;/code&gt; some day.  (&lt;a href=&quot;https://pank.eu/blog/pretty-babel-src-blocks.html&quot; rel=&quot;noreferrer&quot;&gt;source&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d5TRA.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d5TRA.png&quot; alt=&quot;Screenshot of the resulting code&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'org&#xA;  (defvar-local rasmus/org-at-src-begin -1&#xA;    &quot;Variable that holds whether last position was a &quot;)&#xA;&#xA;  (defvar rasmus/ob-header-symbol ?☰&#xA;    &quot;Symbol used for babel headers&quot;)&#xA;&#xA;  (defun rasmus/org-prettify-src--update ()&#xA;    (let ((case-fold-search t)&#xA;          (re &quot;^[ \t]*#\\+begin_src[ \t]+[^ \f\t\n\r\v]+[ \t]*&quot;)&#xA;          found)&#xA;      (save-excursion&#xA;        (goto-char (point-min))&#xA;        (while (re-search-forward re nil t)&#xA;          (goto-char (match-end 0))&#xA;          (let ((args (org-trim&#xA;                       (buffer-substring-no-properties (point)&#xA;                                                       (line-end-position)))))&#xA;            (when (org-string-nw-p args)&#xA;              (let ((new-cell (cons args rasmus/ob-header-symbol)))&#xA;                (cl-pushnew new-cell prettify-symbols-alist :test #'equal)&#xA;                (cl-pushnew new-cell found :test #'equal)))))&#xA;        (setq prettify-symbols-alist&#xA;              (cl-set-difference prettify-symbols-alist&#xA;                                 (cl-set-difference&#xA;                                  (cl-remove-if-not&#xA;                                   (lambda (elm)&#xA;                                     (eq (cdr elm) rasmus/ob-header-symbol))&#xA;                                   prettify-symbols-alist)&#xA;                                  found :test #'equal)))&#xA;        ;; Clean up old font-lock-keywords.&#xA;        (font-lock-remove-keywords nil prettify-symbols--keywords)&#xA;        (setq prettify-symbols--keywords (prettify-symbols--make-keywords))&#xA;        (font-lock-add-keywords nil prettify-symbols--keywords)&#xA;        (while (re-search-forward re nil t)&#xA;          (font-lock-flush (line-beginning-position) (line-end-position))))))&#xA;&#xA;  (defun rasmus/org-prettify-src ()&#xA;    &quot;Hide src options via `prettify-symbols-mode'.&#xA;&#xA;  `prettify-symbols-mode' is used because it has uncollpasing. It's&#xA;  may not be efficient.&quot;&#xA;    (let* ((case-fold-search t)&#xA;           (at-src-block (save-excursion&#xA;                           (beginning-of-line)&#xA;                           (looking-at &quot;^[ \t]*#\\+begin_src[ \t]+[^ \f\t\n\r\v]+[ \t]*&quot;))))&#xA;      ;; Test if we moved out of a block.&#xA;      (when (or (and rasmus/org-at-src-begin&#xA;                     (not at-src-block))&#xA;                ;; File was just opened.&#xA;                (eq rasmus/org-at-src-begin -1))&#xA;        (rasmus/org-prettify-src--update))&#xA;      ;; Remove composition if at line; doesn't work properly.&#xA;      ;; (when at-src-block&#xA;      ;;   (with-silent-modifications&#xA;      ;;     (remove-text-properties (match-end 0)&#xA;      ;;                             (1+ (line-end-position))&#xA;      ;;                             '(composition))))&#xA;      (setq rasmus/org-at-src-begin at-src-block)))&#xA;&#xA;  (defun rasmus/org-prettify-symbols ()&#xA;    (mapc (apply-partially 'add-to-list 'prettify-symbols-alist)&#xA;          (cl-reduce 'append&#xA;                     (mapcar (lambda (x) (list x (cons (upcase (car x)) (cdr x))))&#xA;                             `((&quot;#+begin_src&quot; . ?✎) ;; ➤  ➟ ➤ ✎&#xA;                               (&quot;#+end_src&quot;   . ?□) ;; ⏹&#xA;                               (&quot;#+header:&quot; . ,rasmus/ob-header-symbol)&#xA;                               (&quot;#+begin_quote&quot; . ?»)&#xA;                               (&quot;#+end_quote&quot; . ?«)))))&#xA;    (turn-on-prettify-symbols-mode)&#xA;    (add-hook 'post-command-hook 'rasmus/org-prettify-src t t))&#xA;  (add-hook 'org-mode-hook #'rasmus/org-prettify-symbols))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1974" LastActivityDate="2017-03-22T09:15:23.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31624" PostTypeId="2" ParentId="31620" CreationDate="2017-03-22T11:29:10.090" Score="2" Body="&lt;p&gt;The solution is to add the following lines to your &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if [[ $TERM = dumb ]]; then&#xA;    return&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-03-22T11:29:10.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31625" PostTypeId="1" CreationDate="2017-03-22T11:35:51.227" Score="3" ViewCount="114" Body="&lt;p&gt;I'd like to add a rule to supersede a tex mode. I'd like to colour text between two strings over multiple lines in a similar way that the character % is used as a comment character and so colours (greys out) everything following it on the same line, For example &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{comment}&#xA;coloured (greyed out) text in here&#xA;\end{comment}&#xA;&#xA;normally coloured text by tex mode here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15299" LastEditorUserId="304" LastEditDate="2017-03-23T09:37:39.327" LastActivityDate="2017-03-23T09:37:39.327" Title="Adding a rule to color text" Tags="|syntax-highlighting|tex-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31626" PostTypeId="1" CreationDate="2017-03-22T11:39:06.783" Score="1" ViewCount="59" Body="&lt;p&gt;When editing medium sized .tex files, I often find it convenient to make use of the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Narrowing.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;narrow&lt;/a&gt; command &lt;code&gt;C-x n n (narrow-to-region)&lt;/code&gt;, usually in combination with the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Marking-_0028LaTeX_0029.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;mark section&lt;/a&gt; command &lt;code&gt;C-c * (LaTeX-mark-section)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then wish to compile only the accessible portion. For this purpose, I have been using the &lt;a href=&quot;https://www.gnu.org/software/auctex/manual/auctex/Starting-a-Command.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tex command&lt;/a&gt; &lt;code&gt;C-c C-b (TeX-command-buffer)&lt;/code&gt;, but recently this command has started acting inconsistently. Depending on the position of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Point.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;point&lt;/a&gt;, it sometimes&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Compiles only the accessible portion&lt;/li&gt;&#xA;&lt;li&gt;Compiles the entire buffer&lt;/li&gt;&#xA;&lt;li&gt;Returns the message &lt;code&gt;ad-Advice-TeX-region-create: End of buffer&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Compiling the accessible portion is what I intend, and I can usually (but not always) trigger this behaviour by putting point at the beginning of a line or at the end of the accessible portion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compilation of the entire buffer seems to happen sometimes when I have previously compiled the entire buffer with &lt;code&gt;C-c C-c (TeX-command-master)&lt;/code&gt;, but this is not consistent at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;End of buffer&lt;/code&gt; error is usually triggered by not placing point at the beginning of a line. It also seems to happen more frequently if there is a reference in the accessible portion to something in the inaccessible portion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes (usually if I first trigger the &lt;code&gt;End of buffer&lt;/code&gt; error by running &lt;code&gt;C-c C-b&lt;/code&gt; with point placed mid-line, and then run &lt;code&gt;C-c C-b&lt;/code&gt; with point placed at the beginning of a line) it happens that, although compilation occurs, new changes are &lt;em&gt;not&lt;/em&gt; included in the output &lt;code&gt;_region_.pdf&lt;/code&gt; file, although they &lt;em&gt;are&lt;/em&gt; included in the &lt;code&gt;_region_.tex&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side-note, which is perhaps related, the Tex command &lt;code&gt;C-c C-z (LaTeX-command-section)&lt;/code&gt; also behaves differently if I narrow: Instead of compiling the current section inside the accessible portion, it compiles only from the beginning of the section until the position of point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess first narrowing and then running &lt;code&gt;C-c C-b&lt;/code&gt; is not the intended use of the command &lt;code&gt;C-c C-b&lt;/code&gt;. In that case, I should instead make my own command for this specific purpose. But it used to work for me consistently with the intended effect, so I am interested in knowing what might be the cause of this inconsistent behaviour.&lt;/p&gt;&#xA;" OwnerUserId="15223" LastEditorUserId="15223" LastEditDate="2017-03-22T11:57:54.130" LastActivityDate="2017-03-22T11:57:54.130" Title="What is the cause of this inconsistent behaviour of TeX-command-buffer when narrowing?" Tags="|latex|auctex|region|narrowing|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31627" PostTypeId="2" ParentId="31625" CreationDate="2017-03-22T13:17:41.707" Score="3" Body="&lt;p&gt;Sorry for answering here (my reputation is still to low to comment).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know my answer isn't exactly what you are looking for, but it looks like you want to comment out some regions and, since I assume you are using emacs, to comment out some regions (in Latex) just type:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    C-c ;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will comment out the region you selected, turning it to the standard comment colour (gray in your case). &#xA;If you then want to uncomment the region, just select it and &#xA;type&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    C-c ; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope I could help you even if my answer isn't exactly what you probably needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best.&lt;/p&gt;&#xA;" OwnerUserId="13623" LastActivityDate="2017-03-22T13:17:41.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31629" PostTypeId="1" CreationDate="2017-03-22T13:36:38.477" Score="3" ViewCount="858" Body="&lt;p&gt;Recently the scenario of editing project source code locally but building the project remotely on another machine (for example inside a Docker container or an Amazon Web Services host) is becoming more common. The setup typically involves starting a build from Emacs that first uses &lt;code&gt;rsync&lt;/code&gt; to copy over the project directory to a remote host and then execute the build command there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A problem arises however when there is a build error and the reported remote source code file paths do not match the paths on the local host.  In this case Emacs' compilation mode is not able to automatically jump from the error to the local file (because it doesn't understand how to map the remote path to the local path). How can the Emacs compilation mode be configured to convert the remote paths to local paths?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibly the user would have to provide some basic remote path to local path mapping function. Or maybe some heuristic could be implemented which tries mapping only the part of the path relative to the project directory, which should be the same on the local and remote host.&lt;/p&gt;&#xA;" OwnerUserId="2075" LastActivityDate="2018-03-22T14:22:06.627" Title="Fix compilation mode paths when compiling in container or remotely" Tags="|remote|compile-mode|docker|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31631" PostTypeId="1" CreationDate="2017-03-22T15:01:48.310" Score="3" ViewCount="1513" Body="&lt;p&gt;Is there a package that will gray out or hide the false portion of a c preprocessor macro?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#define ENABLE 1&#xA;#if ENABLE&#xA;    bool hide = false;&#xA;#else&#xA;    bool hide = true;&#xA;#endif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the above example, I want &lt;code&gt;bool hide = true;&lt;/code&gt; to be grayed out or hidden.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at &lt;a href=&quot;https://www.emacswiki.org/emacs?search=%22HideIfDef%22&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hide If Def&lt;/a&gt;, but it doesn't produce my desired effect.  Executing &lt;code&gt;M-x hide-ifdefs&lt;/code&gt; hides  &lt;code&gt;bool hide = false;&lt;/code&gt;, but I would expect &lt;code&gt;bool hide = true;&lt;/code&gt; to be hidden.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The functionality I am looking for would be similar to what NetBeans does.&lt;/p&gt;&#xA;" OwnerUserId="15021" LastEditorUserId="15021" LastEditDate="2017-03-23T20:04:47.180" LastActivityDate="2021-04-06T03:06:29.513" Title="Gray-out preprocessor conditionals" Tags="|faces|syntax-highlighting|c++|c|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31632" PostTypeId="1" CreationDate="2017-03-22T20:03:28.203" Score="5" ViewCount="394" Body="&lt;p&gt;I am writing my research notes in &lt;code&gt;org-mode&lt;/code&gt; and they contain many LaTeX formulas. I use the preview feature (&lt;code&gt;C-c C-x C-l&lt;/code&gt;) a lot. As the notes are rather large, I also tend to use an indirect buffer, to jump around to have a quick glance to refer to some other part of the text.&#xA;While the indirect buffer will show the rendered formulas when I open it (assuming the original buffer was showing them), I cannot make them go doing &lt;code&gt;C-c C-c&lt;/code&gt;. Conversely, if I open the indirect buffer while the original buffer is NOT showing the formulas, I cannot generate them in the indirect buffer. I get a message saying&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;user-error: Can’t preview LaTeX fragment in a non-file buffer&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, is there an easy way to enable org-mode to render and hide the formulas in indirect buffers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would not mind if doing this would mess-up (i.e. also hide, also display) the formulas in the main buffer (as long as I can re-render/display once I am back there).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference: GNU Emacs 25.1.2; Org-mode version 8.2.10&lt;/p&gt;&#xA;" OwnerUserId="8659" LastActivityDate="2017-09-21T09:50:23.893" Title="Preview LaTeX fragment on indirect buffers" Tags="|org-mode|latex|preview-latex|indirect-buffers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31633" PostTypeId="1" AcceptedAnswerId="31656" CreationDate="2017-03-23T01:13:57.063" Score="7" ViewCount="626" Body="&lt;p&gt;I have emacs set up so that when I type &lt;code&gt;M-x&lt;/code&gt; the helm completion buffer pops up. My problem is that helm wont let me select &lt;code&gt;M-x align&lt;/code&gt; if I have previously called &lt;code&gt;M-x align-current&lt;/code&gt;, because it is only letting me select the completion from the Command History List and not the list of all available commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how I can overcome this problem?&lt;/p&gt;&#xA;" OwnerUserId="15309" LastEditorUserId="253" LastEditDate="2017-03-23T01:18:56.987" LastActivityDate="2017-03-23T18:18:50.480" Title="Helm won't let me select available emacs commands" Tags="|helm|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31634" PostTypeId="2" ParentId="14817" CreationDate="2017-03-23T03:42:42.033" Score="2" Body="&lt;p&gt;Looking in someone else's &lt;a href=&quot;https://github.com/sk8ingdom/.emacs.d&quot; rel=&quot;nofollow noreferrer&quot;&gt;config&lt;/a&gt;, I found a way to control where &lt;code&gt;*Org Src.*&lt;/code&gt; and &lt;code&gt;*Org todo*&lt;/code&gt; buffers appear. Now when I hit &lt;code&gt;C-c C-t&lt;/code&gt; or &lt;code&gt;C-c '&lt;/code&gt; these buffers display in a new window at the bottom of my current window layout, and selecting a TODO state or hitting &lt;code&gt;C-c '&lt;/code&gt; (&lt;code&gt;org-edit-src-exit&lt;/code&gt;) returns my window configuration to its original layout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution involves using &lt;a href=&quot;https://github.com/wasamasa/shackle&quot; rel=&quot;nofollow noreferrer&quot;&gt;shackle&lt;/a&gt; and some Elisp:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Step 1&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Download &lt;code&gt;shackle&lt;/code&gt; from MELPA. Here is how I set it up with &lt;code&gt;use-package&lt;/code&gt; in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package shackle&#xA;    :ensure t&#xA;    :diminish shackle-mode  ; hide name in mode-line&#xA;    :config&#xA;    (setq shackle-rules&#xA;          '((&quot;\\*Org Src.*&quot; :regexp t :align below :select t)&#xA;            (&quot; *Org todo*&quot; :align below :select t)))&#xA;    (shackle-mode t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The important settings here are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shackle-rules&#xA;              '((&quot;\\*Org Src.*&quot; :regexp t :align below :select t)&#xA;                (&quot; *Org todo*&quot; :align below :select t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;☞ &lt;a href=&quot;https://github.com/sk8ingdom/.emacs.d/blob/master/general-config/general-plugins.el#L42&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note especially the space between &lt;code&gt;&quot;&lt;/code&gt; and &lt;code&gt;*Org&lt;/code&gt; on the bottom line. I haven't tested setting &lt;code&gt;:align&lt;/code&gt; to other locations, but &lt;code&gt;shackle&lt;/code&gt; seems to be pretty flexible, so it's worth reading the documentation and experimenting with it.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Step 2&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Now we make &lt;code&gt;org-mode&lt;/code&gt; listen to &lt;code&gt;shackle&lt;/code&gt; with some more Elisp in our init file. To get &lt;code&gt;*Org Src.*&lt;/code&gt; buffers to follow &lt;code&gt;shackle-rules&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-src-window-setup 'other-window)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;☞  &lt;a href=&quot;https://github.com/sk8ingdom/.emacs.d/blob/master/general-config/general-plugins.el#L100&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately &lt;code&gt;org-mode&lt;/code&gt; doesn't provide an analogous setting for &lt;code&gt;*Org todo*&lt;/code&gt; buffers. This hack makes up for that (and probably makes &lt;code&gt;(setq org-src-window-setup 'other-window)&lt;/code&gt; superfluous, but someone more knowledgeable will have to chime in):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Re-define org-switch-to-buffer-other-window to NOT use org-no-popups.&#xA;;; Primarily for compatibility with shackle.&#xA;(defun org-switch-to-buffer-other-window (args)&#xA;  &quot;Switch to buffer in a second window on the current frame.&#xA;In particular, do not allow pop-up frames.&#xA;Returns the newly created buffer.&#xA;Redefined to allow pop-up windows.&quot;&#xA;  ;;  (org-no-popups&#xA;  ;;     (apply 'switch-to-buffer-other-window args)))&#xA;  (switch-to-buffer-other-window args))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;☞  &lt;a href=&quot;https://github.com/sk8ingdom/.emacs.d/blob/f84d7c1e986b9e56a6e7bc304ede31ba5d12929c/org-mode-config/org-general.el#L151&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12311" LastActivityDate="2017-03-23T03:42:42.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31636" PostTypeId="1" AcceptedAnswerId="31637" CreationDate="2017-03-23T04:00:37.353" Score="3" ViewCount="392" Body="&lt;p&gt;There are two buffers in &lt;code&gt;image-dired&lt;/code&gt;, one is the thumbnail buffer &lt;code&gt;*image-dired*&lt;/code&gt;, the other is the displayed image buffer &lt;code&gt;*image-dired-display-image*&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I type &lt;kbd&gt;return&lt;/kbd&gt; on an image thumbnail, the focus is switched to the displayed image buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a setting that will make the focus stay in the thumbnail buffer?  What about making the displayed image buffer follow the focus in the thumbnail buffer without hitting return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Turns out the culprit is shackle. If you use it, the default behaviour is restored with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq shackle-rules&#xA;'((&quot;\\`\\*image-dired.*?\\*\\'&quot; :regexp t :select nil)&#xA;  (image-dired-thumbnail-mode :select nil)&#xA;  (image-dired-image-display-mode :select nil))&#xA;  shackle-default-rule '(:select t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="4036" LastEditDate="2017-03-23T07:13:08.373" LastActivityDate="2017-03-23T10:28:13.673" Title="How to make image display follow the focus in image-dired thumbnail buffer" Tags="|image-dired|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31637" PostTypeId="2" ParentId="31636" CreationDate="2017-03-23T04:49:46.990" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;When I type return on an image thumbnail, the focus is switched to the displayed image buffer. Is there a setting that will make the focus stay in the thumbnail buffer?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What you're asking for is the &lt;em&gt;default&lt;/em&gt; behaviour so far as I can see (when running &lt;code&gt;image-dired&lt;/code&gt; in both emacs 24.5 and 25.2). You should be able to confirm that by running &lt;code&gt;emacs -Q&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What about making the displayed image buffer follow the focus in the thumbnail buffer without hitting return?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you just want to cycle through the images, then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;SPC&lt;/kbd&gt; runs the command &lt;code&gt;image-dired-display-next-thumbnail-original&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;DEL&lt;/kbd&gt; (translated from &lt;kbd&gt;&amp;lt;backspace&gt;&lt;/kbd&gt; in my case) runs the command &lt;code&gt;image-dired-display-previous-thumbnail-original&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As always, use &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;m&lt;/kbd&gt; to view help on the modes and keybindings for the current buffer.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When I run image-dired in a dired buffer, all files are marked, how to disable that behavior and mark the files in the thumbnail view manually?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Mark the files in dired and call &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;image-dired-display-thumbs&lt;/code&gt; instead of &lt;code&gt;image-dired&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That command is bound to &lt;kbd&gt;C-t&lt;/kbd&gt;&lt;kbd&gt;d&lt;/kbd&gt; by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type &lt;kbd&gt;C-t&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt; in a dired buffer to see other image/thumbnail-related bindings under that same prefix.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-23T10:28:13.673" LastActivityDate="2017-03-23T10:28:13.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31638" PostTypeId="1" AcceptedAnswerId="31649" CreationDate="2017-03-23T09:02:44.730" Score="1" ViewCount="2606" Body="&lt;p&gt;I'm playing with evil-mode and this is one of the things where evil differs from vim. In vim &lt;code&gt;G&lt;/code&gt; takes you to the last line, but evil uses Emacs &lt;code&gt;end-of-buffer&lt;/code&gt; which for some reason takes me beyond last line to some imaginary line.&lt;/p&gt;&#xA;" OwnerUserId="15216" LastEditorUserId="105" LastEditDate="2017-03-23T13:52:51.140" LastActivityDate="2017-07-09T04:30:20.380" Title="How to make end-of-buffer move to the last line not beyond it?" Tags="|evil|motion|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31639" PostTypeId="2" ParentId="21310" CreationDate="2017-03-23T09:58:47.803" Score="1" Body="&lt;p&gt;I eventually expanded this into a package &lt;a href=&quot;http://melpa.milkbox.net/#/org-mru-clock&quot; rel=&quot;nofollow noreferrer&quot;&gt;org-mru-clock&lt;/a&gt;. This also &lt;a href=&quot;https://emacs.stackexchange.com/a/19473/730&quot;&gt;pre-fills the clock history&lt;/a&gt;), and allows using &lt;a href=&quot;https://github.com/abo-abo/swiper&quot; rel=&quot;nofollow noreferrer&quot;&gt;ivy&lt;/a&gt; or ido, by setting &lt;code&gt;org-mru-clock-completing-read&lt;/code&gt; to whichever completing-read-function you prefer (defaulting to the value of &lt;code&gt;completing-read-function&lt;/code&gt;), for example: &lt;code&gt;(setq org-mru-clock-completing-read #'ivy-completing-read)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-03-23T09:58:47.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31640" PostTypeId="2" ParentId="31515" CreationDate="2017-03-23T10:39:21.263" Score="0" Body="&lt;p&gt;You have something somewhere in your Emacs config which is attempting to set &lt;code&gt;PATH&lt;/code&gt; automatically by calling a shell command, and that config is failing to pay any attention to the exit status of the command, and is just using &lt;em&gt;whatever&lt;/em&gt; is returned -- in this case the text of an error message, because the shell command fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to track down what that is, because we certainly can't tell you. I suggest grepping your config for &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect this shell command is dependent on your shell config having been read, but that you are running Emacs via some kind of GUI launcher mechanism which does not invoke a shell at any point, and therefore has no knowledge of your shell config.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you run &lt;code&gt;emacs -nw&lt;/code&gt; and it works, that is because you are invoking that command from a shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most likely if you run &lt;code&gt;emacs&lt;/code&gt; from a shell it will also work, for the same reason.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-23T10:39:21.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31642" PostTypeId="2" ParentId="3458" CreationDate="2017-03-23T11:46:54.210" Score="1" Body="&lt;p&gt;As usual there are a hundred different ways to accomplish this. My preferred way is using &lt;a href=&quot;https://www.emacswiki.org/emacs/NumberedWindows&quot; rel=&quot;nofollow noreferrer&quot;&gt;NumberedWindows&lt;/a&gt;. I then set the following keybind using Super and keys 1-9.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;s-1&quot;) (lambda() (interactive) (window-number-select 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I go into a little more detail on this exact subject with a recent post of mine which you can read on &lt;a href=&quot;http://afternooncoder.com/how-to-quickly-change-focus-between-windows-in-emacs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Afternoon Coder&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="15314" LastActivityDate="2017-03-23T11:46:54.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31643" PostTypeId="2" ParentId="31638" CreationDate="2017-03-23T12:05:36.543" Score="0" Body="&lt;p&gt;This probably doesn't answer your question, &lt;a href=&quot;https://stackoverflow.com/questions/4675772/keep-emacs-from-scrolling-past-end-of-buffer.&quot;&gt;question about stopping Emacs scrolling past end-of-buffer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq next-line-add-newlines t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with this though is that mouse scroll is not going paste end-of-buffer, and you will end up with alot of empty lines in your files (pressing down arrows adds newlines, up arrow does not remove them).&lt;/p&gt;&#xA;" OwnerUserId="2644" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-03-23T12:05:36.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31644" PostTypeId="2" ParentId="30821" CreationDate="2017-03-23T12:17:02.270" Score="0" Body="&lt;p&gt;This is exactly what &lt;a href=&quot;https://www.emacswiki.org/emacs/KeyboardMacros&quot; rel=&quot;nofollow noreferrer&quot;&gt;Keyboard Macros&lt;/a&gt; are for! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start recording &lt;code&gt;C-x (&lt;/code&gt;&lt;br&gt;&#xA;Accomplish what it is you want to do&lt;br&gt;&#xA;Stop recording &lt;code&gt;C-x )&lt;/code&gt;&lt;br&gt;&#xA;Name your new macro &lt;code&gt;M-x name-last-kbd-macro&lt;/code&gt;&lt;br&gt;&#xA;Save it to init &lt;code&gt;M-x insert-kbd-macro&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can even assign it to a keybind!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;br&gt;&#xA;&lt;code&gt;(global-set-key (kbd &quot;C-c a&quot;) 'my-macro)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't worry about getting the steps when defining the macro perfect. If you make a mistake just correct it and keep going, all that matters is the end result is what you desire. &lt;/p&gt;&#xA;" OwnerUserId="15314" LastActivityDate="2017-03-23T12:17:02.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31645" PostTypeId="1" AcceptedAnswerId="31676" CreationDate="2017-03-23T12:21:12.260" Score="4" ViewCount="870" Body="&lt;p&gt;I have installed org-ref, and enjoy its functionality when writing notes where I need literature references in my text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I press the command &lt;code&gt;C-c ]&lt;/code&gt;, the BibTex entries that are listed in Helm are not alphabetically sorted. That makes it difficult to find the references I want to insert. How can I sort the list of references shown in Helm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Emacs (25.0.93.1) and org-mode (9.0.1) on my windows 10.&lt;/p&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="105" LastEditDate="2017-03-23T13:52:20.347" LastActivityDate="2017-03-24T19:00:55.223" Title="Org-ref: how to get the BibTex entries in Helm sorted alphabetically?" Tags="|helm|org-ref|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31646" PostTypeId="1" AcceptedAnswerId="31680" CreationDate="2017-03-23T13:06:42.590" Score="1" ViewCount="1344" Body="&lt;p&gt;the code block I copy outside emacs, which is not auto-indent when yanking in org&lt;/p&gt;&#xA;&#xA;&lt;p&gt;type &lt;code&gt;org-return-indent&lt;/code&gt; -&gt; yank code block -&gt; indent manually:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&#xA;*** headline&#xA;    |&#xA;&#xA;&#xA;v&#xA;&#xA;&#xA;&#xA;*** headline&#xA;    {&#xA;    code block&#xA;}&#xA;&#xA;&#xA;&#xA;v&#xA;&#xA;&#xA;&#xA;*** headline&#xA;    {&#xA;      code block&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;expecting the yank and indent in a one step&lt;/p&gt;&#xA;" OwnerUserId="14750" LastEditorUserId="14750" LastEditDate="2017-03-25T09:02:32.067" LastActivityDate="2019-11-16T03:46:05.387" Title="how to paste with indent" Tags="|org-mode|indentation|copy-paste|" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31647" PostTypeId="1" CreationDate="2017-03-23T13:20:59.363" Score="6" ViewCount="137" Body="&lt;p&gt;How can I see a mini-picture or icon of the email sender in the headers view and email view in mu4e? Is there an easy way to achieve this using, say org-contacts?&lt;/p&gt;&#xA;" OwnerUserId="9303" LastEditorUserId="737" LastEditDate="2017-03-28T14:39:25.033" LastActivityDate="2017-03-28T14:39:25.033" Title="Picture of sender in mu4e" Tags="|org-mode|mu4e|org-contacts|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31648" PostTypeId="2" ParentId="31611" CreationDate="2017-03-23T13:41:35.290" Score="3" Body="&lt;p&gt;Stupid me, it is working as expected. Spacemacs looks like the screenshot from their site and images in my org files show up inline :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are expected to open the application in GUI mode (from /Application like any other app) and I was trying to do in a terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2wGaF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2wGaF.png&quot; alt=&quot;Happy Spacemacs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15288" LastActivityDate="2017-03-23T13:41:35.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31649" PostTypeId="2" ParentId="31638" CreationDate="2017-03-23T14:25:55.217" Score="3" Body="&#xA;&#xA;&lt;p&gt;The command &lt;code&gt;end-of-buffer&lt;/code&gt; uses a variation on &lt;code&gt;(goto-char (point-max))&lt;/code&gt; to go to the last position in the buffer. If the buffer ends with a newline, &lt;code&gt;end-of-buffer&lt;/code&gt; will leave you on the empty line at the end, whereas if you delete this last newline, &lt;code&gt;end-of-buffer&lt;/code&gt; will leave you at the end of the text in the now non-empty last line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possible solution is to advise &lt;code&gt;end-of-buffer&lt;/code&gt; to just go up a line if it leaves you on an empty line:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-end-of-buffer-dwim (&amp;amp;rest _)&#xA;  &quot;If current line is empty, call `previous-line'.&quot;&#xA;  (when (looking-at-p &quot;^$&quot;)&#xA;    (previous-line)))&#xA;&#xA;(advice-add #'end-of-buffer :after #'my-end-of-buffer-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want &lt;code&gt;end-of-buffer&lt;/code&gt; to always leave you at the &lt;em&gt;beginning&lt;/em&gt; of the penultimate line (rather than at the end if the file has no trailing newline), you might want this instead:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-end-of-buffer-dwim (&amp;amp;rest _)&#xA;  &quot;Go to beginning of line.&#xA;If current line is empty, go to beginning of previous one&#xA;instead.&quot;&#xA;  (beginning-of-line (and (looking-at-p &quot;^$&quot;) 0)))&#xA;&#xA;(advice-add #'end-of-buffer :after #'my-end-of-buffer-dwim)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the standard advice disclaimer: You can avoid unanticipated side-effects by just creating your own end-of-buffer command and rebinding the keys, rather than using advice:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-end-of-buffer ()&#xA;  &quot;Go to beginning of last line in buffer.&#xA;If last line is empty, go to beginning of penultimate one&#xA;instead.&quot;&#xA;  (interactive)&#xA;  (goto-char (point-max))&#xA;  (beginning-of-line (and (looking-at-p &quot;^$&quot;) 0)))&#xA;&#xA;(global-set-key [remap end-of-buffer] #'my-end-of-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that all of the above solutions leave you at most one line away from the end of the buffer - they do not leave you on the &lt;em&gt;last&lt;/em&gt; non-empty line.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="15748" LastEditDate="2017-07-09T04:30:20.380" LastActivityDate="2017-07-09T04:30:20.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31650" PostTypeId="1" CreationDate="2017-03-23T14:36:04.797" Score="1" ViewCount="220" Body="&lt;p&gt;I am using Emacs 24.5 (stock Debian jessie) with a UHD display.  I am over 50 and I need a large font.  I have found a font that works well, but when I set the font using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-face-attribute 'default nil :font &quot;Droid Sans Mono&quot; :height 130)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it breaks the rendering of Unicode character U+2099 (Latin subscript small letter N).  The glyph renders not as a subscript n but as a superscript theta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have verified with &lt;code&gt;emacs -q&lt;/code&gt; that the stock distribution renders the subscript small N correctly with the default font, and that the single command above is enough to break the small N.  My other unicode subscripts, Greek letters, and math symbols seem to render correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I change the main font without breaking the mapping of the subscript small N?&lt;/p&gt;&#xA;" OwnerUserId="9343" LastActivityDate="2017-03-23T15:32:17.530" Title="How to change font without breaking Unicode glyph mapping?" Tags="|fonts|unicode|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31651" PostTypeId="2" ParentId="31645" CreationDate="2017-03-23T15:02:04.717" Score="4" Body="&lt;p&gt;Helm  Bibtex entries are presented in the reverse of the order in which they appear in your .bib file: &lt;a href=&quot;https://github.com/tmalsburg/helm-bibtex/issues/21&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tmalsburg/helm-bibtex/issues/21&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can reverse this order with the following (taken from the linked thread). Put this in your .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(eval-after-load &quot;helm-bibtex&quot;&#xA;    '(advice-add 'bibtex-completion-candidates&#xA;            :filter-return 'reverse))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My bib file is sorted alphabetically, so this gives me alphabetically sorted results from &lt;code&gt;helm-bibtex&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't, yet, customize which column the results are sorted by: &lt;a href=&quot;https://github.com/tmalsburg/helm-bibtex/issues/5&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tmalsburg/helm-bibtex/issues/5&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="262" LastEditDate="2017-03-24T19:00:55.223" LastActivityDate="2017-03-24T19:00:55.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31653" PostTypeId="2" ParentId="10354" CreationDate="2017-03-23T15:50:33.260" Score="3" Body="&lt;p&gt;How about this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; scroll one line at a time (less &quot;jumpy&quot; than defaults)&#xA;(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time&#xA;(setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling&#xA;(setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse&#xA;(setq scroll-step 1) ;; keyboard scroll one line at a time&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15315" LastActivityDate="2017-03-23T15:50:33.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31654" PostTypeId="2" ParentId="107" CreationDate="2017-03-23T17:08:54.053" Score="4" Body="&lt;p&gt;Thanks to the &lt;a href=&quot;https://emacs.stackexchange.com/a/132/115&quot;&gt;solution posted by @Sigma&lt;/a&gt;. I had that solution in my config for more than 2 years, and finally sent that as a patch to emacs upstream.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commit in emacs master: &lt;a href=&quot;http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e472cfe8f3b01f29a49614f6207e4128e8b36b8c&quot; rel=&quot;nofollow noreferrer&quot;&gt;e472cfe8&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is what the patch effectively does:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun modi/ffap-string-at-point (&amp;amp;optional mode)&#xA;  &quot;Return a string of characters from around point.&#xA;&#xA;MODE (defaults to value of `major-mode') is a symbol used to look up&#xA;string syntax parameters in `ffap-string-at-point-mode-alist'.&#xA;&#xA;If MODE is not found, we use `file' instead of MODE.&#xA;&#xA;If the region is active,return a string from the region.&#xA;&#xA;If the point is in a comment, ensure that the returned string does not contain&#xA;the comment start characters (especially for major modes that have '//' as&#xA;comment start characters). https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24057&#xA;&#xA;|-----------------------------------+---------------------------------|&#xA;| Example string in `c-mode' buffer | Returned `ffap-string-at-point' |&#xA;|-----------------------------------+---------------------------------|&#xA;| ▮//tmp                            | tmp                             |&#xA;| //▮tmp                            | tmp                             |&#xA;| ▮///tmp                           | /tmp                            |&#xA;| //▮/tmp                           | /tmp                            |&#xA;| ▮////tmp                          | //tmp                           |&#xA;| ////▮tmp                          | //tmp                           |&#xA;| ▮// //tmp                         | (empty string) \&quot;\&quot;             |&#xA;| // ▮/tmp                          | /tmp                            |&#xA;| // ▮//tmp                         | //tmp                           |&#xA;|-----------------------------------+---------------------------------|&#xA;&#xA;Set the variables `ffap-string-at-point' and `ffap-string-at-point-region'.&#xA;&#xA;When the region is active and larger than `ffap-max-region-length',&#xA;return an empty string, and set `ffap-string-at-point-region' to '(1 1).&quot;&#xA;  (let* ((args&#xA;          (cdr&#xA;           (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)&#xA;               (assq 'file ffap-string-at-point-mode-alist))))&#xA;         (region-selected (use-region-p))&#xA;         (pt (point))&#xA;         (beg (if region-selected&#xA;                  (region-beginning)&#xA;                (save-excursion&#xA;                  (skip-chars-backward (car args))&#xA;                  (skip-chars-forward (nth 1 args) pt)&#xA;                  (point))))&#xA;         (end (if region-selected&#xA;                  (region-end)&#xA;                (save-excursion&#xA;                  (skip-chars-forward (car args))&#xA;                  (skip-chars-backward (nth 2 args) pt)&#xA;                  (point))))&#xA;         (region-len (- (max beg end) (min beg end))))&#xA;&#xA;    ;; If the initial characters of the to-be-returned string are the&#xA;    ;; current major mode's comment starter characters, *and* are&#xA;    ;; not part of a comment, remove those from the returned string&#xA;    ;; (Bug#24057).&#xA;    ;; Example comments in `c-mode' (which considers lines beginning&#xA;    ;; with &quot;//&quot; as comments):&#xA;    ;;  //tmp - This is a comment. It does not contain any path reference.&#xA;    ;;  ///tmp - This is a comment. The &quot;/tmp&quot; portion in that is a path.&#xA;    ;;  ////tmp - This is a comment. The &quot;//tmp&quot; portion in that is a path.&#xA;    (when (and&#xA;           ;; Proceed if no region is selected by the user.&#xA;           (null region-selected)&#xA;           ;; Check if END character is part of a comment.&#xA;           (save-excursion&#xA;             (nth 4 (syntax-ppss end))))&#xA;      ;; Move BEG to beginning of comment (after the comment start&#xA;      ;; characters), or END, whichever comes first.&#xA;      (save-excursion&#xA;        (let ((state (syntax-ppss beg)))&#xA;          ;; (nth 4 (syntax-ppss)) will be nil for comment start chars&#xA;          (unless (nth 4 state)&#xA;            (parse-partial-sexp beg end nil nil state :commentstop)&#xA;            (setq beg (point))))))&#xA;&#xA;    (if (and (natnump ffap-max-region-length)&#xA;             (&amp;lt; region-len ffap-max-region-length)) ; Bug#25243.&#xA;        (setf ffap-string-at-point-region (list beg end)&#xA;              ffap-string-at-point&#xA;              (buffer-substring-no-properties beg end))&#xA;      (setf ffap-string-at-point-region (list 1 1)&#xA;            ffap-string-at-point &quot;&quot;))))&#xA;(advice-add 'ffap-string-at-point :override #'modi/ffap-string-at-point)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="115" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.473" LastActivityDate="2017-03-23T17:08:54.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31656" PostTypeId="2" ParentId="31633" CreationDate="2017-03-23T18:18:50.480" Score="10" Body="&lt;p&gt;You can press &lt;code&gt;C-o&lt;/code&gt; to switch to the other list (I also found this behaviour unintuitive when I started using Helm).&#xA;Alternatively, if you want to always be able to move to the Emacs Command list, evaluate the following snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq helm-move-to-line-cycle-in-source nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a duplicate as a Github issue:&#xA;&lt;a href=&quot;https://github.com/emacs-helm/helm/issues/683&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/emacs-helm/helm/issues/683&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here's a duplicate from SO:&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/27645582/emacs-helm-m-x-how-to-jump-to-the-list-of-historical-command&quot;&gt;https://stackoverflow.com/questions/27645582/emacs-helm-m-x-how-to-jump-to-the-list-of-historical-command&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To read the helm M-x documentation you can press &lt;code&gt;C-c ?&lt;/code&gt; after invoking helm. &lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-23T18:18:50.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31657" PostTypeId="1" CreationDate="2017-03-23T19:11:27.677" Score="1" ViewCount="633" Body="&lt;p&gt;I've searched for a long time and tried some suggestions from respective manuals like &lt;code&gt;ac-use-fuzzy&lt;/code&gt; etc, but haven't been able to enable fuzzy matching. I mean I want it start without pressing any special keys.&lt;/p&gt;&#xA;" OwnerUserId="15216" LastEditorUserId="105" LastEditDate="2017-03-23T21:14:10.820" LastActivityDate="2017-03-23T21:14:10.820" Title="How to enable fuzzy autocomplete in auto-complete and/or company-mode" Tags="|company-mode|completion|auto-complete-mode|fuzzy-matching|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31658" PostTypeId="5" CreationDate="2017-03-23T19:26:06.840" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/jaypei/emacs-neotree&quot; rel=&quot;nofollow noreferrer&quot;&gt;NeoTree&lt;/a&gt; is an emacs tree plugin like &lt;a href=&quot;http://www.vim.org/scripts/script.php?script_id=1658&quot; rel=&quot;nofollow noreferrer&quot;&gt;NERD tree&lt;/a&gt; for Vim.&lt;/p&gt;&#xA;" OwnerUserId="10890" LastEditorUserId="10890" LastEditDate="2017-03-23T21:13:24.130" LastActivityDate="2017-03-23T21:13:24.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31659" PostTypeId="4" CreationDate="2017-03-23T19:26:06.840" Score="0" Body="NeoTree is an emacs tree plugin like NERD tree for Vim." OwnerUserId="10890" LastEditorUserId="10890" LastEditDate="2017-03-23T21:12:49.437" LastActivityDate="2017-03-23T21:12:49.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31660" PostTypeId="1" AcceptedAnswerId="33047" CreationDate="2017-03-23T19:31:50.640" Score="2" ViewCount="5908" Body="&lt;p&gt;The only way i know to make NeoTree show hidden files is to use &lt;a href=&quot;https://www.emacswiki.org/emacs/NeoTree#toc6&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;neotree-hidden-file-toggle&lt;/code&gt;&lt;/a&gt;, but this is meant to be used interactively when the NeoTree buffer is the active buffer. Is there a way to globally set in my &lt;code&gt;.emacs&lt;/code&gt; init file to make NeoTree always have the behavior of showing hidden files?&lt;/p&gt;&#xA;" OwnerUserId="10890" LastActivityDate="2020-10-13T14:45:02.183" Title="How can I set NeoTree to always show hidden files?" Tags="|init-file|neotree|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31661" PostTypeId="1" CreationDate="2017-03-23T21:38:25.330" Score="4" ViewCount="264" Body="&lt;p&gt;In mu4e, :human-date shows seconds which I would like to avoid? How can I only show hour and minute in the HH:MM format?&lt;/p&gt;&#xA;" OwnerUserId="9303" LastActivityDate="2017-03-26T09:22:56.773" Title="Removing seconds from :human-date in mu4e" Tags="|mu4e|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31662" PostTypeId="2" ParentId="31614" CreationDate="2017-03-23T22:00:51.867" Score="4" Body="&lt;p&gt;AFAICT, Emacs does not save this info in a standard place.  Håkon's solution might work for you, but that completely depends on the program that launches Emacs: some will put the directory in $PWD, but others won't (so you may get a valid $PWD, or no $PWD, or a $PWD that's not truthful).  Other solutions would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If it's for your own personal use, just add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq my-saved-launch-directory default-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;somewhere at the beginning of your &lt;code&gt;~/.emacs&lt;/code&gt;, after which you can use that variable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Otherwise, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-current-buffer &quot;*scratch*&quot; default-directory)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which will usually work as long as nothing has deleted &lt;code&gt;*scratch*&lt;/code&gt; nor changed its default directory.  As pointed out by Gilles, you can also use the &lt;code&gt;*Messages*&lt;/code&gt; buffer, which might even work better.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-03-24T03:13:21.673" LastActivityDate="2017-03-24T03:13:21.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31663" PostTypeId="1" CreationDate="2017-03-23T23:10:30.780" Score="2" ViewCount="317" Body="&lt;p&gt;In &lt;code&gt;compilation-mode&lt;/code&gt; (or some similar mode), how can I make the default py.test output be colourized?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not talking about &lt;a href=&quot;https://emacs.stackexchange.com/questions/31554/clickable-links-to-py-test-stack-frame-lines-in-compilation-mode&quot;&gt;clickable links&lt;/a&gt;, but about just 'syntax' colouring the various parts of the output.  Scare quotes because there are multiple syntaxes going on in the same buffer (python code snippets, various kinds of stack info, and other py.test output like the 'FAILURES' line), and because py.test's output perhaps isn't that standardized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be happy with just some of this structure highlighted, but the more the merrier.&lt;/p&gt;&#xA;" OwnerUserId="5495" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-03-26T01:24:10.553" Title="How to syntax-colour py.test output?" Tags="|python|faces|font-lock|syntax-highlighting|compilation-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31664" PostTypeId="1" AcceptedAnswerId="31678" CreationDate="2017-03-24T03:12:23.923" Score="0" ViewCount="623" Body="&lt;p&gt;Can we do statistic with remote table?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say TBL2 row1 is min of TBL1 columns,TBL2 row2 is max of TBL1 columns.&#xA;I write formula as below but it doesn't work!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: TBL1&#xA;|  2 |  3 |&#xA;|  4 |  5 |&#xA;|  7 | 10 |&#xA;| 12 | 1  | &#xA;&#xA;#+NAME: TBL2&#xA;| #ERROR | #ERROR |&#xA;| #ERROR | #ERROR |&#xA;#+TBLFM: @1$1='(seq-min remote(TBL1,$1))::@1$2='(seq-min remote(TBL1,$2))::@2$1='(seq-max remote(TBL1,$1))::@2$2='(seq-max remote(TBL1,$2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;expected output is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: TBL2&#xA;|  2 |  1 |&#xA;| 12 | 10 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2019-04-24T12:43:01.547" Title="Org mode - do statistic with remote table" Tags="|org-mode|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31665" PostTypeId="2" ParentId="31664" CreationDate="2017-03-24T03:31:11.707" Score="0" Body="&lt;p&gt;In &lt;code&gt;TBLFM&lt;/code&gt; row, you must use &lt;a href=&quot;http://orgmode.org/manual/Formula-syntax-for-Calc.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs &lt;code&gt;calc&lt;/code&gt; syntax&lt;/a&gt; to do calculations, not emacs lisp syntax.  So the &lt;code&gt;seq-min&lt;/code&gt; in your &lt;code&gt;TBLFM&lt;/code&gt; will not work.&lt;/p&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="14920" LastEditDate="2019-04-24T12:43:01.547" LastActivityDate="2019-04-24T12:43:01.547" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="31666" PostTypeId="2" ParentId="31475" CreationDate="2017-03-24T07:39:15.897" Score="4" Body="&lt;p&gt;In Emacs, syntax highlighting is performed using the module &lt;code&gt;font-lock&lt;/code&gt;. It highlights a buffer in two phases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;strong&gt;syntactic&lt;/strong&gt; phase, where comments and strings are highlighted.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;keyword&lt;/strong&gt; phase, where everything else is highlighted.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The rules for the keywords phase is stored in the variable &lt;code&gt;font-lock-keywords&lt;/code&gt;. The variable accepts a complex data structure. It is fully described in it's doc string. However, the text is very complex, and it might take some time to let everything sink in -- I've been trying to understand it for the past 20 years ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A keyword can either be based on a regexp or lisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add font-lock keywords using &lt;code&gt;font-lock-add-keywords&lt;/code&gt; and remove old ones using &lt;code&gt;font-lock-remove-keywords&lt;/code&gt;. They take two arguments, a major mode and a list of new keywords. Instead of a major mode, you can pass &lt;code&gt;nil&lt;/code&gt;, which makes them act on the current buffer. I would recommend you to use the latter method, as it would allow you to try out keyword variants until you are satisfied -- just kill the current buffer and reopen the file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you will need to find the font-lock keywords that doesn't work as you want (e.g. how it highlights the &lt;code&gt;@&lt;/code&gt; sign, and how it decides which color a builtin function like &lt;code&gt;print&lt;/code&gt;) and modify those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The view and understand existing keywords, I would like to recommend my package &lt;a href=&quot;https://github.com/Lindydancer/font-lock-studio&quot; rel=&quot;nofollow noreferrer&quot;&gt;Font Lock Studio&lt;/a&gt;. It's an interactive debugger for font-lock keywords, where you can step one part of the font-lock highlighting machinery at a time.&lt;/p&gt;&#xA;" OwnerUserId="897" LastActivityDate="2017-03-24T07:39:15.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31667" PostTypeId="1" AcceptedAnswerId="31673" CreationDate="2017-03-24T08:23:27.637" Score="6" ViewCount="465" Body="&lt;p&gt;There is one star (*) before every menu in Emacs info.  Some of them are red, I am wondering why they are red and what does the red means?  Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NC5ji.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NC5ji.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13609" LastActivityDate="2017-03-24T15:52:24.700" Title="Why is the star before some menus in Info are red?" Tags="|info|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31668" PostTypeId="1" AcceptedAnswerId="31690" CreationDate="2017-03-24T00:35:44.300" Score="3" ViewCount="112" Body="&lt;p&gt;Emacs has a buit-in library to generate a landscape calendar with the function &lt;code&gt;cal-tex-cursor-month-landscape&lt;/code&gt;.  I am using TexLive 2012 on a OSX.  The calendar image gets truncated on portrait orientation paper -- i.e., TexLive 2012 does not know to print the image in landscape.  How can I use &lt;code&gt;cal-tex-cursor-month-landscape&lt;/code&gt; to properly generate a landscape calendar using TexLive 2012?&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;%   This buffer was produced by cal-tex.el.&#xA;%   To print a calendar, type&#xA;%       M-x tex-buffer RET&#xA;%       M-x tex-print  RET&#xA;\documentclass[12pt]{article}&#xA;\hbadness 20000&#xA;\hfuzz=1000pt&#xA;\vbadness 20000&#xA;\lineskip 0pt&#xA;\marginparwidth 0pt&#xA;\oddsidemargin  -2cm&#xA;\evensidemargin -2cm&#xA;\marginparsep   0pt&#xA;\topmargin      0pt&#xA;\textwidth      7.5in&#xA;\textheight     9.5in&#xA;\newlength{\cellwidth}&#xA;\newlength{\cellheight}&#xA;\newlength{\boxwidth}&#xA;\newlength{\boxheight}&#xA;\newlength{\cellsize}&#xA;\newcommand{\myday}[1]{}&#xA;\newcommand{\caldate}[6]{}&#xA;\newcommand{\nocaldate}[6]{}&#xA;\newcommand{\calsmall}[6]{}&#xA;%&#xA;\special{landscape}% &#xA;\textwidth 9.5in{}% &#xA;\textheight 7in{}% &#xA;% &#xA;\def\holidaymult{.08}% &#xA;\fboxsep=0pt&#xA;\long\def\caldate#1#2#3#4#5#6{%&#xA;    \fbox{\hbox to\cellwidth{%&#xA;     \vbox to\cellheight{%&#xA;       \hbox to\cellwidth{%&#xA;          {\hspace*{1mm}\Large \bf \strut #2}\hspace{.05\cellwidth}%&#xA;          \raisebox{\holidaymult\cellheight}%&#xA;                   {\parbox[t]{.75\cellwidth}{\tiny \raggedright #4}}}&#xA;       \hbox to\cellwidth{%&#xA;           \hspace*{1mm}\parbox{.95\cellwidth}{\tiny \raggedright #3}}&#xA;       \hspace*{1mm}%&#xA;       \hbox to\cellwidth{#6}%&#xA;       \vfill%&#xA;       \hbox to\cellwidth{\hfill \tiny #5 \hfill}%&#xA;       \vskip 1.4pt}%&#xA;     \hskip -0.4pt}}}&#xA;{}% &#xA;\renewcommand{\myday}[1]%&#xA;{\makebox[\cellwidth]{\hfill\large\bf#1\hfill}}&#xA;%&#xA;{}% &#xA;\begin{document}% &#xA;\pagestyle{empty}% &#xA;\setlength{\cellwidth}{24cm}% &#xA;\setlength{\cellwidth}{0.157143\cellwidth}&#xA;\setlength{\cellheight}{18cm}% &#xA;\setlength{\cellheight}{0.166667\cellheight}&#xA;\ \par{}% &#xA;\vspace*{-3cm}% &#xA;\def\calmonth#1#2%&#xA;{\begin{center}%&#xA;\Huge\bf\uppercase{#1} #2 \\[1cm]%&#xA;\end{center}}%&#xA;\vspace*{-1.5cm}%&#xA;%&#xA;{}% &#xA;\def\lastmonth{\hbox to\cellwidth{%&#xA;\vbox to\cellheight{%&#xA;\vfil  \hbox to\cellwidth{%&#xA;\hfil\scriptsize\begin{tabular}{@{\hspace{0mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{0mm}}}%&#xA;\multicolumn{7}{c}{March 2017}\\[1mm]&#xA;Su &amp;amp; Mo &amp;amp; Tu &amp;amp; We &amp;amp; Th &amp;amp; Fr &amp;amp; Sa\\[0.7mm]&#xA; &amp;amp;  &amp;amp;  &amp;amp; 1 &amp;amp; 2 &amp;amp; 3 &amp;amp; 4\\[0.5mm]&#xA;5 &amp;amp; 6 &amp;amp; 7 &amp;amp; 8 &amp;amp; 9 &amp;amp; 10 &amp;amp; 11\\[0.5mm]&#xA;12 &amp;amp; 13 &amp;amp; 14 &amp;amp; 15 &amp;amp; 16 &amp;amp; 17 &amp;amp; 18\\[0.5mm]&#xA;19 &amp;amp; 20 &amp;amp; 21 &amp;amp; 22 &amp;amp; 23 &amp;amp; 24 &amp;amp; 25\\[0.5mm]&#xA;26 &amp;amp; 27 &amp;amp; 28 &amp;amp; 29 &amp;amp; 30 &amp;amp; 31 &amp;amp; &#xA;\end{tabular}\hfil}\vfil}}}%&#xA;\def\nextmonth{\hbox to\cellwidth{%&#xA;\vbox to\cellheight{%&#xA;\vfil  \hbox to\cellwidth{%&#xA;\hfil\scriptsize\begin{tabular}{@{\hspace{0mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{0mm}}}%&#xA;\multicolumn{7}{c}{May 2017}\\[1mm]&#xA;Su &amp;amp; Mo &amp;amp; Tu &amp;amp; We &amp;amp; Th &amp;amp; Fr &amp;amp; Sa\\[0.7mm]&#xA; &amp;amp; 1 &amp;amp; 2 &amp;amp; 3 &amp;amp; 4 &amp;amp; 5 &amp;amp; 6\\[0.5mm]&#xA;7 &amp;amp; 8 &amp;amp; 9 &amp;amp; 10 &amp;amp; 11 &amp;amp; 12 &amp;amp; 13\\[0.5mm]&#xA;14 &amp;amp; 15 &amp;amp; 16 &amp;amp; 17 &amp;amp; 18 &amp;amp; 19 &amp;amp; 20\\[0.5mm]&#xA;21 &amp;amp; 22 &amp;amp; 23 &amp;amp; 24 &amp;amp; 25 &amp;amp; 26 &amp;amp; 27\\[0.5mm]&#xA;28 &amp;amp; 29 &amp;amp; 30 &amp;amp; 31 &amp;amp; &#xA;\end{tabular}\hfil}\vfil}}}%&#xA;\calmonth{April}{2017}&#xA;\vspace*{-0.5cm}% &#xA;\myday{Sunday}%% &#xA;\myday{Monday}%% &#xA;\myday{Tuesday}%% &#xA;\myday{Wednesday}%% &#xA;\myday{Thursday}%% &#xA;\myday{Friday}%% &#xA;\myday{Saturday}%% &#xA;\\[.2cm]% &#xA;\lastmonth\nextmonth\hspace*{-2\cellwidth}\caldate{ }{ }{}{}{}{}%&#xA;\caldate{ }{ }{}{}{}{}%&#xA;\caldate{ }{ }{}{}{}{}%&#xA;\caldate{ }{ }{}{}{}{}%&#xA;\caldate{ }{ }{}{}{}{}%&#xA;\caldate{ }{ }{}{}{}{}%&#xA;\caldate{April}{1}{}{}{91/274}{}% &#xA;\hfill\\% &#xA;\caldate{April}{2}{}{}{92/273}{}% &#xA;\caldate{April}{3}{}{}{93/272}{}% &#xA;\caldate{April}{4}{}{}{94/271}{}% &#xA;\caldate{April}{5}{}{}{95/270}{}% &#xA;\caldate{April}{6}{}{}{96/269}{}% &#xA;\caldate{April}{7}{}{}{97/268}{}% &#xA;\caldate{April}{8}{}{}{98/267}{}% &#xA;\hfill\\% &#xA;\caldate{April}{9}{}{}{99/266}{}% &#xA;\caldate{April}{10}{}{}{100/265}{}% &#xA;\caldate{April}{11}{}{}{101/264}{}% &#xA;\caldate{April}{12}{}{}{102/263}{}% &#xA;\caldate{April}{13}{}{}{103/262}{}% &#xA;\caldate{April}{14}{}{}{104/261}{}% &#xA;\caldate{April}{15}{}{}{105/260}{}% &#xA;\hfill\\% &#xA;\caldate{April}{16}{}{}{106/259}{}% &#xA;\caldate{April}{17}{}{}{107/258}{}% &#xA;\caldate{April}{18}{}{}{108/257}{}% &#xA;\caldate{April}{19}{}{}{109/256}{}% &#xA;\caldate{April}{20}{}{}{110/255}{}% &#xA;\caldate{April}{21}{}{}{111/254}{}% &#xA;\caldate{April}{22}{}{}{112/253}{}% &#xA;\hfill\\% &#xA;\caldate{April}{23}{}{}{113/252}{}% &#xA;\caldate{April}{24}{}{}{114/251}{}% &#xA;\caldate{April}{25}{}{}{115/250}{}% &#xA;\caldate{April}{26}{}{}{116/249}{}% &#xA;\caldate{April}{27}{}{}{117/248}{}% &#xA;\caldate{April}{28}{}{}{118/247}{}% &#xA;\caldate{April}{29}{}{}{119/246}{}% &#xA;\hfill\\% &#xA;\caldate{April}{30}{}{}{120/245}{}% &#xA;\caldate{}{}{}{}{}{}%&#xA;\caldate{}{}{}{}{}{}%&#xA;\caldate{}{}{}{}{}{}%&#xA;\caldate{}{}{}{}{}{}%&#xA;\caldate{}{}{}{}{}{}%&#xA;\caldate{}{}{}{}{}{}%&#xA;\end{document}% &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" OwnerDisplayName="lawlist" LastEditorUserId="14190" LastEditDate="2017-03-24T14:20:28.437" LastActivityDate="2017-03-26T16:29:33.870" Title="Emacs: `cal-tex-cursor-month-landscape` is texing as portrait" Tags="|latex|calendar|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31669" PostTypeId="2" ParentId="20339" CreationDate="2017-03-24T09:33:03.473" Score="1" Body="&lt;p&gt;I hadn't read the update completely. It seems as though you might be able to get &lt;code&gt;\bar{&lt;/code&gt; to start the fontification, but to get &lt;code&gt;}&lt;/code&gt; to stop it might be harder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative (if you would like latex support), you might be able to control the export to LaTeX to output &lt;code&gt;\bar{&lt;/code&gt; and &lt;code&gt;}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Old answer (just the formatting)&lt;/strong&gt;: You provided everything needed: just add the item&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;!&quot; (:overline t) verbatim))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your &lt;code&gt;org-emphasis-alist&lt;/code&gt;. This makes &lt;code&gt;!barber!&lt;/code&gt; appear with overline. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example from .emacs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(org-emphasis-alist&#xA;   (quote&#xA;    ((&quot;*&quot; bold)&#xA;     (&quot;/&quot; italic)&#xA;     (&quot;_&quot; underline)&#xA;     (&quot;=&quot; org-verbatim verbatim)&#xA;     (&quot;~&quot; org-code verbatim)&#xA;     (&quot;+&quot;&#xA;      (:strike-through t))&#xA;     (&quot;!&quot;&#xA;      (:overline t)&#xA;      verbatim)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8431" LastEditorUserId="8431" LastEditDate="2017-03-24T16:32:29.653" LastActivityDate="2017-03-24T16:32:29.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31670" PostTypeId="1" AcceptedAnswerId="31677" CreationDate="2017-03-24T09:59:36.180" Score="1" ViewCount="155" Body="&lt;p&gt;I am new to Emacs. I am reading a book on Python. The book has many code examples. What I would like to do is to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;convert this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 61. def getRandomWord(wordList):&#xA; 62.     # This function returns a random string from the passed list of strings.&#xA; 63.     wordIndex = random.randint(0, len(wordList) - 1)&#xA; 64.     return wordList[wordIndex]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def getRandomWord(wordList):&#xA;    # This function returns a random string from the passed list of strings.&#xA;    wordIndex = random.randint(0, len(wordList) - 1)&#xA;    return wordList[wordIndex]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;removing one space + the number + one space that appears at the beginning of each line. I'm sure there are multiple ways to accomplish this. For example, a regex search, multiple cursors, or a command that removes the first 5 chars from each line of a text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were going through a text with a lot of code examples that you wanted to copy/paste into Emacs, what method would you use to remove the line numbers?&lt;/p&gt;&#xA;" OwnerUserId="15184" LastEditorUserId="15184" LastEditDate="2017-03-24T10:46:04.883" LastActivityDate="2017-03-24T13:56:20.937" Title="Removing preceding text from each line of a text" Tags="|regular-expressions|keyboard-macros|" AnswerCount="2" CommentCount="0" ClosedDate="2017-03-26T01:56:54.760" ContentLicense="CC BY-SA 3.0" />
  <row Id="31671" PostTypeId="2" ParentId="31670" CreationDate="2017-03-24T10:30:16.863" Score="2" Body="&lt;p&gt;I'd use either a keyboard macro or a replace-regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Keyboard macro&lt;/strong&gt;: &lt;code&gt;f3 C-a M-d C-d C-d C-n f4&lt;/code&gt; then press &lt;code&gt;f4&lt;/code&gt; to delete the line number for each line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This records a macro which: puts the cursor to the beginning of line, deletes a word (the number) and 2 characters (the dot and the space), then moves to the next line. [Deleting 5 characters only works for numbers between 10 and 99]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you paste another code block later and you didn't record another macro in between, you can just skip to pressing &lt;code&gt;f4&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Replace-regexp&lt;/strong&gt;: call &lt;code&gt;query-replace-regexp&lt;/code&gt; (&lt;code&gt;C-M-%&lt;/code&gt;), with &lt;code&gt;^[0-9]+\.&lt;/code&gt; as &quot;from&quot; and the empty string as &quot;to&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can recall the strings from the input history if you need to execute the same replacement again later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, either solution can easily be turned into an interactive function if you feel the need to: for the macro, use &lt;code&gt;kmacro-name-last-macro&lt;/code&gt;, and for replace-regexp, wrap it into an interactive defun, taking good care to protect the backslashes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tv/delete-heading-newline ()&#xA;    (interactive)&#xA;    (query-replace-regexp &quot;^[0-9]+\\. &quot; &quot;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="184" LastActivityDate="2017-03-24T10:30:16.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31673" PostTypeId="2" ParentId="31667" CreationDate="2017-03-24T12:24:37.447" Score="9" Body="&lt;p&gt;IIRC the red highlight was introduced to help you count entries so you can jump directly to menu entries by number (the red stars correspond to entries 3, 6, and 9 respectively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've never made use of that feature, so I'm not sure how valuable it is.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-24T12:24:37.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31674" PostTypeId="2" ParentId="10354" CreationDate="2017-03-24T13:16:47.370" Score="3" Body="&lt;p&gt;The problem as I understand it is that the image is a single line. Changing how scrolling behaves won't solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only solution I am aware of is to slice the image up so that there are technically many shorter images. This can be done using &lt;code&gt;insert-sliced-image&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastActivityDate="2017-03-24T13:16:47.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31675" PostTypeId="1" CreationDate="2017-03-24T13:27:09.713" Score="3" ViewCount="251" Body="&lt;p&gt;I am trying to use the eieio-persistent class to make persistent objects. My goal is to store many objects in a file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to achieve this though. If I use this code, I do get a persistent object saved in test.db, but (perhaps predictably) the second save overwrites the first one.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defclass animal (eieio-persistent)&#xA;  ((type :initarg :type)&#xA;   (file :initform &quot;/Users/jkitchin/Dropbox/org-mode/test.db&quot;)))&#xA;&#xA;&#xA;(let ((a1 (animal :type 'mammal)))&#xA;  (eieio-persistent-save a1))&#xA;&#xA;(let ((a1 (animal :type 'rodent)))&#xA;  (eieio-persistent-save a1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to save a list of these &quot;animals&quot; using the eieio framework? I would prefer not to create individual files for each object (I am anticipating thousands of objects later that need to be read in). Ideally, there would be another class that had a list of these animal objects in a records field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this is close&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defclass animal-db (eieio-named eieio-persistent)&#xA;  ((id :initarg :id)&#xA;   (file :initform &quot;/Users/jkitchin/Dropbox/org-mode/test.db&quot;)&#xA;   (records :initarg :records :type listp))&#xA;  &quot;Base db for animal class&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but the list in the records doesn't appear to be actual objects, when I read the code back in, but code that needs to be eval'd to get the object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2024-01-15T12:08:01.180" Title="How do you use the eieio-persistent class to serialize a set of objects?" Tags="|eieio|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31676" PostTypeId="2" ParentId="31645" CreationDate="2017-03-24T13:53:04.920" Score="3" Body="&lt;p&gt;It is possible to use a different backend than helm-bibtex which offers different sorting options. The org-ref-helm-cite backend allows you to sort by key, year and first author lastname (both ascending and descending) with key bindings. You type M- and then you get a menu to select the sort type and direction. It is not a well-used feature even by me, so your mileage on its utility might vary.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-03-24T13:53:04.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31677" PostTypeId="2" ParentId="31670" CreationDate="2017-03-24T13:56:20.937" Score="3" Body="&lt;p&gt;I would most likely use rectangle selection in this case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put point at the top-left position, then hit &lt;code&gt;C-x &amp;lt;SPC&amp;gt;&lt;/code&gt; (&lt;code&gt;rectangle-mark-mode&lt;/code&gt;) to start selection. Move point to the lower-right corner of the rectangle that contains the stuff you want to remove, then just kill the region with &lt;code&gt;C-w&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, defining a macro or using a regexp is a better solution if you need to repeat this same thing many times (so +1 to @t-verron's answer). &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-24T13:56:20.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31678" PostTypeId="2" ParentId="31664" CreationDate="2017-03-24T14:10:06.920" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;Should not use '$1' to access column1 values, but use '@1$1..@1$&gt;'.&lt;/li&gt;&#xA;&lt;li&gt;Should use calcFunc vector functions 'calcFunc-v**', vmin/vmax for this case.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;```&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: TBL1&#xA;|  2 |  3 |&#xA;|  4 |  5 |&#xA;|  7 | 10 |&#xA;| 12 | 1  | &#xA;&#xA;#+NAME: TBL2&#xA;|  2 |  1 |&#xA;| 12 | 10 |&#xA;#+TBLFM: @1$1=vmin(remote(TBL1,@1$1..@&amp;gt;$1))::@1$2=vmin(remote(TBL1,@1$2..@&amp;gt;$2))::@2$1=vmax(remote(TBL1,@1$1..@&amp;gt;$1))::@2$2=vmax(remote(TBL1,@1$2..@&amp;gt;$2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;```&lt;/p&gt;&#xA;" OwnerUserId="14840" LastActivityDate="2017-03-24T14:10:06.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31679" PostTypeId="2" ParentId="31667" CreationDate="2017-03-24T15:30:10.870" Score="3" Body="&lt;p&gt;You can &lt;em&gt;ask Emacs&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs provides the &lt;strong&gt;&lt;em&gt;Info&lt;/em&gt; manual&lt;/strong&gt; as the first manual you see when you use command &lt;code&gt;info&lt;/code&gt; (&lt;strong&gt;&lt;code&gt;C-h i&lt;/code&gt;&lt;/strong&gt;). It is a short manual that tells you all about using manuals with Info, the documentation browser built into Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Click its name to open that manual, then type &lt;strong&gt;&lt;code&gt;i&lt;/code&gt;&lt;/strong&gt; to check Index entries. (&lt;code&gt;i&lt;/code&gt; is your friend in Info.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are interested in information about Info &lt;em&gt;menus&lt;/em&gt;, so type &lt;code&gt;menu&lt;/code&gt;, then &lt;code&gt;TAB&lt;/code&gt; at the prompt from &lt;code&gt;i&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That shows only a single completion of your input &quot;&lt;code&gt;menu&lt;/code&gt;&quot;: &lt;code&gt;menus in an Info document&lt;/code&gt;. Hitting &lt;code&gt;RET&lt;/code&gt; takes you to that node (page) of the manual, where you can read about Info menus in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well ... tough luck.  This is a case where the manual's Index didn't help as much as it should have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, there &lt;em&gt;is&lt;/em&gt; a node of the manual that tells you what you are asking.  But it is not indexed with an entry that &lt;em&gt;starts&lt;/em&gt; with &lt;code&gt;menu&lt;/code&gt;, so &lt;code&gt;i&lt;/code&gt; doesn't find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, &lt;code&gt;i&lt;/code&gt; doesn't find it if completion is the default sort, which does not do &lt;em&gt;substring matching&lt;/em&gt;.  If you change option &lt;strong&gt;&lt;code&gt;completion-styles&lt;/code&gt;&lt;/strong&gt; so that your search pattern can match a substring of an index entry (or if you use &lt;a href=&quot;http://www.emacswiki.org/emacs/Icicles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Icicles&lt;/a&gt; or something similar) then -- &lt;em&gt;Bingo!&lt;/em&gt; -- you see these other index entries as choices:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   Info-nth-menu-item &#xA;   select N’th menu item&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Admittedly, they don't scream &lt;strong&gt;&quot;menu item with a red star&quot;&lt;/strong&gt;, but they do sound related, and they are.  Either of them takes you to node &quot;&lt;strong&gt;&lt;code&gt;1&lt;/code&gt; to &lt;code&gt;9&lt;/code&gt; choose a menu subtopic by its number&lt;/strong&gt;&quot;.  And there you see this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If your display supports multiple fonts, colors or underlining, and&#xA;  you are using Emacs’s Info mode to read Info files, &lt;em&gt;the third, sixth and&#xA;  ninth menu items have a &lt;strong&gt;&lt;code&gt;*&lt;/code&gt;&lt;/strong&gt; that stands out&lt;/em&gt;, either in color or in some&#xA;  other attribute, such as underline; this &lt;em&gt;makes it easy to see at a&#xA;  glance which number to use for an item&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And there you have it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(FYI: I just filed Emacs &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26236&quot; rel=&quot;nofollow noreferrer&quot;&gt;bug #26236&lt;/a&gt; for this.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-03-24T15:52:24.700" LastActivityDate="2017-03-24T15:52:24.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31680" PostTypeId="2" ParentId="31646" CreationDate="2017-03-24T15:41:25.877" Score="1" Body="&lt;p&gt;Here is a elisp function that should do what you want&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun yank-with-indent ()&#xA;  (interactive)&#xA;  (let ((indent&#xA;         (buffer-substring-no-properties (line-beginning-position) (line-end-position))))&#xA;    (message indent)&#xA;    (yank)&#xA;    (narrow-to-region (mark t) (point))&#xA;    (pop-to-mark-command)&#xA;    (replace-string &quot;\n&quot; (concat &quot;\n&quot; indent))&#xA;    (widen)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10531" LastActivityDate="2017-03-24T15:41:25.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31681" PostTypeId="1" AcceptedAnswerId="31684" CreationDate="2017-03-24T20:09:14.037" Score="4" ViewCount="1483" Body="&lt;p&gt;I am using special blocks to create myself a theorem environment so that I can style it in both HTML and Latex output. For this I do;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_theorem&#xA; ---Theorem goes here----&#xA;#+END_theorem&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this expands into Latex as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{theorem}&#xA; ---Theorem goes here----&#xA;\end{theorem}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I want to pass an optional argument to this special block so that when I do;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_theorem&#xA;#+ATTR_LATEX :theorem_name &quot;Mean Value Thorem&quot;&#xA; ---Theorem goes here----&#xA;#+END_theorem&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so that it will expand into;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{theorem}[Mean Value Theorem]&#xA; ---Theorem goes here----&#xA;\end{theorem}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, basically I want to pass argument to Latex expansion through special blocks. How can I achieve this?&lt;/p&gt;&#xA;" OwnerUserId="11312" LastActivityDate="2017-03-24T21:31:27.750" Title="org-mode special blocks latex attribute" Tags="|org-mode|latex|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31682" PostTypeId="2" ParentId="31631" CreationDate="2017-03-24T20:12:30.707" Score="2" Body="&lt;p&gt;'hide-ifdef-mode' hides, but it doesn't do the preprocessor evaluation, since that can come from multiple places, most of which aren't available to an Emacs mode which is just looking at a single file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You enter &lt;code&gt;hide-ifdef-mode&lt;/code&gt;, then tell the mode what things are defined and are not, using &lt;code&gt;hide-ifdef-define&lt;/code&gt;/&lt;code&gt;hide-ifdef-undef&lt;/code&gt;.  Then &lt;code&gt;hide-ifdefs&lt;/code&gt; will do what you want. You can save lists of these definitions and toggle them (&lt;code&gt;hide-ifdef-set-define-alist&lt;/code&gt;/&lt;code&gt;hide-ifdef-use-define-alist&lt;/code&gt;). &lt;code&gt;hif-evaluate-macro&lt;/code&gt; might be pretty valuable for you to handle more involved macrology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is simple to use but tedious if you have a lot of complex preprocessor defs that depend on others etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Might be some more project-aware packages that wrap this to make this easier, not sure.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-03-24T20:12:30.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31683" PostTypeId="1" AcceptedAnswerId="31708" CreationDate="2017-03-24T21:23:11.640" Score="12" ViewCount="4023" Body="&lt;p&gt;How do I schedule a repeating org-mode task for the last day of every month?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As is, when I schedule a task like &lt;code&gt;DEADLINE: &amp;lt;2017-03-31 Fri +1m&amp;gt;&lt;/code&gt;, marking it done shifts the next date to &lt;code&gt;DEADLINE: &amp;lt;2017-05-01 Fri +1m&amp;gt;&lt;/code&gt; which would be a day too late if the deadline is the end of the month. Dates scheduled for the beginning of the month properly advance to the first of the following month, regardless of number of days in the month, so this problem only occurs at the end of the month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prefer to do this using pure org-mode and avoid &lt;code&gt;diary&lt;/code&gt; dates if possible since some commands and views can't handle diary dates. That said,  a &lt;code&gt;diary&lt;/code&gt; solution is better than nothing!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is distinct from &lt;a href=&quot;https://emacs.stackexchange.com/questions/21220&quot;&gt;Schedule repeating Org event for day of month&lt;/a&gt; since scheduling for the end of the month is a common edge case which requires special handling to account for the variable number of days in each month.&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-03-27T20:02:31.493" Title="Schedule org task for last day of every month?" Tags="|org-mode|org-agenda|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31684" PostTypeId="2" ParentId="31681" CreationDate="2017-03-24T21:31:27.750" Score="8" Body="&lt;p&gt;The following example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+ATTR_LATEX: :options [Mean Value Theorem]&#xA;#+begin_theorem&#xA;This is a theorem&#xA;#+end_theorem&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;produces&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\begin{theorem}[Mean Value Theorem]&#xA;This is a theorem&#xA;\end{theorem}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;:options&lt;/code&gt; keyword is in the last section of the &lt;a href=&quot;http://orgmode.org/manual/LaTeX-specific-attributes.html&quot; rel=&quot;noreferrer&quot;&gt;manual page&lt;/a&gt; for LaTeX block attributes.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2017-03-24T21:31:27.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31685" PostTypeId="1" AcceptedAnswerId="33030" CreationDate="2017-03-24T23:43:43.693" Score="1" ViewCount="1356" Body="&lt;p&gt;When adding the docstring to a fuction&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def func():&#xA;    &quot;&quot;&quot;|&quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After pressing &lt;code&gt;RET&lt;/code&gt; I have this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def func():&#xA;    &quot;&quot;&quot;&#xA;&quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def func():&#xA;    &quot;&quot;&quot;&#xA;    |&#xA;    &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;|&lt;/code&gt; is a cursor.&lt;/p&gt;&#xA;" OwnerUserId="15216" LastEditorUserId="5187" LastEditDate="2017-03-25T14:51:20.737" LastActivityDate="2017-05-24T19:01:05.123" Title="How to fix multiline-string indentation in python-mode?" Tags="|indentation|python|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31686" PostTypeId="1" AcceptedAnswerId="31687" CreationDate="2017-03-25T02:01:39.190" Score="4" ViewCount="1400" Body="&lt;p&gt;I often did undo too much, then redo it. I noticed I have default undo position in my mind. I think &lt;code&gt;C-x C-s&lt;/code&gt; is helpful but not enough, because it just indicate modified or not, so the buffer is still possible to undo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I want to reset undo history when I think this is certainly my default undo position. If I can do so, I think I can come back default undo position easily like this &lt;code&gt;C-u 1000000000 C-_&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I need to find or create command like below &lt;code&gt;xxx&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I type below text in the current buffer,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...So Emacs is the excellent editor.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I use &lt;code&gt;M-x xxx&lt;/code&gt;. And then, I continue to type like this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...So Emacs is the excellent editor.&#xA;But there are more excellent editor like...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But to pass through the reviewers, I need to correct second one. So I have to do &lt;code&gt;C-u 1000000000 C-_&lt;/code&gt; and the result will be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...So Emacs is the excellent editor.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any command like &lt;code&gt;xxx&lt;/code&gt; above?&lt;/p&gt;&#xA;" OwnerUserId="15255" LastActivityDate="2017-03-28T14:25:10.780" Title="How to reset undo history?" Tags="|undo|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31687" PostTypeId="2" ParentId="31686" CreationDate="2017-03-25T03:01:29.470" Score="4" Body="&lt;p&gt;Instead of &lt;code&gt;C-u 1000000000 C-_&lt;/code&gt;, I'd recommend &lt;code&gt;M-x revert-buffer RET&lt;/code&gt;.  Then you don't need your &lt;code&gt;xxx&lt;/code&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for &lt;code&gt;xxx&lt;/code&gt;, you could do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x buffer-disable-undo RET&#xA;M-x buffer-enable-undo RET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-25T03:01:29.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31688" PostTypeId="2" ParentId="31683" CreationDate="2017-03-25T04:02:27.260" Score="3" Body="&lt;p&gt;Wow I never realized such a basic feature didn't exist. Unfortunate... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first I thought you would be able to set up a warning, so that you would have the deadline for the 1st of every month and then warn you the day prior but that didn't work either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell your best option would be to use a subtask for each month of the year. Each of those subtasks would have a 1y repeat.  This isn't actually so bad being you can just collapse it anyways!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;M-x org-clone-subtree-with-time-shift&lt;/code&gt; to generate duplicated tasks and then update each deadline make sure the dates are correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were not going to use TODO's and mark them complete you could use multiple DEADLINES for one task but I think multiple tasks is a better solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to just copy/paste this and change the titles.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* TODO Monthly Task&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-01-31 Tue +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-02-28 Tue +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-03-31 Fri +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-04-30 Sun +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-05-31 Wed +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-06-30 Fri +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-07-31 Mon +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-08-31 Thu +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-09-30 Sat +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-10-31 Tue +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-11-30 Thu +1y&amp;gt;&#xA;&#xA;** TODO Monthly Task&#xA;   DEADLINE: &amp;lt;2017-12-31 Sun +1y&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It isn't the most elegant solution, but it does work.&lt;/p&gt;&#xA;" OwnerUserId="15314" LastActivityDate="2017-03-25T04:02:27.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31689" PostTypeId="2" ParentId="31632" CreationDate="2017-03-25T05:51:02.857" Score="1" Body="&lt;p&gt;I find indirect buffers to be indispensable when using org-mode. Use &lt;code&gt;clone-indirect-buffer&lt;/code&gt; instead of &lt;code&gt;make-indirect-buffer&lt;/code&gt; to remedy your issue. You will then be able to render and hide Latex fragments independently within each buffer.&lt;/p&gt;&#xA;" OwnerUserId="15331" LastActivityDate="2017-03-25T05:51:02.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31690" PostTypeId="2" ParentId="31668" CreationDate="2017-03-25T06:06:45.280" Score="2" Body="&lt;p&gt;As stated by @Arash Esbati, the problem was indeed due to the fact that &lt;code&gt;pdflatex&lt;/code&gt; does not support &lt;code&gt;\special{landscape}&lt;/code&gt;  One solution is to replace the aforementioned code with a call to the &lt;code&gt;geometry&lt;/code&gt; package that works with &lt;code&gt;pdflatex&lt;/code&gt;.  I chose to hardcode a let-bound value for &lt;code&gt;cal-tex-preamble-extra&lt;/code&gt; that takes effect if the LANDSCAPE argument is used.  I commented out &lt;code&gt;(cal-tex-cmd &quot;\\special&quot; &quot;landscape&quot;)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Jan has pointed out in one of the comments above that &lt;code&gt;landscape&lt;/code&gt; can be added to the document class such that it would look like &lt;code&gt;\documentclass[landscape]{article}&lt;/code&gt;.  The function &lt;code&gt;cal-tex-preamble&lt;/code&gt; accepts one argument called &lt;code&gt;args&lt;/code&gt;, but a look at the code reveals that it really only accepts one string that gets inserted into the square brackets.  Since the argument SIZE is already being used, it would be necessary to concatenate that with the proposed &lt;code&gt;landscape&lt;/code&gt; option.  This would be a viable alternative to using the &lt;code&gt;geometry&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun cal-tex-insert-preamble (weeks landscape size &amp;amp;optional append)&#xA;  &quot;Initialize the output LaTeX calendar buffer, `cal-tex-buffer'.&#xA;Select the output buffer, and insert the preamble for a calendar&#xA;of WEEKS weeks.  Insert code for landscape mode if LANDSCAPE is&#xA;non-nil.  Use point-size SIZE.  Optional argument APPEND, if&#xA;non-nil, means add to end of buffer without erasing current contents.&quot;&#xA;  (let ((width &quot;18cm&quot;)&#xA;        (height &quot;24cm&quot;)&#xA;        (cal-tex-preamble-extra&#xA;          (when landscape&#xA;            (concat&#xA;              &quot;\\usepackage&quot;&#xA;              &quot;[left=.25in,top=0.15in,papersize={8.5in,11.0in},&quot;&#xA;              &quot;landscape,twoside=false]{geometry}&quot;))))&#xA;    (setq width &quot;24cm&quot;&#xA;          height &quot;18cm&quot;)&#xA;    (unless append&#xA;      (cal-tex-preamble size)&#xA;      (if (not landscape)&#xA;          (progn&#xA;            (cal-tex-cmd &quot;\\oddsidemargin -1.75cm&quot;)&#xA;            (cal-tex-cmd &quot;\\def\\holidaymult&quot; &quot;.06&quot;))&#xA;        ;; (cal-tex-cmd &quot;\\special&quot; &quot;landscape&quot;)&#xA;        (cal-tex-cmd &quot;\\textwidth 9.5in&quot;)&#xA;        (cal-tex-cmd &quot;\\textheight 7in&quot;)&#xA;        (cal-tex-comment)&#xA;        (cal-tex-cmd &quot;\\def\\holidaymult&quot; &quot;.08&quot;))&#xA;      (cal-tex-cmd cal-tex-caldate)&#xA;      (cal-tex-cmd cal-tex-myday)&#xA;      (cal-tex-b-document)&#xA;      (cal-tex-cmd &quot;\\pagestyle&quot; &quot;empty&quot;))&#xA;    (cal-tex-cmd &quot;\\setlength{\\cellwidth}&quot; width)&#xA;    (insert (format &quot;\\setlength{\\cellwidth}{%f\\cellwidth}\n&quot;&#xA;                    (/ 1.1 (length cal-tex-which-days))))&#xA;    (cal-tex-cmd &quot;\\setlength{\\cellheight}&quot; height)&#xA;    (insert (format &quot;\\setlength{\\cellheight}{%f\\cellheight}\n&quot;&#xA;                    (/ 1.0 weeks)))&#xA;    (cal-tex-cmd &quot;\\ \\par&quot;)&#xA;    (cal-tex-vspace &quot;-3cm&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-03-26T16:29:33.870" LastActivityDate="2017-03-26T16:29:33.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31691" PostTypeId="2" ParentId="31685" CreationDate="2017-03-25T06:24:46.650" Score="-1" Body="&lt;p&gt;I use yasnippet which avoids this problem. after writing function name, type &lt;code&gt;d&lt;/code&gt; and hit &lt;code&gt;TAB&lt;/code&gt;, it will expand to multiline string with correct indentation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo():&#xA;   d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After hitting &lt;code&gt;TAB&lt;/code&gt;, it becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo():&#xA;   &quot;&quot;&quot;|&#xA;   &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also write a custom snippet to make it &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def foo():&#xA;   &quot;&quot;&quot;&#xA;   |&#xA;   &quot;&quot;&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2017-03-25T06:24:46.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31692" PostTypeId="1" CreationDate="2017-03-25T09:10:40.347" Score="0" ViewCount="252" Body="&lt;p&gt;If I have a bunch of headings with sub-headings and content, how can I programmatically indent them correctly? I've tried combining bunch of elisp functions with &lt;a href=&quot;http://orgmode.org/manual/Using-the-mapping-API.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;mapping api&lt;/a&gt;, still can't figure it out.&lt;/p&gt;&#xA;" OwnerUserId="8992" LastEditorUserId="105" LastEditDate="2017-03-25T14:51:52.967" LastActivityDate="2017-03-25T14:51:52.967" Title="Indenting org entries programmatically" Tags="|org-mode|indentation|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31694" PostTypeId="1" CreationDate="2017-03-25T11:01:18.670" Score="3" ViewCount="88" Body="&lt;p&gt;For example, I want to use &lt;code&gt;font-lock-add-keywords&lt;/code&gt; highlight some keywords in source code. But the font lock system would also highlight the same words (anywhere) in the comments/docs/strings part of the source file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there are functions that detects the environment of a given position, e.g. &lt;code&gt;python-info-docstring-p&lt;/code&gt;, my question is that is it possible to use these kind of functions to have conditional font lock highlights?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2017-03-25T11:01:18.670" Title="Is it possible to have conditional font locks?" Tags="|font-lock|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31695" PostTypeId="2" ParentId="31686" CreationDate="2017-03-25T13:02:07.097" Score="4" Body="&lt;p&gt;You can clear the undo history with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq buffer-undo-list nil) ; discard undo history&#xA;(set-buffer-modified-p nil) ; mark the buffer as unmodified&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the following functions in my config for this use case. If the buffer is associated with a file then you can set the &quot;undo point&quot; and go back to it with the undo-all command. For buffers without a backing file then setting the undo point also registers the undo-all command as the local revert function. I mostly use this with temporary buffers where I'm working with some chunk of text copied from somewhere else, and find it convenient to use my &lt;code&gt;revert-buffer&lt;/code&gt; binding to discard changes and get back to the original text. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-buffer-undo-all (&amp;amp;optional ignore-auto noconfirm)&#xA;  &quot;Undo all edits in the current buffer.&#xA;With a prefix argument, do not prompt for confirmation.&#xA;&#xA;This function can be used as a `revert-buffer-function'.  The&#xA;argument IGNORE-AUTO is ignored if specified.  Optional second&#xA;argument NOCONFIRM means don't ask for confirmation.&quot;&#xA;  (interactive)&#xA;  (or ignore-auto)                      ; silence compiler&#xA;  (if (or noconfirm&#xA;          current-prefix-arg&#xA;          (not (buffer-modified-p))&#xA;          (yes-or-no-p (format &quot;Undo all edits? &quot;)))&#xA;      (progn&#xA;        (when (buffer-modified-p)&#xA;          (undo))&#xA;        (while (buffer-modified-p)&#xA;          (undo-more 1)))))&#xA;&#xA;(defun my-buffer-set-undo-point ()&#xA;  &quot;Make the current buffer state the undo point.&#xA;Marks the current buffer unmodified, clears the buffer undo list,&#xA;and (for non-file buffers) registers a custom `revert-buffer-function'.&quot;&#xA;  (interactive)&#xA;  (setq buffer-undo-list nil)&#xA;  (set-buffer-modified-p nil)&#xA;  (unless (buffer-file-name)&#xA;    (setq-local revert-buffer-function #'my-buffer-undo-all)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-28T14:25:10.780" LastActivityDate="2017-03-28T14:25:10.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31696" PostTypeId="1" CreationDate="2017-03-25T16:42:36.990" Score="2" ViewCount="144" Body="&lt;p&gt;In the good old days, repeated emacs keyboard macros ran without repainting the display until the end. Over the years this changed, and now it appears that the display is redrawn 100% of the time -- which is a bit tedious when I try to run a macro a few million times on a large buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to inhibit redraw until all of the repeats are done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Turns out that it can't figure out a reproducer, even though I've seen it a bunch of times. When I do I'll report it as a bug.&lt;/p&gt;&#xA;" OwnerUserId="15335" LastEditorUserId="15335" LastEditDate="2017-03-26T18:27:18.823" LastActivityDate="2017-05-25T19:56:03.520" Title="Inhibit redraw during keyboard macros?" Tags="|keyboard-macros|redisplay|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31697" PostTypeId="1" AcceptedAnswerId="31700" CreationDate="2017-03-25T16:47:21.480" Score="1" ViewCount="69" Body="&lt;p&gt;The following code evaluates successfully using &lt;code&gt;eval-defun&lt;/code&gt; and runs as I would expect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'cl-lib)&#xA;(defun my/sample-function ()&#xA;  (let ((my-ht (make-hash-table)))&#xA;    (puthash :a 1 my-ht)&#xA;    (puthash :b 2 my-ht)&#xA;    (cl-loop for key being the hash-keys of my-ht using (hash-values value)&#xA;             do&#xA;             (prin1 (cons key value)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(my/sample-function)&#xA;=&amp;gt; (:a . 1)(:b . 2)nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, &lt;code&gt;edebug-defun&lt;/code&gt; complains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (error &quot;Bad ‘using’ clause&quot;)                 &#xA;  signal(error (&quot;Bad ‘using’ clause&quot;))                                     &#xA;  error(&quot;Bad `using' clause&quot;)                                              &#xA;  cl--parse-loop-clause()                                                  &#xA;  #[128 &quot;\306\307\310\311\312\311\306\313!\&quot;\&quot;\&quot;&amp;gt;\204\314\312\315\3...&#xA;  macroexpand((cl-loop for key being the hash-keys of my-ht using (edebug-a...&#xA;  macroexp-macroexpand((cl-loop for key being the hash-keys of my-ht using ...&#xA;  macroexp--expand-all((cl-loop for key being the hash-keys of my-ht using ...&#xA;  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I imagine that edebug is choking during instrumentation on the hash-table -specific parts of the complex &lt;code&gt;cl-loop&lt;/code&gt; macro.  This is the first time I've encountered this sort of problem with edebug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not certain that this is not the result of user-error though. In Common Lisp documentation the keywords appear singular with a different verb ordering (&lt;a href=&quot;http://www.unixuser.org/~euske/doc/cl/loop.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;example source&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(loop for k being the hash-key using (hash-value v) of h do ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the structure used within &lt;code&gt;my/sample-function&lt;/code&gt; above is the only form I have found to eval successfully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find anything relevant in debbugs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;emacs -Q version 25.1.1&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-03-25T19:29:51.547" Title="edebug-defun indicates a malformed cl-loop" Tags="|edebug|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31698" PostTypeId="1" CreationDate="2017-03-25T17:41:00.037" Score="2" ViewCount="1752" Body="&lt;p&gt;I installed emacs with homebrew and cask:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;brew cask install emacs&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It installed emacs 25.1.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then linked the plist file to start emacs as a daemon on start up with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;launchctl load ~/Library/LaunchAgents/homebrew.mxcl.emacs.plist&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the following exports:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;export ALTERNATE_EDITOR=&quot;&quot;&#xA;export EDITOR=&quot;emacsclient -t&quot;terminal&#xA;export VISUAL=&quot;emacsclient -c -a emacs&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the following aliases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias em=&quot;emacsclient -t&quot;&#xA;alias emax=&quot;emacsclient -c -a emacs&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first one will open emacs in the terminal window and works fine but the second alias which I thought would open the GUI. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does open the Gui but the terminal window is holding onto the process until I close the Guid down at which point it kills the emacs process and the daemon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It displays the following text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Waiting for Emacs...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I open the GUI in a new process and shut it down without killing the daemon?&lt;/p&gt;&#xA;" OwnerUserId="13577" LastActivityDate="2017-03-25T19:27:16.683" Title="emacsclient not opening correctly in GUI mode" Tags="|emacsclient|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31699" PostTypeId="2" ParentId="31698" CreationDate="2017-03-25T19:27:16.683" Score="2" Body="&lt;p&gt;Add &lt;code&gt;-n&lt;/code&gt; to switches when invoking &lt;code&gt;emacsclient&lt;/code&gt;. That's the thing you're looking for.&lt;/p&gt;&#xA;" OwnerDisplayName="user12563" LastActivityDate="2017-03-25T19:27:16.683" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31700" PostTypeId="2" ParentId="31697" CreationDate="2017-03-25T19:29:51.547" Score="2" Body="&lt;p&gt;This is &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24750&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs Bug#24750&lt;/a&gt;, which is fixed in the &lt;code&gt;master&lt;/code&gt; branch (what will become 26.1).  For earlier versions, you can add &lt;code&gt;[&quot;using&quot; (symbolp symbolp)]&lt;/code&gt; to &lt;code&gt;cl-loop&lt;/code&gt;'s edebug spec.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(put 'cl-loop 'edebug-form-spec&#xA;     '(&amp;amp;rest &amp;amp;or&#xA;             [[&amp;amp;or &quot;for&quot; &quot;as&quot; &quot;with&quot; &quot;and&quot;]&#xA;              sexp]&#xA;             [[&amp;amp;or &quot;from&quot; &quot;upfrom&quot; &quot;downfrom&quot; &quot;to&quot; &quot;upto&quot; &quot;downto&quot; &quot;above&quot; &quot;below&quot; &quot;by&quot; &quot;in&quot; &quot;on&quot; &quot;=&quot; &quot;across&quot; &quot;repeat&quot; &quot;while&quot; &quot;until&quot; &quot;always&quot; &quot;never&quot; &quot;thereis&quot; &quot;collect&quot; &quot;append&quot; &quot;nconc&quot; &quot;sum&quot; &quot;count&quot; &quot;maximize&quot; &quot;minimize&quot; &quot;if&quot; &quot;unless&quot; &quot;return&quot;]&#xA;              form]&#xA;             [&quot;using&quot; (symbolp symbolp)]&#xA;             symbolp form))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-03-25T19:29:51.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31701" PostTypeId="1" AcceptedAnswerId="31713" CreationDate="2017-03-25T19:32:39.890" Score="1" ViewCount="148" Body="&lt;p&gt;I am attempting to write a convenience function that would, on an item in an orgmode list, insert a checkbox if there is none, and do nothing otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how would I be able to test for the existence of a checkbox in a list item?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of testing for a list item via &lt;code&gt;org-in-item-p&lt;/code&gt;, but am unable to find a similar predicate for checkboxes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastEditorUserId="105" LastEditDate="2017-03-25T22:16:19.513" LastActivityDate="2017-03-26T08:37:10.640" Title="How to check if a list item has a checkbox in orgmode" Tags="|org-mode|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31702" PostTypeId="1" CreationDate="2017-03-25T19:47:54.823" Score="8" ViewCount="2704" Body="&lt;p&gt;Since upgrading from v. 24 to v. 25 [OSX 10.11.6] I find myself frequently fighting with minibuffer completion, as typing a tab after doing switch-to-buffer. ^G just beeps, and the completions redisplay. The only way I know to exit the minibuffer in this situation is to pick one of the completions, either with the mouse or by navigating with keys.  I have a pretty simple setup with respect to switch-buffer. I don't think I  use any buffer libraries that would affect his, and have not changed buffer handling for several versions. Any suggestions about what is causing this and how I can get out of minibuffer completion without choosing one of the completions?&lt;/p&gt;&#xA;" OwnerUserId="11515" LastEditorUserId="105" LastEditDate="2017-03-25T22:14:15.293" LastActivityDate="2019-10-26T01:08:03.837" Title="Can't get out of minibuffer completion" Tags="|debugging|completion|minibuffer|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31703" PostTypeId="1" CreationDate="2017-03-25T20:01:41.883" Score="1" ViewCount="158" Body="&lt;p&gt;According to the doc, since ESS 12.09&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ESS: ess-eval-*-and-step functions go to next empty line at eob, instead of staying at the last line.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I hit &lt;code&gt;C-RET&lt;/code&gt; at the end, it still says on the last line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h c C-RET&lt;/code&gt; confirms that &lt;code&gt;C-RET&lt;/code&gt; is being bound to &lt;code&gt;ess-eval-region-or-line-and-step&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My ESS version is 16.10&lt;/p&gt;&#xA;" OwnerUserId="15312" LastActivityDate="2024-01-24T21:02:05.333" Title="ESS C-RET does not add a new line at the end of buffer" Tags="|ess|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31704" PostTypeId="1" CreationDate="2017-03-25T22:23:43.820" Score="11" ViewCount="11179" Body="&lt;p&gt;I am running emacs 25.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have emacs server starting as a daemon on startup and I can open an emacs terminal session with the following alias:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias em=&quot;emacsclient -t&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I start the emacs gui in a similar fashion?&lt;/p&gt;&#xA;" OwnerUserId="13577" LastEditorUserId="17299" LastEditDate="2019-09-15T09:03:23.677" LastActivityDate="2019-09-15T09:03:23.677" Title="Run emacs GUI from emacsclient" Tags="|emacsclient|" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="31705" PostTypeId="2" ParentId="31696" CreationDate="2017-03-26T00:40:46.740" Score="1" Body="&lt;p&gt;As Stefan says, this sounds like a bug. (I certainly can't replicate it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime you could use this as a very manual workaround:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-toggle-redisplay (arg)&#xA;  &quot;Toggle redisplay.&#xA;&#xA;Force redisplay ON with a positive numeric prefix arg.&#xA;Force redisplay OFF with a zero or negative numeric prefix arg.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (setq inhibit-redisplay&#xA;        (if arg&#xA;            (&amp;lt;= (prefix-numeric-value arg) 0)&#xA;          (not inhibit-redisplay))))&#xA;&#xA;(global-set-key (kbd &quot;&amp;lt;f6&amp;gt;&quot;) 'my-toggle-redisplay)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If all the keyboard macro repetitions finish error-free, you could:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;toggle redisplay off&lt;/li&gt;&#xA;&lt;li&gt;start the macros running&lt;/li&gt;&#xA;&lt;li&gt;press the key to toggle redisplay back on&lt;/li&gt;&#xA;&lt;li&gt;...wait for all of that to finish&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If an error is signalled to abort the macro repetitions (as is extremely common), you'd need to &lt;em&gt;guess&lt;/em&gt; when the macros had finished and manually toggle redisplay back on at that point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You could always write some error handling to attempt to manage that, but I'm not sure that would be straightforward.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-26T00:40:46.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31706" PostTypeId="2" ParentId="31704" CreationDate="2017-03-26T00:43:10.007" Score="12" Body="&lt;p&gt;If &quot;start emacs gui in a similar fashion&quot; is hoping to create a gui frame backed by the same daemon, then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alias ec=&quot;emacsclient --create-frame&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will instantiate another emacs frame backed by the same daemon. &lt;code&gt;--create-frame&lt;/code&gt; can also be abbreviated with &lt;code&gt;-c&lt;/code&gt;. &lt;code&gt;-t&lt;/code&gt; or &lt;code&gt;-nw&lt;/code&gt; or &lt;code&gt;--tty&lt;/code&gt; are requesting the default for emacsclient which is to open another frame in a tty instead of a gui frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the gnu &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html#emacsclient-Options&quot; rel=&quot;noreferrer&quot;&gt;emacsclient commandline options&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="104" LastEditorUserId="104" LastEditDate="2017-03-27T07:43:44.780" LastActivityDate="2017-03-27T07:43:44.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31707" PostTypeId="2" ParentId="31702" CreationDate="2017-03-26T00:47:20.887" Score="9" Body="&lt;p&gt;Is it possible there is an active recursive edit in the completion minibuffer? &lt;kbd&gt;C-]&lt;/kbd&gt; by default is &lt;code&gt;abort-recursive-edit&lt;/code&gt;. Alternatively &lt;code&gt;keyboard-escape-quit&lt;/code&gt; or &lt;kbd&gt;ESC ESC ESC&lt;/kbd&gt; might help?&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2017-03-26T00:47:20.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31708" PostTypeId="2" ParentId="31683" CreationDate="2017-03-26T01:19:26.937" Score="12" Body="&lt;p&gt;The custom function &lt;code&gt;diary-list-day-of-month&lt;/code&gt; (set forth below) can be used to create a &lt;em&gt;repeating&lt;/em&gt; &lt;code&gt;org-mode&lt;/code&gt; task &lt;em&gt;or&lt;/em&gt; to create a &lt;code&gt;diary&lt;/code&gt; entry that will appear on the &lt;code&gt;*Calendar*&lt;/code&gt; and/or in the &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer (if &lt;code&gt;org-agenda-include-diary&lt;/code&gt; is &lt;code&gt;t&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;;;; ORG-MODE:  * My Task&#xA;;;;              SCHEDULED: &amp;lt;%%(diary-last-day-of-month date)&amp;gt;&#xA;;;; DIARY:  %%(diary-last-day-of-month date) Last Day of the Month&#xA;;;; See also:  (setq org-agenda-include-diary t)&#xA;;;; (diary-last-day-of-month '(2 28 2017))&#xA;(defun diary-last-day-of-month (date)&#xA;&quot;Return `t` if DATE is the last day of the month.&quot;&#xA;  (let* ((day (calendar-extract-day date))&#xA;         (month (calendar-extract-month date))&#xA;         (year (calendar-extract-year date))&#xA;         (last-day-of-month&#xA;            (calendar-last-day-of-month month year)))&#xA;    (= day last-day-of-month)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a &lt;code&gt;sexp&lt;/code&gt; for the &lt;code&gt;diary&lt;/code&gt; file, which can appear in the &lt;code&gt;*Calendar*&lt;/code&gt; and/or in the &lt;code&gt;*Org Agenda*&lt;/code&gt; buffer -- see &lt;code&gt;org-agenda-include-diary&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%(diary-last-day-of-month date) Last Day of the Month&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is an example &lt;code&gt;org-mode&lt;/code&gt; entry that can appear in the &lt;code&gt;*Org Agenda*&lt;/code&gt; -- e.g., &lt;code&gt;M-x org-agenda RET&lt;/code&gt; followed by the letter &lt;code&gt;a&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* My Task&#xA;  SCHEDULED: &amp;lt;%%(diary-last-day-of-month date)&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-03-27T20:02:31.493" LastActivityDate="2017-03-27T20:02:31.493" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31709" PostTypeId="2" ParentId="31663" CreationDate="2017-03-26T01:24:10.553" Score="1" Body="&lt;p&gt;I believe this accomplished by modifying &lt;code&gt;compilation-mode-font-lock-keywords&lt;/code&gt; and &lt;code&gt;compilation-error-regexp-alist(-alist)?&lt;/code&gt;. If py-test is running in a raw &lt;code&gt;compilation-mode&lt;/code&gt; than the appropriate alists need to be added to the global font-lock-keywords &amp;amp; error-regexp-alists for compilation-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I believe when defining a compilation derived mode with &lt;code&gt;define-compilation-mode&lt;/code&gt;, it automatically references a variable for deriving mode specific error and font-lock information. IE &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-compilation-mode pytest-compilation-mode &quot;Pytest Compilation&quot; &quot;docs.&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Automatically generates a references to variables like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;pytest-compilation-error-regexp-alist&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;pytest-compilation-error-regexp-alist-alist&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;pytest-compilation-mode-font-lock-keywords&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I believe for this example it would be a &lt;code&gt;pytest-compilation-mode-font-lock-keywords&lt;/code&gt; which would cover metadata about the buffer like number of errors, if it finished, the same as &lt;code&gt;compilation-mode-font-lock-keywords&lt;/code&gt; does in the &lt;code&gt;compile&lt;/code&gt; library. Similarly &lt;code&gt;compilation-error-regexp-alist&lt;/code&gt; defines what errors look like (as well as hyperlink formatting, etc). Finally &lt;code&gt;compilation-error-regexp-alist-alist&lt;/code&gt; defines how to map to lines referenced within a given error. I recommend reading through the documentation for &lt;code&gt;compile&lt;/code&gt; using &lt;code&gt;M-x locate-library compile&lt;/code&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2017-03-26T01:24:10.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31710" PostTypeId="1" CreationDate="2017-03-26T01:40:13.147" Score="0" ViewCount="200" Body="&lt;p&gt;I'm using Emacs 26.0.50.1 on macOS Sierra 10.12.3. I built it from source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently installed Guile 2.2.0 by also building it from source. I can successfully interact with it from the command line with no problem. The sample file I am working with taken from the Guile manual and is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define (make-serial-number-generator)&#xA;  (let ((current-serial-number 0))&#xA;    (lambda ()&#xA;      (set! current-serial-number (+ current-serial-number 1))&#xA;      current-serial-number)))&#xA;&#xA;(define entry-sn-generator (make-serial-number-generator))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, I installed Geiser 0.9 from melpa-stable. After trying to go through the Geiser manual, I get stuck pretty quickly. In particular, when I attempt any of the following commands...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x run-geiser &amp;lt;ret&amp;gt; guile &amp;lt;ret&amp;gt;&#xA;M-x run-guile&#xA;M-x geiser-mode&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply: Invalid function: (lambda (&amp;amp;rest) geiser-guile-case-sensitive-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't see how to work around this problem and I don't know enough to be able to dig deeper. Everything is the stock setup, so I'm a little baffled that there is no mention of this elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody provide me with any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="14978" LastActivityDate="2018-02-18T20:57:08.237" Title="Potential bug in geiser installation when using it with guile" Tags="|scheme|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31712" PostTypeId="1" AcceptedAnswerId="31715" CreationDate="2017-03-26T05:23:57.533" Score="1" ViewCount="556" Body="&lt;p&gt;I understand that &lt;code&gt;evil-ex-define-cmd&lt;/code&gt; allow me create my own ex commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although in Vim, you were able to narrow down the search by doing something like &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:h &amp;lt;term&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to accomplish the same in evil, or if this is even possible.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2017-03-26T17:50:11.043" Title="Passing in arguments for evil-ex-command" Tags="|evil|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31713" PostTypeId="2" ParentId="31701" CreationDate="2017-03-26T08:37:10.640" Score="3" Body="&lt;p&gt;If you have a remotely recent version of Orgmode, you should have the function &lt;code&gt;org-at-item-checkbox-p&lt;/code&gt; in &lt;code&gt;org-list.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look in your &lt;code&gt;org-list.el&lt;/code&gt; to see if it's there. If not, update to a more recent version of Orgmode, or implement it yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun org-at-item-checkbox-p ()&#xA;  &quot;Is point at a line starting a plain-list item with a checklet?&quot;&#xA;  (org-list-at-regexp-after-bullet-p &quot;\\(\\[[- X]\\]\\)[ \t]+&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-03-26T08:37:10.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31714" PostTypeId="2" ParentId="31661" CreationDate="2017-03-26T09:22:56.773" Score="4" Body="&lt;p&gt;You can customize &lt;code&gt;mu4e-headers-time-format&lt;/code&gt; and &lt;code&gt;mu4e-headers-date-format&lt;/code&gt;. &#xA;Their default is to use a locale-dependant format (&lt;code&gt;&quot;%X&quot;&lt;/code&gt; and &lt;code&gt;&quot;%x&quot;&lt;/code&gt;), so I guess this should do the trick for you :&#xA;&lt;code&gt;&#xA;(setq mu4e-headers-time-format &quot;%H:%M&quot;)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="1982" LastActivityDate="2017-03-26T09:22:56.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31715" PostTypeId="2" ParentId="31712" CreationDate="2017-03-26T17:50:11.043" Score="1" Body="&lt;p&gt;An ex command is just another function.  Evil defines a few extra interactive codes to retrieve what you've passed to it, &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; is the most generic one and returns the text after the command as is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-command my-help (arg)&#xA;  (interactive &quot;&amp;lt;a&amp;gt;&quot;)&#xA;  (message &quot;ARG: %s&quot; arg))&#xA;&#xA;(evil-ex-define-cmd &quot;h[elp]&quot; 'my-help)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;:h foo&lt;/code&gt; will display &quot;ARG: foo&quot; in the echo area.  Extend this as you need for whatever you're doing with Helm.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-03-26T17:50:11.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31716" PostTypeId="1" AcceptedAnswerId="31717" CreationDate="2017-03-26T17:51:25.527" Score="3" ViewCount="1994" Body="&lt;p&gt;I'm beginning to think that &lt;code&gt;dired&lt;/code&gt; (+ extensions) is the file browser I've always been looking for. Under Windows, however, &lt;code&gt;dired&lt;/code&gt; does not allow to switch to other drives easily. While most things are happening within one drive anyway, sometimes I would like to be able to switch to some USB-drive, for example. But, in order to get there, I have to know the drive letter and put it in manually with &lt;code&gt;find-files&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Is there a better ways to see, and switch between, drives under windows?&lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="12336" LastEditDate="2022-03-23T14:33:55.057" LastActivityDate="2023-09-06T19:57:30.023" Title="How to show MS Windows drives in dired?" Tags="|dired|microsoft-windows|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31717" PostTypeId="2" ParentId="31716" CreationDate="2017-03-26T18:16:20.327" Score="1" Body="&lt;p&gt;If you use &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dired+&lt;/a&gt; then this is taken care of for you.  As explained &lt;a href=&quot;https://www.emacswiki.org/emacs/DiredPlus#IfYouUseEmacsOnWindows&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Dired+ loads library &lt;a href=&quot;https://www.emacswiki.org/emacs/download/w32-browser.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;w32-browser.el&lt;/code&gt;&lt;/a&gt; if Emacs is running on Microsoft Windows, using it to extend Dired in a few ways. (In addition to being bound to the keys indicated here, these operations are added to the &lt;strong&gt;Dired+&lt;/strong&gt; menus, including the &lt;code&gt;mouse-3&lt;/code&gt; context menu.)&lt;/p&gt;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;code&gt;^&lt;/code&gt;&lt;/strong&gt; -- When at the root of a Windows drive (e.g. &lt;strong&gt;&lt;code&gt;C:/&lt;/code&gt;&lt;/strong&gt;) and you use &lt;code&gt;^&lt;/code&gt; (&lt;code&gt;dired-up-directory&lt;/code&gt;), you get &lt;em&gt;a list of drives to choose from&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;IOW, use &lt;strong&gt;&lt;code&gt;^&lt;/code&gt;&lt;/strong&gt; at the root folder of any drive to get to a list of all available drives.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-03-26T18:16:20.327" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31718" PostTypeId="1" AcceptedAnswerId="31720" CreationDate="2017-03-26T18:48:37.277" Score="2" ViewCount="2605" Body="&lt;p&gt;How can I make an alternative keyboard key (e.g. the Windows key) act as the meta key in emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a solution internal to emacs, so using xmodmap is out of the question.&lt;/p&gt;&#xA;" OwnerUserId="15342" LastEditorUserId="9995" LastEditDate="2017-03-26T19:28:52.927" LastActivityDate="2017-08-19T07:20:48.647" Title="How to remap the meta key on Linux?" Tags="|keyboard-layout|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31719" PostTypeId="1" CreationDate="2017-03-26T20:55:53.780" Score="5" ViewCount="508" Body="&lt;p&gt;[&lt;em&gt;This question is related to, but not a duplicate of, the question &lt;a href=&quot;https://emacs.stackexchange.com/questions/2191/copy-contents-of-current-buffer-in-a-temp-buffer-and-operate-on-that&quot;&gt;copy contents of current buffer in a temp buffer and operate on that&lt;/a&gt;. Besides other incidental things (e.g., the question itself is different), none of the solutions offered both (1) execute the elisp in the same context as the original buffer, AND (2) maintain the state of the original buffer. Indeed, the purpose of the macro offered as a possible solution (&lt;code&gt;with-indirect-buffer-in-foo-mode&lt;/code&gt;) in that question seems to be to actually edit the original text in a different mode. The macro also doesn't maintain the &lt;code&gt;buffer-undo-list&lt;/code&gt;, of course (nor any other 'state' that may change when the text of a buffer changes).&lt;/em&gt;]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to be able to write&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(save-complete-buffer-state&#xA;  (edit-the-buffer-arbitrarily)&#xA;  (condition-p))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and have everything (or as much as is practical) be preserved from the original emacs buffer state before the call, including, for example, point, kill ring, undo list, etc. Does such a macro already exist? If not, how difficult would it be to implement? (What needs to be saved?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I've found &lt;code&gt;c-save-buffer-state&lt;/code&gt; at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/2700326&quot; title=&quot;Emacs: How to intelligently handle buffer-modified when setting text properties?&quot;&gt;Emacs: How to intelligently handle buffer-modified when setting text properties?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I don't know enough about what needs to be done to understand how close this is to doing what I'm asking.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Using lawlist's and @phils' suggestions, I was able to come up with this solution. &lt;strong&gt;Please note that this macro works on a few simple test cases but has not been tested extensively.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-cloned-buffer (&amp;amp;rest body)&#xA;  &quot;Executes BODY just like `progn' but maintains original buffer state.&quot;&#xA;  (declare (indent 0))&#xA;  (let ((return-value (make-symbol &quot;return-value&quot;)))&#xA;    `(let (buffer-undo-list)   ;  maintain original buffer-undo-list&#xA;       (clone-indirect-buffer nil t)&#xA;       (let ((,return-value (progn ,@body)))&#xA;         (primitive-undo 1 buffer-undo-list)&#xA;         (kill-buffer-and-window)&#xA;         ,return-value))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are two simple tests (first returns &lt;code&gt;t&lt;/code&gt;, second returns &lt;code&gt;nil&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-cloned-buffer&#xA;  (insert &quot;A&quot;)&#xA;  (left-char 1)&#xA;  (looking-at-p &quot;A&quot;))&#xA;&#xA;(with-cloned-buffer&#xA;  (insert &quot;A&quot;)&#xA;  (left-char 1)&#xA;  (looking-at-p &quot;B&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15341" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-29T02:57:48.780" Title="Something like save-excursion that saves the complete buffer state?" Tags="|buffers|" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="31720" PostTypeId="2" ParentId="31718" CreationDate="2017-03-26T21:29:35.823" Score="3" Body="&lt;p&gt;The following elisp may help you out. Just add it to your config.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq x-meta-keysym 'super)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13911" LastEditorUserId="13911" LastEditDate="2017-08-19T07:20:48.647" LastActivityDate="2017-08-19T07:20:48.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31721" PostTypeId="1" CreationDate="2017-03-26T22:53:58.417" Score="1" ViewCount="291" Body="&lt;p&gt;I've been starting to take a literate programming approach using org-mode for school assignments.  However a lot of assignments require working in a group with other students who typically don't have emacs/org-mode experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only solution I can think of so far is to create an 'id' for each section in my source code and use the search link method &lt;a href=&quot;http://orgmode.org/manual/Search-options.html#Search-options&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; to link my org file to each section.  For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;code.py&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Section1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;code.org&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* [[file:code.py::Section1][Section 1]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The biggest issue I see with this is others won't benefit from the information in my org file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping for advice on either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How best to implement a system using links as described above&lt;/li&gt;&#xA;&lt;li&gt;A different approach others have used to solve the same issue&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13358" LastActivityDate="2017-03-26T22:53:58.417" Title="Literate Programming with non org-mode Collaborators" Tags="|org-mode|literate-programming|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31722" PostTypeId="2" ParentId="2520" CreationDate="2017-03-26T22:56:18.323" Score="2" Body="&lt;p&gt;All of the existing answers address best practices for organizing &lt;em&gt;manually created&lt;/em&gt; files, like &lt;code&gt;init.el&lt;/code&gt; and friends. Equally important is the organization of all the &lt;em&gt;automatically created&lt;/em&gt; files from various packages, and for this the package &lt;a href=&quot;https://github.com/tarsius/no-littering&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;no-littering&lt;/code&gt;&lt;/a&gt; is excellent.&lt;/p&gt;&#xA;" OwnerUserId="12534" LastActivityDate="2017-03-26T22:56:18.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31724" PostTypeId="1" AcceptedAnswerId="31727" CreationDate="2017-03-27T05:21:54.487" Score="0" ViewCount="57" Body="&lt;p&gt;Are there idiomatic boolean comparators in emacs lisp?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(my/bool&amp;lt; nil t)&#xA; =&amp;gt; t&#xA;(my/bool&amp;lt; 1 2)&#xA; =&amp;gt; nil&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example, a comparator that returns t if the first argument is nil and the second is truthy (per common association of '0' with 'false' or nil).  The convention isn't important; only that it is a comparator and not a simple xor function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, use as a sorting predicate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(sort '(nil t t nil t nil nil nil t)&#xA;      (lambda (a b)&#xA;        (and (not a) b)))&#xA; = &amp;gt; (nil nil nil nil nil t t t t)&#xA;&#xA;(sort '(nil 1 5 nil 3 nil nil nil 2)&#xA;      (lambda (a b)&#xA;        (and (not a) b)))&#xA; =&amp;gt; (nil nil nil nil nil 1 5 3 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2017-03-27T14:17:07.887" LastActivityDate="2017-03-27T14:17:07.887" Title="Idiomatic boolean comparators" Tags="|sorting|equality|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31725" PostTypeId="1" CreationDate="2017-03-27T09:15:47.120" Score="0" ViewCount="557" Body="&lt;p&gt;I know that it is possible to change the face used to display markup (bold, italic, etc.) in org-mode, just as explained &lt;a href=&quot;https://emacs.stackexchange.com/questions/5889/how-to-highlight-text-permanently-in-org-mode&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I would like to know if it is possible to have this kind of settings activated for just one particular buffer, instead of having it activated for all org-mode buffers. In other words, I'm looking for a per-buffer setting for special text highlight in org-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a language teacher and I have dictionaries in org-mode format; it would be great to have special highlight for the different parts of a word entry based on the org-mode markups.  On the other hand, naturally I do have also personal notes in org-mode, and for those notes I want the org-mode markups just the way they are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="9099" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-03-27T19:15:38.070" Title="How to highlight text in org-mode with per-buffer settings" Tags="|org-mode|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31726" PostTypeId="1" CreationDate="2017-03-27T09:59:34.367" Score="2" ViewCount="1199" Body="&lt;p&gt;I am using emacs s 23.1.1.&lt;br&gt;&#xA;I have started to really use in real-earnest the shell, in order to minimize the amounts of time I am out of emacs. However, the bind-keys are emacs based. Which is good, but has its' limitations. if I want to use CTRL-r in the shell-context (loop backward over commands input), and not in the emacs context, how do I do that?&lt;br&gt; Having a preceding bind-key is O.K. I.e. press bindy key ALT-CTRL-S, and then CTRL-r.&lt;/p&gt;&#xA;" OwnerUserId="13534" LastActivityDate="2017-04-01T14:45:51.700" Title="Get the same/map bindkeys in shell mode, in particular CTRL-r" Tags="|key-bindings|shell-mode|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31727" PostTypeId="2" ParentId="31724" CreationDate="2017-03-27T11:32:27.403" Score="0" Body="&lt;p&gt;There is no such idiom in Lisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your code is fine though.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2017-03-27T11:32:27.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31728" PostTypeId="2" ParentId="26178" CreationDate="2017-03-27T11:36:52.433" Score="3" Body="&lt;p&gt;I've just solved the same problem, trying to install Emacs 25.1.rc1 on Ubuntu 15.10, by installing: &lt;code&gt;apt install libxml2-dev&lt;/code&gt; before calling &lt;code&gt;./configure&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="101" LastActivityDate="2017-03-27T11:36:52.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31730" PostTypeId="2" ParentId="31725" CreationDate="2017-03-27T19:15:38.070" Score="1" Body="&lt;p&gt;The variable &lt;code&gt;org-emphasis-alist&lt;/code&gt; is global, but can be made buffer-local with &lt;code&gt;(make-variable-buffer-local 'org-emphasis-alist)&lt;/code&gt; inside the &lt;code&gt;.emacs&lt;/code&gt; file.  There are other methods to make variables buffer-local, but the above-mentioned approach seems appropriate in this circumstance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of setting buffer-local variables on a per-file basis, the manual describes a couple of way to set file variables:  &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-03-27T19:15:38.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31731" PostTypeId="1" CreationDate="2017-03-27T19:18:13.527" Score="6" ViewCount="292" Body="&lt;p&gt;I would like to set a server to host a Gobby process &lt;a href=&quot;https://gobby.github.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gobby.github.io/&lt;/a&gt;.&#xA;It would host latex files for example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I was thinking of using rudel &lt;a href=&quot;https://www.emacswiki.org/emacs/Rudel&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emacswiki.org/emacs/Rudel&lt;/a&gt; to connect to the server and compile the tex file locally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Gobby process allows for multiple users to edit a file at the same time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rudel package seem to have been abandoned no new recent update.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been able to connect two rudel sessions for collaborative editing but this session is not secure on the one that use the Gobby process is.&#xA;Yet could not use rudel to connect to the gobby process. The function &lt;code&gt;join-session&lt;/code&gt; seem to get stuck on “Joining (new)”.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have anyone tried and succedded to connect rudel to a Gobby process? Any help is welcome.&lt;/p&gt;&#xA;" OwnerUserId="9340" LastEditorUserId="25" LastEditDate="2018-06-11T22:29:55.397" LastActivityDate="2019-09-26T21:42:10.497" Title="Collaborative editing:Using Rudel to connect to a Gobby process" Tags="|gobby|rudel|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31732" PostTypeId="1" CreationDate="2017-03-27T20:40:13.007" Score="0" ViewCount="56" Body="&lt;p&gt;Given the following function using cl-block:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun wh/with-block (x)&#xA;  (cl-block 'foo&#xA;    (+ x 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can evaluate it, but &lt;code&gt;C-u M-x edebug-eval-defun&lt;/code&gt; gives an error: &lt;code&gt;edebug-syntax-error: Invalid read syntax: symbolp, &quot;failed&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this? Is this an Emacs bug, or am I using edebug incorrectly?&lt;/p&gt;&#xA;" OwnerUserId="304" LastEditorUserId="304" LastEditDate="2017-05-02T12:46:34.173" LastActivityDate="2017-05-02T12:46:34.173" Title="How can I use edebug with cl-block?" Tags="|edebug|cl-lib|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31733" PostTypeId="1" AcceptedAnswerId="31734" CreationDate="2017-03-27T22:12:26.247" Score="5" ViewCount="186" Body="&lt;p&gt;I need to fix a large .bib file where all proper names are in ALL CAPITALS (thanks ProQuest!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an elisp function that searches a buffer/region for words in all capitals and turns all characters except the first one into lowercase letters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DOE, JOHN --&gt; Doe, John&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a couple of functions on Xah Lee's excellent site that work on cases (&lt;a href=&quot;http://ergoemacs.org/emacs/modernization_upcase-word.html&quot; rel=&quot;noreferrer&quot; title=&quot;toggle cases&quot;&gt;Toggle cases&lt;/a&gt;, &lt;a href=&quot;http://title%20cases&quot; rel=&quot;noreferrer&quot;&gt;Title cases&lt;/a&gt;), but I don't know enough elisp to turn either of them into what I need. &lt;/p&gt;&#xA;" OwnerUserId="15351" LastEditorUserId="105" LastEditDate="2017-03-27T22:16:17.040" LastActivityDate="2017-03-28T21:45:38.957" Title="How to turn every ALL CAP word in a buffer into Title case?" Tags="|bibtex|case-folding|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31734" PostTypeId="2" ParentId="31733" CreationDate="2017-03-27T22:25:17.853" Score="6" Body="&lt;p&gt;How about using keyboard macros:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;kbd&gt;&amp;lt;f3&gt;&lt;/kbd&gt; -- start recording&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;C-M-s&lt;/kbd&gt; &lt;code&gt;\b[A-Z]\{2,\}\b&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; -- find the next word of only upper-case letters and at least 2 letters.&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M--&lt;/kbd&gt;&lt;kbd&gt;M-c&lt;/kbd&gt; -- Call &lt;code&gt;capitalize-word&lt;/code&gt; on the word before point&lt;/li&gt;&#xA;&lt;li&gt;&lt;kbd&gt;M-0&lt;/kbd&gt;&lt;kbd&gt;&amp;lt;f4&gt;&lt;/kbd&gt; -- Stop recording and run the macro repeatedly until error&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;n.b. If that's catching non-upper-case words as well, you'd need to set &lt;code&gt;isearch-case-fold-search&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Or more directly (and you could run this via &lt;kbd&gt;M-:&lt;/kbd&gt; as a one-time thing, or make a new interactive function if you want to re-use it):&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((case-fold-search nil))&#xA;  (while (re-search-forward &quot;\\b[A-Z]\\{2,\\}\\b&quot; nil :noerror)&#xA;    (capitalize-word -1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Regarding comments, some corner cases may well need custom attention, but Emacs does have you covered on the matter of diacritics, as we can simply use &lt;code&gt;[[:upper:]]&lt;/code&gt; in place of &lt;code&gt;[A-Z]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following kind of modification might be worth trying to catch the other elements:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(let ((case-fold-search nil)&#xA;      (pattern &quot;\\(?:\\b\\|Ma?c\\|'\\)\\([[:upper:]]\\{2,\\}\\)\\b&quot;))&#xA;  (while (re-search-forward pattern nil :noerror)&#xA;    (save-restriction&#xA;      (narrow-to-region (match-beginning 1) (match-end 1))&#xA;      (capitalize-word -1))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but perhaps it's good enough to simply relax the pattern to:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;&quot;\\([[:upper:]]\\{2,\\}\\)\\b&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-03-28T21:45:38.957" LastActivityDate="2017-03-28T21:45:38.957" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31735" PostTypeId="2" ParentId="31710" CreationDate="2017-03-28T01:35:35.617" Score="0" Body="&lt;p&gt;The solution ended up being to use the latest version from melpa unstable.&lt;/p&gt;&#xA;" OwnerUserId="14978" LastActivityDate="2017-03-28T01:35:35.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31736" PostTypeId="1" CreationDate="2017-03-28T03:30:49.147" Score="1" ViewCount="558" Body="&lt;p&gt;I found a vivid chalk color scheme &lt;a href=&quot;https://github.com/chongli/emacs/blob/master/colors/vivid-chalk.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; that I want to use with Aquamacs.  After poking around, I discovered that Aquamacs stores its custom color schemes here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/Applications/Aquamacs.app/Contents/Resources/lisp/aquamacs/&#xA;color-theme-library.el &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That file contains the color schemes that I see when I do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x custom-schemes&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't really feel like messing around with that file.  The Aquamacs &lt;code&gt;Preferences.el&lt;/code&gt; file is in the directory:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ~/Library/Preferences/Aquamacs Emacs$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I store third party custom themes in that directory somehow?  &lt;/p&gt;&#xA;" OwnerUserId="15353" LastEditorUserId="15353" LastEditDate="2017-03-29T22:31:24.963" LastActivityDate="2020-08-17T18:05:50.617" Title="Where should I put a custom theme in Aquamacs?" Tags="|themes|aquamacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31737" PostTypeId="1" AcceptedAnswerId="31756" CreationDate="2017-03-28T06:35:14.007" Score="0" ViewCount="1052" Body="&lt;p&gt;I come from Java/Netbeans, and I can indent my Java code using &lt;kbd&gt;alt&lt;/kbd&gt;+&lt;kbd&gt;shift&lt;/kbd&gt;+&lt;kbd&gt;f&lt;/kbd&gt;, &#xA;I have searched through this site and other articles, but I didn't find a good way to indent PHP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I found:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;blockquote&gt;&#xA;  &lt;p&gt;using pear PHP_beautifier&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;but I have to output the result to a different file or simply copy on terminal result.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;blockquote&gt;&#xA;  &lt;p&gt;using PHP beautifier on the web&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have tried using M-x indent-region in PHP-mode but nothing changes. I tried in jdee for Java code M-x indent-region also doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found other solutions but for JSON, com.lang, Asytle (C/C++/C#)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is my .emacs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://gist.github.com/azzamsa/1f76b8ca00fd2737ae08a5c3f6dc6b3f&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/azzamsa/1f76b8ca00fd2737ae08a5c3f6dc6b3f&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;php-mode-1.18.2(ejmr/php-mode), GNU Emacs 24.4.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and installed php-mode from elpa repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After following phils suggestion to use &lt;kbd&gt;Tab&lt;/kbd&gt;, it &lt;strong&gt;works&lt;/strong&gt;. But when I try to break the code format, and try to see the result using &lt;kbd&gt;C-x&lt;/kbd&gt;+ &lt;kbd&gt;h&lt;/kbd&gt; and &lt;kbd&gt;Tab&lt;/kbd&gt;, it doesn't indent the code properly as what online formater does. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    public function&#xA;&#xA;        __construct($name) {&#xA;        $this-&amp;gt;name = $name;&#xA;        //$this-&amp;gt;numLeg = $numLeg;&#xA;    }&#xA;&#xA;    public&#xA;&#xA;        function&#xA;&#xA;            bark() {&#xA;            return &quot;Woof!&quot;;&#xA;        }&#xA;    public&#xA;&#xA;        function&#xA;&#xA;            greet() {&#xA;            return &quot;hello i am &quot; . &quot;$this-&amp;gt;name&quot;;&#xA;        }&#xA;&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is no result even when I use &lt;code&gt;indent-region&lt;/code&gt;. I also tried to use fill-region, and other choice of fill, but no luck. But the online formatter can handle this nicely, the result from &lt;a href=&quot;http://beta.phpformatter.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;online formatter&lt;/a&gt; and the expected one is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Dog {&#xA;    public $numLegs = 4;&#xA;    public $name;&#xA;&#xA;    public function __construct($name) {&#xA;        $this-&amp;gt;name = $name;&#xA;        //$this-&amp;gt;numLeg = $numLeg;&#xA;    }&#xA;&#xA;    public function bark() {&#xA;        return &quot;Woof!&quot;;&#xA;    }&#xA;    public function greet() {&#xA;        return &quot;hello i am &quot; . &quot;$this-&amp;gt;name&quot;;&#xA;    }&#xA;&#xA;&#xA;}&#xA;$dog1 = new Dog(&quot;Barker&quot;);&#xA;$dog2 = new DOg(&quot;Amigo&quot;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11777" LastEditorDisplayName="user8748" LastEditDate="2017-05-01T01:20:17.070" LastActivityDate="2017-05-01T01:20:17.070" Title="How to indent PHP code in PHP-mode?" Tags="|java|php-mode|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31738" PostTypeId="1" AcceptedAnswerId="31751" CreationDate="2017-03-28T09:49:32.580" Score="2" ViewCount="937" Body="&lt;p&gt;Suppose I have two code blocks in my org file&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :tangle ~/dummy.py&#xA;class A:&#xA;    pass&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC python :tangle ~/dummy.py&#xA;class B:&#xA;   pass&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;org-babel-tangle&lt;/code&gt; I get a file &lt;code&gt;dummy.py&lt;/code&gt; containing two classes separated by one empty line. However, according to pep8 there should be two empty lines between class definitions so as a result I receive a warning message in my editor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I ensure more than one empty line between (selected) code blocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. I know the &lt;code&gt;:padline&lt;/code&gt; argument. I wish there was an option &lt;code&gt;:padline 2&lt;/code&gt; meaning: precede a block using two empty lines.&lt;/p&gt;&#xA;" OwnerUserId="14127" LastEditorUserId="14127" LastEditDate="2017-03-29T13:37:53.433" LastActivityDate="2017-03-29T13:37:53.433" Title="Org Mode Babel - ensure more than one empty line between tangled code blocks (for python)" Tags="|org-mode|org-babel|tangle|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31740" PostTypeId="1" AcceptedAnswerId="31748" CreationDate="2017-03-28T10:40:20.243" Score="1" ViewCount="64" Body="&lt;p&gt;I want to check if a user input a word or a number. And I write the function look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun check-input (arg)&#xA;  &quot;description&quot;&#xA;  (interactive &quot;senter arg: &quot;)&#xA;  (setq isnum (string-match &quot;\\'[0-9]+\\'&quot; arg))&#xA;  (if isnum&#xA;      (message &quot;INPUT is number &quot;)&#xA;  (message &quot;INPUT is string &quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But every time I enter whether the a number of a word, it just show &quot;Input is string&quot;. Can you help me where did I go wrong. Thanks you very much&lt;/p&gt;&#xA;" OwnerUserId="14164" LastActivityDate="2017-03-28T14:19:05.787" Title="How to know if user input a string or a number using interactive" Tags="|string|interactive|" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31741" PostTypeId="1" CreationDate="2017-03-28T10:42:01.450" Score="3" ViewCount="144" Body="&lt;p&gt;Whilst using a sqli buffer I accidentally ran a mahoosive query. What's the easiest way to abort it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used sql-postgres to start the process.&lt;/p&gt;&#xA;" OwnerUserId="3944" LastActivityDate="2017-03-28T10:42:01.450" Title="How to abort a command executing in sqli-mode?" Tags="|sql-interactive-mode|sql-mode|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31742" PostTypeId="2" ParentId="31740" CreationDate="2017-03-28T11:34:19.557" Score="-1" Body="&lt;p&gt;You don't need the quotes or backslashes in your regexp.  Change it to just &lt;code&gt;(string-match &quot;[0-9]+&quot; arg)&lt;/code&gt; and I believe it ought to do what you want.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-28T11:34:19.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31743" PostTypeId="2" ParentId="31564" CreationDate="2017-03-28T11:47:59.210" Score="3" Body="&lt;p&gt;There are a couple of ways to do this.  The documentation for &lt;code&gt;cua-mode&lt;/code&gt; (which can be accessed with C-h f cua-mode) says you have three options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;press the prefix key twice very quickly (within 0.2 seconds),&lt;/li&gt;&#xA;&lt;li&gt;press the prefix key and the following key within 0.2 seconds, or&lt;/li&gt;&#xA;&lt;li&gt;use the SHIFT key with the prefix key, i.e. C-S-x or C-S-c.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Alternatively, as others have said, just make your own binding for the &lt;code&gt;python-indent-shift-left&lt;/code&gt; and &lt;code&gt;python-indent-shift-right&lt;/code&gt; commands.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-28T11:47:59.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31744" PostTypeId="2" ParentId="31304" CreationDate="2017-03-28T12:08:54.397" Score="2" Body="&lt;p&gt;You can use the &lt;code&gt;framep&lt;/code&gt; function to determine the type of each frame.  It returns a symbol describing the type of the frame: &lt;code&gt;t&lt;/code&gt; for terminal, &lt;code&gt;x&lt;/code&gt; for X window, &lt;code&gt;w32&lt;/code&gt; for MS windows, &lt;code&gt;ns&lt;/code&gt; for Mac/GNUstep, and &lt;code&gt;pc&lt;/code&gt; for a direct-write MS-DOS frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have this you could count the number of (say) X Window frames with something like &lt;code&gt;(length (seq-filter (lambda (f) (eq (framep f) 'x)) (frame-list)))&lt;/code&gt;, or for a function that returns t if there is an X Window frame otherwise nil, use &lt;code&gt;(seq-some (lambda (f) (eq (framep f) 'x)) (frame-list))&lt;/code&gt;.  There are many other variations as well :-)&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-28T12:08:54.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31745" PostTypeId="1" AcceptedAnswerId="31747" CreationDate="2017-03-28T12:55:18.840" Score="4" ViewCount="383" Body="&lt;p&gt;Let's say I have the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: output-directory&#xA;/path/to/output/directory&#xA;&#xA;Results can be found [[file+emacs:/path/to/output/directory][here]].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way for me to have an org link to the output directory &lt;strong&gt;based on whatever the value of the output-directory variable&lt;/strong&gt;? Something in the lines of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: output-directory&#xA;/path/to/output/directory/&#xA;&#xA;Results can be found [[file+emacs:output-directory][here]].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="105" LastEditDate="2017-03-28T14:31:30.893" LastActivityDate="2022-07-18T07:30:53.393" Title="Controling what an org-link points to with variables" Tags="|org-mode|variables|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31746" PostTypeId="2" ParentId="13286" CreationDate="2017-03-28T13:11:40.003" Score="-1" Body="&lt;p&gt;Just saw this while looking for a solution for the same problem (although the annoying keys for me were &lt;code&gt;SPC&lt;/code&gt; and &lt;code&gt;.&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find that binding the offending keys to &lt;code&gt;nil&lt;/code&gt; as proposed by @glucas and @Radon Rosborough is a not a nice UX as then you need to manually abort the company dropdown which is disruptive for speed typing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, if company becomes active and you type a key bound to &lt;code&gt;nil&lt;/code&gt; &lt;em&gt;nothing&lt;/em&gt; will happen. That's not what you would expect when you type a character. You would expect the character to be inserted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather, it is much more convenient to have emacs automatically call &lt;code&gt;company-abort&lt;/code&gt; &lt;em&gt;and then&lt;/em&gt; insert the typed character for you. Here's my solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun company--my-insert-spc() (interactive) (company-abort)(insert-char #10r32))&#xA;(defun company--my-insert-dot() (interactive) (company-abort)(insert-char #10r46))&#xA;(define-key company-active-map (kbd &quot;SPC&quot;) 'company--my-insert-spc)&#xA;(define-key company-active-map (kbd &quot;.&quot;) 'company--my-insert-dot)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think you can easily extend this to &lt;code&gt;RET&lt;/code&gt; by calling &lt;code&gt;(newline)&lt;/code&gt; instead of &lt;code&gt;(insert-char)&lt;/code&gt;, (though I haven't tried that because I do use &lt;code&gt;RET&lt;/code&gt; to select).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually I am using &lt;code&gt;use-package&lt;/code&gt; so this is what I have in my init:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package company&#xA;  :config&#xA;  (global-company-mode)&#xA;  (setq company-minimum-prefix-length 3)&#xA;  (setq company-auto-complete t)&#xA;  (setq company-show-numbers t)&#xA;  :bind&#xA;  ((&quot;C-&amp;lt;tab&amp;gt;&quot; . company-complete)&#xA;   :map company-active-map&#xA;   (&quot;ESC&quot; . company-abort)&#xA;   ;; prevent company from completing on its own when we type regular characters&#xA;   (&quot;SPC&quot; . company--my-insert-spc)&#xA;   (&quot;.&quot;   . company--my-insert-dot)&#xA;   )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15290" LastEditorUserId="15290" LastEditDate="2017-03-29T12:43:25.120" LastActivityDate="2017-03-29T12:43:25.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31747" PostTypeId="2" ParentId="31745" CreationDate="2017-03-28T13:42:40.037" Score="5" Body="&lt;p&gt;If you want to define the output directory in your org-file you can use &lt;a href=&quot;https://orgmode.org/manual/Link-Abbreviations.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;customized link abbrevations&lt;/a&gt; as follows.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;#+LINK: my-output-dir file+emacs:/path/to/output/directory/&#xA;&#xA;Results can be found [[my-output-dir:][here]].&#xA;&#xA;Link to some [[my-output-dir:test.org][special result]].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="16853" LastEditDate="2022-07-18T07:30:53.393" LastActivityDate="2022-07-18T07:30:53.393" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31748" PostTypeId="2" ParentId="31740" CreationDate="2017-03-28T13:46:36.637" Score="1" Body="&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq isnum (string-match &quot;\\'[0-9]+\\'&quot; arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That should be &lt;code&gt;(setq isnum (string-match &quot;\\`[0-9]+\\'&quot; arg))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;\\`&lt;/code&gt; means beginning of string, &lt;code&gt;\\'&lt;/code&gt; means end of string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;(elisp) Regexp Backslash&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-03-28T13:46:36.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31749" PostTypeId="2" ParentId="31740" CreationDate="2017-03-28T14:19:05.787" Score="0" Body="&lt;p&gt;Depending on what you are trying to accomplish here, you can use &lt;code&gt;(string-to-number arg)&lt;/code&gt;. This will return 0 if the argument is a string that cannot be parsed as a number; otherwise, it just returns the value converted to a number.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-28T14:19:05.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31750" PostTypeId="1" CreationDate="2017-03-28T14:56:24.850" Score="-1" ViewCount="51" Body="&lt;p&gt;I am relatively new to elisp, and am currently in need of a macro that will take in a list, and return, not a cons-list, but:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;given (1 2 3 4)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(cons 1 (cons 2 (cons 3 4)))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated :)&lt;/p&gt;&#xA;" OwnerUserId="15144" LastEditorUserId="105" LastEditDate="2017-03-28T15:05:58.210" LastActivityDate="2017-05-27T17:50:18.507" Title="Writing a macro that generates a (cons atom (cons atom ... ))) list" Tags="|elisp-macros|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31751" PostTypeId="2" ParentId="31738" CreationDate="2017-03-28T15:05:26.717" Score="3" Body="&lt;p&gt;In the original &lt;code&gt;org-babel-tangle&lt;/code&gt; function &lt;code&gt;(C-h k org-babel-tangle)&lt;/code&gt;, found in ob-tangle.el, a space is inserted between two lines &lt;strong&gt;unless&lt;/strong&gt; the argument to &lt;code&gt;:padline&lt;/code&gt; is &lt;em&gt;no&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            ;; Handle :padlines unless first line in file&#xA;            (unless (or (string= &quot;no&quot; (cdr (assq :padline (nth 4 spec))))&#xA;                (= (point) (point-min)))&#xA;              (insert &quot;\n&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A quick and dirty solution to your problem is to hack &lt;code&gt;org-babel-tangle&lt;/code&gt; so that it does what you want. &#xA;Changing those lines to the following, for example, should do the trick:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        ;; Handle :padlines unless first line in file&#xA;        (let ((padlines (format &quot;%s&quot; (cdr (assq :padline (nth 4 spec))))))&#xA;        (cond&#xA;         ((and (string= &quot;nil&quot; padlines) (not (= (point) (point-min))))&#xA;          (insert &quot;\n&quot;))&#xA;         ((string= &quot;no&quot; padlines)&#xA;          nil)&#xA;         ((numberp (string-to-int padlines))&#xA;          (dotimes (i (string-to-int padlines)) (insert &quot;\n&quot;)))&#xA;         (t&#xA;          (insert &quot;\n&quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FOR COMPLETION:&lt;/strong&gt;&#xA;Ideally you won't want to change &lt;code&gt;org-babel-tangle&lt;/code&gt; from &lt;code&gt;ob-tangle.el&lt;/code&gt;, but rather shadow it. Just evaluate the following in your scratch buffer, or load it in your init.el:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-babel-tangle (&amp;amp;optional arg target-file lang)&#xA;  &quot;Write code blocks to source-specific files.&#xA;Extract the bodies of all source code blocks from the current&#xA;file into their own source-specific files.&#xA;With one universal prefix argument, only tangle the block at point.&#xA;When two universal prefix arguments, only tangle blocks for the&#xA;tangle file of the block at point.&#xA;Optional argument TARGET-FILE can be used to specify a default&#xA;export file for all source blocks.  Optional argument LANG can be&#xA;used to limit the exported source code blocks by language.&quot;&#xA;  (interactive &quot;P&quot;)&#xA;  (run-hooks 'org-babel-pre-tangle-hook)&#xA;  ;; Possibly Restrict the buffer to the current code block&#xA;  (save-restriction&#xA;    (save-excursion&#xA;      (when (equal arg '(4))&#xA;    (let ((head (org-babel-where-is-src-block-head)))&#xA;      (if head&#xA;          (goto-char head)&#xA;        (user-error &quot;Point is not in a source code block&quot;))))&#xA;      (let ((block-counter 0)&#xA;        (org-babel-default-header-args&#xA;         (if target-file&#xA;         (org-babel-merge-params org-babel-default-header-args&#xA;                     (list (cons :tangle target-file)))&#xA;           org-babel-default-header-args))&#xA;        (tangle-file&#xA;         (when (equal arg '(16))&#xA;           (or (cdr (assq :tangle (nth 2 (org-babel-get-src-block-info 'light))))&#xA;           (user-error &quot;Point is not in a source code block&quot;))))&#xA;        path-collector)&#xA;    (mapc ;; map over all languages&#xA;     (lambda (by-lang)&#xA;       (let* ((lang (car by-lang))&#xA;          (specs (cdr by-lang))&#xA;          (ext (or (cdr (assoc lang org-babel-tangle-lang-exts)) lang))&#xA;          (lang-f (intern&#xA;               (concat&#xA;                (or (and (cdr (assoc lang org-src-lang-modes))&#xA;                     (symbol-name&#xA;                      (cdr (assoc lang org-src-lang-modes))))&#xA;                lang)&#xA;                &quot;-mode&quot;)))&#xA;          she-banged)&#xA;         (mapc&#xA;          (lambda (spec)&#xA;        (let ((get-spec (lambda (name) (cdr (assoc name (nth 4 spec))))))&#xA;          (let* ((tangle (funcall get-spec :tangle))&#xA;             (she-bang (let ((sheb (funcall get-spec :shebang)))&#xA;                                     (when (&amp;gt; (length sheb) 0) sheb)))&#xA;             (tangle-mode (funcall get-spec :tangle-mode))&#xA;             (base-name (cond&#xA;                     ((string= &quot;yes&quot; tangle)&#xA;                      (file-name-sans-extension&#xA;                       (nth 1 spec)))&#xA;                     ((string= &quot;no&quot; tangle) nil)&#xA;                     ((&amp;gt; (length tangle) 0) tangle)))&#xA;             (file-name (when base-name&#xA;                      ;; decide if we want to add ext to base-name&#xA;                      (if (and ext (string= &quot;yes&quot; tangle))&#xA;                      (concat base-name &quot;.&quot; ext) base-name))))&#xA;            (when file-name&#xA;              ;; Possibly create the parent directories for file.&#xA;              (let ((m (funcall get-spec :mkdirp))&#xA;                (fnd (file-name-directory file-name)))&#xA;            (and m fnd (not (string= m &quot;no&quot;))&#xA;                 (make-directory fnd 'parents)))&#xA;              ;; delete any old versions of file&#xA;              (and (file-exists-p file-name)&#xA;               (not (member file-name (mapcar #'car path-collector)))&#xA;               (delete-file file-name))&#xA;              ;; drop source-block to file&#xA;              (with-temp-buffer&#xA;            (when (fboundp lang-f) (ignore-errors (funcall lang-f)))&#xA;            (when (and she-bang (not (member file-name she-banged)))&#xA;              (insert (concat she-bang &quot;\n&quot;))&#xA;              (setq she-banged (cons file-name she-banged)))&#xA;            (org-babel-spec-to-string spec)&#xA;            ;; We avoid append-to-file as it does not work with tramp.&#xA;            (let ((content (buffer-string)))&#xA;              (with-temp-buffer&#xA;                (when (file-exists-p file-name)&#xA;                  (insert-file-contents file-name))&#xA;                (goto-char (point-max))&#xA;        ;; Handle :padlines unless first line in file&#xA;        (let ((padlines (format &quot;%s&quot; (cdr (assq :padline (nth 4 spec))))))&#xA;        (cond&#xA;         ((and (string= &quot;nil&quot; padlines) (not (= (point) (point-min))))&#xA;          (insert &quot;\n&quot;))&#xA;         ((string= &quot;no&quot; padlines)&#xA;          nil)&#xA;         ((numberp (string-to-int padlines))&#xA;          (dotimes (i (string-to-int padlines)) (insert &quot;\n&quot;)))&#xA;         (t&#xA;          (insert &quot;\n&quot;))))&#xA;                (insert content)&#xA;                (write-region nil nil file-name))))&#xA;              ;; if files contain she-bangs, then make the executable&#xA;              (when she-bang&#xA;            (unless tangle-mode (setq tangle-mode #o755)))&#xA;              ;; update counter&#xA;              (setq block-counter (+ 1 block-counter))&#xA;              (unless (assoc file-name path-collector)&#xA;            (push (cons file-name tangle-mode) path-collector))))))&#xA;          specs)))&#xA;     (if (equal arg '(4))&#xA;         (org-babel-tangle-single-block 1 t)&#xA;       (org-babel-tangle-collect-blocks lang tangle-file)))&#xA;    (message &quot;Tangled %d code block%s from %s&quot; block-counter&#xA;         (if (= block-counter 1) &quot;&quot; &quot;s&quot;)&#xA;         (file-name-nondirectory&#xA;          (buffer-file-name&#xA;           (or (buffer-base-buffer) (current-buffer)))))&#xA;    ;; run `org-babel-post-tangle-hook' in all tangled files&#xA;    (when org-babel-post-tangle-hook&#xA;      (mapc&#xA;       (lambda (file)&#xA;         (org-babel-with-temp-filebuffer file&#xA;           (run-hooks 'org-babel-post-tangle-hook)))&#xA;       (mapcar #'car path-collector)))&#xA;    ;; set permissions on tangled files&#xA;    (mapc (lambda (pair)&#xA;        (when (cdr pair) (set-file-modes (car pair) (cdr pair))))&#xA;          path-collector)&#xA;    (mapcar #'car path-collector)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2017-03-28T19:05:10.223" LastActivityDate="2017-03-28T19:05:10.223" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31752" PostTypeId="2" ParentId="31750" CreationDate="2017-03-28T15:11:57.250" Score="1" Body="&lt;p&gt;You don't need a macro for this.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun foo (lst)&#xA;  (let ((last  (car (last lst)))&#xA;        (butl  (butlast lst)))&#xA;    (append butl last)))&#xA;&#xA;(foo '(1 2 3 4)) ; ==&amp;gt; (1 2 3 . 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-03-28T15:11:57.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31753" PostTypeId="2" ParentId="31733" CreationDate="2017-03-28T16:41:46.143" Score="1" Body="&lt;p&gt;If you want to take @phils answer and wrap it in a command that handles the region, here's one approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun caps-to-title-case (start end)&#xA;  &quot;Convert words in CAPS to Title Case in the current region or buffer.&quot;&#xA;  (interactive (if (use-region-p)&#xA;                   (list (region-beginning) (region-end))&#xA;                 (list (point-min) (point-max))))&#xA;  (save-excursion&#xA;    (goto-char start)&#xA;    (let ((case-fold-search nil))&#xA;      (while (re-search-forward &quot;\\b[A-Z]\\{2,\\}\\b&quot; end :noerror)&#xA;        (capitalize-word -1)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When called interactively this will restrict the changes to the current region if there is one, and otherwise will modify the entire buffer. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-28T16:41:46.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31754" PostTypeId="2" ParentId="31234" CreationDate="2017-03-28T17:11:26.647" Score="1" Body="&lt;p&gt;I had this same problem and for me the problem was caused by &lt;code&gt;python-mode&lt;/code&gt;. Removing &lt;code&gt;python-mode&lt;/code&gt; and falling back on the emacs-25 default (&lt;code&gt;python.el&lt;/code&gt;) solved the problem.&lt;/p&gt;&#xA;" OwnerUserId="15357" LastEditorUserId="15357" LastEditDate="2017-03-29T14:29:29.117" LastActivityDate="2017-03-29T14:29:29.117" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31755" PostTypeId="2" ParentId="31719" CreationDate="2017-03-28T17:14:18.373" Score="3" Body="&lt;p&gt;Your suggested solution confuses things more than anything: &lt;code&gt;clone-indirect-buffer&lt;/code&gt; creates another buffer which &lt;em&gt;shares&lt;/em&gt; the same text, so any changes to the text in the clone will also affect the original buffer, so you haven't gained anything, really.  Maybe you'd be better served with &lt;code&gt;clone-buffer&lt;/code&gt; (not indirect).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a temp buffer might be a good idea, but then you'd presumably want that other buffer to have its own copy of the contents, so you'd do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((orig-buf (current-buffer)))&#xA;  (with-temp-buffer&#xA;    (insert-buffer-substring orig-buffer)&#xA;    &amp;lt;do-your-thing&amp;gt;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, this can suffer from other problems, such as the fact that the temp buffer is not configured in the same major/minor modes as the original one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to stay in the same buffer and instead undo the changes at the end, using &lt;code&gt;atomic-change-group&lt;/code&gt;, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(catch 'done&#xA; (atomic-change-group&#xA;  &amp;lt;do-your-thing&amp;gt;&#xA;  (throw 'done &amp;lt;result&amp;gt;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="1979" LastEditDate="2017-03-29T00:05:42.557" LastActivityDate="2017-03-29T00:05:42.557" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31756" PostTypeId="2" ParentId="31737" CreationDate="2017-03-28T17:32:27.200" Score="1" Body="&lt;p&gt;This problem is &lt;strong&gt;solved&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to Phil Newton (sodaware) for creating &lt;a href=&quot;https://github.com/Sodaware/php-beautifier.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; extension to integrate with PHP_beautifier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This application was released 5 hours ago (on March 28, 2017). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried some of my PHP Code, and it works well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is some gif from when I gave it a try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bFU0e.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bFU0e.gif&quot; alt=&quot;php_beautifier_el_1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11777" LastEditorDisplayName="user8748" LastEditDate="2017-05-01T01:19:56.077" LastActivityDate="2017-05-01T01:19:56.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31757" PostTypeId="1" AcceptedAnswerId="31759" CreationDate="2017-03-28T17:58:39.500" Score="0" ViewCount="165" Body="&lt;p&gt;Ibuffer is great, I  use it with filter groups which work great. I call Ibuffer using by a keypress, the problem is that the cursor is always on the first buffer in the first category. What I need is that it is on the buffername which it was called from. I mean if I'm in notes.org and call ibuffer the cursor should be on notes.org.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any variables that can help me out there? I couldn't find any. I assume elisp is needed to solve it but I have no ability to code.&lt;/p&gt;&#xA;" OwnerUserId="11055" LastEditorUserId="253" LastEditDate="2017-03-28T20:15:20.947" LastActivityDate="2017-03-28T21:11:20.453" Title="ibuffer - Cursor on buffer which it was called from" Tags="|ibuffer|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31758" PostTypeId="2" ParentId="31304" CreationDate="2017-03-28T19:29:22.287" Score="1" Body="&lt;p&gt;Use the &lt;code&gt;display-graphic-p&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;display-graphic-p is a compiled Lisp function in `frame.el'.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(display-graphic-p &amp;amp;optional DISPLAY)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Return non-nil if DISPLAY is a graphic display.&#xA;  Graphical displays are those which are capable of displaying several&#xA;  frames and several different fonts at once.  This is true for displays&#xA;  that use a window system such as X, and false for text-only terminals.&#xA;  DISPLAY can be a display name, a frame, or nil (meaning the selected&#xA;  frame's display).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="897" LastActivityDate="2017-03-28T19:29:22.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31759" PostTypeId="2" ParentId="31757" CreationDate="2017-03-28T21:11:20.453" Score="2" Body="&lt;p&gt;By default ibuffer will sort by recency and start at the first line, which would be the buffer you just came from. Customizing ibuffer -- for example, changing the default sort order -- may result in different behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can define an ibuffer hook to always jump to the most recent buffer with something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ibuffer-jump-to-last-buffer ()&#xA;  (ibuffer-jump-to-buffer (buffer-name (cadr (buffer-list)))))&#xA;&#xA;(add-hook 'ibuffer-hook #'ibuffer-jump-to-last-buffer)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might also be interested in customizing &lt;code&gt;ibuffer-always-show-last-buffer&lt;/code&gt;, which ensures that the most recent buffer is displayed in the ibuffer list even if some other filter would have excluded it.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-28T21:11:20.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31760" PostTypeId="1" AcceptedAnswerId="31775" CreationDate="2017-03-28T21:59:04.387" Score="0" ViewCount="409" Body="&lt;p&gt;I am using company to auto-complete. It works generally fine, with the exception of the &lt;code&gt;M-(digit)&lt;/code&gt; shortcuts, which have no impact at all. I have no idea why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my init code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun company--my-insert-spc() (interactive)(company-abort)(insert-char #10r32))&#xA;(defun company--my-insert-dot() (interactive)(company-abort)(insert-char #10r46))&#xA;(use-package company&#xA;  :config&#xA;  (global-company-mode)&#xA;  (setq company-minimum-prefix-length 3)&#xA;  (setq company-auto-complete t)&#xA;  (setq company-show-numbers t)&#xA;  :bind&#xA;  ((&quot;C-&amp;lt;tab&amp;gt;&quot; . company-complete)&#xA;   :map company-active-map&#xA;   (&quot;ESC&quot; . company-abort)&#xA;   ;; prevent company from completing on its own when we type regular characters&#xA;   (&quot;SPC&quot; . company--my-insert-spc)&#xA;   (&quot;.&quot;   . company--my-insert-dot)&#xA;   )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the result of &lt;code&gt;M-x describe-keymap company-active-map&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;company-active-map&#xA;------------------&#xA;&#xA;For more information check the manuals.&#xA;&#xA;Keymap that is enabled during an active completion.&#xA;&#xA;key             binding&#xA;---             -------&#xA;&#xA;C-d             company-show-doc-buffer&#xA;C-g             company-abort&#xA;C-h             company-show-doc-buffer&#xA;TAB             company-complete-common&#xA;RET             company-complete-selection&#xA;C-s             company-search-candidates&#xA;C-w             company-show-location&#xA;ESC             company-abort&#xA;SPC             company--my-insert-spc&#xA;.               company--my-insert-dot&#xA;&amp;lt;down&amp;gt;          company-select-next-or-abort&#xA;&amp;lt;down-mouse-1&amp;gt;  ignore&#xA;&amp;lt;down-mouse-3&amp;gt;  ignore&#xA;&amp;lt;f1&amp;gt;            company-show-doc-buffer&#xA;&amp;lt;mouse-1&amp;gt;       company-complete-mouse&#xA;&amp;lt;mouse-3&amp;gt;       company-select-mouse&#xA;&amp;lt;remap&amp;gt;         Prefix Command&#xA;&amp;lt;return&amp;gt;        company-complete-selection&#xA;&amp;lt;tab&amp;gt;           company-complete-common&#xA;&amp;lt;up&amp;gt;            company-select-previous-or-abort&#xA;&amp;lt;up-mouse-1&amp;gt;    ignore&#xA;&amp;lt;up-mouse-3&amp;gt;    ignore&#xA;&#xA;&amp;lt;remap&amp;gt; &amp;lt;scroll-down-command&amp;gt;   company-previous-page&#xA;&amp;lt;remap&amp;gt; &amp;lt;scroll-up-command&amp;gt;     company-next-page&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Indeed, the M-(digit) shortcuts are not there. Neither M-n or M-p. I am relatively new to emacs, and I don't know how to pinpoint the cause of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did try to workaround this problem by explicitly setting again the shortcuts in the use-package &lt;code&gt;:config&lt;/code&gt; section:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(dotimes (i 10)&#xA;  (define-key company-active-map (read-kbd-macro (format &quot;M-%d&quot; i)) 'company-complete-number))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... but I get a really baffling warning: &lt;code&gt;while: Key sequence M-0 starts with non-prefix key ESC&lt;/code&gt;. Why does ESC appear here? I also get this same warning for the M-n and M-p shortcuts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (define-key company-active-map (kbd &quot;M-n&quot;) 'company-select-next)&#xA;  (define-key company-active-map (kbd &quot;M-p&quot;) 'company-select-previous)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This warning does appear to give a clue, but I can't figure out to what exactly.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Based on the warning above, I commented out the ESC keybinding to company-abort, and it made M-(digit) work as expected. So now the question is: why does this incompatibility between ESC and M-(digit) happen and how can I use both shortcuts?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Update 2&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The helpful comments by @TianxiangXiong and @phils identified the problem: ESC is the prefix char for M, so emacs will be confounded by the keybindings I've given it. This is a pity since I really wanted those shortcuts. However, based on &lt;a href=&quot;https://emacs.stackexchange.com/questions/14755/how-to-remove-bindings-to-the-esc-prefix-key#comment22847_14757&quot;&gt;this comment&lt;/a&gt;, I was able workaround this and get what I wanted by simply changing &lt;code&gt;(&quot;ESC&quot; . company-abort)&lt;/code&gt; to &lt;code&gt;(&quot;&amp;lt;escape&amp;gt;&quot; . company-abort)&lt;/code&gt; in the &lt;code&gt;:config&lt;/code&gt;. At least in my system (Ubuntu 16.04) this worked.&lt;/p&gt;&#xA;" OwnerUserId="15290" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-03-29T18:18:49.813" Title="company M-(digit) shortcuts not working" Tags="|key-bindings|company-mode|escape|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31761" PostTypeId="1" CreationDate="2017-03-29T00:17:06.750" Score="2" ViewCount="1351" Body="&lt;p&gt;When building, a split view is opened for the output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's possible to close this window, open a new window and set the buffer to the build output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when building again, the other window isn't used.&#xA;Instead a new split is created in the same window the source code is in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way to use any existing compiler output windows instead of creating new splits?&lt;/p&gt;&#xA;" OwnerUserId="2418" LastActivityDate="2017-12-22T06:26:09.463" Title="How to use a separate window for compilation output?" Tags="|compilation-mode|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31762" PostTypeId="1" CreationDate="2017-03-29T02:33:03.407" Score="1" ViewCount="137" Body="&lt;p&gt;Is a way to process the org-agenda asynchronously in the background as it takes a long time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the latest emacs (master branch as of 1week ago and org version 9.0.5).&lt;/p&gt;&#xA;" OwnerUserId="9463" LastActivityDate="2017-03-29T02:33:03.407" Title="org-mode agenda in the background asynchronously" Tags="|org-mode|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31763" PostTypeId="2" ParentId="31719" CreationDate="2017-03-29T02:57:48.780" Score="3" Body="&lt;p&gt;I appreciate all the suggestions offered by everyone. Using them I have created three different macros with very similar (but not completely identical) functionality that do what I want. Note that the macro named &lt;code&gt;with-cloned-buffer&lt;/code&gt; below is not the same as the macro with that name in my question. Also be aware that while these macros have all been tested on toy examples, they have not been tested extensively yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Except for the name, this is the same macro as in the question and uses &lt;code&gt;clone-indirect-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-cloned-indirect-buffer (&amp;amp;rest body)&#xA;  &quot;Executes BODY just like `progn' but maintains original buffer state.&quot;&#xA;  (declare (indent 0))&#xA;  (let ((return-value (make-symbol &quot;return-value&quot;)))&#xA;    `(let (buffer-undo-list)   ;  maintain original buffer-undo-list&#xA;       (clone-indirect-buffer nil t)&#xA;       (let ((,return-value (progn ,@body)))&#xA;         (primitive-undo 1 buffer-undo-list)&#xA;         (kill-buffer-and-window)&#xA;         ,return-value))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;clone-buffer&lt;/code&gt; instead of &lt;code&gt;clone-indirect-buffer&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro with-cloned-buffer (&amp;amp;rest body)&#xA;  &quot;Executes BODY just like `progn' but maintains original buffer state.&quot;&#xA;  (declare (indent 0))&#xA;  (let ((return-value (make-symbol &quot;return-value&quot;)))&#xA;    `(let ((buffer-file-name nil))&#xA;       (clone-buffer nil t)&#xA;       (let ((,return-value (progn ,@body)))&#xA;         (kill-buffer-and-window)&#xA;         ,return-value))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;atomic-change-group&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defmacro save-buffer-state (&amp;amp;rest body)&#xA;  &quot;Executes BODY just like `progn' but maintains original buffer state.&quot;&#xA;  (declare (indent 0))&#xA;  (let ((return-value (make-symbol &quot;return-value&quot;)))&#xA;    `(catch 'done&#xA;       (atomic-change-group&#xA;         (let ((,return-value (progn ,@body)))&#xA;           (throw 'done ,return-value))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A couple notes. In spirit, the last version is my favorite, &lt;em&gt;except&lt;/em&gt; that it doesn't maintain buffer-local variables. I'd actually prefer something that maintained &lt;em&gt;all&lt;/em&gt; variables, but that's probably too much to ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, the &lt;code&gt;atomic-change-group&lt;/code&gt; version can easily be tweaked to make a macro that runs editing code conditionally. One possibility is that the edits are kept if the last form returns a truthy value. (This is, of course, similar to &lt;code&gt;atomic-change-group&lt;/code&gt; itself.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, although it's very clean, using &lt;code&gt;clone-buffer&lt;/code&gt; seems inefficient for the use-case I have in mind: testing small edits on possibly big buffers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, at least the first two macros would be better if they incorporated &lt;code&gt;unwind-protect&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically speaking, assuming I haven't made any big programming errors, all three solve the problem I was hoping to solve. Thanks, everyone!&lt;/p&gt;&#xA;" OwnerUserId="15341" LastActivityDate="2017-03-29T02:57:48.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31764" PostTypeId="1" AcceptedAnswerId="31765" CreationDate="2017-03-29T04:25:40.820" Score="6" ViewCount="2026" Body="&lt;p&gt;I'm wondering if there's a terse (i.e. single function) approach for reading a file's content given its path and returning it as a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My go-to has been:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-temp-buffer&#xA;  (insert-file-contents some-path)&#xA;  (buffer-string))&#xA;  =&amp;gt; &quot;it's a short file&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but a helper function defined per project or this two-functions-and-a-macro copy-pasta seem unnecessary.  Is there a utility function or common pattern I'm missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Judging from the existence of &lt;code&gt;gntp-file-string&lt;/code&gt;, &lt;code&gt;ffap-file-exists-string&lt;/code&gt;, &lt;code&gt;org-file-contents&lt;/code&gt;, and a few others I'm guessing there is not.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="105" LastEditDate="2017-03-29T13:26:41.167" LastActivityDate="2017-03-29T13:26:41.167" Title="Single function to return file contents as a string" Tags="|files|string|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31765" PostTypeId="2" ParentId="31764" CreationDate="2017-03-29T05:00:19.197" Score="7" Body="&lt;p&gt;There is not. You can &lt;code&gt;report-emacs-bug&lt;/code&gt; and suggest that one be included.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One reason I can think of for &lt;em&gt;not&lt;/em&gt; including such a function is that there are different reasonable ways to handle errors. E.g. if the file is not readable, what should the function do? Return &lt;code&gt;nil&lt;/code&gt;? Return empty string (&lt;code&gt;&quot;&quot;&lt;/code&gt;)? Signal an error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: &lt;code&gt;f-read-text&lt;/code&gt; in &lt;code&gt;f.el&lt;/code&gt; does what you want.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2017-03-29T05:26:01.547" LastActivityDate="2017-03-29T05:26:01.547" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31767" PostTypeId="2" ParentId="27926" CreationDate="2017-03-29T09:57:05.540" Score="0" Body="&lt;p&gt;While the practical aspects of your problem find nice solutions in the given answers. But there is an ideological point i want to address : not wanting to overwrite the default global key bindings Emacs comes with, is not a great idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll be unable to use some of the power of Emacs : both the configuration aspects and self documentation aspects if you consider the out of the box bindings to be sacred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make Emacs your own. If there is aa convenient binding you do not use, overwrite with another function that you do want to use. Note it down so that you remember, and remove the binding after a while if you find you don't use it as much as you planned.&lt;/p&gt;&#xA;" OwnerUserId="11609" LastActivityDate="2017-03-29T09:57:05.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31769" PostTypeId="2" ParentId="22049" CreationDate="2017-03-29T10:20:45.937" Score="2" Body="&lt;p&gt;I know this is not exactly the same as the OP, but I think it's an interesting option.&#xA;You can start emacs from the git-bash command-line.&#xA;It will make emacs assume git-bash as the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter something like the following from your bash prompt&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bla@host MINGW64 ~/ $ emacs .&amp;amp;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, in emacs, M-x &quot;shell&quot;&lt;/p&gt;&#xA;" OwnerUserId="15362" LastActivityDate="2017-03-29T10:20:45.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31770" PostTypeId="1" AcceptedAnswerId="32343" CreationDate="2017-03-29T12:48:59.680" Score="1" ViewCount="1752" Body="&lt;p&gt;I tried to compile, this error message appears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ERROR: AUCTeX cannot find a working TeX distribution.&#xA;Make sure you have one and that TeX binaries are in PATH environment variable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have installed texlive 2016 manually and installed emacs by package.&#xA;and added texlive to .bashrc. so directory of texlive shown in emacs shell by typing echo $PATH.&#xA;My OS is ubuntu 16.04&lt;/p&gt;&#xA;" OwnerUserId="15364" LastActivityDate="2017-04-24T12:41:28.400" Title="AUCTeX cannot find a working TeX distribution" Tags="|latex|auctex|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31771" PostTypeId="1" AcceptedAnswerId="31782" CreationDate="2017-03-29T12:58:22.170" Score="1" ViewCount="86" Body="&lt;p&gt;I use Emacs with Cucumber (cucumber.io). Cucumber outputs lines like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Scenario: Jeff returns a faulty microwave              # /somepath/file1.feature:12&#xA;    Given Jeff has bought a microwave for $100         # /somepath/steps/file2.rb:5&#xA;    And he has a receipt&#xA;    When he returns the microwave&#xA;    Then Jeff should be refunded $100&#xA;          Exception blah&#xA;          /path/someotherdir/sourcefile.rb:123:error xxx occured&#xA;&#xA;Scenario: Some other scenario...                       # /somepath/file1.feature:23&#xA;    Given ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works splendidly with the compilation buffers. I have made some entries in &lt;code&gt;compilation-error-regexp-alist&lt;/code&gt; that locate those comments as &quot;info&quot; (in addition to whatever compiler/runtime errors from the Ruby environment) and am able to jump through everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would find it very handy if I could not only step between the &quot;next&quot; (&lt;code&gt;M-n&lt;/code&gt;) and &quot;previous&quot; (&lt;code&gt;M-p&lt;/code&gt;) steps in a completely linear fashion, but if I could separately do a &quot;next scenario&quot; (&lt;code&gt;C-M-n&lt;/code&gt;) and &quot;previous scenario&quot; (&lt;code&gt;C-M-p&lt;/code&gt;) binding. Those would ignore everything and just jump between the lines starting with &lt;code&gt;Scenario:&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is such a thing possible? &lt;/p&gt;&#xA;" OwnerUserId="11371" LastEditorUserId="105" LastEditDate="2017-03-29T13:25:05.493" LastActivityDate="2017-03-30T10:46:28.253" Title="Another level of &quot;next/previous&quot; in the compilation buffer?" Tags="|compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31772" PostTypeId="1" CreationDate="2017-03-29T15:33:23.877" Score="4" ViewCount="1613" Body="&lt;p&gt;I'm creating a simple bash tool that uses various flags/arguments from the user, and I'm using an &lt;code&gt;org&lt;/code&gt; file for the documentation. I have several examples and I'd like to include some explanation of each. Instead of copying the code from each example into the file, I'd like to create a link to the file and display the contents in the org file. Something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This example does such and such...&#xA;[[/path/to/ex-file-1.sh]]&#xA;&#xA;my-tool -f &quot;user-input&quot; # these are the contents of ex-file-1.sh&#xA;&#xA;While this example does this and that...&#xA;[[/path/to/ex-file-2/sh]] &#xA;&#xA;my-tool -r &quot;user-input # these are the contents of ex-file-2.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way, I don't have to modify the &lt;code&gt;README.org&lt;/code&gt; if I modify the individual example files. I'd also like to do the same thing with the contents of the tool's help (which is activated with the &lt;code&gt;-h&lt;/code&gt; flag). Basically I want modifying the documentation to be less tedious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that images can be embedded into &lt;code&gt;org&lt;/code&gt; files (and are even visible within the file before exporting), so I would assume the same is possible with text? What do I need to use for this? Or I am I just being too lazy with my documentation?&lt;/p&gt;&#xA;" OwnerUserId="12571" LastActivityDate="2017-03-29T15:33:23.877" Title="How to embed external file contents in org file?" Tags="|org-mode|org-export|org-link|" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31773" PostTypeId="2" ParentId="31732" CreationDate="2017-03-29T15:53:08.620" Score="1" Body="&lt;p&gt;Edebug is arguably right: The tag is not evaluated and needs to be a symbol, not &lt;code&gt;(quote foo)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-03-29T15:53:08.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31775" PostTypeId="2" ParentId="31760" CreationDate="2017-03-29T18:18:49.813" Score="2" Body="&lt;p&gt;&lt;code&gt;M&lt;/code&gt; is given the &lt;code&gt;ESC&lt;/code&gt; keycode by default. See &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Functions-for-Key-Lookup.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;meta-prefix-char&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, &lt;a href=&quot;https://emacs.stackexchange.com/questions/31007/binding-m-esc-m-esc#comment47687_31035&quot;&gt;don't bind &lt;code&gt;ESC&lt;/code&gt;&lt;/a&gt;--surprising things will happen.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2017-03-29T18:18:49.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31776" PostTypeId="1" CreationDate="2017-03-29T18:27:33.953" Score="1" ViewCount="351" Body="&lt;p&gt;I'm using this in my &lt;code&gt;.emacs&lt;/code&gt; file to make double-clicking the left mouse button run a command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key [(double-mouse-1)] 'some-command)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This only works in GUI mode; it doesn't work when running Emacs in the terminal. Is there some way for me to fix this? Or to detect double click events using some other mechanism? I have tried in a few different terminals without success. Tried Emacs 24.5.1 and 23.1.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;xterm-mouse-mode&lt;/code&gt; is enabled and other mouse functionality (like single-clicking or drag and drop to highlight text) works fine.&lt;/p&gt;&#xA;" OwnerUserId="14269" LastEditorUserId="14269" LastEditDate="2017-03-29T19:10:23.483" LastActivityDate="2017-03-30T13:13:46.550" Title="Detecting double click when running from terminal" Tags="|key-bindings|mouse|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31777" PostTypeId="1" AcceptedAnswerId="31780" CreationDate="2017-03-29T18:45:01.947" Score="1" ViewCount="102" Body="&lt;p&gt;I am not sure when I should name file &lt;code&gt;x-mode.el&lt;/code&gt; and when &lt;code&gt;x.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that because of established practice mode writer should put &lt;code&gt;(provide 'x)&lt;/code&gt; or &lt;code&gt;(provide x-mode)&lt;/code&gt; to the end of file and end-users load your mode via &lt;code&gt;(require 'x)&lt;/code&gt; or &lt;code&gt;(require x-mode)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if there are no any &lt;code&gt;*-mode&lt;/code&gt; functions inside mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if mode is library?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if mode is minor mode?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="14825" LastEditDate="2020-04-30T18:28:18.073" LastActivityDate="2020-04-30T18:28:18.073" Title="File mode name with -mode suffix or not?" Tags="|major-mode|minor-mode|filenames|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31778" PostTypeId="2" ParentId="31776" CreationDate="2017-03-29T18:53:58.587" Score="1" Body="&lt;p&gt;Check the documentation for &lt;code&gt;xterm-mouse-mode&lt;/code&gt; (&lt;code&gt;C-h f xterm-mouse-mode RET&lt;/code&gt;); you'll see that it doesn't support double clicks, or for that matter modifier keys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, I do see code in that same file that looks at consecutive mouse events and counts them to try to find double clicks, so I don't immediately see why they wouldn't be supported. &lt;/p&gt;&#xA;" OwnerUserId="9982" LastActivityDate="2017-03-29T18:53:58.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31779" PostTypeId="1" AcceptedAnswerId="33470" CreationDate="2017-03-29T20:03:53.740" Score="10" ViewCount="1932" Body="&lt;p&gt;When running the command &lt;code&gt;undo-tree-undo/redo&lt;/code&gt; successively, things are undone/redone based upon the current active branch.  Although the user receives a branch point message along the way, the previous branches are ignored unless a user manually selects a different branch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that I can open the visualizer and select a different branch, however, it would be very useful to just hold down the undo/redo key and watch everything happen in the exact opposite order.  Ideally, this should work irrespective of whether the &lt;code&gt;visualizer&lt;/code&gt; buffer is open -- i.e., programmatically calculate the order from finish to start, and from start to finish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;:  This is essentially a feature request to extend &lt;code&gt;undo-tree&lt;/code&gt; to permit linear successive undo/redo, irrespective of whether the visualizer buffer is open.  [New functions and alternative keyboard shortcuts for this new feature are certainly acceptable.]&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-05-29T17:39:02.677" LastActivityDate="2019-02-28T23:14:19.807" Title="How to make undo-tree linear -- undo-tree-undo/redo" Tags="|undo-tree-mode|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31780" PostTypeId="2" ParentId="31777" CreationDate="2017-03-29T20:20:18.017" Score="6" Body="&lt;p&gt;Don't name your file &lt;code&gt;x-mode.el&lt;/code&gt; if it does not actually provide a mode of some sort: that seems confusing. If you are providing library &lt;code&gt;x&lt;/code&gt;, just call the file &lt;code&gt;x.el&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I've seen, most modes (major or minor) do not actually use &lt;code&gt;x-mode.el&lt;/code&gt; either. That naming convention is generally used in multi-file packages where the core functionality is implemented in one or more separate files, and then the &lt;code&gt;x-mode.el&lt;/code&gt; file contains only the actual mode definition and perhaps related customization definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other typical usage I've found is for programming language modes. Emacs itself has a number of these, but file names are not consistent: see e.g. perl-mode.el and ruby-mode.el, vs. prolog.el and python.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But of course naming is subjective -- for any convention you'll be able to find counter-examples. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Anecdotally I have about 65 packages installed at the moment and found 7 files named foo-mode.el. My Emacs installation has 48 such files, many of which are in progmodes or textmodes; and many of which follow the pattern where there is a library file + a mode file, e.g. help.el/help-model.el, calc.el/calc-mode.el, etc). &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-03-30T14:38:26.497" LastActivityDate="2017-03-30T14:38:26.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31781" PostTypeId="2" ParentId="31616" CreationDate="2017-03-29T20:32:38.233" Score="3" Body="&lt;p&gt;Currently, autoloading a function is done all in C code with fairly few Lisp-visible effects (other than the loading itself).  As you have discovered advising &lt;code&gt;load&lt;/code&gt; may not catch it, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can see two ways to attack the problem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use hooks (e.g. &lt;code&gt;after-load-functions&lt;/code&gt;) and advice to detect loads,&#xA;and then use the backtrace mechanism to try and discover what &#xA;triggered the load (see around &lt;code&gt;macroexp--trim-backtrace-frame&lt;/code&gt; for&#xA;code messing with the backtrace for a somewhat related purpose).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;redefine the autoloaded functions you're interested in so they use&#xA;your own autoloading mechanism rather than the built-in one.&#xA;It's not terribly hard to do, you can start with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-autoload (fun file)&#xA;  (defalias fun (lambda (&amp;amp;rest args) (load file) (apply fun args))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which you can then refine to look at the backtrace to find the caller.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-29T20:32:38.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31782" PostTypeId="2" ParentId="31771" CreationDate="2017-03-29T20:53:54.570" Score="0" Body="&lt;p&gt;The shortcut for the next error is C-x ` (backquote, command &lt;code&gt;next-error&lt;/code&gt;) and there is no keyboard shortcut for &quot;previous-error&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going to the next scenario seems totally doable with some &lt;a href=&quot;http://wikemacs.org/wiki/Keyboard_macros&quot; rel=&quot;nofollow noreferrer&quot;&gt;keyboard macros&lt;/a&gt; or some elisp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd try with macros first:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;start registering one (F3 or &lt;code&gt;C-x (&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;go to the compilation buffer,&lt;/li&gt;&#xA;&lt;li&gt;search for the text &quot;Scenario: &quot;, visit it if needed,&lt;/li&gt;&#xA;&lt;li&gt;stop defining the macro (F4 or the closing parenthesis).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can save it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An elisp function would be nice though. I'd go with the same process (does it look right ?). I'll use &lt;code&gt;M-x ielm&lt;/code&gt; to try things out and I'll search elisp methods in manuals and with the built-in help: &lt;code&gt;C-x h k&lt;/code&gt; + a keypress to see the function that is called by this keyboard action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result will look grossely like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun cucumber-next-scenario ()&#xA;    (interactive) ;; to call it with M-x&#xA;    (windmove-next-window)&#xA;    (search-forward &quot;Scenario: &quot;)&#xA;    ;; press enter ?&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and… that's it ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit&lt;/strong&gt;: function by the OP:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-previous-scenario () &#xA;  (interactive) &#xA;  &quot;Jump to the previous cucumber scenario in the compilation buffer&quot; &#xA;  (switch-to-buffer-other-window &quot;*compilation*&quot;) &#xA;  (search-backward &quot;Szenario:&quot;) &#xA;  (execute-kbd-macro (kbd &quot;&amp;lt;return&amp;gt;&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="739" LastEditorUserId="739" LastEditDate="2017-03-30T10:46:28.253" LastActivityDate="2017-03-30T10:46:28.253" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31783" PostTypeId="1" AcceptedAnswerId="31784" CreationDate="2017-03-29T21:33:21.980" Score="4" ViewCount="1879" Body="&lt;p&gt;For:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-ag/font-lock-extend-region ()&#xA;  (save-excursion&#xA;    (goto-char font-lock-beg)&#xA;    (forward-line 2)&#xA;    (setq font-lock-beg (point))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning: reference to free variable 'font-lock-beg'&#xA;Warning: assignment to free variable 'font-lock-beg'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Documentation says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;font-lock-extend-region-functions is a variable defined in ‘font-lock.el’.&#xA;&#xA;Each function is called with no argument; it is expected to adjust the&#xA;dynamically bound variables ‘font-lock-beg’ and ‘font-lock-end’; and return&#xA;non-nil if it did make such an adjustment.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usual solution &lt;code&gt;(defvar ...)&lt;/code&gt; make this variables globally visible and may hide bugs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I mask &quot;reference/assignment to free variable&quot; warning during compilation if variable is dynamically bounded?&lt;/p&gt;&#xA;" OwnerUserId="947" LastEditorUserId="105" LastEditDate="2017-03-29T21:55:45.977" LastActivityDate="2017-03-29T22:38:17.340" Title="Fixing &quot;reference/assignment to free variable&quot; warning during compilation if variable is dynamically bounded" Tags="|variables|byte-compilation|warning|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31784" PostTypeId="2" ParentId="31783" CreationDate="2017-03-29T22:38:17.340" Score="6" Body="&lt;p&gt;Assuming you are using lexical binding, if the variable is dynamic, then it &lt;em&gt;must&lt;/em&gt; be &lt;code&gt;defvar&lt;/code&gt;'d (to ensure that lexical binding cannot treat it otherwise). AFAIK it would be a bug to &lt;em&gt;not&lt;/em&gt; use &lt;code&gt;defvar&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a variable &lt;code&gt;foo&lt;/code&gt; defined by some other library, you need only use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar foo)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to mark it as special/dynamic.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-29T22:38:17.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31785" PostTypeId="2" ParentId="23837" CreationDate="2017-03-29T23:01:32.867" Score="3" Body="&lt;p&gt;If you have chosen all the default paths while installing msys (pacman), you can find 'emacs.exe' under   C:\msys64\mingw64\bin\   on your windows machine as the pacman command installs it under the same catalog as itself. Go there and double click 'emacs.exe' app to launch it. You can also right click on the executable file(emacs.exe) and pin it to either start or task bar for the future shortcuts.&lt;/p&gt;&#xA;" OwnerUserId="15368" LastActivityDate="2017-03-29T23:01:32.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31786" PostTypeId="1" CreationDate="2017-03-30T00:30:18.343" Score="4" ViewCount="252" Body="&lt;p&gt;I was wondering if it is possible to have a column in &lt;code&gt;Ibuffer&lt;/code&gt; that shows the last viewing time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the default view I can see these columns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MR Name                    Size Mode             Filename/Process&#xA;-- ----                    ---- ----             ----------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And with &lt;kbd&gt;s v&lt;/kbd&gt; the buffers are sorted by last viewing time.&lt;br&gt;&#xA;I would be interested in having a column with the value of last viewing/editing time, for example: &lt;code&gt;20secs&lt;/code&gt;, &lt;code&gt;14min&lt;/code&gt;, &lt;code&gt;1h 23min&lt;/code&gt;, &lt;code&gt;1day 2h 34min&lt;/code&gt;, etc...&lt;/p&gt;&#xA;" OwnerUserId="6957" LastActivityDate="2021-08-27T18:07:05.637" Title="Can Ibuffer show buffers last viewing time?" Tags="|time-date|ibuffer|column|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31787" PostTypeId="1" CreationDate="2017-03-30T01:22:13.640" Score="3" ViewCount="578" Body="&lt;p&gt;I would like to set the marks myself, rather than emacs doing it automatically for me. I've experienced emacs setting the mark automatically when I search, or move to the top/bottom of the buffer. None of that. I would like to set the mark myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want to define my own interface on what goes in the mark ring.&lt;/p&gt;&#xA;" OwnerUserId="15370" LastEditorUserId="105" LastEditDate="2017-03-30T02:17:34.040" LastActivityDate="2017-03-30T02:27:59.487" Title="Is it possible to disable automatic &quot;mark&quot;ing in emacs?" Tags="|mark|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31788" PostTypeId="2" ParentId="30040" CreationDate="2017-03-30T01:23:12.650" Score="2" Body="&lt;p&gt;The index of Info files is stored in &lt;a href=&quot;https://github.com/emacs-helm/helm/blob/v2.5.4/helm-info.el#L159&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;helm-default-info-index-list&lt;/code&gt;&lt;/a&gt;, a customizable variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re-evaluating &lt;code&gt;helm-default-info-index-list&lt;/code&gt; will make newly installed Info files available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does seem like an inconvenience. I'll see about &lt;a href=&quot;https://github.com/emacs-helm/helm/pull/1734/files&quot; rel=&quot;nofollow noreferrer&quot;&gt;fixing it in a PR&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: the PR has been &lt;a href=&quot;https://github.com/emacs-helm/helm/commit/e5d5b8d182cef274fd38ba8104f88f822cb5a84a&quot; rel=&quot;nofollow noreferrer&quot;&gt;merged&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2017-03-31T17:02:13.200" LastActivityDate="2017-03-31T17:02:13.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31789" PostTypeId="2" ParentId="31787" CreationDate="2017-03-30T02:27:25.090" Score="6" Body="&lt;p&gt;Not as such. You certainly can't prevent things from calling &lt;code&gt;push-mark&lt;/code&gt; and &lt;code&gt;set-mark&lt;/code&gt; and friends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's nothing stopping you from redefining the standard functions to do nothing, however. You would then need to write your own commands for managing the mark ring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, rather than trying to &lt;em&gt;prevent&lt;/em&gt; Emacs using the mark ring in all possible situations, a simpler approach is probably to ignore the mark ring entirely.  Instead you can define your own custom mark ring and then write the commands you need to utilise it, and simply not care what Emacs is doing with the standard ring.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-03-30T02:27:25.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31790" PostTypeId="2" ParentId="31787" CreationDate="2017-03-30T02:27:59.487" Score="4" Body="&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/The-Mark.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;mark&lt;/a&gt; is &lt;strong&gt;designed&lt;/strong&gt; to be fleeting to enable jumping back (using &lt;kbd&gt;C-x C-x&lt;/kbd&gt;) after a search or a &lt;code&gt;end-of-buffer&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note however that the previous mark is &lt;strong&gt;not&lt;/strong&gt; forgotten - you can use &lt;code&gt;pop-mark&lt;/code&gt; to trace back all the marks ever set.&lt;/p&gt;&#xA;" OwnerUserId="795" LastActivityDate="2017-03-30T02:27:59.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31791" PostTypeId="1" AcceptedAnswerId="31799" CreationDate="2017-03-30T08:43:04.187" Score="1" ViewCount="490" Body="&lt;p&gt;When I create an &lt;code&gt;imenu&lt;/code&gt; with the help of the lisp snippet&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-index-function ()&#xA;  (message &quot;Running `my-index-function'.&quot;)&#xA;  '((&quot;1&quot; . 1) (&quot;1.1&quot; (&quot;1.1.1&quot; . 2) (&quot;1.1.2&quot; . 3) (&quot;1.1.3&quot; . 4)) (&quot;1.2&quot; . 5)))&#xA;(setq imenu-create-index-function #'my-index-function)&#xA;(imenu-add-to-menubar &quot;index menu&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get an &lt;em&gt;index menu&lt;/em&gt; with the items&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1.1&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1.1.1&lt;/li&gt;&#xA;&lt;li&gt;1.1.2&lt;/li&gt;&#xA;&lt;li&gt;1.1.3&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;1&lt;/li&gt;&#xA;&lt;li&gt;1.2&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But this does not correspond to the wanted order of elements in the list returned by &lt;code&gt;my-index-function&lt;/code&gt; &amp;#x2013; which is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1&lt;/li&gt;&#xA;&lt;li&gt;1.1&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1.1.1&lt;/li&gt;&#xA;&lt;li&gt;1.1.2&lt;/li&gt;&#xA;&lt;li&gt;1.1.3&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;1.2&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What am I missing? Is this some special feature of &lt;code&gt;imenu&lt;/code&gt; or is it just a bug?&#xA;How can I get the wanted order in the &lt;em&gt;index menu&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;emacs-version&lt;/code&gt;&lt;/strong&gt;: &lt;strong&gt;GNU Emacs 25.1.1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The real application is adding &lt;code&gt;imenu&lt;/code&gt;-support to &lt;code&gt;reftex&lt;/code&gt;.&#xA;Below you find the first rough test version which works for a single-LaTeX-source  buffer.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&#xA;;; imenu-support for reftex&#xA;&#xA;(require 'imenu)&#xA;&#xA;(unless (fboundp #'substring-no-indent)&#xA;  (defun substring-no-indent (str)&#xA;    &quot;Return STR without its leading whitespace.&quot;&#xA;    (substring str (string-match &quot;[^[:space:]]&quot; str))))&#xA;&#xA;(defun reftex-outline-tree-recursive (docstruct &amp;amp;optional level)&#xA;  &quot;Returns a cons of a tree generated from DOCSTRUCT and the rest of DOCSTRUCT to be processed.&#xA;The initial DOCSTRUCT should be the value of the symbol stored at `reftex-docstruct-symbol'.&quot;&#xA;  (unless (equal (caar docstruct) 'toc)&#xA;    (setq docstruct (cl-remove-if-not (lambda (entry)&#xA;                    (equal (car entry) 'toc))&#xA;                      docstruct)))&#xA;  (unless level&#xA;    (setq level (nth 5 (car docstruct))))&#xA;  (let (tree)&#xA;    (cl-block nil&#xA;      (while docstruct&#xA;    (let* ((entry (car docstruct))&#xA;           (entry-level (nth 5 entry))&#xA;           (next-entry (car-safe (cdr docstruct)))&#xA;           (next-entry-level (nth 5 next-entry))&#xA;           leaf)&#xA;      (cond&#xA;       ((or (null (numberp entry-level))&#xA;        (&amp;lt; entry-level level))&#xA;        (cl-return))&#xA;       ((and (numberp next-entry-level) (&amp;gt; next-entry-level entry-level))&#xA;        (cl-multiple-value-setq (leaf docstruct) (reftex-outline-tree-recursive (cdr docstruct)))&#xA;        (setq leaf (cons (cons &quot;-\&quot;-&quot; (car (last entry))) leaf)) ; prepend the section itself&#xA;        (setq tree (cons (cons (substring-no-indent (nth 2 entry)) leaf) tree)))&#xA;       (t ; entry-level == level&#xA;        (setq tree (cons (cons (substring-no-indent (nth 2 entry)) (car (last entry))) tree)&#xA;          docstruct (cdr docstruct)))))))&#xA;    (list (nreverse tree) docstruct)))&#xA;&#xA;(defun reftex-outline-tree (docstruct)&#xA;  &quot;Returns the toc tree generated from DOCSTRUCT as stored as value of the symbol stored at `reftex-docstruct-symbol'.&quot;&#xA;  (let (subtree tree)&#xA;    (while docstruct&#xA;      (cl-multiple-value-setq (subtree docstruct) (reftex-outline-tree-recursive docstruct))&#xA;      (setq tree (append tree subtree)))&#xA;    tree))&#xA;&#xA;(defcustom reftex-outline-flat-default nil&#xA;  &quot;The index menu \&quot;TeX Outline\&quot; has a flat structure if this option is true.&quot;&#xA;  :group 'reftex-table-of-contents-browser&#xA;  :type 'boolean)&#xA;&#xA;(defvar reftex-outline-flat reftex-outline-flat-default&#xA;  &quot;The index menu \&quot;TeX Outline\&quot; has a flat structure if this option is true.&#xA;The default is read from `reftex-outline-flat-default'.&quot;)&#xA;&#xA;(defun reftex-outline ()&#xA;  &quot;Add the index of the TeX document.&quot;&#xA;  (interactive)&#xA;  (reftex-access-scan-info t)&#xA;  (let ((docstruct (cl-remove-if-not (lambda (entry)&#xA;                       (equal (car entry) 'toc))&#xA;                     (symbol-value reftex-docstruct-symbol))))&#xA;    (if reftex-outline-flat&#xA;    (mapcar (lambda (item)&#xA;          (cons (format &quot;%s&quot; (nth 2 item))&#xA;            (car (last item))))&#xA;        docstruct)&#xA;      (reftex-outline-tree docstruct))))&#xA;&#xA;(defun reftex-toggle-outline-flat (&amp;amp;optional force)&#xA;  &quot;Toggle `reftex-outline-flat'.&#xA;With prefix arg &amp;gt; 0 switch flat outline on. With prefix arg &amp;lt;= 0 switch it off.&quot;&#xA;  (interactive &quot;p&quot;)&#xA;  (if (numberp force)&#xA;      (setq reftex-outline-flat (&amp;gt; force 0))&#xA;    (setq reftex-outline-flat (null reftex-outline-flat))))&#xA;&#xA;(defun reftex-imenu-update-advice (&amp;amp;rest args)&#xA;  &quot;Add \&quot;Flat Outline\&quot; to \&quot;TeX Outline\&quot; menu.&quot;&#xA;  (ignore args)&#xA;  (when (and imenu--index-alist reftex-docstruct-symbol)&#xA;    (easy-menu-add-item imenu--menubar-keymap nil [&quot;Flat Outline&quot; (progn (reftex-toggle-outline-flat) (imenu--menubar-select '(&quot;*Rescan*&quot; . -99))) :style toggle :selected reftex-outline-flat] &quot;*Rescan*&quot;)))&#xA;&#xA;(defun reftex-outline-imenu-enable ()&#xA;  &quot;Enable imenu in the current TeX buffer.&quot;&#xA;  (interactive)&#xA;  (setq-local imenu-create-index-function&#xA;          #'reftex-outline)&#xA;  (imenu-add-to-menubar &quot;TeX Outline&quot;)&#xA;  (advice-add #'imenu-update-menubar :after #'reftex-imenu-update-advice))&#xA;&#xA;(defun reftex-outline-imenu-disable ()&#xA;  &quot;Disable imenu in the current PDF buffer.&quot;&#xA;  (interactive)&#xA;  (setq-local imenu-create-index-function nil)&#xA;  (local-set-key [menu-bar index] nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This gives the index entry &lt;code&gt;-&quot;-&lt;/code&gt; for the start of the first sub-section after the first sub-sub-section for the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-latex prettyprint-override&quot;&gt;&lt;code&gt;\documentclass{article}&#xA;&#xA;\begin{document}&#xA;\section{1}&#xA;\subsection{11}&#xA;\subsubsection{111}&#xA;\subsubsection{112}&#xA;\subsection{12}&#xA;\end{document}&#xA;&#xA;%%% Local Variables:&#xA;%%% mode: latex&#xA;%%% TeX-master: t&#xA;%%% End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;a href=&quot;https://www.emacswiki.org/emacs/LaTeX&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;imenu-add-menubar-index&lt;/code&gt;&lt;/a&gt; but I don't like the splitting of the table of contents into groups. I like better if &lt;code&gt;imenu&lt;/code&gt; creates sub-menus for subsections.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2017-03-30T14:10:15.783" LastActivityDate="2017-08-27T15:39:08.230" Title="Order of items in imenu" Tags="|imenu|" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31792" PostTypeId="1" AcceptedAnswerId="31794" CreationDate="2017-03-30T09:28:49.193" Score="3" ViewCount="3479" Body="&lt;p&gt;How can I set up Magit to access a GitHub repository?&lt;/p&gt;&#xA;" OwnerUserId="4084" LastActivityDate="2017-03-30T21:15:02.293" Title="How to set up Magit to access a GitHub repository?" Tags="|magit|github|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31793" PostTypeId="1" AcceptedAnswerId="31810" CreationDate="2017-03-30T10:02:21.267" Score="1" ViewCount="276" Body="&lt;p&gt;There is a large blank space between the top of the buffer and the bottom of the menu-bar in my Emacs 24 on Ubunutu 16.10 that doesn't want to go away.  I've tried Googling but can't really find anything to help, would appreciate some ideas!  Screenshot included:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kB8DH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kB8DH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15374" LastEditorUserId="105" LastEditDate="2017-03-30T14:43:50.757" LastActivityDate="2017-03-31T08:11:26.213" Title="Large blank space between menu-bar and buffer window" Tags="|buffers|menu-bar|tool-bar|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31794" PostTypeId="2" ParentId="31792" CreationDate="2017-03-30T10:48:16.710" Score="5" Body="&lt;p&gt;Generally speaking you don't configure Magit to access a remote Git repository. Instead you configure &lt;code&gt;git&lt;/code&gt; and because Magit uses &lt;code&gt;git&lt;/code&gt;, Magit is then also able to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some issues can arise due to misconfiguration and/or Windows not having a concept of a pty. But even then, the solution is to properly configure Git and/or Emacs. No additional Magit configuration is required. (Except if you use some two-factor authentication, then you might have to adjust &lt;code&gt;magit-process-password-prompt-regexps&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the difficulties that might arise, are covered in &lt;a href=&quot;https://github.com/magit/magit/wiki/Pushing-with-Magit-from-Windows&quot; rel=&quot;noreferrer&quot;&gt;this wiki page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-03-30T10:48:16.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31795" PostTypeId="2" ParentId="31726" CreationDate="2017-03-30T11:29:53.880" Score="3" Body="&lt;p&gt;By default the binding to do this in Emacs' shell-mode is M-r which runs the command &lt;code&gt;comint-history-isearch-backward-regexp&lt;/code&gt;.  This allows you to search backwards though your input history using a regular expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I prefer the &lt;code&gt;comint-previous-matching-input-from-input&lt;/code&gt; command, which is by default bound to C-c M-r.  I have it bound to the slightly more convenient M-p and it allows me to type the first few characters of the command I want, and to then use M-p to cycle through all previous inputs that begin with this prefix.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-30T11:29:53.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31796" PostTypeId="1" CreationDate="2017-03-30T12:08:33.110" Score="0" ViewCount="526" Body="&lt;p&gt;I'd like to install Magit. &lt;a href=&quot;https://magit.vc/manual/magit/Installing-from-an-Elpa-Archive.html#Installing-from-an-Elpa-Archive&quot; rel=&quot;nofollow noreferrer&quot;&gt;According to the Installation chapter of the Magit user manual&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Magit is available from Melpa and Melpa-Stable. If you haven’t used Emacs’ package manager before, then it is high time you familiarize yourself with it by reading the documentation in the Emacs manual, see &lt;a href=&quot;http://www.gnu.org/software/emacs/manual/html_node/emacs/Packages.html#Packages&quot; rel=&quot;nofollow noreferrer&quot;&gt;(emacs)Packages&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html#Package-Installation&quot; rel=&quot;nofollow noreferrer&quot;&gt;According to the Package Installation section of The Emacs Editor manual linked to in the above quote&lt;/a&gt;,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;By default, packages are downloaded from a single package archive maintained by the Emacs developers. This is controlled by the variable package-archives [...] You can alter this list if you wish to use third party package archives—but do so at your own risk, and use only third parties that you think you can trust!&lt;/p&gt;&#xA;&lt;p&gt;The maintainers of package archives can increase the trust that you can have in their packages by signing them. [...] Package archives should provide instructions on how you can obtain their public key.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Where can I find the MELPA archives' instructions on how I can obtain their public key?&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-03-30T12:08:33.110" Title="MELPA's public key" Tags="|package-repositories|security|" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31797" PostTypeId="2" ParentId="28715" CreationDate="2017-03-30T12:35:21.843" Score="1" Body="&lt;p&gt;You can fix for the formatting of the Pandas DataFrame so it includes a value in the top left corner by setting the column name:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]}, columns=list('AB'))&#xA;test.columns.name = 'foo'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will then produce you a table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: foo     A    B&#xA;: 0    1000   60&#xA;: 1    1000  100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I still couldn't get Org to display the result correctly.  Perhaps you'll have better luck though.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-30T12:35:21.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31798" PostTypeId="2" ParentId="31776" CreationDate="2017-03-30T13:13:46.550" Score="0" Body="&lt;p&gt;I reworked some of that xtrm-mouse-mode handling sometimes around May-June 2014.  Not sure if it reached Emacs-24.5, but at least double clicks seem to work for me here in Emacs-25.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-30T13:13:46.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31799" PostTypeId="2" ParentId="31791" CreationDate="2017-03-30T14:10:30.933" Score="1" Body="&lt;p&gt;The comment of user poliza provided the following solution based on&#xA;&lt;a href=&quot;https://github.com/politza/pdf-tools/blob/master/lisp/pdf-outline.el#L554&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;pdf-outline--imenu--split-menu&lt;/code&gt;&lt;/a&gt; from &lt;code&gt;pdf-tools&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; See http://emacs.stackexchange.com/questions/31791/order-of-items-in-imenu?noredirect=1#comment48799_31791&#xA;(advice-add #'imenu--split-menu :around #'reftex-outline-imenu--split-menu)&#xA;&#xA;(defun reftex-outline-imenu--split-menu (oldfun menulist title)&#xA;  &quot;Replacement function for `imenu--split-menu'.&#xA;This function does not move sub-menus to the top, therefore&#xA;keeping the original outline order of the document.  Also it does&#xA;not call `imenu-sort-function'.&quot;&#xA;  (if (reftex-outline-p)&#xA;      (let ((menulist (copy-sequence menulist))&#xA;        keep-at-top)&#xA;    (if (memq imenu--rescan-item menulist)&#xA;        (setq keep-at-top (list imenu--rescan-item)&#xA;          menulist (delq imenu--rescan-item menulist)))&#xA;    (if (&amp;gt; (length menulist) imenu-max-items)&#xA;        (setq menulist&#xA;          (mapcar&#xA;           (lambda (menu)&#xA;             (cons (format &quot;From: %s&quot; (caar menu)) menu))&#xA;           (imenu--split menulist imenu-max-items))))&#xA;    (cons title&#xA;          (nconc (nreverse keep-at-top) menulist)))&#xA;    (funcall oldfun menulist title)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2017-03-30T14:10:30.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31800" PostTypeId="1" CreationDate="2017-03-30T14:20:23.690" Score="2" ViewCount="63" Body="&lt;p&gt;I'm attempting to write a rule for &lt;code&gt;align-current&lt;/code&gt; for &lt;a href=&quot;http://robotframework.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Robot Framework&lt;/a&gt; tests. Columns are delimited by multiple spaces in a row (I know, what an awful choice) and each row can have a varying number of columns (essentially each column is a function argument). Can this be implemented with &lt;code&gt;align-current&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some example input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Log  fooooooooooooooooooooooooooo 123 456&#xA;Log differently  something else  bazzzzzz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Desired output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Log                fooooooooooooooooooooooooooo 123 456&#xA;Log differently    something else                          bazzzzzz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I have at the moment is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'align-rules-list '(robot-mode-align-test-data&#xA;                                 (regexp  . &quot;\\(  +\\)&quot;)&#xA;                                 (modes   . '(robot-mode))&#xA;                                 (repeat  . t)&#xA;                                 (spacing . 4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works except for the final column on the second line in the example above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried including &lt;code&gt;\n&lt;/code&gt; in the align regex, but I think emacs ends up in an infinite loop (until it hits line length 256 when presumably it gives up).&lt;/p&gt;&#xA;" OwnerUserId="237" LastActivityDate="2017-03-30T14:20:23.690" Title="Can align-current handle aligning a varying number of columns?" Tags="|align|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31801" PostTypeId="1" CreationDate="2017-03-30T14:22:49.637" Score="1" ViewCount="530" Body="&lt;p&gt;I am working on windows machine. I have last org version (from February 2017).&#xA;I have a remote host accessible by putty, where i have created org file of the following contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+TITLE C language things&#xA;&#xA;* Simple hello-world program&#xA;&#xA;#+NAME hello world on C&#xA;#+BEGIN_SRC C :dir /pscp:tcl:/home/tc/development :main no&#xA;  #include &amp;lt;stdio.h&amp;gt;&#xA;&#xA;  int main()&#xA;  {&#xA;      printf(&quot;Hello, world!&quot;);&#xA;      return 0;&#xA;  }&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where tcl is name of saved putty configuration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i evaluate codefragment, overall result is a failure (however, it is not a crash, and toggling debug on yields no backtrace)&#xA;Here is what is output to &lt;em&gt;Message&lt;/em&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;executing C code block...&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816iL0.c to /pscp:tcl:/tmp/C-src-4816VBu.c...&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Tramp: Process has finished.&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816iL0.c to /pscp:tcl:/tmp/C-src-4816VBu.c...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816hfJ.exe to /pscp:tcl:/tmp/C-bin-4816UVD.exe...&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Tramp: Process has finished.&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816hfJ.exe to /pscp:tcl:/tmp/C-bin-4816UVD.exe...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816upP.c to /pscp:tcl:/tmp/C-src-4816VBu.c...&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Tramp: Process has finished.&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816upP.c to /pscp:tcl:/tmp/C-src-4816VBu.c...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816I-b to /pscp:tcl:/tmp/ob-input-48167zV...&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Tramp: Process has finished.&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816I-b to /pscp:tcl:/tmp/ob-input-48167zV...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816iSo to /pscp:tcl:/tmp/ob-error-4816VIi...&#xA;Tramp: Waiting for prompts from remote shell...&#xA;Tramp: Process has finished.&#xA;Tramp: Waiting for prompts from remote shell...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816iSo to /pscp:tcl:/tmp/ob-error-4816VIi...done&#xA;Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816vcu to /pscp:tcl:/tmp/ob-input-48167zV...failed&#xA;byte-code: Spawning child process: invalid argument&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is going on there? What does error in the end mean? Most importantly, is code block being evaluated on remote host at all? Can output of org-babel commands be turned on to get that information? Preferably in such a way that all commands executed will be visible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With tramp tracing turned on, these are copy commands that were executed by tramp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;29 matches in 17 lines for &quot;copy&quot; in buffer: *debug tramp/pscp tcl*&#xA;    143:10:35:24.212000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208n9z.c to /pscp:tcl:/tmp/C-src-2208azt.c...&#xA;    144:10:35:24.224000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r &quot;c:/Users/Ivan/AppData/Local/Temp/tramp.2208n9z.c&quot; &quot;tcl:/tmp/C-src-2208azt.c&quot; &amp;amp;&amp;amp; echo tramp_exit_status 0 || echo tramp_exit_status 1&#xA;    161:10:35:24.424000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208n9z.c to /pscp:tcl:/tmp/C-src-2208azt.c...done&#xA;    206:10:35:25.041000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208mRJ.exe to /pscp:tcl:/tmp/C-bin-2208ZHD.exe...&#xA;    207:10:35:25.050000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r &quot;c:/Users/Ivan/AppData/Local/Temp/tramp.2208mRJ.exe&quot; &quot;tcl:/tmp/C-bin-2208ZHD.exe&quot; &amp;amp;&amp;amp; echo tramp_exit_status 0 || echo tramp_exit_status 1&#xA;    224:10:35:25.245000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208mRJ.exe to /pscp:tcl:/tmp/C-bin-2208ZHD.exe...done&#xA;    246:10:35:25.572000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208zbP.c to /pscp:tcl:/tmp/C-src-2208azt.c...&#xA;    247:10:35:25.583000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r &quot;c:/Users/Ivan/AppData/Local/Temp/tramp.2208zbP.c&quot; &quot;tcl:/tmp/C-src-2208azt.c&quot; &amp;amp;&amp;amp; echo tramp_exit_status 0 || echo tramp_exit_status 1&#xA;    264:10:35:25.832000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208zbP.c to /pscp:tcl:/tmp/C-src-2208azt.c...done&#xA;    289:10:35:26.224000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208Nwb to /pscp:tcl:/tmp/ob-input-2208AmV...&#xA;    290:10:35:26.236000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r &quot;c:/Users/Ivan/AppData/Local/Temp/tramp.2208Nwb&quot; &quot;tcl:/tmp/ob-input-2208AmV&quot; &amp;amp;&amp;amp; echo tramp_exit_status 0 || echo tramp_exit_status 1&#xA;    307:10:35:26.424000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208Nwb to /pscp:tcl:/tmp/ob-input-2208AmV...done&#xA;    332:10:35:26.823000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208nEo to /pscp:tcl:/tmp/ob-error-2208a6h...&#xA;    333:10:35:26.834000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r &quot;c:/Users/Ivan/AppData/Local/Temp/tramp.2208nEo&quot; &quot;tcl:/tmp/ob-error-2208a6h&quot; &amp;amp;&amp;amp; echo tramp_exit_status 0 || echo tramp_exit_status 1&#xA;    350:10:35:27.029000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208nEo to /pscp:tcl:/tmp/ob-error-2208a6h...done&#xA;    384:10:35:27.500000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.22080Ou to /pscp:tcl:/tmp/ob-input-2208AmV...&#xA;    385:10:35:27.512000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.22080Ou to /pscp:tcl:/tmp/ob-input-2208AmV...failed&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In &lt;code&gt;/tmp&lt;/code&gt; folder on remote host, these are new files that have appeared:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;C-bin-2208ZHD.exe&lt;/li&gt;&#xA;&lt;li&gt;C-src-2208azt.c&lt;/li&gt;&#xA;&lt;li&gt;ob-error-2208a6h&lt;/li&gt;&#xA;&lt;li&gt;ob-input-2208AmV&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Following commands were executed by tramp remotely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;59 matches for &quot;send-command&quot; in buffer: *debug tramp/pscp tcl*&#xA;      3:10:35:22.795000 tramp-send-command (6) # echo are you awake&#xA;      7:10:35:22.847000 tramp-send-command (6) # (test -e /tmp/C-src-2208azt.c || test -h /tmp/C-src-2208azt.c) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp/C-src-2208azt.c&#xA;     13:10:35:22.902000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp&#xA;     19:10:35:22.958000 tramp-send-command (6) # test -e /tmp/C-src-2208azt.c 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;     26:10:35:23.058000 tramp-send-command (6) # ( base64 &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     31:10:35:23.111000 tramp-send-command (6) # ( base64 &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     36:10:35:23.163000 tramp-send-command (6) # ( mimencode -b &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     41:10:35:23.215000 tramp-send-command (6) # ( mmencode -b &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     46:10:35:23.267000 tramp-send-command (6) # ( recode data..base64 &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     53:10:35:23.320000 tramp-send-command (6) # ( test -c /dev/stdout 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     58:10:35:23.372000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     63:10:35:23.424000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     68:10:35:23.476000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     73:10:35:23.528000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     84:10:35:23.610000 tramp-send-command (6) # ( base64 &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     89:10:35:23.661000 tramp-send-command (6) # ( base64 &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     94:10:35:23.713000 tramp-send-command (6) # ( mimencode -b &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;     99:10:35:23.765000 tramp-send-command (6) # ( mmencode -b &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;    104:10:35:23.817000 tramp-send-command (6) # ( recode data..base64 &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;    111:10:35:23.869000 tramp-send-command (6) # ( test -c /dev/stdout 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;    116:10:35:23.921000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;    121:10:35:23.974000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;    126:10:35:24.026000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;    131:10:35:24.078000 tramp-send-command (6) # ( uuencode xxx &amp;lt;/dev/null 2&amp;gt;/dev/null); echo tramp_exit_status $? )&#xA;    139:10:35:24.150000 tramp-send-command (6) # test -d /tmp/C-src-2208azt.c 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    157:10:35:24.369000 tramp-send-command (6) # chmod 0666 /tmp/C-src-2208azt.c 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    165:10:35:24.427000 tramp-send-command (6) # (test -e /home || test -h /home) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /home&#xA;    171:10:35:24.481000 tramp-send-command (6) # (test -e /home/tc || test -h /home/tc) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /home/tc&#xA;    177:10:35:24.535000 tramp-send-command (6) # (test -e /home/tc/development || test -h /home/tc/development) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /home/tc/development&#xA;    182:10:35:24.635000 tramp-send-command (6) # chown 1001:50 /tmp/C-src-2208azt.c&#xA;    186:10:35:24.746000 tramp-send-command (6) # (test -e /tmp/C-bin-2208ZHD.exe || test -h /tmp/C-bin-2208ZHD.exe) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp/C-bin-2208ZHD.exe&#xA;    192:10:35:24.800000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp&#xA;    198:10:35:24.855000 tramp-send-command (6) # test -e /tmp/C-bin-2208ZHD.exe 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    202:10:35:24.983000 tramp-send-command (6) # test -d /tmp/C-bin-2208ZHD.exe 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    220:10:35:25.189000 tramp-send-command (6) # chmod 0777 /tmp/C-bin-2208ZHD.exe 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    225:10:35:25.300000 tramp-send-command (6) # chown 1001:50 /tmp/C-bin-2208ZHD.exe&#xA;    229:10:35:25.352000 tramp-send-command (6) # (test -e /tmp/C-src-2208azt.c || test -h /tmp/C-src-2208azt.c) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp/C-src-2208azt.c&#xA;    236:10:35:25.407000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp&#xA;    242:10:35:25.514000 tramp-send-command (6) # test -d /tmp/C-src-2208azt.c 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    260:10:35:25.777000 tramp-send-command (6) # chmod 0666 /tmp/C-src-2208azt.c 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    265:10:35:25.915000 tramp-send-command (6) # chown 1001:50 /tmp/C-src-2208azt.c&#xA;    269:10:35:25.969000 tramp-send-command (6) # (test -e /tmp/ob-input-2208AmV || test -h /tmp/ob-input-2208AmV) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp/ob-input-2208AmV&#xA;    275:10:35:26.023000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp&#xA;    281:10:35:26.077000 tramp-send-command (6) # test -e /tmp/ob-input-2208AmV 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    285:10:35:26.167000 tramp-send-command (6) # test -d /tmp/ob-input-2208AmV 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    303:10:35:26.372000 tramp-send-command (6) # chmod 0666 /tmp/ob-input-2208AmV 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    308:10:35:26.510000 tramp-send-command (6) # chown 1001:50 /tmp/ob-input-2208AmV&#xA;    312:10:35:26.565000 tramp-send-command (6) # (test -e /tmp/ob-error-2208a6h || test -h /tmp/ob-error-2208a6h) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp/ob-error-2208a6h&#xA;    318:10:35:26.619000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp&#xA;    324:10:35:26.674000 tramp-send-command (6) # test -e /tmp/ob-error-2208a6h 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    328:10:35:26.767000 tramp-send-command (6) # test -d /tmp/ob-error-2208a6h 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    346:10:35:26.974000 tramp-send-command (6) # chmod 0666 /tmp/ob-error-2208a6h 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    351:10:35:27.074000 tramp-send-command (6) # chown 1001:50 /tmp/ob-error-2208a6h&#xA;    355:10:35:27.128000 tramp-send-command (6) # (test -e /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe || test -h /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe) &amp;amp;&amp;amp; /bin/ls --color=never -ild /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe&#xA;    359:10:35:27.181000 tramp-send-command (6) # (test -e /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe || test -h /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe&#xA;    362:10:35:27.232000 tramp-send-command (6) # test -x /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;    367:10:35:27.286000 tramp-send-command (6) # (test -e /tmp/ob-input-2208AmV || test -h /tmp/ob-input-2208AmV) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp/ob-input-2208AmV&#xA;    374:10:35:27.342000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) &amp;amp;&amp;amp; /bin/ls --color=never -ildn /tmp&#xA;    380:10:35:27.442000 tramp-send-command (6) # test -d /tmp/ob-input-2208AmV 2&amp;gt;/dev/null; echo tramp_exit_status $?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are two conclusions i can make:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;remote host's &lt;code&gt;gcc&lt;/code&gt; was not called&lt;/li&gt;&#xA;&lt;li&gt;executable file was created on local host by mingw's &lt;code&gt;gcc&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Full trace for tramp can be found &lt;a href=&quot;https://pastebin.com/dvpF3LrN&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11047" LastEditorUserId="11047" LastEditDate="2017-03-31T07:41:40.083" LastActivityDate="2017-03-31T07:41:40.083" Title="How to evaluate source code block on remote host?" Tags="|org-babel|tramp|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31802" PostTypeId="2" ParentId="28715" CreationDate="2017-03-30T14:27:10.363" Score="4" Body="&lt;p&gt;You probably have to convert the dataframe to a type that org knows what to do with. For example, I can get the table contents, but not the column names or the index column like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN_SRC python :exports both :results table&#xA; import pandas as pd&#xA; import numpy&#xA; test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})&#xA; return test.as_matrix()&#xA; #+END_SRC&#xA;&#xA; #+RESULTS:&#xA; | 1000 |  60 |&#xA; | 1000 | 100 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I didn't see options to as_matrix that would let you get at the missing elements, but there might be some other such conversion that is more complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: apparently &lt;code&gt;test.values&lt;/code&gt; is preferred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: ... and this &lt;em&gt;almost&lt;/em&gt; does it (but it might be fragile):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #+BEGIN_SRC python :exports both :results table&#xA; import pandas as pd&#xA; test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})&#xA; return [x.split(',') for x in test.to_csv().split('\n')]&#xA; #+END_SRC&#xA;&#xA; #+RESULTS:&#xA; |   |    A |   B |&#xA; | 0 | 1000 |  60 |&#xA; | 1 | 1000 | 100 |&#xA; |   |      |     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2017-03-30T14:39:47.890" LastActivityDate="2017-03-30T14:39:47.890" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31803" PostTypeId="1" CreationDate="2017-03-30T16:50:58.927" Score="9" ViewCount="2761" Body="&lt;p&gt;I have a basic ordered list in &lt;code&gt;org&lt;/code&gt; mode. After exporting to HTML it takes the default class that org mode assigned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;ol class=&quot;org-ol&quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some lists, however, I'm trying to assign a custom class (like &quot;special_list&quot;, for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;ol class=&quot;special_list&quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The org mode documentation says you could add an attribute in this fashion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;#+ATTR_HTML: :class special_list&#xA;1. First point&#xA;2. Second point&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that doesn't seem to work in this case. Do I have the syntax wrong, or is there a different method for applying custom classes?&lt;/p&gt;&#xA;" OwnerUserId="14390" LastActivityDate="2017-03-30T18:23:19.180" Title="Custom Class Attribute in Org Mode" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31805" PostTypeId="2" ParentId="31803" CreationDate="2017-03-30T18:23:19.180" Score="9" Body="&lt;p&gt;The &lt;code&gt;:class&lt;/code&gt; attribute does not seem to apply to lists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you can wrap your list in a custom div this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_pepe&#xA;1. One&#xA;2. Two&#xA;#+end_pepe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will produce the following HTML:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;pepe&quot;&amp;gt;&#xA; &amp;lt;ol class=&quot;org-ol&quot;&amp;gt;&#xA;  &amp;lt;li&amp;gt;One&amp;lt;/li&amp;gt;&#xA;  &amp;lt;li&amp;gt;Two&amp;lt;/li&amp;gt;&#xA; &amp;lt;/ol&amp;gt;&#xA;&amp;lt;/div&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you can use a CSS selector for that list such as &lt;code&gt;div.pepe ol&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2017-03-30T18:23:19.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31806" PostTypeId="2" ParentId="21938" CreationDate="2017-03-30T18:26:43.237" Score="1" Body="&lt;p&gt;Having &lt;code&gt;(setq whitespace-line-column 80000)&lt;/code&gt; in my init.el files turned out to be an incompatible configuration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commenting that out enabled webmode to work as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this &lt;a href=&quot;https://github.com/fxbois/web-mode/issues/730#issuecomment-241332750&quot; rel=&quot;nofollow noreferrer&quot;&gt;github issue&lt;/a&gt; for further discussion.&lt;/p&gt;&#xA;" OwnerUserId="9311" LastActivityDate="2017-03-30T18:26:43.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31808" PostTypeId="2" ParentId="31792" CreationDate="2017-03-30T21:08:36.550" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;code&gt;magit-clone&lt;/code&gt; to clone a GitHub (or any Git) repo&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can also clone via command line, of course, which I prefer&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Open a file in the repo and call &lt;code&gt;magit-status&lt;/code&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It is convenient to bind this to a key, e.g. &lt;code&gt;C-c m&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Congratulations, you're using Magit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Howard Abrams' excellent &lt;a href=&quot;https://www.youtube.com/watch?v=vQO7F2Q9DwA&quot; rel=&quot;noreferrer&quot;&gt;introductory video&lt;/a&gt; can get you started with staging, committing, pushing, etc. A comprehensive &lt;a href=&quot;https://magit.vc/manual/magit.html&quot; rel=&quot;noreferrer&quot;&gt;user manual&lt;/a&gt; is also available.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I don't want to install this package before I know whether it's possible to access a GitHub repository. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Uhh...where's the spirit of experimentation?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="10269" LastEditDate="2017-03-30T21:15:02.293" LastActivityDate="2017-03-30T21:15:02.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31809" PostTypeId="1" CreationDate="2017-03-30T22:29:31.257" Score="2" ViewCount="255" Body="&lt;p&gt;I am writing a manuscript and I want to be able to reference my figures in the manuscript which I have included like the manual suggests:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+CAPTION: Figure caption&#xA;#+NAME:   fig:my-figure&#xA;     [[./figures/my_figure.pdf]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I basically want to pop up a helm search and autocomplete elsewhere in the document to find the figure I want and reference it. Can this be achieved using &lt;code&gt;C-c C-l&lt;/code&gt; &lt;code&gt;org-insert-link&lt;/code&gt; or is something new needed? This only brings up a canned list of tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen &lt;a href=&quot;https://emacs.stackexchange.com/questions/27647/autocompletion-when-creating-internal-links-in-org-mode&quot;&gt;this&lt;/a&gt; but the question is asking only for headers.&lt;/p&gt;&#xA;" OwnerUserId="9019" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-03-30T22:29:31.257" Title="Easy completion for internal links to figures/images?" Tags="|org-mode|org-link|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31810" PostTypeId="2" ParentId="31793" CreationDate="2017-03-31T04:33:40.447" Score="0" Body="&lt;p&gt;For marking this question as done I cite my comment below the question as an answer here:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What you mean with toolbar is actually the menu-bar. I think the large blank space is the real tool-bar but maybe your emacs is missing the icons for the tool-bar. You can test whether the large blank space is the tool-bar by switching off Options -&gt; Show/Hide -&gt; Tool-bar&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The original poster added that the assumption from the comment is right and that he switches the tool-bar off by adding &lt;code&gt;(tool-bar-mode -1)&lt;/code&gt; to his init file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The remaining question would be why the tool-bar remains empty. This is an error. There should be at least buttons for &lt;code&gt;find-file&lt;/code&gt;, &lt;code&gt;menu-find-file-existing&lt;/code&gt;, &lt;code&gt;dired&lt;/code&gt;, &lt;code&gt;kill-buffer&lt;/code&gt;, and some more buttons for editing text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&#xA;Note, that this is a known problem with emacs24 under &lt;a href=&quot;https://wiki.ubuntu.com/YakketyYak&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ubuntu 16.10&lt;/a&gt;.&#xA;There already exists &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/emacs24/+bug/1623585&quot; rel=&quot;nofollow noreferrer&quot;&gt;a bug report with a workaround for it at launchpad&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2017-03-31T08:11:26.213" LastActivityDate="2017-03-31T08:11:26.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31811" PostTypeId="2" ParentId="31408" CreationDate="2017-03-31T05:19:12.313" Score="0" Body="&lt;p&gt;I also faced the same problem. In my case, it was caused by the wrong setting of  &lt;code&gt;:latex-compiler&lt;/code&gt; in &lt;code&gt;imagemagick&lt;/code&gt; part of &lt;code&gt;org-preview-latex-process-alist&lt;/code&gt;: the original value was &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;pdflatex -interaction nonstopmode -output-directory %o %f&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I would like use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(&quot;lualatex -interaction nonstopmode -output-directory %o %f&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I do not know much about lisp, I simply followed&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/41568410/configure-org-mode-to-use-lualatex&quot;&gt;https://stackoverflow.com/questions/41568410/configure-org-mode-to-use-lualatex&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although this patch is for lualatex users like me (and not the best or reasonable way), your problem could be solved in a similar manner. You might define new function (e.g. &lt;code&gt;new-imagemagick&lt;/code&gt;) with proper &lt;code&gt;:latex-compiler&lt;/code&gt; command, add it to &lt;code&gt;org-preview-latex-process-alist&lt;/code&gt; and call it rather than &lt;code&gt;imagemagick&lt;/code&gt;. You can change directly the part of &lt;code&gt;&quot;pdf latex -interation ....&quot;)&lt;/code&gt; according to your prefer latex command. &lt;/p&gt;&#xA;" OwnerUserId="15383" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-03-31T05:40:05.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31812" PostTypeId="1" AcceptedAnswerId="31927" CreationDate="2017-03-31T05:35:56.167" Score="0" ViewCount="216" Body="&lt;p&gt;I wish to play chess with &lt;code&gt;chess.el&lt;/code&gt; on a FICS server using M-x chess-ics but using that logs me as a guest player. How can I login with my registered user/password?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've come with a way to login. At the beginning of &lt;code&gt;chess-ics.el&lt;/code&gt; comes a list of servers, I can edit it and add my username (or handle) in front of &lt;code&gt;&quot;freechess.org&quot;&lt;/code&gt; &lt;code&gt;5000&lt;/code&gt; as a new arg for connection. Then &lt;code&gt;M-x chess-isc&lt;/code&gt; will ask me my password and that's it. (I have to use set seek 1 when already logged in to get the extra seek buffer, and set availinfo 0 to stop  the annoying noise on  the &lt;code&gt;freechess&lt;/code&gt; buffer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, now my issue is this, I don't like editing the &lt;code&gt;chess-ics.el&lt;/code&gt; file to tell that I want to log in as my username. How can I tell &lt;code&gt;M-x chess-ics&lt;/code&gt; that I want to use my username for connection? I've tried &lt;code&gt;C-u M-x chess-ics&lt;/code&gt; but it seems the &lt;code&gt;chess-ics.el&lt;/code&gt; script doesn't support that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing I need to make some custom command or something (sorry for the newbie language here) so that I can call not  the default (&lt;code&gt;chess-ics&lt;/code&gt;) but the &lt;code&gt;(chess-ics my-username)&lt;/code&gt; which in turns calls what I want. Am I right? So I need to defun something and overwrite the default &lt;code&gt;M-x chess-ics&lt;/code&gt; to call my new function. Is  that it? What would be the correct syntax  to do this. I'm really pretty new on hacking emacs lisp :(&lt;/p&gt;&#xA;" OwnerUserId="684" LastEditorUserId="105" LastEditDate="2017-12-27T03:54:12.117" LastActivityDate="2017-12-27T03:54:12.117" Title="Play chess, login on a FICS server" Tags="|defun|games|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31813" PostTypeId="1" CreationDate="2017-03-31T08:16:49.197" Score="1" ViewCount="94" Body="&lt;p&gt;I want to learn how to use a built in package (e.g. ediff). This built-in package has an online manual in html, but presumably this content is also available from within emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I view it within emacs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside: I have also tried to find the pdf for the ediff manual (for offline reading), but cannot find it. The solution to the above problem would solve it, but it would also be good to know if / how I can find / create a pdf of an emacs builtin package.&lt;/p&gt;&#xA;" OwnerUserId="3944" LastActivityDate="2017-03-31T11:59:50.807" Title="How to view ediff (and other) manuals within emacs?" Tags="|ediff|manual|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31814" PostTypeId="1" AcceptedAnswerId="31821" CreationDate="2017-03-31T08:23:34.527" Score="0" ViewCount="64" Body="&lt;p&gt;I have a code for changing a paragraph of auto filled text into a paragraph with one sentence per line, where each sentence stretches out in its full length. This code is perfect when composing and analyzing prose. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the code has one annoying and unintended side effect if I use it with org-mode. If my text has any starred headlines, these will collapses when I use the code. Then I loose track of where my writing point is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code is attached below. I am grateful for any help removing this side effect.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun myfun-split-para-at-sentence-ends ()&#xA;  &quot;Split current paragraph into lines with one sentence each.&#xA;Then turn off `auto-fill-mode'.&quot;&#xA;  (interactive)&#xA;  (let ((mode  major-mode))&#xA;    (unwind-protect&#xA;         (progn (text-mode)&#xA;                (save-excursion&#xA;                  (let ((emacs-lisp-docstring-fill-column  t)&#xA;                        (fill-column                       (point-max)))&#xA;                    (fill-paragraph))&#xA;                  (let ((bop  (progn (backward-paragraph) (point)))&#xA;                        (eop  (progn (forward-paragraph)  (point))))&#xA;                    (goto-char bop)&#xA;                    (while (&amp;lt; (point) eop)&#xA;                      (forward-sentence)&#xA;                      (delete-horizontal-space)&#xA;                      (insert &quot;\n&quot;)))))&#xA;      (funcall mode)))&#xA;  (auto-fill-mode -1))&#xA;&#xA;(define-minor-mode split-para-mode &#xA;    &quot;Toggle between a filled paragraph and one split into sentences.&quot;&#xA;  nil nil nil&#xA;  (if (not split-para-mode)&#xA;      (myfun-split-para-at-sentence-ends)&#xA;    (auto-fill-mode 1)&#xA;    (fill-paragraph)))&#xA;(global-set-key &quot;\C-s&quot; 'split-para-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8348" LastEditorUserId="105" LastEditDate="2017-03-31T13:38:36.493" LastActivityDate="2017-03-31T13:38:36.493" Title="My code for streching text lines collapses any org-mode headline in a buffer. How to avoid it?" Tags="|org-mode|code-folding|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31815" PostTypeId="2" ParentId="31704" CreationDate="2017-03-31T08:26:24.540" Score="3" Body="&lt;p&gt;For me on ubuntu 16.04,&#xA;after started emacs server&#xA;edit your &lt;code&gt;/usr/share/applications/emacs24.desktop&lt;/code&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TryExec=/usr/bin/emacsclient -c                                                                                                                                          &#xA;Exec=/usr/bin/emacsclient -c %F&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15227" LastActivityDate="2017-03-31T08:26:24.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31816" PostTypeId="1" CreationDate="2017-03-31T08:46:05.400" Score="0" ViewCount="143" Body="&lt;p&gt;I cannot get ps-pinting working in emacs I have a lisp file, and when I try to translate to ps I only get the file with an error&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C-u M-x ps-print-buffer-with-faces&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get this file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ufile.io/1f0f0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ufile.io/1f0f0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has an error&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Mac Os Sierra, emacs 26.0, but the same configuration on other cmputer but with Captain works, I user the same .emacs.d for both emacs, for example converting an org file to latex pdf it works well in both environments&lt;/p&gt;&#xA;" OwnerUserId="8892" LastEditorUserId="8892" LastEditDate="2017-03-31T11:36:58.453" LastActivityDate="2017-03-31T11:36:58.453" Title="ps-print-buffer error" Tags="|print|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31818" PostTypeId="2" ParentId="18741" CreationDate="2017-03-31T11:49:46.253" Score="3" Body="&lt;p&gt;The problem lies on the arbitrariness with which Org Mode deals with case sensitivity. I was used to having a &lt;code&gt;#+BEGIN_HTML&lt;/code&gt; block in Org Mode 8, and that didn't trigger the syntax highlighting. Had I used lowercases as in &lt;code&gt;#+begin_html&lt;/code&gt;, things might have looked different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, with Org Mode 9, one can get HTML highlight with any of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_export html&#xA;&amp;lt;div&amp;gt;  &#xA;&amp;lt;/div&amp;gt;&#xA;#+end_export&#xA;&#xA;#+BEGIN_EXPORT html&#xA;&amp;lt;div&amp;gt;  &#xA;&amp;lt;/div&amp;gt;&#xA;#+END_EXPORT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But not with: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_EXPORT HTML&#xA;&amp;lt;div&amp;gt;  &#xA;&amp;lt;/div&amp;gt;&#xA;#+END_EXPORT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's a screenshot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vkmpj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vkmpj.png&quot; alt=&quot;html_highlighting&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-03-31T11:49:46.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31819" PostTypeId="2" ParentId="31813" CreationDate="2017-03-31T11:59:50.807" Score="2" Body="&lt;p&gt;Emacs comes with comprehensive documentation in the form of GNU Info pages.  To access these press &lt;code&gt;C-h i&lt;/code&gt; which will take you to the toplevel menu of major topics which ought to include Emacs, the Emacs FAQ, Info, and many others.  Press 'm' to search for a named info node.  Enter (say) &quot;ediff&quot; and you'll be taken to the Ediff documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively given a command you could use &lt;code&gt;C-h F&lt;/code&gt; to search the documentation, which in this case if you enter 'ediff' will also drop you into the Ediff documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This being Emacs of course there are also many other ways :-)&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-31T11:59:50.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31820" PostTypeId="2" ParentId="27464" CreationDate="2017-03-31T12:19:08.500" Score="0" Body="&lt;p&gt;When it receives an event with the shift modifier and it can't find any corresponding binding in the keymaps, Emacs then tries a second lookup in the keymaps with the shift modifier removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So maybe that's simply what you're seeing.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-03-31T12:19:08.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31821" PostTypeId="2" ParentId="31814" CreationDate="2017-03-31T12:31:19.043" Score="1" Body="&lt;p&gt;The problem occurs because you're restarting org-mode, and by default when it starts it will set the global state to &quot;overview&quot; where only the top level headlines are visible.  This can be configured through the variable ‘org-startup-folded’ or on a per-file basis, as described by &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/org.html#Initial-visibility&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/org.html#Initial-visibility&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm no expert in mode writing, but perhaps it might be better to try and rework your code so that it doesn't try to change the major mode at all?&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-31T12:31:19.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31822" PostTypeId="2" ParentId="31812" CreationDate="2017-03-31T12:42:23.280" Score="2" Body="&lt;p&gt;From a quick scan of chess-ics.el (I've not used it myself so haven't verified this) it looks as though you ought to be able to configure &lt;code&gt;chess-ics-server-list&lt;/code&gt; to include a handle and password on a per server basis, or you should be able to set &lt;code&gt;chess-ics-handle&lt;/code&gt; and &lt;code&gt;chess-ics-password&lt;/code&gt; from your init file.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-31T12:42:23.280" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31823" PostTypeId="2" ParentId="28715" CreationDate="2017-03-31T12:48:53.387" Score="7" Body="&lt;p&gt;Here is one way to achieve what you want I think. The key is constructing a list that has what you want in it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC python :exports both :results value table :return test2&#xA;import pandas as pd&#xA;test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})&#xA;test2 = [list(test)] + [None] + test.values.tolist()&#xA;#+END_SRC&#xA;#+RESULTS:&#xA;|    A |   B |&#xA;|------+-----|&#xA;| 1000 |  60 |&#xA;| 1000 | 100 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-03-31T12:48:53.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31824" PostTypeId="1" CreationDate="2017-03-31T13:21:26.760" Score="0" ViewCount="282" Body="&lt;p&gt;In recent weeks, &lt;code&gt;(require 'package)&lt;/code&gt; takes &lt;strong&gt;minutes&lt;/strong&gt;.  This only happens on Windows, not on macOS or GNU/Linux.  What is going on?  &lt;code&gt;emacs-version&lt;/code&gt; is &lt;code&gt;GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-11-15&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Resolution (see below):  It turned out &lt;strong&gt;not to be a problem with Emacs&lt;/strong&gt; at all.&lt;/p&gt;&#xA;" OwnerUserId="2235" LastEditorUserId="2235" LastEditDate="2017-03-31T18:07:36.563" LastActivityDate="2017-03-31T18:07:36.563" Title="(require 'package) is newly very slow on Windows" Tags="|package|debugging|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31825" PostTypeId="1" CreationDate="2017-03-31T14:08:00.387" Score="4" ViewCount="5715" Body="&lt;p&gt;I'm trying to upgrade &lt;code&gt;org&lt;/code&gt; in my setup by following the instructions &lt;a href=&quot;http://orgmode.org/worg/org-faq.html#installing-via-elpa&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; but I don't see org listed as an option.  The instructions say to report it as a discrepancy but I'm thinking it's more likely something on my end since I haven't seen it there for a while and figure someone else would have reported by now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm on Windows with Emacs 25.1.1.  I've tried emacs -q then &lt;code&gt;package-refresh-contents&lt;/code&gt; and can see the other packages listed at &lt;a href=&quot;http://elpa.gnu.org/packages/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://elpa.gnu.org/packages/&lt;/a&gt; but not &lt;code&gt;org&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13358" LastEditorUserId="13358" LastEditDate="2017-03-31T14:22:18.953" LastActivityDate="2018-05-10T18:34:14.583" Title="Can't Install org Through Package Manager" Tags="|org-mode|package|microsoft-windows|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31826" PostTypeId="1" AcceptedAnswerId="31827" CreationDate="2017-03-31T14:48:15.020" Score="7" ViewCount="2451" Body="&lt;p&gt;I'm using use-package in my init.el for all my package installations and configuration. I thought specifying &lt;code&gt;:ensure t&lt;/code&gt; in use-package would make sure I always have the latest versions installed. But when I did &lt;code&gt;M-x package-list-packages&lt;/code&gt; the minibuffer tells me I have a number of package updates waiting. Isn't it enough to specify &lt;code&gt;:ensure t&lt;/code&gt; in use-package, do I have to manually check for and install updates using &lt;code&gt;M-x package-list-packages&lt;/code&gt;? What is the best way to handle updates when using use-package?&lt;/p&gt;&#xA;" OwnerUserId="14924" LastActivityDate="2017-04-03T17:57:55.430" Title="Does use-package keep packages automatically updated?" Tags="|use-package|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31827" PostTypeId="2" ParentId="31826" CreationDate="2017-03-31T15:30:32.667" Score="7" Body="&lt;p&gt;The &lt;code&gt;:ensure&lt;/code&gt; option in &lt;code&gt;use-package&lt;/code&gt; does not automatically keep packages up to date. It ensures that the package is installed. This might be useful if you pull your Emacs config on to a new machine (or are using it across several machines), because when you start up all your required packages would get installed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll still need to deal with installing updates.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-03-31T15:30:32.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31828" PostTypeId="1" AcceptedAnswerId="35617" CreationDate="2017-03-31T15:52:10.353" Score="1" ViewCount="529" Body="&lt;p&gt;Say I have an org-link like &lt;code&gt;[[file:/ftp:anonymous@ftp.gnu.org:]]&lt;/code&gt; to an FTP site that I would like to open in &lt;code&gt;dired&lt;/code&gt;. Unfortunately, when opening the link, the following is prompted:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Opening FTP connection to ftp.gnu.org...&lt;/p&gt;&#xA;&lt;p&gt;tramp-file-name-handler: FTP Error: OPEN request failed:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Upon trying it a second time, Emacs tends to crash.&lt;/p&gt;&#xA;&lt;p&gt;There is also a buffer &lt;code&gt;*ftp anonymous@ftp.gnu.org*&lt;/code&gt; which has the following content (sorry, partly in German):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Ung ltiger Hilfebefehl foo&lt;/p&gt;&#xA;&lt;p&gt;open ftp.gnu.org&lt;/p&gt;&#xA;&lt;p&gt;Verbindung mit ftp.gnu.org wurde hergestellt.&lt;/p&gt;&#xA;&lt;p&gt;220 GNU FTP server ready.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Any idea what could be going on?&#xA;(I'm under Windows with Emacs 25.1.90.1 (x86_64-w64-mingw32) using &lt;code&gt;tramp&lt;/code&gt; 2.2.13.25.2 as is.)&lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2018-02-28T06:45:24.213" Title="Problem with FTP connections under Windows" Tags="|microsoft-windows|tramp|ftp|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31829" PostTypeId="1" CreationDate="2017-03-31T17:01:52.390" Score="0" ViewCount="1377" Body="&lt;p&gt;I want to force whitespace-mode highlight line after 99 character in rust-mode (cuz this length recommended by guidelines). For other modes i want to leave this variable with default value(80). How can i do this?&lt;/p&gt;&#xA;" OwnerUserId="11619" LastActivityDate="2018-03-27T17:34:17.367" Title="Custom whitespace-line-column for specific modes in whitespace-mode" Tags="|whitespace-mode|" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31830" PostTypeId="1" AcceptedAnswerId="31848" CreationDate="2017-03-31T17:07:34.940" Score="0" ViewCount="3480" Body="&lt;p&gt;How can I get Emacs to behave the same as other programs for copy/paste (i.e. OpenOffice, Microsoft Word, etc.)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to simplify the &lt;code&gt;kill-ring&lt;/code&gt; so that it behaves like a simple clipboard. I find it complex that the kill-ring contains multiple items.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my understanding I don't lose any of my work by doing this, since I have &lt;code&gt;undo-tree&lt;/code&gt; to help me keep a history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quote from &lt;a href=&quot;https://www.gnu.org/software/emacs/tour/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs tour&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Recall that most commands which delete a large amount of text in fact&#xA;  kill it (i.e. place it in the kill ring) so you can restore it later.&#xA;  Emacs makes it very difficult to lose a lot of text permanently: in&#xA;  editors with only a single clipboard, one can easily accidentally&#xA;  delete a large chunk of text or clobber the contents of the clipboard&#xA;  (by cutting two items in succession). But in Emacs, in either of those&#xA;  cases, the lost text can easily be retrieved from the kill ring.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Please tell me how to do this. You can also add your reasoning why I shouldn't do this, or under what (infrequent) circumstances this scenario occurs.&lt;/p&gt;&#xA;" OwnerUserId="14354" LastEditorUserId="14354" LastEditDate="2017-04-01T05:42:19.817" LastActivityDate="2020-07-31T15:22:54.050" Title="how can I get Emacs kill-ring to behave like a simple clipboard buffer?" Tags="|kill-ring|undo|undo-tree-mode|" AnswerCount="4" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="31831" PostTypeId="1" CreationDate="2017-03-31T17:44:51.820" Score="2" ViewCount="260" Body="&lt;p&gt;I just updated bookmark+ package and something broke.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use &lt;code&gt;bmkp-toggle-autonamed-bookmark-set/delete&lt;/code&gt; to mark areas of interest&#xA;and return to it using:&#xA;&lt;code&gt;bmk-previous-autonamed-bookmark-repeat&lt;/code&gt; /&#xA;&lt;code&gt;bmk-next-autonamed-bookmark-repeat&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This used to be across buffers per emacs instance and it was perfect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the update, this does not work. I cannot use next or previous to visit&#xA;the bookmark. Even if I invoke it, it stays as if I did not press anything.&#xA;It does work within one buffer, but earlier this used to work across buffers.&#xA;Is there any new setting that needs to be made to make it work across buffers ?&lt;/p&gt;&#xA;" OwnerUserId="15391" LastEditorUserId="1979" LastEditDate="2017-03-31T18:04:37.243" LastActivityDate="2017-05-31T03:13:32.833" Title="Bookmark plus doesn't work as expected after upgrade" Tags="|bookmarks|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31832" PostTypeId="2" ParentId="31824" CreationDate="2017-03-31T18:06:36.603" Score="2" Body="&lt;p&gt;I followed @npostavs's guidance and it turned out, in the stack trace, that MinGHC (a Haskell environment) had a &lt;code&gt;gpg.exe&lt;/code&gt; that was on the PATH that was causing problems.  @npostavs noticed that the MinGHC project is dead, and along with the notice of MinGHC project death was a suggestion to use Stack.  (I actually have Stack on the Windows computer involved as well.)  I removed MinGHC from the Windows computer and the problem I reported went away completely.  So this was &lt;strong&gt;not an Emacs problem at all&lt;/strong&gt;, but a problem with something on the PATH that got in the way as &lt;code&gt;(require 'package)&lt;/code&gt; was trying to do its job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you Emacs community for your help and suggestions.&lt;/p&gt;&#xA;" OwnerUserId="2235" LastActivityDate="2017-03-31T18:06:36.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31833" PostTypeId="2" ParentId="31831" CreationDate="2017-03-31T19:45:56.013" Score="1" Body="&lt;p&gt;It was a bug (regression), reported by another user yesterday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I've fixed it now. Please try the latest &lt;a href=&quot;https://www.emacswiki.org/emacs/BookmarkPlus#ObtainingBookmarkPlus&quot; rel=&quot;nofollow noreferrer&quot;&gt;files from Emacs Wiki&lt;/a&gt; (or wait up to a day for them to be updated on MELPA).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know, if you still see the problem. Thx, and sorry for the trouble.&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-04-01T02:09:18.530" LastActivityDate="2017-04-01T02:09:18.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31834" PostTypeId="1" AcceptedAnswerId="31950" CreationDate="2017-03-31T19:51:37.417" Score="3" ViewCount="548" Body="&lt;p&gt;Do I have to activate something to allow Org-mode 9 to process macros?&#xA;An org-file with the following content gives me an error on export:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+MACRO CANVAS @@html:&amp;lt;div align=center&amp;gt;&amp;lt;canvas id=&quot;$1&quot;&amp;gt;&amp;lt;/canvas&amp;gt;&amp;lt;/div&amp;gt;@@&#xA;{{{CANVAS(thename)}}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would somebody be able to point me in the right direction?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;cond: Undefined Org macro: canvas; aborting&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-04-05T12:53:26.457" Title="Dealing with org-macros: Undefined org macro; aborting" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31835" PostTypeId="2" ParentId="31830" CreationDate="2017-03-31T20:22:41.217" Score="0" Body="&lt;p&gt;Have you tried using Emacs' &lt;code&gt;cua-mode&lt;/code&gt;?  This sets up key bindings that are compatible with the Common User Access (CUA) system, so C-x, C-c, and C-v behave as they do in those other applications.  I believe it should give you the behaviour that you're after.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-31T20:22:41.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31836" PostTypeId="2" ParentId="31829" CreationDate="2017-03-31T20:25:59.543" Score="0" Body="&lt;p&gt;Rather than whitespace-mode, try &lt;code&gt;column-enforce-mode&lt;/code&gt; which can be installed from Emacs MELPA.  See &lt;a href=&quot;https://github.com/jordonbiondo/column-enforce-mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jordonbiondo/column-enforce-mode&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-03-31T20:25:59.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31837" PostTypeId="2" ParentId="31825" CreationDate="2017-03-31T20:26:25.627" Score="2" Body="&lt;p&gt;Orgmode is such a large project that it has &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;its own repo&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this &lt;a href=&quot;https://www.reddit.com/r/emacs/comments/5sx7j0/how_do_i_get_usepackage_to_ignore_the_bundled/&quot; rel=&quot;nofollow noreferrer&quot;&gt;discussion on /r/emacs&lt;/a&gt; about installing a new version of Orgmode using &lt;code&gt;use-package&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-03-31T20:26:25.627" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31838" PostTypeId="1" AcceptedAnswerId="31839" CreationDate="2017-03-31T20:35:54.943" Score="0" ViewCount="176" Body="&lt;p&gt;I have a custom face defined as&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defface my-underlined&#xA;  '((t (:underline &quot;red&quot;)))&#xA;  :group 'my-group)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At some place I underline some words with something like&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(add-text-properties (match-beginning 0) (match-end 0) '(font-lock-face my-underlined)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What would be a correct way to revert this text properties set on some words (or on all words on demand) as well as restore their syntax highlight that might have existed before? Nothing with &lt;code&gt;font-lock-&lt;/code&gt; seems to work. What would be a correct way to underline and revert?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A function &lt;code&gt;underline-region&lt;/code&gt; doesn't seem to work. It just inserts &lt;code&gt;^H_&lt;/code&gt; into the text.&lt;/p&gt;&#xA;" OwnerUserId="15379" LastActivityDate="2017-03-31T20:45:59.853" Title="Revert `font-lock-face` changes" Tags="|font-lock|text-properties|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31839" PostTypeId="2" ParentId="31838" CreationDate="2017-03-31T20:45:59.853" Score="1" Body="&lt;p&gt;See the Emacs Lisp manual section on &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Changing-Properties.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;removing text properties&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;remove-list-of-text-properties&lt;/code&gt; seems to do what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://emacs.stackexchange.com/questions/12526/how-to-remove-all-text-properties-in-a-buffer&quot;&gt;related discussion&lt;/a&gt; here on the Emacs StackExchange.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-03-31T20:45:59.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31840" PostTypeId="2" ParentId="31829" CreationDate="2017-04-01T02:12:58.007" Score="0" Body="&lt;p&gt;The variable you want is &lt;code&gt;whitespace-line-column&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Specify column beyond which the line is highlighted.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It must be an integer or nil.  If nil, the ‘fill-column’ variable value is&#xA;  used.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Used when ‘whitespace-style’ includes ‘lines’ or ‘lines-tail’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Add &lt;code&gt;(setq whitespace-line-column 99)&lt;/code&gt; to your &lt;code&gt;.emacs&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2017-04-01T02:12:58.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31841" PostTypeId="1" AcceptedAnswerId="31889" CreationDate="2017-04-01T06:37:10.507" Score="1" ViewCount="394" Body="&lt;p&gt;I just got started with Emacs for around 1 week or so and I have the following question: can I make Auto Complete ignore a certain word (in a certain major mode)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concrete example: I was writing in a file in Org mode a sort of &quot;tutorial&quot; for my use and I wrote about the &lt;code&gt;&amp;lt;sTAB&lt;/code&gt; command which inserts a code snippet. Now whenever I open a file in Org mode and write &lt;code&gt;&amp;lt;s&lt;/code&gt;, it offers the completion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I prefer commiting completions with the &lt;code&gt;TAB&lt;/code&gt; key, my only choice is to &lt;code&gt;C-g&lt;/code&gt; the completion list and then &lt;code&gt;TAB&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, I think that this could serve me well for other cases also. So is it possible to make &lt;code&gt;auto-complete-mode&lt;/code&gt; &lt;em&gt;always&lt;/em&gt; ignore a certain word in a certain major mode?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's difficult enough to implement, where can I find the actual list of completions which is created? I could visit it and erase &lt;code&gt;&amp;lt;sTAB&lt;/code&gt;. I'll never write it again. :)&lt;/p&gt;&#xA;" OwnerUserId="15371" LastEditorUserId="253" LastEditDate="2017-04-02T01:54:25.420" LastActivityDate="2017-04-03T04:18:02.997" Title="Make Autocomplete ignore a word" Tags="|org-mode|completion|auto-complete-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31842" PostTypeId="1" AcceptedAnswerId="31845" CreationDate="2017-04-01T08:49:50.817" Score="0" ViewCount="130" Body="&lt;p&gt;I've been using GNU manuals of &lt;code&gt;core-utils&lt;/code&gt; and &lt;code&gt;find-utils&lt;/code&gt; and so on in GNU Emacs when I am using GNU Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are default after installing GNU Emacs on many GNU Linux distributions.  After open GNU Emacs and &lt;code&gt;C-h i&lt;/code&gt; I'll find the &lt;code&gt;core-utils&lt;/code&gt; and &lt;code&gt;find-utils&lt;/code&gt; doc if I installed &lt;code&gt;core-utils&lt;/code&gt; and &lt;code&gt;find-utils&lt;/code&gt; on my Linux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Mac, I cannot find the &lt;code&gt;core-utils&lt;/code&gt; and &lt;code&gt;find-utils&lt;/code&gt; docs.  I've heard that Mac uses FreeBSD as its kernel.  So I am wondering whether there is a &lt;code&gt;*-utils&lt;/code&gt; doc that I can install in Emacs, or there is a way to install the &lt;code&gt;*-utils&lt;/code&gt; docs of GNU Linux on a Macbook?&lt;/p&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="253" LastEditDate="2017-04-02T01:54:03.257" LastActivityDate="2017-04-02T01:54:03.257" Title="How to install `*-utils` manuals in GNU Emacs on Mac OS X?" Tags="|documentation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31844" PostTypeId="2" ParentId="31830" CreationDate="2017-04-01T09:42:04.930" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I want to simplify the kill-ring so that it behaves like a simple clipboard. I find it complex that the kill-ring contains multiple items.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can &lt;em&gt;completely ignore&lt;/em&gt; the fact that the kill ring contains multiple items if you want. If you only ever use &lt;code&gt;yank&lt;/code&gt; (&lt;kbd&gt;C-y&lt;/kbd&gt;) to paste, then you will only ever paste the most recently-killed text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless you actively tell Emacs to yank text from elsewhere in the kill-ring, it won't do that, and so you needn't care that the rest of the kill ring exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. In systems with a single-item clipboard, the paste command always pastes the most recent copy/cut text, because that is all that it &lt;em&gt;can&lt;/em&gt; do. In Emacs the yank command &lt;em&gt;also&lt;/em&gt; pastes the most recent killed text, &lt;em&gt;but if you explicitly ask it to&lt;/em&gt; it can give you something different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the only thing which could trip you up is the variety of commands that kill text (therefore changing what is on the front of the kill ring). There isn't just a single 'cut' command in Emacs, but a whole array of &lt;code&gt;kill-*&lt;/code&gt; commands with standard key bindings. Hence you might manage to add some text to the kill ring &lt;em&gt;inadvertently&lt;/em&gt; after an intentional kill, and then be surprised that your next &lt;code&gt;yank&lt;/code&gt; didn't give you the text you were expecting to get.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really would urge you to familiarise yourself with the kill ring concept, rather than trying to limit it. I've heard plenty of people bemoaning the lack of a kill ring outside of Emacs, but I think this is the first time I've ever heard of a person wishing that Emacs didn't have one either. I genuinely think you're doing yourself a disservice if you try to avoid it.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-04-01T11:42:02.037" LastActivityDate="2017-04-01T11:42:02.037" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31845" PostTypeId="2" ParentId="31842" CreationDate="2017-04-01T11:30:36.057" Score="0" Body="&lt;p&gt;One way is to use the Homebrew package manager for macOS from &lt;a href=&quot;https://brew.sh/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://brew.sh/&lt;/a&gt;.  This can simply install all manner of useful software including GNU Coreutils which will come with the associated info documentation.  Emacs' info should then automatically detect the new info pages and add them to the toplevel info directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other alternatives to Homebrew such as MacPorts (&lt;a href=&quot;https://www.macports.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.macports.org/&lt;/a&gt;) exist that will do something similar.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-04-01T11:30:36.057" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31846" PostTypeId="1" AcceptedAnswerId="31849" CreationDate="2017-04-01T11:36:25.317" Score="4" ViewCount="542" Body="&lt;p&gt;Many procedures in &lt;code&gt;Emacs&lt;/code&gt; write to the &lt;code&gt;*Messages*&lt;/code&gt; buffer. I usually kill it from time to time. My problem is that the content gets deleted once the buffer get killed. Is there a way to preserve the contents of the &lt;code&gt;*Messages*&lt;/code&gt; buffer throughout an &lt;code&gt;Emacs&lt;/code&gt; session or even throughout multiple sessions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a related topic here, but was unable to fit it to the &lt;code&gt;*Messages*&lt;/code&gt; buffer?&lt;br&gt;&#xA;&lt;a href=&quot;https://stackoverflow.com/a/1230877/2854890&quot;&gt;How can I save my mini-buffer history in Emacs?&#xA;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12007" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-04-01T13:16:57.327" Title="Save *Messages* history" Tags="|buffers|history|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31848" PostTypeId="2" ParentId="31830" CreationDate="2017-04-01T12:46:02.093" Score="7" Body="&lt;p&gt;From the various comments so far, it sounds like you are in the process of learning about Emacs (welcome!). There are many things in Emacs that are unlike other editors, and as you go through the tutorials and read about things you might come across concepts like the kill ring that seem confusing and/or unnecessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs is endlessly configurable so you can bend it to your workflow, but I would always recommend you experiment with its features before trying the change something. You might find something that seemed weird is actually really useful -- or that it isn't, but now you've got enough experience to know exactly how you would like it to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this particular case it seems like you are worried about the complexity of managing the kill ring, but perhaps have not used Emacs kill/yank commands frequently enough to see that it does not gets in the way or require any specific workflow:  this is a feature that is invisible until you ask for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are specific problems you've encountered (such as accidentally hitting &lt;code&gt;M-y&lt;/code&gt; and yanking the wrong text) then add those to the question and they can be addressed directly. You can change or remove the binding for &lt;code&gt;yank-pop&lt;/code&gt; if it gets in the way of something else. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the comment threads, it sounds like the real concern here is not the kill-ring but rather the various kill commands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In many editors: &lt;code&gt;C-x&lt;/code&gt; will cut the selected text, and &lt;code&gt;C-v&lt;/code&gt; will paste the most recently cut text. In Emacs: &lt;code&gt;C-w&lt;/code&gt; will cut the selected text, and &lt;code&gt;C-y&lt;/code&gt; will paste the most recently cut text -- same thing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In many editors, you can select some text and hit backspace to delete that text without saving it anywhere. In Emacs you can do the same thing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference is that most editors have only one command to cut text. Emacs has that, but also has commands to cut things &lt;em&gt;without&lt;/em&gt; having to select them first: the rest of the line (&lt;code&gt;C-k&lt;/code&gt;), the next word (&lt;code&gt;M-d&lt;/code&gt;), a sentence, an expression, and so on. These are variations of the cut command: use any one of them, then use &lt;code&gt;C-y&lt;/code&gt; to paste the most recently cut bit of text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For every cut (&lt;code&gt;kill-&lt;/code&gt;) command in Emacs you could define another command to do the same thing without saving to a clipboard. For example you could have &lt;code&gt;delete-line&lt;/code&gt;, &lt;code&gt;delete-word&lt;/code&gt;, &lt;code&gt;delete-sentence&lt;/code&gt;, &lt;code&gt;delete-sexp&lt;/code&gt;, etc. Then you have the choice to delete or cut anything you want -- but you double the number of commands and key bindings, and every time you want to remove some chunk of text you need to decide whether you want to save it for later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Emacs approach is to provide the &quot;cut&quot; versions of all these commands, but to maintain a longer history. You can freely cut text in many places and will be able to find it and paste it again if needed. Otherwise you can ignore the history and always paste the most recently cut text using &lt;code&gt;C-y&lt;/code&gt;, as usual. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other editors I'm aware of don't (ok, ignoring vi[m]) have commands to delete up to the end of the line or sentence, delete the next expression or next 3 words, etc. You would do that by highlighting the text and then either hitting cut or backspace -- which you can do in Emacs too. So asking for these special commands to behave as they do in other editors is confusing: they don't exist elsewhere. If you want to use them, it's worth trying out the default behavior before deciding it is too complicated. If you end up deciding this is really not what you want, it is fairly easy to define new delete-xxx commands that are similar to the kill-xxx commands you actually find useful. &lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2017-04-03T00:25:34.983" LastActivityDate="2017-04-03T00:25:34.983" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="31849" PostTypeId="2" ParentId="31846" CreationDate="2017-04-01T13:15:38.700" Score="6" Body="&lt;p&gt;You can use &lt;code&gt;kill-buffer-query-functions&lt;/code&gt; to prevent certain buffers from being killed inadvertently. I use something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom buffer-protect-buffers '(&quot;*scratch*&quot; &quot;*Messages*&quot;)&#xA;  &quot;List of buffer names to protect.&quot;&#xA;  :type '(repeat string)&#xA;  :group 'buffer-protect)&#xA;&#xA;(defun buffer-protect-protected-p (buffer)&#xA;  &quot;Return non-nil if BUFFER is protected.&quot;&#xA;  (member buffer buffer-protect-buffers))&#xA;&#xA;(defun buffer-protect-kill-buffer-query-function ()&#xA;  &quot;Bury a protected buffer and don't allow it to be killed.&quot;&#xA;  (let ((buf (buffer-name)))&#xA;    (if (buffer-protect-protected-p buf)&#xA;        (with-current-buffer buf&#xA;          (progn (bury-buffer) nil))&#xA;      t)))&#xA;&#xA;(add-hook 'kill-buffer-query-functions #'buffer-protect-kill-buffer-query-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this setup the scratch and message buffers will not be killed during your Emacs session. You can customize the &lt;code&gt;buffer-protect-buffers&lt;/code&gt; list to protect other things. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't believe you can maintain your &lt;code&gt;*Messages*&lt;/code&gt; buffer across sessions. You can save the buffer to a text file using the normal &lt;code&gt;write-file&lt;/code&gt; command, but there is no way to restore its content to the actual &lt;code&gt;*Messages*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-04-01T13:15:38.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31850" PostTypeId="2" ParentId="31846" CreationDate="2017-04-01T13:16:57.327" Score="3" Body="&lt;p&gt;You should be able to save it to a file just like any other buffer - switch to it with &lt;code&gt;C-h e&lt;/code&gt; and then save it to a named file with &lt;code&gt;C-x C-w&lt;/code&gt;.  This will save the current contents of the buffer but note that as it continues to update those changes won't appear in the saved file.  If you really wanted to save it all (although I'm not really sure why this would be useful) you could add a function to do this to &lt;code&gt;kill-emacs-hook&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-04-01T13:16:57.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31851" PostTypeId="2" ParentId="31726" CreationDate="2017-04-01T14:45:51.700" Score="3" Body="&lt;p&gt;Consider using &lt;code&gt;term-mode&lt;/code&gt; rather than &lt;code&gt;shell-mode&lt;/code&gt;.  In &lt;code&gt;term-mode&lt;/code&gt; you can switch between &quot;character mode&quot; (where commands like &lt;code&gt;C-r&lt;/code&gt; go directly to the terminal) and &quot;line mode&quot; (where commands are first interpreted by Emacs).  &lt;code&gt;C-c C-j&lt;/code&gt; activates line mode and &lt;code&gt;C-c C-k&lt;/code&gt; character mode.  Character mode gives &lt;code&gt;C-r&lt;/code&gt; the behavior you want while line mode makes the terminal act more like a normal Emacs buffer.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2017-04-01T14:45:51.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31852" PostTypeId="1" AcceptedAnswerId="31864" CreationDate="2017-04-01T15:45:20.907" Score="3" ViewCount="60" Body="&lt;p&gt;Does Emacs or any packages provide a &lt;code&gt;transpose-page&lt;/code&gt; command?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the &lt;code&gt;C-x [&lt;/code&gt; and &lt;code&gt;C-x ]&lt;/code&gt; and forward or backward page, but many times I just want to transpose two adjacent pages, especially when in some Major Modes where pages are defined to be some group of special things.&lt;/p&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="253" LastEditDate="2017-04-02T01:50:06.397" LastActivityDate="2017-04-02T01:50:06.397" Title="is there a `transpose-page` command?" Tags="|text-editing|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31853" PostTypeId="1" AcceptedAnswerId="31869" CreationDate="2017-04-01T17:11:18.170" Score="2" ViewCount="1016" Body="&lt;p&gt;It seems that &lt;code&gt;replace-regexp&lt;/code&gt; has a different behavior if called interactively and not, but I do not understand why, and how to get the wanted behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want is the non-interactive equivalent of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x replace-regexp RET foo1 RET foo\#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which, if called on buffer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo1&#xA;foo1&#xA;foo1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;creates&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foo0&#xA;foo1&#xA;foo2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, non-interactively, the naive&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp &quot;foo1&quot; &quot;foo\\#&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yields&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;Invalid use of '\' in replacement text&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same happens with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(funcall-interactive &quot;foo1&quot; &quot;foo\\#&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And singling or doubling the backslashes give the expected (unwanted) results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(replace-regexp &quot;foo1&quot; &quot;foo\#&quot;)&#xA;;; foo#&#xA;;; foo#&#xA;;; foo#&#xA;&#xA;(replace-regexp &quot;foo1&quot; &quot;foo\\\\#&quot;)&#xA;;; foo\#&#xA;;; foo\#&#xA;;; foo\#&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, running &lt;code&gt;call-interactively&lt;/code&gt; works, but in my use-case the regexp and replacement string will be crafted by elisp code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running a loop searching and replacing would probably work, but is it really the only solution? It seems hard to believe.&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2017-04-02T08:18:10.503" Title="&quot;Invalid use of '\' in replacement text&quot; with non-interactive calls" Tags="|regular-expressions|replace|interactive|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31855" PostTypeId="1" AcceptedAnswerId="31856" CreationDate="2017-04-01T18:16:00.763" Score="2" ViewCount="94" Body="&lt;p&gt;While doing statistical work in ESS, I often want to evaluate everything from the top of buffer to point. This is to make sure that my analysis is reproducible (i.e. script can be run from top to bottom and gives the right result).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do this in ESS?&lt;/p&gt;&#xA;" OwnerUserId="15312" LastActivityDate="2017-04-01T18:28:49.917" Title="Is there a way to evaluate from top of buffer to point?" Tags="|ess|eval|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31856" PostTypeId="2" ParentId="31855" CreationDate="2017-04-01T18:28:49.917" Score="4" Body="&lt;p&gt;The function you are looking for is &lt;code&gt;ess-eval-buffer-from-beg-to-here&lt;/code&gt; (bound to &lt;code&gt;C-c &amp;lt;C-up&amp;gt;&lt;/code&gt; by default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this using &lt;code&gt;M-x apropos &quot;ess eval&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastActivityDate="2017-04-01T18:28:49.917" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31857" PostTypeId="1" AcceptedAnswerId="31863" CreationDate="2017-04-01T19:34:18.513" Score="0" ViewCount="157" Body="&lt;p&gt;I want to be able to switch between &quot;Consolas-12&quot; and &quot;Georgia-13&quot; using key bindings. Can I do that? How?  &lt;/p&gt;&#xA;" OwnerUserId="15401" LastEditorUserId="105" LastEditDate="2017-04-02T00:17:36.077" LastActivityDate="2017-04-02T00:17:36.077" Title="Key binding for changing font face" Tags="|key-bindings|fonts|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31858" PostTypeId="1" AcceptedAnswerId="31861" CreationDate="2017-04-01T19:59:24.990" Score="0" ViewCount="56" Body="&lt;p&gt;I have a command file that uses syntax such as &lt;code&gt;-TAG &amp;lt;ARGS&amp;gt; -TAG-&lt;/code&gt; to pass arguments to a sub program. I want to Highlight everything between the opening and closing tags with specific background color to make then easy to find, but not change the faces used for the foreground. Is there a way to do this with Emacs font locks without having to define two faces for everything (one with a background and one without)?&lt;/p&gt;&#xA;" OwnerUserId="12269" LastEditorUserId="105" LastEditDate="2017-04-02T00:17:26.487" LastActivityDate="2017-04-02T07:08:15.880" Title="Apply a background to code with font-lock" Tags="|faces|font-lock|syntax-highlighting|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31859" PostTypeId="1" AcceptedAnswerId="31997" CreationDate="2017-04-01T20:08:10.600" Score="4" ViewCount="1959" Body="&lt;p&gt;In particular, I have a blue cursor (and highlighted window), which seems to correspond with spacemacs' &lt;a href=&quot;http://boyanangelov.com/spacemacs/doc/DOCUMENTATION.html#orgheadline50&quot; rel=&quot;nofollow noreferrer&quot;&gt;Emacs mode&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'd like to put that color to yellow or something else. Don't see that in the &lt;a href=&quot;http://boyanangelov.com/spacemacs/doc/DOCUMENTATION.html#orgheadline64&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Color themes&quot; section&lt;/a&gt; of Spacemacs' guide. And I don't seem to have a &lt;code&gt;cursor-color&lt;/code&gt; variable, as &lt;a href=&quot;https://emacs.stackexchange.com/questions/392/how-to-change-the-cursor-type-and-color&quot;&gt;described here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we tweak the cursor and highlighted window color, without changing modes?&lt;/p&gt;&#xA;" OwnerUserId="10528" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-04-09T23:39:19.563" Title="Howto to change color of cursor and highlighted window in spacemacs" Tags="|spacemacs|themes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31860" PostTypeId="1" AcceptedAnswerId="31885" CreationDate="2017-04-01T20:14:16.643" Score="2" ViewCount="903" Body="&lt;p&gt;Problems with my modeline separator aren't quite the &lt;em&gt;&quot;Ugly separators&quot;&lt;/em&gt; problem as &lt;a href=&quot;http://boyanangelov.com/spacemacs/doc/DOCUMENTATION.html#orgheadline65&quot; rel=&quot;nofollow noreferrer&quot;&gt;seen here&lt;/a&gt;. But the color is slightly off, as in this screenshot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/eEJf5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eEJf5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can solve it with this piece of code. But then everything just looks more drab. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq ns-use-srgb-colorspace nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way of fixing the modeline color skew while keeping a full color pallette (or srgb-colorspace)? This is the &lt;a href=&quot;https://github.com/syl20bnr/spacemacs#automatic-update-on-master-branch&quot; rel=&quot;nofollow noreferrer&quot;&gt;color balance&lt;/a&gt; I expect to have.&lt;/p&gt;&#xA;" OwnerUserId="10528" LastActivityDate="2019-07-01T09:52:37.957" Title="Spacemacs modeline color mismatch" Tags="|spacemacs|themes|colors|configuration-files|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31861" PostTypeId="2" ParentId="31858" CreationDate="2017-04-01T20:38:16.167" Score="1" Body="&lt;p&gt;If you specify &lt;code&gt;prepend&lt;/code&gt; or &lt;code&gt;append&lt;/code&gt; as the OVERRIDE flag in a font-lock keyword, the two faces are joined.&lt;/p&gt;&#xA;" OwnerUserId="897" LastEditorUserId="897" LastEditDate="2017-04-02T07:08:15.880" LastActivityDate="2017-04-02T07:08:15.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31863" PostTypeId="2" ParentId="31857" CreationDate="2017-04-01T22:18:48.480" Score="3" Body="&lt;p&gt;Are you looking to set the default font as you might with the &quot;Options -&gt; Set default font...&quot; menu item?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relevant command is &lt;code&gt;set-frame-font&lt;/code&gt;. You can write a command to toggle between two (or more) fonts like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defcustom my-default-fonts&#xA;  '(&quot;Consolas-12&quot; &quot;Georgia-13&quot;) &quot;List of default fonts&quot;)&#xA;&#xA;(defun toggle-frame-font ()&#xA;  &quot;Toggle between default fonts.&quot;&#xA;  (interactive)&#xA;  (add-to-list 'my-default-fonts (pop my-default-fonts) t) ; rotate list&#xA;  (set-frame-font (car my-default-fonts) nil t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then bind it to key, for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;&amp;lt;f11&amp;gt;&quot;) #'toggle-frame-font)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-04-01T22:18:48.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31864" PostTypeId="2" ParentId="31852" CreationDate="2017-04-01T23:15:47.293" Score="4" Body="&lt;p&gt;The &quot;transpose&quot; functionality is beautifully abstracted such that to implement a new variant you need only give it a single function which knows how to move backward and forward over the thing in question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Emacs doesn't provide &lt;code&gt;transpose-pages&lt;/code&gt; by default, but it &lt;em&gt;does&lt;/em&gt; provide the &lt;code&gt;forward-page&lt;/code&gt; function we need, and so it is trivial to write the new command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I've copied and pasted &lt;code&gt;transpose-paragraphs&lt;/code&gt; and substituted &quot;page&quot; appropriately.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun transpose-pages (arg)&#xA;  &quot;Interchange the current page with the next one.&#xA;With prefix argument ARG a non-zero integer, moves the current&#xA;page past ARG pages, leaving point after the current page.&#xA;If ARG is positive, moves the current page forwards, if&#xA;ARG is negative moves it backwards.  If ARG is zero, exchanges&#xA;the current page with the one containing the mark.&quot;&#xA;  (interactive &quot;*p&quot;)&#xA;  (transpose-subr 'forward-page arg))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-04-01T23:15:47.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31865" PostTypeId="2" ParentId="30516" CreationDate="2017-04-02T04:12:58.647" Score="1" Body="&lt;p&gt;I recently faced the same problem. Searching around, I found &lt;a href=&quot;https://www.emacswiki.org/emacs/centered-cursor-mode.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;centered-cursor-mode&lt;/a&gt;.  It does not solve the problem directly, but by enabling it when looking at search results, I solved the problem well enough for my needs.  Perhaps it will work for you as well.&lt;/p&gt;&#xA;" OwnerUserId="15403" LastActivityDate="2017-04-02T04:12:58.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31866" PostTypeId="1" CreationDate="2017-04-02T06:31:26.920" Score="1" ViewCount="699" Body="&lt;p&gt;I'm new to Emacs. Been a vim user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;code&gt;M-x customize-face&lt;/code&gt;, irrespective of what font I set it to, Emacs always ends up using &lt;code&gt;Inconsolata-g for Powerline&lt;/code&gt; font. Default is &lt;code&gt;DejaVu Sans Mono&lt;/code&gt;. I tried removing &lt;code&gt;.emacs.d&lt;/code&gt; directory as well as emacs (package itself), but neither helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I do:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;M-x customize-face default&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Set it to, say, &lt;code&gt;Ubuntu Mono Regular&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hit &lt;code&gt;Apply&lt;/code&gt; and things look good&lt;/li&gt;&#xA;&lt;li&gt;So I hit &lt;code&gt;State&lt;/code&gt; and choose option &lt;code&gt;#1&lt;/code&gt; which stores it to &lt;code&gt;~/.emacs&lt;/code&gt; (for fresh install; I use &lt;code&gt;~/.emacs/init.el&lt;/code&gt; instead - not sure which is better of two)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;C-x C-c&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Start emacs again and the font is set back to &lt;code&gt;Inconsolata-g for Powerline&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How do I get rid of what I'm seeing on step 6 here? I saved &lt;code&gt;~/.emacs&lt;/code&gt; to &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; and here are its contents:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ cat .emacs.d/init.el &#xA;(custom-set-variables&#xA; ;; custom-set-variables was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; )&#xA;(custom-set-faces&#xA; ;; custom-set-faces was added by Custom.&#xA; ;; If you edit it by hand, you could mess it up, so be careful.&#xA; ;; Your init file should contain only one such instance.&#xA; ;; If there is more than one, they won't work right.&#xA; '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry &quot;PfEd&quot; :family &quot;Ubuntu Mono Regular&quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15384" LastEditorUserId="15384" LastEditDate="2017-04-02T07:13:05.157" LastActivityDate="2018-04-28T11:39:35.650" Title="Restarting emacs changes default font" Tags="|init-file|fonts|customize|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31867" PostTypeId="1" AcceptedAnswerId="31870" CreationDate="2017-04-02T07:20:44.623" Score="1" ViewCount="1366" Body="&lt;p&gt;The &lt;a href=&quot;http://orgmode.org/manual/Tag-inheritance.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Org Manual&lt;/a&gt; says that a child headline will inherit all the tags from its parent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What function should I use to give me a list of all these tags?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;org-get-tags&lt;/code&gt; and &lt;code&gt;org-get-local-tags&lt;/code&gt; both seem to be giving me only the tag that is present only on the current headline.&lt;/p&gt;&#xA;" OwnerUserId="9690" LastActivityDate="2017-04-02T08:24:48.337" Title="How do I get all the tags on a headline, including the inherited ones?" Tags="|org-mode|org-tags|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31868" PostTypeId="1" AcceptedAnswerId="31871" CreationDate="2017-04-02T07:59:53.913" Score="2" ViewCount="362" Body="&lt;p&gt;I have just installed Magit from Melpa as per &lt;a href=&quot;https://magit.vc/manual/magit.html#Installing-from-an-Elpa-Archive&quot; rel=&quot;nofollow noreferrer&quot;&gt;the instructions in the official Magit manual&lt;/a&gt;. I then proceeded to follow the manual's &lt;a href=&quot;https://magit.vc/manual/magit.html#Post_002dInstallation-Tasks&quot; rel=&quot;nofollow noreferrer&quot;&gt;Post-Installation Tasks&lt;/a&gt; section, which states&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;After installing Magit you should verify that you are indeed using the Magit, Git, and Emacs releases you think you are using. [...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;M-x magit-version RET&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;should display something like&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;Magit 2.8.0, Git 2.10.2, Emacs 25.1.1, gnu/linux&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The results of my running &lt;code&gt;M-x magit-version RET&lt;/code&gt; are&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;Magit 20170401.1145, Git (unknown), Emacs 25.1.1, darwin&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem to match the expected output.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The Magit version number doesn't have the expected format.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Git does not have a version number at all.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is this a problem? If so, what should I do to fix it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempted Steps&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Is Git installed on my system?&lt;/strong&gt; Opening a Terminal window and running &lt;code&gt;git --version&lt;/code&gt; yields &lt;code&gt;git version 2.10.1&lt;/code&gt;. In particular, &lt;strong&gt;Git is installed on my system&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Are the Git executables on emacs' &lt;code&gt;PATH&lt;/code&gt;?&lt;/strong&gt; Evaluating &lt;code&gt;(getenv &quot;PATH&quot;)&lt;/code&gt; in emacs yields a string that starts with &lt;code&gt;/usr/bin&lt;/code&gt;. Opening a Terminal window and running &lt;code&gt;ls /usr/bin&lt;/code&gt; brings up a list that includes &lt;code&gt;git&lt;/code&gt;. So &lt;strong&gt;the Git executables are on emacs' &lt;code&gt;PATH&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Are the Git executables on emacs' &lt;code&gt;exec-path&lt;/code&gt;?&lt;/strong&gt; Checking the value of emacs' &lt;code&gt;exec-path&lt;/code&gt; variable by entering &lt;code&gt;C-h v exec-path RET&lt;/code&gt; in emacs yields a string that starts with &lt;code&gt;&quot;/usr/bin&quot;&lt;/code&gt;, so &lt;strong&gt;the Git executables are on emacs' &lt;code&gt;exec-path&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Maybe the Git executables that the shell uses are in a different place than &lt;code&gt;/usr/bin/&lt;/code&gt;. Try running &lt;code&gt;which git&lt;/code&gt; from a Terminal window.&lt;/strong&gt; I ran &lt;code&gt;which git&lt;/code&gt; from a Terminal window, and indeed the result was different to &lt;code&gt;/usr/bin/&lt;/code&gt;, namely &lt;code&gt;/usr/local/bin/&lt;/code&gt;. So I added the following lines of code to my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setenv &quot;PATH&quot; (concat (getenv &quot;PATH&quot;) &quot;:/usr/local/bin/&quot;))&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;(setq exec-path (append exec-path '(&quot;/usr/local/bin/&quot;)))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and restarted Emacs, but the problem remained. So, &lt;strong&gt;yes, the Git executables that the shell uses are indeed in a different place, but appending the correct location to the end of &lt;code&gt;PATH&lt;/code&gt;/&lt;code&gt;exec-path&lt;/code&gt; has no effect.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;If appending to &lt;code&gt;PATH&lt;/code&gt;/&lt;code&gt;exec-path&lt;/code&gt; doesn't do the trick, how about prepending?&lt;/strong&gt; I added the following lines of code to my &lt;code&gt;.emacs&lt;/code&gt; file:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setenv &quot;PATH&quot; (concat &quot;/usr/local/bin/:&quot; (getenv &quot;PATH&quot;)))&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;(setq exec-path (append '(&quot;/usr/local/bin/&quot;) exec-path))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;strong&gt;now it works!&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;An alternative solution:&lt;/strong&gt; Taking a lead from a comment by npostavs below, I installed Xcode from the Apple store, restarted my computer (not sure this step was necessary; I decided to do this on my own), and ran &lt;code&gt;sudo xcodebuild -license&lt;/code&gt; from a Terminal window to accept Xcode's license agreement. Now Magit works even without modifying Emac's &lt;code&gt;PATH&lt;/code&gt; and &lt;code&gt;exec-path&lt;/code&gt;, and also the Git version is more up-to-date (it was &lt;code&gt;2.10.1&lt;/code&gt; before; now it's &lt;code&gt;2.11.0 (Apple Git-81)&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside is that Xcode takes a big chunk of memory (4.53 GB), it has received many very bad reviews on the Apple store, I had to sign a license agreement with Apple, and aside from the convenience of not having to modify the Emacs path for Magit to work, I have no use for this mammoth, since I'm not an Apple developer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Operating system: macOS Sierra, Version 10.12.4&lt;br&gt;&#xA;Emacs version: 25.1.1&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="4084" LastEditDate="2017-04-03T16:47:33.630" LastActivityDate="2017-04-03T17:24:06.803" Title="Magit version post-installation does not look as in the manual" Tags="|magit|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31869" PostTypeId="2" ParentId="31853" CreationDate="2017-04-02T08:18:10.503" Score="3" Body="&lt;p&gt;(Credits go to &lt;a href=&quot;https://emacs.stackexchange.com/users/2370/tobias&quot;&gt;Tobias&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;replace-regexp&lt;/code&gt; (and &lt;code&gt;query-replace-regexp&lt;/code&gt;) have their second read argument malaxed into a suitable form for the elisp call. In particular, in case the replacement string contains elisp forms, it is turned into a quoted elisp expression by the function &lt;code&gt;query-replace-compile-replacement&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is actually written explicitely in the documentation for &lt;code&gt;query-replace-regexp&lt;/code&gt;... once you know what to look for:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When using those Lisp features interactively in the replacement&#xA;  text, TO-STRING is actually made a list instead of a string.&#xA;  Use C-x M-: after this command for details.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Anyway, it turns out that replacing &lt;code&gt;&quot;foo\\#&quot;&lt;/code&gt; with `(query-replace-compile-replacement &quot;foo\#&quot; t) works for my purpose. And the entire call, with elisp-supplied strings and just enough interactivity,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((from-string &quot;foo1&quot;)&#xA;      (to-string &quot;foo\\#&quot;))&#xA;   (funcall-interactively #'query-replace-regexp&#xA;                          from-string&#xA;                          (query-replace-compile-replacement to-string t)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works as intended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="184" LastActivityDate="2017-04-02T08:18:10.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31870" PostTypeId="2" ParentId="31867" CreationDate="2017-04-02T08:24:48.337" Score="4" Body="&lt;p&gt;The function &lt;code&gt;org-get-tags-at&lt;/code&gt; is a means by which to obtain a list of tags that can include or exclude those that are inherited based upon the second optional argument &lt;code&gt;LOCAL&lt;/code&gt;.  For a description of this particular function, see the doc-string:  &lt;code&gt;C-h f&lt;/code&gt; or &lt;code&gt;M-x describe-function&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-04-02T08:24:48.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31871" PostTypeId="2" ParentId="31868" CreationDate="2017-04-02T08:29:04.610" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The Magit version number doesn't have the expected format.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;All version numbers on Melpa (non-stable) are just timestamps. So this is expected. But this &lt;a href=&quot;https://github.com/melpa/melpa/issues/2955&quot; rel=&quot;nofollow noreferrer&quot;&gt;might be changed eventually&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Git does not have a version number at all.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That could mean that Magit is not able to find any &lt;code&gt;git&lt;/code&gt; executable, which of course would be a big problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are actually able to use Magit, then please post the output of &lt;code&gt;git version&lt;/code&gt;, because another possibility is that it prints something we did not expect.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Progress, at last! Hurrah! What now?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We have established that I was right all along. Your shell is configured correctly to use the &lt;code&gt;git&lt;/code&gt; that you have installed, but that configuration does not carry over to an Emacs instance that was started by clicking on an icon. The reason for this is that Emacs does not read your shell's configuration files, which makes sense because it is a different application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You now have to customize Emacs to use the same &lt;code&gt;git&lt;/code&gt; executable by configuring &lt;code&gt;exec-path&lt;/code&gt; correctly. There are multiple ways of doing that and doing it by hand is what I recommend. Based on the information you have provided I would assume that &lt;code&gt;(push &quot;/usr/local/bin&quot; exec-path)&lt;/code&gt; should do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option would be to configure Emacs'&lt;code&gt;exec-path&lt;/code&gt; based on your shell's configuration, even when Emacs isn't started from a shell by using the &lt;a href=&quot;https://github.com/purcell/exec-path-from-shell&quot; rel=&quot;nofollow noreferrer&quot;&gt;exec-path-from-shell&lt;/a&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="306" LastEditorUserId="306" LastEditDate="2017-04-03T17:24:06.803" LastActivityDate="2017-04-03T17:24:06.803" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="31872" PostTypeId="1" AcceptedAnswerId="31874" CreationDate="2017-04-02T08:43:04.140" Score="41" ViewCount="26132" Body="&lt;p&gt;I'm using &lt;code&gt;use-package&lt;/code&gt; to install and configure packages (most of these packages are in melpa).&#xA;Is there a clean automated way of keeping all these packages up-to-date ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what is the best work flow in this case ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; A very similar question &lt;a href=&quot;https://emacs.stackexchange.com/questions/31826/does-use-package-keep-packages-automatically-updated&quot;&gt;here&lt;/a&gt; with an answer, but I wanted a clarification on &quot;You'll still need to deal with installing updates&quot;.&#xA;I could not comment on the answer for clarification as I do not have enough reputation.&lt;/p&gt;&#xA;" OwnerUserId="15405" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2023-11-14T04:01:44.430" Title="How to update packages installed with use-package" Tags="|use-package|" AnswerCount="7" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31874" PostTypeId="2" ParentId="31872" CreationDate="2017-04-02T12:44:46.593" Score="40" Body="&lt;p&gt;I just do this manually: run &lt;code&gt;list-packages&lt;/code&gt; hit &lt;code&gt;U&lt;/code&gt;to mark available upgrades, then review to decide if there are any I don't want to pick up. Then &lt;code&gt;x&lt;/code&gt; to upgrade. I do this pretty regularly, and often check what's new at the same time. I've got a couple tweaks to simplify this (see below).&lt;/p&gt;&#xA;&lt;p&gt;I suspect upgrading could be automated, but you do want to consider the case where an update breaks something and you need to back it out and then prevent your automated updater from just installing it again.&lt;/p&gt;&#xA;&lt;p&gt;Some package menu tweaks:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun package-menu-find-marks ()&#xA;  &amp;quot;Find packages marked for action in *Packages*.&amp;quot;&#xA;  (interactive)&#xA;  (occur &amp;quot;^[A-Z]&amp;quot;))&#xA;&#xA;;; Only in Emacs 25.1+&#xA;(defun package-menu-filter-by-status (status)&#xA;  &amp;quot;Filter the *Packages* buffer by status.&amp;quot;&#xA;  (interactive&#xA;   (list (completing-read&#xA;          &amp;quot;Status: &amp;quot; '(&amp;quot;new&amp;quot; &amp;quot;installed&amp;quot; &amp;quot;dependency&amp;quot; &amp;quot;obsolete&amp;quot;))))&#xA;  (package-menu-filter (concat &amp;quot;status:&amp;quot; status)))&#xA;&#xA;(define-key package-menu-mode-map &amp;quot;s&amp;quot; #'package-menu-filter-by-status)&#xA;(define-key package-menu-mode-map &amp;quot;a&amp;quot; #'package-menu-find-marks)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With this I can use &lt;code&gt;s new&lt;/code&gt; to just see what packages are newly available. And after hitting &lt;code&gt;U&lt;/code&gt; to mark upgrades I can hit &lt;code&gt;a&lt;/code&gt; for an occur buffer list of the ones that were marked, in case I want to dig in to details of what changed etc.&lt;/p&gt;&#xA;&lt;p&gt;UPDATED: Emacs 28 added new package menu commands to filter the package list in various ways, replacing the need for the custom commands above. Use &lt;code&gt;/-?&lt;/code&gt; to see the available &lt;code&gt;package-menu-filter-*&lt;/code&gt; bindings.&lt;/p&gt;&#xA;" OwnerUserId="780" LastEditorUserId="780" LastEditDate="2022-09-01T20:31:16.873" LastActivityDate="2022-09-01T20:31:16.873" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="31875" PostTypeId="1" AcceptedAnswerId="31969" CreationDate="2017-04-02T12:48:51.393" Score="1" ViewCount="164" Body="&lt;p&gt;When I type a loop keyword (&lt;code&gt;for&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt;, &lt;code&gt;do&lt;/code&gt;) in perl program, emacs automatically inserts brackets and parenthesizes to complete the loop structure. I would like to disable this but I'm not sure what is actually doing it. I have CPerl, Flymake, AC, Outl, and Abbrev modes loaded.&lt;/p&gt;&#xA;" OwnerUserId="9507" LastActivityDate="2017-04-06T14:05:14.830" Title="Disable loop completion when programming perl" Tags="|auto-complete-mode|programming|perl|" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31876" PostTypeId="1" AcceptedAnswerId="31887" CreationDate="2017-04-02T14:28:14.273" Score="0" ViewCount="575" Body="&lt;p&gt;I am trying to use &lt;code&gt;org-crypt&lt;/code&gt; but cannot find where exactly is this package hosted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'package)&#xA;    (add-to-list 'package-archives '(&quot;melpa&quot; .   &quot;http://melpa.milkbox.net/packages/&quot;) t)&#xA;    (add-to-list 'package-archives '(&quot;org&quot; . &quot;http://orgmode.org/elpa/&quot;) t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then trying to use &lt;code&gt;use-package&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org-crypt&#xA;:ensure t&#xA;:config&#xA;(org-crypt-use-before-save-magic)&#xA;(setq org-tags-exclude-from-inheritance (quote (&quot;crypt&quot;)))&#xA;(setq org-crypt-key nil)&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this results in &lt;code&gt;package 'org-crypt-' unavailable&lt;/code&gt;.&#xA;I cant find it in the package list too when I check with &lt;code&gt;list-packages&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="15405" LastActivityDate="2017-04-03T04:07:03.103" Title="Where is `org-crypt` ? Need to install it with `use-package`" Tags="|org-mode|use-package|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31877" PostTypeId="2" ParentId="31866" CreationDate="2017-04-02T15:18:29.353" Score="1" Body="&lt;p&gt;This sounds like &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25228&quot; rel=&quot;nofollow noreferrer&quot;&gt;bug #25228&lt;/a&gt;: &lt;em&gt;GNU emacs 25.1: &lt;strong&gt;custom-set-faces from init file ~/.emacs ignored&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at that, and see if it doesn't correspond to your scenario.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-04-02T15:18:29.353" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31878" PostTypeId="1" AcceptedAnswerId="34598" CreationDate="2017-04-02T17:03:46.027" Score="5" ViewCount="1004" Body="&lt;p&gt;I have simple code blocks that I would like to show the noweb generated source for inside the same org-mode file.  eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: example&#xA;#+BEGIN_SRC java :classname Test :results code  :exports both :tangle yes :noweb yes&#xA;&#xA;&amp;lt;&amp;lt;preface&amp;gt;&amp;gt;&#xA;String result = &quot;hello world&quot;;&#xA;&amp;lt;&amp;lt;end&amp;gt;&amp;gt;&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;preface&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; are something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: teststart&#xA;#+BEGIN_SRC java  +n :results none :exports code :tangle yes :noweb yes&#xA;public class Test {&#xA;  public static void main(String[] args)&#xA;  {&#xA;#+END_SRC&#xA;&#xA;#+NAME: testend&#xA;#+BEGIN_SRC java +n :classname Test :results none :exports code :tangle yes :noweb yes&#xA;      System.out.print(result);&#xA;    }&#xA;  }&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can do a file include, eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+INCLUDE: &quot;./Test.java&quot; src java&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and see it in exports, but not the org-mode file itself. &lt;/p&gt;&#xA;" OwnerUserId="15069" LastActivityDate="2017-08-01T23:54:56.400" Title="How to display a babel tangled source code block in org-mode?" Tags="|org-mode|babel|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31879" PostTypeId="2" ParentId="31875" CreationDate="2017-04-02T17:14:44.480" Score="0" Body="&lt;p&gt;It's hard to tell for the little bit you've provided but you may want to start with (setq cperl-electric-parens nil) and lookup perl-hairy in the documentation&lt;/p&gt;&#xA;" OwnerUserId="12436" LastActivityDate="2017-04-02T17:14:44.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31880" PostTypeId="1" CreationDate="2017-04-02T20:00:24.753" Score="2" ViewCount="121" Body="&lt;p&gt;I have a file that I want to turn into a (local) package containing (inter alia) the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun tl-sort-regexp-fields (reverse record-regexp key-regexp beg end)&#xA;  &quot;Extended sort function.&quot;&#xA;  (interactive &quot;P\nsRegexp specifying records to sort: \nsRegexp specifying key within record: \nr&quot;)&#xA;  (if (string-match &quot;\\`\\(?:-\\\\[1-9]\\|\\(?:-?\\\\[1-9]\\)\\{2,\\}\\)\\'&quot; key-regexp)&#xA;      (let&#xA;          ((i (length key-regexp)))&#xA;        (while (&amp;gt; i 0)&#xA;          (let ((key-reverse (and (&amp;gt; i 2) (= (aref key-regexp (- i 3)) ?-)))&#xA;                (key (substring key-regexp (- i 2) i)))&#xA;            (sort-regexp-fields (if reverse (not key-reverse) key-reverse) record-regexp key beg end)&#xA;            (if key-reverse&#xA;                (setq i (- i 1)))&#xA;            (setq i (- i 2)))))&#xA;    (sort-regexp-fields reverse record-regexp key-regexp beg end)))&#xA;&#xA;(dolist (i '((&quot;Apples&quot;  &quot;^\\([-+ ]\\)\\([^\t]+\\)\t\\([0-9]+\\)\t.*$&quot;                                            &quot;\\2\\3-\\1&quot;)&#xA;             (&quot;Bananas&quot; &quot;^\\([-+ ]\\)\\([0-9]+\\)\t.*$&quot;                                                          &quot;\\2-\\1&quot;)&#xA;             (&quot;Oranges&quot; &quot;^\\([-+ ]\\)\\([0-9]+\\)\t.*$&quot;                                                          &quot;\\2-\\1&quot;)&#xA;             (&quot;Pears&quot;   &quot;^\\([-+ ]\\)\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t.*$&quot;  &quot;\\2\\3\\4\\5\\6-\\1&quot;)&#xA;             (&quot;Kiwis&quot;   &quot;^\\([-+ ]\\)\\([0-9]+\\)\t.*$&quot;                                                          &quot;\\2-\\1&quot;)))&#xA;  (fset (intern (concat &quot;tl-sort-&quot; (downcase (nth 0 i))))&#xA;        `(lambda (beg end)&#xA;           ,(concat &quot;Sort region according to primary key of table &quot; (nth 0 i) &quot;.&quot;)&#xA;           (interactive &quot;r&quot;)&#xA;           (tl-sort-regexp-fields nil ,(nth 1 i) ,(nth 2 i) beg end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This generates (one plus) five functions named &lt;code&gt;tl-sort-apples&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can easily prepend &lt;code&gt;;;;###autoload&lt;/code&gt; to &lt;code&gt;tl-sort-regexp-fields&lt;/code&gt;'s &lt;code&gt;defun&lt;/code&gt; to have it produce the proper autoload for &lt;code&gt;tl-sort-regexp-fields&lt;/code&gt;, but how can I do the same for the &quot;generated&quot; functions while keeping the code &lt;a href=&quot;https://en.wikipedia.org/wiki/Don%27t_repeat_yourself&quot; rel=&quot;nofollow noreferrer&quot;&gt;DRY&lt;/a&gt;, i. e. not adding a &lt;code&gt;;;;###autoload (autoload 'tl-sort-apples […])&lt;/code&gt; for every function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I prepend &lt;code&gt;;;;###autoload&lt;/code&gt; to &lt;code&gt;dolist&lt;/code&gt; (on a separate line), the code is executed once when the autoloads are loaded and once when the file is loaded. If I prepend &lt;code&gt;;;;###autoload&lt;/code&gt; on the same line, i. e. writing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;;;###autoload (dolist (i '((&quot;Apples&quot; &quot;^\\([-+ ]\\)\\([^\t]+\\)\t\\([0-9]+\\)\t.*$&quot; &quot;\\2\\3-\\1&quot;) (&quot;Bananas&quot; &quot;^\\([-+ ]\\)\\([0-9]+\\)\t.*$&quot; &quot;\\2-\\1&quot;) (&quot;Oranges&quot; &quot;^\\([-+ ]\\)\\([0-9]+\\)\t.*$&quot; &quot;\\2-\\1&quot;) (&quot;Pears&quot; &quot;^\\([-+ ]\\)\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t\\([^\t]+\\)\t.*$&quot; &quot;\\2\\3\\4\\5\\6-\\1&quot;) (&quot;Kiwis&quot; &quot;^\\([-+ ]\\)\\([0-9]+\\)\t.*$&quot; &quot;\\2-\\1&quot;))) (fset (intern (concat &quot;tl-sort-&quot; (downcase (nth 0 i)))) `(lambda (beg end) ,(concat &quot;Sort region according to primary key of table &quot; (nth 0 i) &quot;.&quot;) (interactive &quot;r&quot;) (tl-sort-regexp-fields nil ,(nth 1 i) ,(nth 2 i) beg end))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this would (only) define the functions when reading the autoloads (which in this case would probably be fine because the functions are short and few), but the code looks simply illegible and the solution not very universal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the preferred pattern for declaring autoloads for &quot;generated&quot; functions?&lt;/p&gt;&#xA;" OwnerUserId="12068" LastEditorUserId="105" LastEditDate="2017-04-03T01:13:40.100" LastActivityDate="2017-11-29T15:51:03.057" Title="Autoloads for &quot;generated&quot; functions?" Tags="|package|autoload|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31881" PostTypeId="2" ParentId="31880" CreationDate="2017-04-02T21:11:56.410" Score="1" Body="&lt;p&gt;To make it work like you suggest, you're going to need to turn &lt;code&gt;tl-sort-regexp-fields&lt;/code&gt; into a macro.  Then placing a &lt;code&gt;;;;###autoload&lt;/code&gt; in front of the macro call should do the trick (tho only if that macro is known to Emacs when the autoloads file is created).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, I recommend you use &lt;code&gt;defalias&lt;/code&gt; instead of &lt;code&gt;fset&lt;/code&gt; when defining a function.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-04-02T21:11:56.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31882" PostTypeId="1" AcceptedAnswerId="31883" CreationDate="2017-04-02T22:38:57.167" Score="7" ViewCount="1429" Body="&lt;p&gt;On a Mac, I would like to use &quot;text to speech&quot; to read web content. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the eww browser. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Text to speech&quot; treats line breaks as the end of the sentence so I would like eww to display long lines, wrapped if needed, but not truncated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried (among many other things) this in .emacs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'eww-mode-hook&#xA;          (lambda ()&#xA;            (set-fill-column 99999)&#xA;            (auto-fill-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but eww still breaks the lines at the width of the buffer. Can you please advise me how to avoid these breaks?&lt;/p&gt;&#xA;" OwnerUserId="15413" LastEditorUserId="1979" LastEditDate="2018-04-07T14:51:20.423" LastActivityDate="2018-04-07T14:51:20.423" Title="How to prevent eww from truncating lines?" Tags="|eww|line-break|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31883" PostTypeId="2" ParentId="31882" CreationDate="2017-04-02T23:52:09.037" Score="3" Body="&lt;p&gt;A little investigation indicates that you'll need to modify the various &lt;code&gt;shr-fill-*&lt;/code&gt; functions to achieve this. The &lt;code&gt;shr-width&lt;/code&gt; variable may or may not still be relevant at that point, but it seems reasonable to set that as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It you just want to hard-code this, you can redefine the functions like so:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(eval-after-load 'shr&#xA;  '(progn (setq shr-width -1)&#xA;          (defun shr-fill-text (text) text)&#xA;          (defun shr-fill-lines (start end) nil)&#xA;          (defun shr-fill-line () nil)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want behaviour you can toggle, I would probably advise the functions to &lt;em&gt;conditionally&lt;/em&gt; do nothing, based upon some variable. e.g.:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defadvice shr-fill-text (around shr-no-fill-text activate)&#xA;  &quot;Do not fill text when `shr-no-fill-mode' is enabled.&quot;&#xA;  (if (bound-and-true-p shr-no-fill-mode)&#xA;      (ad-get-arg 0)&#xA;    ad-do-it))&#xA;&#xA;(defadvice shr-fill-lines (around shr-no-fill-lines activate)&#xA;  &quot;Do not fill text when `shr-no-fill-mode' is enabled.&quot;&#xA;  (unless (bound-and-true-p shr-no-fill-mode)&#xA;    ad-do-it))&#xA;&#xA;(defadvice shr-fill-line (around shr-no-fill-line activate)&#xA;  &quot;Do not fill text when `shr-no-fill-mode' is enabled.&quot;&#xA;  (unless (bound-and-true-p shr-no-fill-mode)&#xA;    ad-do-it))&#xA;&#xA;(define-minor-mode shr-no-fill-mode&#xA;  &quot;Global minor mode which prevents `shr' and `eww' from filling text output.&quot;&#xA;  ;; :lighter (:eval (if (derived-mode-p 'eww-mode) &quot; ShrNoFill&quot;))&#xA;  :global t)&#xA;&#xA;(shr-no-fill-mode 1) ;; To enable by default.&#xA;                     ;; M-x shr-no-fill-mode to toggle.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-04-03T02:34:56.740" LastActivityDate="2017-04-03T02:34:56.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31885" PostTypeId="2" ParentId="31860" CreationDate="2017-04-03T02:54:37.587" Score="2" Body="&lt;p&gt;Assuming you're using OSX, the modeline doesn't display correctly due to a bug with &lt;a href=&quot;https://github.com/milkypostman/powerline/issues/54&quot; rel=&quot;nofollow noreferrer&quot;&gt;srgb&lt;/a&gt;. The if you don't want to set srgb to nil you should use &lt;a href=&quot;https://github.com/railwaycat/homebrew-emacsmacport&quot; rel=&quot;nofollow noreferrer&quot;&gt;emacs-mac&lt;/a&gt;, a osx-friendly version by Mitsuharu Yamamoto.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do this: &lt;code&gt;(setq powerline-default-separator 'utf-8)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're not on OSX, then there is a similar srgb problem for your operating system and you'll likely just have to live with it or switch your separators.  &lt;/p&gt;&#xA;" OwnerUserId="11934" LastActivityDate="2017-04-03T02:54:37.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31887" PostTypeId="2" ParentId="31876" CreationDate="2017-04-03T04:07:03.103" Score="0" Body="&lt;p&gt;&lt;code&gt;org-crypt.el&lt;/code&gt; seems to be included within &lt;code&gt;org-mode&lt;/code&gt; itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you can simply using it like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org&#xA;  ...&#xA;  :config&#xA;  (require 'org-crypt)&#xA;  ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2017-04-03T04:07:03.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31888" PostTypeId="1" AcceptedAnswerId="31890" CreationDate="2017-04-03T04:11:07.393" Score="2" ViewCount="6155" Body="&lt;p&gt;Magit doesn't work on my system. I'd like to remove it and everything that came with it when I installed the package. How can I do this? What packages, beside Magit, were installed on my emacs when I installed Magit?&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="306" LastEditDate="2017-04-03T10:27:28.227" LastActivityDate="2017-04-03T11:49:19.257" Title="Uninstalling a package and all of its dependencies" Tags="|package|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31889" PostTypeId="2" ParentId="31841" CreationDate="2017-04-03T04:18:02.997" Score="1" Body="&lt;p&gt;I think &lt;code&gt;ac-stop-words&lt;/code&gt; will be what you are searching for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cf. &lt;a href=&quot;https://github.com/auto-complete/auto-complete/blob/master/doc/manual.md#stop-completion-automatically-after-inserting-specific-words&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/auto-complete/auto-complete/blob/master/doc/manual.md#stop-completion-automatically-after-inserting-specific-words&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2017-04-03T04:18:02.997" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31890" PostTypeId="2" ParentId="31888" CreationDate="2017-04-03T05:23:57.390" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Through emacs' package manager, via MELPA.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In which case a manual approach is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;rgrep&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;package-requires&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;*.el&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;~/.emacs.d/elpa/&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will show you the dependencies for all your packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-s&lt;/kbd&gt; &lt;code&gt;magit&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; to check that one, and you can then look for sub-dependencies in turn.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If an earlier version of Magit had a dependency that was removed in subsequent versions, it's possible that it would now be an 'orphaned' package, as I suspect package.el doesn't attempt to detect such things.  If you were really keen, and assuming you version-control your config, you could always check the dependencies over your repo history to see whether any such thing had occurred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Of course if you version-control your config, you almost certainly have a version-control record of what else you added when you installed or updated Magit.)&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-04-03T11:49:19.257" LastActivityDate="2017-04-03T11:49:19.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31891" PostTypeId="2" ParentId="31872" CreationDate="2017-04-03T06:47:27.697" Score="6" Body="&lt;p&gt;There is a highly recommended package called paradox that extends package management commands.&#xA;Read more from &lt;a href=&quot;https://github.com/Malabarba/paradox&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/Malabarba/paradox&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package paradox&#xA;  :init&#xA;  (setq paradox-github-token t)&#xA;  (setq paradox-execute-asynchronously t)&#xA;  (setq paradox-automatically-star t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This setup feeds package usage statistics back to system using a separately set github token and updates packages in the background when you manually run the command &lt;kbd&gt;paradox-upgrade-packages&lt;/kbd&gt; bound to your keys of choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read the inline documentation of the variable &lt;kbd&gt;paradox-github-token&lt;/kbd&gt; on how to set it up.&lt;/p&gt;&#xA;" OwnerUserId="903" LastEditorUserId="11419" LastEditDate="2019-03-06T22:46:55.530" LastActivityDate="2019-03-06T22:46:55.530" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31892" PostTypeId="2" ParentId="31872" CreationDate="2017-04-03T07:08:28.867" Score="0" Body="&lt;p&gt;Try &lt;code&gt;epm&lt;/code&gt; to keep update process clean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cf. &lt;a href=&quot;https://github.com/xuchunyang/epm&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/xuchunyang/epm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can run update process within emacs batch process, without loading normal init.el settings.&lt;/p&gt;&#xA;" OwnerUserId="11580" LastActivityDate="2017-04-03T07:08:28.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31893" PostTypeId="1" AcceptedAnswerId="31894" CreationDate="2017-04-03T08:49:40.577" Score="2" ViewCount="2819" Body="&lt;p&gt;After starting Emacs from a Terminal window, the following message is displayed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;An error has occurred while loading '/Users/EvanAad/.emacs':&#xA;Symbol's function definition is void: package-initialize&#xA;To ensure normal operation, you should investigate and remove the&#xA;cause of the error in your initialization file.  Start Emacs with the&#xA;'--debug-init' option to view a complete error backtrace.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Restarting Emacs with the &lt;code&gt;--debug-init&lt;/code&gt; option displays the following in Emacs' Debugger buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-function package-initialize)&#xA;(package-initialize)   eval-buffer(#&amp;lt;buffer  *load*&amp;gt; nil&#xA;&quot;/Users/evanaad/.emacs&quot; nil t)  ; Reading$&#xA;load-with-code-conversion(&quot;/Users/evanaad/.emacs&quot;&#xA;&quot;/Users/evanaad/.emacs&quot;$   load(&quot;~/.emacs&quot; t t)   #[nil&#xA;&quot;^H\205\276^@   \306=\203^Q^@\307^H\310Q\202A^@&#xA;\311=\2033^@\312\307\31$   command-line()   normal-top-level()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;P.S. The reason why I want to start emacs from the command line is as an attempt to resolve &lt;a href=&quot;https://emacs.stackexchange.com/questions/31868/magit-version-post-installation-does-not-look-as-in-the-manual&quot;&gt;this issue&lt;/a&gt; (see step #5 in the 'Attempted steps' section).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Operating system: macOS Sierra, Version 10.12.4&lt;br&gt;&#xA;Emacs version: 25.1.1&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-04-04T19:34:45.477" Title="Error running Emacs from a Terminal window: &quot;Symbol's function definition is void: package-initialize&quot;" Tags="|init-file|osx|shell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31894" PostTypeId="2" ParentId="31893" CreationDate="2017-04-03T10:32:14.883" Score="7" Body="&lt;p&gt;This is an ancient version of &lt;code&gt;emacs&lt;/code&gt; that came preinstalled with macOS. To find out where the version of &lt;code&gt;emacs&lt;/code&gt; that you installed is, start it by clicking on the icon and then evaluate &lt;code&gt;(expand-file-name invocation-name invocation-directory)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then post that into a shell.&lt;/p&gt;&#xA;" OwnerUserId="306" LastActivityDate="2017-04-03T10:32:14.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31895" PostTypeId="1" CreationDate="2017-04-03T11:41:35.437" Score="1" ViewCount="2492" Body="&lt;p&gt;I would like to have &lt;code&gt;emacsclient&lt;/code&gt; as my default application for opening pdf-files, when openning them from within Emacs, based on a similar post &lt;a href=&quot;https://emacs.stackexchange.com/questions/29512/emacsclient-opens-a-file-and-does-eval-simultaneously/29519&quot;&gt;emacsclient opens a file and does eval simultaneously&lt;/a&gt;. Moreover I'd like the ability to jump to a specific page in that file, when the file is opened in an &lt;code&gt;org-mode&lt;/code&gt; buffer where &lt;strong&gt;&lt;em&gt;file-path::pg&lt;/em&gt;&lt;/strong&gt; e.g. &lt;em&gt;[[file:~/myfile.pdf::2][pg 2 of My File]]&lt;/em&gt;, opens the pdf file on the desired page, when invoking &lt;code&gt;C-c C-o&lt;/code&gt; or &lt;code&gt;org-open-at-point&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd expect the following in my &lt;code&gt;init.el&lt;/code&gt; to effect the desired result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-file-apps '((&quot;\\.pdf::\\([0-9]+\\)\\'&quot; . &#xA;                      &quot;emacsclient -e '(progn&#xA;                                          (find-file \&quot;%s\&quot;)&#xA;                                          (pdf-view-goto-page +%1)&#xA;                                       )'&quot;&#xA;                       )))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that on execution,&lt;code&gt;find-file \&quot;%s\&quot;&lt;/code&gt;, the double quotations are not escaped and do &lt;strong&gt;not&lt;/strong&gt; show up in the command that is actually run. i.e. I get &lt;code&gt;find-file /path/to/file&lt;/code&gt; instead of &lt;code&gt;find-file &quot;/path/to/file&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are the escaped &lt;code&gt;&quot;&lt;/code&gt; being ignored and how do I escape them so that they wrap around the &lt;code&gt;%s&lt;/code&gt; when the command is run? &lt;/p&gt;&#xA;" OwnerUserId="13326" LastEditorUserId="105" LastEditDate="2017-10-10T14:16:12.727" LastActivityDate="2018-01-08T16:12:01.947" Title="Configure org-pdfview and pdf-tools to open at page" Tags="|org-mode|init-file|pdf-tools|" AnswerCount="1" CommentCount="10" ClosedDate="2018-01-10T13:04:00.053" ContentLicense="CC BY-SA 3.0" />
  <row Id="31896" PostTypeId="2" ParentId="31895" CreationDate="2017-04-03T13:41:15.583" Score="1" Body="&lt;p&gt;String substitution &lt;code&gt;%s&lt;/code&gt; does not like adjacent quotation marks. Had to pad the variable with a space and then create a new string with the trailing space removed. i.e.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;(find-file (substring \&quot;%s \&quot; 0 -1))&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13326" LastActivityDate="2017-04-03T13:41:15.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31897" PostTypeId="1" AcceptedAnswerId="32156" CreationDate="2017-04-03T15:16:04.120" Score="5" ViewCount="635" Body="&lt;p&gt;I read my email in Emacs, and every now and then I receive an ICS file as an attachment, usually in a confirmation message for an event I've signed up for.  That's very kind of them, because it means I don't need to enter the event into my calendar manually.  It looks like this in the message buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Attachment: [4. text/calendar; foobar.ics]...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to import that event into Google Calendar.  Currently I handle those files like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Save the ICS attachment from within message-mode (move point to the attachment and hit &lt;code&gt;o&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Open Google Calendar in my web browser&lt;/li&gt;&#xA;&lt;li&gt;Click the cogwheel, and select &quot;Settings&quot; in the menu that appears&lt;/li&gt;&#xA;&lt;li&gt;Open the &quot;Calendars&quot; tab in the settings page&lt;/li&gt;&#xA;&lt;li&gt;Click the &quot;Import calendar&quot; link&lt;/li&gt;&#xA;&lt;li&gt;Select the ICS file in the file upload input control&lt;/li&gt;&#xA;&lt;li&gt;Select which calendar to add the event to&lt;/li&gt;&#xA;&lt;li&gt;Click the &quot;Import&quot; button&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It gets tedious after a while. How can I import the event into Google Calendar directly from Emacs, without all these intermediate steps?&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2017-04-14T22:03:34.507" Title="Upload ICS calendar file to Google Calendar" Tags="|email|ical|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31898" PostTypeId="2" ParentId="31878" CreationDate="2017-04-03T15:54:40.397" Score="0" Body="&lt;p&gt;Assuming you have configured the org exporter (&lt;code&gt;C-C C-e O o&lt;/code&gt; in the menu), the following file works for me (in the limited manner as explained in my first comment - but as I said, it is not quite what you wanted, but maybe it's good enough):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Tangling into another org file&#xA;&#xA;#+NAME: example&#xA;#+BEGIN_SRC java :classname Test :exports code :tangle yes :noweb yes&#xA;&#xA;&amp;lt;&amp;lt;preface&amp;gt;&amp;gt;&#xA;String result = &quot;hello world&quot;;&#xA;&amp;lt;&amp;lt;postface&amp;gt;&amp;gt;&#xA;&#xA;#+END_SRC&#xA;&#xA;where preface and end are something like this (but will disappear in the export):&#xA;&#xA;#+NAME: preface&#xA;#+BEGIN_SRC java  +n :results none :exports none&#xA;public class Test {&#xA;  public static void main(String[] args)&#xA;  {&#xA;#+END_SRC&#xA;&#xA;#+NAME: postface&#xA;#+BEGIN_SRC java +n :classname Test :results none :exports none&#xA;      System.out.print(result);&#xA;    }&#xA;  }&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the names and the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing &lt;code&gt;C-c C-e O o&lt;/code&gt; exports into &lt;code&gt;test.org.org&lt;/code&gt; (where the original file was &lt;code&gt;test.org&lt;/code&gt;) and contains just the expanded code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; # Created 2017-04-03 Mon 11:51&#xA; #+TITLE: &#xA; #+AUTHOR: Me&#xA; * Tangling into another org file&#xA;&#xA; #+NAME: example&#xA; #+BEGIN_SRC java&#xA;&#xA;   public class Test {&#xA;     public static void main(String[] args)&#xA;     {&#xA;   String result = &quot;hello world&quot;;&#xA;       System.out.print(result);&#xA;     }&#xA;   }&#xA; #+END_SRC&#xA;&#xA; where preface and end are something like this (but will disappear in the export):&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2017-04-03T18:33:46.490" LastActivityDate="2017-04-03T18:33:46.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31902" PostTypeId="1" AcceptedAnswerId="31917" CreationDate="2017-04-03T17:47:05.573" Score="2" ViewCount="93" Body="&lt;p&gt;&lt;strong&gt;NB&lt;/strong&gt;:  This problem seems to be limited to &lt;a href=&quot;https://raw.githubusercontent.com/skaslev/emacs.d/master/progmodes/mma.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;mma-mode&lt;/a&gt; (for Mathematica).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I define a snippet like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# key: test&#xA;# name: test&#xA;# --&#xA;$1&#xA;$1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, I test it (with &lt;code&gt;C-c C-t&lt;/code&gt;).  After I type the first character (&lt;code&gt;x&lt;/code&gt;), my terminal looks like this (the &lt;code&gt;▮&lt;/code&gt; indicates the position of the cursor).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x▮&#xA;  x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that a couple of spurious spaces were added in front of the mirrored &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This behavior continues with every additional keystroke, as long as mirroring is taking place:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xy▮&#xA;    xy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It happens even if the keystroke is for a backspace:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x▮&#xA;      x&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As I said at the beginning, I see this problem only with mma-mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, mma-mode is not maintained, AFAICT.  Therefore, the most I can hope for is some workaround.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how I could prevent the addition of spurious spaces before mirrors?&lt;/p&gt;&#xA;" OwnerUserId="882" LastEditorUserId="105" LastEditDate="2017-04-04T14:48:58.140" LastActivityDate="2017-04-04T14:48:58.140" Title="Mirrors produce spurious indentation under mma-mode" Tags="|yasnippet|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31903" PostTypeId="2" ParentId="31826" CreationDate="2017-04-03T17:57:55.430" Score="14" Body="&lt;p&gt;I use &lt;code&gt;auto-package-update&lt;/code&gt; to automatically update packages.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package auto-package-update&#xA;   :ensure t&#xA;   :config&#xA;   (setq auto-package-update-delete-old-versions t&#xA;         auto-package-update-interval 4)&#xA;   (auto-package-update-maybe))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that setup, packages will be updated every &lt;code&gt;4&lt;/code&gt; days, and the old packages will be removed.&lt;/p&gt;&#xA;" OwnerUserId="9972" LastActivityDate="2017-04-03T17:57:55.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31904" PostTypeId="2" ParentId="31872" CreationDate="2017-04-03T18:15:40.223" Score="18" Body="&lt;p&gt;You can use &lt;code&gt;auto-package-update&lt;/code&gt; to automatically update packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Copied from my other post (&lt;a href=&quot;https://emacs.stackexchange.com/a/31903/9972&quot;&gt;https://emacs.stackexchange.com/a/31903/9972&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(use-package auto-package-update&#xA;   :ensure t&#xA;   :config&#xA;   (setq auto-package-update-delete-old-versions t&#xA;         auto-package-update-interval 4)&#xA;   (auto-package-update-maybe))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With that setup, packages will be updated every &lt;code&gt;4&lt;/code&gt; days, and the old packages will be removed.&lt;/p&gt;&#xA;" OwnerUserId="9972" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.633" LastActivityDate="2017-04-03T18:15:40.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31905" PostTypeId="1" CreationDate="2017-04-03T18:47:33.880" Score="1" ViewCount="278" Body="&lt;p&gt;I have a lot of filenames in Russian in my file system. Every time I close Emacs if I had eshell opened, it shows a &lt;code&gt;*temp*&lt;/code&gt; buffer with a list of directories. And asks 2 questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Select coding system (default utf-8):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I click enter&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Selected encoding utf-8 disagrees with latin-2  specified by file contents. Really save (else edit coding cookies and try again)? (y or n)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I click &quot;y&quot;, enter&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What file cookies is he talking about? Where can I set it to utf-8, so this question is never asked again?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the wrong file: &lt;code&gt;~/.emacs.d/eshell/lastdir&lt;/code&gt;. I saved this: &quot;яОяН­яОяННяОуВяНЕяОяОяННяОяНОяОяНВяОяНА&quot; instead of normal Russian name. Then it tries to save it again.&lt;/p&gt;&#xA;" OwnerUserId="2389" LastEditorUserId="2389" LastEditDate="2017-04-05T08:01:25.370" LastActivityDate="2020-09-15T19:59:29.740" Title="Wrong encoding in eshell when closing Emacs" Tags="|eshell|character-encoding|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31906" PostTypeId="1" AcceptedAnswerId="31907" CreationDate="2017-04-03T23:18:33.687" Score="4" ViewCount="1170" Body="&lt;p&gt;I use Pandoc to convert from HTML and Markdown to org-mode. The conversion leaves lots of extraneous org-mode PROPERTIES drawers. How can I direct org-mode to delete all PROPERTIES drawers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ADDITION: I'm using this shell script to run the conversion.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function pandoc2org () {&#xA;    basename=${1%%.*}                       # remove old file extension&#xA;    pandoc -s -S &quot;$1&quot; -o $basename.org      # name file as oldfile.org &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2017-04-03T23:40:25.997" LastActivityDate="2021-06-17T15:03:07.437" Title="in org-mode, a function to delete all properties drawers?" Tags="|org-mode|pandoc|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31907" PostTypeId="2" ParentId="31906" CreationDate="2017-04-03T23:37:00.860" Score="4" Body="&lt;p&gt;If you don't mind using a shell script to accomplish what you want, you can try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pandoc -t org file.md | sed -E &quot;/^[[:space:]]+:/ d&quot; &amp;gt; file.org&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will remove all lines starting with one (or more) spaces followed by a semicolon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe you can fit it into your script by doing the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function pandoc2org () {&#xA;    basename=${1%%.*}                      &#xA;    pandoc -s -S &quot;$1&quot; -t org | sed -E &quot;/^[[:space:]]+:/ d&quot; &amp;gt; $basename.org&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can find an explanation of the function &lt;a href=&quot;https://explainshell.com/explain?cmd=pandoc%20-s%20-S%20%22%241%22%20-t%20org%20%7C%20sed%20-E%20%22%2F%5E%5B%5B%3Aspace%3A%5D%5D%2B%3A%2F%20d%22%20%3E%20%24basename.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2017-04-04T00:01:08.553" LastActivityDate="2017-04-04T00:01:08.553" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="31908" PostTypeId="1" CreationDate="2017-04-03T23:52:03.440" Score="3" ViewCount="598" Body="&lt;p&gt;Once I have pushed a mark into the ring with &lt;code&gt;C-c %&lt;/code&gt;, &lt;code&gt;org-mark-ring-push&lt;/code&gt; and have cycled through the ring with &lt;code&gt;C-c &amp;amp;&lt;/code&gt;, &lt;code&gt;org-mark-ring-goto&lt;/code&gt;, how can I remove a mark that I don't need anymore? I tried &lt;code&gt;C-u C-u&lt;/code&gt; &lt;code&gt;set-mark-command-repeat-pop&lt;/code&gt; but nothing happens.&lt;/p&gt;&#xA;" OwnerUserId="15427" LastEditorUserId="15427" LastEditDate="2017-04-05T13:38:16.100" LastActivityDate="2018-03-22T13:57:15.243" Title="Remove mark from ring in org mode" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31909" PostTypeId="1" CreationDate="2017-04-04T01:31:15.980" Score="7" ViewCount="2716" Body="&lt;p&gt;How can I open a file with a BOM Byte Order Mark and ensure that BOM is gone when I save the file.&lt;/p&gt;&#xA;" OwnerUserId="15429" LastEditorUserId="253" LastEditDate="2017-04-04T03:03:31.600" LastActivityDate="2017-10-17T16:31:54.470" Title="How to get rid of BOM (byte order mark)" Tags="|character-encoding|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31910" PostTypeId="1" AcceptedAnswerId="31933" CreationDate="2017-04-04T03:20:33.397" Score="1" ViewCount="243" Body="&lt;p&gt;When I install ox-gfm package, I got below warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Leaving directory ‘/Users/root/.emacs.d/elpa/ox-gfm-20170304.1504’&#xA;&#xA;Compiling file /Users/root/.emacs.d/elpa/ox-gfm-20170304.1504/ox-gfm.el at Mon Apr  3 22:11:54 2017&#xA;Entering directory ‘/Users/root/.emacs.d/elpa/ox-gfm-20170304.1504/’&#xA;&#xA;Compiling no file at Mon Apr  3 22:11:55 2017&#xA;Warning (bytecomp): reference to free variable ‘info’&#xA;Warning (bytecomp): org-export-collect-footnote-definitions called with 1&#xA;argument, but requires 2&#xA;Warning (bytecomp): org-html--anchor called with 4 arguments, but accepts only&#xA;0-3&#xA;Warning (bytecomp): the function ‘org-export-get-reference’ is not known to be&#xA;defined.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But sounds like org-export-get-reference will be used in publish code, so when I try to publish org file to md file (refer to &lt;a href=&quot;https://vurt.co.uk/post/blogging-with-emacs-and-hugo/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this link&lt;/a&gt;), it will report a error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;org-gfm-format-toc: Symbol’s function definition is void: org-export-get-reference&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I guess we should not ignore the warning!&#xA;Not sure if any other depend package missed!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My emacs version on MacOSX 10.12:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GNU Emacs 25.2.1 (x86_64-apple-darwin16.0.0, NS appkit-1504.00 Version 10.12 (Build 16A323)) of 2017-04-03&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2017-04-04T19:49:39.320" Title="ox-gfm package install warning" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31912" PostTypeId="1" AcceptedAnswerId="32980" CreationDate="2017-04-04T06:40:08.313" Score="2" ViewCount="635" Body="&lt;p&gt;The standard way to define an abbreviation using quail is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(quail-define-rules&#xA;(&quot;a&quot; ?s ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inserting &quot;a&quot; gives &quot;s&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if one can insert an arbitrary string using quail, I tried the following but do not work&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(quail-define-rules&#xA;(&quot;a&quot; ?s?o?m?t?h?i?n?g ))&#xA;&#xA;(quail-define-rules&#xA;(&quot;a&quot; &quot;something&quot; ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know there are other methods to achieve this (e.g., abbrev-mode) but I am interested if there is way to do it using quail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; If one uses &lt;code&gt;(&quot;a&quot; &quot;something&quot; )&lt;/code&gt;, typing &lt;code&gt;a&lt;/code&gt; inserts &lt;code&gt;s&lt;/code&gt; and ignores &lt;code&gt;omething&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2017-04-05T04:26:28.217" LastActivityDate="2017-05-21T09:10:56.117" Title="Using quail input-method to insert a string" Tags="|string|input-method|insert|quail|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31913" PostTypeId="1" AcceptedAnswerId="31914" CreationDate="2017-04-04T08:04:54.700" Score="3" ViewCount="408" Body="&lt;p&gt;&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;According to the Emacs manual&lt;/a&gt;, &lt;code&gt;M-:&lt;/code&gt; evaluates an Emacs Lisp expression and prints the value in the echo area. How can I direct the value to the current buffer instead?&lt;/p&gt;&#xA;" OwnerUserId="4084" LastEditorUserId="4084" LastEditDate="2017-04-04T16:05:11.850" LastActivityDate="2017-04-04T16:05:11.850" Title="How to direct `M-:`'s value to the current buffer?" Tags="|echo-area|eval-expression|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31914" PostTypeId="2" ParentId="31913" CreationDate="2017-04-04T08:59:36.547" Score="8" Body="&lt;p&gt;use &lt;code&gt;C-u M-:&lt;/code&gt; insert the result into current buffer instead of printing it in the echo area.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(eval-expression EXP &amp;amp;optional INSERT-VALUE)&lt;/p&gt;&#xA;&lt;p&gt;Evaluate EXP and print value in the echo area.&#xA;When called interactively, read an Emacs Lisp expression and evaluate it.&#xA;Value is also consed on to front of the variable ‘values’.&#xA;If the resulting value is an integer, it will be printed in&#xA;several additional formats (octal, hexadecimal, and character).&#xA;Optional argument INSERT-VALUE non-nil (interactively, with&#xA;prefix argument) means insert the result into the current buffer&#xA;instead of printing it in the echo area.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9363" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-04-04T08:59:36.547" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="31915" PostTypeId="2" ParentId="30656" CreationDate="2017-04-04T11:27:44.963" Score="1" Body="&lt;p&gt;I've found the error by commenting out lines in the emacs' init file, starting with a large selection of code and narrowing it down to one line. It turned out that a custom org-ref variable causes this error when it points to a folder that doesn't exist:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq org-ref-pdf-directory &quot;~/Documents/Bibliography/notes/org-ref-pdfs/&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="14395" LastActivityDate="2017-04-04T11:27:44.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31916" PostTypeId="2" ParentId="22171" CreationDate="2017-04-04T11:52:25.473" Score="1" Body="&lt;p&gt;This is a bug in linum-mode. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;bug#24169: &#xA;&lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24169&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24169&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Line numbers will indeed disappear with horizontal scrolling when using line-truncation. See reproduction details in bug report.&lt;/p&gt;&#xA;" OwnerUserId="15421" LastActivityDate="2017-04-04T11:52:25.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31917" PostTypeId="2" ParentId="31902" CreationDate="2017-04-04T12:51:47.070" Score="2" Body="&lt;p&gt;&lt;code&gt;mma-mode&lt;/code&gt; seems to have a strange (non-idempotent) indentation function.  Therefore you should stop yasnippet from trying to use it when in &lt;code&gt;mma-mode&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my-mma-mode-hook ()&#xA;  (setq-local yas-indent-line 'fixed))&#xA;(add-hook 'mma-mode-hook #'my-mma-mode-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this doesn't work in yasnippet versions 0.11 and earlier because it doesn't respect &lt;code&gt;yas-indent-line&lt;/code&gt; for mirror updates.  This will be fixed in the upcoming 0.12, but you can use this advice to fix it in the meantime:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;;; NOTE: this also disables `$&amp;gt;' indent markers in snippets,&#xA;;; but hardly anyone uses those anyway.&#xA;(defun yas-indent-line-is-auto-p (&amp;amp;rest _)&#xA;  (eq yas-indent-line 'auto))&#xA;(advice-add 'yas--indent-region :before-while #'yas-indent-line-is-auto-p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-04-04T12:51:47.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31920" PostTypeId="1" AcceptedAnswerId="31921" CreationDate="2017-04-04T14:13:45.743" Score="5" ViewCount="283" Body="&lt;p&gt;Suppose I have a &lt;code&gt;python-mode&lt;/code&gt; &lt;em&gt;user&lt;/em&gt; buffer with content &lt;code&gt;import os&lt;/code&gt;, I can use &lt;code&gt;(buffer-substring (point-min) (point-max))&lt;/code&gt; to get a colorized string &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#(&quot;import os&quot; 0 6&#xA;(fontified t face font-lock-keyword-face)&#xA;6 9&#xA;(fontified t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But now I want to generate this using emacs lisp code like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq string&#xA;      (with-temp-buffer&#xA;        (python-mode)&#xA;        (font-lock-mode 1)&#xA;        (insert &quot;import os&quot;)&#xA;        (buffer-substring (point-min) (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but got result&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#(&quot;import os&quot; 0 9 (fontified nil))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my question is how can I generate the same string just as I substring it from a truly existed user buffer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastActivityDate="2017-04-06T14:14:53.693" Title="How can I get a font-locked string just as substring it from a buffer under specified major mode?" Tags="|font-lock|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31921" PostTypeId="2" ParentId="31920" CreationDate="2017-04-04T14:40:18.990" Score="3" Body="&lt;p&gt;You need to tell font-lock to fontify the text you entered. Font-lock generally behaves lazily. It has already font-locked the text shown in the window, and you need to tell it to do so again, to pick up the text you just inserted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the commands and other functions whose names start with &lt;code&gt;font-lock-fontify-&lt;/code&gt;: &lt;strong&gt;&lt;code&gt;M-x font-lock-fontify- TAB&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;code&gt;font-lock-fontify-block&lt;/code&gt;, which is bound by default to &lt;code&gt;M-o M-o&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;font-lock-fontify-block&lt;/code&gt;&lt;/strong&gt; is an interactive compiled Lisp function in&#xA;  ‘font-lock.el’.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It is bound to &lt;strong&gt;&lt;code&gt;M-o M-o&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(font-lock-fontify-block &amp;amp;optional ARG)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Fontify some lines the way &lt;code&gt;font-lock-fontify-buffer&lt;/code&gt; would.&#xA;  The lines could be a function or paragraph, or a specified number of lines.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;ARG&lt;/code&gt; is given, fontify that many lines before and after point, or 16 lines if&#xA;  no &lt;code&gt;ARG&lt;/code&gt; is given and &lt;code&gt;font-lock-mark-block-function&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If &lt;code&gt;font-lock-mark-block-function&lt;/code&gt; non-&lt;code&gt;nil&lt;/code&gt; and no &lt;code&gt;ARG&lt;/code&gt; is given, it is used to&#xA;  delimit the region to fontify.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-04-04T14:40:18.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31922" PostTypeId="1" AcceptedAnswerId="31923" CreationDate="2017-04-04T15:27:14.260" Score="1" ViewCount="96" Body="&lt;p&gt;I'd like to prompt the user for a register name. Is there an easy way to do this? Apparently, this functionality isn't built into &lt;code&gt;interactive&lt;/code&gt; (&lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Interactive-Codes.html&lt;/a&gt;)...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="15411" LastActivityDate="2017-04-04T20:54:17.957" Title="How to prompt user for register name?" Tags="|interactive|registers|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31923" PostTypeId="2" ParentId="31922" CreationDate="2017-04-04T15:49:14.820" Score="3" Body="&lt;p&gt;Just by looking at source code of the first function I found via apropos that has anything to do with registers, I found &lt;code&gt;register-read-with-preview&lt;/code&gt;. It might be what you're looking for.&lt;/p&gt;&#xA;&lt;p&gt;You can prompt for registers only when calling a function interactively by passing code that returns a list of arguments to &lt;code&gt;interactive&lt;/code&gt; as it's argument.&lt;/p&gt;&#xA;&lt;p&gt;Here's the docstring:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;register-read-with-preview is a compiled Lisp function in ‘register.el’.&lt;/p&gt;&#xA;&lt;p&gt;(register-read-with-preview PROMPT)&lt;/p&gt;&#xA;&lt;p&gt;Read and return a register name, possibly showing existing registers.&#xA;Prompt with the string PROMPT.  If ‘register-alist’ and&#xA;‘register-preview-delay’ are both non-nil, display a window&#xA;listing existing registers after ‘register-preview-delay’ seconds.&#xA;If ‘help-char’ (or a member of ‘help-event-list’) is pressed,&#xA;display such a window regardless.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user12563" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-04-04T20:54:17.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31924" PostTypeId="2" ParentId="4045" CreationDate="2017-04-04T17:02:27.263" Score="1" Body="&lt;p&gt;How about &lt;a href=&quot;https://github.com/rranelli/auto-package-update.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;auto-package-update&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Old versions can be deleted by this customization: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq auto-package-update-delete-old-versions t)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2226" LastActivityDate="2017-04-04T17:02:27.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31925" PostTypeId="1" CreationDate="2017-04-04T17:30:33.013" Score="0" ViewCount="147" Body="&lt;p&gt;I use &lt;a href=&quot;https://github.com/rolandwalker/flyspell-lazy&quot; rel=&quot;nofollow noreferrer&quot;&gt;flyspell-lazy&lt;/a&gt; to improve flyspell performance and it works really well. However, when I open a buffer with a lot of text, I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range #&amp;lt;buffer buffer2&amp;gt; 155 215)&#xA;  #&amp;lt;subr buffer-substring-no-properties&amp;gt;(215 155)&#xA;  ad-Advice-buffer-substring-no-properties(#&amp;lt;subr buffer-substring-no-properties&amp;gt; 215 155)&#xA;  apply(ad-Advice-buffer-substring-no-properties #&amp;lt;subr buffer-substring-no-properties&amp;gt; (215 155))&#xA;  buffer-substring-no-properties(215 155)&#xA;  flyspell-lazy-check-pending()&#xA;  apply(flyspell-lazy-check-pending nil)&#xA;  timer-event-handler([t 0 3 0 t flyspell-lazy-check-pending nil idle 0])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's another version of the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (args-out-of-range #&amp;lt;buffer 0-why-I-wrote-this-book.txt&amp;gt; 90378 90651)&#xA;  buffer-substring-no-properties(90651 90378)&#xA;  flyspell-lazy-check-pending()&#xA;  apply(flyspell-lazy-check-pending nil)&#xA;  timer-event-handler([t 0 3 0 t flyspell-lazy-check-pending nil idle 0])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I resolve this error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As requested, here are my flyspell settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package flyspell&#xA;:config&#xA;'(flyspell-abbrev-p t)&#xA;'(flyspell-use-global-abbrev-table-p t)&#xA;'(global-flyspell-mode t)&#xA;&#xA;:bind&#xA;(:map flyspell-mode-map &#xA;(&quot;C-.&quot; . nil)&#xA;)&#xA;)&#xA;&#xA;;; flyspell skip source blocks&#xA;;; NO spell check for embedded snippets&#xA;(defadvice org-mode-flyspell-verify (after org-mode-flyspell-verify-hack activate)&#xA;  (let ((rlt ad-return-value)&#xA;        (begin-regexp &quot;^[ \t]*#\\+begin_\\(src\\|html\\|latex\\)&quot;)&#xA;        (end-regexp &quot;^[ \t]*#\\+end_\\(src\\|html\\|latex\\)&quot;)&#xA;        old-flag&#xA;        b e)&#xA;    (when ad-return-value&#xA;      (save-excursion&#xA;        (setq old-flag case-fold-search)&#xA;        (setq case-fold-search t)&#xA;        (setq b (re-search-backward begin-regexp nil t))&#xA;        (if b (setq e (re-search-forward end-regexp nil t)))&#xA;        (setq case-fold-search old-flag))&#xA;      (if (and b e (&amp;lt; (point) e)) (setq rlt nil)))&#xA;    (setq ad-return-value rlt)))&#xA;&#xA;(add-hook 'org-mode-hook (lambda () (flyspell-lazy-mode 1))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2494" LastEditorUserId="2494" LastEditDate="2017-04-05T04:19:44.477" LastActivityDate="2017-04-05T04:19:44.477" Title="how to fix flyspell-lazy args-out-of-range error?" Tags="|flyspell|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31926" PostTypeId="1" CreationDate="2017-04-04T17:30:47.533" Score="1" ViewCount="359" Body="&lt;p&gt;I want to change my colour scheme to a random color scheme. Consider this elisp function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun random-colour-theme () ;; written 2017-04-02&#xA;  &quot;Pick a random colour theme.&quot;&#xA;  (interactive)&#xA;  (setq randomNumber (random 2))&#xA;  (setq randomColourScheme (nth randomNumber '(&#xA;&quot;color-theme-dark&quot;&#xA;&quot;color-theme-light&quot;)))&#xA;(randomColourScheme)&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything works except the last line, (randomColourScheme). randomColourScheme is a string representing either &quot;color-theme-dark&quot; or &quot;color-theme-light&quot;. If the command were (color-theme-dark), then it would work. How do you execute a command that is currently in a variable as a string? I don't know how to get started on this one.&lt;/p&gt;&#xA;" OwnerUserId="15431" LastEditorUserId="105" LastEditDate="2017-04-04T20:49:25.513" LastActivityDate="2017-04-05T01:20:10.700" Title="emacs lisp execute random command" Tags="|colors|eval|" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31927" PostTypeId="2" ParentId="31812" CreationDate="2017-04-04T17:32:40.380" Score="1" Body="&lt;p&gt;Well, got it, I made this and setted it up on my init scripts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Chess ICS&#xA;(defun playchess ()&#xA;  (interactive)&#xA;  (setq username (read-string &quot;Username: &quot;))&#xA;  (if (string= username &quot;guest&quot;)&#xA;      (chess-ics &quot;freechess.org&quot; 5000 username)&#xA;    (setq pass (read-passwd &quot;Password: &quot;))&#xA;    (chess-ics &quot;freechess.org&quot; 5000 username pass)&#xA;    )&#xA;  )&#xA;(provide 'playchess)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="684" LastActivityDate="2017-04-04T17:32:40.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31928" PostTypeId="2" ParentId="31926" CreationDate="2017-04-04T17:44:27.623" Score="3" Body="&lt;p&gt;Use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbols.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;symbol&lt;/code&gt;&lt;/a&gt;s instead of &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Strings-and-Characters.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;string&lt;/code&gt;&lt;/a&gt;s:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'seq)&#xA;(defvar theme-selection&#xA;  '(color-theme-dark&#xA;    color-theme-light))&#xA;(defun random-theme ()&#xA;  &quot;Pick a random colour theme.&quot;&#xA;  (interactive)&#xA;  (funcall (seq-random-elt theme-selection)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Calling-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;funcall&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequence-Functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sequence Functions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. Note that if you compile your function, you will get warnings about undeclared globals. You should use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Local-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;let&lt;/code&gt;&lt;/a&gt; instead of &lt;code&gt;setq&lt;/code&gt; for your local variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PPS. Older Emacsen lack &lt;code&gt;seq&lt;/code&gt;, so you can roll your own:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun random-theme ()&#xA;  &quot;Pick a random colour theme.&quot;&#xA;  (interactive)&#xA;  (funcall (nth (random (length theme-selection)) theme-selection)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="795" LastEditorUserId="795" LastEditDate="2017-04-05T01:20:10.700" LastActivityDate="2017-04-05T01:20:10.700" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="31929" PostTypeId="2" ParentId="28650" CreationDate="2017-04-04T17:58:41.923" Score="1" Body="&lt;p&gt;Ah. It seems that you have misplaced the &lt;code&gt;(nnir-search-engine imap) (nnimap-authinfo-file &quot;~/.authinfo&quot;)&lt;/code&gt; part.  That should be inside the parens that start at &lt;code&gt;'(nnimp &quot;gmail&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correct would be:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(setq gnus-select-method&#xA;      '(nnimap &quot;gmail&quot;&#xA;               (nnimap-address &quot;imap.gmail.com&quot;)&#xA;               (nnimap-server-port 993)&#xA;               (nnimap-stream ssl)&#xA;               (nnir-search-enging imap)&#xA;               (nnimap-authinfo-file &quot;~/.authinfo&quot;)))&#xA;;; -- Two too many ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5145" LastEditorUserId="10269" LastEditDate="2017-04-05T02:09:35.093" LastActivityDate="2017-04-05T02:09:35.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31930" PostTypeId="2" ParentId="31925" CreationDate="2017-04-04T18:50:00.593" Score="1" Body="&lt;p&gt;&lt;code&gt;flyspell-lazy.el&lt;/code&gt; does not apply any &lt;code&gt;advice&lt;/code&gt; to &lt;code&gt;buffer-substring-no-properties&lt;/code&gt;.  It will be necessary to find out where else in the user-configuration said function has been advised and undo-it or fix-it.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-04-04T18:50:00.593" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31931" PostTypeId="1" CreationDate="2017-04-04T18:50:15.683" Score="3" ViewCount="1058" Body="&lt;p&gt;I have a very large project and generally I work on multiple related projects simultaneously. While switching project I have to type full name everytime (multiple similar named files under different directories) to open a buffer which was already opened earlier as helm-projectile-find-files doesn't show already opened buffers. &#xA;  How do I make projectile-project-switch-action to display and filter both project open buffers and rest of the project matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I was using spacemacs I remember having this kind of behavior. I use prelude now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg: &#xA;project p1 has pp1, pp2, pp3 ...&#xA;Project a1 has aa1, aa2, aa3...&#xA;Project x1 has xx1, xx2, xx3...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume I have 2 windows win1 and win2.&#xA;In win1 I have pp1 opened and in win2 aa1 is opened&#xA;Now I switch to project x1 in win1 and open file xx1&#xA;Now after viewing the file I try to switch back to project p1 in win1. After selecting project from projectile-switch-project projectile list me with all the files of p1 - pp1, pp2, pp3... to select a file and open it.&#xA;Now since I have already opened pp1 earlier if I could see a list of open buffers along with project files I could save some time.&lt;/p&gt;&#xA;" OwnerUserId="15432" LastEditorUserId="15432" LastEditDate="2017-04-05T18:23:53.520" LastActivityDate="2017-05-05T19:03:35.580" Title="Projectile: show project open buffers when switching project" Tags="|spacemacs|customize|projectile|prelude|helm-projectile|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31932" PostTypeId="1" AcceptedAnswerId="31958" CreationDate="2017-04-04T19:27:09.230" Score="1" ViewCount="1330" Body="&lt;p&gt;After upgrade org mode version to 9, the babel variable params is void.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below example works fine in org 8 version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results output&#xA;(print params)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &#xA;: ((:comments . &quot;&quot;) (:shebang . &quot;&quot;) (:cache . &quot;no&quot;) (:padline . &quot;&quot;) (:noweb . &quot;no&quot;) (:tangle . &quot;no&quot;) (:exports . &quot;code&quot;) (:results . &quot;replace output&quot;) (:session . &quot;none&quot;) (:hlines . &quot;yes&quot;) (:colnames . &quot;no&quot;) (:result-type . output) (:result-params &quot;output&quot; &quot;replace&quot;) (:rowname-names) (:colname-names))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if we run the same code in org 9.0.5, I got below error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let: Symbol’s value as variable is void: params&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it changed to another name?&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="105" LastEditDate="2017-04-04T20:50:09.230" LastActivityDate="2017-04-13T02:28:02.663" Title="org mode - babel params variable is void" Tags="|org-mode|variables|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31933" PostTypeId="2" ParentId="31910" CreationDate="2017-04-04T19:49:39.320" Score="2" Body="&lt;p&gt;Seems like you should &lt;a href=&quot;https://github.com/yjwen/org-reveal/issues/152#issuecomment-146449649&quot; rel=&quot;nofollow noreferrer&quot;&gt;upgrade&lt;/a&gt; to a newer version of Orgmode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Call &lt;code&gt;org-version&lt;/code&gt; and see what you get. If it's something like &lt;code&gt;8.2&lt;/code&gt;, you should upgrade to &lt;code&gt;8.3&lt;/code&gt; or higher. See the &lt;a href=&quot;http://orgmode.org/elpa.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Orgmode package repo&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-04-04T19:49:39.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31934" PostTypeId="2" ParentId="31909" CreationDate="2017-04-04T19:52:46.387" Score="4" Body="&lt;p&gt;&lt;code&gt;M-x set-buffer-file-coding-system&lt;/code&gt;, hit TAB to get a completion list, select encoding you desire (one without BOM), then save the file.&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-04-04T19:52:46.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31935" PostTypeId="2" ParentId="31926" CreationDate="2017-04-04T21:47:12.493" Score="1" Body="&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun random-colour-theme () ;; written 2017-04-02&#xA;  &quot;Pick a random colour theme.&quot;&#xA;  (interactive)&#xA;  (let* ((color-schemes '(&quot;color-theme-dark&quot;&#xA;                          &quot;color-theme-light&quot;))&#xA;         (random-number (random (length color-schemes)))&#xA;         (random-colour-scheme&#xA;          (nth random-number color-schemes)))&#xA;    (funcall (intern random-colour-scheme))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5253" LastActivityDate="2017-04-04T21:47:12.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31936" PostTypeId="2" ParentId="31931" CreationDate="2017-04-04T23:42:06.557" Score="2" Body="&lt;p&gt;Have you tried &lt;code&gt;helm-projectile-switch-to-buffer&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-04-04T23:42:06.557" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31937" PostTypeId="1" AcceptedAnswerId="31938" CreationDate="2017-04-05T03:14:59.197" Score="4" ViewCount="3915" Body="&lt;p&gt;I use Evil, and I'm using &lt;a href=&quot;http://emacsist.com/10779&quot; rel=&quot;nofollow noreferrer&quot;&gt;the General package&lt;/a&gt; to set my custom keybindings. I'm using SPC as a leader key. The trouble is, I find that SPC is not interpreted as my leader key in some modes, namely dired, and also in the *Messages* buffer. I can't seem to figure out how to get it to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've defined my leader key like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(general-define-key&#xA; :states 'motion&#xA; :prefix &quot;SPC&quot;&#xA; ; Bindings under the leader key defined here...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Adding &lt;code&gt;keymaps: 'dired-mode-map&lt;/code&gt; doesn't seem to work, which is odd, because &lt;code&gt;C-h k SPC&lt;/code&gt; in dired mode shows &lt;code&gt;SPC runs the command dired-next-line (found in dired-mode-map)...&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to define my SPC leader key such that it will be effective in all modes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="15411" LastActivityDate="2021-12-29T17:00:20.730" Title="(Evil) &quot;General&quot; leader key (SPC) not working in some modes (dired, *Messages*)" Tags="|key-bindings|evil|dired|" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31938" PostTypeId="2" ParentId="31937" CreationDate="2017-04-05T04:03:51.633" Score="2" Body="&lt;p&gt;I think you need to set the keybindings in normal state &lt;code&gt;:states 'normal&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13439" LastActivityDate="2017-04-05T04:03:51.633" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31939" PostTypeId="2" ParentId="31736" CreationDate="2017-04-05T05:51:43.190" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://github.com/chongli/emacs/blob/master/colors/vivid-chalk.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;file you reference&lt;/a&gt; is an old-style &quot;color-theme&quot;. These can be dropped anywhere in your &lt;code&gt;load-path&lt;/code&gt;. You can also add any directory to your load path. Personally I like to keep my color-themes in &lt;code&gt;~/.emacs.d/lisp&lt;/code&gt;. A minimal init-file that updates your load path and loads your theme would look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; prepend personal lisp directory to the load-path                           &#xA;(add-to-list 'load-path (expand-file-name &quot;~/.emacs.d/lisp&quot;))&#xA;;; load a fancy new theme&#xA;(require 'color-theme)&#xA;(require 'vivid-chalk)&#xA;(color-theme-vivid-chalk)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12713" LastActivityDate="2017-04-05T05:51:43.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31940" PostTypeId="2" ParentId="26957" CreationDate="2017-04-05T06:02:14.430" Score="0" Body="&lt;p&gt;This is possibly due to a legacy startup setting in Aquamacs. You have a couple of options to fix it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Patch Aquamacs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try the patch &lt;a href=&quot;https://github.com/davidswelt/aquamacs-emacs/issues/127&quot; rel=&quot;nofollow noreferrer&quot;&gt;posted here&lt;/a&gt;, which &lt;em&gt;worksforme&lt;/em&gt;. &#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;--- Contents/Resources/lisp/aquamacs/macosx/aquamacs-frame-setup.el.orig    2017-04-06 14:38:45.000000000 -0400&#xA;+++ Contents/Resources/lisp/aquamacs/macosx/aquamacs-frame-setup.el 2017-04-06 16:30:54.000000000 -0400&#xA;@@ -79,7 +79,7 @@&#xA;  '((create-frame-min-width 68)&#xA; ;; do not set any fonts here. aquamacs.el takes care of this,&#xA; ;; checking that the fonts actually exist.&#xA;-   (default-frame-alist &#xA;+   (initial-frame-alist &#xA;      ((foreground-color . &quot;Black&quot;) (background-color . &quot;White&quot;) &#xA;       (cursor-type . box) (cursor-color . &quot;Red&quot;)&#xA;       (vertical-scroll-bars . right)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit your init-file&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your &lt;code&gt;~/.emacs&lt;/code&gt; or &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; or &lt;code&gt;~/Library/Preferences/Aquamacs Emacs/Preferences.el&lt;/code&gt; (where ever you load your theme from, add &lt;code&gt;(setq default-frame-alist nil)&lt;/code&gt; &lt;strong&gt;before&lt;/strong&gt; you load your theme, a la:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when window-system&#xA;  (when (featurep 'aquamacs)&#xA;    (setq default-frame-alist nil))&#xA;  (load-theme 'my-new-theme t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or, more simply:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq default-frame-alist nil)&#xA;(load-theme 'my-new-theme t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12713" LastEditorUserId="12713" LastEditDate="2017-04-06T21:11:08.907" LastActivityDate="2017-04-06T21:11:08.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31941" PostTypeId="2" ParentId="31875" CreationDate="2017-04-05T07:22:21.877" Score="2" Body="&lt;p&gt;cperl creates abbreviations for perl keywords into &lt;code&gt;~/.emacs.d/abbrev_defs&lt;/code&gt; that trigger function &lt;code&gt;cperl-electric-keyword&lt;/code&gt; that does the expansion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To remove the offending entries, call &lt;code&gt;M-x edit-abbrevs&lt;/code&gt;,&#xA;remove the lines you want, save, and press &lt;code&gt;C-c C-c&lt;/code&gt; to activate the changes.  &lt;/p&gt;&#xA;" OwnerUserId="903" LastActivityDate="2017-04-05T07:22:21.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31942" PostTypeId="1" CreationDate="2017-04-05T07:41:29.027" Score="2" ViewCount="697" Body="&lt;p&gt;Files above about 5kb fail to load in tramp mode, with the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tramp-file-name-handler: Invalid base64 data&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Loading smaller files works fine:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Inserting ‘/scp:server:small_file’...&#xA;Tramp: Encoding remote file ‘/scp:server:small_file’ with ‘base64 &amp;lt;%s’...done&#xA;Tramp: Decoding local file ‘/tmp/tramp.13491uQF.py’ with ‘base64-decode-region’...done&#xA;Tramp: Inserting ‘/scp:server:small_file’...done&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But with larger files I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tramp: Inserting ‘/scp:server:larger_file’...&#xA;Tramp: Encoding remote file ‘/scp:server:larger_file’ with ‘(gzip &amp;lt;%s | base64)’...done&#xA;Tramp: Decoding local file ‘/tmp/tramp.13491iyp.py’ with ‘(lambda (beg end) (base64-decode-region beg end) (let ((coding-system-for-write (quote binary)) (coding-system-for-read (quote binary)) (default-directory (tramp-compat-temporary-file-directory))) (apply (quote tramp-call-process-region) [scp nil kronos larger_file nil] (point-min) (point-max) (car (split-string gzip -d)) t t nil (cdr (split-string gzip -d)))))’...failed&#xA;Tramp: Inserting ‘/scp:server:larger_file’...failed&#xA;tramp-file-name-handler: Invalid base64 data&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've checked the gzip command on the remote server, it seems to be working. Can I get tramp to keep the intermediate files around so I can inspect them? How else can I debug this?&lt;/p&gt;&#xA;" OwnerUserId="11407" LastActivityDate="2017-04-07T11:03:17.543" Title="Tramp cannot load larger files (Invalid base64 data)" Tags="|tramp|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31943" PostTypeId="1" CreationDate="2017-04-05T08:37:57.453" Score="0" ViewCount="291" Body="&lt;p&gt;Here's my setup:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Tramp on remote&#xA;:PROPERTIES:&#xA;:header-args: :dir /ssh:me@server.com|ssh:me@remote:/project/&#xA;:END:&#xA;&#xA;#+BEGIN_SRC ipython :session :results output drawer&#xA;import pandas as pd&#xA;data = pd.read_csv('/project/path/to/file/data.txt')&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I run the code, tramp complains that the file &lt;code&gt;'/project/path/to/file/data.txt'&lt;/code&gt; does not exist. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;FileNotFoundError: [Errno 2] No such file or directory:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, the file does exist on the remote, and if I switch to the org-babel session and type in the commands directly, then I don't get any errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what could be happening here?&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-04-05T08:37:57.453" Title="Tramp Ipython remote session: Problems with remote paths within code" Tags="|org-mode|org-babel|tramp|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31944" PostTypeId="2" ParentId="5342" CreationDate="2017-04-05T09:25:05.217" Score="8" Body="&lt;p&gt;You can set the fringe color to nil, in which case you don't need to worry about any theme changes. I've got the following in my config:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(set-face-attribute 'fringe nil :background nil)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the fringe just disappears.... :)&lt;/p&gt;&#xA;" OwnerUserId="11028" LastActivityDate="2017-04-05T09:25:05.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31946" PostTypeId="1" CreationDate="2017-04-05T10:24:00.207" Score="3" ViewCount="98" Body="&lt;p&gt;There's some stuff in the mode-line that's &quot;global&quot;, not particular to that buffer, e.g. date-time-load, org-clock task and erc-track. If &lt;code&gt;split-window-right&lt;/code&gt;, that stuff is both duplicated and truncated in the same way in both windows, e.g. here the org clock task name is truncated (scroll right to see the duplication):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;27: 0 U ~/foo.el Top Elisp 12:19 [#ha] [1:31] [Procrast| 99: 0 U ~/foo.el 83% ELisp 12:19 [#ha] [1:31] [Procrast&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a way to truncate only the &quot;global&quot; stuff such that I get as much information as possible? E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;27: 0 U ~/foo.el Top Elisp 12:19 [#ha] [1:31] [Procras…| 99: 0 U ~/foo.el 83% Elisp 12:19 …tination]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(scroll right to see the non-duplication)&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2017-04-05T10:24:00.207" Title="&quot;shared global mode-line info&quot;" Tags="|mode-line|" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31947" PostTypeId="1" AcceptedAnswerId="31948" CreationDate="2017-04-05T12:04:39.793" Score="3" ViewCount="416" Body="&lt;p&gt;I really like the &lt;code&gt;ido-use-virtual-buffers&lt;/code&gt;/&lt;code&gt;ivy-use-virtual-buffers&lt;/code&gt; features, but unfortunately if you have five files named &lt;code&gt;style.css&lt;/code&gt; in different projects, it is less useful. With already-opened buffers in &lt;code&gt;ivy-switch-buffer&lt;/code&gt;, I see &lt;code&gt;style.css|fooproject&lt;/code&gt; &lt;code&gt;style.css|barproject&lt;/code&gt;, while for the stuff from recentf, I just see a single &lt;code&gt;style.css&lt;/code&gt; with no distinguishing folder name. Is there a way to put distinguishers on the virtual buffers too?&lt;/p&gt;&#xA;" OwnerUserId="730" LastActivityDate="2017-04-07T18:14:04.020" Title="distinguish ido/ivy's virtual-buffers with equal names using directory?" Tags="|ido|recentf|ivy|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31948" PostTypeId="2" ParentId="31947" CreationDate="2017-04-05T12:04:39.793" Score="5" Body="&lt;p&gt;According to &lt;a href=&quot;https://github.com/abo-abo/swiper/issues/648&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/abo-abo/swiper/issues/648&lt;/a&gt;, it's simply&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (setq ivy-virtual-abbreviate 'full)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's not quite as nice as opened buffers (where only the differing part is shown), but good enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I haven't found anything like that for ido though.)&lt;/p&gt;&#xA;" OwnerUserId="730" LastEditorUserId="730" LastEditDate="2017-04-07T18:14:04.020" LastActivityDate="2017-04-07T18:14:04.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31949" PostTypeId="1" AcceptedAnswerId="31955" CreationDate="2017-04-05T12:53:07.430" Score="1" ViewCount="314" Body="&lt;p&gt;For example, the master file is named test.org with the following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+title: test&#xA;&#xA;* test&#xA;#+BEGIN_SRC python :exports results :results output raw&#xA;#! /usr/bin/env python     &#xA;# -*- coding: utf-8 -*-   &#xA;print('#+include: &quot;hello.org&quot;')&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;hello.org is in the current folder with the following content:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* hello world&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;run org-export-to-odt in the buffer of test.org doesn't include hello.org.&lt;/p&gt;&#xA;" OwnerUserId="4036" LastEditorUserId="105" LastEditDate="2017-04-05T13:33:10.627" LastActivityDate="2017-04-05T17:15:42.633" Title="#+include in source block not working in org export" Tags="|org-mode|org-export|odt|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31950" PostTypeId="2" ParentId="31834" CreationDate="2017-04-05T12:53:26.457" Score="3" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;In-buffer settings start with ‘#+’, followed by a keyword, a colon, and then a word for each setting.&lt;/p&gt;&#xA;&lt;p&gt;(info &amp;quot;(org) In-buffer settings&amp;quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Your macro definition lacks the colon: &lt;code&gt;#+MACRO:&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-04-05T12:53:26.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31951" PostTypeId="1" AcceptedAnswerId="31952" CreationDate="2017-04-05T14:23:08.323" Score="2" ViewCount="68" Body="&lt;p&gt;I remember using a package to quickly switch between windows, it was a key like C-something and then on each window a letter appeared for example if you have 4 windows then you have a, b, c and d. Depending on the letter you pressed you moved to its corresponding window. I don't remember the name of the package, I think I've installed it together with some starter kit but don't remember which. Now I use C-x o or S-arrows but I don't like it.&lt;/p&gt;&#xA;" OwnerUserId="15438" LastActivityDate="2017-04-05T14:43:24.153" Title="What is the name of the package for quickly switching between windows by using some key and then a, b, c or d?" Tags="|package|window|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31952" PostTypeId="2" ParentId="31951" CreationDate="2017-04-05T14:43:24.153" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/abo-abo/ace-window&quot; rel=&quot;noreferrer&quot;&gt;ace-window&lt;/a&gt; provides this function.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-04-05T14:43:24.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31954" PostTypeId="2" ParentId="24784" CreationDate="2017-04-05T16:35:29.813" Score="2" Body="&lt;p&gt;It is correct that ansi-term only supports 8 colors, but, using xterm-color.el instead of ansi-color.el, you get 256 colors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;ANSI &amp;amp; xterm-256 color text property translator for Emacs&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/atomontage/xterm-color&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/atomontage/xterm-color&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15421" LastActivityDate="2017-04-05T16:35:29.813" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31955" PostTypeId="2" ParentId="31949" CreationDate="2017-04-05T17:15:42.633" Score="2" Body="&lt;p&gt;During export, include keywords are parsed before babel evaluation of source blocks. By the time the block is evaluated and the include line is produced, it's too late to process it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might do an export to org instead with &lt;code&gt;C-c O o&lt;/code&gt;, producing a &lt;code&gt;test.org.org&lt;/code&gt; file that contains the include. Then export &lt;em&gt;that&lt;/em&gt; file to ODT.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastActivityDate="2017-04-05T17:15:42.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31956" PostTypeId="1" CreationDate="2017-04-05T19:02:12.490" Score="3" ViewCount="272" Body="&lt;p&gt;I'm overriding &lt;code&gt;double-mouse-1&lt;/code&gt; to do additional stuff on top of its default behavior. To this end, I have a function that (1) does my additional stuff and then (2) calls another function, &lt;code&gt;ora-mark-like-double-mouse-1&lt;/code&gt;, which simulates normal &lt;code&gt;double-mouse-1&lt;/code&gt; behavior (copied from &lt;a href=&quot;https://emacs.stackexchange.com/a/21922/14269&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(transient-mark-mode t)&#xA;&#xA;(defun ora-mark-like-double-mouse-1 ()&#xA;  (interactive)&#xA;  (let ((bnd (mouse-start-end (point) (point) 1)))&#xA;    (goto-char (car bnd))&#xA;    (push-mark)&#xA;    (set-mark (point))&#xA;    (goto-char (cadr bnd))&#xA;&#xA;    ; The addition of this line produces a different,&#xA;    ; but also wrong effect, in which the selection vanishes&#xA;    ; immediately after appearing.&#xA;    (setq deactivate-mark t)&#xA;  )&#xA;)&#xA;&#xA;(global-set-key [(double-mouse-1)] 'ora-mark-like-double-mouse-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this function is slightly flawed. It selects the clicked-on word as the region, but afterwards, any non-shifted cursor movement I do with the arrow keys causes the existing region to be expanded, rather than deactivated. This is different from normal &lt;code&gt;double-mouse-1&lt;/code&gt; behavior. This happens even if I just bind this function directly to &lt;code&gt;double-mouse-1&lt;/code&gt;, as I do in the code above (in which I have temporarily removed my own extra functionality, and I have added a call to &lt;code&gt;(setq deactivate-mark t)&lt;/code&gt;, which causes the selection to vanish immediately after appearing -- which is not the correct behavior either).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to set it so that, after calling this function, which selects a region, subsequent non-shifted cursor movement will cause the region to be deactivated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if there some way to set up a hook to run after a double-click event, I wouldn't need to override and reimplement the default functionality at all. (It would also solve the problem that the linked-to function doesn't work when I double-click on the opening quote.)&lt;/p&gt;&#xA;" OwnerUserId="14269" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.653" LastActivityDate="2017-04-10T17:03:31.960" Title="Making it so that cursor movement after command will deactivate region" Tags="|key-bindings|hooks|region|mouse|mark|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31957" PostTypeId="2" ParentId="29891" CreationDate="2017-04-05T19:51:15.460" Score="1" Body="&lt;p&gt;Emacs invokes inferior processes with a pseudo-TTY device as standard input. TXR's listener &lt;code&gt;isatty&lt;/code&gt; to decide whether the input is an interactive device; if so, then it goes into raw mode and provides editing, driving the terminal with ANSI/VT100 codes. It ignores the &lt;code&gt;TERM&lt;/code&gt; environment variable's existence status or contents, or other such clues for whether to drive the terminal, or with what escape sequence language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting in TXR 174, the existing &lt;code&gt;-n&lt;/code&gt;/&lt;code&gt;--noninteractive&lt;/code&gt; option's meaning has been extended: if the option is present, it causes the listener to treat the device as a non-TTY and operate in &quot;plain&quot; mode: line-buffered input with no prompts, no editing features and no generation of any ANSI/VT100 codes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, an important bugfix has been applied to make this plain mode actually work correctly. &lt;strong&gt;Even if there is some trick in Emacs to run the inferior Lisp using just a pipe device, that bugfix is still required.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fixes were tested using &lt;code&gt;emacs&lt;/code&gt; as to their efficacy in supporting the inferior Lisp operation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;-n&lt;/code&gt; option can &quot;clump&quot; with &lt;code&gt;-i&lt;/code&gt;, as in &lt;code&gt;txr -ni&lt;/code&gt; or &lt;code&gt;txr -in&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14679" LastActivityDate="2017-04-05T19:51:15.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31958" PostTypeId="2" ParentId="31932" CreationDate="2017-04-05T21:08:38.863" Score="1" Body="&lt;p&gt;The variable is now called &lt;code&gt;org-babel-default-header-args&lt;/code&gt;. There are also similar variables for each language supported by babel. I don't remember what &lt;code&gt;params&lt;/code&gt; meant in older versions, however, so I'm not sure if this is an exact replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, &lt;code&gt;C-h-v org-babel- TAB&lt;/code&gt; is a nice way to find out all the variables whose names have the prefix &lt;code&gt;org-babel-&lt;/code&gt;. And one thing that org 9.x has going for it is that it has much more predictable names for variables and functions in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I read your comment and took a look through the code: I don't think that what you want can be done with unmodified org-mode. I was only able to do it by adding a (dynamically bound) variable and assigning to it the (internal) value of params just before the block was executed. Obviously, that invalidates your warranty :-). Here's the diff:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff --git a/lisp/ob-core.el b/lisp/ob-core.el&#xA;index 9f67000..dfcc7a9 100644&#xA;--- a/lisp/ob-core.el&#xA;+++ b/lisp/ob-core.el&#xA;@@ -628,6 +628,8 @@ a list with the following pattern:&#xA;    (setf (nth 2 info) (org-babel-generate-file-param name (nth 2 info)))&#xA;    info))))&#xA;&#xA;+(defvar org-babel-params)&#xA;+&#xA; ;;;###autoload&#xA; (defun org-babel-execute-src-block (&amp;amp;optional arg info params)&#xA;   &quot;Execute the current source code block.&#xA;@@ -696,6 +698,7 @@ block.&quot;&#xA;         (capitalize lang)&#xA;         (let ((name (nth 4 info)))&#xA;           (if name (format &quot; (%s)&quot; name) &quot;&quot;)))&#xA;+       (setq org-babel-params params)&#xA;    (if (member &quot;none&quot; result-params)&#xA;        (progn (funcall cmd body params)&#xA;           (message &quot;result silenced&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The source block would be modified to print &lt;code&gt;org-babel-params&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2017-04-07T01:43:18.170" LastActivityDate="2017-04-07T01:43:18.170" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="31959" PostTypeId="2" ParentId="31779" CreationDate="2017-04-05T21:15:27.840" Score="7" Body="&lt;p&gt;The following is a prototype implementation of an approximation of what you want.&#xA;It exploits the fact that new branches in the undo-tree are added at the left-hand side of the current node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key-sequence &lt;kbd&gt;C-M-_&lt;/kbd&gt; is bound to &lt;code&gt;undo-tree-walk&lt;/code&gt; which walks the right-upper part of the undo tree starting at the current node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behavior differs from what you want if the active branch of some sub-tree on the right-hand side of the current node is not the left-most branch in that sub-tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get in such a state by non-trival undo/redo-sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just try it for yourself to see whether that is sufficient for your application.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defvar-local undo-tree-walk&#xA;  &quot;Possible values:&#xA;nil: not in undo/redo-chain&#xA;undo: traversing undo tree upwards&#xA;redo: traversing undo tree downwards&#xA;&quot;)&#xA;&#xA;(setq undo-tree-walk nil)&#xA;&#xA;(defun undo-tree-walk ()&#xA;  &quot;Walk the right-upper part of the undo-tree starting at the current node.&quot;&#xA;  (interactive)&#xA;  (when (eq buffer-undo-list t)&#xA;    (user-error &quot;No undo information.&quot;))&#xA;  (unless undo-tree-mode&#xA;    (user-error &quot;`undo-tree-walk' should only be used with `undo-tree-mode'.&quot;))&#xA;  (undo-list-transfer-to-tree)&#xA;  (set-transient-map undo-tree-walk-map t #'undo-tree-walk-off)&#xA;  (let ((num-branches (undo-tree-num-branches)))&#xA;    (cond&#xA;     ((= num-branches 0) ; arrived at leaf&#xA;      (setq undo-tree-walk 'undo))&#xA;     ((&amp;gt; num-branches 1) ; &#xA;      (let ((branch (undo-tree-node-branch (undo-tree-current buffer-undo-tree))))&#xA;    (setf (undo-tree-node-branch (undo-tree-current buffer-undo-tree))&#xA;          (if (&amp;gt;= (1+ branch) (undo-tree-num-branches))&#xA;          (progn&#xA;            (setq undo-tree-walk 'undo)&#xA;            (1- (undo-tree-num-branches)))&#xA;        (setq undo-tree-walk 'redo)&#xA;        (1+ branch))))&#xA;      ;; no state change for (= num-branches 1)&#xA;      )&#xA;     ))&#xA;  (case undo-tree-walk&#xA;   (undo&#xA;    (undo-tree-undo-1))&#xA;   (redo&#xA;    (undo-tree-redo-1))&#xA;   (t&#xA;    (setq undo-tree-walk 'undo)&#xA;    (undo-tree-undo-1)))&#xA;  (let ((curbuf (current-buffer)))&#xA;    (undo-tree-visualize)&#xA;    (switch-to-buffer-other-window curbuf)))&#xA;&#xA;(defun undo-tree-walk-off ()&#xA;  &quot;Switch `undo-tree-walk' off.&quot;&#xA;  (setq undo-tree-walk nil))&#xA;&#xA;(defvar undo-tree-walk-map&#xA;  (make-sparse-keymap)&#xA;  &quot;Keymap active while `undo-tree-walk'.&quot;)&#xA;&#xA;(define-key undo-tree-walk-map (kbd &quot;C-M-_&quot;) #'undo-tree-walk)&#xA;&#xA;(global-set-key (kbd &quot;C-M-_&quot;) #'undo-tree-walk)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, that I added &lt;code&gt;undo-tree-visualize&lt;/code&gt; to the end of &lt;code&gt;undo-tree-walk&lt;/code&gt; to display the consequences of walking the undo-tree with &lt;code&gt;undo-tree-walk&lt;/code&gt;.&#xA;Feel free to modify the code to your likings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also, that I had to choose this most simple approximation of a solution for your problem because of time-restrictions.&lt;/p&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2017-04-06T03:04:03.863" LastActivityDate="2017-04-06T03:04:03.863" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31960" PostTypeId="1" AcceptedAnswerId="31967" CreationDate="2017-04-05T21:34:16.117" Score="1" ViewCount="266" Body="&lt;p&gt;I'm using wanderlust in emacs-25.1.x&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a way to select a group of messages and have all of their MIME attachments extracted and saved into a specified folder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that I can mark the messages with the target mark ('*'), and use 'wl-summary-target-mark-set-action' to specify an action to run on each of these marked messages. However, I don't know what action will save all MIME attachments in any given message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have searched through the wanderlust docs, but I couldn't find anything. If this info is documented somewhere, could someone point me to it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastActivityDate="2017-04-07T12:09:38.343" Title="wanderlust: save all attachments in a group of messages" Tags="|mark|attachment|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31961" PostTypeId="2" ParentId="31956" CreationDate="2017-04-05T23:08:50.533" Score="3" Body="&lt;p&gt;End your command with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq deactivate-mark  t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(deactivate-mark)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h v deactivate-mark&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;deactivate-mark&lt;/code&gt;&lt;/strong&gt; is a variable defined in &lt;code&gt;C source code&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Its value is &lt;code&gt;nil&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Automatically becomes buffer-local when set.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Documentation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If an editing command sets this to &lt;code&gt;t&lt;/code&gt;, deactivate the mark afterward.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The command loop sets this to &lt;code&gt;nil&lt;/code&gt; before each command,&#xA;  and tests the value when the command returns.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Buffer modification stores &lt;code&gt;t&lt;/code&gt; in this variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;C-h f deactivate-mark&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;code&gt;deactivate-mark&lt;/code&gt;&lt;/strong&gt; is a compiled Lisp function in &lt;code&gt;simple.el&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;code&gt;(deactivate-mark &amp;amp;optional FORCE)&lt;/code&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Deactivate the mark.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If Transient Mark mode is disabled, this function normally does&#xA;  nothing; but if &lt;code&gt;FORCE&lt;/code&gt; is non-&lt;code&gt;nil&lt;/code&gt;, it deactivates the mark anyway.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Deactivating the mark sets &lt;code&gt;mark-active&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt;, updates the&#xA;  primary selection according to &lt;code&gt;select-active-regions&lt;/code&gt;, and runs&#xA;  &lt;code&gt;deactivate-mark-hook&lt;/code&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If Transient Mark mode was temporarily enabled, reset the value&#xA;  of the variable &lt;code&gt;transient-mark-mode&lt;/code&gt;; if this causes Transient&#xA;  Mark mode to be disabled, don’t change &lt;code&gt;mark-active&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; or&#xA;  run &lt;code&gt;deactivate-mark-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The variable and the function do not have the same effect. You can decide which effect you want/need.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-04-05T23:08:50.533" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31962" PostTypeId="1" AcceptedAnswerId="31966" CreationDate="2017-04-05T23:20:41.360" Score="4" ViewCount="684" Body="&lt;p&gt;The org-mode source&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: toc:nil creator:nil author:nil timestamp:nil num:t validate:nil&#xA;#+OPTIONS: tex:imagemagick&#xA;#+LaTeX_HEADER: \usepackage{tikz}&#xA;&#xA;\begin{tikzpicture}&#xA;   \draw (0,0) circle (3cm);&#xA;\end{tikzpicture}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;exports to HTML like a charm. However, the LaTeX snippet is converted to PNG format. Is there a &lt;em&gt;simple&lt;/em&gt; way to persuade the system to use SVG rather than PNG?&lt;/p&gt;&#xA;" OwnerUserId="13168" LastActivityDate="2017-04-06T02:35:29.763" Title="How to export LaTeX snippets to HTML via SVG rather than PNG?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31965" PostTypeId="1" AcceptedAnswerId="31979" CreationDate="2017-04-06T01:45:27.377" Score="2" ViewCount="708" Body="&lt;p&gt;I am trying to write the following function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun define-keymap-onto-keymap (from-map to-map)&#xA;  (map-keymap&#xA;   (lambda (key cmd) (define-key to-map key cmd))&#xA;   from-map))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My implementation above does not work in general, since&#xA;the &lt;code&gt;key&lt;/code&gt; argument to map-keymap is not a key,&#xA;but an event, which is not always understood by &lt;code&gt;define-key&lt;/code&gt;. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-keymap-onto-keymap&#xA; (let ((kmap (make-sparse-keymap)))&#xA;   (define-key kmap (kbd &quot;&amp;lt;s-return&amp;gt;&quot;) nil)&#xA;   kmap)&#xA; emacs-lisp-mode-map)&#xA;*** Eval error ***  Wrong type argument: arrayp, s-return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-keymap-onto-keymap&#xA; (let ((kmap (make-sparse-keymap)))&#xA;   (define-key kmap (kbd &quot;s-2&quot;) nil)&#xA;   kmap)&#xA; emacs-lisp-mode-map)&#xA;*** Eval error ***  Wrong type argument: arrayp, 8388658&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a&#xA;function similar to define-key, which understands whatever may be&#xA;the type of &lt;code&gt;key&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not interested in solutions like &lt;code&gt;derived-mode-merge-keymaps&lt;/code&gt;, which use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setcdr (nthcdr (1- (length new)) new) old)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which can result in infinite lists, and I'm not interested in a brand-new copy of &lt;code&gt;from-map&lt;/code&gt;,&#xA;like in &lt;code&gt;keymap--merge-bindings&lt;/code&gt; but to add&#xA;bindings to an existing &lt;code&gt;to-map&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I just append &lt;code&gt;from-map&lt;/code&gt; onto &lt;code&gt;to-map&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2017-04-06T02:10:08.340" LastActivityDate="2017-04-06T15:06:17.653" Title="define bindings of map a into map b" Tags="|keymap|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31966" PostTypeId="2" ParentId="31962" CreationDate="2017-04-06T02:35:29.763" Score="5" Body="&lt;p&gt;By default the exporter uses Mathjax. You are explicitly over-riding this with the &lt;code&gt;tex:imagemagick&lt;/code&gt; option, which uses PNG instead. The option &lt;code&gt;tex:dvisvgm&lt;/code&gt; selects svg format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://orgmode.org/manual/Math-formatting-in-HTML-export.html#Math-formatting-in-HTML-export&quot; rel=&quot;noreferrer&quot;&gt;http://orgmode.org/manual/Math-formatting-in-HTML-export.html#Math-formatting-in-HTML-export&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-04-06T02:35:29.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31967" PostTypeId="2" ParentId="31960" CreationDate="2017-04-06T02:47:39.963" Score="1" Body="&lt;p&gt;I briefly Googled, but did not find an example of a multiple file extract function that I thought I had once read somewhere.  I only found a multiple attach example.  Here is a simplified version of what I use in my own-setup -- I like to check for an existing file with the same name as I extract all files from a single message, and if there is none, then I just keep hitting the return key -- the additional advantage is that I can change the file name if I so choose.  I would recommend perfecting a custom solution for single messages, and then expand the answer to include multiple messages:&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defun multi-extract ()&#xA;&quot;Doc-string&quot;&#xA;(interactive)&#xA;  (let* (&#xA;      (original-buffer (current-buffer))&#xA;      (multi-extract-regexp (concat&#xA;        &quot;^\\[[*].*\\]$&quot;&#xA;        &quot;\\|&amp;lt;application/.* (base64)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;image/x-png (base64)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;image/png (base64)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;image/jpeg (base64)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;image/bmp (base64)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;image/pjpeg (base64)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;audio/wav (base64)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;application/octet-stream (7bit)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;application/octet-stream (quoted-printable)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;text/plain; windows-1252 (7bit)&amp;gt;&quot;&#xA;        &quot;\\|&amp;lt;application/pdf (quoted-printable)&amp;gt;&quot;))&#xA;      entity basename filename dired-basename-maybe&#xA;      mime-extract-dir prospective-filename)&#xA;    (save-excursion&#xA;      (unless (re-search-forward multi-extract-regexp nil t)&#xA;        (message &quot;`multi-extract' could not locate any attachments.&quot;)))&#xA;    (save-excursion&#xA;      (goto-char (point-min))&#xA;      (while (re-search-forward multi-extract-regexp nil t)&#xA;        (setq entity (get-text-property (match-beginning 0) 'mime-view-entity))&#xA;        (setq prospective-filename&#xA;          (read-file-name &quot;file-name:  &quot;&#xA;            (if mime-extract-dir mime-extract-dir default-directory)))&#xA;        (setq mime-extract-dir (file-name-directory prospective-filename))&#xA;        (setq dired-basename-maybe (if (not (file-directory-p prospective-filename)) (file-name-nondirectory prospective-filename)))&#xA;        (setq basename (mime-entity-safe-filename entity))&#xA;        (setq filename (read-string &quot;Save-As:  &quot; (concat mime-extract-dir (if dired-basename-maybe dired-basename-maybe basename) )))&#xA;        (if (file-exists-p filename)&#xA;          (or (y-or-n-p (format &quot;File %s exists.  Save anyway? &quot; filename))&#xA;            (let ((debug-on-quit nil))&#xA;              (signal 'quit '(&quot;You chose to quit -- a file with that name already exists.&quot;)))))&#xA;        (mime-write-entity-content entity filename)))&#xA;    (when (and filename (buffer-live-p original-buffer))&#xA;      (with-current-buffer original-buffer&#xA;        (when (eq major-mode 'mime-view-mode)&#xA;          (setq default-directory (file-name-directory filename)))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-04-06T02:47:39.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31968" PostTypeId="1" AcceptedAnswerId="35716" CreationDate="2017-04-06T06:22:50.623" Score="2" ViewCount="946" Body="&lt;p&gt;The org-mode source&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+OPTIONS: toc:nil creator:nil author:nil timestamp:nil num:t validate:nil&#xA;#+OPTIONS: tex:dvisvgm&#xA;#+LaTeX_HEADER: \usepackage{tikz}&#xA;&#xA;\begin{tikzpicture}&#xA;   \draw (0,0) circle (3cm);&#xA;\end{tikzpicture}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;exports cleanly to HTML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;tex&lt;/code&gt; option can be changed from &lt;code&gt;dvisvgm&lt;/code&gt; to &lt;code&gt;dvipng&lt;/code&gt; or &lt;code&gt;imagemagick&lt;/code&gt; and it continues to work, but with a difference: When using &lt;code&gt;dvipng&lt;/code&gt; or &lt;code&gt;imagemagick&lt;/code&gt; the image size is constant; when using &lt;code&gt;dvisvgm&lt;/code&gt; the image size is automatically adjusted to occupy the maximum space available. This means that the image size changes as the browser window is resized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to keep the image size constant when exporting images created by LaTeX snippets to HTML via SVG?&lt;/p&gt;&#xA;" OwnerUserId="13168" LastActivityDate="2017-09-24T09:06:38.790" Title="How to control image size when exporting to HTML via dvisvgm?" Tags="|org-mode|org-export|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31969" PostTypeId="2" ParentId="31875" CreationDate="2017-04-06T06:34:58.953" Score="1" Body="&lt;p&gt;Since it looks like cperl-mode always rewrites its abbreviations, my previous answer is not a long term solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better solution is to run a hook after cperl has been loaded and redefine the &lt;code&gt;cperl-mode-abbrev-table&lt;/code&gt;. Add it to your emacs configuration file after other commands modifying cperl. I've removed the loop abbreviations from the redefined table, but &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;do&lt;/code&gt; expansions are still there.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'cperl-mode-hook&#xA;        (lambda ()&#xA;          (clear-abbrev-table cperl-mode-abbrev-table)&#xA;          (define-abbrev-table 'cperl-mode-abbrev-table&#xA;            '(&#xA;              (&quot;=head1&quot; &quot;=head1&quot; cperl-electric-pod 0)&#xA;              (&quot;=head2&quot; &quot;=head2&quot; cperl-electric-pod 0)&#xA;              (&quot;=over&quot; &quot;=over&quot; cperl-electric-pod 0)&#xA;              (&quot;=pod&quot; &quot;=pod&quot; cperl-electric-pod 0)&#xA;              (&quot;continue&quot; &quot;continue&quot; cperl-electric-else 0)&#xA;              (&quot;do&quot; &quot;do&quot; cperl-electric-keyword 0)&#xA;              (&quot;else&quot; &quot;else&quot; cperl-electric-else 0)&#xA;              (&quot;elsif&quot; &quot;elsif&quot; cperl-electric-keyword 0)&#xA;              (&quot;head1&quot; &quot;head1&quot; cperl-electric-pod 0)&#xA;              (&quot;head2&quot; &quot;head2&quot; cperl-electric-pod 0)&#xA;              (&quot;if&quot; &quot;if&quot; cperl-electric-keyword 4)&#xA;              (&quot;over&quot; &quot;over&quot; cperl-electric-pod 0)&#xA;              (&quot;pod&quot; &quot;pod&quot; cperl-electric-pod 0)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="903" LastEditorUserId="903" LastEditDate="2017-04-06T14:05:14.830" LastActivityDate="2017-04-06T14:05:14.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31970" PostTypeId="1" AcceptedAnswerId="31975" CreationDate="2017-04-06T07:24:34.843" Score="5" ViewCount="201" Body="&lt;p&gt;&lt;strong&gt;The general case:&lt;/strong&gt;&lt;br&gt;&#xA;Simply put, given that I start two processes (&lt;code&gt;A&lt;/code&gt;and &lt;code&gt;B&lt;/code&gt;) with, e.g., &lt;code&gt;async-start-process&lt;/code&gt;, what is best way of killing &lt;code&gt;B&lt;/code&gt; if &lt;code&gt;A&lt;/code&gt; terminates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My specific usecase:&lt;/strong&gt;&lt;br&gt;&#xA;I'm debugging embedded software on an external chip and launch a GDB server that interfaces the chip and GDB like this &lt;code&gt;(gdb ... &quot;-ex \&quot;target remote ...\&quot;&quot;)&lt;/code&gt; and I want to kill the GDB server process when GDB quits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional edit:&lt;/strong&gt;&#xA;It would be nice to be able to kill the GDB server when quitting GDB, though. I.e., the opposite way around: hitting &lt;code&gt;q&lt;/code&gt; in the GDB buffer would shut everything down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried searching through the Emacs/elisp documentation, but I'm pretty new to elisp :) Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="9840" LastEditorUserId="9840" LastEditDate="2017-11-08T07:27:22.813" LastActivityDate="2017-11-08T07:27:22.813" Title="How to attach/connect two subprocesses?" Tags="|process|gdb|subprocess|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31972" PostTypeId="1" AcceptedAnswerId="31983" CreationDate="2017-04-06T10:23:46.307" Score="1" ViewCount="733" Body="&lt;p&gt;In &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt; I'm calling my annotated configurations file &lt;code&gt;settings.org&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'ob-tangle)&#xA;(org-babel-load-file&#xA; (expand-file-name &quot;~/.emacs.d/settings.org&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This generates &lt;code&gt;settings.el&lt;/code&gt; however for some reason the file only includes what corresponds to the first 100 lines of code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nothing in the section &lt;code&gt;Keymappings&lt;/code&gt; is making its way into &lt;code&gt;settings.el&lt;/code&gt;. What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It solely seems to be a problem with keybinding commands. I moved things around and add stuff to sections that work and none of this causes an issue. Yet keybinding definitions don't seem to work with org-babel.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Settings.el&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Lines 86-100 EOF in &lt;code&gt;settings.el&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;;; Headings&#xA;(setq foreground1 &quot;#ea056d&quot;)&#xA;(setq foreground2 &quot;#e0f200&quot;)&#xA;(setq foreground3 &quot;#ea056d&quot;)&#xA;(set-face-attribute 'org-level-1 nil&#xA;                     :foreground foreground1&#xA;                     :height 1.3&#xA;                     :weight 'bold)&#xA;(set-face-attribute 'org-level-2 nil&#xA;                     :foreground foreground2&#xA;                     :slant 'italic)&#xA;&#xA;(setq org-src-fontify-natively 1)&#xA;&#xA;;(require 'org)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EOF&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Settings.org&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The corresponding section in &lt;code&gt;settings.org&lt;/code&gt; is this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;Syntax highlighting in org code blocks&#xA;#+begin_src emacs-lisp&#xA;(setq org-src-fontify-natively 1)&#xA;#+end_src&#xA;&#xA;Load org mode&#xA;#+begin_src emacs-lisp&#xA;;(require 'org)&#xA;#+end_src&#xA;&#xA;&#xA;* Keymappings&#xA;** Switching between windows&#xA;This defines easy window switching, similar to my vim setup.&#xA;#+begin_src emacs-lisp&#xA;(define-key evil-normal-state-map (kbd &quot;C-h&quot;) 'evil-window-left)&#xA;(define-key evil-normal-state-map (kbd &quot;C-j&quot;) 'evil-window-down)&#xA;(define-key evil-normal-state-map (kbd &quot;C-k&quot;) 'evil-window-up)&#xA;(define-key evil-normal-state-map (kbd &quot;C-l&quot;) 'evil-window-right)&#xA;#+end_src emacs-lisp&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11028" LastEditorUserId="11028" LastEditDate="2017-04-06T12:58:50.397" LastActivityDate="2017-04-06T17:01:38.933" Title="org-babel-load-file doesn't load entire file" Tags="|init-file|org-babel|literate-programming|babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31973" PostTypeId="1" AcceptedAnswerId="31978" CreationDate="2017-04-06T12:16:10.150" Score="2" ViewCount="239" Body="&lt;p&gt;I was wondering if it is possible (with any reasonable amount of work) to add another mode line (i know there is the configurable header line), maybe right above or below the new mode line or even one under the mini buffer for the whole frame (like if i was running Emacs in tmux or GNUScreen).&lt;/p&gt;&#xA;" OwnerUserId="15073" LastEditorUserId="15073" LastEditDate="2017-04-07T05:04:13.927" LastActivityDate="2017-04-07T13:36:55.677" Title="Is there more than mode line (and header line)?" Tags="|mode-line|header-line|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31974" PostTypeId="2" ParentId="31960" CreationDate="2017-04-06T13:29:39.830" Score="0" Body="&lt;p&gt;I managed to do this by means of my second proposed method: copying the marked emails to files in a temp directory, and then processing these files via an external python program: &quot;/usr/local/bin/wl-image-process&quot;, in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The python program opens each message file and parses it using python's &quot;email&quot; package. It traverses the list of message parts for the multipart message, and if any of the items are of MIME types that I'm interested in (images), it processes them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my elisp code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-wl-save-dir-pattern (expand-file-name &quot;.wlsave-%Y%m%d%H%M%S%N&quot; wl-temporary-file-directory)&#xA;  &quot;*Temporary save directory pattern.&quot;)&#xA;&#xA;;; Save the message if it contains attachments.&#xA;(defun my-wl-summary-save-if-has-attachments (&amp;amp;optional wl-save-dir)&#xA;  &quot;Save current message to disk if it contains one or more attachments.&quot;&#xA;  (interactive)&#xA;  (let ((filename)&#xA;        (pathname)&#xA;        (num (wl-summary-message-number)))&#xA;    (unless wl-save-dir&#xA;      (setq wl-save-dir wl-temporary-file-directory))&#xA;    (if num&#xA;        (save-excursion&#xA;          (setq filename (concat (number-to-string num) wl-summary-save-file-suffix))&#xA;          (setq pathname (expand-file-name filename wl-save-dir))&#xA;          (wl-summary-set-message-buffer-or-redisplay)&#xA;          (save-excursion&#xA;            ;; This determines whether the message contains&#xA;            ;; any MIME parts.&#xA;            (if (get-text-property (point-min) 'mime-view-entity)&#xA;                (progn&#xA;                  (set-buffer (wl-message-get-original-buffer))&#xA;                  (write-region-as-binary (point-min) (point-max) pathname)&#xA;                  filename)&#xA;              nil)))&#xA;      nil)))&#xA;&#xA;;; Helper routine.&#xA;(defun my-wl-summary-display-subr ()&#xA;  (let ((wl-save-dir (format-time-string my-wl-save-dir-pattern))&#xA;        number&#xA;        item&#xA;        msg-list)&#xA;    (message &quot;processing ...&quot;)&#xA;    (unless (file-exists-p wl-save-dir)&#xA;      (make-directory wl-save-dir))&#xA;    (while (setq number (car wl-summary-buffer-target-mark-list))&#xA;      (wl-thread-jump-to-msg number)&#xA;      (let ((inhibit-message t))&#xA;        (setq item (my-wl-summary-save-if-has-attachments wl-save-dir)))&#xA;      (when item&#xA;        ;; '-snoc' is a 3rd-party routine&#xA;        ;; which does the opposite of 'cons'.&#xA;        (setq msg-list (-snoc msg-list item)))&#xA;      (wl-summary-unmark))&#xA;    (if msg-list&#xA;        (let* ((arg-list (append (list &quot;-d&quot; wl-save-dir) msg-list))&#xA;               (msg-count (length msg-list))&#xA;               (maybe-plural (if (= 1 msg-count) &quot;&quot; &quot;s&quot;))&#xA;               (program &quot;/usr/local/bin/wl-image-process&quot;))&#xA;          (with-temp-buffer&#xA;            (apply 'start-process &quot;process&quot; nil program arg-list))&#xA;          (message &quot;%d message%s processed&quot; msg-count maybe-plural))&#xA;      (message &quot;no messages processed&quot;))&#xA;    ))&#xA;&#xA;;; Process all attachments for all marked messages.&#xA;;; If no messages are marked, mark them all.&#xA;(defun my-wl-summary-marked-process-attachments ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (save-restriction&#xA;      (unless wl-summary-buffer-target-mark-list&#xA;        (wl-summary-target-mark-all))&#xA;      (my-wl-summary-process-subr)&#xA;      (wl-summary-toggle-disp-msg 'off))))&#xA;&#xA;;; Process all attachments for the current message only.&#xA;(defun my-wl-summary-process-attachments ()&#xA;  (interactive)&#xA;  (wl-summary-target-mark)&#xA;  (my-wl-summary-process-subr))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-07T12:09:38.343" LastActivityDate="2017-04-07T12:09:38.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31975" PostTypeId="2" ParentId="31970" CreationDate="2017-04-06T13:42:04.500" Score="5" Body="&lt;p&gt;For two processes &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; mutually killing each other you can use the following approach:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start the first process just with &lt;code&gt;start-process&lt;/code&gt; and remember its process (as lisp object).&lt;/li&gt;&#xA;&lt;li&gt;Start the second process &lt;code&gt;B&lt;/code&gt; with &lt;code&gt;async-start-process&lt;/code&gt; and kill &lt;code&gt;A&lt;/code&gt; in its &lt;code&gt;finish-func&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Define a process sentinel for &lt;code&gt;A&lt;/code&gt; which kills &lt;code&gt;B&lt;/code&gt; at exit of &lt;code&gt;A&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Running example:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun make-kill-other-proc-sentinel (other-proc)&#xA;  &quot;Create a process-sentinel killing other-proc when called.&quot;&#xA;  (assert (processp other-proc))&#xA;  `(lambda (proc &amp;amp;optional msg)&#xA;     (when (eq 'exit (process-status proc))&#xA;       (unless (eq 'exit (process-status ,other-proc))&#xA;     (kill-process ,other-proc)))))&#xA;&#xA;(let* ((proc1 (start-process &quot;*A*&quot; &quot;*A*&quot; &quot;xterm&quot; &quot;-T&quot; &quot;A&quot;))&#xA;       (proc2 (async-start-process &quot;*B*&quot; &quot;xterm&quot; (make-kill-other-proc-sentinel proc1) &quot;-T&quot; &quot;B&quot;)))&#xA;  (if (eq 'exit (process-status proc1))&#xA;      (kill-process proc2)&#xA;    (set-process-sentinel proc1 (make-kill-other-proc-sentinel proc2))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastEditorUserId="2370" LastEditDate="2017-04-07T08:47:06.240" LastActivityDate="2017-04-07T08:47:06.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31976" PostTypeId="2" ParentId="31920" CreationDate="2017-04-06T14:14:53.693" Score="3" Body="&lt;p&gt;The function designed specifically for that purpose is &lt;code&gt;font-lock-ensure&lt;/code&gt;.  So just call &lt;code&gt;(font-lock-ensure)&lt;/code&gt; or &lt;code&gt;(font-lock-ensure START END)&lt;/code&gt; before your call to &lt;code&gt;buffer-substring&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-04-06T14:14:53.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31977" PostTypeId="1" AcceptedAnswerId="32034" CreationDate="2017-04-06T14:36:17.293" Score="1" ViewCount="514" Body="&lt;p&gt;Using wanderlust in emacs-25.1.x, how can I specify the display size and position in the message buffer of attached images that are shown inline?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to display smaller versions of the images, and I'd like to arrange them in a grid at the bottom of the message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't find anything in the wanderlust docs about this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More info added ...&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK. Here's what I have been able to determine so far. Images are displayed using the code in semi/mime-image.el. Near the top of that file is a static-cond which is used to select different methods for displaying images. The one that is selected by default makes use of the standard emacs 'insert-image' function. Here is its doc string:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(insert-image IMAGE &amp;amp;optional STRING AREA SLICE)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Insert IMAGE into current buffer at point. IMAGE is displayed by&#xA;  inserting STRING into the current buffer with a ‘display’ property&#xA;  whose value is the image.  STRING defaults to a single space if you&#xA;  omit it. AREA is where to display the image.  AREA nil or omitted&#xA;  means display it in the text area, a value of ‘left-margin’ means&#xA;  display it in the left marginal area, a value of ‘right-margin’ means&#xA;  display it in the right marginal area. SLICE specifies slice of IMAGE&#xA;  to insert.  SLICE nil or omitted means insert whole image.  SLICE is a&#xA;  list (X Y WIDTH HEIGHT) specifying the X and Y positions and WIDTH and&#xA;  HEIGHT of image area to insert.  A float value 0.0 - 1.0 means&#xA;  relative to the width or height of the image; integer values are taken&#xA;  as pixel values.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, even if I change how 'insert-image' is called, it can't be used to resize the image ... only to reposition it and display slices (subsets) of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to resize these images, I am going to have to add code to redefine new versions the 'mime-image-create' and 'mime-image-insert' functions that normally get defined in semi/mime-image.el.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still not sure how to best do this. Perhaps I can use imagemagick's 'display' program to rescale the image text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm investigating this, and I will continue to report my findings.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-06T20:33:50.483" LastActivityDate="2017-04-11T18:23:50.723" Title="wanderlust: size and position of displayed images?" Tags="|images|wanderlust|" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31978" PostTypeId="2" ParentId="31973" CreationDate="2017-04-06T14:38:07.963" Score="5" Body="&lt;p&gt;In general, the fact that every window has only one mode-line is probably difficult to change (would require changes in the C code).  Similarly, adding something below the echo-area is going to require changes to the C code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do is to add a special window at the top of your frames (and if you want it to only occupy a single line, then you can remove its mode-line (by setting &lt;code&gt;mode-line-format&lt;/code&gt; to nil for its buffer) and then fill its buffer with whatever you want to be displayed there.&lt;/p&gt;&#xA;" OwnerUserId="1979" LastEditorUserId="15073" LastEditDate="2017-04-07T13:36:55.677" LastActivityDate="2017-04-07T13:36:55.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31979" PostTypeId="2" ParentId="31965" CreationDate="2017-04-06T15:06:17.653" Score="5" Body="&lt;p&gt;You can get the effect you want by setting a keymap's parent, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Inheritance-and-Keymaps.html&quot; rel=&quot;noreferrer&quot;&gt;(elisp) Inheritance and Keymaps&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A keymap can inherit the bindings of another keymap, which we call the&#xA;&quot;parent keymap&quot;.  Such a keymap looks like this:&#xA;&#xA;     (keymap ELEMENTS... . PARENT-KEYMAP)&#xA;&#xA;The effect is that this keymap inherits all the bindings of&#xA;PARENT-KEYMAP, whatever they may be at the time a key is looked up, but&#xA;can add to them or override them with ELEMENTS.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;can a keymap have multiple parents?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   Sometimes you want to make a keymap that inherits from more than one&#xA;map.  You can use the function ‘make-composed-keymap’ for this.&#xA;&#xA; -- Function: make-composed-keymap maps &amp;amp;optional parent&#xA;     This function returns a new keymap composed of the existing&#xA;     keymap(s) MAPS, and optionally inheriting from a parent keymap&#xA;     PARENT.[...]&#xA;&#xA;For example, here is how Emacs sets the parent of ‘help-mode-map’, such&#xA;that it inherits from both ‘button-buffer-map’ and ‘special-mode-map’:&#xA;&#xA;     (defvar help-mode-map&#xA;       (let ((map (make-sparse-keymap)))&#xA;         (set-keymap-parent map&#xA;           (make-composed-keymap button-buffer-map special-mode-map))&#xA;         ... map) ... )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The main problem with your original code is that a binding passed to &lt;code&gt;define-key&lt;/code&gt; must be a key sequence, see &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html&quot; rel=&quot;noreferrer&quot;&gt;(elisp) Key Sequences&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A &quot;key sequence&quot;, or &quot;key&quot; for short, is a sequence of one or more input&#xA;events that form a unit.  Input events include characters, function&#xA;keys, mouse actions, or system events external to Emacs, such as&#xA;‘iconify-frame’ (see Input Events).  The Emacs Lisp representation&#xA;for a key sequence is a string or vector.&#xA;[...]&#xA;   Key sequences containing function keys, mouse button events, system&#xA;events, or non-ASCII characters such as ‘C-=’ or ‘H-a’ cannot be&#xA;represented as strings; they have to be represented as vectors.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas, &lt;code&gt;map-keymap&lt;/code&gt; gives single events:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(map-keymap FUNCTION KEYMAP)&#xA;&#xA;Call FUNCTION once for each event binding in KEYMAP.&#xA;FUNCTION is called with two arguments: the event that is bound, and&#xA;the definition it is bound to.  The event may be a character range.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So your code should look more like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(map-keymap&#xA;   ;; FIXME: also handle case where KEY is a range.&#xA;   (lambda (key cmd) (define-key to-map (vector key) cmd))&#xA;   from-map)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;why don't I need the &lt;code&gt;(vector key)&lt;/code&gt; when defining the key into the first map?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(kbd &quot;&amp;lt;s-return&amp;gt;&quot;)&lt;/code&gt; gives &lt;code&gt;[s-return]&lt;/code&gt;, a vector.&lt;/p&gt;&#xA;" OwnerUserId="5296" LastActivityDate="2017-04-06T15:06:17.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31980" PostTypeId="1" CreationDate="2017-04-06T15:13:14.450" Score="4" ViewCount="735" Body="&lt;p&gt;Sometimes i work on remote machine (or several) via TRAMP. However, sometimes sessions end in such a way they cannot be reopened later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such situation, closing emacs results in unacceptable delays as futile failing attempts to reconnect to remote host go on; even if all buffers are killed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to avoid that and ensure emacs simply closes without resorting to means of sysstem process control?&lt;/p&gt;&#xA;" OwnerUserId="11047" LastActivityDate="2017-11-03T15:19:00.750" Title="Closing emacs after TRAMP session is aborted" Tags="|tramp|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31981" PostTypeId="1" CreationDate="2017-04-06T16:00:55.340" Score="1" ViewCount="183" Body="&lt;p&gt;As compiling LaTeX documents can take a while, I would like to be able to quickly and effortlessly check whether the compilation process is still runing. How can I achieve this with AUCTeX? I know I could take a look at the log with &lt;kbd&gt;C-c C-l&lt;/kbd&gt; and scroll to the bottom, but that doesn't really feel effortless. On the other hand, constantly following the log buffer (as with &lt;code&gt;TeX-show-compilation&lt;/code&gt;) is not nice either. Instead, I imagine, e.g., some (maybe animated) tag/icon appearing in the mode-line similarly to &quot;Loading&quot; when updating the package information:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/n6Lvj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/n6Lvj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As giordano has pointed out, actually the tag &quot;Compilation&quot; appears somewhere in the mode-line, yet this is easy to overlook. I guess my question then is whether it is possible to make this tag more visible, similarly to the TeX output buffer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kW0np.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kW0np.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;     &lt;/p&gt;&#xA;" OwnerUserId="12336" LastEditorUserId="12336" LastEditDate="2017-04-07T21:49:53.413" LastActivityDate="2017-04-07T21:49:53.413" Title="How to highlight in the mode-line that a compilation process is running in AUCTeX?" Tags="|auctex|mode-line|compilation|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31982" PostTypeId="1" CreationDate="2017-04-06T16:46:50.410" Score="2" ViewCount="32" Body="&lt;p&gt;I am writing my own custom Emacs theme and I would like to express &quot;if a face isn't explicitly listed above, don't color it&quot;.  Many modes have their own custom faces (e.g., Tuareg or Erlang mode) and I would rather not have to laboriously assign colors to every single one.&lt;/p&gt;&#xA;" OwnerUserId="14766" LastActivityDate="2017-04-06T16:46:50.410" Title="&quot;Catch-all&quot; rule for faces in theme definition" Tags="|faces|themes|" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31983" PostTypeId="2" ParentId="31972" CreationDate="2017-04-06T17:01:38.933" Score="2" Body="&lt;p&gt;You have &lt;code&gt;#+end_src emacs-lisp&lt;/code&gt;. This confuses &lt;code&gt;org-babel&lt;/code&gt;. Use just &lt;code&gt;#+end_src&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the &lt;a href=&quot;http://orgmode.org/manual/Easy-Templates.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;easy template&lt;/a&gt; system to insert structural elements and avoid such issues. Source blocks are &lt;code&gt;&amp;lt;s &amp;lt;TAB&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-04-06T17:01:38.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31984" PostTypeId="2" ParentId="31980" CreationDate="2017-04-06T18:39:23.393" Score="0" Body="&lt;p&gt;The Tramp FAQ says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• TRAMP does not recognize if a ‘ssh’ session hangs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ‘ssh’ sessions on the local host hang when the network is down.&#xA; TRAMP cannot safely detect such hangs.  The network configuration&#xA; for ‘ssh’ can be configured to kill such hangs with the following&#xA; command in the ‘~/.ssh/config’:&#xA;&#xA;      Host *&#xA;           ServerAliveInterval 5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Does that help?&lt;/p&gt;&#xA;" OwnerUserId="14825" LastActivityDate="2017-04-06T18:39:23.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31986" PostTypeId="1" CreationDate="2017-04-06T20:49:09.457" Score="0" ViewCount="356" Body="&lt;p&gt;By default Emacs' &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/lisp/ls-lisp.el&quot; rel=&quot;nofollow noreferrer&quot;&gt;ls-lisp&lt;/a&gt; shows the symlink destination in its output like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/tmp:&#xA;total used in directory 2 available 12933091&#xA;lrwxr-xr-x  40 02-07 16:12 foo -&amp;gt; bar&#xA;-rw-r--r--   0 03-06 14:45 bar&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any way to make ls-lisp not show the symlink destination (the &quot;-&gt; bar&quot; part)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for asking this is that the symlink destination can in some cases be very long and cause a linebreak, which looks ugly in dired.&lt;/p&gt;&#xA;" OwnerUserId="2075" LastEditorUserId="105" LastEditDate="2017-04-06T23:42:48.503" LastActivityDate="2017-04-07T02:32:11.203" Title="Hide symlink destination in ls-lisp output?" Tags="|dired|symbolic-links|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31987" PostTypeId="2" ParentId="31986" CreationDate="2017-04-06T23:54:49.720" Score="3" Body="&lt;p&gt;Dunno whether there is something specific to &lt;code&gt;ls-lisp&lt;/code&gt; (haven't found it), but for Dired more generally, if you turn on &lt;code&gt;dired-hide-details-mode&lt;/code&gt; (e.g., using &lt;strong&gt;&lt;code&gt;(&lt;/code&gt;&lt;/strong&gt;), and if you the value of option &lt;strong&gt;&lt;code&gt;dired-hide-details-hide-symlink-targets&lt;/code&gt;&lt;/strong&gt; is non-nil then the targets of symlinks are hidden when details are hidden.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If the length of the target name is a problem you can also consider using relative symbolic links, which are typically much shorter.  Command &lt;code&gt;dired-do-relsymlink&lt;/code&gt; (bound to &lt;code&gt;Y&lt;/code&gt;) from &lt;code&gt;dired-x.el&lt;/code&gt; creates a relative symlink.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-04-07T00:00:40.420" LastActivityDate="2017-04-07T00:00:40.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31988" PostTypeId="1" AcceptedAnswerId="32011" CreationDate="2017-04-07T02:10:57.313" Score="1" ViewCount="449" Body="&lt;p&gt;I'm writing some pseudo code having some symbols like λ (\lambda). Enabling &lt;code&gt;org-toggle-pretty-entities&lt;/code&gt; converts \lambda to λ in buffer, however when I export to HTML or latex, they are not converted. How can I use these symbols in src block.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm okay with using example, verse block or any other way of preserving newlines.&lt;/p&gt;&#xA;" OwnerUserId="11349" LastActivityDate="2019-04-04T01:44:55.183" Title="export latex symbol in src block org mode to latex and html" Tags="|org-mode|org-export|" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31989" PostTypeId="2" ParentId="31986" CreationDate="2017-04-07T02:32:11.203" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The reason for asking this is that the symlink destination can in some cases be very long and cause a linebreak, which looks ugly in dired.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;An alternative approach would be to enable line truncation for dired buffers:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'dired-mode-hook 'my-dired-mode-hook)&#xA;&#xA;(defun my-dired-mode-hook ()&#xA;  &quot;Custom `dired-mode' behaviours.&quot;&#xA;  (setq truncate-lines t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I do recommend using &lt;code&gt;dired-hide-details-mode&lt;/code&gt; as mentioned by Drew, but truncating lines might be preferable to entirely hiding symlink targets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;C-next&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;C-prior&amp;gt;&lt;/code&gt; (n.b. next/prior are typically Page Down and Page up keys) are used to scroll horizontally when lines are truncated.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-04-07T02:32:11.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31990" PostTypeId="2" ParentId="14197" CreationDate="2017-04-07T03:34:18.213" Score="7" Body="&lt;p&gt;write this into your &lt;code&gt;~/.emacs.d/init.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'sgml-mode)&#xA;&#xA;(defun ninrod/reformat-xml ()&#xA;  (interactive)&#xA;  (save-excursion&#xA;    (sgml-pretty-print (point-min) (point-max))&#xA;    (indent-region (point-min) (point-max))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;reload emacs, then just call &lt;code&gt;M-x reformat-xml&lt;/code&gt; on the badly formatted xml buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;source: &lt;a href=&quot;https://davidcapello.com/blog/emacs/reformat-xml-on-emacs/&quot; rel=&quot;noreferrer&quot;&gt;https://davidcapello.com/blog/emacs/reformat-xml-on-emacs/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12585" LastActivityDate="2017-04-07T03:34:18.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31991" PostTypeId="1" AcceptedAnswerId="32000" CreationDate="2017-04-07T05:09:09.063" Score="1" ViewCount="209" Body="&lt;p&gt;I was wondering if it is possible (with any reasonable amount of work) to write infos into the mini buffer (because not every window needs to tell me the time for example).&lt;/p&gt;&#xA;" OwnerUserId="15073" LastEditorUserId="105" LastEditDate="2017-04-07T17:53:01.073" LastActivityDate="2017-04-07T17:53:01.073" Title="Can I write Information into the mini-buffer (like an extra mode line)" Tags="|minibuffer|echo-area|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31994" PostTypeId="1" CreationDate="2017-04-07T09:59:16.327" Score="3" ViewCount="721" Body="&lt;p&gt;I want to create an Emacs-lisp file to store my org-mode configuration. This file will be loaded by &lt;code&gt;dotspacemacs/user-config&lt;/code&gt;. My question is where would it be the standard directory (if any) where I whould store this file? I was considering &lt;code&gt;.emacs.d/private/local&lt;/code&gt;, but I noticed it does not exists in &lt;code&gt;load-path&lt;/code&gt;, so I guessed it is not intended for this kind of use. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="105" LastEditDate="2017-04-07T17:50:57.687" LastActivityDate="2017-04-07T20:32:44.557" Title="Where would be the most appropriate directory to put my own Emacs-lisp files in Spacemacs?" Tags="|spacemacs|configuration-files|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31995" PostTypeId="2" ParentId="31994" CreationDate="2017-04-07T11:00:56.220" Score="3" Body="&lt;p&gt;It depends on what you want to do, essentially.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have lots of extra functionality to add, then have a look at creating your own private layer. There is a &lt;a href=&quot;http://thume.ca/howto/2015/03/07/configuring-spacemacs-a-tutorial/&quot; rel=&quot;nofollow noreferrer&quot;&gt;tutorial here&lt;/a&gt;, and on the spacemacs website, &lt;a href=&quot;http://spacemacs.org/doc/LAYERS.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you plan to have small config files under source control, then having them within your &lt;code&gt;.emacs.d&lt;/code&gt; is not a great idea because &lt;code&gt;.emacs.d&lt;/code&gt; is already the spacemacs repository, and you wouldn't want to mess up the spacemacs organization with random files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, I have a &lt;code&gt;~/Elisp&lt;/code&gt; directory where I keep my configuration files. This way I can have a repo with my personal config and have only a single directory that I have to add to the load path. When I grab some config files from other people, or repositories, I usually keep them in their own git repo (from where I cloned them), and add &lt;em&gt;symlinks&lt;/em&gt; to my &lt;code&gt;~/Elisp&lt;/code&gt; dir.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Small snippets of code go directly into the .spacemacs file, obviously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Looking forward to what other people suggest, too!)&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2017-04-07T20:32:44.557" LastActivityDate="2017-04-07T20:32:44.557" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31996" PostTypeId="2" ParentId="31942" CreationDate="2017-04-07T11:03:17.543" Score="1" Body="&lt;p&gt;You can tell Tramp to print traces. Apply &lt;code&gt;(setq tramp-verbose 6)&lt;/code&gt; prior your test. There will be a Tramp debug buffer, which you shall show, best in the &lt;code&gt;tramp-devel@gnu.org&lt;/code&gt; mailing list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you inspect the debug buffer yourself, follow all trace lines marked with &lt;code&gt;(6)&lt;/code&gt;. These lines show sent commands, and their output.&lt;/p&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-04-07T11:03:17.543" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31997" PostTypeId="2" ParentId="31859" CreationDate="2017-04-07T11:08:18.997" Score="3" Body="&lt;p&gt;If you are using Spacemacs with Emacs editing style, you first have to set &lt;code&gt;dotspacemacs-colorize-cursor-according-to-state nil&lt;/code&gt; in your &lt;code&gt;dotspacemacs/init (setq-default ...&lt;/code&gt;.  This enables you to configure the cursor color from whatever theme you are using without Spacemacs automatically overwriting it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To customize spacemacs colors you can type &lt;code&gt;M-x&lt;/code&gt; &lt;code&gt;customize-group&lt;/code&gt; &lt;code&gt;spacemacs&lt;/code&gt;.&#xA;To change the color of the cursor I refer you to &lt;a href=&quot;https://stackoverflow.com/questions/4642835/how-to-change-the-cursor-color-on-emacs&quot;&gt;this SO thread here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-04-09T23:39:19.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31998" PostTypeId="2" ParentId="31980" CreationDate="2017-04-07T11:36:22.337" Score="2" Body="&lt;p&gt;Tramp offers several commands to cleanup. Try one of them&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M-x tramp-cleanup-this-connection&#xA;M-x tramp-cleanup-connection&#xA;M-x tramp-cleanup-all-connections&#xA;M-x tramp-cleanup-all-buffers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2427" LastActivityDate="2017-04-07T11:36:22.337" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31999" PostTypeId="1" CreationDate="2017-04-07T11:42:41.690" Score="10" ViewCount="1713" Body="&lt;p&gt;I want to understand how org-babel's Library Of Babel works. Seems like a powerful yet underused tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation says that I can &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;add code to the library, by first saving the code in regular ‘src’ code blocks of an Org file, and then load the Org file with org-babel-lob-ingest, which is bound to C-c C-v i. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is that &lt;code&gt;org-babel-lob-ingest&lt;/code&gt; truly doing? It is just appending all source blocks within an Org File to another file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And what are the use cases of this? Can I see what I have in my Library interactively? Can I use noweb syntax with source blocks within the Library? What do I need to do to start using it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any examples and links to tutorials are very welcome. &lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2020-01-30T17:57:43.230" Title="Config, examples and use cases of Library Of Babel" Tags="|org-mode|org-babel|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32000" PostTypeId="2" ParentId="31991" CreationDate="2017-04-07T13:36:43.257" Score="2" Body="&lt;p&gt;Yes you can, and there's even a package for that which you can install from GNU ELPA: &lt;a href=&quot;http://elpa.gnu.org/packages/minibuffer-line.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;minibuffer-line&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1979" LastActivityDate="2017-04-07T13:36:43.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32001" PostTypeId="1" AcceptedAnswerId="32002" CreationDate="2017-04-07T15:11:48.120" Score="6" ViewCount="2594" Body="&lt;p&gt;I followed every instruction I could here &lt;a href=&quot;https://emacs.stackexchange.com/questions/28441/org-mode-9-unable-to-eval-code-blocks&quot;&gt;Org-mode 9: unable to eval code-blocks&lt;/a&gt;, and I am unable to get org-mode and org-babel to evaluate any code blocks in any language. I am dead in the water and I am throwing myself on the mercy of this community for help.  I've spent the entire morning googling and reading and fenceposting and hacking with zero progress. All my org-mode files are dead!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an MVE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I stripped everything back to a fresh installation of &lt;a href=&quot;http://spacemacs.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;spacemacs&lt;/a&gt;, and here is the version info evaluated in the &lt;code&gt;*scratch*&lt;/code&gt; buffer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(emacs-version)&#xA;&quot;GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))&#xA; of 2016-09-17&quot;&#xA;&#xA;(org-version)&#xA;&quot;9.0.5&quot;&#xA;&#xA;0.200.9@25.1.1 (spacemacs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and added &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (org-babel-do-load-languages&#xA;   'org-babel-load-languages&#xA;   '( (emacs-lisp  . t)&#xA;      ))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also changed&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'(safe-local-variable-values (quote ((org-confirm-babel-evaluate))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;into this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; '(safe-local-variable-values))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in an attempt to get anything at all to work.  It doesn't matter what the value of that expression is, I get the same negative results, with no clues about what to do to fix it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have copied the whole .spacemacs &lt;a href=&quot;https://gist.github.com/rebcabin/59548abc5436d9b2a9d7a6bdea139ab9&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to run the emacs-lisp code block that looks like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp :results output :exports both&#xA;    (princ (concat (format &quot;Emacs version: %s\n&quot; (emacs-version))&#xA;                   (format &quot;org version: %s\n&quot; (org-version))))&#xA;&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and made sure that the prevention codes are commented out&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# By default I do not want that source code blocks are evaluated on export. Usually&#xA;# I want to evaluate them interactively and retain the original results.&#xA;# #+PROPERTY: header-args :eval never-export&#xA;&#xA;* COMMENT babel settings&#xA;# Local variables:&#xA;# org-confirm-babel-evaluate: nil&#xA;# End:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I copied the entire org-mode file &lt;a href=&quot;https://gist.github.com/rebcabin/37d7c499a55e2bdb40960c54f529e6d4&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No matter what I do, I get&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;Evaluation of this emacs-lisp code block is disabled.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="596" LastEditorUserId="10292" LastEditDate="2017-04-24T01:08:41.733" LastActivityDate="2017-04-24T01:08:41.733" Title="Org-babel 9 + Spacemacs: Unable to evaluate org-babel SRC Blocks" Tags="|org-mode|org-babel|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32002" PostTypeId="2" ParentId="32001" CreationDate="2017-04-07T15:17:49.540" Score="11" Body="&lt;p&gt;Try doing the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cd .emacs.d/elpa/&#xA;# I suggest to run this without &quot;delete&quot; first.&#xA;find org* -name &quot;*.elc&quot; -delete&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will delete all compiled elisp files from org.&#xA;The problem is likely to be caused by conflicts between Org Mode that ships with Emacs and Org 9.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Restart Emacs afterwards and everything should work fine.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastActivityDate="2017-04-07T15:17:49.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32003" PostTypeId="2" ParentId="31999" CreationDate="2017-04-07T15:33:11.707" Score="10" Body="&lt;p&gt;There is a nice introduction to the library of babel in &lt;code&gt;library-of-babel.org&lt;/code&gt; which is located in Org&amp;rsquo;s source directory. To use those examples of named source-code blocks in other files, populate the &lt;code&gt;org-babel-library-of-babel&lt;/code&gt; variable with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src elisp :results scalar&#xA;(org-babel-lob-ingest &quot;/path/to/org-mode/doc/library-of-babel.org&quot;)&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: 21&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One of the 21 blocks is named &amp;ldquo;transpose&amp;rdquo; and probably does what it&amp;rsquo;s supposed to do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: tbl&#xA;| a | 1 |&#xA;| d | 2 |&#xA;| a | 3 |&#xA;| d | 4 |&#xA;| d | 5 |&#xA;| c | 6 |&#xA;&#xA;#+begin_src elisp :results table :post transpose(table=*this*) :var var=tbl&#xA;var&#xA;#+end_src&#xA;&#xA;#+results:&#xA;| a | d | a | d | d | c |&#xA;| 1 | 2 | 3 | 4 | 5 | 6 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may as well add your own code blocks, especially something you may find yourself using a lot in the future. As an example, the following allows me to aggregate values in the named table by the first column:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+name: aggregatebycol1&#xA;#+begin_src elisp :results table :var table='() fun='()&#xA;(let (res)&#xA;  (mapc&#xA;   (lambda (x)&#xA;     (push `(,(car x) ,(apply fun (mapcar 'cadr (cdr x)))) res))&#xA;   (seq-group-by 'car table))&#xA;  (nreverse res))&#xA;#+end_src&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Save the block in any file and add it to &lt;code&gt;org-babel-library-of-babel&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+begin_src elisp :results scalar&#xA;(org-babel-lob-ingest (buffer-file-name))&#xA;#+end_src&#xA;&#xA;#+results:&#xA;: 1&#xA;&#xA;#+header: :post aggregatebycol1(table=*this*, fun='+)&#xA;#+begin_src elisp :results table :var var=tbl&#xA;var&#xA;#+end_src&#xA;&#xA;#+results:&#xA;| a |  4 |&#xA;| d | 11 |&#xA;| c |  6 |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="5385" LastEditDate="2017-04-07T15:51:03.090" LastActivityDate="2017-04-07T15:51:03.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32004" PostTypeId="1" CreationDate="2017-04-07T15:34:18.010" Score="0" ViewCount="507" Body="&lt;p&gt;I am trying to configure smartparens to work with javascript, my config looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package smartparens&#xA;  :ensure t&#xA;  :diminish smartparens-mode&#xA;  :commands (smartparens-mode&#xA;             smartparens-strict-mode)&#xA;  :config&#xA;  (progn&#xA;    (require 'smartparens-config)&#xA;    (smartparens-global-mode 1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I am writing an if statement, I cannot add certain filters like &amp;lt;, &gt; and others:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try and type these symbols, I get this error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We can not insert unbalanced closing delimiter in strict mode.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there a way round this?&lt;/p&gt;&#xA;" OwnerUserId="13577" LastEditorUserId="105" LastEditDate="2017-04-07T17:50:27.707" LastActivityDate="2017-04-07T18:22:04.137" Title="smartparens with strict mode in javascript" Tags="|javascript|smartparens|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32005" PostTypeId="2" ParentId="32004" CreationDate="2017-04-07T18:22:04.137" Score="6" Body="&lt;p&gt;Use &lt;code&gt;quoted-insert&lt;/code&gt; (&lt;code&gt;C-q&lt;/code&gt;) to get around this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. &lt;code&gt;C-q &amp;lt;&lt;/code&gt; inserts &lt;code&gt;&amp;lt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, create a key binding to toggle &lt;code&gt;smartparens-strict-mode&lt;/code&gt; off and on. This is a waste of keys IMO, but up to you.&lt;/p&gt;&#xA;" OwnerUserId="10269" LastActivityDate="2017-04-07T18:22:04.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32009" PostTypeId="1" CreationDate="2017-04-07T19:44:44.830" Score="4" ViewCount="682" Body="&lt;p&gt;Is there any context-aware auto-completion for Go e.g &#xA;if I enter &quot;fmt.&quot; after importing the library, auto-completion should pop up and suggest me the functions like &quot;Println&quot; etc.&lt;/p&gt;&#xA;" OwnerUserId="15463" LastActivityDate="2024-04-06T23:00:30.083" Title="Context-aware auto completion for Go" Tags="|auto-complete-mode|golang|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32010" PostTypeId="1" AcceptedAnswerId="44316" CreationDate="2017-04-07T20:44:10.457" Score="4" ViewCount="2151" Body="&lt;p&gt;When I'm writing my weekly review I want to see my habits in a way that tells me which habit I did and which I didn't in this week. &#xA;Show the complete graph of habits may be enough for this, but how can I see this graph alone? If I opened my agenda I need to go to the next day to see the complete graph again.&lt;/p&gt;&#xA;" OwnerUserId="8621" LastActivityDate="2018-08-30T13:23:08.533" Title="How to show org-habit graph alone?" Tags="|org-mode|org-habit|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32011" PostTypeId="2" ParentId="31988" CreationDate="2017-04-07T22:08:57.340" Score="1" Body="&lt;p&gt;Within Org SRC_BLOCK blocks, LaTeX inputs are not interpreted nor converted to symbols on export. You can tweak the export, though, to achieve what you want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following filter replaces &lt;code&gt;\lambda&lt;/code&gt; by their equivalent Unicode symbol:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC emacs-lisp&#xA;      (defun my-lambda-to-unicode (output backend info)&#xA;        &quot;Convert lambda to Unicode on export to html.&quot;&#xA;        (when (and (eq backend 'html)&#xA;                   (string-match &quot;\\\\lambda&quot; output))&#xA;          (replace-match &quot;&amp;amp;#955;&quot; nil nil output)))&#xA;&#xA;      (add-to-list 'org-export-filter-final-output-functions&#xA;                   'my-lambda-to-unicode)&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A simpler workaround, though, consists in entering the equivalent Unicode symbol directly into the buffer. To make the process easier you can use &lt;a href=&quot;https://www.emacswiki.org/emacs/AbbrevMode&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;abbrev-mode&lt;/code&gt;&lt;/a&gt;, and have lambda be converted to the Unicode &lt;a href=&quot;http://www.fileformat.info/info/unicode/char/03bb/index.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;small greek lambda&lt;/a&gt; automatically. Here's a &lt;a href=&quot;http://ergoemacs.org/emacs/emacs_n_unicode.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;tutorial&lt;/a&gt; on how to deal with Unicode in Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative is to use &lt;a href=&quot;https://github.com/joaotavora/yasnippet&quot; rel=&quot;nofollow noreferrer&quot;&gt;yasnippet&lt;/a&gt; and have snippets to insert symbols. The abbrev seems more efficient, though.&lt;/p&gt;&#xA;" OwnerUserId="10292" LastEditorUserId="10292" LastEditDate="2017-04-07T22:42:43.773" LastActivityDate="2017-04-07T22:42:43.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32012" PostTypeId="1" CreationDate="2017-04-08T06:40:13.173" Score="1" ViewCount="412" Body="&lt;p&gt;I am planning to write a completion extension for Emacs. Is there any way to maintain a list of source words?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that a lot of completion helpers use regex to scan the buffer for the candidates. I was thinking about using inverted index to maintain the list, but Emacs has no concept of a line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These come from my inverted list idea, line concept is that supposed Emacs buffer consists of a lot pieces of smaller buffer, each piece is a line, assumed that we organize the buffer using linked list, when we editing a line, we editing a node in linked list, as line content changing, I can update my completion table, so the updating cost is minimum, I don't need to rescan the whole buffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more specific, my question is how a maintain a completion table with lowest cost during editing a buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm stuck. Any suggestions？&lt;/p&gt;&#xA;" OwnerUserId="15467" LastEditorUserId="1979" LastEditDate="2017-10-24T20:57:44.013" LastActivityDate="2017-10-24T21:10:13.300" Title="How to maintain a completion words source in a buffer?" Tags="|completion|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32013" PostTypeId="1" CreationDate="2017-04-08T15:14:34.327" Score="0" ViewCount="187" Body="&lt;p&gt;I have &lt;a href=&quot;https://github.com/purcell/flymake-sass&quot; rel=&quot;nofollow noreferrer&quot;&gt;flymake-sass&lt;/a&gt; working, but I can't get it to work for SCSS files. The source &lt;em&gt;looks&lt;/em&gt; like it should work with SCSS, but when I try to enable it I get an error about &lt;code&gt;scss-sass-options&lt;/code&gt; not being defined. After defining that as &lt;code&gt;nil&lt;/code&gt; in &lt;code&gt;.emacs&lt;/code&gt; it loads but doesn't do anything.&lt;/p&gt;&#xA;" OwnerUserId="15339" LastActivityDate="2018-05-04T12:35:21.640" Title="How do I get Flymake to work for SCSS mode?" Tags="|flymake|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32014" PostTypeId="2" ParentId="32012" CreationDate="2017-04-08T16:11:58.883" Score="1" Body="&lt;p&gt;You ask, &quot;&lt;em&gt;Is there any way to maintain a list of source words?&lt;/em&gt;&quot; But you do not specify what you mean by &quot;&lt;em&gt;maintain&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one possibility that comes to mind, wrt maintaining a list of completion source words: Take a look at the very old but still useful and interesting (IMO) library &lt;strong&gt;&lt;code&gt;completion.el&lt;/code&gt;&lt;/strong&gt;, which has long been (and still is) part of Emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only documentation for it is its &lt;code&gt;Commentary&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is that (if &lt;strong&gt;&lt;code&gt;completion-mode&lt;/code&gt;&lt;/strong&gt; is on) a &quot;database&quot; (file) of source words is &lt;strong&gt;automatically filled out and updated as you type or as you move the cursor over text&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, &lt;code&gt;completion.el&lt;/code&gt; &lt;em&gt;optionally provides dabbrev-style completion&lt;/em&gt;.  From comments in &lt;code&gt;completion.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  This method is used if there are no useful stored completions.  It is&#xA;based on dabbrev-expand with these differences :&#xA;  1) Faster (we don't use regexps)&#xA;  2) case coercion handled correctly&#xA;This is called cdabbrev to differentiate it.&#xA;  We simply search backwards through the file looking for words which&#xA;start with the same letters we are trying to complete.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By default, the updated set of source words is saved to disk when you end an Emacs session, and by default it is loaded into a subsequent session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is one kind of source-words &quot;&lt;em&gt;maintaining&lt;/em&gt;&quot;: automatic updating as you &quot;use&quot; words interactively.  In addition, you can easily update the source words using Lisp -- see functions &lt;code&gt;add-completions-from-buffer&lt;/code&gt;, &lt;code&gt;add-completions-from-lisp-file&lt;/code&gt;, and &lt;code&gt;add-completions-from-tags-table&lt;/code&gt;.  And there are commands to add or remove source words interactively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because few people know about this feature and it is not documented (you really have to know it is there and then open &lt;code&gt;completion.el&lt;/code&gt;, to learn about it), I repeat the &lt;code&gt;Commentary&lt;/code&gt; from the file here.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;What to put in .emacs&#xA;-----------------------&#xA;(dynamic-completion-mode)&#xA;&#xA;&#xA;Documentation [Slightly out of date]&#xA;---------------------------------------------------------------------------&#xA; (also check the documentation string of the functions)&#xA;&#xA;Introduction&#xA;---------------&#xA;&#xA;    After you type a few characters, pressing the &quot;complete&quot; key inserts&#xA;the rest of the word you are likely to type.&#xA;&#xA;This watches all the words that you type and remembers them.  When&#xA;typing a new word, pressing &quot;complete&quot; (meta-return) &quot;completes&quot; the&#xA;word by inserting the most recently used word that begins with the&#xA;same characters.  If you press meta-return repeatedly, it cycles&#xA;through all the words it knows about.&#xA;&#xA; If you like the completion then just continue typing, it is as if you&#xA;entered the text by hand.  If you want the inserted extra characters&#xA;to go away, type control-w or delete.  More options are described below.&#xA;&#xA; The guesses are made in the order of the most recently &quot;used&quot;.  Typing&#xA;in a word and then typing a separator character (such as a space) &quot;uses&quot;&#xA;the word.  So does moving a cursor over the word.  If no words are found,&#xA;it uses an extended version of the dabbrev style completion.&#xA;&#xA;  You automatically save the completions you use to a file between&#xA;sessions.&#xA;&#xA;  Completion enables programmers to enter longer, more descriptive&#xA;variable names while typing fewer keystrokes than they normally would.&#xA;&#xA;&#xA;Full documentation&#xA;---------------------&#xA;&#xA;  A &quot;word&quot; is any string containing characters with either word or symbol&#xA;syntax.  [E.G. Any alphanumeric string with hyphens, underscores, etc.]&#xA;Unless you change the constants, you must type at least three characters&#xA;for the word to be recognized.  Only words longer than 6 characters are&#xA;saved.&#xA;&#xA;  When you load this file, completion will be on.  I suggest you use the&#xA;compiled version (because it is noticeably faster).&#xA;&#xA; M-x completion-mode toggles whether or not new words are added to the&#xA;database by changing the value of enable-completion.&#xA;&#xA; SAVING/LOADING COMPLETIONS&#xA;  Completions are automatically saved from one session to another&#xA;(unless save-completions-flag or enable-completion is nil).&#xA;Activating this minor-mode (calling completion-initialize) loads&#xA;a completions database for a saved completions file&#xA;(default: ~/.completions).  When you exit, Emacs saves a copy of the&#xA;completions that you often use.  When you next start, Emacs loads in&#xA;the saved completion file.&#xA;&#xA;  The number of completions saved depends loosely on&#xA;*saved-completions-decay-factor*.  Completions that have never been&#xA;inserted via &quot;complete&quot; are not saved.  You are encouraged to experiment&#xA;with different functions (see compute-completion-min-num-uses).&#xA;&#xA;  Some completions are permanent and are always saved out.  These&#xA;completions have their num-uses slot set to T.  Use&#xA;add-permanent-completion to do this&#xA;&#xA;  Completions are saved only if enable-completion is T.  The number of old&#xA;versions kept of the saved completions file is controlled by&#xA;completions-file-versions-kept.&#xA;&#xA;COMPLETE KEY OPTIONS&#xA;  The complete function takes a numeric arguments.&#xA; control-u :: leave the point at the beginning of the completion rather&#xA;              than the middle.&#xA; a number  :: rotate through the possible completions by that amount&#xA; `-'       :: same as -1 (insert previous completion)&#xA;&#xA;HOW THE DATABASE IS MAINTAINED&#xA; &amp;lt;write&amp;gt;&#xA;&#xA;UPDATING THE DATABASE MANUALLY&#xA;  m-x kill-completion&#xA;    kills the completion at point.&#xA;  m-x add-completion&#xA;  m-x add-permanent-completion&#xA;&#xA;UPDATING THE DATABASE FROM A SOURCE CODE FILE&#xA;  m-x add-completions-from-buffer&#xA;    Parses all the definition names from a C or LISP mode buffer and&#xA;    adds them to the completion database.&#xA;&#xA;  m-x add-completions-from-lisp-file&#xA;    Parses all the definition names from a C or Lisp mode file and&#xA;    adds them to the completion database.&#xA;&#xA;UPDATING THE DATABASE FROM A TAGS TABLE&#xA;  m-x add-completions-from-tags-table&#xA;    Adds completions from the current tags-table-buffer.&#xA;&#xA;HOW A COMPLETION IS FOUND&#xA; &amp;lt;write&amp;gt;&#xA;&#xA;STRING CASING&#xA;  Completion is string case independent if case-fold-search has its&#xA; normal default of T.  Also when the completion is inserted the case of the&#xA; entry is coerced appropriately.&#xA; [E.G.  APP --&amp;gt; APPROPRIATELY     app --&amp;gt; appropriately&#xA;        App --&amp;gt; Appropriately]&#xA;&#xA;INITIALIZATION&#xA; The form `(completion-initialize)' initializes the completion system by&#xA;trying to load in the user's completions.  After the first call, further&#xA;calls have no effect so one should be careful not to put the form in a&#xA;site's standard site-init file.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here is some more doc in the form of comments from &lt;code&gt;completion.el&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---------------------------------------------------------------------------&#xA;&quot;Symbol&quot; parsing functions&#xA;---------------------------------------------------------------------------&#xA;The functions symbol-before-point, symbol-under-point, etc. quickly return&#xA;an appropriate symbol string.  The strategy is to temporarily change&#xA;the syntax table to enable fast symbol searching.  There are three classes&#xA;of syntax in these &quot;symbol&quot; syntax tables ::&#xA;&#xA;syntax (?_) - &quot;symbol&quot; chars (e.g. alphanumerics)&#xA;syntax (?w) - symbol chars to ignore at end of words (e.g. period).&#xA;syntax (? ) - everything else&#xA;&#xA;Thus by judicious use of scan-sexps and forward-word, we can get&#xA;the word we want relatively fast and without consing.&#xA;&#xA;Why do we need a separate category for &quot;symbol chars to ignore at ends&quot; ?&#xA;For example, in LISP we want starting :'s trimmed&#xA;so keyword argument specifiers also define the keyword completion.  And,&#xA;for example, in C we want `.' appearing in a structure ref. to&#xA;be kept intact in order to store the whole structure ref.; however, if&#xA;it appears at the end of a symbol it should be discarded because it is&#xA;probably used as a period.&#xA;&#xA;Here is the default completion syntax ::&#xA;Symbol chars :: A-Z a-z 0-9 @ / \ * + ~ $ &amp;lt; &amp;gt; %&#xA;Symbol chars to ignore at ends :: _ : . -&#xA;Separator chars. :: &amp;lt;tab&amp;gt; &amp;lt;space&amp;gt; ! ^ &amp;amp; ( ) = ` | { } [ ] ; &quot; ' #&#xA;                    , ? &amp;lt;Everything else&amp;gt;&#xA;&#xA;Mode specific differences and notes ::&#xA; LISP diffs -&amp;gt;&#xA;   Symbol chars :: ! &amp;amp; ? = ^&#xA;&#xA;C diffs -&amp;gt;&#xA;  Separator chars :: + * / : %&#xA; A note on the hyphen (`-').  Perhaps the hyphen should also be a separator&#xA;char., however, we wanted to have completion symbols include pointer&#xA;references.  For example, &quot;foo-&amp;gt;bar&quot; is a symbol as far as completion is&#xA;concerned.&#xA;&#xA;FORTRAN diffs -&amp;gt;&#xA;  Separator chars :: + - * / :&#xA;&#xA;Pathname diffs -&amp;gt;&#xA;  Symbol chars :: .&#xA; Of course there is no pathname &quot;mode&quot; and in fact we have not implemented&#xA;this table.  However, if there was such a mode, this is what it would look&#xA;like.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-04-08T16:30:08.640" LastActivityDate="2017-04-08T16:30:08.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32015" PostTypeId="1" CreationDate="2017-04-08T17:24:31.930" Score="1" ViewCount="202" Body="&lt;p&gt;The default layout is fairly useless (for something effectively bound to the easily accessible '1' key all the time) due to the sheer number of buffers it can 'see'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to either:-&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Make the default layout only see buffers which don't belong to any other layout.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Disable/hide the default layout (I can then create my own new layout which would work as above)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="14776" LastActivityDate="2017-04-08T17:24:31.930" Title="Changing default layout to not include all buffers" Tags="|spacemacs|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32016" PostTypeId="1" CreationDate="2017-04-08T17:27:10.643" Score="0" ViewCount="121" Body="&lt;p&gt;I've get emacs 25 build ppa taken from this &lt;a href=&quot;https://askubuntu.com/questions/851633/emacs-25-on-ubuntu-16-10&quot;&gt;ask ubuntu answer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I have this functions and macro:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun remove-lambda-helper (list matcher)&#xA;  &quot;function that remove lambda from a list if match the function `matcher'&quot;&#xA;  (dolist (item list list)&#xA;    (if (and (listp item) (eq (car item) 'lambda))&#xA;        (when (funcall matcher item)&#xA;          (setq list (delete item list))))))&#xA;&#xA;&#xA;(defun remove-project-specifics-lambda (name hook)&#xA;  &quot;Remove lambda from a hook that have code from `project-specifics'&quot;&#xA;  (set hook&#xA;       (remove-lambda-helper (symbol-value hook)&#xA;                             (lambda (body)&#xA;                               (equal (cadr (cadr (caddr body))) name)))))&#xA;&#xA;(defmacro project-specifics (name &amp;amp;rest body)&#xA;  (declare (indent 1))&#xA;  (let ((item (gensym)))&#xA;    `(progn&#xA;       (remove-project-specifics-lambda ,name 'find-file-hook)&#xA;       (remove-project-specifics-lambda ,name 'dired-after-readin-hook)&#xA;       (add-hook 'find-file-hook (lambda ()&#xA;                                   (when (string-match-p ,name (buffer-file-name))&#xA;                                     ,@body)))&#xA;       (add-hook 'dired-after-readin-hook&#xA;                 (lambda ()&#xA;                   (when (string-match-p ,name (dired-current-directory))&#xA;                     ,@body))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I got error (the macro works fine in 24.5.1):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Debugger entered--Lisp error: (void-variable dired-after-readin-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if I try &lt;kbd&gt;C-h&lt;/kbd&gt; &lt;kbd&gt;v&lt;/kbd&gt; dired-after-readin-hook, I got &lt;code&gt;[no match]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;was that hook removed or replaced with different one? I know that I can use directory specific file, but I want my macro to work, anybody know why this return error?&lt;/p&gt;&#xA;" OwnerUserId="10438" LastEditorUserId="-1" LastEditDate="2017-04-13T12:23:03.990" LastActivityDate="2017-05-09T03:55:54.313" Title="void-variable dired-after-readin-hook in emacs 25" Tags="|init-file|dired|start-up|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32017" PostTypeId="2" ParentId="32016" CreationDate="2017-04-08T18:37:28.723" Score="1" Body="&lt;p&gt;It seems that dired is not enabled by default, I've needed to add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'dired)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10438" LastActivityDate="2017-04-08T18:37:28.723" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32019" PostTypeId="1" AcceptedAnswerId="32020" CreationDate="2017-04-08T20:28:55.850" Score="1" ViewCount="318" Body="&lt;p&gt;Below code will draw a tree graph with dot, it works fine but the output graph has been included in &quot;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: nodes&#xA;| From | To | Weight |&#xA;|------+----+--------|&#xA;| A    | B  |      3 |&#xA;| A    | C  |      2 |&#xA;| B    | D  |      4 |&#xA;| B    | E  |      5 |&#xA;| C    | F  |     10 |&#xA;&#xA;#+BEGIN_SRC elisp :results output :wrap image :var nodes=nodes&#xA;    (defun rowfun(x)&#xA;      (format &quot;%s -&amp;gt; %s [label=%s];&quot; (nth 0 x) (nth 1 x) (nth 2 x))&#xA;      )&#xA;    (defun dotgen(nodes)&#xA;      (let ((dotbegin &quot;digraph {\nnode [shape=circle]\n&quot;)&#xA;            (dotend &quot;\n}&quot;))&#xA;        (concat dotbegin&#xA;                (mapconcat #'rowfun nodes &quot;\n&quot;)&#xA;                dotend)))&#xA;    (setq dotname &quot;test.dot&quot;)&#xA;  (setq pngname (format &quot;%s.png&quot;&#xA;                        (replace-regexp-in-string &quot;\.dot&quot; &quot;&quot; dotname)))&#xA;  (with-temp-file dotname (insert (dotgen nodes)))&#xA;  (shell-command-to-string (format &quot;dot -Tpng %s -o %s&quot; dotname pngname))&#xA;  (delete-file dotname)&#xA;  (print (format &quot;[[./%s]]&quot; pngname))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;#+BEGIN_image&#xA;&#xA;&quot;[[./test.png]]&quot;&#xA;#+END_image&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6Wvonm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6Wvonm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get a clean image without the extra &quot;&quot; printed before and end of the picture?&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="105" LastEditDate="2017-04-09T02:21:29.650" LastActivityDate="2017-04-09T02:21:29.650" Title="org mode inline image from elisp code block" Tags="|org-mode|images|print|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32020" PostTypeId="2" ParentId="32019" CreationDate="2017-04-08T23:08:45.113" Score="2" Body="&lt;p&gt;Change (print (format &quot;[[./%s]]&quot; pngname)) to (princ (format &quot;[[./%s]]&quot; pngname))&lt;/p&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-04-08T23:08:45.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32021" PostTypeId="1" AcceptedAnswerId="32024" CreationDate="2017-04-09T01:19:19.000" Score="0" ViewCount="41" Body="&lt;p&gt;If I have a line like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;vec3 pos; // May not be defined.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I want to shift the comment to a specific column number, say 27, such that I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;vec3 pos;                  // May not be defined.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a single command that can do this if I have the cursor placed just before the comment? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what is the easiest way to achieve this affect? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will be doing this regularly to keep comments aligned, so a quick and generic solution is best.&lt;/p&gt;&#xA;" OwnerUserId="315" LastEditorUserId="105" LastEditDate="2017-04-09T02:19:23.777" LastActivityDate="2017-04-09T03:31:58.903" Title="Shift text after cursor to specified column" Tags="|text-editing|comment|align|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32022" PostTypeId="2" ParentId="32013" CreationDate="2017-04-09T01:58:29.243" Score="1" Body="&lt;p&gt;The answer seems to be to use &lt;a href=&quot;http://www.flycheck.org/en/latest/&quot; rel=&quot;nofollow noreferrer&quot;&gt;flycheck&lt;/a&gt; which supports SCSS out of the box.&lt;/p&gt;&#xA;" OwnerUserId="15339" LastActivityDate="2017-04-09T01:58:29.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32023" PostTypeId="1" AcceptedAnswerId="32026" CreationDate="2017-04-09T02:21:08.647" Score="1" ViewCount="245" Body="&lt;p&gt;I am new to Emacs and I am trying to search for all words entered one by one using 'occur'. I am trying following code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun occurlist (ss)&#xA;    (interactive &quot;s\Enter list of search items: &quot;)&#xA;    (let (lst (split-string ss))&#xA;        (message &quot;In let block; lst=%s&quot; lst)&#xA;        (while lst&#xA;            (occur (pop lst)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I enter the search words, e.g.: &lt;code&gt;world bank report&lt;/code&gt;. It should search for these words one by one sequentially.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is not working. There is no error message. Starting emacs with command &quot;emacs --debug-init&quot; also does not show any error message. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where is the error and how can it be solved? Thanks for your help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I added message in let block. It reveals that lst=nil at that location. Hence it is not entering the while loop. Why is lst not getting value of (split-string ss) in let block?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correcting (let (lst (split-string ss)) to (let ((lst (split-string ss))) leads to function showing search for last word only. &lt;/p&gt;&#xA;" OwnerUserId="15472" LastEditorUserId="15472" LastEditDate="2017-04-09T04:09:21.377" LastActivityDate="2017-04-09T04:25:02.513" Title="Searching for multiple items with occur" Tags="|occur|iteration|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32024" PostTypeId="2" ParentId="32021" CreationDate="2017-04-09T02:47:16.917" Score="1" Body="&lt;p&gt;Set comment-column to whatever you want:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq comment-column 27)       ;it's 32 by default for javascript&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;code&gt;M ;&lt;/code&gt; (bound to &lt;code&gt;comment-dwim&lt;/code&gt;) will do it.&lt;/p&gt;&#xA;" OwnerUserId="14825" LastEditorUserId="14825" LastEditDate="2017-04-09T03:31:58.903" LastActivityDate="2017-04-09T03:31:58.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32025" PostTypeId="1" AcceptedAnswerId="32029" CreationDate="2017-04-09T03:43:51.900" Score="1" ViewCount="130" Body="&lt;p&gt;I try to use &lt;code&gt;emacs -Q&lt;/code&gt; and then input &lt;code&gt;RET RET dd&lt;/code&gt; in &lt;code&gt;*scratch*&lt;/code&gt; buffer and then &lt;code&gt;M-x add-mode-abbrev&lt;/code&gt;,&#xA;then after the prompting message &lt;code&gt;Mode abbrev for &quot;dd&quot;:&lt;/code&gt;, I input &lt;code&gt;abcdefg RET&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I defined an mode specific abbrev, but when I try to &lt;code&gt;expand-abbrev&lt;/code&gt; when putting point after the previously input &lt;code&gt;dd&lt;/code&gt;, nothing happened, even no warning messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Emacs version is &quot;GNU Emacs 25.1.1 (x86_64-apple-darwin15.6.0)&#xA; of 2016-10-03&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I use &lt;code&gt;expand-abbrev&lt;/code&gt; in a wrong way? Or does &lt;code&gt;expand-abbrev&lt;/code&gt; of this version break?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="13609" LastEditDate="2017-04-09T03:55:24.213" LastActivityDate="2017-04-09T04:40:35.113" Title="Emacs' default `expand-abbrev` does not work" Tags="|abbrev|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32026" PostTypeId="2" ParentId="32023" CreationDate="2017-04-09T04:00:47.217" Score="1" Body="&lt;p&gt;Your &lt;code&gt;let&lt;/code&gt; is malformed, for one thing.  It should be &lt;code&gt;(let ((lst  (split-string ss)))...)&lt;/code&gt;. What you wrote instead binds variable &lt;code&gt;lst&lt;/code&gt; to &lt;code&gt;nil&lt;/code&gt; and variable &lt;code&gt;split-string&lt;/code&gt; to &lt;code&gt;ss&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your second problem is that subsequent invocations of &lt;code&gt;occur&lt;/code&gt; still search the original buffer, not the output Occur buffer.  So all you see is the result of the last search of the original buffer.  You need to switch to the output buffer after each search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun occurlist (ss)&#xA;  (interactive &quot;s\Enter list of search items: &quot;)&#xA;  (let ((lst (split-string ss)))&#xA;    (while lst&#xA;      (occur (pop lst))&#xA;      (set-buffer next-error-last-buffer))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But subsequent &lt;code&gt;occur&lt;/code&gt; invocations use new buffers &lt;code&gt;*Occur&amp;lt;N&amp;gt;*&lt;/code&gt;.  If you don't want to keep the intermediate output buffers, then this will kill them:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun occurlist (ss)&#xA;  (interactive &quot;s\Enter list of search items: &quot;)&#xA;  (let ((lst  (split-string ss))&#xA;        lastbuf)&#xA;    (while lst&#xA;      (occur (pop lst))&#xA;      (when lastbuf (kill-buffer lastbuf))&#xA;      (set-buffer (setq lastbuf  next-error-last-buffer)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-04-09T04:25:02.513" LastActivityDate="2017-04-09T04:25:02.513" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32027" PostTypeId="1" AcceptedAnswerId="32028" CreationDate="2017-04-09T04:11:40.477" Score="1" ViewCount="301" Body="&lt;p&gt;So I would like to change the color of the arrow that shows the text is being wrapped. Specifically the red arrow shown here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xfbPC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xfbPC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried searching myself and the closest I came is finding out the sides are called &quot;fringe&quot;s and this &lt;a href=&quot;https://stackoverflow.com/questions/26824328/hide-change-emacs-fringe-bent-arrows-due-to-word-wrapping&quot;&gt;answer&lt;/a&gt;. But where I hit a stump is figuring out the syntax of the function, &lt;code&gt;set-fringe-bitmap-face bitmap &amp;amp;optional face&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume means something like this: &lt;code&gt;(set-fringe-bitmap-face 'left-curly-arrow ((t (:foreground &quot;#616161&quot;))))&lt;/code&gt; But my problem is I don't know how to write the correct syntax for a &lt;code&gt;[face]&lt;/code&gt; symbol. Also I don't even know if this would do what I want which is just to change the color of that red arrow to something that fits my theme. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;" OwnerUserId="15475" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:56.473" LastActivityDate="2017-04-09T04:50:50.193" Title="Change the color of the wrap around arrow" Tags="|faces|fringe|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32028" PostTypeId="2" ParentId="32027" CreationDate="2017-04-09T04:21:44.323" Score="2" Body="&lt;p&gt;I do not know about the color &lt;code&gt;#616161&lt;/code&gt; as my Emacs version doesn't seem to display a big enough difference in the color for me to see it with my naked eye, but here is an example using &quot;yellow&quot;.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(defface my-custom-curly-face&#xA;  '((t (:foreground &quot;yellow&quot;)))&#xA;  &quot;Face for fringe curly bitmaps.&quot;&#xA;  :group 'basic-faces)&#xA;&#xA;(set-fringe-bitmap-face 'left-curly-arrow 'my-custom-curly-face)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-04-09T04:36:00.930" LastActivityDate="2017-04-09T04:36:00.930" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32029" PostTypeId="2" ParentId="32025" CreationDate="2017-04-09T04:40:35.113" Score="1" Body="&lt;p&gt;I think you're looking for &lt;strong&gt;&lt;code&gt;inverse-add-mode-abbrev&lt;/code&gt;&lt;/strong&gt;, not &lt;code&gt;add-mode-abbrev&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to expand &lt;code&gt;dd&lt;/code&gt; to &lt;code&gt;abcdefg&lt;/code&gt; then use &lt;code&gt;M-x inverse-add-mode-abbrev&lt;/code&gt; with the cursor after &lt;code&gt;dd&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Command &lt;code&gt;add-mode-abbrev&lt;/code&gt; defines an abbreviation for the last word.  For instance, if the text in the buffer is &lt;code&gt;george&lt;/code&gt; and you use &lt;code&gt;M-x add-mode-abbrev&lt;/code&gt; with the cursor after that text, and then you type &lt;code&gt;gg&lt;/code&gt; at the prompt then you have defined abbreviation &lt;code&gt;gg&lt;/code&gt; for the word &lt;code&gt;george&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you apparently want to define &lt;code&gt;dd&lt;/code&gt; as an abbreviation for &lt;code&gt;abcdefg&lt;/code&gt;, so you need to use &lt;code&gt;inverse-add-mode-abbrev&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-04-09T04:40:35.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32030" PostTypeId="2" ParentId="31977" CreationDate="2017-04-09T06:26:58.357" Score="1" Body="&lt;p&gt;Here is one idea using the built-in &lt;code&gt;image-dired&lt;/code&gt; library and the external utility &lt;code&gt;convert&lt;/code&gt; that is part of the ImageMagick suite.  Emacs does not need to be built with ImageMagick support for this idea to work, but &lt;code&gt;convert&lt;/code&gt; and its dependencies must be on the computer.  I am only shrinking the image, not organizing the attachments in groups of four or anything fancy like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have added support in &lt;code&gt;mime-display-image&lt;/code&gt; for converting PDF full size to PNG thumbnails (first page only).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a &lt;code&gt;mime-preview-condition&lt;/code&gt; in &lt;code&gt;mime-view.el&lt;/code&gt; that conflicts with my new proposed condition, and I resolved the conflict by simply commenting it out.  In a nutshell, I don't want &lt;code&gt;mime-display-text/plain&lt;/code&gt; to be triggered when dealing with a PDF.  If anyone sees a negative effect by commenting out those lines, please post a comment and let me know -- along with a suggested fix (if known).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE:  I added the &lt;code&gt;-flatten&lt;/code&gt; argument to &lt;code&gt;image-dired-cmd-create-thumbnail-options&lt;/code&gt; (&lt;em&gt;in my own setup&lt;/em&gt;) in order to make transparent PNG background white.  The user may choose to do the same.  In my use case, I create PDF with &lt;code&gt;pdflatex&lt;/code&gt; from &lt;code&gt;TexLive&lt;/code&gt; and PDF converted to PNG without &lt;code&gt;-flatten&lt;/code&gt; do not show up well in a buffer with a dark background.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(ctree-set-calist-strictly&#xA;  'mime-preview-condition&#xA;  '((type . application)&#xA;    (subtype . pdf)&#xA;    (body . visible)&#xA;    (body-presentation-method . mime-display-image)&#xA;    (image-format . pdf)))&#xA;&#xA;;; Comment out the following lines in `mime-view.el':&#xA;;;    (ctree-set-calist-strictly&#xA;;;      'mime-preview-condition&#xA;;;      '((body . visible)&#xA;;;        (body-presentation-method . mime-display-text/plain)))&#xA;&#xA;(defun mime-display-image (entity situation)&#xA;  (message &quot;Decoding image ...&quot;)&#xA;  (condition-case err&#xA;    (let* ((format (cdr (assq 'image-format situation)))&#xA;           (image&#xA;             (unless (eq format 'pdf)&#xA;               (mime-image-create (mime-entity-content entity) format 'data))))&#xA;      (if (and (null image) (not (eq format 'pdf)))&#xA;          (message &quot;Invalid glyph!&quot;)&#xA;        (save-excursion&#xA;          ;;; (insert-image image)&#xA;          (let* ((buffer (current-buffer))&#xA;                 (basename (mime-entity-filename entity))&#xA;                 ;;; `temporary-file-directory' `should` already have a forward&#xA;                 ;;;  trailing slash.  Use the `wl-temporary-file-directory'?&#xA;                 (tmp-dir&#xA;                   (concat&#xA;                     (file-name-as-directory temporary-file-directory)&#xA;                      &quot;wanderlust/&quot;))&#xA;                 (wl-extract-dir (concat tmp-dir &quot;full-size/&quot;))&#xA;                 (wl-thumbnails (concat tmp-dir &quot;thumbnails/&quot;))&#xA;                 (curr-file (concat wl-extract-dir basename))&#xA;                 (image-dired-dir wl-thumbnails)&#xA;                 (image-dired-thumb-width 200)&#xA;                 (image-dired-thumb-height 200))&#xA;            (when (or image (eq format 'pdf))&#xA;              ;;; `image-dired' will create the thumbnail directory.&#xA;              (unless (and (file-exists-p wl-extract-dir)&#xA;                           (file-directory-p wl-extract-dir))&#xA;                (make-directory wl-extract-dir 'parents))&#xA;              (mime-write-entity-content entity curr-file))&#xA;            (cond&#xA;              ((string-match (image-file-name-regexp) curr-file)&#xA;                (let ((thumb-name (image-dired-thumb-name curr-file)))&#xA;                  (if (and (not (file-exists-p thumb-name))&#xA;                           (not (= 0 (image-dired-create-thumb&#xA;                                        curr-file thumb-name))))&#xA;                      (message &quot;Thumb could not be created for file %s&quot;&#xA;                               curr-file)&#xA;                    (image-dired-insert-thumbnail&#xA;                      thumb-name curr-file buffer))))&#xA;              ((string-match &quot;\\.\\(PDF\\)\\'&quot; curr-file)&#xA;                (let* ((absolute-basename (file-name-sans-extension curr-file))&#xA;                       (png-filename (concat absolute-basename &quot;.png&quot;))&#xA;                       (pdf-first-page-filename (concat curr-file &quot;[0]&quot;))&#xA;                       (thumb-name (image-dired-thumb-name png-filename)))&#xA;                  (if (and (not (file-exists-p thumb-name))&#xA;                           (not (= 0 (image-dired-create-thumb&#xA;                                       pdf-first-page-filename thumb-name))))&#xA;                      (message &quot;Thumb could not be created for file %s&quot;&#xA;                               pdf-first-page-filename)&#xA;                    (image-dired-insert-thumbnail&#xA;                      thumb-name pdf-first-page-filename buffer))))&#xA;              (t&#xA;                ;;; catch-all / fall-back is the default behavior.&#xA;                (message &quot;%s does not match `image-file-name-regexp'&quot; curr-file)&#xA;                (insert-image image))))&#xA;          (insert &quot;\n&quot;)&#xA;          (message &quot;Decoding image ... done.&quot;))))&#xA;   (error nil err)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-04-11T18:23:50.723" LastActivityDate="2017-04-11T18:23:50.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32031" PostTypeId="1" AcceptedAnswerId="32039" CreationDate="2017-04-09T06:38:36.077" Score="1" ViewCount="1234" Body="&lt;p&gt;Can anyone think of a way to hide org-mode tags, perhaps something along the lines of this solution to &lt;a href=&quot;https://stackoverflow.com/questions/17478260/completely-hide-the-properties-drawer-in-org-mode&quot;&gt;completely hide the properties drawer&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to hide tags but still have them searchable and be able to make them visible through cycling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas?&lt;/p&gt;&#xA;" OwnerUserId="12695" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:57.487" LastActivityDate="2017-04-11T22:59:40.180" Title="Org-mode hide tags in outline view" Tags="|org-mode|code-folding|org-tags|" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="32033" PostTypeId="1" CreationDate="2017-04-09T11:37:15.560" Score="0" ViewCount="113" Body="&lt;p&gt;I was using paredit for other languages apart from lisp and it was great for being able to delete and yank whole functions etc. but it was also quite buggy with &lt;code&gt;web-mode&lt;/code&gt; and &lt;code&gt;js2-mode&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fir example, I could hit ctrl + K at the first line of the code below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const  = (x) =&amp;gt; {&#xA;  // function body&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and it would cut the entire function. This worked with html in web-mode etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyway I can replicate this behaviour without paredit or how do more seasoned emacs users go about copying whole expressions like this or working with them in non-lisp languages?&lt;/p&gt;&#xA;" OwnerUserId="13577" LastEditorUserId="105" LastEditDate="2017-04-09T15:22:04.390" LastActivityDate="2017-04-09T15:22:04.390" Title="dealing with s-expressions in javascript without paredit" Tags="|yank|kill-text|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32034" PostTypeId="2" ParentId="31977" CreationDate="2017-04-09T14:22:47.220" Score="0" Body="&lt;p&gt;I found a way to do all of this. The &quot;image+&quot; package can be used to perform resizing of images and other manipulation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/mhayashi1120/Emacs-imagex&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/mhayashi1120/Emacs-imagex&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It utilizes temp files and some Imagemagick facilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the help of this package, I now have come up with a way to (1) resize images, and (2) arrange them in a grid at the bottom of the message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did this by overriding the 'mime-display-image' function in 'semi/mime-image.el', as follows ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar my-images-per-line 3&#xA;  &quot;*Number of images per line.&quot;)&#xA;(defvar my-max-image-width (truncate (/ (window-pixel-width) (1+ my-images-per-line)))&#xA;  &quot;*Maximum image width.&quot;)&#xA;(defvar my-max-image-height (truncate (/ (window-pixel-height) 3.5))&#xA;  &quot;*Maximum image height.&quot;)&#xA;&#xA;(defun my-mime-display-image (entity situation)&#xA;  (message &quot;Decoding image...&quot;)&#xA;  (condition-case err&#xA;      (let ((format (cdr (assq 'image-format situation)))&#xA;            (nimages 0)&#xA;            image&#xA;            size&#xA;            image-w&#xA;            image-h&#xA;            w-factor&#xA;            h-factor&#xA;            resize-factor&#xA;            current-point&#xA;            end-point)&#xA;        (setq image (mime-image-create (mime-entity-content entity)&#xA;                                       format 'data))&#xA;        (if (null image)&#xA;            (message &quot;Invalid glyph!&quot;)&#xA;          (save-excursion&#xA;            (save-restriction&#xA;              ;; Count the number of images that are already entered&#xA;              ;; into this buffer.&#xA;              (widen)&#xA;              (setq current-point (point-min))&#xA;              (setq end-point (point-max))&#xA;              (while (&amp;lt;= current-point end-point)&#xA;                (when (get-char-property current-point 'display)&#xA;                  (setq nimages (1+ nimages)))&#xA;                (setq current-point (1+ current-point))))&#xA;            (setq size (image-size image t))&#xA;            (setq image-w (car size))&#xA;            (setq image-h (cdr size))&#xA;            (setq w-factor (/ (float my-max-image-width) image-w))&#xA;            (setq h-factor (/ (float my-max-image-height) image-h))&#xA;            (setq resize-factor (min w-factor h-factor))&#xA;            ;; Enter a single newline if it's the first image to be entered.&#xA;            ;; Enter 3 newlines if we've already entered 'my-images-per-line'&#xA;            ;; images on the current line.&#xA;            (when (= (% nimages my-images-per-line) 0)&#xA;              (insert-char ?\n (if (&amp;lt; nimages 1) 1 3)))&#xA;            ;; Always precede each image with a few spaces.&#xA;            (insert-char ?\s 3)&#xA;            (setq current-point (point))&#xA;            (mime-image-insert image)&#xA;            ;; If resize-factor is not close to 1.00, use the image+&#xA;            ;; module to resize the image. It operates on the image&#xA;            ;; located at the current point.&#xA;            ;; For image+, see https://github.com/mhayashi1120/Emacs-imagex&#xA;            (when (&amp;gt; (abs (- resize-factor 1.00)) 0.05)&#xA;              (goto-char current-point)&#xA;              (imagex-sticky-mode 1)&#xA;              (imagex-sticky--zoom resize-factor))&#xA;            (message &quot;Decoding image...done&quot;)&#xA;            )))&#xA;        (error nil err)))&#xA;(advice-add 'mime-display-image :override #'my-mime-display-image)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-09T14:34:18.317" LastActivityDate="2017-04-09T14:34:18.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32035" PostTypeId="2" ParentId="24574" CreationDate="2017-04-09T14:38:28.270" Score="3" Body="&lt;p&gt;You might give this version a try. It adds items and headings with regular return, and with double return on an empty entry terminates the list. It also modifies return in a table to add rows or terminate a table on an empty row. Its lightly tested ;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun scimax/org-return ()&#xA;  &quot;Add new list or headline &quot;&#xA;  (interactive)&#xA;  (cond&#xA;   ((org-in-item-p)&#xA;    (if (org-element-property :contents-begin (org-element-context))&#xA;    (org-insert-heading)&#xA;      (beginning-of-line)&#xA;      (kill-line)&#xA;      (org-return)))&#xA;   ((org-at-heading-p)&#xA;    (if (not (string= &quot;&quot; (org-element-property :title (org-element-context))))&#xA;    (org-insert-heading)&#xA;      (beginning-of-line)&#xA;      (kill-line)&#xA;      (org-return)))&#xA;   ((org-at-table-p)&#xA;    (if (-any?&#xA;     (lambda (x) (not (string= &quot;&quot; x)))&#xA;     (nth&#xA;      (- (org-table-current-dline) 1)&#xA;      (org-table-to-lisp)))&#xA;    (org-return)&#xA;      ;; empty row&#xA;      (beginning-of-line)&#xA;      (kill-line)&#xA;      (org-return)))&#xA;   (t&#xA;    (org-return))))&#xA;&#xA;(define-key org-mode-map (kbd &quot;RET&quot;)&#xA;  'scimax/org-return)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastActivityDate="2017-04-09T14:38:28.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32036" PostTypeId="1" AcceptedAnswerId="32062" CreationDate="2017-04-09T15:10:23.450" Score="0" ViewCount="87" Body="&lt;p&gt;I want to optionally perform some functions on the data in buffer &lt;code&gt;*WL:Message*&lt;/code&gt; right after I access and view it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when first viewing a new message in the &lt;code&gt;*WL:Message*&lt;/code&gt; buffer via &lt;code&gt;wl-summary-read&lt;/code&gt; or &lt;code&gt;wl-summary-enter-handler&lt;/code&gt;, I'd like to perform the following logic (pseudo-code) ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enter the *WL:Message* buffer&#xA;IF *WL:Message* buffer contains images&#xA;THEN&#xA;   Scroll down to the first image&#xA;   Do a (recenter 1) to position this image at the top of the window&#xA;ENDIF&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know how to write the elisp code to do all of this. The problem is knowing &lt;strong&gt;&lt;em&gt;when&lt;/em&gt;&lt;/strong&gt; to issue this code. I haven't been able to find a hook that runs right as the &lt;code&gt;*WL:Message*&lt;/code&gt; buffer is being displayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use advice around various existing wanderlust &lt;code&gt;wl-summary&lt;/code&gt; and &lt;code&gt;wl-message&lt;/code&gt; functions, but I haven't found a reliable way to do what I want. Sometimes (seemingly at random), the &lt;code&gt;wl-message-buffer&lt;/code&gt; variable is not set, or that buffer's window is not live (it needs to be a live window in order for &lt;strong&gt;&lt;code&gt;(recenter 1)&lt;/code&gt;&lt;/strong&gt; to work).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of the proper place I can insert my code so that it always reliably runs whenever I first view a new message in the &lt;code&gt;*WL:Message*&lt;/code&gt; buffer?&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-10T04:16:02.173" LastActivityDate="2017-04-11T16:23:23.457" Title="wanderlust: hook for modifying buffer *WL:Message* as it is being accessed" Tags="|message|wanderlust|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32038" PostTypeId="1" AcceptedAnswerId="32041" CreationDate="2017-04-09T16:17:20.833" Score="8" ViewCount="697" Body="&lt;p&gt;I defined some simple functions in init.el, for example &lt;code&gt;my-cache-file&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defconst my-cache-directory&#xA;  (expand-file-name &amp;quot;.cache&amp;quot; user-emacs-directory)) ; ~/.emacs/.cache&#xA;&#xA;(defun my-cache-file (x)&#xA;  (expand-file-name x my-cache-directory))          ; ~/.emacs/.cache/x&#xA;&#xA;(setq savehist-file&#xA;      (my-cache-file &amp;quot;savehist&amp;quot;))&#xA;&#xA;(setq backup-directory-alist&#xA;      `((&amp;quot;.&amp;quot; . ,(my-cache-file &amp;quot;backups/&amp;quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This seemed like a good use-case for &lt;code&gt;defsubst&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defsubst my-cache-file (x) ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then I started learning about compilation, and wanted to further optimize. I naively tried:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(defsubst my-cache-file (x)&#xA;  (eval-when-compile (expand-file-name x my-cache-directory)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;but the compiler complained (rightly) about the free variable &lt;code&gt;x&lt;/code&gt;, so instead I wrapped the calling code:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq savehist-file&#xA;      (eval-when-compile (my-cache-file &amp;quot;savehist&amp;quot;)))&#xA;&#xA;(setq backup-directory-alist&#xA;      `((&amp;quot;.&amp;quot; . ,((eval-when-compile (my-cache-file &amp;quot;backups/&amp;quot;))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That last caller should probably be evaluating the whole alist at compile time, though, so I pulled the &lt;code&gt;eval-when-compile&lt;/code&gt; up:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(setq backup-directory-alist&#xA;      (eval-when-compile `((&amp;quot;.&amp;quot; . ,(my-cache-file &amp;quot;backups/&amp;quot;)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I'd like to avoid littering my code with more &lt;code&gt;eval-when-compile&lt;/code&gt; calls than necessary, and I wonder if there's a better approach I could take using macros or &lt;code&gt;define-inline&lt;/code&gt;. The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Functions.html&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; makes &lt;code&gt;define-inline&lt;/code&gt; sound promising:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Functions defined via define-inline have several advantages with respect to macros defined by defsubst or defmacro:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;They can be passed to mapcar (see Mapping Functions).&lt;/li&gt;&#xA;&lt;li&gt;They are more efficient.&lt;/li&gt;&#xA;&lt;li&gt;They can be used as place forms to store values (see Generalized Variables).&lt;/li&gt;&#xA;&lt;li&gt;They behave in a more predictable way than cl-defsubst (see Argument Lists in Common Lisp Extensions for GNU Emacs Lisp).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;But the syntax looks cumbersome, and I can't find a single example of it being used in the wild. Nor can I find any explanation of it's claim that defsubst is less efficient.&lt;/p&gt;&#xA;&lt;p&gt;Has anyone used &lt;code&gt;define-inline&lt;/code&gt;, or is there a different macro I should look into, or should I just stick with &lt;code&gt;defsubst&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-04-09T18:59:18.037" Title="eval-when-compile: defsubst vs defmacro vs define-inline" Tags="|elisp-macros|byte-compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32039" PostTypeId="2" ParentId="32031" CreationDate="2017-04-09T16:42:20.410" Score="4" Body="&lt;p&gt;Here is one approach to hide tags in folded view, and show them in any expanded view.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-toggle-tag-visibility (state)&#xA;  &quot;Run in `org-cycle-hook'.&quot;&#xA;  (message &quot;%s&quot; state)&#xA;  (cond&#xA;   ;; global cycling&#xA;   ((memq state '(overview contents showall))&#xA;    (org-map-entries&#xA;     (lambda ()&#xA;       (let ((tagstring (nth 5 (org-heading-components)))&#xA;         start end)&#xA;     (when tagstring&#xA;       (save-excursion&#xA;         (beginning-of-line)&#xA;         (re-search-forward tagstring)&#xA;         (setq start (match-beginning 0)&#xA;           end (match-end 0)))&#xA;       (cond&#xA;        ((memq state '(overview contents))&#xA;         (outline-flag-region start end t))&#xA;        (t&#xA;         (outline-flag-region start end nil))))))))&#xA;   ;; local cycling&#xA;   ((memq state '(folded children subtree))&#xA;    (save-restriction&#xA;      (org-narrow-to-subtree)&#xA;      (org-map-entries&#xA;       (lambda ()&#xA;     (let ((tagstring (nth 5 (org-heading-components)))&#xA;           start end)&#xA;       (when tagstring&#xA;         (save-excursion&#xA;           (beginning-of-line)&#xA;           (re-search-forward tagstring)&#xA;           (setq start (match-beginning 0)&#xA;             end (match-end 0)))&#xA;         (cond&#xA;          ((memq state '(folded children))&#xA;           (outline-flag-region start end t))&#xA;          (t&#xA;           (outline-flag-region start end nil)))))))))))&#xA;&#xA;(add-hook 'org-cycle-hook 'org-toggle-tag-visibility)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="9134" LastEditDate="2017-04-11T22:59:40.180" LastActivityDate="2017-04-11T22:59:40.180" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="32040" PostTypeId="1" AcceptedAnswerId="32065" CreationDate="2017-04-09T18:52:27.477" Score="0" ViewCount="150" Body="&lt;p&gt;I understand in general about idle timers in emacs, but I'm having trouble figuring out how to do the following ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to set an &lt;code&gt;is-idle&lt;/code&gt; variable to &lt;code&gt;t&lt;/code&gt; when emacs is in an idle state, and I want that variable to set to &lt;code&gt;nil&lt;/code&gt; when emacs is not idle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do I want this? It's because I have written signal handlers for sigusr1 and sigusr2 which get invoked when my emacs process receives either of these external signals. I want the handlers not to run if emacs doesn't happen to be idle at the moment that the sigusr1 or sigusr2 signals are received.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I want my signal handler to look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when is-idle&#xA;   ;; do all the sigusr1/sigusr2 processing&#xA;   ;; ... etc. ...&#xA;   )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I haven't figured out how to manage this with an idle timer, nor with any other emacs facilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of a variable, &lt;code&gt;is-idle&lt;/code&gt; could be a function. I don't really care which it is. I just want to know at the moment that the signal is received as to whether my emacs session is idle or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update ...&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across the &lt;code&gt;(current-idle-time)&lt;/code&gt; function. Here's its doc string ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Return the current length of Emacs idleness, or nil.&#xA;The value when Emacs is idle is a list of four integers (HIGH LOW USEC PSEC)&#xA;in the same style as (current-time).&#xA;&#xA;The value when Emacs is not idle is nil.&#xA;&#xA;PSEC is a multiple of the system clock resolution.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm going to do some investigation as to whether this function will provide what I'm looking for, and I'll report back.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-10T03:26:15.183" LastActivityDate="2017-04-10T18:32:03.643" Title="Setting and clearing an &quot;is-idle&quot; variable when going in and out of idle mode?" Tags="|idle-timer|" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32041" PostTypeId="2" ParentId="32038" CreationDate="2017-04-09T18:57:57.197" Score="6" Body="&lt;p&gt;I'd say stick with &lt;strong&gt;&lt;code&gt;defun&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to try &lt;code&gt;define-inline&lt;/code&gt;, which is new (it doesn't even have a doc string yet!), go ahead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;em&gt;think&lt;/em&gt; about how much you want or need inlining. It is rare to need it, IMO (certainly not for the kinds of thing you show here, but they are no doubt just to get the question across).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would definitely recommend &lt;em&gt;not&lt;/em&gt; to use &lt;code&gt;defsubst&lt;/code&gt;. You likely don't need it, and it just gets in the way.  It might have had a use case in 1985, but I know of no place where it is useful now.  &lt;code&gt;define-inline&lt;/code&gt; is apparently an attempt to get the benefit of &lt;code&gt;defsubst&lt;/code&gt; without the downside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question might be primarily opinion-based.  This answer is just one opinion, in any case.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-04-09T18:57:57.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32044" PostTypeId="1" AcceptedAnswerId="32054" CreationDate="2017-04-09T23:53:42.727" Score="1" ViewCount="249" Body="&lt;p&gt;Compiled emacs25.1 from source on MacOS. Emacs works fine when opened by click the icon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when open it from terminal by &lt;code&gt;emacs&lt;/code&gt; or &lt;code&gt;emacsclient -a&lt;/code&gt;. All the key stokes is responded in terminal instead of the Emacs frame. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone known solutions for this issue?&lt;/p&gt;&#xA;" OwnerUserId="4102" LastActivityDate="2017-04-10T11:59:24.730" Title="Key strokes doesn't work for frames created from terminal on Mac OS" Tags="|osx|frames|gui-emacs|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32045" PostTypeId="2" ParentId="32040" CreationDate="2017-04-10T01:14:44.977" Score="0" Body="&lt;p&gt;&lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt; &lt;code&gt;current-idle-time&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;current-idle-time is a built-in function in ‘C source code’.&#xA;&#xA;(current-idle-time)&#xA;&#xA;Return the current length of Emacs idleness, or nil.&#xA;The value when Emacs is idle is a list of four integers (HIGH LOW USEC PSEC)&#xA;in the same style as (current-time).&#xA;&#xA;The value when Emacs is not idle is nil.&#xA;&#xA;PSEC is a multiple of the system clock resolution.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="454" LastActivityDate="2017-04-10T01:14:44.977" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32047" PostTypeId="1" AcceptedAnswerId="32053" CreationDate="2017-04-10T02:51:31.000" Score="0" ViewCount="760" Body="&lt;p&gt;Below major mode is a dummy mode just derived from c-mode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; a simple major mode, mylang-mode&#xA;(define-derived-mode mylang-mode c-mode&#xA;  &quot;major mode for editing mylang language code.&quot;&#xA;  (message &quot;dummy&quot;))&#xA;&#xA;;; add the mode to the `features' list&#xA;(provide 'mylang-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But when I switch on this mode by M-x mylang-mode, I always get below warning message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (irony): Major mode is unknown to Irony, see&#xA;`irony-supported-major-modes'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I try to add below line to init.el but not helpful:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14843" LastActivityDate="2017-04-10T11:41:15.547" Title="major mode with irony warning message" Tags="|major-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32048" PostTypeId="1" AcceptedAnswerId="32049" CreationDate="2017-04-10T04:28:44.443" Score="2" ViewCount="580" Body="&lt;p&gt;I want to create a table in org-mode and use it in Ditaa&#xA;The following function is created to replace “^+-” to “|-”&#xA;and similarly, “^-+\s-*” to “-|”.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surprisingly, this does not work. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun ditaa-to-table (begin end)&#xA;  &quot;Replace “^\+-” to “|-” in region; Replace “-\+\s-*$” to “-|”&quot;&#xA;  &quot;I want to create a table in org-mode and use it in Ditaa&quot;&#xA;  &quot;org-mode uses |- and -| for the row/cell delimiter at the extremes of the     line, while Ditaa uses +- and -+&quot;&#xA;&#xA;  (interactive &quot;r&quot;)&#xA;  (save-restriction&#xA;    (narrow-to-region begin end)&#xA;&#xA;    (goto-char (point-min))&#xA;    (while (search-forward-regexp &quot;^\s-*\+-&quot; nil t) (replace-match &quot;|-&quot; nil t))&#xA;&#xA;    (goto-char (point-min))&#xA;    (while (search-forward-regexp &quot;-\+\s-*$&quot; nil t) (replace-match &quot;-|&quot; nil t))&#xA;&#xA;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I use, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while (search-forward-regexp &quot;\+-&quot; nil t) (replace-match &quot;|-&quot; nil t)) ;; works&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;works, But once I add the &quot;^\s-*&quot; char to mark the start-of-line, it stops working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, basic one works, but once the  &quot;\s-*$&quot; is added, it stops working&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(while (search-forward-regexp &quot;-\+&quot; nil t) (replace-match &quot;-|&quot; nil t)) ;; works&#xA;(while (search-forward-regexp &quot;-\+\s-*$&quot; nil t) (replace-match &quot;-|&quot; nil t)) ;; does not work&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried posix-search-forward also, and it does not work.&lt;/p&gt;&#xA;" OwnerUserId="15487" LastEditorUserId="105" LastEditDate="2017-04-10T05:13:12.337" LastActivityDate="2017-04-11T21:57:36.173" Title="calling search-forward function with ^ and $ in the regexp pattern" Tags="|regular-expressions|search|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32049" PostTypeId="2" ParentId="32048" CreationDate="2017-04-10T05:11:48.577" Score="3" Body="&lt;p&gt;You're getting tripped up by the escaping requirements for Emacs regexps when expressed in the double-quoted read syntax for strings, in conjunction with some historical-compatibility behaviour in Emacs' regexp engine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the syntax requirements for special characters, please refer to these other Q&amp;amp;As:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/a/13391&quot;&gt;https://emacs.stackexchange.com/a/13391&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/10864091&quot;&gt;https://stackoverflow.com/a/10864091&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://emacs.stackexchange.com/q/5568&quot;&gt;Why do regular expressions created with the regex builder use syntax different from the interactive regular expressions?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(The last one covers the issue in the context of the &lt;code&gt;re-builder&lt;/code&gt; feature of Emacs, which is extremely useful.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason your simpler initial regexp was working at all is explained in &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Regexp Special&lt;/code&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;*Please note:* For historical compatibility, special characters are&#xA;treated as ordinary ones if they are in contexts where their special&#xA;meanings make no sense.  For example, ‘*foo’ treats ‘*’ as ordinary&#xA;since there is no preceding expression on which the ‘*’ can act.  It is&#xA;poor practice to depend on this behavior; quote the special character&#xA;anyway, regardless of where it appears.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;\+-&quot;&lt;/code&gt; evaluates to &lt;code&gt;+-&lt;/code&gt; which you are using as a regexp. &lt;code&gt;+&lt;/code&gt; is normally special, but in that pattern is being treated the same as the regexp &lt;code&gt;\+-&lt;/code&gt;, which in string read syntax would be written as &lt;code&gt;&quot;\\+-&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&quot;^\s-*\+-&quot;&lt;/code&gt; on the other hand evaluates to &lt;code&gt;^ -*+-&lt;/code&gt; which is certainly not the regexp you were intending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;i&lt;/kbd&gt;&lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;(elisp) Basic Char Syntax&lt;/code&gt; for why &lt;code&gt;&quot;\s&quot;&lt;/code&gt; is a space.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-04-11T21:57:36.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32052" PostTypeId="1" CreationDate="2017-04-10T09:30:58.373" Score="1" ViewCount="242" Body="&lt;p&gt;I am opening a Java source file which is part of a maven project. JDEE now runs maven once, which I can sort of understand. But whenever I move around in the file, it will trigger once more. Since it always splits my frame, and blocks Emacs, this is quite annoying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a how to or some rules on how to set up Emacs and JDEE for my Maven projects, so that this will not happen?&lt;/p&gt;&#xA;" OwnerUserId="759" LastActivityDate="2023-12-20T00:02:35.343" Title="JDEE runs maven all the time" Tags="|java|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32053" PostTypeId="2" ParentId="32047" CreationDate="2017-04-10T11:41:15.547" Score="1" Body="&lt;p&gt;&lt;code&gt;irony-supported-major-modes&lt;/code&gt; is the list of major modes known to be compatible with irony, and although your mode extends &lt;code&gt;c-mode&lt;/code&gt; irony doesn't know that it's supported.  Add your mode to the list with something like &lt;code&gt;(push 'mylang-mode irony-supported-major-modes)&lt;/code&gt; and the warning ought to go away.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-04-10T11:41:15.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32054" PostTypeId="2" ParentId="32044" CreationDate="2017-04-10T11:59:24.730" Score="2" Body="&lt;p&gt;Assuming that you've configured with --with-ns (because you said it works if you open Emacs by clicking on the app icon), then you can start Emacs from the console in a couple of different ways.  If you just want to start Emacs as an app then you can use the open command, so something like &lt;code&gt;open nextstep/Emacs.app&lt;/code&gt;.  The open command has a variety of arguments which can change its behaviour.  For example, it will attempt to use an already running instance of the application if possible (you can override this with the -n argument), and by default won't wait until the application has exited (you can override this with the -w argument).  If you want to open some files as well then you'd need to use the --args argument to open to tell it that the remaining arguments should go to Emacs - for example: &lt;code&gt;open Emacs.app --args foo.txt&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to see standard output and error from the Emacs executable itself you can also run the binary directly (or in a debugger) from the terminal without using open, with something like &lt;code&gt;./Emacs.app/Contents/MacOS/Emacs foo.txt&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-04-10T11:59:24.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32055" PostTypeId="1" CreationDate="2017-04-10T12:10:10.400" Score="2" ViewCount="855" Body="&lt;p&gt;magit-version: Magit 20170407.2107, Git (unknown), Emacs 25.1.1, darwin&#xA;git version 2.12.2&#xA;OS x 10.12.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;git status on command line works fine&#xA;git rev-parse --git-dir gives .git&lt;/p&gt;&#xA;&#xA;&lt;p&gt;magit-status asks for a directory, then asks to &quot;Create repository in xxx?&quot;, then &quot;user-error: Not inside a Git repository&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? &lt;/p&gt;&#xA;" OwnerUserId="345" LastActivityDate="2017-04-11T16:45:44.393" Title="Not inside a git repository" Tags="|magit|" AnswerCount="1" CommentCount="0" ClosedDate="2017-04-27T20:05:30.897" ContentLicense="CC BY-SA 3.0" />
  <row Id="32056" PostTypeId="1" CreationDate="2017-04-10T12:55:03.800" Score="1" ViewCount="413" Body="&lt;p&gt;In my emacs config i wrote:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    (use-package gnus&#xA;      :bind ((&quot;&amp;lt;f12&amp;gt;&quot; . gnus)&#xA;         :map gnus-group-mode-map&#xA;         (&quot;q&quot; . gnus-group-suspend)&#xA;         (&quot;Q&quot; . gnus-group-exit))&#xA;    :config ........)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After i load emacs, f12 works, but &quot;q&quot; and &quot;Q&quot; do not work in gnus buffer. Only when i manually load the same code these keys work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you help me to automatically bound these keys?&lt;/p&gt;&#xA;" OwnerUserId="14882" LastActivityDate="2017-11-07T12:17:30.283" Title="use-package gnus ignores :bind" Tags="|key-bindings|gnus|use-package|" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32057" PostTypeId="2" ParentId="32055" CreationDate="2017-04-10T13:43:55.640" Score="3" Body="&lt;p&gt;So the answer for me was:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package exec-path-from-shell&#xA;   :if (memq window-system '(mac ns))&#xA;   :ensure t&#xA;   :config&#xA;   (exec-path-from-shell-initialize))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in my init.el&lt;/p&gt;&#xA;" OwnerUserId="345" LastEditorUserId="345" LastEditDate="2017-04-11T16:45:44.393" LastActivityDate="2017-04-11T16:45:44.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32058" PostTypeId="1" AcceptedAnswerId="32059" CreationDate="2017-04-10T13:51:13.587" Score="8" ViewCount="2491" Body="&lt;p&gt;Why does GNU Emacs use ksi(ξ) as its logo, while most Lisp dialects use lambda(λ) as their logos?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vWxyX.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vWxyX.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;not mean this one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/K6ejX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/K6ejX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13609" LastEditorUserId="13609" LastEditDate="2017-04-11T00:54:02.813" LastActivityDate="2021-04-12T14:58:24.847" Title="Why does GNU Emacs use ksi(ξ) as its logo?" Tags="|help|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32059" PostTypeId="2" ParentId="32058" CreationDate="2017-04-10T13:55:55.663" Score="11" Body="&lt;p&gt;It doesn't. It uses just an &lt;code&gt;E&lt;/code&gt; that is suggestive of a gnu's horns.&lt;/p&gt;&#xA;" OwnerUserId="105" LastActivityDate="2017-04-10T13:55:55.663" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="32061" PostTypeId="1" CreationDate="2017-04-10T15:53:21.983" Score="1" ViewCount="325" Body="&lt;p&gt;I have a buffer that will have either plain text or an image (text properties) near the end of the buffer.  I would like to delete any new lines or whitespace at the end of the buffer.  How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following works if there is an image:  &lt;code&gt;(delete-region (previous-property-change (point-max)) (point-max))&lt;/code&gt;.  However, if there is no image, it deletes plain text -- which is not what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following works if there is no image, but deletes the image if there is one (which is also not what I want):&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion&#xA;  (goto-char (point-max))&#xA;  (let ((trailing-whitespace+newlines (abs (skip-chars-backward &quot;\s\r\n\t&quot;))))&#xA;    (when (&amp;gt; trailing-whitespace+newlines 0)&#xA;      (delete-char trailing-whitespace+newlines))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-04-10T15:59:01.207" LastActivityDate="2017-05-10T23:32:57.023" Title="delete trailing new lines / whitespace, but not an image at eob" Tags="|whitespace|text-properties|" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32062" PostTypeId="2" ParentId="32036" CreationDate="2017-04-10T16:17:40.643" Score="0" Body="&lt;p&gt;Thanks to the help from &lt;em&gt;lawlist&lt;/em&gt;, I figured out the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure I had tried &lt;code&gt;wl-message-redisplay-hook&lt;/code&gt;, but I was incorrectly trying to use the variable &lt;code&gt;wl-message-buffer&lt;/code&gt; to get the current &lt;code&gt;*WL:Message*&lt;/code&gt; buffer. However, in that hook (and in many other places in the wanderlust code), that variable's value is set to &lt;code&gt;nil&lt;/code&gt;. In general, I believe we cannot ever reliably use the &lt;code&gt;wl-message-buffer&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in &lt;code&gt;wl-message-redisplay-hook&lt;/code&gt;, the &lt;code&gt;(current-buffer)&lt;/code&gt; function will correctly return a reference to a live &lt;code&gt;*WL:Message*&lt;/code&gt; buffer instance containing the new message. I can then do whatever I want within that buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my code for performing the function I described above ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my-redisplay-func ()&#xA;  ;; As long as this function is run as a&#xA;  ;; wl-message-redisplay-hook, (current-buffer)&#xA;  ;; will return an instance of a live *WL:Message*&#xA;  ;; buffer.&#xA;  (let ((win (get-buffer-window (current-buffer))))&#xA;    (when win&#xA;      (with-selected-window win&#xA;        (let ((cur (point-min))&#xA;              (end (point-max))&#xA;              (image-pos))&#xA;          ;; Get the position of the first displayed&#xA;          ;; image, if there is one.&#xA;          (while (and (not image-pos) (&amp;lt;= cur end))&#xA;            (when (get-char-property cur 'display)&#xA;              (setq image-pos cur))&#xA;            (setq cur (1+ cur)))&#xA;          (when image-pos&#xA;            ;; Scroll to the first image row and reposition&#xA;            ;; it to the bottom of the window.&#xA;            (goto-char image-pos)&#xA;            (next-line)&#xA;            (recenter -1)&#xA;            (goto-char image-pos)))))))&#xA;(add-hook 'wl-message-redisplay-hook 'my-redisplay-func)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-11T16:23:23.457" LastActivityDate="2017-04-11T16:23:23.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32064" PostTypeId="1" CreationDate="2017-04-10T16:26:26.390" Score="1" ViewCount="87" Body="&lt;p&gt;I want to replace words like 1st with 1^{st} and 102nd with 102^{nd} while typing in emacs. Basically I want to replace things that match this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;\([0-9]+\)\(st\|nd\|rd\|th\)&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with this \1^{\2} as I type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like an abbrev might work for this, but it does not appear you can put a regexp as the name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best I have come up with is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun org-ordinal-expansion ()&#xA;  (interactive)&#xA;  (and (= ?w (char-syntax (char-before)))&#xA;       (save-excursion&#xA;         (and (skip-syntax-backward &quot;w&quot;)&#xA;          (let (case-fold-search)&#xA;        (looking-at &quot;\\([0-9]+\\)\\(st\\|nd\\|rd\\|th\\)&quot;))&#xA;          (replace-match &quot;\\1^{\\2}&quot;)))))&#xA;&#xA;(define-minor-mode ordinal-mode&#xA;  &quot;Toggle `ordinal-mode'.  Converst 1st to 1^{st} as you type.&quot;&#xA;  :init-value nil&#xA;  :lighter (&quot; om&quot;)&#xA;  (if ordinal-mode&#xA;      (add-hook 'post-self-insert-hook #'org-ordinal-expansion nil 'local)&#xA;    (remove-hook 'post-self-insert-hook #'org-ordinal-expansion 'local)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there some more elegant way to achieve this that doesn't rely on the post-self-insert-hook?&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="105" LastEditDate="2017-04-10T22:03:35.093" LastActivityDate="2017-04-10T22:03:35.093" Title="Can you use a regexp in an abbrev definition?" Tags="|regular-expressions|abbrev|" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32065" PostTypeId="2" ParentId="32040" CreationDate="2017-04-10T17:10:30.517" Score="0" Body="&lt;p&gt;Even though &lt;code&gt;(current-idle-time)&lt;/code&gt; only seems to return a meaningful value within the context of an idle handler, I figured out how to use it for my purpose ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Initialize to idle mode upon emacs startup.&#xA;(defvar my-last-idle t&#xA;  &quot;*Last idle time value.&quot;)&#xA;&#xA;(defun my-pre-command-hook ()&#xA;  (setq my-last-idle nil))&#xA;&#xA;(defun my-idle-timer-hook ()&#xA;  (setq my-last-idle (current-idle-time)))&#xA;&#xA;(add-hook 'pre-command-hook 'my-pre-command-hook)&#xA;(run-with-idle-timer 1 t 'my-idle-timer-hook)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, my sigusr1/sigusr2 handler can do this ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(when my-last-idle&#xA;  ;; Do my signal-handling stuff.&#xA;  ;; ... etc. ...&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-10T18:32:03.643" LastActivityDate="2017-04-10T18:32:03.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32066" PostTypeId="1" CreationDate="2017-04-10T17:16:17.743" Score="1" ViewCount="2836" Body="&lt;p&gt;I have an issue with &lt;code&gt;copy&lt;/code&gt; and &lt;code&gt;paste&lt;/code&gt; from or to Emacs (GUI); as precised in the title, I'm using Windows 7. The Emacs version is 25.1.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;kill&lt;/code&gt; and &lt;code&gt;yank&lt;/code&gt; are working properly though ; to &lt;code&gt;copy&lt;/code&gt; or &lt;code&gt;paste&lt;/code&gt;, I have to use the mouse, which is annoying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have nothing special in my .emacs file, I added the following lines but nothing has changed :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq select-enable-primary t)&#xA;(setq select-enable-clipboard t)&#xA;(setq save-interprogram-paste-before-kill t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;thanks in advance for your insights.&lt;/p&gt;&#xA;" OwnerUserId="13074" LastActivityDate="2018-01-15T12:34:19.287" Title="copy paste from/to GUI Emacs not working -- Windows 7" Tags="|microsoft-windows|copy-paste|clipboard|" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32067" PostTypeId="1" CreationDate="2017-04-10T17:26:54.280" Score="4" ViewCount="3676" Body="&lt;p&gt;I am using emacs 23.3 on Ubuntu 12.04 LTS. I am having problems trying to copy text from another application (most of the time, Firefox) to emacs. Sometimes it works and sometimes it doesn't. Any way to fix this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15493" LastActivityDate="2023-01-08T12:09:21.103" Title="How to copy text from another application to emacs in ubuntu?" Tags="|copy-paste|" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32068" PostTypeId="1" AcceptedAnswerId="32069" CreationDate="2017-04-10T17:59:47.700" Score="2" ViewCount="2102" Body="&lt;p&gt;When I start Spacemacs there is a message about some faults on my setup which scroll past quickly before I can view them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some file or some buffer that holds them for review?&lt;/p&gt;&#xA;" OwnerUserId="15477" LastActivityDate="2019-05-04T08:20:41.310" Title="How can the start up log of Spacemac be viewed?" Tags="|spacemacs|start-up|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32069" PostTypeId="2" ParentId="32068" CreationDate="2017-04-10T18:06:11.487" Score="6" Body="&lt;p&gt;You should be able to see it in &lt;code&gt;*Messages*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use &lt;code&gt;SPC w p m&lt;/code&gt; (Spacemacs specific) or &lt;code&gt;C-x 4 b&lt;/code&gt; to visit that buffer in another window (or &lt;code&gt;C-x b&lt;/code&gt; to visit it in the same window).  (When prompted for the buffer name completion is available: &lt;code&gt;*Me TAB&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="4102" LastEditorUserId="23367" LastEditDate="2019-05-04T08:20:41.310" LastActivityDate="2019-05-04T08:20:41.310" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32070" PostTypeId="1" AcceptedAnswerId="32107" CreationDate="2017-04-10T19:26:25.493" Score="0" ViewCount="144" Body="&lt;p&gt;I understand that when a window is split, the original window and the new window become children under a new &quot;parent window&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like the option to somehow register these windows such that when either child window is deleted, the other child and the parent are also automatically deleted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's why I want this ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using a complicated 3rd-party package that has a number of ways to create buffers and windows. Under certain isolated conditions (usually during a conditional operation within a hook function), I split certain windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use the standard facilities of this package to delete the original window (which is now one of the two children), the other, newly created child window remains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can write code to determine the parent of a window being deleted and to write more code to delete its parent and sibling windows. However, this involves manually modifying functions within this complicated 3rd-party package, and I'd like to avoid this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd like to somehow register the children and the parent at the time that the window is initially split, so that whenever one of the three windows is deleted, the other two are also automatically deleted. This way, when the existing 3rd-party code deletes the original window as part of its normal processing, the parent and the other child will also automatically be deleted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not been able to find any such facility in emacs nor in any searches. Does such a thing exist, by any chance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One idea which occurs to me is to write wrapper functions for &lt;code&gt;delete-window&lt;/code&gt; and &lt;code&gt;split-window&lt;/code&gt; and install them via emacs' advice mechanism. But is there perhaps another mechanism for my desired functionality which might already exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for any suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;NOTE:&lt;/em&gt;&lt;/strong&gt; In digging through the emacs source code, I notice something called an &quot;atomic window&quot; or an &quot;atom window&quot;. I can't find many docs for this, but it seems like it &lt;strong&gt;&lt;em&gt;might&lt;/em&gt;&lt;/strong&gt; give me what I want. For example, look at the final paragraph of the doc string for &lt;code&gt;delete-window&lt;/code&gt; ...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(delete-window &amp;amp;optional WINDOW)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Delete WINDOW. WINDOW must be a valid window and defaults to the&#xA;  selected one. Return nil.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the variable ‘ignore-window-parameters’ is non-nil or the&#xA;  ‘delete-window’ parameter of WINDOW equals t, do not process any&#xA;  parameters of WINDOW.  Otherwise, if the ‘delete-window’ parameter of&#xA;  WINDOW specifies a function, call that function with WINDOW as its&#xA;  sole argument and return the value returned by that function.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Otherwise, if WINDOW is part of an atomic window, call ‘delete-window’&#xA;  with the root of the atomic window as its argument.  Signal an error&#xA;  if WINDOW is either the only window on its frame, the last non-side&#xA;  window, or part of an atomic window that is its frame’s root window.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;... and here's the doc string for a function I found called &lt;code&gt;display-buffer-in-atom-window&lt;/code&gt; ...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(display-buffer-in-atom-window BUFFER ALIST)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Display BUFFER in an atomic window. This function displays BUFFER in a&#xA;  new window that will be combined with an existing window to form an&#xA;  atomic window.  If the existing window is already part of an atomic&#xA;  window, add the new window to that atomic window.  Operations like&#xA;  ‘split-window’ or ‘delete-window’, when applied to a constituent of an&#xA;  atomic window, are applied atomically to the root of that atomic&#xA;  window.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;ALIST is an association list of symbols and values.  The following&#xA;  symbols can be used.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;‘window’ specifies the existing window the new window shall be&lt;br&gt;&#xA;  combined with.  Use ‘window-atom-root’ to make the new window a&lt;br&gt;&#xA;  sibling of an atomic window’s root.  If an internal window is&lt;br&gt;&#xA;  specified here, all children of that window become part of the&lt;br&gt;&#xA;  atomic window too.  If no window is specified, the new window&lt;br&gt;&#xA;  becomes a sibling of the selected window.  By default, the&lt;br&gt;&#xA;  ‘window-atom’ parameter of the existing window is set to ‘main’&lt;br&gt;&#xA;  provided it is live and was not set before.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;‘side’ denotes the side of the existing window where the new   window&#xA;  shall be located.  Valid values are ‘below’, ‘right’,   ‘above’ and&#xA;  ‘left’.  The default is ‘below’.  By default, the   ‘window-atom’&#xA;  parameter of the new window is set to this value.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The return value is the new window, nil when creating that window&#xA;  failed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'll be investigating this atom(ic) window thing, and I'll report back.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-12T17:57:46.213" LastActivityDate="2017-04-12T17:57:46.213" Title="Auto-delete parent window when deleting any child?" Tags="|window|" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32071" PostTypeId="2" ParentId="32061" CreationDate="2017-04-10T20:12:01.680" Score="1" Body="&lt;p&gt;I think the problem is that &lt;code&gt;insert-image&lt;/code&gt; uses &quot; &quot; by default for the text to put in the buffer to hold the image.  If you pass a non-whitespace string as the second (optional) argument to the &lt;code&gt;insert-image&lt;/code&gt; function then &lt;code&gt;delete-whitespace&lt;/code&gt; should do the right thing and leave the image in the buffer as it's no longer associated with whitespace text.&lt;/p&gt;&#xA;" OwnerUserId="8583" LastActivityDate="2017-04-10T20:12:01.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32072" PostTypeId="2" ParentId="32066" CreationDate="2017-04-10T20:26:13.897" Score="1" Body="&lt;p&gt;I use simpleclip, there is a short explanation on the github page for what may be going on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/rolandwalker/simpleclip&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/rolandwalker/simpleclip&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bind simpleclip-paste to f9 f9&lt;/p&gt;&#xA;" OwnerUserId="13934" LastEditorUserId="13934" LastEditDate="2017-04-10T22:32:43.213" LastActivityDate="2017-04-10T22:32:43.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32073" PostTypeId="2" ParentId="32061" CreationDate="2017-04-10T20:58:06.643" Score="0" Body="&lt;p&gt;Here is a working draft that &lt;em&gt;might&lt;/em&gt; become final after I try it out some more.  I experimented with a few of the &lt;em&gt;property search&lt;/em&gt; functions in the manual -- &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Search.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Search.html&lt;/a&gt; -- in a forwards and reverse search.  I beleive it is possible to use some of those functions in a solution, but I have tentatively chosen instead to move backwards one character at a time until locating an image or text.&lt;/p&gt;&#xA;&#xA;  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(save-excursion&#xA;  (goto-char (point-max))&#xA;  (catch 'done&#xA;    (while (looking-back &quot;[\s\r\n\t]&quot; nil)&#xA;      (let* ((plist (text-properties-at (1- (point))))&#xA;             (image-p (eq (car (plist-get plist 'display)) 'image)))&#xA;        (if image-p&#xA;          (throw 'done nil)&#xA;          (delete-char -1))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-04-10T22:40:14.023" LastActivityDate="2017-04-10T22:40:14.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32075" PostTypeId="1" AcceptedAnswerId="32087" CreationDate="2017-04-11T03:24:23.573" Score="1" ViewCount="68" Body="&lt;p&gt;I have a multi-OS user-configuration.  On OSX, when I byte-compile, the function &lt;code&gt;w32-short-file-name&lt;/code&gt; is not defined (which is okay).  What is the proper way to silence the byte-compiler for this message which will not affect the ability to use this user-configuration on Windows?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In end of data:&#xA;lawlist-dired.el:13754:1:Warning: the following functions are not known to be defined:&#xA;  w32-using-nt (3046),&#xA;  w32-short-file-name (370674)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[I am assuming I can apply the same answer to &lt;code&gt;w32-using-nt&lt;/code&gt;.]&lt;/p&gt;&#xA;" OwnerUserId="2287" LastActivityDate="2017-04-11T18:39:13.137" Title="w32-short-file-name: multi-OS user-configuration -- silence byte-compiler" Tags="|byte-compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32076" PostTypeId="1" CreationDate="2017-04-11T03:59:10.607" Score="5" ViewCount="914" Body="&lt;p&gt;I want to connect to remote ipython server, and follow the doc of the ipython, I start a ipython server in my server by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ipython3 kernel -f ~/.ipython/kernel.json --pprint&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I can start a ipython client in iTerm by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;jupyter console --existing path/to/kernel.json --ssh user@192.168.1.111 -simple-prompt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I use the above command in emacs by &lt;code&gt;run-python&lt;/code&gt; and got &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Warning (python): Python shell prompts cannot be detected.&#xA;If your emacs session hangs when starting python shells&#xA;recover with ‘keyboard-quit’ and then try fixing the&#xA;interactive flag for your interpreter by adjusting the&#xA;‘python-shell-interpreter-interactive-arg’ or add regexps&#xA;matching shell prompts in the directory-local friendly vars:&#xA;  + ‘python-shell-prompt-regexp’&#xA;  + ‘python-shell-prompt-block-regexp’&#xA;  + ‘python-shell-prompt-output-regexp’&#xA;Or alternatively in:&#xA;  + ‘python-shell-prompt-input-regexps’&#xA;  + ‘python-shell-prompt-output-regexps’&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The solution in &lt;a href=&quot;https://emacs.stackexchange.com/questions/13385/running-ipython-remotely&quot;&gt;here&lt;/a&gt; does not work for me and even if it does, it seems that one can not send code to this &lt;code&gt;*Python*&lt;/code&gt; buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is how can I use a remote ipython console and send by codes by &lt;code&gt;python-shell-send-*&lt;/code&gt; functions ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="8373" LastEditorUserId="-1" LastEditDate="2017-04-13T12:52:45.547" LastActivityDate="2024-03-22T10:06:35.767" Title="Problem of starting a remote ipython console" Tags="|python|tramp|ipython|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32077" PostTypeId="1" AcceptedAnswerId="32078" CreationDate="2017-04-11T04:17:21.020" Score="2" ViewCount="2362" Body="&lt;p&gt;It seems that my question should be common knowledge, and I thought I knew it (at some point in the distant past), but the answer escapes me tonight.  I'd like to take a string like &lt;code&gt;&quot;foo&quot;&lt;/code&gt; and programmatically convert it to &lt;code&gt;&quot;\&quot;foo\&quot;&quot;&lt;/code&gt;.  Is there a built-in function for that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize I can &lt;code&gt;(concat &quot;\&quot;&quot; &quot;foo&quot; &quot;\&quot;&quot;)&lt;/code&gt;, but I thought there is probably an existing function that does this.&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-04-11T05:38:07.857" LastActivityDate="2020-07-21T03:20:56.260" Title="How to programmatically surround a string with escaped double-quote" Tags="|string|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32078" PostTypeId="2" ParentId="32077" CreationDate="2017-04-11T04:31:14.953" Score="7" Body="&lt;p&gt;You might be thinking of &lt;code&gt;prin1-to-string&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(prin1-to-string &amp;quot;foo&amp;quot;)&#xA;=&amp;gt; &amp;quot;\&amp;quot;foo\&amp;quot;&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You probably need some protection though (ensure it's a string, strip text properties, etc.), because you'll get more than you bargained for if you try it with a propertized string:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(prin1-to-string (propertize &amp;quot;foo&amp;quot; 'bar &amp;quot;baz&amp;quot;))&#xA;=&amp;gt; &amp;quot;#(\&amp;quot;foo\&amp;quot; 0 3 (bar \&amp;quot;baz\&amp;quot;))&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;In that case you'll also need to ensure the properties have been removed.  For example:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;(let* ((str (propertize &amp;quot;foo \&amp;quot;bar\&amp;quot;&amp;quot; 'bar &amp;quot;baz&amp;quot;)))&#xA;  (set-text-properties 0 (length str) nil str)&#xA;  (prin1-to-string str))&#xA;=&amp;gt; &amp;quot;\&amp;quot;foo \\\&amp;quot;bar\\\&amp;quot;\&amp;quot;&amp;quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="2731" LastEditDate="2020-07-21T03:20:56.260" LastActivityDate="2020-07-21T03:20:56.260" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32079" PostTypeId="1" AcceptedAnswerId="32097" CreationDate="2017-04-11T06:21:39.340" Score="0" ViewCount="656" Body="&lt;p&gt;I have a elisp script that needs to work across different OS platform. So I need to use the &lt;code&gt;convert-standard-filename&lt;/code&gt; to make sure the filename confirms to OS standard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I found Emacs for Windows can handle Windows filename correctly, and it somehow cannot handle the filename returned by the &lt;code&gt;convert-standard-filename&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I need a way to test if the script is executing in s &lt;code&gt;minGW&lt;/code&gt; environment, and return the raw filename.&lt;/p&gt;&#xA;" OwnerUserId="12018" LastEditorUserId="105" LastEditDate="2017-04-11T14:05:10.550" LastActivityDate="2018-06-06T10:45:18.027" Title="How do I test if my Emacs is in minGW environment?" Tags="|microsoft-windows|" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32080" PostTypeId="1" AcceptedAnswerId="32083" CreationDate="2017-04-11T07:06:41.983" Score="1" ViewCount="2571" Body="&lt;p&gt;The default for exporting to LaTeX from org-mode files is to have the article document class at size 11pt font &lt;code&gt;\documentclass[11pt]{article}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get the exported LaTeX file to be a specified font size, namely 12pt?&lt;/p&gt;&#xA;" OwnerUserId="9019" LastActivityDate="2017-04-13T08:17:21.027" Title="Exporting org-mode file to LaTeX with different document font" Tags="|org-mode|org-export|latex|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32082" PostTypeId="2" ParentId="32009" CreationDate="2017-04-11T08:22:09.330" Score="0" Body="&lt;p&gt;Yes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got here while searching for the same thing. I am trying &lt;a href=&quot;https://github.com/nsf/gocode&quot; rel=&quot;nofollow noreferrer&quot;&gt;gocode&lt;/a&gt; together with &lt;a href=&quot;https://www.emacswiki.org/emacs/AutoComplete&quot; rel=&quot;nofollow noreferrer&quot;&gt;auto-complete-mode&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't get it to complete on &lt;code&gt;.&lt;/code&gt; though. Have to type one or two chars to get completion. Not sure if it is me or not possible. I am no emacs wizard..... yet.....&lt;/p&gt;&#xA;" OwnerUserId="8397" LastActivityDate="2017-04-11T08:22:09.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32083" PostTypeId="2" ParentId="32080" CreationDate="2017-04-11T08:30:27.207" Score="4" Body="&lt;p&gt;Problably the simplest is to add &lt;code&gt;#+LATEX_CLASS_OPTIONS: [12pt]&lt;/code&gt; in you file, as discussed in the &lt;a href=&quot;http://orgmode.org/manual/LaTeX-header-and-sectioning.html#LaTeX-header-and-sectioning&quot; rel=&quot;nofollow noreferrer&quot;&gt;doc&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The LATEX_CLASS_OPTIONS keyword or EXPORT_LATEX_CLASS_OPTIONS property can specify the options for the \documentclass macro. These options have to be provided, as expected by LaTeX, within square brackets. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can also use the LATEX_HEADER and LATEX_HEADER_EXTRA2 keywords in order to add lines to the header. See the docstring of org-latex-classes for more information.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;An example is shown below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+LATEX_CLASS: article&#xA;#+LATEX_CLASS_OPTIONS: [a4paper]&#xA;#+LATEX_HEADER: \usepackage{xyz}&#xA;&#xA;* Headline 1&#xA;  some text&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2017-04-13T08:17:21.027" LastActivityDate="2017-04-13T08:17:21.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32086" PostTypeId="1" CreationDate="2017-04-11T16:58:22.127" Score="0" ViewCount="63" Body="&lt;p&gt;I have the following function to produce a form that can be &quot;printed&quot; to a &lt;code&gt;~/.gnus&lt;/code&gt; file to configure gnus to use a certain stmp and imap server for an account:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun gnus-imap-smtp-form (email smtp-server-port imap-server-port)&#xA;  (destructuring-bind ((smtp-server . smtp-port) . (imap-server . imap-port))&#xA;      (cons smtp-server-port imap-server-port)&#xA;    `(let ((email ,email)&#xA;       (smtp-server ,smtp-server)&#xA;       (smtp-port ,smtp-port)&#xA;       (imap-server ,imap-server)&#xA;       (imap-port ,imap-port))&#xA;       (setf gnus-select-method&#xA;         `(nnimap ,email&#xA;              (nnimap-address ,imap-server)&#xA;              (nnimap-server-port ,imap-port)&#xA;              (nnimap-stream ssl)))&#xA;&#xA;       (setf message-send-mail-function 'smtpmail-send-it&#xA;         smtpmail-starttls-credentials `((,smtp-server ,smtp-port nil nil))&#xA;         smtpmail-auth-credentials `((,smtp-server ,smtp-port&#xA;                               ,email nil))&#xA;         smtpmail-default-smtp-server smtp-server&#xA;         smtpmail-smtp-server smtp-server&#xA;         smtpmail-smtp-service smtp-port&#xA;         gnus-ignored-newsgroups&#xA;         &quot;^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\&quot;]\&quot;[#'()]&quot;)&#xA;&#xA;       (setf user-mail-address email)&#xA;       (setf smtpmail-stream-type 'starttls))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the past, the above has generated the correct form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-imap-smtp-form &quot;me@company.com&quot; '(&quot;my.company.smtp&quot; . 587) '(&quot;my.company.imap&quot; . 993))&#xA;&#xA;&#xA;(let&#xA;       ((email &quot;me@company.com&quot;)&#xA;        (smtp-server &quot;my.company.smtp&quot;)&#xA;        (smtp-port 25)&#xA;        (imap-server &quot;my.company.imap&quot;)&#xA;        (imap-port 993))&#xA;     (setf gnus-select-method&#xA;           `(nnimap ,email&#xA;            (nnimap-address ,imap-server)&#xA;            (nnimap-server-port ,imap-port)&#xA;            (nnimap-stream ssl)))&#xA;     (setf message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials&#xA;           `((,smtp-server ,smtp-port nil nil))&#xA;           smtpmail-auth-credentials&#xA;           `((,smtp-server ,smtp-port ,email nil))&#xA;           smtpmail-default-smtp-server smtp-server smtpmail-smtp-server smtp-server smtpmail-smtp-service smtp-port gnus-ignored-newsgroups &quot;^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\&quot;]\&quot;[#'()]&quot;)&#xA;     (setf user-mail-address email)&#xA;     (setf smtpmail-stream-type 'starttls))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Today, I tried to generate the form for another account, but I am getting triple dots &lt;code&gt;...&lt;/code&gt; instead of nested backquotes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(gnus-imap-smtp-form &quot;me@gmail.com&quot; '(&quot;smtp.gmail.com&quot; . 587) '(&quot;imap.gmail.com&quot; . 993)) &#xA;&#xA;&#xA;    (let&#xA;    ((email &quot;me@gmail.com&quot;)&#xA;     (smtp-server &quot;smtp.gmail.com&quot;)&#xA;     (smtp-port 587)&#xA;     (imap-server &quot;imap.gmail.com&quot;)&#xA;     (imap-port 993))&#xA;  (setf gnus-select-method&#xA;    `(nnimap ... ... ... ...))&#xA;  (setf message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials&#xA;    `(...)&#xA;    smtpmail-auth-credentials&#xA;    `(...)&#xA;    smtpmail-default-smtp-server smtp-server smtpmail-smtp-server smtp-server smtpmail-smtp-service ...)&#xA;  (setf user-mail-address email)&#xA;  (setf smtpmail-stream-type 'starttls))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What could be happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;code&gt;(prin1 form)&lt;/code&gt;, let-binding to &lt;code&gt;nil&lt;/code&gt; both &lt;code&gt;eval-expression-print-length&lt;/code&gt; and &lt;code&gt;eval-expression-print-level&lt;/code&gt;, but &lt;code&gt;prin1&lt;/code&gt; still abbreviates the expression:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((eval-expression-print-length nil)&#xA;      (eval-expression-print-level nil))&#xA;      (prin1 form))&#xA;(let ((email &quot;me@gmail.com&quot;) (smtp-server &quot;smtp.gmail.com&quot;) (smtp-port 587) (imap-server &quot;imap.gmail.com&quot;) (imap-port 993)) (setf gnus-select-method (\` (nnimap ... ... ... ...))) (setf message-send-mail-function (quote smtpmail-send-it) smtpmail-starttls-credentials (\` (...)) smtpmail-auth-credentials (\` (...)) smtpmail-default-smtp-server smtp-server smtpmail-smtp-server smtp-server smtpmail-smtp-service ...) (setf user-mail-address email) (setf smtpmail-stream-type (quote starttls)))&#xA;(let&#xA;    ((email &quot;me@gmail.com&quot;)&#xA;     (smtp-server &quot;smtp.gmail.com&quot;)&#xA;     (smtp-port 587)&#xA;     (imap-server &quot;imap.gmail.com&quot;)&#xA;     (imap-port 993))&#xA;  (setf gnus-select-method&#xA;    `(nnimap ... ... ... ...))&#xA;  (setf message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials&#xA;    `(...)&#xA;    smtpmail-auth-credentials&#xA;    `(...)&#xA;    smtpmail-default-smtp-server smtp-server smtpmail-smtp-server smtp-server smtpmail-smtp-service ...)&#xA;  (setf user-mail-address email)&#xA;  (setf smtpmail-stream-type 'starttls))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Binding &lt;code&gt;print-level&lt;/code&gt; and &lt;code&gt;print-length&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(let ((eval-expression-print-length nil)&#xA;         (eval-expression-print-level nil)&#xA;         (print-level nil)&#xA;         (print-length nil))&#xA;     (prin1 form))&#xA;(let ((email &quot;me@gmail.com&quot;) (smtp-server &quot;smtp.gmail.com&quot;) (smtp-port 587) (imap-server &quot;imap.gmail.com&quot;) (imap-port 993)) (setf gnus-select-method (\` (nnimap (\, email) (nnimap-address (\, imap-server)) (nnimap-server-port (\, imap-port)) (nnimap-stream ssl)))) (setf message-send-mail-function (quote smtpmail-send-it) smtpmail-starttls-credentials (\` (((\, smtp-server) (\, smtp-port) nil nil))) smtpmail-auth-credentials (\` (((\, smtp-server) (\, smtp-port) (\, email) nil))) smtpmail-default-smtp-server smtp-server smtpmail-smtp-server smtp-server smtpmail-smtp-service smtp-port gnus-ignored-newsgroups &quot;^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\&quot;]\&quot;[#'()]&quot;) (setf user-mail-address email) (setf smtpmail-stream-type (quote starttls)))&#xA;(let&#xA;    ((email &quot;me@gmail.com&quot;)&#xA;     (smtp-server &quot;smtp.gmail.com&quot;)&#xA;     (smtp-port 587)&#xA;     (imap-server &quot;imap.gmail.com&quot;)&#xA;     (imap-port 993))&#xA;  (setf gnus-select-method&#xA;    `(nnimap ... ... ... ...))&#xA;  (setf message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials&#xA;    `(...)&#xA;    smtpmail-auth-credentials&#xA;    `(...)&#xA;    smtpmail-default-smtp-server smtp-server smtpmail-smtp-server smtp-server smtpmail-smtp-service ...)&#xA;  (setf user-mail-address email)&#xA;  (setf smtpmail-stream-type 'starttls))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2846" LastEditorUserId="2846" LastEditDate="2017-04-11T23:37:16.807" LastActivityDate="2017-04-12T18:44:48.480" Title="prin1 abbreviates form with &quot;...&quot; despite expression-print-level?" Tags="|gnus|elisp-macros|backquote|" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="32087" PostTypeId="2" ParentId="32075" CreationDate="2017-04-11T18:39:13.137" Score="1" Body="&lt;p&gt;You can use &lt;code&gt;declare-function&lt;/code&gt; to declare the files where the functions are defined. From &lt;kbd&gt;C-h&lt;/kbd&gt;&lt;kbd&gt;f&lt;/kbd&gt;&lt;code&gt;declare-function&lt;/code&gt;&lt;kbd&gt;RET&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Tell the byte-compiler that function FN is defined, in FILE.&#xA;  Optional ARGLIST is the argument list used by the function.&#xA;  The FILE argument is not used by the byte-compiler, but by the&#xA;  ‘check-declare’ package, which checks that FILE contains a&#xA;  definition for FN.  ARGLIST is used by both the byte-compiler&#xA;  and ‘check-declare’ to check for consistency.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="247" LastActivityDate="2017-04-11T18:39:13.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32088" PostTypeId="2" ParentId="15264" CreationDate="2017-04-11T19:04:05.933" Score="1" Body="&lt;p&gt;Google searches returned an &lt;a href=&quot;https://tex.stackexchange.com/a/14776&quot;&gt;old answer&lt;/a&gt; from TeX Stackexchange community. The solution suggested is to call &lt;code&gt;xelatex&lt;/code&gt; with &lt;code&gt;-8bit&lt;/code&gt; flag.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A solution may be to call xetex with the command line option -8bit, but I don't know if this has other side effects.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So your configuration should change to&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(setq org-latex-pdf-process&#xA;        '(&quot;xelatex -8bit -shell-escape -interaction nonstopmode -output-directory %o %f&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also keep in mind the possibility of unintended side-effects as warned by the author.&lt;/p&gt;&#xA;" OwnerUserId="247" LastEditorUserId="-1" LastEditDate="2017-04-13T12:34:32.203" LastActivityDate="2017-04-11T19:04:05.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32089" PostTypeId="1" CreationDate="2017-04-11T19:09:33.623" Score="2" ViewCount="263" Body="&lt;p&gt;I have an org-mode file with a bunch of tables. In one tree I would like all the tables to have some specific HTML export attributes, but not in others. Is there a way I can do this without having to copy &quot;#+ATTR_HTML: blah&quot; to every table I want to affect?&lt;/p&gt;&#xA;" OwnerUserId="14636" LastActivityDate="2017-04-11T19:09:33.623" Title="Is there a way to specify that I want all tables in an org-mode file to have specific attributes?" Tags="|org-mode|org-export|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32090" PostTypeId="1" AcceptedAnswerId="32091" CreationDate="2017-04-11T19:29:30.070" Score="1" ViewCount="64" Body="&lt;p&gt;I changed my Emacs configuration including indentation settings -now when I open an old C++ file I can write code and it looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int x(int z){&#xA;    return z;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, the old code in this file looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int x(int z){&#xA;        return z;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In other words its indentation is doubled. &lt;strong&gt;How can I reformat the old code so that it's appropriately indented?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="15502" LastActivityDate="2017-04-12T10:12:45.607" Title="Changed indentation settings - how to reformat old code?" Tags="|indentation|whitespace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32091" PostTypeId="2" ParentId="32090" CreationDate="2017-04-11T19:38:08.060" Score="3" Body="&lt;p&gt;In short: &#xA;  C-x h and then TAB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It changes formatting for whole buffer.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Details&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;C-x h&lt;/strong&gt; - marks whole buffer&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;TAB&lt;/strong&gt; - indent marked region&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, effectively we mark all, then indent ;-)&lt;/p&gt;&#xA;" OwnerUserId="9283" LastEditorUserId="9283" LastEditDate="2017-04-12T10:12:45.607" LastActivityDate="2017-04-12T10:12:45.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32093" PostTypeId="1" AcceptedAnswerId="32275" CreationDate="2017-04-11T23:07:36.667" Score="1" ViewCount="784" Body="&lt;p&gt;So this is quite strange and I'm not sure how solvable this will be. But yesterday erc was working just fine, and then today it is stuck on trying to connect to the server (irc.freenode.net) with the error of: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Connection failed!  Re-establishing connection...&#xA;*** ERC terminated: failed with code 22&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't find any way to figure out what &quot;code 22&quot; means. I'm on a Mac 10.11.6 (El Capitan), installed emacs through brew, and ran emacs like so: &lt;code&gt;emacs --no-init-file&lt;/code&gt;. I've also uninstalled/reinstalled by deleting both the ~/Library/Caches/Homebrew/emac* and /usr/local/Cellar/emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly during a fresh reinstall of running &lt;code&gt;emacs --no-init-file&lt;/code&gt; I also tried to run both &lt;code&gt;M-x erc&lt;/code&gt;, &lt;code&gt;M-x irc&lt;/code&gt; (in emacs), and &lt;code&gt;M-x erc-tls&lt;/code&gt; all fail to connect. I have also tried different ports 6667-7000 any help is appreciated, and thank you.&lt;/p&gt;&#xA;" OwnerUserId="15475" LastEditorUserId="15475" LastEditDate="2017-04-11T23:57:42.710" LastActivityDate="2017-04-21T13:22:44.807" Title="Erc, rcirc, and circe, just won't connect" Tags="|irc|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32094" PostTypeId="1" CreationDate="2017-04-11T23:19:03.453" Score="0" ViewCount="783" Body="&lt;p&gt;In evil-mode, the cursor shape and colour for each state is controlled by the series of variables &lt;code&gt;evil-*-state-cursor&lt;/code&gt;. The documentation for these variables states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;May be a cursor type as per &lt;code&gt;cursor-type&lt;/code&gt;, a color string as passed&#xA;  to &lt;code&gt;set-cursor-color&lt;/code&gt;, a zero-argument function for changing the&#xA;  cursor, or a list of the above.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, when I attempt to use such a nullary function to make the shape of &lt;code&gt;evil-insert-state-cursor&lt;/code&gt; dependent on the value of &lt;code&gt;overwrite-mode&lt;/code&gt;, it doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq evil-insert-state-cursor&#xA;      (lambda()&#xA;        (cond (overwrite-mode '(&quot;chartreuse3&quot; (hbar . 2)))&#xA;              (t              '(&quot;chartreuse3&quot; (bar  . 2))))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result of this is that the insert cursor changes to a hollow box in the same colour as the normal state cursor (Darkgoldenrod2 on my system). If I use a named function instead, I get a solid box (ie. identical to the normal state cursor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also attempted to use a function that actually &lt;em&gt;sets&lt;/em&gt; the value of &lt;code&gt;evil-insert-state-cursor&lt;/code&gt;, rather than simply returning it. The result was the same. In general, setting the variable to &lt;em&gt;any&lt;/em&gt; function results in a solid cursor, while setting it to any symbol/quoted sexp or lambda results in a hollow cursor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I set a state-cursor variable to a function effectively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(I've found the answer to this before posting, but since I've already written the question, I might as well post it with the answer in case anyone else is searching for it.)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="8578" LastActivityDate="2018-06-06T06:45:08.470" Title="How to set `evil-insert-state-cursor` to a function?" Tags="|evil|cursor|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32095" PostTypeId="2" ParentId="32094" CreationDate="2017-04-11T23:19:03.453" Score="1" Body="&lt;p&gt;So I've found the answer to this is &lt;code&gt;evil-states.el&lt;/code&gt;. Here's an example of a cursor defined with a function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(evil-define-state operator&#xA;  &quot;Operator-Pending state.&quot;&#xA;  :tag &quot; &amp;lt;O&amp;gt; &quot;&#xA;  :cursor evil-half-cursor&#xA;  :enable (evil-operator-shortcut-map operator motion normal))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and the function definition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; the half-height &quot;Operator-Pending cursor&quot; cannot be specified&#xA;;; as a static `cursor-type' value, since its height depends on&#xA;;; the current font size&#xA;(defun evil-half-cursor ()&#xA;  &quot;Change cursor to a half-height box.&#xA;\(This is really just a thick horizontal bar.)&quot;&#xA;  (let ((height (/ (window-pixel-height) (* (window-height) 2))))&#xA;    (setq cursor-type (cons 'hbar height))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the function must set the &lt;code&gt;cursor-type&lt;/code&gt; variable with the appropriate value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This example is a bit different from my use-case, since the cursor doesn't need to change after the state is entered. Reasonably enough, evil doesn't re-evaluate the function every keystroke, so for a use-case like mine, we also need to invoke &lt;code&gt;evil-refresh-cursor&lt;/code&gt; to do as its name implies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, this ignores cursor-colour, so the cursor will have whatever colour it had last (probably from normal-state). We can fix this by also calling &lt;code&gt;set-cursor-color&lt;/code&gt; in our function.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Solution:&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun my/evil-insert-overwrite-cursor ()&#xA;  (set-cursor-color &quot;chartreuse3&quot;)&#xA;  (setq cursor-type (if overwrite-mode (cons 'hbar 2) (cons 'bar 2))))&#xA;&#xA;(setq evil-insert-state-cursor #'my/evil-insert-overwrite-cursor)&#xA;&#xA;(defun my/enter-overwrite-mode ()&#xA;  (interactive)&#xA;  (call-interactively #'overwrite-mode)&#xA;  (evil-refresh-cursor))&#xA;&#xA;(define-key evil-insert-state-map (kbd &quot;&amp;lt;insert&amp;gt;&quot;) 'my/enter-overwrite-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;note:&lt;/strong&gt; There is an &lt;code&gt;overwrite-mode-hook&lt;/code&gt;, so we could add &lt;code&gt;evil-refresh-cursor&lt;/code&gt; to that, to be sure it will always be triggered. However, I only expect to enter overwrite-mode with &lt;kbd&gt;Insert&lt;/kbd&gt; and I prefer to use wrapper functions unless hooks are necessary.&lt;/p&gt;&#xA;" OwnerUserId="8578" LastActivityDate="2017-04-11T23:19:03.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32096" PostTypeId="2" ParentId="31932" CreationDate="2017-04-12T01:15:54.247" Score="3" Body="&lt;p&gt;Call function &lt;code&gt;org-babel-get-src-block-info&lt;/code&gt; and access the 3rd element instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: nodes&#xA;| From | To | Weight |&#xA;|------+----+--------|&#xA;| A    | B  |      3 |&#xA;| A    | C  |      2 |&#xA;| B    | D  |      4 |&#xA;| B    | E  |      5 |&#xA;| C    | F  |     10 |&#xA;&#xA;#+BEGIN_SRC elisp :imagename test.png :results output raw :var nodes=nodes&#xA;  (defun rowfun(x)&#xA;    (format &quot;%s -&amp;gt; %s [label=%s];&quot; (nth 0 x) (nth 1 x) (nth 2 x)))&#xA;  (defun dotgen(nodes)&#xA;    (let ((dotbegin &quot;digraph {\nnode [shape=circle]\n&quot;)&#xA;          (dotend &quot;\n}&quot;))&#xA;      (concat dotbegin&#xA;              (mapconcat #'rowfun nodes &quot;\n&quot;)&#xA;              dotend)))&#xA;  (let* ((params (nth 2 (org-babel-get-src-block-info)))&#xA;         (imagename (cdr (assq :imagename params))))&#xA;    (assq-delete-all :imagename params)&#xA;    (push `(:file . ,imagename) params)&#xA;    (org-babel-execute:dot (dotgen nodes) params) &#xA;    (princ (format &quot;[[./%s]]&quot; imagename)))&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[./test.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2pAXi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2pAXi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another more generic solution is using two src block, one for elisp to generate the dot description; the other one is the dot src block with the elisp src as input var.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+NAME: nodes&#xA;| From | To | Weight |&#xA;|------+----+--------|&#xA;| A    | B  |     13 |&#xA;| A    | C  |      2 |&#xA;| B    | D  |      4 |&#xA;| B    | E  |      5 |&#xA;| C    | F  |     10 |&#xA;&#xA;#+NAME: elisp-src&#xA;#+BEGIN_SRC elisp :var nodes=nodes&#xA;  (defun rowfun(x)&#xA;    (format &quot;%s -&amp;gt; %s [label=%s];&quot; (nth 0 x) (nth 1 x) (nth 2 x)))&#xA;  (defun dotgen(nodes)&#xA;    (let ((dotbegin &quot;digraph {\nnode [shape=circle]\n&quot;)&#xA;          (dotend &quot;\n}&quot;))&#xA;      (concat dotbegin&#xA;              (mapconcat #'rowfun nodes &quot;\n&quot;)&#xA;              dotend)))&#xA;  (dotgen nodes)&#xA;#+END_SRC&#xA;&#xA;#+BEGIN_SRC dot :file dot.png :var dotdesc=elisp-src&#xA;$dotdesc&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;[[file:dot.png]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="14840" LastEditorUserId="14840" LastEditDate="2017-04-13T02:28:02.663" LastActivityDate="2017-04-13T02:28:02.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32097" PostTypeId="2" ParentId="32079" CreationDate="2017-04-12T02:27:16.233" Score="0" Body="&lt;h1&gt;Using &lt;code&gt;system-type&lt;/code&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you can roll out &lt;code&gt;cygwin&lt;/code&gt; environment, then using &lt;code&gt;system-type&lt;/code&gt; is a reliable way to test if Emacs is running in &lt;strong&gt;minGW&lt;/strong&gt; or &lt;strong&gt;MSYS&lt;/strong&gt; environment. If &lt;code&gt;system-type&lt;/code&gt; is &lt;em&gt;windows-nt&lt;/em&gt;, it must be one of the two.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Alternatively&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;So far, I found using the &lt;code&gt;SHELL&lt;/code&gt; variable in the Emacs environment is a reliable to to identify it it is running in &lt;strong&gt;minGW&lt;/strong&gt; environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No matter in MSYS or mingGW environment, the &lt;code&gt;SHELL&lt;/code&gt; variable is set to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/some/path/cmdproxy.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I use the last part as a identifier.&lt;/p&gt;&#xA;" OwnerUserId="12018" LastEditorUserId="12018" LastEditDate="2017-04-12T03:05:33.373" LastActivityDate="2017-04-12T03:05:33.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32098" PostTypeId="1" CreationDate="2017-04-12T03:31:33.870" Score="4" ViewCount="175" Body="&lt;p&gt;I've seen the following in &lt;a href=&quot;https://github.com/hlissner/.emacs.d/blob/master/core/core.el#L69&quot; rel=&quot;noreferrer&quot;&gt;some init files&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(set-charset-priority 'unicode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but after reading the documentation, I can't really say I understand the  implications of this. In general I'm inclined to go Unicode and UTF-8 all the way, this being 2017, but would setting unicode as the highest priority charset have performance implications?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that a charset is distinct from an encoding scheme (e.g. UTF-8), but I don't think I understand Emac's handling of charsets well enough to understand the effect this setting has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, running &lt;code&gt;charset-priority-list&lt;/code&gt; in my current Emacs returns a list of 170 charsets, beginning with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(ascii&#xA;iso-8859-1&#xA;unicode&#xA;latin-iso8859-1&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-04-12T03:31:33.870" Title="(set-charset-priority 'unicode) ; should I do it?" Tags="|unicode|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32099" PostTypeId="1" CreationDate="2017-04-12T03:34:06.587" Score="0" ViewCount="41" Body="&lt;p&gt;To construct a quasi-alist, case 1 is using hardcode string; case 2 is using a variable &lt;code&gt;filename&lt;/code&gt; to replace the hadcode string. but case 2 doesn't work as expected (should the same as case 1).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+BEGIN_SRC elisp :results output&#xA;;; case 1&#xA;(setq alist '((:file . &quot;test.txt&quot;)))&#xA;(print alist)&#xA;&#xA;;;case 2&#xA;(setq filename &quot;test.txt&quot;)&#xA;(setq alist '((:file . filename)))&#xA;(print alist)&#xA;#+END_SRC&#xA;&#xA;#+RESULTS:&#xA;: &#xA;: ((:file . &quot;test.txt&quot;))&#xA;: &#xA;: ((:file . filename))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the right way to use a variable to construct a quasi-alist?&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="105" LastEditDate="2017-04-12T04:55:42.473" LastActivityDate="2017-04-12T04:55:42.473" Title="elisp - construct a quasi-alist from variable" Tags="|quote|association-lists|backquote|" AnswerCount="0" CommentCount="2" ClosedDate="2017-04-13T21:30:21.703" ContentLicense="CC BY-SA 3.0" />
  <row Id="32100" PostTypeId="1" AcceptedAnswerId="32129" CreationDate="2017-04-12T04:55:49.720" Score="5" ViewCount="76" Body="&lt;p&gt;I'm making a presentation mode where I want to vertically center some text in the window, which is the only window in the frame. I'm using a custom face so I can control how large the font is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To horizontally center the text, I can use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html#index-window_002dmax_002dchars_002dper_002dline&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;window-max-chars-per-line&lt;/code&gt;&lt;/a&gt; with the &lt;code&gt;face&lt;/code&gt; argument, so I can get the number of characters put in a line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I also want to know how many lines are in the window. There's &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html#index-window_002dbody_002dheight&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;window-body-height&lt;/code&gt;&lt;/a&gt;, but that doesn't let me specify a face.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I tell how tall a window is in lines of a specific face?&lt;/p&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-04-13T05:05:44.020" Title="How do I tell how many lines of a specific face fit in a window?" Tags="|window|faces|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32103" PostTypeId="1" AcceptedAnswerId="32206" CreationDate="2017-04-12T10:54:10.443" Score="5" ViewCount="6725" Body="&lt;p&gt;I have anaconda environments for python2 and python3 as I have code written in the different versions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In spacemacs (with python layer installed), when I open ipython (&lt;code&gt;SPC m s i&lt;/code&gt;) it starts with my default environment (python 3)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to choose which version of python I run my code with? I've tried opening a shell with &lt;code&gt;activate python2&lt;/code&gt; to activate my other environment, but ipython in emacs still opens with my default&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way I've found is to activate the environment is &lt;code&gt;SPC m V a&lt;/code&gt; then navigate to the directory where the venv is, but this is quite tedious as the python script and venv are often on different drives so it takes a fair bit of typing/tabbing to get to the venv directory&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a quicker way?&lt;/p&gt;&#xA;" OwnerUserId="10550" LastActivityDate="2023-06-22T08:33:43.860" Title="Spacemacs use anaconda environment" Tags="|spacemacs|python|ipython|anaconda-mode|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32104" PostTypeId="1" AcceptedAnswerId="32135" CreationDate="2017-04-12T12:45:57.873" Score="7" ViewCount="1276" Body="&lt;p&gt;We can avoid adding duplicate elements to a list variable by using &lt;code&gt;add-to-list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When setting a customizable variable (i.e. one that is or will be defined by &lt;code&gt;defcustom&lt;/code&gt;) from our init file, we're encouraged to use &lt;code&gt;custom-set-variables&lt;/code&gt; (or &lt;code&gt;customize-set-variable&lt;/code&gt;) rather than &lt;code&gt;setq&lt;/code&gt;, to ensure the variable's setter function is run. This also correctly handles cases where the variable hasn't been defined yet, by &quot;remembering&quot; it and setting the desired value once &lt;code&gt;defcustom&lt;/code&gt; has defined the variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if the customizable variable will hold a list, how should we add to it? I've been using this sort of thing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(with-eval-after-load 'savehist&#xA;  (add-to-list 'savehist-additional-variables&#xA;               'evil-ex-history))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I just read in the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks-for-Loading.html&quot; rel=&quot;noreferrer&quot;&gt;Elisp manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Normally, well-designed Lisp programs should not use with-eval-after-load. If you need to examine and set the variables defined in another library (those meant for outside use), you can do it immediately—there is no need to wait until the library is loaded.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there another way to handle adding to a customizable list variable that may not have been defined yet? For that matter, even if it &lt;em&gt;has&lt;/em&gt; been defined, is there a recommended way to use the custom setter function when dealing with a list variable?&lt;/p&gt;&#xA;" OwnerUserId="8528" LastEditorUserId="8528" LastEditDate="2017-04-13T01:22:35.673" LastActivityDate="2017-04-17T10:09:01.760" Title="Add to a list that defcustom has not yet defined" Tags="|list|custom|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32105" PostTypeId="1" AcceptedAnswerId="32109" CreationDate="2017-04-12T12:54:01.253" Score="1" ViewCount="218" Body="&lt;p&gt;It is well known that one can narrow a subtree with &lt;kbd&gt;Ctrl-x&lt;/kbd&gt;&lt;kbd&gt;n&lt;/kbd&gt;&lt;kbd&gt;s&lt;/kbd&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to narrow two consecutive trees? How?&lt;/p&gt;&#xA;" OwnerUserId="2441" LastEditorUserId="9995" LastEditDate="2017-04-12T14:42:42.210" LastActivityDate="2017-04-12T16:44:17.270" Title="Narrowing two consecutive trees in org-mode" Tags="|org-mode|narrowing|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32106" PostTypeId="1" AcceptedAnswerId="32111" CreationDate="2017-04-12T13:17:15.613" Score="2" ViewCount="139" Body="&lt;p&gt;I'm playing with the idea of &quot;literate devops&quot; with org-mode. To simplify scripts i've extracted common values into &lt;code&gt;:PROPERTIES:&lt;/code&gt; drawer, which looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* Scripts&#xA;** Subscripts-A&#xA;*** Subscrtips-B&#xA;:PROPERTIES:&#xA;:header-args: :dir ./folder&#xA;:header-args: :results output&#xA;:header-args: :var NAME='Alex'&#xA;:END:&#xA;&#xA;#+BEGIN_SRC zsh&#xA;pwd&#xA;echo &quot;NAME:&quot; $NAME&#xA;#+END_SRC&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The snippet above produces the following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#+RESULTS:&#xA;: /Users/4lex1v/folder&#xA;: NAME:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So ':var' arguments are ignored, while &lt;code&gt;:dir&lt;/code&gt; and &lt;code&gt;:results&lt;/code&gt; are fine, am i doing something wrong?&lt;/p&gt;&#xA;" OwnerUserId="2361" LastActivityDate="2017-04-12T16:48:24.117" Title="The correct way to declare common vars in babel" Tags="|org-mode|org-babel|literate-programming|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32107" PostTypeId="2" ParentId="32070" CreationDate="2017-04-12T13:43:50.073" Score="1" Body="&lt;p&gt;It turns out that atom(ic) windows are indeed exactly what I want.  Consider this code ...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; Instead of split-window, do this ...&#xA;(let ((subwin (display-buffer-in-atom-window&#xA;               (current-buffer)&#xA;               `((window . ,(get-buffer-window (current-buffer)))&#xA;                 (side . below)))))&#xA;  (with-selected-window subwin&#xA;    ;; do whatever you want with subwin&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the original window is deleted via a generic call to  &lt;code&gt;(delete-window)&lt;/code&gt;, the subwindow also gets deleted.&lt;/p&gt;&#xA;" OwnerUserId="10529" LastEditorUserId="10529" LastEditDate="2017-04-12T17:57:27.033" LastActivityDate="2017-04-12T17:57:27.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32109" PostTypeId="2" ParentId="32105" CreationDate="2017-04-12T14:59:38.797" Score="6" Body="&lt;p&gt;If you have org speed commands setup, you can put your cursor at the beginning of a headline, press C-spc to start a mark, then press n to select subsequent headlines, and then C-x nn to narrow to the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do the same without speed commands, just use &lt;code&gt;C-c C-n&lt;/code&gt; or &lt;code&gt;C-c C-f&lt;/code&gt; to move to the next headline after setting mark. You can also give these commands a prefix argument, e.g. &lt;code&gt;C-4 C-c C-n&lt;/code&gt; if you wanted to mark the next 4 headlines.&lt;/p&gt;&#xA;" OwnerUserId="9134" LastEditorUserId="780" LastEditDate="2017-04-12T16:44:17.270" LastActivityDate="2017-04-12T16:44:17.270" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32111" PostTypeId="2" ParentId="32106" CreationDate="2017-04-12T16:48:24.117" Score="5" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;If you want to add to the value of an existing property, append a ‘+’ to the property name.&lt;/p&gt;&#xA;&lt;p&gt;(info &amp;quot;(org) Property syntax&amp;quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;That means your property drawer should be&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;:PROPERTIES:&#xA;:header-args: :dir ./folder&#xA;:header-args+: :results output&#xA;:header-args+: :var NAME='Alex'&#xA;:END:&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5385" LastEditorUserId="-1" LastEditDate="2020-06-17T08:27:49.140" LastActivityDate="2017-04-12T16:48:24.117" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32113" PostTypeId="2" ParentId="32086" CreationDate="2017-04-12T18:44:48.480" Score="1" Body="&lt;p&gt;Using &lt;code&gt;setf&lt;/code&gt; instead of a &lt;code&gt;let&lt;/code&gt; binding to set the value of &lt;code&gt;print-level&lt;/code&gt; and &lt;code&gt;print-depth&lt;/code&gt; worked, though I'm not sure I understand why:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn (setf print-level 2&#xA;            print-length 2)&#xA;          (pp `(deeply (nested (form (very (deeply (nested))))))))&#xA;(deeply&#xA; (nested ...))&#xA;&#xA;&quot;(deeply\n (nested ...))\n&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting to &lt;code&gt;nil&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(progn (setf print-level nil&#xA;            print-length nil)&#xA;          (pp `(deeply (nested (form (very (deeply (nested))))))))&#xA;(deeply&#xA; (nested&#xA;  (form&#xA;   (very&#xA;    (deeply&#xA;     (nested))))))&#xA;&#xA;&quot;(deeply\n (nested\n  (form\n   (very\n    (deeply\n     (nested))))))\n&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2846" LastActivityDate="2017-04-12T18:44:48.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32114" PostTypeId="2" ParentId="31616" CreationDate="2017-04-12T19:52:27.503" Score="1" Body="  &lt;pre class=&quot;lang-lisp prettyprint-override&quot;&gt;&lt;code&gt;(require 'help-fns)&#xA;&#xA;(defun require--tracing-function (orig-fun &amp;amp;rest args)&#xA;&quot;When testing with `emacs -q`, start by requiring `help-fns.el`.&quot;&#xA;  (message &quot;`require' called with args %S&quot; args)&#xA;  (with-current-buffer (get-buffer-create &quot;*TRACE*&quot;)&#xA;    (let* ((standard-output (current-buffer))&#xA;           (print-escape-newlines t)&#xA;           (print-level 8)&#xA;           (print-length 50)&#xA;           beg end)&#xA;        (goto-char (point-max))&#xA;        (setq beg (point))&#xA;        (setq truncate-lines t)&#xA;        (set-buffer-multibyte t)&#xA;        (setq buffer-undo-list t)&#xA;        (backtrace)&#xA;        (insert &quot;===============================\n&quot;)&#xA;        (setq end (point))&#xA;        (narrow-to-region beg end)&#xA;        (let ((regex&#xA;                (concat&#xA;                  &quot;^\s+byte-code\(&quot;&#xA;                  &quot;\\(\\(?:.\\)*?\\)&quot;&#xA;                  &quot;\s&quot;&#xA;                  &quot;\\[\\(.*\\)\\]&quot;&#xA;                  &quot;\s&quot;&#xA;                  &quot;\\([0-9]+\\)&quot;&#xA;                  &quot;\)&quot;))&#xA;              (bytestr (propertize &quot;BYTESTR&quot; 'face '(:foreground &quot;RoyalBlue&quot;)))&#xA;              (maxdepth (propertize &quot;MAXDEPTH&quot; 'face '(:foreground &quot;RoyalBlue&quot;))))&#xA;          (goto-char (point-max))&#xA;          (while (re-search-backward regex nil t)&#xA;            (when (match-string 1)&#xA;              (replace-match bytestr nil nil nil 1))&#xA;            (when (match-string 2)&#xA;              (let ((constants&#xA;                     (propertize (match-string 2) 'face '(:foreground &quot;purple&quot;))))&#xA;                (replace-match constants nil 'literal nil 2)))&#xA;            (when (match-string 3)&#xA;              (replace-match maxdepth nil nil nil 3))))&#xA;        ;;; See the Emacs Lisp manual:  Byte-Code Function Objects&#xA;        (let ((regex&#xA;                (concat&#xA;                   &quot;#\\[&quot;&#xA;                   ;;; argdesc&#xA;                   &quot;\\([0-9]+\\)&quot;&#xA;                   ;;; byte-code&#xA;                   &quot;\\(?:\s\\(.*?\\)\\)?&quot;&#xA;                   &quot;\s&quot;&#xA;                   ;;; constants&#xA;                   &quot;\\[\\(.*\\)\\]&quot;&#xA;                   &quot;\s&quot;&#xA;                   ;;; stacksize&#xA;                   &quot;\\([0-9]+\\)&quot;&#xA;                   ;;; docstring&#xA;                   &quot;\\(?:\s\\(.*?\\)\\)?&quot;&#xA;                   ;;; interactive&#xA;                   &quot;\\(?:\s\\(.*?\\)\\)?&quot;&#xA;                   &quot;\\]&quot;))&#xA;              (argdesc&#xA;                (propertize &quot;ARGDESC&quot; 'face '(:foreground &quot;orange&quot;)))&#xA;              (byte-code&#xA;                (propertize &quot;BYTE-CODE&quot; 'face '(:foreground &quot;orange&quot;)))&#xA;              (stacksize&#xA;                (propertize &quot;STACKSIZE&quot; 'face '(:foreground &quot;orange&quot;)))&#xA;              (docstring&#xA;                (propertize &quot;DOCSTRING&quot; 'face '(:foreground &quot;orange&quot;)))&#xA;              (interactive&#xA;                (propertize &quot;INTERACTIVE&quot; 'face '(:foreground &quot;orange&quot;))))&#xA;          (goto-char (point-max))&#xA;          (while (re-search-backward regex nil t)&#xA;            (when (match-string 1)&#xA;              (replace-match argdesc nil nil nil 1))&#xA;            (when (match-string 2)&#xA;              (replace-match byte-code nil nil nil 2))&#xA;            (when (match-string 3)&#xA;              (let ((constants&#xA;                      (propertize&#xA;                        (match-string 3) 'face '(:foreground &quot;ForestGreen&quot;))))&#xA;                (replace-match constants nil 'literal nil 3)))&#xA;            (when (match-string 4)&#xA;              (replace-match stacksize nil nil nil 4))&#xA;            (when (match-string 5)&#xA;              (replace-match docstring nil nil nil 5))&#xA;            (when (match-string 6)&#xA;              (replace-match interactive nil nil nil 6))))&#xA;        (let ((regex&#xA;                (concat&#xA;                  &quot;^\s+\(let\\*\s\(\(standard-output.*\(current-buffer\)\)\)$&quot;&#xA;                  &quot;\\|&quot;&#xA;                  &quot;^\s+\(let\s\(\(res\s.*res\)\sres\)$&quot;&#xA;                  &quot;\\|&quot;&#xA;                  (concat &quot;^\s+\(save-current-buffer\s\(set-buffer.*&quot;&#xA;                          &quot;\(current-buffer\)\)\)\)$&quot;)&#xA;                  &quot;\\|&quot;&#xA;                  &quot;^\s+backtrace\(\)$&quot;&#xA;                  &quot;\\|&quot;&#xA;                  &quot;^\s+apply\(require--tracing-function .*\)$&quot;&#xA;                  &quot;\\|&quot;&#xA;                  &quot;^\s+require--tracing-function\(.*\)$&quot;)))&#xA;          (goto-char (point-max))&#xA;          (while (re-search-backward regex nil t)&#xA;            (delete-region (match-beginning 0) (1+ (match-end 0)))))&#xA;        (goto-char (point-min))&#xA;        ;;; A slight variation of the built-in `debugger-make-xrefs'.&#xA;        (while (progn&#xA;           (goto-char (+ (point) 2))&#xA;           (skip-syntax-forward &quot;^w_&quot;)&#xA;           (not (eobp)))&#xA;          (let* ((beg (point))&#xA;                 (end (progn (skip-syntax-forward &quot;w_&quot;) (point)))&#xA;                 (fn (function-called-at-point))&#xA;                 (sym (intern-soft (buffer-substring-no-properties beg end)))&#xA;                 (file&#xA;                   (if fn&#xA;                     (let* (&#xA;                          (function fn)&#xA;                          (advised (and (symbolp function)&#xA;                              (featurep 'nadvice)&#xA;                              (advice--p (advice--symbol-function function))))&#xA;                          ;; If the function is advised, use the symbol that has the&#xA;                          ;; real definition, if that symbol is already set up.&#xA;                          (real-function&#xA;                            (or (and advised&#xA;                                     (advice--cd*r&#xA;                                       (advice--symbol-function function)))&#xA;                               function))&#xA;                          ;; Get the real definition.&#xA;                         (def (if (symbolp real-function)&#xA;                                 (or (symbol-function real-function)&#xA;                                     (signal 'void-function (list real-function)))&#xA;                                 real-function))&#xA;                         (aliased (or (symbolp def)&#xA;                               ;; Advised &amp;amp; aliased function.&#xA;                               (and advised (symbolp real-function)&#xA;                              (not (eq 'autoload (car-safe def))))))&#xA;                         (file-name&#xA;                           (find-lisp-object-file-name&#xA;                             function (if aliased 'defun def))))&#xA;                      file-name)&#xA;                  (and sym (symbol-file sym 'defun)))))&#xA;            (when file&#xA;              (goto-char beg)&#xA;              ;; help-xref-button needs to operate on something matched&#xA;              ;; by a regexp, so set that up for it.&#xA;              (re-search-forward &quot;\\(\\sw\\|\\s_\\)+&quot;)&#xA;              (help-xref-button 0 'help-function-def sym file)))&#xA;          (forward-line 1))&#xA;        (widen)&#xA;      (display-buffer (current-buffer))))&#xA;  (let ((res (apply orig-fun args)))&#xA;    (message &quot;`require' returned %S&quot; res)&#xA;    res))&#xA;&#xA;(advice-add 'require :around #'require--tracing-function)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Highlighting C source code functions in the debugging buffer was addressed in the answer to &lt;em&gt;&quot;Debugging — debugger-mode — how to highlight the culprit&quot;&lt;/em&gt;:  &lt;a href=&quot;https://emacs.stackexchange.com/a/29879/2287&quot;&gt;https://emacs.stackexchange.com/a/29879/2287&lt;/a&gt;  It entails a slight variation of the built-in &lt;code&gt;debugger-make-xrefs&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have submitted a feature request regarding tracing autoloaded functions and here is the tracking link:  &lt;a href=&quot;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26470&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26470&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2287" LastEditorUserId="2287" LastEditDate="2017-04-13T19:45:54.077" LastActivityDate="2017-04-13T19:45:54.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32115" PostTypeId="2" ParentId="32067" CreationDate="2017-04-12T19:53:56.503" Score="1" Body="&lt;p&gt;I have that in my configuration : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq select-enable-primary nil)&#xA;(setq select-enable-clipboard t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on my side it works for gnome-shell (I didn't try with unity)&lt;/p&gt;&#xA;" OwnerUserId="13189" LastEditorUserId="13189" LastEditDate="2017-04-21T15:40:55.283" LastActivityDate="2017-04-21T15:40:55.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32116" PostTypeId="1" AcceptedAnswerId="32121" CreationDate="2017-04-12T20:18:31.707" Score="0" ViewCount="1346" Body="&lt;p&gt;I am using flycheck with its defaults to write modern C++ code.  I frequently get warnings such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;extended initializer lists only available with -std=c++11 or -std=gnu++11&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when using modern features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody tell me the best way to disable the warnings related to c++11 or c++14?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2017-04-13T00:28:07.563" Title="Flycheck: How to disable c++11 Warnings?" Tags="|flycheck|c++|" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32117" PostTypeId="2" ParentId="32067" CreationDate="2017-04-12T21:04:28.757" Score="0" Body="&lt;p&gt;This should use the system clipboard:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun copy-from-ubuntu (text &amp;amp;optional push)&#xA;  (interactive)&#xA;  (if (display-graphic-p)&#xA;      (progn&#xA;        (message &quot;Yanked region to x-clipboard!&quot;)&#xA;        (call-interactively 'clipboard-kill-ring-save)&#xA;        )&#xA;    (if (region-active-p)&#xA;        (progn&#xA;          (shell-command-on-region (region-beginning) (region-end) &quot;xsel -i -b&quot;)&#xA;          (message &quot;Yanked region to clipboard!&quot;)&#xA;          (deactivate-mark))&#xA;      (message &quot;No region active; can't yank to clipboard!&quot;)))&#xA;    )&#xA;&#xA;(defun paste-to-ubuntu ()&#xA;  (interactive)&#xA;  (if (display-graphic-p)&#xA;      (progn&#xA;        (clipboard-yank)&#xA;        (message &quot;graphics active&quot;)&#xA;        )&#xA;    (insert (shell-command-to-string &quot;xsel -o -b&quot;))&#xA;    )&#xA;  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then finally add:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq interprogram-cut-function 'copy-from-ubuntu)&#xA;(setq interprogram-paste-function 'paste-to-ubuntu)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will also need to install &lt;code&gt;xsel&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ sudo apt-get install xsel&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2121" LastActivityDate="2017-04-12T21:04:28.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32118" PostTypeId="2" ParentId="13163" CreationDate="2017-04-12T21:34:58.700" Score="1" Body="&lt;p&gt;Just wanted to post an updated version for the answer. You can find all the necessary info about Boot CIDER repl setup here &lt;a href=&quot;https://github.com/boot-clj/boot/wiki/Cider-REPL&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/boot-clj/boot/wiki/Cider-REPL&lt;/a&gt; . It provides multiple ways to set it up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An important thing to note is boot parameters setup. To make Cider behave as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(setq cider-boot-parameters &quot;repl -s wait&quot;)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also each project in boot tends to have &lt;code&gt;build.boot&lt;/code&gt; file, that serve similar purpose as &lt;code&gt;project.clj&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to transition is to read &lt;a href=&quot;https://github.com/boot-clj/boot/wiki/Boot-for-Leiningen-Users&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/boot-clj/boot/wiki/Boot-for-Leiningen-Users&lt;/a&gt; , &lt;a href=&quot;https://juxt.pro/blog/posts/boot-parity.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://juxt.pro/blog/posts/boot-parity.html&lt;/a&gt; and try to build a small toy application.&lt;/p&gt;&#xA;" OwnerUserId="15522" LastActivityDate="2017-04-12T21:34:58.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32119" PostTypeId="1" AcceptedAnswerId="32142" CreationDate="2017-04-12T23:01:57.757" Score="1" ViewCount="251" Body="&lt;p&gt;In org-mode (note I am running Windows), when creating a link using C-c C-l, using the following path loads my email software when clicking on the resulting link:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:c:/Program Files/The Bat!/thebat32.exe&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far, so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when adding an argument to the executable emacs complains the file does not exist, for example clicking on the resulting link for&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;file:c:/Program Files/The Bat!/thebat32.exe argument1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yields an error message &quot;No such file&quot;. It appears emacs/orgmode is checking if the file exists using an absolute path including the argument, hence not finding it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to properly pass arguments to simple file calls? Or would one need to create a new hyperlink type as described in &lt;a href=&quot;http://orgmode.org/manual/Adding-hyperlink-types.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/manual/Adding-hyperlink-types.html&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="15523" LastActivityDate="2017-04-13T18:32:38.920" Title="How can I pass arguments to absolute links using 'file:' in orgmode" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32120" PostTypeId="1" CreationDate="2017-04-12T23:44:09.587" Score="3" ViewCount="830" Body="&lt;p&gt;I'm trying get Spacemacs (i.e., Emacs) to use the Windows subsystem for Linux bash shell as the shell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added &lt;code&gt;(setq explicit-shell-file-name &quot;c:/Windows/System32/bash.exe&quot;)&lt;/code&gt; to my .spacemacs configuration file, but when I enter:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;SPC SPC ansi-term&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and answer yes, it returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Spawning child process: invalid argument&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get Emacs to run bash (i.e., the Windows subsystem for Linux) as the shell? &lt;/p&gt;&#xA;" OwnerUserId="15516" LastActivityDate="2017-04-12T23:44:09.587" Title="Using Windows bash as the shell" Tags="|spacemacs|bash|" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32121" PostTypeId="2" ParentId="32116" CreationDate="2017-04-13T00:28:07.563" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/a/30964293/864684&quot;&gt;From @lunaryorn&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Flycheck provides the option &lt;code&gt;flycheck-gcc-language-standard&lt;/code&gt; for this purpose. You should not set it globally, because that will break checking of C files, but you can set it from &lt;code&gt;c++-mode-hook&lt;/code&gt; with the following code in your init file:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(add-hook 'c++-mode-hook (lambda () (setq flycheck-gcc-language-standard &quot;c++11&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, I would recommend against this. Instead, use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Directory Variables&lt;/a&gt; to configure the language standard per project.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="10269" LastEditorUserId="-1" LastEditDate="2017-05-23T12:38:55.940" LastActivityDate="2017-04-13T00:28:07.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32123" PostTypeId="1" AcceptedAnswerId="32133" CreationDate="2017-04-13T01:14:17.353" Score="1" ViewCount="703" Body="&lt;p&gt;I'd like to be able to exit view mode by pressing &quot;q&quot;. However, in evil &quot;q&quot; is bound to &lt;code&gt;evil-record-macro&lt;/code&gt;, even in view mode. I wasn't able to find a solution using &lt;code&gt;evil-define-key&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was excited to find a &lt;a href=&quot;https://emacs.stackexchange.com/questions/10726/how-can-i-disable-q-in-normal-state-in-evil-for-some-modes&quot;&gt;similar question here&lt;/a&gt;, which proposes using &lt;code&gt;eval-after-load&lt;/code&gt;, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun testing ()&#xA;  (interactive)&#xA;  (message &quot;Testing...&quot;))&#xA;&#xA;(eval-after-load &quot;view&quot; '(evil-define-key 'normal view-mode-map &quot;q&quot; #'testing))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This produces some strange behavior. When I enter view mode, &lt;code&gt;C-h k q&lt;/code&gt; reports the following: &quot;q runs the command evil-record-macro (found in evil-normal-state-map)... It is bound to q.&quot;. But, I discovered that if I do press &quot;q&quot;, record a macro, and press &quot;q&quot; again to exit the recording, I see the &quot;Testing...&quot; message. Following this, pressing &quot;q&quot; continues to produce the message, and I no longer enter macro recording. &quot;C-h k q&quot; reports: &lt;code&gt;q runs the command testing... It is bound to q, &amp;lt;normal-state&amp;gt; q.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone propose a solution or workaround? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="15411" LastActivityDate="2017-04-13T06:31:39.397" Title="(Evil) Binding &quot;q&quot; to &quot;View-quit&quot; in view mode (instead of &quot;evil-record-macro&quot;)" Tags="|key-bindings|evil|keymap|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32124" PostTypeId="1" CreationDate="2017-04-13T01:17:27.883" Score="0" ViewCount="135" Body="&lt;p&gt;I am following the directions laid out in &lt;a href=&quot;https://emacs.stackexchange.com/questions/52/edit-file-with-super-user-rights&quot;&gt;this answer&lt;/a&gt; to edit my &lt;code&gt;sshd_config&lt;/code&gt; file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I try to save I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;byte-code: Wrong type argument: listp, 126&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know why this would be and how I could fix it? (this prevents me from saving my file)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to the comments I was able to narrow down the issue to the following lines in my init file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq tramp-default-method &quot;ssh&quot;)  &#xA;(setq tramp-auto-save-directory auto-save-location)  &#xA;(setq tramp-backup-directory-alist auto-save-location) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Commenting them out fixed my issue&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="7047" LastEditDate="2017-04-13T19:40:17.890" LastActivityDate="2017-04-13T19:40:17.890" Title="Error when trying to save a file as root using Tramp and sudo" Tags="|tramp|sudo|bytecode|" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="32126" PostTypeId="1" AcceptedAnswerId="32127" CreationDate="2017-04-13T03:26:50.263" Score="0" ViewCount="316" Body="&lt;p&gt;If I'm using &lt;code&gt;use-package&lt;/code&gt; in a file that I plan to byte-compile, can I still leverage Emacs' &lt;code&gt;byte-compile-dynamic&lt;/code&gt; setting to lazy-load compiled function definitions? From the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Dynamic-Loading.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Elisp manual&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With dynamic function loading, loading the file doesn’t fully read the function definitions in the file.  Instead, each function definition contains a place-holder which refers to the file.  The first time each function is called, it reads the full definition from the file, to replace the place-holder.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, for example, if my init.el loads a file,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(require 'my-persistence (concat user-emacs-directory &quot;my-persistence&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in which I've put persistence-related settings,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package savehist&#xA;  :commands savehist-mode&#xA;  :config&#xA;  (setq savehist-autosave-interval 60)&#xA;  (defun foo () ...)&#xA;  (defun bar () ...)&#xA;  (defun baz () ...))&#xA;&#xA;(provide 'my-persistence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I could add &lt;code&gt;-*-byte-compile-dynamic: t;-*-&lt;/code&gt; to the top of that file, in hopes that lazy-loading the compiled function definitions of &lt;code&gt;foo&lt;/code&gt;, &lt;code&gt;bar&lt;/code&gt;, and &lt;code&gt;baz&lt;/code&gt; reduces the time spent evaluating the &lt;code&gt;:config&lt;/code&gt; section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine it playing out like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;my-persistence.elc is loaded&lt;/li&gt;&#xA;&lt;li&gt;user calls &lt;code&gt;savehist-mode&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;savehist&lt;/code&gt; package is loaded&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;:config&lt;/code&gt; section is evaluated&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;savehist-autosave-interval&lt;/code&gt; is set to 60&lt;/li&gt;&#xA;&lt;li&gt;lazy-loading defers the full definitions of &lt;code&gt;foo&lt;/code&gt;, &lt;code&gt;bar&lt;/code&gt;, and &lt;code&gt;baz&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;user calls &lt;code&gt;foo&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;foo&lt;/code&gt;'s full definition is loaded&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tried it out, and &lt;code&gt;:config&lt;/code&gt; still behaves as expected, but I don't know how to check whether &lt;code&gt;foo&lt;/code&gt;, &lt;code&gt;bar&lt;/code&gt; and &lt;code&gt;baz&lt;/code&gt; are in fact being lazy-loaded.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-05-13T04:24:53.467" Title="is byte-compile-dynamic compatible with use-package?" Tags="|use-package|byte-compilation|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32127" PostTypeId="2" ParentId="32126" CreationDate="2017-04-13T03:53:23.730" Score="1" Body="&lt;p&gt;It looks like functions defined in the &lt;code&gt;:config&lt;/code&gt; section will not participate in &lt;code&gt;byte-compile-dynamic&lt;/code&gt; lazy-loading. I tested this by modifying the above example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*-byte-compile-dynamic: t;-*-&#xA;&#xA;(defun foo () 5)&#xA;&#xA;(use-package savehist&#xA;  :commands savehist-mode&#xA;  :config&#xA;  (defun bar () 5))&#xA;&#xA;(provide 'my-persistence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After &lt;code&gt;savehist&lt;/code&gt; has been loaded, calling &lt;code&gt;(symbol-function 'foo)&lt;/code&gt; returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#[nil&#xA;  (&quot;/Users/ivan/.emacs.d/my-persistence.elc&quot; . 473)&#xA;  nil 1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calling &lt;code&gt;(symbol-function 'bar)&lt;/code&gt; returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#[nil &quot;\300\207&quot;&#xA;      [5]&#xA;      1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that &lt;code&gt;foo&lt;/code&gt; currently holds a reference to the file where the full definition can be found, whereas &lt;code&gt;bar&lt;/code&gt; holds the actual byte-compiled instructions and the &lt;code&gt;5&lt;/code&gt; constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, after calling &lt;code&gt;(foo)&lt;/code&gt;, a subsequent &lt;code&gt;(symbol-function 'foo)&lt;/code&gt; shows that the full definition has now been loaded:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#[nil &quot;\300\207&quot;&#xA;      [5]&#xA;      1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What &lt;em&gt;did&lt;/em&gt; work, however, was puting the function I want lazy-loaded into a separate file and requiring it from the &lt;code&gt;:config&lt;/code&gt; section:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package savehist&#xA;  :commands savehist-mode&#xA;  :config&#xA;  (require 'my-foo))&#xA;&#xA;(provide 'my-persistence)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And in my-foo.elc&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-*-byte-compile-dynamic: t;-*-&#xA;&#xA;(defun bar () 5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't know how practical that is, though I guess it might be depending how many functions you're defining (and how many you won't be needing right away). I also don't know how this approach stacks up against autoloads, but it was interesting to try, anyway.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2017-04-13T03:53:23.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32129" PostTypeId="2" ParentId="32100" CreationDate="2017-04-13T05:05:44.020" Score="4" Body="&lt;p&gt;One can get how many pixels tall a face is with &lt;code&gt;window-font-height&lt;/code&gt;, and how many pixels tall a window is with &lt;code&gt;window-body-height&lt;/code&gt;. From there it's a simple division with truncating.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun zck--lines-in-window (face &amp;amp;optional window)&#xA;  &quot;Calculate how many lines of text with face FACE can fit in WINDOW.&quot;&#xA;  (truncate (window-body-height window t)&#xA;            (window-font-height window face)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="97" LastActivityDate="2017-04-13T05:05:44.020" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32130" PostTypeId="2" ParentId="32056" CreationDate="2017-04-13T05:53:51.033" Score="0" Body="&lt;p&gt;Keyword &lt;code&gt;:map&lt;/code&gt; needs to be inside parenthesis. You can have multiple :bind keywords, so it is clearer to separate keys bound to separate modes. This should work:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package gnus&#xA;  :bind ((&quot;&amp;lt;f12&amp;gt;&quot; . gnus))&#xA;  :bind (:map gnus-group-mode-map&#xA;              (&quot;q&quot; . gnus-group-suspend)&#xA;              (&quot;Q&quot; . gnus-group-exit))&#xA;  :config ........)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I did not tried this code but it is based on my functioning elfeed config.&lt;/p&gt;&#xA;" OwnerUserId="903" LastEditorUserId="903" LastEditDate="2017-04-13T06:01:59.033" LastActivityDate="2017-04-13T06:01:59.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32132" PostTypeId="2" ParentId="24574" CreationDate="2017-04-13T06:08:37.953" Score="4" Body="&lt;p&gt;The package &lt;code&gt;org-autolist&lt;/code&gt; that does this has been available from MELPA for almost two years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://github.com/calvinwyoung/org-autolist&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/calvinwyoung/org-autolist&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="903" LastActivityDate="2017-04-13T06:08:37.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32133" PostTypeId="2" ParentId="32123" CreationDate="2017-04-13T06:31:39.397" Score="4" Body="&lt;p&gt;Interestingly enough, Evil &lt;em&gt;does&lt;/em&gt; define an initial state for &lt;code&gt;view-mode&lt;/code&gt;, but it won't do anything because &lt;code&gt;view-mode&lt;/code&gt; is a minor mode and initial states are for major modes only.  The correct way to change the associated state is by using a hook:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'view-mode-hook 'evil-motion-state)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That way, &lt;code&gt;q&lt;/code&gt; does the right thing, simply because it is not bound in &lt;code&gt;evil-motion-state-map&lt;/code&gt; and Emacs looks up the mode-specific key instead.  You can alternatively enter Emacs state by adding &lt;code&gt;evil-emacs-state&lt;/code&gt; to the hook, like I do for more vanilla behavior.&lt;/p&gt;&#xA;" OwnerUserId="10" LastActivityDate="2017-04-13T06:31:39.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32134" PostTypeId="1" CreationDate="2017-04-13T07:58:20.980" Score="1" ViewCount="133" Body="&lt;p&gt;The default mode is fundamental, which is not really comfortable to edit elisp code did I miss something ?&lt;/p&gt;&#xA;" OwnerUserId="14046" LastEditorUserId="105" LastEditDate="2017-04-13T17:18:00.197" LastActivityDate="2017-04-18T08:50:45.933" Title="Is it possible to enable `emacs-lisp-mode` when org-table-edit-formulas?" Tags="|org-mode|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32135" PostTypeId="2" ParentId="32104" CreationDate="2017-04-13T08:19:49.543" Score="3" Body="&lt;p&gt;It's important to distinguish between customization code (part of your init file) and package code (part of a package).  In customization code one appends something to a list with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-to-list 'savehist-additional-variables 'evil-ex-history)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas in package code you use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; creates duplicates&#xA;(push 'evil-ex-history savehist-additional-variables)&#xA;;; avoids duplicates&#xA;(cl-pushnew 'evil-ex-history savehist-additional-variables)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, how do these interact and why does the manual state it's safe in customization code to just set the variable?  In this case, it's because &lt;code&gt;savehist-additional-variables&lt;/code&gt; is an empty list!  If the variable was defined at the time &lt;code&gt;add-to-list&lt;/code&gt; is used (like, if one used &lt;code&gt;(require 'savehist)&lt;/code&gt; before), it appends to it, otherwise it defines the variable and when &lt;code&gt;savehist.el&lt;/code&gt; is loaded, the &lt;code&gt;defcustom&lt;/code&gt; form (or rather &lt;code&gt;defvar&lt;/code&gt;, which it expands to) keeps that value and marks the variable as special.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strategy will work out fine with simple values, like strings, numbers and &lt;code&gt;nil&lt;/code&gt; (which doubles as the empty list), non-empty lists (and other composite data structures) are a bit tricky though.  Assuming &lt;code&gt;savehist-additional-variables&lt;/code&gt; were initialized to &lt;code&gt;(foo bar baz)&lt;/code&gt;, you'd end up with &lt;code&gt;(evil-ex-history foo bar baz)&lt;/code&gt; if it's loaded up before customization or &lt;code&gt;(evil-ex-history)&lt;/code&gt; if done afterwards.  For this reason, composite values shouldn't be put as default value into customizables.  A possible solution is to add the initial values immediately after definition of the variable.  That way both package-provided values and user-provided values will be in the list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;;; package code&#xA;(defvar save-hist-additional-variables nil ...)&#xA;(push 'foo save-hist-additional-variables)&#xA;(push 'bar save-hist-additional-variables)&#xA;(push 'baz save-hist-additional-variables)&#xA;&#xA;;; user code&#xA;(add-to-list 'save-hist-additional-variables 'evil-ex-history)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Same trick works with non-empty hooks, just replace &lt;code&gt;push&lt;/code&gt; with &lt;code&gt;add-hook&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative version of this technique can be used for variables not intended for customization.  Just write a function that's concerned with initializing variables and call it later.&lt;/p&gt;&#xA;" OwnerUserId="10" LastEditorUserId="10" LastEditDate="2017-04-17T10:09:01.760" LastActivityDate="2017-04-17T10:09:01.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32137" PostTypeId="1" AcceptedAnswerId="32139" CreationDate="2017-04-13T12:12:14.403" Score="1" ViewCount="80" Body="&lt;p&gt;I normally use emacs (on Linux) running in windowing mode. I have bound a number of functions to special keypresses such as &lt;code&gt;&amp;lt;C-return&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;kp-add&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ocasionally, I'm forced to run emacs in a text console, where some of the keypresses cannot be detected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can tell a console-based emacs, &quot;Pretend I just pressed &lt;code&gt;&amp;lt;kp-add&amp;gt;&lt;/code&gt;&quot;?&lt;/p&gt;&#xA;" OwnerUserId="15530" LastActivityDate="2017-04-13T13:17:07.920" Title="Injecting keystrokes on console" Tags="|key-bindings|keystrokes|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32138" PostTypeId="2" ParentId="32134" CreationDate="2017-04-13T13:00:17.563" Score="1" Body="&lt;p&gt;A first idea is to to use an &lt;em&gt;after&lt;/em&gt; &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Named-Functions.html#Advising-Named-Functions&quot; rel=&quot;nofollow noreferrer&quot;&gt;advice&lt;/a&gt; to ensure&#xA;&lt;code&gt;emacs-lisp-mode&lt;/code&gt; is turned on after &lt;code&gt;org-table-edit-formulas&lt;/code&gt; is run.&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt; (advice-add #'org-table-edit-formulas :after #'emacs-lisp-mode)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this does not work well.  Examining the source of the&#xA;function (in file &lt;code&gt;org-table.el&lt;/code&gt;) shows that it turns&#xA;&lt;code&gt;fundamental-mode&lt;/code&gt; on then sets up a few things (variables and&#xA;keybindings) that the call to &lt;code&gt;emacs-lisp-mode&lt;/code&gt; will undo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to call &lt;code&gt;emacs-lisp-mode&lt;/code&gt; just after (or ideally, instead of)&#xA;the call to &lt;code&gt;fundamental mode&lt;/code&gt; in &lt;code&gt;org-table-edit-formulas&lt;/code&gt;.  Here's&#xA;how to do it:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-el prettyprint-override&quot;&gt;&lt;code&gt;(defun my--advice-for-edit-formulas (orig-fun &amp;amp;rest args)&#xA;  (advice-add #'fundamental-mode :after #'emacs-lisp-mode)&#xA;  (apply orig-fun args)&#xA;  (advice-remove #'fundamental-mode #'emacs-lisp-mode))&#xA;&#xA;(advice-add #'org-table-edit-formulas :around #'my--advice-for-edit-formulas)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We set an &lt;em&gt;around advice&lt;/em&gt; to &lt;code&gt;org-table-edit-formulas&lt;/code&gt; whose job is&#xA;to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;add an &lt;em&gt;after advice&lt;/em&gt; to &lt;code&gt;fundamental-mode&lt;/code&gt; to make it run &lt;code&gt;emacs-lisp-mode&lt;/code&gt;,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;call &lt;code&gt;org-table-edit-formulas&lt;/code&gt;,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;remove the advice to &lt;code&gt;fundamental-mode&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This way, &lt;code&gt;fundamental-mode&lt;/code&gt; calls &lt;code&gt;emacs-lisp-mode&lt;/code&gt; only when itself&#xA;called from &lt;code&gt;org-table-edit-formulas&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it's possible it would be better to add an option to choose the&#xA;mode &lt;code&gt;org-table-edit-formulas&lt;/code&gt; will use, or to make it automatically&#xA;select &lt;code&gt;emacs-lisp-mode&lt;/code&gt; when the formulas are in elisp.&lt;/p&gt;&#xA;" OwnerUserId="9995" LastEditorUserId="9995" LastEditDate="2017-04-18T08:50:45.933" LastActivityDate="2017-04-18T08:50:45.933" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32139" PostTypeId="2" ParentId="32137" CreationDate="2017-04-13T13:00:29.390" Score="3" Body="&lt;p&gt;For keys which a terminal can't even send unmodified (which I suspect is the case with &lt;code&gt;&amp;lt;kp-add&amp;gt;&lt;/code&gt;), you will need to bind some key which &lt;em&gt;can&lt;/em&gt; be sent by the terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can bind a key to the keyboard macro &lt;code&gt;[kp-add]&lt;/code&gt; in order that the alternative key sequence does whatever &lt;code&gt;&amp;lt;kp-add&amp;gt;&lt;/code&gt; would have done:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(global-set-key (kbd &quot;C-c p&quot;) (kbd &quot;&amp;lt;kp-add&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could even call a macro without a key binding:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;M-:&lt;/kbd&gt; &lt;code&gt;(execute-kbd-macro (kbd &quot;&amp;lt;kp-add&amp;gt;&quot;))&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could use &lt;code&gt;function-key-map&lt;/code&gt; (or the terminal-local &lt;code&gt;local-function-key-map&lt;/code&gt;) to directly map the key sequences like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(define-key function-key-map (kbd &quot;C-c p&quot;) (kbd &quot;&amp;lt;kp-add&amp;gt;&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in which case Emacs &lt;em&gt;translates&lt;/em&gt; &lt;code&gt;C-c p&lt;/code&gt; to &lt;code&gt;&amp;lt;kp-add&amp;gt;&lt;/code&gt; (as opposed to calling a macro which in turn simulates typing &lt;code&gt;&amp;lt;kp-add&amp;gt;&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, both methods ought to do the job.&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&amp;lt;C-return&amp;gt;&lt;/code&gt; would be similar, but &lt;code&gt;C-RET&lt;/code&gt; can be sent via &lt;code&gt;event-apply-control-modifier&lt;/code&gt; like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;@&lt;/kbd&gt;&lt;kbd&gt;c&lt;/kbd&gt;&lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the terminal can send the unmodified key, you can use this approach to send a modified variant. Type &lt;kbd&gt;C-x&lt;/kbd&gt;&lt;kbd&gt;@&lt;/kbd&gt;&lt;kbd&gt;C-h&lt;/kbd&gt; for the list of supported modifiers.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-04-13T13:17:07.920" LastActivityDate="2017-04-13T13:17:07.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32140" PostTypeId="1" AcceptedAnswerId="32999" CreationDate="2017-04-13T15:10:53.907" Score="4" ViewCount="8398" Body="&lt;p&gt;Working on .py files, I know how to get emacs to use 4 spaces as an indent by default. I also know how to get it to use the tab character by default. I'd like to leave it at using spaces by default, but recognize when tab characters are used and use that instead (for my older python files). I know I can just untabify everything, but this might not be an option when working on someone else's code and they'd like to use tabs instead (for whatever reason).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I created 2 simple files consisting of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = 1&#xA;if a == 1:&#xA;    b = 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In one file, that indent is using 4 spaces while the other file uses a tab character. I can't get Emacs to recognize the difference. I am using Elpy, but I've tried this with Elpy disabled. I've also tried this with a blank init file and having only the modifications to tab. Anyone know the solution to this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been messing around with the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook&#xA;    (lambda ()&#xA;       (setq indent-tabs-mode t)&#xA;       (setq tab-width 4)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting indent-tabs-mode to &lt;code&gt;t&lt;/code&gt; makes it always use a tab character. Setting it to &lt;code&gt;nil&lt;/code&gt; makes it always use spaces. I've also tried the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(add-hook 'python-mode-hook 'guess-style-guess-tabs-mode)&#xA;(add-hook 'python-mode-hook (lambda ()&#xA;                            (guess-style-guess-tab-width)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will only use spaces in Python files... What do?&lt;/p&gt;&#xA;" OwnerUserId="15532" LastEditorUserId="15532" LastEditDate="2017-04-13T15:47:03.060" LastActivityDate="2017-05-22T19:02:52.113" Title="Python mode indentation" Tags="|indentation|python|tabs|" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32142" PostTypeId="2" ParentId="32119" CreationDate="2017-04-13T18:32:38.920" Score="1" Body="&lt;p&gt;I was able to solve this using an elisp: hyperlink rather than the file: hyperlink type. Specifically, my org-mode hyperlink code now reads:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;elisp:(w32-shell-execute &quot;open&quot; &quot;C:\\Program Files\\The Bat!\\thebat32.exe&quot; &quot;ARGUMENTS HERE&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Emacs by default brings up a security warning when evaluating elisp code when clicking a link. I don't mind the security hazards, so I turned off the warnings by setting &quot;Org Confirm Elisp Link Function&quot; to &quot;no confirmation&quot;.&lt;/p&gt;&#xA;" OwnerUserId="15523" LastActivityDate="2017-04-13T18:32:38.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32143" PostTypeId="1" CreationDate="2017-04-13T20:18:12.717" Score="0" ViewCount="1167" Body="&lt;p&gt;my question is very similar to &lt;a href=&quot;https://unix.stackexchange.com/questions/20733/load-my-profile-for-bash-in-emacs-terminal-buffer-multi-term-mode&quot;&gt;this one&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use my &lt;code&gt;.profile&lt;/code&gt; file to set environment variables, such as &lt;code&gt;EDITOR&lt;/code&gt;.  However, when I run &lt;code&gt;ansi-term&lt;/code&gt; and type &lt;code&gt;printenv&lt;/code&gt; I can see that that variable is not defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am already using &lt;code&gt;exec-path-from-shell&lt;/code&gt; but it looks like certain environment variables are not set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently the &lt;code&gt;.profile&lt;/code&gt; file is only supposed to be read on login, but this means that environment variables that I do need to be set are not set for &lt;code&gt;ansi-term&lt;/code&gt; which is my preferred way to use a shell in emacs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply put I am looking for a way to make the environment in &lt;code&gt;ansi-term&lt;/code&gt; identical to the a login shell.  Is there a way to do this?&lt;/p&gt;&#xA;" OwnerUserId="7047" LastEditorUserId="7047" LastEditDate="2017-04-14T06:04:25.540" LastActivityDate="2017-04-14T06:04:25.540" Title="Ansi-Term not reading .profile" Tags="|shell|ansi-term|bash|exec-path|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32144" PostTypeId="1" AcceptedAnswerId="41257" CreationDate="2017-04-13T22:57:39.470" Score="5" ViewCount="559" Body="&lt;p&gt;The function &lt;code&gt;org-move-subtree-down&lt;/code&gt; exhibits an unwanted behavior IMO: when moving the subtree it considers the whitespace above the subtree that will be moved as &quot;part&quot; of it. I think it's better explained visually:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/688Ko.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/688Ko.png&quot; alt=&quot;initial text structure&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we try to move down this subtree, see what happens:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Wba0v.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Wba0v.png&quot; alt=&quot;after trying to move subtree&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we try to move the 3rd subtree up starting from the same initial configuration (figure 1), something strange will happen as well:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RxBkD.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RxBkD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the code of the function, one can see that this behavior has been intentionally programmed. I wonder why, and if I'm the only one who dislikes this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently working on hacking this function to correct this behavior, and will propose changes to developers, but wanted to see if it's not the case that I'm crazy here. Thanks, any thoughts will be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is &lt;a href=&quot;https://raw.githubusercontent.com/arthurcgusmao/random/master/org-move-subtree.org&quot; rel=&quot;noreferrer&quot;&gt;the file I used&lt;/a&gt; for you to try the same commands.&lt;/p&gt;&#xA;" OwnerUserId="13589" LastEditorUserId="13589" LastEditDate="2017-04-14T15:27:40.353" LastActivityDate="2018-08-25T23:00:59.340" Title="Org-mode `org-move-subtree-down` function strange behavior" Tags="|org-mode|" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32146" PostTypeId="2" ParentId="21112" CreationDate="2017-04-14T00:00:48.157" Score="0" Body="&lt;p&gt;I answered this here: &lt;a href=&quot;https://emacs.stackexchange.com/questions/13314/install-pdf-tools-on-emacs-macosx&quot;&gt;Install Pdf-Tools on Emacs MacOSX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll also find this helpful for application/mode/package specific tweaks: &lt;a href=&quot;https://emacs.stackexchange.com/questions/19686/how-to-use-pdf-tools-pdf-view-mode-in-emacs&quot;&gt;How to use pdf-tools (pdf-view-mode) in emacs?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8353" LastActivityDate="2017-04-14T00:00:48.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32147" PostTypeId="2" ParentId="32143" CreationDate="2017-04-14T02:09:43.443" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Apparently the .profile file is only supposed to be read on login&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Correct. Invariably there are other shell resource files which are read on non-login shell invocations, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your shell is &lt;code&gt;bash&lt;/code&gt; then you can use &lt;code&gt;~/.bashrc&lt;/code&gt; for this, and including something like the following in your &lt;code&gt;~/.profile&lt;/code&gt; is then fairly common if you want your non-login settings to be used in your login shells as well:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;# if running bash&#xA;if [ -n &quot;$BASH_VERSION&quot; ]; then&#xA;    # include .bashrc if it exists&#xA;    if [ -f &quot;$HOME/.bashrc&quot; ]; then&#xA;        . &quot;$HOME/.bashrc&quot;&#xA;    fi&#xA;fi&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You should read the &lt;code&gt;INVOCATION&lt;/code&gt; section of the bash man page for full details. In Emacs you can use &lt;kbd&gt;g&lt;/kbd&gt; &lt;code&gt;INVOCATION&lt;/code&gt; in the man page buffer, after &lt;kbd&gt;M-x&lt;/kbd&gt; &lt;code&gt;man&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt; &lt;code&gt;bash&lt;/code&gt; &lt;kbd&gt;RET&lt;/kbd&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course if your shell is something different, you should check &lt;em&gt;its&lt;/em&gt; man page for the relevant details.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-04-14T02:15:12.083" LastActivityDate="2017-04-14T02:15:12.083" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32148" PostTypeId="1" AcceptedAnswerId="32149" CreationDate="2017-04-14T09:06:05.287" Score="3" ViewCount="166" Body="&lt;p&gt;Is there a way to center the vertical scroll position when using emacs client to open a file at a position?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacsclient +$NUM:$COL $FILE --no-wait --alternate-editor=emacs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Is it possible to either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Modify this command so it tells emacs to recenter.&lt;/li&gt;&#xA;&lt;li&gt;Add to a hook that runs &lt;code&gt;(recenter)&lt;/code&gt; after has opened a file from a remote request?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2418" LastEditorUserId="2418" LastEditDate="2017-04-14T09:21:02.307" LastActivityDate="2017-04-14T16:54:30.713" Title="How to vertically center when opening a file:line from emacsclient?" Tags="|emacsclient|scrolling|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32149" PostTypeId="2" ParentId="32148" CreationDate="2017-04-14T16:54:30.713" Score="3" Body="&lt;p&gt;You can always choose the &lt;code&gt;--eval&lt;/code&gt; option of &lt;code&gt;emacsclient&lt;/code&gt; to perform more complicated tasks:&lt;/p&gt;&#xA;&#xA;&lt;pre class=&quot;lang-sh prettyprint-override&quot;&gt;&lt;code&gt;emacsclient --eval &quot;(progn (find-file \&quot;$FILE\&quot;) (goto-line $NUM) (forward-char $COL) (recenter))&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2017-04-14T16:54:30.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32150" PostTypeId="1" AcceptedAnswerId="33523" CreationDate="2017-04-14T16:58:41.807" Score="14" ViewCount="2093" Body="&lt;p&gt;I depend on the &lt;code&gt;*Messages*&lt;/code&gt; buffer a lot, but entries are not timestamped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one add a timestamp to each entry in Emacs' &lt;em&gt;Messages&lt;/em&gt; buffer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loading /Users/gsl/lisp.d/init.el (source)...&#xA;No outline structure detected&#xA;For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;Loading /Users/gsl/lisp.d/var/recentf...done&#xA;Error running timer: (wrong-number-of-arguments (lambda nil (setq gc-cons-threshold (* 64 1024 1024)) (message &quot;WARNING: gc-cons-threshold restored to %S&quot;)) 1)&#xA;[yas] Prepared just-in-time loading of snippets successfully.&#xA;M-] is undefined&#xA;CHILDREN [2 times]&#xA;‘show-all’ is an obsolete command (as of 25.1); use ‘outline-show-all’ instead.&#xA;Invalid face reference: nil [33 times]&#xA;Auto-saving...done&#xA;Saving file /Users/gsl/lisp.d/init.el...&#xA;Wrote /Users/gsl/lisp.d/init.el&#xA;mwheel-scroll: Beginning of buffer [5 times]&#xA;Mark set&#xA;previous-line: Beginning of buffer [10 times]&#xA;Quit [4 times]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will become something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2017-02-14-18:50:01 Loading /Users/gsl/lisp.d/init.el (source)...&#xA;2017-02-14-18:50:02 No outline structure detected&#xA;2017-02-14-18:50:03 For information about GNU Emacs and the GNU system, type C-h C-a.&#xA;2017-02-14-18:50:05 Loading /Users/gsl/lisp.d/var/recentf...done&#xA;2017-02-14-18:50:10 Error running timer: (wrong-number-of-arguments (lambda nil (setq gc-cons-threshold (* 64 1024 1024)) (message &quot;WARNING: gc-cons-threshold restored     to %S&quot;)) 1)&#xA;2017-02-14-18:50:12 [yas] Prepared just-in-time loading of snippets successfully.&#xA;2017-02-14-18:50:40 M-] is undefined&#xA;2017-02-14-18:50:41 CHILDREN [2 times]&#xA;2017-02-14-18:50:00 ‘show-all’ is an obsolete command (as of 25.1); use ‘outline-show-all’ instead.&#xA;2017-02-14-18:50:01 Invalid face reference: nil [33 times]&#xA;2017-02-14-18:51:01 Auto-saving...done&#xA;2017-02-14-18:51:03 Saving file /Users/gsl/lisp.d/init.el...&#xA;2017-02-14-18:51:06 Wrote /Users/gsl/lisp.d/init.el&#xA;2017-02-14-18:51:09 mwheel-scroll: Beginning of buffer [5 times]&#xA;2017-02-14-18:51:11 Mark set&#xA;2017-02-14-18:51:21 previous-line: Beginning of buffer [10 times]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I searched on EmacsWiki, Reddit and emacs.sx of course, to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of &lt;a href=&quot;https://github.com/lewang/command-log-mode&quot; rel=&quot;noreferrer&quot;&gt;&lt;code&gt;command-log-mode&lt;/code&gt;&lt;/a&gt;, which can be adjusted to log with timestamps, but it is useful only for interactive commands, not all messages, including Emacs' &quot;system&quot; ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, every message logged to the &lt;em&gt;Messages&lt;/em&gt; buffer should be timestamped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one add a timestamp to each entry in Emacs' &lt;em&gt;Messages&lt;/em&gt; buffer, no matter its source?&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="249" LastEditDate="2017-04-14T18:02:10.370" LastActivityDate="2022-09-19T16:32:55.013" Title="How to add a timestamp to each entry in Emacs' *Messages* buffer?" Tags="|buffers|message|logging|" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32151" PostTypeId="1" CreationDate="2017-04-14T17:40:35.127" Score="1" ViewCount="1243" Body="&lt;p&gt;Does anyone know of a Bash linter for the &lt;a href=&quot;https://google.github.io/styleguide/shell.xml&quot; rel=&quot;nofollow noreferrer&quot;&gt;Google shell style guide&lt;/a&gt;? I have been using shellcheck as my linter with flycheck but it doesn't conform to this standard.&lt;/p&gt;&#xA;" OwnerUserId="10211" LastActivityDate="2018-06-03T18:01:17.847" Title="Linter for Google shell style guide?" Tags="|flycheck|bash|style|" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32152" PostTypeId="1" AcceptedAnswerId="32154" CreationDate="2017-04-14T19:44:46.267" Score="1" ViewCount="315" Body="&lt;p&gt;I want to detect line change event (arrow-,arrow- or mouse click) to trigger my function call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below example handled arrow- arrow- but can not handle mouse click or C-n C-p line change event.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun myup(n)&#xA;  (interactive &quot;p&quot;)&#xA;  (previous-line)&#xA;  (showme))&#xA;&#xA;(defun mynext(n)&#xA;  (interactive &quot;p&quot;)&#xA;  (next-line)&#xA;  (showme))&#xA;&#xA;(defun showme()&#xA;  (let ((line (thing-at-point 'line t)))&#xA;    (when (string-match  &quot;\\[\\([0-9a-f]+\\)\\]&quot; line)&#xA;      (setq sha1 (match-string 1 line))&#xA;      (setq bufname &quot;differ&quot;)&#xA;      (when (= (length (window-list)) 1)&#xA;        (split-window-vertically (floor (* 0.2 (window-height))))&#xA;        )&#xA;      (setq buffer (get-buffer-create bufname))&#xA;      (switch-to-buffer-other-window buffer)&#xA;      (erase-buffer)&#xA;      (insert sha1)&#xA;      (goto-char (point-min))&#xA;      (other-window 1))))&#xA;&#xA;(define-key diff-mode-map  (kbd &quot;&amp;lt;down&amp;gt;&quot;) 'mynext)&#xA;(define-key diff-mode-map  (kbd &quot;&amp;lt;up&amp;gt;&quot;) 'myup)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's right way to handle this case?&lt;/p&gt;&#xA;" OwnerUserId="14843" LastEditorUserId="105" LastEditDate="2017-04-15T00:20:06.667" LastActivityDate="2017-04-15T00:20:06.667" Title="elisp - detect line change event to trigger function" Tags="|mouse|motion|events|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32154" PostTypeId="2" ParentId="32152" CreationDate="2017-04-14T20:17:08.247" Score="2" Body="&lt;p&gt;The answer to “I want to detect (…) event” is usually to use the appropriate &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks.html#Hooks&quot; rel=&quot;nofollow noreferrer&quot;&gt;hook&lt;/a&gt;. The manual has a &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Hooks.html#Standard-Hooks&quot; rel=&quot;nofollow noreferrer&quot;&gt;list of standard hooks&lt;/a&gt;. There's no hook that triggers on a line change, so the next thing is to look for a hook that triggers on any motion. &lt;a href=&quot;https://emacs.stackexchange.com/questions/20596/is-there-a-hook-i-can-use-to-run-my-function-when-point-moves&quot;&gt;There's no hook specifically for that either, to you're down to a hook that runs every command&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep track of the current line number in a variable, and run the desired code whenever that value changes. Untested proof-of-concept:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defvar showme-last-position nil)&#xA;(make-variable-buffer-local 'showme-last-line)&#xA;(defun showme-is-on-different-line (marker)&#xA;  &quot;Returns true if MARKER and point are on different lines.&quot;&#xA;  (save-excursion&#xA;    (if (&amp;lt; showme-last-position (point))&#xA;        (progn&#xA;          (beginning-of-line)&#xA;          (&amp;lt; showme-last-position (point)))&#xA;      (end-of-line)&#xA;      (&amp;gt; showme-last-position (point)))))&#xA;(defun showme-if-needed ()&#xA;  ;; Create marker if needed&#xA;  (if (null showme-last-position)&#xA;      (setq showme-last-position (make-marker)))&#xA;  ;; Is marker on a different line from point, or uninitialized?&#xA;  (when (or (null (marker-position showme-last-position))&#xA;            (showme-is-on-different-line showme-last-position))&#xA;      ;; Update marker and run showme&#xA;      (set-marker-position showme-last-position (point))&#xA;      (showme)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that my way of detecting a line change is faster than recomputing the line number — &lt;code&gt;line-number-at-pos&lt;/code&gt; can be slow in a large file.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't reviewed your code, there may be a better trigger than a change in the line number. You may want to preprocess the buffer and add &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Overlays.html#Overlays&quot; rel=&quot;nofollow noreferrer&quot;&gt;overlays&lt;/a&gt;. &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Mode.html#Font-Lock-Mode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Font Lock mode&lt;/a&gt; has facilities for that, and can do the job lazily based on what parts of the buffer get shown so that opening a large file doesn't take forever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I do notice in your code is that the way you return to the original buffer and window is unreliable: &lt;code&gt;other-window&lt;/code&gt; might not do the right thing depending on the window configuration. Whenever you want to move and then return to the original place, use &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/elisp/Excursions.html#index-save_002dexcursion&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;save-excursion&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25" LastActivityDate="2017-04-14T20:17:08.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32155" PostTypeId="1" AcceptedAnswerId="32190" CreationDate="2017-04-14T21:26:30.537" Score="1" ViewCount="1650" Body="&lt;p&gt;I just upgraded from Ubuntu 16.10 to 17.04, and now my Emacs (25.1.1), working fine before, is broken. Here is the error from running &lt;code&gt;emacs --debug-init&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;emacs: error while loading shared libraries: libMagickWand-6.Q16.so.2: cannot open shared object file: No such file or directory&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've seen (older) answers that hit around this issue, but this problem came from a simple Ubuntu upgrade...&lt;/p&gt;&#xA;" OwnerUserId="8349" LastActivityDate="2018-10-09T13:00:03.910" Title="libMagickWand-6.Q16.so.2 . . . No such file or directory" Tags="|install|libraries|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32156" PostTypeId="2" ParentId="31897" CreationDate="2017-04-14T22:03:34.507" Score="5" Body="&lt;p&gt;There is a command line interface to Google Calendar called &lt;a href=&quot;https://github.com/insanum/gcalcli&quot; rel=&quot;noreferrer&quot;&gt;gcalcli&lt;/a&gt;. You can install it using pip:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pip install gcalcli&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to import calendar files, gcalcli requires the vobject library to be installed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pip install vobject&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first time you run gcalcli, it will launch a web browser in order to obtain an oauth token, which it will save in &lt;code&gt;~/.gcalcli_oauth&lt;/code&gt;.  &lt;code&gt;list&lt;/code&gt; is a good command to use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;gcalcli list&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now that &lt;code&gt;gcalcli&lt;/code&gt; is installed, let's configure Emacs to use it.  Add the following entry to your &lt;code&gt;~/.mailcap&lt;/code&gt; file (create it if it doesn't exist):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;text/calendar; /path/to/gcalcli --calendar 'Calendar Name' import %s&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot;Calendar Name&quot; is the name of the calendar you want to import calendar entries into, as listed by &lt;code&gt;gcalcli list&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make Emacs pick up the new entry, type &lt;code&gt;M-x mailcap-parse-mailcaps&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To import a calendar file, move point to the &lt;code&gt;[4. text/calendar; foobar.ics]&lt;/code&gt; part, hit &lt;code&gt;.&lt;/code&gt;, and enter &lt;code&gt;view externally&lt;/code&gt; as the &quot;action&quot;.  Emacs will run &lt;code&gt;gcalcli&lt;/code&gt; and display the output in the message buffer — hopefully &lt;code&gt;New event added: https://....&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11" LastActivityDate="2017-04-14T22:03:34.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32157" PostTypeId="1" AcceptedAnswerId="40542" CreationDate="2017-04-14T23:46:39.073" Score="4" ViewCount="1419" Body="&lt;p&gt;Should I use &lt;code&gt;custom-set-variables&lt;/code&gt; (as opposed to &lt;code&gt;setq&lt;/code&gt;) when setting a variable that returns non-nil for &lt;code&gt;custom-variable-p&lt;/code&gt; but was not defined by &lt;code&gt;defcustom&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;em&gt;echo-keystrokes&lt;/em&gt; is defined in &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/src/keyboard.c#L11380&quot; rel=&quot;nofollow noreferrer&quot;&gt;keyboard.c&lt;/a&gt; via &lt;a href=&quot;https://github.com/emacs-mirror/emacs/blob/master/src/lread.c#L4237&quot; rel=&quot;nofollow noreferrer&quot;&gt;defvar_lisp&lt;/a&gt;, but the following returns non-nil:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(custom-variable-p 'echo-keystrokes)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation for &lt;code&gt;custom-variable-p&lt;/code&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A customizable variable is either (i) a variable whose property list contains a non-nil ‘standard-value’ or ‘custom-autoload’ property, or (ii) an alias for another customizable variable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This leaves me wondering if the conventional advice to prefer &lt;code&gt;custom-set-variables&lt;/code&gt; over &lt;code&gt;setq&lt;/code&gt; when dealing with custom variables (since they may have special setters and/or initialization code) applies to such variables, or whether it's exclusive to variables defined via &lt;code&gt;defcustom&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I should only bother with &lt;code&gt;custom-set-variables&lt;/code&gt; when dealing with those defined by &lt;code&gt;defcustom&lt;/code&gt;, how can I quickly make that determination? I was hoping to use &lt;code&gt;custom-variable-p&lt;/code&gt; to programmatically check which variables I should set with &lt;code&gt;custom-set-variables&lt;/code&gt; instead of &lt;code&gt;setq&lt;/code&gt;, as I'd rather not have to dig through library source code for every variable I set.&lt;/p&gt;&#xA;" OwnerUserId="8528" LastActivityDate="2022-03-13T09:08:42.913" Title="Should &quot;custom&quot; variables defined without defcustom be set via custom-set-variables or setq?" Tags="|variables|defcustom|setq|" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32158" PostTypeId="1" AcceptedAnswerId="32166" CreationDate="2017-04-15T01:43:16.523" Score="3" ViewCount="611" Body="&lt;p&gt;I would like to use Yasnippet to insert the template for a latex inline equation: &lt;code&gt;\( \)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The snippet is defined:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    # -*- Mode: snippet -*-&#xA;# name: inline equation&#xA;# key: ineq&#xA;# --&#xA;\(  \)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But Yasnippet inserts only the parentheses &lt;code&gt;( )&lt;/code&gt; without the backslashes. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="9382" LastEditorUserId="105" LastEditDate="2020-02-18T19:52:23.437" LastActivityDate="2020-02-18T19:52:23.437" Title="Yasnippet including backslash" Tags="|regular-expressions|yasnippet|backslash|" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32159" PostTypeId="1" CreationDate="2017-04-15T02:17:05.590" Score="27" ViewCount="3690" Body="&lt;p&gt;I saw someone on &lt;a href=&quot;https://twitter.com/DtoToole/status/852811364225568769&quot; rel=&quot;noreferrer&quot;&gt;Twitter&lt;/a&gt; posing the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wJp8j.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wJp8j.png&quot; alt=&quot;&amp;quot;How many people around the world use GNU #Emacs? Could it be over a million?&amp;quot;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It struck me as a very interesting question and got me thinking about how large the community actually is!  I came up with two data points:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the &lt;a href=&quot;https://stackoverflow.com/insights/survey/2016&quot;&gt;2016 Stack Overflow Survey&lt;/a&gt;, 5.2% of 46,613 responses (of 56,033 respondents) used Emacs as a &lt;a href=&quot;https://stackoverflow.com/insights/survey/2016#technology-development-environments&quot;&gt;&lt;em&gt;development environment&lt;/em&gt;&lt;/a&gt;.  Stack Overflow indicate that they estimated 46 million people visited SO in January alone.  If the survey respondents were representative of visitors, that would suggest &lt;strong&gt;~2.0 million&lt;/strong&gt; users of this sort visited SO in January 2016 (or at least &lt;a href=&quot;https://twitter.com/mollermara/status/852897178376957952&quot; rel=&quot;noreferrer&quot;&gt;2,425&lt;/a&gt; users ;-).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://stackoverflow.com/insights/survey/2015#tech-editor&quot;&gt;2015&lt;/a&gt; they asked about &lt;a href=&quot;https://stackoverflow.com/insights/survey/2015#tech-editor&quot;&gt;&lt;em&gt;preferred text editor&lt;/em&gt;&lt;/a&gt;.  4.1% of 16,778 resonses (of 26,086 respondents) indicated Emacs or XEmacs.  At the time they estimated 32 million people visited SO monthly.  These numbers suggest that &lt;strong&gt;~840 thousand&lt;/strong&gt; users of this sort were visiting SO in February 2015.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They acknowledge both surveys are:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...biased against devs who don't speak English, or who don't like&#xA;  taking English-language surveys.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(and they likely offer a high estimate for their amount of unique traffic)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other data might shed some light on this question?  Maybe the Debian package popularity contest?&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="262" LastEditDate="2019-11-07T16:17:21.483" LastActivityDate="2022-12-20T02:08:51.177" Title="Number of Emacs users in the world?" Tags="|emacs-history|" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="32160" PostTypeId="1" CreationDate="2017-04-15T04:24:08.977" Score="1" ViewCount="411" Body="&lt;p&gt;How can I match – in, for example, a group of files from a Dired buffer – all files that have one or more blank lines at the end of the file?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specific need that prompts this question is to remove those trailing blank lines, but with a manual prompt; so I want to search and replace. So I'm looking for a match as a separate step, maybe with an Emacs regexp pattern.&lt;/p&gt;&#xA;" OwnerUserId="2506" LastEditorUserId="2506" LastEditDate="2017-04-15T04:58:09.140" LastActivityDate="2017-04-15T05:21:22.697" Title="Match blank lines at end of file" Tags="|dired|regular-expressions|search|whitespace|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32162" PostTypeId="2" ParentId="32160" CreationDate="2017-04-15T05:14:14.327" Score="2" Body="&lt;p&gt;In Dired, &lt;strong&gt;&lt;code&gt;% g&lt;/code&gt;&lt;/strong&gt; marks the files whose contents match a regexp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to just use &lt;code&gt;% g&lt;/code&gt; with this regexp: &lt;strong&gt;&lt;code&gt;^[[:space:]]*\'&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That matches any amount of whitespace (including none) at the beginning of the last line of the buffer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;strong&gt;&lt;code&gt;\'&lt;/code&gt;&lt;/strong&gt; matches the empty string at the end of the buffer.)&lt;/p&gt;&#xA;" OwnerUserId="105" LastEditorUserId="105" LastEditDate="2017-04-15T05:21:22.697" LastActivityDate="2017-04-15T05:21:22.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32164" PostTypeId="1" AcceptedAnswerId="32187" CreationDate="2017-04-15T09:06:14.140" Score="1" ViewCount="754" Body="&lt;p&gt;Zip files have a comment field for files and an archive comment, that you can set activating the &lt;em&gt;--archive-comment&lt;/em&gt; option and display them with the &lt;em&gt;zipnote&lt;/em&gt; command.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any emacs package to edit them?&lt;/p&gt;&#xA;" OwnerUserId="2026" LastActivityDate="2017-04-16T22:27:36.120" Title="Is there any way to view/edit the zip archive comment field" Tags="|archive-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32166" PostTypeId="2" ParentId="32158" CreationDate="2017-04-15T13:14:28.900" Score="4" Body="&lt;p&gt;The &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;backslash&lt;/a&gt; is used in regular expressions to escape individual characters:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For the most part, &lt;code&gt;\&lt;/code&gt; followed by any character matches only that character.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;\(&lt;/code&gt; gives you &lt;code&gt;(&lt;/code&gt; in your output.  To get the backslash in the output, escape it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\\( \\)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-04-15T13:14:28.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32167" PostTypeId="1" CreationDate="2017-04-15T15:29:02.283" Score="0" ViewCount="217" Body="&lt;p&gt;I install (latest) org-mode on emacs 25.1 from&#xA;&lt;a href=&quot;http://orgmode.org/elpa/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://orgmode.org/elpa/&lt;/a&gt; like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(use-package org&#xA;  :ensure org-plus-contrib&#xA;  :defer t)&#xA;&#xA;(require 'ox-md)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I try to export the draft of my book (this is just used as a ready example, any &lt;code&gt;org-mode&lt;/code&gt; file I create suffers the same problem)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://raw.githubusercontent.com/fommil/fp-scala-mortals/master/manuscript/book.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://raw.githubusercontent.com/fommil/fp-scala-mortals/master/manuscript/book.org&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using &lt;code&gt;C-c C-e&lt;/code&gt; and select &lt;code&gt;m m&lt;/code&gt; (Markdown), I get this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Debugger entered--Lisp error: (wrong-type-argument listp #(&quot;2017&quot; 0 4 &#xA;(:parent (#1))))&#xA;    org-element-set-contents(#(&quot;2017&quot; 0 4 (:parent (#0))))&#xA;    apply(org-element-set-contents #(&quot;2017&quot; 0 4 (:parent (#0))) nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I revert back to the version of &lt;code&gt;ox-md&lt;/code&gt; that comes with Emacs 25.1, the file is exported ok.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a bug or have I done something dumb?&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2017-04-15T15:29:02.283" Title="org-mode markdown broken" Tags="|org-mode|markdown|" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32168" PostTypeId="1" CreationDate="2017-04-15T15:47:22.500" Score="2" ViewCount="300" Body="&lt;p&gt;I am trying to unify my &lt;code&gt;org-mode&lt;/code&gt; hotkeys with Workflowy's. In Workflowy, &lt;kbd&gt;C-↓&lt;/kbd&gt; and &lt;kbd&gt;C-↑&lt;/kbd&gt; will expand and collapse hierarchical structure respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to mimic this behavior in &lt;code&gt;org-mode&lt;/code&gt;. I know I can bind &lt;kbd&gt;C-↓&lt;/kbd&gt; to &lt;code&gt;org-cycle&lt;/code&gt;, but I cannot figure out how to reverse the behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to &lt;code&gt;org-cycle&lt;/code&gt; in reverse?&lt;/p&gt;&#xA;" OwnerUserId="594" LastActivityDate="2017-04-15T20:40:42.143" Title="Reverse org-cycle" Tags="|org-mode|" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32169" PostTypeId="2" ParentId="14049" CreationDate="2017-04-15T19:29:51.367" Score="1" Body="&lt;h2&gt;Using smartparens&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Kill&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Use &lt;code&gt;C-M-u&lt;/code&gt; (&lt;code&gt;sp-backward-up-sexp&lt;/code&gt;) to get out of &lt;code&gt;'&lt;/code&gt; delimiters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Use &lt;code&gt;C-0 C-M-k&lt;/code&gt; (&lt;code&gt;0&lt;/code&gt; prefix + &lt;code&gt;sp-kill-sexp&lt;/code&gt;) to kill stuff inside current sexp or &lt;code&gt;C-k&lt;/code&gt; (&lt;code&gt;sp-kill-hybrid-sexp&lt;/code&gt;). The latter only works when &lt;code&gt;smartparens-strict-mode&lt;/code&gt; is enabled and current sexp fits in one line. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ref = open('specific|-file-name')&#xA;// C-M-u&#xA;ref = open(|'specific-file-name')&#xA;// C-k&#xA;ref = open(|)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mark and delete/kill/copy&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Find your way to the beginning of sexp (in this example &lt;code&gt;C-M-u sp-backward-up-sexp&lt;/code&gt; is enough), set mark &lt;code&gt;C-SPC&lt;/code&gt; and go to the end of sexp with &lt;code&gt;sp-end-of-sexp&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Then you can do whatever you wish: &lt;code&gt;C-w&lt;/code&gt; to kill region, &lt;code&gt;M-w&lt;/code&gt; to kill-ring-save (copy) region, &lt;code&gt;backspace&lt;/code&gt; to delete it without cluttering kill ring (only with &lt;code&gt;delete-selection-mode&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ref = open('specific|-file-name')&#xA;// C-M-u&#xA;ref = open(|'specific-file-name')&#xA;// C-SPC - mark is now active&#xA;ref = open(|'specific-file-name')&#xA;// sp-end-of-sexp (my binding: M-e)&#xA;ref = open(&amp;lt;'specific-file-name'|)&#xA;// backspace&#xA;ref = open(|)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mark-inside-sexp function&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;smartparens&lt;/code&gt; package has &lt;code&gt;sp-mark-sexp&lt;/code&gt; function that marks whole next sexp, i.e. delimiters and stuff between them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could use a function like this to throw delimiters out of the selection:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(defun mark-inside-sexp-using-sp ()&#xA;  (interactive)&#xA;  (sp-mark-sexp)&#xA;  (exchange-point-and-mark) (backward-char)&#xA;  (exchange-point-and-mark) (forward-char)&#xA;  (message &quot;MARK INSIDE SEXP (using sp)&quot;))&#xA;&#xA;(global-set-key (kbd &quot;s-SPC&quot;) 'mark-inside-sexp-using-sp)&#xA;;; this is &quot;super&quot; modifier (win key) with space&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Get out of your sexp using &lt;code&gt;C-M-u&lt;/code&gt; repeatedly and fire mark-inside-sexp-using-sp and then decide what to do with active region.&lt;/p&gt;&#xA;" OwnerUserId="15406" LastEditorUserId="15406" LastEditDate="2017-08-28T10:24:23.317" LastActivityDate="2017-08-28T10:24:23.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32170" PostTypeId="2" ParentId="32168" CreationDate="2017-04-15T20:40:42.143" Score="4" Body="&lt;p&gt;The &lt;code&gt;org-cycle&lt;/code&gt; command cycles between different states (folded, show children, show subtree, back to folded) so it isn't quite the same as having separate expand and collapse commands -- you don't need two key bindings since once expanded you can hit tab again to hide everything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to bind separate expand and collapse commands, you might use &lt;code&gt;org-show-subtree&lt;/code&gt; as your expand command, and use &lt;code&gt;outline-hide-subtree&lt;/code&gt; for the inverse operation. Note that those operate on the whole subtree so it's a bit different then &lt;code&gt;org-cycle&lt;/code&gt; which allows you to show just the children before showing the whole tree. I don't think there are equivalent &quot;partial expand, then full expand&quot; and &quot;partial collapse, then full collapse&quot; commands so you might need to write your own based on &lt;code&gt;org-cycle&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="780" LastActivityDate="2017-04-15T20:40:42.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32172" PostTypeId="1" AcceptedAnswerId="32174" CreationDate="2017-04-16T00:57:27.443" Score="0" ViewCount="192" Body="&lt;p&gt;According to the documentation, the following setting enables subscript only in&#xA;the form like ‘a_{b}’.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  (setq org-use-sub-superscripts nil)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, in 'a_b', 'b' is still exported as subscript. How to export '_' as&#xA;underscore?&lt;/p&gt;&#xA;" OwnerUserId="4036" LastActivityDate="2017-04-16T13:19:38.097" Title="org-odt-export subscript bug" Tags="|org-mode|odt|" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32173" PostTypeId="2" ParentId="24691" CreationDate="2017-04-16T05:51:55.533" Score="1" Body="&lt;p&gt;To make the headline active in your agenda, you should add an active date to it. You can add a hook to org-capture to add a date.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(setq org-capture-templates&#xA;      '((&quot;g&quot; &quot;Grocery today&quot; checkitem (file+datetree &quot;~/org/grocery.org&quot;)&#xA;         &quot;[ ] %?&quot;)))&#xA;&#xA;(defun schedule-grocery-hook ()&#xA;  (if (string= (org-capture-get :description)&#xA;               &quot;Grocery today&quot;)     ;Must match the description in the template&#xA;      (org-schedule 0 (format-time-string &quot;%Y-%m-%d&quot;))))&#xA;&#xA;(add-hook 'org-capture-before-finalize-hook 'schedule-grocery-h